semaphor 0.0.0
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/README.md +0 -0
- package/dist/react-semaphor.d.ts +519 -0
- package/dist/react-semaphor.js +51217 -0
- package/dist/react-semaphor.umd.cjs +499 -0
- package/dist/style.css +1 -0
- package/package.json +112 -0
|
@@ -0,0 +1,499 @@
|
|
|
1
|
+
(function(ht,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):(ht=typeof globalThis<"u"?globalThis:ht||self,m(ht["react-semaphor"]={},ht.React,ht.ReactDOM))})(this,function(ht,m,kt){"use strict";var Uue=Object.defineProperty;var Gue=(ht,m,kt)=>m in ht?Uue(ht,m,{enumerable:!0,configurable:!0,writable:!0,value:kt}):ht[m]=kt;var ke=(ht,m,kt)=>(Gue(ht,typeof m!="symbol"?m+"":m,kt),kt),k1=(ht,m,kt)=>{if(!m.has(ht))throw TypeError("Cannot "+kt)};var Z=(ht,m,kt)=>(k1(ht,m,"read from private field"),kt?kt.call(ht):m.get(ht)),ze=(ht,m,kt)=>{if(m.has(ht))throw TypeError("Cannot add the same private member more than once");m instanceof WeakSet?m.add(ht):m.set(ht,kt)},Ie=(ht,m,kt,ks)=>(k1(ht,m,"write to private field"),ks?ks.call(ht,kt):m.set(ht,kt),kt);var Ng=(ht,m,kt,ks)=>({set _(ue){Ie(ht,m,ue,kt)},get _(){return Z(ht,m,ks)}}),xt=(ht,m,kt)=>(k1(ht,m,"access private method"),kt);var _a,ds,Gl,uA,Yl,fs,Kl,dA,Sa,fA,Xl,Ql,ri,hs,ii,Mn,cd,Ca,Zl,Lg,Si,Ro,hA,Yi,pA,Ki,ud,jr,Jl,Xi,Os,gA,oi,dd,Ea,mA,_n,ps,gs,ec,tc,ms,nc,rc,vA,gr,Zt,fd,er,Pa,ic,Qi,hd,oc,sc,Oa,ka,vs,ac,Ma,Hd,pd,M1,gd,D1,md,T1,vd,A1,bd,I1,yd,R1,xd,N1,Gp,WI,bA,Yp,vx;function ks(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=ks(m),qI=ks(kt);var No=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Sc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function $g(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 Fg={exports:{}},Cc={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.development.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var L1;function UI(){return L1||(L1=1,process.env.NODE_ENV!=="production"&&function(){var e=m,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),a=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),v=Symbol.iterator,y="@@iterator";function x(M){if(M===null||typeof M!="object")return null;var G=v&&M[v]||M[y];return typeof G=="function"?G:null}var w=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function _(M){{for(var G=arguments.length,ae=new Array(G>1?G-1:0),Se=1;Se<G;Se++)ae[Se-1]=arguments[Se];C("error",M,ae)}}function C(M,G,ae){{var Se=w.ReactDebugCurrentFrame,Ne=Se.getStackAddendum();Ne!==""&&(G+="%s",ae=ae.concat([Ne]));var je=ae.map(function(Ae){return String(Ae)});je.unshift("Warning: "+G),Function.prototype.apply.call(console[M],console,je)}}var O=!1,P=!1,k=!1,A=!1,L=!1,F;F=Symbol.for("react.module.reference");function B(M){return!!(typeof M=="string"||typeof M=="function"||M===r||M===o||L||M===i||M===c||M===d||A||M===p||O||P||k||typeof M=="object"&&M!==null&&(M.$$typeof===g||M.$$typeof===f||M.$$typeof===s||M.$$typeof===a||M.$$typeof===l||M.$$typeof===F||M.getModuleId!==void 0))}function H(M,G,ae){var Se=M.displayName;if(Se)return Se;var Ne=G.displayName||G.name||"";return Ne!==""?ae+"("+Ne+")":ae}function V(M){return M.displayName||"Context"}function K(M){if(M==null)return null;if(typeof M.tag=="number"&&_("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof M=="function")return M.displayName||M.name||null;if(typeof M=="string")return M;switch(M){case r:return"Fragment";case n:return"Portal";case o:return"Profiler";case i:return"StrictMode";case c:return"Suspense";case d:return"SuspenseList"}if(typeof M=="object")switch(M.$$typeof){case a:var G=M;return V(G)+".Consumer";case s:var ae=M;return V(ae._context)+".Provider";case l:return H(M,M.render,"ForwardRef");case f:var Se=M.displayName||null;return Se!==null?Se:K(M.type)||"Memo";case g:{var Ne=M,je=Ne._payload,Ae=Ne._init;try{return K(Ae(je))}catch{return null}}}return null}var Y=Object.assign,$=0,X,j,ne,se,D,q,re;function R(){}R.__reactDisabledLog=!0;function te(){{if($===0){X=console.log,j=console.info,ne=console.warn,se=console.error,D=console.group,q=console.groupCollapsed,re=console.groupEnd;var M={configurable:!0,enumerable:!0,value:R,writable:!0};Object.defineProperties(console,{info:M,log:M,warn:M,error:M,group:M,groupCollapsed:M,groupEnd:M})}$++}}function ge(){{if($--,$===0){var M={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:Y({},M,{value:X}),info:Y({},M,{value:j}),warn:Y({},M,{value:ne}),error:Y({},M,{value:se}),group:Y({},M,{value:D}),groupCollapsed:Y({},M,{value:q}),groupEnd:Y({},M,{value:re})})}$<0&&_("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var pe=w.ReactCurrentDispatcher,de;function ie(M,G,ae){{if(de===void 0)try{throw Error()}catch(Ne){var Se=Ne.stack.trim().match(/\n( *(at )?)/);de=Se&&Se[1]||""}return`
|
|
10
|
+
`+de+M}}var J=!1,W;{var be=typeof WeakMap=="function"?WeakMap:Map;W=new be}function oe(M,G){if(!M||J)return"";{var ae=W.get(M);if(ae!==void 0)return ae}var Se;J=!0;var Ne=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var je;je=pe.current,pe.current=null,te();try{if(G){var Ae=function(){throw Error()};if(Object.defineProperty(Ae.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ae,[])}catch(nn){Se=nn}Reflect.construct(M,[],Ae)}else{try{Ae.call()}catch(nn){Se=nn}M.call(Ae.prototype)}}else{try{throw Error()}catch(nn){Se=nn}M()}}catch(nn){if(nn&&Se&&typeof nn.stack=="string"){for(var Me=nn.stack.split(`
|
|
11
|
+
`),Ot=Se.stack.split(`
|
|
12
|
+
`),Ze=Me.length-1,nt=Ot.length-1;Ze>=1&&nt>=0&&Me[Ze]!==Ot[nt];)nt--;for(;Ze>=1&&nt>=0;Ze--,nt--)if(Me[Ze]!==Ot[nt]){if(Ze!==1||nt!==1)do if(Ze--,nt--,nt<0||Me[Ze]!==Ot[nt]){var zt=`
|
|
13
|
+
`+Me[Ze].replace(" at new "," at ");return M.displayName&&zt.includes("<anonymous>")&&(zt=zt.replace("<anonymous>",M.displayName)),typeof M=="function"&&W.set(M,zt),zt}while(Ze>=1&&nt>=0);break}}}finally{J=!1,pe.current=je,ge(),Error.prepareStackTrace=Ne}var Tn=M?M.displayName||M.name:"",ja=Tn?ie(Tn):"";return typeof M=="function"&&W.set(M,ja),ja}function Te(M,G,ae){return oe(M,!1)}function Fe(M){var G=M.prototype;return!!(G&&G.isReactComponent)}function Ve(M,G,ae){if(M==null)return"";if(typeof M=="function")return oe(M,Fe(M));if(typeof M=="string")return ie(M);switch(M){case c:return ie("Suspense");case d:return ie("SuspenseList")}if(typeof M=="object")switch(M.$$typeof){case l:return Te(M.render);case f:return Ve(M.type,G,ae);case g:{var Se=M,Ne=Se._payload,je=Se._init;try{return Ve(je(Ne),G,ae)}catch{}}}return""}var Ke=Object.prototype.hasOwnProperty,St={},vt=w.ReactDebugCurrentFrame;function bt(M){if(M){var G=M._owner,ae=Ve(M.type,M._source,G?G.type:null);vt.setExtraStackFrame(ae)}else vt.setExtraStackFrame(null)}function tn(M,G,ae,Se,Ne){{var je=Function.call.bind(Ke);for(var Ae in M)if(je(M,Ae)){var Me=void 0;try{if(typeof M[Ae]!="function"){var Ot=Error((Se||"React class")+": "+ae+" type `"+Ae+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof M[Ae]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Ot.name="Invariant Violation",Ot}Me=M[Ae](G,Ae,Se,ae,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Ze){Me=Ze}Me&&!(Me instanceof Error)&&(bt(Ne),_("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",Se||"React class",ae,Ae,typeof Me),bt(null)),Me instanceof Error&&!(Me.message in St)&&(St[Me.message]=!0,bt(Ne),_("Failed %s type: %s",ae,Me.message),bt(null))}}}var Jt=Array.isArray;function Dn(M){return Jt(M)}function fn(M){{var G=typeof Symbol=="function"&&Symbol.toStringTag,ae=G&&M[Symbol.toStringTag]||M.constructor.name||"Object";return ae}}function Da(M){try{return fe(M),!1}catch{return!0}}function fe(M){return""+M}function Pe(M){if(Da(M))return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",fn(M)),fe(M)}var Le=w.ReactCurrentOwner,Xe={key:!0,ref:!0,__self:!0,__source:!0},yt,hn,Sn;Sn={};function Fn(M){if(Ke.call(M,"ref")){var G=Object.getOwnPropertyDescriptor(M,"ref").get;if(G&&G.isReactWarning)return!1}return M.ref!==void 0}function zr(M){if(Ke.call(M,"key")){var G=Object.getOwnPropertyDescriptor(M,"key").get;if(G&&G.isReactWarning)return!1}return M.key!==void 0}function Br(M,G){if(typeof M.ref=="string"&&Le.current&&G&&Le.current.stateNode!==G){var ae=K(Le.current.type);Sn[ae]||(_('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',K(Le.current.type),M.ref),Sn[ae]=!0)}}function pn(M,G){{var ae=function(){yt||(yt=!0,_("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",G))};ae.isReactWarning=!0,Object.defineProperty(M,"key",{get:ae,configurable:!0})}}function mr(M,G){{var ae=function(){hn||(hn=!0,_("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",G))};ae.isReactWarning=!0,Object.defineProperty(M,"ref",{get:ae,configurable:!0})}}var jn=function(M,G,ae,Se,Ne,je,Ae){var Me={$$typeof:t,type:M,key:G,ref:ae,props:Ae,_owner:je};return Me._store={},Object.defineProperty(Me._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(Me,"_self",{configurable:!1,enumerable:!1,writable:!1,value:Se}),Object.defineProperty(Me,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Ne}),Object.freeze&&(Object.freeze(Me.props),Object.freeze(Me)),Me};function wd(M,G,ae,Se,Ne){{var je,Ae={},Me=null,Ot=null;ae!==void 0&&(Pe(ae),Me=""+ae),zr(G)&&(Pe(G.key),Me=""+G.key),Fn(G)&&(Ot=G.ref,Br(G,Ne));for(je in G)Ke.call(G,je)&&!Xe.hasOwnProperty(je)&&(Ae[je]=G[je]);if(M&&M.defaultProps){var Ze=M.defaultProps;for(je in Ze)Ae[je]===void 0&&(Ae[je]=Ze[je])}if(Me||Ot){var nt=typeof M=="function"?M.displayName||M.name||"Unknown":M;Me&&pn(Ae,nt),Ot&&mr(Ae,nt)}return jn(M,Me,Ot,Ne,Se,Le.current,Ae)}}var So=w.ReactCurrentOwner,Ta=w.ReactDebugCurrentFrame;function Yn(M){if(M){var G=M._owner,ae=Ve(M.type,M._source,G?G.type:null);Ta.setExtraStackFrame(ae)}else Ta.setExtraStackFrame(null)}var Zi;Zi=!1;function Co(M){return typeof M=="object"&&M!==null&&M.$$typeof===t}function Aa(){{if(So.current){var M=K(So.current.type);if(M)return`
|
|
14
|
+
|
|
15
|
+
Check the render method of \``+M+"`."}return""}}function _d(M){{if(M!==void 0){var G=M.fileName.replace(/^.*[\\\/]/,""),ae=M.lineNumber;return`
|
|
16
|
+
|
|
17
|
+
Check your code at `+G+":"+ae+"."}return""}}var Ia={};function lc(M){{var G=Aa();if(!G){var ae=typeof M=="string"?M:M.displayName||M.name;ae&&(G=`
|
|
18
|
+
|
|
19
|
+
Check the top-level render call using <`+ae+">.")}return G}}function Ra(M,G){{if(!M._store||M._store.validated||M.key!=null)return;M._store.validated=!0;var ae=lc(G);if(Ia[ae])return;Ia[ae]=!0;var Se="";M&&M._owner&&M._owner!==So.current&&(Se=" It was passed a child from "+K(M._owner.type)+"."),Yn(M),_('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',ae,Se),Yn(null)}}function Na(M,G){{if(typeof M!="object")return;if(Dn(M))for(var ae=0;ae<M.length;ae++){var Se=M[ae];Co(Se)&&Ra(Se,G)}else if(Co(M))M._store&&(M._store.validated=!0);else if(M){var Ne=x(M);if(typeof Ne=="function"&&Ne!==M.entries)for(var je=Ne.call(M),Ae;!(Ae=je.next()).done;)Co(Ae.value)&&Ra(Ae.value,G)}}}function Sd(M){{var G=M.type;if(G==null||typeof G=="string")return;var ae;if(typeof G=="function")ae=G.propTypes;else if(typeof G=="object"&&(G.$$typeof===l||G.$$typeof===f))ae=G.propTypes;else return;if(ae){var Se=K(G);tn(ae,M.props,"prop",Se,M)}else if(G.PropTypes!==void 0&&!Zi){Zi=!0;var Ne=K(G);_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Ne||"Unknown")}typeof G.getDefaultProps=="function"&&!G.getDefaultProps.isReactClassApproved&&_("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function La(M){{for(var G=Object.keys(M.props),ae=0;ae<G.length;ae++){var Se=G[ae];if(Se!=="children"&&Se!=="key"){Yn(M),_("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Se),Yn(null);break}}M.ref!==null&&(Yn(M),_("Invalid attribute `ref` supplied to `React.Fragment`."),Yn(null))}}function $a(M,G,ae,Se,Ne,je){{var Ae=B(M);if(!Ae){var Me="";(M===void 0||typeof M=="object"&&M!==null&&Object.keys(M).length===0)&&(Me+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Ot=_d(Ne);Ot?Me+=Ot:Me+=Aa();var Ze;M===null?Ze="null":Dn(M)?Ze="array":M!==void 0&&M.$$typeof===t?(Ze="<"+(K(M.type)||"Unknown")+" />",Me=" Did you accidentally export a JSX literal instead of a component?"):Ze=typeof M,_("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Ze,Me)}var nt=wd(M,G,ae,Ne,je);if(nt==null)return nt;if(Ae){var zt=G.children;if(zt!==void 0)if(Se)if(Dn(zt)){for(var Tn=0;Tn<zt.length;Tn++)Na(zt[Tn],M);Object.freeze&&Object.freeze(zt)}else _("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Na(zt,M)}return M===r?La(nt):Sd(nt),nt}}function Fa(M,G,ae){return $a(M,G,ae,!0)}function Cd(M,G,ae){return $a(M,G,ae,!1)}var Ed=Cd,Pd=Fa;Cc.Fragment=r,Cc.jsx=Ed,Cc.jsxs=Pd}()),Cc}var Ec={};/**
|
|
20
|
+
* @license React
|
|
21
|
+
* react-jsx-runtime.production.min.js
|
|
22
|
+
*
|
|
23
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
24
|
+
*
|
|
25
|
+
* This source code is licensed under the MIT license found in the
|
|
26
|
+
* LICENSE file in the root directory of this source tree.
|
|
27
|
+
*/var $1;function GI(){if($1)return Ec;$1=1;var e=m,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(a,l,c){var d,f={},g=null,p=null;c!==void 0&&(g=""+c),l.key!==void 0&&(g=""+l.key),l.ref!==void 0&&(p=l.ref);for(d in l)r.call(l,d)&&!o.hasOwnProperty(d)&&(f[d]=l[d]);if(a&&a.defaultProps)for(d in l=a.defaultProps,l)f[d]===void 0&&(f[d]=l[d]);return{$$typeof:t,type:a,key:g,ref:p,props:f,_owner:i.current}}return Ec.Fragment=n,Ec.jsx=s,Ec.jsxs=s,Ec}process.env.NODE_ENV==="production"?Fg.exports=GI():Fg.exports=UI();var S=Fg.exports;function F1(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=F1(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function Vd(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=F1(e))&&(r&&(r+=" "),r+=t);return r}const YI=Object.freeze(Object.defineProperty({__proto__:null,clsx:Vd,default:Vd},Symbol.toStringTag,{value:"Module"})),jg="-";function KI(e){const t=QI(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;function i(s){const a=s.split(jg);return a[0]===""&&a.length!==1&&a.shift(),j1(a,t)||XI(s)}function o(s,a){const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}return{getClassGroupId:i,getConflictingClassGroupIds:o}}function j1(e,t){var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?j1(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const o=e.join(jg);return(s=t.validators.find(({validator:a})=>a(o)))==null?void 0:s.classGroupId}const z1=/^\[(.+)\]$/;function XI(e){if(z1.test(e)){const t=z1.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function QI(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return JI(Object.entries(e.classGroups),n).forEach(([o,s])=>{zg(s,r,o,t)}),r}function zg(e,t,n,r){e.forEach(i=>{if(typeof i=="string"){const o=i===""?t:B1(t,i);o.classGroupId=n;return}if(typeof i=="function"){if(ZI(i)){zg(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([o,s])=>{zg(s,B1(t,o),n,r)})})}function B1(e,t){let n=e;return t.split(jg).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function ZI(e){return e.isThemeGetter}function JI(e,t){return t?e.map(([n,r])=>{const i=r.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([s,a])=>[t+s,a])):o);return[n,i]}):e}function eR(e){if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;function i(o,s){n.set(o,s),t++,t>e&&(t=0,r=n,n=new Map)}return{get(o){let s=n.get(o);if(s!==void 0)return s;if((s=r.get(o))!==void 0)return i(o,s),s},set(o,s){n.has(o)?n.set(o,s):i(o,s)}}}const H1="!";function tR(e){const t=e.separator,n=t.length===1,r=t[0],i=t.length;return function(s){const a=[];let l=0,c=0,d;for(let y=0;y<s.length;y++){let x=s[y];if(l===0){if(x===r&&(n||s.slice(y,y+i)===t)){a.push(s.slice(c,y)),c=y+i;continue}if(x==="/"){d=y;continue}}x==="["?l++:x==="]"&&l--}const f=a.length===0?s:s.substring(c),g=f.startsWith(H1),p=g?f.substring(1):f,v=d&&d>c?d-c:void 0;return{modifiers:a,hasImportantModifier:g,baseClassName:p,maybePostfixModifierPosition:v}}}function nR(e){if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t}function rR(e){return{cache:eR(e.cacheSize),splitModifiers:tR(e),...KI(e)}}const iR=/\s+/;function oR(e,t){const{splitModifiers:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,o=new Set;return e.trim().split(iR).map(s=>{const{modifiers:a,hasImportantModifier:l,baseClassName:c,maybePostfixModifierPosition:d}=n(s);let f=r(d?c.substring(0,d):c),g=!!d;if(!f){if(!d)return{isTailwindClass:!1,originalClassName:s};if(f=r(c),!f)return{isTailwindClass:!1,originalClassName:s};g=!1}const p=nR(a).join(":");return{isTailwindClass:!0,modifierId:l?p+H1:p,classGroupId:f,originalClassName:s,hasPostfixModifier:g}}).reverse().filter(s=>{if(!s.isTailwindClass)return!0;const{modifierId:a,classGroupId:l,hasPostfixModifier:c}=s,d=a+l;return o.has(d)?!1:(o.add(d),i(l,c).forEach(f=>o.add(a+f)),!0)}).reverse().map(s=>s.originalClassName).join(" ")}function sR(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=V1(t))&&(r&&(r+=" "),r+=n);return r}function V1(e){if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=V1(e[r]))&&(n&&(n+=" "),n+=t);return n}function aR(e,...t){let n,r,i,o=s;function s(l){const c=t.reduce((d,f)=>f(d),e());return n=rR(c),r=n.cache.get,i=n.cache.set,o=a,a(l)}function a(l){const c=r(l);if(c)return c;const d=oR(l,n);return i(l,d),d}return function(){return o(sR.apply(null,arguments))}}function Ut(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const W1=/^\[(?:([a-z-]+):)?(.+)\]$/i,lR=/^\d+\/\d+$/,cR=new Set(["px","full","screen"]),uR=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,dR=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,fR=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,hR=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function pi(e){return Ms(e)||cR.has(e)||lR.test(e)}function Lo(e){return Ka(e,"length",wR)}function Ms(e){return!!e&&!Number.isNaN(Number(e))}function Wd(e){return Ka(e,"number",Ms)}function Pc(e){return!!e&&Number.isInteger(Number(e))}function pR(e){return e.endsWith("%")&&Ms(e.slice(0,-1))}function lt(e){return W1.test(e)}function $o(e){return uR.test(e)}const gR=new Set(["length","size","percentage"]);function mR(e){return Ka(e,gR,q1)}function vR(e){return Ka(e,"position",q1)}const bR=new Set(["image","url"]);function yR(e){return Ka(e,bR,SR)}function xR(e){return Ka(e,"",_R)}function Oc(){return!0}function Ka(e,t,n){const r=W1.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function wR(e){return dR.test(e)}function q1(){return!1}function _R(e){return fR.test(e)}function SR(e){return hR.test(e)}function CR(){const e=Ut("colors"),t=Ut("spacing"),n=Ut("blur"),r=Ut("brightness"),i=Ut("borderColor"),o=Ut("borderRadius"),s=Ut("borderSpacing"),a=Ut("borderWidth"),l=Ut("contrast"),c=Ut("grayscale"),d=Ut("hueRotate"),f=Ut("invert"),g=Ut("gap"),p=Ut("gradientColorStops"),v=Ut("gradientColorStopPositions"),y=Ut("inset"),x=Ut("margin"),w=Ut("opacity"),_=Ut("padding"),C=Ut("saturate"),O=Ut("scale"),P=Ut("sepia"),k=Ut("skew"),A=Ut("space"),L=Ut("translate"),F=()=>["auto","contain","none"],B=()=>["auto","hidden","clip","visible","scroll"],H=()=>["auto",lt,t],V=()=>[lt,t],K=()=>["",pi,Lo],Y=()=>["auto",Ms,lt],$=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],X=()=>["solid","dashed","dotted","double","none"],j=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],ne=()=>["start","end","center","between","around","evenly","stretch"],se=()=>["","0",lt],D=()=>["auto","avoid","all","avoid-page","page","left","right","column"],q=()=>[Ms,Wd],re=()=>[Ms,lt];return{cacheSize:500,separator:":",theme:{colors:[Oc],spacing:[pi,Lo],blur:["none","",$o,lt],brightness:q(),borderColor:[e],borderRadius:["none","","full",$o,lt],borderSpacing:V(),borderWidth:K(),contrast:q(),grayscale:se(),hueRotate:re(),invert:se(),gap:V(),gradientColorStops:[e],gradientColorStopPositions:[pR,Lo],inset:H(),margin:H(),opacity:q(),padding:V(),saturate:q(),scale:q(),sepia:se(),skew:re(),space:V(),translate:V()},classGroups:{aspect:[{aspect:["auto","square","video",lt]}],container:["container"],columns:[{columns:[$o]}],"break-after":[{"break-after":D()}],"break-before":[{"break-before":D()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none"]}],clear:[{clear:["left","right","both","none"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...$(),lt]}],overflow:[{overflow:B()}],"overflow-x":[{"overflow-x":B()}],"overflow-y":[{"overflow-y":B()}],overscroll:[{overscroll:F()}],"overscroll-x":[{"overscroll-x":F()}],"overscroll-y":[{"overscroll-y":F()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Pc,lt]}],basis:[{basis:H()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",lt]}],grow:[{grow:se()}],shrink:[{shrink:se()}],order:[{order:["first","last","none",Pc,lt]}],"grid-cols":[{"grid-cols":[Oc]}],"col-start-end":[{col:["auto",{span:["full",Pc,lt]},lt]}],"col-start":[{"col-start":Y()}],"col-end":[{"col-end":Y()}],"grid-rows":[{"grid-rows":[Oc]}],"row-start-end":[{row:["auto",{span:[Pc,lt]},lt]}],"row-start":[{"row-start":Y()}],"row-end":[{"row-end":Y()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",lt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",lt]}],gap:[{gap:[g]}],"gap-x":[{"gap-x":[g]}],"gap-y":[{"gap-y":[g]}],"justify-content":[{justify:["normal",...ne()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ne(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ne(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[_]}],px:[{px:[_]}],py:[{py:[_]}],ps:[{ps:[_]}],pe:[{pe:[_]}],pt:[{pt:[_]}],pr:[{pr:[_]}],pb:[{pb:[_]}],pl:[{pl:[_]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[A]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[A]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit",lt,t]}],"min-w":[{"min-w":["min","max","fit",lt,pi]}],"max-w":[{"max-w":["0","none","full","min","max","fit","prose",{screen:[$o]},$o,lt]}],h:[{h:[lt,t,"auto","min","max","fit"]}],"min-h":[{"min-h":["min","max","fit",pi,lt]}],"max-h":[{"max-h":[lt,t,"min","max","fit"]}],"font-size":[{text:["base",$o,Lo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Wd]}],"font-family":[{font:[Oc]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",lt]}],"line-clamp":[{"line-clamp":["none",Ms,Wd]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",pi,lt]}],"list-image":[{"list-image":["none",lt]}],"list-style-type":[{list:["none","disc","decimal",lt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[w]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[w]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...X(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",pi,Lo]}],"underline-offset":[{"underline-offset":["auto",pi,lt]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],indent:[{indent:V()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",lt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",lt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[w]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...$(),vR]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",mR]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},yR]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[w]}],"border-style":[{border:[...X(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[w]}],"divide-style":[{divide:X()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...X()]}],"outline-offset":[{"outline-offset":[pi,lt]}],"outline-w":[{outline:[pi,Lo]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:K()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[pi,Lo]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",$o,xR]}],"shadow-color":[{shadow:[Oc]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":j()}],"bg-blend":[{"bg-blend":j()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",$o,lt]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[C]}],sepia:[{sepia:[P]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[C]}],"backdrop-sepia":[{"backdrop-sepia":[P]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",lt]}],duration:[{duration:re()}],ease:[{ease:["linear","in","out","in-out",lt]}],delay:[{delay:re()}],animate:[{animate:["none","spin","ping","pulse","bounce",lt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[O]}],"scale-x":[{"scale-x":[O]}],"scale-y":[{"scale-y":[O]}],rotate:[{rotate:[Pc,lt]}],"translate-x":[{"translate-x":[L]}],"translate-y":[{"translate-y":[L]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",lt]}],accent:[{accent:["auto",e]}],appearance:["appearance-none"],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",lt]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":V()}],"scroll-mx":[{"scroll-mx":V()}],"scroll-my":[{"scroll-my":V()}],"scroll-ms":[{"scroll-ms":V()}],"scroll-me":[{"scroll-me":V()}],"scroll-mt":[{"scroll-mt":V()}],"scroll-mr":[{"scroll-mr":V()}],"scroll-mb":[{"scroll-mb":V()}],"scroll-ml":[{"scroll-ml":V()}],"scroll-p":[{"scroll-p":V()}],"scroll-px":[{"scroll-px":V()}],"scroll-py":[{"scroll-py":V()}],"scroll-ps":[{"scroll-ps":V()}],"scroll-pe":[{"scroll-pe":V()}],"scroll-pt":[{"scroll-pt":V()}],"scroll-pr":[{"scroll-pr":V()}],"scroll-pb":[{"scroll-pb":V()}],"scroll-pl":[{"scroll-pl":V()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",lt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[pi,Lo,Wd]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}const ER=aR(CR);class PR extends Error{}PR.prototype.name="InvalidTokenError";function Oe(...e){return ER(Vd(e))}async function Xa(e,t,n={}){try{const r=new URLSearchParams(n).toString(),i=`${e}?${r}`,o=await fetch(i,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}});if(!o.ok){const a=await o.json();throw new Error((a==null?void 0:a.error)||`HTTP error! status: ${o.status}`)}return await o.json()}catch(r){throw console.error("Error during fetch:",r),r}}async function Ds(e,t,n={}){try{const r=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify(n)});return r.ok?await r.json():r.json().then(o=>{throw console.log(o.detail||"Unknown error occurred"),new Error((o==null?void 0:o.error)||`HTTP error! status: ${r.status}`)})}catch(r){throw console.error("Error during fetch:",r),r}}function OR(e){var t;if(navigator.clipboard&&e.current)navigator.clipboard.writeText(e.current.innerText).then(()=>console.log("Content copied to clipboard")).catch(n=>console.error("Failed to copy: ",n));else{const n=document.createElement("textarea");n.value=((t=e==null?void 0:e.current)==null?void 0:t.innerText)??"",document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n),console.log("Content copied to clipboard")}}var kR={VITE_SEMAPHOR_API:"https://semaphor.cloud/api/v1",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const U1=e=>{let t;const n=new Set,r=(l,c)=>{const d=typeof l=="function"?l(t):l;if(!Object.is(d,t)){const f=t;t=c??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(g=>g(t,f))}},i=()=>t,a={setState:r,getState:i,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{(kR?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return t=e(r,i,a),a},MR=e=>e?U1(e):U1;var Bg={exports:{}},Hg={},qd={exports:{}},Vg={};/**
|
|
28
|
+
* @license React
|
|
29
|
+
* use-sync-external-store-shim.development.js
|
|
30
|
+
*
|
|
31
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
32
|
+
*
|
|
33
|
+
* This source code is licensed under the MIT license found in the
|
|
34
|
+
* LICENSE file in the root directory of this source tree.
|
|
35
|
+
*/var G1;function DR(){return G1||(G1=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=m,t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(C){{for(var O=arguments.length,P=new Array(O>1?O-1:0),k=1;k<O;k++)P[k-1]=arguments[k];r("error",C,P)}}function r(C,O,P){{var k=t.ReactDebugCurrentFrame,A=k.getStackAddendum();A!==""&&(O+="%s",P=P.concat([A]));var L=P.map(function(F){return String(F)});L.unshift("Warning: "+O),Function.prototype.apply.call(console[C],console,L)}}function i(C,O){return C===O&&(C!==0||1/C===1/O)||C!==C&&O!==O}var o=typeof Object.is=="function"?Object.is:i,s=e.useState,a=e.useEffect,l=e.useLayoutEffect,c=e.useDebugValue,d=!1,f=!1;function g(C,O,P){d||e.startTransition!==void 0&&(d=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var k=O();if(!f){var A=O();o(k,A)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}var L=s({inst:{value:k,getSnapshot:O}}),F=L[0].inst,B=L[1];return l(function(){F.value=k,F.getSnapshot=O,p(F)&&B({inst:F})},[C,k,O]),a(function(){p(F)&&B({inst:F});var H=function(){p(F)&&B({inst:F})};return C(H)},[C]),c(k),k}function p(C){var O=C.getSnapshot,P=C.value;try{var k=O();return!o(P,k)}catch{return!0}}function v(C,O,P){return O()}var y=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",x=!y,w=x?v:g,_=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:w;Vg.useSyncExternalStore=_,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Vg}var Wg={};/**
|
|
36
|
+
* @license React
|
|
37
|
+
* use-sync-external-store-shim.production.min.js
|
|
38
|
+
*
|
|
39
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
40
|
+
*
|
|
41
|
+
* This source code is licensed under the MIT license found in the
|
|
42
|
+
* LICENSE file in the root directory of this source tree.
|
|
43
|
+
*/var Y1;function TR(){if(Y1)return Wg;Y1=1;var e=m;function t(f,g){return f===g&&(f!==0||1/f===1/g)||f!==f&&g!==g}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,s=e.useDebugValue;function a(f,g){var p=g(),v=r({inst:{value:p,getSnapshot:g}}),y=v[0].inst,x=v[1];return o(function(){y.value=p,y.getSnapshot=g,l(y)&&x({inst:y})},[f,p,g]),i(function(){return l(y)&&x({inst:y}),f(function(){l(y)&&x({inst:y})})},[f]),s(p),p}function l(f){var g=f.getSnapshot;f=f.value;try{var p=g();return!n(f,p)}catch{return!0}}function c(f,g){return g()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return Wg.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,Wg}var K1;function X1(){return K1||(K1=1,process.env.NODE_ENV==="production"?qd.exports=TR():qd.exports=DR()),qd.exports}/**
|
|
44
|
+
* @license React
|
|
45
|
+
* use-sync-external-store-shim/with-selector.development.js
|
|
46
|
+
*
|
|
47
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
48
|
+
*
|
|
49
|
+
* This source code is licensed under the MIT license found in the
|
|
50
|
+
* LICENSE file in the root directory of this source tree.
|
|
51
|
+
*/var Q1;function AR(){return Q1||(Q1=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=m,t=X1();function n(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;function c(d,f,g,p,v){var y=o(null),x;y.current===null?(x={hasValue:!1,value:null},y.current=x):x=y.current;var w=a(function(){var P=!1,k,A,L=function(V){if(!P){P=!0,k=V;var K=p(V);if(v!==void 0&&x.hasValue){var Y=x.value;if(v(Y,K))return A=Y,Y}return A=K,K}var $=k,X=A;if(r($,V))return X;var j=p(V);return v!==void 0&&v(X,j)?X:(k=V,A=j,j)},F=g===void 0?null:g,B=function(){return L(f())},H=F===null?void 0:function(){return L(F())};return[B,H]},[f,g,p,v]),_=w[0],C=w[1],O=i(d,_,C);return s(function(){x.hasValue=!0,x.value=O},[O]),l(O),O}Hg.useSyncExternalStoreWithSelector=c,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Hg}var qg={};/**
|
|
52
|
+
* @license React
|
|
53
|
+
* use-sync-external-store-shim/with-selector.production.min.js
|
|
54
|
+
*
|
|
55
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
56
|
+
*
|
|
57
|
+
* This source code is licensed under the MIT license found in the
|
|
58
|
+
* LICENSE file in the root directory of this source tree.
|
|
59
|
+
*/var Z1;function IR(){if(Z1)return qg;Z1=1;var e=m,t=X1();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 qg.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(!_){if(_=!0,C=k,k=g(k),p!==void 0&&y.hasValue){var A=y.value;if(p(A,k))return O=A}return O=k}if(A=O,r(C,k))return A;var L=g(k);return p!==void 0&&p(A,L)?A:(C=k,O=L)}var _=!1,C,O,P=f===void 0?null:f;return[function(){return w(d())},P===null?void 0:function(){return w(P())}]},[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},qg}process.env.NODE_ENV==="production"?Bg.exports=IR():Bg.exports=AR();var RR=Bg.exports;const NR=Sc(RR);var J1={VITE_SEMAPHOR_API:"https://semaphor.cloud/api/v1",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{useDebugValue:LR}=m,{useSyncExternalStoreWithSelector:$R}=NR;let ew=!1;function FR(e,t=e.getState,n){(J1?"production":void 0)!=="production"&&n&&!ew&&(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"),ew=!0);const r=$R(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return LR(r),r}const tw=e=>{(J1?"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"?MR(e):e,n=(r,i)=>FR(t,r,i);return Object.assign(n,t),n},nw=e=>e?tw(e):tw;var rw=Symbol.for("immer-nothing"),iw=Symbol.for("immer-draftable"),wr=Symbol.for("immer-state"),jR=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=jR[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 Qa=Object.getPrototypeOf;function Za(e){return!!e&&!!e[wr]}function Ts(e){var t;return e?ow(e)||Array.isArray(e)||!!e[iw]||!!((t=e.constructor)!=null&&t[iw])||Gd(e)||Yd(e):!1}var zR=Object.prototype.constructor.toString();function ow(e){if(!e||typeof e!="object")return!1;const t=Qa(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)===zR}function kc(e,t){Ud(e)===0?Object.entries(e).forEach(([n,r])=>{t(n,r,e)}):e.forEach((n,r)=>t(r,n,e))}function Ud(e){const t=e[wr];return t?t.type_:Array.isArray(e)?1:Gd(e)?2:Yd(e)?3:0}function Ug(e,t){return Ud(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function sw(e,t,n){const r=Ud(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function BR(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Gd(e){return e instanceof Map}function Yd(e){return e instanceof Set}function As(e){return e.copy_||e.base_}function Gg(e,t){if(Gd(e))return new Map(e);if(Yd(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&ow(e))return Qa(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(Qa(e),n)}function Yg(e,t=!1){return Kd(e)||Za(e)||!Ts(e)||(Ud(e)>1&&(e.set=e.add=e.clear=e.delete=HR),Object.freeze(e),t&&kc(e,(n,r)=>Yg(r,!0))),e}function HR(){ir(2)}function Kd(e){return Object.isFrozen(e)}var VR={};function Is(e){const t=VR[e];return t||ir(0,e),t}var Mc;function aw(){return Mc}function WR(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function lw(e,t){t&&(Is("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Kg(e){Xg(e),e.drafts_.forEach(qR),e.drafts_=null}function Xg(e){e===Mc&&(Mc=e.parent_)}function cw(e){return Mc=WR(Mc,e)}function qR(e){const t=e[wr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function uw(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[wr].modified_&&(Kg(t),ir(4)),Ts(e)&&(e=Xd(t,e),t.parent_||Qd(t,e)),t.patches_&&Is("Patches").generateReplacementPatches_(n[wr].base_,e,t.patches_,t.inversePatches_)):e=Xd(t,n,[]),Kg(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==rw?e:void 0}function Xd(e,t,n){if(Kd(t))return t;const r=t[wr];if(!r)return kc(t,(i,o)=>dw(e,r,t,i,o,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return Qd(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),kc(o,(a,l)=>dw(e,r,i,a,l,n,s)),Qd(e,i,!1),n&&e.patches_&&Is("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function dw(e,t,n,r,i,o,s){if(process.env.NODE_ENV!=="production"&&i===n&&ir(5),Za(i)){const a=o&&t&&t.type_!==3&&!Ug(t.assigned_,r)?o.concat(r):void 0,l=Xd(e,i,a);if(sw(n,r,l),Za(l))e.canAutoFreeze_=!1;else return}else s&&n.add(i);if(Ts(i)&&!Kd(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Xd(e,i),(!t||!t.scope_.parent_)&&Qd(e,i)}}function Qd(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Yg(t,n)}function UR(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:aw(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,o=Qg;n&&(i=[r],o=Dc);const{revoke:s,proxy:a}=Proxy.revocable(i,o);return r.draft_=a,r.revoke_=s,a}var Qg={get(e,t){if(t===wr)return e;const n=As(e);if(!Ug(n,t))return GR(e,n,t);const r=n[t];return e.finalized_||!Ts(r)?r:r===Zg(e.base_,t)?(em(e),e.copy_[t]=tm(r,e)):r},has(e,t){return t in As(e)},ownKeys(e){return Reflect.ownKeys(As(e))},set(e,t,n){const r=fw(As(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=Zg(As(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(BR(n,i)&&(n!==void 0||Ug(e.base_,t)))return!0;em(e),Jg(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 Zg(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,em(e),Jg(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=As(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 Qa(e.base_)},setPrototypeOf(){ir(12)}},Dc={};kc(Qg,(e,t)=>{Dc[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),Dc.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&ir(13),Dc.set.call(this,e,t,void 0)},Dc.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&ir(14),Qg.set.call(this,e[0],t,n,e[0])};function Zg(e,t){const n=e[wr];return(n?As(n):e)[t]}function GR(e,t,n){var i;const r=fw(t,n);return r?"value"in r?r.value:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function fw(e,t){if(!(t in e))return;let n=Qa(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Qa(n)}}function Jg(e){e.modified_||(e.modified_=!0,e.parent_&&Jg(e.parent_))}function em(e){e.copy_||(e.copy_=Gg(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var YR=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(Ts(t)){const o=cw(this),s=tm(t,void 0);let a=!0;try{i=n(s),a=!1}finally{a?Kg(o):Xg(o)}return lw(o,r),uw(i,o)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===rw&&(i=void 0),this.autoFreeze_&&Yg(i,!0),r){const o=[],s=[];Is("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){Ts(e)||ir(8),Za(e)&&(e=KR(e));const t=cw(this),n=tm(e,void 0);return n[wr].isManual_=!0,Xg(t),n}finishDraft(e,t){const n=e&&e[wr];(!n||!n.isManual_)&&ir(9);const{scope_:r}=n;return lw(r,t),uw(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=Is("Patches").applyPatches_;return Za(e)?r(e,t):this.produce(e,i=>r(i,t))}};function tm(e,t){const n=Gd(e)?Is("MapSet").proxyMap_(e,t):Yd(e)?Is("MapSet").proxySet_(e,t):UR(e,t);return(t?t.scope_:aw()).drafts_.push(n),n}function KR(e){return Za(e)||ir(10,e),hw(e)}function hw(e){if(!Ts(e)||Kd(e))return e;const t=e[wr];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Gg(e,t.scope_.immer_.useStrictShallowCopy_)}else n=Gg(e,!0);return kc(n,(r,i)=>{sw(n,r,hw(i))}),t&&(t.finalized_=!1),n}var _r=new YR,XR=_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 pw=e=>(t,n,r)=>(r.setState=(i,o,...s)=>{const a=typeof i=="function"?XR(i):i;return t(a,o,...s)},e(r.setState,n,r));var nm,Zd=kt;if(process.env.NODE_ENV==="production")nm=Zd.createRoot,Zd.hydrateRoot;else{var gw=Zd.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;nm=function(e,t){gw.usingClientEntryPoint=!0;try{return Zd.createRoot(e,t)}finally{gw.usingClientEntryPoint=!1}}}function mw(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=nm(n),s=a=>{a&&(o.render(m.createElement(i,Object.assign({},a))),r.count+=1)};s(t.getState()),t.subscribe(s)}var vw={},bw={},rm={exports:{}},Gt=String,yw=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}};rm.exports=yw(),rm.exports.createColors=yw;var QR=rm.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(QR);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])}}})(bw),function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return i}});const t=n(bw);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}}}(vw);let im=vw;var ZR=(im.__esModule?im:{default:im}).default;const an=Sc(ZR),om={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:JR},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 JR(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=xw()),(t==null?void 0:t.align)==="start"&&(t==null?void 0:t.anchor)==="start"&&(n=xw()),e3(n)}function xw(){return xe.getState().theme==="dark"?"#000000":"#FFFFFF"}function e3(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 xe=nw()(pw((e,t)=>({dashboard:{id:"placeholder",style:om},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}),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}))},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"&&mw("DashboardStore",xe);var Tc=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(){}},Ja=typeof window>"u"||"Deno"in window;function Yr(){}function t3(e,t){return typeof e=="function"?e(t):e}function sm(e){return typeof e=="number"&&e>=0&&e!==1/0}function ww(e,t){return Math.max(e+(t||0)-Date.now(),0)}function _w(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==am(s,t.options))return!1}else if(!Ic(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 Sw(e,t){const{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(Ac(t.options.mutationKey)!==Ac(o))return!1}else if(!Ic(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function am(e,t){return((t==null?void 0:t.queryKeyHashFn)||Ac)(e)}function Ac(e){return JSON.stringify(e,(t,n)=>cm(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Ic(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Ic(e[n],t[n])):!1}function Cw(e,t){if(e===t)return e;const n=Ew(e)&&Ew(t);if(n||cm(e)&&cm(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]=Cw(e[d],t[d]),a[d]===e[d]&&e[d]!==void 0&&l++)}return i===s&&l===i?e:a}return t}function lm(e,t){if(e&&!t||t&&!e)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Ew(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function cm(e){if(!Pw(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!Pw(n)||!n.hasOwnProperty("isPrototypeOf"))}function Pw(e){return Object.prototype.toString.call(e)==="[object Object]"}function n3(e){return new Promise(t=>{setTimeout(t,e)})}function um(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Cw(e,t):t}function r3(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function i3(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var o3=(uA=class extends Tc{constructor(){super();ze(this,_a,void 0);ze(this,ds,void 0);ze(this,Gl,void 0);Ie(this,Gl,t=>{if(!Ja&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){Z(this,ds)||this.setEventListener(Z(this,Gl))}onUnsubscribe(){var t;this.hasListeners()||((t=Z(this,ds))==null||t.call(this),Ie(this,ds,void 0))}setEventListener(t){var n;Ie(this,Gl,t),(n=Z(this,ds))==null||n.call(this),Ie(this,ds,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){Z(this,_a)!==t&&(Ie(this,_a,t),this.onFocus())}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){var t;return typeof Z(this,_a)=="boolean"?Z(this,_a):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},_a=new WeakMap,ds=new WeakMap,Gl=new WeakMap,uA),Jd=new o3,s3=(dA=class extends Tc{constructor(){super();ze(this,Yl,!0);ze(this,fs,void 0);ze(this,Kl,void 0);Ie(this,Kl,t=>{if(!Ja&&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(){Z(this,fs)||this.setEventListener(Z(this,Kl))}onUnsubscribe(){var t;this.hasListeners()||((t=Z(this,fs))==null||t.call(this),Ie(this,fs,void 0))}setEventListener(t){var n;Ie(this,Kl,t),(n=Z(this,fs))==null||n.call(this),Ie(this,fs,t(this.setOnline.bind(this)))}setOnline(t){Z(this,Yl)!==t&&(Ie(this,Yl,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return Z(this,Yl)}},Yl=new WeakMap,fs=new WeakMap,Kl=new WeakMap,dA),ef=new s3;function a3(e){return Math.min(1e3*2**e,3e4)}function tf(e){return(e??"online")==="online"?ef.isOnline():!0}var Ow=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function dm(e){return e instanceof Ow}function kw(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 Ow(x)),(w=e.abort)==null||w.call(e))},c=()=>{t=!0},d=()=>{t=!1},f=()=>!Jd.isFocused()||e.networkMode!=="always"&&!ef.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=_=>{const C=r||!f();return C&&x(_),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 _=e.retry??(Ja?0:3),C=e.retryDelay??a3,O=typeof C=="function"?C(n,w):C,P=_===!0||typeof _=="number"&&n<_||typeof _=="function"&&_(n,w);if(t||!P){p(w);return}n++,(k=e.onFail)==null||k.call(e,n,w),n3(O).then(()=>{if(f())return v()}).then(()=>{t?p(w):y()})})};return tf(e.networkMode)?y():v().then(y),{promise:a,cancel:l,continue:()=>(i==null?void 0:i())?a:Promise.resolve(),cancelRetry:c,continueRetry:d}}function l3(){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=l3(),Mw=(fA=class{constructor(){ze(this,Sa,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),sm(this.gcTime)&&Ie(this,Sa,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ja?1/0:5*60*1e3))}clearGcTimeout(){Z(this,Sa)&&(clearTimeout(Z(this,Sa)),Ie(this,Sa,void 0))}},Sa=new WeakMap,fA),c3=(hA=class extends Mw{constructor(t){super();ze(this,Zl);ze(this,Si);ze(this,Xl,void 0);ze(this,Ql,void 0);ze(this,ri,void 0);ze(this,hs,void 0);ze(this,ii,void 0);ze(this,Mn,void 0);ze(this,cd,void 0);ze(this,Ca,void 0);Ie(this,Ca,!1),Ie(this,cd,t.defaultOptions),xt(this,Zl,Lg).call(this,t.options),Ie(this,Mn,[]),Ie(this,ri,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ie(this,Xl,t.state||u3(this.options)),this.state=Z(this,Xl),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!Z(this,Mn).length&&this.state.fetchStatus==="idle"&&Z(this,ri).remove(this)}setData(t,n){const r=um(this.state.data,t,this.options);return xt(this,Si,Ro).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,Ro).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r;const n=Z(this,hs);return(r=Z(this,ii))==null||r.cancel(t),n?n.then(Yr).catch(Yr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(Z(this,Xl))}isActive(){return Z(this,Mn).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||Z(this,Mn).some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!ww(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=Z(this,Mn).find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=Z(this,ii))==null||n.continue()}onOnline(){var n;const t=Z(this,Mn).find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=Z(this,ii))==null||n.continue()}addObserver(t){Z(this,Mn).includes(t)||(Z(this,Mn).push(t),this.clearGcTimeout(),Z(this,ri).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){Z(this,Mn).includes(t)&&(Ie(this,Mn,Z(this,Mn).filter(n=>n!==t)),Z(this,Mn).length||(Z(this,ii)&&(Z(this,Ca)?Z(this,ii).cancel({revert:!0}):Z(this,ii).cancelRetry()),this.scheduleGc()),Z(this,ri).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return Z(this,Mn).length}invalidate(){this.state.isInvalidated||xt(this,Si,Ro).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(Z(this,hs))return(c=Z(this,ii))==null||c.continueRetry(),Z(this,hs)}if(t&&xt(this,Zl,Lg).call(this,t),!this.options.queryFn){const p=Z(this,Mn).find(v=>v.options.queryFn);p&&xt(this,Zl,Lg).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,Ca,!0),r.signal)})};o(i);const s=()=>this.options.queryFn?(Ie(this,Ca,!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,Ql,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=a.fetchOptions)==null?void 0:f.meta))&&xt(this,Si,Ro).call(this,{type:"fetch",meta:(g=a.fetchOptions)==null?void 0:g.meta});const l=p=>{var v,y,x,w;dm(p)&&p.silent||xt(this,Si,Ro).call(this,{type:"error",error:p}),dm(p)||((y=(v=Z(this,ri).config).onError)==null||y.call(v,p,this),(w=(x=Z(this,ri).config).onSettled)==null||w.call(x,this.state.data,p,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return Ie(this,ii,kw({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=Z(this,ri).config).onSuccess)==null||y.call(v,p,this),(w=(x=Z(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,Ro).call(this,{type:"failed",failureCount:p,error:v})},onPause:()=>{xt(this,Si,Ro).call(this,{type:"pause"})},onContinue:()=>{xt(this,Si,Ro).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode})),Ie(this,hs,Z(this,ii).promise),Z(this,hs)}},Xl=new WeakMap,Ql=new WeakMap,ri=new WeakMap,hs=new WeakMap,ii=new WeakMap,Mn=new WeakMap,cd=new WeakMap,Ca=new WeakMap,Zl=new WeakSet,Lg=function(t){this.options={...Z(this,cd),...t},this.updateGcTime(this.options.gcTime)},Si=new WeakSet,Ro=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:tf(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 dm(i)&&i.revert&&Z(this,Ql)?{...Z(this,Ql),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(()=>{Z(this,Mn).forEach(r=>{r.onQueryUpdate()}),Z(this,ri).notify({query:this,type:"updated",action:t})})},hA);function u3(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 d3=(pA=class extends Tc{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??am(i,n);let s=this.get(o);return s||(s=new c3({cache:this,queryKey:i,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(s)),s}add(t){Z(this,Yi).has(t.queryHash)||(Z(this,Yi).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=Z(this,Yi).get(t.queryHash);n&&(t.destroy(),n===t&&Z(this,Yi).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){In.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return Z(this,Yi).get(t)}getAll(){return[...Z(this,Yi).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>_w(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>_w(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,pA),f3=(gA=class extends Mw{constructor(t){super();ze(this,Xi);ze(this,Ki,void 0);ze(this,ud,void 0);ze(this,jr,void 0);ze(this,Jl,void 0);this.mutationId=t.mutationId,Ie(this,ud,t.defaultOptions),Ie(this,jr,t.mutationCache),Ie(this,Ki,[]),this.state=t.state||h3(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...Z(this,ud),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){Z(this,Ki).includes(t)||(Z(this,Ki).push(t),this.clearGcTimeout(),Z(this,jr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ie(this,Ki,Z(this,Ki).filter(n=>n!==t)),this.scheduleGc(),Z(this,jr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){Z(this,Ki).length||(this.state.status==="pending"?this.scheduleGc():Z(this,jr).remove(this))}continue(){var t;return((t=Z(this,Jl))==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,_,C,O,P,k,A;const n=()=>(Ie(this,Jl,kw({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(L,F)=>{xt(this,Xi,Os).call(this,{type:"failed",failureCount:L,error:F})},onPause:()=>{xt(this,Xi,Os).call(this,{type:"pause"})},onContinue:()=>{xt(this,Xi,Os).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),Z(this,Jl).promise),r=this.state.status==="pending";try{if(!r){xt(this,Xi,Os).call(this,{type:"pending",variables:t}),await((o=(i=Z(this,jr).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,Os).call(this,{type:"pending",context:F,variables:t})}const L=await n();return await((c=(l=Z(this,jr).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=Z(this,jr).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,Os).call(this,{type:"success",data:L}),L}catch(L){try{throw await((w=(x=Z(this,jr).config).onError)==null?void 0:w.call(x,L,t,this.state.context,this)),await((C=(_=this.options).onError)==null?void 0:C.call(_,L,t,this.state.context)),await((P=(O=Z(this,jr).config).onSettled)==null?void 0:P.call(O,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,Os).call(this,{type:"error",error:L})}}}},Ki=new WeakMap,ud=new WeakMap,jr=new WeakMap,Jl=new WeakMap,Xi=new WeakSet,Os=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:!tf(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(()=>{Z(this,Ki).forEach(r=>{r.onMutationUpdate(t)}),Z(this,jr).notify({mutation:this,type:"updated",action:t})})},gA);function h3(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var p3=(mA=class extends Tc{constructor(t={}){super();ze(this,oi,void 0);ze(this,dd,void 0);ze(this,Ea,void 0);this.config=t,Ie(this,oi,[]),Ie(this,dd,0)}build(t,n,r){const i=new f3({mutationCache:this,mutationId:++Ng(this,dd)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){Z(this,oi).push(t),this.notify({type:"added",mutation:t})}remove(t){Ie(this,oi,Z(this,oi).filter(n=>n!==t)),this.notify({type:"removed",mutation:t})}clear(){In.batch(()=>{Z(this,oi).forEach(t=>{this.remove(t)})})}getAll(){return Z(this,oi)}find(t){const n={exact:!0,...t};return Z(this,oi).find(r=>Sw(n,r))}findAll(t={}){return Z(this,oi).filter(n=>Sw(t,n))}notify(t){In.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){return Ie(this,Ea,(Z(this,Ea)??Promise.resolve()).then(()=>{const t=Z(this,oi).filter(n=>n.state.isPaused);return In.batch(()=>t.reduce((n,r)=>n.then(()=>r.continue().catch(Yr)),Promise.resolve()))}).then(()=>{Ie(this,Ea,void 0)})),Z(this,Ea)}},oi=new WeakMap,dd=new WeakMap,Ea=new WeakMap,mA);function g3(e){return{onFetch:(t,n)=>{const r=async()=>{var v,y,x,w,_;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=((_=t.state.data)==null?void 0:_.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,O,P)=>{if(c)return Promise.reject();if(O==null&&C.pages.length)return Promise.resolve(C);const k={queryKey:t.queryKey,pageParam:O,direction:P?"backward":"forward",meta:t.options.meta};d(k);const A=await f(k),{maxPages:L}=t.options,F=P?i3:r3;return{pages:F(C.pages,A,L),pageParams:F(C.pageParams,O,L)}};let p;if(o&&s.length){const C=o==="backward",O=C?m3:Dw,P={pages:s,pageParams:a},k=O(i,P);p=await g(P,k,C)}else{p=await g(l,a[0]??i.initialPageParam);const C=e??s.length;for(let O=1;O<C;O++){const P=Dw(i,p);p=await g(p,P)}}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 Dw(e,{pages:t,pageParams:n}){const r=t.length-1;return e.getNextPageParam(t[r],t,n[r],n)}function m3(e,{pages:t,pageParams:n}){var r;return(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n)}var v3=(vA=class{constructor(e={}){ze(this,_n,void 0);ze(this,ps,void 0);ze(this,gs,void 0);ze(this,ec,void 0);ze(this,tc,void 0);ze(this,ms,void 0);ze(this,nc,void 0);ze(this,rc,void 0);Ie(this,_n,e.queryCache||new d3),Ie(this,ps,e.mutationCache||new p3),Ie(this,gs,e.defaultOptions||{}),Ie(this,ec,new Map),Ie(this,tc,new Map),Ie(this,ms,0)}mount(){Ng(this,ms)._++,Z(this,ms)===1&&(Ie(this,nc,Jd.subscribe(()=>{Jd.isFocused()&&(this.resumePausedMutations(),Z(this,_n).onFocus())})),Ie(this,rc,ef.subscribe(()=>{ef.isOnline()&&(this.resumePausedMutations(),Z(this,_n).onOnline())})))}unmount(){var e,t;Ng(this,ms)._--,Z(this,ms)===0&&((e=Z(this,nc))==null||e.call(this),Ie(this,nc,void 0),(t=Z(this,rc))==null||t.call(this),Ie(this,rc,void 0))}isFetching(e){return Z(this,_n).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return Z(this,ps).findAll({...e,status:"pending"}).length}getQueryData(e){var t;return(t=Z(this,_n).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=Z(this,_n).find({queryKey:e}),i=r==null?void 0:r.state.data,o=t3(t,i);if(typeof o>"u")return;const s=this.defaultQueryOptions({queryKey:e});return Z(this,_n).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=Z(this,_n).find({queryKey:e}))==null?void 0:t.state}removeQueries(e){const t=Z(this,_n);In.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=Z(this,_n),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(()=>Z(this,_n).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Yr).catch(Yr)}invalidateQueries(e={},t={}){return In.batch(()=>{if(Z(this,_n).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(()=>Z(this,_n).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(Yr)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Yr)}fetchQuery(e){const t=this.defaultQueryOptions(e);typeof t.retry>"u"&&(t.retry=!1);const n=Z(this,_n).build(this,t);return n.isStaleByTime(t.staleTime)?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Yr).catch(Yr)}fetchInfiniteQuery(e){return e.behavior=g3(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Yr).catch(Yr)}resumePausedMutations(){return Z(this,ps).resumePausedMutations()}getQueryCache(){return Z(this,_n)}getMutationCache(){return Z(this,ps)}getDefaultOptions(){return Z(this,gs)}setDefaultOptions(e){Ie(this,gs,e)}setQueryDefaults(e,t){Z(this,ec).set(Ac(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...Z(this,ec).values()];let n={};return t.forEach(r=>{Ic(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){Z(this,tc).set(Ac(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...Z(this,tc).values()];let n={};return t.forEach(r=>{Ic(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const t={...Z(this,gs).queries,...(e==null?void 0:e.queryKey)&&this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=am(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:{...Z(this,gs).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){Z(this,_n).clear(),Z(this,ps).clear()}},_n=new WeakMap,ps=new WeakMap,gs=new WeakMap,ec=new WeakMap,tc=new WeakMap,ms=new WeakMap,nc=new WeakMap,rc=new WeakMap,vA),b3=(bA=class extends Tc{constructor(t,n){super();ze(this,Ma);ze(this,pd);ze(this,gd);ze(this,md);ze(this,vd);ze(this,bd);ze(this,yd);ze(this,xd);ze(this,Gp);ze(this,gr,void 0);ze(this,Zt,void 0);ze(this,fd,void 0);ze(this,er,void 0);ze(this,Pa,void 0);ze(this,ic,void 0);ze(this,Qi,void 0);ze(this,hd,void 0);ze(this,oc,void 0);ze(this,sc,void 0);ze(this,Oa,void 0);ze(this,ka,void 0);ze(this,vs,void 0);ze(this,ac,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&&(Z(this,Zt).addObserver(this),Tw(Z(this,Zt),this.options)?xt(this,Ma,Hd).call(this):this.updateResult(),xt(this,vd,A1).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return fm(Z(this,Zt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return fm(Z(this,Zt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,xt(this,bd,I1).call(this),xt(this,yd,R1).call(this),Z(this,Zt).removeObserver(this)}setOptions(t,n){const r=this.options,i=Z(this,Zt);if(this.options=Z(this,gr).defaultQueryOptions(t),lm(r,this.options)||Z(this,gr).getQueryCache().notify({type:"observerOptionsUpdated",query:Z(this,Zt),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,xd,N1).call(this);const o=this.hasListeners();o&&Aw(Z(this,Zt),i,this.options,r)&&xt(this,Ma,Hd).call(this),this.updateResult(n),o&&(Z(this,Zt)!==i||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&xt(this,pd,M1).call(this);const s=xt(this,gd,D1).call(this);o&&(Z(this,Zt)!==i||this.options.enabled!==r.enabled||s!==Z(this,vs))&&xt(this,md,T1).call(this,s)}getOptimisticResult(t){const n=Z(this,gr).getQueryCache().build(Z(this,gr),t),r=this.createResult(n,t);return x3(this,r)&&(Ie(this,er,r),Ie(this,ic,this.options),Ie(this,Pa,Z(this,Zt).state)),r}getCurrentResult(){return Z(this,er)}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(Z(this,ac).add(r),t[r])})}),n}getCurrentQuery(){return Z(this,Zt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=Z(this,gr).defaultQueryOptions(t),r=Z(this,gr).getQueryCache().build(Z(this,gr),n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){return xt(this,Ma,Hd).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),Z(this,er)))}createResult(t,n){var k;const r=Z(this,Zt),i=this.options,o=Z(this,er),s=Z(this,Pa),a=Z(this,ic),c=t!==r?t.state:Z(this,fd),{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&&Tw(t,n),F=A&&Aw(t,r,n,i);(L||F)&&(p=tf(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===Z(this,hd))x=Z(this,oc);else try{Ie(this,hd,n.select),x=n.select(d.data),x=um(o==null?void 0:o.data,x,n),Ie(this,oc,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=Z(this,sc))==null?void 0:k.state.data,Z(this,sc)):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=um(o==null?void 0:o.data,A,n),y=!0)}Z(this,Qi)&&(f=Z(this,Qi),x=Z(this,oc),g=Date.now(),v="error");const w=p==="fetching",_=v==="pending",C=v==="error",O=_&&w;return{status:v,fetchStatus:p,isPending:_,isSuccess:v==="success",isError:C,isInitialLoading:O,isLoading:O,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&&!_,isLoadingError:C&&d.dataUpdatedAt===0,isPaused:p==="paused",isPlaceholderData:y,isRefetchError:C&&d.dataUpdatedAt!==0,isStale:hm(t,n),refetch:this.refetch}}updateResult(t){const n=Z(this,er),r=this.createResult(Z(this,Zt),this.options);if(Ie(this,Pa,Z(this,Zt).state),Ie(this,ic,this.options),Z(this,Pa).data!==void 0&&Ie(this,sc,Z(this,Zt)),lm(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&&!Z(this,ac).size)return!0;const l=new Set(a??Z(this,ac));return this.options.throwOnError&&l.add("error"),Object.keys(Z(this,er)).some(c=>{const d=c;return Z(this,er)[d]!==n[d]&&l.has(d)})};(t==null?void 0:t.listeners)!==!1&&o()&&(i.listeners=!0),xt(this,Gp,WI).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&xt(this,vd,A1).call(this)}},gr=new WeakMap,Zt=new WeakMap,fd=new WeakMap,er=new WeakMap,Pa=new WeakMap,ic=new WeakMap,Qi=new WeakMap,hd=new WeakMap,oc=new WeakMap,sc=new WeakMap,Oa=new WeakMap,ka=new WeakMap,vs=new WeakMap,ac=new WeakMap,Ma=new WeakSet,Hd=function(t){xt(this,xd,N1).call(this);let n=Z(this,Zt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Yr)),n},pd=new WeakSet,M1=function(){if(xt(this,bd,I1).call(this),Ja||Z(this,er).isStale||!sm(this.options.staleTime))return;const n=ww(Z(this,er).dataUpdatedAt,this.options.staleTime)+1;Ie(this,Oa,setTimeout(()=>{Z(this,er).isStale||this.updateResult()},n))},gd=new WeakSet,D1=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(Z(this,Zt)):this.options.refetchInterval)??!1},md=new WeakSet,T1=function(t){xt(this,yd,R1).call(this),Ie(this,vs,t),!(Ja||this.options.enabled===!1||!sm(Z(this,vs))||Z(this,vs)===0)&&Ie(this,ka,setInterval(()=>{(this.options.refetchIntervalInBackground||Jd.isFocused())&&xt(this,Ma,Hd).call(this)},Z(this,vs)))},vd=new WeakSet,A1=function(){xt(this,pd,M1).call(this),xt(this,md,T1).call(this,xt(this,gd,D1).call(this))},bd=new WeakSet,I1=function(){Z(this,Oa)&&(clearTimeout(Z(this,Oa)),Ie(this,Oa,void 0))},yd=new WeakSet,R1=function(){Z(this,ka)&&(clearInterval(Z(this,ka)),Ie(this,ka,void 0))},xd=new WeakSet,N1=function(){const t=Z(this,gr).getQueryCache().build(Z(this,gr),this.options);if(t===Z(this,Zt))return;const n=Z(this,Zt);Ie(this,Zt,t),Ie(this,fd,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Gp=new WeakSet,WI=function(t){In.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(Z(this,er))}),Z(this,gr).getQueryCache().notify({query:Z(this,Zt),type:"observerResultsUpdated"})})},bA);function y3(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Tw(e,t){return y3(e,t)||e.state.dataUpdatedAt>0&&fm(e,t,t.refetchOnMount)}function fm(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&hm(e,t)}return!1}function Aw(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&hm(e,n)}function hm(e,t){return e.isStaleByTime(t.staleTime)}function x3(e,t){return!lm(e.getCurrentResult(),t)}var Iw=ue.createContext(void 0),w3=e=>{const t=ue.useContext(Iw);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},_3=({client:e,children:t})=>(ue.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),ue.createElement(Iw.Provider,{value:e},t)),Rw=ue.createContext(!1),S3=()=>ue.useContext(Rw);Rw.Provider;function C3(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var E3=ue.createContext(C3()),P3=()=>ue.useContext(E3);function O3(e,t){return typeof e=="function"?e(...t):!!e}var k3=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},M3=e=>{ue.useEffect(()=>{e.clearReset()},[e])},D3=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&O3(n,[e.error,r]),T3=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},A3=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,I3=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function R3(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=w3(n),i=S3(),o=P3(),s=r.defaultQueryOptions(e);s._optimisticResults=i?"isRestoring":"optimistic",T3(s),k3(s,o),M3(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]),A3(s,l))throw I3(s,a,o);if(D3({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 R3(e,b3,t)}var nf={exports:{}};/**
|
|
60
|
+
* @license
|
|
61
|
+
* Lodash <https://lodash.com/>
|
|
62
|
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
63
|
+
* Released under MIT license <https://lodash.com/license>
|
|
64
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
65
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
66
|
+
*/nf.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,_=4,C=8,O=16,P=32,k=64,A=128,L=256,F=512,B=30,H="...",V=800,K=16,Y=1,$=2,X=3,j=1/0,ne=9007199254740991,se=17976931348623157e292,D=NaN,q=4294967295,re=q-1,R=q>>>1,te=[["ary",A],["bind",x],["bindKey",w],["curry",C],["curryRight",O],["flip",F],["partial",P],["partialRight",k],["rearg",L]],ge="[object Arguments]",pe="[object Array]",de="[object AsyncFunction]",ie="[object Boolean]",J="[object Date]",W="[object DOMException]",be="[object Error]",oe="[object Function]",Te="[object GeneratorFunction]",Fe="[object Map]",Ve="[object Number]",Ke="[object Null]",St="[object Object]",vt="[object Promise]",bt="[object Proxy]",tn="[object RegExp]",Jt="[object Set]",Dn="[object String]",fn="[object Symbol]",Da="[object Undefined]",fe="[object WeakMap]",Pe="[object WeakSet]",Le="[object ArrayBuffer]",Xe="[object DataView]",yt="[object Float32Array]",hn="[object Float64Array]",Sn="[object Int8Array]",Fn="[object Int16Array]",zr="[object Int32Array]",Br="[object Uint8Array]",pn="[object Uint8ClampedArray]",mr="[object Uint16Array]",jn="[object Uint32Array]",wd=/\b__p \+= '';/g,So=/\b(__p \+=) '' \+/g,Ta=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Yn=/&(?:amp|lt|gt|quot|#39);/g,Zi=/[&<>"']/g,Co=RegExp(Yn.source),Aa=RegExp(Zi.source),_d=/<%-([\s\S]+?)%>/g,Ia=/<%([\s\S]+?)%>/g,lc=/<%=([\s\S]+?)%>/g,Ra=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Na=/^\w*$/,Sd=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,La=/[\\^$.*+?()[\]{}|]/g,$a=RegExp(La.source),Fa=/^\s+/,Cd=/\s/,Ed=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Pd=/\{\n\/\* \[wrapped with (.+)\] \*/,M=/,? & /,G=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ae=/[()=,{}\[\]\/\s]/,Se=/\\(\\)?/g,Ne=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,je=/\w*$/,Ae=/^[-+]0x[0-9a-f]+$/i,Me=/^0b[01]+$/i,Ot=/^\[object .+?Constructor\]$/,Ze=/^0o[0-7]+$/i,nt=/^(?:0|[1-9]\d*)$/,zt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Tn=/($^)/,ja=/['\n\r\u2028\u2029\\]/g,nn="\\ud800-\\udfff",jre="\\u0300-\\u036f",zre="\\ufe20-\\ufe2f",Bre="\\u20d0-\\u20ff",yA=jre+zre+Bre,xA="\\u2700-\\u27bf",wA="a-z\\xdf-\\xf6\\xf8-\\xff",Hre="\\xac\\xb1\\xd7\\xf7",Vre="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Wre="\\u2000-\\u206f",qre=" \\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",_A="A-Z\\xc0-\\xd6\\xd8-\\xde",SA="\\ufe0e\\ufe0f",CA=Hre+Vre+Wre+qre,bx="['’]",Ure="["+nn+"]",EA="["+CA+"]",Kp="["+yA+"]",PA="\\d+",Gre="["+xA+"]",OA="["+wA+"]",kA="[^"+nn+CA+PA+xA+wA+_A+"]",yx="\\ud83c[\\udffb-\\udfff]",Yre="(?:"+Kp+"|"+yx+")",MA="[^"+nn+"]",xx="(?:\\ud83c[\\udde6-\\uddff]){2}",wx="[\\ud800-\\udbff][\\udc00-\\udfff]",cc="["+_A+"]",DA="\\u200d",TA="(?:"+OA+"|"+kA+")",Kre="(?:"+cc+"|"+kA+")",AA="(?:"+bx+"(?:d|ll|m|re|s|t|ve))?",IA="(?:"+bx+"(?:D|LL|M|RE|S|T|VE))?",RA=Yre+"?",NA="["+SA+"]?",Xre="(?:"+DA+"(?:"+[MA,xx,wx].join("|")+")"+NA+RA+")*",Qre="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Zre="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",LA=NA+RA+Xre,Jre="(?:"+[Gre,xx,wx].join("|")+")"+LA,eie="(?:"+[MA+Kp+"?",Kp,xx,wx,Ure].join("|")+")",tie=RegExp(bx,"g"),nie=RegExp(Kp,"g"),_x=RegExp(yx+"(?="+yx+")|"+eie+LA,"g"),rie=RegExp([cc+"?"+OA+"+"+AA+"(?="+[EA,cc,"$"].join("|")+")",Kre+"+"+IA+"(?="+[EA,cc+TA,"$"].join("|")+")",cc+"?"+TA+"+"+AA,cc+"+"+IA,Zre,Qre,PA,Jre].join("|"),"g"),iie=RegExp("["+DA+nn+yA+SA+"]"),oie=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,sie=["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"],aie=-1,en={};en[yt]=en[hn]=en[Sn]=en[Fn]=en[zr]=en[Br]=en[pn]=en[mr]=en[jn]=!0,en[ge]=en[pe]=en[Le]=en[ie]=en[Xe]=en[J]=en[be]=en[oe]=en[Fe]=en[Ve]=en[St]=en[tn]=en[Jt]=en[Dn]=en[fe]=!1;var qt={};qt[ge]=qt[pe]=qt[Le]=qt[Xe]=qt[ie]=qt[J]=qt[yt]=qt[hn]=qt[Sn]=qt[Fn]=qt[zr]=qt[Fe]=qt[Ve]=qt[St]=qt[tn]=qt[Jt]=qt[Dn]=qt[fn]=qt[Br]=qt[pn]=qt[mr]=qt[jn]=!0,qt[be]=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"},cie={"&":"&","<":"<",">":">",'"':""","'":"'"},uie={"&":"&","<":"<",">":">",""":'"',"'":"'"},die={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},fie=parseFloat,hie=parseInt,$A=typeof No=="object"&&No&&No.Object===Object&&No,pie=typeof self=="object"&&self&&self.Object===Object&&self,zn=$A||pie||Function("return this")(),Sx=t&&!t.nodeType&&t,za=Sx&&!0&&e&&!e.nodeType&&e,FA=za&&za.exports===Sx,Cx=FA&&$A.process,si=function(){try{var Q=za&&za.require&&za.require("util").types;return Q||Cx&&Cx.binding&&Cx.binding("util")}catch{}}(),jA=si&&si.isArrayBuffer,zA=si&&si.isDate,BA=si&&si.isMap,HA=si&&si.isRegExp,VA=si&&si.isSet,WA=si&&si.isTypedArray;function Hr(Q,he,ce){switch(ce.length){case 0:return Q.call(he);case 1:return Q.call(he,ce[0]);case 2:return Q.call(he,ce[0],ce[1]);case 3:return Q.call(he,ce[0],ce[1],ce[2])}return Q.apply(he,ce)}function gie(Q,he,ce,Re){for(var Je=-1,Tt=Q==null?0:Q.length;++Je<Tt;){var Cn=Q[Je];he(Re,Cn,ce(Cn),Q)}return Re}function ai(Q,he){for(var ce=-1,Re=Q==null?0:Q.length;++ce<Re&&he(Q[ce],ce,Q)!==!1;);return Q}function mie(Q,he){for(var ce=Q==null?0:Q.length;ce--&&he(Q[ce],ce,Q)!==!1;);return Q}function qA(Q,he){for(var ce=-1,Re=Q==null?0:Q.length;++ce<Re;)if(!he(Q[ce],ce,Q))return!1;return!0}function bs(Q,he){for(var ce=-1,Re=Q==null?0:Q.length,Je=0,Tt=[];++ce<Re;){var Cn=Q[ce];he(Cn,ce,Q)&&(Tt[Je++]=Cn)}return Tt}function Xp(Q,he){var ce=Q==null?0:Q.length;return!!ce&&uc(Q,he,0)>-1}function Ex(Q,he,ce){for(var Re=-1,Je=Q==null?0:Q.length;++Re<Je;)if(ce(he,Q[Re]))return!0;return!1}function rn(Q,he){for(var ce=-1,Re=Q==null?0:Q.length,Je=Array(Re);++ce<Re;)Je[ce]=he(Q[ce],ce,Q);return Je}function ys(Q,he){for(var ce=-1,Re=he.length,Je=Q.length;++ce<Re;)Q[Je+ce]=he[ce];return Q}function Px(Q,he,ce,Re){var Je=-1,Tt=Q==null?0:Q.length;for(Re&&Tt&&(ce=Q[++Je]);++Je<Tt;)ce=he(ce,Q[Je],Je,Q);return ce}function vie(Q,he,ce,Re){var Je=Q==null?0:Q.length;for(Re&&Je&&(ce=Q[--Je]);Je--;)ce=he(ce,Q[Je],Je,Q);return ce}function Ox(Q,he){for(var ce=-1,Re=Q==null?0:Q.length;++ce<Re;)if(he(Q[ce],ce,Q))return!0;return!1}var bie=kx("length");function yie(Q){return Q.split("")}function xie(Q){return Q.match(G)||[]}function UA(Q,he,ce){var Re;return ce(Q,function(Je,Tt,Cn){if(he(Je,Tt,Cn))return Re=Tt,!1}),Re}function Qp(Q,he,ce,Re){for(var Je=Q.length,Tt=ce+(Re?1:-1);Re?Tt--:++Tt<Je;)if(he(Q[Tt],Tt,Q))return Tt;return-1}function uc(Q,he,ce){return he===he?Aie(Q,he,ce):Qp(Q,GA,ce)}function wie(Q,he,ce,Re){for(var Je=ce-1,Tt=Q.length;++Je<Tt;)if(Re(Q[Je],he))return Je;return-1}function GA(Q){return Q!==Q}function YA(Q,he){var ce=Q==null?0:Q.length;return ce?Dx(Q,he)/ce:D}function kx(Q){return function(he){return he==null?n:he[Q]}}function Mx(Q){return function(he){return Q==null?n:Q[he]}}function KA(Q,he,ce,Re,Je){return Je(Q,function(Tt,Cn,Bt){ce=Re?(Re=!1,Tt):he(ce,Tt,Cn,Bt)}),ce}function _ie(Q,he){var ce=Q.length;for(Q.sort(he);ce--;)Q[ce]=Q[ce].value;return Q}function Dx(Q,he){for(var ce,Re=-1,Je=Q.length;++Re<Je;){var Tt=he(Q[Re]);Tt!==n&&(ce=ce===n?Tt:ce+Tt)}return ce}function Tx(Q,he){for(var ce=-1,Re=Array(Q);++ce<Q;)Re[ce]=he(ce);return Re}function Sie(Q,he){return rn(he,function(ce){return[ce,Q[ce]]})}function XA(Q){return Q&&Q.slice(0,e5(Q)+1).replace(Fa,"")}function Vr(Q){return function(he){return Q(he)}}function Ax(Q,he){return rn(he,function(ce){return Q[ce]})}function Od(Q,he){return Q.has(he)}function QA(Q,he){for(var ce=-1,Re=Q.length;++ce<Re&&uc(he,Q[ce],0)>-1;);return ce}function ZA(Q,he){for(var ce=Q.length;ce--&&uc(he,Q[ce],0)>-1;);return ce}function Cie(Q,he){for(var ce=Q.length,Re=0;ce--;)Q[ce]===he&&++Re;return Re}var Eie=Mx(lie),Pie=Mx(cie);function Oie(Q){return"\\"+die[Q]}function kie(Q,he){return Q==null?n:Q[he]}function dc(Q){return iie.test(Q)}function Mie(Q){return oie.test(Q)}function Die(Q){for(var he,ce=[];!(he=Q.next()).done;)ce.push(he.value);return ce}function Ix(Q){var he=-1,ce=Array(Q.size);return Q.forEach(function(Re,Je){ce[++he]=[Je,Re]}),ce}function JA(Q,he){return function(ce){return Q(he(ce))}}function xs(Q,he){for(var ce=-1,Re=Q.length,Je=0,Tt=[];++ce<Re;){var Cn=Q[ce];(Cn===he||Cn===d)&&(Q[ce]=d,Tt[Je++]=ce)}return Tt}function Zp(Q){var he=-1,ce=Array(Q.size);return Q.forEach(function(Re){ce[++he]=Re}),ce}function Tie(Q){var he=-1,ce=Array(Q.size);return Q.forEach(function(Re){ce[++he]=[Re,Re]}),ce}function Aie(Q,he,ce){for(var Re=ce-1,Je=Q.length;++Re<Je;)if(Q[Re]===he)return Re;return-1}function Iie(Q,he,ce){for(var Re=ce+1;Re--;)if(Q[Re]===he)return Re;return Re}function fc(Q){return dc(Q)?Nie(Q):bie(Q)}function Ci(Q){return dc(Q)?Lie(Q):yie(Q)}function e5(Q){for(var he=Q.length;he--&&Cd.test(Q.charAt(he)););return he}var Rie=Mx(uie);function Nie(Q){for(var he=_x.lastIndex=0;_x.test(Q);)++he;return he}function Lie(Q){return Q.match(_x)||[]}function $ie(Q){return Q.match(rie)||[]}var Fie=function Q(he){he=he==null?zn:hc.defaults(zn.Object(),he,hc.pick(zn,sie));var ce=he.Array,Re=he.Date,Je=he.Error,Tt=he.Function,Cn=he.Math,Bt=he.Object,Rx=he.RegExp,jie=he.String,li=he.TypeError,Jp=ce.prototype,zie=Tt.prototype,pc=Bt.prototype,eg=he["__core-js_shared__"],tg=zie.toString,Ft=pc.hasOwnProperty,Bie=0,t5=function(){var u=/[^.]+$/.exec(eg&&eg.keys&&eg.keys.IE_PROTO||"");return u?"Symbol(src)_1."+u:""}(),ng=pc.toString,Hie=tg.call(Bt),Vie=zn._,Wie=Rx("^"+tg.call(Ft).replace(La,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),rg=FA?he.Buffer:n,ws=he.Symbol,ig=he.Uint8Array,n5=rg?rg.allocUnsafe:n,og=JA(Bt.getPrototypeOf,Bt),r5=Bt.create,i5=pc.propertyIsEnumerable,sg=Jp.splice,o5=ws?ws.isConcatSpreadable:n,kd=ws?ws.iterator:n,Ba=ws?ws.toStringTag:n,ag=function(){try{var u=Ua(Bt,"defineProperty");return u({},"",{}),u}catch{}}(),qie=he.clearTimeout!==zn.clearTimeout&&he.clearTimeout,Uie=Re&&Re.now!==zn.Date.now&&Re.now,Gie=he.setTimeout!==zn.setTimeout&&he.setTimeout,lg=Cn.ceil,cg=Cn.floor,Nx=Bt.getOwnPropertySymbols,Yie=rg?rg.isBuffer:n,s5=he.isFinite,Kie=Jp.join,Xie=JA(Bt.keys,Bt),En=Cn.max,Kn=Cn.min,Qie=Re.now,Zie=he.parseInt,a5=Cn.random,Jie=Jp.reverse,Lx=Ua(he,"DataView"),Md=Ua(he,"Map"),$x=Ua(he,"Promise"),gc=Ua(he,"Set"),Dd=Ua(he,"WeakMap"),Td=Ua(Bt,"create"),ug=Dd&&new Dd,mc={},eoe=Ga(Lx),toe=Ga(Md),noe=Ga($x),roe=Ga(gc),ioe=Ga(Dd),dg=ws?ws.prototype:n,Ad=dg?dg.valueOf:n,l5=dg?dg.toString:n;function I(u){if(un(u)&&!rt(u)&&!(u instanceof Ct)){if(u instanceof ci)return u;if(Ft.call(u,"__wrapped__"))return cI(u)}return new ci(u)}var vc=function(){function u(){}return function(h){if(!sn(h))return{};if(r5)return r5(h);u.prototype=h;var b=new u;return u.prototype=n,b}}();function fg(){}function ci(u,h){this.__wrapped__=u,this.__actions__=[],this.__chain__=!!h,this.__index__=0,this.__values__=n}I.templateSettings={escape:_d,evaluate:Ia,interpolate:lc,variable:"",imports:{_:I}},I.prototype=fg.prototype,I.prototype.constructor=I,ci.prototype=vc(fg.prototype),ci.prototype.constructor=ci;function Ct(u){this.__wrapped__=u,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=q,this.__views__=[]}function ooe(){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 soe(){if(this.__filtered__){var u=new Ct(this);u.__dir__=-1,u.__filtered__=!0}else u=this.clone(),u.__dir__*=-1;return u}function aoe(){var u=this.__wrapped__.value(),h=this.__dir__,b=rt(u),E=h<0,T=b?u.length:0,N=yse(0,T,this.__views__),z=N.start,U=N.end,ee=U-z,me=E?U:z-1,ve=this.__iteratees__,we=ve.length,De=0,$e=Kn(ee,this.__takeCount__);if(!b||!E&&T==ee&&$e==ee)return A5(u,this.__actions__);var We=[];e:for(;ee--&&De<$e;){me+=h;for(var ut=-1,qe=u[me];++ut<we;){var _t=ve[ut],Et=_t.iteratee,Ur=_t.type,rr=Et(qe);if(Ur==$)qe=rr;else if(!rr){if(Ur==Y)continue e;break e}}We[De++]=qe}return We}Ct.prototype=vc(fg.prototype),Ct.prototype.constructor=Ct;function Ha(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__=Td?Td(null):{},this.size=0}function coe(u){var h=this.has(u)&&delete this.__data__[u];return this.size-=h?1:0,h}function uoe(u){var h=this.__data__;if(Td){var b=h[u];return b===l?n:b}return Ft.call(h,u)?h[u]:n}function doe(u){var h=this.__data__;return Td?h[u]!==n:Ft.call(h,u)}function foe(u,h){var b=this.__data__;return this.size+=this.has(u)?0:1,b[u]=Td&&h===n?l:h,this}Ha.prototype.clear=loe,Ha.prototype.delete=coe,Ha.prototype.get=uoe,Ha.prototype.has=doe,Ha.prototype.set=foe;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 hoe(){this.__data__=[],this.size=0}function poe(u){var h=this.__data__,b=hg(h,u);if(b<0)return!1;var E=h.length-1;return b==E?h.pop():sg.call(h,b,1),--this.size,!0}function goe(u){var h=this.__data__,b=hg(h,u);return b<0?n:h[b][1]}function moe(u){return hg(this.__data__,u)>-1}function voe(u,h){var b=this.__data__,E=hg(b,u);return E<0?(++this.size,b.push([u,h])):b[E][1]=h,this}Eo.prototype.clear=hoe,Eo.prototype.delete=poe,Eo.prototype.get=goe,Eo.prototype.has=moe,Eo.prototype.set=voe;function Po(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.size=0,this.__data__={hash:new Ha,map:new(Md||Eo),string:new Ha}}function yoe(u){var h=Eg(this,u).delete(u);return this.size-=h?1:0,h}function xoe(u){return Eg(this,u).get(u)}function woe(u){return Eg(this,u).has(u)}function _oe(u,h){var b=Eg(this,u),E=b.size;return b.set(u,h),this.size+=b.size==E?0:1,this}Po.prototype.clear=boe,Po.prototype.delete=yoe,Po.prototype.get=xoe,Po.prototype.has=woe,Po.prototype.set=_oe;function Va(u){var h=-1,b=u==null?0:u.length;for(this.__data__=new Po;++h<b;)this.add(u[h])}function Soe(u){return this.__data__.set(u,l),this}function Coe(u){return this.__data__.has(u)}Va.prototype.add=Va.prototype.push=Soe,Va.prototype.has=Coe;function Ei(u){var h=this.__data__=new Eo(u);this.size=h.size}function Eoe(){this.__data__=new Eo,this.size=0}function Poe(u){var h=this.__data__,b=h.delete(u);return this.size=h.size,b}function Ooe(u){return this.__data__.get(u)}function koe(u){return this.__data__.has(u)}function Moe(u,h){var b=this.__data__;if(b instanceof Eo){var E=b.__data__;if(!Md||E.length<i-1)return E.push([u,h]),this.size=++b.size,this;b=this.__data__=new Po(E)}return b.set(u,h),this.size=b.size,this}Ei.prototype.clear=Eoe,Ei.prototype.delete=Poe,Ei.prototype.get=Ooe,Ei.prototype.has=koe,Ei.prototype.set=Moe;function c5(u,h){var b=rt(u),E=!b&&Ya(u),T=!b&&!E&&Ps(u),N=!b&&!E&&!T&&wc(u),z=b||E||T||N,U=z?Tx(u.length,jie):[],ee=U.length;for(var me in u)(h||Ft.call(u,me))&&!(z&&(me=="length"||T&&(me=="offset"||me=="parent")||N&&(me=="buffer"||me=="byteLength"||me=="byteOffset")||Do(me,ee)))&&U.push(me);return U}function u5(u){var h=u.length;return h?u[Yx(0,h-1)]:n}function Doe(u,h){return Pg(vr(u),Wa(h,0,u.length))}function Toe(u){return Pg(vr(u))}function Fx(u,h,b){(b!==n&&!Pi(u[h],b)||b===n&&!(h in u))&&Oo(u,h,b)}function Id(u,h,b){var E=u[h];(!(Ft.call(u,h)&&Pi(E,b))||b===n&&!(h in u))&&Oo(u,h,b)}function hg(u,h){for(var b=u.length;b--;)if(Pi(u[b][0],h))return b;return-1}function Aoe(u,h,b,E){return _s(u,function(T,N,z){h(E,T,b(T),z)}),E}function d5(u,h){return u&&eo(h,An(h),u)}function Ioe(u,h){return u&&eo(h,yr(h),u)}function Oo(u,h,b){h=="__proto__"&&ag?ag(u,h,{configurable:!0,enumerable:!0,value:b,writable:!0}):u[h]=b}function jx(u,h){for(var b=-1,E=h.length,T=ce(E),N=u==null;++b<E;)T[b]=N?n:y1(u,h[b]);return T}function Wa(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,N){var z,U=h&f,ee=h&g,me=h&p;if(b&&(z=T?b(u,E,T,N):b(u)),z!==n)return z;if(!sn(u))return u;var ve=rt(u);if(ve){if(z=wse(u),!U)return vr(u,z)}else{var we=Xn(u),De=we==oe||we==Te;if(Ps(u))return N5(u,U);if(we==St||we==ge||De&&!T){if(z=ee||De?{}:eI(u),!U)return ee?use(u,Ioe(z,u)):cse(u,d5(z,u))}else{if(!qt[we])return T?u:{};z=_se(u,we,U)}}N||(N=new Ei);var $e=N.get(u);if($e)return $e;N.set(u,z),MI(u)?u.forEach(function(qe){z.add(ui(qe,h,b,qe,u,N))}):OI(u)&&u.forEach(function(qe,_t){z.set(_t,ui(qe,h,b,_t,u,N))});var We=me?ee?o1:i1:ee?yr:An,ut=ve?n:We(u);return ai(ut||u,function(qe,_t){ut&&(_t=qe,qe=u[_t]),Id(z,_t,ui(qe,h,b,_t,u,N))}),z}function Roe(u){var h=An(u);return function(b){return f5(b,u,h)}}function f5(u,h,b){var E=b.length;if(u==null)return!E;for(u=Bt(u);E--;){var T=b[E],N=h[T],z=u[T];if(z===n&&!(T in u)||!N(z))return!1}return!0}function h5(u,h,b){if(typeof u!="function")throw new li(s);return zd(function(){u.apply(n,b)},h)}function Rd(u,h,b,E){var T=-1,N=Xp,z=!0,U=u.length,ee=[],me=h.length;if(!U)return ee;b&&(h=rn(h,Vr(b))),E?(N=Ex,z=!1):h.length>=i&&(N=Od,z=!1,h=new Va(h));e:for(;++T<U;){var ve=u[T],we=b==null?ve:b(ve);if(ve=E||ve!==0?ve:0,z&&we===we){for(var De=me;De--;)if(h[De]===we)continue e;ee.push(ve)}else N(h,we,E)||ee.push(ve)}return ee}var _s=z5(Ji),p5=z5(Bx,!0);function Noe(u,h){var b=!0;return _s(u,function(E,T,N){return b=!!h(E,T,N),b}),b}function pg(u,h,b){for(var E=-1,T=u.length;++E<T;){var N=u[E],z=h(N);if(z!=null&&(U===n?z===z&&!qr(z):b(z,U)))var U=z,ee=N}return ee}function Loe(u,h,b,E){var T=u.length;for(b=at(b),b<0&&(b=-b>T?0:T+b),E=E===n||E>T?T:at(E),E<0&&(E+=T),E=b>E?0:TI(E);b<E;)u[b++]=h;return u}function g5(u,h){var b=[];return _s(u,function(E,T,N){h(E,T,N)&&b.push(E)}),b}function Bn(u,h,b,E,T){var N=-1,z=u.length;for(b||(b=Cse),T||(T=[]);++N<z;){var U=u[N];h>0&&b(U)?h>1?Bn(U,h-1,b,E,T):ys(T,U):E||(T[T.length]=U)}return T}var zx=B5(),m5=B5(!0);function Ji(u,h){return u&&zx(u,h,An)}function Bx(u,h){return u&&m5(u,h,An)}function gg(u,h){return bs(h,function(b){return To(u[b])})}function qa(u,h){h=Cs(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 v5(u,h,b){var E=h(u);return rt(u)?E:ys(E,b(u))}function tr(u){return u==null?u===n?Da:Ke:Ba&&Ba in Bt(u)?bse(u):Tse(u)}function Hx(u,h){return u>h}function $oe(u,h){return u!=null&&Ft.call(u,h)}function Foe(u,h){return u!=null&&h in Bt(u)}function joe(u,h,b){return u>=Kn(h,b)&&u<En(h,b)}function Vx(u,h,b){for(var E=b?Ex:Xp,T=u[0].length,N=u.length,z=N,U=ce(N),ee=1/0,me=[];z--;){var ve=u[z];z&&h&&(ve=rn(ve,Vr(h))),ee=Kn(ve.length,ee),U[z]=!b&&(h||T>=120&&ve.length>=120)?new Va(z&&ve):n}ve=u[0];var we=-1,De=U[0];e:for(;++we<T&&me.length<ee;){var $e=ve[we],We=h?h($e):$e;if($e=b||$e!==0?$e:0,!(De?Od(De,We):E(me,We,b))){for(z=N;--z;){var ut=U[z];if(!(ut?Od(ut,We):E(u[z],We,b)))continue e}De&&De.push(We),me.push($e)}}return me}function zoe(u,h,b,E){return Ji(u,function(T,N,z){h(E,b(T),N,z)}),E}function Nd(u,h,b){h=Cs(h,u),u=iI(u,h);var E=u==null?u:u[to(fi(h))];return E==null?n:Hr(E,u,b)}function b5(u){return un(u)&&tr(u)==ge}function Boe(u){return un(u)&&tr(u)==Le}function Hoe(u){return un(u)&&tr(u)==J}function Ld(u,h,b,E,T){return u===h?!0:u==null||h==null||!un(u)&&!un(h)?u!==u&&h!==h:Voe(u,h,b,E,Ld,T)}function Voe(u,h,b,E,T,N){var z=rt(u),U=rt(h),ee=z?pe:Xn(u),me=U?pe:Xn(h);ee=ee==ge?St:ee,me=me==ge?St:me;var ve=ee==St,we=me==St,De=ee==me;if(De&&Ps(u)){if(!Ps(h))return!1;z=!0,ve=!1}if(De&&!ve)return N||(N=new Ei),z||wc(u)?Q5(u,h,b,E,T,N):mse(u,h,ee,b,E,T,N);if(!(b&v)){var $e=ve&&Ft.call(u,"__wrapped__"),We=we&&Ft.call(h,"__wrapped__");if($e||We){var ut=$e?u.value():u,qe=We?h.value():h;return N||(N=new Ei),T(ut,qe,b,E,N)}}return De?(N||(N=new Ei),vse(u,h,b,E,T,N)):!1}function Woe(u){return un(u)&&Xn(u)==Fe}function Wx(u,h,b,E){var T=b.length,N=T,z=!E;if(u==null)return!N;for(u=Bt(u);T--;){var U=b[T];if(z&&U[2]?U[1]!==u[U[0]]:!(U[0]in u))return!1}for(;++T<N;){U=b[T];var ee=U[0],me=u[ee],ve=U[1];if(z&&U[2]){if(me===n&&!(ee in u))return!1}else{var we=new Ei;if(E)var De=E(me,ve,ee,u,h,we);if(!(De===n?Ld(ve,me,v|y,E,we):De))return!1}}return!0}function y5(u){if(!sn(u)||Pse(u))return!1;var h=To(u)?Wie:Ot;return h.test(Ga(u))}function qoe(u){return un(u)&&tr(u)==tn}function Uoe(u){return un(u)&&Xn(u)==Jt}function Goe(u){return un(u)&&Ag(u.length)&&!!en[tr(u)]}function x5(u){return typeof u=="function"?u:u==null?xr:typeof u=="object"?rt(u)?S5(u[0],u[1]):_5(u):HI(u)}function qx(u){if(!jd(u))return Xie(u);var h=[];for(var b in Bt(u))Ft.call(u,b)&&b!="constructor"&&h.push(b);return h}function Yoe(u){if(!sn(u))return Dse(u);var h=jd(u),b=[];for(var E in u)E=="constructor"&&(h||!Ft.call(u,E))||b.push(E);return b}function Ux(u,h){return u<h}function w5(u,h){var b=-1,E=br(u)?ce(u.length):[];return _s(u,function(T,N,z){E[++b]=h(T,N,z)}),E}function _5(u){var h=a1(u);return h.length==1&&h[0][2]?nI(h[0][0],h[0][1]):function(b){return b===u||Wx(b,u,h)}}function S5(u,h){return c1(u)&&tI(h)?nI(to(u),h):function(b){var E=y1(b,u);return E===n&&E===h?x1(b,u):Ld(h,E,v|y)}}function mg(u,h,b,E,T){u!==h&&zx(h,function(N,z){if(T||(T=new Ei),sn(N))Koe(u,h,z,b,mg,E,T);else{var U=E?E(d1(u,z),N,z+"",u,h,T):n;U===n&&(U=N),Fx(u,z,U)}},yr)}function Koe(u,h,b,E,T,N,z){var U=d1(u,b),ee=d1(h,b),me=z.get(ee);if(me){Fx(u,b,me);return}var ve=N?N(U,ee,b+"",u,h,z):n,we=ve===n;if(we){var De=rt(ee),$e=!De&&Ps(ee),We=!De&&!$e&&wc(ee);ve=ee,De||$e||We?rt(U)?ve=U:gn(U)?ve=vr(U):$e?(we=!1,ve=N5(ee,!0)):We?(we=!1,ve=L5(ee,!0)):ve=[]:Bd(ee)||Ya(ee)?(ve=U,Ya(U)?ve=AI(U):(!sn(U)||To(U))&&(ve=eI(ee))):we=!1}we&&(z.set(ee,ve),T(ve,ee,E,N,z),z.delete(ee)),Fx(u,b,ve)}function C5(u,h){var b=u.length;if(b)return h+=h<0?b:0,Do(h,b)?u[h]:n}function E5(u,h,b){h.length?h=rn(h,function(N){return rt(N)?function(z){return qa(z,N.length===1?N[0]:N)}:N}):h=[xr];var E=-1;h=rn(h,Vr(He()));var T=w5(u,function(N,z,U){var ee=rn(h,function(me){return me(N)});return{criteria:ee,index:++E,value:N}});return _ie(T,function(N,z){return lse(N,z,b)})}function Xoe(u,h){return P5(u,h,function(b,E){return x1(u,E)})}function P5(u,h,b){for(var E=-1,T=h.length,N={};++E<T;){var z=h[E],U=qa(u,z);b(U,z)&&$d(N,Cs(z,u),U)}return N}function Qoe(u){return function(h){return qa(h,u)}}function Gx(u,h,b,E){var T=E?wie:uc,N=-1,z=h.length,U=u;for(u===h&&(h=vr(h)),b&&(U=rn(u,Vr(b)));++N<z;)for(var ee=0,me=h[N],ve=b?b(me):me;(ee=T(U,ve,ee,E))>-1;)U!==u&&sg.call(U,ee,1),sg.call(u,ee,1);return u}function O5(u,h){for(var b=u?h.length:0,E=b-1;b--;){var T=h[b];if(b==E||T!==N){var N=T;Do(T)?sg.call(u,T,1):Qx(u,T)}}return u}function Yx(u,h){return u+cg(a5()*(h-u+1))}function Zoe(u,h,b,E){for(var T=-1,N=En(lg((h-u)/(b||1)),0),z=ce(N);N--;)z[E?N:++T]=u,u+=b;return z}function Kx(u,h){var b="";if(!u||h<1||h>ne)return b;do h%2&&(b+=u),h=cg(h/2),h&&(u+=u);while(h);return b}function ft(u,h){return f1(rI(u,h,xr),u+"")}function Joe(u){return u5(_c(u))}function ese(u,h){var b=_c(u);return Pg(b,Wa(h,0,b.length))}function $d(u,h,b,E){if(!sn(u))return u;h=Cs(h,u);for(var T=-1,N=h.length,z=N-1,U=u;U!=null&&++T<N;){var ee=to(h[T]),me=b;if(ee==="__proto__"||ee==="constructor"||ee==="prototype")return u;if(T!=z){var ve=U[ee];me=E?E(ve,ee,U):n,me===n&&(me=sn(ve)?ve:Do(h[T+1])?[]:{})}Id(U,ee,me),U=U[ee]}return u}var k5=ug?function(u,h){return ug.set(u,h),u}:xr,tse=ag?function(u,h){return ag(u,"toString",{configurable:!0,enumerable:!1,value:_1(h),writable:!0})}:xr;function nse(u){return Pg(_c(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 N=ce(T);++E<T;)N[E]=u[E+h];return N}function rse(u,h){var b;return _s(u,function(E,T,N){return b=h(E,T,N),!b}),!!b}function vg(u,h,b){var E=0,T=u==null?E:u.length;if(typeof h=="number"&&h===h&&T<=R){for(;E<T;){var N=E+T>>>1,z=u[N];z!==null&&!qr(z)&&(b?z<=h:z<h)?E=N+1:T=N}return T}return Xx(u,h,xr,b)}function Xx(u,h,b,E){var T=0,N=u==null?0:u.length;if(N===0)return 0;h=b(h);for(var z=h!==h,U=h===null,ee=qr(h),me=h===n;T<N;){var ve=cg((T+N)/2),we=b(u[ve]),De=we!==n,$e=we===null,We=we===we,ut=qr(we);if(z)var qe=E||We;else me?qe=We&&(E||De):U?qe=We&&De&&(E||!$e):ee?qe=We&&De&&!$e&&(E||!ut):$e||ut?qe=!1:qe=E?we<=h:we<h;qe?T=ve+1:N=ve}return Kn(N,re)}function M5(u,h){for(var b=-1,E=u.length,T=0,N=[];++b<E;){var z=u[b],U=h?h(z):z;if(!b||!Pi(U,ee)){var ee=U;N[T++]=z===0?0:z}}return N}function D5(u){return typeof u=="number"?u:qr(u)?D:+u}function Wr(u){if(typeof u=="string")return u;if(rt(u))return rn(u,Wr)+"";if(qr(u))return l5?l5.call(u):"";var h=u+"";return h=="0"&&1/u==-j?"-0":h}function Ss(u,h,b){var E=-1,T=Xp,N=u.length,z=!0,U=[],ee=U;if(b)z=!1,T=Ex;else if(N>=i){var me=h?null:pse(u);if(me)return Zp(me);z=!1,T=Od,ee=new Va}else ee=h?[]:U;e:for(;++E<N;){var ve=u[E],we=h?h(ve):ve;if(ve=b||ve!==0?ve:0,z&&we===we){for(var De=ee.length;De--;)if(ee[De]===we)continue e;h&&ee.push(we),U.push(ve)}else T(ee,we,b)||(ee!==U&&ee.push(we),U.push(ve))}return U}function Qx(u,h){return h=Cs(h,u),u=iI(u,h),u==null||delete u[to(fi(h))]}function T5(u,h,b,E){return $d(u,h,b(qa(u,h)),E)}function bg(u,h,b,E){for(var T=u.length,N=E?T:-1;(E?N--:++N<T)&&h(u[N],N,u););return b?di(u,E?0:N,E?N+1:T):di(u,E?N+1:0,E?T:N)}function A5(u,h){var b=u;return b instanceof Ct&&(b=b.value()),Px(h,function(E,T){return T.func.apply(T.thisArg,ys([E],T.args))},b)}function Zx(u,h,b){var E=u.length;if(E<2)return E?Ss(u[0]):[];for(var T=-1,N=ce(E);++T<E;)for(var z=u[T],U=-1;++U<E;)U!=T&&(N[T]=Rd(N[T]||z,u[U],h,b));return Ss(Bn(N,1),h,b)}function I5(u,h,b){for(var E=-1,T=u.length,N=h.length,z={};++E<T;){var U=E<N?h[E]:n;b(z,u[E],U)}return z}function Jx(u){return gn(u)?u:[]}function e1(u){return typeof u=="function"?u:xr}function Cs(u,h){return rt(u)?u:c1(u,h)?[u]:lI(Nt(u))}var ise=ft;function Es(u,h,b){var E=u.length;return b=b===n?E:b,!h&&b>=E?u:di(u,h,b)}var R5=qie||function(u){return zn.clearTimeout(u)};function N5(u,h){if(h)return u.slice();var b=u.length,E=n5?n5(b):new u.constructor(b);return u.copy(E),E}function t1(u){var h=new u.constructor(u.byteLength);return new ig(h).set(new ig(u)),h}function ose(u,h){var b=h?t1(u.buffer):u.buffer;return new u.constructor(b,u.byteOffset,u.byteLength)}function sse(u){var h=new u.constructor(u.source,je.exec(u));return h.lastIndex=u.lastIndex,h}function ase(u){return Ad?Bt(Ad.call(u)):{}}function L5(u,h){var b=h?t1(u.buffer):u.buffer;return new u.constructor(b,u.byteOffset,u.length)}function $5(u,h){if(u!==h){var b=u!==n,E=u===null,T=u===u,N=qr(u),z=h!==n,U=h===null,ee=h===h,me=qr(h);if(!U&&!me&&!N&&u>h||N&&z&&ee&&!U&&!me||E&&z&&ee||!b&&ee||!T)return 1;if(!E&&!N&&!me&&u<h||me&&b&&T&&!E&&!N||U&&b&&T||!z&&T||!ee)return-1}return 0}function lse(u,h,b){for(var E=-1,T=u.criteria,N=h.criteria,z=T.length,U=b.length;++E<z;){var ee=$5(T[E],N[E]);if(ee){if(E>=U)return ee;var me=b[E];return ee*(me=="desc"?-1:1)}}return u.index-h.index}function F5(u,h,b,E){for(var T=-1,N=u.length,z=b.length,U=-1,ee=h.length,me=En(N-z,0),ve=ce(ee+me),we=!E;++U<ee;)ve[U]=h[U];for(;++T<z;)(we||T<N)&&(ve[b[T]]=u[T]);for(;me--;)ve[U++]=u[T++];return ve}function j5(u,h,b,E){for(var T=-1,N=u.length,z=-1,U=b.length,ee=-1,me=h.length,ve=En(N-U,0),we=ce(ve+me),De=!E;++T<ve;)we[T]=u[T];for(var $e=T;++ee<me;)we[$e+ee]=h[ee];for(;++z<U;)(De||T<N)&&(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 N=-1,z=h.length;++N<z;){var U=h[N],ee=E?E(b[U],u[U],U,b,u):n;ee===n&&(ee=u[U]),T?Oo(b,U,ee):Id(b,U,ee)}return b}function cse(u,h){return eo(u,l1(u),h)}function use(u,h){return eo(u,Z5(u),h)}function yg(u,h){return function(b,E){var T=rt(b)?gie:Aoe,N=h?h():{};return T(b,u,He(E,2),N)}}function bc(u){return ft(function(h,b){var E=-1,T=b.length,N=T>1?b[T-1]:n,z=T>2?b[2]:n;for(N=u.length>3&&typeof N=="function"?(T--,N):n,z&&nr(b[0],b[1],z)&&(N=T<3?n:N,T=1),h=Bt(h);++E<T;){var U=b[E];U&&u(h,U,E,N)}return h})}function z5(u,h){return function(b,E){if(b==null)return b;if(!br(b))return u(b,E);for(var T=b.length,N=h?T:-1,z=Bt(b);(h?N--:++N<T)&&E(z[N],N,z)!==!1;);return b}}function B5(u){return function(h,b,E){for(var T=-1,N=Bt(h),z=E(h),U=z.length;U--;){var ee=z[u?U:++T];if(b(N[ee],ee,N)===!1)break}return h}}function dse(u,h,b){var E=h&x,T=Fd(u);function N(){var z=this&&this!==zn&&this instanceof N?T:u;return z.apply(E?b:this,arguments)}return N}function H5(u){return function(h){h=Nt(h);var b=dc(h)?Ci(h):n,E=b?b[0]:h.charAt(0),T=b?Es(b,1).join(""):h.slice(1);return E[u]()+T}}function yc(u){return function(h){return Px(zI(jI(h).replace(tie,"")),u,"")}}function Fd(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=vc(u.prototype),E=u.apply(b,h);return sn(E)?E:b}}function fse(u,h,b){var E=Fd(u);function T(){for(var N=arguments.length,z=ce(N),U=N,ee=xc(T);U--;)z[U]=arguments[U];var me=N<3&&z[0]!==ee&&z[N-1]!==ee?[]:xs(z,ee);if(N-=me.length,N<b)return G5(u,h,xg,T.placeholder,n,z,me,n,n,b-N);var ve=this&&this!==zn&&this instanceof T?E:u;return Hr(ve,this,z)}return T}function V5(u){return function(h,b,E){var T=Bt(h);if(!br(h)){var N=He(b,3);h=An(h),b=function(U){return N(T[U],U,T)}}var z=u(h,b,E);return z>-1?T[N?h[z]:z]:n}}function W5(u){return Mo(function(h){var b=h.length,E=b,T=ci.prototype.thru;for(u&&h.reverse();E--;){var N=h[E];if(typeof N!="function")throw new li(s);if(T&&!z&&Cg(N)=="wrapper")var z=new ci([],!0)}for(E=z?E:b;++E<b;){N=h[E];var U=Cg(N),ee=U=="wrapper"?s1(N):n;ee&&u1(ee[0])&&ee[1]==(A|C|P|L)&&!ee[4].length&&ee[9]==1?z=z[Cg(ee[0])].apply(z,ee[3]):z=N.length==1&&u1(N)?z[U]():z.thru(N)}return function(){var me=arguments,ve=me[0];if(z&&me.length==1&&rt(ve))return z.plant(ve).value();for(var we=0,De=b?h[we].apply(this,me):ve;++we<b;)De=h[we].call(this,De);return De}})}function xg(u,h,b,E,T,N,z,U,ee,me){var ve=h&A,we=h&x,De=h&w,$e=h&(C|O),We=h&F,ut=De?n:Fd(u);function qe(){for(var _t=arguments.length,Et=ce(_t),Ur=_t;Ur--;)Et[Ur]=arguments[Ur];if($e)var rr=xc(qe),Gr=Cie(Et,rr);if(E&&(Et=F5(Et,E,T,$e)),N&&(Et=j5(Et,N,z,$e)),_t-=Gr,$e&&_t<me){var mn=xs(Et,rr);return G5(u,h,xg,qe.placeholder,b,Et,mn,U,ee,me-_t)}var Oi=we?b:this,Io=De?Oi[u]:u;return _t=Et.length,U?Et=Ase(Et,U):We&&_t>1&&Et.reverse(),ve&&ee<_t&&(Et.length=ee),this&&this!==zn&&this instanceof qe&&(Io=ut||Fd(Io)),Io.apply(Oi,Et)}return qe}function q5(u,h){return function(b,E){return zoe(b,u,h(E),{})}}function wg(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=Wr(b),E=Wr(E)):(b=D5(b),E=D5(E)),T=u(b,E)}return T}}function n1(u){return Mo(function(h){return h=rn(h,Vr(He())),ft(function(b){var E=this;return u(h,function(T){return Hr(T,E,b)})})})}function _g(u,h){h=h===n?" ":Wr(h);var b=h.length;if(b<2)return b?Kx(h,u):h;var E=Kx(h,lg(u/fc(h)));return dc(h)?Es(Ci(E),0,u).join(""):E.slice(0,u)}function hse(u,h,b,E){var T=h&x,N=Fd(u);function z(){for(var U=-1,ee=arguments.length,me=-1,ve=E.length,we=ce(ve+ee),De=this&&this!==zn&&this instanceof z?N:u;++me<ve;)we[me]=E[me];for(;ee--;)we[me++]=arguments[++U];return Hr(De,T?b:this,we)}return z}function U5(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),Zoe(h,b,E,u)}}function Sg(u){return function(h,b){return typeof h=="string"&&typeof b=="string"||(h=hi(h),b=hi(b)),u(h,b)}}function G5(u,h,b,E,T,N,z,U,ee,me){var ve=h&C,we=ve?z:n,De=ve?n:z,$e=ve?N:n,We=ve?n:N;h|=ve?P:k,h&=~(ve?k:P),h&_||(h&=~(x|w));var ut=[u,h,T,$e,we,We,De,U,ee,me],qe=b.apply(n,ut);return u1(u)&&oI(qe,ut),qe.placeholder=E,sI(qe,u,h)}function r1(u){var h=Cn[u];return function(b,E){if(b=hi(b),E=E==null?0:Kn(at(E),292),E&&s5(b)){var T=(Nt(b)+"e").split("e"),N=h(T[0]+"e"+(+T[1]+E));return T=(Nt(N)+"e").split("e"),+(T[0]+"e"+(+T[1]-E))}return h(b)}}var pse=gc&&1/Zp(new gc([,-0]))[1]==j?function(u){return new gc(u)}:E1;function Y5(u){return function(h){var b=Xn(h);return b==Fe?Ix(h):b==Jt?Tie(h):Sie(h,u(h))}}function ko(u,h,b,E,T,N,z,U){var ee=h&w;if(!ee&&typeof u!="function")throw new li(s);var me=E?E.length:0;if(me||(h&=~(P|k),E=T=n),z=z===n?z:En(at(z),0),U=U===n?U:at(U),me-=T?T.length:0,h&k){var ve=E,we=T;E=T=n}var De=ee?n:s1(u),$e=[u,h,b,E,T,ve,we,N,z,U];if(De&&Mse($e,De),u=$e[0],h=$e[1],b=$e[2],E=$e[3],T=$e[4],U=$e[9]=$e[9]===n?ee?0:u.length:En($e[9]-me,0),!U&&h&(C|O)&&(h&=~(C|O)),!h||h==x)var We=dse(u,h,b);else h==C||h==O?We=fse(u,h,U):(h==P||h==(x|P))&&!T.length?We=hse(u,h,b,E):We=xg.apply(n,$e);var ut=De?k5:oI;return sI(ut(We,$e),u,h)}function K5(u,h,b,E){return u===n||Pi(u,pc[b])&&!Ft.call(E,b)?h:u}function X5(u,h,b,E,T,N){return sn(u)&&sn(h)&&(N.set(h,u),mg(u,h,n,X5,N),N.delete(h)),u}function gse(u){return Bd(u)?n:u}function Q5(u,h,b,E,T,N){var z=b&v,U=u.length,ee=h.length;if(U!=ee&&!(z&&ee>U))return!1;var me=N.get(u),ve=N.get(h);if(me&&ve)return me==h&&ve==u;var we=-1,De=!0,$e=b&y?new Va:n;for(N.set(u,h),N.set(h,u);++we<U;){var We=u[we],ut=h[we];if(E)var qe=z?E(ut,We,we,h,u,N):E(We,ut,we,u,h,N);if(qe!==n){if(qe)continue;De=!1;break}if($e){if(!Ox(h,function(_t,Et){if(!Od($e,Et)&&(We===_t||T(We,_t,b,E,N)))return $e.push(Et)})){De=!1;break}}else if(!(We===ut||T(We,ut,b,E,N))){De=!1;break}}return N.delete(u),N.delete(h),De}function mse(u,h,b,E,T,N,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||!N(new ig(u),new ig(h)));case ie:case J:case Ve:return Pi(+u,+h);case be:return u.name==h.name&&u.message==h.message;case tn:case Dn:return u==h+"";case Fe:var U=Ix;case Jt:var ee=E&v;if(U||(U=Zp),u.size!=h.size&&!ee)return!1;var me=z.get(u);if(me)return me==h;E|=y,z.set(u,h);var ve=Q5(U(u),U(h),E,T,N,z);return z.delete(u),ve;case fn:if(Ad)return Ad.call(u)==Ad.call(h)}return!1}function vse(u,h,b,E,T,N){var z=b&v,U=i1(u),ee=U.length,me=i1(h),ve=me.length;if(ee!=ve&&!z)return!1;for(var we=ee;we--;){var De=U[we];if(!(z?De in h:Ft.call(h,De)))return!1}var $e=N.get(u),We=N.get(h);if($e&&We)return $e==h&&We==u;var ut=!0;N.set(u,h),N.set(h,u);for(var qe=z;++we<ee;){De=U[we];var _t=u[De],Et=h[De];if(E)var Ur=z?E(Et,_t,De,h,u,N):E(_t,Et,De,u,h,N);if(!(Ur===n?_t===Et||T(_t,Et,b,E,N):Ur)){ut=!1;break}qe||(qe=De=="constructor")}if(ut&&!qe){var rr=u.constructor,Gr=h.constructor;rr!=Gr&&"constructor"in u&&"constructor"in h&&!(typeof rr=="function"&&rr instanceof rr&&typeof Gr=="function"&&Gr instanceof Gr)&&(ut=!1)}return N.delete(u),N.delete(h),ut}function Mo(u){return f1(rI(u,n,fI),u+"")}function i1(u){return v5(u,An,l1)}function o1(u){return v5(u,yr,Z5)}var s1=ug?function(u){return ug.get(u)}:E1;function Cg(u){for(var h=u.name+"",b=mc[h],E=Ft.call(mc,h)?b.length:0;E--;){var T=b[E],N=T.func;if(N==null||N==u)return T.name}return h}function xc(u){var h=Ft.call(I,"placeholder")?I:u;return h.placeholder}function He(){var u=I.iteratee||S1;return u=u===S1?x5:u,arguments.length?u(arguments[0],arguments[1]):u}function Eg(u,h){var b=u.__data__;return Ese(h)?b[typeof h=="string"?"string":"hash"]:b.map}function a1(u){for(var h=An(u),b=h.length;b--;){var E=h[b],T=u[E];h[b]=[E,T,tI(T)]}return h}function Ua(u,h){var b=kie(u,h);return y5(b)?b:n}function bse(u){var h=Ft.call(u,Ba),b=u[Ba];try{u[Ba]=n;var E=!0}catch{}var T=ng.call(u);return E&&(h?u[Ba]=b:delete u[Ba]),T}var l1=Nx?function(u){return u==null?[]:(u=Bt(u),bs(Nx(u),function(h){return i5.call(u,h)}))}:P1,Z5=Nx?function(u){for(var h=[];u;)ys(h,l1(u)),u=og(u);return h}:P1,Xn=tr;(Lx&&Xn(new Lx(new ArrayBuffer(1)))!=Xe||Md&&Xn(new Md)!=Fe||$x&&Xn($x.resolve())!=vt||gc&&Xn(new gc)!=Jt||Dd&&Xn(new Dd)!=fe)&&(Xn=function(u){var h=tr(u),b=h==St?u.constructor:n,E=b?Ga(b):"";if(E)switch(E){case eoe:return Xe;case toe:return Fe;case noe:return vt;case roe:return Jt;case ioe:return fe}return h});function yse(u,h,b){for(var E=-1,T=b.length;++E<T;){var N=b[E],z=N.size;switch(N.type){case"drop":u+=z;break;case"dropRight":h-=z;break;case"take":h=Kn(h,u+z);break;case"takeRight":u=En(u,h-z);break}}return{start:u,end:h}}function xse(u){var h=u.match(Pd);return h?h[1].split(M):[]}function J5(u,h,b){h=Cs(h,u);for(var E=-1,T=h.length,N=!1;++E<T;){var z=to(h[E]);if(!(N=u!=null&&b(u,z)))break;u=u[z]}return N||++E!=T?N:(T=u==null?0:u.length,!!T&&Ag(T)&&Do(z,T)&&(rt(u)||Ya(u)))}function wse(u){var h=u.length,b=new u.constructor(h);return h&&typeof u[0]=="string"&&Ft.call(u,"index")&&(b.index=u.index,b.input=u.input),b}function eI(u){return typeof u.constructor=="function"&&!jd(u)?vc(og(u)):{}}function _se(u,h,b){var E=u.constructor;switch(h){case Le:return t1(u);case ie:case J:return new E(+u);case Xe:return ose(u,b);case yt:case hn:case Sn:case Fn:case zr:case Br:case pn:case mr:case jn:return L5(u,b);case Fe:return new E;case Ve:case Dn:return new E(u);case tn:return sse(u);case Jt:return new E;case fn:return ase(u)}}function Sse(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(Ed,`{
|
|
67
|
+
/* [wrapped with `+h+`] */
|
|
68
|
+
`)}function Cse(u){return rt(u)||Ya(u)||!!(o5&&u&&u[o5])}function Do(u,h){var b=typeof u;return h=h??ne,!!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)?Pi(b[h],u):!1}function c1(u,h){if(rt(u))return!1;var b=typeof u;return b=="number"||b=="symbol"||b=="boolean"||u==null||qr(u)?!0:Na.test(u)||!Ra.test(u)||h!=null&&u in Bt(h)}function Ese(u){var h=typeof u;return h=="string"||h=="number"||h=="symbol"||h=="boolean"?u!=="__proto__":u===null}function u1(u){var h=Cg(u),b=I[h];if(typeof b!="function"||!(h in Ct.prototype))return!1;if(u===b)return!0;var E=s1(b);return!!E&&u===E[0]}function Pse(u){return!!t5&&t5 in u}var Ose=eg?To:O1;function jd(u){var h=u&&u.constructor,b=typeof h=="function"&&h.prototype||pc;return u===b}function tI(u){return u===u&&!sn(u)}function nI(u,h){return function(b){return b==null?!1:b[u]===h&&(h!==n||u in Bt(b))}}function kse(u){var h=Dg(u,function(E){return b.size===c&&b.clear(),E}),b=h.cache;return h}function Mse(u,h){var b=u[1],E=h[1],T=b|E,N=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(!(N||z))return u;E&x&&(u[2]=h[2],T|=b&x?0:_);var U=h[3];if(U){var ee=u[3];u[3]=ee?F5(ee,U,h[4]):U,u[4]=ee?xs(u[3],d):h[4]}return U=h[5],U&&(ee=u[5],u[5]=ee?j5(ee,U,h[6]):U,u[6]=ee?xs(u[5],d):h[6]),U=h[7],U&&(u[7]=U),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 Dse(u){var h=[];if(u!=null)for(var b in Bt(u))h.push(b);return h}function Tse(u){return ng.call(u)}function rI(u,h,b){return h=En(h===n?u.length-1:h,0),function(){for(var E=arguments,T=-1,N=En(E.length-h,0),z=ce(N);++T<N;)z[T]=E[h+T];T=-1;for(var U=ce(h+1);++T<h;)U[T]=E[T];return U[h]=b(z),Hr(u,this,U)}}function iI(u,h){return h.length<2?u:qa(u,di(h,0,-1))}function Ase(u,h){for(var b=u.length,E=Kn(h.length,b),T=vr(u);E--;){var N=h[E];u[E]=Do(N,b)?T[N]:n}return u}function d1(u,h){if(!(h==="constructor"&&typeof u[h]=="function")&&h!="__proto__")return u[h]}var oI=aI(k5),zd=Gie||function(u,h){return zn.setTimeout(u,h)},f1=aI(tse);function sI(u,h,b){var E=h+"";return f1(u,Sse(E,Ise(xse(E),b)))}function aI(u){var h=0,b=0;return function(){var E=Qie(),T=K-(E-b);if(b=E,T>0){if(++h>=V)return arguments[0]}else h=0;return u.apply(n,arguments)}}function Pg(u,h){var b=-1,E=u.length,T=E-1;for(h=h===n?E:h;++b<h;){var N=Yx(b,T),z=u[N];u[N]=u[b],u[b]=z}return u.length=h,u}var lI=kse(function(u){var h=[];return u.charCodeAt(0)===46&&h.push(""),u.replace(Sd,function(b,E,T,N){h.push(T?N.replace(Se,"$1"):E||b)}),h});function to(u){if(typeof u=="string"||qr(u))return u;var h=u+"";return h=="0"&&1/u==-j?"-0":h}function Ga(u){if(u!=null){try{return tg.call(u)}catch{}try{return u+""}catch{}}return""}function Ise(u,h){return ai(te,function(b){var E="_."+b[0];h&b[1]&&!Xp(u,E)&&u.push(E)}),u.sort()}function cI(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 Rse(u,h,b){(b?nr(u,h,b):h===n)?h=1:h=En(at(h),0);var E=u==null?0:u.length;if(!E||h<1)return[];for(var T=0,N=0,z=ce(lg(E/h));T<E;)z[N++]=di(u,T,T+=h);return z}function Nse(u){for(var h=-1,b=u==null?0:u.length,E=0,T=[];++h<b;){var N=u[h];N&&(T[E++]=N)}return T}function Lse(){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 ys(rt(b)?vr(b):[b],Bn(h,1))}var $se=ft(function(u,h){return gn(u)?Rd(u,Bn(h,1,gn,!0)):[]}),Fse=ft(function(u,h){var b=fi(h);return gn(b)&&(b=n),gn(u)?Rd(u,Bn(h,1,gn,!0),He(b,2)):[]}),jse=ft(function(u,h){var b=fi(h);return gn(b)&&(b=n),gn(u)?Rd(u,Bn(h,1,gn,!0),n,b):[]});function zse(u,h,b){var E=u==null?0:u.length;return E?(h=b||h===n?1:at(h),di(u,h<0?0:h,E)):[]}function Bse(u,h,b){var E=u==null?0:u.length;return E?(h=b||h===n?1:at(h),h=E-h,di(u,0,h<0?0:h)):[]}function Hse(u,h){return u&&u.length?bg(u,He(h,3),!0,!0):[]}function Vse(u,h){return u&&u.length?bg(u,He(h,3),!0):[]}function Wse(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),Loe(u,h,b,E)):[]}function uI(u,h,b){var E=u==null?0:u.length;if(!E)return-1;var T=b==null?0:at(b);return T<0&&(T=En(E+T,0)),Qp(u,He(h,3),T)}function dI(u,h,b){var E=u==null?0:u.length;if(!E)return-1;var T=E-1;return b!==n&&(T=at(b),T=b<0?En(E+T,0):Kn(T,E-1)),Qp(u,He(h,3),T,!0)}function fI(u){var h=u==null?0:u.length;return h?Bn(u,1):[]}function qse(u){var h=u==null?0:u.length;return h?Bn(u,j):[]}function Use(u,h){var b=u==null?0:u.length;return b?(h=h===n?1:at(h),Bn(u,h)):[]}function Gse(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 hI(u){return u&&u.length?u[0]:n}function Yse(u,h,b){var E=u==null?0:u.length;if(!E)return-1;var T=b==null?0:at(b);return T<0&&(T=En(E+T,0)),uc(u,h,T)}function Kse(u){var h=u==null?0:u.length;return h?di(u,0,-1):[]}var Xse=ft(function(u){var h=rn(u,Jx);return h.length&&h[0]===u[0]?Vx(h):[]}),Qse=ft(function(u){var h=fi(u),b=rn(u,Jx);return h===fi(b)?h=n:b.pop(),b.length&&b[0]===u[0]?Vx(b,He(h,2)):[]}),Zse=ft(function(u){var h=fi(u),b=rn(u,Jx);return h=typeof h=="function"?h:n,h&&b.pop(),b.length&&b[0]===u[0]?Vx(b,n,h):[]});function Jse(u,h){return u==null?"":Kie.call(u,h)}function fi(u){var h=u==null?0:u.length;return h?u[h-1]:n}function eae(u,h,b){var E=u==null?0:u.length;if(!E)return-1;var T=E;return b!==n&&(T=at(b),T=T<0?En(E+T,0):Kn(T,E-1)),h===h?Iie(u,h,T):Qp(u,GA,T,!0)}function tae(u,h){return u&&u.length?C5(u,at(h)):n}var nae=ft(pI);function pI(u,h){return u&&u.length&&h&&h.length?Gx(u,h):u}function rae(u,h,b){return u&&u.length&&h&&h.length?Gx(u,h,He(b,2)):u}function iae(u,h,b){return u&&u.length&&h&&h.length?Gx(u,h,n,b):u}var oae=Mo(function(u,h){var b=u==null?0:u.length,E=jx(u,h);return O5(u,rn(h,function(T){return Do(T,b)?+T:T}).sort($5)),E});function sae(u,h){var b=[];if(!(u&&u.length))return b;var E=-1,T=[],N=u.length;for(h=He(h,3);++E<N;){var z=u[E];h(z,E,u)&&(b.push(z),T.push(E))}return O5(u,T),b}function h1(u){return u==null?u:Jie.call(u)}function aae(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:at(h),b=b===n?E:at(b)),di(u,h,b)):[]}function lae(u,h){return vg(u,h)}function cae(u,h,b){return Xx(u,h,He(b,2))}function uae(u,h){var b=u==null?0:u.length;if(b){var E=vg(u,h);if(E<b&&Pi(u[E],h))return E}return-1}function dae(u,h){return vg(u,h,!0)}function fae(u,h,b){return Xx(u,h,He(b,2),!0)}function hae(u,h){var b=u==null?0:u.length;if(b){var E=vg(u,h,!0)-1;if(Pi(u[E],h))return E}return-1}function pae(u){return u&&u.length?M5(u):[]}function gae(u,h){return u&&u.length?M5(u,He(h,2)):[]}function mae(u){var h=u==null?0:u.length;return h?di(u,1,h):[]}function vae(u,h,b){return u&&u.length?(h=b||h===n?1:at(h),di(u,0,h<0?0:h)):[]}function bae(u,h,b){var E=u==null?0:u.length;return E?(h=b||h===n?1:at(h),h=E-h,di(u,h<0?0:h,E)):[]}function yae(u,h){return u&&u.length?bg(u,He(h,3),!1,!0):[]}function xae(u,h){return u&&u.length?bg(u,He(h,3)):[]}var wae=ft(function(u){return Ss(Bn(u,1,gn,!0))}),_ae=ft(function(u){var h=fi(u);return gn(h)&&(h=n),Ss(Bn(u,1,gn,!0),He(h,2))}),Sae=ft(function(u){var h=fi(u);return h=typeof h=="function"?h:n,Ss(Bn(u,1,gn,!0),n,h)});function Cae(u){return u&&u.length?Ss(u):[]}function Eae(u,h){return u&&u.length?Ss(u,He(h,2)):[]}function Pae(u,h){return h=typeof h=="function"?h:n,u&&u.length?Ss(u,n,h):[]}function p1(u){if(!(u&&u.length))return[];var h=0;return u=bs(u,function(b){if(gn(b))return h=En(b.length,h),!0}),Tx(h,function(b){return rn(u,kx(b))})}function gI(u,h){if(!(u&&u.length))return[];var b=p1(u);return h==null?b:rn(b,function(E){return Hr(h,n,E)})}var Oae=ft(function(u,h){return gn(u)?Rd(u,h):[]}),kae=ft(function(u){return Zx(bs(u,gn))}),Mae=ft(function(u){var h=fi(u);return gn(h)&&(h=n),Zx(bs(u,gn),He(h,2))}),Dae=ft(function(u){var h=fi(u);return h=typeof h=="function"?h:n,Zx(bs(u,gn),n,h)}),Tae=ft(p1);function Aae(u,h){return I5(u||[],h||[],Id)}function Iae(u,h){return I5(u||[],h||[],$d)}var Rae=ft(function(u){var h=u.length,b=h>1?u[h-1]:n;return b=typeof b=="function"?(u.pop(),b):n,gI(u,b)});function mI(u){var h=I(u);return h.__chain__=!0,h}function Nae(u,h){return h(u),u}function Og(u,h){return h(u)}var Lae=Mo(function(u){var h=u.length,b=h?u[0]:0,E=this.__wrapped__,T=function(N){return jx(N,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:Og,args:[T],thisArg:n}),new ci(E,this.__chain__).thru(function(N){return h&&!N.length&&N.push(n),N}))});function $ae(){return mI(this)}function Fae(){return new ci(this.value(),this.__chain__)}function jae(){this.__values__===n&&(this.__values__=DI(this.value()));var u=this.__index__>=this.__values__.length,h=u?n:this.__values__[this.__index__++];return{done:u,value:h}}function zae(){return this}function Bae(u){for(var h,b=this;b instanceof fg;){var E=cI(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 Hae(){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:Og,args:[h1],thisArg:n}),new ci(h,this.__chain__)}return this.thru(h1)}function Vae(){return A5(this.__wrapped__,this.__actions__)}var Wae=yg(function(u,h,b){Ft.call(u,b)?++u[b]:Oo(u,b,1)});function qae(u,h,b){var E=rt(u)?qA:Noe;return b&&nr(u,h,b)&&(h=n),E(u,He(h,3))}function Uae(u,h){var b=rt(u)?bs:g5;return b(u,He(h,3))}var Gae=V5(uI),Yae=V5(dI);function Kae(u,h){return Bn(kg(u,h),1)}function Xae(u,h){return Bn(kg(u,h),j)}function Qae(u,h,b){return b=b===n?1:at(b),Bn(kg(u,h),b)}function vI(u,h){var b=rt(u)?ai:_s;return b(u,He(h,3))}function bI(u,h){var b=rt(u)?mie:p5;return b(u,He(h,3))}var Zae=yg(function(u,h,b){Ft.call(u,b)?u[b].push(h):Oo(u,b,[h])});function Jae(u,h,b,E){u=br(u)?u:_c(u),b=b&&!E?at(b):0;var T=u.length;return b<0&&(b=En(T+b,0)),Ig(u)?b<=T&&u.indexOf(h,b)>-1:!!T&&uc(u,h,b)>-1}var ele=ft(function(u,h,b){var E=-1,T=typeof h=="function",N=br(u)?ce(u.length):[];return _s(u,function(z){N[++E]=T?Hr(h,z,b):Nd(z,h,b)}),N}),tle=yg(function(u,h,b){Oo(u,b,h)});function kg(u,h){var b=rt(u)?rn:w5;return b(u,He(h,3))}function nle(u,h,b,E){return u==null?[]:(rt(h)||(h=h==null?[]:[h]),b=E?n:b,rt(b)||(b=b==null?[]:[b]),E5(u,h,b))}var rle=yg(function(u,h,b){u[b?0:1].push(h)},function(){return[[],[]]});function ile(u,h,b){var E=rt(u)?Px:KA,T=arguments.length<3;return E(u,He(h,4),b,T,_s)}function ole(u,h,b){var E=rt(u)?vie:KA,T=arguments.length<3;return E(u,He(h,4),b,T,p5)}function sle(u,h){var b=rt(u)?bs:g5;return b(u,Tg(He(h,3)))}function ale(u){var h=rt(u)?u5:Joe;return h(u)}function lle(u,h,b){(b?nr(u,h,b):h===n)?h=1:h=at(h);var E=rt(u)?Doe:ese;return E(u,h)}function cle(u){var h=rt(u)?Toe:nse;return h(u)}function ule(u){if(u==null)return 0;if(br(u))return Ig(u)?fc(u):u.length;var h=Xn(u);return h==Fe||h==Jt?u.size:qx(u).length}function dle(u,h,b){var E=rt(u)?Ox:rse;return b&&nr(u,h,b)&&(h=n),E(u,He(h,3))}var fle=ft(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]]),E5(u,Bn(h,1),[])}),Mg=Uie||function(){return zn.Date.now()};function hle(u,h){if(typeof h!="function")throw new li(s);return u=at(u),function(){if(--u<1)return h.apply(this,arguments)}}function yI(u,h,b){return h=b?n:h,h=u&&h==null?u.length:h,ko(u,A,n,n,n,n,h)}function xI(u,h){var b;if(typeof h!="function")throw new li(s);return u=at(u),function(){return--u>0&&(b=h.apply(this,arguments)),u<=1&&(h=n),b}}var g1=ft(function(u,h,b){var E=x;if(b.length){var T=xs(b,xc(g1));E|=P}return ko(u,E,h,b,T)}),wI=ft(function(u,h,b){var E=x|w;if(b.length){var T=xs(b,xc(wI));E|=P}return ko(h,E,u,b,T)});function _I(u,h,b){h=b?n:h;var E=ko(u,C,n,n,n,n,n,h);return E.placeholder=_I.placeholder,E}function SI(u,h,b){h=b?n:h;var E=ko(u,O,n,n,n,n,n,h);return E.placeholder=SI.placeholder,E}function CI(u,h,b){var E,T,N,z,U,ee,me=0,ve=!1,we=!1,De=!0;if(typeof u!="function")throw new li(s);h=hi(h)||0,sn(b)&&(ve=!!b.leading,we="maxWait"in b,N=we?En(hi(b.maxWait)||0,h):N,De="trailing"in b?!!b.trailing:De);function $e(mn){var Oi=E,Io=T;return E=T=n,me=mn,z=u.apply(Io,Oi),z}function We(mn){return me=mn,U=zd(_t,h),ve?$e(mn):z}function ut(mn){var Oi=mn-ee,Io=mn-me,VI=h-Oi;return we?Kn(VI,N-Io):VI}function qe(mn){var Oi=mn-ee,Io=mn-me;return ee===n||Oi>=h||Oi<0||we&&Io>=N}function _t(){var mn=Mg();if(qe(mn))return Et(mn);U=zd(_t,ut(mn))}function Et(mn){return U=n,De&&E?$e(mn):(E=T=n,z)}function Ur(){U!==n&&R5(U),me=0,E=ee=T=U=n}function rr(){return U===n?z:Et(Mg())}function Gr(){var mn=Mg(),Oi=qe(mn);if(E=arguments,T=this,ee=mn,Oi){if(U===n)return We(ee);if(we)return R5(U),U=zd(_t,h),$e(ee)}return U===n&&(U=zd(_t,h)),z}return Gr.cancel=Ur,Gr.flush=rr,Gr}var ple=ft(function(u,h){return h5(u,1,h)}),gle=ft(function(u,h,b){return h5(u,hi(h)||0,b)});function mle(u){return ko(u,F)}function Dg(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],N=b.cache;if(N.has(T))return N.get(T);var z=u.apply(this,E);return b.cache=N.set(T,z)||N,z};return b.cache=new(Dg.Cache||Po),b}Dg.Cache=Po;function Tg(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 vle(u){return xI(2,u)}var ble=ise(function(u,h){h=h.length==1&&rt(h[0])?rn(h[0],Vr(He())):rn(Bn(h,1),Vr(He()));var b=h.length;return ft(function(E){for(var T=-1,N=Kn(E.length,b);++T<N;)E[T]=h[T].call(this,E[T]);return Hr(u,this,E)})}),m1=ft(function(u,h){var b=xs(h,xc(m1));return ko(u,P,n,h,b)}),EI=ft(function(u,h){var b=xs(h,xc(EI));return ko(u,k,n,h,b)}),yle=Mo(function(u,h){return ko(u,L,n,n,n,h)});function xle(u,h){if(typeof u!="function")throw new li(s);return h=h===n?h:at(h),ft(u,h)}function wle(u,h){if(typeof u!="function")throw new li(s);return h=h==null?0:En(at(h),0),ft(function(b){var E=b[h],T=Es(b,0,h);return E&&ys(T,E),Hr(u,this,T)})}function _le(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),CI(u,h,{leading:E,maxWait:h,trailing:T})}function Sle(u){return yI(u,1)}function Cle(u,h){return m1(e1(h),u)}function Ele(){if(!arguments.length)return[];var u=arguments[0];return rt(u)?u:[u]}function Ple(u){return ui(u,p)}function Ole(u,h){return h=typeof h=="function"?h:n,ui(u,p,h)}function kle(u){return ui(u,f|p)}function Mle(u,h){return h=typeof h=="function"?h:n,ui(u,f|p,h)}function Dle(u,h){return h==null||f5(u,h,An(h))}function Pi(u,h){return u===h||u!==u&&h!==h}var Tle=Sg(Hx),Ale=Sg(function(u,h){return u>=h}),Ya=b5(function(){return arguments}())?b5:function(u){return un(u)&&Ft.call(u,"callee")&&!i5.call(u,"callee")},rt=ce.isArray,Ile=jA?Vr(jA):Boe;function br(u){return u!=null&&Ag(u.length)&&!To(u)}function gn(u){return un(u)&&br(u)}function Rle(u){return u===!0||u===!1||un(u)&&tr(u)==ie}var Ps=Yie||O1,Nle=zA?Vr(zA):Hoe;function Lle(u){return un(u)&&u.nodeType===1&&!Bd(u)}function $le(u){if(u==null)return!0;if(br(u)&&(rt(u)||typeof u=="string"||typeof u.splice=="function"||Ps(u)||wc(u)||Ya(u)))return!u.length;var h=Xn(u);if(h==Fe||h==Jt)return!u.size;if(jd(u))return!qx(u).length;for(var b in u)if(Ft.call(u,b))return!1;return!0}function Fle(u,h){return Ld(u,h)}function jle(u,h,b){b=typeof b=="function"?b:n;var E=b?b(u,h):n;return E===n?Ld(u,h,n,b):!!E}function v1(u){if(!un(u))return!1;var h=tr(u);return h==be||h==W||typeof u.message=="string"&&typeof u.name=="string"&&!Bd(u)}function zle(u){return typeof u=="number"&&s5(u)}function To(u){if(!sn(u))return!1;var h=tr(u);return h==oe||h==Te||h==de||h==bt}function PI(u){return typeof u=="number"&&u==at(u)}function Ag(u){return typeof u=="number"&&u>-1&&u%1==0&&u<=ne}function sn(u){var h=typeof u;return u!=null&&(h=="object"||h=="function")}function un(u){return u!=null&&typeof u=="object"}var OI=BA?Vr(BA):Woe;function Ble(u,h){return u===h||Wx(u,h,a1(h))}function Hle(u,h,b){return b=typeof b=="function"?b:n,Wx(u,h,a1(h),b)}function Vle(u){return kI(u)&&u!=+u}function Wle(u){if(Ose(u))throw new Je(o);return y5(u)}function qle(u){return u===null}function Ule(u){return u==null}function kI(u){return typeof u=="number"||un(u)&&tr(u)==Ve}function Bd(u){if(!un(u)||tr(u)!=St)return!1;var h=og(u);if(h===null)return!0;var b=Ft.call(h,"constructor")&&h.constructor;return typeof b=="function"&&b instanceof b&&tg.call(b)==Hie}var b1=HA?Vr(HA):qoe;function Gle(u){return PI(u)&&u>=-ne&&u<=ne}var MI=VA?Vr(VA):Uoe;function Ig(u){return typeof u=="string"||!rt(u)&&un(u)&&tr(u)==Dn}function qr(u){return typeof u=="symbol"||un(u)&&tr(u)==fn}var wc=WA?Vr(WA):Goe;function Yle(u){return u===n}function Kle(u){return un(u)&&Xn(u)==fe}function Xle(u){return un(u)&&tr(u)==Pe}var Qle=Sg(Ux),Zle=Sg(function(u,h){return u<=h});function DI(u){if(!u)return[];if(br(u))return Ig(u)?Ci(u):vr(u);if(kd&&u[kd])return Die(u[kd]());var h=Xn(u),b=h==Fe?Ix:h==Jt?Zp:_c;return b(u)}function Ao(u){if(!u)return u===0?u:0;if(u=hi(u),u===j||u===-j){var h=u<0?-1:1;return h*se}return u===u?u:0}function at(u){var h=Ao(u),b=h%1;return h===h?b?h-b:h:0}function TI(u){return u?Wa(at(u),0,q):0}function hi(u){if(typeof u=="number")return u;if(qr(u))return D;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=XA(u);var b=Me.test(u);return b||Ze.test(u)?hie(u.slice(2),b?2:8):Ae.test(u)?D:+u}function AI(u){return eo(u,yr(u))}function Jle(u){return u?Wa(at(u),-ne,ne):u===0?u:0}function Nt(u){return u==null?"":Wr(u)}var ece=bc(function(u,h){if(jd(h)||br(h)){eo(h,An(h),u);return}for(var b in h)Ft.call(h,b)&&Id(u,b,h[b])}),II=bc(function(u,h){eo(h,yr(h),u)}),Rg=bc(function(u,h,b,E){eo(h,yr(h),u,E)}),tce=bc(function(u,h,b,E){eo(h,An(h),u,E)}),nce=Mo(jx);function rce(u,h){var b=vc(u);return h==null?b:d5(b,h)}var ice=ft(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 N=h[b],z=yr(N),U=-1,ee=z.length;++U<ee;){var me=z[U],ve=u[me];(ve===n||Pi(ve,pc[me])&&!Ft.call(u,me))&&(u[me]=N[me])}return u}),oce=ft(function(u){return u.push(n,X5),Hr(RI,n,u)});function sce(u,h){return UA(u,He(h,3),Ji)}function ace(u,h){return UA(u,He(h,3),Bx)}function lce(u,h){return u==null?u:zx(u,He(h,3),yr)}function cce(u,h){return u==null?u:m5(u,He(h,3),yr)}function uce(u,h){return u&&Ji(u,He(h,3))}function dce(u,h){return u&&Bx(u,He(h,3))}function fce(u){return u==null?[]:gg(u,An(u))}function hce(u){return u==null?[]:gg(u,yr(u))}function y1(u,h,b){var E=u==null?n:qa(u,h);return E===n?b:E}function pce(u,h){return u!=null&&J5(u,h,$oe)}function x1(u,h){return u!=null&&J5(u,h,Foe)}var gce=q5(function(u,h,b){h!=null&&typeof h.toString!="function"&&(h=ng.call(h)),u[h]=b},_1(xr)),mce=q5(function(u,h,b){h!=null&&typeof h.toString!="function"&&(h=ng.call(h)),Ft.call(u,h)?u[h].push(b):u[h]=[b]},He),vce=ft(Nd);function An(u){return br(u)?c5(u):qx(u)}function yr(u){return br(u)?c5(u,!0):Yoe(u)}function bce(u,h){var b={};return h=He(h,3),Ji(u,function(E,T,N){Oo(b,h(E,T,N),E)}),b}function yce(u,h){var b={};return h=He(h,3),Ji(u,function(E,T,N){Oo(b,T,h(E,T,N))}),b}var xce=bc(function(u,h,b){mg(u,h,b)}),RI=bc(function(u,h,b,E){mg(u,h,b,E)}),wce=Mo(function(u,h){var b={};if(u==null)return b;var E=!1;h=rn(h,function(N){return N=Cs(N,u),E||(E=N.length>1),N}),eo(u,o1(u),b),E&&(b=ui(b,f|g|p,gse));for(var T=h.length;T--;)Qx(b,h[T]);return b});function _ce(u,h){return NI(u,Tg(He(h)))}var Sce=Mo(function(u,h){return u==null?{}:Xoe(u,h)});function NI(u,h){if(u==null)return{};var b=rn(o1(u),function(E){return[E]});return h=He(h),P5(u,b,function(E,T){return h(E,T[0])})}function Cce(u,h,b){h=Cs(h,u);var E=-1,T=h.length;for(T||(T=1,u=n);++E<T;){var N=u==null?n:u[to(h[E])];N===n&&(E=T,N=b),u=To(N)?N.call(u):N}return u}function Ece(u,h,b){return u==null?u:$d(u,h,b)}function Pce(u,h,b,E){return E=typeof E=="function"?E:n,u==null?u:$d(u,h,b,E)}var LI=Y5(An),$I=Y5(yr);function Oce(u,h,b){var E=rt(u),T=E||Ps(u)||wc(u);if(h=He(h,4),b==null){var N=u&&u.constructor;T?b=E?new N:[]:sn(u)?b=To(N)?vc(og(u)):{}:b={}}return(T?ai:Ji)(u,function(z,U,ee){return h(b,z,U,ee)}),b}function kce(u,h){return u==null?!0:Qx(u,h)}function Mce(u,h,b){return u==null?u:T5(u,h,e1(b))}function Dce(u,h,b,E){return E=typeof E=="function"?E:n,u==null?u:T5(u,h,e1(b),E)}function _c(u){return u==null?[]:Ax(u,An(u))}function Tce(u){return u==null?[]:Ax(u,yr(u))}function Ace(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),Wa(hi(u),h,b)}function Ice(u,h,b){return h=Ao(h),b===n?(b=h,h=0):b=Ao(b),u=hi(u),joe(u,h,b)}function Rce(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=a5();return Kn(u+T*(h-u+fie("1e-"+((T+"").length-1))),h)}return Yx(u,h)}var Nce=yc(function(u,h,b){return h=h.toLowerCase(),u+(b?FI(h):h)});function FI(u){return w1(Nt(u).toLowerCase())}function jI(u){return u=Nt(u),u&&u.replace(zt,Eie).replace(nie,"")}function Lce(u,h,b){u=Nt(u),h=Wr(h);var E=u.length;b=b===n?E:Wa(at(b),0,E);var T=b;return b-=h.length,b>=0&&u.slice(b,T)==h}function $ce(u){return u=Nt(u),u&&Aa.test(u)?u.replace(Zi,Pie):u}function Fce(u){return u=Nt(u),u&&$a.test(u)?u.replace(La,"\\$&"):u}var jce=yc(function(u,h,b){return u+(b?"-":"")+h.toLowerCase()}),zce=yc(function(u,h,b){return u+(b?" ":"")+h.toLowerCase()}),Bce=H5("toLowerCase");function Hce(u,h,b){u=Nt(u),h=at(h);var E=h?fc(u):0;if(!h||E>=h)return u;var T=(h-E)/2;return _g(cg(T),b)+u+_g(lg(T),b)}function Vce(u,h,b){u=Nt(u),h=at(h);var E=h?fc(u):0;return h&&E<h?u+_g(h-E,b):u}function Wce(u,h,b){u=Nt(u),h=at(h);var E=h?fc(u):0;return h&&E<h?_g(h-E,b)+u:u}function qce(u,h,b){return b||h==null?h=0:h&&(h=+h),Zie(Nt(u).replace(Fa,""),h||0)}function Uce(u,h,b){return(b?nr(u,h,b):h===n)?h=1:h=at(h),Kx(Nt(u),h)}function Gce(){var u=arguments,h=Nt(u[0]);return u.length<3?h:h.replace(u[1],u[2])}var Yce=yc(function(u,h,b){return u+(b?"_":"")+h.toLowerCase()});function Kce(u,h,b){return b&&typeof b!="number"&&nr(u,h,b)&&(h=b=n),b=b===n?q:b>>>0,b?(u=Nt(u),u&&(typeof h=="string"||h!=null&&!b1(h))&&(h=Wr(h),!h&&dc(u))?Es(Ci(u),0,b):u.split(h,b)):[]}var Xce=yc(function(u,h,b){return u+(b?" ":"")+w1(h)});function Qce(u,h,b){return u=Nt(u),b=b==null?0:Wa(at(b),0,u.length),h=Wr(h),u.slice(b,b+h.length)==h}function Zce(u,h,b){var E=I.templateSettings;b&&nr(u,h,b)&&(h=n),u=Nt(u),h=Rg({},h,E,K5);var T=Rg({},h.imports,E.imports,K5),N=An(T),z=Ax(T,N),U,ee,me=0,ve=h.interpolate||Tn,we="__p += '",De=Rx((h.escape||Tn).source+"|"+ve.source+"|"+(ve===lc?Ne:Tn).source+"|"+(h.evaluate||Tn).source+"|$","g"),$e="//# sourceURL="+(Ft.call(h,"sourceURL")?(h.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++aie+"]")+`
|
|
69
|
+
`;u.replace(De,function(qe,_t,Et,Ur,rr,Gr){return Et||(Et=Ur),we+=u.slice(me,Gr).replace(ja,Oie),_t&&(U=!0,we+=`' +
|
|
70
|
+
__e(`+_t+`) +
|
|
71
|
+
'`),rr&&(ee=!0,we+=`';
|
|
72
|
+
`+rr+`;
|
|
73
|
+
__p += '`),Et&&(we+=`' +
|
|
74
|
+
((__t = (`+Et+`)) == null ? '' : __t) +
|
|
75
|
+
'`),me=Gr+qe.length,qe}),we+=`';
|
|
76
|
+
`;var We=Ft.call(h,"variable")&&h.variable;if(!We)we=`with (obj) {
|
|
77
|
+
`+we+`
|
|
78
|
+
}
|
|
79
|
+
`;else if(ae.test(We))throw new Je(a);we=(ee?we.replace(wd,""):we).replace(So,"$1").replace(Ta,"$1;"),we="function("+(We||"obj")+`) {
|
|
80
|
+
`+(We?"":`obj || (obj = {});
|
|
81
|
+
`)+"var __t, __p = ''"+(U?", __e = _.escape":"")+(ee?`, __j = Array.prototype.join;
|
|
82
|
+
function print() { __p += __j.call(arguments, '') }
|
|
83
|
+
`:`;
|
|
84
|
+
`)+we+`return __p
|
|
85
|
+
}`;var ut=BI(function(){return Tt(N,$e+"return "+we).apply(n,z)});if(ut.source=we,v1(ut))throw ut;return ut}function Jce(u){return Nt(u).toLowerCase()}function eue(u){return Nt(u).toUpperCase()}function tue(u,h,b){if(u=Nt(u),u&&(b||h===n))return XA(u);if(!u||!(h=Wr(h)))return u;var E=Ci(u),T=Ci(h),N=QA(E,T),z=ZA(E,T)+1;return Es(E,N,z).join("")}function nue(u,h,b){if(u=Nt(u),u&&(b||h===n))return u.slice(0,e5(u)+1);if(!u||!(h=Wr(h)))return u;var E=Ci(u),T=ZA(E,Ci(h))+1;return Es(E,0,T).join("")}function rue(u,h,b){if(u=Nt(u),u&&(b||h===n))return u.replace(Fa,"");if(!u||!(h=Wr(h)))return u;var E=Ci(u),T=QA(E,Ci(h));return Es(E,T).join("")}function iue(u,h){var b=B,E=H;if(sn(h)){var T="separator"in h?h.separator:T;b="length"in h?at(h.length):b,E="omission"in h?Wr(h.omission):E}u=Nt(u);var N=u.length;if(dc(u)){var z=Ci(u);N=z.length}if(b>=N)return u;var U=b-fc(E);if(U<1)return E;var ee=z?Es(z,0,U).join(""):u.slice(0,U);if(T===n)return ee+E;if(z&&(U+=ee.length-U),b1(T)){if(u.slice(U).search(T)){var me,ve=ee;for(T.global||(T=Rx(T.source,Nt(je.exec(T))+"g")),T.lastIndex=0;me=T.exec(ve);)var we=me.index;ee=ee.slice(0,we===n?U:we)}}else if(u.indexOf(Wr(T),U)!=U){var De=ee.lastIndexOf(T);De>-1&&(ee=ee.slice(0,De))}return ee+E}function oue(u){return u=Nt(u),u&&Co.test(u)?u.replace(Yn,Rie):u}var sue=yc(function(u,h,b){return u+(b?" ":"")+h.toUpperCase()}),w1=H5("toUpperCase");function zI(u,h,b){return u=Nt(u),h=b?n:h,h===n?Mie(u)?$ie(u):xie(u):u.match(h)||[]}var BI=ft(function(u,h){try{return Hr(u,n,h)}catch(b){return v1(b)?b:new Je(b)}}),aue=Mo(function(u,h){return ai(h,function(b){b=to(b),Oo(u,b,g1(u[b],u))}),u});function lue(u){var h=u==null?0:u.length,b=He();return u=h?rn(u,function(E){if(typeof E[1]!="function")throw new li(s);return[b(E[0]),E[1]]}):[],ft(function(E){for(var T=-1;++T<h;){var N=u[T];if(Hr(N[0],this,E))return Hr(N[1],this,E)}})}function cue(u){return Roe(ui(u,f))}function _1(u){return function(){return u}}function uue(u,h){return u==null||u!==u?h:u}var due=W5(),fue=W5(!0);function xr(u){return u}function S1(u){return x5(typeof u=="function"?u:ui(u,f))}function hue(u){return _5(ui(u,f))}function pue(u,h){return S5(u,ui(h,f))}var gue=ft(function(u,h){return function(b){return Nd(b,u,h)}}),mue=ft(function(u,h){return function(b){return Nd(u,b,h)}});function C1(u,h,b){var E=An(h),T=gg(h,E);b==null&&!(sn(h)&&(T.length||!E.length))&&(b=h,h=u,u=this,T=gg(h,An(h)));var N=!(sn(b)&&"chain"in b)||!!b.chain,z=To(u);return ai(T,function(U){var ee=h[U];u[U]=ee,z&&(u.prototype[U]=function(){var me=this.__chain__;if(N||me){var ve=u(this.__wrapped__),we=ve.__actions__=vr(this.__actions__);return we.push({func:ee,args:arguments,thisArg:u}),ve.__chain__=me,ve}return ee.apply(u,ys([this.value()],arguments))})}),u}function vue(){return zn._===this&&(zn._=Vie),this}function E1(){}function bue(u){return u=at(u),ft(function(h){return C5(h,u)})}var yue=n1(rn),xue=n1(qA),wue=n1(Ox);function HI(u){return c1(u)?kx(to(u)):Qoe(u)}function _ue(u){return function(h){return u==null?n:qa(u,h)}}var Sue=U5(),Cue=U5(!0);function P1(){return[]}function O1(){return!1}function Eue(){return{}}function Pue(){return""}function Oue(){return!0}function kue(u,h){if(u=at(u),u<1||u>ne)return[];var b=q,E=Kn(u,q);h=He(h),u-=q;for(var T=Tx(E,h);++b<u;)h(b);return T}function Mue(u){return rt(u)?rn(u,to):qr(u)?[u]:vr(lI(Nt(u)))}function Due(u){var h=++Bie;return Nt(u)+h}var Tue=wg(function(u,h){return u+h},0),Aue=r1("ceil"),Iue=wg(function(u,h){return u/h},1),Rue=r1("floor");function Nue(u){return u&&u.length?pg(u,xr,Hx):n}function Lue(u,h){return u&&u.length?pg(u,He(h,2),Hx):n}function $ue(u){return YA(u,xr)}function Fue(u,h){return YA(u,He(h,2))}function jue(u){return u&&u.length?pg(u,xr,Ux):n}function zue(u,h){return u&&u.length?pg(u,He(h,2),Ux):n}var Bue=wg(function(u,h){return u*h},1),Hue=r1("round"),Vue=wg(function(u,h){return u-h},0);function Wue(u){return u&&u.length?Dx(u,xr):0}function que(u,h){return u&&u.length?Dx(u,He(h,2)):0}return I.after=hle,I.ary=yI,I.assign=ece,I.assignIn=II,I.assignInWith=Rg,I.assignWith=tce,I.at=nce,I.before=xI,I.bind=g1,I.bindAll=aue,I.bindKey=wI,I.castArray=Ele,I.chain=mI,I.chunk=Rse,I.compact=Nse,I.concat=Lse,I.cond=lue,I.conforms=cue,I.constant=_1,I.countBy=Wae,I.create=rce,I.curry=_I,I.curryRight=SI,I.debounce=CI,I.defaults=ice,I.defaultsDeep=oce,I.defer=ple,I.delay=gle,I.difference=$se,I.differenceBy=Fse,I.differenceWith=jse,I.drop=zse,I.dropRight=Bse,I.dropRightWhile=Hse,I.dropWhile=Vse,I.fill=Wse,I.filter=Uae,I.flatMap=Kae,I.flatMapDeep=Xae,I.flatMapDepth=Qae,I.flatten=fI,I.flattenDeep=qse,I.flattenDepth=Use,I.flip=mle,I.flow=due,I.flowRight=fue,I.fromPairs=Gse,I.functions=fce,I.functionsIn=hce,I.groupBy=Zae,I.initial=Kse,I.intersection=Xse,I.intersectionBy=Qse,I.intersectionWith=Zse,I.invert=gce,I.invertBy=mce,I.invokeMap=ele,I.iteratee=S1,I.keyBy=tle,I.keys=An,I.keysIn=yr,I.map=kg,I.mapKeys=bce,I.mapValues=yce,I.matches=hue,I.matchesProperty=pue,I.memoize=Dg,I.merge=xce,I.mergeWith=RI,I.method=gue,I.methodOf=mue,I.mixin=C1,I.negate=Tg,I.nthArg=bue,I.omit=wce,I.omitBy=_ce,I.once=vle,I.orderBy=nle,I.over=yue,I.overArgs=ble,I.overEvery=xue,I.overSome=wue,I.partial=m1,I.partialRight=EI,I.partition=rle,I.pick=Sce,I.pickBy=NI,I.property=HI,I.propertyOf=_ue,I.pull=nae,I.pullAll=pI,I.pullAllBy=rae,I.pullAllWith=iae,I.pullAt=oae,I.range=Sue,I.rangeRight=Cue,I.rearg=yle,I.reject=sle,I.remove=sae,I.rest=xle,I.reverse=h1,I.sampleSize=lle,I.set=Ece,I.setWith=Pce,I.shuffle=cle,I.slice=aae,I.sortBy=fle,I.sortedUniq=pae,I.sortedUniqBy=gae,I.split=Kce,I.spread=wle,I.tail=mae,I.take=vae,I.takeRight=bae,I.takeRightWhile=yae,I.takeWhile=xae,I.tap=Nae,I.throttle=_le,I.thru=Og,I.toArray=DI,I.toPairs=LI,I.toPairsIn=$I,I.toPath=Mue,I.toPlainObject=AI,I.transform=Oce,I.unary=Sle,I.union=wae,I.unionBy=_ae,I.unionWith=Sae,I.uniq=Cae,I.uniqBy=Eae,I.uniqWith=Pae,I.unset=kce,I.unzip=p1,I.unzipWith=gI,I.update=Mce,I.updateWith=Dce,I.values=_c,I.valuesIn=Tce,I.without=Oae,I.words=zI,I.wrap=Cle,I.xor=kae,I.xorBy=Mae,I.xorWith=Dae,I.zip=Tae,I.zipObject=Aae,I.zipObjectDeep=Iae,I.zipWith=Rae,I.entries=LI,I.entriesIn=$I,I.extend=II,I.extendWith=Rg,C1(I,I),I.add=Tue,I.attempt=BI,I.camelCase=Nce,I.capitalize=FI,I.ceil=Aue,I.clamp=Ace,I.clone=Ple,I.cloneDeep=kle,I.cloneDeepWith=Mle,I.cloneWith=Ole,I.conformsTo=Dle,I.deburr=jI,I.defaultTo=uue,I.divide=Iue,I.endsWith=Lce,I.eq=Pi,I.escape=$ce,I.escapeRegExp=Fce,I.every=qae,I.find=Gae,I.findIndex=uI,I.findKey=sce,I.findLast=Yae,I.findLastIndex=dI,I.findLastKey=ace,I.floor=Rue,I.forEach=vI,I.forEachRight=bI,I.forIn=lce,I.forInRight=cce,I.forOwn=uce,I.forOwnRight=dce,I.get=y1,I.gt=Tle,I.gte=Ale,I.has=pce,I.hasIn=x1,I.head=hI,I.identity=xr,I.includes=Jae,I.indexOf=Yse,I.inRange=Ice,I.invoke=vce,I.isArguments=Ya,I.isArray=rt,I.isArrayBuffer=Ile,I.isArrayLike=br,I.isArrayLikeObject=gn,I.isBoolean=Rle,I.isBuffer=Ps,I.isDate=Nle,I.isElement=Lle,I.isEmpty=$le,I.isEqual=Fle,I.isEqualWith=jle,I.isError=v1,I.isFinite=zle,I.isFunction=To,I.isInteger=PI,I.isLength=Ag,I.isMap=OI,I.isMatch=Ble,I.isMatchWith=Hle,I.isNaN=Vle,I.isNative=Wle,I.isNil=Ule,I.isNull=qle,I.isNumber=kI,I.isObject=sn,I.isObjectLike=un,I.isPlainObject=Bd,I.isRegExp=b1,I.isSafeInteger=Gle,I.isSet=MI,I.isString=Ig,I.isSymbol=qr,I.isTypedArray=wc,I.isUndefined=Yle,I.isWeakMap=Kle,I.isWeakSet=Xle,I.join=Jse,I.kebabCase=jce,I.last=fi,I.lastIndexOf=eae,I.lowerCase=zce,I.lowerFirst=Bce,I.lt=Qle,I.lte=Zle,I.max=Nue,I.maxBy=Lue,I.mean=$ue,I.meanBy=Fue,I.min=jue,I.minBy=zue,I.stubArray=P1,I.stubFalse=O1,I.stubObject=Eue,I.stubString=Pue,I.stubTrue=Oue,I.multiply=Bue,I.nth=tae,I.noConflict=vue,I.noop=E1,I.now=Mg,I.pad=Hce,I.padEnd=Vce,I.padStart=Wce,I.parseInt=qce,I.random=Rce,I.reduce=ile,I.reduceRight=ole,I.repeat=Uce,I.replace=Gce,I.result=Cce,I.round=Hue,I.runInContext=Q,I.sample=ale,I.size=ule,I.snakeCase=Yce,I.some=dle,I.sortedIndex=lae,I.sortedIndexBy=cae,I.sortedIndexOf=uae,I.sortedLastIndex=dae,I.sortedLastIndexBy=fae,I.sortedLastIndexOf=hae,I.startCase=Xce,I.startsWith=Qce,I.subtract=Vue,I.sum=Wue,I.sumBy=que,I.template=Zce,I.times=kue,I.toFinite=Ao,I.toInteger=at,I.toLength=TI,I.toLower=Jce,I.toNumber=hi,I.toSafeInteger=Jle,I.toString=Nt,I.toUpper=eue,I.trim=tue,I.trimEnd=nue,I.trimStart=rue,I.truncate=iue,I.unescape=oue,I.uniqueId=Due,I.upperCase=sue,I.upperFirst=w1,I.each=vI,I.eachRight=bI,I.first=hI,C1(I,function(){var u={};return Ji(I,function(h,b){Ft.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:En(at(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,q),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==X;Ct.prototype[u]=function(T){var N=this.clone();return N.__iteratees__.push({iteratee:He(T,3),type:b}),N.__filtered__=N.__filtered__||E,N}}),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=ft(function(u,h){return typeof u=="function"?new Ct(this):this.map(function(b){return Nd(b,u,h)})}),Ct.prototype.reject=function(u){return this.filter(Tg(He(u)))},Ct.prototype.slice=function(u,h){u=at(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=at(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(q)},Ji(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],N=E||/^find/.test(h);T&&(I.prototype[h]=function(){var z=this.__wrapped__,U=E?[1]:arguments,ee=z instanceof Ct,me=U[0],ve=ee||rt(z),we=function(_t){var Et=T.apply(I,ys([_t],U));return E&&De?Et[0]:Et};ve&&b&&typeof me=="function"&&me.length!=1&&(ee=ve=!1);var De=this.__chain__,$e=!!this.__actions__.length,We=N&&!De,ut=ee&&!$e;if(!N&&ve){z=ut?z:new Ct(this);var qe=u.apply(z,U);return qe.__actions__.push({func:Og,args:[we],thisArg:n}),new ci(qe,De)}return We&&ut?u.apply(this,U):(qe=this.thru(we),We?E?qe.value()[0]:qe.value():qe)})}),ai(["pop","push","shift","sort","splice","unshift"],function(u){var h=Jp[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 N=this.value();return h.apply(rt(N)?N:[],T)}return this[b](function(z){return h.apply(rt(z)?z:[],T)})}}),Ji(Ct.prototype,function(u,h){var b=I[h];if(b){var E=b.name+"";Ft.call(mc,E)||(mc[E]=[]),mc[E].push({name:h,func:b})}}),mc[xg(n,w).name]=[{name:"wrapper",func:n}],Ct.prototype.clone=ooe,Ct.prototype.reverse=soe,Ct.prototype.value=aoe,I.prototype.at=Lae,I.prototype.chain=$ae,I.prototype.commit=Fae,I.prototype.next=jae,I.prototype.plant=Bae,I.prototype.reverse=Hae,I.prototype.toJSON=I.prototype.valueOf=I.prototype.value=Vae,I.prototype.first=I.prototype.head,kd&&(I.prototype[kd]=zae),I},hc=Fie();za?((za.exports=hc)._=hc,Sx._=hc):zn._=hc}).call(No)}(nf,nf.exports);var N3=nf.exports;const Rs=Sc(N3),L3={theme:"system",setTheme:()=>null},Nw=m.createContext(L3);function $3({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 S.jsx(Nw.Provider,{...r,value:s,children:e})}const pm=()=>{const e=m.useContext(Nw);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};async function F3(e,t){return await(await fetch(`https://semaphor.cloud/api/v1/dashboard?id=${e}`,{headers:{Authorization:`Bearer ${t}`}})).json()}function Lw(e,t){return e==="dark"?Rs.merge({...t==null?void 0:t.default},{...t==null?void 0:t.dark}):t==null?void 0:t.default}function j3(e,t,n,r,i,o){const{data:s,refetch:a,isLoading:l,isError:c}=Sr({queryKey:[e],queryFn:()=>F3(e,t==null?void 0:t.accessToken),enabled:!1}),{theme:d,setTheme:f}=pm(),{setDashboard:g,setSelectedSheetId:p,setStyle:v,setOnSaveFunction:y}=xe(O=>O.actions),x=xe(O=>O.actions.setAuthToken),w=xe(O=>O.actions.setThemeStyle),_=xe(O=>O.actions.setDashboardTheme),C=xe(O=>O.actions.setOnEvent);return m.useEffect(()=>{d&&_(d)},[d,_]),m.useEffect(()=>{r&&f(r)},[r,f]),m.useEffect(()=>{const O=Rs.cloneDeep(om);if(n){const P=Rs.merge(O,n),k=Lw(d,P);w(k),v(P)}else{const P=Lw(d,O);w(P),v(om)}},[d,n,v]),m.useEffect(()=>{var P;if(!s||!s.dashboard)return;const O=s.dashboard;g(O),p((P=O.sheets)==null?void 0:P[0].id)},[s,g,p]),m.useEffect(()=>{i&&y(i),o&&C(o)},[i,y,o,C]),m.useEffect(()=>{t&&t.accessToken&&(x(t),a())},[t,a,x]),{isLoading:l,isError:c}}function Rc({className:e,...t}){return S.jsx("div",{className:Oe("animate-pulse rounded-md bg-muted",e),...t})}function $w({className:e,style:t,onSave:n,onEvent:r,LoadingComponent:i,ErrorComponent:o,id:s,authToken:a,currentTheme:l,...c}){xe(v=>v.selectedSheetId);const d=xe(v=>v.themeStyle),f=xe(v=>v.onEvent),{isLoading:g,isError:p}=j3(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?S.jsx(i,{message:"loading"}):S.jsx("div",{className:" flex items-center gap-3",children:S.jsx(Rc,{className:"dark:h-[2px] h-1 w-full"})})):p?(f==null||f({type:"error",message:"Error fetching dashboard"}),o?(console.log("Error fetching dashboard"),S.jsx(o,{})):S.jsx("div",{children:"Error"})):S.jsx("div",{className:Oe(" h-full flex flex-col justify-between",d==null?void 0:d.dashboardPanel,e),role:"dashboard-panel",...c})}function le(){return le=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},le.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,z3(i,...t)]}function z3(...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 B3(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function rf(...e){return t=>e.forEach(n=>B3(n,t))}function et(...e){return m.useCallback(rf(...e),e)}const no=m.forwardRef((e,t)=>{const{children:n,...r}=e,i=m.Children.toArray(n),o=i.find(H3);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(gm,le({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(gm,le({},r,{ref:t}),n)});no.displayName="Slot";const gm=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...V3(r,n.props),ref:t?rf(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});gm.displayName="SlotClone";const Fw=({children:e})=>m.createElement(m.Fragment,null,e);function H3(e){return m.isValidElement(e)&&e.type===Fw}function V3(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 of(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),_=et(v,w.collectionRef);return m.createElement(no,{ref:_},x)}),c=e+"CollectionItemSlot",d="data-radix-collection-item",f=m.forwardRef((p,v)=>{const{scope:y,children:x,...w}=p,_=m.useRef(null),C=et(v,_),O=o(c,y);return m.useEffect(()=>(O.itemMap.set(_,{ref:_,...w}),()=>void O.itemMap.delete(_))),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((O,P)=>w.indexOf(O.ref.current)-w.indexOf(P.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:s,Slot:l,ItemSlot:f},g,r]}const Hn=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},W3=ue.useId||(()=>{});let q3=0;function or(e){const[t,n]=ue.useState(W3());return Hn(()=>{e||n(r=>r??String(q3++))},[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,le({},s,{ref:i}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function jw(e,t){e&&kt.flushSync(()=>e.dispatchEvent(t))}function On(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]=U3({defaultProp:t,onChange:n}),o=e!==void 0,s=o?e:r,a=On(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 U3({defaultProp:e,onChange:t}){const n=m.useState(e),[r]=n,i=m.useRef(r),o=On(t);return m.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}const G3=m.createContext(void 0);function Ns(e){const t=m.useContext(G3);return e||t||"ltr"}const mm="rovingFocusGroup.onEntryFocus",Y3={bubbles:!1,cancelable:!0},vm="RovingFocusGroup",[bm,zw,K3]=of(vm),[X3,el]=Pn(vm,[K3]),[Q3,Z3]=X3(vm),J3=m.forwardRef((e,t)=>m.createElement(bm.Provider,{scope:e.__scopeRovingFocusGroup},m.createElement(bm.Slot,{scope:e.__scopeRovingFocusGroup},m.createElement(eN,le({},e,{ref:t}))))),eN=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=Ns(o),[v=null,y]=Qn({prop:s,defaultProp:a,onChange:l}),[x,w]=m.useState(!1),_=On(c),C=zw(n),O=m.useRef(!1),[P,k]=m.useState(0);return m.useEffect(()=>{const A=f.current;if(A)return A.addEventListener(mm,_),()=>A.removeEventListener(mm,_)},[_]),m.createElement(Q3,{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,le({tabIndex:x||P===0?-1:0,"data-orientation":r},d,{ref:g,style:{outline:"none",...e.style},onMouseDown:Ce(e.onMouseDown,()=>{O.current=!0}),onFocus:Ce(e.onFocus,A=>{const L=!O.current;if(A.target===A.currentTarget&&L&&!x){const F=new CustomEvent(mm,Y3);if(A.currentTarget.dispatchEvent(F),!F.defaultPrevented){const B=C().filter($=>$.focusable),H=B.find($=>$.active),V=B.find($=>$.id===v),Y=[H,V,...B].filter(Boolean).map($=>$.ref.current);Bw(Y)}}O.current=!1}),onBlur:Ce(e.onBlur,()=>w(!1))})))}),tN="RovingFocusGroupItem",nN=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,...s}=e,a=or(),l=o||a,c=Z3(tN,n),d=c.currentTabStopId===l,f=zw(n),{onFocusableItemAdd:g,onFocusableItemRemove:p}=c;return m.useEffect(()=>{if(r)return g(),()=>p()},[r,g,p]),m.createElement(bm.ItemSlot,{scope:n,id:l,focusable:r,active:i},m.createElement(Be.span,le({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=oN(v,c.orientation,c.dir);if(y!==void 0){v.preventDefault();let w=f().filter(_=>_.focusable).map(_=>_.ref.current);if(y==="last")w.reverse();else if(y==="prev"||y==="next"){y==="prev"&&w.reverse();const _=w.indexOf(v.currentTarget);w=c.loop?sN(w,_+1):w.slice(_+1)}setTimeout(()=>Bw(w))}})})))}),rN={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function iN(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function oN(e,t,n){const r=iN(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return rN[r]}function Bw(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function sN(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const ym=J3,xm=nN;function aN(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=lN(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 lN(e){const[t,n]=m.useState(),r=m.useRef({}),i=m.useRef(e),o=m.useRef("none"),s=e?"mounted":"unmounted",[a,l]=aN(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const c=sf(r.current);o.current=a==="mounted"?c:"none"},[a]),Hn(()=>{const c=r.current,d=i.current;if(d!==e){const g=o.current,p=sf(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]),Hn(()=>{if(t){const c=f=>{const p=sf(r.current).includes(f.animationName);f.target===t&&p&&kt.flushSync(()=>l("ANIMATION_END"))},d=f=>{f.target===t&&(o.current=sf(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 sf(e){return(e==null?void 0:e.animationName)||"none"}const Hw="Tabs",[cN,Xue]=Pn(Hw,[el]),Vw=el(),[uN,wm]=cN(Hw),dN=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:s="horizontal",dir:a,activationMode:l="automatic",...c}=e,d=Ns(a),[f,g]=Qn({prop:r,onChange:i,defaultProp:o});return m.createElement(uN,{scope:n,baseId:or(),value:f,onValueChange:g,orientation:s,dir:d,activationMode:l},m.createElement(Be.div,le({dir:d,"data-orientation":s},c,{ref:t})))}),fN="TabsList",hN=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=wm(fN,n),s=Vw(n);return m.createElement(ym,le({asChild:!0},s,{orientation:o.orientation,dir:o.dir,loop:r}),m.createElement(Be.div,le({role:"tablist","aria-orientation":o.orientation},i,{ref:t})))}),pN="TabsTrigger",gN=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,s=wm(pN,n),a=Vw(n),l=Ww(s.baseId,r),c=qw(s.baseId,r),d=r===s.value;return m.createElement(xm,le({asChild:!0},a,{focusable:!i,active:d}),m.createElement(Be.button,le({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)})})))}),mN="TabsContent",vN=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...s}=e,a=wm(mN,n),l=Ww(a.baseId,r),c=qw(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,le({"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 Ww(e,t){return`${e}-trigger-${t}`}function qw(e,t){return`${e}-content-${t}`}const bN=dN,Uw=hN,Gw=gN,Yw=vN,Kw=bN,Xw=ue.forwardRef(({className:e,...t},n)=>S.jsx(Uw,{ref:n,className:Oe("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Xw.displayName=Uw.displayName;const _m=ue.forwardRef(({className:e,...t},n)=>S.jsx(Gw,{ref:n,className:Oe("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}));_m.displayName=Gw.displayName;const af=ue.forwardRef(({className:e,...t},n)=>S.jsx(Yw,{ref:n,className:Oe("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));af.displayName=Yw.displayName;var Qw={exports:{}},Nc={},Sm={exports:{}};(function(e,t){(function(n,r){r(t)})(No,function(n){function r(ie){return function(W,be,oe,Te,Fe,Ve,Ke){return ie(W,be,Ke)}}function i(ie){return function(W,be,oe,Te){if(!W||!be||typeof W!="object"||typeof be!="object")return ie(W,be,oe,Te);var Fe=Te.get(W),Ve=Te.get(be);if(Fe&&Ve)return Fe===be&&Ve===W;Te.set(W,be),Te.set(be,W);var Ke=ie(W,be,oe,Te);return Te.delete(W),Te.delete(be),Ke}}function o(ie,J){var W={};for(var be in ie)W[be]=ie[be];for(var be in J)W[be]=J[be];return W}function s(ie){return ie.constructor===Object||ie.constructor==null}function a(ie){return typeof ie.then=="function"}function l(ie,J){return ie===J||ie!==ie&&J!==J}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]",_=Object.prototype.toString;function C(ie){var J=ie.areArraysEqual,W=ie.areDatesEqual,be=ie.areMapsEqual,oe=ie.areObjectsEqual,Te=ie.areRegExpsEqual,Fe=ie.areSetsEqual,Ve=ie.createIsNestedEqual,Ke=Ve(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 Jt=Array.isArray(vt),Dn=Array.isArray(bt);if(Jt||Dn)return Jt===Dn&&J(vt,bt,Ke,tn);var fn=_.call(vt);return fn!==_.call(bt)?!1:fn===f?W(vt,bt,Ke,tn):fn===g?Te(vt,bt,Ke,tn):fn===p?be(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 O(ie,J,W,be){var oe=ie.length;if(J.length!==oe)return!1;for(;oe-- >0;)if(!W(ie[oe],J[oe],oe,oe,ie,J,be))return!1;return!0}var P=i(O);function k(ie,J){return l(ie.valueOf(),J.valueOf())}function A(ie,J,W,be){var oe=ie.size===J.size;if(!oe)return!1;if(!ie.size)return!0;var Te={},Fe=0;return ie.forEach(function(Ve,Ke){if(oe){var St=!1,vt=0;J.forEach(function(bt,tn){!St&&!Te[vt]&&(St=W(Ke,tn,Fe,vt,ie,J,be)&&W(Ve,bt,Ke,tn,ie,J,be))&&(Te[vt]=!0),vt++}),Fe++,oe=St}}),oe}var L=i(A),F="_owner",B=Object.prototype.hasOwnProperty;function H(ie,J,W,be){var oe=Object.keys(ie),Te=oe.length;if(Object.keys(J).length!==Te)return!1;for(var Fe;Te-- >0;){if(Fe=oe[Te],Fe===F){var Ve=!!ie.$$typeof,Ke=!!J.$$typeof;if((Ve||Ke)&&Ve!==Ke)return!1}if(!B.call(J,Fe)||!W(ie[Fe],J[Fe],Fe,Fe,ie,J,be))return!1}return!0}var V=i(H);function K(ie,J){return ie.source===J.source&&ie.flags===J.flags}function Y(ie,J,W,be){var oe=ie.size===J.size;if(!oe)return!1;if(!ie.size)return!0;var Te={};return ie.forEach(function(Fe,Ve){if(oe){var Ke=!1,St=0;J.forEach(function(vt,bt){!Ke&&!Te[St]&&(Ke=W(Fe,vt,Ve,bt,ie,J,be))&&(Te[St]=!0),St++}),oe=Ke}}),oe}var $=i(Y),X=Object.freeze({areArraysEqual:O,areDatesEqual:k,areMapsEqual:A,areObjectsEqual:H,areRegExpsEqual:K,areSetsEqual:Y,createIsNestedEqual:r}),j=Object.freeze({areArraysEqual:P,areDatesEqual:k,areMapsEqual:L,areObjectsEqual:V,areRegExpsEqual:K,areSetsEqual:$,createIsNestedEqual:r}),ne=C(X);function se(ie,J){return ne(ie,J,void 0)}var D=C(o(X,{createIsNestedEqual:function(){return l}}));function q(ie,J){return D(ie,J,void 0)}var re=C(j);function R(ie,J){return re(ie,J,new WeakMap)}var te=C(o(j,{createIsNestedEqual:function(){return l}}));function ge(ie,J){return te(ie,J,new WeakMap)}function pe(ie){return C(o(X,ie(X)))}function de(ie){var J=C(o(j,ie(j)));return function(W,be,oe){return oe===void 0&&(oe=new WeakMap),J(W,be,oe)}}n.circularDeepEqual=R,n.circularShallowEqual=ge,n.createCustomCircularEqual=de,n.createCustomEqual=pe,n.deepEqual=se,n.sameValueZeroEqual=l,n.shallowEqual=q,Object.defineProperty(n,"__esModule",{value:!0})})})(Sm,Sm.exports);var Cm=Sm.exports;const Em=$g(YI);var pt={},yN=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=Pm,pt.childrenEqual=SN,pt.cloneLayout=Jw,pt.cloneLayoutItem=Ls,pt.collides=lf,pt.compact=t_,pt.compactItem=n_,pt.compactType=IN,pt.correctBounds=r_,pt.fastPositionEqual=EN,pt.fastRGLPropsEqual=void 0,pt.getAllCollisions=i_,pt.getFirstCollision=$s,pt.getLayoutItem=km,pt.getStatics=Mm,pt.modifyLayout=e_,pt.moveElement=$c,pt.moveElementAwayFromCollision=Dm,pt.noop=void 0,pt.perc=ON,pt.resizeItemInDirection=MN,pt.setTopLeft=TN,pt.setTransform=DN,pt.sortLayoutItems=Lm,pt.sortLayoutItemsByColRow=c_,pt.sortLayoutItemsByRowCol=l_,pt.synchronizeLayoutWithChildren=AN,pt.validateLayout=u_,pt.withLayoutItem=_N;var Zw=Cm,Lc=xN(m);function xN(e){return e&&e.__esModule?e:{default:e}}const wN=process.env.NODE_ENV==="production";function Pm(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 Jw(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=Ls(e[n]);return t}function e_(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 _N(e,t,n){let r=km(e,t);return r?(r=n(Ls(r)),e=e_(e,r),[e,r]):[e,null]}function Ls(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 SN(e,t){return(0,Zw.deepEqual)(Lc.default.Children.map(e,n=>n==null?void 0:n.key),Lc.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,Zw.deepEqual)(Lc.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),Lc.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}const CN=yN;pt.fastRGLPropsEqual=CN;function EN(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function lf(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 t_(e,t,n,r){const i=Mm(e),o=Lm(e,t),s=Array(e.length);for(let a=0,l=o.length;a<l;a++){let c=Ls(o[a]);c.static||(c=n_(i,c,t,n,o,r),i.push(c)),s[e.indexOf(o[a])]=c,c.moved=!1}return s}const PN={x:"w",y:"h"};function Om(e,t,n,r){const i=PN[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;lf(t,a)&&Om(e,a,n+t[i],r)}}t[r]=n}function n_(e,t,n,r,i,o){const s=n==="vertical",a=n==="horizontal";if(s)for(t.y=Math.min(Pm(e),t.y);t.y>0&&!$s(e,t);)t.y--;else if(a)for(;t.x>0&&!$s(e,t);)t.x--;let l;for(;(l=$s(e,t))&&!(n===null&&o);)if(a?Om(i,t,l.x+l.w,"x"):Om(i,t,l.y+l.h,"y"),a&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!$s(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function r_(e,t){const n=Mm(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(;$s(n,o);)o.y++}return e}function km(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function $s(e,t){for(let n=0,r=e.length;n<r;n++)if(lf(e[n],t))return e[n]}function i_(e,t){return e.filter(n=>lf(n,t))}function Mm(e){return e.filter(t=>t.static)}function $c(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=Lm(e,s);(s==="vertical"&&typeof r=="number"?d>=r:s==="horizontal"&&typeof n=="number"?c>=n:!1)&&(f=f.reverse());const p=i_(f,t),v=p.length>0;if(v&&l)return Jw(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=Dm(e,w,t,i,s):e=Dm(e,t,w,i,s))}return e}function Dm(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=$s(e,f),p=g&&g.y+g.h>t.y,v=g&&t.x+t.w>g.x;if(g){if(p&&a)return $c(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 $c(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,"]."),$c(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:$c(e,n,s?n.x+1:void 0,a?n.y+1:void 0,r,l,i)}function ON(e){return e*100+"%"}const o_=(e,t,n,r)=>e+n>r?t:n,s_=(e,t,n)=>e<0?t:n,a_=e=>Math.max(0,e),Tm=e=>Math.max(0,e),Am=(e,t,n)=>{let{left:r,height:i,width:o}=t;const s=e.top-(i-e.height);return{left:r,width:o,height:s_(s,e.height,i),top:Tm(s)}},Im=(e,t,n)=>{let{top:r,left:i,height:o,width:s}=t;return{top:r,height:o,width:o_(e.left,e.width,s,n),left:a_(i)}},Rm=(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:o_(e.left,e.width,o,n),top:Tm(r),left:a_(s)}},Nm=(e,t,n)=>{let{top:r,left:i,height:o,width:s}=t;return{width:s,left:i,height:s_(r,e.height,o),top:Tm(r)}},kN={n:Am,ne:function(){return Am(arguments.length<=0?void 0:arguments[0],Im(...arguments))},e:Im,se:function(){return Nm(arguments.length<=0?void 0:arguments[0],Im(...arguments))},s:Nm,sw:function(){return Nm(arguments.length<=0?void 0:arguments[0],Rm(...arguments))},w:Rm,nw:function(){return Am(arguments.length<=0?void 0:arguments[0],Rm(...arguments))}};function MN(e,t,n,r){const i=kN[e];return i?i(t,{...t,...n},r):n}function DN(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 TN(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 Lm(e,t){return t==="horizontal"?c_(e):t==="vertical"?l_(e):e}function l_(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 c_(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 AN(e,t,n,r,i){e=e||[];const o=[];Lc.default.Children.forEach(t,a=>{if((a==null?void 0:a.key)==null)return;const l=km(e,String(a.key)),c=a.props["data-grid"];l&&c==null?o.push(Ls(l)):c?(wN||u_([c],"ReactGridLayout.children"),o.push(Ls({...c,i:a.key}))):o.push(Ls({w:1,h:1,x:0,y:Pm(o),i:String(a.key)}))});const s=r_(o,{cols:n});return i?s:t_(s,r,n)}function u_(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 IN(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}function tde(){}const RN=()=>{};pt.noop=RN;var ki={};Object.defineProperty(ki,"__esModule",{value:!0}),ki.calcGridColWidth=cf,ki.calcGridItemPosition=NN,ki.calcGridItemWHPx=$m,ki.calcWH=$N,ki.calcXY=LN,ki.clamp=Fs;function cf(e){const{margin:t,containerPadding:n,containerWidth:r,cols:i}=e;return(r-t[0]*(i-1)-n[0]*2)/i}function $m(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function NN(e,t,n,r,i,o){const{margin:s,containerPadding:a,rowHeight:l}=e,c=cf(e),d={};return o&&o.resizing?(d.width=Math.round(o.resizing.width),d.height=Math.round(o.resizing.height)):(d.width=$m(r,c,s[0]),d.height=$m(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 LN(e,t,n,r,i){const{margin:o,cols:s,rowHeight:a,maxRows:l}=e,c=cf(e);let d=Math.round((n-o[0])/(c+o[0])),f=Math.round((t-o[1])/(a+o[1]));return d=Fs(d,0,s-r),f=Fs(f,0,l-i),{x:d,y:f}}function $N(e,t,n,r,i,o){const{margin:s,maxRows:a,cols:l,rowHeight:c}=e,d=cf(e);let f=Math.round((t+s[0])/(d+s[0])),g=Math.round((n+s[1])/(c+s[1])),p=Fs(f,0,l-r),v=Fs(g,0,a-i);return["sw","w","nw"].indexOf(o)!==-1&&(p=Fs(f,0,l)),["nw","n","ne"].indexOf(o)!==-1&&(v=Fs(g,0,a)),{w:p,h:v}}function Fs(e,t,n){return Math.max(Math.min(e,n),t)}var uf={},Fm={exports:{}},jm,d_;function zm(){if(d_)return jm;d_=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return jm=e,jm}var Bm,f_;function FN(){if(f_)return Bm;f_=1;var e=zm();function t(){}function n(){}return n.resetWarningCache=t,Bm=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},Bm}var df={exports:{}},At={};/** @license React v16.13.1
|
|
86
|
+
* react-is.development.js
|
|
87
|
+
*
|
|
88
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
89
|
+
*
|
|
90
|
+
* This source code is licensed under the MIT license found in the
|
|
91
|
+
* LICENSE file in the root directory of this source tree.
|
|
92
|
+
*/var h_;function jN(){return h_||(h_=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,g=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,v=e?Symbol.for("react.lazy"):60116,y=e?Symbol.for("react.block"):60121,x=e?Symbol.for("react.fundamental"):60117,w=e?Symbol.for("react.responder"):60118,_=e?Symbol.for("react.scope"):60119;function C(oe){return typeof oe=="string"||typeof oe=="function"||oe===r||oe===c||oe===o||oe===i||oe===f||oe===g||typeof oe=="object"&&oe!==null&&(oe.$$typeof===v||oe.$$typeof===p||oe.$$typeof===s||oe.$$typeof===a||oe.$$typeof===d||oe.$$typeof===x||oe.$$typeof===w||oe.$$typeof===_||oe.$$typeof===y)}function O(oe){if(typeof oe=="object"&&oe!==null){var Te=oe.$$typeof;switch(Te){case t:var Fe=oe.type;switch(Fe){case l:case c:case r:case o:case i:case f:return Fe;default:var Ve=Fe&&Fe.$$typeof;switch(Ve){case a:case d:case v:case p:case s:return Ve;default:return Te}}case n:return Te}}}var P=l,k=c,A=a,L=s,F=t,B=d,H=r,V=v,K=p,Y=n,$=o,X=i,j=f,ne=!1;function se(oe){return ne||(ne=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),D(oe)||O(oe)===l}function D(oe){return O(oe)===c}function q(oe){return O(oe)===a}function re(oe){return O(oe)===s}function R(oe){return typeof oe=="object"&&oe!==null&&oe.$$typeof===t}function te(oe){return O(oe)===d}function ge(oe){return O(oe)===r}function pe(oe){return O(oe)===v}function de(oe){return O(oe)===p}function ie(oe){return O(oe)===n}function J(oe){return O(oe)===o}function W(oe){return O(oe)===i}function be(oe){return O(oe)===f}At.AsyncMode=P,At.ConcurrentMode=k,At.ContextConsumer=A,At.ContextProvider=L,At.Element=F,At.ForwardRef=B,At.Fragment=H,At.Lazy=V,At.Memo=K,At.Portal=Y,At.Profiler=$,At.StrictMode=X,At.Suspense=j,At.isAsyncMode=se,At.isConcurrentMode=D,At.isContextConsumer=q,At.isContextProvider=re,At.isElement=R,At.isForwardRef=te,At.isFragment=ge,At.isLazy=pe,At.isMemo=de,At.isPortal=ie,At.isProfiler=J,At.isStrictMode=W,At.isSuspense=be,At.isValidElementType=C,At.typeOf=O}()),At}var It={};/** @license React v16.13.1
|
|
93
|
+
* react-is.production.min.js
|
|
94
|
+
*
|
|
95
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
96
|
+
*
|
|
97
|
+
* This source code is licensed under the MIT license found in the
|
|
98
|
+
* LICENSE file in the root directory of this source tree.
|
|
99
|
+
*/var p_;function zN(){if(p_)return It;p_=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,g=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,v=e?Symbol.for("react.lazy"):60116,y=e?Symbol.for("react.block"):60121,x=e?Symbol.for("react.fundamental"):60117,w=e?Symbol.for("react.responder"):60118,_=e?Symbol.for("react.scope"):60119;function C(P){if(typeof P=="object"&&P!==null){var k=P.$$typeof;switch(k){case t:switch(P=P.type,P){case l:case c:case r:case o:case i:case f:return P;default:switch(P=P&&P.$$typeof,P){case a:case d:case v:case p:case s:return P;default:return k}}case n:return k}}}function O(P){return C(P)===c}return It.AsyncMode=l,It.ConcurrentMode=c,It.ContextConsumer=a,It.ContextProvider=s,It.Element=t,It.ForwardRef=d,It.Fragment=r,It.Lazy=v,It.Memo=p,It.Portal=n,It.Profiler=o,It.StrictMode=i,It.Suspense=f,It.isAsyncMode=function(P){return O(P)||C(P)===l},It.isConcurrentMode=O,It.isContextConsumer=function(P){return C(P)===a},It.isContextProvider=function(P){return C(P)===s},It.isElement=function(P){return typeof P=="object"&&P!==null&&P.$$typeof===t},It.isForwardRef=function(P){return C(P)===d},It.isFragment=function(P){return C(P)===r},It.isLazy=function(P){return C(P)===v},It.isMemo=function(P){return C(P)===p},It.isPortal=function(P){return C(P)===n},It.isProfiler=function(P){return C(P)===o},It.isStrictMode=function(P){return C(P)===i},It.isSuspense=function(P){return C(P)===f},It.isValidElementType=function(P){return typeof P=="string"||typeof P=="function"||P===r||P===c||P===o||P===i||P===f||P===g||typeof P=="object"&&P!==null&&(P.$$typeof===v||P.$$typeof===p||P.$$typeof===s||P.$$typeof===a||P.$$typeof===d||P.$$typeof===x||P.$$typeof===w||P.$$typeof===_||P.$$typeof===y)},It.typeOf=C,It}var g_;function m_(){return g_||(g_=1,process.env.NODE_ENV==="production"?df.exports=zN():df.exports=jN()),df.exports}/*
|
|
100
|
+
object-assign
|
|
101
|
+
(c) Sindre Sorhus
|
|
102
|
+
@license MIT
|
|
103
|
+
*/var Hm,v_;function BN(){if(v_)return Hm;v_=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 Hm=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},Hm}var Vm,b_;function y_(){return b_||(b_=1,Vm=Function.call.bind(Object.prototype.hasOwnProperty)),Vm}var Wm,x_;function HN(){if(x_)return Wm;x_=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=zm(),n={},r=y_();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={})},Wm=i,Wm}var qm,w_;function VN(){if(w_)return qm;w_=1;var e=m_(),t=BN(),n=zm(),r=y_(),i=HN(),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 qm=function(a,l){var c=typeof Symbol=="function"&&Symbol.iterator,d="@@iterator";function f(D){var q=D&&(c&&D[c]||D[d]);if(typeof q=="function")return q}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:_(),arrayOf:C,element:O(),elementType:P(),instanceOf:k,node:B(),objectOf:L,oneOf:A,oneOfType:F,shape:V,exact:K};function v(D,q){return D===q?D!==0||1/D===1/q:D!==D&&q!==q}function y(D,q){this.message=D,this.data=q&&typeof q=="object"?q:{},this.stack=""}y.prototype=Error.prototype;function x(D){if(process.env.NODE_ENV!=="production")var q={},re=0;function R(ge,pe,de,ie,J,W,be){if(ie=ie||g,W=W||de,be!==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=ie+":"+de;!q[Te]&&re<3&&(o("You are manually calling a React.PropTypes validation function for the `"+W+"` prop on `"+ie+"`. 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."),q[Te]=!0,re++)}}return pe[de]==null?ge?pe[de]===null?new y("The "+J+" `"+W+"` is marked as required "+("in `"+ie+"`, but its value is `null`.")):new y("The "+J+" `"+W+"` is marked as required in "+("`"+ie+"`, but its value is `undefined`.")):null:D(pe,de,ie,J,W)}var te=R.bind(null,!1);return te.isRequired=R.bind(null,!0),te}function w(D){function q(re,R,te,ge,pe,de){var ie=re[R],J=X(ie);if(J!==D){var W=j(ie);return new y("Invalid "+ge+" `"+pe+"` of type "+("`"+W+"` supplied to `"+te+"`, expected ")+("`"+D+"`."),{expectedType:D})}return null}return x(q)}function _(){return x(s)}function C(D){function q(re,R,te,ge,pe){if(typeof D!="function")return new y("Property `"+pe+"` of component `"+te+"` has invalid PropType notation inside arrayOf.");var de=re[R];if(!Array.isArray(de)){var ie=X(de);return new y("Invalid "+ge+" `"+pe+"` of type "+("`"+ie+"` supplied to `"+te+"`, expected an array."))}for(var J=0;J<de.length;J++){var W=D(de,J,te,ge,pe+"["+J+"]",n);if(W instanceof Error)return W}return null}return x(q)}function O(){function D(q,re,R,te,ge){var pe=q[re];if(!a(pe)){var de=X(pe);return new y("Invalid "+te+" `"+ge+"` of type "+("`"+de+"` supplied to `"+R+"`, expected a single ReactElement."))}return null}return x(D)}function P(){function D(q,re,R,te,ge){var pe=q[re];if(!e.isValidElementType(pe)){var de=X(pe);return new y("Invalid "+te+" `"+ge+"` of type "+("`"+de+"` supplied to `"+R+"`, expected a single ReactElement type."))}return null}return x(D)}function k(D){function q(re,R,te,ge,pe){if(!(re[R]instanceof D)){var de=D.name||g,ie=se(re[R]);return new y("Invalid "+ge+" `"+pe+"` of type "+("`"+ie+"` supplied to `"+te+"`, expected ")+("instance of `"+de+"`."))}return null}return x(q)}function A(D){if(!Array.isArray(D))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 q(re,R,te,ge,pe){for(var de=re[R],ie=0;ie<D.length;ie++)if(v(de,D[ie]))return null;var J=JSON.stringify(D,function(be,oe){var Te=j(oe);return Te==="symbol"?String(oe):oe});return new y("Invalid "+ge+" `"+pe+"` of value `"+String(de)+"` "+("supplied to `"+te+"`, expected one of "+J+"."))}return x(q)}function L(D){function q(re,R,te,ge,pe){if(typeof D!="function")return new y("Property `"+pe+"` of component `"+te+"` has invalid PropType notation inside objectOf.");var de=re[R],ie=X(de);if(ie!=="object")return new y("Invalid "+ge+" `"+pe+"` of type "+("`"+ie+"` supplied to `"+te+"`, expected an object."));for(var J in de)if(r(de,J)){var W=D(de,J,te,ge,pe+"."+J,n);if(W instanceof Error)return W}return null}return x(q)}function F(D){if(!Array.isArray(D))return process.env.NODE_ENV!=="production"&&o("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var q=0;q<D.length;q++){var re=D[q];if(typeof re!="function")return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+ne(re)+" at index "+q+"."),s}function R(te,ge,pe,de,ie){for(var J=[],W=0;W<D.length;W++){var be=D[W],oe=be(te,ge,pe,de,ie,n);if(oe==null)return null;oe.data&&r(oe.data,"expectedType")&&J.push(oe.data.expectedType)}var Te=J.length>0?", expected one of type ["+J.join(", ")+"]":"";return new y("Invalid "+de+" `"+ie+"` supplied to "+("`"+pe+"`"+Te+"."))}return x(R)}function B(){function D(q,re,R,te,ge){return Y(q[re])?null:new y("Invalid "+te+" `"+ge+"` supplied to "+("`"+R+"`, expected a ReactNode."))}return x(D)}function H(D,q,re,R,te){return new y((D||"React class")+": "+q+" type `"+re+"."+R+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+te+"`.")}function V(D){function q(re,R,te,ge,pe){var de=re[R],ie=X(de);if(ie!=="object")return new y("Invalid "+ge+" `"+pe+"` of type `"+ie+"` "+("supplied to `"+te+"`, expected `object`."));for(var J in D){var W=D[J];if(typeof W!="function")return H(te,ge,pe,J,j(W));var be=W(de,J,te,ge,pe+"."+J,n);if(be)return be}return null}return x(q)}function K(D){function q(re,R,te,ge,pe){var de=re[R],ie=X(de);if(ie!=="object")return new y("Invalid "+ge+" `"+pe+"` of type `"+ie+"` "+("supplied to `"+te+"`, expected `object`."));var J=t({},re[R],D);for(var W in J){var be=D[W];if(r(D,W)&&typeof be!="function")return H(te,ge,pe,W,j(be));if(!be)return new y("Invalid "+ge+" `"+pe+"` key `"+W+"` supplied to `"+te+"`.\nBad object: "+JSON.stringify(re[R],null," ")+`
|
|
104
|
+
Valid keys: `+JSON.stringify(Object.keys(D),null," "));var oe=be(de,W,te,ge,pe+"."+W,n);if(oe)return oe}return null}return x(q)}function Y(D){switch(typeof D){case"number":case"string":case"undefined":return!0;case"boolean":return!D;case"object":if(Array.isArray(D))return D.every(Y);if(D===null||a(D))return!0;var q=f(D);if(q){var re=q.call(D),R;if(q!==D.entries){for(;!(R=re.next()).done;)if(!Y(R.value))return!1}else for(;!(R=re.next()).done;){var te=R.value;if(te&&!Y(te[1]))return!1}}else return!1;return!0;default:return!1}}function $(D,q){return D==="symbol"?!0:q?q["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&q instanceof Symbol:!1}function X(D){var q=typeof D;return Array.isArray(D)?"array":D instanceof RegExp?"object":$(q,D)?"symbol":q}function j(D){if(typeof D>"u"||D===null)return""+D;var q=X(D);if(q==="object"){if(D instanceof Date)return"date";if(D instanceof RegExp)return"regexp"}return q}function ne(D){var q=j(D);switch(q){case"array":case"object":return"an "+q;case"boolean":case"date":case"regexp":return"a "+q;default:return q}}function se(D){return!D.constructor||!D.constructor.name?g:D.constructor.name}return p.checkPropTypes=i,p.resetWarningCache=i.resetWarningCache,p.PropTypes=p,p},qm}if(process.env.NODE_ENV!=="production"){var WN=m_(),qN=!0;Fm.exports=VN()(WN.isElement,qN)}else Fm.exports=FN()();var Fo=Fm.exports,ff={exports:{}},__={};function S_(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=S_(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function C_(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=S_(e))&&(r&&(r+=" "),r+=t);return r}const UN=$g(Object.freeze(Object.defineProperty({__proto__:null,clsx:C_,default:C_},Symbol.toStringTag,{value:"Module"})));var ln={},Mi={};Object.defineProperty(Mi,"__esModule",{value:!0}),Mi.dontSetMe=QN,Mi.findInArray=GN,Mi.int=XN,Mi.isFunction=YN,Mi.isNum=KN;function GN(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function YN(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function KN(e){return typeof e=="number"&&!isNaN(e)}function XN(e){return parseInt(e,10)}function QN(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 js={};Object.defineProperty(js,"__esModule",{value:!0}),js.browserPrefixToKey=P_,js.browserPrefixToStyle=ZN,js.default=void 0,js.getPrefix=E_;const Um=["Moz","Webkit","O","ms"];function E_(){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<Um.length;r++)if(P_(t,Um[r])in n)return Um[r];return""}function P_(e,t){return t?"".concat(t).concat(JN(e)):e}function ZN(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e}function JN(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}js.default=E_(),Object.defineProperty(ln,"__esModule",{value:!0}),ln.addClassName=D_,ln.addEvent=n7,ln.addUserSelectStyles=h7,ln.createCSSTransform=c7,ln.createSVGTransform=u7,ln.getTouch=d7,ln.getTouchIdentifier=f7,ln.getTranslation=Gm,ln.innerHeight=s7,ln.innerWidth=a7,ln.matchesSelector=M_,ln.matchesSelectorAndParentsTo=t7,ln.offsetXYFromParent=l7,ln.outerHeight=i7,ln.outerWidth=o7,ln.removeClassName=T_,ln.removeEvent=r7,ln.removeUserSelectStyles=p7;var Cr=Mi,O_=e7(js);function k_(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(k_=function(r){return r?n:t})(e)}function e7(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=k_(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 hf="";function M_(e,t){return hf||(hf=(0,Cr.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(n){return(0,Cr.isFunction)(e[n])})),(0,Cr.isFunction)(e[hf])?e[hf](t):!1}function t7(e,t,n){let r=e;do{if(M_(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function n7(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 r7(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 i7(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 o7(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 s7(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 a7(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 l7(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 c7(e,t){const n=Gm(e,t,"px");return{[(0,O_.browserPrefixToKey)("transform",O_.default)]:n}}function u7(e,t){return Gm(e,t,"")}function Gm(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 d7(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 f7(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function h7(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
|
+
`,t.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
106
|
+
`,e.getElementsByTagName("head")[0].appendChild(t)),e.body&&D_(e.body,"react-draggable-transparent-selection")}function p7(e){if(e)try{if(e.body&&T_(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 D_(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function T_(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=v7,Di.canDragY=b7,Di.createCoreData=x7,Di.createDraggableData=w7,Di.getBoundPosition=g7,Di.getControlPosition=y7,Di.snapToGrid=m7;var Er=Mi,tl=ln;function g7(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r=="string"?r:_7(r);const i=Ym(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,tl.innerWidth)(l)-(0,tl.outerWidth)(i)-i.offsetLeft+(0,Er.int)(d.paddingRight)-(0,Er.int)(c.marginRight),bottom:(0,tl.innerHeight)(l)-(0,tl.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 m7(e,t,n){const r=Math.round(t/e[0])*e[0],i=Math.round(n/e[1])*e[1];return[r,i]}function v7(e){return e.props.axis==="both"||e.props.axis==="x"}function b7(e){return e.props.axis==="both"||e.props.axis==="y"}function y7(e,t,n){const r=typeof t=="number"?(0,tl.getTouch)(e,t):null;if(typeof t=="number"&&!r)return null;const i=Ym(n),o=n.props.offsetParent||i.offsetParent||i.ownerDocument.body;return(0,tl.offsetXYFromParent)(r||e,o,n.props.scale)}function x7(e,t,n){const r=!(0,Er.isNum)(e.lastX),i=Ym(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 w7(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 _7(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function Ym(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var pf={},gf={};Object.defineProperty(gf,"__esModule",{value:!0}),gf.default=S7;function S7(){}Object.defineProperty(pf,"__esModule",{value:!0}),pf.default=void 0;var Km=E7(m),sr=Qm(Fo),C7=Qm(kt),Vn=ln,jo=Di,Xm=Mi,Fc=Qm(gf);function Qm(e){return e&&e.__esModule?e:{default:e}}function A_(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(A_=function(r){return r?n:t})(e)}function E7(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=A_(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 Zn(e,t,n){return t=P7(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function P7(e){var t=O7(e,"string");return typeof t=="symbol"?t:String(t)}function O7(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,mf=class extends Km.Component{constructor(){super(...arguments),Zn(this,"dragging",!1),Zn(this,"lastX",NaN),Zn(this,"lastY",NaN),Zn(this,"touchIdentifier",null),Zn(this,"mounted",!1),Zn(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,Vn.matchesSelectorAndParentsTo)(t.target,this.props.handle,n)||this.props.cancel&&(0,Vn.matchesSelectorAndParentsTo)(t.target,this.props.cancel,n))return;t.type==="touchstart"&&t.preventDefault();const i=(0,Vn.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,Fc.default)("DraggableCore: handleDragStart: %j",l),(0,Fc.default)("calling",this.props.onStart),!(this.props.onStart(t,l)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,Vn.addUserSelectStyles)(r),this.dragging=!0,this.lastX=s,this.lastY=a,(0,Vn.addEvent)(r,zo.move,this.handleDrag),(0,Vn.addEvent)(r,zo.stop,this.handleDragStop))}),Zn(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,Fc.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}),Zn(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,Vn.removeUserSelectStyles)(a.ownerDocument),(0,Fc.default)("DraggableCore: handleDragStop: %j",o),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&((0,Fc.default)("DraggableCore: Removing handlers"),(0,Vn.removeEvent)(a.ownerDocument,zo.move,this.handleDrag),(0,Vn.removeEvent)(a.ownerDocument,zo.stop,this.handleDragStop))}),Zn(this,"onMouseDown",t=>(zo=gi.mouse,this.handleDragStart(t))),Zn(this,"onMouseUp",t=>(zo=gi.mouse,this.handleDragStop(t))),Zn(this,"onTouchStart",t=>(zo=gi.touch,this.handleDragStart(t))),Zn(this,"onTouchEnd",t=>(zo=gi.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,Vn.addEvent)(t,gi.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:n}=t;(0,Vn.removeEvent)(n,gi.mouse.move,this.handleDrag),(0,Vn.removeEvent)(n,gi.touch.move,this.handleDrag),(0,Vn.removeEvent)(n,gi.mouse.stop,this.handleDragStop),(0,Vn.removeEvent)(n,gi.touch.stop,this.handleDragStop),(0,Vn.removeEvent)(t,gi.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,Vn.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:C7.default.findDOMNode(this)}render(){return Km.cloneElement(Km.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};pf.default=mf,Zn(mf,"displayName","DraggableCore"),Zn(mf,"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:Xm.dontSetMe,style:Xm.dontSetMe,transform:Xm.dontSetMe}),Zn(mf,"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(UN),o=ln,s=Di,a=Mi,l=d(pf),c=d(gf);function d(_){return _&&_.__esModule?_:{default:_}}function f(_){if(typeof WeakMap!="function")return null;var C=new WeakMap,O=new WeakMap;return(f=function(P){return P?O:C})(_)}function g(_,C){if(!C&&_&&_.__esModule)return _;if(_===null||typeof _!="object"&&typeof _!="function")return{default:_};var O=f(C);if(O&&O.has(_))return O.get(_);var P={},k=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var A in _)if(A!=="default"&&Object.prototype.hasOwnProperty.call(_,A)){var L=k?Object.getOwnPropertyDescriptor(_,A):null;L&&(L.get||L.set)?Object.defineProperty(P,A,L):P[A]=_[A]}return P.default=_,O&&O.set(_,P),P}function p(){return p=Object.assign?Object.assign.bind():function(_){for(var C=1;C<arguments.length;C++){var O=arguments[C];for(var P in O)Object.prototype.hasOwnProperty.call(O,P)&&(_[P]=O[P])}return _},p.apply(this,arguments)}function v(_,C,O){return C=y(C),C in _?Object.defineProperty(_,C,{value:O,enumerable:!0,configurable:!0,writable:!0}):_[C]=O,_}function y(_){var C=x(_,"string");return typeof C=="symbol"?C:String(C)}function x(_,C){if(typeof _!="object"||_===null)return _;var O=_[Symbol.toPrimitive];if(O!==void 0){var P=O.call(_,C||"default");if(typeof P!="object")return P;throw new TypeError("@@toPrimitive must return a primitive value.")}return(C==="string"?String:Number)(_)}class w extends t.Component{static getDerivedStateFromProps(C,O){let{position:P}=C,{prevPropsPosition:k}=O;return P&&(!k||P.x!==k.x||P.y!==k.y)?((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:P,prevPropsPosition:k}),{x:P.x,y:P.y,prevPropsPosition:{...P}}):null}constructor(C){super(C),v(this,"onDragStart",(O,P)=>{if((0,c.default)("Draggable: onDragStart: %j",P),this.props.onStart(O,(0,s.createDraggableData)(this,P))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),v(this,"onDrag",(O,P)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",P);const k=(0,s.createDraggableData)(this,P),A={x:k.x,y:k.y,slackX:0,slackY:0};if(this.props.bounds){const{x:F,y:B}=A;A.x+=this.state.slackX,A.y+=this.state.slackY;const[H,V]=(0,s.getBoundPosition)(this,A.x,A.y);A.x=H,A.y=V,A.slackX=this.state.slackX+(F-A.x),A.slackY=this.state.slackY+(B-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(O,k)===!1)return!1;this.setState(A)}),v(this,"onDragStop",(O,P)=>{if(!this.state.dragging||this.props.onStop(O,(0,s.createDraggableData)(this,P))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",P);const A={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:F,y:B}=this.props.position;A.x=F,A.y=B}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,O;return(C=(O=this.props)===null||O===void 0||(O=O.nodeRef)===null||O===void 0?void 0:O.current)!==null&&C!==void 0?C:r.default.findDOMNode(this)}render(){const{axis:C,bounds:O,children:P,defaultPosition:k,defaultClassName:A,defaultClassNameDragging:L,defaultClassNameDragged:F,position:B,positionOffset:H,scale:V,...K}=this.props;let Y={},$=null;const j=!!!B||this.state.dragging,ne=B||k,se={x:(0,s.canDragX)(this)&&j?this.state.x:ne.x,y:(0,s.canDragY)(this)&&j?this.state.y:ne.y};this.state.isElementSVG?$=(0,o.createSVGTransform)(se,H):Y=(0,o.createCSSTransform)(se,H);const D=(0,i.default)(P.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(P),{className:D,style:{...P.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})}(__);const{default:I_,DraggableCore:k7}=__;ff.exports=I_,ff.exports.default=I_,ff.exports.DraggableCore=k7;var R_=ff.exports,vf={exports:{}},jc={},Zm={};Zm.__esModule=!0,Zm.cloneElement=R7;var M7=D7(m);function D7(e){return e&&e.__esModule?e:{default:e}}function N_(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 L_(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?N_(Object(n),!0).forEach(function(r){T7(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function T7(e,t,n){return t=A7(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function A7(e){var t=I7(e,"string");return typeof t=="symbol"?t:String(t)}function I7(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 R7(e,t){return t.style&&e.props.style&&(t.style=L_(L_({},e.props.style),t.style)),t.className&&e.props.className&&(t.className=e.props.className+" "+t.className),M7.default.cloneElement(e,t)}var zc={};zc.__esModule=!0,zc.resizableProps=void 0;var it=N7(Fo);function N7(e){return e&&e.__esModule?e:{default:e}}var L7={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)}};zc.resizableProps=L7,jc.__esModule=!0,jc.default=void 0;var Bc=B7(m),$7=R_,F7=Zm,j7=zc,z7=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function $_(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return($_=function(i){return i?n:t})(e)}function B7(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=$_(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 Jm(){return Jm=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},Jm.apply(this,arguments)}function H7(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 F_(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 ev(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?F_(Object(n),!0).forEach(function(r){V7(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):F_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function V7(e,t,n){return t=W7(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function W7(e){var t=q7(e,"string");return typeof t=="symbol"?t:String(t)}function q7(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 U7(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,tv(e,t)}function tv(e,t){return tv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},tv(e,t)}var nv=function(e){U7(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 _=x.top-s.lastHandleRect.top;f+=_}}s.lastHandleRect=x,y==="w"&&(d=-d),v==="n"&&(f=-f);var C=s.props.width+(g?d/s.props.transformScale:0),O=s.props.height+(p?f/s.props.transformScale:0),P=s.runConstraints(C,O);C=P[0],O=P[1];var k=C!==s.props.width||O!==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:O},handle:o})),i==="onResizeStop"&&s.resetData()}}},n.renderResizeHandle=function(i,o){var s=this.props.handle;if(!s)return Bc.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=ev({ref:o},a?{}:{handleAxis:i});return Bc.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=H7(o,z7);return(0,F7.cloneElement)(s,ev(ev({},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]=Bc.createRef();return Bc.createElement($7.DraggableCore,Jm({},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}(Bc.Component);jc.default=nv,nv.propTypes=j7.resizableProps,nv.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var bf={};bf.__esModule=!0,bf.default=void 0;var rv=Q7(m),G7=j_(Fo),Y7=j_(jc),K7=zc,X7=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function j_(e){return e&&e.__esModule?e:{default:e}}function z_(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(z_=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=z_(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 iv(){return iv=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},iv.apply(this,arguments)}function B_(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 yf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?B_(Object(n),!0).forEach(function(r){Z7(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):B_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Z7(e,t,n){return t=J7(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function J7(e){var t=e4(e,"string");return typeof t=="symbol"?t:String(t)}function e4(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 t4(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 n4(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,ov(e,t)}function ov(e,t){return ov=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},ov(e,t)}var H_=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.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=t4(i,X7);return rv.createElement(Y7.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},rv.createElement("div",iv({},w,{style:yf(yf({},y),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},t}(rv.Component);bf.default=H_,H_.propTypes=yf(yf({},K7.resizableProps),{},{children:G7.default.element}),vf.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},vf.exports.Resizable=jc.default,vf.exports.ResizableBox=bf.default;var r4=vf.exports,ro={};Object.defineProperty(ro,"__esModule",{value:!0}),ro.resizeHandleType=ro.resizeHandleAxesType=ro.default=void 0;var ct=V_(Fo),i4=V_(m);function V_(e){return e&&e.__esModule?e:{default:e}}const W_=ct.default.arrayOf(ct.default.oneOf(["s","w","e","n","sw","nw","se","ne"]));ro.resizeHandleAxesType=W_;const q_=ct.default.oneOfType([ct.default.node,ct.default.func]);ro.resizeHandleType=q_;var o4={className:ct.default.string,style:ct.default.object,width:ct.default.number,autoSize:ct.default.bool,cols:ct.default.number,draggableCancel:ct.default.string,draggableHandle:ct.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:ct.default.oneOf(["vertical","horizontal"]),layout:function(e){var t=e.layout;t!==void 0&&pt.validateLayout(t,"layout")},margin:ct.default.arrayOf(ct.default.number),containerPadding:ct.default.arrayOf(ct.default.number),rowHeight:ct.default.number,maxRows:ct.default.number,isBounded:ct.default.bool,isDraggable:ct.default.bool,isResizable:ct.default.bool,allowOverlap:ct.default.bool,preventCollision:ct.default.bool,useCSSTransforms:ct.default.bool,transformScale:ct.default.number,isDroppable:ct.default.bool,resizeHandles:W_,resizeHandle:q_,onLayoutChange:ct.default.func,onDragStart:ct.default.func,onDrag:ct.default.func,onDragStop:ct.default.func,onResizeStart:ct.default.func,onResize:ct.default.func,onResizeStop:ct.default.func,onDrop:ct.default.func,droppingItem:ct.default.shape({i:ct.default.string.isRequired,w:ct.default.number.isRequired,h:ct.default.number.isRequired}),children:function(e,t){const n=e[t],r={};i4.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:ct.default.any};ro.default=o4,Object.defineProperty(uf,"__esModule",{value:!0}),uf.default=void 0;var nl=sv(m),Mt=sv(Fo),s4=R_,a4=r4,rl=pt,Rn=ki,U_=ro,l4=sv(Em);function sv(e){return e&&e.__esModule?e:{default:e}}function Ti(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)}class av extends nl.default.Component{constructor(){super(...arguments),Ti(this,"state",{resizing:null,dragging:null,className:""}),Ti(this,"elementRef",nl.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,Rn.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:_}=r;if(_){const{margin:C,rowHeight:O}=this.props,P=_.clientHeight-(0,Rn.calcGridItemWHPx)(g,O,C[1]);a=(0,Rn.clamp)(a,0,P);const k=(0,Rn.calcGridColWidth)(v),A=p-(0,Rn.calcGridItemWHPx)(f,k,C[0]);l=(0,Rn.clamp)(l,0,A)}}const y={top:a,left:l};this.setState({dragging:y});const{x,y:w}=(0,Rn.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,Rn.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,Rn.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),i=(0,Rn.calcGridItemPosition)(this.getPositionParams(t),t.x,t.y,t.w,t.h,n);return!(0,rl.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,rl.setTransform)(t):(o=(0,rl.setTopLeft)(t),n&&(o.left=(0,rl.perc)(t.left/r),o.width=(0,rl.perc)(t.width/r))),o}mixinDraggable(t,n){return nl.default.createElement(s4.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,Rn.calcGridItemPosition)(g,0,0,i,0).width,v=(0,Rn.calcGridItemPosition)(g,0,0,o,s),y=(0,Rn.calcGridItemPosition)(g,0,0,a,l),x=[v.width,v.height],w=[Math.min(y.width,p),Math.min(y.height,1/0)];return nl.default.createElement(a4.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,rl.resizeItemInDirection)(a,r,s,v),this.setState({resizing:i==="onResizeStop"?null:w}));let{w:_,h:C}=(0,Rn.calcWH)(this.getPositionParams(),w.width,w.height,c,d,a);_=(0,Rn.clamp)(_,Math.max(y,1),x),C=(0,Rn.clamp)(C,p,g),l.call(this,f,_,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,Rn.calcGridItemPosition)(this.getPositionParams(),t,n,r,i,this.state),d=nl.default.Children.only(this.props.children);let f=nl.default.cloneElement(d,{ref:this.elementRef,className:(0,l4.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}}uf.default=av,Ti(av,"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:U_.resizeHandleAxesType,resizeHandle:U_.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(av,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1}),Object.defineProperty(Nc,"__esModule",{value:!0}),Nc.default=void 0;var zs=p4(m),lv=Cm,d4=cv(Em),Ye=pt,f4=ki,G_=cv(uf),h4=cv(ro);function cv(e){return e&&e.__esModule?e:{default:e}}function Y_(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(Y_=function(r){return r?n:t})(e)}function p4(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=Y_(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=g4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g4(e){var t=m4(e,"string");return typeof t=="symbol"?t:String(t)}function m4(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 K_="react-grid-layout";let X_=!1;try{X_=/firefox/i.test(navigator.userAgent)}catch{}class xf extends zs.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[_,C]=(0,Ye.withLayoutItem)(d,t,P=>{let k;return x=P.x,w=P.y,["sw","w","nw","n","ne"].indexOf(l)!==-1&&(["sw","nw","w"].indexOf(l)!==-1&&(x=P.x+(P.w-n),n=P.x!==x&&x<0?P.w:n,x=x<0?0:x),["ne","n","nw"].indexOf(l)!==-1&&(w=P.y+(P.h-r),r=P.y!==w&&w<0?P.h:r,w=w<0?0:w),v=!0),g&&!p&&(k=(0,Ye.getAllCollisions)(d,{...P,w:n,h:r,x,y:w}).filter(L=>L.i!==P.i).length>0,k&&(w=P.y,r=P.h,x=P.x,n=P.w,v=!1)),P.w=n,P.h=r,P});if(!C)return;y=_,v&&(y=(0,Ye.moveElement)(_,C,x,w,!0,this.props.preventCollision,(0,Ye.compactType)(this.props),f,p));const O={w:C.w,h:C.h,x:C.x,y:C.y,static:!0,i:t};this.props.onResize(y,c,C,O,o,s),this.setState({layout:p?y:(0,Ye.compact)(y,(0,Ye.compactType)(this.props),f),activeDrag:O})}),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(),X_&&!((n=t.nativeEvent.target)!==null&&n!==void 0&&n.classList.contains(K_)))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:_,top:C}=this.state.droppingPosition;(_!=y||C!=x)&&this.setState({droppingPosition:w})}}else{const _={cols:s,margin:o,maxRows:l,rowHeight:a,containerWidth:c,containerPadding:d||o},C=(0,f4.calcXY)(_,x,y,p.w,p.h);this.setState({droppingDOMNode:zs.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,lv.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,lv.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,lv.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 zs.createElement(G_.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},zs.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:_}=this.props,{mounted:C,droppingPosition:O}=this.state,P=typeof r.isDraggable=="boolean"?r.isDraggable:!r.static&&d,k=typeof r.isResizable=="boolean"?r.isResizable:!r.static&&f,A=r.resizeHandles||w,L=P&&g&&r.isBounded!==!1;return zs.createElement(G_.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:P,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?O:void 0,resizeHandles:A,resizeHandle:_},t)}render(){const{className:t,style:n,isDroppable:r,innerRef:i}=this.props,o=(0,d4.default)(K_,t),s={height:this.containerHeight(),...n};return zs.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},zs.Children.map(this.props.children,a=>this.processGridItem(a)),r&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}}Nc.default=xf,Wn(xf,"displayName","ReactGridLayout"),Wn(xf,"propTypes",h4.default),Wn(xf,"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 wf={},Bs={};Object.defineProperty(Bs,"__esModule",{value:!0}),Bs.findOrGenerateResponsiveLayout=y4,Bs.getBreakpointFromWidth=v4,Bs.getColsFromBreakpoint=b4,Bs.sortBreakpoints=uv;var _f=pt;function v4(e,t){const n=uv(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 b4(e,t){if(!t[e])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+e+" is missing!");return t[e]}function y4(e,t,n,r,i,o){if(e[n])return(0,_f.cloneLayout)(e[n]);let s=e[r];const a=uv(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,_f.cloneLayout)(s||[]),(0,_f.compact)((0,_f.correctBounds)(s,{cols:i}),o,i)}function uv(e){return Object.keys(e).sort(function(n,r){return e[n]-e[r]})}Object.defineProperty(wf,"__esModule",{value:!0}),wf.default=void 0;var Q_=w4(m),ar=Z_(Fo),dv=Cm,il=pt,Hs=Bs,x4=Z_(Nc);function Z_(e){return e&&e.__esModule?e:{default:e}}function J_(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(J_=function(r){return r?n:t})(e)}function w4(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=J_(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 fv(){return fv=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},fv.apply(this,arguments)}function Sf(e,t,n){return t=_4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _4(e){var t=S4(e,"string");return typeof t=="symbol"?t:String(t)}function S4(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 eS=e=>Object.prototype.toString.call(e);function Cf(e,t){return e==null?null:Array.isArray(e)?e:e[t]}class hv extends Q_.Component{constructor(){super(...arguments),Sf(this,"state",this.generateInitialState()),Sf(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,Hs.getBreakpointFromWidth)(n,t),s=(0,Hs.getColsFromBreakpoint)(o,i),a=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,Hs.findOrGenerateResponsiveLayout)(r,n,o,o,s,a),breakpoint:o,cols:s}}static getDerivedStateFromProps(t,n){if(!(0,dv.deepEqual)(t.layouts,n.layouts)){const{breakpoint:r,cols:i}=n;return{layout:(0,Hs.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,dv.deepEqual)(this.props.breakpoints,t.breakpoints)||!(0,dv.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,Hs.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),a=this.state.breakpoint,l=(0,Hs.getColsFromBreakpoint)(s,r),c={...i};if(a!==s||t.breakpoints!==n||t.cols!==r){a in c||(c[a]=(0,il.cloneLayout)(this.state.layout));let g=(0,Hs.findOrGenerateResponsiveLayout)(c,n,s,a,l,o);g=(0,il.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=Cf(this.props.margin,s),f=Cf(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 Q_.createElement(x4.default,fv({},d,{margin:Cf(o,this.state.breakpoint),containerPadding:Cf(s,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}}wf.default=hv,Sf(hv,"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(eS(e[t])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+eS(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,il.validateLayout)(e.layouts[n],"layouts."+n)})},width:ar.default.number.isRequired,onBreakpointChange:ar.default.func,onLayoutChange:ar.default.func,onWidthChange:ar.default.func}),Sf(hv,"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:il.noop,onLayoutChange:il.noop,onWidthChange:il.noop});var pv={},tS=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}()}(),gv=typeof window<"u"&&typeof document<"u"&&window.document===document,Ef=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")()}(),C4=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Ef):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),E4=2;function P4(e,t){var n=!1,r=!1,i=0;function o(){n&&(n=!1,e()),r&&a()}function s(){C4(o)}function a(){var l=Date.now();if(n){if(l-i<E4)return;r=!0}else n=!0,r=!1,setTimeout(s,t);i=l}return a}var O4=20,k4=["top","right","bottom","left","width","height","size","weight"],M4=typeof MutationObserver<"u",D4=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=P4(this.refresh.bind(this),O4)}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(){!gv||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),M4?(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(){!gv||!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=k4.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}(),nS=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},ol=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||Ef},rS=Of(0,0,0,0);function Pf(e){return parseFloat(e)||0}function iS(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+Pf(o)},0)}function T4(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]=Pf(s)}return n}function A4(e){var t=e.getBBox();return Of(0,0,t.width,t.height)}function I4(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return rS;var r=ol(e).getComputedStyle(e),i=T4(r),o=i.left+i.right,s=i.top+i.bottom,a=Pf(r.width),l=Pf(r.height);if(r.boxSizing==="border-box"&&(Math.round(a+o)!==t&&(a-=iS(r,"left","right")+o),Math.round(l+s)!==n&&(l-=iS(r,"top","bottom")+s)),!N4(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 Of(i.left,i.top,a,l)}var R4=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof ol(e).SVGGraphicsElement}:function(e){return e instanceof ol(e).SVGElement&&typeof e.getBBox=="function"}}();function N4(e){return e===ol(e).document.documentElement}function L4(e){return gv?R4(e)?A4(e):I4(e):rS}function $4(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 nS(s,{x:t,y:n,width:r,height:i,top:n,right:t+r,bottom:i+n,left:t}),s}function Of(e,t,n,r){return{x:e,y:t,width:n,height:r}}var F4=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Of(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=L4(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}(),j4=function(){function e(t,n){var r=$4(n);nS(this,{target:t,contentRect:r})}return e}(),z4=function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new tS,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 ol(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new F4(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 ol(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 j4(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}(),oS=typeof WeakMap<"u"?new WeakMap:new tS,sS=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=D4.getInstance(),r=new z4(t,n,this);oS.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){sS.prototype[e]=function(){var t;return(t=oS.get(this))[e].apply(t,arguments)}});var B4=function(){return typeof Ef.ResizeObserver<"u"?Ef.ResizeObserver:sS}();const H4=$g(Object.freeze(Object.defineProperty({__proto__:null,default:B4},Symbol.toStringTag,{value:"Module"})));Object.defineProperty(pv,"__esModule",{value:!0}),pv.default=X4;var kf=U4(m),V4=mv(Fo),W4=mv(H4),q4=mv(Em);function mv(e){return e&&e.__esModule?e:{default:e}}function aS(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(aS=function(r){return r?n:t})(e)}function U4(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=aS(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 vv(){return vv=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},vv.apply(this,arguments)}function sl(e,t,n){return t=G4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function G4(e){var t=Y4(e,"string");return typeof t=="symbol"?t:String(t)}function Y4(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 K4="react-grid-layout";function X4(e){var t;return t=class extends kf.Component{constructor(){super(...arguments),sl(this,"state",{width:1280}),sl(this,"elementRef",kf.createRef()),sl(this,"mounted",!1),sl(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new W4.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?kf.createElement("div",{className:(0,q4.default)(this.props.className,K4),style:this.props.style,ref:this.elementRef}):kf.createElement(e,vv({innerRef:this.elementRef},i,this.state))}},sl(t,"defaultProps",{measureBeforeMount:!1}),sl(t,"propTypes",{measureBeforeMount:V4.default.bool}),t}(function(e){e.exports=Nc.default,e.exports.utils=pt,e.exports.calculateUtils=ki,e.exports.Responsive=wf.default,e.exports.Responsive.utils=Bs,e.exports.WidthProvider=pv.default})(Qw);var lS=Qw.exports;function Hc({children:e,className:t,text:n,onSave:r}){const[i,o]=m.useState(!1),[s,a]=m.useState(n),l=xe(d=>d.isDashboardEditing),c=d=>{d.stopPropagation(),l&&o(!0)};return S.jsx("div",{role:"editable",onDoubleClick:c,children:i?S.jsx("input",{type:"text",className:Oe("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 bv=ue.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Oe("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));bv.displayName="Card";const yv=ue.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Oe("flex flex-col space-y-1.5 p-6",e),...t}));yv.displayName="CardHeader";const xv=ue.forwardRef(({className:e,...t},n)=>S.jsx("h3",{ref:n,className:Oe("text-2xl font-semibold leading-none tracking-tight",e),...t}));xv.displayName="CardTitle";const wv=ue.forwardRef(({className:e,...t},n)=>S.jsx("p",{ref:n,className:Oe("text-sm text-muted-foreground",e),...t}));wv.displayName="CardDescription";const _v=ue.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Oe("p-6 pt-0",e),...t}));_v.displayName="CardContent";const Q4=ue.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Oe("flex items-center p-6 pt-0",e),...t}));Q4.displayName="CardFooter";/*!
|
|
107
|
+
* @kurkle/color v0.3.2
|
|
108
|
+
* https://github.com/kurkle/color#readme
|
|
109
|
+
* (c) 2023 Jukka Kurkela
|
|
110
|
+
* Released under the MIT License
|
|
111
|
+
*/function Vc(e){return e+.5|0}const Bo=(e,t,n)=>Math.max(Math.min(e,n),t);function Wc(e){return Bo(Vc(e*2.55),0,255)}function Ho(e){return Bo(Vc(e*255),0,255)}function io(e){return Bo(Vc(e/2.55)/100,0,1)}function cS(e){return Bo(Vc(e*100),0,100)}const Kr={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Sv=[..."0123456789ABCDEF"],Z4=e=>Sv[e&15],J4=e=>Sv[(e&240)>>4]+Sv[e&15],Mf=e=>(e&240)>>4===(e&15),eL=e=>Mf(e.r)&&Mf(e.g)&&Mf(e.b)&&Mf(e.a);function tL(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&Kr[e[1]]*17,g:255&Kr[e[2]]*17,b:255&Kr[e[3]]*17,a:t===5?Kr[e[4]]*17:255}:(t===7||t===9)&&(n={r:Kr[e[1]]<<4|Kr[e[2]],g:Kr[e[3]]<<4|Kr[e[4]],b:Kr[e[5]]<<4|Kr[e[6]],a:t===9?Kr[e[7]]<<4|Kr[e[8]]:255})),n}const nL=(e,t)=>e<255?t(e):"";function rL(e){var t=eL(e)?Z4:J4;return e?"#"+t(e.r)+t(e.g)+t(e.b)+nL(e.a,t):void 0}const iL=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function uS(e,t,n){const r=t*Math.min(n,1-n),i=(o,s=(o+e/30)%12)=>n-r*Math.max(Math.min(s-3,9-s,1),-1);return[i(0),i(8),i(4)]}function oL(e,t,n){const r=(i,o=(i+e/60)%6)=>n-n*t*Math.max(Math.min(o,4-o,1),0);return[r(5),r(3),r(1)]}function sL(e,t,n){const r=uS(e,1,.5);let i;for(t+n>1&&(i=1/(t+n),t*=i,n*=i),i=0;i<3;i++)r[i]*=1-t-n,r[i]+=t;return r}function aL(e,t,n,r,i){return e===i?(t-n)/r+(t<n?6:0):t===i?(n-e)/r+2:(e-t)/r+4}function Cv(e){const n=e.r/255,r=e.g/255,i=e.b/255,o=Math.max(n,r,i),s=Math.min(n,r,i),a=(o+s)/2;let l,c,d;return o!==s&&(d=o-s,c=a>.5?d/(2-o-s):d/(o+s),l=aL(n,r,i,d,o),l=l*60+.5),[l|0,c||0,a]}function Ev(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(Ho)}function Pv(e,t,n){return Ev(uS,e,t,n)}function lL(e,t,n){return Ev(sL,e,t,n)}function cL(e,t,n){return Ev(oL,e,t,n)}function dS(e){return(e%360+360)%360}function uL(e){const t=iL.exec(e);let n=255,r;if(!t)return;t[5]!==r&&(n=t[6]?Wc(+t[5]):Ho(+t[5]));const i=dS(+t[2]),o=+t[3]/100,s=+t[4]/100;return t[1]==="hwb"?r=lL(i,o,s):t[1]==="hsv"?r=cL(i,o,s):r=Pv(i,o,s),{r:r[0],g:r[1],b:r[2],a:n}}function dL(e,t){var n=Cv(e);n[0]=dS(n[0]+t),n=Pv(n),e.r=n[0],e.g=n[1],e.b=n[2]}function fL(e){if(!e)return;const t=Cv(e),n=t[0],r=cS(t[1]),i=cS(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${i}%, ${io(e.a)})`:`hsl(${n}, ${r}%, ${i}%)`}const fS={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},hS={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function hL(){const e={},t=Object.keys(hS),n=Object.keys(fS);let r,i,o,s,a;for(r=0;r<t.length;r++){for(s=a=t[r],i=0;i<n.length;i++)o=n[i],a=a.replace(o,fS[o]);o=parseInt(hS[s],16),e[a]=[o>>16&255,o>>8&255,o&255]}return e}let Df;function pL(e){Df||(Df=hL(),Df.transparent=[0,0,0,0]);const t=Df[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const gL=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function mL(e){const t=gL.exec(e);let n=255,r,i,o;if(t){if(t[7]!==r){const s=+t[7];n=t[8]?Wc(s):Bo(s*255,0,255)}return r=+t[1],i=+t[3],o=+t[5],r=255&(t[2]?Wc(r):Bo(r,0,255)),i=255&(t[4]?Wc(i):Bo(i,0,255)),o=255&(t[6]?Wc(o):Bo(o,0,255)),{r,g:i,b:o,a:n}}}function vL(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${io(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const Ov=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,al=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function bL(e,t,n){const r=al(io(e.r)),i=al(io(e.g)),o=al(io(e.b));return{r:Ho(Ov(r+n*(al(io(t.r))-r))),g:Ho(Ov(i+n*(al(io(t.g))-i))),b:Ho(Ov(o+n*(al(io(t.b))-o))),a:e.a+n*(t.a-e.a)}}function Tf(e,t,n){if(e){let r=Cv(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,t===0?360:1)),r=Pv(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function pS(e,t){return e&&Object.assign(t||{},e)}function gS(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=Ho(e[3]))):(t=pS(e,{r:0,g:0,b:0,a:1}),t.a=Ho(t.a)),t}function yL(e){return e.charAt(0)==="r"?mL(e):uL(e)}class qc{constructor(t){if(t instanceof qc)return t;const n=typeof t;let r;n==="object"?r=gS(t):n==="string"&&(r=tL(t)||pL(t)||yL(t)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var t=pS(this._rgb);return t&&(t.a=io(t.a)),t}set rgb(t){this._rgb=gS(t)}rgbString(){return this._valid?vL(this._rgb):void 0}hexString(){return this._valid?rL(this._rgb):void 0}hslString(){return this._valid?fL(this._rgb):void 0}mix(t,n){if(t){const r=this.rgb,i=t.rgb;let o;const s=n===o?.5:n,a=2*s-1,l=r.a-i.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;o=1-c,r.r=255&c*r.r+o*i.r+.5,r.g=255&c*r.g+o*i.g+.5,r.b=255&c*r.b+o*i.b+.5,r.a=s*r.a+(1-s)*i.a,this.rgb=r}return this}interpolate(t,n){return t&&(this._rgb=bL(this._rgb,t._rgb,n)),this}clone(){return new qc(this.rgb)}alpha(t){return this._rgb.a=Ho(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=Vc(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=n,this}opaquer(t){const n=this._rgb;return n.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Tf(this._rgb,2,t),this}darken(t){return Tf(this._rgb,2,-t),this}saturate(t){return Tf(this._rgb,1,t),this}desaturate(t){return Tf(this._rgb,1,-t),this}rotate(t){return dL(this._rgb,t),this}}/*!
|
|
112
|
+
* Chart.js v4.4.1
|
|
113
|
+
* https://www.chartjs.org
|
|
114
|
+
* (c) 2023 Chart.js Contributors
|
|
115
|
+
* Released under the MIT License
|
|
116
|
+
*/function oo(){}const xL=(()=>{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 Pr(e,t){return cn(e)?e:t}function tt(e,t){return typeof e>"u"?t:e}const wL=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,mS=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function jt(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function Rt(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 Af(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 If(e){if(Yt(e))return e.map(If);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]]=If(e[n[i]]);return t}return e}function vS(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function _L(e,t,n,r){if(!vS(e))return;const i=t[e],o=n[e];wt(i)&&wt(o)?Ai(i,o,r):t[e]=If(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||_L;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 Uc(e,t){return Ai(e,t,{merger:SL})}function SL(e,t,n){if(!vS(e))return;const r=t[e],i=n[e];wt(r)&&wt(i)?Uc(r,i):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=If(i))}const bS={"":e=>e,x:e=>e.x,y:e=>e.y};function CL(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 EL(e){const t=CL(e);return n=>{for(const r of t){if(r==="")break;n=n&&n[r]}return n}}function Vo(e,t){return(bS[t]||(bS[t]=EL(t)))(e)}function kv(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Gc=e=>typeof e<"u",Wo=e=>typeof e=="function",yS=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function PL(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const Kt=Math.PI,Xt=2*Kt,OL=Xt+Kt,Rf=Number.POSITIVE_INFINITY,kL=Kt/180,dn=Kt/2,Vs=Kt/4,xS=Kt*2/3,qo=Math.log10,Ii=Math.sign;function Yc(e,t,n){return Math.abs(e-t)<n}function wS(e){const t=Math.round(e);e=Yc(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 ML(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 ll(e){return!isNaN(parseFloat(e))&&isFinite(e)}function DL(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function _S(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 Mv(e){return e*(180/Kt)}function SS(e){if(!cn(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function CS(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 Dv(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function TL(e,t){return(e-t+OL)%Xt-Kt}function Or(e){return(e%Xt+Xt)%Xt}function Kc(e,t,n,r){const i=Or(e),o=Or(t),s=Or(n),a=Or(o-i),l=Or(s-i),c=Or(i-o),d=Or(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 AL(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 Tv(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)=>Tv(e,n,r?i=>{const o=e[i][t];return o<n||o===n&&e[i+1][t]===n}:i=>e[i][t]<n),IL=(e,t,n)=>Tv(e,n,r=>e[r][t]>=n);function RL(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 ES=["push","pop","shift","splice","unshift"];function NL(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),ES.forEach(n=>{const r="_onData"+kv(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 PS(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)&&(ES.forEach(o=>{delete e[o]}),delete e._chartjs)}function OS(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const kS=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function MS(e,t){let n=[],r=!1;return function(...i){n=i,r||(r=!0,kS.call(window,()=>{r=!1,e.apply(t,n)}))}}function LL(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}const Av=e=>e==="start"?"left":e==="end"?"right":"center",qn=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,$L=(e,t,n,r)=>e===(r?"left":"right")?n:e==="center"?(t+n)/2:t;function DS(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 TS(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 Nf=e=>e===0||e===1,AS=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*Xt/n)),IS=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*Xt/n)+1,Xc={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=>Nf(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=>Nf(e)?e:AS(e,.075,.3),easeOutElastic:e=>Nf(e)?e:IS(e,.075,.3),easeInOutElastic(e){return Nf(e)?e:e<.5?.5*AS(e*2,.1125,.45):.5+.5*IS(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-Xc.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?Xc.easeInBounce(e*2)*.5:Xc.easeOutBounce(e*2-1)*.5+.5};function Iv(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function RS(e){return Iv(e)?e:new qc(e)}function Rv(e){return Iv(e)?e:new qc(e).saturate(.5).darken(.1).hexString()}const FL=["x","y","borderWidth","radius","tension"],jL=["color","borderColor","backgroundColor"];function zL(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:jL},numbers:{type:"number",properties:FL}}),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 BL(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const NS=new Map;function HL(e,t){t=t||{};const n=e+JSON.stringify(t);let r=NS.get(n);return r||(r=new Intl.NumberFormat(e,t),NS.set(n,r)),r}function Qc(e,t,n){return HL(t,n).format(e)}const LS={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=VL(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),Qc(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?LS.numeric.call(this,e,t,n):""}};function VL(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 Lf={formatters:LS};function WL(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:Lf.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 Ws=Object.create(null),Nv=Object.create(null);function Zc(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 Lv(e,t,n){return typeof t=="string"?Ai(Zc(e,t),n):Ai(Zc(e,""),t)}class qL{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)=>Rv(i.backgroundColor),this.hoverBorderColor=(r,i)=>Rv(i.borderColor),this.hoverColor=(r,i)=>Rv(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 Lv(this,t,n)}get(t){return Zc(this,t)}describe(t,n){return Lv(Nv,t,n)}override(t,n){return Lv(Ws,t,n)}route(t,n,r,i){const o=Zc(this,t),s=Zc(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 qL({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[zL,BL,WL]);function UL(e){return!e||gt(e.size)||gt(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function $f(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 GL(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=$f(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=$f(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 qs(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 $S(e,t){t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore()}function $v(e,t,n,r){FS(e,t,n,r,null)}function FS(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)*kL;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+=xS,e.lineTo(n+Math.sin(x)*d,r-Math.cos(x)*y),x+=xS,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+Vs)*l,f=Math.cos(x+Vs)*(i?i/2-c:l),a=Math.sin(x+Vs)*l,g=Math.sin(x+Vs)*(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+=Vs;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+=Vs;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+=Vs,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 Ff(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function jf(e){e.restore()}function YL(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 KL(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 XL(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 QL(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 ZL(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function Us(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,XL(e,o),l=0;l<s.length;++l)c=s[l],o.backdrop&&ZL(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),QL(e,n,r,c,o),r+=Number(i.lineHeight);e.restore()}function Jc(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 JL=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,e9=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function t9(e,t){const n=(""+e).match(JL);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 n9=e=>+e||0;function Fv(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]=n9(o(s));return n}function jS(e){return Fv(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Gs(e){return Fv(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Nn(e){const t=jS(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(e9)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const i={family:tt(e.family,t.family),lineHeight:t9(tt(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:tt(e.weight,t.weight),string:""};return i.string=UL(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 r9(e,t,n){const{min:r,max:i}=e,o=mS(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 jv(e,t=[""],n,r,i=()=>e[0]){const o=n||e;typeof r>"u"&&(r=WS("_fallback",e));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:o,_fallback:r,_getTarget:i,override:a=>jv([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 BS(a,l,()=>d9(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return qS(a).includes(l)},ownKeys(a){return qS(a)},set(a,l,c){const d=a._storage||(a._storage=i());return a[l]=d[l]=c,delete a._keys,!0}})}function cl(e,t,n,r){const i={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:zS(e,r),setContext:o=>cl(e,o,n,r),override:o=>cl(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 BS(o,s,()=>o9(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 zS(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 i9=(e,t)=>e?e+kv(t):t,zv=(e,t)=>wt(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function BS(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];const r=n();return e[t]=r,r}function o9(e,t,n){const{_proxy:r,_context:i,_subProxy:o,_descriptors:s}=e;let a=r[t];return Wo(a)&&s.isScriptable(t)&&(a=s9(t,a,e,n)),Yt(a)&&a.length&&(a=a9(t,a,e,s.isIndexable)),zv(t,a)&&(a=cl(a,i,o&&o[t],s)),a}function s9(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),zv(e,l)&&(l=Bv(i._scopes,i,e,l)),l}function a9(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=Bv(c,i,e,d);t.push(cl(f,o,s&&s[e],a))}}return t}function HS(e,t,n){return Wo(e)?e(t,n):e}const l9=(e,t)=>e===!0?t:typeof e=="string"?Vo(t,e):void 0;function c9(e,t,n,r,i){for(const o of t){const s=l9(n,o);if(s){e.add(s);const a=HS(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 Bv(e,t,n,r){const i=t._rootScopes,o=HS(t._fallback,n,r),s=[...e,...i],a=new Set;a.add(r);let l=VS(a,s,n,o||n,r);return l===null||typeof o<"u"&&o!==n&&(l=VS(a,s,o,l,r),l===null)?!1:jv(Array.from(a),[""],i,o,()=>u9(t,n,r))}function VS(e,t,n,r,i){for(;n;)n=c9(e,t,n,r,i);return n}function u9(e,t,n){const r=e._getTarget();t in r||(r[t]={});const i=r[t];return Yt(i)&&wt(n)?n:i||{}}function d9(e,t,n,r){let i;for(const o of t)if(i=WS(i9(o,e),n),typeof i<"u")return zv(e,i)?Bv(n,r,e,i):i}function WS(e,t){for(const n of t){if(!n)continue;const r=n[e];if(typeof r<"u")return r}}function qS(e){let t=e._keys;return t||(t=e._keys=f9(e._scopes)),t}function f9(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 US(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(Vo(d,o),c)};return s}const h9=Number.EPSILON||1e-14,ul=(e,t)=>t<e.length&&!e[t].skip&&e[t],GS=e=>e==="x"?"y":"x";function p9(e,t,n,r){const i=e.skip?t:e,o=t,s=n.skip?t:n,a=Dv(o,i),l=Dv(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 g9(e,t,n){const r=e.length;let i,o,s,a,l,c=ul(e,0);for(let d=0;d<r-1;++d)if(l=c,c=ul(e,d+1),!(!l||!c)){if(Yc(t[d],0,h9)){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 m9(e,t,n="x"){const r=GS(n),i=e.length;let o,s,a,l=ul(e,0);for(let c=0;c<i;++c){if(s=a,a=l,l=ul(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 v9(e,t="x"){const n=GS(t),r=e.length,i=Array(r).fill(0),o=Array(r);let s,a,l,c=ul(e,0);for(s=0;s<r;++s)if(a=l,l=c,c=ul(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]}g9(e,i,o),m9(e,o,t)}function zf(e,t,n){return Math.max(Math.min(e,n),t)}function b9(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=zf(i.cp1x,t.left,t.right),i.cp1y=zf(i.cp1y,t.top,t.bottom)),a&&(i.cp2x=zf(i.cp2x,t.left,t.right),i.cp2y=zf(i.cp2y,t.top,t.bottom)))}function y9(e,t,n,r,i){let o,s,a,l;if(t.spanGaps&&(e=e.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")v9(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=p9(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&&b9(e,n)}function Hv(){return typeof window<"u"&&typeof document<"u"}function Vv(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Bf(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 Hf=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function x9(e,t){return Hf(e).getPropertyValue(t)}const w9=["top","right","bottom","left"];function Ys(e,t,n){const r={};n=n?"-"+n:"";for(let i=0;i<4;i++){const o=w9[i];r[o]=parseFloat(e[t+"-"+o+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const _9=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function S9(e,t){const n=e.touches,r=n&&n.length?n[0]:e,{offsetX:i,offsetY:o}=r;let s=!1,a,l;if(_9(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 Ks(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:r}=t,i=Hf(n),o=i.boxSizing==="border-box",s=Ys(i,"padding"),a=Ys(i,"border","width"),{x:l,y:c,box:d}=S9(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 C9(e,t,n){let r,i;if(t===void 0||n===void 0){const o=Vv(e);if(!o)t=e.clientWidth,n=e.clientHeight;else{const s=o.getBoundingClientRect(),a=Hf(o),l=Ys(a,"border","width"),c=Ys(a,"padding");t=s.width-c.width-l.width,n=s.height-c.height-l.height,r=Bf(a.maxWidth,o,"clientWidth"),i=Bf(a.maxHeight,o,"clientHeight")}}return{width:t,height:n,maxWidth:r||Rf,maxHeight:i||Rf}}const Vf=e=>Math.round(e*10)/10;function E9(e,t,n,r){const i=Hf(e),o=Ys(i,"margin"),s=Bf(i.maxWidth,e,"clientWidth")||Rf,a=Bf(i.maxHeight,e,"clientHeight")||Rf,l=C9(e,t,n);let{width:c,height:d}=l;if(i.boxSizing==="content-box"){const g=Ys(i,"border","width"),p=Ys(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=Vf(Math.min(c,s,l.maxWidth)),d=Vf(Math.min(d,a,l.maxHeight)),c&&!d&&(d=Vf(c/2)),(t!==void 0||n!==void 0)&&r&&l.height&&d>l.height&&(d=l.height,c=Vf(Math.floor(d*r))),{width:c,height:d}}function YS(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 P9=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};Hv()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function KS(e,t){const n=x9(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function Xs(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function O9(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 k9(e,t,n,r){const i={x:e.cp2x,y:e.cp2y},o={x:t.cp1x,y:t.cp1y},s=Xs(e,i,n),a=Xs(i,o,n),l=Xs(o,t,n),c=Xs(s,a,n),d=Xs(a,l,n);return Xs(c,d,n)}const M9=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}}},D9=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function dl(e,t,n){return e?M9(t,n):D9()}function XS(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 QS(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function ZS(e){return e==="angle"?{between:Kc,compare:TL,normalize:Or}:{between:so,compare:(t,n)=>t-n,normalize:t=>t}}function JS({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 T9(e,t,n){const{property:r,start:i,end:o}=n,{between:s,normalize:a}=ZS(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 eC(e,t,n){if(!n)return[e];const{property:r,start:i,end:o}=n,s=t.length,{compare:a,between:l,normalize:c}=ZS(r),{start:d,end:f,loop:g,style:p}=T9(e,t,n),v=[];let y=!1,x=null,w,_,C;const O=()=>l(i,C,w)&&a(i,C)!==0,P=()=>a(o,w)===0||l(o,C,w),k=()=>y||O(),A=()=>!y||P();for(let L=d,F=d;L<=f;++L)_=t[L%s],!_.skip&&(w=c(_[r]),w!==C&&(y=l(w,i,o),x===null&&k()&&(x=a(w,i)===0?L:F),x!==null&&A()&&(v.push(JS({start:x,end:L,loop:g,count:s,style:p})),x=null),F=L,C=w));return x!==null&&v.push(JS({start:x,end:f,loop:g,count:s,style:p})),v}function tC(e,t){const n=[],r=e.segments;for(let i=0;i<r.length;i++){const o=eC(r[i],e.points,t);o.length&&n.push(...o)}return n}function A9(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 I9(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 R9(e,t){const n=e.points,r=e.options.spanGaps,i=n.length;if(!i)return[];const o=!!e._loop,{start:s,end:a}=A9(n,i,o,r);if(r===!0)return nC(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 nC(e,I9(n,s,l,c),n,t)}function nC(e,t,n,r){return!r||!r.setContext||!n?t:N9(e,t,n,r)}function N9(e,t,n,r){const i=e._chart.getContext(),o=rC(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 _=a?-1:1;if(v!==y){for(v+=l;n[v%l].skip;)v-=_;for(;n[y%l].skip;)y+=_;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=rC(r.setContext(Uo(i,{type:"segment",p0:y,p1:w,p0DataIndex:(g-1)%l,p1DataIndex:g%l,datasetIndex:s}))),L9(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 rC(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function L9(e,t){if(!t)return!1;const n=[],r=function(i,o){return Iv(o)?(n.includes(o)||n.push(o),n.indexOf(o)):o};return JSON.stringify(e,r)!==JSON.stringify(t,r)}/*!
|
|
117
|
+
* Chart.js v4.4.1
|
|
118
|
+
* https://www.chartjs.org
|
|
119
|
+
* (c) 2023 Chart.js Contributors
|
|
120
|
+
* Released under the MIT License
|
|
121
|
+
*/class $9{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=kS.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 $9;const iC="transparent",F9={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=RS(e||iC),i=r.valid&&RS(t||iC);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class j9{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||F9[t.type||typeof s],this._easing=Xc[t.easing]||Xc.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 oC{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=B9(t,r);if(!i)return[];const o=this._createAnimations(i,r);return r.$shared&&z9(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 j9(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 z9(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 B9(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 sC(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 H9(e,t,n){if(n===!1)return!1;const r=sC(e,n),i=sC(t,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function V9(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 aC(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 lC(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 W9(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 cC(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function q9(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function U9(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 G9(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function uC(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 dC(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=q9(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]=G9(i,d,y),g[a]=x,g._top=uC(g,s,!0,r.type),g._bottom=uC(g,s,!1,r.type);const _=g._visualValues||(g._visualValues={});_[a]=x}}function Wv(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function Y9(e,t){return Uo(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function K9(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 eu(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 qv=e=>e==="reset"||e==="none",fC=(e,t)=>t?e:Object.assign({},e),X9=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:aC(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=cC(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&&eu(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,Wv(t,"x")),s=n.yAxisID=tt(r.yAxisID,Wv(t,"y")),a=n.rAxisID=tt(r.rAxisID,Wv(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&&PS(this._data,this),t._stacked&&eu(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(wt(n))this._data=W9(n);else if(r!==n){if(r){PS(r,this);const i=this._cachedMeta;eu(i),i._parsed=[]}n&&Object.isExtensible(n)&&NL(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=cC(n.vScale,n),n.stack!==r.stack&&(i=!0,eu(n),n.stack=r.stack),this._resyncElements(t),(i||o!==n._stacked)&&dC(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&&dC(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(Vo(p,a),g),y:s.parse(Vo(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:aC(i,!0),values:n._stacks[t.axis]._visualValues};return lC(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=lC(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=X9(n,r,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:d,max:f}=U9(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=V9(tt(this.options.clip,H9(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=K9(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=Y9(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&&Gc(r);if(a)return fC(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(fC(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 oC(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||qv(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){qv(i)?Object.assign(t,r):this._resolveAnimations(n,i).update(t,r)}updateSharedOptions(t,n,r){t&&!qv(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&&eu(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 Q9(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=OS(r.sort((i,o)=>i-o))}return e._cache.$bar}function Z9(e){const t=e.iScale,n=Q9(t,e.type);let r=t._length,i,o,s,a;const l=()=>{s===32767||s===-32768||(Gc(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 J9(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 e$(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 t$(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 hC(e,t,n,r){return Yt(e)?t$(e,t,n,r):t[n.axis]=n.parse(e,r),t}function pC(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(hC(g,f,o,c));return l}function Uv(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function n$(e,t,n){return e!==0?Ii(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function r$(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 i$(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}=r$(e);i==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?i=c:(n._bottom||0)===r?i=d:(o[gC(d,s,a,l)]=!0,i=c)),o[gC(i,s,a,l)]=!0,e.borderSkipped=o}function gC(e,t,n,r){return r?(e=o$(e,t,n),e=mC(e,n,t)):e=mC(e,t,n),e}function o$(e,t,n){return e===t?n:e===n?t:e}function mC(e,t,n){return e==="start"?t:e==="end"?n:e}function s$(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class Wf extends vi{parsePrimitiveData(t,n,r,i){return pC(t,n,r,i)}parseArrayData(t,n,r,i){return pC(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(Vo(y,c),g),f.push(hC(Vo(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=Uv(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],_={horizontal:c,base:y.base,enableBorderRadius:!w||Uv(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&&(_.options=f||this.resolveDataElementOptions(p,t[p].active?"active":i));const C=_.options||t[p].options;i$(_,C,w,s),s$(_,C,d.ratio),this.updateElement(t[p],p,_,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||Z9(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=Uv(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=n$(y,n,a)*s,f===a&&(w-=y/2);const _=n.getPixelForDecimal(0),C=n.getPixelForDecimal(1),O=Math.min(_,C),P=Math.max(_,C);w=Math.max(Math.min(w,P),O),v=w+y,r&&!d&&(l._stacks[n.axis]._visualValues[i]=n.getValueForPixel(v)-n.getValueForPixel(w))}if(w===n.getPixelForValue(a)){const _=Ii(y)*n.getLineWidthForValue(a)/2;w+=_,y-=_}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"?e$(t,n,i,c):J9(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(Wf,"id","bar"),ke(Wf,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),ke(Wf,"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 a$(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,O,P)=>Kc(C,a,l,!0)?1:Math.max(O,O*n,P,P*n),v=(C,O,P)=>Kc(C,a,l,!0)?-1:Math.min(O,O*n,P,P*n),y=p(0,c,f),x=p(dn,d,g),w=v(Kt,c,f),_=v(Kt+dn,d,g);r=(y-w)/2,i=(x-_)/2,o=-(y+w)/2,s=-(x+_)/2}return{ratioX:r,ratioY:i,offsetX:o,offsetY:s}}class Qs 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=>+Vo(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(wL(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:d,rotation:f}=this._getRotationExtents(),{ratioX:g,ratioY:p,offsetX:v,offsetY:y}=a$(f,d,l),x=(r.width-s)/g,w=(r.height-s)/p,_=Math.max(Math.min(x,w)/2,0),C=mS(this.options.radius,_),O=Math.max(C*l,0),P=(C-O)/this._getVisibleDatasetWeightTotal();this.offsetX=v*C,this.offsetY=y*C,i.total=this.calculateTotal(),this.outerRadius=C-P*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-P*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(),_;for(_=0;_<n;++_)w+=this._circumference(_,o);for(_=n;_<n+r;++_){const C=this._circumference(_,o),O=t[_],P={x:d+this.offsetX,y:f+this.offsetY,startAngle:w,endAngle:w+C,circumference:C,outerRadius:v,innerRadius:p};x&&(P.options=y||this.resolveDataElementOptions(_,O.active?"active":i)),w+=C,this.updateElement(O,_,P,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=Qc(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(Qs,"id","doughnut"),ke(Qs,"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(Qs,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),ke(Qs,"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 Uf 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}=DS(n,i,s);this._drawStart=a,this._drawCount=l,TS(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=ll(v)?v:Number.POSITIVE_INFINITY,w=this.chart._animationsDisabled||o||i==="none",_=n+r,C=t.length;let O=n>0&&this.getParsed(n-1);for(let P=0;P<C;++P){const k=t[P],A=w?k:{};if(P<n||P>=_){A.skip=!0;continue}const L=this.getParsed(P),F=gt(L[p]),B=A[g]=s.getPixelForValue(L[g],P),H=A[p]=o||F?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,L,l):L[p],P);A.skip=isNaN(B)||isNaN(H)||F,A.stop=P>0&&Math.abs(L[g]-O[g])>x,y&&(A.parsed=L,A.raw=c.data[P]),f&&(A.options=d||this.resolveDataElementOptions(P,k.active?"active":i)),w||this.updateElement(k,P,A,i),O=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(Uf,"id","line"),ke(Uf,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),ke(Uf,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class tu 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=Qc(n._parsed[t].r,r.options.locale);return{label:i[t]||"",value:o}}parseObjectData(t,n,r,i){return US.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,_=p+this._computeAngle(v,i,y),C=s.getDataVisibility(v)?c.getDistanceFromCenterForValue(this.getParsed(v).r):0;p=_,o&&(l.animateScale&&(C=0),l.animateRotate&&(w=_=g));const O={x:d,y:f,innerRadius:0,outerRadius:C,startAngle:w,endAngle:_,options:this.resolveDataElementOptions(v,x.active?"active":i)};this.updateElement(x,v,O,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(tu,"id","polarArea"),ke(tu,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),ke(tu,"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 Gv extends Qs{}ke(Gv,"id","pie"),ke(Gv,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Gf 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 US.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(Gf,"id","radar"),ke(Gf,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),ke(Gf,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class Yf 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}=DS(n,r,i);if(this._drawStart=o,this._drawCount=s,TS(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=ll(y)?y:Number.POSITIVE_INFINITY,_=this.chart._animationsDisabled||o||i==="none";let C=n>0&&this.getParsed(n-1);for(let O=n;O<n+r;++O){const P=t[O],k=this.getParsed(O),A=_?P:{},L=gt(k[v]),F=A[p]=s.getPixelForValue(k[p],O),B=A[v]=o||L?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,k,l):k[v],O);A.skip=isNaN(F)||isNaN(B)||L,A.stop=O>0&&Math.abs(k[p]-C[p])>w,x&&(A.parsed=k,A.raw=c.data[O]),g&&(A.options=f||this.resolveDataElementOptions(O,P.active?"active":i)),_||this.updateElement(P,O,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(Yf,"id","scatter"),ke(Yf,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),ke(Yf,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var l$=Object.freeze({__proto__:null,BarController:Wf,BubbleController:qf,DoughnutController:Qs,LineController:Uf,PieController:Gv,PolarAreaController:tu,RadarController:Gf,ScatterController:Yf});function Zs(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Yv{constructor(t){ke(this,"options");this.options=t||{}}static override(t){Object.assign(Yv.prototype,t)}init(){}formats(){return Zs()}parse(){return Zs()}format(){return Zs()}add(){return Zs()}diff(){return Zs()}startOf(){return Zs()}endOf(){return Zs()}}var c$={_date:Yv};function u$(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?IL: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 nu(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}=u$(o[a],t,s,i);for(let p=f;p<=g;++p){const v=d[p];v.skip||r(v,c,p)}}}function d$(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 Kv(e,t,n,r,i){const o=[];return!i&&!e.isPointInArea(t)||nu(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 f$(e,t,n,r){let i=[];function o(s,a,l){const{startAngle:c,endAngle:d}=s.getProps(["startAngle","endAngle"],r),{angle:f}=CS(s,{x:t.x,y:t.y});Kc(f,c,d)&&i.push({element:s,datasetIndex:a,index:l})}return nu(e,n,t,o),i}function h$(e,t,n,r,i,o){let s=[];const a=d$(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 nu(e,n,t,c),s}function Xv(e,t,n,r,i,o){return!o&&!e.isPointInArea(t)?[]:n==="r"&&!r?f$(e,t,n,i):h$(e,t,n,r,i,o)}function vC(e,t,n,r,i){const o=[],s=n==="x"?"inXRange":"inYRange";let a=!1;return nu(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 p$={evaluateInteractionItems:nu,modes:{index(e,t,n,r){const i=Ks(t,e),o=n.axis||"x",s=n.includeInvisible||!1,a=n.intersect?Kv(e,i,o,r,s):Xv(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=Ks(t,e),o=n.axis||"xy",s=n.includeInvisible||!1;let a=n.intersect?Kv(e,i,o,r,s):Xv(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=Ks(t,e),o=n.axis||"xy",s=n.includeInvisible||!1;return Kv(e,i,o,r,s)},nearest(e,t,n,r){const i=Ks(t,e),o=n.axis||"xy",s=n.includeInvisible||!1;return Xv(e,i,o,n.intersect,r,s)},x(e,t,n,r){const i=Ks(t,e);return vC(e,i,"x",n.intersect,r)},y(e,t,n,r){const i=Ks(t,e);return vC(e,i,"y",n.intersect,r)}}};const bC=["left","top","right","bottom"];function ru(e,t){return e.filter(n=>n.pos===t)}function yC(e,t){return e.filter(n=>bC.indexOf(n.pos)===-1&&n.box.axis===t)}function iu(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 g$(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 m$(e){const t={};for(const n of e){const{stack:r,pos:i,stackWeight:o}=n;if(!r||!bC.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 v$(e,t){const n=m$(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 b$(e){const t=g$(e),n=iu(t.filter(c=>c.box.fullSize),!0),r=iu(ru(t,"left"),!0),i=iu(ru(t,"right")),o=iu(ru(t,"top"),!0),s=iu(ru(t,"bottom")),a=yC(t,"x"),l=yC(t,"y");return{fullSize:n,leftAndTop:r.concat(o),rightAndBottom:i.concat(l).concat(s).concat(a),chartArea:ru(t,"chartArea"),vertical:r.concat(i).concat(l),horizontal:o.concat(s).concat(a)}}function xC(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function wC(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 y$(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&&wC(s,o.getPadding());const a=Math.max(0,t.outerWidth-xC(s,e,"left","right")),l=Math.max(0,t.outerHeight-xC(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 x$(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 w$(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 ou(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,w$(a.horizontal,t));const{same:f,other:g}=y$(t,n,a,r);c|=f&&i.length,d=d||g,l.fullSize||i.push(a)}return c&&ou(i,t,n,r)||d}function Kf(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 _C(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;Gc(c.start)&&(s=c.start),l.fullSize?Kf(l,i.left,s,n.outerWidth-i.right-i.left,g):Kf(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;Gc(c.start)&&(o=c.start),l.fullSize?Kf(l,o,i.top,g,n.outerHeight-i.bottom-i.top):Kf(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=Nn(e.options.layout.padding),o=Math.max(t-i.width,0),s=Math.max(n-i.height,0),a=b$(e.boxes),l=a.vertical,c=a.horizontal;Rt(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);wC(g,Nn(r));const p=Object.assign({maxPadding:g,w:o,h:s,x:i.left,y:i.top},i),v=v$(l.concat(c),f);ou(a.fullSize,p,f,v),ou(l,p,f,v),ou(c,p,f,v)&&ou(l,p,f,v),x$(p),_C(a.leftAndTop,p,f,v),p.x+=p.w,p.y+=p.h,_C(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},Rt(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 SC{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 _$ extends SC{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Xf="$chartjs",S$={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},CC=e=>e===null||e==="";function C$(e,t){const n=e.style,r=e.getAttribute("height"),i=e.getAttribute("width");if(e[Xf]={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",CC(i)){const o=KS(e,"width");o!==void 0&&(e.width=o)}if(CC(r))if(e.style.height==="")e.height=e.width/(t||2);else{const o=KS(e,"height");o!==void 0&&(e.height=o)}return e}const EC=P9?{passive:!0}:!1;function E$(e,t,n){e.addEventListener(t,n,EC)}function P$(e,t,n){e.canvas.removeEventListener(t,n,EC)}function O$(e,t){const n=S$[e.type]||e.type,{x:r,y:i}=Ks(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:i!==void 0?i:null}}function Qf(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function k$(e,t,n){const r=e.canvas,i=new MutationObserver(o=>{let s=!1;for(const a of o)s=s||Qf(a.addedNodes,r),s=s&&!Qf(a.removedNodes,r);s&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function M$(e,t,n){const r=e.canvas,i=new MutationObserver(o=>{let s=!1;for(const a of o)s=s||Qf(a.removedNodes,r),s=s&&!Qf(a.addedNodes,r);s&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const su=new Map;let PC=0;function OC(){const e=window.devicePixelRatio;e!==PC&&(PC=e,su.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function D$(e,t){su.size||window.addEventListener("resize",OC),su.set(e,t)}function T$(e){su.delete(e),su.size||window.removeEventListener("resize",OC)}function A$(e,t,n){const r=e.canvas,i=r&&Vv(r);if(!i)return;const o=MS((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),D$(e,o),s}function Qv(e,t,n){n&&n.disconnect(),t==="resize"&&T$(e)}function I$(e,t,n){const r=e.canvas,i=MS(o=>{e.ctx!==null&&n(O$(o,e))},e);return E$(r,t,i),i}class R$ extends SC{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(C$(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[Xf])return!1;const r=n[Xf].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[Xf],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const i=t.$proxies||(t.$proxies={}),s={attach:k$,detach:M$,resize:A$}[n]||I$;i[n]=s(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),i=r[n];if(!i)return;({attach:Qv,detach:Qv,resize:Qv}[n]||P$)(t,n,i),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,i){return E9(t,n,r,i)}isAttached(t){const n=Vv(t);return!!(n&&n.isConnected)}}function N$(e){return!Hv()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?_$:R$}let uo=(Yp=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 ll(this.x)&&ll(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(Yp,"defaults",{}),ke(Yp,"defaultRoutes"),Yp);function L$(e,t){const n=e.options.ticks,r=$$(e),i=Math.min(n.maxTicksLimit||r,r),o=n.major.enabled?j$(t):[],s=o.length,a=o[0],l=o[s-1],c=[];if(s>i)return z$(t,c,o,s/i),c;const d=F$(o,t,i);if(s>0){let f,g;const p=s>1?Math.round((l-a)/(s-1)):null;for(Zf(t,c,d,gt(p)?0:a-p,a),f=0,g=s-1;f<g;f++)Zf(t,c,d,o[f],o[f+1]);return Zf(t,c,d,l,gt(p)?t.length:l+p),c}return Zf(t,c,d),c}function $$(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 F$(e,t,n){const r=B$(e),i=t.length/n;if(!r)return Math.max(i,1);const o=ML(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 j$(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function z$(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 Zf(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 B$(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 H$=e=>e==="left"?"right":e==="right"?"left":e,kC=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,MC=(e,t)=>Math.min(t||e,e);function DC(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 V$(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 W$(e,t){Rt(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 au(e){return e.drawTicks?e.tickLength:0}function TC(e,t){if(!e.display)return 0;const n=bn(e.font,t),r=Nn(e.padding);return(Yt(e.text)?e.text.length:1)*n.lineHeight+r.height}function q$(e,t){return Uo(e,{scale:t,type:"scale"})}function U$(e,t,n){return Uo(e,{tick:n,index:t,type:"tick"})}function G$(e,t,n){let r=Av(e);return(n&&t!=="right"||!n&&t==="right")&&(r=H$(r)),r}function Y$(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],_=n[w];v=d[w].getPixelForValue(_)+y-t}else n==="center"?v=(c.bottom+c.top)/2+y-t:v=kC(e,n,t);g=a-o}else{if(wt(n)){const w=Object.keys(n)[0],_=n[w];p=d[w].getPixelForValue(_)-x+t}else n==="center"?p=(c.left+c.right)/2-x+t:p=kC(e,n,t);v=qn(r,s,i),f=n==="left"?-dn:dn}return{titleX:p,titleY:v,maxWidth:g,rotation:f}}class Js 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=Pr(t,Number.POSITIVE_INFINITY),n=Pr(n,Number.NEGATIVE_INFINITY),r=Pr(r,Number.POSITIVE_INFINITY),i=Pr(i,Number.NEGATIVE_INFINITY),{min:Pr(t,r),max:Pr(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:Pr(n,Pr(r,n)),max:Pr(r,Pr(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(){jt(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=r9(this,o,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?DC(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),s.display&&(s.autoSkip||s.source==="auto")&&(this.ticks=L$(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(){jt(this.options.afterUpdate,[this])}beforeSetDimensions(){jt(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(){jt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),jt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){jt(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=jt(n.callback,[o.value,r,t],this)}afterTickToLabelConversion(){jt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){jt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=MC(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-au(t.grid)-n.padding-TC(t.title,this.chart.options.font),c=Math.sqrt(f*f+g*g),s=Mv(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(){jt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){jt(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=TC(i,n.options.font);if(a?(t.width=this.maxWidth,t.height=au(o)+l):(t.height=this.maxHeight,t.width=au(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(){jt(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=DC(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/MC(n,r));let c=0,d=0,f,g,p,v,y,x,w,_,C,O,P;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:[]},_=y.lineHeight,C=O=0,!gt(v)&&!Yt(v))C=$f(i,w.data,w.gc,C,v),O=_;else if(Yt(v))for(g=0,p=v.length;g<p;++g)P=v[g],!gt(P)&&!Yt(P)&&(C=$f(i,w.data,w.gc,C,P),O+=_);s.push(C),a.push(O),c=Math.max(C,c),d=Math.max(O,d)}W$(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 AL(this._alignToPixels?qs(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=U$(this.getContext(),t,r))}return this.$context||(this.$context=q$(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=au(o),p=[],v=a.setContext(this.getContext()),y=v.display?v.width:0,x=y/2,w=function(X){return qs(r,X,y)};let _,C,O,P,k,A,L,F,B,H,V,K;if(s==="top")_=w(this.bottom),A=this.bottom-g,F=_-x,H=w(t.top)+x,K=t.bottom;else if(s==="bottom")_=w(this.top),H=t.top,K=w(t.bottom)-x,A=_+x,F=this.top+g;else if(s==="left")_=w(this.right),k=this.right-g,L=_-x,B=w(t.left)+x,V=t.right;else if(s==="right")_=w(this.left),B=t.left,V=w(t.right)-x,k=_+x,L=this.left+g;else if(n==="x"){if(s==="center")_=w((t.top+t.bottom)/2+.5);else if(wt(s)){const X=Object.keys(s)[0],j=s[X];_=w(this.chart.scales[X].getPixelForValue(j))}H=t.top,K=t.bottom,A=_+x,F=A+g}else if(n==="y"){if(s==="center")_=w((t.left+t.right)/2);else if(wt(s)){const X=Object.keys(s)[0],j=s[X];_=w(this.chart.scales[X].getPixelForValue(j))}k=_-x,L=k-g,B=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 X=this.getContext(C),j=o.setContext(X),ne=a.setContext(X),se=j.lineWidth,D=j.color,q=ne.dash||[],re=ne.dashOffset,R=j.tickWidth,te=j.tickColor,ge=j.tickBorderDash||[],pe=j.tickBorderDashOffset;O=V$(this,C,l),O!==void 0&&(P=qs(r,O,se),c?k=L=B=V=P:A=F=H=K=P,p.push({tx1:k,ty1:A,tx2:L,ty2:F,x1:B,y1:H,x2:V,y2:K,width:se,color:D,borderDash:q,borderDashOffset:re,tickWidth:R,tickColor:te,tickBorderDash:ge,tickBorderDashOffset:pe}))}return this._ticksLength=f,this._borderValue=_,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=au(r.grid),p=g+d,v=f?-d:p,y=-mi(this.labelRotation),x=[];let w,_,C,O,P,k,A,L,F,B,H,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,P=$.x}else if(i==="right"){const $=this._getYAxisLabelAlignment(g);A=$.textAlign,P=$.x}else if(n==="x"){if(i==="center")k=(t.top+t.bottom)/2+p;else if(wt(i)){const $=Object.keys(i)[0],X=i[$];k=this.chart.scales[$].getPixelForValue(X)+p}A=this._getXAxisLabelAlignment()}else if(n==="y"){if(i==="center")P=(t.left+t.right)/2-p;else if(wt(i)){const $=Object.keys(i)[0],X=i[$];P=this.chart.scales[$].getPixelForValue(X)}A=this._getYAxisLabelAlignment(g).textAlign}n==="y"&&(l==="start"?K="top":l==="end"&&(K="bottom"));const Y=this._getLabelSizes();for(w=0,_=a.length;w<_;++w){C=a[w],O=C.label;const $=o.setContext(this.getContext(w));L=this.getPixelForTick(w)+o.labelOffset,F=this._resolveTickFontOptions(w),B=F.lineHeight,H=Yt(O)?O.length:1;const X=H/2,j=$.color,ne=$.textStrokeColor,se=$.textStrokeWidth;let D=A;s?(P=L,A==="inner"&&(w===_-1?D=this.options.reverse?"left":"right":w===0?D=this.options.reverse?"right":"left":D="center"),i==="top"?c==="near"||y!==0?V=-H*B+B/2:c==="center"?V=-Y.highest.height/2-X*B+B:V=-Y.highest.height+B/2:c==="near"||y!==0?V=B/2:c==="center"?V=Y.highest.height/2-X*B:V=Y.highest.height-H*B,f&&(V*=-1),y!==0&&!$.showLabelBackdrop&&(P+=B/2*Math.sin(y))):(k=L,V=(1-H)*B/2);let q;if($.showLabelBackdrop){const re=Nn($.backdropPadding),R=Y.heights[w],te=Y.widths[w];let ge=V-re.top,pe=0-re.left;switch(K){case"middle":ge-=R/2;break;case"bottom":ge-=R;break}switch(A){case"center":pe-=te/2;break;case"right":pe-=te;break;case"inner":w===_-1?pe-=te:w>0&&(pe-=te/2);break}q={left:pe,top:ge,width:te+re.width,height:R+re.height,color:$.backdropColor}}x.push({label:O,font:F,textOffset:V,options:{rotation:y,color:j,strokeColor:ne,strokeWidth:se,textAlign:D,textBaseline:K,translation:[P,k],backdrop:q}})}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=qs(t,this.left,s)-s/2,d=qs(t,this.right,a)+a/2,f=g=l):(f=qs(t,this.top,s)-s/2,g=qs(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&&Ff(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;Us(r,c,0,d,l,a)}i&&jf(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:i}}=this;if(!r.display)return;const o=bn(r.font),s=Nn(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}=Y$(this,l,n,a);Us(t,r.text,0,0,o,{color:r.color,maxWidth:f,rotation:g,textAlign:G$(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!==Js.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 Jf{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;Q$(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,K$(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 Ws[r])}}function K$(e,t,n){const r=Ai(Object.create(null),[n?on.get(n):{},on.get(t),e.defaults]);on.set(t,r),e.defaultRoutes&&X$(t,e.defaultRoutes),e.descriptors&&on.describe(t,e.descriptors)}function X$(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 Q$(e){return"id"in e&&"defaults"in e}class Z${constructor(){this.controllers=new Jf(vi,"datasets",!0),this.elements=new Jf(uo,"elements"),this.plugins=new Jf(Object,"plugins"),this.scales=new Jf(Js,"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):Rt(i,s=>{const a=r||this._getRegistryForType(s);this._exec(t,a,s)})})}_exec(t,n,r){const i=kv(t);jt(r["before"+i],[],r),n[t](r),jt(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 Ri=new Z$;class J${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(jt(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=eF(r);return i===!1&&!n?[]:nF(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 eF(e){const t={},n=[],r=Object.keys(Ri.plugins.items);for(let o=0;o<r.length;o++)n.push(Ri.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 tF(e,t){return!t&&e===!1?null:e===!0?{}:e}function nF(e,{plugins:t,localIds:n},r,i){const o=[],s=e.getContext();for(const a of t){const l=a.id,c=tF(r[l],i);c!==null&&o.push({plugin:a,options:rF(e.config,{plugin:a,local:n[l]},c,s)})}return o}function rF(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 Zv(e,t){const n=on.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function iF(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function oF(e,t){return e===t?"_index_":"_value_"}function AC(e){if(e==="x"||e==="y"||e==="r")return e}function sF(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function Jv(e,...t){if(AC(e))return e;for(const n of t){const r=n.axis||sF(n.position)||e.length>1&&AC(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function IC(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function aF(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 IC(e,"x",n[0])||IC(e,"y",n[0])}return{}}function lF(e,t){const n=Ws[e.type]||{scales:{}},r=t.scales||{},i=Zv(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=Jv(s,a,aF(s,e),on.scales[a.type]),c=oF(l,i),d=n.scales||{};o[s]=Uc(Object.create(null),[{axis:l},a,d[l],d[c]])}),e.data.datasets.forEach(s=>{const a=s.type||e.type,l=s.indexAxis||Zv(a,t),d=(Ws[a]||{}).scales||{};Object.keys(d).forEach(f=>{const g=iF(f,l),p=s[g+"AxisID"]||g;o[p]=o[p]||Object.create(null),Uc(o[p],[{axis:g},r[p],d[f]])})}),Object.keys(o).forEach(s=>{const a=o[s];Uc(a,[on.scales[a.type],on.scale])}),o}function RC(e){const t=e.options||(e.options={});t.plugins=tt(t.plugins,{}),t.scales=lF(e,t)}function NC(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function cF(e){return e=e||{},e.data=NC(e.data),RC(e),e}const LC=new Map,$C=new Set;function eh(e,t){let n=LC.get(e);return n||(n=t(),LC.set(e,n),$C.add(n)),n}const lu=(e,t,n)=>{const r=Vo(t,n);r!==void 0&&e.add(r)};class uF{constructor(t){this._config=cF(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=NC(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(),RC(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return eh(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return eh(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return eh(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return eh(`${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=>lu(l,t,f))),d.forEach(f=>lu(l,i,f)),d.forEach(f=>lu(l,Ws[o]||{},f)),d.forEach(f=>lu(l,on,f)),d.forEach(f=>lu(l,Nv,f))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),$C.has(n)&&s.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,Ws[n]||{},on.datasets[n]||{},{type:n},on,Nv]}resolveNamedOptions(t,n,r,i=[""]){const o={$shared:!0},{resolver:s,subPrefixes:a}=FC(this._resolverCache,t,i);let l=s;if(fF(s,n)){o.$shared=!1,r=Wo(r)?r():r;const c=this.createResolver(t,r,a);l=cl(s,r,c)}for(const c of n)o[c]=l[c];return o}createResolver(t,n,r=[""],i){const{resolver:o}=FC(this._resolverCache,t,r);return wt(n)?cl(o,n,void 0,i):o}}function FC(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:jv(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(i,o)),o}const dF=e=>wt(e)&&Object.getOwnPropertyNames(e).some(t=>Wo(e[t]));function fF(e,t){const{isScriptable:n,isIndexable:r}=zS(e);for(const i of t){const o=n(i),s=r(i),a=(s||o)&&e[i];if(o&&(Wo(a)||dF(a))||s&&Yt(a))return!0}return!1}var hF="4.4.1";const pF=["top","bottom","left","right","chartArea"];function jC(e,t){return e==="top"||e==="bottom"||pF.indexOf(e)===-1&&t==="x"}function zC(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function BC(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),jt(n&&n.onComplete,[e],t)}function gF(e){const t=e.chart,n=t.options.animation;jt(n&&n.onProgress,[e],t)}function HC(e){return Hv()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const th={},VC=e=>{const t=HC(e);return Object.values(th).filter(n=>n.canvas===t).pop()};function mF(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 vF(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}function nh(e,t,n){return e.options.clip?e[n]:t[n]}function bF(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:nh(n,t,"left"),right:nh(n,t,"right"),top:nh(r,t,"top"),bottom:nh(r,t,"bottom")}:t}class Xr{static register(...t){Ri.add(...t),WC()}static unregister(...t){Ri.remove(...t),WC()}constructor(t,n){const r=this.config=new uF(n),i=HC(t),o=VC(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||N$(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=xL(),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 J$,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=LL(f=>this.update(f),s.resizeDelay||0),this._dataChanges=[],th[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}co.listen(this,"complete",BC),co.listen(this,"progress",gF),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 Ri}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():YS(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return $S(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,YS(this,a,!0)&&(this.notifyPlugins("resize",{size:s}),jt(r.onResize,[this,s],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Rt(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=Jv(s,a),c=l==="r",d=l==="x";return{options:a,dposition:c?"chartArea":d?"bottom":"left",dtype:c?"radialLinear":d?"category":"linear"}}))),Rt(o,s=>{const a=s.options,l=a.id,c=Jv(l,a),d=tt(a.type,s.dtype);(a.position===void 0||jC(a.position,c)!==jC(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=Ri.getScale(d);f=new g({id:l,type:d,ctx:this.ctx,chart:this}),r[f.id]=f}f.init(a,t)}),Rt(i,(s,a)=>{s||delete r[a]}),Rt(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(zC("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||Zv(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=Ri.getController(a),{datasetElementType:c,dataElementType:d}=on.datasets[a];Object.assign(l,{dataElementType:Ri.getElement(d),datasetElementType:c&&Ri.getElement(c)}),s.controller=new l(this,r),t.push(s.controller)}}return this._updateMetasets(),t}_resetElements(){Rt(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||Rt(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(zC("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Rt(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);(!yS(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;mF(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(!yS(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=[],Rt(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(),BC({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=bF(t,this.chartArea),s={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(i&&Ff(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&&jf(n),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return lo(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,i){const o=p$.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);Gc(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(),$S(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete th[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)};Rt(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(){Rt(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Rt(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}});!Af(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=PL(t),c=vF(t,this._lastEvent,r,l);r&&(this._lastEvent=null,jt(o.onHover,[t,a,this],this),l&&jt(o.onClick,[t,a,this],this));const d=!Af(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(Xr,"defaults",on),ke(Xr,"instances",th),ke(Xr,"overrides",Ws),ke(Xr,"registry",Ri),ke(Xr,"version",hF),ke(Xr,"getChart",VC);function WC(){return Rt(Xr.instances,e=>e._plugins.invalidate())}function yF(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 xF(e){return Fv(e,["outerStart","outerEnd","innerStart","innerEnd"])}function wF(e,t,n,r){const i=xF(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 fl(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function rh(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,X=f>0?f-r:0,j=($+X)/2,ne=j!==0?v*j/(j+r):v;p=(v-ne)/2}const y=Math.max(.001,v*f-n/Kt)/f,x=(v-y)/2,w=l+x+p,_=i-x-p,{outerStart:C,outerEnd:O,innerStart:P,innerEnd:k}=wF(t,g,f,_-w),A=f-C,L=f-O,F=w+C/A,B=_-O/L,H=g+P,V=g+k,K=w+P/H,Y=_-k/V;if(e.beginPath(),o){const $=(F+B)/2;if(e.arc(s,a,f,F,$),e.arc(s,a,f,$,B),O>0){const se=fl(L,B,s,a);e.arc(se.x,se.y,O,B,_+dn)}const X=fl(V,_,s,a);if(e.lineTo(X.x,X.y),k>0){const se=fl(V,Y,s,a);e.arc(se.x,se.y,k,_+dn,Y+Math.PI)}const j=(_-k/g+(w+P/g))/2;if(e.arc(s,a,g,_-k/g,j,!0),e.arc(s,a,g,j,w+P/g,!0),P>0){const se=fl(H,K,s,a);e.arc(se.x,se.y,P,K+Math.PI,w-dn)}const ne=fl(A,w,s,a);if(e.lineTo(ne.x,ne.y),C>0){const se=fl(A,F,s,a);e.arc(se.x,se.y,C,w-dn,F)}}else{e.moveTo(s,a);const $=Math.cos(F)*f+s,X=Math.sin(F)*f+a;e.lineTo($,X);const j=Math.cos(B)*f+s,ne=Math.sin(B)*f+a;e.lineTo(j,ne)}e.closePath()}function _F(e,t,n,r,i){const{fullCircles:o,startAngle:s,circumference:a}=t;let l=t.endAngle;if(o){rh(e,t,n,r,l,i);for(let c=0;c<o;++c)e.fill();isNaN(a)||(l=s+(a%Xt||Xt))}return rh(e,t,n,r,l,i),e.fill(),l}function SF(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){rh(e,t,n,r,v,i);for(let y=0;y<o;++y)e.stroke();isNaN(a)||(v=s+(a%Xt||Xt))}p&&yF(e,t,v),o||(rh(e,t,n,r,v,i),e.stroke())}class hl 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}=CS(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||Kc(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,_F(n,this,d,s,a),SF(n,this,d,s,a),n.restore()}}ke(hl,"id","arc"),ke(hl,"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(hl,"defaultRoutes",{backgroundColor:"backgroundColor"}),ke(hl,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function qC(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 CF(e,t,n){e.lineTo(n.x,n.y)}function EF(e){return e.stepped?YL:e.tension||e.cubicInterpolationMode==="monotone"?KL:CF}function UC(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 PF(e,t,n,r){const{points:i,options:o}=t,{count:s,start:a,loop:l,ilen:c}=UC(i,n,r),d=EF(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 OF(e,t,n,r){const i=t.points,{count:o,start:s,ilen:a}=UC(i,n,r),{move:l=!0,reverse:c}=r||{};let d=0,f=0,g,p,v,y,x,w;const _=O=>(s+(c?a-O:O))%o,C=()=>{y!==x&&(e.lineTo(d,x),e.lineTo(d,y),e.lineTo(d,w))};for(l&&(p=i[_(0)],e.moveTo(p.x,p.y)),g=0;g<=a;++g){if(p=i[_(g)],p.skip)continue;const O=p.x,P=p.y,k=O|0;k===v?(P<y?y=P:P>x&&(x=P),d=(f*d+O)/++f):(C(),e.lineTo(O,P),v=k,f=0,y=x=P),w=P}C()}function eb(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?OF:PF}function kF(e){return e.stepped?O9:e.tension||e.cubicInterpolationMode==="monotone"?k9:Xs}function MF(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),qC(e,t.options),e.stroke(i)}function DF(e,t,n,r){const{segments:i,options:o}=t,s=eb(t);for(const a of i)qC(e,o,a.style),e.beginPath(),s(e,t,a,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const TF=typeof Path2D=="function";function AF(e,t,n,r){TF&&!t.options.segment?MF(e,t,n,r):DF(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;y9(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=R9(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=tC(this,{property:n,start:i,end:i});if(!s.length)return;const a=[],l=kF(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 eb(this)(t,this,n,r)}path(t,n,r){const i=this.segments,o=eb(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(),AF(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 GC(e,t,n,r){const i=e.options,{[n]:o}=e.getProps([n],r);return Math.abs(t-o)<i.radius+i.hitRadius}class cu 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 GC(this,n,"x",r)}inYRange(n,r){return GC(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,$v(n,i,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}ke(cu,"id","point"),ke(cu,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),ke(cu,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function YC(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 IF(e,t,n){const r=e.options.borderWidth,i=e.borderSkipped,o=jS(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 RF(e,t,n){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),i=e.options.borderRadius,o=Gs(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 NF(e){const t=YC(e),n=t.right-t.left,r=t.bottom-t.top,i=IF(e,n/2,r/2),o=RF(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 tb(e,t,n,r){const i=t===null,o=n===null,a=e&&!(i&&o)&&YC(e,r);return a&&(i||so(t,a.left,a.right))&&(o||so(n,a.top,a.bottom))}function LF(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function $F(e,t){e.rect(t.x,t.y,t.w,t.h)}function nb(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 uu 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}=NF(this),a=LF(s.radius)?Jc:$F;t.save(),(s.w!==o.w||s.h!==o.h)&&(t.beginPath(),a(t,nb(s,n,o)),t.clip(),a(t,nb(o,-n,s)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),a(t,nb(o,n)),t.fillStyle=i,t.fill(),t.restore()}inRange(t,n,r){return tb(this,t,n,r)}inXRange(t,n){return tb(this,t,null,n)}inYRange(t,n){return tb(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(uu,"id","bar"),ke(uu,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),ke(uu,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var FF=Object.freeze({__proto__:null,ArcElement:hl,BarElement:uu,LineElement:Go,PointElement:cu});const rb=["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)"],KC=rb.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function XC(e){return rb[e%rb.length]}function QC(e){return KC[e%KC.length]}function jF(e,t){return e.borderColor=XC(t),e.backgroundColor=QC(t),++t}function zF(e,t){return e.backgroundColor=e.data.map(()=>XC(t++)),t}function BF(e,t){return e.backgroundColor=e.data.map(()=>QC(t++)),t}function HF(e){let t=0;return(n,r)=>{const i=e.getDatasetMeta(r).controller;i instanceof Qs?t=zF(n,t):i instanceof tu?t=BF(n,t):i&&(t=jF(n,t))}}function ZC(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function VF(e){return e&&(e.borderColor||e.backgroundColor)}var WF={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&&(ZC(r)||VF(i)||o&&ZC(o)))return;const s=HF(e);r.forEach(s)}};function qF(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,_;const C=Math.floor((f+1)*a)+1+t,O=Math.min(Math.floor((f+2)*a)+1,n)+t,P=O-C;for(_=C;_<O;_++)x+=e[_].x,w+=e[_].y;x/=P,w/=P;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,_=k;_<A;_++)v=.5*Math.abs((L-x)*(e[_].y-F)-(L-e[_].x)*(w-F)),v>p&&(p=v,g=e[_],y=_);s[l++]=g,d=y}return s[l++]=e[c],s}function UF(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,_=e[t].x,O=e[w].x-_;for(s=t;s<t+n;++s){a=e[s],l=(a.x-_)/O*r,c=a.y;const P=l|0;if(P===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=P,o=0,v=y=c,f=g=p=s}}return x}function JC(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 eE(e){e.data.datasets.forEach(t=>{JC(t)})}function GF(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 YF={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){eE(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}=GF(l,c);const p=n.threshold||4*r;if(g<=p){JC(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=qF(c,f,g,r,n);break;case"min-max":v=UF(c,f,g,r);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}i._decimated=v})},destroy(e){eE(e)}};function KF(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=ob(l,c,i);const d=ib(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=tC(t,d);for(const g of f){const p=ib(n,o[g.start],o[g.end],g.loop),v=eC(a,i,p);for(const y of v)s.push({source:y,target:g,start:{[n]:tE(d,p,"start",Math.max)},end:{[n]:tE(d,p,"end",Math.min)}})}}return s}function ib(e,t,n,r){if(r)return;let i=t[e],o=n[e];return e==="angle"&&(i=Or(i),o=Or(o)),{property:e,start:i,end:o}}function XF(e,t){const{x:n=null,y:r=null}=e||{},i=t.points,o=[];return t.segments.forEach(({start:s,end:a})=>{a=ob(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 ob(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function tE(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function nE(e,t){let n=[],r=!1;return Yt(e)?(r=!0,n=e):n=XF(e,t),n.length?new Go({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function rE(e){return e&&e.fill!==!1}function QF(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 ZF(e,t,n){const r=n8(e);if(wt(r))return isNaN(r.value)?!1:r;let i=parseFloat(r);return cn(i)&&Math.floor(i)===i?JF(r[0],t,i,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function JF(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function e8(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 t8(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 n8(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 r8(e){const{scale:t,index:n,line:r}=e,i=[],o=r.segments,s=r.points,a=i8(t,n);a.push(nE({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++)o8(i,s[d],a)}return new Go({points:i,options:{}})}function i8(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 o8(e,t,n){const r=[];for(let i=0;i<n.length;i++){const o=n[i],{first:s,last:a,point:l}=s8(o,t,"x");if(!(!l||s&&a)){if(s)r.unshift(l);else if(e.push(l),!a)break}}e.push(...r)}function s8(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 iE{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 a8(e){const{chart:t,fill:n,line:r}=e;if(cn(n))return l8(t,n);if(n==="stack")return r8(e);if(n==="shape")return!0;const i=c8(e);return i instanceof iE?i:nE(i,r)}function l8(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function c8(e){return(e.scale||{}).getPointPositionForValue?d8(e):u8(e)}function u8(e){const{scale:t={},fill:n}=e,r=e8(n,t);if(cn(r)){const i=t.isHorizontal();return{x:i?r:null,y:i?null:r}}return null}function d8(e){const{scale:t,fill:n}=e,r=t.options,i=t.getLabels().length,o=r.reverse?t.max:t.min,s=t8(n,t,o),a=[];if(r.grid.circular){const l=t.getPointPositionForValue(0,o);return new iE({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 sb(e,t,n){const r=a8(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&&(Ff(e,n),f8(e,{line:i,target:r,above:d,below:f,area:n,scale:o,axis:s}),jf(e))}function f8(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&&(oE(e,r,s.top),sE(e,{line:n,target:r,color:i,scale:a,property:l}),e.restore(),e.save(),oE(e,r,s.bottom)),sE(e,{line:n,target:r,color:o,scale:a,property:l}),e.restore()}function oE(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[ob(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 sE(e,t){const{line:n,target:r,property:i,color:o,scale:s}=t,a=KF(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,h8(e,s,p&&ib(i,d,f)),e.beginPath();const v=!!n.pathSegment(e,l);let y;if(p){v?e.closePath():aE(e,r,f,i);const x=!!r.pathSegment(e,c,{move:v,reverse:!0});y=v&&x,y||aE(e,r,d,i)}e.closePath(),e.fill(y?"evenodd":"nonzero"),e.restore()}}function h8(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 aE(e,t,n,r){const i=t.interpolate(n,r);i&&e.lineTo(i.x,i.y)}var p8={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:ZF(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=QF(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&&sb(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;rE(o)&&sb(e.ctx,o,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!rE(r)||n.drawTime!=="beforeDatasetDraw"||sb(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const lE=(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)}},g8=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class cE 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=jt(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}=lE(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:_,itemHeight:C}=m8(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:_,height:C},g=Math.max(g,_),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=dl(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;Ff(t,this),this._draw(),jf(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:i}=this,{align:o,labels:s}=t,a=on.color,l=dl(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}=lE(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 B={radius:y*Math.SQRT2/2,pointStyle:L.pointStyle,rotation:L.rotation,borderWidth:F},H=l.xPlus(k,v/2),V=A+g;FS(i,B,H,V,s.pointStyleWidth&&v)}else{const B=A+Math.max((f-y)/2,0),H=l.leftForLtr(k,v),V=Gs(L.borderRadius);i.beginPath(),Object.values(V).some(K=>K!==0)?Jc(i,{x:H,y:B,w:v,h:y,radius:V}):i.rect(H,B,v,y),i.fill(),F!==0&&i.stroke()}i.restore()},_=function(k,A,L){Us(i,L.text,k,A+x/2,c,{strikethrough:L.hidden,textAlign:l.textAlign(L.textAlign)})},C=this.isHorizontal(),O=this._computeTitleHeight();C?p={x:qn(o,this.left+d,this.right-r[0]),y:this.top+d+O,line:0}:p={x:this.left+d,y:qn(o,this.top+O+d,this.bottom-n[0].height),line:0},XS(this.ctx,t.textDirection);const P=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)),B=v+g+L;let H=p.x,V=p.y;l.setWidth(this.width),C?A>0&&H+B+d>this.right&&(V=p.y+=P,p.line++,H=p.x=qn(o,this.left+d,this.right-r[p.line])):A>0&&V+P>this.bottom&&(H=p.x=H+n[p.line].width+d,p.line++,V=p.y=qn(o,this.top+O+d,this.bottom-n[p.line].height));const K=l.x(H);if(w(K,V,k),H=$L(F,H+v+g,C?H+B:this.right,t.rtl),_(l.x(H),V,k),C)p.x+=B+d;else if(typeof k.text!="string"){const Y=c.lineHeight;p.y+=uE(k,Y)+d}else p.y+=P}),QS(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=bn(n.font),i=Nn(n.padding);if(!n.display)return;const o=dl(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(Av(a)),s.textBaseline="middle",s.strokeStyle=n.color,s.fillStyle=n.color,s.font=r.string,Us(s,n.text,p,d,r)}_computeTitleHeight(){const t=this.options.title,n=bn(t.font),r=Nn(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(!y8(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const i=this._hoveredItem,o=g8(i,r);i&&!o&&jt(n.onLeave,[t,i,this],this),this._hoveredItem=r,r&&!o&&jt(n.onHover,[t,r,this],this)}else r&&jt(n.onClick,[t,r,this],this)}}function m8(e,t,n,r,i){const o=v8(r,e,t,n),s=b8(i,r,t.lineHeight);return{itemWidth:o,itemHeight:s}}function v8(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 b8(e,t,n){let r=e;return typeof t.text!="string"&&(r=uE(t,n)),r}function uE(e,t){const n=e.text?e.text.length:0;return t*n}function y8(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var x8={id:"legend",_element:cE,start(e,t,n){const r=e.legend=new cE({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=Nn(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 ab 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=Nn(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);Us(t,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:c,textAlign:Av(n.align),textBaseline:"middle",translation:[s,a]})}}function w8(e,t){const n=new ab({ctx:e.ctx,options:t,chart:e});Un.configure(e,n,t),Un.addBox(e,n),e.titleBlock=n}var _8={id:"title",_element:ab,start(e,t,n){w8(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 ih=new WeakMap;var S8={id:"subtitle",start(e,t,n){const r=new ab({ctx:e.ctx,options:n,chart:e});Un.configure(e,r,n),Un.addBox(e,r),ih.set(e,r)},stop(e){Un.removeBox(e,ih.get(e)),ih.delete(e)},beforeUpdate(e,t,n){const r=ih.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 du={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=Dv(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 Ni(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
|
+
`)>-1?e.split(`
|
|
123
|
+
`):e}function C8(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 dE(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=Nn(t.padding);let y=v.height,x=0,w=r.reduce((O,P)=>O+P.before.length+P.lines.length+P.after.length,0);if(w+=e.beforeBody.length+e.afterBody.length,f&&(y+=f*c.lineHeight+(f-1)*t.titleSpacing+t.titleMarginBottom),w){const O=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;y+=p*O+(w-p)*l.lineHeight+(w-1)*t.bodySpacing}g&&(y+=t.footerMarginTop+g*d.lineHeight+(g-1)*t.footerSpacing);let _=0;const C=function(O){x=Math.max(x,n.measureText(O).width+_)};return n.save(),n.font=c.string,Rt(e.title,C),n.font=l.string,Rt(e.beforeBody.concat(e.afterBody),C),_=t.displayColors?s+2+t.boxPadding:0,Rt(r,O=>{Rt(O.before,C),Rt(O.lines,C),Rt(O.after,C)}),_=0,n.font=d.string,Rt(e.footer,C),n.restore(),x+=v.width,{width:x,height:y}}function E8(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function P8(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 O8(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"),P8(c,e,t,n)&&(c="center"),c}function fE(e,t,n){const r=n.yAlign||t.yAlign||E8(e,n);return{xAlign:n.xAlign||t.xAlign||O8(e,t,n,r),yAlign:r}}function k8(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function M8(e,t,n){let{y:r,height:i}=e;return t==="top"?r+=n:t==="bottom"?r-=i+n:r-=i/2,r}function hE(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}=Gs(s);let v=k8(t,a);const y=M8(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 oh(e,t,n){const r=Nn(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function pE(e){return Ni([],fo(e))}function D8(e,t,n){return Uo(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function gE(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const mE={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"?mE[t].call(n,r):i}let vE=(vx=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 oC(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=D8(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=Ni(a,fo(i)),a=Ni(a,fo(o)),a=Ni(a,fo(s)),a}getBeforeBody(t,n){return pE(lr(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,i=[];return Rt(t,o=>{const s={before:[],lines:[],after:[]},a=gE(r,o);Ni(s.before,fo(lr(a,"beforeLabel",this,o))),Ni(s.lines,lr(a,"label",this,o)),Ni(s.after,fo(lr(a,"afterLabel",this,o))),i.push(s)}),i}getAfterBody(t,n){return pE(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=Ni(a,fo(i)),a=Ni(a,fo(o)),a=Ni(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(C8(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))),Rt(a,d=>{const f=gE(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=du[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=dE(this,r),c=Object.assign({},a,l),d=fE(this.chart,r,c),f=hE(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}=Gs(a),{x:g,y:p}=t,{width:v,height:y}=n;let x,w,_,C,O,P;return o==="center"?(O=p+y/2,i==="left"?(x=g,w=x-s,C=O+s,P=O-s):(x=g+v,w=x+s,C=O-s,P=O+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,O=C-s,x=w-s,_=w+s):(C=p+y,O=C+s,x=w+s,_=w-s),P=C),{x1:x,x2:w,x3:_,y1:C,y2:O,y3:P}}drawTitle(t,n,r){const i=this.title,o=i.length;let s,a,l;if(o){const c=dl(r.rtl,this.x,this.width);for(t.x=oh(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=oh(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,$v(t,y,x,w),t.strokeStyle=s.borderColor,t.fillStyle=s.backgroundColor,$v(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=Gs(s.borderRadius);Object.values(w).some(_=>_!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,Jc(t,{x:y,y:v,w:c,h:l,radius:w}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),Jc(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=dl(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,_,C,O,P,k,A;for(n.textAlign=s,n.textBaseline="middle",n.font=f.string,t.x=oh(this,x,r),n.fillStyle=r.bodyColor,Rt(this.beforeBody,y),p=a&&x!=="right"?s==="center"?c/2+d:c+2+d:0,O=0,k=i.length;O<k;++O){for(w=i[O],_=this.labelTextColors[O],n.fillStyle=_,Rt(w.before,y),C=w.lines,a&&C.length&&(this._drawColorBox(n,t,O,v,r),g=Math.max(f.lineHeight,l)),P=0,A=C.length;P<A;++P)y(C[P]),g=f.lineHeight;Rt(w.after,y)}p=0,g=f.lineHeight,Rt(this.afterBody,y),t.y-=o}drawFooter(t,n,r){const i=this.footer,o=i.length;let s,a;if(o){const l=dl(r.rtl,this.x,this.width);for(t.x=oh(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}=Gs(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=du[t.position].call(this,this._active,this._eventPosition);if(!s)return;const a=this._size=dE(this,t),l=Object.assign({},s,this._size),c=fE(n,t,l),d=hE(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=Nn(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),XS(t,n.textDirection),o.y+=s.top,this.drawTitle(o,t,n),this.drawBody(o,t,n),this.drawFooter(o,t,n),QS(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=!Af(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||!Af(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=du[o.position].call(this,t,n);return s!==!1&&(r!==s.x||i!==s.y)}},ke(vx,"positioners",du),vx);var T8={id:"tooltip",_element:vE,positioners:du,afterInit(e,t,n){n&&(e.tooltip=new vE({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:mE},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"]},A8=Object.freeze({__proto__:null,Colors:WF,Decimation:YF,Filler:p8,Legend:x8,SubTitle:S8,Title:_8,Tooltip:T8});const I8=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function R8(e,t,n,r){const i=e.indexOf(t);if(i===-1)return I8(e,t,n,r);const o=e.lastIndexOf(t);return i!==o?n:i}const N8=(e,t)=>e===null?null:kn(Math.round(e),0,t);function bE(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class lb extends Js{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:R8(r,t,tt(n,t),this._addedLabels),N8(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 bE.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(lb,"id","category"),ke(lb,"defaults",{ticks:{callback:bE}});function L8(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),_=!gt(a),C=!gt(c),O=(x-y)/(f+1);let P=wS((x-y)/v/p)*p,k,A,L,F;if(P<1e-14&&!w&&!_)return[{value:y},{value:x}];F=Math.ceil(x/P)-Math.floor(y/P),F>v&&(P=wS(F*P/v/p)*p),gt(l)||(k=Math.pow(10,l),P=Math.ceil(P*k)/k),i==="ticks"?(A=Math.floor(y/P)*P,L=Math.ceil(x/P)*P):(A=y,L=x),w&&_&&o&&DL((a-s)/o,P/1e3)?(F=Math.round(Math.min((a-s)/P,d)),P=(a-s)/F,A=s,L=a):C?(A=w?s:A,L=_?a:L,F=c-1,P=(L-A)/F):(F=(L-A)/P,Yc(F,Math.round(F),P/1e3)?F=Math.round(F):F=Math.ceil(F));const B=Math.max(SS(P),SS(A));k=Math.pow(10,gt(l)?B:l),A=Math.round(A*k)/k,L=Math.round(L*k)/k;let H=0;for(w&&(g&&A!==s?(n.push({value:s}),A<s&&H++,Yc(Math.round((A+H*P)*k)/k,s,yE(s,O,e))&&H++):A<s&&H++);H<F;++H){const V=Math.round((A+H*P)*k)/k;if(_&&V>a)break;n.push({value:V})}return _&&g&&L!==a?n.length&&Yc(n[n.length-1].value,a,yE(a,O,e))?n[n.length-1].value=a:n.push({value:a}):(!_||L===a)&&n.push({value:L}),n}function yE(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 sh extends Js{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=L8(i,o);return t.bounds==="ticks"&&_S(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 Qc(t,this.chart.options.locale,this.options.ticks.format)}}class cb extends sh{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(cb,"id","linear"),ke(cb,"defaults",{ticks:{callback:Lf.formatters.numeric}});const fu=e=>Math.floor(qo(e)),ea=(e,t)=>Math.pow(10,fu(e)+t);function xE(e){return e/Math.pow(10,fu(e))===1}function wE(e,t,n){const r=Math.pow(10,n),i=Math.floor(e/r);return Math.ceil(t/r)-i}function $8(e,t){const n=t-e;let r=fu(n);for(;wE(e,t,r)>10;)r++;for(;wE(e,t,r)<10;)r--;return Math.min(r,fu(e))}function F8(e,{min:t,max:n}){t=Pr(e.min,t);const r=[],i=fu(t);let o=$8(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=Pr(e.min,Math.round((l+d+f*Math.pow(10,o))*s)/s);for(;g<n;)r.push({value:g,major:xE(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=Pr(e.max,g);return r.push({value:p,major:xE(p),significand:f}),r}class ub extends Js{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const r=sh.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===ea(this.min,0)?ea(this.min,-1):ea(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(ea(r,-1)),s(ea(i,1)))),r<=0&&o(ea(i,-1)),i<=0&&s(ea(r,1)),this.min=r,this.max=i}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},r=F8(n,this);return t.bounds==="ticks"&&_S(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":Qc(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(ub,"id","logarithmic"),ke(ub,"defaults",{ticks:{callback:Lf.formatters.logarithmic,major:{enabled:!0}}});function db(e){const t=e.ticks;if(t.display&&e.display){const n=Nn(t.backdropPadding);return tt(t.font&&t.font.size,on.font.size)+n.height}return 0}function j8(e,t,n){return n=Yt(n)?n:[n],{w:GL(e,t.string,n),h:n.length*t.lineHeight}}function _E(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 z8(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=j8(e.ctx,f,e._pointLabels[l]);r[l]=g;const p=Or(e.getIndexAngle(l)+a),v=Math.round(Mv(p)),y=_E(v,d.x,g.w,0,180),x=_E(v,d.y,g.h,90,270);B8(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=W8(e,r,i)}function B8(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 H8(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(Mv(Or(l.angle+dn))),d=G8(l.y,a.h,c),f=q8(c),g=U8(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 V8(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 W8(e,t,n){const r=[],i=e._pointLabels.length,o=e.options,{centerPointLabels:s,display:a}=o.pointLabels,l={extra:db(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=H8(e,d,l);r.push(f),a==="auto"&&(f.visible=V8(f,c),f.visible&&(c=f))}return r}function q8(e){return e===0||e===180?"center":e<180?"left":"right"}function U8(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function G8(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function Y8(e,t,n){const{left:r,top:i,right:o,bottom:s}=n,{backdropColor:a}=t;if(!gt(a)){const l=Gs(t.borderRadius),c=Nn(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(),Jc(e,{x:d,y:f,w:g,h:p,radius:l}),e.fill()):e.fillRect(d,f,g,p)}}function K8(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));Y8(n,s,o);const a=bn(s.font),{x:l,y:c,textAlign:d}=o;Us(n,e._pointLabels[i],l,c+a.lineHeight/2,a,{color:s.color,textAlign:d,textBaseline:"middle"})}}function SE(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 X8(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(),SE(e,n,s,r),o.closePath(),o.stroke(),o.restore())}function Q8(e,t,n){return Uo(e,{label:n,index:t,type:"pointLabel"})}class hu extends sh{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=Nn(db(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/db(this.options))}generateTickLabels(t){sh.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,r)=>{const i=jt(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?z8(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 Or(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 Q8(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(),SE(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&&K8(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);X8(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=Nn(c.backdropPadding);t.fillRect(-s/2-f.left,-o-d.size/2-f.top,s+f.width,d.size+f.height)}Us(t,a.label,0,-o,d,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}ke(hu,"id","radialLinear"),ke(hu,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Lf.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),ke(hu,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),ke(hu,"descriptors",{angleLines:{_fallback:"grid"}});const ah={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(ah);function CE(e,t){return e-t}function EE(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"&&(ll(o)||o===!0)?n.startOf(s,"isoWeek",o):n.startOf(s,i)),+s)}function PE(e,t,n,r){const i=cr.length;for(let o=cr.indexOf(e);o<i-1;++o){const s=ah[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 Z8(e,t,n,r,i){for(let o=cr.length-1;o>=cr.indexOf(n);o--){const s=cr[o];if(ah[s].common&&e._adapter.diff(i,r,s)>=t-1)return s}return cr[n?cr.indexOf(n):0]}function J8(e){for(let t=cr.indexOf(e)+1,n=cr.length;t<n;++t)if(ah[cr[t]].common)return cr[t]}function OE(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:i}=Tv(n,t),o=n[r]>=t?n[r]:n[i];e[o]=!0}}function ej(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 kE(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:ej(e,r,i,n)}class pu extends Js{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 c$._date(t.adapters.date);i.init(n),Uc(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:EE(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=RL(i,o,s);return this._unit=n.unit||(r.autoSkip?PE(n.minUnit,this.min,this.max,this._getLabelCapacity(o)):Z8(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:J8(this._unit),this.initOffsets(i),t.reverse&&a.reverse(),kE(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||PE(o.minUnit,n,r,this._getLabelCapacity(n)),a=tt(i.ticks.stepSize,1),l=s==="week"?o.isoWeekday:!1,c=ll(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++)OE(d,g,v);return(g===r||i.bounds==="ticks"||p===1)&&OE(d,g,v),Object.keys(d).sort(CE).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 jt(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,kE(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(EE(this,i[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return OS(t.sort(CE))}}ke(pu,"id","time"),ke(pu,"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 lh(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 fb extends pu{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=lh(n,this.min),this._tableRange=lh(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(lh(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return lh(this._table,r*this._tableRange+this._minPos,!0)}}ke(fb,"id","timeseries"),ke(fb,"defaults",pu.defaults);var tj=Object.freeze({__proto__:null,CategoryScale:lb,LinearScale:cb,LogarithmicScale:ub,RadialLinearScale:hu,TimeScale:pu,TimeSeriesScale:fb});const nj=[l$,FF,A8,tj];/*!
|
|
124
|
+
* chartjs-plugin-datalabels v2.2.0
|
|
125
|
+
* https://chartjs-plugin-datalabels.netlify.app
|
|
126
|
+
* (c) 2017-2022 chartjs-plugin-datalabels contributors
|
|
127
|
+
* Released under the MIT license
|
|
128
|
+
*/var ME=function(){if(typeof window<"u"){if(window.devicePixelRatio)return window.devicePixelRatio;var e=window.screen;if(e)return(e.deviceXDPI||1)/(e.logicalXDPI||1)}return 1}(),gu={toTextLines:function(e){var t=[],n;for(e=[].concat(e);e.length;)n=e.pop(),typeof n=="string"?t.unshift.apply(t,n.split(`
|
|
129
|
+
`)):Array.isArray(n)?e.push.apply(e,n):gt(e)||t.unshift(""+n);return t},textSize:function(e,t,n){var r=[].concat(t),i=r.length,o=e.font,s=0,a;for(e.font=n.string,a=0;a<i;++a)s=Math.max(e.measureText(r[a]).width,s);return e.font=o,{height:i*n.lineHeight,width:s}},bound:function(e,t,n){return Math.max(e,Math.min(t,n))},arrayDiff:function(e,t){var n=e.slice(),r=[],i,o,s,a;for(i=0,s=t.length;i<s;++i)a=t[i],o=n.indexOf(a),o===-1?r.push([a,1]):n.splice(o,1);for(i=0,s=n.length;i<s;++i)r.push([n[i],-1]);return r},rasterize:function(e){return Math.round(e*ME)/ME}};function hb(e,t){var n=t.x,r=t.y;if(n===null)return{x:0,y:-1};if(r===null)return{x:1,y:0};var i=e.x-n,o=e.y-r,s=Math.sqrt(i*i+o*o);return{x:s?i/s:0,y:s?o/s:-1}}function rj(e,t,n,r,i){switch(i){case"center":n=r=0;break;case"bottom":n=0,r=1;break;case"right":n=1,r=0;break;case"left":n=-1,r=0;break;case"top":n=0,r=-1;break;case"start":n=-n,r=-r;break;case"end":break;default:i*=Math.PI/180,n=Math.cos(i),r=Math.sin(i);break}return{x:e,y:t,vx:n,vy:r}}var ij=0,DE=1,TE=2,AE=4,IE=8;function ch(e,t,n){var r=ij;return e<n.left?r|=DE:e>n.right&&(r|=TE),t<n.top?r|=IE:t>n.bottom&&(r|=AE),r}function oj(e,t){for(var n=e.x0,r=e.y0,i=e.x1,o=e.y1,s=ch(n,r,t),a=ch(i,o,t),l,c,d;!(!(s|a)||s&a);)l=s||a,l&IE?(c=n+(i-n)*(t.top-r)/(o-r),d=t.top):l&AE?(c=n+(i-n)*(t.bottom-r)/(o-r),d=t.bottom):l&TE?(d=r+(o-r)*(t.right-n)/(i-n),c=t.right):l&DE&&(d=r+(o-r)*(t.left-n)/(i-n),c=t.left),l===s?(n=c,r=d,s=ch(n,r,t)):(i=c,o=d,a=ch(i,o,t));return{x0:n,x1:i,y0:r,y1:o}}function uh(e,t){var n=t.anchor,r=e,i,o;return t.clamp&&(r=oj(r,t.area)),n==="start"?(i=r.x0,o=r.y0):n==="end"?(i=r.x1,o=r.y1):(i=(r.x0+r.x1)/2,o=(r.y0+r.y1)/2),rj(i,o,e.vx,e.vy,t.align)}var dh={arc:function(e,t){var n=(e.startAngle+e.endAngle)/2,r=Math.cos(n),i=Math.sin(n),o=e.innerRadius,s=e.outerRadius;return uh({x0:e.x+r*o,y0:e.y+i*o,x1:e.x+r*s,y1:e.y+i*s,vx:r,vy:i},t)},point:function(e,t){var n=hb(e,t.origin),r=n.x*e.options.radius,i=n.y*e.options.radius;return uh({x0:e.x-r,y0:e.y-i,x1:e.x+r,y1:e.y+i,vx:n.x,vy:n.y},t)},bar:function(e,t){var n=hb(e,t.origin),r=e.x,i=e.y,o=0,s=0;return e.horizontal?(r=Math.min(e.x,e.base),o=Math.abs(e.base-e.x)):(i=Math.min(e.y,e.base),s=Math.abs(e.base-e.y)),uh({x0:r,y0:i+s,x1:r+o,y1:i,vx:n.x,vy:n.y},t)},fallback:function(e,t){var n=hb(e,t.origin);return uh({x0:e.x,y0:e.y,x1:e.x+(e.width||0),y1:e.y+(e.height||0),vx:n.x,vy:n.y},t)}},ho=gu.rasterize;function sj(e){var t=e.borderWidth||0,n=e.padding,r=e.size.height,i=e.size.width,o=-i/2,s=-r/2;return{frame:{x:o-n.left-t,y:s-n.top-t,w:i+n.width+t*2,h:r+n.height+t*2},text:{x:o,y:s,w:i,h:r}}}function aj(e,t){var n=t.chart.getDatasetMeta(t.datasetIndex).vScale;if(!n)return null;if(n.xCenter!==void 0&&n.yCenter!==void 0)return{x:n.xCenter,y:n.yCenter};var r=n.getBasePixel();return e.horizontal?{x:r,y:null}:{x:null,y:r}}function lj(e){return e instanceof hl?dh.arc:e instanceof cu?dh.point:e instanceof uu?dh.bar:dh.fallback}function cj(e,t,n,r,i,o){var s=Math.PI/2;if(o){var a=Math.min(o,i/2,r/2),l=t+a,c=n+a,d=t+r-a,f=n+i-a;e.moveTo(t,c),l<d&&c<f?(e.arc(l,c,a,-Math.PI,-s),e.arc(d,c,a,-s,0),e.arc(d,f,a,0,s),e.arc(l,f,a,s,Math.PI)):l<d?(e.moveTo(l,n),e.arc(d,c,a,-s,s),e.arc(l,c,a,s,Math.PI+s)):c<f?(e.arc(l,c,a,-Math.PI,0),e.arc(l,f,a,0,Math.PI)):e.arc(l,c,a,-Math.PI,Math.PI),e.closePath(),e.moveTo(t,n)}else e.rect(t,n,r,i)}function uj(e,t,n){var r=n.backgroundColor,i=n.borderColor,o=n.borderWidth;!r&&(!i||!o)||(e.beginPath(),cj(e,ho(t.x)+o/2,ho(t.y)+o/2,ho(t.w)-o,ho(t.h)-o,n.borderRadius),e.closePath(),r&&(e.fillStyle=r,e.fill()),i&&o&&(e.strokeStyle=i,e.lineWidth=o,e.lineJoin="miter",e.stroke()))}function dj(e,t,n){var r=n.lineHeight,i=e.w,o=e.x,s=e.y+r/2;return t==="center"?o+=i/2:(t==="end"||t==="right")&&(o+=i),{h:r,w:i,x:o,y:s}}function fj(e,t,n){var r=e.shadowBlur,i=n.stroked,o=ho(n.x),s=ho(n.y),a=ho(n.w);i&&e.strokeText(t,o,s,a),n.filled&&(r&&i&&(e.shadowBlur=0),e.fillText(t,o,s,a),r&&i&&(e.shadowBlur=r))}function hj(e,t,n,r){var i=r.textAlign,o=r.color,s=!!o,a=r.font,l=t.length,c=r.textStrokeColor,d=r.textStrokeWidth,f=c&&d,g;if(!(!l||!s&&!f))for(n=dj(n,i,a),e.font=a.string,e.textAlign=i,e.textBaseline="middle",e.shadowBlur=r.textShadowBlur,e.shadowColor=r.textShadowColor,s&&(e.fillStyle=o),f&&(e.lineJoin="round",e.lineWidth=d,e.strokeStyle=c),g=0,l=t.length;g<l;++g)fj(e,t[g],{stroked:f,filled:s,w:n.w,x:n.x,y:n.y+n.h*g})}var RE=function(e,t,n,r){var i=this;i._config=e,i._index=r,i._model=null,i._rects=null,i._ctx=t,i._el=n};Ai(RE.prototype,{_modelize:function(e,t,n,r){var i=this,o=i._index,s=bn(Qt([n.font,{}],r,o)),a=Qt([n.color,on.color],r,o);return{align:Qt([n.align,"center"],r,o),anchor:Qt([n.anchor,"center"],r,o),area:r.chart.chartArea,backgroundColor:Qt([n.backgroundColor,null],r,o),borderColor:Qt([n.borderColor,null],r,o),borderRadius:Qt([n.borderRadius,0],r,o),borderWidth:Qt([n.borderWidth,0],r,o),clamp:Qt([n.clamp,!1],r,o),clip:Qt([n.clip,!1],r,o),color:a,display:e,font:s,lines:t,offset:Qt([n.offset,4],r,o),opacity:Qt([n.opacity,1],r,o),origin:aj(i._el,r),padding:Nn(Qt([n.padding,4],r,o)),positioner:lj(i._el),rotation:Qt([n.rotation,0],r,o)*(Math.PI/180),size:gu.textSize(i._ctx,t,s),textAlign:Qt([n.textAlign,"start"],r,o),textShadowBlur:Qt([n.textShadowBlur,0],r,o),textShadowColor:Qt([n.textShadowColor,a],r,o),textStrokeColor:Qt([n.textStrokeColor,a],r,o),textStrokeWidth:Qt([n.textStrokeWidth,0],r,o)}},update:function(e){var t=this,n=null,r=null,i=t._index,o=t._config,s,a,l,c=Qt([o.display,!0],e,i);c&&(s=e.dataset.data[i],a=tt(jt(o.formatter,[s,e]),s),l=gt(a)?[]:gu.toTextLines(a),l.length&&(n=t._modelize(c,l,o,e),r=sj(n))),t._model=n,t._rects=r},geometry:function(){return this._rects?this._rects.frame:{}},rotation:function(){return this._model?this._model.rotation:0},visible:function(){return this._model&&this._model.opacity},model:function(){return this._model},draw:function(e,t){var n=this,r=e.ctx,i=n._model,o=n._rects,s;this.visible()&&(r.save(),i.clip&&(s=i.area,r.beginPath(),r.rect(s.left,s.top,s.right-s.left,s.bottom-s.top),r.clip()),r.globalAlpha=gu.bound(0,i.opacity,1),r.translate(ho(t.x),ho(t.y)),r.rotate(i.rotation),uj(r,o.frame,i),hj(r,i.lines,o.text,i),r.restore())}});var pj=Number.MIN_SAFE_INTEGER||-9007199254740991,gj=Number.MAX_SAFE_INTEGER||9007199254740991;function mu(e,t,n){var r=Math.cos(n),i=Math.sin(n),o=t.x,s=t.y;return{x:o+r*(e.x-o)-i*(e.y-s),y:s+i*(e.x-o)+r*(e.y-s)}}function NE(e,t){var n=gj,r=pj,i=t.origin,o,s,a,l,c;for(o=0;o<e.length;++o)s=e[o],a=s.x-i.x,l=s.y-i.y,c=t.vx*a+t.vy*l,n=Math.min(n,c),r=Math.max(r,c);return{min:n,max:r}}function fh(e,t){var n=t.x-e.x,r=t.y-e.y,i=Math.sqrt(n*n+r*r);return{vx:(t.x-e.x)/i,vy:(t.y-e.y)/i,origin:e,ln:i}}var LE=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0}};Ai(LE.prototype,{center:function(){var e=this._rect;return{x:e.x+e.w/2,y:e.y+e.h/2}},update:function(e,t,n){this._rotation=n,this._rect={x:t.x+e.x,y:t.y+e.y,w:t.w,h:t.h}},contains:function(e){var t=this,n=1,r=t._rect;return e=mu(e,t.center(),-t._rotation),!(e.x<r.x-n||e.y<r.y-n||e.x>r.x+r.w+n*2||e.y>r.y+r.h+n*2)},intersects:function(e){var t=this._points(),n=e._points(),r=[fh(t[0],t[1]),fh(t[0],t[3])],i,o,s;for(this._rotation!==e._rotation&&r.push(fh(n[0],n[1]),fh(n[0],n[3])),i=0;i<r.length;++i)if(o=NE(t,r[i]),s=NE(n,r[i]),o.max<s.min||s.max<o.min)return!1;return!0},_points:function(){var e=this,t=e._rect,n=e._rotation,r=e.center();return[mu({x:t.x,y:t.y},r,n),mu({x:t.x+t.w,y:t.y},r,n),mu({x:t.x+t.w,y:t.y+t.h},r,n),mu({x:t.x,y:t.y+t.h},r,n)]}});function $E(e,t,n){var r=t.positioner(e,t),i=r.vx,o=r.vy;if(!i&&!o)return{x:r.x,y:r.y};var s=n.w,a=n.h,l=t.rotation,c=Math.abs(s/2*Math.cos(l))+Math.abs(a/2*Math.sin(l)),d=Math.abs(s/2*Math.sin(l))+Math.abs(a/2*Math.cos(l)),f=1/Math.max(Math.abs(i),Math.abs(o));return c*=i*f,d*=o*f,c+=t.offset*i,d+=t.offset*o,{x:r.x+c,y:r.y+d}}function mj(e,t){var n,r,i,o;for(n=e.length-1;n>=0;--n)for(i=e[n].$layout,r=n-1;r>=0&&i._visible;--r)o=e[r].$layout,o._visible&&i._box.intersects(o._box)&&t(i,o);return e}function vj(e){var t,n,r,i,o,s,a;for(t=0,n=e.length;t<n;++t)r=e[t],i=r.$layout,i._visible&&(a=new Proxy(r._el,{get:(l,c)=>l.getProps([c],!0)[c]}),o=r.geometry(),s=$E(a,r.model(),o),i._box.update(s,o,r.rotation()));return mj(e,function(l,c){var d=l._hidable,f=c._hidable;d&&f||f?c._visible=!1:d&&(l._visible=!1)})}var vu={prepare:function(e){var t=[],n,r,i,o,s;for(n=0,i=e.length;n<i;++n)for(r=0,o=e[n].length;r<o;++r)s=e[n][r],t.push(s),s.$layout={_box:new LE,_hidable:!1,_visible:!0,_set:n,_idx:s._index};return t.sort(function(a,l){var c=a.$layout,d=l.$layout;return c._idx===d._idx?d._set-c._set:d._idx-c._idx}),this.update(t),t},update:function(e){var t=!1,n,r,i,o,s;for(n=0,r=e.length;n<r;++n)i=e[n],o=i.model(),s=i.$layout,s._hidable=o&&o.display==="auto",s._visible=i.visible(),t|=s._hidable;t&&vj(e)},lookup:function(e,t){var n,r;for(n=e.length-1;n>=0;--n)if(r=e[n].$layout,r&&r._visible&&r._box.contains(t))return e[n];return null},draw:function(e,t){var n,r,i,o,s,a;for(n=0,r=t.length;n<r;++n)i=t[n],o=i.$layout,o._visible&&(s=i.geometry(),a=$E(i._el,i.model(),s),o._box.update(a,s,i.rotation()),i.draw(e,a))}},bj=function(e){if(gt(e))return null;var t=e,n,r,i;if(wt(e))if(!gt(e.label))t=e.label;else if(!gt(e.r))t=e.r;else for(t="",n=Object.keys(e),i=0,r=n.length;i<r;++i)t+=(i!==0?", ":"")+n[i]+": "+e[n[i]];return""+t},yj={align:"center",anchor:"center",backgroundColor:null,borderColor:null,borderRadius:0,borderWidth:0,clamp:!1,clip:!1,color:void 0,display:!0,font:{family:void 0,lineHeight:1.2,size:void 0,style:void 0,weight:null},formatter:bj,labels:void 0,listeners:{},offset:4,opacity:1,padding:{top:4,right:4,bottom:4,left:4},rotation:0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,textShadowBlur:0,textShadowColor:void 0},ur="$datalabels",FE="$default";function xj(e,t){var n=e.datalabels,r={},i=[],o,s;return n===!1?null:(n===!0&&(n={}),t=Ai({},[t,n]),o=t.labels||{},s=Object.keys(o),delete t.labels,s.length?s.forEach(function(a){o[a]&&i.push(Ai({},[t,o[a],{_key:a}]))}):i.push(t),r=i.reduce(function(a,l){return Rt(l.listeners||{},function(c,d){a[d]=a[d]||{},a[d][l._key||FE]=c}),delete l.listeners,a},{}),{labels:i,listeners:r})}function pb(e,t,n,r){if(t){var i=n.$context,o=n.$groups,s;t[o._set]&&(s=t[o._set][o._key],s&&jt(s,[i,r])===!0&&(e[ur]._dirty=!0,n.update(i)))}}function wj(e,t,n,r,i){var o,s;!n&&!r||(n?r?n!==r&&(s=o=!0):s=!0:o=!0,s&&pb(e,t.leave,n,i),o&&pb(e,t.enter,r,i))}function _j(e,t){var n=e[ur],r=n._listeners,i,o;if(!(!r.enter&&!r.leave)){if(t.type==="mousemove")o=vu.lookup(n._labels,t);else if(t.type!=="mouseout")return;i=n._hovered,n._hovered=o,wj(e,r,i,o,t)}}function Sj(e,t){var n=e[ur],r=n._listeners.click,i=r&&vu.lookup(n._labels,t);i&&pb(e,r,i,t)}var Cj={id:"datalabels",defaults:yj,beforeInit:function(e){e[ur]={_actives:[]}},beforeUpdate:function(e){var t=e[ur];t._listened=!1,t._listeners={},t._datasets=[],t._labels=[]},afterDatasetUpdate:function(e,t,n){var r=t.index,i=e[ur],o=i._datasets[r]=[],s=e.isDatasetVisible(r),a=e.data.datasets[r],l=xj(a,n),c=t.meta.data||[],d=e.ctx,f,g,p,v,y,x,w,_;for(d.save(),f=0,p=c.length;f<p;++f)if(w=c[f],w[ur]=[],s&&w&&e.getDataVisibility(f)&&!w.skip)for(g=0,v=l.labels.length;g<v;++g)y=l.labels[g],x=y._key,_=new RE(y,d,w,f),_.$groups={_set:r,_key:x||FE},_.$context={active:!1,chart:e,dataIndex:f,dataset:a,datasetIndex:r},_.update(_.$context),w[ur].push(_),o.push(_);d.restore(),Ai(i._listeners,l.listeners,{merger:function(C,O,P){O[C]=O[C]||{},O[C][t.index]=P[C],i._listened=!0}})},afterUpdate:function(e){e[ur]._labels=vu.prepare(e[ur]._datasets)},afterDatasetsDraw:function(e){vu.draw(e,e[ur]._labels)},beforeEvent:function(e,t){if(e[ur]._listened){var n=t.event;switch(n.type){case"mousemove":case"mouseout":_j(e,n);break;case"click":Sj(e,n);break}}},afterEvent:function(e){var t=e[ur],n=t._actives,r=t._actives=e.getActiveElements(),i=gu.arrayDiff(n,r),o,s,a,l,c,d,f;for(o=0,s=i.length;o<s;++o)if(c=i[o],c[1])for(f=c[0].element[ur]||[],a=0,l=f.length;a<l;++a)d=f[a],d.$context.active=c[1]===1,d.update(d.$context);(t._dirty||i.length)&&(vu.update(t._labels),e.render()),delete t._dirty}};Xr.register(...nj),Xr.register(Cj);function jE({cfg:e,onDatapointClick:t}){var a;const n=m.useRef(null),[r,i]=m.useState(),o=xe(l=>l.themeStyle);m.useEffect(()=>{var d,f,g,p;(f=(d=o==null?void 0:o.chart)==null?void 0:d.font)!=null&&f.family&&(Xr.defaults.font={...Xr.defaults.font,...(g=o==null?void 0:o.chart)==null?void 0:g.font}),e.options&&(e.options.responsive=!0,e.options.maintainAspectRatio=!1);const l=(p=n==null?void 0:n.current)==null?void 0:p.getContext("2d");if(!l)return;let c;try{c=new Xr(l,e),i(c)}catch(v){console.log("error creating chart",v)}return()=>{c&&c.destroy()}},[(a=o==null?void 0:o.chart)==null?void 0:a.font]);function s(l){var d,f;if(!r)return;const c=r==null?void 0:r.getElementsAtEventForMode(l,"nearest",{intersect:!0},!0);if(c&&c.length>0){const g=c[0].datasetIndex,p=c[0].index,v=(f=(d=c[0].element)==null?void 0:d.$context)==null?void 0:f.raw;t==null||t(r,g,p,v)}}return S.jsx("div",{onClick:s,className:" relative h-[99%] xbg-red-100",children:S.jsx("canvas",{ref:n})})}function Li(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}var Ej=["color"],zE=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Li(e,Ej);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),m.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Pj=["color"],Oj=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Li(e,Pj);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),m.createElement("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),kj=["color"],BE=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Li(e,kj);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),m.createElement("path",{d:"M5 2V1H10V2H5ZM4.75 0C4.33579 0 4 0.335786 4 0.75V1H3.5C2.67157 1 2 1.67157 2 2.5V12.5C2 13.3284 2.67157 14 3.5 14H7V13H3.5C3.22386 13 3 12.7761 3 12.5V2.5C3 2.22386 3.22386 2 3.5 2H4V2.25C4 2.66421 4.33579 3 4.75 3H10.25C10.6642 3 11 2.66421 11 2.25V2H11.5C11.7761 2 12 2.22386 12 2.5V7H13V2.5C13 1.67157 12.3284 1 11.5 1H11V0.75C11 0.335786 10.6642 0 10.25 0H4.75ZM9 8.5C9 8.77614 8.77614 9 8.5 9C8.22386 9 8 8.77614 8 8.5C8 8.22386 8.22386 8 8.5 8C8.77614 8 9 8.22386 9 8.5ZM10.5 9C10.7761 9 11 8.77614 11 8.5C11 8.22386 10.7761 8 10.5 8C10.2239 8 10 8.22386 10 8.5C10 8.77614 10.2239 9 10.5 9ZM13 8.5C13 8.77614 12.7761 9 12.5 9C12.2239 9 12 8.77614 12 8.5C12 8.22386 12.2239 8 12.5 8C12.7761 8 13 8.22386 13 8.5ZM14.5 9C14.7761 9 15 8.77614 15 8.5C15 8.22386 14.7761 8 14.5 8C14.2239 8 14 8.22386 14 8.5C14 8.77614 14.2239 9 14.5 9ZM15 10.5C15 10.7761 14.7761 11 14.5 11C14.2239 11 14 10.7761 14 10.5C14 10.2239 14.2239 10 14.5 10C14.7761 10 15 10.2239 15 10.5ZM14.5 13C14.7761 13 15 12.7761 15 12.5C15 12.2239 14.7761 12 14.5 12C14.2239 12 14 12.2239 14 12.5C14 12.7761 14.2239 13 14.5 13ZM14.5 15C14.7761 15 15 14.7761 15 14.5C15 14.2239 14.7761 14 14.5 14C14.2239 14 14 14.2239 14 14.5C14 14.7761 14.2239 15 14.5 15ZM8.5 11C8.77614 11 9 10.7761 9 10.5C9 10.2239 8.77614 10 8.5 10C8.22386 10 8 10.2239 8 10.5C8 10.7761 8.22386 11 8.5 11ZM9 12.5C9 12.7761 8.77614 13 8.5 13C8.22386 13 8 12.7761 8 12.5C8 12.2239 8.22386 12 8.5 12C8.77614 12 9 12.2239 9 12.5ZM8.5 15C8.77614 15 9 14.7761 9 14.5C9 14.2239 8.77614 14 8.5 14C8.22386 14 8 14.2239 8 14.5C8 14.7761 8.22386 15 8.5 15ZM11 14.5C11 14.7761 10.7761 15 10.5 15C10.2239 15 10 14.7761 10 14.5C10 14.2239 10.2239 14 10.5 14C10.7761 14 11 14.2239 11 14.5ZM12.5 15C12.7761 15 13 14.7761 13 14.5C13 14.2239 12.7761 14 12.5 14C12.2239 14 12 14.2239 12 14.5C12 14.7761 12.2239 15 12.5 15Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Mj=["color"],bu=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Li(e,Mj);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),m.createElement("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Dj=["color"],Tj=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Li(e,Dj);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),m.createElement("path",{d:"M3.625 7.5C3.625 8.12132 3.12132 8.625 2.5 8.625C1.87868 8.625 1.375 8.12132 1.375 7.5C1.375 6.87868 1.87868 6.375 2.5 6.375C3.12132 6.375 3.625 6.87868 3.625 7.5ZM8.625 7.5C8.625 8.12132 8.12132 8.625 7.5 8.625C6.87868 8.625 6.375 8.12132 6.375 7.5C6.375 6.87868 6.87868 6.375 7.5 6.375C8.12132 6.375 8.625 6.87868 8.625 7.5ZM12.5 8.625C13.1213 8.625 13.625 8.12132 13.625 7.5C13.625 6.87868 13.1213 6.375 12.5 6.375C11.8787 6.375 11.375 6.87868 11.375 7.5C11.375 8.12132 11.8787 8.625 12.5 8.625Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Aj=["color"],Ij=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Li(e,Aj);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),m.createElement("path",{d:"M14.7649 6.07596C14.9991 6.22231 15.0703 6.53079 14.9239 6.76495C14.4849 7.46743 13.9632 8.10645 13.3702 8.66305L14.5712 9.86406C14.7664 10.0593 14.7664 10.3759 14.5712 10.5712C14.3759 10.7664 14.0593 10.7664 13.8641 10.5712L12.6011 9.30817C11.805 9.90283 10.9089 10.3621 9.93375 10.651L10.383 12.3277C10.4544 12.5944 10.2961 12.8685 10.0294 12.94C9.76267 13.0115 9.4885 12.8532 9.41704 12.5865L8.95917 10.8775C8.48743 10.958 8.00036 10.9999 7.50001 10.9999C6.99965 10.9999 6.51257 10.958 6.04082 10.8775L5.58299 12.5864C5.51153 12.8532 5.23737 13.0115 4.97064 12.94C4.7039 12.8686 4.5456 12.5944 4.61706 12.3277L5.06625 10.651C4.09111 10.3621 3.19503 9.90282 2.3989 9.30815L1.1359 10.5712C0.940638 10.7664 0.624058 10.7664 0.428798 10.5712C0.233537 10.3759 0.233537 10.0593 0.428798 9.86405L1.62982 8.66303C1.03682 8.10643 0.515113 7.46742 0.0760677 6.76495C-0.0702867 6.53079 0.000898544 6.22231 0.235065 6.07596C0.469231 5.9296 0.777703 6.00079 0.924058 6.23496C1.40354 7.00213 1.989 7.68057 2.66233 8.2427C2.67315 8.25096 2.6837 8.25972 2.69397 8.26898C4.00897 9.35527 5.65537 9.99991 7.50001 9.99991C10.3078 9.99991 12.6564 8.5063 14.076 6.23495C14.2223 6.00079 14.5308 5.9296 14.7649 6.07596Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Rj=["color"],Nj=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Li(e,Rj);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),m.createElement("path",{d:"M7.5 11C4.80285 11 2.52952 9.62184 1.09622 7.50001C2.52952 5.37816 4.80285 4 7.5 4C10.1971 4 12.4705 5.37816 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11ZM7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C1.65639 10.2936 4.30786 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C13.3436 4.70638 10.6921 3 7.5 3ZM7.5 9.5C8.60457 9.5 9.5 8.60457 9.5 7.5C9.5 6.39543 8.60457 5.5 7.5 5.5C6.39543 5.5 5.5 6.39543 5.5 7.5C5.5 8.60457 6.39543 9.5 7.5 9.5Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Lj=["color"],HE=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Li(e,Lj);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),m.createElement("path",{d:"M7.49991 0.876892C3.84222 0.876892 0.877075 3.84204 0.877075 7.49972C0.877075 11.1574 3.84222 14.1226 7.49991 14.1226C11.1576 14.1226 14.1227 11.1574 14.1227 7.49972C14.1227 3.84204 11.1576 0.876892 7.49991 0.876892ZM1.82707 7.49972C1.82707 4.36671 4.36689 1.82689 7.49991 1.82689C10.6329 1.82689 13.1727 4.36671 13.1727 7.49972C13.1727 10.6327 10.6329 13.1726 7.49991 13.1726C4.36689 13.1726 1.82707 10.6327 1.82707 7.49972ZM8.24992 4.49999C8.24992 4.9142 7.91413 5.24999 7.49992 5.24999C7.08571 5.24999 6.74992 4.9142 6.74992 4.49999C6.74992 4.08577 7.08571 3.74999 7.49992 3.74999C7.91413 3.74999 8.24992 4.08577 8.24992 4.49999ZM6.00003 5.99999H6.50003H7.50003C7.77618 5.99999 8.00003 6.22384 8.00003 6.49999V9.99999H8.50003H9.00003V11H8.50003H7.50003H6.50003H6.00003V9.99999H6.50003H7.00003V6.99999H6.50003H6.00003V5.99999Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),$j=["color"],Fj=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Li(e,$j);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),m.createElement("path",{d:"M1.20308 1.04312C1.00481 0.954998 0.772341 1.0048 0.627577 1.16641C0.482813 1.32802 0.458794 1.56455 0.568117 1.75196L3.92115 7.50002L0.568117 13.2481C0.458794 13.4355 0.482813 13.672 0.627577 13.8336C0.772341 13.9952 1.00481 14.045 1.20308 13.9569L14.7031 7.95693C14.8836 7.87668 15 7.69762 15 7.50002C15 7.30243 14.8836 7.12337 14.7031 7.04312L1.20308 1.04312ZM4.84553 7.10002L2.21234 2.586L13.2689 7.50002L2.21234 12.414L4.84552 7.90002H9C9.22092 7.90002 9.4 7.72094 9.4 7.50002C9.4 7.27911 9.22092 7.10002 9 7.10002H4.84553Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),jj=["color"],zj=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Li(e,jj);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),m.createElement("path",{d:"M3.24182 2.32181C3.3919 2.23132 3.5784 2.22601 3.73338 2.30781L12.7334 7.05781C12.8974 7.14436 13 7.31457 13 7.5C13 7.68543 12.8974 7.85564 12.7334 7.94219L3.73338 12.6922C3.5784 12.774 3.3919 12.7687 3.24182 12.6782C3.09175 12.5877 3 12.4252 3 12.25V2.75C3 2.57476 3.09175 2.4123 3.24182 2.32181ZM4 3.57925V11.4207L11.4288 7.5L4 3.57925Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))});let hh;const Bj=new Uint8Array(16);function Hj(){if(!hh&&(hh=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!hh))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return hh(Bj)}const Ln=[];for(let e=0;e<256;++e)Ln.push((e+256).toString(16).slice(1));function Vj(e,t=0){return Ln[e[t+0]]+Ln[e[t+1]]+Ln[e[t+2]]+Ln[e[t+3]]+"-"+Ln[e[t+4]]+Ln[e[t+5]]+"-"+Ln[e[t+6]]+Ln[e[t+7]]+"-"+Ln[e[t+8]]+Ln[e[t+9]]+"-"+Ln[e[t+10]]+Ln[e[t+11]]+Ln[e[t+12]]+Ln[e[t+13]]+Ln[e[t+14]]+Ln[e[t+15]]}const VE={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function ph(e,t,n){if(VE.randomUUID&&!t&&!e)return VE.randomUUID();e=e||{};const r=e.random||(e.rng||Hj)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let i=0;i<16;++i)t[n+i]=r[i];return t}return Vj(r)}const _e=nw()(pw((e,t)=>({isShowingVisual:!0,runSql:!1,sqlGen:{},sql:"",isSqlRunning:!1,showFilters:!1,applyFilters:!1,filterValues:[{filterId:"sample-filter-id",valueType:"string",name:"",operation:"in",values:[""]}],card:{id:ph(),title:"Editor Card",description:"Desdcription",type:"bar",data:[]},actions:{setCardPreferences:n=>{e(r=>{r.card.preferences=n})},setFilterOnClickField:n=>{e(r=>{r.card.preferences={...r.card.preferences,filterOnClick:!0,filterOnClickField:n}})},setCardRefreshInterval:n=>{e(r=>{r.card.refreshInterval=n})},setIsShowingVisual:n=>{e({isShowingVisual:n})},setRunSql:n=>{e({runSql:n})},setIsSqlRunning:n=>{e({isSqlRunning:n})},setCard:n=>{e({card:n})},setCardType:n=>{e(r=>{r.card.type=n})},setCardSql:n=>{e(r=>{r.card.sql=n})},setCardCustomCfg:n=>{e(r=>{r.card.customCfg=n})},setCardCfg:n=>{e(r=>{r.card.cfg=n})},setShowFilters:n=>{e(r=>{r.showFilters=n})},setApplyFilters:n=>{e(r=>{r.applyFilters=n})},setFilterValues:n=>{e(r=>{r.filterValues=n})},setSqlGen:n=>{e(r=>{r.sqlGen=n})},setSqlGenMeasure:(n,r)=>{e(i=>{i.sqlGen.measures=[...i.sqlGen.measures||[],{name:n,calc:r}]})},setSqlGenDimension:n=>{e(r=>{r.sqlGen.dimensions=[...r.sqlGen.dimensions||[],n]})},setCardData:n=>{e(r=>{r.card.data=n})},setSelectedConnectionId:n=>{var r,i;e(o=>{o.selectedConnectionId=n,o.card.connectionId=n}),(i=(r=t()).onConnectionChange)==null||i.call(r,n)},setSelectedDatabaseName:n=>{var r,i;e(o=>{o.selectedDatabaseName=n,o.card.lastSelectedDatabase=n}),(i=(r=t()).onDatabaseChange)==null||i.call(r,n)},setSelectedSchemaName:n=>{var r,i;e(o=>{o.selectedSchemaName=n,o.card.lastSelectedSchema=n}),(i=(r=t()).onSchemaChange)==null||i.call(r,n)},setSelectedTableName:n=>{var r,i;e(o=>{o.selectedTableName=n,o.card.lastSelectedTable=n}),(i=(r=t()).onTableChange)==null||i.call(r,n)},setCurrentColumns:n=>{e(r=>{r.currentColumns=n})},setOnConnectionChange:n=>{e({onConnectionChange:n})},setOnDatabaseChange:n=>{e({onDatabaseChange:n})},setOnSchemaChange:n=>{e({onSchemaChange:n})},setOnTableChange:n=>{e({onTableChange:n})},setOnSave:n=>{e({onSave:n})},setOnClose:n=>{e({onClose:n})}}})));process.env.NODE_ENV==="development"&&mw("EditorStore",_e);function Wj({card:e}){const t=xe(y=>y.isDashboardEditing),n=xe(y=>y.filterValues),r=xe(y=>y.isVisualEditing),i=xe(y=>y.selectedSheetId),o=xe(y=>y.actions.removeCard),s=xe(y=>y.actions.setIsVisualEditing),a=_e(y=>y.actions.setFilterValues),l=_e(y=>y.actions.setApplyFilters),c=_e(y=>y.actions.setCard),d=_e(y=>y.actions.setSelectedConnectionId),f=_e(y=>y.actions.setSelectedDatabaseName),g=_e(y=>y.actions.setSelectedSchemaName),p=_e(y=>y.actions.setSelectedTableName);function v(){s(!r),c(e),e!=null&&e.connectionId&&d(e==null?void 0:e.connectionId),e!=null&&e.lastSelectedDatabase&&f(e==null?void 0:e.lastSelectedDatabase),e!=null&&e.lastSelectedSchema&&g(e==null?void 0:e.lastSelectedSchema),e!=null&&e.lastSelectedTable&&p(e==null?void 0:e.lastSelectedTable),n&&(a(n),l(!0))}return S.jsx("section",{className:"absolute right-2 top-2",children:t&&S.jsxs("div",{className:"flex items-center gap-2",children:[r?S.jsx(Ij,{onClick:()=>{s(!r)},className:"h-[14px] w-[14px] hover:cursor-pointer hover:text-foreground/50 text-foreground/30"}):S.jsx(Nj,{role:"edit-visual",onClick:v,className:"h-[14px] w-[14px] hover:cursor-pointer hover:text-foreground/50 text-foreground/30"}),S.jsx(bu,{onClick:()=>o(i,e),className:"h-[14px] w-[14px] hover:cursor-pointer hover:text-foreground/50 text-foreground/30"})]})})}function qj(e,t){var s,a,l,c;const n=xe.getState().themeStyle,r=(a=(s=n==null?void 0:n.chart)==null?void 0:s.dataset)==null?void 0:a.backgroundColor,i=(c=(l=n==null?void 0:n.chart)==null?void 0:l.dataset)==null?void 0:c.borderColor;return e.map((d,f)=>({label:d.charAt(0).toUpperCase()+d.slice(1),data:t.map(g=>g[d]),backgroundColor:r==null?void 0:r[f%r.length],borderColor:i==null?void 0:i[f%i.length]}))}function Uj(e){var a,l,c,d;const{metricKeys:t,dimensionKeys:n}=ta(e);let r=[];const i=xe.getState().themeStyle,o=(l=(a=i==null?void 0:i.chart)==null?void 0:a.dataset)==null?void 0:l.backgroundColor,s=(d=(c=i==null?void 0:i.chart)==null?void 0:c.dataset)==null?void 0:d.borderColor;if((n==null?void 0:n.length)===1){const f=e.map(g=>({x:g[t[0]],y:g[t[1]],r:g[t[2]],label:g[n==null?void 0:n[0]]}));r=[{label:n==null?void 0:n[0],data:f}]}return(n==null?void 0:n.length)>1&&(r=[...new Set(e.map(g=>g[n==null?void 0:n[1]]))].map((g,p)=>{const v=e.filter(y=>y[n==null?void 0:n[1]]===g);return{label:g,data:v.map(y=>({x:y[t[0]],y:y[t[1]],r:y[t[2]],label:y[n==null?void 0:n[0]]})),backgroundColor:o==null?void 0:o[p%o.length],borderColor:s==null?void 0:s[p%s.length]}})),r}function Gj(e,t){var s,a,l,c;const n=xe.getState().themeStyle,r=(a=(s=n==null?void 0:n.chart)==null?void 0:s.dataset)==null?void 0:a.backgroundColor,i=(c=(l=n==null?void 0:n.chart)==null?void 0:l.dataset)==null?void 0:c.borderColor;return e.map(d=>({label:d.charAt(0).toUpperCase()+d.slice(1),data:t.map(f=>f[d]),backgroundColor:t.map((f,g)=>r==null?void 0:r[g%r.length]),borderColor:t.map((f,g)=>i==null?void 0:i[g%i.length])}))}function ta(e){const t=Object.keys(e[0]),n=t.filter(i=>{var o,s,a,l;return!!(typeof e[0][i]&&typeof e[0][i]=="string"||typeof((o=e==null?void 0:e[1])==null?void 0:o[i])&&typeof((s=e==null?void 0:e[1])==null?void 0:s[i])=="string"||typeof((a=e==null?void 0:e[2])==null?void 0:a[i])&&typeof((l=e==null?void 0:e[2])==null?void 0:l[i])=="string")});n.length===0&&n.push(t[0]);const r=t.filter(i=>e[0][i]===+e[0][i]);return{dimensionKeys:n,metricKeys:r}}function gb(e,t){var r;const n=(r=t==null?void 0:t.data)==null?void 0:r.datasets;return n&&n.length>0?e.map((o,s)=>({...o,...n[s],data:o.data,label:o.label})):e}function WE({dataArray:e,groupKey:t,pivotKey:n,valueKey:r}){const i=e.reduce((o,s)=>{const a=s[t],l=s[n],c=s[r];return o[a]||(o[a]={[t]:a}),o[a][l]=c,o},{});return Object.values(i)}function mb(e,t){var s;const n=xe.getState().themeStyle,r=(s=n==null?void 0:n.chart)==null?void 0:s.options,i=Rs.cloneDeep(r);return Rs.merge(i,e,t)}function qE(e,t){return e.map(n=>n[t]?n[t]:"BLANK")}function na({data:e,cfg:t,customCfg:n}){const{dimensionKeys:r,metricKeys:i}=ta(e),o=qj(i,e),s=gb(o,n),a=r[0],l=qE(e,a),c=mb((t==null?void 0:t.options)||{},(n==null?void 0:n.options)||{});return{type:(n==null?void 0:n.type)||(t==null?void 0:t.type)||"bar",data:{labels:l,datasets:s},options:c}}function Yj(e){return{...e,type:"bar",options:{...e==null?void 0:e.options,indexAxis:"y",scales:{x:{display:!0},y:{display:!0}}}}}function Kj(e){return{...e,type:"bar",options:{...e==null?void 0:e.options,scales:{x:{display:!0},y:{display:!0}}}}}function Xj(e){var n,r,i,o;return{...e,type:"bar",options:{...e==null?void 0:e.options,scales:{x:{...(r=(n=e==null?void 0:e.options)==null?void 0:n.scales)==null?void 0:r.x,display:!0,stacked:!0},y:{...(o=(i=e==null?void 0:e.options)==null?void 0:i.scales)==null?void 0:o.y,display:!0,stacked:!0}}}}}function Qj(e){return{...e,type:"line",options:{...e==null?void 0:e.options,scales:{x:{display:!0},y:{display:!0}}}}}function UE(e,t){return{...t,type:e,options:{...t==null?void 0:t.options,scales:{x:{display:!1},y:{display:!1}}}}}function Zj(e){return{...e,type:"radar",options:{...e==null?void 0:e.options,scales:{x:{display:!1},y:{display:!1}}}}}function vb({data:e,cardType:t="bar",cfg:n,customCfg:r,provider:i="chartjs",userSettings:o}){if(t==="bar"){const s=Kj(n);return na({data:e,cfg:s,customCfg:r,cardType:t,userSettings:o,provider:i})}if(t==="horizontalBar"){const s=Yj(n);return na({data:e,cfg:s,customCfg:r,cardType:t,userSettings:o,provider:i})}if(t==="stackedBar"){const s=Xj(n),{dimensionKeys:a,metricKeys:l}=ta(e),c=WE({dataArray:e,groupKey:a[0],pivotKey:a[1],valueKey:l[0]});return na({data:c,cfg:s,customCfg:r,cardType:t,userSettings:o,provider:i})}if(t==="line"){const s=Qj(n);return na({data:e,cfg:s,customCfg:r,cardType:t,userSettings:o,provider:i})}if(t==="pie"||t==="doughnut"){const s=UE(t,n),{dimensionKeys:a,metricKeys:l}=ta(e),c=Gj(l,e),d=gb(c,r),f=a[0],g=qE(e,f),p=mb((s==null?void 0:s.options)||{},(r==null?void 0:r.options)||{});return{type:t,data:{labels:g,datasets:d},options:p}}if(t==="radar"){const s=Zj(n);return na({data:e,cfg:s,customCfg:r,cardType:t,userSettings:o,provider:i})}if(t==="bubble"||t==="scatter"){const{metricKeys:s}=ta(e);if(s.length<3){console.log("Bubble charts require 3 numeric columns");return}const a=Uj(e),l=gb(a,r),c={plugins:{datalabels:{display:!0}},scales:{x:{title:{display:!0,text:s[0]},beginAtZero:!0,ticks:{precision:0}},y:{title:{display:!0,text:s[1]},beginAtZero:!0,ticks:{precision:0}}}},d=mb(c,(r==null?void 0:r.options)||{});return{type:t,data:{datasets:l},options:d}}if(t==="polarArea"){const s=UE(t,n);return na({data:e,cfg:s,customCfg:r,cardType:t,userSettings:o,provider:i})}return na({data:e,cfg:n,customCfg:r,cardType:t,userSettings:o,provider:i})}var pl=1e3,gl=pl*60,ml=gl*60,ra=ml*24,Jj=ra*7,ez=ra*365.25,tz=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0)return nz(e);if(n==="number"&&isFinite(e))return t.long?iz(e):rz(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function nz(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]),r=(t[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*ez;case"weeks":case"week":case"w":return n*Jj;case"days":case"day":case"d":return n*ra;case"hours":case"hour":case"hrs":case"hr":case"h":return n*ml;case"minutes":case"minute":case"mins":case"min":case"m":return n*gl;case"seconds":case"second":case"secs":case"sec":case"s":return n*pl;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function rz(e){var t=Math.abs(e);return t>=ra?Math.round(e/ra)+"d":t>=ml?Math.round(e/ml)+"h":t>=gl?Math.round(e/gl)+"m":t>=pl?Math.round(e/pl)+"s":e+"ms"}function iz(e){var t=Math.abs(e);return t>=ra?gh(e,t,ra,"day"):t>=ml?gh(e,t,ml,"hour"):t>=gl?gh(e,t,gl,"minute"):t>=pl?gh(e,t,pl,"second"):e+" ms"}function gh(e,t,n,r){var i=t>=n*1.5;return Math.round(e/n)+" "+r+(i?"s":"")}const oz=Sc(tz);function sz(e){const t=xe(a=>a.authToken),n=xe(a=>a.filterValues),r=xe(a=>a.isDashboardEditing),i=oz((e==null?void 0:e.refreshInterval)||"0"),o=Sr({queryKey:[e.id,e.sql],queryFn:()=>Ds("https://semaphor.cloud/api/v1/data",(t==null?void 0:t.accessToken)||"",{visual_id:e.id,active_filters:n}),refetchInterval:i,enabled:!!i&&!r}),s=Sr({queryKey:[e.id,e.sql],queryFn:()=>Ds("https://semaphor.cloud/api/v1/query",(t==null?void 0:t.accessToken)||"",{connection_id:e.connectionId,sql:e.sql,active_filters:n}),refetchInterval:i,enabled:!!i&&r});return r?s:o}function az(e,t=globalThis==null?void 0:globalThis.document){const n=On(e);m.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const bb="dismissableLayer.update",lz="dismissableLayer.pointerDownOutside",cz="dismissableLayer.focusOutside";let GE;const uz=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),vl=m.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:a,onDismiss:l,...c}=e,d=m.useContext(uz),[f,g]=m.useState(null),p=(n=f==null?void 0:f.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,v]=m.useState({}),y=et(t,L=>g(L)),x=Array.from(d.layers),[w]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),_=x.indexOf(w),C=f?x.indexOf(f):-1,O=d.layersWithOutsidePointerEventsDisabled.size>0,P=C>=_,k=dz(L=>{const F=L.target,B=[...d.branches].some(H=>H.contains(F));!P||B||(o==null||o(L),a==null||a(L),L.defaultPrevented||l==null||l())},p),A=fz(L=>{const F=L.target;[...d.branches].some(H=>H.contains(F))||(s==null||s(L),a==null||a(L),L.defaultPrevented||l==null||l())},p);return az(L=>{C===d.layers.size-1&&(i==null||i(L),!L.defaultPrevented&&l&&(L.preventDefault(),l()))},p),m.useEffect(()=>{if(f)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(GE=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),YE(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=GE)}},[f,p,r,d]),m.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),YE())},[f,d]),m.useEffect(()=>{const L=()=>v({});return document.addEventListener(bb,L),()=>document.removeEventListener(bb,L)},[]),m.createElement(Be.div,le({},c,{ref:y,style:{pointerEvents:O?P?"auto":"none":void 0,...e.style},onFocusCapture:Ce(e.onFocusCapture,A.onFocusCapture),onBlurCapture:Ce(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:Ce(e.onPointerDownCapture,k.onPointerDownCapture)}))});function dz(e,t=globalThis==null?void 0:globalThis.document){const n=On(e),r=m.useRef(!1),i=m.useRef(()=>{});return m.useEffect(()=>{const o=a=>{if(a.target&&!r.current){let c=function(){KE(lz,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=c,t.addEventListener("click",i.current,{once:!0})):c()}else t.removeEventListener("click",i.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function fz(e,t=globalThis==null?void 0:globalThis.document){const n=On(e),r=m.useRef(!1);return m.useEffect(()=>{const i=o=>{o.target&&!r.current&&KE(cz,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function YE(){const e=new CustomEvent(bb);document.dispatchEvent(e)}function KE(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?jw(i,o):i.dispatchEvent(o)}const hz=["top","right","bottom","left"],Ko=Math.min,kr=Math.max,mh=Math.round,vh=Math.floor,Xo=e=>({x:e,y:e}),pz={left:"right",right:"left",bottom:"top",top:"bottom"},gz={start:"end",end:"start"};function yb(e,t,n){return kr(e,Ko(t,n))}function po(e,t){return typeof e=="function"?e(t):e}function go(e){return e.split("-")[0]}function bl(e){return e.split("-")[1]}function xb(e){return e==="x"?"y":"x"}function wb(e){return e==="y"?"height":"width"}function yl(e){return["top","bottom"].includes(go(e))?"y":"x"}function _b(e){return xb(yl(e))}function mz(e,t,n){n===void 0&&(n=!1);const r=bl(e),i=_b(e),o=wb(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(s=bh(s)),[s,bh(s)]}function vz(e){const t=bh(e);return[Sb(e),t,Sb(t)]}function Sb(e){return e.replace(/start|end/g,t=>gz[t])}function bz(e,t,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?o:s;default:return[]}}function yz(e,t,n,r){const i=bl(e);let o=bz(go(e),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),t&&(o=o.concat(o.map(Sb)))),o}function bh(e){return e.replace(/left|right|bottom|top/g,t=>pz[t])}function xz(e){return{top:0,right:0,bottom:0,left:0,...e}}function XE(e){return typeof e!="number"?xz(e):{top:e,right:e,bottom:e,left:e}}function yh(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function QE(e,t,n){let{reference:r,floating:i}=e;const o=yl(t),s=_b(t),a=wb(s),l=go(t),c=o==="y",d=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,g=r[a]/2-i[a]/2;let p;switch(l){case"top":p={x:d,y:r.y-i.height};break;case"bottom":p={x:d,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-i.width,y:f};break;default:p={x:r.x,y:r.y}}switch(bl(t)){case"start":p[s]-=g*(n&&c?-1:1);break;case"end":p[s]+=g*(n&&c?-1:1);break}return p}const wz=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,a=o.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:d,y:f}=QE(c,r,l),g=r,p={},v=0;for(let y=0;y<a.length;y++){const{name:x,fn:w}=a[y],{x:_,y:C,data:O,reset:P}=await w({x:d,y:f,initialPlacement:r,placement:g,strategy:i,middlewareData:p,rects:c,platform:s,elements:{reference:e,floating:t}});if(d=_??d,f=C??f,p={...p,[x]:{...p[x],...O}},P&&v<=50){v++,typeof P=="object"&&(P.placement&&(g=P.placement),P.rects&&(c=P.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:i}):P.rects),{x:d,y:f}=QE(c,g,l)),y=-1;continue}}return{x:d,y:f,placement:g,strategy:i,middlewareData:p}};async function yu(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:g=!1,padding:p=0}=po(t,e),v=XE(p),x=a[g?f==="floating"?"reference":"floating":f],w=yh(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(x)))==null||n?x:x.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),_=f==="floating"?{...s.floating,x:r,y:i}:s.reference,C=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),O=await(o.isElement==null?void 0:o.isElement(C))?await(o.getScale==null?void 0:o.getScale(C))||{x:1,y:1}:{x:1,y:1},P=yh(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({rect:_,offsetParent:C,strategy:l}):_);return{top:(w.top-P.top+v.top)/O.y,bottom:(P.bottom-w.bottom+v.bottom)/O.y,left:(w.left-P.left+v.left)/O.x,right:(P.right-w.right+v.right)/O.x}}const ZE=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:d=0}=po(e,t)||{};if(c==null)return{};const f=XE(d),g={x:n,y:r},p=_b(i),v=wb(p),y=await s.getDimensions(c),x=p==="y",w=x?"top":"left",_=x?"bottom":"right",C=x?"clientHeight":"clientWidth",O=o.reference[v]+o.reference[p]-g[p]-o.floating[v],P=g[p]-o.reference[p],k=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let A=k?k[C]:0;(!A||!await(s.isElement==null?void 0:s.isElement(k)))&&(A=a.floating[C]||o.floating[v]);const L=O/2-P/2,F=A/2-y[v]/2-1,B=Ko(f[w],F),H=Ko(f[_],F),V=B,K=A-y[v]-H,Y=A/2-y[v]/2+L,$=yb(V,Y,K),X=!l.arrow&&bl(i)!=null&&Y!=$&&o.reference[v]/2-(Y<V?B:H)-y[v]/2<0,j=X?Y<V?Y-V:Y-K:0;return{[p]:g[p]+j,data:{[p]:$,centerOffset:Y-$-j,...X&&{alignmentOffset:j}},reset:X}}}),_z=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:g,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:y=!0,...x}=po(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const w=go(i),_=go(a)===a,C=await(l.isRTL==null?void 0:l.isRTL(c.floating)),O=g||(_||!y?[bh(a)]:vz(a));!g&&v!=="none"&&O.push(...yz(a,y,v,C));const P=[a,...O],k=await yu(t,x),A=[];let L=((r=o.flip)==null?void 0:r.overflows)||[];if(d&&A.push(k[w]),f){const V=mz(i,s,C);A.push(k[V[0]],k[V[1]])}if(L=[...L,{placement:i,overflows:A}],!A.every(V=>V<=0)){var F,B;const V=(((F=o.flip)==null?void 0:F.index)||0)+1,K=P[V];if(K)return{data:{index:V,overflows:L},reset:{placement:K}};let Y=(B=L.filter($=>$.overflows[0]<=0).sort(($,X)=>$.overflows[1]-X.overflows[1])[0])==null?void 0:B.placement;if(!Y)switch(p){case"bestFit":{var H;const $=(H=L.map(X=>[X.placement,X.overflows.filter(j=>j>0).reduce((j,ne)=>j+ne,0)]).sort((X,j)=>X[1]-j[1])[0])==null?void 0:H[0];$&&(Y=$);break}case"initialPlacement":Y=a;break}if(i!==Y)return{reset:{placement:Y}}}return{}}}};function JE(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function e2(e){return hz.some(t=>e[t]>=0)}const Sz=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=po(e,t);switch(r){case"referenceHidden":{const o=await yu(t,{...i,elementContext:"reference"}),s=JE(o,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:e2(s)}}}case"escaped":{const o=await yu(t,{...i,altBoundary:!0}),s=JE(o,n.floating);return{data:{escapedOffsets:s,escaped:e2(s)}}}default:return{}}}}};async function Cz(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=go(n),a=bl(n),l=yl(n)==="y",c=["left","top"].includes(s)?-1:1,d=o&&l?-1:1,f=po(t,e);let{mainAxis:g,crossAxis:p,alignmentAxis:v}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&typeof v=="number"&&(p=a==="end"?v*-1:v),l?{x:p*d,y:g*c}:{x:g*c,y:p*d}}const Ez=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:s,middlewareData:a}=t,l=await Cz(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:s}}}}},Pz=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:a={fn:x=>{let{x:w,y:_}=x;return{x:w,y:_}}},...l}=po(e,t),c={x:n,y:r},d=await yu(t,l),f=yl(go(i)),g=xb(f);let p=c[g],v=c[f];if(o){const x=g==="y"?"top":"left",w=g==="y"?"bottom":"right",_=p+d[x],C=p-d[w];p=yb(_,p,C)}if(s){const x=f==="y"?"top":"left",w=f==="y"?"bottom":"right",_=v+d[x],C=v-d[w];v=yb(_,v,C)}const y=a.fn({...t,[g]:p,[f]:v});return{...y,data:{x:y.x-n,y:y.y-r}}}}},Oz=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=po(e,t),d={x:n,y:r},f=yl(i),g=xb(f);let p=d[g],v=d[f];const y=po(a,t),x=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(l){const C=g==="y"?"height":"width",O=o.reference[g]-o.floating[C]+x.mainAxis,P=o.reference[g]+o.reference[C]-x.mainAxis;p<O?p=O:p>P&&(p=P)}if(c){var w,_;const C=g==="y"?"width":"height",O=["top","left"].includes(go(i)),P=o.reference[f]-o.floating[C]+(O&&((w=s.offset)==null?void 0:w[f])||0)+(O?0:x.crossAxis),k=o.reference[f]+o.reference[C]+(O?0:((_=s.offset)==null?void 0:_[f])||0)-(O?x.crossAxis:0);v<P?v=P:v>k&&(v=k)}return{[g]:p,[f]:v}}}},kz=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:i,elements:o}=t,{apply:s=()=>{},...a}=po(e,t),l=await yu(t,a),c=go(n),d=bl(n),f=yl(n)==="y",{width:g,height:p}=r.floating;let v,y;c==="top"||c==="bottom"?(v=c,y=d===(await(i.isRTL==null?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(y=c,v=d==="end"?"top":"bottom");const x=p-l[v],w=g-l[y],_=!t.middlewareData.shift;let C=x,O=w;if(f){const k=g-l.left-l.right;O=d||_?Ko(w,k):k}else{const k=p-l.top-l.bottom;C=d||_?Ko(x,k):k}if(_&&!d){const k=kr(l.left,0),A=kr(l.right,0),L=kr(l.top,0),F=kr(l.bottom,0);f?O=g-2*(k!==0||A!==0?k+A:kr(l.left,l.right)):C=p-2*(L!==0||F!==0?L+F:kr(l.top,l.bottom))}await s({...t,availableWidth:O,availableHeight:C});const P=await i.getDimensions(o.floating);return g!==P.width||p!==P.height?{reset:{rects:!0}}:{}}}};function Qo(e){return t2(e)?(e.nodeName||"").toLowerCase():"#document"}function Mr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function mo(e){var t;return(t=(t2(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function t2(e){return e instanceof Node||e instanceof Mr(e).Node}function vo(e){return e instanceof Element||e instanceof Mr(e).Element}function $i(e){return e instanceof HTMLElement||e instanceof Mr(e).HTMLElement}function n2(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Mr(e).ShadowRoot}function xu(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Qr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function Mz(e){return["table","td","th"].includes(Qo(e))}function Cb(e){const t=Eb(),n=Qr(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function Dz(e){let t=xl(e);for(;$i(t)&&!xh(t);){if(Cb(t))return t;t=xl(t)}return null}function Eb(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function xh(e){return["html","body","#document"].includes(Qo(e))}function Qr(e){return Mr(e).getComputedStyle(e)}function wh(e){return vo(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function xl(e){if(Qo(e)==="html")return e;const t=e.assignedSlot||e.parentNode||n2(e)&&e.host||mo(e);return n2(t)?t.host:t}function r2(e){const t=xl(e);return xh(t)?e.ownerDocument?e.ownerDocument.body:e.body:$i(t)&&xu(t)?t:r2(t)}function wu(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=r2(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),s=Mr(i);return o?t.concat(s,s.visualViewport||[],xu(i)?i:[],s.frameElement&&n?wu(s.frameElement):[]):t.concat(i,wu(i,[],n))}function i2(e){const t=Qr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=$i(e),o=i?e.offsetWidth:n,s=i?e.offsetHeight:r,a=mh(n)!==o||mh(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function Pb(e){return vo(e)?e:e.contextElement}function wl(e){const t=Pb(e);if(!$i(t))return Xo(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=i2(t);let s=(o?mh(n.width):n.width)/r,a=(o?mh(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const Tz=Xo(0);function o2(e){const t=Mr(e);return!Eb()||!t.visualViewport?Tz:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Az(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Mr(e)?!1:t}function ia(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=Pb(e);let s=Xo(1);t&&(r?vo(r)&&(s=wl(r)):s=wl(e));const a=Az(o,n,r)?o2(o):Xo(0);let l=(i.left+a.x)/s.x,c=(i.top+a.y)/s.y,d=i.width/s.x,f=i.height/s.y;if(o){const g=Mr(o),p=r&&vo(r)?Mr(r):r;let v=g.frameElement;for(;v&&r&&p!==g;){const y=wl(v),x=v.getBoundingClientRect(),w=Qr(v),_=x.left+(v.clientLeft+parseFloat(w.paddingLeft))*y.x,C=x.top+(v.clientTop+parseFloat(w.paddingTop))*y.y;l*=y.x,c*=y.y,d*=y.x,f*=y.y,l+=_,c+=C,v=Mr(v).frameElement}}return yh({width:d,height:f,x:l,y:c})}function Iz(e){let{rect:t,offsetParent:n,strategy:r}=e;const i=$i(n),o=mo(n);if(n===o)return t;let s={scrollLeft:0,scrollTop:0},a=Xo(1);const l=Xo(0);if((i||!i&&r!=="fixed")&&((Qo(n)!=="body"||xu(o))&&(s=wh(n)),$i(n))){const c=ia(n);a=wl(n),l.x=c.x+n.clientLeft,l.y=c.y+n.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-s.scrollLeft*a.x+l.x,y:t.y*a.y-s.scrollTop*a.y+l.y}}function Rz(e){return Array.from(e.getClientRects())}function s2(e){return ia(mo(e)).left+wh(e).scrollLeft}function Nz(e){const t=mo(e),n=wh(e),r=e.ownerDocument.body,i=kr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=kr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+s2(e);const a=-n.scrollTop;return Qr(r).direction==="rtl"&&(s+=kr(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}function Lz(e,t){const n=Mr(e),r=mo(e),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;const c=Eb();(!c||c&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a,y:l}}function $z(e,t){const n=ia(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=$i(e)?wl(e):Xo(1),s=e.clientWidth*o.x,a=e.clientHeight*o.y,l=i*o.x,c=r*o.y;return{width:s,height:a,x:l,y:c}}function a2(e,t,n){let r;if(t==="viewport")r=Lz(e,n);else if(t==="document")r=Nz(mo(e));else if(vo(t))r=$z(t,n);else{const i=o2(e);r={...t,x:t.x-i.x,y:t.y-i.y}}return yh(r)}function l2(e,t){const n=xl(e);return n===t||!vo(n)||xh(n)?!1:Qr(n).position==="fixed"||l2(n,t)}function Fz(e,t){const n=t.get(e);if(n)return n;let r=wu(e,[],!1).filter(a=>vo(a)&&Qo(a)!=="body"),i=null;const o=Qr(e).position==="fixed";let s=o?xl(e):e;for(;vo(s)&&!xh(s);){const a=Qr(s),l=Cb(s);!l&&a.position==="fixed"&&(i=null),(o?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||xu(s)&&!l&&l2(e,s))?r=r.filter(d=>d!==s):i=a,s=xl(s)}return t.set(e,r),r}function jz(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const s=[...n==="clippingAncestors"?Fz(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,d)=>{const f=a2(t,d,i);return c.top=kr(f.top,c.top),c.right=Ko(f.right,c.right),c.bottom=Ko(f.bottom,c.bottom),c.left=kr(f.left,c.left),c},a2(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function zz(e){return i2(e)}function Bz(e,t,n){const r=$i(t),i=mo(t),o=n==="fixed",s=ia(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const l=Xo(0);if(r||!r&&!o)if((Qo(t)!=="body"||xu(i))&&(a=wh(t)),r){const c=ia(t,!0,o,t);l.x=c.x+t.clientLeft,l.y=c.y+t.clientTop}else i&&(l.x=s2(i));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function c2(e,t){return!$i(e)||Qr(e).position==="fixed"?null:t?t(e):e.offsetParent}function u2(e,t){const n=Mr(e);if(!$i(e))return n;let r=c2(e,t);for(;r&&Mz(r)&&Qr(r).position==="static";)r=c2(r,t);return r&&(Qo(r)==="html"||Qo(r)==="body"&&Qr(r).position==="static"&&!Cb(r))?n:r||Dz(e)||n}const Hz=async function(e){let{reference:t,floating:n,strategy:r}=e;const i=this.getOffsetParent||u2,o=this.getDimensions;return{reference:Bz(t,await i(n),r),floating:{x:0,y:0,...await o(n)}}};function Vz(e){return Qr(e).direction==="rtl"}const Wz={convertOffsetParentRelativeRectToViewportRelativeRect:Iz,getDocumentElement:mo,getClippingRect:jz,getOffsetParent:u2,getElementRects:Hz,getClientRects:Rz,getDimensions:zz,getScale:wl,isElement:vo,isRTL:Vz};function qz(e,t){let n=null,r;const i=mo(e);function o(){clearTimeout(r),n&&n.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const{left:c,top:d,width:f,height:g}=e.getBoundingClientRect();if(a||t(),!f||!g)return;const p=vh(d),v=vh(i.clientWidth-(c+f)),y=vh(i.clientHeight-(d+g)),x=vh(c),_={rootMargin:-p+"px "+-v+"px "+-y+"px "+-x+"px",threshold:kr(0,Ko(1,l))||1};let C=!0;function O(P){const k=P[0].intersectionRatio;if(k!==l){if(!C)return s();k?s(!1,k):r=setTimeout(()=>{s(!1,1e-7)},100)}C=!1}try{n=new IntersectionObserver(O,{..._,root:i.ownerDocument})}catch{n=new IntersectionObserver(O,_)}n.observe(e)}return s(!0),o}function Uz(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Pb(e),d=i||o?[...c?wu(c):[],...wu(t)]:[];d.forEach(w=>{i&&w.addEventListener("scroll",n,{passive:!0}),o&&w.addEventListener("resize",n)});const f=c&&a?qz(c,n):null;let g=-1,p=null;s&&(p=new ResizeObserver(w=>{let[_]=w;_&&_.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{p&&p.observe(t)})),n()}),c&&!l&&p.observe(c),p.observe(t));let v,y=l?ia(e):null;l&&x();function x(){const w=ia(e);y&&(w.x!==y.x||w.y!==y.y||w.width!==y.width||w.height!==y.height)&&n(),y=w,v=requestAnimationFrame(x)}return n(),()=>{d.forEach(w=>{i&&w.removeEventListener("scroll",n),o&&w.removeEventListener("resize",n)}),f&&f(),p&&p.disconnect(),p=null,l&&cancelAnimationFrame(v)}}const Gz=(e,t,n)=>{const r=new Map,i={platform:Wz,...n},o={...i.platform,_c:r};return wz(e,t,{...i,platform:o})},Yz=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?ZE({element:r.current,padding:i}).fn(n):{}:r?ZE({element:r,padding:i}).fn(n):{}}}};var _h=typeof document<"u"?m.useLayoutEffect:m.useEffect;function Sh(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!Sh(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!Sh(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function d2(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function f2(e,t){const n=d2(e);return Math.round(t*n)/n}function h2(e){const t=ue.useRef(e);return _h(()=>{t.current=e}),t}function Kz(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[d,f]=ue.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,p]=ue.useState(r);Sh(g,r)||p(r);const[v,y]=ue.useState(null),[x,w]=ue.useState(null),_=ue.useCallback(X=>{X!=k.current&&(k.current=X,y(X))},[y]),C=ue.useCallback(X=>{X!==A.current&&(A.current=X,w(X))},[w]),O=o||v,P=s||x,k=ue.useRef(null),A=ue.useRef(null),L=ue.useRef(d),F=h2(l),B=h2(i),H=ue.useCallback(()=>{if(!k.current||!A.current)return;const X={placement:t,strategy:n,middleware:g};B.current&&(X.platform=B.current),Gz(k.current,A.current,X).then(j=>{const ne={...j,isPositioned:!0};V.current&&!Sh(L.current,ne)&&(L.current=ne,qI.flushSync(()=>{f(ne)}))})},[g,t,n,B]);_h(()=>{c===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,f(X=>({...X,isPositioned:!1})))},[c]);const V=ue.useRef(!1);_h(()=>(V.current=!0,()=>{V.current=!1}),[]),_h(()=>{if(O&&(k.current=O),P&&(A.current=P),O&&P){if(F.current)return F.current(O,P,H);H()}},[O,P,H,F]);const K=ue.useMemo(()=>({reference:k,floating:A,setReference:_,setFloating:C}),[_,C]),Y=ue.useMemo(()=>({reference:O,floating:P}),[O,P]),$=ue.useMemo(()=>{const X={position:n,left:0,top:0};if(!Y.floating)return X;const j=f2(Y.floating,d.x),ne=f2(Y.floating,d.y);return a?{...X,transform:"translate("+j+"px, "+ne+"px)",...d2(Y.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:j,top:ne}},[n,a,Y.floating,d.x,d.y]);return ue.useMemo(()=>({...d,update:H,refs:K,elements:Y,floatingStyles:$}),[d,H,K,Y,$])}function Ch(e){const[t,n]=m.useState(void 0);return Hn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let s,a;if("borderBoxSize"in o){const l=o.borderBoxSize,c=Array.isArray(l)?l[0]:l;s=c.inlineSize,a=c.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const p2="Popper",[g2,Fi]=Pn(p2),[Xz,m2]=g2(p2),Qz=e=>{const{__scopePopper:t,children:n}=e,[r,i]=m.useState(null);return m.createElement(Xz,{scope:t,anchor:r,onAnchorChange:i},n)},Zz="PopperAnchor",Jz=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=m2(Zz,n),s=m.useRef(null),a=et(t,s);return m.useEffect(()=>{o.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:m.createElement(Be.div,le({},i,{ref:a}))}),v2="PopperContent",[eB,ode]=g2(v2),tB=m.forwardRef((e,t)=>{var n,r,i,o,s,a,l,c;const{__scopePopper:d,side:f="bottom",sideOffset:g=0,align:p="center",alignOffset:v=0,arrowPadding:y=0,avoidCollisions:x=!0,collisionBoundary:w=[],collisionPadding:_=0,sticky:C="partial",hideWhenDetached:O=!1,updatePositionStrategy:P="optimized",onPlaced:k,...A}=e,L=m2(v2,d),[F,B]=m.useState(null),H=et(t,Ve=>B(Ve)),[V,K]=m.useState(null),Y=Ch(V),$=(n=Y==null?void 0:Y.width)!==null&&n!==void 0?n:0,X=(r=Y==null?void 0:Y.height)!==null&&r!==void 0?r:0,j=f+(p!=="center"?"-"+p:""),ne=typeof _=="number"?_:{top:0,right:0,bottom:0,left:0,..._},se=Array.isArray(w)?w:[w],D=se.length>0,q={padding:ne,boundary:se.filter(nB),altBoundary:D},{refs:re,floatingStyles:R,placement:te,isPositioned:ge,middlewareData:pe}=Kz({strategy:"fixed",placement:j,whileElementsMounted:(...Ve)=>Uz(...Ve,{animationFrame:P==="always"}),elements:{reference:L.anchor},middleware:[Ez({mainAxis:g+X,alignmentAxis:v}),x&&Pz({mainAxis:!0,crossAxis:!1,limiter:C==="partial"?Oz():void 0,...q}),x&&_z({...q}),kz({...q,apply:({elements:Ve,rects:Ke,availableWidth:St,availableHeight:vt})=>{const{width:bt,height:tn}=Ke.reference,Jt=Ve.floating.style;Jt.setProperty("--radix-popper-available-width",`${St}px`),Jt.setProperty("--radix-popper-available-height",`${vt}px`),Jt.setProperty("--radix-popper-anchor-width",`${bt}px`),Jt.setProperty("--radix-popper-anchor-height",`${tn}px`)}}),V&&Yz({element:V,padding:y}),rB({arrowWidth:$,arrowHeight:X}),O&&Sz({strategy:"referenceHidden",...q})]}),[de,ie]=b2(te),J=On(k);Hn(()=>{ge&&(J==null||J())},[ge,J]);const W=(i=pe.arrow)===null||i===void 0?void 0:i.x,be=(o=pe.arrow)===null||o===void 0?void 0:o.y,oe=((s=pe.arrow)===null||s===void 0?void 0:s.centerOffset)!==0,[Te,Fe]=m.useState();return Hn(()=>{F&&Fe(window.getComputedStyle(F).zIndex)},[F]),m.createElement("div",{ref:re.setFloating,"data-radix-popper-content-wrapper":"",style:{...R,transform:ge?R.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Te,"--radix-popper-transform-origin":[(a=pe.transformOrigin)===null||a===void 0?void 0:a.x,(l=pe.transformOrigin)===null||l===void 0?void 0:l.y].join(" ")},dir:e.dir},m.createElement(eB,{scope:d,placedSide:de,onArrowChange:K,arrowX:W,arrowY:be,shouldHideArrow:oe},m.createElement(Be.div,le({"data-side":de,"data-align":ie},A,{ref:H,style:{...A.style,animation:ge?void 0:"none",opacity:(c=pe.hide)!==null&&c!==void 0&&c.referenceHidden?0:void 0}}))))});function nB(e){return e!==null}const rB=e=>({name:"transformOrigin",options:e,fn(t){var n,r,i,o,s;const{placement:a,rects:l,middlewareData:c}=t,f=((n=c.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,g=f?0:e.arrowWidth,p=f?0:e.arrowHeight,[v,y]=b2(a),x={start:"0%",center:"50%",end:"100%"}[y],w=((r=(i=c.arrow)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)+g/2,_=((o=(s=c.arrow)===null||s===void 0?void 0:s.y)!==null&&o!==void 0?o:0)+p/2;let C="",O="";return v==="bottom"?(C=f?x:`${w}px`,O=`${-p}px`):v==="top"?(C=f?x:`${w}px`,O=`${l.floating.height+p}px`):v==="right"?(C=`${-p}px`,O=f?x:`${_}px`):v==="left"&&(C=`${l.floating.width+p}px`,O=f?x:`${_}px`),{data:{x:C,y:O}}}});function b2(e){const[t,n="center"]=e.split("-");return[t,n]}const _u=Qz,Su=Jz,Cu=tB,Eh=m.forwardRef((e,t)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...i}=e;return r?kt.createPortal(m.createElement(Be.div,le({},i,{ref:t})),r):null}),y2=m.forwardRef((e,t)=>m.createElement(Be.span,le({},e,{ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}))),iB=y2,[Ph,sde]=Pn("Tooltip",[Fi]),Ob=Fi(),oB="TooltipProvider",sB=700,kb="tooltip.open",[aB,Mb]=Ph(oB),lB=e=>{const{__scopeTooltip:t,delayDuration:n=sB,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:o}=e,[s,a]=m.useState(!0),l=m.useRef(!1),c=m.useRef(0);return m.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),m.createElement(aB,{scope:t,isOpenDelayed:s,delayDuration:n,onOpen:m.useCallback(()=>{window.clearTimeout(c.current),a(!1)},[]),onClose:m.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:m.useCallback(d=>{l.current=d},[]),disableHoverableContent:i},o)},Db="Tooltip",[cB,Oh]=Ph(Db),uB=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i=!1,onOpenChange:o,disableHoverableContent:s,delayDuration:a}=e,l=Mb(Db,e.__scopeTooltip),c=Ob(t),[d,f]=m.useState(null),g=or(),p=m.useRef(0),v=s??l.disableHoverableContent,y=a??l.delayDuration,x=m.useRef(!1),[w=!1,_]=Qn({prop:r,defaultProp:i,onChange:A=>{A?(l.onOpen(),document.dispatchEvent(new CustomEvent(kb))):l.onClose(),o==null||o(A)}}),C=m.useMemo(()=>w?x.current?"delayed-open":"instant-open":"closed",[w]),O=m.useCallback(()=>{window.clearTimeout(p.current),x.current=!1,_(!0)},[_]),P=m.useCallback(()=>{window.clearTimeout(p.current),_(!1)},[_]),k=m.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{x.current=!0,_(!0)},y)},[y,_]);return m.useEffect(()=>()=>window.clearTimeout(p.current),[]),m.createElement(_u,c,m.createElement(cB,{scope:t,contentId:g,open:w,stateAttribute:C,trigger:d,onTriggerChange:f,onTriggerEnter:m.useCallback(()=>{l.isOpenDelayed?k():O()},[l.isOpenDelayed,k,O]),onTriggerLeave:m.useCallback(()=>{v?P():window.clearTimeout(p.current)},[P,v]),onOpen:O,onClose:P,disableHoverableContent:v},n))},x2="TooltipTrigger",w2=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=Oh(x2,n),o=Mb(x2,n),s=Ob(n),a=m.useRef(null),l=et(t,a,i.onTriggerChange),c=m.useRef(!1),d=m.useRef(!1),f=m.useCallback(()=>c.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),m.createElement(Su,le({asChild:!0},s),m.createElement(Be.button,le({"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute},r,{ref:l,onPointerMove:Ce(e.onPointerMove,g=>{g.pointerType!=="touch"&&!d.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),d.current=!0)}),onPointerLeave:Ce(e.onPointerLeave,()=>{i.onTriggerLeave(),d.current=!1}),onPointerDown:Ce(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:Ce(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:Ce(e.onBlur,i.onClose),onClick:Ce(e.onClick,i.onClose)})))}),dB="TooltipPortal",[ade,fB]=Ph(dB,{forceMount:void 0}),Eu="TooltipContent",hB=m.forwardRef((e,t)=>{const n=fB(Eu,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...o}=e,s=Oh(Eu,e.__scopeTooltip);return m.createElement(vn,{present:r||s.open},s.disableHoverableContent?m.createElement(_2,le({side:i},o,{ref:t})):m.createElement(pB,le({side:i},o,{ref:t})))}),pB=m.forwardRef((e,t)=>{const n=Oh(Eu,e.__scopeTooltip),r=Mb(Eu,e.__scopeTooltip),i=m.useRef(null),o=et(t,i),[s,a]=m.useState(null),{trigger:l,onClose:c}=n,d=i.current,{onPointerInTransitChange:f}=r,g=m.useCallback(()=>{a(null),f(!1)},[f]),p=m.useCallback((v,y)=>{const x=v.currentTarget,w={x:v.clientX,y:v.clientY},_=mB(w,x.getBoundingClientRect()),C=vB(w,_),O=bB(y.getBoundingClientRect()),P=xB([...C,...O]);a(P),f(!0)},[f]);return m.useEffect(()=>()=>g(),[g]),m.useEffect(()=>{if(l&&d){const v=x=>p(x,d),y=x=>p(x,l);return l.addEventListener("pointerleave",v),d.addEventListener("pointerleave",y),()=>{l.removeEventListener("pointerleave",v),d.removeEventListener("pointerleave",y)}}},[l,d,p,g]),m.useEffect(()=>{if(s){const v=y=>{const x=y.target,w={x:y.clientX,y:y.clientY},_=(l==null?void 0:l.contains(x))||(d==null?void 0:d.contains(x)),C=!yB(w,s);_?g():C&&(g(),c())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[l,d,s,c,g]),m.createElement(_2,le({},e,{ref:o}))}),[gB,lde]=Ph(Db,{isInside:!1}),_2=m.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:s,...a}=e,l=Oh(Eu,n),c=Ob(n),{onClose:d}=l;return m.useEffect(()=>(document.addEventListener(kb,d),()=>document.removeEventListener(kb,d)),[d]),m.useEffect(()=>{if(l.trigger){const f=g=>{const p=g.target;p!=null&&p.contains(l.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,d]),m.createElement(vl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:d},m.createElement(Cu,le({"data-state":l.stateAttribute},c,a,{ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"}}),m.createElement(Fw,null,r),m.createElement(gB,{scope:n,isInside:!0},m.createElement(iB,{id:l.contentId,role:"tooltip"},i||r))))});function mB(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,i,o)){case o:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function vB(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function bB(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function yB(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 xB(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),wB(t)}function wB(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const i=e[r];for(;t.length>=2;){const o=t[t.length-1],s=t[t.length-2];if((o.x-s.x)*(i.y-s.y)>=(o.y-s.y)*(i.x-s.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const o=n[n.length-1],s=n[n.length-2];if((o.x-s.x)*(i.y-s.y)>=(o.y-s.y)*(i.x-s.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}const _B=lB,SB=uB,CB=w2,S2=hB,EB=_B,Tb=SB,C2=CB,kh=ue.forwardRef(({className:e,sideOffset:t=4,...n},r)=>S.jsx(S2,{ref:r,sideOffset:t,className:Oe("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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}));kh.displayName=S2.displayName;const E2=ue.forwardRef(({className:e,...t},n)=>S.jsx("div",{className:"relative w-full overflow-auto",children:S.jsx("table",{ref:n,className:Oe("w-full caption-bottom text-sm",e),...t})}));E2.displayName="Table";const P2=ue.forwardRef(({className:e,...t},n)=>S.jsx("thead",{ref:n,className:Oe("[&_tr]:border-b",e),...t}));P2.displayName="TableHeader";const O2=ue.forwardRef(({className:e,...t},n)=>S.jsx("tbody",{ref:n,className:Oe("[&_tr:last-child]:border-0",e),...t}));O2.displayName="TableBody";const PB=ue.forwardRef(({className:e,...t},n)=>S.jsx("tfoot",{ref:n,className:Oe("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));PB.displayName="TableFooter";const Mh=ue.forwardRef(({className:e,...t},n)=>S.jsx("tr",{ref:n,className:Oe("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));Mh.displayName="TableRow";const k2=ue.forwardRef(({className:e,...t},n)=>S.jsx("th",{ref:n,className:Oe("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));k2.displayName="TableHead";const Ab=ue.forwardRef(({className:e,...t},n)=>S.jsx("td",{ref:n,className:Oe("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));Ab.displayName="TableCell";const OB=ue.forwardRef(({className:e,...t},n)=>S.jsx("caption",{ref:n,className:Oe("mt-4 text-sm text-muted-foreground",e),...t}));OB.displayName="TableCaption";/**
|
|
130
|
+
* @license lucide-react v0.298.0 - ISC
|
|
131
|
+
*
|
|
132
|
+
* This source code is licensed under the ISC license.
|
|
133
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
134
|
+
*/var kB={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
135
|
+
* @license lucide-react v0.298.0 - ISC
|
|
136
|
+
*
|
|
137
|
+
* This source code is licensed under the ISC license.
|
|
138
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
139
|
+
*/const MB=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),Lt=(e,t)=>{const n=m.forwardRef(({color:r="currentColor",size:i=24,strokeWidth:o=2,absoluteStrokeWidth:s,className:a="",children:l,...c},d)=>m.createElement("svg",{ref:d,...kB,width:i,height:i,stroke:r,strokeWidth:s?Number(o)*24/Number(i):o,className:["lucide",`lucide-${MB(e)}`,a].join(" "),...c},[...t.map(([f,g])=>m.createElement(f,g)),...Array.isArray(l)?l:[l]]));return n.displayName=`${e}`,n};/**
|
|
140
|
+
* @license lucide-react v0.298.0 - ISC
|
|
141
|
+
*
|
|
142
|
+
* This source code is licensed under the ISC license.
|
|
143
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
144
|
+
*/const DB=Lt("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
|
|
145
|
+
* @license lucide-react v0.298.0 - ISC
|
|
146
|
+
*
|
|
147
|
+
* This source code is licensed under the ISC license.
|
|
148
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
149
|
+
*/const TB=Lt("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
|
|
150
|
+
* @license lucide-react v0.298.0 - ISC
|
|
151
|
+
*
|
|
152
|
+
* This source code is licensed under the ISC license.
|
|
153
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
154
|
+
*/const M2=Lt("BarChart3",[["path",{d:"M3 3v18h18",key:"1s2lah"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/**
|
|
155
|
+
* @license lucide-react v0.298.0 - ISC
|
|
156
|
+
*
|
|
157
|
+
* This source code is licensed under the ISC license.
|
|
158
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
159
|
+
*/const AB=Lt("Calendar",[["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",ry:"2",key:"eu3xkr"}],["line",{x1:"16",x2:"16",y1:"2",y2:"6",key:"m3sa8f"}],["line",{x1:"8",x2:"8",y1:"2",y2:"6",key:"18kwsl"}],["line",{x1:"3",x2:"21",y1:"10",y2:"10",key:"xt86sb"}]]);/**
|
|
160
|
+
* @license lucide-react v0.298.0 - ISC
|
|
161
|
+
*
|
|
162
|
+
* This source code is licensed under the ISC license.
|
|
163
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
164
|
+
*/const Ib=Lt("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
165
|
+
* @license lucide-react v0.298.0 - ISC
|
|
166
|
+
*
|
|
167
|
+
* This source code is licensed under the ISC license.
|
|
168
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
169
|
+
*/const Rb=Lt("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
170
|
+
* @license lucide-react v0.298.0 - ISC
|
|
171
|
+
*
|
|
172
|
+
* This source code is licensed under the ISC license.
|
|
173
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
174
|
+
*/const IB=Lt("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
175
|
+
* @license lucide-react v0.298.0 - ISC
|
|
176
|
+
*
|
|
177
|
+
* This source code is licensed under the ISC license.
|
|
178
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
179
|
+
*/const D2=Lt("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
180
|
+
* @license lucide-react v0.298.0 - ISC
|
|
181
|
+
*
|
|
182
|
+
* This source code is licensed under the ISC license.
|
|
183
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
184
|
+
*/const RB=Lt("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
185
|
+
* @license lucide-react v0.298.0 - ISC
|
|
186
|
+
*
|
|
187
|
+
* This source code is licensed under the ISC license.
|
|
188
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
189
|
+
*/const T2=Lt("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
190
|
+
* @license lucide-react v0.298.0 - ISC
|
|
191
|
+
*
|
|
192
|
+
* This source code is licensed under the ISC license.
|
|
193
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
194
|
+
*/const NB=Lt("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
|
|
195
|
+
* @license lucide-react v0.298.0 - ISC
|
|
196
|
+
*
|
|
197
|
+
* This source code is licensed under the ISC license.
|
|
198
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
199
|
+
*/const LB=Lt("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
|
|
200
|
+
* @license lucide-react v0.298.0 - ISC
|
|
201
|
+
*
|
|
202
|
+
* This source code is licensed under the ISC license.
|
|
203
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
204
|
+
*/const A2=Lt("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
|
|
205
|
+
* @license lucide-react v0.298.0 - ISC
|
|
206
|
+
*
|
|
207
|
+
* This source code is licensed under the ISC license.
|
|
208
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
209
|
+
*/const $B=Lt("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"}]]);/**
|
|
210
|
+
* @license lucide-react v0.298.0 - ISC
|
|
211
|
+
*
|
|
212
|
+
* This source code is licensed under the ISC license.
|
|
213
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
214
|
+
*/const I2=Lt("LineChart",[["path",{d:"M3 3v18h18",key:"1s2lah"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]]);/**
|
|
215
|
+
* @license lucide-react v0.298.0 - ISC
|
|
216
|
+
*
|
|
217
|
+
* This source code is licensed under the ISC license.
|
|
218
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
219
|
+
*/const Pu=Lt("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
220
|
+
* @license lucide-react v0.298.0 - ISC
|
|
221
|
+
*
|
|
222
|
+
* This source code is licensed under the ISC license.
|
|
223
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
224
|
+
*/const FB=Lt("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
|
225
|
+
* @license lucide-react v0.298.0 - ISC
|
|
226
|
+
*
|
|
227
|
+
* This source code is licensed under the ISC license.
|
|
228
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
229
|
+
*/const jB=Lt("Pencil",[["path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z",key:"5qss01"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
|
|
230
|
+
* @license lucide-react v0.298.0 - ISC
|
|
231
|
+
*
|
|
232
|
+
* This source code is licensed under the ISC license.
|
|
233
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
234
|
+
*/const R2=Lt("PieChart",[["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}],["path",{d:"M22 12A10 10 0 0 0 12 2v10z",key:"1rfc4y"}]]);/**
|
|
235
|
+
* @license lucide-react v0.298.0 - ISC
|
|
236
|
+
*
|
|
237
|
+
* This source code is licensed under the ISC license.
|
|
238
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
239
|
+
*/const zB=Lt("Plug2",[["path",{d:"M9 2v6",key:"17ngun"}],["path",{d:"M15 2v6",key:"s7yy2p"}],["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M5 8h14",key:"pcz4l3"}],["path",{d:"M6 11V8h12v3a6 6 0 1 1-12 0v0Z",key:"nd4hoy"}]]);/**
|
|
240
|
+
* @license lucide-react v0.298.0 - ISC
|
|
241
|
+
*
|
|
242
|
+
* This source code is licensed under the ISC license.
|
|
243
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
244
|
+
*/const BB=Lt("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
245
|
+
* @license lucide-react v0.298.0 - ISC
|
|
246
|
+
*
|
|
247
|
+
* This source code is licensed under the ISC license.
|
|
248
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
249
|
+
*/const HB=Lt("Save",[["path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z",key:"1owoqh"}],["polyline",{points:"17 21 17 13 7 13 7 21",key:"1md35c"}],["polyline",{points:"7 3 7 8 15 8",key:"8nz8an"}]]);/**
|
|
250
|
+
* @license lucide-react v0.298.0 - ISC
|
|
251
|
+
*
|
|
252
|
+
* This source code is licensed under the ISC license.
|
|
253
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
254
|
+
*/const N2=Lt("ScatterChart",[["circle",{cx:"7.5",cy:"7.5",r:".5",key:"1x97lo"}],["circle",{cx:"18.5",cy:"5.5",r:".5",key:"56iowl"}],["circle",{cx:"11.5",cy:"11.5",r:".5",key:"m9xkw9"}],["circle",{cx:"7.5",cy:"16.5",r:".5",key:"14ln9z"}],["circle",{cx:"17.5",cy:"14.5",r:".5",key:"14qxqt"}],["path",{d:"M3 3v18h18",key:"1s2lah"}]]);/**
|
|
255
|
+
* @license lucide-react v0.298.0 - ISC
|
|
256
|
+
*
|
|
257
|
+
* This source code is licensed under the ISC license.
|
|
258
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
259
|
+
*/const VB=Lt("Sparkles",[["path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z",key:"17u4zn"}],["path",{d:"M5 3v4",key:"bklmnn"}],["path",{d:"M19 17v4",key:"iiml17"}],["path",{d:"M3 5h4",key:"nem4j1"}],["path",{d:"M17 19h4",key:"lbex7p"}]]);/**
|
|
260
|
+
* @license lucide-react v0.298.0 - ISC
|
|
261
|
+
*
|
|
262
|
+
* This source code is licensed under the ISC license.
|
|
263
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
264
|
+
*/const WB=Lt("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
|
|
265
|
+
* @license lucide-react v0.298.0 - ISC
|
|
266
|
+
*
|
|
267
|
+
* This source code is licensed under the ISC license.
|
|
268
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
269
|
+
*/const qB=Lt("Table2",[["path",{d:"M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18",key:"gugj83"}]]);/**
|
|
270
|
+
* @license lucide-react v0.298.0 - ISC
|
|
271
|
+
*
|
|
272
|
+
* This source code is licensed under the ISC license.
|
|
273
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
274
|
+
*/const Nb=Lt("Table",[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]]);/**
|
|
275
|
+
* @license lucide-react v0.298.0 - ISC
|
|
276
|
+
*
|
|
277
|
+
* This source code is licensed under the ISC license.
|
|
278
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
279
|
+
*/const UB=Lt("XCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
|
|
280
|
+
* @license lucide-react v0.298.0 - ISC
|
|
281
|
+
*
|
|
282
|
+
* This source code is licensed under the ISC license.
|
|
283
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
284
|
+
*/const GB=Lt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
285
|
+
* table-core
|
|
286
|
+
*
|
|
287
|
+
* Copyright (c) TanStack
|
|
288
|
+
*
|
|
289
|
+
* This source code is licensed under the MIT license found in the
|
|
290
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
291
|
+
*
|
|
292
|
+
* @license MIT
|
|
293
|
+
*/function Zo(e,t){return typeof e=="function"?e(t):e}function Dr(e,t){return n=>{t.setState(r=>({...r,[e]:Zo(n,r[e])}))}}function Dh(e){return e instanceof Function}function YB(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function KB(e,t){const n=[],r=i=>{i.forEach(o=>{n.push(o);const s=t(o);s!=null&&s.length&&r(s)})};return r(e),n}function Qe(e,t,n){let r=[],i;return()=>{let o;n.key&&n.debug&&(o=Date.now());const s=e();if(!(s.length!==r.length||s.some((c,d)=>r[d]!==c)))return i;r=s;let l;if(n.key&&n.debug&&(l=Date.now()),i=t(...s),n==null||n.onChange==null||n.onChange(i),n.key&&n.debug&&n!=null&&n.debug()){const c=Math.round((Date.now()-o)*100)/100,d=Math.round((Date.now()-l)*100)/100,f=d/16,g=(p,v)=>{for(p=String(p);p.length<v;)p=" "+p;return p};console.info(`%c⏱ ${g(d,5)} /${g(c,5)} ms`,`
|
|
294
|
+
font-size: .6rem;
|
|
295
|
+
font-weight: bold;
|
|
296
|
+
color: hsl(${Math.max(0,Math.min(120-120*f,120))}deg 100% 31%);`,n==null?void 0:n.key)}return i}}function XB(e,t,n,r){var i,o;const a={...e._getDefaultColumnDef(),...t},l=a.accessorKey;let c=(i=(o=a.id)!=null?o:l?l.replace(".","_"):void 0)!=null?i:typeof a.header=="string"?a.header:void 0,d;if(a.accessorFn?d=a.accessorFn:l&&(l.includes(".")?d=g=>{let p=g;for(const y of l.split(".")){var v;p=(v=p)==null?void 0:v[y],process.env.NODE_ENV!=="production"&&p===void 0&&console.warn(`"${y}" in deeply nested key "${l}" returned undefined.`)}return p}:d=g=>g[a.accessorKey]),!c)throw process.env.NODE_ENV!=="production"?new Error(a.accessorFn?"Columns require an id when using an accessorFn":"Columns require an id when using a non-string header"):new Error;let f={id:`${String(c)}`,accessorFn:d,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:Qe(()=>[!0],()=>{var g;return[f,...(g=f.columns)==null?void 0:g.flatMap(p=>p.getFlatColumns())]},{key:process.env.NODE_ENV==="production"&&"column.getFlatColumns",debug:()=>{var g;return(g=e.options.debugAll)!=null?g:e.options.debugColumns}}),getLeafColumns:Qe(()=>[e._getOrderColumnsFn()],g=>{var p;if((p=f.columns)!=null&&p.length){let v=f.columns.flatMap(y=>y.getLeafColumns());return g(v)}return[f]},{key:process.env.NODE_ENV==="production"&&"column.getLeafColumns",debug:()=>{var g;return(g=e.options.debugAll)!=null?g:e.options.debugColumns}})};for(const g of e._features)g.createColumn==null||g.createColumn(f,e);return f}function L2(e,t,n){var r;let o={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const s=[],a=l=>{l.subHeaders&&l.subHeaders.length&&l.subHeaders.map(a),s.push(l)};return a(o),s},getContext:()=>({table:e,header:o,column:t})};return e._features.forEach(s=>{s.createHeader==null||s.createHeader(o,e)}),o}const QB={createTable:e=>{e.getHeaderGroups=Qe(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,i)=>{var o,s;const a=(o=r==null?void 0:r.map(f=>n.find(g=>g.id===f)).filter(Boolean))!=null?o:[],l=(s=i==null?void 0:i.map(f=>n.find(g=>g.id===f)).filter(Boolean))!=null?s:[],c=n.filter(f=>!(r!=null&&r.includes(f.id))&&!(i!=null&&i.includes(f.id)));return Th(t,[...a,...c,...l],e)},{key:process.env.NODE_ENV==="development"&&"getHeaderGroups",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getCenterHeaderGroups=Qe(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,i)=>(n=n.filter(o=>!(r!=null&&r.includes(o.id))&&!(i!=null&&i.includes(o.id))),Th(t,n,e,"center")),{key:process.env.NODE_ENV==="development"&&"getCenterHeaderGroups",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getLeftHeaderGroups=Qe(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var i;const o=(i=r==null?void 0:r.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?i:[];return Th(t,o,e,"left")},{key:process.env.NODE_ENV==="development"&&"getLeftHeaderGroups",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getRightHeaderGroups=Qe(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var i;const o=(i=r==null?void 0:r.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?i:[];return Th(t,o,e,"right")},{key:process.env.NODE_ENV==="development"&&"getRightHeaderGroups",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getFooterGroups=Qe(()=>[e.getHeaderGroups()],t=>[...t].reverse(),{key:process.env.NODE_ENV==="development"&&"getFooterGroups",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getLeftFooterGroups=Qe(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),{key:process.env.NODE_ENV==="development"&&"getLeftFooterGroups",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getCenterFooterGroups=Qe(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),{key:process.env.NODE_ENV==="development"&&"getCenterFooterGroups",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getRightFooterGroups=Qe(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),{key:process.env.NODE_ENV==="development"&&"getRightFooterGroups",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getFlatHeaders=Qe(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),{key:process.env.NODE_ENV==="development"&&"getFlatHeaders",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getLeftFlatHeaders=Qe(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),{key:process.env.NODE_ENV==="development"&&"getLeftFlatHeaders",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getCenterFlatHeaders=Qe(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),{key:process.env.NODE_ENV==="development"&&"getCenterFlatHeaders",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getRightFlatHeaders=Qe(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),{key:process.env.NODE_ENV==="development"&&"getRightFlatHeaders",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getCenterLeafHeaders=Qe(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),{key:process.env.NODE_ENV==="development"&&"getCenterLeafHeaders",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getLeftLeafHeaders=Qe(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),{key:process.env.NODE_ENV==="development"&&"getLeftLeafHeaders",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getRightLeafHeaders=Qe(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),{key:process.env.NODE_ENV==="development"&&"getRightLeafHeaders",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getLeafHeaders=Qe(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var i,o,s,a,l,c;return[...(i=(o=t[0])==null?void 0:o.headers)!=null?i:[],...(s=(a=n[0])==null?void 0:a.headers)!=null?s:[],...(l=(c=r[0])==null?void 0:c.headers)!=null?l:[]].map(d=>d.getLeafHeaders()).flat()},{key:process.env.NODE_ENV==="development"&&"getLeafHeaders",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}})}};function Th(e,t,n,r){var i,o;let s=0;const a=function(g,p){p===void 0&&(p=1),s=Math.max(s,p),g.filter(v=>v.getIsVisible()).forEach(v=>{var y;(y=v.columns)!=null&&y.length&&a(v.columns,p+1)},0)};a(e);let l=[];const c=(g,p)=>{const v={depth:p,id:[r,`${p}`].filter(Boolean).join("_"),headers:[]},y=[];g.forEach(x=>{const w=[...y].reverse()[0],_=x.column.depth===v.depth;let C,O=!1;if(_&&x.column.parent?C=x.column.parent:(C=x.column,O=!0),w&&(w==null?void 0:w.column)===C)w.subHeaders.push(x);else{const P=L2(n,C,{id:[r,p,C.id,x==null?void 0:x.id].filter(Boolean).join("_"),isPlaceholder:O,placeholderId:O?`${y.filter(k=>k.column===C).length}`:void 0,depth:p,index:y.length});P.subHeaders.push(x),y.push(P)}v.headers.push(x),x.headerGroup=v}),l.push(v),p>0&&c(y,p-1)},d=t.map((g,p)=>L2(n,g,{depth:s,index:p}));c(d,s-1),l.reverse();const f=g=>g.filter(v=>v.column.getIsVisible()).map(v=>{let y=0,x=0,w=[0];v.subHeaders&&v.subHeaders.length?(w=[],f(v.subHeaders).forEach(C=>{let{colSpan:O,rowSpan:P}=C;y+=O,w.push(P)})):y=1;const _=Math.min(...w);return x=x+_,v.colSpan=y,v.rowSpan=x,{colSpan:y,rowSpan:x}});return f((i=(o=l[0])==null?void 0:o.headers)!=null?i:[]),l}const Ah={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Lb=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),ZB={getDefaultColumnDef:()=>Ah,getInitialState:e=>({columnSizing:{},columnSizingInfo:Lb(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Dr("columnSizing",e),onColumnSizingInfoChange:Dr("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,i;const o=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:Ah.minSize,(r=o??e.columnDef.size)!=null?r:Ah.size),(i=e.columnDef.maxSize)!=null?i:Ah.maxSize)},e.getStart=n=>{const r=n?n==="left"?t.getLeftVisibleLeafColumns():t.getRightVisibleLeafColumns():t.getVisibleLeafColumns(),i=r.findIndex(o=>o.id===e.id);if(i>0){const o=r[i-1];return o.getStart(n)+o.getSize()}return 0},e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...i}=n;return i})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=i=>{if(i.subHeaders.length)i.subHeaders.forEach(r);else{var o;n+=(o=i.column.getSize())!=null?o:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),i=r==null?void 0:r.getCanResize();return o=>{if(!r||!i||(o.persist==null||o.persist(),$b(o)&&o.touches&&o.touches.length>1))return;const s=e.getSize(),a=e?e.getLeafHeaders().map(w=>[w.column.id,w.column.getSize()]):[[r.id,r.getSize()]],l=$b(o)?Math.round(o.touches[0].clientX):o.clientX,c={},d=(w,_)=>{typeof _=="number"&&(t.setColumnSizingInfo(C=>{var O,P;const k=t.options.columnResizeDirection==="rtl"?-1:1,A=(_-((O=C==null?void 0:C.startOffset)!=null?O:0))*k,L=Math.max(A/((P=C==null?void 0:C.startSize)!=null?P:0),-.999999);return C.columnSizingStart.forEach(F=>{let[B,H]=F;c[B]=Math.round(Math.max(H+H*L,0)*100)/100}),{...C,deltaOffset:A,deltaPercentage:L}}),(t.options.columnResizeMode==="onChange"||w==="end")&&t.setColumnSizing(C=>({...C,...c})))},f=w=>d("move",w),g=w=>{d("end",w),t.setColumnSizingInfo(_=>({..._,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},p=n||typeof document<"u"?document:null,v={moveHandler:w=>f(w.clientX),upHandler:w=>{p==null||p.removeEventListener("mousemove",v.moveHandler),p==null||p.removeEventListener("mouseup",v.upHandler),g(w.clientX)}},y={moveHandler:w=>(w.cancelable&&(w.preventDefault(),w.stopPropagation()),f(w.touches[0].clientX),!1),upHandler:w=>{var _;p==null||p.removeEventListener("touchmove",y.moveHandler),p==null||p.removeEventListener("touchend",y.upHandler),w.cancelable&&(w.preventDefault(),w.stopPropagation()),g((_=w.touches[0])==null?void 0:_.clientX)}},x=JB()?{passive:!1}:!1;$b(o)?(p==null||p.addEventListener("touchmove",y.moveHandler,x),p==null||p.addEventListener("touchend",y.upHandler,x)):(p==null||p.addEventListener("mousemove",v.moveHandler,x),p==null||p.addEventListener("mouseup",v.upHandler,x)),t.setColumnSizingInfo(w=>({...w,startOffset:l,startSize:s,deltaOffset:0,deltaPercentage:0,columnSizingStart:a,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?Lb():(n=e.initialState.columnSizingInfo)!=null?n:Lb())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0}}};let Ih=null;function JB(){if(typeof Ih=="boolean")return Ih;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return Ih=e,Ih}function $b(e){return e.type==="touchstart"}const eH={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Dr("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,i;if(!t){e._queue(()=>{t=!0});return}if((r=(i=e.options.autoResetAll)!=null?i:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var i,o;e.setExpanded(r?{}:(i=(o=e.initialState)==null?void 0:o.expanded)!=null?i:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(i=>!i.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(o=>{const s=o.split(".");r=Math.max(r,s.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var i;const o=r===!0?!0:!!(r!=null&&r[e.id]);let s={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(a=>{s[a]=!0}):s=r,n=(i=n)!=null?i:!o,!o&&n)return{...s,[e.id]:!0};if(o&&!n){const{[e.id]:a,...l}=s;return l}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r!=null&&r[e.id])},e.getCanExpand=()=>{var n,r,i;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((i=e.subRows)!=null&&i.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},$2=(e,t,n)=>{var r;const i=n.toLowerCase();return!!(!((r=e.getValue(t))==null||(r=r.toString())==null||(r=r.toLowerCase())==null)&&r.includes(i))};$2.autoRemove=e=>bi(e);const F2=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};F2.autoRemove=e=>bi(e);const j2=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===(n==null?void 0:n.toLowerCase())};j2.autoRemove=e=>bi(e);const z2=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};z2.autoRemove=e=>bi(e)||!(e!=null&&e.length);const B2=(e,t,n)=>!n.some(r=>{var i;return!((i=e.getValue(t))!=null&&i.includes(r))});B2.autoRemove=e=>bi(e)||!(e!=null&&e.length);const H2=(e,t,n)=>n.some(r=>{var i;return(i=e.getValue(t))==null?void 0:i.includes(r)});H2.autoRemove=e=>bi(e)||!(e!=null&&e.length);const V2=(e,t,n)=>e.getValue(t)===n;V2.autoRemove=e=>bi(e);const W2=(e,t,n)=>e.getValue(t)==n;W2.autoRemove=e=>bi(e);const Fb=(e,t,n)=>{let[r,i]=n;const o=e.getValue(t);return o>=r&&o<=i};Fb.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,i=typeof n!="number"?parseFloat(n):n,o=t===null||Number.isNaN(r)?-1/0:r,s=n===null||Number.isNaN(i)?1/0:i;if(o>s){const a=o;o=s,s=a}return[o,s]},Fb.autoRemove=e=>bi(e)||bi(e[0])&&bi(e[1]);const bo={includesString:$2,includesStringSensitive:F2,equalsString:j2,arrIncludes:z2,arrIncludesAll:B2,arrIncludesSome:H2,equals:V2,weakEquals:W2,inNumberRange:Fb};function bi(e){return e==null||e===""}const tH={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],globalFilter:void 0,...e}),getDefaultOptions:e=>({onColumnFiltersChange:Dr("columnFilters",e),onGlobalFilterChange:Dr("globalFilter",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100,globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);return typeof r=="string"?bo.includesString:typeof r=="number"?bo.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?bo.equals:Array.isArray(r)?bo.arrIncludes:bo.weakEquals},e.getFilterFn=()=>{var n,r;return Dh(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:bo[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,i;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((i=t.options.enableFilters)!=null?i:!0)&&!!e.accessorFn},e.getCanGlobalFilter=()=>{var n,r,i,o;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((i=t.options.enableFilters)!=null?i:!0)&&((o=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?o:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(i=>i.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const i=e.getFilterFn(),o=r==null?void 0:r.find(d=>d.id===e.id),s=Zo(n,o?o.value:void 0);if(q2(i,s,e)){var a;return(a=r==null?void 0:r.filter(d=>d.id!==e.id))!=null?a:[]}const l={id:e.id,value:s};if(o){var c;return(c=r==null?void 0:r.map(d=>d.id===e.id?l:d))!=null?c:[]}return r!=null&&r.length?[...r,l]:[l]})},e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.getGlobalAutoFilterFn=()=>bo.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return Dh(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:bo[r]},e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=i=>{var o;return(o=Zo(t,i))==null?void 0:o.filter(s=>{const a=n.find(l=>l.id===s.id);if(a){const l=a.getFilterFn();if(q2(l,s.value,a))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel()),e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}};function q2(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const jb={sum:(e,t,n)=>n.reduce((r,i)=>{const o=i.getValue(e);return r+(typeof o=="number"?o:0)},0),min:(e,t,n)=>{let r;return n.forEach(i=>{const o=i.getValue(e);o!=null&&(r>o||r===void 0&&o>=o)&&(r=o)}),r},max:(e,t,n)=>{let r;return n.forEach(i=>{const o=i.getValue(e);o!=null&&(r<o||r===void 0&&o>=o)&&(r=o)}),r},extent:(e,t,n)=>{let r,i;return n.forEach(o=>{const s=o.getValue(e);s!=null&&(r===void 0?s>=s&&(r=i=s):(r>s&&(r=s),i<s&&(i=s)))}),[r,i]},mean:(e,t)=>{let n=0,r=0;if(t.forEach(i=>{let o=i.getValue(e);o!=null&&(o=+o)>=o&&(++n,r+=o)}),n)return r/n},median:(e,t)=>{if(!t.length)return;const n=t.map(o=>o.getValue(e));if(!YB(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),i=n.sort((o,s)=>o-s);return n.length%2!==0?i[r]:(i[r-1]+i[r])/2},unique:(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),uniqueCount:(e,t)=>new Set(t.map(n=>n.getValue(e))).size,count:(e,t)=>t.length},nH={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Dr("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r,i,o;return(n=(r=(i=(o=e.columnDef.enableGrouping)!=null?o:!0)!=null?i:t.options.enableGrouping)!=null?r:!0)!=null?n:!!e.accessorFn},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);if(typeof r=="number")return jb.sum;if(Object.prototype.toString.call(r)==="[object Date]")return jb.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return Dh(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:jb[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var i;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((i=n.subRows)!=null&&i.length)}}};function rH(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(o=>!t.includes(o.id));return n==="remove"?r:[...t.map(o=>e.find(s=>s.id===o)).filter(Boolean),...r]}const iH={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Dr("columnOrder",e)}),createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=Qe(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>i=>{let o=[];if(!(t!=null&&t.length))o=i;else{const s=[...t],a=[...i];for(;a.length&&s.length;){const l=s.shift(),c=a.findIndex(d=>d.id===l);c>-1&&o.push(a.splice(c,1)[0])}o=[...o,...a]}return rH(o,n,r)},{key:process.env.NODE_ENV==="development"&&"getOrderColumnsFn"})}},zb=0,Bb=10,Hb=()=>({pageIndex:zb,pageSize:Bb}),oH={getInitialState:e=>({...e,pagination:{...Hb(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Dr("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,i;if(!t){e._queue(()=>{t=!0});return}if((r=(i=e.options.autoResetAll)!=null?i:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const i=o=>Zo(r,o);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(i)},e.resetPagination=r=>{var i;e.setPagination(r?Hb():(i=e.initialState.pagination)!=null?i:Hb())},e.setPageIndex=r=>{e.setPagination(i=>{let o=Zo(r,i.pageIndex);const s=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return o=Math.max(0,Math.min(o,s)),{...i,pageIndex:o}})},e.resetPageIndex=r=>{var i,o;e.setPageIndex(r?zb:(i=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageIndex)!=null?i:zb)},e.resetPageSize=r=>{var i,o;e.setPageSize(r?Bb:(i=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageSize)!=null?i:Bb)},e.setPageSize=r=>{e.setPagination(i=>{const o=Math.max(1,Zo(r,i.pageSize)),s=i.pageSize*i.pageIndex,a=Math.floor(s/o);return{...i,pageIndex:a,pageSize:o}})},e.setPageCount=r=>e.setPagination(i=>{var o;let s=Zo(r,(o=e.options.pageCount)!=null?o:-1);return typeof s=="number"&&(s=Math.max(-1,s)),{...i,pageCount:s}}),e.getPageOptions=Qe(()=>[e.getPageCount()],r=>{let i=[];return r&&r>0&&(i=[...new Array(r)].fill(null).map((o,s)=>s)),i},{key:process.env.NODE_ENV==="development"&&"getPageOptions",debug:()=>{var r;return(r=e.options.debugAll)!=null?r:e.options.debugTable}}),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,i=e.getPageCount();return i===-1?!0:i===0?!1:r<i-1},e.previousPage=()=>e.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getPrePaginationRowModel().rows.length/e.getState().pagination.pageSize)}}},Vb=()=>({left:[],right:[]}),Wb=()=>({top:[],bottom:[]}),sH={getInitialState:e=>({columnPinning:Vb(),rowPinning:Wb(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Dr("columnPinning",e),onRowPinningChange:Dr("rowPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(i=>i.id).filter(Boolean);t.setColumnPinning(i=>{var o,s;if(n==="right"){var a,l;return{left:((a=i==null?void 0:i.left)!=null?a:[]).filter(f=>!(r!=null&&r.includes(f))),right:[...((l=i==null?void 0:i.right)!=null?l:[]).filter(f=>!(r!=null&&r.includes(f))),...r]}}if(n==="left"){var c,d;return{left:[...((c=i==null?void 0:i.left)!=null?c:[]).filter(f=>!(r!=null&&r.includes(f))),...r],right:((d=i==null?void 0:i.right)!=null?d:[]).filter(f=>!(r!=null&&r.includes(f)))}}return{left:((o=i==null?void 0:i.left)!=null?o:[]).filter(f=>!(r!=null&&r.includes(f))),right:((s=i==null?void 0:i.right)!=null?s:[]).filter(f=>!(r!=null&&r.includes(f)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var i,o,s;return((i=r.columnDef.enablePinning)!=null?i:!0)&&((o=(s=t.options.enableColumnPinning)!=null?s:t.options.enablePinning)!=null?o:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(a=>a.id),{left:r,right:i}=t.getState().columnPinning,o=n.some(a=>r==null?void 0:r.includes(a)),s=n.some(a=>i==null?void 0:i.includes(a));return o?"left":s?"right":!1},e.getPinnedIndex=()=>{var n,r;const i=e.getIsPinned();return i?(n=(r=t.getState().columnPinning)==null||(r=r[i])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.pin=(n,r,i)=>{const o=r?e.getLeafRows().map(l=>{let{id:c}=l;return c}):[],s=i?e.getParentRows().map(l=>{let{id:c}=l;return c}):[],a=new Set([...s,e.id,...o]);t.setRowPinning(l=>{var c,d;if(n==="bottom"){var f,g;return{top:((f=l==null?void 0:l.top)!=null?f:[]).filter(y=>!(a!=null&&a.has(y))),bottom:[...((g=l==null?void 0:l.bottom)!=null?g:[]).filter(y=>!(a!=null&&a.has(y))),...Array.from(a)]}}if(n==="top"){var p,v;return{top:[...((p=l==null?void 0:l.top)!=null?p:[]).filter(y=>!(a!=null&&a.has(y))),...Array.from(a)],bottom:((v=l==null?void 0:l.bottom)!=null?v:[]).filter(y=>!(a!=null&&a.has(y)))}}return{top:((c=l==null?void 0:l.top)!=null?c:[]).filter(y=>!(a!=null&&a.has(y))),bottom:((d=l==null?void 0:l.bottom)!=null?d:[]).filter(y=>!(a!=null&&a.has(y)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:i}=t.options;return typeof r=="function"?r(e):(n=r??i)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:i}=t.getState().rowPinning,o=n.some(a=>r==null?void 0:r.includes(a)),s=n.some(a=>i==null?void 0:i.includes(a));return o?"top":s?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const i=e.getIsPinned();if(!i)return-1;const o=(n=t._getPinnedRows(i))==null?void 0:n.map(s=>{let{id:a}=s;return a});return(r=o==null?void 0:o.indexOf(e.id))!=null?r:-1},e.getCenterVisibleCells=Qe(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,i)=>{const o=[...r??[],...i??[]];return n.filter(s=>!o.includes(s.column.id))},{key:process.env.NODE_ENV==="development"&&"row.getCenterVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}}),e.getLeftVisibleCells=Qe(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,,],(n,r)=>(r??[]).map(o=>n.find(s=>s.column.id===o)).filter(Boolean).map(o=>({...o,position:"left"})),{key:process.env.NODE_ENV==="development"&&"row.getLeftVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}}),e.getRightVisibleCells=Qe(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(o=>n.find(s=>s.column.id===o)).filter(Boolean).map(o=>({...o,position:"right"})),{key:process.env.NODE_ENV==="development"&&"row.getRightVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}})},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?Vb():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:Vb())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var i,o;return!!((i=r.left)!=null&&i.length||(o=r.right)!=null&&o.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=Qe(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(i=>i.id===r)).filter(Boolean),{key:process.env.NODE_ENV==="development"&&"getLeftLeafColumns",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugColumns}}),e.getRightLeafColumns=Qe(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(i=>i.id===r)).filter(Boolean),{key:process.env.NODE_ENV==="development"&&"getRightLeafColumns",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugColumns}}),e.getCenterLeafColumns=Qe(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const i=[...n??[],...r??[]];return t.filter(o=>!i.includes(o.id))},{key:process.env.NODE_ENV==="development"&&"getCenterLeafColumns",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugColumns}}),e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?Wb():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:Wb())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var i,o;return!!((i=r.top)!=null&&i.length||(o=r.bottom)!=null&&o.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=t=>Qe(()=>[e.getRowModel().rows,e.getState().rowPinning[t]],(n,r)=>{var i;return((i=e.options.keepPinnedRows)==null||i?(r??[]).map(s=>{const a=e.getRow(s,!0);return a.getIsAllParentsExpanded()?a:null}):(r??[]).map(s=>n.find(a=>a.id===s))).filter(Boolean).map(s=>({...s,position:t}))},{key:process.env.NODE_ENV==="development"&&`row.get${t==="top"?"Top":"Bottom"}Rows`,debug:()=>{var n;return(n=e.options.debugAll)!=null?n:e.options.debugRows}})(),e.getTopRows=()=>e._getPinnedRows("top"),e.getBottomRows=()=>e._getPinnedRows("bottom"),e.getCenterRows=Qe(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const i=new Set([...n??[],...r??[]]);return t.filter(o=>!i.has(o.id))},{key:process.env.NODE_ENV==="development"&&"row.getCenterRows",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugRows}})}},aH={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Dr("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},i=e.getPreGroupedRowModel().flatRows;return t?i.forEach(o=>{o.getCanSelect()&&(r[o.id]=!0)}):i.forEach(o=>{delete r[o.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),i={...n};return e.getRowModel().rows.forEach(o=>{qb(i,o.id,r,!0,e)}),i}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=Qe(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?Ub(e,n):{rows:[],flatRows:[],rowsById:{}},{key:process.env.NODE_ENV==="development"&&"getSelectedRowModel",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable}}),e.getFilteredSelectedRowModel=Qe(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?Ub(e,n):{rows:[],flatRows:[],rowsById:{}},{key:process.env.NODE_ENV==="production"&&"getFilteredSelectedRowModel",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable}}),e.getGroupedSelectedRowModel=Qe(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?Ub(e,n):{rows:[],flatRows:[],rowsById:{}},{key:process.env.NODE_ENV==="production"&&"getGroupedSelectedRowModel",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable}}),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(i=>i.getCanSelect()&&!n[i.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(i=>i.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(i=>!n[i.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const i=e.getIsSelected();t.setRowSelection(o=>{var s;if(n=typeof n<"u"?n:!i,e.getCanSelect()&&i===n)return o;const a={...o};return qb(a,e.id,n,(s=r==null?void 0:r.selectChildren)!=null?s:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return Gb(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return Yb(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return Yb(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var i;n&&e.toggleSelected((i=r.target)==null?void 0:i.checked)}}}},qb=(e,t,n,r,i)=>{var o;const s=i.getRow(t,!0);n?(s.getCanMultiSelect()||Object.keys(e).forEach(a=>delete e[a]),s.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(o=s.subRows)!=null&&o.length&&s.getCanSelectSubRows()&&s.subRows.forEach(a=>qb(e,a.id,n,r,i))};function Ub(e,t){const n=e.getState().rowSelection,r=[],i={},o=function(s,a){return s.map(l=>{var c;const d=Gb(l,n);if(d&&(r.push(l),i[l.id]=l),(c=l.subRows)!=null&&c.length&&(l={...l,subRows:o(l.subRows)}),d)return l}).filter(Boolean)};return{rows:o(t.rows),flatRows:r,rowsById:i}}function Gb(e,t){var n;return(n=t[e.id])!=null?n:!1}function Yb(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let i=!0,o=!1;return e.subRows.forEach(s=>{if(!(o&&!i)&&(s.getCanSelect()&&(Gb(s,t)?o=!0:i=!1),s.subRows&&s.subRows.length)){const a=Yb(s,t);a==="all"?o=!0:(a==="some"&&(o=!0),i=!1)}}),i?"all":o?"some":!1}const Kb=/([0-9]+)/gm,lH=(e,t,n)=>U2(Jo(e.getValue(n)).toLowerCase(),Jo(t.getValue(n)).toLowerCase()),cH=(e,t,n)=>U2(Jo(e.getValue(n)),Jo(t.getValue(n))),uH=(e,t,n)=>Xb(Jo(e.getValue(n)).toLowerCase(),Jo(t.getValue(n)).toLowerCase()),dH=(e,t,n)=>Xb(Jo(e.getValue(n)),Jo(t.getValue(n))),fH=(e,t,n)=>{const r=e.getValue(n),i=t.getValue(n);return r>i?1:r<i?-1:0},hH=(e,t,n)=>Xb(e.getValue(n),t.getValue(n));function Xb(e,t){return e===t?0:e>t?1:-1}function Jo(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function U2(e,t){const n=e.split(Kb).filter(Boolean),r=t.split(Kb).filter(Boolean);for(;n.length&&r.length;){const i=n.shift(),o=r.shift(),s=parseInt(i,10),a=parseInt(o,10),l=[s,a].sort();if(isNaN(l[0])){if(i>o)return 1;if(o>i)return-1;continue}if(isNaN(l[1]))return isNaN(s)?-1:1;if(s>a)return 1;if(a>s)return-1}return n.length-r.length}const Ou={alphanumeric:lH,alphanumericCaseSensitive:cH,text:uH,textCaseSensitive:dH,datetime:fH,basic:hH},G2=[QB,{getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Dr("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;return(n=(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=Qe(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),{key:process.env.NODE_ENV==="production"&&"row._getAllVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}}),e.getVisibleCells=Qe(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,i)=>[...n,...r,...i],{key:process.env.NODE_ENV==="development"&&"row.getVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}})},createTable:e=>{const t=(n,r)=>Qe(()=>[r(),r().filter(i=>i.getIsVisible()).map(i=>i.id).join("_")],i=>i.filter(o=>o.getIsVisible==null?void 0:o.getIsVisible()),{key:n,debug:()=>{var i;return(i=e.options.debugAll)!=null?i:e.options.debugColumns}});e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((i,o)=>({...i,[o.id]:n||!(o.getCanHide!=null&&o.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}},iH,sH,tH,{getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Dr("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const i of n){const o=i==null?void 0:i.getValue(e.id);if(Object.prototype.toString.call(o)==="[object Date]")return Ou.datetime;if(typeof o=="string"&&(r=!0,o.split(Kb).length>1))return Ou.alphanumeric}return r?Ou.text:Ou.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(e.id))=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return Dh(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:Ou[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const i=e.getNextSortingOrder(),o=typeof n<"u"&&n!==null;t.setSorting(s=>{const a=s==null?void 0:s.find(p=>p.id===e.id),l=s==null?void 0:s.findIndex(p=>p.id===e.id);let c=[],d,f=o?n:i==="desc";if(s!=null&&s.length&&e.getCanMultiSort()&&r?a?d="toggle":d="add":s!=null&&s.length&&l!==s.length-1?d="replace":a?d="toggle":d="replace",d==="toggle"&&(o||i||(d="remove")),d==="add"){var g;c=[...s,{id:e.id,desc:f}],c.splice(0,c.length-((g=t.options.maxMultiSortColCount)!=null?g:Number.MAX_SAFE_INTEGER))}else d==="toggle"?c=s.map(p=>p.id===e.id?{...p,desc:f}:p):d==="remove"?c=s.filter(p=>p.id!==e.id):c=[{id:e.id,desc:f}];return c})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,i;const o=e.getFirstSortDir(),s=e.getIsSorted();return s?s!==o&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(i=t.options.enableMultiRemove)!=null)||i)?!1:s==="desc"?"asc":"desc":o},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(i=>i.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(i=>i.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},nH,eH,oH,aH,ZB];function pH(e){var t;(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");let n={_features:G2};const r=n._features.reduce((d,f)=>Object.assign(d,f.getDefaultOptions==null?void 0:f.getDefaultOptions(n)),{}),i=d=>n.options.mergeOptions?n.options.mergeOptions(r,d):{...r,...d};let s={...{},...(t=e.initialState)!=null?t:{}};n._features.forEach(d=>{var f;s=(f=d.getInitialState==null?void 0:d.getInitialState(s))!=null?f:s});const a=[];let l=!1;const c={_features:G2,options:{...r,...e},initialState:s,_queue:d=>{a.push(d),l||(l=!0,Promise.resolve().then(()=>{for(;a.length;)a.shift()();l=!1}).catch(f=>setTimeout(()=>{throw f})))},reset:()=>{n.setState(n.initialState)},setOptions:d=>{const f=Zo(d,n.options);n.options=i(f)},getState:()=>n.options.state,setState:d=>{n.options.onStateChange==null||n.options.onStateChange(d)},_getRowId:(d,f,g)=>{var p;return(p=n.options.getRowId==null?void 0:n.options.getRowId(d,f,g))!=null?p:`${g?[g.id,f].join("."):f}`},getCoreRowModel:()=>(n._getCoreRowModel||(n._getCoreRowModel=n.options.getCoreRowModel(n)),n._getCoreRowModel()),getRowModel:()=>n.getPaginationRowModel(),getRow:(d,f)=>{let g=(f?n.getPrePaginationRowModel():n.getRowModel()).rowsById[d];if(!g&&(g=n.getCoreRowModel().rowsById[d],!g))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${d}`):new Error;return g},_getDefaultColumnDef:Qe(()=>[n.options.defaultColumn],d=>{var f;return d=(f=d)!=null?f:{},{header:g=>{const p=g.header.column.columnDef;return p.accessorKey?p.accessorKey:p.accessorFn?p.id:null},cell:g=>{var p,v;return(p=(v=g.renderValue())==null||v.toString==null?void 0:v.toString())!=null?p:null},...n._features.reduce((g,p)=>Object.assign(g,p.getDefaultColumnDef==null?void 0:p.getDefaultColumnDef()),{}),...d}},{debug:()=>{var d;return(d=n.options.debugAll)!=null?d:n.options.debugColumns},key:process.env.NODE_ENV==="development"&&"getDefaultColumnDef"}),_getColumnDefs:()=>n.options.columns,getAllColumns:Qe(()=>[n._getColumnDefs()],d=>{const f=function(g,p,v){return v===void 0&&(v=0),g.map(y=>{const x=XB(n,y,v,p),w=y;return x.columns=w.columns?f(w.columns,x,v+1):[],x})};return f(d)},{key:process.env.NODE_ENV==="development"&&"getAllColumns",debug:()=>{var d;return(d=n.options.debugAll)!=null?d:n.options.debugColumns}}),getAllFlatColumns:Qe(()=>[n.getAllColumns()],d=>d.flatMap(f=>f.getFlatColumns()),{key:process.env.NODE_ENV==="development"&&"getAllFlatColumns",debug:()=>{var d;return(d=n.options.debugAll)!=null?d:n.options.debugColumns}}),_getAllFlatColumnsById:Qe(()=>[n.getAllFlatColumns()],d=>d.reduce((f,g)=>(f[g.id]=g,f),{}),{key:process.env.NODE_ENV==="development"&&"getAllFlatColumnsById",debug:()=>{var d;return(d=n.options.debugAll)!=null?d:n.options.debugColumns}}),getAllLeafColumns:Qe(()=>[n.getAllColumns(),n._getOrderColumnsFn()],(d,f)=>{let g=d.flatMap(p=>p.getLeafColumns());return f(g)},{key:process.env.NODE_ENV==="development"&&"getAllLeafColumns",debug:()=>{var d;return(d=n.options.debugAll)!=null?d:n.options.debugColumns}}),getColumn:d=>{const f=n._getAllFlatColumnsById()[d];return process.env.NODE_ENV!=="production"&&!f&&console.error(`[Table] Column with id '${d}' does not exist.`),f}};Object.assign(n,c);for(let d=0;d<n._features.length;d++){const f=n._features[d];f==null||f.createTable==null||f.createTable(n)}return n}function gH(e,t,n,r){const i=()=>{var s;return(s=o.getValue())!=null?s:e.options.renderFallbackValue},o={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:i,getContext:Qe(()=>[e,n,t,o],(s,a,l,c)=>({table:s,column:a,row:l,cell:c,getValue:c.getValue,renderValue:c.renderValue}),{key:process.env.NODE_ENV==="development"&&"cell.getContext",debug:()=>e.options.debugAll})};return e._features.forEach(s=>{s.createCell==null||s.createCell(o,n,t,e)},{}),o}const mH=(e,t,n,r,i,o,s)=>{let a={id:t,index:r,original:n,depth:i,parentId:s,_valuesCache:{},_uniqueValuesCache:{},getValue:l=>{if(a._valuesCache.hasOwnProperty(l))return a._valuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return a._valuesCache[l]=c.accessorFn(a.original,r),a._valuesCache[l]},getUniqueValues:l=>{if(a._uniqueValuesCache.hasOwnProperty(l))return a._uniqueValuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return c.columnDef.getUniqueValues?(a._uniqueValuesCache[l]=c.columnDef.getUniqueValues(a.original,r),a._uniqueValuesCache[l]):(a._uniqueValuesCache[l]=[a.getValue(l)],a._uniqueValuesCache[l])},renderValue:l=>{var c;return(c=a.getValue(l))!=null?c:e.options.renderFallbackValue},subRows:o??[],getLeafRows:()=>KB(a.subRows,l=>l.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId,!0):void 0,getParentRows:()=>{let l=[],c=a;for(;;){const d=c.getParentRow();if(!d)break;l.push(d),c=d}return l.reverse()},getAllCells:Qe(()=>[e.getAllLeafColumns()],l=>l.map(c=>gH(e,a,c,c.id)),{key:process.env.NODE_ENV==="development"&&"row.getAllCells",debug:()=>{var l;return(l=e.options.debugAll)!=null?l:e.options.debugRows}}),_getAllCellsByColumnId:Qe(()=>[a.getAllCells()],l=>l.reduce((c,d)=>(c[d.column.id]=d,c),{}),{key:process.env.NODE_ENV==="production"&&"row.getAllCellsByColumnId",debug:()=>{var l;return(l=e.options.debugAll)!=null?l:e.options.debugRows}})};for(let l=0;l<e._features.length;l++){const c=e._features[l];c==null||c.createRow==null||c.createRow(a,e)}return a};function vH(){return e=>Qe(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(i,o,s){o===void 0&&(o=0);const a=[];for(let c=0;c<i.length;c++){const d=mH(e,e._getRowId(i[c],c,s),i[c],c,o,void 0,s==null?void 0:s.id);if(n.flatRows.push(d),n.rowsById[d.id]=d,a.push(d),e.options.getSubRows){var l;d.originalSubRows=e.options.getSubRows(i[c],c),(l=d.originalSubRows)!=null&&l.length&&(d.subRows=r(d.originalSubRows,o+1,d))}}return a};return n.rows=r(t),n},{key:process.env.NODE_ENV==="development"&&"getRowModel",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}})}function bH(){return e=>Qe(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,i=[],o=r.filter(l=>{var c;return(c=e.getColumn(l.id))==null?void 0:c.getCanSort()}),s={};o.forEach(l=>{const c=e.getColumn(l.id);c&&(s[l.id]={sortUndefined:c.columnDef.sortUndefined,invertSorting:c.columnDef.invertSorting,sortingFn:c.getSortingFn()})});const a=l=>{const c=l.map(d=>({...d}));return c.sort((d,f)=>{for(let p=0;p<o.length;p+=1){var g;const v=o[p],y=s[v.id],x=(g=v==null?void 0:v.desc)!=null?g:!1;let w=0;if(y.sortUndefined){const _=d.getValue(v.id),C=f.getValue(v.id),O=_===void 0,P=C===void 0;(O||P)&&(w=O&&P?0:O?y.sortUndefined:-y.sortUndefined)}if(w===0&&(w=y.sortingFn(d,f,v.id)),w!==0)return x&&(w*=-1),y.invertSorting&&(w*=-1),w}return d.index-f.index}),c.forEach(d=>{var f;i.push(d),(f=d.subRows)!=null&&f.length&&(d.subRows=a(d.subRows))}),c};return{rows:a(n.rows),flatRows:i,rowsById:n.rowsById}},{key:process.env.NODE_ENV==="development"&&"getSortedRowModel",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}})}function yH(e){const t=[],n=r=>{var i;t.push(r),(i=r.subRows)!=null&&i.length&&r.getIsExpanded()&&r.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function xH(e){return t=>Qe(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,r)=>{if(!r.rows.length)return r;const{pageSize:i,pageIndex:o}=n;let{rows:s,flatRows:a,rowsById:l}=r;const c=i*o,d=c+i;s=s.slice(c,d);let f;t.options.paginateExpandedRows?f={rows:s,flatRows:a,rowsById:l}:f=yH({rows:s,flatRows:a,rowsById:l}),f.flatRows=[];const g=p=>{f.flatRows.push(p),p.subRows.length&&p.subRows.forEach(g)};return f.rows.forEach(g),f},{key:process.env.NODE_ENV==="development"&&"getPaginationRowModel",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugTable}})}/**
|
|
297
|
+
* react-table
|
|
298
|
+
*
|
|
299
|
+
* Copyright (c) TanStack
|
|
300
|
+
*
|
|
301
|
+
* This source code is licensed under the MIT license found in the
|
|
302
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
303
|
+
*
|
|
304
|
+
* @license MIT
|
|
305
|
+
*/function Y2(e,t){return e?wH(e)?ue.createElement(e,t):e:null}function wH(e){return _H(e)||typeof e=="function"||SH(e)}function _H(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function SH(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function CH(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=ue.useState(()=>({current:pH(t)})),[r,i]=ue.useState(()=>n.current.initialState);return n.current.setOptions(o=>({...o,...e,state:{...r,...e.state},onStateChange:s=>{i(s),e.onStateChange==null||e.onStateChange(s)}})),n.current}function Qb({data:e}){var s;const[t,n]=m.useState([]),i=Object.keys(e[0]).map(a=>({accessorKey:a,header:({column:l})=>{const c=l.getIsSorted();return S.jsxs("div",{className:"flex items-center cursor-pointer ",onClick:()=>l.toggleSorting(l.getIsSorted()==="asc"),children:[a,c==="asc"?S.jsx(TB,{className:"ml-2 h-4 w-4"}):c==="desc"?S.jsx(DB,{className:"ml-2 h-4 w-4"}):null]})}})),o=CH({data:e,columns:i,getCoreRowModel:vH(),getPaginationRowModel:xH(),onSortingChange:n,getSortedRowModel:bH(),manualPagination:!0,state:{sorting:t}});return S.jsx(S.Fragment,{children:S.jsxs(E2,{children:[S.jsx(P2,{children:o.getHeaderGroups().map(a=>S.jsx(Mh,{children:a.headers.map(l=>S.jsx(k2,{className:"sticky top-0",children:l.isPlaceholder?null:Y2(l.column.columnDef.header,l.getContext())},l.id))},a.id))}),S.jsx(O2,{children:(s=o.getRowModel().rows)!=null&&s.length?o.getRowModel().rows.map(a=>S.jsx(Mh,{className:"whitespace-nowrap py-2","data-state":a.getIsSelected()&&"selected",children:a.getVisibleCells().map(l=>S.jsx(Ab,{children:Y2(l.column.columnDef.cell,l.getContext())},l.id))},a.id)):S.jsx(Mh,{children:S.jsx(Ab,{colSpan:i.length,className:"h-24 text-center ",children:"No results."})})})]})})}function Zb(e,[t,n]){return Math.min(n,Math.max(t,e))}function EH(e,t){return m.useReducer((n,r)=>{const i=t[n][r];return i??n},e)}const K2="ScrollArea",[X2,xde]=Pn(K2),[PH,Zr]=X2(K2),Q2=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:o=600,...s}=e,[a,l]=m.useState(null),[c,d]=m.useState(null),[f,g]=m.useState(null),[p,v]=m.useState(null),[y,x]=m.useState(null),[w,_]=m.useState(0),[C,O]=m.useState(0),[P,k]=m.useState(!1),[A,L]=m.useState(!1),F=et(t,H=>l(H)),B=Ns(i);return m.createElement(PH,{scope:n,type:r,dir:B,scrollHideDelay:o,scrollArea:a,viewport:c,onViewportChange:d,content:f,onContentChange:g,scrollbarX:p,onScrollbarXChange:v,scrollbarXEnabled:P,onScrollbarXEnabledChange:k,scrollbarY:y,onScrollbarYChange:x,scrollbarYEnabled:A,onScrollbarYEnabledChange:L,onCornerWidthChange:_,onCornerHeightChange:O},m.createElement(Be.div,le({dir:B},s,{ref:F,style:{position:"relative","--radix-scroll-area-corner-width":w+"px","--radix-scroll-area-corner-height":C+"px",...e.style}})))}),OH="ScrollAreaViewport",kH=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,...i}=e,o=Zr(OH,n),s=m.useRef(null),a=et(t,s,o.onViewportChange);return m.createElement(m.Fragment,null,m.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"}}),m.createElement(Be.div,le({"data-radix-scroll-area-viewport":""},i,{ref:a,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...e.style}}),m.createElement("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"}},r)))}),yo="ScrollAreaScrollbar",Z2=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Zr(yo,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:s}=i,a=e.orientation==="horizontal";return m.useEffect(()=>(a?o(!0):s(!0),()=>{a?o(!1):s(!1)}),[a,o,s]),i.type==="hover"?m.createElement(MH,le({},r,{ref:t,forceMount:n})):i.type==="scroll"?m.createElement(DH,le({},r,{ref:t,forceMount:n})):i.type==="auto"?m.createElement(J2,le({},r,{ref:t,forceMount:n})):i.type==="always"?m.createElement(Jb,le({},r,{ref:t})):null}),MH=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Zr(yo,e.__scopeScrollArea),[o,s]=m.useState(!1);return m.useEffect(()=>{const a=i.scrollArea;let l=0;if(a){const c=()=>{window.clearTimeout(l),s(!0)},d=()=>{l=window.setTimeout(()=>s(!1),i.scrollHideDelay)};return a.addEventListener("pointerenter",c),a.addEventListener("pointerleave",d),()=>{window.clearTimeout(l),a.removeEventListener("pointerenter",c),a.removeEventListener("pointerleave",d)}}},[i.scrollArea,i.scrollHideDelay]),m.createElement(vn,{present:n||o},m.createElement(J2,le({"data-state":o?"visible":"hidden"},r,{ref:t})))}),DH=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Zr(yo,e.__scopeScrollArea),o=e.orientation==="horizontal",s=Lh(()=>l("SCROLL_END"),100),[a,l]=EH("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return m.useEffect(()=>{if(a==="idle"){const c=window.setTimeout(()=>l("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(c)}},[a,i.scrollHideDelay,l]),m.useEffect(()=>{const c=i.viewport,d=o?"scrollLeft":"scrollTop";if(c){let f=c[d];const g=()=>{const p=c[d];f!==p&&(l("SCROLL"),s()),f=p};return c.addEventListener("scroll",g),()=>c.removeEventListener("scroll",g)}},[i.viewport,o,l,s]),m.createElement(vn,{present:n||a!=="hidden"},m.createElement(Jb,le({"data-state":a==="hidden"?"hidden":"visible"},r,{ref:t,onPointerEnter:Ce(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:Ce(e.onPointerLeave,()=>l("POINTER_LEAVE"))})))}),J2=m.forwardRef((e,t)=>{const n=Zr(yo,e.__scopeScrollArea),{forceMount:r,...i}=e,[o,s]=m.useState(!1),a=e.orientation==="horizontal",l=Lh(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,d=n.viewport.offsetHeight<n.viewport.scrollHeight;s(a?c:d)}},10);return _l(n.viewport,l),_l(n.content,l),m.createElement(vn,{present:r||o},m.createElement(Jb,le({"data-state":o?"visible":"hidden"},i,{ref:t})))}),Jb=m.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,i=Zr(yo,e.__scopeScrollArea),o=m.useRef(null),s=m.useRef(0),[a,l]=m.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=rP(a.viewport,a.content),d={...r,sizes:a,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:g=>o.current=g,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:g=>s.current=g};function f(g,p){return FH(g,s.current,a,p)}return n==="horizontal"?m.createElement(TH,le({},d,{ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const g=i.viewport.scrollLeft,p=iP(g,a,i.dir);o.current.style.transform=`translate3d(${p}px, 0, 0)`}},onWheelScroll:g=>{i.viewport&&(i.viewport.scrollLeft=g)},onDragScroll:g=>{i.viewport&&(i.viewport.scrollLeft=f(g,i.dir))}})):n==="vertical"?m.createElement(AH,le({},d,{ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const g=i.viewport.scrollTop,p=iP(g,a);o.current.style.transform=`translate3d(0, ${p}px, 0)`}},onWheelScroll:g=>{i.viewport&&(i.viewport.scrollTop=g)},onDragScroll:g=>{i.viewport&&(i.viewport.scrollTop=f(g))}})):null}),TH=m.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=Zr(yo,e.__scopeScrollArea),[s,a]=m.useState(),l=m.useRef(null),c=et(t,l,o.onScrollbarXChange);return m.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),m.createElement(tP,le({"data-orientation":"horizontal"},i,{ref:c,sizes:n,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Nh(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,f)=>{if(o.viewport){const g=o.viewport.scrollLeft+d.deltaX;e.onWheelScroll(g),sP(g,f)&&d.preventDefault()}},onResize:()=>{l.current&&o.viewport&&s&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:Rh(s.paddingLeft),paddingEnd:Rh(s.paddingRight)}})}}))}),AH=m.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=Zr(yo,e.__scopeScrollArea),[s,a]=m.useState(),l=m.useRef(null),c=et(t,l,o.onScrollbarYChange);return m.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),m.createElement(tP,le({"data-orientation":"vertical"},i,{ref:c,sizes:n,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Nh(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,f)=>{if(o.viewport){const g=o.viewport.scrollTop+d.deltaY;e.onWheelScroll(g),sP(g,f)&&d.preventDefault()}},onResize:()=>{l.current&&o.viewport&&s&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:Rh(s.paddingTop),paddingEnd:Rh(s.paddingBottom)}})}}))}),[IH,eP]=X2(yo),tP=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:o,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:d,onResize:f,...g}=e,p=Zr(yo,n),[v,y]=m.useState(null),x=et(t,F=>y(F)),w=m.useRef(null),_=m.useRef(""),C=p.viewport,O=r.content-r.viewport,P=On(d),k=On(l),A=Lh(f,10);function L(F){if(w.current){const B=F.clientX-w.current.left,H=F.clientY-w.current.top;c({x:B,y:H})}}return m.useEffect(()=>{const F=B=>{const H=B.target;(v==null?void 0:v.contains(H))&&P(B,O)};return document.addEventListener("wheel",F,{passive:!1}),()=>document.removeEventListener("wheel",F,{passive:!1})},[C,v,O,P]),m.useEffect(k,[r,k]),_l(v,A),_l(p.content,A),m.createElement(IH,{scope:n,scrollbar:v,hasThumb:i,onThumbChange:On(o),onThumbPointerUp:On(s),onThumbPositionChange:k,onThumbPointerDown:On(a)},m.createElement(Be.div,le({},g,{ref:x,style:{position:"absolute",...g.style},onPointerDown:Ce(e.onPointerDown,F=>{F.button===0&&(F.target.setPointerCapture(F.pointerId),w.current=v.getBoundingClientRect(),_.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),L(F))}),onPointerMove:Ce(e.onPointerMove,L),onPointerUp:Ce(e.onPointerUp,F=>{const B=F.target;B.hasPointerCapture(F.pointerId)&&B.releasePointerCapture(F.pointerId),document.body.style.webkitUserSelect=_.current,p.viewport&&(p.viewport.style.scrollBehavior=""),w.current=null})})))}),e0="ScrollAreaThumb",RH=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=eP(e0,e.__scopeScrollArea);return m.createElement(vn,{present:n||i.hasThumb},m.createElement(NH,le({ref:t},r)))}),NH=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...i}=e,o=Zr(e0,n),s=eP(e0,n),{onThumbPositionChange:a}=s,l=et(t,f=>s.onThumbChange(f)),c=m.useRef(),d=Lh(()=>{c.current&&(c.current(),c.current=void 0)},100);return m.useEffect(()=>{const f=o.viewport;if(f){const g=()=>{if(d(),!c.current){const p=jH(f,a);c.current=p,a()}};return a(),f.addEventListener("scroll",g),()=>f.removeEventListener("scroll",g)}},[o.viewport,d,a]),m.createElement(Be.div,le({"data-state":s.hasThumb?"visible":"hidden"},i,{ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Ce(e.onPointerDownCapture,f=>{const p=f.target.getBoundingClientRect(),v=f.clientX-p.left,y=f.clientY-p.top;s.onThumbPointerDown({x:v,y})}),onPointerUp:Ce(e.onPointerUp,s.onThumbPointerUp)}))}),nP="ScrollAreaCorner",LH=m.forwardRef((e,t)=>{const n=Zr(nP,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?m.createElement($H,le({},e,{ref:t})):null}),$H=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,i=Zr(nP,n),[o,s]=m.useState(0),[a,l]=m.useState(0),c=!!(o&&a);return _l(i.scrollbarX,()=>{var d;const f=((d=i.scrollbarX)===null||d===void 0?void 0:d.offsetHeight)||0;i.onCornerHeightChange(f),l(f)}),_l(i.scrollbarY,()=>{var d;const f=((d=i.scrollbarY)===null||d===void 0?void 0:d.offsetWidth)||0;i.onCornerWidthChange(f),s(f)}),c?m.createElement(Be.div,le({},r,{ref:t,style:{width:o,height:a,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}})):null});function Rh(e){return e?parseInt(e,10):0}function rP(e,t){const n=e/t;return isNaN(n)?0:n}function Nh(e){const t=rP(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function FH(e,t,n,r="ltr"){const i=Nh(n),o=i/2,s=t||o,a=i-s,l=n.scrollbar.paddingStart+s,c=n.scrollbar.size-n.scrollbar.paddingEnd-a,d=n.content-n.viewport,f=r==="ltr"?[0,d]:[d*-1,0];return oP([l,c],f)(e)}function iP(e,t,n="ltr"){const r=Nh(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-i,s=t.content-t.viewport,a=o-r,l=n==="ltr"?[0,s]:[s*-1,0],c=Zb(e,l);return oP([0,s],[0,a])(c)}function oP(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function sP(e,t){return e>0&&e<t}const jH=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function i(){const o={left:e.scrollLeft,top:e.scrollTop},s=n.left!==o.left,a=n.top!==o.top;(s||a)&&t(),n=o,r=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(r)};function Lh(e,t){const n=On(e),r=m.useRef(0);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),m.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function _l(e,t){const n=On(t);Hn(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}const aP=Q2,zH=kH,BH=LH,Sl=ue.forwardRef(({className:e,children:t,...n},r)=>S.jsxs(aP,{ref:r,className:Oe("relative overflow-hidden",e),...n,children:[S.jsx(zH,{className:"h-full w-full rounded-[inherit]",children:t}),S.jsx($h,{}),S.jsx(BH,{})]}));Sl.displayName=aP.displayName;const $h=ue.forwardRef(({className:e,orientation:t="vertical",...n},r)=>S.jsx(Z2,{ref:r,orientation:t,className:Oe("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:S.jsx(RH,{className:"relative flex-1 rounded-full bg-border"})}));$h.displayName=Z2.displayName;function HH(e,t,n,r,i){var o,s,a,l;r?(s=(o=e==null?void 0:e.data)==null?void 0:o.datasets)==null||s.forEach(c=>{var d,f;typeof c.backgroundColor=="string"&&(c.backgroundColor=new Array(c.data.length).fill(c.backgroundColor),c.borderColor=new Array(c.data.length).fill(c.borderColor)),c.backgroundColor=(d=c==null?void 0:c.backgroundColor)==null?void 0:d.map((g,p)=>p===t?g:i),c.borderColor=(f=c==null?void 0:c.borderColor)==null?void 0:f.map((g,p)=>p===t?g:i)}):(l=(a=e==null?void 0:e.data)==null?void 0:a.datasets)==null||l.forEach((c,d)=>{var f,g,p,v,y,x;c.backgroundColor=new Array(c.data.length).fill((p=(g=(f=n==null?void 0:n.data)==null?void 0:f.datasets)==null?void 0:g[d])==null?void 0:p.backgroundColor),c.borderColor=new Array(c.data.length).fill((x=(y=(v=n==null?void 0:n.data)==null?void 0:v.datasets)==null?void 0:y[d])==null?void 0:x.borderColor)}),e==null||e.update()}function VH(e,t,n,r,i){var o,s,a,l;r?(s=(o=e==null?void 0:e.data)==null?void 0:o.datasets)==null||s.forEach(c=>{var d,f;console.log("clicked index",t),console.log(n.data),console.log(c),c.backgroundColor=(d=c==null?void 0:c.backgroundColor)==null?void 0:d.map((g,p)=>p===t?g:i),c.borderColor=(f=c==null?void 0:c.borderColor)==null?void 0:f.map((g,p)=>p===t?g:i)}):(l=(a=e==null?void 0:e.data)==null?void 0:a.datasets)==null||l.forEach((c,d)=>{var f,g,p,v,y,x,w,_;typeof c.backgroundColor=="string"&&(c.backgroundColor=(p=(g=(f=n==null?void 0:n.data)==null?void 0:f.datasets)==null?void 0:g[d])==null?void 0:p.backgroundColor,c.borderColor=(x=(y=(v=n==null?void 0:n.data)==null?void 0:v.datasets)==null?void 0:y[d])==null?void 0:x.borderColor),c.backgroundColor=(w=c==null?void 0:c.backgroundColor)==null?void 0:w.map((C,O)=>{var P;return(P=n.data.datasets[d].backgroundColor)==null?void 0:P[O]}),c.borderColor=(_=c==null?void 0:c.borderColor)==null?void 0:_.map((C,O)=>{var P;return(P=n.data.datasets[d].borderColor)==null?void 0:P[O]})}),e==null||e.update()}function WH(e,t,n,r){var i,o;try{if(!e||!e.data)return;const{dimensionKeys:s,metricKeys:a}=ta(e.data);if(["bar","horizontalBar","line","pie","doughnut","radar","polarArea"].includes(e.type)){const l=s[0],c=(i=e.data[n])==null?void 0:i[l];return[{columnName:l,columnValue:c,metric:a[t],value:r}]}if(e.type==="stackedBar"){const l=WE({dataArray:e.data,groupKey:s[0],pivotKey:s[1],valueKey:a[0]}),c=s[0],d=(o=l[n])==null?void 0:o[c],f=s[1],{metricKeys:g}=ta(l),p=g[t];return[{columnName:c,columnValue:d,metric:a[0],value:r},{columnName:f,columnValue:p,metric:a[0],value:r}]}if(e.type==="bubble"||e.type==="scatter"){const l=s[0],c=r.label;return[{columnName:l,columnValue:c,metric1:a[0],value1:r.x,metric2:a[1],value2:r.y,metric3:a==null?void 0:a[2],value3:r==null?void 0:r.r}]}}catch(s){console.error("Error in getAdhocFilter",s)}}function qH(e){let t=[];const n=xe(te=>te.authToken),r=_e(te=>te.selectedConnectionId),i=_e(te=>te.selectedDatabaseName),o=_e(te=>te.selectedSchemaName),s=_e(te=>te.selectedTableName),a=_e(te=>te.actions.setCurrentColumns),{data:l,isLoading:c,isError:d}=Sr({queryKey:[e||"connections"],queryFn:()=>Xa("https://semaphor.cloud/api/v1/connections",(n==null?void 0:n.accessToken)||""),enabled:!!(n!=null&&n.accessToken)}),f=l==null?void 0:l.connections.find(te=>te.id===r),g=(f==null?void 0:f.type)==="API",{data:p,isLoading:v,isFetching:y,isError:x,refetch:w}=Sr({queryKey:[r],queryFn:()=>Xa("https://semaphor.cloud/api/v1/databases",(n==null?void 0:n.accessToken)||"",{connection_id:r}),enabled:!!r&&(f==null?void 0:f.type)!=="API"}),{data:_,isLoading:C,isFetching:O,isError:P,refetch:k}=Sr({queryKey:[r,i],queryFn:()=>Xa("https://semaphor.cloud/api/v1/schemas",(n==null?void 0:n.accessToken)||"",{connection_id:r,database_name:i}),enabled:!!r&&!!i&&(f==null?void 0:f.type)!=="API"}),{data:A,isLoading:L,isFetching:F,isError:B,refetch:H}=Sr({queryKey:[r,i,o],queryFn:()=>Xa("https://semaphor.cloud/api/v1/tables",(n==null?void 0:n.accessToken)||"",{connection_id:r,database_name:i,schema_name:o}),enabled:!!r&&!!i&&!!o&&(f==null?void 0:f.type)!=="API"}),{data:V,isLoading:K,isFetching:Y,isError:$}=Sr({queryKey:[r,i,s],queryFn:()=>Xa("https://semaphor.cloud/api/v1/columns",(n==null?void 0:n.accessToken)||"",{connection_id:r,database_name:i,schema_name:o,table_name:s}),enabled:!!r&&!!i&&!!o&&!!s&&(f==null?void 0:f.type)!=="API"}),{data:X,isLoading:j,isFetching:ne,isError:se}=Sr({queryKey:["api",r],queryFn:()=>Ds("https://semaphor.cloud/api/v1/query",(n==null?void 0:n.accessToken)||"",{connection_id:r,sql:"select * from api limit 10"}),enabled:!!r&&g});m.useEffect(()=>{a(t)},[t,a]),X&&X.records.length>0&&(t=YH(X.records[0])),p&&p.databases.length>0,_&&_.schemas.length>0,V&&V.columns.length>0&&(t=V.columns.map(te=>({...te,data_type:te.data_type.toLowerCase()}))),x&&(t=[]),($||d)&&(t=[]);const D=l==null?void 0:l.connections.map(te=>({id:te.id,name:te.name})),q=p==null?void 0:p.databases.map(te=>({id:te.database_name,name:te.database_name})),re=_==null?void 0:_.schemas.map(te=>({id:te.schema_name,name:te.schema_name})),R=A==null?void 0:A.tables.map(te=>({id:te.table_name,name:te.table_name}));return{connectionItems:D,isConnectionsLoading:c,isConnectionsError:d,databaseItems:q,isDatabasesLoadingOrFetching:v||y,isDatabaseError:x,schemaItems:re,isSchemaLoadingOrFetching:C||O,isSchemaError:P,tableItems:R,isTableLoadingOrFetching:L||F,isTableError:B,columns:t,isColumnsLoadingOrFetching:K||Y,isColumnsError:$,isAPIConnection:g}}const UH=e=>{const t=new Date(e);return!isNaN(t.getTime())},GH=e=>!isNaN(Number(e))&&!isNaN(parseFloat(e)),lP=e=>{let t;return typeof e=="number"?t="number":typeof e=="string"?UH(e)?t="date":GH(e)?t="number":t="string":typeof e=="boolean"?t="boolean":e instanceof Date?t="date":t="unknown",t},YH=e=>Object.keys(e).map(t=>{const n=e[t],r=lP(n);return{column_name:t,data_type:r,is_nullable:n===null?"YES":"NO"}});function KH({card:e,className:t,...n}){const r=m.useRef(null),[i,o]=m.useState(0),[s,a]=m.useState(!1),l=xe(j=>j.theme),c=xe(j=>j.themeStyle),d=xe(j=>j.isVisualEditing),f=xe(j=>j.selectedSheetId),g=xe(j=>j.selectedCardId),p=xe(j=>j.isDashboardEditing),v=xe(j=>j.themeStyle),y=xe(j=>j.filterValues),x=xe(j=>j.actions.setCardData),w=xe(j=>j.actions.setSelectedCardId),_=xe(j=>j.actions.addOrUpdateFilterValue),C=xe(j=>j.actions.removeFilterValue),O=xe(j=>j.actions.setSelectedCard),P=xe(j=>j.actions.setCardTitle),k=xe(j=>j.actions.setCardDescription),{data:A,isLoading:L,isFetching:F,isError:B,refetch:H}=sz(e);m.useEffect(()=>{!A||!A.records||x(f,e.id,(A==null?void 0:A.records)||[])},[A,f,e.id,x]),m.useEffect(()=>{o(i+1)},[e.data,e.type,e.cfg,e.customCfg,v]),m.useEffect(()=>{g===e.id&&p&&!d&&V()},[g,e.id,p,d]),m.useEffect(()=>{e.connectionId&&!s&&H()},[y]);const V=()=>{const j=r.current;j==null||j.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})};function K(j,ne){j.stopPropagation(),w(f,ne.id),O(ne)}function Y(j,ne,se,D,q){if(!D)return;const re=l==="dark"?"rgb(238,238,238,0.2)":"rgb(238,238,238,0.8)";["bar","line","horizontalBar","stackedBar","bubble","scatter"].includes(se)&&HH(j,ne,D,q,re),["pie","doughnut","polarArea"].includes(se)&&VH(j,ne,D,q,re)}function $(j,ne,se,D){var R,te;if(!e.data)return;const q=WH(e,ne,se,D);if(!((R=e==null?void 0:e.preferences)!=null&&R.filterOnClick))return;if(s){const ge=e.id;C(ge),a(!1),Y(j,se,e.type,X,!1);return}if(!q)return;const re={filterId:e.id,connectionId:e==null?void 0:e.connectionId,tableName:e.lastSelectedTable,name:q[0].columnName,expression:(te=e.preferences)==null?void 0:te.filterOnClickField,valueType:lP(q[0].columnValue),operation:"=",values:[q[0].columnValue]};_(re),a(!0),Y(j,se,e.type,X,!0)}if(!e.id)return null;let X;return e.data&&e.data.length>0&&(X=vb({data:e.data,cardType:e.type,cfg:e.cfg,customCfg:e.customCfg})),S.jsxs(bv,{tabIndex:-1,ref:r,role:"dashboard-card",onClick:j=>K(j,e),className:Oe(" relative h-full flex flex-col rounded-sm border-muted ",{"border-dashed border-foreground/50 ":g===e.id&&p},t,c==null?void 0:c.dashboardCard),...n,children:[S.jsx(Wj,{card:e}),S.jsxs(yv,{className:"xbg-green-100 pb-4",children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(Hc,{text:e.title,onSave:j=>P(f,e.id,j),children:S.jsx(xv,{className:"text-base",children:e.title})}),e.refreshInterval&&S.jsxs(Tb,{children:[S.jsx(C2,{className:"pr-1",children:S.jsx("div",{className:Oe("h-2 w-2 rounded-full bg-green-500",{"bg-orange-500":L||F})})}),S.jsx(kh,{side:"right",align:"center",children:S.jsx("p",{className:"text-xs",children:`Realtime (${e==null?void 0:e.refreshInterval})`})})]}),!e.refreshInterval&&(L||F)&&S.jsx(Pu,{className:"w-4 h-4 animate-spin text-muted-foreground"})]}),S.jsx(Hc,{text:(e==null?void 0:e.description)||"",onSave:j=>k(f,e.id,j),children:S.jsxs(wv,{children:[" ",e.description]})})]}),S.jsxs(_v,{className:"flex flex-col pb-6 grow relative xbg-yellow-100 overflow-auto ",children:[B&&S.jsx("p",{className:"text-sm",children:"Oops! It seems like something went wrong. Please review your connection or filters."}),!B&&X&&e.type!=="table"&&S.jsx(jE,{cfg:X,onDatapointClick:$},i),e.type==="table"&&e.data&&e.data.length>0&&S.jsx(Sl,{children:S.jsx(Qb,{data:e==null?void 0:e.data})})]})]})}const XH=lS.WidthProvider(lS.Responsive);function QH(){var d,f;const e=xe(g=>g.isDashboardEditing),t=xe(g=>g.themeStyle),n=xe(g=>g.selectedSheetId),r=xe(g=>{var p,v,y;return(y=(v=(p=g.dashboard)==null?void 0:p.sheets)==null?void 0:v.find(x=>x.id===n))==null?void 0:y.cards}),{getSelectedSheet:i,getSelectedSheetLayout:o,setSheetLayout:s}=xe(g=>g.actions);if(!n)return null;const a=i(),l=o(),c=(g,p)=>S.jsx(cP,{className:" after:content-none",ref:p,handleAxis:g});return S.jsx(XH,{margin:((d=t==null?void 0:t.gridLayout)==null?void 0:d.margin)||[10,10],isDraggable:e,resizeHandles:e?["sw","nw","ne","se","e","w"]:[],onLayoutChange:g=>{a!=null&&a.id&&s(a.id,g)},className:Oe((f=t==null?void 0:t.gridLayout)==null?void 0:f.className),layouts:{lg:l||[]},breakpoints:{lg:1500},cols:{lg:48},rowHeight:48,resizeHandle:c,children:r&&r.map((g,p)=>S.jsx("div",{role:"card-container",className:"group","data-grid":a!=null&&a.layout?a==null?void 0:a.layout[p]:{x:0,y:0,w:20,h:6,minH:5,minW:10,maxH:12},children:S.jsx(KH,{card:g})},g.id))})}const cP=m.forwardRef(({className:e,handleAxis:t,...n},r)=>S.jsx("div",{ref:r,className:Oe(`z-10 react-resizable-handle react-resizable-handle-${t} absolute border-foreground/40 `,{"group-hover:border-2 group-hover:border-r-0 group-hover:border-b-0 border-foreground/40":t==="nw","group-hover:border-2 group-hover:border-l-0 group-hover:border-b-0 border-foreground/40":t==="ne","group-hover:border-2 group-hover:border-r-0 group-hover:border-t-0 border-foreground/40":t==="sw","group-hover:border-2 group-hover:border-l-0 group-hover:border-t-0 border-foreground/40":t==="se","group-hover:border-2 group-hover:border-b-0 group-hover:border-t-0 group-hover:border-l-0 border-foreground/40 ":t==="e","group-hover:border-2 group-hover:border-b-0 group-hover:border-t-0 group-hover:border-r-0 border-foreground/40":t==="w"},e),...n}));cP.displayName="ResizeHandle";/**
|
|
306
|
+
* react-virtual
|
|
307
|
+
*
|
|
308
|
+
* Copyright (c) TanStack
|
|
309
|
+
*
|
|
310
|
+
* This source code is licensed under the MIT license found in the
|
|
311
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
312
|
+
*
|
|
313
|
+
* @license MIT
|
|
314
|
+
*/function Fh(){return Fh=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},Fh.apply(this,arguments)}/**
|
|
315
|
+
* virtual-core
|
|
316
|
+
*
|
|
317
|
+
* Copyright (c) TanStack
|
|
318
|
+
*
|
|
319
|
+
* This source code is licensed under the MIT license found in the
|
|
320
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
321
|
+
*
|
|
322
|
+
* @license MIT
|
|
323
|
+
*/function jh(){return jh=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},jh.apply(this,arguments)}/**
|
|
324
|
+
* virtual-core
|
|
325
|
+
*
|
|
326
|
+
* Copyright (c) TanStack
|
|
327
|
+
*
|
|
328
|
+
* This source code is licensed under the MIT license found in the
|
|
329
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
330
|
+
*
|
|
331
|
+
* @license MIT
|
|
332
|
+
*/function Cl(e,t,n){var r,i=(r=n.initialDeps)!=null?r:[],o;return function(){var s;n.key&&n.debug!=null&&n.debug()&&(s=Date.now());var a=e(),l=a.length!==i.length||a.some(function(v,y){return i[y]!==v});if(!l)return o;i=a;var c;if(n.key&&n.debug!=null&&n.debug()&&(c=Date.now()),o=t.apply(void 0,a),n.key&&n.debug!=null&&n.debug()){var d=Math.round((Date.now()-s)*100)/100,f=Math.round((Date.now()-c)*100)/100,g=f/16,p=function(y,x){for(y=String(y);y.length<x;)y=" "+y;return y};console.info("%c⏱ "+p(f,5)+" /"+p(d,5)+" ms",`
|
|
333
|
+
font-size: .6rem;
|
|
334
|
+
font-weight: bold;
|
|
335
|
+
color: hsl(`+Math.max(0,Math.min(120-120*g,120))+"deg 100% 31%);",n==null?void 0:n.key)}return n==null||n.onChange==null||n.onChange(o),o}}function t0(e,t){if(e===void 0)throw new Error("Unexpected undefined"+(t?": "+t:""));return e}var ZH=function(t,n){return Math.abs(t-n)<1};/**
|
|
336
|
+
* virtual-core
|
|
337
|
+
*
|
|
338
|
+
* Copyright (c) TanStack
|
|
339
|
+
*
|
|
340
|
+
* This source code is licensed under the MIT license found in the
|
|
341
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
342
|
+
*
|
|
343
|
+
* @license MIT
|
|
344
|
+
*/var JH=function(t){return t},eV=function(t){for(var n=Math.max(t.startIndex-t.overscan,0),r=Math.min(t.endIndex+t.overscan,t.count-1),i=[],o=n;o<=r;o++)i.push(o);return i},tV=function(t,n){var r=t.scrollElement;if(r){var i=function(a){var l=a.width,c=a.height;n({width:Math.round(l),height:Math.round(c)})};i(r.getBoundingClientRect());var o=new ResizeObserver(function(s){var a=s[0];if(a!=null&&a.borderBoxSize){var l=a.borderBoxSize[0];if(l){i({width:l.inlineSize,height:l.blockSize});return}}i(r.getBoundingClientRect())});return o.observe(r,{box:"border-box"}),function(){o.unobserve(r)}}},nV=function(t,n){var r=t.scrollElement;if(r){var i=function(){n(r[t.options.horizontal?"scrollLeft":"scrollTop"])};return i(),r.addEventListener("scroll",i,{passive:!0}),function(){r.removeEventListener("scroll",i)}}},rV=function(t,n,r){if(n!=null&&n.borderBoxSize){var i=n.borderBoxSize[0];if(i){var o=Math.round(i[r.options.horizontal?"inlineSize":"blockSize"]);return o}}return Math.round(t.getBoundingClientRect()[r.options.horizontal?"width":"height"])},iV=function(t,n,r){var i,o,s=n.adjustments,a=s===void 0?0:s,l=n.behavior,c=t+a;(i=r.scrollElement)==null||i.scrollTo==null||i.scrollTo((o={},o[r.options.horizontal?"left":"top"]=c,o.behavior=l,o))},oV=function(t){var n=this;this.unsubs=[],this.scrollElement=null,this.isScrolling=!1,this.isScrollingTimeoutId=null,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollDirection=null,this.scrollAdjustments=0,this.measureElementCache=new Map,this.observer=function(){var r=null,i=function(){return r||(typeof ResizeObserver<"u"?r=new ResizeObserver(function(s){s.forEach(function(a){n._measureElement(a.target,a)})}):null)};return{disconnect:function(){var s;return(s=i())==null?void 0:s.disconnect()},observe:function(s){var a;return(a=i())==null?void 0:a.observe(s,{box:"border-box"})},unobserve:function(s){var a;return(a=i())==null?void 0:a.unobserve(s)}}}(),this.range=null,this.setOptions=function(r){Object.entries(r).forEach(function(i){var o=i[0],s=i[1];typeof s>"u"&&delete r[o]}),n.options=jh({debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:JH,rangeExtractor:eV,onChange:function(){},measureElement:rV,initialRect:{width:0,height:0},scrollMargin:0,scrollingDelay:150,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1},r)},this.notify=function(r){n.options.onChange==null||n.options.onChange(n,r)},this.maybeNotify=Cl(function(){return n.calculateRange(),[n.isScrolling,n.range?n.range.startIndex:null,n.range?n.range.endIndex:null]},function(r){n.notify(r)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:function(){return n.options.debug},initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=function(){n.unsubs.filter(Boolean).forEach(function(r){return r()}),n.unsubs=[],n.scrollElement=null},this._didMount=function(){return n.measureElementCache.forEach(n.observer.observe),function(){n.observer.disconnect(),n.cleanup()}},this._willUpdate=function(){var r=n.options.getScrollElement();n.scrollElement!==r&&(n.cleanup(),n.scrollElement=r,n._scrollToOffset(n.scrollOffset,{adjustments:void 0,behavior:void 0}),n.unsubs.push(n.options.observeElementRect(n,function(i){n.scrollRect=i,n.maybeNotify()})),n.unsubs.push(n.options.observeElementOffset(n,function(i){n.scrollAdjustments=0,n.scrollOffset!==i&&(n.isScrollingTimeoutId!==null&&(clearTimeout(n.isScrollingTimeoutId),n.isScrollingTimeoutId=null),n.isScrolling=!0,n.scrollDirection=n.scrollOffset<i?"forward":"backward",n.scrollOffset=i,n.maybeNotify(),n.isScrollingTimeoutId=setTimeout(function(){n.isScrollingTimeoutId=null,n.isScrolling=!1,n.scrollDirection=null,n.maybeNotify()},n.options.scrollingDelay))})))},this.getSize=function(){return n.scrollRect[n.options.horizontal?"width":"height"]},this.memoOptions=Cl(function(){return[n.options.count,n.options.paddingStart,n.options.scrollMargin,n.options.getItemKey]},function(r,i,o,s){return n.pendingMeasuredCacheIndexes=[],{count:r,paddingStart:i,scrollMargin:o,getItemKey:s}},{key:!1}),this.getFurthestMeasurement=function(r,i){for(var o=new Map,s=new Map,a=i-1;a>=0;a--){var l=r[a];if(!o.has(l.lane)){var c=s.get(l.lane);if(c==null||l.end>c.end?s.set(l.lane,l):l.end<c.end&&o.set(l.lane,!0),o.size===n.options.lanes)break}}return s.size===n.options.lanes?Array.from(s.values()).sort(function(d,f){return d.end-f.end})[0]:void 0},this.getMeasurements=Cl(function(){return[n.memoOptions(),n.itemSizeCache]},function(r,i){var o=r.count,s=r.paddingStart,a=r.scrollMargin,l=r.getItemKey,c=n.pendingMeasuredCacheIndexes.length>0?Math.min.apply(Math,n.pendingMeasuredCacheIndexes):0;n.pendingMeasuredCacheIndexes=[];for(var d=n.measurementsCache.slice(0,c),f=c;f<o;f++){var g=l(f),p=n.options.lanes===1?d[f-1]:n.getFurthestMeasurement(d,f),v=p?p.end:s+a,y=i.get(g),x=typeof y=="number"?y:n.options.estimateSize(f),w=v+x,_=p?p.lane:f%n.options.lanes;d[f]={index:f,start:v,size:x,end:w,key:g,lane:_}}return n.measurementsCache=d,d},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:function(){return n.options.debug}}),this.calculateRange=Cl(function(){return[n.getMeasurements(),n.getSize(),n.scrollOffset]},function(r,i,o){return n.range=r.length>0&&i>0?sV({measurements:r,outerSize:i,scrollOffset:o}):null},{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:function(){return n.options.debug}}),this.getIndexes=Cl(function(){return[n.options.rangeExtractor,n.calculateRange(),n.options.overscan,n.options.count]},function(r,i,o,s){return i===null?[]:r(jh({},i,{overscan:o,count:s}))},{key:process.env.NODE_ENV!=="production"&&"getIndexes",debug:function(){return n.options.debug}}),this.indexFromElement=function(r){var i=n.options.indexAttribute,o=r.getAttribute(i);return o?parseInt(o,10):(console.warn("Missing attribute name '"+i+"={index}' on measured element."),-1)},this._measureElement=function(r,i){var o=n.measurementsCache[n.indexFromElement(r)];if(!o||!r.isConnected){n.measureElementCache.forEach(function(l,c){l===r&&(n.observer.unobserve(r),n.measureElementCache.delete(c))});return}var s=n.measureElementCache.get(o.key);s!==r&&(s&&n.observer.unobserve(s),n.observer.observe(r),n.measureElementCache.set(o.key,r));var a=n.options.measureElement(r,i,n);n.resizeItem(o,a)},this.resizeItem=function(r,i){var o,s=(o=n.itemSizeCache.get(r.key))!=null?o:r.size,a=i-s;a!==0&&(r.start<n.scrollOffset&&(process.env.NODE_ENV!=="production"&&n.options.debug&&console.info("correction",a),n._scrollToOffset(n.scrollOffset,{adjustments:n.scrollAdjustments+=a,behavior:void 0})),n.pendingMeasuredCacheIndexes.push(r.index),n.itemSizeCache=new Map(n.itemSizeCache.set(r.key,i)),n.notify(!1))},this.measureElement=function(r){r&&n._measureElement(r,void 0)},this.getVirtualItems=Cl(function(){return[n.getIndexes(),n.getMeasurements()]},function(r,i){for(var o=[],s=0,a=r.length;s<a;s++){var l=r[s],c=i[l];o.push(c)}return o},{key:process.env.NODE_ENV!=="production"&&"getIndexes",debug:function(){return n.options.debug}}),this.getVirtualItemForOffset=function(r){var i=n.getMeasurements();return t0(i[uP(0,i.length-1,function(o){return t0(i[o]).start},r)])},this.getOffsetForAlignment=function(r,i){var o=n.getSize();i==="auto"&&(r<=n.scrollOffset?i="start":r>=n.scrollOffset+o?i="end":i="start"),i==="start"?r=r:i==="end"?r=r-o:i==="center"&&(r=r-o/2);var s=n.options.horizontal?"scrollWidth":"scrollHeight",a=n.scrollElement?"document"in n.scrollElement?n.scrollElement.document.documentElement[s]:n.scrollElement[s]:0,l=a-n.getSize();return Math.max(Math.min(l,r),0)},this.getOffsetForIndex=function(r,i){i===void 0&&(i="auto"),r=Math.max(0,Math.min(r,n.options.count-1));var o=t0(n.getMeasurements()[r]);if(i==="auto")if(o.end>=n.scrollOffset+n.getSize()-n.options.scrollPaddingEnd)i="end";else if(o.start<=n.scrollOffset+n.options.scrollPaddingStart)i="start";else return[n.scrollOffset,i];var s=i==="end"?o.end+n.options.scrollPaddingEnd:o.start-n.options.scrollPaddingStart;return[n.getOffsetForAlignment(s,i),i]},this.isDynamicMode=function(){return n.measureElementCache.size>0},this.cancelScrollToIndex=function(){n.scrollToIndexTimeoutId!==null&&(clearTimeout(n.scrollToIndexTimeoutId),n.scrollToIndexTimeoutId=null)},this.scrollToOffset=function(r,i){var o=i===void 0?{}:i,s=o.align,a=s===void 0?"start":s,l=o.behavior;n.cancelScrollToIndex(),l==="smooth"&&n.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),n._scrollToOffset(n.getOffsetForAlignment(r,a),{adjustments:void 0,behavior:l})},this.scrollToIndex=function(r,i){var o=i===void 0?{}:i,s=o.align,a=s===void 0?"auto":s,l=o.behavior;r=Math.max(0,Math.min(r,n.options.count-1)),n.cancelScrollToIndex(),l==="smooth"&&n.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");var c=n.getOffsetForIndex(r,a),d=c[0],f=c[1];n._scrollToOffset(d,{adjustments:void 0,behavior:l}),l!=="smooth"&&n.isDynamicMode()&&(n.scrollToIndexTimeoutId=setTimeout(function(){n.scrollToIndexTimeoutId=null;var g=n.measureElementCache.has(n.options.getItemKey(r));if(g){var p=n.getOffsetForIndex(r,f),v=p[0];ZH(v,n.scrollOffset)||n.scrollToIndex(r,{align:f,behavior:l})}else n.scrollToIndex(r,{align:f,behavior:l})}))},this.scrollBy=function(r,i){var o=i===void 0?{}:i,s=o.behavior;n.cancelScrollToIndex(),s==="smooth"&&n.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),n._scrollToOffset(n.scrollOffset+r,{adjustments:void 0,behavior:s})},this.getTotalSize=function(){var r;return(((r=n.getMeasurements()[n.options.count-1])==null?void 0:r.end)||n.options.paddingStart)-n.options.scrollMargin+n.options.paddingEnd},this._scrollToOffset=function(r,i){var o=i.adjustments,s=i.behavior;n.options.scrollToFn(r,{behavior:s,adjustments:o},n)},this.measure=function(){n.itemSizeCache=new Map,n.notify(!1)},this.setOptions(t),this.scrollRect=this.options.initialRect,this.scrollOffset=this.options.initialOffset,this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(function(r){n.itemSizeCache.set(r.key,r.size)}),this.maybeNotify()},uP=function(t,n,r,i){for(;t<=n;){var o=(t+n)/2|0,s=r(o);if(s<i)t=o+1;else if(s>i)n=o-1;else return o}return t>0?t-1:0};function sV(e){for(var t=e.measurements,n=e.outerSize,r=e.scrollOffset,i=t.length-1,o=function(c){return t[c].start},s=uP(0,i,o,r),a=s;a<i&&t[a].end<r+n;)a++;return{startIndex:s,endIndex:a}}/**
|
|
345
|
+
* react-virtual
|
|
346
|
+
*
|
|
347
|
+
* Copyright (c) TanStack
|
|
348
|
+
*
|
|
349
|
+
* This source code is licensed under the MIT license found in the
|
|
350
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
351
|
+
*
|
|
352
|
+
* @license MIT
|
|
353
|
+
*/var aV=typeof document<"u"?ue.useLayoutEffect:ue.useEffect;function lV(e){var t=ue.useReducer(function(){return{}},{})[1],n=Fh({},e,{onChange:function(s,a){a?kt.flushSync(t):t(),e.onChange==null||e.onChange(s,a)}}),r=ue.useState(function(){return new oV(n)}),i=r[0];return i.setOptions(n),ue.useEffect(function(){return i._didMount()},[]),aV(function(){return i._willUpdate()}),i}function cV(e){return lV(Fh({observeElementRect:tV,observeElementOffset:nV,scrollToFn:iV},e))}var uV=Object.defineProperty,dV=(e,t,n)=>t in e?uV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,n0=(e,t,n)=>(dV(e,typeof t!="symbol"?t+"":t,n),n);let fV=class{constructor(){n0(this,"current",this.detect()),n0(this,"handoffState","pending"),n0(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"}},oa=new fV,xn=(e,t)=>{oa.isServer?m.useEffect(e,t):m.useLayoutEffect(e,t)};function ji(e){let t=m.useRef(e);return xn(()=>{t.current=e},[e]),t}function r0(e,t){let[n,r]=m.useState(e),i=ji(e);return xn(()=>r(i.current),[i,r,...t]),n}let mt=function(e){let t=ji(e);return m.useCallback((...n)=>t.current(...n),[t])};function hV(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 pV(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function sa(){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 pV(()=>{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=sa();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 ku(){let[e]=m.useState(sa);return m.useEffect(()=>()=>e.dispose(),[e]),e}function gV(){let e=typeof document>"u";return"useSyncExternalStore"in ue?(t=>t.useSyncExternalStore)(ue)(()=>()=>{},()=>!1,()=>!e):!1}function i0(){let e=gV(),[t,n]=ue.useState(oa.isHandoffComplete);return t&&oa.isHandoffComplete===!1&&n(!1),ue.useEffect(()=>{t!==!0&&n(!0)},[t]),ue.useEffect(()=>oa.handoff(),[]),e?!1:t}var dP;let Mu=(dP=m.useId)!=null?dP:function(){let e=i0(),[t,n]=m.useState(e?()=>oa.nextId():null);return xn(()=>{t===null&&n(oa.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 o0(e){return oa.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let fP=["[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 mV=(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))(mV||{}),vV=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(vV||{}),bV=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(bV||{}),hP=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(hP||{});function yV(e,t=0){var n;return e===((n=o0(e))==null?void 0:n.body)?!1:$n(t,{0(){return e.matches(fP)},1(){let r=e;for(;r!==null;){if(r.matches(fP))return!0;r=r.parentElement}return!1}})}var xV=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(xV||{});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 wV(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 _V(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function SV(){return/Android/gi.test(window.navigator.userAgent)}function pP(){return _V()||SV()}function zh(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 CV(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 EV(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!yV(l,hP.Loose)&&l.tabIndex!==-1&&s.preventDefault(),t(s,l)}let o=m.useRef(null);zh("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),zh("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),zh("click",s=>{pP()||o.current&&(i(s,()=>o.current),o.current=null)},!0),zh("touchend",s=>i(s,()=>s.target instanceof HTMLElement?s.target:null),!0),CV("blur",s=>i(s,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function PV(...e){return m.useMemo(()=>o0(...e),[...e])}function gP(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 OV(e,t){let[n,r]=m.useState(()=>gP(e));return xn(()=>{r(gP(e))},[e.type,e.as]),xn(()=>{n||t.current&&t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&r("button")},[n,t]),n}let kV=Symbol();function aa(...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[kV]))?void 0:n}function mP(e){return[e.screenX,e.screenY]}function MV(){let e=m.useRef([-1,-1]);return{wasMoved(t){let n=mP(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=mP(t)}}}function DV({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]),xn(()=>{if(!e||!r)return;let s=o0(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 vP(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 Bh(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}var Hh=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(Hh||{}),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??TV;let l=bP(t,e);if(o)return Vh(l,n,r,s,a);let c=i??0;if(c&2){let{static:d=!1,...f}=l;if(d)return Vh(f,n,r,s,a)}if(c&1){let{unmount:d=!0,...f}=l;return $n(d?0:1,{0(){return null},1(){return Vh({...f,hidden:!0,style:{display:"none"}},n,r,s,a)}})}return Vh(l,n,r,s,a)}function Vh(e,t={},n,r,i){let{as:o=n,children:s,refName:a="ref",...l}=a0(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(s0(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(`
|
|
354
|
+
`),"","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(`
|
|
355
|
+
`)].join(`
|
|
356
|
+
`));let g=d.props,p=typeof(g==null?void 0:g.className)=="function"?(...y)=>Bh(g==null?void 0:g.className(...y),l.className):Bh(g==null?void 0:g.className,l.className),v=p?{className:p}:{};return m.cloneElement(d,Object.assign({},bP(d.props,s0(a0(l,["ref"]))),f,c,{ref:i(d.ref,c.ref)},v))}return m.createElement(o,Object.assign({},a0(l,["ref"]),o!==m.Fragment&&c,o!==m.Fragment&&f),d)}function TV(...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 bP(...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 s0(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function a0(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}let AV="div";var yP=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(yP||{});function IV(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:AV,name:"Hidden"})}let RV=zi(IV),l0=m.createContext(null);l0.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 c0(){return m.useContext(l0)}function xP({value:e,children:t}){return m.createElement(l0.Provider,{value:e},t)}function NV(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let la=[];NV(()=>{function e(t){t.target instanceof HTMLElement&&t.target!==document.body&&la[0]!==t.target&&(la.unshift(t.target),la=la.filter(n=>n!=null&&n.isConnected),la.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 LV(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&&$V(n)?!1:r}function $V(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}function FV(e){throw new Error("Unexpected object: "+e)}var wn=(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))(wn||{});function wP(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:FV(e)}}function _P(e={},t=null,n=[]){for(let[r,i]of Object.entries(e))CP(n,SP(t,r),i);return n}function SP(e,t){return e?e+"["+t+"]":t}function CP(e,t,n){if(Array.isArray(n))for(let[r,i]of n.entries())CP(e,SP(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,""]):_P(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||{}),jV=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(jV||{}),zV=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(zV||{}),BV=(e=>(e[e.Pointer=0]="Pointer",e[e.Focus=1]="Focus",e[e.Other=2]="Other",e))(BV||{}),HV=(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))(HV||{});function u0(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):wV(r,s=>s.dataRef.current.domRef.current),o=n?i.indexOf(n):null;return o===-1&&(o=null),{options:i,activeOptionIndex:o}}let VV={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===wn.Specific?t.idx:wP(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=u0(e);if(a.activeOptionIndex===null){let d=a.options.findIndex(f=>!f.dataRef.current.disabled);d!==-1&&(a.activeOptionIndex=d)}let l=t.focus===wn.Specific?t.idx:wP(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=u0(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=u0(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})}}},d0=m.createContext(null);d0.displayName="ComboboxActionsContext";function Du(e){let t=m.useContext(d0);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Du),n}return t}let EP=m.createContext(null);function WV(e){var t;let n=ca("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=cV({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 xn(()=>{a(l=>l+1)},[(t=n.virtual)==null?void 0:t.options]),m.createElement(EP.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 f0=m.createContext(null);f0.displayName="ComboboxDataContext";function ca(e){let t=m.useContext(f0);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,ca),n}return t}function qV(e,t){return $n(t.type,VV,e,t)}let UV=m.Fragment;function GV(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,_]=hV(n,i,r),[C,O]=m.useReducer(qV,{dataRef:m.createRef(),comboboxState:c?0:1,options:[],virtual:null,activeOptionIndex:null,activationTrigger:2,labelId:null}),P=m.useRef(!1),k=m.useRef({static:!1,hold:!1}),A=m.useRef(null),L=m.useRef(null),F=m.useRef(null),B=m.useRef(null),H=mt(typeof a=="string"?(J,W)=>{let be=a;return(J==null?void 0:J[be])===(W==null?void 0:W[be])}:a??((J,W)=>J===W)),V=mt(J=>C.options.findIndex(W=>H(W.dataRef.current.value,J))),K=m.useCallback(J=>$n($.mode,{1:()=>w.some(W=>H(W,J)),0:()=>H(w,J)}),[w]),Y=mt(J=>C.activeOptionIndex===V(J)),$=m.useMemo(()=>({...C,immediate:y,optionsPropsRef:k,labelRef:A,inputRef:L,buttonRef:F,optionsRef:B,value:w,defaultValue:r,disabled:l,mode:f?1:0,virtual:C.virtual,get activeOptionIndex(){if(P.current&&C.activeOptionIndex===null&&C.options.length>0){let J=C.options.findIndex(W=>!W.dataRef.current.disabled);if(J!==-1)return J}return C.activeOptionIndex},calculateIndex:V,compare:H,isSelected:K,isActive:Y,nullable:d,__demoMode:c}),[w,r,l,f,d,c,C,x]);xn(()=>{},[x,void 0]),xn(()=>{C.dataRef.current=$},[$]),EV([$.buttonRef,$.inputRef,$.optionsRef],()=>ge.closeCombobox(),$.comboboxState===0);let X=m.useMemo(()=>{var J,W,be;return{open:$.comboboxState===0,disabled:l,activeIndex:$.activeOptionIndex,activeOption:$.activeOptionIndex===null?null:$.virtual?$.virtual.options[(J=$.activeOptionIndex)!=null?J:0]:(be=(W=$.options[$.activeOptionIndex])==null?void 0:W.dataRef.current.value)!=null?be:null,value:w}},[$,l,w]),j=mt(()=>{if($.activeOptionIndex!==null){if($.virtual)R($.virtual.options[$.activeOptionIndex]);else{let{dataRef:J}=$.options[$.activeOptionIndex];R(J.current.value)}ge.goToOption(wn.Specific,$.activeOptionIndex)}}),ne=mt(()=>{O({type:0}),P.current=!0}),se=mt(()=>{O({type:1}),P.current=!1}),D=mt((J,W,be)=>(P.current=!1,J===wn.Specific?O({type:2,focus:wn.Specific,idx:W,trigger:be}):O({type:2,focus:J,trigger:be}))),q=mt((J,W)=>(O({type:3,payload:{id:J,dataRef:W}}),()=>{$.isActive(W.current.value)&&(P.current=!0),O({type:4,id:J})})),re=mt(J=>(O({type:5,id:J}),()=>O({type:5,id:null}))),R=mt(J=>$n($.mode,{0(){return _==null?void 0:_(J)},1(){let W=$.value.slice(),be=W.findIndex(oe=>H(oe,J));return be===-1?W.push(J):W.splice(be,1),_==null?void 0:_(W)}})),te=mt(J=>{O({type:6,trigger:J})}),ge=m.useMemo(()=>({onChange:R,registerOption:q,registerLabel:re,goToOption:D,closeCombobox:se,openCombobox:ne,setActivationTrigger:te,selectActiveOption:j}),[]),pe=t===null?{}:{ref:t},de=m.useRef(null),ie=ku();return m.useEffect(()=>{de.current&&r!==void 0&&ie.addEventListener(de.current,"reset",()=>{_==null||_(r)})},[de,_]),m.createElement(d0.Provider,{value:ge},m.createElement(f0.Provider,{value:$},m.createElement(xP,{value:$n($.comboboxState,{0:Tr.Open,1:Tr.Closed})},s!=null&&w!=null&&_P({[s]:w}).map(([J,W],be)=>m.createElement(RV,{features:yP.Hidden,ref:be===0?oe=>{var Te;de.current=(Te=oe==null?void 0:oe.closest("form"))!=null?Te:null}:void 0,...s0({key:J,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:o,name:J,value:W})})),xo({ourProps:pe,theirProps:v,slot:X,defaultTag:UV,name:"Combobox"}))))}let YV="input";function KV(e,t){var n,r,i,o,s;let a=Mu(),{id:l=`headlessui-combobox-input-${a}`,onChange:c,displayValue:d,type:f="text",...g}=e,p=ca("Combobox.Input"),v=Du("Combobox.Input"),y=aa(p.inputRef,t),x=PV(p.inputRef),w=m.useRef(!1),_=ku(),C=mt(()=>{v.onChange(null),p.optionsRef.current&&(p.optionsRef.current.scrollTop=0),v.goToOption(wn.Nothing)}),O=function(){var $;return typeof d=="function"&&p.value!==void 0?($=d(p.value))!=null?$:"":typeof p.value=="string"?p.value:""}();vP(([$,X],[j,ne])=>{if(w.current)return;let se=p.inputRef.current;se&&((ne===0&&X===1||$!==j)&&(se.value=$),requestAnimationFrame(()=>{if(w.current||!se||(x==null?void 0:x.activeElement)!==se)return;let{selectionStart:D,selectionEnd:q}=se;Math.abs((q??0)-(D??0))===0&&D===0&&se.setSelectionRange(se.value.length,se.value.length)}))},[O,p.comboboxState,x]),vP(([$],[X])=>{if($===0&&X===1){if(w.current)return;let j=p.inputRef.current;if(!j)return;let ne=j.value,{selectionStart:se,selectionEnd:D,selectionDirection:q}=j;j.value="",j.value=ne,q!==null?j.setSelectionRange(se,D,q):j.setSelectionRange(se,D)}},[p.comboboxState]);let P=m.useRef(!1),k=mt(()=>{P.current=!0}),A=mt(()=>{_.nextFrame(()=>{P.current=!1})}),L=mt($=>{switch(w.current=!0,$.key){case Ar.Enter:if(w.current=!1,p.comboboxState!==0||P.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(wn.Next),1:()=>v.openCombobox()});case Ar.ArrowUp:return w.current=!1,$.preventDefault(),$.stopPropagation(),$n(p.comboboxState,{0:()=>v.goToOption(wn.Previous),1:()=>{v.openCombobox(),_.nextFrame(()=>{p.value||v.goToOption(wn.Last)})}});case Ar.Home:if($.shiftKey)break;return w.current=!1,$.preventDefault(),$.stopPropagation(),v.goToOption(wn.First);case Ar.PageUp:return w.current=!1,$.preventDefault(),$.stopPropagation(),v.goToOption(wn.First);case Ar.End:if($.shiftKey)break;return w.current=!1,$.preventDefault(),$.stopPropagation(),v.goToOption(wn.Last);case Ar.PageDown:return w.current=!1,$.preventDefault(),$.stopPropagation(),v.goToOption(wn.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()}),B=mt($=>{var X,j,ne;let se=(X=$.relatedTarget)!=null?X:la.find(D=>D!==$.currentTarget);if(w.current=!1,!((j=p.optionsRef.current)!=null&&j.contains(se))&&!((ne=p.buttonRef.current)!=null&&ne.contains(se))&&p.comboboxState===0)return $.preventDefault(),p.mode===0&&(p.nullable&&p.value===null?C():p.activationTrigger!==1&&v.selectActiveOption()),v.closeCombobox()}),H=mt($=>{var X,j,ne;let se=(X=$.relatedTarget)!=null?X:la.find(D=>D!==$.currentTarget);(j=p.buttonRef.current)!=null&&j.contains(se)||(ne=p.optionsRef.current)!=null&&ne.contains(se)||p.disabled||p.immediate&&p.comboboxState!==0&&(v.openCombobox(),_.nextFrame(()=>{v.setActivationTrigger(1)}))}),V=r0(()=>{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 X;return!((X=p.virtual)!=null&&X.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:H,onBlur:B};return xo({ourProps:Y,theirProps:g,slot:K,defaultTag:YV,name:"Combobox.Input"})}let XV="button";function QV(e,t){var n;let r=ca("Combobox.Button"),i=Du("Combobox.Button"),o=aa(r.buttonRef,t),s=Mu(),{id:a=`headlessui-combobox-button-${s}`,...l}=e,c=ku(),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(wn.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(LV(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=r0(()=>{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:OV(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:XV,name:"Combobox.Button"})}let ZV="label";function JV(e,t){let n=Mu(),{id:r=`headlessui-combobox-label-${n}`,...i}=e,o=ca("Combobox.Label"),s=Du("Combobox.Label"),a=aa(o.labelRef,t);xn(()=>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:ZV,name:"Combobox.Label"})}let eW="ul",tW=Hh.RenderStrategy|Hh.Static;function nW(e,t){let n=Mu(),{id:r=`headlessui-combobox-options-${n}`,hold:i=!1,...o}=e,s=ca("Combobox.Options"),a=aa(s.optionsRef,t),l=c0(),c=l!==null?(l&Tr.Open)===Tr.Open:s.comboboxState===0;xn(()=>{var p;s.optionsPropsRef.current.static=(p=e.static)!=null?p:!1},[s.optionsPropsRef,e.static]),xn(()=>{s.optionsPropsRef.current.hold=i},[s.optionsPropsRef,i]),DV({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=r0(()=>{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(WV,null,o.children)}),xo({ourProps:g,theirProps:o,slot:f,defaultTag:eW,features:tW,visible:c,name:"Combobox.Options"})}let rW="li";function iW(e,t){var n;let r=Mu(),{id:i=`headlessui-combobox-option-${r}`,disabled:o=!1,value:s,order:a=null,...l}=e,c=ca("Combobox.Option"),d=Du("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(EP),x=aa(t,p,y?y.measureElement:null),w=mt(()=>d.onChange(s));xn(()=>d.registerOption(i,v),[v,i]);let _=m.useRef(!(c.virtual||c.__demoMode));xn(()=>{if(!c.virtual||!c.__demoMode)return;let B=sa();return B.requestAnimationFrame(()=>{_.current=!0}),B.dispose},[c.virtual,c.__demoMode]),xn(()=>{if(!_.current||c.comboboxState!==0||!f||c.activationTrigger===0)return;let B=sa();return B.requestAnimationFrame(()=>{var H,V;(V=(H=p.current)==null?void 0:H.scrollIntoView)==null||V.call(H,{block:"nearest"})}),B.dispose},[p,f,c.comboboxState,c.activationTrigger,c.activeOptionIndex]);let C=mt(B=>{var H;if(o||(H=c.virtual)!=null&&H.disabled(s))return B.preventDefault();w(),pP()||requestAnimationFrame(()=>{var V;return(V=c.inputRef.current)==null?void 0:V.focus({preventScroll:!0})}),c.mode===0&&requestAnimationFrame(()=>d.closeCombobox())}),O=mt(()=>{var B;if(o||(B=c.virtual)!=null&&B.disabled(s))return d.goToOption(wn.Nothing);let H=c.calculateIndex(s);d.goToOption(wn.Specific,H)}),P=MV(),k=mt(B=>P.update(B)),A=mt(B=>{var H;if(!P.wasMoved(B)||o||(H=c.virtual)!=null&&H.disabled(s)||f)return;let V=c.calculateIndex(s);d.goToOption(wn.Specific,V,0)}),L=mt(B=>{var H;P.wasMoved(B)&&(o||(H=c.virtual)!=null&&H.disabled(s)||f&&(c.optionsPropsRef.current.hold||d.goToOption(wn.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:O,onPointerEnter:k,onMouseEnter:k,onPointerMove:A,onMouseMove:A,onPointerLeave:L,onMouseLeave:L},theirProps:l,slot:F,defaultTag:rW,name:"Combobox.Option"})}let oW=zi(GV),sW=zi(QV),aW=zi(KV),lW=zi(JV),cW=zi(nW),uW=zi(iW),El=Object.assign(oW,{Input:aW,Button:sW,Label:lW,Options:cW,Option:uW});function h0(){let e=m.useRef(!1);return xn(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function dW(e=0){let[t,n]=m.useState(e),r=h0(),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 fW(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}function p0(e,...t){e&&t.length>0&&e.classList.add(...t)}function g0(e,...t){e&&t.length>0&&e.classList.remove(...t)}function hW(e,t){let n=sa();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 pW(e,t,n,r){let i=n?"enter":"leave",o=sa(),s=r!==void 0?fW(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 g0(e,...t.base,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),p0(e,...t.base,...a,...c),o.nextFrame(()=>{g0(e,...t.base,...a,...c),p0(e,...t.base,...a,...l),hW(e,()=>(g0(e,...t.base,...a),p0(e,...t.base,...t.entered),s()))}),o.dispose}function gW({immediate:e,container:t,direction:n,classes:r,onStart:i,onStop:o}){let s=h0(),a=ku(),l=ji(n);xn(()=>{e&&(l.current="enter")},[e]),xn(()=>{let c=sa();a.add(c.dispose);let d=t.current;if(d&&l.current!=="idle"&&s.current)return c.dispose(),i.current(l.current),c.add(pW(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 Wh=m.createContext(null);Wh.displayName="TransitionContext";var mW=(e=>(e.Visible="visible",e.Hidden="hidden",e))(mW||{});function vW(){let e=m.useContext(Wh);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function bW(){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 Uh(e){return"children"in e?Uh(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function PP(e,t){let n=ji(e),r=m.useRef([]),i=h0(),o=ku(),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;!Uh(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,_])=>_)).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 yW(){}let xW=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function OP(e){var t;let n={};for(let r of xW)n[r]=(t=e[r])!=null?t:yW;return n}function wW(e){let t=m.useRef(OP(e));return m.useEffect(()=>{t.current=OP(e)},[e]),t}let _W="div",kP=Hh.RenderStrategy;function SW(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=aa(x,t),_=(n=y.unmount)==null||n?es.Unmount:es.Hidden,{show:C,appear:O,initial:P}=vW(),[k,A]=m.useState(C?"visible":"hidden"),L=bW(),{register:F,unregister:B}=L;m.useEffect(()=>F(x),[F,x]),m.useEffect(()=>{if(_===es.Hidden&&x.current){if(C&&k!=="visible"){A("visible");return}return $n(k,{hidden:()=>B(x),visible:()=>F(x)})}},[k,x,F,B,C,_]);let H=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=wW({beforeEnter:i,afterEnter:o,beforeLeave:s,afterLeave:a}),K=i0();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=P&&!O,$=O&&C&&P,X=!K||Y?"idle":C?"enter":"leave",j=dW(0),ne=mt(te=>$n(te,{enter:()=>{j.addFlag(Tr.Opening),V.current.beforeEnter()},leave:()=>{j.addFlag(Tr.Closing),V.current.beforeLeave()},idle:()=>{}})),se=mt(te=>$n(te,{enter:()=>{j.removeFlag(Tr.Opening),V.current.afterEnter()},leave:()=>{j.removeFlag(Tr.Closing),V.current.afterLeave()},idle:()=>{}})),D=PP(()=>{A("hidden"),B(x)},L),q=m.useRef(!1);gW({immediate:$,container:x,classes:H,direction:X,onStart:ji(te=>{q.current=!0,D.onStart(x,te,ne)}),onStop:ji(te=>{q.current=!1,D.onStop(x,te,se),te==="leave"&&!Uh(D)&&(A("hidden"),B(x))})});let re=y,R={ref:w};return $?re={...re,className:Bh(y.className,...H.current.enter,...H.current.enterFrom)}:q.current&&(re.className=Bh(y.className,(r=x.current)==null?void 0:r.className),re.className===""&&delete re.className),m.createElement(qh.Provider,{value:D},m.createElement(xP,{value:$n(k,{visible:Tr.Open,hidden:Tr.Closed})|j.flags},xo({ourProps:R,theirProps:re,defaultTag:_W,features:kP,visible:k==="visible",name:"Transition.Child"})))}function CW(e,t){let{show:n,appear:r=!1,unmount:i=!0,...o}=e,s=m.useRef(null),a=aa(s,t);i0();let l=c0();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=PP(()=>{d("hidden")}),[g,p]=m.useState(!0),v=m.useRef([n]);xn(()=>{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(!Uh(f))d("hidden");else{let C=s.current;if(!C)return;let O=C.getBoundingClientRect();O.x===0&&O.y===0&&O.width===0&&O.height===0&&d("hidden")}},[n,f]);let x={unmount:i},w=mt(()=>{var C;g&&p(!1),(C=e.beforeEnter)==null||C.call(e)}),_=mt(()=>{var C;g&&p(!1),(C=e.beforeLeave)==null||C.call(e)});return m.createElement(qh.Provider,{value:f},m.createElement(Wh.Provider,{value:y},xo({ourProps:{...x,as:m.Fragment,children:m.createElement(MP,{ref:a,...x,...o,beforeEnter:w,beforeLeave:_})},theirProps:{},defaultTag:m.Fragment,features:kP,visible:c==="visible",name:"Transition"})))}function EW(e,t){let n=m.useContext(Wh)!==null,r=c0()!==null;return m.createElement(m.Fragment,null,!n&&r?m.createElement(m0,{ref:t,...e}):m.createElement(MP,{ref:t,...e}))}let m0=zi(CW),MP=zi(SW),PW=zi(EW),OW=Object.assign(m0,{Child:PW,Root:m0});const v0=["text","varchar","nvarchar","nvarchar2","char","character","nchar","char varying","nchar varying","character varying","string"],Pl=["number","integer","int","bigint","smallint","tinyint","byteint","numeric","decimal","dec","double","real","double precision","float","float4","float8"],Tu=["date","datetime","time","timestamp","timestamp without time zone"],DP=["boolean"];function TP(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=y0(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 AP(e,t,n="AVG"){var i,o,s,a;let r={};return v0.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]}),Pl.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 b0(e){return v0.includes(e.dataType)?"string":Pl.includes(e.dataType)?"number":Tu.includes(e.dataType)?"date":DP.includes(e.dataType)?"boolean":"string"}function kW(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 y0(e,t){return e==="public"?t:e?`${e}.${t}`:`${t}`}function MW(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 IP=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,RP=Vd,NP=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return RP(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=IP(d)||IP(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 RP(e,s,l,n==null?void 0:n.class,n==null?void 0:n.className)},x0=NP("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"}}),dt=ue.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},o)=>{const s=r?no:"button";return S.jsx(s,{className:Oe(x0({variant:t,size:n,className:e})),ref:o,...i})});dt.displayName="Button";function DW({filter:e}){const[t,n]=m.useState([]),[r,i]=m.useState(""),[o,s]=m.useState(""),a=m.useRef(null),l=xe(k=>k.authToken),c=xe(k=>k.filterValues),d=xe(k=>k.actions.addOrUpdateFilterValue),f=xe(k=>k.actions.removeFilterValue),{data:g,isLoading:p,isFetching:v,isError:y,refetch:x}=Sr({queryKey:[e.sql],queryFn:()=>Ds("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});m.useEffect(()=>{var k;if(c){const A=c.find(L=>L.filterId===e.id);if(!A){n([]);return}if(A.operation==="in"){const L=(k=g==null?void 0:g.records)==null?void 0:k.filter(F=>A.values.includes(F[e.column]));n(L)}else i(`${A.operation} ${A.values[0]}`)}},[]),m.useEffect(()=>{if(c&&!c.find(A=>A.filterId===e.id)){n([]);return}},[c,e.id]);const w=m.useMemo(()=>{var k;return(k=g==null?void 0:g.records)==null?void 0:k.map((A,L)=>({id:L,value:A[e.column.toLowerCase()]}))},[g,e.column]);function _(k){console.log("custom input");const A=MW(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:b0(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){_(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:b0(e),operation:"in",values:k.map(L=>L.value)};d(A)}function O(){var k;i(""),f(e.id),console.log(e.id),(k=a.current)==null||k.click()}if(p)return S.jsx("div",{children:S.jsx(Rc,{className:" bg-foreground/10 h-8 w-[180px]"})});if(y)return S.jsx("div",{className:"bg-muted h-8 w-[180px] px-2",children:"Error"});if(!g)return null;let P=[];return Pl.includes(e.dataType)?P=w:P=o===""?w:w.filter(k=>k.value.toLowerCase().replace(/\s+/g,"").includes(o.toLowerCase().replace(/\s+/g,""))),S.jsx(El,{value:t,onChange:C,multiple:!0,children:S.jsxs("div",{className:"relative",children:[S.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 focus-visible:ring-offset-teal-300 sm:text-sm",children:[S.jsx(El.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)}}),S.jsx(El.Button,{ref:a,className:"absolute bg-background pl-1 inset-y-0 right-0 flex items-center pr-2",children:S.jsx(Oj,{className:"h-5 w-5 text-gray-400","aria-hidden":"true"})})]}),S.jsx(OW,{as:m.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",afterLeave:()=>s(""),children:S.jsxs(El.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:[Pl.includes(e.dataType)&&S.jsxs(El.Option,{value:r,className:" flex items-center px-3 justify-between gap-2 py-2",children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx("span",{className:" font-thin",children:"#"}),S.jsx("span",{children:r})]}),r&&S.jsx(dt,{variant:"link",className:" h-4 w-3 text-foreground/50 hover:text-foreground/100 cursor-pointer",onClick:k=>{k.stopPropagation(),O()},children:"Clear"})]}),P.length===0&&o!==""?S.jsx("div",{className:"relative cursor-default select-none px-4 py-2 text-gray-700",children:"Nothing found."}):P.map(k=>S.jsx(El.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})=>S.jsxs(S.Fragment,{children:[S.jsx("span",{className:`block truncate ${A?"font-medium":"font-normal"}`,children:typeof k.value=="boolean"?k.value?"True":"False":k.value}),A?S.jsx("span",{className:"absolute inset-y-0 left-0 flex items-center pl-3 text-foreground",children:S.jsx(zE,{className:"h-5 w-5","aria-hidden":"true"})}):null]})},k.id))]})})]})})}const LP=m.forwardRef((e,t)=>m.createElement(Be.label,le({},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()}}))),TW=NP("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Ol=ue.forwardRef(({className:e,...t},n)=>S.jsx(LP,{ref:n,className:Oe(TW(),e),...t}));Ol.displayName=LP.displayName;function Pt(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 Jn(e,t){const n=Pt(e);return isNaN(t)?Ir(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function yi(e,t){const n=Pt(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 w0=6048e5,AW=864e5;let IW={};function Au(){return IW}function Bi(e,t){var a,l,c,d;const n=Au(),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=Pt(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 ua(e){return Bi(e,{weekStartsOn:1})}function $P(e){const t=Pt(e),n=t.getFullYear(),r=Ir(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const i=ua(r),o=Ir(e,0);o.setFullYear(n,0,4),o.setHours(0,0,0,0);const s=ua(o);return t.getTime()>=i.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function kl(e){const t=Pt(e);return t.setHours(0,0,0,0),t}function Gh(e){const t=Pt(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 Hi(e,t){const n=kl(e),r=kl(t),i=+n-Gh(n),o=+r-Gh(r);return Math.round((i-o)/AW)}function RW(e){const t=$P(e),n=Ir(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),ua(n)}function _0(e,t){const n=t*7;return Jn(e,n)}function NW(e,t){return yi(e,t*12)}function LW(e){let t;return e.forEach(function(n){const r=Pt(n);(t===void 0||t<r||isNaN(Number(r)))&&(t=r)}),t||new Date(NaN)}function $W(e){let t;return e.forEach(n=>{const r=Pt(n);(!t||t>r||isNaN(+r))&&(t=r)}),t||new Date(NaN)}function dr(e,t){const n=kl(e),r=kl(t);return+n==+r}function S0(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function FW(e){if(!S0(e)&&typeof e!="number")return!1;const t=Pt(e);return!isNaN(Number(t))}function Iu(e,t){const n=Pt(e),r=Pt(t),i=n.getFullYear()-r.getFullYear(),o=n.getMonth()-r.getMonth();return i*12+o}function jW(e,t,n){const r=Bi(e,n),i=Bi(t,n),o=+r-Gh(r),s=+i-Gh(i);return Math.round((o-s)/w0)}function C0(e){const t=Pt(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function fr(e){const t=Pt(e);return t.setDate(1),t.setHours(0,0,0,0),t}function FP(e){const t=Pt(e),n=Ir(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function E0(e,t){var a,l,c,d;const n=Au(),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=Pt(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 jP(e){return E0(e,{weekStartsOn:1})}const zW={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"}},BW=(e,t,n)=>{let r;const i=zW[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 P0(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const HW={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},VW={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},WW={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},qW={date:P0({formats:HW,defaultWidth:"full"}),time:P0({formats:VW,defaultWidth:"full"}),dateTime:P0({formats:WW,defaultWidth:"full"})},UW={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},GW=(e,t,n,r)=>UW[e];function Ru(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 YW={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},KW={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},XW={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"]},QW={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"]},ZW={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"}},JW={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"}},e6={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:Ru({values:YW,defaultWidth:"wide"}),quarter:Ru({values:KW,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Ru({values:XW,defaultWidth:"wide"}),day:Ru({values:QW,defaultWidth:"wide"}),dayPeriod:Ru({values:ZW,defaultWidth:"wide",formattingValues:JW,defaultFormattingWidth:"wide"})};function Nu(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)?n6(a,f=>f.test(s)):t6(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 t6(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function n6(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function r6(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 i6=/^(\d+)(th|st|nd|rd)?/i,o6=/\d+/i,s6={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},a6={any:[/^b/i,/^(a|c)/i]},l6={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},c6={any:[/1/i,/2/i,/3/i,/4/i]},u6={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},d6={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]},f6={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},h6={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]},p6={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},g6={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}},m6={ordinalNumber:r6({matchPattern:i6,parsePattern:o6,valueCallback:e=>parseInt(e,10)}),era:Nu({matchPatterns:s6,defaultMatchWidth:"wide",parsePatterns:a6,defaultParseWidth:"any"}),quarter:Nu({matchPatterns:l6,defaultMatchWidth:"wide",parsePatterns:c6,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Nu({matchPatterns:u6,defaultMatchWidth:"wide",parsePatterns:d6,defaultParseWidth:"any"}),day:Nu({matchPatterns:f6,defaultMatchWidth:"wide",parsePatterns:h6,defaultParseWidth:"any"}),dayPeriod:Nu({matchPatterns:p6,defaultMatchWidth:"any",parsePatterns:g6,defaultParseWidth:"any"})},zP={code:"en-US",formatDistance:BW,formatLong:qW,formatRelative:GW,localize:e6,match:m6,options:{weekStartsOn:0,firstWeekContainsDate:1}};function v6(e){const t=Pt(e);return Hi(t,FP(t))+1}function BP(e){const t=Pt(e),n=+ua(t)-+RW(t);return Math.round(n/w0)+1}function HP(e,t){var d,f,g,p;const n=Pt(e),r=n.getFullYear(),i=Au(),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 b6(e,t){var a,l,c,d;const n=Au(),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=HP(e,t),o=Ir(e,0);return o.setFullYear(i,0,r),o.setHours(0,0,0,0),Bi(o,t)}function VP(e,t){const n=Pt(e),r=+Bi(n,t)-+b6(n,t);return Math.round(r/w0)+1}function $t(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const ns={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return $t(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):$t(n+1,2)},d(e,t){return $t(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 $t(e.getHours()%12||12,t.length)},H(e,t){return $t(e.getHours(),t.length)},m(e,t){return $t(e.getMinutes(),t.length)},s(e,t){return $t(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return $t(i,t.length)}},Ml={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},WP={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 ns.y(e,t)},Y:function(e,t,n,r){const i=HP(e,r),o=i>0?i:1-i;if(t==="YY"){const s=o%100;return $t(s,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):$t(o,t.length)},R:function(e,t){const n=$P(e);return $t(n,t.length)},u:function(e,t){const n=e.getFullYear();return $t(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 $t(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 $t(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 ns.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 $t(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=VP(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):$t(i,t.length)},I:function(e,t,n){const r=BP(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):$t(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):ns.d(e,t)},D:function(e,t,n){const r=v6(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):$t(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 $t(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 $t(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 $t(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=Ml.noon:r===0?i=Ml.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=Ml.evening:r>=12?i=Ml.afternoon:r>=4?i=Ml.morning:i=Ml.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 ns.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):ns.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):$t(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):$t(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):ns.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):ns.s(e,t)},S:function(e,t){return ns.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return UP(r);case"XXXX":case"XX":return da(r);case"XXXXX":case"XXX":default:return da(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return UP(r);case"xxxx":case"xx":return da(r);case"xxxxx":case"xxx":default:return da(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+qP(r,":");case"OOOO":default:return"GMT"+da(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+qP(r,":");case"zzzz":default:return"GMT"+da(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return $t(r,t.length)},T:function(e,t,n){const r=e.getTime();return $t(r,t.length)}};function qP(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+$t(o,2)}function UP(e,t){return e%60===0?(e>0?"-":"+")+$t(Math.abs(e)/60,2):da(e,t)}function da(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=$t(Math.trunc(r/60),2),o=$t(r%60,2);return n+i+t+o}const GP=(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"})}},YP=(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"})}},y6={p:YP,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return GP(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}}",GP(r,t)).replace("{{time}}",YP(i,t))}},x6=/^D+$/,w6=/^Y+$/,_6=["D","DD","YY","YYYY"];function S6(e){return x6.test(e)}function C6(e){return w6.test(e)}function E6(e,t,n){const r=P6(e,t,n);if(console.warn(r),_6.includes(e))throw new RangeError(r)}function P6(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 O6=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,k6=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,M6=/^'([^]*?)'?$/,D6=/''/g,T6=/[a-zA-Z]/;function Vi(e,t,n){var d,f,g,p,v,y,x,w;const r=Au(),i=(n==null?void 0:n.locale)??r.locale??zP,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=Pt(e);if(!FW(a))throw new RangeError("Invalid time value");let l=t.match(k6).map(_=>{const C=_[0];if(C==="p"||C==="P"){const O=y6[C];return O(_,i.formatLong)}return _}).join("").match(O6).map(_=>{if(_==="''")return{isToken:!1,value:"'"};const C=_[0];if(C==="'")return{isToken:!1,value:A6(_)};if(WP[C])return{isToken:!0,value:_};if(C.match(T6))throw new RangeError("Format string contains an unescaped latin alphabet character `"+C+"`");return{isToken:!1,value:_}});i.localize.preprocessor&&(l=i.localize.preprocessor(a,l));const c={firstWeekContainsDate:o,weekStartsOn:s,locale:i};return l.map(_=>{if(!_.isToken)return _.value;const C=_.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&C6(C)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&S6(C))&&E6(C,t,String(e));const O=WP[C[0]];return O(a,C,i.localize,c)}).join("")}function A6(e){const t=e.match(M6);return t?t[1].replace(D6,"'"):e}function I6(e){const t=Pt(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 R6(e){return Math.trunc(+Pt(e)/1e3)}function N6(e){const t=Pt(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}function L6(e,t){return jW(N6(e),fr(e),t)+1}function O0(e,t){const n=Pt(e),r=Pt(t);return n.getTime()>r.getTime()}function KP(e,t){const n=Pt(e),r=Pt(t);return+n<+r}function k0(e,t){const n=Pt(e),r=Pt(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function $6(e,t){const n=Pt(e),r=Pt(t);return n.getFullYear()===r.getFullYear()}function M0(e,t){return Jn(e,-t)}function D0(e,t){const n=Pt(e),r=n.getFullYear(),i=n.getDate(),o=Ir(e,0);o.setFullYear(r,t,15),o.setHours(0,0,0,0);const s=I6(o);return n.setMonth(t,Math.min(i,s)),n}function XP(e,t){const n=Pt(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 F6(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 QP(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 T0={exports:{}},Lu={};/**
|
|
357
|
+
* @license React
|
|
358
|
+
* react-jsx-runtime.development.js
|
|
359
|
+
*
|
|
360
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
361
|
+
*
|
|
362
|
+
* This source code is licensed under the MIT license found in the
|
|
363
|
+
* LICENSE file in the root directory of this source tree.
|
|
364
|
+
*/var ZP;function j6(){return ZP||(ZP=1,process.env.NODE_ENV!=="production"&&function(){var e=m,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),a=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),v=Symbol.iterator,y="@@iterator";function x(M){if(M===null||typeof M!="object")return null;var G=v&&M[v]||M[y];return typeof G=="function"?G:null}var w=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function _(M){{for(var G=arguments.length,ae=new Array(G>1?G-1:0),Se=1;Se<G;Se++)ae[Se-1]=arguments[Se];C("error",M,ae)}}function C(M,G,ae){{var Se=w.ReactDebugCurrentFrame,Ne=Se.getStackAddendum();Ne!==""&&(G+="%s",ae=ae.concat([Ne]));var je=ae.map(function(Ae){return String(Ae)});je.unshift("Warning: "+G),Function.prototype.apply.call(console[M],console,je)}}var O=!1,P=!1,k=!1,A=!1,L=!1,F;F=Symbol.for("react.module.reference");function B(M){return!!(typeof M=="string"||typeof M=="function"||M===r||M===o||L||M===i||M===c||M===d||A||M===p||O||P||k||typeof M=="object"&&M!==null&&(M.$$typeof===g||M.$$typeof===f||M.$$typeof===s||M.$$typeof===a||M.$$typeof===l||M.$$typeof===F||M.getModuleId!==void 0))}function H(M,G,ae){var Se=M.displayName;if(Se)return Se;var Ne=G.displayName||G.name||"";return Ne!==""?ae+"("+Ne+")":ae}function V(M){return M.displayName||"Context"}function K(M){if(M==null)return null;if(typeof M.tag=="number"&&_("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof M=="function")return M.displayName||M.name||null;if(typeof M=="string")return M;switch(M){case r:return"Fragment";case n:return"Portal";case o:return"Profiler";case i:return"StrictMode";case c:return"Suspense";case d:return"SuspenseList"}if(typeof M=="object")switch(M.$$typeof){case a:var G=M;return V(G)+".Consumer";case s:var ae=M;return V(ae._context)+".Provider";case l:return H(M,M.render,"ForwardRef");case f:var Se=M.displayName||null;return Se!==null?Se:K(M.type)||"Memo";case g:{var Ne=M,je=Ne._payload,Ae=Ne._init;try{return K(Ae(je))}catch{return null}}}return null}var Y=Object.assign,$=0,X,j,ne,se,D,q,re;function R(){}R.__reactDisabledLog=!0;function te(){{if($===0){X=console.log,j=console.info,ne=console.warn,se=console.error,D=console.group,q=console.groupCollapsed,re=console.groupEnd;var M={configurable:!0,enumerable:!0,value:R,writable:!0};Object.defineProperties(console,{info:M,log:M,warn:M,error:M,group:M,groupCollapsed:M,groupEnd:M})}$++}}function ge(){{if($--,$===0){var M={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:Y({},M,{value:X}),info:Y({},M,{value:j}),warn:Y({},M,{value:ne}),error:Y({},M,{value:se}),group:Y({},M,{value:D}),groupCollapsed:Y({},M,{value:q}),groupEnd:Y({},M,{value:re})})}$<0&&_("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var pe=w.ReactCurrentDispatcher,de;function ie(M,G,ae){{if(de===void 0)try{throw Error()}catch(Ne){var Se=Ne.stack.trim().match(/\n( *(at )?)/);de=Se&&Se[1]||""}return`
|
|
365
|
+
`+de+M}}var J=!1,W;{var be=typeof WeakMap=="function"?WeakMap:Map;W=new be}function oe(M,G){if(!M||J)return"";{var ae=W.get(M);if(ae!==void 0)return ae}var Se;J=!0;var Ne=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var je;je=pe.current,pe.current=null,te();try{if(G){var Ae=function(){throw Error()};if(Object.defineProperty(Ae.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ae,[])}catch(nn){Se=nn}Reflect.construct(M,[],Ae)}else{try{Ae.call()}catch(nn){Se=nn}M.call(Ae.prototype)}}else{try{throw Error()}catch(nn){Se=nn}M()}}catch(nn){if(nn&&Se&&typeof nn.stack=="string"){for(var Me=nn.stack.split(`
|
|
366
|
+
`),Ot=Se.stack.split(`
|
|
367
|
+
`),Ze=Me.length-1,nt=Ot.length-1;Ze>=1&&nt>=0&&Me[Ze]!==Ot[nt];)nt--;for(;Ze>=1&&nt>=0;Ze--,nt--)if(Me[Ze]!==Ot[nt]){if(Ze!==1||nt!==1)do if(Ze--,nt--,nt<0||Me[Ze]!==Ot[nt]){var zt=`
|
|
368
|
+
`+Me[Ze].replace(" at new "," at ");return M.displayName&&zt.includes("<anonymous>")&&(zt=zt.replace("<anonymous>",M.displayName)),typeof M=="function"&&W.set(M,zt),zt}while(Ze>=1&&nt>=0);break}}}finally{J=!1,pe.current=je,ge(),Error.prepareStackTrace=Ne}var Tn=M?M.displayName||M.name:"",ja=Tn?ie(Tn):"";return typeof M=="function"&&W.set(M,ja),ja}function Te(M,G,ae){return oe(M,!1)}function Fe(M){var G=M.prototype;return!!(G&&G.isReactComponent)}function Ve(M,G,ae){if(M==null)return"";if(typeof M=="function")return oe(M,Fe(M));if(typeof M=="string")return ie(M);switch(M){case c:return ie("Suspense");case d:return ie("SuspenseList")}if(typeof M=="object")switch(M.$$typeof){case l:return Te(M.render);case f:return Ve(M.type,G,ae);case g:{var Se=M,Ne=Se._payload,je=Se._init;try{return Ve(je(Ne),G,ae)}catch{}}}return""}var Ke=Object.prototype.hasOwnProperty,St={},vt=w.ReactDebugCurrentFrame;function bt(M){if(M){var G=M._owner,ae=Ve(M.type,M._source,G?G.type:null);vt.setExtraStackFrame(ae)}else vt.setExtraStackFrame(null)}function tn(M,G,ae,Se,Ne){{var je=Function.call.bind(Ke);for(var Ae in M)if(je(M,Ae)){var Me=void 0;try{if(typeof M[Ae]!="function"){var Ot=Error((Se||"React class")+": "+ae+" type `"+Ae+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof M[Ae]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Ot.name="Invariant Violation",Ot}Me=M[Ae](G,Ae,Se,ae,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Ze){Me=Ze}Me&&!(Me instanceof Error)&&(bt(Ne),_("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",Se||"React class",ae,Ae,typeof Me),bt(null)),Me instanceof Error&&!(Me.message in St)&&(St[Me.message]=!0,bt(Ne),_("Failed %s type: %s",ae,Me.message),bt(null))}}}var Jt=Array.isArray;function Dn(M){return Jt(M)}function fn(M){{var G=typeof Symbol=="function"&&Symbol.toStringTag,ae=G&&M[Symbol.toStringTag]||M.constructor.name||"Object";return ae}}function Da(M){try{return fe(M),!1}catch{return!0}}function fe(M){return""+M}function Pe(M){if(Da(M))return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",fn(M)),fe(M)}var Le=w.ReactCurrentOwner,Xe={key:!0,ref:!0,__self:!0,__source:!0},yt,hn,Sn;Sn={};function Fn(M){if(Ke.call(M,"ref")){var G=Object.getOwnPropertyDescriptor(M,"ref").get;if(G&&G.isReactWarning)return!1}return M.ref!==void 0}function zr(M){if(Ke.call(M,"key")){var G=Object.getOwnPropertyDescriptor(M,"key").get;if(G&&G.isReactWarning)return!1}return M.key!==void 0}function Br(M,G){if(typeof M.ref=="string"&&Le.current&&G&&Le.current.stateNode!==G){var ae=K(Le.current.type);Sn[ae]||(_('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',K(Le.current.type),M.ref),Sn[ae]=!0)}}function pn(M,G){{var ae=function(){yt||(yt=!0,_("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",G))};ae.isReactWarning=!0,Object.defineProperty(M,"key",{get:ae,configurable:!0})}}function mr(M,G){{var ae=function(){hn||(hn=!0,_("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",G))};ae.isReactWarning=!0,Object.defineProperty(M,"ref",{get:ae,configurable:!0})}}var jn=function(M,G,ae,Se,Ne,je,Ae){var Me={$$typeof:t,type:M,key:G,ref:ae,props:Ae,_owner:je};return Me._store={},Object.defineProperty(Me._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(Me,"_self",{configurable:!1,enumerable:!1,writable:!1,value:Se}),Object.defineProperty(Me,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Ne}),Object.freeze&&(Object.freeze(Me.props),Object.freeze(Me)),Me};function wd(M,G,ae,Se,Ne){{var je,Ae={},Me=null,Ot=null;ae!==void 0&&(Pe(ae),Me=""+ae),zr(G)&&(Pe(G.key),Me=""+G.key),Fn(G)&&(Ot=G.ref,Br(G,Ne));for(je in G)Ke.call(G,je)&&!Xe.hasOwnProperty(je)&&(Ae[je]=G[je]);if(M&&M.defaultProps){var Ze=M.defaultProps;for(je in Ze)Ae[je]===void 0&&(Ae[je]=Ze[je])}if(Me||Ot){var nt=typeof M=="function"?M.displayName||M.name||"Unknown":M;Me&&pn(Ae,nt),Ot&&mr(Ae,nt)}return jn(M,Me,Ot,Ne,Se,Le.current,Ae)}}var So=w.ReactCurrentOwner,Ta=w.ReactDebugCurrentFrame;function Yn(M){if(M){var G=M._owner,ae=Ve(M.type,M._source,G?G.type:null);Ta.setExtraStackFrame(ae)}else Ta.setExtraStackFrame(null)}var Zi;Zi=!1;function Co(M){return typeof M=="object"&&M!==null&&M.$$typeof===t}function Aa(){{if(So.current){var M=K(So.current.type);if(M)return`
|
|
369
|
+
|
|
370
|
+
Check the render method of \``+M+"`."}return""}}function _d(M){{if(M!==void 0){var G=M.fileName.replace(/^.*[\\\/]/,""),ae=M.lineNumber;return`
|
|
371
|
+
|
|
372
|
+
Check your code at `+G+":"+ae+"."}return""}}var Ia={};function lc(M){{var G=Aa();if(!G){var ae=typeof M=="string"?M:M.displayName||M.name;ae&&(G=`
|
|
373
|
+
|
|
374
|
+
Check the top-level render call using <`+ae+">.")}return G}}function Ra(M,G){{if(!M._store||M._store.validated||M.key!=null)return;M._store.validated=!0;var ae=lc(G);if(Ia[ae])return;Ia[ae]=!0;var Se="";M&&M._owner&&M._owner!==So.current&&(Se=" It was passed a child from "+K(M._owner.type)+"."),Yn(M),_('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',ae,Se),Yn(null)}}function Na(M,G){{if(typeof M!="object")return;if(Dn(M))for(var ae=0;ae<M.length;ae++){var Se=M[ae];Co(Se)&&Ra(Se,G)}else if(Co(M))M._store&&(M._store.validated=!0);else if(M){var Ne=x(M);if(typeof Ne=="function"&&Ne!==M.entries)for(var je=Ne.call(M),Ae;!(Ae=je.next()).done;)Co(Ae.value)&&Ra(Ae.value,G)}}}function Sd(M){{var G=M.type;if(G==null||typeof G=="string")return;var ae;if(typeof G=="function")ae=G.propTypes;else if(typeof G=="object"&&(G.$$typeof===l||G.$$typeof===f))ae=G.propTypes;else return;if(ae){var Se=K(G);tn(ae,M.props,"prop",Se,M)}else if(G.PropTypes!==void 0&&!Zi){Zi=!0;var Ne=K(G);_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Ne||"Unknown")}typeof G.getDefaultProps=="function"&&!G.getDefaultProps.isReactClassApproved&&_("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function La(M){{for(var G=Object.keys(M.props),ae=0;ae<G.length;ae++){var Se=G[ae];if(Se!=="children"&&Se!=="key"){Yn(M),_("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Se),Yn(null);break}}M.ref!==null&&(Yn(M),_("Invalid attribute `ref` supplied to `React.Fragment`."),Yn(null))}}function $a(M,G,ae,Se,Ne,je){{var Ae=B(M);if(!Ae){var Me="";(M===void 0||typeof M=="object"&&M!==null&&Object.keys(M).length===0)&&(Me+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Ot=_d(Ne);Ot?Me+=Ot:Me+=Aa();var Ze;M===null?Ze="null":Dn(M)?Ze="array":M!==void 0&&M.$$typeof===t?(Ze="<"+(K(M.type)||"Unknown")+" />",Me=" Did you accidentally export a JSX literal instead of a component?"):Ze=typeof M,_("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Ze,Me)}var nt=wd(M,G,ae,Ne,je);if(nt==null)return nt;if(Ae){var zt=G.children;if(zt!==void 0)if(Se)if(Dn(zt)){for(var Tn=0;Tn<zt.length;Tn++)Na(zt[Tn],M);Object.freeze&&Object.freeze(zt)}else _("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Na(zt,M)}return M===r?La(nt):Sd(nt),nt}}function Fa(M,G,ae){return $a(M,G,ae,!0)}function Cd(M,G,ae){return $a(M,G,ae,!1)}var Ed=Cd,Pd=Fa;Lu.Fragment=r,Lu.jsx=Ed,Lu.jsxs=Pd}()),Lu}var $u={};/**
|
|
375
|
+
* @license React
|
|
376
|
+
* react-jsx-runtime.production.min.js
|
|
377
|
+
*
|
|
378
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
379
|
+
*
|
|
380
|
+
* This source code is licensed under the MIT license found in the
|
|
381
|
+
* LICENSE file in the root directory of this source tree.
|
|
382
|
+
*/var JP;function z6(){if(JP)return $u;JP=1;var e=m,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(a,l,c){var d,f={},g=null,p=null;c!==void 0&&(g=""+c),l.key!==void 0&&(g=""+l.key),l.ref!==void 0&&(p=l.ref);for(d in l)r.call(l,d)&&!o.hasOwnProperty(d)&&(f[d]=l[d]);if(a&&a.defaultProps)for(d in l=a.defaultProps,l)f[d]===void 0&&(f[d]=l[d]);return{$$typeof:t,type:a,key:g,ref:p,props:f,_owner:i.current}}return $u.Fragment=n,$u.jsx=s,$u.jsxs=s,$u}process.env.NODE_ENV==="production"?T0.exports=z6():T0.exports=j6();var ye=T0.exports;function Fu(e){return e.mode==="multiple"}function ju(e){return e.mode==="range"}function Yh(e){return e.mode==="single"}var B6={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};function H6(e,t){return Vi(e,"LLLL y",t)}function V6(e,t){return Vi(e,"d",t)}function W6(e,t){return Vi(e,"LLLL",t)}function q6(e){return"".concat(e)}function U6(e,t){return Vi(e,"cccccc",t)}function G6(e,t){return Vi(e,"yyyy",t)}var Y6=Object.freeze({__proto__:null,formatCaption:H6,formatDay:V6,formatMonthCaption:W6,formatWeekNumber:q6,formatWeekdayName:U6,formatYearCaption:G6}),K6=function(e,t,n){return Vi(e,"do MMMM (EEEE)",n)},X6=function(){return"Month: "},Q6=function(){return"Go to next month"},Z6=function(){return"Go to previous month"},J6=function(e,t){return Vi(e,"cccc",t)},eq=function(e){return"Week n. ".concat(e)},tq=function(){return"Year: "},nq=Object.freeze({__proto__:null,labelDay:K6,labelMonthDropdown:X6,labelNext:Q6,labelPrevious:Z6,labelWeekNumber:eq,labelWeekday:J6,labelYearDropdown:tq});function rq(){var e="buttons",t=B6,n=zP,r={},i={},o=1,s={},a=new Date;return{captionLayout:e,classNames:t,formatters:Y6,labels:nq,locale:n,modifiersClassNames:r,modifiers:i,numberOfMonths:o,styles:s,today:a,mode:"default"}}function iq(e){var t=e.fromYear,n=e.toYear,r=e.fromMonth,i=e.toMonth,o=e.fromDate,s=e.toDate;return r?o=fr(r):t&&(o=new Date(t,0,1)),i?s=C0(i):n&&(s=new Date(n,11,31)),{fromDate:o?kl(o):void 0,toDate:s?kl(s):void 0}}var eO=m.createContext(void 0);function oq(e){var t,n=e.initialProps,r=rq(),i=iq(n),o=i.fromDate,s=i.toDate,a=(t=n.captionLayout)!==null&&t!==void 0?t:r.captionLayout;a!=="buttons"&&(!o||!s)&&(a="buttons");var l;(Yh(n)||Fu(n)||ju(n))&&(l=n.onSelect);var c=Ue(Ue(Ue({},r),n),{captionLayout:a,classNames:Ue(Ue({},r.classNames),n.classNames),components:Ue({},n.components),formatters:Ue(Ue({},r.formatters),n.formatters),fromDate:o,labels:Ue(Ue({},r.labels),n.labels),mode:n.mode||r.mode,modifiers:Ue(Ue({},r.modifiers),n.modifiers),modifiersClassNames:Ue(Ue({},r.modifiersClassNames),n.modifiersClassNames),onSelect:l,styles:Ue(Ue({},r.styles),n.styles),toDate:s});return ye.jsx(eO.Provider,{value:c,children:e.children})}function Ht(){var e=m.useContext(eO);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function tO(e){var t=Ht(),n=t.locale,r=t.classNames,i=t.styles,o=t.formatters.formatCaption;return ye.jsx("div",{className:r.caption_label,style:i.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:o(e.displayMonth,{locale:n})})}function sq(e){return ye.jsx("svg",Ue({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:ye.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function nO(e){var t,n,r=e.onChange,i=e.value,o=e.children,s=e.caption,a=e.className,l=e.style,c=Ht(),d=(n=(t=c.components)===null||t===void 0?void 0:t.IconDropdown)!==null&&n!==void 0?n:sq;return ye.jsxs("div",{className:a,style:l,children:[ye.jsx("span",{className:c.classNames.vhidden,children:e["aria-label"]}),ye.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:c.classNames.dropdown,style:c.styles.dropdown,value:i,onChange:r,children:o}),ye.jsxs("div",{className:c.classNames.caption_label,style:c.styles.caption_label,"aria-hidden":"true",children:[s,ye.jsx(d,{className:c.classNames.dropdown_icon,style:c.styles.dropdown_icon})]})]})}function aq(e){var t,n=Ht(),r=n.fromDate,i=n.toDate,o=n.styles,s=n.locale,a=n.formatters.formatMonthCaption,l=n.classNames,c=n.components,d=n.labels.labelMonthDropdown;if(!r)return ye.jsx(ye.Fragment,{});if(!i)return ye.jsx(ye.Fragment,{});var f=[];if($6(r,i))for(var g=fr(r),p=r.getMonth();p<=i.getMonth();p++)f.push(D0(g,p));else for(var g=fr(new Date),p=0;p<=11;p++)f.push(D0(g,p));var v=function(x){var w=Number(x.target.value),_=D0(fr(e.displayMonth),w);e.onChange(_)},y=(t=c==null?void 0:c.Dropdown)!==null&&t!==void 0?t:nO;return ye.jsx(y,{name:"months","aria-label":d(),className:l.dropdown_month,style:o.dropdown_month,onChange:v,value:e.displayMonth.getMonth(),caption:a(e.displayMonth,{locale:s}),children:f.map(function(x){return ye.jsx("option",{value:x.getMonth(),children:a(x,{locale:s})},x.getMonth())})})}function lq(e){var t,n=e.displayMonth,r=Ht(),i=r.fromDate,o=r.toDate,s=r.locale,a=r.styles,l=r.classNames,c=r.components,d=r.formatters.formatYearCaption,f=r.labels.labelYearDropdown,g=[];if(!i)return ye.jsx(ye.Fragment,{});if(!o)return ye.jsx(ye.Fragment,{});for(var p=i.getFullYear(),v=o.getFullYear(),y=p;y<=v;y++)g.push(XP(FP(new Date),y));var x=function(_){var C=XP(fr(n),Number(_.target.value));e.onChange(C)},w=(t=c==null?void 0:c.Dropdown)!==null&&t!==void 0?t:nO;return ye.jsx(w,{name:"years","aria-label":f(),className:l.dropdown_year,style:a.dropdown_year,onChange:x,value:n.getFullYear(),caption:d(n,{locale:s}),children:g.map(function(_){return ye.jsx("option",{value:_.getFullYear(),children:d(_,{locale:s})},_.getFullYear())})})}function cq(e,t){var n=m.useState(e),r=n[0],i=n[1],o=t===void 0?r:t;return[o,i]}function uq(e){var t=e.month,n=e.defaultMonth,r=e.today,i=t||n||r||new Date,o=e.toDate,s=e.fromDate,a=e.numberOfMonths,l=a===void 0?1:a;if(o&&Iu(o,i)<0){var c=-1*(l-1);i=yi(o,c)}return s&&Iu(i,s)<0&&(i=s),fr(i)}function dq(){var e=Ht(),t=uq(e),n=cq(t,e.month),r=n[0],i=n[1],o=function(s){var a;if(!e.disableNavigation){var l=fr(s);i(l),(a=e.onMonthChange)===null||a===void 0||a.call(e,l)}};return[r,o]}function fq(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,i=fr(e),o=fr(yi(i,r)),s=Iu(o,i),a=[],l=0;l<s;l++){var c=yi(i,l);a.push(c)}return n&&(a=a.reverse()),a}function hq(e,t){if(!t.disableNavigation){var n=t.toDate,r=t.pagedNavigation,i=t.numberOfMonths,o=i===void 0?1:i,s=r?o:1,a=fr(e);if(!n)return yi(a,s);var l=Iu(n,e);if(!(l<o))return yi(a,s)}}function pq(e,t){if(!t.disableNavigation){var n=t.fromDate,r=t.pagedNavigation,i=t.numberOfMonths,o=i===void 0?1:i,s=r?o:1,a=fr(e);if(!n)return yi(a,-s);var l=Iu(a,n);if(!(l<=0))return yi(a,-s)}}var rO=m.createContext(void 0);function gq(e){var t=Ht(),n=dq(),r=n[0],i=n[1],o=fq(r,t),s=hq(r,t),a=pq(r,t),l=function(f){return o.some(function(g){return k0(f,g)})},c=function(f,g){l(f)||(g&&KP(f,g)?i(yi(f,1+t.numberOfMonths*-1)):i(f))},d={currentMonth:r,displayMonths:o,goToMonth:i,goToDate:c,previousMonth:a,nextMonth:s,isDateDisplayed:l};return ye.jsx(rO.Provider,{value:d,children:e.children})}function zu(){var e=m.useContext(rO);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function iO(e){var t,n=Ht(),r=n.classNames,i=n.styles,o=n.components,s=zu().goToMonth,a=function(d){s(yi(d,e.displayIndex?-e.displayIndex:0))},l=(t=o==null?void 0:o.CaptionLabel)!==null&&t!==void 0?t:tO,c=ye.jsx(l,{id:e.id,displayMonth:e.displayMonth});return ye.jsxs("div",{className:r.caption_dropdowns,style:i.caption_dropdowns,children:[ye.jsx("div",{className:r.vhidden,children:c}),ye.jsx(aq,{onChange:a,displayMonth:e.displayMonth}),ye.jsx(lq,{onChange:a,displayMonth:e.displayMonth})]})}function mq(e){return ye.jsx("svg",Ue({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:ye.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function vq(e){return ye.jsx("svg",Ue({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:ye.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var Kh=m.forwardRef(function(e,t){var n=Ht(),r=n.classNames,i=n.styles,o=[r.button_reset,r.button];e.className&&o.push(e.className);var s=o.join(" "),a=Ue(Ue({},i.button_reset),i.button);return e.style&&Object.assign(a,e.style),ye.jsx("button",Ue({},e,{ref:t,type:"button",className:s,style:a}))});function bq(e){var t,n,r=Ht(),i=r.dir,o=r.locale,s=r.classNames,a=r.styles,l=r.labels,c=l.labelPrevious,d=l.labelNext,f=r.components;if(!e.nextMonth&&!e.previousMonth)return ye.jsx(ye.Fragment,{});var g=c(e.previousMonth,{locale:o}),p=[s.nav_button,s.nav_button_previous].join(" "),v=d(e.nextMonth,{locale:o}),y=[s.nav_button,s.nav_button_next].join(" "),x=(t=f==null?void 0:f.IconRight)!==null&&t!==void 0?t:vq,w=(n=f==null?void 0:f.IconLeft)!==null&&n!==void 0?n:mq;return ye.jsxs("div",{className:s.nav,style:a.nav,children:[!e.hidePrevious&&ye.jsx(Kh,{name:"previous-month","aria-label":g,className:p,style:a.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:i==="rtl"?ye.jsx(x,{className:s.nav_icon,style:a.nav_icon}):ye.jsx(w,{className:s.nav_icon,style:a.nav_icon})}),!e.hideNext&&ye.jsx(Kh,{name:"next-month","aria-label":v,className:y,style:a.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:i==="rtl"?ye.jsx(w,{className:s.nav_icon,style:a.nav_icon}):ye.jsx(x,{className:s.nav_icon,style:a.nav_icon})})]})}function oO(e){var t=Ht().numberOfMonths,n=zu(),r=n.previousMonth,i=n.nextMonth,o=n.goToMonth,s=n.displayMonths,a=s.findIndex(function(v){return k0(e.displayMonth,v)}),l=a===0,c=a===s.length-1,d=t>1&&(l||!c),f=t>1&&(c||!l),g=function(){r&&o(r)},p=function(){i&&o(i)};return ye.jsx(bq,{displayMonth:e.displayMonth,hideNext:d,hidePrevious:f,nextMonth:i,previousMonth:r,onPreviousClick:g,onNextClick:p})}function yq(e){var t,n=Ht(),r=n.classNames,i=n.disableNavigation,o=n.styles,s=n.captionLayout,a=n.components,l=(t=a==null?void 0:a.CaptionLabel)!==null&&t!==void 0?t:tO,c;return i?c=ye.jsx(l,{id:e.id,displayMonth:e.displayMonth}):s==="dropdown"?c=ye.jsx(iO,{displayMonth:e.displayMonth,id:e.id}):s==="dropdown-buttons"?c=ye.jsxs(ye.Fragment,{children:[ye.jsx(iO,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),ye.jsx(oO,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):c=ye.jsxs(ye.Fragment,{children:[ye.jsx(l,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),ye.jsx(oO,{displayMonth:e.displayMonth,id:e.id})]}),ye.jsx("div",{className:r.caption,style:o.caption,children:c})}function xq(e){var t=Ht(),n=t.footer,r=t.styles,i=t.classNames.tfoot;return n?ye.jsx("tfoot",{className:i,style:r.tfoot,children:ye.jsx("tr",{children:ye.jsx("td",{colSpan:8,children:n})})}):ye.jsx(ye.Fragment,{})}function wq(e,t,n){for(var r=n?ua(new Date):Bi(new Date,{locale:e,weekStartsOn:t}),i=[],o=0;o<7;o++){var s=Jn(r,o);i.push(s)}return i}function _q(){var e=Ht(),t=e.classNames,n=e.styles,r=e.showWeekNumber,i=e.locale,o=e.weekStartsOn,s=e.ISOWeek,a=e.formatters.formatWeekdayName,l=e.labels.labelWeekday,c=wq(i,o,s);return ye.jsxs("tr",{style:n.head_row,className:t.head_row,children:[r&&ye.jsx("td",{style:n.head_cell,className:t.head_cell}),c.map(function(d,f){return ye.jsx("th",{scope:"col",className:t.head_cell,style:n.head_cell,"aria-label":l(d,{locale:i}),children:a(d,{locale:i})},f)})]})}function Sq(){var e,t=Ht(),n=t.classNames,r=t.styles,i=t.components,o=(e=i==null?void 0:i.HeadRow)!==null&&e!==void 0?e:_q;return ye.jsx("thead",{style:r.head,className:n.head,children:ye.jsx(o,{})})}function Cq(e){var t=Ht(),n=t.locale,r=t.formatters.formatDay;return ye.jsx(ye.Fragment,{children:r(e.date,{locale:n})})}var A0=m.createContext(void 0);function Eq(e){if(!Fu(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return ye.jsx(A0.Provider,{value:t,children:e.children})}return ye.jsx(Pq,{initialProps:e.initialProps,children:e.children})}function Pq(e){var t=e.initialProps,n=e.children,r=t.selected,i=t.min,o=t.max,s=function(c,d,f){var g,p;(g=t.onDayClick)===null||g===void 0||g.call(t,c,d,f);var v=!!(d.selected&&i&&(r==null?void 0:r.length)===i);if(!v){var y=!!(!d.selected&&o&&(r==null?void 0:r.length)===o);if(!y){var x=r?QP([],r,!0):[];if(d.selected){var w=x.findIndex(function(_){return dr(c,_)});x.splice(w,1)}else x.push(c);(p=t.onSelect)===null||p===void 0||p.call(t,x,c,d,f)}}},a={disabled:[]};r&&a.disabled.push(function(c){var d=o&&r.length>o-1,f=r.some(function(g){return dr(g,c)});return!!(d&&!f)});var l={selected:r,onDayClick:s,modifiers:a};return ye.jsx(A0.Provider,{value:l,children:n})}function I0(){var e=m.useContext(A0);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function Oq(e,t){var n=t||{},r=n.from,i=n.to;return r&&i?dr(i,e)&&dr(r,e)?void 0:dr(i,e)?{from:i,to:void 0}:dr(r,e)?void 0:O0(r,e)?{from:e,to:i}:{from:r,to:e}:i?O0(e,i)?{from:i,to:e}:{from:e,to:i}:r?KP(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}var R0=m.createContext(void 0);function kq(e){if(!ju(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return ye.jsx(R0.Provider,{value:t,children:e.children})}return ye.jsx(Mq,{initialProps:e.initialProps,children:e.children})}function Mq(e){var t=e.initialProps,n=e.children,r=t.selected,i=r||{},o=i.from,s=i.to,a=t.min,l=t.max,c=function(p,v,y){var x,w;(x=t.onDayClick)===null||x===void 0||x.call(t,p,v,y);var _=Oq(p,r);(w=t.onSelect)===null||w===void 0||w.call(t,_,p,v,y)},d={range_start:[],range_end:[],range_middle:[],disabled:[]};if(o?(d.range_start=[o],s?(d.range_end=[s],dr(o,s)||(d.range_middle=[{after:o,before:s}])):d.range_end=[o]):s&&(d.range_start=[s],d.range_end=[s]),a&&(o&&!s&&d.disabled.push({after:M0(o,a-1),before:Jn(o,a-1)}),o&&s&&d.disabled.push({after:o,before:Jn(o,a-1)}),!o&&s&&d.disabled.push({after:M0(s,a-1),before:Jn(s,a-1)})),l){if(o&&!s&&(d.disabled.push({before:Jn(o,-l+1)}),d.disabled.push({after:Jn(o,l-1)})),o&&s){var f=Hi(s,o)+1,g=l-f;d.disabled.push({before:M0(o,g)}),d.disabled.push({after:Jn(s,g)})}!o&&s&&(d.disabled.push({before:Jn(s,-l+1)}),d.disabled.push({after:Jn(s,l-1)}))}return ye.jsx(R0.Provider,{value:{selected:r,onDayClick:c,modifiers:d},children:n})}function N0(){var e=m.useContext(R0);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function Xh(e){return Array.isArray(e)?QP([],e,!0):e!==void 0?[e]:[]}function Dq(e){var t={};return Object.entries(e).forEach(function(n){var r=n[0],i=n[1];t[r]=Xh(i)}),t}var xi;(function(e){e.Outside="outside",e.Disabled="disabled",e.Selected="selected",e.Hidden="hidden",e.Today="today",e.RangeStart="range_start",e.RangeEnd="range_end",e.RangeMiddle="range_middle"})(xi||(xi={}));var Tq=xi.Selected,wo=xi.Disabled,Aq=xi.Hidden,Iq=xi.Today,L0=xi.RangeEnd,$0=xi.RangeMiddle,F0=xi.RangeStart,Rq=xi.Outside;function Nq(e,t,n){var r,i=(r={},r[Tq]=Xh(e.selected),r[wo]=Xh(e.disabled),r[Aq]=Xh(e.hidden),r[Iq]=[e.today],r[L0]=[],r[$0]=[],r[F0]=[],r[Rq]=[],r);return e.fromDate&&i[wo].push({before:e.fromDate}),e.toDate&&i[wo].push({after:e.toDate}),Fu(e)?i[wo]=i[wo].concat(t.modifiers[wo]):ju(e)&&(i[wo]=i[wo].concat(n.modifiers[wo]),i[F0]=n.modifiers[F0],i[$0]=n.modifiers[$0],i[L0]=n.modifiers[L0]),i}var sO=m.createContext(void 0);function Lq(e){var t=Ht(),n=I0(),r=N0(),i=Nq(t,n,r),o=Dq(t.modifiers),s=Ue(Ue({},i),o);return ye.jsx(sO.Provider,{value:s,children:e.children})}function aO(){var e=m.useContext(sO);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function $q(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function Fq(e){return!!(e&&typeof e=="object"&&"from"in e)}function jq(e){return!!(e&&typeof e=="object"&&"after"in e)}function zq(e){return!!(e&&typeof e=="object"&&"before"in e)}function Bq(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function Hq(e,t){var n,r=t.from,i=t.to;if(r&&i){var o=Hi(i,r)<0;o&&(n=[i,r],r=n[0],i=n[1]);var s=Hi(e,r)>=0&&Hi(i,e)>=0;return s}return i?dr(i,e):r?dr(r,e):!1}function Vq(e){return S0(e)}function Wq(e){return Array.isArray(e)&&e.every(S0)}function qq(e,t){return t.some(function(n){if(typeof n=="boolean")return n;if(Vq(n))return dr(e,n);if(Wq(n))return n.includes(e);if(Fq(n))return Hq(e,n);if(Bq(n))return n.dayOfWeek.includes(e.getDay());if($q(n)){var r=Hi(n.before,e),i=Hi(n.after,e),o=r>0,s=i<0,a=O0(n.before,n.after);return a?s&&o:o||s}return jq(n)?Hi(e,n.after)>0:zq(n)?Hi(n.before,e)>0:typeof n=="function"?n(e):!1})}function j0(e,t,n){var r=Object.keys(t).reduce(function(o,s){var a=t[s];return qq(e,a)&&o.push(s),o},[]),i={};return r.forEach(function(o){return i[o]=!0}),n&&!k0(e,n)&&(i.outside=!0),i}function Uq(e,t){for(var n=fr(e[0]),r=C0(e[e.length-1]),i,o,s=n;s<=r;){var a=j0(s,t),l=!a.disabled&&!a.hidden;if(!l){s=Jn(s,1);continue}if(a.selected)return s;a.today&&!o&&(o=s),i||(i=s),s=Jn(s,1)}return o||i}var Gq=365;function lO(e,t){var n=t.moveBy,r=t.direction,i=t.context,o=t.modifiers,s=t.retry,a=s===void 0?{count:0,lastFocused:e}:s,l=i.weekStartsOn,c=i.fromDate,d=i.toDate,f=i.locale,g={day:Jn,week:_0,month:yi,year:NW,startOfWeek:function(x){return i.ISOWeek?ua(x):Bi(x,{locale:f,weekStartsOn:l})},endOfWeek:function(x){return i.ISOWeek?jP(x):E0(x,{locale:f,weekStartsOn:l})}},p=g[n](e,r==="after"?1:-1);r==="before"&&c?p=LW([c,p]):r==="after"&&d&&(p=$W([d,p]));var v=!0;if(o){var y=j0(p,o);v=!y.disabled&&!y.hidden}return v?p:a.count>Gq?a.lastFocused:lO(p,{moveBy:n,direction:r,context:i,modifiers:o,retry:Ue(Ue({},a),{count:a.count+1})})}var cO=m.createContext(void 0);function Yq(e){var t=zu(),n=aO(),r=m.useState(),i=r[0],o=r[1],s=m.useState(),a=s[0],l=s[1],c=Uq(t.displayMonths,n),d=i??(a&&t.isDateDisplayed(a))?a:c,f=function(){l(i),o(void 0)},g=function(x){o(x)},p=Ht(),v=function(x,w){if(i){var _=lO(i,{moveBy:x,direction:w,context:p,modifiers:n});dr(i,_)||(t.goToDate(_,i),g(_))}},y={focusedDay:i,focusTarget:d,blur:f,focus:g,focusDayAfter:function(){return v("day","after")},focusDayBefore:function(){return v("day","before")},focusWeekAfter:function(){return v("week","after")},focusWeekBefore:function(){return v("week","before")},focusMonthBefore:function(){return v("month","before")},focusMonthAfter:function(){return v("month","after")},focusYearBefore:function(){return v("year","before")},focusYearAfter:function(){return v("year","after")},focusStartOfWeek:function(){return v("startOfWeek","before")},focusEndOfWeek:function(){return v("endOfWeek","after")}};return ye.jsx(cO.Provider,{value:y,children:e.children})}function z0(){var e=m.useContext(cO);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function Kq(e,t){var n=aO(),r=j0(e,n,t);return r}var B0=m.createContext(void 0);function Xq(e){if(!Yh(e.initialProps)){var t={selected:void 0};return ye.jsx(B0.Provider,{value:t,children:e.children})}return ye.jsx(Qq,{initialProps:e.initialProps,children:e.children})}function Qq(e){var t=e.initialProps,n=e.children,r=function(o,s,a){var l,c,d;if((l=t.onDayClick)===null||l===void 0||l.call(t,o,s,a),s.selected&&!t.required){(c=t.onSelect)===null||c===void 0||c.call(t,void 0,o,s,a);return}(d=t.onSelect)===null||d===void 0||d.call(t,o,o,s,a)},i={selected:t.selected,onDayClick:r};return ye.jsx(B0.Provider,{value:i,children:n})}function uO(){var e=m.useContext(B0);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function Zq(e,t){var n=Ht(),r=uO(),i=I0(),o=N0(),s=z0(),a=s.focusDayAfter,l=s.focusDayBefore,c=s.focusWeekAfter,d=s.focusWeekBefore,f=s.blur,g=s.focus,p=s.focusMonthBefore,v=s.focusMonthAfter,y=s.focusYearBefore,x=s.focusYearAfter,w=s.focusStartOfWeek,_=s.focusEndOfWeek,C=function(j){var ne,se,D,q;Yh(n)?(ne=r.onDayClick)===null||ne===void 0||ne.call(r,e,t,j):Fu(n)?(se=i.onDayClick)===null||se===void 0||se.call(i,e,t,j):ju(n)?(D=o.onDayClick)===null||D===void 0||D.call(o,e,t,j):(q=n.onDayClick)===null||q===void 0||q.call(n,e,t,j)},O=function(j){var ne;g(e),(ne=n.onDayFocus)===null||ne===void 0||ne.call(n,e,t,j)},P=function(j){var ne;f(),(ne=n.onDayBlur)===null||ne===void 0||ne.call(n,e,t,j)},k=function(j){var ne;(ne=n.onDayMouseEnter)===null||ne===void 0||ne.call(n,e,t,j)},A=function(j){var ne;(ne=n.onDayMouseLeave)===null||ne===void 0||ne.call(n,e,t,j)},L=function(j){var ne;(ne=n.onDayPointerEnter)===null||ne===void 0||ne.call(n,e,t,j)},F=function(j){var ne;(ne=n.onDayPointerLeave)===null||ne===void 0||ne.call(n,e,t,j)},B=function(j){var ne;(ne=n.onDayTouchCancel)===null||ne===void 0||ne.call(n,e,t,j)},H=function(j){var ne;(ne=n.onDayTouchEnd)===null||ne===void 0||ne.call(n,e,t,j)},V=function(j){var ne;(ne=n.onDayTouchMove)===null||ne===void 0||ne.call(n,e,t,j)},K=function(j){var ne;(ne=n.onDayTouchStart)===null||ne===void 0||ne.call(n,e,t,j)},Y=function(j){var ne;(ne=n.onDayKeyUp)===null||ne===void 0||ne.call(n,e,t,j)},$=function(j){var ne;switch(j.key){case"ArrowLeft":j.preventDefault(),j.stopPropagation(),n.dir==="rtl"?a():l();break;case"ArrowRight":j.preventDefault(),j.stopPropagation(),n.dir==="rtl"?l():a();break;case"ArrowDown":j.preventDefault(),j.stopPropagation(),c();break;case"ArrowUp":j.preventDefault(),j.stopPropagation(),d();break;case"PageUp":j.preventDefault(),j.stopPropagation(),j.shiftKey?y():p();break;case"PageDown":j.preventDefault(),j.stopPropagation(),j.shiftKey?x():v();break;case"Home":j.preventDefault(),j.stopPropagation(),w();break;case"End":j.preventDefault(),j.stopPropagation(),_();break}(ne=n.onDayKeyDown)===null||ne===void 0||ne.call(n,e,t,j)},X={onClick:C,onFocus:O,onBlur:P,onKeyDown:$,onKeyUp:Y,onMouseEnter:k,onMouseLeave:A,onPointerEnter:L,onPointerLeave:F,onTouchCancel:B,onTouchEnd:H,onTouchMove:V,onTouchStart:K};return X}function Jq(){var e=Ht(),t=uO(),n=I0(),r=N0(),i=Yh(e)?t.selected:Fu(e)?n.selected:ju(e)?r.selected:void 0;return i}function eU(e){return Object.values(xi).includes(e)}function tU(e,t){var n=[e.classNames.day];return Object.keys(t).forEach(function(r){var i=e.modifiersClassNames[r];if(i)n.push(i);else if(eU(r)){var o=e.classNames["day_".concat(r)];o&&n.push(o)}}),n}function nU(e,t){var n=Ue({},e.styles.day);return Object.keys(t).forEach(function(r){var i;n=Ue(Ue({},n),(i=e.modifiersStyles)===null||i===void 0?void 0:i[r])}),n}function rU(e,t,n){var r,i,o,s=Ht(),a=z0(),l=Kq(e,t),c=Zq(e,l),d=Jq(),f=!!(s.onDayClick||s.mode!=="default");m.useEffect(function(){var k;l.outside||a.focusedDay&&f&&dr(a.focusedDay,e)&&((k=n.current)===null||k===void 0||k.focus())},[a.focusedDay,e,n,f,l.outside]);var g=tU(s,l).join(" "),p=nU(s,l),v=!!(l.outside&&!s.showOutsideDays||l.hidden),y=(o=(i=s.components)===null||i===void 0?void 0:i.DayContent)!==null&&o!==void 0?o:Cq,x=ye.jsx(y,{date:e,displayMonth:t,activeModifiers:l}),w={style:p,className:g,children:x,role:"gridcell"},_=a.focusTarget&&dr(a.focusTarget,e)&&!l.outside,C=a.focusedDay&&dr(a.focusedDay,e),O=Ue(Ue(Ue({},w),(r={disabled:l.disabled,role:"gridcell"},r["aria-selected"]=l.selected,r.tabIndex=C||_?0:-1,r)),c),P={isButton:f,isHidden:v,activeModifiers:l,selectedDays:d,buttonProps:O,divProps:w};return P}function iU(e){var t=m.useRef(null),n=rU(e.date,e.displayMonth,t);return n.isHidden?ye.jsx("div",{role:"gridcell"}):n.isButton?ye.jsx(Kh,Ue({name:"day",ref:t},n.buttonProps)):ye.jsx("div",Ue({},n.divProps))}function oU(e){var t=e.number,n=e.dates,r=Ht(),i=r.onWeekNumberClick,o=r.styles,s=r.classNames,a=r.locale,l=r.labels.labelWeekNumber,c=r.formatters.formatWeekNumber,d=c(Number(t),{locale:a});if(!i)return ye.jsx("span",{className:s.weeknumber,style:o.weeknumber,children:d});var f=l(Number(t),{locale:a}),g=function(p){i(t,n,p)};return ye.jsx(Kh,{name:"week-number","aria-label":f,className:s.weeknumber,style:o.weeknumber,onClick:g,children:d})}function sU(e){var t,n,r=Ht(),i=r.styles,o=r.classNames,s=r.showWeekNumber,a=r.components,l=(t=a==null?void 0:a.Day)!==null&&t!==void 0?t:iU,c=(n=a==null?void 0:a.WeekNumber)!==null&&n!==void 0?n:oU,d;return s&&(d=ye.jsx("td",{className:o.cell,style:i.cell,children:ye.jsx(c,{number:e.weekNumber,dates:e.dates})})),ye.jsxs("tr",{className:o.row,style:i.row,children:[d,e.dates.map(function(f){return ye.jsx("td",{className:o.cell,style:i.cell,role:"presentation",children:ye.jsx(l,{displayMonth:e.displayMonth,date:f})},R6(f))})]})}function dO(e,t,n){for(var r=n!=null&&n.ISOWeek?jP(t):E0(t,n),i=n!=null&&n.ISOWeek?ua(e):Bi(e,n),o=Hi(r,i),s=[],a=0;a<=o;a++)s.push(Jn(i,a));var l=s.reduce(function(c,d){var f=n!=null&&n.ISOWeek?BP(d):VP(d,n),g=c.find(function(p){return p.weekNumber===f});return g?(g.dates.push(d),c):(c.push({weekNumber:f,dates:[d]}),c)},[]);return l}function aU(e,t){var n=dO(fr(e),C0(e),t);if(t!=null&&t.useFixedWeeks){var r=L6(e,t);if(r<6){var i=n[n.length-1],o=i.dates[i.dates.length-1],s=_0(o,6-r),a=dO(_0(o,1),s,t);n.push.apply(n,a)}}return n}function lU(e){var t,n,r,i=Ht(),o=i.locale,s=i.classNames,a=i.styles,l=i.hideHead,c=i.fixedWeeks,d=i.components,f=i.weekStartsOn,g=i.firstWeekContainsDate,p=i.ISOWeek,v=aU(e.displayMonth,{useFixedWeeks:!!c,ISOWeek:p,locale:o,weekStartsOn:f,firstWeekContainsDate:g}),y=(t=d==null?void 0:d.Head)!==null&&t!==void 0?t:Sq,x=(n=d==null?void 0:d.Row)!==null&&n!==void 0?n:sU,w=(r=d==null?void 0:d.Footer)!==null&&r!==void 0?r:xq;return ye.jsxs("table",{id:e.id,className:s.table,style:a.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!l&&ye.jsx(y,{}),ye.jsx("tbody",{className:s.tbody,style:a.tbody,children:v.map(function(_){return ye.jsx(x,{displayMonth:e.displayMonth,dates:_.dates,weekNumber:_.weekNumber},_.weekNumber)})}),ye.jsx(w,{displayMonth:e.displayMonth})]})}function cU(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var uU=cU()?m.useLayoutEffect:m.useEffect,H0=!1,dU=0;function fO(){return"react-day-picker-".concat(++dU)}function fU(e){var t,n=e??(H0?fO():null),r=m.useState(n),i=r[0],o=r[1];return uU(function(){i===null&&o(fO())},[]),m.useEffect(function(){H0===!1&&(H0=!0)},[]),(t=e??i)!==null&&t!==void 0?t:void 0}function hU(e){var t,n,r=Ht(),i=r.dir,o=r.classNames,s=r.styles,a=r.components,l=zu().displayMonths,c=fU(r.id?"".concat(r.id,"-").concat(e.displayIndex):void 0),d=r.id?"".concat(r.id,"-grid-").concat(e.displayIndex):void 0,f=[o.month],g=s.month,p=e.displayIndex===0,v=e.displayIndex===l.length-1,y=!p&&!v;i==="rtl"&&(t=[p,v],v=t[0],p=t[1]),p&&(f.push(o.caption_start),g=Ue(Ue({},g),s.caption_start)),v&&(f.push(o.caption_end),g=Ue(Ue({},g),s.caption_end)),y&&(f.push(o.caption_between),g=Ue(Ue({},g),s.caption_between));var x=(n=a==null?void 0:a.Caption)!==null&&n!==void 0?n:yq;return ye.jsxs("div",{className:f.join(" "),style:g,children:[ye.jsx(x,{id:c,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),ye.jsx(lU,{id:d,"aria-labelledby":c,displayMonth:e.displayMonth})]},e.displayIndex)}function pU(e){var t=Ht(),n=t.classNames,r=t.styles;return ye.jsx("div",{className:n.months,style:r.months,children:e.children})}function gU(e){var t,n,r=e.initialProps,i=Ht(),o=z0(),s=zu(),a=m.useState(!1),l=a[0],c=a[1];m.useEffect(function(){i.initialFocus&&o.focusTarget&&(l||(o.focus(o.focusTarget),c(!0)))},[i.initialFocus,l,o.focus,o.focusTarget,o]);var d=[i.classNames.root,i.className];i.numberOfMonths>1&&d.push(i.classNames.multiple_months),i.showWeekNumber&&d.push(i.classNames.with_weeknumber);var f=Ue(Ue({},i.styles.root),i.style),g=Object.keys(r).filter(function(v){return v.startsWith("data-")}).reduce(function(v,y){var x;return Ue(Ue({},v),(x={},x[y]=r[y],x))},{}),p=(n=(t=r.components)===null||t===void 0?void 0:t.Months)!==null&&n!==void 0?n:pU;return ye.jsx("div",Ue({className:d.join(" "),style:f,dir:i.dir,id:i.id,nonce:r.nonce,title:r.title,lang:r.lang},g,{children:ye.jsx(p,{children:s.displayMonths.map(function(v,y){return ye.jsx(hU,{displayIndex:y,displayMonth:v},y)})})}))}function mU(e){var t=e.children,n=F6(e,["children"]);return ye.jsx(oq,{initialProps:n,children:ye.jsx(gq,{children:ye.jsx(Xq,{initialProps:n,children:ye.jsx(Eq,{initialProps:n,children:ye.jsx(kq,{initialProps:n,children:ye.jsx(Lq,{children:ye.jsx(Yq,{children:t})})})})})})})}function vU(e){return ye.jsx(mU,Ue({},e,{children:ye.jsx(gU,{initialProps:e})}))}function hO({className:e,classNames:t,showOutsideDays:n=!0,...r}){return S.jsx(vU,{showOutsideDays:n,className:Oe("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:Oe(x0({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",day:Oe(x0({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{IconLeft:({...i})=>S.jsx(IB,{...i,className:"h-4 w-4"}),IconRight:({...i})=>S.jsx(D2,{...i,className:"h-4 w-4"})},...r})}hO.displayName="Calendar";let V0=0;function Qh(){m.useEffect(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:pO()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:pO()),V0++,()=>{V0===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),V0--}},[])}function pO(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}const W0="focusScope.autoFocusOnMount",q0="focusScope.autoFocusOnUnmount",gO={bubbles:!1,cancelable:!0},Zh=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...s}=e,[a,l]=m.useState(null),c=On(i),d=On(o),f=m.useRef(null),g=et(t,y=>l(y)),p=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let y=function(C){if(p.paused||!a)return;const O=C.target;a.contains(O)?f.current=O:rs(f.current,{select:!0})},x=function(C){if(p.paused||!a)return;const O=C.relatedTarget;O!==null&&(a.contains(O)||rs(f.current,{select:!0}))},w=function(C){if(document.activeElement===document.body)for(const P of C)P.removedNodes.length>0&&rs(a)};document.addEventListener("focusin",y),document.addEventListener("focusout",x);const _=new MutationObserver(w);return a&&_.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",x),_.disconnect()}}},[r,a,p.paused]),m.useEffect(()=>{if(a){bO.add(p);const y=document.activeElement;if(!a.contains(y)){const w=new CustomEvent(W0,gO);a.addEventListener(W0,c),a.dispatchEvent(w),w.defaultPrevented||(bU(SU(mO(a)),{select:!0}),document.activeElement===y&&rs(a))}return()=>{a.removeEventListener(W0,c),setTimeout(()=>{const w=new CustomEvent(q0,gO);a.addEventListener(q0,d),a.dispatchEvent(w),w.defaultPrevented||rs(y??document.body,{select:!0}),a.removeEventListener(q0,d),bO.remove(p)},0)}}},[a,c,d,p]);const v=m.useCallback(y=>{if(!n&&!r||p.paused)return;const x=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,w=document.activeElement;if(x&&w){const _=y.currentTarget,[C,O]=yU(_);C&&O?!y.shiftKey&&w===O?(y.preventDefault(),n&&rs(C,{select:!0})):y.shiftKey&&w===C&&(y.preventDefault(),n&&rs(O,{select:!0})):w===_&&y.preventDefault()}},[n,r,p.paused]);return m.createElement(Be.div,le({tabIndex:-1},s,{ref:g,onKeyDown:v}))});function bU(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(rs(r,{select:t}),document.activeElement!==n)return}function yU(e){const t=mO(e),n=vO(t,e),r=vO(t.reverse(),e);return[n,r]}function mO(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function vO(e,t){for(const n of e)if(!xU(n,{upTo:t}))return n}function xU(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function wU(e){return e instanceof HTMLInputElement&&"select"in e}function rs(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&wU(e)&&t&&e.select()}}const bO=_U();function _U(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=yO(e,t),e.unshift(t)},remove(t){var n;e=yO(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function yO(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function SU(e){return e.filter(t=>t.tagName!=="A")}var CU=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Dl=new WeakMap,Jh=new WeakMap,ep={},U0=0,xO=function(e){return e&&(e.host||xO(e.parentNode))},EU=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=xO(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},PU=function(e,t,n,r){var i=EU(t,Array.isArray(e)?e:[e]);ep[n]||(ep[n]=new WeakMap);var o=ep[n],s=[],a=new Set,l=new Set(i),c=function(f){!f||a.has(f)||(a.add(f),c(f.parentNode))};i.forEach(c);var d=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(g){if(a.has(g))d(g);else{var p=g.getAttribute(r),v=p!==null&&p!=="false",y=(Dl.get(g)||0)+1,x=(o.get(g)||0)+1;Dl.set(g,y),o.set(g,x),s.push(g),y===1&&v&&Jh.set(g,!0),x===1&&g.setAttribute(n,"true"),v||g.setAttribute(r,"true")}})};return d(t),a.clear(),U0++,function(){s.forEach(function(f){var g=Dl.get(f)-1,p=o.get(f)-1;Dl.set(f,g),o.set(f,p),g||(Jh.has(f)||f.removeAttribute(r),Jh.delete(f)),p||f.removeAttribute(n)}),U0--,U0||(Dl=new WeakMap,Dl=new WeakMap,Jh=new WeakMap,ep={})}},tp=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=t||CU(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),PU(r,i,n,"aria-hidden")):function(){return null}},Wi=function(){return Wi=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},Wi.apply(this,arguments)};function wO(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 OU(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 np="right-scroll-bar-position",rp="width-before-scroll-bar",kU="with-scroll-bars-hidden",MU="--removed-body-scroll-bar-size";function DU(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function TU(e,t){var n=m.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}function AU(e,t){return TU(t||null,function(n){return e.forEach(function(r){return DU(r,n)})})}function IU(e){return e}function RU(e,t){t===void 0&&(t=IU);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var s=t(o,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(o){for(r=!0;n.length;){var s=n;n=[],s.forEach(o)}n={push:function(a){return o(a)},filter:function(){return n}}},assignMedium:function(o){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(o),s=n}var l=function(){var d=s;s=[],d.forEach(o)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(d){s.push(d),c()},filter:function(d){return s=s.filter(d),n}}}};return i}function NU(e){e===void 0&&(e={});var t=RU(null);return t.options=Wi({async:!0,ssr:!1},e),t}var _O=function(e){var t=e.sideCar,n=wO(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return ue.createElement(r,Wi({},n))};_O.isSideCarExport=!0;function LU(e,t){return e.useMedium(t),_O}var SO=NU(),G0=function(){},ip=ue.forwardRef(function(e,t){var n=ue.useRef(null),r=ue.useState({onScrollCapture:G0,onWheelCapture:G0,onTouchMoveCapture:G0}),i=r[0],o=r[1],s=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,d=e.enabled,f=e.shards,g=e.sideCar,p=e.noIsolation,v=e.inert,y=e.allowPinchZoom,x=e.as,w=x===void 0?"div":x,_=wO(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),C=g,O=AU([n,t]),P=Wi(Wi({},_),i);return ue.createElement(ue.Fragment,null,d&&ue.createElement(C,{sideCar:SO,removeScrollBar:c,shards:f,noIsolation:p,inert:v,setCallbacks:o,allowPinchZoom:!!y,lockRef:n}),s?ue.cloneElement(ue.Children.only(a),Wi(Wi({},P),{ref:O})):ue.createElement(w,Wi({},P,{className:l,ref:O}),a))});ip.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},ip.classNames={fullWidth:rp,zeroRight:np};var CO,$U=function(){if(CO)return CO;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function FU(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=$U();return t&&e.setAttribute("nonce",t),e}function jU(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function zU(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var BU=function(){var e=0,t=null;return{add:function(n){e==0&&(t=FU())&&(jU(t,n),zU(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},HU=function(){var e=BU();return function(t,n){ue.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},EO=function(){var e=HU(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},VU={left:0,top:0,right:0,gap:0},Y0=function(e){return parseInt(e||"",10)||0},WU=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[Y0(n),Y0(r),Y0(i)]},qU=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return VU;var t=WU(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},UU=EO(),GU=function(e,t,n,r){var i=e.left,o=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
383
|
+
.`.concat(kU,` {
|
|
384
|
+
overflow: hidden `).concat(r,`;
|
|
385
|
+
padding-right: `).concat(a,"px ").concat(r,`;
|
|
386
|
+
}
|
|
387
|
+
body {
|
|
388
|
+
overflow: hidden `).concat(r,`;
|
|
389
|
+
overscroll-behavior: contain;
|
|
390
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
391
|
+
padding-left: `.concat(i,`px;
|
|
392
|
+
padding-top: `).concat(o,`px;
|
|
393
|
+
padding-right: `).concat(s,`px;
|
|
394
|
+
margin-left:0;
|
|
395
|
+
margin-top:0;
|
|
396
|
+
margin-right: `).concat(a,"px ").concat(r,`;
|
|
397
|
+
`),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
.`).concat(np,` {
|
|
401
|
+
right: `).concat(a,"px ").concat(r,`;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
.`).concat(rp,` {
|
|
405
|
+
margin-right: `).concat(a,"px ").concat(r,`;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
.`).concat(np," .").concat(np,` {
|
|
409
|
+
right: 0 `).concat(r,`;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
.`).concat(rp," .").concat(rp,` {
|
|
413
|
+
margin-right: 0 `).concat(r,`;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
body {
|
|
417
|
+
`).concat(MU,": ").concat(a,`px;
|
|
418
|
+
}
|
|
419
|
+
`)},YU=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r,o=ue.useMemo(function(){return qU(i)},[i]);return ue.createElement(UU,{styles:GU(o,!t,i,n?"":"!important")})},K0=!1;if(typeof window<"u")try{var op=Object.defineProperty({},"passive",{get:function(){return K0=!0,!0}});window.addEventListener("test",op,op),window.removeEventListener("test",op,op)}catch{K0=!1}var Tl=K0?{passive:!1}:!1,KU=function(e){return e.tagName==="TEXTAREA"},PO=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!KU(e)&&n[t]==="visible")},XU=function(e){return PO(e,"overflowY")},QU=function(e){return PO(e,"overflowX")},OO=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=kO(e,n);if(r){var i=MO(e,n),o=i[1],s=i[2];if(o>s)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},ZU=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},JU=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},kO=function(e,t){return e==="v"?XU(t):QU(t)},MO=function(e,t){return e==="v"?ZU(t):JU(t)},eG=function(e,t){return e==="h"&&t==="rtl"?-1:1},tG=function(e,t,n,r,i){var o=eG(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=MO(e,a),v=p[0],y=p[1],x=p[2],w=y-x-o*v;(v||w)&&kO(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},sp=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},DO=function(e){return[e.deltaX,e.deltaY]},TO=function(e){return e&&"current"in e?e.current:e},nG=function(e,t){return e[0]===t[0]&&e[1]===t[1]},rG=function(e){return`
|
|
420
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
421
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
422
|
+
`)},iG=0,Al=[];function oG(e){var t=ue.useRef([]),n=ue.useRef([0,0]),r=ue.useRef(),i=ue.useState(iG++)[0],o=ue.useState(function(){return EO()})[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=OU([e.lockRef.current],(e.shards||[]).map(TO),!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=sp(y),_=n.current,C="deltaX"in y?y.deltaX:_[0]-w[0],O="deltaY"in y?y.deltaY:_[1]-w[1],P,k=y.target,A=Math.abs(C)>Math.abs(O)?"h":"v";if("touches"in y&&A==="h"&&k.type==="range")return!1;var L=OO(A,k);if(!L)return!0;if(L?P=A:(P=A==="v"?"h":"v",L=OO(A,k)),!L)return!1;if(!r.current&&"changedTouches"in y&&(C||O)&&(r.current=P),!P)return!0;var F=r.current||P;return tG(F,x,y,F==="h"?C:O,!0)},[]),l=ue.useCallback(function(y){var x=y;if(!(!Al.length||Al[Al.length-1]!==o)){var w="deltaY"in x?DO(x):sp(x),_=t.current.filter(function(P){return P.name===x.type&&P.target===x.target&&nG(P.delta,w)})[0];if(_&&_.should){x.cancelable&&x.preventDefault();return}if(!_){var C=(s.current.shards||[]).map(TO).filter(Boolean).filter(function(P){return P.contains(x.target)}),O=C.length>0?a(x,C[0]):!s.current.noIsolation;O&&x.cancelable&&x.preventDefault()}}},[]),c=ue.useCallback(function(y,x,w,_){var C={name:y,delta:x,target:w,should:_};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(O){return O!==C})},1)},[]),d=ue.useCallback(function(y){n.current=sp(y),r.current=void 0},[]),f=ue.useCallback(function(y){c(y.type,DO(y),y.target,a(y,e.lockRef.current))},[]),g=ue.useCallback(function(y){c(y.type,sp(y),y.target,a(y,e.lockRef.current))},[]);ue.useEffect(function(){return Al.push(o),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:g}),document.addEventListener("wheel",l,Tl),document.addEventListener("touchmove",l,Tl),document.addEventListener("touchstart",d,Tl),function(){Al=Al.filter(function(y){return y!==o}),document.removeEventListener("wheel",l,Tl),document.removeEventListener("touchmove",l,Tl),document.removeEventListener("touchstart",d,Tl)}},[]);var p=e.removeScrollBar,v=e.inert;return ue.createElement(ue.Fragment,null,v?ue.createElement(o,{styles:rG(i)}):null,p?ue.createElement(YU,{gapMode:"margin"}):null)}const sG=LU(SO,oG);var AO=ue.forwardRef(function(e,t){return ue.createElement(ip,Wi({},e,{ref:t,sideCar:sG}))});AO.classNames=ip.classNames;const ap=AO,IO="Popover",[RO,Cde]=Pn(IO,[Fi]),X0=Fi(),[aG,Il]=RO(IO),lG=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:s=!1}=e,a=X0(t),l=m.useRef(null),[c,d]=m.useState(!1),[f=!1,g]=Qn({prop:r,defaultProp:i,onChange:o});return m.createElement(_u,a,m.createElement(aG,{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))},cG="PopoverTrigger",uG=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Il(cG,n),o=X0(n),s=et(t,i.triggerRef),a=m.createElement(Be.button,le({type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":$O(i.open)},r,{ref:s,onClick:Ce(e.onClick,i.onOpenToggle)}));return i.hasCustomAnchor?a:m.createElement(Su,le({asChild:!0},o),a)}),NO="PopoverPortal",[dG,fG]=RO(NO,{forceMount:void 0}),hG=e=>{const{__scopePopover:t,forceMount:n,children:r,container:i}=e,o=Il(NO,t);return m.createElement(dG,{scope:t,forceMount:n},m.createElement(vn,{present:n||o.open},m.createElement(Eh,{asChild:!0,container:i},r)))},Bu="PopoverContent",pG=m.forwardRef((e,t)=>{const n=fG(Bu,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,o=Il(Bu,e.__scopePopover);return m.createElement(vn,{present:r||o.open},o.modal?m.createElement(gG,le({},i,{ref:t})):m.createElement(mG,le({},i,{ref:t})))}),gG=m.forwardRef((e,t)=>{const n=Il(Bu,e.__scopePopover),r=m.useRef(null),i=et(t,r),o=m.useRef(!1);return m.useEffect(()=>{const s=r.current;if(s)return tp(s)},[]),m.createElement(ap,{as:no,allowPinchZoom:!0},m.createElement(LO,le({},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})})))}),mG=m.forwardRef((e,t)=>{const n=Il(Bu,e.__scopePopover),r=m.useRef(!1),i=m.useRef(!1);return m.createElement(LO,le({},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()}}))}),LO=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=Il(Bu,n),p=X0(n);return Qh(),m.createElement(Zh,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o},m.createElement(vl,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:d,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>g.onOpenChange(!1)},m.createElement(Cu,le({"data-state":$O(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 $O(e){return e?"open":"closed"}const vG=lG,bG=uG,yG=hG,FO=pG,lp=vG,cp=bG,Hu=ue.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},i)=>S.jsx(yG,{children:S.jsx(FO,{ref:i,align:t,sideOffset:n,className:Oe("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})}));Hu.displayName=FO.displayName;function xG({filter:e,className:t}){const[n,r]=m.useState(!1),[i,o]=m.useState(),[s,a]=m.useState(),l=xe(C=>C.filterValues),c=xe(C=>C.authToken),d=xe(C=>C.actions.addOrUpdateFilterValue),f=xe(C=>C.actions.removeFilterValue),{data:g,isLoading:p,isFetching:v,isError:y,refetch:x}=Sr({queryKey:[e.sql],queryFn:()=>Ds("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 O=g.records[0];if(!O.min||!O.max)return;o({from:new Date(O.min),to:new Date(O.max)}),a({from:new Date(O.min),to:new Date(O.max)})}},[g]),m.useEffect(()=>{if(l&&!l.find(O=>O.filterId===e.id)){o(s);return}},[l,e.id,s]);function w(){f(e.id),o(s),r(!1)}function _(){if(!i)return;console.log(i);const C=[i==null?void 0:i.from,i==null?void 0:i.to];console.log(C);const O={filterId:e.id,connectionType:e.database==="NA"?"api":"database",valueType:b0(e),name:e.column,operation:"between",values:C};d(O),r(!1)}return p?S.jsx("div",{children:S.jsx(Rc,{className:" bg-foreground/10 h-8 w-[250px]"})}):y?S.jsx("div",{className:"bg-muted h-8 w-[250px] px-2",children:"Error"}):g?S.jsx("div",{className:Oe("grid gap-2",t),children:S.jsxs(lp,{open:n,onOpenChange:r,children:[S.jsx(cp,{asChild:!0,children:S.jsxs(dt,{size:"sm",id:"date",variant:"outline",className:Oe("w-[250px] justify-start text-left font-normal rounded-sm h-[34px]",!i&&"text-muted-foreground"),children:[S.jsx(AB,{className:"mr-2 h-4 w-4"}),i!=null&&i.from?i.to?S.jsxs(S.Fragment,{children:[Vi(i.from,"LLL dd, y")," -"," ",Vi(i.to,"LLL dd, y")]}):Vi(i.from,"LLL dd, y"):S.jsx("span",{children:"Pick a date"})]})}),S.jsxs(Hu,{className:"w-auto p-0",align:"start",children:[S.jsx(hO,{initialFocus:!0,mode:"range",defaultMonth:i==null?void 0:i.from,selected:i,onSelect:o,numberOfMonths:2}),S.jsxs("div",{className:"flex justify-end px-4 py-3 gap-2",children:[S.jsx(dt,{size:"sm",variant:"outline",onClick:_,children:"Apply"}),S.jsx(dt,{size:"sm",variant:"outline",onClick:w,children:"Clear"})]})]})]})}):null}function wG(){const e=xe(s=>s.dashboard.filters),t=xe(s=>s.isDashboardEditing),n=xe(s=>s.actions.removeFilter),r=xe(s=>s.actions.updateFilter),i=xe(s=>s.actions.removeFilterValue);if(!e)return null;const o=s=>Tu.includes(s.dataType)?S.jsx(xG,{filter:s}):S.jsx(DW,{filter:s});return S.jsx("section",{role:"dashboard-filters",className:" px-[10px] pt-0 grow w-full items-center flex gap-2 flex-wrap ",children:e.map(s=>S.jsxs("div",{children:[S.jsx(Hc,{className:" my-1 ",text:s.title||s.column,onSave:a=>r({...s,title:a}),children:S.jsxs("div",{className:"flex items-center justify-between group mb-1",children:[S.jsxs("div",{className:"flex gap-1 items-center ",children:[S.jsx(Ol,{className:" inline-block text-sm ",children:s.title}),t&&S.jsx(bu,{onClick:()=>{i(s.id),n(s.id)},className:"w-3 h-3 invisible text-muted-foreground group-hover:visible hover:text-foreground cursor-pointer"})]}),S.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 jO(){const e=xe(i=>{var o;return(o=i.dashboard)==null?void 0:o.sheets});xe(i=>i.isDashboardEditing);const t=xe(i=>i.themeStyle);xe(i=>i.isVisualEditing);const n=xe(i=>i.selectedSheetId),r=xe(i=>i.actions.setSelectedSheetId);return xe(i=>i.actions.setSheetTitle),e?S.jsxs(Kw,{role:"dashboard-tabs-container",className:Oe(" grow bg-muted dark:bg-foreground/5 p-2 ",t==null?void 0:t.dashboardTabsContainer),onValueChange:i=>{r(i)},value:n||e[0].id,children:[S.jsx(wG,{}),e==null?void 0:e.map(i=>S.jsx(af,{className:"mt-0",value:i.id,children:S.jsx(QH,{})},i.id))]}):null}const zO=m.forwardRef(({className:e,...t},n)=>S.jsx("div",{role:"dashboard-footer",ref:n,className:Oe("flex items-center justify-end px-4 py-2",e),...t,children:S.jsxs("h2",{className:" text-md font-mono tracking-wider before:content-['\\/\\\\'] before:text-red-700 before:tracking-tight",children:[" ","semaphor"]})}));zO.displayName="DashboardFooter";function BO({children:e}){const t=new v3;return S.jsx($3,{defaultTheme:"dark",storageKey:"vite-ui-theme",children:S.jsx(EB,{delayDuration:0,children:S.jsx(_3,{client:t,children:e})})})}function _G(e){return S.jsx(BO,{children:S.jsxs($w,{...e,children:[S.jsx(jO,{}),S.jsx(zO,{})]})})}const Q0=["Enter"," "],SG=["ArrowDown","PageUp","Home"],HO=["ArrowUp","PageDown","End"],CG=[...SG,...HO],EG={ltr:[...Q0,"ArrowRight"],rtl:[...Q0,"ArrowLeft"]},PG={ltr:["ArrowLeft"],rtl:["ArrowRight"]},up="Menu",[Vu,OG,kG]=of(up),[fa,VO]=Pn(up,[kG,Fi,el]),Z0=Fi(),WO=el(),[MG,ha]=fa(up),[DG,Wu]=fa(up),TG=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:o,modal:s=!0}=e,a=Z0(t),[l,c]=m.useState(null),d=m.useRef(!1),f=On(o),g=Ns(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(_u,a,m.createElement(MG,{scope:t,open:n,onOpenChange:f,content:l,onContentChange:c},m.createElement(DG,{scope:t,onClose:m.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:g,modal:s},r)))},qO=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=Z0(n);return m.createElement(Su,le({},i,r,{ref:t}))}),UO="MenuPortal",[AG,GO]=fa(UO,{forceMount:void 0}),IG=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,o=ha(UO,t);return m.createElement(AG,{scope:t,forceMount:n},m.createElement(vn,{present:n||o.open},m.createElement(Eh,{asChild:!0,container:i},r)))},wi="MenuContent",[RG,J0]=fa(wi),NG=m.forwardRef((e,t)=>{const n=GO(wi,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=ha(wi,e.__scopeMenu),s=Wu(wi,e.__scopeMenu);return m.createElement(Vu.Provider,{scope:e.__scopeMenu},m.createElement(vn,{present:r||o.open},m.createElement(Vu.Slot,{scope:e.__scopeMenu},s.modal?m.createElement(LG,le({},i,{ref:t})):m.createElement($G,le({},i,{ref:t})))))}),LG=m.forwardRef((e,t)=>{const n=ha(wi,e.__scopeMenu),r=m.useRef(null),i=et(t,r);return m.useEffect(()=>{const o=r.current;if(o)return tp(o)},[]),m.createElement(ey,le({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ce(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))}),$G=m.forwardRef((e,t)=>{const n=ha(wi,e.__scopeMenu);return m.createElement(ey,le({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),ey=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=ha(wi,n),w=Wu(wi,n),_=Z0(n),C=WO(n),O=OG(n),[P,k]=m.useState(null),A=m.useRef(null),L=et(t,A,x.onContentChange),F=m.useRef(0),B=m.useRef(""),H=m.useRef(0),V=m.useRef(null),K=m.useRef("right"),Y=m.useRef(0),$=v?ap:m.Fragment,X=v?{as:no,allowPinchZoom:!0}:void 0,j=se=>{var D,q;const re=B.current+se,R=O().filter(J=>!J.disabled),te=document.activeElement,ge=(D=R.find(J=>J.ref.current===te))===null||D===void 0?void 0:D.textValue,pe=R.map(J=>J.textValue),de=JG(pe,re,ge),ie=(q=R.find(J=>J.textValue===de))===null||q===void 0?void 0:q.ref.current;(function J(W){B.current=W,window.clearTimeout(F.current),W!==""&&(F.current=window.setTimeout(()=>J(""),1e3))})(re),ie&&setTimeout(()=>ie.focus())};m.useEffect(()=>()=>window.clearTimeout(F.current),[]),Qh();const ne=m.useCallback(se=>{var D,q;return K.current===((D=V.current)===null||D===void 0?void 0:D.side)&&tY(se,(q=V.current)===null||q===void 0?void 0:q.area)},[]);return m.createElement(RG,{scope:n,searchRef:B,onItemEnter:m.useCallback(se=>{ne(se)&&se.preventDefault()},[ne]),onItemLeave:m.useCallback(se=>{var D;ne(se)||((D=A.current)===null||D===void 0||D.focus(),k(null))},[ne]),onTriggerLeave:m.useCallback(se=>{ne(se)&&se.preventDefault()},[ne]),pointerGraceTimerRef:H,onPointerGraceIntentChange:m.useCallback(se=>{V.current=se},[])},m.createElement($,X,m.createElement(Zh,{asChild:!0,trapped:i,onMountAutoFocus:Ce(o,se=>{var D;se.preventDefault(),(D=A.current)===null||D===void 0||D.focus()}),onUnmountAutoFocus:s},m.createElement(vl,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:g,onDismiss:p},m.createElement(ym,le({asChild:!0},C,{dir:w.dir,orientation:"vertical",loop:r,currentTabStopId:P,onCurrentTabStopIdChange:k,onEntryFocus:Ce(l,se=>{w.isUsingKeyboardRef.current||se.preventDefault()})}),m.createElement(Cu,le({role:"menu","aria-orientation":"vertical","data-state":JO(x.open),"data-radix-menu-content":"",dir:w.dir},_,y,{ref:L,style:{outline:"none",...y.style},onKeyDown:Ce(y.onKeyDown,se=>{const q=se.target.closest("[data-radix-menu-content]")===se.currentTarget,re=se.ctrlKey||se.altKey||se.metaKey,R=se.key.length===1;q&&(se.key==="Tab"&&se.preventDefault(),!re&&R&&j(se.key));const te=A.current;if(se.target!==te||!CG.includes(se.key))return;se.preventDefault();const pe=O().filter(de=>!de.disabled).map(de=>de.ref.current);HO.includes(se.key)&&pe.reverse(),QG(pe)}),onBlur:Ce(e.onBlur,se=>{se.currentTarget.contains(se.target)||(window.clearTimeout(F.current),B.current="")}),onPointerMove:Ce(e.onPointerMove,qu(se=>{const D=se.target,q=Y.current!==se.clientX;if(se.currentTarget.contains(D)&&q){const re=se.clientX>Y.current?"right":"left";K.current=re,Y.current=se.clientX}}))})))))))}),FG=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(Be.div,le({},r,{ref:t}))}),ty="MenuItem",YO="menu.itemSelect",ny=m.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,o=m.useRef(null),s=Wu(ty,e.__scopeMenu),a=J0(ty,e.__scopeMenu),l=et(t,o),c=m.useRef(!1),d=()=>{const f=o.current;if(!n&&f){const g=new CustomEvent(YO,{bubbles:!0,cancelable:!0});f.addEventListener(YO,p=>r==null?void 0:r(p),{once:!0}),jw(f,g),g.defaultPrevented?c.current=!1:s.onClose()}};return m.createElement(KO,le({},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===" "||Q0.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})}))}),KO=m.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=e,s=J0(ty,n),a=WO(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(Vu.ItemSlot,{scope:n,disabled:r,textValue:i??g},m.createElement(xm,le({asChild:!0},a,{focusable:!r}),m.createElement(Be.div,le({role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},o,{ref:c,onPointerMove:Ce(e.onPointerMove,qu(v=>{r?s.onItemLeave(v):(s.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus())})),onPointerLeave:Ce(e.onPointerLeave,qu(v=>s.onItemLeave(v))),onFocus:Ce(e.onFocus,()=>f(!0)),onBlur:Ce(e.onBlur,()=>f(!1))}))))}),jG=m.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return m.createElement(QO,{scope:e.__scopeMenu,checked:n},m.createElement(ny,le({role:"menuitemcheckbox","aria-checked":fp(n)?"mixed":n},i,{ref:t,"data-state":ry(n),onSelect:Ce(i.onSelect,()=>r==null?void 0:r(fp(n)?!0:!n),{checkForDefaultPrevented:!1})})))}),zG="MenuRadioGroup",[Ede,BG]=fa(zG,{value:void 0,onValueChange:()=>{}}),HG="MenuRadioItem",VG=m.forwardRef((e,t)=>{const{value:n,...r}=e,i=BG(HG,e.__scopeMenu),o=n===i.value;return m.createElement(QO,{scope:e.__scopeMenu,checked:o},m.createElement(ny,le({role:"menuitemradio","aria-checked":o},r,{ref:t,"data-state":ry(o),onSelect:Ce(r.onSelect,()=>{var s;return(s=i.onValueChange)===null||s===void 0?void 0:s.call(i,n)},{checkForDefaultPrevented:!1})})))}),XO="MenuItemIndicator",[QO,WG]=fa(XO,{checked:!1}),qG=m.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,o=WG(XO,n);return m.createElement(vn,{present:r||fp(o.checked)||o.checked===!0},m.createElement(Be.span,le({},i,{ref:t,"data-state":ry(o.checked)})))}),UG=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(Be.div,le({role:"separator","aria-orientation":"horizontal"},r,{ref:t}))}),GG="MenuSub",[Pde,ZO]=fa(GG),dp="MenuSubTrigger",YG=m.forwardRef((e,t)=>{const n=ha(dp,e.__scopeMenu),r=Wu(dp,e.__scopeMenu),i=ZO(dp,e.__scopeMenu),o=J0(dp,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(qO,le({asChild:!0},c),m.createElement(KO,le({id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":JO(n.open)},e,{ref:rf(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,qu(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,qu(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,_=p[x?"left":"right"],C=p[x?"right":"left"];o.onPointerGraceIntentChange({area:[{x:f.clientX+w,y:f.clientY},{x:_,y:p.top},{x:C,y:p.top},{x:C,y:p.bottom},{x:_,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===" ")&&EG[r.dir].includes(f.key)){var p;n.onOpenChange(!0),(p=n.content)===null||p===void 0||p.focus(),f.preventDefault()}})})))}),KG="MenuSubContent",XG=m.forwardRef((e,t)=>{const n=GO(wi,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=ha(wi,e.__scopeMenu),s=Wu(wi,e.__scopeMenu),a=ZO(KG,e.__scopeMenu),l=m.useRef(null),c=et(t,l);return m.createElement(Vu.Provider,{scope:e.__scopeMenu},m.createElement(vn,{present:r||o.open},m.createElement(Vu.Slot,{scope:e.__scopeMenu},m.createElement(ey,le({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=PG[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 JO(e){return e?"open":"closed"}function fp(e){return e==="indeterminate"}function ry(e){return fp(e)?"indeterminate":e?"checked":"unchecked"}function QG(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function ZG(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function JG(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=ZG(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 eY(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 tY(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return eY(n,t)}function qu(e){return t=>t.pointerType==="mouse"?e(t):void 0}const nY=TG,rY=qO,iY=IG,oY=NG,sY=FG,aY=ny,lY=jG,cY=VG,uY=qG,dY=UG,fY=YG,hY=XG,ek="DropdownMenu",[pY,Ode]=Pn(ek,[VO]),Jr=VO(),[gY,tk]=pY(ek),mY=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:o,onOpenChange:s,modal:a=!0}=e,l=Jr(t),c=m.useRef(null),[d=!1,f]=Qn({prop:i,defaultProp:o,onChange:s});return m.createElement(gY,{scope:t,triggerId:or(),triggerRef:c,contentId:or(),open:d,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(g=>!g),[f]),modal:a},m.createElement(nY,le({},l,{open:d,onOpenChange:f,dir:r,modal:a}),n))},vY="DropdownMenuTrigger",bY=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,o=tk(vY,n),s=Jr(n);return m.createElement(rY,le({asChild:!0},s),m.createElement(Be.button,le({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:rf(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())})})))}),yY=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Jr(t);return m.createElement(iY,le({},r,n))},xY="DropdownMenuContent",wY=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=tk(xY,n),o=Jr(n),s=m.useRef(!1);return m.createElement(oY,le({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)"}}))}),_Y=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Jr(n);return m.createElement(sY,le({},i,r,{ref:t}))}),SY=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Jr(n);return m.createElement(aY,le({},i,r,{ref:t}))}),CY=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Jr(n);return m.createElement(lY,le({},i,r,{ref:t}))}),EY=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Jr(n);return m.createElement(cY,le({},i,r,{ref:t}))}),PY=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Jr(n);return m.createElement(uY,le({},i,r,{ref:t}))}),OY=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Jr(n);return m.createElement(dY,le({},i,r,{ref:t}))}),kY=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Jr(n);return m.createElement(fY,le({},i,r,{ref:t}))}),MY=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Jr(n);return m.createElement(hY,le({},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)"}}))}),DY=mY,TY=bY,AY=yY,nk=wY,rk=_Y,ik=SY,ok=CY,sk=EY,ak=PY,lk=OY,ck=kY,uk=MY,IY=DY,RY=TY,NY=ue.forwardRef(({className:e,inset:t,children:n,...r},i)=>S.jsxs(ck,{ref:i,className:Oe("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,S.jsx(D2,{className:"ml-auto h-4 w-4"})]}));NY.displayName=ck.displayName;const LY=ue.forwardRef(({className:e,...t},n)=>S.jsx(uk,{ref:n,className:Oe("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}));LY.displayName=uk.displayName;const dk=ue.forwardRef(({className:e,sideOffset:t=4,...n},r)=>S.jsx(AY,{children:S.jsx(nk,{ref:r,sideOffset:t,className:Oe("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})}));dk.displayName=nk.displayName;const hp=ue.forwardRef(({className:e,inset:t,...n},r)=>S.jsx(ik,{ref:r,className:Oe("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}));hp.displayName=ik.displayName;const $Y=ue.forwardRef(({className:e,children:t,checked:n,...r},i)=>S.jsxs(ok,{ref:i,className:Oe("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:[S.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:S.jsx(ak,{children:S.jsx(Ib,{className:"h-4 w-4"})})}),t]}));$Y.displayName=ok.displayName;const FY=ue.forwardRef(({className:e,children:t,...n},r)=>S.jsxs(sk,{ref:r,className:Oe("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:[S.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:S.jsx(ak,{children:S.jsx(T2,{className:"h-2 w-2 fill-current"})})}),t]}));FY.displayName=sk.displayName;const jY=ue.forwardRef(({className:e,inset:t,...n},r)=>S.jsx(rk,{ref:r,className:Oe("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));jY.displayName=rk.displayName;const zY=ue.forwardRef(({className:e,...t},n)=>S.jsx(lk,{ref:n,className:Oe("-mx-1 my-1 h-px bg-muted",e),...t}));zY.displayName=lk.displayName;function BY(){const{setTheme:e}=pm(),t=xe(n=>n.actions.setDashboardTheme);return S.jsxs(IY,{children:[S.jsx(RY,{asChild:!0,children:S.jsxs(dt,{className:"h-7 p-2",variant:"outline",size:"sm",children:[S.jsx(WB,{strokeWidth:1.5,className:"h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),S.jsx(FB,{strokeWidth:1.5,className:"absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),S.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),S.jsxs(dk,{align:"end",children:[S.jsx(hp,{onClick:()=>{e("light"),t("light")},children:"Light"}),S.jsx(hp,{onClick:()=>{e("dark"),t("dark")},children:"Dark"}),S.jsx(hp,{onClick:()=>{e("system"),t("system")},children:"System"})]})]})}function fk(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=>hk(i))}})}}function hk(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:HY(e.customCfg),data:[]}}function HY(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 VY(){const e=xe(w=>w.dashboard),t=xe(w=>w.selectedSheetId),n=xe(w=>w.isDashboardEditing),r=xe(w=>w.showFilters),i=xe(w=>w.showDashboardJSON),o=xe(w=>w.actions.setShowDashboardJSON),s=xe(w=>w.onSaveFunction),a=xe(w=>w.actions.setShowFilters),{addCard:l,getSelectedSheet:c,setIsDashboardEditing:d,setSelectedCardId:f,setSelectedCard:g}=xe(w=>w.actions),p=c(),v=()=>{if(!n||!p)return;const w={id:ph(),title:"New Card",description:"New Card Description",preferences:{filterOnClick:!0},type:"bar",data:[]};l(p.id,w),f(t,w.id),g(w)},y=()=>{d(!0)};function x(){const w=fk(e);console.log("handleSaveWithoutData",w),s==null||s(w),d(!n)}return S.jsxs("div",{className:"flex items-center justify-end gap-2 px-4 py-2 ",role:"dashboard-controls",children:[n&&S.jsxs(dt,{variant:"outline",className:"h-7 p-2",size:"sm",disabled:!n,onClick:v,children:[S.jsx(BB,{className:" mr-2 h-4 w-4",strokeWidth:1.5}),"Add Card"]}),!n&&S.jsx(dt,{variant:"outline",className:"h-7 p-2",onClick:y,size:"sm",children:S.jsx(jB,{className:"h-4 w-4",strokeWidth:1.5})}),n&&S.jsx(dt,{variant:"outline",role:"close",className:"h-7 p-2",onClick:()=>d(!1),size:"sm",children:S.jsx(bu,{className:"h-4 w-4",strokeWidth:1.5})}),n&&S.jsx(dt,{className:"h-7 p-2",variant:"outline",onClick:x,size:"sm",children:S.jsx(HB,{className:"h-4 w-4",strokeWidth:1.5})}),!r&&S.jsx(dt,{className:"h-7 p-2",variant:"outline",onClick:()=>a(!0),size:"sm",children:S.jsx(A2,{className:"h-4 w-4",strokeWidth:1.5})}),S.jsx("div",{className:" flex items-center space-x-2",children:S.jsx(dt,{className:"h-7 p-2",onClick:()=>o(!i),size:"sm",variant:"outline",children:S.jsx(NB,{className:"h-4 w-4",strokeWidth:1.5})})}),S.jsx(BY,{})]})}const pk=m.forwardRef(({className:e,...t},n)=>S.jsx("div",{role:"editor-panel",ref:n,className:Oe("flex grow min-h-[80vh]",e),...t}));pk.displayName="EditorPanel";const gk=m.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Oe("px-6 py-4 flex flex-col space-y-2 w-[270px]",e),...t}));gk.displayName="EditorAside";const mk=m.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Oe(" grow",e),...t}));mk.displayName="EditorMain";function pp(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 WY=[" ","Enter","ArrowUp","ArrowDown"],qY=[" ","Enter"],gp="Select",[mp,vp,UY]=of(gp),[Rl,kde]=Pn(gp,[UY,Fi]),iy=Fi(),[GY,pa]=Rl(gp),[YY,KY]=Rl(gp),XY=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=iy(t),[y,x]=m.useState(null),[w,_]=m.useState(null),[C,O]=m.useState(!1),P=Ns(c),[k=!1,A]=Qn({prop:r,defaultProp:i,onChange:o}),[L,F]=Qn({prop:s,defaultProp:a,onChange:l}),B=m.useRef(null),H=y?!!y.closest("form"):!0,[V,K]=m.useState(new Set),Y=Array.from(V).map($=>$.props.value).join(";");return m.createElement(_u,v,m.createElement(GY,{required:p,scope:t,trigger:y,onTriggerChange:x,valueNode:w,onValueNodeChange:_,valueNodeHasChildren:C,onValueNodeHasChildrenChange:O,contentId:or(),value:L,onValueChange:F,open:k,onOpenChange:A,dir:P,triggerPointerDownPosRef:B,disabled:g},m.createElement(mp.Provider,{scope:t},m.createElement(YY,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback($=>{K(X=>new Set(X).add($))},[]),onNativeOptionRemove:m.useCallback($=>{K(X=>{const j=new Set(X);return j.delete($),j})},[])},n)),H?m.createElement(Ek,{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))},QY="SelectTrigger",ZY=m.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=iy(n),s=pa(QY,n),a=s.disabled||r,l=et(t,s.onTriggerChange),c=vp(n),[d,f,g]=Pk(v=>{const y=c().filter(_=>!_.disabled),x=y.find(_=>_.value===s.value),w=Ok(y,v,x);w!==void 0&&s.onValueChange(w.value)}),p=()=>{a||(s.onOpenChange(!0),g())};return m.createElement(Su,le({asChild:!0},o),m.createElement(Be.button,le({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":Ck(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===" ")&&WY.includes(v.key)&&(p(),v.preventDefault())})})))}),JY="SelectValue",eK=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:s="",...a}=e,l=pa(JY,n),{onValueNodeHasChildrenChange:c}=l,d=o!==void 0,f=et(t,l.onValueNodeChange);return Hn(()=>{c(d)},[c,d]),m.createElement(Be.span,le({},a,{ref:f,style:{pointerEvents:"none"}}),Ck(l.value)?m.createElement(m.Fragment,null,s):o)}),tK=m.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return m.createElement(Be.span,le({"aria-hidden":!0},i,{ref:t}),r||"▼")}),nK=e=>m.createElement(Eh,le({asChild:!0},e)),Nl="SelectContent",rK=m.forwardRef((e,t)=>{const n=pa(Nl,e.__scopeSelect),[r,i]=m.useState();if(Hn(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?kt.createPortal(m.createElement(vk,{scope:e.__scopeSelect},m.createElement(mp.Slot,{scope:e.__scopeSelect},m.createElement("div",null,e.children))),o):null}return m.createElement(iK,le({},e,{ref:t}))}),_o=10,[vk,ga]=Rl(Nl),iK=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,_=pa(Nl,n),[C,O]=m.useState(null),[P,k]=m.useState(null),A=et(t,de=>O(de)),[L,F]=m.useState(null),[B,H]=m.useState(null),V=vp(n),[K,Y]=m.useState(!1),$=m.useRef(!1);m.useEffect(()=>{if(C)return tp(C)},[C]),Qh();const X=m.useCallback(de=>{const[ie,...J]=V().map(oe=>oe.ref.current),[W]=J.slice(-1),be=document.activeElement;for(const oe of de)if(oe===be||(oe==null||oe.scrollIntoView({block:"nearest"}),oe===ie&&P&&(P.scrollTop=0),oe===W&&P&&(P.scrollTop=P.scrollHeight),oe==null||oe.focus(),document.activeElement!==be))return},[V,P]),j=m.useCallback(()=>X([L,C]),[X,L,C]);m.useEffect(()=>{K&&j()},[K,j]);const{onOpenChange:ne,triggerPointerDownPosRef:se}=_;m.useEffect(()=>{if(C){let de={x:0,y:0};const ie=W=>{var be,oe,Te,Fe;de={x:Math.abs(Math.round(W.pageX)-((be=(oe=se.current)===null||oe===void 0?void 0:oe.x)!==null&&be!==void 0?be:0)),y:Math.abs(Math.round(W.pageY)-((Te=(Fe=se.current)===null||Fe===void 0?void 0:Fe.y)!==null&&Te!==void 0?Te:0))}},J=W=>{de.x<=10&&de.y<=10?W.preventDefault():C.contains(W.target)||ne(!1),document.removeEventListener("pointermove",ie),se.current=null};return se.current!==null&&(document.addEventListener("pointermove",ie),document.addEventListener("pointerup",J,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ie),document.removeEventListener("pointerup",J,{capture:!0})}}},[C,ne,se]),m.useEffect(()=>{const de=()=>ne(!1);return window.addEventListener("blur",de),window.addEventListener("resize",de),()=>{window.removeEventListener("blur",de),window.removeEventListener("resize",de)}},[ne]);const[D,q]=Pk(de=>{const ie=V().filter(be=>!be.disabled),J=ie.find(be=>be.ref.current===document.activeElement),W=Ok(ie,de,J);W&&setTimeout(()=>W.ref.current.focus())}),re=m.useCallback((de,ie,J)=>{const W=!$.current&&!J;(_.value!==void 0&&_.value===ie||W)&&(F(de),W&&($.current=!0))},[_.value]),R=m.useCallback(()=>C==null?void 0:C.focus(),[C]),te=m.useCallback((de,ie,J)=>{const W=!$.current&&!J;(_.value!==void 0&&_.value===ie||W)&&H(de)},[_.value]),ge=r==="popper"?bk:oK,pe=ge===bk?{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:P,onViewportChange:k,itemRefCallback:re,selectedItem:L,onItemLeave:R,itemTextRefCallback:te,focusSelectedItem:j,selectedItemText:B,position:r,isPositioned:K,searchRef:D},m.createElement(ap,{as:no,allowPinchZoom:!0},m.createElement(Zh,{asChild:!0,trapped:_.open,onMountAutoFocus:de=>{de.preventDefault()},onUnmountAutoFocus:Ce(i,de=>{var ie;(ie=_.trigger)===null||ie===void 0||ie.focus({preventScroll:!0}),de.preventDefault()})},m.createElement(vl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:de=>de.preventDefault(),onDismiss:()=>_.onOpenChange(!1)},m.createElement(ge,le({role:"listbox",id:_.contentId,"data-state":_.open?"open":"closed",dir:_.dir,onContextMenu:de=>de.preventDefault()},w,pe,{onPlaced:()=>Y(!0),ref:A,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:Ce(w.onKeyDown,de=>{const ie=de.ctrlKey||de.altKey||de.metaKey;if(de.key==="Tab"&&de.preventDefault(),!ie&&de.key.length===1&&q(de.key),["ArrowUp","ArrowDown","Home","End"].includes(de.key)){let W=V().filter(be=>!be.disabled).map(be=>be.ref.current);if(["ArrowUp","End"].includes(de.key)&&(W=W.slice().reverse()),["ArrowUp","ArrowDown"].includes(de.key)){const be=de.target,oe=W.indexOf(be);W=W.slice(oe+1)}setTimeout(()=>X(W)),de.preventDefault()}})}))))))}),oK=m.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=pa(Nl,n),s=ga(Nl,n),[a,l]=m.useState(null),[c,d]=m.useState(null),f=et(t,A=>d(A)),g=vp(n),p=m.useRef(!1),v=m.useRef(!0),{viewport:y,selectedItem:x,selectedItemText:w,focusSelectedItem:_}=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(),B=w.getBoundingClientRect();if(o.dir!=="rtl"){const be=B.left-L.left,oe=F.left-be,Te=A.left-oe,Fe=A.width+Te,Ve=Math.max(Fe,L.width),Ke=window.innerWidth-_o,St=Zb(oe,[_o,Ke-Ve]);a.style.minWidth=Fe+"px",a.style.left=St+"px"}else{const be=L.right-B.right,oe=window.innerWidth-F.right-be,Te=window.innerWidth-A.right-oe,Fe=A.width+Te,Ve=Math.max(Fe,L.width),Ke=window.innerWidth-_o,St=Zb(oe,[_o,Ke-Ve]);a.style.minWidth=Fe+"px",a.style.right=St+"px"}const H=g(),V=window.innerHeight-_o*2,K=y.scrollHeight,Y=window.getComputedStyle(c),$=parseInt(Y.borderTopWidth,10),X=parseInt(Y.paddingTop,10),j=parseInt(Y.borderBottomWidth,10),ne=parseInt(Y.paddingBottom,10),se=$+X+K+ne+j,D=Math.min(x.offsetHeight*5,se),q=window.getComputedStyle(y),re=parseInt(q.paddingTop,10),R=parseInt(q.paddingBottom,10),te=A.top+A.height/2-_o,ge=V-te,pe=x.offsetHeight/2,de=x.offsetTop+pe,ie=$+X+de,J=se-ie;if(ie<=te){const be=x===H[H.length-1].ref.current;a.style.bottom="0px";const oe=c.clientHeight-y.offsetTop-y.offsetHeight,Te=Math.max(ge,pe+(be?R:0)+oe+j),Fe=ie+Te;a.style.height=Fe+"px"}else{const be=x===H[0].ref.current;a.style.top="0px";const Te=Math.max(te,$+y.offsetTop+(be?re:0)+pe)+J;a.style.height=Te+"px",y.scrollTop=ie-te+y.offsetTop}a.style.margin=`${_o}px 0`,a.style.minHeight=D+"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]);Hn(()=>C(),[C]);const[O,P]=m.useState();Hn(()=>{c&&P(window.getComputedStyle(c).zIndex)},[c]);const k=m.useCallback(A=>{A&&v.current===!0&&(C(),_==null||_(),v.current=!1)},[C,_]);return m.createElement(sK,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:p,onScrollButtonChange:k},m.createElement("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:O}},m.createElement(Be.div,le({},i,{ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}}))))}),bk=m.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=_o,...o}=e,s=iy(n);return m.createElement(Cu,le({},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)"}}))}),[sK,oy]=Rl(Nl,{}),yk="SelectViewport",aK=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=ga(yk,n),o=oy(yk,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(mp.Slot,{scope:n},m.createElement(Be.div,le({"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,_=Math.min(p,w),C=w-_;d.style.height=_+"px",d.style.bottom==="0px"&&(c.scrollTop=C>0?C:0,d.style.justifyContent="flex-end")}}}a.current=c.scrollTop})}))))}),lK="SelectGroup",[cK,uK]=Rl(lK),dK=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=or();return m.createElement(cK,{scope:n,id:i},m.createElement(Be.div,le({role:"group","aria-labelledby":i},r,{ref:t})))}),fK="SelectLabel",hK=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=uK(fK,n);return m.createElement(Be.div,le({id:i.id},r,{ref:t}))}),sy="SelectItem",[pK,xk]=Rl(sy),gK=m.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...s}=e,a=pa(sy,n),l=ga(sy,n),c=a.value===r,[d,f]=m.useState(o??""),[g,p]=m.useState(!1),v=et(t,w=>{var _;return(_=l.itemRefCallback)===null||_===void 0?void 0:_.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(pK,{scope:n,value:r,disabled:i,textId:y,isSelected:c,onItemTextChange:m.useCallback(w=>{f(_=>{var C;return _||((C=w==null?void 0:w.textContent)!==null&&C!==void 0?C:"").trim()})},[])},m.createElement(mp.ItemSlot,{scope:n,value:r,disabled:i,textValue:d},m.createElement(Be.div,le({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 _;(_=l.onItemLeave)===null||_===void 0||_.call(l)}else w.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ce(s.onPointerLeave,w=>{if(w.currentTarget===document.activeElement){var _;(_=l.onItemLeave)===null||_===void 0||_.call(l)}}),onKeyDown:Ce(s.onKeyDown,w=>{var _;((_=l.searchRef)===null||_===void 0?void 0:_.current)!==""&&w.key===" "||(qY.includes(w.key)&&x(),w.key===" "&&w.preventDefault())})}))))}),bp="SelectItemText",mK=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,s=pa(bp,n),a=ga(bp,n),l=xk(bp,n),c=KY(bp,n),[d,f]=m.useState(null),g=et(t,w=>f(w),l.onItemTextChange,w=>{var _;return(_=a.itemTextRefCallback)===null||_===void 0?void 0:_.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 Hn(()=>(y(v),()=>x(v)),[y,x,v]),m.createElement(m.Fragment,null,m.createElement(Be.span,le({id:l.textId},o,{ref:g})),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?kt.createPortal(o.children,s.valueNode):null)}),vK="SelectItemIndicator",bK=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return xk(vK,n).isSelected?m.createElement(Be.span,le({"aria-hidden":!0},r,{ref:t})):null}),wk="SelectScrollUpButton",yK=m.forwardRef((e,t)=>{const n=ga(wk,e.__scopeSelect),r=oy(wk,e.__scopeSelect),[i,o]=m.useState(!1),s=et(t,r.onScrollButtonChange);return Hn(()=>{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(Sk,le({},e,{ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}})):null}),_k="SelectScrollDownButton",xK=m.forwardRef((e,t)=>{const n=ga(_k,e.__scopeSelect),r=oy(_k,e.__scopeSelect),[i,o]=m.useState(!1),s=et(t,r.onScrollButtonChange);return Hn(()=>{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(Sk,le({},e,{ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}})):null}),Sk=m.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=ga("SelectScrollButton",n),s=m.useRef(null),a=vp(n),l=m.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return m.useEffect(()=>()=>l(),[l]),Hn(()=>{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,le({"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()})}))}),wK=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return m.createElement(Be.div,le({"aria-hidden":!0},r,{ref:t}))});function Ck(e){return e===""||e===void 0}const Ek=m.forwardRef((e,t)=>{const{value:n,...r}=e,i=m.useRef(null),o=et(t,i),s=pp(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(y2,{asChild:!0},m.createElement("select",le({},r,{ref:o,defaultValue:n})))});Ek.displayName="BubbleSelect";function Pk(e){const t=On(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 Ok(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=_K(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 _K(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const SK=XY,kk=ZY,CK=eK,EK=tK,PK=nK,Mk=rK,OK=aK,kK=dK,Dk=hK,Tk=gK,MK=mK,DK=bK,Ak=yK,Ik=xK,ay=wK,Rk=SK,Nk=kK,Lk=CK,ly=ue.forwardRef(({className:e,children:t,...n},r)=>S.jsxs(kk,{ref:r,className:Oe("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,S.jsx(EK,{asChild:!0,children:S.jsx(Rb,{className:"h-4 w-4 opacity-50"})})]}));ly.displayName=kk.displayName;const $k=ue.forwardRef(({className:e,...t},n)=>S.jsx(Ak,{ref:n,className:Oe("flex cursor-default items-center justify-center py-1",e),...t,children:S.jsx(RB,{className:"h-4 w-4"})}));$k.displayName=Ak.displayName;const Fk=ue.forwardRef(({className:e,...t},n)=>S.jsx(Ik,{ref:n,className:Oe("flex cursor-default items-center justify-center py-1",e),...t,children:S.jsx(Rb,{className:"h-4 w-4"})}));Fk.displayName=Ik.displayName;const cy=ue.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>S.jsx(PK,{children:S.jsxs(Mk,{ref:i,className:Oe("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:[S.jsx($k,{}),S.jsx(OK,{className:Oe("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),S.jsx(Fk,{})]})}));cy.displayName=Mk.displayName;const yp=ue.forwardRef(({className:e,...t},n)=>S.jsx(Dk,{ref:n,className:Oe("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));yp.displayName=Dk.displayName;const ma=ue.forwardRef(({className:e,children:t,...n},r)=>S.jsxs(Tk,{ref:r,className:Oe("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:[S.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:S.jsx(DK,{children:S.jsx(Ib,{className:"h-4 w-4"})})}),S.jsx(MK,{children:t})]}));ma.displayName=Tk.displayName;const TK=ue.forwardRef(({className:e,...t},n)=>S.jsx(ay,{ref:n,className:Oe("-mx-1 my-1 h-px bg-muted",e),...t}));TK.displayName=ay.displayName;function xp({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 S.jsx(zB,{className:" rotate-90",strokeWidth:1,size:16});if(e==="Database")return S.jsx(LB,{strokeWidth:1,size:16});if(e==="Schema")return S.jsx(qB,{strokeWidth:1,size:16});if(e==="Table")return S.jsx(Nb,{strokeWidth:1,size:16})}return S.jsxs("div",{className:"flex gap-2 items-center",children:[S.jsx("div",{className:" shrink-0",children:a()}),S.jsxs(Rk,{value:s,onValueChange:o,children:[S.jsx(ly,{className:"focus:ring-offset-0 focus:ring-1 h-7 w-[190px] ",children:S.jsx(Lk,{placeholder:r?"Loading...":i?"Error":`Select ${e}`})}),S.jsx(cy,{children:S.jsxs(Nk,{children:[r?S.jsx(yp,{children:"Loading..."}):S.jsx(yp,{children:e}),S.jsx(S.Fragment,{children:t&&t.map(l=>S.jsx(ma,{value:l.id,children:l.name},l.id))}),(r||i)&&S.jsx(ma,{value:s,children:s})]})})]})]})}function AK({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=AP(d,o,f);s(g);const p=TP(g,i||"",r);p&&(a(p),l(!0)),n(!1)}return S.jsxs(lp,{open:t,onOpenChange:n,children:[S.jsx(cp,{asChild:!0,children:S.jsx(Tj,{className:"w-3 h-3 text-foreground/40 cursor-pointer"})}),S.jsx(Hu,{align:"center",className:" p-0 w-18 rounded-none shadow-none ",children:S.jsxs("ul",{className:"text-xs ",children:[S.jsx("li",{onClick:()=>c(e,"COUNT"),className:" px-3 p-1 hover:bg-muted transition-colors cursor-pointer",children:"Count"}),S.jsx("li",{onClick:()=>c(e,"AVG"),className:" px-3 p-1 hover:bg-muted transition-colors cursor-pointer",children:"Avg"}),S.jsx("li",{onClick:()=>c(e,"SUM"),className:"px-3 p-1 hover:bg-muted transition-colors cursor-pointer",children:"Sum"}),S.jsx("li",{onClick:()=>c(e,"MAX"),className:"px-3 p-1 hover:bg-muted transition-colors cursor-pointer",children:"Max"}),S.jsx("li",{onClick:()=>c(e,"MIN"),className:"px-3 p-1 hover:bg-muted transition-colors cursor-pointer",children:"Min"})]})})]})}function jk({column:e}){return S.jsxs(Tb,{children:[S.jsx(w2,{asChild:!0,children:v0.includes(e.data_type.toLowerCase())?S.jsx("span",{className:" font-thin",children:"T"}):Pl.includes(e.data_type.toLowerCase())?S.jsx("span",{className:" font-thin",children:"#"}):Tu.includes(e.data_type.toLowerCase())?S.jsx("span",{className:" font-thin",children:"D"}):DP.includes(e.data_type.toLowerCase())?S.jsx("span",{className:" font-thin",children:"B"}):S.jsx("span",{className:" font-thin",children:"?"})}),S.jsx(kh,{children:S.jsx("p",{className:"text-xs font-mono",children:e.data_type})})]})}function IK({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=AP(f,i);s(g);const p=TP(g,e,t);p&&(l(p),o(!0))}function d(){const f=y0(e,t);a(!1),l(`SELECT * FROM ${f} LIMIT 10`),o(!0)}return S.jsxs("div",{children:[S.jsx("div",{className:" font-medium px-3 py-2",children:S.jsxs(dt,{disabled:r!=="Success",onClick:d,variant:"outline",className:" h-7 flex w-full",children:[r!=="Success"&&S.jsx(Pu,{className:" w-4 h-4 animate-spin mr-2 text-foreground/50"}),"Show top 10 rows"]})}),S.jsxs(Sl,{className:`w-[200px] ${t==="api"?"h-[74vh]":"h-[60vh]"}`,children:[n==null?void 0:n.map(f=>S.jsxs("div",{onClick:()=>c(f),className:Oe(" text-sm flex items-center justify-between px-3 py-[6px] transition-colors hover:bg-muted/50 cursor-pointer rounded ",{" bg-muted":kW(f,i)}),children:[S.jsxs("div",{className:"flex items-center space-x-2 ",children:[S.jsx(jk,{column:f}),S.jsx("span",{children:f.column_name})]}),Pl.includes(f.data_type)&&S.jsx("div",{onClick:g=>g.stopPropagation(),className:" flex items-center justify-end ",children:S.jsx(AK,{column:f})})]},f.column_name)),S.jsx($h,{orientation:"vertical"}),S.jsx($h,{orientation:"horizontal"})]})]})}function zk({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:_,isSchemaLoadingOrFetching:C,isSchemaError:O,isColumnsError:P,isColumnsLoadingOrFetching:k,isAPIConnection:A}=qH();m.useEffect(()=>{A&&(s("NA"),a(""),l("api"))},[A,c,l,a,s]);const L=A?"api":i||"",F=A?"":r||"";function B(Y){a(Y),l("")}function H(Y){s(Y),a(""),l("")}function V(Y){o(Y)}function K(){return e?e(F,L,v):S.jsx(IK,{schemaName:F,tableName:L,columns:v,status:k?"Loading...":P?"Error":"Success"})}return S.jsxs("aside",{className:" grow flex flex-col ",children:[S.jsxs("section",{className:"space-y-3 pb-4",children:[S.jsx(xp,{items:d,title:"Connection",value:t||"",onChange:V,isLoading:y,isError:x}),!A&&S.jsxs(S.Fragment,{children:[S.jsx(xp,{onChange:H,isError:_,isLoading:w,items:g,value:n||"",title:"Database"}),S.jsx(xp,{onChange:B,isError:O,isLoading:C,items:f,value:r||"",title:"Schema"}),S.jsx(xp,{onChange:l,isError:_,items:p,isLoading:w,value:i||"",title:"Table"})]})]}),k?S.jsx(Rc,{className:"h-1 mb-2"}):S.jsx(ay,{className:"h-1 mb-2 bg-foreground/20"}),K(),S.jsx("div",{className:" grow justify-end flex flex-col pt-6 "})]})}const{createElement:Ll,createContext:RK,createRef:Mde,forwardRef:Bk,useCallback:Rr,useContext:Hk,useEffect:va,useImperativeHandle:Vk,useLayoutEffect:NK,useMemo:LK,useRef:ei,useState:wp}=ue,Wk=ue.useId,_p=RK(null);_p.displayName="PanelGroupContext";const Uu=NK,$K=typeof Wk=="function"?Wk:()=>null;let FK=0;function uy(e=null){const t=$K(),n=ei(e||t||null);return n.current===null&&(n.current=""+FK++),e??n.current}function qk({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=Hk(_p);if(x===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:w,expandPanel:_,getPanelSize:C,getPanelStyle:O,groupId:P,isPanelCollapsed:k,registerPanel:A,resizePanel:L,unregisterPanel:F}=x,B=uy(s),H=ei({callbacks:{onCollapse:c,onExpand:d,onResize:f},constraints:{collapsedSize:n,collapsible:r,defaultSize:i,maxSize:a,minSize:l},id:B,idIsFromProps:s!==void 0,order:g});ei({didLogMissingDefaultSizeWarning:!1}),Uu(()=>{const{callbacks:K,constraints:Y}=H.current;H.current.id=B,H.current.idIsFromProps=s!==void 0,H.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}),Uu(()=>{const K=H.current;return A(K),()=>{F(K)}},[g,B,A,F]),Vk(o,()=>({collapse:()=>{w(H.current)},expand:()=>{_(H.current)},getId(){return B},getSize(){return C(H.current)},isCollapsed(){return k(H.current)},isExpanded(){return!k(H.current)},resize:K=>{L(H.current,K)}}),[w,_,C,k,B,L]);const V=O(H.current,i);return Ll(v,{...y,children:e,className:t,style:{...V,...p},"data-panel":"","data-panel-id":B,"data-panel-group-id":P,"data-panel-collapsible":void 0,"data-panel-size":void 0})}const Uk=Bk((e,t)=>Ll(qk,{...e,forwardedRef:t}));qk.displayName="Panel",Uk.displayName="forwardRef(Panel)";function ot(e,t="Assertion failed!"){if(!e)throw console.error(t),Error(t)}const Gk=10;function Gu(e,t,n=Gk){e=parseFloat(e.toFixed(n)),t=parseFloat(t.toFixed(n));const r=e-t;return r===0?0:r>0?1:-1}function Nr(e,t,n){return Gu(e,t,n)===0}function $l({panelConstraints:e,panelIndex:t,size:n}){const r=e[t];ot(r!=null);let{collapsedSize:i=0,collapsible:o,maxSize:s=100,minSize:a=0}=r;if(Gu(n,a)<0)if(o){const l=(i+a)/2;Gu(n,l)<0?n=i:n=a}else n=a;return n=Math.min(s,n),n=parseFloat(n.toFixed(Gk)),n}function Yu({delta:e,layout:t,panelConstraints:n,pivotIndices:r,trigger:i}){if(Nr(e,0))return t;const o=[...t],[s,a]=r;ot(s!=null),ot(a!=null);let l=0;if(i==="keyboard"){{const d=e<0?a:s,f=n[d];if(ot(f),f.collapsible){const g=t[d];ot(g!=null);const p=n[d];ot(p);const{collapsedSize:v=0,minSize:y=0}=p;if(Nr(g,v)){const x=y-g;Gu(x,Math.abs(e))>0&&(e=e<0?0-x:x)}}}{const d=e<0?s:a,f=n[d];ot(f);const{collapsible:g}=f;if(g){const p=t[d];ot(p!=null);const v=n[d];ot(v);const{collapsedSize:y=0,minSize:x=0}=v;if(Nr(p,x)){const w=p-y;Gu(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];ot(v!=null);const x=$l({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];ot(p!=null);const v=p-g,y=$l({panelConstraints:n,panelIndex:f,size:v});if(!Nr(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(Nr(l,0))return t;{const d=e<0?a:s,f=t[d];ot(f!=null);const g=f+l,p=$l({panelConstraints:n,panelIndex:d,size:g});if(o[d]=p,!Nr(p,g)){let v=g-p,x=e<0?a:s;for(;x>=0&&x<n.length;){const w=o[x];ot(w!=null);const _=w+v,C=$l({panelConstraints:n,panelIndex:x,size:_});if(Nr(w,C)||(v-=C-w,o[x]=C),Nr(v,0))break;e>0?x--:x++}}}const c=o.reduce((d,f)=>f+d,0);return Nr(c,100)?o:t}function jK({layout:e,panelsArray:t,pivotIndices:n}){let r=0,i=100,o=0,s=0;const a=n[0];ot(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 Ku(e){return Array.from(document.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function Yk(e,t){const r=Ku(e).findIndex(i=>i.getAttribute("data-panel-resize-handle-id")===t);return r??null}function Kk(e,t){const n=Yk(e,t);return n!=null?[n,n+1]:[-1,-1]}function Xk(e){const t=document.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return t||null}function Sp(e){const t=document.querySelector(`[data-panel-resize-handle-id="${e}"]`);return t||null}function zK(e,t,n){var r,i,o,s;const a=Sp(t),l=Ku(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 BK({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:i,setLayout:o}){ei({didWarnAboutMissingResizeHandle:!1}),Uu(()=>{const s=Ku(n);for(let a=0;a<i.length-1;a++){const{valueMax:l,valueMin:c,valueNow:d}=jK({layout:r,panelsArray:i,pivotIndices:[a,a+1]}),f=s[a];if(f!=null){const g=i[a];ot(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]),va(()=>{const s=t.current;ot(s);const{panelDataArray:a}=s,l=Xk(n);ot(l!=null,`No group found for id "${n}"`);const c=Ku(n);ot(c);const d=c.map(f=>{const g=f.getAttribute("data-panel-resize-handle-id");ot(g);const[p,v]=zK(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(_=>_.id===p);if(w>=0){const _=a[w];ot(_);const C=r[w],{collapsedSize:O=0,collapsible:P,minSize:k=0}=_.constraints;if(C!=null&&P){const A=Yu({delta:Nr(C,O)?k-O:O-C,layout:r,panelConstraints:a.map(L=>L.constraints),pivotIndices:Kk(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 Qk(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 Zk(e){return e.type==="keydown"}function Jk(e){return e.type.startsWith("mouse")}function eM(e){return e.type.startsWith("touch")}function tM(e,t){const n=e==="horizontal";if(Jk(t))return n?t.clientX:t.clientY;if(eM(t)){const r=t.touches[0];return ot(r),n?r.screenX:r.screenY}else throw Error(`Unsupported event type "${t.type}"`)}function HK(e,t,n,r){const i=n==="horizontal",o=Sp(t);ot(o);const s=o.getAttribute("data-panel-group-id");ot(s);let{initialCursorPosition:a}=r;const l=tM(n,e),c=Xk(s);ot(c);const d=c.getBoundingClientRect(),f=i?d.width:d.height;return(l-a)/f*100}function VK(e,t,n,r,i){if(Zk(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:HK(e,t,n,r)}function WK({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];ot(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];ot(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 Fl(e,t,n){t.forEach((r,i)=>{const o=e[i];ot(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 Cp(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 qK({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 dy=null,ba=null;function nM(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 UK(){ba!==null&&(document.head.removeChild(ba),dy=null,ba=null)}function fy(e){if(dy===e)return;dy=e;const t=nM(e);ba===null&&(ba=document.createElement("style"),document.head.appendChild(ba)),ba.innerHTML=`*{cursor: ${t}!important;}`}function GK(e,t=10){let n=null;return(...i)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...i)},t)}}function rM(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 iM(e){return`react-resizable-panels:${e}`}function oM(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 sM(e,t){try{const n=iM(e),r=t.getItem(n);if(r){const i=JSON.parse(r);if(typeof i=="object"&&i!=null)return i}}catch{}return null}function YK(e,t,n){var r,i;const o=(r=sM(e,n))!==null&&r!==void 0?r:{},s=oM(t);return(i=o[s])!==null&&i!==void 0?i:null}function KK(e,t,n,r,i){var o;const s=iM(e),a=oM(t),l=(o=sM(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 aM({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(!Nr(r,100))for(let o=0;o<t.length;o++){const s=n[o];ot(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];ot(s!=null);const a=$l({panelConstraints:t,panelIndex:o,size:s});s!=a&&(i+=s-a,n[o]=a)}if(!Nr(i,0))for(let o=0;o<t.length;o++){const s=n[o];ot(s!=null);const a=s+i,l=$l({panelConstraints:t,panelIndex:o,size:a});if(s!==l&&(i-=l-s,n[o]=l,Nr(i,0)))break}return n}const XK=100,Xu={getItem:e=>(rM(Xu),Xu.getItem(e)),setItem:(e,t)=>{rM(Xu),Xu.setItem(e,t)}},lM={};function cM({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:i,id:o=null,onLayout:s=null,keyboardResizeBy:a=null,storage:l=Xu,style:c,tagName:d="div",...f}){const g=uy(o),[p,v]=wp(null),[y,x]=wp([]),w=ei({}),_=ei(new Map),C=ei(0),O=ei({autoSaveId:e,direction:r,dragState:p,id:g,keyboardResizeBy:a,onLayout:s,storage:l}),P=ei({layout:y,panelDataArray:[],panelDataArrayChanged:!1});ei({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),Vk(i,()=>({getId:()=>O.current.id,getLayout:()=>{const{layout:D}=P.current;return D},setLayout:D=>{const{onLayout:q}=O.current,{layout:re,panelDataArray:R}=P.current,te=aM({layout:D,panelConstraints:R.map(ge=>ge.constraints)});Qk(re,te)||(x(te),P.current.layout=te,q&&q(te),Fl(R,te,w.current))}}),[]),Uu(()=>{O.current.autoSaveId=e,O.current.direction=r,O.current.dragState=p,O.current.id=g,O.current.onLayout=s,O.current.storage=l}),BK({committedValuesRef:O,eagerValuesRef:P,groupId:g,layout:y,panelDataArray:P.current.panelDataArray,setLayout:x}),va(()=>{const{panelDataArray:D}=P.current;if(e){if(y.length===0||y.length!==D.length)return;let q=lM[e];q==null&&(q=GK(KK,XK),lM[e]=q);const re=[...D],R=new Map(_.current);q(e,re,R,y,l)}},[e,y,l]),va(()=>{});const k=Rr(D=>{const{onLayout:q}=O.current,{layout:re,panelDataArray:R}=P.current;if(D.constraints.collapsible){const te=R.map(ie=>ie.constraints),{collapsedSize:ge=0,panelSize:pe,pivotIndices:de}=zl(R,D,re);if(ot(pe!=null),pe!==ge){_.current.set(D.id,pe);const J=jl(R,D)===R.length-1?pe-ge:ge-pe,W=Yu({delta:J,layout:re,panelConstraints:te,pivotIndices:de,trigger:"imperative-api"});Cp(re,W)||(x(W),P.current.layout=W,q&&q(W),Fl(R,W,w.current))}}},[]),A=Rr(D=>{const{onLayout:q}=O.current,{layout:re,panelDataArray:R}=P.current;if(D.constraints.collapsible){const te=R.map(J=>J.constraints),{collapsedSize:ge=0,panelSize:pe,minSize:de=0,pivotIndices:ie}=zl(R,D,re);if(pe===ge){const J=_.current.get(D.id),W=J!=null&&J>=de?J:de,oe=jl(R,D)===R.length-1?pe-W:W-pe,Te=Yu({delta:oe,layout:re,panelConstraints:te,pivotIndices:ie,trigger:"imperative-api"});Cp(re,Te)||(x(Te),P.current.layout=Te,q&&q(Te),Fl(R,Te,w.current))}}},[]),L=Rr(D=>{const{layout:q,panelDataArray:re}=P.current,{panelSize:R}=zl(re,D,q);return ot(R!=null),R},[]),F=Rr((D,q)=>{const{panelDataArray:re}=P.current,R=jl(re,D);return qK({defaultSize:q,dragState:p,layout:y,panelData:re,panelIndex:R})},[p,y]),B=Rr(D=>{const{layout:q,panelDataArray:re}=P.current,{collapsedSize:R=0,collapsible:te,panelSize:ge}=zl(re,D,q);return te===!0&&ge===R},[]),H=Rr(D=>{const{layout:q,panelDataArray:re}=P.current,{collapsedSize:R=0,collapsible:te,panelSize:ge}=zl(re,D,q);return ot(ge!=null),!te||ge>R},[]),V=Rr(D=>{const{panelDataArray:q}=P.current;q.push(D),q.sort((re,R)=>{const te=re.order,ge=R.order;return te==null&&ge==null?0:te==null?-1:ge==null?1:te-ge}),P.current.panelDataArrayChanged=!0},[]);Uu(()=>{if(P.current.panelDataArrayChanged){P.current.panelDataArrayChanged=!1;const{autoSaveId:D,onLayout:q,storage:re}=O.current,{layout:R,panelDataArray:te}=P.current;let ge=null;if(D){const de=YK(D,te,re);de&&(_.current=new Map(Object.entries(de.expandToSizes)),ge=de.layout)}ge==null&&(ge=WK({panelDataArray:te}));const pe=aM({layout:ge,panelConstraints:te.map(de=>de.constraints)});Qk(R,pe)||(x(pe),P.current.layout=pe,q&&q(pe),Fl(te,pe,w.current))}});const K=Rr(D=>function(re){re.preventDefault();const{direction:R,dragState:te,id:ge,keyboardResizeBy:pe,onLayout:de}=O.current,{layout:ie,panelDataArray:J}=P.current,{initialLayout:W}=te??{},be=Kk(ge,D);let oe=VK(re,D,R,te,pe);if(oe===0)return;const Te=R==="horizontal";document.dir==="rtl"&&Te&&(oe=-oe);const Fe=J.map(St=>St.constraints),Ve=Yu({delta:oe,layout:W??ie,panelConstraints:Fe,pivotIndices:be,trigger:Zk(re)?"keyboard":"mouse-or-touch"}),Ke=!Cp(ie,Ve);(Jk(re)||eM(re))&&C.current!=oe&&(C.current=oe,fy(Ke?Te?"horizontal":"vertical":Te?oe<0?"horizontal-min":"horizontal-max":oe<0?"vertical-min":"vertical-max")),Ke&&(x(Ve),P.current.layout=Ve,de&&de(Ve),Fl(J,Ve,w.current))},[]),Y=Rr((D,q)=>{const{onLayout:re}=O.current,{layout:R,panelDataArray:te}=P.current,ge=te.map(be=>be.constraints),{panelSize:pe,pivotIndices:de}=zl(te,D,R);ot(pe!=null);const J=jl(te,D)===te.length-1?pe-q:q-pe,W=Yu({delta:J,layout:R,panelConstraints:ge,pivotIndices:de,trigger:"imperative-api"});Cp(R,W)||(x(W),P.current.layout=W,re&&re(W),Fl(te,W,w.current))},[]),$=Rr((D,q)=>{const{direction:re}=O.current,{layout:R}=P.current,te=Sp(D);ot(te);const ge=tM(re,q);v({dragHandleId:D,dragHandleRect:te.getBoundingClientRect(),initialCursorPosition:ge,initialLayout:R})},[]),X=Rr(()=>{UK(),v(null)},[]),j=Rr(D=>{const{panelDataArray:q}=P.current,re=jl(q,D);re>=0&&(q.splice(re,1),delete w.current[D.id],P.current.panelDataArrayChanged=!0)},[]),ne=LK(()=>({collapsePanel:k,direction:r,dragState:p,expandPanel:A,getPanelSize:L,getPanelStyle:F,groupId:g,isPanelCollapsed:B,isPanelExpanded:H,registerPanel:V,registerResizeHandle:K,resizePanel:Y,startDragging:$,stopDragging:X,unregisterPanel:j}),[k,p,r,A,L,F,g,B,H,V,K,Y,$,X,j]),se={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return Ll(_p.Provider,{value:ne},Ll(d,{...f,children:t,className:n,style:{...se,...c},"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":g}))}const uM=Bk((e,t)=>Ll(cM,{...e,forwardedRef:t}));cM.displayName="PanelGroup",uM.displayName="forwardRef(PanelGroup)";function jl(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function zl(e,t,n){const r=e.map(c=>c.constraints),i=jl(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 QK({disabled:e,handleId:t,resizeHandler:n}){va(()=>{if(e||n==null)return;const r=Sp(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");ot(s);const a=Ku(s),l=Yk(s,t);ot(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 dM({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});va(()=>{d.current.onDragging=i});const f=Hk(_p);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,_=uy(r),C=(p==null?void 0:p.dragHandleId)===_,[O,P]=wp(!1),[k,A]=wp(null),L=Rr(()=>{const B=c.current;ot(B),B.blur(),w();const{onDragging:H}=d.current;H&&H(!1)},[w]);va(()=>{if(n)A(null);else{const B=y(_);A(()=>B)}},[n,_,y]),va(()=>{if(n||k==null||!C)return;const B=Y=>{k(Y)},H=Y=>{k(Y)},V=c.current;ot(V);const K=V.ownerDocument;return K.body.addEventListener("contextmenu",L),K.body.addEventListener("mousemove",B),K.body.addEventListener("touchmove",B),K.body.addEventListener("mouseleave",H),window.addEventListener("mouseup",L),window.addEventListener("touchend",L),()=>{K.body.removeEventListener("contextmenu",L),K.body.removeEventListener("mousemove",B),K.body.removeEventListener("touchmove",B),K.body.removeEventListener("mouseleave",H),window.removeEventListener("mouseup",L),window.removeEventListener("touchend",L)}},[g,n,C,k,L]),QK({disabled:n,handleId:_,resizeHandler:k});const F={cursor:nM(g),touchAction:"none",userSelect:"none"};return Ll(a,{...l,children:e,className:t,onBlur:()=>P(!1),onFocus:()=>P(!0),onMouseDown:B=>{x(_,B.nativeEvent);const H=d.current;ot(H);const{onDragging:V}=H;V&&V(!0)},onMouseUp:L,onTouchCancel:L,onTouchEnd:L,onTouchStart:B=>{x(_,B.nativeEvent);const H=d.current;ot(H);const{onDragging:V}=H;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":O?"keyboard":void 0,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":_})}dM.displayName="PanelResizeHandle";const fM=({className:e,...t})=>S.jsx(uM,{className:Oe("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t}),Ep=Uk,hM=({withHandle:e,className:t,...n})=>S.jsx(dM,{className:Oe("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&&S.jsx("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",children:S.jsx($B,{className:"h-2.5 w-2.5"})})});function ZK(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pM(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 gM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pM(Object(n),!0).forEach(function(r){ZK(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function JK(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 eX(e,t){if(e==null)return{};var n=JK(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 tX(e,t){return nX(e)||rX(e,t)||iX(e,t)||oX()}function nX(e){if(Array.isArray(e))return e}function rX(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 iX(e,t){if(e){if(typeof e=="string")return mM(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 mM(e,t)}}function mM(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 oX(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
423
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sX(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vM(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?vM(Object(n),!0).forEach(function(r){sX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function aX(){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 Qu(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 Pp(e){return{}.toString.call(e).includes("Object")}function lX(e){return!Object.keys(e).length}function Zu(e){return typeof e=="function"}function cX(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function uX(e,t){return Pp(t)||is("changeType"),Object.keys(t).some(function(n){return!cX(e,n)})&&is("changeField"),t}function dX(e){Zu(e)||is("selectorType")}function fX(e){Zu(e)||Pp(e)||is("handlerType"),Pp(e)&&Object.values(e).some(function(t){return!Zu(t)})&&is("handlersType")}function hX(e){e||is("initialIsRequired"),Pp(e)||is("initialType"),lX(e)&&is("initialContent")}function pX(e,t){throw new Error(e[t]||e.default)}var gX={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"},is=Qu(pX)(gX),Op={changes:uX,selector:dX,handler:fX,initial:hX};function mX(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Op.initial(e),Op.handler(t);var n={current:e},r=Qu(yX)(n,t),i=Qu(bX)(n),o=Qu(Op.changes)(e),s=Qu(vX)(n);function a(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(d){return d};return Op.selector(c),c(n.current)}function l(c){aX(r,i,o,s)(c)}return[a,l]}function vX(e,t){return Zu(t)?t(e.current):t}function bX(e,t){return e.current=bM(bM({},e.current),t),t}function yX(e,t,n){return Zu(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 xX={create:mX},wX={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs"}};function _X(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 SX(e){return{}.toString.call(e).includes("Object")}function CX(e){return e||xM("configIsRequired"),SX(e)||xM("configType"),e.urls?(EX(),{paths:{vs:e.urls.monacoBase}}):e}function EX(){console.warn(yM.deprecation)}function PX(e,t){throw new Error(e[t]||e.default)}var yM={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!
|
|
424
|
+
You are using deprecated way of configuration.
|
|
425
|
+
|
|
426
|
+
Instead of using
|
|
427
|
+
monaco.config({ urls: { monacoBase: '...' } })
|
|
428
|
+
use
|
|
429
|
+
monaco.config({ paths: { vs: '...' } })
|
|
430
|
+
|
|
431
|
+
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
432
|
+
`},xM=_X(PX)(yM),OX={config:CX},kX=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 wM(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],wM(e[n],t[n]))}),gM(gM({},e),t)}var MX={type:"cancelation",msg:"operation is manually canceled"};function hy(e){var t=!1,n=new Promise(function(r,i){e.then(function(o){return t?i(MX):r(o)}),e.catch(i)});return n.cancel=function(){return t=!0},n}var DX=xX.create({config:wX,isInitialized:!1,resolve:null,reject:null,monaco:null}),_M=tX(DX,2),Ju=_M[0],kp=_M[1];function TX(e){var t=OX.config(e),n=t.monaco,r=eX(t,["monaco"]);kp(function(i){return{config:wM(i.config,r),monaco:n}})}function AX(){var e=Ju(function(t){var n=t.monaco,r=t.isInitialized,i=t.resolve;return{monaco:n,isInitialized:r,resolve:i}});if(!e.isInitialized){if(kp({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),hy(py);if(window.monaco&&window.monaco.editor)return SM(window.monaco),e.resolve(window.monaco),hy(py);kX(IX,NX)(LX)}return hy(py)}function IX(e){return document.body.appendChild(e)}function RX(e){var t=document.createElement("script");return e&&(t.src=e),t}function NX(e){var t=Ju(function(r){var i=r.config,o=r.reject;return{config:i,reject:o}}),n=RX("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function LX(){var e=Ju(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){SM(n),e.resolve(n)},function(n){e.reject(n)})}function SM(e){Ju().monaco||kp({monaco:e})}function $X(){return Ju(function(e){var t=e.monaco;return t})}var py=new Promise(function(e,t){return kp({resolve:e,reject:t})}),CM={config:TX,init:AX,__getMonacoInstance:$X},FX={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},gy=FX,jX={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},zX=jX;function BX({children:e}){return m.createElement("div",{style:zX.container},e)}var HX=BX,VX=HX;function WX({width:e,height:t,isEditorReady:n,loading:r,_ref:i,className:o,wrapperProps:s}){return m.createElement("section",{style:{...gy.wrapper,width:e,height:t},...s},!n&&m.createElement(VX,null,r),m.createElement("div",{ref:i,style:{...gy.fullWidth,...!n&&gy.hide},className:o}))}var qX=WX,EM=m.memo(qX);function UX(e){m.useEffect(e,[])}var PM=UX;function GX(e,t,n=!0){let r=m.useRef(!0);m.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var Lr=GX;function ed(){}function Bl(e,t,n,r){return YX(e,r)||KX(e,t,n,r)}function YX(e,t){return e.editor.getModel(OM(e,t))}function KX(e,t,n,r){return e.editor.createModel(t,n,r?OM(e,r):void 0)}function OM(e,t){return e.Uri.parse(t)}function XX({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=ed,onMount:w=ed}){let[_,C]=m.useState(!1),[O,P]=m.useState(!0),k=m.useRef(null),A=m.useRef(null),L=m.useRef(null),F=m.useRef(w),B=m.useRef(x),H=m.useRef(!1);PM(()=>{let $=CM.init();return $.then(X=>(A.current=X)&&P(!1)).catch(X=>(X==null?void 0:X.type)!=="cancelation"&&console.error("Monaco initialization: error:",X)),()=>k.current?Y():$.cancel()}),Lr(()=>{if(k.current&&A.current){let $=k.current.getOriginalEditor(),X=Bl(A.current,e||"",r||n||"text",o||"");X!==$.getModel()&&$.setModel(X)}},[o],_),Lr(()=>{if(k.current&&A.current){let $=k.current.getModifiedEditor(),X=Bl(A.current,t||"",i||n||"text",s||"");X!==$.getModel()&&$.setModel(X)}},[s],_),Lr(()=>{let $=k.current.getModifiedEditor();$.getOption(A.current.editor.EditorOption.readOnly)?$.setValue(t||""):t!==$.getValue()&&($.executeEdits("",[{range:$.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),$.pushUndoStop())},[t],_),Lr(()=>{var $,X;(X=($=k.current)==null?void 0:$.getModel())==null||X.original.setValue(e||"")},[e],_),Lr(()=>{let{original:$,modified:X}=k.current.getModel();A.current.editor.setModelLanguage($,r||n||"text"),A.current.editor.setModelLanguage(X,i||n||"text")},[n,r,i],_),Lr(()=>{var $;($=A.current)==null||$.editor.setTheme(c)},[c],_),Lr(()=>{var $;($=k.current)==null||$.updateOptions(f)},[f],_);let V=m.useCallback(()=>{var j;if(!A.current)return;B.current(A.current);let $=Bl(A.current,e||"",r||n||"text",o||""),X=Bl(A.current,t||"",i||n||"text",s||"");(j=k.current)==null||j.setModel({original:$,modified:X})},[n,t,i,e,r,o,s]),K=m.useCallback(()=>{var $;!H.current&&L.current&&(k.current=A.current.editor.createDiffEditor(L.current,{automaticLayout:!0,...f}),V(),($=A.current)==null||$.editor.setTheme(c),C(!0),H.current=!0)},[f,c,V]);m.useEffect(()=>{_&&F.current(k.current,A.current)},[_]),m.useEffect(()=>{!O&&!_&&K()},[O,_,K]);function Y(){var X,j,ne,se;let $=(X=k.current)==null?void 0:X.getModel();a||((j=$==null?void 0:$.original)==null||j.dispose()),l||((ne=$==null?void 0:$.modified)==null||ne.dispose()),(se=k.current)==null||se.dispose()}return m.createElement(EM,{width:p,height:g,isEditorReady:_,loading:d,_ref:L,className:v,wrapperProps:y})}var QX=XX;m.memo(QX);function ZX(e){let t=m.useRef();return m.useEffect(()=>{t.current=e},[e]),t.current}var JX=ZX,Mp=new Map;function eQ({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=ed,onMount:_=ed,onChange:C,onValidate:O=ed}){let[P,k]=m.useState(!1),[A,L]=m.useState(!0),F=m.useRef(null),B=m.useRef(null),H=m.useRef(null),V=m.useRef(_),K=m.useRef(w),Y=m.useRef(),$=m.useRef(r),X=JX(o),j=m.useRef(!1),ne=m.useRef(!1);PM(()=>{let q=CM.init();return q.then(re=>(F.current=re)&&L(!1)).catch(re=>(re==null?void 0:re.type)!=="cancelation"&&console.error("Monaco initialization: error:",re)),()=>B.current?D():q.cancel()}),Lr(()=>{var re,R,te,ge;let q=Bl(F.current,e||r||"",t||i||"",o||n||"");q!==((re=B.current)==null?void 0:re.getModel())&&(f&&Mp.set(X,(R=B.current)==null?void 0:R.saveViewState()),(te=B.current)==null||te.setModel(q),f&&((ge=B.current)==null||ge.restoreViewState(Mp.get(o))))},[o],P),Lr(()=>{var q;(q=B.current)==null||q.updateOptions(c)},[c],P),Lr(()=>{!B.current||r===void 0||(B.current.getOption(F.current.editor.EditorOption.readOnly)?B.current.setValue(r):r!==B.current.getValue()&&(ne.current=!0,B.current.executeEdits("",[{range:B.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),B.current.pushUndoStop(),ne.current=!1))},[r],P),Lr(()=>{var re,R;let q=(re=B.current)==null?void 0:re.getModel();q&&i&&((R=F.current)==null||R.editor.setModelLanguage(q,i))},[i],P),Lr(()=>{var q;a!==void 0&&((q=B.current)==null||q.revealLine(a))},[a],P),Lr(()=>{var q;(q=F.current)==null||q.editor.setTheme(s)},[s],P);let se=m.useCallback(()=>{var q;if(!(!H.current||!F.current)&&!j.current){K.current(F.current);let re=o||n,R=Bl(F.current,r||e||"",t||i||"",re||"");B.current=(q=F.current)==null?void 0:q.editor.create(H.current,{model:R,automaticLayout:!0,...c},d),f&&B.current.restoreViewState(Mp.get(re)),F.current.editor.setTheme(s),a!==void 0&&B.current.revealLine(a),k(!0),j.current=!0}},[e,t,n,r,i,o,c,d,f,s,a]);m.useEffect(()=>{P&&V.current(B.current,F.current)},[P]),m.useEffect(()=>{!A&&!P&&se()},[A,P,se]),$.current=r,m.useEffect(()=>{var q,re;P&&C&&((q=Y.current)==null||q.dispose(),Y.current=(re=B.current)==null?void 0:re.onDidChangeModelContent(R=>{ne.current||C(B.current.getValue(),R)}))},[P,C]),m.useEffect(()=>{if(P){let q=F.current.editor.onDidChangeMarkers(re=>{var te;let R=(te=B.current.getModel())==null?void 0:te.uri;if(R&&re.find(ge=>ge.path===R.path)){let ge=F.current.editor.getModelMarkers({resource:R});O==null||O(ge)}});return()=>{q==null||q.dispose()}}return()=>{}},[P,O]);function D(){var q,re;(q=Y.current)==null||q.dispose(),g?f&&Mp.set(o,B.current.saveViewState()):(re=B.current.getModel())==null||re.dispose(),B.current.dispose()}return m.createElement(EM,{width:p,height:v,isEditorReady:P,loading:l,_ref:H,className:y,wrapperProps:x})}var tQ=eQ,kM=m.memo(tQ),my=kM;function nQ(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 vy;const MM="HoverCard",[DM,Dde]=Pn(MM,[Fi]),by=Fi(),[rQ,yy]=DM(MM),iQ=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:i,onOpenChange:o,openDelay:s=700,closeDelay:a=300}=e,l=by(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(rQ,{scope:t,open:p,onOpenChange:v,onOpen:y,onClose:x,onDismiss:w,hasSelectionRef:f,isPointerDownOnContentRef:g},m.createElement(_u,l,n))},oQ="HoverCardTrigger",sQ=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,i=yy(oQ,n),o=by(n);return m.createElement(Su,le({asChild:!0},o),m.createElement(Be.a,le({"data-state":i.open?"open":"closed"},r,{ref:t,onPointerEnter:Ce(e.onPointerEnter,Dp(i.onOpen)),onPointerLeave:Ce(e.onPointerLeave,Dp(i.onClose)),onFocus:Ce(e.onFocus,i.onOpen),onBlur:Ce(e.onBlur,i.onClose),onTouchStart:Ce(e.onTouchStart,s=>s.preventDefault())})))}),aQ="HoverCardPortal",[Tde,lQ]=DM(aQ,{forceMount:void 0}),xy="HoverCardContent",cQ=m.forwardRef((e,t)=>{const n=lQ(xy,e.__scopeHoverCard),{forceMount:r=n.forceMount,...i}=e,o=yy(xy,e.__scopeHoverCard);return m.createElement(vn,{present:r||o.open},m.createElement(uQ,le({"data-state":o.open?"open":"closed"},i,{onPointerEnter:Ce(e.onPointerEnter,Dp(o.onOpen)),onPointerLeave:Ce(e.onPointerLeave,Dp(o.onClose)),ref:t})))}),uQ=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:s,...a}=e,l=yy(xy,n),c=by(n),d=m.useRef(null),f=et(t,d),[g,p]=m.useState(!1);return m.useEffect(()=>{if(g){const v=document.body;return vy=v.style.userSelect||v.style.webkitUserSelect,v.style.userSelect="none",v.style.webkitUserSelect="none",()=>{v.style.userSelect=vy,v.style.webkitUserSelect=vy}}},[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&&dQ(d.current).forEach(y=>y.setAttribute("tabindex","-1"))}),m.createElement(vl,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:s,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:Ce(o,v=>{v.preventDefault()}),onDismiss:l.onDismiss},m.createElement(Cu,le({},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 Dp(e){return t=>t.pointerType==="touch"?void 0:e()}function dQ(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 fQ=iQ,hQ=sQ,TM=cQ,AM=fQ,IM=hQ,wy=ue.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},i)=>S.jsx(TM,{ref:i,align:t,sideOffset:n,className:Oe("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}));wy.displayName=TM.displayName;function pQ({error:e}){return S.jsxs(AM,{openDelay:0,children:[S.jsx(IM,{asChild:!0,children:S.jsx(dt,{variant:"link",className:" p-0 h-5",children:S.jsx(UB,{className:"h-4 w-4 text-red-500"})})}),S.jsx(wy,{align:"start",className:"w-[600px]",children:S.jsx("div",{className:"flex justify-between space-x-4",children:S.jsx("div",{className:"space-y-1",children:S.jsx("p",{className:"text-sm",children:e})})})})]})}const RM="Checkbox",[gQ,Ade]=Pn(RM),[mQ,vQ]=gQ(RM),bQ=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}),_=m.useRef(x);return m.useEffect(()=>{const C=f==null?void 0:f.form;if(C){const O=()=>w(_.current);return C.addEventListener("reset",O),()=>C.removeEventListener("reset",O)}},[f,w]),m.createElement(mQ,{scope:n,state:x,disabled:a},m.createElement(Be.button,le({type:"button",role:"checkbox","aria-checked":ya(x)?"mixed":x,"aria-required":s,"data-state":NM(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(O=>ya(O)?!0:!O),y&&(v.current=C.isPropagationStopped(),v.current||C.stopPropagation())})})),y&&m.createElement(wQ,{control:f,bubbles:!v.current,name:r,value:l,checked:x,required:s,disabled:a,style:{transform:"translateX(-100%)"}}))}),yQ="CheckboxIndicator",xQ=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...i}=e,o=vQ(yQ,n);return m.createElement(vn,{present:r||ya(o.state)||o.state===!0},m.createElement(Be.span,le({"data-state":NM(o.state),"data-disabled":o.disabled?"":void 0},i,{ref:t,style:{pointerEvents:"none",...e.style}})))}),wQ=e=>{const{control:t,checked:n,bubbles:r=!0,...i}=e,o=m.useRef(null),s=pp(n),a=Ch(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",le({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 NM(e){return ya(e)?"indeterminate":e?"checked":"unchecked"}const LM=bQ,_Q=xQ,_y=ue.forwardRef(({className:e,...t},n)=>S.jsx(LM,{ref:n,className:Oe("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:S.jsx(_Q,{className:Oe("flex items-center justify-center text-current"),children:S.jsx(Ib,{className:"h-4 w-4"})})}));_y.displayName=LM.displayName;function SQ({text:e,onCheckedChange:t,checked:n}){return S.jsxs("div",{className:"flex items-center space-x-1 xbg-red-100 ml-7",children:[S.jsx(_y,{checked:n,onCheckedChange:t}),S.jsx("label",{className:"text-xs leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:e})]})}function CQ(){const e=xe(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 S.jsxs(AM,{openDelay:0,onOpenChange:async a=>{if(!a)return;console.log("onOpenChange");const l=await Ds("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:[S.jsx(IM,{asChild:!0,children:n&&S.jsx("p",{className:" p-0 hover:cursor-pointer text-xs",children:"| Filter Query"})}),S.jsxs(wy,{align:"end",className:"w-[600px] ",children:[S.jsx("div",{className:" flex justify-between space-x-4",children:S.jsx("div",{className:"bg-muted p-2 rounded-sm",children:S.jsxs("code",{ref:t,className:"text-sm font-mono ",children:[r,S.jsx(BE,{onClick:()=>OR(t),className:" inline-block ml-3 h-4 w-4 opacity-70 hover:opacity-100 hover:cursor-pointer"})]})})}),S.jsxs("div",{className:"flex gap-2 items-center pt-2",children:[S.jsx(HE,{className:"h-4 w-4 opacity-70"}),S.jsx("span",{className:"text-xs text-muted-foreground",children:"A preview of the query with filters applied."})]})]})]})}const Tp=ue.forwardRef(({className:e,type:t,...n},r)=>S.jsx("input",{type:t,className:Oe("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}));Tp.displayName="Input";const $M="Dialog",[FM,Ide]=Pn($M),[EQ,_i]=FM($M),PQ=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(EQ,{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)},OQ="DialogTrigger",kQ=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=_i(OQ,n),o=et(t,i.triggerRef);return m.createElement(Be.button,le({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)}))}),jM="DialogPortal",[MQ,zM]=FM(jM,{forceMount:void 0}),DQ=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=_i(jM,t);return m.createElement(MQ,{scope:t,forceMount:n},m.Children.map(r,s=>m.createElement(vn,{present:n||o.open},m.createElement(Eh,{asChild:!0,container:i},s))))},Sy="DialogOverlay",TQ=m.forwardRef((e,t)=>{const n=zM(Sy,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=_i(Sy,e.__scopeDialog);return o.modal?m.createElement(vn,{present:r||o.open},m.createElement(AQ,le({},i,{ref:t}))):null}),AQ=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=_i(Sy,n);return m.createElement(ap,{as:no,allowPinchZoom:!0,shards:[i.contentRef]},m.createElement(Be.div,le({"data-state":Cy(i.open)},r,{ref:t,style:{pointerEvents:"auto",...r.style}})))}),td="DialogContent",IQ=m.forwardRef((e,t)=>{const n=zM(td,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=_i(td,e.__scopeDialog);return m.createElement(vn,{present:r||o.open},o.modal?m.createElement(RQ,le({},i,{ref:t})):m.createElement(NQ,le({},i,{ref:t})))}),RQ=m.forwardRef((e,t)=>{const n=_i(td,e.__scopeDialog),r=m.useRef(null),i=et(t,n.contentRef,r);return m.useEffect(()=>{const o=r.current;if(o)return tp(o)},[]),m.createElement(BM,le({},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())}))}),NQ=m.forwardRef((e,t)=>{const n=_i(td,e.__scopeDialog),r=m.useRef(!1),i=m.useRef(!1);return m.createElement(BM,le({},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()}}))}),BM=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...s}=e,a=_i(td,n),l=m.useRef(null),c=et(t,l);return Qh(),m.createElement(m.Fragment,null,m.createElement(Zh,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o},m.createElement(vl,le({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)}),LQ="DialogTitle",$Q=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=_i(LQ,n);return m.createElement(Be.h2,le({id:i.titleId},r,{ref:t}))}),FQ="DialogDescription",jQ=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=_i(FQ,n);return m.createElement(Be.p,le({id:i.descriptionId},r,{ref:t}))}),zQ="DialogClose",BQ=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=_i(zQ,n);return m.createElement(Be.button,le({type:"button"},r,{ref:t,onClick:Ce(e.onClick,()=>i.onOpenChange(!1))}))});function Cy(e){return e?"open":"closed"}const HQ=PQ,VQ=kQ,WQ=DQ,HM=TQ,VM=IQ,WM=$Q,qM=jQ,qQ=BQ,UM=HQ,GM=VQ,UQ=WQ,YM=ue.forwardRef(({className:e,...t},n)=>S.jsx(HM,{ref:n,className:Oe("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}));YM.displayName=HM.displayName;const Ey=ue.forwardRef(({className:e,children:t,...n},r)=>S.jsxs(UQ,{children:[S.jsx(YM,{}),S.jsxs(VM,{ref:r,className:Oe("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,S.jsxs(qQ,{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:[S.jsx(GB,{className:"h-4 w-4"}),S.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Ey.displayName=VM.displayName;const Py=({className:e,...t})=>S.jsx("div",{className:Oe("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Py.displayName="DialogHeader";const KM=({className:e,...t})=>S.jsx("div",{className:Oe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});KM.displayName="DialogFooter";const Oy=ue.forwardRef(({className:e,...t},n)=>S.jsx(WM,{ref:n,className:Oe("text-lg font-semibold leading-none tracking-tight",e),...t}));Oy.displayName=WM.displayName;const ky=ue.forwardRef(({className:e,...t},n)=>S.jsx(qM,{ref:n,className:Oe("text-sm text-muted-foreground",e),...t}));ky.displayName=qM.displayName;const My=ue.forwardRef(({className:e,...t},n)=>S.jsx("textarea",{className:Oe("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}));My.displayName="Textarea";function Rde(){}function Nde(){}function GQ(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const YQ=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,KQ=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,XQ={};function XM(e,t){return((t||XQ).jsx?KQ:YQ).test(e)}const QQ=/[ \t\n\f\r]/g;function ZQ(e){return typeof e=="object"?e.type==="text"?QM(e.value):!1:QM(e)}function QM(e){return e.replace(QQ,"")===""}class nd{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}nd.prototype.property={},nd.prototype.normal={},nd.prototype.space=null;function ZM(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 nd(n,r,t)}function Dy(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 JQ=0;const st=xa(),yn=xa(),JM=xa(),Ee=xa(),Vt=xa(),Hl=xa(),$r=xa();function xa(){return 2**++JQ}const Ty=Object.freeze(Object.defineProperty({__proto__:null,boolean:st,booleanish:yn,commaOrSpaceSeparated:$r,commaSeparated:Hl,number:Ee,overloadedBoolean:JM,spaceSeparated:Vt},Symbol.toStringTag,{value:"Module"})),Ay=Object.keys(Ty);class Iy extends ti{constructor(t,n,r,i){let o=-1;if(super(t,n),eD(this,"space",i),typeof r=="number")for(;++o<Ay.length;){const s=Ay[o];eD(this,Ay[o],(r&Ty[s])===Ty[s])}}}Iy.prototype.defined=!0;function eD(e,t,n){n&&(e[t]=n)}const eZ={}.hasOwnProperty;function Vl(e){const t={},n={};let r;for(r in e.properties)if(eZ.call(e.properties,r)){const i=e.properties[r],o=new Iy(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[Dy(r)]=r,n[Dy(o.attribute)]=r}return new nd(t,n,e.space)}const tD=Vl({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}}),nD=Vl({space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function rD(e,t){return t in e?e[t]:t}function iD(e,t){return rD(e,t.toLowerCase())}const oD=Vl({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:iD,properties:{xmlns:null,xmlnsXLink:null}}),sD=Vl({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:Vt,ariaCurrent:null,ariaDescribedBy:Vt,ariaDetails:null,ariaDisabled:yn,ariaDropEffect:Vt,ariaErrorMessage:null,ariaExpanded:yn,ariaFlowTo:Vt,ariaGrabbed:yn,ariaHasPopup:null,ariaHidden:yn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Vt,ariaLevel:Ee,ariaLive:null,ariaModal:yn,ariaMultiLine:yn,ariaMultiSelectable:yn,ariaOrientation:null,ariaOwns:Vt,ariaPlaceholder:null,ariaPosInSet:Ee,ariaPressed:yn,ariaReadOnly:yn,ariaRelevant:null,ariaRequired:yn,ariaRoleDescription:Vt,ariaRowCount:Ee,ariaRowIndex:Ee,ariaRowSpan:Ee,ariaSelected:yn,ariaSetSize:Ee,ariaSort:null,ariaValueMax:Ee,ariaValueMin:Ee,ariaValueNow:Ee,ariaValueText:null,role:null}}),tZ=Vl({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:iD,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Hl,acceptCharset:Vt,accessKey:Vt,action:null,allow:null,allowFullScreen:st,allowPaymentRequest:st,allowUserMedia:st,alt:null,as:null,async:st,autoCapitalize:null,autoComplete:Vt,autoFocus:st,autoPlay:st,blocking:Vt,capture:null,charSet:null,checked:st,cite:null,className:Vt,cols:Ee,colSpan:null,content:null,contentEditable:yn,controls:st,controlsList:Vt,coords:Ee|Hl,crossOrigin:null,data:null,dateTime:null,decoding:null,default:st,defer:st,dir:null,dirName:null,disabled:st,download:JM,draggable:yn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:st,formTarget:null,headers:Vt,height:Ee,hidden:st,high:Ee,href:null,hrefLang:null,htmlFor:Vt,httpEquiv:Vt,id:null,imageSizes:null,imageSrcSet:null,inert:st,inputMode:null,integrity:null,is:null,isMap:st,itemId:null,itemProp:Vt,itemRef:Vt,itemScope:st,itemType:Vt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:st,low:Ee,manifest:null,max:null,maxLength:Ee,media:null,method:null,min:null,minLength:Ee,multiple:st,muted:st,name:null,nonce:null,noModule:st,noValidate:st,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:st,optimum:Ee,pattern:null,ping:Vt,placeholder:null,playsInline:st,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:st,referrerPolicy:null,rel:Vt,required:st,reversed:st,rows:Ee,rowSpan:Ee,sandbox:Vt,scope:null,scoped:st,seamless:st,selected:st,shadowRootDelegatesFocus:st,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:st,useMap:null,value:yn,width:Ee,wrap:null,align:null,aLink:null,archive:Vt,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:st,declare:st,event:null,face:null,frame:null,frameBorder:null,hSpace:Ee,leftMargin:Ee,link:null,longDesc:null,lowSrc:null,marginHeight:Ee,marginWidth:Ee,noResize:st,noHref:st,noShade:st,noWrap:st,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:st,disableRemotePlayback:st,prefix:null,property:null,results:Ee,security:null,unselectable:null}}),nZ=Vl({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:rD,properties:{about:$r,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:Vt,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:st,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:Hl,g2:Hl,glyphName:Hl,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:$r,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:Vt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ee,pointsAtY:Ee,pointsAtZ:Ee,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:$r,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:$r,rev:$r,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:$r,requiredFeatures:$r,requiredFonts:$r,requiredFormats:$r,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:$r,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:$r,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:$r,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}}),rZ=/^data[-\w.:]+$/i,aD=/-[a-z]/g,iZ=/[A-Z]/g;function oZ(e,t){const n=Dy(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"&&rZ.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(aD,aZ);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!aD.test(o)){let s=o.replace(iZ,sZ);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=Iy}return new i(r,t)}function sZ(e){return"-"+e.toLowerCase()}function aZ(e){return e.charAt(1).toUpperCase()}const lZ={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"},cZ=ZM([nD,tD,oD,sD,tZ],"html"),Ry=ZM([nD,tD,oD,sD,nZ],"svg");function uZ(e){return e.join(" ").trim()}var lD={},cD=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,dZ=/\n/g,fZ=/^\s*/,hZ=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,pZ=/^:\s*/,gZ=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,mZ=/^[;\s]*/,vZ=/^\s+|\s+$/g,bZ=`
|
|
433
|
+
`,uD="/",dD="*",wa="",yZ="comment",xZ="declaration",wZ=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(dZ);y&&(n+=y.length);var x=v.lastIndexOf(bZ);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(fZ)}function d(v){var y;for(v=v||[];y=f();)y!==!1&&v.push(y);return v}function f(){var v=o();if(!(uD!=e.charAt(0)||dD!=e.charAt(1))){for(var y=2;wa!=e.charAt(y)&&(dD!=e.charAt(y)||uD!=e.charAt(y+1));)++y;if(y+=2,wa===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:yZ,comment:x})}}function g(){var v=o(),y=l(hZ);if(y){if(f(),!l(pZ))return a("property missing ':'");var x=l(gZ),w=v({type:xZ,property:fD(y[0].replace(cD,wa)),value:x?fD(x[0].replace(cD,wa)):wa});return l(mZ),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 fD(e){return e?e.replace(vZ,wa):wa}var _Z=No&&No.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(lD,"__esModule",{value:!0});var SZ=_Z(wZ);function CZ(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,SZ.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 hD=lD.default=CZ;const EZ=hD.default||hD,pD=gD("end"),Ny=gD("start");function gD(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 PZ(e){const t=Ny(e),n=pD(e);if(t&&n)return{start:t,end:n}}function rd(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?mD(e.position):"start"in e||"end"in e?mD(e):"line"in e||"column"in e?Ly(e):""}function Ly(e){return vD(e&&e.line)+":"+vD(e&&e.column)}function mD(e){return Ly(e&&e.start)+"-"+Ly(e&&e.end)}function vD(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=rd(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 $y={}.hasOwnProperty,OZ=new Map,kZ=/[A-Z]/g,MZ=/-([a-z])/g,DZ=new Set(["table","tbody","thead","tfoot","tr"]),TZ=new Set(["td","th"]),bD="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function AZ(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=zZ(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=jZ(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"?Ry:cZ,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=yD(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function yD(e,t,n){if(t.type==="element")return IZ(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return RZ(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return LZ(e,t,n);if(t.type==="mdxjsEsm")return NZ(e,t);if(t.type==="root")return $Z(e,t,n);if(t.type==="text")return FZ(e,t)}function IZ(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Ry,e.schema=i),e.ancestors.push(t);const o=wD(e,t.tagName,!1),s=BZ(e,t);let a=jy(e,t);return DZ.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!ZQ(l):!0})),xD(e,s,o,t),Fy(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function RZ(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)}id(e,t.position)}function NZ(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);id(e,t.position)}function LZ(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Ry,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:wD(e,t.name,!0),s=HZ(e,t),a=jy(e,t);return xD(e,s,o,t),Fy(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function $Z(e,t,n){const r={};return Fy(r,jy(e,t)),e.create(t,e.Fragment,r,n)}function FZ(e,t){return t.value}function xD(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Fy(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function jZ(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 zZ(e,t){return n;function n(r,i,o,s){const a=Array.isArray(o.children),l=Ny(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 BZ(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&$y.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"&&TZ.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 HZ(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 id(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 id(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function jy(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:OZ;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=yD(e,o,s);a!==void 0&&n.push(a)}return n}function VZ(e,t,n){const r=oZ(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?GQ(n):uZ(n)),r.property==="style"){let i=typeof n=="object"?n:WZ(e,String(n));return e.stylePropertyNameCase==="css"&&(i=qZ(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?lZ[r.property]||r.property:r.attribute,n]}}function WZ(e,t){const n={};try{EZ(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=bD+"#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(MZ,GZ)),n[s]=o}}function wD(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=XM(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=XM(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return $y.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);id(e)}function id(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=bD+"#cannot-handle-mdx-estrees-without-createevaluater",n}function qZ(e){const t={};let n;for(n in e)$y.call(e,n)&&(t[UZ(n)]=e[n]);return t}function UZ(e){let t=e.replace(kZ,YZ);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function GZ(e,t){return t.toUpperCase()}function YZ(e){return"-"+e.toLowerCase()}const zy={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"]},KZ={};function XZ(e,t){const n=t||KZ,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return _D(e,r,i)}function _D(e,t,n){if(QZ(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 SD(e.children,t,n)}return Array.isArray(e)?SD(e,t,n):""}function SD(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=_D(e[i],t,n);return r.join("")}function QZ(e){return!!(e&&typeof e=="object")}const CD=document.createElement("i");function By(e){const t="&"+e+";";CD.innerHTML=t;const n=CD.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 ED={}.hasOwnProperty;function ZZ(e){const t={};let n=-1;for(;++n<e.length;)JZ(t,e[n]);return t}function JZ(e,t){let n;for(n in t){const i=(ED.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let s;if(o)for(s in o){ED.call(i,s)||(i[s]=[]);const a=o[s];eJ(i[s],Array.isArray(a)?a:a?[a]:[])}}}function eJ(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 PD(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 Wl(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const tJ=os(new RegExp("\\p{P}","u")),Ui=os(/[A-Za-z]/),Fr=os(/[\dA-Za-z]/),nJ=os(/[#-'*+\--9=?A-Z^-~]/);function Hy(e){return e!==null&&(e<32||e===127)}const Vy=os(/\d/),rJ=os(/[\dA-Fa-f]/),OD=os(/[!-/:-@[-`{-~]/);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 iJ(e){return OD(e)||tJ(e)}const oJ=os(/\s/);function os(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function ql(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let s="";if(o===37&&Fr(e.charCodeAt(n+1))&&Fr(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 sJ={tokenize:aJ};function aJ(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 lJ={tokenize:cJ},kD={tokenize:uJ};function cJ(e){const t=this,n=[];let r=0,i,o,s;return a;function a(C){if(r<n.length){const O=n[r];return t.containerState=O[1],e.attempt(O[0].continuation,l,c)(C)}return c(C)}function l(C){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&_();const O=t.events.length;let P=O,k;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){k=t.events[P][1].end;break}w(r);let A=O;for(;A<t.events.length;)t.events[A][1].end=Object.assign({},k),A++;return qi(t.events,P+1,0,t.events.slice(O)),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(kD,d,f)(C)}function d(C){return i&&_(),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(kD,p,v)(C)}function p(C){return r++,n.push([t.currentConstruct,t.containerState]),g(C)}function v(C){if(C===null){i&&_(),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,O){const P=t.sliceStream(C);if(O&&P.push(null),C.previous=o,o&&(o.next=C),o=C,i.defineSkip(C.start),i.write(P),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,B;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){if(F){B=t.events[L][1].end;break}F=!0}for(w(r),k=A;k<t.events.length;)t.events[k][1].end=Object.assign({},B),k++;qi(t.events,L+1,0,t.events.slice(A)),t.events.length=k}}function w(C){let O=n.length;for(;O-- >C;){const P=n[O];t.containerState=P[1],P[0].exit.call(t,e)}n.length=C}function _(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function uJ(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 MD(e){if(e===null||hr(e)||oJ(e))return 1;if(iJ(e))return 2}function Wy(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 qy={name:"attention",tokenize:fJ,resolveAll:dJ};function dJ(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);DD(f,-l),DD(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,Wy(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 fJ(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=MD(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=MD(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 DD(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const hJ={name:"autolink",tokenize:pJ};function pJ(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||Fr(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||Fr(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||Hy(p)?n(p):(e.consume(p),l)}function c(p){return p===64?(e.consume(p),d):nJ(p)?(e.consume(p),c):n(p)}function d(p){return Fr(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||Fr(p))&&r++<63){const v=p===45?g:f;return e.consume(p),v}return n(p)}}const Ap={tokenize:gJ,partial:!0};function gJ(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 TD={name:"blockQuote",tokenize:mJ,continuation:{tokenize:vJ},exit:bJ};function mJ(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 vJ(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(TD,t,n)(s)}}function bJ(e){e.exit("blockQuote")}const AD={name:"characterEscape",tokenize:yJ};function yJ(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 OD(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const ID={name:"characterReference",tokenize:xJ};function xJ(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=Fr,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=rJ,d):(e.enter("characterReferenceValue"),o=7,s=Vy,d(f))}function d(f){if(f===59&&i){const g=e.exit("characterReferenceValue");return s===Fr&&!By(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 RD={tokenize:_J,partial:!0},ND={name:"codeFenced",tokenize:wJ,concrete:!0};function wJ(e,t,n){const r=this,i={tokenize:P,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(RD,y,O)(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,O,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,_,"linePrefix",o+1)(k):_(k)}function _(k){return k===null||Ge(k)?e.check(RD,y,O)(k):(e.enter("codeFlowValue"),C(k))}function C(k){return k===null||Ge(k)?(e.exit("codeFlowValue"),_(k)):(e.consume(k),C)}function O(k){return e.exit("codeFenced"),t(k)}function P(k,A,L){let F=0;return B;function B($){return k.enter("lineEnding"),k.consume($),k.exit("lineEnding"),H}function H($){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 _J(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 Uy={name:"codeIndented",tokenize:CJ},SJ={tokenize:EJ,partial:!0};function CJ(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(SJ,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 EJ(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 PJ={name:"codeText",tokenize:MJ,resolve:OJ,previous:kJ};function OJ(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 kJ(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function MJ(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 LD(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,DJ(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 DJ(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]),_=o.pop();l.unshift([_,_+w.length-1]),qi(e,_,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 TJ={tokenize:RJ,resolve:IJ},AJ={tokenize:NJ,partial:!0};function IJ(e){return LD(e),e}function RJ(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(AJ,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 NJ(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 $D(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||Hy(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||Hy(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 FD(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 jD(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 od(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 LJ={name:"definition",tokenize:FJ},$J={tokenize:jJ,partial:!0};function FJ(e,t,n){const r=this;let i;return o;function o(p){return e.enter("definition"),s(p)}function s(p){return FD.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return i=Wl(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)?od(e,c)(p):c(p)}function c(p){return $D(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return e.attempt($J,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 jJ(e,t,n){return r;function r(a){return hr(a)?od(e,i)(a):n(a)}function i(a){return jD(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 zJ={name:"hardBreakEscape",tokenize:BJ};function BJ(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 HJ={name:"headingAtx",tokenize:WJ,resolve:VJ};function VJ(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 WJ(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 qJ=["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"],zD=["pre","script","style","textarea"],UJ={name:"htmlFlow",tokenize:XJ,resolveTo:KJ,concrete:!0},GJ={tokenize:ZJ,partial:!0},YJ={tokenize:QJ,partial:!0};function KJ(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 XJ(e,t,n){const r=this;let i,o,s,a,l;return c;function c(R){return d(R)}function d(R){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(R),f}function f(R){return R===33?(e.consume(R),g):R===47?(e.consume(R),o=!0,y):R===63?(e.consume(R),i=3,r.interrupt?t:D):Ui(R)?(e.consume(R),s=String.fromCharCode(R),x):n(R)}function g(R){return R===45?(e.consume(R),i=2,p):R===91?(e.consume(R),i=5,a=0,v):Ui(R)?(e.consume(R),i=4,r.interrupt?t:D):n(R)}function p(R){return R===45?(e.consume(R),r.interrupt?t:D):n(R)}function v(R){const te="CDATA[";return R===te.charCodeAt(a++)?(e.consume(R),a===te.length?r.interrupt?t:V:v):n(R)}function y(R){return Ui(R)?(e.consume(R),s=String.fromCharCode(R),x):n(R)}function x(R){if(R===null||R===47||R===62||hr(R)){const te=R===47,ge=s.toLowerCase();return!te&&!o&&zD.includes(ge)?(i=1,r.interrupt?t(R):V(R)):qJ.includes(s.toLowerCase())?(i=6,te?(e.consume(R),w):r.interrupt?t(R):V(R)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(R):o?_(R):C(R))}return R===45||Fr(R)?(e.consume(R),s+=String.fromCharCode(R),x):n(R)}function w(R){return R===62?(e.consume(R),r.interrupt?t:V):n(R)}function _(R){return Dt(R)?(e.consume(R),_):B(R)}function C(R){return R===47?(e.consume(R),B):R===58||R===95||Ui(R)?(e.consume(R),O):Dt(R)?(e.consume(R),C):B(R)}function O(R){return R===45||R===46||R===58||R===95||Fr(R)?(e.consume(R),O):P(R)}function P(R){return R===61?(e.consume(R),k):Dt(R)?(e.consume(R),P):C(R)}function k(R){return R===null||R===60||R===61||R===62||R===96?n(R):R===34||R===39?(e.consume(R),l=R,A):Dt(R)?(e.consume(R),k):L(R)}function A(R){return R===l?(e.consume(R),l=null,F):R===null||Ge(R)?n(R):(e.consume(R),A)}function L(R){return R===null||R===34||R===39||R===47||R===60||R===61||R===62||R===96||hr(R)?P(R):(e.consume(R),L)}function F(R){return R===47||R===62||Dt(R)?C(R):n(R)}function B(R){return R===62?(e.consume(R),H):n(R)}function H(R){return R===null||Ge(R)?V(R):Dt(R)?(e.consume(R),H):n(R)}function V(R){return R===45&&i===2?(e.consume(R),X):R===60&&i===1?(e.consume(R),j):R===62&&i===4?(e.consume(R),q):R===63&&i===3?(e.consume(R),D):R===93&&i===5?(e.consume(R),se):Ge(R)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(GJ,re,K)(R)):R===null||Ge(R)?(e.exit("htmlFlowData"),K(R)):(e.consume(R),V)}function K(R){return e.check(YJ,Y,re)(R)}function Y(R){return e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),$}function $(R){return R===null||Ge(R)?K(R):(e.enter("htmlFlowData"),V(R))}function X(R){return R===45?(e.consume(R),D):V(R)}function j(R){return R===47?(e.consume(R),s="",ne):V(R)}function ne(R){if(R===62){const te=s.toLowerCase();return zD.includes(te)?(e.consume(R),q):V(R)}return Ui(R)&&s.length<8?(e.consume(R),s+=String.fromCharCode(R),ne):V(R)}function se(R){return R===93?(e.consume(R),D):V(R)}function D(R){return R===62?(e.consume(R),q):R===45&&i===2?(e.consume(R),D):V(R)}function q(R){return R===null||Ge(R)?(e.exit("htmlFlowData"),re(R)):(e.consume(R),q)}function re(R){return e.exit("htmlFlow"),t(R)}}function QJ(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 ZJ(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Ap,t,n)}}const JJ={name:"htmlText",tokenize:eee};function eee(e,t,n){const r=this;let i,o,s;return a;function a(D){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(D),l}function l(D){return D===33?(e.consume(D),c):D===47?(e.consume(D),P):D===63?(e.consume(D),C):Ui(D)?(e.consume(D),L):n(D)}function c(D){return D===45?(e.consume(D),d):D===91?(e.consume(D),o=0,v):Ui(D)?(e.consume(D),_):n(D)}function d(D){return D===45?(e.consume(D),p):n(D)}function f(D){return D===null?n(D):D===45?(e.consume(D),g):Ge(D)?(s=f,j(D)):(e.consume(D),f)}function g(D){return D===45?(e.consume(D),p):f(D)}function p(D){return D===62?X(D):D===45?g(D):f(D)}function v(D){const q="CDATA[";return D===q.charCodeAt(o++)?(e.consume(D),o===q.length?y:v):n(D)}function y(D){return D===null?n(D):D===93?(e.consume(D),x):Ge(D)?(s=y,j(D)):(e.consume(D),y)}function x(D){return D===93?(e.consume(D),w):y(D)}function w(D){return D===62?X(D):D===93?(e.consume(D),w):y(D)}function _(D){return D===null||D===62?X(D):Ge(D)?(s=_,j(D)):(e.consume(D),_)}function C(D){return D===null?n(D):D===63?(e.consume(D),O):Ge(D)?(s=C,j(D)):(e.consume(D),C)}function O(D){return D===62?X(D):C(D)}function P(D){return Ui(D)?(e.consume(D),k):n(D)}function k(D){return D===45||Fr(D)?(e.consume(D),k):A(D)}function A(D){return Ge(D)?(s=A,j(D)):Dt(D)?(e.consume(D),A):X(D)}function L(D){return D===45||Fr(D)?(e.consume(D),L):D===47||D===62||hr(D)?F(D):n(D)}function F(D){return D===47?(e.consume(D),X):D===58||D===95||Ui(D)?(e.consume(D),B):Ge(D)?(s=F,j(D)):Dt(D)?(e.consume(D),F):X(D)}function B(D){return D===45||D===46||D===58||D===95||Fr(D)?(e.consume(D),B):H(D)}function H(D){return D===61?(e.consume(D),V):Ge(D)?(s=H,j(D)):Dt(D)?(e.consume(D),H):F(D)}function V(D){return D===null||D===60||D===61||D===62||D===96?n(D):D===34||D===39?(e.consume(D),i=D,K):Ge(D)?(s=V,j(D)):Dt(D)?(e.consume(D),V):(e.consume(D),Y)}function K(D){return D===i?(e.consume(D),i=void 0,$):D===null?n(D):Ge(D)?(s=K,j(D)):(e.consume(D),K)}function Y(D){return D===null||D===34||D===39||D===60||D===61||D===96?n(D):D===47||D===62||hr(D)?F(D):(e.consume(D),Y)}function $(D){return D===47||D===62||hr(D)?F(D):n(D)}function X(D){return D===62?(e.consume(D),e.exit("htmlTextData"),e.exit("htmlText"),t):n(D)}function j(D){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),ne}function ne(D){return Dt(D)?Wt(e,se,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):se(D)}function se(D){return e.enter("htmlTextData"),s(D)}}const Gy={name:"labelEnd",tokenize:see,resolveTo:oee,resolveAll:iee},tee={tokenize:aee},nee={tokenize:lee},ree={tokenize:cee};function iee(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 oee(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,Wy(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 see(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(Wl(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(tee,d,s?d:f)(g):g===91?e.attempt(nee,d,s?c:f)(g):s?d(g):f(g)}function c(g){return e.attempt(ree,d,f)(g)}function d(g){return t(g)}function f(g){return o._balanced=!0,n(g)}}function aee(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)?od(e,o)(f):o(f)}function o(f){return f===41?d(f):$D(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function s(f){return hr(f)?od(e,l)(f):d(f)}function a(f){return n(f)}function l(f){return f===34||f===39||f===40?jD(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):d(f)}function c(f){return hr(f)?od(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 FD.call(r,e,o,s,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(Wl(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function cee(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 uee={name:"labelStartImage",tokenize:dee,resolveAll:Gy.resolveAll};function dee(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 fee={name:"labelStartLink",tokenize:hee,resolveAll:Gy.resolveAll};function hee(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 Yy={name:"lineEnding",tokenize:pee};function pee(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Wt(e,t,"linePrefix")}}const Ip={name:"thematicBreak",tokenize:gee};function gee(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:bee,continuation:{tokenize:yee},exit:wee},mee={tokenize:_ee,partial:!0},vee={tokenize:xee,partial:!0};function bee(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:Vy(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(Ip,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 Vy(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(Ap,r.interrupt?n:d,e.attempt(mee,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 yee(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Ap,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(vee,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 xee(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 wee(e){e.exit(this.containerState.type)}function _ee(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 BD={name:"setextUnderline",tokenize:Cee,resolveTo:See};function See(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 Cee(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 Eee={tokenize:Pee};function Pee(e){const t=this,n=e.attempt(Ap,r,e.attempt(this.parser.constructs.flowInitial,i,Wt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(TJ,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 Oee={resolveAll:VD()},kee=HD("string"),Mee=HD("text");function HD(e){return{tokenize:t,resolveAll:VD(e==="text"?Dee: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 VD(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 Dee(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 Tee(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:_,enter:C,exit:O,attempt:A(P),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(H){return s=ni(s,H),x(),s[s.length-1]!==null?[]:(L(t,0),c.events=Wy(o,c.events,c),c.events)}function g(H,V){return Iee(p(H),V)}function p(H){return Aee(s,H)}function v(){const{line:H,column:V,offset:K,_index:Y,_bufferIndex:$}=r;return{line:H,column:V,offset:K,_index:Y,_bufferIndex:$}}function y(H){i[H.line]=H.column,B()}function x(){let H;for(;r._index<s.length;){const V=s[r._index];if(typeof V=="string")for(H=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===H&&r._bufferIndex<V.length;)w(V.charCodeAt(r._bufferIndex));else w(V)}}function w(H){d=d(H)}function _(H){Ge(H)?(r.line++,r.column=1,r.offset+=H===-3?2:1,B()):H!==-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=H}function C(H,V){const K=V||{};return K.type=H,K.start=v(),c.events.push(["enter",K,c]),a.push(K),K}function O(H){const V=a.pop();return V.end=v(),c.events.push(["exit",V,c]),V}function P(H,V){L(H,V.from)}function k(H,V){V.restore()}function A(H,V){return K;function K(Y,$,X){let j,ne,se,D;return Array.isArray(Y)?re(Y):"tokenize"in Y?re([Y]):q(Y);function q(pe){return de;function de(ie){const J=ie!==null&&pe[ie],W=ie!==null&&pe.null,be=[...Array.isArray(J)?J:J?[J]:[],...Array.isArray(W)?W:W?[W]:[]];return re(be)(ie)}}function re(pe){return j=pe,ne=0,pe.length===0?X:R(pe[ne])}function R(pe){return de;function de(ie){return D=F(),se=pe,pe.partial||(c.currentConstruct=pe),pe.name&&c.parser.constructs.disable.null.includes(pe.name)?ge():pe.tokenize.call(V?Object.assign(Object.create(c),V):c,l,te,ge)(ie)}}function te(pe){return H(se,D),$}function ge(pe){return D.restore(),++ne<j.length?R(j[ne]):X}}}function L(H,V){H.resolveAll&&!o.includes(H)&&o.push(H),H.resolve&&qi(c.events,V,c.events.length-V,H.resolve(c.events.slice(V),c)),H.resolveTo&&(c.events=H.resolveTo(c.events,c))}function F(){const H=v(),V=c.previous,K=c.currentConstruct,Y=c.events.length,$=Array.from(a);return{restore:X,from:Y};function X(){r=H,c.previous=V,c.currentConstruct=K,c.events.length=Y,a=$,B()}}function B(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Aee(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 Iee(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=`
|
|
434
|
+
`;break}case-3:{s=`\r
|
|
435
|
+
`;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 Ree=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:{91:LJ},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:TD},flow:{35:HJ,42:Ip,45:[BD,Ip],60:UJ,61:BD,95:Ip,96:ND,126:ND},flowInitial:{[-2]:Uy,[-1]:Uy,32:Uy},insideSpan:{null:[qy,Oee]},string:{38:ID,92:AD},text:{[-5]:Yy,[-4]:Yy,[-3]:Yy,33:uee,38:ID,42:qy,60:[hJ,JJ],91:fee,92:[zJ,AD],93:Gy,95:qy,96:PJ}},Symbol.toStringTag,{value:"Module"}));function Nee(e){const n=ZZ([Ree,...(e||{}).extensions||[]]),r={defined:[],lazy:{},constructs:n,content:i(sJ),document:i(lJ),flow:i(Eee),string:i(kee),text:i(Mee)};return r;function i(o){return s;function s(a){return Tee(r,o,a)}}}function Lee(e){for(;!LD(e););return e}const WD=/[\0\t\n\r]/g;function $ee(){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(WD.lastIndex=f,c=WD.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 Fee=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function jee(e){return e.replace(Fee,zee)}function zee(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return PD(n.slice(o?2:1),o?16:10)}return By(n)||e}const qD={}.hasOwnProperty;function Bee(e,t,n){return typeof t!="string"&&(n=t,t=void 0),Hee(n)(Lee(Nee(n).document().write($ee()(e,t,!0))))}function Hee(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(vt),autolinkProtocol:F,autolinkEmail:F,atxHeading:o(Fe),blockQuote:o(J),characterEscape:F,characterReference:F,codeFenced:o(W),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(W,s),codeText:o(be,s),codeTextData:F,data:F,codeFlowValue:F,definition:o(oe),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(Te),hardBreakEscape:o(Ve),hardBreakTrailing:o(Ve),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(Jt),reference:R,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(Fe),strong:o(Dn),thematicBreak:o(Da)},exit:{atxHeading:l(),atxHeadingSequence:P,autolink:l(),autolinkEmail:ie,autolinkProtocol:de,blockQuote:l(),characterEscapeValue:B,characterReferenceMarkerHexadecimal:ge,characterReferenceMarkerNumeric:ge,characterReferenceValue:pe,codeFenced:l(x),codeFencedFence:y,codeFencedFenceInfo:p,codeFencedFenceMeta:v,codeFlowValue:B,codeIndented:l(w),codeText:l($),codeTextData:B,data:B,definition:l(),definitionDestinationString:O,definitionLabelString:_,definitionTitleString:C,emphasis:l(),hardBreakEscape:l(V),hardBreakTrailing:l(V),htmlFlow:l(K),htmlFlowData:B,htmlText:l(Y),htmlTextData:B,image:l(j),label:se,labelText:ne,lineEnding:H,link:l(X),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:te,resourceDestinationString:D,resourceTitleString:q,resource:re,setextHeading:l(L),setextHeadingLineSequence:A,setextHeadingText:k,strong:l(),thematicBreak:l()}};UD(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(fe){let Pe={type:"root",children:[]};const Le={stack:[Pe],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]];qD.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]||GD).call(Le,void 0,hn[0])}for(Pe.position={start:ss(fe.length>0?fe[0][1].start:{line:1,column:1,offset:0}),end:ss(fe.length>0?fe[fe.length-2][1].end:{line:1,column:1,offset:0})},yt=-1;++yt<t.transforms.length;)Pe=t.transforms[yt](Pe)||Pe;return Pe}function i(fe,Pe,Le){let Xe=Pe-1,yt=-1,hn=!1,Sn,Fn,zr,Br;for(;++Xe<=Le;){const pn=fe[Xe];switch(pn[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{pn[0]==="enter"?yt++:yt--,Br=void 0;break}case"lineEndingBlank":{pn[0]==="enter"&&(Sn&&!Br&&!yt&&!zr&&(zr=Xe),Br=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Br=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(Sn){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}zr&&(!Fn||zr<Fn)&&(Sn._spread=!0),Sn.end=Object.assign({},Fn?fe[Fn][1].start:pn[1].end),fe.splice(Fn||Xe,0,["exit",Sn,pn[2]]),Xe++,Le++}if(pn[1].type==="listItemPrefix"){const mr={type:"listItem",_spread:!1,start:Object.assign({},pn[1].start),end:void 0};Sn=mr,fe.splice(Xe,0,["enter",mr,pn[2]]),Xe++,Le++,zr=void 0,Br=!0}}}return fe[Pe][1]._spread=hn,Le}function o(fe,Pe){return Le;function Le(Xe){a.call(this,fe(Xe),Xe),Pe&&Pe.call(this,Xe)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(fe,Pe,Le){this.stack[this.stack.length-1].children.push(fe),this.stack.push(fe),this.tokenStack.push([Pe,Le]),fe.position={start:ss(Pe.start),end:void 0}}function l(fe){return Pe;function Pe(Le){fe&&fe.call(this,Le),c.call(this,Le)}}function c(fe,Pe){const Le=this.stack.pop(),Xe=this.tokenStack.pop();if(Xe)Xe[0].type!==fe.type&&(Pe?Pe.call(this,fe,Xe[0]):(Xe[1]||GD).call(this,fe,Xe[0]));else throw new Error("Cannot close `"+fe.type+"` ("+rd({start:fe.start,end:fe.end})+"): it’s not open");Le.position.end=ss(fe.end)}function d(){return XZ(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function g(fe){if(this.data.expectingFirstListItemValue){const Pe=this.stack[this.stack.length-2];Pe.start=Number.parseInt(this.sliceSerialize(fe),10),this.data.expectingFirstListItemValue=void 0}}function p(){const fe=this.resume(),Pe=this.stack[this.stack.length-1];Pe.lang=fe}function v(){const fe=this.resume(),Pe=this.stack[this.stack.length-1];Pe.meta=fe}function y(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function x(){const fe=this.resume(),Pe=this.stack[this.stack.length-1];Pe.value=fe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function w(){const fe=this.resume(),Pe=this.stack[this.stack.length-1];Pe.value=fe.replace(/(\r?\n|\r)$/g,"")}function _(fe){const Pe=this.resume(),Le=this.stack[this.stack.length-1];Le.label=Pe,Le.identifier=Wl(this.sliceSerialize(fe)).toLowerCase()}function C(){const fe=this.resume(),Pe=this.stack[this.stack.length-1];Pe.title=fe}function O(){const fe=this.resume(),Pe=this.stack[this.stack.length-1];Pe.url=fe}function P(fe){const Pe=this.stack[this.stack.length-1];if(!Pe.depth){const Le=this.sliceSerialize(fe).length;Pe.depth=Le}}function k(){this.data.setextHeadingSlurpLineEnding=!0}function A(fe){const Pe=this.stack[this.stack.length-1];Pe.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:ss(fe.start),end:void 0},Le.push(Xe)),this.stack.push(Xe)}function B(fe){const Pe=this.stack.pop();Pe.value+=this.sliceSerialize(fe),Pe.position.end=ss(fe.end)}function H(fe){const Pe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Le=Pe.children[Pe.children.length-1];Le.position.end=ss(fe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Pe.type)&&(F.call(this,fe),B.call(this,fe))}function V(){this.data.atHardBreak=!0}function K(){const fe=this.resume(),Pe=this.stack[this.stack.length-1];Pe.value=fe}function Y(){const fe=this.resume(),Pe=this.stack[this.stack.length-1];Pe.value=fe}function $(){const fe=this.resume(),Pe=this.stack[this.stack.length-1];Pe.value=fe}function X(){const fe=this.stack[this.stack.length-1];if(this.data.inReference){const Pe=this.data.referenceType||"shortcut";fe.type+="Reference",fe.referenceType=Pe,delete fe.url,delete fe.title}else delete fe.identifier,delete fe.label;this.data.referenceType=void 0}function j(){const fe=this.stack[this.stack.length-1];if(this.data.inReference){const Pe=this.data.referenceType||"shortcut";fe.type+="Reference",fe.referenceType=Pe,delete fe.url,delete fe.title}else delete fe.identifier,delete fe.label;this.data.referenceType=void 0}function ne(fe){const Pe=this.sliceSerialize(fe),Le=this.stack[this.stack.length-2];Le.label=jee(Pe),Le.identifier=Wl(Pe).toLowerCase()}function se(){const fe=this.stack[this.stack.length-1],Pe=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=Pe}function D(){const fe=this.resume(),Pe=this.stack[this.stack.length-1];Pe.url=fe}function q(){const fe=this.resume(),Pe=this.stack[this.stack.length-1];Pe.title=fe}function re(){this.data.inReference=void 0}function R(){this.data.referenceType="collapsed"}function te(fe){const Pe=this.resume(),Le=this.stack[this.stack.length-1];Le.label=Pe,Le.identifier=Wl(this.sliceSerialize(fe)).toLowerCase(),this.data.referenceType="full"}function ge(fe){this.data.characterReferenceType=fe.type}function pe(fe){const Pe=this.sliceSerialize(fe),Le=this.data.characterReferenceType;let Xe;Le?(Xe=PD(Pe,Le==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Xe=By(Pe);const yt=this.stack.pop();yt.value+=Xe,yt.position.end=ss(fe.end)}function de(fe){B.call(this,fe);const Pe=this.stack[this.stack.length-1];Pe.url=this.sliceSerialize(fe)}function ie(fe){B.call(this,fe);const Pe=this.stack[this.stack.length-1];Pe.url="mailto:"+this.sliceSerialize(fe)}function J(){return{type:"blockquote",children:[]}}function W(){return{type:"code",lang:null,meta:null,value:""}}function be(){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 Ve(){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 Jt(){return{type:"paragraph",children:[]}}function Dn(){return{type:"strong",children:[]}}function fn(){return{type:"text",value:""}}function Da(){return{type:"thematicBreak"}}}function ss(e){return{line:e.line,column:e.column,offset:e.offset}}function UD(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?UD(e,r):Vee(e,r)}}function Vee(e,t){let n;for(n in t)if(qD.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 GD(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+rd({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+rd({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+rd({start:t.start,end:t.end})+") is still open")}function Wee(e){const t=this;t.parser=n;function n(r){return Bee(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function qee(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 Uee(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
436
|
+
`}]}function Gee(e,t){const n=t.value?t.value+`
|
|
437
|
+
`:"",r={};t.lang&&(r.className=["language-"+t.lang]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function Yee(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Kee(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Xee(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=ql(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let s,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=o+1,a+=1,e.footnoteCounts.set(r,a);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)}function Qee(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Zee(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function YD(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function Jee(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return YD(e,t);const i={src:ql(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function ete(e,t){const n={src:ql(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function tte(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function nte(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return YD(e,t);const i={href:ql(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function rte(e,t){const n={href:ql(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function ite(e,t,n){const r=e.all(t),i=n?ote(n):KD(t),o={},s=[];if(typeof t.checked=="boolean"){const d=r[0];let f;d&&d.type==="element"&&d.tagName==="p"?f=d:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const d=r[a];(i||a!==0||d.type!=="element"||d.tagName!=="p")&&s.push({type:"text",value:`
|
|
438
|
+
`}),d.type==="element"&&d.tagName==="p"&&!i?s.push(...d.children):s.push(d)}const l=r[r.length-1];l&&(i||l.type!=="element"||l.tagName!=="p")&&s.push({type:"text",value:`
|
|
439
|
+
`});const c={type:"element",tagName:"li",properties:o,children:s};return e.patch(t,c),e.applyData(t,c)}function ote(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=KD(n[r])}return t}function KD(e){const t=e.spread;return t??e.children.length>1}function ste(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const s=r[i];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function ate(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function lte(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function cte(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ute(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),i.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=Ny(t.children[1]),l=pD(t.children[t.children.length-1]);a&&l&&(s.position={start:a,end:l}),i.push(s)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function dte(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,a=s?s.length:t.children.length;let l=-1;const c=[];for(;++l<a;){const f=t.children[l],g={},p=s?s[l]:void 0;p&&(g.align=p);let v={type:"element",tagName:o,properties:g,children:[]};f&&(v.children=e.all(f),e.patch(f,v),v=e.applyData(f,v)),c.push(v)}const d={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,d),e.applyData(t,d)}function fte(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const XD=9,QD=32;function hte(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(ZD(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(ZD(t.slice(i),i>0,!1)),o.join("")}function ZD(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===XD||o===QD;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===XD||o===QD;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function pte(e,t){const n={type:"text",value:hte(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function gte(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const mte={blockquote:qee,break:Uee,code:Gee,delete:Yee,emphasis:Kee,footnoteReference:Xee,heading:Qee,html:Zee,imageReference:Jee,image:ete,inlineCode:tte,linkReference:nte,link:rte,listItem:ite,list:ste,paragraph:ate,root:lte,strong:cte,table:ute,tableCell:fte,tableRow:dte,text:pte,thematicBreak:gte,toml:Rp,yaml:Rp,definition:Rp,footnoteDefinition:Rp};function Rp(){}const JD=-1,Np=0,Lp=1,$p=2,Ky=3,Xy=4,Qy=5,Zy=6,eT=7,tT=8,nT=typeof self=="object"?self:globalThis,vte=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,s]=t[i];switch(o){case Np:case JD:return n(s,i);case Lp:{const a=n([],i);for(const l of s)a.push(r(l));return a}case $p:{const a=n({},i);for(const[l,c]of s)a[r(l)]=r(c);return a}case Ky:return n(new Date(s),i);case Xy:{const{source:a,flags:l}=s;return n(new RegExp(a,l),i)}case Qy:{const a=n(new Map,i);for(const[l,c]of s)a.set(r(l),r(c));return a}case Zy:{const a=n(new Set,i);for(const l of s)a.add(r(l));return a}case eT:{const{name:a,message:l}=s;return n(new nT[a](l),i)}case tT:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i)}return n(new nT[o](s),i)};return r},rT=e=>vte(new Map,e)(0),Ul="",{toString:bte}={},{keys:yte}=Object,sd=e=>{const t=typeof e;if(t!=="object"||!e)return[Np,t];const n=bte.call(e).slice(8,-1);switch(n){case"Array":return[Lp,Ul];case"Object":return[$p,Ul];case"Date":return[Ky,Ul];case"RegExp":return[Xy,Ul];case"Map":return[Qy,Ul];case"Set":return[Zy,Ul]}return n.includes("Array")?[Lp,n]:n.includes("Error")?[eT,n]:[$p,n]},Fp=([e,t])=>e===Np&&(t==="function"||t==="symbol"),xte=(e,t,n,r)=>{const i=(s,a)=>{const l=r.push(s)-1;return n.set(a,l),l},o=s=>{if(n.has(s))return n.get(s);let[a,l]=sd(s);switch(a){case Np:{let d=s;switch(l){case"bigint":a=tT,d=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);d=null;break;case"undefined":return i([JD],s)}return i([a,d],s)}case Lp:{if(l)return i([l,[...s]],s);const d=[],f=i([a,d],s);for(const g of s)d.push(o(g));return f}case $p:{if(l)switch(l){case"BigInt":return i([l,s.toString()],s);case"Boolean":case"Number":case"String":return i([l,s.valueOf()],s)}if(t&&"toJSON"in s)return o(s.toJSON());const d=[],f=i([a,d],s);for(const g of yte(s))(e||!Fp(sd(s[g])))&&d.push([o(g),o(s[g])]);return f}case Ky:return i([a,s.toISOString()],s);case Xy:{const{source:d,flags:f}=s;return i([a,{source:d,flags:f}],s)}case Qy:{const d=[],f=i([a,d],s);for(const[g,p]of s)(e||!(Fp(sd(g))||Fp(sd(p))))&&d.push([o(g),o(p)]);return f}case Zy:{const d=[],f=i([a,d],s);for(const g of s)(e||!Fp(sd(g)))&&d.push(o(g));return f}}const{message:c}=s;return i([a,{name:l,message:c}],s)};return o},iT=(e,{json:t,lossy:n}={})=>{const r=[];return xte(!(t||n),!!t,new Map,r)(e),r},jp=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?rT(iT(e,t)):structuredClone(e):(e,t)=>rT(iT(e,t));function wte(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function _te(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Ste(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||wte,r=e.options.footnoteBackLabel||_te,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[l]);if(!c)continue;const d=e.all(c),f=String(c.identifier).toUpperCase(),g=ql(f.toLowerCase());let p=0;const v=[],y=e.footnoteCounts.get(f);for(;y!==void 0&&++p<=y;){v.length>0&&v.push({type:"text",value:" "});let _=typeof n=="string"?n:n(l,p);typeof _=="string"&&(_={type:"text",value:_}),v.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+g+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,p),className:["data-footnote-backref"]},children:Array.isArray(_)?_:[_]})}const x=d[d.length-1];if(x&&x.type==="element"&&x.tagName==="p"){const _=x.children[x.children.length-1];_&&_.type==="text"?_.value+=" ":x.children.push({type:"text",value:" "}),x.children.push(...v)}else d.push(...v);const w={type:"element",tagName:"li",properties:{id:t+"fn-"+g},children:e.wrap(d,!0)};e.patch(c,w),a.push(w)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...jp(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
440
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
|
|
441
|
+
`}]}}const oT=function(e){if(e==null)return Ote;if(typeof e=="function")return zp(e);if(typeof e=="object")return Array.isArray(e)?Cte(e):Ete(e);if(typeof e=="string")return Pte(e);throw new Error("Expected function, string, or object as test")};function Cte(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=oT(e[n]);return zp(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function Ete(e){const t=e;return zp(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function Pte(e){return zp(t);function t(n){return n&&n.type===e}}function zp(e){return t;function t(n,r,i){return!!(kte(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function Ote(){return!0}function kte(e){return e!==null&&typeof e=="object"&&"type"in e}function qde(e){return e}const sT=[],Mte=!0,aT=!1,Dte="skip";function Tte(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=oT(i),s=r?-1:1;a(e,void 0,[])();function a(l,c,d){const f=l&&typeof l=="object"?l:{};if(typeof f.type=="string"){const p=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(g,"name",{value:"node ("+(l.type+(p?"<"+p+">":""))+")"})}return g;function g(){let p=sT,v,y,x;if((!t||o(l,c,d[d.length-1]||void 0))&&(p=Ate(n(l,d)),p[0]===aT))return p;if("children"in l&&l.children){const w=l;if(w.children&&p[0]!==Dte)for(y=(r?w.children.length:-1)+s,x=d.concat(w);y>-1&&y<w.children.length;){const _=w.children[y];if(v=a(_,y,x)(),v[0]===aT)return v;y=typeof v[1]=="number"?v[1]:y+s}}return p}}}function Ate(e){return Array.isArray(e)?e:typeof e=="number"?[Mte,e]:e==null?sT:[e]}function lT(e,t,n,r){let i,o,s;typeof t=="function"&&typeof n!="function"?(o=void 0,s=t,i=n):(o=t,s=n,i=r),Tte(e,o,a,i);function a(l,c){const d=c[c.length-1],f=d?d.children.indexOf(l):void 0;return s(l,f,d)}}const Jy={}.hasOwnProperty,Ite={};function Rte(e,t){const n=t||Ite,r=new Map,i=new Map,o=new Map,s={...mte,...n.handlers},a={all:c,applyData:Lte,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:s,one:l,options:n,patch:Nte,wrap:Fte};return lT(e,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const f=d.type==="definition"?r:i,g=String(d.identifier).toUpperCase();f.has(g)||f.set(g,d)}}),a;function l(d,f){const g=d.type,p=a.handlers[g];if(Jy.call(a.handlers,g)&&p)return p(a,d,f);if(a.options.passThrough&&a.options.passThrough.includes(g)){if("children"in d){const{children:y,...x}=d,w=jp(x);return w.children=a.all(d),w}return jp(d)}return(a.options.unknownHandler||$te)(a,d,f)}function c(d){const f=[];if("children"in d){const g=d.children;let p=-1;for(;++p<g.length;){const v=a.one(g[p],d);if(v){if(p&&g[p-1].type==="break"&&(!Array.isArray(v)&&v.type==="text"&&(v.value=cT(v.value)),!Array.isArray(v)&&v.type==="element")){const y=v.children[0];y&&y.type==="text"&&(y.value=cT(y.value))}Array.isArray(v)?f.push(...v):f.push(v)}}}return f}}function Nte(e,t){e.position&&(t.position=PZ(e))}function Lte(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const s="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:s}}n.type==="element"&&o&&Object.assign(n.properties,jp(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function $te(e,t){const n=t.data||{},r="value"in t&&!(Jy.call(n,"hProperties")||Jy.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Fte(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
442
|
+
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
443
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
444
|
+
`}),n}function cT(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function uT(e,t){const n=Rte(e,t),r=n.one(e,void 0),i=Ste(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
|
|
445
|
+
`},i),o}function jte(e,t){return e&&"run"in e?async function(n,r){const i=uT(n,{file:r,...t});await e.run(i,r)}:function(n,r){return uT(n,{file:r,...t||e})}}function dT(e){if(e)throw e}var Bp=Object.prototype.hasOwnProperty,fT=Object.prototype.toString,hT=Object.defineProperty,pT=Object.getOwnPropertyDescriptor,gT=function(t){return typeof Array.isArray=="function"?Array.isArray(t):fT.call(t)==="[object Array]"},mT=function(t){if(!t||fT.call(t)!=="[object Object]")return!1;var n=Bp.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Bp.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Bp.call(t,i)},vT=function(t,n){hT&&n.name==="__proto__"?hT(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},bT=function(t,n){if(n==="__proto__")if(Bp.call(t,n)){if(pT)return pT(t,n).value}else return;return t[n]},zte=function e(){var t,n,r,i,o,s,a=arguments[0],l=1,c=arguments.length,d=!1;for(typeof a=="boolean"&&(d=a,a=arguments[1]||{},l=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});l<c;++l)if(t=arguments[l],t!=null)for(n in t)r=bT(a,n),i=bT(t,n),a!==i&&(d&&i&&(mT(i)||(o=gT(i)))?(o?(o=!1,s=r&&gT(r)?r:[]):s=r&&mT(r)?r:{},vT(a,{name:n,newValue:e(d,s,i)})):typeof i<"u"&&vT(a,{name:n,newValue:i}));return a};const ex=Sc(zte);function tx(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Bte(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...i);function a(l,...c){const d=e[++o];let f=-1;if(l){s(l);return}for(;++f<i.length;)(c[f]===null||c[f]===void 0)&&(c[f]=i[f]);i=c,d?Hte(d,a)(...c):s(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function Hte(e,t){let n;return r;function r(...s){const a=e.length>s.length;let l;a&&s.push(i);try{l=e.apply(this,s)}catch(c){const d=c;if(a&&n)throw d;return i(d)}a||(l instanceof Promise?l.then(o,i):l instanceof Error?i(l):o(l))}function i(s,...a){n||(n=!0,t(s,...a))}function o(s){i(null,s)}}const Gi={basename:Vte,dirname:Wte,extname:qte,join:Ute,sep:"/"};function Vte(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');ad(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function Wte(e){if(ad(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function qte(e){ad(e);let t=e.length,n=-1,r=0,i=-1,o=0,s;for(;t--;){const a=e.codePointAt(t);if(a===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),a===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function Ute(...e){let t=-1,n;for(;++t<e.length;)ad(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Gte(n)}function Gte(e){ad(e);const t=e.codePointAt(0)===47;let n=Yte(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Yte(e,t){let n="",r=0,i=-1,o=0,s=-1,a,l;for(;++s<=e.length;){if(s<e.length)a=e.codePointAt(s);else{if(a===47)break;a=47}if(a===47){if(!(i===s-1||o===1))if(i!==s-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=s,o=0;continue}}else if(n.length>0){n="",r=0,i=s,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,o=0}else a===46&&o>-1?o++:o=-1}return n}function ad(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Kte={cwd:Xte};function Xte(){return"/"}function nx(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Qte(e){if(typeof e=="string")e=new URL(e);else if(!nx(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Zte(e)}function Zte(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const rx=["history","path","basename","stem","extname","dirname"];class yT{constructor(t){let n;t?nx(t)?n={path:t}:typeof t=="string"||Jte(t)?n={value:t}:n=t:n={},this.cwd=Kte.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<rx.length;){const o=rx[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)rx.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Gi.basename(this.path):void 0}set basename(t){ox(t,"basename"),ix(t,"basename"),this.path=Gi.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Gi.dirname(this.path):void 0}set dirname(t){xT(this.basename,"dirname"),this.path=Gi.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Gi.extname(this.path):void 0}set extname(t){if(ix(t,"extname"),xT(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Gi.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){nx(t)&&(t=Qte(t)),ox(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Gi.basename(this.path,this.extname):void 0}set stem(t){ox(t,"stem"),ix(t,"stem"),this.path=Gi.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new Gn(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function ix(e,t){if(e&&e.includes(Gi.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Gi.sep+"`")}function ox(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function xT(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Jte(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const ene=function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};Object.setPrototypeOf(o,r);const s=Object.getOwnPropertyNames(i);for(const a of s){const l=Object.getOwnPropertyDescriptor(i,a);l&&Object.defineProperty(o,a,l)}return o},tne={}.hasOwnProperty;class sx extends ene{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Bte()}copy(){const t=new sx;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(ex(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(cx("data",this.frozen),this.namespace[t]=n,this):tne.call(this.namespace,t)&&this.namespace[t]||void 0:t?(cx("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Hp(t),r=this.parser||this.Parser;return ax("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),ax("process",this.parser||this.Parser),lx("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,s){const a=Hp(t),l=r.parse(a);r.run(l,a,function(d,f,g){if(d||!f||!g)return c(d);const p=f,v=r.stringify(p,g);ine(v)?g.value=v:g.result=v,c(d,g)});function c(d,f){d||!f?s(d):o?o(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),ax("processSync",this.parser||this.Parser),lx("processSync",this.compiler||this.Compiler),this.process(t,i),_T("processSync","process",n),r;function i(o,s){n=!0,dT(o),r=s}}run(t,n,r){wT(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(s,a){const l=Hp(n);i.run(t,l,c);function c(d,f,g){const p=f||t;d?a(d):s?s(p):r(void 0,p,g)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),_T("runSync","run",r),i;function o(s,a){dT(s),i=a,r=!0}}stringify(t,n){this.freeze();const r=Hp(n),i=this.compiler||this.Compiler;return lx("stringify",i),wT(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(cx("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[d,...f]=c;l(d,f)}else s(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function s(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(c.plugins),c.settings&&(i.settings=ex(!0,i.settings,c.settings))}function a(c){let d=-1;if(c!=null)if(Array.isArray(c))for(;++d<c.length;){const f=c[d];o(f)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,d){let f=-1,g=-1;for(;++f<r.length;)if(r[f][0]===c){g=f;break}if(g===-1)r.push([c,...d]);else if(d.length>0){let[p,...v]=d;const y=r[g][1];tx(y)&&tx(p)&&(p=ex(!0,y,p)),r[g]=[c,p,...v]}}}}const nne=new sx().freeze();function ax(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function lx(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function cx(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function wT(e){if(!tx(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function _T(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Hp(e){return rne(e)?e:new yT(e)}function rne(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function ine(e){return typeof e=="string"||one(e)}function one(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const sne="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",ST=[],CT={allowDangerousHtml:!0},ane=/^(https?|ircs?|mailto|xmpp)$/i,lne=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function cne(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,o=e.components,s=e.disallowedElements,a=e.rehypePlugins||ST,l=e.remarkPlugins||ST,c=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...CT}:CT,d=e.skipHtml,f=e.unwrapDisallowed,g=e.urlTransform||une,p=nne().use(Wee).use(l).use(jte,c).use(a),v=new yT;typeof r=="string"&&(v.value=r);for(const _ of lne)Object.hasOwn(e,_.from)&&(""+_.from+(_.to?"use `"+_.to+"` instead":"remove it")+sne+_.id,void 0);const y=p.parse(v);let x=p.runSync(y,v);return i&&(x={type:"element",tagName:"div",properties:{className:i},children:x.type==="root"?x.children:[x]}),lT(x,w),AZ(x,{Fragment:S.Fragment,components:o,ignoreInvalidStyle:!0,jsx:S.jsx,jsxs:S.jsxs,passKeys:!0,passNode:!0});function w(_,C,O){if(_.type==="raw"&&O&&typeof C=="number")return d?O.children.splice(C,1):O.children[C]={type:"text",value:_.value},C;if(_.type==="element"){let P;for(P in zy)if(Object.hasOwn(zy,P)&&Object.hasOwn(_.properties,P)){const k=_.properties[P],A=zy[P];(A===null||A.includes(_.tagName))&&(_.properties[P]=g(String(k||""),P,_))}}if(_.type==="element"){let P=t?!t.includes(_.tagName):s?s.includes(_.tagName):!1;if(!P&&n&&typeof C=="number"&&(P=!n(_,C,O)),P&&O&&typeof C=="number")return f&&_.children?O.children.splice(C,1,..._.children):O.children.splice(C,1),C}}}function une(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t<0||i>-1&&t>i||n>-1&&t>n||r>-1&&t>r||ane.test(e.slice(0,t))?e:""}const dne=`
|
|
446
|
+
|
|
447
|
+
Use the following syntax to create a chart query. Please replace the x-axis, y-axis, stack-by, label, and measure with the actual column names of the table.
|
|
448
|
+
|
|
449
|
+
Bar / Line Chart:
|
|
450
|
+
|
|
451
|
+
SELECT x-axis, y-axis-1, y-axis-2, y-axis-3,... FROM table
|
|
452
|
+
|
|
453
|
+
- X-axis - Category
|
|
454
|
+
- Y-axis - Number
|
|
455
|
+
|
|
456
|
+
Stacked Chart:
|
|
457
|
+
|
|
458
|
+
SELECT x-axis, stack-by, y-axis FROM table
|
|
459
|
+
|
|
460
|
+
- X-axis - Category
|
|
461
|
+
- Stack by - Category
|
|
462
|
+
- Y-axis - Number
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
Scatter Chart:
|
|
466
|
+
|
|
467
|
+
SELECT label, x-axis, y-axis FROM table
|
|
468
|
+
|
|
469
|
+
- Label - Category
|
|
470
|
+
- Group (opt) - Category
|
|
471
|
+
- X-axis - Number
|
|
472
|
+
- Y-axis - Number
|
|
473
|
+
|
|
474
|
+
|
|
475
|
+
Bubble Chart:
|
|
476
|
+
|
|
477
|
+
SELECT label, x-axis, y-axis, radius FROM table
|
|
478
|
+
|
|
479
|
+
- Label - Category
|
|
480
|
+
- Bubble Group (opt) - Category
|
|
481
|
+
- X-axis - Number
|
|
482
|
+
- Y-axis - Number
|
|
483
|
+
- Radius - Number
|
|
484
|
+
|
|
485
|
+
Pie / Dougnut Chart:
|
|
486
|
+
|
|
487
|
+
SELECT label, measure FROM table
|
|
488
|
+
|
|
489
|
+
- Label - Category
|
|
490
|
+
- Measure - Number
|
|
491
|
+
`;function fne({open:e,setOpen:t,userInput:n,setUserInput:r,triggerAIRun:i,setTriggerAIRun:o}){const s=xe(K=>K.authToken),[a,l]=m.useState(!1),c=_e(K=>K.actions.setCardSql),d=_e(K=>K.actions.setRunSql),f=_e(K=>K.actions.setCardType),g=_e(K=>K.currentColumns),p=_e(K=>K.card.sql),v=_e(K=>K.selectedTableName),y=`
|
|
492
|
+
${n}
|
|
493
|
+
|
|
494
|
+
${v==="api"?"please use the alaSQL syntax to query the data":""}
|
|
495
|
+
Table: ${v}
|
|
496
|
+
Table Columns: ${g==null?void 0:g.map(K=>`${K.column_name} | ${K.data_type}`).join(", ")}
|
|
497
|
+
User SQL: ${p}
|
|
498
|
+
`,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.
|
|
499
|
+
Visual Query Syntax: ${dne}`,{data:w,isLoading:_,isFetching:C,isError:O,refetch:P}=Sr({queryKey:["ai-query"],queryFn:()=>Xa("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),P())}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},B={fontFamily:"Arial, sans-serif",lineHeight:1.6,fontSize:15,padding:"2px 0",marginLeft:20,listStyleType:"disc"},H={p:({node:K,...Y})=>S.jsx("p",{style:L,...Y}),pre:({node:K,...Y})=>S.jsxs("pre",{className:" bg-muted/50 space-y-2 p-3 rounded-sm",style:F,children:[S.jsx("code",{className:" whitespace-normal",children:Y.children}),S.jsxs("div",{className:" flex justify-start gap-2",children:[S.jsx(dt,{onClick:V,size:"sm",variant:"outline",children:S.jsx(BE,{})}),S.jsx(dt,{onClick:$=>{const X=V($);X&&(t(!1),c(X),d(!0))},size:"sm",variant:"outline",children:S.jsx(zj,{})})]})]}),li:({node:K,...Y})=>S.jsx("li",{style:B,...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(X=>console.error("Error in copying text: ",X)),$}return S.jsxs(UM,{open:e,onOpenChange:t,children:[S.jsx(GM,{asChild:!0,children:S.jsx(dt,{size:"sm",className:"",variant:"outline",children:S.jsx(VB,{strokeWidth:1.5,size:18})})}),S.jsxs(Ey,{className:"sm:max-w-[425px] md:min-w-[625px] md:max-h-[625px] flex flex-col justify-between overflow-auto",children:[S.jsxs(Py,{children:[S.jsx(Oy,{children:"Ask"}),S.jsx(ky,{children:"Need assistance with SQL queries? Feel free to ask me any question!"})]}),S.jsx(Sl,{className:"h-[625px] w-full border-t ",children:(!_||!C)&&S.jsx(cne,{className:" pl-1 pr-3 py-1 w-full xbg-red-100 overflow-auto ",components:H,children:w==null?void 0:w.response})}),S.jsxs("div",{children:[S.jsx(Rc,{className:Oe(" invisible h-1 w-full animate-pulse",{visible:_||C})}),S.jsxs("div",{className:" border rounded-md flex items-center w-full",children:[S.jsx(My,{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)})," ",S.jsx(dt,{className:"h-8",size:"sm",variant:"ghost",onClick:A,children:!_&&!C?S.jsx(Fj,{}):S.jsx(Pu,{className:" w-4 h-4 animate-spin mr-2 text-foreground/50"})})]})]})]})]})}function hne(){const{theme:e}=pm(),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=xe(W=>W.authToken),g=_e(W=>W.card),p=xe(W=>W.theme),v=_e(W=>W.selectedConnectionId),y=_e(W=>W.selectedDatabaseName),x=_e(W=>W.selectedSchemaName),w=_e(W=>W.selectedTableName),_=_e(W=>W.actions.setCardSql),C=_e(W=>W.card.sql),O=_e(W=>W.selectedConnectionId),P=_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),B=_e(W=>W.actions.setApplyFilters),H=_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),X=_e(W=>W.actions.setIsSqlRunning),{data:j,isLoading:ne,isFetching:se,isSuccess:D,isError:q,error:re,status:R,refetch:te}=Sr({queryKey:[C],queryFn:()=>Ds("https://semaphor.cloud/api/v1/query",(f==null?void 0:f.accessToken)||"",{connection_id:O,sql:C,active_filters:k?P:[]}),enabled:!1,retry:!1});m.useEffect(()=>{j&&(console.log("queryData",j),V(j.records))},[j,V]),m.useEffect(()=>{Y&&(te(),$(!1))},[Y,te,$]),m.useEffect(()=>{(ne||se)&&X(!0),(q||D)&&X(!1)},[ne,se,q,D,X]);function ge(){_(""),V([]),K({}),A("")}const pe=W=>{n.current=W};function de(){if(C&&!C.includes("{{")){const W=nQ(C);_(W),F==null||F({...g,sql:W,lastSelectedSchema:x,lastSelectedDatabase:y,lastSelectedTable:w,connectionId:v})}else F==null||F(g)}function ie(){H==null||H()}m.useEffect(()=>{const W=t.current,be=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 be&&W&&be.addCommand(W.KeyMod.Shift|W.KeyCode.Enter,function(){return console.log("Executing query..."),te(),!1}),()=>{}},[e,p,t.current]);function J(W){t.current=W}return S.jsxs("section",{className:"grow h-full flex flex-col justify-end pt-8 pb-4 ",children:[S.jsxs("div",{className:"w-full h-full grow flex relative justify-between ",children:[S.jsx("div",{className:`flex ${r?"w-2/3":"w-[95%]"} h-full xbg-red-100 p-1`,children:S.jsx(my,{theme:"default",onChange:W=>{_(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:J,onMount:pe})}),r&&S.jsx("div",{className:"xbg-red-200 p-1 w-1/3 text-xs relative overflow-hidden xbg-yellow-100 ",children:S.jsxs("div",{className:"max-h-[250px] overflow-y-auto ",children:[S.jsxs("div",{className:"flex gap-2 items-center",children:[S.jsx(SQ,{checked:k,onCheckedChange:()=>B(!k),text:"Apply Filters"}),S.jsx(CQ,{})]}),S.jsx(my,{theme:"default",onChange:W=>{if(W)try{JSON.parse(W),L(JSON.parse(W))}catch{}},defaultLanguage:"json",className:"h-[250px] overflow-y-auto mt-1",value:JSON.stringify(P,null,2),options:{minimap:{enabled:!1},lineNumbers:"off",glyphMargin:!1,wordWrap:"on",scrollbar:{verticalScrollbarSize:0,horizontalScrollbarSize:0},fontSize:12,renderLineHighlight:"none"}})]})}),P&&r&&S.jsx(bu,{onClick:()=>i(!1),className:"absolute right-6 top-1 w-3 h-3 text-foreground/50 hover:text-foreground hover:cursor-pointer"}),P&&!r&&S.jsx(A2,{onClick:()=>i(!0),className:Oe("absolute right-6 top-1 w-3 h-3 text-foreground/50 hover:text-foreground hover:cursor-pointer",{"text-red-800 font-bold":k})})]}),S.jsxs("div",{className:" flex grow pl-8 pr-6 gap-2 justify-between item-center",children:[S.jsxs("div",{className:"flex grow gap-2 items-center",children:[S.jsxs(dt,{disabled:ne||se,onClick:()=>{te()},className:" shrink-0",size:"sm",variant:"outline",children:[(ne||se)&&S.jsx(Pu,{className:"w-4 h-4 mr-2 animate-spin text-foreground/50"}),"Run"]}),q&&S.jsx(pQ,{error:re.message}),S.jsx(dt,{onClick:ge,className:"",size:"sm",variant:"outline",children:"Clear"}),S.jsx(Tp,{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"}),S.jsx(fne,{open:o,setOpen:s,userInput:a,triggerAIRun:c,setTriggerAIRun:d,setUserInput:W=>l(W)})]}),S.jsxs("div",{className:"flex gap-2 items-end ",children:[S.jsx(dt,{onClick:de,className:" w-full",size:"sm",variant:"outline",children:"Update"}),S.jsx(dt,{onClick:ie,className:" w-full",size:"sm",variant:"outline",children:"Close"})]})]})]})}const ET="Switch",[pne,Ude]=Pn(ET),[gne,mne]=pne(ET),vne=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,_=>g(_)),v=m.useRef(!1),y=f?!!f.closest("form"):!0,[x=!1,w]=Qn({prop:i,defaultProp:o,onChange:c});return m.createElement(gne,{scope:n,checked:x,disabled:a},m.createElement(Be.button,le({type:"button",role:"switch","aria-checked":x,"aria-required":s,"data-state":PT(x),"data-disabled":a?"":void 0,disabled:a,value:l},d,{ref:p,onClick:Ce(e.onClick,_=>{w(C=>!C),y&&(v.current=_.isPropagationStopped(),v.current||_.stopPropagation())})})),y&&m.createElement(xne,{control:f,bubbles:!v.current,name:r,value:l,checked:x,required:s,disabled:a,style:{transform:"translateX(-100%)"}}))}),bne="SwitchThumb",yne=m.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,i=mne(bne,n);return m.createElement(Be.span,le({"data-state":PT(i.checked),"data-disabled":i.disabled?"":void 0},r,{ref:t}))}),xne=e=>{const{control:t,checked:n,bubbles:r=!0,...i}=e,o=m.useRef(null),s=pp(n),a=Ch(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",le({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 PT(e){return e?"checked":"unchecked"}const OT=vne,wne=yne,kT=ue.forwardRef(({className:e,...t},n)=>S.jsx(OT,{className:Oe("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:S.jsx(wne,{className:Oe("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")})}));kT.displayName=OT.displayName;function MT({className:e,...t}){const[n,r]=m.useState(0),i=xe(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=vb({data:o.data,cardType:o.type,cfg:o.cfg,customCfg:o.customCfg})),S.jsxs(bv,{role:"editor-visual-card",className:Oe(" relative h-full flex flex-col rounded-none",e),...t,children:[S.jsxs(yv,{children:[S.jsx(Hc,{text:o.title,onSave:l=>s({...o,title:l}),children:S.jsx(xv,{className:"text-base",children:o.title})}),S.jsx(Hc,{text:o.description||"",onSave:l=>s({...o,description:l}),children:S.jsxs(wv,{children:[" ",o.description]})})]}),S.jsxs(_v,{className:"flex flex-col pb-3 grow",children:[o.type!=="table"&&a&&S.jsx(jE,{cfg:a},n),o.type==="table"&&o.data&&o.data.length>0&&S.jsx(Q2,{children:S.jsx(Qb,{data:o==null?void 0:o.data})})]})]})}function _ne(){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,O;const w={...x,data:{...x==null?void 0:x.data,datasets:(O=(C=x==null?void 0:x.data)==null?void 0:C.datasets)==null?void 0:O.map(P=>({...P,data:[]}))}};return JSON.stringify(w,null,1)}function g(){if(!l.data||l.data.length===0)return;const x=vb({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=Rs.cloneDeep(l.cfg),_=Rs.merge(w,c);return x=f(_),x}return n?(x=f(JSON.parse(n)),x):""}return S.jsxs(UM,{open:e,onOpenChange:t,children:[S.jsx(GM,{asChild:!0,children:S.jsx(dt,{onClick:g,className:`h-7 ${c&&"border-foreground/50 dark:border-foreground/70"}`,size:"sm",variant:"outline",children:c?"Custom Config":"Customize"})}),S.jsx(Ey,{className:" sm:max-w-[425px] md:min-w-[600px] md:min-h-[700px] lg:min-w-[800px] xl:min-w-[1000px]",children:S.jsxs("div",{className:"bg-red-x100 flex flex-col gap-2 justify-between",children:[S.jsxs(Py,{className:"",children:[S.jsx(Oy,{children:"Customize Chart"}),S.jsxs(ky,{children:["See the configuration options and documentation",S.jsx("a",{target:"_blank",className:"ml-1 underline text-blue-500 ",href:"https://www.chartjs.org/docs/latest/samples/bar/vertical.html",children:"here."})]})]}),S.jsxs("div",{className:"grow flex flex-wrap gap-2",children:[S.jsx(MT,{className:"flex-1 rounded shadow-none"}),S.jsxs(Kw,{defaultValue:"custom-config",className:" flex flex-col flex-1",children:[S.jsxs(Xw,{className:" justify-start border rounded-sm rounded-b-none border-b-0 ",children:[S.jsxs(_m,{value:"custom-config",children:[c&&S.jsx(zE,{className:"w-5 h-5 mr-1 text-green-600"}),c?"Custom Config":"Default Config"]}),S.jsx(_m,{className:"",value:"output",children:"Output"})]}),S.jsx(af,{className:" grow mt-0 bg-red-x p-2 border border-t-0 rounded-b ",value:"output",children:S.jsx(My,{disabled:!0,value:n,className:" border-none resize-none font-mono h-full focus-visible:ring-0 focus-visible:ring-offset-0"})}),S.jsx(af,{className:"grow mt-0 border border-t-0 rounded-b ",value:"custom-config",children:S.jsx(my,{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)})})]})]}),S.jsxs(KM,{className:"flex items-center",children:[S.jsx(Ol,{className:"text-red-500 mr-2",children:s}),S.jsx(dt,{disabled:!c,onClick:v,variant:"outline",children:"Reset"}),S.jsx(dt,{onClick:p,variant:"outline",children:"Apply"}),S.jsx(dt,{onClick:()=>t(!1),variant:"outline",children:"Close"})]})]})})]})}var DT={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},TT=m.createContext&&m.createContext(DT),Sne=["attr","size","title"];function Cne(e,t){if(e==null)return{};var n=Ene(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 Ene(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 Vp(){return Vp=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},Vp.apply(this,arguments)}function AT(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 Wp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?AT(Object(n),!0).forEach(function(r){Pne(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Pne(e,t,n){return t=One(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function One(e){var t=kne(e,"string");return typeof t=="symbol"?t:String(t)}function kne(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 IT(e){return e&&e.map((t,n)=>m.createElement(t.tag,Wp({key:n},t.attr),IT(t.child)))}function ld(e){return t=>m.createElement(Mne,Vp({attr:Wp({},e.attr)},t),IT(e.child))}function Mne(e){var t=n=>{var{attr:r,size:i,title:o}=e,s=Cne(e,Sne),a=i||n.size||"1em",l;return n.className&&(l=n.className),e.className&&(l=(l?l+" ":"")+e.className),m.createElement("svg",Vp({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,s,{className:l,style:Wp(Wp({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 TT!==void 0?m.createElement(TT.Consumer,null,n=>t(n)):t(DT)}function RT(e){return ld({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 NT(e){return ld({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 LT(e){return ld({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 $T(e){return ld({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 FT(e){return ld({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 Dne(){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 S.jsxs(lp,{open:e,onOpenChange:t,children:[S.jsx(cp,{asChild:!0,children:S.jsx(dt,{className:"h-7 px-2",variant:"outline",children:S.jsx(Tne,{className:"h-4 w-4",chartType:n})})}),S.jsx(Hu,{className:"w-50",children:S.jsxs("div",{className:"grid grid-cols-3 place-items-center ",children:[S.jsx(dt,{onClick:()=>o("bar"),className:"font-normal",variant:"ghost",children:S.jsx(M2,{strokeWidth:1})}),S.jsx(dt,{onClick:()=>o("line"),variant:"ghost",children:S.jsx(I2,{strokeWidth:1})}),S.jsx(dt,{onClick:()=>o("stackedBar"),variant:"ghost",children:S.jsx(FT,{className:"h-6 w-6 text-foreground/50 ",strokeWidth:0})}),S.jsx(dt,{onClick:()=>o("scatter"),variant:"ghost",children:S.jsx(N2,{strokeWidth:1})}),S.jsx(dt,{onClick:()=>o("bubble"),variant:"ghost",children:S.jsx($T,{strokeWidth:2})}),S.jsx(dt,{onClick:()=>o("pie"),variant:"ghost",children:S.jsx(R2,{strokeWidth:1})}),S.jsx(dt,{onClick:()=>o("doughnut"),variant:"ghost",children:S.jsx(LT,{className:"h-7 w-7",strokeWidth:.5})}),S.jsx(dt,{onClick:()=>o("radar"),variant:"ghost",children:S.jsx(RT,{className:"h-6 w-6 text-foreground/50 font-extralight",strokeWidth:.5})}),S.jsx(dt,{onClick:()=>o("polarArea"),variant:"ghost",children:S.jsx(NT,{className:"h-6 w-6 text-foreground/50",strokeWidth:1})}),S.jsx(dt,{onClick:()=>o("table"),variant:"ghost",children:S.jsx(Nb,{className:"h-6 w-6 text-foreground/90",strokeWidth:1})})]})})]})}function Tne({chartType:e,className:t}){switch(e){case"bar":return S.jsx(M2,{className:t});case"line":return S.jsx(I2,{className:t});case"pie":return S.jsx(R2,{className:t});case"radar":return S.jsx(RT,{className:t});case"scatter":return S.jsx(N2,{className:t});case"bubble":return S.jsx($T,{className:t});case"doughnut":return S.jsx(LT,{className:t});case"stackedBar":return S.jsx(FT,{className:"h-5 w-5 text-foreground/50 ",strokeWidth:0});case"polarArea":return S.jsx(NT,{className:t});default:return S.jsx(Nb,{className:t})}}function Ane(){const e=_e(n=>n.card.refreshInterval),t=_e(n=>n.actions.setCardRefreshInterval);return S.jsxs(lp,{children:[S.jsx(cp,{asChild:!0,children:S.jsx(dt,{className:"h-7",variant:"outline",children:"Realtime"})}),S.jsx(Hu,{className:"w-[200px]",children:S.jsx("div",{className:"grid gap-4",children:S.jsx("div",{className:"grid gap-2",children:S.jsxs("div",{className:"grid grid-cols-5 items-center gap-1",children:[S.jsx(Ol,{className:"col-span-3",htmlFor:"width",children:"Refresh Every"}),S.jsx(Tp,{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 jT(){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),S.jsxs("div",{className:" h-full relative flex flex-col",children:[n&&S.jsx(Pu,{className:" w-10 h-10 z-10 absolute m-auto left-0 right-0 top-0 bottom-0 animate-spin text-foreground/10 "}),S.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&&S.jsxs("div",{className:"bg-red-x00 flex grow gap-2",children:[S.jsx(Dne,{}),S.jsx(_ne,{}),S.jsx(Ane,{})]}),S.jsx(Ine,{})]}),t?S.jsx(MT,{className:"grow border-none shadow-none "}):S.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&&S.jsx(Qb,{data:e.data})})]})}function Ine(){const e=_e(n=>n.isShowingVisual),t=_e(n=>n.actions.setIsShowingVisual);return S.jsxs("div",{className:" flex items-center space-x-2",children:[S.jsx(Ol,{htmlFor:"visualize",children:"Chart"}),S.jsx(kT,{checked:e,onCheckedChange:()=>t(!e),id:"visualize",className:"data-[state=checked]:bg-foreground/50"})]})}const zT="Collapsible",[Rne,BT]=Pn(zT),[Nne,ux]=Rne(zT),Lne=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(Nne,{scope:n,disabled:o,contentId:or(),open:l,onOpenToggle:m.useCallback(()=>c(d=>!d),[c])},m.createElement(Be.div,le({"data-state":dx(l),"data-disabled":o?"":void 0},a,{ref:t})))}),$ne="CollapsibleTrigger",Fne=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=ux($ne,n);return m.createElement(Be.button,le({type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":dx(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled},r,{ref:t,onClick:Ce(e.onClick,i.onOpenToggle)}))}),HT="CollapsibleContent",jne=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=ux(HT,e.__scopeCollapsible);return m.createElement(vn,{present:n||i.open},({present:o})=>m.createElement(zne,le({},r,{ref:t,present:o})))}),zne=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...o}=e,s=ux(HT,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 _=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(_)},[]),Hn(()=>{const _=c.current;if(_){w.current=w.current||{transitionDuration:_.style.transitionDuration,animationName:_.style.animationName},_.style.transitionDuration="0s",_.style.animationName="none";const C=_.getBoundingClientRect();f.current=C.height,p.current=C.width,x.current||(_.style.transitionDuration=w.current.transitionDuration,_.style.animationName=w.current.animationName),l(r)}},[s.open,r]),m.createElement(Be.div,le({"data-state":dx(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 dx(e){return e?"open":"closed"}const Bne=Lne,Hne=Fne,Vne=jne,as="Accordion",Wne=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[fx,qne,Une]=of(as),[qp,Gde]=Pn(as,[Une,BT]),hx=BT(),VT=m.forwardRef((e,t)=>{const{type:n,...r}=e,i=r,o=r;return m.createElement(fx.Provider,{scope:e.__scopeAccordion},n==="multiple"?m.createElement(Xne,le({},o,{ref:t})):m.createElement(Kne,le({},i,{ref:t})))});VT.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[WT,Gne]=qp(as),[qT,Yne]=qp(as,{collapsible:!1}),Kne=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(WT,{scope:e.__scopeAccordion,value:a?[a]:[],onItemOpen:l,onItemClose:m.useCallback(()=>o&&l(""),[o,l])},m.createElement(qT,{scope:e.__scopeAccordion,collapsible:o},m.createElement(UT,le({},s,{ref:t}))))}),Xne=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(WT,{scope:e.__scopeAccordion,value:s,onItemOpen:l,onItemClose:c},m.createElement(qT,{scope:e.__scopeAccordion,collapsible:!0},m.createElement(UT,le({},o,{ref:t}))))}),[Qne,Up]=qp(as),UT=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=qne(n),f=Ns(i)==="ltr",g=Ce(e.onKeyDown,p=>{var v;if(!Wne.includes(p.key))return;const y=p.target,x=c().filter(F=>{var B;return!((B=F.ref.current)!==null&&B!==void 0&&B.disabled)}),w=x.findIndex(F=>F.ref.current===y),_=x.length;if(w===-1)return;p.preventDefault();let C=w;const O=0,P=_-1,k=()=>{C=w+1,C>P&&(C=O)},A=()=>{C=w-1,C<O&&(C=P)};switch(p.key){case"Home":C=O;break;case"End":C=P;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%_;(v=x[L].ref.current)===null||v===void 0||v.focus()});return m.createElement(Qne,{scope:n,disabled:r,direction:i,orientation:o},m.createElement(fx.Slot,{scope:n},m.createElement(Be.div,le({},s,{"data-orientation":o,ref:l,onKeyDown:r?void 0:g}))))}),px="AccordionItem",[Zne,gx]=qp(px),Jne=m.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...i}=e,o=Up(px,n),s=Gne(px,n),a=hx(n),l=or(),c=r&&s.value.includes(r)||!1,d=o.disabled||e.disabled;return m.createElement(Zne,{scope:n,open:c,disabled:d,triggerId:l},m.createElement(Bne,le({"data-orientation":o.orientation,"data-state":YT(c)},a,i,{ref:t,disabled:d,open:c,onOpenChange:f=>{f?s.onItemOpen(r):s.onItemClose(r)}})))}),ere="AccordionHeader",tre=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,i=Up(as,n),o=gx(ere,n);return m.createElement(Be.h3,le({"data-orientation":i.orientation,"data-state":YT(o.open),"data-disabled":o.disabled?"":void 0},r,{ref:t}))}),GT="AccordionTrigger",nre=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,i=Up(as,n),o=gx(GT,n),s=Yne(GT,n),a=hx(n);return m.createElement(fx.ItemSlot,{scope:n},m.createElement(Hne,le({"aria-disabled":o.open&&!s.collapsible||void 0,"data-orientation":i.orientation,id:o.triggerId},a,r,{ref:t})))}),rre="AccordionContent",ire=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,i=Up(as,n),o=gx(rre,n),s=hx(n);return m.createElement(Vne,le({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 YT(e){return e?"open":"closed"}const ore=VT,sre=Jne,are=tre,KT=nre,XT=ire,QT=ore,ls=ue.forwardRef(({className:e,...t},n)=>S.jsx(sre,{ref:n,className:Oe("border-b",e),...t}));ls.displayName="AccordionItem";const cs=ue.forwardRef(({className:e,children:t,...n},r)=>S.jsx(are,{className:"flex",children:S.jsxs(KT,{ref:r,className:Oe("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,S.jsx(Rb,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));cs.displayName=KT.displayName;const us=ue.forwardRef(({className:e,children:t,...n},r)=>S.jsx(XT,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:S.jsx("div",{className:Oe("pb-4 pt-0",e),children:t})}));us.displayName=XT.displayName;const ZT="Radio",[lre,JT]=Pn(ZT),[cre,ure]=lre(ZT),dre=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(cre,{scope:n,checked:i,disabled:s},m.createElement(Be.button,le({type:"button",role:"radio","aria-checked":i,"data-state":eA(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(pre,{control:d,bubbles:!p.current,name:r,value:a,checked:i,required:o,disabled:s,style:{transform:"translateX(-100%)"}}))}),fre="RadioIndicator",hre=m.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...i}=e,o=ure(fre,n);return m.createElement(vn,{present:r||o.checked},m.createElement(Be.span,le({"data-state":eA(o.checked),"data-disabled":o.disabled?"":void 0},i,{ref:t})))}),pre=e=>{const{control:t,checked:n,bubbles:r=!0,...i}=e,o=m.useRef(null),s=pp(n),a=Ch(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",le({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 eA(e){return e?"checked":"unchecked"}const gre=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],tA="RadioGroup",[mre,Yde]=Pn(tA,[el,JT]),nA=el(),rA=JT(),[vre,bre]=mre(tA),yre=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=nA(n),v=Ns(c),[y,x]=Qn({prop:o,defaultProp:i,onChange:f});return m.createElement(vre,{scope:n,name:r,required:s,disabled:a,value:y,onValueChange:x},m.createElement(ym,le({asChild:!0},p,{orientation:l,dir:v,loop:d}),m.createElement(Be.div,le({role:"radiogroup","aria-required":s,"aria-orientation":l,"data-disabled":a?"":void 0,dir:v},g,{ref:t}))))}),xre="RadioGroupItem",wre=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...i}=e,o=bre(xre,n),s=o.disabled||r,a=nA(n),l=rA(n),c=m.useRef(null),d=et(t,c),f=o.value===i.value,g=m.useRef(!1);return m.useEffect(()=>{const p=y=>{gre.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(xm,le({asChild:!0},a,{focusable:!s,active:f}),m.createElement(dre,le({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())})})))}),_re=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,i=rA(n);return m.createElement(hre,le({},i,r,{ref:t}))}),iA=yre,oA=wre,Sre=_re,sA=ue.forwardRef(({className:e,...t},n)=>S.jsx(iA,{className:Oe("grid gap-2",e),...t,ref:n}));sA.displayName=iA.displayName;const mx=ue.forwardRef(({className:e,...t},n)=>S.jsx(oA,{ref:n,className:Oe("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:S.jsx(Sre,{className:"flex items-center justify-center",children:S.jsx(T2,{className:"h-2.5 w-2.5 fill-current text-current"})})}));mx.displayName=oA.displayName;function aA(){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 S.jsxs("div",{children:[S.jsx("p",{className:"font-semibold",children:"Orientation"}),S.jsxs(sA,{value:n,onValueChange:r,className:"flex gap-3 mt-2 ",defaultValue:"x",children:[S.jsxs("div",{className:"flex items-center space-x-2",children:[S.jsx(mx,{value:"x",id:"r1"}),S.jsx("label",{className:"text-sm",htmlFor:"r1",children:"Vertical"})]}),S.jsxs("div",{className:"flex items-center space-x-2",children:[S.jsx(mx,{value:"y",id:"r2"}),S.jsx("label",{className:"text-sm",htmlFor:"r2",children:"Horizontal"})]})]})]})}function lA(){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 S.jsxs(S.Fragment,{children:[S.jsx("label",{className:"font-medium",children:"Data Labels"}),S.jsxs(Rk,{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:[S.jsx(ly,{className:"w-[180px] mt-2 focus:ring-1 focus:ring-offset-0 h-7",children:S.jsx(Lk,{placeholder:"Select position"})}),S.jsx(cy,{children:S.jsxs(Nk,{children:[S.jsx(yp,{children:"Data Labels"}),S.jsx(ma,{value:"none",children:"None"}),S.jsx(ma,{value:"start",children:"Start"}),S.jsx(ma,{value:"center",children:"Center"}),S.jsx(ma,{value:"end",children:"End"})]})})]})]})}function cA(){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 S.jsxs("div",{children:[S.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[S.jsx(_y,{checked:!!(e!=null&&e.filterOnClick),onCheckedChange:i=>{t({...e,filterOnClick:!!i})}}),S.jsx(Ol,{children:"Filter on click"})]}),(e==null?void 0:e.filterOnClick)===!0&&S.jsxs("div",{className:"flex gap-2 items-center",children:[S.jsx(Tp,{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)}),S.jsxs(Tb,{children:[S.jsx(C2,{children:S.jsx(HE,{className:"h-4 w-4 opacity-70"})}),S.jsx(kh,{children:S.jsxs("div",{className:"max-w-[200px]",children:["The x-axis expression of your query. Example:",S.jsx("div",{className:" mt-1 text-xs font-mono",children:"TO_CHAR(order_date, 'YYYY-MM')"})]})})]})]})]})}const Cre={datasets:[{type:"line",label:"Sum_sales",data:[]},{type:"bar",label:"Sum_profit",data:[]}]},Ere={datasets:[{fill:"origin",type:"line",label:"Sum_sales",data:[]}]};function Pre(){const e=_e(t=>t.card.type);return S.jsxs("div",{className:"p-6 space-y-6",children:[S.jsx(QT,{className:" ",type:"single",collapsible:!0,children:Ore(e)}),S.jsx("section",{className:"",children:["line","bar"].includes(e)&&S.jsx(aA,{})}),S.jsx("div",{children:S.jsx(lA,{})}),S.jsx("div",{children:S.jsx(cA,{})})]})}function Ore(e){if(["line","bar"].includes(e))return S.jsxs(S.Fragment,{children:[S.jsxs(ls,{value:"item-1",children:[S.jsx(cs,{className:" font-normal",children:S.jsxs("p",{children:["How to create a ",S.jsx("span",{children:"chart"})," query?"]})}),S.jsxs(us,{className:" ",children:[S.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"}),S.jsxs("ul",{className:"my-6 ml-6 list-disc [&>li]:mt-2 font-normal text-xs",children:[S.jsx("li",{children:"X-axis - Category (ex. city)"}),S.jsx("li",{children:"Y-axis - Number (ex. population)"})]})]})]}),S.jsxs(ls,{value:"item-2",children:[S.jsx(cs,{className:" font-normal",children:"How to create a mixed chart?"}),S.jsxs(us,{className:" text-xs space-y-2",children:[S.jsxs("p",{children:["Click ",S.jsx("b",{children:"Format"})," and change the `type` property in the dataset."]}),S.jsx("pre",{children:JSON.stringify(Cre,null,2)})]})]}),S.jsxs(ls,{value:"item-3",children:[S.jsx(cs,{className:" font-normal",children:"How to create an area chart?"}),S.jsxs(us,{className:" text-xs space-y-2",children:[S.jsxs("p",{children:["Click ",S.jsx("b",{children:"Format"})," and add `fill` property to the dataset. See",S.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."]}),S.jsx("pre",{children:JSON.stringify(Ere,null,2)})]})]})]});if(e==="bubble")return S.jsx(S.Fragment,{children:S.jsxs(ls,{value:"item-1",children:[S.jsx(cs,{className:" font-normal",children:S.jsxs("p",{children:["How to create a ",S.jsx("span",{children:e})," chart query?"]})}),S.jsxs(us,{className:" ",children:[S.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"}),S.jsxs("ul",{className:"my-6 ml-6 list-disc [&>li]:mt-2 font-normal text-xs",children:[S.jsx("li",{children:"Label - Category (ex. city)"}),S.jsx("li",{children:"Bubble Group (opt) - Category (ex. state)"}),S.jsx("li",{children:"X-axis - Number (ex. avg. age)"}),S.jsx("li",{children:"Y-axis - Number (ex. avg. weight)"}),S.jsx("li",{children:"Radius - Number (ex. population)"})]})]})]})});if(e==="scatter")return S.jsx(S.Fragment,{children:S.jsxs(ls,{value:"item-1",children:[S.jsx(cs,{className:" font-normal",children:S.jsxs("p",{children:["How to create a ",S.jsx("span",{children:e})," chart query?"]})}),S.jsxs(us,{className:" ",children:[S.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"}),S.jsxs("ul",{className:"my-6 ml-6 list-disc [&>li]:mt-2 font-normal text-xs",children:[S.jsx("li",{children:"Label - Category (ex. city)"}),S.jsx("li",{children:"Group (opt) - Category (ex. state)"}),S.jsx("li",{children:"X-axis - Number (ex. avg. age)"}),S.jsx("li",{children:"Y-axis - Number (ex. avg. weight)"})]})]})]})});if(["pie","doughnut","polarArea"].includes(e))return S.jsx(S.Fragment,{children:S.jsxs(ls,{value:"item-1",children:[S.jsx(cs,{className:" font-normal",children:S.jsxs("p",{children:["How to create a"," ",S.jsxs("span",{children:[e==="polarArea"?"polar":e," "]})," ","chart query?"]})}),S.jsxs(us,{className:" ",children:[S.jsx("div",{className:"bg-muted px-2 py-1 rounded font-mono font-semibold text-xs",children:"SELECT label, measure FROM table"}),S.jsxs("ul",{className:"my-6 ml-6 list-disc [&>li]:mt-2 font-normal text-xs",children:[S.jsx("li",{children:"Label - Category (ex. city)"}),S.jsx("li",{children:"Measure - Number (ex. population)"})]})]})]})})}function kre(){return S.jsxs("div",{className:"px-6 py-2 space-y-6",children:[S.jsx(QT,{className:" ",type:"single",collapsible:!0,children:S.jsxs(ls,{value:"item-1",children:[S.jsx(cs,{className:" font-normal",children:"Stacked chart query?"}),S.jsxs(us,{className:" ",children:[S.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"}),S.jsxs("ul",{className:"my-6 ml-6 list-disc [&>li]:mt-2 font-normal text-xs",children:[S.jsx("li",{children:"X-axis - Category (ex. country)"}),S.jsx("li",{children:"Stack by - Category (ex. city)"}),S.jsx("li",{children:"Y-axis - Number (ex. population)"})]})]})]})}),S.jsx("section",{className:"",children:S.jsx(aA,{})}),S.jsx("div",{children:S.jsx(lA,{})}),S.jsx("div",{children:S.jsx(cA,{})})]})}function Mre(){const e=_e(t=>t.card.type);return S.jsx(Sl,{className:" text-sm h-full w-full ",children:e==="stackedBar"?S.jsx(kre,{}):S.jsx(Pre,{})})}function Dre(){const e=_e(t=>t.isShowingVisual);return S.jsxs(fM,{direction:"vertical",className:"min-w-full max-w-lg min-h-[250px] border-y",children:[S.jsx(Ep,{minSize:30,defaultSize:35,children:S.jsx(hne,{})}),S.jsx(hM,{}),S.jsx(Ep,{minSize:60,defaultSize:75,children:e?S.jsxs(fM,{direction:"horizontal",children:[S.jsx(S.Fragment,{children:S.jsx(Ep,{className:"flex min-w-[275px]",minSize:20,defaultSize:25,maxSize:30,children:S.jsx(Mre,{})})}),S.jsx(hM,{}),S.jsx(Ep,{minSize:40,defaultSize:70,maxSize:100,children:S.jsx(jT,{})})]}):S.jsx(jT,{})})]})}function Tre({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=xe(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]),S.jsxs(pk,{children:[S.jsx(gk,{className:"border rounded-none border-y-2 border-l-2 border-muted",children:S.jsx(zk,{})}),S.jsx(mk,{className:"border rounded-none border-r-2 border-muted",children:S.jsx(Dre,{})})]})}function Are(){xe(s=>s.selectedCardId);const e=xe(s=>s.selectedSheetId),t=xe(s=>s.actions.setIsVisualEditing);xe(s=>s.actions.setIsEditorSaveEvent);const n=xe(s=>s.isVisualEditing);xe(s=>s.actions.getSelectedCard());const r=xe(s=>s.actions.updateCard);function i(s){e&&(r(e,s),t(!1))}function o(){t(!1)}return S.jsx("div",{className:`grow flex ${n?"block":"hidden"}`,children:S.jsx(Tre,{onSave:i,onClose:o})})}function Ire({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=xe(f=>f.dashboard.filters)||[],a=xe(f=>f.actions.addFilter),l=xe(f=>f.actions.removeFilter),c=xe(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=y0(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:ph(),column:f.column_name,title:f.column_name,dataType:f.data_type,table:"api",database:"NA",connectionId:n,sql:Tu.includes(f.data_type)?y:v});return}if(!n||!r||!o)throw new Error("missing connectionId, database, or table");a({id:ph(),column:f.column_name,title:f.column_name,dataType:f.data_type,table:o,database:r,connectionId:n,sql:Tu.includes(f.data_type)?y:v})}}return S.jsx(Sl,{className:" h-[70vh] mt-2",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 S.jsx("div",{onClick:()=>d(f),className:Oe(" 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:S.jsxs("div",{className:"flex items-center gap-2 ",children:[S.jsx(jk,{column:f}),S.jsx("span",{children:f.column_name})]})},f.column_name)})})}function Rre(){xe(t=>t.showFilters);const e=xe(t=>t.actions.setShowFilters);return S.jsxs("section",{className:" relative space-y-4 py-0 px-4 bg-red-x100",children:[S.jsx(dt,{onClick:()=>e(!1),className:" p-0 h-7 w-7 absolute top-0 right-4",variant:"outline",children:S.jsx(bu,{})}),S.jsx("p",{className:"text-md",children:"Data Columns"}),S.jsx("div",{children:S.jsx(zk,{ColumnsComponent:(t,n,r)=>S.jsx(Ire,{schemaName:t,tableName:n,columns:r})})})]})}function Nre(){const e=xe(n=>n.showFilters),t=xe(n=>n.isVisualEditing);return S.jsxs("div",{role:"dashboard-plus-main",className:` flex grow ${t?"hidden":"block"} `,children:[S.jsx("div",{role:"dashboard-tabs-container",className:" flex grow",children:S.jsx(jO,{})}),e&&S.jsx("div",{role:"filter-aside-container",className:" border min-h-[80vh] w-[300px]",children:S.jsx(Rre,{})})]})}function Lre(){const e=xe(r=>r.dashboard),t=xe(r=>r.actions.setDashboard),n=xe(r=>r.showDashboardJSON);return xe(r=>r.actions.setShowDashboardJSON),S.jsx("div",{className:Oe(" p-2",{hidden:!n}),children:S.jsx(kM,{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 $re({showControls:e=!1,showFooter:t=!0,...n}){return xe(r=>r.isVisualEditing),S.jsxs(BO,{children:[e&&S.jsx(VY,{}),S.jsx(Lre,{}),S.jsxs($w,{...n,children:[S.jsx(Are,{}),S.jsx(Nre,{})]})]})}function Fre(){const e=xe(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}}ht.Dashboard=_G,ht.DashboardPlus=$re,ht.cleanCard=hk,ht.getDashbaordStateWithoutData=fk,ht.useActions=Fre,ht.useDashboardStore=xe,Object.defineProperty(ht,Symbol.toStringTag,{value:"Module"})});
|