1mpacto-react-ui 0.0.87 → 0.0.89
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/style.css +1 -1
- package/dist/index.cjs +14 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +332 -328
- package/dist/index.mjs.map +1 -1
- package/dist/src/interfaces/components/Badges/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
@@ -18,11 +18,11 @@
|
|
18
18
|
`+G+M}}var re=!1,fe;{var le=typeof WeakMap=="function"?WeakMap:Map;fe=new le}function z(M,X){if(!M||re)return"";{var Q=fe.get(M);if(Q!==void 0)return Q}var me;re=!0;var Me=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var ze;ze=N.current,N.current=null,q();try{if(X){var Ie=function(){throw Error()};if(Object.defineProperty(Ie.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ie,[])}catch(Lt){me=Lt}Reflect.construct(M,[],Ie)}else{try{Ie.call()}catch(Lt){me=Lt}M.call(Ie.prototype)}}else{try{throw Error()}catch(Lt){me=Lt}M()}}catch(Lt){if(Lt&&me&&typeof Lt.stack=="string"){for(var we=Lt.stack.split(`
|
19
19
|
`),Pt=me.stack.split(`
|
20
20
|
`),ct=we.length-1,ft=Pt.length-1;ct>=1&&ft>=0&&we[ct]!==Pt[ft];)ft--;for(;ct>=1&&ft>=0;ct--,ft--)if(we[ct]!==Pt[ft]){if(ct!==1||ft!==1)do if(ct--,ft--,ft<0||we[ct]!==Pt[ft]){var cn=`
|
21
|
-
`+we[ct].replace(" at new "," at ");return M.displayName&&cn.includes("<anonymous>")&&(cn=cn.replace("<anonymous>",M.displayName)),typeof M=="function"&&fe.set(M,cn),cn}while(ct>=1&&ft>=0);break}}}finally{re=!1,N.current=ze,Y(),Error.prepareStackTrace=Me}var Ai=M?M.displayName||M.name:"",Hr=Ai?J(Ai):"";return typeof M=="function"&&fe.set(M,Hr),Hr}function Ae(M,X,Q){return z(M,!1)}function ke(M){var X=M.prototype;return!!(X&&X.isReactComponent)}function Xe(M,X,Q){if(M==null)return"";if(typeof M=="function")return z(M,ke(M));if(typeof M=="string")return J(M);switch(M){case u:return J("Suspense");case c:return J("SuspenseList")}if(typeof M=="object")switch(M.$$typeof){case l:return Ae(M.render);case d:return Xe(M.type,X,Q);case f:{var me=M,Me=me._payload,ze=me._init;try{return Xe(ze(Me),X,Q)}catch{}}}return""}var
|
21
|
+
`+we[ct].replace(" at new "," at ");return M.displayName&&cn.includes("<anonymous>")&&(cn=cn.replace("<anonymous>",M.displayName)),typeof M=="function"&&fe.set(M,cn),cn}while(ct>=1&&ft>=0);break}}}finally{re=!1,N.current=ze,Y(),Error.prepareStackTrace=Me}var Ai=M?M.displayName||M.name:"",Hr=Ai?J(Ai):"";return typeof M=="function"&&fe.set(M,Hr),Hr}function Ae(M,X,Q){return z(M,!1)}function ke(M){var X=M.prototype;return!!(X&&X.isReactComponent)}function Xe(M,X,Q){if(M==null)return"";if(typeof M=="function")return z(M,ke(M));if(typeof M=="string")return J(M);switch(M){case u:return J("Suspense");case c:return J("SuspenseList")}if(typeof M=="object")switch(M.$$typeof){case l:return Ae(M.render);case d:return Xe(M.type,X,Q);case f:{var me=M,Me=me._payload,ze=me._init;try{return Xe(ze(Me),X,Q)}catch{}}}return""}var et=Object.prototype.hasOwnProperty,ee={},ne=b.ReactDebugCurrentFrame;function he(M){if(M){var X=M._owner,Q=Xe(M.type,M._source,X?X.type:null);ne.setExtraStackFrame(Q)}else ne.setExtraStackFrame(null)}function Oe(M,X,Q,me,Me){{var ze=Function.call.bind(et);for(var Ie in M)if(ze(M,Ie)){var we=void 0;try{if(typeof M[Ie]!="function"){var Pt=Error((me||"React class")+": "+Q+" type `"+Ie+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof M[Ie]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Pt.name="Invariant Violation",Pt}we=M[Ie](X,Ie,me,Q,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(ct){we=ct}we&&!(we instanceof Error)&&(he(Me),v("%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).",me||"React class",Q,Ie,typeof we),he(null)),we instanceof Error&&!(we.message in ee)&&(ee[we.message]=!0,he(Me),v("Failed %s type: %s",Q,we.message),he(null))}}}var ut=Array.isArray;function Se(M){return ut(M)}function xe(M){{var X=typeof Symbol=="function"&&Symbol.toStringTag,Q=X&&M[Symbol.toStringTag]||M.constructor.name||"Object";return Q}}function Vt(M){try{return Ot(M),!1}catch{return!0}}function Ot(M){return""+M}function Nt(M){if(Vt(M))return v("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",xe(M)),Ot(M)}var un=b.ReactCurrentOwner,Ch={key:!0,ref:!0,__self:!0,__source:!0},Qo,$i,va;va={};function D3(M){if(et.call(M,"ref")){var X=Object.getOwnPropertyDescriptor(M,"ref").get;if(X&&X.isReactWarning)return!1}return M.ref!==void 0}function S3(M){if(et.call(M,"key")){var X=Object.getOwnPropertyDescriptor(M,"key").get;if(X&&X.isReactWarning)return!1}return M.key!==void 0}function I3(M,X){if(typeof M.ref=="string"&&un.current&&X&&un.current.stateNode!==X){var Q=k(un.current.type);va[Q]||(v('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(un.current.type),M.ref),va[Q]=!0)}}function E3(M,X){{var Q=function(){Qo||(Qo=!0,v("%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)",X))};Q.isReactWarning=!0,Object.defineProperty(M,"key",{get:Q,configurable:!0})}}function _3(M,X){{var Q=function(){$i||($i=!0,v("%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)",X))};Q.isReactWarning=!0,Object.defineProperty(M,"ref",{get:Q,configurable:!0})}}var $3=function(M,X,Q,me,Me,ze,Ie){var we={$$typeof:t,type:M,key:X,ref:Q,props:Ie,_owner:ze};return we._store={},Object.defineProperty(we._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(we,"_self",{configurable:!1,enumerable:!1,writable:!1,value:me}),Object.defineProperty(we,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Me}),Object.freeze&&(Object.freeze(we.props),Object.freeze(we)),we};function R3(M,X,Q,me,Me){{var ze,Ie={},we=null,Pt=null;Q!==void 0&&(Nt(Q),we=""+Q),S3(X)&&(Nt(X.key),we=""+X.key),D3(X)&&(Pt=X.ref,I3(X,Me));for(ze in X)et.call(X,ze)&&!Ch.hasOwnProperty(ze)&&(Ie[ze]=X[ze]);if(M&&M.defaultProps){var ct=M.defaultProps;for(ze in ct)Ie[ze]===void 0&&(Ie[ze]=ct[ze])}if(we||Pt){var ft=typeof M=="function"?M.displayName||M.name||"Unknown":M;we&&E3(Ie,ft),Pt&&_3(Ie,ft)}return $3(M,we,Pt,Me,me,un.current,Ie)}}var Eu=b.ReactCurrentOwner,wh=b.ReactDebugCurrentFrame;function Ri(M){if(M){var X=M._owner,Q=Xe(M.type,M._source,X?X.type:null);wh.setExtraStackFrame(Q)}else wh.setExtraStackFrame(null)}var _u;_u=!1;function $u(M){return typeof M=="object"&&M!==null&&M.$$typeof===t}function Dh(){{if(Eu.current){var M=k(Eu.current.type);if(M)return`
|
22
22
|
|
23
23
|
Check the render method of \``+M+"`."}return""}}function A3(M){return""}var Sh={};function F3(M){{var X=Dh();if(!X){var Q=typeof M=="string"?M:M.displayName||M.name;Q&&(X=`
|
24
24
|
|
25
|
-
Check the top-level render call using <`+Q+">.")}return X}}function Ih(M,X){{if(!M._store||M._store.validated||M.key!=null)return;M._store.validated=!0;var Q=F3(X);if(Sh[Q])return;Sh[Q]=!0;var me="";M&&M._owner&&M._owner!==Eu.current&&(me=" It was passed a child from "+k(M._owner.type)+"."),Ri(M),v('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',Q,me),Ri(null)}}function Eh(M,X){{if(typeof M!="object")return;if(Se(M))for(var Q=0;Q<M.length;Q++){var me=M[Q];$u(me)&&Ih(me,X)}else if($u(M))M._store&&(M._store.validated=!0);else if(M){var Me=p(M);if(typeof Me=="function"&&Me!==M.entries)for(var ze=Me.call(M),Ie;!(Ie=ze.next()).done;)$u(Ie.value)&&Ih(Ie.value,X)}}}function P3(M){{var X=M.type;if(X==null||typeof X=="string")return;var Q;if(typeof X=="function")Q=X.propTypes;else if(typeof X=="object"&&(X.$$typeof===l||X.$$typeof===d))Q=X.propTypes;else return;if(Q){var me=k(X);Oe(Q,M.props,"prop",me,M)}else if(X.PropTypes!==void 0&&!_u){_u=!0;var Me=k(X);v("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Me||"Unknown")}typeof X.getDefaultProps=="function"&&!X.getDefaultProps.isReactClassApproved&&v("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function T3(M){{for(var X=Object.keys(M.props),Q=0;Q<X.length;Q++){var me=X[Q];if(me!=="children"&&me!=="key"){Ri(M),v("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",me),Ri(null);break}}M.ref!==null&&(Ri(M),v("Invalid attribute `ref` supplied to `React.Fragment`."),Ri(null))}}var _h={};function $h(M,X,Q,me,Me,ze){{var Ie=F(M);if(!Ie){var we="";(M===void 0||typeof M=="object"&&M!==null&&Object.keys(M).length===0)&&(we+=" 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 Pt=A3();Pt?we+=Pt:we+=Dh();var ct;M===null?ct="null":Se(M)?ct="array":M!==void 0&&M.$$typeof===t?(ct="<"+(k(M.type)||"Unknown")+" />",we=" Did you accidentally export a JSX literal instead of a component?"):ct=typeof M,v("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",ct,we)}var ft=R3(M,X,Q,Me,ze);if(ft==null)return ft;if(Ie){var cn=X.children;if(cn!==void 0)if(me)if(Se(cn)){for(var Ai=0;Ai<cn.length;Ai++)Eh(cn[Ai],M);Object.freeze&&Object.freeze(cn)}else v("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 Eh(cn,M)}if(
|
25
|
+
Check the top-level render call using <`+Q+">.")}return X}}function Ih(M,X){{if(!M._store||M._store.validated||M.key!=null)return;M._store.validated=!0;var Q=F3(X);if(Sh[Q])return;Sh[Q]=!0;var me="";M&&M._owner&&M._owner!==Eu.current&&(me=" It was passed a child from "+k(M._owner.type)+"."),Ri(M),v('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',Q,me),Ri(null)}}function Eh(M,X){{if(typeof M!="object")return;if(Se(M))for(var Q=0;Q<M.length;Q++){var me=M[Q];$u(me)&&Ih(me,X)}else if($u(M))M._store&&(M._store.validated=!0);else if(M){var Me=p(M);if(typeof Me=="function"&&Me!==M.entries)for(var ze=Me.call(M),Ie;!(Ie=ze.next()).done;)$u(Ie.value)&&Ih(Ie.value,X)}}}function P3(M){{var X=M.type;if(X==null||typeof X=="string")return;var Q;if(typeof X=="function")Q=X.propTypes;else if(typeof X=="object"&&(X.$$typeof===l||X.$$typeof===d))Q=X.propTypes;else return;if(Q){var me=k(X);Oe(Q,M.props,"prop",me,M)}else if(X.PropTypes!==void 0&&!_u){_u=!0;var Me=k(X);v("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Me||"Unknown")}typeof X.getDefaultProps=="function"&&!X.getDefaultProps.isReactClassApproved&&v("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function T3(M){{for(var X=Object.keys(M.props),Q=0;Q<X.length;Q++){var me=X[Q];if(me!=="children"&&me!=="key"){Ri(M),v("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",me),Ri(null);break}}M.ref!==null&&(Ri(M),v("Invalid attribute `ref` supplied to `React.Fragment`."),Ri(null))}}var _h={};function $h(M,X,Q,me,Me,ze){{var Ie=F(M);if(!Ie){var we="";(M===void 0||typeof M=="object"&&M!==null&&Object.keys(M).length===0)&&(we+=" 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 Pt=A3();Pt?we+=Pt:we+=Dh();var ct;M===null?ct="null":Se(M)?ct="array":M!==void 0&&M.$$typeof===t?(ct="<"+(k(M.type)||"Unknown")+" />",we=" Did you accidentally export a JSX literal instead of a component?"):ct=typeof M,v("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",ct,we)}var ft=R3(M,X,Q,Me,ze);if(ft==null)return ft;if(Ie){var cn=X.children;if(cn!==void 0)if(me)if(Se(cn)){for(var Ai=0;Ai<cn.length;Ai++)Eh(cn[Ai],M);Object.freeze&&Object.freeze(cn)}else v("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 Eh(cn,M)}if(et.call(X,"key")){var Hr=k(M),Lt=Object.keys(X).filter(function(N3){return N3!=="key"}),Ru=Lt.length>0?"{key: someKey, "+Lt.join(": ..., ")+": ...}":"{key: someKey}";if(!_h[Hr+Ru]){var O3=Lt.length>0?"{"+Lt.join(": ..., ")+": ...}":"{}";v(`A props object containing a "key" prop is being spread into JSX:
|
26
26
|
let props = %s;
|
27
27
|
<%s {...props} />
|
28
28
|
React keys must be passed directly to JSX without using spread:
|
@@ -41,7 +41,7 @@ React keys must be passed directly to JSX without using spread:
|
|
41
41
|
${u?_e.loading:""} ${s??""}`,type:d,disabled:f??u,...h,children:[!u&&S.jsxs(S.Fragment,{children:[typeof i=="function"&&i(),x.isValidElement(i)&&i]}),u&&S.jsx(Aw,{className:`${g.loadingSize[n]} ${l}`}),o,!u&&S.jsxs(S.Fragment,{children:[typeof a=="function"&&a(),x.isValidElement(a)&&a]})]})});Hn.displayName="Button";function Br(e){return M0(e)?(e.nodeName||"").toLowerCase():"#document"}function nn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function gr(e){var t;return(t=(M0(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function M0(e){return e instanceof Node||e instanceof nn(e).Node}function rt(e){return e instanceof Element||e instanceof nn(e).Element}function vt(e){return e instanceof HTMLElement||e instanceof nn(e).HTMLElement}function Pc(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof nn(e).ShadowRoot}function Mo(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=vn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function Fw(e){return["table","td","th"].includes(Br(e))}function ql(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Nd(e){const t=Ld(),n=vn(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 Pw(e){let t=fr(e);for(;vt(t)&&!Ar(t);){if(ql(t))return null;if(Nd(t))return t;t=fr(t)}return null}function Ld(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ar(e){return["html","body","#document"].includes(Br(e))}function vn(e){return nn(e).getComputedStyle(e)}function eu(e){return rt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function fr(e){if(Br(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Pc(e)&&e.host||gr(e);return Pc(t)?t.host:t}function B0(e){const t=fr(e);return Ar(t)?e.ownerDocument?e.ownerDocument.body:e.body:vt(t)&&Mo(t)?t:B0(t)}function $r(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=B0(e),a=i===((r=e.ownerDocument)==null?void 0:r.body),o=nn(i);return a?t.concat(o,o.visualViewport||[],Mo(i)?i:[],o.frameElement&&n?$r(o.frameElement):[]):t.concat(i,$r(i,[],n))}function Kr(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function Kt(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Pc(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Tw(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function V0(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function kw(e){return e.mozInputSource===0&&e.isTrusted?!0:Tc()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Mw(e){return Vw()?!1:!Tc()&&e.width===0&&e.height===0||Tc()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function Bw(){return/apple/i.test(navigator.vendor)}function Tc(){const e=/android/i;return e.test(Tw())||e.test(V0())}function Vw(){return V0().includes("jsdom/")}function Nh(e,t){return["mouse","pen"].includes(e)}function Ow(e){return"nativeEvent"in e}function Nw(e){return e.matches("html,body")}function xn(e){return(e==null?void 0:e.ownerDocument)||document}function Fu(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function ti(e){return"composedPath"in e?e.composedPath()[0]:e.target}const Lw="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function O0(e){return vt(e)&&e.matches(Lw)}function Pu(e){e.preventDefault(),e.stopPropagation()}function jw(e){return e?e.getAttribute("role")==="combobox"&&O0(e):!1}const Hw=["top","right","bottom","left"],Lh=["start","end"],jh=Hw.reduce((e,t)=>e.concat(t,t+"-"+Lh[0],t+"-"+Lh[1]),[]),il=Math.min,ui=Math.max,al=Math.round,ns=Math.floor,Fr=e=>({x:e,y:e}),Ww={left:"right",right:"left",bottom:"top",top:"bottom"},zw={start:"end",end:"start"};function Hh(e,t,n){return ui(e,il(t,n))}function Bo(e,t){return typeof e=="function"?e(t):e}function hr(e){return e.split("-")[0]}function cr(e){return e.split("-")[1]}function N0(e){return e==="x"?"y":"x"}function L0(e){return e==="y"?"height":"width"}function ia(e){return["top","bottom"].includes(hr(e))?"y":"x"}function j0(e){return N0(ia(e))}function H0(e,t,n){n===void 0&&(n=!1);const r=cr(e),i=j0(e),a=L0(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=sl(o)),[o,sl(o)]}function Gw(e){const t=sl(e);return[ol(e),t,ol(t)]}function ol(e){return e.replace(/start|end/g,t=>zw[t])}function Zw(e,t,n){const r=["left","right"],i=["right","left"],a=["top","bottom"],o=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?a:o;default:return[]}}function Xw(e,t,n,r){const i=cr(e);let a=Zw(hr(e),n==="start",r);return i&&(a=a.map(o=>o+"-"+i),t&&(a=a.concat(a.map(ol)))),a}function sl(e){return e.replace(/left|right|bottom|top/g,t=>Ww[t])}function Yw(e){return{top:0,right:0,bottom:0,left:0,...e}}function Uw(e){return typeof e!="number"?Yw(e):{top:e,right:e,bottom:e,left:e}}function ll(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}/*!
|
42
42
|
* tabbable 6.2.0
|
43
43
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
44
|
-
*/var Jw=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],ul=Jw.join(","),W0=typeof Element>"u",aa=W0?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,cl=!W0&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},dl=function e(t,n){var r;n===void 0&&(n=!0);var i=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),a=i===""||i==="true",o=a||n&&t&&e(t.parentNode);return o},Kw=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},Qw=function(t,n,r){if(dl(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(ul));return n&&aa.call(t,ul)&&i.unshift(t),i=i.filter(r),i},qw=function e(t,n,r){for(var i=[],a=Array.from(t);a.length;){var o=a.shift();if(!dl(o,!1))if(o.tagName==="SLOT"){var s=o.assignedElements(),l=s.length?s:o.children,u=e(l,!0,r);r.flatten?i.push.apply(i,u):i.push({scopeParent:o,candidates:u})}else{var c=aa.call(o,ul);c&&r.filter(o)&&(n||!t.includes(o))&&i.push(o);var d=o.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(o),f=!dl(d,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(o));if(d&&f){var h=e(d===!0?o.children:d.children,!0,r);r.flatten?i.push.apply(i,h):i.push({scopeParent:o,candidates:h})}else a.unshift.apply(a,o.children)}}return i},z0=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},G0=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||Kw(t))&&!z0(t)?0:t.tabIndex},eD=function(t,n){var r=G0(t);return r<0&&n&&!z0(t)?0:r},tD=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Z0=function(t){return t.tagName==="INPUT"},nD=function(t){return Z0(t)&&t.type==="hidden"},rD=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},iD=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},aD=function(t){if(!t.name)return!0;var n=t.form||cl(t),r=function(s){return n.querySelectorAll('input[type="radio"][name="'+s+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=r(window.CSS.escape(t.name));else try{i=r(t.name)}catch(o){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",o.message),!1}var a=iD(i,t.form);return!a||a===t},oD=function(t){return Z0(t)&&t.type==="radio"},sD=function(t){return oD(t)&&!aD(t)},lD=function(t){var n,r=t&&cl(t),i=(n=r)===null||n===void 0?void 0:n.host,a=!1;if(r&&r!==t){var o,s,l;for(a=!!((o=i)!==null&&o!==void 0&&(s=o.ownerDocument)!==null&&s!==void 0&&s.contains(i)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!a&&i;){var u,c,d;r=cl(i),i=(u=r)===null||u===void 0?void 0:u.host,a=!!((c=i)!==null&&c!==void 0&&(d=c.ownerDocument)!==null&&d!==void 0&&d.contains(i))}}return a},Wh=function(t){var n=t.getBoundingClientRect(),r=n.width,i=n.height;return r===0&&i===0},uD=function(t,n){var r=n.displayCheck,i=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var a=aa.call(t,"details>summary:first-of-type"),o=a?t.parentElement:t;if(aa.call(o,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof i=="function"){for(var s=t;t;){var l=t.parentElement,u=cl(t);if(l&&!l.shadowRoot&&i(l)===!0)return Wh(t);t.assignedSlot?t=t.assignedSlot:!l&&u!==t.ownerDocument?t=u.host:t=l}t=s}if(lD(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Wh(t);return!1},cD=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var i=n.children.item(r);if(i.tagName==="LEGEND")return aa.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},dD=function(t,n){return!(n.disabled||dl(n)||nD(n)||uD(n,t)||rD(n)||cD(n))},kc=function(t,n){return!(sD(n)||G0(n)<0||!dD(t,n))},fD=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},hD=function e(t){var n=[],r=[];return t.forEach(function(i,a){var o=!!i.scopeParent,s=o?i.scopeParent:i,l=eD(s,o),u=o?e(i.candidates):s;l===0?o?n.push.apply(n,u):n.push(s):r.push({documentOrder:a,tabIndex:l,item:i,isScope:o,content:u})}),r.sort(tD).reduce(function(i,a){return a.isScope?i.push.apply(i,a.content):i.push(a.content),i},[]).concat(n)},tu=function(t,n){n=n||{};var r;return n.getShadowRoot?r=qw([t],n.includeContainer,{filter:kc.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:fD}):r=Qw(t,n.includeContainer,kc.bind(null,n)),hD(r)},gD=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return aa.call(t,ul)===!1?!1:kc(n,t)};function zh(e,t,n){let{reference:r,floating:i}=e;const a=ia(t),o=j0(t),s=L0(o),l=hr(t),u=a==="y",c=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2;let h;switch(l){case"top":h={x:c,y:r.y-i.height};break;case"bottom":h={x:c,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-i.width,y:d};break;default:h={x:r.x,y:r.y}}switch(cr(t)){case"start":h[o]-=f*(n&&u?-1:1);break;case"end":h[o]+=f*(n&&u?-1:1);break}return h}const mD=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:a=[],platform:o}=n,s=a.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:d}=zh(u,r,l),f=r,h={},g=0;for(let m=0;m<s.length;m++){const{name:p,fn:b}=s[m],{x:v,y,data:C,reset:w}=await b({x:c,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:h,rects:u,platform:o,elements:{reference:e,floating:t}});c=v??c,d=y??d,h={...h,[p]:{...h[p],...C}},w&&g<=50&&(g++,typeof w=="object"&&(w.placement&&(f=w.placement),w.rects&&(u=w.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):w.rects),{x:c,y:d}=zh(u,f,l)),m=-1)}return{x:c,y:d,placement:f,strategy:i,middlewareData:h}};async function jd(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:a,rects:o,elements:s,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=Bo(t,e),g=Uw(h),p=s[f?d==="floating"?"reference":"floating":d],b=ll(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(p)))==null||n?p:p.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:u,rootBoundary:c,strategy:l})),v=d==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,y=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),C=await(a.isElement==null?void 0:a.isElement(y))?await(a.getScale==null?void 0:a.getScale(y))||{x:1,y:1}:{x:1,y:1},w=ll(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:y,strategy:l}):v);return{top:(b.top-w.top+g.top)/C.y,bottom:(w.bottom-b.bottom+g.bottom)/C.y,left:(b.left-w.left+g.left)/C.x,right:(w.right-b.right+g.right)/C.x}}function pD(e,t,n){return(e?[...n.filter(i=>cr(i)===e),...n.filter(i=>cr(i)!==e)]:n.filter(i=>hr(i)===i)).filter(i=>e?cr(i)===e||(t?ol(i)!==i:!1):!0)}const bD=function(e){return e===void 0&&(e={}),{name:"autoPlacement",options:e,async fn(t){var n,r,i;const{rects:a,middlewareData:o,placement:s,platform:l,elements:u}=t,{crossAxis:c=!1,alignment:d,allowedPlacements:f=jh,autoAlignment:h=!0,...g}=Bo(e,t),m=d!==void 0||f===jh?pD(d||null,h,f):f,p=await jd(t,g),b=((n=o.autoPlacement)==null?void 0:n.index)||0,v=m[b];if(v==null)return{};const y=H0(v,a,await(l.isRTL==null?void 0:l.isRTL(u.floating)));if(s!==v)return{reset:{placement:m[0]}};const C=[p[hr(v)],p[y[0]],p[y[1]]],w=[...((r=o.autoPlacement)==null?void 0:r.overflows)||[],{placement:v,overflows:C}],I=m[b+1];if(I)return{data:{index:b+1,overflows:w},reset:{placement:I}};const E=w.map(F=>{const _=cr(F.placement);return[F.placement,_&&c?F.overflows.slice(0,2).reduce((P,k)=>P+k,0):F.overflows[0],F.overflows]}).sort((F,_)=>F[1]-_[1]),$=((i=E.filter(F=>F[2].slice(0,cr(F[0])?2:3).every(_=>_<=0))[0])==null?void 0:i[0])||E[0][0];return $!==s?{data:{index:b+1,overflows:w},reset:{placement:$}}:{}}}},vD=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:a,rects:o,initialPlacement:s,platform:l,elements:u}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:m=!0,...p}=Bo(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const b=hr(i),v=ia(s),y=hr(s)===s,C=await(l.isRTL==null?void 0:l.isRTL(u.floating)),w=f||(y||!m?[sl(s)]:Gw(s)),I=g!=="none";!f&&I&&w.push(...Xw(s,m,g,C));const E=[s,...w],D=await jd(t,p),$=[];let F=((r=a.flip)==null?void 0:r.overflows)||[];if(c&&$.push(D[b]),d){const A=H0(i,o,C);$.push(D[A[0]],D[A[1]])}if(F=[...F,{placement:i,overflows:$}],!$.every(A=>A<=0)){var _,P;const A=(((_=a.flip)==null?void 0:_.index)||0)+1,B=E[A];if(B)return{data:{index:A,overflows:F},reset:{placement:B}};let T=(P=F.filter(R=>R.overflows[0]<=0).sort((R,V)=>R.overflows[1]-V.overflows[1])[0])==null?void 0:P.placement;if(!T)switch(h){case"bestFit":{var k;const R=(k=F.filter(V=>{if(I){const H=ia(V.placement);return H===v||H==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(H=>H>0).reduce((H,L)=>H+L,0)]).sort((V,H)=>V[1]-H[1])[0])==null?void 0:k[0];R&&(T=R);break}case"initialPlacement":T=s;break}if(i!==T)return{reset:{placement:T}}}return{}}}};async function yD(e,t){const{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=hr(n),s=cr(n),l=ia(n)==="y",u=["left","top"].includes(o)?-1:1,c=a&&l?-1:1,d=Bo(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return s&&typeof g=="number"&&(h=s==="end"?g*-1:g),l?{x:h*c,y:f*u}:{x:f*u,y:h*c}}const xD=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:a,placement:o,middlewareData:s}=t,l=await yD(t,e);return o===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:a+l.y,data:{...l,placement:o}}}}},CD=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:s={fn:p=>{let{x:b,y:v}=p;return{x:b,y:v}}},...l}=Bo(e,t),u={x:n,y:r},c=await jd(t,l),d=ia(hr(i)),f=N0(d);let h=u[f],g=u[d];if(a){const p=f==="y"?"top":"left",b=f==="y"?"bottom":"right",v=h+c[p],y=h-c[b];h=Hh(v,h,y)}if(o){const p=d==="y"?"top":"left",b=d==="y"?"bottom":"right",v=g+c[p],y=g-c[b];g=Hh(v,g,y)}const m=s.fn({...t,[f]:h,[d]:g});return{...m,data:{x:m.x-n,y:m.y-r}}}}};function X0(e){const t=vn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=vt(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=al(n)!==a||al(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Hd(e){return rt(e)?e:e.contextElement}function Yi(e){const t=Hd(e);if(!vt(t))return Fr(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:a}=X0(t);let o=(a?al(n.width):n.width)/r,s=(a?al(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}const wD=Fr(0);function Y0(e){const t=nn(e);return!Ld()||!t.visualViewport?wD:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function DD(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==nn(e)?!1:t}function hi(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),a=Hd(e);let o=Fr(1);t&&(r?rt(r)&&(o=Yi(r)):o=Yi(e));const s=DD(a,n,r)?Y0(a):Fr(0);let l=(i.left+s.x)/o.x,u=(i.top+s.y)/o.y,c=i.width/o.x,d=i.height/o.y;if(a){const f=nn(a),h=r&&rt(r)?nn(r):r;let g=f,m=g.frameElement;for(;m&&r&&h!==g;){const p=Yi(m),b=m.getBoundingClientRect(),v=vn(m),y=b.left+(m.clientLeft+parseFloat(v.paddingLeft))*p.x,C=b.top+(m.clientTop+parseFloat(v.paddingTop))*p.y;l*=p.x,u*=p.y,c*=p.x,d*=p.y,l+=y,u+=C,g=nn(m),m=g.frameElement}}return ll({width:c,height:d,x:l,y:u})}function SD(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const a=i==="fixed",o=gr(r),s=t?ql(t.floating):!1;if(r===o||s&&a)return n;let l={scrollLeft:0,scrollTop:0},u=Fr(1);const c=Fr(0),d=vt(r);if((d||!d&&!a)&&((Br(r)!=="body"||Mo(o))&&(l=eu(r)),vt(r))){const f=hi(r);u=Yi(r),c.x=f.x+r.clientLeft,c.y=f.y+r.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x,y:n.y*u.y-l.scrollTop*u.y+c.y}}function ID(e){return Array.from(e.getClientRects())}function U0(e){return hi(gr(e)).left+eu(e).scrollLeft}function ED(e){const t=gr(e),n=eu(e),r=e.ownerDocument.body,i=ui(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=ui(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+U0(e);const s=-n.scrollTop;return vn(r).direction==="rtl"&&(o+=ui(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}function _D(e,t){const n=nn(e),r=gr(e),i=n.visualViewport;let a=r.clientWidth,o=r.clientHeight,s=0,l=0;if(i){a=i.width,o=i.height;const u=Ld();(!u||u&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:a,height:o,x:s,y:l}}function $D(e,t){const n=hi(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=vt(e)?Yi(e):Fr(1),o=e.clientWidth*a.x,s=e.clientHeight*a.y,l=i*a.x,u=r*a.y;return{width:o,height:s,x:l,y:u}}function Gh(e,t,n){let r;if(t==="viewport")r=_D(e,n);else if(t==="document")r=ED(gr(e));else if(rt(t))r=$D(t,n);else{const i=Y0(e);r={...t,x:t.x-i.x,y:t.y-i.y}}return ll(r)}function J0(e,t){const n=fr(e);return n===t||!rt(n)||Ar(n)?!1:vn(n).position==="fixed"||J0(n,t)}function RD(e,t){const n=t.get(e);if(n)return n;let r=$r(e,[],!1).filter(s=>rt(s)&&Br(s)!=="body"),i=null;const a=vn(e).position==="fixed";let o=a?fr(e):e;for(;rt(o)&&!Ar(o);){const s=vn(o),l=Nd(o);!l&&s.position==="fixed"&&(i=null),(a?!l&&!i:!l&&s.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Mo(o)&&!l&&J0(e,o))?r=r.filter(c=>c!==o):i=s,o=fr(o)}return t.set(e,r),r}function AD(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?ql(t)?[]:RD(t,this._c):[].concat(n),r],s=o[0],l=o.reduce((u,c)=>{const d=Gh(t,c,i);return u.top=ui(d.top,u.top),u.right=il(d.right,u.right),u.bottom=il(d.bottom,u.bottom),u.left=ui(d.left,u.left),u},Gh(t,s,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function FD(e){const{width:t,height:n}=X0(e);return{width:t,height:n}}function PD(e,t,n){const r=vt(t),i=gr(t),a=n==="fixed",o=hi(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const l=Fr(0);if(r||!r&&!a)if((Br(t)!=="body"||Mo(i))&&(s=eu(t)),r){const d=hi(t,!0,a,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else i&&(l.x=U0(i));const u=o.left+s.scrollLeft-l.x,c=o.top+s.scrollTop-l.y;return{x:u,y:c,width:o.width,height:o.height}}function Tu(e){return vn(e).position==="static"}function Zh(e,t){return!vt(e)||vn(e).position==="fixed"?null:t?t(e):e.offsetParent}function K0(e,t){const n=nn(e);if(ql(e))return n;if(!vt(e)){let i=fr(e);for(;i&&!Ar(i);){if(rt(i)&&!Tu(i))return i;i=fr(i)}return n}let r=Zh(e,t);for(;r&&Fw(r)&&Tu(r);)r=Zh(r,t);return r&&Ar(r)&&Tu(r)&&!Nd(r)?n:r||Pw(e)||n}const TD=async function(e){const t=this.getOffsetParent||K0,n=this.getDimensions,r=await n(e.floating);return{reference:PD(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function kD(e){return vn(e).direction==="rtl"}const MD={convertOffsetParentRelativeRectToViewportRelativeRect:SD,getDocumentElement:gr,getClippingRect:AD,getOffsetParent:K0,getElementRects:TD,getClientRects:ID,getDimensions:FD,getScale:Yi,isElement:rt,isRTL:kD};function BD(e,t){let n=null,r;const i=gr(e);function a(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function o(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),a();const{left:u,top:c,width:d,height:f}=e.getBoundingClientRect();if(s||t(),!d||!f)return;const h=ns(c),g=ns(i.clientWidth-(u+d)),m=ns(i.clientHeight-(c+f)),p=ns(u),v={rootMargin:-h+"px "+-g+"px "+-m+"px "+-p+"px",threshold:ui(0,il(1,l))||1};let y=!0;function C(w){const I=w[0].intersectionRatio;if(I!==l){if(!y)return o();I?o(!1,I):r=setTimeout(()=>{o(!1,1e-7)},1e3)}y=!1}try{n=new IntersectionObserver(C,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(C,v)}n.observe(e)}return o(!0),a}function Q0(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=Hd(e),c=i||a?[...u?$r(u):[],...$r(t)]:[];c.forEach(b=>{i&&b.addEventListener("scroll",n,{passive:!0}),a&&b.addEventListener("resize",n)});const d=u&&s?BD(u,n):null;let f=-1,h=null;o&&(h=new ResizeObserver(b=>{let[v]=b;v&&v.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var y;(y=h)==null||y.observe(t)})),n()}),u&&!l&&h.observe(u),h.observe(t));let g,m=l?hi(e):null;l&&p();function p(){const b=hi(e);m&&(b.x!==m.x||b.y!==m.y||b.width!==m.width||b.height!==m.height)&&n(),m=b,g=requestAnimationFrame(p)}return n(),()=>{var b;c.forEach(v=>{i&&v.removeEventListener("scroll",n),a&&v.removeEventListener("resize",n)}),d==null||d(),(b=h)==null||b.disconnect(),h=null,l&&cancelAnimationFrame(g)}}const VD=xD,OD=bD,ND=CD,LD=vD,jD=(e,t,n)=>{const r=new Map,i={platform:MD,...n},a={...i.platform,_c:r};return mD(e,t,{...i,platform:a})};var Ns=typeof document<"u"?x.useLayoutEffect:x.useEffect;function fl(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(!fl(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 a=i[r];if(!(a==="_owner"&&e.$$typeof)&&!fl(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function q0(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Xh(e,t){const n=q0(e);return Math.round(t*n)/n}function Yh(e){const t=j.useRef(e);return Ns(()=>{t.current=e}),t}function HD(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:l,open:u}=e,[c,d]=j.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,h]=j.useState(r);fl(f,r)||h(r);const[g,m]=j.useState(null),[p,b]=j.useState(null),v=j.useCallback(R=>{R!==I.current&&(I.current=R,m(R))},[]),y=j.useCallback(R=>{R!==E.current&&(E.current=R,b(R))},[]),C=a||g,w=o||p,I=j.useRef(null),E=j.useRef(null),D=j.useRef(c),$=l!=null,F=Yh(l),_=Yh(i),P=j.useCallback(()=>{if(!I.current||!E.current)return;const R={placement:t,strategy:n,middleware:f};_.current&&(R.platform=_.current),jD(I.current,E.current,R).then(V=>{const H={...V,isPositioned:!0};k.current&&!fl(D.current,H)&&(D.current=H,v0.flushSync(()=>{d(H)}))})},[f,t,n,_]);Ns(()=>{u===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,d(R=>({...R,isPositioned:!1})))},[u]);const k=j.useRef(!1);Ns(()=>(k.current=!0,()=>{k.current=!1}),[]),Ns(()=>{if(C&&(I.current=C),w&&(E.current=w),C&&w){if(F.current)return F.current(C,w,P);P()}},[C,w,P,F,$]);const A=j.useMemo(()=>({reference:I,floating:E,setReference:v,setFloating:y}),[v,y]),B=j.useMemo(()=>({reference:C,floating:w}),[C,w]),T=j.useMemo(()=>{const R={position:n,left:0,top:0};if(!B.floating)return R;const V=Xh(B.floating,c.x),H=Xh(B.floating,c.y);return s?{...R,transform:"translate("+V+"px, "+H+"px)",...q0(B.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:V,top:H}},[n,s,B.floating,c.x,c.y]);return j.useMemo(()=>({...c,update:P,refs:A,elements:B,floatingStyles:T}),[c,P,A,B,T])}const WD=(e,t)=>({...VD(e),options:[e,t]}),zD=(e,t)=>({...ND(e),options:[e,t]}),GD=(e,t)=>({...LD(e),options:[e,t]}),ZD=(e,t)=>({...OD(e),options:[e,t]}),eb={...j},XD=eb.useInsertionEffect,YD=XD||(e=>e());function Cr(e){const t=j.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return YD(()=>{t.current=e}),j.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}let Uh=0;function Wr(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(Uh);const a=()=>e==null?void 0:e.focus({preventScroll:n});i?a():Uh=requestAnimationFrame(a)}var zt=typeof document<"u"?x.useLayoutEffect:x.useEffect;function hl(){return hl=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},hl.apply(this,arguments)}let Jh=!1,UD=0;const Kh=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+UD++;function JD(){const[e,t]=j.useState(()=>Jh?Kh():void 0);return zt(()=>{e==null&&t(Kh())},[]),j.useEffect(()=>{Jh=!0},[]),e}const KD=eb.useId,Wd=KD||JD;let Mc;process.env.NODE_ENV!=="production"&&(Mc=new Set);function QD(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const i="Floating UI: "+n.join(" ");if(!((e=Mc)!=null&&e.has(i))){var a;(a=Mc)==null||a.add(i),console.error(i)}}function qD(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(i=>i(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(i=>i!==n))||[])}}}const e5=j.createContext(null),t5=j.createContext(null),tb=()=>{var e;return((e=j.useContext(e5))==null?void 0:e.id)||null},zd=()=>j.useContext(t5);function ro(e){return"data-floating-ui-"+e}function ii(e){const t=x.useRef(e);return zt(()=>{t.current=e}),t}function n5(e,t){var n;let r=[],i=(n=e.find(a=>a.id===t))==null?void 0:n.parentId;for(;i;){const a=e.find(o=>o.id===i);i=a==null?void 0:a.parentId,a&&(r=r.concat(a))}return r}function Wa(e,t){let n=e.filter(i=>{var a;return i.parentId===t&&((a=i.context)==null?void 0:a.open)}),r=n;for(;r.length;)r=e.filter(i=>{var a;return(a=r)==null?void 0:a.some(o=>{var s;return i.parentId===o.id&&((s=i.context)==null?void 0:s.open)})}),n=n.concat(r);return n}let Pi=new WeakMap,rs=new WeakSet,is={},ku=0;const r5=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,nb=e=>e&&(e.host||nb(e.parentNode)),i5=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=nb(n);return e.contains(r)?r:null}).filter(n=>n!=null);function a5(e,t,n,r){const i="data-floating-ui-inert",a=r?"inert":n?"aria-hidden":null,o=i5(t,e),s=new Set,l=new Set(o),u=[];is[i]||(is[i]=new WeakMap);const c=is[i];o.forEach(d),f(t),s.clear();function d(h){!h||s.has(h)||(s.add(h),h.parentNode&&d(h.parentNode))}function f(h){!h||l.has(h)||[].forEach.call(h.children,g=>{if(Br(g)!=="script")if(s.has(g))f(g);else{const m=a?g.getAttribute(a):null,p=m!==null&&m!=="false",b=(Pi.get(g)||0)+1,v=(c.get(g)||0)+1;Pi.set(g,b),c.set(g,v),u.push(g),b===1&&p&&rs.add(g),v===1&&g.setAttribute(i,""),!p&&a&&g.setAttribute(a,"true")}})}return ku++,()=>{u.forEach(h=>{const g=(Pi.get(h)||0)-1,m=(c.get(h)||0)-1;Pi.set(h,g),c.set(h,m),g||(!rs.has(h)&&a&&h.removeAttribute(a),rs.delete(h)),m||h.removeAttribute(i)}),ku--,ku||(Pi=new WeakMap,Pi=new WeakMap,rs=new WeakSet,is={})}}function Qh(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=xn(e[0]).body;return a5(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const io=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function rb(e,t){const n=tu(e,io());t==="prev"&&n.reverse();const r=n.indexOf(Kr(xn(e)));return n.slice(r+1)[0]}function ib(){return rb(document.body,"next")}function ab(){return rb(document.body,"prev")}function za(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Kt(n,r)}function o5(e){tu(e,io()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function s5(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const Gd={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};let l5;function qh(e){e.key==="Tab"&&(e.target,clearTimeout(l5))}const gl=j.forwardRef(function(t,n){const[r,i]=j.useState();zt(()=>(Bw()&&i("button"),document.addEventListener("keydown",qh),()=>{document.removeEventListener("keydown",qh)}),[]);const a={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[ro("focus-guard")]:"",style:Gd};return j.createElement("span",hl({},t,a))}),ob=j.createContext(null),eg=ro("portal");function u5(e){e===void 0&&(e={});const{id:t,root:n}=e,r=Wd(),i=sb(),[a,o]=j.useState(null),s=j.useRef(null);return zt(()=>()=>{a==null||a.remove(),queueMicrotask(()=>{s.current=null})},[a]),zt(()=>{if(!r||s.current)return;const l=t?document.getElementById(t):null;if(!l)return;const u=document.createElement("div");u.id=r,u.setAttribute(eg,""),l.appendChild(u),s.current=u,o(u)},[t,r]),zt(()=>{if(!r||s.current)return;let l=n||(i==null?void 0:i.portalNode);l&&!rt(l)&&(l=l.current),l=l||document.body;let u=null;t&&(u=document.createElement("div"),u.id=t,l.appendChild(u));const c=document.createElement("div");c.id=r,c.setAttribute(eg,""),l=u||l,l.appendChild(c),s.current=c,o(c)},[t,n,r,i]),a}function c5(e){const{children:t,id:n,root:r=null,preserveTabOrder:i=!0}=e,a=u5({id:n,root:r}),[o,s]=j.useState(null),l=j.useRef(null),u=j.useRef(null),c=j.useRef(null),d=j.useRef(null),f=!!o&&!o.modal&&o.open&&i&&!!(r||a);return j.useEffect(()=>{if(!a||!i||o!=null&&o.modal)return;function h(g){a&&za(g)&&(g.type==="focusin"?s5:o5)(a)}return a.addEventListener("focusin",h,!0),a.addEventListener("focusout",h,!0),()=>{a.removeEventListener("focusin",h,!0),a.removeEventListener("focusout",h,!0)}},[a,i,o==null?void 0:o.modal]),j.createElement(ob.Provider,{value:j.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:l,afterOutsideRef:u,beforeInsideRef:c,afterInsideRef:d,portalNode:a,setFocusManagerState:s}),[i,a])},f&&a&&j.createElement(gl,{"data-type":"outside",ref:l,onFocus:h=>{if(za(h,a)){var g;(g=c.current)==null||g.focus()}else{const m=ab()||(o==null?void 0:o.refs.domReference.current);m==null||m.focus()}}}),f&&a&&j.createElement("span",{"aria-owns":a.id,style:Gd}),a&&v0.createPortal(t,a),f&&a&&j.createElement(gl,{"data-type":"outside",ref:u,onFocus:h=>{if(za(h,a)){var g;(g=d.current)==null||g.focus()}else{const m=ib()||(o==null?void 0:o.refs.domReference.current);m==null||m.focus(),o!=null&&o.closeOnFocusOut&&(o==null||o.onOpenChange(!1,h.nativeEvent))}}}))}const sb=()=>j.useContext(ob),tg=20;let Qr=[];function Mu(e){Qr=Qr.filter(n=>n.isConnected);let t=e;if(!(!t||Br(t)==="body")){if(!gD(t,io())){const n=tu(t,io())[0];n&&(t=n)}Qr.push(t),Qr.length>tg&&(Qr=Qr.slice(-tg))}}function ng(){return Qr.slice().reverse().find(e=>e.isConnected)}const d5=j.forwardRef(function(t,n){return j.createElement("button",hl({},t,{type:"button",ref:n,tabIndex:-1,style:Gd}))});function f5(e){const{context:t,children:n,disabled:r=!1,order:i=["content"],guards:a=!0,initialFocus:o=0,returnFocus:s=!0,restoreFocus:l=!1,modal:u=!0,visuallyHiddenDismiss:c=!1,closeOnFocusOut:d=!0}=e,{open:f,refs:h,nodeId:g,onOpenChange:m,events:p,dataRef:b,floatingId:v,elements:{domReference:y,floating:C}}=t,w=typeof o=="number"&&o<0,I=jw(y)&&w,E=r5()?a:!0,D=ii(i),$=ii(o),F=ii(s),_=zd(),P=sb(),k=j.useRef(null),A=j.useRef(null),B=j.useRef(!1),T=j.useRef(!1),R=j.useRef(-1),V=P!=null,H=C==null?void 0:C.firstElementChild,L=(H==null?void 0:H.id)===v?H:C,Z=Cr(function(Y){return Y===void 0&&(Y=L),Y?tu(Y,io()):[]}),O=Cr(Y=>{const N=Z(Y);return D.current.map(G=>y&&G==="reference"?y:L&&G==="floating"?L:N).filter(Boolean).flat()});j.useEffect(()=>{if(r||!u)return;function Y(G){if(G.key==="Tab"){Kt(L,Kr(xn(L)))&&Z().length===0&&!I&&Pu(G);const J=O(),re=ti(G);D.current[0]==="reference"&&re===y&&(Pu(G),G.shiftKey?Wr(J[J.length-1]):Wr(J[1])),D.current[1]==="floating"&&re===L&&G.shiftKey&&(Pu(G),Wr(J[0]))}}const N=xn(L);return N.addEventListener("keydown",Y),()=>{N.removeEventListener("keydown",Y)}},[r,y,L,u,D,I,Z,O]),j.useEffect(()=>{if(r||!C)return;function Y(N){const G=ti(N),re=Z().indexOf(G);re!==-1&&(R.current=re)}return C.addEventListener("focusin",Y),()=>{C.removeEventListener("focusin",Y)}},[r,C,Z]),j.useEffect(()=>{if(r||!d)return;function Y(){T.current=!0,setTimeout(()=>{T.current=!1})}function N(G){const J=G.relatedTarget;queueMicrotask(()=>{const re=!(Kt(y,J)||Kt(C,J)||Kt(J,C)||Kt(P==null?void 0:P.portalNode,J)||J!=null&&J.hasAttribute(ro("focus-guard"))||_&&(Wa(_.nodesRef.current,g).find(fe=>{var le,z;return Kt((le=fe.context)==null?void 0:le.elements.floating,J)||Kt((z=fe.context)==null?void 0:z.elements.domReference,J)})||n5(_.nodesRef.current,g).find(fe=>{var le,z;return((le=fe.context)==null?void 0:le.elements.floating)===J||((z=fe.context)==null?void 0:z.elements.domReference)===J})));if(l&&re&&Kr(xn(L))===xn(L).body){vt(L)&&(L==null||L.focus());const fe=R.current,le=Z(),z=le[fe]||le[le.length-1]||L;vt(z)&&z.focus()}(I||!u)&&J&&re&&!T.current&&J!==ng()&&(B.current=!0,m(!1,G))})}if(C&&vt(y))return y.addEventListener("focusout",N),y.addEventListener("pointerdown",Y),C.addEventListener("focusout",N),()=>{y.removeEventListener("focusout",N),y.removeEventListener("pointerdown",Y),C.removeEventListener("focusout",N)}},[r,y,C,L,u,g,_,P,m,d,l,Z,I]),j.useEffect(()=>{var Y;if(r)return;const N=Array.from((P==null||(Y=P.portalNode)==null?void 0:Y.querySelectorAll("["+ro("portal")+"]"))||[]);if(C){const G=[C,...N,k.current,A.current,D.current.includes("reference")||I?y:null].filter(re=>re!=null),J=u||I?Qh(G,E,!E):Qh(G);return()=>{J()}}},[r,y,C,u,D,P,I,E]),zt(()=>{if(r||!vt(L))return;const Y=xn(L),N=Kr(Y);queueMicrotask(()=>{const G=O(L),J=$.current,re=(typeof J=="number"?G[J]:J.current)||L,fe=Kt(L,N);!w&&!fe&&f&&Wr(re,{preventScroll:re===L})})},[r,f,L,w,O,$]),zt(()=>{if(r||!L)return;let Y=!1;const N=xn(L),G=Kr(N);let re=b.current.openEvent;Mu(G);function fe(le){let{open:z,reason:Ae,event:ke,nested:Xe}=le;z&&(re=ke),Ae==="escape-key"&&h.domReference.current&&Mu(h.domReference.current),Ae==="hover"&&ke.type==="mouseleave"&&(B.current=!0),Ae==="outside-press"&&(Xe?(B.current=!1,Y=!0):B.current=!(kw(ke)||Mw(ke)))}return p.on("openchange",fe),()=>{p.off("openchange",fe);const le=Kr(N),z=Kt(C,le)||_&&Wa(_.nodesRef.current,g).some(Xe=>{var qe;return Kt((qe=Xe.context)==null?void 0:qe.elements.floating,le)});(z||re&&["click","mousedown"].includes(re.type))&&h.domReference.current&&Mu(h.domReference.current);const ke=ng();F.current&&!B.current&&vt(ke)&&(!(ke!==le&&le!==N.body)||z)&&Wr(ke,{cancelPrevious:!1,preventScroll:Y})}},[r,C,L,F,b,h,p,_,g]),zt(()=>{if(!r&&P)return P.setFocusManagerState({modal:u,closeOnFocusOut:d,open:f,onOpenChange:m,refs:h}),()=>{P.setFocusManagerState(null)}},[r,P,u,f,m,h,d]),zt(()=>{if(r||!L||typeof MutationObserver!="function"||w)return;const Y=()=>{const G=L.getAttribute("tabindex"),J=Z(),re=Kr(xn(C)),fe=J.indexOf(re);fe!==-1&&(R.current=fe),D.current.includes("floating")||re!==h.domReference.current&&J.length===0?G!=="0"&&L.setAttribute("tabindex","0"):G!=="-1"&&L.setAttribute("tabindex","-1")};Y();const N=new MutationObserver(Y);return N.observe(L,{childList:!0,subtree:!0,attributes:!0}),()=>{N.disconnect()}},[r,C,L,h,D,Z,w]);function W(Y){return r||!c||!u?null:j.createElement(d5,{ref:Y==="start"?k:A,onClick:N=>m(!1,N.nativeEvent)},typeof c=="string"?c:"Dismiss")}const q=!r&&E&&(u?!I:!0)&&(V||u);return j.createElement(j.Fragment,null,q&&j.createElement(gl,{"data-type":"inside",ref:P==null?void 0:P.beforeInsideRef,onFocus:Y=>{if(u){const G=O();Wr(i[0]==="reference"?G[0]:G[G.length-1])}else if(P!=null&&P.preserveTabOrder&&P.portalNode)if(B.current=!1,za(Y,P.portalNode)){const G=ib()||y;G==null||G.focus()}else{var N;(N=P.beforeOutsideRef.current)==null||N.focus()}}}),!I&&W("start"),n,W("end"),q&&j.createElement(gl,{"data-type":"inside",ref:P==null?void 0:P.afterInsideRef,onFocus:Y=>{if(u)Wr(O()[0]);else if(P!=null&&P.preserveTabOrder&&P.portalNode)if(d&&(B.current=!0),za(Y,P.portalNode)){const G=ab()||y;G==null||G.focus()}else{var N;(N=P.afterOutsideRef.current)==null||N.focus()}}}))}function rg(e){return vt(e.target)&&e.target.tagName==="BUTTON"}function ig(e){return O0(e)}function h5(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:i,elements:{domReference:a}}=e,{enabled:o=!0,event:s="click",toggle:l=!0,ignoreMouse:u=!1,keyboardHandlers:c=!0}=t,d=j.useRef(),f=j.useRef(!1),h=j.useMemo(()=>({onPointerDown(g){d.current=g.pointerType},onMouseDown(g){const m=d.current;g.button===0&&s!=="click"&&(Nh(m)&&u||(n&&l&&(!i.current.openEvent||i.current.openEvent.type==="mousedown")?r(!1,g.nativeEvent,"click"):(g.preventDefault(),r(!0,g.nativeEvent,"click"))))},onClick(g){const m=d.current;if(s==="mousedown"&&d.current){d.current=void 0;return}Nh(m)&&u||(n&&l&&(!i.current.openEvent||i.current.openEvent.type==="click")?r(!1,g.nativeEvent,"click"):r(!0,g.nativeEvent,"click"))},onKeyDown(g){d.current=void 0,!(g.defaultPrevented||!c||rg(g))&&(g.key===" "&&!ig(a)&&(g.preventDefault(),f.current=!0),g.key==="Enter"&&r(!(n&&l),g.nativeEvent,"click"))},onKeyUp(g){g.defaultPrevented||!c||rg(g)||ig(a)||g.key===" "&&f.current&&(f.current=!1,r(!(n&&l),g.nativeEvent,"click"))}}),[i,a,s,u,c,r,n,l]);return j.useMemo(()=>o?{reference:h}:{},[o,h])}const g5={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},m5={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},ag=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function p5(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:i,dataRef:a}=e,{enabled:o=!0,escapeKey:s=!0,outsidePress:l=!0,outsidePressEvent:u="pointerdown",referencePress:c=!1,referencePressEvent:d="pointerdown",ancestorScroll:f=!1,bubbles:h,capture:g}=t,m=zd(),p=Cr(typeof l=="function"?l:()=>!1),b=typeof l=="function"?p:l,v=j.useRef(!1),y=j.useRef(!1),{escapeKey:C,outsidePress:w}=ag(h),{escapeKey:I,outsidePress:E}=ag(g),D=Cr(A=>{var B;if(!n||!o||!s||A.key!=="Escape")return;const T=(B=a.current.floatingContext)==null?void 0:B.nodeId,R=m?Wa(m.nodesRef.current,T):[];if(!C&&(A.stopPropagation(),R.length>0)){let V=!0;if(R.forEach(H=>{var L;if((L=H.context)!=null&&L.open&&!H.context.dataRef.current.__escapeKeyBubbles){V=!1;return}}),!V)return}r(!1,Ow(A)?A.nativeEvent:A,"escape-key")}),$=Cr(A=>{var B;const T=()=>{var R;D(A),(R=ti(A))==null||R.removeEventListener("keydown",T)};(B=ti(A))==null||B.addEventListener("keydown",T)}),F=Cr(A=>{var B;const T=v.current;v.current=!1;const R=y.current;if(y.current=!1,u==="click"&&R||T||typeof b=="function"&&!b(A))return;const V=ti(A),H="["+ro("inert")+"]",L=xn(i.floating).querySelectorAll(H);let Z=rt(V)?V:null;for(;Z&&!Ar(Z);){const Y=fr(Z);if(Ar(Y)||!rt(Y))break;Z=Y}if(L.length&&rt(V)&&!Nw(V)&&!Kt(V,i.floating)&&Array.from(L).every(Y=>!Kt(Z,Y)))return;if(vt(V)&&k){const Y=V.clientWidth>0&&V.scrollWidth>V.clientWidth,N=V.clientHeight>0&&V.scrollHeight>V.clientHeight;let G=N&&A.offsetX>V.clientWidth;if(N&&vn(V).direction==="rtl"&&(G=A.offsetX<=V.offsetWidth-V.clientWidth),G||Y&&A.offsetY>V.clientHeight)return}const O=(B=a.current.floatingContext)==null?void 0:B.nodeId,W=m&&Wa(m.nodesRef.current,O).some(Y=>{var N;return Fu(A,(N=Y.context)==null?void 0:N.elements.floating)});if(Fu(A,i.floating)||Fu(A,i.domReference)||W)return;const q=m?Wa(m.nodesRef.current,O):[];if(q.length>0){let Y=!0;if(q.forEach(N=>{var G;if((G=N.context)!=null&&G.open&&!N.context.dataRef.current.__outsidePressBubbles){Y=!1;return}}),!Y)return}r(!1,A,"outside-press")}),_=Cr(A=>{var B;const T=()=>{var R;F(A),(R=ti(A))==null||R.removeEventListener(u,T)};(B=ti(A))==null||B.addEventListener(u,T)});j.useEffect(()=>{if(!n||!o)return;a.current.__escapeKeyBubbles=C,a.current.__outsidePressBubbles=w;function A(R){r(!1,R,"ancestor-scroll")}const B=xn(i.floating);s&&B.addEventListener("keydown",I?$:D,I),b&&B.addEventListener(u,E?_:F,E);let T=[];return f&&(rt(i.domReference)&&(T=$r(i.domReference)),rt(i.floating)&&(T=T.concat($r(i.floating))),!rt(i.reference)&&i.reference&&i.reference.contextElement&&(T=T.concat($r(i.reference.contextElement)))),T=T.filter(R=>{var V;return R!==((V=B.defaultView)==null?void 0:V.visualViewport)}),T.forEach(R=>{R.addEventListener("scroll",A,{passive:!0})}),()=>{s&&B.removeEventListener("keydown",I?$:D,I),b&&B.removeEventListener(u,E?_:F,E),T.forEach(R=>{R.removeEventListener("scroll",A)})}},[a,i,s,b,u,n,r,f,o,C,w,D,I,$,F,E,_]),j.useEffect(()=>{v.current=!1},[b,u]);const P=j.useMemo(()=>({onKeyDown:D,[g5[d]]:A=>{c&&r(!1,A.nativeEvent,"reference-press")}}),[D,r,c,d]),k=j.useMemo(()=>({onKeyDown:D,onMouseDown(){y.current=!0},onMouseUp(){y.current=!0},[m5[u]]:()=>{v.current=!0}}),[D,u]);return j.useMemo(()=>o?{reference:P,floating:k}:{},[o,P,k])}function b5(e){const{open:t=!1,onOpenChange:n,elements:r}=e,i=Wd(),a=j.useRef({}),[o]=j.useState(()=>qD()),s=tb()!=null;if(process.env.NODE_ENV!=="production"){const h=r.reference;h&&!rt(h)&&QD("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,u]=j.useState(r.reference),c=Cr((h,g,m)=>{a.current.openEvent=h?g:void 0,o.emit("openchange",{open:h,event:g,reason:m,nested:s}),n==null||n(h,g,m)}),d=j.useMemo(()=>({setPositionReference:u}),[]),f=j.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return j.useMemo(()=>({dataRef:a,open:t,onOpenChange:c,elements:f,events:o,floatingId:i,refs:d}),[t,c,f,o,i,d])}function v5(e){e===void 0&&(e={});const{nodeId:t}=e,n=b5({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,i=r.elements,[a,o]=j.useState(null),[s,l]=j.useState(null),c=(i==null?void 0:i.reference)||a,d=j.useRef(null),f=zd();zt(()=>{c&&(d.current=c)},[c]);const h=HD({...e,elements:{...i,...s&&{reference:s}}}),g=j.useCallback(y=>{const C=rt(y)?{getBoundingClientRect:()=>y.getBoundingClientRect(),contextElement:y}:y;l(C),h.refs.setReference(C)},[h.refs]),m=j.useCallback(y=>{(rt(y)||y===null)&&(d.current=y,o(y)),(rt(h.refs.reference.current)||h.refs.reference.current===null||y!==null&&!rt(y))&&h.refs.setReference(y)},[h.refs]),p=j.useMemo(()=>({...h.refs,setReference:m,setPositionReference:g,domReference:d}),[h.refs,m,g]),b=j.useMemo(()=>({...h.elements,domReference:c}),[h.elements,c]),v=j.useMemo(()=>({...h,...r,refs:p,elements:b,nodeId:t}),[h,p,b,t,r]);return zt(()=>{r.dataRef.current.floatingContext=v;const y=f==null?void 0:f.nodesRef.current.find(C=>C.id===t);y&&(y.context=v)}),j.useMemo(()=>({...h,context:v,refs:p,elements:b}),[h,p,b,v])}const og="active",sg="selected";function Bu(e,t,n){const r=new Map,i=n==="item";let a=e;if(i&&e){const{[og]:o,[sg]:s,...l}=e;a=l}return{...n==="floating"&&{tabIndex:-1},...a,...t.map(o=>{const s=o?o[n]:null;return typeof s=="function"?e?s(e):null:s}).concat(e).reduce((o,s)=>(s&&Object.entries(s).forEach(l=>{let[u,c]=l;if(!(i&&[og,sg].includes(u)))if(u.indexOf("on")===0){if(r.has(u)||r.set(u,[]),typeof c=="function"){var d;(d=r.get(u))==null||d.push(c),o[u]=function(){for(var f,h=arguments.length,g=new Array(h),m=0;m<h;m++)g[m]=arguments[m];return(f=r.get(u))==null?void 0:f.map(p=>p(...g)).find(p=>p!==void 0)}}}else o[u]=c}),o),{})}}function y5(e){e===void 0&&(e=[]);const t=e.map(s=>s==null?void 0:s.reference),n=e.map(s=>s==null?void 0:s.floating),r=e.map(s=>s==null?void 0:s.item),i=j.useCallback(s=>Bu(s,e,"reference"),t),a=j.useCallback(s=>Bu(s,e,"floating"),n),o=j.useCallback(s=>Bu(s,e,"item"),r);return j.useMemo(()=>({getReferenceProps:i,getFloatingProps:a,getItemProps:o}),[i,a,o])}const x5=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function C5(e,t){var n;t===void 0&&(t={});const{open:r,floatingId:i}=e,{enabled:a=!0,role:o="dialog"}=t,s=(n=x5.get(o))!=null?n:o,l=Wd(),c=tb()!=null,d=j.useMemo(()=>s==="tooltip"||o==="label"?{["aria-"+(o==="label"?"labelledby":"describedby")]:r?i:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":s==="alertdialog"?"dialog":s,"aria-controls":r?i:void 0,...s==="listbox"&&{role:"combobox"},...s==="menu"&&{id:l},...s==="menu"&&c&&{role:"menuitem"},...o==="select"&&{"aria-autocomplete":"none"},...o==="combobox"&&{"aria-autocomplete":"list"}},[s,i,c,r,l,o]),f=j.useMemo(()=>{const g={id:i,...s&&{role:s}};return s==="tooltip"||o==="label"?g:{...g,...s==="menu"&&{"aria-labelledby":l}}},[s,i,l,o]),h=j.useCallback(g=>{let{active:m,selected:p}=g;const b={role:"option",...m&&{id:i+"-option"}};switch(o){case"select":return{...b,"aria-selected":m&&p};case"combobox":return{...b,...m&&{"aria-selected":!0}}}return{}},[i,o]);return j.useMemo(()=>a?{reference:d,floating:f,item:h}:{},[a,d,f,h])}const lg=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(t,n)=>(n?"-":"")+t.toLowerCase());function Ti(e,t){return typeof e=="function"?e(t):e}function w5(e,t){const[n,r]=j.useState(e);return e&&!n&&r(!0),j.useEffect(()=>{if(!e&&n){const i=setTimeout(()=>r(!1),t);return()=>clearTimeout(i)}},[e,n,t]),n}function D5(e,t){t===void 0&&(t={});const{open:n,elements:{floating:r}}=e,{duration:i=250}=t,o=(typeof i=="number"?i:i.close)||0,[s,l]=j.useState("unmounted"),u=w5(n,o);return!u&&s==="close"&&l("unmounted"),zt(()=>{if(r){if(n){l("initial");const c=requestAnimationFrame(()=>{l("open")});return()=>{cancelAnimationFrame(c)}}l("close")}},[n,r]),{isMounted:u,status:s}}function S5(e,t){t===void 0&&(t={});const{initial:n={opacity:0},open:r,close:i,common:a,duration:o=250}=t,s=e.placement,l=s.split("-")[0],u=j.useMemo(()=>({side:l,placement:s}),[l,s]),c=typeof o=="number",d=(c?o:o.open)||0,f=(c?o:o.close)||0,[h,g]=j.useState(()=>({...Ti(a,u),...Ti(n,u)})),{isMounted:m,status:p}=D5(e,{duration:o}),b=ii(n),v=ii(r),y=ii(i),C=ii(a);return zt(()=>{const w=Ti(b.current,u),I=Ti(y.current,u),E=Ti(C.current,u),D=Ti(v.current,u)||Object.keys(w).reduce(($,F)=>($[F]="",$),{});if(p==="initial"&&g($=>({transitionProperty:$.transitionProperty,...E,...w})),p==="open"&&g({transitionProperty:Object.keys(D).map(lg).join(","),transitionDuration:d+"ms",...E,...D}),p==="close"){const $=I||w;g({transitionProperty:Object.keys($).map(lg).join(","),transitionDuration:f+"ms",...E,...$})}},[f,y,b,v,C,d,p,u]),{isMounted:m,styles:h}}const I5="_popover_7cinv_1",E5={popover:I5},wi=x.forwardRef((e,t)=>{const{children:n,className:r,offset:i=10,isShow:a,anchorEl:o,useAutoPlacement:s=!1,flipOptions:l,autoPlacementOptions:u,zIndex:c=10,width:d,styleInnerPopover:f={},floatingOptions:h={},...g}=e,[m,p]=x.useState(!1),{refs:b,floatingStyles:v,context:y}=v5({open:m,onOpenChange:p,middleware:[WD(i),s?ZD(u):GD(l),zD()],whileElementsMounted:Q0,...h}),C=h5(y),w=p5(y),I=C5(y),{getReferenceProps:E,getFloatingProps:D}=y5([C,w,I]),{styles:$,isMounted:F}=S5(y),_=k=>{b.setReference(k.currentTarget),p(A=>!A)};x.useEffect(()=>{a&&o?_({currentTarget:o}):a||p(!1)},[a,o]),x.useImperativeHandle(t,()=>({show:m,setShow:p,handlerShow:_,getReferenceProps:E}),[m]);const P=()=>{let k={...v,...$,...f,zIndex:c};return d&&(k={...k,width:d}),k};return S.jsx(S.Fragment,{children:F&&m&&S.jsx(c5,{children:S.jsx(f5,{context:y,modal:!1,children:S.jsx("div",{ref:b.setFloating,style:P(),...D(),className:`${E5.popover} ${r??""}`,...g,children:n})})})})});wi.displayName="Popover";const _5="_input_17tnz_7",$5="_label_17tnz_35",R5="_error_17tnz_42",Ut={"container-large":"_container-large_17tnz_1","container-input":"_container-input_17tnz_4",input:_5,label:$5,error:R5,"isset-right-icon":"_isset-right-icon_17tnz_53","isset-left-icon":"_isset-left-icon_17tnz_56","start-icon":"_start-icon_17tnz_63","end-icon":"_end-icon_17tnz_66","label-error":"_label-error_17tnz_72","container-medium":"_container-medium_17tnz_77"},lb=x.forwardRef((e,t)=>{var y;const{isRequired:n,classNameContainer:r,classNameLabelError:i,classNameLabel:a,className:o,name:s,id:l,label:u,type:c="text",startIcon:d,endIcon:f,error:h,sizeInput:g="large",...m}=e,p={size:{large:Ut["container-large"],medium:Ut["container-medium"]},variant:{}},b=()=>typeof d=="function"||x.isValidElement(d),v=()=>typeof f=="function"||x.isValidElement(f);return S.jsxs("div",{className:`${Ut.container} ${(y=p.size)==null?void 0:y[g]} ${r??""}`,children:[S.jsxs("div",{className:Ut["container-input"],children:[S.jsx("input",{id:l??s,className:`${Ut.input} ${h?Ut.error:""}
|
44
|
+
*/var Jw=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],ul=Jw.join(","),W0=typeof Element>"u",aa=W0?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,cl=!W0&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},dl=function e(t,n){var r;n===void 0&&(n=!0);var i=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),a=i===""||i==="true",o=a||n&&t&&e(t.parentNode);return o},Kw=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},Qw=function(t,n,r){if(dl(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(ul));return n&&aa.call(t,ul)&&i.unshift(t),i=i.filter(r),i},qw=function e(t,n,r){for(var i=[],a=Array.from(t);a.length;){var o=a.shift();if(!dl(o,!1))if(o.tagName==="SLOT"){var s=o.assignedElements(),l=s.length?s:o.children,u=e(l,!0,r);r.flatten?i.push.apply(i,u):i.push({scopeParent:o,candidates:u})}else{var c=aa.call(o,ul);c&&r.filter(o)&&(n||!t.includes(o))&&i.push(o);var d=o.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(o),f=!dl(d,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(o));if(d&&f){var h=e(d===!0?o.children:d.children,!0,r);r.flatten?i.push.apply(i,h):i.push({scopeParent:o,candidates:h})}else a.unshift.apply(a,o.children)}}return i},z0=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},G0=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||Kw(t))&&!z0(t)?0:t.tabIndex},eD=function(t,n){var r=G0(t);return r<0&&n&&!z0(t)?0:r},tD=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Z0=function(t){return t.tagName==="INPUT"},nD=function(t){return Z0(t)&&t.type==="hidden"},rD=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},iD=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},aD=function(t){if(!t.name)return!0;var n=t.form||cl(t),r=function(s){return n.querySelectorAll('input[type="radio"][name="'+s+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=r(window.CSS.escape(t.name));else try{i=r(t.name)}catch(o){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",o.message),!1}var a=iD(i,t.form);return!a||a===t},oD=function(t){return Z0(t)&&t.type==="radio"},sD=function(t){return oD(t)&&!aD(t)},lD=function(t){var n,r=t&&cl(t),i=(n=r)===null||n===void 0?void 0:n.host,a=!1;if(r&&r!==t){var o,s,l;for(a=!!((o=i)!==null&&o!==void 0&&(s=o.ownerDocument)!==null&&s!==void 0&&s.contains(i)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!a&&i;){var u,c,d;r=cl(i),i=(u=r)===null||u===void 0?void 0:u.host,a=!!((c=i)!==null&&c!==void 0&&(d=c.ownerDocument)!==null&&d!==void 0&&d.contains(i))}}return a},Wh=function(t){var n=t.getBoundingClientRect(),r=n.width,i=n.height;return r===0&&i===0},uD=function(t,n){var r=n.displayCheck,i=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var a=aa.call(t,"details>summary:first-of-type"),o=a?t.parentElement:t;if(aa.call(o,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof i=="function"){for(var s=t;t;){var l=t.parentElement,u=cl(t);if(l&&!l.shadowRoot&&i(l)===!0)return Wh(t);t.assignedSlot?t=t.assignedSlot:!l&&u!==t.ownerDocument?t=u.host:t=l}t=s}if(lD(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Wh(t);return!1},cD=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var i=n.children.item(r);if(i.tagName==="LEGEND")return aa.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},dD=function(t,n){return!(n.disabled||dl(n)||nD(n)||uD(n,t)||rD(n)||cD(n))},kc=function(t,n){return!(sD(n)||G0(n)<0||!dD(t,n))},fD=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},hD=function e(t){var n=[],r=[];return t.forEach(function(i,a){var o=!!i.scopeParent,s=o?i.scopeParent:i,l=eD(s,o),u=o?e(i.candidates):s;l===0?o?n.push.apply(n,u):n.push(s):r.push({documentOrder:a,tabIndex:l,item:i,isScope:o,content:u})}),r.sort(tD).reduce(function(i,a){return a.isScope?i.push.apply(i,a.content):i.push(a.content),i},[]).concat(n)},tu=function(t,n){n=n||{};var r;return n.getShadowRoot?r=qw([t],n.includeContainer,{filter:kc.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:fD}):r=Qw(t,n.includeContainer,kc.bind(null,n)),hD(r)},gD=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return aa.call(t,ul)===!1?!1:kc(n,t)};function zh(e,t,n){let{reference:r,floating:i}=e;const a=ia(t),o=j0(t),s=L0(o),l=hr(t),u=a==="y",c=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2;let h;switch(l){case"top":h={x:c,y:r.y-i.height};break;case"bottom":h={x:c,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-i.width,y:d};break;default:h={x:r.x,y:r.y}}switch(cr(t)){case"start":h[o]-=f*(n&&u?-1:1);break;case"end":h[o]+=f*(n&&u?-1:1);break}return h}const mD=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:a=[],platform:o}=n,s=a.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:d}=zh(u,r,l),f=r,h={},g=0;for(let m=0;m<s.length;m++){const{name:p,fn:b}=s[m],{x:v,y,data:C,reset:w}=await b({x:c,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:h,rects:u,platform:o,elements:{reference:e,floating:t}});c=v??c,d=y??d,h={...h,[p]:{...h[p],...C}},w&&g<=50&&(g++,typeof w=="object"&&(w.placement&&(f=w.placement),w.rects&&(u=w.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):w.rects),{x:c,y:d}=zh(u,f,l)),m=-1)}return{x:c,y:d,placement:f,strategy:i,middlewareData:h}};async function jd(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:a,rects:o,elements:s,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=Bo(t,e),g=Uw(h),p=s[f?d==="floating"?"reference":"floating":d],b=ll(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(p)))==null||n?p:p.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:u,rootBoundary:c,strategy:l})),v=d==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,y=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),C=await(a.isElement==null?void 0:a.isElement(y))?await(a.getScale==null?void 0:a.getScale(y))||{x:1,y:1}:{x:1,y:1},w=ll(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:y,strategy:l}):v);return{top:(b.top-w.top+g.top)/C.y,bottom:(w.bottom-b.bottom+g.bottom)/C.y,left:(b.left-w.left+g.left)/C.x,right:(w.right-b.right+g.right)/C.x}}function pD(e,t,n){return(e?[...n.filter(i=>cr(i)===e),...n.filter(i=>cr(i)!==e)]:n.filter(i=>hr(i)===i)).filter(i=>e?cr(i)===e||(t?ol(i)!==i:!1):!0)}const bD=function(e){return e===void 0&&(e={}),{name:"autoPlacement",options:e,async fn(t){var n,r,i;const{rects:a,middlewareData:o,placement:s,platform:l,elements:u}=t,{crossAxis:c=!1,alignment:d,allowedPlacements:f=jh,autoAlignment:h=!0,...g}=Bo(e,t),m=d!==void 0||f===jh?pD(d||null,h,f):f,p=await jd(t,g),b=((n=o.autoPlacement)==null?void 0:n.index)||0,v=m[b];if(v==null)return{};const y=H0(v,a,await(l.isRTL==null?void 0:l.isRTL(u.floating)));if(s!==v)return{reset:{placement:m[0]}};const C=[p[hr(v)],p[y[0]],p[y[1]]],w=[...((r=o.autoPlacement)==null?void 0:r.overflows)||[],{placement:v,overflows:C}],I=m[b+1];if(I)return{data:{index:b+1,overflows:w},reset:{placement:I}};const E=w.map(F=>{const _=cr(F.placement);return[F.placement,_&&c?F.overflows.slice(0,2).reduce((P,k)=>P+k,0):F.overflows[0],F.overflows]}).sort((F,_)=>F[1]-_[1]),$=((i=E.filter(F=>F[2].slice(0,cr(F[0])?2:3).every(_=>_<=0))[0])==null?void 0:i[0])||E[0][0];return $!==s?{data:{index:b+1,overflows:w},reset:{placement:$}}:{}}}},vD=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:a,rects:o,initialPlacement:s,platform:l,elements:u}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:m=!0,...p}=Bo(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const b=hr(i),v=ia(s),y=hr(s)===s,C=await(l.isRTL==null?void 0:l.isRTL(u.floating)),w=f||(y||!m?[sl(s)]:Gw(s)),I=g!=="none";!f&&I&&w.push(...Xw(s,m,g,C));const E=[s,...w],D=await jd(t,p),$=[];let F=((r=a.flip)==null?void 0:r.overflows)||[];if(c&&$.push(D[b]),d){const A=H0(i,o,C);$.push(D[A[0]],D[A[1]])}if(F=[...F,{placement:i,overflows:$}],!$.every(A=>A<=0)){var _,P;const A=(((_=a.flip)==null?void 0:_.index)||0)+1,B=E[A];if(B)return{data:{index:A,overflows:F},reset:{placement:B}};let T=(P=F.filter(R=>R.overflows[0]<=0).sort((R,V)=>R.overflows[1]-V.overflows[1])[0])==null?void 0:P.placement;if(!T)switch(h){case"bestFit":{var k;const R=(k=F.filter(V=>{if(I){const H=ia(V.placement);return H===v||H==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(H=>H>0).reduce((H,L)=>H+L,0)]).sort((V,H)=>V[1]-H[1])[0])==null?void 0:k[0];R&&(T=R);break}case"initialPlacement":T=s;break}if(i!==T)return{reset:{placement:T}}}return{}}}};async function yD(e,t){const{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=hr(n),s=cr(n),l=ia(n)==="y",u=["left","top"].includes(o)?-1:1,c=a&&l?-1:1,d=Bo(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return s&&typeof g=="number"&&(h=s==="end"?g*-1:g),l?{x:h*c,y:f*u}:{x:f*u,y:h*c}}const xD=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:a,placement:o,middlewareData:s}=t,l=await yD(t,e);return o===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:a+l.y,data:{...l,placement:o}}}}},CD=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:s={fn:p=>{let{x:b,y:v}=p;return{x:b,y:v}}},...l}=Bo(e,t),u={x:n,y:r},c=await jd(t,l),d=ia(hr(i)),f=N0(d);let h=u[f],g=u[d];if(a){const p=f==="y"?"top":"left",b=f==="y"?"bottom":"right",v=h+c[p],y=h-c[b];h=Hh(v,h,y)}if(o){const p=d==="y"?"top":"left",b=d==="y"?"bottom":"right",v=g+c[p],y=g-c[b];g=Hh(v,g,y)}const m=s.fn({...t,[f]:h,[d]:g});return{...m,data:{x:m.x-n,y:m.y-r}}}}};function X0(e){const t=vn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=vt(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=al(n)!==a||al(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Hd(e){return rt(e)?e:e.contextElement}function Yi(e){const t=Hd(e);if(!vt(t))return Fr(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:a}=X0(t);let o=(a?al(n.width):n.width)/r,s=(a?al(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}const wD=Fr(0);function Y0(e){const t=nn(e);return!Ld()||!t.visualViewport?wD:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function DD(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==nn(e)?!1:t}function hi(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),a=Hd(e);let o=Fr(1);t&&(r?rt(r)&&(o=Yi(r)):o=Yi(e));const s=DD(a,n,r)?Y0(a):Fr(0);let l=(i.left+s.x)/o.x,u=(i.top+s.y)/o.y,c=i.width/o.x,d=i.height/o.y;if(a){const f=nn(a),h=r&&rt(r)?nn(r):r;let g=f,m=g.frameElement;for(;m&&r&&h!==g;){const p=Yi(m),b=m.getBoundingClientRect(),v=vn(m),y=b.left+(m.clientLeft+parseFloat(v.paddingLeft))*p.x,C=b.top+(m.clientTop+parseFloat(v.paddingTop))*p.y;l*=p.x,u*=p.y,c*=p.x,d*=p.y,l+=y,u+=C,g=nn(m),m=g.frameElement}}return ll({width:c,height:d,x:l,y:u})}function SD(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const a=i==="fixed",o=gr(r),s=t?ql(t.floating):!1;if(r===o||s&&a)return n;let l={scrollLeft:0,scrollTop:0},u=Fr(1);const c=Fr(0),d=vt(r);if((d||!d&&!a)&&((Br(r)!=="body"||Mo(o))&&(l=eu(r)),vt(r))){const f=hi(r);u=Yi(r),c.x=f.x+r.clientLeft,c.y=f.y+r.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x,y:n.y*u.y-l.scrollTop*u.y+c.y}}function ID(e){return Array.from(e.getClientRects())}function U0(e){return hi(gr(e)).left+eu(e).scrollLeft}function ED(e){const t=gr(e),n=eu(e),r=e.ownerDocument.body,i=ui(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=ui(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+U0(e);const s=-n.scrollTop;return vn(r).direction==="rtl"&&(o+=ui(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}function _D(e,t){const n=nn(e),r=gr(e),i=n.visualViewport;let a=r.clientWidth,o=r.clientHeight,s=0,l=0;if(i){a=i.width,o=i.height;const u=Ld();(!u||u&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:a,height:o,x:s,y:l}}function $D(e,t){const n=hi(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=vt(e)?Yi(e):Fr(1),o=e.clientWidth*a.x,s=e.clientHeight*a.y,l=i*a.x,u=r*a.y;return{width:o,height:s,x:l,y:u}}function Gh(e,t,n){let r;if(t==="viewport")r=_D(e,n);else if(t==="document")r=ED(gr(e));else if(rt(t))r=$D(t,n);else{const i=Y0(e);r={...t,x:t.x-i.x,y:t.y-i.y}}return ll(r)}function J0(e,t){const n=fr(e);return n===t||!rt(n)||Ar(n)?!1:vn(n).position==="fixed"||J0(n,t)}function RD(e,t){const n=t.get(e);if(n)return n;let r=$r(e,[],!1).filter(s=>rt(s)&&Br(s)!=="body"),i=null;const a=vn(e).position==="fixed";let o=a?fr(e):e;for(;rt(o)&&!Ar(o);){const s=vn(o),l=Nd(o);!l&&s.position==="fixed"&&(i=null),(a?!l&&!i:!l&&s.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Mo(o)&&!l&&J0(e,o))?r=r.filter(c=>c!==o):i=s,o=fr(o)}return t.set(e,r),r}function AD(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?ql(t)?[]:RD(t,this._c):[].concat(n),r],s=o[0],l=o.reduce((u,c)=>{const d=Gh(t,c,i);return u.top=ui(d.top,u.top),u.right=il(d.right,u.right),u.bottom=il(d.bottom,u.bottom),u.left=ui(d.left,u.left),u},Gh(t,s,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function FD(e){const{width:t,height:n}=X0(e);return{width:t,height:n}}function PD(e,t,n){const r=vt(t),i=gr(t),a=n==="fixed",o=hi(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const l=Fr(0);if(r||!r&&!a)if((Br(t)!=="body"||Mo(i))&&(s=eu(t)),r){const d=hi(t,!0,a,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else i&&(l.x=U0(i));const u=o.left+s.scrollLeft-l.x,c=o.top+s.scrollTop-l.y;return{x:u,y:c,width:o.width,height:o.height}}function Tu(e){return vn(e).position==="static"}function Zh(e,t){return!vt(e)||vn(e).position==="fixed"?null:t?t(e):e.offsetParent}function K0(e,t){const n=nn(e);if(ql(e))return n;if(!vt(e)){let i=fr(e);for(;i&&!Ar(i);){if(rt(i)&&!Tu(i))return i;i=fr(i)}return n}let r=Zh(e,t);for(;r&&Fw(r)&&Tu(r);)r=Zh(r,t);return r&&Ar(r)&&Tu(r)&&!Nd(r)?n:r||Pw(e)||n}const TD=async function(e){const t=this.getOffsetParent||K0,n=this.getDimensions,r=await n(e.floating);return{reference:PD(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function kD(e){return vn(e).direction==="rtl"}const MD={convertOffsetParentRelativeRectToViewportRelativeRect:SD,getDocumentElement:gr,getClippingRect:AD,getOffsetParent:K0,getElementRects:TD,getClientRects:ID,getDimensions:FD,getScale:Yi,isElement:rt,isRTL:kD};function BD(e,t){let n=null,r;const i=gr(e);function a(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function o(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),a();const{left:u,top:c,width:d,height:f}=e.getBoundingClientRect();if(s||t(),!d||!f)return;const h=ns(c),g=ns(i.clientWidth-(u+d)),m=ns(i.clientHeight-(c+f)),p=ns(u),v={rootMargin:-h+"px "+-g+"px "+-m+"px "+-p+"px",threshold:ui(0,il(1,l))||1};let y=!0;function C(w){const I=w[0].intersectionRatio;if(I!==l){if(!y)return o();I?o(!1,I):r=setTimeout(()=>{o(!1,1e-7)},1e3)}y=!1}try{n=new IntersectionObserver(C,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(C,v)}n.observe(e)}return o(!0),a}function Q0(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=Hd(e),c=i||a?[...u?$r(u):[],...$r(t)]:[];c.forEach(b=>{i&&b.addEventListener("scroll",n,{passive:!0}),a&&b.addEventListener("resize",n)});const d=u&&s?BD(u,n):null;let f=-1,h=null;o&&(h=new ResizeObserver(b=>{let[v]=b;v&&v.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var y;(y=h)==null||y.observe(t)})),n()}),u&&!l&&h.observe(u),h.observe(t));let g,m=l?hi(e):null;l&&p();function p(){const b=hi(e);m&&(b.x!==m.x||b.y!==m.y||b.width!==m.width||b.height!==m.height)&&n(),m=b,g=requestAnimationFrame(p)}return n(),()=>{var b;c.forEach(v=>{i&&v.removeEventListener("scroll",n),a&&v.removeEventListener("resize",n)}),d==null||d(),(b=h)==null||b.disconnect(),h=null,l&&cancelAnimationFrame(g)}}const VD=xD,OD=bD,ND=CD,LD=vD,jD=(e,t,n)=>{const r=new Map,i={platform:MD,...n},a={...i.platform,_c:r};return mD(e,t,{...i,platform:a})};var Ns=typeof document<"u"?x.useLayoutEffect:x.useEffect;function fl(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(!fl(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 a=i[r];if(!(a==="_owner"&&e.$$typeof)&&!fl(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function q0(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Xh(e,t){const n=q0(e);return Math.round(t*n)/n}function Yh(e){const t=j.useRef(e);return Ns(()=>{t.current=e}),t}function HD(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:l,open:u}=e,[c,d]=j.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,h]=j.useState(r);fl(f,r)||h(r);const[g,m]=j.useState(null),[p,b]=j.useState(null),v=j.useCallback(R=>{R!==I.current&&(I.current=R,m(R))},[]),y=j.useCallback(R=>{R!==E.current&&(E.current=R,b(R))},[]),C=a||g,w=o||p,I=j.useRef(null),E=j.useRef(null),D=j.useRef(c),$=l!=null,F=Yh(l),_=Yh(i),P=j.useCallback(()=>{if(!I.current||!E.current)return;const R={placement:t,strategy:n,middleware:f};_.current&&(R.platform=_.current),jD(I.current,E.current,R).then(V=>{const H={...V,isPositioned:!0};k.current&&!fl(D.current,H)&&(D.current=H,v0.flushSync(()=>{d(H)}))})},[f,t,n,_]);Ns(()=>{u===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,d(R=>({...R,isPositioned:!1})))},[u]);const k=j.useRef(!1);Ns(()=>(k.current=!0,()=>{k.current=!1}),[]),Ns(()=>{if(C&&(I.current=C),w&&(E.current=w),C&&w){if(F.current)return F.current(C,w,P);P()}},[C,w,P,F,$]);const A=j.useMemo(()=>({reference:I,floating:E,setReference:v,setFloating:y}),[v,y]),B=j.useMemo(()=>({reference:C,floating:w}),[C,w]),T=j.useMemo(()=>{const R={position:n,left:0,top:0};if(!B.floating)return R;const V=Xh(B.floating,c.x),H=Xh(B.floating,c.y);return s?{...R,transform:"translate("+V+"px, "+H+"px)",...q0(B.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:V,top:H}},[n,s,B.floating,c.x,c.y]);return j.useMemo(()=>({...c,update:P,refs:A,elements:B,floatingStyles:T}),[c,P,A,B,T])}const WD=(e,t)=>({...VD(e),options:[e,t]}),zD=(e,t)=>({...ND(e),options:[e,t]}),GD=(e,t)=>({...LD(e),options:[e,t]}),ZD=(e,t)=>({...OD(e),options:[e,t]}),eb={...j},XD=eb.useInsertionEffect,YD=XD||(e=>e());function Cr(e){const t=j.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return YD(()=>{t.current=e}),j.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}let Uh=0;function Wr(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(Uh);const a=()=>e==null?void 0:e.focus({preventScroll:n});i?a():Uh=requestAnimationFrame(a)}var zt=typeof document<"u"?x.useLayoutEffect:x.useEffect;function hl(){return hl=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},hl.apply(this,arguments)}let Jh=!1,UD=0;const Kh=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+UD++;function JD(){const[e,t]=j.useState(()=>Jh?Kh():void 0);return zt(()=>{e==null&&t(Kh())},[]),j.useEffect(()=>{Jh=!0},[]),e}const KD=eb.useId,Wd=KD||JD;let Mc;process.env.NODE_ENV!=="production"&&(Mc=new Set);function QD(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const i="Floating UI: "+n.join(" ");if(!((e=Mc)!=null&&e.has(i))){var a;(a=Mc)==null||a.add(i),console.error(i)}}function qD(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(i=>i(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(i=>i!==n))||[])}}}const e5=j.createContext(null),t5=j.createContext(null),tb=()=>{var e;return((e=j.useContext(e5))==null?void 0:e.id)||null},zd=()=>j.useContext(t5);function ro(e){return"data-floating-ui-"+e}function ii(e){const t=x.useRef(e);return zt(()=>{t.current=e}),t}function n5(e,t){var n;let r=[],i=(n=e.find(a=>a.id===t))==null?void 0:n.parentId;for(;i;){const a=e.find(o=>o.id===i);i=a==null?void 0:a.parentId,a&&(r=r.concat(a))}return r}function Wa(e,t){let n=e.filter(i=>{var a;return i.parentId===t&&((a=i.context)==null?void 0:a.open)}),r=n;for(;r.length;)r=e.filter(i=>{var a;return(a=r)==null?void 0:a.some(o=>{var s;return i.parentId===o.id&&((s=i.context)==null?void 0:s.open)})}),n=n.concat(r);return n}let Pi=new WeakMap,rs=new WeakSet,is={},ku=0;const r5=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,nb=e=>e&&(e.host||nb(e.parentNode)),i5=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=nb(n);return e.contains(r)?r:null}).filter(n=>n!=null);function a5(e,t,n,r){const i="data-floating-ui-inert",a=r?"inert":n?"aria-hidden":null,o=i5(t,e),s=new Set,l=new Set(o),u=[];is[i]||(is[i]=new WeakMap);const c=is[i];o.forEach(d),f(t),s.clear();function d(h){!h||s.has(h)||(s.add(h),h.parentNode&&d(h.parentNode))}function f(h){!h||l.has(h)||[].forEach.call(h.children,g=>{if(Br(g)!=="script")if(s.has(g))f(g);else{const m=a?g.getAttribute(a):null,p=m!==null&&m!=="false",b=(Pi.get(g)||0)+1,v=(c.get(g)||0)+1;Pi.set(g,b),c.set(g,v),u.push(g),b===1&&p&&rs.add(g),v===1&&g.setAttribute(i,""),!p&&a&&g.setAttribute(a,"true")}})}return ku++,()=>{u.forEach(h=>{const g=(Pi.get(h)||0)-1,m=(c.get(h)||0)-1;Pi.set(h,g),c.set(h,m),g||(!rs.has(h)&&a&&h.removeAttribute(a),rs.delete(h)),m||h.removeAttribute(i)}),ku--,ku||(Pi=new WeakMap,Pi=new WeakMap,rs=new WeakSet,is={})}}function Qh(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=xn(e[0]).body;return a5(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const io=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function rb(e,t){const n=tu(e,io());t==="prev"&&n.reverse();const r=n.indexOf(Kr(xn(e)));return n.slice(r+1)[0]}function ib(){return rb(document.body,"next")}function ab(){return rb(document.body,"prev")}function za(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Kt(n,r)}function o5(e){tu(e,io()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function s5(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const Gd={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};let l5;function qh(e){e.key==="Tab"&&(e.target,clearTimeout(l5))}const gl=j.forwardRef(function(t,n){const[r,i]=j.useState();zt(()=>(Bw()&&i("button"),document.addEventListener("keydown",qh),()=>{document.removeEventListener("keydown",qh)}),[]);const a={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[ro("focus-guard")]:"",style:Gd};return j.createElement("span",hl({},t,a))}),ob=j.createContext(null),eg=ro("portal");function u5(e){e===void 0&&(e={});const{id:t,root:n}=e,r=Wd(),i=sb(),[a,o]=j.useState(null),s=j.useRef(null);return zt(()=>()=>{a==null||a.remove(),queueMicrotask(()=>{s.current=null})},[a]),zt(()=>{if(!r||s.current)return;const l=t?document.getElementById(t):null;if(!l)return;const u=document.createElement("div");u.id=r,u.setAttribute(eg,""),l.appendChild(u),s.current=u,o(u)},[t,r]),zt(()=>{if(!r||s.current)return;let l=n||(i==null?void 0:i.portalNode);l&&!rt(l)&&(l=l.current),l=l||document.body;let u=null;t&&(u=document.createElement("div"),u.id=t,l.appendChild(u));const c=document.createElement("div");c.id=r,c.setAttribute(eg,""),l=u||l,l.appendChild(c),s.current=c,o(c)},[t,n,r,i]),a}function c5(e){const{children:t,id:n,root:r=null,preserveTabOrder:i=!0}=e,a=u5({id:n,root:r}),[o,s]=j.useState(null),l=j.useRef(null),u=j.useRef(null),c=j.useRef(null),d=j.useRef(null),f=!!o&&!o.modal&&o.open&&i&&!!(r||a);return j.useEffect(()=>{if(!a||!i||o!=null&&o.modal)return;function h(g){a&&za(g)&&(g.type==="focusin"?s5:o5)(a)}return a.addEventListener("focusin",h,!0),a.addEventListener("focusout",h,!0),()=>{a.removeEventListener("focusin",h,!0),a.removeEventListener("focusout",h,!0)}},[a,i,o==null?void 0:o.modal]),j.createElement(ob.Provider,{value:j.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:l,afterOutsideRef:u,beforeInsideRef:c,afterInsideRef:d,portalNode:a,setFocusManagerState:s}),[i,a])},f&&a&&j.createElement(gl,{"data-type":"outside",ref:l,onFocus:h=>{if(za(h,a)){var g;(g=c.current)==null||g.focus()}else{const m=ab()||(o==null?void 0:o.refs.domReference.current);m==null||m.focus()}}}),f&&a&&j.createElement("span",{"aria-owns":a.id,style:Gd}),a&&v0.createPortal(t,a),f&&a&&j.createElement(gl,{"data-type":"outside",ref:u,onFocus:h=>{if(za(h,a)){var g;(g=d.current)==null||g.focus()}else{const m=ib()||(o==null?void 0:o.refs.domReference.current);m==null||m.focus(),o!=null&&o.closeOnFocusOut&&(o==null||o.onOpenChange(!1,h.nativeEvent))}}}))}const sb=()=>j.useContext(ob),tg=20;let Qr=[];function Mu(e){Qr=Qr.filter(n=>n.isConnected);let t=e;if(!(!t||Br(t)==="body")){if(!gD(t,io())){const n=tu(t,io())[0];n&&(t=n)}Qr.push(t),Qr.length>tg&&(Qr=Qr.slice(-tg))}}function ng(){return Qr.slice().reverse().find(e=>e.isConnected)}const d5=j.forwardRef(function(t,n){return j.createElement("button",hl({},t,{type:"button",ref:n,tabIndex:-1,style:Gd}))});function f5(e){const{context:t,children:n,disabled:r=!1,order:i=["content"],guards:a=!0,initialFocus:o=0,returnFocus:s=!0,restoreFocus:l=!1,modal:u=!0,visuallyHiddenDismiss:c=!1,closeOnFocusOut:d=!0}=e,{open:f,refs:h,nodeId:g,onOpenChange:m,events:p,dataRef:b,floatingId:v,elements:{domReference:y,floating:C}}=t,w=typeof o=="number"&&o<0,I=jw(y)&&w,E=r5()?a:!0,D=ii(i),$=ii(o),F=ii(s),_=zd(),P=sb(),k=j.useRef(null),A=j.useRef(null),B=j.useRef(!1),T=j.useRef(!1),R=j.useRef(-1),V=P!=null,H=C==null?void 0:C.firstElementChild,L=(H==null?void 0:H.id)===v?H:C,Z=Cr(function(Y){return Y===void 0&&(Y=L),Y?tu(Y,io()):[]}),O=Cr(Y=>{const N=Z(Y);return D.current.map(G=>y&&G==="reference"?y:L&&G==="floating"?L:N).filter(Boolean).flat()});j.useEffect(()=>{if(r||!u)return;function Y(G){if(G.key==="Tab"){Kt(L,Kr(xn(L)))&&Z().length===0&&!I&&Pu(G);const J=O(),re=ti(G);D.current[0]==="reference"&&re===y&&(Pu(G),G.shiftKey?Wr(J[J.length-1]):Wr(J[1])),D.current[1]==="floating"&&re===L&&G.shiftKey&&(Pu(G),Wr(J[0]))}}const N=xn(L);return N.addEventListener("keydown",Y),()=>{N.removeEventListener("keydown",Y)}},[r,y,L,u,D,I,Z,O]),j.useEffect(()=>{if(r||!C)return;function Y(N){const G=ti(N),re=Z().indexOf(G);re!==-1&&(R.current=re)}return C.addEventListener("focusin",Y),()=>{C.removeEventListener("focusin",Y)}},[r,C,Z]),j.useEffect(()=>{if(r||!d)return;function Y(){T.current=!0,setTimeout(()=>{T.current=!1})}function N(G){const J=G.relatedTarget;queueMicrotask(()=>{const re=!(Kt(y,J)||Kt(C,J)||Kt(J,C)||Kt(P==null?void 0:P.portalNode,J)||J!=null&&J.hasAttribute(ro("focus-guard"))||_&&(Wa(_.nodesRef.current,g).find(fe=>{var le,z;return Kt((le=fe.context)==null?void 0:le.elements.floating,J)||Kt((z=fe.context)==null?void 0:z.elements.domReference,J)})||n5(_.nodesRef.current,g).find(fe=>{var le,z;return((le=fe.context)==null?void 0:le.elements.floating)===J||((z=fe.context)==null?void 0:z.elements.domReference)===J})));if(l&&re&&Kr(xn(L))===xn(L).body){vt(L)&&(L==null||L.focus());const fe=R.current,le=Z(),z=le[fe]||le[le.length-1]||L;vt(z)&&z.focus()}(I||!u)&&J&&re&&!T.current&&J!==ng()&&(B.current=!0,m(!1,G))})}if(C&&vt(y))return y.addEventListener("focusout",N),y.addEventListener("pointerdown",Y),C.addEventListener("focusout",N),()=>{y.removeEventListener("focusout",N),y.removeEventListener("pointerdown",Y),C.removeEventListener("focusout",N)}},[r,y,C,L,u,g,_,P,m,d,l,Z,I]),j.useEffect(()=>{var Y;if(r)return;const N=Array.from((P==null||(Y=P.portalNode)==null?void 0:Y.querySelectorAll("["+ro("portal")+"]"))||[]);if(C){const G=[C,...N,k.current,A.current,D.current.includes("reference")||I?y:null].filter(re=>re!=null),J=u||I?Qh(G,E,!E):Qh(G);return()=>{J()}}},[r,y,C,u,D,P,I,E]),zt(()=>{if(r||!vt(L))return;const Y=xn(L),N=Kr(Y);queueMicrotask(()=>{const G=O(L),J=$.current,re=(typeof J=="number"?G[J]:J.current)||L,fe=Kt(L,N);!w&&!fe&&f&&Wr(re,{preventScroll:re===L})})},[r,f,L,w,O,$]),zt(()=>{if(r||!L)return;let Y=!1;const N=xn(L),G=Kr(N);let re=b.current.openEvent;Mu(G);function fe(le){let{open:z,reason:Ae,event:ke,nested:Xe}=le;z&&(re=ke),Ae==="escape-key"&&h.domReference.current&&Mu(h.domReference.current),Ae==="hover"&&ke.type==="mouseleave"&&(B.current=!0),Ae==="outside-press"&&(Xe?(B.current=!1,Y=!0):B.current=!(kw(ke)||Mw(ke)))}return p.on("openchange",fe),()=>{p.off("openchange",fe);const le=Kr(N),z=Kt(C,le)||_&&Wa(_.nodesRef.current,g).some(Xe=>{var et;return Kt((et=Xe.context)==null?void 0:et.elements.floating,le)});(z||re&&["click","mousedown"].includes(re.type))&&h.domReference.current&&Mu(h.domReference.current);const ke=ng();F.current&&!B.current&&vt(ke)&&(!(ke!==le&&le!==N.body)||z)&&Wr(ke,{cancelPrevious:!1,preventScroll:Y})}},[r,C,L,F,b,h,p,_,g]),zt(()=>{if(!r&&P)return P.setFocusManagerState({modal:u,closeOnFocusOut:d,open:f,onOpenChange:m,refs:h}),()=>{P.setFocusManagerState(null)}},[r,P,u,f,m,h,d]),zt(()=>{if(r||!L||typeof MutationObserver!="function"||w)return;const Y=()=>{const G=L.getAttribute("tabindex"),J=Z(),re=Kr(xn(C)),fe=J.indexOf(re);fe!==-1&&(R.current=fe),D.current.includes("floating")||re!==h.domReference.current&&J.length===0?G!=="0"&&L.setAttribute("tabindex","0"):G!=="-1"&&L.setAttribute("tabindex","-1")};Y();const N=new MutationObserver(Y);return N.observe(L,{childList:!0,subtree:!0,attributes:!0}),()=>{N.disconnect()}},[r,C,L,h,D,Z,w]);function W(Y){return r||!c||!u?null:j.createElement(d5,{ref:Y==="start"?k:A,onClick:N=>m(!1,N.nativeEvent)},typeof c=="string"?c:"Dismiss")}const q=!r&&E&&(u?!I:!0)&&(V||u);return j.createElement(j.Fragment,null,q&&j.createElement(gl,{"data-type":"inside",ref:P==null?void 0:P.beforeInsideRef,onFocus:Y=>{if(u){const G=O();Wr(i[0]==="reference"?G[0]:G[G.length-1])}else if(P!=null&&P.preserveTabOrder&&P.portalNode)if(B.current=!1,za(Y,P.portalNode)){const G=ib()||y;G==null||G.focus()}else{var N;(N=P.beforeOutsideRef.current)==null||N.focus()}}}),!I&&W("start"),n,W("end"),q&&j.createElement(gl,{"data-type":"inside",ref:P==null?void 0:P.afterInsideRef,onFocus:Y=>{if(u)Wr(O()[0]);else if(P!=null&&P.preserveTabOrder&&P.portalNode)if(d&&(B.current=!0),za(Y,P.portalNode)){const G=ab()||y;G==null||G.focus()}else{var N;(N=P.afterOutsideRef.current)==null||N.focus()}}}))}function rg(e){return vt(e.target)&&e.target.tagName==="BUTTON"}function ig(e){return O0(e)}function h5(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:i,elements:{domReference:a}}=e,{enabled:o=!0,event:s="click",toggle:l=!0,ignoreMouse:u=!1,keyboardHandlers:c=!0}=t,d=j.useRef(),f=j.useRef(!1),h=j.useMemo(()=>({onPointerDown(g){d.current=g.pointerType},onMouseDown(g){const m=d.current;g.button===0&&s!=="click"&&(Nh(m)&&u||(n&&l&&(!i.current.openEvent||i.current.openEvent.type==="mousedown")?r(!1,g.nativeEvent,"click"):(g.preventDefault(),r(!0,g.nativeEvent,"click"))))},onClick(g){const m=d.current;if(s==="mousedown"&&d.current){d.current=void 0;return}Nh(m)&&u||(n&&l&&(!i.current.openEvent||i.current.openEvent.type==="click")?r(!1,g.nativeEvent,"click"):r(!0,g.nativeEvent,"click"))},onKeyDown(g){d.current=void 0,!(g.defaultPrevented||!c||rg(g))&&(g.key===" "&&!ig(a)&&(g.preventDefault(),f.current=!0),g.key==="Enter"&&r(!(n&&l),g.nativeEvent,"click"))},onKeyUp(g){g.defaultPrevented||!c||rg(g)||ig(a)||g.key===" "&&f.current&&(f.current=!1,r(!(n&&l),g.nativeEvent,"click"))}}),[i,a,s,u,c,r,n,l]);return j.useMemo(()=>o?{reference:h}:{},[o,h])}const g5={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},m5={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},ag=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function p5(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:i,dataRef:a}=e,{enabled:o=!0,escapeKey:s=!0,outsidePress:l=!0,outsidePressEvent:u="pointerdown",referencePress:c=!1,referencePressEvent:d="pointerdown",ancestorScroll:f=!1,bubbles:h,capture:g}=t,m=zd(),p=Cr(typeof l=="function"?l:()=>!1),b=typeof l=="function"?p:l,v=j.useRef(!1),y=j.useRef(!1),{escapeKey:C,outsidePress:w}=ag(h),{escapeKey:I,outsidePress:E}=ag(g),D=Cr(A=>{var B;if(!n||!o||!s||A.key!=="Escape")return;const T=(B=a.current.floatingContext)==null?void 0:B.nodeId,R=m?Wa(m.nodesRef.current,T):[];if(!C&&(A.stopPropagation(),R.length>0)){let V=!0;if(R.forEach(H=>{var L;if((L=H.context)!=null&&L.open&&!H.context.dataRef.current.__escapeKeyBubbles){V=!1;return}}),!V)return}r(!1,Ow(A)?A.nativeEvent:A,"escape-key")}),$=Cr(A=>{var B;const T=()=>{var R;D(A),(R=ti(A))==null||R.removeEventListener("keydown",T)};(B=ti(A))==null||B.addEventListener("keydown",T)}),F=Cr(A=>{var B;const T=v.current;v.current=!1;const R=y.current;if(y.current=!1,u==="click"&&R||T||typeof b=="function"&&!b(A))return;const V=ti(A),H="["+ro("inert")+"]",L=xn(i.floating).querySelectorAll(H);let Z=rt(V)?V:null;for(;Z&&!Ar(Z);){const Y=fr(Z);if(Ar(Y)||!rt(Y))break;Z=Y}if(L.length&&rt(V)&&!Nw(V)&&!Kt(V,i.floating)&&Array.from(L).every(Y=>!Kt(Z,Y)))return;if(vt(V)&&k){const Y=V.clientWidth>0&&V.scrollWidth>V.clientWidth,N=V.clientHeight>0&&V.scrollHeight>V.clientHeight;let G=N&&A.offsetX>V.clientWidth;if(N&&vn(V).direction==="rtl"&&(G=A.offsetX<=V.offsetWidth-V.clientWidth),G||Y&&A.offsetY>V.clientHeight)return}const O=(B=a.current.floatingContext)==null?void 0:B.nodeId,W=m&&Wa(m.nodesRef.current,O).some(Y=>{var N;return Fu(A,(N=Y.context)==null?void 0:N.elements.floating)});if(Fu(A,i.floating)||Fu(A,i.domReference)||W)return;const q=m?Wa(m.nodesRef.current,O):[];if(q.length>0){let Y=!0;if(q.forEach(N=>{var G;if((G=N.context)!=null&&G.open&&!N.context.dataRef.current.__outsidePressBubbles){Y=!1;return}}),!Y)return}r(!1,A,"outside-press")}),_=Cr(A=>{var B;const T=()=>{var R;F(A),(R=ti(A))==null||R.removeEventListener(u,T)};(B=ti(A))==null||B.addEventListener(u,T)});j.useEffect(()=>{if(!n||!o)return;a.current.__escapeKeyBubbles=C,a.current.__outsidePressBubbles=w;function A(R){r(!1,R,"ancestor-scroll")}const B=xn(i.floating);s&&B.addEventListener("keydown",I?$:D,I),b&&B.addEventListener(u,E?_:F,E);let T=[];return f&&(rt(i.domReference)&&(T=$r(i.domReference)),rt(i.floating)&&(T=T.concat($r(i.floating))),!rt(i.reference)&&i.reference&&i.reference.contextElement&&(T=T.concat($r(i.reference.contextElement)))),T=T.filter(R=>{var V;return R!==((V=B.defaultView)==null?void 0:V.visualViewport)}),T.forEach(R=>{R.addEventListener("scroll",A,{passive:!0})}),()=>{s&&B.removeEventListener("keydown",I?$:D,I),b&&B.removeEventListener(u,E?_:F,E),T.forEach(R=>{R.removeEventListener("scroll",A)})}},[a,i,s,b,u,n,r,f,o,C,w,D,I,$,F,E,_]),j.useEffect(()=>{v.current=!1},[b,u]);const P=j.useMemo(()=>({onKeyDown:D,[g5[d]]:A=>{c&&r(!1,A.nativeEvent,"reference-press")}}),[D,r,c,d]),k=j.useMemo(()=>({onKeyDown:D,onMouseDown(){y.current=!0},onMouseUp(){y.current=!0},[m5[u]]:()=>{v.current=!0}}),[D,u]);return j.useMemo(()=>o?{reference:P,floating:k}:{},[o,P,k])}function b5(e){const{open:t=!1,onOpenChange:n,elements:r}=e,i=Wd(),a=j.useRef({}),[o]=j.useState(()=>qD()),s=tb()!=null;if(process.env.NODE_ENV!=="production"){const h=r.reference;h&&!rt(h)&&QD("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,u]=j.useState(r.reference),c=Cr((h,g,m)=>{a.current.openEvent=h?g:void 0,o.emit("openchange",{open:h,event:g,reason:m,nested:s}),n==null||n(h,g,m)}),d=j.useMemo(()=>({setPositionReference:u}),[]),f=j.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return j.useMemo(()=>({dataRef:a,open:t,onOpenChange:c,elements:f,events:o,floatingId:i,refs:d}),[t,c,f,o,i,d])}function v5(e){e===void 0&&(e={});const{nodeId:t}=e,n=b5({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,i=r.elements,[a,o]=j.useState(null),[s,l]=j.useState(null),c=(i==null?void 0:i.reference)||a,d=j.useRef(null),f=zd();zt(()=>{c&&(d.current=c)},[c]);const h=HD({...e,elements:{...i,...s&&{reference:s}}}),g=j.useCallback(y=>{const C=rt(y)?{getBoundingClientRect:()=>y.getBoundingClientRect(),contextElement:y}:y;l(C),h.refs.setReference(C)},[h.refs]),m=j.useCallback(y=>{(rt(y)||y===null)&&(d.current=y,o(y)),(rt(h.refs.reference.current)||h.refs.reference.current===null||y!==null&&!rt(y))&&h.refs.setReference(y)},[h.refs]),p=j.useMemo(()=>({...h.refs,setReference:m,setPositionReference:g,domReference:d}),[h.refs,m,g]),b=j.useMemo(()=>({...h.elements,domReference:c}),[h.elements,c]),v=j.useMemo(()=>({...h,...r,refs:p,elements:b,nodeId:t}),[h,p,b,t,r]);return zt(()=>{r.dataRef.current.floatingContext=v;const y=f==null?void 0:f.nodesRef.current.find(C=>C.id===t);y&&(y.context=v)}),j.useMemo(()=>({...h,context:v,refs:p,elements:b}),[h,p,b,v])}const og="active",sg="selected";function Bu(e,t,n){const r=new Map,i=n==="item";let a=e;if(i&&e){const{[og]:o,[sg]:s,...l}=e;a=l}return{...n==="floating"&&{tabIndex:-1},...a,...t.map(o=>{const s=o?o[n]:null;return typeof s=="function"?e?s(e):null:s}).concat(e).reduce((o,s)=>(s&&Object.entries(s).forEach(l=>{let[u,c]=l;if(!(i&&[og,sg].includes(u)))if(u.indexOf("on")===0){if(r.has(u)||r.set(u,[]),typeof c=="function"){var d;(d=r.get(u))==null||d.push(c),o[u]=function(){for(var f,h=arguments.length,g=new Array(h),m=0;m<h;m++)g[m]=arguments[m];return(f=r.get(u))==null?void 0:f.map(p=>p(...g)).find(p=>p!==void 0)}}}else o[u]=c}),o),{})}}function y5(e){e===void 0&&(e=[]);const t=e.map(s=>s==null?void 0:s.reference),n=e.map(s=>s==null?void 0:s.floating),r=e.map(s=>s==null?void 0:s.item),i=j.useCallback(s=>Bu(s,e,"reference"),t),a=j.useCallback(s=>Bu(s,e,"floating"),n),o=j.useCallback(s=>Bu(s,e,"item"),r);return j.useMemo(()=>({getReferenceProps:i,getFloatingProps:a,getItemProps:o}),[i,a,o])}const x5=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function C5(e,t){var n;t===void 0&&(t={});const{open:r,floatingId:i}=e,{enabled:a=!0,role:o="dialog"}=t,s=(n=x5.get(o))!=null?n:o,l=Wd(),c=tb()!=null,d=j.useMemo(()=>s==="tooltip"||o==="label"?{["aria-"+(o==="label"?"labelledby":"describedby")]:r?i:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":s==="alertdialog"?"dialog":s,"aria-controls":r?i:void 0,...s==="listbox"&&{role:"combobox"},...s==="menu"&&{id:l},...s==="menu"&&c&&{role:"menuitem"},...o==="select"&&{"aria-autocomplete":"none"},...o==="combobox"&&{"aria-autocomplete":"list"}},[s,i,c,r,l,o]),f=j.useMemo(()=>{const g={id:i,...s&&{role:s}};return s==="tooltip"||o==="label"?g:{...g,...s==="menu"&&{"aria-labelledby":l}}},[s,i,l,o]),h=j.useCallback(g=>{let{active:m,selected:p}=g;const b={role:"option",...m&&{id:i+"-option"}};switch(o){case"select":return{...b,"aria-selected":m&&p};case"combobox":return{...b,...m&&{"aria-selected":!0}}}return{}},[i,o]);return j.useMemo(()=>a?{reference:d,floating:f,item:h}:{},[a,d,f,h])}const lg=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(t,n)=>(n?"-":"")+t.toLowerCase());function Ti(e,t){return typeof e=="function"?e(t):e}function w5(e,t){const[n,r]=j.useState(e);return e&&!n&&r(!0),j.useEffect(()=>{if(!e&&n){const i=setTimeout(()=>r(!1),t);return()=>clearTimeout(i)}},[e,n,t]),n}function D5(e,t){t===void 0&&(t={});const{open:n,elements:{floating:r}}=e,{duration:i=250}=t,o=(typeof i=="number"?i:i.close)||0,[s,l]=j.useState("unmounted"),u=w5(n,o);return!u&&s==="close"&&l("unmounted"),zt(()=>{if(r){if(n){l("initial");const c=requestAnimationFrame(()=>{l("open")});return()=>{cancelAnimationFrame(c)}}l("close")}},[n,r]),{isMounted:u,status:s}}function S5(e,t){t===void 0&&(t={});const{initial:n={opacity:0},open:r,close:i,common:a,duration:o=250}=t,s=e.placement,l=s.split("-")[0],u=j.useMemo(()=>({side:l,placement:s}),[l,s]),c=typeof o=="number",d=(c?o:o.open)||0,f=(c?o:o.close)||0,[h,g]=j.useState(()=>({...Ti(a,u),...Ti(n,u)})),{isMounted:m,status:p}=D5(e,{duration:o}),b=ii(n),v=ii(r),y=ii(i),C=ii(a);return zt(()=>{const w=Ti(b.current,u),I=Ti(y.current,u),E=Ti(C.current,u),D=Ti(v.current,u)||Object.keys(w).reduce(($,F)=>($[F]="",$),{});if(p==="initial"&&g($=>({transitionProperty:$.transitionProperty,...E,...w})),p==="open"&&g({transitionProperty:Object.keys(D).map(lg).join(","),transitionDuration:d+"ms",...E,...D}),p==="close"){const $=I||w;g({transitionProperty:Object.keys($).map(lg).join(","),transitionDuration:f+"ms",...E,...$})}},[f,y,b,v,C,d,p,u]),{isMounted:m,styles:h}}const I5="_popover_7cinv_1",E5={popover:I5},wi=x.forwardRef((e,t)=>{const{children:n,className:r,offset:i=10,isShow:a,anchorEl:o,useAutoPlacement:s=!1,flipOptions:l,autoPlacementOptions:u,zIndex:c=10,width:d,styleInnerPopover:f={},floatingOptions:h={},...g}=e,[m,p]=x.useState(!1),{refs:b,floatingStyles:v,context:y}=v5({open:m,onOpenChange:p,middleware:[WD(i),s?ZD(u):GD(l),zD()],whileElementsMounted:Q0,...h}),C=h5(y),w=p5(y),I=C5(y),{getReferenceProps:E,getFloatingProps:D}=y5([C,w,I]),{styles:$,isMounted:F}=S5(y),_=k=>{b.setReference(k.currentTarget),p(A=>!A)};x.useEffect(()=>{a&&o?_({currentTarget:o}):a||p(!1)},[a,o]),x.useImperativeHandle(t,()=>({show:m,setShow:p,handlerShow:_,getReferenceProps:E}),[m]);const P=()=>{let k={...v,...$,...f,zIndex:c};return d&&(k={...k,width:d}),k};return S.jsx(S.Fragment,{children:F&&m&&S.jsx(c5,{children:S.jsx(f5,{context:y,modal:!1,children:S.jsx("div",{ref:b.setFloating,style:P(),...D(),className:`${E5.popover} ${r??""}`,...g,children:n})})})})});wi.displayName="Popover";const _5="_input_17tnz_7",$5="_label_17tnz_35",R5="_error_17tnz_42",Ut={"container-large":"_container-large_17tnz_1","container-input":"_container-input_17tnz_4",input:_5,label:$5,error:R5,"isset-right-icon":"_isset-right-icon_17tnz_53","isset-left-icon":"_isset-left-icon_17tnz_56","start-icon":"_start-icon_17tnz_63","end-icon":"_end-icon_17tnz_66","label-error":"_label-error_17tnz_72","container-medium":"_container-medium_17tnz_77"},lb=x.forwardRef((e,t)=>{var y;const{isRequired:n,classNameContainer:r,classNameLabelError:i,classNameLabel:a,className:o,name:s,id:l,label:u,type:c="text",startIcon:d,endIcon:f,error:h,sizeInput:g="large",...m}=e,p={size:{large:Ut["container-large"],medium:Ut["container-medium"]},variant:{}},b=()=>typeof d=="function"||x.isValidElement(d),v=()=>typeof f=="function"||x.isValidElement(f);return S.jsxs("div",{className:`${Ut.container} ${(y=p.size)==null?void 0:y[g]} ${r??""}`,children:[S.jsxs("div",{className:Ut["container-input"],children:[S.jsx("input",{id:l??s,className:`${Ut.input} ${h?Ut.error:""}
|
45
45
|
${b()?Ut["isset-left-icon"]:""}
|
46
46
|
${v()?Ut["isset-right-icon"]:""}
|
47
47
|
${o??""}`,ref:t,type:c,...m}),S.jsxs("div",{className:Ut["start-icon"],children:[typeof d=="function"&&d(),x.isValidElement(d)&&d]}),S.jsxs("label",{className:`${Ut.label} ${a??""}`,htmlFor:l??s,children:[u," ",n&&S.jsx("span",{className:"1ru-text-laba-red-08",children:"*"})]}),S.jsxs("div",{className:Ut["end-icon"],children:[typeof f=="function"&&f(),x.isValidElement(f)&&f]})]}),h&&S.jsx("label",{className:`${Ut["label-error"]}
|
@@ -70,7 +70,7 @@ React keys must be passed directly to JSX without using spread:
|
|
70
70
|
* LICENSE.md file in the root directory of this source tree.
|
71
71
|
*
|
72
72
|
* @license MIT
|
73
|
-
*/function ao(e,t){return e?cS(e)?j.createElement(e,t):e:null}function cS(e){return dS(e)||typeof e=="function"||fS(e)}function dS(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function fS(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function hS(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=j.useState(()=>({current:Ob(t)})),[r,i]=j.useState(()=>n.current.initialState);return n.current.setOptions(a=>({...a,...e,state:{...r,...e.state},onStateChange:o=>{i(o),e.onStateChange==null||e.onStateChange(o)}})),n.current}const gS=Object.freeze(Object.defineProperty({__proto__:null,ColumnFaceting:hb,ColumnFiltering:wb,ColumnGrouping:Db,ColumnOrdering:Ib,ColumnPinning:Eb,ColumnSizing:_b,ColumnVisibility:Rb,GlobalFaceting:Ab,GlobalFiltering:Fb,Headers:fb,RowExpanding:Pb,RowPagination:Tb,RowPinning:kb,RowSelection:Mb,RowSorting:Vb,_getVisibleLeafColumns:Ui,aggregationFns:Ls,buildHeaderGroups:Aa,createCell:cb,createColumn:db,createColumnHelper:k5,createRow:Oo,createTable:Ob,defaultColumnSizing:Fa,expandRows:Jd,filterFns:Mn,flattenBy:Xd,flexRender:ao,functionalUpdate:ar,getCoreRowModel:Q5,getExpandedRowModel:q5,getFacetedMinMaxValues:eS,getFacetedRowModel:rS,getFacetedUniqueValues:iS,getFilteredRowModel:aS,getGroupedRowModel:oS,getMemoOptions:oe,getPaginationRowModel:lS,getSortedRowModel:uS,isFunction:Vo,isNumberArray:ub,isRowSelected:nu,isSubRowSelected:ml,makeStateUpdater:Gt,memo:ae,noop:M5,orderColumns:Sb,passiveEventSupported:$b,reSplitAlphaNumeric:pl,selectRowsFn:js,shouldAutoRemoveFilter:Bc,sortingFns:zi,useReactTable:hS},Symbol.toStringTag,{value:"Module"})),ru=0,Vr=1,ga=2,Lb=4;function oo(e,t){return n=>e(t(n))}function mS(e,t){return t(e)}function jb(e,t){return n=>e(t,n)}function cg(e,t){return()=>e(t)}function iu(e,t){return t(e),e}function Ue(...e){return e}function pS(e){e()}function dg(e){return()=>e}function bS(...e){return()=>{e.map(pS)}}function Kd(e){return e!==void 0}function Di(){}function We(e,t){return e(Vr,t)}function ve(e,t){e(ru,t)}function Qd(e){e(ga)}function Rt(e){return e(Lb)}function se(e,t){return We(e,jb(t,ru))}function Wn(e,t){const n=e(Vr,r=>{n(),t(r)});return n}function Ee(){const e=[];return(t,n)=>{switch(t){case ga:e.splice(0,e.length);return;case Vr:return e.push(n),()=>{const r=e.indexOf(n);r>-1&&e.splice(r,1)};case ru:e.slice().forEach(r=>{r(n)});return;default:throw new Error(`unrecognized action ${t}`)}}}function K(e){let t=e;const n=Ee();return(r,i)=>{switch(r){case Vr:i(t);break;case ru:t=i;break;case Lb:return t}return n(r,i)}}function vS(e){let t,n;const r=()=>t&&t();return function(i,a){switch(i){case Vr:return a?n===a?void 0:(r(),n=a,t=We(e,a),t):(r(),Di);case ga:r(),n=null;return;default:throw new Error(`unrecognized action ${i}`)}}}function rn(e){return iu(Ee(),t=>se(e,t))}function At(e,t){return iu(K(t),n=>se(e,n))}function yS(...e){return t=>e.reduceRight(mS,t)}function U(e,...t){const n=yS(...t);return(r,i)=>{switch(r){case Vr:return We(e,n(i));case ga:Qd(e);return}}}function Hb(e,t){return e===t}function Ye(e=Hb){let t;return n=>r=>{e(t,r)||(t=r,n(r))}}function pe(e){return t=>n=>{e(n)&&t(n)}}function te(e){return t=>oo(t,e)}function Bn(e){return t=>()=>t(e)}function On(e,t){return n=>r=>n(t=e(t,r))}function oa(e){return t=>n=>{e>0?e--:t(n)}}function Dr(e){let t=null,n;return r=>i=>{t=i,!n&&(n=setTimeout(()=>{n=void 0,r(t)},e))}}function fg(e){let t,n;return r=>i=>{t=i,n&&clearTimeout(n),n=setTimeout(()=>{r(t)},e)}}function ye(...e){const t=new Array(e.length);let n=0,r=null;const i=Math.pow(2,e.length)-1;return e.forEach((a,o)=>{const s=Math.pow(2,o);We(a,l=>{const u=n;n=n|s,t[o]=l,u!==i&&n===i&&r&&(r(),r=null)})}),a=>o=>{const s=()=>a([o].concat(t));n===i?s():r=s}}function hg(...e){return function(t,n){switch(t){case Vr:return bS(...e.map(r=>We(r,n)));case ga:return;default:throw new Error(`unrecognized action ${t}`)}}}function be(e,t=Hb){return U(e,Ye(t))}function yt(...e){const t=Ee(),n=new Array(e.length);let r=0;const i=Math.pow(2,e.length)-1;return e.forEach((a,o)=>{const s=Math.pow(2,o);We(a,l=>{n[o]=l,r=r|s,r===i&&ve(t,n)})}),function(a,o){switch(a){case Vr:return r===i&&o(n),We(t,o);case ga:return Qd(t);default:throw new Error(`unrecognized action ${a}`)}}}function Te(e,t=[],{singleton:n}={singleton:!0}){return{id:xS(),constructor:e,dependencies:t,singleton:n}}const xS=()=>Symbol();function CS(e){const t=new Map,n=({id:r,constructor:i,dependencies:a,singleton:o})=>{if(o&&t.has(r))return t.get(r);const s=i(a.map(l=>n(l)));return o&&t.set(r,s),s};return n(e)}function wS(e,t){const n={},r={};let i=0;const a=e.length;for(;i<a;)r[e[i]]=1,i+=1;for(const o in t)r.hasOwnProperty(o)||(n[o]=t[o]);return n}const os=typeof document<"u"?x.useLayoutEffect:x.useEffect;function qd(e,t,n){const r=Object.keys(t.required||{}),i=Object.keys(t.optional||{}),a=Object.keys(t.methods||{}),o=Object.keys(t.events||{}),s=x.createContext({});function l(b,v){b.propsReady&&ve(b.propsReady,!1);for(const y of r){const C=b[t.required[y]];ve(C,v[y])}for(const y of i)if(y in v){const C=b[t.optional[y]];ve(C,v[y])}b.propsReady&&ve(b.propsReady,!0)}function u(b){return a.reduce((v,y)=>(v[y]=C=>{const w=b[t.methods[y]];ve(w,C)},v),{})}function c(b){return o.reduce((v,y)=>(v[y]=vS(b[t.events[y]]),v),{})}const d=x.forwardRef((b,v)=>{const{children:y,...C}=b,[w]=x.useState(()=>iu(CS(e),E=>l(E,C))),[I]=x.useState(cg(c,w));return os(()=>{for(const E of o)E in C&&We(I[E],C[E]);return()=>{Object.values(I).map(Qd)}},[C,I,w]),os(()=>{l(w,C)}),x.useImperativeHandle(v,dg(u(w))),x.createElement(s.Provider,{value:w},n?x.createElement(n,wS([...r,...i,...o],C),y):y)}),f=b=>x.useCallback(jb(ve,x.useContext(s)[b]),[b]),h=b=>{const y=x.useContext(s)[b],C=x.useCallback(w=>We(y,w),[y]);return x.useSyncExternalStore(C,()=>Rt(y),()=>Rt(y))},g=b=>{const y=x.useContext(s)[b],[C,w]=x.useState(cg(Rt,y));return os(()=>We(y,I=>{I!==C&&w(dg(I))}),[y,C]),C},m=x.version.startsWith("18")?h:g;return{Component:d,usePublisher:f,useEmitterValue:m,useEmitter:(b,v)=>{const C=x.useContext(s)[b];os(()=>We(C,v),[v,C])}}}const DS=typeof document<"u"?x.useLayoutEffect:x.useEffect,SS=DS;var an=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e))(an||{});const IS={0:"debug",1:"log",2:"warn",3:"error"},ES=()=>typeof globalThis>"u"?window:globalThis,Or=Te(()=>{const e=K(3);return{log:K((n,r,i=1)=>{var a;const o=(a=ES().VIRTUOSO_LOG_LEVEL)!=null?a:Rt(e);i>=o&&console[IS[i]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",n,r)}),logLevel:e}},[],{singleton:!0});function ef(e,t=!0){const n=x.useRef(null);let r=i=>{};if(typeof ResizeObserver<"u"){const i=x.useMemo(()=>new ResizeObserver(a=>{requestAnimationFrame(()=>{const o=a[0].target;o.offsetParent!==null&&e(o)})}),[e]);r=a=>{a&&t?(i.observe(a),n.current=a):(n.current&&i.unobserve(n.current),n.current=null)}}return{ref:n,callbackRef:r}}function zn(e,t=!0){return ef(e,t).callbackRef}function Wb(e,t,n,r,i,a,o){const s=x.useCallback(l=>{const u=_S(l.children,t,"offsetHeight",i);let c=l.parentElement;for(;!c.dataset.virtuosoScroller;)c=c.parentElement;const d=c.lastElementChild.dataset.viewportType==="window",f=o?o.scrollTop:d?window.pageYOffset||document.documentElement.scrollTop:c.scrollTop,h=o?o.scrollHeight:d?document.documentElement.scrollHeight:c.scrollHeight,g=o?o.offsetHeight:d?window.innerHeight:c.offsetHeight;r({scrollTop:Math.max(f,0),scrollHeight:h,viewportHeight:g}),a==null||a($S("row-gap",getComputedStyle(l).rowGap,i)),u!==null&&e(u)},[e,t,i,a,o,r]);return ef(s,n)}function _S(e,t,n,r){const i=e.length;if(i===0)return null;const a=[];for(let o=0;o<i;o++){const s=e.item(o);if(!s||s.dataset.index===void 0)continue;const l=parseInt(s.dataset.index),u=parseFloat(s.dataset.knownSize),c=t(s,n);if(c===0&&r("Zero-sized element, this should not happen",{child:s},an.ERROR),c===u)continue;const d=a[a.length-1];a.length===0||d.size!==c||d.endIndex!==l-1?a.push({startIndex:l,endIndex:l,size:c}):a[a.length-1].endIndex++}return a}function $S(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,an.WARN),t==="normal"?0:parseInt(t??"0",10)}function _n(e,t){return Math.round(e.getBoundingClientRect()[t])}function zb(e,t){return Math.abs(e-t)<1.01}function Gb(e,t,n,r=Di,i){const a=x.useRef(null),o=x.useRef(null),s=x.useRef(null),l=x.useCallback(d=>{const f=d.target,h=f===window||f===document,g=h?window.pageYOffset||document.documentElement.scrollTop:f.scrollTop,m=h?document.documentElement.scrollHeight:f.scrollHeight,p=h?window.innerHeight:f.offsetHeight,b=()=>{e({scrollTop:Math.max(g,0),scrollHeight:m,viewportHeight:p})};d.suppressFlushSync?b():ko.flushSync(b),o.current!==null&&(g===o.current||g<=0||g===m-p)&&(o.current=null,t(!0),s.current&&(clearTimeout(s.current),s.current=null))},[e,t]);x.useEffect(()=>{const d=i||a.current;return r(i||a.current),l({target:d,suppressFlushSync:!0}),d.addEventListener("scroll",l,{passive:!0}),()=>{r(null),d.removeEventListener("scroll",l)}},[a,l,n,r,i]);function u(d){const f=a.current;if(!f||"offsetHeight"in f&&f.offsetHeight===0)return;const h=d.behavior==="smooth";let g,m,p;f===window?(m=Math.max(_n(document.documentElement,"height"),document.documentElement.scrollHeight),g=window.innerHeight,p=document.documentElement.scrollTop):(m=f.scrollHeight,g=_n(f,"height"),p=f.scrollTop);const b=m-g;if(d.top=Math.ceil(Math.max(Math.min(b,d.top),0)),zb(g,m)||d.top===p){e({scrollTop:p,scrollHeight:m,viewportHeight:g}),h&&t(!0);return}h?(o.current=d.top,s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{s.current=null,o.current=null,t(!0)},1e3)):o.current=null,f.scrollTo(d)}function c(d){a.current.scrollBy(d)}return{scrollerRef:a,scrollByCallback:c,scrollToCallback:u}}const Bt=Te(()=>{const e=Ee(),t=Ee(),n=K(0),r=Ee(),i=K(0),a=Ee(),o=Ee(),s=K(0),l=K(0),u=K(0),c=K(0),d=Ee(),f=Ee(),h=K(!1);return se(U(e,te(({scrollTop:g})=>g)),t),se(U(e,te(({scrollHeight:g})=>g)),o),se(t,i),{scrollContainerState:e,scrollTop:t,viewportHeight:a,headerHeight:s,fixedHeaderHeight:l,fixedFooterHeight:u,footerHeight:c,scrollHeight:o,smoothScrollTargetReached:r,scrollTo:d,scrollBy:f,statefulScrollTop:i,deviation:n,scrollingInProgress:h}},[],{singleton:!0}),so={lvl:0};function Zb(e,t,n,r=so,i=so){return{k:e,v:t,lvl:n,l:r,r:i}}function Ge(e){return e===so}function Ji(){return so}function Lc(e,t){if(Ge(e))return so;const{k:n,l:r,r:i}=e;if(t===n){if(Ge(r))return i;if(Ge(i))return r;{const[a,o]=Xb(r);return Hs(mt(e,{k:a,v:o,l:Yb(r)}))}}else return t<n?Hs(mt(e,{l:Lc(r,t)})):Hs(mt(e,{r:Lc(i,t)}))}function lo(e,t){if(!Ge(e))return t===e.k?e.v:t<e.k?lo(e.l,t):lo(e.r,t)}function $n(e,t,n="k"){if(Ge(e))return[-1/0,void 0];if(Number(e[n])===t)return[e.k,e.v];if(Number(e[n])<t){const r=$n(e.r,t,n);return r[0]===-1/0?[e.k,e.v]:r}return $n(e.l,t,n)}function qt(e,t,n){return Ge(e)?Zb(t,n,1):t===e.k?mt(e,{k:t,v:n}):t<e.k?gg(mt(e,{l:qt(e.l,t,n)})):gg(mt(e,{r:qt(e.r,t,n)}))}function jc(e,t,n){if(Ge(e))return[];const{k:r,v:i,l:a,r:o}=e;let s=[];return r>t&&(s=s.concat(jc(a,t,n))),r>=t&&r<=n&&s.push({k:r,v:i}),r<=n&&(s=s.concat(jc(o,t,n))),s}function ai(e){return Ge(e)?[]:[...ai(e.l),{k:e.k,v:e.v},...ai(e.r)]}function Xb(e){return Ge(e.r)?[e.k,e.v]:Xb(e.r)}function Yb(e){return Ge(e.r)?e.l:Hs(mt(e,{r:Yb(e.r)}))}function mt(e,t){return Zb(t.k!==void 0?t.k:e.k,t.v!==void 0?t.v:e.v,t.lvl!==void 0?t.lvl:e.lvl,t.l!==void 0?t.l:e.l,t.r!==void 0?t.r:e.r)}function Hu(e){return Ge(e)||e.lvl>e.r.lvl}function gg(e){return Hc(Jb(e))}function Hs(e){const{l:t,r:n,lvl:r}=e;if(n.lvl>=r-1&&t.lvl>=r-1)return e;if(r>n.lvl+1){if(Hu(t))return Jb(mt(e,{lvl:r-1}));if(!Ge(t)&&!Ge(t.r))return mt(t.r,{l:mt(t,{r:t.r.l}),r:mt(e,{l:t.r.r,lvl:r-1}),lvl:r});throw new Error("Unexpected empty nodes")}else{if(Hu(e))return Hc(mt(e,{lvl:r-1}));if(!Ge(n)&&!Ge(n.l)){const i=n.l,a=Hu(i)?n.lvl-1:n.lvl;return mt(i,{l:mt(e,{r:i.l,lvl:r-1}),r:Hc(mt(n,{l:i.r,lvl:a})),lvl:i.lvl+1})}else throw new Error("Unexpected empty nodes")}}function au(e,t,n){if(Ge(e))return[];const r=$n(e,t)[0];return RS(jc(e,r,n))}function Ub(e,t){const n=e.length;if(n===0)return[];let{index:r,value:i}=t(e[0]);const a=[];for(let o=1;o<n;o++){const{index:s,value:l}=t(e[o]);a.push({start:r,end:s-1,value:i}),r=s,i=l}return a.push({start:r,end:1/0,value:i}),a}function RS(e){return Ub(e,({k:t,v:n})=>({index:t,value:n}))}function Hc(e){const{r:t,lvl:n}=e;return!Ge(t)&&!Ge(t.r)&&t.lvl===n&&t.r.lvl===n?mt(t,{l:mt(e,{r:t.l}),lvl:n+1}):e}function Jb(e){const{l:t}=e;return!Ge(t)&&t.lvl===e.lvl?mt(t,{r:mt(e,{l:t.r})}):e}function bl(e,t,n,r=0){let i=e.length-1;for(;r<=i;){const a=Math.floor((r+i)/2),o=e[a],s=n(o,t);if(s===0)return a;if(s===-1){if(i-r<2)return a-1;i=a-1}else{if(i===r)return a;r=a+1}}throw new Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function Kb(e,t,n){return e[bl(e,t,n)]}function AS(e,t,n,r){const i=bl(e,t,r),a=bl(e,n,r,i);return e.slice(i,a+1)}const tf=Te(()=>({recalcInProgress:K(!1)}),[],{singleton:!0});function FS(e){const{size:t,startIndex:n,endIndex:r}=e;return i=>i.start===n&&(i.end===r||i.end===1/0)&&i.value===t}function mg(e,t){let n=0,r=0;for(;n<e;)n+=t[r+1]-t[r]-1,r++;return r-(n===e?0:1)}function PS(e,t){let n=Ge(e)?0:1/0;for(const r of t){const{size:i,startIndex:a,endIndex:o}=r;if(n=Math.min(n,a),Ge(e)){e=qt(e,0,i);continue}const s=au(e,a-1,o+1);if(s.some(FS(r)))continue;let l=!1,u=!1;for(const{start:c,end:d,value:f}of s)l?(o>=c||i===f)&&(e=Lc(e,c)):(u=f!==i,l=!0),d>o&&o>=c&&f!==i&&(e=qt(e,o+1,f));u&&(e=qt(e,a,i))}return[e,n]}function TS(){return{offsetTree:[],sizeTree:Ji(),groupOffsetTree:Ji(),lastIndex:0,lastOffset:0,lastSize:0,groupIndices:[]}}function nf({index:e},t){return t===e?0:t<e?-1:1}function kS({offset:e},t){return t===e?0:t<e?-1:1}function MS(e){return{index:e.index,value:e}}function BS(e,t,n,r=0){return r>0&&(t=Math.max(t,Kb(e,r,nf).offset)),Ub(AS(e,t,n,kS),MS)}function Wc(e,t,n,r){let i=e,a=0,o=0,s=0,l=0;if(t!==0){l=bl(i,t-1,nf),s=i[l].offset;const c=$n(n,t-1);a=c[0],o=c[1],i.length&&i[l].size===$n(n,t)[1]&&(l-=1),i=i.slice(0,l+1)}else i=[];for(const{start:u,value:c}of au(n,t,1/0)){const d=u-a,f=d*o+s+d*r;i.push({offset:f,size:c,index:u}),a=u,s=f,o=c}return{offsetTree:i,lastIndex:a,lastOffset:s,lastSize:o}}function VS(e,[t,n,r,i]){t.length>0&&r("received item sizes",t,an.DEBUG);const a=e.sizeTree;let o=a,s=0;if(n.length>0&&Ge(a)&&t.length===2){const f=t[0].size,h=t[1].size;o=n.reduce((g,m)=>qt(qt(g,m,f),m+1,h),o)}else[o,s]=PS(o,t);if(o===a)return e;const{offsetTree:l,lastIndex:u,lastSize:c,lastOffset:d}=Wc(e.offsetTree,s,o,i);return{sizeTree:o,offsetTree:l,lastIndex:u,lastOffset:d,lastSize:c,groupOffsetTree:n.reduce((f,h)=>qt(f,h,uo(h,l,i)),Ji()),groupIndices:n}}function uo(e,t,n){if(t.length===0)return 0;const{offset:r,index:i,size:a}=Kb(t,e,nf),o=e-i,s=a*o+(o-1)*n+r;return s>0?s+n:s}function OS(e){return typeof e.groupIndex<"u"}function Qb(e,t,n){if(OS(e))return t.groupIndices[e.groupIndex]+1;{const r=e.index==="LAST"?n:e.index;let i=qb(r,t);return i=Math.max(0,i,Math.min(n,i)),i}}function qb(e,t){if(!ou(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function ou(e){return!Ge(e.groupOffsetTree)}function NS(e){return ai(e).map(({k:t,v:n},r,i)=>{const a=i[r+1],o=a?a.k-1:1/0;return{startIndex:t,endIndex:o,size:n}})}const LS={offsetHeight:"height",offsetWidth:"width"},Gn=Te(([{log:e},{recalcInProgress:t}])=>{const n=Ee(),r=Ee(),i=At(r,0),a=Ee(),o=Ee(),s=K(0),l=K([]),u=K(void 0),c=K(void 0),d=K((w,I)=>_n(w,LS[I])),f=K(void 0),h=K(0),g=TS(),m=At(U(n,ye(l,e,h),On(VS,g),Ye()),g),p=At(U(l,Ye(),On((w,I)=>({prev:w.current,current:I}),{prev:[],current:[]}),te(({prev:w})=>w)),[]);se(U(l,pe(w=>w.length>0),ye(m,h),te(([w,I,E])=>{const D=w.reduce(($,F,_)=>qt($,F,uo(F,I.offsetTree,E)||_),Ji());return{...I,groupIndices:w,groupOffsetTree:D}})),m),se(U(r,ye(m),pe(([w,{lastIndex:I}])=>w<I),te(([w,{lastIndex:I,lastSize:E}])=>[{startIndex:w,endIndex:I,size:E}])),n),se(u,c);const b=At(U(u,te(w=>w===void 0)),!0);se(U(c,pe(w=>w!==void 0&&Ge(Rt(m).sizeTree)),te(w=>[{startIndex:0,endIndex:0,size:w}])),n);const v=rn(U(n,ye(m),On(({sizes:w},[I,E])=>({changed:E!==w,sizes:E}),{changed:!1,sizes:g}),te(w=>w.changed)));We(U(s,On((w,I)=>({diff:w.prev-I,prev:I}),{diff:0,prev:0}),te(w=>w.diff)),w=>{const{groupIndices:I}=Rt(m);if(w>0)ve(t,!0),ve(a,w+mg(w,I));else if(w<0){const E=Rt(p);E.length>0&&(w-=mg(-w,E)),ve(o,w)}}),We(U(s,ye(e)),([w,I])=>{w<0&&I("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:s},an.ERROR)});const y=rn(a);se(U(a,ye(m),te(([w,I])=>{const E=I.groupIndices.length>0,D=[],$=I.lastSize;if(E){const F=lo(I.sizeTree,0);let _=0,P=0;for(;_<w;){const B=I.groupIndices[P],T=I.groupIndices.length===P+1?1/0:I.groupIndices[P+1]-B-1;D.push({startIndex:B,endIndex:B,size:F}),D.push({startIndex:B+1,endIndex:B+1+T-1,size:$}),P++,_+=T+1}const k=ai(I.sizeTree);return _!==w&&k.shift(),k.reduce((B,{k:T,v:R})=>{let V=B.ranges;return B.prevSize!==0&&(V=[...B.ranges,{startIndex:B.prevIndex,endIndex:T+w-1,size:B.prevSize}]),{ranges:V,prevIndex:T+w,prevSize:R}},{ranges:D,prevIndex:w,prevSize:0}).ranges}return ai(I.sizeTree).reduce((F,{k:_,v:P})=>({ranges:[...F.ranges,{startIndex:F.prevIndex,endIndex:_+w-1,size:F.prevSize}],prevIndex:_+w,prevSize:P}),{ranges:[],prevIndex:0,prevSize:$}).ranges})),n);const C=rn(U(o,ye(m,h),te(([w,{offsetTree:I},E])=>{const D=-w;return uo(D,I,E)})));return se(U(o,ye(m,h),te(([w,I,E])=>{if(I.groupIndices.length>0){if(Ge(I.sizeTree))return I;let $=Ji();const F=Rt(p);let _=0,P=0,k=0;for(;_<-w;){k=F[P];const B=F[P+1]-k-1;P++,_+=B+1}if($=ai(I.sizeTree).reduce((B,{k:T,v:R})=>qt(B,Math.max(0,T+w),R),$),_!==-w){const B=lo(I.sizeTree,k);$=qt($,0,B);const T=$n(I.sizeTree,-w+1)[1];$=qt($,1,T)}return{...I,sizeTree:$,...Wc(I.offsetTree,0,$,E)}}else{const $=ai(I.sizeTree).reduce((F,{k:_,v:P})=>qt(F,Math.max(0,_+w),P),Ji());return{...I,sizeTree:$,...Wc(I.offsetTree,0,$,E)}}})),m),{data:f,totalCount:r,sizeRanges:n,groupIndices:l,defaultItemSize:c,fixedItemSize:u,unshiftWith:a,shiftWith:o,shiftWithOffset:C,beforeUnshiftWith:y,firstItemIndex:s,gap:h,sizes:m,listRefresh:v,statefulTotalCount:i,trackItemSizes:b,itemSize:d}},Ue(Or,tf),{singleton:!0}),jS=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function e1(e){const t=typeof e=="number"?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!jS)&&(t.behavior="auto"),t.offset||(t.offset=0),t}const No=Te(([{sizes:e,totalCount:t,listRefresh:n,gap:r},{scrollingInProgress:i,viewportHeight:a,scrollTo:o,smoothScrollTargetReached:s,headerHeight:l,footerHeight:u,fixedHeaderHeight:c,fixedFooterHeight:d},{log:f}])=>{const h=Ee(),g=Ee(),m=K(0);let p=null,b=null,v=null;function y(){p&&(p(),p=null),v&&(v(),v=null),b&&(clearTimeout(b),b=null),ve(i,!1)}return se(U(h,ye(e,a,t,m,l,u,f),ye(r,c,d),te(([[C,w,I,E,D,$,F,_],P,k,A])=>{const B=e1(C),{align:T,behavior:R,offset:V}=B,H=E-1,L=Qb(B,w,H);let Z=uo(L,w.offsetTree,P)+$;T==="end"?(Z+=k+$n(w.sizeTree,L)[1]-I+A,L===H&&(Z+=F)):T==="center"?Z+=(k+$n(w.sizeTree,L)[1]-I+A)/2:Z-=D,V&&(Z+=V);const O=W=>{y(),W?(_("retrying to scroll to",{location:C},an.DEBUG),ve(h,C)):(ve(g,!0),_("list did not change, scroll successful",{},an.DEBUG))};if(y(),R==="smooth"){let W=!1;v=We(n,q=>{W=W||q}),p=Wn(s,()=>{O(W)})}else p=Wn(U(n,HS(150)),O);return b=setTimeout(()=>{y()},1200),ve(i,!0),_("scrolling from index to",{index:L,top:Z,behavior:R},an.DEBUG),{top:Z,behavior:R}})),o),{scrollToIndex:h,scrollTargetReached:g,topListHeight:m}},Ue(Gn,Bt,Or),{singleton:!0});function HS(e){return t=>{const n=setTimeout(()=>{t(!1)},e);return r=>{r&&(t(!0),clearTimeout(n))}}}const co="up",Ga="down",WS="none",zS={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollTop:0,viewportHeight:0,scrollHeight:0}},GS=0,Lo=Te(([{scrollContainerState:e,scrollTop:t,viewportHeight:n,headerHeight:r,footerHeight:i,scrollBy:a}])=>{const o=K(!1),s=K(!0),l=Ee(),u=Ee(),c=K(4),d=K(GS),f=At(U(hg(U(be(t),oa(1),Bn(!0)),U(be(t),oa(1),Bn(!1),fg(100))),Ye()),!1),h=At(U(hg(U(a,Bn(!0)),U(a,Bn(!1),fg(200))),Ye()),!1);se(U(yt(be(t),be(d)),te(([v,y])=>v<=y),Ye()),s),se(U(s,Dr(50)),u);const g=rn(U(yt(e,be(n),be(r),be(i),be(c)),On((v,[{scrollTop:y,scrollHeight:C},w,I,E,D])=>{const $=y+w-C>-D,F={viewportHeight:w,scrollTop:y,scrollHeight:C};if($){let P,k;return y>v.state.scrollTop?(P="SCROLLED_DOWN",k=v.state.scrollTop-y):(P="SIZE_DECREASED",k=v.state.scrollTop-y||v.scrollTopDelta),{atBottom:!0,state:F,atBottomBecause:P,scrollTopDelta:k}}let _;return F.scrollHeight>v.state.scrollHeight?_="SIZE_INCREASED":w<v.state.viewportHeight?_="VIEWPORT_HEIGHT_DECREASING":y<v.state.scrollTop?_="SCROLLING_UPWARDS":_="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:_,state:F}},zS),Ye((v,y)=>v&&v.atBottom===y.atBottom))),m=At(U(e,On((v,{scrollTop:y,scrollHeight:C,viewportHeight:w})=>{if(zb(v.scrollHeight,C))return{scrollTop:y,scrollHeight:C,jump:0,changed:!1};{const I=C-(y+w)<1;return v.scrollTop!==y&&I?{scrollHeight:C,scrollTop:y,jump:v.scrollTop-y,changed:!0}:{scrollHeight:C,scrollTop:y,jump:0,changed:!0}}},{scrollHeight:0,jump:0,scrollTop:0,changed:!1}),pe(v=>v.changed),te(v=>v.jump)),0);se(U(g,te(v=>v.atBottom)),o),se(U(o,Dr(50)),l);const p=K(Ga);se(U(e,te(({scrollTop:v})=>v),Ye(),On((v,y)=>Rt(h)?{direction:v.direction,prevScrollTop:y}:{direction:y<v.prevScrollTop?co:Ga,prevScrollTop:y},{direction:Ga,prevScrollTop:0}),te(v=>v.direction)),p),se(U(e,Dr(50),Bn(WS)),p);const b=K(0);return se(U(f,pe(v=>!v),Bn(0)),b),se(U(t,Dr(100),ye(f),pe(([v,y])=>!!y),On(([v,y],[C])=>[y,C],[0,0]),te(([v,y])=>y-v)),b),{isScrolling:f,isAtTop:s,isAtBottom:o,atBottomState:g,atTopStateChange:u,atBottomStateChange:l,scrollDirection:p,atBottomThreshold:c,atTopThreshold:d,scrollVelocity:b,lastJumpDueToItemResize:m}},Ue(Bt)),Nr=Te(([{log:e}])=>{const t=K(!1),n=rn(U(t,pe(r=>r),Ye()));return We(t,r=>{r&&Rt(e)("props updated",{},an.DEBUG)}),{propsReady:t,didMount:n}},Ue(Or),{singleton:!0});function rf(e,t){e==0?t():requestAnimationFrame(()=>rf(e-1,t))}function af(e,t){const n=t-1;return typeof e=="number"?e:e.index==="LAST"?n:e.index}const jo=Te(([{sizes:e,listRefresh:t,defaultItemSize:n},{scrollTop:r},{scrollToIndex:i,scrollTargetReached:a},{didMount:o}])=>{const s=K(!0),l=K(0),u=K(!0);return se(U(o,ye(l),pe(([c,d])=>!!d),Bn(!1)),s),se(U(o,ye(l),pe(([c,d])=>!!d),Bn(!1)),u),We(U(yt(t,o),ye(s,e,n,u),pe(([[,c],d,{sizeTree:f},h,g])=>c&&(!Ge(f)||Kd(h))&&!d&&!g),ye(l)),([,c])=>{Wn(a,()=>{ve(u,!0)}),rf(4,()=>{Wn(r,()=>{ve(s,!0)}),ve(i,c)})}),{scrolledToInitialItem:s,initialTopMostItemIndex:l,initialItemFinalLocationReached:u}},Ue(Gn,Bt,No,Nr),{singleton:!0});function pg(e){return e?e==="smooth"?"smooth":"auto":!1}const ZS=(e,t)=>typeof e=="function"?pg(e(t)):t&&pg(e),XS=Te(([{totalCount:e,listRefresh:t},{isAtBottom:n,atBottomState:r},{scrollToIndex:i},{scrolledToInitialItem:a},{propsReady:o,didMount:s},{log:l},{scrollingInProgress:u}])=>{const c=K(!1),d=Ee();let f=null;function h(m){ve(i,{index:"LAST",align:"end",behavior:m})}We(U(yt(U(be(e),oa(1)),s),ye(be(c),n,a,u),te(([[m,p],b,v,y,C])=>{let w=p&&y,I="auto";return w&&(I=ZS(b,v||C),w=w&&!!I),{totalCount:m,shouldFollow:w,followOutputBehavior:I}}),pe(({shouldFollow:m})=>m)),({totalCount:m,followOutputBehavior:p})=>{f&&(f(),f=null),f=Wn(t,()=>{Rt(l)("following output to ",{totalCount:m},an.DEBUG),h(p),f=null})});function g(m){const p=Wn(r,b=>{m&&!b.atBottom&&b.notAtBottomBecause==="SIZE_INCREASED"&&!f&&(Rt(l)("scrolling to bottom due to increased size",{},an.DEBUG),h("auto"))});setTimeout(p,100)}return We(U(yt(be(c),e,o),pe(([m,,p])=>m&&p),On(({value:m},[,p])=>({refreshed:m===p,value:p}),{refreshed:!1,value:0}),pe(({refreshed:m})=>m),ye(c,e)),([,m])=>{Rt(a)&&g(m!==!1)}),We(d,()=>{g(Rt(c)!==!1)}),We(yt(be(c),r),([m,p])=>{m&&!p.atBottom&&p.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&h("auto")}),{followOutput:c,autoscrollToBottom:d}},Ue(Gn,Lo,No,jo,Nr,Or,Bt));function YS(e){return e.reduce((t,n)=>(t.groupIndices.push(t.totalCount),t.totalCount+=n+1,t),{totalCount:0,groupIndices:[]})}const t1=Te(([{totalCount:e,groupIndices:t,sizes:n},{scrollTop:r,headerHeight:i}])=>{const a=Ee(),o=Ee(),s=rn(U(a,te(YS)));return se(U(s,te(l=>l.totalCount)),e),se(U(s,te(l=>l.groupIndices)),t),se(U(yt(r,n,i),pe(([l,u])=>ou(u)),te(([l,u,c])=>$n(u.groupOffsetTree,Math.max(l-c,0),"v")[0]),Ye(),te(l=>[l])),o),{groupCounts:a,topItemsIndexes:o}},Ue(Gn,Bt));function fo(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}function n1(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}const vl="top",yl="bottom",bg="none";function vg(e,t,n){return typeof e=="number"?n===co&&t===vl||n===Ga&&t===yl?e:0:n===co?t===vl?e.main:e.reverse:t===yl?e.main:e.reverse}function yg(e,t){return typeof e=="number"?e:e[t]||0}const of=Te(([{scrollTop:e,viewportHeight:t,deviation:n,headerHeight:r,fixedHeaderHeight:i}])=>{const a=Ee(),o=K(0),s=K(0),l=K(0),u=At(U(yt(be(e),be(t),be(r),be(a,fo),be(l),be(o),be(i),be(n),be(s)),te(([c,d,f,[h,g],m,p,b,v,y])=>{const C=c-v,w=p+b,I=Math.max(f-C,0);let E=bg;const D=yg(y,vl),$=yg(y,yl);return h-=v,h+=f+b,g+=f+b,g-=v,h>c+w-D&&(E=co),g<c-I+d+$&&(E=Ga),E!==bg?[Math.max(C-f-vg(m,vl,E)-D,0),C-I-b+d+vg(m,yl,E)+$]:null}),pe(c=>c!=null),Ye(fo)),[0,0]);return{listBoundary:a,overscan:l,topListHeight:o,increaseViewportBy:s,visibleRange:u}},Ue(Bt),{singleton:!0});function US(e,t,n){if(ou(t)){const r=qb(e,t);return[{index:$n(t.groupOffsetTree,r)[0],size:0,offset:0},{index:r,size:0,offset:0,data:n&&n[0]}]}return[{index:e,size:0,offset:0,data:n&&n[0]}]}const Wu={items:[],topItems:[],offsetTop:0,offsetBottom:0,top:0,bottom:0,topListHeight:0,totalCount:0,firstItemIndex:0};function xg(e,t,n){if(e.length===0)return[];if(!ou(t))return e.map(u=>({...u,index:u.index+n,originalIndex:u.index}));const r=e[0].index,i=e[e.length-1].index,a=[],o=au(t.groupOffsetTree,r,i);let s,l=0;for(const u of e){(!s||s.end<u.index)&&(s=o.shift(),l=t.groupIndices.indexOf(s.start));let c;u.index===s.start?c={type:"group",index:l}:c={index:u.index-(l+1)+n,groupIndex:l},a.push({...c,size:u.size,offset:u.offset,originalIndex:u.index,data:u.data})}return a}function Ws(e,t,n,r,i,a){const{lastSize:o,lastOffset:s,lastIndex:l}=i;let u=0,c=0;if(e.length>0){u=e[0].offset;const m=e[e.length-1];c=m.offset+m.size}const d=n-l,f=s+d*o+(d-1)*r,h=u,g=f-c;return{items:xg(e,i,a),topItems:xg(t,i,a),topListHeight:t.reduce((m,p)=>p.size+m,0),offsetTop:u,offsetBottom:g,top:h,bottom:c,totalCount:n,firstItemIndex:a}}function r1(e,t,n,r,i,a){let o=0;if(n.groupIndices.length>0)for(const c of n.groupIndices){if(c-o>=e)break;o++}const s=e+o,l=af(t,s),u=Array.from({length:s}).map((c,d)=>({index:d+l,size:0,offset:0,data:a[d+l]}));return Ws(u,[],s,i,n,r)}const Si=Te(([{sizes:e,totalCount:t,data:n,firstItemIndex:r,gap:i},a,{visibleRange:o,listBoundary:s,topListHeight:l},{scrolledToInitialItem:u,initialTopMostItemIndex:c},{topListHeight:d},f,{didMount:h},{recalcInProgress:g}])=>{const m=K([]),p=K(0),b=Ee();se(a.topItemsIndexes,m);const v=At(U(yt(h,g,be(o,fo),be(t),be(e),be(c),u,be(m),be(r),be(i),n),pe(([I,E,,D,,,,,,,$])=>{const F=$&&$.length!==D;return I&&!E&&!F}),te(([,,[I,E],D,$,F,_,P,k,A,B])=>{const T=$,{sizeTree:R,offsetTree:V}=T,H=Rt(p);if(D===0)return{...Wu,totalCount:D};if(I===0&&E===0)return H===0?{...Wu,totalCount:D}:r1(H,F,$,k,A,B||[]);if(Ge(R))return H>0?null:Ws(US(af(F,D),T,B),[],D,A,T,k);const L=[];if(P.length>0){const Y=P[0],N=P[P.length-1];let G=0;for(const J of au(R,Y,N)){const re=J.value,fe=Math.max(J.start,Y),le=Math.min(J.end,N);for(let z=fe;z<=le;z++)L.push({index:z,size:re,offset:G,data:B&&B[z]}),G+=re}}if(!_)return Ws([],L,D,A,T,k);const Z=P.length>0?P[P.length-1]+1:0,O=BS(V,I,E,Z);if(O.length===0)return null;const W=D-1,q=iu([],Y=>{for(const N of O){const G=N.value;let J=G.offset,re=N.start;const fe=G.size;if(G.offset<I){re+=Math.floor((I-G.offset+A)/(fe+A));const z=re-N.start;J+=z*fe+z*A}re<Z&&(J+=(Z-re)*fe,re=Z);const le=Math.min(N.end,W);for(let z=re;z<=le&&!(J>=E);z++)Y.push({index:z,size:fe,offset:J,data:B&&B[z]}),J+=fe+A}});return Ws(q,L,D,A,T,k)}),pe(I=>I!==null),Ye()),Wu);se(U(n,pe(Kd),te(I=>I==null?void 0:I.length)),t),se(U(v,te(I=>I.topListHeight)),d),se(d,l),se(U(v,te(I=>[I.top,I.bottom])),s),se(U(v,te(I=>I.items)),b);const y=rn(U(v,pe(({items:I})=>I.length>0),ye(t,n),pe(([{items:I},E])=>I[I.length-1].originalIndex===E-1),te(([,I,E])=>[I-1,E]),Ye(fo),te(([I])=>I))),C=rn(U(v,Dr(200),pe(({items:I,topItems:E})=>I.length>0&&I[0].originalIndex===E.length),te(({items:I})=>I[0].index),Ye())),w=rn(U(v,pe(({items:I})=>I.length>0),te(({items:I})=>{let E=0,D=I.length-1;for(;I[E].type==="group"&&E<D;)E++;for(;I[D].type==="group"&&D>E;)D--;return{startIndex:I[E].index,endIndex:I[D].index}}),Ye(n1)));return{listState:v,topItemsIndexes:m,endReached:y,startReached:C,rangeChanged:w,itemsRendered:b,initialItemCount:p,...f}},Ue(Gn,t1,of,jo,No,Lo,Nr,tf),{singleton:!0}),JS=Te(([{sizes:e,firstItemIndex:t,data:n,gap:r},{initialTopMostItemIndex:i},{initialItemCount:a,listState:o},{didMount:s}])=>(se(U(s,ye(a),pe(([,l])=>l!==0),ye(i,e,t,r,n),te(([[,l],u,c,d,f,h=[]])=>r1(l,u,c,d,f,h))),o),{}),Ue(Gn,jo,Si,Nr),{singleton:!0}),i1=Te(([{scrollVelocity:e}])=>{const t=K(!1),n=Ee(),r=K(!1);return se(U(e,ye(r,t,n),pe(([i,a])=>!!a),te(([i,a,o,s])=>{const{exit:l,enter:u}=a;if(o){if(l(i,s))return!1}else if(u(i,s))return!0;return o}),Ye()),t),We(U(yt(t,e,n),ye(r)),([[i,a,o],s])=>i&&s&&s.change&&s.change(a,o)),{isSeeking:t,scrollSeekConfiguration:r,scrollVelocity:e,scrollSeekRangeChanged:n}},Ue(Lo),{singleton:!0}),KS=Te(([{topItemsIndexes:e}])=>{const t=K(0);return se(U(t,pe(n=>n>0),te(n=>Array.from({length:n}).map((r,i)=>i))),e),{topItemCount:t}},Ue(Si)),a1=Te(([{footerHeight:e,headerHeight:t,fixedHeaderHeight:n,fixedFooterHeight:r},{listState:i}])=>{const a=Ee(),o=At(U(yt(e,r,t,n,i),te(([s,l,u,c,d])=>s+l+u+c+d.offsetBottom+d.bottom)),0);return se(be(o),a),{totalListHeight:o,totalListHeightChanged:a}},Ue(Bt,Si),{singleton:!0});function o1(e){let t=!1,n;return()=>(t||(t=!0,n=e()),n)}const QS=o1(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),qS=Te(([{scrollBy:e,scrollTop:t,deviation:n,scrollingInProgress:r},{isScrolling:i,isAtBottom:a,scrollDirection:o,lastJumpDueToItemResize:s},{listState:l},{beforeUnshiftWith:u,shiftWithOffset:c,sizes:d,gap:f},{log:h},{recalcInProgress:g}])=>{const m=rn(U(l,ye(s),On(([,b,v,y],[{items:C,totalCount:w,bottom:I,offsetBottom:E},D])=>{const $=I+E;let F=0;return v===w&&b.length>0&&C.length>0&&(C[0].originalIndex===0&&b[0].originalIndex===0||(F=$-y,F!==0&&(F+=D))),[F,C,w,$]},[0,[],0,0]),pe(([b])=>b!==0),ye(t,o,r,a,h,g),pe(([,b,v,y,,,C])=>!C&&!y&&b!==0&&v===co),te(([[b],,,,,v])=>(v("Upward scrolling compensation",{amount:b},an.DEBUG),b))));function p(b){b>0?(ve(e,{top:-b,behavior:"auto"}),ve(n,0)):(ve(n,0),ve(e,{top:-b,behavior:"auto"}))}return We(U(m,ye(n,i)),([b,v,y])=>{y&&QS()?ve(n,v-b):p(-b)}),We(U(yt(At(i,!1),n,g),pe(([b,v,y])=>!b&&!y&&v!==0),te(([b,v])=>v),Dr(1)),p),se(U(c,te(b=>({top:-b}))),e),We(U(u,ye(d,f),te(([b,{lastSize:v,groupIndices:y,sizeTree:C},w])=>{function I(E){return E*(v+w)}if(y.length===0)return I(b);{let E=0;const D=lo(C,0);let $=0,F=0;for(;$<b;){$++,E+=D;let _=y.length===F+1?1/0:y[F+1]-y[F]-1;$+_>b&&(E-=D,_=b-$+1),$+=_,E+=I(_),F++}return E}})),b=>{ve(n,b),requestAnimationFrame(()=>{ve(e,{top:b}),requestAnimationFrame(()=>{ve(n,0),ve(g,!1)})})}),{deviation:n}},Ue(Bt,Lo,Si,Gn,Or,tf)),eI=Te(([{didMount:e},{scrollTo:t},{listState:n}])=>{const r=K(0);return We(U(e,ye(r),pe(([,i])=>i!==0),te(([,i])=>({top:i}))),i=>{Wn(U(n,oa(1),pe(a=>a.items.length>1)),()=>{requestAnimationFrame(()=>{ve(t,i)})})}),{initialScrollTop:r}},Ue(Nr,Bt,Si),{singleton:!0}),tI=Te(([{viewportHeight:e},{totalListHeight:t}])=>{const n=K(!1),r=At(U(yt(n,e,t),pe(([i])=>i),te(([,i,a])=>Math.max(0,i-a)),Dr(0),Ye()),0);return{alignToBottom:n,paddingTopAddition:r}},Ue(Bt,a1),{singleton:!0}),sf=Te(([{scrollTo:e,scrollContainerState:t}])=>{const n=Ee(),r=Ee(),i=Ee(),a=K(!1),o=K(void 0);return se(U(yt(n,r),te(([{viewportHeight:s,scrollTop:l,scrollHeight:u},{offsetTop:c}])=>({scrollTop:Math.max(0,l-c),scrollHeight:u,viewportHeight:s}))),t),se(U(e,ye(r),te(([s,{offsetTop:l}])=>({...s,top:s.top+l}))),i),{useWindowScroll:a,customScrollParent:o,windowScrollContainerState:n,windowViewportRect:r,windowScrollTo:i}},Ue(Bt)),nI=({itemTop:e,itemBottom:t,viewportTop:n,viewportBottom:r,locationParams:{behavior:i,align:a,...o}})=>e<n?{...o,behavior:i,align:a??"start"}:t>r?{...o,behavior:i,align:a??"end"}:null,rI=Te(([{sizes:e,totalCount:t,gap:n},{scrollTop:r,viewportHeight:i,headerHeight:a,fixedHeaderHeight:o,fixedFooterHeight:s,scrollingInProgress:l},{scrollToIndex:u}])=>{const c=Ee();return se(U(c,ye(e,i,t,a,o,s,r),ye(n),te(([[d,f,h,g,m,p,b,v],y])=>{const{done:C,behavior:w,align:I,calculateViewLocation:E=nI,...D}=d,$=Qb(d,f,g-1),F=uo($,f.offsetTree,y)+m+p,_=F+$n(f.sizeTree,$)[1],P=v+p,k=v+h-b,A=E({itemTop:F,itemBottom:_,viewportTop:P,viewportBottom:k,locationParams:{behavior:w,align:I,...D}});return A?C&&Wn(U(l,pe(B=>B===!1),oa(Rt(l)?1:2)),C):C&&C(),A}),pe(d=>d!==null)),u),{scrollIntoView:c}},Ue(Gn,Bt,No,Si,Or),{singleton:!0}),iI=Te(([{sizes:e,sizeRanges:t},{scrollTop:n},{initialTopMostItemIndex:r},{didMount:i},{useWindowScroll:a,windowScrollContainerState:o,windowViewportRect:s}])=>{const l=Ee(),u=K(void 0),c=K(null),d=K(null);return se(o,c),se(s,d),We(U(l,ye(e,n,a,c,d)),([f,h,g,m,p,b])=>{const v=NS(h.sizeTree);m&&p!==null&&b!==null&&(g=p.scrollTop-b.offsetTop),f({ranges:v,scrollTop:g})}),se(U(u,pe(Kd),te(aI)),r),se(U(i,ye(u),pe(([,f])=>f!==void 0),Ye(),te(([,f])=>f.ranges)),t),{getState:l,restoreStateFrom:u}},Ue(Gn,Bt,jo,Nr,sf));function aI(e){return{offset:e.scrollTop,index:0,align:"start"}}const oI=Te(([e,t,n,r,i,a,o,s,l,u])=>({...e,...t,...n,...r,...i,...a,...o,...s,...l,...u}),Ue(of,JS,Nr,i1,a1,eI,tI,sf,rI,Or)),s1=Te(([{totalCount:e,sizeRanges:t,fixedItemSize:n,defaultItemSize:r,trackItemSizes:i,itemSize:a,data:o,firstItemIndex:s,groupIndices:l,statefulTotalCount:u,gap:c,sizes:d},{initialTopMostItemIndex:f,scrolledToInitialItem:h,initialItemFinalLocationReached:g},m,p,b,{listState:v,topItemsIndexes:y,...C},{scrollToIndex:w},I,{topItemCount:E},{groupCounts:D},$])=>(se(C.rangeChanged,$.scrollSeekRangeChanged),se(U($.windowViewportRect,te(F=>F.visibleHeight)),m.viewportHeight),{totalCount:e,data:o,firstItemIndex:s,sizeRanges:t,initialTopMostItemIndex:f,scrolledToInitialItem:h,initialItemFinalLocationReached:g,topItemsIndexes:y,topItemCount:E,groupCounts:D,fixedItemHeight:n,defaultItemHeight:r,gap:c,...b,statefulTotalCount:u,listState:v,scrollToIndex:w,trackItemSizes:i,itemSize:a,groupIndices:l,...C,...$,...m,sizes:d,...p}),Ue(Gn,jo,Bt,iI,XS,Si,No,qS,KS,t1,oI)),zu="-webkit-sticky",Cg="sticky",l1=o1(()=>{if(typeof document>"u")return Cg;const e=document.createElement("div");return e.style.position=zu,e.style.position===zu?zu:Cg});function lf(e,t){const n=x.useRef(null),r=x.useCallback(s=>{if(s===null||!s.offsetParent)return;const l=s.getBoundingClientRect(),u=l.width;let c,d;if(t){const f=t.getBoundingClientRect(),h=l.top-f.top;c=f.height-Math.max(0,h),d=h+t.scrollTop}else c=window.innerHeight-Math.max(0,l.top),d=l.top+window.pageYOffset;n.current={offsetTop:d,visibleHeight:c,visibleWidth:u},e(n.current)},[e,t]),{callbackRef:i,ref:a}=ef(r),o=x.useCallback(()=>{r(a.current)},[r,a]);return x.useEffect(()=>{if(t){t.addEventListener("scroll",o);const s=new ResizeObserver(()=>{requestAnimationFrame(o)});return s.observe(t),()=>{t.removeEventListener("scroll",o),s.unobserve(t)}}else return window.addEventListener("scroll",o),window.addEventListener("resize",o),()=>{window.removeEventListener("scroll",o),window.removeEventListener("resize",o)}},[o,t]),i}const su=x.createContext(void 0),u1=x.createContext(void 0);function uf(e){return e}const sI=Te(()=>{const e=K(l=>`Item ${l}`),t=K(null),n=K(l=>`Group ${l}`),r=K({}),i=K(uf),a=K("div"),o=K(Di),s=(l,u=null)=>At(U(r,te(c=>c[l]),Ye()),u);return{context:t,itemContent:e,groupContent:n,components:r,computeItemKey:i,headerFooterTag:a,scrollerRef:o,FooterComponent:s("Footer"),HeaderComponent:s("Header"),TopItemListComponent:s("TopItemList"),ListComponent:s("List","div"),ItemComponent:s("Item","div"),GroupComponent:s("Group","div"),ScrollerComponent:s("Scroller","div"),EmptyPlaceholder:s("EmptyPlaceholder"),ScrollSeekPlaceholder:s("ScrollSeekPlaceholder")}}),lI=Te(([e,t])=>({...e,...t}),Ue(s1,sI)),uI=({height:e})=>x.createElement("div",{style:{height:e}}),cI={position:l1(),zIndex:1,overflowAnchor:"none"},dI={overflowAnchor:"none"},wg=x.memo(function({showTopList:t=!1}){const n=De("listState"),r=pn("sizeRanges"),i=De("useWindowScroll"),a=De("customScrollParent"),o=pn("windowScrollContainerState"),s=pn("scrollContainerState"),l=a||i?o:s,u=De("itemContent"),c=De("context"),d=De("groupContent"),f=De("trackItemSizes"),h=De("itemSize"),g=De("log"),m=pn("gap"),{callbackRef:p}=Wb(r,h,f,t?Di:l,g,m,a),[b,v]=x.useState(0);ff("deviation",A=>{b!==A&&v(A)});const y=De("EmptyPlaceholder"),C=De("ScrollSeekPlaceholder")||uI,w=De("ListComponent"),I=De("ItemComponent"),E=De("GroupComponent"),D=De("computeItemKey"),$=De("isSeeking"),F=De("groupIndices").length>0,_=De("alignToBottom"),P=De("initialItemFinalLocationReached"),k=t?{}:{boxSizing:"border-box",paddingTop:n.offsetTop,paddingBottom:n.offsetBottom,marginTop:b!==0?b:_?"auto":0,...P?{}:{visibility:"hidden"}};return!t&&n.totalCount===0&&y?x.createElement(y,it(y,c)):x.createElement(w,{...it(w,c),ref:p,style:k,"data-testid":t?"virtuoso-top-item-list":"virtuoso-item-list"},(t?n.topItems:n.items).map(A=>{const B=A.originalIndex,T=D(B+n.firstItemIndex,A.data,c);return $?x.createElement(C,{...it(C,c),key:T,index:A.index,height:A.size,type:A.type||"item",...A.type==="group"?{}:{groupIndex:A.groupIndex}}):A.type==="group"?x.createElement(E,{...it(E,c),key:T,"data-index":B,"data-known-size":A.size,"data-item-index":A.index,style:cI},d(A.index,c)):x.createElement(I,{...it(I,c),...c1(I,A.data),key:T,"data-index":B,"data-known-size":A.size,"data-item-index":A.index,"data-item-group-index":A.groupIndex,style:dI},F?u(A.index,A.groupIndex,A.data,c):u(A.index,A.data,c))}))}),fI={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},ma=e=>({width:"100%",height:"100%",position:"absolute",top:0,...e?{display:"flex",flexDirection:"column"}:{}}),hI={width:"100%",position:l1(),top:0,zIndex:1};function it(e,t){if(typeof e!="string")return{context:t}}function c1(e,t){return{item:typeof e=="string"?void 0:t}}const gI=x.memo(function(){const t=De("HeaderComponent"),n=pn("headerHeight"),r=De("headerFooterTag"),i=zn(o=>n(_n(o,"height"))),a=De("context");return t?x.createElement(r,{ref:i},x.createElement(t,it(t,a))):null}),mI=x.memo(function(){const t=De("FooterComponent"),n=pn("footerHeight"),r=De("headerFooterTag"),i=zn(o=>n(_n(o,"height"))),a=De("context");return t?x.createElement(r,{ref:i},x.createElement(t,it(t,a))):null});function cf({usePublisher:e,useEmitter:t,useEmitterValue:n}){return x.memo(function({style:a,children:o,...s}){const l=e("scrollContainerState"),u=n("ScrollerComponent"),c=e("smoothScrollTargetReached"),d=n("scrollerRef"),f=n("context"),{scrollerRef:h,scrollByCallback:g,scrollToCallback:m}=Gb(l,c,u,d);return t("scrollTo",m),t("scrollBy",g),x.createElement(u,{ref:h,style:{...fI,...a},"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,tabIndex:0,...s,...it(u,f)},o)})}function df({usePublisher:e,useEmitter:t,useEmitterValue:n}){return x.memo(function({style:a,children:o,...s}){const l=e("windowScrollContainerState"),u=n("ScrollerComponent"),c=e("smoothScrollTargetReached"),d=n("totalListHeight"),f=n("deviation"),h=n("customScrollParent"),g=n("context"),{scrollerRef:m,scrollByCallback:p,scrollToCallback:b}=Gb(l,c,u,Di,h);return SS(()=>(m.current=h||window,()=>{m.current=null}),[m,h]),t("windowScrollTo",b),t("scrollBy",p),x.createElement(u,{style:{position:"relative",...a,...d!==0?{height:d+f}:{}},"data-virtuoso-scroller":!0,...s,...it(u,g)},o)})}const pI=({children:e})=>{const t=x.useContext(su),n=pn("viewportHeight"),r=pn("fixedItemHeight"),i=De("alignToBottom"),a=zn(oo(n,o=>_n(o,"height")));return x.useEffect(()=>{t&&(n(t.viewportHeight),r(t.itemHeight))},[t,n,r]),x.createElement("div",{style:ma(i),ref:a,"data-viewport-type":"element"},e)},bI=({children:e})=>{const t=x.useContext(su),n=pn("windowViewportRect"),r=pn("fixedItemHeight"),i=De("customScrollParent"),a=lf(n,i),o=De("alignToBottom");return x.useEffect(()=>{t&&(r(t.itemHeight),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,r]),x.createElement("div",{ref:a,style:ma(o),"data-viewport-type":"window"},e)},vI=({children:e})=>{const t=De("TopItemListComponent")||"div",n=De("headerHeight"),r={...hI,marginTop:`${n}px`},i=De("context");return x.createElement(t,{style:r,...it(t,i)},e)},yI=x.memo(function(t){const n=De("useWindowScroll"),r=De("topItemsIndexes").length>0,i=De("customScrollParent"),a=i||n?wI:CI,o=i||n?bI:pI;return x.createElement(a,{...t},r&&x.createElement(vI,null,x.createElement(wg,{showTopList:!0})),x.createElement(o,null,x.createElement(gI,null),x.createElement(wg,null),x.createElement(mI,null)))}),{Component:xI,usePublisher:pn,useEmitterValue:De,useEmitter:ff}=qd(lI,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},yI),CI=cf({usePublisher:pn,useEmitterValue:De,useEmitter:ff}),wI=df({usePublisher:pn,useEmitterValue:De,useEmitter:ff}),DI=xI,Dg={items:[],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},SI={items:[{index:0}],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},{round:Sg,ceil:Ig,floor:xl,min:Gu,max:Za}=Math;function II(e){return{...SI,items:e}}function Eg(e,t,n){return Array.from({length:t-e+1}).map((r,i)=>{const a=n===null?null:n[i+e];return{index:i+e,data:a}})}function EI(e,t){return e&&e.column===t.column&&e.row===t.row}function ss(e,t){return e&&e.width===t.width&&e.height===t.height}const _I=Te(([{overscan:e,visibleRange:t,listBoundary:n},{scrollTop:r,viewportHeight:i,scrollBy:a,scrollTo:o,smoothScrollTargetReached:s,scrollContainerState:l,footerHeight:u,headerHeight:c},d,f,{propsReady:h,didMount:g},{windowViewportRect:m,useWindowScroll:p,customScrollParent:b,windowScrollContainerState:v,windowScrollTo:y},C])=>{const w=K(0),I=K(0),E=K(Dg),D=K({height:0,width:0}),$=K({height:0,width:0}),F=Ee(),_=Ee(),P=K(0),k=K(null),A=K({row:0,column:0}),B=Ee(),T=Ee(),R=K(!1),V=K(0),H=K(!0),L=K(!1);We(U(g,ye(V),pe(([N,G])=>!!G)),()=>{ve(H,!1),ve(I,0)}),We(U(yt(g,H,$,D,V,L),pe(([N,G,J,re,,fe])=>N&&!G&&J.height!==0&&re.height!==0&&!fe)),([,,,,N])=>{ve(L,!0),rf(1,()=>{ve(F,N)}),Wn(U(r),()=>{ve(n,[0,0]),ve(H,!0)})}),se(U(T,pe(N=>N!=null&&N.scrollTop>0),Bn(0)),I),We(U(g,ye(T),pe(([,N])=>N!=null)),([,N])=>{N&&(ve(D,N.viewport),ve($,N==null?void 0:N.item),ve(A,N.gap),N.scrollTop>0&&(ve(R,!0),Wn(U(r,oa(1)),G=>{ve(R,!1)}),ve(o,{top:N.scrollTop})))}),se(U(D,te(({height:N})=>N)),i),se(U(yt(be(D,ss),be($,ss),be(A,(N,G)=>N&&N.column===G.column&&N.row===G.row),be(r)),te(([N,G,J,re])=>({viewport:N,item:G,gap:J,scrollTop:re}))),B),se(U(yt(be(w),t,be(A,EI),be($,ss),be(D,ss),be(k),be(I),be(R),be(H),be(V)),pe(([,,,,,,,N])=>!N),te(([N,[G,J],re,fe,le,z,Ae,,ke,Xe])=>{const{row:qe,column:ee}=re,{height:ne,width:he}=fe,{width:Oe}=le;if(Ae===0&&(N===0||Oe===0))return Dg;if(he===0){const $i=af(Xe,N),va=$i===0?Math.max(Ae-1,0):$i;return II(Eg($i,va,z))}const ut=d1(Oe,he,ee);let Se,xe;ke?G===0&&J===0&&Ae>0?(Se=0,xe=Ae-1):(Se=ut*xl((G+qe)/(ne+qe)),xe=ut*Ig((J+qe)/(ne+qe))-1,xe=Gu(N-1,Za(xe,ut-1)),Se=Gu(xe,Za(0,Se))):(Se=0,xe=-1);const Vt=Eg(Se,xe,z),{top:Ot,bottom:Nt}=_g(le,re,fe,Vt),un=Ig(N/ut),Qo=un*ne+(un-1)*qe-Nt;return{items:Vt,offsetTop:Ot,offsetBottom:Qo,top:Ot,bottom:Nt,itemHeight:ne,itemWidth:he}})),E),se(U(k,pe(N=>N!==null),te(N=>N.length)),w),se(U(yt(D,$,E,A),pe(([N,G,{items:J}])=>J.length>0&&G.height!==0&&N.height!==0),te(([N,G,{items:J},re])=>{const{top:fe,bottom:le}=_g(N,re,G,J);return[fe,le]}),Ye(fo)),n);const Z=K(!1);se(U(r,ye(Z),te(([N,G])=>G||N!==0)),Z);const O=rn(U(be(E),pe(({items:N})=>N.length>0),ye(w,Z),pe(([{items:N},G,J])=>J&&N[N.length-1].index===G-1),te(([,N])=>N-1),Ye())),W=rn(U(be(E),pe(({items:N})=>N.length>0&&N[0].index===0),Bn(0),Ye())),q=rn(U(be(E),ye(R),pe(([{items:N},G])=>N.length>0&&!G),te(([{items:N}])=>({startIndex:N[0].index,endIndex:N[N.length-1].index})),Ye(n1),Dr(0)));se(q,f.scrollSeekRangeChanged),se(U(F,ye(D,$,w,A),te(([N,G,J,re,fe])=>{const le=e1(N),{align:z,behavior:Ae,offset:ke}=le;let Xe=le.index;Xe==="LAST"&&(Xe=re-1),Xe=Za(0,Xe,Gu(re-1,Xe));let qe=zc(G,fe,J,Xe);return z==="end"?qe=Sg(qe-G.height+J.height):z==="center"&&(qe=Sg(qe-G.height/2+J.height/2)),ke&&(qe+=ke),{top:qe,behavior:Ae}})),o);const Y=At(U(E,te(N=>N.offsetBottom+N.bottom)),0);return se(U(m,te(N=>({width:N.visibleWidth,height:N.visibleHeight}))),D),{data:k,totalCount:w,viewportDimensions:D,itemDimensions:$,scrollTop:r,scrollHeight:_,overscan:e,scrollBy:a,scrollTo:o,scrollToIndex:F,smoothScrollTargetReached:s,windowViewportRect:m,windowScrollTo:y,useWindowScroll:p,customScrollParent:b,windowScrollContainerState:v,deviation:P,scrollContainerState:l,footerHeight:u,headerHeight:c,initialItemCount:I,gap:A,restoreStateFrom:T,...f,initialTopMostItemIndex:V,gridState:E,totalListHeight:Y,...d,startReached:W,endReached:O,rangeChanged:q,stateChanged:B,propsReady:h,stateRestoreInProgress:R,...C}},Ue(of,Bt,Lo,i1,Nr,sf,Or));function _g(e,t,n,r){const{height:i}=n;if(i===void 0||r.length===0)return{top:0,bottom:0};const a=zc(e,t,n,r[0].index),o=zc(e,t,n,r[r.length-1].index)+i;return{top:a,bottom:o}}function zc(e,t,n,r){const i=d1(e.width,n.width,t.column),a=xl(r/i),o=a*n.height+Za(0,a-1)*t.row;return o>0?o+t.row:o}function d1(e,t,n){return Za(1,xl((e+n)/(xl(t)+n)))}const $I=Te(()=>{const e=K(u=>`Item ${u}`),t=K({}),n=K(null),r=K("virtuoso-grid-item"),i=K("virtuoso-grid-list"),a=K(uf),o=K("div"),s=K(Di),l=(u,c=null)=>At(U(t,te(d=>d[u]),Ye()),c);return{context:n,itemContent:e,components:t,computeItemKey:a,itemClassName:r,listClassName:i,headerFooterTag:o,scrollerRef:s,FooterComponent:l("Footer"),HeaderComponent:l("Header"),ListComponent:l("List","div"),ItemComponent:l("Item","div"),ScrollerComponent:l("Scroller","div"),ScrollSeekPlaceholder:l("ScrollSeekPlaceholder","div")}}),RI=Te(([e,t])=>({...e,...t}),Ue(_I,$I)),AI=x.memo(function(){const t=tt("gridState"),n=tt("listClassName"),r=tt("itemClassName"),i=tt("itemContent"),a=tt("computeItemKey"),o=tt("isSeeking"),s=In("scrollHeight"),l=tt("ItemComponent"),u=tt("ListComponent"),c=tt("ScrollSeekPlaceholder"),d=tt("context"),f=In("itemDimensions"),h=In("gap"),g=tt("log"),m=tt("stateRestoreInProgress"),p=zn(b=>{const v=b.parentElement.parentElement.scrollHeight;s(v);const y=b.firstChild;if(y){const{width:C,height:w}=y.getBoundingClientRect();f({width:C,height:w})}h({row:$g("row-gap",getComputedStyle(b).rowGap,g),column:$g("column-gap",getComputedStyle(b).columnGap,g)})});return m?null:x.createElement(u,{ref:p,className:n,...it(u,d),style:{paddingTop:t.offsetTop,paddingBottom:t.offsetBottom},"data-testid":"virtuoso-item-list"},t.items.map(b=>{const v=a(b.index,b.data,d);return o?x.createElement(c,{key:v,...it(c,d),index:b.index,height:t.itemHeight,width:t.itemWidth}):x.createElement(l,{...it(l,d),className:r,"data-index":b.index,key:v},i(b.index,b.data,d))}))}),FI=x.memo(function(){const t=tt("HeaderComponent"),n=In("headerHeight"),r=tt("headerFooterTag"),i=zn(o=>n(_n(o,"height"))),a=tt("context");return t?x.createElement(r,{ref:i},x.createElement(t,it(t,a))):null}),PI=x.memo(function(){const t=tt("FooterComponent"),n=In("footerHeight"),r=tt("headerFooterTag"),i=zn(o=>n(_n(o,"height"))),a=tt("context");return t?x.createElement(r,{ref:i},x.createElement(t,it(t,a))):null}),TI=({children:e})=>{const t=x.useContext(u1),n=In("itemDimensions"),r=In("viewportDimensions"),i=zn(a=>{r(a.getBoundingClientRect())});return x.useEffect(()=>{t&&(r({height:t.viewportHeight,width:t.viewportWidth}),n({height:t.itemHeight,width:t.itemWidth}))},[t,r,n]),x.createElement("div",{style:ma(!1),ref:i},e)},kI=({children:e})=>{const t=x.useContext(u1),n=In("windowViewportRect"),r=In("itemDimensions"),i=tt("customScrollParent"),a=lf(n,i);return x.useEffect(()=>{t&&(r({height:t.itemHeight,width:t.itemWidth}),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,n,r]),x.createElement("div",{ref:a,style:ma(!1)},e)},MI=x.memo(function({...t}){const n=tt("useWindowScroll"),r=tt("customScrollParent"),i=r||n?VI:BI,a=r||n?kI:TI;return x.createElement(i,{...t},x.createElement(a,null,x.createElement(FI,null),x.createElement(AI,null),x.createElement(PI,null)))}),{Component:oB,usePublisher:In,useEmitterValue:tt,useEmitter:f1}=qd(RI,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged"}},MI),BI=cf({usePublisher:In,useEmitterValue:tt,useEmitter:f1}),VI=df({usePublisher:In,useEmitterValue:tt,useEmitter:f1});function $g(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,an.WARN),t==="normal"?0:parseInt(t??"0",10)}const OI=Te(()=>{const e=K(l=>x.createElement("td",null,"Item $",l)),t=K(null),n=K(null),r=K(null),i=K({}),a=K(uf),o=K(Di),s=(l,u=null)=>At(U(i,te(c=>c[l]),Ye()),u);return{context:t,itemContent:e,fixedHeaderContent:n,fixedFooterContent:r,components:i,computeItemKey:a,scrollerRef:o,TableComponent:s("Table","table"),TableHeadComponent:s("TableHead","thead"),TableFooterComponent:s("TableFoot","tfoot"),TableBodyComponent:s("TableBody","tbody"),TableRowComponent:s("TableRow","tr"),ScrollerComponent:s("Scroller","div"),EmptyPlaceholder:s("EmptyPlaceholder"),ScrollSeekPlaceholder:s("ScrollSeekPlaceholder"),FillerRow:s("FillerRow")}}),NI=Te(([e,t])=>({...e,...t}),Ue(s1,OI)),LI=({height:e})=>x.createElement("tr",null,x.createElement("td",{style:{height:e}})),jI=({height:e})=>x.createElement("tr",null,x.createElement("td",{style:{height:e,padding:0,border:0}})),HI={overflowAnchor:"none"},WI=x.memo(function(){const t=Le("listState"),n=En("sizeRanges"),r=Le("useWindowScroll"),i=Le("customScrollParent"),a=En("windowScrollContainerState"),o=En("scrollContainerState"),s=i||r?a:o,l=Le("itemContent"),u=Le("trackItemSizes"),c=Le("itemSize"),d=Le("log"),{callbackRef:f,ref:h}=Wb(n,c,u,s,d,void 0,i),[g,m]=x.useState(0);hf("deviation",T=>{g!==T&&(h.current.style.marginTop=`${T}px`,m(T))});const p=Le("EmptyPlaceholder"),b=Le("ScrollSeekPlaceholder")||LI,v=Le("FillerRow")||jI,y=Le("TableBodyComponent"),C=Le("TableRowComponent"),w=Le("computeItemKey"),I=Le("isSeeking"),E=Le("paddingTopAddition"),D=Le("firstItemIndex"),$=Le("statefulTotalCount"),F=Le("context");if($===0&&p)return x.createElement(p,it(p,F));const _=t.offsetTop+E+g,P=t.offsetBottom,k=_>0?x.createElement(v,{height:_,key:"padding-top",context:F}):null,A=P>0?x.createElement(v,{height:P,key:"padding-bottom",context:F}):null,B=t.items.map(T=>{const R=T.originalIndex,V=w(R+D,T.data,F);return I?x.createElement(b,{...it(b,F),key:V,index:T.index,height:T.size,type:T.type||"item"}):x.createElement(C,{...it(C,F),...c1(C,T.data),key:V,"data-index":R,"data-known-size":T.size,"data-item-index":T.index,style:HI},l(T.index,T.data,F))});return x.createElement(y,{ref:f,"data-testid":"virtuoso-item-list",...it(y,F)},[k,...B,A])}),zI=({children:e})=>{const t=x.useContext(su),n=En("viewportHeight"),r=En("fixedItemHeight"),i=zn(oo(n,a=>_n(a,"height")));return x.useEffect(()=>{t&&(n(t.viewportHeight),r(t.itemHeight))},[t,n,r]),x.createElement("div",{style:ma(!1),ref:i,"data-viewport-type":"element"},e)},GI=({children:e})=>{const t=x.useContext(su),n=En("windowViewportRect"),r=En("fixedItemHeight"),i=Le("customScrollParent"),a=lf(n,i);return x.useEffect(()=>{t&&(r(t.itemHeight),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,r]),x.createElement("div",{ref:a,style:ma(!1),"data-viewport-type":"window"},e)},ZI=x.memo(function(t){const n=Le("useWindowScroll"),r=Le("customScrollParent"),i=En("fixedHeaderHeight"),a=En("fixedFooterHeight"),o=Le("fixedHeaderContent"),s=Le("fixedFooterContent"),l=Le("context"),u=zn(oo(i,v=>_n(v,"height"))),c=zn(oo(a,v=>_n(v,"height"))),d=r||n?UI:YI,f=r||n?GI:zI,h=Le("TableComponent"),g=Le("TableHeadComponent"),m=Le("TableFooterComponent"),p=o?x.createElement(g,{key:"TableHead",style:{zIndex:2,position:"sticky",top:0},ref:u,...it(g,l)},o()):null,b=s?x.createElement(m,{key:"TableFoot",style:{zIndex:1,position:"sticky",bottom:0},ref:c,...it(m,l)},s()):null;return x.createElement(d,{...t},x.createElement(f,null,x.createElement(h,{style:{borderSpacing:0,overflowAnchor:"none"},...it(h,l)},[p,x.createElement(WI,{key:"TableBody"}),b])))}),{Component:XI,usePublisher:En,useEmitterValue:Le,useEmitter:hf}=qd(NI,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",firstItemIndex:"firstItemIndex",itemContent:"itemContent",fixedHeaderContent:"fixedHeaderContent",fixedFooterContent:"fixedFooterContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",topItemCount:"topItemCount",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",groupCounts:"groupCounts",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},ZI),YI=cf({usePublisher:En,useEmitterValue:Le,useEmitter:hf}),UI=df({usePublisher:En,useEmitterValue:Le,useEmitter:hf}),JI=XI,KI=({children:e,...t})=>S.jsx(S.Fragment,{children:e(t)}),QI=({children:e,...t})=>S.jsx(S.Fragment,{children:x.isValidElement(e)&&S.jsx(S.Fragment,{children:x.cloneElement(e,t)})}),gf=x.forwardRef((e,t)=>{const{classNameContainer:n="",computeItemKey:r=()=>"",itemSize:i=()=>0,totalCount:a=0,typeHight:o="min-max",minHeightItem:s=0,maxHeightTable:l=0,minLengthItem:u=0,fixedHeaderContent:c,itemContent:d,typeCalculateItemSize:f="manual",itemSizeNames:h=[],overscan:g=null,component:m={},idContainer:p="",triggerCalCulateContainer:b="",accumulationHeight:v=0,delayTriggerCalculateHeight:y=0,increaseViewportBy:C=()=>0,context:w={},endReached:I}=e,[E,D]=x.useState(0),$=()=>{if(o==="min-max"){const P=(a+1)*s;return{height:a>u?l:E>P?E:P}}return o==="container"?{height:E}:{}},F=P=>{var B;const k=P.getAttribute("data-index");let A=((B=P.getBoundingClientRect())==null?void 0:B.height)||0;return h==null||h.forEach(T=>{var R,V;A+=((V=(R=document.querySelector(`[${T}="${k}"]`))==null?void 0:R.getBoundingClientRect())==null?void 0:V.height)??0}),A},_=()=>{var P;if(p&&o==="container"){const k=((P=document==null?void 0:document.getElementById(p))==null?void 0:P.offsetHeight)??0;D(k-v)}};return x.useEffect(()=>{const P=setTimeout(_,y);return window==null||window.addEventListener("resize",_),window==null||window.addEventListener("load",_),()=>{clearTimeout(P),window==null||window.removeEventListener("resize",_),window==null||window.removeEventListener("load",_)}},[o,b]),S.jsx("div",{className:`1ru-w-full ${n}`,children:S.jsx(JI,{context:w,ref:t,overscan:typeof g=="function"?g(o==="container"?E:l):o==="container"?E:l,totalListHeightChanged:P=>o==="min-max"?D(P):null,style:$(),totalCount:a,computeItemKey:r,itemSize:x.useCallback(P=>f==="manual"?i(P):F(P),[]),components:{TableRow:QI,...m},fixedHeaderContent:c,itemContent:(...P)=>d(KI,...P),endReached:I,increaseViewportBy:C(o==="container"?E:l)})})});gf.displayName="TableVirtualization";const qI="_sorting_1i6eh_39",qn={"container-table":"_container-table_1i6eh_1","payhere-reguler":"_payhere-reguler_1i6eh_1","laba-small":"_laba-small_1i6eh_1","laba-reguler":"_laba-reguler_1i6eh_1","table-root":"_table-root_1i6eh_5","table-scroll-top":"_table-scroll-top_1i6eh_9","pointer-laba":"_pointer-laba_1i6eh_16","pointer-payhere":"_pointer-payhere_1i6eh_20",sorting:qI,"laba-grey-02":"_laba-grey-02_1i6eh_53"},ki="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M10.6673%2011.3333L8.00065%2014M8.00065%2014L5.33398%2011.3333M8.00065%2014V2'%20stroke='%23CFD8DC'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e";function eE(e,t=null){const[n,r]=x.useState(!1);return x.useEffect(()=>{let i=null,a=null;const o=()=>{const s=i instanceof HTMLElement?i.getBoundingClientRect().width:window.innerWidth,l=window.matchMedia(e.replace("WIDTH",s.toString()));r(l.matches)};if(t){if(i=document.getElementById(t),!i)return;a=new ResizeObserver(o),a.observe(i)}else i=window,window.addEventListener("resize",o);return o(),()=>{a?a.disconnect():window.removeEventListener("resize",o)}},[e,t]),n}const tE=e=>{const t=f=>{const h=new Date,g=f.getTime()-h.getTime();return Math.max(Math.floor(g/1e3),0)},n=new Date(new Date(e.date).setHours(new Date(e.date).getHours()-((e==null?void 0:e.adjustTimesTime)??0))),[r,i]=x.useState(t(n)),[a,o]=x.useState(e.running??!1),[s,l]=x.useState(()=>e==null?void 0:e.callbackDone);return x.useEffect(()=>{let f;return a&&r>0?f=setInterval(()=>{i(h=>Math.max(h-1,0))},e.intervalMs):a&&r===0&&typeof s=="function"&&s(),()=>{f&&clearInterval(f)}},[a,r,e.intervalMs,s]),{count:r,startCountdown:()=>{o(!0)},stopCountdown:()=>{o(!1)},resetCountdown:f=>{i(typeof f=="number"?f:t(f??n))},setCallbackDone:f=>l(()=>f)}};function nE(e,t=0){const n=x.useRef({promise:null,resolve:null,reject:null,timeout:null});return x.useCallback((...i)=>(n.current.timeout&&clearTimeout(n.current.timeout),n.current.promise||(n.current.promise=new Promise((a,o)=>{n.current.resolve=a,n.current.reject=o})),n.current.timeout=setTimeout(()=>{e(...i).then(a=>{n.current.resolve&&n.current.resolve(a)}).catch(a=>{n.current.reject&&n.current.reject(a)}).finally(()=>{n.current.promise=null,n.current.resolve=null,n.current.reject=null,n.current.timeout=null})},t),n.current.promise),[e,t])}const mf=typeof window<"u"?x.useLayoutEffect:x.useEffect,rE=(e,t)=>{const[n,r]=x.useState({width:0,height:0}),[i,a]=x.useState({width:0,height:0,top:0,left:0,bottom:0,right:0,x:0,y:0}),o=x.useRef(null);return mf(()=>{const s=()=>{r({width:window.innerWidth,height:window.innerHeight})},l=d=>{for(const f of d){const{width:h,height:g,top:m,left:p,bottom:b,right:v,x:y,y:C}=f.contentRect;a({width:h,height:g,top:m,left:p,bottom:b,right:v,x:y,y:C})}};let u=null;t?u=document.querySelector(t):o.current&&(u=o.current);const c=new ResizeObserver(l);return u&&c.observe(u),window.addEventListener("resize",s),s(),()=>{u&&c.unobserve(u),window.removeEventListener("resize",s)}},[t,...e??[]]),{ref:o,windowSize:n,contentRect:i}};function iE(e){const[t,n]=x.useState(e),r=x.useRef(t);return x.useEffect(()=>{r.current=t},[t]),[t,n,r]}function aE(e,t){if(e!=null){if(typeof e=="function"){e(t);return}try{e.current=t}catch{throw new Error(`Cannot assign value '${JSON.stringify(t)}' to ref '${JSON.stringify(e)}'`)}}}function oE(...e){return t=>{e.forEach(n=>{aE(n,t)})}}function pf(...e){return x.useMemo(()=>oE(...e),e)}function bf(e){const t=x.useRef(e);return Od(e,t.current)||(t.current=e),t.current}function Ho(e,t){const n=t.map(bf);x.useEffect(e,n)}function sE({ref:e,handlerMain:t,eventListener:n="mousedown",useEffectDependency:r=[]}){x.useEffect(()=>{function i(a){t(e,a)}return document.addEventListener(n,i),()=>{document.removeEventListener(n,i)}},[e,t,n,...r])}const lE=(e,t)=>{var r,i;let n={};return e?n={position:"sticky",top:0,zIndex:2}:(r=t.column.columnDef.meta)!=null&&r.styleTh&&(n={...n,...(i=t.column.columnDef.meta)==null?void 0:i.styleTh(t.column.columnDef)}),n},Jt=()=>({kind:{"payhere-reguler":qn["payhere-reguler"],"laba-reguler":qn["laba-reguler"],"laba-small":qn["laba-small"]},pointer:{"payhere-reguler":qn["pointer-payhere"],"laba-reguler":qn["pointer-laba"],"laba-small":qn["pointer-laba"]},utility:{"table-scroll-top":""},sortingIcon:{"payhere-reguler":{asc:S.jsx("img",{src:ki,className:"1ru-w-4 1ru-h-4"}),desc:S.jsx("img",{src:ki,className:"1ru-w-4 1ru-h-4 1ru-rotate-180"})},"laba-reguler":{asc:S.jsx("img",{src:ki,className:"1ru-w-4 1ru-h-4"}),desc:S.jsx("img",{src:ki,className:"1ru-w-4 1ru-h-4 1ru-rotate-180"})},"laba-small":{asc:S.jsx("img",{src:ki,className:"1ru-w-4 1ru-h-4"}),desc:S.jsx("img",{src:ki,className:"1ru-w-4 1ru-h-4 1ru-rotate-180"})}},variant:{"laba-grey-02":qn["laba-grey-02"]}}),uE=({tableInstance:e,classNameWrapperTable:t,classNameTable:n,handlerRowClick:r,privillageRowClick:i,headerId:a,tbodyTrId:o,maxHeight:s,idCalculateHeight:l,componentSortASC:u,componentSortDESC:c,classNamePointer:d,emptyPlaceholder:f,renderSubComponent:h})=>S.jsx("div",{id:"1ru-table",style:s?{height:s,overflow:"auto"}:{},className:t??"",children:S.jsxs("table",{className:n,children:[S.jsx("thead",{id:a,children:e.getHeaderGroups().map(g=>S.jsx("tr",{children:g.headers.map(m=>S.jsx("th",{style:lE(s,m),colSpan:m.colSpan,children:m.isPlaceholder?null:S.jsxs("div",{className:m.column.getCanSort()?qn.sorting:"",onClick:m.column.getToggleSortingHandler(),children:[ao(m.column.columnDef.header,m.getContext()),m.column.getCanSort()&&S.jsx("span",{className:"1ru-flex-shrink-0",children:m.column.getIsSorted()==="asc"||m.column.getIsSorted()==="desc"?S.jsxs(S.Fragment,{children:[m.column.getIsSorted()==="asc"&&S.jsx(S.Fragment,{children:u}),m.column.getIsSorted()==="desc"&&S.jsx(S.Fragment,{children:c})]}):S.jsx(S.Fragment,{})})]})},m.id))},g.id))}),S.jsxs("tbody",{children:[e.getRowModel().rows.length>0&&e.getRowModel().rows.map((g,m)=>S.jsxs(x.Fragment,{children:[S.jsx("tr",{onClick:p=>{p.stopPropagation(),i&&typeof r=="function"&&r(g.original,g)},className:i?d:"","data-calculate-height":`${l}-${m}`,id:o(g),children:g.getVisibleCells().map(p=>{var b,v,y;return S.jsx("td",{style:typeof((b=p.column.columnDef.meta)==null?void 0:b.styleTd)=="function"?p.column.columnDef.meta.styleTd(g.original,g):{},className:typeof((v=p.column.columnDef.meta)==null?void 0:v.classNameTd)=="function"?(y=p.column.columnDef.meta)==null?void 0:y.classNameTd(g.original,g):"",children:ao(p.column.columnDef.cell,p.getContext())},p.id)})}),g.getIsExpanded()&&typeof h=="function"&&S.jsx("tr",{children:S.jsx("td",{colSpan:g.getVisibleCells().length,children:h(g.original,g)})})]},g.id)),e.getRowModel().rows.length===0&&x.isValidElement(f)&&S.jsx("tr",{children:S.jsx("td",{colSpan:e.getVisibleFlatColumns().length,children:f})})]})]})}),h1=x.forwardRef((e,t)=>{const{context:n,...r}=e;return S.jsx("thead",{id:(n==null?void 0:n.headerId)??"",...r,ref:t})});h1.displayName="VirtualizationHead";const cE=({style:e,context:t,...n})=>S.jsx("table",{...n,id:"1ru-table",className:(t==null?void 0:t.classNameTable)??"",style:e}),dE=({tableInstance:e,classNameWrapperTable:t,handlerRowClick:n,privillageRowClick:r,virtualizationProps:i,headerId:a,tbodyTrId:o,classNameTable:s,componentSortASC:l,componentSortDESC:u,classNamePointer:c,emptyPlaceholder:d,renderSubComponent:f})=>{var m,p,b;const[h,g]=x.useState(0);return S.jsx(gf,{context:{headerId:a,classNameTable:s},typeHight:"min-max",totalCount:((m=e.getRowModel().rows)==null?void 0:m.length)||0,minLengthItem:((p=e.getRowModel().rows)==null?void 0:p.length)||0,typeCalculateItemSize:"auto",component:{TableHead:h1,Table:cE,EmptyPlaceholder:()=>S.jsx("tbody",{ref:v=>{var y;return g(((y=v==null?void 0:v.getBoundingClientRect())==null?void 0:y.height)??0)},children:S.jsx("tr",{children:S.jsx("td",{colSpan:e.getVisibleFlatColumns().length,children:x.isValidElement(d)&&d})})})},classNameContainer:t,fixedHeaderContent:()=>e.getHeaderGroups().map(v=>S.jsx("tr",{children:v.headers.map(y=>{var C,w;return S.jsx("th",{colSpan:y.colSpan,style:typeof((C=y.column.columnDef.meta)==null?void 0:C.styleTh)=="function"?(w=y.column.columnDef.meta)==null?void 0:w.styleTh(y.column.columnDef):{},children:y.isPlaceholder?null:S.jsxs("div",{className:y.column.getCanSort()?qn.sorting:"",onClick:y.column.getToggleSortingHandler(),children:[ao(y.column.columnDef.header,y.getContext()),y.column.getCanSort()&&S.jsx("span",{className:"1ru-flex-shrink-0",children:y.column.getIsSorted()==="asc"||y.column.getIsSorted()==="desc"?S.jsxs(S.Fragment,{children:[y.column.getIsSorted()==="asc"&&S.jsx(S.Fragment,{children:l}),y.column.getIsSorted()==="desc"&&S.jsx(S.Fragment,{children:u})]}):S.jsx(S.Fragment,{})})]})},y.id)})},v.id)),itemContent:(v,y)=>{var w,I;const C=(I=(w=e.getRowModel())==null?void 0:w.rows)==null?void 0:I[y];return S.jsx(v,{children:({...E})=>S.jsxs(x.Fragment,{children:[S.jsx("tr",{...E,onClick:D=>{D.stopPropagation(),r&&typeof n=="function"&&n(C.original,C)},className:r?c:"",id:o(C),children:C.getVisibleCells().map(D=>{var $,F,_;return S.jsx(S.Fragment,{children:S.jsx("td",{style:typeof(($=D.column.columnDef.meta)==null?void 0:$.styleTd)=="function"?D.column.columnDef.meta.styleTd(C.original,C):{},className:typeof((F=D.column.columnDef.meta)==null?void 0:F.classNameTd)=="function"?(_=D.column.columnDef.meta)==null?void 0:_.classNameTd(C.original,C):"",children:ao(D.column.columnDef.cell,D.getContext())},D.id)})})}),C.getIsExpanded()&&typeof f=="function"&&S.jsx("tr",{"data-sub-component":y,children:S.jsx("td",{colSpan:C.getVisibleCells().length,children:f(C.original,C)})})]},C.id)},C.id)},...i,minHeightItem:((i==null?void 0:i.minHeightItem)??60)+((((b=e.getRowModel().rows)==null?void 0:b.length)||0)>0?0:h),itemSizeNames:typeof f=="function"?[...(i==null?void 0:i.itemSizeNames)??[],"data-sub-component"]:i==null?void 0:i.itemSizeNames})},fE=({tableInstance:e,classNameWrapperTable:t="",classNameTable:n="",collapseAll:r=!0,handlerRowClick:i,privillageRowClick:a=!1,virtualization:o=!1,virtualizationProps:s,headerId:l="",tbodyTrId:u=()=>"",maxHeight:c=0,idCalculateHeight:d=void 0,kind:f="laba-reguler",componentSortASC:h,componentSortDESC:g,scrollTop:m=!1,emptyPlaceholder:p,variant:b,renderSubComponent:v})=>{const y=()=>{if(![void 0,"undefined"].includes(d)){let C=0;const w=document.querySelectorAll(`[data-calculate-height^="${d}-"]`);return w==null||w.forEach(I=>{C+=I.offsetHeight}),C>c?c:C}return c};return Ho(()=>{!r&&typeof e.toggleAllRowsExpanded=="function"&&e.toggleAllRowsExpanded()},[r,e==null?void 0:e.toggleAllRowsExpanded]),S.jsxs(S.Fragment,{children:[!o&&S.jsx(uE,{tbodyTrId:u,headerId:l,tableInstance:e,classNameTable:n,classNameWrapperTable:`${Jt().kind[f]} ${b?Jt().variant[b]:""}
|
73
|
+
*/function ao(e,t){return e?cS(e)?j.createElement(e,t):e:null}function cS(e){return dS(e)||typeof e=="function"||fS(e)}function dS(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function fS(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function hS(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=j.useState(()=>({current:Ob(t)})),[r,i]=j.useState(()=>n.current.initialState);return n.current.setOptions(a=>({...a,...e,state:{...r,...e.state},onStateChange:o=>{i(o),e.onStateChange==null||e.onStateChange(o)}})),n.current}const gS=Object.freeze(Object.defineProperty({__proto__:null,ColumnFaceting:hb,ColumnFiltering:wb,ColumnGrouping:Db,ColumnOrdering:Ib,ColumnPinning:Eb,ColumnSizing:_b,ColumnVisibility:Rb,GlobalFaceting:Ab,GlobalFiltering:Fb,Headers:fb,RowExpanding:Pb,RowPagination:Tb,RowPinning:kb,RowSelection:Mb,RowSorting:Vb,_getVisibleLeafColumns:Ui,aggregationFns:Ls,buildHeaderGroups:Aa,createCell:cb,createColumn:db,createColumnHelper:k5,createRow:Oo,createTable:Ob,defaultColumnSizing:Fa,expandRows:Jd,filterFns:Mn,flattenBy:Xd,flexRender:ao,functionalUpdate:ar,getCoreRowModel:Q5,getExpandedRowModel:q5,getFacetedMinMaxValues:eS,getFacetedRowModel:rS,getFacetedUniqueValues:iS,getFilteredRowModel:aS,getGroupedRowModel:oS,getMemoOptions:oe,getPaginationRowModel:lS,getSortedRowModel:uS,isFunction:Vo,isNumberArray:ub,isRowSelected:nu,isSubRowSelected:ml,makeStateUpdater:Gt,memo:ae,noop:M5,orderColumns:Sb,passiveEventSupported:$b,reSplitAlphaNumeric:pl,selectRowsFn:js,shouldAutoRemoveFilter:Bc,sortingFns:zi,useReactTable:hS},Symbol.toStringTag,{value:"Module"})),ru=0,Vr=1,ga=2,Lb=4;function oo(e,t){return n=>e(t(n))}function mS(e,t){return t(e)}function jb(e,t){return n=>e(t,n)}function cg(e,t){return()=>e(t)}function iu(e,t){return t(e),e}function Ue(...e){return e}function pS(e){e()}function dg(e){return()=>e}function bS(...e){return()=>{e.map(pS)}}function Kd(e){return e!==void 0}function Di(){}function We(e,t){return e(Vr,t)}function ve(e,t){e(ru,t)}function Qd(e){e(ga)}function Rt(e){return e(Lb)}function se(e,t){return We(e,jb(t,ru))}function Wn(e,t){const n=e(Vr,r=>{n(),t(r)});return n}function Ee(){const e=[];return(t,n)=>{switch(t){case ga:e.splice(0,e.length);return;case Vr:return e.push(n),()=>{const r=e.indexOf(n);r>-1&&e.splice(r,1)};case ru:e.slice().forEach(r=>{r(n)});return;default:throw new Error(`unrecognized action ${t}`)}}}function K(e){let t=e;const n=Ee();return(r,i)=>{switch(r){case Vr:i(t);break;case ru:t=i;break;case Lb:return t}return n(r,i)}}function vS(e){let t,n;const r=()=>t&&t();return function(i,a){switch(i){case Vr:return a?n===a?void 0:(r(),n=a,t=We(e,a),t):(r(),Di);case ga:r(),n=null;return;default:throw new Error(`unrecognized action ${i}`)}}}function rn(e){return iu(Ee(),t=>se(e,t))}function At(e,t){return iu(K(t),n=>se(e,n))}function yS(...e){return t=>e.reduceRight(mS,t)}function U(e,...t){const n=yS(...t);return(r,i)=>{switch(r){case Vr:return We(e,n(i));case ga:Qd(e);return}}}function Hb(e,t){return e===t}function Ye(e=Hb){let t;return n=>r=>{e(t,r)||(t=r,n(r))}}function pe(e){return t=>n=>{e(n)&&t(n)}}function te(e){return t=>oo(t,e)}function Bn(e){return t=>()=>t(e)}function On(e,t){return n=>r=>n(t=e(t,r))}function oa(e){return t=>n=>{e>0?e--:t(n)}}function Dr(e){let t=null,n;return r=>i=>{t=i,!n&&(n=setTimeout(()=>{n=void 0,r(t)},e))}}function fg(e){let t,n;return r=>i=>{t=i,n&&clearTimeout(n),n=setTimeout(()=>{r(t)},e)}}function ye(...e){const t=new Array(e.length);let n=0,r=null;const i=Math.pow(2,e.length)-1;return e.forEach((a,o)=>{const s=Math.pow(2,o);We(a,l=>{const u=n;n=n|s,t[o]=l,u!==i&&n===i&&r&&(r(),r=null)})}),a=>o=>{const s=()=>a([o].concat(t));n===i?s():r=s}}function hg(...e){return function(t,n){switch(t){case Vr:return bS(...e.map(r=>We(r,n)));case ga:return;default:throw new Error(`unrecognized action ${t}`)}}}function be(e,t=Hb){return U(e,Ye(t))}function yt(...e){const t=Ee(),n=new Array(e.length);let r=0;const i=Math.pow(2,e.length)-1;return e.forEach((a,o)=>{const s=Math.pow(2,o);We(a,l=>{n[o]=l,r=r|s,r===i&&ve(t,n)})}),function(a,o){switch(a){case Vr:return r===i&&o(n),We(t,o);case ga:return Qd(t);default:throw new Error(`unrecognized action ${a}`)}}}function Te(e,t=[],{singleton:n}={singleton:!0}){return{id:xS(),constructor:e,dependencies:t,singleton:n}}const xS=()=>Symbol();function CS(e){const t=new Map,n=({id:r,constructor:i,dependencies:a,singleton:o})=>{if(o&&t.has(r))return t.get(r);const s=i(a.map(l=>n(l)));return o&&t.set(r,s),s};return n(e)}function wS(e,t){const n={},r={};let i=0;const a=e.length;for(;i<a;)r[e[i]]=1,i+=1;for(const o in t)r.hasOwnProperty(o)||(n[o]=t[o]);return n}const os=typeof document<"u"?x.useLayoutEffect:x.useEffect;function qd(e,t,n){const r=Object.keys(t.required||{}),i=Object.keys(t.optional||{}),a=Object.keys(t.methods||{}),o=Object.keys(t.events||{}),s=x.createContext({});function l(b,v){b.propsReady&&ve(b.propsReady,!1);for(const y of r){const C=b[t.required[y]];ve(C,v[y])}for(const y of i)if(y in v){const C=b[t.optional[y]];ve(C,v[y])}b.propsReady&&ve(b.propsReady,!0)}function u(b){return a.reduce((v,y)=>(v[y]=C=>{const w=b[t.methods[y]];ve(w,C)},v),{})}function c(b){return o.reduce((v,y)=>(v[y]=vS(b[t.events[y]]),v),{})}const d=x.forwardRef((b,v)=>{const{children:y,...C}=b,[w]=x.useState(()=>iu(CS(e),E=>l(E,C))),[I]=x.useState(cg(c,w));return os(()=>{for(const E of o)E in C&&We(I[E],C[E]);return()=>{Object.values(I).map(Qd)}},[C,I,w]),os(()=>{l(w,C)}),x.useImperativeHandle(v,dg(u(w))),x.createElement(s.Provider,{value:w},n?x.createElement(n,wS([...r,...i,...o],C),y):y)}),f=b=>x.useCallback(jb(ve,x.useContext(s)[b]),[b]),h=b=>{const y=x.useContext(s)[b],C=x.useCallback(w=>We(y,w),[y]);return x.useSyncExternalStore(C,()=>Rt(y),()=>Rt(y))},g=b=>{const y=x.useContext(s)[b],[C,w]=x.useState(cg(Rt,y));return os(()=>We(y,I=>{I!==C&&w(dg(I))}),[y,C]),C},m=x.version.startsWith("18")?h:g;return{Component:d,usePublisher:f,useEmitterValue:m,useEmitter:(b,v)=>{const C=x.useContext(s)[b];os(()=>We(C,v),[v,C])}}}const DS=typeof document<"u"?x.useLayoutEffect:x.useEffect,SS=DS;var an=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e))(an||{});const IS={0:"debug",1:"log",2:"warn",3:"error"},ES=()=>typeof globalThis>"u"?window:globalThis,Or=Te(()=>{const e=K(3);return{log:K((n,r,i=1)=>{var a;const o=(a=ES().VIRTUOSO_LOG_LEVEL)!=null?a:Rt(e);i>=o&&console[IS[i]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",n,r)}),logLevel:e}},[],{singleton:!0});function ef(e,t=!0){const n=x.useRef(null);let r=i=>{};if(typeof ResizeObserver<"u"){const i=x.useMemo(()=>new ResizeObserver(a=>{requestAnimationFrame(()=>{const o=a[0].target;o.offsetParent!==null&&e(o)})}),[e]);r=a=>{a&&t?(i.observe(a),n.current=a):(n.current&&i.unobserve(n.current),n.current=null)}}return{ref:n,callbackRef:r}}function zn(e,t=!0){return ef(e,t).callbackRef}function Wb(e,t,n,r,i,a,o){const s=x.useCallback(l=>{const u=_S(l.children,t,"offsetHeight",i);let c=l.parentElement;for(;!c.dataset.virtuosoScroller;)c=c.parentElement;const d=c.lastElementChild.dataset.viewportType==="window",f=o?o.scrollTop:d?window.pageYOffset||document.documentElement.scrollTop:c.scrollTop,h=o?o.scrollHeight:d?document.documentElement.scrollHeight:c.scrollHeight,g=o?o.offsetHeight:d?window.innerHeight:c.offsetHeight;r({scrollTop:Math.max(f,0),scrollHeight:h,viewportHeight:g}),a==null||a($S("row-gap",getComputedStyle(l).rowGap,i)),u!==null&&e(u)},[e,t,i,a,o,r]);return ef(s,n)}function _S(e,t,n,r){const i=e.length;if(i===0)return null;const a=[];for(let o=0;o<i;o++){const s=e.item(o);if(!s||s.dataset.index===void 0)continue;const l=parseInt(s.dataset.index),u=parseFloat(s.dataset.knownSize),c=t(s,n);if(c===0&&r("Zero-sized element, this should not happen",{child:s},an.ERROR),c===u)continue;const d=a[a.length-1];a.length===0||d.size!==c||d.endIndex!==l-1?a.push({startIndex:l,endIndex:l,size:c}):a[a.length-1].endIndex++}return a}function $S(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,an.WARN),t==="normal"?0:parseInt(t??"0",10)}function _n(e,t){return Math.round(e.getBoundingClientRect()[t])}function zb(e,t){return Math.abs(e-t)<1.01}function Gb(e,t,n,r=Di,i){const a=x.useRef(null),o=x.useRef(null),s=x.useRef(null),l=x.useCallback(d=>{const f=d.target,h=f===window||f===document,g=h?window.pageYOffset||document.documentElement.scrollTop:f.scrollTop,m=h?document.documentElement.scrollHeight:f.scrollHeight,p=h?window.innerHeight:f.offsetHeight,b=()=>{e({scrollTop:Math.max(g,0),scrollHeight:m,viewportHeight:p})};d.suppressFlushSync?b():ko.flushSync(b),o.current!==null&&(g===o.current||g<=0||g===m-p)&&(o.current=null,t(!0),s.current&&(clearTimeout(s.current),s.current=null))},[e,t]);x.useEffect(()=>{const d=i||a.current;return r(i||a.current),l({target:d,suppressFlushSync:!0}),d.addEventListener("scroll",l,{passive:!0}),()=>{r(null),d.removeEventListener("scroll",l)}},[a,l,n,r,i]);function u(d){const f=a.current;if(!f||"offsetHeight"in f&&f.offsetHeight===0)return;const h=d.behavior==="smooth";let g,m,p;f===window?(m=Math.max(_n(document.documentElement,"height"),document.documentElement.scrollHeight),g=window.innerHeight,p=document.documentElement.scrollTop):(m=f.scrollHeight,g=_n(f,"height"),p=f.scrollTop);const b=m-g;if(d.top=Math.ceil(Math.max(Math.min(b,d.top),0)),zb(g,m)||d.top===p){e({scrollTop:p,scrollHeight:m,viewportHeight:g}),h&&t(!0);return}h?(o.current=d.top,s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{s.current=null,o.current=null,t(!0)},1e3)):o.current=null,f.scrollTo(d)}function c(d){a.current.scrollBy(d)}return{scrollerRef:a,scrollByCallback:c,scrollToCallback:u}}const Bt=Te(()=>{const e=Ee(),t=Ee(),n=K(0),r=Ee(),i=K(0),a=Ee(),o=Ee(),s=K(0),l=K(0),u=K(0),c=K(0),d=Ee(),f=Ee(),h=K(!1);return se(U(e,te(({scrollTop:g})=>g)),t),se(U(e,te(({scrollHeight:g})=>g)),o),se(t,i),{scrollContainerState:e,scrollTop:t,viewportHeight:a,headerHeight:s,fixedHeaderHeight:l,fixedFooterHeight:u,footerHeight:c,scrollHeight:o,smoothScrollTargetReached:r,scrollTo:d,scrollBy:f,statefulScrollTop:i,deviation:n,scrollingInProgress:h}},[],{singleton:!0}),so={lvl:0};function Zb(e,t,n,r=so,i=so){return{k:e,v:t,lvl:n,l:r,r:i}}function Ge(e){return e===so}function Ji(){return so}function Lc(e,t){if(Ge(e))return so;const{k:n,l:r,r:i}=e;if(t===n){if(Ge(r))return i;if(Ge(i))return r;{const[a,o]=Xb(r);return Hs(mt(e,{k:a,v:o,l:Yb(r)}))}}else return t<n?Hs(mt(e,{l:Lc(r,t)})):Hs(mt(e,{r:Lc(i,t)}))}function lo(e,t){if(!Ge(e))return t===e.k?e.v:t<e.k?lo(e.l,t):lo(e.r,t)}function $n(e,t,n="k"){if(Ge(e))return[-1/0,void 0];if(Number(e[n])===t)return[e.k,e.v];if(Number(e[n])<t){const r=$n(e.r,t,n);return r[0]===-1/0?[e.k,e.v]:r}return $n(e.l,t,n)}function qt(e,t,n){return Ge(e)?Zb(t,n,1):t===e.k?mt(e,{k:t,v:n}):t<e.k?gg(mt(e,{l:qt(e.l,t,n)})):gg(mt(e,{r:qt(e.r,t,n)}))}function jc(e,t,n){if(Ge(e))return[];const{k:r,v:i,l:a,r:o}=e;let s=[];return r>t&&(s=s.concat(jc(a,t,n))),r>=t&&r<=n&&s.push({k:r,v:i}),r<=n&&(s=s.concat(jc(o,t,n))),s}function ai(e){return Ge(e)?[]:[...ai(e.l),{k:e.k,v:e.v},...ai(e.r)]}function Xb(e){return Ge(e.r)?[e.k,e.v]:Xb(e.r)}function Yb(e){return Ge(e.r)?e.l:Hs(mt(e,{r:Yb(e.r)}))}function mt(e,t){return Zb(t.k!==void 0?t.k:e.k,t.v!==void 0?t.v:e.v,t.lvl!==void 0?t.lvl:e.lvl,t.l!==void 0?t.l:e.l,t.r!==void 0?t.r:e.r)}function Hu(e){return Ge(e)||e.lvl>e.r.lvl}function gg(e){return Hc(Jb(e))}function Hs(e){const{l:t,r:n,lvl:r}=e;if(n.lvl>=r-1&&t.lvl>=r-1)return e;if(r>n.lvl+1){if(Hu(t))return Jb(mt(e,{lvl:r-1}));if(!Ge(t)&&!Ge(t.r))return mt(t.r,{l:mt(t,{r:t.r.l}),r:mt(e,{l:t.r.r,lvl:r-1}),lvl:r});throw new Error("Unexpected empty nodes")}else{if(Hu(e))return Hc(mt(e,{lvl:r-1}));if(!Ge(n)&&!Ge(n.l)){const i=n.l,a=Hu(i)?n.lvl-1:n.lvl;return mt(i,{l:mt(e,{r:i.l,lvl:r-1}),r:Hc(mt(n,{l:i.r,lvl:a})),lvl:i.lvl+1})}else throw new Error("Unexpected empty nodes")}}function au(e,t,n){if(Ge(e))return[];const r=$n(e,t)[0];return RS(jc(e,r,n))}function Ub(e,t){const n=e.length;if(n===0)return[];let{index:r,value:i}=t(e[0]);const a=[];for(let o=1;o<n;o++){const{index:s,value:l}=t(e[o]);a.push({start:r,end:s-1,value:i}),r=s,i=l}return a.push({start:r,end:1/0,value:i}),a}function RS(e){return Ub(e,({k:t,v:n})=>({index:t,value:n}))}function Hc(e){const{r:t,lvl:n}=e;return!Ge(t)&&!Ge(t.r)&&t.lvl===n&&t.r.lvl===n?mt(t,{l:mt(e,{r:t.l}),lvl:n+1}):e}function Jb(e){const{l:t}=e;return!Ge(t)&&t.lvl===e.lvl?mt(t,{r:mt(e,{l:t.r})}):e}function bl(e,t,n,r=0){let i=e.length-1;for(;r<=i;){const a=Math.floor((r+i)/2),o=e[a],s=n(o,t);if(s===0)return a;if(s===-1){if(i-r<2)return a-1;i=a-1}else{if(i===r)return a;r=a+1}}throw new Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function Kb(e,t,n){return e[bl(e,t,n)]}function AS(e,t,n,r){const i=bl(e,t,r),a=bl(e,n,r,i);return e.slice(i,a+1)}const tf=Te(()=>({recalcInProgress:K(!1)}),[],{singleton:!0});function FS(e){const{size:t,startIndex:n,endIndex:r}=e;return i=>i.start===n&&(i.end===r||i.end===1/0)&&i.value===t}function mg(e,t){let n=0,r=0;for(;n<e;)n+=t[r+1]-t[r]-1,r++;return r-(n===e?0:1)}function PS(e,t){let n=Ge(e)?0:1/0;for(const r of t){const{size:i,startIndex:a,endIndex:o}=r;if(n=Math.min(n,a),Ge(e)){e=qt(e,0,i);continue}const s=au(e,a-1,o+1);if(s.some(FS(r)))continue;let l=!1,u=!1;for(const{start:c,end:d,value:f}of s)l?(o>=c||i===f)&&(e=Lc(e,c)):(u=f!==i,l=!0),d>o&&o>=c&&f!==i&&(e=qt(e,o+1,f));u&&(e=qt(e,a,i))}return[e,n]}function TS(){return{offsetTree:[],sizeTree:Ji(),groupOffsetTree:Ji(),lastIndex:0,lastOffset:0,lastSize:0,groupIndices:[]}}function nf({index:e},t){return t===e?0:t<e?-1:1}function kS({offset:e},t){return t===e?0:t<e?-1:1}function MS(e){return{index:e.index,value:e}}function BS(e,t,n,r=0){return r>0&&(t=Math.max(t,Kb(e,r,nf).offset)),Ub(AS(e,t,n,kS),MS)}function Wc(e,t,n,r){let i=e,a=0,o=0,s=0,l=0;if(t!==0){l=bl(i,t-1,nf),s=i[l].offset;const c=$n(n,t-1);a=c[0],o=c[1],i.length&&i[l].size===$n(n,t)[1]&&(l-=1),i=i.slice(0,l+1)}else i=[];for(const{start:u,value:c}of au(n,t,1/0)){const d=u-a,f=d*o+s+d*r;i.push({offset:f,size:c,index:u}),a=u,s=f,o=c}return{offsetTree:i,lastIndex:a,lastOffset:s,lastSize:o}}function VS(e,[t,n,r,i]){t.length>0&&r("received item sizes",t,an.DEBUG);const a=e.sizeTree;let o=a,s=0;if(n.length>0&&Ge(a)&&t.length===2){const f=t[0].size,h=t[1].size;o=n.reduce((g,m)=>qt(qt(g,m,f),m+1,h),o)}else[o,s]=PS(o,t);if(o===a)return e;const{offsetTree:l,lastIndex:u,lastSize:c,lastOffset:d}=Wc(e.offsetTree,s,o,i);return{sizeTree:o,offsetTree:l,lastIndex:u,lastOffset:d,lastSize:c,groupOffsetTree:n.reduce((f,h)=>qt(f,h,uo(h,l,i)),Ji()),groupIndices:n}}function uo(e,t,n){if(t.length===0)return 0;const{offset:r,index:i,size:a}=Kb(t,e,nf),o=e-i,s=a*o+(o-1)*n+r;return s>0?s+n:s}function OS(e){return typeof e.groupIndex<"u"}function Qb(e,t,n){if(OS(e))return t.groupIndices[e.groupIndex]+1;{const r=e.index==="LAST"?n:e.index;let i=qb(r,t);return i=Math.max(0,i,Math.min(n,i)),i}}function qb(e,t){if(!ou(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function ou(e){return!Ge(e.groupOffsetTree)}function NS(e){return ai(e).map(({k:t,v:n},r,i)=>{const a=i[r+1],o=a?a.k-1:1/0;return{startIndex:t,endIndex:o,size:n}})}const LS={offsetHeight:"height",offsetWidth:"width"},Gn=Te(([{log:e},{recalcInProgress:t}])=>{const n=Ee(),r=Ee(),i=At(r,0),a=Ee(),o=Ee(),s=K(0),l=K([]),u=K(void 0),c=K(void 0),d=K((w,I)=>_n(w,LS[I])),f=K(void 0),h=K(0),g=TS(),m=At(U(n,ye(l,e,h),On(VS,g),Ye()),g),p=At(U(l,Ye(),On((w,I)=>({prev:w.current,current:I}),{prev:[],current:[]}),te(({prev:w})=>w)),[]);se(U(l,pe(w=>w.length>0),ye(m,h),te(([w,I,E])=>{const D=w.reduce(($,F,_)=>qt($,F,uo(F,I.offsetTree,E)||_),Ji());return{...I,groupIndices:w,groupOffsetTree:D}})),m),se(U(r,ye(m),pe(([w,{lastIndex:I}])=>w<I),te(([w,{lastIndex:I,lastSize:E}])=>[{startIndex:w,endIndex:I,size:E}])),n),se(u,c);const b=At(U(u,te(w=>w===void 0)),!0);se(U(c,pe(w=>w!==void 0&&Ge(Rt(m).sizeTree)),te(w=>[{startIndex:0,endIndex:0,size:w}])),n);const v=rn(U(n,ye(m),On(({sizes:w},[I,E])=>({changed:E!==w,sizes:E}),{changed:!1,sizes:g}),te(w=>w.changed)));We(U(s,On((w,I)=>({diff:w.prev-I,prev:I}),{diff:0,prev:0}),te(w=>w.diff)),w=>{const{groupIndices:I}=Rt(m);if(w>0)ve(t,!0),ve(a,w+mg(w,I));else if(w<0){const E=Rt(p);E.length>0&&(w-=mg(-w,E)),ve(o,w)}}),We(U(s,ye(e)),([w,I])=>{w<0&&I("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:s},an.ERROR)});const y=rn(a);se(U(a,ye(m),te(([w,I])=>{const E=I.groupIndices.length>0,D=[],$=I.lastSize;if(E){const F=lo(I.sizeTree,0);let _=0,P=0;for(;_<w;){const B=I.groupIndices[P],T=I.groupIndices.length===P+1?1/0:I.groupIndices[P+1]-B-1;D.push({startIndex:B,endIndex:B,size:F}),D.push({startIndex:B+1,endIndex:B+1+T-1,size:$}),P++,_+=T+1}const k=ai(I.sizeTree);return _!==w&&k.shift(),k.reduce((B,{k:T,v:R})=>{let V=B.ranges;return B.prevSize!==0&&(V=[...B.ranges,{startIndex:B.prevIndex,endIndex:T+w-1,size:B.prevSize}]),{ranges:V,prevIndex:T+w,prevSize:R}},{ranges:D,prevIndex:w,prevSize:0}).ranges}return ai(I.sizeTree).reduce((F,{k:_,v:P})=>({ranges:[...F.ranges,{startIndex:F.prevIndex,endIndex:_+w-1,size:F.prevSize}],prevIndex:_+w,prevSize:P}),{ranges:[],prevIndex:0,prevSize:$}).ranges})),n);const C=rn(U(o,ye(m,h),te(([w,{offsetTree:I},E])=>{const D=-w;return uo(D,I,E)})));return se(U(o,ye(m,h),te(([w,I,E])=>{if(I.groupIndices.length>0){if(Ge(I.sizeTree))return I;let $=Ji();const F=Rt(p);let _=0,P=0,k=0;for(;_<-w;){k=F[P];const B=F[P+1]-k-1;P++,_+=B+1}if($=ai(I.sizeTree).reduce((B,{k:T,v:R})=>qt(B,Math.max(0,T+w),R),$),_!==-w){const B=lo(I.sizeTree,k);$=qt($,0,B);const T=$n(I.sizeTree,-w+1)[1];$=qt($,1,T)}return{...I,sizeTree:$,...Wc(I.offsetTree,0,$,E)}}else{const $=ai(I.sizeTree).reduce((F,{k:_,v:P})=>qt(F,Math.max(0,_+w),P),Ji());return{...I,sizeTree:$,...Wc(I.offsetTree,0,$,E)}}})),m),{data:f,totalCount:r,sizeRanges:n,groupIndices:l,defaultItemSize:c,fixedItemSize:u,unshiftWith:a,shiftWith:o,shiftWithOffset:C,beforeUnshiftWith:y,firstItemIndex:s,gap:h,sizes:m,listRefresh:v,statefulTotalCount:i,trackItemSizes:b,itemSize:d}},Ue(Or,tf),{singleton:!0}),jS=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function e1(e){const t=typeof e=="number"?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!jS)&&(t.behavior="auto"),t.offset||(t.offset=0),t}const No=Te(([{sizes:e,totalCount:t,listRefresh:n,gap:r},{scrollingInProgress:i,viewportHeight:a,scrollTo:o,smoothScrollTargetReached:s,headerHeight:l,footerHeight:u,fixedHeaderHeight:c,fixedFooterHeight:d},{log:f}])=>{const h=Ee(),g=Ee(),m=K(0);let p=null,b=null,v=null;function y(){p&&(p(),p=null),v&&(v(),v=null),b&&(clearTimeout(b),b=null),ve(i,!1)}return se(U(h,ye(e,a,t,m,l,u,f),ye(r,c,d),te(([[C,w,I,E,D,$,F,_],P,k,A])=>{const B=e1(C),{align:T,behavior:R,offset:V}=B,H=E-1,L=Qb(B,w,H);let Z=uo(L,w.offsetTree,P)+$;T==="end"?(Z+=k+$n(w.sizeTree,L)[1]-I+A,L===H&&(Z+=F)):T==="center"?Z+=(k+$n(w.sizeTree,L)[1]-I+A)/2:Z-=D,V&&(Z+=V);const O=W=>{y(),W?(_("retrying to scroll to",{location:C},an.DEBUG),ve(h,C)):(ve(g,!0),_("list did not change, scroll successful",{},an.DEBUG))};if(y(),R==="smooth"){let W=!1;v=We(n,q=>{W=W||q}),p=Wn(s,()=>{O(W)})}else p=Wn(U(n,HS(150)),O);return b=setTimeout(()=>{y()},1200),ve(i,!0),_("scrolling from index to",{index:L,top:Z,behavior:R},an.DEBUG),{top:Z,behavior:R}})),o),{scrollToIndex:h,scrollTargetReached:g,topListHeight:m}},Ue(Gn,Bt,Or),{singleton:!0});function HS(e){return t=>{const n=setTimeout(()=>{t(!1)},e);return r=>{r&&(t(!0),clearTimeout(n))}}}const co="up",Ga="down",WS="none",zS={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollTop:0,viewportHeight:0,scrollHeight:0}},GS=0,Lo=Te(([{scrollContainerState:e,scrollTop:t,viewportHeight:n,headerHeight:r,footerHeight:i,scrollBy:a}])=>{const o=K(!1),s=K(!0),l=Ee(),u=Ee(),c=K(4),d=K(GS),f=At(U(hg(U(be(t),oa(1),Bn(!0)),U(be(t),oa(1),Bn(!1),fg(100))),Ye()),!1),h=At(U(hg(U(a,Bn(!0)),U(a,Bn(!1),fg(200))),Ye()),!1);se(U(yt(be(t),be(d)),te(([v,y])=>v<=y),Ye()),s),se(U(s,Dr(50)),u);const g=rn(U(yt(e,be(n),be(r),be(i),be(c)),On((v,[{scrollTop:y,scrollHeight:C},w,I,E,D])=>{const $=y+w-C>-D,F={viewportHeight:w,scrollTop:y,scrollHeight:C};if($){let P,k;return y>v.state.scrollTop?(P="SCROLLED_DOWN",k=v.state.scrollTop-y):(P="SIZE_DECREASED",k=v.state.scrollTop-y||v.scrollTopDelta),{atBottom:!0,state:F,atBottomBecause:P,scrollTopDelta:k}}let _;return F.scrollHeight>v.state.scrollHeight?_="SIZE_INCREASED":w<v.state.viewportHeight?_="VIEWPORT_HEIGHT_DECREASING":y<v.state.scrollTop?_="SCROLLING_UPWARDS":_="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:_,state:F}},zS),Ye((v,y)=>v&&v.atBottom===y.atBottom))),m=At(U(e,On((v,{scrollTop:y,scrollHeight:C,viewportHeight:w})=>{if(zb(v.scrollHeight,C))return{scrollTop:y,scrollHeight:C,jump:0,changed:!1};{const I=C-(y+w)<1;return v.scrollTop!==y&&I?{scrollHeight:C,scrollTop:y,jump:v.scrollTop-y,changed:!0}:{scrollHeight:C,scrollTop:y,jump:0,changed:!0}}},{scrollHeight:0,jump:0,scrollTop:0,changed:!1}),pe(v=>v.changed),te(v=>v.jump)),0);se(U(g,te(v=>v.atBottom)),o),se(U(o,Dr(50)),l);const p=K(Ga);se(U(e,te(({scrollTop:v})=>v),Ye(),On((v,y)=>Rt(h)?{direction:v.direction,prevScrollTop:y}:{direction:y<v.prevScrollTop?co:Ga,prevScrollTop:y},{direction:Ga,prevScrollTop:0}),te(v=>v.direction)),p),se(U(e,Dr(50),Bn(WS)),p);const b=K(0);return se(U(f,pe(v=>!v),Bn(0)),b),se(U(t,Dr(100),ye(f),pe(([v,y])=>!!y),On(([v,y],[C])=>[y,C],[0,0]),te(([v,y])=>y-v)),b),{isScrolling:f,isAtTop:s,isAtBottom:o,atBottomState:g,atTopStateChange:u,atBottomStateChange:l,scrollDirection:p,atBottomThreshold:c,atTopThreshold:d,scrollVelocity:b,lastJumpDueToItemResize:m}},Ue(Bt)),Nr=Te(([{log:e}])=>{const t=K(!1),n=rn(U(t,pe(r=>r),Ye()));return We(t,r=>{r&&Rt(e)("props updated",{},an.DEBUG)}),{propsReady:t,didMount:n}},Ue(Or),{singleton:!0});function rf(e,t){e==0?t():requestAnimationFrame(()=>rf(e-1,t))}function af(e,t){const n=t-1;return typeof e=="number"?e:e.index==="LAST"?n:e.index}const jo=Te(([{sizes:e,listRefresh:t,defaultItemSize:n},{scrollTop:r},{scrollToIndex:i,scrollTargetReached:a},{didMount:o}])=>{const s=K(!0),l=K(0),u=K(!0);return se(U(o,ye(l),pe(([c,d])=>!!d),Bn(!1)),s),se(U(o,ye(l),pe(([c,d])=>!!d),Bn(!1)),u),We(U(yt(t,o),ye(s,e,n,u),pe(([[,c],d,{sizeTree:f},h,g])=>c&&(!Ge(f)||Kd(h))&&!d&&!g),ye(l)),([,c])=>{Wn(a,()=>{ve(u,!0)}),rf(4,()=>{Wn(r,()=>{ve(s,!0)}),ve(i,c)})}),{scrolledToInitialItem:s,initialTopMostItemIndex:l,initialItemFinalLocationReached:u}},Ue(Gn,Bt,No,Nr),{singleton:!0});function pg(e){return e?e==="smooth"?"smooth":"auto":!1}const ZS=(e,t)=>typeof e=="function"?pg(e(t)):t&&pg(e),XS=Te(([{totalCount:e,listRefresh:t},{isAtBottom:n,atBottomState:r},{scrollToIndex:i},{scrolledToInitialItem:a},{propsReady:o,didMount:s},{log:l},{scrollingInProgress:u}])=>{const c=K(!1),d=Ee();let f=null;function h(m){ve(i,{index:"LAST",align:"end",behavior:m})}We(U(yt(U(be(e),oa(1)),s),ye(be(c),n,a,u),te(([[m,p],b,v,y,C])=>{let w=p&&y,I="auto";return w&&(I=ZS(b,v||C),w=w&&!!I),{totalCount:m,shouldFollow:w,followOutputBehavior:I}}),pe(({shouldFollow:m})=>m)),({totalCount:m,followOutputBehavior:p})=>{f&&(f(),f=null),f=Wn(t,()=>{Rt(l)("following output to ",{totalCount:m},an.DEBUG),h(p),f=null})});function g(m){const p=Wn(r,b=>{m&&!b.atBottom&&b.notAtBottomBecause==="SIZE_INCREASED"&&!f&&(Rt(l)("scrolling to bottom due to increased size",{},an.DEBUG),h("auto"))});setTimeout(p,100)}return We(U(yt(be(c),e,o),pe(([m,,p])=>m&&p),On(({value:m},[,p])=>({refreshed:m===p,value:p}),{refreshed:!1,value:0}),pe(({refreshed:m})=>m),ye(c,e)),([,m])=>{Rt(a)&&g(m!==!1)}),We(d,()=>{g(Rt(c)!==!1)}),We(yt(be(c),r),([m,p])=>{m&&!p.atBottom&&p.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&h("auto")}),{followOutput:c,autoscrollToBottom:d}},Ue(Gn,Lo,No,jo,Nr,Or,Bt));function YS(e){return e.reduce((t,n)=>(t.groupIndices.push(t.totalCount),t.totalCount+=n+1,t),{totalCount:0,groupIndices:[]})}const t1=Te(([{totalCount:e,groupIndices:t,sizes:n},{scrollTop:r,headerHeight:i}])=>{const a=Ee(),o=Ee(),s=rn(U(a,te(YS)));return se(U(s,te(l=>l.totalCount)),e),se(U(s,te(l=>l.groupIndices)),t),se(U(yt(r,n,i),pe(([l,u])=>ou(u)),te(([l,u,c])=>$n(u.groupOffsetTree,Math.max(l-c,0),"v")[0]),Ye(),te(l=>[l])),o),{groupCounts:a,topItemsIndexes:o}},Ue(Gn,Bt));function fo(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}function n1(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}const vl="top",yl="bottom",bg="none";function vg(e,t,n){return typeof e=="number"?n===co&&t===vl||n===Ga&&t===yl?e:0:n===co?t===vl?e.main:e.reverse:t===yl?e.main:e.reverse}function yg(e,t){return typeof e=="number"?e:e[t]||0}const of=Te(([{scrollTop:e,viewportHeight:t,deviation:n,headerHeight:r,fixedHeaderHeight:i}])=>{const a=Ee(),o=K(0),s=K(0),l=K(0),u=At(U(yt(be(e),be(t),be(r),be(a,fo),be(l),be(o),be(i),be(n),be(s)),te(([c,d,f,[h,g],m,p,b,v,y])=>{const C=c-v,w=p+b,I=Math.max(f-C,0);let E=bg;const D=yg(y,vl),$=yg(y,yl);return h-=v,h+=f+b,g+=f+b,g-=v,h>c+w-D&&(E=co),g<c-I+d+$&&(E=Ga),E!==bg?[Math.max(C-f-vg(m,vl,E)-D,0),C-I-b+d+vg(m,yl,E)+$]:null}),pe(c=>c!=null),Ye(fo)),[0,0]);return{listBoundary:a,overscan:l,topListHeight:o,increaseViewportBy:s,visibleRange:u}},Ue(Bt),{singleton:!0});function US(e,t,n){if(ou(t)){const r=qb(e,t);return[{index:$n(t.groupOffsetTree,r)[0],size:0,offset:0},{index:r,size:0,offset:0,data:n&&n[0]}]}return[{index:e,size:0,offset:0,data:n&&n[0]}]}const Wu={items:[],topItems:[],offsetTop:0,offsetBottom:0,top:0,bottom:0,topListHeight:0,totalCount:0,firstItemIndex:0};function xg(e,t,n){if(e.length===0)return[];if(!ou(t))return e.map(u=>({...u,index:u.index+n,originalIndex:u.index}));const r=e[0].index,i=e[e.length-1].index,a=[],o=au(t.groupOffsetTree,r,i);let s,l=0;for(const u of e){(!s||s.end<u.index)&&(s=o.shift(),l=t.groupIndices.indexOf(s.start));let c;u.index===s.start?c={type:"group",index:l}:c={index:u.index-(l+1)+n,groupIndex:l},a.push({...c,size:u.size,offset:u.offset,originalIndex:u.index,data:u.data})}return a}function Ws(e,t,n,r,i,a){const{lastSize:o,lastOffset:s,lastIndex:l}=i;let u=0,c=0;if(e.length>0){u=e[0].offset;const m=e[e.length-1];c=m.offset+m.size}const d=n-l,f=s+d*o+(d-1)*r,h=u,g=f-c;return{items:xg(e,i,a),topItems:xg(t,i,a),topListHeight:t.reduce((m,p)=>p.size+m,0),offsetTop:u,offsetBottom:g,top:h,bottom:c,totalCount:n,firstItemIndex:a}}function r1(e,t,n,r,i,a){let o=0;if(n.groupIndices.length>0)for(const c of n.groupIndices){if(c-o>=e)break;o++}const s=e+o,l=af(t,s),u=Array.from({length:s}).map((c,d)=>({index:d+l,size:0,offset:0,data:a[d+l]}));return Ws(u,[],s,i,n,r)}const Si=Te(([{sizes:e,totalCount:t,data:n,firstItemIndex:r,gap:i},a,{visibleRange:o,listBoundary:s,topListHeight:l},{scrolledToInitialItem:u,initialTopMostItemIndex:c},{topListHeight:d},f,{didMount:h},{recalcInProgress:g}])=>{const m=K([]),p=K(0),b=Ee();se(a.topItemsIndexes,m);const v=At(U(yt(h,g,be(o,fo),be(t),be(e),be(c),u,be(m),be(r),be(i),n),pe(([I,E,,D,,,,,,,$])=>{const F=$&&$.length!==D;return I&&!E&&!F}),te(([,,[I,E],D,$,F,_,P,k,A,B])=>{const T=$,{sizeTree:R,offsetTree:V}=T,H=Rt(p);if(D===0)return{...Wu,totalCount:D};if(I===0&&E===0)return H===0?{...Wu,totalCount:D}:r1(H,F,$,k,A,B||[]);if(Ge(R))return H>0?null:Ws(US(af(F,D),T,B),[],D,A,T,k);const L=[];if(P.length>0){const Y=P[0],N=P[P.length-1];let G=0;for(const J of au(R,Y,N)){const re=J.value,fe=Math.max(J.start,Y),le=Math.min(J.end,N);for(let z=fe;z<=le;z++)L.push({index:z,size:re,offset:G,data:B&&B[z]}),G+=re}}if(!_)return Ws([],L,D,A,T,k);const Z=P.length>0?P[P.length-1]+1:0,O=BS(V,I,E,Z);if(O.length===0)return null;const W=D-1,q=iu([],Y=>{for(const N of O){const G=N.value;let J=G.offset,re=N.start;const fe=G.size;if(G.offset<I){re+=Math.floor((I-G.offset+A)/(fe+A));const z=re-N.start;J+=z*fe+z*A}re<Z&&(J+=(Z-re)*fe,re=Z);const le=Math.min(N.end,W);for(let z=re;z<=le&&!(J>=E);z++)Y.push({index:z,size:fe,offset:J,data:B&&B[z]}),J+=fe+A}});return Ws(q,L,D,A,T,k)}),pe(I=>I!==null),Ye()),Wu);se(U(n,pe(Kd),te(I=>I==null?void 0:I.length)),t),se(U(v,te(I=>I.topListHeight)),d),se(d,l),se(U(v,te(I=>[I.top,I.bottom])),s),se(U(v,te(I=>I.items)),b);const y=rn(U(v,pe(({items:I})=>I.length>0),ye(t,n),pe(([{items:I},E])=>I[I.length-1].originalIndex===E-1),te(([,I,E])=>[I-1,E]),Ye(fo),te(([I])=>I))),C=rn(U(v,Dr(200),pe(({items:I,topItems:E})=>I.length>0&&I[0].originalIndex===E.length),te(({items:I})=>I[0].index),Ye())),w=rn(U(v,pe(({items:I})=>I.length>0),te(({items:I})=>{let E=0,D=I.length-1;for(;I[E].type==="group"&&E<D;)E++;for(;I[D].type==="group"&&D>E;)D--;return{startIndex:I[E].index,endIndex:I[D].index}}),Ye(n1)));return{listState:v,topItemsIndexes:m,endReached:y,startReached:C,rangeChanged:w,itemsRendered:b,initialItemCount:p,...f}},Ue(Gn,t1,of,jo,No,Lo,Nr,tf),{singleton:!0}),JS=Te(([{sizes:e,firstItemIndex:t,data:n,gap:r},{initialTopMostItemIndex:i},{initialItemCount:a,listState:o},{didMount:s}])=>(se(U(s,ye(a),pe(([,l])=>l!==0),ye(i,e,t,r,n),te(([[,l],u,c,d,f,h=[]])=>r1(l,u,c,d,f,h))),o),{}),Ue(Gn,jo,Si,Nr),{singleton:!0}),i1=Te(([{scrollVelocity:e}])=>{const t=K(!1),n=Ee(),r=K(!1);return se(U(e,ye(r,t,n),pe(([i,a])=>!!a),te(([i,a,o,s])=>{const{exit:l,enter:u}=a;if(o){if(l(i,s))return!1}else if(u(i,s))return!0;return o}),Ye()),t),We(U(yt(t,e,n),ye(r)),([[i,a,o],s])=>i&&s&&s.change&&s.change(a,o)),{isSeeking:t,scrollSeekConfiguration:r,scrollVelocity:e,scrollSeekRangeChanged:n}},Ue(Lo),{singleton:!0}),KS=Te(([{topItemsIndexes:e}])=>{const t=K(0);return se(U(t,pe(n=>n>0),te(n=>Array.from({length:n}).map((r,i)=>i))),e),{topItemCount:t}},Ue(Si)),a1=Te(([{footerHeight:e,headerHeight:t,fixedHeaderHeight:n,fixedFooterHeight:r},{listState:i}])=>{const a=Ee(),o=At(U(yt(e,r,t,n,i),te(([s,l,u,c,d])=>s+l+u+c+d.offsetBottom+d.bottom)),0);return se(be(o),a),{totalListHeight:o,totalListHeightChanged:a}},Ue(Bt,Si),{singleton:!0});function o1(e){let t=!1,n;return()=>(t||(t=!0,n=e()),n)}const QS=o1(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),qS=Te(([{scrollBy:e,scrollTop:t,deviation:n,scrollingInProgress:r},{isScrolling:i,isAtBottom:a,scrollDirection:o,lastJumpDueToItemResize:s},{listState:l},{beforeUnshiftWith:u,shiftWithOffset:c,sizes:d,gap:f},{log:h},{recalcInProgress:g}])=>{const m=rn(U(l,ye(s),On(([,b,v,y],[{items:C,totalCount:w,bottom:I,offsetBottom:E},D])=>{const $=I+E;let F=0;return v===w&&b.length>0&&C.length>0&&(C[0].originalIndex===0&&b[0].originalIndex===0||(F=$-y,F!==0&&(F+=D))),[F,C,w,$]},[0,[],0,0]),pe(([b])=>b!==0),ye(t,o,r,a,h,g),pe(([,b,v,y,,,C])=>!C&&!y&&b!==0&&v===co),te(([[b],,,,,v])=>(v("Upward scrolling compensation",{amount:b},an.DEBUG),b))));function p(b){b>0?(ve(e,{top:-b,behavior:"auto"}),ve(n,0)):(ve(n,0),ve(e,{top:-b,behavior:"auto"}))}return We(U(m,ye(n,i)),([b,v,y])=>{y&&QS()?ve(n,v-b):p(-b)}),We(U(yt(At(i,!1),n,g),pe(([b,v,y])=>!b&&!y&&v!==0),te(([b,v])=>v),Dr(1)),p),se(U(c,te(b=>({top:-b}))),e),We(U(u,ye(d,f),te(([b,{lastSize:v,groupIndices:y,sizeTree:C},w])=>{function I(E){return E*(v+w)}if(y.length===0)return I(b);{let E=0;const D=lo(C,0);let $=0,F=0;for(;$<b;){$++,E+=D;let _=y.length===F+1?1/0:y[F+1]-y[F]-1;$+_>b&&(E-=D,_=b-$+1),$+=_,E+=I(_),F++}return E}})),b=>{ve(n,b),requestAnimationFrame(()=>{ve(e,{top:b}),requestAnimationFrame(()=>{ve(n,0),ve(g,!1)})})}),{deviation:n}},Ue(Bt,Lo,Si,Gn,Or,tf)),eI=Te(([{didMount:e},{scrollTo:t},{listState:n}])=>{const r=K(0);return We(U(e,ye(r),pe(([,i])=>i!==0),te(([,i])=>({top:i}))),i=>{Wn(U(n,oa(1),pe(a=>a.items.length>1)),()=>{requestAnimationFrame(()=>{ve(t,i)})})}),{initialScrollTop:r}},Ue(Nr,Bt,Si),{singleton:!0}),tI=Te(([{viewportHeight:e},{totalListHeight:t}])=>{const n=K(!1),r=At(U(yt(n,e,t),pe(([i])=>i),te(([,i,a])=>Math.max(0,i-a)),Dr(0),Ye()),0);return{alignToBottom:n,paddingTopAddition:r}},Ue(Bt,a1),{singleton:!0}),sf=Te(([{scrollTo:e,scrollContainerState:t}])=>{const n=Ee(),r=Ee(),i=Ee(),a=K(!1),o=K(void 0);return se(U(yt(n,r),te(([{viewportHeight:s,scrollTop:l,scrollHeight:u},{offsetTop:c}])=>({scrollTop:Math.max(0,l-c),scrollHeight:u,viewportHeight:s}))),t),se(U(e,ye(r),te(([s,{offsetTop:l}])=>({...s,top:s.top+l}))),i),{useWindowScroll:a,customScrollParent:o,windowScrollContainerState:n,windowViewportRect:r,windowScrollTo:i}},Ue(Bt)),nI=({itemTop:e,itemBottom:t,viewportTop:n,viewportBottom:r,locationParams:{behavior:i,align:a,...o}})=>e<n?{...o,behavior:i,align:a??"start"}:t>r?{...o,behavior:i,align:a??"end"}:null,rI=Te(([{sizes:e,totalCount:t,gap:n},{scrollTop:r,viewportHeight:i,headerHeight:a,fixedHeaderHeight:o,fixedFooterHeight:s,scrollingInProgress:l},{scrollToIndex:u}])=>{const c=Ee();return se(U(c,ye(e,i,t,a,o,s,r),ye(n),te(([[d,f,h,g,m,p,b,v],y])=>{const{done:C,behavior:w,align:I,calculateViewLocation:E=nI,...D}=d,$=Qb(d,f,g-1),F=uo($,f.offsetTree,y)+m+p,_=F+$n(f.sizeTree,$)[1],P=v+p,k=v+h-b,A=E({itemTop:F,itemBottom:_,viewportTop:P,viewportBottom:k,locationParams:{behavior:w,align:I,...D}});return A?C&&Wn(U(l,pe(B=>B===!1),oa(Rt(l)?1:2)),C):C&&C(),A}),pe(d=>d!==null)),u),{scrollIntoView:c}},Ue(Gn,Bt,No,Si,Or),{singleton:!0}),iI=Te(([{sizes:e,sizeRanges:t},{scrollTop:n},{initialTopMostItemIndex:r},{didMount:i},{useWindowScroll:a,windowScrollContainerState:o,windowViewportRect:s}])=>{const l=Ee(),u=K(void 0),c=K(null),d=K(null);return se(o,c),se(s,d),We(U(l,ye(e,n,a,c,d)),([f,h,g,m,p,b])=>{const v=NS(h.sizeTree);m&&p!==null&&b!==null&&(g=p.scrollTop-b.offsetTop),f({ranges:v,scrollTop:g})}),se(U(u,pe(Kd),te(aI)),r),se(U(i,ye(u),pe(([,f])=>f!==void 0),Ye(),te(([,f])=>f.ranges)),t),{getState:l,restoreStateFrom:u}},Ue(Gn,Bt,jo,Nr,sf));function aI(e){return{offset:e.scrollTop,index:0,align:"start"}}const oI=Te(([e,t,n,r,i,a,o,s,l,u])=>({...e,...t,...n,...r,...i,...a,...o,...s,...l,...u}),Ue(of,JS,Nr,i1,a1,eI,tI,sf,rI,Or)),s1=Te(([{totalCount:e,sizeRanges:t,fixedItemSize:n,defaultItemSize:r,trackItemSizes:i,itemSize:a,data:o,firstItemIndex:s,groupIndices:l,statefulTotalCount:u,gap:c,sizes:d},{initialTopMostItemIndex:f,scrolledToInitialItem:h,initialItemFinalLocationReached:g},m,p,b,{listState:v,topItemsIndexes:y,...C},{scrollToIndex:w},I,{topItemCount:E},{groupCounts:D},$])=>(se(C.rangeChanged,$.scrollSeekRangeChanged),se(U($.windowViewportRect,te(F=>F.visibleHeight)),m.viewportHeight),{totalCount:e,data:o,firstItemIndex:s,sizeRanges:t,initialTopMostItemIndex:f,scrolledToInitialItem:h,initialItemFinalLocationReached:g,topItemsIndexes:y,topItemCount:E,groupCounts:D,fixedItemHeight:n,defaultItemHeight:r,gap:c,...b,statefulTotalCount:u,listState:v,scrollToIndex:w,trackItemSizes:i,itemSize:a,groupIndices:l,...C,...$,...m,sizes:d,...p}),Ue(Gn,jo,Bt,iI,XS,Si,No,qS,KS,t1,oI)),zu="-webkit-sticky",Cg="sticky",l1=o1(()=>{if(typeof document>"u")return Cg;const e=document.createElement("div");return e.style.position=zu,e.style.position===zu?zu:Cg});function lf(e,t){const n=x.useRef(null),r=x.useCallback(s=>{if(s===null||!s.offsetParent)return;const l=s.getBoundingClientRect(),u=l.width;let c,d;if(t){const f=t.getBoundingClientRect(),h=l.top-f.top;c=f.height-Math.max(0,h),d=h+t.scrollTop}else c=window.innerHeight-Math.max(0,l.top),d=l.top+window.pageYOffset;n.current={offsetTop:d,visibleHeight:c,visibleWidth:u},e(n.current)},[e,t]),{callbackRef:i,ref:a}=ef(r),o=x.useCallback(()=>{r(a.current)},[r,a]);return x.useEffect(()=>{if(t){t.addEventListener("scroll",o);const s=new ResizeObserver(()=>{requestAnimationFrame(o)});return s.observe(t),()=>{t.removeEventListener("scroll",o),s.unobserve(t)}}else return window.addEventListener("scroll",o),window.addEventListener("resize",o),()=>{window.removeEventListener("scroll",o),window.removeEventListener("resize",o)}},[o,t]),i}const su=x.createContext(void 0),u1=x.createContext(void 0);function uf(e){return e}const sI=Te(()=>{const e=K(l=>`Item ${l}`),t=K(null),n=K(l=>`Group ${l}`),r=K({}),i=K(uf),a=K("div"),o=K(Di),s=(l,u=null)=>At(U(r,te(c=>c[l]),Ye()),u);return{context:t,itemContent:e,groupContent:n,components:r,computeItemKey:i,headerFooterTag:a,scrollerRef:o,FooterComponent:s("Footer"),HeaderComponent:s("Header"),TopItemListComponent:s("TopItemList"),ListComponent:s("List","div"),ItemComponent:s("Item","div"),GroupComponent:s("Group","div"),ScrollerComponent:s("Scroller","div"),EmptyPlaceholder:s("EmptyPlaceholder"),ScrollSeekPlaceholder:s("ScrollSeekPlaceholder")}}),lI=Te(([e,t])=>({...e,...t}),Ue(s1,sI)),uI=({height:e})=>x.createElement("div",{style:{height:e}}),cI={position:l1(),zIndex:1,overflowAnchor:"none"},dI={overflowAnchor:"none"},wg=x.memo(function({showTopList:t=!1}){const n=De("listState"),r=pn("sizeRanges"),i=De("useWindowScroll"),a=De("customScrollParent"),o=pn("windowScrollContainerState"),s=pn("scrollContainerState"),l=a||i?o:s,u=De("itemContent"),c=De("context"),d=De("groupContent"),f=De("trackItemSizes"),h=De("itemSize"),g=De("log"),m=pn("gap"),{callbackRef:p}=Wb(r,h,f,t?Di:l,g,m,a),[b,v]=x.useState(0);ff("deviation",A=>{b!==A&&v(A)});const y=De("EmptyPlaceholder"),C=De("ScrollSeekPlaceholder")||uI,w=De("ListComponent"),I=De("ItemComponent"),E=De("GroupComponent"),D=De("computeItemKey"),$=De("isSeeking"),F=De("groupIndices").length>0,_=De("alignToBottom"),P=De("initialItemFinalLocationReached"),k=t?{}:{boxSizing:"border-box",paddingTop:n.offsetTop,paddingBottom:n.offsetBottom,marginTop:b!==0?b:_?"auto":0,...P?{}:{visibility:"hidden"}};return!t&&n.totalCount===0&&y?x.createElement(y,it(y,c)):x.createElement(w,{...it(w,c),ref:p,style:k,"data-testid":t?"virtuoso-top-item-list":"virtuoso-item-list"},(t?n.topItems:n.items).map(A=>{const B=A.originalIndex,T=D(B+n.firstItemIndex,A.data,c);return $?x.createElement(C,{...it(C,c),key:T,index:A.index,height:A.size,type:A.type||"item",...A.type==="group"?{}:{groupIndex:A.groupIndex}}):A.type==="group"?x.createElement(E,{...it(E,c),key:T,"data-index":B,"data-known-size":A.size,"data-item-index":A.index,style:cI},d(A.index,c)):x.createElement(I,{...it(I,c),...c1(I,A.data),key:T,"data-index":B,"data-known-size":A.size,"data-item-index":A.index,"data-item-group-index":A.groupIndex,style:dI},F?u(A.index,A.groupIndex,A.data,c):u(A.index,A.data,c))}))}),fI={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},ma=e=>({width:"100%",height:"100%",position:"absolute",top:0,...e?{display:"flex",flexDirection:"column"}:{}}),hI={width:"100%",position:l1(),top:0,zIndex:1};function it(e,t){if(typeof e!="string")return{context:t}}function c1(e,t){return{item:typeof e=="string"?void 0:t}}const gI=x.memo(function(){const t=De("HeaderComponent"),n=pn("headerHeight"),r=De("headerFooterTag"),i=zn(o=>n(_n(o,"height"))),a=De("context");return t?x.createElement(r,{ref:i},x.createElement(t,it(t,a))):null}),mI=x.memo(function(){const t=De("FooterComponent"),n=pn("footerHeight"),r=De("headerFooterTag"),i=zn(o=>n(_n(o,"height"))),a=De("context");return t?x.createElement(r,{ref:i},x.createElement(t,it(t,a))):null});function cf({usePublisher:e,useEmitter:t,useEmitterValue:n}){return x.memo(function({style:a,children:o,...s}){const l=e("scrollContainerState"),u=n("ScrollerComponent"),c=e("smoothScrollTargetReached"),d=n("scrollerRef"),f=n("context"),{scrollerRef:h,scrollByCallback:g,scrollToCallback:m}=Gb(l,c,u,d);return t("scrollTo",m),t("scrollBy",g),x.createElement(u,{ref:h,style:{...fI,...a},"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,tabIndex:0,...s,...it(u,f)},o)})}function df({usePublisher:e,useEmitter:t,useEmitterValue:n}){return x.memo(function({style:a,children:o,...s}){const l=e("windowScrollContainerState"),u=n("ScrollerComponent"),c=e("smoothScrollTargetReached"),d=n("totalListHeight"),f=n("deviation"),h=n("customScrollParent"),g=n("context"),{scrollerRef:m,scrollByCallback:p,scrollToCallback:b}=Gb(l,c,u,Di,h);return SS(()=>(m.current=h||window,()=>{m.current=null}),[m,h]),t("windowScrollTo",b),t("scrollBy",p),x.createElement(u,{style:{position:"relative",...a,...d!==0?{height:d+f}:{}},"data-virtuoso-scroller":!0,...s,...it(u,g)},o)})}const pI=({children:e})=>{const t=x.useContext(su),n=pn("viewportHeight"),r=pn("fixedItemHeight"),i=De("alignToBottom"),a=zn(oo(n,o=>_n(o,"height")));return x.useEffect(()=>{t&&(n(t.viewportHeight),r(t.itemHeight))},[t,n,r]),x.createElement("div",{style:ma(i),ref:a,"data-viewport-type":"element"},e)},bI=({children:e})=>{const t=x.useContext(su),n=pn("windowViewportRect"),r=pn("fixedItemHeight"),i=De("customScrollParent"),a=lf(n,i),o=De("alignToBottom");return x.useEffect(()=>{t&&(r(t.itemHeight),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,r]),x.createElement("div",{ref:a,style:ma(o),"data-viewport-type":"window"},e)},vI=({children:e})=>{const t=De("TopItemListComponent")||"div",n=De("headerHeight"),r={...hI,marginTop:`${n}px`},i=De("context");return x.createElement(t,{style:r,...it(t,i)},e)},yI=x.memo(function(t){const n=De("useWindowScroll"),r=De("topItemsIndexes").length>0,i=De("customScrollParent"),a=i||n?wI:CI,o=i||n?bI:pI;return x.createElement(a,{...t},r&&x.createElement(vI,null,x.createElement(wg,{showTopList:!0})),x.createElement(o,null,x.createElement(gI,null),x.createElement(wg,null),x.createElement(mI,null)))}),{Component:xI,usePublisher:pn,useEmitterValue:De,useEmitter:ff}=qd(lI,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},yI),CI=cf({usePublisher:pn,useEmitterValue:De,useEmitter:ff}),wI=df({usePublisher:pn,useEmitterValue:De,useEmitter:ff}),DI=xI,Dg={items:[],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},SI={items:[{index:0}],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},{round:Sg,ceil:Ig,floor:xl,min:Gu,max:Za}=Math;function II(e){return{...SI,items:e}}function Eg(e,t,n){return Array.from({length:t-e+1}).map((r,i)=>{const a=n===null?null:n[i+e];return{index:i+e,data:a}})}function EI(e,t){return e&&e.column===t.column&&e.row===t.row}function ss(e,t){return e&&e.width===t.width&&e.height===t.height}const _I=Te(([{overscan:e,visibleRange:t,listBoundary:n},{scrollTop:r,viewportHeight:i,scrollBy:a,scrollTo:o,smoothScrollTargetReached:s,scrollContainerState:l,footerHeight:u,headerHeight:c},d,f,{propsReady:h,didMount:g},{windowViewportRect:m,useWindowScroll:p,customScrollParent:b,windowScrollContainerState:v,windowScrollTo:y},C])=>{const w=K(0),I=K(0),E=K(Dg),D=K({height:0,width:0}),$=K({height:0,width:0}),F=Ee(),_=Ee(),P=K(0),k=K(null),A=K({row:0,column:0}),B=Ee(),T=Ee(),R=K(!1),V=K(0),H=K(!0),L=K(!1);We(U(g,ye(V),pe(([N,G])=>!!G)),()=>{ve(H,!1),ve(I,0)}),We(U(yt(g,H,$,D,V,L),pe(([N,G,J,re,,fe])=>N&&!G&&J.height!==0&&re.height!==0&&!fe)),([,,,,N])=>{ve(L,!0),rf(1,()=>{ve(F,N)}),Wn(U(r),()=>{ve(n,[0,0]),ve(H,!0)})}),se(U(T,pe(N=>N!=null&&N.scrollTop>0),Bn(0)),I),We(U(g,ye(T),pe(([,N])=>N!=null)),([,N])=>{N&&(ve(D,N.viewport),ve($,N==null?void 0:N.item),ve(A,N.gap),N.scrollTop>0&&(ve(R,!0),Wn(U(r,oa(1)),G=>{ve(R,!1)}),ve(o,{top:N.scrollTop})))}),se(U(D,te(({height:N})=>N)),i),se(U(yt(be(D,ss),be($,ss),be(A,(N,G)=>N&&N.column===G.column&&N.row===G.row),be(r)),te(([N,G,J,re])=>({viewport:N,item:G,gap:J,scrollTop:re}))),B),se(U(yt(be(w),t,be(A,EI),be($,ss),be(D,ss),be(k),be(I),be(R),be(H),be(V)),pe(([,,,,,,,N])=>!N),te(([N,[G,J],re,fe,le,z,Ae,,ke,Xe])=>{const{row:et,column:ee}=re,{height:ne,width:he}=fe,{width:Oe}=le;if(Ae===0&&(N===0||Oe===0))return Dg;if(he===0){const $i=af(Xe,N),va=$i===0?Math.max(Ae-1,0):$i;return II(Eg($i,va,z))}const ut=d1(Oe,he,ee);let Se,xe;ke?G===0&&J===0&&Ae>0?(Se=0,xe=Ae-1):(Se=ut*xl((G+et)/(ne+et)),xe=ut*Ig((J+et)/(ne+et))-1,xe=Gu(N-1,Za(xe,ut-1)),Se=Gu(xe,Za(0,Se))):(Se=0,xe=-1);const Vt=Eg(Se,xe,z),{top:Ot,bottom:Nt}=_g(le,re,fe,Vt),un=Ig(N/ut),Qo=un*ne+(un-1)*et-Nt;return{items:Vt,offsetTop:Ot,offsetBottom:Qo,top:Ot,bottom:Nt,itemHeight:ne,itemWidth:he}})),E),se(U(k,pe(N=>N!==null),te(N=>N.length)),w),se(U(yt(D,$,E,A),pe(([N,G,{items:J}])=>J.length>0&&G.height!==0&&N.height!==0),te(([N,G,{items:J},re])=>{const{top:fe,bottom:le}=_g(N,re,G,J);return[fe,le]}),Ye(fo)),n);const Z=K(!1);se(U(r,ye(Z),te(([N,G])=>G||N!==0)),Z);const O=rn(U(be(E),pe(({items:N})=>N.length>0),ye(w,Z),pe(([{items:N},G,J])=>J&&N[N.length-1].index===G-1),te(([,N])=>N-1),Ye())),W=rn(U(be(E),pe(({items:N})=>N.length>0&&N[0].index===0),Bn(0),Ye())),q=rn(U(be(E),ye(R),pe(([{items:N},G])=>N.length>0&&!G),te(([{items:N}])=>({startIndex:N[0].index,endIndex:N[N.length-1].index})),Ye(n1),Dr(0)));se(q,f.scrollSeekRangeChanged),se(U(F,ye(D,$,w,A),te(([N,G,J,re,fe])=>{const le=e1(N),{align:z,behavior:Ae,offset:ke}=le;let Xe=le.index;Xe==="LAST"&&(Xe=re-1),Xe=Za(0,Xe,Gu(re-1,Xe));let et=zc(G,fe,J,Xe);return z==="end"?et=Sg(et-G.height+J.height):z==="center"&&(et=Sg(et-G.height/2+J.height/2)),ke&&(et+=ke),{top:et,behavior:Ae}})),o);const Y=At(U(E,te(N=>N.offsetBottom+N.bottom)),0);return se(U(m,te(N=>({width:N.visibleWidth,height:N.visibleHeight}))),D),{data:k,totalCount:w,viewportDimensions:D,itemDimensions:$,scrollTop:r,scrollHeight:_,overscan:e,scrollBy:a,scrollTo:o,scrollToIndex:F,smoothScrollTargetReached:s,windowViewportRect:m,windowScrollTo:y,useWindowScroll:p,customScrollParent:b,windowScrollContainerState:v,deviation:P,scrollContainerState:l,footerHeight:u,headerHeight:c,initialItemCount:I,gap:A,restoreStateFrom:T,...f,initialTopMostItemIndex:V,gridState:E,totalListHeight:Y,...d,startReached:W,endReached:O,rangeChanged:q,stateChanged:B,propsReady:h,stateRestoreInProgress:R,...C}},Ue(of,Bt,Lo,i1,Nr,sf,Or));function _g(e,t,n,r){const{height:i}=n;if(i===void 0||r.length===0)return{top:0,bottom:0};const a=zc(e,t,n,r[0].index),o=zc(e,t,n,r[r.length-1].index)+i;return{top:a,bottom:o}}function zc(e,t,n,r){const i=d1(e.width,n.width,t.column),a=xl(r/i),o=a*n.height+Za(0,a-1)*t.row;return o>0?o+t.row:o}function d1(e,t,n){return Za(1,xl((e+n)/(xl(t)+n)))}const $I=Te(()=>{const e=K(u=>`Item ${u}`),t=K({}),n=K(null),r=K("virtuoso-grid-item"),i=K("virtuoso-grid-list"),a=K(uf),o=K("div"),s=K(Di),l=(u,c=null)=>At(U(t,te(d=>d[u]),Ye()),c);return{context:n,itemContent:e,components:t,computeItemKey:a,itemClassName:r,listClassName:i,headerFooterTag:o,scrollerRef:s,FooterComponent:l("Footer"),HeaderComponent:l("Header"),ListComponent:l("List","div"),ItemComponent:l("Item","div"),ScrollerComponent:l("Scroller","div"),ScrollSeekPlaceholder:l("ScrollSeekPlaceholder","div")}}),RI=Te(([e,t])=>({...e,...t}),Ue(_I,$I)),AI=x.memo(function(){const t=nt("gridState"),n=nt("listClassName"),r=nt("itemClassName"),i=nt("itemContent"),a=nt("computeItemKey"),o=nt("isSeeking"),s=In("scrollHeight"),l=nt("ItemComponent"),u=nt("ListComponent"),c=nt("ScrollSeekPlaceholder"),d=nt("context"),f=In("itemDimensions"),h=In("gap"),g=nt("log"),m=nt("stateRestoreInProgress"),p=zn(b=>{const v=b.parentElement.parentElement.scrollHeight;s(v);const y=b.firstChild;if(y){const{width:C,height:w}=y.getBoundingClientRect();f({width:C,height:w})}h({row:$g("row-gap",getComputedStyle(b).rowGap,g),column:$g("column-gap",getComputedStyle(b).columnGap,g)})});return m?null:x.createElement(u,{ref:p,className:n,...it(u,d),style:{paddingTop:t.offsetTop,paddingBottom:t.offsetBottom},"data-testid":"virtuoso-item-list"},t.items.map(b=>{const v=a(b.index,b.data,d);return o?x.createElement(c,{key:v,...it(c,d),index:b.index,height:t.itemHeight,width:t.itemWidth}):x.createElement(l,{...it(l,d),className:r,"data-index":b.index,key:v},i(b.index,b.data,d))}))}),FI=x.memo(function(){const t=nt("HeaderComponent"),n=In("headerHeight"),r=nt("headerFooterTag"),i=zn(o=>n(_n(o,"height"))),a=nt("context");return t?x.createElement(r,{ref:i},x.createElement(t,it(t,a))):null}),PI=x.memo(function(){const t=nt("FooterComponent"),n=In("footerHeight"),r=nt("headerFooterTag"),i=zn(o=>n(_n(o,"height"))),a=nt("context");return t?x.createElement(r,{ref:i},x.createElement(t,it(t,a))):null}),TI=({children:e})=>{const t=x.useContext(u1),n=In("itemDimensions"),r=In("viewportDimensions"),i=zn(a=>{r(a.getBoundingClientRect())});return x.useEffect(()=>{t&&(r({height:t.viewportHeight,width:t.viewportWidth}),n({height:t.itemHeight,width:t.itemWidth}))},[t,r,n]),x.createElement("div",{style:ma(!1),ref:i},e)},kI=({children:e})=>{const t=x.useContext(u1),n=In("windowViewportRect"),r=In("itemDimensions"),i=nt("customScrollParent"),a=lf(n,i);return x.useEffect(()=>{t&&(r({height:t.itemHeight,width:t.itemWidth}),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,n,r]),x.createElement("div",{ref:a,style:ma(!1)},e)},MI=x.memo(function({...t}){const n=nt("useWindowScroll"),r=nt("customScrollParent"),i=r||n?VI:BI,a=r||n?kI:TI;return x.createElement(i,{...t},x.createElement(a,null,x.createElement(FI,null),x.createElement(AI,null),x.createElement(PI,null)))}),{Component:oB,usePublisher:In,useEmitterValue:nt,useEmitter:f1}=qd(RI,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged"}},MI),BI=cf({usePublisher:In,useEmitterValue:nt,useEmitter:f1}),VI=df({usePublisher:In,useEmitterValue:nt,useEmitter:f1});function $g(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,an.WARN),t==="normal"?0:parseInt(t??"0",10)}const OI=Te(()=>{const e=K(l=>x.createElement("td",null,"Item $",l)),t=K(null),n=K(null),r=K(null),i=K({}),a=K(uf),o=K(Di),s=(l,u=null)=>At(U(i,te(c=>c[l]),Ye()),u);return{context:t,itemContent:e,fixedHeaderContent:n,fixedFooterContent:r,components:i,computeItemKey:a,scrollerRef:o,TableComponent:s("Table","table"),TableHeadComponent:s("TableHead","thead"),TableFooterComponent:s("TableFoot","tfoot"),TableBodyComponent:s("TableBody","tbody"),TableRowComponent:s("TableRow","tr"),ScrollerComponent:s("Scroller","div"),EmptyPlaceholder:s("EmptyPlaceholder"),ScrollSeekPlaceholder:s("ScrollSeekPlaceholder"),FillerRow:s("FillerRow")}}),NI=Te(([e,t])=>({...e,...t}),Ue(s1,OI)),LI=({height:e})=>x.createElement("tr",null,x.createElement("td",{style:{height:e}})),jI=({height:e})=>x.createElement("tr",null,x.createElement("td",{style:{height:e,padding:0,border:0}})),HI={overflowAnchor:"none"},WI=x.memo(function(){const t=Le("listState"),n=En("sizeRanges"),r=Le("useWindowScroll"),i=Le("customScrollParent"),a=En("windowScrollContainerState"),o=En("scrollContainerState"),s=i||r?a:o,l=Le("itemContent"),u=Le("trackItemSizes"),c=Le("itemSize"),d=Le("log"),{callbackRef:f,ref:h}=Wb(n,c,u,s,d,void 0,i),[g,m]=x.useState(0);hf("deviation",T=>{g!==T&&(h.current.style.marginTop=`${T}px`,m(T))});const p=Le("EmptyPlaceholder"),b=Le("ScrollSeekPlaceholder")||LI,v=Le("FillerRow")||jI,y=Le("TableBodyComponent"),C=Le("TableRowComponent"),w=Le("computeItemKey"),I=Le("isSeeking"),E=Le("paddingTopAddition"),D=Le("firstItemIndex"),$=Le("statefulTotalCount"),F=Le("context");if($===0&&p)return x.createElement(p,it(p,F));const _=t.offsetTop+E+g,P=t.offsetBottom,k=_>0?x.createElement(v,{height:_,key:"padding-top",context:F}):null,A=P>0?x.createElement(v,{height:P,key:"padding-bottom",context:F}):null,B=t.items.map(T=>{const R=T.originalIndex,V=w(R+D,T.data,F);return I?x.createElement(b,{...it(b,F),key:V,index:T.index,height:T.size,type:T.type||"item"}):x.createElement(C,{...it(C,F),...c1(C,T.data),key:V,"data-index":R,"data-known-size":T.size,"data-item-index":T.index,style:HI},l(T.index,T.data,F))});return x.createElement(y,{ref:f,"data-testid":"virtuoso-item-list",...it(y,F)},[k,...B,A])}),zI=({children:e})=>{const t=x.useContext(su),n=En("viewportHeight"),r=En("fixedItemHeight"),i=zn(oo(n,a=>_n(a,"height")));return x.useEffect(()=>{t&&(n(t.viewportHeight),r(t.itemHeight))},[t,n,r]),x.createElement("div",{style:ma(!1),ref:i,"data-viewport-type":"element"},e)},GI=({children:e})=>{const t=x.useContext(su),n=En("windowViewportRect"),r=En("fixedItemHeight"),i=Le("customScrollParent"),a=lf(n,i);return x.useEffect(()=>{t&&(r(t.itemHeight),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,r]),x.createElement("div",{ref:a,style:ma(!1),"data-viewport-type":"window"},e)},ZI=x.memo(function(t){const n=Le("useWindowScroll"),r=Le("customScrollParent"),i=En("fixedHeaderHeight"),a=En("fixedFooterHeight"),o=Le("fixedHeaderContent"),s=Le("fixedFooterContent"),l=Le("context"),u=zn(oo(i,v=>_n(v,"height"))),c=zn(oo(a,v=>_n(v,"height"))),d=r||n?UI:YI,f=r||n?GI:zI,h=Le("TableComponent"),g=Le("TableHeadComponent"),m=Le("TableFooterComponent"),p=o?x.createElement(g,{key:"TableHead",style:{zIndex:2,position:"sticky",top:0},ref:u,...it(g,l)},o()):null,b=s?x.createElement(m,{key:"TableFoot",style:{zIndex:1,position:"sticky",bottom:0},ref:c,...it(m,l)},s()):null;return x.createElement(d,{...t},x.createElement(f,null,x.createElement(h,{style:{borderSpacing:0,overflowAnchor:"none"},...it(h,l)},[p,x.createElement(WI,{key:"TableBody"}),b])))}),{Component:XI,usePublisher:En,useEmitterValue:Le,useEmitter:hf}=qd(NI,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",firstItemIndex:"firstItemIndex",itemContent:"itemContent",fixedHeaderContent:"fixedHeaderContent",fixedFooterContent:"fixedFooterContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",topItemCount:"topItemCount",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",groupCounts:"groupCounts",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},ZI),YI=cf({usePublisher:En,useEmitterValue:Le,useEmitter:hf}),UI=df({usePublisher:En,useEmitterValue:Le,useEmitter:hf}),JI=XI,KI=({children:e,...t})=>S.jsx(S.Fragment,{children:e(t)}),QI=({children:e,...t})=>S.jsx(S.Fragment,{children:x.isValidElement(e)&&S.jsx(S.Fragment,{children:x.cloneElement(e,t)})}),gf=x.forwardRef((e,t)=>{const{classNameContainer:n="",computeItemKey:r=()=>"",itemSize:i=()=>0,totalCount:a=0,typeHight:o="min-max",minHeightItem:s=0,maxHeightTable:l=0,minLengthItem:u=0,fixedHeaderContent:c,itemContent:d,typeCalculateItemSize:f="manual",itemSizeNames:h=[],overscan:g=null,component:m={},idContainer:p="",triggerCalCulateContainer:b="",accumulationHeight:v=0,delayTriggerCalculateHeight:y=0,increaseViewportBy:C=()=>0,context:w={},endReached:I}=e,[E,D]=x.useState(0),$=()=>{if(o==="min-max"){const P=(a+1)*s;return{height:a>u?l:E>P?E:P}}return o==="container"?{height:E}:{}},F=P=>{var B;const k=P.getAttribute("data-index");let A=((B=P.getBoundingClientRect())==null?void 0:B.height)||0;return h==null||h.forEach(T=>{var R,V;A+=((V=(R=document.querySelector(`[${T}="${k}"]`))==null?void 0:R.getBoundingClientRect())==null?void 0:V.height)??0}),A},_=()=>{var P;if(p&&o==="container"){const k=((P=document==null?void 0:document.getElementById(p))==null?void 0:P.offsetHeight)??0;D(k-v)}};return x.useEffect(()=>{const P=setTimeout(_,y);return window==null||window.addEventListener("resize",_),window==null||window.addEventListener("load",_),()=>{clearTimeout(P),window==null||window.removeEventListener("resize",_),window==null||window.removeEventListener("load",_)}},[o,b]),S.jsx("div",{className:`1ru-w-full ${n}`,children:S.jsx(JI,{context:w,ref:t,overscan:typeof g=="function"?g(o==="container"?E:l):o==="container"?E:l,totalListHeightChanged:P=>o==="min-max"?D(P):null,style:$(),totalCount:a,computeItemKey:r,itemSize:x.useCallback(P=>f==="manual"?i(P):F(P),[]),components:{TableRow:QI,...m},fixedHeaderContent:c,itemContent:(...P)=>d(KI,...P),endReached:I,increaseViewportBy:C(o==="container"?E:l)})})});gf.displayName="TableVirtualization";const qI="_sorting_1i6eh_39",qn={"container-table":"_container-table_1i6eh_1","payhere-reguler":"_payhere-reguler_1i6eh_1","laba-small":"_laba-small_1i6eh_1","laba-reguler":"_laba-reguler_1i6eh_1","table-root":"_table-root_1i6eh_5","table-scroll-top":"_table-scroll-top_1i6eh_9","pointer-laba":"_pointer-laba_1i6eh_16","pointer-payhere":"_pointer-payhere_1i6eh_20",sorting:qI,"laba-grey-02":"_laba-grey-02_1i6eh_53"},ki="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M10.6673%2011.3333L8.00065%2014M8.00065%2014L5.33398%2011.3333M8.00065%2014V2'%20stroke='%23CFD8DC'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e";function eE(e,t=null){const[n,r]=x.useState(!1);return x.useEffect(()=>{let i=null,a=null;const o=()=>{const s=i instanceof HTMLElement?i.getBoundingClientRect().width:window.innerWidth,l=window.matchMedia(e.replace("WIDTH",s.toString()));r(l.matches)};if(t){if(i=document.getElementById(t),!i)return;a=new ResizeObserver(o),a.observe(i)}else i=window,window.addEventListener("resize",o);return o(),()=>{a?a.disconnect():window.removeEventListener("resize",o)}},[e,t]),n}const tE=e=>{const t=f=>{const h=new Date,g=f.getTime()-h.getTime();return Math.max(Math.floor(g/1e3),0)},n=new Date(new Date(e.date).setHours(new Date(e.date).getHours()-((e==null?void 0:e.adjustTimesTime)??0))),[r,i]=x.useState(t(n)),[a,o]=x.useState(e.running??!1),[s,l]=x.useState(()=>e==null?void 0:e.callbackDone);return x.useEffect(()=>{let f;return a&&r>0?f=setInterval(()=>{i(h=>Math.max(h-1,0))},e.intervalMs):a&&r===0&&typeof s=="function"&&s(),()=>{f&&clearInterval(f)}},[a,r,e.intervalMs,s]),{count:r,startCountdown:()=>{o(!0)},stopCountdown:()=>{o(!1)},resetCountdown:f=>{i(typeof f=="number"?f:t(f??n))},setCallbackDone:f=>l(()=>f)}};function nE(e,t=0){const n=x.useRef({promise:null,resolve:null,reject:null,timeout:null});return x.useCallback((...i)=>(n.current.timeout&&clearTimeout(n.current.timeout),n.current.promise||(n.current.promise=new Promise((a,o)=>{n.current.resolve=a,n.current.reject=o})),n.current.timeout=setTimeout(()=>{e(...i).then(a=>{n.current.resolve&&n.current.resolve(a)}).catch(a=>{n.current.reject&&n.current.reject(a)}).finally(()=>{n.current.promise=null,n.current.resolve=null,n.current.reject=null,n.current.timeout=null})},t),n.current.promise),[e,t])}const mf=typeof window<"u"?x.useLayoutEffect:x.useEffect,rE=(e,t)=>{const[n,r]=x.useState({width:0,height:0}),[i,a]=x.useState({width:0,height:0,top:0,left:0,bottom:0,right:0,x:0,y:0}),o=x.useRef(null);return mf(()=>{const s=()=>{r({width:window.innerWidth,height:window.innerHeight})},l=d=>{for(const f of d){const{width:h,height:g,top:m,left:p,bottom:b,right:v,x:y,y:C}=f.contentRect;a({width:h,height:g,top:m,left:p,bottom:b,right:v,x:y,y:C})}};let u=null;t?u=document.querySelector(t):o.current&&(u=o.current);const c=new ResizeObserver(l);return u&&c.observe(u),window.addEventListener("resize",s),s(),()=>{u&&c.unobserve(u),window.removeEventListener("resize",s)}},[t,...e??[]]),{ref:o,windowSize:n,contentRect:i}};function iE(e){const[t,n]=x.useState(e),r=x.useRef(t);return x.useEffect(()=>{r.current=t},[t]),[t,n,r]}function aE(e,t){if(e!=null){if(typeof e=="function"){e(t);return}try{e.current=t}catch{throw new Error(`Cannot assign value '${JSON.stringify(t)}' to ref '${JSON.stringify(e)}'`)}}}function oE(...e){return t=>{e.forEach(n=>{aE(n,t)})}}function pf(...e){return x.useMemo(()=>oE(...e),e)}function bf(e){const t=x.useRef(e);return Od(e,t.current)||(t.current=e),t.current}function Ho(e,t){const n=t.map(bf);x.useEffect(e,n)}function sE({ref:e,handlerMain:t,eventListener:n="mousedown",useEffectDependency:r=[]}){x.useEffect(()=>{function i(a){t(e,a)}return document.addEventListener(n,i),()=>{document.removeEventListener(n,i)}},[e,t,n,...r])}const lE=(e,t)=>{var r,i;let n={};return e?n={position:"sticky",top:0,zIndex:2}:(r=t.column.columnDef.meta)!=null&&r.styleTh&&(n={...n,...(i=t.column.columnDef.meta)==null?void 0:i.styleTh(t.column.columnDef)}),n},Jt=()=>({kind:{"payhere-reguler":qn["payhere-reguler"],"laba-reguler":qn["laba-reguler"],"laba-small":qn["laba-small"]},pointer:{"payhere-reguler":qn["pointer-payhere"],"laba-reguler":qn["pointer-laba"],"laba-small":qn["pointer-laba"]},utility:{"table-scroll-top":""},sortingIcon:{"payhere-reguler":{asc:S.jsx("img",{src:ki,className:"1ru-w-4 1ru-h-4"}),desc:S.jsx("img",{src:ki,className:"1ru-w-4 1ru-h-4 1ru-rotate-180"})},"laba-reguler":{asc:S.jsx("img",{src:ki,className:"1ru-w-4 1ru-h-4"}),desc:S.jsx("img",{src:ki,className:"1ru-w-4 1ru-h-4 1ru-rotate-180"})},"laba-small":{asc:S.jsx("img",{src:ki,className:"1ru-w-4 1ru-h-4"}),desc:S.jsx("img",{src:ki,className:"1ru-w-4 1ru-h-4 1ru-rotate-180"})}},variant:{"laba-grey-02":qn["laba-grey-02"]}}),uE=({tableInstance:e,classNameWrapperTable:t,classNameTable:n,handlerRowClick:r,privillageRowClick:i,headerId:a,tbodyTrId:o,maxHeight:s,idCalculateHeight:l,componentSortASC:u,componentSortDESC:c,classNamePointer:d,emptyPlaceholder:f,renderSubComponent:h})=>S.jsx("div",{id:"1ru-table",style:s?{height:s,overflow:"auto"}:{},className:t??"",children:S.jsxs("table",{className:n,children:[S.jsx("thead",{id:a,children:e.getHeaderGroups().map(g=>S.jsx("tr",{children:g.headers.map(m=>S.jsx("th",{style:lE(s,m),colSpan:m.colSpan,children:m.isPlaceholder?null:S.jsxs("div",{className:m.column.getCanSort()?qn.sorting:"",onClick:m.column.getToggleSortingHandler(),children:[ao(m.column.columnDef.header,m.getContext()),m.column.getCanSort()&&S.jsx("span",{className:"1ru-flex-shrink-0",children:m.column.getIsSorted()==="asc"||m.column.getIsSorted()==="desc"?S.jsxs(S.Fragment,{children:[m.column.getIsSorted()==="asc"&&S.jsx(S.Fragment,{children:u}),m.column.getIsSorted()==="desc"&&S.jsx(S.Fragment,{children:c})]}):S.jsx(S.Fragment,{})})]})},m.id))},g.id))}),S.jsxs("tbody",{children:[e.getRowModel().rows.length>0&&e.getRowModel().rows.map((g,m)=>S.jsxs(x.Fragment,{children:[S.jsx("tr",{onClick:p=>{p.stopPropagation(),i&&typeof r=="function"&&r(g.original,g)},className:i?d:"","data-calculate-height":`${l}-${m}`,id:o(g),children:g.getVisibleCells().map(p=>{var b,v,y;return S.jsx("td",{style:typeof((b=p.column.columnDef.meta)==null?void 0:b.styleTd)=="function"?p.column.columnDef.meta.styleTd(g.original,g):{},className:typeof((v=p.column.columnDef.meta)==null?void 0:v.classNameTd)=="function"?(y=p.column.columnDef.meta)==null?void 0:y.classNameTd(g.original,g):"",children:ao(p.column.columnDef.cell,p.getContext())},p.id)})}),g.getIsExpanded()&&typeof h=="function"&&S.jsx("tr",{children:S.jsx("td",{colSpan:g.getVisibleCells().length,children:h(g.original,g)})})]},g.id)),e.getRowModel().rows.length===0&&x.isValidElement(f)&&S.jsx("tr",{children:S.jsx("td",{colSpan:e.getVisibleFlatColumns().length,children:f})})]})]})}),h1=x.forwardRef((e,t)=>{const{context:n,...r}=e;return S.jsx("thead",{id:(n==null?void 0:n.headerId)??"",...r,ref:t})});h1.displayName="VirtualizationHead";const cE=({style:e,context:t,...n})=>S.jsx("table",{...n,id:"1ru-table",className:(t==null?void 0:t.classNameTable)??"",style:e}),dE=({tableInstance:e,classNameWrapperTable:t,handlerRowClick:n,privillageRowClick:r,virtualizationProps:i,headerId:a,tbodyTrId:o,classNameTable:s,componentSortASC:l,componentSortDESC:u,classNamePointer:c,emptyPlaceholder:d,renderSubComponent:f})=>{var m,p,b;const[h,g]=x.useState(0);return S.jsx(gf,{context:{headerId:a,classNameTable:s},typeHight:"min-max",totalCount:((m=e.getRowModel().rows)==null?void 0:m.length)||0,minLengthItem:((p=e.getRowModel().rows)==null?void 0:p.length)||0,typeCalculateItemSize:"auto",component:{TableHead:h1,Table:cE,EmptyPlaceholder:()=>S.jsx("tbody",{ref:v=>{var y;return g(((y=v==null?void 0:v.getBoundingClientRect())==null?void 0:y.height)??0)},children:S.jsx("tr",{children:S.jsx("td",{colSpan:e.getVisibleFlatColumns().length,children:x.isValidElement(d)&&d})})})},classNameContainer:t,fixedHeaderContent:()=>e.getHeaderGroups().map(v=>S.jsx("tr",{children:v.headers.map(y=>{var C,w;return S.jsx("th",{colSpan:y.colSpan,style:typeof((C=y.column.columnDef.meta)==null?void 0:C.styleTh)=="function"?(w=y.column.columnDef.meta)==null?void 0:w.styleTh(y.column.columnDef):{},children:y.isPlaceholder?null:S.jsxs("div",{className:y.column.getCanSort()?qn.sorting:"",onClick:y.column.getToggleSortingHandler(),children:[ao(y.column.columnDef.header,y.getContext()),y.column.getCanSort()&&S.jsx("span",{className:"1ru-flex-shrink-0",children:y.column.getIsSorted()==="asc"||y.column.getIsSorted()==="desc"?S.jsxs(S.Fragment,{children:[y.column.getIsSorted()==="asc"&&S.jsx(S.Fragment,{children:l}),y.column.getIsSorted()==="desc"&&S.jsx(S.Fragment,{children:u})]}):S.jsx(S.Fragment,{})})]})},y.id)})},v.id)),itemContent:(v,y)=>{var w,I;const C=(I=(w=e.getRowModel())==null?void 0:w.rows)==null?void 0:I[y];return S.jsx(v,{children:({...E})=>S.jsxs(x.Fragment,{children:[S.jsx("tr",{...E,onClick:D=>{D.stopPropagation(),r&&typeof n=="function"&&n(C.original,C)},className:r?c:"",id:o(C),children:C.getVisibleCells().map(D=>{var $,F,_;return S.jsx(S.Fragment,{children:S.jsx("td",{style:typeof(($=D.column.columnDef.meta)==null?void 0:$.styleTd)=="function"?D.column.columnDef.meta.styleTd(C.original,C):{},className:typeof((F=D.column.columnDef.meta)==null?void 0:F.classNameTd)=="function"?(_=D.column.columnDef.meta)==null?void 0:_.classNameTd(C.original,C):"",children:ao(D.column.columnDef.cell,D.getContext())},D.id)})})}),C.getIsExpanded()&&typeof f=="function"&&S.jsx("tr",{"data-sub-component":y,children:S.jsx("td",{colSpan:C.getVisibleCells().length,children:f(C.original,C)})})]},C.id)},C.id)},...i,minHeightItem:((i==null?void 0:i.minHeightItem)??60)+((((b=e.getRowModel().rows)==null?void 0:b.length)||0)>0?0:h),itemSizeNames:typeof f=="function"?[...(i==null?void 0:i.itemSizeNames)??[],"data-sub-component"]:i==null?void 0:i.itemSizeNames})},fE=({tableInstance:e,classNameWrapperTable:t="",classNameTable:n="",collapseAll:r=!0,handlerRowClick:i,privillageRowClick:a=!1,virtualization:o=!1,virtualizationProps:s,headerId:l="",tbodyTrId:u=()=>"",maxHeight:c=0,idCalculateHeight:d=void 0,kind:f="laba-reguler",componentSortASC:h,componentSortDESC:g,scrollTop:m=!1,emptyPlaceholder:p,variant:b,renderSubComponent:v})=>{const y=()=>{if(![void 0,"undefined"].includes(d)){let C=0;const w=document.querySelectorAll(`[data-calculate-height^="${d}-"]`);return w==null||w.forEach(I=>{C+=I.offsetHeight}),C>c?c:C}return c};return Ho(()=>{!r&&typeof e.toggleAllRowsExpanded=="function"&&e.toggleAllRowsExpanded()},[r,e==null?void 0:e.toggleAllRowsExpanded]),S.jsxs(S.Fragment,{children:[!o&&S.jsx(uE,{tbodyTrId:u,headerId:l,tableInstance:e,classNameTable:n,classNameWrapperTable:`${Jt().kind[f]} ${b?Jt().variant[b]:""}
|
74
74
|
${m?Jt().utility["table-scroll-top"]:""} ${t}`,handlerRowClick:i,privillageRowClick:a,maxHeight:y(),idCalculateHeight:d,componentSortASC:x.isValidElement(h)?h:Jt().sortingIcon[f].asc,componentSortDESC:x.isValidElement(g)?g:Jt().sortingIcon[f].desc,classNamePointer:Jt().pointer[f],emptyPlaceholder:p,renderSubComponent:v}),o&&S.jsx(dE,{tbodyTrId:u,headerId:l,tableInstance:e,classNameTable:n,classNameWrapperTable:`${Jt().kind[f]} ${b?Jt().variant[b]:""}
|
75
75
|
${m?Jt().utility["table-scroll-top"]:""} ${t}`,handlerRowClick:i,privillageRowClick:a,virtualizationProps:s,componentSortASC:x.isValidElement(h)?h:Jt().sortingIcon[f].asc,componentSortDESC:x.isValidElement(g)?g:Jt().sortingIcon[f].desc,classNamePointer:Jt().pointer[f],emptyPlaceholder:p,renderSubComponent:v})]})},hE=({children:e,...t})=>S.jsx(S.Fragment,{children:e(t)}),gE=({children:e,...t})=>S.jsx(S.Fragment,{children:x.isValidElement(e)&&S.jsx(S.Fragment,{children:x.cloneElement(e,t)})}),g1=x.forwardRef((e,t)=>{const{classNameContainer:n="",computeItemKey:r=()=>"",itemSize:i=()=>0,totalCount:a=0,typeHight:o="min-max",minHeightItem:s=0,maxHeightTable:l=0,minLengthItem:u=0,itemContent:c,typeCalculateItemSize:d="manual",itemSizeNames:f=[],overscan:h=null,component:g={},idContainer:m="",triggerCalCulateContainer:p="",accumulationHeight:b=0,delayTriggerCalculateHeight:v=0,increaseViewportBy:y=()=>0,context:C={},endReached:w}=e,[I,E]=x.useState(0),D=()=>{if(o==="min-max"){const _=(a+1)*s;return{height:a>u?l:I>_?I:_}}return o==="container"?{height:I}:{}},$=_=>{var A;const P=_.getAttribute("data-index");let k=((A=_.getBoundingClientRect())==null?void 0:A.height)||0;return f==null||f.forEach(B=>{var T,R;k+=((R=(T=document.querySelector(`[${B}="${P}"]`))==null?void 0:T.getBoundingClientRect())==null?void 0:R.height)??0}),k},F=()=>{var _;if(m&&o==="container"){const P=((_=document==null?void 0:document.getElementById(m))==null?void 0:_.offsetHeight)??0;E(P-b)}};return x.useEffect(()=>{const _=setTimeout(F,v);return window==null||window.addEventListener("resize",F),window==null||window.addEventListener("load",F),()=>{clearTimeout(_),window==null||window.removeEventListener("resize",F),window==null||window.removeEventListener("load",F)}},[o,p]),S.jsx("div",{className:`1ru-w-full ${n}`,children:S.jsx(DI,{context:C,ref:t,overscan:typeof h=="function"?h(o==="container"?I:l):o==="container"?I:l,totalListHeightChanged:_=>o==="min-max"?E(_):null,style:D(),totalCount:a,computeItemKey:r,itemSize:x.useCallback(_=>d==="manual"?i(_):$(_),[]),itemContent:(..._)=>c(hE,..._),components:{Item:gE,...g},endReached:w,increaseViewportBy:y(o==="container"?I:l)})})});g1.displayName="ListVirtualization";const mE="_ripple_ori0m_64",pE="_active_ori0m_69",wt={"disable-transition":"_disable-transition_ori0m_1","tab-panel":"_tab-panel_ori0m_5","tabs-medium":"_tabs-medium_ori0m_9","tabs-list":"_tabs-list_ori0m_12","button-tabs":"_button-tabs_ori0m_12","tabs-small":"_tabs-small_ori0m_19","tabs-m":"_tabs-m_ori0m_9","tabs-s":"_tabs-s_ori0m_19","container-tabs":"_container-tabs_ori0m_49","original-laba-blue-10":"_original-laba-blue-10_ori0m_52",ripple:mE,active:pE,"tabs-slider":"_tabs-slider_ori0m_76","container-payhere-brand-base":"_container-payhere-brand-base_ori0m_81","container-laba-blue-10":"_container-laba-blue-10_ori0m_105","container-laba-blue-10-bg_white":"_container-laba-blue-10-bg_white_ori0m_129"},ho={"0px":"1ru-rounded-none","2px":"1ru-rounded-sm","4px":"1ru-rounded","6px":"1ru-rounded-md","8px":"1ru-rounded-lg","12px":"1ru-rounded-xl","16px":"1ru-rounded-2xl","24px":"1ru-rounded-3xl",full:"1ru-rounded-full"},bE=({id:e,value:t="",keyValueTab:n="",tabsList:r,className:i,classNameContainer:a,classNameButton:o,variant:s="original-laba-blue-10",size:l="tabs-m",borderRadius:u="0px",disabled:c,animation:d=!0,onChange:f})=>{var E;const h=x.useRef([]);let g=r||[];const m=Object.fromEntries(new URL(window.location.href).searchParams.entries()),p={tabsVariant:{"original-laba-blue-10":wt["original-laba-blue-10"],"container-payhere-brand-base":wt["container-payhere-brand-base"],"container-laba-blue-10":wt["container-laba-blue-10"],"container-laba-blue-10-bg_white":wt["container-laba-blue-10-bg_white"]},size:{"tabs-m":wt["tabs-m"],"tabs-s":wt["tabs-s"],"tabs-medium":wt["tabs-medium"],"tabs-small":wt["tabs-small"]},borderRadius:ho,isContainer:["container-payhere-brand-base","container-laba-blue-10","container-laba-blue-10-bg_white"]},[b,v]=x.useState(0),[y,C]=x.useState({height:0,width:0,left:0});g=g.filter(D=>typeof(D==null?void 0:D.isHide)=="boolean"?!D.isHide:!0);const w=D=>{const $=D.currentTarget,F=document.createElement("span"),_=Math.max($.clientWidth,$.clientHeight),P=_/2;F.style.width=F.style.height=`${_}px`,F.style.left=`${D.clientX-$.getBoundingClientRect().left-P}px`,F.style.top=`${D.clientY-$.getBoundingClientRect().top-P}px`,F.classList.add(wt.ripple);const k=$.getElementsByClassName(wt.ripple)[0];k&&k.remove(),$.appendChild(F),setTimeout(()=>{F.remove()},500)},I=D=>{typeof f=="function"&&f(D)};return x.useEffect(()=>{function D(){const $=h.current[b],F={left:($==null?void 0:$.offsetLeft)??0,width:($==null?void 0:$.clientWidth)??0,height:p.isContainer.includes(s)?($==null?void 0:$.clientHeight)??0:4};C(F)}return D(),window.addEventListener("resize",D),()=>window.removeEventListener("resize",D)},[b]),x.useEffect(()=>{const D=g.findIndex($=>$.id===(m==null?void 0:m[n])||$.id===t);if((m!=null&&m[n]||t)&&D>=0){v(D);const $=g==null?void 0:g.find(F=>F.id===(m==null?void 0:m[n]));m!=null&&m[n]&&$&&I($)}D<0&&I(g[0])},[JSON.stringify(t),JSON.stringify(m==null?void 0:m[n])]),S.jsx("div",{className:`${wt["container-tabs"]} ${c?"1ru-opacity-50":""} ${a??""}`,children:S.jsxs("div",{className:`${p.tabsVariant[s]}
|
76
76
|
${p.isContainer.includes(s)?p.size[l]:""}
|
@@ -118,18 +118,18 @@ You should wrap it with \`css\` like this:
|
|
118
118
|
8.57931 4.89118 6.85872C6.05378 5.13813 7.76522 3.86239 9.7462 3.23967C11.7272 2.61695 13.8607 \r
|
119
119
|
2.68403 15.7987 3.42996C17.296 4.0063 18.6083 4.96159 19.6129 6.19191C20.1049 \r
|
120
120
|
6.79445 20.9604 7.02733 21.6311 6.63315Z`,fill:"currentColor"})}),v4=x.forwardRef((e,t)=>{const{size:n="reguler",variants:r="primary-laba-blue-10",children:i,className:a,classNameIconLoading:o,loading:s,onClick:l,type:u="button",disabled:c,...d}=e,f={size:{large:$e["button-large"],reguler:$e["button-reguler"],small:$e["button-small"],"extra-small":$e["button-extra-small"],l:$e["button-l"],m:$e["button-m"],s:$e["button-s"],xs:$e["button-xs"]},loadingSize:{large:"1ru-size-6",reguler:"1ru-size-5",small:"1ru-size-5","extra-small":"1ru-size-5",l:"1ru-size-6",m:"1ru-size-5",s:"1ru-size-5",xs:"1ru-size-5"},variants:{"primary-laba-blue-10":$e["primary-laba-blue-10"],"primary-red-700-dsb_laba-grey-06":$e["primary-red-700-dsb_laba-grey-06"],"primary-green-700":$e["primary-green-700"],"filled-laba-white_laba-blue-10":$e["filled-laba-white_laba-blue-10"],"ghost-laba-blue-10":$e["ghost-laba-blue-10"],"ghost-red-700":$e["ghost-red-700"],"ghost-green-700":$e["ghost-green-700"],"nude-laba-blue-10":$e["nude-laba-blue-10"],"nude-red-700":$e["nude-red-700"],"nude-green-700":$e["nude-green-700"],"nude-gray-500":$e["nude-gray-500"],"primary-blue-700":$e["primary-blue-700"],"secondary-blue-700":$e["secondary-blue-700"],"tertiary-blue-700":$e["tertiary-blue-700"],"ghost-blue-gray-100-bg_white":$e["ghost-blue-gray-100-bg_white"],"secondary-red-600":$e["secondary-red-600"],"tertiary-red-300":$e["tertiary-red-300"],"tertiary-gray-500":$e["tertiary-gray-500"],"tertiary-red-600":$e["tertiary-red-600"],"secondary-green-600":$e["secondary-green-600"],"nude-laba-red-10":$e["nude-laba-red-10"],"primary-red-700":$e["primary-red-700"]}};return S.jsxs("button",{onClick:s?void 0:l,ref:t,className:`${f.size[n]} ${f.variants[r]}
|
121
|
-
${s?$e.loading:""} ${a??""}`,type:u,disabled:c??s,...d,children:[s&&S.jsx(cF,{className:`${f.loadingSize[n]} ${o}`}),i]})});v4.displayName="ButtonIcon";const
|
121
|
+
${s?$e.loading:""} ${a??""}`,type:u,disabled:c??s,...d,children:[s&&S.jsx(cF,{className:`${f.loadingSize[n]} ${o}`}),i]})});v4.displayName="ButtonIcon";const Je={"base-badges":"_base-badges_2njot_1","outline-laba-blue-01":"_outline-laba-blue-01_2njot_1","outline-amber-800":"_outline-amber-800_2njot_1","outline-blue-600":"_outline-blue-600_2njot_1","outline-red-500":"_outline-red-500_2njot_1","outline-green-600":"_outline-green-600_2njot_1","outline-gray-600":"_outline-gray-600_2njot_1","ghost-laba-red-01":"_ghost-laba-red-01_2njot_1","ghost-laba-grey-05":"_ghost-laba-grey-05_2njot_1","ghost-laba-blue-02":"_ghost-laba-blue-02_2njot_1","ghost-laba-green-01":"_ghost-laba-green-01_2njot_1","ghost-laba-orange-01":"_ghost-laba-orange-01_2njot_1","ghost-amber-100":"_ghost-amber-100_2njot_1","ghost-blue-100":"_ghost-blue-100_2njot_1","ghost-red-100":"_ghost-red-100_2njot_1","ghost-green-100":"_ghost-green-100_2njot_1","ghost-gray-200":"_ghost-gray-200_2njot_1","filled-red-900":"_filled-red-900_2njot_1","filled-lime-700":"_filled-lime-700_2njot_1","filled-amber-800":"_filled-amber-800_2njot_1","filled-pink-600":"_filled-pink-600_2njot_1","filled-blue-600":"_filled-blue-600_2njot_1","filled-red-500":"_filled-red-500_2njot_1","filled-green-600":"_filled-green-600_2njot_1","filled-gray-600":"_filled-gray-600_2njot_1"},y4=x.forwardRef((e,t)=>{const n={variants:{"filled-gray-600":Je["filled-gray-600"],"filled-green-600":Je["filled-green-600"],"filled-red-500":Je["filled-red-500"],"filled-blue-600":Je["filled-blue-600"],"filled-amber-800":Je["filled-amber-800"],"filled-pink-600":Je["filled-pink-600"],"filled-lime-700":Je["filled-lime-700"],"filled-red-900":Je["filled-red-900"],"ghost-laba-orange-01":Je["ghost-laba-orange-01"],"ghost-laba-green-01":Je["ghost-laba-green-01"],"ghost-laba-blue-02":Je["ghost-laba-blue-02"],"ghost-gray-200":Je["ghost-gray-200"],"ghost-green-100":Je["ghost-green-100"],"ghost-red-100":Je["ghost-red-100"],"ghost-blue-100":Je["ghost-blue-100"],"ghost-amber-100":Je["ghost-amber-100"],"ghost-laba-grey-05":Je["ghost-laba-grey-05"],"ghost-laba-red-01":Je["ghost-laba-red-01"],"outline-gray-600":Je["outline-gray-600"],"outline-green-600":Je["outline-green-600"],"outline-red-500":Je["outline-red-500"],"outline-blue-600":Je["outline-blue-600"],"outline-amber-800":Je["outline-amber-800"],"outline-laba-blue-01":Je["outline-laba-blue-01"]},borderRadius:ho,fonts:{lato:"1ru-font-lato",inter:"1ru-font-Inter"}},{className:r,rounded:i="8px",variants:a="filled-gray-600",children:o,fonts:s="inter",...l}=e;return S.jsx("span",{className:`${ho[i]} ${n.fonts[s]}
|
122
122
|
${n.variants[a]} ${r??""}`,ref:t,...l,children:o})});y4.displayName="Badges";const Xn={"chips-reguler":"_chips-reguler_578ma_1","chips-small":"_chips-small_578ma_10","chips-l":"_chips-l_578ma_19","chips-s":"_chips-s_578ma_10","filled-laba-blue-10":"_filled-laba-blue-10_578ma_37","filled-blue-gray-100":"_filled-blue-gray-100_578ma_42","filled-gray-300":"_filled-gray-300_578ma_47","ghost-laba-grey-02":"_ghost-laba-grey-02_578ma_52","nude-laba-grey-10":"_nude-laba-grey-10_578ma_59"},x4=x.forwardRef((e,t)=>{const{className:n,children:r,fonts:i="inter",size:a="reguler",variants:o="filled-laba-blue-10",icon:s=S.jsx(S.Fragment,{}),removeIcon:l=S.jsx(S.Fragment,{})}=e,u={fonts:{lato:"1ru-font-lato",inter:"1ru-font-Inter"},size:{reguler:Xn["chips-reguler"],small:Xn["chips-small"],l:Xn["chips-l"],s:Xn["chips-s"]},variants:{"filled-laba-blue-10":Xn["filled-laba-blue-10"],"filled-gray-300":Xn["filled-gray-300"],"filled-blue-gray-100":Xn["filled-blue-gray-100"],"ghost-laba-grey-02":Xn["ghost-laba-grey-02"],"nude-laba-grey-10":Xn["nude-laba-grey-10"]}};return S.jsxs("span",{className:`${u.fonts[i]} ${u.size[a]}
|
123
123
|
${u.variants[o]} ${n??""}`,ref:t,children:[typeof s=="function"&&s(),x.isValidElement(s)&&s,r,typeof l=="function"&&l(),x.isValidElement(l)&&l]})});x4.displayName="Chips";const Dd={"payhere-h1":"1ru-text-payhere-h1","payhere-h2":"1ru-text-payhere-h2","payhere-h3":"1ru-text-payhere-h3","payhere-h4":"1ru-text-payhere-h4","payhere-h5":"1ru-text-payhere-h5","payhere-h6":"1ru-text-payhere-h6","payhere-body-lr":"1ru-text-payhere-body-lr","payhere-body-lm":"1ru-text-payhere-body-lm","payhere-body-ls":"1ru-text-payhere-body-ls","payhere-body-lb":"1ru-text-payhere-body-lb","payhere-body-mr":"1ru-text-payhere-body-mr","payhere-body-mm":"1ru-text-payhere-body-mm","payhere-body-ms":"1ru-text-payhere-body-ms","payhere-body-mb":"1ru-text-payhere-body-mb","payhere-label-r":"1ru-text-payhere-label-r","payhere-label-m":"1ru-text-payhere-label-m","payhere-body-sr":"1ru-text-payhere-body-sr","payhere-body-sm":"1ru-text-payhere-body-sm","payhere-body-esr":"1ru-text-payhere-body-esr","payhere-body-esm":"1ru-text-payhere-body-esm","laba-h1":"1ru-text-laba-h1","laba-h2":"1ru-text-laba-h2","laba-base-rb":"1ru-text-laba-base-rb","laba-base-rs":"1ru-text-laba-base-rs","laba-base-rr":"1ru-text-laba-base-rr","laba-base-sb":"1ru-text-laba-base-sb","laba-base-ss":"1ru-text-laba-base-ss","laba-base-sr":"1ru-text-laba-base-sr","laba-subtitle-rb":"1ru-text-laba-subtitle-rb","laba-subtitle-rs":"1ru-text-laba-subtitle-rs","laba-subtitle-rr":"1ru-text-laba-subtitle-rr","laba-subtitle-sb":"1ru-text-laba-subtitle-sb","laba-subtitle-ss":"1ru-text-laba-subtitle-ss","laba-subtitle-sr":"1ru-text-laba-subtitle-sr"},dF="_container_pw3xo_1",fF="_label_pw3xo_103",hF="_disabled_pw3xo_106",Ct={"input-radio-checkbox-base":"_input-radio-checkbox-base_pw3xo_1",container:dF,"container-input":"_container-input_pw3xo_1","input-radio-checkbox-s":"_input-radio-checkbox-s_pw3xo_1","input-radio-checkbox-m":"_input-radio-checkbox-m_pw3xo_1","input-radio-checkbox-small":"_input-radio-checkbox-small_pw3xo_1","input-radio-checkbox-reguler":"_input-radio-checkbox-reguler_pw3xo_1","checked-icon":"_checked-icon_pw3xo_4","default-disabled-radio":"_default-disabled-radio_pw3xo_34","default-disabled-checkbox":"_default-disabled-checkbox_pw3xo_44","laba-blue-10":"_laba-blue-10_pw3xo_52","laba-blue-10-hv_bg_transparent":"_laba-blue-10-hv_bg_transparent_pw3xo_64","blue-700":"_blue-700_pw3xo_76","blue-700-hv_bg_transparent":"_blue-700-hv_bg_transparent_pw3xo_88",label:fF,disabled:hF},C4=({className:e})=>S.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:`1ru-h-3.5 1ru-w-3.5 1ru-text-white ${e??""}`,viewBox:"0 0 20 20",fill:"currentColor",stroke:"currentColor",strokeWidth:"1",children:S.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}),w4=({className:e})=>S.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:`1ru-h-4 1ru-w-4 1ru-text-blue-700 ${e??""}`,viewBox:"0 0 16 16",fill:"currentColor",children:S.jsx("circle",{"data-name":"ellipse",cx:"8",cy:"8",r:"8"})}),yu=x.forwardRef((e,t)=>{const{variantDisableds:n,classNameContainer:r,classNameLabel:i,classNameCheckedIcon:a,fonts:o="lato",id:s,name:l,borderRadius:u="full",className:c,sizeInput:d="reguler",variants:f="laba-blue-10",type:h="checkbox",checkedIcon:g,label:m,typography:p="payhere-body-mr",classNameContainerCheckedIcon:b,...v}=e,y={size:{reguler:Ct["input-radio-checkbox-reguler"],small:Ct["input-radio-checkbox-small"],m:Ct["input-radio-checkbox-m"],s:Ct["input-radio-checkbox-s"]},variants:{"laba-blue-10":Ct["laba-blue-10"],"laba-blue-10-hv_bg_transparent":Ct["laba-blue-10-hv_bg_transparent"],"blue-700":Ct["blue-700"],"blue-700-hv_bg_transparent":Ct["blue-700-hv_bg_transparent"]},variantDisableds:{"default-disabled-checkbox":Ct["default-disabled-checkbox"],"default-disabled-radio":Ct["default-disabled-radio"]},borderRadius:ho,typography:Dd,fonts:{lato:"1ru-font-lato",inter:"1ru-font-Inter"}},C=()=>n?y.variantDisableds[n]:h==="checkbox"?Ct["default-disabled-checkbox"]:Ct["default-disabled-radio"];return S.jsxs("div",{className:`${Ct.container} ${r??""}`,children:[S.jsxs("div",{className:Ct["container-input"],children:[S.jsx("input",{id:s??l,type:h,name:l,className:`${y.size[d]} ${y.variants[f]}
|
124
124
|
${y.borderRadius[u]} ${C()} ${c??""}`,ref:t,...v}),S.jsx("span",{className:`${Ct["checked-icon"]} ${b??""}`,children:g?S.jsx(S.Fragment,{children:g}):S.jsx(S.Fragment,{children:h==="checkbox"?S.jsx(C4,{className:a}):S.jsx(w4,{className:a})})})]}),m&&S.jsx("label",{className:`${y.fonts[o]} ${y.typography[p]}
|
125
125
|
${Ct.label} ${v.disabled?Ct.disabled:""} ${i??""}`,htmlFor:s??l,children:m})]})});yu.displayName="RadioCheckbox";const gF="_container_12ztd_1",mF="_disabled_12ztd_5",pF="_label_12ztd_9",bF="_desc_12ztd_12",Ni={container:gF,"laba-blue-01":"_laba-blue-01_12ztd_1","blue-50":"_blue-50_12ztd_1",disabled:mF,label:pF,desc:bF,"custom-typography":"_custom-typography_12ztd_25"},vF=({radioCheckboxProps:e,name:t,id:n,type:r="checkbox",typographyLabel:i,typographyDesc:a,fonts:o,borderRadius:s="8px",className:l,disabled:u,variants:c,label:d,desc:f,...h})=>{const g={borderRadius:ho,typographyLabel:Dd,typographyDesc:Dd,fonts:{lato:"1ru-font-lato",inter:"1ru-font-Inter"},variants:{"laba-blue-01":Ni["laba-blue-01"],"blue-50":Ni["blue-50"]}},m=()=>o?g.fonts[o]:r==="checkbox"?g.fonts.lato:g.fonts.inter,p=()=>c?g.variants[c]:r==="checkbox"?g.variants["laba-blue-01"]:g.variants["blue-50"];return S.jsxs("label",{className:`${Ni.container} ${g.borderRadius[s]}
|
126
126
|
${m()} ${p()} ${u?Ni.disabled:""} ${l??""}`,htmlFor:n??t,children:[S.jsx(yu,{id:n,name:t,type:r,disabled:u,...e,...h}),S.jsxs("div",{children:[S.jsx("p",{className:`${Ni.label}
|
127
127
|
${i?`${g.typographyLabel[i]} custom-typography`:""}`,children:d}),S.jsx("p",{className:`${Ni.desc} ${a?`${g.typographyDesc[a]} custom-typography`:""}`,children:f})]})]})},Ym={"gap-0":"1ru-gap-0","gap-x-0":"1ru-gap-x-0","gap-y-0":"1ru-gap-y-0","gap-px":"1ru-gap-px","gap-x-px":"1ru-gap-x-px","gap-y-px":"1ru-gap-y-px","gap-0.5":"1ru-gap-0.5","gap-x-0.5":"1ru-gap-x-0.5","gap-y-0.5":"1ru-gap-y-0.5","gap-1":"1ru-gap-1","gap-x-1":"1ru-gap-x-1","gap-y-1":"1ru-gap-y-1","gap-1.5":"1ru-gap-1.5","gap-x-1.5":"1ru-gap-x-1.5","gap-y-1.5":"1ru-gap-y-1.5","gap-2":"1ru-gap-2","gap-x-2":"1ru-gap-x-2","gap-y-2":"1ru-gap-y-2","gap-2.5":"1ru-gap-2.5","gap-x-2.5":"1ru-gap-x-2.5","gap-y-2.5":"1ru-gap-y-2.5","gap-3":"1ru-gap-3","gap-x-3":"1ru-gap-x-3","gap-y-3":"1ru-gap-y-3","gap-3.5":"1ru-gap-3.5","gap-x-3.5":"1ru-gap-x-3.5","gap-y-3.5":"1ru-gap-y-3.5","gap-4":"1ru-gap-4","gap-x-4":"1ru-gap-x-4","gap-y-4":"1ru-gap-y-4","gap-5":"1ru-gap-5","gap-x-5":"1ru-gap-x-5","gap-y-5":"1ru-gap-y-5","gap-6":"1ru-gap-6","gap-x-6":"1ru-gap-x-6","gap-y-6":"1ru-gap-y-6","gap-7":"1ru-gap-7","gap-x-7":"1ru-gap-x-7","gap-y-7":"1ru-gap-y-7","gap-8":"1ru-gap-8","gap-x-8":"1ru-gap-x-8","gap-y-8":"1ru-gap-y-8","gap-9":"1ru-gap-9","gap-x-9":"1ru-gap-x-9","gap-y-9":"1ru-gap-y-9","gap-10":"1ru-gap-10","gap-x-10":"1ru-gap-x-10","gap-y-10":"1ru-gap-y-10"},yF="_container_fqogk_1",xF="_action_fqogk_8",CF="_urls_fqogk_20",wF="_url_fqogk_20",DF="_active_fqogk_32",Li={container:yF,"laba-blue-10":"_laba-blue-10_fqogk_1","blue-700":"_blue-700_fqogk_1",action:xF,urls:CF,url:wF,active:DF},SF=({as:e,variants:t="laba-blue-10",fonts:n="lato",urls:r=[],textBreadcrumbs:i=[],onClickBreadcrumbs:a=[],gapAction:o,gapUrls:s,className:l,textAction:u="Kembali",iconAction:c,onClickAction:d,onClickUrls:f,separator:h=">",propsLink:g,...m})=>{const p=e??"div",b={fonts:{lato:"1ru-font-lato",inter:"1ru-font-Inter"},variants:{"laba-blue-10":Li["laba-blue-10"],"blue-700":Li["blue-700"]},gapAction:Ym,gapUrls:Ym},v=y=>!!(Array.isArray(r)&&r.length>0&&r.length-1===y);return S.jsxs("div",{className:`${b.fonts[n]} ${b.variants[t]}
|
128
|
-
${l??""}`,...m,children:[d&&S.jsxs("div",{onClick:d,className:`${Li.action} ${o?b.gapAction[o]:""}`,children:[c,u]}),S.jsx("div",{className:`${Li.urls} ${s?b.gapUrls[s]:""}`,children:r==null?void 0:r.map((y,C)=>S.jsxs(x.Fragment,{children:[S.jsx(p,{className:`${Li.url} ${v(C)?Li.active:""}`,onClick:()=>{(a==null?void 0:a[C])!==void 0&&typeof a[C]=="function"?a[C]():typeof f=="function"&&f(y)},...g?g(y,C,r):{},children:i[C]}),!v(C)&&S.jsx(S.Fragment,{children:h})]},C))})]})},IF="_sidebar_mnqdg_9",fn={"splace-screen":"_splace-screen_mnqdg_1","payhere-brand-base-white":"_payhere-brand-base-white_mnqdg_6",sidebar:IF,"button-collaps-sidebar":"_button-collaps-sidebar_mnqdg_19","menu-sidebar":"_menu-sidebar_mnqdg_30","sidebar-open":"_sidebar-open_mnqdg_49","container-icon-company-sidebar":"_container-icon-company-sidebar_mnqdg_60","icon-company-sidebar":"_icon-company-sidebar_mnqdg_63","sidebar-close":"_sidebar-close_mnqdg_67","content-sidebar":"_content-sidebar_mnqdg_84","payhere-brand-base-transparent":"_payhere-brand-base-transparent_mnqdg_138","laba-white":"_laba-white_mnqdg_270"},EF="_hidden_1j95c_62",
|
129
|
-
${m||u.subs.length>0&&b?(C=c.activeColor)==null?void 0:C[a]:""} ${typeof n=="boolean"&&n?
|
130
|
-
`,onClick:v,onMouseOver:()=>g(!0),onMouseOut:()=>g(!1),...l?l(u.slug):{},children:[S.jsxs("div",{className:"1ru-flex 1ru-items-center 1ru-gap-3 1ru-relative",children:[x.isValidElement(u.svgIcon)&&S.jsx("div",{className:
|
131
|
-
${m||u.subs.length>0&&b?(I=c.activeColor)==null?void 0:I[a]:""} ${typeof n=="boolean"&&n?
|
132
|
-
`,onClick:v,onMouseOver:()=>g(!0),onMouseOut:()=>g(!1),...l?l(u.slug):{},children:[x.isValidElement(u.svgIcon)&&S.jsx("div",{className:et["item-icon"],children:m||u.subs.length>0&&b||h?u.svgIconActive:u.svgIcon}),S.jsx("div",{className:et["item-label"],children:u.label}),u.subs.length>0&&n&&S.jsxs("div",{className:et["item-icon-subs"],children:[x.isValidElement(i)&&i,typeof i=="function"&&i()]})]}),u.parent===4&&!u.subs.length&&S.jsx("div",{className:et["divider-item-sidebar"]})]})),u.subs.length>0?S.jsxs("div",{className:`${n??b?"":"-mt-2"}`,children:[d,S.jsx("div",{className:`${et["item-subs-sidebar"]} ${!n||!b?et.hidden:""}`,children:u.subs.map(E=>x.createElement(D4,{...E,as:E.manualRoute?"div":E.subs.length>0?e:u.linkComponent,key:E.name,patch:r,iconSubs:i,show:t,open:n,variant:a,setShow:o}))}),[3,4].includes(u.parent)&&S.jsx("div",{className:et["divider-item-sidebar"]})]}):d):S.jsx(S.Fragment,{})},S4=x.forwardRef((e,t)=>{var B;const{as:n,children:r,patch:i="/",iconCompany:a,iconSubs:o,iconCollapse:s,iconCollapseClose:l,modules:u,toleranceWidthIconCompany:c=25,onClickItems:d,variant:f="payhere-brand-base-white",footer:h,withInheritance:g,...m}=e,p=x.useRef(null),b={withCuctomWidthIconCompany:["payhere-brand-base-white","payhere-brand-base-transparent"],variants:{"payhere-brand-base-white":fn["payhere-brand-base-white"],"payhere-brand-base-transparent":fn["payhere-brand-base-transparent"],"laba-white":fn["laba-white"]}},[v,y]=x.useState(null),[C,w]=x.useState(null),[I,E]=x.useState(""),[D,$]=x.useState(),[F,_]=x.useState(0),P=()=>{var V;let T=0;const R=document.getElementById("icon-company-sidebar");(V=R==null?void 0:R.childNodes)==null||V.forEach(H=>{T+=H.getBoundingClientRect().width??0}),$(T+c+"px")},k=()=>{_(window.innerWidth)},A=()=>{y(!C),C?$("auto"):setTimeout(()=>{P()},100)};return x.useEffect(()=>{F>=768?(y(!0),setTimeout(()=>{P()},100)):(y(!1),$("auto"))},[F]),x.useEffect(()=>{typeof v=="boolean"&&w(v)},[v]),x.useImperativeHandle(t,()=>({openSidebar:v,setOpenSidebar:y,handlerClickCollapse:A}),[v,C]),x.useEffect(()=>(i&&i.split("/").length>1&&E(i+"/"),P(),k(),window.addEventListener("resize",k),()=>window.removeEventListener("resize",k)),[]),S.jsxs("div",{className:b.variants[f],...m,ref:p,children:[S.jsxs("div",{id:"1ru-sidebar",className:`${fn.sidebar} ${typeof C=="boolean"&&C?fn["sidebar-open"]:""} ${typeof C=="boolean"&&!C?fn["sidebar-close"]:""}`,children:[x.isValidElement(s)&&S.jsxs("div",{className:fn["button-collaps-sidebar"],onClick:A,children:[v&&s,v?"":x.isValidElement(l)?l:s]}),S.jsx("div",{className:fn["container-icon-company-sidebar"],children:S.jsxs("div",{id:"icon-company-sidebar",className:fn["icon-company-sidebar"],style:{width:D&&b.withCuctomWidthIconCompany.includes(f)?D:"100%"},children:[x.isValidElement(a)&&a,typeof a=="function"&&a({openSidebar:C,setOpenSidebar:y})]})}),S.jsx("div",{className:fn["menu-sidebar"],onMouseOver:()=>{v||w(!0)},onMouseOut:()=>{v||w(!1)},children:u.map(T=>x.createElement(D4,{...T,as:T.manualRoute||T.subs.length>0?"div":n,linkComponent:n,key:T.name,show:I,open:C,patch:i,iconSubs:o,variant:f,setShow:E,onClickItems:d}))}),h&&S.jsxs("div",{className:C?"1ru-opacity-[1]":"1ru-opacity-0",children:[x.isValidElement(h)&&S.jsx("div",{children:h}),typeof h=="function"&&S.jsx("div",{children:h()})]})]}),v&&S.jsx("div",{className:fn["splace-screen"],onClick:A}),S.jsxs("div",{className:fn["content-sidebar"],children:[g&&((B=x.Children)==null?void 0:B.map(r,T=>S.jsx(S.Fragment,{children:x.isValidElement(T)&&S.jsx(S.Fragment,{children:x.cloneElement(T,{openSidebar:v,handlerClickCollapse:A})})}))),!g&&S.jsx(S.Fragment,{children:r})]})]})});S4.displayName="Sidebar";const _F="_collapse_gto9s_1",$F={collapse:_F},RF=({children:e,id:t="id-collapse-1mpacto-react-ui",open:n,className:r,maxCollapsedHeight:i="0px",triggerCalCulateContainer:a,delayTriggerCalculateHeight:o=0})=>{const[s,l]=x.useState("1000vh"),u=()=>{var d;const c=((d=document==null?void 0:document.getElementById(t))==null?void 0:d.offsetHeight)??0;l(c||"1000vh")};return x.useEffect(()=>{const c=setTimeout(u,o);return window==null||window.addEventListener("resize",u),window==null||window.addEventListener("load",u),()=>{clearTimeout(c),window==null||window.removeEventListener("resize",u),window==null||window.removeEventListener("load",u)}},[a]),S.jsx("div",{className:$F.collapse,style:{maxHeight:n?s:i},children:S.jsx("div",{id:t,className:r??"",children:e})})},AF="_modal_1j8ss_1",Gr={"center-layout":"_center-layout_1j8ss_1",modal:AF,"modal-content":"_modal-content_1j8ss_1","with-overlay":"_with-overlay_1j8ss_14","modal-small":"_modal-small_1j8ss_24","modal-regular":"_modal-regular_1j8ss_28","modal-large":"_modal-large_1j8ss_32","modal-show":"_modal-show_1j8ss_36"},FF=({as:e,children:t,id:n="modal",idModal:r="1ru-modal",withOverlay:i=!0,show:a,size:o="regular",className:s,classNameContainer:l,onClose:u,...c})=>{const d=e??"div",f={size:{small:Gr["modal-small"],regular:Gr["modal-regular"],large:Gr["modal-large"]}},h=()=>{typeof u=="function"&&u()};return S.jsx(S.Fragment,{children:a&&document.getElementById(r)&&ko.createPortal(S.jsx("div",{id:n,onClick:h,className:`${Gr.modal} ${i?Gr["with-overlay"]:""} ${a?Gr["modal-show"]:""} ${l??""}`,children:S.jsx(d,{onClick:g=>g.stopPropagation(),className:`${Gr["modal-content"]} ${f.size[o]} ${s??""}`,...c,children:t})}),document.getElementById(r))})},PF="_dot_10oqk_31",Tn={"timeline-container":"_timeline-container_10oqk_1","no-time":"_no-time_10oqk_11","timeline-content":"_timeline-content_10oqk_15","left-content":"_left-content_10oqk_18","time-content":"_time-content_10oqk_24","text-time":"_text-time_10oqk_27",dot:PF,"right-content":"_right-content_10oqk_34"},TF=({children:e,noTime:t=!1})=>S.jsx("div",{className:`${Tn["timeline-container"]} ${t?Tn["no-time"]:""}`,children:e}),kF=({children:e,time:t,clasName:n,noTime:r=!1})=>S.jsxs("div",{className:Tn["timeline-content"],children:[S.jsx("div",{className:`${Tn["left-content"]} ${r?Tn["no-time"]:""}`,children:S.jsxs("div",{className:Tn["time-content"],children:[!r&&S.jsx("time",{className:Tn["text-time"],children:t??""}),S.jsx("div",{className:Tn.dot})]})}),S.jsx("div",{className:`${Tn["right-content"]} ${r?Tn["no-time"]:""} ${n??""}`,children:e})]}),MF=Object.assign(TF,{TimelineContent:kF}),Um=(e,t,n)=>{if((t==null?void 0:t.length)>0){const r={};return t.forEach(i=>{e[i]&&(r[i]=e[i]),n&&e[`${n}${i}`]&&(r[`${n}${i}`]=e[`${n}${i}`])}),r}return e},BF=({children:e,onChange:t,prefixNativeValue:n="",defaultNativeValue:r,defaultValue:i,mountedExecuteChange:a=!0,keepKeys:o=[],resetPagination:s=!0,keyPageNumber:l="pageNumber"})=>{const u=s?{[l]:1}:{},[c,d]=x.useState(Um(i??{},o,"")),[f,h]=x.useState(Q2(n,Um(r??{},o,n))),[g,m]=x.useState(!1),p=(w,I)=>w.map(E=>E[I]).join(","),b=(w,I)=>w.map(E=>E[I]),v=(w,I)=>{const E={};return Object.keys(I).forEach(D=>{E[`${w}${D}`]=I[D]}),E},y=(w,I,E,D)=>{let $=w;const F=v(n,{[I]:w});Array.isArray(w)&&(E==="array-of-object-to-array"?$=b(w,D):E==="array-of-object-to-string"?$=p(w,D):E==="array-to-string"&&($=$.toString())),typeof t=="function"&&t({...c,[I]:$,...u},{...f,...F}),d(_=>({..._,[I]:$})),h(_=>({..._,...F}))},C=(w,I)=>{const D=v(n,{...I??w});typeof t=="function"&&t({...c,...w,...u},{...f,...D}),d($=>({...$,...w})),h($=>({...$,...D}))};return Ho(()=>{!g&&typeof t=="function"&&a&&(t(c,f),m(!0))},[c,f,g,a]),S.jsx(S.Fragment,{children:e({handlerOnChange:y,handlerOnChangeNative:C,value:c,nativeValue:f})})};function th(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}var _o;(function(e){e.event="event",e.props="prop"})(_o||(_o={}));function rr(){}function VF(e){var t,n=void 0;return function(){for(var r=[],i=arguments.length;i--;)r[i]=arguments[i];return t&&r.length===t.length&&r.every(function(a,o){return a===t[o]})||(t=r,n=e.apply(void 0,r)),n}}function yi(e){return!!(e||"").match(/\d/)}function ci(e){return e==null}function OF(e){return typeof e=="number"&&isNaN(e)}function I4(e){return ci(e)||OF(e)||typeof e=="number"&&!isFinite(e)}function E4(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function NF(e){switch(e){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;case"thousand":default:return/(\d)(?=(\d{3})+(?!\d))/g}}function LF(e,t,n){var r=NF(n),i=e.search(/[1-9]/);return i=i===-1?e.length:i,e.substring(0,i)+e.substring(i,e.length).replace(r,"$1"+t)}function jF(e){var t=x.useRef(e);t.current=e;var n=x.useRef(function(){for(var r=[],i=arguments.length;i--;)r[i]=arguments[i];return t.current.apply(t,r)});return n.current}function nh(e,t){t===void 0&&(t=!0);var n=e[0]==="-",r=n&&t;e=e.replace("-","");var i=e.split("."),a=i[0],o=i[1]||"";return{beforeDecimal:a,afterDecimal:o,hasNegation:n,addNegation:r}}function HF(e){if(!e)return e;var t=e[0]==="-";t&&(e=e.substring(1,e.length));var n=e.split("."),r=n[0].replace(/^0+/,"")||"0",i=n[1]||"";return(t?"-":"")+r+(i?"."+i:"")}function _4(e,t,n){for(var r="",i=n?"0":"",a=0;a<=t-1;a++)r+=e[a]||i;return r}function Jm(e,t){return Array(t+1).join(e)}function $4(e){var t=e+"",n=t[0]==="-"?"-":"";n&&(t=t.substring(1));var r=t.split(/[eE]/g),i=r[0],a=r[1];if(a=Number(a),!a)return n+i;i=i.replace(".","");var o=1+a,s=i.length;return o<0?i="0."+Jm("0",Math.abs(o))+i:o>=s?i=i+Jm("0",o-s):i=(i.substring(0,o)||"0")+"."+i.substring(o),n+i}function Km(e,t,n){if(["","-"].indexOf(e)!==-1)return e;var r=(e.indexOf(".")!==-1||n)&&t,i=nh(e),a=i.beforeDecimal,o=i.afterDecimal,s=i.hasNegation,l=parseFloat("0."+(o||"0")),u=o.length<=t?"0."+o:l.toFixed(t),c=u.split("."),d=a;a&&Number(c[0])&&(d=a.split("").reverse().reduce(function(m,p,b){return m.length>b?(Number(m[0])+Number(p)).toString()+m.substring(1,m.length):p+m},c[0]));var f=_4(c[1]||"",t,n),h=s?"-":"",g=r?".":"";return""+h+d+g+f}function wr(e,t){if(e.value=e.value,e!==null){if(e.createTextRange){var n=e.createTextRange();return n.move("character",t),n.select(),!0}return e.selectionStart||e.selectionStart===0?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}var R4=VF(function(e,t){for(var n=0,r=0,i=e.length,a=t.length;e[n]===t[n]&&n<i;)n++;for(;e[i-1-r]===t[a-1-r]&&a-r>n&&i-r>n;)r++;return{from:{start:n,end:i-r},to:{start:n,end:a-r}}}),WF=function(e,t){var n=Math.min(e.selectionStart,t);return{from:{start:n,end:e.selectionEnd},to:{start:n,end:t}}};function zF(e,t,n){return Math.min(Math.max(e,t),n)}function vc(e){return Math.max(e.selectionStart,e.selectionEnd)}function GF(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function A4(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function F4(e,t){return e===void 0&&(e=" "),typeof e=="string"?e:e[t]||" "}function ZF(e){var t=e.currentValue,n=e.formattedValue,r=e.currentValueIndex,i=e.formattedValueIndex;return t[r]===n[i]}function XF(e,t,n,r,i,a,o){o===void 0&&(o=ZF);var s=i.findIndex(function(C){return C}),l=e.slice(0,s);!t&&!n.startsWith(l)&&(t=l,n=l+n,r=r+l.length);for(var u=n.length,c=e.length,d={},f=new Array(u),h=0;h<u;h++){f[h]=-1;for(var g=0,m=c;g<m;g++){var p=o({currentValue:n,lastValue:t,formattedValue:e,currentValueIndex:h,formattedValueIndex:g});if(p&&d[g]!==!0){f[h]=g,d[g]=!0;break}}}for(var b=r;b<u&&(f[b]===-1||!a(n[b]));)b++;var v=b===u||f[b]===-1?c:f[b];for(b=r-1;b>0&&f[b]===-1;)b--;var y=b===-1||f[b]===-1?0:f[b]+1;return y>v?v:r-y<v-r?y:v}function Vl(e,t,n,r){var i=e.length;if(t=zF(t,0,i),r==="left"){for(;t>=0&&!n[t];)t--;t===-1&&(t=n.indexOf(!0))}else{for(;t<=i&&!n[t];)t++;t>i&&(t=n.lastIndexOf(!0))}return t===-1&&(t=i),t}function YF(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,r=t.length;n<r;n++)t[n]=!!(yi(e[n])||yi(e[n-1]));return t}function P4(e,t,n,r,i,a){a===void 0&&(a=rr);var o=jF(function(g,m){var p,b;return I4(g)?(b="",p=""):typeof g=="number"||m?(b=typeof g=="number"?$4(g):g,p=r(b)):(b=i(g,void 0),p=r(b)),{formattedValue:p,numAsString:b}}),s=x.useState(function(){return o(ci(e)?t:e,n)}),l=s[0],u=s[1],c=function(g,m){g.formattedValue!==l.formattedValue&&u({formattedValue:g.formattedValue,numAsString:g.value}),a(g,m)},d=e,f=n;ci(e)&&(d=l.numAsString,f=!0);var h=o(d,f);return x.useMemo(function(){u(h)},[h.formattedValue]),[l,c]}function UF(e){return e.replace(/[^0-9]/g,"")}function JF(e){return e}function T4(e){var t=e.type;t===void 0&&(t="text");var n=e.displayType;n===void 0&&(n="input");var r=e.customInput,i=e.renderText,a=e.getInputRef,o=e.format;o===void 0&&(o=JF);var s=e.removeFormatting;s===void 0&&(s=UF);var l=e.defaultValue,u=e.valueIsNumericString,c=e.onValueChange,d=e.isAllowed,f=e.onChange;f===void 0&&(f=rr);var h=e.onKeyDown;h===void 0&&(h=rr);var g=e.onMouseUp;g===void 0&&(g=rr);var m=e.onFocus;m===void 0&&(m=rr);var p=e.onBlur;p===void 0&&(p=rr);var b=e.value,v=e.getCaretBoundary;v===void 0&&(v=YF);var y=e.isValidInputCharacter;y===void 0&&(y=yi);var C=e.isCharacterSame,w=th(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),I=P4(b,l,!!u,o,s,c),E=I[0],D=E.formattedValue,$=E.numAsString,F=I[1],_=x.useRef(),P=x.useRef({formattedValue:D,numAsString:$}),k=function(ee,ne){P.current={formattedValue:ee.formattedValue,numAsString:ee.value},F(ee,ne)},A=x.useState(!1),B=A[0],T=A[1],R=x.useRef(null),V=x.useRef({setCaretTimeout:null,focusTimeout:null});x.useEffect(function(){return T(!0),function(){clearTimeout(V.current.setCaretTimeout),clearTimeout(V.current.focusTimeout)}},[]);var H=o,L=function(ee,ne){var he=parseFloat(ne);return{formattedValue:ee,value:ne,floatValue:isNaN(he)?void 0:he}},Z=function(ee,ne,he){ee.selectionStart===0&&ee.selectionEnd===ee.value.length||(wr(ee,ne),V.current.setCaretTimeout=setTimeout(function(){ee.value===he&&ee.selectionStart!==ne&&wr(ee,ne)},0))},O=function(ee,ne,he){return Vl(ee,ne,v(ee),he)},W=function(ee,ne,he){var Oe=v(ne),ut=XF(ne,D,ee,he,Oe,y,C);return ut=Vl(ne,ut,Oe),ut},q=function(ee){var ne=ee.formattedValue;ne===void 0&&(ne="");var he=ee.input,Oe=ee.source,ut=ee.event,Se=ee.numAsString,xe;if(he){var Vt=ee.inputValue||he.value,Ot=vc(he);he.value=ne,xe=W(Vt,ne,Ot),xe!==void 0&&Z(he,xe,ne)}ne!==D&&k(L(ne,Se),{event:ut,source:Oe})};x.useEffect(function(){var ee=P.current,ne=ee.formattedValue,he=ee.numAsString;(D!==ne||$!==he)&&k(L(D,$),{event:void 0,source:_o.props})},[D,$]);var Y=R.current?vc(R.current):void 0,N=typeof window<"u"?x.useLayoutEffect:x.useEffect;N(function(){var ee=R.current;if(D!==P.current.formattedValue&&ee){var ne=W(P.current.formattedValue,D,Y);ee.value=D,Z(ee,ne,D)}},[D]);var G=function(ee,ne,he){var Oe=ne.target,ut=_.current?WF(_.current,Oe.selectionEnd):R4(D,ee),Se=Object.assign(Object.assign({},ut),{lastValue:D}),xe=s(ee,Se),Vt=H(xe);if(xe=s(Vt,void 0),d&&!d(L(Vt,xe))){var Ot=ne.target,Nt=vc(Ot),un=W(ee,D,Nt);return Ot.value=D,Z(Ot,un,D),!1}return q({formattedValue:Vt,numAsString:xe,inputValue:ee,event:ne,source:he,input:ne.target}),!0},J=function(ee,ne){ne===void 0&&(ne=0);var he=ee.selectionStart,Oe=ee.selectionEnd;_.current={selectionStart:he,selectionEnd:Oe+ne}},re=function(ee){var ne=ee.target,he=ne.value,Oe=G(he,ee,_o.event);Oe&&f(ee),_.current=void 0},fe=function(ee){var ne=ee.target,he=ee.key,Oe=ne.selectionStart,ut=ne.selectionEnd,Se=ne.value;Se===void 0&&(Se="");var xe;he==="ArrowLeft"||he==="Backspace"?xe=Math.max(Oe-1,0):he==="ArrowRight"?xe=Math.min(Oe+1,Se.length):he==="Delete"&&(xe=Oe);var Vt=0;he==="Delete"&&Oe===ut&&(Vt=1);var Ot=he==="ArrowLeft"||he==="ArrowRight";if(xe===void 0||Oe!==ut&&!Ot){h(ee),J(ne,Vt);return}var Nt=xe;if(Ot){var un=he==="ArrowLeft"?"left":"right";Nt=O(Se,xe,un),Nt!==xe&&ee.preventDefault()}else he==="Delete"&&!y(Se[xe])?Nt=O(Se,xe,"right"):he==="Backspace"&&!y(Se[xe])&&(Nt=O(Se,xe,"left"));Nt!==xe&&Z(ne,Nt,Se),h(ee),J(ne,Vt)},le=function(ee){var ne=ee.target,he=function(){var Oe=ne.selectionStart,ut=ne.selectionEnd,Se=ne.value;if(Se===void 0&&(Se=""),Oe===ut){var xe=O(Se,Oe);xe!==Oe&&Z(ne,xe,Se)}};he(),requestAnimationFrame(function(){he()}),g(ee),J(ne)},z=function(ee){ee.persist&&ee.persist();var ne=ee.target,he=ee.currentTarget;R.current=ne,V.current.focusTimeout=setTimeout(function(){var Oe=ne.selectionStart,ut=ne.selectionEnd,Se=ne.value;Se===void 0&&(Se="");var xe=O(Se,Oe);xe!==Oe&&!(Oe===0&&ut===Se.length)&&Z(ne,xe,Se),m(Object.assign(Object.assign({},ee),{currentTarget:he}))},0)},Ae=function(ee){R.current=null,clearTimeout(V.current.focusTimeout),clearTimeout(V.current.setCaretTimeout),p(ee)},ke=B&&GF()?"numeric":void 0,Xe=Object.assign({inputMode:ke},w,{type:t,value:D,onChange:re,onKeyDown:fe,onMouseUp:le,onFocus:z,onBlur:Ae});if(n==="text")return i?x.createElement(x.Fragment,null,i(D,w)||null):x.createElement("span",Object.assign({},w,{ref:a}),D);if(r){var qe=r;return x.createElement(qe,Object.assign({},Xe,{ref:a}))}return x.createElement("input",Object.assign({},Xe,{ref:a}))}function Qm(e,t){var n=t.decimalScale,r=t.fixedDecimalScale,i=t.prefix;i===void 0&&(i="");var a=t.suffix;a===void 0&&(a="");var o=t.allowNegative,s=t.thousandsGroupStyle;if(s===void 0&&(s="thousand"),e===""||e==="-")return e;var l=xu(t),u=l.thousandSeparator,c=l.decimalSeparator,d=n!==0&&e.indexOf(".")!==-1||n&&r,f=nh(e,o),h=f.beforeDecimal,g=f.afterDecimal,m=f.addNegation;return n!==void 0&&(g=_4(g,n,!!r)),u&&(h=LF(h,u,s)),i&&(h=i+h),a&&(g=g+a),m&&(h="-"+h),e=h+(d&&c||"")+g,e}function xu(e){var t=e.decimalSeparator;t===void 0&&(t=".");var n=e.thousandSeparator,r=e.allowedDecimalSeparators;return n===!0&&(n=","),r||(r=[t,"."]),{decimalSeparator:t,thousandSeparator:n,allowedDecimalSeparators:r}}function KF(e,t){e===void 0&&(e="");var n=new RegExp("(-)"),r=new RegExp("(-)(.)*(-)"),i=n.test(e),a=r.test(e);return e=e.replace(/-/g,""),i&&!a&&t&&(e="-"+e),e}function QF(e,t){return new RegExp("(^-)|[0-9]|"+E4(e),"g")}function qF(e,t,n){return e===""?!0:!(t!=null&&t.match(/\d/))&&!(n!=null&&n.match(/\d/))&&typeof e=="string"&&!isNaN(Number(e))}function e7(e,t,n){var r;t===void 0&&(t=A4(e));var i=n.allowNegative,a=n.prefix;a===void 0&&(a="");var o=n.suffix;o===void 0&&(o="");var s=n.decimalScale,l=t.from,u=t.to,c=u.start,d=u.end,f=xu(n),h=f.allowedDecimalSeparators,g=f.decimalSeparator,m=e[d]===g;if(yi(e)&&(e===a||e===o)&&t.lastValue==="")return e;if(d-c===1&&h.indexOf(e[c])!==-1){var p=s===0?"":g;e=e.substring(0,c)+p+e.substring(c+1,e.length)}var b=function(R,V,H){var L=!1,Z=!1;a.startsWith("-")?L=!1:R.startsWith("--")?(L=!1,Z=!0):o.startsWith("-")&&R.length===o.length?L=!1:R[0]==="-"&&(L=!0);var O=L?1:0;return Z&&(O=2),O&&(R=R.substring(O),V-=O,H-=O),{value:R,start:V,end:H,hasNegation:L}},v=b(e,c,d),y=v.hasNegation;r=v,e=r.value,c=r.start,d=r.end;var C=b(t.lastValue,l.start,l.end),w=C.start,I=C.end,E=C.value,D=e.substring(c,d);e.length&&E.length&&(w>E.length-o.length||I<a.length)&&!(D&&o.startsWith(D))&&(e=E);var $=0;e.startsWith(a)?$+=a.length:c<a.length&&($=c),e=e.substring($),d-=$;var F=e.length,_=e.length-o.length;e.endsWith(o)?F=_:(d>_||d>e.length-o.length)&&(F=d),e=e.substring(0,F),e=KF(y?"-"+e:e,i),e=(e.match(QF(g))||[]).join("");var P=e.indexOf(g);e=e.replace(new RegExp(E4(g),"g"),function(R,V){return V===P?".":""});var k=nh(e,i),A=k.beforeDecimal,B=k.afterDecimal,T=k.addNegation;return u.end-u.start<l.end-l.start&&A===""&&m&&!parseFloat(B)&&(e=T?"-":""),e}function t7(e,t){var n=t.prefix;n===void 0&&(n="");var r=t.suffix;r===void 0&&(r="");var i=Array.from({length:e.length+1}).map(function(){return!0}),a=e[0]==="-";i.fill(!1,0,n.length+(a?1:0));var o=e.length;return i.fill(!1,o-r.length+1,o+1),i}function n7(e){var t=xu(e),n=t.thousandSeparator,r=t.decimalSeparator,i=e.prefix;i===void 0&&(i="");var a=e.allowNegative;if(a===void 0&&(a=!0),n===r)throw new Error(`
|
128
|
+
${l??""}`,...m,children:[d&&S.jsxs("div",{onClick:d,className:`${Li.action} ${o?b.gapAction[o]:""}`,children:[c,u]}),S.jsx("div",{className:`${Li.urls} ${s?b.gapUrls[s]:""}`,children:r==null?void 0:r.map((y,C)=>S.jsxs(x.Fragment,{children:[S.jsx(p,{className:`${Li.url} ${v(C)?Li.active:""}`,onClick:()=>{(a==null?void 0:a[C])!==void 0&&typeof a[C]=="function"?a[C]():typeof f=="function"&&f(y)},...g?g(y,C,r):{},children:i[C]}),!v(C)&&S.jsx(S.Fragment,{children:h})]},C))})]})},IF="_sidebar_mnqdg_9",fn={"splace-screen":"_splace-screen_mnqdg_1","payhere-brand-base-white":"_payhere-brand-base-white_mnqdg_6",sidebar:IF,"button-collaps-sidebar":"_button-collaps-sidebar_mnqdg_19","menu-sidebar":"_menu-sidebar_mnqdg_30","sidebar-open":"_sidebar-open_mnqdg_49","container-icon-company-sidebar":"_container-icon-company-sidebar_mnqdg_60","icon-company-sidebar":"_icon-company-sidebar_mnqdg_63","sidebar-close":"_sidebar-close_mnqdg_67","content-sidebar":"_content-sidebar_mnqdg_84","payhere-brand-base-transparent":"_payhere-brand-base-transparent_mnqdg_138","laba-white":"_laba-white_mnqdg_270"},EF="_hidden_1j95c_62",tt={"base-icon-sidebar":"_base-icon-sidebar_1j95c_1","base-item-sidebar":"_base-item-sidebar_1j95c_1","item-icon-subs":"_item-icon-subs_1j95c_1","item-sidebar-2":"_item-sidebar-2_1j95c_1","item-sidebar-1":"_item-sidebar-1_1j95c_1","item-icon":"_item-icon_1j95c_1","item-label":"_item-label_1j95c_13","item-sidebar-open":"_item-sidebar-open_1j95c_35","item-sidebar-close":"_item-sidebar-close_1j95c_45","item-icon-subs-active":"_item-icon-subs-active_1j95c_53","item-sidebar-laba":"_item-sidebar-laba_1j95c_53","item-sidebar-payhere":"_item-sidebar-payhere_1j95c_53","item-subs-sidebar":"_item-subs-sidebar_1j95c_58",hidden:EF,"divider-item-sidebar":"_divider-item-sidebar_1j95c_67","hover-sidebar-payhere":"_hover-sidebar-payhere_1j95c_87","hover-sidebar-laba":"_hover-sidebar-laba_1j95c_96"},D4=({as:e,show:t,open:n,patch:r,iconSubs:i,variant:a="payhere-brand-base-white",setShow:o,onClickItems:s,propsLink:l,...u})=>{var y,C,w,I;const c={activeColor:{"payhere-brand-base-white":tt["item-sidebar-payhere"],"payhere-brand-base-transparent":tt["item-sidebar-payhere"],"laba-white":tt["item-sidebar-laba"]},hoverColor:{"payhere-brand-base-white":tt["hover-sidebar-payhere"],"payhere-brand-base-transparent":tt["hover-sidebar-payhere"],"laba-white":tt["hover-sidebar-laba"]}};let d=S.jsx(S.Fragment,{});const f=e??"div",[h,g]=x.useState(!1),m=r===u.slug,p=t.split("/"),b=p.includes(u.name),v=()=>{if(u.subs.length>0)if(b){const E=p.splice(0,p.indexOf(u.name));E.length>0?o(`${E.join("/")}/`):o("")}else o(`${t}${u.name}/`);else typeof s=="function"&&s(u)};return u.isShow?((u.parent===1||u.parent===3)&&(d=S.jsxs(S.Fragment,{children:[S.jsxs(f,{id:u.name,className:`${tt["item-sidebar-1"]} ${(y=c.hoverColor)==null?void 0:y[a]}
|
129
|
+
${m||u.subs.length>0&&b?(C=c.activeColor)==null?void 0:C[a]:""} ${typeof n=="boolean"&&n?tt["item-sidebar-open"]:""} ${typeof n=="boolean"&&!n?tt["item-sidebar-close"]:""}
|
130
|
+
`,onClick:v,onMouseOver:()=>g(!0),onMouseOut:()=>g(!1),...l?l(u.slug):{},children:[S.jsxs("div",{className:"1ru-flex 1ru-items-center 1ru-gap-3 1ru-relative",children:[x.isValidElement(u.svgIcon)&&S.jsx("div",{className:tt["item-icon"],children:m||u.subs.length>0&&b||h?u.svgIconActive:u.svgIcon}),S.jsx("div",{className:tt["item-label"],children:u.label})]}),u.subs.length>0&&n&&S.jsxs("div",{className:tt["item-icon-subs"],children:[x.isValidElement(i)&&i,typeof i=="function"&&i()]})]}),u.parent===3&&!u.subs.length&&S.jsx("div",{className:tt["divider-item-sidebar"]})]})),(u.parent===2||u.parent===4)&&(d=S.jsxs(S.Fragment,{children:[S.jsxs(f,{id:u.name,className:`${tt["item-sidebar-2"]} ${(w=c.hoverColor)==null?void 0:w[a]}
|
131
|
+
${m||u.subs.length>0&&b?(I=c.activeColor)==null?void 0:I[a]:""} ${typeof n=="boolean"&&n?tt["item-sidebar-open"]:""} ${typeof n=="boolean"&&!n?tt["item-sidebar-close"]:""}
|
132
|
+
`,onClick:v,onMouseOver:()=>g(!0),onMouseOut:()=>g(!1),...l?l(u.slug):{},children:[x.isValidElement(u.svgIcon)&&S.jsx("div",{className:tt["item-icon"],children:m||u.subs.length>0&&b||h?u.svgIconActive:u.svgIcon}),S.jsx("div",{className:tt["item-label"],children:u.label}),u.subs.length>0&&n&&S.jsxs("div",{className:tt["item-icon-subs"],children:[x.isValidElement(i)&&i,typeof i=="function"&&i()]})]}),u.parent===4&&!u.subs.length&&S.jsx("div",{className:tt["divider-item-sidebar"]})]})),u.subs.length>0?S.jsxs("div",{className:`${n??b?"":"-mt-2"}`,children:[d,S.jsx("div",{className:`${tt["item-subs-sidebar"]} ${!n||!b?tt.hidden:""}`,children:u.subs.map(E=>x.createElement(D4,{...E,as:E.manualRoute?"div":E.subs.length>0?e:u.linkComponent,key:E.name,patch:r,iconSubs:i,show:t,open:n,variant:a,setShow:o}))}),[3,4].includes(u.parent)&&S.jsx("div",{className:tt["divider-item-sidebar"]})]}):d):S.jsx(S.Fragment,{})},S4=x.forwardRef((e,t)=>{var B;const{as:n,children:r,patch:i="/",iconCompany:a,iconSubs:o,iconCollapse:s,iconCollapseClose:l,modules:u,toleranceWidthIconCompany:c=25,onClickItems:d,variant:f="payhere-brand-base-white",footer:h,withInheritance:g,...m}=e,p=x.useRef(null),b={withCuctomWidthIconCompany:["payhere-brand-base-white","payhere-brand-base-transparent"],variants:{"payhere-brand-base-white":fn["payhere-brand-base-white"],"payhere-brand-base-transparent":fn["payhere-brand-base-transparent"],"laba-white":fn["laba-white"]}},[v,y]=x.useState(null),[C,w]=x.useState(null),[I,E]=x.useState(""),[D,$]=x.useState(),[F,_]=x.useState(0),P=()=>{var V;let T=0;const R=document.getElementById("icon-company-sidebar");(V=R==null?void 0:R.childNodes)==null||V.forEach(H=>{T+=H.getBoundingClientRect().width??0}),$(T+c+"px")},k=()=>{_(window.innerWidth)},A=()=>{y(!C),C?$("auto"):setTimeout(()=>{P()},100)};return x.useEffect(()=>{F>=768?(y(!0),setTimeout(()=>{P()},100)):(y(!1),$("auto"))},[F]),x.useEffect(()=>{typeof v=="boolean"&&w(v)},[v]),x.useImperativeHandle(t,()=>({openSidebar:v,setOpenSidebar:y,handlerClickCollapse:A}),[v,C]),x.useEffect(()=>(i&&i.split("/").length>1&&E(i+"/"),P(),k(),window.addEventListener("resize",k),()=>window.removeEventListener("resize",k)),[]),S.jsxs("div",{className:b.variants[f],...m,ref:p,children:[S.jsxs("div",{id:"1ru-sidebar",className:`${fn.sidebar} ${typeof C=="boolean"&&C?fn["sidebar-open"]:""} ${typeof C=="boolean"&&!C?fn["sidebar-close"]:""}`,children:[x.isValidElement(s)&&S.jsxs("div",{className:fn["button-collaps-sidebar"],onClick:A,children:[v&&s,v?"":x.isValidElement(l)?l:s]}),S.jsx("div",{className:fn["container-icon-company-sidebar"],children:S.jsxs("div",{id:"icon-company-sidebar",className:fn["icon-company-sidebar"],style:{width:D&&b.withCuctomWidthIconCompany.includes(f)?D:"100%"},children:[x.isValidElement(a)&&a,typeof a=="function"&&a({openSidebar:C,setOpenSidebar:y})]})}),S.jsx("div",{className:fn["menu-sidebar"],onMouseOver:()=>{v||w(!0)},onMouseOut:()=>{v||w(!1)},children:u.map(T=>x.createElement(D4,{...T,as:T.manualRoute||T.subs.length>0?"div":n,linkComponent:n,key:T.name,show:I,open:C,patch:i,iconSubs:o,variant:f,setShow:E,onClickItems:d}))}),h&&S.jsxs("div",{className:C?"1ru-opacity-[1]":"1ru-opacity-0",children:[x.isValidElement(h)&&S.jsx("div",{children:h}),typeof h=="function"&&S.jsx("div",{children:h()})]})]}),v&&S.jsx("div",{className:fn["splace-screen"],onClick:A}),S.jsxs("div",{className:fn["content-sidebar"],children:[g&&((B=x.Children)==null?void 0:B.map(r,T=>S.jsx(S.Fragment,{children:x.isValidElement(T)&&S.jsx(S.Fragment,{children:x.cloneElement(T,{openSidebar:v,handlerClickCollapse:A})})}))),!g&&S.jsx(S.Fragment,{children:r})]})]})});S4.displayName="Sidebar";const _F="_collapse_gto9s_1",$F={collapse:_F},RF=({children:e,id:t="id-collapse-1mpacto-react-ui",open:n,className:r,maxCollapsedHeight:i="0px",triggerCalCulateContainer:a,delayTriggerCalculateHeight:o=0})=>{const[s,l]=x.useState("1000vh"),u=()=>{var d;const c=((d=document==null?void 0:document.getElementById(t))==null?void 0:d.offsetHeight)??0;l(c||"1000vh")};return x.useEffect(()=>{const c=setTimeout(u,o);return window==null||window.addEventListener("resize",u),window==null||window.addEventListener("load",u),()=>{clearTimeout(c),window==null||window.removeEventListener("resize",u),window==null||window.removeEventListener("load",u)}},[a]),S.jsx("div",{className:$F.collapse,style:{maxHeight:n?s:i},children:S.jsx("div",{id:t,className:r??"",children:e})})},AF="_modal_1j8ss_1",Gr={"center-layout":"_center-layout_1j8ss_1",modal:AF,"modal-content":"_modal-content_1j8ss_1","with-overlay":"_with-overlay_1j8ss_14","modal-small":"_modal-small_1j8ss_24","modal-regular":"_modal-regular_1j8ss_28","modal-large":"_modal-large_1j8ss_32","modal-show":"_modal-show_1j8ss_36"},FF=({as:e,children:t,id:n="modal",idModal:r="1ru-modal",withOverlay:i=!0,show:a,size:o="regular",className:s,classNameContainer:l,onClose:u,...c})=>{const d=e??"div",f={size:{small:Gr["modal-small"],regular:Gr["modal-regular"],large:Gr["modal-large"]}},h=()=>{typeof u=="function"&&u()};return S.jsx(S.Fragment,{children:a&&document.getElementById(r)&&ko.createPortal(S.jsx("div",{id:n,onClick:h,className:`${Gr.modal} ${i?Gr["with-overlay"]:""} ${a?Gr["modal-show"]:""} ${l??""}`,children:S.jsx(d,{onClick:g=>g.stopPropagation(),className:`${Gr["modal-content"]} ${f.size[o]} ${s??""}`,...c,children:t})}),document.getElementById(r))})},PF="_dot_10oqk_31",Tn={"timeline-container":"_timeline-container_10oqk_1","no-time":"_no-time_10oqk_11","timeline-content":"_timeline-content_10oqk_15","left-content":"_left-content_10oqk_18","time-content":"_time-content_10oqk_24","text-time":"_text-time_10oqk_27",dot:PF,"right-content":"_right-content_10oqk_34"},TF=({children:e,noTime:t=!1})=>S.jsx("div",{className:`${Tn["timeline-container"]} ${t?Tn["no-time"]:""}`,children:e}),kF=({children:e,time:t,clasName:n,noTime:r=!1})=>S.jsxs("div",{className:Tn["timeline-content"],children:[S.jsx("div",{className:`${Tn["left-content"]} ${r?Tn["no-time"]:""}`,children:S.jsxs("div",{className:Tn["time-content"],children:[!r&&S.jsx("time",{className:Tn["text-time"],children:t??""}),S.jsx("div",{className:Tn.dot})]})}),S.jsx("div",{className:`${Tn["right-content"]} ${r?Tn["no-time"]:""} ${n??""}`,children:e})]}),MF=Object.assign(TF,{TimelineContent:kF}),Um=(e,t,n)=>{if((t==null?void 0:t.length)>0){const r={};return t.forEach(i=>{e[i]&&(r[i]=e[i]),n&&e[`${n}${i}`]&&(r[`${n}${i}`]=e[`${n}${i}`])}),r}return e},BF=({children:e,onChange:t,prefixNativeValue:n="",defaultNativeValue:r,defaultValue:i,mountedExecuteChange:a=!0,keepKeys:o=[],resetPagination:s=!0,keyPageNumber:l="pageNumber"})=>{const u=s?{[l]:1}:{},[c,d]=x.useState(Um(i??{},o,"")),[f,h]=x.useState(Q2(n,Um(r??{},o,n))),[g,m]=x.useState(!1),p=(w,I)=>w.map(E=>E[I]).join(","),b=(w,I)=>w.map(E=>E[I]),v=(w,I)=>{const E={};return Object.keys(I).forEach(D=>{E[`${w}${D}`]=I[D]}),E},y=(w,I,E,D)=>{let $=w;const F=v(n,{[I]:w});Array.isArray(w)&&(E==="array-of-object-to-array"?$=b(w,D):E==="array-of-object-to-string"?$=p(w,D):E==="array-to-string"&&($=$.toString())),typeof t=="function"&&t({...c,[I]:$,...u},{...f,...F}),d(_=>({..._,[I]:$})),h(_=>({..._,...F}))},C=(w,I)=>{const D=v(n,{...I??w});typeof t=="function"&&t({...c,...w,...u},{...f,...D}),d($=>({...$,...w})),h($=>({...$,...D}))};return Ho(()=>{!g&&typeof t=="function"&&a&&(t(c,f),m(!0))},[c,f,g,a]),S.jsx(S.Fragment,{children:e({handlerOnChange:y,handlerOnChangeNative:C,value:c,nativeValue:f})})};function th(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}var _o;(function(e){e.event="event",e.props="prop"})(_o||(_o={}));function rr(){}function VF(e){var t,n=void 0;return function(){for(var r=[],i=arguments.length;i--;)r[i]=arguments[i];return t&&r.length===t.length&&r.every(function(a,o){return a===t[o]})||(t=r,n=e.apply(void 0,r)),n}}function yi(e){return!!(e||"").match(/\d/)}function ci(e){return e==null}function OF(e){return typeof e=="number"&&isNaN(e)}function I4(e){return ci(e)||OF(e)||typeof e=="number"&&!isFinite(e)}function E4(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function NF(e){switch(e){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;case"thousand":default:return/(\d)(?=(\d{3})+(?!\d))/g}}function LF(e,t,n){var r=NF(n),i=e.search(/[1-9]/);return i=i===-1?e.length:i,e.substring(0,i)+e.substring(i,e.length).replace(r,"$1"+t)}function jF(e){var t=x.useRef(e);t.current=e;var n=x.useRef(function(){for(var r=[],i=arguments.length;i--;)r[i]=arguments[i];return t.current.apply(t,r)});return n.current}function nh(e,t){t===void 0&&(t=!0);var n=e[0]==="-",r=n&&t;e=e.replace("-","");var i=e.split("."),a=i[0],o=i[1]||"";return{beforeDecimal:a,afterDecimal:o,hasNegation:n,addNegation:r}}function HF(e){if(!e)return e;var t=e[0]==="-";t&&(e=e.substring(1,e.length));var n=e.split("."),r=n[0].replace(/^0+/,"")||"0",i=n[1]||"";return(t?"-":"")+r+(i?"."+i:"")}function _4(e,t,n){for(var r="",i=n?"0":"",a=0;a<=t-1;a++)r+=e[a]||i;return r}function Jm(e,t){return Array(t+1).join(e)}function $4(e){var t=e+"",n=t[0]==="-"?"-":"";n&&(t=t.substring(1));var r=t.split(/[eE]/g),i=r[0],a=r[1];if(a=Number(a),!a)return n+i;i=i.replace(".","");var o=1+a,s=i.length;return o<0?i="0."+Jm("0",Math.abs(o))+i:o>=s?i=i+Jm("0",o-s):i=(i.substring(0,o)||"0")+"."+i.substring(o),n+i}function Km(e,t,n){if(["","-"].indexOf(e)!==-1)return e;var r=(e.indexOf(".")!==-1||n)&&t,i=nh(e),a=i.beforeDecimal,o=i.afterDecimal,s=i.hasNegation,l=parseFloat("0."+(o||"0")),u=o.length<=t?"0."+o:l.toFixed(t),c=u.split("."),d=a;a&&Number(c[0])&&(d=a.split("").reverse().reduce(function(m,p,b){return m.length>b?(Number(m[0])+Number(p)).toString()+m.substring(1,m.length):p+m},c[0]));var f=_4(c[1]||"",t,n),h=s?"-":"",g=r?".":"";return""+h+d+g+f}function wr(e,t){if(e.value=e.value,e!==null){if(e.createTextRange){var n=e.createTextRange();return n.move("character",t),n.select(),!0}return e.selectionStart||e.selectionStart===0?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}var R4=VF(function(e,t){for(var n=0,r=0,i=e.length,a=t.length;e[n]===t[n]&&n<i;)n++;for(;e[i-1-r]===t[a-1-r]&&a-r>n&&i-r>n;)r++;return{from:{start:n,end:i-r},to:{start:n,end:a-r}}}),WF=function(e,t){var n=Math.min(e.selectionStart,t);return{from:{start:n,end:e.selectionEnd},to:{start:n,end:t}}};function zF(e,t,n){return Math.min(Math.max(e,t),n)}function vc(e){return Math.max(e.selectionStart,e.selectionEnd)}function GF(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function A4(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function F4(e,t){return e===void 0&&(e=" "),typeof e=="string"?e:e[t]||" "}function ZF(e){var t=e.currentValue,n=e.formattedValue,r=e.currentValueIndex,i=e.formattedValueIndex;return t[r]===n[i]}function XF(e,t,n,r,i,a,o){o===void 0&&(o=ZF);var s=i.findIndex(function(C){return C}),l=e.slice(0,s);!t&&!n.startsWith(l)&&(t=l,n=l+n,r=r+l.length);for(var u=n.length,c=e.length,d={},f=new Array(u),h=0;h<u;h++){f[h]=-1;for(var g=0,m=c;g<m;g++){var p=o({currentValue:n,lastValue:t,formattedValue:e,currentValueIndex:h,formattedValueIndex:g});if(p&&d[g]!==!0){f[h]=g,d[g]=!0;break}}}for(var b=r;b<u&&(f[b]===-1||!a(n[b]));)b++;var v=b===u||f[b]===-1?c:f[b];for(b=r-1;b>0&&f[b]===-1;)b--;var y=b===-1||f[b]===-1?0:f[b]+1;return y>v?v:r-y<v-r?y:v}function Vl(e,t,n,r){var i=e.length;if(t=zF(t,0,i),r==="left"){for(;t>=0&&!n[t];)t--;t===-1&&(t=n.indexOf(!0))}else{for(;t<=i&&!n[t];)t++;t>i&&(t=n.lastIndexOf(!0))}return t===-1&&(t=i),t}function YF(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,r=t.length;n<r;n++)t[n]=!!(yi(e[n])||yi(e[n-1]));return t}function P4(e,t,n,r,i,a){a===void 0&&(a=rr);var o=jF(function(g,m){var p,b;return I4(g)?(b="",p=""):typeof g=="number"||m?(b=typeof g=="number"?$4(g):g,p=r(b)):(b=i(g,void 0),p=r(b)),{formattedValue:p,numAsString:b}}),s=x.useState(function(){return o(ci(e)?t:e,n)}),l=s[0],u=s[1],c=function(g,m){g.formattedValue!==l.formattedValue&&u({formattedValue:g.formattedValue,numAsString:g.value}),a(g,m)},d=e,f=n;ci(e)&&(d=l.numAsString,f=!0);var h=o(d,f);return x.useMemo(function(){u(h)},[h.formattedValue]),[l,c]}function UF(e){return e.replace(/[^0-9]/g,"")}function JF(e){return e}function T4(e){var t=e.type;t===void 0&&(t="text");var n=e.displayType;n===void 0&&(n="input");var r=e.customInput,i=e.renderText,a=e.getInputRef,o=e.format;o===void 0&&(o=JF);var s=e.removeFormatting;s===void 0&&(s=UF);var l=e.defaultValue,u=e.valueIsNumericString,c=e.onValueChange,d=e.isAllowed,f=e.onChange;f===void 0&&(f=rr);var h=e.onKeyDown;h===void 0&&(h=rr);var g=e.onMouseUp;g===void 0&&(g=rr);var m=e.onFocus;m===void 0&&(m=rr);var p=e.onBlur;p===void 0&&(p=rr);var b=e.value,v=e.getCaretBoundary;v===void 0&&(v=YF);var y=e.isValidInputCharacter;y===void 0&&(y=yi);var C=e.isCharacterSame,w=th(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),I=P4(b,l,!!u,o,s,c),E=I[0],D=E.formattedValue,$=E.numAsString,F=I[1],_=x.useRef(),P=x.useRef({formattedValue:D,numAsString:$}),k=function(ee,ne){P.current={formattedValue:ee.formattedValue,numAsString:ee.value},F(ee,ne)},A=x.useState(!1),B=A[0],T=A[1],R=x.useRef(null),V=x.useRef({setCaretTimeout:null,focusTimeout:null});x.useEffect(function(){return T(!0),function(){clearTimeout(V.current.setCaretTimeout),clearTimeout(V.current.focusTimeout)}},[]);var H=o,L=function(ee,ne){var he=parseFloat(ne);return{formattedValue:ee,value:ne,floatValue:isNaN(he)?void 0:he}},Z=function(ee,ne,he){ee.selectionStart===0&&ee.selectionEnd===ee.value.length||(wr(ee,ne),V.current.setCaretTimeout=setTimeout(function(){ee.value===he&&ee.selectionStart!==ne&&wr(ee,ne)},0))},O=function(ee,ne,he){return Vl(ee,ne,v(ee),he)},W=function(ee,ne,he){var Oe=v(ne),ut=XF(ne,D,ee,he,Oe,y,C);return ut=Vl(ne,ut,Oe),ut},q=function(ee){var ne=ee.formattedValue;ne===void 0&&(ne="");var he=ee.input,Oe=ee.source,ut=ee.event,Se=ee.numAsString,xe;if(he){var Vt=ee.inputValue||he.value,Ot=vc(he);he.value=ne,xe=W(Vt,ne,Ot),xe!==void 0&&Z(he,xe,ne)}ne!==D&&k(L(ne,Se),{event:ut,source:Oe})};x.useEffect(function(){var ee=P.current,ne=ee.formattedValue,he=ee.numAsString;(D!==ne||$!==he)&&k(L(D,$),{event:void 0,source:_o.props})},[D,$]);var Y=R.current?vc(R.current):void 0,N=typeof window<"u"?x.useLayoutEffect:x.useEffect;N(function(){var ee=R.current;if(D!==P.current.formattedValue&&ee){var ne=W(P.current.formattedValue,D,Y);ee.value=D,Z(ee,ne,D)}},[D]);var G=function(ee,ne,he){var Oe=ne.target,ut=_.current?WF(_.current,Oe.selectionEnd):R4(D,ee),Se=Object.assign(Object.assign({},ut),{lastValue:D}),xe=s(ee,Se),Vt=H(xe);if(xe=s(Vt,void 0),d&&!d(L(Vt,xe))){var Ot=ne.target,Nt=vc(Ot),un=W(ee,D,Nt);return Ot.value=D,Z(Ot,un,D),!1}return q({formattedValue:Vt,numAsString:xe,inputValue:ee,event:ne,source:he,input:ne.target}),!0},J=function(ee,ne){ne===void 0&&(ne=0);var he=ee.selectionStart,Oe=ee.selectionEnd;_.current={selectionStart:he,selectionEnd:Oe+ne}},re=function(ee){var ne=ee.target,he=ne.value,Oe=G(he,ee,_o.event);Oe&&f(ee),_.current=void 0},fe=function(ee){var ne=ee.target,he=ee.key,Oe=ne.selectionStart,ut=ne.selectionEnd,Se=ne.value;Se===void 0&&(Se="");var xe;he==="ArrowLeft"||he==="Backspace"?xe=Math.max(Oe-1,0):he==="ArrowRight"?xe=Math.min(Oe+1,Se.length):he==="Delete"&&(xe=Oe);var Vt=0;he==="Delete"&&Oe===ut&&(Vt=1);var Ot=he==="ArrowLeft"||he==="ArrowRight";if(xe===void 0||Oe!==ut&&!Ot){h(ee),J(ne,Vt);return}var Nt=xe;if(Ot){var un=he==="ArrowLeft"?"left":"right";Nt=O(Se,xe,un),Nt!==xe&&ee.preventDefault()}else he==="Delete"&&!y(Se[xe])?Nt=O(Se,xe,"right"):he==="Backspace"&&!y(Se[xe])&&(Nt=O(Se,xe,"left"));Nt!==xe&&Z(ne,Nt,Se),h(ee),J(ne,Vt)},le=function(ee){var ne=ee.target,he=function(){var Oe=ne.selectionStart,ut=ne.selectionEnd,Se=ne.value;if(Se===void 0&&(Se=""),Oe===ut){var xe=O(Se,Oe);xe!==Oe&&Z(ne,xe,Se)}};he(),requestAnimationFrame(function(){he()}),g(ee),J(ne)},z=function(ee){ee.persist&&ee.persist();var ne=ee.target,he=ee.currentTarget;R.current=ne,V.current.focusTimeout=setTimeout(function(){var Oe=ne.selectionStart,ut=ne.selectionEnd,Se=ne.value;Se===void 0&&(Se="");var xe=O(Se,Oe);xe!==Oe&&!(Oe===0&&ut===Se.length)&&Z(ne,xe,Se),m(Object.assign(Object.assign({},ee),{currentTarget:he}))},0)},Ae=function(ee){R.current=null,clearTimeout(V.current.focusTimeout),clearTimeout(V.current.setCaretTimeout),p(ee)},ke=B&&GF()?"numeric":void 0,Xe=Object.assign({inputMode:ke},w,{type:t,value:D,onChange:re,onKeyDown:fe,onMouseUp:le,onFocus:z,onBlur:Ae});if(n==="text")return i?x.createElement(x.Fragment,null,i(D,w)||null):x.createElement("span",Object.assign({},w,{ref:a}),D);if(r){var et=r;return x.createElement(et,Object.assign({},Xe,{ref:a}))}return x.createElement("input",Object.assign({},Xe,{ref:a}))}function Qm(e,t){var n=t.decimalScale,r=t.fixedDecimalScale,i=t.prefix;i===void 0&&(i="");var a=t.suffix;a===void 0&&(a="");var o=t.allowNegative,s=t.thousandsGroupStyle;if(s===void 0&&(s="thousand"),e===""||e==="-")return e;var l=xu(t),u=l.thousandSeparator,c=l.decimalSeparator,d=n!==0&&e.indexOf(".")!==-1||n&&r,f=nh(e,o),h=f.beforeDecimal,g=f.afterDecimal,m=f.addNegation;return n!==void 0&&(g=_4(g,n,!!r)),u&&(h=LF(h,u,s)),i&&(h=i+h),a&&(g=g+a),m&&(h="-"+h),e=h+(d&&c||"")+g,e}function xu(e){var t=e.decimalSeparator;t===void 0&&(t=".");var n=e.thousandSeparator,r=e.allowedDecimalSeparators;return n===!0&&(n=","),r||(r=[t,"."]),{decimalSeparator:t,thousandSeparator:n,allowedDecimalSeparators:r}}function KF(e,t){e===void 0&&(e="");var n=new RegExp("(-)"),r=new RegExp("(-)(.)*(-)"),i=n.test(e),a=r.test(e);return e=e.replace(/-/g,""),i&&!a&&t&&(e="-"+e),e}function QF(e,t){return new RegExp("(^-)|[0-9]|"+E4(e),"g")}function qF(e,t,n){return e===""?!0:!(t!=null&&t.match(/\d/))&&!(n!=null&&n.match(/\d/))&&typeof e=="string"&&!isNaN(Number(e))}function e7(e,t,n){var r;t===void 0&&(t=A4(e));var i=n.allowNegative,a=n.prefix;a===void 0&&(a="");var o=n.suffix;o===void 0&&(o="");var s=n.decimalScale,l=t.from,u=t.to,c=u.start,d=u.end,f=xu(n),h=f.allowedDecimalSeparators,g=f.decimalSeparator,m=e[d]===g;if(yi(e)&&(e===a||e===o)&&t.lastValue==="")return e;if(d-c===1&&h.indexOf(e[c])!==-1){var p=s===0?"":g;e=e.substring(0,c)+p+e.substring(c+1,e.length)}var b=function(R,V,H){var L=!1,Z=!1;a.startsWith("-")?L=!1:R.startsWith("--")?(L=!1,Z=!0):o.startsWith("-")&&R.length===o.length?L=!1:R[0]==="-"&&(L=!0);var O=L?1:0;return Z&&(O=2),O&&(R=R.substring(O),V-=O,H-=O),{value:R,start:V,end:H,hasNegation:L}},v=b(e,c,d),y=v.hasNegation;r=v,e=r.value,c=r.start,d=r.end;var C=b(t.lastValue,l.start,l.end),w=C.start,I=C.end,E=C.value,D=e.substring(c,d);e.length&&E.length&&(w>E.length-o.length||I<a.length)&&!(D&&o.startsWith(D))&&(e=E);var $=0;e.startsWith(a)?$+=a.length:c<a.length&&($=c),e=e.substring($),d-=$;var F=e.length,_=e.length-o.length;e.endsWith(o)?F=_:(d>_||d>e.length-o.length)&&(F=d),e=e.substring(0,F),e=KF(y?"-"+e:e,i),e=(e.match(QF(g))||[]).join("");var P=e.indexOf(g);e=e.replace(new RegExp(E4(g),"g"),function(R,V){return V===P?".":""});var k=nh(e,i),A=k.beforeDecimal,B=k.afterDecimal,T=k.addNegation;return u.end-u.start<l.end-l.start&&A===""&&m&&!parseFloat(B)&&(e=T?"-":""),e}function t7(e,t){var n=t.prefix;n===void 0&&(n="");var r=t.suffix;r===void 0&&(r="");var i=Array.from({length:e.length+1}).map(function(){return!0}),a=e[0]==="-";i.fill(!1,0,n.length+(a?1:0));var o=e.length;return i.fill(!1,o-r.length+1,o+1),i}function n7(e){var t=xu(e),n=t.thousandSeparator,r=t.decimalSeparator,i=e.prefix;i===void 0&&(i="");var a=e.allowNegative;if(a===void 0&&(a=!0),n===r)throw new Error(`
|
133
133
|
Decimal separator can't be same as thousand separator.
|
134
134
|
thousandSeparator: `+n+` (thousandSeparator = {true} is same as thousandSeparator = ",")
|
135
135
|
decimalSeparator: `+r+` (default value for decimalSeparator is .)
|
@@ -164,18 +164,18 @@ You should wrap it with \`css\` like this:
|
|
164
164
|
* https://www.chartjs.org
|
165
165
|
* (c) 2024 Chart.js Contributors
|
166
166
|
* Released under the MIT License
|
167
|
-
*/function Un(){}const J7=(()=>{let e=0;return()=>e++})();function Je(e){return e===null||typeof e>"u"}function at(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 Re(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function xt(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function Qt(e,t){return xt(e)?e:t}function Ce(e,t){return typeof e>"u"?t:e}const K7=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,N4=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function Ze(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function He(e,t,n,r){let i,a,o;if(at(e))for(a=e.length,i=0;i<a;i++)t.call(n,e[i],i);else if(Re(e))for(o=Object.keys(e),a=o.length,i=0;i<a;i++)t.call(n,e[o[i]],o[i])}function Ol(e,t){let n,r,i,a;if(!e||!t||e.length!==t.length)return!1;for(n=0,r=e.length;n<r;++n)if(i=e[n],a=t[n],i.datasetIndex!==a.datasetIndex||i.index!==a.index)return!1;return!0}function Nl(e){if(at(e))return e.map(Nl);if(Re(e)){const t=Object.create(null),n=Object.keys(e),r=n.length;let i=0;for(;i<r;++i)t[n[i]]=Nl(e[n[i]]);return t}return e}function L4(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function Q7(e,t,n,r){if(!L4(e))return;const i=t[e],a=n[e];Re(i)&&Re(a)?Ro(i,a,r):t[e]=Nl(a)}function Ro(e,t,n){const r=at(t)?t:[t],i=r.length;if(!Re(e))return e;n=n||{};const a=n.merger||Q7;let o;for(let s=0;s<i;++s){if(o=r[s],!Re(o))continue;const l=Object.keys(o);for(let u=0,c=l.length;u<c;++u)a(l[u],e,o,n)}return e}function Ua(e,t){return Ro(e,t,{merger:q7})}function q7(e,t,n){if(!L4(e))return;const r=t[e],i=n[e];Re(r)&&Re(i)?Ua(r,i):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=Nl(i))}const rp={"":e=>e,x:e=>e.x,y:e=>e.y};function eP(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 tP(e){const t=eP(e);return n=>{for(const r of t){if(r==="")break;n=n&&n[r]}return n}}function Ao(e,t){return(rp[t]||(rp[t]=tP(t)))(e)}function oh(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Ll=e=>typeof e<"u",Mr=e=>typeof e=="function",ip=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function nP(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const Qe=Math.PI,Ke=2*Qe,rP=Ke+Qe,jl=Number.POSITIVE_INFINITY,iP=Qe/180,dt=Qe/2,Zr=Qe/4,ap=Qe*2/3,_r=Math.log10,da=Math.sign;function Ja(e,t,n){return Math.abs(e-t)<n}function op(e){const t=Math.round(e);e=Ja(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(_r(e))),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function aP(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,a)=>i-a).pop(),t}function Hl(e){return!isNaN(parseFloat(e))&&isFinite(e)}function oP(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function j4(e,t,n){let r,i,a;for(r=0,i=e.length;r<i;r++)a=e[r][n],isNaN(a)||(t.min=Math.min(t.min,a),t.max=Math.max(t.max,a))}function Nn(e){return e*(Qe/180)}function sh(e){return e*(180/Qe)}function sp(e){if(!xt(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function H4(e,t){const n=t.x-e.x,r=t.y-e.y,i=Math.sqrt(n*n+r*r);let a=Math.atan2(r,n);return a<-.5*Qe&&(a+=Ke),{angle:a,distance:i}}function Id(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function sP(e,t){return(e-t+rP)%Ke-Qe}function Cn(e){return(e%Ke+Ke)%Ke}function Fo(e,t,n,r){const i=Cn(e),a=Cn(t),o=Cn(n),s=Cn(a-i),l=Cn(o-i),u=Cn(i-a),c=Cn(i-o);return i===a||i===o||r&&a===o||s>l&&u<c}function tn(e,t,n){return Math.max(t,Math.min(n,e))}function lP(e){return tn(e,-32768,32767)}function Xi(e,t,n,r=1e-6){return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function lh(e,t,n){n=n||(o=>e[o]<t);let r=e.length-1,i=0,a;for(;r-i>1;)a=i+r>>1,n(a)?i=a:r=a;return{lo:i,hi:r}}const Ed=(e,t,n,r)=>lh(e,n,r?i=>{const a=e[i][t];return a<n||a===n&&e[i+1][t]===n}:i=>e[i][t]<n),uP=(e,t,n)=>lh(e,n,r=>e[r][t]>=n);function cP(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 W4=["push","pop","shift","splice","unshift"];function dP(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),W4.forEach(n=>{const r="_onData"+oh(n),i=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...a){const o=i.apply(this,a);return e._chartjs.listeners.forEach(s=>{typeof s[r]=="function"&&s[r](...a)}),o}})})}function lp(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)&&(W4.forEach(a=>{delete e[a]}),delete e._chartjs)}function fP(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const z4=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function G4(e,t){let n=[],r=!1;return function(...i){n=i,r||(r=!0,z4.call(window,()=>{r=!1,e.apply(t,n)}))}}function hP(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}const uh=e=>e==="start"?"left":e==="end"?"right":"center",_t=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,gP=(e,t,n,r)=>e===(r?"left":"right")?n:e==="center"?(t+n)/2:t,Ss=e=>e===0||e===1,up=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*Ke/n)),cp=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*Ke/n)+1,Ka={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*dt)+1,easeOutSine:e=>Math.sin(e*dt),easeInOutSine:e=>-.5*(Math.cos(Qe*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=>Ss(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=>Ss(e)?e:up(e,.075,.3),easeOutElastic:e=>Ss(e)?e:cp(e,.075,.3),easeInOutElastic(e){return Ss(e)?e:e<.5?.5*up(e*2,.1125,.45):.5+.5*cp(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-Ka.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?Ka.easeInBounce(e*2)*.5:Ka.easeOutBounce(e*2-1)*.5+.5};function ch(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function dp(e){return ch(e)?e:new $o(e)}function xc(e){return ch(e)?e:new $o(e).saturate(.5).darken(.1).hexString()}const mP=["x","y","borderWidth","radius","tension"],pP=["color","borderColor","backgroundColor"];function bP(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:pP},numbers:{type:"number",properties:mP}}),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 vP(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const fp=new Map;function yP(e,t){t=t||{};const n=e+JSON.stringify(t);let r=fp.get(n);return r||(r=new Intl.NumberFormat(e,t),fp.set(n,r)),r}function Cu(e,t,n){return yP(t,n).format(e)}const Z4={values(e){return at(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const r=this.chart.options.locale;let i,a=e;if(n.length>1){const u=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(u<1e-4||u>1e15)&&(i="scientific"),a=xP(e,n)}const o=_r(Math.abs(a)),s=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:i,minimumFractionDigits:s,maximumFractionDigits:s};return Object.assign(l,this.options.ticks.format),Cu(e,r,l)},logarithmic(e,t,n){if(e===0)return"0";const r=n[t].significand||e/Math.pow(10,Math.floor(_r(e)));return[1,2,3,5,10,15].includes(r)||t>.8*n.length?Z4.numeric.call(this,e,t,n):""}};function xP(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 wu={formatters:Z4};function CP(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:wu.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 xi=Object.create(null),_d=Object.create(null);function Qa(e,t){if(!t)return e;const n=t.split(".");for(let r=0,i=n.length;r<i;++r){const a=n[r];e=e[a]||(e[a]=Object.create(null))}return e}function Cc(e,t,n){return typeof t=="string"?Ro(Qa(e,t),n):Ro(Qa(e,""),t)}class wP{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)=>xc(i.backgroundColor),this.hoverBorderColor=(r,i)=>xc(i.borderColor),this.hoverColor=(r,i)=>xc(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 Cc(this,t,n)}get(t){return Qa(this,t)}describe(t,n){return Cc(_d,t,n)}override(t,n){return Cc(xi,t,n)}route(t,n,r,i){const a=Qa(this,t),o=Qa(this,r),s="_"+n;Object.defineProperties(a,{[s]:{value:a[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[s],u=o[i];return Re(l)?Object.assign({},u,l):Ce(l,u)},set(l){this[s]=l}}})}apply(t){t.forEach(n=>n(this))}}var ot=new wP({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[bP,vP,CP]);function DP(e){return!e||Je(e.size)||Je(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function Wl(e,t,n,r,i){let a=t[i];return a||(a=t[i]=e.measureText(i).width,n.push(i)),a>r&&(r=a),r}function SP(e,t,n,r){r=r||{};let i=r.data=r.data||{},a=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(i=r.data={},a=r.garbageCollect=[],r.font=t),e.save(),e.font=t;let o=0;const s=n.length;let l,u,c,d,f;for(l=0;l<s;l++)if(d=n[l],d!=null&&!at(d))o=Wl(e,i,a,o,d);else if(at(d))for(u=0,c=d.length;u<c;u++)f=d[u],f!=null&&!at(f)&&(o=Wl(e,i,a,o,f));e.restore();const h=a.length/2;if(h>n.length){for(l=0;l<h;l++)delete i[a[l]];a.splice(0,h)}return o}function Xr(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 hp(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function $d(e,t,n,r){X4(e,t,n,r,null)}function X4(e,t,n,r,i){let a,o,s,l,u,c,d,f;const h=t.pointStyle,g=t.rotation,m=t.radius;let p=(g||0)*iP;if(h&&typeof h=="object"&&(a=h.toString(),a==="[object HTMLImageElement]"||a==="[object HTMLCanvasElement]")){e.save(),e.translate(n,r),e.rotate(p),e.drawImage(h,-h.width/2,-h.height/2,h.width,h.height),e.restore();return}if(!(isNaN(m)||m<=0)){switch(e.beginPath(),h){default:i?e.ellipse(n,r,i/2,m,0,0,Ke):e.arc(n,r,m,0,Ke),e.closePath();break;case"triangle":c=i?i/2:m,e.moveTo(n+Math.sin(p)*c,r-Math.cos(p)*m),p+=ap,e.lineTo(n+Math.sin(p)*c,r-Math.cos(p)*m),p+=ap,e.lineTo(n+Math.sin(p)*c,r-Math.cos(p)*m),e.closePath();break;case"rectRounded":u=m*.516,l=m-u,o=Math.cos(p+Zr)*l,d=Math.cos(p+Zr)*(i?i/2-u:l),s=Math.sin(p+Zr)*l,f=Math.sin(p+Zr)*(i?i/2-u:l),e.arc(n-d,r-s,u,p-Qe,p-dt),e.arc(n+f,r-o,u,p-dt,p),e.arc(n+d,r+s,u,p,p+dt),e.arc(n-f,r+o,u,p+dt,p+Qe),e.closePath();break;case"rect":if(!g){l=Math.SQRT1_2*m,c=i?i/2:l,e.rect(n-c,r-l,2*c,2*l);break}p+=Zr;case"rectRot":d=Math.cos(p)*(i?i/2:m),o=Math.cos(p)*m,s=Math.sin(p)*m,f=Math.sin(p)*(i?i/2:m),e.moveTo(n-d,r-s),e.lineTo(n+f,r-o),e.lineTo(n+d,r+s),e.lineTo(n-f,r+o),e.closePath();break;case"crossRot":p+=Zr;case"cross":d=Math.cos(p)*(i?i/2:m),o=Math.cos(p)*m,s=Math.sin(p)*m,f=Math.sin(p)*(i?i/2:m),e.moveTo(n-d,r-s),e.lineTo(n+d,r+s),e.moveTo(n+f,r-o),e.lineTo(n-f,r+o);break;case"star":d=Math.cos(p)*(i?i/2:m),o=Math.cos(p)*m,s=Math.sin(p)*m,f=Math.sin(p)*(i?i/2:m),e.moveTo(n-d,r-s),e.lineTo(n+d,r+s),e.moveTo(n+f,r-o),e.lineTo(n-f,r+o),p+=Zr,d=Math.cos(p)*(i?i/2:m),o=Math.cos(p)*m,s=Math.sin(p)*m,f=Math.sin(p)*(i?i/2:m),e.moveTo(n-d,r-s),e.lineTo(n+d,r+s),e.moveTo(n+f,r-o),e.lineTo(n-f,r+o);break;case"line":o=i?i/2:Math.cos(p)*m,s=Math.sin(p)*m,e.moveTo(n-o,r-s),e.lineTo(n+o,r+s);break;case"dash":e.moveTo(n,r),e.lineTo(n+Math.cos(p)*(i?i/2:m),r+Math.sin(p)*m);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function lr(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 dh(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function fh(e){e.restore()}function IP(e,t,n,r,i){if(!t)return e.lineTo(n.x,n.y);if(i==="middle"){const a=(t.x+n.x)/2;e.lineTo(a,t.y),e.lineTo(a,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 EP(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 _P(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),Je(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 $P(e,t,n,r,i){if(i.strikethrough||i.underline){const a=e.measureText(r),o=t-a.actualBoundingBoxLeft,s=t+a.actualBoundingBoxRight,l=n-a.actualBoundingBoxAscent,u=n+a.actualBoundingBoxDescent,c=i.strikethrough?(l+u)/2:u;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=i.decorationWidth||2,e.moveTo(o,c),e.lineTo(s,c),e.stroke()}}function RP(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function Ci(e,t,n,r,i,a={}){const o=at(t)?t:[t],s=a.strokeWidth>0&&a.strokeColor!=="";let l,u;for(e.save(),e.font=i.string,_P(e,a),l=0;l<o.length;++l)u=o[l],a.backdrop&&RP(e,a.backdrop),s&&(a.strokeColor&&(e.strokeStyle=a.strokeColor),Je(a.strokeWidth)||(e.lineWidth=a.strokeWidth),e.strokeText(u,n,r,a.maxWidth)),e.fillText(u,n,r,a.maxWidth),$P(e,n,r,u,a),r+=Number(i.lineHeight);e.restore()}function zl(e,t){const{x:n,y:r,w:i,h:a,radius:o}=t;e.arc(n+o.topLeft,r+o.topLeft,o.topLeft,1.5*Qe,Qe,!0),e.lineTo(n,r+a-o.bottomLeft),e.arc(n+o.bottomLeft,r+a-o.bottomLeft,o.bottomLeft,Qe,dt,!0),e.lineTo(n+i-o.bottomRight,r+a),e.arc(n+i-o.bottomRight,r+a-o.bottomRight,o.bottomRight,dt,0,!0),e.lineTo(n+i,r+o.topRight),e.arc(n+i-o.topRight,r+o.topRight,o.topRight,0,-dt,!0),e.lineTo(n+o.topLeft,r)}const AP=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,FP=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function PP(e,t){const n=(""+e).match(AP);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 TP=e=>+e||0;function hh(e,t){const n={},r=Re(t),i=r?Object.keys(t):t,a=Re(e)?r?o=>Ce(e[o],e[t[o]]):o=>e[o]:()=>e;for(const o of i)n[o]=TP(a(o));return n}function kP(e){return hh(e,{top:"y",right:"x",bottom:"y",left:"x"})}function na(e){return hh(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Ft(e){const t=kP(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function pt(e,t){e=e||{},t=t||ot.font;let n=Ce(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let r=Ce(e.style,t.style);r&&!(""+r).match(FP)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const i={family:Ce(e.family,t.family),lineHeight:PP(Ce(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:Ce(e.weight,t.weight),string:""};return i.string=DP(i),i}function Is(e,t,n,r){let i,a,o;for(i=0,a=e.length;i<a;++i)if(o=e[i],o!==void 0&&o!==void 0)return o}function MP(e,t,n){const{min:r,max:i}=e,a=N4(t,(i-r)/2),o=(s,l)=>n&&s===0?0:s+l;return{min:o(r,-Math.abs(a)),max:o(i,a)}}function Lr(e,t){return Object.assign(Object.create(e),t)}function gh(e,t=[""],n,r,i=()=>e[0]){const a=n||e;typeof r>"u"&&(r=K4("_fallback",e));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:a,_fallback:r,_getTarget:i,override:s=>gh([s,...e],t,a,r)};return new Proxy(o,{deleteProperty(s,l){return delete s[l],delete s._keys,delete e[0][l],!0},get(s,l){return U4(s,l,()=>WP(l,t,e,s))},getOwnPropertyDescriptor(s,l){return Reflect.getOwnPropertyDescriptor(s._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(s,l){return mp(s).includes(l)},ownKeys(s){return mp(s)},set(s,l,u){const c=s._storage||(s._storage=i());return s[l]=c[l]=u,delete s._keys,!0}})}function fa(e,t,n,r){const i={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:Y4(e,r),setContext:a=>fa(e,a,n,r),override:a=>fa(e.override(a),t,n,r)};return new Proxy(i,{deleteProperty(a,o){return delete a[o],delete e[o],!0},get(a,o,s){return U4(a,o,()=>VP(a,o,s))},getOwnPropertyDescriptor(a,o){return a._descriptors.allKeys?Reflect.has(e,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,o)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(a,o){return Reflect.has(e,o)},ownKeys(){return Reflect.ownKeys(e)},set(a,o,s){return e[o]=s,delete a[o],!0}})}function Y4(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:Mr(n)?n:()=>n,isIndexable:Mr(r)?r:()=>r}}const BP=(e,t)=>e?e+oh(t):t,mh=(e,t)=>Re(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function U4(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const r=n();return e[t]=r,r}function VP(e,t,n){const{_proxy:r,_context:i,_subProxy:a,_descriptors:o}=e;let s=r[t];return Mr(s)&&o.isScriptable(t)&&(s=OP(t,s,e,n)),at(s)&&s.length&&(s=NP(t,s,e,o.isIndexable)),mh(t,s)&&(s=fa(s,i,a&&a[t],o)),s}function OP(e,t,n,r){const{_proxy:i,_context:a,_subProxy:o,_stack:s}=n;if(s.has(e))throw new Error("Recursion detected: "+Array.from(s).join("->")+"->"+e);s.add(e);let l=t(a,o||r);return s.delete(e),mh(e,l)&&(l=ph(i._scopes,i,e,l)),l}function NP(e,t,n,r){const{_proxy:i,_context:a,_subProxy:o,_descriptors:s}=n;if(typeof a.index<"u"&&r(e))return t[a.index%t.length];if(Re(t[0])){const l=t,u=i._scopes.filter(c=>c!==l);t=[];for(const c of l){const d=ph(u,i,e,c);t.push(fa(d,a,o&&o[e],s))}}return t}function J4(e,t,n){return Mr(e)?e(t,n):e}const LP=(e,t)=>e===!0?t:typeof e=="string"?Ao(t,e):void 0;function jP(e,t,n,r,i){for(const a of t){const o=LP(n,a);if(o){e.add(o);const s=J4(o._fallback,n,i);if(typeof s<"u"&&s!==n&&s!==r)return s}else if(o===!1&&typeof r<"u"&&n!==r)return null}return!1}function ph(e,t,n,r){const i=t._rootScopes,a=J4(t._fallback,n,r),o=[...e,...i],s=new Set;s.add(r);let l=gp(s,o,n,a||n,r);return l===null||typeof a<"u"&&a!==n&&(l=gp(s,o,a,l,r),l===null)?!1:gh(Array.from(s),[""],i,a,()=>HP(t,n,r))}function gp(e,t,n,r,i){for(;n;)n=jP(e,t,n,r,i);return n}function HP(e,t,n){const r=e._getTarget();t in r||(r[t]={});const i=r[t];return at(i)&&Re(n)?n:i||{}}function WP(e,t,n,r){let i;for(const a of t)if(i=K4(BP(a,e),n),typeof i<"u")return mh(e,i)?ph(n,r,e,i):i}function K4(e,t){for(const n of t){if(!n)continue;const r=n[e];if(typeof r<"u")return r}}function mp(e){let t=e._keys;return t||(t=e._keys=zP(e._scopes)),t}function zP(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)}const GP=Number.EPSILON||1e-14,ha=(e,t)=>t<e.length&&!e[t].skip&&e[t],Q4=e=>e==="x"?"y":"x";function ZP(e,t,n,r){const i=e.skip?t:e,a=t,o=n.skip?t:n,s=Id(a,i),l=Id(o,a);let u=s/(s+l),c=l/(s+l);u=isNaN(u)?0:u,c=isNaN(c)?0:c;const d=r*u,f=r*c;return{previous:{x:a.x-d*(o.x-i.x),y:a.y-d*(o.y-i.y)},next:{x:a.x+f*(o.x-i.x),y:a.y+f*(o.y-i.y)}}}function XP(e,t,n){const r=e.length;let i,a,o,s,l,u=ha(e,0);for(let c=0;c<r-1;++c)if(l=u,u=ha(e,c+1),!(!l||!u)){if(Ja(t[c],0,GP)){n[c]=n[c+1]=0;continue}i=n[c]/t[c],a=n[c+1]/t[c],s=Math.pow(i,2)+Math.pow(a,2),!(s<=9)&&(o=3/Math.sqrt(s),n[c]=i*o*t[c],n[c+1]=a*o*t[c])}}function YP(e,t,n="x"){const r=Q4(n),i=e.length;let a,o,s,l=ha(e,0);for(let u=0;u<i;++u){if(o=s,s=l,l=ha(e,u+1),!s)continue;const c=s[n],d=s[r];o&&(a=(c-o[n])/3,s[`cp1${n}`]=c-a,s[`cp1${r}`]=d-a*t[u]),l&&(a=(l[n]-c)/3,s[`cp2${n}`]=c+a,s[`cp2${r}`]=d+a*t[u])}}function UP(e,t="x"){const n=Q4(t),r=e.length,i=Array(r).fill(0),a=Array(r);let o,s,l,u=ha(e,0);for(o=0;o<r;++o)if(s=l,l=u,u=ha(e,o+1),!!l){if(u){const c=u[t]-l[t];i[o]=c!==0?(u[n]-l[n])/c:0}a[o]=s?u?da(i[o-1])!==da(i[o])?0:(i[o-1]+i[o])/2:i[o-1]:i[o]}XP(e,i,a),YP(e,a,t)}function Es(e,t,n){return Math.max(Math.min(e,n),t)}function JP(e,t){let n,r,i,a,o,s=lr(e[0],t);for(n=0,r=e.length;n<r;++n)o=a,a=s,s=n<r-1&&lr(e[n+1],t),a&&(i=e[n],o&&(i.cp1x=Es(i.cp1x,t.left,t.right),i.cp1y=Es(i.cp1y,t.top,t.bottom)),s&&(i.cp2x=Es(i.cp2x,t.left,t.right),i.cp2y=Es(i.cp2y,t.top,t.bottom)))}function KP(e,t,n,r,i){let a,o,s,l;if(t.spanGaps&&(e=e.filter(u=>!u.skip)),t.cubicInterpolationMode==="monotone")UP(e,i);else{let u=r?e[e.length-1]:e[0];for(a=0,o=e.length;a<o;++a)s=e[a],l=ZP(u,s,e[Math.min(a+1,o-(r?0:1))%o],t.tension),s.cp1x=l.previous.x,s.cp1y=l.previous.y,s.cp2x=l.next.x,s.cp2y=l.next.y,u=s}t.capBezierPoints&&JP(e,n)}function bh(){return typeof window<"u"&&typeof document<"u"}function vh(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Gl(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 Du=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function QP(e,t){return Du(e).getPropertyValue(t)}const qP=["top","right","bottom","left"];function di(e,t,n){const r={};n=n?"-"+n:"";for(let i=0;i<4;i++){const a=qP[i];r[a]=parseFloat(e[t+"-"+a+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const eT=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function tT(e,t){const n=e.touches,r=n&&n.length?n[0]:e,{offsetX:i,offsetY:a}=r;let o=!1,s,l;if(eT(i,a,e.target))s=i,l=a;else{const u=t.getBoundingClientRect();s=r.clientX-u.left,l=r.clientY-u.top,o=!0}return{x:s,y:l,box:o}}function qr(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:r}=t,i=Du(n),a=i.boxSizing==="border-box",o=di(i,"padding"),s=di(i,"border","width"),{x:l,y:u,box:c}=tT(e,n),d=o.left+(c&&s.left),f=o.top+(c&&s.top);let{width:h,height:g}=t;return a&&(h-=o.width+s.width,g-=o.height+s.height),{x:Math.round((l-d)/h*n.width/r),y:Math.round((u-f)/g*n.height/r)}}function nT(e,t,n){let r,i;if(t===void 0||n===void 0){const a=e&&vh(e);if(!a)t=e.clientWidth,n=e.clientHeight;else{const o=a.getBoundingClientRect(),s=Du(a),l=di(s,"border","width"),u=di(s,"padding");t=o.width-u.width-l.width,n=o.height-u.height-l.height,r=Gl(s.maxWidth,a,"clientWidth"),i=Gl(s.maxHeight,a,"clientHeight")}}return{width:t,height:n,maxWidth:r||jl,maxHeight:i||jl}}const _s=e=>Math.round(e*10)/10;function rT(e,t,n,r){const i=Du(e),a=di(i,"margin"),o=Gl(i.maxWidth,e,"clientWidth")||jl,s=Gl(i.maxHeight,e,"clientHeight")||jl,l=nT(e,t,n);let{width:u,height:c}=l;if(i.boxSizing==="content-box"){const f=di(i,"border","width"),h=di(i,"padding");u-=h.width+f.width,c-=h.height+f.height}return u=Math.max(0,u-a.width),c=Math.max(0,r?u/r:c-a.height),u=_s(Math.min(u,o,l.maxWidth)),c=_s(Math.min(c,s,l.maxHeight)),u&&!c&&(c=_s(u/2)),(t!==void 0||n!==void 0)&&r&&l.height&&c>l.height&&(c=l.height,u=_s(Math.floor(c*r))),{width:u,height:c}}function pp(e,t,n){const r=t||1,i=Math.floor(e.height*r),a=Math.floor(e.width*r);e.height=Math.floor(e.height),e.width=Math.floor(e.width);const o=e.canvas;return o.style&&(n||!o.style.height&&!o.style.width)&&(o.style.height=`${e.height}px`,o.style.width=`${e.width}px`),e.currentDevicePixelRatio!==r||o.height!==i||o.width!==a?(e.currentDevicePixelRatio=r,o.height=i,o.width=a,e.ctx.setTransform(r,0,0,r,0,0),!0):!1}const iT=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};bh()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function bp(e,t){const n=QP(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function ei(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function aT(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 oT(e,t,n,r){const i={x:e.cp2x,y:e.cp2y},a={x:t.cp1x,y:t.cp1y},o=ei(e,i,n),s=ei(i,a,n),l=ei(a,t,n),u=ei(o,s,n),c=ei(s,l,n);return ei(u,c,n)}const sT=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}}},lT=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function ra(e,t,n){return e?sT(t,n):lT()}function q4(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 e3(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function t3(e){return e==="angle"?{between:Fo,compare:sP,normalize:Cn}:{between:Xi,compare:(t,n)=>t-n,normalize:t=>t}}function vp({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 uT(e,t,n){const{property:r,start:i,end:a}=n,{between:o,normalize:s}=t3(r),l=t.length;let{start:u,end:c,loop:d}=e,f,h;if(d){for(u+=l,c+=l,f=0,h=l;f<h&&o(s(t[u%l][r]),i,a);++f)u--,c--;u%=l,c%=l}return c<u&&(c+=l),{start:u,end:c,loop:d,style:e.style}}function cT(e,t,n){if(!n)return[e];const{property:r,start:i,end:a}=n,o=t.length,{compare:s,between:l,normalize:u}=t3(r),{start:c,end:d,loop:f,style:h}=uT(e,t,n),g=[];let m=!1,p=null,b,v,y;const C=()=>l(i,y,b)&&s(i,y)!==0,w=()=>s(a,b)===0||l(a,y,b),I=()=>m||C(),E=()=>!m||w();for(let D=c,$=c;D<=d;++D)v=t[D%o],!v.skip&&(b=u(v[r]),b!==y&&(m=l(b,i,a),p===null&&I()&&(p=s(b,i)===0?D:$),p!==null&&E()&&(g.push(vp({start:p,end:D,loop:f,count:o,style:h})),p=null),$=D,y=b));return p!==null&&g.push(vp({start:p,end:d,loop:f,count:o,style:h})),g}function dT(e,t){const n=[],r=e.segments;for(let i=0;i<r.length;i++){const a=cT(r[i],e.points,t);a.length&&n.push(...a)}return n}function fT(e,t,n,r){let i=0,a=t-1;if(n&&!r)for(;i<t&&!e[i].skip;)i++;for(;i<t&&e[i].skip;)i++;for(i%=t,n&&(a+=i);a>i&&e[a%t].skip;)a--;return a%=t,{start:i,end:a}}function hT(e,t,n,r){const i=e.length,a=[];let o=t,s=e[t],l;for(l=t+1;l<=n;++l){const u=e[l%i];u.skip||u.stop?s.skip||(r=!1,a.push({start:t%i,end:(l-1)%i,loop:r}),t=o=u.stop?l:null):(o=l,s.skip&&(t=l)),s=u}return o!==null&&a.push({start:t%i,end:o%i,loop:r}),a}function gT(e,t){const n=e.points,r=e.options.spanGaps,i=n.length;if(!i)return[];const a=!!e._loop,{start:o,end:s}=fT(n,i,a,r);if(r===!0)return yp(e,[{start:o,end:s,loop:a}],n,t);const l=s<o?s+i:s,u=!!e._fullLoop&&o===0&&s===i-1;return yp(e,hT(n,o,l,u),n,t)}function yp(e,t,n,r){return!r||!r.setContext||!n?t:mT(e,t,n,r)}function mT(e,t,n,r){const i=e._chart.getContext(),a=xp(e.options),{_datasetIndex:o,options:{spanGaps:s}}=e,l=n.length,u=[];let c=a,d=t[0].start,f=d;function h(g,m,p,b){const v=s?-1:1;if(g!==m){for(g+=l;n[g%l].skip;)g-=v;for(;n[m%l].skip;)m+=v;g%l!==m%l&&(u.push({start:g%l,end:m%l,loop:p,style:b}),c=b,d=m%l)}}for(const g of t){d=s?d:g.start;let m=n[d%l],p;for(f=d+1;f<=g.end;f++){const b=n[f%l];p=xp(r.setContext(Lr(i,{type:"segment",p0:m,p1:b,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:o}))),pT(p,c)&&h(d,f-1,g.loop,c),m=b,c=p}d<f-1&&h(d,f-1,g.loop,c)}return u}function xp(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function pT(e,t){if(!t)return!1;const n=[],r=function(i,a){return ch(a)?(n.includes(a)||n.push(a),n.indexOf(a)):a};return JSON.stringify(e,r)!==JSON.stringify(t,r)}/*!
|
167
|
+
*/function Un(){}const J7=(()=>{let e=0;return()=>e++})();function Ke(e){return e===null||typeof e>"u"}function at(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 Re(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function xt(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function Qt(e,t){return xt(e)?e:t}function Ce(e,t){return typeof e>"u"?t:e}const K7=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,N4=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function Ze(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function He(e,t,n,r){let i,a,o;if(at(e))for(a=e.length,i=0;i<a;i++)t.call(n,e[i],i);else if(Re(e))for(o=Object.keys(e),a=o.length,i=0;i<a;i++)t.call(n,e[o[i]],o[i])}function Ol(e,t){let n,r,i,a;if(!e||!t||e.length!==t.length)return!1;for(n=0,r=e.length;n<r;++n)if(i=e[n],a=t[n],i.datasetIndex!==a.datasetIndex||i.index!==a.index)return!1;return!0}function Nl(e){if(at(e))return e.map(Nl);if(Re(e)){const t=Object.create(null),n=Object.keys(e),r=n.length;let i=0;for(;i<r;++i)t[n[i]]=Nl(e[n[i]]);return t}return e}function L4(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function Q7(e,t,n,r){if(!L4(e))return;const i=t[e],a=n[e];Re(i)&&Re(a)?Ro(i,a,r):t[e]=Nl(a)}function Ro(e,t,n){const r=at(t)?t:[t],i=r.length;if(!Re(e))return e;n=n||{};const a=n.merger||Q7;let o;for(let s=0;s<i;++s){if(o=r[s],!Re(o))continue;const l=Object.keys(o);for(let u=0,c=l.length;u<c;++u)a(l[u],e,o,n)}return e}function Ua(e,t){return Ro(e,t,{merger:q7})}function q7(e,t,n){if(!L4(e))return;const r=t[e],i=n[e];Re(r)&&Re(i)?Ua(r,i):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=Nl(i))}const rp={"":e=>e,x:e=>e.x,y:e=>e.y};function eP(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 tP(e){const t=eP(e);return n=>{for(const r of t){if(r==="")break;n=n&&n[r]}return n}}function Ao(e,t){return(rp[t]||(rp[t]=tP(t)))(e)}function oh(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Ll=e=>typeof e<"u",Mr=e=>typeof e=="function",ip=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function nP(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const qe=Math.PI,Qe=2*qe,rP=Qe+qe,jl=Number.POSITIVE_INFINITY,iP=qe/180,dt=qe/2,Zr=qe/4,ap=qe*2/3,_r=Math.log10,da=Math.sign;function Ja(e,t,n){return Math.abs(e-t)<n}function op(e){const t=Math.round(e);e=Ja(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(_r(e))),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function aP(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,a)=>i-a).pop(),t}function Hl(e){return!isNaN(parseFloat(e))&&isFinite(e)}function oP(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function j4(e,t,n){let r,i,a;for(r=0,i=e.length;r<i;r++)a=e[r][n],isNaN(a)||(t.min=Math.min(t.min,a),t.max=Math.max(t.max,a))}function Nn(e){return e*(qe/180)}function sh(e){return e*(180/qe)}function sp(e){if(!xt(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function H4(e,t){const n=t.x-e.x,r=t.y-e.y,i=Math.sqrt(n*n+r*r);let a=Math.atan2(r,n);return a<-.5*qe&&(a+=Qe),{angle:a,distance:i}}function Id(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function sP(e,t){return(e-t+rP)%Qe-qe}function Cn(e){return(e%Qe+Qe)%Qe}function Fo(e,t,n,r){const i=Cn(e),a=Cn(t),o=Cn(n),s=Cn(a-i),l=Cn(o-i),u=Cn(i-a),c=Cn(i-o);return i===a||i===o||r&&a===o||s>l&&u<c}function tn(e,t,n){return Math.max(t,Math.min(n,e))}function lP(e){return tn(e,-32768,32767)}function Xi(e,t,n,r=1e-6){return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function lh(e,t,n){n=n||(o=>e[o]<t);let r=e.length-1,i=0,a;for(;r-i>1;)a=i+r>>1,n(a)?i=a:r=a;return{lo:i,hi:r}}const Ed=(e,t,n,r)=>lh(e,n,r?i=>{const a=e[i][t];return a<n||a===n&&e[i+1][t]===n}:i=>e[i][t]<n),uP=(e,t,n)=>lh(e,n,r=>e[r][t]>=n);function cP(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 W4=["push","pop","shift","splice","unshift"];function dP(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),W4.forEach(n=>{const r="_onData"+oh(n),i=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...a){const o=i.apply(this,a);return e._chartjs.listeners.forEach(s=>{typeof s[r]=="function"&&s[r](...a)}),o}})})}function lp(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)&&(W4.forEach(a=>{delete e[a]}),delete e._chartjs)}function fP(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const z4=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function G4(e,t){let n=[],r=!1;return function(...i){n=i,r||(r=!0,z4.call(window,()=>{r=!1,e.apply(t,n)}))}}function hP(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}const uh=e=>e==="start"?"left":e==="end"?"right":"center",_t=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,gP=(e,t,n,r)=>e===(r?"left":"right")?n:e==="center"?(t+n)/2:t,Ss=e=>e===0||e===1,up=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*Qe/n)),cp=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*Qe/n)+1,Ka={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*dt)+1,easeOutSine:e=>Math.sin(e*dt),easeInOutSine:e=>-.5*(Math.cos(qe*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=>Ss(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=>Ss(e)?e:up(e,.075,.3),easeOutElastic:e=>Ss(e)?e:cp(e,.075,.3),easeInOutElastic(e){return Ss(e)?e:e<.5?.5*up(e*2,.1125,.45):.5+.5*cp(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-Ka.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?Ka.easeInBounce(e*2)*.5:Ka.easeOutBounce(e*2-1)*.5+.5};function ch(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function dp(e){return ch(e)?e:new $o(e)}function xc(e){return ch(e)?e:new $o(e).saturate(.5).darken(.1).hexString()}const mP=["x","y","borderWidth","radius","tension"],pP=["color","borderColor","backgroundColor"];function bP(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:pP},numbers:{type:"number",properties:mP}}),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 vP(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const fp=new Map;function yP(e,t){t=t||{};const n=e+JSON.stringify(t);let r=fp.get(n);return r||(r=new Intl.NumberFormat(e,t),fp.set(n,r)),r}function Cu(e,t,n){return yP(t,n).format(e)}const Z4={values(e){return at(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const r=this.chart.options.locale;let i,a=e;if(n.length>1){const u=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(u<1e-4||u>1e15)&&(i="scientific"),a=xP(e,n)}const o=_r(Math.abs(a)),s=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:i,minimumFractionDigits:s,maximumFractionDigits:s};return Object.assign(l,this.options.ticks.format),Cu(e,r,l)},logarithmic(e,t,n){if(e===0)return"0";const r=n[t].significand||e/Math.pow(10,Math.floor(_r(e)));return[1,2,3,5,10,15].includes(r)||t>.8*n.length?Z4.numeric.call(this,e,t,n):""}};function xP(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 wu={formatters:Z4};function CP(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:wu.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 xi=Object.create(null),_d=Object.create(null);function Qa(e,t){if(!t)return e;const n=t.split(".");for(let r=0,i=n.length;r<i;++r){const a=n[r];e=e[a]||(e[a]=Object.create(null))}return e}function Cc(e,t,n){return typeof t=="string"?Ro(Qa(e,t),n):Ro(Qa(e,""),t)}class wP{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)=>xc(i.backgroundColor),this.hoverBorderColor=(r,i)=>xc(i.borderColor),this.hoverColor=(r,i)=>xc(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 Cc(this,t,n)}get(t){return Qa(this,t)}describe(t,n){return Cc(_d,t,n)}override(t,n){return Cc(xi,t,n)}route(t,n,r,i){const a=Qa(this,t),o=Qa(this,r),s="_"+n;Object.defineProperties(a,{[s]:{value:a[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[s],u=o[i];return Re(l)?Object.assign({},u,l):Ce(l,u)},set(l){this[s]=l}}})}apply(t){t.forEach(n=>n(this))}}var ot=new wP({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[bP,vP,CP]);function DP(e){return!e||Ke(e.size)||Ke(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function Wl(e,t,n,r,i){let a=t[i];return a||(a=t[i]=e.measureText(i).width,n.push(i)),a>r&&(r=a),r}function SP(e,t,n,r){r=r||{};let i=r.data=r.data||{},a=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(i=r.data={},a=r.garbageCollect=[],r.font=t),e.save(),e.font=t;let o=0;const s=n.length;let l,u,c,d,f;for(l=0;l<s;l++)if(d=n[l],d!=null&&!at(d))o=Wl(e,i,a,o,d);else if(at(d))for(u=0,c=d.length;u<c;u++)f=d[u],f!=null&&!at(f)&&(o=Wl(e,i,a,o,f));e.restore();const h=a.length/2;if(h>n.length){for(l=0;l<h;l++)delete i[a[l]];a.splice(0,h)}return o}function Xr(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 hp(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function $d(e,t,n,r){X4(e,t,n,r,null)}function X4(e,t,n,r,i){let a,o,s,l,u,c,d,f;const h=t.pointStyle,g=t.rotation,m=t.radius;let p=(g||0)*iP;if(h&&typeof h=="object"&&(a=h.toString(),a==="[object HTMLImageElement]"||a==="[object HTMLCanvasElement]")){e.save(),e.translate(n,r),e.rotate(p),e.drawImage(h,-h.width/2,-h.height/2,h.width,h.height),e.restore();return}if(!(isNaN(m)||m<=0)){switch(e.beginPath(),h){default:i?e.ellipse(n,r,i/2,m,0,0,Qe):e.arc(n,r,m,0,Qe),e.closePath();break;case"triangle":c=i?i/2:m,e.moveTo(n+Math.sin(p)*c,r-Math.cos(p)*m),p+=ap,e.lineTo(n+Math.sin(p)*c,r-Math.cos(p)*m),p+=ap,e.lineTo(n+Math.sin(p)*c,r-Math.cos(p)*m),e.closePath();break;case"rectRounded":u=m*.516,l=m-u,o=Math.cos(p+Zr)*l,d=Math.cos(p+Zr)*(i?i/2-u:l),s=Math.sin(p+Zr)*l,f=Math.sin(p+Zr)*(i?i/2-u:l),e.arc(n-d,r-s,u,p-qe,p-dt),e.arc(n+f,r-o,u,p-dt,p),e.arc(n+d,r+s,u,p,p+dt),e.arc(n-f,r+o,u,p+dt,p+qe),e.closePath();break;case"rect":if(!g){l=Math.SQRT1_2*m,c=i?i/2:l,e.rect(n-c,r-l,2*c,2*l);break}p+=Zr;case"rectRot":d=Math.cos(p)*(i?i/2:m),o=Math.cos(p)*m,s=Math.sin(p)*m,f=Math.sin(p)*(i?i/2:m),e.moveTo(n-d,r-s),e.lineTo(n+f,r-o),e.lineTo(n+d,r+s),e.lineTo(n-f,r+o),e.closePath();break;case"crossRot":p+=Zr;case"cross":d=Math.cos(p)*(i?i/2:m),o=Math.cos(p)*m,s=Math.sin(p)*m,f=Math.sin(p)*(i?i/2:m),e.moveTo(n-d,r-s),e.lineTo(n+d,r+s),e.moveTo(n+f,r-o),e.lineTo(n-f,r+o);break;case"star":d=Math.cos(p)*(i?i/2:m),o=Math.cos(p)*m,s=Math.sin(p)*m,f=Math.sin(p)*(i?i/2:m),e.moveTo(n-d,r-s),e.lineTo(n+d,r+s),e.moveTo(n+f,r-o),e.lineTo(n-f,r+o),p+=Zr,d=Math.cos(p)*(i?i/2:m),o=Math.cos(p)*m,s=Math.sin(p)*m,f=Math.sin(p)*(i?i/2:m),e.moveTo(n-d,r-s),e.lineTo(n+d,r+s),e.moveTo(n+f,r-o),e.lineTo(n-f,r+o);break;case"line":o=i?i/2:Math.cos(p)*m,s=Math.sin(p)*m,e.moveTo(n-o,r-s),e.lineTo(n+o,r+s);break;case"dash":e.moveTo(n,r),e.lineTo(n+Math.cos(p)*(i?i/2:m),r+Math.sin(p)*m);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function lr(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 dh(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function fh(e){e.restore()}function IP(e,t,n,r,i){if(!t)return e.lineTo(n.x,n.y);if(i==="middle"){const a=(t.x+n.x)/2;e.lineTo(a,t.y),e.lineTo(a,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 EP(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 _P(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),Ke(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 $P(e,t,n,r,i){if(i.strikethrough||i.underline){const a=e.measureText(r),o=t-a.actualBoundingBoxLeft,s=t+a.actualBoundingBoxRight,l=n-a.actualBoundingBoxAscent,u=n+a.actualBoundingBoxDescent,c=i.strikethrough?(l+u)/2:u;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=i.decorationWidth||2,e.moveTo(o,c),e.lineTo(s,c),e.stroke()}}function RP(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function Ci(e,t,n,r,i,a={}){const o=at(t)?t:[t],s=a.strokeWidth>0&&a.strokeColor!=="";let l,u;for(e.save(),e.font=i.string,_P(e,a),l=0;l<o.length;++l)u=o[l],a.backdrop&&RP(e,a.backdrop),s&&(a.strokeColor&&(e.strokeStyle=a.strokeColor),Ke(a.strokeWidth)||(e.lineWidth=a.strokeWidth),e.strokeText(u,n,r,a.maxWidth)),e.fillText(u,n,r,a.maxWidth),$P(e,n,r,u,a),r+=Number(i.lineHeight);e.restore()}function zl(e,t){const{x:n,y:r,w:i,h:a,radius:o}=t;e.arc(n+o.topLeft,r+o.topLeft,o.topLeft,1.5*qe,qe,!0),e.lineTo(n,r+a-o.bottomLeft),e.arc(n+o.bottomLeft,r+a-o.bottomLeft,o.bottomLeft,qe,dt,!0),e.lineTo(n+i-o.bottomRight,r+a),e.arc(n+i-o.bottomRight,r+a-o.bottomRight,o.bottomRight,dt,0,!0),e.lineTo(n+i,r+o.topRight),e.arc(n+i-o.topRight,r+o.topRight,o.topRight,0,-dt,!0),e.lineTo(n+o.topLeft,r)}const AP=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,FP=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function PP(e,t){const n=(""+e).match(AP);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 TP=e=>+e||0;function hh(e,t){const n={},r=Re(t),i=r?Object.keys(t):t,a=Re(e)?r?o=>Ce(e[o],e[t[o]]):o=>e[o]:()=>e;for(const o of i)n[o]=TP(a(o));return n}function kP(e){return hh(e,{top:"y",right:"x",bottom:"y",left:"x"})}function na(e){return hh(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Ft(e){const t=kP(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function pt(e,t){e=e||{},t=t||ot.font;let n=Ce(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let r=Ce(e.style,t.style);r&&!(""+r).match(FP)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const i={family:Ce(e.family,t.family),lineHeight:PP(Ce(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:Ce(e.weight,t.weight),string:""};return i.string=DP(i),i}function Is(e,t,n,r){let i,a,o;for(i=0,a=e.length;i<a;++i)if(o=e[i],o!==void 0&&o!==void 0)return o}function MP(e,t,n){const{min:r,max:i}=e,a=N4(t,(i-r)/2),o=(s,l)=>n&&s===0?0:s+l;return{min:o(r,-Math.abs(a)),max:o(i,a)}}function Lr(e,t){return Object.assign(Object.create(e),t)}function gh(e,t=[""],n,r,i=()=>e[0]){const a=n||e;typeof r>"u"&&(r=K4("_fallback",e));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:a,_fallback:r,_getTarget:i,override:s=>gh([s,...e],t,a,r)};return new Proxy(o,{deleteProperty(s,l){return delete s[l],delete s._keys,delete e[0][l],!0},get(s,l){return U4(s,l,()=>WP(l,t,e,s))},getOwnPropertyDescriptor(s,l){return Reflect.getOwnPropertyDescriptor(s._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(s,l){return mp(s).includes(l)},ownKeys(s){return mp(s)},set(s,l,u){const c=s._storage||(s._storage=i());return s[l]=c[l]=u,delete s._keys,!0}})}function fa(e,t,n,r){const i={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:Y4(e,r),setContext:a=>fa(e,a,n,r),override:a=>fa(e.override(a),t,n,r)};return new Proxy(i,{deleteProperty(a,o){return delete a[o],delete e[o],!0},get(a,o,s){return U4(a,o,()=>VP(a,o,s))},getOwnPropertyDescriptor(a,o){return a._descriptors.allKeys?Reflect.has(e,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,o)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(a,o){return Reflect.has(e,o)},ownKeys(){return Reflect.ownKeys(e)},set(a,o,s){return e[o]=s,delete a[o],!0}})}function Y4(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:Mr(n)?n:()=>n,isIndexable:Mr(r)?r:()=>r}}const BP=(e,t)=>e?e+oh(t):t,mh=(e,t)=>Re(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function U4(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const r=n();return e[t]=r,r}function VP(e,t,n){const{_proxy:r,_context:i,_subProxy:a,_descriptors:o}=e;let s=r[t];return Mr(s)&&o.isScriptable(t)&&(s=OP(t,s,e,n)),at(s)&&s.length&&(s=NP(t,s,e,o.isIndexable)),mh(t,s)&&(s=fa(s,i,a&&a[t],o)),s}function OP(e,t,n,r){const{_proxy:i,_context:a,_subProxy:o,_stack:s}=n;if(s.has(e))throw new Error("Recursion detected: "+Array.from(s).join("->")+"->"+e);s.add(e);let l=t(a,o||r);return s.delete(e),mh(e,l)&&(l=ph(i._scopes,i,e,l)),l}function NP(e,t,n,r){const{_proxy:i,_context:a,_subProxy:o,_descriptors:s}=n;if(typeof a.index<"u"&&r(e))return t[a.index%t.length];if(Re(t[0])){const l=t,u=i._scopes.filter(c=>c!==l);t=[];for(const c of l){const d=ph(u,i,e,c);t.push(fa(d,a,o&&o[e],s))}}return t}function J4(e,t,n){return Mr(e)?e(t,n):e}const LP=(e,t)=>e===!0?t:typeof e=="string"?Ao(t,e):void 0;function jP(e,t,n,r,i){for(const a of t){const o=LP(n,a);if(o){e.add(o);const s=J4(o._fallback,n,i);if(typeof s<"u"&&s!==n&&s!==r)return s}else if(o===!1&&typeof r<"u"&&n!==r)return null}return!1}function ph(e,t,n,r){const i=t._rootScopes,a=J4(t._fallback,n,r),o=[...e,...i],s=new Set;s.add(r);let l=gp(s,o,n,a||n,r);return l===null||typeof a<"u"&&a!==n&&(l=gp(s,o,a,l,r),l===null)?!1:gh(Array.from(s),[""],i,a,()=>HP(t,n,r))}function gp(e,t,n,r,i){for(;n;)n=jP(e,t,n,r,i);return n}function HP(e,t,n){const r=e._getTarget();t in r||(r[t]={});const i=r[t];return at(i)&&Re(n)?n:i||{}}function WP(e,t,n,r){let i;for(const a of t)if(i=K4(BP(a,e),n),typeof i<"u")return mh(e,i)?ph(n,r,e,i):i}function K4(e,t){for(const n of t){if(!n)continue;const r=n[e];if(typeof r<"u")return r}}function mp(e){let t=e._keys;return t||(t=e._keys=zP(e._scopes)),t}function zP(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)}const GP=Number.EPSILON||1e-14,ha=(e,t)=>t<e.length&&!e[t].skip&&e[t],Q4=e=>e==="x"?"y":"x";function ZP(e,t,n,r){const i=e.skip?t:e,a=t,o=n.skip?t:n,s=Id(a,i),l=Id(o,a);let u=s/(s+l),c=l/(s+l);u=isNaN(u)?0:u,c=isNaN(c)?0:c;const d=r*u,f=r*c;return{previous:{x:a.x-d*(o.x-i.x),y:a.y-d*(o.y-i.y)},next:{x:a.x+f*(o.x-i.x),y:a.y+f*(o.y-i.y)}}}function XP(e,t,n){const r=e.length;let i,a,o,s,l,u=ha(e,0);for(let c=0;c<r-1;++c)if(l=u,u=ha(e,c+1),!(!l||!u)){if(Ja(t[c],0,GP)){n[c]=n[c+1]=0;continue}i=n[c]/t[c],a=n[c+1]/t[c],s=Math.pow(i,2)+Math.pow(a,2),!(s<=9)&&(o=3/Math.sqrt(s),n[c]=i*o*t[c],n[c+1]=a*o*t[c])}}function YP(e,t,n="x"){const r=Q4(n),i=e.length;let a,o,s,l=ha(e,0);for(let u=0;u<i;++u){if(o=s,s=l,l=ha(e,u+1),!s)continue;const c=s[n],d=s[r];o&&(a=(c-o[n])/3,s[`cp1${n}`]=c-a,s[`cp1${r}`]=d-a*t[u]),l&&(a=(l[n]-c)/3,s[`cp2${n}`]=c+a,s[`cp2${r}`]=d+a*t[u])}}function UP(e,t="x"){const n=Q4(t),r=e.length,i=Array(r).fill(0),a=Array(r);let o,s,l,u=ha(e,0);for(o=0;o<r;++o)if(s=l,l=u,u=ha(e,o+1),!!l){if(u){const c=u[t]-l[t];i[o]=c!==0?(u[n]-l[n])/c:0}a[o]=s?u?da(i[o-1])!==da(i[o])?0:(i[o-1]+i[o])/2:i[o-1]:i[o]}XP(e,i,a),YP(e,a,t)}function Es(e,t,n){return Math.max(Math.min(e,n),t)}function JP(e,t){let n,r,i,a,o,s=lr(e[0],t);for(n=0,r=e.length;n<r;++n)o=a,a=s,s=n<r-1&&lr(e[n+1],t),a&&(i=e[n],o&&(i.cp1x=Es(i.cp1x,t.left,t.right),i.cp1y=Es(i.cp1y,t.top,t.bottom)),s&&(i.cp2x=Es(i.cp2x,t.left,t.right),i.cp2y=Es(i.cp2y,t.top,t.bottom)))}function KP(e,t,n,r,i){let a,o,s,l;if(t.spanGaps&&(e=e.filter(u=>!u.skip)),t.cubicInterpolationMode==="monotone")UP(e,i);else{let u=r?e[e.length-1]:e[0];for(a=0,o=e.length;a<o;++a)s=e[a],l=ZP(u,s,e[Math.min(a+1,o-(r?0:1))%o],t.tension),s.cp1x=l.previous.x,s.cp1y=l.previous.y,s.cp2x=l.next.x,s.cp2y=l.next.y,u=s}t.capBezierPoints&&JP(e,n)}function bh(){return typeof window<"u"&&typeof document<"u"}function vh(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Gl(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 Du=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function QP(e,t){return Du(e).getPropertyValue(t)}const qP=["top","right","bottom","left"];function di(e,t,n){const r={};n=n?"-"+n:"";for(let i=0;i<4;i++){const a=qP[i];r[a]=parseFloat(e[t+"-"+a+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const eT=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function tT(e,t){const n=e.touches,r=n&&n.length?n[0]:e,{offsetX:i,offsetY:a}=r;let o=!1,s,l;if(eT(i,a,e.target))s=i,l=a;else{const u=t.getBoundingClientRect();s=r.clientX-u.left,l=r.clientY-u.top,o=!0}return{x:s,y:l,box:o}}function qr(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:r}=t,i=Du(n),a=i.boxSizing==="border-box",o=di(i,"padding"),s=di(i,"border","width"),{x:l,y:u,box:c}=tT(e,n),d=o.left+(c&&s.left),f=o.top+(c&&s.top);let{width:h,height:g}=t;return a&&(h-=o.width+s.width,g-=o.height+s.height),{x:Math.round((l-d)/h*n.width/r),y:Math.round((u-f)/g*n.height/r)}}function nT(e,t,n){let r,i;if(t===void 0||n===void 0){const a=e&&vh(e);if(!a)t=e.clientWidth,n=e.clientHeight;else{const o=a.getBoundingClientRect(),s=Du(a),l=di(s,"border","width"),u=di(s,"padding");t=o.width-u.width-l.width,n=o.height-u.height-l.height,r=Gl(s.maxWidth,a,"clientWidth"),i=Gl(s.maxHeight,a,"clientHeight")}}return{width:t,height:n,maxWidth:r||jl,maxHeight:i||jl}}const _s=e=>Math.round(e*10)/10;function rT(e,t,n,r){const i=Du(e),a=di(i,"margin"),o=Gl(i.maxWidth,e,"clientWidth")||jl,s=Gl(i.maxHeight,e,"clientHeight")||jl,l=nT(e,t,n);let{width:u,height:c}=l;if(i.boxSizing==="content-box"){const f=di(i,"border","width"),h=di(i,"padding");u-=h.width+f.width,c-=h.height+f.height}return u=Math.max(0,u-a.width),c=Math.max(0,r?u/r:c-a.height),u=_s(Math.min(u,o,l.maxWidth)),c=_s(Math.min(c,s,l.maxHeight)),u&&!c&&(c=_s(u/2)),(t!==void 0||n!==void 0)&&r&&l.height&&c>l.height&&(c=l.height,u=_s(Math.floor(c*r))),{width:u,height:c}}function pp(e,t,n){const r=t||1,i=Math.floor(e.height*r),a=Math.floor(e.width*r);e.height=Math.floor(e.height),e.width=Math.floor(e.width);const o=e.canvas;return o.style&&(n||!o.style.height&&!o.style.width)&&(o.style.height=`${e.height}px`,o.style.width=`${e.width}px`),e.currentDevicePixelRatio!==r||o.height!==i||o.width!==a?(e.currentDevicePixelRatio=r,o.height=i,o.width=a,e.ctx.setTransform(r,0,0,r,0,0),!0):!1}const iT=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};bh()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function bp(e,t){const n=QP(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function ei(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function aT(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 oT(e,t,n,r){const i={x:e.cp2x,y:e.cp2y},a={x:t.cp1x,y:t.cp1y},o=ei(e,i,n),s=ei(i,a,n),l=ei(a,t,n),u=ei(o,s,n),c=ei(s,l,n);return ei(u,c,n)}const sT=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}}},lT=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function ra(e,t,n){return e?sT(t,n):lT()}function q4(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 e3(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function t3(e){return e==="angle"?{between:Fo,compare:sP,normalize:Cn}:{between:Xi,compare:(t,n)=>t-n,normalize:t=>t}}function vp({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 uT(e,t,n){const{property:r,start:i,end:a}=n,{between:o,normalize:s}=t3(r),l=t.length;let{start:u,end:c,loop:d}=e,f,h;if(d){for(u+=l,c+=l,f=0,h=l;f<h&&o(s(t[u%l][r]),i,a);++f)u--,c--;u%=l,c%=l}return c<u&&(c+=l),{start:u,end:c,loop:d,style:e.style}}function cT(e,t,n){if(!n)return[e];const{property:r,start:i,end:a}=n,o=t.length,{compare:s,between:l,normalize:u}=t3(r),{start:c,end:d,loop:f,style:h}=uT(e,t,n),g=[];let m=!1,p=null,b,v,y;const C=()=>l(i,y,b)&&s(i,y)!==0,w=()=>s(a,b)===0||l(a,y,b),I=()=>m||C(),E=()=>!m||w();for(let D=c,$=c;D<=d;++D)v=t[D%o],!v.skip&&(b=u(v[r]),b!==y&&(m=l(b,i,a),p===null&&I()&&(p=s(b,i)===0?D:$),p!==null&&E()&&(g.push(vp({start:p,end:D,loop:f,count:o,style:h})),p=null),$=D,y=b));return p!==null&&g.push(vp({start:p,end:d,loop:f,count:o,style:h})),g}function dT(e,t){const n=[],r=e.segments;for(let i=0;i<r.length;i++){const a=cT(r[i],e.points,t);a.length&&n.push(...a)}return n}function fT(e,t,n,r){let i=0,a=t-1;if(n&&!r)for(;i<t&&!e[i].skip;)i++;for(;i<t&&e[i].skip;)i++;for(i%=t,n&&(a+=i);a>i&&e[a%t].skip;)a--;return a%=t,{start:i,end:a}}function hT(e,t,n,r){const i=e.length,a=[];let o=t,s=e[t],l;for(l=t+1;l<=n;++l){const u=e[l%i];u.skip||u.stop?s.skip||(r=!1,a.push({start:t%i,end:(l-1)%i,loop:r}),t=o=u.stop?l:null):(o=l,s.skip&&(t=l)),s=u}return o!==null&&a.push({start:t%i,end:o%i,loop:r}),a}function gT(e,t){const n=e.points,r=e.options.spanGaps,i=n.length;if(!i)return[];const a=!!e._loop,{start:o,end:s}=fT(n,i,a,r);if(r===!0)return yp(e,[{start:o,end:s,loop:a}],n,t);const l=s<o?s+i:s,u=!!e._fullLoop&&o===0&&s===i-1;return yp(e,hT(n,o,l,u),n,t)}function yp(e,t,n,r){return!r||!r.setContext||!n?t:mT(e,t,n,r)}function mT(e,t,n,r){const i=e._chart.getContext(),a=xp(e.options),{_datasetIndex:o,options:{spanGaps:s}}=e,l=n.length,u=[];let c=a,d=t[0].start,f=d;function h(g,m,p,b){const v=s?-1:1;if(g!==m){for(g+=l;n[g%l].skip;)g-=v;for(;n[m%l].skip;)m+=v;g%l!==m%l&&(u.push({start:g%l,end:m%l,loop:p,style:b}),c=b,d=m%l)}}for(const g of t){d=s?d:g.start;let m=n[d%l],p;for(f=d+1;f<=g.end;f++){const b=n[f%l];p=xp(r.setContext(Lr(i,{type:"segment",p0:m,p1:b,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:o}))),pT(p,c)&&h(d,f-1,g.loop,c),m=b,c=p}d<f-1&&h(d,f-1,g.loop,c)}return u}function xp(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function pT(e,t){if(!t)return!1;const n=[],r=function(i,a){return ch(a)?(n.includes(a)||n.push(a),n.indexOf(a)):a};return JSON.stringify(e,r)!==JSON.stringify(t,r)}/*!
|
168
168
|
* Chart.js v4.4.3
|
169
169
|
* https://www.chartjs.org
|
170
170
|
* (c) 2024 Chart.js Contributors
|
171
171
|
* Released under the MIT License
|
172
|
-
*/class bT{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,r,i){const a=n.listeners[i],o=n.duration;a.forEach(s=>s({chart:t,initial:n.initial,numSteps:o,currentStep:Math.min(r-n.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=z4.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 a=r.items;let o=a.length-1,s=!1,l;for(;o>=0;--o)l=a[o],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(t),s=!0):(a[o]=a[a.length-1],a.pop());s&&(i.draw(),this._notify(i,r,t,"progress")),a.length||(r.running=!1,this._notify(i,r,t,"complete"),r.initial=!1),n+=a.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 Kn=new bT;const Cp="transparent",vT={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=dp(e||Cp),i=r.valid&&dp(t||Cp);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class yT{constructor(t,n,r,i){const a=n[r];i=Is([t.to,i,a,t.from]);const o=Is([t.from,a,i]);this._active=!0,this._fn=t.fn||vT[t.type||typeof o],this._easing=Ka[t.easing]||Ka.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=o,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],a=r-this._start,o=this._duration-a;this._start=r,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=a,this._loop=!!t.loop,this._to=Is([t.to,n,i,t.from]),this._from=Is([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,a=this._from,o=this._loop,s=this._to;let l;if(this._active=a!==s&&(o||n<r),!this._active){this._target[i]=s,this._notify(!0);return}if(n<0){this._target[i]=a;return}l=n/r%2,l=o&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[i]=this._fn(a,s,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 n3{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!Re(t))return;const n=Object.keys(ot.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const a=t[i];if(!Re(a))return;const o={};for(const s of n)o[s]=a[s];(at(a.properties)&&a.properties||[i]).forEach(s=>{(s===i||!r.has(s))&&r.set(s,o)})})}_animateOptions(t,n){const r=n.options,i=CT(t,r);if(!i)return[];const a=this._createAnimations(i,r);return r.$shared&&xT(t.options.$animations,r).then(()=>{t.options=r},()=>{}),a}_createAnimations(t,n){const r=this._properties,i=[],a=t.$animations||(t.$animations={}),o=Object.keys(n),s=Date.now();let l;for(l=o.length-1;l>=0;--l){const u=o[l];if(u.charAt(0)==="$")continue;if(u==="options"){i.push(...this._animateOptions(t,n));continue}const c=n[u];let d=a[u];const f=r.get(u);if(d)if(f&&d.active()){d.update(f,c,s);continue}else d.cancel();if(!f||!f.duration){t[u]=c;continue}a[u]=d=new yT(f,t,u,c),i.push(d)}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 Kn.add(this._chart,r),!0}}function xT(e,t){const n=[],r=Object.keys(t);for(let i=0;i<r.length;i++){const a=e[r[i]];a&&a.active()&&n.push(a.wait())}return Promise.all(n)}function CT(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 wp(e,t){const n=e&&e.options||{},r=n.reverse,i=n.min===void 0?t:0,a=n.max===void 0?t:0;return{start:r?a:i,end:r?i:a}}function wT(e,t,n){if(n===!1)return!1;const r=wp(e,n),i=wp(t,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function DT(e){let t,n,r,i;return Re(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 r3(e,t){const n=[],r=e._getSortedDatasetMetas(t);let i,a;for(i=0,a=r.length;i<a;++i)n.push(r[i].index);return n}function Dp(e,t,n,r={}){const i=e.keys,a=r.mode==="single";let o,s,l,u;if(t!==null){for(o=0,s=i.length;o<s;++o){if(l=+i[o],l===n){if(r.all)continue;break}u=e.values[l],xt(u)&&(a||t===0||da(t)===da(u))&&(t+=u)}return t}}function ST(e,t){const{iScale:n,vScale:r}=t,i=n.axis==="x"?"x":"y",a=r.axis==="x"?"x":"y",o=Object.keys(e),s=new Array(o.length);let l,u,c;for(l=0,u=o.length;l<u;++l)c=o[l],s[l]={[i]:c,[a]:e[c]};return s}function Sp(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function IT(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function ET(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 _T(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function Ip(e,t,n,r){for(const i of t.getMatchingVisibleMetas(r).reverse()){const a=e[i.index];if(n&&a>0||!n&&a<0)return i.index}return null}function Ep(e,t){const{chart:n,_cachedMeta:r}=e,i=n._stacks||(n._stacks={}),{iScale:a,vScale:o,index:s}=r,l=a.axis,u=o.axis,c=IT(a,o,r),d=t.length;let f;for(let h=0;h<d;++h){const g=t[h],{[l]:m,[u]:p}=g,b=g._stacks||(g._stacks={});f=b[u]=_T(i,c,m),f[s]=p,f._top=Ip(f,o,!0,r.type),f._bottom=Ip(f,o,!1,r.type);const v=f._visualValues||(f._visualValues={});v[s]=p}}function wc(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function $T(e,t){return Lr(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function RT(e,t,n){return Lr(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function Ia(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 a=i._stacks;if(!a||a[r]===void 0||a[r][n]===void 0)return;delete a[r][n],a[r]._visualValues!==void 0&&a[r]._visualValues[n]!==void 0&&delete a[r]._visualValues[n]}}}const Dc=e=>e==="reset"||e==="none",_p=(e,t)=>t?e:Object.assign({},e),AT=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:r3(n,!0),values:null};class qa{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=Sp(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&&Ia(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),i=(d,f,h,g)=>d==="x"?f:d==="r"?g:h,a=n.xAxisID=Ce(r.xAxisID,wc(t,"x")),o=n.yAxisID=Ce(r.yAxisID,wc(t,"y")),s=n.rAxisID=Ce(r.rAxisID,wc(t,"r")),l=n.indexAxis,u=n.iAxisID=i(l,a,o,s),c=n.vAxisID=i(l,o,a,s);n.xScale=this.getScaleForId(a),n.yScale=this.getScaleForId(o),n.rScale=this.getScaleForId(s),n.iScale=this.getScaleForId(u),n.vScale=this.getScaleForId(c)}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&&lp(this._data,this),t._stacked&&Ia(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(Re(n)){const i=this._cachedMeta;this._data=ST(n,i)}else if(r!==n){if(r){lp(r,this);const i=this._cachedMeta;Ia(i),i._parsed=[]}n&&Object.isExtensible(n)&&dP(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 a=n._stacked;n._stacked=Sp(n.vScale,n),n.stack!==r.stack&&(i=!0,Ia(n),n.stack=r.stack),this._resyncElements(t),(i||a!==n._stacked)&&Ep(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:a,_stacked:o}=r,s=a.axis;let l=t===0&&n===i.length?!0:r._sorted,u=t>0&&r._parsed[t-1],c,d,f;if(this._parsing===!1)r._parsed=i,r._sorted=!0,f=i;else{at(i[t])?f=this.parseArrayData(r,i,t,n):Re(i[t])?f=this.parseObjectData(r,i,t,n):f=this.parsePrimitiveData(r,i,t,n);const h=()=>d[s]===null||u&&d[s]<u[s];for(c=0;c<n;++c)r._parsed[c+t]=d=f[c],l&&(h()&&(l=!1),u=d);r._sorted=l}o&&Ep(this,f)}parsePrimitiveData(t,n,r,i){const{iScale:a,vScale:o}=t,s=a.axis,l=o.axis,u=a.getLabels(),c=a===o,d=new Array(i);let f,h,g;for(f=0,h=i;f<h;++f)g=f+r,d[f]={[s]:c||a.parse(u[g],g),[l]:o.parse(n[g],g)};return d}parseArrayData(t,n,r,i){const{xScale:a,yScale:o}=t,s=new Array(i);let l,u,c,d;for(l=0,u=i;l<u;++l)c=l+r,d=n[c],s[l]={x:a.parse(d[0],c),y:o.parse(d[1],c)};return s}parseObjectData(t,n,r,i){const{xScale:a,yScale:o}=t,{xAxisKey:s="x",yAxisKey:l="y"}=this._parsing,u=new Array(i);let c,d,f,h;for(c=0,d=i;c<d;++c)f=c+r,h=n[f],u[c]={x:a.parse(Ao(h,s),f),y:o.parse(Ao(h,l),f)};return u}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,r){const i=this.chart,a=this._cachedMeta,o=n[t.axis],s={keys:r3(i,!0),values:n._stacks[t.axis]._visualValues};return Dp(s,o,a.index,{mode:r})}updateRangeFromParsed(t,n,r,i){const a=r[n.axis];let o=a===null?NaN:a;const s=i&&r._stacks[n.axis];i&&s&&(i.values=s,o=Dp(i,a,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,n){const r=this._cachedMeta,i=r._parsed,a=r._sorted&&t===r.iScale,o=i.length,s=this._getOtherScale(t),l=AT(n,r,this.chart),u={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:d}=ET(s);let f,h;function g(){h=i[f];const m=h[s.axis];return!xt(h[t.axis])||c>m||d<m}for(f=0;f<o&&!(!g()&&(this.updateRangeFromParsed(u,t,h,l),a));++f);if(a){for(f=o-1;f>=0;--f)if(!g()){this.updateRangeFromParsed(u,t,h,l);break}}return u}getAllParsedValues(t){const n=this._cachedMeta._parsed,r=[];let i,a,o;for(i=0,a=n.length;i<a;++i)o=n[i][t.axis],xt(o)&&r.push(o);return r}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,r=n.iScale,i=n.vScale,a=this.getParsed(t);return{label:r?""+r.getLabelForValue(a[r.axis]):"",value:i?""+i.getLabelForValue(a[i.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=DT(Ce(this.options.clip,wT(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,r=this._cachedMeta,i=r.data||[],a=n.chartArea,o=[],s=this._drawStart||0,l=this._drawCount||i.length-s,u=this.options.drawActiveElementsOnTop;let c;for(r.dataset&&r.dataset.draw(t,a,s,l),c=s;c<s+l;++c){const d=i[c];d.hidden||(d.active&&u?o.push(d):d.draw(t,a))}for(c=0;c<o.length;++c)o[c].draw(t,a)}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 a;if(t>=0&&t<this._cachedMeta.data.length){const o=this._cachedMeta.data[t];a=o.$context||(o.$context=RT(this.getContext(),t,o)),a.parsed=this.getParsed(t),a.raw=i.data[t],a.index=a.dataIndex=t}else a=this.$context||(this.$context=$T(this.chart.getContext(),this.index)),a.dataset=i,a.index=a.datasetIndex=this.index;return a.active=!!n,a.mode=r,a}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",a=this._cachedDataOpts,o=t+"-"+n,s=a[o],l=this.enableOptionSharing&&Ll(r);if(s)return _p(s,l);const u=this.chart.config,c=u.datasetElementScopeKeys(this._type,t),d=i?[`${t}Hover`,"hover",t,""]:[t,""],f=u.getOptionScopes(this.getDataset(),c),h=Object.keys(ot.elements[t]),g=()=>this.getContext(r,i,n),m=u.resolveNamedOptions(f,h,g,d);return m.$shared&&(m.$shared=l,a[o]=Object.freeze(_p(m,l))),m}_resolveAnimations(t,n,r){const i=this.chart,a=this._cachedDataOpts,o=`animation-${n}`,s=a[o];if(s)return s;let l;if(i.options.animation!==!1){const c=this.chart.config,d=c.datasetAnimationScopeKeys(this._type,n),f=c.getOptionScopes(this.getDataset(),d);l=c.createResolver(f,this.getContext(t,r,n))}const u=new n3(i,l&&l.animations);return l&&l._cacheable&&(a[o]=Object.freeze(u)),u}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||Dc(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const r=this.resolveDataElementOptions(t,n),i=this._sharedOptions,a=this.getSharedOptions(r),o=this.includeOptions(n,a)||a!==i;return this.updateSharedOptions(a,n,r),{sharedOptions:a,includeOptions:o}}updateElement(t,n,r,i){Dc(i)?Object.assign(t,r):this._resolveAnimations(n,i).update(t,r)}updateSharedOptions(t,n,r){t&&!Dc(n)&&this._resolveAnimations(void 0,n).update(t,r)}_setStyle(t,n,r,i){t.active=i;const a=this.getStyle(n,i);this._resolveAnimations(n,r,i).update(t,{options:!i&&this.getSharedOptions(a)||a})}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[s,l,u]of this._syncList)this[s](l,u);this._syncList=[];const i=r.length,a=n.length,o=Math.min(a,i);o&&this.parse(0,o),a>i?this._insertElements(i,a-i,t):a<i&&this._removeElements(a,i-a)}_insertElements(t,n,r=!0){const i=this._cachedMeta,a=i.data,o=t+n;let s;const l=u=>{for(u.length+=n,s=u.length-1;s>=o;s--)u[s]=u[s-n]};for(l(a),s=t;s<o;++s)a[s]=new this.dataElementType;this._parsing&&l(i._parsed),this.parse(t,n),r&&this.updateElements(a,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&&Ia(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])}}ie(qa,"defaults",{}),ie(qa,"datasetElementType",null),ie(qa,"dataElementType",null);function FT(e,t,n){let r=1,i=1,a=0,o=0;if(t<Ke){const s=e,l=s+t,u=Math.cos(s),c=Math.sin(s),d=Math.cos(l),f=Math.sin(l),h=(y,C,w)=>Fo(y,s,l,!0)?1:Math.max(C,C*n,w,w*n),g=(y,C,w)=>Fo(y,s,l,!0)?-1:Math.min(C,C*n,w,w*n),m=h(0,u,d),p=h(dt,c,f),b=g(Qe,u,d),v=g(Qe+dt,c,f);r=(m-b)/2,i=(p-v)/2,a=-(m+b)/2,o=-(p+v)/2}return{ratioX:r,ratioY:i,offsetX:a,offsetY:o}}class Va extends qa{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 a=l=>+r[l];if(Re(r[t])){const{key:l="value"}=this._parsing;a=u=>+Ao(r[u],l)}let o,s;for(o=t,s=t+n;o<s;++o)i._parsed[o]=a(o)}}_getRotation(){return Nn(this.options.rotation-90)}_getCircumference(){return Nn(this.options.circumference)}_getRotationExtents(){let t=Ke,n=-Ke;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,a=i._getRotation(),o=i._getCircumference();t=Math.min(t,a),n=Math.max(n,a+o)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:r}=n,i=this._cachedMeta,a=i.data,o=this.getMaxBorderWidth()+this.getMaxOffset(a)+this.options.spacing,s=Math.max((Math.min(r.width,r.height)-o)/2,0),l=Math.min(K7(this.options.cutout,s),1),u=this._getRingWeight(this.index),{circumference:c,rotation:d}=this._getRotationExtents(),{ratioX:f,ratioY:h,offsetX:g,offsetY:m}=FT(d,c,l),p=(r.width-o)/f,b=(r.height-o)/h,v=Math.max(Math.min(p,b)/2,0),y=N4(this.options.radius,v),C=Math.max(y*l,0),w=(y-C)/this._getVisibleDatasetWeightTotal();this.offsetX=g*y,this.offsetY=m*y,i.total=this.calculateTotal(),this.outerRadius=y-w*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-w*u,0),this.updateElements(a,0,a.length,t)}_circumference(t,n){const r=this.options,i=this._cachedMeta,a=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]*a/Ke)}updateElements(t,n,r,i){const a=i==="reset",o=this.chart,s=o.chartArea,u=o.options.animation,c=(s.left+s.right)/2,d=(s.top+s.bottom)/2,f=a&&u.animateScale,h=f?0:this.innerRadius,g=f?0:this.outerRadius,{sharedOptions:m,includeOptions:p}=this._getSharedOptions(n,i);let b=this._getRotation(),v;for(v=0;v<n;++v)b+=this._circumference(v,a);for(v=n;v<n+r;++v){const y=this._circumference(v,a),C=t[v],w={x:c+this.offsetX,y:d+this.offsetY,startAngle:b,endAngle:b+y,circumference:y,outerRadius:g,innerRadius:h};p&&(w.options=m||this.resolveDataElementOptions(v,C.active?"active":i)),b+=y,this.updateElement(C,v,w,i)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let r=0,i;for(i=0;i<n.length;i++){const a=t._parsed[i];a!==null&&!isNaN(a)&&this.chart.getDataVisibility(i)&&!n[i].hidden&&(r+=Math.abs(a))}return r}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?Ke*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,i=r.data.labels||[],a=Cu(n._parsed[t],r.options.locale);return{label:i[t]||"",value:a}}getMaxBorderWidth(t){let n=0;const r=this.chart;let i,a,o,s,l;if(!t){for(i=0,a=r.data.datasets.length;i<a;++i)if(r.isDatasetVisible(i)){o=r.getDatasetMeta(i),t=o.data,s=o.controller;break}}if(!t)return 0;for(i=0,a=t.length;i<a;++i)l=s.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 a=this.resolveDataElementOptions(r);n=Math.max(n,a.offset||0,a.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(Ce(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}ie(Va,"id","doughnut"),ie(Va,"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"}),ie(Va,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),ie(Va,"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((a,o)=>{const l=t.getDatasetMeta(0).controller.getStyle(o);return{text:a,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:i,lineWidth:l.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(o),index:o}})}return[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}}});function Yr(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class yh{constructor(t){ie(this,"options");this.options=t||{}}static override(t){Object.assign(yh.prototype,t)}init(){}formats(){return Yr()}parse(){return Yr()}format(){return Yr()}add(){return Yr()}diff(){return Yr()}startOf(){return Yr()}endOf(){return Yr()}}var PT={_date:yh};function TT(e,t,n,r){const{controller:i,data:a,_sorted:o}=e,s=i._cachedMeta.iScale;if(s&&t===s.axis&&t!=="r"&&o&&a.length){const l=s._reversePixels?uP:Ed;if(r){if(i._sharedOptions){const u=a[0],c=typeof u.getRange=="function"&&u.getRange(t);if(c){const d=l(a,t,n-c),f=l(a,t,n+c);return{lo:d.lo,hi:f.hi}}}}else return l(a,t,n)}return{lo:0,hi:a.length-1}}function Ko(e,t,n,r,i){const a=e.getSortedVisibleDatasetMetas(),o=n[t];for(let s=0,l=a.length;s<l;++s){const{index:u,data:c}=a[s],{lo:d,hi:f}=TT(a[s],t,o,i);for(let h=d;h<=f;++h){const g=c[h];g.skip||r(g,u,h)}}}function kT(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(r,i){const a=t?Math.abs(r.x-i.x):0,o=n?Math.abs(r.y-i.y):0;return Math.sqrt(Math.pow(a,2)+Math.pow(o,2))}}function Sc(e,t,n,r,i){const a=[];return!i&&!e.isPointInArea(t)||Ko(e,n,t,function(s,l,u){!i&&!lr(s,e.chartArea,0)||s.inRange(t.x,t.y,r)&&a.push({element:s,datasetIndex:l,index:u})},!0),a}function MT(e,t,n,r){let i=[];function a(o,s,l){const{startAngle:u,endAngle:c}=o.getProps(["startAngle","endAngle"],r),{angle:d}=H4(o,{x:t.x,y:t.y});Fo(d,u,c)&&i.push({element:o,datasetIndex:s,index:l})}return Ko(e,n,t,a),i}function BT(e,t,n,r,i,a){let o=[];const s=kT(n);let l=Number.POSITIVE_INFINITY;function u(c,d,f){const h=c.inRange(t.x,t.y,i);if(r&&!h)return;const g=c.getCenterPoint(i);if(!(!!a||e.isPointInArea(g))&&!h)return;const p=s(t,g);p<l?(o=[{element:c,datasetIndex:d,index:f}],l=p):p===l&&o.push({element:c,datasetIndex:d,index:f})}return Ko(e,n,t,u),o}function Ic(e,t,n,r,i,a){return!a&&!e.isPointInArea(t)?[]:n==="r"&&!r?MT(e,t,n,i):BT(e,t,n,r,i,a)}function $p(e,t,n,r,i){const a=[],o=n==="x"?"inXRange":"inYRange";let s=!1;return Ko(e,n,t,(l,u,c)=>{l[o](t[n],i)&&(a.push({element:l,datasetIndex:u,index:c}),s=s||l.inRange(t.x,t.y,i))}),r&&!s?[]:a}var VT={evaluateInteractionItems:Ko,modes:{index(e,t,n,r){const i=qr(t,e),a=n.axis||"x",o=n.includeInvisible||!1,s=n.intersect?Sc(e,i,a,r,o):Ic(e,i,a,!1,r,o),l=[];return s.length?(e.getSortedVisibleDatasetMetas().forEach(u=>{const c=s[0].index,d=u.data[c];d&&!d.skip&&l.push({element:d,datasetIndex:u.index,index:c})}),l):[]},dataset(e,t,n,r){const i=qr(t,e),a=n.axis||"xy",o=n.includeInvisible||!1;let s=n.intersect?Sc(e,i,a,r,o):Ic(e,i,a,!1,r,o);if(s.length>0){const l=s[0].datasetIndex,u=e.getDatasetMeta(l).data;s=[];for(let c=0;c<u.length;++c)s.push({element:u[c],datasetIndex:l,index:c})}return s},point(e,t,n,r){const i=qr(t,e),a=n.axis||"xy",o=n.includeInvisible||!1;return Sc(e,i,a,r,o)},nearest(e,t,n,r){const i=qr(t,e),a=n.axis||"xy",o=n.includeInvisible||!1;return Ic(e,i,a,n.intersect,r,o)},x(e,t,n,r){const i=qr(t,e);return $p(e,i,"x",n.intersect,r)},y(e,t,n,r){const i=qr(t,e);return $p(e,i,"y",n.intersect,r)}}};const i3=["left","top","right","bottom"];function Ea(e,t){return e.filter(n=>n.pos===t)}function Rp(e,t){return e.filter(n=>i3.indexOf(n.pos)===-1&&n.box.axis===t)}function _a(e,t){return e.sort((n,r)=>{const i=t?r:n,a=t?n:r;return i.weight===a.weight?i.index-a.index:i.weight-a.weight})}function OT(e){const t=[];let n,r,i,a,o,s;for(n=0,r=(e||[]).length;n<r;++n)i=e[n],{position:a,options:{stack:o,stackWeight:s=1}}=i,t.push({index:n,box:i,pos:a,horizontal:i.isHorizontal(),weight:i.weight,stack:o&&a+o,stackWeight:s});return t}function NT(e){const t={};for(const n of e){const{stack:r,pos:i,stackWeight:a}=n;if(!r||!i3.includes(i))continue;const o=t[r]||(t[r]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=a}return t}function LT(e,t){const n=NT(e),{vBoxMaxWidth:r,hBoxMaxHeight:i}=t;let a,o,s;for(a=0,o=e.length;a<o;++a){s=e[a];const{fullSize:l}=s.box,u=n[s.stack],c=u&&s.stackWeight/u.weight;s.horizontal?(s.width=c?c*r:l&&t.availableWidth,s.height=i):(s.width=r,s.height=c?c*i:l&&t.availableHeight)}return n}function jT(e){const t=OT(e),n=_a(t.filter(u=>u.box.fullSize),!0),r=_a(Ea(t,"left"),!0),i=_a(Ea(t,"right")),a=_a(Ea(t,"top"),!0),o=_a(Ea(t,"bottom")),s=Rp(t,"x"),l=Rp(t,"y");return{fullSize:n,leftAndTop:r.concat(a),rightAndBottom:i.concat(l).concat(o).concat(s),chartArea:Ea(t,"chartArea"),vertical:r.concat(i).concat(l),horizontal:a.concat(o).concat(s)}}function Ap(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function a3(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 HT(e,t,n,r){const{pos:i,box:a}=n,o=e.maxPadding;if(!Re(i)){n.size&&(e[i]-=n.size);const d=r[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?a.height:a.width),n.size=d.size/d.count,e[i]+=n.size}a.getPadding&&a3(o,a.getPadding());const s=Math.max(0,t.outerWidth-Ap(o,e,"left","right")),l=Math.max(0,t.outerHeight-Ap(o,e,"top","bottom")),u=s!==e.w,c=l!==e.h;return e.w=s,e.h=l,n.horizontal?{same:u,other:c}:{same:c,other:u}}function WT(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 zT(e,t){const n=t.maxPadding;function r(i){const a={left:0,top:0,right:0,bottom:0};return i.forEach(o=>{a[o]=Math.max(t[o],n[o])}),a}return r(e?["left","right"]:["top","bottom"])}function Oa(e,t,n,r){const i=[];let a,o,s,l,u,c;for(a=0,o=e.length,u=0;a<o;++a){s=e[a],l=s.box,l.update(s.width||t.w,s.height||t.h,zT(s.horizontal,t));const{same:d,other:f}=HT(t,n,s,r);u|=d&&i.length,c=c||f,l.fullSize||i.push(s)}return u&&Oa(i,t,n,r)||c}function $s(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 Fp(e,t,n,r){const i=n.padding;let{x:a,y:o}=t;for(const s of e){const l=s.box,u=r[s.stack]||{count:1,placed:0,weight:1},c=s.stackWeight/u.weight||1;if(s.horizontal){const d=t.w*c,f=u.size||l.height;Ll(u.start)&&(o=u.start),l.fullSize?$s(l,i.left,o,n.outerWidth-i.right-i.left,f):$s(l,t.left+u.placed,o,d,f),u.start=o,u.placed+=d,o=l.bottom}else{const d=t.h*c,f=u.size||l.width;Ll(u.start)&&(a=u.start),l.fullSize?$s(l,a,i.top,f,n.outerHeight-i.bottom-i.top):$s(l,a,t.top+u.placed,f,d),u.start=a,u.placed+=d,a=l.right}}t.x=a,t.y=o}var bn={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=Ft(e.options.layout.padding),a=Math.max(t-i.width,0),o=Math.max(n-i.height,0),s=jT(e.boxes),l=s.vertical,u=s.horizontal;He(e.boxes,m=>{typeof m.beforeLayout=="function"&&m.beforeLayout()});const c=l.reduce((m,p)=>p.box.options&&p.box.options.display===!1?m:m+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:a,availableHeight:o,vBoxMaxWidth:a/2/c,hBoxMaxHeight:o/2}),f=Object.assign({},i);a3(f,Ft(r));const h=Object.assign({maxPadding:f,w:a,h:o,x:i.left,y:i.top},i),g=LT(l.concat(u),d);Oa(s.fullSize,h,d,g),Oa(l,h,d,g),Oa(u,h,d,g)&&Oa(l,h,d,g),WT(h),Fp(s.leftAndTop,h,d,g),h.x+=h.w,h.y+=h.h,Fp(s.rightAndBottom,h,d,g),e.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},He(s.chartArea,m=>{const p=m.box;Object.assign(p,e.chartArea),p.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}};class o3{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 GT extends o3{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Qs="$chartjs",ZT={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Pp=e=>e===null||e==="";function XT(e,t){const n=e.style,r=e.getAttribute("height"),i=e.getAttribute("width");if(e[Qs]={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",Pp(i)){const a=bp(e,"width");a!==void 0&&(e.width=a)}if(Pp(r))if(e.style.height==="")e.height=e.width/(t||2);else{const a=bp(e,"height");a!==void 0&&(e.height=a)}return e}const s3=iT?{passive:!0}:!1;function YT(e,t,n){e&&e.addEventListener(t,n,s3)}function UT(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,s3)}function JT(e,t){const n=ZT[e.type]||e.type,{x:r,y:i}=qr(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:i!==void 0?i:null}}function Zl(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function KT(e,t,n){const r=e.canvas,i=new MutationObserver(a=>{let o=!1;for(const s of a)o=o||Zl(s.addedNodes,r),o=o&&!Zl(s.removedNodes,r);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function QT(e,t,n){const r=e.canvas,i=new MutationObserver(a=>{let o=!1;for(const s of a)o=o||Zl(s.removedNodes,r),o=o&&!Zl(s.addedNodes,r);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const Po=new Map;let Tp=0;function l3(){const e=window.devicePixelRatio;e!==Tp&&(Tp=e,Po.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function qT(e,t){Po.size||window.addEventListener("resize",l3),Po.set(e,t)}function ek(e){Po.delete(e),Po.size||window.removeEventListener("resize",l3)}function tk(e,t,n){const r=e.canvas,i=r&&vh(r);if(!i)return;const a=G4((s,l)=>{const u=i.clientWidth;n(s,l),u<i.clientWidth&&n()},window),o=new ResizeObserver(s=>{const l=s[0],u=l.contentRect.width,c=l.contentRect.height;u===0&&c===0||a(u,c)});return o.observe(i),qT(e,a),o}function Ec(e,t,n){n&&n.disconnect(),t==="resize"&&ek(e)}function nk(e,t,n){const r=e.canvas,i=G4(a=>{e.ctx!==null&&n(JT(a,e))},e);return YT(r,t,i),i}class rk extends o3{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(XT(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[Qs])return!1;const r=n[Qs].initial;["height","width"].forEach(a=>{const o=r[a];Je(o)?n.removeAttribute(a):n.setAttribute(a,o)});const i=r.style||{};return Object.keys(i).forEach(a=>{n.style[a]=i[a]}),n.width=n.width,delete n[Qs],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const i=t.$proxies||(t.$proxies={}),o={attach:KT,detach:QT,resize:tk}[n]||nk;i[n]=o(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),i=r[n];if(!i)return;({attach:Ec,detach:Ec,resize:Ec}[n]||UT)(t,n,i),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,i){return rT(t,n,r,i)}isAttached(t){const n=t&&vh(t);return!!(n&&n.isConnected)}}function ik(e){return!bh()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?GT:rk}var Vs;let jr=(Vs=class{constructor(){ie(this,"x");ie(this,"y");ie(this,"active",!1);ie(this,"options");ie(this,"$animations")}tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return Hl(this.x)&&Hl(this.y)}getProps(t,n){const r=this.$animations;if(!n||!r)return this;const i={};return t.forEach(a=>{i[a]=r[a]&&r[a].active()?r[a]._to:this[a]}),i}},ie(Vs,"defaults",{}),ie(Vs,"defaultRoutes"),Vs);function ak(e,t){const n=e.options.ticks,r=ok(e),i=Math.min(n.maxTicksLimit||r,r),a=n.major.enabled?lk(t):[],o=a.length,s=a[0],l=a[o-1],u=[];if(o>i)return uk(t,u,a,o/i),u;const c=sk(a,t,i);if(o>0){let d,f;const h=o>1?Math.round((l-s)/(o-1)):null;for(Rs(t,u,c,Je(h)?0:s-h,s),d=0,f=o-1;d<f;d++)Rs(t,u,c,a[d],a[d+1]);return Rs(t,u,c,l,Je(h)?t.length:l+h),u}return Rs(t,u,c),u}function ok(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 sk(e,t,n){const r=ck(e),i=t.length/n;if(!r)return Math.max(i,1);const a=aP(r);for(let o=0,s=a.length-1;o<s;o++){const l=a[o];if(l>i)return l}return Math.max(i,1)}function lk(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function uk(e,t,n,r){let i=0,a=n[0],o;for(r=Math.ceil(r),o=0;o<e.length;o++)o===a&&(t.push(e[o]),i++,a=n[i*r])}function Rs(e,t,n,r,i){const a=Ce(r,0),o=Math.min(Ce(i,e.length),e.length);let s=0,l,u,c;for(n=Math.ceil(n),i&&(l=i-r,n=l/Math.floor(l/n)),c=a;c<0;)s++,c=Math.round(a+s*n);for(u=Math.max(a,0);u<o;u++)u===c&&(t.push(e[u]),s++,c=Math.round(a+s*n))}function ck(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 dk=e=>e==="left"?"right":e==="right"?"left":e,kp=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,Mp=(e,t)=>Math.min(t||e,e);function Bp(e,t){const n=[],r=e.length/t,i=e.length;let a=0;for(;a<i;a+=r)n.push(e[Math.floor(a)]);return n}function fk(e,t,n){const r=e.ticks.length,i=Math.min(t,r-1),a=e._startPixel,o=e._endPixel,s=1e-6;let l=e.getPixelForTick(i),u;if(!(n&&(r===1?u=Math.max(l-a,o-l):t===0?u=(e.getPixelForTick(1)-l)/2:u=(l-e.getPixelForTick(i-1))/2,l+=i<t?u:-u,l<a-s||l>o+s)))return l}function hk(e,t){He(e,n=>{const r=n.gc,i=r.length/2;let a;if(i>t){for(a=0;a<i;++a)delete n.data[r[a]];r.splice(0,i)}})}function $a(e){return e.drawTicks?e.tickLength:0}function Vp(e,t){if(!e.display)return 0;const n=pt(e.font,t),r=Ft(e.padding);return(at(e.text)?e.text.length:1)*n.lineHeight+r.height}function gk(e,t){return Lr(e,{scale:t,type:"scale"})}function mk(e,t,n){return Lr(e,{tick:n,index:t,type:"tick"})}function pk(e,t,n){let r=uh(e);return(n&&t!=="right"||!n&&t==="right")&&(r=dk(r)),r}function bk(e,t,n,r){const{top:i,left:a,bottom:o,right:s,chart:l}=e,{chartArea:u,scales:c}=l;let d=0,f,h,g;const m=o-i,p=s-a;if(e.isHorizontal()){if(h=_t(r,a,s),Re(n)){const b=Object.keys(n)[0],v=n[b];g=c[b].getPixelForValue(v)+m-t}else n==="center"?g=(u.bottom+u.top)/2+m-t:g=kp(e,n,t);f=s-a}else{if(Re(n)){const b=Object.keys(n)[0],v=n[b];h=c[b].getPixelForValue(v)-p+t}else n==="center"?h=(u.left+u.right)/2-p+t:h=kp(e,n,t);g=_t(r,o,i),d=n==="left"?-dt:dt}return{titleX:h,titleY:g,maxWidth:f,rotation:d}}class _i extends jr{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=Qt(t,Number.POSITIVE_INFINITY),n=Qt(n,Number.NEGATIVE_INFINITY),r=Qt(r,Number.POSITIVE_INFINITY),i=Qt(i,Number.NEGATIVE_INFINITY),{min:Qt(t,r),max:Qt(n,i),minDefined:xt(t),maxDefined:xt(n)}}getMinMax(t){let{min:n,max:r,minDefined:i,maxDefined:a}=this.getUserBounds(),o;if(i&&a)return{min:n,max:r};const s=this.getMatchingVisibleMetas();for(let l=0,u=s.length;l<u;++l)o=s[l].controller.getMinMax(this,t),i||(n=Math.min(n,o.min)),a||(r=Math.max(r,o.max));return n=a&&n>r?r:n,r=i&&n>r?n:r,{min:Qt(n,Qt(r,n)),max:Qt(r,Qt(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(){Ze(this.options.beforeUpdate,[this])}update(t,n,r){const{beginAtZero:i,grace:a,ticks:o}=this.options,s=o.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=MP(this,a,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=s<this.ticks.length;this._convertTicksToLabels(l?Bp(this.ticks,s):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=ak(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(){Ze(this.options.afterUpdate,[this])}beforeSetDimensions(){Ze(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(){Ze(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Ze(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Ze(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let r,i,a;for(r=0,i=t.length;r<i;r++)a=t[r],a.label=Ze(n.callback,[a.value,r,t],this)}afterTickToLabelConversion(){Ze(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Ze(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=Mp(this.ticks.length,t.ticks.maxTicksLimit),i=n.minRotation||0,a=n.maxRotation;let o=i,s,l,u;if(!this._isVisible()||!n.display||i>=a||r<=1||!this.isHorizontal()){this.labelRotation=i;return}const c=this._getLabelSizes(),d=c.widest.width,f=c.highest.height,h=tn(this.chart.width-d,0,this.maxWidth);s=t.offset?this.maxWidth/r:h/(r-1),d+6>s&&(s=h/(r-(t.offset?.5:1)),l=this.maxHeight-$a(t.grid)-n.padding-Vp(t.title,this.chart.options.font),u=Math.sqrt(d*d+f*f),o=sh(Math.min(Math.asin(tn((c.highest.height+6)/s,-1,1)),Math.asin(tn(l/u,-1,1))-Math.asin(tn(f/u,-1,1)))),o=Math.max(i,Math.min(a,o))),this.labelRotation=o}afterCalculateLabelRotation(){Ze(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Ze(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:r,title:i,grid:a}}=this,o=this._isVisible(),s=this.isHorizontal();if(o){const l=Vp(i,n.options.font);if(s?(t.width=this.maxWidth,t.height=$a(a)+l):(t.height=this.maxHeight,t.width=$a(a)+l),r.display&&this.ticks.length){const{first:u,last:c,widest:d,highest:f}=this._getLabelSizes(),h=r.padding*2,g=Nn(this.labelRotation),m=Math.cos(g),p=Math.sin(g);if(s){const b=r.mirror?0:p*d.width+m*f.height;t.height=Math.min(this.maxHeight,t.height+b+h)}else{const b=r.mirror?0:m*d.width+p*f.height;t.width=Math.min(this.maxWidth,t.width+b+h)}this._calculatePadding(u,c,p,m)}}this._handleMargins(),s?(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:a,padding:o},position:s}=this.options,l=this.labelRotation!==0,u=s!=="top"&&this.axis==="x";if(this.isHorizontal()){const c=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,h=0;l?u?(f=i*t.width,h=r*n.height):(f=r*t.height,h=i*n.width):a==="start"?h=n.width:a==="end"?f=t.width:a!=="inner"&&(f=t.width/2,h=n.width/2),this.paddingLeft=Math.max((f-c+o)*this.width/(this.width-c),0),this.paddingRight=Math.max((h-d+o)*this.width/(this.width-d),0)}else{let c=n.height/2,d=t.height/2;a==="start"?(c=0,d=t.height):a==="end"&&(c=n.height,d=0),this.paddingTop=c+o,this.paddingBottom=d+o}}_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(){Ze(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++)Je(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=Bp(r,n)),this._labelSizes=t=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,r){const{ctx:i,_longestTextCache:a}=this,o=[],s=[],l=Math.floor(n/Mp(n,r));let u=0,c=0,d,f,h,g,m,p,b,v,y,C,w;for(d=0;d<n;d+=l){if(g=t[d].label,m=this._resolveTickFontOptions(d),i.font=p=m.string,b=a[p]=a[p]||{data:{},gc:[]},v=m.lineHeight,y=C=0,!Je(g)&&!at(g))y=Wl(i,b.data,b.gc,y,g),C=v;else if(at(g))for(f=0,h=g.length;f<h;++f)w=g[f],!Je(w)&&!at(w)&&(y=Wl(i,b.data,b.gc,y,w),C+=v);o.push(y),s.push(C),u=Math.max(y,u),c=Math.max(C,c)}hk(a,n);const I=o.indexOf(u),E=s.indexOf(c),D=$=>({width:o[$]||0,height:s[$]||0});return{first:D(0),last:D(n-1),widest:D(I),highest:D(E),widths:o,heights:s}}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 lP(this._alignToPixels?Xr(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=mk(this.getContext(),t,r))}return this.$context||(this.$context=gk(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=Nn(this.labelRotation),r=Math.abs(Math.cos(n)),i=Math.abs(Math.sin(n)),a=this._getLabelSizes(),o=t.autoSkipPadding||0,s=a?a.widest.width+o:0,l=a?a.highest.height+o:0;return this.isHorizontal()?l*r>s*i?s/r:l/i:l*i<s*r?l/r:s/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:a,position:o,border:s}=i,l=a.offset,u=this.isHorizontal(),d=this.ticks.length+(l?1:0),f=$a(a),h=[],g=s.setContext(this.getContext()),m=g.display?g.width:0,p=m/2,b=function(T){return Xr(r,T,m)};let v,y,C,w,I,E,D,$,F,_,P,k;if(o==="top")v=b(this.bottom),E=this.bottom-f,$=v-p,_=b(t.top)+p,k=t.bottom;else if(o==="bottom")v=b(this.top),_=t.top,k=b(t.bottom)-p,E=v+p,$=this.top+f;else if(o==="left")v=b(this.right),I=this.right-f,D=v-p,F=b(t.left)+p,P=t.right;else if(o==="right")v=b(this.left),F=t.left,P=b(t.right)-p,I=v+p,D=this.left+f;else if(n==="x"){if(o==="center")v=b((t.top+t.bottom)/2+.5);else if(Re(o)){const T=Object.keys(o)[0],R=o[T];v=b(this.chart.scales[T].getPixelForValue(R))}_=t.top,k=t.bottom,E=v+p,$=E+f}else if(n==="y"){if(o==="center")v=b((t.left+t.right)/2);else if(Re(o)){const T=Object.keys(o)[0],R=o[T];v=b(this.chart.scales[T].getPixelForValue(R))}I=v-p,D=I-f,F=t.left,P=t.right}const A=Ce(i.ticks.maxTicksLimit,d),B=Math.max(1,Math.ceil(d/A));for(y=0;y<d;y+=B){const T=this.getContext(y),R=a.setContext(T),V=s.setContext(T),H=R.lineWidth,L=R.color,Z=V.dash||[],O=V.dashOffset,W=R.tickWidth,q=R.tickColor,Y=R.tickBorderDash||[],N=R.tickBorderDashOffset;C=fk(this,y,l),C!==void 0&&(w=Xr(r,C,H),u?I=D=F=P=w:E=$=_=k=w,h.push({tx1:I,ty1:E,tx2:D,ty2:$,x1:F,y1:_,x2:P,y2:k,width:H,color:L,borderDash:Z,borderDashOffset:O,tickWidth:W,tickColor:q,tickBorderDash:Y,tickBorderDashOffset:N}))}return this._ticksLength=d,this._borderValue=v,h}_computeLabelItems(t){const n=this.axis,r=this.options,{position:i,ticks:a}=r,o=this.isHorizontal(),s=this.ticks,{align:l,crossAlign:u,padding:c,mirror:d}=a,f=$a(r.grid),h=f+c,g=d?-c:h,m=-Nn(this.labelRotation),p=[];let b,v,y,C,w,I,E,D,$,F,_,P,k="middle";if(i==="top")I=this.bottom-g,E=this._getXAxisLabelAlignment();else if(i==="bottom")I=this.top+g,E=this._getXAxisLabelAlignment();else if(i==="left"){const B=this._getYAxisLabelAlignment(f);E=B.textAlign,w=B.x}else if(i==="right"){const B=this._getYAxisLabelAlignment(f);E=B.textAlign,w=B.x}else if(n==="x"){if(i==="center")I=(t.top+t.bottom)/2+h;else if(Re(i)){const B=Object.keys(i)[0],T=i[B];I=this.chart.scales[B].getPixelForValue(T)+h}E=this._getXAxisLabelAlignment()}else if(n==="y"){if(i==="center")w=(t.left+t.right)/2-h;else if(Re(i)){const B=Object.keys(i)[0],T=i[B];w=this.chart.scales[B].getPixelForValue(T)}E=this._getYAxisLabelAlignment(f).textAlign}n==="y"&&(l==="start"?k="top":l==="end"&&(k="bottom"));const A=this._getLabelSizes();for(b=0,v=s.length;b<v;++b){y=s[b],C=y.label;const B=a.setContext(this.getContext(b));D=this.getPixelForTick(b)+a.labelOffset,$=this._resolveTickFontOptions(b),F=$.lineHeight,_=at(C)?C.length:1;const T=_/2,R=B.color,V=B.textStrokeColor,H=B.textStrokeWidth;let L=E;o?(w=D,E==="inner"&&(b===v-1?L=this.options.reverse?"left":"right":b===0?L=this.options.reverse?"right":"left":L="center"),i==="top"?u==="near"||m!==0?P=-_*F+F/2:u==="center"?P=-A.highest.height/2-T*F+F:P=-A.highest.height+F/2:u==="near"||m!==0?P=F/2:u==="center"?P=A.highest.height/2-T*F:P=A.highest.height-_*F,d&&(P*=-1),m!==0&&!B.showLabelBackdrop&&(w+=F/2*Math.sin(m))):(I=D,P=(1-_)*F/2);let Z;if(B.showLabelBackdrop){const O=Ft(B.backdropPadding),W=A.heights[b],q=A.widths[b];let Y=P-O.top,N=0-O.left;switch(k){case"middle":Y-=W/2;break;case"bottom":Y-=W;break}switch(E){case"center":N-=q/2;break;case"right":N-=q;break;case"inner":b===v-1?N-=q:b>0&&(N-=q/2);break}Z={left:N,top:Y,width:q+O.width,height:W+O.height,color:B.backdropColor}}p.push({label:C,font:$,textOffset:P,options:{rotation:m,color:R,strokeColor:V,strokeWidth:H,textAlign:L,textBaseline:k,translation:[w,I],backdrop:Z}})}return p}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Nn(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:a}}=this.options,o=this._getLabelSizes(),s=t+a,l=o.widest.width;let u,c;return n==="left"?i?(c=this.right+a,r==="near"?u="left":r==="center"?(u="center",c+=l/2):(u="right",c+=l)):(c=this.right-s,r==="near"?u="right":r==="center"?(u="center",c-=l/2):(u="left",c=this.left)):n==="right"?i?(c=this.left+a,r==="near"?u="right":r==="center"?(u="center",c-=l/2):(u="left",c-=l)):(c=this.left+s,r==="near"?u="left":r==="center"?(u="center",c+=l/2):(u="right",c=this.right)):u="right",{textAlign:u,x:c}}_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:a,height:o}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(r,i,a,o),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const i=this.ticks.findIndex(a=>a.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 a,o;const s=(l,u,c)=>{!c.width||!c.color||(r.save(),r.lineWidth=c.width,r.strokeStyle=c.color,r.setLineDash(c.borderDash||[]),r.lineDashOffset=c.borderDashOffset,r.beginPath(),r.moveTo(l.x,l.y),r.lineTo(u.x,u.y),r.stroke(),r.restore())};if(n.display)for(a=0,o=i.length;a<o;++a){const l=i[a];n.drawOnChartArea&&s({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.drawTicks&&s({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,a=r.setContext(this.getContext()),o=r.display?a.width:0;if(!o)return;const s=i.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let u,c,d,f;this.isHorizontal()?(u=Xr(t,this.left,o)-o/2,c=Xr(t,this.right,s)+s/2,d=f=l):(d=Xr(t,this.top,o)-o/2,f=Xr(t,this.bottom,s)+s/2,u=c=l),n.save(),n.lineWidth=a.width,n.strokeStyle=a.color,n.beginPath(),n.moveTo(u,d),n.lineTo(c,f),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,i=this._computeLabelArea();i&&dh(r,i);const a=this.getLabelItems(t);for(const o of a){const s=o.options,l=o.font,u=o.label,c=o.textOffset;Ci(r,u,0,c,l,s)}i&&fh(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:i}}=this;if(!r.display)return;const a=pt(r.font),o=Ft(r.padding),s=r.align;let l=a.lineHeight/2;n==="bottom"||n==="center"||Re(n)?(l+=o.bottom,at(r.text)&&(l+=a.lineHeight*(r.text.length-1))):l+=o.top;const{titleX:u,titleY:c,maxWidth:d,rotation:f}=bk(this,l,n,s);Ci(t,r.text,0,0,a,{color:r.color,maxWidth:d,rotation:f,textAlign:pk(s,n,i),textBaseline:"middle",translation:[u,c]})}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=Ce(t.grid&&t.grid.z,-1),i=Ce(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==_i.prototype.draw?[{z:n,draw:a=>{this.draw(a)}}]:[{z:r,draw:a=>{this.drawBackground(),this.drawGrid(a),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:a=>{this.drawLabels(a)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",i=[];let a,o;for(a=0,o=n.length;a<o;++a){const s=n[a];s[r]===this.id&&(!t||s.type===t)&&i.push(s)}return i}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return pt(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class As{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;xk(n)&&(r=this.register(n));const i=this.items,a=t.id,o=this.scope+"."+a;if(!a)throw new Error("class does not have id: "+t);return a in i||(i[a]=t,vk(t,o,r),this.override&&ot.override(t.id,t.overrides)),o}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 ot[i]&&(delete ot[i][r],this.override&&delete xi[r])}}function vk(e,t,n){const r=Ro(Object.create(null),[n?ot.get(n):{},ot.get(t),e.defaults]);ot.set(t,r),e.defaultRoutes&&yk(t,e.defaultRoutes),e.descriptors&&ot.describe(t,e.descriptors)}function yk(e,t){Object.keys(t).forEach(n=>{const r=n.split("."),i=r.pop(),a=[e].concat(r).join("."),o=t[n].split("."),s=o.pop(),l=o.join(".");ot.route(a,i,l,s)})}function xk(e){return"id"in e&&"defaults"in e}class Ck{constructor(){this.controllers=new As(qa,"datasets",!0),this.elements=new As(jr,"elements"),this.plugins=new As(Object,"plugins"),this.scales=new As(_i,"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 a=r||this._getRegistryForType(i);r||a.isForType(i)||a===this.plugins&&i.id?this._exec(t,a,i):He(i,o=>{const s=r||this._getRegistryForType(o);this._exec(t,s,o)})})}_exec(t,n,r){const i=oh(t);Ze(r["before"+i],[],r),n[t](r),Ze(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 kn=new Ck;class wk{constructor(){this._init=[]}notify(t,n,r,i){n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const a=i?this._descriptors(t).filter(i):this._descriptors(t),o=this._notify(a,t,n,r);return n==="afterDestroy"&&(this._notify(a,t,"stop"),this._notify(this._init,t,"uninstall")),o}_notify(t,n,r,i){i=i||{};for(const a of t){const o=a.plugin,s=o[r],l=[n,i,a.options];if(Ze(s,l,o)===!1&&i.cancelable)return!1}return!0}invalidate(){Je(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=Ce(r.options&&r.options.plugins,{}),a=Dk(r);return i===!1&&!n?[]:Ik(t,a,i,n)}_notifyStateChanges(t){const n=this._oldCache||[],r=this._cache,i=(a,o)=>a.filter(s=>!o.some(l=>s.plugin.id===l.plugin.id));this._notify(i(n,r),t,"stop"),this._notify(i(r,n),t,"start")}}function Dk(e){const t={},n=[],r=Object.keys(kn.plugins.items);for(let a=0;a<r.length;a++)n.push(kn.getPlugin(r[a]));const i=e.plugins||[];for(let a=0;a<i.length;a++){const o=i[a];n.indexOf(o)===-1&&(n.push(o),t[o.id]=!0)}return{plugins:n,localIds:t}}function Sk(e,t){return!t&&e===!1?null:e===!0?{}:e}function Ik(e,{plugins:t,localIds:n},r,i){const a=[],o=e.getContext();for(const s of t){const l=s.id,u=Sk(r[l],i);u!==null&&a.push({plugin:s,options:Ek(e.config,{plugin:s,local:n[l]},u,o)})}return a}function Ek(e,{plugin:t,local:n},r,i){const a=e.pluginScopeKeys(t),o=e.getOptionScopes(r,a);return n&&t.defaults&&o.push(t.defaults),e.createResolver(o,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Rd(e,t){const n=ot.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function _k(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function $k(e,t){return e===t?"_index_":"_value_"}function Op(e){if(e==="x"||e==="y"||e==="r")return e}function Rk(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function Ad(e,...t){if(Op(e))return e;for(const n of t){const r=n.axis||Rk(n.position)||e.length>1&&Op(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function Np(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function Ak(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 Np(e,"x",n[0])||Np(e,"y",n[0])}return{}}function Fk(e,t){const n=xi[e.type]||{scales:{}},r=t.scales||{},i=Rd(e.type,t),a=Object.create(null);return Object.keys(r).forEach(o=>{const s=r[o];if(!Re(s))return console.error(`Invalid scale configuration for scale: ${o}`);if(s._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const l=Ad(o,s,Ak(o,e),ot.scales[s.type]),u=$k(l,i),c=n.scales||{};a[o]=Ua(Object.create(null),[{axis:l},s,c[l],c[u]])}),e.data.datasets.forEach(o=>{const s=o.type||e.type,l=o.indexAxis||Rd(s,t),c=(xi[s]||{}).scales||{};Object.keys(c).forEach(d=>{const f=_k(d,l),h=o[f+"AxisID"]||f;a[h]=a[h]||Object.create(null),Ua(a[h],[{axis:f},r[h],c[d]])})}),Object.keys(a).forEach(o=>{const s=a[o];Ua(s,[ot.scales[s.type],ot.scale])}),a}function u3(e){const t=e.options||(e.options={});t.plugins=Ce(t.plugins,{}),t.scales=Fk(e,t)}function c3(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function Pk(e){return e=e||{},e.data=c3(e.data),u3(e),e}const Lp=new Map,d3=new Set;function Fs(e,t){let n=Lp.get(e);return n||(n=t(),Lp.set(e,n),d3.add(n)),n}const Ra=(e,t,n)=>{const r=Ao(t,n);r!==void 0&&e.add(r)};class Tk{constructor(t){this._config=Pk(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=c3(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(),u3(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Fs(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return Fs(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return Fs(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return Fs(`${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:a}=this,o=this._cachedScopes(t,r),s=o.get(n);if(s)return s;const l=new Set;n.forEach(c=>{t&&(l.add(t),c.forEach(d=>Ra(l,t,d))),c.forEach(d=>Ra(l,i,d)),c.forEach(d=>Ra(l,xi[a]||{},d)),c.forEach(d=>Ra(l,ot,d)),c.forEach(d=>Ra(l,_d,d))});const u=Array.from(l);return u.length===0&&u.push(Object.create(null)),d3.has(n)&&o.set(n,u),u}chartOptionScopes(){const{options:t,type:n}=this;return[t,xi[n]||{},ot.datasets[n]||{},{type:n},ot,_d]}resolveNamedOptions(t,n,r,i=[""]){const a={$shared:!0},{resolver:o,subPrefixes:s}=jp(this._resolverCache,t,i);let l=o;if(Mk(o,n)){a.$shared=!1,r=Mr(r)?r():r;const u=this.createResolver(t,r,s);l=fa(o,r,u)}for(const u of n)a[u]=l[u];return a}createResolver(t,n,r=[""],i){const{resolver:a}=jp(this._resolverCache,t,r);return Re(n)?fa(a,n,void 0,i):a}}function jp(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const i=n.join();let a=r.get(i);return a||(a={resolver:gh(t,n),subPrefixes:n.filter(s=>!s.toLowerCase().includes("hover"))},r.set(i,a)),a}const kk=e=>Re(e)&&Object.getOwnPropertyNames(e).some(t=>Mr(e[t]));function Mk(e,t){const{isScriptable:n,isIndexable:r}=Y4(e);for(const i of t){const a=n(i),o=r(i),s=(o||a)&&e[i];if(a&&(Mr(s)||kk(s))||o&&at(s))return!0}return!1}var Bk="4.4.3";const Vk=["top","bottom","left","right","chartArea"];function Hp(e,t){return e==="top"||e==="bottom"||Vk.indexOf(e)===-1&&t==="x"}function Wp(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function zp(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),Ze(n&&n.onComplete,[e],t)}function Ok(e){const t=e.chart,n=t.options.animation;Ze(n&&n.onProgress,[e],t)}function f3(e){return bh()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const qs={},Gp=e=>{const t=f3(e);return Object.values(qs).filter(n=>n.canvas===t).pop()};function Nk(e,t,n){const r=Object.keys(e);for(const i of r){const a=+i;if(a>=t){const o=e[i];delete e[i],(n>0||a>t)&&(e[a+n]=o)}}}function Lk(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}function Ps(e,t,n){return e.options.clip?e[n]:t[n]}function jk(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:Ps(n,t,"left"),right:Ps(n,t,"right"),top:Ps(r,t,"top"),bottom:Ps(r,t,"bottom")}:t}var br;let Su=(br=class{static register(...t){kn.add(...t),Zp()}static unregister(...t){kn.remove(...t),Zp()}constructor(t,n){const r=this.config=new Tk(n),i=f3(t),a=Gp(i);if(a)throw new Error("Canvas is already in use. Chart with ID '"+a.id+"' must be destroyed before the canvas with ID '"+a.canvas.id+"' can be reused.");const o=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||ik(i)),this.platform.updateConfig(r);const s=this.platform.acquireContext(i,o.aspectRatio),l=s&&s.canvas,u=l&&l.height,c=l&&l.width;if(this.id=J7(),this.ctx=s,this.canvas=l,this.width=c,this.height=u,this._options=o,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 wk,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=hP(d=>this.update(d),o.resizeDelay||0),this._dataChanges=[],qs[this.id]=this,!s||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Kn.listen(this,"complete",zp),Kn.listen(this,"progress",Ok),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:i,_aspectRatio:a}=this;return Je(t)?n&&a?a: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 kn}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():pp(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return hp(this.canvas,this.ctx),this}stop(){return Kn.stop(this),this}resize(t,n){Kn.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const r=this.options,i=this.canvas,a=r.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(i,t,n,a),s=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,pp(this,s,!0)&&(this.notifyPlugins("resize",{size:o}),Ze(r.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};He(n,(r,i)=>{r.id=i})}buildOrUpdateScales(){const t=this.options,n=t.scales,r=this.scales,i=Object.keys(r).reduce((o,s)=>(o[s]=!1,o),{});let a=[];n&&(a=a.concat(Object.keys(n).map(o=>{const s=n[o],l=Ad(o,s),u=l==="r",c=l==="x";return{options:s,dposition:u?"chartArea":c?"bottom":"left",dtype:u?"radialLinear":c?"category":"linear"}}))),He(a,o=>{const s=o.options,l=s.id,u=Ad(l,s),c=Ce(s.type,o.dtype);(s.position===void 0||Hp(s.position,u)!==Hp(o.dposition))&&(s.position=o.dposition),i[l]=!0;let d=null;if(l in r&&r[l].type===c)d=r[l];else{const f=kn.getScale(c);d=new f({id:l,type:c,ctx:this.ctx,chart:this}),r[d.id]=d}d.init(s,t)}),He(i,(o,s)=>{o||delete r[s]}),He(r,o=>{bn.configure(this,o,o.options),bn.addBox(this,o)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,r=t.length;if(t.sort((i,a)=>i.index-a.index),r>n){for(let i=n;i<r;++i)this._destroyDatasetMeta(i);t.splice(n,r-n)}this._sortedMetasets=t.slice(0).sort(Wp("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((r,i)=>{n.filter(a=>a===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 a=n[r];let o=this.getDatasetMeta(r);const s=a.type||this.config.type;if(o.type&&o.type!==s&&(this._destroyDatasetMeta(r),o=this.getDatasetMeta(r)),o.type=s,o.indexAxis=a.indexAxis||Rd(s,this.options),o.order=a.order||0,o.index=r,o.label=""+a.label,o.visible=this.isDatasetVisible(r),o.controller)o.controller.updateIndex(r),o.controller.linkScales();else{const l=kn.getController(s),{datasetElementType:u,dataElementType:c}=ot.datasets[s];Object.assign(l,{dataElementType:kn.getElement(c),datasetElementType:u&&kn.getElement(u)}),o.controller=new l(this,r),t.push(o.controller)}}return this._updateMetasets(),t}_resetElements(){He(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 a=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let u=0,c=this.data.datasets.length;u<c;u++){const{controller:d}=this.getDatasetMeta(u),f=!i&&a.indexOf(d)===-1;d.buildOrUpdateElements(f),o=Math.max(+d.getMaxOverflow(),o)}o=this._minPadding=r.layout.autoPadding?o:0,this._updateLayout(o),i||He(a,u=>{u.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Wp("z","_idx"));const{_active:s,_lastEvent:l}=this;l?this._eventHandler(l,!0):s.length&&this._updateHoverStyles(s,s,!0),this.render()}_updateScales(){He(this.scales,t=>{bn.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!ip(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:a}of n){const o=r==="_removeElements"?-a:a;Nk(t,i,o)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=a=>new Set(t.filter(o=>o[0]===a).map((o,s)=>s+","+o.splice(1).join(","))),i=r(0);for(let a=1;a<n;a++)if(!ip(i,r(a)))return;return Array.from(i).map(a=>a.split(",")).map(a=>({method:a[1],start:+a[2],count:+a[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;bn.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],He(this.boxes,i=>{r&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()))},this),this._layers.forEach((i,a)=>{i._idx=a}),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,Mr(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&&(Kn.has(this)?this.attached&&!Kn.running(this)&&Kn.start(this):(this.draw(),zp({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,a;for(i=0,a=n.length;i<a;++i){const o=n[i];(!t||o.visible)&&r.push(o)}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,a=jk(t,this.chartArea),o={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(i&&dh(n,{left:r.left===!1?0:a.left-r.left,right:r.right===!1?this.width:a.right+r.right,top:r.top===!1?0:a.top-r.top,bottom:r.bottom===!1?this.height:a.bottom+r.bottom}),t.controller.draw(),i&&fh(n),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return lr(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,i){const a=VT.modes[n];return typeof a=="function"?a(this,t,r,i):[]}getDatasetMeta(t){const n=this.data.datasets[t],r=this._metasets;let i=r.filter(a=>a&&a._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=Lr(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",a=this.getDatasetMeta(t),o=a.controller._resolveAnimations(void 0,i);Ll(n)?(a.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),o.update(a,{visible:r}),this.update(s=>s.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(),Kn.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(),hp(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete qs[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=(a,o)=>{n.addEventListener(this,a,o),t[a]=o},i=(a,o,s)=>{a.offsetX=o,a.offsetY=s,this._eventHandler(a)};He(this.options.events,a=>r(a,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,r=(l,u)=>{n.addEventListener(this,l,u),t[l]=u},i=(l,u)=>{t[l]&&(n.removeEventListener(this,l,u),delete t[l])},a=(l,u)=>{this.canvas&&this.resize(l,u)};let o;const s=()=>{i("attach",s),this.attached=!0,this.resize(),r("resize",a),r("detach",o)};o=()=>{this.attached=!1,i("resize",a),this._stop(),this._resize(0,0),r("attach",s)},n.isAttached(this.canvas)?s():o()}unbindEvents(){He(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},He(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,r){const i=r?"set":"remove";let a,o,s,l;for(n==="dataset"&&(a=this.getDatasetMeta(t[0].datasetIndex),a.controller["_"+i+"DatasetHoverStyle"]()),s=0,l=t.length;s<l;++s){o=t[s];const u=o&&this.getDatasetMeta(o.datasetIndex).controller;u&&u[i+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],r=t.map(({datasetIndex:a,index:o})=>{const s=this.getDatasetMeta(a);if(!s)throw new Error("No dataset found at index "+a);return{datasetIndex:a,element:s.data[o],index:o}});!Ol(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,a=(l,u)=>l.filter(c=>!u.some(d=>c.datasetIndex===d.datasetIndex&&c.index===d.index)),o=a(n,t),s=r?t:a(t,n);o.length&&this.updateHoverStyle(o,i.mode,!1),s.length&&i.mode&&this.updateHoverStyle(s,i.mode,!0)}_eventHandler(t,n){const r={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},i=o=>(o.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,i)===!1)return;const a=this._handleEvent(t,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,i),(a||r.changed)&&this.render(),this}_handleEvent(t,n,r){const{_active:i=[],options:a}=this,o=n,s=this._getActiveElements(t,i,r,o),l=nP(t),u=Lk(t,this._lastEvent,r,l);r&&(this._lastEvent=null,Ze(a.onHover,[t,s,this],this),l&&Ze(a.onClick,[t,s,this],this));const c=!Ol(s,i);return(c||n)&&(this._active=s,this._updateHoverStyles(s,i,n)),this._lastEvent=u,c}_getActiveElements(t,n,r,i){if(t.type==="mouseout")return[];if(!r)return n;const a=this.options.hover;return this.getElementsAtEventForMode(t,a.mode,a,i)}},ie(br,"defaults",ot),ie(br,"instances",qs),ie(br,"overrides",xi),ie(br,"registry",kn),ie(br,"version",Bk),ie(br,"getChart",Gp),br);function Zp(){return He(Su.instances,e=>e._plugins.invalidate())}function Hk(e,t,n){const{startAngle:r,pixelMargin:i,x:a,y:o,outerRadius:s,innerRadius:l}=t;let u=i/s;e.beginPath(),e.arc(a,o,s,r-u,n+u),l>i?(u=i/l,e.arc(a,o,l,n+u,r-u,!0)):e.arc(a,o,i,n+dt,r-dt),e.closePath(),e.clip()}function Wk(e){return hh(e,["outerStart","outerEnd","innerStart","innerEnd"])}function zk(e,t,n,r){const i=Wk(e.options.borderRadius),a=(n-t)/2,o=Math.min(a,r*t/2),s=l=>{const u=(n-Math.min(a,l))*r/2;return tn(l,0,Math.min(a,u))};return{outerStart:s(i.outerStart),outerEnd:s(i.outerEnd),innerStart:tn(i.innerStart,0,o),innerEnd:tn(i.innerEnd,0,o)}}function Hi(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function Xl(e,t,n,r,i,a){const{x:o,y:s,startAngle:l,pixelMargin:u,innerRadius:c}=t,d=Math.max(t.outerRadius+r+n-u,0),f=c>0?c+r+n+u:0;let h=0;const g=i-l;if(r){const B=c>0?c-r:0,T=d>0?d-r:0,R=(B+T)/2,V=R!==0?g*R/(R+r):g;h=(g-V)/2}const m=Math.max(.001,g*d-n/Qe)/d,p=(g-m)/2,b=l+p+h,v=i-p-h,{outerStart:y,outerEnd:C,innerStart:w,innerEnd:I}=zk(t,f,d,v-b),E=d-y,D=d-C,$=b+y/E,F=v-C/D,_=f+w,P=f+I,k=b+w/_,A=v-I/P;if(e.beginPath(),a){const B=($+F)/2;if(e.arc(o,s,d,$,B),e.arc(o,s,d,B,F),C>0){const H=Hi(D,F,o,s);e.arc(H.x,H.y,C,F,v+dt)}const T=Hi(P,v,o,s);if(e.lineTo(T.x,T.y),I>0){const H=Hi(P,A,o,s);e.arc(H.x,H.y,I,v+dt,A+Math.PI)}const R=(v-I/f+(b+w/f))/2;if(e.arc(o,s,f,v-I/f,R,!0),e.arc(o,s,f,R,b+w/f,!0),w>0){const H=Hi(_,k,o,s);e.arc(H.x,H.y,w,k+Math.PI,b-dt)}const V=Hi(E,b,o,s);if(e.lineTo(V.x,V.y),y>0){const H=Hi(E,$,o,s);e.arc(H.x,H.y,y,b-dt,$)}}else{e.moveTo(o,s);const B=Math.cos($)*d+o,T=Math.sin($)*d+s;e.lineTo(B,T);const R=Math.cos(F)*d+o,V=Math.sin(F)*d+s;e.lineTo(R,V)}e.closePath()}function Gk(e,t,n,r,i){const{fullCircles:a,startAngle:o,circumference:s}=t;let l=t.endAngle;if(a){Xl(e,t,n,r,l,i);for(let u=0;u<a;++u)e.fill();isNaN(s)||(l=o+(s%Ke||Ke))}return Xl(e,t,n,r,l,i),e.fill(),l}function Zk(e,t,n,r,i){const{fullCircles:a,startAngle:o,circumference:s,options:l}=t,{borderWidth:u,borderJoinStyle:c,borderDash:d,borderDashOffset:f}=l,h=l.borderAlign==="inner";if(!u)return;e.setLineDash(d||[]),e.lineDashOffset=f,h?(e.lineWidth=u*2,e.lineJoin=c||"round"):(e.lineWidth=u,e.lineJoin=c||"bevel");let g=t.endAngle;if(a){Xl(e,t,n,r,g,i);for(let m=0;m<a;++m)e.stroke();isNaN(s)||(g=o+(s%Ke||Ke))}h&&Hk(e,t,g),a||(Xl(e,t,n,r,g,i),e.stroke())}class Na extends jr{constructor(n){super();ie(this,"circumference");ie(this,"endAngle");ie(this,"fullCircles");ie(this,"innerRadius");ie(this,"outerRadius");ie(this,"pixelMargin");ie(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 a=this.getProps(["x","y"],i),{angle:o,distance:s}=H4(a,{x:n,y:r}),{startAngle:l,endAngle:u,innerRadius:c,outerRadius:d,circumference:f}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),h=(this.options.spacing+this.options.borderWidth)/2,m=Ce(f,u-l)>=Ke||Fo(o,l,u),p=Xi(s,c+h,d+h);return m&&p}getCenterPoint(n){const{x:r,y:i,startAngle:a,endAngle:o,innerRadius:s,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:u,spacing:c}=this.options,d=(a+o)/2,f=(s+l+c+u)/2;return{x:r+Math.cos(d)*f,y:i+Math.sin(d)*f}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:r,circumference:i}=this,a=(r.offset||0)/4,o=(r.spacing||0)/2,s=r.circular;if(this.pixelMargin=r.borderAlign==="inner"?.33:0,this.fullCircles=i>Ke?Math.floor(i/Ke):0,i===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const l=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(l)*a,Math.sin(l)*a);const u=1-Math.sin(Math.min(Qe,i||0)),c=a*u;n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,Gk(n,this,c,o,s),Zk(n,this,c,o,s),n.restore()}}ie(Na,"id","arc"),ie(Na,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),ie(Na,"defaultRoutes",{backgroundColor:"backgroundColor"}),ie(Na,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function h3(e,t,n=t){e.lineCap=Ce(n.borderCapStyle,t.borderCapStyle),e.setLineDash(Ce(n.borderDash,t.borderDash)),e.lineDashOffset=Ce(n.borderDashOffset,t.borderDashOffset),e.lineJoin=Ce(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=Ce(n.borderWidth,t.borderWidth),e.strokeStyle=Ce(n.borderColor,t.borderColor)}function Xk(e,t,n){e.lineTo(n.x,n.y)}function Yk(e){return e.stepped?IP:e.tension||e.cubicInterpolationMode==="monotone"?EP:Xk}function g3(e,t,n={}){const r=e.length,{start:i=0,end:a=r-1}=n,{start:o,end:s}=t,l=Math.max(i,o),u=Math.min(a,s),c=i<o&&a<o||i>s&&a>s;return{count:r,start:l,loop:t.loop,ilen:u<l&&!c?r+u-l:u-l}}function Uk(e,t,n,r){const{points:i,options:a}=t,{count:o,start:s,loop:l,ilen:u}=g3(i,n,r),c=Yk(a);let{move:d=!0,reverse:f}=r||{},h,g,m;for(h=0;h<=u;++h)g=i[(s+(f?u-h:h))%o],!g.skip&&(d?(e.moveTo(g.x,g.y),d=!1):c(e,m,g,f,a.stepped),m=g);return l&&(g=i[(s+(f?u:0))%o],c(e,m,g,f,a.stepped)),!!l}function Jk(e,t,n,r){const i=t.points,{count:a,start:o,ilen:s}=g3(i,n,r),{move:l=!0,reverse:u}=r||{};let c=0,d=0,f,h,g,m,p,b;const v=C=>(o+(u?s-C:C))%a,y=()=>{m!==p&&(e.lineTo(c,p),e.lineTo(c,m),e.lineTo(c,b))};for(l&&(h=i[v(0)],e.moveTo(h.x,h.y)),f=0;f<=s;++f){if(h=i[v(f)],h.skip)continue;const C=h.x,w=h.y,I=C|0;I===g?(w<m?m=w:w>p&&(p=w),c=(d*c+C)/++d):(y(),e.lineTo(C,w),g=I,d=0,m=p=w),b=w}y()}function Fd(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?Jk:Uk}function Kk(e){return e.stepped?aT:e.tension||e.cubicInterpolationMode==="monotone"?oT:ei}function Qk(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),h3(e,t.options),e.stroke(i)}function qk(e,t,n,r){const{segments:i,options:a}=t,o=Fd(t);for(const s of i)h3(e,a,s.style),e.beginPath(),o(e,t,s,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const eM=typeof Path2D=="function";function tM(e,t,n,r){eM&&!t.options.segment?Qk(e,t,n,r):qk(e,t,n,r)}class La extends jr{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;KP(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=gT(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],a=this.points,o=dT(this,{property:n,start:i,end:i});if(!o.length)return;const s=[],l=Kk(r);let u,c;for(u=0,c=o.length;u<c;++u){const{start:d,end:f}=o[u],h=a[d],g=a[f];if(h===g){s.push(h);continue}const m=Math.abs((i-h[n])/(g[n]-h[n])),p=l(h,g,m,r.stepped);p[n]=t[n],s.push(p)}return s.length===1?s[0]:s}pathSegment(t,n,r){return Fd(this)(t,this,n,r)}path(t,n,r){const i=this.segments,a=Fd(this);let o=this._loop;n=n||0,r=r||this.points.length-n;for(const s of i)o&=a(t,this,s,{start:n,end:n+r-1});return!!o}draw(t,n,r,i){const a=this.options||{};(this.points||[]).length&&a.borderWidth&&(t.save(),tM(t,this,r,i),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}ie(La,"id","line"),ie(La,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),ie(La,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),ie(La,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function Xp(e,t,n,r){const i=e.options,{[n]:a}=e.getProps([n],r);return Math.abs(t-a)<i.radius+i.hitRadius}class el extends jr{constructor(n){super();ie(this,"parsed");ie(this,"skip");ie(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 a=this.options,{x:o,y:s}=this.getProps(["x","y"],i);return Math.pow(n-o,2)+Math.pow(r-s,2)<Math.pow(a.hitRadius+a.radius,2)}inXRange(n,r){return Xp(this,n,"x",r)}inYRange(n,r){return Xp(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||!lr(this,r,this.size(i)/2)||(n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.fillStyle=i.backgroundColor,$d(n,i,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}ie(el,"id","point"),ie(el,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),ie(el,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});const Yp=(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)}},nM=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class Up extends jr{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=Ze(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=pt(r.font),a=i.size,o=this._computeTitleHeight(),{boxWidth:s,itemHeight:l}=Yp(r,a);let u,c;n.font=i.string,this.isHorizontal()?(u=this.maxWidth,c=this._fitRows(o,a,s,l)+10):(c=this.maxHeight,u=this._fitCols(o,i,s,l)+10),this.width=Math.min(u,t.maxWidth||this.maxWidth),this.height=Math.min(c,t.maxHeight||this.maxHeight)}_fitRows(t,n,r,i){const{ctx:a,maxWidth:o,options:{labels:{padding:s}}}=this,l=this.legendHitBoxes=[],u=this.lineWidths=[0],c=i+s;let d=t;a.textAlign="left",a.textBaseline="middle";let f=-1,h=-c;return this.legendItems.forEach((g,m)=>{const p=r+n/2+a.measureText(g.text).width;(m===0||u[u.length-1]+p+2*s>o)&&(d+=c,u[u.length-(m>0?0:1)]=0,h+=c,f++),l[m]={left:0,top:h,row:f,width:p,height:i},u[u.length-1]+=p+s}),d}_fitCols(t,n,r,i){const{ctx:a,maxHeight:o,options:{labels:{padding:s}}}=this,l=this.legendHitBoxes=[],u=this.columnSizes=[],c=o-t;let d=s,f=0,h=0,g=0,m=0;return this.legendItems.forEach((p,b)=>{const{itemWidth:v,itemHeight:y}=rM(r,n,a,p,i);b>0&&h+y+2*s>c&&(d+=f+s,u.push({width:f,height:h}),g+=f+s,m++,f=h=0),l[b]={left:g,top:h,col:m,width:v,height:y},f=Math.max(f,v),h+=y+s}),d+=f,u.push({width:f,height:h}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:i},rtl:a}}=this,o=ra(a,this.left,this.width);if(this.isHorizontal()){let s=0,l=_t(r,this.left+i,this.right-this.lineWidths[s]);for(const u of n)s!==u.row&&(s=u.row,l=_t(r,this.left+i,this.right-this.lineWidths[s])),u.top+=this.top+t+i,u.left=o.leftForLtr(o.x(l),u.width),l+=u.width+i}else{let s=0,l=_t(r,this.top+t+i,this.bottom-this.columnSizes[s].height);for(const u of n)u.col!==s&&(s=u.col,l=_t(r,this.top+t+i,this.bottom-this.columnSizes[s].height)),u.top=l,u.left+=this.left+i,u.left=o.leftForLtr(o.x(u.left),u.width),l+=u.height+i}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;dh(t,this),this._draw(),fh(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:i}=this,{align:a,labels:o}=t,s=ot.color,l=ra(t.rtl,this.left,this.width),u=pt(o.font),{padding:c}=o,d=u.size,f=d/2;let h;this.drawTitle(),i.textAlign=l.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=u.string;const{boxWidth:g,boxHeight:m,itemHeight:p}=Yp(o,d),b=function(I,E,D){if(isNaN(g)||g<=0||isNaN(m)||m<0)return;i.save();const $=Ce(D.lineWidth,1);if(i.fillStyle=Ce(D.fillStyle,s),i.lineCap=Ce(D.lineCap,"butt"),i.lineDashOffset=Ce(D.lineDashOffset,0),i.lineJoin=Ce(D.lineJoin,"miter"),i.lineWidth=$,i.strokeStyle=Ce(D.strokeStyle,s),i.setLineDash(Ce(D.lineDash,[])),o.usePointStyle){const F={radius:m*Math.SQRT2/2,pointStyle:D.pointStyle,rotation:D.rotation,borderWidth:$},_=l.xPlus(I,g/2),P=E+f;X4(i,F,_,P,o.pointStyleWidth&&g)}else{const F=E+Math.max((d-m)/2,0),_=l.leftForLtr(I,g),P=na(D.borderRadius);i.beginPath(),Object.values(P).some(k=>k!==0)?zl(i,{x:_,y:F,w:g,h:m,radius:P}):i.rect(_,F,g,m),i.fill(),$!==0&&i.stroke()}i.restore()},v=function(I,E,D){Ci(i,D.text,I,E+p/2,u,{strikethrough:D.hidden,textAlign:l.textAlign(D.textAlign)})},y=this.isHorizontal(),C=this._computeTitleHeight();y?h={x:_t(a,this.left+c,this.right-r[0]),y:this.top+c+C,line:0}:h={x:this.left+c,y:_t(a,this.top+C+c,this.bottom-n[0].height),line:0},q4(this.ctx,t.textDirection);const w=p+c;this.legendItems.forEach((I,E)=>{i.strokeStyle=I.fontColor,i.fillStyle=I.fontColor;const D=i.measureText(I.text).width,$=l.textAlign(I.textAlign||(I.textAlign=o.textAlign)),F=g+f+D;let _=h.x,P=h.y;l.setWidth(this.width),y?E>0&&_+F+c>this.right&&(P=h.y+=w,h.line++,_=h.x=_t(a,this.left+c,this.right-r[h.line])):E>0&&P+w>this.bottom&&(_=h.x=_+n[h.line].width+c,h.line++,P=h.y=_t(a,this.top+C+c,this.bottom-n[h.line].height));const k=l.x(_);if(b(k,P,I),_=gP($,_+g+f,y?_+F:this.right,t.rtl),v(l.x(_),P,I),y)h.x+=F+c;else if(typeof I.text!="string"){const A=u.lineHeight;h.y+=m3(I,A)+c}else h.y+=w}),e3(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=pt(n.font),i=Ft(n.padding);if(!n.display)return;const a=ra(t.rtl,this.left,this.width),o=this.ctx,s=n.position,l=r.size/2,u=i.top+l;let c,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),c=this.top+u,d=_t(t.align,d,this.right-f);else{const g=this.columnSizes.reduce((m,p)=>Math.max(m,p.height),0);c=u+_t(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}const h=_t(s,d,d+f);o.textAlign=a.textAlign(uh(s)),o.textBaseline="middle",o.strokeStyle=n.color,o.fillStyle=n.color,o.font=r.string,Ci(o,n.text,h,c,r)}_computeTitleHeight(){const t=this.options.title,n=pt(t.font),r=Ft(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,i,a;if(Xi(t,this.left,this.right)&&Xi(n,this.top,this.bottom)){for(a=this.legendHitBoxes,r=0;r<a.length;++r)if(i=a[r],Xi(t,i.left,i.left+i.width)&&Xi(n,i.top,i.top+i.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!oM(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const i=this._hoveredItem,a=nM(i,r);i&&!a&&Ze(n.onLeave,[t,i,this],this),this._hoveredItem=r,r&&!a&&Ze(n.onHover,[t,r,this],this)}else r&&Ze(n.onClick,[t,r,this],this)}}function rM(e,t,n,r,i){const a=iM(r,e,t,n),o=aM(i,r,t.lineHeight);return{itemWidth:a,itemHeight:o}}function iM(e,t,n,r){let i=e.text;return i&&typeof i!="string"&&(i=i.reduce((a,o)=>a.length>o.length?a:o)),t+n.size/2+r.measureText(i).width}function aM(e,t,n){let r=e;return typeof t.text!="string"&&(r=m3(t,n)),r}function m3(e,t){const n=e.text?e.text.length:0;return t*n}function oM(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var sM={id:"legend",_element:Up,start(e,t,n){const r=e.legend=new Up({ctx:e.ctx,options:n,chart:e});bn.configure(e,r,n),bn.addBox(e,r)},stop(e){bn.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;bn.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:a,useBorderRadius:o,borderRadius:s}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const u=l.controller.getStyle(n?0:void 0),c=Ft(u.borderWidth);return{text:t[l.index].label,fillStyle:u.backgroundColor,fontColor:a,hidden:!l.visible,lineCap:u.borderCapStyle,lineDash:u.borderDash,lineDashOffset:u.borderDashOffset,lineJoin:u.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:u.borderColor,pointStyle:r||u.pointStyle,rotation:u.rotation,textAlign:i||u.textAlign,borderRadius:o&&(s||u.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 p3 extends jr{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=at(r.text)?r.text.length:1;this._padding=Ft(r.padding);const a=i*pt(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=a:this.width=a}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:r,bottom:i,right:a,options:o}=this,s=o.align;let l=0,u,c,d;return this.isHorizontal()?(c=_t(s,r,a),d=n+t,u=a-r):(o.position==="left"?(c=r+t,d=_t(s,i,n),l=Qe*-.5):(c=a-t,d=_t(s,n,i),l=Qe*.5),u=i-n),{titleX:c,titleY:d,maxWidth:u,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const r=pt(n.font),a=r.lineHeight/2+this._padding.top,{titleX:o,titleY:s,maxWidth:l,rotation:u}=this._drawArgs(a);Ci(t,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:u,textAlign:uh(n.align),textBaseline:"middle",translation:[o,s]})}}function lM(e,t){const n=new p3({ctx:e.ctx,options:t,chart:e});bn.configure(e,n,t),bn.addBox(e,n),e.titleBlock=n}var uM={id:"title",_element:p3,start(e,t,n){lM(e,n)},stop(e){const t=e.titleBlock;bn.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;bn.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 ja={average(e){if(!e.length)return!1;let t,n,r=new Set,i=0,a=0;for(t=0,n=e.length;t<n;++t){const s=e[t].element;if(s&&s.hasValue()){const l=s.tooltipPosition();r.add(l.x),i+=l.y,++a}}return{x:[...r].reduce((s,l)=>s+l)/r.size,y:i/a}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,i=Number.POSITIVE_INFINITY,a,o,s;for(a=0,o=e.length;a<o;++a){const l=e[a].element;if(l&&l.hasValue()){const u=l.getCenterPoint(),c=Id(t,u);c<i&&(i=c,s=l)}}if(s){const l=s.tooltipPosition();n=l.x,r=l.y}return{x:n,y:r}}};function Pn(e,t){return t&&(at(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Qn(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
|
172
|
+
*/class bT{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,r,i){const a=n.listeners[i],o=n.duration;a.forEach(s=>s({chart:t,initial:n.initial,numSteps:o,currentStep:Math.min(r-n.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=z4.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 a=r.items;let o=a.length-1,s=!1,l;for(;o>=0;--o)l=a[o],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(t),s=!0):(a[o]=a[a.length-1],a.pop());s&&(i.draw(),this._notify(i,r,t,"progress")),a.length||(r.running=!1,this._notify(i,r,t,"complete"),r.initial=!1),n+=a.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 Kn=new bT;const Cp="transparent",vT={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=dp(e||Cp),i=r.valid&&dp(t||Cp);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class yT{constructor(t,n,r,i){const a=n[r];i=Is([t.to,i,a,t.from]);const o=Is([t.from,a,i]);this._active=!0,this._fn=t.fn||vT[t.type||typeof o],this._easing=Ka[t.easing]||Ka.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=o,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],a=r-this._start,o=this._duration-a;this._start=r,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=a,this._loop=!!t.loop,this._to=Is([t.to,n,i,t.from]),this._from=Is([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,a=this._from,o=this._loop,s=this._to;let l;if(this._active=a!==s&&(o||n<r),!this._active){this._target[i]=s,this._notify(!0);return}if(n<0){this._target[i]=a;return}l=n/r%2,l=o&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[i]=this._fn(a,s,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 n3{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!Re(t))return;const n=Object.keys(ot.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const a=t[i];if(!Re(a))return;const o={};for(const s of n)o[s]=a[s];(at(a.properties)&&a.properties||[i]).forEach(s=>{(s===i||!r.has(s))&&r.set(s,o)})})}_animateOptions(t,n){const r=n.options,i=CT(t,r);if(!i)return[];const a=this._createAnimations(i,r);return r.$shared&&xT(t.options.$animations,r).then(()=>{t.options=r},()=>{}),a}_createAnimations(t,n){const r=this._properties,i=[],a=t.$animations||(t.$animations={}),o=Object.keys(n),s=Date.now();let l;for(l=o.length-1;l>=0;--l){const u=o[l];if(u.charAt(0)==="$")continue;if(u==="options"){i.push(...this._animateOptions(t,n));continue}const c=n[u];let d=a[u];const f=r.get(u);if(d)if(f&&d.active()){d.update(f,c,s);continue}else d.cancel();if(!f||!f.duration){t[u]=c;continue}a[u]=d=new yT(f,t,u,c),i.push(d)}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 Kn.add(this._chart,r),!0}}function xT(e,t){const n=[],r=Object.keys(t);for(let i=0;i<r.length;i++){const a=e[r[i]];a&&a.active()&&n.push(a.wait())}return Promise.all(n)}function CT(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 wp(e,t){const n=e&&e.options||{},r=n.reverse,i=n.min===void 0?t:0,a=n.max===void 0?t:0;return{start:r?a:i,end:r?i:a}}function wT(e,t,n){if(n===!1)return!1;const r=wp(e,n),i=wp(t,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function DT(e){let t,n,r,i;return Re(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 r3(e,t){const n=[],r=e._getSortedDatasetMetas(t);let i,a;for(i=0,a=r.length;i<a;++i)n.push(r[i].index);return n}function Dp(e,t,n,r={}){const i=e.keys,a=r.mode==="single";let o,s,l,u;if(t!==null){for(o=0,s=i.length;o<s;++o){if(l=+i[o],l===n){if(r.all)continue;break}u=e.values[l],xt(u)&&(a||t===0||da(t)===da(u))&&(t+=u)}return t}}function ST(e,t){const{iScale:n,vScale:r}=t,i=n.axis==="x"?"x":"y",a=r.axis==="x"?"x":"y",o=Object.keys(e),s=new Array(o.length);let l,u,c;for(l=0,u=o.length;l<u;++l)c=o[l],s[l]={[i]:c,[a]:e[c]};return s}function Sp(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function IT(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function ET(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 _T(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function Ip(e,t,n,r){for(const i of t.getMatchingVisibleMetas(r).reverse()){const a=e[i.index];if(n&&a>0||!n&&a<0)return i.index}return null}function Ep(e,t){const{chart:n,_cachedMeta:r}=e,i=n._stacks||(n._stacks={}),{iScale:a,vScale:o,index:s}=r,l=a.axis,u=o.axis,c=IT(a,o,r),d=t.length;let f;for(let h=0;h<d;++h){const g=t[h],{[l]:m,[u]:p}=g,b=g._stacks||(g._stacks={});f=b[u]=_T(i,c,m),f[s]=p,f._top=Ip(f,o,!0,r.type),f._bottom=Ip(f,o,!1,r.type);const v=f._visualValues||(f._visualValues={});v[s]=p}}function wc(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function $T(e,t){return Lr(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function RT(e,t,n){return Lr(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function Ia(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 a=i._stacks;if(!a||a[r]===void 0||a[r][n]===void 0)return;delete a[r][n],a[r]._visualValues!==void 0&&a[r]._visualValues[n]!==void 0&&delete a[r]._visualValues[n]}}}const Dc=e=>e==="reset"||e==="none",_p=(e,t)=>t?e:Object.assign({},e),AT=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:r3(n,!0),values:null};class qa{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=Sp(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&&Ia(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),i=(d,f,h,g)=>d==="x"?f:d==="r"?g:h,a=n.xAxisID=Ce(r.xAxisID,wc(t,"x")),o=n.yAxisID=Ce(r.yAxisID,wc(t,"y")),s=n.rAxisID=Ce(r.rAxisID,wc(t,"r")),l=n.indexAxis,u=n.iAxisID=i(l,a,o,s),c=n.vAxisID=i(l,o,a,s);n.xScale=this.getScaleForId(a),n.yScale=this.getScaleForId(o),n.rScale=this.getScaleForId(s),n.iScale=this.getScaleForId(u),n.vScale=this.getScaleForId(c)}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&&lp(this._data,this),t._stacked&&Ia(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(Re(n)){const i=this._cachedMeta;this._data=ST(n,i)}else if(r!==n){if(r){lp(r,this);const i=this._cachedMeta;Ia(i),i._parsed=[]}n&&Object.isExtensible(n)&&dP(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 a=n._stacked;n._stacked=Sp(n.vScale,n),n.stack!==r.stack&&(i=!0,Ia(n),n.stack=r.stack),this._resyncElements(t),(i||a!==n._stacked)&&Ep(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:a,_stacked:o}=r,s=a.axis;let l=t===0&&n===i.length?!0:r._sorted,u=t>0&&r._parsed[t-1],c,d,f;if(this._parsing===!1)r._parsed=i,r._sorted=!0,f=i;else{at(i[t])?f=this.parseArrayData(r,i,t,n):Re(i[t])?f=this.parseObjectData(r,i,t,n):f=this.parsePrimitiveData(r,i,t,n);const h=()=>d[s]===null||u&&d[s]<u[s];for(c=0;c<n;++c)r._parsed[c+t]=d=f[c],l&&(h()&&(l=!1),u=d);r._sorted=l}o&&Ep(this,f)}parsePrimitiveData(t,n,r,i){const{iScale:a,vScale:o}=t,s=a.axis,l=o.axis,u=a.getLabels(),c=a===o,d=new Array(i);let f,h,g;for(f=0,h=i;f<h;++f)g=f+r,d[f]={[s]:c||a.parse(u[g],g),[l]:o.parse(n[g],g)};return d}parseArrayData(t,n,r,i){const{xScale:a,yScale:o}=t,s=new Array(i);let l,u,c,d;for(l=0,u=i;l<u;++l)c=l+r,d=n[c],s[l]={x:a.parse(d[0],c),y:o.parse(d[1],c)};return s}parseObjectData(t,n,r,i){const{xScale:a,yScale:o}=t,{xAxisKey:s="x",yAxisKey:l="y"}=this._parsing,u=new Array(i);let c,d,f,h;for(c=0,d=i;c<d;++c)f=c+r,h=n[f],u[c]={x:a.parse(Ao(h,s),f),y:o.parse(Ao(h,l),f)};return u}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,r){const i=this.chart,a=this._cachedMeta,o=n[t.axis],s={keys:r3(i,!0),values:n._stacks[t.axis]._visualValues};return Dp(s,o,a.index,{mode:r})}updateRangeFromParsed(t,n,r,i){const a=r[n.axis];let o=a===null?NaN:a;const s=i&&r._stacks[n.axis];i&&s&&(i.values=s,o=Dp(i,a,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,n){const r=this._cachedMeta,i=r._parsed,a=r._sorted&&t===r.iScale,o=i.length,s=this._getOtherScale(t),l=AT(n,r,this.chart),u={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:d}=ET(s);let f,h;function g(){h=i[f];const m=h[s.axis];return!xt(h[t.axis])||c>m||d<m}for(f=0;f<o&&!(!g()&&(this.updateRangeFromParsed(u,t,h,l),a));++f);if(a){for(f=o-1;f>=0;--f)if(!g()){this.updateRangeFromParsed(u,t,h,l);break}}return u}getAllParsedValues(t){const n=this._cachedMeta._parsed,r=[];let i,a,o;for(i=0,a=n.length;i<a;++i)o=n[i][t.axis],xt(o)&&r.push(o);return r}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,r=n.iScale,i=n.vScale,a=this.getParsed(t);return{label:r?""+r.getLabelForValue(a[r.axis]):"",value:i?""+i.getLabelForValue(a[i.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=DT(Ce(this.options.clip,wT(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,r=this._cachedMeta,i=r.data||[],a=n.chartArea,o=[],s=this._drawStart||0,l=this._drawCount||i.length-s,u=this.options.drawActiveElementsOnTop;let c;for(r.dataset&&r.dataset.draw(t,a,s,l),c=s;c<s+l;++c){const d=i[c];d.hidden||(d.active&&u?o.push(d):d.draw(t,a))}for(c=0;c<o.length;++c)o[c].draw(t,a)}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 a;if(t>=0&&t<this._cachedMeta.data.length){const o=this._cachedMeta.data[t];a=o.$context||(o.$context=RT(this.getContext(),t,o)),a.parsed=this.getParsed(t),a.raw=i.data[t],a.index=a.dataIndex=t}else a=this.$context||(this.$context=$T(this.chart.getContext(),this.index)),a.dataset=i,a.index=a.datasetIndex=this.index;return a.active=!!n,a.mode=r,a}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",a=this._cachedDataOpts,o=t+"-"+n,s=a[o],l=this.enableOptionSharing&&Ll(r);if(s)return _p(s,l);const u=this.chart.config,c=u.datasetElementScopeKeys(this._type,t),d=i?[`${t}Hover`,"hover",t,""]:[t,""],f=u.getOptionScopes(this.getDataset(),c),h=Object.keys(ot.elements[t]),g=()=>this.getContext(r,i,n),m=u.resolveNamedOptions(f,h,g,d);return m.$shared&&(m.$shared=l,a[o]=Object.freeze(_p(m,l))),m}_resolveAnimations(t,n,r){const i=this.chart,a=this._cachedDataOpts,o=`animation-${n}`,s=a[o];if(s)return s;let l;if(i.options.animation!==!1){const c=this.chart.config,d=c.datasetAnimationScopeKeys(this._type,n),f=c.getOptionScopes(this.getDataset(),d);l=c.createResolver(f,this.getContext(t,r,n))}const u=new n3(i,l&&l.animations);return l&&l._cacheable&&(a[o]=Object.freeze(u)),u}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||Dc(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const r=this.resolveDataElementOptions(t,n),i=this._sharedOptions,a=this.getSharedOptions(r),o=this.includeOptions(n,a)||a!==i;return this.updateSharedOptions(a,n,r),{sharedOptions:a,includeOptions:o}}updateElement(t,n,r,i){Dc(i)?Object.assign(t,r):this._resolveAnimations(n,i).update(t,r)}updateSharedOptions(t,n,r){t&&!Dc(n)&&this._resolveAnimations(void 0,n).update(t,r)}_setStyle(t,n,r,i){t.active=i;const a=this.getStyle(n,i);this._resolveAnimations(n,r,i).update(t,{options:!i&&this.getSharedOptions(a)||a})}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[s,l,u]of this._syncList)this[s](l,u);this._syncList=[];const i=r.length,a=n.length,o=Math.min(a,i);o&&this.parse(0,o),a>i?this._insertElements(i,a-i,t):a<i&&this._removeElements(a,i-a)}_insertElements(t,n,r=!0){const i=this._cachedMeta,a=i.data,o=t+n;let s;const l=u=>{for(u.length+=n,s=u.length-1;s>=o;s--)u[s]=u[s-n]};for(l(a),s=t;s<o;++s)a[s]=new this.dataElementType;this._parsing&&l(i._parsed),this.parse(t,n),r&&this.updateElements(a,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&&Ia(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])}}ie(qa,"defaults",{}),ie(qa,"datasetElementType",null),ie(qa,"dataElementType",null);function FT(e,t,n){let r=1,i=1,a=0,o=0;if(t<Qe){const s=e,l=s+t,u=Math.cos(s),c=Math.sin(s),d=Math.cos(l),f=Math.sin(l),h=(y,C,w)=>Fo(y,s,l,!0)?1:Math.max(C,C*n,w,w*n),g=(y,C,w)=>Fo(y,s,l,!0)?-1:Math.min(C,C*n,w,w*n),m=h(0,u,d),p=h(dt,c,f),b=g(qe,u,d),v=g(qe+dt,c,f);r=(m-b)/2,i=(p-v)/2,a=-(m+b)/2,o=-(p+v)/2}return{ratioX:r,ratioY:i,offsetX:a,offsetY:o}}class Va extends qa{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 a=l=>+r[l];if(Re(r[t])){const{key:l="value"}=this._parsing;a=u=>+Ao(r[u],l)}let o,s;for(o=t,s=t+n;o<s;++o)i._parsed[o]=a(o)}}_getRotation(){return Nn(this.options.rotation-90)}_getCircumference(){return Nn(this.options.circumference)}_getRotationExtents(){let t=Qe,n=-Qe;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,a=i._getRotation(),o=i._getCircumference();t=Math.min(t,a),n=Math.max(n,a+o)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:r}=n,i=this._cachedMeta,a=i.data,o=this.getMaxBorderWidth()+this.getMaxOffset(a)+this.options.spacing,s=Math.max((Math.min(r.width,r.height)-o)/2,0),l=Math.min(K7(this.options.cutout,s),1),u=this._getRingWeight(this.index),{circumference:c,rotation:d}=this._getRotationExtents(),{ratioX:f,ratioY:h,offsetX:g,offsetY:m}=FT(d,c,l),p=(r.width-o)/f,b=(r.height-o)/h,v=Math.max(Math.min(p,b)/2,0),y=N4(this.options.radius,v),C=Math.max(y*l,0),w=(y-C)/this._getVisibleDatasetWeightTotal();this.offsetX=g*y,this.offsetY=m*y,i.total=this.calculateTotal(),this.outerRadius=y-w*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-w*u,0),this.updateElements(a,0,a.length,t)}_circumference(t,n){const r=this.options,i=this._cachedMeta,a=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]*a/Qe)}updateElements(t,n,r,i){const a=i==="reset",o=this.chart,s=o.chartArea,u=o.options.animation,c=(s.left+s.right)/2,d=(s.top+s.bottom)/2,f=a&&u.animateScale,h=f?0:this.innerRadius,g=f?0:this.outerRadius,{sharedOptions:m,includeOptions:p}=this._getSharedOptions(n,i);let b=this._getRotation(),v;for(v=0;v<n;++v)b+=this._circumference(v,a);for(v=n;v<n+r;++v){const y=this._circumference(v,a),C=t[v],w={x:c+this.offsetX,y:d+this.offsetY,startAngle:b,endAngle:b+y,circumference:y,outerRadius:g,innerRadius:h};p&&(w.options=m||this.resolveDataElementOptions(v,C.active?"active":i)),b+=y,this.updateElement(C,v,w,i)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let r=0,i;for(i=0;i<n.length;i++){const a=t._parsed[i];a!==null&&!isNaN(a)&&this.chart.getDataVisibility(i)&&!n[i].hidden&&(r+=Math.abs(a))}return r}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?Qe*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,i=r.data.labels||[],a=Cu(n._parsed[t],r.options.locale);return{label:i[t]||"",value:a}}getMaxBorderWidth(t){let n=0;const r=this.chart;let i,a,o,s,l;if(!t){for(i=0,a=r.data.datasets.length;i<a;++i)if(r.isDatasetVisible(i)){o=r.getDatasetMeta(i),t=o.data,s=o.controller;break}}if(!t)return 0;for(i=0,a=t.length;i<a;++i)l=s.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 a=this.resolveDataElementOptions(r);n=Math.max(n,a.offset||0,a.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(Ce(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}ie(Va,"id","doughnut"),ie(Va,"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"}),ie(Va,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),ie(Va,"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((a,o)=>{const l=t.getDatasetMeta(0).controller.getStyle(o);return{text:a,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:i,lineWidth:l.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(o),index:o}})}return[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}}});function Yr(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class yh{constructor(t){ie(this,"options");this.options=t||{}}static override(t){Object.assign(yh.prototype,t)}init(){}formats(){return Yr()}parse(){return Yr()}format(){return Yr()}add(){return Yr()}diff(){return Yr()}startOf(){return Yr()}endOf(){return Yr()}}var PT={_date:yh};function TT(e,t,n,r){const{controller:i,data:a,_sorted:o}=e,s=i._cachedMeta.iScale;if(s&&t===s.axis&&t!=="r"&&o&&a.length){const l=s._reversePixels?uP:Ed;if(r){if(i._sharedOptions){const u=a[0],c=typeof u.getRange=="function"&&u.getRange(t);if(c){const d=l(a,t,n-c),f=l(a,t,n+c);return{lo:d.lo,hi:f.hi}}}}else return l(a,t,n)}return{lo:0,hi:a.length-1}}function Ko(e,t,n,r,i){const a=e.getSortedVisibleDatasetMetas(),o=n[t];for(let s=0,l=a.length;s<l;++s){const{index:u,data:c}=a[s],{lo:d,hi:f}=TT(a[s],t,o,i);for(let h=d;h<=f;++h){const g=c[h];g.skip||r(g,u,h)}}}function kT(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(r,i){const a=t?Math.abs(r.x-i.x):0,o=n?Math.abs(r.y-i.y):0;return Math.sqrt(Math.pow(a,2)+Math.pow(o,2))}}function Sc(e,t,n,r,i){const a=[];return!i&&!e.isPointInArea(t)||Ko(e,n,t,function(s,l,u){!i&&!lr(s,e.chartArea,0)||s.inRange(t.x,t.y,r)&&a.push({element:s,datasetIndex:l,index:u})},!0),a}function MT(e,t,n,r){let i=[];function a(o,s,l){const{startAngle:u,endAngle:c}=o.getProps(["startAngle","endAngle"],r),{angle:d}=H4(o,{x:t.x,y:t.y});Fo(d,u,c)&&i.push({element:o,datasetIndex:s,index:l})}return Ko(e,n,t,a),i}function BT(e,t,n,r,i,a){let o=[];const s=kT(n);let l=Number.POSITIVE_INFINITY;function u(c,d,f){const h=c.inRange(t.x,t.y,i);if(r&&!h)return;const g=c.getCenterPoint(i);if(!(!!a||e.isPointInArea(g))&&!h)return;const p=s(t,g);p<l?(o=[{element:c,datasetIndex:d,index:f}],l=p):p===l&&o.push({element:c,datasetIndex:d,index:f})}return Ko(e,n,t,u),o}function Ic(e,t,n,r,i,a){return!a&&!e.isPointInArea(t)?[]:n==="r"&&!r?MT(e,t,n,i):BT(e,t,n,r,i,a)}function $p(e,t,n,r,i){const a=[],o=n==="x"?"inXRange":"inYRange";let s=!1;return Ko(e,n,t,(l,u,c)=>{l[o](t[n],i)&&(a.push({element:l,datasetIndex:u,index:c}),s=s||l.inRange(t.x,t.y,i))}),r&&!s?[]:a}var VT={evaluateInteractionItems:Ko,modes:{index(e,t,n,r){const i=qr(t,e),a=n.axis||"x",o=n.includeInvisible||!1,s=n.intersect?Sc(e,i,a,r,o):Ic(e,i,a,!1,r,o),l=[];return s.length?(e.getSortedVisibleDatasetMetas().forEach(u=>{const c=s[0].index,d=u.data[c];d&&!d.skip&&l.push({element:d,datasetIndex:u.index,index:c})}),l):[]},dataset(e,t,n,r){const i=qr(t,e),a=n.axis||"xy",o=n.includeInvisible||!1;let s=n.intersect?Sc(e,i,a,r,o):Ic(e,i,a,!1,r,o);if(s.length>0){const l=s[0].datasetIndex,u=e.getDatasetMeta(l).data;s=[];for(let c=0;c<u.length;++c)s.push({element:u[c],datasetIndex:l,index:c})}return s},point(e,t,n,r){const i=qr(t,e),a=n.axis||"xy",o=n.includeInvisible||!1;return Sc(e,i,a,r,o)},nearest(e,t,n,r){const i=qr(t,e),a=n.axis||"xy",o=n.includeInvisible||!1;return Ic(e,i,a,n.intersect,r,o)},x(e,t,n,r){const i=qr(t,e);return $p(e,i,"x",n.intersect,r)},y(e,t,n,r){const i=qr(t,e);return $p(e,i,"y",n.intersect,r)}}};const i3=["left","top","right","bottom"];function Ea(e,t){return e.filter(n=>n.pos===t)}function Rp(e,t){return e.filter(n=>i3.indexOf(n.pos)===-1&&n.box.axis===t)}function _a(e,t){return e.sort((n,r)=>{const i=t?r:n,a=t?n:r;return i.weight===a.weight?i.index-a.index:i.weight-a.weight})}function OT(e){const t=[];let n,r,i,a,o,s;for(n=0,r=(e||[]).length;n<r;++n)i=e[n],{position:a,options:{stack:o,stackWeight:s=1}}=i,t.push({index:n,box:i,pos:a,horizontal:i.isHorizontal(),weight:i.weight,stack:o&&a+o,stackWeight:s});return t}function NT(e){const t={};for(const n of e){const{stack:r,pos:i,stackWeight:a}=n;if(!r||!i3.includes(i))continue;const o=t[r]||(t[r]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=a}return t}function LT(e,t){const n=NT(e),{vBoxMaxWidth:r,hBoxMaxHeight:i}=t;let a,o,s;for(a=0,o=e.length;a<o;++a){s=e[a];const{fullSize:l}=s.box,u=n[s.stack],c=u&&s.stackWeight/u.weight;s.horizontal?(s.width=c?c*r:l&&t.availableWidth,s.height=i):(s.width=r,s.height=c?c*i:l&&t.availableHeight)}return n}function jT(e){const t=OT(e),n=_a(t.filter(u=>u.box.fullSize),!0),r=_a(Ea(t,"left"),!0),i=_a(Ea(t,"right")),a=_a(Ea(t,"top"),!0),o=_a(Ea(t,"bottom")),s=Rp(t,"x"),l=Rp(t,"y");return{fullSize:n,leftAndTop:r.concat(a),rightAndBottom:i.concat(l).concat(o).concat(s),chartArea:Ea(t,"chartArea"),vertical:r.concat(i).concat(l),horizontal:a.concat(o).concat(s)}}function Ap(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function a3(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 HT(e,t,n,r){const{pos:i,box:a}=n,o=e.maxPadding;if(!Re(i)){n.size&&(e[i]-=n.size);const d=r[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?a.height:a.width),n.size=d.size/d.count,e[i]+=n.size}a.getPadding&&a3(o,a.getPadding());const s=Math.max(0,t.outerWidth-Ap(o,e,"left","right")),l=Math.max(0,t.outerHeight-Ap(o,e,"top","bottom")),u=s!==e.w,c=l!==e.h;return e.w=s,e.h=l,n.horizontal?{same:u,other:c}:{same:c,other:u}}function WT(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 zT(e,t){const n=t.maxPadding;function r(i){const a={left:0,top:0,right:0,bottom:0};return i.forEach(o=>{a[o]=Math.max(t[o],n[o])}),a}return r(e?["left","right"]:["top","bottom"])}function Oa(e,t,n,r){const i=[];let a,o,s,l,u,c;for(a=0,o=e.length,u=0;a<o;++a){s=e[a],l=s.box,l.update(s.width||t.w,s.height||t.h,zT(s.horizontal,t));const{same:d,other:f}=HT(t,n,s,r);u|=d&&i.length,c=c||f,l.fullSize||i.push(s)}return u&&Oa(i,t,n,r)||c}function $s(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 Fp(e,t,n,r){const i=n.padding;let{x:a,y:o}=t;for(const s of e){const l=s.box,u=r[s.stack]||{count:1,placed:0,weight:1},c=s.stackWeight/u.weight||1;if(s.horizontal){const d=t.w*c,f=u.size||l.height;Ll(u.start)&&(o=u.start),l.fullSize?$s(l,i.left,o,n.outerWidth-i.right-i.left,f):$s(l,t.left+u.placed,o,d,f),u.start=o,u.placed+=d,o=l.bottom}else{const d=t.h*c,f=u.size||l.width;Ll(u.start)&&(a=u.start),l.fullSize?$s(l,a,i.top,f,n.outerHeight-i.bottom-i.top):$s(l,a,t.top+u.placed,f,d),u.start=a,u.placed+=d,a=l.right}}t.x=a,t.y=o}var bn={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=Ft(e.options.layout.padding),a=Math.max(t-i.width,0),o=Math.max(n-i.height,0),s=jT(e.boxes),l=s.vertical,u=s.horizontal;He(e.boxes,m=>{typeof m.beforeLayout=="function"&&m.beforeLayout()});const c=l.reduce((m,p)=>p.box.options&&p.box.options.display===!1?m:m+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:a,availableHeight:o,vBoxMaxWidth:a/2/c,hBoxMaxHeight:o/2}),f=Object.assign({},i);a3(f,Ft(r));const h=Object.assign({maxPadding:f,w:a,h:o,x:i.left,y:i.top},i),g=LT(l.concat(u),d);Oa(s.fullSize,h,d,g),Oa(l,h,d,g),Oa(u,h,d,g)&&Oa(l,h,d,g),WT(h),Fp(s.leftAndTop,h,d,g),h.x+=h.w,h.y+=h.h,Fp(s.rightAndBottom,h,d,g),e.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},He(s.chartArea,m=>{const p=m.box;Object.assign(p,e.chartArea),p.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}};class o3{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 GT extends o3{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Qs="$chartjs",ZT={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Pp=e=>e===null||e==="";function XT(e,t){const n=e.style,r=e.getAttribute("height"),i=e.getAttribute("width");if(e[Qs]={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",Pp(i)){const a=bp(e,"width");a!==void 0&&(e.width=a)}if(Pp(r))if(e.style.height==="")e.height=e.width/(t||2);else{const a=bp(e,"height");a!==void 0&&(e.height=a)}return e}const s3=iT?{passive:!0}:!1;function YT(e,t,n){e&&e.addEventListener(t,n,s3)}function UT(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,s3)}function JT(e,t){const n=ZT[e.type]||e.type,{x:r,y:i}=qr(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:i!==void 0?i:null}}function Zl(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function KT(e,t,n){const r=e.canvas,i=new MutationObserver(a=>{let o=!1;for(const s of a)o=o||Zl(s.addedNodes,r),o=o&&!Zl(s.removedNodes,r);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function QT(e,t,n){const r=e.canvas,i=new MutationObserver(a=>{let o=!1;for(const s of a)o=o||Zl(s.removedNodes,r),o=o&&!Zl(s.addedNodes,r);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const Po=new Map;let Tp=0;function l3(){const e=window.devicePixelRatio;e!==Tp&&(Tp=e,Po.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function qT(e,t){Po.size||window.addEventListener("resize",l3),Po.set(e,t)}function ek(e){Po.delete(e),Po.size||window.removeEventListener("resize",l3)}function tk(e,t,n){const r=e.canvas,i=r&&vh(r);if(!i)return;const a=G4((s,l)=>{const u=i.clientWidth;n(s,l),u<i.clientWidth&&n()},window),o=new ResizeObserver(s=>{const l=s[0],u=l.contentRect.width,c=l.contentRect.height;u===0&&c===0||a(u,c)});return o.observe(i),qT(e,a),o}function Ec(e,t,n){n&&n.disconnect(),t==="resize"&&ek(e)}function nk(e,t,n){const r=e.canvas,i=G4(a=>{e.ctx!==null&&n(JT(a,e))},e);return YT(r,t,i),i}class rk extends o3{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(XT(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[Qs])return!1;const r=n[Qs].initial;["height","width"].forEach(a=>{const o=r[a];Ke(o)?n.removeAttribute(a):n.setAttribute(a,o)});const i=r.style||{};return Object.keys(i).forEach(a=>{n.style[a]=i[a]}),n.width=n.width,delete n[Qs],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const i=t.$proxies||(t.$proxies={}),o={attach:KT,detach:QT,resize:tk}[n]||nk;i[n]=o(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),i=r[n];if(!i)return;({attach:Ec,detach:Ec,resize:Ec}[n]||UT)(t,n,i),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,i){return rT(t,n,r,i)}isAttached(t){const n=t&&vh(t);return!!(n&&n.isConnected)}}function ik(e){return!bh()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?GT:rk}var Vs;let jr=(Vs=class{constructor(){ie(this,"x");ie(this,"y");ie(this,"active",!1);ie(this,"options");ie(this,"$animations")}tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return Hl(this.x)&&Hl(this.y)}getProps(t,n){const r=this.$animations;if(!n||!r)return this;const i={};return t.forEach(a=>{i[a]=r[a]&&r[a].active()?r[a]._to:this[a]}),i}},ie(Vs,"defaults",{}),ie(Vs,"defaultRoutes"),Vs);function ak(e,t){const n=e.options.ticks,r=ok(e),i=Math.min(n.maxTicksLimit||r,r),a=n.major.enabled?lk(t):[],o=a.length,s=a[0],l=a[o-1],u=[];if(o>i)return uk(t,u,a,o/i),u;const c=sk(a,t,i);if(o>0){let d,f;const h=o>1?Math.round((l-s)/(o-1)):null;for(Rs(t,u,c,Ke(h)?0:s-h,s),d=0,f=o-1;d<f;d++)Rs(t,u,c,a[d],a[d+1]);return Rs(t,u,c,l,Ke(h)?t.length:l+h),u}return Rs(t,u,c),u}function ok(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 sk(e,t,n){const r=ck(e),i=t.length/n;if(!r)return Math.max(i,1);const a=aP(r);for(let o=0,s=a.length-1;o<s;o++){const l=a[o];if(l>i)return l}return Math.max(i,1)}function lk(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function uk(e,t,n,r){let i=0,a=n[0],o;for(r=Math.ceil(r),o=0;o<e.length;o++)o===a&&(t.push(e[o]),i++,a=n[i*r])}function Rs(e,t,n,r,i){const a=Ce(r,0),o=Math.min(Ce(i,e.length),e.length);let s=0,l,u,c;for(n=Math.ceil(n),i&&(l=i-r,n=l/Math.floor(l/n)),c=a;c<0;)s++,c=Math.round(a+s*n);for(u=Math.max(a,0);u<o;u++)u===c&&(t.push(e[u]),s++,c=Math.round(a+s*n))}function ck(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 dk=e=>e==="left"?"right":e==="right"?"left":e,kp=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,Mp=(e,t)=>Math.min(t||e,e);function Bp(e,t){const n=[],r=e.length/t,i=e.length;let a=0;for(;a<i;a+=r)n.push(e[Math.floor(a)]);return n}function fk(e,t,n){const r=e.ticks.length,i=Math.min(t,r-1),a=e._startPixel,o=e._endPixel,s=1e-6;let l=e.getPixelForTick(i),u;if(!(n&&(r===1?u=Math.max(l-a,o-l):t===0?u=(e.getPixelForTick(1)-l)/2:u=(l-e.getPixelForTick(i-1))/2,l+=i<t?u:-u,l<a-s||l>o+s)))return l}function hk(e,t){He(e,n=>{const r=n.gc,i=r.length/2;let a;if(i>t){for(a=0;a<i;++a)delete n.data[r[a]];r.splice(0,i)}})}function $a(e){return e.drawTicks?e.tickLength:0}function Vp(e,t){if(!e.display)return 0;const n=pt(e.font,t),r=Ft(e.padding);return(at(e.text)?e.text.length:1)*n.lineHeight+r.height}function gk(e,t){return Lr(e,{scale:t,type:"scale"})}function mk(e,t,n){return Lr(e,{tick:n,index:t,type:"tick"})}function pk(e,t,n){let r=uh(e);return(n&&t!=="right"||!n&&t==="right")&&(r=dk(r)),r}function bk(e,t,n,r){const{top:i,left:a,bottom:o,right:s,chart:l}=e,{chartArea:u,scales:c}=l;let d=0,f,h,g;const m=o-i,p=s-a;if(e.isHorizontal()){if(h=_t(r,a,s),Re(n)){const b=Object.keys(n)[0],v=n[b];g=c[b].getPixelForValue(v)+m-t}else n==="center"?g=(u.bottom+u.top)/2+m-t:g=kp(e,n,t);f=s-a}else{if(Re(n)){const b=Object.keys(n)[0],v=n[b];h=c[b].getPixelForValue(v)-p+t}else n==="center"?h=(u.left+u.right)/2-p+t:h=kp(e,n,t);g=_t(r,o,i),d=n==="left"?-dt:dt}return{titleX:h,titleY:g,maxWidth:f,rotation:d}}class _i extends jr{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=Qt(t,Number.POSITIVE_INFINITY),n=Qt(n,Number.NEGATIVE_INFINITY),r=Qt(r,Number.POSITIVE_INFINITY),i=Qt(i,Number.NEGATIVE_INFINITY),{min:Qt(t,r),max:Qt(n,i),minDefined:xt(t),maxDefined:xt(n)}}getMinMax(t){let{min:n,max:r,minDefined:i,maxDefined:a}=this.getUserBounds(),o;if(i&&a)return{min:n,max:r};const s=this.getMatchingVisibleMetas();for(let l=0,u=s.length;l<u;++l)o=s[l].controller.getMinMax(this,t),i||(n=Math.min(n,o.min)),a||(r=Math.max(r,o.max));return n=a&&n>r?r:n,r=i&&n>r?n:r,{min:Qt(n,Qt(r,n)),max:Qt(r,Qt(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(){Ze(this.options.beforeUpdate,[this])}update(t,n,r){const{beginAtZero:i,grace:a,ticks:o}=this.options,s=o.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=MP(this,a,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=s<this.ticks.length;this._convertTicksToLabels(l?Bp(this.ticks,s):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=ak(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(){Ze(this.options.afterUpdate,[this])}beforeSetDimensions(){Ze(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(){Ze(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Ze(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Ze(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let r,i,a;for(r=0,i=t.length;r<i;r++)a=t[r],a.label=Ze(n.callback,[a.value,r,t],this)}afterTickToLabelConversion(){Ze(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Ze(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=Mp(this.ticks.length,t.ticks.maxTicksLimit),i=n.minRotation||0,a=n.maxRotation;let o=i,s,l,u;if(!this._isVisible()||!n.display||i>=a||r<=1||!this.isHorizontal()){this.labelRotation=i;return}const c=this._getLabelSizes(),d=c.widest.width,f=c.highest.height,h=tn(this.chart.width-d,0,this.maxWidth);s=t.offset?this.maxWidth/r:h/(r-1),d+6>s&&(s=h/(r-(t.offset?.5:1)),l=this.maxHeight-$a(t.grid)-n.padding-Vp(t.title,this.chart.options.font),u=Math.sqrt(d*d+f*f),o=sh(Math.min(Math.asin(tn((c.highest.height+6)/s,-1,1)),Math.asin(tn(l/u,-1,1))-Math.asin(tn(f/u,-1,1)))),o=Math.max(i,Math.min(a,o))),this.labelRotation=o}afterCalculateLabelRotation(){Ze(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Ze(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:r,title:i,grid:a}}=this,o=this._isVisible(),s=this.isHorizontal();if(o){const l=Vp(i,n.options.font);if(s?(t.width=this.maxWidth,t.height=$a(a)+l):(t.height=this.maxHeight,t.width=$a(a)+l),r.display&&this.ticks.length){const{first:u,last:c,widest:d,highest:f}=this._getLabelSizes(),h=r.padding*2,g=Nn(this.labelRotation),m=Math.cos(g),p=Math.sin(g);if(s){const b=r.mirror?0:p*d.width+m*f.height;t.height=Math.min(this.maxHeight,t.height+b+h)}else{const b=r.mirror?0:m*d.width+p*f.height;t.width=Math.min(this.maxWidth,t.width+b+h)}this._calculatePadding(u,c,p,m)}}this._handleMargins(),s?(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:a,padding:o},position:s}=this.options,l=this.labelRotation!==0,u=s!=="top"&&this.axis==="x";if(this.isHorizontal()){const c=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,h=0;l?u?(f=i*t.width,h=r*n.height):(f=r*t.height,h=i*n.width):a==="start"?h=n.width:a==="end"?f=t.width:a!=="inner"&&(f=t.width/2,h=n.width/2),this.paddingLeft=Math.max((f-c+o)*this.width/(this.width-c),0),this.paddingRight=Math.max((h-d+o)*this.width/(this.width-d),0)}else{let c=n.height/2,d=t.height/2;a==="start"?(c=0,d=t.height):a==="end"&&(c=n.height,d=0),this.paddingTop=c+o,this.paddingBottom=d+o}}_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(){Ze(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++)Ke(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=Bp(r,n)),this._labelSizes=t=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,r){const{ctx:i,_longestTextCache:a}=this,o=[],s=[],l=Math.floor(n/Mp(n,r));let u=0,c=0,d,f,h,g,m,p,b,v,y,C,w;for(d=0;d<n;d+=l){if(g=t[d].label,m=this._resolveTickFontOptions(d),i.font=p=m.string,b=a[p]=a[p]||{data:{},gc:[]},v=m.lineHeight,y=C=0,!Ke(g)&&!at(g))y=Wl(i,b.data,b.gc,y,g),C=v;else if(at(g))for(f=0,h=g.length;f<h;++f)w=g[f],!Ke(w)&&!at(w)&&(y=Wl(i,b.data,b.gc,y,w),C+=v);o.push(y),s.push(C),u=Math.max(y,u),c=Math.max(C,c)}hk(a,n);const I=o.indexOf(u),E=s.indexOf(c),D=$=>({width:o[$]||0,height:s[$]||0});return{first:D(0),last:D(n-1),widest:D(I),highest:D(E),widths:o,heights:s}}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 lP(this._alignToPixels?Xr(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=mk(this.getContext(),t,r))}return this.$context||(this.$context=gk(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=Nn(this.labelRotation),r=Math.abs(Math.cos(n)),i=Math.abs(Math.sin(n)),a=this._getLabelSizes(),o=t.autoSkipPadding||0,s=a?a.widest.width+o:0,l=a?a.highest.height+o:0;return this.isHorizontal()?l*r>s*i?s/r:l/i:l*i<s*r?l/r:s/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:a,position:o,border:s}=i,l=a.offset,u=this.isHorizontal(),d=this.ticks.length+(l?1:0),f=$a(a),h=[],g=s.setContext(this.getContext()),m=g.display?g.width:0,p=m/2,b=function(T){return Xr(r,T,m)};let v,y,C,w,I,E,D,$,F,_,P,k;if(o==="top")v=b(this.bottom),E=this.bottom-f,$=v-p,_=b(t.top)+p,k=t.bottom;else if(o==="bottom")v=b(this.top),_=t.top,k=b(t.bottom)-p,E=v+p,$=this.top+f;else if(o==="left")v=b(this.right),I=this.right-f,D=v-p,F=b(t.left)+p,P=t.right;else if(o==="right")v=b(this.left),F=t.left,P=b(t.right)-p,I=v+p,D=this.left+f;else if(n==="x"){if(o==="center")v=b((t.top+t.bottom)/2+.5);else if(Re(o)){const T=Object.keys(o)[0],R=o[T];v=b(this.chart.scales[T].getPixelForValue(R))}_=t.top,k=t.bottom,E=v+p,$=E+f}else if(n==="y"){if(o==="center")v=b((t.left+t.right)/2);else if(Re(o)){const T=Object.keys(o)[0],R=o[T];v=b(this.chart.scales[T].getPixelForValue(R))}I=v-p,D=I-f,F=t.left,P=t.right}const A=Ce(i.ticks.maxTicksLimit,d),B=Math.max(1,Math.ceil(d/A));for(y=0;y<d;y+=B){const T=this.getContext(y),R=a.setContext(T),V=s.setContext(T),H=R.lineWidth,L=R.color,Z=V.dash||[],O=V.dashOffset,W=R.tickWidth,q=R.tickColor,Y=R.tickBorderDash||[],N=R.tickBorderDashOffset;C=fk(this,y,l),C!==void 0&&(w=Xr(r,C,H),u?I=D=F=P=w:E=$=_=k=w,h.push({tx1:I,ty1:E,tx2:D,ty2:$,x1:F,y1:_,x2:P,y2:k,width:H,color:L,borderDash:Z,borderDashOffset:O,tickWidth:W,tickColor:q,tickBorderDash:Y,tickBorderDashOffset:N}))}return this._ticksLength=d,this._borderValue=v,h}_computeLabelItems(t){const n=this.axis,r=this.options,{position:i,ticks:a}=r,o=this.isHorizontal(),s=this.ticks,{align:l,crossAlign:u,padding:c,mirror:d}=a,f=$a(r.grid),h=f+c,g=d?-c:h,m=-Nn(this.labelRotation),p=[];let b,v,y,C,w,I,E,D,$,F,_,P,k="middle";if(i==="top")I=this.bottom-g,E=this._getXAxisLabelAlignment();else if(i==="bottom")I=this.top+g,E=this._getXAxisLabelAlignment();else if(i==="left"){const B=this._getYAxisLabelAlignment(f);E=B.textAlign,w=B.x}else if(i==="right"){const B=this._getYAxisLabelAlignment(f);E=B.textAlign,w=B.x}else if(n==="x"){if(i==="center")I=(t.top+t.bottom)/2+h;else if(Re(i)){const B=Object.keys(i)[0],T=i[B];I=this.chart.scales[B].getPixelForValue(T)+h}E=this._getXAxisLabelAlignment()}else if(n==="y"){if(i==="center")w=(t.left+t.right)/2-h;else if(Re(i)){const B=Object.keys(i)[0],T=i[B];w=this.chart.scales[B].getPixelForValue(T)}E=this._getYAxisLabelAlignment(f).textAlign}n==="y"&&(l==="start"?k="top":l==="end"&&(k="bottom"));const A=this._getLabelSizes();for(b=0,v=s.length;b<v;++b){y=s[b],C=y.label;const B=a.setContext(this.getContext(b));D=this.getPixelForTick(b)+a.labelOffset,$=this._resolveTickFontOptions(b),F=$.lineHeight,_=at(C)?C.length:1;const T=_/2,R=B.color,V=B.textStrokeColor,H=B.textStrokeWidth;let L=E;o?(w=D,E==="inner"&&(b===v-1?L=this.options.reverse?"left":"right":b===0?L=this.options.reverse?"right":"left":L="center"),i==="top"?u==="near"||m!==0?P=-_*F+F/2:u==="center"?P=-A.highest.height/2-T*F+F:P=-A.highest.height+F/2:u==="near"||m!==0?P=F/2:u==="center"?P=A.highest.height/2-T*F:P=A.highest.height-_*F,d&&(P*=-1),m!==0&&!B.showLabelBackdrop&&(w+=F/2*Math.sin(m))):(I=D,P=(1-_)*F/2);let Z;if(B.showLabelBackdrop){const O=Ft(B.backdropPadding),W=A.heights[b],q=A.widths[b];let Y=P-O.top,N=0-O.left;switch(k){case"middle":Y-=W/2;break;case"bottom":Y-=W;break}switch(E){case"center":N-=q/2;break;case"right":N-=q;break;case"inner":b===v-1?N-=q:b>0&&(N-=q/2);break}Z={left:N,top:Y,width:q+O.width,height:W+O.height,color:B.backdropColor}}p.push({label:C,font:$,textOffset:P,options:{rotation:m,color:R,strokeColor:V,strokeWidth:H,textAlign:L,textBaseline:k,translation:[w,I],backdrop:Z}})}return p}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Nn(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:a}}=this.options,o=this._getLabelSizes(),s=t+a,l=o.widest.width;let u,c;return n==="left"?i?(c=this.right+a,r==="near"?u="left":r==="center"?(u="center",c+=l/2):(u="right",c+=l)):(c=this.right-s,r==="near"?u="right":r==="center"?(u="center",c-=l/2):(u="left",c=this.left)):n==="right"?i?(c=this.left+a,r==="near"?u="right":r==="center"?(u="center",c-=l/2):(u="left",c-=l)):(c=this.left+s,r==="near"?u="left":r==="center"?(u="center",c+=l/2):(u="right",c=this.right)):u="right",{textAlign:u,x:c}}_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:a,height:o}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(r,i,a,o),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const i=this.ticks.findIndex(a=>a.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 a,o;const s=(l,u,c)=>{!c.width||!c.color||(r.save(),r.lineWidth=c.width,r.strokeStyle=c.color,r.setLineDash(c.borderDash||[]),r.lineDashOffset=c.borderDashOffset,r.beginPath(),r.moveTo(l.x,l.y),r.lineTo(u.x,u.y),r.stroke(),r.restore())};if(n.display)for(a=0,o=i.length;a<o;++a){const l=i[a];n.drawOnChartArea&&s({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.drawTicks&&s({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,a=r.setContext(this.getContext()),o=r.display?a.width:0;if(!o)return;const s=i.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let u,c,d,f;this.isHorizontal()?(u=Xr(t,this.left,o)-o/2,c=Xr(t,this.right,s)+s/2,d=f=l):(d=Xr(t,this.top,o)-o/2,f=Xr(t,this.bottom,s)+s/2,u=c=l),n.save(),n.lineWidth=a.width,n.strokeStyle=a.color,n.beginPath(),n.moveTo(u,d),n.lineTo(c,f),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,i=this._computeLabelArea();i&&dh(r,i);const a=this.getLabelItems(t);for(const o of a){const s=o.options,l=o.font,u=o.label,c=o.textOffset;Ci(r,u,0,c,l,s)}i&&fh(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:i}}=this;if(!r.display)return;const a=pt(r.font),o=Ft(r.padding),s=r.align;let l=a.lineHeight/2;n==="bottom"||n==="center"||Re(n)?(l+=o.bottom,at(r.text)&&(l+=a.lineHeight*(r.text.length-1))):l+=o.top;const{titleX:u,titleY:c,maxWidth:d,rotation:f}=bk(this,l,n,s);Ci(t,r.text,0,0,a,{color:r.color,maxWidth:d,rotation:f,textAlign:pk(s,n,i),textBaseline:"middle",translation:[u,c]})}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=Ce(t.grid&&t.grid.z,-1),i=Ce(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==_i.prototype.draw?[{z:n,draw:a=>{this.draw(a)}}]:[{z:r,draw:a=>{this.drawBackground(),this.drawGrid(a),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:a=>{this.drawLabels(a)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",i=[];let a,o;for(a=0,o=n.length;a<o;++a){const s=n[a];s[r]===this.id&&(!t||s.type===t)&&i.push(s)}return i}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return pt(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class As{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;xk(n)&&(r=this.register(n));const i=this.items,a=t.id,o=this.scope+"."+a;if(!a)throw new Error("class does not have id: "+t);return a in i||(i[a]=t,vk(t,o,r),this.override&&ot.override(t.id,t.overrides)),o}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 ot[i]&&(delete ot[i][r],this.override&&delete xi[r])}}function vk(e,t,n){const r=Ro(Object.create(null),[n?ot.get(n):{},ot.get(t),e.defaults]);ot.set(t,r),e.defaultRoutes&&yk(t,e.defaultRoutes),e.descriptors&&ot.describe(t,e.descriptors)}function yk(e,t){Object.keys(t).forEach(n=>{const r=n.split("."),i=r.pop(),a=[e].concat(r).join("."),o=t[n].split("."),s=o.pop(),l=o.join(".");ot.route(a,i,l,s)})}function xk(e){return"id"in e&&"defaults"in e}class Ck{constructor(){this.controllers=new As(qa,"datasets",!0),this.elements=new As(jr,"elements"),this.plugins=new As(Object,"plugins"),this.scales=new As(_i,"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 a=r||this._getRegistryForType(i);r||a.isForType(i)||a===this.plugins&&i.id?this._exec(t,a,i):He(i,o=>{const s=r||this._getRegistryForType(o);this._exec(t,s,o)})})}_exec(t,n,r){const i=oh(t);Ze(r["before"+i],[],r),n[t](r),Ze(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 kn=new Ck;class wk{constructor(){this._init=[]}notify(t,n,r,i){n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const a=i?this._descriptors(t).filter(i):this._descriptors(t),o=this._notify(a,t,n,r);return n==="afterDestroy"&&(this._notify(a,t,"stop"),this._notify(this._init,t,"uninstall")),o}_notify(t,n,r,i){i=i||{};for(const a of t){const o=a.plugin,s=o[r],l=[n,i,a.options];if(Ze(s,l,o)===!1&&i.cancelable)return!1}return!0}invalidate(){Ke(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=Ce(r.options&&r.options.plugins,{}),a=Dk(r);return i===!1&&!n?[]:Ik(t,a,i,n)}_notifyStateChanges(t){const n=this._oldCache||[],r=this._cache,i=(a,o)=>a.filter(s=>!o.some(l=>s.plugin.id===l.plugin.id));this._notify(i(n,r),t,"stop"),this._notify(i(r,n),t,"start")}}function Dk(e){const t={},n=[],r=Object.keys(kn.plugins.items);for(let a=0;a<r.length;a++)n.push(kn.getPlugin(r[a]));const i=e.plugins||[];for(let a=0;a<i.length;a++){const o=i[a];n.indexOf(o)===-1&&(n.push(o),t[o.id]=!0)}return{plugins:n,localIds:t}}function Sk(e,t){return!t&&e===!1?null:e===!0?{}:e}function Ik(e,{plugins:t,localIds:n},r,i){const a=[],o=e.getContext();for(const s of t){const l=s.id,u=Sk(r[l],i);u!==null&&a.push({plugin:s,options:Ek(e.config,{plugin:s,local:n[l]},u,o)})}return a}function Ek(e,{plugin:t,local:n},r,i){const a=e.pluginScopeKeys(t),o=e.getOptionScopes(r,a);return n&&t.defaults&&o.push(t.defaults),e.createResolver(o,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Rd(e,t){const n=ot.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function _k(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function $k(e,t){return e===t?"_index_":"_value_"}function Op(e){if(e==="x"||e==="y"||e==="r")return e}function Rk(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function Ad(e,...t){if(Op(e))return e;for(const n of t){const r=n.axis||Rk(n.position)||e.length>1&&Op(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function Np(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function Ak(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 Np(e,"x",n[0])||Np(e,"y",n[0])}return{}}function Fk(e,t){const n=xi[e.type]||{scales:{}},r=t.scales||{},i=Rd(e.type,t),a=Object.create(null);return Object.keys(r).forEach(o=>{const s=r[o];if(!Re(s))return console.error(`Invalid scale configuration for scale: ${o}`);if(s._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const l=Ad(o,s,Ak(o,e),ot.scales[s.type]),u=$k(l,i),c=n.scales||{};a[o]=Ua(Object.create(null),[{axis:l},s,c[l],c[u]])}),e.data.datasets.forEach(o=>{const s=o.type||e.type,l=o.indexAxis||Rd(s,t),c=(xi[s]||{}).scales||{};Object.keys(c).forEach(d=>{const f=_k(d,l),h=o[f+"AxisID"]||f;a[h]=a[h]||Object.create(null),Ua(a[h],[{axis:f},r[h],c[d]])})}),Object.keys(a).forEach(o=>{const s=a[o];Ua(s,[ot.scales[s.type],ot.scale])}),a}function u3(e){const t=e.options||(e.options={});t.plugins=Ce(t.plugins,{}),t.scales=Fk(e,t)}function c3(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function Pk(e){return e=e||{},e.data=c3(e.data),u3(e),e}const Lp=new Map,d3=new Set;function Fs(e,t){let n=Lp.get(e);return n||(n=t(),Lp.set(e,n),d3.add(n)),n}const Ra=(e,t,n)=>{const r=Ao(t,n);r!==void 0&&e.add(r)};class Tk{constructor(t){this._config=Pk(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=c3(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(),u3(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Fs(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return Fs(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return Fs(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return Fs(`${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:a}=this,o=this._cachedScopes(t,r),s=o.get(n);if(s)return s;const l=new Set;n.forEach(c=>{t&&(l.add(t),c.forEach(d=>Ra(l,t,d))),c.forEach(d=>Ra(l,i,d)),c.forEach(d=>Ra(l,xi[a]||{},d)),c.forEach(d=>Ra(l,ot,d)),c.forEach(d=>Ra(l,_d,d))});const u=Array.from(l);return u.length===0&&u.push(Object.create(null)),d3.has(n)&&o.set(n,u),u}chartOptionScopes(){const{options:t,type:n}=this;return[t,xi[n]||{},ot.datasets[n]||{},{type:n},ot,_d]}resolveNamedOptions(t,n,r,i=[""]){const a={$shared:!0},{resolver:o,subPrefixes:s}=jp(this._resolverCache,t,i);let l=o;if(Mk(o,n)){a.$shared=!1,r=Mr(r)?r():r;const u=this.createResolver(t,r,s);l=fa(o,r,u)}for(const u of n)a[u]=l[u];return a}createResolver(t,n,r=[""],i){const{resolver:a}=jp(this._resolverCache,t,r);return Re(n)?fa(a,n,void 0,i):a}}function jp(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const i=n.join();let a=r.get(i);return a||(a={resolver:gh(t,n),subPrefixes:n.filter(s=>!s.toLowerCase().includes("hover"))},r.set(i,a)),a}const kk=e=>Re(e)&&Object.getOwnPropertyNames(e).some(t=>Mr(e[t]));function Mk(e,t){const{isScriptable:n,isIndexable:r}=Y4(e);for(const i of t){const a=n(i),o=r(i),s=(o||a)&&e[i];if(a&&(Mr(s)||kk(s))||o&&at(s))return!0}return!1}var Bk="4.4.3";const Vk=["top","bottom","left","right","chartArea"];function Hp(e,t){return e==="top"||e==="bottom"||Vk.indexOf(e)===-1&&t==="x"}function Wp(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function zp(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),Ze(n&&n.onComplete,[e],t)}function Ok(e){const t=e.chart,n=t.options.animation;Ze(n&&n.onProgress,[e],t)}function f3(e){return bh()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const qs={},Gp=e=>{const t=f3(e);return Object.values(qs).filter(n=>n.canvas===t).pop()};function Nk(e,t,n){const r=Object.keys(e);for(const i of r){const a=+i;if(a>=t){const o=e[i];delete e[i],(n>0||a>t)&&(e[a+n]=o)}}}function Lk(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}function Ps(e,t,n){return e.options.clip?e[n]:t[n]}function jk(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:Ps(n,t,"left"),right:Ps(n,t,"right"),top:Ps(r,t,"top"),bottom:Ps(r,t,"bottom")}:t}var br;let Su=(br=class{static register(...t){kn.add(...t),Zp()}static unregister(...t){kn.remove(...t),Zp()}constructor(t,n){const r=this.config=new Tk(n),i=f3(t),a=Gp(i);if(a)throw new Error("Canvas is already in use. Chart with ID '"+a.id+"' must be destroyed before the canvas with ID '"+a.canvas.id+"' can be reused.");const o=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||ik(i)),this.platform.updateConfig(r);const s=this.platform.acquireContext(i,o.aspectRatio),l=s&&s.canvas,u=l&&l.height,c=l&&l.width;if(this.id=J7(),this.ctx=s,this.canvas=l,this.width=c,this.height=u,this._options=o,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 wk,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=hP(d=>this.update(d),o.resizeDelay||0),this._dataChanges=[],qs[this.id]=this,!s||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Kn.listen(this,"complete",zp),Kn.listen(this,"progress",Ok),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:i,_aspectRatio:a}=this;return Ke(t)?n&&a?a: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 kn}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():pp(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return hp(this.canvas,this.ctx),this}stop(){return Kn.stop(this),this}resize(t,n){Kn.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const r=this.options,i=this.canvas,a=r.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(i,t,n,a),s=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,pp(this,s,!0)&&(this.notifyPlugins("resize",{size:o}),Ze(r.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};He(n,(r,i)=>{r.id=i})}buildOrUpdateScales(){const t=this.options,n=t.scales,r=this.scales,i=Object.keys(r).reduce((o,s)=>(o[s]=!1,o),{});let a=[];n&&(a=a.concat(Object.keys(n).map(o=>{const s=n[o],l=Ad(o,s),u=l==="r",c=l==="x";return{options:s,dposition:u?"chartArea":c?"bottom":"left",dtype:u?"radialLinear":c?"category":"linear"}}))),He(a,o=>{const s=o.options,l=s.id,u=Ad(l,s),c=Ce(s.type,o.dtype);(s.position===void 0||Hp(s.position,u)!==Hp(o.dposition))&&(s.position=o.dposition),i[l]=!0;let d=null;if(l in r&&r[l].type===c)d=r[l];else{const f=kn.getScale(c);d=new f({id:l,type:c,ctx:this.ctx,chart:this}),r[d.id]=d}d.init(s,t)}),He(i,(o,s)=>{o||delete r[s]}),He(r,o=>{bn.configure(this,o,o.options),bn.addBox(this,o)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,r=t.length;if(t.sort((i,a)=>i.index-a.index),r>n){for(let i=n;i<r;++i)this._destroyDatasetMeta(i);t.splice(n,r-n)}this._sortedMetasets=t.slice(0).sort(Wp("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((r,i)=>{n.filter(a=>a===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 a=n[r];let o=this.getDatasetMeta(r);const s=a.type||this.config.type;if(o.type&&o.type!==s&&(this._destroyDatasetMeta(r),o=this.getDatasetMeta(r)),o.type=s,o.indexAxis=a.indexAxis||Rd(s,this.options),o.order=a.order||0,o.index=r,o.label=""+a.label,o.visible=this.isDatasetVisible(r),o.controller)o.controller.updateIndex(r),o.controller.linkScales();else{const l=kn.getController(s),{datasetElementType:u,dataElementType:c}=ot.datasets[s];Object.assign(l,{dataElementType:kn.getElement(c),datasetElementType:u&&kn.getElement(u)}),o.controller=new l(this,r),t.push(o.controller)}}return this._updateMetasets(),t}_resetElements(){He(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 a=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let u=0,c=this.data.datasets.length;u<c;u++){const{controller:d}=this.getDatasetMeta(u),f=!i&&a.indexOf(d)===-1;d.buildOrUpdateElements(f),o=Math.max(+d.getMaxOverflow(),o)}o=this._minPadding=r.layout.autoPadding?o:0,this._updateLayout(o),i||He(a,u=>{u.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Wp("z","_idx"));const{_active:s,_lastEvent:l}=this;l?this._eventHandler(l,!0):s.length&&this._updateHoverStyles(s,s,!0),this.render()}_updateScales(){He(this.scales,t=>{bn.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!ip(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:a}of n){const o=r==="_removeElements"?-a:a;Nk(t,i,o)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=a=>new Set(t.filter(o=>o[0]===a).map((o,s)=>s+","+o.splice(1).join(","))),i=r(0);for(let a=1;a<n;a++)if(!ip(i,r(a)))return;return Array.from(i).map(a=>a.split(",")).map(a=>({method:a[1],start:+a[2],count:+a[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;bn.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],He(this.boxes,i=>{r&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()))},this),this._layers.forEach((i,a)=>{i._idx=a}),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,Mr(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&&(Kn.has(this)?this.attached&&!Kn.running(this)&&Kn.start(this):(this.draw(),zp({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,a;for(i=0,a=n.length;i<a;++i){const o=n[i];(!t||o.visible)&&r.push(o)}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,a=jk(t,this.chartArea),o={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(i&&dh(n,{left:r.left===!1?0:a.left-r.left,right:r.right===!1?this.width:a.right+r.right,top:r.top===!1?0:a.top-r.top,bottom:r.bottom===!1?this.height:a.bottom+r.bottom}),t.controller.draw(),i&&fh(n),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return lr(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,i){const a=VT.modes[n];return typeof a=="function"?a(this,t,r,i):[]}getDatasetMeta(t){const n=this.data.datasets[t],r=this._metasets;let i=r.filter(a=>a&&a._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=Lr(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",a=this.getDatasetMeta(t),o=a.controller._resolveAnimations(void 0,i);Ll(n)?(a.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),o.update(a,{visible:r}),this.update(s=>s.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(),Kn.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(),hp(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete qs[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=(a,o)=>{n.addEventListener(this,a,o),t[a]=o},i=(a,o,s)=>{a.offsetX=o,a.offsetY=s,this._eventHandler(a)};He(this.options.events,a=>r(a,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,r=(l,u)=>{n.addEventListener(this,l,u),t[l]=u},i=(l,u)=>{t[l]&&(n.removeEventListener(this,l,u),delete t[l])},a=(l,u)=>{this.canvas&&this.resize(l,u)};let o;const s=()=>{i("attach",s),this.attached=!0,this.resize(),r("resize",a),r("detach",o)};o=()=>{this.attached=!1,i("resize",a),this._stop(),this._resize(0,0),r("attach",s)},n.isAttached(this.canvas)?s():o()}unbindEvents(){He(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},He(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,r){const i=r?"set":"remove";let a,o,s,l;for(n==="dataset"&&(a=this.getDatasetMeta(t[0].datasetIndex),a.controller["_"+i+"DatasetHoverStyle"]()),s=0,l=t.length;s<l;++s){o=t[s];const u=o&&this.getDatasetMeta(o.datasetIndex).controller;u&&u[i+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],r=t.map(({datasetIndex:a,index:o})=>{const s=this.getDatasetMeta(a);if(!s)throw new Error("No dataset found at index "+a);return{datasetIndex:a,element:s.data[o],index:o}});!Ol(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,a=(l,u)=>l.filter(c=>!u.some(d=>c.datasetIndex===d.datasetIndex&&c.index===d.index)),o=a(n,t),s=r?t:a(t,n);o.length&&this.updateHoverStyle(o,i.mode,!1),s.length&&i.mode&&this.updateHoverStyle(s,i.mode,!0)}_eventHandler(t,n){const r={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},i=o=>(o.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,i)===!1)return;const a=this._handleEvent(t,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,i),(a||r.changed)&&this.render(),this}_handleEvent(t,n,r){const{_active:i=[],options:a}=this,o=n,s=this._getActiveElements(t,i,r,o),l=nP(t),u=Lk(t,this._lastEvent,r,l);r&&(this._lastEvent=null,Ze(a.onHover,[t,s,this],this),l&&Ze(a.onClick,[t,s,this],this));const c=!Ol(s,i);return(c||n)&&(this._active=s,this._updateHoverStyles(s,i,n)),this._lastEvent=u,c}_getActiveElements(t,n,r,i){if(t.type==="mouseout")return[];if(!r)return n;const a=this.options.hover;return this.getElementsAtEventForMode(t,a.mode,a,i)}},ie(br,"defaults",ot),ie(br,"instances",qs),ie(br,"overrides",xi),ie(br,"registry",kn),ie(br,"version",Bk),ie(br,"getChart",Gp),br);function Zp(){return He(Su.instances,e=>e._plugins.invalidate())}function Hk(e,t,n){const{startAngle:r,pixelMargin:i,x:a,y:o,outerRadius:s,innerRadius:l}=t;let u=i/s;e.beginPath(),e.arc(a,o,s,r-u,n+u),l>i?(u=i/l,e.arc(a,o,l,n+u,r-u,!0)):e.arc(a,o,i,n+dt,r-dt),e.closePath(),e.clip()}function Wk(e){return hh(e,["outerStart","outerEnd","innerStart","innerEnd"])}function zk(e,t,n,r){const i=Wk(e.options.borderRadius),a=(n-t)/2,o=Math.min(a,r*t/2),s=l=>{const u=(n-Math.min(a,l))*r/2;return tn(l,0,Math.min(a,u))};return{outerStart:s(i.outerStart),outerEnd:s(i.outerEnd),innerStart:tn(i.innerStart,0,o),innerEnd:tn(i.innerEnd,0,o)}}function Hi(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function Xl(e,t,n,r,i,a){const{x:o,y:s,startAngle:l,pixelMargin:u,innerRadius:c}=t,d=Math.max(t.outerRadius+r+n-u,0),f=c>0?c+r+n+u:0;let h=0;const g=i-l;if(r){const B=c>0?c-r:0,T=d>0?d-r:0,R=(B+T)/2,V=R!==0?g*R/(R+r):g;h=(g-V)/2}const m=Math.max(.001,g*d-n/qe)/d,p=(g-m)/2,b=l+p+h,v=i-p-h,{outerStart:y,outerEnd:C,innerStart:w,innerEnd:I}=zk(t,f,d,v-b),E=d-y,D=d-C,$=b+y/E,F=v-C/D,_=f+w,P=f+I,k=b+w/_,A=v-I/P;if(e.beginPath(),a){const B=($+F)/2;if(e.arc(o,s,d,$,B),e.arc(o,s,d,B,F),C>0){const H=Hi(D,F,o,s);e.arc(H.x,H.y,C,F,v+dt)}const T=Hi(P,v,o,s);if(e.lineTo(T.x,T.y),I>0){const H=Hi(P,A,o,s);e.arc(H.x,H.y,I,v+dt,A+Math.PI)}const R=(v-I/f+(b+w/f))/2;if(e.arc(o,s,f,v-I/f,R,!0),e.arc(o,s,f,R,b+w/f,!0),w>0){const H=Hi(_,k,o,s);e.arc(H.x,H.y,w,k+Math.PI,b-dt)}const V=Hi(E,b,o,s);if(e.lineTo(V.x,V.y),y>0){const H=Hi(E,$,o,s);e.arc(H.x,H.y,y,b-dt,$)}}else{e.moveTo(o,s);const B=Math.cos($)*d+o,T=Math.sin($)*d+s;e.lineTo(B,T);const R=Math.cos(F)*d+o,V=Math.sin(F)*d+s;e.lineTo(R,V)}e.closePath()}function Gk(e,t,n,r,i){const{fullCircles:a,startAngle:o,circumference:s}=t;let l=t.endAngle;if(a){Xl(e,t,n,r,l,i);for(let u=0;u<a;++u)e.fill();isNaN(s)||(l=o+(s%Qe||Qe))}return Xl(e,t,n,r,l,i),e.fill(),l}function Zk(e,t,n,r,i){const{fullCircles:a,startAngle:o,circumference:s,options:l}=t,{borderWidth:u,borderJoinStyle:c,borderDash:d,borderDashOffset:f}=l,h=l.borderAlign==="inner";if(!u)return;e.setLineDash(d||[]),e.lineDashOffset=f,h?(e.lineWidth=u*2,e.lineJoin=c||"round"):(e.lineWidth=u,e.lineJoin=c||"bevel");let g=t.endAngle;if(a){Xl(e,t,n,r,g,i);for(let m=0;m<a;++m)e.stroke();isNaN(s)||(g=o+(s%Qe||Qe))}h&&Hk(e,t,g),a||(Xl(e,t,n,r,g,i),e.stroke())}class Na extends jr{constructor(n){super();ie(this,"circumference");ie(this,"endAngle");ie(this,"fullCircles");ie(this,"innerRadius");ie(this,"outerRadius");ie(this,"pixelMargin");ie(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 a=this.getProps(["x","y"],i),{angle:o,distance:s}=H4(a,{x:n,y:r}),{startAngle:l,endAngle:u,innerRadius:c,outerRadius:d,circumference:f}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),h=(this.options.spacing+this.options.borderWidth)/2,m=Ce(f,u-l)>=Qe||Fo(o,l,u),p=Xi(s,c+h,d+h);return m&&p}getCenterPoint(n){const{x:r,y:i,startAngle:a,endAngle:o,innerRadius:s,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:u,spacing:c}=this.options,d=(a+o)/2,f=(s+l+c+u)/2;return{x:r+Math.cos(d)*f,y:i+Math.sin(d)*f}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:r,circumference:i}=this,a=(r.offset||0)/4,o=(r.spacing||0)/2,s=r.circular;if(this.pixelMargin=r.borderAlign==="inner"?.33:0,this.fullCircles=i>Qe?Math.floor(i/Qe):0,i===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const l=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(l)*a,Math.sin(l)*a);const u=1-Math.sin(Math.min(qe,i||0)),c=a*u;n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,Gk(n,this,c,o,s),Zk(n,this,c,o,s),n.restore()}}ie(Na,"id","arc"),ie(Na,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),ie(Na,"defaultRoutes",{backgroundColor:"backgroundColor"}),ie(Na,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function h3(e,t,n=t){e.lineCap=Ce(n.borderCapStyle,t.borderCapStyle),e.setLineDash(Ce(n.borderDash,t.borderDash)),e.lineDashOffset=Ce(n.borderDashOffset,t.borderDashOffset),e.lineJoin=Ce(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=Ce(n.borderWidth,t.borderWidth),e.strokeStyle=Ce(n.borderColor,t.borderColor)}function Xk(e,t,n){e.lineTo(n.x,n.y)}function Yk(e){return e.stepped?IP:e.tension||e.cubicInterpolationMode==="monotone"?EP:Xk}function g3(e,t,n={}){const r=e.length,{start:i=0,end:a=r-1}=n,{start:o,end:s}=t,l=Math.max(i,o),u=Math.min(a,s),c=i<o&&a<o||i>s&&a>s;return{count:r,start:l,loop:t.loop,ilen:u<l&&!c?r+u-l:u-l}}function Uk(e,t,n,r){const{points:i,options:a}=t,{count:o,start:s,loop:l,ilen:u}=g3(i,n,r),c=Yk(a);let{move:d=!0,reverse:f}=r||{},h,g,m;for(h=0;h<=u;++h)g=i[(s+(f?u-h:h))%o],!g.skip&&(d?(e.moveTo(g.x,g.y),d=!1):c(e,m,g,f,a.stepped),m=g);return l&&(g=i[(s+(f?u:0))%o],c(e,m,g,f,a.stepped)),!!l}function Jk(e,t,n,r){const i=t.points,{count:a,start:o,ilen:s}=g3(i,n,r),{move:l=!0,reverse:u}=r||{};let c=0,d=0,f,h,g,m,p,b;const v=C=>(o+(u?s-C:C))%a,y=()=>{m!==p&&(e.lineTo(c,p),e.lineTo(c,m),e.lineTo(c,b))};for(l&&(h=i[v(0)],e.moveTo(h.x,h.y)),f=0;f<=s;++f){if(h=i[v(f)],h.skip)continue;const C=h.x,w=h.y,I=C|0;I===g?(w<m?m=w:w>p&&(p=w),c=(d*c+C)/++d):(y(),e.lineTo(C,w),g=I,d=0,m=p=w),b=w}y()}function Fd(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?Jk:Uk}function Kk(e){return e.stepped?aT:e.tension||e.cubicInterpolationMode==="monotone"?oT:ei}function Qk(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),h3(e,t.options),e.stroke(i)}function qk(e,t,n,r){const{segments:i,options:a}=t,o=Fd(t);for(const s of i)h3(e,a,s.style),e.beginPath(),o(e,t,s,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const eM=typeof Path2D=="function";function tM(e,t,n,r){eM&&!t.options.segment?Qk(e,t,n,r):qk(e,t,n,r)}class La extends jr{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;KP(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=gT(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],a=this.points,o=dT(this,{property:n,start:i,end:i});if(!o.length)return;const s=[],l=Kk(r);let u,c;for(u=0,c=o.length;u<c;++u){const{start:d,end:f}=o[u],h=a[d],g=a[f];if(h===g){s.push(h);continue}const m=Math.abs((i-h[n])/(g[n]-h[n])),p=l(h,g,m,r.stepped);p[n]=t[n],s.push(p)}return s.length===1?s[0]:s}pathSegment(t,n,r){return Fd(this)(t,this,n,r)}path(t,n,r){const i=this.segments,a=Fd(this);let o=this._loop;n=n||0,r=r||this.points.length-n;for(const s of i)o&=a(t,this,s,{start:n,end:n+r-1});return!!o}draw(t,n,r,i){const a=this.options||{};(this.points||[]).length&&a.borderWidth&&(t.save(),tM(t,this,r,i),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}ie(La,"id","line"),ie(La,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),ie(La,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),ie(La,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function Xp(e,t,n,r){const i=e.options,{[n]:a}=e.getProps([n],r);return Math.abs(t-a)<i.radius+i.hitRadius}class el extends jr{constructor(n){super();ie(this,"parsed");ie(this,"skip");ie(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 a=this.options,{x:o,y:s}=this.getProps(["x","y"],i);return Math.pow(n-o,2)+Math.pow(r-s,2)<Math.pow(a.hitRadius+a.radius,2)}inXRange(n,r){return Xp(this,n,"x",r)}inYRange(n,r){return Xp(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||!lr(this,r,this.size(i)/2)||(n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.fillStyle=i.backgroundColor,$d(n,i,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}ie(el,"id","point"),ie(el,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),ie(el,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});const Yp=(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)}},nM=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class Up extends jr{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=Ze(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=pt(r.font),a=i.size,o=this._computeTitleHeight(),{boxWidth:s,itemHeight:l}=Yp(r,a);let u,c;n.font=i.string,this.isHorizontal()?(u=this.maxWidth,c=this._fitRows(o,a,s,l)+10):(c=this.maxHeight,u=this._fitCols(o,i,s,l)+10),this.width=Math.min(u,t.maxWidth||this.maxWidth),this.height=Math.min(c,t.maxHeight||this.maxHeight)}_fitRows(t,n,r,i){const{ctx:a,maxWidth:o,options:{labels:{padding:s}}}=this,l=this.legendHitBoxes=[],u=this.lineWidths=[0],c=i+s;let d=t;a.textAlign="left",a.textBaseline="middle";let f=-1,h=-c;return this.legendItems.forEach((g,m)=>{const p=r+n/2+a.measureText(g.text).width;(m===0||u[u.length-1]+p+2*s>o)&&(d+=c,u[u.length-(m>0?0:1)]=0,h+=c,f++),l[m]={left:0,top:h,row:f,width:p,height:i},u[u.length-1]+=p+s}),d}_fitCols(t,n,r,i){const{ctx:a,maxHeight:o,options:{labels:{padding:s}}}=this,l=this.legendHitBoxes=[],u=this.columnSizes=[],c=o-t;let d=s,f=0,h=0,g=0,m=0;return this.legendItems.forEach((p,b)=>{const{itemWidth:v,itemHeight:y}=rM(r,n,a,p,i);b>0&&h+y+2*s>c&&(d+=f+s,u.push({width:f,height:h}),g+=f+s,m++,f=h=0),l[b]={left:g,top:h,col:m,width:v,height:y},f=Math.max(f,v),h+=y+s}),d+=f,u.push({width:f,height:h}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:i},rtl:a}}=this,o=ra(a,this.left,this.width);if(this.isHorizontal()){let s=0,l=_t(r,this.left+i,this.right-this.lineWidths[s]);for(const u of n)s!==u.row&&(s=u.row,l=_t(r,this.left+i,this.right-this.lineWidths[s])),u.top+=this.top+t+i,u.left=o.leftForLtr(o.x(l),u.width),l+=u.width+i}else{let s=0,l=_t(r,this.top+t+i,this.bottom-this.columnSizes[s].height);for(const u of n)u.col!==s&&(s=u.col,l=_t(r,this.top+t+i,this.bottom-this.columnSizes[s].height)),u.top=l,u.left+=this.left+i,u.left=o.leftForLtr(o.x(u.left),u.width),l+=u.height+i}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;dh(t,this),this._draw(),fh(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:i}=this,{align:a,labels:o}=t,s=ot.color,l=ra(t.rtl,this.left,this.width),u=pt(o.font),{padding:c}=o,d=u.size,f=d/2;let h;this.drawTitle(),i.textAlign=l.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=u.string;const{boxWidth:g,boxHeight:m,itemHeight:p}=Yp(o,d),b=function(I,E,D){if(isNaN(g)||g<=0||isNaN(m)||m<0)return;i.save();const $=Ce(D.lineWidth,1);if(i.fillStyle=Ce(D.fillStyle,s),i.lineCap=Ce(D.lineCap,"butt"),i.lineDashOffset=Ce(D.lineDashOffset,0),i.lineJoin=Ce(D.lineJoin,"miter"),i.lineWidth=$,i.strokeStyle=Ce(D.strokeStyle,s),i.setLineDash(Ce(D.lineDash,[])),o.usePointStyle){const F={radius:m*Math.SQRT2/2,pointStyle:D.pointStyle,rotation:D.rotation,borderWidth:$},_=l.xPlus(I,g/2),P=E+f;X4(i,F,_,P,o.pointStyleWidth&&g)}else{const F=E+Math.max((d-m)/2,0),_=l.leftForLtr(I,g),P=na(D.borderRadius);i.beginPath(),Object.values(P).some(k=>k!==0)?zl(i,{x:_,y:F,w:g,h:m,radius:P}):i.rect(_,F,g,m),i.fill(),$!==0&&i.stroke()}i.restore()},v=function(I,E,D){Ci(i,D.text,I,E+p/2,u,{strikethrough:D.hidden,textAlign:l.textAlign(D.textAlign)})},y=this.isHorizontal(),C=this._computeTitleHeight();y?h={x:_t(a,this.left+c,this.right-r[0]),y:this.top+c+C,line:0}:h={x:this.left+c,y:_t(a,this.top+C+c,this.bottom-n[0].height),line:0},q4(this.ctx,t.textDirection);const w=p+c;this.legendItems.forEach((I,E)=>{i.strokeStyle=I.fontColor,i.fillStyle=I.fontColor;const D=i.measureText(I.text).width,$=l.textAlign(I.textAlign||(I.textAlign=o.textAlign)),F=g+f+D;let _=h.x,P=h.y;l.setWidth(this.width),y?E>0&&_+F+c>this.right&&(P=h.y+=w,h.line++,_=h.x=_t(a,this.left+c,this.right-r[h.line])):E>0&&P+w>this.bottom&&(_=h.x=_+n[h.line].width+c,h.line++,P=h.y=_t(a,this.top+C+c,this.bottom-n[h.line].height));const k=l.x(_);if(b(k,P,I),_=gP($,_+g+f,y?_+F:this.right,t.rtl),v(l.x(_),P,I),y)h.x+=F+c;else if(typeof I.text!="string"){const A=u.lineHeight;h.y+=m3(I,A)+c}else h.y+=w}),e3(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=pt(n.font),i=Ft(n.padding);if(!n.display)return;const a=ra(t.rtl,this.left,this.width),o=this.ctx,s=n.position,l=r.size/2,u=i.top+l;let c,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),c=this.top+u,d=_t(t.align,d,this.right-f);else{const g=this.columnSizes.reduce((m,p)=>Math.max(m,p.height),0);c=u+_t(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}const h=_t(s,d,d+f);o.textAlign=a.textAlign(uh(s)),o.textBaseline="middle",o.strokeStyle=n.color,o.fillStyle=n.color,o.font=r.string,Ci(o,n.text,h,c,r)}_computeTitleHeight(){const t=this.options.title,n=pt(t.font),r=Ft(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,i,a;if(Xi(t,this.left,this.right)&&Xi(n,this.top,this.bottom)){for(a=this.legendHitBoxes,r=0;r<a.length;++r)if(i=a[r],Xi(t,i.left,i.left+i.width)&&Xi(n,i.top,i.top+i.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!oM(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const i=this._hoveredItem,a=nM(i,r);i&&!a&&Ze(n.onLeave,[t,i,this],this),this._hoveredItem=r,r&&!a&&Ze(n.onHover,[t,r,this],this)}else r&&Ze(n.onClick,[t,r,this],this)}}function rM(e,t,n,r,i){const a=iM(r,e,t,n),o=aM(i,r,t.lineHeight);return{itemWidth:a,itemHeight:o}}function iM(e,t,n,r){let i=e.text;return i&&typeof i!="string"&&(i=i.reduce((a,o)=>a.length>o.length?a:o)),t+n.size/2+r.measureText(i).width}function aM(e,t,n){let r=e;return typeof t.text!="string"&&(r=m3(t,n)),r}function m3(e,t){const n=e.text?e.text.length:0;return t*n}function oM(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var sM={id:"legend",_element:Up,start(e,t,n){const r=e.legend=new Up({ctx:e.ctx,options:n,chart:e});bn.configure(e,r,n),bn.addBox(e,r)},stop(e){bn.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;bn.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:a,useBorderRadius:o,borderRadius:s}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const u=l.controller.getStyle(n?0:void 0),c=Ft(u.borderWidth);return{text:t[l.index].label,fillStyle:u.backgroundColor,fontColor:a,hidden:!l.visible,lineCap:u.borderCapStyle,lineDash:u.borderDash,lineDashOffset:u.borderDashOffset,lineJoin:u.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:u.borderColor,pointStyle:r||u.pointStyle,rotation:u.rotation,textAlign:i||u.textAlign,borderRadius:o&&(s||u.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 p3 extends jr{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=at(r.text)?r.text.length:1;this._padding=Ft(r.padding);const a=i*pt(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=a:this.width=a}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:r,bottom:i,right:a,options:o}=this,s=o.align;let l=0,u,c,d;return this.isHorizontal()?(c=_t(s,r,a),d=n+t,u=a-r):(o.position==="left"?(c=r+t,d=_t(s,i,n),l=qe*-.5):(c=a-t,d=_t(s,n,i),l=qe*.5),u=i-n),{titleX:c,titleY:d,maxWidth:u,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const r=pt(n.font),a=r.lineHeight/2+this._padding.top,{titleX:o,titleY:s,maxWidth:l,rotation:u}=this._drawArgs(a);Ci(t,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:u,textAlign:uh(n.align),textBaseline:"middle",translation:[o,s]})}}function lM(e,t){const n=new p3({ctx:e.ctx,options:t,chart:e});bn.configure(e,n,t),bn.addBox(e,n),e.titleBlock=n}var uM={id:"title",_element:p3,start(e,t,n){lM(e,n)},stop(e){const t=e.titleBlock;bn.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;bn.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 ja={average(e){if(!e.length)return!1;let t,n,r=new Set,i=0,a=0;for(t=0,n=e.length;t<n;++t){const s=e[t].element;if(s&&s.hasValue()){const l=s.tooltipPosition();r.add(l.x),i+=l.y,++a}}return{x:[...r].reduce((s,l)=>s+l)/r.size,y:i/a}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,i=Number.POSITIVE_INFINITY,a,o,s;for(a=0,o=e.length;a<o;++a){const l=e[a].element;if(l&&l.hasValue()){const u=l.getCenterPoint(),c=Id(t,u);c<i&&(i=c,s=l)}}if(s){const l=s.tooltipPosition();n=l.x,r=l.y}return{x:n,y:r}}};function Pn(e,t){return t&&(at(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Qn(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
|
173
173
|
`)>-1?e.split(`
|
174
|
-
`):e}function cM(e,t){const{element:n,datasetIndex:r,index:i}=t,a=e.getDatasetMeta(r).controller,{label:o,value:s}=a.getLabelAndValue(i);return{chart:e,label:o,parsed:a.getParsed(i),raw:e.data.datasets[r].data[i],formattedValue:s,dataset:a.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function Jp(e,t){const n=e.chart.ctx,{body:r,footer:i,title:a}=e,{boxWidth:o,boxHeight:s}=t,l=pt(t.bodyFont),u=pt(t.titleFont),c=pt(t.footerFont),d=a.length,f=i.length,h=r.length,g=Ft(t.padding);let m=g.height,p=0,b=r.reduce((C,w)=>C+w.before.length+w.lines.length+w.after.length,0);if(b+=e.beforeBody.length+e.afterBody.length,d&&(m+=d*u.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),b){const C=t.displayColors?Math.max(s,l.lineHeight):l.lineHeight;m+=h*C+(b-h)*l.lineHeight+(b-1)*t.bodySpacing}f&&(m+=t.footerMarginTop+f*c.lineHeight+(f-1)*t.footerSpacing);let v=0;const y=function(C){p=Math.max(p,n.measureText(C).width+v)};return n.save(),n.font=u.string,He(e.title,y),n.font=l.string,He(e.beforeBody.concat(e.afterBody),y),v=t.displayColors?o+2+t.boxPadding:0,He(r,C=>{He(C.before,y),He(C.lines,y),He(C.after,y)}),v=0,n.font=c.string,He(e.footer,y),n.restore(),p+=g.width,{width:p,height:m}}function dM(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function fM(e,t,n,r){const{x:i,width:a}=r,o=n.caretSize+n.caretPadding;if(e==="left"&&i+a+o>t.width||e==="right"&&i-a-o<0)return!0}function hM(e,t,n,r){const{x:i,width:a}=n,{width:o,chartArea:{left:s,right:l}}=e;let u="center";return r==="center"?u=i<=(s+l)/2?"left":"right":i<=a/2?u="left":i>=o-a/2&&(u="right"),fM(u,e,t,n)&&(u="center"),u}function Kp(e,t,n){const r=n.yAlign||t.yAlign||dM(e,n);return{xAlign:n.xAlign||t.xAlign||hM(e,t,n,r),yAlign:r}}function gM(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function mM(e,t,n){let{y:r,height:i}=e;return t==="top"?r+=n:t==="bottom"?r-=i+n:r-=i/2,r}function Qp(e,t,n,r){const{caretSize:i,caretPadding:a,cornerRadius:o}=e,{xAlign:s,yAlign:l}=n,u=i+a,{topLeft:c,topRight:d,bottomLeft:f,bottomRight:h}=na(o);let g=gM(t,s);const m=mM(t,l,u);return l==="center"?s==="left"?g+=u:s==="right"&&(g-=u):s==="left"?g-=Math.max(c,f)+i:s==="right"&&(g+=Math.max(d,h)+i),{x:tn(g,0,r.width-t.width),y:tn(m,0,r.height-t.height)}}function Ts(e,t,n){const r=Ft(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function qp(e){return Pn([],Qn(e))}function pM(e,t,n){return Lr(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function e0(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const b3={beforeTitle:Un,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:Un,beforeBody:Un,beforeLabel:Un,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 Je(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:Un,afterBody:Un,beforeFooter:Un,footer:Un,afterFooter:Un};function Ht(e,t,n,r){const i=e[t].call(n,r);return typeof i>"u"?b3[t].call(n,r):i}class Pd extends jr{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,a=new n3(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(a)),a}getContext(){return this.$context||(this.$context=pM(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,i=Ht(r,"beforeTitle",this,t),a=Ht(r,"title",this,t),o=Ht(r,"afterTitle",this,t);let s=[];return s=Pn(s,Qn(i)),s=Pn(s,Qn(a)),s=Pn(s,Qn(o)),s}getBeforeBody(t,n){return qp(Ht(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,i=[];return He(t,a=>{const o={before:[],lines:[],after:[]},s=e0(r,a);Pn(o.before,Qn(Ht(s,"beforeLabel",this,a))),Pn(o.lines,Ht(s,"label",this,a)),Pn(o.after,Qn(Ht(s,"afterLabel",this,a))),i.push(o)}),i}getAfterBody(t,n){return qp(Ht(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,i=Ht(r,"beforeFooter",this,t),a=Ht(r,"footer",this,t),o=Ht(r,"afterFooter",this,t);let s=[];return s=Pn(s,Qn(i)),s=Pn(s,Qn(a)),s=Pn(s,Qn(o)),s}_createItems(t){const n=this._active,r=this.chart.data,i=[],a=[],o=[];let s=[],l,u;for(l=0,u=n.length;l<u;++l)s.push(cM(this.chart,n[l]));return t.filter&&(s=s.filter((c,d,f)=>t.filter(c,d,f,r))),t.itemSort&&(s=s.sort((c,d)=>t.itemSort(c,d,r))),He(s,c=>{const d=e0(t.callbacks,c);i.push(Ht(d,"labelColor",this,c)),a.push(Ht(d,"labelPointStyle",this,c)),o.push(Ht(d,"labelTextColor",this,c))}),this.labelColors=i,this.labelPointStyles=a,this.labelTextColors=o,this.dataPoints=s,s}update(t,n){const r=this.options.setContext(this.getContext()),i=this._active;let a,o=[];if(!i.length)this.opacity!==0&&(a={opacity:0});else{const s=ja[r.position].call(this,i,this._eventPosition);o=this._createItems(r),this.title=this.getTitle(o,r),this.beforeBody=this.getBeforeBody(o,r),this.body=this.getBody(o,r),this.afterBody=this.getAfterBody(o,r),this.footer=this.getFooter(o,r);const l=this._size=Jp(this,r),u=Object.assign({},s,l),c=Kp(this.chart,r,u),d=Qp(r,u,c,this.chart);this.xAlign=c.xAlign,this.yAlign=c.yAlign,a={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:s.x,caretY:s.y}}this._tooltipItems=o,this.$context=void 0,a&&this._resolveAnimations().update(this,a),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,i){const a=this.getCaretPosition(t,r,i);n.lineTo(a.x1,a.y1),n.lineTo(a.x2,a.y2),n.lineTo(a.x3,a.y3)}getCaretPosition(t,n,r){const{xAlign:i,yAlign:a}=this,{caretSize:o,cornerRadius:s}=r,{topLeft:l,topRight:u,bottomLeft:c,bottomRight:d}=na(s),{x:f,y:h}=t,{width:g,height:m}=n;let p,b,v,y,C,w;return a==="center"?(C=h+m/2,i==="left"?(p=f,b=p-o,y=C+o,w=C-o):(p=f+g,b=p+o,y=C-o,w=C+o),v=p):(i==="left"?b=f+Math.max(l,c)+o:i==="right"?b=f+g-Math.max(u,d)-o:b=this.caretX,a==="top"?(y=h,C=y-o,p=b-o,v=b+o):(y=h+m,C=y+o,p=b+o,v=b-o),w=y),{x1:p,x2:b,x3:v,y1:y,y2:C,y3:w}}drawTitle(t,n,r){const i=this.title,a=i.length;let o,s,l;if(a){const u=ra(r.rtl,this.x,this.width);for(t.x=Ts(this,r.titleAlign,r),n.textAlign=u.textAlign(r.titleAlign),n.textBaseline="middle",o=pt(r.titleFont),s=r.titleSpacing,n.fillStyle=r.titleColor,n.font=o.string,l=0;l<a;++l)n.fillText(i[l],u.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+s,l+1===a&&(t.y+=r.titleMarginBottom-s)}}_drawColorBox(t,n,r,i,a){const o=this.labelColors[r],s=this.labelPointStyles[r],{boxHeight:l,boxWidth:u}=a,c=pt(a.bodyFont),d=Ts(this,"left",a),f=i.x(d),h=l<c.lineHeight?(c.lineHeight-l)/2:0,g=n.y+h;if(a.usePointStyle){const m={radius:Math.min(u,l)/2,pointStyle:s.pointStyle,rotation:s.rotation,borderWidth:1},p=i.leftForLtr(f,u)+u/2,b=g+l/2;t.strokeStyle=a.multiKeyBackground,t.fillStyle=a.multiKeyBackground,$d(t,m,p,b),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,$d(t,m,p,b)}else{t.lineWidth=Re(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,t.strokeStyle=o.borderColor,t.setLineDash(o.borderDash||[]),t.lineDashOffset=o.borderDashOffset||0;const m=i.leftForLtr(f,u),p=i.leftForLtr(i.xPlus(f,1),u-2),b=na(o.borderRadius);Object.values(b).some(v=>v!==0)?(t.beginPath(),t.fillStyle=a.multiKeyBackground,zl(t,{x:m,y:g,w:u,h:l,radius:b}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),zl(t,{x:p,y:g+1,w:u-2,h:l-2,radius:b}),t.fill()):(t.fillStyle=a.multiKeyBackground,t.fillRect(m,g,u,l),t.strokeRect(m,g,u,l),t.fillStyle=o.backgroundColor,t.fillRect(p,g+1,u-2,l-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){const{body:i}=this,{bodySpacing:a,bodyAlign:o,displayColors:s,boxHeight:l,boxWidth:u,boxPadding:c}=r,d=pt(r.bodyFont);let f=d.lineHeight,h=0;const g=ra(r.rtl,this.x,this.width),m=function(D){n.fillText(D,g.x(t.x+h),t.y+f/2),t.y+=f+a},p=g.textAlign(o);let b,v,y,C,w,I,E;for(n.textAlign=o,n.textBaseline="middle",n.font=d.string,t.x=Ts(this,p,r),n.fillStyle=r.bodyColor,He(this.beforeBody,m),h=s&&p!=="right"?o==="center"?u/2+c:u+2+c:0,C=0,I=i.length;C<I;++C){for(b=i[C],v=this.labelTextColors[C],n.fillStyle=v,He(b.before,m),y=b.lines,s&&y.length&&(this._drawColorBox(n,t,C,g,r),f=Math.max(d.lineHeight,l)),w=0,E=y.length;w<E;++w)m(y[w]),f=d.lineHeight;He(b.after,m)}h=0,f=d.lineHeight,He(this.afterBody,m),t.y-=a}drawFooter(t,n,r){const i=this.footer,a=i.length;let o,s;if(a){const l=ra(r.rtl,this.x,this.width);for(t.x=Ts(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",o=pt(r.footerFont),n.fillStyle=r.footerColor,n.font=o.string,s=0;s<a;++s)n.fillText(i[s],l.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+r.footerSpacing}}drawBackground(t,n,r,i){const{xAlign:a,yAlign:o}=this,{x:s,y:l}=t,{width:u,height:c}=r,{topLeft:d,topRight:f,bottomLeft:h,bottomRight:g}=na(i.cornerRadius);n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.beginPath(),n.moveTo(s+d,l),o==="top"&&this.drawCaret(t,n,r,i),n.lineTo(s+u-f,l),n.quadraticCurveTo(s+u,l,s+u,l+f),o==="center"&&a==="right"&&this.drawCaret(t,n,r,i),n.lineTo(s+u,l+c-g),n.quadraticCurveTo(s+u,l+c,s+u-g,l+c),o==="bottom"&&this.drawCaret(t,n,r,i),n.lineTo(s+h,l+c),n.quadraticCurveTo(s,l+c,s,l+c-h),o==="center"&&a==="left"&&this.drawCaret(t,n,r,i),n.lineTo(s,l+d),n.quadraticCurveTo(s,l,s+d,l),n.closePath(),n.fill(),i.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,i=r&&r.x,a=r&&r.y;if(i||a){const o=ja[t.position].call(this,this._active,this._eventPosition);if(!o)return;const s=this._size=Jp(this,t),l=Object.assign({},o,this._size),u=Kp(n,t,l),c=Qp(t,l,u,n);(i._to!==c.x||a._to!==c.y)&&(this.xAlign=u.xAlign,this.yAlign=u.yAlign,this.width=s.width,this.height=s.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,c))}}_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},a={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const o=Ft(n.padding),s=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&s&&(t.save(),t.globalAlpha=r,this.drawBackground(a,t,i,n),q4(t,n.textDirection),a.y+=o.top,this.drawTitle(a,t,n),this.drawBody(a,t,n),this.drawFooter(a,t,n),e3(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,i=t.map(({datasetIndex:s,index:l})=>{const u=this.chart.getDatasetMeta(s);if(!u)throw new Error("Cannot find a dataset at index "+s);return{datasetIndex:s,element:u.data[l],index:l}}),a=!Ol(r,i),o=this._positionChanged(i,n);(a||o)&&(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,a=this._active||[],o=this._getActiveElements(t,a,n,r),s=this._positionChanged(o,t),l=n||!Ol(o,a)||s;return l&&(this._active=o,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,r,i){const a=this.options;if(t.type==="mouseout")return[];if(!i)return n.filter(s=>this.chart.data.datasets[s.datasetIndex]&&this.chart.getDatasetMeta(s.datasetIndex).controller.getParsed(s.index)!==void 0);const o=this.chart.getElementsAtEventForMode(t,a.mode,a,r);return a.reverse&&o.reverse(),o}_positionChanged(t,n){const{caretX:r,caretY:i,options:a}=this,o=ja[a.position].call(this,t,n);return o!==!1&&(r!==o.x||i!==o.y)}}ie(Pd,"positioners",ja);var bM={id:"tooltip",_element:Pd,positioners:ja,afterInit(e,t,n){n&&(e.tooltip=new Pd({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:b3},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"]};const vM=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function yM(e,t,n,r){const i=e.indexOf(t);if(i===-1)return vM(e,t,n,r);const a=e.lastIndexOf(t);return i!==a?n:i}const xM=(e,t)=>e===null?null:tn(Math.round(e),0,t);function t0(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class Td extends _i{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:a}of n)r[i]===a&&r.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(Je(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:yM(r,t,Ce(n,t),this._addedLabels),xM(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 a=this.getLabels();a=t===0&&n===a.length-1?a:a.slice(t,n+1),this._valueRange=Math.max(a.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let o=t;o<=n;o++)i.push({value:o});return i}getLabelForValue(t){return t0.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}}ie(Td,"id","category"),ie(Td,"defaults",{ticks:{callback:t0}});function CM(e,t){const n=[],{bounds:i,step:a,min:o,max:s,precision:l,count:u,maxTicks:c,maxDigits:d,includeBounds:f}=e,h=a||1,g=c-1,{min:m,max:p}=t,b=!Je(o),v=!Je(s),y=!Je(u),C=(p-m)/(d+1);let w=op((p-m)/g/h)*h,I,E,D,$;if(w<1e-14&&!b&&!v)return[{value:m},{value:p}];$=Math.ceil(p/w)-Math.floor(m/w),$>g&&(w=op($*w/g/h)*h),Je(l)||(I=Math.pow(10,l),w=Math.ceil(w*I)/I),i==="ticks"?(E=Math.floor(m/w)*w,D=Math.ceil(p/w)*w):(E=m,D=p),b&&v&&a&&oP((s-o)/a,w/1e3)?($=Math.round(Math.min((s-o)/w,c)),w=(s-o)/$,E=o,D=s):y?(E=b?o:E,D=v?s:D,$=u-1,w=(D-E)/$):($=(D-E)/w,Ja($,Math.round($),w/1e3)?$=Math.round($):$=Math.ceil($));const F=Math.max(sp(w),sp(E));I=Math.pow(10,Je(l)?F:l),E=Math.round(E*I)/I,D=Math.round(D*I)/I;let _=0;for(b&&(f&&E!==o?(n.push({value:o}),E<o&&_++,Ja(Math.round((E+_*w)*I)/I,o,n0(o,C,e))&&_++):E<o&&_++);_<$;++_){const P=Math.round((E+_*w)*I)/I;if(v&&P>s)break;n.push({value:P})}return v&&f&&D!==s?n.length&&Ja(n[n.length-1].value,s,n0(s,C,e))?n[n.length-1].value=s:n.push({value:s}):(!v||D===s)&&n.push({value:D}),n}function n0(e,t,{horizontal:n,minRotation:r}){const i=Nn(r),a=(n?Math.sin(i):Math.cos(i))||.001,o=.75*t*(""+e).length;return Math.min(t/a,o)}class Yl extends _i{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 Je(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:a}=this;const o=l=>i=n?i:l,s=l=>a=r?a:l;if(t){const l=da(i),u=da(a);l<0&&u<0?s(0):l>0&&u>0&&o(0)}if(i===a){let l=a===0?1:Math.abs(a*.05);s(a+l),t||o(i-l)}this.min=i,this.max=a}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},a=this._range||this,o=CM(i,a);return t.bounds==="ticks"&&j4(o,this,"value"),t.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}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 Cu(t,this.chart.options.locale,this.options.ticks.format)}}class kd extends Yl{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=xt(t)?t:0,this.max=xt(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=Nn(this.options.ticks.minRotation),i=(t?Math.sin(r):Math.cos(r))||.001,a=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,a.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}}ie(kd,"id","linear"),ie(kd,"defaults",{ticks:{callback:wu.formatters.numeric}});const To=e=>Math.floor(_r(e)),Ur=(e,t)=>Math.pow(10,To(e)+t);function r0(e){return e/Math.pow(10,To(e))===1}function i0(e,t,n){const r=Math.pow(10,n),i=Math.floor(e/r);return Math.ceil(t/r)-i}function wM(e,t){const n=t-e;let r=To(n);for(;i0(e,t,r)>10;)r++;for(;i0(e,t,r)<10;)r--;return Math.min(r,To(e))}function DM(e,{min:t,max:n}){t=Qt(e.min,t);const r=[],i=To(t);let a=wM(t,n),o=a<0?Math.pow(10,Math.abs(a)):1;const s=Math.pow(10,a),l=i>a?Math.pow(10,i):0,u=Math.round((t-l)*o)/o,c=Math.floor((t-l)/s/10)*s*10;let d=Math.floor((u-c)/Math.pow(10,a)),f=Qt(e.min,Math.round((l+c+d*Math.pow(10,a))*o)/o);for(;f<n;)r.push({value:f,major:r0(f),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(a++,d=2,o=a>=0?1:o),f=Math.round((l+c+d*Math.pow(10,a))*o)/o;const h=Qt(e.max,f);return r.push({value:h,major:r0(h),significand:d}),r}class a0 extends _i{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const r=Yl.prototype.parse.apply(this,[t,n]);if(r===0){this._zero=!0;return}return xt(r)&&r>0?r:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=xt(t)?Math.max(0,t):null,this.max=xt(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!xt(this._userMin)&&(this.min=t===Ur(this.min,0)?Ur(this.min,-1):Ur(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let r=this.min,i=this.max;const a=s=>r=t?r:s,o=s=>i=n?i:s;r===i&&(r<=0?(a(1),o(10)):(a(Ur(r,-1)),o(Ur(i,1)))),r<=0&&a(Ur(i,-1)),i<=0&&o(Ur(r,1)),this.min=r,this.max=i}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},r=DM(n,this);return t.bounds==="ticks"&&j4(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":Cu(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=_r(t),this._valueRange=_r(this.max)-_r(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(_r(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}ie(a0,"id","logarithmic"),ie(a0,"defaults",{ticks:{callback:wu.formatters.logarithmic,major:{enabled:!0}}});function Md(e){const t=e.ticks;if(t.display&&e.display){const n=Ft(t.backdropPadding);return Ce(t.font&&t.font.size,ot.font.size)+n.height}return 0}function SM(e,t,n){return n=at(n)?n:[n],{w:SP(e,t.string,n),h:n.length*t.lineHeight}}function o0(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 IM(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=[],a=e._pointLabels.length,o=e.options.pointLabels,s=o.centerPointLabels?Qe/a:0;for(let l=0;l<a;l++){const u=o.setContext(e.getPointLabelContext(l));i[l]=u.padding;const c=e.getPointPosition(l,e.drawingArea+i[l],s),d=pt(u.font),f=SM(e.ctx,d,e._pointLabels[l]);r[l]=f;const h=Cn(e.getIndexAngle(l)+s),g=Math.round(sh(h)),m=o0(g,c.x,f.w,0,180),p=o0(g,c.y,f.h,90,270);EM(n,t,h,m,p)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=RM(e,r,i)}function EM(e,t,n,r,i){const a=Math.abs(Math.sin(n)),o=Math.abs(Math.cos(n));let s=0,l=0;r.start<t.l?(s=(t.l-r.start)/a,e.l=Math.min(e.l,t.l-s)):r.end>t.r&&(s=(r.end-t.r)/a,e.r=Math.max(e.r,t.r+s)),i.start<t.t?(l=(t.t-i.start)/o,e.t=Math.min(e.t,t.t-l)):i.end>t.b&&(l=(i.end-t.b)/o,e.b=Math.max(e.b,t.b+l))}function _M(e,t,n){const r=e.drawingArea,{extra:i,additionalAngle:a,padding:o,size:s}=n,l=e.getPointPosition(t,r+i+o,a),u=Math.round(sh(Cn(l.angle+dt))),c=PM(l.y,s.h,u),d=AM(u),f=FM(l.x,s.w,d);return{visible:!0,x:l.x,y:c,textAlign:d,left:f,top:c,right:f+s.w,bottom:c+s.h}}function $M(e,t){if(!t)return!0;const{left:n,top:r,right:i,bottom:a}=e;return!(lr({x:n,y:r},t)||lr({x:n,y:a},t)||lr({x:i,y:r},t)||lr({x:i,y:a},t))}function RM(e,t,n){const r=[],i=e._pointLabels.length,a=e.options,{centerPointLabels:o,display:s}=a.pointLabels,l={extra:Md(a)/2,additionalAngle:o?Qe/i:0};let u;for(let c=0;c<i;c++){l.padding=n[c],l.size=t[c];const d=_M(e,c,l);r.push(d),s==="auto"&&(d.visible=$M(d,u),d.visible&&(u=d))}return r}function AM(e){return e===0||e===180?"center":e<180?"left":"right"}function FM(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function PM(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function TM(e,t,n){const{left:r,top:i,right:a,bottom:o}=n,{backdropColor:s}=t;if(!Je(s)){const l=na(t.borderRadius),u=Ft(t.backdropPadding);e.fillStyle=s;const c=r-u.left,d=i-u.top,f=a-r+u.width,h=o-i+u.height;Object.values(l).some(g=>g!==0)?(e.beginPath(),zl(e,{x:c,y:d,w:f,h,radius:l}),e.fill()):e.fillRect(c,d,f,h)}}function kM(e,t){const{ctx:n,options:{pointLabels:r}}=e;for(let i=t-1;i>=0;i--){const a=e._pointLabelItems[i];if(!a.visible)continue;const o=r.setContext(e.getPointLabelContext(i));TM(n,o,a);const s=pt(o.font),{x:l,y:u,textAlign:c}=a;Ci(n,e._pointLabels[i],l,u+s.lineHeight/2,s,{color:o.color,textAlign:c,textBaseline:"middle"})}}function v3(e,t,n,r){const{ctx:i}=e;if(n)i.arc(e.xCenter,e.yCenter,t,0,Ke);else{let a=e.getPointPosition(0,t);i.moveTo(a.x,a.y);for(let o=1;o<r;o++)a=e.getPointPosition(o,t),i.lineTo(a.x,a.y)}}function MM(e,t,n,r,i){const a=e.ctx,o=t.circular,{color:s,lineWidth:l}=t;!o&&!r||!s||!l||n<0||(a.save(),a.strokeStyle=s,a.lineWidth=l,a.setLineDash(i.dash),a.lineDashOffset=i.dashOffset,a.beginPath(),v3(e,n,o,r),a.closePath(),a.stroke(),a.restore())}function BM(e,t,n){return Lr(e,{label:n,index:t,type:"pointLabel"})}class ks extends Yl{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=Ft(Md(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=xt(t)&&!isNaN(t)?t:0,this.max=xt(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Md(this.options))}generateTickLabels(t){Yl.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,r)=>{const i=Ze(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?IM(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=Ke/(this._pointLabels.length||1),r=this.options.startAngle||0;return Cn(t*n+Nn(r))}getDistanceFromCenterForValue(t){if(Je(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(Je(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 BM(this.getContext(),t,r)}}getPointPosition(t,n,r=0){const i=this.getIndexAngle(t)-dt+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:a}=this._pointLabelItems[t];return{left:n,top:r,right:i,bottom:a}}drawBackground(){const{backgroundColor:t,grid:{circular:n}}=this.options;if(t){const r=this.ctx;r.save(),r.beginPath(),v3(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:a}=n,o=this._pointLabels.length;let s,l,u;if(n.pointLabels.display&&kM(this,o),i.display&&this.ticks.forEach((c,d)=>{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(c.value);const f=this.getContext(d),h=i.setContext(f),g=a.setContext(f);MM(this,h,l,o,g)}}),r.display){for(t.save(),s=o-1;s>=0;s--){const c=r.setContext(this.getPointLabelContext(s)),{color:d,lineWidth:f}=c;!f||!d||(t.lineWidth=f,t.strokeStyle=d,t.setLineDash(c.borderDash),t.lineDashOffset=c.borderDashOffset,l=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),u=this.getPointPosition(s,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(u.x,u.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 a,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(i),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((s,l)=>{if(l===0&&this.min>=0&&!n.reverse)return;const u=r.setContext(this.getContext(l)),c=pt(u.font);if(a=this.getDistanceFromCenterForValue(this.ticks[l].value),u.showLabelBackdrop){t.font=c.string,o=t.measureText(s.label).width,t.fillStyle=u.backdropColor;const d=Ft(u.backdropPadding);t.fillRect(-o/2-d.left,-a-c.size/2-d.top,o+d.width,c.size+d.height)}Ci(t,s.label,0,-a,c,{color:u.color,strokeColor:u.textStrokeColor,strokeWidth:u.textStrokeWidth})}),t.restore()}drawTitle(){}}ie(ks,"id","radialLinear"),ie(ks,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:wu.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),ie(ks,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),ie(ks,"descriptors",{angleLines:{_fallback:"grid"}});const Iu={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}},Wt=Object.keys(Iu);function s0(e,t){return e-t}function l0(e,t){if(Je(t))return null;const n=e._adapter,{parser:r,round:i,isoWeekday:a}=e._parseOpts;let o=t;return typeof r=="function"&&(o=r(o)),xt(o)||(o=typeof r=="string"?n.parse(o,r):n.parse(o)),o===null?null:(i&&(o=i==="week"&&(Hl(a)||a===!0)?n.startOf(o,"isoWeek",a):n.startOf(o,i)),+o)}function u0(e,t,n,r){const i=Wt.length;for(let a=Wt.indexOf(e);a<i-1;++a){const o=Iu[Wt[a]],s=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((n-t)/(s*o.size))<=r)return Wt[a]}return Wt[i-1]}function VM(e,t,n,r,i){for(let a=Wt.length-1;a>=Wt.indexOf(n);a--){const o=Wt[a];if(Iu[o].common&&e._adapter.diff(i,r,o)>=t-1)return o}return Wt[n?Wt.indexOf(n):0]}function OM(e){for(let t=Wt.indexOf(e)+1,n=Wt.length;t<n;++t)if(Iu[Wt[t]].common)return Wt[t]}function c0(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:i}=lh(n,t),a=n[r]>=t?n[r]:n[i];e[a]=!0}}function NM(e,t,n,r){const i=e._adapter,a=+i.startOf(t[0].value,r),o=t[t.length-1].value;let s,l;for(s=a;s<=o;s=+i.add(s,1,r))l=n[s],l>=0&&(t[l].major=!0);return t}function d0(e,t,n){const r=[],i={},a=t.length;let o,s;for(o=0;o<a;++o)s=t[o],i[s]=o,r.push({value:s,major:!1});return a===0||!n?r:NM(e,r,i,n)}class Ul extends _i{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 PT._date(t.adapters.date);i.init(n),Ua(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:l0(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:a,minDefined:o,maxDefined:s}=this.getUserBounds();function l(u){!o&&!isNaN(u.min)&&(i=Math.min(i,u.min)),!s&&!isNaN(u.max)&&(a=Math.max(a,u.max))}(!o||!s)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),i=xt(i)&&!isNaN(i)?i:+n.startOf(Date.now(),r),a=xt(a)&&!isNaN(a)?a:+n.endOf(Date.now(),r)+1,this.min=Math.min(i,a-1),this.max=Math.max(i+1,a)}_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 a=this.min,o=this.max,s=cP(i,a,o);return this._unit=n.unit||(r.autoSkip?u0(n.minUnit,this.min,this.max,this._getLabelCapacity(a)):VM(this,s.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:OM(this._unit),this.initOffsets(i),t.reverse&&s.reverse(),d0(this,s,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,r=0,i,a;this.options.offset&&t.length&&(i=this.getDecimalForValue(t[0]),t.length===1?n=1-i:n=(this.getDecimalForValue(t[1])-i)/2,a=this.getDecimalForValue(t[t.length-1]),t.length===1?r=a:r=(a-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;n=tn(n,0,o),r=tn(r,0,o),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,a=i.time,o=a.unit||u0(a.minUnit,n,r,this._getLabelCapacity(n)),s=Ce(i.ticks.stepSize,1),l=o==="week"?a.isoWeekday:!1,u=Hl(l)||l===!0,c={};let d=n,f,h;if(u&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,u?"day":o),t.diff(r,n,o)>1e5*s)throw new Error(n+" and "+r+" are too far apart with stepSize of "+s+" "+o);const g=i.ticks.source==="data"&&this.getDataTimestamps();for(f=d,h=0;f<r;f=+t.add(f,s,o),h++)c0(c,f,g);return(f===r||i.bounds==="ticks"||h===1)&&c0(c,f,g),Object.keys(c).sort(s0).map(m=>+m)}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,a=this._unit,o=n||i[a];return this._adapter.format(t,o)}_tickFormatFunction(t,n,r,i){const a=this.options,o=a.ticks.callback;if(o)return Ze(o,[t,n,r],this);const s=a.time.displayFormats,l=this._unit,u=this._majorUnit,c=l&&s[l],d=u&&s[u],f=r[n],h=u&&d&&f&&f.major;return this._adapter.format(t,i||(h?d:c))}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=Nn(this.isHorizontal()?n.maxRotation:n.minRotation),a=Math.cos(i),o=Math.sin(i),s=this._resolveTickFontOptions(0).size;return{w:r*a+s*o,h:r*o+s*a}}_getLabelCapacity(t){const n=this.options.time,r=n.displayFormats,i=r[n.unit]||r.millisecond,a=this._tickFormatFunction(t,0,d0(this,[t],this._majorUnit),i),o=this._getLabelSize(a),s=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return s>0?s: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(l0(this,i[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return fP(t.sort(s0))}}ie(Ul,"id","time"),ie(Ul,"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 Ms(e,t,n){let r=0,i=e.length-1,a,o,s,l;n?(t>=e[r].pos&&t<=e[i].pos&&({lo:r,hi:i}=Ed(e,"pos",t)),{pos:a,time:s}=e[r],{pos:o,time:l}=e[i]):(t>=e[r].time&&t<=e[i].time&&({lo:r,hi:i}=Ed(e,"time",t)),{time:a,pos:s}=e[r],{time:o,pos:l}=e[i]);const u=o-a;return u?s+(l-s)*(t-a)/u:s}class f0 extends Ul{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=Ms(n,this.min),this._tableRange=Ms(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,i=[],a=[];let o,s,l,u,c;for(o=0,s=t.length;o<s;++o)u=t[o],u>=n&&u<=r&&i.push(u);if(i.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(o=0,s=i.length;o<s;++o)c=i[o+1],l=i[o-1],u=i[o],Math.round((c+l)/2)!==u&&a.push({time:u,pos:o/(s-1)});return a}_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,a)=>i-a)}_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(Ms(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return Ms(this._table,r*this._tableRange+this._minPos,!0)}}ie(f0,"id","timeseries"),ie(f0,"defaults",Ul.defaults);const y3="label";function h0(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function LM(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function x3(e,t){e.labels=t}function C3(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:y3;const r=[];e.datasets=t.map(i=>{const a=e.datasets.find(o=>o[n]===i[n]);return!a||!i.data||r.includes(a)?{...i}:(r.push(a),Object.assign(a,i),a)})}function jM(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:y3;const n={labels:[],datasets:[]};return x3(n,e.labels),C3(n,e.datasets,t),n}function HM(e,t){const{height:n=150,width:r=300,redraw:i=!1,datasetIdKey:a,type:o,data:s,options:l,plugins:u=[],fallbackContent:c,updateMode:d,...f}=e,h=x.useRef(null),g=x.useRef(),m=()=>{h.current&&(g.current=new Su(h.current,{type:o,data:jM(s,a),options:l&&{...l},plugins:u}),h0(t,g.current))},p=()=>{h0(t,null),g.current&&(g.current.destroy(),g.current=null)};return x.useEffect(()=>{!i&&g.current&&l&&LM(g.current,l)},[i,l]),x.useEffect(()=>{!i&&g.current&&x3(g.current.config.data,s.labels)},[i,s.labels]),x.useEffect(()=>{!i&&g.current&&s.datasets&&C3(g.current.config.data,s.datasets,a)},[i,s.datasets]),x.useEffect(()=>{g.current&&(i?(p(),setTimeout(m)):g.current.update(d))},[i,l,s.labels,s.datasets,d]),x.useEffect(()=>{g.current&&(p(),setTimeout(m))},[o]),x.useEffect(()=>(m(),()=>p()),[]),x.createElement("canvas",Object.assign({ref:h,role:"img",height:n,width:r},f),c)}const WM=x.forwardRef(HM);function zM(e,t){return Su.register(t),x.forwardRef((n,r)=>x.createElement(WM,Object.assign({},n,{ref:r,type:e})))}const g0=zM("doughnut",Va);Su.register(Td,kd,el,La,Na,uM,bM,sM);const m0=(e,t)=>{var i,a,o,s;const n=e.getVisibleDatasetCount(),r=e.getDatasetMeta(n-1).data.at(0);if(r){const{innerRadius:l}=r.getProps(["innerRadius"]),{ctx:u}=e,c=()=>{var _;const C=[].concat(t),w=C.length,I=u.font;let E=0,D=0,$;for($=0;$<w;++$)u.font=C[$].font,E=Math.max(u.measureText(C[$].text).width,E),D+=(_=C[$].font)==null?void 0:_.lineHeight;return u.font=I,{height:D,width:E}},d=(C,w)=>{let I=document.createElement("div");document.body.appendChild(I),I.style.fontSize=`${w}px`,I.style.position="absolute",I.style.left="-10",I.style.top="-10",I.textContent=C;const E={width:I.clientWidth,height:I.clientHeight};return document.body.removeChild(I),I=null,E},f=c(),h=parseFloat(parseFloat(l).toFixed(2));u.textAlign="center",u.textBaseline="middle";const g=(e.chartArea.left+e.chartArea.right)/2,p=(e.chartArea.top+e.chartArea.bottom)/2-f.height/2;let b;const v=t.length;let y=0;for(b=0;b<v;++b){let C=(i=t[b].font)==null?void 0:i.size,w=(a=t[b].font)==null?void 0:a.lineHeight;const I=typeof t[b].text=="number"?t[b].text.toString():t[b].text;for(;d(I,C).width>h+(t[b].id==="value"?50:0);)C-=1,w=d(I,C).height;I.length>22&&w<14&&(w=18);const E=p+w/2+y,D=typeof t[b].text=="number"?new Intl.NumberFormat("id-ID",{style:"currency",currency:"IDR"}).format(t[b].text):t[b].text;let $=t[b].urlIconDesc?" ":"";if(t[b].percentage!==void 0?$+=`${t[b].percentage}% ${t[b].text}`:$+=D,u.fillStyle=t[b].color,u.font=`${C<10?10:C}px sans-serif`,y+=w,t[b].percentage!==void 0&&t[b].urlIconDesc){const F=((s=(o=t[b])==null?void 0:o.percentage)==null?void 0:s.length)??0,_=new Image;_.src=t[b].urlIconDesc,u.drawImage(_,45-(F>6?F+2:F-2.5),E-8,16,14)}u.fillText($,g,E)}u.restore(),u.save()}},GM=({labels:e,data:t,backgroundColor:n,options:r={},redraw:i,widthInnerDoughnut:a,innerLabels:o,open:s=!0,keyRemoveDataOpen:l="gap",keyLabel:u="title",keyValue:c="originalValue",keyBackground:d="backgroundColor",className:f})=>{const h={labels:e||t.map(m=>m[u]),datasets:[{data:t.map(m=>m[c]),backgroundColor:n||t.map(m=>m[d])}]},g={cutout:a,animation:{duration:i?400:0},plugins:{legend:{display:!1},tooltip:{external(m){let p=document.getElementById("chartjs-tooltip");p||(p=document.createElement("div"),p.id="chartjs-tooltip",p.innerHTML="<table></table>",document.body.appendChild(p));const b=m.tooltip;if(b.opacity===0){p.style.opacity="0";return}p.classList.remove("above","below","no-transform"),b.yAlign?p.classList.add(b.yAlign):p.classList.add("no-transform");const v=t.filter(E=>!E[u]),y=t.filter(E=>E[c]>0&&E[c]<1);if(v.length===1&&y.length===1)return;function C(E){return E.lines}if(b.body){const E=b.title||[];let D=b.body.map(C),$="<thead>";E.forEach(_=>{let P="";P+="display: flex",P+="; justify-content: center",P+="; font-weight: 600",P+="; font-size: 14px",P+="; padding: 0px 14px",$+=`<tr><span style="${P}">${_}</span></tr>`}),$+="</thead><tbody>",D.length>1&&D[0][0]===D[1][0]&&(D=[D[0]]),D.forEach(_=>{let P="";P+="display: flex",P+="; justify-content: center",P+="; color: #0163C8",P+="; padding: 0px 14px",P+="; font-size: 14px";const k=`<span style="${P}">${_}</span>`;$+=`<tr><td>${k}</td></tr>`}),$+="</tbody>";const F=p.querySelector("table");F&&(F.innerHTML=$)}const w=m.chart.canvas.getBoundingClientRect(),I=w.top+window.pageYOffset+b.caretY;p.style.opacity="1",p.style.border="solid 1px #0163C8",p.style.background="white",p.style.height="fit-content",p.style.borderRadius="10px",p.style.position="absolute",p.style.zIndex="10",p.style.padding="4px 0",p.style.left=`${w.left+window.pageXOffset+b.caretX-80}px`,p.style.top=`${I>300&&!s?280:I}px`,p.style.pointerEvents="none"},displayColors:!0,enabled:!1,callbacks:{title(m){const p=t[m[0].dataIndex];return p==null?void 0:p[u]},label(m){const p=t==null?void 0:t[m.dataIndex];let b="Nilai: ";return p&&(b+=p.value),b}}}},elements:{arc:{borderWidth:0}}};return S.jsxs("div",{className:f??"",children:[!s&&S.jsx(g0,{data:h,redraw:i,plugins:[{id:"draw",beforeDraw(m){m0(m,o)}}],options:Object.keys(r).length>1?r:g}),s&&S.jsx(g0,{data:h,redraw:i,plugins:[{id:"draw",beforeDraw(m){m0(m,o.filter(p=>p.id!==l))}}],options:Object.keys(r).length>1?r:g})]})},Bs=e=>{let t;const n=new Date(e??new Date);return e&&(t=Nf(new Date(n.setHours(n.getHours()+7)).toISOString().slice(0,10))),t},ZM=({month:e,year:t,type:n=["month","year"],activeType:r="month",minDate:i,maxDate:a,className:o,classNameButton:s,onChange:l,buttonClick:u,id:c="date-picker",idPopover:d="date-picker-popover",floatingOptions:f={},offsetPopover:h=5,zIndexPopper:g=1})=>{const{locale:m}=Rn(),p=x.useRef(null),b=Bs(i),v=Bs(a),y=C=>{var w;typeof l=="function"&&(l({month:C.month,year:C.year}),(w=p.current)==null||w.setShow(!1))};return S.jsxs(S.Fragment,{children:[S.jsx("div",{id:c,onClick:C=>{var w;C.stopPropagation(),(w=p.current)==null||w.handlerShow(C)},className:s,children:typeof u=="function"?u({month:e,year:t}):"Pilih Tanggal"}),S.jsx("div",{className:o??"",children:S.jsx(wi,{zIndex:g,ref:p,offset:h,id:d,floatingOptions:{placement:"bottom-end",...f},onClick:C=>C.stopPropagation(),children:S.jsx(qf,{locale:"id-ID",children:S.jsx(vu,{minValue:b,maxValue:v,minDate:i,maxDate:a,activeType:n.length===1?n[0]:r,locale:m,value:Bs(`${t}/${e}/1`),createCalendar:Xo,defaultValue:Bs(`${t}/${e}/1`),onChange:y,handlerReset:()=>{},handlerSubmit:()=>{},withDateSelect:!1,type:n})})})})]})},XM=({indeterminate:e,className:t="",classNameContainer:n,...r})=>{const i=x.useRef(null);return x.useEffect(()=>{typeof e=="boolean"&&(i.current.indeterminate=!r.checked&&e)},[i,e]),S.jsx("div",{className:`1ru-flex 1ru-items-center 1ru-h-full ${t??""}`,children:S.jsx(yu,{ref:i,label:"",variants:"blue-700",borderRadius:"full",className:"1ru-flex 1ru-items-center 1ru-h-full",classNameContainer:`1ru-flex 1ru-items-center 1ru-h-full ${n??""}}`,...r,onClick:a=>{a.stopPropagation(),typeof r.onClick=="function"&&r.onClick(a)},type:"checkbox"})})},YM="_input_ezltz_7",UM="_error_ezltz_32",yn={"container-xs":"_container-xs_ezltz_1","container-input":"_container-input_ezltz_4",input:YM,error:UM,"isset-right-icon":"_isset-right-icon_ezltz_41","isset-left-icon":"_isset-left-icon_ezltz_45","start-icon":"_start-icon_ezltz_49","end-icon":"_end-icon_ezltz_52","label-error":"_label-error_ezltz_55","container-s":"_container-s_ezltz_61"},xh=x.forwardRef(({name:e,classNameContainer:t,id:n,type:r="text",startIcon:i,endIcon:a,error:o,sizeInput:s="xs",classNameLabelError:l,className:u,...c},d)=>{const f={size:{s:yn["container-s"],xs:yn["container-xs"]},variant:{}},h=()=>typeof i=="function"||x.isValidElement(i),g=()=>typeof a=="function"||x.isValidElement(a);return S.jsxs("div",{className:`${f.size[s]} ${t}`,children:[S.jsxs("div",{className:`${yn["container-input"]}`,children:[S.jsxs("div",{className:yn["start-icon"],children:[typeof i=="function"&&i(),x.isValidElement(i)&&i]}),S.jsx("input",{id:n??e,className:`${yn.input} ${o?yn.error:""}
|
174
|
+
`):e}function cM(e,t){const{element:n,datasetIndex:r,index:i}=t,a=e.getDatasetMeta(r).controller,{label:o,value:s}=a.getLabelAndValue(i);return{chart:e,label:o,parsed:a.getParsed(i),raw:e.data.datasets[r].data[i],formattedValue:s,dataset:a.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function Jp(e,t){const n=e.chart.ctx,{body:r,footer:i,title:a}=e,{boxWidth:o,boxHeight:s}=t,l=pt(t.bodyFont),u=pt(t.titleFont),c=pt(t.footerFont),d=a.length,f=i.length,h=r.length,g=Ft(t.padding);let m=g.height,p=0,b=r.reduce((C,w)=>C+w.before.length+w.lines.length+w.after.length,0);if(b+=e.beforeBody.length+e.afterBody.length,d&&(m+=d*u.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),b){const C=t.displayColors?Math.max(s,l.lineHeight):l.lineHeight;m+=h*C+(b-h)*l.lineHeight+(b-1)*t.bodySpacing}f&&(m+=t.footerMarginTop+f*c.lineHeight+(f-1)*t.footerSpacing);let v=0;const y=function(C){p=Math.max(p,n.measureText(C).width+v)};return n.save(),n.font=u.string,He(e.title,y),n.font=l.string,He(e.beforeBody.concat(e.afterBody),y),v=t.displayColors?o+2+t.boxPadding:0,He(r,C=>{He(C.before,y),He(C.lines,y),He(C.after,y)}),v=0,n.font=c.string,He(e.footer,y),n.restore(),p+=g.width,{width:p,height:m}}function dM(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function fM(e,t,n,r){const{x:i,width:a}=r,o=n.caretSize+n.caretPadding;if(e==="left"&&i+a+o>t.width||e==="right"&&i-a-o<0)return!0}function hM(e,t,n,r){const{x:i,width:a}=n,{width:o,chartArea:{left:s,right:l}}=e;let u="center";return r==="center"?u=i<=(s+l)/2?"left":"right":i<=a/2?u="left":i>=o-a/2&&(u="right"),fM(u,e,t,n)&&(u="center"),u}function Kp(e,t,n){const r=n.yAlign||t.yAlign||dM(e,n);return{xAlign:n.xAlign||t.xAlign||hM(e,t,n,r),yAlign:r}}function gM(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function mM(e,t,n){let{y:r,height:i}=e;return t==="top"?r+=n:t==="bottom"?r-=i+n:r-=i/2,r}function Qp(e,t,n,r){const{caretSize:i,caretPadding:a,cornerRadius:o}=e,{xAlign:s,yAlign:l}=n,u=i+a,{topLeft:c,topRight:d,bottomLeft:f,bottomRight:h}=na(o);let g=gM(t,s);const m=mM(t,l,u);return l==="center"?s==="left"?g+=u:s==="right"&&(g-=u):s==="left"?g-=Math.max(c,f)+i:s==="right"&&(g+=Math.max(d,h)+i),{x:tn(g,0,r.width-t.width),y:tn(m,0,r.height-t.height)}}function Ts(e,t,n){const r=Ft(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function qp(e){return Pn([],Qn(e))}function pM(e,t,n){return Lr(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function e0(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const b3={beforeTitle:Un,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:Un,beforeBody:Un,beforeLabel:Un,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 Ke(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:Un,afterBody:Un,beforeFooter:Un,footer:Un,afterFooter:Un};function Ht(e,t,n,r){const i=e[t].call(n,r);return typeof i>"u"?b3[t].call(n,r):i}class Pd extends jr{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,a=new n3(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(a)),a}getContext(){return this.$context||(this.$context=pM(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,i=Ht(r,"beforeTitle",this,t),a=Ht(r,"title",this,t),o=Ht(r,"afterTitle",this,t);let s=[];return s=Pn(s,Qn(i)),s=Pn(s,Qn(a)),s=Pn(s,Qn(o)),s}getBeforeBody(t,n){return qp(Ht(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,i=[];return He(t,a=>{const o={before:[],lines:[],after:[]},s=e0(r,a);Pn(o.before,Qn(Ht(s,"beforeLabel",this,a))),Pn(o.lines,Ht(s,"label",this,a)),Pn(o.after,Qn(Ht(s,"afterLabel",this,a))),i.push(o)}),i}getAfterBody(t,n){return qp(Ht(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,i=Ht(r,"beforeFooter",this,t),a=Ht(r,"footer",this,t),o=Ht(r,"afterFooter",this,t);let s=[];return s=Pn(s,Qn(i)),s=Pn(s,Qn(a)),s=Pn(s,Qn(o)),s}_createItems(t){const n=this._active,r=this.chart.data,i=[],a=[],o=[];let s=[],l,u;for(l=0,u=n.length;l<u;++l)s.push(cM(this.chart,n[l]));return t.filter&&(s=s.filter((c,d,f)=>t.filter(c,d,f,r))),t.itemSort&&(s=s.sort((c,d)=>t.itemSort(c,d,r))),He(s,c=>{const d=e0(t.callbacks,c);i.push(Ht(d,"labelColor",this,c)),a.push(Ht(d,"labelPointStyle",this,c)),o.push(Ht(d,"labelTextColor",this,c))}),this.labelColors=i,this.labelPointStyles=a,this.labelTextColors=o,this.dataPoints=s,s}update(t,n){const r=this.options.setContext(this.getContext()),i=this._active;let a,o=[];if(!i.length)this.opacity!==0&&(a={opacity:0});else{const s=ja[r.position].call(this,i,this._eventPosition);o=this._createItems(r),this.title=this.getTitle(o,r),this.beforeBody=this.getBeforeBody(o,r),this.body=this.getBody(o,r),this.afterBody=this.getAfterBody(o,r),this.footer=this.getFooter(o,r);const l=this._size=Jp(this,r),u=Object.assign({},s,l),c=Kp(this.chart,r,u),d=Qp(r,u,c,this.chart);this.xAlign=c.xAlign,this.yAlign=c.yAlign,a={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:s.x,caretY:s.y}}this._tooltipItems=o,this.$context=void 0,a&&this._resolveAnimations().update(this,a),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,i){const a=this.getCaretPosition(t,r,i);n.lineTo(a.x1,a.y1),n.lineTo(a.x2,a.y2),n.lineTo(a.x3,a.y3)}getCaretPosition(t,n,r){const{xAlign:i,yAlign:a}=this,{caretSize:o,cornerRadius:s}=r,{topLeft:l,topRight:u,bottomLeft:c,bottomRight:d}=na(s),{x:f,y:h}=t,{width:g,height:m}=n;let p,b,v,y,C,w;return a==="center"?(C=h+m/2,i==="left"?(p=f,b=p-o,y=C+o,w=C-o):(p=f+g,b=p+o,y=C-o,w=C+o),v=p):(i==="left"?b=f+Math.max(l,c)+o:i==="right"?b=f+g-Math.max(u,d)-o:b=this.caretX,a==="top"?(y=h,C=y-o,p=b-o,v=b+o):(y=h+m,C=y+o,p=b+o,v=b-o),w=y),{x1:p,x2:b,x3:v,y1:y,y2:C,y3:w}}drawTitle(t,n,r){const i=this.title,a=i.length;let o,s,l;if(a){const u=ra(r.rtl,this.x,this.width);for(t.x=Ts(this,r.titleAlign,r),n.textAlign=u.textAlign(r.titleAlign),n.textBaseline="middle",o=pt(r.titleFont),s=r.titleSpacing,n.fillStyle=r.titleColor,n.font=o.string,l=0;l<a;++l)n.fillText(i[l],u.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+s,l+1===a&&(t.y+=r.titleMarginBottom-s)}}_drawColorBox(t,n,r,i,a){const o=this.labelColors[r],s=this.labelPointStyles[r],{boxHeight:l,boxWidth:u}=a,c=pt(a.bodyFont),d=Ts(this,"left",a),f=i.x(d),h=l<c.lineHeight?(c.lineHeight-l)/2:0,g=n.y+h;if(a.usePointStyle){const m={radius:Math.min(u,l)/2,pointStyle:s.pointStyle,rotation:s.rotation,borderWidth:1},p=i.leftForLtr(f,u)+u/2,b=g+l/2;t.strokeStyle=a.multiKeyBackground,t.fillStyle=a.multiKeyBackground,$d(t,m,p,b),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,$d(t,m,p,b)}else{t.lineWidth=Re(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,t.strokeStyle=o.borderColor,t.setLineDash(o.borderDash||[]),t.lineDashOffset=o.borderDashOffset||0;const m=i.leftForLtr(f,u),p=i.leftForLtr(i.xPlus(f,1),u-2),b=na(o.borderRadius);Object.values(b).some(v=>v!==0)?(t.beginPath(),t.fillStyle=a.multiKeyBackground,zl(t,{x:m,y:g,w:u,h:l,radius:b}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),zl(t,{x:p,y:g+1,w:u-2,h:l-2,radius:b}),t.fill()):(t.fillStyle=a.multiKeyBackground,t.fillRect(m,g,u,l),t.strokeRect(m,g,u,l),t.fillStyle=o.backgroundColor,t.fillRect(p,g+1,u-2,l-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){const{body:i}=this,{bodySpacing:a,bodyAlign:o,displayColors:s,boxHeight:l,boxWidth:u,boxPadding:c}=r,d=pt(r.bodyFont);let f=d.lineHeight,h=0;const g=ra(r.rtl,this.x,this.width),m=function(D){n.fillText(D,g.x(t.x+h),t.y+f/2),t.y+=f+a},p=g.textAlign(o);let b,v,y,C,w,I,E;for(n.textAlign=o,n.textBaseline="middle",n.font=d.string,t.x=Ts(this,p,r),n.fillStyle=r.bodyColor,He(this.beforeBody,m),h=s&&p!=="right"?o==="center"?u/2+c:u+2+c:0,C=0,I=i.length;C<I;++C){for(b=i[C],v=this.labelTextColors[C],n.fillStyle=v,He(b.before,m),y=b.lines,s&&y.length&&(this._drawColorBox(n,t,C,g,r),f=Math.max(d.lineHeight,l)),w=0,E=y.length;w<E;++w)m(y[w]),f=d.lineHeight;He(b.after,m)}h=0,f=d.lineHeight,He(this.afterBody,m),t.y-=a}drawFooter(t,n,r){const i=this.footer,a=i.length;let o,s;if(a){const l=ra(r.rtl,this.x,this.width);for(t.x=Ts(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",o=pt(r.footerFont),n.fillStyle=r.footerColor,n.font=o.string,s=0;s<a;++s)n.fillText(i[s],l.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+r.footerSpacing}}drawBackground(t,n,r,i){const{xAlign:a,yAlign:o}=this,{x:s,y:l}=t,{width:u,height:c}=r,{topLeft:d,topRight:f,bottomLeft:h,bottomRight:g}=na(i.cornerRadius);n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.beginPath(),n.moveTo(s+d,l),o==="top"&&this.drawCaret(t,n,r,i),n.lineTo(s+u-f,l),n.quadraticCurveTo(s+u,l,s+u,l+f),o==="center"&&a==="right"&&this.drawCaret(t,n,r,i),n.lineTo(s+u,l+c-g),n.quadraticCurveTo(s+u,l+c,s+u-g,l+c),o==="bottom"&&this.drawCaret(t,n,r,i),n.lineTo(s+h,l+c),n.quadraticCurveTo(s,l+c,s,l+c-h),o==="center"&&a==="left"&&this.drawCaret(t,n,r,i),n.lineTo(s,l+d),n.quadraticCurveTo(s,l,s+d,l),n.closePath(),n.fill(),i.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,i=r&&r.x,a=r&&r.y;if(i||a){const o=ja[t.position].call(this,this._active,this._eventPosition);if(!o)return;const s=this._size=Jp(this,t),l=Object.assign({},o,this._size),u=Kp(n,t,l),c=Qp(t,l,u,n);(i._to!==c.x||a._to!==c.y)&&(this.xAlign=u.xAlign,this.yAlign=u.yAlign,this.width=s.width,this.height=s.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,c))}}_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},a={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const o=Ft(n.padding),s=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&s&&(t.save(),t.globalAlpha=r,this.drawBackground(a,t,i,n),q4(t,n.textDirection),a.y+=o.top,this.drawTitle(a,t,n),this.drawBody(a,t,n),this.drawFooter(a,t,n),e3(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,i=t.map(({datasetIndex:s,index:l})=>{const u=this.chart.getDatasetMeta(s);if(!u)throw new Error("Cannot find a dataset at index "+s);return{datasetIndex:s,element:u.data[l],index:l}}),a=!Ol(r,i),o=this._positionChanged(i,n);(a||o)&&(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,a=this._active||[],o=this._getActiveElements(t,a,n,r),s=this._positionChanged(o,t),l=n||!Ol(o,a)||s;return l&&(this._active=o,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,r,i){const a=this.options;if(t.type==="mouseout")return[];if(!i)return n.filter(s=>this.chart.data.datasets[s.datasetIndex]&&this.chart.getDatasetMeta(s.datasetIndex).controller.getParsed(s.index)!==void 0);const o=this.chart.getElementsAtEventForMode(t,a.mode,a,r);return a.reverse&&o.reverse(),o}_positionChanged(t,n){const{caretX:r,caretY:i,options:a}=this,o=ja[a.position].call(this,t,n);return o!==!1&&(r!==o.x||i!==o.y)}}ie(Pd,"positioners",ja);var bM={id:"tooltip",_element:Pd,positioners:ja,afterInit(e,t,n){n&&(e.tooltip=new Pd({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:b3},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"]};const vM=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function yM(e,t,n,r){const i=e.indexOf(t);if(i===-1)return vM(e,t,n,r);const a=e.lastIndexOf(t);return i!==a?n:i}const xM=(e,t)=>e===null?null:tn(Math.round(e),0,t);function t0(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class Td extends _i{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:a}of n)r[i]===a&&r.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(Ke(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:yM(r,t,Ce(n,t),this._addedLabels),xM(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 a=this.getLabels();a=t===0&&n===a.length-1?a:a.slice(t,n+1),this._valueRange=Math.max(a.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let o=t;o<=n;o++)i.push({value:o});return i}getLabelForValue(t){return t0.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}}ie(Td,"id","category"),ie(Td,"defaults",{ticks:{callback:t0}});function CM(e,t){const n=[],{bounds:i,step:a,min:o,max:s,precision:l,count:u,maxTicks:c,maxDigits:d,includeBounds:f}=e,h=a||1,g=c-1,{min:m,max:p}=t,b=!Ke(o),v=!Ke(s),y=!Ke(u),C=(p-m)/(d+1);let w=op((p-m)/g/h)*h,I,E,D,$;if(w<1e-14&&!b&&!v)return[{value:m},{value:p}];$=Math.ceil(p/w)-Math.floor(m/w),$>g&&(w=op($*w/g/h)*h),Ke(l)||(I=Math.pow(10,l),w=Math.ceil(w*I)/I),i==="ticks"?(E=Math.floor(m/w)*w,D=Math.ceil(p/w)*w):(E=m,D=p),b&&v&&a&&oP((s-o)/a,w/1e3)?($=Math.round(Math.min((s-o)/w,c)),w=(s-o)/$,E=o,D=s):y?(E=b?o:E,D=v?s:D,$=u-1,w=(D-E)/$):($=(D-E)/w,Ja($,Math.round($),w/1e3)?$=Math.round($):$=Math.ceil($));const F=Math.max(sp(w),sp(E));I=Math.pow(10,Ke(l)?F:l),E=Math.round(E*I)/I,D=Math.round(D*I)/I;let _=0;for(b&&(f&&E!==o?(n.push({value:o}),E<o&&_++,Ja(Math.round((E+_*w)*I)/I,o,n0(o,C,e))&&_++):E<o&&_++);_<$;++_){const P=Math.round((E+_*w)*I)/I;if(v&&P>s)break;n.push({value:P})}return v&&f&&D!==s?n.length&&Ja(n[n.length-1].value,s,n0(s,C,e))?n[n.length-1].value=s:n.push({value:s}):(!v||D===s)&&n.push({value:D}),n}function n0(e,t,{horizontal:n,minRotation:r}){const i=Nn(r),a=(n?Math.sin(i):Math.cos(i))||.001,o=.75*t*(""+e).length;return Math.min(t/a,o)}class Yl extends _i{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 Ke(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:a}=this;const o=l=>i=n?i:l,s=l=>a=r?a:l;if(t){const l=da(i),u=da(a);l<0&&u<0?s(0):l>0&&u>0&&o(0)}if(i===a){let l=a===0?1:Math.abs(a*.05);s(a+l),t||o(i-l)}this.min=i,this.max=a}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},a=this._range||this,o=CM(i,a);return t.bounds==="ticks"&&j4(o,this,"value"),t.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}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 Cu(t,this.chart.options.locale,this.options.ticks.format)}}class kd extends Yl{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=xt(t)?t:0,this.max=xt(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=Nn(this.options.ticks.minRotation),i=(t?Math.sin(r):Math.cos(r))||.001,a=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,a.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}}ie(kd,"id","linear"),ie(kd,"defaults",{ticks:{callback:wu.formatters.numeric}});const To=e=>Math.floor(_r(e)),Ur=(e,t)=>Math.pow(10,To(e)+t);function r0(e){return e/Math.pow(10,To(e))===1}function i0(e,t,n){const r=Math.pow(10,n),i=Math.floor(e/r);return Math.ceil(t/r)-i}function wM(e,t){const n=t-e;let r=To(n);for(;i0(e,t,r)>10;)r++;for(;i0(e,t,r)<10;)r--;return Math.min(r,To(e))}function DM(e,{min:t,max:n}){t=Qt(e.min,t);const r=[],i=To(t);let a=wM(t,n),o=a<0?Math.pow(10,Math.abs(a)):1;const s=Math.pow(10,a),l=i>a?Math.pow(10,i):0,u=Math.round((t-l)*o)/o,c=Math.floor((t-l)/s/10)*s*10;let d=Math.floor((u-c)/Math.pow(10,a)),f=Qt(e.min,Math.round((l+c+d*Math.pow(10,a))*o)/o);for(;f<n;)r.push({value:f,major:r0(f),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(a++,d=2,o=a>=0?1:o),f=Math.round((l+c+d*Math.pow(10,a))*o)/o;const h=Qt(e.max,f);return r.push({value:h,major:r0(h),significand:d}),r}class a0 extends _i{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const r=Yl.prototype.parse.apply(this,[t,n]);if(r===0){this._zero=!0;return}return xt(r)&&r>0?r:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=xt(t)?Math.max(0,t):null,this.max=xt(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!xt(this._userMin)&&(this.min=t===Ur(this.min,0)?Ur(this.min,-1):Ur(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let r=this.min,i=this.max;const a=s=>r=t?r:s,o=s=>i=n?i:s;r===i&&(r<=0?(a(1),o(10)):(a(Ur(r,-1)),o(Ur(i,1)))),r<=0&&a(Ur(i,-1)),i<=0&&o(Ur(r,1)),this.min=r,this.max=i}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},r=DM(n,this);return t.bounds==="ticks"&&j4(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":Cu(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=_r(t),this._valueRange=_r(this.max)-_r(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(_r(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}ie(a0,"id","logarithmic"),ie(a0,"defaults",{ticks:{callback:wu.formatters.logarithmic,major:{enabled:!0}}});function Md(e){const t=e.ticks;if(t.display&&e.display){const n=Ft(t.backdropPadding);return Ce(t.font&&t.font.size,ot.font.size)+n.height}return 0}function SM(e,t,n){return n=at(n)?n:[n],{w:SP(e,t.string,n),h:n.length*t.lineHeight}}function o0(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 IM(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=[],a=e._pointLabels.length,o=e.options.pointLabels,s=o.centerPointLabels?qe/a:0;for(let l=0;l<a;l++){const u=o.setContext(e.getPointLabelContext(l));i[l]=u.padding;const c=e.getPointPosition(l,e.drawingArea+i[l],s),d=pt(u.font),f=SM(e.ctx,d,e._pointLabels[l]);r[l]=f;const h=Cn(e.getIndexAngle(l)+s),g=Math.round(sh(h)),m=o0(g,c.x,f.w,0,180),p=o0(g,c.y,f.h,90,270);EM(n,t,h,m,p)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=RM(e,r,i)}function EM(e,t,n,r,i){const a=Math.abs(Math.sin(n)),o=Math.abs(Math.cos(n));let s=0,l=0;r.start<t.l?(s=(t.l-r.start)/a,e.l=Math.min(e.l,t.l-s)):r.end>t.r&&(s=(r.end-t.r)/a,e.r=Math.max(e.r,t.r+s)),i.start<t.t?(l=(t.t-i.start)/o,e.t=Math.min(e.t,t.t-l)):i.end>t.b&&(l=(i.end-t.b)/o,e.b=Math.max(e.b,t.b+l))}function _M(e,t,n){const r=e.drawingArea,{extra:i,additionalAngle:a,padding:o,size:s}=n,l=e.getPointPosition(t,r+i+o,a),u=Math.round(sh(Cn(l.angle+dt))),c=PM(l.y,s.h,u),d=AM(u),f=FM(l.x,s.w,d);return{visible:!0,x:l.x,y:c,textAlign:d,left:f,top:c,right:f+s.w,bottom:c+s.h}}function $M(e,t){if(!t)return!0;const{left:n,top:r,right:i,bottom:a}=e;return!(lr({x:n,y:r},t)||lr({x:n,y:a},t)||lr({x:i,y:r},t)||lr({x:i,y:a},t))}function RM(e,t,n){const r=[],i=e._pointLabels.length,a=e.options,{centerPointLabels:o,display:s}=a.pointLabels,l={extra:Md(a)/2,additionalAngle:o?qe/i:0};let u;for(let c=0;c<i;c++){l.padding=n[c],l.size=t[c];const d=_M(e,c,l);r.push(d),s==="auto"&&(d.visible=$M(d,u),d.visible&&(u=d))}return r}function AM(e){return e===0||e===180?"center":e<180?"left":"right"}function FM(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function PM(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function TM(e,t,n){const{left:r,top:i,right:a,bottom:o}=n,{backdropColor:s}=t;if(!Ke(s)){const l=na(t.borderRadius),u=Ft(t.backdropPadding);e.fillStyle=s;const c=r-u.left,d=i-u.top,f=a-r+u.width,h=o-i+u.height;Object.values(l).some(g=>g!==0)?(e.beginPath(),zl(e,{x:c,y:d,w:f,h,radius:l}),e.fill()):e.fillRect(c,d,f,h)}}function kM(e,t){const{ctx:n,options:{pointLabels:r}}=e;for(let i=t-1;i>=0;i--){const a=e._pointLabelItems[i];if(!a.visible)continue;const o=r.setContext(e.getPointLabelContext(i));TM(n,o,a);const s=pt(o.font),{x:l,y:u,textAlign:c}=a;Ci(n,e._pointLabels[i],l,u+s.lineHeight/2,s,{color:o.color,textAlign:c,textBaseline:"middle"})}}function v3(e,t,n,r){const{ctx:i}=e;if(n)i.arc(e.xCenter,e.yCenter,t,0,Qe);else{let a=e.getPointPosition(0,t);i.moveTo(a.x,a.y);for(let o=1;o<r;o++)a=e.getPointPosition(o,t),i.lineTo(a.x,a.y)}}function MM(e,t,n,r,i){const a=e.ctx,o=t.circular,{color:s,lineWidth:l}=t;!o&&!r||!s||!l||n<0||(a.save(),a.strokeStyle=s,a.lineWidth=l,a.setLineDash(i.dash),a.lineDashOffset=i.dashOffset,a.beginPath(),v3(e,n,o,r),a.closePath(),a.stroke(),a.restore())}function BM(e,t,n){return Lr(e,{label:n,index:t,type:"pointLabel"})}class ks extends Yl{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=Ft(Md(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=xt(t)&&!isNaN(t)?t:0,this.max=xt(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Md(this.options))}generateTickLabels(t){Yl.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,r)=>{const i=Ze(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?IM(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=Qe/(this._pointLabels.length||1),r=this.options.startAngle||0;return Cn(t*n+Nn(r))}getDistanceFromCenterForValue(t){if(Ke(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(Ke(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 BM(this.getContext(),t,r)}}getPointPosition(t,n,r=0){const i=this.getIndexAngle(t)-dt+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:a}=this._pointLabelItems[t];return{left:n,top:r,right:i,bottom:a}}drawBackground(){const{backgroundColor:t,grid:{circular:n}}=this.options;if(t){const r=this.ctx;r.save(),r.beginPath(),v3(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:a}=n,o=this._pointLabels.length;let s,l,u;if(n.pointLabels.display&&kM(this,o),i.display&&this.ticks.forEach((c,d)=>{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(c.value);const f=this.getContext(d),h=i.setContext(f),g=a.setContext(f);MM(this,h,l,o,g)}}),r.display){for(t.save(),s=o-1;s>=0;s--){const c=r.setContext(this.getPointLabelContext(s)),{color:d,lineWidth:f}=c;!f||!d||(t.lineWidth=f,t.strokeStyle=d,t.setLineDash(c.borderDash),t.lineDashOffset=c.borderDashOffset,l=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),u=this.getPointPosition(s,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(u.x,u.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 a,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(i),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((s,l)=>{if(l===0&&this.min>=0&&!n.reverse)return;const u=r.setContext(this.getContext(l)),c=pt(u.font);if(a=this.getDistanceFromCenterForValue(this.ticks[l].value),u.showLabelBackdrop){t.font=c.string,o=t.measureText(s.label).width,t.fillStyle=u.backdropColor;const d=Ft(u.backdropPadding);t.fillRect(-o/2-d.left,-a-c.size/2-d.top,o+d.width,c.size+d.height)}Ci(t,s.label,0,-a,c,{color:u.color,strokeColor:u.textStrokeColor,strokeWidth:u.textStrokeWidth})}),t.restore()}drawTitle(){}}ie(ks,"id","radialLinear"),ie(ks,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:wu.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),ie(ks,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),ie(ks,"descriptors",{angleLines:{_fallback:"grid"}});const Iu={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}},Wt=Object.keys(Iu);function s0(e,t){return e-t}function l0(e,t){if(Ke(t))return null;const n=e._adapter,{parser:r,round:i,isoWeekday:a}=e._parseOpts;let o=t;return typeof r=="function"&&(o=r(o)),xt(o)||(o=typeof r=="string"?n.parse(o,r):n.parse(o)),o===null?null:(i&&(o=i==="week"&&(Hl(a)||a===!0)?n.startOf(o,"isoWeek",a):n.startOf(o,i)),+o)}function u0(e,t,n,r){const i=Wt.length;for(let a=Wt.indexOf(e);a<i-1;++a){const o=Iu[Wt[a]],s=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((n-t)/(s*o.size))<=r)return Wt[a]}return Wt[i-1]}function VM(e,t,n,r,i){for(let a=Wt.length-1;a>=Wt.indexOf(n);a--){const o=Wt[a];if(Iu[o].common&&e._adapter.diff(i,r,o)>=t-1)return o}return Wt[n?Wt.indexOf(n):0]}function OM(e){for(let t=Wt.indexOf(e)+1,n=Wt.length;t<n;++t)if(Iu[Wt[t]].common)return Wt[t]}function c0(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:i}=lh(n,t),a=n[r]>=t?n[r]:n[i];e[a]=!0}}function NM(e,t,n,r){const i=e._adapter,a=+i.startOf(t[0].value,r),o=t[t.length-1].value;let s,l;for(s=a;s<=o;s=+i.add(s,1,r))l=n[s],l>=0&&(t[l].major=!0);return t}function d0(e,t,n){const r=[],i={},a=t.length;let o,s;for(o=0;o<a;++o)s=t[o],i[s]=o,r.push({value:s,major:!1});return a===0||!n?r:NM(e,r,i,n)}class Ul extends _i{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 PT._date(t.adapters.date);i.init(n),Ua(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:l0(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:a,minDefined:o,maxDefined:s}=this.getUserBounds();function l(u){!o&&!isNaN(u.min)&&(i=Math.min(i,u.min)),!s&&!isNaN(u.max)&&(a=Math.max(a,u.max))}(!o||!s)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),i=xt(i)&&!isNaN(i)?i:+n.startOf(Date.now(),r),a=xt(a)&&!isNaN(a)?a:+n.endOf(Date.now(),r)+1,this.min=Math.min(i,a-1),this.max=Math.max(i+1,a)}_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 a=this.min,o=this.max,s=cP(i,a,o);return this._unit=n.unit||(r.autoSkip?u0(n.minUnit,this.min,this.max,this._getLabelCapacity(a)):VM(this,s.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:OM(this._unit),this.initOffsets(i),t.reverse&&s.reverse(),d0(this,s,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,r=0,i,a;this.options.offset&&t.length&&(i=this.getDecimalForValue(t[0]),t.length===1?n=1-i:n=(this.getDecimalForValue(t[1])-i)/2,a=this.getDecimalForValue(t[t.length-1]),t.length===1?r=a:r=(a-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;n=tn(n,0,o),r=tn(r,0,o),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,a=i.time,o=a.unit||u0(a.minUnit,n,r,this._getLabelCapacity(n)),s=Ce(i.ticks.stepSize,1),l=o==="week"?a.isoWeekday:!1,u=Hl(l)||l===!0,c={};let d=n,f,h;if(u&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,u?"day":o),t.diff(r,n,o)>1e5*s)throw new Error(n+" and "+r+" are too far apart with stepSize of "+s+" "+o);const g=i.ticks.source==="data"&&this.getDataTimestamps();for(f=d,h=0;f<r;f=+t.add(f,s,o),h++)c0(c,f,g);return(f===r||i.bounds==="ticks"||h===1)&&c0(c,f,g),Object.keys(c).sort(s0).map(m=>+m)}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,a=this._unit,o=n||i[a];return this._adapter.format(t,o)}_tickFormatFunction(t,n,r,i){const a=this.options,o=a.ticks.callback;if(o)return Ze(o,[t,n,r],this);const s=a.time.displayFormats,l=this._unit,u=this._majorUnit,c=l&&s[l],d=u&&s[u],f=r[n],h=u&&d&&f&&f.major;return this._adapter.format(t,i||(h?d:c))}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=Nn(this.isHorizontal()?n.maxRotation:n.minRotation),a=Math.cos(i),o=Math.sin(i),s=this._resolveTickFontOptions(0).size;return{w:r*a+s*o,h:r*o+s*a}}_getLabelCapacity(t){const n=this.options.time,r=n.displayFormats,i=r[n.unit]||r.millisecond,a=this._tickFormatFunction(t,0,d0(this,[t],this._majorUnit),i),o=this._getLabelSize(a),s=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return s>0?s: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(l0(this,i[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return fP(t.sort(s0))}}ie(Ul,"id","time"),ie(Ul,"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 Ms(e,t,n){let r=0,i=e.length-1,a,o,s,l;n?(t>=e[r].pos&&t<=e[i].pos&&({lo:r,hi:i}=Ed(e,"pos",t)),{pos:a,time:s}=e[r],{pos:o,time:l}=e[i]):(t>=e[r].time&&t<=e[i].time&&({lo:r,hi:i}=Ed(e,"time",t)),{time:a,pos:s}=e[r],{time:o,pos:l}=e[i]);const u=o-a;return u?s+(l-s)*(t-a)/u:s}class f0 extends Ul{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=Ms(n,this.min),this._tableRange=Ms(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,i=[],a=[];let o,s,l,u,c;for(o=0,s=t.length;o<s;++o)u=t[o],u>=n&&u<=r&&i.push(u);if(i.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(o=0,s=i.length;o<s;++o)c=i[o+1],l=i[o-1],u=i[o],Math.round((c+l)/2)!==u&&a.push({time:u,pos:o/(s-1)});return a}_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,a)=>i-a)}_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(Ms(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return Ms(this._table,r*this._tableRange+this._minPos,!0)}}ie(f0,"id","timeseries"),ie(f0,"defaults",Ul.defaults);const y3="label";function h0(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function LM(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function x3(e,t){e.labels=t}function C3(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:y3;const r=[];e.datasets=t.map(i=>{const a=e.datasets.find(o=>o[n]===i[n]);return!a||!i.data||r.includes(a)?{...i}:(r.push(a),Object.assign(a,i),a)})}function jM(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:y3;const n={labels:[],datasets:[]};return x3(n,e.labels),C3(n,e.datasets,t),n}function HM(e,t){const{height:n=150,width:r=300,redraw:i=!1,datasetIdKey:a,type:o,data:s,options:l,plugins:u=[],fallbackContent:c,updateMode:d,...f}=e,h=x.useRef(null),g=x.useRef(),m=()=>{h.current&&(g.current=new Su(h.current,{type:o,data:jM(s,a),options:l&&{...l},plugins:u}),h0(t,g.current))},p=()=>{h0(t,null),g.current&&(g.current.destroy(),g.current=null)};return x.useEffect(()=>{!i&&g.current&&l&&LM(g.current,l)},[i,l]),x.useEffect(()=>{!i&&g.current&&x3(g.current.config.data,s.labels)},[i,s.labels]),x.useEffect(()=>{!i&&g.current&&s.datasets&&C3(g.current.config.data,s.datasets,a)},[i,s.datasets]),x.useEffect(()=>{g.current&&(i?(p(),setTimeout(m)):g.current.update(d))},[i,l,s.labels,s.datasets,d]),x.useEffect(()=>{g.current&&(p(),setTimeout(m))},[o]),x.useEffect(()=>(m(),()=>p()),[]),x.createElement("canvas",Object.assign({ref:h,role:"img",height:n,width:r},f),c)}const WM=x.forwardRef(HM);function zM(e,t){return Su.register(t),x.forwardRef((n,r)=>x.createElement(WM,Object.assign({},n,{ref:r,type:e})))}const g0=zM("doughnut",Va);Su.register(Td,kd,el,La,Na,uM,bM,sM);const m0=(e,t)=>{var i,a,o,s;const n=e.getVisibleDatasetCount(),r=e.getDatasetMeta(n-1).data.at(0);if(r){const{innerRadius:l}=r.getProps(["innerRadius"]),{ctx:u}=e,c=()=>{var _;const C=[].concat(t),w=C.length,I=u.font;let E=0,D=0,$;for($=0;$<w;++$)u.font=C[$].font,E=Math.max(u.measureText(C[$].text).width,E),D+=(_=C[$].font)==null?void 0:_.lineHeight;return u.font=I,{height:D,width:E}},d=(C,w)=>{let I=document.createElement("div");document.body.appendChild(I),I.style.fontSize=`${w}px`,I.style.position="absolute",I.style.left="-10",I.style.top="-10",I.textContent=C;const E={width:I.clientWidth,height:I.clientHeight};return document.body.removeChild(I),I=null,E},f=c(),h=parseFloat(parseFloat(l).toFixed(2));u.textAlign="center",u.textBaseline="middle";const g=(e.chartArea.left+e.chartArea.right)/2,p=(e.chartArea.top+e.chartArea.bottom)/2-f.height/2;let b;const v=t.length;let y=0;for(b=0;b<v;++b){let C=(i=t[b].font)==null?void 0:i.size,w=(a=t[b].font)==null?void 0:a.lineHeight;const I=typeof t[b].text=="number"?t[b].text.toString():t[b].text;for(;d(I,C).width>h+(t[b].id==="value"?50:0);)C-=1,w=d(I,C).height;I.length>22&&w<14&&(w=18);const E=p+w/2+y,D=typeof t[b].text=="number"?new Intl.NumberFormat("id-ID",{style:"currency",currency:"IDR"}).format(t[b].text):t[b].text;let $=t[b].urlIconDesc?" ":"";if(t[b].percentage!==void 0?$+=`${t[b].percentage}% ${t[b].text}`:$+=D,u.fillStyle=t[b].color,u.font=`${C<10?10:C}px sans-serif`,y+=w,t[b].percentage!==void 0&&t[b].urlIconDesc){const F=((s=(o=t[b])==null?void 0:o.percentage)==null?void 0:s.length)??0,_=new Image;_.src=t[b].urlIconDesc,u.drawImage(_,45-(F>6?F+2:F-2.5),E-8,16,14)}u.fillText($,g,E)}u.restore(),u.save()}},GM=({labels:e,data:t,backgroundColor:n,options:r={},redraw:i,widthInnerDoughnut:a,innerLabels:o,open:s=!0,keyRemoveDataOpen:l="gap",keyLabel:u="title",keyValue:c="originalValue",keyBackground:d="backgroundColor",className:f})=>{const h={labels:e||t.map(m=>m[u]),datasets:[{data:t.map(m=>m[c]),backgroundColor:n||t.map(m=>m[d])}]},g={cutout:a,animation:{duration:i?400:0},plugins:{legend:{display:!1},tooltip:{external(m){let p=document.getElementById("chartjs-tooltip");p||(p=document.createElement("div"),p.id="chartjs-tooltip",p.innerHTML="<table></table>",document.body.appendChild(p));const b=m.tooltip;if(b.opacity===0){p.style.opacity="0";return}p.classList.remove("above","below","no-transform"),b.yAlign?p.classList.add(b.yAlign):p.classList.add("no-transform");const v=t.filter(E=>!E[u]),y=t.filter(E=>E[c]>0&&E[c]<1);if(v.length===1&&y.length===1)return;function C(E){return E.lines}if(b.body){const E=b.title||[];let D=b.body.map(C),$="<thead>";E.forEach(_=>{let P="";P+="display: flex",P+="; justify-content: center",P+="; font-weight: 600",P+="; font-size: 14px",P+="; padding: 0px 14px",$+=`<tr><span style="${P}">${_}</span></tr>`}),$+="</thead><tbody>",D.length>1&&D[0][0]===D[1][0]&&(D=[D[0]]),D.forEach(_=>{let P="";P+="display: flex",P+="; justify-content: center",P+="; color: #0163C8",P+="; padding: 0px 14px",P+="; font-size: 14px";const k=`<span style="${P}">${_}</span>`;$+=`<tr><td>${k}</td></tr>`}),$+="</tbody>";const F=p.querySelector("table");F&&(F.innerHTML=$)}const w=m.chart.canvas.getBoundingClientRect(),I=w.top+window.pageYOffset+b.caretY;p.style.opacity="1",p.style.border="solid 1px #0163C8",p.style.background="white",p.style.height="fit-content",p.style.borderRadius="10px",p.style.position="absolute",p.style.zIndex="10",p.style.padding="4px 0",p.style.left=`${w.left+window.pageXOffset+b.caretX-80}px`,p.style.top=`${I>300&&!s?280:I}px`,p.style.pointerEvents="none"},displayColors:!0,enabled:!1,callbacks:{title(m){const p=t[m[0].dataIndex];return p==null?void 0:p[u]},label(m){const p=t==null?void 0:t[m.dataIndex];let b="Nilai: ";return p&&(b+=p.value),b}}}},elements:{arc:{borderWidth:0}}};return S.jsxs("div",{className:f??"",children:[!s&&S.jsx(g0,{data:h,redraw:i,plugins:[{id:"draw",beforeDraw(m){m0(m,o)}}],options:Object.keys(r).length>1?r:g}),s&&S.jsx(g0,{data:h,redraw:i,plugins:[{id:"draw",beforeDraw(m){m0(m,o.filter(p=>p.id!==l))}}],options:Object.keys(r).length>1?r:g})]})},Bs=e=>{let t;const n=new Date(e??new Date);return e&&(t=Nf(new Date(n.setHours(n.getHours()+7)).toISOString().slice(0,10))),t},ZM=({month:e,year:t,type:n=["month","year"],activeType:r="month",minDate:i,maxDate:a,className:o,classNameButton:s,onChange:l,buttonClick:u,id:c="date-picker",idPopover:d="date-picker-popover",floatingOptions:f={},offsetPopover:h=5,zIndexPopper:g=1})=>{const{locale:m}=Rn(),p=x.useRef(null),b=Bs(i),v=Bs(a),y=C=>{var w;typeof l=="function"&&(l({month:C.month,year:C.year}),(w=p.current)==null||w.setShow(!1))};return S.jsxs(S.Fragment,{children:[S.jsx("div",{id:c,onClick:C=>{var w;C.stopPropagation(),(w=p.current)==null||w.handlerShow(C)},className:s,children:typeof u=="function"?u({month:e,year:t}):"Pilih Tanggal"}),S.jsx("div",{className:o??"",children:S.jsx(wi,{zIndex:g,ref:p,offset:h,id:d,floatingOptions:{placement:"bottom-end",...f},onClick:C=>C.stopPropagation(),children:S.jsx(qf,{locale:"id-ID",children:S.jsx(vu,{minValue:b,maxValue:v,minDate:i,maxDate:a,activeType:n.length===1?n[0]:r,locale:m,value:Bs(`${t}/${e}/1`),createCalendar:Xo,defaultValue:Bs(`${t}/${e}/1`),onChange:y,handlerReset:()=>{},handlerSubmit:()=>{},withDateSelect:!1,type:n})})})})]})},XM=({indeterminate:e,className:t="",classNameContainer:n,...r})=>{const i=x.useRef(null);return x.useEffect(()=>{typeof e=="boolean"&&(i.current.indeterminate=!r.checked&&e)},[i,e]),S.jsx("div",{className:`1ru-flex 1ru-items-center 1ru-h-full ${t??""}`,children:S.jsx(yu,{ref:i,label:"",variants:"blue-700",borderRadius:"full",className:"1ru-flex 1ru-items-center 1ru-h-full",classNameContainer:`1ru-flex 1ru-items-center 1ru-h-full ${n??""}}`,...r,onClick:a=>{a.stopPropagation(),typeof r.onClick=="function"&&r.onClick(a)},type:"checkbox"})})},YM="_input_ezltz_7",UM="_error_ezltz_32",yn={"container-xs":"_container-xs_ezltz_1","container-input":"_container-input_ezltz_4",input:YM,error:UM,"isset-right-icon":"_isset-right-icon_ezltz_41","isset-left-icon":"_isset-left-icon_ezltz_45","start-icon":"_start-icon_ezltz_49","end-icon":"_end-icon_ezltz_52","label-error":"_label-error_ezltz_55","container-s":"_container-s_ezltz_61"},xh=x.forwardRef(({name:e,classNameContainer:t,id:n,type:r="text",startIcon:i,endIcon:a,error:o,sizeInput:s="xs",classNameLabelError:l,className:u,...c},d)=>{const f={size:{s:yn["container-s"],xs:yn["container-xs"]},variant:{}},h=()=>typeof i=="function"||x.isValidElement(i),g=()=>typeof a=="function"||x.isValidElement(a);return S.jsxs("div",{className:`${f.size[s]} ${t}`,children:[S.jsxs("div",{className:`${yn["container-input"]}`,children:[S.jsxs("div",{className:yn["start-icon"],children:[typeof i=="function"&&i(),x.isValidElement(i)&&i]}),S.jsx("input",{id:n??e,className:`${yn.input} ${o?yn.error:""}
|
175
175
|
${h()?yn["isset-left-icon"]:""}
|
176
176
|
${g()?yn["isset-right-icon"]:""}
|
177
177
|
${u??""}`,ref:d,type:r,...c}),S.jsxs("div",{className:yn["end-icon"],children:[typeof a=="function"&&a(),x.isValidElement(a)&&a]})]}),o&&S.jsx("label",{className:`${yn["label-error"]}
|
178
|
-
${c.disabled?yn.disabled:""} ${l??""}`,children:o})]})});xh.displayName="InputNative";const JM="_container_1szxn_1",KM="_files_1szxn_4",QM="_file_1szxn_4",Wi={container:JM,files:KM,file:QM,"file-name-wrapper":"_file-name-wrapper_1szxn_10","file-name":"_file-name_1szxn_10","file-extension":"_file-extension_1szxn_13"},qM=({value:e,validateFile:t,classNameContainer:n,classNameButton:r,textUpload:i="Unggah Lampiran",buttonProps:a={},maxFile:o=1,maxSize:s=1,error:l,removeElement:u,onChange:c,handlerDownload:d})=>{const f={variants:"ghost-laba-blue-10",size:"small"},h=x.useRef(null),g=t||["image/png","image/jpeg","image/jpg"],[m,p]=x.useState(""),b=C=>{if(C!=null&&C.length){const w=Array.from(C).slice(0,o),I=w==null?void 0:w.filter(D=>!g.includes(D.type)),E=(w==null?void 0:w.reduce((D,$)=>D+$.size,0))/1024/1024;if(I.length>0)p("Berkas tidak didukung, silahkan pilih file kembali.");else if(E>s){const D=`${C.length>1?"Jumlah u":"U"}kuran berkas tidak boleh melebihi ${s}MB.`;p(D)}else{if(!(h!=null&&h.current))return;typeof c=="function"&&c(w),p(""),h.current.value=""}}},v=C=>{var w;C.preventDefault(),h!=null&&h.current&&((w=h.current)==null||w.click())};function y(C){if(typeof C!="string")throw new Error("Input harus berupa string");const w=C.split(".");if(w.length===1)return{filename:C,extension:""};const I="."+w[w.length-1];return{filename:w.slice(0,-1).join("."),extension:I}}return S.jsxs("div",{className:`${Wi.container} ${n??""}`,children:[S.jsx(Hn,{...f,...a,className:r??"",onClick:C=>v(C),children:i}),S.jsx(xh,{accept:g==null?void 0:g.join(", "),ref:h,type:"file",onChange:C=>b(C.target.files),error:l??m,multiple:o>1,hidden:!0}),S.jsx("div",{className:Wi.files,children:e==null?void 0:e.map((C,w)=>S.jsxs("div",{className:Wi.file,onClick:I=>{I.stopPropagation(),typeof d=="function"&&d(C)},children:[S.jsxs("div",{className:Wi["file-name-wrapper"],children:[S.jsx("span",{className:Wi["file-name"],children:y((C==null?void 0:C.
|
178
|
+
${c.disabled?yn.disabled:""} ${l??""}`,children:o})]})});xh.displayName="InputNative";const JM="_container_1szxn_1",KM="_files_1szxn_4",QM="_file_1szxn_4",Wi={container:JM,files:KM,file:QM,"file-name-wrapper":"_file-name-wrapper_1szxn_10","file-name":"_file-name_1szxn_10","file-extension":"_file-extension_1szxn_13"},qM=({value:e,validateFile:t,classNameContainer:n,classNameButton:r,textUpload:i="Unggah Lampiran",buttonProps:a={},maxFile:o=1,maxSize:s=1,error:l,removeElement:u,onChange:c,handlerDownload:d})=>{const f={variants:"ghost-laba-blue-10",size:"small"},h=x.useRef(null),g=t||["image/png","image/jpeg","image/jpg"],[m,p]=x.useState(""),b=C=>{if(C!=null&&C.length){const w=Array.from(C).slice(0,o),I=w==null?void 0:w.filter(D=>!g.includes(D.type)),E=(w==null?void 0:w.reduce((D,$)=>D+$.size,0))/1024/1024;if(I.length>0)p("Berkas tidak didukung, silahkan pilih file kembali.");else if(E>s){const D=`${C.length>1?"Jumlah u":"U"}kuran berkas tidak boleh melebihi ${s}MB.`;p(D)}else{if(!(h!=null&&h.current))return;typeof c=="function"&&c(w),p(""),h.current.value=""}}},v=C=>{var w;C.preventDefault(),h!=null&&h.current&&((w=h.current)==null||w.click())};function y(C){if(typeof C!="string")throw new Error("Input harus berupa string");const w=C.split(".");if(w.length===1)return{filename:C,extension:""};const I="."+w[w.length-1];return{filename:w.slice(0,-1).join("."),extension:I}}return S.jsxs("div",{className:`${Wi.container} ${n??""}`,children:[S.jsx(Hn,{...f,...a,className:r??"",onClick:C=>v(C),children:i}),S.jsx(xh,{accept:g==null?void 0:g.join(", "),ref:h,type:"file",onChange:C=>b(C.target.files),error:l??m,multiple:o>1,hidden:!0}),S.jsx("div",{className:Wi.files,children:e==null?void 0:e.map((C,w)=>S.jsxs("div",{className:Wi.file,onClick:I=>{I.stopPropagation(),typeof d=="function"&&d(C)},children:[S.jsxs("div",{className:Wi["file-name-wrapper"],children:[S.jsx("span",{className:Wi["file-name"],children:y((C==null?void 0:C.originalName)??(C==null?void 0:C.name)??(C==null?void 0:C.fileName)??"").filename}),S.jsx("span",{className:Wi["file-extension"],children:y((C==null?void 0:C.originalName)??(C==null?void 0:C.name)??(C==null?void 0:C.fileName)??"").extension})]}),typeof u=="function"&&S.jsx(S.Fragment,{children:u(C)})]},w))})]})},p0={"error-payhere":"_error-payhere_1hkqz_1","error-laba":"_error-laba_1hkqz_5"},eB=({className:e,variants:t="laba",error:n})=>{const r={variants:{laba:p0["error-laba"],payhere:p0["error-payhere"]}};return S.jsx(S.Fragment,{children:n?S.jsx("span",{className:`${r.variants[t]} ${e??""}`,children:n}):S.jsx(S.Fragment,{})})},tB="_container_5yc5a_1",nB="_textarea_5yc5a_7",rB="_label_5yc5a_36",iB="_error_5yc5a_44",Jn={container:tB,"size-medium":"_size-medium_5yc5a_1","container-textarea":"_container-textarea_5yc5a_4",textarea:nB,"placeholder-shown":"_placeholder-shown_5yc5a_24",label:rB,error:iB,"label-error":"_label-error_5yc5a_60"},w3=x.forwardRef((e,t)=>{const{isRequired:n,classNameContainer:r,className:i,classNameLabel:a,classNameLabelError:o,name:s,id:l,label:u,error:c,height:d,minHeight:f=94,maxHeight:h=150,style:g,sizeInput:m="medium",translateLabel:p=20,autoTranslateLabel:b=!1,...v}=e,y=x.useRef(null),C=pf(y,t),w=x.useRef(null),I={...g??{},maxHeight:h,height:d??f,minHeight:f},[E,D]=x.useState(!1),[$,F]=x.useState(!1),[_,P]=x.useState(p),k={size:{medium:Jn["size-medium"]}},A=()=>{var V;v.value===""||((V=y.current)==null?void 0:V.value)===""?(F(!1),b&&setTimeout(()=>{var O,W;const H=((O=y.current)==null?void 0:O.offsetHeight)??0,L=((W=w.current)==null?void 0:W.offsetHeight)??0,Z=(H-L)/2;P(Z)},100)):F(!0)},B=function(V){var H;D(!0),A(),(H=e.onFocus)==null||H.call(e,V)},T=function(V){var H;D(!1),(H=e.onBlur)==null||H.call(e,V)},R=function(V){A();const H=(V==null?void 0:V.target)??y.current;H.style.height="0px",H.style.height=H.scrollHeight+"px"};return mf(()=>(E&&y.current?y.current.addEventListener("input",R):R(),()=>{var V;(V=y.current)==null||V.removeEventListener("input",R)}),[E]),S.jsxs("div",{className:`${Jn.container}
|
179
179
|
${k.size[m]}
|
180
180
|
${r??""}`,children:[S.jsxs("div",{className:`${Jn["container-textarea"]}`,children:[S.jsx("textarea",{id:l??s,className:`${$?"":Jn["placeholder-shown"]} ${c?Jn.error:""}
|
181
181
|
${Jn.textarea}
|