diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 23b4979..2c80220 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -18,10 +18,15 @@ import { MDBSelect, } from "mdb-react-ui-kit"; +// const CASE_1 = "Case 1: Θ(nlogb(a))"; +// const CASE_2 = "Case 2: Θ(nk log n)"; +const CASE_3 = "Case 3: Θ(nk)"; + interface ResultType { complexity: string; case: string; recurrence_relation: string; + regularity_condition_met?: boolean; plot_data: { n: number[]; n_log_b_a: number[]; @@ -338,6 +343,14 @@ function App() { + {result.case.includes(CASE_3) && ( // Check if the case includes the string for Case 3 + + Regularity Condition Met:{" "} + {result.regularity_condition_met !== undefined && // Check if regularity_condition_met is defined + (result.regularity_condition_met ? "Yes" : "No")} + + )} + Time Complexity: logb(a) {" "} - (and also fulfills the regularity condition*) : + (and must also fulfill the{" "} + + regularity condition + *) + {" "} + :

@@ -557,14 +575,8 @@ function App() {

- * Please note that this app evaluates n - - logb(a) - - and f(nk) using their exponents and does not assess - the regularity condition in Case 3, or whether the difference - in growth between these two functions is polynomial. The - regularity condition ensures that the work done at the + * + The regularity condition ensures that the work done at the recursive levels does not grow too quickly compared to the work done to divide the problem and combine the results. This condition helps maintain the integrity of the complexity diff --git a/mastertheorem/tests/test_master_theorem.py b/mastertheorem/tests/test_master_theorem.py index 8e44bea..0504e99 100644 --- a/mastertheorem/tests/test_master_theorem.py +++ b/mastertheorem/tests/test_master_theorem.py @@ -107,12 +107,12 @@ def test_recurrence_relation_output(a: int, b: int, k: int, expected_recurrence_ assert recurrence_relation == expected_recurrence_relation, f"Recurrence relation does not expected output for parameters a={a}, b={b}, k={k}" @pytest.mark.parametrize("a,b,k,expected_regularity", [ - (4, 2, 3, True), # Regular condition met - (10, 2, 3, False), # Regular condition not met - (8, 2, 3, False), # Case 3 but does not satisfy the regularity condition. - (9, 2, 3, False), # Just over the edge, regularity condition not met + (4, 2, 3, True), # Case 3, Regularity condition met. + (10, 2, 3, False), # Case 1, regularity condition not applicable. + (8, 2, 3, False), # Case 2, regularity condition not applicable. + (9, 2, 3, False), # Case 1, regularity condition not applicable. (2, 2, 1, False), # Case 2, regularity condition not applicable. - (1000, 10, 3, False), # Large numbers, regularity condition not met + (1000, 10, 3, False), # Case 3 with large values, testing the function's ability to correctly evaluate the regularity condition despite the significant value of 'a'. Regularity condition not met, demonstrating the function's robustness in handling extreme or non-intuitive scenarios within Case 3's criteria. ]) def test_regularity_condition(a: int, b: int, k: int, expected_regularity: bool): _, _, _, regularity_condition_met = evaluate_master_theorem(a, b, k) diff --git a/static/assets/index-HE6f1_nl.js b/static/assets/index-C14P8ZTk.js similarity index 88% rename from static/assets/index-HE6f1_nl.js rename to static/assets/index-C14P8ZTk.js index a1417ae..21bbe8f 100644 --- a/static/assets/index-HE6f1_nl.js +++ b/static/assets/index-C14P8ZTk.js @@ -6,7 +6,7 @@ var FT=Object.defineProperty;var BT=(e,t,n)=>t in e?FT(e,t,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var oc=Symbol.for("react.element"),VT=Symbol.for("react.portal"),zT=Symbol.for("react.fragment"),WT=Symbol.for("react.strict_mode"),HT=Symbol.for("react.profiler"),UT=Symbol.for("react.provider"),YT=Symbol.for("react.context"),XT=Symbol.for("react.forward_ref"),KT=Symbol.for("react.suspense"),GT=Symbol.for("react.memo"),qT=Symbol.for("react.lazy"),L0=Symbol.iterator;function QT(e){return e===null||typeof e!="object"?null:(e=L0&&e[L0]||e["@@iterator"],typeof e=="function"?e:null)}var xw={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},bw=Object.assign,_w={};function ia(e,t,n){this.props=e,this.context=t,this.refs=_w,this.updater=n||xw}ia.prototype.isReactComponent={};ia.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};ia.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function ww(){}ww.prototype=ia.prototype;function cg(e,t,n){this.props=e,this.context=t,this.refs=_w,this.updater=n||xw}var ug=cg.prototype=new ww;ug.constructor=cg;bw(ug,ia.prototype);ug.isPureReactComponent=!0;var R0=Array.isArray,kw=Object.prototype.hasOwnProperty,dg={current:null},Sw={key:!0,ref:!0,__self:!0,__source:!0};function Mw(e,t,n){var i,s={},r=null,o=null;if(t!=null)for(i in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(r=""+t.key),t)kw.call(t,i)&&!Sw.hasOwnProperty(i)&&(s[i]=t[i]);var a=arguments.length-2;if(a===1)s.children=n;else if(1t in e?FT(e,t,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */(function(e){function t(D,$){var F=D.length;D.push($);t:for(;0>>1,W=D[V];if(0>>1;Vs(O,F))Us(lt,O)?(D[V]=lt,D[U]=F,V=U):(D[V]=O,D[Z]=F,V=Z);else if(Us(lt,F))D[V]=lt,D[U]=F,V=U;else break t}}return $}function s(D,$){var F=D.sortIndex-$.sortIndex;return F!==0?F:D.id-$.id}if(typeof performance=="object"&&typeof performance.now=="function"){var r=performance;e.unstable_now=function(){return r.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var l=[],c=[],u=1,d=null,h=3,f=!1,p=!1,m=!1,v=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(D){for(var $=n(c);$!==null;){if($.callback===null)i(c);else if($.startTime<=D)i(c),$.sortIndex=$.expirationTime,t(l,$);else break;$=n(c)}}function _(D){if(m=!1,x(D),!p)if(n(l)!==null)p=!0,R(w);else{var $=n(c);$!==null&&B(_,$.startTime-D)}}function w(D,$){p=!1,m&&(m=!1,y(M),M=-1),f=!0;var F=h;try{for(x($),d=n(l);d!==null&&(!(d.expirationTime>$)||D&&!A());){var V=d.callback;if(typeof V=="function"){d.callback=null,h=d.priorityLevel;var W=V(d.expirationTime<=$);$=e.unstable_now(),typeof W=="function"?d.callback=W:d===n(l)&&i(l),x($)}else i(l);d=n(l)}if(d!==null)var et=!0;else{var Z=n(c);Z!==null&&B(_,Z.startTime-$),et=!1}return et}finally{d=null,h=F,f=!1}}var S=!1,C=null,M=-1,P=5,T=-1;function A(){return!(e.unstable_now()-TD||125V?(D.sortIndex=F,t(c,D),n(l)===null&&D===n(c)&&(m?(y(M),M=-1):m=!0,B(_,F-V))):(D.sortIndex=W,t(l,D),p||f||(p=!0,R(w))),D},e.unstable_shouldYield=A,e.unstable_wrapCallback=function(D){var $=h;return function(){var F=h;h=$;try{return D.apply(this,arguments)}finally{h=F}}}})(Dw);Tw.exports=Dw;var lD=Tw.exports;/** + */(function(e){function t(D,$){var F=D.length;D.push($);t:for(;0>>1,W=D[V];if(0>>1;Vs(O,F))Us(lt,O)?(D[V]=lt,D[U]=F,V=U):(D[V]=O,D[Z]=F,V=Z);else if(Us(lt,F))D[V]=lt,D[U]=F,V=U;else break t}}return $}function s(D,$){var F=D.sortIndex-$.sortIndex;return F!==0?F:D.id-$.id}if(typeof performance=="object"&&typeof performance.now=="function"){var r=performance;e.unstable_now=function(){return r.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var l=[],c=[],u=1,d=null,h=3,f=!1,p=!1,m=!1,v=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(D){for(var $=n(c);$!==null;){if($.callback===null)i(c);else if($.startTime<=D)i(c),$.sortIndex=$.expirationTime,t(l,$);else break;$=n(c)}}function _(D){if(m=!1,x(D),!p)if(n(l)!==null)p=!0,L(w);else{var $=n(c);$!==null&&B(_,$.startTime-D)}}function w(D,$){p=!1,m&&(m=!1,y(M),M=-1),f=!0;var F=h;try{for(x($),d=n(l);d!==null&&(!(d.expirationTime>$)||D&&!A());){var V=d.callback;if(typeof V=="function"){d.callback=null,h=d.priorityLevel;var W=V(d.expirationTime<=$);$=e.unstable_now(),typeof W=="function"?d.callback=W:d===n(l)&&i(l),x($)}else i(l);d=n(l)}if(d!==null)var et=!0;else{var Z=n(c);Z!==null&&B(_,Z.startTime-$),et=!1}return et}finally{d=null,h=F,f=!1}}var S=!1,C=null,M=-1,P=5,T=-1;function A(){return!(e.unstable_now()-TD||125V?(D.sortIndex=F,t(c,D),n(l)===null&&D===n(c)&&(m?(y(M),M=-1):m=!0,B(_,F-V))):(D.sortIndex=W,t(l,D),p||f||(p=!0,L(w))),D},e.unstable_shouldYield=A,e.unstable_wrapCallback=function(D){var $=h;return function(){var F=h;h=$;try{return D.apply(this,arguments)}finally{h=F}}}})(Dw);Tw.exports=Dw;var lD=Tw.exports;/** * @license React * react-dom.production.min.js * @@ -30,31 +30,31 @@ var FT=Object.defineProperty;var BT=(e,t,n)=>t in e?FT(e,t,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Ew=k,_n=lD;function H(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Mp=Object.prototype.hasOwnProperty,cD=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,j0={},$0={};function uD(e){return Mp.call($0,e)?!0:Mp.call(j0,e)?!1:cD.test(e)?$0[e]=!0:(j0[e]=!0,!1)}function dD(e,t,n,i){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return i?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function hD(e,t,n,i){if(t===null||typeof t>"u"||dD(e,t,n,i))return!0;if(i)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Xe(e,t,n,i,s,r,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=i,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=r,this.removeEmptyString=o}var Ee={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ee[e]=new Xe(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ee[t]=new Xe(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ee[e]=new Xe(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ee[e]=new Xe(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Ee[e]=new Xe(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ee[e]=new Xe(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ee[e]=new Xe(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ee[e]=new Xe(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ee[e]=new Xe(e,5,!1,e.toLowerCase(),null,!1,!1)});var fg=/[\-:]([a-z])/g;function pg(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(fg,pg);Ee[t]=new Xe(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(fg,pg);Ee[t]=new Xe(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(fg,pg);Ee[t]=new Xe(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ee[e]=new Xe(e,1,!1,e.toLowerCase(),null,!1,!1)});Ee.xlinkHref=new Xe("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ee[e]=new Xe(e,1,!1,e.toLowerCase(),null,!0,!0)});function mg(e,t,n,i){var s=Ee.hasOwnProperty(t)?Ee[t]:null;(s!==null?s.type!==0:i||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Mp=Object.prototype.hasOwnProperty,cD=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,j0={},$0={};function uD(e){return Mp.call($0,e)?!0:Mp.call(j0,e)?!1:cD.test(e)?$0[e]=!0:(j0[e]=!0,!1)}function dD(e,t,n,i){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return i?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function hD(e,t,n,i){if(t===null||typeof t>"u"||dD(e,t,n,i))return!0;if(i)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Xe(e,t,n,i,s,r,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=i,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=r,this.removeEmptyString=o}var Ee={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ee[e]=new Xe(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ee[t]=new Xe(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ee[e]=new Xe(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ee[e]=new Xe(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Ee[e]=new Xe(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ee[e]=new Xe(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ee[e]=new Xe(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ee[e]=new Xe(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ee[e]=new Xe(e,5,!1,e.toLowerCase(),null,!1,!1)});var fg=/[\-:]([a-z])/g;function pg(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(fg,pg);Ee[t]=new Xe(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(fg,pg);Ee[t]=new Xe(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(fg,pg);Ee[t]=new Xe(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ee[e]=new Xe(e,1,!1,e.toLowerCase(),null,!1,!1)});Ee.xlinkHref=new Xe("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ee[e]=new Xe(e,1,!1,e.toLowerCase(),null,!0,!0)});function mg(e,t,n,i){var s=Ee.hasOwnProperty(t)?Ee[t]:null;(s!==null?s.type!==0:i||!(2a||s[o]!==r[a]){var l=` -`+s[o].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=o&&0<=a);break}}}finally{cf=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ha(e):""}function fD(e){switch(e.tag){case 5:return Ha(e.type);case 16:return Ha("Lazy");case 13:return Ha("Suspense");case 19:return Ha("SuspenseList");case 0:case 2:case 15:return e=uf(e.type,!1),e;case 11:return e=uf(e.type.render,!1),e;case 1:return e=uf(e.type,!0),e;default:return""}}function Dp(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case co:return"Fragment";case lo:return"Portal";case Cp:return"Profiler";case gg:return"StrictMode";case Pp:return"Suspense";case Tp:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Lw:return(e.displayName||"Context")+".Consumer";case Ow:return(e._context.displayName||"Context")+".Provider";case yg:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case vg:return t=e.displayName||null,t!==null?t:Dp(e.type)||"Memo";case ms:t=e._payload,e=e._init;try{return Dp(e(t))}catch{}}return null}function pD(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Dp(t);case 8:return t===gg?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Bs(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Nw(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function mD(e){var t=Nw(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),i=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,r=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(o){i=""+o,r.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(o){i=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Lc(e){e._valueTracker||(e._valueTracker=mD(e))}function jw(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),i="";return e&&(i=Nw(e)?e.checked?"true":"false":e.value),e=i,e!==n?(t.setValue(e),!0):!1}function cd(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Ep(e,t){var n=t.checked;return se({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function F0(e,t){var n=t.defaultValue==null?"":t.defaultValue,i=t.checked!=null?t.checked:t.defaultChecked;n=Bs(t.value!=null?t.value:n),e._wrapperState={initialChecked:i,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function $w(e,t){t=t.checked,t!=null&&mg(e,"checked",t,!1)}function Ap(e,t){$w(e,t);var n=Bs(t.value),i=t.type;if(n!=null)i==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(i==="submit"||i==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Op(e,t.type,n):t.hasOwnProperty("defaultValue")&&Op(e,t.type,Bs(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function B0(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var i=t.type;if(!(i!=="submit"&&i!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Op(e,t,n){(t!=="number"||cd(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ua=Array.isArray;function Co(e,t,n,i){if(e=e.options,t){t={};for(var s=0;s"+t.valueOf().toString()+"",t=Rc.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Cl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var el={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},gD=["Webkit","ms","Moz","O"];Object.keys(el).forEach(function(e){gD.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),el[t]=el[e]})});function Vw(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||el.hasOwnProperty(e)&&el[e]?(""+t).trim():t+"px"}function zw(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var i=n.indexOf("--")===0,s=Vw(n,t[n],i);n==="float"&&(n="cssFloat"),i?e.setProperty(n,s):e[n]=s}}var yD=se({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Np(e,t){if(t){if(yD[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(H(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(H(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(H(61))}if(t.style!=null&&typeof t.style!="object")throw Error(H(62))}}function jp(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var $p=null;function xg(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ip=null,Po=null,To=null;function W0(e){if(e=cc(e)){if(typeof Ip!="function")throw Error(H(280));var t=e.stateNode;t&&(t=ph(t),Ip(e.stateNode,e.type,t))}}function Ww(e){Po?To?To.push(e):To=[e]:Po=e}function Hw(){if(Po){var e=Po,t=To;if(To=Po=null,W0(e),t)for(e=0;e>>=0,e===0?32:31-(TD(e)/DD|0)|0}var Nc=64,jc=4194304;function Ya(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function fd(e,t){var n=e.pendingLanes;if(n===0)return 0;var i=0,s=e.suspendedLanes,r=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~s;a!==0?i=Ya(a):(r&=o,r!==0&&(i=Ya(r)))}else o=n&~s,o!==0?i=Ya(o):r!==0&&(i=Ya(r));if(i===0)return 0;if(t!==0&&t!==i&&!(t&s)&&(s=i&-i,r=t&-t,s>=r||s===16&&(r&4194240)!==0))return t;if(i&4&&(i|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=i;0n;n++)t.push(e);return t}function ac(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ei(t),e[t]=n}function LD(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var i=e.eventTimes;for(e=e.expirationTimes;0=il),Z0=" ",J0=!1;function uk(e,t){switch(e){case"keyup":return aE.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function dk(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var uo=!1;function cE(e,t){switch(e){case"compositionend":return dk(t);case"keypress":return t.which!==32?null:(J0=!0,Z0);case"textInput":return e=t.data,e===Z0&&J0?null:e;default:return null}}function uE(e,t){if(uo)return e==="compositionend"||!Pg&&uk(e,t)?(e=lk(),zu=Sg=_s=null,uo=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=i}t:{for(;n;){if(n.nextSibling){n=n.nextSibling;break t}n=n.parentNode}n=void 0}n=iv(n)}}function mk(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?mk(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function gk(){for(var e=window,t=cd();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=cd(e.document)}return t}function Tg(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function xE(e){var t=gk(),n=e.focusedElem,i=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&mk(n.ownerDocument.documentElement,n)){if(i!==null&&Tg(n)){if(t=i.start,e=i.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=n.textContent.length,r=Math.min(i.start,s);i=i.end===void 0?r:Math.min(i.end,s),!e.extend&&r>i&&(s=i,i=r,r=s),s=sv(n,r);var o=sv(n,i);s&&o&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),r>i?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,ho=null,Hp=null,rl=null,Up=!1;function rv(e,t,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Up||ho==null||ho!==cd(i)||(i=ho,"selectionStart"in i&&Tg(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),rl&&Ol(rl,i)||(rl=i,i=gd(Hp,"onSelect"),0mo||(e.current=Qp[mo],Qp[mo]=null,mo--)}function Bt(e,t){mo++,Qp[mo]=e.current,e.current=t}var Vs={},Ve=Gs(Vs),rn=Gs(!1),Lr=Vs;function $o(e,t){var n=e.type.contextTypes;if(!n)return Vs;var i=e.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===t)return i.__reactInternalMemoizedMaskedChildContext;var s={},r;for(r in n)s[r]=t[r];return i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function on(e){return e=e.childContextTypes,e!=null}function vd(){Yt(rn),Yt(Ve)}function hv(e,t,n){if(Ve.current!==Vs)throw Error(H(168));Bt(Ve,t),Bt(rn,n)}function Mk(e,t,n){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!="function")return n;i=i.getChildContext();for(var s in i)if(!(s in t))throw Error(H(108,pD(e)||"Unknown",s));return se({},n,i)}function xd(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Vs,Lr=Ve.current,Bt(Ve,e),Bt(rn,rn.current),!0}function fv(e,t,n){var i=e.stateNode;if(!i)throw Error(H(169));n?(e=Mk(e,t,Lr),i.__reactInternalMemoizedMergedChildContext=e,Yt(rn),Yt(Ve),Bt(Ve,e)):Yt(rn),Bt(rn,n)}var ji=null,mh=!1,Sf=!1;function Ck(e){ji===null?ji=[e]:ji.push(e)}function AE(e){mh=!0,Ck(e)}function qs(){if(!Sf&&ji!==null){Sf=!0;var e=0,t=Ot;try{var n=ji;for(Ot=1;e>=o,s-=o,Fi=1<<32-ei(t)+s|n<M?(P=C,C=null):P=C.sibling;var T=h(y,C,x[M],_);if(T===null){C===null&&(C=P);break}e&&C&&T.alternate===null&&t(y,C),g=r(T,g,M),S===null?w=T:S.sibling=T,S=T,C=P}if(M===x.length)return n(y,C),Gt&&dr(y,M),w;if(C===null){for(;MM?(P=C,C=null):P=C.sibling;var A=h(y,C,T.value,_);if(A===null){C===null&&(C=P);break}e&&C&&A.alternate===null&&t(y,C),g=r(A,g,M),S===null?w=A:S.sibling=A,S=A,C=P}if(T.done)return n(y,C),Gt&&dr(y,M),w;if(C===null){for(;!T.done;M++,T=x.next())T=d(y,T.value,_),T!==null&&(g=r(T,g,M),S===null?w=T:S.sibling=T,S=T);return Gt&&dr(y,M),w}for(C=i(y,C);!T.done;M++,T=x.next())T=f(C,y,M,T.value,_),T!==null&&(e&&T.alternate!==null&&C.delete(T.key===null?M:T.key),g=r(T,g,M),S===null?w=T:S.sibling=T,S=T);return e&&C.forEach(function(E){return t(y,E)}),Gt&&dr(y,M),w}function v(y,g,x,_){if(typeof x=="object"&&x!==null&&x.type===co&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Oc:t:{for(var w=x.key,S=g;S!==null;){if(S.key===w){if(w=x.type,w===co){if(S.tag===7){n(y,S.sibling),g=s(S,x.props.children),g.return=y,y=g;break t}}else if(S.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===ms&&bv(w)===S.type){n(y,S.sibling),g=s(S,x.props),g.ref=ga(y,S,x),g.return=y,y=g;break t}n(y,S);break}else t(y,S);S=S.sibling}x.type===co?(g=Mr(x.props.children,y.mode,_,x.key),g.return=y,y=g):(_=qu(x.type,x.key,x.props,null,y.mode,_),_.ref=ga(y,g,x),_.return=y,y=_)}return o(y);case lo:t:{for(S=x.key;g!==null;){if(g.key===S)if(g.tag===4&&g.stateNode.containerInfo===x.containerInfo&&g.stateNode.implementation===x.implementation){n(y,g.sibling),g=s(g,x.children||[]),g.return=y,y=g;break t}else{n(y,g);break}else t(y,g);g=g.sibling}g=Of(x,y.mode,_),g.return=y,y=g}return o(y);case ms:return S=x._init,v(y,g,S(x._payload),_)}if(Ua(x))return p(y,g,x,_);if(da(x))return m(y,g,x,_);Wc(y,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,g!==null&&g.tag===6?(n(y,g.sibling),g=s(g,x),g.return=y,y=g):(n(y,g),g=Af(x,y.mode,_),g.return=y,y=g),o(y)):n(y,g)}return v}var Fo=Rk(!0),Nk=Rk(!1),uc={},yi=Gs(uc),jl=Gs(uc),$l=Gs(uc);function wr(e){if(e===uc)throw Error(H(174));return e}function $g(e,t){switch(Bt($l,t),Bt(jl,e),Bt(yi,uc),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Rp(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Rp(t,e)}Yt(yi),Bt(yi,t)}function Bo(){Yt(yi),Yt(jl),Yt($l)}function jk(e){wr($l.current);var t=wr(yi.current),n=Rp(t,e.type);t!==n&&(Bt(jl,e),Bt(yi,n))}function Ig(e){jl.current===e&&(Yt(yi),Yt(jl))}var te=Gs(0);function Md(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Mf=[];function Fg(){for(var e=0;en?n:4,e(!0);var i=Cf.transition;Cf.transition={};try{e(!1),t()}finally{Ot=n,Cf.transition=i}}function Zk(){return Vn().memoizedState}function NE(e,t,n){var i=Ns(e);if(n={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null},Jk(e))tS(t,n);else if(n=Ek(e,t,n,i),n!==null){var s=Ue();ni(n,e,i,s),eS(n,t,i)}}function jE(e,t,n){var i=Ns(e),s={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null};if(Jk(e))tS(t,s);else{var r=e.alternate;if(e.lanes===0&&(r===null||r.lanes===0)&&(r=t.lastRenderedReducer,r!==null))try{var o=t.lastRenderedState,a=r(o,n);if(s.hasEagerState=!0,s.eagerState=a,ii(a,o)){var l=t.interleaved;l===null?(s.next=s,Ng(t)):(s.next=l.next,l.next=s),t.interleaved=s;return}}catch{}finally{}n=Ek(e,t,s,i),n!==null&&(s=Ue(),ni(n,e,i,s),eS(n,t,i))}}function Jk(e){var t=e.alternate;return e===ie||t!==null&&t===ie}function tS(e,t){ol=Cd=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function eS(e,t,n){if(n&4194240){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,_g(e,n)}}var Pd={readContext:Bn,useCallback:Le,useContext:Le,useEffect:Le,useImperativeHandle:Le,useInsertionEffect:Le,useLayoutEffect:Le,useMemo:Le,useReducer:Le,useRef:Le,useState:Le,useDebugValue:Le,useDeferredValue:Le,useTransition:Le,useMutableSource:Le,useSyncExternalStore:Le,useId:Le,unstable_isNewReconciler:!1},$E={readContext:Bn,useCallback:function(e,t){return di().memoizedState=[e,t===void 0?null:t],e},useContext:Bn,useEffect:wv,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Yu(4194308,4,Xk.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Yu(4194308,4,e,t)},useInsertionEffect:function(e,t){return Yu(4,2,e,t)},useMemo:function(e,t){var n=di();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var i=di();return t=n!==void 0?n(t):t,i.memoizedState=i.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},i.queue=e,e=e.dispatch=NE.bind(null,ie,e),[i.memoizedState,e]},useRef:function(e){var t=di();return e={current:e},t.memoizedState=e},useState:_v,useDebugValue:Hg,useDeferredValue:function(e){return di().memoizedState=e},useTransition:function(){var e=_v(!1),t=e[0];return e=RE.bind(null,e[1]),di().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var i=ie,s=di();if(Gt){if(n===void 0)throw Error(H(407));n=n()}else{if(n=t(),Se===null)throw Error(H(349));Nr&30||Fk(i,t,n)}s.memoizedState=n;var r={value:n,getSnapshot:t};return s.queue=r,wv(Vk.bind(null,i,r,e),[e]),i.flags|=2048,Bl(9,Bk.bind(null,i,r,n,t),void 0,null),n},useId:function(){var e=di(),t=Se.identifierPrefix;if(Gt){var n=Bi,i=Fi;n=(i&~(1<<32-ei(i)-1)).toString(32)+n,t=":"+t+"R"+n,n=Il++,0")&&(l=l.replace("",e.displayName)),l}while(1<=o&&0<=a);break}}}finally{cf=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ha(e):""}function fD(e){switch(e.tag){case 5:return Ha(e.type);case 16:return Ha("Lazy");case 13:return Ha("Suspense");case 19:return Ha("SuspenseList");case 0:case 2:case 15:return e=uf(e.type,!1),e;case 11:return e=uf(e.type.render,!1),e;case 1:return e=uf(e.type,!0),e;default:return""}}function Dp(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case co:return"Fragment";case lo:return"Portal";case Cp:return"Profiler";case gg:return"StrictMode";case Pp:return"Suspense";case Tp:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Rw:return(e.displayName||"Context")+".Consumer";case Ow:return(e._context.displayName||"Context")+".Provider";case yg:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case vg:return t=e.displayName||null,t!==null?t:Dp(e.type)||"Memo";case ms:t=e._payload,e=e._init;try{return Dp(e(t))}catch{}}return null}function pD(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Dp(t);case 8:return t===gg?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Bs(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Nw(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function mD(e){var t=Nw(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),i=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,r=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(o){i=""+o,r.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(o){i=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Lc(e){e._valueTracker||(e._valueTracker=mD(e))}function jw(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),i="";return e&&(i=Nw(e)?e.checked?"true":"false":e.value),e=i,e!==n?(t.setValue(e),!0):!1}function cd(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Ep(e,t){var n=t.checked;return se({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function F0(e,t){var n=t.defaultValue==null?"":t.defaultValue,i=t.checked!=null?t.checked:t.defaultChecked;n=Bs(t.value!=null?t.value:n),e._wrapperState={initialChecked:i,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function $w(e,t){t=t.checked,t!=null&&mg(e,"checked",t,!1)}function Ap(e,t){$w(e,t);var n=Bs(t.value),i=t.type;if(n!=null)i==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(i==="submit"||i==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Op(e,t.type,n):t.hasOwnProperty("defaultValue")&&Op(e,t.type,Bs(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function B0(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var i=t.type;if(!(i!=="submit"&&i!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Op(e,t,n){(t!=="number"||cd(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ua=Array.isArray;function Co(e,t,n,i){if(e=e.options,t){t={};for(var s=0;s"+t.valueOf().toString()+"",t=Nc.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Pl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var nl={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},gD=["Webkit","ms","Moz","O"];Object.keys(nl).forEach(function(e){gD.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),nl[t]=nl[e]})});function Vw(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||nl.hasOwnProperty(e)&&nl[e]?(""+t).trim():t+"px"}function zw(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var i=n.indexOf("--")===0,s=Vw(n,t[n],i);n==="float"&&(n="cssFloat"),i?e.setProperty(n,s):e[n]=s}}var yD=se({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Np(e,t){if(t){if(yD[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(H(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(H(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(H(61))}if(t.style!=null&&typeof t.style!="object")throw Error(H(62))}}function jp(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var $p=null;function xg(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ip=null,Po=null,To=null;function W0(e){if(e=uc(e)){if(typeof Ip!="function")throw Error(H(280));var t=e.stateNode;t&&(t=ph(t),Ip(e.stateNode,e.type,t))}}function Ww(e){Po?To?To.push(e):To=[e]:Po=e}function Hw(){if(Po){var e=Po,t=To;if(To=Po=null,W0(e),t)for(e=0;e>>=0,e===0?32:31-(TD(e)/DD|0)|0}var jc=64,$c=4194304;function Ya(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function fd(e,t){var n=e.pendingLanes;if(n===0)return 0;var i=0,s=e.suspendedLanes,r=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~s;a!==0?i=Ya(a):(r&=o,r!==0&&(i=Ya(r)))}else o=n&~s,o!==0?i=Ya(o):r!==0&&(i=Ya(r));if(i===0)return 0;if(t!==0&&t!==i&&!(t&s)&&(s=i&-i,r=t&-t,s>=r||s===16&&(r&4194240)!==0))return t;if(i&4&&(i|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=i;0n;n++)t.push(e);return t}function lc(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ei(t),e[t]=n}function RD(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var i=e.eventTimes;for(e=e.expirationTimes;0=sl),Z0=" ",J0=!1;function uk(e,t){switch(e){case"keyup":return aE.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function dk(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var uo=!1;function cE(e,t){switch(e){case"compositionend":return dk(t);case"keypress":return t.which!==32?null:(J0=!0,Z0);case"textInput":return e=t.data,e===Z0&&J0?null:e;default:return null}}function uE(e,t){if(uo)return e==="compositionend"||!Pg&&uk(e,t)?(e=lk(),Wu=Sg=_s=null,uo=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=i}t:{for(;n;){if(n.nextSibling){n=n.nextSibling;break t}n=n.parentNode}n=void 0}n=iv(n)}}function mk(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?mk(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function gk(){for(var e=window,t=cd();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=cd(e.document)}return t}function Tg(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function xE(e){var t=gk(),n=e.focusedElem,i=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&mk(n.ownerDocument.documentElement,n)){if(i!==null&&Tg(n)){if(t=i.start,e=i.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=n.textContent.length,r=Math.min(i.start,s);i=i.end===void 0?r:Math.min(i.end,s),!e.extend&&r>i&&(s=i,i=r,r=s),s=sv(n,r);var o=sv(n,i);s&&o&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),r>i?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,ho=null,Hp=null,ol=null,Up=!1;function rv(e,t,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Up||ho==null||ho!==cd(i)||(i=ho,"selectionStart"in i&&Tg(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),ol&&Rl(ol,i)||(ol=i,i=gd(Hp,"onSelect"),0mo||(e.current=Qp[mo],Qp[mo]=null,mo--)}function Bt(e,t){mo++,Qp[mo]=e.current,e.current=t}var Vs={},Ve=Gs(Vs),rn=Gs(!1),Rr=Vs;function $o(e,t){var n=e.type.contextTypes;if(!n)return Vs;var i=e.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===t)return i.__reactInternalMemoizedMaskedChildContext;var s={},r;for(r in n)s[r]=t[r];return i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function on(e){return e=e.childContextTypes,e!=null}function vd(){Yt(rn),Yt(Ve)}function hv(e,t,n){if(Ve.current!==Vs)throw Error(H(168));Bt(Ve,t),Bt(rn,n)}function Mk(e,t,n){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!="function")return n;i=i.getChildContext();for(var s in i)if(!(s in t))throw Error(H(108,pD(e)||"Unknown",s));return se({},n,i)}function xd(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Vs,Rr=Ve.current,Bt(Ve,e),Bt(rn,rn.current),!0}function fv(e,t,n){var i=e.stateNode;if(!i)throw Error(H(169));n?(e=Mk(e,t,Rr),i.__reactInternalMemoizedMergedChildContext=e,Yt(rn),Yt(Ve),Bt(Ve,e)):Yt(rn),Bt(rn,n)}var ji=null,mh=!1,Sf=!1;function Ck(e){ji===null?ji=[e]:ji.push(e)}function AE(e){mh=!0,Ck(e)}function qs(){if(!Sf&&ji!==null){Sf=!0;var e=0,t=Ot;try{var n=ji;for(Ot=1;e>=o,s-=o,Fi=1<<32-ei(t)+s|n<M?(P=C,C=null):P=C.sibling;var T=h(y,C,x[M],_);if(T===null){C===null&&(C=P);break}e&&C&&T.alternate===null&&t(y,C),g=r(T,g,M),S===null?w=T:S.sibling=T,S=T,C=P}if(M===x.length)return n(y,C),Gt&&dr(y,M),w;if(C===null){for(;MM?(P=C,C=null):P=C.sibling;var A=h(y,C,T.value,_);if(A===null){C===null&&(C=P);break}e&&C&&A.alternate===null&&t(y,C),g=r(A,g,M),S===null?w=A:S.sibling=A,S=A,C=P}if(T.done)return n(y,C),Gt&&dr(y,M),w;if(C===null){for(;!T.done;M++,T=x.next())T=d(y,T.value,_),T!==null&&(g=r(T,g,M),S===null?w=T:S.sibling=T,S=T);return Gt&&dr(y,M),w}for(C=i(y,C);!T.done;M++,T=x.next())T=f(C,y,M,T.value,_),T!==null&&(e&&T.alternate!==null&&C.delete(T.key===null?M:T.key),g=r(T,g,M),S===null?w=T:S.sibling=T,S=T);return e&&C.forEach(function(E){return t(y,E)}),Gt&&dr(y,M),w}function v(y,g,x,_){if(typeof x=="object"&&x!==null&&x.type===co&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Rc:t:{for(var w=x.key,S=g;S!==null;){if(S.key===w){if(w=x.type,w===co){if(S.tag===7){n(y,S.sibling),g=s(S,x.props.children),g.return=y,y=g;break t}}else if(S.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===ms&&bv(w)===S.type){n(y,S.sibling),g=s(S,x.props),g.ref=ga(y,S,x),g.return=y,y=g;break t}n(y,S);break}else t(y,S);S=S.sibling}x.type===co?(g=Mr(x.props.children,y.mode,_,x.key),g.return=y,y=g):(_=Qu(x.type,x.key,x.props,null,y.mode,_),_.ref=ga(y,g,x),_.return=y,y=_)}return o(y);case lo:t:{for(S=x.key;g!==null;){if(g.key===S)if(g.tag===4&&g.stateNode.containerInfo===x.containerInfo&&g.stateNode.implementation===x.implementation){n(y,g.sibling),g=s(g,x.children||[]),g.return=y,y=g;break t}else{n(y,g);break}else t(y,g);g=g.sibling}g=Of(x,y.mode,_),g.return=y,y=g}return o(y);case ms:return S=x._init,v(y,g,S(x._payload),_)}if(Ua(x))return p(y,g,x,_);if(da(x))return m(y,g,x,_);Hc(y,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,g!==null&&g.tag===6?(n(y,g.sibling),g=s(g,x),g.return=y,y=g):(n(y,g),g=Af(x,y.mode,_),g.return=y,y=g),o(y)):n(y,g)}return v}var Fo=Lk(!0),Nk=Lk(!1),dc={},yi=Gs(dc),$l=Gs(dc),Il=Gs(dc);function wr(e){if(e===dc)throw Error(H(174));return e}function $g(e,t){switch(Bt(Il,t),Bt($l,e),Bt(yi,dc),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Lp(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Lp(t,e)}Yt(yi),Bt(yi,t)}function Bo(){Yt(yi),Yt($l),Yt(Il)}function jk(e){wr(Il.current);var t=wr(yi.current),n=Lp(t,e.type);t!==n&&(Bt($l,e),Bt(yi,n))}function Ig(e){$l.current===e&&(Yt(yi),Yt($l))}var te=Gs(0);function Md(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Mf=[];function Fg(){for(var e=0;en?n:4,e(!0);var i=Cf.transition;Cf.transition={};try{e(!1),t()}finally{Ot=n,Cf.transition=i}}function Zk(){return Vn().memoizedState}function NE(e,t,n){var i=Ns(e);if(n={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null},Jk(e))tS(t,n);else if(n=Ek(e,t,n,i),n!==null){var s=Ue();ni(n,e,i,s),eS(n,t,i)}}function jE(e,t,n){var i=Ns(e),s={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null};if(Jk(e))tS(t,s);else{var r=e.alternate;if(e.lanes===0&&(r===null||r.lanes===0)&&(r=t.lastRenderedReducer,r!==null))try{var o=t.lastRenderedState,a=r(o,n);if(s.hasEagerState=!0,s.eagerState=a,ii(a,o)){var l=t.interleaved;l===null?(s.next=s,Ng(t)):(s.next=l.next,l.next=s),t.interleaved=s;return}}catch{}finally{}n=Ek(e,t,s,i),n!==null&&(s=Ue(),ni(n,e,i,s),eS(n,t,i))}}function Jk(e){var t=e.alternate;return e===ie||t!==null&&t===ie}function tS(e,t){al=Cd=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function eS(e,t,n){if(n&4194240){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,_g(e,n)}}var Pd={readContext:Bn,useCallback:Re,useContext:Re,useEffect:Re,useImperativeHandle:Re,useInsertionEffect:Re,useLayoutEffect:Re,useMemo:Re,useReducer:Re,useRef:Re,useState:Re,useDebugValue:Re,useDeferredValue:Re,useTransition:Re,useMutableSource:Re,useSyncExternalStore:Re,useId:Re,unstable_isNewReconciler:!1},$E={readContext:Bn,useCallback:function(e,t){return di().memoizedState=[e,t===void 0?null:t],e},useContext:Bn,useEffect:wv,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Xu(4194308,4,Xk.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Xu(4194308,4,e,t)},useInsertionEffect:function(e,t){return Xu(4,2,e,t)},useMemo:function(e,t){var n=di();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var i=di();return t=n!==void 0?n(t):t,i.memoizedState=i.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},i.queue=e,e=e.dispatch=NE.bind(null,ie,e),[i.memoizedState,e]},useRef:function(e){var t=di();return e={current:e},t.memoizedState=e},useState:_v,useDebugValue:Hg,useDeferredValue:function(e){return di().memoizedState=e},useTransition:function(){var e=_v(!1),t=e[0];return e=LE.bind(null,e[1]),di().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var i=ie,s=di();if(Gt){if(n===void 0)throw Error(H(407));n=n()}else{if(n=t(),Se===null)throw Error(H(349));Nr&30||Fk(i,t,n)}s.memoizedState=n;var r={value:n,getSnapshot:t};return s.queue=r,wv(Vk.bind(null,i,r,e),[e]),i.flags|=2048,Vl(9,Bk.bind(null,i,r,n,t),void 0,null),n},useId:function(){var e=di(),t=Se.identifierPrefix;if(Gt){var n=Bi,i=Fi;n=(i&~(1<<32-ei(i)-1)).toString(32)+n,t=":"+t+"R"+n,n=Fl++,0<\/script>",e=e.removeChild(e.firstChild)):typeof i.is=="string"?e=o.createElement(n,{is:i.is}):(e=o.createElement(n),n==="select"&&(o=e,i.multiple?o.multiple=!0:i.size&&(o.size=i.size))):e=o.createElementNS(e,n),e[fi]=t,e[Nl]=i,uS(e,t,!1,!1),t.stateNode=e;t:{switch(o=jp(n,i),n){case"dialog":Wt("cancel",e),Wt("close",e),s=i;break;case"iframe":case"object":case"embed":Wt("load",e),s=i;break;case"video":case"audio":for(s=0;szo&&(t.flags|=128,i=!0,ya(r,!1),t.lanes=4194304)}else{if(!i)if(e=Md(o),e!==null){if(t.flags|=128,i=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ya(r,!0),r.tail===null&&r.tailMode==="hidden"&&!o.alternate&&!Gt)return Re(t),null}else 2*le()-r.renderingStartTime>zo&&n!==1073741824&&(t.flags|=128,i=!0,ya(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(n=r.last,n!==null?n.sibling=o:t.child=o,r.last=o)}return r.tail!==null?(t=r.tail,r.rendering=t,r.tail=t.sibling,r.renderingStartTime=le(),t.sibling=null,n=te.current,Bt(te,i?n&1|2:n&1),t):(Re(t),null);case 22:case 23:return qg(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?gn&1073741824&&(Re(t),t.subtreeFlags&6&&(t.flags|=8192)):Re(t),null;case 24:return null;case 25:return null}throw Error(H(156,t.tag))}function UE(e,t){switch(Eg(t),t.tag){case 1:return on(t.type)&&vd(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Bo(),Yt(rn),Yt(Ve),Fg(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ig(t),null;case 13:if(Yt(te),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(H(340));Io()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Yt(te),null;case 4:return Bo(),null;case 10:return Rg(t.type._context),null;case 22:case 23:return qg(),null;case 24:return null;default:return null}}var Uc=!1,Ie=!1,YE=typeof WeakSet=="function"?WeakSet:Set,tt=null;function xo(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(i){re(e,t,i)}else n.current=null}function cm(e,t,n){try{n()}catch(i){re(e,t,i)}}var Av=!1;function XE(e,t){if(Yp=pd,e=gk(),Tg(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else t:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var s=i.anchorOffset,r=i.focusNode;i=i.focusOffset;try{n.nodeType,r.nodeType}catch{n=null;break t}var o=0,a=-1,l=-1,c=0,u=0,d=e,h=null;e:for(;;){for(var f;d!==n||s!==0&&d.nodeType!==3||(a=o+s),d!==r||i!==0&&d.nodeType!==3||(l=o+i),d.nodeType===3&&(o+=d.nodeValue.length),(f=d.firstChild)!==null;)h=d,d=f;for(;;){if(d===e)break e;if(h===n&&++c===s&&(a=o),h===r&&++u===i&&(l=o),(f=d.nextSibling)!==null)break;d=h,h=d.parentNode}d=f}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Xp={focusedElem:e,selectionRange:n},pd=!1,tt=t;tt!==null;)if(t=tt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,tt=e;else for(;tt!==null;){t=tt;try{var p=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var m=p.memoizedProps,v=p.memoizedState,y=t.stateNode,g=y.getSnapshotBeforeUpdate(t.elementType===t.type?m:qn(t.type,m),v);y.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(H(163))}}catch(_){re(t,t.return,_)}if(e=t.sibling,e!==null){e.return=t.return,tt=e;break}tt=t.return}return p=Av,Av=!1,p}function al(e,t,n){var i=t.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var s=i=i.next;do{if((s.tag&e)===e){var r=s.destroy;s.destroy=void 0,r!==void 0&&cm(t,n,r)}s=s.next}while(s!==i)}}function vh(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var i=n.create;n.destroy=i()}n=n.next}while(n!==t)}}function um(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function fS(e){var t=e.alternate;t!==null&&(e.alternate=null,fS(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[fi],delete t[Nl],delete t[qp],delete t[DE],delete t[EE])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function pS(e){return e.tag===5||e.tag===3||e.tag===4}function Ov(e){t:for(;;){for(;e.sibling===null;){if(e.return===null||pS(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue t;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function dm(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=yd));else if(i!==4&&(e=e.child,e!==null))for(dm(e,t,n),e=e.sibling;e!==null;)dm(e,t,n),e=e.sibling}function hm(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(i!==4&&(e=e.child,e!==null))for(hm(e,t,n),e=e.sibling;e!==null;)hm(e,t,n),e=e.sibling}var Pe=null,Qn=!1;function ds(e,t,n){for(n=n.child;n!==null;)mS(e,t,n),n=n.sibling}function mS(e,t,n){if(gi&&typeof gi.onCommitFiberUnmount=="function")try{gi.onCommitFiberUnmount(uh,n)}catch{}switch(n.tag){case 5:Ie||xo(n,t);case 6:var i=Pe,s=Qn;Pe=null,ds(e,t,n),Pe=i,Qn=s,Pe!==null&&(Qn?(e=Pe,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Pe.removeChild(n.stateNode));break;case 18:Pe!==null&&(Qn?(e=Pe,n=n.stateNode,e.nodeType===8?kf(e.parentNode,n):e.nodeType===1&&kf(e,n),El(e)):kf(Pe,n.stateNode));break;case 4:i=Pe,s=Qn,Pe=n.stateNode.containerInfo,Qn=!0,ds(e,t,n),Pe=i,Qn=s;break;case 0:case 11:case 14:case 15:if(!Ie&&(i=n.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){s=i=i.next;do{var r=s,o=r.destroy;r=r.tag,o!==void 0&&(r&2||r&4)&&cm(n,t,o),s=s.next}while(s!==i)}ds(e,t,n);break;case 1:if(!Ie&&(xo(n,t),i=n.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=n.memoizedProps,i.state=n.memoizedState,i.componentWillUnmount()}catch(a){re(n,t,a)}ds(e,t,n);break;case 21:ds(e,t,n);break;case 22:n.mode&1?(Ie=(i=Ie)||n.memoizedState!==null,ds(e,t,n),Ie=i):ds(e,t,n);break;default:ds(e,t,n)}}function Lv(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new YE),t.forEach(function(i){var s=nA.bind(null,e,i);n.has(i)||(n.add(i),i.then(s,s))})}}function Gn(e,t){var n=t.deletions;if(n!==null)for(var i=0;is&&(s=o),i&=~r}if(i=s,i=le()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*GE(i/1960))-i,10e?16:e,ws===null)var i=!1;else{if(e=ws,ws=null,Ed=0,St&6)throw Error(H(331));var s=St;for(St|=4,tt=e.current;tt!==null;){var r=tt,o=r.child;if(tt.flags&16){var a=r.deletions;if(a!==null){for(var l=0;lle()-Kg?Sr(e,0):Xg|=n),an(e,t)}function kS(e,t){t===0&&(e.mode&1?(t=jc,jc<<=1,!(jc&130023424)&&(jc=4194304)):t=1);var n=Ue();e=ts(e,t),e!==null&&(ac(e,t,n),an(e,n))}function eA(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),kS(e,n)}function nA(e,t){var n=0;switch(e.tag){case 13:var i=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(H(314))}i!==null&&i.delete(t),kS(e,n)}var SS;SS=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||rn.current)nn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return nn=!1,WE(e,t,n);nn=!!(e.flags&131072)}else nn=!1,Gt&&t.flags&1048576&&Pk(t,_d,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;Xu(e,t),e=t.pendingProps;var s=$o(t,Ve.current);Eo(t,n),s=Vg(null,t,i,e,s,n);var r=zg();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,on(i)?(r=!0,xd(t)):r=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,jg(t),s.updater=gh,t.stateNode=s,s._reactInternals=t,nm(t,i,e,n),t=rm(null,t,i,!0,r,n)):(t.tag=0,Gt&&r&&Dg(t),He(null,t,s,n),t=t.child),t;case 16:i=t.elementType;t:{switch(Xu(e,t),e=t.pendingProps,s=i._init,i=s(i._payload),t.type=i,s=t.tag=sA(i),e=qn(i,e),s){case 0:t=sm(null,t,i,e,n);break t;case 1:t=Tv(null,t,i,e,n);break t;case 11:t=Cv(null,t,i,e,n);break t;case 14:t=Pv(null,t,i,qn(i.type,e),n);break t}throw Error(H(306,i,""))}return t;case 0:return i=t.type,s=t.pendingProps,s=t.elementType===i?s:qn(i,s),sm(e,t,i,s,n);case 1:return i=t.type,s=t.pendingProps,s=t.elementType===i?s:qn(i,s),Tv(e,t,i,s,n);case 3:t:{if(aS(t),e===null)throw Error(H(387));i=t.pendingProps,r=t.memoizedState,s=r.element,Ak(e,t),Sd(t,i,null,n);var o=t.memoizedState;if(i=o.element,r.isDehydrated)if(r={element:i,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=r,t.memoizedState=r,t.flags&256){s=Vo(Error(H(423)),t),t=Dv(e,t,i,n,s);break t}else if(i!==s){s=Vo(Error(H(424)),t),t=Dv(e,t,i,n,s);break t}else for(xn=Os(t.stateNode.containerInfo.firstChild),bn=t,Gt=!0,Zn=null,n=Nk(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Io(),i===s){t=es(e,t,n);break t}He(e,t,i,n)}t=t.child}return t;case 5:return jk(t),e===null&&Jp(t),i=t.type,s=t.pendingProps,r=e!==null?e.memoizedProps:null,o=s.children,Kp(i,s)?o=null:r!==null&&Kp(i,r)&&(t.flags|=32),oS(e,t),He(e,t,o,n),t.child;case 6:return e===null&&Jp(t),null;case 13:return lS(e,t,n);case 4:return $g(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Fo(t,null,i,n):He(e,t,i,n),t.child;case 11:return i=t.type,s=t.pendingProps,s=t.elementType===i?s:qn(i,s),Cv(e,t,i,s,n);case 7:return He(e,t,t.pendingProps,n),t.child;case 8:return He(e,t,t.pendingProps.children,n),t.child;case 12:return He(e,t,t.pendingProps.children,n),t.child;case 10:t:{if(i=t.type._context,s=t.pendingProps,r=t.memoizedProps,o=s.value,Bt(wd,i._currentValue),i._currentValue=o,r!==null)if(ii(r.value,o)){if(r.children===s.children&&!rn.current){t=es(e,t,n);break t}}else for(r=t.child,r!==null&&(r.return=t);r!==null;){var a=r.dependencies;if(a!==null){o=r.child;for(var l=a.firstContext;l!==null;){if(l.context===i){if(r.tag===1){l=Gi(-1,n&-n),l.tag=2;var c=r.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}r.lanes|=n,l=r.alternate,l!==null&&(l.lanes|=n),tm(r.return,n,t),a.lanes|=n;break}l=l.next}}else if(r.tag===10)o=r.type===t.type?null:r.child;else if(r.tag===18){if(o=r.return,o===null)throw Error(H(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),tm(o,n,t),o=r.sibling}else o=r.child;if(o!==null)o.return=r;else for(o=r;o!==null;){if(o===t){o=null;break}if(r=o.sibling,r!==null){r.return=o.return,o=r;break}o=o.return}r=o}He(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,i=t.pendingProps.children,Eo(t,n),s=Bn(s),i=i(s),t.flags|=1,He(e,t,i,n),t.child;case 14:return i=t.type,s=qn(i,t.pendingProps),s=qn(i.type,s),Pv(e,t,i,s,n);case 15:return sS(e,t,t.type,t.pendingProps,n);case 17:return i=t.type,s=t.pendingProps,s=t.elementType===i?s:qn(i,s),Xu(e,t),t.tag=1,on(i)?(e=!0,xd(t)):e=!1,Eo(t,n),Lk(t,i,s),nm(t,i,s,n),rm(null,t,i,!0,e,n);case 19:return cS(e,t,n);case 22:return rS(e,t,n)}throw Error(H(156,t.tag))};function MS(e,t){return Qw(e,t)}function iA(e,t,n,i){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function $n(e,t,n,i){return new iA(e,t,n,i)}function Zg(e){return e=e.prototype,!(!e||!e.isReactComponent)}function sA(e){if(typeof e=="function")return Zg(e)?1:0;if(e!=null){if(e=e.$$typeof,e===yg)return 11;if(e===vg)return 14}return 2}function js(e,t){var n=e.alternate;return n===null?(n=$n(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function qu(e,t,n,i,s,r){var o=2;if(i=e,typeof e=="function")Zg(e)&&(o=1);else if(typeof e=="string")o=5;else t:switch(e){case co:return Mr(n.children,s,r,t);case gg:o=8,s|=8;break;case Cp:return e=$n(12,n,t,s|2),e.elementType=Cp,e.lanes=r,e;case Pp:return e=$n(13,n,t,s),e.elementType=Pp,e.lanes=r,e;case Tp:return e=$n(19,n,t,s),e.elementType=Tp,e.lanes=r,e;case Rw:return bh(n,s,r,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Ow:o=10;break t;case Lw:o=9;break t;case yg:o=11;break t;case vg:o=14;break t;case ms:o=16,i=null;break t}throw Error(H(130,e==null?e:typeof e,""))}return t=$n(o,n,t,s),t.elementType=e,t.type=i,t.lanes=r,t}function Mr(e,t,n,i){return e=$n(7,e,i,t),e.lanes=n,e}function bh(e,t,n,i){return e=$n(22,e,i,t),e.elementType=Rw,e.lanes=n,e.stateNode={isHidden:!1},e}function Af(e,t,n){return e=$n(6,e,null,t),e.lanes=n,e}function Of(e,t,n){return t=$n(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function rA(e,t,n,i,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=hf(0),this.expirationTimes=hf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=hf(0),this.identifierPrefix=i,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Jg(e,t,n,i,s,r,o,a,l){return e=new rA(e,t,n,a,l),t===1?(t=1,r===!0&&(t|=8)):t=0,r=$n(3,null,null,t),e.current=r,r.stateNode=e,r.memoizedState={element:i,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},jg(r),e}function oA(e,t,n){var i=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(DS)}catch(e){console.error(e)}}DS(),Pw.exports=kn;var iy=Pw.exports,Vv=iy;Sp.createRoot=Vv.createRoot,Sp.hydrateRoot=Vv.hydrateRoot;/*! +`+r.stack}return{value:e,source:t,stack:s,digest:null}}function Df(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function im(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var BE=typeof WeakMap=="function"?WeakMap:Map;function nS(e,t,n){n=Gi(-1,n),n.tag=3,n.payload={element:null};var i=t.value;return n.callback=function(){Dd||(Dd=!0,fm=i),im(e,t)},n}function iS(e,t,n){n=Gi(-1,n),n.tag=3;var i=e.type.getDerivedStateFromError;if(typeof i=="function"){var s=t.value;n.payload=function(){return i(s)},n.callback=function(){im(e,t)}}var r=e.stateNode;return r!==null&&typeof r.componentDidCatch=="function"&&(n.callback=function(){im(e,t),typeof i!="function"&&(Ls===null?Ls=new Set([this]):Ls.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function kv(e,t,n){var i=e.pingCache;if(i===null){i=e.pingCache=new BE;var s=new Set;i.set(t,s)}else s=i.get(t),s===void 0&&(s=new Set,i.set(t,s));s.has(n)||(s.add(n),e=tA.bind(null,e,t,n),t.then(e,e))}function Sv(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Mv(e,t,n,i,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Gi(-1,1),t.tag=2,Rs(n,t,1))),n.lanes|=1),e)}var VE=rs.ReactCurrentOwner,nn=!1;function He(e,t,n,i){t.child=e===null?Nk(t,null,n,i):Fo(t,e.child,n,i)}function Cv(e,t,n,i,s){n=n.render;var r=t.ref;return Eo(t,s),i=Vg(e,t,n,i,r,s),n=zg(),e!==null&&!nn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,es(e,t,s)):(Gt&&n&&Dg(t),t.flags|=1,He(e,t,i,s),t.child)}function Pv(e,t,n,i,s){if(e===null){var r=n.type;return typeof r=="function"&&!Zg(r)&&r.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=r,sS(e,t,r,i,s)):(e=Qu(n.type,null,i,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(r=e.child,!(e.lanes&s)){var o=r.memoizedProps;if(n=n.compare,n=n!==null?n:Rl,n(o,i)&&e.ref===t.ref)return es(e,t,s)}return t.flags|=1,e=js(r,i),e.ref=t.ref,e.return=t,t.child=e}function sS(e,t,n,i,s){if(e!==null){var r=e.memoizedProps;if(Rl(r,i)&&e.ref===t.ref)if(nn=!1,t.pendingProps=i=r,(e.lanes&s)!==0)e.flags&131072&&(nn=!0);else return t.lanes=e.lanes,es(e,t,s)}return sm(e,t,n,i,s)}function rS(e,t,n){var i=t.pendingProps,s=i.children,r=e!==null?e.memoizedState:null;if(i.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Bt(bo,gn),gn|=n;else{if(!(n&1073741824))return e=r!==null?r.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Bt(bo,gn),gn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=r!==null?r.baseLanes:n,Bt(bo,gn),gn|=i}else r!==null?(i=r.baseLanes|n,t.memoizedState=null):i=n,Bt(bo,gn),gn|=i;return He(e,t,s,n),t.child}function oS(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function sm(e,t,n,i,s){var r=on(n)?Rr:Ve.current;return r=$o(t,r),Eo(t,s),n=Vg(e,t,n,i,r,s),i=zg(),e!==null&&!nn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,es(e,t,s)):(Gt&&i&&Dg(t),t.flags|=1,He(e,t,n,s),t.child)}function Tv(e,t,n,i,s){if(on(n)){var r=!0;xd(t)}else r=!1;if(Eo(t,s),t.stateNode===null)Ku(e,t),Rk(t,n,i),nm(t,n,i,s),i=!0;else if(e===null){var o=t.stateNode,a=t.memoizedProps;o.props=a;var l=o.context,c=n.contextType;typeof c=="object"&&c!==null?c=Bn(c):(c=on(n)?Rr:Ve.current,c=$o(t,c));var u=n.getDerivedStateFromProps,d=typeof u=="function"||typeof o.getSnapshotBeforeUpdate=="function";d||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==i||l!==c)&&xv(t,o,i,c),gs=!1;var h=t.memoizedState;o.state=h,Sd(t,i,o,s),l=t.memoizedState,a!==i||h!==l||rn.current||gs?(typeof u=="function"&&(em(t,n,u,i),l=t.memoizedState),(a=gs||vv(t,n,a,i,h,l,c))?(d||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=l),o.props=i,o.state=l,o.context=c,i=a):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{o=t.stateNode,Ak(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:qn(t.type,a),o.props=c,d=t.pendingProps,h=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=Bn(l):(l=on(n)?Rr:Ve.current,l=$o(t,l));var f=n.getDerivedStateFromProps;(u=typeof f=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==d||h!==l)&&xv(t,o,i,l),gs=!1,h=t.memoizedState,o.state=h,Sd(t,i,o,s);var p=t.memoizedState;a!==d||h!==p||rn.current||gs?(typeof f=="function"&&(em(t,n,f,i),p=t.memoizedState),(c=gs||vv(t,n,c,i,h,p,l)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(i,p,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(i,p,l)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=p),o.props=i,o.state=p,o.context=l,i=c):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),i=!1)}return rm(e,t,n,i,r,s)}function rm(e,t,n,i,s,r){oS(e,t);var o=(t.flags&128)!==0;if(!i&&!o)return s&&fv(t,n,!1),es(e,t,r);i=t.stateNode,VE.current=t;var a=o&&typeof n.getDerivedStateFromError!="function"?null:i.render();return t.flags|=1,e!==null&&o?(t.child=Fo(t,e.child,null,r),t.child=Fo(t,null,a,r)):He(e,t,a,r),t.memoizedState=i.state,s&&fv(t,n,!0),t.child}function aS(e){var t=e.stateNode;t.pendingContext?hv(e,t.pendingContext,t.pendingContext!==t.context):t.context&&hv(e,t.context,!1),$g(e,t.containerInfo)}function Dv(e,t,n,i,s){return Io(),Ag(s),t.flags|=256,He(e,t,n,i),t.child}var om={dehydrated:null,treeContext:null,retryLane:0};function am(e){return{baseLanes:e,cachePool:null,transitions:null}}function lS(e,t,n){var i=t.pendingProps,s=te.current,r=!1,o=(t.flags&128)!==0,a;if((a=o)||(a=e!==null&&e.memoizedState===null?!1:(s&2)!==0),a?(r=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),Bt(te,s&1),e===null)return Jp(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=i.children,e=i.fallback,r?(i=t.mode,r=t.child,o={mode:"hidden",children:o},!(i&1)&&r!==null?(r.childLanes=0,r.pendingProps=o):r=bh(o,i,0,null),e=Mr(e,i,n,null),r.return=t,e.return=t,r.sibling=e,t.child=r,t.child.memoizedState=am(n),t.memoizedState=om,e):Ug(t,o));if(s=e.memoizedState,s!==null&&(a=s.dehydrated,a!==null))return zE(e,t,o,i,a,s,n);if(r){r=i.fallback,o=t.mode,s=e.child,a=s.sibling;var l={mode:"hidden",children:i.children};return!(o&1)&&t.child!==s?(i=t.child,i.childLanes=0,i.pendingProps=l,t.deletions=null):(i=js(s,l),i.subtreeFlags=s.subtreeFlags&14680064),a!==null?r=js(a,r):(r=Mr(r,o,n,null),r.flags|=2),r.return=t,i.return=t,i.sibling=r,t.child=i,i=r,r=t.child,o=e.child.memoizedState,o=o===null?am(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},r.memoizedState=o,r.childLanes=e.childLanes&~n,t.memoizedState=om,i}return r=e.child,e=r.sibling,i=js(r,{mode:"visible",children:i.children}),!(t.mode&1)&&(i.lanes=n),i.return=t,i.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=i,t.memoizedState=null,i}function Ug(e,t){return t=bh({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Uc(e,t,n,i){return i!==null&&Ag(i),Fo(t,e.child,null,n),e=Ug(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function zE(e,t,n,i,s,r,o){if(n)return t.flags&256?(t.flags&=-257,i=Df(Error(H(422))),Uc(e,t,o,i)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(r=i.fallback,s=t.mode,i=bh({mode:"visible",children:i.children},s,0,null),r=Mr(r,s,o,null),r.flags|=2,i.return=t,r.return=t,i.sibling=r,t.child=i,t.mode&1&&Fo(t,e.child,null,o),t.child.memoizedState=am(o),t.memoizedState=om,r);if(!(t.mode&1))return Uc(e,t,o,null);if(s.data==="$!"){if(i=s.nextSibling&&s.nextSibling.dataset,i)var a=i.dgst;return i=a,r=Error(H(419)),i=Df(r,i,void 0),Uc(e,t,o,i)}if(a=(o&e.childLanes)!==0,nn||a){if(i=Se,i!==null){switch(o&-o){case 4:s=2;break;case 16:s=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(i.suspendedLanes|o)?0:s,s!==0&&s!==r.retryLane&&(r.retryLane=s,ts(e,s),ni(i,e,s,-1))}return Qg(),i=Df(Error(H(421))),Uc(e,t,o,i)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=eA.bind(null,e),s._reactRetry=t,null):(e=r.treeContext,xn=Os(s.nextSibling),bn=t,Gt=!0,Zn=null,e!==null&&(Ln[Nn++]=Fi,Ln[Nn++]=Bi,Ln[Nn++]=Lr,Fi=e.id,Bi=e.overflow,Lr=t),t=Ug(t,i.children),t.flags|=4096,t)}function Ev(e,t,n){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),tm(e.return,t,n)}function Ef(e,t,n,i,s){var r=e.memoizedState;r===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:s}:(r.isBackwards=t,r.rendering=null,r.renderingStartTime=0,r.last=i,r.tail=n,r.tailMode=s)}function cS(e,t,n){var i=t.pendingProps,s=i.revealOrder,r=i.tail;if(He(e,t,i.children,n),i=te.current,i&2)i=i&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)t:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ev(e,n,t);else if(e.tag===19)Ev(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break t;for(;e.sibling===null;){if(e.return===null||e.return===t)break t;e=e.return}e.sibling.return=e.return,e=e.sibling}i&=1}if(Bt(te,i),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&Md(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),Ef(t,!1,s,n,r);break;case"backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&Md(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}Ef(t,!0,n,null,r);break;case"together":Ef(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ku(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function es(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),jr|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(H(153));if(t.child!==null){for(e=t.child,n=js(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=js(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function WE(e,t,n){switch(t.tag){case 3:aS(t),Io();break;case 5:jk(t);break;case 1:on(t.type)&&xd(t);break;case 4:$g(t,t.stateNode.containerInfo);break;case 10:var i=t.type._context,s=t.memoizedProps.value;Bt(wd,i._currentValue),i._currentValue=s;break;case 13:if(i=t.memoizedState,i!==null)return i.dehydrated!==null?(Bt(te,te.current&1),t.flags|=128,null):n&t.child.childLanes?lS(e,t,n):(Bt(te,te.current&1),e=es(e,t,n),e!==null?e.sibling:null);Bt(te,te.current&1);break;case 19:if(i=(n&t.childLanes)!==0,e.flags&128){if(i)return cS(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),Bt(te,te.current),i)break;return null;case 22:case 23:return t.lanes=0,rS(e,t,n)}return es(e,t,n)}var uS,lm,dS,hS;uS=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};lm=function(){};dS=function(e,t,n,i){var s=e.memoizedProps;if(s!==i){e=t.stateNode,wr(yi.current);var r=null;switch(n){case"input":s=Ep(e,s),i=Ep(e,i),r=[];break;case"select":s=se({},s,{value:void 0}),i=se({},i,{value:void 0}),r=[];break;case"textarea":s=Rp(e,s),i=Rp(e,i),r=[];break;default:typeof s.onClick!="function"&&typeof i.onClick=="function"&&(e.onclick=yd)}Np(n,i);var o;n=null;for(c in s)if(!i.hasOwnProperty(c)&&s.hasOwnProperty(c)&&s[c]!=null)if(c==="style"){var a=s[c];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(Cl.hasOwnProperty(c)?r||(r=[]):(r=r||[]).push(c,null));for(c in i){var l=i[c];if(a=s!=null?s[c]:void 0,i.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(n||(n={}),n[o]=l[o])}else n||(r||(r=[]),r.push(c,n)),n=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(r=r||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(r=r||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(Cl.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&Wt("scroll",e),r||a===l||(r=[])):(r=r||[]).push(c,l))}n&&(r=r||[]).push("style",n);var c=r;(t.updateQueue=c)&&(t.flags|=4)}};hS=function(e,t,n,i){n!==i&&(t.flags|=4)};function ya(e,t){if(!Gt)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function Le(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,i=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,i|=s.subtreeFlags&14680064,i|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,i|=s.subtreeFlags,i|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=i,e.childLanes=n,t}function HE(e,t,n){var i=t.pendingProps;switch(Eg(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Le(t),null;case 1:return on(t.type)&&vd(),Le(t),null;case 3:return i=t.stateNode,Bo(),Yt(rn),Yt(Ve),Fg(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Wc(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Zn!==null&&(gm(Zn),Zn=null))),lm(e,t),Le(t),null;case 5:Ig(t);var s=wr(Il.current);if(n=t.type,e!==null&&t.stateNode!=null)dS(e,t,n,i,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(t.stateNode===null)throw Error(H(166));return Le(t),null}if(e=wr(yi.current),Wc(t)){i=t.stateNode,n=t.type;var r=t.memoizedProps;switch(i[fi]=t,i[jl]=r,e=(t.mode&1)!==0,n){case"dialog":Wt("cancel",i),Wt("close",i);break;case"iframe":case"object":case"embed":Wt("load",i);break;case"video":case"audio":for(s=0;s<\/script>",e=e.removeChild(e.firstChild)):typeof i.is=="string"?e=o.createElement(n,{is:i.is}):(e=o.createElement(n),n==="select"&&(o=e,i.multiple?o.multiple=!0:i.size&&(o.size=i.size))):e=o.createElementNS(e,n),e[fi]=t,e[jl]=i,uS(e,t,!1,!1),t.stateNode=e;t:{switch(o=jp(n,i),n){case"dialog":Wt("cancel",e),Wt("close",e),s=i;break;case"iframe":case"object":case"embed":Wt("load",e),s=i;break;case"video":case"audio":for(s=0;szo&&(t.flags|=128,i=!0,ya(r,!1),t.lanes=4194304)}else{if(!i)if(e=Md(o),e!==null){if(t.flags|=128,i=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ya(r,!0),r.tail===null&&r.tailMode==="hidden"&&!o.alternate&&!Gt)return Le(t),null}else 2*le()-r.renderingStartTime>zo&&n!==1073741824&&(t.flags|=128,i=!0,ya(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(n=r.last,n!==null?n.sibling=o:t.child=o,r.last=o)}return r.tail!==null?(t=r.tail,r.rendering=t,r.tail=t.sibling,r.renderingStartTime=le(),t.sibling=null,n=te.current,Bt(te,i?n&1|2:n&1),t):(Le(t),null);case 22:case 23:return qg(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?gn&1073741824&&(Le(t),t.subtreeFlags&6&&(t.flags|=8192)):Le(t),null;case 24:return null;case 25:return null}throw Error(H(156,t.tag))}function UE(e,t){switch(Eg(t),t.tag){case 1:return on(t.type)&&vd(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Bo(),Yt(rn),Yt(Ve),Fg(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ig(t),null;case 13:if(Yt(te),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(H(340));Io()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Yt(te),null;case 4:return Bo(),null;case 10:return Lg(t.type._context),null;case 22:case 23:return qg(),null;case 24:return null;default:return null}}var Yc=!1,Ie=!1,YE=typeof WeakSet=="function"?WeakSet:Set,tt=null;function xo(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(i){re(e,t,i)}else n.current=null}function cm(e,t,n){try{n()}catch(i){re(e,t,i)}}var Av=!1;function XE(e,t){if(Yp=pd,e=gk(),Tg(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else t:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var s=i.anchorOffset,r=i.focusNode;i=i.focusOffset;try{n.nodeType,r.nodeType}catch{n=null;break t}var o=0,a=-1,l=-1,c=0,u=0,d=e,h=null;e:for(;;){for(var f;d!==n||s!==0&&d.nodeType!==3||(a=o+s),d!==r||i!==0&&d.nodeType!==3||(l=o+i),d.nodeType===3&&(o+=d.nodeValue.length),(f=d.firstChild)!==null;)h=d,d=f;for(;;){if(d===e)break e;if(h===n&&++c===s&&(a=o),h===r&&++u===i&&(l=o),(f=d.nextSibling)!==null)break;d=h,h=d.parentNode}d=f}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Xp={focusedElem:e,selectionRange:n},pd=!1,tt=t;tt!==null;)if(t=tt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,tt=e;else for(;tt!==null;){t=tt;try{var p=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var m=p.memoizedProps,v=p.memoizedState,y=t.stateNode,g=y.getSnapshotBeforeUpdate(t.elementType===t.type?m:qn(t.type,m),v);y.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(H(163))}}catch(_){re(t,t.return,_)}if(e=t.sibling,e!==null){e.return=t.return,tt=e;break}tt=t.return}return p=Av,Av=!1,p}function ll(e,t,n){var i=t.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var s=i=i.next;do{if((s.tag&e)===e){var r=s.destroy;s.destroy=void 0,r!==void 0&&cm(t,n,r)}s=s.next}while(s!==i)}}function vh(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var i=n.create;n.destroy=i()}n=n.next}while(n!==t)}}function um(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function fS(e){var t=e.alternate;t!==null&&(e.alternate=null,fS(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[fi],delete t[jl],delete t[qp],delete t[DE],delete t[EE])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function pS(e){return e.tag===5||e.tag===3||e.tag===4}function Ov(e){t:for(;;){for(;e.sibling===null;){if(e.return===null||pS(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue t;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function dm(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=yd));else if(i!==4&&(e=e.child,e!==null))for(dm(e,t,n),e=e.sibling;e!==null;)dm(e,t,n),e=e.sibling}function hm(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(i!==4&&(e=e.child,e!==null))for(hm(e,t,n),e=e.sibling;e!==null;)hm(e,t,n),e=e.sibling}var Pe=null,Qn=!1;function ds(e,t,n){for(n=n.child;n!==null;)mS(e,t,n),n=n.sibling}function mS(e,t,n){if(gi&&typeof gi.onCommitFiberUnmount=="function")try{gi.onCommitFiberUnmount(uh,n)}catch{}switch(n.tag){case 5:Ie||xo(n,t);case 6:var i=Pe,s=Qn;Pe=null,ds(e,t,n),Pe=i,Qn=s,Pe!==null&&(Qn?(e=Pe,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Pe.removeChild(n.stateNode));break;case 18:Pe!==null&&(Qn?(e=Pe,n=n.stateNode,e.nodeType===8?kf(e.parentNode,n):e.nodeType===1&&kf(e,n),Al(e)):kf(Pe,n.stateNode));break;case 4:i=Pe,s=Qn,Pe=n.stateNode.containerInfo,Qn=!0,ds(e,t,n),Pe=i,Qn=s;break;case 0:case 11:case 14:case 15:if(!Ie&&(i=n.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){s=i=i.next;do{var r=s,o=r.destroy;r=r.tag,o!==void 0&&(r&2||r&4)&&cm(n,t,o),s=s.next}while(s!==i)}ds(e,t,n);break;case 1:if(!Ie&&(xo(n,t),i=n.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=n.memoizedProps,i.state=n.memoizedState,i.componentWillUnmount()}catch(a){re(n,t,a)}ds(e,t,n);break;case 21:ds(e,t,n);break;case 22:n.mode&1?(Ie=(i=Ie)||n.memoizedState!==null,ds(e,t,n),Ie=i):ds(e,t,n);break;default:ds(e,t,n)}}function Rv(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new YE),t.forEach(function(i){var s=nA.bind(null,e,i);n.has(i)||(n.add(i),i.then(s,s))})}}function Gn(e,t){var n=t.deletions;if(n!==null)for(var i=0;is&&(s=o),i&=~r}if(i=s,i=le()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*GE(i/1960))-i,10e?16:e,ws===null)var i=!1;else{if(e=ws,ws=null,Ed=0,St&6)throw Error(H(331));var s=St;for(St|=4,tt=e.current;tt!==null;){var r=tt,o=r.child;if(tt.flags&16){var a=r.deletions;if(a!==null){for(var l=0;lle()-Kg?Sr(e,0):Xg|=n),an(e,t)}function kS(e,t){t===0&&(e.mode&1?(t=$c,$c<<=1,!($c&130023424)&&($c=4194304)):t=1);var n=Ue();e=ts(e,t),e!==null&&(lc(e,t,n),an(e,n))}function eA(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),kS(e,n)}function nA(e,t){var n=0;switch(e.tag){case 13:var i=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(H(314))}i!==null&&i.delete(t),kS(e,n)}var SS;SS=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||rn.current)nn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return nn=!1,WE(e,t,n);nn=!!(e.flags&131072)}else nn=!1,Gt&&t.flags&1048576&&Pk(t,_d,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;Ku(e,t),e=t.pendingProps;var s=$o(t,Ve.current);Eo(t,n),s=Vg(null,t,i,e,s,n);var r=zg();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,on(i)?(r=!0,xd(t)):r=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,jg(t),s.updater=gh,t.stateNode=s,s._reactInternals=t,nm(t,i,e,n),t=rm(null,t,i,!0,r,n)):(t.tag=0,Gt&&r&&Dg(t),He(null,t,s,n),t=t.child),t;case 16:i=t.elementType;t:{switch(Ku(e,t),e=t.pendingProps,s=i._init,i=s(i._payload),t.type=i,s=t.tag=sA(i),e=qn(i,e),s){case 0:t=sm(null,t,i,e,n);break t;case 1:t=Tv(null,t,i,e,n);break t;case 11:t=Cv(null,t,i,e,n);break t;case 14:t=Pv(null,t,i,qn(i.type,e),n);break t}throw Error(H(306,i,""))}return t;case 0:return i=t.type,s=t.pendingProps,s=t.elementType===i?s:qn(i,s),sm(e,t,i,s,n);case 1:return i=t.type,s=t.pendingProps,s=t.elementType===i?s:qn(i,s),Tv(e,t,i,s,n);case 3:t:{if(aS(t),e===null)throw Error(H(387));i=t.pendingProps,r=t.memoizedState,s=r.element,Ak(e,t),Sd(t,i,null,n);var o=t.memoizedState;if(i=o.element,r.isDehydrated)if(r={element:i,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=r,t.memoizedState=r,t.flags&256){s=Vo(Error(H(423)),t),t=Dv(e,t,i,n,s);break t}else if(i!==s){s=Vo(Error(H(424)),t),t=Dv(e,t,i,n,s);break t}else for(xn=Os(t.stateNode.containerInfo.firstChild),bn=t,Gt=!0,Zn=null,n=Nk(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Io(),i===s){t=es(e,t,n);break t}He(e,t,i,n)}t=t.child}return t;case 5:return jk(t),e===null&&Jp(t),i=t.type,s=t.pendingProps,r=e!==null?e.memoizedProps:null,o=s.children,Kp(i,s)?o=null:r!==null&&Kp(i,r)&&(t.flags|=32),oS(e,t),He(e,t,o,n),t.child;case 6:return e===null&&Jp(t),null;case 13:return lS(e,t,n);case 4:return $g(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Fo(t,null,i,n):He(e,t,i,n),t.child;case 11:return i=t.type,s=t.pendingProps,s=t.elementType===i?s:qn(i,s),Cv(e,t,i,s,n);case 7:return He(e,t,t.pendingProps,n),t.child;case 8:return He(e,t,t.pendingProps.children,n),t.child;case 12:return He(e,t,t.pendingProps.children,n),t.child;case 10:t:{if(i=t.type._context,s=t.pendingProps,r=t.memoizedProps,o=s.value,Bt(wd,i._currentValue),i._currentValue=o,r!==null)if(ii(r.value,o)){if(r.children===s.children&&!rn.current){t=es(e,t,n);break t}}else for(r=t.child,r!==null&&(r.return=t);r!==null;){var a=r.dependencies;if(a!==null){o=r.child;for(var l=a.firstContext;l!==null;){if(l.context===i){if(r.tag===1){l=Gi(-1,n&-n),l.tag=2;var c=r.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}r.lanes|=n,l=r.alternate,l!==null&&(l.lanes|=n),tm(r.return,n,t),a.lanes|=n;break}l=l.next}}else if(r.tag===10)o=r.type===t.type?null:r.child;else if(r.tag===18){if(o=r.return,o===null)throw Error(H(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),tm(o,n,t),o=r.sibling}else o=r.child;if(o!==null)o.return=r;else for(o=r;o!==null;){if(o===t){o=null;break}if(r=o.sibling,r!==null){r.return=o.return,o=r;break}o=o.return}r=o}He(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,i=t.pendingProps.children,Eo(t,n),s=Bn(s),i=i(s),t.flags|=1,He(e,t,i,n),t.child;case 14:return i=t.type,s=qn(i,t.pendingProps),s=qn(i.type,s),Pv(e,t,i,s,n);case 15:return sS(e,t,t.type,t.pendingProps,n);case 17:return i=t.type,s=t.pendingProps,s=t.elementType===i?s:qn(i,s),Ku(e,t),t.tag=1,on(i)?(e=!0,xd(t)):e=!1,Eo(t,n),Rk(t,i,s),nm(t,i,s,n),rm(null,t,i,!0,e,n);case 19:return cS(e,t,n);case 22:return rS(e,t,n)}throw Error(H(156,t.tag))};function MS(e,t){return Qw(e,t)}function iA(e,t,n,i){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function $n(e,t,n,i){return new iA(e,t,n,i)}function Zg(e){return e=e.prototype,!(!e||!e.isReactComponent)}function sA(e){if(typeof e=="function")return Zg(e)?1:0;if(e!=null){if(e=e.$$typeof,e===yg)return 11;if(e===vg)return 14}return 2}function js(e,t){var n=e.alternate;return n===null?(n=$n(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Qu(e,t,n,i,s,r){var o=2;if(i=e,typeof e=="function")Zg(e)&&(o=1);else if(typeof e=="string")o=5;else t:switch(e){case co:return Mr(n.children,s,r,t);case gg:o=8,s|=8;break;case Cp:return e=$n(12,n,t,s|2),e.elementType=Cp,e.lanes=r,e;case Pp:return e=$n(13,n,t,s),e.elementType=Pp,e.lanes=r,e;case Tp:return e=$n(19,n,t,s),e.elementType=Tp,e.lanes=r,e;case Lw:return bh(n,s,r,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Ow:o=10;break t;case Rw:o=9;break t;case yg:o=11;break t;case vg:o=14;break t;case ms:o=16,i=null;break t}throw Error(H(130,e==null?e:typeof e,""))}return t=$n(o,n,t,s),t.elementType=e,t.type=i,t.lanes=r,t}function Mr(e,t,n,i){return e=$n(7,e,i,t),e.lanes=n,e}function bh(e,t,n,i){return e=$n(22,e,i,t),e.elementType=Lw,e.lanes=n,e.stateNode={isHidden:!1},e}function Af(e,t,n){return e=$n(6,e,null,t),e.lanes=n,e}function Of(e,t,n){return t=$n(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function rA(e,t,n,i,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=hf(0),this.expirationTimes=hf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=hf(0),this.identifierPrefix=i,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Jg(e,t,n,i,s,r,o,a,l){return e=new rA(e,t,n,a,l),t===1?(t=1,r===!0&&(t|=8)):t=0,r=$n(3,null,null,t),e.current=r,r.stateNode=e,r.memoizedState={element:i,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},jg(r),e}function oA(e,t,n){var i=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(DS)}catch(e){console.error(e)}}DS(),Pw.exports=kn;var iy=Pw.exports,Vv=iy;Sp.createRoot=Vv.createRoot,Sp.hydrateRoot=Vv.hydrateRoot;/*! * @kurkle/color v0.3.2 * https://github.com/kurkle/color#readme * (c) 2023 Jukka Kurkela * Released under the MIT License - */function dc(e){return e+.5|0}const ks=(e,t,n)=>Math.max(Math.min(e,n),t);function Ka(e){return ks(dc(e*2.55),0,255)}function $s(e){return ks(dc(e*255),0,255)}function $i(e){return ks(dc(e/2.55)/100,0,1)}function zv(e){return ks(dc(e*100),0,100)}const Tn={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},ym=[..."0123456789ABCDEF"],dA=e=>ym[e&15],hA=e=>ym[(e&240)>>4]+ym[e&15],Kc=e=>(e&240)>>4===(e&15),fA=e=>Kc(e.r)&&Kc(e.g)&&Kc(e.b)&&Kc(e.a);function pA(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&Tn[e[1]]*17,g:255&Tn[e[2]]*17,b:255&Tn[e[3]]*17,a:t===5?Tn[e[4]]*17:255}:(t===7||t===9)&&(n={r:Tn[e[1]]<<4|Tn[e[2]],g:Tn[e[3]]<<4|Tn[e[4]],b:Tn[e[5]]<<4|Tn[e[6]],a:t===9?Tn[e[7]]<<4|Tn[e[8]]:255})),n}const mA=(e,t)=>e<255?t(e):"";function gA(e){var t=fA(e)?dA:hA;return e?"#"+t(e.r)+t(e.g)+t(e.b)+mA(e.a,t):void 0}const yA=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function ES(e,t,n){const i=t*Math.min(n,1-n),s=(r,o=(r+e/30)%12)=>n-i*Math.max(Math.min(o-3,9-o,1),-1);return[s(0),s(8),s(4)]}function vA(e,t,n){const i=(s,r=(s+e/60)%6)=>n-n*t*Math.max(Math.min(r,4-r,1),0);return[i(5),i(3),i(1)]}function xA(e,t,n){const i=ES(e,1,.5);let s;for(t+n>1&&(s=1/(t+n),t*=s,n*=s),s=0;s<3;s++)i[s]*=1-t-n,i[s]+=t;return i}function bA(e,t,n,i,s){return e===s?(t-n)/i+(t.5?u/(2-r-o):u/(r+o),l=bA(n,i,s,u,r),l=l*60+.5),[l|0,c||0,a]}function ry(e,t,n,i){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,i)).map($s)}function oy(e,t,n){return ry(ES,e,t,n)}function _A(e,t,n){return ry(xA,e,t,n)}function wA(e,t,n){return ry(vA,e,t,n)}function AS(e){return(e%360+360)%360}function kA(e){const t=yA.exec(e);let n=255,i;if(!t)return;t[5]!==i&&(n=t[6]?Ka(+t[5]):$s(+t[5]));const s=AS(+t[2]),r=+t[3]/100,o=+t[4]/100;return t[1]==="hwb"?i=_A(s,r,o):t[1]==="hsv"?i=wA(s,r,o):i=oy(s,r,o),{r:i[0],g:i[1],b:i[2],a:n}}function SA(e,t){var n=sy(e);n[0]=AS(n[0]+t),n=oy(n),e.r=n[0],e.g=n[1],e.b=n[2]}function MA(e){if(!e)return;const t=sy(e),n=t[0],i=zv(t[1]),s=zv(t[2]);return e.a<255?`hsla(${n}, ${i}%, ${s}%, ${$i(e.a)})`:`hsl(${n}, ${i}%, ${s}%)`}const Wv={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Hv={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function CA(){const e={},t=Object.keys(Hv),n=Object.keys(Wv);let i,s,r,o,a;for(i=0;i>16&255,r>>8&255,r&255]}return e}let Gc;function PA(e){Gc||(Gc=CA(),Gc.transparent=[0,0,0,0]);const t=Gc[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const TA=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function DA(e){const t=TA.exec(e);let n=255,i,s,r;if(t){if(t[7]!==i){const o=+t[7];n=t[8]?Ka(o):ks(o*255,0,255)}return i=+t[1],s=+t[3],r=+t[5],i=255&(t[2]?Ka(i):ks(i,0,255)),s=255&(t[4]?Ka(s):ks(s,0,255)),r=255&(t[6]?Ka(r):ks(r,0,255)),{r:i,g:s,b:r,a:n}}}function EA(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${$i(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const Lf=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,Qr=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function AA(e,t,n){const i=Qr($i(e.r)),s=Qr($i(e.g)),r=Qr($i(e.b));return{r:$s(Lf(i+n*(Qr($i(t.r))-i))),g:$s(Lf(s+n*(Qr($i(t.g))-s))),b:$s(Lf(r+n*(Qr($i(t.b))-r))),a:e.a+n*(t.a-e.a)}}function qc(e,t,n){if(e){let i=sy(e);i[t]=Math.max(0,Math.min(i[t]+i[t]*n,t===0?360:1)),i=oy(i),e.r=i[0],e.g=i[1],e.b=i[2]}}function OS(e,t){return e&&Object.assign(t||{},e)}function Uv(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=$s(e[3]))):(t=OS(e,{r:0,g:0,b:0,a:1}),t.a=$s(t.a)),t}function OA(e){return e.charAt(0)==="r"?DA(e):kA(e)}let LS=class vm{constructor(t){if(t instanceof vm)return t;const n=typeof t;let i;n==="object"?i=Uv(t):n==="string"&&(i=pA(t)||PA(t)||OA(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=OS(this._rgb);return t&&(t.a=$i(t.a)),t}set rgb(t){this._rgb=Uv(t)}rgbString(){return this._valid?EA(this._rgb):void 0}hexString(){return this._valid?gA(this._rgb):void 0}hslString(){return this._valid?MA(this._rgb):void 0}mix(t,n){if(t){const i=this.rgb,s=t.rgb;let r;const o=n===r?.5:n,a=2*o-1,l=i.a-s.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;r=1-c,i.r=255&c*i.r+r*s.r+.5,i.g=255&c*i.g+r*s.g+.5,i.b=255&c*i.b+r*s.b+.5,i.a=o*i.a+(1-o)*s.a,this.rgb=i}return this}interpolate(t,n){return t&&(this._rgb=AA(this._rgb,t._rgb,n)),this}clone(){return new vm(this.rgb)}alpha(t){return this._rgb.a=$s(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=dc(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=n,this}opaquer(t){const n=this._rgb;return n.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return qc(this._rgb,2,t),this}darken(t){return qc(this._rgb,2,-t),this}saturate(t){return qc(this._rgb,1,t),this}desaturate(t){return qc(this._rgb,1,-t),this}rotate(t){return SA(this._rgb,t),this}};/*! + */function hc(e){return e+.5|0}const ks=(e,t,n)=>Math.max(Math.min(e,n),t);function Ka(e){return ks(hc(e*2.55),0,255)}function $s(e){return ks(hc(e*255),0,255)}function $i(e){return ks(hc(e/2.55)/100,0,1)}function zv(e){return ks(hc(e*100),0,100)}const Tn={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},ym=[..."0123456789ABCDEF"],dA=e=>ym[e&15],hA=e=>ym[(e&240)>>4]+ym[e&15],Gc=e=>(e&240)>>4===(e&15),fA=e=>Gc(e.r)&&Gc(e.g)&&Gc(e.b)&&Gc(e.a);function pA(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&Tn[e[1]]*17,g:255&Tn[e[2]]*17,b:255&Tn[e[3]]*17,a:t===5?Tn[e[4]]*17:255}:(t===7||t===9)&&(n={r:Tn[e[1]]<<4|Tn[e[2]],g:Tn[e[3]]<<4|Tn[e[4]],b:Tn[e[5]]<<4|Tn[e[6]],a:t===9?Tn[e[7]]<<4|Tn[e[8]]:255})),n}const mA=(e,t)=>e<255?t(e):"";function gA(e){var t=fA(e)?dA:hA;return e?"#"+t(e.r)+t(e.g)+t(e.b)+mA(e.a,t):void 0}const yA=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function ES(e,t,n){const i=t*Math.min(n,1-n),s=(r,o=(r+e/30)%12)=>n-i*Math.max(Math.min(o-3,9-o,1),-1);return[s(0),s(8),s(4)]}function vA(e,t,n){const i=(s,r=(s+e/60)%6)=>n-n*t*Math.max(Math.min(r,4-r,1),0);return[i(5),i(3),i(1)]}function xA(e,t,n){const i=ES(e,1,.5);let s;for(t+n>1&&(s=1/(t+n),t*=s,n*=s),s=0;s<3;s++)i[s]*=1-t-n,i[s]+=t;return i}function bA(e,t,n,i,s){return e===s?(t-n)/i+(t.5?u/(2-r-o):u/(r+o),l=bA(n,i,s,u,r),l=l*60+.5),[l|0,c||0,a]}function ry(e,t,n,i){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,i)).map($s)}function oy(e,t,n){return ry(ES,e,t,n)}function _A(e,t,n){return ry(xA,e,t,n)}function wA(e,t,n){return ry(vA,e,t,n)}function AS(e){return(e%360+360)%360}function kA(e){const t=yA.exec(e);let n=255,i;if(!t)return;t[5]!==i&&(n=t[6]?Ka(+t[5]):$s(+t[5]));const s=AS(+t[2]),r=+t[3]/100,o=+t[4]/100;return t[1]==="hwb"?i=_A(s,r,o):t[1]==="hsv"?i=wA(s,r,o):i=oy(s,r,o),{r:i[0],g:i[1],b:i[2],a:n}}function SA(e,t){var n=sy(e);n[0]=AS(n[0]+t),n=oy(n),e.r=n[0],e.g=n[1],e.b=n[2]}function MA(e){if(!e)return;const t=sy(e),n=t[0],i=zv(t[1]),s=zv(t[2]);return e.a<255?`hsla(${n}, ${i}%, ${s}%, ${$i(e.a)})`:`hsl(${n}, ${i}%, ${s}%)`}const Wv={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Hv={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function CA(){const e={},t=Object.keys(Hv),n=Object.keys(Wv);let i,s,r,o,a;for(i=0;i>16&255,r>>8&255,r&255]}return e}let qc;function PA(e){qc||(qc=CA(),qc.transparent=[0,0,0,0]);const t=qc[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const TA=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function DA(e){const t=TA.exec(e);let n=255,i,s,r;if(t){if(t[7]!==i){const o=+t[7];n=t[8]?Ka(o):ks(o*255,0,255)}return i=+t[1],s=+t[3],r=+t[5],i=255&(t[2]?Ka(i):ks(i,0,255)),s=255&(t[4]?Ka(s):ks(s,0,255)),r=255&(t[6]?Ka(r):ks(r,0,255)),{r:i,g:s,b:r,a:n}}}function EA(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${$i(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const Rf=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,Qr=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function AA(e,t,n){const i=Qr($i(e.r)),s=Qr($i(e.g)),r=Qr($i(e.b));return{r:$s(Rf(i+n*(Qr($i(t.r))-i))),g:$s(Rf(s+n*(Qr($i(t.g))-s))),b:$s(Rf(r+n*(Qr($i(t.b))-r))),a:e.a+n*(t.a-e.a)}}function Qc(e,t,n){if(e){let i=sy(e);i[t]=Math.max(0,Math.min(i[t]+i[t]*n,t===0?360:1)),i=oy(i),e.r=i[0],e.g=i[1],e.b=i[2]}}function OS(e,t){return e&&Object.assign(t||{},e)}function Uv(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=$s(e[3]))):(t=OS(e,{r:0,g:0,b:0,a:1}),t.a=$s(t.a)),t}function OA(e){return e.charAt(0)==="r"?DA(e):kA(e)}let RS=class vm{constructor(t){if(t instanceof vm)return t;const n=typeof t;let i;n==="object"?i=Uv(t):n==="string"&&(i=pA(t)||PA(t)||OA(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=OS(this._rgb);return t&&(t.a=$i(t.a)),t}set rgb(t){this._rgb=Uv(t)}rgbString(){return this._valid?EA(this._rgb):void 0}hexString(){return this._valid?gA(this._rgb):void 0}hslString(){return this._valid?MA(this._rgb):void 0}mix(t,n){if(t){const i=this.rgb,s=t.rgb;let r;const o=n===r?.5:n,a=2*o-1,l=i.a-s.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;r=1-c,i.r=255&c*i.r+r*s.r+.5,i.g=255&c*i.g+r*s.g+.5,i.b=255&c*i.b+r*s.b+.5,i.a=o*i.a+(1-o)*s.a,this.rgb=i}return this}interpolate(t,n){return t&&(this._rgb=AA(this._rgb,t._rgb,n)),this}clone(){return new vm(this.rgb)}alpha(t){return this._rgb.a=$s(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=hc(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=n,this}opaquer(t){const n=this._rgb;return n.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Qc(this._rgb,2,t),this}darken(t){return Qc(this._rgb,2,-t),this}saturate(t){return Qc(this._rgb,1,t),this}desaturate(t){return Qc(this._rgb,1,-t),this}rotate(t){return SA(this._rgb,t),this}};/*! * Chart.js v4.4.2 * https://www.chartjs.org * (c) 2024 Chart.js Contributors * Released under the MIT License - */function Di(){}const LA=(()=>{let e=0;return()=>e++})();function bt(e){return e===null||typeof e>"u"}function Ut(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 gt(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function oe(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function mn(e,t){return oe(e)?e:t}function at(e,t){return typeof e>"u"?t:e}const RA=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,RS=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function $t(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function Et(e,t,n,i){let s,r,o;if(Ut(e))if(r=e.length,i)for(s=r-1;s>=0;s--)t.call(n,e[s],s);else for(s=0;se,x:e=>e.x,y:e=>e.y};function $A(e){const t=e.split("."),n=[];let i="";for(const s of t)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(n.push(i),i="");return n}function IA(e){const t=$A(e);return n=>{for(const i of t){if(i==="")break;n=n&&n[i]}return n}}function zs(e,t){return(Yv[t]||(Yv[t]=IA(t)))(e)}function ay(e){return e.charAt(0).toUpperCase()+e.slice(1)}const zl=e=>typeof e<"u",Ws=e=>typeof e=="function",Xv=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function FA(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const Kt=Math.PI,Xt=2*Kt,BA=Xt+Kt,Nd=Number.POSITIVE_INFINITY,VA=Kt/180,ue=Kt/2,sr=Kt/4,Kv=Kt*2/3,Ss=Math.log10,vi=Math.sign;function dl(e,t,n){return Math.abs(e-t)s-r).pop(),t}function Wo(e){return!isNaN(parseFloat(e))&&isFinite(e)}function WA(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function jS(e,t,n){let i,s,r;for(i=0,s=e.length;il&&c=Math.min(t,n)-i&&e<=Math.max(t,n)+i}function cy(e,t,n){n=n||(o=>e[o]1;)r=s+i>>1,n(r)?s=r:i=r;return{lo:s,hi:i}}const zi=(e,t,n,i)=>cy(e,n,i?s=>{const r=e[s][t];return re[s][t]cy(e,n,i=>e[i][t]>=n);function XA(e,t,n){let i=0,s=e.length;for(;ii&&e[s-1]>n;)s--;return i>0||s{const i="_onData"+ay(n),s=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...r){const o=s.apply(this,r);return e._chartjs.listeners.forEach(a=>{typeof a[i]=="function"&&a[i](...r)}),o}})})}function Qv(e,t){const n=e._chartjs;if(!n)return;const i=n.listeners,s=i.indexOf(t);s!==-1&&i.splice(s,1),!(i.length>0)&&(IS.forEach(r=>{delete e[r]}),delete e._chartjs)}function FS(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const BS=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function VS(e,t){let n=[],i=!1;return function(...s){n=s,i||(i=!0,BS.call(window,()=>{i=!1,e.apply(t,n)}))}}function GA(e,t){let n;return function(...i){return t?(clearTimeout(n),n=setTimeout(e,t,i)):e.apply(this,i),t}}const uy=e=>e==="start"?"left":e==="end"?"right":"center",Ne=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,qA=(e,t,n,i)=>e===(i?"left":"right")?n:e==="center"?(t+n)/2:t;function zS(e,t,n){const i=t.length;let s=0,r=i;if(e._sorted){const{iScale:o,_parsed:a}=e,l=o.axis,{min:c,max:u,minDefined:d,maxDefined:h}=o.getUserBounds();d&&(s=we(Math.min(zi(a,l,c).lo,n?i:zi(t,l,o.getPixelForValue(c)).lo),0,i-1)),h?r=we(Math.max(zi(a,o.axis,u,!0).hi+1,n?0:zi(t,l,o.getPixelForValue(u),!0).hi+1),s,i)-s:r=i-s}return{start:s,count:r}}function WS(e){const{xScale:t,yScale:n,_scaleRanges:i}=e,s={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!i)return e._scaleRanges=s,!0;const r=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==n.min||i.ymax!==n.max;return Object.assign(i,s),r}const Qc=e=>e===0||e===1,Zv=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*Xt/n)),Jv=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*Xt/n)+1,hl={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*ue)+1,easeOutSine:e=>Math.sin(e*ue),easeInOutSine:e=>-.5*(Math.cos(Kt*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>Qc(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=>Qc(e)?e:Zv(e,.075,.3),easeOutElastic:e=>Qc(e)?e:Jv(e,.075,.3),easeInOutElastic(e){return Qc(e)?e:e<.5?.5*Zv(e*2,.1125,.45):.5+.5*Jv(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-hl.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?hl.easeInBounce(e*2)*.5:hl.easeOutBounce(e*2-1)*.5+.5};function dy(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function tx(e){return dy(e)?e:new LS(e)}function Rf(e){return dy(e)?e:new LS(e).saturate(.5).darken(.1).hexString()}const QA=["x","y","borderWidth","radius","tension"],ZA=["color","borderColor","backgroundColor"];function JA(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:ZA},numbers:{type:"number",properties:QA}}),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 tO(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const ex=new Map;function eO(e,t){t=t||{};const n=e+JSON.stringify(t);let i=ex.get(n);return i||(i=new Intl.NumberFormat(e,t),ex.set(n,i)),i}function hc(e,t,n){return eO(t,n).format(e)}const HS={values(e){return Ut(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const i=this.chart.options.locale;let s,r=e;if(n.length>1){const c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),r=nO(e,n)}const o=Ss(Math.abs(r)),a=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),hc(e,i,l)},logarithmic(e,t,n){if(e===0)return"0";const i=n[t].significand||e/Math.pow(10,Math.floor(Ss(e)));return[1,2,3,5,10,15].includes(i)||t>.8*n.length?HS.numeric.call(this,e,t,n):""}};function nO(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 Mh={formatters:HS};function iO(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:Mh.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 Fr=Object.create(null),bm=Object.create(null);function fl(e,t){if(!t)return e;const n=t.split(".");for(let i=0,s=n.length;ii.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=(i,s)=>Rf(s.backgroundColor),this.hoverBorderColor=(i,s)=>Rf(s.borderColor),this.hoverColor=(i,s)=>Rf(s.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 Nf(this,t,n)}get(t){return fl(this,t)}describe(t,n){return Nf(bm,t,n)}override(t,n){return Nf(Fr,t,n)}route(t,n,i,s){const r=fl(this,t),o=fl(this,i),a="_"+n;Object.defineProperties(r,{[a]:{value:r[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],c=o[s];return gt(l)?Object.assign({},c,l):at(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}};var ne=new sO({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[JA,tO,iO]);function rO(e){return!e||bt(e.size)||bt(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function jd(e,t,n,i,s){let r=t[s];return r||(r=t[s]=e.measureText(s).width,n.push(s)),r>i&&(i=r),i}function oO(e,t,n,i){i=i||{};let s=i.data=i.data||{},r=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(s=i.data={},r=i.garbageCollect=[],i.font=t),e.save(),e.font=t;let o=0;const a=n.length;let l,c,u,d,h;for(l=0;ln.length){for(l=0;l0&&e.stroke()}}function Wi(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.xt.top-n&&e.y0&&r.strokeColor!=="";let l,c;for(e.save(),e.font=s.string,cO(e,r),l=0;l+e||0;function hy(e,t){const n={},i=gt(t),s=i?Object.keys(t):t,r=gt(e)?i?o=>at(e[o],e[t[o]]):o=>e[o]:()=>e;for(const o of s)n[o]=mO(r(o));return n}function YS(e){return hy(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Cr(e){return hy(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Ae(e){const t=YS(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function ge(e,t){e=e||{},t=t||ne.font;let n=at(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let i=at(e.style,t.style);i&&!(""+i).match(fO)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:at(e.family,t.family),lineHeight:pO(at(e.lineHeight,t.lineHeight),n),size:n,style:i,weight:at(e.weight,t.weight),string:""};return s.string=rO(s),s}function Ht(e,t,n,i){let s=!0,r,o,a;for(r=0,o=e.length;rn&&a===0?0:a+l;return{min:o(i,-Math.abs(r)),max:o(s,r)}}function Qs(e,t){return Object.assign(Object.create(e),t)}function fy(e,t=[""],n,i,s=()=>e[0]){const r=n||e;typeof i>"u"&&(i=qS("_fallback",e));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:r,_fallback:i,_getTarget:s,override:a=>fy([a,...e],t,r,i)};return new Proxy(o,{deleteProperty(a,l){return delete a[l],delete a._keys,delete e[0][l],!0},get(a,l){return KS(a,l,()=>SO(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return sx(a).includes(l)},ownKeys(a){return sx(a)},set(a,l,c){const u=a._storage||(a._storage=s());return a[l]=u[l]=c,delete a._keys,!0}})}function Ho(e,t,n,i){const s={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:XS(e,i),setContext:r=>Ho(e,r,n,i),override:r=>Ho(e.override(r),t,n,i)};return new Proxy(s,{deleteProperty(r,o){return delete r[o],delete e[o],!0},get(r,o,a){return KS(r,o,()=>vO(r,o,a))},getOwnPropertyDescriptor(r,o){return r._descriptors.allKeys?Reflect.has(e,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,o)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(r,o){return Reflect.has(e,o)},ownKeys(){return Reflect.ownKeys(e)},set(r,o,a){return e[o]=a,delete r[o],!0}})}function XS(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:i=t.indexable,_allKeys:s=t.allKeys}=e;return{allKeys:s,scriptable:n,indexable:i,isScriptable:Ws(n)?n:()=>n,isIndexable:Ws(i)?i:()=>i}}const yO=(e,t)=>e?e+ay(t):t,py=(e,t)=>gt(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function KS(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];const i=n();return e[t]=i,i}function vO(e,t,n){const{_proxy:i,_context:s,_subProxy:r,_descriptors:o}=e;let a=i[t];return Ws(a)&&o.isScriptable(t)&&(a=xO(t,a,e,n)),Ut(a)&&a.length&&(a=bO(t,a,e,o.isIndexable)),py(t,a)&&(a=Ho(a,s,r&&r[t],o)),a}function xO(e,t,n,i){const{_proxy:s,_context:r,_subProxy:o,_stack:a}=n;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);a.add(e);let l=t(r,o||i);return a.delete(e),py(e,l)&&(l=my(s._scopes,s,e,l)),l}function bO(e,t,n,i){const{_proxy:s,_context:r,_subProxy:o,_descriptors:a}=n;if(typeof r.index<"u"&&i(e))return t[r.index%t.length];if(gt(t[0])){const l=t,c=s._scopes.filter(u=>u!==l);t=[];for(const u of l){const d=my(c,s,e,u);t.push(Ho(d,r,o&&o[e],a))}}return t}function GS(e,t,n){return Ws(e)?e(t,n):e}const _O=(e,t)=>e===!0?t:typeof e=="string"?zs(t,e):void 0;function wO(e,t,n,i,s){for(const r of t){const o=_O(n,r);if(o){e.add(o);const a=GS(o._fallback,n,s);if(typeof a<"u"&&a!==n&&a!==i)return a}else if(o===!1&&typeof i<"u"&&n!==i)return null}return!1}function my(e,t,n,i){const s=t._rootScopes,r=GS(t._fallback,n,i),o=[...e,...s],a=new Set;a.add(i);let l=ix(a,o,n,r||n,i);return l===null||typeof r<"u"&&r!==n&&(l=ix(a,o,r,l,i),l===null)?!1:fy(Array.from(a),[""],s,r,()=>kO(t,n,i))}function ix(e,t,n,i,s){for(;n;)n=wO(e,t,n,i,s);return n}function kO(e,t,n){const i=e._getTarget();t in i||(i[t]={});const s=i[t];return Ut(s)&>(n)?n:s||{}}function SO(e,t,n,i){let s;for(const r of t)if(s=qS(yO(r,e),n),typeof s<"u")return py(e,s)?my(n,i,e,s):s}function qS(e,t){for(const n of t){if(!n)continue;const i=n[e];if(typeof i<"u")return i}}function sx(e){let t=e._keys;return t||(t=e._keys=MO(e._scopes)),t}function MO(e){const t=new Set;for(const n of e)for(const i of Object.keys(n).filter(s=>!s.startsWith("_")))t.add(i);return Array.from(t)}function QS(e,t,n,i){const{iScale:s}=e,{key:r="r"}=this._parsing,o=new Array(i);let a,l,c,u;for(a=0,l=i;ate==="x"?"y":"x";function PO(e,t,n,i){const s=e.skip?t:e,r=t,o=n.skip?t:n,a=xm(r,s),l=xm(o,r);let c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const d=i*c,h=i*u;return{previous:{x:r.x-d*(o.x-s.x),y:r.y-d*(o.y-s.y)},next:{x:r.x+h*(o.x-s.x),y:r.y+h*(o.y-s.y)}}}function TO(e,t,n){const i=e.length;let s,r,o,a,l,c=Uo(e,0);for(let u=0;u!c.skip)),t.cubicInterpolationMode==="monotone")EO(e,s);else{let c=i?e[e.length-1]:e[0];for(r=0,o=e.length;re.ownerDocument.defaultView.getComputedStyle(e,null);function LO(e,t){return Th(e).getPropertyValue(t)}const RO=["top","right","bottom","left"];function Pr(e,t,n){const i={};n=n?"-"+n:"";for(let s=0;s<4;s++){const r=RO[s];i[r]=parseFloat(e[t+"-"+r+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const NO=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function jO(e,t){const n=e.touches,i=n&&n.length?n[0]:e,{offsetX:s,offsetY:r}=i;let o=!1,a,l;if(NO(s,r,e.target))a=s,l=r;else{const c=t.getBoundingClientRect();a=i.clientX-c.left,l=i.clientY-c.top,o=!0}return{x:a,y:l,box:o}}function fr(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:i}=t,s=Th(n),r=s.boxSizing==="border-box",o=Pr(s,"padding"),a=Pr(s,"border","width"),{x:l,y:c,box:u}=jO(e,n),d=o.left+(u&&a.left),h=o.top+(u&&a.top);let{width:f,height:p}=t;return r&&(f-=o.width+a.width,p-=o.height+a.height),{x:Math.round((l-d)/f*n.width/i),y:Math.round((c-h)/p*n.height/i)}}function $O(e,t,n){let i,s;if(t===void 0||n===void 0){const r=yy(e);if(!r)t=e.clientWidth,n=e.clientHeight;else{const o=r.getBoundingClientRect(),a=Th(r),l=Pr(a,"border","width"),c=Pr(a,"padding");t=o.width-c.width-l.width,n=o.height-c.height-l.height,i=$d(a.maxWidth,r,"clientWidth"),s=$d(a.maxHeight,r,"clientHeight")}}return{width:t,height:n,maxWidth:i||Nd,maxHeight:s||Nd}}const Jc=e=>Math.round(e*10)/10;function IO(e,t,n,i){const s=Th(e),r=Pr(s,"margin"),o=$d(s.maxWidth,e,"clientWidth")||Nd,a=$d(s.maxHeight,e,"clientHeight")||Nd,l=$O(e,t,n);let{width:c,height:u}=l;if(s.boxSizing==="content-box"){const h=Pr(s,"border","width"),f=Pr(s,"padding");c-=f.width+h.width,u-=f.height+h.height}return c=Math.max(0,c-r.width),u=Math.max(0,i?c/i:u-r.height),c=Jc(Math.min(c,o,l.maxWidth)),u=Jc(Math.min(u,a,l.maxHeight)),c&&!u&&(u=Jc(c/2)),(t!==void 0||n!==void 0)&&i&&l.height&&u>l.height&&(u=l.height,c=Jc(Math.floor(u*i))),{width:c,height:u}}function rx(e,t,n){const i=t||1,s=Math.floor(e.height*i),r=Math.floor(e.width*i);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!==i||o.height!==s||o.width!==r?(e.currentDevicePixelRatio=i,o.height=s,o.width=r,e.ctx.setTransform(i,0,0,i,0,0),!0):!1}const FO=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};gy()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function ox(e,t){const n=LO(e,t),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function pr(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function BO(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:i==="middle"?n<.5?e.y:t.y:i==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function VO(e,t,n,i){const s={x:e.cp2x,y:e.cp2y},r={x:t.cp1x,y:t.cp1y},o=pr(e,s,n),a=pr(s,r,n),l=pr(r,t,n),c=pr(o,a,n),u=pr(a,l,n);return pr(c,u,n)}const zO=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,i){return n-i},leftForLtr(n,i){return n-i}}},WO=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function Oo(e,t,n){return e?zO(t,n):WO()}function JS(e,t){let n,i;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,i=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=i)}function tM(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function eM(e){return e==="angle"?{between:Wl,compare:HA,normalize:yn}:{between:Vi,compare:(t,n)=>t-n,normalize:t=>t}}function ax({start:e,end:t,count:n,loop:i,style:s}){return{start:e%n,end:t%n,loop:i&&(t-e+1)%n===0,style:s}}function HO(e,t,n){const{property:i,start:s,end:r}=n,{between:o,normalize:a}=eM(i),l=t.length;let{start:c,end:u,loop:d}=e,h,f;if(d){for(c+=l,u+=l,h=0,f=l;hl(s,x,y)&&a(s,x)!==0,w=()=>a(r,y)===0||l(r,x,y),S=()=>m||_(),C=()=>!m||w();for(let M=u,P=u;M<=d;++M)g=t[M%o],!g.skip&&(y=c(g[i]),y!==x&&(m=l(y,s,r),v===null&&S()&&(v=a(y,s)===0?M:P),v!==null&&C()&&(p.push(ax({start:v,end:M,loop:h,count:o,style:f})),v=null),P=M,x=y));return v!==null&&p.push(ax({start:v,end:d,loop:h,count:o,style:f})),p}function iM(e,t){const n=[],i=e.segments;for(let s=0;ss&&e[r%t].skip;)r--;return r%=t,{start:s,end:r}}function YO(e,t,n,i){const s=e.length,r=[];let o=t,a=e[t],l;for(l=t+1;l<=n;++l){const c=e[l%s];c.skip||c.stop?a.skip||(i=!1,r.push({start:t%s,end:(l-1)%s,loop:i}),t=o=c.stop?l:null):(o=l,a.skip&&(t=l)),a=c}return o!==null&&r.push({start:t%s,end:o%s,loop:i}),r}function XO(e,t){const n=e.points,i=e.options.spanGaps,s=n.length;if(!s)return[];const r=!!e._loop,{start:o,end:a}=UO(n,s,r,i);if(i===!0)return lx(e,[{start:o,end:a,loop:r}],n,t);const l=a{let e=0;return()=>e++})();function bt(e){return e===null||typeof e>"u"}function Ut(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 gt(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function oe(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function mn(e,t){return oe(e)?e:t}function at(e,t){return typeof e>"u"?t:e}const LA=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,LS=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function $t(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function Et(e,t,n,i){let s,r,o;if(Ut(e))if(r=e.length,i)for(s=r-1;s>=0;s--)t.call(n,e[s],s);else for(s=0;se,x:e=>e.x,y:e=>e.y};function $A(e){const t=e.split("."),n=[];let i="";for(const s of t)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(n.push(i),i="");return n}function IA(e){const t=$A(e);return n=>{for(const i of t){if(i==="")break;n=n&&n[i]}return n}}function zs(e,t){return(Yv[t]||(Yv[t]=IA(t)))(e)}function ay(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Wl=e=>typeof e<"u",Ws=e=>typeof e=="function",Xv=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function FA(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const Kt=Math.PI,Xt=2*Kt,BA=Xt+Kt,Nd=Number.POSITIVE_INFINITY,VA=Kt/180,ue=Kt/2,sr=Kt/4,Kv=Kt*2/3,Ss=Math.log10,vi=Math.sign;function hl(e,t,n){return Math.abs(e-t)s-r).pop(),t}function Wo(e){return!isNaN(parseFloat(e))&&isFinite(e)}function WA(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function jS(e,t,n){let i,s,r;for(i=0,s=e.length;il&&c=Math.min(t,n)-i&&e<=Math.max(t,n)+i}function cy(e,t,n){n=n||(o=>e[o]1;)r=s+i>>1,n(r)?s=r:i=r;return{lo:s,hi:i}}const zi=(e,t,n,i)=>cy(e,n,i?s=>{const r=e[s][t];return re[s][t]cy(e,n,i=>e[i][t]>=n);function XA(e,t,n){let i=0,s=e.length;for(;ii&&e[s-1]>n;)s--;return i>0||s{const i="_onData"+ay(n),s=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...r){const o=s.apply(this,r);return e._chartjs.listeners.forEach(a=>{typeof a[i]=="function"&&a[i](...r)}),o}})})}function Qv(e,t){const n=e._chartjs;if(!n)return;const i=n.listeners,s=i.indexOf(t);s!==-1&&i.splice(s,1),!(i.length>0)&&(IS.forEach(r=>{delete e[r]}),delete e._chartjs)}function FS(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const BS=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function VS(e,t){let n=[],i=!1;return function(...s){n=s,i||(i=!0,BS.call(window,()=>{i=!1,e.apply(t,n)}))}}function GA(e,t){let n;return function(...i){return t?(clearTimeout(n),n=setTimeout(e,t,i)):e.apply(this,i),t}}const uy=e=>e==="start"?"left":e==="end"?"right":"center",Ne=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,qA=(e,t,n,i)=>e===(i?"left":"right")?n:e==="center"?(t+n)/2:t;function zS(e,t,n){const i=t.length;let s=0,r=i;if(e._sorted){const{iScale:o,_parsed:a}=e,l=o.axis,{min:c,max:u,minDefined:d,maxDefined:h}=o.getUserBounds();d&&(s=we(Math.min(zi(a,l,c).lo,n?i:zi(t,l,o.getPixelForValue(c)).lo),0,i-1)),h?r=we(Math.max(zi(a,o.axis,u,!0).hi+1,n?0:zi(t,l,o.getPixelForValue(u),!0).hi+1),s,i)-s:r=i-s}return{start:s,count:r}}function WS(e){const{xScale:t,yScale:n,_scaleRanges:i}=e,s={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!i)return e._scaleRanges=s,!0;const r=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==n.min||i.ymax!==n.max;return Object.assign(i,s),r}const Zc=e=>e===0||e===1,Zv=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*Xt/n)),Jv=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*Xt/n)+1,fl={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*ue)+1,easeOutSine:e=>Math.sin(e*ue),easeInOutSine:e=>-.5*(Math.cos(Kt*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>Zc(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=>Zc(e)?e:Zv(e,.075,.3),easeOutElastic:e=>Zc(e)?e:Jv(e,.075,.3),easeInOutElastic(e){return Zc(e)?e:e<.5?.5*Zv(e*2,.1125,.45):.5+.5*Jv(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-fl.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?fl.easeInBounce(e*2)*.5:fl.easeOutBounce(e*2-1)*.5+.5};function dy(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function tx(e){return dy(e)?e:new RS(e)}function Lf(e){return dy(e)?e:new RS(e).saturate(.5).darken(.1).hexString()}const QA=["x","y","borderWidth","radius","tension"],ZA=["color","borderColor","backgroundColor"];function JA(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:ZA},numbers:{type:"number",properties:QA}}),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 tO(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const ex=new Map;function eO(e,t){t=t||{};const n=e+JSON.stringify(t);let i=ex.get(n);return i||(i=new Intl.NumberFormat(e,t),ex.set(n,i)),i}function fc(e,t,n){return eO(t,n).format(e)}const HS={values(e){return Ut(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const i=this.chart.options.locale;let s,r=e;if(n.length>1){const c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),r=nO(e,n)}const o=Ss(Math.abs(r)),a=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),fc(e,i,l)},logarithmic(e,t,n){if(e===0)return"0";const i=n[t].significand||e/Math.pow(10,Math.floor(Ss(e)));return[1,2,3,5,10,15].includes(i)||t>.8*n.length?HS.numeric.call(this,e,t,n):""}};function nO(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 Mh={formatters:HS};function iO(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:Mh.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 Fr=Object.create(null),bm=Object.create(null);function pl(e,t){if(!t)return e;const n=t.split(".");for(let i=0,s=n.length;ii.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=(i,s)=>Lf(s.backgroundColor),this.hoverBorderColor=(i,s)=>Lf(s.borderColor),this.hoverColor=(i,s)=>Lf(s.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 Nf(this,t,n)}get(t){return pl(this,t)}describe(t,n){return Nf(bm,t,n)}override(t,n){return Nf(Fr,t,n)}route(t,n,i,s){const r=pl(this,t),o=pl(this,i),a="_"+n;Object.defineProperties(r,{[a]:{value:r[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],c=o[s];return gt(l)?Object.assign({},c,l):at(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}};var ne=new sO({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[JA,tO,iO]);function rO(e){return!e||bt(e.size)||bt(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function jd(e,t,n,i,s){let r=t[s];return r||(r=t[s]=e.measureText(s).width,n.push(s)),r>i&&(i=r),i}function oO(e,t,n,i){i=i||{};let s=i.data=i.data||{},r=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(s=i.data={},r=i.garbageCollect=[],i.font=t),e.save(),e.font=t;let o=0;const a=n.length;let l,c,u,d,h;for(l=0;ln.length){for(l=0;l0&&e.stroke()}}function Wi(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.xt.top-n&&e.y0&&r.strokeColor!=="";let l,c;for(e.save(),e.font=s.string,cO(e,r),l=0;l+e||0;function hy(e,t){const n={},i=gt(t),s=i?Object.keys(t):t,r=gt(e)?i?o=>at(e[o],e[t[o]]):o=>e[o]:()=>e;for(const o of s)n[o]=mO(r(o));return n}function YS(e){return hy(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Cr(e){return hy(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Ae(e){const t=YS(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function ge(e,t){e=e||{},t=t||ne.font;let n=at(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let i=at(e.style,t.style);i&&!(""+i).match(fO)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:at(e.family,t.family),lineHeight:pO(at(e.lineHeight,t.lineHeight),n),size:n,style:i,weight:at(e.weight,t.weight),string:""};return s.string=rO(s),s}function Ht(e,t,n,i){let s=!0,r,o,a;for(r=0,o=e.length;rn&&a===0?0:a+l;return{min:o(i,-Math.abs(r)),max:o(s,r)}}function Qs(e,t){return Object.assign(Object.create(e),t)}function fy(e,t=[""],n,i,s=()=>e[0]){const r=n||e;typeof i>"u"&&(i=qS("_fallback",e));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:r,_fallback:i,_getTarget:s,override:a=>fy([a,...e],t,r,i)};return new Proxy(o,{deleteProperty(a,l){return delete a[l],delete a._keys,delete e[0][l],!0},get(a,l){return KS(a,l,()=>SO(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return sx(a).includes(l)},ownKeys(a){return sx(a)},set(a,l,c){const u=a._storage||(a._storage=s());return a[l]=u[l]=c,delete a._keys,!0}})}function Ho(e,t,n,i){const s={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:XS(e,i),setContext:r=>Ho(e,r,n,i),override:r=>Ho(e.override(r),t,n,i)};return new Proxy(s,{deleteProperty(r,o){return delete r[o],delete e[o],!0},get(r,o,a){return KS(r,o,()=>vO(r,o,a))},getOwnPropertyDescriptor(r,o){return r._descriptors.allKeys?Reflect.has(e,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,o)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(r,o){return Reflect.has(e,o)},ownKeys(){return Reflect.ownKeys(e)},set(r,o,a){return e[o]=a,delete r[o],!0}})}function XS(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:i=t.indexable,_allKeys:s=t.allKeys}=e;return{allKeys:s,scriptable:n,indexable:i,isScriptable:Ws(n)?n:()=>n,isIndexable:Ws(i)?i:()=>i}}const yO=(e,t)=>e?e+ay(t):t,py=(e,t)=>gt(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function KS(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];const i=n();return e[t]=i,i}function vO(e,t,n){const{_proxy:i,_context:s,_subProxy:r,_descriptors:o}=e;let a=i[t];return Ws(a)&&o.isScriptable(t)&&(a=xO(t,a,e,n)),Ut(a)&&a.length&&(a=bO(t,a,e,o.isIndexable)),py(t,a)&&(a=Ho(a,s,r&&r[t],o)),a}function xO(e,t,n,i){const{_proxy:s,_context:r,_subProxy:o,_stack:a}=n;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);a.add(e);let l=t(r,o||i);return a.delete(e),py(e,l)&&(l=my(s._scopes,s,e,l)),l}function bO(e,t,n,i){const{_proxy:s,_context:r,_subProxy:o,_descriptors:a}=n;if(typeof r.index<"u"&&i(e))return t[r.index%t.length];if(gt(t[0])){const l=t,c=s._scopes.filter(u=>u!==l);t=[];for(const u of l){const d=my(c,s,e,u);t.push(Ho(d,r,o&&o[e],a))}}return t}function GS(e,t,n){return Ws(e)?e(t,n):e}const _O=(e,t)=>e===!0?t:typeof e=="string"?zs(t,e):void 0;function wO(e,t,n,i,s){for(const r of t){const o=_O(n,r);if(o){e.add(o);const a=GS(o._fallback,n,s);if(typeof a<"u"&&a!==n&&a!==i)return a}else if(o===!1&&typeof i<"u"&&n!==i)return null}return!1}function my(e,t,n,i){const s=t._rootScopes,r=GS(t._fallback,n,i),o=[...e,...s],a=new Set;a.add(i);let l=ix(a,o,n,r||n,i);return l===null||typeof r<"u"&&r!==n&&(l=ix(a,o,r,l,i),l===null)?!1:fy(Array.from(a),[""],s,r,()=>kO(t,n,i))}function ix(e,t,n,i,s){for(;n;)n=wO(e,t,n,i,s);return n}function kO(e,t,n){const i=e._getTarget();t in i||(i[t]={});const s=i[t];return Ut(s)&>(n)?n:s||{}}function SO(e,t,n,i){let s;for(const r of t)if(s=qS(yO(r,e),n),typeof s<"u")return py(e,s)?my(n,i,e,s):s}function qS(e,t){for(const n of t){if(!n)continue;const i=n[e];if(typeof i<"u")return i}}function sx(e){let t=e._keys;return t||(t=e._keys=MO(e._scopes)),t}function MO(e){const t=new Set;for(const n of e)for(const i of Object.keys(n).filter(s=>!s.startsWith("_")))t.add(i);return Array.from(t)}function QS(e,t,n,i){const{iScale:s}=e,{key:r="r"}=this._parsing,o=new Array(i);let a,l,c,u;for(a=0,l=i;ate==="x"?"y":"x";function PO(e,t,n,i){const s=e.skip?t:e,r=t,o=n.skip?t:n,a=xm(r,s),l=xm(o,r);let c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const d=i*c,h=i*u;return{previous:{x:r.x-d*(o.x-s.x),y:r.y-d*(o.y-s.y)},next:{x:r.x+h*(o.x-s.x),y:r.y+h*(o.y-s.y)}}}function TO(e,t,n){const i=e.length;let s,r,o,a,l,c=Uo(e,0);for(let u=0;u!c.skip)),t.cubicInterpolationMode==="monotone")EO(e,s);else{let c=i?e[e.length-1]:e[0];for(r=0,o=e.length;re.ownerDocument.defaultView.getComputedStyle(e,null);function RO(e,t){return Th(e).getPropertyValue(t)}const LO=["top","right","bottom","left"];function Pr(e,t,n){const i={};n=n?"-"+n:"";for(let s=0;s<4;s++){const r=LO[s];i[r]=parseFloat(e[t+"-"+r+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const NO=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function jO(e,t){const n=e.touches,i=n&&n.length?n[0]:e,{offsetX:s,offsetY:r}=i;let o=!1,a,l;if(NO(s,r,e.target))a=s,l=r;else{const c=t.getBoundingClientRect();a=i.clientX-c.left,l=i.clientY-c.top,o=!0}return{x:a,y:l,box:o}}function fr(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:i}=t,s=Th(n),r=s.boxSizing==="border-box",o=Pr(s,"padding"),a=Pr(s,"border","width"),{x:l,y:c,box:u}=jO(e,n),d=o.left+(u&&a.left),h=o.top+(u&&a.top);let{width:f,height:p}=t;return r&&(f-=o.width+a.width,p-=o.height+a.height),{x:Math.round((l-d)/f*n.width/i),y:Math.round((c-h)/p*n.height/i)}}function $O(e,t,n){let i,s;if(t===void 0||n===void 0){const r=yy(e);if(!r)t=e.clientWidth,n=e.clientHeight;else{const o=r.getBoundingClientRect(),a=Th(r),l=Pr(a,"border","width"),c=Pr(a,"padding");t=o.width-c.width-l.width,n=o.height-c.height-l.height,i=$d(a.maxWidth,r,"clientWidth"),s=$d(a.maxHeight,r,"clientHeight")}}return{width:t,height:n,maxWidth:i||Nd,maxHeight:s||Nd}}const tu=e=>Math.round(e*10)/10;function IO(e,t,n,i){const s=Th(e),r=Pr(s,"margin"),o=$d(s.maxWidth,e,"clientWidth")||Nd,a=$d(s.maxHeight,e,"clientHeight")||Nd,l=$O(e,t,n);let{width:c,height:u}=l;if(s.boxSizing==="content-box"){const h=Pr(s,"border","width"),f=Pr(s,"padding");c-=f.width+h.width,u-=f.height+h.height}return c=Math.max(0,c-r.width),u=Math.max(0,i?c/i:u-r.height),c=tu(Math.min(c,o,l.maxWidth)),u=tu(Math.min(u,a,l.maxHeight)),c&&!u&&(u=tu(c/2)),(t!==void 0||n!==void 0)&&i&&l.height&&u>l.height&&(u=l.height,c=tu(Math.floor(u*i))),{width:c,height:u}}function rx(e,t,n){const i=t||1,s=Math.floor(e.height*i),r=Math.floor(e.width*i);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!==i||o.height!==s||o.width!==r?(e.currentDevicePixelRatio=i,o.height=s,o.width=r,e.ctx.setTransform(i,0,0,i,0,0),!0):!1}const FO=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};gy()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function ox(e,t){const n=RO(e,t),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function pr(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function BO(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:i==="middle"?n<.5?e.y:t.y:i==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function VO(e,t,n,i){const s={x:e.cp2x,y:e.cp2y},r={x:t.cp1x,y:t.cp1y},o=pr(e,s,n),a=pr(s,r,n),l=pr(r,t,n),c=pr(o,a,n),u=pr(a,l,n);return pr(c,u,n)}const zO=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,i){return n-i},leftForLtr(n,i){return n-i}}},WO=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function Oo(e,t,n){return e?zO(t,n):WO()}function JS(e,t){let n,i;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,i=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=i)}function tM(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function eM(e){return e==="angle"?{between:Hl,compare:HA,normalize:yn}:{between:Vi,compare:(t,n)=>t-n,normalize:t=>t}}function ax({start:e,end:t,count:n,loop:i,style:s}){return{start:e%n,end:t%n,loop:i&&(t-e+1)%n===0,style:s}}function HO(e,t,n){const{property:i,start:s,end:r}=n,{between:o,normalize:a}=eM(i),l=t.length;let{start:c,end:u,loop:d}=e,h,f;if(d){for(c+=l,u+=l,h=0,f=l;hl(s,x,y)&&a(s,x)!==0,w=()=>a(r,y)===0||l(r,x,y),S=()=>m||_(),C=()=>!m||w();for(let M=u,P=u;M<=d;++M)g=t[M%o],!g.skip&&(y=c(g[i]),y!==x&&(m=l(y,s,r),v===null&&S()&&(v=a(y,s)===0?M:P),v!==null&&C()&&(p.push(ax({start:v,end:M,loop:h,count:o,style:f})),v=null),P=M,x=y));return v!==null&&p.push(ax({start:v,end:d,loop:h,count:o,style:f})),p}function iM(e,t){const n=[],i=e.segments;for(let s=0;ss&&e[r%t].skip;)r--;return r%=t,{start:s,end:r}}function YO(e,t,n,i){const s=e.length,r=[];let o=t,a=e[t],l;for(l=t+1;l<=n;++l){const c=e[l%s];c.skip||c.stop?a.skip||(i=!1,r.push({start:t%s,end:(l-1)%s,loop:i}),t=o=c.stop?l:null):(o=l,a.skip&&(t=l)),a=c}return o!==null&&r.push({start:t%s,end:o%s,loop:i}),r}function XO(e,t){const n=e.points,i=e.options.spanGaps,s=n.length;if(!s)return[];const r=!!e._loop,{start:o,end:a}=UO(n,s,r,i);if(i===!0)return lx(e,[{start:o,end:a,loop:r}],n,t);const l=aa({chart:t,initial:n.initial,numSteps:o,currentStep:Math.min(i-n.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=BS.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const r=i.items;let o=r.length-1,a=!1,l;for(;o>=0;--o)l=r[o],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),a=!0):(r[o]=r[r.length-1],r.pop());a&&(s.draw(),this._notify(s,i,t,"progress")),r.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),n+=r.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let i=n.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,i)),i}listen(t,n,i){this._getAnims(t).listeners[n].push(i)}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((i,s)=>Math.max(i,s._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 i=n.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}};var Ai=new qO;const ux="transparent",QO={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const i=tx(e||ux),s=i.valid&&tx(t||ux);return s&&s.valid?s.mix(i,n).hexString():t},number(e,t,n){return e+(t-e)*n}};let ZO=class{constructor(t,n,i,s){const r=n[i];s=Ht([t.to,s,r,t.from]);const o=Ht([t.from,r,s]);this._active=!0,this._fn=t.fn||QO[t.type||typeof o],this._easing=hl[t.easing]||hl.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=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(t,n,i){if(this._active){this._notify(!1);const s=this._target[this._prop],r=i-this._start,o=this._duration-r;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=Ht([t.to,n,s,t.from]),this._from=Ht([t.from,s,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,i=this._duration,s=this._prop,r=this._from,o=this._loop,a=this._to;let l;if(this._active=r!==a&&(o||n1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(r,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,i)=>{t.push({res:n,rej:i})})}_notify(t){const n=t?"res":"rej",i=this._promises||[];for(let s=0;s{const r=t[s];if(!gt(r))return;const o={};for(const a of n)o[a]=r[a];(Ut(r.properties)&&r.properties||[s]).forEach(a=>{(a===s||!i.has(a))&&i.set(a,o)})})}_animateOptions(t,n){const i=n.options,s=t2(t,i);if(!s)return[];const r=this._createAnimations(s,i);return i.$shared&&JO(t.options.$animations,i).then(()=>{t.options=i},()=>{}),r}_createAnimations(t,n){const i=this._properties,s=[],r=t.$animations||(t.$animations={}),o=Object.keys(n),a=Date.now();let l;for(l=o.length-1;l>=0;--l){const c=o[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,n));continue}const u=n[c];let d=r[c];const h=i.get(c);if(d)if(h&&d.active()){d.update(h,u,a);continue}else d.cancel();if(!h||!h.duration){t[c]=u;continue}r[c]=d=new ZO(h,t,c,u),s.push(d)}return s}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const i=this._createAnimations(t,n);if(i.length)return Ai.add(this._chart,i),!0}};function JO(e,t){const n=[],i=Object.keys(t);for(let s=0;s0||!n&&r<0)return s.index}return null}function mx(e,t){const{chart:n,_cachedMeta:i}=e,s=n._stacks||(n._stacks={}),{iScale:r,vScale:o,index:a}=i,l=r.axis,c=o.axis,u=s2(r,o,i),d=t.length;let h;for(let f=0;fn[i].axis===t).shift()}function a2(e,t){return Qs(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function l2(e,t,n){return Qs(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function xa(e,t){const n=e.controller.index,i=e.vScale&&e.vScale.axis;if(i){t=t||e._parsed;for(const s of t){const r=s._stacks;if(!r||r[i]===void 0||r[i][n]===void 0)return;delete r[i][n],r[i]._visualValues!==void 0&&r[i]._visualValues[n]!==void 0&&delete r[i]._visualValues[n]}}}const $f=e=>e==="reset"||e==="none",gx=(e,t)=>t?e:Object.assign({},e),c2=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:rM(n,!0),values:null};var Na;let Zs=(Na=class{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=fx(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&&xa(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,i=this.getDataset(),s=(d,h,f,p)=>d==="x"?h:d==="r"?p:f,r=n.xAxisID=at(i.xAxisID,jf(t,"x")),o=n.yAxisID=at(i.yAxisID,jf(t,"y")),a=n.rAxisID=at(i.rAxisID,jf(t,"r")),l=n.indexAxis,c=n.iAxisID=s(l,r,o,a),u=n.vAxisID=s(l,o,r,a);n.xScale=this.getScaleForId(r),n.yScale=this.getScaleForId(o),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(u)}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&&Qv(this._data,this),t._stacked&&xa(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),i=this._data;if(gt(n))this._data=i2(n);else if(i!==n){if(i){Qv(i,this);const s=this._cachedMeta;xa(s),s._parsed=[]}n&&Object.isExtensible(n)&&KA(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,i=this.getDataset();let s=!1;this._dataCheck();const r=n._stacked;n._stacked=fx(n.vScale,n),n.stack!==i.stack&&(s=!0,xa(n),n.stack=i.stack),this._resyncElements(t),(s||r!==n._stacked)&&mx(this,n._parsed)}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:i,_data:s}=this,{iScale:r,_stacked:o}=i,a=r.axis;let l=t===0&&n===s.length?!0:i._sorted,c=t>0&&i._parsed[t-1],u,d,h;if(this._parsing===!1)i._parsed=s,i._sorted=!0,h=s;else{Ut(s[t])?h=this.parseArrayData(i,s,t,n):gt(s[t])?h=this.parseObjectData(i,s,t,n):h=this.parsePrimitiveData(i,s,t,n);const f=()=>d[a]===null||c&&d[a]m||d=0;--h)if(!p()){this.updateRangeFromParsed(c,t,f,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,i=[];let s,r,o;for(s=0,r=n.length;s=0&&tthis.getContext(i,s,n),m=c.resolveNamedOptions(h,f,p,d);return m.$shared&&(m.$shared=l,r[o]=Object.freeze(gx(m,l))),m}_resolveAnimations(t,n,i){const s=this.chart,r=this._cachedDataOpts,o=`animation-${n}`,a=r[o];if(a)return a;let l;if(s.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,n),h=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(h,this.getContext(t,i,n))}const c=new sM(s,l&&l.animations);return l&&l._cacheable&&(r[o]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||$f(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const i=this.resolveDataElementOptions(t,n),s=this._sharedOptions,r=this.getSharedOptions(i),o=this.includeOptions(n,r)||r!==s;return this.updateSharedOptions(r,n,i),{sharedOptions:r,includeOptions:o}}updateElement(t,n,i,s){$f(s)?Object.assign(t,i):this._resolveAnimations(n,s).update(t,i)}updateSharedOptions(t,n,i){t&&!$f(n)&&this._resolveAnimations(void 0,n).update(t,i)}_setStyle(t,n,i,s){t.active=s;const r=this.getStyle(n,s);this._resolveAnimations(n,i,s).update(t,{options:!s&&this.getSharedOptions(r)||r})}removeHoverStyle(t,n,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,n,i){this._setStyle(t,i,"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,i=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const s=i.length,r=n.length,o=Math.min(r,s);o&&this.parse(0,o),r>s?this._insertElements(s,r-s,t):r{for(c.length+=n,a=c.length-1;a>=o;a--)c[a]=c[a-n]};for(l(r),a=t;as-r))}return e._cache.$bar}function d2(e){const t=e.iScale,n=u2(t,e.type);let i=t._length,s,r,o,a;const l=()=>{o===32767||o===-32768||(zl(a)&&(i=Math.min(i,Math.abs(o-a)||i)),a=o)};for(s=0,r=n.length;s0?s[e-1]:null,a=eMath.abs(a)&&(l=a,c=o),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:r,min:o,max:a}}function oM(e,t,n,i){return Ut(e)?p2(e,t,n,i):t[n.axis]=n.parse(e,i),t}function yx(e,t,n,i){const s=e.iScale,r=e.vScale,o=s.getLabels(),a=s===r,l=[];let c,u,d,h;for(c=n,u=n+i;c=n?1:-1)}function g2(e){let t,n,i,s,r;return e.horizontal?(t=e.base>e.x,n="left",i="right"):(t=e.basel.controller.options.grouped),r=i.options.stacked,o=[],a=l=>{const c=l.controller.getParsed(n),u=c&&c[l.vScale.axis];if(bt(u)||isNaN(u))return!0};for(const l of s)if(!(n!==void 0&&a(l))&&((r===!1||o.indexOf(l.stack)===-1||r===void 0&&l.stack===void 0)&&o.push(l.stack),l.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,n,i){const s=this._getStacks(t,i),r=n!==void 0?s.indexOf(n):-1;return r===-1?s.length-1:r}_getRuler(){const t=this.options,n=this._cachedMeta,i=n.iScale,s=[];let r,o;for(r=0,o=n.data.length;r=0;--i)n=Math.max(n,t[i].size(this.resolveDataElementOptions(i))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:r}=n,o=this.getParsed(t),a=s.getLabelForValue(o.x),l=r.getLabelForValue(o.y),c=o._custom;return{label:i[t]||"",value:"("+a+", "+l+(c?", "+c:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,i,s){const r=s==="reset",{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(n,s),u=o.axis,d=a.axis;for(let h=n;hWl(x,a,l,!0)?1:Math.max(_,_*n,w,w*n),p=(x,_,w)=>Wl(x,a,l,!0)?-1:Math.min(_,_*n,w,w*n),m=f(0,c,d),v=f(ue,u,h),y=p(Kt,c,d),g=p(Kt+ue,u,h);i=(m-y)/2,s=(v-g)/2,r=-(m+y)/2,o=-(v+g)/2}return{ratioX:i,ratioY:s,offsetX:r,offsetY:o}}var no;let vy=(no=class extends Zs{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 i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let r=l=>+i[l];if(gt(i[t])){const{key:l="value"}=this._parsing;r=c=>+zs(i[c],l)}let o,a;for(o=t,a=t+n;o0&&!isNaN(t)?Xt*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=hc(n._parsed[t],i.options.locale);return{label:s[t]||"",value:r}}getMaxBorderWidth(t){let n=0;const i=this.chart;let s,r,o,a,l;if(!t){for(s=0,r=i.data.datasets.length;st!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),K(no,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return n.labels.map((r,o)=>{const l=t.getDatasetMeta(0).controller.getStyle(o);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(o),index:o}})}return[]}},onClick(t,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}}}),no);var Ia;let k2=(Ia=class extends Zs{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:i,data:s=[],_dataset:r}=n,o=this.chart._animationsDisabled;let{start:a,count:l}=zS(n,s,o);this._drawStart=a,this._drawCount=l,WS(n)&&(a=0,l=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!r._decimated,i.points=s;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:c},t),this.updateElements(s,a,l,t)}updateElements(t,n,i,s){const r=s==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(n,s),h=o.axis,f=a.axis,{spanGaps:p,segment:m}=this.options,v=Wo(p)?p:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||r||s==="none",g=n+i,x=t.length;let _=n>0&&this.getParsed(n-1);for(let w=0;w=g){C.skip=!0;continue}const M=this.getParsed(w),P=bt(M[f]),T=C[h]=o.getPixelForValue(M[h],w),A=C[f]=r||P?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,M,l):M[f],w);C.skip=isNaN(T)||isNaN(A)||P,C.stop=w>0&&Math.abs(M[h]-_[h])>v,m&&(C.parsed=M,C.raw=c.data[w]),d&&(C.options=u||this.resolveDataElementOptions(w,S.active?"active":s)),y||this.updateElement(S,w,C,s),_=M}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,i=n.options&&n.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const r=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,r,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}},K(Ia,"id","line"),K(Ia,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),K(Ia,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}}),Ia);var Fa;let aM=(Fa=class extends Zs{constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=hc(n._parsed[t].r,i.options.locale);return{label:s[t]||"",value:r}}parseObjectData(t,n,i,s){return QS.bind(this)(t,n,i,s)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,s)=>{const r=this.getParsed(s).r;!isNaN(r)&&this.chart.getDataVisibility(s)&&(rn.max&&(n.max=r))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,i=t.options,s=Math.min(n.right-n.left,n.bottom-n.top),r=Math.max(s/2,0),o=Math.max(i.cutoutPercentage?r/100*i.cutoutPercentage:1,0),a=(r-o)/t.getVisibleDatasetCount();this.outerRadius=r-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,n,i,s){const r=s==="reset",o=this.chart,l=o.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,d=c.yCenter,h=c.getIndexAngle(0)-.5*Kt;let f=h,p;const m=360/this.countVisibleElements();for(p=0;p{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&n++}),n}_computeAngle(t,n,i){return this.chart.getDataVisibility(t)?Jn(this.resolveDataElementOptions(t,n).angle||i):0}},K(Fa,"id","polarArea"),K(Fa,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),K(Fa,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return n.labels.map((r,o)=>{const l=t.getDatasetMeta(0).controller.getStyle(o);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(o),index:o}})}return[]}},onClick(t,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}}),Fa);var Ou;let S2=(Ou=class extends vy{},K(Ou,"id","pie"),K(Ou,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"}),Ou);var Ba;let M2=(Ba=class extends Zs{getLabelAndValue(t){const n=this._cachedMeta.vScale,i=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(i[n.axis])}}parseObjectData(t,n,i,s){return QS.bind(this)(t,n,i,s)}update(t){const n=this._cachedMeta,i=n.dataset,s=n.data||[],r=n.iScale.getLabels();if(i.points=s,t!=="resize"){const o=this.resolveDatasetElementOptions(t);this.options.showLine||(o.borderWidth=0);const a={_loop:!0,_fullLoop:r.length===s.length,options:o};this.updateElement(i,void 0,a,t)}this.updateElements(s,0,s.length,t)}updateElements(t,n,i,s){const r=this._cachedMeta.rScale,o=s==="reset";for(let a=n;a0&&this.getParsed(n-1);for(let _=n;_0&&Math.abs(S[f]-x[f])>y,v&&(C.parsed=S,C.raw=c.data[_]),h&&(C.options=d||this.resolveDataElementOptions(_,w.active?"active":s)),g||this.updateElement(w,_,C,s),x=S}this.updateSharedOptions(d,s,u)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let a=0;for(let l=n.length-1;l>=0;--l)a=Math.max(a,n[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!n.length)return s;const r=n[0].size(this.resolveDataElementOptions(0)),o=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(s,r,o)/2}},K(Va,"id","scatter"),K(Va,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),K(Va,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}}),Va);var P2=Object.freeze({__proto__:null,BarController:b2,BubbleController:_2,DoughnutController:vy,LineController:k2,PieController:S2,PolarAreaController:aM,RadarController:M2,ScatterController:C2});function or(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class xy{constructor(t){K(this,"options");this.options=t||{}}static override(t){Object.assign(xy.prototype,t)}init(){}formats(){return or()}parse(){return or()}format(){return or()}add(){return or()}diff(){return or()}startOf(){return or()}endOf(){return or()}}var T2={_date:xy};function D2(e,t,n,i){const{controller:s,data:r,_sorted:o}=e,a=s._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&o&&r.length){const l=a._reversePixels?YA:zi;if(i){if(s._sharedOptions){const c=r[0],u=typeof c.getRange=="function"&&c.getRange(t);if(u){const d=l(r,t,n-u),h=l(r,t,n+u);return{lo:d.lo,hi:h.hi}}}}else return l(r,t,n)}return{lo:0,hi:r.length-1}}function fc(e,t,n,i,s){const r=e.getSortedVisibleDatasetMetas(),o=n[t];for(let a=0,l=r.length;a{l[o](t[n],s)&&(r.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,s))}),i&&!a?[]:r}var L2={evaluateInteractionItems:fc,modes:{index(e,t,n,i){const s=fr(t,e),r=n.axis||"x",o=n.includeInvisible||!1,a=n.intersect?Ff(e,s,r,i,o):Bf(e,s,r,!1,i,o),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(e,t,n,i){const s=fr(t,e),r=n.axis||"xy",o=n.includeInvisible||!1;let a=n.intersect?Ff(e,s,r,i,o):Bf(e,s,r,!1,i,o);if(a.length>0){const l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let u=0;un.pos===t)}function _x(e,t){return e.filter(n=>lM.indexOf(n.pos)===-1&&n.box.axis===t)}function _a(e,t){return e.sort((n,i)=>{const s=t?i:n,r=t?n:i;return s.weight===r.weight?s.index-r.index:s.weight-r.weight})}function R2(e){const t=[];let n,i,s,r,o,a;for(n=0,i=(e||[]).length;nc.box.fullSize),!0),i=_a(ba(t,"left"),!0),s=_a(ba(t,"right")),r=_a(ba(t,"top"),!0),o=_a(ba(t,"bottom")),a=_x(t,"x"),l=_x(t,"y");return{fullSize:n,leftAndTop:i.concat(r),rightAndBottom:s.concat(l).concat(o).concat(a),chartArea:ba(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:r.concat(o).concat(a)}}function wx(e,t,n,i){return Math.max(e[n],t[n])+Math.max(e[i],t[i])}function cM(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 I2(e,t,n,i){const{pos:s,box:r}=n,o=e.maxPadding;if(!gt(s)){n.size&&(e[s]-=n.size);const d=i[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?r.height:r.width),n.size=d.size/d.count,e[s]+=n.size}r.getPadding&&cM(o,r.getPadding());const a=Math.max(0,t.outerWidth-wx(o,e,"left","right")),l=Math.max(0,t.outerHeight-wx(o,e,"top","bottom")),c=a!==e.w,u=l!==e.h;return e.w=a,e.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function F2(e){const t=e.maxPadding;function n(i){const s=Math.max(t[i]-e[i],0);return e[i]+=s,s}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function B2(e,t){const n=t.maxPadding;function i(s){const r={left:0,top:0,right:0,bottom:0};return s.forEach(o=>{r[o]=Math.max(t[o],n[o])}),r}return i(e?["left","right"]:["top","bottom"])}function Ga(e,t,n,i){const s=[];let r,o,a,l,c,u;for(r=0,o=e.length,c=0;r{typeof m.beforeLayout=="function"&&m.beforeLayout()});const u=l.reduce((m,v)=>v.box.options&&v.box.options.display===!1?m:m+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:s,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/u,hBoxMaxHeight:o/2}),h=Object.assign({},s);cM(h,Ae(i));const f=Object.assign({maxPadding:h,w:r,h:o,x:s.left,y:s.top},s),p=j2(l.concat(c),d);Ga(a.fullSize,f,d,p),Ga(l,f,d,p),Ga(c,f,d,p)&&Ga(l,f,d,p),F2(f),kx(a.leftAndTop,f,d,p),f.x+=f.w,f.y+=f.h,kx(a.rightAndBottom,f,d,p),e.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},Et(a.chartArea,m=>{const v=m.box;Object.assign(v,e.chartArea),v.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};let uM=class{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,i){}removeEventListener(t,n,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,i,s){return n=Math.max(0,n||t.width),i=i||t.height,{width:n,height:Math.max(0,s?Math.floor(n/s):i)}}isAttached(t){return!0}updateConfig(t){}},V2=class extends uM{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}};const Qu="$chartjs",z2={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Sx=e=>e===null||e==="";function W2(e,t){const n=e.style,i=e.getAttribute("height"),s=e.getAttribute("width");if(e[Qu]={initial:{height:i,width:s,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",Sx(s)){const r=ox(e,"width");r!==void 0&&(e.width=r)}if(Sx(i))if(e.style.height==="")e.height=e.width/(t||2);else{const r=ox(e,"height");r!==void 0&&(e.height=r)}return e}const dM=FO?{passive:!0}:!1;function H2(e,t,n){e&&e.addEventListener(t,n,dM)}function U2(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,dM)}function Y2(e,t){const n=z2[e.type]||e.type,{x:i,y:s}=fr(e,t);return{type:n,chart:t,native:e,x:i!==void 0?i:null,y:s!==void 0?s:null}}function Id(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function X2(e,t,n){const i=e.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||Id(a.addedNodes,i),o=o&&!Id(a.removedNodes,i);o&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}function K2(e,t,n){const i=e.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||Id(a.removedNodes,i),o=o&&!Id(a.addedNodes,i);o&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}const Ul=new Map;let Mx=0;function hM(){const e=window.devicePixelRatio;e!==Mx&&(Mx=e,Ul.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function G2(e,t){Ul.size||window.addEventListener("resize",hM),Ul.set(e,t)}function q2(e){Ul.delete(e),Ul.size||window.removeEventListener("resize",hM)}function Q2(e,t,n){const i=e.canvas,s=i&&yy(i);if(!s)return;const r=VS((a,l)=>{const c=s.clientWidth;n(a,l),c{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||r(c,u)});return o.observe(s),G2(e,r),o}function Vf(e,t,n){n&&n.disconnect(),t==="resize"&&q2(e)}function Z2(e,t,n){const i=e.canvas,s=VS(r=>{e.ctx!==null&&n(Y2(r,e))},e);return H2(i,t,s),s}let J2=class extends uM{acquireContext(t,n){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(W2(t,n),i):null}releaseContext(t){const n=t.canvas;if(!n[Qu])return!1;const i=n[Qu].initial;["height","width"].forEach(r=>{const o=i[r];bt(o)?n.removeAttribute(r):n.setAttribute(r,o)});const s=i.style||{};return Object.keys(s).forEach(r=>{n.style[r]=s[r]}),n.width=n.width,delete n[Qu],!0}addEventListener(t,n,i){this.removeEventListener(t,n);const s=t.$proxies||(t.$proxies={}),o={attach:X2,detach:K2,resize:Q2}[n]||Z2;s[n]=o(t,n,i)}removeEventListener(t,n){const i=t.$proxies||(t.$proxies={}),s=i[n];if(!s)return;({attach:Vf,detach:Vf,resize:Vf}[n]||U2)(t,n,s),i[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,i,s){return IO(t,n,i,s)}isAttached(t){const n=yy(t);return!!(n&&n.isConnected)}};function tL(e){return!gy()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?V2:J2}var Lu;let os=(Lu=class{constructor(){K(this,"x");K(this,"y");K(this,"active",!1);K(this,"options");K(this,"$animations")}tooltipPosition(t){const{x:n,y:i}=this.getProps(["x","y"],t);return{x:n,y:i}}hasValue(){return Wo(this.x)&&Wo(this.y)}getProps(t,n){const i=this.$animations;if(!n||!i)return this;const s={};return t.forEach(r=>{s[r]=i[r]&&i[r].active()?i[r]._to:this[r]}),s}},K(Lu,"defaults",{}),K(Lu,"defaultRoutes"),Lu);function eL(e,t){const n=e.options.ticks,i=nL(e),s=Math.min(n.maxTicksLimit||i,i),r=n.major.enabled?sL(t):[],o=r.length,a=r[0],l=r[o-1],c=[];if(o>s)return rL(t,c,r,o/s),c;const u=iL(r,t,s);if(o>0){let d,h;const f=o>1?Math.round((l-a)/(o-1)):null;for(eu(t,c,u,bt(f)?0:a-f,a),d=0,h=o-1;ds)return l}return Math.max(s,1)}function sL(e){const t=[];let n,i;for(n=0,i=e.length;ne==="left"?"right":e==="right"?"left":e,Cx=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,Px=(e,t)=>Math.min(t||e,e);function Tx(e,t){const n=[],i=e.length/t,s=e.length;let r=0;for(;ro+a)))return l}function cL(e,t){Et(e,n=>{const i=n.gc,s=i.length/2;let r;if(s>t){for(r=0;ri?i:n,i=s&&n>i?n:i,{min:mn(n,mn(i,n)),max:mn(i,mn(n,i))}}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(){$t(this.options.beforeUpdate,[this])}update(t,n,i){const{beginAtZero:s,grace:r,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=gO(this,r,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a=r||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const u=this._getLabelSizes(),d=u.widest.width,h=u.highest.height,f=we(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/i:f/(i-1),d+6>a&&(a=f/(i-(t.offset?.5:1)),l=this.maxHeight-wa(t.grid)-n.padding-Dx(t.title,this.chart.options.font),c=Math.sqrt(d*d+h*h),o=ly(Math.min(Math.asin(we((u.highest.height+6)/a,-1,1)),Math.asin(we(l/c,-1,1))-Math.asin(we(h/c,-1,1)))),o=Math.max(s,Math.min(r,o))),this.labelRotation=o}afterCalculateLabelRotation(){$t(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){$t(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:i,title:s,grid:r}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const l=Dx(s,n.options.font);if(a?(t.width=this.maxWidth,t.height=wa(r)+l):(t.height=this.maxHeight,t.width=wa(r)+l),i.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:h}=this._getLabelSizes(),f=i.padding*2,p=Jn(this.labelRotation),m=Math.cos(p),v=Math.sin(p);if(a){const y=i.mirror?0:v*d.width+m*h.height;t.height=Math.min(this.maxHeight,t.height+y+f)}else{const y=i.mirror?0:m*d.width+v*h.height;t.width=Math.min(this.maxWidth,t.width+y+f)}this._calculatePadding(c,u,v,m)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,i,s){const{ticks:{align:r,padding:o},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,f=0;l?c?(h=s*t.width,f=i*n.height):(h=i*t.height,f=s*n.width):r==="start"?f=n.width:r==="end"?h=t.width:r!=="inner"&&(h=t.width/2,f=n.width/2),this.paddingLeft=Math.max((h-u+o)*this.width/(this.width-u),0),this.paddingRight=Math.max((f-d+o)*this.width/(this.width-d),0)}else{let u=n.height/2,d=t.height/2;r==="start"?(u=0,d=t.height):r==="end"&&(u=n.height,d=0),this.paddingTop=u+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(){$t(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,i;for(n=0,i=t.length;n({width:o[P]||0,height:a[P]||0});return{first:M(0),last:M(n-1),widest:M(S),highest:M(C),widths:o,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return UA(this._alignToPixels?rr(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&&ta*s?a/i:l/s:l*s0}_computeGridLineItems(t){const n=this.axis,i=this.chart,s=this.options,{grid:r,position:o,border:a}=s,l=r.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),h=wa(r),f=[],p=a.setContext(this.getContext()),m=p.display?p.width:0,v=m/2,y=function(R){return rr(i,R,m)};let g,x,_,w,S,C,M,P,T,A,E,z;if(o==="top")g=y(this.bottom),C=this.bottom-h,P=g-v,A=y(t.top)+v,z=t.bottom;else if(o==="bottom")g=y(this.top),A=t.top,z=y(t.bottom)-v,C=g+v,P=this.top+h;else if(o==="left")g=y(this.right),S=this.right-h,M=g-v,T=y(t.left)+v,E=t.right;else if(o==="right")g=y(this.left),T=t.left,E=y(t.right)-v,S=g+v,M=this.left+h;else if(n==="x"){if(o==="center")g=y((t.top+t.bottom)/2+.5);else if(gt(o)){const R=Object.keys(o)[0],B=o[R];g=y(this.chart.scales[R].getPixelForValue(B))}A=t.top,z=t.bottom,C=g+v,P=C+h}else if(n==="y"){if(o==="center")g=y((t.left+t.right)/2);else if(gt(o)){const R=Object.keys(o)[0],B=o[R];g=y(this.chart.scales[R].getPixelForValue(B))}S=g-v,M=S-h,T=t.left,E=t.right}const N=at(s.ticks.maxTicksLimit,d),L=Math.max(1,Math.ceil(d/N));for(x=0;x0&&(U-=Z/2);break}V={left:U,top:O,width:Z+W.width,height:et+W.height,color:L.backdropColor}}v.push({label:_,font:P,textOffset:E,options:{rotation:m,color:B,strokeColor:D,strokeWidth:$,textAlign:F,textBaseline:z,translation:[w,S],backdrop:V}})}return v}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Jn(this.labelRotation))return t==="top"?"left":"right";let s="center";return n.align==="start"?s="left":n.align==="end"?s="right":n.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:i,mirror:s,padding:r}}=this.options,o=this._getLabelSizes(),a=t+r,l=o.widest.width;let c,u;return n==="left"?s?(u=this.right+r,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?s?(u=this.left+r,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_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:i,top:s,width:r,height:o}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(i,s,r,o),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const s=this.ticks.findIndex(r=>r.value===t);return s>=0?n.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const n=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let r,o;const a=(l,c,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(n.display)for(r=0,o=s.length;r{this.draw(r)}}]:[{z:i,draw:r=>{this.drawBackground(),this.drawGrid(r),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:n,draw:r=>{this.drawLabels(r)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let r,o;for(r=0,o=n.length;r{const i=n.split("."),s=i.pop(),r=[e].concat(i).join("."),o=t[n].split("."),a=o.pop(),l=o.join(".");ne.route(r,s,l,a)})}function gL(e){return"id"in e&&"defaults"in e}let yL=class{constructor(){this.controllers=new nu(Zs,"datasets",!0),this.elements=new nu(os,"elements"),this.plugins=new nu(Object,"plugins"),this.scales=new nu(pc,"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,i){[...n].forEach(s=>{const r=i||this._getRegistryForType(s);i||r.isForType(s)||r===this.plugins&&s.id?this._exec(t,r,s):Et(s,o=>{const a=i||this._getRegistryForType(o);this._exec(t,a,o)})})}_exec(t,n,i){const s=ay(t);$t(i["before"+s],[],i),n[t](i),$t(i["after"+s],[],i)}_getRegistryForType(t){for(let n=0;nr.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(s(n,i),t,"stop"),this._notify(s(i,n),t,"start")}};function xL(e){const t={},n=[],i=Object.keys(hi.plugins.items);for(let r=0;r1&&Ex(e[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function Ax(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function CL(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(i=>i.xAxisID===e||i.yAxisID===e);if(n.length)return Ax(e,"x",n[0])||Ax(e,"y",n[0])}return{}}function PL(e,t){const n=Fr[e.type]||{scales:{}},i=t.scales||{},s=wm(e.type,t),r=Object.create(null);return Object.keys(i).forEach(o=>{const a=i[o];if(!gt(a))return console.error(`Invalid scale configuration for scale: ${o}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const l=km(o,a,CL(o,e),ne.scales[a.type]),c=SL(l,s),u=n.scales||{};r[o]=ul(Object.create(null),[{axis:l},a,u[l],u[c]])}),e.data.datasets.forEach(o=>{const a=o.type||e.type,l=o.indexAxis||wm(a,t),u=(Fr[a]||{}).scales||{};Object.keys(u).forEach(d=>{const h=kL(d,l),f=o[h+"AxisID"]||h;r[f]=r[f]||Object.create(null),ul(r[f],[{axis:h},i[f],u[d]])})}),Object.keys(r).forEach(o=>{const a=r[o];ul(a,[ne.scales[a.type],ne.scale])}),r}function pM(e){const t=e.options||(e.options={});t.plugins=at(t.plugins,{}),t.scales=PL(e,t)}function mM(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function TL(e){return e=e||{},e.data=mM(e.data),pM(e),e}const Ox=new Map,gM=new Set;function iu(e,t){let n=Ox.get(e);return n||(n=t(),Ox.set(e,n),gM.add(n)),n}const ka=(e,t,n)=>{const i=zs(t,n);i!==void 0&&e.add(i)};let DL=class{constructor(t){this._config=TL(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=mM(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(),pM(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return iu(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return iu(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return iu(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,i=this.type;return iu(`${i}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const i=this._scopeCache;let s=i.get(t);return(!s||n)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,n,i){const{options:s,type:r}=this,o=this._cachedScopes(t,i),a=o.get(n);if(a)return a;const l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(d=>ka(l,t,d))),u.forEach(d=>ka(l,s,d)),u.forEach(d=>ka(l,Fr[r]||{},d)),u.forEach(d=>ka(l,ne,d)),u.forEach(d=>ka(l,bm,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),gM.has(n)&&o.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,Fr[n]||{},ne.datasets[n]||{},{type:n},ne,bm]}resolveNamedOptions(t,n,i,s=[""]){const r={$shared:!0},{resolver:o,subPrefixes:a}=Lx(this._resolverCache,t,s);let l=o;if(AL(o,n)){r.$shared=!1,i=Ws(i)?i():i;const c=this.createResolver(t,i,a);l=Ho(o,i,c)}for(const c of n)r[c]=l[c];return r}createResolver(t,n,i=[""],s){const{resolver:r}=Lx(this._resolverCache,t,i);return gt(n)?Ho(r,n,void 0,s):r}};function Lx(e,t,n){let i=e.get(t);i||(i=new Map,e.set(t,i));const s=n.join();let r=i.get(s);return r||(r={resolver:fy(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},i.set(s,r)),r}const EL=e=>gt(e)&&Object.getOwnPropertyNames(e).some(t=>Ws(e[t]));function AL(e,t){const{isScriptable:n,isIndexable:i}=XS(e);for(const s of t){const r=n(s),o=i(s),a=(o||r)&&e[s];if(r&&(Ws(a)||EL(a))||o&&Ut(a))return!0}return!1}var OL="4.4.2";const LL=["top","bottom","left","right","chartArea"];function Rx(e,t){return e==="top"||e==="bottom"||LL.indexOf(e)===-1&&t==="x"}function Nx(e,t){return function(n,i){return n[e]===i[e]?n[t]-i[t]:n[e]-i[e]}}function jx(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),$t(n&&n.onComplete,[e],t)}function RL(e){const t=e.chart,n=t.options.animation;$t(n&&n.onProgress,[e],t)}function yM(e){return gy()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Zu={},$x=e=>{const t=yM(e);return Object.values(Zu).filter(n=>n.canvas===t).pop()};function NL(e,t,n){const i=Object.keys(e);for(const s of i){const r=+s;if(r>=t){const o=e[s];delete e[s],(n>0||r>t)&&(e[r+n]=o)}}}function jL(e,t,n,i){return!n||e.type==="mouseout"?null:i?t:e}function su(e,t,n){return e.options.clip?e[n]:t[n]}function $L(e,t){const{xScale:n,yScale:i}=e;return n&&i?{left:su(n,t,"left"),right:su(n,t,"right"),top:su(i,t,"top"),bottom:su(i,t,"bottom")}:t}var fs;let by=(fs=class{static register(...t){hi.add(...t),Ix()}static unregister(...t){hi.remove(...t),Ix()}constructor(t,n){const i=this.config=new DL(n),s=yM(t),r=$x(s);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||tL(s)),this.platform.updateConfig(i);const a=this.platform.acquireContext(s,o.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=LA(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,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 vL,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=GA(d=>this.update(d),o.resizeDelay||0),this._dataChanges=[],Zu[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Ai.listen(this,"complete",jx),Ai.listen(this,"progress",RL),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:i,height:s,_aspectRatio:r}=this;return bt(t)?n&&r?r:s?i/s: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 hi}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():rx(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return nx(this.canvas,this.ctx),this}stop(){return Ai.stop(this),this}resize(t,n){Ai.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const i=this.options,s=this.canvas,r=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,t,n,r),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,rx(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),$t(i.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Et(n,(i,s)=>{i.id=s})}buildOrUpdateScales(){const t=this.options,n=t.scales,i=this.scales,s=Object.keys(i).reduce((o,a)=>(o[a]=!1,o),{});let r=[];n&&(r=r.concat(Object.keys(n).map(o=>{const a=n[o],l=km(o,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),Et(r,o=>{const a=o.options,l=a.id,c=km(l,a),u=at(a.type,o.dtype);(a.position===void 0||Rx(a.position,c)!==Rx(o.dposition))&&(a.position=o.dposition),s[l]=!0;let d=null;if(l in i&&i[l].type===u)d=i[l];else{const h=hi.getScale(u);d=new h({id:l,type:u,ctx:this.ctx,chart:this}),i[d.id]=d}d.init(a,t)}),Et(s,(o,a)=>{o||delete i[a]}),Et(i,o=>{Fe.configure(this,o,o.options),Fe.addBox(this,o)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,i=t.length;if(t.sort((s,r)=>s.index-r.index),i>n){for(let s=n;sn.length&&delete this._stacks,t.forEach((i,s)=>{n.filter(r=>r===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=n.length;i{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const i=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let c=0,u=this.data.datasets.length;c{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Nx("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Et(this.scales,t=>{Fe.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Xv(n,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:r}of n){const o=i==="_removeElements"?-r:r;NL(t,s,o)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,i=r=>new Set(t.filter(o=>o[0]===r).map((o,a)=>a+","+o.splice(1).join(","))),s=i(0);for(let r=1;rr.split(",")).map(r=>({method:r[1],start:+r[2],count:+r[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Fe.update(this,this.width,this.height,t);const n=this.chartArea,i=n.width<=0||n.height<=0;this._layers=[],Et(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,r)=>{s._idx=r}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,i=this.data.datasets.length;n=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,i=t._clip,s=!i.disabled,r=$L(t,this.chartArea),o={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(s&&Ch(n,{left:i.left===!1?0:r.left-i.left,right:i.right===!1?this.width:r.right+i.right,top:i.top===!1?0:r.top-i.top,bottom:i.bottom===!1?this.height:r.bottom+i.bottom}),t.controller.draw(),s&&Ph(n),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return Wi(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,i,s){const r=L2.modes[n];return typeof r=="function"?r(this,t,i,s):[]}getDatasetMeta(t){const n=this.data.datasets[t],i=this._metasets;let s=i.filter(r=>r&&r._dataset===n).pop();return s||(s={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},i.push(s)),s}getContext(){return this.$context||(this.$context=Qs(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!n.hidden}setDatasetVisibility(t,n){const i=this.getDatasetMeta(t);i.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,i){const s=i?"show":"hide",r=this.getDatasetMeta(t),o=r.controller._resolveAnimations(void 0,s);zl(n)?(r.data[n].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(r,{visible:i}),this.update(a=>a.datasetIndex===t?s: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(),Ai.remove(this),t=0,n=this.data.datasets.length;t{n.addEventListener(this,r,o),t[r]=o},s=(r,o,a)=>{r.offsetX=o,r.offsetY=a,this._eventHandler(r)};Et(this.options.events,r=>i(r,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,i=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},r=(l,c)=>{this.canvas&&this.resize(l,c)};let o;const a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",r),i("detach",o)};o=()=>{this.attached=!1,s("resize",r),this._stop(),this._resize(0,0),i("attach",a)},n.isAttached(this.canvas)?a():o()}unbindEvents(){Et(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Et(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,i){const s=i?"set":"remove";let r,o,a,l;for(n==="dataset"&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=t.length;a{const a=this.getDatasetMeta(r);if(!a)throw new Error("No dataset found at index "+r);return{datasetIndex:r,element:a.data[o],index:o}});!Ld(i,n)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,n))}notifyPlugins(t,n,i){return this._plugins.notify(this,t,n,i)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,i){const s=this.options.hover,r=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),o=r(n,t),a=i?t:r(t,n);o.length&&this.updateHoverStyle(o,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,n){const i={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},s=o=>(o.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const r=this._handleEvent(t,n,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(r||i.changed)&&this.render(),this}_handleEvent(t,n,i){const{_active:s=[],options:r}=this,o=n,a=this._getActiveElements(t,s,i,o),l=FA(t),c=jL(t,this._lastEvent,i,l);i&&(this._lastEvent=null,$t(r.onHover,[t,a,this],this),l&&$t(r.onClick,[t,a,this],this));const u=!Ld(a,s);return(u||n)&&(this._active=a,this._updateHoverStyles(a,s,n)),this._lastEvent=c,u}_getActiveElements(t,n,i,s){if(t.type==="mouseout")return[];if(!i)return n;const r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,s)}},K(fs,"defaults",ne),K(fs,"instances",Zu),K(fs,"overrides",Fr),K(fs,"registry",hi),K(fs,"version",OL),K(fs,"getChart",$x),fs);function Ix(){return Et(by.instances,e=>e._plugins.invalidate())}function IL(e,t,n){const{startAngle:i,pixelMargin:s,x:r,y:o,outerRadius:a,innerRadius:l}=t;let c=s/a;e.beginPath(),e.arc(r,o,a,i-c,n+c),l>s?(c=s/l,e.arc(r,o,l,n+c,i-c,!0)):e.arc(r,o,s,n+ue,i-ue),e.closePath(),e.clip()}function FL(e){return hy(e,["outerStart","outerEnd","innerStart","innerEnd"])}function BL(e,t,n,i){const s=FL(e.options.borderRadius),r=(n-t)/2,o=Math.min(r,i*t/2),a=l=>{const c=(n-Math.min(r,l))*i/2;return we(l,0,Math.min(r,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:we(s.innerStart,0,o),innerEnd:we(s.innerEnd,0,o)}}function Zr(e,t,n,i){return{x:n+e*Math.cos(t),y:i+e*Math.sin(t)}}function Fd(e,t,n,i,s,r){const{x:o,y:a,startAngle:l,pixelMargin:c,innerRadius:u}=t,d=Math.max(t.outerRadius+i+n-c,0),h=u>0?u+i+n+c:0;let f=0;const p=s-l;if(i){const L=u>0?u-i:0,R=d>0?d-i:0,B=(L+R)/2,D=B!==0?p*B/(B+i):p;f=(p-D)/2}const m=Math.max(.001,p*d-n/Kt)/d,v=(p-m)/2,y=l+v+f,g=s-v-f,{outerStart:x,outerEnd:_,innerStart:w,innerEnd:S}=BL(t,h,d,g-y),C=d-x,M=d-_,P=y+x/C,T=g-_/M,A=h+w,E=h+S,z=y+w/A,N=g-S/E;if(e.beginPath(),r){const L=(P+T)/2;if(e.arc(o,a,d,P,L),e.arc(o,a,d,L,T),_>0){const $=Zr(M,T,o,a);e.arc($.x,$.y,_,T,g+ue)}const R=Zr(E,g,o,a);if(e.lineTo(R.x,R.y),S>0){const $=Zr(E,N,o,a);e.arc($.x,$.y,S,g+ue,N+Math.PI)}const B=(g-S/h+(y+w/h))/2;if(e.arc(o,a,h,g-S/h,B,!0),e.arc(o,a,h,B,y+w/h,!0),w>0){const $=Zr(A,z,o,a);e.arc($.x,$.y,w,z+Math.PI,y-ue)}const D=Zr(C,y,o,a);if(e.lineTo(D.x,D.y),x>0){const $=Zr(C,P,o,a);e.arc($.x,$.y,x,y-ue,P)}}else{e.moveTo(o,a);const L=Math.cos(P)*d+o,R=Math.sin(P)*d+a;e.lineTo(L,R);const B=Math.cos(T)*d+o,D=Math.sin(T)*d+a;e.lineTo(B,D)}e.closePath()}function VL(e,t,n,i,s){const{fullCircles:r,startAngle:o,circumference:a}=t;let l=t.endAngle;if(r){Fd(e,t,n,i,l,s);for(let c=0;c=Xt||Wl(o,l,c),v=Vi(a,u+f,d+f);return m&&v}getCenterPoint(n){const{x:i,y:s,startAngle:r,endAngle:o,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:c,spacing:u}=this.options,d=(r+o)/2,h=(a+l+u+c)/2;return{x:i+Math.cos(d)*h,y:s+Math.sin(d)*h}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:i,circumference:s}=this,r=(i.offset||0)/4,o=(i.spacing||0)/2,a=i.circular;if(this.pixelMargin=i.borderAlign==="inner"?.33:0,this.fullCircles=s>Xt?Math.floor(s/Xt):0,s===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const l=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(l)*r,Math.sin(l)*r);const c=1-Math.sin(Math.min(Kt,s||0)),u=r*c;n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,VL(n,this,u,o,a),zL(n,this,u,o,a),n.restore()}},K(io,"id","arc"),K(io,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),K(io,"defaultRoutes",{backgroundColor:"backgroundColor"}),K(io,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"}),io);function xM(e,t,n=t){e.lineCap=at(n.borderCapStyle,t.borderCapStyle),e.setLineDash(at(n.borderDash,t.borderDash)),e.lineDashOffset=at(n.borderDashOffset,t.borderDashOffset),e.lineJoin=at(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=at(n.borderWidth,t.borderWidth),e.strokeStyle=at(n.borderColor,t.borderColor)}function WL(e,t,n){e.lineTo(n.x,n.y)}function HL(e){return e.stepped?aO:e.tension||e.cubicInterpolationMode==="monotone"?lO:WL}function bM(e,t,n={}){const i=e.length,{start:s=0,end:r=i-1}=n,{start:o,end:a}=t,l=Math.max(s,o),c=Math.min(r,a),u=sa&&r>a;return{count:i,start:l,loop:t.loop,ilen:c(o+(c?a-_:_))%r,x=()=>{m!==v&&(e.lineTo(u,v),e.lineTo(u,m),e.lineTo(u,y))};for(l&&(f=s[g(0)],e.moveTo(f.x,f.y)),h=0;h<=a;++h){if(f=s[g(h)],f.skip)continue;const _=f.x,w=f.y,S=_|0;S===p?(wv&&(v=w),u=(d*u+_)/++d):(x(),e.lineTo(_,w),p=S,d=0,m=v=w),y=w}x()}function Sm(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?YL:UL}function XL(e){return e.stepped?BO:e.tension||e.cubicInterpolationMode==="monotone"?VO:pr}function KL(e,t,n,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,n,i)&&s.closePath()),xM(e,t.options),e.stroke(s)}function GL(e,t,n,i){const{segments:s,options:r}=t,o=Sm(t);for(const a of s)xM(e,r,a.style),e.beginPath(),o(e,t,a,{start:n,end:n+i-1})&&e.closePath(),e.stroke()}const qL=typeof Path2D=="function";function QL(e,t,n,i){qL&&!t.options.segment?KL(e,t,n,i):GL(e,t,n,i)}var so;let Dh=(so=class extends os{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 i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;OO(this._points,i,t,s,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=XO(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,i=t.length;return i&&n[t[i-1].end]}interpolate(t,n){const i=this.options,s=t[n],r=this.points,o=iM(this,{property:n,start:s,end:s});if(!o.length)return;const a=[],l=XL(i);let c,u;for(c=0,u=o.length;ct!=="borderDash"&&t!=="fill"}),so);function Fx(e,t,n,i){const s=e.options,{[n]:r}=e.getProps([n],i);return Math.abs(t-r)e.replace("rgb(","rgba(").replace(")",", 0.5)"));function SM(e){return Mm[e%Mm.length]}function MM(e){return Bx[e%Bx.length]}function sR(e,t){return e.borderColor=SM(t),e.backgroundColor=MM(t),++t}function rR(e,t){return e.backgroundColor=e.data.map(()=>SM(t++)),t}function oR(e,t){return e.backgroundColor=e.data.map(()=>MM(t++)),t}function aR(e){let t=0;return(n,i)=>{const s=e.getDatasetMeta(i).controller;s instanceof vy?t=rR(n,t):s instanceof aM?t=oR(n,t):s&&(t=sR(n,t))}}function Vx(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function lR(e){return e&&(e.borderColor||e.backgroundColor)}var cR={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:i},options:s}=e.config,{elements:r}=s;if(!n.forceOverride&&(Vx(i)||lR(s)||r&&Vx(r)))return;const o=aR(e);i.forEach(o)}};function uR(e,t,n,i,s){const r=s.samples||i;if(r>=n)return e.slice(t,t+n);const o=[],a=(n-2)/(r-2);let l=0;const c=t+n-1;let u=t,d,h,f,p,m;for(o[l++]=e[u],d=0;df&&(f=p,h=e[g],m=g);o[l++]=h,u=m}return o[l++]=e[c],o}function dR(e,t,n,i){let s=0,r=0,o,a,l,c,u,d,h,f,p,m;const v=[],y=t+n-1,g=e[t].x,_=e[y].x-g;for(o=t;om&&(m=c,h=o),s=(r*s+a.x)/++r;else{const S=o-1;if(!bt(d)&&!bt(h)){const C=Math.min(d,h),M=Math.max(d,h);C!==f&&C!==S&&v.push({...e[C],x:s}),M!==f&&M!==S&&v.push({...e[M],x:s})}o>0&&S!==f&&v.push(e[S]),v.push(a),u=w,r=0,p=m=c,d=h=f=o}}return v}function CM(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function zx(e){e.data.datasets.forEach(t=>{CM(t)})}function hR(e,t){const n=t.length;let i=0,s;const{iScale:r}=e,{min:o,max:a,minDefined:l,maxDefined:c}=r.getUserBounds();return l&&(i=we(zi(t,r.axis,o).lo,0,n-1)),c?s=we(zi(t,r.axis,a).hi+1,i,n)-i:s=n-i,{start:i,count:s}}var fR={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){zx(e);return}const i=e.width;e.data.datasets.forEach((s,r)=>{const{_data:o,indexAxis:a}=s,l=e.getDatasetMeta(r),c=o||s.data;if(Ht([a,e.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const u=e.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||e.options.parsing)return;let{start:d,count:h}=hR(l,c);const f=n.threshold||4*i;if(h<=f){CM(s);return}bt(o)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(m){this._data=m}}));let p;switch(n.algorithm){case"lttb":p=uR(c,d,h,i,n);break;case"min-max":p=dR(c,d,h,i);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}s._decimated=p})},destroy(e){zx(e)}};function pR(e,t,n){const i=e.segments,s=e.points,r=t.points,o=[];for(const a of i){let{start:l,end:c}=a;c=_y(l,c,s);const u=Cm(n,s[l],s[c],a.loop);if(!t.segments){o.push({source:a,target:u,start:s[l],end:s[c]});continue}const d=iM(t,u);for(const h of d){const f=Cm(n,r[h.start],r[h.end],h.loop),p=nM(a,s,f);for(const m of p)o.push({source:m,target:h,start:{[n]:Wx(u,f,"start",Math.max)},end:{[n]:Wx(u,f,"end",Math.min)}})}}return o}function Cm(e,t,n,i){if(i)return;let s=t[e],r=n[e];return e==="angle"&&(s=yn(s),r=yn(r)),{property:e,start:s,end:r}}function mR(e,t){const{x:n=null,y:i=null}=e||{},s=t.points,r=[];return t.segments.forEach(({start:o,end:a})=>{a=_y(o,a,s);const l=s[o],c=s[a];i!==null?(r.push({x:l.x,y:i}),r.push({x:c.x,y:i})):n!==null&&(r.push({x:n,y:l.y}),r.push({x:n,y:c.y}))}),r}function _y(e,t,n){for(;t>e;t--){const i=n[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function Wx(e,t,n,i){return e&&t?i(e[n],t[n]):e?e[n]:t?t[n]:0}function PM(e,t){let n=[],i=!1;return Ut(e)?(i=!0,n=e):n=mR(e,t),n.length?new Dh({points:n,options:{tension:0},_loop:i,_fullLoop:i}):null}function Hx(e){return e&&e.fill!==!1}function gR(e,t,n){let s=e[t].fill;const r=[t];let o;if(!n)return s;for(;s!==!1&&r.indexOf(s)===-1;){if(!oe(s))return s;if(o=e[s],!o)return!1;if(o.visible)return s;r.push(s),s=o.fill}return!1}function yR(e,t,n){const i=_R(e);if(gt(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return oe(s)&&Math.floor(s)===s?vR(i[0],t,s,n):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function vR(e,t,n,i){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=i?!1:n}function xR(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:gt(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function bR(e,t,n){let i;return e==="start"?i=n:e==="end"?i=t.options.reverse?t.min:t.max:gt(e)?i=e.value:i=t.getBaseValue(),i}function _R(e){const t=e.options,n=t.fill;let i=at(n&&n.target,n);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function wR(e){const{scale:t,index:n,line:i}=e,s=[],r=i.segments,o=i.points,a=kR(t,n);a.push(PM({x:null,y:t.bottom},i));for(let l=0;l=0;--o){const a=s[o].$filler;a&&(a.line.updateControlPoints(r,a.axis),i&&a.fill&&Hf(e.ctx,a,r))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const i=e.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const r=i[s].$filler;Hx(r)&&Hf(e.ctx,r,e.chartArea)}},beforeDatasetDraw(e,t,n){const i=t.meta.$filler;!Hx(i)||n.drawTime!=="beforeDatasetDraw"||Hf(e.ctx,i,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Kx=(e,t)=>{let{boxHeight:n=t,boxWidth:i=t}=e;return e.usePointStyle&&(n=Math.min(n,t),i=e.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:n,itemHeight:Math.max(t,n)}},RR=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;let Gx=class extends os{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,i){this.maxWidth=t,this.maxHeight=n,this._margins=i,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=$t(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(i=>t.filter(i,this.chart.data))),t.sort&&(n=n.sort((i,s)=>t.sort(i,s,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 i=t.labels,s=ge(i.font),r=s.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Kx(i,r);let c,u;n.font=s.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(o,r,a,l)+10):(u=this.maxHeight,c=this._fitCols(o,s,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,n,i,s){const{ctx:r,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=s+a;let d=t;r.textAlign="left",r.textBaseline="middle";let h=-1,f=-u;return this.legendItems.forEach((p,m)=>{const v=i+n/2+r.measureText(p.text).width;(m===0||c[c.length-1]+v+2*a>o)&&(d+=u,c[c.length-(m>0?0:1)]=0,f+=u,h++),l[m]={left:0,top:f,row:h,width:v,height:s},c[c.length-1]+=v+a}),d}_fitCols(t,n,i,s){const{ctx:r,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=o-t;let d=a,h=0,f=0,p=0,m=0;return this.legendItems.forEach((v,y)=>{const{itemWidth:g,itemHeight:x}=NR(i,n,r,v,s);y>0&&f+x+2*a>u&&(d+=h+a,c.push({width:h,height:f}),p+=h+a,m++,h=f=0),l[y]={left:p,top:f,col:m,width:g,height:x},h=Math.max(h,g),f+=x+a}),d+=h,c.push({width:h,height:f}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:i,labels:{padding:s},rtl:r}}=this,o=Oo(r,this.left,this.width);if(this.isHorizontal()){let a=0,l=Ne(i,this.left+s,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=Ne(i,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+t+s,c.left=o.leftForLtr(o.x(l),c.width),l+=c.width+s}else{let a=0,l=Ne(i,this.top+t+s,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=Ne(i,this.top+t+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=o.leftForLtr(o.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Ch(t,this),this._draw(),Ph(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:i,ctx:s}=this,{align:r,labels:o}=t,a=ne.color,l=Oo(t.rtl,this.left,this.width),c=ge(o.font),{padding:u}=o,d=c.size,h=d/2;let f;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:p,boxHeight:m,itemHeight:v}=Kx(o,d),y=function(S,C,M){if(isNaN(p)||p<=0||isNaN(m)||m<0)return;s.save();const P=at(M.lineWidth,1);if(s.fillStyle=at(M.fillStyle,a),s.lineCap=at(M.lineCap,"butt"),s.lineDashOffset=at(M.lineDashOffset,0),s.lineJoin=at(M.lineJoin,"miter"),s.lineWidth=P,s.strokeStyle=at(M.strokeStyle,a),s.setLineDash(at(M.lineDash,[])),o.usePointStyle){const T={radius:m*Math.SQRT2/2,pointStyle:M.pointStyle,rotation:M.rotation,borderWidth:P},A=l.xPlus(S,p/2),E=C+h;US(s,T,A,E,o.pointStyleWidth&&p)}else{const T=C+Math.max((d-m)/2,0),A=l.leftForLtr(S,p),E=Cr(M.borderRadius);s.beginPath(),Object.values(E).some(z=>z!==0)?Hl(s,{x:A,y:T,w:p,h:m,radius:E}):s.rect(A,T,p,m),s.fill(),P!==0&&s.stroke()}s.restore()},g=function(S,C,M){Br(s,M.text,S,C+v/2,c,{strikethrough:M.hidden,textAlign:l.textAlign(M.textAlign)})},x=this.isHorizontal(),_=this._computeTitleHeight();x?f={x:Ne(r,this.left+u,this.right-i[0]),y:this.top+u+_,line:0}:f={x:this.left+u,y:Ne(r,this.top+_+u,this.bottom-n[0].height),line:0},JS(this.ctx,t.textDirection);const w=v+u;this.legendItems.forEach((S,C)=>{s.strokeStyle=S.fontColor,s.fillStyle=S.fontColor;const M=s.measureText(S.text).width,P=l.textAlign(S.textAlign||(S.textAlign=o.textAlign)),T=p+h+M;let A=f.x,E=f.y;l.setWidth(this.width),x?C>0&&A+T+u>this.right&&(E=f.y+=w,f.line++,A=f.x=Ne(r,this.left+u,this.right-i[f.line])):C>0&&E+w>this.bottom&&(A=f.x=A+n[f.line].width+u,f.line++,E=f.y=Ne(r,this.top+_+u,this.bottom-n[f.line].height));const z=l.x(A);if(y(z,E,S),A=qA(P,A+p+h,x?A+T:this.right,t.rtl),g(l.x(A),E,S),x)f.x+=T+u;else if(typeof S.text!="string"){const N=c.lineHeight;f.y+=DM(S,N)+u}else f.y+=w}),tM(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,i=ge(n.font),s=Ae(n.padding);if(!n.display)return;const r=Oo(t.rtl,this.left,this.width),o=this.ctx,a=n.position,l=i.size/2,c=s.top+l;let u,d=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),u=this.top+c,d=Ne(t.align,d,this.right-h);else{const p=this.columnSizes.reduce((m,v)=>Math.max(m,v.height),0);u=c+Ne(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const f=Ne(a,d,d+h);o.textAlign=r.textAlign(uy(a)),o.textBaseline="middle",o.strokeStyle=n.color,o.fillStyle=n.color,o.font=i.string,Br(o,n.text,f,u,i)}_computeTitleHeight(){const t=this.options.title,n=ge(t.font),i=Ae(t.padding);return t.display?n.lineHeight+i.height:0}_getLegendItemAt(t,n){let i,s,r;if(Vi(t,this.left,this.right)&&Vi(n,this.top,this.bottom)){for(r=this.legendHitBoxes,i=0;ir.length>o.length?r:o)),t+n.size/2+i.measureText(s).width}function $R(e,t,n){let i=e;return typeof t.text!="string"&&(i=DM(t,n)),i}function DM(e,t){const n=e.text?e.text.length:0;return t*n}function IR(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var FR={id:"legend",_element:Gx,start(e,t,n){const i=e.legend=new Gx({ctx:e.ctx,options:n,chart:e});Fe.configure(e,i,n),Fe.addBox(e,i)},stop(e){Fe.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const i=e.legend;Fe.configure(e,i,n),i.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 i=t.datasetIndex,s=n.chart;s.isDatasetVisible(i)?(s.hide(i),t.hidden=!0):(s.show(i),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:i,textAlign:s,color:r,useBorderRadius:o,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),u=Ae(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:r,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:i||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:o&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};let wy=class extends os{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 i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const s=Ut(i.text)?i.text.length:1;this._padding=Ae(i.padding);const r=s*ge(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:i,bottom:s,right:r,options:o}=this,a=o.align;let l=0,c,u,d;return this.isHorizontal()?(u=Ne(a,i,r),d=n+t,c=r-i):(o.position==="left"?(u=i+t,d=Ne(a,s,n),l=Kt*-.5):(u=r-t,d=Ne(a,n,s),l=Kt*.5),c=s-n),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const i=ge(n.font),r=i.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(r);Br(t,n.text,0,0,i,{color:n.color,maxWidth:l,rotation:c,textAlign:uy(n.align),textBaseline:"middle",translation:[o,a]})}};function BR(e,t){const n=new wy({ctx:e.ctx,options:t,chart:e});Fe.configure(e,n,t),Fe.addBox(e,n),e.titleBlock=n}var VR={id:"title",_element:wy,start(e,t,n){BR(e,n)},stop(e){const t=e.titleBlock;Fe.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const i=e.titleBlock;Fe.configure(e,i,n),i.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 ru=new WeakMap;var zR={id:"subtitle",start(e,t,n){const i=new wy({ctx:e.ctx,options:n,chart:e});Fe.configure(e,i,n),Fe.addBox(e,i),ru.set(e,i)},stop(e){Fe.removeBox(e,ru.get(e)),ru.delete(e)},beforeUpdate(e,t,n){const i=ru.get(e);Fe.configure(e,i,n),i.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const qa={average(e){if(!e.length)return!1;let t,n,i=new Set,s=0,r=0;for(t=0,n=e.length;ta+l)/i.size,y:s/r}},nearest(e,t){if(!e.length)return!1;let n=t.x,i=t.y,s=Number.POSITIVE_INFINITY,r,o,a;for(r=0,o=e.length;ra({chart:t,initial:n.initial,numSteps:o,currentStep:Math.min(i-n.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=BS.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const r=i.items;let o=r.length-1,a=!1,l;for(;o>=0;--o)l=r[o],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),a=!0):(r[o]=r[r.length-1],r.pop());a&&(s.draw(),this._notify(s,i,t,"progress")),r.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),n+=r.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let i=n.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,i)),i}listen(t,n,i){this._getAnims(t).listeners[n].push(i)}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((i,s)=>Math.max(i,s._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 i=n.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}};var Ai=new qO;const ux="transparent",QO={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const i=tx(e||ux),s=i.valid&&tx(t||ux);return s&&s.valid?s.mix(i,n).hexString():t},number(e,t,n){return e+(t-e)*n}};let ZO=class{constructor(t,n,i,s){const r=n[i];s=Ht([t.to,s,r,t.from]);const o=Ht([t.from,r,s]);this._active=!0,this._fn=t.fn||QO[t.type||typeof o],this._easing=fl[t.easing]||fl.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=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(t,n,i){if(this._active){this._notify(!1);const s=this._target[this._prop],r=i-this._start,o=this._duration-r;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=Ht([t.to,n,s,t.from]),this._from=Ht([t.from,s,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,i=this._duration,s=this._prop,r=this._from,o=this._loop,a=this._to;let l;if(this._active=r!==a&&(o||n1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(r,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,i)=>{t.push({res:n,rej:i})})}_notify(t){const n=t?"res":"rej",i=this._promises||[];for(let s=0;s{const r=t[s];if(!gt(r))return;const o={};for(const a of n)o[a]=r[a];(Ut(r.properties)&&r.properties||[s]).forEach(a=>{(a===s||!i.has(a))&&i.set(a,o)})})}_animateOptions(t,n){const i=n.options,s=t2(t,i);if(!s)return[];const r=this._createAnimations(s,i);return i.$shared&&JO(t.options.$animations,i).then(()=>{t.options=i},()=>{}),r}_createAnimations(t,n){const i=this._properties,s=[],r=t.$animations||(t.$animations={}),o=Object.keys(n),a=Date.now();let l;for(l=o.length-1;l>=0;--l){const c=o[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,n));continue}const u=n[c];let d=r[c];const h=i.get(c);if(d)if(h&&d.active()){d.update(h,u,a);continue}else d.cancel();if(!h||!h.duration){t[c]=u;continue}r[c]=d=new ZO(h,t,c,u),s.push(d)}return s}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const i=this._createAnimations(t,n);if(i.length)return Ai.add(this._chart,i),!0}};function JO(e,t){const n=[],i=Object.keys(t);for(let s=0;s0||!n&&r<0)return s.index}return null}function mx(e,t){const{chart:n,_cachedMeta:i}=e,s=n._stacks||(n._stacks={}),{iScale:r,vScale:o,index:a}=i,l=r.axis,c=o.axis,u=s2(r,o,i),d=t.length;let h;for(let f=0;fn[i].axis===t).shift()}function a2(e,t){return Qs(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function l2(e,t,n){return Qs(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function xa(e,t){const n=e.controller.index,i=e.vScale&&e.vScale.axis;if(i){t=t||e._parsed;for(const s of t){const r=s._stacks;if(!r||r[i]===void 0||r[i][n]===void 0)return;delete r[i][n],r[i]._visualValues!==void 0&&r[i]._visualValues[n]!==void 0&&delete r[i]._visualValues[n]}}}const $f=e=>e==="reset"||e==="none",gx=(e,t)=>t?e:Object.assign({},e),c2=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:rM(n,!0),values:null};var Na;let Zs=(Na=class{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=fx(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&&xa(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,i=this.getDataset(),s=(d,h,f,p)=>d==="x"?h:d==="r"?p:f,r=n.xAxisID=at(i.xAxisID,jf(t,"x")),o=n.yAxisID=at(i.yAxisID,jf(t,"y")),a=n.rAxisID=at(i.rAxisID,jf(t,"r")),l=n.indexAxis,c=n.iAxisID=s(l,r,o,a),u=n.vAxisID=s(l,o,r,a);n.xScale=this.getScaleForId(r),n.yScale=this.getScaleForId(o),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(u)}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&&Qv(this._data,this),t._stacked&&xa(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),i=this._data;if(gt(n))this._data=i2(n);else if(i!==n){if(i){Qv(i,this);const s=this._cachedMeta;xa(s),s._parsed=[]}n&&Object.isExtensible(n)&&KA(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,i=this.getDataset();let s=!1;this._dataCheck();const r=n._stacked;n._stacked=fx(n.vScale,n),n.stack!==i.stack&&(s=!0,xa(n),n.stack=i.stack),this._resyncElements(t),(s||r!==n._stacked)&&mx(this,n._parsed)}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:i,_data:s}=this,{iScale:r,_stacked:o}=i,a=r.axis;let l=t===0&&n===s.length?!0:i._sorted,c=t>0&&i._parsed[t-1],u,d,h;if(this._parsing===!1)i._parsed=s,i._sorted=!0,h=s;else{Ut(s[t])?h=this.parseArrayData(i,s,t,n):gt(s[t])?h=this.parseObjectData(i,s,t,n):h=this.parsePrimitiveData(i,s,t,n);const f=()=>d[a]===null||c&&d[a]m||d=0;--h)if(!p()){this.updateRangeFromParsed(c,t,f,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,i=[];let s,r,o;for(s=0,r=n.length;s=0&&tthis.getContext(i,s,n),m=c.resolveNamedOptions(h,f,p,d);return m.$shared&&(m.$shared=l,r[o]=Object.freeze(gx(m,l))),m}_resolveAnimations(t,n,i){const s=this.chart,r=this._cachedDataOpts,o=`animation-${n}`,a=r[o];if(a)return a;let l;if(s.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,n),h=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(h,this.getContext(t,i,n))}const c=new sM(s,l&&l.animations);return l&&l._cacheable&&(r[o]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||$f(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const i=this.resolveDataElementOptions(t,n),s=this._sharedOptions,r=this.getSharedOptions(i),o=this.includeOptions(n,r)||r!==s;return this.updateSharedOptions(r,n,i),{sharedOptions:r,includeOptions:o}}updateElement(t,n,i,s){$f(s)?Object.assign(t,i):this._resolveAnimations(n,s).update(t,i)}updateSharedOptions(t,n,i){t&&!$f(n)&&this._resolveAnimations(void 0,n).update(t,i)}_setStyle(t,n,i,s){t.active=s;const r=this.getStyle(n,s);this._resolveAnimations(n,i,s).update(t,{options:!s&&this.getSharedOptions(r)||r})}removeHoverStyle(t,n,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,n,i){this._setStyle(t,i,"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,i=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const s=i.length,r=n.length,o=Math.min(r,s);o&&this.parse(0,o),r>s?this._insertElements(s,r-s,t):r{for(c.length+=n,a=c.length-1;a>=o;a--)c[a]=c[a-n]};for(l(r),a=t;as-r))}return e._cache.$bar}function d2(e){const t=e.iScale,n=u2(t,e.type);let i=t._length,s,r,o,a;const l=()=>{o===32767||o===-32768||(Wl(a)&&(i=Math.min(i,Math.abs(o-a)||i)),a=o)};for(s=0,r=n.length;s0?s[e-1]:null,a=eMath.abs(a)&&(l=a,c=o),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:r,min:o,max:a}}function oM(e,t,n,i){return Ut(e)?p2(e,t,n,i):t[n.axis]=n.parse(e,i),t}function yx(e,t,n,i){const s=e.iScale,r=e.vScale,o=s.getLabels(),a=s===r,l=[];let c,u,d,h;for(c=n,u=n+i;c=n?1:-1)}function g2(e){let t,n,i,s,r;return e.horizontal?(t=e.base>e.x,n="left",i="right"):(t=e.basel.controller.options.grouped),r=i.options.stacked,o=[],a=l=>{const c=l.controller.getParsed(n),u=c&&c[l.vScale.axis];if(bt(u)||isNaN(u))return!0};for(const l of s)if(!(n!==void 0&&a(l))&&((r===!1||o.indexOf(l.stack)===-1||r===void 0&&l.stack===void 0)&&o.push(l.stack),l.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,n,i){const s=this._getStacks(t,i),r=n!==void 0?s.indexOf(n):-1;return r===-1?s.length-1:r}_getRuler(){const t=this.options,n=this._cachedMeta,i=n.iScale,s=[];let r,o;for(r=0,o=n.data.length;r=0;--i)n=Math.max(n,t[i].size(this.resolveDataElementOptions(i))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:r}=n,o=this.getParsed(t),a=s.getLabelForValue(o.x),l=r.getLabelForValue(o.y),c=o._custom;return{label:i[t]||"",value:"("+a+", "+l+(c?", "+c:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,i,s){const r=s==="reset",{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(n,s),u=o.axis,d=a.axis;for(let h=n;hHl(x,a,l,!0)?1:Math.max(_,_*n,w,w*n),p=(x,_,w)=>Hl(x,a,l,!0)?-1:Math.min(_,_*n,w,w*n),m=f(0,c,d),v=f(ue,u,h),y=p(Kt,c,d),g=p(Kt+ue,u,h);i=(m-y)/2,s=(v-g)/2,r=-(m+y)/2,o=-(v+g)/2}return{ratioX:i,ratioY:s,offsetX:r,offsetY:o}}var no;let vy=(no=class extends Zs{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 i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let r=l=>+i[l];if(gt(i[t])){const{key:l="value"}=this._parsing;r=c=>+zs(i[c],l)}let o,a;for(o=t,a=t+n;o0&&!isNaN(t)?Xt*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=fc(n._parsed[t],i.options.locale);return{label:s[t]||"",value:r}}getMaxBorderWidth(t){let n=0;const i=this.chart;let s,r,o,a,l;if(!t){for(s=0,r=i.data.datasets.length;st!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),K(no,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return n.labels.map((r,o)=>{const l=t.getDatasetMeta(0).controller.getStyle(o);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(o),index:o}})}return[]}},onClick(t,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}}}),no);var Ia;let k2=(Ia=class extends Zs{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:i,data:s=[],_dataset:r}=n,o=this.chart._animationsDisabled;let{start:a,count:l}=zS(n,s,o);this._drawStart=a,this._drawCount=l,WS(n)&&(a=0,l=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!r._decimated,i.points=s;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:c},t),this.updateElements(s,a,l,t)}updateElements(t,n,i,s){const r=s==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(n,s),h=o.axis,f=a.axis,{spanGaps:p,segment:m}=this.options,v=Wo(p)?p:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||r||s==="none",g=n+i,x=t.length;let _=n>0&&this.getParsed(n-1);for(let w=0;w=g){C.skip=!0;continue}const M=this.getParsed(w),P=bt(M[f]),T=C[h]=o.getPixelForValue(M[h],w),A=C[f]=r||P?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,M,l):M[f],w);C.skip=isNaN(T)||isNaN(A)||P,C.stop=w>0&&Math.abs(M[h]-_[h])>v,m&&(C.parsed=M,C.raw=c.data[w]),d&&(C.options=u||this.resolveDataElementOptions(w,S.active?"active":s)),y||this.updateElement(S,w,C,s),_=M}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,i=n.options&&n.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const r=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,r,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}},K(Ia,"id","line"),K(Ia,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),K(Ia,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}}),Ia);var Fa;let aM=(Fa=class extends Zs{constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=fc(n._parsed[t].r,i.options.locale);return{label:s[t]||"",value:r}}parseObjectData(t,n,i,s){return QS.bind(this)(t,n,i,s)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,s)=>{const r=this.getParsed(s).r;!isNaN(r)&&this.chart.getDataVisibility(s)&&(rn.max&&(n.max=r))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,i=t.options,s=Math.min(n.right-n.left,n.bottom-n.top),r=Math.max(s/2,0),o=Math.max(i.cutoutPercentage?r/100*i.cutoutPercentage:1,0),a=(r-o)/t.getVisibleDatasetCount();this.outerRadius=r-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,n,i,s){const r=s==="reset",o=this.chart,l=o.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,d=c.yCenter,h=c.getIndexAngle(0)-.5*Kt;let f=h,p;const m=360/this.countVisibleElements();for(p=0;p{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&n++}),n}_computeAngle(t,n,i){return this.chart.getDataVisibility(t)?Jn(this.resolveDataElementOptions(t,n).angle||i):0}},K(Fa,"id","polarArea"),K(Fa,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),K(Fa,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return n.labels.map((r,o)=>{const l=t.getDatasetMeta(0).controller.getStyle(o);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(o),index:o}})}return[]}},onClick(t,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}}),Fa);var Ru;let S2=(Ru=class extends vy{},K(Ru,"id","pie"),K(Ru,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"}),Ru);var Ba;let M2=(Ba=class extends Zs{getLabelAndValue(t){const n=this._cachedMeta.vScale,i=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(i[n.axis])}}parseObjectData(t,n,i,s){return QS.bind(this)(t,n,i,s)}update(t){const n=this._cachedMeta,i=n.dataset,s=n.data||[],r=n.iScale.getLabels();if(i.points=s,t!=="resize"){const o=this.resolveDatasetElementOptions(t);this.options.showLine||(o.borderWidth=0);const a={_loop:!0,_fullLoop:r.length===s.length,options:o};this.updateElement(i,void 0,a,t)}this.updateElements(s,0,s.length,t)}updateElements(t,n,i,s){const r=this._cachedMeta.rScale,o=s==="reset";for(let a=n;a0&&this.getParsed(n-1);for(let _=n;_0&&Math.abs(S[f]-x[f])>y,v&&(C.parsed=S,C.raw=c.data[_]),h&&(C.options=d||this.resolveDataElementOptions(_,w.active?"active":s)),g||this.updateElement(w,_,C,s),x=S}this.updateSharedOptions(d,s,u)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let a=0;for(let l=n.length-1;l>=0;--l)a=Math.max(a,n[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!n.length)return s;const r=n[0].size(this.resolveDataElementOptions(0)),o=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(s,r,o)/2}},K(Va,"id","scatter"),K(Va,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),K(Va,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}}),Va);var P2=Object.freeze({__proto__:null,BarController:b2,BubbleController:_2,DoughnutController:vy,LineController:k2,PieController:S2,PolarAreaController:aM,RadarController:M2,ScatterController:C2});function or(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class xy{constructor(t){K(this,"options");this.options=t||{}}static override(t){Object.assign(xy.prototype,t)}init(){}formats(){return or()}parse(){return or()}format(){return or()}add(){return or()}diff(){return or()}startOf(){return or()}endOf(){return or()}}var T2={_date:xy};function D2(e,t,n,i){const{controller:s,data:r,_sorted:o}=e,a=s._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&o&&r.length){const l=a._reversePixels?YA:zi;if(i){if(s._sharedOptions){const c=r[0],u=typeof c.getRange=="function"&&c.getRange(t);if(u){const d=l(r,t,n-u),h=l(r,t,n+u);return{lo:d.lo,hi:h.hi}}}}else return l(r,t,n)}return{lo:0,hi:r.length-1}}function pc(e,t,n,i,s){const r=e.getSortedVisibleDatasetMetas(),o=n[t];for(let a=0,l=r.length;a{l[o](t[n],s)&&(r.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,s))}),i&&!a?[]:r}var R2={evaluateInteractionItems:pc,modes:{index(e,t,n,i){const s=fr(t,e),r=n.axis||"x",o=n.includeInvisible||!1,a=n.intersect?Ff(e,s,r,i,o):Bf(e,s,r,!1,i,o),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(e,t,n,i){const s=fr(t,e),r=n.axis||"xy",o=n.includeInvisible||!1;let a=n.intersect?Ff(e,s,r,i,o):Bf(e,s,r,!1,i,o);if(a.length>0){const l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let u=0;un.pos===t)}function _x(e,t){return e.filter(n=>lM.indexOf(n.pos)===-1&&n.box.axis===t)}function _a(e,t){return e.sort((n,i)=>{const s=t?i:n,r=t?n:i;return s.weight===r.weight?s.index-r.index:s.weight-r.weight})}function L2(e){const t=[];let n,i,s,r,o,a;for(n=0,i=(e||[]).length;nc.box.fullSize),!0),i=_a(ba(t,"left"),!0),s=_a(ba(t,"right")),r=_a(ba(t,"top"),!0),o=_a(ba(t,"bottom")),a=_x(t,"x"),l=_x(t,"y");return{fullSize:n,leftAndTop:i.concat(r),rightAndBottom:s.concat(l).concat(o).concat(a),chartArea:ba(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:r.concat(o).concat(a)}}function wx(e,t,n,i){return Math.max(e[n],t[n])+Math.max(e[i],t[i])}function cM(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 I2(e,t,n,i){const{pos:s,box:r}=n,o=e.maxPadding;if(!gt(s)){n.size&&(e[s]-=n.size);const d=i[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?r.height:r.width),n.size=d.size/d.count,e[s]+=n.size}r.getPadding&&cM(o,r.getPadding());const a=Math.max(0,t.outerWidth-wx(o,e,"left","right")),l=Math.max(0,t.outerHeight-wx(o,e,"top","bottom")),c=a!==e.w,u=l!==e.h;return e.w=a,e.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function F2(e){const t=e.maxPadding;function n(i){const s=Math.max(t[i]-e[i],0);return e[i]+=s,s}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function B2(e,t){const n=t.maxPadding;function i(s){const r={left:0,top:0,right:0,bottom:0};return s.forEach(o=>{r[o]=Math.max(t[o],n[o])}),r}return i(e?["left","right"]:["top","bottom"])}function Ga(e,t,n,i){const s=[];let r,o,a,l,c,u;for(r=0,o=e.length,c=0;r{typeof m.beforeLayout=="function"&&m.beforeLayout()});const u=l.reduce((m,v)=>v.box.options&&v.box.options.display===!1?m:m+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:s,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/u,hBoxMaxHeight:o/2}),h=Object.assign({},s);cM(h,Ae(i));const f=Object.assign({maxPadding:h,w:r,h:o,x:s.left,y:s.top},s),p=j2(l.concat(c),d);Ga(a.fullSize,f,d,p),Ga(l,f,d,p),Ga(c,f,d,p)&&Ga(l,f,d,p),F2(f),kx(a.leftAndTop,f,d,p),f.x+=f.w,f.y+=f.h,kx(a.rightAndBottom,f,d,p),e.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},Et(a.chartArea,m=>{const v=m.box;Object.assign(v,e.chartArea),v.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};let uM=class{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,i){}removeEventListener(t,n,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,i,s){return n=Math.max(0,n||t.width),i=i||t.height,{width:n,height:Math.max(0,s?Math.floor(n/s):i)}}isAttached(t){return!0}updateConfig(t){}},V2=class extends uM{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}};const Zu="$chartjs",z2={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Sx=e=>e===null||e==="";function W2(e,t){const n=e.style,i=e.getAttribute("height"),s=e.getAttribute("width");if(e[Zu]={initial:{height:i,width:s,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",Sx(s)){const r=ox(e,"width");r!==void 0&&(e.width=r)}if(Sx(i))if(e.style.height==="")e.height=e.width/(t||2);else{const r=ox(e,"height");r!==void 0&&(e.height=r)}return e}const dM=FO?{passive:!0}:!1;function H2(e,t,n){e&&e.addEventListener(t,n,dM)}function U2(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,dM)}function Y2(e,t){const n=z2[e.type]||e.type,{x:i,y:s}=fr(e,t);return{type:n,chart:t,native:e,x:i!==void 0?i:null,y:s!==void 0?s:null}}function Id(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function X2(e,t,n){const i=e.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||Id(a.addedNodes,i),o=o&&!Id(a.removedNodes,i);o&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}function K2(e,t,n){const i=e.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||Id(a.removedNodes,i),o=o&&!Id(a.addedNodes,i);o&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}const Yl=new Map;let Mx=0;function hM(){const e=window.devicePixelRatio;e!==Mx&&(Mx=e,Yl.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function G2(e,t){Yl.size||window.addEventListener("resize",hM),Yl.set(e,t)}function q2(e){Yl.delete(e),Yl.size||window.removeEventListener("resize",hM)}function Q2(e,t,n){const i=e.canvas,s=i&&yy(i);if(!s)return;const r=VS((a,l)=>{const c=s.clientWidth;n(a,l),c{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||r(c,u)});return o.observe(s),G2(e,r),o}function Vf(e,t,n){n&&n.disconnect(),t==="resize"&&q2(e)}function Z2(e,t,n){const i=e.canvas,s=VS(r=>{e.ctx!==null&&n(Y2(r,e))},e);return H2(i,t,s),s}let J2=class extends uM{acquireContext(t,n){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(W2(t,n),i):null}releaseContext(t){const n=t.canvas;if(!n[Zu])return!1;const i=n[Zu].initial;["height","width"].forEach(r=>{const o=i[r];bt(o)?n.removeAttribute(r):n.setAttribute(r,o)});const s=i.style||{};return Object.keys(s).forEach(r=>{n.style[r]=s[r]}),n.width=n.width,delete n[Zu],!0}addEventListener(t,n,i){this.removeEventListener(t,n);const s=t.$proxies||(t.$proxies={}),o={attach:X2,detach:K2,resize:Q2}[n]||Z2;s[n]=o(t,n,i)}removeEventListener(t,n){const i=t.$proxies||(t.$proxies={}),s=i[n];if(!s)return;({attach:Vf,detach:Vf,resize:Vf}[n]||U2)(t,n,s),i[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,i,s){return IO(t,n,i,s)}isAttached(t){const n=yy(t);return!!(n&&n.isConnected)}};function tR(e){return!gy()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?V2:J2}var Lu;let os=(Lu=class{constructor(){K(this,"x");K(this,"y");K(this,"active",!1);K(this,"options");K(this,"$animations")}tooltipPosition(t){const{x:n,y:i}=this.getProps(["x","y"],t);return{x:n,y:i}}hasValue(){return Wo(this.x)&&Wo(this.y)}getProps(t,n){const i=this.$animations;if(!n||!i)return this;const s={};return t.forEach(r=>{s[r]=i[r]&&i[r].active()?i[r]._to:this[r]}),s}},K(Lu,"defaults",{}),K(Lu,"defaultRoutes"),Lu);function eR(e,t){const n=e.options.ticks,i=nR(e),s=Math.min(n.maxTicksLimit||i,i),r=n.major.enabled?sR(t):[],o=r.length,a=r[0],l=r[o-1],c=[];if(o>s)return rR(t,c,r,o/s),c;const u=iR(r,t,s);if(o>0){let d,h;const f=o>1?Math.round((l-a)/(o-1)):null;for(nu(t,c,u,bt(f)?0:a-f,a),d=0,h=o-1;ds)return l}return Math.max(s,1)}function sR(e){const t=[];let n,i;for(n=0,i=e.length;ne==="left"?"right":e==="right"?"left":e,Cx=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,Px=(e,t)=>Math.min(t||e,e);function Tx(e,t){const n=[],i=e.length/t,s=e.length;let r=0;for(;ro+a)))return l}function cR(e,t){Et(e,n=>{const i=n.gc,s=i.length/2;let r;if(s>t){for(r=0;ri?i:n,i=s&&n>i?n:i,{min:mn(n,mn(i,n)),max:mn(i,mn(n,i))}}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(){$t(this.options.beforeUpdate,[this])}update(t,n,i){const{beginAtZero:s,grace:r,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=gO(this,r,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a=r||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const u=this._getLabelSizes(),d=u.widest.width,h=u.highest.height,f=we(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/i:f/(i-1),d+6>a&&(a=f/(i-(t.offset?.5:1)),l=this.maxHeight-wa(t.grid)-n.padding-Dx(t.title,this.chart.options.font),c=Math.sqrt(d*d+h*h),o=ly(Math.min(Math.asin(we((u.highest.height+6)/a,-1,1)),Math.asin(we(l/c,-1,1))-Math.asin(we(h/c,-1,1)))),o=Math.max(s,Math.min(r,o))),this.labelRotation=o}afterCalculateLabelRotation(){$t(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){$t(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:i,title:s,grid:r}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const l=Dx(s,n.options.font);if(a?(t.width=this.maxWidth,t.height=wa(r)+l):(t.height=this.maxHeight,t.width=wa(r)+l),i.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:h}=this._getLabelSizes(),f=i.padding*2,p=Jn(this.labelRotation),m=Math.cos(p),v=Math.sin(p);if(a){const y=i.mirror?0:v*d.width+m*h.height;t.height=Math.min(this.maxHeight,t.height+y+f)}else{const y=i.mirror?0:m*d.width+v*h.height;t.width=Math.min(this.maxWidth,t.width+y+f)}this._calculatePadding(c,u,v,m)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,i,s){const{ticks:{align:r,padding:o},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,f=0;l?c?(h=s*t.width,f=i*n.height):(h=i*t.height,f=s*n.width):r==="start"?f=n.width:r==="end"?h=t.width:r!=="inner"&&(h=t.width/2,f=n.width/2),this.paddingLeft=Math.max((h-u+o)*this.width/(this.width-u),0),this.paddingRight=Math.max((f-d+o)*this.width/(this.width-d),0)}else{let u=n.height/2,d=t.height/2;r==="start"?(u=0,d=t.height):r==="end"&&(u=n.height,d=0),this.paddingTop=u+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(){$t(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,i;for(n=0,i=t.length;n({width:o[P]||0,height:a[P]||0});return{first:M(0),last:M(n-1),widest:M(S),highest:M(C),widths:o,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return UA(this._alignToPixels?rr(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&&ta*s?a/i:l/s:l*s0}_computeGridLineItems(t){const n=this.axis,i=this.chart,s=this.options,{grid:r,position:o,border:a}=s,l=r.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),h=wa(r),f=[],p=a.setContext(this.getContext()),m=p.display?p.width:0,v=m/2,y=function(L){return rr(i,L,m)};let g,x,_,w,S,C,M,P,T,A,E,z;if(o==="top")g=y(this.bottom),C=this.bottom-h,P=g-v,A=y(t.top)+v,z=t.bottom;else if(o==="bottom")g=y(this.top),A=t.top,z=y(t.bottom)-v,C=g+v,P=this.top+h;else if(o==="left")g=y(this.right),S=this.right-h,M=g-v,T=y(t.left)+v,E=t.right;else if(o==="right")g=y(this.left),T=t.left,E=y(t.right)-v,S=g+v,M=this.left+h;else if(n==="x"){if(o==="center")g=y((t.top+t.bottom)/2+.5);else if(gt(o)){const L=Object.keys(o)[0],B=o[L];g=y(this.chart.scales[L].getPixelForValue(B))}A=t.top,z=t.bottom,C=g+v,P=C+h}else if(n==="y"){if(o==="center")g=y((t.left+t.right)/2);else if(gt(o)){const L=Object.keys(o)[0],B=o[L];g=y(this.chart.scales[L].getPixelForValue(B))}S=g-v,M=S-h,T=t.left,E=t.right}const N=at(s.ticks.maxTicksLimit,d),R=Math.max(1,Math.ceil(d/N));for(x=0;x0&&(U-=Z/2);break}V={left:U,top:O,width:Z+W.width,height:et+W.height,color:R.backdropColor}}v.push({label:_,font:P,textOffset:E,options:{rotation:m,color:B,strokeColor:D,strokeWidth:$,textAlign:F,textBaseline:z,translation:[w,S],backdrop:V}})}return v}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Jn(this.labelRotation))return t==="top"?"left":"right";let s="center";return n.align==="start"?s="left":n.align==="end"?s="right":n.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:i,mirror:s,padding:r}}=this.options,o=this._getLabelSizes(),a=t+r,l=o.widest.width;let c,u;return n==="left"?s?(u=this.right+r,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?s?(u=this.left+r,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_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:i,top:s,width:r,height:o}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(i,s,r,o),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const s=this.ticks.findIndex(r=>r.value===t);return s>=0?n.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const n=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let r,o;const a=(l,c,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(n.display)for(r=0,o=s.length;r{this.draw(r)}}]:[{z:i,draw:r=>{this.drawBackground(),this.drawGrid(r),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:n,draw:r=>{this.drawLabels(r)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let r,o;for(r=0,o=n.length;r{const i=n.split("."),s=i.pop(),r=[e].concat(i).join("."),o=t[n].split("."),a=o.pop(),l=o.join(".");ne.route(r,s,l,a)})}function gR(e){return"id"in e&&"defaults"in e}let yR=class{constructor(){this.controllers=new iu(Zs,"datasets",!0),this.elements=new iu(os,"elements"),this.plugins=new iu(Object,"plugins"),this.scales=new iu(mc,"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,i){[...n].forEach(s=>{const r=i||this._getRegistryForType(s);i||r.isForType(s)||r===this.plugins&&s.id?this._exec(t,r,s):Et(s,o=>{const a=i||this._getRegistryForType(o);this._exec(t,a,o)})})}_exec(t,n,i){const s=ay(t);$t(i["before"+s],[],i),n[t](i),$t(i["after"+s],[],i)}_getRegistryForType(t){for(let n=0;nr.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(s(n,i),t,"stop"),this._notify(s(i,n),t,"start")}};function xR(e){const t={},n=[],i=Object.keys(hi.plugins.items);for(let r=0;r1&&Ex(e[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function Ax(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function CR(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(i=>i.xAxisID===e||i.yAxisID===e);if(n.length)return Ax(e,"x",n[0])||Ax(e,"y",n[0])}return{}}function PR(e,t){const n=Fr[e.type]||{scales:{}},i=t.scales||{},s=wm(e.type,t),r=Object.create(null);return Object.keys(i).forEach(o=>{const a=i[o];if(!gt(a))return console.error(`Invalid scale configuration for scale: ${o}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const l=km(o,a,CR(o,e),ne.scales[a.type]),c=SR(l,s),u=n.scales||{};r[o]=dl(Object.create(null),[{axis:l},a,u[l],u[c]])}),e.data.datasets.forEach(o=>{const a=o.type||e.type,l=o.indexAxis||wm(a,t),u=(Fr[a]||{}).scales||{};Object.keys(u).forEach(d=>{const h=kR(d,l),f=o[h+"AxisID"]||h;r[f]=r[f]||Object.create(null),dl(r[f],[{axis:h},i[f],u[d]])})}),Object.keys(r).forEach(o=>{const a=r[o];dl(a,[ne.scales[a.type],ne.scale])}),r}function pM(e){const t=e.options||(e.options={});t.plugins=at(t.plugins,{}),t.scales=PR(e,t)}function mM(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function TR(e){return e=e||{},e.data=mM(e.data),pM(e),e}const Ox=new Map,gM=new Set;function su(e,t){let n=Ox.get(e);return n||(n=t(),Ox.set(e,n),gM.add(n)),n}const ka=(e,t,n)=>{const i=zs(t,n);i!==void 0&&e.add(i)};let DR=class{constructor(t){this._config=TR(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=mM(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(),pM(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return su(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return su(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return su(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,i=this.type;return su(`${i}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const i=this._scopeCache;let s=i.get(t);return(!s||n)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,n,i){const{options:s,type:r}=this,o=this._cachedScopes(t,i),a=o.get(n);if(a)return a;const l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(d=>ka(l,t,d))),u.forEach(d=>ka(l,s,d)),u.forEach(d=>ka(l,Fr[r]||{},d)),u.forEach(d=>ka(l,ne,d)),u.forEach(d=>ka(l,bm,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),gM.has(n)&&o.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,Fr[n]||{},ne.datasets[n]||{},{type:n},ne,bm]}resolveNamedOptions(t,n,i,s=[""]){const r={$shared:!0},{resolver:o,subPrefixes:a}=Rx(this._resolverCache,t,s);let l=o;if(AR(o,n)){r.$shared=!1,i=Ws(i)?i():i;const c=this.createResolver(t,i,a);l=Ho(o,i,c)}for(const c of n)r[c]=l[c];return r}createResolver(t,n,i=[""],s){const{resolver:r}=Rx(this._resolverCache,t,i);return gt(n)?Ho(r,n,void 0,s):r}};function Rx(e,t,n){let i=e.get(t);i||(i=new Map,e.set(t,i));const s=n.join();let r=i.get(s);return r||(r={resolver:fy(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},i.set(s,r)),r}const ER=e=>gt(e)&&Object.getOwnPropertyNames(e).some(t=>Ws(e[t]));function AR(e,t){const{isScriptable:n,isIndexable:i}=XS(e);for(const s of t){const r=n(s),o=i(s),a=(o||r)&&e[s];if(r&&(Ws(a)||ER(a))||o&&Ut(a))return!0}return!1}var OR="4.4.2";const RR=["top","bottom","left","right","chartArea"];function Lx(e,t){return e==="top"||e==="bottom"||RR.indexOf(e)===-1&&t==="x"}function Nx(e,t){return function(n,i){return n[e]===i[e]?n[t]-i[t]:n[e]-i[e]}}function jx(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),$t(n&&n.onComplete,[e],t)}function LR(e){const t=e.chart,n=t.options.animation;$t(n&&n.onProgress,[e],t)}function yM(e){return gy()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Ju={},$x=e=>{const t=yM(e);return Object.values(Ju).filter(n=>n.canvas===t).pop()};function NR(e,t,n){const i=Object.keys(e);for(const s of i){const r=+s;if(r>=t){const o=e[s];delete e[s],(n>0||r>t)&&(e[r+n]=o)}}}function jR(e,t,n,i){return!n||e.type==="mouseout"?null:i?t:e}function ru(e,t,n){return e.options.clip?e[n]:t[n]}function $R(e,t){const{xScale:n,yScale:i}=e;return n&&i?{left:ru(n,t,"left"),right:ru(n,t,"right"),top:ru(i,t,"top"),bottom:ru(i,t,"bottom")}:t}var fs;let by=(fs=class{static register(...t){hi.add(...t),Ix()}static unregister(...t){hi.remove(...t),Ix()}constructor(t,n){const i=this.config=new DR(n),s=yM(t),r=$x(s);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||tR(s)),this.platform.updateConfig(i);const a=this.platform.acquireContext(s,o.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=RA(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,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 vR,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=GA(d=>this.update(d),o.resizeDelay||0),this._dataChanges=[],Ju[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Ai.listen(this,"complete",jx),Ai.listen(this,"progress",LR),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:i,height:s,_aspectRatio:r}=this;return bt(t)?n&&r?r:s?i/s: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 hi}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():rx(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return nx(this.canvas,this.ctx),this}stop(){return Ai.stop(this),this}resize(t,n){Ai.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const i=this.options,s=this.canvas,r=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,t,n,r),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,rx(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),$t(i.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Et(n,(i,s)=>{i.id=s})}buildOrUpdateScales(){const t=this.options,n=t.scales,i=this.scales,s=Object.keys(i).reduce((o,a)=>(o[a]=!1,o),{});let r=[];n&&(r=r.concat(Object.keys(n).map(o=>{const a=n[o],l=km(o,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),Et(r,o=>{const a=o.options,l=a.id,c=km(l,a),u=at(a.type,o.dtype);(a.position===void 0||Lx(a.position,c)!==Lx(o.dposition))&&(a.position=o.dposition),s[l]=!0;let d=null;if(l in i&&i[l].type===u)d=i[l];else{const h=hi.getScale(u);d=new h({id:l,type:u,ctx:this.ctx,chart:this}),i[d.id]=d}d.init(a,t)}),Et(s,(o,a)=>{o||delete i[a]}),Et(i,o=>{Fe.configure(this,o,o.options),Fe.addBox(this,o)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,i=t.length;if(t.sort((s,r)=>s.index-r.index),i>n){for(let s=n;sn.length&&delete this._stacks,t.forEach((i,s)=>{n.filter(r=>r===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=n.length;i{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const i=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let c=0,u=this.data.datasets.length;c{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Nx("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Et(this.scales,t=>{Fe.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Xv(n,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:r}of n){const o=i==="_removeElements"?-r:r;NR(t,s,o)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,i=r=>new Set(t.filter(o=>o[0]===r).map((o,a)=>a+","+o.splice(1).join(","))),s=i(0);for(let r=1;rr.split(",")).map(r=>({method:r[1],start:+r[2],count:+r[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Fe.update(this,this.width,this.height,t);const n=this.chartArea,i=n.width<=0||n.height<=0;this._layers=[],Et(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,r)=>{s._idx=r}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,i=this.data.datasets.length;n=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,i=t._clip,s=!i.disabled,r=$R(t,this.chartArea),o={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(s&&Ch(n,{left:i.left===!1?0:r.left-i.left,right:i.right===!1?this.width:r.right+i.right,top:i.top===!1?0:r.top-i.top,bottom:i.bottom===!1?this.height:r.bottom+i.bottom}),t.controller.draw(),s&&Ph(n),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return Wi(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,i,s){const r=R2.modes[n];return typeof r=="function"?r(this,t,i,s):[]}getDatasetMeta(t){const n=this.data.datasets[t],i=this._metasets;let s=i.filter(r=>r&&r._dataset===n).pop();return s||(s={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},i.push(s)),s}getContext(){return this.$context||(this.$context=Qs(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!n.hidden}setDatasetVisibility(t,n){const i=this.getDatasetMeta(t);i.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,i){const s=i?"show":"hide",r=this.getDatasetMeta(t),o=r.controller._resolveAnimations(void 0,s);Wl(n)?(r.data[n].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(r,{visible:i}),this.update(a=>a.datasetIndex===t?s: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(),Ai.remove(this),t=0,n=this.data.datasets.length;t{n.addEventListener(this,r,o),t[r]=o},s=(r,o,a)=>{r.offsetX=o,r.offsetY=a,this._eventHandler(r)};Et(this.options.events,r=>i(r,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,i=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},r=(l,c)=>{this.canvas&&this.resize(l,c)};let o;const a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",r),i("detach",o)};o=()=>{this.attached=!1,s("resize",r),this._stop(),this._resize(0,0),i("attach",a)},n.isAttached(this.canvas)?a():o()}unbindEvents(){Et(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Et(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,i){const s=i?"set":"remove";let r,o,a,l;for(n==="dataset"&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=t.length;a{const a=this.getDatasetMeta(r);if(!a)throw new Error("No dataset found at index "+r);return{datasetIndex:r,element:a.data[o],index:o}});!Rd(i,n)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,n))}notifyPlugins(t,n,i){return this._plugins.notify(this,t,n,i)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,i){const s=this.options.hover,r=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),o=r(n,t),a=i?t:r(t,n);o.length&&this.updateHoverStyle(o,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,n){const i={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},s=o=>(o.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const r=this._handleEvent(t,n,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(r||i.changed)&&this.render(),this}_handleEvent(t,n,i){const{_active:s=[],options:r}=this,o=n,a=this._getActiveElements(t,s,i,o),l=FA(t),c=jR(t,this._lastEvent,i,l);i&&(this._lastEvent=null,$t(r.onHover,[t,a,this],this),l&&$t(r.onClick,[t,a,this],this));const u=!Rd(a,s);return(u||n)&&(this._active=a,this._updateHoverStyles(a,s,n)),this._lastEvent=c,u}_getActiveElements(t,n,i,s){if(t.type==="mouseout")return[];if(!i)return n;const r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,s)}},K(fs,"defaults",ne),K(fs,"instances",Ju),K(fs,"overrides",Fr),K(fs,"registry",hi),K(fs,"version",OR),K(fs,"getChart",$x),fs);function Ix(){return Et(by.instances,e=>e._plugins.invalidate())}function IR(e,t,n){const{startAngle:i,pixelMargin:s,x:r,y:o,outerRadius:a,innerRadius:l}=t;let c=s/a;e.beginPath(),e.arc(r,o,a,i-c,n+c),l>s?(c=s/l,e.arc(r,o,l,n+c,i-c,!0)):e.arc(r,o,s,n+ue,i-ue),e.closePath(),e.clip()}function FR(e){return hy(e,["outerStart","outerEnd","innerStart","innerEnd"])}function BR(e,t,n,i){const s=FR(e.options.borderRadius),r=(n-t)/2,o=Math.min(r,i*t/2),a=l=>{const c=(n-Math.min(r,l))*i/2;return we(l,0,Math.min(r,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:we(s.innerStart,0,o),innerEnd:we(s.innerEnd,0,o)}}function Zr(e,t,n,i){return{x:n+e*Math.cos(t),y:i+e*Math.sin(t)}}function Fd(e,t,n,i,s,r){const{x:o,y:a,startAngle:l,pixelMargin:c,innerRadius:u}=t,d=Math.max(t.outerRadius+i+n-c,0),h=u>0?u+i+n+c:0;let f=0;const p=s-l;if(i){const R=u>0?u-i:0,L=d>0?d-i:0,B=(R+L)/2,D=B!==0?p*B/(B+i):p;f=(p-D)/2}const m=Math.max(.001,p*d-n/Kt)/d,v=(p-m)/2,y=l+v+f,g=s-v-f,{outerStart:x,outerEnd:_,innerStart:w,innerEnd:S}=BR(t,h,d,g-y),C=d-x,M=d-_,P=y+x/C,T=g-_/M,A=h+w,E=h+S,z=y+w/A,N=g-S/E;if(e.beginPath(),r){const R=(P+T)/2;if(e.arc(o,a,d,P,R),e.arc(o,a,d,R,T),_>0){const $=Zr(M,T,o,a);e.arc($.x,$.y,_,T,g+ue)}const L=Zr(E,g,o,a);if(e.lineTo(L.x,L.y),S>0){const $=Zr(E,N,o,a);e.arc($.x,$.y,S,g+ue,N+Math.PI)}const B=(g-S/h+(y+w/h))/2;if(e.arc(o,a,h,g-S/h,B,!0),e.arc(o,a,h,B,y+w/h,!0),w>0){const $=Zr(A,z,o,a);e.arc($.x,$.y,w,z+Math.PI,y-ue)}const D=Zr(C,y,o,a);if(e.lineTo(D.x,D.y),x>0){const $=Zr(C,P,o,a);e.arc($.x,$.y,x,y-ue,P)}}else{e.moveTo(o,a);const R=Math.cos(P)*d+o,L=Math.sin(P)*d+a;e.lineTo(R,L);const B=Math.cos(T)*d+o,D=Math.sin(T)*d+a;e.lineTo(B,D)}e.closePath()}function VR(e,t,n,i,s){const{fullCircles:r,startAngle:o,circumference:a}=t;let l=t.endAngle;if(r){Fd(e,t,n,i,l,s);for(let c=0;c=Xt||Hl(o,l,c),v=Vi(a,u+f,d+f);return m&&v}getCenterPoint(n){const{x:i,y:s,startAngle:r,endAngle:o,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:c,spacing:u}=this.options,d=(r+o)/2,h=(a+l+u+c)/2;return{x:i+Math.cos(d)*h,y:s+Math.sin(d)*h}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:i,circumference:s}=this,r=(i.offset||0)/4,o=(i.spacing||0)/2,a=i.circular;if(this.pixelMargin=i.borderAlign==="inner"?.33:0,this.fullCircles=s>Xt?Math.floor(s/Xt):0,s===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const l=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(l)*r,Math.sin(l)*r);const c=1-Math.sin(Math.min(Kt,s||0)),u=r*c;n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,VR(n,this,u,o,a),zR(n,this,u,o,a),n.restore()}},K(io,"id","arc"),K(io,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),K(io,"defaultRoutes",{backgroundColor:"backgroundColor"}),K(io,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"}),io);function xM(e,t,n=t){e.lineCap=at(n.borderCapStyle,t.borderCapStyle),e.setLineDash(at(n.borderDash,t.borderDash)),e.lineDashOffset=at(n.borderDashOffset,t.borderDashOffset),e.lineJoin=at(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=at(n.borderWidth,t.borderWidth),e.strokeStyle=at(n.borderColor,t.borderColor)}function WR(e,t,n){e.lineTo(n.x,n.y)}function HR(e){return e.stepped?aO:e.tension||e.cubicInterpolationMode==="monotone"?lO:WR}function bM(e,t,n={}){const i=e.length,{start:s=0,end:r=i-1}=n,{start:o,end:a}=t,l=Math.max(s,o),c=Math.min(r,a),u=sa&&r>a;return{count:i,start:l,loop:t.loop,ilen:c(o+(c?a-_:_))%r,x=()=>{m!==v&&(e.lineTo(u,v),e.lineTo(u,m),e.lineTo(u,y))};for(l&&(f=s[g(0)],e.moveTo(f.x,f.y)),h=0;h<=a;++h){if(f=s[g(h)],f.skip)continue;const _=f.x,w=f.y,S=_|0;S===p?(wv&&(v=w),u=(d*u+_)/++d):(x(),e.lineTo(_,w),p=S,d=0,m=v=w),y=w}x()}function Sm(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?YR:UR}function XR(e){return e.stepped?BO:e.tension||e.cubicInterpolationMode==="monotone"?VO:pr}function KR(e,t,n,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,n,i)&&s.closePath()),xM(e,t.options),e.stroke(s)}function GR(e,t,n,i){const{segments:s,options:r}=t,o=Sm(t);for(const a of s)xM(e,r,a.style),e.beginPath(),o(e,t,a,{start:n,end:n+i-1})&&e.closePath(),e.stroke()}const qR=typeof Path2D=="function";function QR(e,t,n,i){qR&&!t.options.segment?KR(e,t,n,i):GR(e,t,n,i)}var so;let Dh=(so=class extends os{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 i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;OO(this._points,i,t,s,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=XO(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,i=t.length;return i&&n[t[i-1].end]}interpolate(t,n){const i=this.options,s=t[n],r=this.points,o=iM(this,{property:n,start:s,end:s});if(!o.length)return;const a=[],l=XR(i);let c,u;for(c=0,u=o.length;ct!=="borderDash"&&t!=="fill"}),so);function Fx(e,t,n,i){const s=e.options,{[n]:r}=e.getProps([n],i);return Math.abs(t-r)e.replace("rgb(","rgba(").replace(")",", 0.5)"));function SM(e){return Mm[e%Mm.length]}function MM(e){return Bx[e%Bx.length]}function sL(e,t){return e.borderColor=SM(t),e.backgroundColor=MM(t),++t}function rL(e,t){return e.backgroundColor=e.data.map(()=>SM(t++)),t}function oL(e,t){return e.backgroundColor=e.data.map(()=>MM(t++)),t}function aL(e){let t=0;return(n,i)=>{const s=e.getDatasetMeta(i).controller;s instanceof vy?t=rL(n,t):s instanceof aM?t=oL(n,t):s&&(t=sL(n,t))}}function Vx(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function lL(e){return e&&(e.borderColor||e.backgroundColor)}var cL={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:i},options:s}=e.config,{elements:r}=s;if(!n.forceOverride&&(Vx(i)||lL(s)||r&&Vx(r)))return;const o=aL(e);i.forEach(o)}};function uL(e,t,n,i,s){const r=s.samples||i;if(r>=n)return e.slice(t,t+n);const o=[],a=(n-2)/(r-2);let l=0;const c=t+n-1;let u=t,d,h,f,p,m;for(o[l++]=e[u],d=0;df&&(f=p,h=e[g],m=g);o[l++]=h,u=m}return o[l++]=e[c],o}function dL(e,t,n,i){let s=0,r=0,o,a,l,c,u,d,h,f,p,m;const v=[],y=t+n-1,g=e[t].x,_=e[y].x-g;for(o=t;om&&(m=c,h=o),s=(r*s+a.x)/++r;else{const S=o-1;if(!bt(d)&&!bt(h)){const C=Math.min(d,h),M=Math.max(d,h);C!==f&&C!==S&&v.push({...e[C],x:s}),M!==f&&M!==S&&v.push({...e[M],x:s})}o>0&&S!==f&&v.push(e[S]),v.push(a),u=w,r=0,p=m=c,d=h=f=o}}return v}function CM(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function zx(e){e.data.datasets.forEach(t=>{CM(t)})}function hL(e,t){const n=t.length;let i=0,s;const{iScale:r}=e,{min:o,max:a,minDefined:l,maxDefined:c}=r.getUserBounds();return l&&(i=we(zi(t,r.axis,o).lo,0,n-1)),c?s=we(zi(t,r.axis,a).hi+1,i,n)-i:s=n-i,{start:i,count:s}}var fL={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){zx(e);return}const i=e.width;e.data.datasets.forEach((s,r)=>{const{_data:o,indexAxis:a}=s,l=e.getDatasetMeta(r),c=o||s.data;if(Ht([a,e.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const u=e.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||e.options.parsing)return;let{start:d,count:h}=hL(l,c);const f=n.threshold||4*i;if(h<=f){CM(s);return}bt(o)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(m){this._data=m}}));let p;switch(n.algorithm){case"lttb":p=uL(c,d,h,i,n);break;case"min-max":p=dL(c,d,h,i);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}s._decimated=p})},destroy(e){zx(e)}};function pL(e,t,n){const i=e.segments,s=e.points,r=t.points,o=[];for(const a of i){let{start:l,end:c}=a;c=_y(l,c,s);const u=Cm(n,s[l],s[c],a.loop);if(!t.segments){o.push({source:a,target:u,start:s[l],end:s[c]});continue}const d=iM(t,u);for(const h of d){const f=Cm(n,r[h.start],r[h.end],h.loop),p=nM(a,s,f);for(const m of p)o.push({source:m,target:h,start:{[n]:Wx(u,f,"start",Math.max)},end:{[n]:Wx(u,f,"end",Math.min)}})}}return o}function Cm(e,t,n,i){if(i)return;let s=t[e],r=n[e];return e==="angle"&&(s=yn(s),r=yn(r)),{property:e,start:s,end:r}}function mL(e,t){const{x:n=null,y:i=null}=e||{},s=t.points,r=[];return t.segments.forEach(({start:o,end:a})=>{a=_y(o,a,s);const l=s[o],c=s[a];i!==null?(r.push({x:l.x,y:i}),r.push({x:c.x,y:i})):n!==null&&(r.push({x:n,y:l.y}),r.push({x:n,y:c.y}))}),r}function _y(e,t,n){for(;t>e;t--){const i=n[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function Wx(e,t,n,i){return e&&t?i(e[n],t[n]):e?e[n]:t?t[n]:0}function PM(e,t){let n=[],i=!1;return Ut(e)?(i=!0,n=e):n=mL(e,t),n.length?new Dh({points:n,options:{tension:0},_loop:i,_fullLoop:i}):null}function Hx(e){return e&&e.fill!==!1}function gL(e,t,n){let s=e[t].fill;const r=[t];let o;if(!n)return s;for(;s!==!1&&r.indexOf(s)===-1;){if(!oe(s))return s;if(o=e[s],!o)return!1;if(o.visible)return s;r.push(s),s=o.fill}return!1}function yL(e,t,n){const i=_L(e);if(gt(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return oe(s)&&Math.floor(s)===s?vL(i[0],t,s,n):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function vL(e,t,n,i){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=i?!1:n}function xL(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:gt(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function bL(e,t,n){let i;return e==="start"?i=n:e==="end"?i=t.options.reverse?t.min:t.max:gt(e)?i=e.value:i=t.getBaseValue(),i}function _L(e){const t=e.options,n=t.fill;let i=at(n&&n.target,n);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function wL(e){const{scale:t,index:n,line:i}=e,s=[],r=i.segments,o=i.points,a=kL(t,n);a.push(PM({x:null,y:t.bottom},i));for(let l=0;l=0;--o){const a=s[o].$filler;a&&(a.line.updateControlPoints(r,a.axis),i&&a.fill&&Hf(e.ctx,a,r))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const i=e.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const r=i[s].$filler;Hx(r)&&Hf(e.ctx,r,e.chartArea)}},beforeDatasetDraw(e,t,n){const i=t.meta.$filler;!Hx(i)||n.drawTime!=="beforeDatasetDraw"||Hf(e.ctx,i,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Kx=(e,t)=>{let{boxHeight:n=t,boxWidth:i=t}=e;return e.usePointStyle&&(n=Math.min(n,t),i=e.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:n,itemHeight:Math.max(t,n)}},LL=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;let Gx=class extends os{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,i){this.maxWidth=t,this.maxHeight=n,this._margins=i,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=$t(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(i=>t.filter(i,this.chart.data))),t.sort&&(n=n.sort((i,s)=>t.sort(i,s,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 i=t.labels,s=ge(i.font),r=s.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Kx(i,r);let c,u;n.font=s.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(o,r,a,l)+10):(u=this.maxHeight,c=this._fitCols(o,s,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,n,i,s){const{ctx:r,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=s+a;let d=t;r.textAlign="left",r.textBaseline="middle";let h=-1,f=-u;return this.legendItems.forEach((p,m)=>{const v=i+n/2+r.measureText(p.text).width;(m===0||c[c.length-1]+v+2*a>o)&&(d+=u,c[c.length-(m>0?0:1)]=0,f+=u,h++),l[m]={left:0,top:f,row:h,width:v,height:s},c[c.length-1]+=v+a}),d}_fitCols(t,n,i,s){const{ctx:r,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=o-t;let d=a,h=0,f=0,p=0,m=0;return this.legendItems.forEach((v,y)=>{const{itemWidth:g,itemHeight:x}=NL(i,n,r,v,s);y>0&&f+x+2*a>u&&(d+=h+a,c.push({width:h,height:f}),p+=h+a,m++,h=f=0),l[y]={left:p,top:f,col:m,width:g,height:x},h=Math.max(h,g),f+=x+a}),d+=h,c.push({width:h,height:f}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:i,labels:{padding:s},rtl:r}}=this,o=Oo(r,this.left,this.width);if(this.isHorizontal()){let a=0,l=Ne(i,this.left+s,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=Ne(i,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+t+s,c.left=o.leftForLtr(o.x(l),c.width),l+=c.width+s}else{let a=0,l=Ne(i,this.top+t+s,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=Ne(i,this.top+t+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=o.leftForLtr(o.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Ch(t,this),this._draw(),Ph(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:i,ctx:s}=this,{align:r,labels:o}=t,a=ne.color,l=Oo(t.rtl,this.left,this.width),c=ge(o.font),{padding:u}=o,d=c.size,h=d/2;let f;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:p,boxHeight:m,itemHeight:v}=Kx(o,d),y=function(S,C,M){if(isNaN(p)||p<=0||isNaN(m)||m<0)return;s.save();const P=at(M.lineWidth,1);if(s.fillStyle=at(M.fillStyle,a),s.lineCap=at(M.lineCap,"butt"),s.lineDashOffset=at(M.lineDashOffset,0),s.lineJoin=at(M.lineJoin,"miter"),s.lineWidth=P,s.strokeStyle=at(M.strokeStyle,a),s.setLineDash(at(M.lineDash,[])),o.usePointStyle){const T={radius:m*Math.SQRT2/2,pointStyle:M.pointStyle,rotation:M.rotation,borderWidth:P},A=l.xPlus(S,p/2),E=C+h;US(s,T,A,E,o.pointStyleWidth&&p)}else{const T=C+Math.max((d-m)/2,0),A=l.leftForLtr(S,p),E=Cr(M.borderRadius);s.beginPath(),Object.values(E).some(z=>z!==0)?Ul(s,{x:A,y:T,w:p,h:m,radius:E}):s.rect(A,T,p,m),s.fill(),P!==0&&s.stroke()}s.restore()},g=function(S,C,M){Br(s,M.text,S,C+v/2,c,{strikethrough:M.hidden,textAlign:l.textAlign(M.textAlign)})},x=this.isHorizontal(),_=this._computeTitleHeight();x?f={x:Ne(r,this.left+u,this.right-i[0]),y:this.top+u+_,line:0}:f={x:this.left+u,y:Ne(r,this.top+_+u,this.bottom-n[0].height),line:0},JS(this.ctx,t.textDirection);const w=v+u;this.legendItems.forEach((S,C)=>{s.strokeStyle=S.fontColor,s.fillStyle=S.fontColor;const M=s.measureText(S.text).width,P=l.textAlign(S.textAlign||(S.textAlign=o.textAlign)),T=p+h+M;let A=f.x,E=f.y;l.setWidth(this.width),x?C>0&&A+T+u>this.right&&(E=f.y+=w,f.line++,A=f.x=Ne(r,this.left+u,this.right-i[f.line])):C>0&&E+w>this.bottom&&(A=f.x=A+n[f.line].width+u,f.line++,E=f.y=Ne(r,this.top+_+u,this.bottom-n[f.line].height));const z=l.x(A);if(y(z,E,S),A=qA(P,A+p+h,x?A+T:this.right,t.rtl),g(l.x(A),E,S),x)f.x+=T+u;else if(typeof S.text!="string"){const N=c.lineHeight;f.y+=DM(S,N)+u}else f.y+=w}),tM(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,i=ge(n.font),s=Ae(n.padding);if(!n.display)return;const r=Oo(t.rtl,this.left,this.width),o=this.ctx,a=n.position,l=i.size/2,c=s.top+l;let u,d=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),u=this.top+c,d=Ne(t.align,d,this.right-h);else{const p=this.columnSizes.reduce((m,v)=>Math.max(m,v.height),0);u=c+Ne(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const f=Ne(a,d,d+h);o.textAlign=r.textAlign(uy(a)),o.textBaseline="middle",o.strokeStyle=n.color,o.fillStyle=n.color,o.font=i.string,Br(o,n.text,f,u,i)}_computeTitleHeight(){const t=this.options.title,n=ge(t.font),i=Ae(t.padding);return t.display?n.lineHeight+i.height:0}_getLegendItemAt(t,n){let i,s,r;if(Vi(t,this.left,this.right)&&Vi(n,this.top,this.bottom)){for(r=this.legendHitBoxes,i=0;ir.length>o.length?r:o)),t+n.size/2+i.measureText(s).width}function $L(e,t,n){let i=e;return typeof t.text!="string"&&(i=DM(t,n)),i}function DM(e,t){const n=e.text?e.text.length:0;return t*n}function IL(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var FL={id:"legend",_element:Gx,start(e,t,n){const i=e.legend=new Gx({ctx:e.ctx,options:n,chart:e});Fe.configure(e,i,n),Fe.addBox(e,i)},stop(e){Fe.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const i=e.legend;Fe.configure(e,i,n),i.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 i=t.datasetIndex,s=n.chart;s.isDatasetVisible(i)?(s.hide(i),t.hidden=!0):(s.show(i),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:i,textAlign:s,color:r,useBorderRadius:o,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),u=Ae(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:r,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:i||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:o&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};let wy=class extends os{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 i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const s=Ut(i.text)?i.text.length:1;this._padding=Ae(i.padding);const r=s*ge(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:i,bottom:s,right:r,options:o}=this,a=o.align;let l=0,c,u,d;return this.isHorizontal()?(u=Ne(a,i,r),d=n+t,c=r-i):(o.position==="left"?(u=i+t,d=Ne(a,s,n),l=Kt*-.5):(u=r-t,d=Ne(a,n,s),l=Kt*.5),c=s-n),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const i=ge(n.font),r=i.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(r);Br(t,n.text,0,0,i,{color:n.color,maxWidth:l,rotation:c,textAlign:uy(n.align),textBaseline:"middle",translation:[o,a]})}};function BL(e,t){const n=new wy({ctx:e.ctx,options:t,chart:e});Fe.configure(e,n,t),Fe.addBox(e,n),e.titleBlock=n}var VL={id:"title",_element:wy,start(e,t,n){BL(e,n)},stop(e){const t=e.titleBlock;Fe.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const i=e.titleBlock;Fe.configure(e,i,n),i.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 ou=new WeakMap;var zL={id:"subtitle",start(e,t,n){const i=new wy({ctx:e.ctx,options:n,chart:e});Fe.configure(e,i,n),Fe.addBox(e,i),ou.set(e,i)},stop(e){Fe.removeBox(e,ou.get(e)),ou.delete(e)},beforeUpdate(e,t,n){const i=ou.get(e);Fe.configure(e,i,n),i.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const qa={average(e){if(!e.length)return!1;let t,n,i=new Set,s=0,r=0;for(t=0,n=e.length;ta+l)/i.size,y:s/r}},nearest(e,t){if(!e.length)return!1;let n=t.x,i=t.y,s=Number.POSITIVE_INFINITY,r,o,a;for(r=0,o=e.length;r-1?e.split(` -`):e}function WR(e,t){const{element:n,datasetIndex:i,index:s}=t,r=e.getDatasetMeta(i).controller,{label:o,value:a}=r.getLabelAndValue(s);return{chart:e,label:o,parsed:r.getParsed(s),raw:e.data.datasets[i].data[s],formattedValue:a,dataset:r.getDataset(),dataIndex:s,datasetIndex:i,element:n}}function qx(e,t){const n=e.chart.ctx,{body:i,footer:s,title:r}=e,{boxWidth:o,boxHeight:a}=t,l=ge(t.bodyFont),c=ge(t.titleFont),u=ge(t.footerFont),d=r.length,h=s.length,f=i.length,p=Ae(t.padding);let m=p.height,v=0,y=i.reduce((_,w)=>_+w.before.length+w.lines.length+w.after.length,0);if(y+=e.beforeBody.length+e.afterBody.length,d&&(m+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),y){const _=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;m+=f*_+(y-f)*l.lineHeight+(y-1)*t.bodySpacing}h&&(m+=t.footerMarginTop+h*u.lineHeight+(h-1)*t.footerSpacing);let g=0;const x=function(_){v=Math.max(v,n.measureText(_).width+g)};return n.save(),n.font=c.string,Et(e.title,x),n.font=l.string,Et(e.beforeBody.concat(e.afterBody),x),g=t.displayColors?o+2+t.boxPadding:0,Et(i,_=>{Et(_.before,x),Et(_.lines,x),Et(_.after,x)}),g=0,n.font=u.string,Et(e.footer,x),n.restore(),v+=p.width,{width:v,height:m}}function HR(e,t){const{y:n,height:i}=t;return ne.height-i/2?"bottom":"center"}function UR(e,t,n,i){const{x:s,width:r}=i,o=n.caretSize+n.caretPadding;if(e==="left"&&s+r+o>t.width||e==="right"&&s-r-o<0)return!0}function YR(e,t,n,i){const{x:s,width:r}=n,{width:o,chartArea:{left:a,right:l}}=e;let c="center";return i==="center"?c=s<=(a+l)/2?"left":"right":s<=r/2?c="left":s>=o-r/2&&(c="right"),UR(c,e,t,n)&&(c="center"),c}function Qx(e,t,n){const i=n.yAlign||t.yAlign||HR(e,n);return{xAlign:n.xAlign||t.xAlign||YR(e,t,n,i),yAlign:i}}function XR(e,t){let{x:n,width:i}=e;return t==="right"?n-=i:t==="center"&&(n-=i/2),n}function KR(e,t,n){let{y:i,height:s}=e;return t==="top"?i+=n:t==="bottom"?i-=s+n:i-=s/2,i}function Zx(e,t,n,i){const{caretSize:s,caretPadding:r,cornerRadius:o}=e,{xAlign:a,yAlign:l}=n,c=s+r,{topLeft:u,topRight:d,bottomLeft:h,bottomRight:f}=Cr(o);let p=XR(t,a);const m=KR(t,l,c);return l==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(u,h)+s:a==="right"&&(p+=Math.max(d,f)+s),{x:we(p,0,i.width-t.width),y:we(m,0,i.height-t.height)}}function ou(e,t,n){const i=Ae(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-i.right:e.x+i.left}function Jx(e){return ci([],Oi(e))}function GR(e,t,n){return Qs(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function tb(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const EM={beforeTitle:Di,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,i=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex"u"?EM[t].call(n,i):s}var kp;let eb=(kp=class extends os{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,i=this.options.setContext(this.getContext()),s=i.enabled&&n.options.animation&&i.animations,r=new sM(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=GR(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:i}=n,s=qe(i,"beforeTitle",this,t),r=qe(i,"title",this,t),o=qe(i,"afterTitle",this,t);let a=[];return a=ci(a,Oi(s)),a=ci(a,Oi(r)),a=ci(a,Oi(o)),a}getBeforeBody(t,n){return Jx(qe(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:i}=n,s=[];return Et(t,r=>{const o={before:[],lines:[],after:[]},a=tb(i,r);ci(o.before,Oi(qe(a,"beforeLabel",this,r))),ci(o.lines,qe(a,"label",this,r)),ci(o.after,Oi(qe(a,"afterLabel",this,r))),s.push(o)}),s}getAfterBody(t,n){return Jx(qe(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:i}=n,s=qe(i,"beforeFooter",this,t),r=qe(i,"footer",this,t),o=qe(i,"afterFooter",this,t);let a=[];return a=ci(a,Oi(s)),a=ci(a,Oi(r)),a=ci(a,Oi(o)),a}_createItems(t){const n=this._active,i=this.chart.data,s=[],r=[],o=[];let a=[],l,c;for(l=0,c=n.length;lt.filter(u,d,h,i))),t.itemSort&&(a=a.sort((u,d)=>t.itemSort(u,d,i))),Et(a,u=>{const d=tb(t.callbacks,u);s.push(qe(d,"labelColor",this,u)),r.push(qe(d,"labelPointStyle",this,u)),o.push(qe(d,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=r,this.labelTextColors=o,this.dataPoints=a,a}update(t,n){const i=this.options.setContext(this.getContext()),s=this._active;let r,o=[];if(!s.length)this.opacity!==0&&(r={opacity:0});else{const a=qa[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const l=this._size=qx(this,i),c=Object.assign({},a,l),u=Qx(this.chart,i,c),d=Zx(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,r={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,i,s){const r=this.getCaretPosition(t,i,s);n.lineTo(r.x1,r.y1),n.lineTo(r.x2,r.y2),n.lineTo(r.x3,r.y3)}getCaretPosition(t,n,i){const{xAlign:s,yAlign:r}=this,{caretSize:o,cornerRadius:a}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=Cr(a),{x:h,y:f}=t,{width:p,height:m}=n;let v,y,g,x,_,w;return r==="center"?(_=f+m/2,s==="left"?(v=h,y=v-o,x=_+o,w=_-o):(v=h+p,y=v+o,x=_-o,w=_+o),g=v):(s==="left"?y=h+Math.max(l,u)+o:s==="right"?y=h+p-Math.max(c,d)-o:y=this.caretX,r==="top"?(x=f,_=x-o,v=y-o,g=y+o):(x=f+m,_=x+o,v=y+o,g=y-o),w=x),{x1:v,x2:y,x3:g,y1:x,y2:_,y3:w}}drawTitle(t,n,i){const s=this.title,r=s.length;let o,a,l;if(r){const c=Oo(i.rtl,this.x,this.width);for(t.x=ou(this,i.titleAlign,i),n.textAlign=c.textAlign(i.titleAlign),n.textBaseline="middle",o=ge(i.titleFont),a=i.titleSpacing,n.fillStyle=i.titleColor,n.font=o.string,l=0;lg!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,Hl(t,{x:m,y:p,w:c,h:l,radius:y}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),Hl(t,{x:v,y:p+1,w:c-2,h:l-2,radius:y}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(m,p,c,l),t.strokeRect(m,p,c,l),t.fillStyle=o.backgroundColor,t.fillRect(v,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,n,i){const{body:s}=this,{bodySpacing:r,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=i,d=ge(i.bodyFont);let h=d.lineHeight,f=0;const p=Oo(i.rtl,this.x,this.width),m=function(M){n.fillText(M,p.x(t.x+f),t.y+h/2),t.y+=h+r},v=p.textAlign(o);let y,g,x,_,w,S,C;for(n.textAlign=o,n.textBaseline="middle",n.font=d.string,t.x=ou(this,v,i),n.fillStyle=i.bodyColor,Et(this.beforeBody,m),f=a&&v!=="right"?o==="center"?c/2+u:c+2+u:0,_=0,S=s.length;_0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,i=this.$animations,s=i&&i.x,r=i&&i.y;if(s||r){const o=qa[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=qx(this,t),l=Object.assign({},o,this._size),c=Qx(n,t,l),u=Zx(t,l,c,n);(s._to!==u.x||r._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(n);const s={width:this.width,height:this.height},r={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=Ae(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(r,t,s,n),JS(t,n.textDirection),r.y+=o.top,this.drawTitle(r,t,n),this.drawBody(r,t,n),this.drawFooter(r,t,n),tM(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const i=this._active,s=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),r=!Ld(i,s),o=this._positionChanged(s,n);(r||o)&&(this._active=s,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,i=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,r=this._active||[],o=this._getActiveElements(t,r,n,i),a=this._positionChanged(o,t),l=n||!Ld(o,r)||a;return l&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,i,s){const r=this.options;if(t.type==="mouseout")return[];if(!s)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const o=this.chart.getElementsAtEventForMode(t,r.mode,r,i);return r.reverse&&o.reverse(),o}_positionChanged(t,n){const{caretX:i,caretY:s,options:r}=this,o=qa[r.position].call(this,t,n);return o!==!1&&(i!==o.x||s!==o.y)}},K(kp,"positioners",qa),kp);var qR={id:"tooltip",_element:eb,positioners:qa,afterInit(e,t,n){n&&(e.tooltip=new eb({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:EM},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"]},QR=Object.freeze({__proto__:null,Colors:cR,Decimation:fR,Filler:LR,Legend:FR,SubTitle:zR,Title:VR,Tooltip:qR});const ZR=(e,t,n,i)=>(typeof t=="string"?(n=e.push(t)-1,i.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function JR(e,t,n,i){const s=e.indexOf(t);if(s===-1)return ZR(e,t,n,i);const r=e.lastIndexOf(t);return s!==r?n:s}const tN=(e,t)=>e===null?null:we(Math.round(e),0,t);function nb(e){const t=this.getLabels();return e>=0&&en.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}},K(Ru,"id","category"),K(Ru,"defaults",{ticks:{callback:nb}}),Ru);function nN(e,t){const n=[],{bounds:s,step:r,min:o,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:h}=e,f=r||1,p=u-1,{min:m,max:v}=t,y=!bt(o),g=!bt(a),x=!bt(c),_=(v-m)/(d+1);let w=Gv((v-m)/p/f)*f,S,C,M,P;if(w<1e-14&&!y&&!g)return[{value:m},{value:v}];P=Math.ceil(v/w)-Math.floor(m/w),P>p&&(w=Gv(P*w/p/f)*f),bt(l)||(S=Math.pow(10,l),w=Math.ceil(w*S)/S),s==="ticks"?(C=Math.floor(m/w)*w,M=Math.ceil(v/w)*w):(C=m,M=v),y&&g&&r&&WA((a-o)/r,w/1e3)?(P=Math.round(Math.min((a-o)/w,u)),w=(a-o)/P,C=o,M=a):x?(C=y?o:C,M=g?a:M,P=c-1,w=(M-C)/P):(P=(M-C)/w,dl(P,Math.round(P),w/1e3)?P=Math.round(P):P=Math.ceil(P));const T=Math.max(qv(w),qv(C));S=Math.pow(10,bt(l)?T:l),C=Math.round(C*S)/S,M=Math.round(M*S)/S;let A=0;for(y&&(h&&C!==o?(n.push({value:o}),Ca)break;n.push({value:E})}return g&&h&&M!==a?n.length&&dl(n[n.length-1].value,a,ib(a,_,e))?n[n.length-1].value=a:n.push({value:a}):(!g||M===a)&&n.push({value:M}),n}function ib(e,t,{horizontal:n,minRotation:i}){const s=Jn(i),r=(n?Math.sin(s):Math.cos(s))||.001,o=.75*t*(""+e).length;return Math.min(t/r,o)}let Bd=class extends pc{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 bt(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:i}=this.getUserBounds();let{min:s,max:r}=this;const o=l=>s=n?s:l,a=l=>r=i?r:l;if(t){const l=vi(s),c=vi(r);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(s===r){let l=r===0?1:Math.abs(r*.05);a(r+l),t||o(s-l)}this.min=s,this.max=r}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:i}=t,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),n=n||11),n&&(s=Math.min(n,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,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},r=this._range||this,o=nN(s,r);return t.bounds==="ticks"&&jS(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,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-n)/Math.max(t.length-1,1)/2;n-=s,i+=s}this._startValue=n,this._endValue=i,this._valueRange=i-n}getLabelForValue(t){return hc(t,this.chart.options.locale,this.options.ticks.format)}};var Nu;let iN=(Nu=class extends Bd{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=oe(t)?t:0,this.max=oe(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,i=Jn(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,r.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}},K(Nu,"id","linear"),K(Nu,"defaults",{ticks:{callback:Mh.formatters.numeric}}),Nu);const Yl=e=>Math.floor(Ss(e)),ar=(e,t)=>Math.pow(10,Yl(e)+t);function sb(e){return e/Math.pow(10,Yl(e))===1}function rb(e,t,n){const i=Math.pow(10,n),s=Math.floor(e/i);return Math.ceil(t/i)-s}function sN(e,t){const n=t-e;let i=Yl(n);for(;rb(e,t,i)>10;)i++;for(;rb(e,t,i)<10;)i--;return Math.min(i,Yl(e))}function rN(e,{min:t,max:n}){t=mn(e.min,t);const i=[],s=Yl(t);let r=sN(t,n),o=r<0?Math.pow(10,Math.abs(r)):1;const a=Math.pow(10,r),l=s>r?Math.pow(10,s):0,c=Math.round((t-l)*o)/o,u=Math.floor((t-l)/a/10)*a*10;let d=Math.floor((c-u)/Math.pow(10,r)),h=mn(e.min,Math.round((l+u+d*Math.pow(10,r))*o)/o);for(;h=10?d=d<15?15:20:d++,d>=20&&(r++,d=2,o=r>=0?1:o),h=Math.round((l+u+d*Math.pow(10,r))*o)/o;const f=mn(e.max,h);return i.push({value:f,major:sb(f),significand:d}),i}var ju;let oN=(ju=class extends pc{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const i=Bd.prototype.parse.apply(this,[t,n]);if(i===0){this._zero=!0;return}return oe(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=oe(t)?Math.max(0,t):null,this.max=oe(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!oe(this._userMin)&&(this.min=t===ar(this.min,0)?ar(this.min,-1):ar(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let i=this.min,s=this.max;const r=a=>i=t?i:a,o=a=>s=n?s:a;i===s&&(i<=0?(r(1),o(10)):(r(ar(i,-1)),o(ar(s,1)))),i<=0&&r(ar(s,-1)),s<=0&&o(ar(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},i=rN(n,this);return t.bounds==="ticks"&&jS(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":hc(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Ss(t),this._valueRange=Ss(this.max)-Ss(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Ss(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}},K(ju,"id","logarithmic"),K(ju,"defaults",{ticks:{callback:Mh.formatters.logarithmic,major:{enabled:!0}}}),ju);function Pm(e){const t=e.ticks;if(t.display&&e.display){const n=Ae(t.backdropPadding);return at(t.font&&t.font.size,ne.font.size)+n.height}return 0}function aN(e,t,n){return n=Ut(n)?n:[n],{w:oO(e,t.string,n),h:n.length*t.lineHeight}}function ob(e,t,n,i,s){return e===i||e===s?{start:t-n/2,end:t+n/2}:es?{start:t-n,end:t}:{start:t,end:t+n}}function lN(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),i=[],s=[],r=e._pointLabels.length,o=e.options.pointLabels,a=o.centerPointLabels?Kt/r:0;for(let l=0;lt.r&&(a=(i.end-t.r)/r,e.r=Math.max(e.r,t.r+a)),s.startt.b&&(l=(s.end-t.b)/o,e.b=Math.max(e.b,t.b+l))}function uN(e,t,n){const i=e.drawingArea,{extra:s,additionalAngle:r,padding:o,size:a}=n,l=e.getPointPosition(t,i+s+o,r),c=Math.round(ly(yn(l.angle+ue))),u=mN(l.y,a.h,c),d=fN(c),h=pN(l.x,a.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:h,top:u,right:h+a.w,bottom:u+a.h}}function dN(e,t){if(!t)return!0;const{left:n,top:i,right:s,bottom:r}=e;return!(Wi({x:n,y:i},t)||Wi({x:n,y:r},t)||Wi({x:s,y:i},t)||Wi({x:s,y:r},t))}function hN(e,t,n){const i=[],s=e._pointLabels.length,r=e.options,{centerPointLabels:o,display:a}=r.pointLabels,l={extra:Pm(r)/2,additionalAngle:o?Kt/s:0};let c;for(let u=0;u270||n<90)&&(e-=t),e}function gN(e,t,n){const{left:i,top:s,right:r,bottom:o}=n,{backdropColor:a}=t;if(!bt(a)){const l=Cr(t.borderRadius),c=Ae(t.backdropPadding);e.fillStyle=a;const u=i-c.left,d=s-c.top,h=r-i+c.width,f=o-s+c.height;Object.values(l).some(p=>p!==0)?(e.beginPath(),Hl(e,{x:u,y:d,w:h,h:f,radius:l}),e.fill()):e.fillRect(u,d,h,f)}}function yN(e,t){const{ctx:n,options:{pointLabels:i}}=e;for(let s=t-1;s>=0;s--){const r=e._pointLabelItems[s];if(!r.visible)continue;const o=i.setContext(e.getPointLabelContext(s));gN(n,o,r);const a=ge(o.font),{x:l,y:c,textAlign:u}=r;Br(n,e._pointLabels[s],l,c+a.lineHeight/2,a,{color:o.color,textAlign:u,textBaseline:"middle"})}}function AM(e,t,n,i){const{ctx:s}=e;if(n)s.arc(e.xCenter,e.yCenter,t,0,Xt);else{let r=e.getPointPosition(0,t);s.moveTo(r.x,r.y);for(let o=1;o{const s=$t(this.options.pointLabels.callback,[n,i],this);return s||s===0?s:""}).filter((n,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?lN(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,i,s){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,i,s))}getIndexAngle(t){const n=Xt/(this._pointLabels.length||1),i=this.options.startAngle||0;return yn(t*n+Jn(i))}getDistanceFromCenterForValue(t){if(bt(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(bt(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{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const h=this.getContext(d),f=s.setContext(h),p=r.setContext(h);vN(this,f,l,o,p)}}),i.display){for(t.save(),a=o-1;a>=0;a--){const u=i.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:h}=u;!h||!d||(t.lineWidth=h,t.strokeStyle=d,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,i=n.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let r,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!n.reverse)return;const c=i.setContext(this.getContext(l)),u=ge(c.font);if(r=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,o=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const d=Ae(c.backdropPadding);t.fillRect(-o/2-d.left,-r-u.size/2-d.top,o+d.width,u.size+d.height)}Br(t,a.label,0,-r,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}},K(ro,"id","radialLinear"),K(ro,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Mh.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),K(ro,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),K(ro,"descriptors",{angleLines:{_fallback:"grid"}}),ro);const Eh={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}},tn=Object.keys(Eh);function ab(e,t){return e-t}function lb(e,t){if(bt(t))return null;const n=e._adapter,{parser:i,round:s,isoWeekday:r}=e._parseOpts;let o=t;return typeof i=="function"&&(o=i(o)),oe(o)||(o=typeof i=="string"?n.parse(o,i):n.parse(o)),o===null?null:(s&&(o=s==="week"&&(Wo(r)||r===!0)?n.startOf(o,"isoWeek",r):n.startOf(o,s)),+o)}function cb(e,t,n,i){const s=tn.length;for(let r=tn.indexOf(e);r=tn.indexOf(n);r--){const o=tn[r];if(Eh[o].common&&e._adapter.diff(s,i,o)>=t-1)return o}return tn[n?tn.indexOf(n):0]}function wN(e){for(let t=tn.indexOf(e)+1,n=tn.length;t=t?n[i]:n[s];e[r]=!0}}function kN(e,t,n,i){const s=e._adapter,r=+s.startOf(t[0].value,i),o=t[t.length-1].value;let a,l;for(a=r;a<=o;a=+s.add(a,1,i))l=n[a],l>=0&&(t[l].major=!0);return t}function db(e,t,n){const i=[],s={},r=t.length;let o,a;for(o=0;o+t.value))}initOffsets(t=[]){let n=0,i=0,s,r;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?n=1-s:n=(this.getDecimalForValue(t[1])-s)/2,r=this.getDecimalForValue(t[t.length-1]),t.length===1?i=r:i=(r-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;n=we(n,0,o),i=we(i,0,o),this._offsets={start:n,end:i,factor:1/(n+1+i)}}_generate(){const t=this._adapter,n=this.min,i=this.max,s=this.options,r=s.time,o=r.unit||cb(r.minUnit,n,i,this._getLabelCapacity(n)),a=at(s.ticks.stepSize,1),l=o==="week"?r.isoWeekday:!1,c=Wo(l)||l===!0,u={};let d=n,h,f;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":o),t.diff(i,n,o)>1e5*a)throw new Error(n+" and "+i+" are too far apart with stepSize of "+a+" "+o);const p=s.ticks.source==="data"&&this.getDataTimestamps();for(h=d,f=0;h+m)}getLabelForValue(t){const n=this._adapter,i=this.options.time;return i.tooltipFormat?n.format(t,i.tooltipFormat):n.format(t,i.displayFormats.datetime)}format(t,n){const s=this.options.time.displayFormats,r=this._unit,o=n||s[r];return this._adapter.format(t,o)}_tickFormatFunction(t,n,i,s){const r=this.options,o=r.ticks.callback;if(o)return $t(o,[t,n,i],this);const a=r.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],d=c&&a[c],h=i[n],f=c&&d&&h&&h.major;return this._adapter.format(t,s||(f?d:u))}generateTickLabels(t){let n,i,s;for(n=0,i=t.length;n0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,i;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(n=0,i=s.length;n=e[i].pos&&t<=e[s].pos&&({lo:i,hi:s}=zi(e,"pos",t)),{pos:r,time:a}=e[i],{pos:o,time:l}=e[s]):(t>=e[i].time&&t<=e[s].time&&({lo:i,hi:s}=zi(e,"time",t)),{time:r,pos:a}=e[i],{time:o,pos:l}=e[s]);const c=o-r;return c?a+(l-a)*(t-r)/c:a}var Iu;let SN=(Iu=class extends Tm{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=au(n,this.min),this._tableRange=au(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:i}=this,s=[],r=[];let o,a,l,c,u;for(o=0,a=t.length;o=n&&c<=i&&s.push(c);if(s.length<2)return[{time:n,pos:0},{time:i,pos:1}];for(o=0,a=s.length;os-r)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),i=this.getLabelTimestamps();return n.length&&i.length?t=this.normalize(n.concat(i)):t=n.length?n:i,t=this._cache.all=t,t}getDecimalForValue(t){return(au(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return au(this._table,i*this._tableRange+this._minPos,!0)}},K(Iu,"id","timeseries"),K(Iu,"defaults",Tm.defaults),Iu);var MN=Object.freeze({__proto__:null,CategoryScale:eN,LinearScale:iN,LogarithmicScale:oN,RadialLinearScale:bN,TimeScale:Tm,TimeSeriesScale:SN});const CN=[P2,iR,QR,MN];by.register(...CN);function OM(e){var t,n,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t"u")return!1;var t=si(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function FN(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var i=t.styles[n]||{},s=t.attributes[n]||{},r=t.elements[n];!Fn(r)||!ki(r)||(Object.assign(r.style,i),Object.keys(s).forEach(function(o){var a=s[o];a===!1?r.removeAttribute(o):r.setAttribute(o,a===!0?"":a)}))})}function BN(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(i){var s=t.elements[i],r=t.attributes[i]||{},o=Object.keys(t.styles.hasOwnProperty(i)?t.styles[i]:n[i]),a=o.reduce(function(l,c){return l[c]="",l},{});!Fn(s)||!ki(s)||(Object.assign(s.style,a),Object.keys(r).forEach(function(l){s.removeAttribute(l)}))})}}const VN={name:"applyStyles",enabled:!0,phase:"write",fn:FN,effect:BN,requires:["computeStyles"]};function xi(e){return e.split("-")[0]}var Tr=Math.max,Vd=Math.min,Ko=Math.round;function Go(e,t){t===void 0&&(t=!1);var n=e.getBoundingClientRect(),i=1,s=1;if(Fn(e)&&t){var r=e.offsetHeight,o=e.offsetWidth;o>0&&(i=Ko(n.width)/o||1),r>0&&(s=Ko(n.height)/r||1)}return{width:n.width/i,height:n.height/s,top:n.top/s,right:n.right/i,bottom:n.bottom/s,left:n.left/i,x:n.left/i,y:n.top/s}}function My(e){var t=Go(e),n=e.offsetWidth,i=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-i)<=1&&(i=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:i}}function NM(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Sy(n)){var i=t;do{if(i&&e.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function ns(e){return si(e).getComputedStyle(e)}function zN(e){return["table","td","th"].indexOf(ki(e))>=0}function Js(e){return((Xo(e)?e.ownerDocument:e.document)||window.document).documentElement}function Ah(e){return ki(e)==="html"?e:e.assignedSlot||e.parentNode||(Sy(e)?e.host:null)||Js(e)}function mb(e){return!Fn(e)||ns(e).position==="fixed"?null:e.offsetParent}function WN(e){var t=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,n=navigator.userAgent.indexOf("Trident")!==-1;if(n&&Fn(e)){var i=ns(e);if(i.position==="fixed")return null}var s=Ah(e);for(Sy(s)&&(s=s.host);Fn(s)&&["html","body"].indexOf(ki(s))<0;){var r=ns(s);if(r.transform!=="none"||r.perspective!=="none"||r.contain==="paint"||["transform","perspective"].indexOf(r.willChange)!==-1||t&&r.willChange==="filter"||t&&r.filter&&r.filter!=="none")return s;s=s.parentNode}return null}function gc(e){for(var t=si(e),n=mb(e);n&&zN(n)&&ns(n).position==="static";)n=mb(n);return n&&(ki(n)==="html"||ki(n)==="body"&&ns(n).position==="static")?t:n||WN(e)||t}function Cy(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function pl(e,t,n){return Tr(e,Vd(t,n))}function HN(e,t,n){var i=pl(e,t,n);return i>n?n:i}function jM(){return{top:0,right:0,bottom:0,left:0}}function $M(e){return Object.assign({},jM(),e)}function IM(e,t){return t.reduce(function(n,i){return n[i]=e,n},{})}var UN=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,$M(typeof t!="number"?t:IM(t,mc))};function YN(e){var t,n=e.state,i=e.name,s=e.options,r=n.elements.arrow,o=n.modifiersData.popperOffsets,a=xi(n.placement),l=Cy(a),c=[cn,Wn].indexOf(a)>=0,u=c?"height":"width";if(!(!r||!o)){var d=UN(s.padding,n),h=My(r),f=l==="y"?ln:cn,p=l==="y"?zn:Wn,m=n.rects.reference[u]+n.rects.reference[l]-o[l]-n.rects.popper[u],v=o[l]-n.rects.reference[l],y=gc(r),g=y?l==="y"?y.clientHeight||0:y.clientWidth||0:0,x=m/2-v/2,_=d[f],w=g-h[u]-d[p],S=g/2-h[u]/2+x,C=pl(_,S,w),M=l;n.modifiersData[i]=(t={},t[M]=C,t.centerOffset=C-S,t)}}function XN(e){var t=e.state,n=e.options,i=n.element,s=i===void 0?"[data-popper-arrow]":i;s!=null&&(typeof s=="string"&&(s=t.elements.popper.querySelector(s),!s)||NM(t.elements.popper,s)&&(t.elements.arrow=s))}const KN={name:"arrow",enabled:!0,phase:"main",fn:YN,effect:XN,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function qo(e){return e.split("-")[1]}var GN={top:"auto",right:"auto",bottom:"auto",left:"auto"};function qN(e){var t=e.x,n=e.y,i=window,s=i.devicePixelRatio||1;return{x:Ko(t*s)/s||0,y:Ko(n*s)/s||0}}function gb(e){var t,n=e.popper,i=e.popperRect,s=e.placement,r=e.variation,o=e.offsets,a=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,d=e.isFixed,h=o.x,f=h===void 0?0:h,p=o.y,m=p===void 0?0:p,v=typeof u=="function"?u({x:f,y:m}):{x:f,y:m};f=v.x,m=v.y;var y=o.hasOwnProperty("x"),g=o.hasOwnProperty("y"),x=cn,_=ln,w=window;if(c){var S=gc(n),C="clientHeight",M="clientWidth";if(S===si(n)&&(S=Js(n),ns(S).position!=="static"&&a==="absolute"&&(C="scrollHeight",M="scrollWidth")),S=S,s===ln||(s===cn||s===Wn)&&r===Xl){_=zn;var P=d&&S===w&&w.visualViewport?w.visualViewport.height:S[C];m-=P-i.height,m*=l?1:-1}if(s===cn||(s===ln||s===zn)&&r===Xl){x=Wn;var T=d&&S===w&&w.visualViewport?w.visualViewport.width:S[M];f-=T-i.width,f*=l?1:-1}}var A=Object.assign({position:a},c&&GN),E=u===!0?qN({x:f,y:m}):{x:f,y:m};if(f=E.x,m=E.y,l){var z;return Object.assign({},A,(z={},z[_]=g?"0":"",z[x]=y?"0":"",z.transform=(w.devicePixelRatio||1)<=1?"translate("+f+"px, "+m+"px)":"translate3d("+f+"px, "+m+"px, 0)",z))}return Object.assign({},A,(t={},t[_]=g?m+"px":"",t[x]=y?f+"px":"",t.transform="",t))}function QN(e){var t=e.state,n=e.options,i=n.gpuAcceleration,s=i===void 0?!0:i,r=n.adaptive,o=r===void 0?!0:r,a=n.roundOffsets,l=a===void 0?!0:a,c={placement:xi(t.placement),variation:qo(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:s,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,gb(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,gb(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const ZN={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:QN,data:{}};var lu={passive:!0};function JN(e){var t=e.state,n=e.instance,i=e.options,s=i.scroll,r=s===void 0?!0:s,o=i.resize,a=o===void 0?!0:o,l=si(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return r&&c.forEach(function(u){u.addEventListener("scroll",n.update,lu)}),a&&l.addEventListener("resize",n.update,lu),function(){r&&c.forEach(function(u){u.removeEventListener("scroll",n.update,lu)}),a&&l.removeEventListener("resize",n.update,lu)}}const tj={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:JN,data:{}};var ej={left:"right",right:"left",bottom:"top",top:"bottom"};function Ju(e){return e.replace(/left|right|bottom|top/g,function(t){return ej[t]})}var nj={start:"end",end:"start"};function yb(e){return e.replace(/start|end/g,function(t){return nj[t]})}function Py(e){var t=si(e),n=t.pageXOffset,i=t.pageYOffset;return{scrollLeft:n,scrollTop:i}}function Ty(e){return Go(Js(e)).left+Py(e).scrollLeft}function ij(e){var t=si(e),n=Js(e),i=t.visualViewport,s=n.clientWidth,r=n.clientHeight,o=0,a=0;return i&&(s=i.width,r=i.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(o=i.offsetLeft,a=i.offsetTop)),{width:s,height:r,x:o+Ty(e),y:a}}function sj(e){var t,n=Js(e),i=Py(e),s=(t=e.ownerDocument)==null?void 0:t.body,r=Tr(n.scrollWidth,n.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),o=Tr(n.scrollHeight,n.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-i.scrollLeft+Ty(e),l=-i.scrollTop;return ns(s||n).direction==="rtl"&&(a+=Tr(n.clientWidth,s?s.clientWidth:0)-r),{width:r,height:o,x:a,y:l}}function Dy(e){var t=ns(e),n=t.overflow,i=t.overflowX,s=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+s+i)}function FM(e){return["html","body","#document"].indexOf(ki(e))>=0?e.ownerDocument.body:Fn(e)&&Dy(e)?e:FM(Ah(e))}function ml(e,t){var n;t===void 0&&(t=[]);var i=FM(e),s=i===((n=e.ownerDocument)==null?void 0:n.body),r=si(i),o=s?[r].concat(r.visualViewport||[],Dy(i)?i:[]):i,a=t.concat(o);return s?a:a.concat(ml(Ah(o)))}function Dm(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function rj(e){var t=Go(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}function vb(e,t){return t===LM?Dm(ij(e)):Xo(t)?rj(t):Dm(sj(Js(e)))}function oj(e){var t=ml(Ah(e)),n=["absolute","fixed"].indexOf(ns(e).position)>=0,i=n&&Fn(e)?gc(e):e;return Xo(i)?t.filter(function(s){return Xo(s)&&NM(s,i)&&ki(s)!=="body"}):[]}function aj(e,t,n){var i=t==="clippingParents"?oj(e):[].concat(t),s=[].concat(i,[n]),r=s[0],o=s.reduce(function(a,l){var c=vb(e,l);return a.top=Tr(c.top,a.top),a.right=Vd(c.right,a.right),a.bottom=Vd(c.bottom,a.bottom),a.left=Tr(c.left,a.left),a},vb(e,r));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function BM(e){var t=e.reference,n=e.element,i=e.placement,s=i?xi(i):null,r=i?qo(i):null,o=t.x+t.width/2-n.width/2,a=t.y+t.height/2-n.height/2,l;switch(s){case ln:l={x:o,y:t.y-n.height};break;case zn:l={x:o,y:t.y+t.height};break;case Wn:l={x:t.x+t.width,y:a};break;case cn:l={x:t.x-n.width,y:a};break;default:l={x:t.x,y:t.y}}var c=s?Cy(s):null;if(c!=null){var u=c==="y"?"height":"width";switch(r){case Yo:l[c]=l[c]-(t[u]/2-n[u]/2);break;case Xl:l[c]=l[c]+(t[u]/2-n[u]/2);break}}return l}function Kl(e,t){t===void 0&&(t={});var n=t,i=n.placement,s=i===void 0?e.placement:i,r=n.boundary,o=r===void 0?PN:r,a=n.rootBoundary,l=a===void 0?LM:a,c=n.elementContext,u=c===void 0?Sa:c,d=n.altBoundary,h=d===void 0?!1:d,f=n.padding,p=f===void 0?0:f,m=$M(typeof p!="number"?p:IM(p,mc)),v=u===Sa?TN:Sa,y=e.rects.popper,g=e.elements[h?v:u],x=aj(Xo(g)?g:g.contextElement||Js(e.elements.popper),o,l),_=Go(e.elements.reference),w=BM({reference:_,element:y,strategy:"absolute",placement:s}),S=Dm(Object.assign({},y,w)),C=u===Sa?S:_,M={top:x.top-C.top+m.top,bottom:C.bottom-x.bottom+m.bottom,left:x.left-C.left+m.left,right:C.right-x.right+m.right},P=e.modifiersData.offset;if(u===Sa&&P){var T=P[s];Object.keys(M).forEach(function(A){var E=[Wn,zn].indexOf(A)>=0?1:-1,z=[ln,zn].indexOf(A)>=0?"y":"x";M[A]+=T[z]*E})}return M}function lj(e,t){t===void 0&&(t={});var n=t,i=n.placement,s=n.boundary,r=n.rootBoundary,o=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=l===void 0?RM:l,u=qo(i),d=u?a?pb:pb.filter(function(p){return qo(p)===u}):mc,h=d.filter(function(p){return c.indexOf(p)>=0});h.length===0&&(h=d);var f=h.reduce(function(p,m){return p[m]=Kl(e,{placement:m,boundary:s,rootBoundary:r,padding:o})[xi(m)],p},{});return Object.keys(f).sort(function(p,m){return f[p]-f[m]})}function cj(e){if(xi(e)===ky)return[];var t=Ju(e);return[yb(e),t,yb(t)]}function uj(e){var t=e.state,n=e.options,i=e.name;if(!t.modifiersData[i]._skip){for(var s=n.mainAxis,r=s===void 0?!0:s,o=n.altAxis,a=o===void 0?!0:o,l=n.fallbackPlacements,c=n.padding,u=n.boundary,d=n.rootBoundary,h=n.altBoundary,f=n.flipVariations,p=f===void 0?!0:f,m=n.allowedAutoPlacements,v=t.options.placement,y=xi(v),g=y===v,x=l||(g||!p?[Ju(v)]:cj(v)),_=[v].concat(x).reduce(function(Z,O){return Z.concat(xi(O)===ky?lj(t,{placement:O,boundary:u,rootBoundary:d,padding:c,flipVariations:p,allowedAutoPlacements:m}):O)},[]),w=t.rects.reference,S=t.rects.popper,C=new Map,M=!0,P=_[0],T=0;T<_.length;T++){var A=_[T],E=xi(A),z=qo(A)===Yo,N=[ln,zn].indexOf(E)>=0,L=N?"width":"height",R=Kl(t,{placement:A,boundary:u,rootBoundary:d,altBoundary:h,padding:c}),B=N?z?Wn:cn:z?zn:ln;w[L]>S[L]&&(B=Ju(B));var D=Ju(B),$=[];if(r&&$.push(R[E]<=0),a&&$.push(R[B]<=0,R[D]<=0),$.every(function(Z){return Z})){P=A,M=!1;break}C.set(A,$)}if(M)for(var F=p?3:1,V=function(O){var U=_.find(function(lt){var ct=C.get(lt);if(ct)return ct.slice(0,O).every(function(kt){return kt})});if(U)return P=U,"break"},W=F;W>0;W--){var et=V(W);if(et==="break")break}t.placement!==P&&(t.modifiersData[i]._skip=!0,t.placement=P,t.reset=!0)}}const VM={name:"flip",enabled:!0,phase:"main",fn:uj,requiresIfExists:["offset"],data:{_skip:!1}};function xb(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function bb(e){return[ln,Wn,zn,cn].some(function(t){return e[t]>=0})}function dj(e){var t=e.state,n=e.name,i=t.rects.reference,s=t.rects.popper,r=t.modifiersData.preventOverflow,o=Kl(t,{elementContext:"reference"}),a=Kl(t,{altBoundary:!0}),l=xb(o,i),c=xb(a,s,r),u=bb(l),d=bb(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}const hj={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:dj};function fj(e,t,n){var i=xi(e),s=[cn,ln].indexOf(i)>=0?-1:1,r=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,o=r[0],a=r[1];return o=o||0,a=(a||0)*s,[cn,Wn].indexOf(i)>=0?{x:a,y:o}:{x:o,y:a}}function pj(e){var t=e.state,n=e.options,i=e.name,s=n.offset,r=s===void 0?[0,0]:s,o=RM.reduce(function(u,d){return u[d]=fj(d,t.rects,r),u},{}),a=o[t.placement],l=a.x,c=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[i]=o}const mj={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:pj};function gj(e){var t=e.state,n=e.name;t.modifiersData[n]=BM({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const yj={name:"popperOffsets",enabled:!0,phase:"read",fn:gj,data:{}};function vj(e){return e==="x"?"y":"x"}function xj(e){var t=e.state,n=e.options,i=e.name,s=n.mainAxis,r=s===void 0?!0:s,o=n.altAxis,a=o===void 0?!1:o,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,d=n.padding,h=n.tether,f=h===void 0?!0:h,p=n.tetherOffset,m=p===void 0?0:p,v=Kl(t,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),y=xi(t.placement),g=qo(t.placement),x=!g,_=Cy(y),w=vj(_),S=t.modifiersData.popperOffsets,C=t.rects.reference,M=t.rects.popper,P=typeof m=="function"?m(Object.assign({},t.rects,{placement:t.placement})):m,T=typeof P=="number"?{mainAxis:P,altAxis:P}:Object.assign({mainAxis:0,altAxis:0},P),A=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,E={x:0,y:0};if(S){if(r){var z,N=_==="y"?ln:cn,L=_==="y"?zn:Wn,R=_==="y"?"height":"width",B=S[_],D=B+v[N],$=B-v[L],F=f?-M[R]/2:0,V=g===Yo?C[R]:M[R],W=g===Yo?-M[R]:-C[R],et=t.elements.arrow,Z=f&&et?My(et):{width:0,height:0},O=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:jM(),U=O[N],lt=O[L],ct=pl(0,C[R],Z[R]),kt=x?C[R]/2-F-ct-U-T.mainAxis:V-ct-U-T.mainAxis,it=x?-C[R]/2+F+ct+lt+T.mainAxis:W+ct+lt+T.mainAxis,Lt=t.elements.arrow&&gc(t.elements.arrow),Ct=Lt?_==="y"?Lt.clientTop||0:Lt.clientLeft||0:0,Qt=(z=A==null?void 0:A[_])!=null?z:0,ft=B+kt-Qt-Ct,wt=B+it-Qt,dt=pl(f?Vd(D,ft):D,B,f?Tr($,wt):$);S[_]=dt,E[_]=dt-B}if(a){var jt,pt=_==="x"?ln:cn,xt=_==="x"?zn:Wn,J=S[w],mt=w==="y"?"height":"width",q=J+v[pt],ye=J-v[xt],Dt=[ln,cn].indexOf(y)!==-1,he=(jt=A==null?void 0:A[w])!=null?jt:0,Un=Dt?q:J-C[mt]-M[mt]-he+T.altAxis,Yn=Dt?J+C[mt]+M[mt]-he-T.altAxis:ye,Mn=f&&Dt?HN(Un,J,Yn):pl(f?Un:q,J,f?Yn:ye);S[w]=Mn,E[w]=Mn-J}t.modifiersData[i]=E}}const bj={name:"preventOverflow",enabled:!0,phase:"main",fn:xj,requiresIfExists:["offset"]};function _j(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function wj(e){return e===si(e)||!Fn(e)?Py(e):_j(e)}function kj(e){var t=e.getBoundingClientRect(),n=Ko(t.width)/e.offsetWidth||1,i=Ko(t.height)/e.offsetHeight||1;return n!==1||i!==1}function Sj(e,t,n){n===void 0&&(n=!1);var i=Fn(t),s=Fn(t)&&kj(t),r=Js(t),o=Go(e,s),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!n)&&((ki(t)!=="body"||Dy(r))&&(a=wj(t)),Fn(t)?(l=Go(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):r&&(l.x=Ty(r))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function Mj(e){var t=new Map,n=new Set,i=[];e.forEach(function(r){t.set(r.name,r)});function s(r){n.add(r.name);var o=[].concat(r.requires||[],r.requiresIfExists||[]);o.forEach(function(a){if(!n.has(a)){var l=t.get(a);l&&s(l)}}),i.push(r)}return e.forEach(function(r){n.has(r.name)||s(r)}),i}function Cj(e){var t=Mj(e);return IN.reduce(function(n,i){return n.concat(t.filter(function(s){return s.phase===i}))},[])}function Pj(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function Tj(e){var t=e.reduce(function(n,i){var s=n[i.name];return n[i.name]=s?Object.assign({},s,i,{options:Object.assign({},s.options,i.options),data:Object.assign({},s.data,i.data)}):i,n},{});return Object.keys(t).map(function(n){return t[n]})}var _b={placement:"bottom",modifiers:[],strategy:"absolute"};function wb(){for(var e=arguments.length,t=new Array(e),n=0;ne,isStatic:!1,reducedMotion:"never"}),Lh=k.createContext({}),Rh=k.createContext(null),Nh=typeof document<"u",Ey=Nh?k.useLayoutEffect:k.useEffect,WM=k.createContext({strict:!1}),Ay=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),Fj="framerAppearId",HM="data-"+Ay(Fj);function Bj(e,t,n,i){const{visualElement:s}=k.useContext(Lh),r=k.useContext(WM),o=k.useContext(Rh),a=k.useContext(zM).reducedMotion,l=k.useRef();i=i||r.renderer,!l.current&&i&&(l.current=i(e,{visualState:t,parent:s,props:n,presenceContext:o,blockInitialAnimation:o?o.initial===!1:!1,reducedMotionConfig:a}));const c=l.current;k.useInsertionEffect(()=>{c&&c.update(n,o)});const u=k.useRef(!!(n[HM]&&!window.HandoffComplete));return Ey(()=>{c&&(c.render(),u.current&&c.animationState&&c.animationState.animateChanges())}),k.useEffect(()=>{c&&(c.updateFeatures(),!u.current&&c.animationState&&c.animationState.animateChanges(),u.current&&(u.current=!1,window.HandoffComplete=!0))}),c}function _o(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Vj(e,t,n){return k.useCallback(i=>{i&&e.mount&&e.mount(i),t&&(i?t.mount(i):t.unmount()),n&&(typeof n=="function"?n(i):_o(n)&&(n.current=i))},[t])}function Gl(e){return typeof e=="string"||Array.isArray(e)}function jh(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const Oy=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ly=["initial",...Oy];function $h(e){return jh(e.animate)||Ly.some(t=>Gl(e[t]))}function UM(e){return!!($h(e)||e.variants)}function zj(e,t){if($h(e)){const{initial:n,animate:i}=e;return{initial:n===!1||Gl(n)?n:void 0,animate:Gl(i)?i:void 0}}return e.inherit!==!1?t:{}}function Wj(e){const{initial:t,animate:n}=zj(e,k.useContext(Lh));return k.useMemo(()=>({initial:t,animate:n}),[kb(t),kb(n)])}function kb(e){return Array.isArray(e)?e.join(" "):e}const Sb={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},ql={};for(const e in Sb)ql[e]={isEnabled:t=>Sb[e].some(n=>!!t[n])};function Hj(e){for(const t in e)ql[t]={...ql[t],...e[t]}}const Ry=k.createContext({}),YM=k.createContext({}),Uj=Symbol.for("motionComponentSymbol");function Yj({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:i,Component:s}){e&&Hj(e);function r(a,l){let c;const u={...k.useContext(zM),...a,layoutId:Xj(a)},{isStatic:d}=u,h=Wj(a),f=i(a,d);if(!d&&Nh){h.visualElement=Bj(s,f,u,t);const p=k.useContext(YM),m=k.useContext(WM).strict;h.visualElement&&(c=h.visualElement.loadFeatures(u,m,e,p))}return k.createElement(Lh.Provider,{value:h},c&&h.visualElement?k.createElement(c,{visualElement:h.visualElement,...u}):null,n(s,a,Vj(f,h.visualElement,l),f,d,h.visualElement))}const o=k.forwardRef(r);return o[Uj]=s,o}function Xj({layoutId:e}){const t=k.useContext(Ry).id;return t&&e!==void 0?t+"-"+e:e}function Kj(e){function t(i,s={}){return Yj(e(i,s))}if(typeof Proxy>"u")return t;const n=new Map;return new Proxy(t,{get:(i,s)=>(n.has(s)||n.set(s,t(s)),n.get(s))})}const Gj=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Ny(e){return typeof e!="string"||e.includes("-")?!1:!!(Gj.indexOf(e)>-1||/[A-Z]/.test(e))}const zd={};function qj(e){Object.assign(zd,e)}const yc=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ur=new Set(yc);function XM(e,{layout:t,layoutId:n}){return Ur.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!zd[e]||e==="opacity")}const un=e=>!!(e&&e.getVelocity),Qj={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Zj=yc.length;function Jj(e,{enableHardwareAcceleration:t=!0,allowTransformNone:n=!0},i,s){let r="";for(let o=0;ot=>typeof t=="string"&&t.startsWith(e),GM=KM("--"),Em=KM("var(--"),t$=/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,e$=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Hs=(e,t,n)=>Math.min(Math.max(n,e),t),Yr={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},gl={...Yr,transform:e=>Hs(0,1,e)},cu={...Yr,default:1},yl=e=>Math.round(e*1e5)/1e5,Ih=/(-)?([\d]*\.?[\d])+/g,qM=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,n$=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function vc(e){return typeof e=="string"}const xc=e=>({test:t=>vc(t)&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),ps=xc("deg"),bi=xc("%"),st=xc("px"),i$=xc("vh"),s$=xc("vw"),Mb={...bi,parse:e=>bi.parse(e)/100,transform:e=>bi.transform(e*100)},Cb={...Yr,transform:Math.round},QM={borderWidth:st,borderTopWidth:st,borderRightWidth:st,borderBottomWidth:st,borderLeftWidth:st,borderRadius:st,radius:st,borderTopLeftRadius:st,borderTopRightRadius:st,borderBottomRightRadius:st,borderBottomLeftRadius:st,width:st,maxWidth:st,height:st,maxHeight:st,size:st,top:st,right:st,bottom:st,left:st,padding:st,paddingTop:st,paddingRight:st,paddingBottom:st,paddingLeft:st,margin:st,marginTop:st,marginRight:st,marginBottom:st,marginLeft:st,rotate:ps,rotateX:ps,rotateY:ps,rotateZ:ps,scale:cu,scaleX:cu,scaleY:cu,scaleZ:cu,skew:ps,skewX:ps,skewY:ps,distance:st,translateX:st,translateY:st,translateZ:st,x:st,y:st,z:st,perspective:st,transformPerspective:st,opacity:gl,originX:Mb,originY:Mb,originZ:st,zIndex:Cb,fillOpacity:gl,strokeOpacity:gl,numOctaves:Cb};function jy(e,t,n,i){const{style:s,vars:r,transform:o,transformOrigin:a}=e;let l=!1,c=!1,u=!0;for(const d in t){const h=t[d];if(GM(d)){r[d]=h;continue}const f=QM[d],p=e$(h,f);if(Ur.has(d)){if(l=!0,o[d]=p,!u)continue;h!==(f.default||0)&&(u=!1)}else d.startsWith("origin")?(c=!0,a[d]=p):s[d]=p}if(t.transform||(l||i?s.transform=Jj(e.transform,n,u,i):s.transform&&(s.transform="none")),c){const{originX:d="50%",originY:h="50%",originZ:f=0}=a;s.transformOrigin=`${d} ${h} ${f}`}}const $y=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function ZM(e,t,n){for(const i in t)!un(t[i])&&!XM(i,n)&&(e[i]=t[i])}function r$({transformTemplate:e},t,n){return k.useMemo(()=>{const i=$y();return jy(i,t,{enableHardwareAcceleration:!n},e),Object.assign({},i.vars,i.style)},[t])}function o$(e,t,n){const i=e.style||{},s={};return ZM(s,i,e),Object.assign(s,r$(e,t,n)),e.transformValues?e.transformValues(s):s}function a$(e,t,n){const i={},s=o$(e,t,n);return e.drag&&e.dragListener!==!1&&(i.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(i.tabIndex=0),i.style=s,i}const l$=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Wd(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||l$.has(e)}let JM=e=>!Wd(e);function c$(e){e&&(JM=t=>t.startsWith("on")?!Wd(t):e(t))}try{c$(require("@emotion/is-prop-valid").default)}catch{}function u$(e,t,n){const i={};for(const s in e)s==="values"&&typeof e.values=="object"||(JM(s)||n===!0&&Wd(s)||!t&&!Wd(s)||e.draggable&&s.startsWith("onDrag"))&&(i[s]=e[s]);return i}function Pb(e,t,n){return typeof e=="string"?e:st.transform(t+n*e)}function d$(e,t,n){const i=Pb(t,e.x,e.width),s=Pb(n,e.y,e.height);return`${i} ${s}`}const h$={offset:"stroke-dashoffset",array:"stroke-dasharray"},f$={offset:"strokeDashoffset",array:"strokeDasharray"};function p$(e,t,n=1,i=0,s=!0){e.pathLength=1;const r=s?h$:f$;e[r.offset]=st.transform(-i);const o=st.transform(t),a=st.transform(n);e[r.array]=`${o} ${a}`}function Iy(e,{attrX:t,attrY:n,attrScale:i,originX:s,originY:r,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...c},u,d,h){if(jy(e,c,u,h),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:p,dimensions:m}=e;f.transform&&(m&&(p.transform=f.transform),delete f.transform),m&&(s!==void 0||r!==void 0||p.transform)&&(p.transformOrigin=d$(m,s!==void 0?s:.5,r!==void 0?r:.5)),t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),i!==void 0&&(f.scale=i),o!==void 0&&p$(f,o,a,l,!1)}const tC=()=>({...$y(),attrs:{}}),Fy=e=>typeof e=="string"&&e.toLowerCase()==="svg";function m$(e,t,n,i){const s=k.useMemo(()=>{const r=tC();return Iy(r,t,{enableHardwareAcceleration:!1},Fy(i),e.transformTemplate),{...r.attrs,style:{...r.style}}},[t]);if(e.style){const r={};ZM(r,e.style,e),s.style={...r,...s.style}}return s}function g$(e=!1){return(n,i,s,{latestValues:r},o)=>{const l=(Ny(n)?m$:a$)(i,r,o,n),u={...u$(i,typeof n=="string",e),...l,ref:s},{children:d}=i,h=k.useMemo(()=>un(d)?d.get():d,[d]);return k.createElement(n,{...u,children:h})}}function eC(e,{style:t,vars:n},i,s){Object.assign(e.style,t,s&&s.getProjectionStyles(i));for(const r in n)e.style.setProperty(r,n[r])}const nC=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function iC(e,t,n,i){eC(e,t,void 0,i);for(const s in t.attrs)e.setAttribute(nC.has(s)?s:Ay(s),t.attrs[s])}function By(e,t){const{style:n}=e,i={};for(const s in n)(un(n[s])||t.style&&un(t.style[s])||XM(s,e))&&(i[s]=n[s]);return i}function sC(e,t){const n=By(e,t);for(const i in e)if(un(e[i])||un(t[i])){const s=yc.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;n[s]=e[i]}return n}function Vy(e,t,n,i={},s={}){return typeof t=="function"&&(t=t(n!==void 0?n:e.custom,i,s)),typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"&&(t=t(n!==void 0?n:e.custom,i,s)),t}function rC(e){const t=k.useRef(null);return t.current===null&&(t.current=e()),t.current}const Hd=e=>Array.isArray(e),y$=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),v$=e=>Hd(e)?e[e.length-1]||0:e;function ed(e){const t=un(e)?e.get():e;return y$(t)?t.toValue():t}function x$({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},i,s,r){const o={latestValues:b$(i,s,r,e),renderState:t()};return n&&(o.mount=a=>n(i,a,o)),o}const oC=e=>(t,n)=>{const i=k.useContext(Lh),s=k.useContext(Rh),r=()=>x$(e,t,i,s);return n?r():rC(r)};function b$(e,t,n,i){const s={},r=i(e,{});for(const h in r)s[h]=ed(r[h]);let{initial:o,animate:a}=e;const l=$h(e),c=UM(e);t&&c&&!l&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||o===!1;const d=u?a:o;return d&&typeof d!="boolean"&&!jh(d)&&(Array.isArray(d)?d:[d]).forEach(f=>{const p=Vy(e,f);if(!p)return;const{transitionEnd:m,transition:v,...y}=p;for(const g in y){let x=y[g];if(Array.isArray(x)){const _=u?x.length-1:0;x=x[_]}x!==null&&(s[g]=x)}for(const g in m)s[g]=m[g]}),s}const ce=e=>e;class Tb{constructor(){this.order=[],this.scheduled=new Set}add(t){if(!this.scheduled.has(t))return this.scheduled.add(t),this.order.push(t),!0}remove(t){const n=this.order.indexOf(t);n!==-1&&(this.order.splice(n,1),this.scheduled.delete(t))}clear(){this.order.length=0,this.scheduled.clear()}}function _$(e){let t=new Tb,n=new Tb,i=0,s=!1,r=!1;const o=new WeakSet,a={schedule:(l,c=!1,u=!1)=>{const d=u&&s,h=d?t:n;return c&&o.add(l),h.add(l)&&d&&s&&(i=t.order.length),l},cancel:l=>{n.remove(l),o.delete(l)},process:l=>{if(s){r=!0;return}if(s=!0,[t,n]=[n,t],n.clear(),i=t.order.length,i)for(let c=0;c(d[h]=_$(()=>n=!0),d),{}),o=d=>r[d].process(s),a=()=>{const d=performance.now();n=!1,s.delta=i?1e3/60:Math.max(Math.min(d-s.timestamp,w$),1),s.timestamp=d,s.isProcessing=!0,uu.forEach(o),s.isProcessing=!1,n&&t&&(i=!1,e(a))},l=()=>{n=!0,i=!0,s.isProcessing||e(a)};return{schedule:uu.reduce((d,h)=>{const f=r[h];return d[h]=(p,m=!1,v=!1)=>(n||l(),f.schedule(p,m,v)),d},{}),cancel:d=>uu.forEach(h=>r[h].cancel(d)),state:s,steps:r}}const{schedule:zt,cancel:is,state:je,steps:Uf}=k$(typeof requestAnimationFrame<"u"?requestAnimationFrame:ce,!0),S$={useVisualState:oC({scrapeMotionValuesFromProps:sC,createRenderState:tC,onMount:(e,t,{renderState:n,latestValues:i})=>{zt.read(()=>{try{n.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}}),zt.render(()=>{Iy(n,i,{enableHardwareAcceleration:!1},Fy(t.tagName),e.transformTemplate),iC(t,n)})}})},M$={useVisualState:oC({scrapeMotionValuesFromProps:By,createRenderState:$y})};function C$(e,{forwardMotionProps:t=!1},n,i){return{...Ny(e)?S$:M$,preloadedFeatures:n,useRender:g$(t),createVisualElement:i,Component:e}}function Hi(e,t,n,i={passive:!0}){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n)}const aC=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function Fh(e,t="page"){return{point:{x:e[t+"X"],y:e[t+"Y"]}}}const P$=e=>t=>aC(t)&&e(t,Fh(t));function qi(e,t,n,i){return Hi(e,t,P$(n),i)}const T$=(e,t)=>n=>t(e(n)),Is=(...e)=>e.reduce(T$);function lC(e){let t=null;return()=>{const n=()=>{t=null};return t===null?(t=e,n):!1}}const Db=lC("dragHorizontal"),Eb=lC("dragVertical");function cC(e){let t=!1;if(e==="y")t=Eb();else if(e==="x")t=Db();else{const n=Db(),i=Eb();n&&i?t=()=>{n(),i()}:(n&&n(),i&&i())}return t}function uC(){const e=cC(!0);return e?(e(),!1):!0}class tr{constructor(t){this.isMounted=!1,this.node=t}update(){}}function Ab(e,t){const n="pointer"+(t?"enter":"leave"),i="onHover"+(t?"Start":"End"),s=(r,o)=>{if(r.pointerType==="touch"||uC())return;const a=e.getProps();e.animationState&&a.whileHover&&e.animationState.setActive("whileHover",t),a[i]&&zt.update(()=>a[i](r,o))};return qi(e.current,n,s,{passive:!e.getProps()[i]})}class D$ extends tr{mount(){this.unmount=Is(Ab(this.node,!0),Ab(this.node,!1))}unmount(){}}class E$ extends tr{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Is(Hi(this.node.current,"focus",()=>this.onFocus()),Hi(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const dC=(e,t)=>t?e===t?!0:dC(e,t.parentElement):!1;function Yf(e,t){if(!t)return;const n=new PointerEvent("pointer"+e);t(n,Fh(n))}class A$ extends tr{constructor(){super(...arguments),this.removeStartListeners=ce,this.removeEndListeners=ce,this.removeAccessibleListeners=ce,this.startPointerPress=(t,n)=>{if(this.isPressing)return;this.removeEndListeners();const i=this.node.getProps(),r=qi(window,"pointerup",(a,l)=>{if(!this.checkPressEnd())return;const{onTap:c,onTapCancel:u,globalTapTarget:d}=this.node.getProps();zt.update(()=>{!d&&!dC(this.node.current,a.target)?u&&u(a,l):c&&c(a,l)})},{passive:!(i.onTap||i.onPointerUp)}),o=qi(window,"pointercancel",(a,l)=>this.cancelPress(a,l),{passive:!(i.onTapCancel||i.onPointerCancel)});this.removeEndListeners=Is(r,o),this.startPress(t,n)},this.startAccessiblePress=()=>{const t=r=>{if(r.key!=="Enter"||this.isPressing)return;const o=a=>{a.key!=="Enter"||!this.checkPressEnd()||Yf("up",(l,c)=>{const{onTap:u}=this.node.getProps();u&&zt.update(()=>u(l,c))})};this.removeEndListeners(),this.removeEndListeners=Hi(this.node.current,"keyup",o),Yf("down",(a,l)=>{this.startPress(a,l)})},n=Hi(this.node.current,"keydown",t),i=()=>{this.isPressing&&Yf("cancel",(r,o)=>this.cancelPress(r,o))},s=Hi(this.node.current,"blur",i);this.removeAccessibleListeners=Is(n,s)}}startPress(t,n){this.isPressing=!0;const{onTapStart:i,whileTap:s}=this.node.getProps();s&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),i&&zt.update(()=>i(t,n))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!uC()}cancelPress(t,n){if(!this.checkPressEnd())return;const{onTapCancel:i}=this.node.getProps();i&&zt.update(()=>i(t,n))}mount(){const t=this.node.getProps(),n=qi(t.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),i=Hi(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=Is(n,i)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const Am=new WeakMap,Xf=new WeakMap,O$=e=>{const t=Am.get(e.target);t&&t(e)},L$=e=>{e.forEach(O$)};function R$({root:e,...t}){const n=e||document;Xf.has(n)||Xf.set(n,{});const i=Xf.get(n),s=JSON.stringify(t);return i[s]||(i[s]=new IntersectionObserver(L$,{root:e,...t})),i[s]}function N$(e,t,n){const i=R$(t);return Am.set(e,n),i.observe(e),()=>{Am.delete(e),i.unobserve(e)}}const j$={some:0,all:1};class $$ extends tr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:i,amount:s="some",once:r}=t,o={root:n?n.current:void 0,rootMargin:i,threshold:typeof s=="number"?s:j$[s]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,r&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:d}=this.node.getProps(),h=c?u:d;h&&h(l)};return N$(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(I$(t,n))&&this.startObserver()}unmount(){}}function I$({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const F$={inView:{Feature:$$},tap:{Feature:A$},focus:{Feature:E$},hover:{Feature:D$}};function hC(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let i=0;it[i]=n.get()),t}function V$(e){const t={};return e.values.forEach((n,i)=>t[i]=n.getVelocity()),t}function Bh(e,t,n){const i=e.getProps();return Vy(i,t,n!==void 0?n:i.custom,B$(e),V$(e))}let zy=ce;const Dr=e=>e*1e3,Qi=e=>e/1e3,z$={current:!1},fC=e=>Array.isArray(e)&&typeof e[0]=="number";function pC(e){return!!(!e||typeof e=="string"&&mC[e]||fC(e)||Array.isArray(e)&&e.every(pC))}const Qa=([e,t,n,i])=>`cubic-bezier(${e}, ${t}, ${n}, ${i})`,mC={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Qa([0,.65,.55,1]),circOut:Qa([.55,0,1,.45]),backIn:Qa([.31,.01,.66,-.59]),backOut:Qa([.33,1.53,.69,.99])};function gC(e){if(e)return fC(e)?Qa(e):Array.isArray(e)?e.map(gC):mC[e]}function W$(e,t,n,{delay:i=0,duration:s,repeat:r=0,repeatType:o="loop",ease:a,times:l}={}){const c={[t]:n};l&&(c.offset=l);const u=gC(a);return Array.isArray(u)&&(c.easing=u),e.animate(c,{delay:i,duration:s,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:r+1,direction:o==="reverse"?"alternate":"normal"})}function H$(e,{repeat:t,repeatType:n="loop"}){const i=t&&n!=="loop"&&t%2===1?0:e.length-1;return e[i]}const yC=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,U$=1e-7,Y$=12;function X$(e,t,n,i,s){let r,o,a=0;do o=t+(n-t)/2,r=yC(o,i,s)-e,r>0?n=o:t=o;while(Math.abs(r)>U$&&++aX$(r,0,1,e,n);return r=>r===0||r===1?r:yC(s(r),t,i)}const K$=bc(.42,0,1,1),G$=bc(0,0,.58,1),vC=bc(.42,0,.58,1),q$=e=>Array.isArray(e)&&typeof e[0]!="number",xC=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,bC=e=>t=>1-e(1-t),Wy=e=>1-Math.sin(Math.acos(e)),_C=bC(Wy),Q$=xC(Wy),wC=bc(.33,1.53,.69,.99),Hy=bC(wC),Z$=xC(Hy),J$=e=>(e*=2)<1?.5*Hy(e):.5*(2-Math.pow(2,-10*(e-1))),tI={linear:ce,easeIn:K$,easeInOut:vC,easeOut:G$,circIn:Wy,circInOut:Q$,circOut:_C,backIn:Hy,backInOut:Z$,backOut:wC,anticipate:J$},Ob=e=>{if(Array.isArray(e)){zy(e.length===4);const[t,n,i,s]=e;return bc(t,n,i,s)}else if(typeof e=="string")return tI[e];return e},Uy=(e,t)=>n=>!!(vc(n)&&n$.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),kC=(e,t,n)=>i=>{if(!vc(i))return i;const[s,r,o,a]=i.match(Ih);return{[e]:parseFloat(s),[t]:parseFloat(r),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},eI=e=>Hs(0,255,e),Kf={...Yr,transform:e=>Math.round(eI(e))},kr={test:Uy("rgb","red"),parse:kC("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:i=1})=>"rgba("+Kf.transform(e)+", "+Kf.transform(t)+", "+Kf.transform(n)+", "+yl(gl.transform(i))+")"};function nI(e){let t="",n="",i="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),i=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),i=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,i+=i,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}}const Om={test:Uy("#"),parse:nI,transform:kr.transform},wo={test:Uy("hsl","hue"),parse:kC("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:i=1})=>"hsla("+Math.round(e)+", "+bi.transform(yl(t))+", "+bi.transform(yl(n))+", "+yl(gl.transform(i))+")"},We={test:e=>kr.test(e)||Om.test(e)||wo.test(e),parse:e=>kr.test(e)?kr.parse(e):wo.test(e)?wo.parse(e):Om.parse(e),transform:e=>vc(e)?e:e.hasOwnProperty("red")?kr.transform(e):wo.transform(e)},ee=(e,t,n)=>-n*e+n*t+e;function Gf(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function iI({hue:e,saturation:t,lightness:n,alpha:i}){e/=360,t/=100,n/=100;let s=0,r=0,o=0;if(!t)s=r=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;s=Gf(l,a,e+1/3),r=Gf(l,a,e),o=Gf(l,a,e-1/3)}return{red:Math.round(s*255),green:Math.round(r*255),blue:Math.round(o*255),alpha:i}}const qf=(e,t,n)=>{const i=e*e;return Math.sqrt(Math.max(0,n*(t*t-i)+i))},sI=[Om,kr,wo],rI=e=>sI.find(t=>t.test(e));function Lb(e){const t=rI(e);let n=t.parse(e);return t===wo&&(n=iI(n)),n}const SC=(e,t)=>{const n=Lb(e),i=Lb(t),s={...n};return r=>(s.red=qf(n.red,i.red,r),s.green=qf(n.green,i.green,r),s.blue=qf(n.blue,i.blue,r),s.alpha=ee(n.alpha,i.alpha,r),kr.transform(s))};function oI(e){var t,n;return isNaN(e)&&vc(e)&&(((t=e.match(Ih))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(qM))===null||n===void 0?void 0:n.length)||0)>0}const MC={regex:t$,countKey:"Vars",token:"${v}",parse:ce},CC={regex:qM,countKey:"Colors",token:"${c}",parse:We.parse},PC={regex:Ih,countKey:"Numbers",token:"${n}",parse:Yr.parse};function Qf(e,{regex:t,countKey:n,token:i,parse:s}){const r=e.tokenised.match(t);r&&(e["num"+n]=r.length,e.tokenised=e.tokenised.replace(t,i),e.values.push(...r.map(s)))}function Ud(e){const t=e.toString(),n={value:t,tokenised:t,values:[],numVars:0,numColors:0,numNumbers:0};return n.value.includes("var(--")&&Qf(n,MC),Qf(n,CC),Qf(n,PC),n}function TC(e){return Ud(e).values}function DC(e){const{values:t,numColors:n,numVars:i,tokenised:s}=Ud(e),r=t.length;return o=>{let a=s;for(let l=0;ltypeof e=="number"?0:e;function lI(e){const t=TC(e);return DC(e)(t.map(aI))}const Us={test:oI,parse:TC,createTransformer:DC,getAnimatableNone:lI},EC=(e,t)=>n=>`${n>0?t:e}`;function AC(e,t){return typeof e=="number"?n=>ee(e,t,n):We.test(e)?SC(e,t):e.startsWith("var(")?EC(e,t):LC(e,t)}const OC=(e,t)=>{const n=[...e],i=n.length,s=e.map((r,o)=>AC(r,t[o]));return r=>{for(let o=0;o{const n={...e,...t},i={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(i[s]=AC(e[s],t[s]));return s=>{for(const r in i)n[r]=i[r](s);return n}},LC=(e,t)=>{const n=Us.createTransformer(t),i=Ud(e),s=Ud(t);return i.numVars===s.numVars&&i.numColors===s.numColors&&i.numNumbers>=s.numNumbers?Is(OC(i.values,s.values),n):EC(e,t)},Ql=(e,t,n)=>{const i=t-e;return i===0?1:(n-e)/i},Rb=(e,t)=>n=>ee(e,t,n);function uI(e){return typeof e=="number"?Rb:typeof e=="string"?We.test(e)?SC:LC:Array.isArray(e)?OC:typeof e=="object"?cI:Rb}function dI(e,t,n){const i=[],s=n||uI(e[0]),r=e.length-1;for(let o=0;ot[0];e[0]>e[r-1]&&(e=[...e].reverse(),t=[...t].reverse());const o=dI(t,i,s),a=o.length,l=c=>{let u=0;if(a>1)for(;ul(Hs(e[0],e[r-1],c)):l}function hI(e,t){const n=e[e.length-1];for(let i=1;i<=t;i++){const s=Ql(0,t,i);e.push(ee(n,1,s))}}function fI(e){const t=[0];return hI(t,e.length-1),t}function pI(e,t){return e.map(n=>n*t)}function mI(e,t){return e.map(()=>t||vC).splice(0,e.length-1)}function Yd({duration:e=300,keyframes:t,times:n,ease:i="easeInOut"}){const s=q$(i)?i.map(Ob):Ob(i),r={done:!1,value:t[0]},o=pI(n&&n.length===t.length?n:fI(t),e),a=RC(o,t,{ease:Array.isArray(s)?s:mI(t,s)});return{calculatedDuration:e,next:l=>(r.value=a(l),r.done=l>=e,r)}}function NC(e,t){return t?e*(1e3/t):0}const gI=5;function jC(e,t,n){const i=Math.max(t-gI,0);return NC(n-e(i),t-i)}const Zf=.001,yI=.01,vI=10,xI=.05,bI=1;function _I({duration:e=800,bounce:t=.25,velocity:n=0,mass:i=1}){let s,r,o=1-t;o=Hs(xI,bI,o),e=Hs(yI,vI,Qi(e)),o<1?(s=c=>{const u=c*o,d=u*e,h=u-n,f=Lm(c,o),p=Math.exp(-d);return Zf-h/f*p},r=c=>{const d=c*o*e,h=d*n+n,f=Math.pow(o,2)*Math.pow(c,2)*e,p=Math.exp(-d),m=Lm(Math.pow(c,2),o);return(-s(c)+Zf>0?-1:1)*((h-f)*p)/m}):(s=c=>{const u=Math.exp(-c*e),d=(c-n)*e+1;return-Zf+u*d},r=c=>{const u=Math.exp(-c*e),d=(n-c)*(e*e);return u*d});const a=5/e,l=kI(s,r,a);if(e=Dr(e),isNaN(l))return{stiffness:100,damping:10,duration:e};{const c=Math.pow(l,2)*i;return{stiffness:c,damping:o*2*Math.sqrt(i*c),duration:e}}}const wI=12;function kI(e,t,n){let i=n;for(let s=1;se[n]!==void 0)}function CI(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!Nb(e,MI)&&Nb(e,SI)){const n=_I(e);t={...t,...n,mass:1},t.isResolvedFromDuration=!0}return t}function $C({keyframes:e,restDelta:t,restSpeed:n,...i}){const s=e[0],r=e[e.length-1],o={done:!1,value:s},{stiffness:a,damping:l,mass:c,duration:u,velocity:d,isResolvedFromDuration:h}=CI({...i,velocity:-Qi(i.velocity||0)}),f=d||0,p=l/(2*Math.sqrt(a*c)),m=r-s,v=Qi(Math.sqrt(a/c)),y=Math.abs(m)<5;n||(n=y?.01:2),t||(t=y?.005:.5);let g;if(p<1){const x=Lm(v,p);g=_=>{const w=Math.exp(-p*v*_);return r-w*((f+p*v*m)/x*Math.sin(x*_)+m*Math.cos(x*_))}}else if(p===1)g=x=>r-Math.exp(-v*x)*(m+(f+v*m)*x);else{const x=v*Math.sqrt(p*p-1);g=_=>{const w=Math.exp(-p*v*_),S=Math.min(x*_,300);return r-w*((f+p*v*m)*Math.sinh(S)+x*m*Math.cosh(S))/x}}return{calculatedDuration:h&&u||null,next:x=>{const _=g(x);if(h)o.done=x>=u;else{let w=f;x!==0&&(p<1?w=jC(g,x,_):w=0);const S=Math.abs(w)<=n,C=Math.abs(r-_)<=t;o.done=S&&C}return o.value=o.done?r:_,o}}}function jb({keyframes:e,velocity:t=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:u}){const d=e[0],h={done:!1,value:d},f=M=>a!==void 0&&Ml,p=M=>a===void 0?l:l===void 0||Math.abs(a-M)-m*Math.exp(-M/i),x=M=>y+g(M),_=M=>{const P=g(M),T=x(M);h.done=Math.abs(P)<=c,h.value=h.done?y:T};let w,S;const C=M=>{f(h.value)&&(w=M,S=$C({keyframes:[h.value,p(h.value)],velocity:jC(x,M,h.value),damping:s,stiffness:r,restDelta:c,restSpeed:u}))};return C(0),{calculatedDuration:null,next:M=>{let P=!1;return!S&&w===void 0&&(P=!0,_(M),C(M)),w!==void 0&&M>w?S.next(M-w):(!P&&_(M),h)}}}const PI=e=>{const t=({timestamp:n})=>e(n);return{start:()=>zt.update(t,!0),stop:()=>is(t),now:()=>je.isProcessing?je.timestamp:performance.now()}},$b=2e4;function Ib(e){let t=0;const n=50;let i=e.next(t);for(;!i.done&&t<$b;)t+=n,i=e.next(t);return t>=$b?1/0:t}const TI={decay:jb,inertia:jb,tween:Yd,keyframes:Yd,spring:$C};function Xd({autoplay:e=!0,delay:t=0,driver:n=PI,keyframes:i,type:s="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:a="loop",onPlay:l,onStop:c,onComplete:u,onUpdate:d,...h}){let f=1,p=!1,m,v;const y=()=>{v=new Promise(V=>{m=V})};y();let g;const x=TI[s]||Yd;let _;x!==Yd&&typeof i[0]!="number"&&(_=RC([0,100],i,{clamp:!1}),i=[0,100]);const w=x({...h,keyframes:i});let S;a==="mirror"&&(S=x({...h,keyframes:[...i].reverse(),velocity:-(h.velocity||0)}));let C="idle",M=null,P=null,T=null;w.calculatedDuration===null&&r&&(w.calculatedDuration=Ib(w));const{calculatedDuration:A}=w;let E=1/0,z=1/0;A!==null&&(E=A+o,z=E*(r+1)-o);let N=0;const L=V=>{if(P===null)return;f>0&&(P=Math.min(P,V)),f<0&&(P=Math.min(V-z/f,P)),M!==null?N=M:N=Math.round(V-P)*f;const W=N-t*(f>=0?1:-1),et=f>=0?W<0:W>z;N=Math.max(W,0),C==="finished"&&M===null&&(N=z);let Z=N,O=w;if(r){const kt=Math.min(N,z)/E;let it=Math.floor(kt),Lt=kt%1;!Lt&&kt>=1&&(Lt=1),Lt===1&&it--,it=Math.min(it,r+1),!!(it%2)&&(a==="reverse"?(Lt=1-Lt,o&&(Lt-=o/E)):a==="mirror"&&(O=S)),Z=Hs(0,1,Lt)*E}const U=et?{done:!1,value:i[0]}:O.next(Z);_&&(U.value=_(U.value));let{done:lt}=U;!et&&A!==null&&(lt=f>=0?N>=z:N<=0);const ct=M===null&&(C==="finished"||C==="running"&<);return d&&d(U.value),ct&&D(),U},R=()=>{g&&g.stop(),g=void 0},B=()=>{C="idle",R(),m(),y(),P=T=null},D=()=>{C="finished",u&&u(),R(),m()},$=()=>{if(p)return;g||(g=n(L));const V=g.now();l&&l(),M!==null?P=V-M:(!P||C==="finished")&&(P=V),C==="finished"&&y(),T=P,M=null,C="running",g.start()};e&&$();const F={then(V,W){return v.then(V,W)},get time(){return Qi(N)},set time(V){V=Dr(V),N=V,M!==null||!g||f===0?M=V:P=g.now()-V/f},get duration(){const V=w.calculatedDuration===null?Ib(w):w.calculatedDuration;return Qi(V)},get speed(){return f},set speed(V){V===f||!g||(f=V,F.time=Qi(N))},get state(){return C},play:$,pause:()=>{C="paused",M=N},stop:()=>{p=!0,C!=="idle"&&(C="idle",c&&c(),B())},cancel:()=>{T!==null&&L(T),B()},complete:()=>{C="finished"},sample:V=>(P=0,L(V))};return F}function DI(e){let t;return()=>(t===void 0&&(t=e()),t)}const EI=DI(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),AI=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),du=10,OI=2e4,LI=(e,t)=>t.type==="spring"||e==="backgroundColor"||!pC(t.ease);function RI(e,t,{onUpdate:n,onComplete:i,...s}){if(!(EI()&&AI.has(t)&&!s.repeatDelay&&s.repeatType!=="mirror"&&s.damping!==0&&s.type!=="inertia"))return!1;let o=!1,a,l,c=!1;const u=()=>{l=new Promise(x=>{a=x})};u();let{keyframes:d,duration:h=300,ease:f,times:p}=s;if(LI(t,s)){const x=Xd({...s,repeat:0,delay:0});let _={done:!1,value:d[0]};const w=[];let S=0;for(;!_.done&&S{c=!1,m.cancel()},y=()=>{c=!0,zt.update(v),a(),u()};return m.onfinish=()=>{c||(e.set(H$(d,s)),i&&i(),y())},{then(x,_){return l.then(x,_)},attachTimeline(x){return m.timeline=x,m.onfinish=null,ce},get time(){return Qi(m.currentTime||0)},set time(x){m.currentTime=Dr(x)},get speed(){return m.playbackRate},set speed(x){m.playbackRate=x},get duration(){return Qi(h)},play:()=>{o||(m.play(),is(v))},pause:()=>m.pause(),stop:()=>{if(o=!0,m.playState==="idle")return;const{currentTime:x}=m;if(x){const _=Xd({...s,autoplay:!1});e.setWithVelocity(_.sample(x-du).value,_.sample(x).value,du)}y()},complete:()=>{c||m.finish()},cancel:y}}function NI({keyframes:e,delay:t,onUpdate:n,onComplete:i}){const s=()=>(n&&n(e[e.length-1]),i&&i(),{time:0,speed:1,duration:0,play:ce,pause:ce,stop:ce,then:r=>(r(),Promise.resolve()),cancel:ce,complete:ce});return t?Xd({keyframes:[0,1],duration:0,delay:t,onComplete:s}):s()}const jI={type:"spring",stiffness:500,damping:25,restSpeed:10},$I=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),II={type:"keyframes",duration:.8},FI={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},BI=(e,{keyframes:t})=>t.length>2?II:Ur.has(e)?e.startsWith("scale")?$I(t[1]):jI:FI,Rm=(e,t)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Us.test(t)||t==="0")&&!t.startsWith("url(")),VI=new Set(["brightness","contrast","saturate","opacity"]);function zI(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[i]=n.match(Ih)||[];if(!i)return e;const s=n.replace(i,"");let r=VI.has(t)?1:0;return i!==n&&(r*=100),t+"("+r+s+")"}const WI=/([a-z-]*)\(.*?\)/g,Nm={...Us,getAnimatableNone:e=>{const t=e.match(WI);return t?t.map(zI).join(" "):e}},HI={...QM,color:We,backgroundColor:We,outlineColor:We,fill:We,stroke:We,borderColor:We,borderTopColor:We,borderRightColor:We,borderBottomColor:We,borderLeftColor:We,filter:Nm,WebkitFilter:Nm},Yy=e=>HI[e];function IC(e,t){let n=Yy(e);return n!==Nm&&(n=Us),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const FC=e=>/^0[^.\s]+$/.test(e);function UI(e){if(typeof e=="number")return e===0;if(e!==null)return e==="none"||e==="0"||FC(e)}function YI(e,t,n,i){const s=Rm(t,n);let r;Array.isArray(n)?r=[...n]:r=[null,n];const o=i.from!==void 0?i.from:e.get();let a;const l=[];for(let c=0;cs=>{const r=Xy(i,e)||{},o=r.delay||i.delay||0;let{elapsed:a=0}=i;a=a-Dr(o);const l=YI(t,e,n,r),c=l[0],u=l[l.length-1],d=Rm(e,c),h=Rm(e,u);let f={keyframes:l,velocity:t.getVelocity(),ease:"easeOut",...r,delay:-a,onUpdate:p=>{t.set(p),r.onUpdate&&r.onUpdate(p)},onComplete:()=>{s(),r.onComplete&&r.onComplete()}};if(XI(r)||(f={...f,...BI(e,f)}),f.duration&&(f.duration=Dr(f.duration)),f.repeatDelay&&(f.repeatDelay=Dr(f.repeatDelay)),!d||!h||z$.current||r.type===!1||KI.skipAnimations)return NI(f);if(!i.isHandoff&&t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate){const p=RI(t,e,f);if(p)return p}return Xd(f)};function Kd(e){return!!(un(e)&&e.add)}const BC=e=>/^\-?\d*\.?\d+$/.test(e);function Gy(e,t){e.indexOf(t)===-1&&e.push(t)}function qy(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Qy{constructor(){this.subscriptions=[]}add(t){return Gy(this.subscriptions,t),()=>qy(this.subscriptions,t)}notify(t,n,i){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,i);else for(let r=0;r!isNaN(parseFloat(e));class qI{constructor(t,n={}){this.version="10.18.0",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(i,s=!0)=>{this.prev=this.current,this.current=i;const{delta:r,timestamp:o}=je;this.lastUpdated!==o&&(this.timeDelta=r,this.lastUpdated=o,zt.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),s&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>zt.postRender(this.velocityCheck),this.velocityCheck=({timestamp:i})=>{i!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=GI(this.current),this.owner=n.owner}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Qy);const i=this.events[t].add(n);return t==="change"?()=>{i(),zt.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,i){this.set(n),this.prev=t,this.timeDelta=i}jump(t){this.updateAndNotify(t),this.prev=t,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?NC(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Qo(e,t){return new qI(e,t)}const VC=e=>t=>t.test(e),QI={test:e=>e==="auto",parse:e=>e},zC=[Yr,st,bi,ps,s$,i$,QI],Ma=e=>zC.find(VC(e)),ZI=[...zC,We,Us],JI=e=>ZI.find(VC(e));function tF(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Qo(n))}function eF(e,t){const n=Bh(e,t);let{transitionEnd:i={},transition:s={},...r}=n?e.makeTargetAnimatable(n,!1):{};r={...r,...i};for(const o in r){const a=v$(r[o]);tF(e,o,a)}}function nF(e,t,n){var i,s;const r=Object.keys(t).filter(a=>!e.hasValue(a)),o=r.length;if(o)for(let a=0;al.remove(d))),c.push(v)}return o&&Promise.all(c).then(()=>{o&&eF(e,o)}),c}function jm(e,t,n={}){const i=Bh(e,t,n.custom);let{transition:s=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const r=i?()=>Promise.all(WC(e,i,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:c=0,staggerChildren:u,staggerDirection:d}=s;return aF(e,t,c+l,u,d,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[l,c]=a==="beforeChildren"?[r,o]:[o,r];return l().then(()=>c())}else return Promise.all([r(),o(n.delay)])}function aF(e,t,n=0,i=0,s=1,r){const o=[],a=(e.variantChildren.size-1)*i,l=s===1?(c=0)=>c*i:(c=0)=>a-c*i;return Array.from(e.variantChildren).sort(lF).forEach((c,u)=>{c.notify("AnimationStart",t),o.push(jm(c,t,{...r,delay:n+l(u)}).then(()=>c.notify("AnimationComplete",t)))}),Promise.all(o)}function lF(e,t){return e.sortNodePosition(t)}function cF(e,t,n={}){e.notify("AnimationStart",t);let i;if(Array.isArray(t)){const s=t.map(r=>jm(e,r,n));i=Promise.all(s)}else if(typeof t=="string")i=jm(e,t,n);else{const s=typeof t=="function"?Bh(e,t,n.custom):t;i=Promise.all(WC(e,s,n))}return i.then(()=>e.notify("AnimationComplete",t))}const uF=[...Oy].reverse(),dF=Oy.length;function hF(e){return t=>Promise.all(t.map(({animation:n,options:i})=>cF(e,n,i)))}function fF(e){let t=hF(e);const n=mF();let i=!0;const s=(l,c)=>{const u=Bh(e,c);if(u){const{transition:d,transitionEnd:h,...f}=u;l={...l,...f,...h}}return l};function r(l){t=l(e)}function o(l,c){const u=e.getProps(),d=e.getVariantContext(!0)||{},h=[],f=new Set;let p={},m=1/0;for(let y=0;ym&&w,T=!1;const A=Array.isArray(_)?_:[_];let E=A.reduce(s,{});S===!1&&(E={});const{prevResolvedValues:z={}}=x,N={...z,...E},L=R=>{P=!0,f.has(R)&&(T=!0,f.delete(R)),x.needsAnimating[R]=!0};for(const R in N){const B=E[R],D=z[R];if(p.hasOwnProperty(R))continue;let $=!1;Hd(B)&&Hd(D)?$=!hC(B,D):$=B!==D,$?B!==void 0?L(R):f.add(R):B!==void 0&&f.has(R)?L(R):x.protectedKeys[R]=!0}x.prevProp=_,x.prevResolvedValues=E,x.isActive&&(p={...p,...E}),i&&e.blockInitialAnimation&&(P=!1),P&&(!C||T)&&h.push(...A.map(R=>({animation:R,options:{type:g,...l}})))}if(f.size){const y={};f.forEach(g=>{const x=e.getBaseTarget(g);x!==void 0&&(y[g]=x)}),h.push({animation:y})}let v=!!h.length;return i&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(v=!1),i=!1,v?t(h):Promise.resolve()}function a(l,c,u){var d;if(n[l].isActive===c)return Promise.resolve();(d=e.variantChildren)===null||d===void 0||d.forEach(f=>{var p;return(p=f.animationState)===null||p===void 0?void 0:p.setActive(l,c)}),n[l].isActive=c;const h=o(u,l);for(const f in n)n[f].protectedKeys={};return h}return{animateChanges:o,setActive:a,setAnimateFunction:r,getState:()=>n}}function pF(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!hC(t,e):!1}function lr(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function mF(){return{animate:lr(!0),whileInView:lr(),whileHover:lr(),whileTap:lr(),whileDrag:lr(),whileFocus:lr(),exit:lr()}}class gF extends tr{constructor(t){super(t),t.animationState||(t.animationState=fF(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();this.unmount(),jh(t)&&(this.unmount=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){}}let yF=0;class vF extends tr{constructor(){super(...arguments),this.id=yF++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n,custom:i}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===s)return;const r=this.node.animationState.setActive("exit",!t,{custom:i??this.node.getProps().custom});n&&!t&&r.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const xF={animation:{Feature:gF},exit:{Feature:vF}},Fb=(e,t)=>Math.abs(e-t);function bF(e,t){const n=Fb(e.x,t.x),i=Fb(e.y,t.y);return Math.sqrt(n**2+i**2)}class HC{constructor(t,n,{transformPagePoint:i,contextWindow:s,dragSnapToOrigin:r=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=tp(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,f=bF(d.offset,{x:0,y:0})>=3;if(!h&&!f)return;const{point:p}=d,{timestamp:m}=je;this.history.push({...p,timestamp:m});const{onStart:v,onMove:y}=this.handlers;h||(v&&v(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,d)},this.handlePointerMove=(d,h)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=Jf(h,this.transformPagePoint),zt.update(this.updatePoint,!0)},this.handlePointerUp=(d,h)=>{this.end();const{onEnd:f,onSessionEnd:p,resumeAnimation:m}=this.handlers;if(this.dragSnapToOrigin&&m&&m(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=tp(d.type==="pointercancel"?this.lastMoveEventInfo:Jf(h,this.transformPagePoint),this.history);this.startEvent&&f&&f(d,v),p&&p(d,v)},!aC(t))return;this.dragSnapToOrigin=r,this.handlers=n,this.transformPagePoint=i,this.contextWindow=s||window;const o=Fh(t),a=Jf(o,this.transformPagePoint),{point:l}=a,{timestamp:c}=je;this.history=[{...l,timestamp:c}];const{onSessionStart:u}=n;u&&u(t,tp(a,this.history)),this.removeListeners=Is(qi(this.contextWindow,"pointermove",this.handlePointerMove),qi(this.contextWindow,"pointerup",this.handlePointerUp),qi(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),is(this.updatePoint)}}function Jf(e,t){return t?{point:t(e.point)}:e}function Bb(e,t){return{x:e.x-t.x,y:e.y-t.y}}function tp({point:e},t){return{point:e,delta:Bb(e,UC(t)),offset:Bb(e,_F(t)),velocity:wF(t,.1)}}function _F(e){return e[0]}function UC(e){return e[e.length-1]}function wF(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,i=null;const s=UC(e);for(;n>=0&&(i=e[n],!(s.timestamp-i.timestamp>Dr(t)));)n--;if(!i)return{x:0,y:0};const r=Qi(s.timestamp-i.timestamp);if(r===0)return{x:0,y:0};const o={x:(s.x-i.x)/r,y:(s.y-i.y)/r};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function wn(e){return e.max-e.min}function $m(e,t=0,n=.01){return Math.abs(e-t)<=n}function Vb(e,t,n,i=.5){e.origin=i,e.originPoint=ee(t.min,t.max,e.origin),e.scale=wn(n)/wn(t),($m(e.scale,1,1e-4)||isNaN(e.scale))&&(e.scale=1),e.translate=ee(n.min,n.max,e.origin)-e.originPoint,($m(e.translate)||isNaN(e.translate))&&(e.translate=0)}function vl(e,t,n,i){Vb(e.x,t.x,n.x,i?i.originX:void 0),Vb(e.y,t.y,n.y,i?i.originY:void 0)}function zb(e,t,n){e.min=n.min+t.min,e.max=e.min+wn(t)}function kF(e,t,n){zb(e.x,t.x,n.x),zb(e.y,t.y,n.y)}function Wb(e,t,n){e.min=t.min-n.min,e.max=e.min+wn(t)}function xl(e,t,n){Wb(e.x,t.x,n.x),Wb(e.y,t.y,n.y)}function SF(e,{min:t,max:n},i){return t!==void 0&&en&&(e=i?ee(n,e,i.max):Math.min(e,n)),e}function Hb(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function MF(e,{top:t,left:n,bottom:i,right:s}){return{x:Hb(e.x,n,s),y:Hb(e.y,t,i)}}function Ub(e,t){let n=t.min-e.min,i=t.max-e.max;return t.max-t.mini?n=Ql(t.min,t.max-i,e.min):i>s&&(n=Ql(e.min,e.max-s,t.min)),Hs(0,1,n)}function TF(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Im=.35;function DF(e=Im){return e===!1?e=0:e===!0&&(e=Im),{x:Yb(e,"left","right"),y:Yb(e,"top","bottom")}}function Yb(e,t,n){return{min:Xb(e,t),max:Xb(e,n)}}function Xb(e,t){return typeof e=="number"?e:e[t]||0}const Kb=()=>({translate:0,scale:1,origin:0,originPoint:0}),ko=()=>({x:Kb(),y:Kb()}),Gb=()=>({min:0,max:0}),fe=()=>({x:Gb(),y:Gb()});function An(e){return[e("x"),e("y")]}function YC({top:e,left:t,right:n,bottom:i}){return{x:{min:t,max:n},y:{min:e,max:i}}}function EF({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function AF(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),i=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}function ep(e){return e===void 0||e===1}function Fm({scale:e,scaleX:t,scaleY:n}){return!ep(e)||!ep(t)||!ep(n)}function mr(e){return Fm(e)||XC(e)||e.z||e.rotate||e.rotateX||e.rotateY}function XC(e){return qb(e.x)||qb(e.y)}function qb(e){return e&&e!=="0%"}function Gd(e,t,n){const i=e-n,s=t*i;return n+s}function Qb(e,t,n,i,s){return s!==void 0&&(e=Gd(e,s,i)),Gd(e,n,i)+t}function Bm(e,t=0,n=1,i,s){e.min=Qb(e.min,t,n,i,s),e.max=Qb(e.max,t,n,i,s)}function KC(e,{x:t,y:n}){Bm(e.x,t.translate,t.scale,t.originPoint),Bm(e.y,n.translate,n.scale,n.originPoint)}function OF(e,t,n,i=!1){const s=n.length;if(!s)return;t.x=t.y=1;let r,o;for(let a=0;a1.0000000000001||e<.999999999999?e:1}function ys(e,t){e.min=e.min+t,e.max=e.max+t}function Jb(e,t,[n,i,s]){const r=t[s]!==void 0?t[s]:.5,o=ee(e.min,e.max,r);Bm(e,t[n],t[i],o,t.scale)}const LF=["x","scaleX","originX"],RF=["y","scaleY","originY"];function So(e,t){Jb(e.x,t,LF),Jb(e.y,t,RF)}function GC(e,t){return YC(AF(e.getBoundingClientRect(),t))}function NF(e,t,n){const i=GC(e,n),{scroll:s}=t;return s&&(ys(i.x,s.offset.x),ys(i.y,s.offset.y)),i}const qC=({current:e})=>e?e.ownerDocument.defaultView:null,jF=new WeakMap;class $F{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=fe(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const s=u=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Fh(u,"page").point)},r=(u,d)=>{const{drag:h,dragPropagation:f,onDragStart:p}=this.getProps();if(h&&!f&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=cC(h),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),An(v=>{let y=this.getAxisMotionValue(v).get()||0;if(bi.test(y)){const{projection:g}=this.visualElement;if(g&&g.layout){const x=g.layout.layoutBox[v];x&&(y=wn(x)*(parseFloat(y)/100))}}this.originPoint[v]=y}),p&&zt.update(()=>p(u,d),!1,!0);const{animationState:m}=this.visualElement;m&&m.setActive("whileDrag",!0)},o=(u,d)=>{const{dragPropagation:h,dragDirectionLock:f,onDirectionLock:p,onDrag:m}=this.getProps();if(!h&&!this.openGlobalLock)return;const{offset:v}=d;if(f&&this.currentDirection===null){this.currentDirection=IF(v),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",d.point,v),this.updateAxis("y",d.point,v),this.visualElement.render(),m&&m(u,d)},a=(u,d)=>this.stop(u,d),l=()=>An(u=>{var d;return this.getAnimationState(u)==="paused"&&((d=this.getAxisMotionValue(u).animation)===null||d===void 0?void 0:d.play())}),{dragSnapToOrigin:c}=this.getProps();this.panSession=new HC(t,{onSessionStart:s,onStart:r,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,contextWindow:qC(this.visualElement)})}stop(t,n){const i=this.isDragging;if(this.cancel(),!i)return;const{velocity:s}=n;this.startAnimation(s);const{onDragEnd:r}=this.getProps();r&&zt.update(()=>r(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:i}=this.getProps();!i&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,i){const{drag:s}=this.getProps();if(!i||!hu(t,s,this.currentDirection))return;const r=this.getAxisMotionValue(t);let o=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(o=SF(o,this.constraints[t],this.elastic[t])),r.set(o)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:i}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,r=this.constraints;n&&_o(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&s?this.constraints=MF(s.layoutBox,n):this.constraints=!1,this.elastic=DF(i),r!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&An(o=>{this.getAxisMotionValue(o)&&(this.constraints[o]=TF(s.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!_o(t))return!1;const i=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const r=NF(i,s.root,this.visualElement.getTransformPagePoint());let o=CF(s.layout.layoutBox,r);if(n){const a=n(EF(o));this.hasMutatedConstraints=!!a,a&&(o=YC(a))}return o}startAnimation(t){const{drag:n,dragMomentum:i,dragElastic:s,dragTransition:r,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=An(u=>{if(!hu(u,n,this.currentDirection))return;let d=l&&l[u]||{};o&&(d={min:0,max:0});const h=s?200:1e6,f=s?40:1e7,p={type:"inertia",velocity:i?t[u]:0,bounceStiffness:h,bounceDamping:f,timeConstant:750,restDelta:1,restSpeed:10,...r,...d};return this.startAxisValueAnimation(u,p)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const i=this.getAxisMotionValue(t);return i.start(Ky(t,i,0,n))}stopAnimation(){An(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){An(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n="_drag"+t.toUpperCase(),i=this.visualElement.getProps(),s=i[n];return s||this.visualElement.getValue(t,(i.initial?i.initial[t]:void 0)||0)}snapToCursor(t){An(n=>{const{drag:i}=this.getProps();if(!hu(n,i,this.currentDirection))return;const{projection:s}=this.visualElement,r=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:a}=s.layout.layoutBox[n];r.set(t[n]-ee(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!_o(n)||!i||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};An(o=>{const a=this.getAxisMotionValue(o);if(a){const l=a.get();s[o]=PF({min:l,max:l},this.constraints[o])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),An(o=>{if(!hu(o,t,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(ee(l,c,s[o]))})}addListeners(){if(!this.visualElement.current)return;jF.set(this.visualElement,this);const t=this.visualElement.current,n=qi(t,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),i=()=>{const{dragConstraints:l}=this.getProps();_o(l)&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,r=s.addEventListener("measure",i);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),i();const o=Hi(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(An(u=>{const d=this.getAxisMotionValue(u);d&&(this.originPoint[u]+=l[u].translate,d.set(d.get()+l[u].translate))}),this.visualElement.render())});return()=>{o(),n(),r(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:i=!1,dragPropagation:s=!1,dragConstraints:r=!1,dragElastic:o=Im,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:i,dragPropagation:s,dragConstraints:r,dragElastic:o,dragMomentum:a}}}function hu(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function IF(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class FF extends tr{constructor(t){super(t),this.removeGroupControls=ce,this.removeListeners=ce,this.controls=new $F(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ce}unmount(){this.removeGroupControls(),this.removeListeners()}}const t1=e=>(t,n)=>{e&&zt.update(()=>e(t,n))};class BF extends tr{constructor(){super(...arguments),this.removePointerDownListener=ce}onPointerDown(t){this.session=new HC(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:qC(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:i,onPanEnd:s}=this.node.getProps();return{onSessionStart:t1(t),onStart:t1(n),onMove:i,onEnd:(r,o)=>{delete this.session,s&&zt.update(()=>s(r,o))}}}mount(){this.removePointerDownListener=qi(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function VF(){const e=k.useContext(Rh);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:n,register:i}=e,s=k.useId();return k.useEffect(()=>i(s),[]),!t&&n?[!1,()=>n&&n(s)]:[!0]}const nd={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function e1(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Ca={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(st.test(e))e=parseFloat(e);else return e;const n=e1(e,t.target.x),i=e1(e,t.target.y);return`${n}% ${i}%`}},zF={correct:(e,{treeScale:t,projectionDelta:n})=>{const i=e,s=Us.parse(e);if(s.length>5)return i;const r=Us.createTransformer(e),o=typeof s[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;s[0+o]/=a,s[1+o]/=l;const c=ee(a,l,.5);return typeof s[2+o]=="number"&&(s[2+o]/=c),typeof s[3+o]=="number"&&(s[3+o]/=c),r(s)}};class WF extends Y.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i,layoutId:s}=this.props,{projection:r}=t;qj(HF),r&&(n.group&&n.group.add(r),i&&i.register&&s&&i.register(r),r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,onExitComplete:()=>this.safeToRemove()})),nd.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:i,drag:s,isPresent:r}=this.props,o=i.projection;return o&&(o.isPresent=r,s||t.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),t.isPresent!==r&&(r?o.promote():o.relegate()||zt.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),queueMicrotask(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i}=this.props,{projection:s}=t;s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),i&&i.deregister&&i.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function QC(e){const[t,n]=VF(),i=k.useContext(Ry);return Y.createElement(WF,{...e,layoutGroup:i,switchLayoutGroup:k.useContext(YM),isPresent:t,safeToRemove:n})}const HF={borderRadius:{...Ca,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ca,borderTopRightRadius:Ca,borderBottomLeftRadius:Ca,borderBottomRightRadius:Ca,boxShadow:zF},ZC=["TopLeft","TopRight","BottomLeft","BottomRight"],UF=ZC.length,n1=e=>typeof e=="string"?parseFloat(e):e,i1=e=>typeof e=="number"||st.test(e);function YF(e,t,n,i,s,r){s?(e.opacity=ee(0,n.opacity!==void 0?n.opacity:1,XF(i)),e.opacityExit=ee(t.opacity!==void 0?t.opacity:1,0,KF(i))):r&&(e.opacity=ee(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,i));for(let o=0;oit?1:n(Ql(e,t,i))}function r1(e,t){e.min=t.min,e.max=t.max}function Dn(e,t){r1(e.x,t.x),r1(e.y,t.y)}function o1(e,t,n,i,s){return e-=t,e=Gd(e,1/n,i),s!==void 0&&(e=Gd(e,1/s,i)),e}function GF(e,t=0,n=1,i=.5,s,r=e,o=e){if(bi.test(t)&&(t=parseFloat(t),t=ee(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=ee(r.min,r.max,i);e===r&&(a-=t),e.min=o1(e.min,t,n,a,s),e.max=o1(e.max,t,n,a,s)}function a1(e,t,[n,i,s],r,o){GF(e,t[n],t[i],t[s],t.scale,r,o)}const qF=["x","scaleX","originX"],QF=["y","scaleY","originY"];function l1(e,t,n,i){a1(e.x,t,qF,n?n.x:void 0,i?i.x:void 0),a1(e.y,t,QF,n?n.y:void 0,i?i.y:void 0)}function c1(e){return e.translate===0&&e.scale===1}function tP(e){return c1(e.x)&&c1(e.y)}function ZF(e,t){return e.x.min===t.x.min&&e.x.max===t.x.max&&e.y.min===t.y.min&&e.y.max===t.y.max}function eP(e,t){return Math.round(e.x.min)===Math.round(t.x.min)&&Math.round(e.x.max)===Math.round(t.x.max)&&Math.round(e.y.min)===Math.round(t.y.min)&&Math.round(e.y.max)===Math.round(t.y.max)}function u1(e){return wn(e.x)/wn(e.y)}class JF{constructor(){this.members=[]}add(t){Gy(this.members,t),t.scheduleRender()}remove(t){if(qy(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(s=>t===s);if(n===0)return!1;let i;for(let s=n;s>=0;s--){const r=this.members[s];if(r.isPresent!==!1){i=r;break}}return i?(this.promote(i),!0):!1}promote(t,n){const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.instance&&i.scheduleRender(),t.scheduleRender(),t.resumeFrom=i,n&&(t.resumeFrom.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:s}=t.options;s===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:i}=t;n.onExitComplete&&n.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function d1(e,t,n){let i="";const s=e.x.translate/t.x,r=e.y.translate/t.y;if((s||r)&&(i=`translate3d(${s}px, ${r}px, 0) `),(t.x!==1||t.y!==1)&&(i+=`scale(${1/t.x}, ${1/t.y}) `),n){const{rotate:l,rotateX:c,rotateY:u}=n;l&&(i+=`rotate(${l}deg) `),c&&(i+=`rotateX(${c}deg) `),u&&(i+=`rotateY(${u}deg) `)}const o=e.x.scale*t.x,a=e.y.scale*t.y;return(o!==1||a!==1)&&(i+=`scale(${o}, ${a})`),i||"none"}const tB=(e,t)=>e.depth-t.depth;class eB{constructor(){this.children=[],this.isDirty=!1}add(t){Gy(this.children,t),this.isDirty=!0}remove(t){qy(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(tB),this.isDirty=!1,this.children.forEach(t)}}function nB(e,t){const n=performance.now(),i=({timestamp:s})=>{const r=s-n;r>=t&&(is(i),e(r-t))};return zt.read(i,!0),()=>is(i)}function iB(e){window.MotionDebug&&window.MotionDebug.record(e)}function sB(e){return e instanceof SVGElement&&e.tagName!=="svg"}function rB(e,t,n){const i=un(e)?e:Qo(e);return i.start(Ky("",i,t,n)),i.animation}const h1=["","X","Y","Z"],oB={visibility:"hidden"},f1=1e3;let aB=0;const gr={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function nP({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:i,resetTransform:s}){return class{constructor(o={},a=t==null?void 0:t()){this.id=aB++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,gr.totalNodes=gr.resolvedTargetDeltas=gr.recalculatedProjection=0,this.nodes.forEach(uB),this.nodes.forEach(mB),this.nodes.forEach(gB),this.nodes.forEach(dB),iB(gr)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;lthis.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=nB(h,250),nd.hasAnimatedSinceResize&&(nd.hasAnimatedSinceResize=!1,this.nodes.forEach(m1))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&u&&(l||c)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:h,hasRelativeTargetChanged:f,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||u.getDefaultTransition()||_B,{onLayoutAnimationStart:v,onLayoutAnimationComplete:y}=u.getProps(),g=!this.targetLayout||!eP(this.targetLayout,p)||f,x=!h&&f;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||x||h&&(g||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,x);const _={...Xy(m,"layout"),onPlay:v,onComplete:y};(u.shouldReduceMotion||this.options.layoutRoot)&&(_.delay=0,_.type=!1),this.startAnimation(_)}else h||m1(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,is(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(yB),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;uthis.update()))}clearAllSnapshots(){this.nodes.forEach(hB),this.sharedNodes.forEach(vB)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,zt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){zt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{const w=_/1e3;g1(d.x,o.x,w),g1(d.y,o.y,w),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(xl(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),xB(this.relativeTarget,this.relativeTargetOrigin,h,w),x&&ZF(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=fe()),Dn(x,this.relativeTarget)),m&&(this.animationValues=u,YF(u,c,this.latestValues,w,g,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=w},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(is(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=zt.update(()=>{nd.hasAnimatedSinceResize=!0,this.currentAnimation=rB(0,f1,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(f1),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=o;if(!(!a||!l||!c)){if(this!==o&&this.layout&&c&&iP(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||fe();const d=wn(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+d;const h=wn(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+h}Dn(a,l),So(a,u),vl(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new JF),this.sharedNodes.get(o).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.rotate||l.rotateX||l.rotateY||l.rotateZ)&&(a=!0),!a)return;const c={};for(let u=0;u{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(p1),this.root.sharedNodes.clear()}}}function lB(e){e.updateLayout()}function cB(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:i,measuredBox:s}=e.layout,{animationType:r}=e.options,o=n.source!==e.layout.source;r==="size"?An(d=>{const h=o?n.measuredBox[d]:n.layoutBox[d],f=wn(h);h.min=i[d].min,h.max=h.min+f}):iP(r,n.layoutBox,i)&&An(d=>{const h=o?n.measuredBox[d]:n.layoutBox[d],f=wn(i[d]);h.max=h.min+f,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+f)});const a=ko();vl(a,i,n.layoutBox);const l=ko();o?vl(l,e.applyTransform(s,!0),n.measuredBox):vl(l,i,n.layoutBox);const c=!tP(a);let u=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:h,layout:f}=d;if(h&&f){const p=fe();xl(p,n.layoutBox,h.layoutBox);const m=fe();xl(m,i,f.layoutBox),eP(p,m)||(u=!0),d.options.layoutRoot&&(e.relativeTarget=m,e.relativeTargetOrigin=p,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:i,snapshot:n,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeTargetChanged:u})}else if(e.isLead()){const{onExitComplete:i}=e.options;i&&i()}e.options.transition=void 0}function uB(e){gr.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function dB(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function hB(e){e.clearSnapshot()}function p1(e){e.clearMeasurements()}function fB(e){e.isLayoutDirty=!1}function pB(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function m1(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function mB(e){e.resolveTargetDelta()}function gB(e){e.calcProjection()}function yB(e){e.resetRotation()}function vB(e){e.removeLeadSnapshot()}function g1(e,t,n){e.translate=ee(t.translate,0,n),e.scale=ee(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function y1(e,t,n,i){e.min=ee(t.min,n.min,i),e.max=ee(t.max,n.max,i)}function xB(e,t,n,i){y1(e.x,t.x,n.x,i),y1(e.y,t.y,n.y,i)}function bB(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const _B={duration:.45,ease:[.4,0,.1,1]},v1=e=>typeof navigator<"u"&&navigator.userAgent.toLowerCase().includes(e),x1=v1("applewebkit/")&&!v1("chrome/")?Math.round:ce;function b1(e){e.min=x1(e.min),e.max=x1(e.max)}function wB(e){b1(e.x),b1(e.y)}function iP(e,t,n){return e==="position"||e==="preserve-aspect"&&!$m(u1(t),u1(n),.2)}const kB=nP({attachResizeListener:(e,t)=>Hi(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),np={current:void 0},sP=nP({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!np.current){const e=new kB({});e.mount(window),e.setOptions({layoutScroll:!0}),np.current=e}return np.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),SB={pan:{Feature:BF},drag:{Feature:FF,ProjectionNode:sP,MeasureLayout:QC}},MB=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function CB(e){const t=MB.exec(e);if(!t)return[,];const[,n,i]=t;return[n,i]}function Vm(e,t,n=1){const[i,s]=CB(e);if(!i)return;const r=window.getComputedStyle(t).getPropertyValue(i);if(r){const o=r.trim();return BC(o)?parseFloat(o):o}else return Em(s)?Vm(s,t,n+1):s}function PB(e,{...t},n){const i=e.current;if(!(i instanceof Element))return{target:t,transitionEnd:n};n&&(n={...n}),e.values.forEach(s=>{const r=s.get();if(!Em(r))return;const o=Vm(r,i);o&&s.set(o)});for(const s in t){const r=t[s];if(!Em(r))continue;const o=Vm(r,i);o&&(t[s]=o,n||(n={}),n[s]===void 0&&(n[s]=r))}return{target:t,transitionEnd:n}}const TB=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),rP=e=>TB.has(e),DB=e=>Object.keys(e).some(rP),_1=e=>e===Yr||e===st,w1=(e,t)=>parseFloat(e.split(", ")[t]),k1=(e,t)=>(n,{transform:i})=>{if(i==="none"||!i)return 0;const s=i.match(/^matrix3d\((.+)\)$/);if(s)return w1(s[1],t);{const r=i.match(/^matrix\((.+)\)$/);return r?w1(r[1],e):0}},EB=new Set(["x","y","z"]),AB=yc.filter(e=>!EB.has(e));function OB(e){const t=[];return AB.forEach(n=>{const i=e.getValue(n);i!==void 0&&(t.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),t.length&&e.render(),t}const Zo={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:k1(4,13),y:k1(5,14)};Zo.translateX=Zo.x;Zo.translateY=Zo.y;const LB=(e,t,n)=>{const i=t.measureViewportBox(),s=t.current,r=getComputedStyle(s),{display:o}=r,a={};o==="none"&&t.setStaticValue("display",e.display||"block"),n.forEach(c=>{a[c]=Zo[c](i,r)}),t.render();const l=t.measureViewportBox();return n.forEach(c=>{const u=t.getValue(c);u&&u.jump(a[c]),e[c]=Zo[c](l,r)}),e},RB=(e,t,n={},i={})=>{t={...t},i={...i};const s=Object.keys(t).filter(rP);let r=[],o=!1;const a=[];if(s.forEach(l=>{const c=e.getValue(l);if(!e.hasValue(l))return;let u=n[l],d=Ma(u);const h=t[l];let f;if(Hd(h)){const p=h.length,m=h[0]===null?1:0;u=h[m],d=Ma(u);for(let v=m;v=0?window.pageYOffset:null,c=LB(t,e,a);return r.length&&r.forEach(([u,d])=>{e.getValue(u).set(d)}),e.render(),Nh&&l!==null&&window.scrollTo({top:l}),{target:c,transitionEnd:i}}else return{target:t,transitionEnd:i}};function NB(e,t,n,i){return DB(t)?RB(e,t,n,i):{target:t,transitionEnd:i}}const jB=(e,t,n,i)=>{const s=PB(e,t,i);return t=s.target,i=s.transitionEnd,NB(e,t,n,i)},zm={current:null},oP={current:!1};function $B(){if(oP.current=!0,!!Nh)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>zm.current=e.matches;e.addListener(t),t()}else zm.current=!1}function IB(e,t,n){const{willChange:i}=t;for(const s in t){const r=t[s],o=n[s];if(un(r))e.addValue(s,r),Kd(i)&&i.add(s);else if(un(o))e.addValue(s,Qo(r,{owner:e})),Kd(i)&&i.remove(s);else if(o!==r)if(e.hasValue(s)){const a=e.getValue(s);!a.hasAnimated&&a.set(r)}else{const a=e.getStaticValue(s);e.addValue(s,Qo(a!==void 0?a:r,{owner:e}))}}for(const s in n)t[s]===void 0&&e.removeValue(s);return t}const S1=new WeakMap,aP=Object.keys(ql),FB=aP.length,M1=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],BB=Ly.length;class VB{constructor({parent:t,props:n,presenceContext:i,reducedMotionConfig:s,visualState:r},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>zt.render(this.render,!1,!0);const{latestValues:a,renderState:l}=r;this.latestValues=a,this.baseTarget={...a},this.initialValues=n.initial?{...a}:{},this.renderState=l,this.parent=t,this.props=n,this.presenceContext=i,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=o,this.isControllingVariants=$h(n),this.isVariantNode=UM(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:c,...u}=this.scrapeMotionValuesFromProps(n,{});for(const d in u){const h=u[d];a[d]!==void 0&&un(h)&&(h.set(a[d],!1),Kd(c)&&c.add(d))}}scrapeMotionValuesFromProps(t,n){return{}}mount(t){this.current=t,S1.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,i)=>this.bindToMotionValue(i,n)),oP.current||$B(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:zm.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){S1.delete(this.current),this.projection&&this.projection.unmount(),is(this.notifyUpdate),is(this.render),this.valueSubscriptions.forEach(t=>t()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features)this.features[t].unmount();this.current=null}bindToMotionValue(t,n){const i=Ur.has(t),s=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&zt.update(this.notifyUpdate,!1,!0),i&&this.projection&&(this.projection.isTransformDirty=!0)}),r=n.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(t,()=>{s(),r()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}loadFeatures({children:t,...n},i,s,r){let o,a;for(let l=0;lthis.scheduleRender(),animationType:typeof c=="string"?c:"both",initialPromotionConfig:r,layoutScroll:h,layoutRoot:f})}return a}updateFeatures(){for(const t in this.features){const n=this.features[t];n.isMounted?n.update():(n.mount(),n.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):fe()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}makeTargetAnimatable(t,n=!0){return this.makeTargetAnimatableFromInstance(t,this.props,n)}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let i=0;in.variantChildren.delete(t)}addValue(t,n){n!==this.values.get(t)&&(this.removeValue(t),this.bindToMotionValue(t,n)),this.values.set(t,n),this.latestValues[t]=n.get()}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let i=this.values.get(t);return i===void 0&&n!==void 0&&(i=Qo(n,{owner:this}),this.addValue(t,i)),i}readValue(t){var n;return this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(n=this.getBaseTargetFromProps(this.props,t))!==null&&n!==void 0?n:this.readValueFromInstance(this.current,t,this.options)}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:i}=this.props,s=typeof i=="string"||typeof i=="object"?(n=Vy(this.props,i))===null||n===void 0?void 0:n[t]:void 0;if(i&&s!==void 0)return s;const r=this.getBaseTargetFromProps(this.props,t);return r!==void 0&&!un(r)?r:this.initialValues[t]!==void 0&&s===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Qy),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class lP extends VB{sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:i}){delete n[t],delete i[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:n,...i},{transformValues:s},r){let o=sF(i,t||{},this);if(s&&(n&&(n=s(n)),i&&(i=s(i)),o&&(o=s(o))),r){nF(this,i,o);const a=jB(this,i,o,n);n=a.transitionEnd,i=a.target}return{transition:t,transitionEnd:n,...i}}}function zB(e){return window.getComputedStyle(e)}class WB extends lP{constructor(){super(...arguments),this.type="html"}readValueFromInstance(t,n){if(Ur.has(n)){const i=Yy(n);return i&&i.default||0}else{const i=zB(t),s=(GM(n)?i.getPropertyValue(n):i[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return GC(t,n)}build(t,n,i,s){jy(t,n,i,s.transformTemplate)}scrapeMotionValuesFromProps(t,n){return By(t,n)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;un(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}renderInstance(t,n,i,s){eC(t,n,i,s)}}class HB extends lP{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Ur.has(n)){const i=Yy(n);return i&&i.default||0}return n=nC.has(n)?n:Ay(n),t.getAttribute(n)}measureInstanceViewportBox(){return fe()}scrapeMotionValuesFromProps(t,n){return sC(t,n)}build(t,n,i,s){Iy(t,n,i,this.isSVGTag,s.transformTemplate)}renderInstance(t,n,i,s){iC(t,n,i,s)}mount(t){this.isSVGTag=Fy(t.tagName),super.mount(t)}}const UB=(e,t)=>Ny(e)?new HB(t,{enableHardwareAcceleration:!1}):new WB(t,{enableHardwareAcceleration:!0}),YB={layout:{ProjectionNode:sP,MeasureLayout:QC}},XB={...xF,...F$,...SB,...YB},Jo=Kj((e,t)=>C$(e,t,XB,UB));function cP(){const e=k.useRef(!1);return Ey(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function KB(){const e=cP(),[t,n]=k.useState(0),i=k.useCallback(()=>{e.current&&n(t+1)},[t]);return[k.useCallback(()=>zt.postRender(i),[i]),t]}class GB extends k.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const i=this.props.sizeRef.current;i.height=n.offsetHeight||0,i.width=n.offsetWidth||0,i.top=n.offsetTop,i.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function qB({children:e,isPresent:t}){const n=k.useId(),i=k.useRef(null),s=k.useRef({width:0,height:0,top:0,left:0});return k.useInsertionEffect(()=>{const{width:r,height:o,top:a,left:l}=s.current;if(t||!i.current||!r||!o)return;i.current.dataset.motionPopId=n;const c=document.createElement("style");return document.head.appendChild(c),c.sheet&&c.sheet.insertRule(` +`):e}function WL(e,t){const{element:n,datasetIndex:i,index:s}=t,r=e.getDatasetMeta(i).controller,{label:o,value:a}=r.getLabelAndValue(s);return{chart:e,label:o,parsed:r.getParsed(s),raw:e.data.datasets[i].data[s],formattedValue:a,dataset:r.getDataset(),dataIndex:s,datasetIndex:i,element:n}}function qx(e,t){const n=e.chart.ctx,{body:i,footer:s,title:r}=e,{boxWidth:o,boxHeight:a}=t,l=ge(t.bodyFont),c=ge(t.titleFont),u=ge(t.footerFont),d=r.length,h=s.length,f=i.length,p=Ae(t.padding);let m=p.height,v=0,y=i.reduce((_,w)=>_+w.before.length+w.lines.length+w.after.length,0);if(y+=e.beforeBody.length+e.afterBody.length,d&&(m+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),y){const _=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;m+=f*_+(y-f)*l.lineHeight+(y-1)*t.bodySpacing}h&&(m+=t.footerMarginTop+h*u.lineHeight+(h-1)*t.footerSpacing);let g=0;const x=function(_){v=Math.max(v,n.measureText(_).width+g)};return n.save(),n.font=c.string,Et(e.title,x),n.font=l.string,Et(e.beforeBody.concat(e.afterBody),x),g=t.displayColors?o+2+t.boxPadding:0,Et(i,_=>{Et(_.before,x),Et(_.lines,x),Et(_.after,x)}),g=0,n.font=u.string,Et(e.footer,x),n.restore(),v+=p.width,{width:v,height:m}}function HL(e,t){const{y:n,height:i}=t;return ne.height-i/2?"bottom":"center"}function UL(e,t,n,i){const{x:s,width:r}=i,o=n.caretSize+n.caretPadding;if(e==="left"&&s+r+o>t.width||e==="right"&&s-r-o<0)return!0}function YL(e,t,n,i){const{x:s,width:r}=n,{width:o,chartArea:{left:a,right:l}}=e;let c="center";return i==="center"?c=s<=(a+l)/2?"left":"right":s<=r/2?c="left":s>=o-r/2&&(c="right"),UL(c,e,t,n)&&(c="center"),c}function Qx(e,t,n){const i=n.yAlign||t.yAlign||HL(e,n);return{xAlign:n.xAlign||t.xAlign||YL(e,t,n,i),yAlign:i}}function XL(e,t){let{x:n,width:i}=e;return t==="right"?n-=i:t==="center"&&(n-=i/2),n}function KL(e,t,n){let{y:i,height:s}=e;return t==="top"?i+=n:t==="bottom"?i-=s+n:i-=s/2,i}function Zx(e,t,n,i){const{caretSize:s,caretPadding:r,cornerRadius:o}=e,{xAlign:a,yAlign:l}=n,c=s+r,{topLeft:u,topRight:d,bottomLeft:h,bottomRight:f}=Cr(o);let p=XL(t,a);const m=KL(t,l,c);return l==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(u,h)+s:a==="right"&&(p+=Math.max(d,f)+s),{x:we(p,0,i.width-t.width),y:we(m,0,i.height-t.height)}}function au(e,t,n){const i=Ae(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-i.right:e.x+i.left}function Jx(e){return ci([],Oi(e))}function GL(e,t,n){return Qs(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function tb(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const EM={beforeTitle:Di,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,i=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex"u"?EM[t].call(n,i):s}var kp;let eb=(kp=class extends os{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,i=this.options.setContext(this.getContext()),s=i.enabled&&n.options.animation&&i.animations,r=new sM(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=GL(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:i}=n,s=qe(i,"beforeTitle",this,t),r=qe(i,"title",this,t),o=qe(i,"afterTitle",this,t);let a=[];return a=ci(a,Oi(s)),a=ci(a,Oi(r)),a=ci(a,Oi(o)),a}getBeforeBody(t,n){return Jx(qe(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:i}=n,s=[];return Et(t,r=>{const o={before:[],lines:[],after:[]},a=tb(i,r);ci(o.before,Oi(qe(a,"beforeLabel",this,r))),ci(o.lines,qe(a,"label",this,r)),ci(o.after,Oi(qe(a,"afterLabel",this,r))),s.push(o)}),s}getAfterBody(t,n){return Jx(qe(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:i}=n,s=qe(i,"beforeFooter",this,t),r=qe(i,"footer",this,t),o=qe(i,"afterFooter",this,t);let a=[];return a=ci(a,Oi(s)),a=ci(a,Oi(r)),a=ci(a,Oi(o)),a}_createItems(t){const n=this._active,i=this.chart.data,s=[],r=[],o=[];let a=[],l,c;for(l=0,c=n.length;lt.filter(u,d,h,i))),t.itemSort&&(a=a.sort((u,d)=>t.itemSort(u,d,i))),Et(a,u=>{const d=tb(t.callbacks,u);s.push(qe(d,"labelColor",this,u)),r.push(qe(d,"labelPointStyle",this,u)),o.push(qe(d,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=r,this.labelTextColors=o,this.dataPoints=a,a}update(t,n){const i=this.options.setContext(this.getContext()),s=this._active;let r,o=[];if(!s.length)this.opacity!==0&&(r={opacity:0});else{const a=qa[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const l=this._size=qx(this,i),c=Object.assign({},a,l),u=Qx(this.chart,i,c),d=Zx(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,r={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,i,s){const r=this.getCaretPosition(t,i,s);n.lineTo(r.x1,r.y1),n.lineTo(r.x2,r.y2),n.lineTo(r.x3,r.y3)}getCaretPosition(t,n,i){const{xAlign:s,yAlign:r}=this,{caretSize:o,cornerRadius:a}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=Cr(a),{x:h,y:f}=t,{width:p,height:m}=n;let v,y,g,x,_,w;return r==="center"?(_=f+m/2,s==="left"?(v=h,y=v-o,x=_+o,w=_-o):(v=h+p,y=v+o,x=_-o,w=_+o),g=v):(s==="left"?y=h+Math.max(l,u)+o:s==="right"?y=h+p-Math.max(c,d)-o:y=this.caretX,r==="top"?(x=f,_=x-o,v=y-o,g=y+o):(x=f+m,_=x+o,v=y+o,g=y-o),w=x),{x1:v,x2:y,x3:g,y1:x,y2:_,y3:w}}drawTitle(t,n,i){const s=this.title,r=s.length;let o,a,l;if(r){const c=Oo(i.rtl,this.x,this.width);for(t.x=au(this,i.titleAlign,i),n.textAlign=c.textAlign(i.titleAlign),n.textBaseline="middle",o=ge(i.titleFont),a=i.titleSpacing,n.fillStyle=i.titleColor,n.font=o.string,l=0;lg!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,Ul(t,{x:m,y:p,w:c,h:l,radius:y}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),Ul(t,{x:v,y:p+1,w:c-2,h:l-2,radius:y}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(m,p,c,l),t.strokeRect(m,p,c,l),t.fillStyle=o.backgroundColor,t.fillRect(v,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,n,i){const{body:s}=this,{bodySpacing:r,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=i,d=ge(i.bodyFont);let h=d.lineHeight,f=0;const p=Oo(i.rtl,this.x,this.width),m=function(M){n.fillText(M,p.x(t.x+f),t.y+h/2),t.y+=h+r},v=p.textAlign(o);let y,g,x,_,w,S,C;for(n.textAlign=o,n.textBaseline="middle",n.font=d.string,t.x=au(this,v,i),n.fillStyle=i.bodyColor,Et(this.beforeBody,m),f=a&&v!=="right"?o==="center"?c/2+u:c+2+u:0,_=0,S=s.length;_0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,i=this.$animations,s=i&&i.x,r=i&&i.y;if(s||r){const o=qa[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=qx(this,t),l=Object.assign({},o,this._size),c=Qx(n,t,l),u=Zx(t,l,c,n);(s._to!==u.x||r._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(n);const s={width:this.width,height:this.height},r={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=Ae(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(r,t,s,n),JS(t,n.textDirection),r.y+=o.top,this.drawTitle(r,t,n),this.drawBody(r,t,n),this.drawFooter(r,t,n),tM(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const i=this._active,s=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),r=!Rd(i,s),o=this._positionChanged(s,n);(r||o)&&(this._active=s,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,i=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,r=this._active||[],o=this._getActiveElements(t,r,n,i),a=this._positionChanged(o,t),l=n||!Rd(o,r)||a;return l&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,i,s){const r=this.options;if(t.type==="mouseout")return[];if(!s)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const o=this.chart.getElementsAtEventForMode(t,r.mode,r,i);return r.reverse&&o.reverse(),o}_positionChanged(t,n){const{caretX:i,caretY:s,options:r}=this,o=qa[r.position].call(this,t,n);return o!==!1&&(i!==o.x||s!==o.y)}},K(kp,"positioners",qa),kp);var qL={id:"tooltip",_element:eb,positioners:qa,afterInit(e,t,n){n&&(e.tooltip=new eb({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:EM},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"]},QL=Object.freeze({__proto__:null,Colors:cL,Decimation:fL,Filler:RL,Legend:FL,SubTitle:zL,Title:VL,Tooltip:qL});const ZL=(e,t,n,i)=>(typeof t=="string"?(n=e.push(t)-1,i.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function JL(e,t,n,i){const s=e.indexOf(t);if(s===-1)return ZL(e,t,n,i);const r=e.lastIndexOf(t);return s!==r?n:s}const tN=(e,t)=>e===null?null:we(Math.round(e),0,t);function nb(e){const t=this.getLabels();return e>=0&&en.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}},K(Nu,"id","category"),K(Nu,"defaults",{ticks:{callback:nb}}),Nu);function nN(e,t){const n=[],{bounds:s,step:r,min:o,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:h}=e,f=r||1,p=u-1,{min:m,max:v}=t,y=!bt(o),g=!bt(a),x=!bt(c),_=(v-m)/(d+1);let w=Gv((v-m)/p/f)*f,S,C,M,P;if(w<1e-14&&!y&&!g)return[{value:m},{value:v}];P=Math.ceil(v/w)-Math.floor(m/w),P>p&&(w=Gv(P*w/p/f)*f),bt(l)||(S=Math.pow(10,l),w=Math.ceil(w*S)/S),s==="ticks"?(C=Math.floor(m/w)*w,M=Math.ceil(v/w)*w):(C=m,M=v),y&&g&&r&&WA((a-o)/r,w/1e3)?(P=Math.round(Math.min((a-o)/w,u)),w=(a-o)/P,C=o,M=a):x?(C=y?o:C,M=g?a:M,P=c-1,w=(M-C)/P):(P=(M-C)/w,hl(P,Math.round(P),w/1e3)?P=Math.round(P):P=Math.ceil(P));const T=Math.max(qv(w),qv(C));S=Math.pow(10,bt(l)?T:l),C=Math.round(C*S)/S,M=Math.round(M*S)/S;let A=0;for(y&&(h&&C!==o?(n.push({value:o}),Ca)break;n.push({value:E})}return g&&h&&M!==a?n.length&&hl(n[n.length-1].value,a,ib(a,_,e))?n[n.length-1].value=a:n.push({value:a}):(!g||M===a)&&n.push({value:M}),n}function ib(e,t,{horizontal:n,minRotation:i}){const s=Jn(i),r=(n?Math.sin(s):Math.cos(s))||.001,o=.75*t*(""+e).length;return Math.min(t/r,o)}let Bd=class extends mc{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 bt(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:i}=this.getUserBounds();let{min:s,max:r}=this;const o=l=>s=n?s:l,a=l=>r=i?r:l;if(t){const l=vi(s),c=vi(r);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(s===r){let l=r===0?1:Math.abs(r*.05);a(r+l),t||o(s-l)}this.min=s,this.max=r}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:i}=t,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),n=n||11),n&&(s=Math.min(n,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,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},r=this._range||this,o=nN(s,r);return t.bounds==="ticks"&&jS(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,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-n)/Math.max(t.length-1,1)/2;n-=s,i+=s}this._startValue=n,this._endValue=i,this._valueRange=i-n}getLabelForValue(t){return fc(t,this.chart.options.locale,this.options.ticks.format)}};var ju;let iN=(ju=class extends Bd{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=oe(t)?t:0,this.max=oe(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,i=Jn(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,r.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}},K(ju,"id","linear"),K(ju,"defaults",{ticks:{callback:Mh.formatters.numeric}}),ju);const Xl=e=>Math.floor(Ss(e)),ar=(e,t)=>Math.pow(10,Xl(e)+t);function sb(e){return e/Math.pow(10,Xl(e))===1}function rb(e,t,n){const i=Math.pow(10,n),s=Math.floor(e/i);return Math.ceil(t/i)-s}function sN(e,t){const n=t-e;let i=Xl(n);for(;rb(e,t,i)>10;)i++;for(;rb(e,t,i)<10;)i--;return Math.min(i,Xl(e))}function rN(e,{min:t,max:n}){t=mn(e.min,t);const i=[],s=Xl(t);let r=sN(t,n),o=r<0?Math.pow(10,Math.abs(r)):1;const a=Math.pow(10,r),l=s>r?Math.pow(10,s):0,c=Math.round((t-l)*o)/o,u=Math.floor((t-l)/a/10)*a*10;let d=Math.floor((c-u)/Math.pow(10,r)),h=mn(e.min,Math.round((l+u+d*Math.pow(10,r))*o)/o);for(;h=10?d=d<15?15:20:d++,d>=20&&(r++,d=2,o=r>=0?1:o),h=Math.round((l+u+d*Math.pow(10,r))*o)/o;const f=mn(e.max,h);return i.push({value:f,major:sb(f),significand:d}),i}var $u;let oN=($u=class extends mc{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const i=Bd.prototype.parse.apply(this,[t,n]);if(i===0){this._zero=!0;return}return oe(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=oe(t)?Math.max(0,t):null,this.max=oe(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!oe(this._userMin)&&(this.min=t===ar(this.min,0)?ar(this.min,-1):ar(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let i=this.min,s=this.max;const r=a=>i=t?i:a,o=a=>s=n?s:a;i===s&&(i<=0?(r(1),o(10)):(r(ar(i,-1)),o(ar(s,1)))),i<=0&&r(ar(s,-1)),s<=0&&o(ar(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},i=rN(n,this);return t.bounds==="ticks"&&jS(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":fc(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Ss(t),this._valueRange=Ss(this.max)-Ss(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Ss(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}},K($u,"id","logarithmic"),K($u,"defaults",{ticks:{callback:Mh.formatters.logarithmic,major:{enabled:!0}}}),$u);function Pm(e){const t=e.ticks;if(t.display&&e.display){const n=Ae(t.backdropPadding);return at(t.font&&t.font.size,ne.font.size)+n.height}return 0}function aN(e,t,n){return n=Ut(n)?n:[n],{w:oO(e,t.string,n),h:n.length*t.lineHeight}}function ob(e,t,n,i,s){return e===i||e===s?{start:t-n/2,end:t+n/2}:es?{start:t-n,end:t}:{start:t,end:t+n}}function lN(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),i=[],s=[],r=e._pointLabels.length,o=e.options.pointLabels,a=o.centerPointLabels?Kt/r:0;for(let l=0;lt.r&&(a=(i.end-t.r)/r,e.r=Math.max(e.r,t.r+a)),s.startt.b&&(l=(s.end-t.b)/o,e.b=Math.max(e.b,t.b+l))}function uN(e,t,n){const i=e.drawingArea,{extra:s,additionalAngle:r,padding:o,size:a}=n,l=e.getPointPosition(t,i+s+o,r),c=Math.round(ly(yn(l.angle+ue))),u=mN(l.y,a.h,c),d=fN(c),h=pN(l.x,a.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:h,top:u,right:h+a.w,bottom:u+a.h}}function dN(e,t){if(!t)return!0;const{left:n,top:i,right:s,bottom:r}=e;return!(Wi({x:n,y:i},t)||Wi({x:n,y:r},t)||Wi({x:s,y:i},t)||Wi({x:s,y:r},t))}function hN(e,t,n){const i=[],s=e._pointLabels.length,r=e.options,{centerPointLabels:o,display:a}=r.pointLabels,l={extra:Pm(r)/2,additionalAngle:o?Kt/s:0};let c;for(let u=0;u270||n<90)&&(e-=t),e}function gN(e,t,n){const{left:i,top:s,right:r,bottom:o}=n,{backdropColor:a}=t;if(!bt(a)){const l=Cr(t.borderRadius),c=Ae(t.backdropPadding);e.fillStyle=a;const u=i-c.left,d=s-c.top,h=r-i+c.width,f=o-s+c.height;Object.values(l).some(p=>p!==0)?(e.beginPath(),Ul(e,{x:u,y:d,w:h,h:f,radius:l}),e.fill()):e.fillRect(u,d,h,f)}}function yN(e,t){const{ctx:n,options:{pointLabels:i}}=e;for(let s=t-1;s>=0;s--){const r=e._pointLabelItems[s];if(!r.visible)continue;const o=i.setContext(e.getPointLabelContext(s));gN(n,o,r);const a=ge(o.font),{x:l,y:c,textAlign:u}=r;Br(n,e._pointLabels[s],l,c+a.lineHeight/2,a,{color:o.color,textAlign:u,textBaseline:"middle"})}}function AM(e,t,n,i){const{ctx:s}=e;if(n)s.arc(e.xCenter,e.yCenter,t,0,Xt);else{let r=e.getPointPosition(0,t);s.moveTo(r.x,r.y);for(let o=1;o{const s=$t(this.options.pointLabels.callback,[n,i],this);return s||s===0?s:""}).filter((n,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?lN(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,i,s){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,i,s))}getIndexAngle(t){const n=Xt/(this._pointLabels.length||1),i=this.options.startAngle||0;return yn(t*n+Jn(i))}getDistanceFromCenterForValue(t){if(bt(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(bt(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{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const h=this.getContext(d),f=s.setContext(h),p=r.setContext(h);vN(this,f,l,o,p)}}),i.display){for(t.save(),a=o-1;a>=0;a--){const u=i.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:h}=u;!h||!d||(t.lineWidth=h,t.strokeStyle=d,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,i=n.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let r,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!n.reverse)return;const c=i.setContext(this.getContext(l)),u=ge(c.font);if(r=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,o=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const d=Ae(c.backdropPadding);t.fillRect(-o/2-d.left,-r-u.size/2-d.top,o+d.width,u.size+d.height)}Br(t,a.label,0,-r,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}},K(ro,"id","radialLinear"),K(ro,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Mh.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),K(ro,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),K(ro,"descriptors",{angleLines:{_fallback:"grid"}}),ro);const Eh={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}},tn=Object.keys(Eh);function ab(e,t){return e-t}function lb(e,t){if(bt(t))return null;const n=e._adapter,{parser:i,round:s,isoWeekday:r}=e._parseOpts;let o=t;return typeof i=="function"&&(o=i(o)),oe(o)||(o=typeof i=="string"?n.parse(o,i):n.parse(o)),o===null?null:(s&&(o=s==="week"&&(Wo(r)||r===!0)?n.startOf(o,"isoWeek",r):n.startOf(o,s)),+o)}function cb(e,t,n,i){const s=tn.length;for(let r=tn.indexOf(e);r=tn.indexOf(n);r--){const o=tn[r];if(Eh[o].common&&e._adapter.diff(s,i,o)>=t-1)return o}return tn[n?tn.indexOf(n):0]}function wN(e){for(let t=tn.indexOf(e)+1,n=tn.length;t=t?n[i]:n[s];e[r]=!0}}function kN(e,t,n,i){const s=e._adapter,r=+s.startOf(t[0].value,i),o=t[t.length-1].value;let a,l;for(a=r;a<=o;a=+s.add(a,1,i))l=n[a],l>=0&&(t[l].major=!0);return t}function db(e,t,n){const i=[],s={},r=t.length;let o,a;for(o=0;o+t.value))}initOffsets(t=[]){let n=0,i=0,s,r;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?n=1-s:n=(this.getDecimalForValue(t[1])-s)/2,r=this.getDecimalForValue(t[t.length-1]),t.length===1?i=r:i=(r-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;n=we(n,0,o),i=we(i,0,o),this._offsets={start:n,end:i,factor:1/(n+1+i)}}_generate(){const t=this._adapter,n=this.min,i=this.max,s=this.options,r=s.time,o=r.unit||cb(r.minUnit,n,i,this._getLabelCapacity(n)),a=at(s.ticks.stepSize,1),l=o==="week"?r.isoWeekday:!1,c=Wo(l)||l===!0,u={};let d=n,h,f;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":o),t.diff(i,n,o)>1e5*a)throw new Error(n+" and "+i+" are too far apart with stepSize of "+a+" "+o);const p=s.ticks.source==="data"&&this.getDataTimestamps();for(h=d,f=0;h+m)}getLabelForValue(t){const n=this._adapter,i=this.options.time;return i.tooltipFormat?n.format(t,i.tooltipFormat):n.format(t,i.displayFormats.datetime)}format(t,n){const s=this.options.time.displayFormats,r=this._unit,o=n||s[r];return this._adapter.format(t,o)}_tickFormatFunction(t,n,i,s){const r=this.options,o=r.ticks.callback;if(o)return $t(o,[t,n,i],this);const a=r.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],d=c&&a[c],h=i[n],f=c&&d&&h&&h.major;return this._adapter.format(t,s||(f?d:u))}generateTickLabels(t){let n,i,s;for(n=0,i=t.length;n0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,i;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(n=0,i=s.length;n=e[i].pos&&t<=e[s].pos&&({lo:i,hi:s}=zi(e,"pos",t)),{pos:r,time:a}=e[i],{pos:o,time:l}=e[s]):(t>=e[i].time&&t<=e[s].time&&({lo:i,hi:s}=zi(e,"time",t)),{time:r,pos:a}=e[i],{time:o,pos:l}=e[s]);const c=o-r;return c?a+(l-a)*(t-r)/c:a}var Fu;let SN=(Fu=class extends Tm{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=lu(n,this.min),this._tableRange=lu(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:i}=this,s=[],r=[];let o,a,l,c,u;for(o=0,a=t.length;o=n&&c<=i&&s.push(c);if(s.length<2)return[{time:n,pos:0},{time:i,pos:1}];for(o=0,a=s.length;os-r)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),i=this.getLabelTimestamps();return n.length&&i.length?t=this.normalize(n.concat(i)):t=n.length?n:i,t=this._cache.all=t,t}getDecimalForValue(t){return(lu(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return lu(this._table,i*this._tableRange+this._minPos,!0)}},K(Fu,"id","timeseries"),K(Fu,"defaults",Tm.defaults),Fu);var MN=Object.freeze({__proto__:null,CategoryScale:eN,LinearScale:iN,LogarithmicScale:oN,RadialLinearScale:bN,TimeScale:Tm,TimeSeriesScale:SN});const CN=[P2,iL,QL,MN];by.register(...CN);function OM(e){var t,n,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t"u")return!1;var t=si(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function FN(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var i=t.styles[n]||{},s=t.attributes[n]||{},r=t.elements[n];!Fn(r)||!ki(r)||(Object.assign(r.style,i),Object.keys(s).forEach(function(o){var a=s[o];a===!1?r.removeAttribute(o):r.setAttribute(o,a===!0?"":a)}))})}function BN(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(i){var s=t.elements[i],r=t.attributes[i]||{},o=Object.keys(t.styles.hasOwnProperty(i)?t.styles[i]:n[i]),a=o.reduce(function(l,c){return l[c]="",l},{});!Fn(s)||!ki(s)||(Object.assign(s.style,a),Object.keys(r).forEach(function(l){s.removeAttribute(l)}))})}}const VN={name:"applyStyles",enabled:!0,phase:"write",fn:FN,effect:BN,requires:["computeStyles"]};function xi(e){return e.split("-")[0]}var Tr=Math.max,Vd=Math.min,Ko=Math.round;function Go(e,t){t===void 0&&(t=!1);var n=e.getBoundingClientRect(),i=1,s=1;if(Fn(e)&&t){var r=e.offsetHeight,o=e.offsetWidth;o>0&&(i=Ko(n.width)/o||1),r>0&&(s=Ko(n.height)/r||1)}return{width:n.width/i,height:n.height/s,top:n.top/s,right:n.right/i,bottom:n.bottom/s,left:n.left/i,x:n.left/i,y:n.top/s}}function My(e){var t=Go(e),n=e.offsetWidth,i=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-i)<=1&&(i=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:i}}function NM(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Sy(n)){var i=t;do{if(i&&e.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function ns(e){return si(e).getComputedStyle(e)}function zN(e){return["table","td","th"].indexOf(ki(e))>=0}function Js(e){return((Xo(e)?e.ownerDocument:e.document)||window.document).documentElement}function Ah(e){return ki(e)==="html"?e:e.assignedSlot||e.parentNode||(Sy(e)?e.host:null)||Js(e)}function mb(e){return!Fn(e)||ns(e).position==="fixed"?null:e.offsetParent}function WN(e){var t=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,n=navigator.userAgent.indexOf("Trident")!==-1;if(n&&Fn(e)){var i=ns(e);if(i.position==="fixed")return null}var s=Ah(e);for(Sy(s)&&(s=s.host);Fn(s)&&["html","body"].indexOf(ki(s))<0;){var r=ns(s);if(r.transform!=="none"||r.perspective!=="none"||r.contain==="paint"||["transform","perspective"].indexOf(r.willChange)!==-1||t&&r.willChange==="filter"||t&&r.filter&&r.filter!=="none")return s;s=s.parentNode}return null}function yc(e){for(var t=si(e),n=mb(e);n&&zN(n)&&ns(n).position==="static";)n=mb(n);return n&&(ki(n)==="html"||ki(n)==="body"&&ns(n).position==="static")?t:n||WN(e)||t}function Cy(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function ml(e,t,n){return Tr(e,Vd(t,n))}function HN(e,t,n){var i=ml(e,t,n);return i>n?n:i}function jM(){return{top:0,right:0,bottom:0,left:0}}function $M(e){return Object.assign({},jM(),e)}function IM(e,t){return t.reduce(function(n,i){return n[i]=e,n},{})}var UN=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,$M(typeof t!="number"?t:IM(t,gc))};function YN(e){var t,n=e.state,i=e.name,s=e.options,r=n.elements.arrow,o=n.modifiersData.popperOffsets,a=xi(n.placement),l=Cy(a),c=[cn,Wn].indexOf(a)>=0,u=c?"height":"width";if(!(!r||!o)){var d=UN(s.padding,n),h=My(r),f=l==="y"?ln:cn,p=l==="y"?zn:Wn,m=n.rects.reference[u]+n.rects.reference[l]-o[l]-n.rects.popper[u],v=o[l]-n.rects.reference[l],y=yc(r),g=y?l==="y"?y.clientHeight||0:y.clientWidth||0:0,x=m/2-v/2,_=d[f],w=g-h[u]-d[p],S=g/2-h[u]/2+x,C=ml(_,S,w),M=l;n.modifiersData[i]=(t={},t[M]=C,t.centerOffset=C-S,t)}}function XN(e){var t=e.state,n=e.options,i=n.element,s=i===void 0?"[data-popper-arrow]":i;s!=null&&(typeof s=="string"&&(s=t.elements.popper.querySelector(s),!s)||NM(t.elements.popper,s)&&(t.elements.arrow=s))}const KN={name:"arrow",enabled:!0,phase:"main",fn:YN,effect:XN,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function qo(e){return e.split("-")[1]}var GN={top:"auto",right:"auto",bottom:"auto",left:"auto"};function qN(e){var t=e.x,n=e.y,i=window,s=i.devicePixelRatio||1;return{x:Ko(t*s)/s||0,y:Ko(n*s)/s||0}}function gb(e){var t,n=e.popper,i=e.popperRect,s=e.placement,r=e.variation,o=e.offsets,a=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,d=e.isFixed,h=o.x,f=h===void 0?0:h,p=o.y,m=p===void 0?0:p,v=typeof u=="function"?u({x:f,y:m}):{x:f,y:m};f=v.x,m=v.y;var y=o.hasOwnProperty("x"),g=o.hasOwnProperty("y"),x=cn,_=ln,w=window;if(c){var S=yc(n),C="clientHeight",M="clientWidth";if(S===si(n)&&(S=Js(n),ns(S).position!=="static"&&a==="absolute"&&(C="scrollHeight",M="scrollWidth")),S=S,s===ln||(s===cn||s===Wn)&&r===Kl){_=zn;var P=d&&S===w&&w.visualViewport?w.visualViewport.height:S[C];m-=P-i.height,m*=l?1:-1}if(s===cn||(s===ln||s===zn)&&r===Kl){x=Wn;var T=d&&S===w&&w.visualViewport?w.visualViewport.width:S[M];f-=T-i.width,f*=l?1:-1}}var A=Object.assign({position:a},c&&GN),E=u===!0?qN({x:f,y:m}):{x:f,y:m};if(f=E.x,m=E.y,l){var z;return Object.assign({},A,(z={},z[_]=g?"0":"",z[x]=y?"0":"",z.transform=(w.devicePixelRatio||1)<=1?"translate("+f+"px, "+m+"px)":"translate3d("+f+"px, "+m+"px, 0)",z))}return Object.assign({},A,(t={},t[_]=g?m+"px":"",t[x]=y?f+"px":"",t.transform="",t))}function QN(e){var t=e.state,n=e.options,i=n.gpuAcceleration,s=i===void 0?!0:i,r=n.adaptive,o=r===void 0?!0:r,a=n.roundOffsets,l=a===void 0?!0:a,c={placement:xi(t.placement),variation:qo(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:s,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,gb(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,gb(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const ZN={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:QN,data:{}};var cu={passive:!0};function JN(e){var t=e.state,n=e.instance,i=e.options,s=i.scroll,r=s===void 0?!0:s,o=i.resize,a=o===void 0?!0:o,l=si(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return r&&c.forEach(function(u){u.addEventListener("scroll",n.update,cu)}),a&&l.addEventListener("resize",n.update,cu),function(){r&&c.forEach(function(u){u.removeEventListener("scroll",n.update,cu)}),a&&l.removeEventListener("resize",n.update,cu)}}const tj={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:JN,data:{}};var ej={left:"right",right:"left",bottom:"top",top:"bottom"};function td(e){return e.replace(/left|right|bottom|top/g,function(t){return ej[t]})}var nj={start:"end",end:"start"};function yb(e){return e.replace(/start|end/g,function(t){return nj[t]})}function Py(e){var t=si(e),n=t.pageXOffset,i=t.pageYOffset;return{scrollLeft:n,scrollTop:i}}function Ty(e){return Go(Js(e)).left+Py(e).scrollLeft}function ij(e){var t=si(e),n=Js(e),i=t.visualViewport,s=n.clientWidth,r=n.clientHeight,o=0,a=0;return i&&(s=i.width,r=i.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(o=i.offsetLeft,a=i.offsetTop)),{width:s,height:r,x:o+Ty(e),y:a}}function sj(e){var t,n=Js(e),i=Py(e),s=(t=e.ownerDocument)==null?void 0:t.body,r=Tr(n.scrollWidth,n.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),o=Tr(n.scrollHeight,n.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-i.scrollLeft+Ty(e),l=-i.scrollTop;return ns(s||n).direction==="rtl"&&(a+=Tr(n.clientWidth,s?s.clientWidth:0)-r),{width:r,height:o,x:a,y:l}}function Dy(e){var t=ns(e),n=t.overflow,i=t.overflowX,s=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+s+i)}function FM(e){return["html","body","#document"].indexOf(ki(e))>=0?e.ownerDocument.body:Fn(e)&&Dy(e)?e:FM(Ah(e))}function gl(e,t){var n;t===void 0&&(t=[]);var i=FM(e),s=i===((n=e.ownerDocument)==null?void 0:n.body),r=si(i),o=s?[r].concat(r.visualViewport||[],Dy(i)?i:[]):i,a=t.concat(o);return s?a:a.concat(gl(Ah(o)))}function Dm(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function rj(e){var t=Go(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}function vb(e,t){return t===RM?Dm(ij(e)):Xo(t)?rj(t):Dm(sj(Js(e)))}function oj(e){var t=gl(Ah(e)),n=["absolute","fixed"].indexOf(ns(e).position)>=0,i=n&&Fn(e)?yc(e):e;return Xo(i)?t.filter(function(s){return Xo(s)&&NM(s,i)&&ki(s)!=="body"}):[]}function aj(e,t,n){var i=t==="clippingParents"?oj(e):[].concat(t),s=[].concat(i,[n]),r=s[0],o=s.reduce(function(a,l){var c=vb(e,l);return a.top=Tr(c.top,a.top),a.right=Vd(c.right,a.right),a.bottom=Vd(c.bottom,a.bottom),a.left=Tr(c.left,a.left),a},vb(e,r));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function BM(e){var t=e.reference,n=e.element,i=e.placement,s=i?xi(i):null,r=i?qo(i):null,o=t.x+t.width/2-n.width/2,a=t.y+t.height/2-n.height/2,l;switch(s){case ln:l={x:o,y:t.y-n.height};break;case zn:l={x:o,y:t.y+t.height};break;case Wn:l={x:t.x+t.width,y:a};break;case cn:l={x:t.x-n.width,y:a};break;default:l={x:t.x,y:t.y}}var c=s?Cy(s):null;if(c!=null){var u=c==="y"?"height":"width";switch(r){case Yo:l[c]=l[c]-(t[u]/2-n[u]/2);break;case Kl:l[c]=l[c]+(t[u]/2-n[u]/2);break}}return l}function Gl(e,t){t===void 0&&(t={});var n=t,i=n.placement,s=i===void 0?e.placement:i,r=n.boundary,o=r===void 0?PN:r,a=n.rootBoundary,l=a===void 0?RM:a,c=n.elementContext,u=c===void 0?Sa:c,d=n.altBoundary,h=d===void 0?!1:d,f=n.padding,p=f===void 0?0:f,m=$M(typeof p!="number"?p:IM(p,gc)),v=u===Sa?TN:Sa,y=e.rects.popper,g=e.elements[h?v:u],x=aj(Xo(g)?g:g.contextElement||Js(e.elements.popper),o,l),_=Go(e.elements.reference),w=BM({reference:_,element:y,strategy:"absolute",placement:s}),S=Dm(Object.assign({},y,w)),C=u===Sa?S:_,M={top:x.top-C.top+m.top,bottom:C.bottom-x.bottom+m.bottom,left:x.left-C.left+m.left,right:C.right-x.right+m.right},P=e.modifiersData.offset;if(u===Sa&&P){var T=P[s];Object.keys(M).forEach(function(A){var E=[Wn,zn].indexOf(A)>=0?1:-1,z=[ln,zn].indexOf(A)>=0?"y":"x";M[A]+=T[z]*E})}return M}function lj(e,t){t===void 0&&(t={});var n=t,i=n.placement,s=n.boundary,r=n.rootBoundary,o=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=l===void 0?LM:l,u=qo(i),d=u?a?pb:pb.filter(function(p){return qo(p)===u}):gc,h=d.filter(function(p){return c.indexOf(p)>=0});h.length===0&&(h=d);var f=h.reduce(function(p,m){return p[m]=Gl(e,{placement:m,boundary:s,rootBoundary:r,padding:o})[xi(m)],p},{});return Object.keys(f).sort(function(p,m){return f[p]-f[m]})}function cj(e){if(xi(e)===ky)return[];var t=td(e);return[yb(e),t,yb(t)]}function uj(e){var t=e.state,n=e.options,i=e.name;if(!t.modifiersData[i]._skip){for(var s=n.mainAxis,r=s===void 0?!0:s,o=n.altAxis,a=o===void 0?!0:o,l=n.fallbackPlacements,c=n.padding,u=n.boundary,d=n.rootBoundary,h=n.altBoundary,f=n.flipVariations,p=f===void 0?!0:f,m=n.allowedAutoPlacements,v=t.options.placement,y=xi(v),g=y===v,x=l||(g||!p?[td(v)]:cj(v)),_=[v].concat(x).reduce(function(Z,O){return Z.concat(xi(O)===ky?lj(t,{placement:O,boundary:u,rootBoundary:d,padding:c,flipVariations:p,allowedAutoPlacements:m}):O)},[]),w=t.rects.reference,S=t.rects.popper,C=new Map,M=!0,P=_[0],T=0;T<_.length;T++){var A=_[T],E=xi(A),z=qo(A)===Yo,N=[ln,zn].indexOf(E)>=0,R=N?"width":"height",L=Gl(t,{placement:A,boundary:u,rootBoundary:d,altBoundary:h,padding:c}),B=N?z?Wn:cn:z?zn:ln;w[R]>S[R]&&(B=td(B));var D=td(B),$=[];if(r&&$.push(L[E]<=0),a&&$.push(L[B]<=0,L[D]<=0),$.every(function(Z){return Z})){P=A,M=!1;break}C.set(A,$)}if(M)for(var F=p?3:1,V=function(O){var U=_.find(function(lt){var ct=C.get(lt);if(ct)return ct.slice(0,O).every(function(kt){return kt})});if(U)return P=U,"break"},W=F;W>0;W--){var et=V(W);if(et==="break")break}t.placement!==P&&(t.modifiersData[i]._skip=!0,t.placement=P,t.reset=!0)}}const VM={name:"flip",enabled:!0,phase:"main",fn:uj,requiresIfExists:["offset"],data:{_skip:!1}};function xb(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function bb(e){return[ln,Wn,zn,cn].some(function(t){return e[t]>=0})}function dj(e){var t=e.state,n=e.name,i=t.rects.reference,s=t.rects.popper,r=t.modifiersData.preventOverflow,o=Gl(t,{elementContext:"reference"}),a=Gl(t,{altBoundary:!0}),l=xb(o,i),c=xb(a,s,r),u=bb(l),d=bb(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}const hj={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:dj};function fj(e,t,n){var i=xi(e),s=[cn,ln].indexOf(i)>=0?-1:1,r=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,o=r[0],a=r[1];return o=o||0,a=(a||0)*s,[cn,Wn].indexOf(i)>=0?{x:a,y:o}:{x:o,y:a}}function pj(e){var t=e.state,n=e.options,i=e.name,s=n.offset,r=s===void 0?[0,0]:s,o=LM.reduce(function(u,d){return u[d]=fj(d,t.rects,r),u},{}),a=o[t.placement],l=a.x,c=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[i]=o}const mj={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:pj};function gj(e){var t=e.state,n=e.name;t.modifiersData[n]=BM({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const yj={name:"popperOffsets",enabled:!0,phase:"read",fn:gj,data:{}};function vj(e){return e==="x"?"y":"x"}function xj(e){var t=e.state,n=e.options,i=e.name,s=n.mainAxis,r=s===void 0?!0:s,o=n.altAxis,a=o===void 0?!1:o,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,d=n.padding,h=n.tether,f=h===void 0?!0:h,p=n.tetherOffset,m=p===void 0?0:p,v=Gl(t,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),y=xi(t.placement),g=qo(t.placement),x=!g,_=Cy(y),w=vj(_),S=t.modifiersData.popperOffsets,C=t.rects.reference,M=t.rects.popper,P=typeof m=="function"?m(Object.assign({},t.rects,{placement:t.placement})):m,T=typeof P=="number"?{mainAxis:P,altAxis:P}:Object.assign({mainAxis:0,altAxis:0},P),A=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,E={x:0,y:0};if(S){if(r){var z,N=_==="y"?ln:cn,R=_==="y"?zn:Wn,L=_==="y"?"height":"width",B=S[_],D=B+v[N],$=B-v[R],F=f?-M[L]/2:0,V=g===Yo?C[L]:M[L],W=g===Yo?-M[L]:-C[L],et=t.elements.arrow,Z=f&&et?My(et):{width:0,height:0},O=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:jM(),U=O[N],lt=O[R],ct=ml(0,C[L],Z[L]),kt=x?C[L]/2-F-ct-U-T.mainAxis:V-ct-U-T.mainAxis,it=x?-C[L]/2+F+ct+lt+T.mainAxis:W+ct+lt+T.mainAxis,Rt=t.elements.arrow&&yc(t.elements.arrow),Ct=Rt?_==="y"?Rt.clientTop||0:Rt.clientLeft||0:0,Qt=(z=A==null?void 0:A[_])!=null?z:0,ft=B+kt-Qt-Ct,wt=B+it-Qt,dt=ml(f?Vd(D,ft):D,B,f?Tr($,wt):$);S[_]=dt,E[_]=dt-B}if(a){var jt,pt=_==="x"?ln:cn,xt=_==="x"?zn:Wn,J=S[w],mt=w==="y"?"height":"width",q=J+v[pt],ye=J-v[xt],Dt=[ln,cn].indexOf(y)!==-1,he=(jt=A==null?void 0:A[w])!=null?jt:0,Un=Dt?q:J-C[mt]-M[mt]-he+T.altAxis,Yn=Dt?J+C[mt]+M[mt]-he-T.altAxis:ye,Mn=f&&Dt?HN(Un,J,Yn):ml(f?Un:q,J,f?Yn:ye);S[w]=Mn,E[w]=Mn-J}t.modifiersData[i]=E}}const bj={name:"preventOverflow",enabled:!0,phase:"main",fn:xj,requiresIfExists:["offset"]};function _j(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function wj(e){return e===si(e)||!Fn(e)?Py(e):_j(e)}function kj(e){var t=e.getBoundingClientRect(),n=Ko(t.width)/e.offsetWidth||1,i=Ko(t.height)/e.offsetHeight||1;return n!==1||i!==1}function Sj(e,t,n){n===void 0&&(n=!1);var i=Fn(t),s=Fn(t)&&kj(t),r=Js(t),o=Go(e,s),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!n)&&((ki(t)!=="body"||Dy(r))&&(a=wj(t)),Fn(t)?(l=Go(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):r&&(l.x=Ty(r))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function Mj(e){var t=new Map,n=new Set,i=[];e.forEach(function(r){t.set(r.name,r)});function s(r){n.add(r.name);var o=[].concat(r.requires||[],r.requiresIfExists||[]);o.forEach(function(a){if(!n.has(a)){var l=t.get(a);l&&s(l)}}),i.push(r)}return e.forEach(function(r){n.has(r.name)||s(r)}),i}function Cj(e){var t=Mj(e);return IN.reduce(function(n,i){return n.concat(t.filter(function(s){return s.phase===i}))},[])}function Pj(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function Tj(e){var t=e.reduce(function(n,i){var s=n[i.name];return n[i.name]=s?Object.assign({},s,i,{options:Object.assign({},s.options,i.options),data:Object.assign({},s.data,i.data)}):i,n},{});return Object.keys(t).map(function(n){return t[n]})}var _b={placement:"bottom",modifiers:[],strategy:"absolute"};function wb(){for(var e=arguments.length,t=new Array(e),n=0;ne,isStatic:!1,reducedMotion:"never"}),Rh=k.createContext({}),Lh=k.createContext(null),Nh=typeof document<"u",Ey=Nh?k.useLayoutEffect:k.useEffect,WM=k.createContext({strict:!1}),Ay=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),Fj="framerAppearId",HM="data-"+Ay(Fj);function Bj(e,t,n,i){const{visualElement:s}=k.useContext(Rh),r=k.useContext(WM),o=k.useContext(Lh),a=k.useContext(zM).reducedMotion,l=k.useRef();i=i||r.renderer,!l.current&&i&&(l.current=i(e,{visualState:t,parent:s,props:n,presenceContext:o,blockInitialAnimation:o?o.initial===!1:!1,reducedMotionConfig:a}));const c=l.current;k.useInsertionEffect(()=>{c&&c.update(n,o)});const u=k.useRef(!!(n[HM]&&!window.HandoffComplete));return Ey(()=>{c&&(c.render(),u.current&&c.animationState&&c.animationState.animateChanges())}),k.useEffect(()=>{c&&(c.updateFeatures(),!u.current&&c.animationState&&c.animationState.animateChanges(),u.current&&(u.current=!1,window.HandoffComplete=!0))}),c}function _o(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Vj(e,t,n){return k.useCallback(i=>{i&&e.mount&&e.mount(i),t&&(i?t.mount(i):t.unmount()),n&&(typeof n=="function"?n(i):_o(n)&&(n.current=i))},[t])}function ql(e){return typeof e=="string"||Array.isArray(e)}function jh(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const Oy=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ry=["initial",...Oy];function $h(e){return jh(e.animate)||Ry.some(t=>ql(e[t]))}function UM(e){return!!($h(e)||e.variants)}function zj(e,t){if($h(e)){const{initial:n,animate:i}=e;return{initial:n===!1||ql(n)?n:void 0,animate:ql(i)?i:void 0}}return e.inherit!==!1?t:{}}function Wj(e){const{initial:t,animate:n}=zj(e,k.useContext(Rh));return k.useMemo(()=>({initial:t,animate:n}),[kb(t),kb(n)])}function kb(e){return Array.isArray(e)?e.join(" "):e}const Sb={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Ql={};for(const e in Sb)Ql[e]={isEnabled:t=>Sb[e].some(n=>!!t[n])};function Hj(e){for(const t in e)Ql[t]={...Ql[t],...e[t]}}const Ly=k.createContext({}),YM=k.createContext({}),Uj=Symbol.for("motionComponentSymbol");function Yj({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:i,Component:s}){e&&Hj(e);function r(a,l){let c;const u={...k.useContext(zM),...a,layoutId:Xj(a)},{isStatic:d}=u,h=Wj(a),f=i(a,d);if(!d&&Nh){h.visualElement=Bj(s,f,u,t);const p=k.useContext(YM),m=k.useContext(WM).strict;h.visualElement&&(c=h.visualElement.loadFeatures(u,m,e,p))}return k.createElement(Rh.Provider,{value:h},c&&h.visualElement?k.createElement(c,{visualElement:h.visualElement,...u}):null,n(s,a,Vj(f,h.visualElement,l),f,d,h.visualElement))}const o=k.forwardRef(r);return o[Uj]=s,o}function Xj({layoutId:e}){const t=k.useContext(Ly).id;return t&&e!==void 0?t+"-"+e:e}function Kj(e){function t(i,s={}){return Yj(e(i,s))}if(typeof Proxy>"u")return t;const n=new Map;return new Proxy(t,{get:(i,s)=>(n.has(s)||n.set(s,t(s)),n.get(s))})}const Gj=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Ny(e){return typeof e!="string"||e.includes("-")?!1:!!(Gj.indexOf(e)>-1||/[A-Z]/.test(e))}const zd={};function qj(e){Object.assign(zd,e)}const vc=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ur=new Set(vc);function XM(e,{layout:t,layoutId:n}){return Ur.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!zd[e]||e==="opacity")}const un=e=>!!(e&&e.getVelocity),Qj={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Zj=vc.length;function Jj(e,{enableHardwareAcceleration:t=!0,allowTransformNone:n=!0},i,s){let r="";for(let o=0;ot=>typeof t=="string"&&t.startsWith(e),GM=KM("--"),Em=KM("var(--"),t$=/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,e$=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Hs=(e,t,n)=>Math.min(Math.max(n,e),t),Yr={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},yl={...Yr,transform:e=>Hs(0,1,e)},uu={...Yr,default:1},vl=e=>Math.round(e*1e5)/1e5,Ih=/(-)?([\d]*\.?[\d])+/g,qM=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,n$=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function xc(e){return typeof e=="string"}const bc=e=>({test:t=>xc(t)&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),ps=bc("deg"),bi=bc("%"),st=bc("px"),i$=bc("vh"),s$=bc("vw"),Mb={...bi,parse:e=>bi.parse(e)/100,transform:e=>bi.transform(e*100)},Cb={...Yr,transform:Math.round},QM={borderWidth:st,borderTopWidth:st,borderRightWidth:st,borderBottomWidth:st,borderLeftWidth:st,borderRadius:st,radius:st,borderTopLeftRadius:st,borderTopRightRadius:st,borderBottomRightRadius:st,borderBottomLeftRadius:st,width:st,maxWidth:st,height:st,maxHeight:st,size:st,top:st,right:st,bottom:st,left:st,padding:st,paddingTop:st,paddingRight:st,paddingBottom:st,paddingLeft:st,margin:st,marginTop:st,marginRight:st,marginBottom:st,marginLeft:st,rotate:ps,rotateX:ps,rotateY:ps,rotateZ:ps,scale:uu,scaleX:uu,scaleY:uu,scaleZ:uu,skew:ps,skewX:ps,skewY:ps,distance:st,translateX:st,translateY:st,translateZ:st,x:st,y:st,z:st,perspective:st,transformPerspective:st,opacity:yl,originX:Mb,originY:Mb,originZ:st,zIndex:Cb,fillOpacity:yl,strokeOpacity:yl,numOctaves:Cb};function jy(e,t,n,i){const{style:s,vars:r,transform:o,transformOrigin:a}=e;let l=!1,c=!1,u=!0;for(const d in t){const h=t[d];if(GM(d)){r[d]=h;continue}const f=QM[d],p=e$(h,f);if(Ur.has(d)){if(l=!0,o[d]=p,!u)continue;h!==(f.default||0)&&(u=!1)}else d.startsWith("origin")?(c=!0,a[d]=p):s[d]=p}if(t.transform||(l||i?s.transform=Jj(e.transform,n,u,i):s.transform&&(s.transform="none")),c){const{originX:d="50%",originY:h="50%",originZ:f=0}=a;s.transformOrigin=`${d} ${h} ${f}`}}const $y=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function ZM(e,t,n){for(const i in t)!un(t[i])&&!XM(i,n)&&(e[i]=t[i])}function r$({transformTemplate:e},t,n){return k.useMemo(()=>{const i=$y();return jy(i,t,{enableHardwareAcceleration:!n},e),Object.assign({},i.vars,i.style)},[t])}function o$(e,t,n){const i=e.style||{},s={};return ZM(s,i,e),Object.assign(s,r$(e,t,n)),e.transformValues?e.transformValues(s):s}function a$(e,t,n){const i={},s=o$(e,t,n);return e.drag&&e.dragListener!==!1&&(i.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(i.tabIndex=0),i.style=s,i}const l$=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Wd(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||l$.has(e)}let JM=e=>!Wd(e);function c$(e){e&&(JM=t=>t.startsWith("on")?!Wd(t):e(t))}try{c$(require("@emotion/is-prop-valid").default)}catch{}function u$(e,t,n){const i={};for(const s in e)s==="values"&&typeof e.values=="object"||(JM(s)||n===!0&&Wd(s)||!t&&!Wd(s)||e.draggable&&s.startsWith("onDrag"))&&(i[s]=e[s]);return i}function Pb(e,t,n){return typeof e=="string"?e:st.transform(t+n*e)}function d$(e,t,n){const i=Pb(t,e.x,e.width),s=Pb(n,e.y,e.height);return`${i} ${s}`}const h$={offset:"stroke-dashoffset",array:"stroke-dasharray"},f$={offset:"strokeDashoffset",array:"strokeDasharray"};function p$(e,t,n=1,i=0,s=!0){e.pathLength=1;const r=s?h$:f$;e[r.offset]=st.transform(-i);const o=st.transform(t),a=st.transform(n);e[r.array]=`${o} ${a}`}function Iy(e,{attrX:t,attrY:n,attrScale:i,originX:s,originY:r,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...c},u,d,h){if(jy(e,c,u,h),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:p,dimensions:m}=e;f.transform&&(m&&(p.transform=f.transform),delete f.transform),m&&(s!==void 0||r!==void 0||p.transform)&&(p.transformOrigin=d$(m,s!==void 0?s:.5,r!==void 0?r:.5)),t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),i!==void 0&&(f.scale=i),o!==void 0&&p$(f,o,a,l,!1)}const tC=()=>({...$y(),attrs:{}}),Fy=e=>typeof e=="string"&&e.toLowerCase()==="svg";function m$(e,t,n,i){const s=k.useMemo(()=>{const r=tC();return Iy(r,t,{enableHardwareAcceleration:!1},Fy(i),e.transformTemplate),{...r.attrs,style:{...r.style}}},[t]);if(e.style){const r={};ZM(r,e.style,e),s.style={...r,...s.style}}return s}function g$(e=!1){return(n,i,s,{latestValues:r},o)=>{const l=(Ny(n)?m$:a$)(i,r,o,n),u={...u$(i,typeof n=="string",e),...l,ref:s},{children:d}=i,h=k.useMemo(()=>un(d)?d.get():d,[d]);return k.createElement(n,{...u,children:h})}}function eC(e,{style:t,vars:n},i,s){Object.assign(e.style,t,s&&s.getProjectionStyles(i));for(const r in n)e.style.setProperty(r,n[r])}const nC=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function iC(e,t,n,i){eC(e,t,void 0,i);for(const s in t.attrs)e.setAttribute(nC.has(s)?s:Ay(s),t.attrs[s])}function By(e,t){const{style:n}=e,i={};for(const s in n)(un(n[s])||t.style&&un(t.style[s])||XM(s,e))&&(i[s]=n[s]);return i}function sC(e,t){const n=By(e,t);for(const i in e)if(un(e[i])||un(t[i])){const s=vc.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;n[s]=e[i]}return n}function Vy(e,t,n,i={},s={}){return typeof t=="function"&&(t=t(n!==void 0?n:e.custom,i,s)),typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"&&(t=t(n!==void 0?n:e.custom,i,s)),t}function rC(e){const t=k.useRef(null);return t.current===null&&(t.current=e()),t.current}const Hd=e=>Array.isArray(e),y$=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),v$=e=>Hd(e)?e[e.length-1]||0:e;function nd(e){const t=un(e)?e.get():e;return y$(t)?t.toValue():t}function x$({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},i,s,r){const o={latestValues:b$(i,s,r,e),renderState:t()};return n&&(o.mount=a=>n(i,a,o)),o}const oC=e=>(t,n)=>{const i=k.useContext(Rh),s=k.useContext(Lh),r=()=>x$(e,t,i,s);return n?r():rC(r)};function b$(e,t,n,i){const s={},r=i(e,{});for(const h in r)s[h]=nd(r[h]);let{initial:o,animate:a}=e;const l=$h(e),c=UM(e);t&&c&&!l&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||o===!1;const d=u?a:o;return d&&typeof d!="boolean"&&!jh(d)&&(Array.isArray(d)?d:[d]).forEach(f=>{const p=Vy(e,f);if(!p)return;const{transitionEnd:m,transition:v,...y}=p;for(const g in y){let x=y[g];if(Array.isArray(x)){const _=u?x.length-1:0;x=x[_]}x!==null&&(s[g]=x)}for(const g in m)s[g]=m[g]}),s}const ce=e=>e;class Tb{constructor(){this.order=[],this.scheduled=new Set}add(t){if(!this.scheduled.has(t))return this.scheduled.add(t),this.order.push(t),!0}remove(t){const n=this.order.indexOf(t);n!==-1&&(this.order.splice(n,1),this.scheduled.delete(t))}clear(){this.order.length=0,this.scheduled.clear()}}function _$(e){let t=new Tb,n=new Tb,i=0,s=!1,r=!1;const o=new WeakSet,a={schedule:(l,c=!1,u=!1)=>{const d=u&&s,h=d?t:n;return c&&o.add(l),h.add(l)&&d&&s&&(i=t.order.length),l},cancel:l=>{n.remove(l),o.delete(l)},process:l=>{if(s){r=!0;return}if(s=!0,[t,n]=[n,t],n.clear(),i=t.order.length,i)for(let c=0;c(d[h]=_$(()=>n=!0),d),{}),o=d=>r[d].process(s),a=()=>{const d=performance.now();n=!1,s.delta=i?1e3/60:Math.max(Math.min(d-s.timestamp,w$),1),s.timestamp=d,s.isProcessing=!0,du.forEach(o),s.isProcessing=!1,n&&t&&(i=!1,e(a))},l=()=>{n=!0,i=!0,s.isProcessing||e(a)};return{schedule:du.reduce((d,h)=>{const f=r[h];return d[h]=(p,m=!1,v=!1)=>(n||l(),f.schedule(p,m,v)),d},{}),cancel:d=>du.forEach(h=>r[h].cancel(d)),state:s,steps:r}}const{schedule:zt,cancel:is,state:je,steps:Uf}=k$(typeof requestAnimationFrame<"u"?requestAnimationFrame:ce,!0),S$={useVisualState:oC({scrapeMotionValuesFromProps:sC,createRenderState:tC,onMount:(e,t,{renderState:n,latestValues:i})=>{zt.read(()=>{try{n.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}}),zt.render(()=>{Iy(n,i,{enableHardwareAcceleration:!1},Fy(t.tagName),e.transformTemplate),iC(t,n)})}})},M$={useVisualState:oC({scrapeMotionValuesFromProps:By,createRenderState:$y})};function C$(e,{forwardMotionProps:t=!1},n,i){return{...Ny(e)?S$:M$,preloadedFeatures:n,useRender:g$(t),createVisualElement:i,Component:e}}function Hi(e,t,n,i={passive:!0}){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n)}const aC=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function Fh(e,t="page"){return{point:{x:e[t+"X"],y:e[t+"Y"]}}}const P$=e=>t=>aC(t)&&e(t,Fh(t));function qi(e,t,n,i){return Hi(e,t,P$(n),i)}const T$=(e,t)=>n=>t(e(n)),Is=(...e)=>e.reduce(T$);function lC(e){let t=null;return()=>{const n=()=>{t=null};return t===null?(t=e,n):!1}}const Db=lC("dragHorizontal"),Eb=lC("dragVertical");function cC(e){let t=!1;if(e==="y")t=Eb();else if(e==="x")t=Db();else{const n=Db(),i=Eb();n&&i?t=()=>{n(),i()}:(n&&n(),i&&i())}return t}function uC(){const e=cC(!0);return e?(e(),!1):!0}class tr{constructor(t){this.isMounted=!1,this.node=t}update(){}}function Ab(e,t){const n="pointer"+(t?"enter":"leave"),i="onHover"+(t?"Start":"End"),s=(r,o)=>{if(r.pointerType==="touch"||uC())return;const a=e.getProps();e.animationState&&a.whileHover&&e.animationState.setActive("whileHover",t),a[i]&&zt.update(()=>a[i](r,o))};return qi(e.current,n,s,{passive:!e.getProps()[i]})}class D$ extends tr{mount(){this.unmount=Is(Ab(this.node,!0),Ab(this.node,!1))}unmount(){}}class E$ extends tr{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Is(Hi(this.node.current,"focus",()=>this.onFocus()),Hi(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const dC=(e,t)=>t?e===t?!0:dC(e,t.parentElement):!1;function Yf(e,t){if(!t)return;const n=new PointerEvent("pointer"+e);t(n,Fh(n))}class A$ extends tr{constructor(){super(...arguments),this.removeStartListeners=ce,this.removeEndListeners=ce,this.removeAccessibleListeners=ce,this.startPointerPress=(t,n)=>{if(this.isPressing)return;this.removeEndListeners();const i=this.node.getProps(),r=qi(window,"pointerup",(a,l)=>{if(!this.checkPressEnd())return;const{onTap:c,onTapCancel:u,globalTapTarget:d}=this.node.getProps();zt.update(()=>{!d&&!dC(this.node.current,a.target)?u&&u(a,l):c&&c(a,l)})},{passive:!(i.onTap||i.onPointerUp)}),o=qi(window,"pointercancel",(a,l)=>this.cancelPress(a,l),{passive:!(i.onTapCancel||i.onPointerCancel)});this.removeEndListeners=Is(r,o),this.startPress(t,n)},this.startAccessiblePress=()=>{const t=r=>{if(r.key!=="Enter"||this.isPressing)return;const o=a=>{a.key!=="Enter"||!this.checkPressEnd()||Yf("up",(l,c)=>{const{onTap:u}=this.node.getProps();u&&zt.update(()=>u(l,c))})};this.removeEndListeners(),this.removeEndListeners=Hi(this.node.current,"keyup",o),Yf("down",(a,l)=>{this.startPress(a,l)})},n=Hi(this.node.current,"keydown",t),i=()=>{this.isPressing&&Yf("cancel",(r,o)=>this.cancelPress(r,o))},s=Hi(this.node.current,"blur",i);this.removeAccessibleListeners=Is(n,s)}}startPress(t,n){this.isPressing=!0;const{onTapStart:i,whileTap:s}=this.node.getProps();s&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),i&&zt.update(()=>i(t,n))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!uC()}cancelPress(t,n){if(!this.checkPressEnd())return;const{onTapCancel:i}=this.node.getProps();i&&zt.update(()=>i(t,n))}mount(){const t=this.node.getProps(),n=qi(t.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),i=Hi(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=Is(n,i)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const Am=new WeakMap,Xf=new WeakMap,O$=e=>{const t=Am.get(e.target);t&&t(e)},R$=e=>{e.forEach(O$)};function L$({root:e,...t}){const n=e||document;Xf.has(n)||Xf.set(n,{});const i=Xf.get(n),s=JSON.stringify(t);return i[s]||(i[s]=new IntersectionObserver(R$,{root:e,...t})),i[s]}function N$(e,t,n){const i=L$(t);return Am.set(e,n),i.observe(e),()=>{Am.delete(e),i.unobserve(e)}}const j$={some:0,all:1};class $$ extends tr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:i,amount:s="some",once:r}=t,o={root:n?n.current:void 0,rootMargin:i,threshold:typeof s=="number"?s:j$[s]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,r&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:d}=this.node.getProps(),h=c?u:d;h&&h(l)};return N$(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(I$(t,n))&&this.startObserver()}unmount(){}}function I$({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const F$={inView:{Feature:$$},tap:{Feature:A$},focus:{Feature:E$},hover:{Feature:D$}};function hC(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let i=0;it[i]=n.get()),t}function V$(e){const t={};return e.values.forEach((n,i)=>t[i]=n.getVelocity()),t}function Bh(e,t,n){const i=e.getProps();return Vy(i,t,n!==void 0?n:i.custom,B$(e),V$(e))}let zy=ce;const Dr=e=>e*1e3,Qi=e=>e/1e3,z$={current:!1},fC=e=>Array.isArray(e)&&typeof e[0]=="number";function pC(e){return!!(!e||typeof e=="string"&&mC[e]||fC(e)||Array.isArray(e)&&e.every(pC))}const Qa=([e,t,n,i])=>`cubic-bezier(${e}, ${t}, ${n}, ${i})`,mC={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Qa([0,.65,.55,1]),circOut:Qa([.55,0,1,.45]),backIn:Qa([.31,.01,.66,-.59]),backOut:Qa([.33,1.53,.69,.99])};function gC(e){if(e)return fC(e)?Qa(e):Array.isArray(e)?e.map(gC):mC[e]}function W$(e,t,n,{delay:i=0,duration:s,repeat:r=0,repeatType:o="loop",ease:a,times:l}={}){const c={[t]:n};l&&(c.offset=l);const u=gC(a);return Array.isArray(u)&&(c.easing=u),e.animate(c,{delay:i,duration:s,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:r+1,direction:o==="reverse"?"alternate":"normal"})}function H$(e,{repeat:t,repeatType:n="loop"}){const i=t&&n!=="loop"&&t%2===1?0:e.length-1;return e[i]}const yC=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,U$=1e-7,Y$=12;function X$(e,t,n,i,s){let r,o,a=0;do o=t+(n-t)/2,r=yC(o,i,s)-e,r>0?n=o:t=o;while(Math.abs(r)>U$&&++aX$(r,0,1,e,n);return r=>r===0||r===1?r:yC(s(r),t,i)}const K$=_c(.42,0,1,1),G$=_c(0,0,.58,1),vC=_c(.42,0,.58,1),q$=e=>Array.isArray(e)&&typeof e[0]!="number",xC=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,bC=e=>t=>1-e(1-t),Wy=e=>1-Math.sin(Math.acos(e)),_C=bC(Wy),Q$=xC(Wy),wC=_c(.33,1.53,.69,.99),Hy=bC(wC),Z$=xC(Hy),J$=e=>(e*=2)<1?.5*Hy(e):.5*(2-Math.pow(2,-10*(e-1))),tI={linear:ce,easeIn:K$,easeInOut:vC,easeOut:G$,circIn:Wy,circInOut:Q$,circOut:_C,backIn:Hy,backInOut:Z$,backOut:wC,anticipate:J$},Ob=e=>{if(Array.isArray(e)){zy(e.length===4);const[t,n,i,s]=e;return _c(t,n,i,s)}else if(typeof e=="string")return tI[e];return e},Uy=(e,t)=>n=>!!(xc(n)&&n$.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),kC=(e,t,n)=>i=>{if(!xc(i))return i;const[s,r,o,a]=i.match(Ih);return{[e]:parseFloat(s),[t]:parseFloat(r),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},eI=e=>Hs(0,255,e),Kf={...Yr,transform:e=>Math.round(eI(e))},kr={test:Uy("rgb","red"),parse:kC("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:i=1})=>"rgba("+Kf.transform(e)+", "+Kf.transform(t)+", "+Kf.transform(n)+", "+vl(yl.transform(i))+")"};function nI(e){let t="",n="",i="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),i=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),i=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,i+=i,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}}const Om={test:Uy("#"),parse:nI,transform:kr.transform},wo={test:Uy("hsl","hue"),parse:kC("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:i=1})=>"hsla("+Math.round(e)+", "+bi.transform(vl(t))+", "+bi.transform(vl(n))+", "+vl(yl.transform(i))+")"},We={test:e=>kr.test(e)||Om.test(e)||wo.test(e),parse:e=>kr.test(e)?kr.parse(e):wo.test(e)?wo.parse(e):Om.parse(e),transform:e=>xc(e)?e:e.hasOwnProperty("red")?kr.transform(e):wo.transform(e)},ee=(e,t,n)=>-n*e+n*t+e;function Gf(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function iI({hue:e,saturation:t,lightness:n,alpha:i}){e/=360,t/=100,n/=100;let s=0,r=0,o=0;if(!t)s=r=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;s=Gf(l,a,e+1/3),r=Gf(l,a,e),o=Gf(l,a,e-1/3)}return{red:Math.round(s*255),green:Math.round(r*255),blue:Math.round(o*255),alpha:i}}const qf=(e,t,n)=>{const i=e*e;return Math.sqrt(Math.max(0,n*(t*t-i)+i))},sI=[Om,kr,wo],rI=e=>sI.find(t=>t.test(e));function Rb(e){const t=rI(e);let n=t.parse(e);return t===wo&&(n=iI(n)),n}const SC=(e,t)=>{const n=Rb(e),i=Rb(t),s={...n};return r=>(s.red=qf(n.red,i.red,r),s.green=qf(n.green,i.green,r),s.blue=qf(n.blue,i.blue,r),s.alpha=ee(n.alpha,i.alpha,r),kr.transform(s))};function oI(e){var t,n;return isNaN(e)&&xc(e)&&(((t=e.match(Ih))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(qM))===null||n===void 0?void 0:n.length)||0)>0}const MC={regex:t$,countKey:"Vars",token:"${v}",parse:ce},CC={regex:qM,countKey:"Colors",token:"${c}",parse:We.parse},PC={regex:Ih,countKey:"Numbers",token:"${n}",parse:Yr.parse};function Qf(e,{regex:t,countKey:n,token:i,parse:s}){const r=e.tokenised.match(t);r&&(e["num"+n]=r.length,e.tokenised=e.tokenised.replace(t,i),e.values.push(...r.map(s)))}function Ud(e){const t=e.toString(),n={value:t,tokenised:t,values:[],numVars:0,numColors:0,numNumbers:0};return n.value.includes("var(--")&&Qf(n,MC),Qf(n,CC),Qf(n,PC),n}function TC(e){return Ud(e).values}function DC(e){const{values:t,numColors:n,numVars:i,tokenised:s}=Ud(e),r=t.length;return o=>{let a=s;for(let l=0;ltypeof e=="number"?0:e;function lI(e){const t=TC(e);return DC(e)(t.map(aI))}const Us={test:oI,parse:TC,createTransformer:DC,getAnimatableNone:lI},EC=(e,t)=>n=>`${n>0?t:e}`;function AC(e,t){return typeof e=="number"?n=>ee(e,t,n):We.test(e)?SC(e,t):e.startsWith("var(")?EC(e,t):RC(e,t)}const OC=(e,t)=>{const n=[...e],i=n.length,s=e.map((r,o)=>AC(r,t[o]));return r=>{for(let o=0;o{const n={...e,...t},i={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(i[s]=AC(e[s],t[s]));return s=>{for(const r in i)n[r]=i[r](s);return n}},RC=(e,t)=>{const n=Us.createTransformer(t),i=Ud(e),s=Ud(t);return i.numVars===s.numVars&&i.numColors===s.numColors&&i.numNumbers>=s.numNumbers?Is(OC(i.values,s.values),n):EC(e,t)},Zl=(e,t,n)=>{const i=t-e;return i===0?1:(n-e)/i},Lb=(e,t)=>n=>ee(e,t,n);function uI(e){return typeof e=="number"?Lb:typeof e=="string"?We.test(e)?SC:RC:Array.isArray(e)?OC:typeof e=="object"?cI:Lb}function dI(e,t,n){const i=[],s=n||uI(e[0]),r=e.length-1;for(let o=0;ot[0];e[0]>e[r-1]&&(e=[...e].reverse(),t=[...t].reverse());const o=dI(t,i,s),a=o.length,l=c=>{let u=0;if(a>1)for(;ul(Hs(e[0],e[r-1],c)):l}function hI(e,t){const n=e[e.length-1];for(let i=1;i<=t;i++){const s=Zl(0,t,i);e.push(ee(n,1,s))}}function fI(e){const t=[0];return hI(t,e.length-1),t}function pI(e,t){return e.map(n=>n*t)}function mI(e,t){return e.map(()=>t||vC).splice(0,e.length-1)}function Yd({duration:e=300,keyframes:t,times:n,ease:i="easeInOut"}){const s=q$(i)?i.map(Ob):Ob(i),r={done:!1,value:t[0]},o=pI(n&&n.length===t.length?n:fI(t),e),a=LC(o,t,{ease:Array.isArray(s)?s:mI(t,s)});return{calculatedDuration:e,next:l=>(r.value=a(l),r.done=l>=e,r)}}function NC(e,t){return t?e*(1e3/t):0}const gI=5;function jC(e,t,n){const i=Math.max(t-gI,0);return NC(n-e(i),t-i)}const Zf=.001,yI=.01,vI=10,xI=.05,bI=1;function _I({duration:e=800,bounce:t=.25,velocity:n=0,mass:i=1}){let s,r,o=1-t;o=Hs(xI,bI,o),e=Hs(yI,vI,Qi(e)),o<1?(s=c=>{const u=c*o,d=u*e,h=u-n,f=Rm(c,o),p=Math.exp(-d);return Zf-h/f*p},r=c=>{const d=c*o*e,h=d*n+n,f=Math.pow(o,2)*Math.pow(c,2)*e,p=Math.exp(-d),m=Rm(Math.pow(c,2),o);return(-s(c)+Zf>0?-1:1)*((h-f)*p)/m}):(s=c=>{const u=Math.exp(-c*e),d=(c-n)*e+1;return-Zf+u*d},r=c=>{const u=Math.exp(-c*e),d=(n-c)*(e*e);return u*d});const a=5/e,l=kI(s,r,a);if(e=Dr(e),isNaN(l))return{stiffness:100,damping:10,duration:e};{const c=Math.pow(l,2)*i;return{stiffness:c,damping:o*2*Math.sqrt(i*c),duration:e}}}const wI=12;function kI(e,t,n){let i=n;for(let s=1;se[n]!==void 0)}function CI(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!Nb(e,MI)&&Nb(e,SI)){const n=_I(e);t={...t,...n,mass:1},t.isResolvedFromDuration=!0}return t}function $C({keyframes:e,restDelta:t,restSpeed:n,...i}){const s=e[0],r=e[e.length-1],o={done:!1,value:s},{stiffness:a,damping:l,mass:c,duration:u,velocity:d,isResolvedFromDuration:h}=CI({...i,velocity:-Qi(i.velocity||0)}),f=d||0,p=l/(2*Math.sqrt(a*c)),m=r-s,v=Qi(Math.sqrt(a/c)),y=Math.abs(m)<5;n||(n=y?.01:2),t||(t=y?.005:.5);let g;if(p<1){const x=Rm(v,p);g=_=>{const w=Math.exp(-p*v*_);return r-w*((f+p*v*m)/x*Math.sin(x*_)+m*Math.cos(x*_))}}else if(p===1)g=x=>r-Math.exp(-v*x)*(m+(f+v*m)*x);else{const x=v*Math.sqrt(p*p-1);g=_=>{const w=Math.exp(-p*v*_),S=Math.min(x*_,300);return r-w*((f+p*v*m)*Math.sinh(S)+x*m*Math.cosh(S))/x}}return{calculatedDuration:h&&u||null,next:x=>{const _=g(x);if(h)o.done=x>=u;else{let w=f;x!==0&&(p<1?w=jC(g,x,_):w=0);const S=Math.abs(w)<=n,C=Math.abs(r-_)<=t;o.done=S&&C}return o.value=o.done?r:_,o}}}function jb({keyframes:e,velocity:t=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:u}){const d=e[0],h={done:!1,value:d},f=M=>a!==void 0&&Ml,p=M=>a===void 0?l:l===void 0||Math.abs(a-M)-m*Math.exp(-M/i),x=M=>y+g(M),_=M=>{const P=g(M),T=x(M);h.done=Math.abs(P)<=c,h.value=h.done?y:T};let w,S;const C=M=>{f(h.value)&&(w=M,S=$C({keyframes:[h.value,p(h.value)],velocity:jC(x,M,h.value),damping:s,stiffness:r,restDelta:c,restSpeed:u}))};return C(0),{calculatedDuration:null,next:M=>{let P=!1;return!S&&w===void 0&&(P=!0,_(M),C(M)),w!==void 0&&M>w?S.next(M-w):(!P&&_(M),h)}}}const PI=e=>{const t=({timestamp:n})=>e(n);return{start:()=>zt.update(t,!0),stop:()=>is(t),now:()=>je.isProcessing?je.timestamp:performance.now()}},$b=2e4;function Ib(e){let t=0;const n=50;let i=e.next(t);for(;!i.done&&t<$b;)t+=n,i=e.next(t);return t>=$b?1/0:t}const TI={decay:jb,inertia:jb,tween:Yd,keyframes:Yd,spring:$C};function Xd({autoplay:e=!0,delay:t=0,driver:n=PI,keyframes:i,type:s="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:a="loop",onPlay:l,onStop:c,onComplete:u,onUpdate:d,...h}){let f=1,p=!1,m,v;const y=()=>{v=new Promise(V=>{m=V})};y();let g;const x=TI[s]||Yd;let _;x!==Yd&&typeof i[0]!="number"&&(_=LC([0,100],i,{clamp:!1}),i=[0,100]);const w=x({...h,keyframes:i});let S;a==="mirror"&&(S=x({...h,keyframes:[...i].reverse(),velocity:-(h.velocity||0)}));let C="idle",M=null,P=null,T=null;w.calculatedDuration===null&&r&&(w.calculatedDuration=Ib(w));const{calculatedDuration:A}=w;let E=1/0,z=1/0;A!==null&&(E=A+o,z=E*(r+1)-o);let N=0;const R=V=>{if(P===null)return;f>0&&(P=Math.min(P,V)),f<0&&(P=Math.min(V-z/f,P)),M!==null?N=M:N=Math.round(V-P)*f;const W=N-t*(f>=0?1:-1),et=f>=0?W<0:W>z;N=Math.max(W,0),C==="finished"&&M===null&&(N=z);let Z=N,O=w;if(r){const kt=Math.min(N,z)/E;let it=Math.floor(kt),Rt=kt%1;!Rt&&kt>=1&&(Rt=1),Rt===1&&it--,it=Math.min(it,r+1),!!(it%2)&&(a==="reverse"?(Rt=1-Rt,o&&(Rt-=o/E)):a==="mirror"&&(O=S)),Z=Hs(0,1,Rt)*E}const U=et?{done:!1,value:i[0]}:O.next(Z);_&&(U.value=_(U.value));let{done:lt}=U;!et&&A!==null&&(lt=f>=0?N>=z:N<=0);const ct=M===null&&(C==="finished"||C==="running"&<);return d&&d(U.value),ct&&D(),U},L=()=>{g&&g.stop(),g=void 0},B=()=>{C="idle",L(),m(),y(),P=T=null},D=()=>{C="finished",u&&u(),L(),m()},$=()=>{if(p)return;g||(g=n(R));const V=g.now();l&&l(),M!==null?P=V-M:(!P||C==="finished")&&(P=V),C==="finished"&&y(),T=P,M=null,C="running",g.start()};e&&$();const F={then(V,W){return v.then(V,W)},get time(){return Qi(N)},set time(V){V=Dr(V),N=V,M!==null||!g||f===0?M=V:P=g.now()-V/f},get duration(){const V=w.calculatedDuration===null?Ib(w):w.calculatedDuration;return Qi(V)},get speed(){return f},set speed(V){V===f||!g||(f=V,F.time=Qi(N))},get state(){return C},play:$,pause:()=>{C="paused",M=N},stop:()=>{p=!0,C!=="idle"&&(C="idle",c&&c(),B())},cancel:()=>{T!==null&&R(T),B()},complete:()=>{C="finished"},sample:V=>(P=0,R(V))};return F}function DI(e){let t;return()=>(t===void 0&&(t=e()),t)}const EI=DI(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),AI=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),hu=10,OI=2e4,RI=(e,t)=>t.type==="spring"||e==="backgroundColor"||!pC(t.ease);function LI(e,t,{onUpdate:n,onComplete:i,...s}){if(!(EI()&&AI.has(t)&&!s.repeatDelay&&s.repeatType!=="mirror"&&s.damping!==0&&s.type!=="inertia"))return!1;let o=!1,a,l,c=!1;const u=()=>{l=new Promise(x=>{a=x})};u();let{keyframes:d,duration:h=300,ease:f,times:p}=s;if(RI(t,s)){const x=Xd({...s,repeat:0,delay:0});let _={done:!1,value:d[0]};const w=[];let S=0;for(;!_.done&&S{c=!1,m.cancel()},y=()=>{c=!0,zt.update(v),a(),u()};return m.onfinish=()=>{c||(e.set(H$(d,s)),i&&i(),y())},{then(x,_){return l.then(x,_)},attachTimeline(x){return m.timeline=x,m.onfinish=null,ce},get time(){return Qi(m.currentTime||0)},set time(x){m.currentTime=Dr(x)},get speed(){return m.playbackRate},set speed(x){m.playbackRate=x},get duration(){return Qi(h)},play:()=>{o||(m.play(),is(v))},pause:()=>m.pause(),stop:()=>{if(o=!0,m.playState==="idle")return;const{currentTime:x}=m;if(x){const _=Xd({...s,autoplay:!1});e.setWithVelocity(_.sample(x-hu).value,_.sample(x).value,hu)}y()},complete:()=>{c||m.finish()},cancel:y}}function NI({keyframes:e,delay:t,onUpdate:n,onComplete:i}){const s=()=>(n&&n(e[e.length-1]),i&&i(),{time:0,speed:1,duration:0,play:ce,pause:ce,stop:ce,then:r=>(r(),Promise.resolve()),cancel:ce,complete:ce});return t?Xd({keyframes:[0,1],duration:0,delay:t,onComplete:s}):s()}const jI={type:"spring",stiffness:500,damping:25,restSpeed:10},$I=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),II={type:"keyframes",duration:.8},FI={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},BI=(e,{keyframes:t})=>t.length>2?II:Ur.has(e)?e.startsWith("scale")?$I(t[1]):jI:FI,Lm=(e,t)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Us.test(t)||t==="0")&&!t.startsWith("url(")),VI=new Set(["brightness","contrast","saturate","opacity"]);function zI(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[i]=n.match(Ih)||[];if(!i)return e;const s=n.replace(i,"");let r=VI.has(t)?1:0;return i!==n&&(r*=100),t+"("+r+s+")"}const WI=/([a-z-]*)\(.*?\)/g,Nm={...Us,getAnimatableNone:e=>{const t=e.match(WI);return t?t.map(zI).join(" "):e}},HI={...QM,color:We,backgroundColor:We,outlineColor:We,fill:We,stroke:We,borderColor:We,borderTopColor:We,borderRightColor:We,borderBottomColor:We,borderLeftColor:We,filter:Nm,WebkitFilter:Nm},Yy=e=>HI[e];function IC(e,t){let n=Yy(e);return n!==Nm&&(n=Us),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const FC=e=>/^0[^.\s]+$/.test(e);function UI(e){if(typeof e=="number")return e===0;if(e!==null)return e==="none"||e==="0"||FC(e)}function YI(e,t,n,i){const s=Lm(t,n);let r;Array.isArray(n)?r=[...n]:r=[null,n];const o=i.from!==void 0?i.from:e.get();let a;const l=[];for(let c=0;cs=>{const r=Xy(i,e)||{},o=r.delay||i.delay||0;let{elapsed:a=0}=i;a=a-Dr(o);const l=YI(t,e,n,r),c=l[0],u=l[l.length-1],d=Lm(e,c),h=Lm(e,u);let f={keyframes:l,velocity:t.getVelocity(),ease:"easeOut",...r,delay:-a,onUpdate:p=>{t.set(p),r.onUpdate&&r.onUpdate(p)},onComplete:()=>{s(),r.onComplete&&r.onComplete()}};if(XI(r)||(f={...f,...BI(e,f)}),f.duration&&(f.duration=Dr(f.duration)),f.repeatDelay&&(f.repeatDelay=Dr(f.repeatDelay)),!d||!h||z$.current||r.type===!1||KI.skipAnimations)return NI(f);if(!i.isHandoff&&t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate){const p=LI(t,e,f);if(p)return p}return Xd(f)};function Kd(e){return!!(un(e)&&e.add)}const BC=e=>/^\-?\d*\.?\d+$/.test(e);function Gy(e,t){e.indexOf(t)===-1&&e.push(t)}function qy(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Qy{constructor(){this.subscriptions=[]}add(t){return Gy(this.subscriptions,t),()=>qy(this.subscriptions,t)}notify(t,n,i){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,i);else for(let r=0;r!isNaN(parseFloat(e));class qI{constructor(t,n={}){this.version="10.18.0",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(i,s=!0)=>{this.prev=this.current,this.current=i;const{delta:r,timestamp:o}=je;this.lastUpdated!==o&&(this.timeDelta=r,this.lastUpdated=o,zt.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),s&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>zt.postRender(this.velocityCheck),this.velocityCheck=({timestamp:i})=>{i!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=GI(this.current),this.owner=n.owner}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Qy);const i=this.events[t].add(n);return t==="change"?()=>{i(),zt.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,i){this.set(n),this.prev=t,this.timeDelta=i}jump(t){this.updateAndNotify(t),this.prev=t,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?NC(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Qo(e,t){return new qI(e,t)}const VC=e=>t=>t.test(e),QI={test:e=>e==="auto",parse:e=>e},zC=[Yr,st,bi,ps,s$,i$,QI],Ma=e=>zC.find(VC(e)),ZI=[...zC,We,Us],JI=e=>ZI.find(VC(e));function tF(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Qo(n))}function eF(e,t){const n=Bh(e,t);let{transitionEnd:i={},transition:s={},...r}=n?e.makeTargetAnimatable(n,!1):{};r={...r,...i};for(const o in r){const a=v$(r[o]);tF(e,o,a)}}function nF(e,t,n){var i,s;const r=Object.keys(t).filter(a=>!e.hasValue(a)),o=r.length;if(o)for(let a=0;al.remove(d))),c.push(v)}return o&&Promise.all(c).then(()=>{o&&eF(e,o)}),c}function jm(e,t,n={}){const i=Bh(e,t,n.custom);let{transition:s=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const r=i?()=>Promise.all(WC(e,i,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:c=0,staggerChildren:u,staggerDirection:d}=s;return aF(e,t,c+l,u,d,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[l,c]=a==="beforeChildren"?[r,o]:[o,r];return l().then(()=>c())}else return Promise.all([r(),o(n.delay)])}function aF(e,t,n=0,i=0,s=1,r){const o=[],a=(e.variantChildren.size-1)*i,l=s===1?(c=0)=>c*i:(c=0)=>a-c*i;return Array.from(e.variantChildren).sort(lF).forEach((c,u)=>{c.notify("AnimationStart",t),o.push(jm(c,t,{...r,delay:n+l(u)}).then(()=>c.notify("AnimationComplete",t)))}),Promise.all(o)}function lF(e,t){return e.sortNodePosition(t)}function cF(e,t,n={}){e.notify("AnimationStart",t);let i;if(Array.isArray(t)){const s=t.map(r=>jm(e,r,n));i=Promise.all(s)}else if(typeof t=="string")i=jm(e,t,n);else{const s=typeof t=="function"?Bh(e,t,n.custom):t;i=Promise.all(WC(e,s,n))}return i.then(()=>e.notify("AnimationComplete",t))}const uF=[...Oy].reverse(),dF=Oy.length;function hF(e){return t=>Promise.all(t.map(({animation:n,options:i})=>cF(e,n,i)))}function fF(e){let t=hF(e);const n=mF();let i=!0;const s=(l,c)=>{const u=Bh(e,c);if(u){const{transition:d,transitionEnd:h,...f}=u;l={...l,...f,...h}}return l};function r(l){t=l(e)}function o(l,c){const u=e.getProps(),d=e.getVariantContext(!0)||{},h=[],f=new Set;let p={},m=1/0;for(let y=0;ym&&w,T=!1;const A=Array.isArray(_)?_:[_];let E=A.reduce(s,{});S===!1&&(E={});const{prevResolvedValues:z={}}=x,N={...z,...E},R=L=>{P=!0,f.has(L)&&(T=!0,f.delete(L)),x.needsAnimating[L]=!0};for(const L in N){const B=E[L],D=z[L];if(p.hasOwnProperty(L))continue;let $=!1;Hd(B)&&Hd(D)?$=!hC(B,D):$=B!==D,$?B!==void 0?R(L):f.add(L):B!==void 0&&f.has(L)?R(L):x.protectedKeys[L]=!0}x.prevProp=_,x.prevResolvedValues=E,x.isActive&&(p={...p,...E}),i&&e.blockInitialAnimation&&(P=!1),P&&(!C||T)&&h.push(...A.map(L=>({animation:L,options:{type:g,...l}})))}if(f.size){const y={};f.forEach(g=>{const x=e.getBaseTarget(g);x!==void 0&&(y[g]=x)}),h.push({animation:y})}let v=!!h.length;return i&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(v=!1),i=!1,v?t(h):Promise.resolve()}function a(l,c,u){var d;if(n[l].isActive===c)return Promise.resolve();(d=e.variantChildren)===null||d===void 0||d.forEach(f=>{var p;return(p=f.animationState)===null||p===void 0?void 0:p.setActive(l,c)}),n[l].isActive=c;const h=o(u,l);for(const f in n)n[f].protectedKeys={};return h}return{animateChanges:o,setActive:a,setAnimateFunction:r,getState:()=>n}}function pF(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!hC(t,e):!1}function lr(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function mF(){return{animate:lr(!0),whileInView:lr(),whileHover:lr(),whileTap:lr(),whileDrag:lr(),whileFocus:lr(),exit:lr()}}class gF extends tr{constructor(t){super(t),t.animationState||(t.animationState=fF(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();this.unmount(),jh(t)&&(this.unmount=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){}}let yF=0;class vF extends tr{constructor(){super(...arguments),this.id=yF++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n,custom:i}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===s)return;const r=this.node.animationState.setActive("exit",!t,{custom:i??this.node.getProps().custom});n&&!t&&r.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const xF={animation:{Feature:gF},exit:{Feature:vF}},Fb=(e,t)=>Math.abs(e-t);function bF(e,t){const n=Fb(e.x,t.x),i=Fb(e.y,t.y);return Math.sqrt(n**2+i**2)}class HC{constructor(t,n,{transformPagePoint:i,contextWindow:s,dragSnapToOrigin:r=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=tp(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,f=bF(d.offset,{x:0,y:0})>=3;if(!h&&!f)return;const{point:p}=d,{timestamp:m}=je;this.history.push({...p,timestamp:m});const{onStart:v,onMove:y}=this.handlers;h||(v&&v(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,d)},this.handlePointerMove=(d,h)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=Jf(h,this.transformPagePoint),zt.update(this.updatePoint,!0)},this.handlePointerUp=(d,h)=>{this.end();const{onEnd:f,onSessionEnd:p,resumeAnimation:m}=this.handlers;if(this.dragSnapToOrigin&&m&&m(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=tp(d.type==="pointercancel"?this.lastMoveEventInfo:Jf(h,this.transformPagePoint),this.history);this.startEvent&&f&&f(d,v),p&&p(d,v)},!aC(t))return;this.dragSnapToOrigin=r,this.handlers=n,this.transformPagePoint=i,this.contextWindow=s||window;const o=Fh(t),a=Jf(o,this.transformPagePoint),{point:l}=a,{timestamp:c}=je;this.history=[{...l,timestamp:c}];const{onSessionStart:u}=n;u&&u(t,tp(a,this.history)),this.removeListeners=Is(qi(this.contextWindow,"pointermove",this.handlePointerMove),qi(this.contextWindow,"pointerup",this.handlePointerUp),qi(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),is(this.updatePoint)}}function Jf(e,t){return t?{point:t(e.point)}:e}function Bb(e,t){return{x:e.x-t.x,y:e.y-t.y}}function tp({point:e},t){return{point:e,delta:Bb(e,UC(t)),offset:Bb(e,_F(t)),velocity:wF(t,.1)}}function _F(e){return e[0]}function UC(e){return e[e.length-1]}function wF(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,i=null;const s=UC(e);for(;n>=0&&(i=e[n],!(s.timestamp-i.timestamp>Dr(t)));)n--;if(!i)return{x:0,y:0};const r=Qi(s.timestamp-i.timestamp);if(r===0)return{x:0,y:0};const o={x:(s.x-i.x)/r,y:(s.y-i.y)/r};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function wn(e){return e.max-e.min}function $m(e,t=0,n=.01){return Math.abs(e-t)<=n}function Vb(e,t,n,i=.5){e.origin=i,e.originPoint=ee(t.min,t.max,e.origin),e.scale=wn(n)/wn(t),($m(e.scale,1,1e-4)||isNaN(e.scale))&&(e.scale=1),e.translate=ee(n.min,n.max,e.origin)-e.originPoint,($m(e.translate)||isNaN(e.translate))&&(e.translate=0)}function xl(e,t,n,i){Vb(e.x,t.x,n.x,i?i.originX:void 0),Vb(e.y,t.y,n.y,i?i.originY:void 0)}function zb(e,t,n){e.min=n.min+t.min,e.max=e.min+wn(t)}function kF(e,t,n){zb(e.x,t.x,n.x),zb(e.y,t.y,n.y)}function Wb(e,t,n){e.min=t.min-n.min,e.max=e.min+wn(t)}function bl(e,t,n){Wb(e.x,t.x,n.x),Wb(e.y,t.y,n.y)}function SF(e,{min:t,max:n},i){return t!==void 0&&en&&(e=i?ee(n,e,i.max):Math.min(e,n)),e}function Hb(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function MF(e,{top:t,left:n,bottom:i,right:s}){return{x:Hb(e.x,n,s),y:Hb(e.y,t,i)}}function Ub(e,t){let n=t.min-e.min,i=t.max-e.max;return t.max-t.mini?n=Zl(t.min,t.max-i,e.min):i>s&&(n=Zl(e.min,e.max-s,t.min)),Hs(0,1,n)}function TF(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Im=.35;function DF(e=Im){return e===!1?e=0:e===!0&&(e=Im),{x:Yb(e,"left","right"),y:Yb(e,"top","bottom")}}function Yb(e,t,n){return{min:Xb(e,t),max:Xb(e,n)}}function Xb(e,t){return typeof e=="number"?e:e[t]||0}const Kb=()=>({translate:0,scale:1,origin:0,originPoint:0}),ko=()=>({x:Kb(),y:Kb()}),Gb=()=>({min:0,max:0}),fe=()=>({x:Gb(),y:Gb()});function An(e){return[e("x"),e("y")]}function YC({top:e,left:t,right:n,bottom:i}){return{x:{min:t,max:n},y:{min:e,max:i}}}function EF({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function AF(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),i=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}function ep(e){return e===void 0||e===1}function Fm({scale:e,scaleX:t,scaleY:n}){return!ep(e)||!ep(t)||!ep(n)}function mr(e){return Fm(e)||XC(e)||e.z||e.rotate||e.rotateX||e.rotateY}function XC(e){return qb(e.x)||qb(e.y)}function qb(e){return e&&e!=="0%"}function Gd(e,t,n){const i=e-n,s=t*i;return n+s}function Qb(e,t,n,i,s){return s!==void 0&&(e=Gd(e,s,i)),Gd(e,n,i)+t}function Bm(e,t=0,n=1,i,s){e.min=Qb(e.min,t,n,i,s),e.max=Qb(e.max,t,n,i,s)}function KC(e,{x:t,y:n}){Bm(e.x,t.translate,t.scale,t.originPoint),Bm(e.y,n.translate,n.scale,n.originPoint)}function OF(e,t,n,i=!1){const s=n.length;if(!s)return;t.x=t.y=1;let r,o;for(let a=0;a1.0000000000001||e<.999999999999?e:1}function ys(e,t){e.min=e.min+t,e.max=e.max+t}function Jb(e,t,[n,i,s]){const r=t[s]!==void 0?t[s]:.5,o=ee(e.min,e.max,r);Bm(e,t[n],t[i],o,t.scale)}const RF=["x","scaleX","originX"],LF=["y","scaleY","originY"];function So(e,t){Jb(e.x,t,RF),Jb(e.y,t,LF)}function GC(e,t){return YC(AF(e.getBoundingClientRect(),t))}function NF(e,t,n){const i=GC(e,n),{scroll:s}=t;return s&&(ys(i.x,s.offset.x),ys(i.y,s.offset.y)),i}const qC=({current:e})=>e?e.ownerDocument.defaultView:null,jF=new WeakMap;class $F{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=fe(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const s=u=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Fh(u,"page").point)},r=(u,d)=>{const{drag:h,dragPropagation:f,onDragStart:p}=this.getProps();if(h&&!f&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=cC(h),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),An(v=>{let y=this.getAxisMotionValue(v).get()||0;if(bi.test(y)){const{projection:g}=this.visualElement;if(g&&g.layout){const x=g.layout.layoutBox[v];x&&(y=wn(x)*(parseFloat(y)/100))}}this.originPoint[v]=y}),p&&zt.update(()=>p(u,d),!1,!0);const{animationState:m}=this.visualElement;m&&m.setActive("whileDrag",!0)},o=(u,d)=>{const{dragPropagation:h,dragDirectionLock:f,onDirectionLock:p,onDrag:m}=this.getProps();if(!h&&!this.openGlobalLock)return;const{offset:v}=d;if(f&&this.currentDirection===null){this.currentDirection=IF(v),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",d.point,v),this.updateAxis("y",d.point,v),this.visualElement.render(),m&&m(u,d)},a=(u,d)=>this.stop(u,d),l=()=>An(u=>{var d;return this.getAnimationState(u)==="paused"&&((d=this.getAxisMotionValue(u).animation)===null||d===void 0?void 0:d.play())}),{dragSnapToOrigin:c}=this.getProps();this.panSession=new HC(t,{onSessionStart:s,onStart:r,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,contextWindow:qC(this.visualElement)})}stop(t,n){const i=this.isDragging;if(this.cancel(),!i)return;const{velocity:s}=n;this.startAnimation(s);const{onDragEnd:r}=this.getProps();r&&zt.update(()=>r(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:i}=this.getProps();!i&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,i){const{drag:s}=this.getProps();if(!i||!fu(t,s,this.currentDirection))return;const r=this.getAxisMotionValue(t);let o=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(o=SF(o,this.constraints[t],this.elastic[t])),r.set(o)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:i}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,r=this.constraints;n&&_o(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&s?this.constraints=MF(s.layoutBox,n):this.constraints=!1,this.elastic=DF(i),r!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&An(o=>{this.getAxisMotionValue(o)&&(this.constraints[o]=TF(s.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!_o(t))return!1;const i=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const r=NF(i,s.root,this.visualElement.getTransformPagePoint());let o=CF(s.layout.layoutBox,r);if(n){const a=n(EF(o));this.hasMutatedConstraints=!!a,a&&(o=YC(a))}return o}startAnimation(t){const{drag:n,dragMomentum:i,dragElastic:s,dragTransition:r,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=An(u=>{if(!fu(u,n,this.currentDirection))return;let d=l&&l[u]||{};o&&(d={min:0,max:0});const h=s?200:1e6,f=s?40:1e7,p={type:"inertia",velocity:i?t[u]:0,bounceStiffness:h,bounceDamping:f,timeConstant:750,restDelta:1,restSpeed:10,...r,...d};return this.startAxisValueAnimation(u,p)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const i=this.getAxisMotionValue(t);return i.start(Ky(t,i,0,n))}stopAnimation(){An(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){An(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n="_drag"+t.toUpperCase(),i=this.visualElement.getProps(),s=i[n];return s||this.visualElement.getValue(t,(i.initial?i.initial[t]:void 0)||0)}snapToCursor(t){An(n=>{const{drag:i}=this.getProps();if(!fu(n,i,this.currentDirection))return;const{projection:s}=this.visualElement,r=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:a}=s.layout.layoutBox[n];r.set(t[n]-ee(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!_o(n)||!i||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};An(o=>{const a=this.getAxisMotionValue(o);if(a){const l=a.get();s[o]=PF({min:l,max:l},this.constraints[o])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),An(o=>{if(!fu(o,t,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(ee(l,c,s[o]))})}addListeners(){if(!this.visualElement.current)return;jF.set(this.visualElement,this);const t=this.visualElement.current,n=qi(t,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),i=()=>{const{dragConstraints:l}=this.getProps();_o(l)&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,r=s.addEventListener("measure",i);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),i();const o=Hi(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(An(u=>{const d=this.getAxisMotionValue(u);d&&(this.originPoint[u]+=l[u].translate,d.set(d.get()+l[u].translate))}),this.visualElement.render())});return()=>{o(),n(),r(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:i=!1,dragPropagation:s=!1,dragConstraints:r=!1,dragElastic:o=Im,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:i,dragPropagation:s,dragConstraints:r,dragElastic:o,dragMomentum:a}}}function fu(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function IF(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class FF extends tr{constructor(t){super(t),this.removeGroupControls=ce,this.removeListeners=ce,this.controls=new $F(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ce}unmount(){this.removeGroupControls(),this.removeListeners()}}const t1=e=>(t,n)=>{e&&zt.update(()=>e(t,n))};class BF extends tr{constructor(){super(...arguments),this.removePointerDownListener=ce}onPointerDown(t){this.session=new HC(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:qC(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:i,onPanEnd:s}=this.node.getProps();return{onSessionStart:t1(t),onStart:t1(n),onMove:i,onEnd:(r,o)=>{delete this.session,s&&zt.update(()=>s(r,o))}}}mount(){this.removePointerDownListener=qi(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function VF(){const e=k.useContext(Lh);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:n,register:i}=e,s=k.useId();return k.useEffect(()=>i(s),[]),!t&&n?[!1,()=>n&&n(s)]:[!0]}const id={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function e1(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Ca={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(st.test(e))e=parseFloat(e);else return e;const n=e1(e,t.target.x),i=e1(e,t.target.y);return`${n}% ${i}%`}},zF={correct:(e,{treeScale:t,projectionDelta:n})=>{const i=e,s=Us.parse(e);if(s.length>5)return i;const r=Us.createTransformer(e),o=typeof s[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;s[0+o]/=a,s[1+o]/=l;const c=ee(a,l,.5);return typeof s[2+o]=="number"&&(s[2+o]/=c),typeof s[3+o]=="number"&&(s[3+o]/=c),r(s)}};class WF extends Y.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i,layoutId:s}=this.props,{projection:r}=t;qj(HF),r&&(n.group&&n.group.add(r),i&&i.register&&s&&i.register(r),r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,onExitComplete:()=>this.safeToRemove()})),id.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:i,drag:s,isPresent:r}=this.props,o=i.projection;return o&&(o.isPresent=r,s||t.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),t.isPresent!==r&&(r?o.promote():o.relegate()||zt.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),queueMicrotask(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i}=this.props,{projection:s}=t;s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),i&&i.deregister&&i.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function QC(e){const[t,n]=VF(),i=k.useContext(Ly);return Y.createElement(WF,{...e,layoutGroup:i,switchLayoutGroup:k.useContext(YM),isPresent:t,safeToRemove:n})}const HF={borderRadius:{...Ca,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ca,borderTopRightRadius:Ca,borderBottomLeftRadius:Ca,borderBottomRightRadius:Ca,boxShadow:zF},ZC=["TopLeft","TopRight","BottomLeft","BottomRight"],UF=ZC.length,n1=e=>typeof e=="string"?parseFloat(e):e,i1=e=>typeof e=="number"||st.test(e);function YF(e,t,n,i,s,r){s?(e.opacity=ee(0,n.opacity!==void 0?n.opacity:1,XF(i)),e.opacityExit=ee(t.opacity!==void 0?t.opacity:1,0,KF(i))):r&&(e.opacity=ee(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,i));for(let o=0;oit?1:n(Zl(e,t,i))}function r1(e,t){e.min=t.min,e.max=t.max}function Dn(e,t){r1(e.x,t.x),r1(e.y,t.y)}function o1(e,t,n,i,s){return e-=t,e=Gd(e,1/n,i),s!==void 0&&(e=Gd(e,1/s,i)),e}function GF(e,t=0,n=1,i=.5,s,r=e,o=e){if(bi.test(t)&&(t=parseFloat(t),t=ee(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=ee(r.min,r.max,i);e===r&&(a-=t),e.min=o1(e.min,t,n,a,s),e.max=o1(e.max,t,n,a,s)}function a1(e,t,[n,i,s],r,o){GF(e,t[n],t[i],t[s],t.scale,r,o)}const qF=["x","scaleX","originX"],QF=["y","scaleY","originY"];function l1(e,t,n,i){a1(e.x,t,qF,n?n.x:void 0,i?i.x:void 0),a1(e.y,t,QF,n?n.y:void 0,i?i.y:void 0)}function c1(e){return e.translate===0&&e.scale===1}function tP(e){return c1(e.x)&&c1(e.y)}function ZF(e,t){return e.x.min===t.x.min&&e.x.max===t.x.max&&e.y.min===t.y.min&&e.y.max===t.y.max}function eP(e,t){return Math.round(e.x.min)===Math.round(t.x.min)&&Math.round(e.x.max)===Math.round(t.x.max)&&Math.round(e.y.min)===Math.round(t.y.min)&&Math.round(e.y.max)===Math.round(t.y.max)}function u1(e){return wn(e.x)/wn(e.y)}class JF{constructor(){this.members=[]}add(t){Gy(this.members,t),t.scheduleRender()}remove(t){if(qy(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(s=>t===s);if(n===0)return!1;let i;for(let s=n;s>=0;s--){const r=this.members[s];if(r.isPresent!==!1){i=r;break}}return i?(this.promote(i),!0):!1}promote(t,n){const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.instance&&i.scheduleRender(),t.scheduleRender(),t.resumeFrom=i,n&&(t.resumeFrom.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:s}=t.options;s===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:i}=t;n.onExitComplete&&n.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function d1(e,t,n){let i="";const s=e.x.translate/t.x,r=e.y.translate/t.y;if((s||r)&&(i=`translate3d(${s}px, ${r}px, 0) `),(t.x!==1||t.y!==1)&&(i+=`scale(${1/t.x}, ${1/t.y}) `),n){const{rotate:l,rotateX:c,rotateY:u}=n;l&&(i+=`rotate(${l}deg) `),c&&(i+=`rotateX(${c}deg) `),u&&(i+=`rotateY(${u}deg) `)}const o=e.x.scale*t.x,a=e.y.scale*t.y;return(o!==1||a!==1)&&(i+=`scale(${o}, ${a})`),i||"none"}const tB=(e,t)=>e.depth-t.depth;class eB{constructor(){this.children=[],this.isDirty=!1}add(t){Gy(this.children,t),this.isDirty=!0}remove(t){qy(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(tB),this.isDirty=!1,this.children.forEach(t)}}function nB(e,t){const n=performance.now(),i=({timestamp:s})=>{const r=s-n;r>=t&&(is(i),e(r-t))};return zt.read(i,!0),()=>is(i)}function iB(e){window.MotionDebug&&window.MotionDebug.record(e)}function sB(e){return e instanceof SVGElement&&e.tagName!=="svg"}function rB(e,t,n){const i=un(e)?e:Qo(e);return i.start(Ky("",i,t,n)),i.animation}const h1=["","X","Y","Z"],oB={visibility:"hidden"},f1=1e3;let aB=0;const gr={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function nP({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:i,resetTransform:s}){return class{constructor(o={},a=t==null?void 0:t()){this.id=aB++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,gr.totalNodes=gr.resolvedTargetDeltas=gr.recalculatedProjection=0,this.nodes.forEach(uB),this.nodes.forEach(mB),this.nodes.forEach(gB),this.nodes.forEach(dB),iB(gr)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;lthis.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=nB(h,250),id.hasAnimatedSinceResize&&(id.hasAnimatedSinceResize=!1,this.nodes.forEach(m1))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&u&&(l||c)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:h,hasRelativeTargetChanged:f,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||u.getDefaultTransition()||_B,{onLayoutAnimationStart:v,onLayoutAnimationComplete:y}=u.getProps(),g=!this.targetLayout||!eP(this.targetLayout,p)||f,x=!h&&f;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||x||h&&(g||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,x);const _={...Xy(m,"layout"),onPlay:v,onComplete:y};(u.shouldReduceMotion||this.options.layoutRoot)&&(_.delay=0,_.type=!1),this.startAnimation(_)}else h||m1(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,is(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(yB),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;uthis.update()))}clearAllSnapshots(){this.nodes.forEach(hB),this.sharedNodes.forEach(vB)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,zt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){zt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{const w=_/1e3;g1(d.x,o.x,w),g1(d.y,o.y,w),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(bl(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),xB(this.relativeTarget,this.relativeTargetOrigin,h,w),x&&ZF(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=fe()),Dn(x,this.relativeTarget)),m&&(this.animationValues=u,YF(u,c,this.latestValues,w,g,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=w},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(is(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=zt.update(()=>{id.hasAnimatedSinceResize=!0,this.currentAnimation=rB(0,f1,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(f1),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=o;if(!(!a||!l||!c)){if(this!==o&&this.layout&&c&&iP(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||fe();const d=wn(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+d;const h=wn(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+h}Dn(a,l),So(a,u),xl(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new JF),this.sharedNodes.get(o).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.rotate||l.rotateX||l.rotateY||l.rotateZ)&&(a=!0),!a)return;const c={};for(let u=0;u{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(p1),this.root.sharedNodes.clear()}}}function lB(e){e.updateLayout()}function cB(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:i,measuredBox:s}=e.layout,{animationType:r}=e.options,o=n.source!==e.layout.source;r==="size"?An(d=>{const h=o?n.measuredBox[d]:n.layoutBox[d],f=wn(h);h.min=i[d].min,h.max=h.min+f}):iP(r,n.layoutBox,i)&&An(d=>{const h=o?n.measuredBox[d]:n.layoutBox[d],f=wn(i[d]);h.max=h.min+f,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+f)});const a=ko();xl(a,i,n.layoutBox);const l=ko();o?xl(l,e.applyTransform(s,!0),n.measuredBox):xl(l,i,n.layoutBox);const c=!tP(a);let u=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:h,layout:f}=d;if(h&&f){const p=fe();bl(p,n.layoutBox,h.layoutBox);const m=fe();bl(m,i,f.layoutBox),eP(p,m)||(u=!0),d.options.layoutRoot&&(e.relativeTarget=m,e.relativeTargetOrigin=p,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:i,snapshot:n,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeTargetChanged:u})}else if(e.isLead()){const{onExitComplete:i}=e.options;i&&i()}e.options.transition=void 0}function uB(e){gr.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function dB(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function hB(e){e.clearSnapshot()}function p1(e){e.clearMeasurements()}function fB(e){e.isLayoutDirty=!1}function pB(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function m1(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function mB(e){e.resolveTargetDelta()}function gB(e){e.calcProjection()}function yB(e){e.resetRotation()}function vB(e){e.removeLeadSnapshot()}function g1(e,t,n){e.translate=ee(t.translate,0,n),e.scale=ee(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function y1(e,t,n,i){e.min=ee(t.min,n.min,i),e.max=ee(t.max,n.max,i)}function xB(e,t,n,i){y1(e.x,t.x,n.x,i),y1(e.y,t.y,n.y,i)}function bB(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const _B={duration:.45,ease:[.4,0,.1,1]},v1=e=>typeof navigator<"u"&&navigator.userAgent.toLowerCase().includes(e),x1=v1("applewebkit/")&&!v1("chrome/")?Math.round:ce;function b1(e){e.min=x1(e.min),e.max=x1(e.max)}function wB(e){b1(e.x),b1(e.y)}function iP(e,t,n){return e==="position"||e==="preserve-aspect"&&!$m(u1(t),u1(n),.2)}const kB=nP({attachResizeListener:(e,t)=>Hi(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),np={current:void 0},sP=nP({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!np.current){const e=new kB({});e.mount(window),e.setOptions({layoutScroll:!0}),np.current=e}return np.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),SB={pan:{Feature:BF},drag:{Feature:FF,ProjectionNode:sP,MeasureLayout:QC}},MB=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function CB(e){const t=MB.exec(e);if(!t)return[,];const[,n,i]=t;return[n,i]}function Vm(e,t,n=1){const[i,s]=CB(e);if(!i)return;const r=window.getComputedStyle(t).getPropertyValue(i);if(r){const o=r.trim();return BC(o)?parseFloat(o):o}else return Em(s)?Vm(s,t,n+1):s}function PB(e,{...t},n){const i=e.current;if(!(i instanceof Element))return{target:t,transitionEnd:n};n&&(n={...n}),e.values.forEach(s=>{const r=s.get();if(!Em(r))return;const o=Vm(r,i);o&&s.set(o)});for(const s in t){const r=t[s];if(!Em(r))continue;const o=Vm(r,i);o&&(t[s]=o,n||(n={}),n[s]===void 0&&(n[s]=r))}return{target:t,transitionEnd:n}}const TB=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),rP=e=>TB.has(e),DB=e=>Object.keys(e).some(rP),_1=e=>e===Yr||e===st,w1=(e,t)=>parseFloat(e.split(", ")[t]),k1=(e,t)=>(n,{transform:i})=>{if(i==="none"||!i)return 0;const s=i.match(/^matrix3d\((.+)\)$/);if(s)return w1(s[1],t);{const r=i.match(/^matrix\((.+)\)$/);return r?w1(r[1],e):0}},EB=new Set(["x","y","z"]),AB=vc.filter(e=>!EB.has(e));function OB(e){const t=[];return AB.forEach(n=>{const i=e.getValue(n);i!==void 0&&(t.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),t.length&&e.render(),t}const Zo={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:k1(4,13),y:k1(5,14)};Zo.translateX=Zo.x;Zo.translateY=Zo.y;const RB=(e,t,n)=>{const i=t.measureViewportBox(),s=t.current,r=getComputedStyle(s),{display:o}=r,a={};o==="none"&&t.setStaticValue("display",e.display||"block"),n.forEach(c=>{a[c]=Zo[c](i,r)}),t.render();const l=t.measureViewportBox();return n.forEach(c=>{const u=t.getValue(c);u&&u.jump(a[c]),e[c]=Zo[c](l,r)}),e},LB=(e,t,n={},i={})=>{t={...t},i={...i};const s=Object.keys(t).filter(rP);let r=[],o=!1;const a=[];if(s.forEach(l=>{const c=e.getValue(l);if(!e.hasValue(l))return;let u=n[l],d=Ma(u);const h=t[l];let f;if(Hd(h)){const p=h.length,m=h[0]===null?1:0;u=h[m],d=Ma(u);for(let v=m;v=0?window.pageYOffset:null,c=RB(t,e,a);return r.length&&r.forEach(([u,d])=>{e.getValue(u).set(d)}),e.render(),Nh&&l!==null&&window.scrollTo({top:l}),{target:c,transitionEnd:i}}else return{target:t,transitionEnd:i}};function NB(e,t,n,i){return DB(t)?LB(e,t,n,i):{target:t,transitionEnd:i}}const jB=(e,t,n,i)=>{const s=PB(e,t,i);return t=s.target,i=s.transitionEnd,NB(e,t,n,i)},zm={current:null},oP={current:!1};function $B(){if(oP.current=!0,!!Nh)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>zm.current=e.matches;e.addListener(t),t()}else zm.current=!1}function IB(e,t,n){const{willChange:i}=t;for(const s in t){const r=t[s],o=n[s];if(un(r))e.addValue(s,r),Kd(i)&&i.add(s);else if(un(o))e.addValue(s,Qo(r,{owner:e})),Kd(i)&&i.remove(s);else if(o!==r)if(e.hasValue(s)){const a=e.getValue(s);!a.hasAnimated&&a.set(r)}else{const a=e.getStaticValue(s);e.addValue(s,Qo(a!==void 0?a:r,{owner:e}))}}for(const s in n)t[s]===void 0&&e.removeValue(s);return t}const S1=new WeakMap,aP=Object.keys(Ql),FB=aP.length,M1=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],BB=Ry.length;class VB{constructor({parent:t,props:n,presenceContext:i,reducedMotionConfig:s,visualState:r},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>zt.render(this.render,!1,!0);const{latestValues:a,renderState:l}=r;this.latestValues=a,this.baseTarget={...a},this.initialValues=n.initial?{...a}:{},this.renderState=l,this.parent=t,this.props=n,this.presenceContext=i,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=o,this.isControllingVariants=$h(n),this.isVariantNode=UM(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:c,...u}=this.scrapeMotionValuesFromProps(n,{});for(const d in u){const h=u[d];a[d]!==void 0&&un(h)&&(h.set(a[d],!1),Kd(c)&&c.add(d))}}scrapeMotionValuesFromProps(t,n){return{}}mount(t){this.current=t,S1.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,i)=>this.bindToMotionValue(i,n)),oP.current||$B(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:zm.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){S1.delete(this.current),this.projection&&this.projection.unmount(),is(this.notifyUpdate),is(this.render),this.valueSubscriptions.forEach(t=>t()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features)this.features[t].unmount();this.current=null}bindToMotionValue(t,n){const i=Ur.has(t),s=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&zt.update(this.notifyUpdate,!1,!0),i&&this.projection&&(this.projection.isTransformDirty=!0)}),r=n.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(t,()=>{s(),r()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}loadFeatures({children:t,...n},i,s,r){let o,a;for(let l=0;lthis.scheduleRender(),animationType:typeof c=="string"?c:"both",initialPromotionConfig:r,layoutScroll:h,layoutRoot:f})}return a}updateFeatures(){for(const t in this.features){const n=this.features[t];n.isMounted?n.update():(n.mount(),n.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):fe()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}makeTargetAnimatable(t,n=!0){return this.makeTargetAnimatableFromInstance(t,this.props,n)}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let i=0;in.variantChildren.delete(t)}addValue(t,n){n!==this.values.get(t)&&(this.removeValue(t),this.bindToMotionValue(t,n)),this.values.set(t,n),this.latestValues[t]=n.get()}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let i=this.values.get(t);return i===void 0&&n!==void 0&&(i=Qo(n,{owner:this}),this.addValue(t,i)),i}readValue(t){var n;return this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(n=this.getBaseTargetFromProps(this.props,t))!==null&&n!==void 0?n:this.readValueFromInstance(this.current,t,this.options)}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:i}=this.props,s=typeof i=="string"||typeof i=="object"?(n=Vy(this.props,i))===null||n===void 0?void 0:n[t]:void 0;if(i&&s!==void 0)return s;const r=this.getBaseTargetFromProps(this.props,t);return r!==void 0&&!un(r)?r:this.initialValues[t]!==void 0&&s===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Qy),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class lP extends VB{sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:i}){delete n[t],delete i[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:n,...i},{transformValues:s},r){let o=sF(i,t||{},this);if(s&&(n&&(n=s(n)),i&&(i=s(i)),o&&(o=s(o))),r){nF(this,i,o);const a=jB(this,i,o,n);n=a.transitionEnd,i=a.target}return{transition:t,transitionEnd:n,...i}}}function zB(e){return window.getComputedStyle(e)}class WB extends lP{constructor(){super(...arguments),this.type="html"}readValueFromInstance(t,n){if(Ur.has(n)){const i=Yy(n);return i&&i.default||0}else{const i=zB(t),s=(GM(n)?i.getPropertyValue(n):i[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return GC(t,n)}build(t,n,i,s){jy(t,n,i,s.transformTemplate)}scrapeMotionValuesFromProps(t,n){return By(t,n)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;un(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}renderInstance(t,n,i,s){eC(t,n,i,s)}}class HB extends lP{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Ur.has(n)){const i=Yy(n);return i&&i.default||0}return n=nC.has(n)?n:Ay(n),t.getAttribute(n)}measureInstanceViewportBox(){return fe()}scrapeMotionValuesFromProps(t,n){return sC(t,n)}build(t,n,i,s){Iy(t,n,i,this.isSVGTag,s.transformTemplate)}renderInstance(t,n,i,s){iC(t,n,i,s)}mount(t){this.isSVGTag=Fy(t.tagName),super.mount(t)}}const UB=(e,t)=>Ny(e)?new HB(t,{enableHardwareAcceleration:!1}):new WB(t,{enableHardwareAcceleration:!0}),YB={layout:{ProjectionNode:sP,MeasureLayout:QC}},XB={...xF,...F$,...SB,...YB},Jo=Kj((e,t)=>C$(e,t,XB,UB));function cP(){const e=k.useRef(!1);return Ey(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function KB(){const e=cP(),[t,n]=k.useState(0),i=k.useCallback(()=>{e.current&&n(t+1)},[t]);return[k.useCallback(()=>zt.postRender(i),[i]),t]}class GB extends k.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const i=this.props.sizeRef.current;i.height=n.offsetHeight||0,i.width=n.offsetWidth||0,i.top=n.offsetTop,i.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function qB({children:e,isPresent:t}){const n=k.useId(),i=k.useRef(null),s=k.useRef({width:0,height:0,top:0,left:0});return k.useInsertionEffect(()=>{const{width:r,height:o,top:a,left:l}=s.current;if(t||!i.current||!r||!o)return;i.current.dataset.motionPopId=n;const c=document.createElement("style");return document.head.appendChild(c),c.sheet&&c.sheet.insertRule(` [data-motion-pop-id="${n}"] { position: absolute !important; width: ${r}px !important; @@ -62,31 +62,31 @@ Error generating stack: `+r.message+` top: ${a}px !important; left: ${l}px !important; } - `),()=>{document.head.removeChild(c)}},[t]),k.createElement(GB,{isPresent:t,childRef:i,sizeRef:s},k.cloneElement(e,{ref:i}))}const ip=({children:e,initial:t,isPresent:n,onExitComplete:i,custom:s,presenceAffectsLayout:r,mode:o})=>{const a=rC(QB),l=k.useId(),c=k.useMemo(()=>({id:l,initial:t,isPresent:n,custom:s,onExitComplete:u=>{a.set(u,!0);for(const d of a.values())if(!d)return;i&&i()},register:u=>(a.set(u,!1),()=>a.delete(u))}),r?void 0:[n]);return k.useMemo(()=>{a.forEach((u,d)=>a.set(d,!1))},[n]),k.useEffect(()=>{!n&&!a.size&&i&&i()},[n]),o==="popLayout"&&(e=k.createElement(qB,{isPresent:n},e)),k.createElement(Rh.Provider,{value:c},e)};function QB(){return new Map}function ZB(e){return k.useEffect(()=>()=>e(),[])}const yr=e=>e.key||"";function JB(e,t){e.forEach(n=>{const i=yr(n);t.set(i,n)})}function tV(e){const t=[];return k.Children.forEach(e,n=>{k.isValidElement(n)&&t.push(n)}),t}const Zy=({children:e,custom:t,initial:n=!0,onExitComplete:i,exitBeforeEnter:s,presenceAffectsLayout:r=!0,mode:o="sync"})=>{const a=k.useContext(Ry).forceRender||KB()[0],l=cP(),c=tV(e);let u=c;const d=k.useRef(new Map).current,h=k.useRef(u),f=k.useRef(new Map).current,p=k.useRef(!0);if(Ey(()=>{p.current=!1,JB(c,f),h.current=u}),ZB(()=>{p.current=!0,f.clear(),d.clear()}),p.current)return k.createElement(k.Fragment,null,u.map(g=>k.createElement(ip,{key:yr(g),isPresent:!0,initial:n?void 0:!1,presenceAffectsLayout:r,mode:o},g)));u=[...u];const m=h.current.map(yr),v=c.map(yr),y=m.length;for(let g=0;g{if(v.indexOf(x)!==-1)return;const _=f.get(x);if(!_)return;const w=m.indexOf(x);let S=g;if(!S){const C=()=>{d.delete(x);const M=Array.from(f.keys()).filter(P=>!v.includes(P));if(M.forEach(P=>f.delete(P)),h.current=c.filter(P=>{const T=yr(P);return T===x||M.includes(T)}),!d.size){if(l.current===!1)return;a(),i&&i()}};S=k.createElement(ip,{key:yr(_),isPresent:!1,onExitComplete:C,custom:t,presenceAffectsLayout:r,mode:o},_),d.set(x,S)}u.splice(w,0,S)}),u=u.map(g=>{const x=g.key;return d.has(x)?g:k.createElement(ip,{key:yr(g),isPresent:!0,presenceAffectsLayout:r,mode:o},g)}),k.createElement(k.Fragment,null,d.size?u:u.map(g=>k.cloneElement(g)))};/*! + `),()=>{document.head.removeChild(c)}},[t]),k.createElement(GB,{isPresent:t,childRef:i,sizeRef:s},k.cloneElement(e,{ref:i}))}const ip=({children:e,initial:t,isPresent:n,onExitComplete:i,custom:s,presenceAffectsLayout:r,mode:o})=>{const a=rC(QB),l=k.useId(),c=k.useMemo(()=>({id:l,initial:t,isPresent:n,custom:s,onExitComplete:u=>{a.set(u,!0);for(const d of a.values())if(!d)return;i&&i()},register:u=>(a.set(u,!1),()=>a.delete(u))}),r?void 0:[n]);return k.useMemo(()=>{a.forEach((u,d)=>a.set(d,!1))},[n]),k.useEffect(()=>{!n&&!a.size&&i&&i()},[n]),o==="popLayout"&&(e=k.createElement(qB,{isPresent:n},e)),k.createElement(Lh.Provider,{value:c},e)};function QB(){return new Map}function ZB(e){return k.useEffect(()=>()=>e(),[])}const yr=e=>e.key||"";function JB(e,t){e.forEach(n=>{const i=yr(n);t.set(i,n)})}function tV(e){const t=[];return k.Children.forEach(e,n=>{k.isValidElement(n)&&t.push(n)}),t}const Zy=({children:e,custom:t,initial:n=!0,onExitComplete:i,exitBeforeEnter:s,presenceAffectsLayout:r=!0,mode:o="sync"})=>{const a=k.useContext(Ly).forceRender||KB()[0],l=cP(),c=tV(e);let u=c;const d=k.useRef(new Map).current,h=k.useRef(u),f=k.useRef(new Map).current,p=k.useRef(!0);if(Ey(()=>{p.current=!1,JB(c,f),h.current=u}),ZB(()=>{p.current=!0,f.clear(),d.clear()}),p.current)return k.createElement(k.Fragment,null,u.map(g=>k.createElement(ip,{key:yr(g),isPresent:!0,initial:n?void 0:!1,presenceAffectsLayout:r,mode:o},g)));u=[...u];const m=h.current.map(yr),v=c.map(yr),y=m.length;for(let g=0;g{if(v.indexOf(x)!==-1)return;const _=f.get(x);if(!_)return;const w=m.indexOf(x);let S=g;if(!S){const C=()=>{d.delete(x);const M=Array.from(f.keys()).filter(P=>!v.includes(P));if(M.forEach(P=>f.delete(P)),h.current=c.filter(P=>{const T=yr(P);return T===x||M.includes(T)}),!d.size){if(l.current===!1)return;a(),i&&i()}};S=k.createElement(ip,{key:yr(_),isPresent:!1,onExitComplete:C,custom:t,presenceAffectsLayout:r,mode:o},_),d.set(x,S)}u.splice(w,0,S)}),u=u.map(g=>{const x=g.key;return d.has(x)?g:k.createElement(ip,{key:yr(g),isPresent:!0,presenceAffectsLayout:r,mode:o},g)}),k.createElement(k.Fragment,null,d.size?u:u.map(g=>k.cloneElement(g)))};/*! * chartjs-plugin-datalabels v2.2.0 * https://chartjs-plugin-datalabels.netlify.app * (c) 2017-2022 chartjs-plugin-datalabels contributors * Released under the MIT license - */var C1=function(){if(typeof window<"u"){if(window.devicePixelRatio)return window.devicePixelRatio;var e=window.screen;if(e)return(e.deviceXDPI||1)/(e.logicalXDPI||1)}return 1}(),id={toTextLines:function(e){var t=[],n;for(e=[].concat(e);e.length;)n=e.pop(),typeof n=="string"?t.unshift.apply(t,n.split(` -`)):Array.isArray(n)?e.push.apply(e,n):bt(e)||t.unshift(""+n);return t},textSize:function(e,t,n){var i=[].concat(t),s=i.length,r=e.font,o=0,a;for(e.font=n.string,a=0;an.right&&(i|=dP),tn.bottom&&(i|=hP),i}function iV(e,t){for(var n=e.x0,i=e.y0,s=e.x1,r=e.y1,o=fu(n,i,t),a=fu(s,r,t),l,c,u;!(!(o|a)||o&a);)l=o||a,l&fP?(c=n+(s-n)*(t.top-i)/(r-i),u=t.top):l&hP?(c=n+(s-n)*(t.bottom-i)/(r-i),u=t.bottom):l&dP?(u=i+(r-i)*(t.right-n)/(s-n),c=t.right):l&uP&&(u=i+(r-i)*(t.left-n)/(s-n),c=t.left),l===o?(n=c,i=u,o=fu(n,i,t)):(s=c,r=u,a=fu(s,r,t));return{x0:n,x1:s,y0:i,y1:r}}function pu(e,t){var n=t.anchor,i=e,s,r;return t.clamp&&(i=iV(i,t.area)),n==="start"?(s=i.x0,r=i.y0):n==="end"?(s=i.x1,r=i.y1):(s=(i.x0+i.x1)/2,r=(i.y0+i.y1)/2),eV(s,r,e.vx,e.vy,t.align)}var mu={arc:function(e,t){var n=(e.startAngle+e.endAngle)/2,i=Math.cos(n),s=Math.sin(n),r=e.innerRadius,o=e.outerRadius;return pu({x0:e.x+i*r,y0:e.y+s*r,x1:e.x+i*o,y1:e.y+s*o,vx:i,vy:s},t)},point:function(e,t){var n=sp(e,t.origin),i=n.x*e.options.radius,s=n.y*e.options.radius;return pu({x0:e.x-i,y0:e.y-s,x1:e.x+i,y1:e.y+s,vx:n.x,vy:n.y},t)},bar:function(e,t){var n=sp(e,t.origin),i=e.x,s=e.y,r=0,o=0;return e.horizontal?(i=Math.min(e.x,e.base),r=Math.abs(e.base-e.x)):(s=Math.min(e.y,e.base),o=Math.abs(e.base-e.y)),pu({x0:i,y0:s+o,x1:i+r,y1:s,vx:n.x,vy:n.y},t)},fallback:function(e,t){var n=sp(e,t.origin);return pu({x0:e.x,y0:e.y,x1:e.x+(e.width||0),y1:e.y+(e.height||0),vx:n.x,vy:n.y},t)}},Ui=id.rasterize;function sV(e){var t=e.borderWidth||0,n=e.padding,i=e.size.height,s=e.size.width,r=-s/2,o=-i/2;return{frame:{x:r-n.left-t,y:o-n.top-t,w:s+n.width+t*2,h:i+n.height+t*2},text:{x:r,y:o,w:s,h:i}}}function rV(e,t){var n=t.chart.getDatasetMeta(t.datasetIndex).vScale;if(!n)return null;if(n.xCenter!==void 0&&n.yCenter!==void 0)return{x:n.xCenter,y:n.yCenter};var i=n.getBasePixel();return e.horizontal?{x:i,y:null}:{x:null,y:i}}function oV(e){return e instanceof vM?mu.arc:e instanceof _M?mu.point:e instanceof kM?mu.bar:mu.fallback}function aV(e,t,n,i,s,r){var o=Math.PI/2;if(r){var a=Math.min(r,s/2,i/2),l=t+a,c=n+a,u=t+i-a,d=n+s-a;e.moveTo(t,c),li.x+i.w+n*2||e.y>i.y+i.h+n*2)},intersects:function(e){var t=this._points(),n=e._points(),i=[gu(t[0],t[1]),gu(t[0],t[3])],s,r,o;for(this._rotation!==e._rotation&&i.push(gu(n[0],n[1]),gu(n[0],n[3])),s=0;sn.right&&(i|=dP),tn.bottom&&(i|=hP),i}function iV(e,t){for(var n=e.x0,i=e.y0,s=e.x1,r=e.y1,o=pu(n,i,t),a=pu(s,r,t),l,c,u;!(!(o|a)||o&a);)l=o||a,l&fP?(c=n+(s-n)*(t.top-i)/(r-i),u=t.top):l&hP?(c=n+(s-n)*(t.bottom-i)/(r-i),u=t.bottom):l&dP?(u=i+(r-i)*(t.right-n)/(s-n),c=t.right):l&uP&&(u=i+(r-i)*(t.left-n)/(s-n),c=t.left),l===o?(n=c,i=u,o=pu(n,i,t)):(s=c,r=u,a=pu(s,r,t));return{x0:n,x1:s,y0:i,y1:r}}function mu(e,t){var n=t.anchor,i=e,s,r;return t.clamp&&(i=iV(i,t.area)),n==="start"?(s=i.x0,r=i.y0):n==="end"?(s=i.x1,r=i.y1):(s=(i.x0+i.x1)/2,r=(i.y0+i.y1)/2),eV(s,r,e.vx,e.vy,t.align)}var gu={arc:function(e,t){var n=(e.startAngle+e.endAngle)/2,i=Math.cos(n),s=Math.sin(n),r=e.innerRadius,o=e.outerRadius;return mu({x0:e.x+i*r,y0:e.y+s*r,x1:e.x+i*o,y1:e.y+s*o,vx:i,vy:s},t)},point:function(e,t){var n=sp(e,t.origin),i=n.x*e.options.radius,s=n.y*e.options.radius;return mu({x0:e.x-i,y0:e.y-s,x1:e.x+i,y1:e.y+s,vx:n.x,vy:n.y},t)},bar:function(e,t){var n=sp(e,t.origin),i=e.x,s=e.y,r=0,o=0;return e.horizontal?(i=Math.min(e.x,e.base),r=Math.abs(e.base-e.x)):(s=Math.min(e.y,e.base),o=Math.abs(e.base-e.y)),mu({x0:i,y0:s+o,x1:i+r,y1:s,vx:n.x,vy:n.y},t)},fallback:function(e,t){var n=sp(e,t.origin);return mu({x0:e.x,y0:e.y,x1:e.x+(e.width||0),y1:e.y+(e.height||0),vx:n.x,vy:n.y},t)}},Ui=sd.rasterize;function sV(e){var t=e.borderWidth||0,n=e.padding,i=e.size.height,s=e.size.width,r=-s/2,o=-i/2;return{frame:{x:r-n.left-t,y:o-n.top-t,w:s+n.width+t*2,h:i+n.height+t*2},text:{x:r,y:o,w:s,h:i}}}function rV(e,t){var n=t.chart.getDatasetMeta(t.datasetIndex).vScale;if(!n)return null;if(n.xCenter!==void 0&&n.yCenter!==void 0)return{x:n.xCenter,y:n.yCenter};var i=n.getBasePixel();return e.horizontal?{x:i,y:null}:{x:null,y:i}}function oV(e){return e instanceof vM?gu.arc:e instanceof _M?gu.point:e instanceof kM?gu.bar:gu.fallback}function aV(e,t,n,i,s,r){var o=Math.PI/2;if(r){var a=Math.min(r,s/2,i/2),l=t+a,c=n+a,u=t+i-a,d=n+s-a;e.moveTo(t,c),li.x+i.w+n*2||e.y>i.y+i.h+n*2)},intersects:function(e){var t=this._points(),n=e._points(),i=[yu(t[0],t[1]),yu(t[0],t[3])],s,r,o;for(this._rotation!==e._rotation&&i.push(yu(n[0],n[1]),yu(n[0],n[3])),s=0;s"u"}function Vt(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 yt(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}const de=e=>(typeof e=="number"||e instanceof Number)&&isFinite(+e);function On(e,t){return de(e)?e:t}function ut(e,t){return typeof e>"u"?t:e}const yV=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:e/t,pP=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function Ft(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function At(e,t,n,i){let s,r,o;if(Vt(e))if(r=e.length,i)for(s=r-1;s>=0;s--)t.call(n,e[s],s);else for(s=0;se,x:e=>e.x,y:e=>e.y};function Ys(e,t){return(T1[t]||(T1[t]=bV(t)))(e)}function bV(e){const t=_V(e);return n=>{for(const i of t){if(i==="")break;n=n&&n[i]}return n}}function _V(e){const t=e.split("."),n=[];let i="";for(const s of t)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(n.push(i),i="");return n}function Jy(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Hn=e=>typeof e<"u",Xs=e=>typeof e=="function",D1=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function wV(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const qt=Math.PI,Nt=2*qt,kV=Nt+qt,Zd=Number.POSITIVE_INFINITY,SV=qt/180,ae=qt/2,Ta=qt/4,E1=qt*2/3,jn=Math.log10,_i=Math.sign;function A1(e){const t=Math.round(e);e=_l(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(jn(e))),i=e/n;return(i<=1?1:i<=2?2:i<=5?5:10)*n}function MV(e){const t=[],n=Math.sqrt(e);let i;for(i=1;is-r).pop(),t}function ta(e){return!isNaN(parseFloat(e))&&isFinite(e)}function _l(e,t,n){return Math.abs(e-t)=e}function gP(e,t,n){let i,s,r;for(i=0,s=e.length;il&&c=Math.min(t,n)-i&&e<=Math.max(t,n)+i}function e0(e,t,n){n=n||(o=>e[o]1;)r=s+i>>1,n(r)?s=r:i=r;return{lo:s,hi:i}}const Xi=(e,t,n,i)=>e0(e,n,i?s=>e[s][t]<=n:s=>e[s][t]e0(e,n,i=>e[i][t]>=n);function EV(e,t,n){let i=0,s=e.length;for(;ii&&e[s-1]>n;)s--;return i>0||s{const i="_onData"+Jy(n),s=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...r){const o=s.apply(this,r);return e._chartjs.listeners.forEach(a=>{typeof a[i]=="function"&&a[i](...r)}),o}})})}function L1(e,t){const n=e._chartjs;if(!n)return;const i=n.listeners,s=i.indexOf(t);s!==-1&&i.splice(s,1),!(i.length>0)&&(vP.forEach(r=>{delete e[r]}),delete e._chartjs)}function xP(e){const t=new Set;let n,i;for(n=0,i=e.length;n"u"?function(e){return e()}:window.requestAnimationFrame}();function _P(e,t,n){const i=n||(o=>Array.prototype.slice.call(o));let s=!1,r=[];return function(...o){r=i(o),s||(s=!0,bP.call(window,()=>{s=!1,e.apply(t,r)}))}}function OV(e,t){let n;return function(...i){return t?(clearTimeout(n),n=setTimeout(e,t,i)):e.apply(this,i),t}}const n0=e=>e==="start"?"left":e==="end"?"right":"center",$e=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,LV=(e,t,n,i)=>e===(i?"left":"right")?n:e==="center"?(t+n)/2:t;function wP(e,t,n){const i=t.length;let s=0,r=i;if(e._sorted){const{iScale:o,_parsed:a}=e,l=o.axis,{min:c,max:u,minDefined:d,maxDefined:h}=o.getUserBounds();d&&(s=ke(Math.min(Xi(a,o.axis,c).lo,n?i:Xi(t,l,o.getPixelForValue(c)).lo),0,i-1)),h?r=ke(Math.max(Xi(a,o.axis,u,!0).hi+1,n?0:Xi(t,l,o.getPixelForValue(u),!0).hi+1),s,i)-s:r=i-s}return{start:s,count:r}}function kP(e){const{xScale:t,yScale:n,_scaleRanges:i}=e,s={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!i)return e._scaleRanges=s,!0;const r=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==n.min||i.ymax!==n.max;return Object.assign(i,s),r}const yu=e=>e===0||e===1,R1=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*Nt/n)),N1=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*Nt/n)+1,wl={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*ae)+1,easeOutSine:e=>Math.sin(e*ae),easeInOutSine:e=>-.5*(Math.cos(qt*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=>yu(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=>yu(e)?e:R1(e,.075,.3),easeOutElastic:e=>yu(e)?e:N1(e,.075,.3),easeInOutElastic(e){return yu(e)?e:e<.5?.5*R1(e*2,.1125,.45):.5+.5*N1(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-wl.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?wl.easeInBounce(e*2)*.5:wl.easeOutBounce(e*2-1)*.5+.5};/*! + */function Ei(){}const gV=function(){let e=0;return function(){return e++}}();function Mt(e){return e===null||typeof e>"u"}function Vt(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 yt(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}const de=e=>(typeof e=="number"||e instanceof Number)&&isFinite(+e);function On(e,t){return de(e)?e:t}function ut(e,t){return typeof e>"u"?t:e}const yV=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:e/t,pP=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function Ft(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function At(e,t,n,i){let s,r,o;if(Vt(e))if(r=e.length,i)for(s=r-1;s>=0;s--)t.call(n,e[s],s);else for(s=0;se,x:e=>e.x,y:e=>e.y};function Ys(e,t){return(T1[t]||(T1[t]=bV(t)))(e)}function bV(e){const t=_V(e);return n=>{for(const i of t){if(i==="")break;n=n&&n[i]}return n}}function _V(e){const t=e.split("."),n=[];let i="";for(const s of t)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(n.push(i),i="");return n}function Jy(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Hn=e=>typeof e<"u",Xs=e=>typeof e=="function",D1=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function wV(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const qt=Math.PI,Nt=2*qt,kV=Nt+qt,Zd=Number.POSITIVE_INFINITY,SV=qt/180,ae=qt/2,Ta=qt/4,E1=qt*2/3,jn=Math.log10,_i=Math.sign;function A1(e){const t=Math.round(e);e=wl(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(jn(e))),i=e/n;return(i<=1?1:i<=2?2:i<=5?5:10)*n}function MV(e){const t=[],n=Math.sqrt(e);let i;for(i=1;is-r).pop(),t}function ta(e){return!isNaN(parseFloat(e))&&isFinite(e)}function wl(e,t,n){return Math.abs(e-t)=e}function gP(e,t,n){let i,s,r;for(i=0,s=e.length;il&&c=Math.min(t,n)-i&&e<=Math.max(t,n)+i}function e0(e,t,n){n=n||(o=>e[o]1;)r=s+i>>1,n(r)?s=r:i=r;return{lo:s,hi:i}}const Xi=(e,t,n,i)=>e0(e,n,i?s=>e[s][t]<=n:s=>e[s][t]e0(e,n,i=>e[i][t]>=n);function EV(e,t,n){let i=0,s=e.length;for(;ii&&e[s-1]>n;)s--;return i>0||s{const i="_onData"+Jy(n),s=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...r){const o=s.apply(this,r);return e._chartjs.listeners.forEach(a=>{typeof a[i]=="function"&&a[i](...r)}),o}})})}function R1(e,t){const n=e._chartjs;if(!n)return;const i=n.listeners,s=i.indexOf(t);s!==-1&&i.splice(s,1),!(i.length>0)&&(vP.forEach(r=>{delete e[r]}),delete e._chartjs)}function xP(e){const t=new Set;let n,i;for(n=0,i=e.length;n"u"?function(e){return e()}:window.requestAnimationFrame}();function _P(e,t,n){const i=n||(o=>Array.prototype.slice.call(o));let s=!1,r=[];return function(...o){r=i(o),s||(s=!0,bP.call(window,()=>{s=!1,e.apply(t,r)}))}}function OV(e,t){let n;return function(...i){return t?(clearTimeout(n),n=setTimeout(e,t,i)):e.apply(this,i),t}}const n0=e=>e==="start"?"left":e==="end"?"right":"center",$e=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,RV=(e,t,n,i)=>e===(i?"left":"right")?n:e==="center"?(t+n)/2:t;function wP(e,t,n){const i=t.length;let s=0,r=i;if(e._sorted){const{iScale:o,_parsed:a}=e,l=o.axis,{min:c,max:u,minDefined:d,maxDefined:h}=o.getUserBounds();d&&(s=ke(Math.min(Xi(a,o.axis,c).lo,n?i:Xi(t,l,o.getPixelForValue(c)).lo),0,i-1)),h?r=ke(Math.max(Xi(a,o.axis,u,!0).hi+1,n?0:Xi(t,l,o.getPixelForValue(u),!0).hi+1),s,i)-s:r=i-s}return{start:s,count:r}}function kP(e){const{xScale:t,yScale:n,_scaleRanges:i}=e,s={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!i)return e._scaleRanges=s,!0;const r=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==n.min||i.ymax!==n.max;return Object.assign(i,s),r}const vu=e=>e===0||e===1,L1=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*Nt/n)),N1=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*Nt/n)+1,kl={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*ae)+1,easeOutSine:e=>Math.sin(e*ae),easeInOutSine:e=>-.5*(Math.cos(qt*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=>vu(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=>vu(e)?e:L1(e,.075,.3),easeOutElastic:e=>vu(e)?e:N1(e,.075,.3),easeInOutElastic(e){return vu(e)?e:e<.5?.5*L1(e*2,.1125,.45):.5+.5*N1(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-kl.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?kl.easeInBounce(e*2)*.5:kl.easeOutBounce(e*2-1)*.5+.5};/*! * @kurkle/color v0.2.1 * https://github.com/kurkle/color#readme * (c) 2022 Jukka Kurkela * Released under the MIT License - */function _c(e){return e+.5|0}const Cs=(e,t,n)=>Math.max(Math.min(e,n),t);function Za(e){return Cs(_c(e*2.55),0,255)}function Fs(e){return Cs(_c(e*255),0,255)}function Ii(e){return Cs(_c(e/2.55)/100,0,1)}function j1(e){return Cs(_c(e*100),0,100)}const En={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Hm=[..."0123456789ABCDEF"],RV=e=>Hm[e&15],NV=e=>Hm[(e&240)>>4]+Hm[e&15],vu=e=>(e&240)>>4===(e&15),jV=e=>vu(e.r)&&vu(e.g)&&vu(e.b)&&vu(e.a);function $V(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&En[e[1]]*17,g:255&En[e[2]]*17,b:255&En[e[3]]*17,a:t===5?En[e[4]]*17:255}:(t===7||t===9)&&(n={r:En[e[1]]<<4|En[e[2]],g:En[e[3]]<<4|En[e[4]],b:En[e[5]]<<4|En[e[6]],a:t===9?En[e[7]]<<4|En[e[8]]:255})),n}const IV=(e,t)=>e<255?t(e):"";function FV(e){var t=jV(e)?RV:NV;return e?"#"+t(e.r)+t(e.g)+t(e.b)+IV(e.a,t):void 0}const BV=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function SP(e,t,n){const i=t*Math.min(n,1-n),s=(r,o=(r+e/30)%12)=>n-i*Math.max(Math.min(o-3,9-o,1),-1);return[s(0),s(8),s(4)]}function VV(e,t,n){const i=(s,r=(s+e/60)%6)=>n-n*t*Math.max(Math.min(r,4-r,1),0);return[i(5),i(3),i(1)]}function zV(e,t,n){const i=SP(e,1,.5);let s;for(t+n>1&&(s=1/(t+n),t*=s,n*=s),s=0;s<3;s++)i[s]*=1-t-n,i[s]+=t;return i}function WV(e,t,n,i,s){return e===s?(t-n)/i+(t.5?u/(2-r-o):u/(r+o),l=WV(n,i,s,u,r),l=l*60+.5),[l|0,c||0,a]}function s0(e,t,n,i){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,i)).map(Fs)}function r0(e,t,n){return s0(SP,e,t,n)}function HV(e,t,n){return s0(zV,e,t,n)}function UV(e,t,n){return s0(VV,e,t,n)}function MP(e){return(e%360+360)%360}function YV(e){const t=BV.exec(e);let n=255,i;if(!t)return;t[5]!==i&&(n=t[6]?Za(+t[5]):Fs(+t[5]));const s=MP(+t[2]),r=+t[3]/100,o=+t[4]/100;return t[1]==="hwb"?i=HV(s,r,o):t[1]==="hsv"?i=UV(s,r,o):i=r0(s,r,o),{r:i[0],g:i[1],b:i[2],a:n}}function XV(e,t){var n=i0(e);n[0]=MP(n[0]+t),n=r0(n),e.r=n[0],e.g=n[1],e.b=n[2]}function KV(e){if(!e)return;const t=i0(e),n=t[0],i=j1(t[1]),s=j1(t[2]);return e.a<255?`hsla(${n}, ${i}%, ${s}%, ${Ii(e.a)})`:`hsl(${n}, ${i}%, ${s}%)`}const $1={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},I1={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function GV(){const e={},t=Object.keys(I1),n=Object.keys($1);let i,s,r,o,a;for(i=0;i>16&255,r>>8&255,r&255]}return e}let xu;function qV(e){xu||(xu=GV(),xu.transparent=[0,0,0,0]);const t=xu[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const QV=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function ZV(e){const t=QV.exec(e);let n=255,i,s,r;if(t){if(t[7]!==i){const o=+t[7];n=t[8]?Za(o):Cs(o*255,0,255)}return i=+t[1],s=+t[3],r=+t[5],i=255&(t[2]?Za(i):Cs(i,0,255)),s=255&(t[4]?Za(s):Cs(s,0,255)),r=255&(t[6]?Za(r):Cs(r,0,255)),{r:i,g:s,b:r,a:n}}}function JV(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${Ii(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const rp=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,Jr=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function tz(e,t,n){const i=Jr(Ii(e.r)),s=Jr(Ii(e.g)),r=Jr(Ii(e.b));return{r:Fs(rp(i+n*(Jr(Ii(t.r))-i))),g:Fs(rp(s+n*(Jr(Ii(t.g))-s))),b:Fs(rp(r+n*(Jr(Ii(t.b))-r))),a:e.a+n*(t.a-e.a)}}function bu(e,t,n){if(e){let i=i0(e);i[t]=Math.max(0,Math.min(i[t]+i[t]*n,t===0?360:1)),i=r0(i),e.r=i[0],e.g=i[1],e.b=i[2]}}function CP(e,t){return e&&Object.assign(t||{},e)}function F1(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=Fs(e[3]))):(t=CP(e,{r:0,g:0,b:0,a:1}),t.a=Fs(t.a)),t}function ez(e){return e.charAt(0)==="r"?ZV(e):YV(e)}class Jd{constructor(t){if(t instanceof Jd)return t;const n=typeof t;let i;n==="object"?i=F1(t):n==="string"&&(i=$V(t)||qV(t)||ez(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=CP(this._rgb);return t&&(t.a=Ii(t.a)),t}set rgb(t){this._rgb=F1(t)}rgbString(){return this._valid?JV(this._rgb):void 0}hexString(){return this._valid?FV(this._rgb):void 0}hslString(){return this._valid?KV(this._rgb):void 0}mix(t,n){if(t){const i=this.rgb,s=t.rgb;let r;const o=n===r?.5:n,a=2*o-1,l=i.a-s.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;r=1-c,i.r=255&c*i.r+r*s.r+.5,i.g=255&c*i.g+r*s.g+.5,i.b=255&c*i.b+r*s.b+.5,i.a=o*i.a+(1-o)*s.a,this.rgb=i}return this}interpolate(t,n){return t&&(this._rgb=tz(this._rgb,t._rgb,n)),this}clone(){return new Jd(this.rgb)}alpha(t){return this._rgb.a=Fs(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=_c(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=n,this}opaquer(t){const n=this._rgb;return n.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return bu(this._rgb,2,t),this}darken(t){return bu(this._rgb,2,-t),this}saturate(t){return bu(this._rgb,1,t),this}desaturate(t){return bu(this._rgb,1,-t),this}rotate(t){return XV(this._rgb,t),this}}function PP(e){return new Jd(e)}function TP(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function B1(e){return TP(e)?e:PP(e)}function op(e){return TP(e)?e:PP(e).saturate(.5).darken(.1).hexString()}const Vr=Object.create(null),Um=Object.create(null);function kl(e,t){if(!t)return e;const n=t.split(".");for(let i=0,s=n.length;in.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=(n,i)=>op(i.backgroundColor),this.hoverBorderColor=(n,i)=>op(i.borderColor),this.hoverColor=(n,i)=>op(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)}set(t,n){return ap(this,t,n)}get(t){return kl(this,t)}describe(t,n){return ap(Um,t,n)}override(t,n){return ap(Vr,t,n)}route(t,n,i,s){const r=kl(this,t),o=kl(this,i),a="_"+n;Object.defineProperties(r,{[a]:{value:r[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],c=o[s];return yt(l)?Object.assign({},c,l):ut(l,c)},set(l){this[a]=l}}})}}var _t=new nz({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function iz(e){return!e||Mt(e.size)||Mt(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function th(e,t,n,i,s){let r=t[s];return r||(r=t[s]=e.measureText(s).width,n.push(s)),r>i&&(i=r),i}function sz(e,t,n,i){i=i||{};let s=i.data=i.data||{},r=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(s=i.data={},r=i.garbageCollect=[],i.font=t),e.save(),e.font=t;let o=0;const a=n.length;let l,c,u,d,h;for(l=0;ln.length){for(l=0;l0&&e.stroke()}}function tc(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.xt.top-n&&e.y0&&r.strokeColor!=="";let l,c;for(e.save(),e.font=s.string,az(e,r),l=0;l+e||0;function o0(e,t){const n={},i=yt(t),s=i?Object.keys(t):t,r=yt(e)?i?o=>ut(e[o],e[t[o]]):o=>e[o]:()=>e;for(const o of s)n[o]=hz(r(o));return n}function EP(e){return o0(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Er(e){return o0(e,["topLeft","topRight","bottomLeft","bottomRight"])}function ze(e){const t=EP(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function be(e,t){e=e||{},t=t||_t.font;let n=ut(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let i=ut(e.style,t.style);i&&!(""+i).match(uz)&&(console.warn('Invalid font style specified: "'+i+'"'),i="");const s={family:ut(e.family,t.family),lineHeight:dz(ut(e.lineHeight,t.lineHeight),n),size:n,style:i,weight:ut(e.weight,t.weight),string:""};return s.string=iz(s),s}function Ja(e,t,n,i){let s=!0,r,o,a;for(r=0,o=e.length;rn&&a===0?0:a+l;return{min:o(i,-Math.abs(r)),max:o(s,r)}}function er(e,t){return Object.assign(Object.create(e),t)}function a0(e,t=[""],n=e,i,s=()=>e[0]){Hn(i)||(i=RP("_fallback",e));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:n,_fallback:i,_getTarget:s,override:o=>a0([o,...e],t,n,i)};return new Proxy(r,{deleteProperty(o,a){return delete o[a],delete o._keys,delete e[0][a],!0},get(o,a){return OP(o,a,()=>_z(a,t,e,o))},getOwnPropertyDescriptor(o,a){return Reflect.getOwnPropertyDescriptor(o._scopes[0],a)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(o,a){return W1(o).includes(a)},ownKeys(o){return W1(o)},set(o,a,l){const c=o._storage||(o._storage=s());return o[a]=c[a]=l,delete o._keys,!0}})}function ea(e,t,n,i){const s={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:AP(e,i),setContext:r=>ea(e,r,n,i),override:r=>ea(e.override(r),t,n,i)};return new Proxy(s,{deleteProperty(r,o){return delete r[o],delete e[o],!0},get(r,o,a){return OP(r,o,()=>mz(r,o,a))},getOwnPropertyDescriptor(r,o){return r._descriptors.allKeys?Reflect.has(e,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,o)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(r,o){return Reflect.has(e,o)},ownKeys(){return Reflect.ownKeys(e)},set(r,o,a){return e[o]=a,delete r[o],!0}})}function AP(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:i=t.indexable,_allKeys:s=t.allKeys}=e;return{allKeys:s,scriptable:n,indexable:i,isScriptable:Xs(n)?n:()=>n,isIndexable:Xs(i)?i:()=>i}}const pz=(e,t)=>e?e+Jy(t):t,l0=(e,t)=>yt(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function OP(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];const i=n();return e[t]=i,i}function mz(e,t,n){const{_proxy:i,_context:s,_subProxy:r,_descriptors:o}=e;let a=i[t];return Xs(a)&&o.isScriptable(t)&&(a=gz(t,a,e,n)),Vt(a)&&a.length&&(a=yz(t,a,e,o.isIndexable)),l0(t,a)&&(a=ea(a,s,r&&r[t],o)),a}function gz(e,t,n,i){const{_proxy:s,_context:r,_subProxy:o,_stack:a}=n;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);return a.add(e),t=t(r,o||i),a.delete(e),l0(e,t)&&(t=c0(s._scopes,s,e,t)),t}function yz(e,t,n,i){const{_proxy:s,_context:r,_subProxy:o,_descriptors:a}=n;if(Hn(r.index)&&i(e))t=t[r.index%t.length];else if(yt(t[0])){const l=t,c=s._scopes.filter(u=>u!==l);t=[];for(const u of l){const d=c0(c,s,e,u);t.push(ea(d,r,o&&o[e],a))}}return t}function LP(e,t,n){return Xs(e)?e(t,n):e}const vz=(e,t)=>e===!0?t:typeof e=="string"?Ys(t,e):void 0;function xz(e,t,n,i,s){for(const r of t){const o=vz(n,r);if(o){e.add(o);const a=LP(o._fallback,n,s);if(Hn(a)&&a!==n&&a!==i)return a}else if(o===!1&&Hn(i)&&n!==i)return null}return!1}function c0(e,t,n,i){const s=t._rootScopes,r=LP(t._fallback,n,i),o=[...e,...s],a=new Set;a.add(i);let l=z1(a,o,n,r||n,i);return l===null||Hn(r)&&r!==n&&(l=z1(a,o,r,l,i),l===null)?!1:a0(Array.from(a),[""],s,r,()=>bz(t,n,i))}function z1(e,t,n,i,s){for(;n;)n=xz(e,t,n,i,s);return n}function bz(e,t,n){const i=e._getTarget();t in i||(i[t]={});const s=i[t];return Vt(s)&&yt(n)?n:s}function _z(e,t,n,i){let s;for(const r of t)if(s=RP(pz(r,e),n),Hn(s))return l0(e,s)?c0(n,i,e,s):s}function RP(e,t){for(const n of t){if(!n)continue;const i=n[e];if(Hn(i))return i}}function W1(e){let t=e._keys;return t||(t=e._keys=wz(e._scopes)),t}function wz(e){const t=new Set;for(const n of e)for(const i of Object.keys(n).filter(s=>!s.startsWith("_")))t.add(i);return Array.from(t)}function NP(e,t,n,i){const{iScale:s}=e,{key:r="r"}=this._parsing,o=new Array(i);let a,l,c,u;for(a=0,l=i;ate==="x"?"y":"x";function Sz(e,t,n,i){const s=e.skip?t:e,r=t,o=n.skip?t:n,a=Wm(r,s),l=Wm(o,r);let c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const d=i*c,h=i*u;return{previous:{x:r.x-d*(o.x-s.x),y:r.y-d*(o.y-s.y)},next:{x:r.x+h*(o.x-s.x),y:r.y+h*(o.y-s.y)}}}function Mz(e,t,n){const i=e.length;let s,r,o,a,l,c=na(e,0);for(let u=0;u!c.skip)),t.cubicInterpolationMode==="monotone")Pz(e,s);else{let c=i?e[e.length-1]:e[0];for(r=0,o=e.length;rwindow.getComputedStyle(e,null);function Ez(e,t){return Wh(e).getPropertyValue(t)}const Az=["top","right","bottom","left"];function Ar(e,t,n){const i={};n=n?"-"+n:"";for(let s=0;s<4;s++){const r=Az[s];i[r]=parseFloat(e[t+"-"+r+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Oz=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function Lz(e,t){const n=e.touches,i=n&&n.length?n[0]:e,{offsetX:s,offsetY:r}=i;let o=!1,a,l;if(Oz(s,r,e.target))a=s,l=r;else{const c=t.getBoundingClientRect();a=i.clientX-c.left,l=i.clientY-c.top,o=!0}return{x:a,y:l,box:o}}function vr(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:i}=t,s=Wh(n),r=s.boxSizing==="border-box",o=Ar(s,"padding"),a=Ar(s,"border","width"),{x:l,y:c,box:u}=Lz(e,n),d=o.left+(u&&a.left),h=o.top+(u&&a.top);let{width:f,height:p}=t;return r&&(f-=o.width+a.width,p-=o.height+a.height),{x:Math.round((l-d)/f*n.width/i),y:Math.round((c-h)/p*n.height/i)}}function Rz(e,t,n){let i,s;if(t===void 0||n===void 0){const r=u0(e);if(!r)t=e.clientWidth,n=e.clientHeight;else{const o=r.getBoundingClientRect(),a=Wh(r),l=Ar(a,"border","width"),c=Ar(a,"padding");t=o.width-c.width-l.width,n=o.height-c.height-l.height,i=eh(a.maxWidth,r,"clientWidth"),s=eh(a.maxHeight,r,"clientHeight")}}return{width:t,height:n,maxWidth:i||Zd,maxHeight:s||Zd}}const lp=e=>Math.round(e*10)/10;function Nz(e,t,n,i){const s=Wh(e),r=Ar(s,"margin"),o=eh(s.maxWidth,e,"clientWidth")||Zd,a=eh(s.maxHeight,e,"clientHeight")||Zd,l=Rz(e,t,n);let{width:c,height:u}=l;if(s.boxSizing==="content-box"){const d=Ar(s,"border","width"),h=Ar(s,"padding");c-=h.width+d.width,u-=h.height+d.height}return c=Math.max(0,c-r.width),u=Math.max(0,i?Math.floor(c/i):u-r.height),c=lp(Math.min(c,o,l.maxWidth)),u=lp(Math.min(u,a,l.maxHeight)),c&&!u&&(u=lp(c/2)),{width:c,height:u}}function H1(e,t,n){const i=t||1,s=Math.floor(e.height*i),r=Math.floor(e.width*i);e.height=s/i,e.width=r/i;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!==i||o.height!==s||o.width!==r?(e.currentDevicePixelRatio=i,o.height=s,o.width=r,e.ctx.setTransform(i,0,0,i,0,0),!0):!1}const jz=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch{}return e}();function U1(e,t){const n=Ez(e,t),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function xr(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function $z(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:i==="middle"?n<.5?e.y:t.y:i==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function Iz(e,t,n,i){const s={x:e.cp2x,y:e.cp2y},r={x:t.cp1x,y:t.cp1y},o=xr(e,s,n),a=xr(s,r,n),l=xr(r,t,n),c=xr(o,a,n),u=xr(a,l,n);return xr(c,u,n)}const Y1=new Map;function Fz(e,t){t=t||{};const n=e+JSON.stringify(t);let i=Y1.get(n);return i||(i=new Intl.NumberFormat(e,t),Y1.set(n,i)),i}function wc(e,t,n){return Fz(t,n).format(e)}const Bz=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,i){return n-i},leftForLtr(n,i){return n-i}}},Vz=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function Lo(e,t,n){return e?Bz(t,n):Vz()}function IP(e,t){let n,i;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,i=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=i)}function FP(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function BP(e){return e==="angle"?{between:Jl,compare:PV,normalize:vn}:{between:Yi,compare:(t,n)=>t-n,normalize:t=>t}}function X1({start:e,end:t,count:n,loop:i,style:s}){return{start:e%n,end:t%n,loop:i&&(t-e+1)%n===0,style:s}}function zz(e,t,n){const{property:i,start:s,end:r}=n,{between:o,normalize:a}=BP(i),l=t.length;let{start:c,end:u,loop:d}=e,h,f;if(d){for(c+=l,u+=l,h=0,f=l;hl(s,x,y)&&a(s,x)!==0,w=()=>a(r,y)===0||l(r,x,y),S=()=>m||_(),C=()=>!m||w();for(let M=u,P=u;M<=d;++M)g=t[M%o],!g.skip&&(y=c(g[i]),y!==x&&(m=l(y,s,r),v===null&&S()&&(v=a(y,s)===0?M:P),v!==null&&C()&&(p.push(X1({start:v,end:M,loop:h,count:o,style:f})),v=null),P=M,x=y));return v!==null&&p.push(X1({start:v,end:d,loop:h,count:o,style:f})),p}function zP(e,t){const n=[],i=e.segments;for(let s=0;ss&&e[r%t].skip;)r--;return r%=t,{start:s,end:r}}function Hz(e,t,n,i){const s=e.length,r=[];let o=t,a=e[t],l;for(l=t+1;l<=n;++l){const c=e[l%s];c.skip||c.stop?a.skip||(i=!1,r.push({start:t%s,end:(l-1)%s,loop:i}),t=o=c.stop?l:null):(o=l,a.skip&&(t=l)),a=c}return o!==null&&r.push({start:t%s,end:o%s,loop:i}),r}function Uz(e,t){const n=e.points,i=e.options.spanGaps,s=n.length;if(!s)return[];const r=!!e._loop,{start:o,end:a}=Wz(n,s,r,i);if(i===!0)return K1(e,[{start:o,end:a,loop:r}],n,t);const l=aMath.max(Math.min(e,n),t);function Za(e){return Cs(wc(e*2.55),0,255)}function Fs(e){return Cs(wc(e*255),0,255)}function Ii(e){return Cs(wc(e/2.55)/100,0,1)}function j1(e){return Cs(wc(e*100),0,100)}const En={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Hm=[..."0123456789ABCDEF"],LV=e=>Hm[e&15],NV=e=>Hm[(e&240)>>4]+Hm[e&15],xu=e=>(e&240)>>4===(e&15),jV=e=>xu(e.r)&&xu(e.g)&&xu(e.b)&&xu(e.a);function $V(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&En[e[1]]*17,g:255&En[e[2]]*17,b:255&En[e[3]]*17,a:t===5?En[e[4]]*17:255}:(t===7||t===9)&&(n={r:En[e[1]]<<4|En[e[2]],g:En[e[3]]<<4|En[e[4]],b:En[e[5]]<<4|En[e[6]],a:t===9?En[e[7]]<<4|En[e[8]]:255})),n}const IV=(e,t)=>e<255?t(e):"";function FV(e){var t=jV(e)?LV:NV;return e?"#"+t(e.r)+t(e.g)+t(e.b)+IV(e.a,t):void 0}const BV=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function SP(e,t,n){const i=t*Math.min(n,1-n),s=(r,o=(r+e/30)%12)=>n-i*Math.max(Math.min(o-3,9-o,1),-1);return[s(0),s(8),s(4)]}function VV(e,t,n){const i=(s,r=(s+e/60)%6)=>n-n*t*Math.max(Math.min(r,4-r,1),0);return[i(5),i(3),i(1)]}function zV(e,t,n){const i=SP(e,1,.5);let s;for(t+n>1&&(s=1/(t+n),t*=s,n*=s),s=0;s<3;s++)i[s]*=1-t-n,i[s]+=t;return i}function WV(e,t,n,i,s){return e===s?(t-n)/i+(t.5?u/(2-r-o):u/(r+o),l=WV(n,i,s,u,r),l=l*60+.5),[l|0,c||0,a]}function s0(e,t,n,i){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,i)).map(Fs)}function r0(e,t,n){return s0(SP,e,t,n)}function HV(e,t,n){return s0(zV,e,t,n)}function UV(e,t,n){return s0(VV,e,t,n)}function MP(e){return(e%360+360)%360}function YV(e){const t=BV.exec(e);let n=255,i;if(!t)return;t[5]!==i&&(n=t[6]?Za(+t[5]):Fs(+t[5]));const s=MP(+t[2]),r=+t[3]/100,o=+t[4]/100;return t[1]==="hwb"?i=HV(s,r,o):t[1]==="hsv"?i=UV(s,r,o):i=r0(s,r,o),{r:i[0],g:i[1],b:i[2],a:n}}function XV(e,t){var n=i0(e);n[0]=MP(n[0]+t),n=r0(n),e.r=n[0],e.g=n[1],e.b=n[2]}function KV(e){if(!e)return;const t=i0(e),n=t[0],i=j1(t[1]),s=j1(t[2]);return e.a<255?`hsla(${n}, ${i}%, ${s}%, ${Ii(e.a)})`:`hsl(${n}, ${i}%, ${s}%)`}const $1={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},I1={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function GV(){const e={},t=Object.keys(I1),n=Object.keys($1);let i,s,r,o,a;for(i=0;i>16&255,r>>8&255,r&255]}return e}let bu;function qV(e){bu||(bu=GV(),bu.transparent=[0,0,0,0]);const t=bu[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const QV=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function ZV(e){const t=QV.exec(e);let n=255,i,s,r;if(t){if(t[7]!==i){const o=+t[7];n=t[8]?Za(o):Cs(o*255,0,255)}return i=+t[1],s=+t[3],r=+t[5],i=255&(t[2]?Za(i):Cs(i,0,255)),s=255&(t[4]?Za(s):Cs(s,0,255)),r=255&(t[6]?Za(r):Cs(r,0,255)),{r:i,g:s,b:r,a:n}}}function JV(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${Ii(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const rp=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,Jr=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function tz(e,t,n){const i=Jr(Ii(e.r)),s=Jr(Ii(e.g)),r=Jr(Ii(e.b));return{r:Fs(rp(i+n*(Jr(Ii(t.r))-i))),g:Fs(rp(s+n*(Jr(Ii(t.g))-s))),b:Fs(rp(r+n*(Jr(Ii(t.b))-r))),a:e.a+n*(t.a-e.a)}}function _u(e,t,n){if(e){let i=i0(e);i[t]=Math.max(0,Math.min(i[t]+i[t]*n,t===0?360:1)),i=r0(i),e.r=i[0],e.g=i[1],e.b=i[2]}}function CP(e,t){return e&&Object.assign(t||{},e)}function F1(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=Fs(e[3]))):(t=CP(e,{r:0,g:0,b:0,a:1}),t.a=Fs(t.a)),t}function ez(e){return e.charAt(0)==="r"?ZV(e):YV(e)}class Jd{constructor(t){if(t instanceof Jd)return t;const n=typeof t;let i;n==="object"?i=F1(t):n==="string"&&(i=$V(t)||qV(t)||ez(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=CP(this._rgb);return t&&(t.a=Ii(t.a)),t}set rgb(t){this._rgb=F1(t)}rgbString(){return this._valid?JV(this._rgb):void 0}hexString(){return this._valid?FV(this._rgb):void 0}hslString(){return this._valid?KV(this._rgb):void 0}mix(t,n){if(t){const i=this.rgb,s=t.rgb;let r;const o=n===r?.5:n,a=2*o-1,l=i.a-s.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;r=1-c,i.r=255&c*i.r+r*s.r+.5,i.g=255&c*i.g+r*s.g+.5,i.b=255&c*i.b+r*s.b+.5,i.a=o*i.a+(1-o)*s.a,this.rgb=i}return this}interpolate(t,n){return t&&(this._rgb=tz(this._rgb,t._rgb,n)),this}clone(){return new Jd(this.rgb)}alpha(t){return this._rgb.a=Fs(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=wc(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=n,this}opaquer(t){const n=this._rgb;return n.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return _u(this._rgb,2,t),this}darken(t){return _u(this._rgb,2,-t),this}saturate(t){return _u(this._rgb,1,t),this}desaturate(t){return _u(this._rgb,1,-t),this}rotate(t){return XV(this._rgb,t),this}}function PP(e){return new Jd(e)}function TP(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function B1(e){return TP(e)?e:PP(e)}function op(e){return TP(e)?e:PP(e).saturate(.5).darken(.1).hexString()}const Vr=Object.create(null),Um=Object.create(null);function Sl(e,t){if(!t)return e;const n=t.split(".");for(let i=0,s=n.length;in.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=(n,i)=>op(i.backgroundColor),this.hoverBorderColor=(n,i)=>op(i.borderColor),this.hoverColor=(n,i)=>op(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)}set(t,n){return ap(this,t,n)}get(t){return Sl(this,t)}describe(t,n){return ap(Um,t,n)}override(t,n){return ap(Vr,t,n)}route(t,n,i,s){const r=Sl(this,t),o=Sl(this,i),a="_"+n;Object.defineProperties(r,{[a]:{value:r[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],c=o[s];return yt(l)?Object.assign({},c,l):ut(l,c)},set(l){this[a]=l}}})}}var _t=new nz({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function iz(e){return!e||Mt(e.size)||Mt(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function th(e,t,n,i,s){let r=t[s];return r||(r=t[s]=e.measureText(s).width,n.push(s)),r>i&&(i=r),i}function sz(e,t,n,i){i=i||{};let s=i.data=i.data||{},r=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(s=i.data={},r=i.garbageCollect=[],i.font=t),e.save(),e.font=t;let o=0;const a=n.length;let l,c,u,d,h;for(l=0;ln.length){for(l=0;l0&&e.stroke()}}function ec(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.xt.top-n&&e.y0&&r.strokeColor!=="";let l,c;for(e.save(),e.font=s.string,az(e,r),l=0;l+e||0;function o0(e,t){const n={},i=yt(t),s=i?Object.keys(t):t,r=yt(e)?i?o=>ut(e[o],e[t[o]]):o=>e[o]:()=>e;for(const o of s)n[o]=hz(r(o));return n}function EP(e){return o0(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Er(e){return o0(e,["topLeft","topRight","bottomLeft","bottomRight"])}function ze(e){const t=EP(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function be(e,t){e=e||{},t=t||_t.font;let n=ut(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let i=ut(e.style,t.style);i&&!(""+i).match(uz)&&(console.warn('Invalid font style specified: "'+i+'"'),i="");const s={family:ut(e.family,t.family),lineHeight:dz(ut(e.lineHeight,t.lineHeight),n),size:n,style:i,weight:ut(e.weight,t.weight),string:""};return s.string=iz(s),s}function Ja(e,t,n,i){let s=!0,r,o,a;for(r=0,o=e.length;rn&&a===0?0:a+l;return{min:o(i,-Math.abs(r)),max:o(s,r)}}function er(e,t){return Object.assign(Object.create(e),t)}function a0(e,t=[""],n=e,i,s=()=>e[0]){Hn(i)||(i=LP("_fallback",e));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:n,_fallback:i,_getTarget:s,override:o=>a0([o,...e],t,n,i)};return new Proxy(r,{deleteProperty(o,a){return delete o[a],delete o._keys,delete e[0][a],!0},get(o,a){return OP(o,a,()=>_z(a,t,e,o))},getOwnPropertyDescriptor(o,a){return Reflect.getOwnPropertyDescriptor(o._scopes[0],a)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(o,a){return W1(o).includes(a)},ownKeys(o){return W1(o)},set(o,a,l){const c=o._storage||(o._storage=s());return o[a]=c[a]=l,delete o._keys,!0}})}function ea(e,t,n,i){const s={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:AP(e,i),setContext:r=>ea(e,r,n,i),override:r=>ea(e.override(r),t,n,i)};return new Proxy(s,{deleteProperty(r,o){return delete r[o],delete e[o],!0},get(r,o,a){return OP(r,o,()=>mz(r,o,a))},getOwnPropertyDescriptor(r,o){return r._descriptors.allKeys?Reflect.has(e,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,o)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(r,o){return Reflect.has(e,o)},ownKeys(){return Reflect.ownKeys(e)},set(r,o,a){return e[o]=a,delete r[o],!0}})}function AP(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:i=t.indexable,_allKeys:s=t.allKeys}=e;return{allKeys:s,scriptable:n,indexable:i,isScriptable:Xs(n)?n:()=>n,isIndexable:Xs(i)?i:()=>i}}const pz=(e,t)=>e?e+Jy(t):t,l0=(e,t)=>yt(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function OP(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];const i=n();return e[t]=i,i}function mz(e,t,n){const{_proxy:i,_context:s,_subProxy:r,_descriptors:o}=e;let a=i[t];return Xs(a)&&o.isScriptable(t)&&(a=gz(t,a,e,n)),Vt(a)&&a.length&&(a=yz(t,a,e,o.isIndexable)),l0(t,a)&&(a=ea(a,s,r&&r[t],o)),a}function gz(e,t,n,i){const{_proxy:s,_context:r,_subProxy:o,_stack:a}=n;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);return a.add(e),t=t(r,o||i),a.delete(e),l0(e,t)&&(t=c0(s._scopes,s,e,t)),t}function yz(e,t,n,i){const{_proxy:s,_context:r,_subProxy:o,_descriptors:a}=n;if(Hn(r.index)&&i(e))t=t[r.index%t.length];else if(yt(t[0])){const l=t,c=s._scopes.filter(u=>u!==l);t=[];for(const u of l){const d=c0(c,s,e,u);t.push(ea(d,r,o&&o[e],a))}}return t}function RP(e,t,n){return Xs(e)?e(t,n):e}const vz=(e,t)=>e===!0?t:typeof e=="string"?Ys(t,e):void 0;function xz(e,t,n,i,s){for(const r of t){const o=vz(n,r);if(o){e.add(o);const a=RP(o._fallback,n,s);if(Hn(a)&&a!==n&&a!==i)return a}else if(o===!1&&Hn(i)&&n!==i)return null}return!1}function c0(e,t,n,i){const s=t._rootScopes,r=RP(t._fallback,n,i),o=[...e,...s],a=new Set;a.add(i);let l=z1(a,o,n,r||n,i);return l===null||Hn(r)&&r!==n&&(l=z1(a,o,r,l,i),l===null)?!1:a0(Array.from(a),[""],s,r,()=>bz(t,n,i))}function z1(e,t,n,i,s){for(;n;)n=xz(e,t,n,i,s);return n}function bz(e,t,n){const i=e._getTarget();t in i||(i[t]={});const s=i[t];return Vt(s)&&yt(n)?n:s}function _z(e,t,n,i){let s;for(const r of t)if(s=LP(pz(r,e),n),Hn(s))return l0(e,s)?c0(n,i,e,s):s}function LP(e,t){for(const n of t){if(!n)continue;const i=n[e];if(Hn(i))return i}}function W1(e){let t=e._keys;return t||(t=e._keys=wz(e._scopes)),t}function wz(e){const t=new Set;for(const n of e)for(const i of Object.keys(n).filter(s=>!s.startsWith("_")))t.add(i);return Array.from(t)}function NP(e,t,n,i){const{iScale:s}=e,{key:r="r"}=this._parsing,o=new Array(i);let a,l,c,u;for(a=0,l=i;ate==="x"?"y":"x";function Sz(e,t,n,i){const s=e.skip?t:e,r=t,o=n.skip?t:n,a=Wm(r,s),l=Wm(o,r);let c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const d=i*c,h=i*u;return{previous:{x:r.x-d*(o.x-s.x),y:r.y-d*(o.y-s.y)},next:{x:r.x+h*(o.x-s.x),y:r.y+h*(o.y-s.y)}}}function Mz(e,t,n){const i=e.length;let s,r,o,a,l,c=na(e,0);for(let u=0;u!c.skip)),t.cubicInterpolationMode==="monotone")Pz(e,s);else{let c=i?e[e.length-1]:e[0];for(r=0,o=e.length;rwindow.getComputedStyle(e,null);function Ez(e,t){return Wh(e).getPropertyValue(t)}const Az=["top","right","bottom","left"];function Ar(e,t,n){const i={};n=n?"-"+n:"";for(let s=0;s<4;s++){const r=Az[s];i[r]=parseFloat(e[t+"-"+r+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Oz=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function Rz(e,t){const n=e.touches,i=n&&n.length?n[0]:e,{offsetX:s,offsetY:r}=i;let o=!1,a,l;if(Oz(s,r,e.target))a=s,l=r;else{const c=t.getBoundingClientRect();a=i.clientX-c.left,l=i.clientY-c.top,o=!0}return{x:a,y:l,box:o}}function vr(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:i}=t,s=Wh(n),r=s.boxSizing==="border-box",o=Ar(s,"padding"),a=Ar(s,"border","width"),{x:l,y:c,box:u}=Rz(e,n),d=o.left+(u&&a.left),h=o.top+(u&&a.top);let{width:f,height:p}=t;return r&&(f-=o.width+a.width,p-=o.height+a.height),{x:Math.round((l-d)/f*n.width/i),y:Math.round((c-h)/p*n.height/i)}}function Lz(e,t,n){let i,s;if(t===void 0||n===void 0){const r=u0(e);if(!r)t=e.clientWidth,n=e.clientHeight;else{const o=r.getBoundingClientRect(),a=Wh(r),l=Ar(a,"border","width"),c=Ar(a,"padding");t=o.width-c.width-l.width,n=o.height-c.height-l.height,i=eh(a.maxWidth,r,"clientWidth"),s=eh(a.maxHeight,r,"clientHeight")}}return{width:t,height:n,maxWidth:i||Zd,maxHeight:s||Zd}}const lp=e=>Math.round(e*10)/10;function Nz(e,t,n,i){const s=Wh(e),r=Ar(s,"margin"),o=eh(s.maxWidth,e,"clientWidth")||Zd,a=eh(s.maxHeight,e,"clientHeight")||Zd,l=Lz(e,t,n);let{width:c,height:u}=l;if(s.boxSizing==="content-box"){const d=Ar(s,"border","width"),h=Ar(s,"padding");c-=h.width+d.width,u-=h.height+d.height}return c=Math.max(0,c-r.width),u=Math.max(0,i?Math.floor(c/i):u-r.height),c=lp(Math.min(c,o,l.maxWidth)),u=lp(Math.min(u,a,l.maxHeight)),c&&!u&&(u=lp(c/2)),{width:c,height:u}}function H1(e,t,n){const i=t||1,s=Math.floor(e.height*i),r=Math.floor(e.width*i);e.height=s/i,e.width=r/i;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!==i||o.height!==s||o.width!==r?(e.currentDevicePixelRatio=i,o.height=s,o.width=r,e.ctx.setTransform(i,0,0,i,0,0),!0):!1}const jz=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch{}return e}();function U1(e,t){const n=Ez(e,t),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function xr(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function $z(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:i==="middle"?n<.5?e.y:t.y:i==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function Iz(e,t,n,i){const s={x:e.cp2x,y:e.cp2y},r={x:t.cp1x,y:t.cp1y},o=xr(e,s,n),a=xr(s,r,n),l=xr(r,t,n),c=xr(o,a,n),u=xr(a,l,n);return xr(c,u,n)}const Y1=new Map;function Fz(e,t){t=t||{};const n=e+JSON.stringify(t);let i=Y1.get(n);return i||(i=new Intl.NumberFormat(e,t),Y1.set(n,i)),i}function kc(e,t,n){return Fz(t,n).format(e)}const Bz=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,i){return n-i},leftForLtr(n,i){return n-i}}},Vz=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function Ro(e,t,n){return e?Bz(t,n):Vz()}function IP(e,t){let n,i;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,i=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=i)}function FP(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function BP(e){return e==="angle"?{between:tc,compare:PV,normalize:vn}:{between:Yi,compare:(t,n)=>t-n,normalize:t=>t}}function X1({start:e,end:t,count:n,loop:i,style:s}){return{start:e%n,end:t%n,loop:i&&(t-e+1)%n===0,style:s}}function zz(e,t,n){const{property:i,start:s,end:r}=n,{between:o,normalize:a}=BP(i),l=t.length;let{start:c,end:u,loop:d}=e,h,f;if(d){for(c+=l,u+=l,h=0,f=l;hl(s,x,y)&&a(s,x)!==0,w=()=>a(r,y)===0||l(r,x,y),S=()=>m||_(),C=()=>!m||w();for(let M=u,P=u;M<=d;++M)g=t[M%o],!g.skip&&(y=c(g[i]),y!==x&&(m=l(y,s,r),v===null&&S()&&(v=a(y,s)===0?M:P),v!==null&&C()&&(p.push(X1({start:v,end:M,loop:h,count:o,style:f})),v=null),P=M,x=y));return v!==null&&p.push(X1({start:v,end:d,loop:h,count:o,style:f})),p}function zP(e,t){const n=[],i=e.segments;for(let s=0;ss&&e[r%t].skip;)r--;return r%=t,{start:s,end:r}}function Hz(e,t,n,i){const s=e.length,r=[];let o=t,a=e[t],l;for(l=t+1;l<=n;++l){const c=e[l%s];c.skip||c.stop?a.skip||(i=!1,r.push({start:t%s,end:(l-1)%s,loop:i}),t=o=c.stop?l:null):(o=l,a.skip&&(t=l)),a=c}return o!==null&&r.push({start:t%s,end:o%s,loop:i}),r}function Uz(e,t){const n=e.points,i=e.options.spanGaps,s=n.length;if(!s)return[];const r=!!e._loop,{start:o,end:a}=Wz(n,s,r,i);if(i===!0)return K1(e,[{start:o,end:a,loop:r}],n,t);const l=aa({chart:t,initial:n.initial,numSteps:o,currentStep:Math.min(i-n.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=bP.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const r=i.items;let o=r.length-1,a=!1,l;for(;o>=0;--o)l=r[o],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),a=!0):(r[o]=r[r.length-1],r.pop());a&&(s.draw(),this._notify(s,i,t,"progress")),r.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),n+=r.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let i=n.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,i)),i}listen(t,n,i){this._getAnims(t).listeners[n].push(i)}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((i,s)=>Math.max(i,s._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 i=n.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Li=new Kz;const q1="transparent",Gz={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const i=B1(e||q1),s=i.valid&&B1(t||q1);return s&&s.valid?s.mix(i,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class qz{constructor(t,n,i,s){const r=n[i];s=Ja([t.to,s,r,t.from]);const o=Ja([t.from,r,s]);this._active=!0,this._fn=t.fn||Gz[t.type||typeof o],this._easing=wl[t.easing]||wl.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=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(t,n,i){if(this._active){this._notify(!1);const s=this._target[this._prop],r=i-this._start,o=this._duration-r;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=Ja([t.to,n,s,t.from]),this._from=Ja([t.from,s,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,i=this._duration,s=this._prop,r=this._from,o=this._loop,a=this._to;let l;if(this._active=r!==a&&(o||n1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(r,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,i)=>{t.push({res:n,rej:i})})}_notify(t){const n=t?"res":"rej",i=this._promises||[];for(let s=0;se!=="onProgress"&&e!=="onComplete"&&e!=="fn"});_t.set("animations",{colors:{type:"color",properties:Zz},numbers:{type:"number",properties:Qz}});_t.describe("animations",{_fallback:"animation"});_t.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:e=>e|0}}}});class WP{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!yt(t))return;const n=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const s=t[i];if(!yt(s))return;const r={};for(const o of Jz)r[o]=s[o];(Vt(s.properties)&&s.properties||[i]).forEach(o=>{(o===i||!n.has(o))&&n.set(o,r)})})}_animateOptions(t,n){const i=n.options,s=e5(t,i);if(!s)return[];const r=this._createAnimations(s,i);return i.$shared&&t5(t.options.$animations,i).then(()=>{t.options=i},()=>{}),r}_createAnimations(t,n){const i=this._properties,s=[],r=t.$animations||(t.$animations={}),o=Object.keys(n),a=Date.now();let l;for(l=o.length-1;l>=0;--l){const c=o[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,n));continue}const u=n[c];let d=r[c];const h=i.get(c);if(d)if(h&&d.active()){d.update(h,u,a);continue}else d.cancel();if(!h||!h.duration){t[c]=u;continue}r[c]=d=new qz(h,t,c,u),s.push(d)}return s}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const i=this._createAnimations(t,n);if(i.length)return Li.add(this._chart,i),!0}}function t5(e,t){const n=[],i=Object.keys(t);for(let s=0;s0||!n&&r<0)return s.index}return null}function e_(e,t){const{chart:n,_cachedMeta:i}=e,s=n._stacks||(n._stacks={}),{iScale:r,vScale:o,index:a}=i,l=r.axis,c=o.axis,u=r5(r,o,i),d=t.length;let h;for(let f=0;fn[i].axis===t).shift()}function l5(e,t){return er(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function c5(e,t,n){return er(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function Da(e,t){const n=e.controller.index,i=e.vScale&&e.vScale.axis;if(i){t=t||e._parsed;for(const s of t){const r=s._stacks;if(!r||r[i]===void 0||r[i][n]===void 0)return;delete r[i][n]}}}const up=e=>e==="reset"||e==="none",n_=(e,t)=>t?e:Object.assign({},e),u5=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:HP(n,!0),values:null};class ri{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.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=J1(t.vScale,t),this.addElements()}updateIndex(t){this.index!==t&&Da(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,i=this.getDataset(),s=(d,h,f,p)=>d==="x"?h:d==="r"?p:f,r=n.xAxisID=ut(i.xAxisID,cp(t,"x")),o=n.yAxisID=ut(i.yAxisID,cp(t,"y")),a=n.rAxisID=ut(i.rAxisID,cp(t,"r")),l=n.indexAxis,c=n.iAxisID=s(l,r,o,a),u=n.vAxisID=s(l,o,r,a);n.xScale=this.getScaleForId(r),n.yScale=this.getScaleForId(o),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(u)}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&&L1(this._data,this),t._stacked&&Da(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),i=this._data;if(yt(n))this._data=s5(n);else if(i!==n){if(i){L1(i,this);const s=this._cachedMeta;Da(s),s._parsed=[]}n&&Object.isExtensible(n)&&AV(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,i=this.getDataset();let s=!1;this._dataCheck();const r=n._stacked;n._stacked=J1(n.vScale,n),n.stack!==i.stack&&(s=!0,Da(n),n.stack=i.stack),this._resyncElements(t),(s||r!==n._stacked)&&e_(this,n._parsed)}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:i,_data:s}=this,{iScale:r,_stacked:o}=i,a=r.axis;let l=t===0&&n===s.length?!0:i._sorted,c=t>0&&i._parsed[t-1],u,d,h;if(this._parsing===!1)i._parsed=s,i._sorted=!0,h=s;else{Vt(s[t])?h=this.parseArrayData(i,s,t,n):yt(s[t])?h=this.parseObjectData(i,s,t,n):h=this.parsePrimitiveData(i,s,t,n);const f=()=>d[a]===null||c&&d[a]m||d=0;--h)if(!p()){this.updateRangeFromParsed(c,t,f,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,i=[];let s,r,o;for(s=0,r=n.length;s=0&&tthis.getContext(i,s),m=c.resolveNamedOptions(h,f,p,d);return m.$shared&&(m.$shared=l,r[o]=Object.freeze(n_(m,l))),m}_resolveAnimations(t,n,i){const s=this.chart,r=this._cachedDataOpts,o=`animation-${n}`,a=r[o];if(a)return a;let l;if(s.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,n),h=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(h,this.getContext(t,i,n))}const c=new WP(s,l&&l.animations);return l&&l._cacheable&&(r[o]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||up(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const i=this.resolveDataElementOptions(t,n),s=this._sharedOptions,r=this.getSharedOptions(i),o=this.includeOptions(n,r)||r!==s;return this.updateSharedOptions(r,n,i),{sharedOptions:r,includeOptions:o}}updateElement(t,n,i,s){up(s)?Object.assign(t,i):this._resolveAnimations(n,s).update(t,i)}updateSharedOptions(t,n,i){t&&!up(n)&&this._resolveAnimations(void 0,n).update(t,i)}_setStyle(t,n,i,s){t.active=s;const r=this.getStyle(n,s);this._resolveAnimations(n,i,s).update(t,{options:!s&&this.getSharedOptions(r)||r})}removeHoverStyle(t,n,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,n,i){this._setStyle(t,i,"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,i=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const s=i.length,r=n.length,o=Math.min(r,s);o&&this.parse(0,o),r>s?this._insertElements(s,r-s,t):r{for(c.length+=n,a=c.length-1;a>=o;a--)c[a]=c[a-n]};for(l(r),a=t;as-r))}return e._cache.$bar}function h5(e){const t=e.iScale,n=d5(t,e.type);let i=t._length,s,r,o,a;const l=()=>{o===32767||o===-32768||(Hn(a)&&(i=Math.min(i,Math.abs(o-a)||i)),a=o)};for(s=0,r=n.length;s0?s[e-1]:null,a=eMath.abs(a)&&(l=a,c=o),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:r,min:o,max:a}}function UP(e,t,n,i){return Vt(e)?m5(e,t,n,i):t[n.axis]=n.parse(e,i),t}function i_(e,t,n,i){const s=e.iScale,r=e.vScale,o=s.getLabels(),a=s===r,l=[];let c,u,d,h;for(c=n,u=n+i;c=n?1:-1)}function y5(e){let t,n,i,s,r;return e.horizontal?(t=e.base>e.x,n="left",i="right"):(t=e.basel.controller.options.grouped),r=i.options.stacked,o=[],a=l=>{const c=l.controller.getParsed(n),u=c&&c[l.vScale.axis];if(Mt(u)||isNaN(u))return!0};for(const l of s)if(!(n!==void 0&&a(l))&&((r===!1||o.indexOf(l.stack)===-1||r===void 0&&l.stack===void 0)&&o.push(l.stack),l.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,n,i){const s=this._getStacks(t,i),r=n!==void 0?s.indexOf(n):-1;return r===-1?s.length-1:r}_getRuler(){const t=this.options,n=this._cachedMeta,i=n.iScale,s=[];let r,o;for(r=0,o=n.data.length;r=0;--i)n=Math.max(n,t[i].size(this.resolveDataElementOptions(i))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,{xScale:i,yScale:s}=n,r=this.getParsed(t),o=i.getLabelForValue(r.x),a=s.getLabelForValue(r.y),l=r._custom;return{label:n.label,value:"("+o+", "+a+(l?", "+l:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,i,s){const r=s==="reset",{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(n,s),u=o.axis,d=a.axis;for(let h=n;hJl(x,a,l,!0)?1:Math.max(_,_*n,w,w*n),p=(x,_,w)=>Jl(x,a,l,!0)?-1:Math.min(_,_*n,w,w*n),m=f(0,c,d),v=f(ae,u,h),y=p(qt,c,d),g=p(qt+ae,u,h);i=(m-y)/2,s=(v-g)/2,r=-(m+y)/2,o=-(v+g)/2}return{ratioX:i,ratioY:s,offsetX:r,offsetY:o}}class oa extends ri{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 i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let r=l=>+i[l];if(yt(i[t])){const{key:l="value"}=this._parsing;r=c=>+Ys(i[c],l)}let o,a;for(o=t,a=t+n;o0&&!isNaN(t)?Nt*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=wc(n._parsed[t],i.options.locale);return{label:s[t]||"",value:r}}getMaxBorderWidth(t){let n=0;const i=this.chart;let s,r,o,a,l;if(!t){for(s=0,r=i.data.datasets.length;se!=="spacing",_indexable:e=>e!=="spacing"};oa.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const t=e.data;if(t.labels.length&&t.datasets.length){const{labels:{pointStyle:n}}=e.legend.options;return t.labels.map((i,s)=>{const o=e.getDatasetMeta(0).controller.getStyle(s);return{text:i,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:n,hidden:!e.getDataVisibility(s),index:s}})}return[]}},onClick(e,t,n){n.chart.toggleDataVisibility(t.index),n.chart.update()}},tooltip:{callbacks:{title(){return""},label(e){let t=e.label;const n=": "+e.formattedValue;return Vt(t)?(t=t.slice(),t[0]+=n):t+=n,t}}}}};class Yh extends ri{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:i,data:s=[],_dataset:r}=n,o=this.chart._animationsDisabled;let{start:a,count:l}=wP(n,s,o);this._drawStart=a,this._drawCount=l,kP(n)&&(a=0,l=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!r._decimated,i.points=s;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:c},t),this.updateElements(s,a,l,t)}updateElements(t,n,i,s){const r=s==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(n,s),h=o.axis,f=a.axis,{spanGaps:p,segment:m}=this.options,v=ta(p)?p:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||r||s==="none";let g=n>0&&this.getParsed(n-1);for(let x=n;x0&&Math.abs(w[h]-g[h])>v,m&&(S.parsed=w,S.raw=c.data[x]),d&&(S.options=u||this.resolveDataElementOptions(x,_.active?"active":s)),y||this.updateElement(_,x,S,s),g=w}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,i=n.options&&n.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const r=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,r,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}Yh.id="line";Yh.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};Yh.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class Xh extends ri{constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=wc(n._parsed[t].r,i.options.locale);return{label:s[t]||"",value:r}}parseObjectData(t,n,i,s){return NP.bind(this)(t,n,i,s)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,s)=>{const r=this.getParsed(s).r;!isNaN(r)&&this.chart.getDataVisibility(s)&&(rn.max&&(n.max=r))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,i=t.options,s=Math.min(n.right-n.left,n.bottom-n.top),r=Math.max(s/2,0),o=Math.max(i.cutoutPercentage?r/100*i.cutoutPercentage:1,0),a=(r-o)/t.getVisibleDatasetCount();this.outerRadius=r-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,n,i,s){const r=s==="reset",o=this.chart,l=o.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,d=c.yCenter,h=c.getIndexAngle(0)-.5*qt;let f=h,p;const m=360/this.countVisibleElements();for(p=0;p{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&n++}),n}_computeAngle(t,n,i){return this.chart.getDataVisibility(t)?ti(this.resolveDataElementOptions(t,n).angle||i):0}}Xh.id="polarArea";Xh.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};Xh.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const t=e.data;if(t.labels.length&&t.datasets.length){const{labels:{pointStyle:n}}=e.legend.options;return t.labels.map((i,s)=>{const o=e.getDatasetMeta(0).controller.getStyle(s);return{text:i,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:n,hidden:!e.getDataVisibility(s),index:s}})}return[]}},onClick(e,t,n){n.chart.toggleDataVisibility(t.index),n.chart.update()}},tooltip:{callbacks:{title(){return""},label(e){return e.chart.data.labels[e.dataIndex]+": "+e.formattedValue}}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class d0 extends oa{}d0.id="pie";d0.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class Kh extends ri{getLabelAndValue(t){const n=this._cachedMeta.vScale,i=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(i[n.axis])}}parseObjectData(t,n,i,s){return NP.bind(this)(t,n,i,s)}update(t){const n=this._cachedMeta,i=n.dataset,s=n.data||[],r=n.iScale.getLabels();if(i.points=s,t!=="resize"){const o=this.resolveDatasetElementOptions(t);this.options.showLine||(o.borderWidth=0);const a={_loop:!0,_fullLoop:r.length===s.length,options:o};this.updateElement(i,void 0,a,t)}this.updateElements(s,0,s.length,t)}updateElements(t,n,i,s){const r=this._cachedMeta.rScale,o=s==="reset";for(let a=n;a{s[r]=i[r]&&i[r].active()?i[r]._to:this[r]}),s}};oi.defaults={};oi.defaultRoutes=void 0;const YP={values(e){return Vt(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const i=this.chart.options.locale;let s,r=e;if(n.length>1){const c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),r=w5(e,n)}const o=jn(Math.abs(r)),a=Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),wc(e,i,l)},logarithmic(e,t,n){if(e===0)return"0";const i=e/Math.pow(10,Math.floor(jn(e)));return i===1||i===2||i===5?YP.numeric.call(this,e,t,n):""}};function w5(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 Gh={formatters:YP};_t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth: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:Gh.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}});_t.route("scale.ticks","color","","color");_t.route("scale.grid","color","","borderColor");_t.route("scale.grid","borderColor","","borderColor");_t.route("scale.title","color","","color");_t.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"});_t.describe("scales",{_fallback:"scale"});_t.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"});function k5(e,t){const n=e.options.ticks,i=n.maxTicksLimit||S5(e),s=n.major.enabled?C5(t):[],r=s.length,o=s[0],a=s[r-1],l=[];if(r>i)return P5(t,l,s,r/i),l;const c=M5(s,t,i);if(r>0){let u,d;const h=r>1?Math.round((a-o)/(r-1)):null;for(wu(t,l,c,Mt(h)?0:o-h,o),u=0,d=r-1;us)return l}return Math.max(s,1)}function C5(e){const t=[];let n,i;for(n=0,i=e.length;ne==="left"?"right":e==="right"?"left":e,o_=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n;function a_(e,t){const n=[],i=e.length/t,s=e.length;let r=0;for(;ro+a)))return l}function A5(e,t){At(e,n=>{const i=n.gc,s=i.length/2;let r;if(s>t){for(r=0;ri?i:n,i=s&&n>i?n:i,{min:On(n,On(i,n)),max:On(i,On(n,i))}}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||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Ft(this.options.beforeUpdate,[this])}update(t,n,i){const{beginAtZero:s,grace:r,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=fz(this,r,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a=r||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const u=this._getLabelSizes(),d=u.widest.width,h=u.highest.height,f=ke(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/i:f/(i-1),d+6>a&&(a=f/(i-(t.offset?.5:1)),l=this.maxHeight-Ea(t.grid)-n.padding-l_(t.title,this.chart.options.font),c=Math.sqrt(d*d+h*h),o=t0(Math.min(Math.asin(ke((u.highest.height+6)/a,-1,1)),Math.asin(ke(l/c,-1,1))-Math.asin(ke(h/c,-1,1)))),o=Math.max(s,Math.min(r,o))),this.labelRotation=o}afterCalculateLabelRotation(){Ft(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Ft(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:i,title:s,grid:r}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const l=l_(s,n.options.font);if(a?(t.width=this.maxWidth,t.height=Ea(r)+l):(t.height=this.maxHeight,t.width=Ea(r)+l),i.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:h}=this._getLabelSizes(),f=i.padding*2,p=ti(this.labelRotation),m=Math.cos(p),v=Math.sin(p);if(a){const y=i.mirror?0:v*d.width+m*h.height;t.height=Math.min(this.maxHeight,t.height+y+f)}else{const y=i.mirror?0:m*d.width+v*h.height;t.width=Math.min(this.maxWidth,t.width+y+f)}this._calculatePadding(c,u,v,m)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,i,s){const{ticks:{align:r,padding:o},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,f=0;l?c?(h=s*t.width,f=i*n.height):(h=i*t.height,f=s*n.width):r==="start"?f=n.width:r==="end"?h=t.width:r!=="inner"&&(h=t.width/2,f=n.width/2),this.paddingLeft=Math.max((h-u+o)*this.width/(this.width-u),0),this.paddingRight=Math.max((f-d+o)*this.width/(this.width-d),0)}else{let u=n.height/2,d=t.height/2;r==="start"?(u=0,d=t.height):r==="end"&&(u=n.height,d=0),this.paddingTop=u+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(){Ft(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,i;for(n=0,i=t.length;n({width:r[C]||0,height:o[C]||0});return{first:S(0),last:S(n-1),widest:S(_),highest:S(w),widths:r,heights:o}}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 TV(this._alignToPixels?cr(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&&ta*s?a/i:l/s:l*s0}_computeGridLineItems(t){const n=this.axis,i=this.chart,s=this.options,{grid:r,position:o}=s,a=r.offset,l=this.isHorizontal(),u=this.ticks.length+(a?1:0),d=Ea(r),h=[],f=r.setContext(this.getContext()),p=f.drawBorder?f.borderWidth:0,m=p/2,v=function(L){return cr(i,L,p)};let y,g,x,_,w,S,C,M,P,T,A,E;if(o==="top")y=v(this.bottom),S=this.bottom-d,M=y-m,T=v(t.top)+m,E=t.bottom;else if(o==="bottom")y=v(this.top),T=t.top,E=v(t.bottom)-m,S=y+m,M=this.top+d;else if(o==="left")y=v(this.right),w=this.right-d,C=y-m,P=v(t.left)+m,A=t.right;else if(o==="right")y=v(this.left),P=t.left,A=v(t.right)-m,w=y+m,C=this.left+d;else if(n==="x"){if(o==="center")y=v((t.top+t.bottom)/2+.5);else if(yt(o)){const L=Object.keys(o)[0],R=o[L];y=v(this.chart.scales[L].getPixelForValue(R))}T=t.top,E=t.bottom,S=y+m,M=S+d}else if(n==="y"){if(o==="center")y=v((t.left+t.right)/2);else if(yt(o)){const L=Object.keys(o)[0],R=o[L];y=v(this.chart.scales[L].getPixelForValue(R))}w=y-m,C=w-d,P=t.left,A=t.right}const z=ut(s.ticks.maxTicksLimit,u),N=Math.max(1,Math.ceil(u/z));for(g=0;gr.value===t);return s>=0?n.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const n=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let r,o;const a=(l,c,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(n.display)for(r=0,o=s.length;r{this.draw(s)}}]:[{z:i,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:i+1,draw:()=>{this.drawBorder()}},{z:n,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let r,o;for(r=0,o=n.length;r{const i=n.split("."),s=i.pop(),r=[e].concat(i).join("."),o=t[n].split("."),a=o.pop(),l=o.join(".");_t.route(r,s,l,a)})}function I5(e){return"id"in e&&"defaults"in e}class F5{constructor(){this.controllers=new ku(ri,"datasets",!0),this.elements=new ku(oi,"elements"),this.plugins=new ku(Object,"plugins"),this.scales=new ku(Xr,"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,i){[...n].forEach(s=>{const r=i||this._getRegistryForType(s);i||r.isForType(s)||r===this.plugins&&s.id?this._exec(t,r,s):At(s,o=>{const a=i||this._getRegistryForType(o);this._exec(t,a,o)})})}_exec(t,n,i){const s=Jy(t);Ft(i["before"+s],[],i),n[t](i),Ft(i["after"+s],[],i)}_getRegistryForType(t){for(let n=0;n0&&this.getParsed(n-1);for(let _=n;_0&&Math.abs(S[f]-x[f])>y,v&&(C.parsed=S,C.raw=c.data[_]),h&&(C.options=d||this.resolveDataElementOptions(_,w.active?"active":s)),g||this.updateElement(w,_,C,s),x=S}this.updateSharedOptions(d,s,u)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let a=0;for(let l=n.length-1;l>=0;--l)a=Math.max(a,n[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!n.length)return s;const r=n[0].size(this.resolveDataElementOptions(0)),o=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(s,r,o)/2}}qh.id="scatter";qh.defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};qh.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title(){return""},label(e){return"("+e.label+", "+e.formattedValue+")"}}}},scales:{x:{type:"linear"},y:{type:"linear"}}};var B5=Object.freeze({__proto__:null,BarController:Hh,BubbleController:Uh,DoughnutController:oa,LineController:Yh,PolarAreaController:Xh,PieController:d0,RadarController:Kh,ScatterController:qh});function ur(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Xm{constructor(t){this.options=t||{}}init(t){}formats(){return ur()}parse(t,n){return ur()}format(t,n){return ur()}add(t,n,i){return ur()}diff(t,n,i){return ur()}startOf(t,n,i){return ur()}endOf(t,n){return ur()}}Xm.override=function(e){Object.assign(Xm.prototype,e)};var V5={_date:Xm};function z5(e,t,n,i){const{controller:s,data:r,_sorted:o}=e,a=s._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&o&&r.length){const l=a._reversePixels?DV:Xi;if(i){if(s._sharedOptions){const c=r[0],u=typeof c.getRange=="function"&&c.getRange(t);if(u){const d=l(r,t,n-u),h=l(r,t,n+u);return{lo:d.lo,hi:h.hi}}}}else return l(r,t,n)}return{lo:0,hi:r.length-1}}function kc(e,t,n,i,s){const r=e.getSortedVisibleDatasetMetas(),o=n[t];for(let a=0,l=r.length;a{l[o](t[n],s)&&(r.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,s))}),i&&!a?[]:r}var Y5={evaluateInteractionItems:kc,modes:{index(e,t,n,i){const s=vr(t,e),r=n.axis||"x",o=n.includeInvisible||!1,a=n.intersect?hp(e,s,r,i,o):fp(e,s,r,!1,i,o),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(e,t,n,i){const s=vr(t,e),r=n.axis||"xy",o=n.includeInvisible||!1;let a=n.intersect?hp(e,s,r,i,o):fp(e,s,r,!1,i,o);if(a.length>0){const l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let u=0;un.pos===t)}function u_(e,t){return e.filter(n=>XP.indexOf(n.pos)===-1&&n.box.axis===t)}function Oa(e,t){return e.sort((n,i)=>{const s=t?i:n,r=t?n:i;return s.weight===r.weight?s.index-r.index:s.weight-r.weight})}function X5(e){const t=[];let n,i,s,r,o,a;for(n=0,i=(e||[]).length;nc.box.fullSize),!0),i=Oa(Aa(t,"left"),!0),s=Oa(Aa(t,"right")),r=Oa(Aa(t,"top"),!0),o=Oa(Aa(t,"bottom")),a=u_(t,"x"),l=u_(t,"y");return{fullSize:n,leftAndTop:i.concat(r),rightAndBottom:s.concat(l).concat(o).concat(a),chartArea:Aa(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:r.concat(o).concat(a)}}function d_(e,t,n,i){return Math.max(e[n],t[n])+Math.max(e[i],t[i])}function KP(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 Q5(e,t,n,i){const{pos:s,box:r}=n,o=e.maxPadding;if(!yt(s)){n.size&&(e[s]-=n.size);const d=i[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?r.height:r.width),n.size=d.size/d.count,e[s]+=n.size}r.getPadding&&KP(o,r.getPadding());const a=Math.max(0,t.outerWidth-d_(o,e,"left","right")),l=Math.max(0,t.outerHeight-d_(o,e,"top","bottom")),c=a!==e.w,u=l!==e.h;return e.w=a,e.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function Z5(e){const t=e.maxPadding;function n(i){const s=Math.max(t[i]-e[i],0);return e[i]+=s,s}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function J5(e,t){const n=t.maxPadding;function i(s){const r={left:0,top:0,right:0,bottom:0};return s.forEach(o=>{r[o]=Math.max(t[o],n[o])}),r}return i(e?["left","right"]:["top","bottom"])}function tl(e,t,n,i){const s=[];let r,o,a,l,c,u;for(r=0,o=e.length,c=0;r{typeof m.beforeLayout=="function"&&m.beforeLayout()});const u=l.reduce((m,v)=>v.box.options&&v.box.options.display===!1?m:m+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:s,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/u,hBoxMaxHeight:o/2}),h=Object.assign({},s);KP(h,ze(i));const f=Object.assign({maxPadding:h,w:r,h:o,x:s.left,y:s.top},s),p=G5(l.concat(c),d);tl(a.fullSize,f,d,p),tl(l,f,d,p),tl(c,f,d,p)&&tl(l,f,d,p),Z5(f),h_(a.leftAndTop,f,d,p),f.x+=f.w,f.y+=f.h,h_(a.rightAndBottom,f,d,p),e.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},At(a.chartArea,m=>{const v=m.box;Object.assign(v,e.chartArea),v.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class GP{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,i){}removeEventListener(t,n,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,i,s){return n=Math.max(0,n||t.width),i=i||t.height,{width:n,height:Math.max(0,s?Math.floor(n/s):i)}}isAttached(t){return!0}updateConfig(t){}}class tW extends GP{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const sd="$chartjs",eW={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},f_=e=>e===null||e==="";function nW(e,t){const n=e.style,i=e.getAttribute("height"),s=e.getAttribute("width");if(e[sd]={initial:{height:i,width:s,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",f_(s)){const r=U1(e,"width");r!==void 0&&(e.width=r)}if(f_(i))if(e.style.height==="")e.height=e.width/(t||2);else{const r=U1(e,"height");r!==void 0&&(e.height=r)}return e}const qP=jz?{passive:!0}:!1;function iW(e,t,n){e.addEventListener(t,n,qP)}function sW(e,t,n){e.canvas.removeEventListener(t,n,qP)}function rW(e,t){const n=eW[e.type]||e.type,{x:i,y:s}=vr(e,t);return{type:n,chart:t,native:e,x:i!==void 0?i:null,y:s!==void 0?s:null}}function nh(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function oW(e,t,n){const i=e.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||nh(a.addedNodes,i),o=o&&!nh(a.removedNodes,i);o&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}function aW(e,t,n){const i=e.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||nh(a.removedNodes,i),o=o&&!nh(a.addedNodes,i);o&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}const nc=new Map;let p_=0;function QP(){const e=window.devicePixelRatio;e!==p_&&(p_=e,nc.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function lW(e,t){nc.size||window.addEventListener("resize",QP),nc.set(e,t)}function cW(e){nc.delete(e),nc.size||window.removeEventListener("resize",QP)}function uW(e,t,n){const i=e.canvas,s=i&&u0(i);if(!s)return;const r=_P((a,l)=>{const c=s.clientWidth;n(a,l),c{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||r(c,u)});return o.observe(s),lW(e,r),o}function pp(e,t,n){n&&n.disconnect(),t==="resize"&&cW(e)}function dW(e,t,n){const i=e.canvas,s=_P(r=>{e.ctx!==null&&n(rW(r,e))},e,r=>{const o=r[0];return[o,o.offsetX,o.offsetY]});return iW(i,t,s),s}class hW extends GP{acquireContext(t,n){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(nW(t,n),i):null}releaseContext(t){const n=t.canvas;if(!n[sd])return!1;const i=n[sd].initial;["height","width"].forEach(r=>{const o=i[r];Mt(o)?n.removeAttribute(r):n.setAttribute(r,o)});const s=i.style||{};return Object.keys(s).forEach(r=>{n.style[r]=s[r]}),n.width=n.width,delete n[sd],!0}addEventListener(t,n,i){this.removeEventListener(t,n);const s=t.$proxies||(t.$proxies={}),o={attach:oW,detach:aW,resize:uW}[n]||dW;s[n]=o(t,n,i)}removeEventListener(t,n){const i=t.$proxies||(t.$proxies={}),s=i[n];if(!s)return;({attach:pp,detach:pp,resize:pp}[n]||sW)(t,n,s),i[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,i,s){return Nz(t,n,i,s)}isAttached(t){const n=u0(t);return!!(n&&n.isConnected)}}function fW(e){return!$P()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?tW:hW}class pW{constructor(){this._init=[]}notify(t,n,i,s){n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const r=s?this._descriptors(t).filter(s):this._descriptors(t),o=this._notify(r,t,n,i);return n==="afterDestroy"&&(this._notify(r,t,"stop"),this._notify(this._init,t,"uninstall")),o}_notify(t,n,i,s){s=s||{};for(const r of t){const o=r.plugin,a=o[i],l=[n,s,r.options];if(Ft(a,l,o)===!1&&s.cancelable)return!1}return!0}invalidate(){Mt(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 i=t&&t.config,s=ut(i.options&&i.options.plugins,{}),r=mW(i);return s===!1&&!n?[]:yW(t,r,s,n)}_notifyStateChanges(t){const n=this._oldCache||[],i=this._cache,s=(r,o)=>r.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(s(n,i),t,"stop"),this._notify(s(i,n),t,"start")}}function mW(e){const t={},n=[],i=Object.keys(pi.plugins.items);for(let r=0;r{const l=i[a];if(!yt(l))return console.error(`Invalid scale configuration for scale: ${a}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const c=Gm(a,l),u=bW(c,s),d=n.scales||{};r[c]=r[c]||a,o[a]=bl(Object.create(null),[{axis:c},l,d[c],d[u]])}),e.data.datasets.forEach(a=>{const l=a.type||e.type,c=a.indexAxis||Km(l,t),d=(Vr[l]||{}).scales||{};Object.keys(d).forEach(h=>{const f=xW(h,c),p=a[f+"AxisID"]||r[f]||f;o[p]=o[p]||Object.create(null),bl(o[p],[{axis:f},i[p],d[h]])})}),Object.keys(o).forEach(a=>{const l=o[a];bl(l,[_t.scales[l.type],_t.scale])}),o}function ZP(e){const t=e.options||(e.options={});t.plugins=ut(t.plugins,{}),t.scales=wW(e,t)}function JP(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function kW(e){return e=e||{},e.data=JP(e.data),ZP(e),e}const m_=new Map,tT=new Set;function Mu(e,t){let n=m_.get(e);return n||(n=t(),m_.set(e,n),tT.add(n)),n}const La=(e,t,n)=>{const i=Ys(t,n);i!==void 0&&e.add(i)};class SW{constructor(t){this._config=kW(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=JP(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(),ZP(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Mu(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return Mu(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return Mu(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,i=this.type;return Mu(`${i}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const i=this._scopeCache;let s=i.get(t);return(!s||n)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,n,i){const{options:s,type:r}=this,o=this._cachedScopes(t,i),a=o.get(n);if(a)return a;const l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(d=>La(l,t,d))),u.forEach(d=>La(l,s,d)),u.forEach(d=>La(l,Vr[r]||{},d)),u.forEach(d=>La(l,_t,d)),u.forEach(d=>La(l,Um,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),tT.has(n)&&o.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,Vr[n]||{},_t.datasets[n]||{},{type:n},_t,Um]}resolveNamedOptions(t,n,i,s=[""]){const r={$shared:!0},{resolver:o,subPrefixes:a}=g_(this._resolverCache,t,s);let l=o;if(CW(o,n)){r.$shared=!1,i=Xs(i)?i():i;const c=this.createResolver(t,i,a);l=ea(o,i,c)}for(const c of n)r[c]=l[c];return r}createResolver(t,n,i=[""],s){const{resolver:r}=g_(this._resolverCache,t,i);return yt(n)?ea(r,n,void 0,s):r}}function g_(e,t,n){let i=e.get(t);i||(i=new Map,e.set(t,i));const s=n.join();let r=i.get(s);return r||(r={resolver:a0(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},i.set(s,r)),r}const MW=e=>yt(e)&&Object.getOwnPropertyNames(e).reduce((t,n)=>t||Xs(e[n]),!1);function CW(e,t){const{isScriptable:n,isIndexable:i}=AP(e);for(const s of t){const r=n(s),o=i(s),a=(o||r)&&e[s];if(r&&(Xs(a)||MW(a))||o&&Vt(a))return!0}return!1}var PW="3.9.1";const TW=["top","bottom","left","right","chartArea"];function y_(e,t){return e==="top"||e==="bottom"||TW.indexOf(e)===-1&&t==="x"}function v_(e,t){return function(n,i){return n[e]===i[e]?n[t]-i[t]:n[e]-i[e]}}function x_(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),Ft(n&&n.onComplete,[e],t)}function DW(e){const t=e.chart,n=t.options.animation;Ft(n&&n.onProgress,[e],t)}function eT(e){return $P()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const ih={},nT=e=>{const t=eT(e);return Object.values(ih).filter(n=>n.canvas===t).pop()};function EW(e,t,n){const i=Object.keys(e);for(const s of i){const r=+s;if(r>=t){const o=e[s];delete e[s],(n>0||r>t)&&(e[r+n]=o)}}}function AW(e,t,n,i){return!n||e.type==="mouseout"?null:i?t:e}class h0{constructor(t,n){const i=this.config=new SW(n),s=eT(t),r=nT(s);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||fW(s)),this.platform.updateConfig(i);const a=this.platform.acquireContext(s,o.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=gV(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,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 pW,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=OV(d=>this.update(d),o.resizeDelay||0),this._dataChanges=[],ih[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Li.listen(this,"complete",x_),Li.listen(this,"progress",DW),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:i,height:s,_aspectRatio:r}=this;return Mt(t)?n&&r?r:s?i/s: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}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():H1(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return V1(this.canvas,this.ctx),this}stop(){return Li.stop(this),this}resize(t,n){Li.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const i=this.options,s=this.canvas,r=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,t,n,r),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,H1(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),Ft(i.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};At(n,(i,s)=>{i.id=s})}buildOrUpdateScales(){const t=this.options,n=t.scales,i=this.scales,s=Object.keys(i).reduce((o,a)=>(o[a]=!1,o),{});let r=[];n&&(r=r.concat(Object.keys(n).map(o=>{const a=n[o],l=Gm(o,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),At(r,o=>{const a=o.options,l=a.id,c=Gm(l,a),u=ut(a.type,o.dtype);(a.position===void 0||y_(a.position,c)!==y_(o.dposition))&&(a.position=o.dposition),s[l]=!0;let d=null;if(l in i&&i[l].type===u)d=i[l];else{const h=pi.getScale(u);d=new h({id:l,type:u,ctx:this.ctx,chart:this}),i[d.id]=d}d.init(a,t)}),At(s,(o,a)=>{o||delete i[a]}),At(i,o=>{Be.configure(this,o,o.options),Be.addBox(this,o)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,i=t.length;if(t.sort((s,r)=>s.index-r.index),i>n){for(let s=n;sn.length&&delete this._stacks,t.forEach((i,s)=>{n.filter(r=>r===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=n.length;i{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const i=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let c=0,u=this.data.datasets.length;c{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(v_("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){At(this.scales,t=>{Be.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!D1(n,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:r}of n){const o=i==="_removeElements"?-r:r;EW(t,s,o)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,i=r=>new Set(t.filter(o=>o[0]===r).map((o,a)=>a+","+o.splice(1).join(","))),s=i(0);for(let r=1;rr.split(",")).map(r=>({method:r[1],start:+r[2],count:+r[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Be.update(this,this.width,this.height,t);const n=this.chartArea,i=n.width<=0||n.height<=0;this._layers=[],At(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,r)=>{s._idx=r}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,i=this.data.datasets.length;n=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,i=t._clip,s=!i.disabled,r=this.chartArea,o={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(s&&Vh(n,{left:i.left===!1?0:r.left-i.left,right:i.right===!1?this.width:r.right+i.right,top:i.top===!1?0:r.top-i.top,bottom:i.bottom===!1?this.height:r.bottom+i.bottom}),t.controller.draw(),s&&zh(n),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return tc(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,i,s){const r=Y5.modes[n];return typeof r=="function"?r(this,t,i,s):[]}getDatasetMeta(t){const n=this.data.datasets[t],i=this._metasets;let s=i.filter(r=>r&&r._dataset===n).pop();return s||(s={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},i.push(s)),s}getContext(){return this.$context||(this.$context=er(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!n.hidden}setDatasetVisibility(t,n){const i=this.getDatasetMeta(t);i.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,i){const s=i?"show":"hide",r=this.getDatasetMeta(t),o=r.controller._resolveAnimations(void 0,s);Hn(n)?(r.data[n].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(r,{visible:i}),this.update(a=>a.datasetIndex===t?s: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(),Li.remove(this),t=0,n=this.data.datasets.length;t{n.addEventListener(this,r,o),t[r]=o},s=(r,o,a)=>{r.offsetX=o,r.offsetY=a,this._eventHandler(r)};At(this.options.events,r=>i(r,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,i=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},r=(l,c)=>{this.canvas&&this.resize(l,c)};let o;const a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",r),i("detach",o)};o=()=>{this.attached=!1,s("resize",r),this._stop(),this._resize(0,0),i("attach",a)},n.isAttached(this.canvas)?a():o()}unbindEvents(){At(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},At(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,i){const s=i?"set":"remove";let r,o,a,l;for(n==="dataset"&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=t.length;a{const a=this.getDatasetMeta(r);if(!a)throw new Error("No dataset found at index "+r);return{datasetIndex:r,element:a.data[o],index:o}});!qd(i,n)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,n))}notifyPlugins(t,n,i){return this._plugins.notify(this,t,n,i)}_updateHoverStyles(t,n,i){const s=this.options.hover,r=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),o=r(n,t),a=i?t:r(t,n);o.length&&this.updateHoverStyle(o,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,n){const i={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},s=o=>(o.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const r=this._handleEvent(t,n,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(r||i.changed)&&this.render(),this}_handleEvent(t,n,i){const{_active:s=[],options:r}=this,o=n,a=this._getActiveElements(t,s,i,o),l=wV(t),c=AW(t,this._lastEvent,i,l);i&&(this._lastEvent=null,Ft(r.onHover,[t,a,this],this),l&&Ft(r.onClick,[t,a,this],this));const u=!qd(a,s);return(u||n)&&(this._active=a,this._updateHoverStyles(a,s,n)),this._lastEvent=c,u}_getActiveElements(t,n,i,s){if(t.type==="mouseout")return[];if(!i)return n;const r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,s)}}const b_=()=>At(h0.instances,e=>e._plugins.invalidate()),hs=!0;Object.defineProperties(h0,{defaults:{enumerable:hs,value:_t},instances:{enumerable:hs,value:ih},overrides:{enumerable:hs,value:Vr},registry:{enumerable:hs,value:pi},version:{enumerable:hs,value:PW},getChart:{enumerable:hs,value:nT},register:{enumerable:hs,value:(...e)=>{pi.add(...e),b_()}},unregister:{enumerable:hs,value:(...e)=>{pi.remove(...e),b_()}}});function iT(e,t,n){const{startAngle:i,pixelMargin:s,x:r,y:o,outerRadius:a,innerRadius:l}=t;let c=s/a;e.beginPath(),e.arc(r,o,a,i-c,n+c),l>s?(c=s/l,e.arc(r,o,l,n+c,i-c,!0)):e.arc(r,o,s,n+ae,i-ae),e.closePath(),e.clip()}function OW(e){return o0(e,["outerStart","outerEnd","innerStart","innerEnd"])}function LW(e,t,n,i){const s=OW(e.options.borderRadius),r=(n-t)/2,o=Math.min(r,i*t/2),a=l=>{const c=(n-Math.min(r,l))*i/2;return ke(l,0,Math.min(r,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:ke(s.innerStart,0,o),innerEnd:ke(s.innerEnd,0,o)}}function to(e,t,n,i){return{x:n+e*Math.cos(t),y:i+e*Math.sin(t)}}function qm(e,t,n,i,s,r){const{x:o,y:a,startAngle:l,pixelMargin:c,innerRadius:u}=t,d=Math.max(t.outerRadius+i+n-c,0),h=u>0?u+i+n+c:0;let f=0;const p=s-l;if(i){const L=u>0?u-i:0,R=d>0?d-i:0,B=(L+R)/2,D=B!==0?p*B/(B+i):p;f=(p-D)/2}const m=Math.max(.001,p*d-n/qt)/d,v=(p-m)/2,y=l+v+f,g=s-v-f,{outerStart:x,outerEnd:_,innerStart:w,innerEnd:S}=LW(t,h,d,g-y),C=d-x,M=d-_,P=y+x/C,T=g-_/M,A=h+w,E=h+S,z=y+w/A,N=g-S/E;if(e.beginPath(),r){if(e.arc(o,a,d,P,T),_>0){const B=to(M,T,o,a);e.arc(B.x,B.y,_,T,g+ae)}const L=to(E,g,o,a);if(e.lineTo(L.x,L.y),S>0){const B=to(E,N,o,a);e.arc(B.x,B.y,S,g+ae,N+Math.PI)}if(e.arc(o,a,h,g-S/h,y+w/h,!0),w>0){const B=to(A,z,o,a);e.arc(B.x,B.y,w,z+Math.PI,y-ae)}const R=to(C,y,o,a);if(e.lineTo(R.x,R.y),x>0){const B=to(C,P,o,a);e.arc(B.x,B.y,x,y-ae,P)}}else{e.moveTo(o,a);const L=Math.cos(P)*d+o,R=Math.sin(P)*d+a;e.lineTo(L,R);const B=Math.cos(T)*d+o,D=Math.sin(T)*d+a;e.lineTo(B,D)}e.closePath()}function RW(e,t,n,i,s){const{fullCircles:r,startAngle:o,circumference:a}=t;let l=t.endAngle;if(r){qm(e,t,n,i,o+Nt,s);for(let c=0;c=Nt||Jl(r,a,l),m=Yi(o,c+h,u+h);return p&&m}getCenterPoint(t){const{x:n,y:i,startAngle:s,endAngle:r,innerRadius:o,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:l,spacing:c}=this.options,u=(s+r)/2,d=(o+a+c+l)/2;return{x:n+Math.cos(u)*d,y:i+Math.sin(u)*d}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:n,circumference:i}=this,s=(n.offset||0)/2,r=(n.spacing||0)/2,o=n.circular;if(this.pixelMargin=n.borderAlign==="inner"?.33:0,this.fullCircles=i>Nt?Math.floor(i/Nt):0,i===0||this.innerRadius<0||this.outerRadius<0)return;t.save();let a=0;if(s){a=s/2;const c=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(c)*a,Math.sin(c)*a),this.circumference>=qt&&(a=s)}t.fillStyle=n.backgroundColor,t.strokeStyle=n.borderColor;const l=RW(t,this,a,r,o);jW(t,this,a,r,l,o),t.restore()}}Qh.id="arc";Qh.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};Qh.defaultRoutes={backgroundColor:"backgroundColor"};function sT(e,t,n=t){e.lineCap=ut(n.borderCapStyle,t.borderCapStyle),e.setLineDash(ut(n.borderDash,t.borderDash)),e.lineDashOffset=ut(n.borderDashOffset,t.borderDashOffset),e.lineJoin=ut(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=ut(n.borderWidth,t.borderWidth),e.strokeStyle=ut(n.borderColor,t.borderColor)}function $W(e,t,n){e.lineTo(n.x,n.y)}function IW(e){return e.stepped?rz:e.tension||e.cubicInterpolationMode==="monotone"?oz:$W}function rT(e,t,n={}){const i=e.length,{start:s=0,end:r=i-1}=n,{start:o,end:a}=t,l=Math.max(s,o),c=Math.min(r,a),u=sa&&r>a;return{count:i,start:l,loop:t.loop,ilen:c(o+(c?a-_:_))%r,x=()=>{m!==v&&(e.lineTo(u,v),e.lineTo(u,m),e.lineTo(u,y))};for(l&&(f=s[g(0)],e.moveTo(f.x,f.y)),h=0;h<=a;++h){if(f=s[g(h)],f.skip)continue;const _=f.x,w=f.y,S=_|0;S===p?(wv&&(v=w),u=(d*u+_)/++d):(x(),e.lineTo(_,w),p=S,d=0,m=v=w),y=w}x()}function Qm(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?BW:FW}function VW(e){return e.stepped?$z:e.tension||e.cubicInterpolationMode==="monotone"?Iz:xr}function zW(e,t,n,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,n,i)&&s.closePath()),sT(e,t.options),e.stroke(s)}function WW(e,t,n,i){const{segments:s,options:r}=t,o=Qm(t);for(const a of s)sT(e,r,a.style),e.beginPath(),o(e,t,a,{start:n,end:n+i-1})&&e.closePath(),e.stroke()}const HW=typeof Path2D=="function";function UW(e,t,n,i){HW&&!t.options.segment?zW(e,t,n,i):WW(e,t,n,i)}class nr extends oi{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 i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;Dz(this._points,i,t,s,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=Uz(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,i=t.length;return i&&n[t[i-1].end]}interpolate(t,n){const i=this.options,s=t[n],r=this.points,o=zP(this,{property:n,start:s,end:s});if(!o.length)return;const a=[],l=VW(i);let c,u;for(c=0,u=o.length;ce!=="borderDash"&&e!=="fill"};function __(e,t,n,i){const s=e.options,{[n]:r}=e.getProps([n],i);return Math.abs(t-r)=n)return e.slice(t,t+n);const o=[],a=(n-2)/(r-2);let l=0;const c=t+n-1;let u=t,d,h,f,p,m;for(o[l++]=e[u],d=0;df&&(f=p,h=e[g],m=g);o[l++]=h,u=m}return o[l++]=e[c],o}function JW(e,t,n,i){let s=0,r=0,o,a,l,c,u,d,h,f,p,m;const v=[],y=t+n-1,g=e[t].x,_=e[y].x-g;for(o=t;om&&(m=c,h=o),s=(r*s+a.x)/++r;else{const S=o-1;if(!Mt(d)&&!Mt(h)){const C=Math.min(d,h),M=Math.max(d,h);C!==f&&C!==S&&v.push({...e[C],x:s}),M!==f&&M!==S&&v.push({...e[M],x:s})}o>0&&S!==f&&v.push(e[S]),v.push(a),u=w,r=0,p=m=c,d=h=f=o}}return v}function aT(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{value:t})}}function w_(e){e.data.datasets.forEach(t=>{aT(t)})}function tH(e,t){const n=t.length;let i=0,s;const{iScale:r}=e,{min:o,max:a,minDefined:l,maxDefined:c}=r.getUserBounds();return l&&(i=ke(Xi(t,r.axis,o).lo,0,n-1)),c?s=ke(Xi(t,r.axis,a).hi+1,i,n)-i:s=n-i,{start:i,count:s}}var eH={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){w_(e);return}const i=e.width;e.data.datasets.forEach((s,r)=>{const{_data:o,indexAxis:a}=s,l=e.getDatasetMeta(r),c=o||s.data;if(Ja([a,e.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const u=e.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||e.options.parsing)return;let{start:d,count:h}=tH(l,c);const f=n.threshold||4*i;if(h<=f){aT(s);return}Mt(o)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(m){this._data=m}}));let p;switch(n.algorithm){case"lttb":p=ZW(c,d,h,i,n);break;case"min-max":p=JW(c,d,h,i);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}s._decimated=p})},destroy(e){w_(e)}};function nH(e,t,n){const i=e.segments,s=e.points,r=t.points,o=[];for(const a of i){let{start:l,end:c}=a;c=f0(l,c,s);const u=Zm(n,s[l],s[c],a.loop);if(!t.segments){o.push({source:a,target:u,start:s[l],end:s[c]});continue}const d=zP(t,u);for(const h of d){const f=Zm(n,r[h.start],r[h.end],h.loop),p=VP(a,s,f);for(const m of p)o.push({source:m,target:h,start:{[n]:k_(u,f,"start",Math.max)},end:{[n]:k_(u,f,"end",Math.min)}})}}return o}function Zm(e,t,n,i){if(i)return;let s=t[e],r=n[e];return e==="angle"&&(s=vn(s),r=vn(r)),{property:e,start:s,end:r}}function iH(e,t){const{x:n=null,y:i=null}=e||{},s=t.points,r=[];return t.segments.forEach(({start:o,end:a})=>{a=f0(o,a,s);const l=s[o],c=s[a];i!==null?(r.push({x:l.x,y:i}),r.push({x:c.x,y:i})):n!==null&&(r.push({x:n,y:l.y}),r.push({x:n,y:c.y}))}),r}function f0(e,t,n){for(;t>e;t--){const i=n[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function k_(e,t,n,i){return e&&t?i(e[n],t[n]):e?e[n]:t?t[n]:0}function lT(e,t){let n=[],i=!1;return Vt(e)?(i=!0,n=e):n=iH(e,t),n.length?new nr({points:n,options:{tension:0},_loop:i,_fullLoop:i}):null}function S_(e){return e&&e.fill!==!1}function sH(e,t,n){let s=e[t].fill;const r=[t];let o;if(!n)return s;for(;s!==!1&&r.indexOf(s)===-1;){if(!de(s))return s;if(o=e[s],!o)return!1;if(o.visible)return s;r.push(s),s=o.fill}return!1}function rH(e,t,n){const i=cH(e);if(yt(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return de(s)&&Math.floor(s)===s?oH(i[0],t,s,n):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function oH(e,t,n,i){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=i?!1:n}function aH(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:yt(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function lH(e,t,n){let i;return e==="start"?i=n:e==="end"?i=t.options.reverse?t.min:t.max:yt(e)?i=e.value:i=t.getBaseValue(),i}function cH(e){const t=e.options,n=t.fill;let i=ut(n&&n.target,n);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function uH(e){const{scale:t,index:n,line:i}=e,s=[],r=i.segments,o=i.points,a=dH(t,n);a.push(lT({x:null,y:t.bottom},i));for(let l=0;l=0;--o){const a=s[o].$filler;a&&(a.line.updateControlPoints(r,a.axis),i&&a.fill&&yp(e.ctx,a,r))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const i=e.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const r=i[s].$filler;S_(r)&&yp(e.ctx,r,e.chartArea)}},beforeDatasetDraw(e,t,n){const i=t.meta.$filler;!S_(i)||n.drawTime!=="beforeDatasetDraw"||yp(e.ctx,i,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const T_=(e,t)=>{let{boxHeight:n=t,boxWidth:i=t}=e;return e.usePointStyle&&(n=Math.min(n,t),i=e.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:n,itemHeight:Math.max(t,n)}},wH=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class D_ extends oi{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,i){this.maxWidth=t,this.maxHeight=n,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let n=Ft(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(i=>t.filter(i,this.chart.data))),t.sort&&(n=n.sort((i,s)=>t.sort(i,s,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 i=t.labels,s=be(i.font),r=s.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=T_(i,r);let c,u;n.font=s.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(o,r,a,l)+10):(u=this.maxHeight,c=this._fitCols(o,r,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,n,i,s){const{ctx:r,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=s+a;let d=t;r.textAlign="left",r.textBaseline="middle";let h=-1,f=-u;return this.legendItems.forEach((p,m)=>{const v=i+n/2+r.measureText(p.text).width;(m===0||c[c.length-1]+v+2*a>o)&&(d+=u,c[c.length-(m>0?0:1)]=0,f+=u,h++),l[m]={left:0,top:f,row:h,width:v,height:s},c[c.length-1]+=v+a}),d}_fitCols(t,n,i,s){const{ctx:r,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=o-t;let d=a,h=0,f=0,p=0,m=0;return this.legendItems.forEach((v,y)=>{const g=i+n/2+r.measureText(v.text).width;y>0&&f+s+2*a>u&&(d+=h+a,c.push({width:h,height:f}),p+=h+a,m++,h=f=0),l[y]={left:p,top:f,col:m,width:g,height:s},h=Math.max(h,g),f+=s+a}),d+=h,c.push({width:h,height:f}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:i,labels:{padding:s},rtl:r}}=this,o=Lo(r,this.left,this.width);if(this.isHorizontal()){let a=0,l=$e(i,this.left+s,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=$e(i,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+t+s,c.left=o.leftForLtr(o.x(l),c.width),l+=c.width+s}else{let a=0,l=$e(i,this.top+t+s,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=$e(i,this.top+t+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=o.leftForLtr(o.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Vh(t,this),this._draw(),zh(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:i,ctx:s}=this,{align:r,labels:o}=t,a=_t.color,l=Lo(t.rtl,this.left,this.width),c=be(o.font),{color:u,padding:d}=o,h=c.size,f=h/2;let p;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:m,boxHeight:v,itemHeight:y}=T_(o,h),g=function(C,M,P){if(isNaN(m)||m<=0||isNaN(v)||v<0)return;s.save();const T=ut(P.lineWidth,1);if(s.fillStyle=ut(P.fillStyle,a),s.lineCap=ut(P.lineCap,"butt"),s.lineDashOffset=ut(P.lineDashOffset,0),s.lineJoin=ut(P.lineJoin,"miter"),s.lineWidth=T,s.strokeStyle=ut(P.strokeStyle,a),s.setLineDash(ut(P.lineDash,[])),o.usePointStyle){const A={radius:v*Math.SQRT2/2,pointStyle:P.pointStyle,rotation:P.rotation,borderWidth:T},E=l.xPlus(C,m/2),z=M+f;DP(s,A,E,z,o.pointStyleWidth&&m)}else{const A=M+Math.max((h-v)/2,0),E=l.leftForLtr(C,m),z=Er(P.borderRadius);s.beginPath(),Object.values(z).some(N=>N!==0)?ec(s,{x:E,y:A,w:m,h:v,radius:z}):s.rect(E,A,m,v),s.fill(),T!==0&&s.stroke()}s.restore()},x=function(C,M,P){zr(s,P.text,C,M+y/2,c,{strikethrough:P.hidden,textAlign:l.textAlign(P.textAlign)})},_=this.isHorizontal(),w=this._computeTitleHeight();_?p={x:$e(r,this.left+d,this.right-i[0]),y:this.top+d+w,line:0}:p={x:this.left+d,y:$e(r,this.top+w+d,this.bottom-n[0].height),line:0},IP(this.ctx,t.textDirection);const S=y+d;this.legendItems.forEach((C,M)=>{s.strokeStyle=C.fontColor||u,s.fillStyle=C.fontColor||u;const P=s.measureText(C.text).width,T=l.textAlign(C.textAlign||(C.textAlign=o.textAlign)),A=m+f+P;let E=p.x,z=p.y;l.setWidth(this.width),_?M>0&&E+A+d>this.right&&(z=p.y+=S,p.line++,E=p.x=$e(r,this.left+d,this.right-i[p.line])):M>0&&z+S>this.bottom&&(E=p.x=E+n[p.line].width+d,p.line++,z=p.y=$e(r,this.top+w+d,this.bottom-n[p.line].height));const N=l.x(E);g(N,z,C),E=LV(T,E+m+f,_?E+A:this.right,t.rtl),x(l.x(E),z,C),_?p.x+=A+d:p.y+=S}),FP(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,i=be(n.font),s=ze(n.padding);if(!n.display)return;const r=Lo(t.rtl,this.left,this.width),o=this.ctx,a=n.position,l=i.size/2,c=s.top+l;let u,d=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),u=this.top+c,d=$e(t.align,d,this.right-h);else{const p=this.columnSizes.reduce((m,v)=>Math.max(m,v.height),0);u=c+$e(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const f=$e(a,d,d+h);o.textAlign=r.textAlign(n0(a)),o.textBaseline="middle",o.strokeStyle=n.color,o.fillStyle=n.color,o.font=i.string,zr(o,n.text,f,u,i)}_computeTitleHeight(){const t=this.options.title,n=be(t.font),i=ze(t.padding);return t.display?n.lineHeight+i.height:0}_getLegendItemAt(t,n){let i,s,r;if(Yi(t,this.left,this.right)&&Yi(n,this.top,this.bottom)){for(r=this.legendHitBoxes,i=0;ie.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:i,textAlign:s,color:r}}=e.legend.options;return e._getSortedDatasetMetas().map(o=>{const a=o.controller.getStyle(n?0:void 0),l=ze(a.borderWidth);return{text:t[o.index].label,fillStyle:a.backgroundColor,fontColor:r,hidden:!o.visible,lineCap:a.borderCapStyle,lineDash:a.borderDash,lineDashOffset:a.borderDashOffset,lineJoin:a.borderJoinStyle,lineWidth:(l.width+l.height)/4,strokeStyle:a.borderColor,pointStyle:i||a.pointStyle,rotation:a.rotation,textAlign:s||a.textAlign,borderRadius:0,datasetIndex:o.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 p0 extends oi{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 i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const s=Vt(i.text)?i.text.length:1;this._padding=ze(i.padding);const r=s*be(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:i,bottom:s,right:r,options:o}=this,a=o.align;let l=0,c,u,d;return this.isHorizontal()?(u=$e(a,i,r),d=n+t,c=r-i):(o.position==="left"?(u=i+t,d=$e(a,s,n),l=qt*-.5):(u=r-t,d=$e(a,n,s),l=qt*.5),c=s-n),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const i=be(n.font),r=i.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(r);zr(t,n.text,0,0,i,{color:n.color,maxWidth:l,rotation:c,textAlign:n0(n.align),textBaseline:"middle",translation:[o,a]})}}function MH(e,t){const n=new p0({ctx:e.ctx,options:t,chart:e});Be.configure(e,n,t),Be.addBox(e,n),e.titleBlock=n}var CH={id:"title",_element:p0,start(e,t,n){MH(e,n)},stop(e){const t=e.titleBlock;Be.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const i=e.titleBlock;Be.configure(e,i,n),i.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 Cu=new WeakMap;var PH={id:"subtitle",start(e,t,n){const i=new p0({ctx:e.ctx,options:n,chart:e});Be.configure(e,i,n),Be.addBox(e,i),Cu.set(e,i)},stop(e){Be.removeBox(e,Cu.get(e)),Cu.delete(e)},beforeUpdate(e,t,n){const i=Cu.get(e);Be.configure(e,i,n),i.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Sl={average(e){if(!e.length)return!1;let t,n,i=0,s=0,r=0;for(t=0,n=e.length;ta({chart:t,initial:n.initial,numSteps:o,currentStep:Math.min(i-n.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=bP.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const r=i.items;let o=r.length-1,a=!1,l;for(;o>=0;--o)l=r[o],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),a=!0):(r[o]=r[r.length-1],r.pop());a&&(s.draw(),this._notify(s,i,t,"progress")),r.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),n+=r.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let i=n.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,i)),i}listen(t,n,i){this._getAnims(t).listeners[n].push(i)}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((i,s)=>Math.max(i,s._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 i=n.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Ri=new Kz;const q1="transparent",Gz={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const i=B1(e||q1),s=i.valid&&B1(t||q1);return s&&s.valid?s.mix(i,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class qz{constructor(t,n,i,s){const r=n[i];s=Ja([t.to,s,r,t.from]);const o=Ja([t.from,r,s]);this._active=!0,this._fn=t.fn||Gz[t.type||typeof o],this._easing=kl[t.easing]||kl.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=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(t,n,i){if(this._active){this._notify(!1);const s=this._target[this._prop],r=i-this._start,o=this._duration-r;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=Ja([t.to,n,s,t.from]),this._from=Ja([t.from,s,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,i=this._duration,s=this._prop,r=this._from,o=this._loop,a=this._to;let l;if(this._active=r!==a&&(o||n1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(r,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,i)=>{t.push({res:n,rej:i})})}_notify(t){const n=t?"res":"rej",i=this._promises||[];for(let s=0;se!=="onProgress"&&e!=="onComplete"&&e!=="fn"});_t.set("animations",{colors:{type:"color",properties:Zz},numbers:{type:"number",properties:Qz}});_t.describe("animations",{_fallback:"animation"});_t.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:e=>e|0}}}});class WP{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!yt(t))return;const n=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const s=t[i];if(!yt(s))return;const r={};for(const o of Jz)r[o]=s[o];(Vt(s.properties)&&s.properties||[i]).forEach(o=>{(o===i||!n.has(o))&&n.set(o,r)})})}_animateOptions(t,n){const i=n.options,s=e5(t,i);if(!s)return[];const r=this._createAnimations(s,i);return i.$shared&&t5(t.options.$animations,i).then(()=>{t.options=i},()=>{}),r}_createAnimations(t,n){const i=this._properties,s=[],r=t.$animations||(t.$animations={}),o=Object.keys(n),a=Date.now();let l;for(l=o.length-1;l>=0;--l){const c=o[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,n));continue}const u=n[c];let d=r[c];const h=i.get(c);if(d)if(h&&d.active()){d.update(h,u,a);continue}else d.cancel();if(!h||!h.duration){t[c]=u;continue}r[c]=d=new qz(h,t,c,u),s.push(d)}return s}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const i=this._createAnimations(t,n);if(i.length)return Ri.add(this._chart,i),!0}}function t5(e,t){const n=[],i=Object.keys(t);for(let s=0;s0||!n&&r<0)return s.index}return null}function e_(e,t){const{chart:n,_cachedMeta:i}=e,s=n._stacks||(n._stacks={}),{iScale:r,vScale:o,index:a}=i,l=r.axis,c=o.axis,u=r5(r,o,i),d=t.length;let h;for(let f=0;fn[i].axis===t).shift()}function l5(e,t){return er(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function c5(e,t,n){return er(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function Da(e,t){const n=e.controller.index,i=e.vScale&&e.vScale.axis;if(i){t=t||e._parsed;for(const s of t){const r=s._stacks;if(!r||r[i]===void 0||r[i][n]===void 0)return;delete r[i][n]}}}const up=e=>e==="reset"||e==="none",n_=(e,t)=>t?e:Object.assign({},e),u5=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:HP(n,!0),values:null};class ri{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.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=J1(t.vScale,t),this.addElements()}updateIndex(t){this.index!==t&&Da(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,i=this.getDataset(),s=(d,h,f,p)=>d==="x"?h:d==="r"?p:f,r=n.xAxisID=ut(i.xAxisID,cp(t,"x")),o=n.yAxisID=ut(i.yAxisID,cp(t,"y")),a=n.rAxisID=ut(i.rAxisID,cp(t,"r")),l=n.indexAxis,c=n.iAxisID=s(l,r,o,a),u=n.vAxisID=s(l,o,r,a);n.xScale=this.getScaleForId(r),n.yScale=this.getScaleForId(o),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(u)}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&&R1(this._data,this),t._stacked&&Da(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),i=this._data;if(yt(n))this._data=s5(n);else if(i!==n){if(i){R1(i,this);const s=this._cachedMeta;Da(s),s._parsed=[]}n&&Object.isExtensible(n)&&AV(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,i=this.getDataset();let s=!1;this._dataCheck();const r=n._stacked;n._stacked=J1(n.vScale,n),n.stack!==i.stack&&(s=!0,Da(n),n.stack=i.stack),this._resyncElements(t),(s||r!==n._stacked)&&e_(this,n._parsed)}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:i,_data:s}=this,{iScale:r,_stacked:o}=i,a=r.axis;let l=t===0&&n===s.length?!0:i._sorted,c=t>0&&i._parsed[t-1],u,d,h;if(this._parsing===!1)i._parsed=s,i._sorted=!0,h=s;else{Vt(s[t])?h=this.parseArrayData(i,s,t,n):yt(s[t])?h=this.parseObjectData(i,s,t,n):h=this.parsePrimitiveData(i,s,t,n);const f=()=>d[a]===null||c&&d[a]m||d=0;--h)if(!p()){this.updateRangeFromParsed(c,t,f,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,i=[];let s,r,o;for(s=0,r=n.length;s=0&&tthis.getContext(i,s),m=c.resolveNamedOptions(h,f,p,d);return m.$shared&&(m.$shared=l,r[o]=Object.freeze(n_(m,l))),m}_resolveAnimations(t,n,i){const s=this.chart,r=this._cachedDataOpts,o=`animation-${n}`,a=r[o];if(a)return a;let l;if(s.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,n),h=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(h,this.getContext(t,i,n))}const c=new WP(s,l&&l.animations);return l&&l._cacheable&&(r[o]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||up(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const i=this.resolveDataElementOptions(t,n),s=this._sharedOptions,r=this.getSharedOptions(i),o=this.includeOptions(n,r)||r!==s;return this.updateSharedOptions(r,n,i),{sharedOptions:r,includeOptions:o}}updateElement(t,n,i,s){up(s)?Object.assign(t,i):this._resolveAnimations(n,s).update(t,i)}updateSharedOptions(t,n,i){t&&!up(n)&&this._resolveAnimations(void 0,n).update(t,i)}_setStyle(t,n,i,s){t.active=s;const r=this.getStyle(n,s);this._resolveAnimations(n,i,s).update(t,{options:!s&&this.getSharedOptions(r)||r})}removeHoverStyle(t,n,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,n,i){this._setStyle(t,i,"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,i=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const s=i.length,r=n.length,o=Math.min(r,s);o&&this.parse(0,o),r>s?this._insertElements(s,r-s,t):r{for(c.length+=n,a=c.length-1;a>=o;a--)c[a]=c[a-n]};for(l(r),a=t;as-r))}return e._cache.$bar}function h5(e){const t=e.iScale,n=d5(t,e.type);let i=t._length,s,r,o,a;const l=()=>{o===32767||o===-32768||(Hn(a)&&(i=Math.min(i,Math.abs(o-a)||i)),a=o)};for(s=0,r=n.length;s0?s[e-1]:null,a=eMath.abs(a)&&(l=a,c=o),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:r,min:o,max:a}}function UP(e,t,n,i){return Vt(e)?m5(e,t,n,i):t[n.axis]=n.parse(e,i),t}function i_(e,t,n,i){const s=e.iScale,r=e.vScale,o=s.getLabels(),a=s===r,l=[];let c,u,d,h;for(c=n,u=n+i;c=n?1:-1)}function y5(e){let t,n,i,s,r;return e.horizontal?(t=e.base>e.x,n="left",i="right"):(t=e.basel.controller.options.grouped),r=i.options.stacked,o=[],a=l=>{const c=l.controller.getParsed(n),u=c&&c[l.vScale.axis];if(Mt(u)||isNaN(u))return!0};for(const l of s)if(!(n!==void 0&&a(l))&&((r===!1||o.indexOf(l.stack)===-1||r===void 0&&l.stack===void 0)&&o.push(l.stack),l.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,n,i){const s=this._getStacks(t,i),r=n!==void 0?s.indexOf(n):-1;return r===-1?s.length-1:r}_getRuler(){const t=this.options,n=this._cachedMeta,i=n.iScale,s=[];let r,o;for(r=0,o=n.data.length;r=0;--i)n=Math.max(n,t[i].size(this.resolveDataElementOptions(i))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,{xScale:i,yScale:s}=n,r=this.getParsed(t),o=i.getLabelForValue(r.x),a=s.getLabelForValue(r.y),l=r._custom;return{label:n.label,value:"("+o+", "+a+(l?", "+l:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,i,s){const r=s==="reset",{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(n,s),u=o.axis,d=a.axis;for(let h=n;htc(x,a,l,!0)?1:Math.max(_,_*n,w,w*n),p=(x,_,w)=>tc(x,a,l,!0)?-1:Math.min(_,_*n,w,w*n),m=f(0,c,d),v=f(ae,u,h),y=p(qt,c,d),g=p(qt+ae,u,h);i=(m-y)/2,s=(v-g)/2,r=-(m+y)/2,o=-(v+g)/2}return{ratioX:i,ratioY:s,offsetX:r,offsetY:o}}class oa extends ri{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 i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let r=l=>+i[l];if(yt(i[t])){const{key:l="value"}=this._parsing;r=c=>+Ys(i[c],l)}let o,a;for(o=t,a=t+n;o0&&!isNaN(t)?Nt*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=kc(n._parsed[t],i.options.locale);return{label:s[t]||"",value:r}}getMaxBorderWidth(t){let n=0;const i=this.chart;let s,r,o,a,l;if(!t){for(s=0,r=i.data.datasets.length;se!=="spacing",_indexable:e=>e!=="spacing"};oa.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const t=e.data;if(t.labels.length&&t.datasets.length){const{labels:{pointStyle:n}}=e.legend.options;return t.labels.map((i,s)=>{const o=e.getDatasetMeta(0).controller.getStyle(s);return{text:i,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:n,hidden:!e.getDataVisibility(s),index:s}})}return[]}},onClick(e,t,n){n.chart.toggleDataVisibility(t.index),n.chart.update()}},tooltip:{callbacks:{title(){return""},label(e){let t=e.label;const n=": "+e.formattedValue;return Vt(t)?(t=t.slice(),t[0]+=n):t+=n,t}}}}};class Yh extends ri{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:i,data:s=[],_dataset:r}=n,o=this.chart._animationsDisabled;let{start:a,count:l}=wP(n,s,o);this._drawStart=a,this._drawCount=l,kP(n)&&(a=0,l=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!r._decimated,i.points=s;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:c},t),this.updateElements(s,a,l,t)}updateElements(t,n,i,s){const r=s==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(n,s),h=o.axis,f=a.axis,{spanGaps:p,segment:m}=this.options,v=ta(p)?p:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||r||s==="none";let g=n>0&&this.getParsed(n-1);for(let x=n;x0&&Math.abs(w[h]-g[h])>v,m&&(S.parsed=w,S.raw=c.data[x]),d&&(S.options=u||this.resolveDataElementOptions(x,_.active?"active":s)),y||this.updateElement(_,x,S,s),g=w}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,i=n.options&&n.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const r=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,r,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}Yh.id="line";Yh.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};Yh.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class Xh extends ri{constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=kc(n._parsed[t].r,i.options.locale);return{label:s[t]||"",value:r}}parseObjectData(t,n,i,s){return NP.bind(this)(t,n,i,s)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,s)=>{const r=this.getParsed(s).r;!isNaN(r)&&this.chart.getDataVisibility(s)&&(rn.max&&(n.max=r))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,i=t.options,s=Math.min(n.right-n.left,n.bottom-n.top),r=Math.max(s/2,0),o=Math.max(i.cutoutPercentage?r/100*i.cutoutPercentage:1,0),a=(r-o)/t.getVisibleDatasetCount();this.outerRadius=r-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,n,i,s){const r=s==="reset",o=this.chart,l=o.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,d=c.yCenter,h=c.getIndexAngle(0)-.5*qt;let f=h,p;const m=360/this.countVisibleElements();for(p=0;p{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&n++}),n}_computeAngle(t,n,i){return this.chart.getDataVisibility(t)?ti(this.resolveDataElementOptions(t,n).angle||i):0}}Xh.id="polarArea";Xh.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};Xh.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const t=e.data;if(t.labels.length&&t.datasets.length){const{labels:{pointStyle:n}}=e.legend.options;return t.labels.map((i,s)=>{const o=e.getDatasetMeta(0).controller.getStyle(s);return{text:i,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:n,hidden:!e.getDataVisibility(s),index:s}})}return[]}},onClick(e,t,n){n.chart.toggleDataVisibility(t.index),n.chart.update()}},tooltip:{callbacks:{title(){return""},label(e){return e.chart.data.labels[e.dataIndex]+": "+e.formattedValue}}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class d0 extends oa{}d0.id="pie";d0.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class Kh extends ri{getLabelAndValue(t){const n=this._cachedMeta.vScale,i=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(i[n.axis])}}parseObjectData(t,n,i,s){return NP.bind(this)(t,n,i,s)}update(t){const n=this._cachedMeta,i=n.dataset,s=n.data||[],r=n.iScale.getLabels();if(i.points=s,t!=="resize"){const o=this.resolveDatasetElementOptions(t);this.options.showLine||(o.borderWidth=0);const a={_loop:!0,_fullLoop:r.length===s.length,options:o};this.updateElement(i,void 0,a,t)}this.updateElements(s,0,s.length,t)}updateElements(t,n,i,s){const r=this._cachedMeta.rScale,o=s==="reset";for(let a=n;a{s[r]=i[r]&&i[r].active()?i[r]._to:this[r]}),s}};oi.defaults={};oi.defaultRoutes=void 0;const YP={values(e){return Vt(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const i=this.chart.options.locale;let s,r=e;if(n.length>1){const c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),r=w5(e,n)}const o=jn(Math.abs(r)),a=Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),kc(e,i,l)},logarithmic(e,t,n){if(e===0)return"0";const i=e/Math.pow(10,Math.floor(jn(e)));return i===1||i===2||i===5?YP.numeric.call(this,e,t,n):""}};function w5(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 Gh={formatters:YP};_t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth: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:Gh.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}});_t.route("scale.ticks","color","","color");_t.route("scale.grid","color","","borderColor");_t.route("scale.grid","borderColor","","borderColor");_t.route("scale.title","color","","color");_t.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"});_t.describe("scales",{_fallback:"scale"});_t.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"});function k5(e,t){const n=e.options.ticks,i=n.maxTicksLimit||S5(e),s=n.major.enabled?C5(t):[],r=s.length,o=s[0],a=s[r-1],l=[];if(r>i)return P5(t,l,s,r/i),l;const c=M5(s,t,i);if(r>0){let u,d;const h=r>1?Math.round((a-o)/(r-1)):null;for(ku(t,l,c,Mt(h)?0:o-h,o),u=0,d=r-1;us)return l}return Math.max(s,1)}function C5(e){const t=[];let n,i;for(n=0,i=e.length;ne==="left"?"right":e==="right"?"left":e,o_=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n;function a_(e,t){const n=[],i=e.length/t,s=e.length;let r=0;for(;ro+a)))return l}function A5(e,t){At(e,n=>{const i=n.gc,s=i.length/2;let r;if(s>t){for(r=0;ri?i:n,i=s&&n>i?n:i,{min:On(n,On(i,n)),max:On(i,On(n,i))}}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||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Ft(this.options.beforeUpdate,[this])}update(t,n,i){const{beginAtZero:s,grace:r,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=fz(this,r,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a=r||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const u=this._getLabelSizes(),d=u.widest.width,h=u.highest.height,f=ke(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/i:f/(i-1),d+6>a&&(a=f/(i-(t.offset?.5:1)),l=this.maxHeight-Ea(t.grid)-n.padding-l_(t.title,this.chart.options.font),c=Math.sqrt(d*d+h*h),o=t0(Math.min(Math.asin(ke((u.highest.height+6)/a,-1,1)),Math.asin(ke(l/c,-1,1))-Math.asin(ke(h/c,-1,1)))),o=Math.max(s,Math.min(r,o))),this.labelRotation=o}afterCalculateLabelRotation(){Ft(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Ft(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:i,title:s,grid:r}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const l=l_(s,n.options.font);if(a?(t.width=this.maxWidth,t.height=Ea(r)+l):(t.height=this.maxHeight,t.width=Ea(r)+l),i.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:h}=this._getLabelSizes(),f=i.padding*2,p=ti(this.labelRotation),m=Math.cos(p),v=Math.sin(p);if(a){const y=i.mirror?0:v*d.width+m*h.height;t.height=Math.min(this.maxHeight,t.height+y+f)}else{const y=i.mirror?0:m*d.width+v*h.height;t.width=Math.min(this.maxWidth,t.width+y+f)}this._calculatePadding(c,u,v,m)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,i,s){const{ticks:{align:r,padding:o},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,f=0;l?c?(h=s*t.width,f=i*n.height):(h=i*t.height,f=s*n.width):r==="start"?f=n.width:r==="end"?h=t.width:r!=="inner"&&(h=t.width/2,f=n.width/2),this.paddingLeft=Math.max((h-u+o)*this.width/(this.width-u),0),this.paddingRight=Math.max((f-d+o)*this.width/(this.width-d),0)}else{let u=n.height/2,d=t.height/2;r==="start"?(u=0,d=t.height):r==="end"&&(u=n.height,d=0),this.paddingTop=u+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(){Ft(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,i;for(n=0,i=t.length;n({width:r[C]||0,height:o[C]||0});return{first:S(0),last:S(n-1),widest:S(_),highest:S(w),widths:r,heights:o}}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 TV(this._alignToPixels?cr(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&&ta*s?a/i:l/s:l*s0}_computeGridLineItems(t){const n=this.axis,i=this.chart,s=this.options,{grid:r,position:o}=s,a=r.offset,l=this.isHorizontal(),u=this.ticks.length+(a?1:0),d=Ea(r),h=[],f=r.setContext(this.getContext()),p=f.drawBorder?f.borderWidth:0,m=p/2,v=function(R){return cr(i,R,p)};let y,g,x,_,w,S,C,M,P,T,A,E;if(o==="top")y=v(this.bottom),S=this.bottom-d,M=y-m,T=v(t.top)+m,E=t.bottom;else if(o==="bottom")y=v(this.top),T=t.top,E=v(t.bottom)-m,S=y+m,M=this.top+d;else if(o==="left")y=v(this.right),w=this.right-d,C=y-m,P=v(t.left)+m,A=t.right;else if(o==="right")y=v(this.left),P=t.left,A=v(t.right)-m,w=y+m,C=this.left+d;else if(n==="x"){if(o==="center")y=v((t.top+t.bottom)/2+.5);else if(yt(o)){const R=Object.keys(o)[0],L=o[R];y=v(this.chart.scales[R].getPixelForValue(L))}T=t.top,E=t.bottom,S=y+m,M=S+d}else if(n==="y"){if(o==="center")y=v((t.left+t.right)/2);else if(yt(o)){const R=Object.keys(o)[0],L=o[R];y=v(this.chart.scales[R].getPixelForValue(L))}w=y-m,C=w-d,P=t.left,A=t.right}const z=ut(s.ticks.maxTicksLimit,u),N=Math.max(1,Math.ceil(u/z));for(g=0;gr.value===t);return s>=0?n.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const n=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let r,o;const a=(l,c,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(n.display)for(r=0,o=s.length;r{this.draw(s)}}]:[{z:i,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:i+1,draw:()=>{this.drawBorder()}},{z:n,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let r,o;for(r=0,o=n.length;r{const i=n.split("."),s=i.pop(),r=[e].concat(i).join("."),o=t[n].split("."),a=o.pop(),l=o.join(".");_t.route(r,s,l,a)})}function I5(e){return"id"in e&&"defaults"in e}class F5{constructor(){this.controllers=new Su(ri,"datasets",!0),this.elements=new Su(oi,"elements"),this.plugins=new Su(Object,"plugins"),this.scales=new Su(Xr,"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,i){[...n].forEach(s=>{const r=i||this._getRegistryForType(s);i||r.isForType(s)||r===this.plugins&&s.id?this._exec(t,r,s):At(s,o=>{const a=i||this._getRegistryForType(o);this._exec(t,a,o)})})}_exec(t,n,i){const s=Jy(t);Ft(i["before"+s],[],i),n[t](i),Ft(i["after"+s],[],i)}_getRegistryForType(t){for(let n=0;n0&&this.getParsed(n-1);for(let _=n;_0&&Math.abs(S[f]-x[f])>y,v&&(C.parsed=S,C.raw=c.data[_]),h&&(C.options=d||this.resolveDataElementOptions(_,w.active?"active":s)),g||this.updateElement(w,_,C,s),x=S}this.updateSharedOptions(d,s,u)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let a=0;for(let l=n.length-1;l>=0;--l)a=Math.max(a,n[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!n.length)return s;const r=n[0].size(this.resolveDataElementOptions(0)),o=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(s,r,o)/2}}qh.id="scatter";qh.defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};qh.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title(){return""},label(e){return"("+e.label+", "+e.formattedValue+")"}}}},scales:{x:{type:"linear"},y:{type:"linear"}}};var B5=Object.freeze({__proto__:null,BarController:Hh,BubbleController:Uh,DoughnutController:oa,LineController:Yh,PolarAreaController:Xh,PieController:d0,RadarController:Kh,ScatterController:qh});function ur(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Xm{constructor(t){this.options=t||{}}init(t){}formats(){return ur()}parse(t,n){return ur()}format(t,n){return ur()}add(t,n,i){return ur()}diff(t,n,i){return ur()}startOf(t,n,i){return ur()}endOf(t,n){return ur()}}Xm.override=function(e){Object.assign(Xm.prototype,e)};var V5={_date:Xm};function z5(e,t,n,i){const{controller:s,data:r,_sorted:o}=e,a=s._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&o&&r.length){const l=a._reversePixels?DV:Xi;if(i){if(s._sharedOptions){const c=r[0],u=typeof c.getRange=="function"&&c.getRange(t);if(u){const d=l(r,t,n-u),h=l(r,t,n+u);return{lo:d.lo,hi:h.hi}}}}else return l(r,t,n)}return{lo:0,hi:r.length-1}}function Sc(e,t,n,i,s){const r=e.getSortedVisibleDatasetMetas(),o=n[t];for(let a=0,l=r.length;a{l[o](t[n],s)&&(r.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,s))}),i&&!a?[]:r}var Y5={evaluateInteractionItems:Sc,modes:{index(e,t,n,i){const s=vr(t,e),r=n.axis||"x",o=n.includeInvisible||!1,a=n.intersect?hp(e,s,r,i,o):fp(e,s,r,!1,i,o),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(e,t,n,i){const s=vr(t,e),r=n.axis||"xy",o=n.includeInvisible||!1;let a=n.intersect?hp(e,s,r,i,o):fp(e,s,r,!1,i,o);if(a.length>0){const l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let u=0;un.pos===t)}function u_(e,t){return e.filter(n=>XP.indexOf(n.pos)===-1&&n.box.axis===t)}function Oa(e,t){return e.sort((n,i)=>{const s=t?i:n,r=t?n:i;return s.weight===r.weight?s.index-r.index:s.weight-r.weight})}function X5(e){const t=[];let n,i,s,r,o,a;for(n=0,i=(e||[]).length;nc.box.fullSize),!0),i=Oa(Aa(t,"left"),!0),s=Oa(Aa(t,"right")),r=Oa(Aa(t,"top"),!0),o=Oa(Aa(t,"bottom")),a=u_(t,"x"),l=u_(t,"y");return{fullSize:n,leftAndTop:i.concat(r),rightAndBottom:s.concat(l).concat(o).concat(a),chartArea:Aa(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:r.concat(o).concat(a)}}function d_(e,t,n,i){return Math.max(e[n],t[n])+Math.max(e[i],t[i])}function KP(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 Q5(e,t,n,i){const{pos:s,box:r}=n,o=e.maxPadding;if(!yt(s)){n.size&&(e[s]-=n.size);const d=i[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?r.height:r.width),n.size=d.size/d.count,e[s]+=n.size}r.getPadding&&KP(o,r.getPadding());const a=Math.max(0,t.outerWidth-d_(o,e,"left","right")),l=Math.max(0,t.outerHeight-d_(o,e,"top","bottom")),c=a!==e.w,u=l!==e.h;return e.w=a,e.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function Z5(e){const t=e.maxPadding;function n(i){const s=Math.max(t[i]-e[i],0);return e[i]+=s,s}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function J5(e,t){const n=t.maxPadding;function i(s){const r={left:0,top:0,right:0,bottom:0};return s.forEach(o=>{r[o]=Math.max(t[o],n[o])}),r}return i(e?["left","right"]:["top","bottom"])}function tl(e,t,n,i){const s=[];let r,o,a,l,c,u;for(r=0,o=e.length,c=0;r{typeof m.beforeLayout=="function"&&m.beforeLayout()});const u=l.reduce((m,v)=>v.box.options&&v.box.options.display===!1?m:m+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:s,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/u,hBoxMaxHeight:o/2}),h=Object.assign({},s);KP(h,ze(i));const f=Object.assign({maxPadding:h,w:r,h:o,x:s.left,y:s.top},s),p=G5(l.concat(c),d);tl(a.fullSize,f,d,p),tl(l,f,d,p),tl(c,f,d,p)&&tl(l,f,d,p),Z5(f),h_(a.leftAndTop,f,d,p),f.x+=f.w,f.y+=f.h,h_(a.rightAndBottom,f,d,p),e.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},At(a.chartArea,m=>{const v=m.box;Object.assign(v,e.chartArea),v.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class GP{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,i){}removeEventListener(t,n,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,i,s){return n=Math.max(0,n||t.width),i=i||t.height,{width:n,height:Math.max(0,s?Math.floor(n/s):i)}}isAttached(t){return!0}updateConfig(t){}}class tW extends GP{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const rd="$chartjs",eW={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},f_=e=>e===null||e==="";function nW(e,t){const n=e.style,i=e.getAttribute("height"),s=e.getAttribute("width");if(e[rd]={initial:{height:i,width:s,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",f_(s)){const r=U1(e,"width");r!==void 0&&(e.width=r)}if(f_(i))if(e.style.height==="")e.height=e.width/(t||2);else{const r=U1(e,"height");r!==void 0&&(e.height=r)}return e}const qP=jz?{passive:!0}:!1;function iW(e,t,n){e.addEventListener(t,n,qP)}function sW(e,t,n){e.canvas.removeEventListener(t,n,qP)}function rW(e,t){const n=eW[e.type]||e.type,{x:i,y:s}=vr(e,t);return{type:n,chart:t,native:e,x:i!==void 0?i:null,y:s!==void 0?s:null}}function nh(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function oW(e,t,n){const i=e.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||nh(a.addedNodes,i),o=o&&!nh(a.removedNodes,i);o&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}function aW(e,t,n){const i=e.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||nh(a.removedNodes,i),o=o&&!nh(a.addedNodes,i);o&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}const ic=new Map;let p_=0;function QP(){const e=window.devicePixelRatio;e!==p_&&(p_=e,ic.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function lW(e,t){ic.size||window.addEventListener("resize",QP),ic.set(e,t)}function cW(e){ic.delete(e),ic.size||window.removeEventListener("resize",QP)}function uW(e,t,n){const i=e.canvas,s=i&&u0(i);if(!s)return;const r=_P((a,l)=>{const c=s.clientWidth;n(a,l),c{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||r(c,u)});return o.observe(s),lW(e,r),o}function pp(e,t,n){n&&n.disconnect(),t==="resize"&&cW(e)}function dW(e,t,n){const i=e.canvas,s=_P(r=>{e.ctx!==null&&n(rW(r,e))},e,r=>{const o=r[0];return[o,o.offsetX,o.offsetY]});return iW(i,t,s),s}class hW extends GP{acquireContext(t,n){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(nW(t,n),i):null}releaseContext(t){const n=t.canvas;if(!n[rd])return!1;const i=n[rd].initial;["height","width"].forEach(r=>{const o=i[r];Mt(o)?n.removeAttribute(r):n.setAttribute(r,o)});const s=i.style||{};return Object.keys(s).forEach(r=>{n.style[r]=s[r]}),n.width=n.width,delete n[rd],!0}addEventListener(t,n,i){this.removeEventListener(t,n);const s=t.$proxies||(t.$proxies={}),o={attach:oW,detach:aW,resize:uW}[n]||dW;s[n]=o(t,n,i)}removeEventListener(t,n){const i=t.$proxies||(t.$proxies={}),s=i[n];if(!s)return;({attach:pp,detach:pp,resize:pp}[n]||sW)(t,n,s),i[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,i,s){return Nz(t,n,i,s)}isAttached(t){const n=u0(t);return!!(n&&n.isConnected)}}function fW(e){return!$P()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?tW:hW}class pW{constructor(){this._init=[]}notify(t,n,i,s){n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const r=s?this._descriptors(t).filter(s):this._descriptors(t),o=this._notify(r,t,n,i);return n==="afterDestroy"&&(this._notify(r,t,"stop"),this._notify(this._init,t,"uninstall")),o}_notify(t,n,i,s){s=s||{};for(const r of t){const o=r.plugin,a=o[i],l=[n,s,r.options];if(Ft(a,l,o)===!1&&s.cancelable)return!1}return!0}invalidate(){Mt(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 i=t&&t.config,s=ut(i.options&&i.options.plugins,{}),r=mW(i);return s===!1&&!n?[]:yW(t,r,s,n)}_notifyStateChanges(t){const n=this._oldCache||[],i=this._cache,s=(r,o)=>r.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(s(n,i),t,"stop"),this._notify(s(i,n),t,"start")}}function mW(e){const t={},n=[],i=Object.keys(pi.plugins.items);for(let r=0;r{const l=i[a];if(!yt(l))return console.error(`Invalid scale configuration for scale: ${a}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const c=Gm(a,l),u=bW(c,s),d=n.scales||{};r[c]=r[c]||a,o[a]=_l(Object.create(null),[{axis:c},l,d[c],d[u]])}),e.data.datasets.forEach(a=>{const l=a.type||e.type,c=a.indexAxis||Km(l,t),d=(Vr[l]||{}).scales||{};Object.keys(d).forEach(h=>{const f=xW(h,c),p=a[f+"AxisID"]||r[f]||f;o[p]=o[p]||Object.create(null),_l(o[p],[{axis:f},i[p],d[h]])})}),Object.keys(o).forEach(a=>{const l=o[a];_l(l,[_t.scales[l.type],_t.scale])}),o}function ZP(e){const t=e.options||(e.options={});t.plugins=ut(t.plugins,{}),t.scales=wW(e,t)}function JP(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function kW(e){return e=e||{},e.data=JP(e.data),ZP(e),e}const m_=new Map,tT=new Set;function Cu(e,t){let n=m_.get(e);return n||(n=t(),m_.set(e,n),tT.add(n)),n}const Ra=(e,t,n)=>{const i=Ys(t,n);i!==void 0&&e.add(i)};class SW{constructor(t){this._config=kW(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=JP(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(),ZP(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Cu(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return Cu(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return Cu(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,i=this.type;return Cu(`${i}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const i=this._scopeCache;let s=i.get(t);return(!s||n)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,n,i){const{options:s,type:r}=this,o=this._cachedScopes(t,i),a=o.get(n);if(a)return a;const l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(d=>Ra(l,t,d))),u.forEach(d=>Ra(l,s,d)),u.forEach(d=>Ra(l,Vr[r]||{},d)),u.forEach(d=>Ra(l,_t,d)),u.forEach(d=>Ra(l,Um,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),tT.has(n)&&o.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,Vr[n]||{},_t.datasets[n]||{},{type:n},_t,Um]}resolveNamedOptions(t,n,i,s=[""]){const r={$shared:!0},{resolver:o,subPrefixes:a}=g_(this._resolverCache,t,s);let l=o;if(CW(o,n)){r.$shared=!1,i=Xs(i)?i():i;const c=this.createResolver(t,i,a);l=ea(o,i,c)}for(const c of n)r[c]=l[c];return r}createResolver(t,n,i=[""],s){const{resolver:r}=g_(this._resolverCache,t,i);return yt(n)?ea(r,n,void 0,s):r}}function g_(e,t,n){let i=e.get(t);i||(i=new Map,e.set(t,i));const s=n.join();let r=i.get(s);return r||(r={resolver:a0(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},i.set(s,r)),r}const MW=e=>yt(e)&&Object.getOwnPropertyNames(e).reduce((t,n)=>t||Xs(e[n]),!1);function CW(e,t){const{isScriptable:n,isIndexable:i}=AP(e);for(const s of t){const r=n(s),o=i(s),a=(o||r)&&e[s];if(r&&(Xs(a)||MW(a))||o&&Vt(a))return!0}return!1}var PW="3.9.1";const TW=["top","bottom","left","right","chartArea"];function y_(e,t){return e==="top"||e==="bottom"||TW.indexOf(e)===-1&&t==="x"}function v_(e,t){return function(n,i){return n[e]===i[e]?n[t]-i[t]:n[e]-i[e]}}function x_(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),Ft(n&&n.onComplete,[e],t)}function DW(e){const t=e.chart,n=t.options.animation;Ft(n&&n.onProgress,[e],t)}function eT(e){return $P()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const ih={},nT=e=>{const t=eT(e);return Object.values(ih).filter(n=>n.canvas===t).pop()};function EW(e,t,n){const i=Object.keys(e);for(const s of i){const r=+s;if(r>=t){const o=e[s];delete e[s],(n>0||r>t)&&(e[r+n]=o)}}}function AW(e,t,n,i){return!n||e.type==="mouseout"?null:i?t:e}class h0{constructor(t,n){const i=this.config=new SW(n),s=eT(t),r=nT(s);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||fW(s)),this.platform.updateConfig(i);const a=this.platform.acquireContext(s,o.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=gV(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,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 pW,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=OV(d=>this.update(d),o.resizeDelay||0),this._dataChanges=[],ih[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Ri.listen(this,"complete",x_),Ri.listen(this,"progress",DW),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:i,height:s,_aspectRatio:r}=this;return Mt(t)?n&&r?r:s?i/s: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}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():H1(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return V1(this.canvas,this.ctx),this}stop(){return Ri.stop(this),this}resize(t,n){Ri.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const i=this.options,s=this.canvas,r=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,t,n,r),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,H1(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),Ft(i.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};At(n,(i,s)=>{i.id=s})}buildOrUpdateScales(){const t=this.options,n=t.scales,i=this.scales,s=Object.keys(i).reduce((o,a)=>(o[a]=!1,o),{});let r=[];n&&(r=r.concat(Object.keys(n).map(o=>{const a=n[o],l=Gm(o,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),At(r,o=>{const a=o.options,l=a.id,c=Gm(l,a),u=ut(a.type,o.dtype);(a.position===void 0||y_(a.position,c)!==y_(o.dposition))&&(a.position=o.dposition),s[l]=!0;let d=null;if(l in i&&i[l].type===u)d=i[l];else{const h=pi.getScale(u);d=new h({id:l,type:u,ctx:this.ctx,chart:this}),i[d.id]=d}d.init(a,t)}),At(s,(o,a)=>{o||delete i[a]}),At(i,o=>{Be.configure(this,o,o.options),Be.addBox(this,o)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,i=t.length;if(t.sort((s,r)=>s.index-r.index),i>n){for(let s=n;sn.length&&delete this._stacks,t.forEach((i,s)=>{n.filter(r=>r===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=n.length;i{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const i=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let c=0,u=this.data.datasets.length;c{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(v_("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){At(this.scales,t=>{Be.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!D1(n,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:r}of n){const o=i==="_removeElements"?-r:r;EW(t,s,o)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,i=r=>new Set(t.filter(o=>o[0]===r).map((o,a)=>a+","+o.splice(1).join(","))),s=i(0);for(let r=1;rr.split(",")).map(r=>({method:r[1],start:+r[2],count:+r[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Be.update(this,this.width,this.height,t);const n=this.chartArea,i=n.width<=0||n.height<=0;this._layers=[],At(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,r)=>{s._idx=r}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,i=this.data.datasets.length;n=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,i=t._clip,s=!i.disabled,r=this.chartArea,o={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(s&&Vh(n,{left:i.left===!1?0:r.left-i.left,right:i.right===!1?this.width:r.right+i.right,top:i.top===!1?0:r.top-i.top,bottom:i.bottom===!1?this.height:r.bottom+i.bottom}),t.controller.draw(),s&&zh(n),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return ec(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,i,s){const r=Y5.modes[n];return typeof r=="function"?r(this,t,i,s):[]}getDatasetMeta(t){const n=this.data.datasets[t],i=this._metasets;let s=i.filter(r=>r&&r._dataset===n).pop();return s||(s={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},i.push(s)),s}getContext(){return this.$context||(this.$context=er(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!n.hidden}setDatasetVisibility(t,n){const i=this.getDatasetMeta(t);i.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,i){const s=i?"show":"hide",r=this.getDatasetMeta(t),o=r.controller._resolveAnimations(void 0,s);Hn(n)?(r.data[n].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(r,{visible:i}),this.update(a=>a.datasetIndex===t?s: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(),Ri.remove(this),t=0,n=this.data.datasets.length;t{n.addEventListener(this,r,o),t[r]=o},s=(r,o,a)=>{r.offsetX=o,r.offsetY=a,this._eventHandler(r)};At(this.options.events,r=>i(r,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,i=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},r=(l,c)=>{this.canvas&&this.resize(l,c)};let o;const a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",r),i("detach",o)};o=()=>{this.attached=!1,s("resize",r),this._stop(),this._resize(0,0),i("attach",a)},n.isAttached(this.canvas)?a():o()}unbindEvents(){At(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},At(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,i){const s=i?"set":"remove";let r,o,a,l;for(n==="dataset"&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=t.length;a{const a=this.getDatasetMeta(r);if(!a)throw new Error("No dataset found at index "+r);return{datasetIndex:r,element:a.data[o],index:o}});!qd(i,n)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,n))}notifyPlugins(t,n,i){return this._plugins.notify(this,t,n,i)}_updateHoverStyles(t,n,i){const s=this.options.hover,r=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),o=r(n,t),a=i?t:r(t,n);o.length&&this.updateHoverStyle(o,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,n){const i={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},s=o=>(o.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const r=this._handleEvent(t,n,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(r||i.changed)&&this.render(),this}_handleEvent(t,n,i){const{_active:s=[],options:r}=this,o=n,a=this._getActiveElements(t,s,i,o),l=wV(t),c=AW(t,this._lastEvent,i,l);i&&(this._lastEvent=null,Ft(r.onHover,[t,a,this],this),l&&Ft(r.onClick,[t,a,this],this));const u=!qd(a,s);return(u||n)&&(this._active=a,this._updateHoverStyles(a,s,n)),this._lastEvent=c,u}_getActiveElements(t,n,i,s){if(t.type==="mouseout")return[];if(!i)return n;const r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,s)}}const b_=()=>At(h0.instances,e=>e._plugins.invalidate()),hs=!0;Object.defineProperties(h0,{defaults:{enumerable:hs,value:_t},instances:{enumerable:hs,value:ih},overrides:{enumerable:hs,value:Vr},registry:{enumerable:hs,value:pi},version:{enumerable:hs,value:PW},getChart:{enumerable:hs,value:nT},register:{enumerable:hs,value:(...e)=>{pi.add(...e),b_()}},unregister:{enumerable:hs,value:(...e)=>{pi.remove(...e),b_()}}});function iT(e,t,n){const{startAngle:i,pixelMargin:s,x:r,y:o,outerRadius:a,innerRadius:l}=t;let c=s/a;e.beginPath(),e.arc(r,o,a,i-c,n+c),l>s?(c=s/l,e.arc(r,o,l,n+c,i-c,!0)):e.arc(r,o,s,n+ae,i-ae),e.closePath(),e.clip()}function OW(e){return o0(e,["outerStart","outerEnd","innerStart","innerEnd"])}function RW(e,t,n,i){const s=OW(e.options.borderRadius),r=(n-t)/2,o=Math.min(r,i*t/2),a=l=>{const c=(n-Math.min(r,l))*i/2;return ke(l,0,Math.min(r,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:ke(s.innerStart,0,o),innerEnd:ke(s.innerEnd,0,o)}}function to(e,t,n,i){return{x:n+e*Math.cos(t),y:i+e*Math.sin(t)}}function qm(e,t,n,i,s,r){const{x:o,y:a,startAngle:l,pixelMargin:c,innerRadius:u}=t,d=Math.max(t.outerRadius+i+n-c,0),h=u>0?u+i+n+c:0;let f=0;const p=s-l;if(i){const R=u>0?u-i:0,L=d>0?d-i:0,B=(R+L)/2,D=B!==0?p*B/(B+i):p;f=(p-D)/2}const m=Math.max(.001,p*d-n/qt)/d,v=(p-m)/2,y=l+v+f,g=s-v-f,{outerStart:x,outerEnd:_,innerStart:w,innerEnd:S}=RW(t,h,d,g-y),C=d-x,M=d-_,P=y+x/C,T=g-_/M,A=h+w,E=h+S,z=y+w/A,N=g-S/E;if(e.beginPath(),r){if(e.arc(o,a,d,P,T),_>0){const B=to(M,T,o,a);e.arc(B.x,B.y,_,T,g+ae)}const R=to(E,g,o,a);if(e.lineTo(R.x,R.y),S>0){const B=to(E,N,o,a);e.arc(B.x,B.y,S,g+ae,N+Math.PI)}if(e.arc(o,a,h,g-S/h,y+w/h,!0),w>0){const B=to(A,z,o,a);e.arc(B.x,B.y,w,z+Math.PI,y-ae)}const L=to(C,y,o,a);if(e.lineTo(L.x,L.y),x>0){const B=to(C,P,o,a);e.arc(B.x,B.y,x,y-ae,P)}}else{e.moveTo(o,a);const R=Math.cos(P)*d+o,L=Math.sin(P)*d+a;e.lineTo(R,L);const B=Math.cos(T)*d+o,D=Math.sin(T)*d+a;e.lineTo(B,D)}e.closePath()}function LW(e,t,n,i,s){const{fullCircles:r,startAngle:o,circumference:a}=t;let l=t.endAngle;if(r){qm(e,t,n,i,o+Nt,s);for(let c=0;c=Nt||tc(r,a,l),m=Yi(o,c+h,u+h);return p&&m}getCenterPoint(t){const{x:n,y:i,startAngle:s,endAngle:r,innerRadius:o,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:l,spacing:c}=this.options,u=(s+r)/2,d=(o+a+c+l)/2;return{x:n+Math.cos(u)*d,y:i+Math.sin(u)*d}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:n,circumference:i}=this,s=(n.offset||0)/2,r=(n.spacing||0)/2,o=n.circular;if(this.pixelMargin=n.borderAlign==="inner"?.33:0,this.fullCircles=i>Nt?Math.floor(i/Nt):0,i===0||this.innerRadius<0||this.outerRadius<0)return;t.save();let a=0;if(s){a=s/2;const c=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(c)*a,Math.sin(c)*a),this.circumference>=qt&&(a=s)}t.fillStyle=n.backgroundColor,t.strokeStyle=n.borderColor;const l=LW(t,this,a,r,o);jW(t,this,a,r,l,o),t.restore()}}Qh.id="arc";Qh.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};Qh.defaultRoutes={backgroundColor:"backgroundColor"};function sT(e,t,n=t){e.lineCap=ut(n.borderCapStyle,t.borderCapStyle),e.setLineDash(ut(n.borderDash,t.borderDash)),e.lineDashOffset=ut(n.borderDashOffset,t.borderDashOffset),e.lineJoin=ut(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=ut(n.borderWidth,t.borderWidth),e.strokeStyle=ut(n.borderColor,t.borderColor)}function $W(e,t,n){e.lineTo(n.x,n.y)}function IW(e){return e.stepped?rz:e.tension||e.cubicInterpolationMode==="monotone"?oz:$W}function rT(e,t,n={}){const i=e.length,{start:s=0,end:r=i-1}=n,{start:o,end:a}=t,l=Math.max(s,o),c=Math.min(r,a),u=sa&&r>a;return{count:i,start:l,loop:t.loop,ilen:c(o+(c?a-_:_))%r,x=()=>{m!==v&&(e.lineTo(u,v),e.lineTo(u,m),e.lineTo(u,y))};for(l&&(f=s[g(0)],e.moveTo(f.x,f.y)),h=0;h<=a;++h){if(f=s[g(h)],f.skip)continue;const _=f.x,w=f.y,S=_|0;S===p?(wv&&(v=w),u=(d*u+_)/++d):(x(),e.lineTo(_,w),p=S,d=0,m=v=w),y=w}x()}function Qm(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?BW:FW}function VW(e){return e.stepped?$z:e.tension||e.cubicInterpolationMode==="monotone"?Iz:xr}function zW(e,t,n,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,n,i)&&s.closePath()),sT(e,t.options),e.stroke(s)}function WW(e,t,n,i){const{segments:s,options:r}=t,o=Qm(t);for(const a of s)sT(e,r,a.style),e.beginPath(),o(e,t,a,{start:n,end:n+i-1})&&e.closePath(),e.stroke()}const HW=typeof Path2D=="function";function UW(e,t,n,i){HW&&!t.options.segment?zW(e,t,n,i):WW(e,t,n,i)}class nr extends oi{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 i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;Dz(this._points,i,t,s,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=Uz(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,i=t.length;return i&&n[t[i-1].end]}interpolate(t,n){const i=this.options,s=t[n],r=this.points,o=zP(this,{property:n,start:s,end:s});if(!o.length)return;const a=[],l=VW(i);let c,u;for(c=0,u=o.length;ce!=="borderDash"&&e!=="fill"};function __(e,t,n,i){const s=e.options,{[n]:r}=e.getProps([n],i);return Math.abs(t-r)=n)return e.slice(t,t+n);const o=[],a=(n-2)/(r-2);let l=0;const c=t+n-1;let u=t,d,h,f,p,m;for(o[l++]=e[u],d=0;df&&(f=p,h=e[g],m=g);o[l++]=h,u=m}return o[l++]=e[c],o}function JW(e,t,n,i){let s=0,r=0,o,a,l,c,u,d,h,f,p,m;const v=[],y=t+n-1,g=e[t].x,_=e[y].x-g;for(o=t;om&&(m=c,h=o),s=(r*s+a.x)/++r;else{const S=o-1;if(!Mt(d)&&!Mt(h)){const C=Math.min(d,h),M=Math.max(d,h);C!==f&&C!==S&&v.push({...e[C],x:s}),M!==f&&M!==S&&v.push({...e[M],x:s})}o>0&&S!==f&&v.push(e[S]),v.push(a),u=w,r=0,p=m=c,d=h=f=o}}return v}function aT(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{value:t})}}function w_(e){e.data.datasets.forEach(t=>{aT(t)})}function tH(e,t){const n=t.length;let i=0,s;const{iScale:r}=e,{min:o,max:a,minDefined:l,maxDefined:c}=r.getUserBounds();return l&&(i=ke(Xi(t,r.axis,o).lo,0,n-1)),c?s=ke(Xi(t,r.axis,a).hi+1,i,n)-i:s=n-i,{start:i,count:s}}var eH={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){w_(e);return}const i=e.width;e.data.datasets.forEach((s,r)=>{const{_data:o,indexAxis:a}=s,l=e.getDatasetMeta(r),c=o||s.data;if(Ja([a,e.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const u=e.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||e.options.parsing)return;let{start:d,count:h}=tH(l,c);const f=n.threshold||4*i;if(h<=f){aT(s);return}Mt(o)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(m){this._data=m}}));let p;switch(n.algorithm){case"lttb":p=ZW(c,d,h,i,n);break;case"min-max":p=JW(c,d,h,i);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}s._decimated=p})},destroy(e){w_(e)}};function nH(e,t,n){const i=e.segments,s=e.points,r=t.points,o=[];for(const a of i){let{start:l,end:c}=a;c=f0(l,c,s);const u=Zm(n,s[l],s[c],a.loop);if(!t.segments){o.push({source:a,target:u,start:s[l],end:s[c]});continue}const d=zP(t,u);for(const h of d){const f=Zm(n,r[h.start],r[h.end],h.loop),p=VP(a,s,f);for(const m of p)o.push({source:m,target:h,start:{[n]:k_(u,f,"start",Math.max)},end:{[n]:k_(u,f,"end",Math.min)}})}}return o}function Zm(e,t,n,i){if(i)return;let s=t[e],r=n[e];return e==="angle"&&(s=vn(s),r=vn(r)),{property:e,start:s,end:r}}function iH(e,t){const{x:n=null,y:i=null}=e||{},s=t.points,r=[];return t.segments.forEach(({start:o,end:a})=>{a=f0(o,a,s);const l=s[o],c=s[a];i!==null?(r.push({x:l.x,y:i}),r.push({x:c.x,y:i})):n!==null&&(r.push({x:n,y:l.y}),r.push({x:n,y:c.y}))}),r}function f0(e,t,n){for(;t>e;t--){const i=n[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function k_(e,t,n,i){return e&&t?i(e[n],t[n]):e?e[n]:t?t[n]:0}function lT(e,t){let n=[],i=!1;return Vt(e)?(i=!0,n=e):n=iH(e,t),n.length?new nr({points:n,options:{tension:0},_loop:i,_fullLoop:i}):null}function S_(e){return e&&e.fill!==!1}function sH(e,t,n){let s=e[t].fill;const r=[t];let o;if(!n)return s;for(;s!==!1&&r.indexOf(s)===-1;){if(!de(s))return s;if(o=e[s],!o)return!1;if(o.visible)return s;r.push(s),s=o.fill}return!1}function rH(e,t,n){const i=cH(e);if(yt(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return de(s)&&Math.floor(s)===s?oH(i[0],t,s,n):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function oH(e,t,n,i){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=i?!1:n}function aH(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:yt(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function lH(e,t,n){let i;return e==="start"?i=n:e==="end"?i=t.options.reverse?t.min:t.max:yt(e)?i=e.value:i=t.getBaseValue(),i}function cH(e){const t=e.options,n=t.fill;let i=ut(n&&n.target,n);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function uH(e){const{scale:t,index:n,line:i}=e,s=[],r=i.segments,o=i.points,a=dH(t,n);a.push(lT({x:null,y:t.bottom},i));for(let l=0;l=0;--o){const a=s[o].$filler;a&&(a.line.updateControlPoints(r,a.axis),i&&a.fill&&yp(e.ctx,a,r))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const i=e.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const r=i[s].$filler;S_(r)&&yp(e.ctx,r,e.chartArea)}},beforeDatasetDraw(e,t,n){const i=t.meta.$filler;!S_(i)||n.drawTime!=="beforeDatasetDraw"||yp(e.ctx,i,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const T_=(e,t)=>{let{boxHeight:n=t,boxWidth:i=t}=e;return e.usePointStyle&&(n=Math.min(n,t),i=e.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:n,itemHeight:Math.max(t,n)}},wH=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class D_ extends oi{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,i){this.maxWidth=t,this.maxHeight=n,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let n=Ft(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(i=>t.filter(i,this.chart.data))),t.sort&&(n=n.sort((i,s)=>t.sort(i,s,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 i=t.labels,s=be(i.font),r=s.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=T_(i,r);let c,u;n.font=s.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(o,r,a,l)+10):(u=this.maxHeight,c=this._fitCols(o,r,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,n,i,s){const{ctx:r,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=s+a;let d=t;r.textAlign="left",r.textBaseline="middle";let h=-1,f=-u;return this.legendItems.forEach((p,m)=>{const v=i+n/2+r.measureText(p.text).width;(m===0||c[c.length-1]+v+2*a>o)&&(d+=u,c[c.length-(m>0?0:1)]=0,f+=u,h++),l[m]={left:0,top:f,row:h,width:v,height:s},c[c.length-1]+=v+a}),d}_fitCols(t,n,i,s){const{ctx:r,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=o-t;let d=a,h=0,f=0,p=0,m=0;return this.legendItems.forEach((v,y)=>{const g=i+n/2+r.measureText(v.text).width;y>0&&f+s+2*a>u&&(d+=h+a,c.push({width:h,height:f}),p+=h+a,m++,h=f=0),l[y]={left:p,top:f,col:m,width:g,height:s},h=Math.max(h,g),f+=s+a}),d+=h,c.push({width:h,height:f}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:i,labels:{padding:s},rtl:r}}=this,o=Ro(r,this.left,this.width);if(this.isHorizontal()){let a=0,l=$e(i,this.left+s,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=$e(i,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+t+s,c.left=o.leftForLtr(o.x(l),c.width),l+=c.width+s}else{let a=0,l=$e(i,this.top+t+s,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=$e(i,this.top+t+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=o.leftForLtr(o.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Vh(t,this),this._draw(),zh(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:i,ctx:s}=this,{align:r,labels:o}=t,a=_t.color,l=Ro(t.rtl,this.left,this.width),c=be(o.font),{color:u,padding:d}=o,h=c.size,f=h/2;let p;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:m,boxHeight:v,itemHeight:y}=T_(o,h),g=function(C,M,P){if(isNaN(m)||m<=0||isNaN(v)||v<0)return;s.save();const T=ut(P.lineWidth,1);if(s.fillStyle=ut(P.fillStyle,a),s.lineCap=ut(P.lineCap,"butt"),s.lineDashOffset=ut(P.lineDashOffset,0),s.lineJoin=ut(P.lineJoin,"miter"),s.lineWidth=T,s.strokeStyle=ut(P.strokeStyle,a),s.setLineDash(ut(P.lineDash,[])),o.usePointStyle){const A={radius:v*Math.SQRT2/2,pointStyle:P.pointStyle,rotation:P.rotation,borderWidth:T},E=l.xPlus(C,m/2),z=M+f;DP(s,A,E,z,o.pointStyleWidth&&m)}else{const A=M+Math.max((h-v)/2,0),E=l.leftForLtr(C,m),z=Er(P.borderRadius);s.beginPath(),Object.values(z).some(N=>N!==0)?nc(s,{x:E,y:A,w:m,h:v,radius:z}):s.rect(E,A,m,v),s.fill(),T!==0&&s.stroke()}s.restore()},x=function(C,M,P){zr(s,P.text,C,M+y/2,c,{strikethrough:P.hidden,textAlign:l.textAlign(P.textAlign)})},_=this.isHorizontal(),w=this._computeTitleHeight();_?p={x:$e(r,this.left+d,this.right-i[0]),y:this.top+d+w,line:0}:p={x:this.left+d,y:$e(r,this.top+w+d,this.bottom-n[0].height),line:0},IP(this.ctx,t.textDirection);const S=y+d;this.legendItems.forEach((C,M)=>{s.strokeStyle=C.fontColor||u,s.fillStyle=C.fontColor||u;const P=s.measureText(C.text).width,T=l.textAlign(C.textAlign||(C.textAlign=o.textAlign)),A=m+f+P;let E=p.x,z=p.y;l.setWidth(this.width),_?M>0&&E+A+d>this.right&&(z=p.y+=S,p.line++,E=p.x=$e(r,this.left+d,this.right-i[p.line])):M>0&&z+S>this.bottom&&(E=p.x=E+n[p.line].width+d,p.line++,z=p.y=$e(r,this.top+w+d,this.bottom-n[p.line].height));const N=l.x(E);g(N,z,C),E=RV(T,E+m+f,_?E+A:this.right,t.rtl),x(l.x(E),z,C),_?p.x+=A+d:p.y+=S}),FP(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,i=be(n.font),s=ze(n.padding);if(!n.display)return;const r=Ro(t.rtl,this.left,this.width),o=this.ctx,a=n.position,l=i.size/2,c=s.top+l;let u,d=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),u=this.top+c,d=$e(t.align,d,this.right-h);else{const p=this.columnSizes.reduce((m,v)=>Math.max(m,v.height),0);u=c+$e(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const f=$e(a,d,d+h);o.textAlign=r.textAlign(n0(a)),o.textBaseline="middle",o.strokeStyle=n.color,o.fillStyle=n.color,o.font=i.string,zr(o,n.text,f,u,i)}_computeTitleHeight(){const t=this.options.title,n=be(t.font),i=ze(t.padding);return t.display?n.lineHeight+i.height:0}_getLegendItemAt(t,n){let i,s,r;if(Yi(t,this.left,this.right)&&Yi(n,this.top,this.bottom)){for(r=this.legendHitBoxes,i=0;ie.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:i,textAlign:s,color:r}}=e.legend.options;return e._getSortedDatasetMetas().map(o=>{const a=o.controller.getStyle(n?0:void 0),l=ze(a.borderWidth);return{text:t[o.index].label,fillStyle:a.backgroundColor,fontColor:r,hidden:!o.visible,lineCap:a.borderCapStyle,lineDash:a.borderDash,lineDashOffset:a.borderDashOffset,lineJoin:a.borderJoinStyle,lineWidth:(l.width+l.height)/4,strokeStyle:a.borderColor,pointStyle:i||a.pointStyle,rotation:a.rotation,textAlign:s||a.textAlign,borderRadius:0,datasetIndex:o.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 p0 extends oi{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 i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const s=Vt(i.text)?i.text.length:1;this._padding=ze(i.padding);const r=s*be(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:i,bottom:s,right:r,options:o}=this,a=o.align;let l=0,c,u,d;return this.isHorizontal()?(u=$e(a,i,r),d=n+t,c=r-i):(o.position==="left"?(u=i+t,d=$e(a,s,n),l=qt*-.5):(u=r-t,d=$e(a,n,s),l=qt*.5),c=s-n),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const i=be(n.font),r=i.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(r);zr(t,n.text,0,0,i,{color:n.color,maxWidth:l,rotation:c,textAlign:n0(n.align),textBaseline:"middle",translation:[o,a]})}}function MH(e,t){const n=new p0({ctx:e.ctx,options:t,chart:e});Be.configure(e,n,t),Be.addBox(e,n),e.titleBlock=n}var CH={id:"title",_element:p0,start(e,t,n){MH(e,n)},stop(e){const t=e.titleBlock;Be.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const i=e.titleBlock;Be.configure(e,i,n),i.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 Pu=new WeakMap;var PH={id:"subtitle",start(e,t,n){const i=new p0({ctx:e.ctx,options:n,chart:e});Be.configure(e,i,n),Be.addBox(e,i),Pu.set(e,i)},stop(e){Be.removeBox(e,Pu.get(e)),Pu.delete(e)},beforeUpdate(e,t,n){const i=Pu.get(e);Be.configure(e,i,n),i.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Ml={average(e){if(!e.length)return!1;let t,n,i=0,s=0,r=0;for(t=0,n=e.length;t-1?e.split(` -`):e}function TH(e,t){const{element:n,datasetIndex:i,index:s}=t,r=e.getDatasetMeta(i).controller,{label:o,value:a}=r.getLabelAndValue(s);return{chart:e,label:o,parsed:r.getParsed(s),raw:e.data.datasets[i].data[s],formattedValue:a,dataset:r.getDataset(),dataIndex:s,datasetIndex:i,element:n}}function E_(e,t){const n=e.chart.ctx,{body:i,footer:s,title:r}=e,{boxWidth:o,boxHeight:a}=t,l=be(t.bodyFont),c=be(t.titleFont),u=be(t.footerFont),d=r.length,h=s.length,f=i.length,p=ze(t.padding);let m=p.height,v=0,y=i.reduce((_,w)=>_+w.before.length+w.lines.length+w.after.length,0);if(y+=e.beforeBody.length+e.afterBody.length,d&&(m+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),y){const _=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;m+=f*_+(y-f)*l.lineHeight+(y-1)*t.bodySpacing}h&&(m+=t.footerMarginTop+h*u.lineHeight+(h-1)*t.footerSpacing);let g=0;const x=function(_){v=Math.max(v,n.measureText(_).width+g)};return n.save(),n.font=c.string,At(e.title,x),n.font=l.string,At(e.beforeBody.concat(e.afterBody),x),g=t.displayColors?o+2+t.boxPadding:0,At(i,_=>{At(_.before,x),At(_.lines,x),At(_.after,x)}),g=0,n.font=u.string,At(e.footer,x),n.restore(),v+=p.width,{width:v,height:m}}function DH(e,t){const{y:n,height:i}=t;return ne.height-i/2?"bottom":"center"}function EH(e,t,n,i){const{x:s,width:r}=i,o=n.caretSize+n.caretPadding;if(e==="left"&&s+r+o>t.width||e==="right"&&s-r-o<0)return!0}function AH(e,t,n,i){const{x:s,width:r}=n,{width:o,chartArea:{left:a,right:l}}=e;let c="center";return i==="center"?c=s<=(a+l)/2?"left":"right":s<=r/2?c="left":s>=o-r/2&&(c="right"),EH(c,e,t,n)&&(c="center"),c}function A_(e,t,n){const i=n.yAlign||t.yAlign||DH(e,n);return{xAlign:n.xAlign||t.xAlign||AH(e,t,n,i),yAlign:i}}function OH(e,t){let{x:n,width:i}=e;return t==="right"?n-=i:t==="center"&&(n-=i/2),n}function LH(e,t,n){let{y:i,height:s}=e;return t==="top"?i+=n:t==="bottom"?i-=s+n:i-=s/2,i}function O_(e,t,n,i){const{caretSize:s,caretPadding:r,cornerRadius:o}=e,{xAlign:a,yAlign:l}=n,c=s+r,{topLeft:u,topRight:d,bottomLeft:h,bottomRight:f}=Er(o);let p=OH(t,a);const m=LH(t,l,c);return l==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(u,h)+s:a==="right"&&(p+=Math.max(d,f)+s),{x:ke(p,0,i.width-t.width),y:ke(m,0,i.height-t.height)}}function Pu(e,t,n){const i=ze(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-i.right:e.x+i.left}function L_(e){return ui([],Ri(e))}function RH(e,t,n){return er(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function R_(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}class Jm extends oi{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||t._chart,this._chart=this.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,i=this.options.setContext(this.getContext()),s=i.enabled&&n.options.animation&&i.animations,r=new WP(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=RH(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:i}=n,s=i.beforeTitle.apply(this,[t]),r=i.title.apply(this,[t]),o=i.afterTitle.apply(this,[t]);let a=[];return a=ui(a,Ri(s)),a=ui(a,Ri(r)),a=ui(a,Ri(o)),a}getBeforeBody(t,n){return L_(n.callbacks.beforeBody.apply(this,[t]))}getBody(t,n){const{callbacks:i}=n,s=[];return At(t,r=>{const o={before:[],lines:[],after:[]},a=R_(i,r);ui(o.before,Ri(a.beforeLabel.call(this,r))),ui(o.lines,a.label.call(this,r)),ui(o.after,Ri(a.afterLabel.call(this,r))),s.push(o)}),s}getAfterBody(t,n){return L_(n.callbacks.afterBody.apply(this,[t]))}getFooter(t,n){const{callbacks:i}=n,s=i.beforeFooter.apply(this,[t]),r=i.footer.apply(this,[t]),o=i.afterFooter.apply(this,[t]);let a=[];return a=ui(a,Ri(s)),a=ui(a,Ri(r)),a=ui(a,Ri(o)),a}_createItems(t){const n=this._active,i=this.chart.data,s=[],r=[],o=[];let a=[],l,c;for(l=0,c=n.length;lt.filter(u,d,h,i))),t.itemSort&&(a=a.sort((u,d)=>t.itemSort(u,d,i))),At(a,u=>{const d=R_(t.callbacks,u);s.push(d.labelColor.call(this,u)),r.push(d.labelPointStyle.call(this,u)),o.push(d.labelTextColor.call(this,u))}),this.labelColors=s,this.labelPointStyles=r,this.labelTextColors=o,this.dataPoints=a,a}update(t,n){const i=this.options.setContext(this.getContext()),s=this._active;let r,o=[];if(!s.length)this.opacity!==0&&(r={opacity:0});else{const a=Sl[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const l=this._size=E_(this,i),c=Object.assign({},a,l),u=A_(this.chart,i,c),d=O_(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,r={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,i,s){const r=this.getCaretPosition(t,i,s);n.lineTo(r.x1,r.y1),n.lineTo(r.x2,r.y2),n.lineTo(r.x3,r.y3)}getCaretPosition(t,n,i){const{xAlign:s,yAlign:r}=this,{caretSize:o,cornerRadius:a}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=Er(a),{x:h,y:f}=t,{width:p,height:m}=n;let v,y,g,x,_,w;return r==="center"?(_=f+m/2,s==="left"?(v=h,y=v-o,x=_+o,w=_-o):(v=h+p,y=v+o,x=_-o,w=_+o),g=v):(s==="left"?y=h+Math.max(l,u)+o:s==="right"?y=h+p-Math.max(c,d)-o:y=this.caretX,r==="top"?(x=f,_=x-o,v=y-o,g=y+o):(x=f+m,_=x+o,v=y+o,g=y-o),w=x),{x1:v,x2:y,x3:g,y1:x,y2:_,y3:w}}drawTitle(t,n,i){const s=this.title,r=s.length;let o,a,l;if(r){const c=Lo(i.rtl,this.x,this.width);for(t.x=Pu(this,i.titleAlign,i),n.textAlign=c.textAlign(i.titleAlign),n.textBaseline="middle",o=be(i.titleFont),a=i.titleSpacing,n.fillStyle=i.titleColor,n.font=o.string,l=0;lx!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,ec(t,{x:v,y:m,w:c,h:l,radius:g}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),ec(t,{x:y,y:m+1,w:c-2,h:l-2,radius:g}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(v,m,c,l),t.strokeRect(v,m,c,l),t.fillStyle=o.backgroundColor,t.fillRect(y,m+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,n,i){const{body:s}=this,{bodySpacing:r,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=i,d=be(i.bodyFont);let h=d.lineHeight,f=0;const p=Lo(i.rtl,this.x,this.width),m=function(M){n.fillText(M,p.x(t.x+f),t.y+h/2),t.y+=h+r},v=p.textAlign(o);let y,g,x,_,w,S,C;for(n.textAlign=o,n.textBaseline="middle",n.font=d.string,t.x=Pu(this,v,i),n.fillStyle=i.bodyColor,At(this.beforeBody,m),f=a&&v!=="right"?o==="center"?c/2+u:c+2+u:0,_=0,S=s.length;_0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,i=this.$animations,s=i&&i.x,r=i&&i.y;if(s||r){const o=Sl[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=E_(this,t),l=Object.assign({},o,this._size),c=A_(n,t,l),u=O_(t,l,c,n);(s._to!==u.x||r._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(n);const s={width:this.width,height:this.height},r={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=ze(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(r,t,s,n),IP(t,n.textDirection),r.y+=o.top,this.drawTitle(r,t,n),this.drawBody(r,t,n),this.drawFooter(r,t,n),FP(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const i=this._active,s=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),r=!qd(i,s),o=this._positionChanged(s,n);(r||o)&&(this._active=s,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,i=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,r=this._active||[],o=this._getActiveElements(t,r,n,i),a=this._positionChanged(o,t),l=n||!qd(o,r)||a;return l&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,i,s){const r=this.options;if(t.type==="mouseout")return[];if(!s)return n;const o=this.chart.getElementsAtEventForMode(t,r.mode,r,i);return r.reverse&&o.reverse(),o}_positionChanged(t,n){const{caretX:i,caretY:s,options:r}=this,o=Sl[r.position].call(this,t,n);return o!==!1&&(i!==o.x||s!==o.y)}}Jm.positioners=Sl;var NH={id:"tooltip",_element:Jm,positioners:Sl,afterInit(e,t,n){n&&(e.tooltip=new Jm({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)===!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:{beforeTitle:Ei,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,i=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndexe!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},jH=Object.freeze({__proto__:null,Decimation:eH,Filler:_H,Legend:SH,SubTitle:PH,Title:CH,Tooltip:NH});const $H=(e,t,n,i)=>(typeof t=="string"?(n=e.push(t)-1,i.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function IH(e,t,n,i){const s=e.indexOf(t);if(s===-1)return $H(e,t,n,i);const r=e.lastIndexOf(t);return s!==r?n:s}const FH=(e,t)=>e===null?null:ke(Math.round(e),0,t);class sh extends Xr{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const i=this.getLabels();for(const{index:s,label:r}of n)i[s]===r&&i.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(Mt(t))return null;const i=this.getLabels();return n=isFinite(n)&&i[n]===t?n:IH(i,t,ut(n,t),this._addedLabels),FH(n,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),n||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,n=this.max,i=this.options.offset,s=[];let r=this.getLabels();r=t===0&&n===r.length-1?r:r.slice(t,n+1),this._valueRange=Math.max(r.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let o=t;o<=n;o++)s.push({value:o});return s}getLabelForValue(t){const n=this.getLabels();return t>=0&&tn.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}sh.id="category";sh.defaults={ticks:{callback:sh.prototype.getLabelForValue}};function BH(e,t){const n=[],{bounds:s,step:r,min:o,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:h}=e,f=r||1,p=u-1,{min:m,max:v}=t,y=!Mt(o),g=!Mt(a),x=!Mt(c),_=(v-m)/(d+1);let w=A1((v-m)/p/f)*f,S,C,M,P;if(w<1e-14&&!y&&!g)return[{value:m},{value:v}];P=Math.ceil(v/w)-Math.floor(m/w),P>p&&(w=A1(P*w/p/f)*f),Mt(l)||(S=Math.pow(10,l),w=Math.ceil(w*S)/S),s==="ticks"?(C=Math.floor(m/w)*w,M=Math.ceil(v/w)*w):(C=m,M=v),y&&g&&r&&CV((a-o)/r,w/1e3)?(P=Math.round(Math.min((a-o)/w,u)),w=(a-o)/P,C=o,M=a):x?(C=y?o:C,M=g?a:M,P=c-1,w=(M-C)/P):(P=(M-C)/w,_l(P,Math.round(P),w/1e3)?P=Math.round(P):P=Math.ceil(P));const T=Math.max(O1(w),O1(C));S=Math.pow(10,Mt(l)?T:l),C=Math.round(C*S)/S,M=Math.round(M*S)/S;let A=0;for(y&&(h&&C!==o?(n.push({value:o}),Cs=n?s:l,a=l=>r=i?r:l;if(t){const l=_i(s),c=_i(r);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(s===r){let l=1;(r>=Number.MAX_SAFE_INTEGER||s<=Number.MIN_SAFE_INTEGER)&&(l=Math.abs(r*.05)),a(r+l),t||o(s-l)}this.min=s,this.max=r}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:i}=t,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),n=n||11),n&&(s=Math.min(n,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,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},r=this._range||this,o=BH(s,r);return t.bounds==="ticks"&&gP(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,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-n)/Math.max(t.length-1,1)/2;n-=s,i+=s}this._startValue=n,this._endValue=i,this._valueRange=i-n}getLabelForValue(t){return wc(t,this.chart.options.locale,this.options.ticks.format)}}class m0 extends rh{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=de(t)?t:0,this.max=de(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,i=ti(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,r.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}m0.id="linear";m0.defaults={ticks:{callback:Gh.formatters.numeric}};function j_(e){return e/Math.pow(10,Math.floor(jn(e)))===1}function VH(e,t){const n=Math.floor(jn(t.max)),i=Math.ceil(t.max/Math.pow(10,n)),s=[];let r=On(e.min,Math.pow(10,Math.floor(jn(t.min)))),o=Math.floor(jn(r)),a=Math.floor(r/Math.pow(10,o)),l=o<0?Math.pow(10,Math.abs(o)):1;do s.push({value:r,major:j_(r)}),++a,a===10&&(a=1,++o,l=o>=0?1:l),r=Math.round(a*Math.pow(10,o)*l)/l;while(o0?i:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=de(t)?Math.max(0,t):null,this.max=de(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let i=this.min,s=this.max;const r=l=>i=t?i:l,o=l=>s=n?s:l,a=(l,c)=>Math.pow(10,Math.floor(jn(l))+c);i===s&&(i<=0?(r(1),o(10)):(r(a(i,-1)),o(a(s,1)))),i<=0&&r(a(s,-1)),s<=0&&o(a(i,1)),this._zero&&this.min!==this._suggestedMin&&i===a(this.min,0)&&r(a(i,-1)),this.min=i,this.max=s}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},i=VH(n,this);return t.bounds==="ticks"&&gP(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":wc(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=jn(t),this._valueRange=jn(this.max)-jn(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(jn(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}g0.id="logarithmic";g0.defaults={ticks:{callback:Gh.formatters.logarithmic,major:{enabled:!0}}};function tg(e){const t=e.ticks;if(t.display&&e.display){const n=ze(t.backdropPadding);return ut(t.font&&t.font.size,_t.font.size)+n.height}return 0}function zH(e,t,n){return n=Vt(n)?n:[n],{w:sz(e,t.string,n),h:n.length*t.lineHeight}}function $_(e,t,n,i,s){return e===i||e===s?{start:t-n/2,end:t+n/2}:es?{start:t-n,end:t}:{start:t,end:t+n}}function WH(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),i=[],s=[],r=e._pointLabels.length,o=e.options.pointLabels,a=o.centerPointLabels?qt/r:0;for(let l=0;lt.r&&(a=(i.end-t.r)/r,e.r=Math.max(e.r,t.r+a)),s.startt.b&&(l=(s.end-t.b)/o,e.b=Math.max(e.b,t.b+l))}function UH(e,t,n){const i=[],s=e._pointLabels.length,r=e.options,o=tg(r)/2,a=e.drawingArea,l=r.pointLabels.centerPointLabels?qt/s:0;for(let c=0;c270||n<90)&&(e-=t),e}function GH(e,t){const{ctx:n,options:{pointLabels:i}}=e;for(let s=t-1;s>=0;s--){const r=i.setContext(e.getPointLabelContext(s)),o=be(r.font),{x:a,y:l,textAlign:c,left:u,top:d,right:h,bottom:f}=e._pointLabelItems[s],{backdropColor:p}=r;if(!Mt(p)){const m=Er(r.borderRadius),v=ze(r.backdropPadding);n.fillStyle=p;const y=u-v.left,g=d-v.top,x=h-u+v.width,_=f-d+v.height;Object.values(m).some(w=>w!==0)?(n.beginPath(),ec(n,{x:y,y:g,w:x,h:_,radius:m}),n.fill()):n.fillRect(y,g,x,_)}zr(n,e._pointLabels[s],a,l+o.lineHeight/2,o,{color:r.color,textAlign:c,textBaseline:"middle"})}}function uT(e,t,n,i){const{ctx:s}=e;if(n)s.arc(e.xCenter,e.yCenter,t,0,Nt);else{let r=e.getPointPosition(0,t);s.moveTo(r.x,r.y);for(let o=1;o{const s=Ft(this.options.pointLabels.callback,[n,i],this);return s||s===0?s:""}).filter((n,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?WH(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,i,s){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,i,s))}getIndexAngle(t){const n=Nt/(this._pointLabels.length||1),i=this.options.startAngle||0;return vn(t*n+ti(i))}getDistanceFromCenterForValue(t){if(Mt(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(Mt(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{if(u!==0){a=this.getDistanceFromCenterForValue(c.value);const d=s.setContext(this.getContext(u-1));qH(this,d,a,r)}}),i.display){for(t.save(),o=r-1;o>=0;o--){const c=i.setContext(this.getPointLabelContext(o)),{color:u,lineWidth:d}=c;!d||!u||(t.lineWidth=d,t.strokeStyle=u,t.setLineDash(c.borderDash),t.lineDashOffset=c.borderDashOffset,a=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),l=this.getPointPosition(o,a),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,i=n.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let r,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&!n.reverse)return;const c=i.setContext(this.getContext(l)),u=be(c.font);if(r=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,o=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const d=ze(c.backdropPadding);t.fillRect(-o/2-d.left,-r-u.size/2-d.top,o+d.width,u.size+d.height)}zr(t,a.label,0,-r,u,{color:c.color})}),t.restore()}drawTitle(){}}Sc.id="radialLinear";Sc.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Gh.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(e){return e},padding:5,centerPointLabels:!1}};Sc.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};Sc.descriptors={angleLines:{_fallback:"grid"}};const tf={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}},en=Object.keys(tf);function ZH(e,t){return e-t}function I_(e,t){if(Mt(t))return null;const n=e._adapter,{parser:i,round:s,isoWeekday:r}=e._parseOpts;let o=t;return typeof i=="function"&&(o=i(o)),de(o)||(o=typeof i=="string"?n.parse(o,i):n.parse(o)),o===null?null:(s&&(o=s==="week"&&(ta(r)||r===!0)?n.startOf(o,"isoWeek",r):n.startOf(o,s)),+o)}function F_(e,t,n,i){const s=en.length;for(let r=en.indexOf(e);r=en.indexOf(n);r--){const o=en[r];if(tf[o].common&&e._adapter.diff(s,i,o)>=t-1)return o}return en[n?en.indexOf(n):0]}function t3(e){for(let t=en.indexOf(e)+1,n=en.length;t=t?n[i]:n[s];e[r]=!0}}function e3(e,t,n,i){const s=e._adapter,r=+s.startOf(t[0].value,i),o=t[t.length-1].value;let a,l;for(a=r;a<=o;a=+s.add(a,1,i))l=n[a],l>=0&&(t[l].major=!0);return t}function V_(e,t,n){const i=[],s={},r=t.length;let o,a;for(o=0;o+t.value))}initOffsets(t){let n=0,i=0,s,r;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?n=1-s:n=(this.getDecimalForValue(t[1])-s)/2,r=this.getDecimalForValue(t[t.length-1]),t.length===1?i=r:i=(r-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;n=ke(n,0,o),i=ke(i,0,o),this._offsets={start:n,end:i,factor:1/(n+1+i)}}_generate(){const t=this._adapter,n=this.min,i=this.max,s=this.options,r=s.time,o=r.unit||F_(r.minUnit,n,i,this._getLabelCapacity(n)),a=ut(r.stepSize,1),l=o==="week"?r.isoWeekday:!1,c=ta(l)||l===!0,u={};let d=n,h,f;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":o),t.diff(i,n,o)>1e5*a)throw new Error(n+" and "+i+" are too far apart with stepSize of "+a+" "+o);const p=s.ticks.source==="data"&&this.getDataTimestamps();for(h=d,f=0;hm-v).map(m=>+m)}getLabelForValue(t){const n=this._adapter,i=this.options.time;return i.tooltipFormat?n.format(t,i.tooltipFormat):n.format(t,i.displayFormats.datetime)}_tickFormatFunction(t,n,i,s){const r=this.options,o=r.time.displayFormats,a=this._unit,l=this._majorUnit,c=a&&o[a],u=l&&o[l],d=i[n],h=l&&u&&d&&d.major,f=this._adapter.format(t,s||(h?u:c)),p=r.ticks.callback;return p?Ft(p,[f,n,i],this):f}generateTickLabels(t){let n,i,s;for(n=0,i=t.length;n0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,i;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(n=0,i=s.length;n=e[i].pos&&t<=e[s].pos&&({lo:i,hi:s}=Xi(e,"pos",t)),{pos:r,time:a}=e[i],{pos:o,time:l}=e[s]):(t>=e[i].time&&t<=e[s].time&&({lo:i,hi:s}=Xi(e,"time",t)),{time:r,pos:a}=e[i],{time:o,pos:l}=e[s]);const c=o-r;return c?a+(l-a)*(t-r)/c:a}class y0 extends Mc{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=Tu(n,this.min),this._tableRange=Tu(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:i}=this,s=[],r=[];let o,a,l,c,u;for(o=0,a=t.length;o=n&&c<=i&&s.push(c);if(s.length<2)return[{time:n,pos:0},{time:i,pos:1}];for(o=0,a=s.length;o.dropdown-menu{right:0!important}.select-input-label-active{color:#1266f1!important}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();const g3=Y.forwardRef(({breakpoint:e,fluid:t,children:n,className:i,tag:s="div",...r},o)=>{const a=I(`${t?"container-fluid":`container${e?"-"+e:""}`}`,i);return b.jsx(s,{className:a,...r,ref:o,children:n})});g3.displayName="MDBContainer";const y3=Y.forwardRef(({center:e,children:t,className:n,end:i,lg:s,md:r,offsetLg:o,offsetMd:a,offsetSm:l,order:c,size:u,sm:d,start:h,tag:f="div",xl:p,xxl:m,xs:v,...y},g)=>{const x=I(u&&`col-${u}`,v&&`col-xs-${v}`,d&&`col-sm-${d}`,r&&`col-md-${r}`,s&&`col-lg-${s}`,p&&`col-xl-${p}`,m&&`col-xxl-${m}`,!u&&!v&&!d&&!r&&!s&&!p&&!m?"col":"",c&&`order-${c}`,h&&"align-self-start",e&&"align-self-center",i&&"align-self-end",l&&`offset-sm-${l}`,a&&`offset-md-${a}`,o&&`offset-lg-${o}`,n);return b.jsx(f,{className:x,ref:g,...y,children:t})});y3.displayName="MDBCol";const v3=Y.forwardRef(({className:e,color:t="primary",pill:n,light:i,dot:s,tag:r="span",children:o,notification:a,...l},c)=>{const u=I("badge",i?t&&`badge-${t}`:t&&`bg-${t}`,s&&"badge-dot",n&&"rounded-pill",a&&"badge-notification",e);return b.jsx(r,{className:u,ref:c,...l,children:o})});v3.displayName="MDBBadge";const x3=({...e})=>{const[t,n]=k.useState(!1),i=I("ripple-wave",t&&"active");return k.useEffect(()=>{const s=setTimeout(()=>{n(!0)},50);return()=>{clearTimeout(s)}},[]),b.jsx("div",{className:i,...e})},b3=(...e)=>{const t=Y.useRef();return Y.useEffect(()=>{e.forEach(n=>{n&&(typeof n=="function"?n(t.current):n.current=t.current)})},[e]),t},v0=Y.forwardRef(({className:e,rippleTag:t="div",rippleCentered:n,rippleDuration:i=500,rippleUnbound:s,rippleRadius:r=0,rippleColor:o="dark",children:a,onMouseDown:l,...c},u)=>{const d=k.useRef(null),h=b3(u,d),f="rgba({{color}}, 0.2) 0, rgba({{color}}, 0.3) 40%, rgba({{color}}, 0.4) 50%, rgba({{color}}, 0.5) 60%, rgba({{color}}, 0) 70%",p=[0,0,0],m=["primary","secondary","success","danger","warning","info","light","dark"],[v,y]=k.useState([]),[g,x]=k.useState(!1),_=I("ripple","ripple-surface",s&&"ripple-surface-unbound",g&&`ripple-surface-${o}`,e),w=()=>{if(m.find(T=>T===(o==null?void 0:o.toLowerCase())))return x(!0);{const T=S(o).join(",");return`radial-gradient(circle, ${f.split("{{color}}").join(`${T}`)})`}},S=T=>{const A=N=>(N.length<7&&(N=`#${N[1]}${N[1]}${N[2]}${N[2]}${N[3]}${N[3]}`),[parseInt(N.substr(1,2),16),parseInt(N.substr(3,2),16),parseInt(N.substr(5,2),16)]),E=N=>{const L=document.body.appendChild(document.createElement("fictum")),R="rgb(1, 2, 3)";return L.style.color=R,L.style.color!==R||(L.style.color=N,L.style.color===R||L.style.color==="")?p:(N=getComputedStyle(L).color,document.body.removeChild(L),N)},z=N=>(N=N.match(/[.\d]+/g).map(L=>+Number(L)),N.length=3,N);return T.toLowerCase()==="transparent"?p:T[0]==="#"?A(T):(T.indexOf("rgb")===-1&&(T=E(T)),T.indexOf("rgb")===0?z(T):p)},C=T=>{const{offsetX:A,offsetY:E,height:z,width:N}=T,L=E<=z/2,R=A<=N/2,B=(W,et)=>Math.sqrt(W**2+et**2),D=E===z/2&&A===N/2,$={first:L===!0&&R===!1,second:L===!0&&R===!0,third:L===!1&&R===!0,fourth:L===!1&&R===!1},F={topLeft:B(A,E),topRight:B(N-A,E),bottomLeft:B(A,z-E),bottomRight:B(N-A,z-E)};let V=0;return D||$.fourth?V=F.topLeft:$.third?V=F.topRight:$.second?V=F.bottomRight:$.first&&(V=F.bottomLeft),V*2},M=T=>{var A;const E=(A=h.current)==null?void 0:A.getBoundingClientRect(),z=T.clientX-E.left,N=T.clientY-E.top,L=E.height,R=E.width,B={offsetX:n?L/2:z,offsetY:n?R/2:N,height:L,width:R},D={delay:i&&i*.5,duration:i&&i-i*.5},$=C(B),F=r||$/2,V={left:n?`${R/2-F}px`:`${z-F}px`,top:n?`${L/2-F}px`:`${N-F}px`,height:r?`${r*2}px`:`${$}px`,width:r?`${r*2}px`:`${$}px`,transitionDelay:`0s, ${D.delay}ms`,transitionDuration:`${i}ms, ${D.duration}ms`};return g?V:{...V,backgroundImage:`${w()}`}},P=T=>{const A=M(T),E=v.concat(A);y(E),l&&l(T)};return k.useEffect(()=>{const T=setTimeout(()=>{v.length>0&&y(v.splice(1,v.length-1))},i);return()=>{clearTimeout(T)}},[i,v]),b.jsxs(t,{className:_,onMouseDown:T=>P(T),ref:h,...c,children:[a,v.map((T,A)=>b.jsx(x3,{style:T},A))]})});v0.displayName="MDBRipple";const Zt=Y.forwardRef(({className:e,color:t="primary",outline:n,children:i,rounded:s,disabled:r,floating:o,size:a,href:l,block:c,active:u,toggle:d,noRipple:h,tag:f="button",role:p="button",...m},v)=>{const[y,g]=k.useState(u||!1);let x;const _=t&&["light","link"].includes(t)||n?"dark":"light";t!=="none"?n?t?x=`btn-outline-${t}`:x="btn-outline-primary":t?x=`btn-${t}`:x="btn-primary":x="";const w=I(t!=="none"&&"btn",x,s&&"btn-rounded",o&&"btn-floating",a&&`btn-${a}`,`${(l||f!=="button")&&r?"disabled":""}`,c&&"btn-block",y&&"active",e);return l&&f!=="a"&&(f="a"),["hr","img","input"].includes(f)||h?b.jsx(f,{className:w,onClick:d?()=>{g(!y)}:void 0,disabled:r&&f==="button"?!0:void 0,href:l,ref:v,role:p,...m,children:i}):b.jsx(v0,{rippleTag:f,rippleColor:_,className:w,onClick:d?()=>{g(!y)}:void 0,disabled:r&&f==="button"?!0:void 0,href:l,ref:v,role:p,...m,children:i})});Zt.displayName="MDBBtn";const _3=Y.forwardRef(({className:e,children:t,shadow:n,toolbar:i,size:s,vertical:r,tag:o="div",role:a="group",...l},c)=>{let u;i?u="btn-toolbar":r?u="btn-group-vertical":u="btn-group";const d=I(u,n&&`shadow-${n}`,s&&`btn-group-${s}`,e);return b.jsx(o,{className:d,ref:c,role:a,...l,children:t})});_3.displayName="MDBBtnGroup";const hT=Y.forwardRef(({className:e,children:t,tag:n="div",color:i,grow:s,size:r,...o},a)=>{const l=I(`${s?"spinner-grow":"spinner-border"}`,i&&`text-${i}`,`${r?s?"spinner-grow-"+r:"spinner-border-"+r:""}`,e);return b.jsx(n,{className:l,ref:a,...o,children:t})});hT.displayName="MDBSpinner";const rd=Y.forwardRef(({className:e,children:t,border:n,background:i,tag:s="div",shadow:r,alignment:o,...a},l)=>{const c=I("card",n&&`border border-${n}`,i&&`bg-${i}`,r&&`shadow-${r}`,o&&`text-${o}`,e);return b.jsx(s,{className:c,ref:l,...a,children:t})});rd.displayName="MDBCard";const od=Y.forwardRef(({className:e,children:t,border:n,background:i,tag:s="div",...r},o)=>{const a=I("card-header",n&&`border-${n}`,i&&`bg-${i}`,e);return b.jsx(s,{className:a,...r,ref:o,children:t})});od.displayName="MDBCardHeader";const w3=Y.forwardRef(({className:e,children:t,tag:n="p",...i},s)=>{const r=I("card-subtitle",e);return b.jsx(n,{className:r,...i,ref:s,children:t})});w3.displayName="MDBCardSubTitle";const fT=Y.forwardRef(({className:e,children:t,tag:n="h5",...i},s)=>{const r=I("card-title",e);return b.jsx(n,{className:r,...i,ref:s,children:t})});fT.displayName="MDBCardTitle";const ad=Y.forwardRef(({className:e,children:t,tag:n="p",...i},s)=>{const r=I("card-text",e);return b.jsx(n,{className:r,...i,ref:s,children:t})});ad.displayName="MDBCardText";const eg=Y.forwardRef(({className:e,children:t,tag:n="div",...i},s)=>{const r=I("card-body",e);return b.jsx(n,{className:r,...i,ref:s,children:t})});eg.displayName="MDBCardBody";const k3=Y.forwardRef(({className:e,children:t,border:n,background:i,tag:s="div",...r},o)=>{const a=I("card-footer",n&&`border-${n}`,i&&`bg-${i}`,e);return b.jsx(s,{className:a,...r,ref:o,children:t})});k3.displayName="MDBCardFooter";const S3=Y.forwardRef(({className:e,children:t,tag:n="div",...i},s)=>{const r=I("card-img-overlay",e);return b.jsx(n,{className:r,...i,ref:s,children:t})});S3.displayName="MDBCardOverlay";const M3=Y.forwardRef(({className:e,children:t,tag:n="div",...i},s)=>{const r=I("card-group",e);return b.jsx(n,{className:r,...i,ref:s,children:t})});M3.displayName="MDBCardGroup";const C3=Y.forwardRef(({className:e,tag:t="ul",horizontal:n,horizontalSize:i,light:s,numbered:r,children:o,small:a,...l},c)=>{const u=I("list-group",n&&(i?`list-group-horizontal-${i}`:"list-group-horizontal"),s&&"list-group-light",r&&"list-group-numbered",a&&"list-group-small",e);return b.jsx(t,{className:u,ref:c,...l,children:o})});C3.displayName="MDBListGroup";const P3=Y.forwardRef(({className:e,tag:t="li",active:n,disabled:i,action:s,color:r,children:o,noBorders:a,...l},c)=>{const u=t==="button",d=I("list-group-item",n&&"active",i&&!u&&"disabled",s&&"list-group-item-action",r&&`list-group-item-${r}`,a&&"border-0",e);return b.jsx(t,{className:d,disabled:u&&i,ref:c,...l,children:o})});P3.displayName="MDBListGroupItem";const aa=({children:e,containerRef:t,disablePortal:n})=>{const[i,s]=k.useState(!1);return k.useEffect(()=>{!n&&s(!0)},[n]),n?b.jsx(b.Fragment,{children:e}):i?iy.createPortal(b.jsx(b.Fragment,{children:e}),(t==null?void 0:t.current)||document.body):null},T3=Y.forwardRef(({around:e,between:t,bottom:n,center:i,children:s,className:r,evenly:o,end:a,middle:l,start:c,tag:u="div",top:d,...h},f)=>{const p=I("row",e&&"justify-content-around",t&&"justify-content-between",n&&"align-self-end",i&&"justify-content-center",o&&"justifty-content-evenly",a&&"justify-content-end",l&&"align-self-center",c&&"justify-content-start",d&&"align-self-start",r);return b.jsx(u,{className:p,...h,ref:f,children:s})});T3.displayName="MDBRow";const sn=({animate:e,className:t,icon:n,fab:i,fas:s,fal:r,far:o,flag:a,spin:l,fixed:c,flip:u,list:d,size:h,pull:f,pulse:p,color:m,border:v,rotate:y,inverse:g,stack:x,iconType:_,children:w,...S})=>{let C;a?C="flag":i?C="fab":s?C="fas":o?C="far":r?C="fal":C="fa";const M=I(_?`fa-${_}`:C,e&&`fa-${e}`,a?`flag-${a}`:n&&`fa-${n}`,h&&`fa-${h}`,m&&`text-${m}`,v&&"fa-border",y&&`fa-rotate-${y}`,f&&`fa-pull-${f}`,l&&!e&&"fa-spin",d&&"fa-li",c&&"fa-fw",p&&!e&&"fa-pulse",g&&"fa-inverse",u&&`fa-flip-${u}`,x&&`fa-stack-${x}`,t);return b.jsx("i",{className:M,...S,children:w})},D3=Y.forwardRef(({className:e,children:t,tag:n="p",variant:i,color:s,blockquote:r,note:o,noteColor:a,listUnStyled:l,listInLine:c,...u},d)=>{const h=I(i&&i,r&&"blockquote",o&&"note",s&&`text-${s}`,a&&`note-${a}`,l&&"list-unstyled",c&&"list-inline",e);return r&&(n="blockquote"),(l||c)&&(n="ul"),b.jsx(n,{className:h,ref:d,...u,children:t})});D3.displayName="MDBTypography";const E3=Y.forwardRef(({className:e,color:t,uppercase:n,bold:i,children:s,...r},o)=>{const a=I("breadcrumb",i&&"font-weight-bold",t&&`text-${t}`,n&&"text-uppercase",e);return b.jsx("nav",{"aria-label":"breadcrumb",children:b.jsx("ol",{className:a,ref:o,...r,children:s})})});E3.displayName="MDBBreadcrumb";const A3=Y.forwardRef(({className:e,active:t,current:n="page",children:i,...s},r)=>{const o=I("breadcrumb-item",t&&"active",e);return b.jsx("li",{className:o,ref:r,"aria-current":t&&n,...s,children:i})});A3.displayName="MDBBreadcrumbItem";const O3=e=>{if(e!==!1)return`navbar-expand-${e}`},pT=Y.forwardRef(({className:e,children:t,light:n,dark:i,scrolling:s,fixed:r,sticky:o,scrollingNavbarOffset:a,color:l,transparent:c,expand:u,tag:d="nav",bgColor:h,...f},p)=>{const[m,v]=k.useState(!1),y=I({"navbar-light":n,"navbar-dark":i,"scrolling-navbar":s||a,"top-nav-collapse":m,[`text-${l}`]:l&&c?m:l},r&&`fixed-${r}`,o&&"sticky-top","navbar",u&&O3(u),h&&`bg-${h}`,e),g=k.useCallback(()=>{a&&window.pageYOffset>a?v(!0):v(!1)},[a]);return k.useEffect(()=>((s||a)&&window.addEventListener("scroll",g),()=>{window.removeEventListener("scroll",g)}),[g,s,a]),b.jsx(d,{className:y,role:"navigation",...f,ref:p,children:t})});pT.displayName="MDBNavbar";const L3=Y.forwardRef(({children:e,className:t="",disabled:n=!1,active:i=!1,tag:s="a",...r},o)=>{const a=I("nav-link",n?"disabled":i?"active":"",t);return b.jsx(s,{"data-test":"nav-link",className:a,style:{cursor:"pointer"},ref:o,...r,children:e})});L3.displayName="MDBNavbarLink";const R3=Y.forwardRef(({className:e,children:t,tag:n="a",...i},s)=>{const r=I("navbar-brand",e);return b.jsx(n,{className:r,ref:s,...i,children:t})});R3.displayName="MDBNavbarBrand";const N3=Y.forwardRef(({children:e,className:t,active:n,text:i,tag:s="li",...r},o)=>{const a=I("nav-item",n&&"active",i&&"navbar-text",t);return b.jsx(s,{...r,className:a,ref:o,children:e})});N3.displayName="MDBNavbarItem";const j3=Y.forwardRef(({children:e,className:t,right:n,fullWidth:i=!0,left:s,tag:r="ul",...o},a)=>{const l=I("navbar-nav",i&&"w-100",n&&"ms-auto",s&&"me-auto",t);return b.jsx(r,{className:l,ref:a,...o,children:e})});j3.displayName="MDBNavbarNav";const $3=Y.forwardRef(({children:e,className:t,tag:n="button",...i},s)=>{const r=I("navbar-toggler",t);return b.jsx(n,{...i,className:r,ref:s,children:e})});$3.displayName="MDBNavbarToggler";const I3=Y.forwardRef(({children:e,bgColor:t,color:n,className:i,...s},r)=>{const o=I(t&&`bg-${t}`,n&&`text-${n}`,i);return b.jsx("footer",{className:o,...s,ref:r,children:e})});I3.displayName="MDBFooter";const F3=Y.forwardRef(({children:e,size:t,circle:n,center:i,end:s,start:r,className:o,...a},l)=>{const c=I("pagination",i&&"justify-content-center",n&&"pagination-circle",s&&"justify-content-end",t&&`pagination-${t}`,r&&"justify-content-start",o);return b.jsx("ul",{className:c,...a,ref:l,children:e})});F3.displayName="MDBPagination";const B3=Y.forwardRef(({children:e,className:t,tag:n="a",...i},s)=>{const r=I("page-link",t);return b.jsx(n,{className:r,...i,ref:s,children:e})});B3.displayName="MDBPaginationLink";const V3=Y.forwardRef(({children:e,className:t,active:n,disabled:i,...s},r)=>{const o=I("page-item",n&&"active",i&&"disabled",t);return b.jsx("li",{className:o,...s,ref:r,children:e})});V3.displayName="MDBPaginationItem";const z3=({className:e,classNameResponsive:t,responsive:n,align:i,borderColor:s,bordered:r,borderless:o,children:a,color:l,hover:c,small:u,striped:d,...h})=>{const f=I("table",i&&`align-${i}`,s&&`border-${s}`,r&&"table-bordered",o&&"table-borderless",l&&`table-${l}`,c&&"table-hover",u&&"table-sm",d&&"table-striped",e),p=k.useMemo(()=>b.jsx("table",{className:f,...h,children:a}),[a,f,h]);if(n){const m=I(typeof n=="string"?`table-responsive-${n}`:"table-responsive",t);return b.jsx("div",{className:m,children:p})}else return p},W3=({className:e,children:t,dark:n,light:i,...s})=>{const r=I(n&&"table-dark",i&&"table-light",e);return b.jsx("thead",{className:r,...s,children:t})},H3=({className:e,children:t,...n})=>{const i=I(e);return b.jsx("tbody",{className:i,...n,children:t})},mT=Y.forwardRef(({animated:e,children:t,className:n,style:i,tag:s="div",valuenow:r,valuemax:o,striped:a,bgColor:l,valuemin:c,width:u,...d},h)=>{const f=I("progress-bar",l&&`bg-${l}`,a&&"progress-bar-striped",e&&"progress-bar-animated",n),p={width:`${u}%`,...i};return b.jsx(s,{className:f,style:p,ref:h,role:"progressbar",...d,"aria-valuenow":Number(u)??r,"aria-valuemin":Number(c),"aria-valuemax":Number(o),children:t})});mT.displayName="MDBProgressBar";const U3=Y.forwardRef(({className:e,children:t,tag:n="div",height:i,style:s,...r},o)=>{const a=I("progress",e),l={height:`${i}px`,...s};return b.jsx(n,{className:a,ref:o,style:l,...r,children:Y.Children.map(t,c=>{if(!Y.isValidElement(c)||c.type!==mT){console.error("Progress component only allows ProgressBar as child");return}else return c})})});U3.displayName="MDBProgress";const Y3=e=>{const[t,n]=k.useState(!1),[i,s]=k.useState(null);return k.useEffect(()=>{s(()=>new IntersectionObserver(([r])=>{n(r.isIntersecting)}))},[]),k.useEffect(()=>{if(!(!e.current||!i))return i.observe(e.current),()=>i.disconnect()},[i,e]),t},ef=(e,t)=>k.useMemo(()=>t!==void 0?t:e,[t,e]),wi=Y.forwardRef(({className:e,size:t,contrast:n,value:i,defaultValue:s,id:r,labelClass:o,wrapperClass:a,wrapperStyle:l,wrapperTag:c="div",label:u,onChange:d,children:h,labelRef:f,labelStyle:p,type:m,onBlur:v,readonly:y=!1,showCounter:g=!1,...x},_)=>{var w;const[S,C]=k.useState(s),M=k.useMemo(()=>i!==void 0?i:S,[i,S]),[P,T]=k.useState(0),[A,E]=k.useState(!1),[z,N]=k.useState(0),L=k.useRef(null),R=Y3(L),B=k.useRef(null),D=f||B;k.useImperativeHandle(_,()=>L.current);const $=I("form-outline",n&&"form-white",a),F=I("form-control",A&&"active",m==="date"&&"active",t&&`form-control-${t}`,e),V=I("form-label",o),W=k.useCallback(()=>{var O;(O=D.current)!=null&&O.clientWidth&&T(D.current.clientWidth*.8+8)},[D]),et=O=>{C(O.target.value),g&&N(O.target.value.length),d==null||d(O)},Z=k.useCallback(O=>{L.current&&(E(!!M),v&&v(O))},[M,v]);return k.useEffect(()=>{W()},[(w=D.current)==null?void 0:w.clientWidth,W,R]),k.useEffect(()=>{if(M)return E(!0);E(!1)},[M]),b.jsxs(c,{className:$,style:l,children:[b.jsx("input",{type:m,readOnly:y,className:F,onBlur:Z,onChange:et,onFocus:W,value:i,defaultValue:s,id:r,ref:L,...x}),u&&b.jsx("label",{className:V,style:p,htmlFor:r,ref:D,children:u}),b.jsxs("div",{className:"form-notch",children:[b.jsx("div",{className:"form-notch-leading"}),b.jsx("div",{className:"form-notch-middle",style:{width:P}}),b.jsx("div",{className:"form-notch-trailing"})]}),h,g&&x.maxLength&&b.jsx("div",{className:"form-helper",children:b.jsx("div",{className:"form-counter",children:`${z}/${x.maxLength}`})})]})});wi.displayName="MDBInput";const gT=k.forwardRef(({className:e,inputRef:t,labelClass:n,wrapperClass:i,labelStyle:s,wrapperTag:r="div",wrapperStyle:o,label:a,inline:l,btn:c,id:u,btnColor:d,disableWrapper:h,toggleSwitch:f,...p},m)=>{let v="form-check-input",y="form-check-label";c&&(v="btn-check",d?y=`btn btn-${d}`:y="btn btn-primary");const g=I(a&&!c&&"form-check",l&&!c&&"form-check-inline",f&&"form-switch",i),x=I(v,e),_=I(y,n),w=b.jsxs(b.Fragment,{children:[b.jsx("input",{className:x,id:u,ref:t,...p}),a&&b.jsx("label",{className:_,style:s,htmlFor:u,children:a})]});return b.jsx(b.Fragment,{children:h?w:b.jsx(r,{style:o,className:g,ref:m,children:w})})});gT.displayName="InputTemplate";const oh=({...e})=>b.jsx(gT,{type:"checkbox",...e}),X3=({className:e,children:t,open:n=!1,id:i,navbar:s,tag:r="div",collapseRef:o,style:a,onOpen:l,onClose:c,...u})=>{const[d,h]=k.useState(!1),[f,p]=k.useState(void 0),[m,v]=k.useState(!1),y=I(m?"collapsing":"collapse",!m&&d&&"show",s&&"navbar-collapse",e),g=k.useRef(null),x=o??g,_=k.useCallback(()=>{d&&p(void 0)},[d]);return k.useEffect(()=>{var w;f===void 0&&d&&p((w=x==null?void 0:x.current)==null?void 0:w.scrollHeight)},[f,d,x]),k.useEffect(()=>{d!==n&&(n?l==null||l():c==null||c(),h(n)),d&&v(!0);const w=setTimeout(()=>{v(!1)},350);return()=>{clearTimeout(w)}},[n,d,l,c]),k.useEffect(()=>{var w;p(d?(w=x==null?void 0:x.current)==null?void 0:w.scrollHeight:0)},[d,x,t]),k.useEffect(()=>(window.addEventListener("resize",_),()=>{window.removeEventListener("resize",_)}),[_]),b.jsx(r,{style:{height:f,...a},id:i,className:y,...u,ref:x,children:t})};k.createContext(null);const K3=Y.forwardRef(({className:e,children:t,tag:n="div",...i},s)=>{const r=I("modal-content",e);return b.jsx(n,{className:r,...i,ref:s,children:t})});K3.displayName="MDBModalContent";const G3=Y.forwardRef(({className:e,children:t,tag:n="div",...i},s)=>{const r=I("modal-header",e);return b.jsx(n,{className:r,...i,ref:s,children:t})});G3.displayName="MDBModalHeader";const q3=Y.forwardRef(({className:e,children:t,tag:n="h5",...i},s)=>{const r=I("modal-title",e);return b.jsx(n,{className:r,...i,ref:s,children:t})});q3.displayName="MDBModalTitle";const Q3=Y.forwardRef(({className:e,children:t,tag:n="div",...i},s)=>{const r=I("modal-body",e);return b.jsx(n,{className:r,...i,ref:s,children:t})});Q3.displayName="MDBModalBody";const Z3=Y.forwardRef(({className:e,children:t,tag:n="div",...i},s)=>{const r=I("modal-footer",e);return b.jsx(n,{className:r,...i,ref:s,children:t})});Z3.displayName="MDBModalFooter";Y.createContext({activeElement:null,setTargets:null});const J3=k.forwardRef(({className:e,labelClass:t,labelStyle:n,inputRef:i,size:s,label:r,id:o,...a},l)=>{const c=I("form-control",`form-control-${s}`,e),u=I("form-label",t),d=k.useRef(null);return k.useImperativeHandle(l,()=>d.current||(i==null?void 0:i.current)),b.jsxs(b.Fragment,{children:[r&&b.jsx("label",{className:u,style:n,htmlFor:o,children:r}),b.jsx("input",{className:c,type:"file",id:o,ref:d,...a})]})});J3.displayName="MDBFile";const yT=Y.forwardRef(({className:e,children:t,noBorder:n,textBefore:i,textAfter:s,noWrap:r,tag:o="div",textTag:a="span",textClass:l,size:c,textProps:u,...d},h)=>{const f=I("input-group",r&&"flex-nowrap",c&&`input-group-${c}`,e),p=I("input-group-text",n&&"border-0",l),m=v=>b.jsx(b.Fragment,{children:v&&Array.isArray(v)?v.map((y,g)=>b.jsx(a,{className:p,...u,children:y},g)):b.jsx(a,{className:p,...u,children:v})});return b.jsxs(o,{className:f,ref:h,...d,children:[i&&m(i),t,s&&m(s)]})});yT.displayName="MDBInputGroup";const t4=Y.forwardRef(({className:e,children:t,isValidated:n=!1,onReset:i,onSubmit:s,noValidate:r=!0,...o},a)=>{const[l,c]=k.useState(n),u=I("needs-validation",l&&"was-validated",e),d=f=>{f.preventDefault(),c(!0),s&&s(f)},h=f=>{f.preventDefault(),c(!1),i&&i(f)};return k.useEffect(()=>{c(n)},[n]),b.jsx("form",{className:u,onSubmit:d,onReset:h,ref:a,noValidate:r,...o,children:t})});t4.displayName="MDBValidation";const e4=Y.forwardRef(({className:e,fill:t,pills:n,justify:i,children:s,...r},o)=>{const a=I("nav",n?"nav-pills":"nav-tabs",t&&"nav-fill",i&&"nav-justified",e);return b.jsx("ul",{className:a,ref:o,...r,children:s})});e4.displayName="MDBTabs";const n4=Y.forwardRef(({className:e,children:t,style:n,tag:i="li",...s},r)=>{const o=I("nav-item",e);return b.jsx(i,{className:o,style:{cursor:"pointer",...n},role:"presentation",ref:r,...s,children:t})});n4.displayName="MDBTabsItem";const i4=Y.forwardRef(({className:e,color:t,active:n,onOpen:i,onClose:s,children:r,...o},a)=>{const l=I("nav-link",n&&"active",t&&`bg-${t}`,e);return k.useEffect(()=>{n?i==null||i():s==null||s()},[n]),b.jsx("a",{className:l,ref:a,...o,children:r})});i4.displayName="MDBTabsLink";const s4=Y.forwardRef(({className:e,tag:t="div",children:n,...i},s)=>{const r=I("tab-content",e);return b.jsx(t,{className:r,ref:s,...i,children:n})});s4.displayName="MDBTabsContent";const r4=Y.forwardRef(({className:e,tag:t="div",open:n,children:i,...s},r)=>{const[o,a]=k.useState(!1),l=I("tab-pane","fade",o&&"show",n&&"active",e);return k.useEffect(()=>{let c;return n?c=setTimeout(()=>{a(!0)},100):a(!1),()=>{clearTimeout(c)}},[n]),b.jsx(t,{className:l,role:"tabpanel",ref:r,...s,children:i})});r4.displayName="MDBTabsPane";k.createContext({active:0});const vT=Y.createContext({activeItem:0,setActiveItem:null,alwaysOpen:!1,initialActive:0}),ng=Y.forwardRef(({alwaysOpen:e,borderless:t,className:n,flush:i,active:s,initialActive:r=0,tag:o="div",children:a,onChange:l,...c},u)=>{const d=k.useMemo(()=>typeof s<"u",[s]),h=I("accordion",i&&"accordion-flush",t&&"accordion-borderless",n),[f,p]=k.useState(r);return b.jsx(o,{className:h,ref:u,...c,children:b.jsx(vT.Provider,{value:{activeItem:d?s:f,setActiveItem:p,alwaysOpen:e,initialActive:r,onChange:l},children:a})})});ng.displayName="MDBAccordion";const oo=Y.forwardRef(({className:e,bodyClassName:t,bodyStyle:n,headerClassName:i,collapseId:s,headerTitle:r,headerStyle:o,btnClassName:a,tag:l="div",children:c,...u},d)=>{const{activeItem:h,setActiveItem:f,alwaysOpen:p,onChange:m}=k.useContext(vT),v=k.useMemo(()=>Array.isArray(h)?h.includes(s):h===s,[h,s]),y=I("accordion-item",e),g=I("accordion-header",i),x=I("accordion-body",t),_=I("accordion-button",!v&&"collapsed",a),w=k.useCallback(S=>{let C=S;Array.isArray(h)?h.includes(S)?C=h.filter(M=>M!==S):C=p?[...h,S]:[S]:(C=h===S?0:S,p&&(C=[C])),m==null||m(C),f(C)},[m,h,f,p]);return b.jsxs(l,{className:y,ref:d,...u,children:[b.jsx("h2",{className:g,style:o,children:b.jsx("button",{onClick:()=>w(s),className:_,type:"button",children:r})}),b.jsx(X3,{id:s.toString(),open:v,children:b.jsx("div",{className:x,style:n,children:c})})]})});oo.displayName="MDBAccordionItem";const o4=Y.forwardRef(({className:e,open:t,tag:n="div",children:i,...s},r)=>{const o=I("select-dropdown",t&&"open",e);return b.jsx(n,{className:o,...s,ref:r,children:i})});o4.displayName="MDBSelectDropdown";const a4=Y.forwardRef(({className:e,tag:t="span",children:n,...i},s)=>{const r=I("select-option-icon-container",e);return b.jsx(t,{className:r,...i,ref:s,children:n})});a4.displayName="MDBSelectIconContainer";const l4=Y.forwardRef(({className:e,tag:t="img",children:n,...i},s)=>{const r=I("select-option-icon",e);return b.jsx(t,{className:r,...i,ref:s,children:n})});l4.displayName="MDBSelectOptionIcon";const c4=Y.forwardRef(({className:e,tag:t="div",children:n,...i},s)=>{const r=I("select-options-list",e);return b.jsx(t,{className:r,...i,ref:s,children:n})});c4.displayName="MDBSelectOptionsList";const u4=Y.forwardRef(({className:e,tag:t="div",children:n,maxHeight:i,...s},r)=>{const o=I("select-options-wrapper",e);return b.jsx(t,{className:o,style:{maxHeight:i},...s,ref:r,children:n})});u4.displayName="MDBSelectOptionsWrapper";/*! +`):e}function TH(e,t){const{element:n,datasetIndex:i,index:s}=t,r=e.getDatasetMeta(i).controller,{label:o,value:a}=r.getLabelAndValue(s);return{chart:e,label:o,parsed:r.getParsed(s),raw:e.data.datasets[i].data[s],formattedValue:a,dataset:r.getDataset(),dataIndex:s,datasetIndex:i,element:n}}function E_(e,t){const n=e.chart.ctx,{body:i,footer:s,title:r}=e,{boxWidth:o,boxHeight:a}=t,l=be(t.bodyFont),c=be(t.titleFont),u=be(t.footerFont),d=r.length,h=s.length,f=i.length,p=ze(t.padding);let m=p.height,v=0,y=i.reduce((_,w)=>_+w.before.length+w.lines.length+w.after.length,0);if(y+=e.beforeBody.length+e.afterBody.length,d&&(m+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),y){const _=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;m+=f*_+(y-f)*l.lineHeight+(y-1)*t.bodySpacing}h&&(m+=t.footerMarginTop+h*u.lineHeight+(h-1)*t.footerSpacing);let g=0;const x=function(_){v=Math.max(v,n.measureText(_).width+g)};return n.save(),n.font=c.string,At(e.title,x),n.font=l.string,At(e.beforeBody.concat(e.afterBody),x),g=t.displayColors?o+2+t.boxPadding:0,At(i,_=>{At(_.before,x),At(_.lines,x),At(_.after,x)}),g=0,n.font=u.string,At(e.footer,x),n.restore(),v+=p.width,{width:v,height:m}}function DH(e,t){const{y:n,height:i}=t;return ne.height-i/2?"bottom":"center"}function EH(e,t,n,i){const{x:s,width:r}=i,o=n.caretSize+n.caretPadding;if(e==="left"&&s+r+o>t.width||e==="right"&&s-r-o<0)return!0}function AH(e,t,n,i){const{x:s,width:r}=n,{width:o,chartArea:{left:a,right:l}}=e;let c="center";return i==="center"?c=s<=(a+l)/2?"left":"right":s<=r/2?c="left":s>=o-r/2&&(c="right"),EH(c,e,t,n)&&(c="center"),c}function A_(e,t,n){const i=n.yAlign||t.yAlign||DH(e,n);return{xAlign:n.xAlign||t.xAlign||AH(e,t,n,i),yAlign:i}}function OH(e,t){let{x:n,width:i}=e;return t==="right"?n-=i:t==="center"&&(n-=i/2),n}function RH(e,t,n){let{y:i,height:s}=e;return t==="top"?i+=n:t==="bottom"?i-=s+n:i-=s/2,i}function O_(e,t,n,i){const{caretSize:s,caretPadding:r,cornerRadius:o}=e,{xAlign:a,yAlign:l}=n,c=s+r,{topLeft:u,topRight:d,bottomLeft:h,bottomRight:f}=Er(o);let p=OH(t,a);const m=RH(t,l,c);return l==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(u,h)+s:a==="right"&&(p+=Math.max(d,f)+s),{x:ke(p,0,i.width-t.width),y:ke(m,0,i.height-t.height)}}function Tu(e,t,n){const i=ze(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-i.right:e.x+i.left}function R_(e){return ui([],Li(e))}function LH(e,t,n){return er(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function L_(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}class Jm extends oi{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||t._chart,this._chart=this.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,i=this.options.setContext(this.getContext()),s=i.enabled&&n.options.animation&&i.animations,r=new WP(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=LH(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:i}=n,s=i.beforeTitle.apply(this,[t]),r=i.title.apply(this,[t]),o=i.afterTitle.apply(this,[t]);let a=[];return a=ui(a,Li(s)),a=ui(a,Li(r)),a=ui(a,Li(o)),a}getBeforeBody(t,n){return R_(n.callbacks.beforeBody.apply(this,[t]))}getBody(t,n){const{callbacks:i}=n,s=[];return At(t,r=>{const o={before:[],lines:[],after:[]},a=L_(i,r);ui(o.before,Li(a.beforeLabel.call(this,r))),ui(o.lines,a.label.call(this,r)),ui(o.after,Li(a.afterLabel.call(this,r))),s.push(o)}),s}getAfterBody(t,n){return R_(n.callbacks.afterBody.apply(this,[t]))}getFooter(t,n){const{callbacks:i}=n,s=i.beforeFooter.apply(this,[t]),r=i.footer.apply(this,[t]),o=i.afterFooter.apply(this,[t]);let a=[];return a=ui(a,Li(s)),a=ui(a,Li(r)),a=ui(a,Li(o)),a}_createItems(t){const n=this._active,i=this.chart.data,s=[],r=[],o=[];let a=[],l,c;for(l=0,c=n.length;lt.filter(u,d,h,i))),t.itemSort&&(a=a.sort((u,d)=>t.itemSort(u,d,i))),At(a,u=>{const d=L_(t.callbacks,u);s.push(d.labelColor.call(this,u)),r.push(d.labelPointStyle.call(this,u)),o.push(d.labelTextColor.call(this,u))}),this.labelColors=s,this.labelPointStyles=r,this.labelTextColors=o,this.dataPoints=a,a}update(t,n){const i=this.options.setContext(this.getContext()),s=this._active;let r,o=[];if(!s.length)this.opacity!==0&&(r={opacity:0});else{const a=Ml[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const l=this._size=E_(this,i),c=Object.assign({},a,l),u=A_(this.chart,i,c),d=O_(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,r={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,i,s){const r=this.getCaretPosition(t,i,s);n.lineTo(r.x1,r.y1),n.lineTo(r.x2,r.y2),n.lineTo(r.x3,r.y3)}getCaretPosition(t,n,i){const{xAlign:s,yAlign:r}=this,{caretSize:o,cornerRadius:a}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=Er(a),{x:h,y:f}=t,{width:p,height:m}=n;let v,y,g,x,_,w;return r==="center"?(_=f+m/2,s==="left"?(v=h,y=v-o,x=_+o,w=_-o):(v=h+p,y=v+o,x=_-o,w=_+o),g=v):(s==="left"?y=h+Math.max(l,u)+o:s==="right"?y=h+p-Math.max(c,d)-o:y=this.caretX,r==="top"?(x=f,_=x-o,v=y-o,g=y+o):(x=f+m,_=x+o,v=y+o,g=y-o),w=x),{x1:v,x2:y,x3:g,y1:x,y2:_,y3:w}}drawTitle(t,n,i){const s=this.title,r=s.length;let o,a,l;if(r){const c=Ro(i.rtl,this.x,this.width);for(t.x=Tu(this,i.titleAlign,i),n.textAlign=c.textAlign(i.titleAlign),n.textBaseline="middle",o=be(i.titleFont),a=i.titleSpacing,n.fillStyle=i.titleColor,n.font=o.string,l=0;lx!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,nc(t,{x:v,y:m,w:c,h:l,radius:g}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),nc(t,{x:y,y:m+1,w:c-2,h:l-2,radius:g}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(v,m,c,l),t.strokeRect(v,m,c,l),t.fillStyle=o.backgroundColor,t.fillRect(y,m+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,n,i){const{body:s}=this,{bodySpacing:r,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=i,d=be(i.bodyFont);let h=d.lineHeight,f=0;const p=Ro(i.rtl,this.x,this.width),m=function(M){n.fillText(M,p.x(t.x+f),t.y+h/2),t.y+=h+r},v=p.textAlign(o);let y,g,x,_,w,S,C;for(n.textAlign=o,n.textBaseline="middle",n.font=d.string,t.x=Tu(this,v,i),n.fillStyle=i.bodyColor,At(this.beforeBody,m),f=a&&v!=="right"?o==="center"?c/2+u:c+2+u:0,_=0,S=s.length;_0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,i=this.$animations,s=i&&i.x,r=i&&i.y;if(s||r){const o=Ml[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=E_(this,t),l=Object.assign({},o,this._size),c=A_(n,t,l),u=O_(t,l,c,n);(s._to!==u.x||r._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(n);const s={width:this.width,height:this.height},r={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=ze(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(r,t,s,n),IP(t,n.textDirection),r.y+=o.top,this.drawTitle(r,t,n),this.drawBody(r,t,n),this.drawFooter(r,t,n),FP(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const i=this._active,s=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),r=!qd(i,s),o=this._positionChanged(s,n);(r||o)&&(this._active=s,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,i=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,r=this._active||[],o=this._getActiveElements(t,r,n,i),a=this._positionChanged(o,t),l=n||!qd(o,r)||a;return l&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,i,s){const r=this.options;if(t.type==="mouseout")return[];if(!s)return n;const o=this.chart.getElementsAtEventForMode(t,r.mode,r,i);return r.reverse&&o.reverse(),o}_positionChanged(t,n){const{caretX:i,caretY:s,options:r}=this,o=Ml[r.position].call(this,t,n);return o!==!1&&(i!==o.x||s!==o.y)}}Jm.positioners=Ml;var NH={id:"tooltip",_element:Jm,positioners:Ml,afterInit(e,t,n){n&&(e.tooltip=new Jm({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)===!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:{beforeTitle:Ei,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,i=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndexe!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},jH=Object.freeze({__proto__:null,Decimation:eH,Filler:_H,Legend:SH,SubTitle:PH,Title:CH,Tooltip:NH});const $H=(e,t,n,i)=>(typeof t=="string"?(n=e.push(t)-1,i.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function IH(e,t,n,i){const s=e.indexOf(t);if(s===-1)return $H(e,t,n,i);const r=e.lastIndexOf(t);return s!==r?n:s}const FH=(e,t)=>e===null?null:ke(Math.round(e),0,t);class sh extends Xr{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const i=this.getLabels();for(const{index:s,label:r}of n)i[s]===r&&i.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(Mt(t))return null;const i=this.getLabels();return n=isFinite(n)&&i[n]===t?n:IH(i,t,ut(n,t),this._addedLabels),FH(n,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),n||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,n=this.max,i=this.options.offset,s=[];let r=this.getLabels();r=t===0&&n===r.length-1?r:r.slice(t,n+1),this._valueRange=Math.max(r.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let o=t;o<=n;o++)s.push({value:o});return s}getLabelForValue(t){const n=this.getLabels();return t>=0&&tn.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}sh.id="category";sh.defaults={ticks:{callback:sh.prototype.getLabelForValue}};function BH(e,t){const n=[],{bounds:s,step:r,min:o,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:h}=e,f=r||1,p=u-1,{min:m,max:v}=t,y=!Mt(o),g=!Mt(a),x=!Mt(c),_=(v-m)/(d+1);let w=A1((v-m)/p/f)*f,S,C,M,P;if(w<1e-14&&!y&&!g)return[{value:m},{value:v}];P=Math.ceil(v/w)-Math.floor(m/w),P>p&&(w=A1(P*w/p/f)*f),Mt(l)||(S=Math.pow(10,l),w=Math.ceil(w*S)/S),s==="ticks"?(C=Math.floor(m/w)*w,M=Math.ceil(v/w)*w):(C=m,M=v),y&&g&&r&&CV((a-o)/r,w/1e3)?(P=Math.round(Math.min((a-o)/w,u)),w=(a-o)/P,C=o,M=a):x?(C=y?o:C,M=g?a:M,P=c-1,w=(M-C)/P):(P=(M-C)/w,wl(P,Math.round(P),w/1e3)?P=Math.round(P):P=Math.ceil(P));const T=Math.max(O1(w),O1(C));S=Math.pow(10,Mt(l)?T:l),C=Math.round(C*S)/S,M=Math.round(M*S)/S;let A=0;for(y&&(h&&C!==o?(n.push({value:o}),Cs=n?s:l,a=l=>r=i?r:l;if(t){const l=_i(s),c=_i(r);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(s===r){let l=1;(r>=Number.MAX_SAFE_INTEGER||s<=Number.MIN_SAFE_INTEGER)&&(l=Math.abs(r*.05)),a(r+l),t||o(s-l)}this.min=s,this.max=r}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:i}=t,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),n=n||11),n&&(s=Math.min(n,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,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},r=this._range||this,o=BH(s,r);return t.bounds==="ticks"&&gP(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,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-n)/Math.max(t.length-1,1)/2;n-=s,i+=s}this._startValue=n,this._endValue=i,this._valueRange=i-n}getLabelForValue(t){return kc(t,this.chart.options.locale,this.options.ticks.format)}}class m0 extends rh{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=de(t)?t:0,this.max=de(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,i=ti(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,r.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}m0.id="linear";m0.defaults={ticks:{callback:Gh.formatters.numeric}};function j_(e){return e/Math.pow(10,Math.floor(jn(e)))===1}function VH(e,t){const n=Math.floor(jn(t.max)),i=Math.ceil(t.max/Math.pow(10,n)),s=[];let r=On(e.min,Math.pow(10,Math.floor(jn(t.min)))),o=Math.floor(jn(r)),a=Math.floor(r/Math.pow(10,o)),l=o<0?Math.pow(10,Math.abs(o)):1;do s.push({value:r,major:j_(r)}),++a,a===10&&(a=1,++o,l=o>=0?1:l),r=Math.round(a*Math.pow(10,o)*l)/l;while(o0?i:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=de(t)?Math.max(0,t):null,this.max=de(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let i=this.min,s=this.max;const r=l=>i=t?i:l,o=l=>s=n?s:l,a=(l,c)=>Math.pow(10,Math.floor(jn(l))+c);i===s&&(i<=0?(r(1),o(10)):(r(a(i,-1)),o(a(s,1)))),i<=0&&r(a(s,-1)),s<=0&&o(a(i,1)),this._zero&&this.min!==this._suggestedMin&&i===a(this.min,0)&&r(a(i,-1)),this.min=i,this.max=s}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},i=VH(n,this);return t.bounds==="ticks"&&gP(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":kc(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=jn(t),this._valueRange=jn(this.max)-jn(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(jn(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}g0.id="logarithmic";g0.defaults={ticks:{callback:Gh.formatters.logarithmic,major:{enabled:!0}}};function tg(e){const t=e.ticks;if(t.display&&e.display){const n=ze(t.backdropPadding);return ut(t.font&&t.font.size,_t.font.size)+n.height}return 0}function zH(e,t,n){return n=Vt(n)?n:[n],{w:sz(e,t.string,n),h:n.length*t.lineHeight}}function $_(e,t,n,i,s){return e===i||e===s?{start:t-n/2,end:t+n/2}:es?{start:t-n,end:t}:{start:t,end:t+n}}function WH(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),i=[],s=[],r=e._pointLabels.length,o=e.options.pointLabels,a=o.centerPointLabels?qt/r:0;for(let l=0;lt.r&&(a=(i.end-t.r)/r,e.r=Math.max(e.r,t.r+a)),s.startt.b&&(l=(s.end-t.b)/o,e.b=Math.max(e.b,t.b+l))}function UH(e,t,n){const i=[],s=e._pointLabels.length,r=e.options,o=tg(r)/2,a=e.drawingArea,l=r.pointLabels.centerPointLabels?qt/s:0;for(let c=0;c270||n<90)&&(e-=t),e}function GH(e,t){const{ctx:n,options:{pointLabels:i}}=e;for(let s=t-1;s>=0;s--){const r=i.setContext(e.getPointLabelContext(s)),o=be(r.font),{x:a,y:l,textAlign:c,left:u,top:d,right:h,bottom:f}=e._pointLabelItems[s],{backdropColor:p}=r;if(!Mt(p)){const m=Er(r.borderRadius),v=ze(r.backdropPadding);n.fillStyle=p;const y=u-v.left,g=d-v.top,x=h-u+v.width,_=f-d+v.height;Object.values(m).some(w=>w!==0)?(n.beginPath(),nc(n,{x:y,y:g,w:x,h:_,radius:m}),n.fill()):n.fillRect(y,g,x,_)}zr(n,e._pointLabels[s],a,l+o.lineHeight/2,o,{color:r.color,textAlign:c,textBaseline:"middle"})}}function uT(e,t,n,i){const{ctx:s}=e;if(n)s.arc(e.xCenter,e.yCenter,t,0,Nt);else{let r=e.getPointPosition(0,t);s.moveTo(r.x,r.y);for(let o=1;o{const s=Ft(this.options.pointLabels.callback,[n,i],this);return s||s===0?s:""}).filter((n,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?WH(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,i,s){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,i,s))}getIndexAngle(t){const n=Nt/(this._pointLabels.length||1),i=this.options.startAngle||0;return vn(t*n+ti(i))}getDistanceFromCenterForValue(t){if(Mt(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(Mt(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{if(u!==0){a=this.getDistanceFromCenterForValue(c.value);const d=s.setContext(this.getContext(u-1));qH(this,d,a,r)}}),i.display){for(t.save(),o=r-1;o>=0;o--){const c=i.setContext(this.getPointLabelContext(o)),{color:u,lineWidth:d}=c;!d||!u||(t.lineWidth=d,t.strokeStyle=u,t.setLineDash(c.borderDash),t.lineDashOffset=c.borderDashOffset,a=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),l=this.getPointPosition(o,a),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,i=n.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let r,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&!n.reverse)return;const c=i.setContext(this.getContext(l)),u=be(c.font);if(r=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,o=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const d=ze(c.backdropPadding);t.fillRect(-o/2-d.left,-r-u.size/2-d.top,o+d.width,u.size+d.height)}zr(t,a.label,0,-r,u,{color:c.color})}),t.restore()}drawTitle(){}}Mc.id="radialLinear";Mc.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Gh.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(e){return e},padding:5,centerPointLabels:!1}};Mc.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};Mc.descriptors={angleLines:{_fallback:"grid"}};const tf={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}},en=Object.keys(tf);function ZH(e,t){return e-t}function I_(e,t){if(Mt(t))return null;const n=e._adapter,{parser:i,round:s,isoWeekday:r}=e._parseOpts;let o=t;return typeof i=="function"&&(o=i(o)),de(o)||(o=typeof i=="string"?n.parse(o,i):n.parse(o)),o===null?null:(s&&(o=s==="week"&&(ta(r)||r===!0)?n.startOf(o,"isoWeek",r):n.startOf(o,s)),+o)}function F_(e,t,n,i){const s=en.length;for(let r=en.indexOf(e);r=en.indexOf(n);r--){const o=en[r];if(tf[o].common&&e._adapter.diff(s,i,o)>=t-1)return o}return en[n?en.indexOf(n):0]}function t3(e){for(let t=en.indexOf(e)+1,n=en.length;t=t?n[i]:n[s];e[r]=!0}}function e3(e,t,n,i){const s=e._adapter,r=+s.startOf(t[0].value,i),o=t[t.length-1].value;let a,l;for(a=r;a<=o;a=+s.add(a,1,i))l=n[a],l>=0&&(t[l].major=!0);return t}function V_(e,t,n){const i=[],s={},r=t.length;let o,a;for(o=0;o+t.value))}initOffsets(t){let n=0,i=0,s,r;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?n=1-s:n=(this.getDecimalForValue(t[1])-s)/2,r=this.getDecimalForValue(t[t.length-1]),t.length===1?i=r:i=(r-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;n=ke(n,0,o),i=ke(i,0,o),this._offsets={start:n,end:i,factor:1/(n+1+i)}}_generate(){const t=this._adapter,n=this.min,i=this.max,s=this.options,r=s.time,o=r.unit||F_(r.minUnit,n,i,this._getLabelCapacity(n)),a=ut(r.stepSize,1),l=o==="week"?r.isoWeekday:!1,c=ta(l)||l===!0,u={};let d=n,h,f;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":o),t.diff(i,n,o)>1e5*a)throw new Error(n+" and "+i+" are too far apart with stepSize of "+a+" "+o);const p=s.ticks.source==="data"&&this.getDataTimestamps();for(h=d,f=0;hm-v).map(m=>+m)}getLabelForValue(t){const n=this._adapter,i=this.options.time;return i.tooltipFormat?n.format(t,i.tooltipFormat):n.format(t,i.displayFormats.datetime)}_tickFormatFunction(t,n,i,s){const r=this.options,o=r.time.displayFormats,a=this._unit,l=this._majorUnit,c=a&&o[a],u=l&&o[l],d=i[n],h=l&&u&&d&&d.major,f=this._adapter.format(t,s||(h?u:c)),p=r.ticks.callback;return p?Ft(p,[f,n,i],this):f}generateTickLabels(t){let n,i,s;for(n=0,i=t.length;n0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,i;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(n=0,i=s.length;n=e[i].pos&&t<=e[s].pos&&({lo:i,hi:s}=Xi(e,"pos",t)),{pos:r,time:a}=e[i],{pos:o,time:l}=e[s]):(t>=e[i].time&&t<=e[s].time&&({lo:i,hi:s}=Xi(e,"time",t)),{time:r,pos:a}=e[i],{time:o,pos:l}=e[s]);const c=o-r;return c?a+(l-a)*(t-r)/c:a}class y0 extends Cc{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=Du(n,this.min),this._tableRange=Du(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:i}=this,s=[],r=[];let o,a,l,c,u;for(o=0,a=t.length;o=n&&c<=i&&s.push(c);if(s.length<2)return[{time:n,pos:0},{time:i,pos:1}];for(o=0,a=s.length;o.dropdown-menu{right:0!important}.select-input-label-active{color:#1266f1!important}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();const g3=Y.forwardRef(({breakpoint:e,fluid:t,children:n,className:i,tag:s="div",...r},o)=>{const a=I(`${t?"container-fluid":`container${e?"-"+e:""}`}`,i);return b.jsx(s,{className:a,...r,ref:o,children:n})});g3.displayName="MDBContainer";const y3=Y.forwardRef(({center:e,children:t,className:n,end:i,lg:s,md:r,offsetLg:o,offsetMd:a,offsetSm:l,order:c,size:u,sm:d,start:h,tag:f="div",xl:p,xxl:m,xs:v,...y},g)=>{const x=I(u&&`col-${u}`,v&&`col-xs-${v}`,d&&`col-sm-${d}`,r&&`col-md-${r}`,s&&`col-lg-${s}`,p&&`col-xl-${p}`,m&&`col-xxl-${m}`,!u&&!v&&!d&&!r&&!s&&!p&&!m?"col":"",c&&`order-${c}`,h&&"align-self-start",e&&"align-self-center",i&&"align-self-end",l&&`offset-sm-${l}`,a&&`offset-md-${a}`,o&&`offset-lg-${o}`,n);return b.jsx(f,{className:x,ref:g,...y,children:t})});y3.displayName="MDBCol";const v3=Y.forwardRef(({className:e,color:t="primary",pill:n,light:i,dot:s,tag:r="span",children:o,notification:a,...l},c)=>{const u=I("badge",i?t&&`badge-${t}`:t&&`bg-${t}`,s&&"badge-dot",n&&"rounded-pill",a&&"badge-notification",e);return b.jsx(r,{className:u,ref:c,...l,children:o})});v3.displayName="MDBBadge";const x3=({...e})=>{const[t,n]=k.useState(!1),i=I("ripple-wave",t&&"active");return k.useEffect(()=>{const s=setTimeout(()=>{n(!0)},50);return()=>{clearTimeout(s)}},[]),b.jsx("div",{className:i,...e})},b3=(...e)=>{const t=Y.useRef();return Y.useEffect(()=>{e.forEach(n=>{n&&(typeof n=="function"?n(t.current):n.current=t.current)})},[e]),t},v0=Y.forwardRef(({className:e,rippleTag:t="div",rippleCentered:n,rippleDuration:i=500,rippleUnbound:s,rippleRadius:r=0,rippleColor:o="dark",children:a,onMouseDown:l,...c},u)=>{const d=k.useRef(null),h=b3(u,d),f="rgba({{color}}, 0.2) 0, rgba({{color}}, 0.3) 40%, rgba({{color}}, 0.4) 50%, rgba({{color}}, 0.5) 60%, rgba({{color}}, 0) 70%",p=[0,0,0],m=["primary","secondary","success","danger","warning","info","light","dark"],[v,y]=k.useState([]),[g,x]=k.useState(!1),_=I("ripple","ripple-surface",s&&"ripple-surface-unbound",g&&`ripple-surface-${o}`,e),w=()=>{if(m.find(T=>T===(o==null?void 0:o.toLowerCase())))return x(!0);{const T=S(o).join(",");return`radial-gradient(circle, ${f.split("{{color}}").join(`${T}`)})`}},S=T=>{const A=N=>(N.length<7&&(N=`#${N[1]}${N[1]}${N[2]}${N[2]}${N[3]}${N[3]}`),[parseInt(N.substr(1,2),16),parseInt(N.substr(3,2),16),parseInt(N.substr(5,2),16)]),E=N=>{const R=document.body.appendChild(document.createElement("fictum")),L="rgb(1, 2, 3)";return R.style.color=L,R.style.color!==L||(R.style.color=N,R.style.color===L||R.style.color==="")?p:(N=getComputedStyle(R).color,document.body.removeChild(R),N)},z=N=>(N=N.match(/[.\d]+/g).map(R=>+Number(R)),N.length=3,N);return T.toLowerCase()==="transparent"?p:T[0]==="#"?A(T):(T.indexOf("rgb")===-1&&(T=E(T)),T.indexOf("rgb")===0?z(T):p)},C=T=>{const{offsetX:A,offsetY:E,height:z,width:N}=T,R=E<=z/2,L=A<=N/2,B=(W,et)=>Math.sqrt(W**2+et**2),D=E===z/2&&A===N/2,$={first:R===!0&&L===!1,second:R===!0&&L===!0,third:R===!1&&L===!0,fourth:R===!1&&L===!1},F={topLeft:B(A,E),topRight:B(N-A,E),bottomLeft:B(A,z-E),bottomRight:B(N-A,z-E)};let V=0;return D||$.fourth?V=F.topLeft:$.third?V=F.topRight:$.second?V=F.bottomRight:$.first&&(V=F.bottomLeft),V*2},M=T=>{var A;const E=(A=h.current)==null?void 0:A.getBoundingClientRect(),z=T.clientX-E.left,N=T.clientY-E.top,R=E.height,L=E.width,B={offsetX:n?R/2:z,offsetY:n?L/2:N,height:R,width:L},D={delay:i&&i*.5,duration:i&&i-i*.5},$=C(B),F=r||$/2,V={left:n?`${L/2-F}px`:`${z-F}px`,top:n?`${R/2-F}px`:`${N-F}px`,height:r?`${r*2}px`:`${$}px`,width:r?`${r*2}px`:`${$}px`,transitionDelay:`0s, ${D.delay}ms`,transitionDuration:`${i}ms, ${D.duration}ms`};return g?V:{...V,backgroundImage:`${w()}`}},P=T=>{const A=M(T),E=v.concat(A);y(E),l&&l(T)};return k.useEffect(()=>{const T=setTimeout(()=>{v.length>0&&y(v.splice(1,v.length-1))},i);return()=>{clearTimeout(T)}},[i,v]),b.jsxs(t,{className:_,onMouseDown:T=>P(T),ref:h,...c,children:[a,v.map((T,A)=>b.jsx(x3,{style:T},A))]})});v0.displayName="MDBRipple";const Zt=Y.forwardRef(({className:e,color:t="primary",outline:n,children:i,rounded:s,disabled:r,floating:o,size:a,href:l,block:c,active:u,toggle:d,noRipple:h,tag:f="button",role:p="button",...m},v)=>{const[y,g]=k.useState(u||!1);let x;const _=t&&["light","link"].includes(t)||n?"dark":"light";t!=="none"?n?t?x=`btn-outline-${t}`:x="btn-outline-primary":t?x=`btn-${t}`:x="btn-primary":x="";const w=I(t!=="none"&&"btn",x,s&&"btn-rounded",o&&"btn-floating",a&&`btn-${a}`,`${(l||f!=="button")&&r?"disabled":""}`,c&&"btn-block",y&&"active",e);return l&&f!=="a"&&(f="a"),["hr","img","input"].includes(f)||h?b.jsx(f,{className:w,onClick:d?()=>{g(!y)}:void 0,disabled:r&&f==="button"?!0:void 0,href:l,ref:v,role:p,...m,children:i}):b.jsx(v0,{rippleTag:f,rippleColor:_,className:w,onClick:d?()=>{g(!y)}:void 0,disabled:r&&f==="button"?!0:void 0,href:l,ref:v,role:p,...m,children:i})});Zt.displayName="MDBBtn";const _3=Y.forwardRef(({className:e,children:t,shadow:n,toolbar:i,size:s,vertical:r,tag:o="div",role:a="group",...l},c)=>{let u;i?u="btn-toolbar":r?u="btn-group-vertical":u="btn-group";const d=I(u,n&&`shadow-${n}`,s&&`btn-group-${s}`,e);return b.jsx(o,{className:d,ref:c,role:a,...l,children:t})});_3.displayName="MDBBtnGroup";const hT=Y.forwardRef(({className:e,children:t,tag:n="div",color:i,grow:s,size:r,...o},a)=>{const l=I(`${s?"spinner-grow":"spinner-border"}`,i&&`text-${i}`,`${r?s?"spinner-grow-"+r:"spinner-border-"+r:""}`,e);return b.jsx(n,{className:l,ref:a,...o,children:t})});hT.displayName="MDBSpinner";const od=Y.forwardRef(({className:e,children:t,border:n,background:i,tag:s="div",shadow:r,alignment:o,...a},l)=>{const c=I("card",n&&`border border-${n}`,i&&`bg-${i}`,r&&`shadow-${r}`,o&&`text-${o}`,e);return b.jsx(s,{className:c,ref:l,...a,children:t})});od.displayName="MDBCard";const ad=Y.forwardRef(({className:e,children:t,border:n,background:i,tag:s="div",...r},o)=>{const a=I("card-header",n&&`border-${n}`,i&&`bg-${i}`,e);return b.jsx(s,{className:a,...r,ref:o,children:t})});ad.displayName="MDBCardHeader";const w3=Y.forwardRef(({className:e,children:t,tag:n="p",...i},s)=>{const r=I("card-subtitle",e);return b.jsx(n,{className:r,...i,ref:s,children:t})});w3.displayName="MDBCardSubTitle";const fT=Y.forwardRef(({className:e,children:t,tag:n="h5",...i},s)=>{const r=I("card-title",e);return b.jsx(n,{className:r,...i,ref:s,children:t})});fT.displayName="MDBCardTitle";const el=Y.forwardRef(({className:e,children:t,tag:n="p",...i},s)=>{const r=I("card-text",e);return b.jsx(n,{className:r,...i,ref:s,children:t})});el.displayName="MDBCardText";const eg=Y.forwardRef(({className:e,children:t,tag:n="div",...i},s)=>{const r=I("card-body",e);return b.jsx(n,{className:r,...i,ref:s,children:t})});eg.displayName="MDBCardBody";const k3=Y.forwardRef(({className:e,children:t,border:n,background:i,tag:s="div",...r},o)=>{const a=I("card-footer",n&&`border-${n}`,i&&`bg-${i}`,e);return b.jsx(s,{className:a,...r,ref:o,children:t})});k3.displayName="MDBCardFooter";const S3=Y.forwardRef(({className:e,children:t,tag:n="div",...i},s)=>{const r=I("card-img-overlay",e);return b.jsx(n,{className:r,...i,ref:s,children:t})});S3.displayName="MDBCardOverlay";const M3=Y.forwardRef(({className:e,children:t,tag:n="div",...i},s)=>{const r=I("card-group",e);return b.jsx(n,{className:r,...i,ref:s,children:t})});M3.displayName="MDBCardGroup";const C3=Y.forwardRef(({className:e,tag:t="ul",horizontal:n,horizontalSize:i,light:s,numbered:r,children:o,small:a,...l},c)=>{const u=I("list-group",n&&(i?`list-group-horizontal-${i}`:"list-group-horizontal"),s&&"list-group-light",r&&"list-group-numbered",a&&"list-group-small",e);return b.jsx(t,{className:u,ref:c,...l,children:o})});C3.displayName="MDBListGroup";const P3=Y.forwardRef(({className:e,tag:t="li",active:n,disabled:i,action:s,color:r,children:o,noBorders:a,...l},c)=>{const u=t==="button",d=I("list-group-item",n&&"active",i&&!u&&"disabled",s&&"list-group-item-action",r&&`list-group-item-${r}`,a&&"border-0",e);return b.jsx(t,{className:d,disabled:u&&i,ref:c,...l,children:o})});P3.displayName="MDBListGroupItem";const aa=({children:e,containerRef:t,disablePortal:n})=>{const[i,s]=k.useState(!1);return k.useEffect(()=>{!n&&s(!0)},[n]),n?b.jsx(b.Fragment,{children:e}):i?iy.createPortal(b.jsx(b.Fragment,{children:e}),(t==null?void 0:t.current)||document.body):null},T3=Y.forwardRef(({around:e,between:t,bottom:n,center:i,children:s,className:r,evenly:o,end:a,middle:l,start:c,tag:u="div",top:d,...h},f)=>{const p=I("row",e&&"justify-content-around",t&&"justify-content-between",n&&"align-self-end",i&&"justify-content-center",o&&"justifty-content-evenly",a&&"justify-content-end",l&&"align-self-center",c&&"justify-content-start",d&&"align-self-start",r);return b.jsx(u,{className:p,...h,ref:f,children:s})});T3.displayName="MDBRow";const sn=({animate:e,className:t,icon:n,fab:i,fas:s,fal:r,far:o,flag:a,spin:l,fixed:c,flip:u,list:d,size:h,pull:f,pulse:p,color:m,border:v,rotate:y,inverse:g,stack:x,iconType:_,children:w,...S})=>{let C;a?C="flag":i?C="fab":s?C="fas":o?C="far":r?C="fal":C="fa";const M=I(_?`fa-${_}`:C,e&&`fa-${e}`,a?`flag-${a}`:n&&`fa-${n}`,h&&`fa-${h}`,m&&`text-${m}`,v&&"fa-border",y&&`fa-rotate-${y}`,f&&`fa-pull-${f}`,l&&!e&&"fa-spin",d&&"fa-li",c&&"fa-fw",p&&!e&&"fa-pulse",g&&"fa-inverse",u&&`fa-flip-${u}`,x&&`fa-stack-${x}`,t);return b.jsx("i",{className:M,...S,children:w})},D3=Y.forwardRef(({className:e,children:t,tag:n="p",variant:i,color:s,blockquote:r,note:o,noteColor:a,listUnStyled:l,listInLine:c,...u},d)=>{const h=I(i&&i,r&&"blockquote",o&&"note",s&&`text-${s}`,a&&`note-${a}`,l&&"list-unstyled",c&&"list-inline",e);return r&&(n="blockquote"),(l||c)&&(n="ul"),b.jsx(n,{className:h,ref:d,...u,children:t})});D3.displayName="MDBTypography";const E3=Y.forwardRef(({className:e,color:t,uppercase:n,bold:i,children:s,...r},o)=>{const a=I("breadcrumb",i&&"font-weight-bold",t&&`text-${t}`,n&&"text-uppercase",e);return b.jsx("nav",{"aria-label":"breadcrumb",children:b.jsx("ol",{className:a,ref:o,...r,children:s})})});E3.displayName="MDBBreadcrumb";const A3=Y.forwardRef(({className:e,active:t,current:n="page",children:i,...s},r)=>{const o=I("breadcrumb-item",t&&"active",e);return b.jsx("li",{className:o,ref:r,"aria-current":t&&n,...s,children:i})});A3.displayName="MDBBreadcrumbItem";const O3=e=>{if(e!==!1)return`navbar-expand-${e}`},pT=Y.forwardRef(({className:e,children:t,light:n,dark:i,scrolling:s,fixed:r,sticky:o,scrollingNavbarOffset:a,color:l,transparent:c,expand:u,tag:d="nav",bgColor:h,...f},p)=>{const[m,v]=k.useState(!1),y=I({"navbar-light":n,"navbar-dark":i,"scrolling-navbar":s||a,"top-nav-collapse":m,[`text-${l}`]:l&&c?m:l},r&&`fixed-${r}`,o&&"sticky-top","navbar",u&&O3(u),h&&`bg-${h}`,e),g=k.useCallback(()=>{a&&window.pageYOffset>a?v(!0):v(!1)},[a]);return k.useEffect(()=>((s||a)&&window.addEventListener("scroll",g),()=>{window.removeEventListener("scroll",g)}),[g,s,a]),b.jsx(d,{className:y,role:"navigation",...f,ref:p,children:t})});pT.displayName="MDBNavbar";const R3=Y.forwardRef(({children:e,className:t="",disabled:n=!1,active:i=!1,tag:s="a",...r},o)=>{const a=I("nav-link",n?"disabled":i?"active":"",t);return b.jsx(s,{"data-test":"nav-link",className:a,style:{cursor:"pointer"},ref:o,...r,children:e})});R3.displayName="MDBNavbarLink";const L3=Y.forwardRef(({className:e,children:t,tag:n="a",...i},s)=>{const r=I("navbar-brand",e);return b.jsx(n,{className:r,ref:s,...i,children:t})});L3.displayName="MDBNavbarBrand";const N3=Y.forwardRef(({children:e,className:t,active:n,text:i,tag:s="li",...r},o)=>{const a=I("nav-item",n&&"active",i&&"navbar-text",t);return b.jsx(s,{...r,className:a,ref:o,children:e})});N3.displayName="MDBNavbarItem";const j3=Y.forwardRef(({children:e,className:t,right:n,fullWidth:i=!0,left:s,tag:r="ul",...o},a)=>{const l=I("navbar-nav",i&&"w-100",n&&"ms-auto",s&&"me-auto",t);return b.jsx(r,{className:l,ref:a,...o,children:e})});j3.displayName="MDBNavbarNav";const $3=Y.forwardRef(({children:e,className:t,tag:n="button",...i},s)=>{const r=I("navbar-toggler",t);return b.jsx(n,{...i,className:r,ref:s,children:e})});$3.displayName="MDBNavbarToggler";const I3=Y.forwardRef(({children:e,bgColor:t,color:n,className:i,...s},r)=>{const o=I(t&&`bg-${t}`,n&&`text-${n}`,i);return b.jsx("footer",{className:o,...s,ref:r,children:e})});I3.displayName="MDBFooter";const F3=Y.forwardRef(({children:e,size:t,circle:n,center:i,end:s,start:r,className:o,...a},l)=>{const c=I("pagination",i&&"justify-content-center",n&&"pagination-circle",s&&"justify-content-end",t&&`pagination-${t}`,r&&"justify-content-start",o);return b.jsx("ul",{className:c,...a,ref:l,children:e})});F3.displayName="MDBPagination";const B3=Y.forwardRef(({children:e,className:t,tag:n="a",...i},s)=>{const r=I("page-link",t);return b.jsx(n,{className:r,...i,ref:s,children:e})});B3.displayName="MDBPaginationLink";const V3=Y.forwardRef(({children:e,className:t,active:n,disabled:i,...s},r)=>{const o=I("page-item",n&&"active",i&&"disabled",t);return b.jsx("li",{className:o,...s,ref:r,children:e})});V3.displayName="MDBPaginationItem";const z3=({className:e,classNameResponsive:t,responsive:n,align:i,borderColor:s,bordered:r,borderless:o,children:a,color:l,hover:c,small:u,striped:d,...h})=>{const f=I("table",i&&`align-${i}`,s&&`border-${s}`,r&&"table-bordered",o&&"table-borderless",l&&`table-${l}`,c&&"table-hover",u&&"table-sm",d&&"table-striped",e),p=k.useMemo(()=>b.jsx("table",{className:f,...h,children:a}),[a,f,h]);if(n){const m=I(typeof n=="string"?`table-responsive-${n}`:"table-responsive",t);return b.jsx("div",{className:m,children:p})}else return p},W3=({className:e,children:t,dark:n,light:i,...s})=>{const r=I(n&&"table-dark",i&&"table-light",e);return b.jsx("thead",{className:r,...s,children:t})},H3=({className:e,children:t,...n})=>{const i=I(e);return b.jsx("tbody",{className:i,...n,children:t})},mT=Y.forwardRef(({animated:e,children:t,className:n,style:i,tag:s="div",valuenow:r,valuemax:o,striped:a,bgColor:l,valuemin:c,width:u,...d},h)=>{const f=I("progress-bar",l&&`bg-${l}`,a&&"progress-bar-striped",e&&"progress-bar-animated",n),p={width:`${u}%`,...i};return b.jsx(s,{className:f,style:p,ref:h,role:"progressbar",...d,"aria-valuenow":Number(u)??r,"aria-valuemin":Number(c),"aria-valuemax":Number(o),children:t})});mT.displayName="MDBProgressBar";const U3=Y.forwardRef(({className:e,children:t,tag:n="div",height:i,style:s,...r},o)=>{const a=I("progress",e),l={height:`${i}px`,...s};return b.jsx(n,{className:a,ref:o,style:l,...r,children:Y.Children.map(t,c=>{if(!Y.isValidElement(c)||c.type!==mT){console.error("Progress component only allows ProgressBar as child");return}else return c})})});U3.displayName="MDBProgress";const Y3=e=>{const[t,n]=k.useState(!1),[i,s]=k.useState(null);return k.useEffect(()=>{s(()=>new IntersectionObserver(([r])=>{n(r.isIntersecting)}))},[]),k.useEffect(()=>{if(!(!e.current||!i))return i.observe(e.current),()=>i.disconnect()},[i,e]),t},ef=(e,t)=>k.useMemo(()=>t!==void 0?t:e,[t,e]),wi=Y.forwardRef(({className:e,size:t,contrast:n,value:i,defaultValue:s,id:r,labelClass:o,wrapperClass:a,wrapperStyle:l,wrapperTag:c="div",label:u,onChange:d,children:h,labelRef:f,labelStyle:p,type:m,onBlur:v,readonly:y=!1,showCounter:g=!1,...x},_)=>{var w;const[S,C]=k.useState(s),M=k.useMemo(()=>i!==void 0?i:S,[i,S]),[P,T]=k.useState(0),[A,E]=k.useState(!1),[z,N]=k.useState(0),R=k.useRef(null),L=Y3(R),B=k.useRef(null),D=f||B;k.useImperativeHandle(_,()=>R.current);const $=I("form-outline",n&&"form-white",a),F=I("form-control",A&&"active",m==="date"&&"active",t&&`form-control-${t}`,e),V=I("form-label",o),W=k.useCallback(()=>{var O;(O=D.current)!=null&&O.clientWidth&&T(D.current.clientWidth*.8+8)},[D]),et=O=>{C(O.target.value),g&&N(O.target.value.length),d==null||d(O)},Z=k.useCallback(O=>{R.current&&(E(!!M),v&&v(O))},[M,v]);return k.useEffect(()=>{W()},[(w=D.current)==null?void 0:w.clientWidth,W,L]),k.useEffect(()=>{if(M)return E(!0);E(!1)},[M]),b.jsxs(c,{className:$,style:l,children:[b.jsx("input",{type:m,readOnly:y,className:F,onBlur:Z,onChange:et,onFocus:W,value:i,defaultValue:s,id:r,ref:R,...x}),u&&b.jsx("label",{className:V,style:p,htmlFor:r,ref:D,children:u}),b.jsxs("div",{className:"form-notch",children:[b.jsx("div",{className:"form-notch-leading"}),b.jsx("div",{className:"form-notch-middle",style:{width:P}}),b.jsx("div",{className:"form-notch-trailing"})]}),h,g&&x.maxLength&&b.jsx("div",{className:"form-helper",children:b.jsx("div",{className:"form-counter",children:`${z}/${x.maxLength}`})})]})});wi.displayName="MDBInput";const gT=k.forwardRef(({className:e,inputRef:t,labelClass:n,wrapperClass:i,labelStyle:s,wrapperTag:r="div",wrapperStyle:o,label:a,inline:l,btn:c,id:u,btnColor:d,disableWrapper:h,toggleSwitch:f,...p},m)=>{let v="form-check-input",y="form-check-label";c&&(v="btn-check",d?y=`btn btn-${d}`:y="btn btn-primary");const g=I(a&&!c&&"form-check",l&&!c&&"form-check-inline",f&&"form-switch",i),x=I(v,e),_=I(y,n),w=b.jsxs(b.Fragment,{children:[b.jsx("input",{className:x,id:u,ref:t,...p}),a&&b.jsx("label",{className:_,style:s,htmlFor:u,children:a})]});return b.jsx(b.Fragment,{children:h?w:b.jsx(r,{style:o,className:g,ref:m,children:w})})});gT.displayName="InputTemplate";const oh=({...e})=>b.jsx(gT,{type:"checkbox",...e}),X3=({className:e,children:t,open:n=!1,id:i,navbar:s,tag:r="div",collapseRef:o,style:a,onOpen:l,onClose:c,...u})=>{const[d,h]=k.useState(!1),[f,p]=k.useState(void 0),[m,v]=k.useState(!1),y=I(m?"collapsing":"collapse",!m&&d&&"show",s&&"navbar-collapse",e),g=k.useRef(null),x=o??g,_=k.useCallback(()=>{d&&p(void 0)},[d]);return k.useEffect(()=>{var w;f===void 0&&d&&p((w=x==null?void 0:x.current)==null?void 0:w.scrollHeight)},[f,d,x]),k.useEffect(()=>{d!==n&&(n?l==null||l():c==null||c(),h(n)),d&&v(!0);const w=setTimeout(()=>{v(!1)},350);return()=>{clearTimeout(w)}},[n,d,l,c]),k.useEffect(()=>{var w;p(d?(w=x==null?void 0:x.current)==null?void 0:w.scrollHeight:0)},[d,x,t]),k.useEffect(()=>(window.addEventListener("resize",_),()=>{window.removeEventListener("resize",_)}),[_]),b.jsx(r,{style:{height:f,...a},id:i,className:y,...u,ref:x,children:t})};k.createContext(null);const K3=Y.forwardRef(({className:e,children:t,tag:n="div",...i},s)=>{const r=I("modal-content",e);return b.jsx(n,{className:r,...i,ref:s,children:t})});K3.displayName="MDBModalContent";const G3=Y.forwardRef(({className:e,children:t,tag:n="div",...i},s)=>{const r=I("modal-header",e);return b.jsx(n,{className:r,...i,ref:s,children:t})});G3.displayName="MDBModalHeader";const q3=Y.forwardRef(({className:e,children:t,tag:n="h5",...i},s)=>{const r=I("modal-title",e);return b.jsx(n,{className:r,...i,ref:s,children:t})});q3.displayName="MDBModalTitle";const Q3=Y.forwardRef(({className:e,children:t,tag:n="div",...i},s)=>{const r=I("modal-body",e);return b.jsx(n,{className:r,...i,ref:s,children:t})});Q3.displayName="MDBModalBody";const Z3=Y.forwardRef(({className:e,children:t,tag:n="div",...i},s)=>{const r=I("modal-footer",e);return b.jsx(n,{className:r,...i,ref:s,children:t})});Z3.displayName="MDBModalFooter";Y.createContext({activeElement:null,setTargets:null});const J3=k.forwardRef(({className:e,labelClass:t,labelStyle:n,inputRef:i,size:s,label:r,id:o,...a},l)=>{const c=I("form-control",`form-control-${s}`,e),u=I("form-label",t),d=k.useRef(null);return k.useImperativeHandle(l,()=>d.current||(i==null?void 0:i.current)),b.jsxs(b.Fragment,{children:[r&&b.jsx("label",{className:u,style:n,htmlFor:o,children:r}),b.jsx("input",{className:c,type:"file",id:o,ref:d,...a})]})});J3.displayName="MDBFile";const yT=Y.forwardRef(({className:e,children:t,noBorder:n,textBefore:i,textAfter:s,noWrap:r,tag:o="div",textTag:a="span",textClass:l,size:c,textProps:u,...d},h)=>{const f=I("input-group",r&&"flex-nowrap",c&&`input-group-${c}`,e),p=I("input-group-text",n&&"border-0",l),m=v=>b.jsx(b.Fragment,{children:v&&Array.isArray(v)?v.map((y,g)=>b.jsx(a,{className:p,...u,children:y},g)):b.jsx(a,{className:p,...u,children:v})});return b.jsxs(o,{className:f,ref:h,...d,children:[i&&m(i),t,s&&m(s)]})});yT.displayName="MDBInputGroup";const t4=Y.forwardRef(({className:e,children:t,isValidated:n=!1,onReset:i,onSubmit:s,noValidate:r=!0,...o},a)=>{const[l,c]=k.useState(n),u=I("needs-validation",l&&"was-validated",e),d=f=>{f.preventDefault(),c(!0),s&&s(f)},h=f=>{f.preventDefault(),c(!1),i&&i(f)};return k.useEffect(()=>{c(n)},[n]),b.jsx("form",{className:u,onSubmit:d,onReset:h,ref:a,noValidate:r,...o,children:t})});t4.displayName="MDBValidation";const e4=Y.forwardRef(({className:e,fill:t,pills:n,justify:i,children:s,...r},o)=>{const a=I("nav",n?"nav-pills":"nav-tabs",t&&"nav-fill",i&&"nav-justified",e);return b.jsx("ul",{className:a,ref:o,...r,children:s})});e4.displayName="MDBTabs";const n4=Y.forwardRef(({className:e,children:t,style:n,tag:i="li",...s},r)=>{const o=I("nav-item",e);return b.jsx(i,{className:o,style:{cursor:"pointer",...n},role:"presentation",ref:r,...s,children:t})});n4.displayName="MDBTabsItem";const i4=Y.forwardRef(({className:e,color:t,active:n,onOpen:i,onClose:s,children:r,...o},a)=>{const l=I("nav-link",n&&"active",t&&`bg-${t}`,e);return k.useEffect(()=>{n?i==null||i():s==null||s()},[n]),b.jsx("a",{className:l,ref:a,...o,children:r})});i4.displayName="MDBTabsLink";const s4=Y.forwardRef(({className:e,tag:t="div",children:n,...i},s)=>{const r=I("tab-content",e);return b.jsx(t,{className:r,ref:s,...i,children:n})});s4.displayName="MDBTabsContent";const r4=Y.forwardRef(({className:e,tag:t="div",open:n,children:i,...s},r)=>{const[o,a]=k.useState(!1),l=I("tab-pane","fade",o&&"show",n&&"active",e);return k.useEffect(()=>{let c;return n?c=setTimeout(()=>{a(!0)},100):a(!1),()=>{clearTimeout(c)}},[n]),b.jsx(t,{className:l,role:"tabpanel",ref:r,...s,children:i})});r4.displayName="MDBTabsPane";k.createContext({active:0});const vT=Y.createContext({activeItem:0,setActiveItem:null,alwaysOpen:!1,initialActive:0}),ng=Y.forwardRef(({alwaysOpen:e,borderless:t,className:n,flush:i,active:s,initialActive:r=0,tag:o="div",children:a,onChange:l,...c},u)=>{const d=k.useMemo(()=>typeof s<"u",[s]),h=I("accordion",i&&"accordion-flush",t&&"accordion-borderless",n),[f,p]=k.useState(r);return b.jsx(o,{className:h,ref:u,...c,children:b.jsx(vT.Provider,{value:{activeItem:d?s:f,setActiveItem:p,alwaysOpen:e,initialActive:r,onChange:l},children:a})})});ng.displayName="MDBAccordion";const oo=Y.forwardRef(({className:e,bodyClassName:t,bodyStyle:n,headerClassName:i,collapseId:s,headerTitle:r,headerStyle:o,btnClassName:a,tag:l="div",children:c,...u},d)=>{const{activeItem:h,setActiveItem:f,alwaysOpen:p,onChange:m}=k.useContext(vT),v=k.useMemo(()=>Array.isArray(h)?h.includes(s):h===s,[h,s]),y=I("accordion-item",e),g=I("accordion-header",i),x=I("accordion-body",t),_=I("accordion-button",!v&&"collapsed",a),w=k.useCallback(S=>{let C=S;Array.isArray(h)?h.includes(S)?C=h.filter(M=>M!==S):C=p?[...h,S]:[S]:(C=h===S?0:S,p&&(C=[C])),m==null||m(C),f(C)},[m,h,f,p]);return b.jsxs(l,{className:y,ref:d,...u,children:[b.jsx("h2",{className:g,style:o,children:b.jsx("button",{onClick:()=>w(s),className:_,type:"button",children:r})}),b.jsx(X3,{id:s.toString(),open:v,children:b.jsx("div",{className:x,style:n,children:c})})]})});oo.displayName="MDBAccordionItem";const o4=Y.forwardRef(({className:e,open:t,tag:n="div",children:i,...s},r)=>{const o=I("select-dropdown",t&&"open",e);return b.jsx(n,{className:o,...s,ref:r,children:i})});o4.displayName="MDBSelectDropdown";const a4=Y.forwardRef(({className:e,tag:t="span",children:n,...i},s)=>{const r=I("select-option-icon-container",e);return b.jsx(t,{className:r,...i,ref:s,children:n})});a4.displayName="MDBSelectIconContainer";const l4=Y.forwardRef(({className:e,tag:t="img",children:n,...i},s)=>{const r=I("select-option-icon",e);return b.jsx(t,{className:r,...i,ref:s,children:n})});l4.displayName="MDBSelectOptionIcon";const c4=Y.forwardRef(({className:e,tag:t="div",children:n,...i},s)=>{const r=I("select-options-list",e);return b.jsx(t,{className:r,...i,ref:s,children:n})});c4.displayName="MDBSelectOptionsList";const u4=Y.forwardRef(({className:e,tag:t="div",children:n,maxHeight:i,...s},r)=>{const o=I("select-options-wrapper",e);return b.jsx(t,{className:o,style:{maxHeight:i},...s,ref:r,children:n})});u4.displayName="MDBSelectOptionsWrapper";/*! * perfect-scrollbar v1.5.3 * Copyright 2021 Hyunje Jun, MDBootstrap and Contributors * Licensed under MIT - */function mi(e){return getComputedStyle(e)}function Ze(e,t){for(var n in t){var i=t[n];typeof i=="number"&&(i=i+"px"),e.style[n]=i}return e}function Du(e){var t=document.createElement("div");return t.className=e,t}var W_=typeof Element<"u"&&(Element.prototype.matches||Element.prototype.webkitMatchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector);function Ts(e,t){if(!W_)throw new Error("No element matching method supported");return W_.call(e,t)}function Mo(e){e.remove?e.remove():e.parentNode&&e.parentNode.removeChild(e)}function H_(e,t){return Array.prototype.filter.call(e.children,function(n){return Ts(n,t)})}var pe={main:"ps",rtl:"ps__rtl",element:{thumb:function(e){return"ps__thumb-"+e},rail:function(e){return"ps__rail-"+e},consuming:"ps__child--consume"},state:{focus:"ps--focus",clicking:"ps--clicking",active:function(e){return"ps--active-"+e},scrolling:function(e){return"ps--scrolling-"+e}}},xT={x:null,y:null};function bT(e,t){var n=e.element.classList,i=pe.state.scrolling(t);n.contains(i)?clearTimeout(xT[t]):n.add(i)}function _T(e,t){xT[t]=setTimeout(function(){return e.isAlive&&e.element.classList.remove(pe.state.scrolling(t))},e.settings.scrollingThreshold)}function d4(e,t){bT(e,t),_T(e,t)}var Cc=function(e){this.element=e,this.handlers={}},wT={isEmpty:{configurable:!0}};Cc.prototype.bind=function(e,t){typeof this.handlers[e]>"u"&&(this.handlers[e]=[]),this.handlers[e].push(t),this.element.addEventListener(e,t,!1)};Cc.prototype.unbind=function(e,t){var n=this;this.handlers[e]=this.handlers[e].filter(function(i){return t&&i!==t?!0:(n.element.removeEventListener(e,i,!1),!1)})};Cc.prototype.unbindAll=function(){for(var e in this.handlers)this.unbind(e)};wT.isEmpty.get=function(){var e=this;return Object.keys(this.handlers).every(function(t){return e.handlers[t].length===0})};Object.defineProperties(Cc.prototype,wT);var la=function(){this.eventElements=[]};la.prototype.eventElement=function(e){var t=this.eventElements.filter(function(n){return n.element===e})[0];return t||(t=new Cc(e),this.eventElements.push(t)),t};la.prototype.bind=function(e,t,n){this.eventElement(e).bind(t,n)};la.prototype.unbind=function(e,t,n){var i=this.eventElement(e);i.unbind(t,n),i.isEmpty&&this.eventElements.splice(this.eventElements.indexOf(i),1)};la.prototype.unbindAll=function(){this.eventElements.forEach(function(e){return e.unbindAll()}),this.eventElements=[]};la.prototype.once=function(e,t,n){var i=this.eventElement(e),s=function(r){i.unbind(t,s),n(r)};i.bind(t,s)};function Eu(e){if(typeof window.CustomEvent=="function")return new CustomEvent(e);var t=document.createEvent("CustomEvent");return t.initCustomEvent(e,!1,!1,void 0),t}function ah(e,t,n,i,s){i===void 0&&(i=!0),s===void 0&&(s=!1);var r;if(t==="top")r=["contentHeight","containerHeight","scrollTop","y","up","down"];else if(t==="left")r=["contentWidth","containerWidth","scrollLeft","x","left","right"];else throw new Error("A proper axis should be provided");h4(e,n,r,i,s)}function h4(e,t,n,i,s){var r=n[0],o=n[1],a=n[2],l=n[3],c=n[4],u=n[5];i===void 0&&(i=!0),s===void 0&&(s=!1);var d=e.element;e.reach[l]=null,d[a]<1&&(e.reach[l]="start"),d[a]>e[r]-e[o]-1&&(e.reach[l]="end"),t&&(d.dispatchEvent(Eu("ps-scroll-"+l)),t<0?d.dispatchEvent(Eu("ps-scroll-"+c)):t>0&&d.dispatchEvent(Eu("ps-scroll-"+u)),i&&d4(e,l)),e.reach[l]&&(t||s)&&d.dispatchEvent(Eu("ps-"+l+"-reach-"+e.reach[l]))}function Jt(e){return parseInt(e,10)||0}function f4(e){return Ts(e,"input,[contenteditable]")||Ts(e,"select,[contenteditable]")||Ts(e,"textarea,[contenteditable]")||Ts(e,"button,[contenteditable]")}function p4(e){var t=mi(e);return Jt(t.width)+Jt(t.paddingLeft)+Jt(t.paddingRight)+Jt(t.borderLeftWidth)+Jt(t.borderRightWidth)}var ao={isWebKit:typeof document<"u"&&"WebkitAppearance"in document.documentElement.style,supportsTouch:typeof window<"u"&&("ontouchstart"in window||"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>0||window.DocumentTouch&&document instanceof window.DocumentTouch),supportsIePointer:typeof navigator<"u"&&navigator.msMaxTouchPoints,isChrome:typeof navigator<"u"&&/Chrome/i.test(navigator&&navigator.userAgent)};function ss(e){var t=e.element,n=Math.floor(t.scrollTop),i=t.getBoundingClientRect();e.containerWidth=Math.round(i.width),e.containerHeight=Math.round(i.height),e.contentWidth=t.scrollWidth,e.contentHeight=t.scrollHeight,t.contains(e.scrollbarXRail)||(H_(t,pe.element.rail("x")).forEach(function(s){return Mo(s)}),t.appendChild(e.scrollbarXRail)),t.contains(e.scrollbarYRail)||(H_(t,pe.element.rail("y")).forEach(function(s){return Mo(s)}),t.appendChild(e.scrollbarYRail)),!e.settings.suppressScrollX&&e.containerWidth+e.settings.scrollXMarginOffset=e.railXWidth-e.scrollbarXWidth&&(e.scrollbarXLeft=e.railXWidth-e.scrollbarXWidth),e.scrollbarYTop>=e.railYHeight-e.scrollbarYHeight&&(e.scrollbarYTop=e.railYHeight-e.scrollbarYHeight),m4(t,e),e.scrollbarXActive?t.classList.add(pe.state.active("x")):(t.classList.remove(pe.state.active("x")),e.scrollbarXWidth=0,e.scrollbarXLeft=0,t.scrollLeft=e.isRtl===!0?e.contentWidth:0),e.scrollbarYActive?t.classList.add(pe.state.active("y")):(t.classList.remove(pe.state.active("y")),e.scrollbarYHeight=0,e.scrollbarYTop=0,t.scrollTop=0)}function U_(e,t){return e.settings.minScrollbarLength&&(t=Math.max(t,e.settings.minScrollbarLength)),e.settings.maxScrollbarLength&&(t=Math.min(t,e.settings.maxScrollbarLength)),t}function m4(e,t){var n={width:t.railXWidth},i=Math.floor(e.scrollTop);t.isRtl?n.left=t.negativeScrollAdjustment+e.scrollLeft+t.containerWidth-t.contentWidth:n.left=e.scrollLeft,t.isScrollbarXUsingBottom?n.bottom=t.scrollbarXBottom-i:n.top=t.scrollbarXTop+i,Ze(t.scrollbarXRail,n);var s={top:i,height:t.railYHeight};t.isScrollbarYUsingRight?t.isRtl?s.right=t.contentWidth-(t.negativeScrollAdjustment+e.scrollLeft)-t.scrollbarYRight-t.scrollbarYOuterWidth-9:s.right=t.scrollbarYRight-e.scrollLeft:t.isRtl?s.left=t.negativeScrollAdjustment+e.scrollLeft+t.containerWidth*2-t.contentWidth-t.scrollbarYLeft-t.scrollbarYOuterWidth:s.left=t.scrollbarYLeft+e.scrollLeft,Ze(t.scrollbarYRail,s),Ze(t.scrollbarX,{left:t.scrollbarXLeft,width:t.scrollbarXWidth-t.railBorderXWidth}),Ze(t.scrollbarY,{top:t.scrollbarYTop,height:t.scrollbarYHeight-t.railBorderYWidth})}function g4(e){e.element,e.event.bind(e.scrollbarY,"mousedown",function(t){return t.stopPropagation()}),e.event.bind(e.scrollbarYRail,"mousedown",function(t){var n=t.pageY-window.pageYOffset-e.scrollbarYRail.getBoundingClientRect().top,i=n>e.scrollbarYTop?1:-1;e.element.scrollTop+=i*e.containerHeight,ss(e),t.stopPropagation()}),e.event.bind(e.scrollbarX,"mousedown",function(t){return t.stopPropagation()}),e.event.bind(e.scrollbarXRail,"mousedown",function(t){var n=t.pageX-window.pageXOffset-e.scrollbarXRail.getBoundingClientRect().left,i=n>e.scrollbarXLeft?1:-1;e.element.scrollLeft+=i*e.containerWidth,ss(e),t.stopPropagation()})}function y4(e){Y_(e,["containerWidth","contentWidth","pageX","railXWidth","scrollbarX","scrollbarXWidth","scrollLeft","x","scrollbarXRail"]),Y_(e,["containerHeight","contentHeight","pageY","railYHeight","scrollbarY","scrollbarYHeight","scrollTop","y","scrollbarYRail"])}function Y_(e,t){var n=t[0],i=t[1],s=t[2],r=t[3],o=t[4],a=t[5],l=t[6],c=t[7],u=t[8],d=e.element,h=null,f=null,p=null;function m(g){g.touches&&g.touches[0]&&(g[s]=g.touches[0].pageY),d[l]=h+p*(g[s]-f),bT(e,c),ss(e),g.stopPropagation(),g.type.startsWith("touch")&&g.changedTouches.length>1&&g.preventDefault()}function v(){_T(e,c),e[u].classList.remove(pe.state.clicking),e.event.unbind(e.ownerDocument,"mousemove",m)}function y(g,x){h=d[l],x&&g.touches&&(g[s]=g.touches[0].pageY),f=g[s],p=(e[i]-e[n])/(e[r]-e[a]),x?e.event.bind(e.ownerDocument,"touchmove",m):(e.event.bind(e.ownerDocument,"mousemove",m),e.event.once(e.ownerDocument,"mouseup",v),g.preventDefault()),e[u].classList.add(pe.state.clicking),g.stopPropagation()}e.event.bind(e[o],"mousedown",function(g){y(g)}),e.event.bind(e[o],"touchstart",function(g){y(g,!0)})}function v4(e){var t=e.element,n=function(){return Ts(t,":hover")},i=function(){return Ts(e.scrollbarX,":focus")||Ts(e.scrollbarY,":focus")};function s(r,o){var a=Math.floor(t.scrollTop);if(r===0){if(!e.scrollbarYActive)return!1;if(a===0&&o>0||a>=e.contentHeight-e.containerHeight&&o<0)return!e.settings.wheelPropagation}var l=t.scrollLeft;if(o===0){if(!e.scrollbarXActive)return!1;if(l===0&&r<0||l>=e.contentWidth-e.containerWidth&&r>0)return!e.settings.wheelPropagation}return!0}e.event.bind(e.ownerDocument,"keydown",function(r){if(!(r.isDefaultPrevented&&r.isDefaultPrevented()||r.defaultPrevented)&&!(!n()&&!i())){var o=document.activeElement?document.activeElement:e.ownerDocument.activeElement;if(o){if(o.tagName==="IFRAME")o=o.contentDocument.activeElement;else for(;o.shadowRoot;)o=o.shadowRoot.activeElement;if(f4(o))return}var a=0,l=0;switch(r.which){case 37:r.metaKey?a=-e.contentWidth:r.altKey?a=-e.containerWidth:a=-30;break;case 38:r.metaKey?l=e.contentHeight:r.altKey?l=e.containerHeight:l=30;break;case 39:r.metaKey?a=e.contentWidth:r.altKey?a=e.containerWidth:a=30;break;case 40:r.metaKey?l=-e.contentHeight:r.altKey?l=-e.containerHeight:l=-30;break;case 32:r.shiftKey?l=e.containerHeight:l=-e.containerHeight;break;case 33:l=e.containerHeight;break;case 34:l=-e.containerHeight;break;case 36:l=e.contentHeight;break;case 35:l=-e.contentHeight;break;default:return}e.settings.suppressScrollX&&a!==0||e.settings.suppressScrollY&&l!==0||(t.scrollTop-=l,t.scrollLeft+=a,ss(e),s(a,l)&&r.preventDefault())}})}function x4(e){var t=e.element;function n(o,a){var l=Math.floor(t.scrollTop),c=t.scrollTop===0,u=l+t.offsetHeight===t.scrollHeight,d=t.scrollLeft===0,h=t.scrollLeft+t.offsetWidth===t.scrollWidth,f;return Math.abs(a)>Math.abs(o)?f=c||u:f=d||h,f?!e.settings.wheelPropagation:!0}function i(o){var a=o.deltaX,l=-1*o.deltaY;return(typeof a>"u"||typeof l>"u")&&(a=-1*o.wheelDeltaX/6,l=o.wheelDeltaY/6),o.deltaMode&&o.deltaMode===1&&(a*=10,l*=10),a!==a&&l!==l&&(a=0,l=o.wheelDelta),o.shiftKey?[-l,-a]:[a,l]}function s(o,a,l){if(!ao.isWebKit&&t.querySelector("select:focus"))return!0;if(!t.contains(o))return!1;for(var c=o;c&&c!==t;){if(c.classList.contains(pe.element.consuming))return!0;var u=mi(c);if(l&&u.overflowY.match(/(scroll|auto)/)){var d=c.scrollHeight-c.clientHeight;if(d>0&&(c.scrollTop>0&&l<0||c.scrollTop0))return!0}if(a&&u.overflowX.match(/(scroll|auto)/)){var h=c.scrollWidth-c.clientWidth;if(h>0&&(c.scrollLeft>0&&a<0||c.scrollLeft0))return!0}c=c.parentNode}return!1}function r(o){var a=i(o),l=a[0],c=a[1];if(!s(o.target,l,c)){var u=!1;e.settings.useBothWheelAxes?e.scrollbarYActive&&!e.scrollbarXActive?(c?t.scrollTop-=c*e.settings.wheelSpeed:t.scrollTop+=l*e.settings.wheelSpeed,u=!0):e.scrollbarXActive&&!e.scrollbarYActive&&(l?t.scrollLeft+=l*e.settings.wheelSpeed:t.scrollLeft-=c*e.settings.wheelSpeed,u=!0):(t.scrollTop-=c*e.settings.wheelSpeed,t.scrollLeft+=l*e.settings.wheelSpeed),ss(e),u=u||n(l,c),u&&!o.ctrlKey&&(o.stopPropagation(),o.preventDefault())}}typeof window.onwheel<"u"?e.event.bind(t,"wheel",r):typeof window.onmousewheel<"u"&&e.event.bind(t,"mousewheel",r)}function b4(e){if(!ao.supportsTouch&&!ao.supportsIePointer)return;var t=e.element;function n(p,m){var v=Math.floor(t.scrollTop),y=t.scrollLeft,g=Math.abs(p),x=Math.abs(m);if(x>g){if(m<0&&v===e.contentHeight-e.containerHeight||m>0&&v===0)return window.scrollY===0&&m>0&&ao.isChrome}else if(g>x&&(p<0&&y===e.contentWidth-e.containerWidth||p>0&&y===0))return!0;return!0}function i(p,m){t.scrollTop-=m,t.scrollLeft-=p,ss(e)}var s={},r=0,o={},a=null;function l(p){return p.targetTouches?p.targetTouches[0]:p}function c(p){return p.pointerType&&p.pointerType==="pen"&&p.buttons===0?!1:!!(p.targetTouches&&p.targetTouches.length===1||p.pointerType&&p.pointerType!=="mouse"&&p.pointerType!==p.MSPOINTER_TYPE_MOUSE)}function u(p){if(c(p)){var m=l(p);s.pageX=m.pageX,s.pageY=m.pageY,r=new Date().getTime(),a!==null&&clearInterval(a)}}function d(p,m,v){if(!t.contains(p))return!1;for(var y=p;y&&y!==t;){if(y.classList.contains(pe.element.consuming))return!0;var g=mi(y);if(v&&g.overflowY.match(/(scroll|auto)/)){var x=y.scrollHeight-y.clientHeight;if(x>0&&(y.scrollTop>0&&v<0||y.scrollTop0))return!0}if(m&&g.overflowX.match(/(scroll|auto)/)){var _=y.scrollWidth-y.clientWidth;if(_>0&&(y.scrollLeft>0&&m<0||y.scrollLeft<_&&m>0))return!0}y=y.parentNode}return!1}function h(p){if(c(p)){var m=l(p),v={pageX:m.pageX,pageY:m.pageY},y=v.pageX-s.pageX,g=v.pageY-s.pageY;if(d(p.target,y,g))return;i(y,g),s=v;var x=new Date().getTime(),_=x-r;_>0&&(o.x=y/_,o.y=g/_,r=x),n(y,g)&&p.preventDefault()}}function f(){e.settings.swipeEasing&&(clearInterval(a),a=setInterval(function(){if(e.isInitialized){clearInterval(a);return}if(!o.x&&!o.y){clearInterval(a);return}if(Math.abs(o.x)<.01&&Math.abs(o.y)<.01){clearInterval(a);return}if(!e.element){clearInterval(a);return}i(o.x*30,o.y*30),o.x*=.8,o.y*=.8},10))}ao.supportsTouch?(e.event.bind(t,"touchstart",u),e.event.bind(t,"touchmove",h),e.event.bind(t,"touchend",f)):ao.supportsIePointer&&(window.PointerEvent?(e.event.bind(t,"pointerdown",u),e.event.bind(t,"pointermove",h),e.event.bind(t,"pointerup",f)):window.MSPointerEvent&&(e.event.bind(t,"MSPointerDown",u),e.event.bind(t,"MSPointerMove",h),e.event.bind(t,"MSPointerUp",f)))}var _4=function(){return{handlers:["click-rail","drag-thumb","keyboard","wheel","touch"],maxScrollbarLength:null,minScrollbarLength:null,scrollingThreshold:1e3,scrollXMarginOffset:0,scrollYMarginOffset:0,suppressScrollX:!1,suppressScrollY:!1,swipeEasing:!0,useBothWheelAxes:!1,wheelPropagation:!0,wheelSpeed:1}},w4={"click-rail":g4,"drag-thumb":y4,keyboard:v4,wheel:x4,touch:b4},Pc=function(e,t){var n=this;if(t===void 0&&(t={}),typeof e=="string"&&(e=document.querySelector(e)),!e||!e.nodeName)throw new Error("no element is specified to initialize PerfectScrollbar");this.element=e,e.classList.add(pe.main),this.settings=_4();for(var i in t)this.settings[i]=t[i];this.containerWidth=null,this.containerHeight=null,this.contentWidth=null,this.contentHeight=null;var s=function(){return e.classList.add(pe.state.focus)},r=function(){return e.classList.remove(pe.state.focus)};this.isRtl=mi(e).direction==="rtl",this.isRtl===!0&&e.classList.add(pe.rtl),this.isNegativeScroll=function(){var l=e.scrollLeft,c=null;return e.scrollLeft=-1,c=e.scrollLeft<0,e.scrollLeft=l,c}(),this.negativeScrollAdjustment=this.isNegativeScroll?e.scrollWidth-e.clientWidth:0,this.event=new la,this.ownerDocument=e.ownerDocument||document,this.scrollbarXRail=Du(pe.element.rail("x")),e.appendChild(this.scrollbarXRail),this.scrollbarX=Du(pe.element.thumb("x")),this.scrollbarXRail.appendChild(this.scrollbarX),this.scrollbarX.setAttribute("tabindex",0),this.event.bind(this.scrollbarX,"focus",s),this.event.bind(this.scrollbarX,"blur",r),this.scrollbarXActive=null,this.scrollbarXWidth=null,this.scrollbarXLeft=null;var o=mi(this.scrollbarXRail);this.scrollbarXBottom=parseInt(o.bottom,10),isNaN(this.scrollbarXBottom)?(this.isScrollbarXUsingBottom=!1,this.scrollbarXTop=Jt(o.top)):this.isScrollbarXUsingBottom=!0,this.railBorderXWidth=Jt(o.borderLeftWidth)+Jt(o.borderRightWidth),Ze(this.scrollbarXRail,{display:"block"}),this.railXMarginWidth=Jt(o.marginLeft)+Jt(o.marginRight),Ze(this.scrollbarXRail,{display:""}),this.railXWidth=null,this.railXRatio=null,this.scrollbarYRail=Du(pe.element.rail("y")),e.appendChild(this.scrollbarYRail),this.scrollbarY=Du(pe.element.thumb("y")),this.scrollbarYRail.appendChild(this.scrollbarY),this.scrollbarY.setAttribute("tabindex",0),this.event.bind(this.scrollbarY,"focus",s),this.event.bind(this.scrollbarY,"blur",r),this.scrollbarYActive=null,this.scrollbarYHeight=null,this.scrollbarYTop=null;var a=mi(this.scrollbarYRail);this.scrollbarYRight=parseInt(a.right,10),isNaN(this.scrollbarYRight)?(this.isScrollbarYUsingRight=!1,this.scrollbarYLeft=Jt(a.left)):this.isScrollbarYUsingRight=!0,this.scrollbarYOuterWidth=this.isRtl?p4(this.scrollbarY):null,this.railBorderYWidth=Jt(a.borderTopWidth)+Jt(a.borderBottomWidth),Ze(this.scrollbarYRail,{display:"block"}),this.railYMarginHeight=Jt(a.marginTop)+Jt(a.marginBottom),Ze(this.scrollbarYRail,{display:""}),this.railYHeight=null,this.railYRatio=null,this.reach={x:e.scrollLeft<=0?"start":e.scrollLeft>=this.contentWidth-this.containerWidth?"end":null,y:e.scrollTop<=0?"start":e.scrollTop>=this.contentHeight-this.containerHeight?"end":null},this.isAlive=!0,this.settings.handlers.forEach(function(l){return w4[l](n)}),this.lastScrollTop=Math.floor(e.scrollTop),this.lastScrollLeft=e.scrollLeft,this.event.bind(this.element,"scroll",function(l){return n.onScroll(l)}),ss(this)};Pc.prototype.update=function(){this.isAlive&&(this.negativeScrollAdjustment=this.isNegativeScroll?this.element.scrollWidth-this.element.clientWidth:0,Ze(this.scrollbarXRail,{display:"block"}),Ze(this.scrollbarYRail,{display:"block"}),this.railXMarginWidth=Jt(mi(this.scrollbarXRail).marginLeft)+Jt(mi(this.scrollbarXRail).marginRight),this.railYMarginHeight=Jt(mi(this.scrollbarYRail).marginTop)+Jt(mi(this.scrollbarYRail).marginBottom),Ze(this.scrollbarXRail,{display:"none"}),Ze(this.scrollbarYRail,{display:"none"}),ss(this),ah(this,"top",0,!1,!0),ah(this,"left",0,!1,!0),Ze(this.scrollbarXRail,{display:""}),Ze(this.scrollbarYRail,{display:""}))};Pc.prototype.onScroll=function(e){this.isAlive&&(ss(this),ah(this,"top",this.element.scrollTop-this.lastScrollTop),ah(this,"left",this.element.scrollLeft-this.lastScrollLeft),this.lastScrollTop=Math.floor(this.element.scrollTop),this.lastScrollLeft=this.element.scrollLeft)};Pc.prototype.destroy=function(){this.isAlive&&(this.event.unbindAll(),Mo(this.scrollbarX),Mo(this.scrollbarY),Mo(this.scrollbarXRail),Mo(this.scrollbarYRail),this.removePsClasses(),this.element=null,this.scrollbarX=null,this.scrollbarY=null,this.scrollbarXRail=null,this.scrollbarYRail=null,this.isAlive=!1)};Pc.prototype.removePsClasses=function(){this.element.className=this.element.className.split(" ").filter(function(e){return!e.match(/^ps([-_].+|)$/)}).join(" ")};const k4=({className:e,sidenav:t,tag:n="div",handlers:i=["click-rail","drag-thumb","keyboard","wheel","touch"],wheelSpeed:s=1,wheelPropagation:r=!0,swipeEasing:o=!0,minScrollbarLength:a,maxScrollbarLength:l,scrollingThreshold:c=1e3,useBothWheelAxes:u=!1,suppressScrollX:d=!1,suppressScrollY:h=!1,scrollXMarginOffset:f=0,scrollYMarginOffset:p=0,scrollBarRef:m,onScrollY:v,onScrollX:y,onScrollUp:g,onScrollDown:x,onScrollLeft:_,onScrollRight:w,onYReachStart:S,onYReachEnd:C,onXReachStart:M,onXReachEnd:P,children:T,options:A,...E})=>{const z=I(t&&"sidenav-menu",e),N=k.useRef(null),L=k.useRef(null);return k.useEffect(()=>{let R=null;const B=[],D={handlers:i,wheelSpeed:s,wheelPropagation:r,swipeEasing:o,minScrollbarLength:a,maxScrollbarLength:l,scrollingThreshold:c,useBothWheelAxes:u,suppressScrollX:d,suppressScrollY:h,scrollXMarginOffset:f,scrollYMarginOffset:p,...A};if(!N.current)return;R=N.current,L.current=new Pc(R,D);const $={"ps-scroll-y":v,"ps-scroll-x":y,"ps-scroll-up":g,"ps-scroll-down":x,"ps-scroll-left":_,"ps-scroll-right":w,"ps-y-reach-start":S,"ps-y-reach-end":C,"ps-x-reach-start":M,"ps-x-reach-end":P};return Object.keys($).forEach(F=>{const V=$[F];if(typeof V=="function"&&R){const W=()=>V(R);B.push({eventName:F,handler:W}),R.addEventListener(F,W)}}),m&&m(L.current),()=>{var F;B.forEach(V=>{R==null||R.removeEventListener(V.eventName,V.handler)}),(F=L.current)==null||F.destroy(),L.current=null}},[i,s,r,o,a,l,c,u,d,h,f,p,m,v,y,g,x,_,w,S,C,M,P,A]),b.jsx(n,{className:z,ref:N,...E,children:T})},S4=Y.createContext({color:"primary"}),M4=Y.forwardRef(({className:e,children:t,...n},i)=>{const s=I("sidenav-menu",e);return b.jsx("ul",{className:s,ref:i,...n,children:t})});M4.displayName="MDBSideNavMenu";const C4=Y.forwardRef(({className:e,children:t,...n},i)=>{const s=I("sidenav-item",e);return b.jsx("li",{className:s,ref:i,...n,children:t})});C4.displayName="MDBSideNavItem";const P4=Y.forwardRef(({className:e,icon:t,iconClasses:n,iconAngle:i=180,shouldBeExpanded:s,children:r,active:o,tag:a="a",...l},c)=>{const{color:u}=k.useContext(S4),d=I("sidenav-link",o&&"active",e),h=I("rotate-icon",n),[f,p]=k.useState(s?i:0);return k.useEffect(()=>{p(s?i:0)},[s,i]),b.jsxs(v0,{rippleTag:a,onKeyDown:m=>{m.key==="Enter"&&m.target.click()},tabIndex:1,rippleColor:u,className:d,ref:c,...l,children:[r,t&&b.jsx(sn,{icon:t,style:{transform:`rotate(${f}deg)`},className:h})]})});P4.displayName="MDBSideNavLink";const kT=Y.forwardRef(({className:e,centered:t,children:n,size:i,scrollable:s,tag:r="div",...o},a)=>{const l=I("modal-dialog",s&&"modal-dialog-scrollable",t&&"modal-dialog-centered",i&&`modal-${i}`,e);return b.jsx(r,{className:l,...o,ref:a,children:n})});kT.displayName="MDBModalDialog";const T4=Y.forwardRef(({className:e,side:t,frame:n,position:i,children:s,tag:r="div",...o},a)=>{const l=I(t&&"modal-side",n&&"modal-frame",i&&`modal-${i}`,e);return b.jsx(kT,{className:l,...o,tag:r,ref:a,children:s})});T4.displayName="MDBModalDialog";const nf=Y.createContext({onDatetimepickerModeSwitch:()=>null,isInDatetimepicker:!1,setInputValue:null,setActiveHour:null,setActiveMinute:null,setPeriod:null,setMode:null,setHandAnimation:null,setMinuteAngle:null,setHourAngle:null,submitLabel:"",clearLabel:"",cancelLabel:"",activeHour:12,activeMinute:12,format:"12h",period:"",defaultValue:"",minHour:0,maxHour:23,minPeriod:"",maxPeriod:"",mode:"hours",handAnimation:!1,maxMinute:59,minMinute:0,minuteAngle:360,hourAngle:360,inline:!1,increment:!1,onChange:()=>null,onOpen:()=>null,onClose:()=>null,onCloseHandler:()=>null,amLabel:"AM",pmLabel:"PM",switchHoursToMinutesOnClick:!0,headId:"",bodyId:""}),ld=e=>{const t=e.split(":"),n=t[0],i=t[1].split(" ")[1],s=t[1].split(" ")[0];return{hour:parseInt(n),minute:parseInt(s),defaultPeriod:i}},X_=(e,t)=>(t==="24h"?/^([01]\d|2[0-3])(:[0-5]\d)$/:/^(0?[1-9]|1[012])(:[0-5]\d) [APap][mM]$/).test(e),Ki=(e,t,n,i,s,r)=>{let o=!1;return t&&(s!==""?e>t&&i===s&&(o=!0):e>t&&(o=!0)),n&&(r!==""?eKi(i,s,r,o,a,l)&&(n===t||n===e),D4=(e,t,n)=>{t.split(" ").forEach(i=>{e.addEventListener(i,n)})},E4=(e,t,n)=>{t.split(" ").forEach(i=>{e.removeEventListener(i,n)})},ST=(e,t)=>{const n=t.x-e.x,i=t.y-e.y;return Math.sqrt(n*n+i*i)},A4=(e,t)=>{const n=2*Math.atan2(t.y-e.y-ST(e,t),t.x-e.x);return Math.abs(n*180/Math.PI)},K_=e=>({radius:(e-32)/2-4}),O4=e=>{const t=new Date;let n=t.getHours();const i=t.getMinutes();if(e==="24h")return{hours:n,minutes:i,period:""};const s=n>=12?"PM":"AM";return n=n%12,n=n||12,{hours:n,minutes:i,period:s}},xp=(e,t)=>{const n=e.getMinutes();let i=e.getHours(),s;i===24&&(i=0);const r=i>=12?"PM":"AM";return t=="24h"?s=i<10?`0${i}:${n}`:`${i}:${n}`:t=="12h"&&(s=`${(i+24)%12||12}:${n} ${r}`),s},ig=Y.forwardRef(({...e},t)=>{const{activeHour:n,format:i,period:s,setPeriod:r,mode:o,setMode:a,activeMinute:l,setHandAnimation:c,inline:u,setActiveHour:d,setActiveMinute:h,maxHour:f,maxMinute:p,minHour:m,minMinute:v,maxPeriod:y,minPeriod:g,setInputValue:x,increment:_,submitLabel:w,onChange:S,onCloseHandler:C,amLabel:M,pmLabel:P,headId:T,show:A,onDatetimepickerModeSwitch:E,isInDatetimepicker:z}=k.useContext(nf),N=D=>{a(D),c(!0)},L=()=>{if(Ki(n,f,m,s,y,g)||Ki(l,p,v,s,y,g)||!A)return;C==null||C();const D=n===24?"00":n<10?`0${n}`:n,$=l<10?`0${l}`:l,F=`${D}:${$} ${s}`.trim();x(F),S==null||S(F)},R=(D,$)=>{const F=i==="12h"?12:24;if($.type==="click")return d(D?V=>V===F?1:V+1:V=>V===1?F:V-1);if($.type==="mousedown"){const V=setTimeout(()=>{const et=setInterval(()=>{d(D?O=>O===F?1:O+1:O=>O===1?F:O-1)},100),Z=()=>{clearInterval(et),document.removeEventListener("mouseup",Z)};document.addEventListener("mouseup",Z)},300),W=()=>{clearTimeout(V),document.removeEventListener("mouseup",W)};document.addEventListener("mouseup",W)}},B=(D,$)=>{const F=_?55:59,V=_?5:1;if($.type==="click")return h(D?W=>W>=F?0:W+V:W=>W-V<0?F:W-V);if($.type==="mousedown"){const W=setTimeout(()=>{const Z=setInterval(()=>{h(D?U=>U>=F?0:U+V:U=>U-V<0?F:U-V)},100),O=()=>{clearInterval(Z),document.removeEventListener("mouseup",O)};document.addEventListener("mouseup",O)},300),et=()=>{clearTimeout(W),document.removeEventListener("mouseup",et)};document.addEventListener("mouseup",et)}};return u?b.jsx("div",{id:T,className:"timepicker-head d-flex flex-row align-items-center justify-content-center timepicker-head-inline",style:{paddingRight:"0px"},ref:t,...e,children:b.jsxs("div",{className:"timepicker-head-content d-flex w-100 justify-content-evenly align-items-center",children:[b.jsxs("div",{className:"timepicker-current-wrapper",children:[b.jsxs("span",{className:"position-relative h-100 timepicker-inline-hour-icons",children:[b.jsx(sn,{fas:!0,icon:"chevron-up",style:{display:"flex"},className:"position-absolute text-white timepicker-icon-up timepicker-icon-inline-hour",onClick:D=>R(!0,D),onMouseDown:D=>R(!0,D)}),b.jsx(Zt,{type:"button",color:"none",onClick:()=>{N("hours")},className:`timepicker-current timepicker-current-inline timepicker-hour ${o==="hours"&&"active"}`,tabIndex:0,style:{pointerEvents:o==="hours"?"none":void 0},onFocus:()=>{N("hours")},children:n===24?"00":n<10?`0${n}`:n}),b.jsx(sn,{fas:!0,icon:"chevron-down",style:{display:"flex"},className:"position-absolute text-white timepicker-icon-down timepicker-icon-inline-hour",onClick:D=>R(!1,D),onMouseDown:D=>R(!1,D)})]}),b.jsx(Zt,{color:"none",className:"timepicker-dot timepicker-current-inline",disabled:!0,children:":"}),b.jsxs("span",{className:"position-relative h-100 timepicker-inline-minutes-icons",children:[b.jsx(sn,{fas:!0,icon:"chevron-up",style:{display:"flex"},className:"position-absolute text-white timepicker-icon-up timepicker-icon-inline-minute",onClick:D=>B(!0,D),onMouseDown:D=>B(!0,D)}),b.jsx(Zt,{onClick:()=>{N("minutes")},type:"button",color:"none",className:`timepicker-current timepicker-current-inline timepicker-minute ${o==="minutes"&&"active"}`,tabIndex:0,style:{pointerEvents:o==="minutes"?"none":void 0},onFocus:()=>{N("minutes")},children:l<10?`0${l}`:l}),b.jsx(sn,{fas:!0,icon:"chevron-down",style:{display:"flex"},className:"position-absolute text-white timepicker-icon-down timepicker-icon-inline-minute",onClick:D=>B(!1,D),onMouseDown:D=>B(!1,D)})]})]}),b.jsxs("div",{className:"d-flex justify-content-center timepicker-mode-wrapper",children:[i==="12h"&&b.jsxs(b.Fragment,{children:[b.jsx(Zt,{onClick:()=>r("AM"),type:"button",color:"none",className:`timepicker-hour-mode timepicker-am me-2 ms-4 ${s.toLowerCase()==="am"&&"active"}`,tabIndex:0,children:M}),b.jsx(Zt,{onClick:()=>r("PM"),type:"button",color:"none",className:`timepicker-hour-mode timepicker-pm ${s.toLowerCase()==="pm"&&"active"}`,tabIndex:0,children:P})]}),b.jsx(Zt,{type:"button",color:"none",className:"timepicker-button timepicker-submit timepicker-submit-inline py-1 px-2 mb-0",tabIndex:0,onClick:L,children:w})]})]})}):b.jsxs(b.Fragment,{children:[b.jsx("div",{id:T,className:"timepicker-head d-flex flex-row align-items-center justify-content-center",style:{paddingRight:"0px"},ref:t,...e,children:b.jsxs("div",{className:"timepicker-head-content d-flex w-100 justify-content-evenly",style:{paddingRight:i==="24h"?"50px":""},children:[b.jsxs("div",{className:"timepicker-current-wrapper",children:[b.jsx("span",{className:"position-relative h-100",children:b.jsx(Zt,{type:"button",color:"none",onClick:()=>{N("hours")},className:`timepicker-current timepicker-hour ${o==="hours"&&"active"}`,tabIndex:0,style:{pointerEvents:o==="hours"?"none":void 0},children:n===24?"00":n<10?`0${n}`:n})}),b.jsx(Zt,{color:"none",className:"timepicker-dot",disabled:!0,children:":"}),b.jsx("span",{className:"position-relative h-100",children:b.jsx(Zt,{onClick:()=>{N("minutes")},type:"button",color:"none",className:`timepicker-current timepicker-minute ${o==="minutes"&&"active"}`,tabIndex:0,style:{pointerEvents:o==="minutes"?"none":void 0},children:l<10?`0${l}`:l})})]}),i==="12h"&&b.jsxs("div",{className:"d-flex flex-column justify-content-center timepicker-mode-wrapper",children:[b.jsx(Zt,{onClick:()=>r("AM"),type:"button",color:"none",className:`timepicker-hour-mode timepicker-am ${s.toLowerCase()==="am"&&"active"}`,tabIndex:0,children:M}),b.jsx(Zt,{onClick:()=>r("PM"),type:"button",color:"none",className:`timepicker-hour-mode timepicker-pm ${s.toLowerCase()==="pm"&&"active"}`,tabIndex:0,children:P})]})]})}),z&&b.jsxs("div",{className:"buttons-container",children:[b.jsx("button",{type:"button",className:"datepicker-button-toggle",onClick:E,children:b.jsx("i",{className:"far fa-calendar datepicker-toggle-icon"})}),b.jsx("button",{type:"button",className:"timepicker-button-toggle",children:b.jsx("i",{className:"far fa-clock fa-sm timepicker-icon"})})]})]})});ig.displayName="MDBTimePickerHeader";const bp={hours:[{value:1,left:"169px",bottom:"209.263px",angle:30,id:`hour-1-${Math.floor(Math.random()*1001)}`},{value:2,left:"209.263px",bottom:"169px",angle:60,id:`hour-2-${Math.floor(Math.random()*1001)}`},{value:3,left:"224px",bottom:"114px",angle:90,id:`hour-3-${Math.floor(Math.random()*1001)}`},{value:4,left:"209.263px",bottom:"59px",angle:120,id:`hour-4-${Math.floor(Math.random()*1001)}`},{value:5,left:"169px",bottom:"18.7372px",angle:150,id:`hour-5-${Math.floor(Math.random()*1001)}`},{value:6,left:"114px",bottom:"4px",angle:180,id:`hour-6-${Math.floor(Math.random()*1001)}`},{value:7,left:"59px",bottom:"18.7372px",angle:210,id:`hour-7-${Math.floor(Math.random()*1001)}`},{value:8,left:"18.7372px",bottom:"59px",angle:240,id:`hour-8-${Math.floor(Math.random()*1001)}`},{value:9,left:"4px",bottom:"114px",angle:270,id:`hour-9-${Math.floor(Math.random()*1001)}`},{value:10,left:"18.7372px",bottom:"169px",angle:300,id:`hour-10-${Math.floor(Math.random()*1001)}`},{value:11,left:"59px",bottom:"209.263px",angle:330,id:`hour-11-${Math.floor(Math.random()*1001)}`},{value:12,left:"114px",bottom:"224px",angle:360,id:`hour-12-${Math.floor(Math.random()*1001)}`},{value:13,left:"94px",bottom:"115.962px",angle:30,id:`hour-13-${Math.floor(Math.random()*1001)}`},{value:14,left:"115.962px",bottom:"94px",angle:60,id:`hour-14-${Math.floor(Math.random()*1001)}`},{value:15,left:"124px",bottom:"64px",angle:90,id:`hour-15-${Math.floor(Math.random()*1001)}`},{value:16,left:"115.962px",bottom:"34px",angle:120,id:`hour-16-${Math.floor(Math.random()*1001)}`},{value:17,left:"94px",bottom:"12.0385px",angle:150,id:`hour-17-${Math.floor(Math.random()*1001)}`},{value:18,left:"64px",bottom:"4px",angle:180,id:`hour-18-${Math.floor(Math.random()*1001)}`},{value:19,left:"34px",bottom:"12.0385px",angle:210,id:`hour-19-${Math.floor(Math.random()*1001)}`},{value:20,left:"12.0385px",bottom:"34px",angle:240,id:`hour-20-${Math.floor(Math.random()*1001)}`},{value:21,left:"4px",bottom:"64px",angle:270,id:`hour-21-${Math.floor(Math.random()*1001)}`},{value:22,left:"12.0385px",bottom:"94px",angle:300,id:`hour-22-${Math.floor(Math.random()*1001)}`},{value:23,left:"34px",bottom:"115.962px",angle:330,id:`hour-23-${Math.floor(Math.random()*1001)}`},{value:24,left:"64px",bottom:"124px",angle:360,id:`hour-0-${Math.floor(Math.random()*1001)}`}],minutes:[{value:0,left:"114px",bottom:"224px",angle:360,id:`minute-0-${Math.floor(Math.random()*1001)}`},{value:5,left:"169px",bottom:"209.263px",angle:30,id:`minute-5-${Math.floor(Math.random()*1001)}`},{value:10,left:"209.263px",bottom:"169px",angle:60,id:`minute-10-${Math.floor(Math.random()*1001)}`},{value:15,left:"224px",bottom:"114px",angle:90,id:`minute-15-${Math.floor(Math.random()*1001)}`},{value:20,left:"209.263px",bottom:"59px",angle:120,id:`minute-20-${Math.floor(Math.random()*1001)}`},{value:25,left:"169px",bottom:"18.7372px",angle:150,id:`minute-25-${Math.floor(Math.random()*1001)}`},{value:30,left:"114px",bottom:"4px",angle:180,id:`minute-30-${Math.floor(Math.random()*1001)}`},{value:35,left:"59px",bottom:"18.7372px",angle:210,id:`minute-35-${Math.floor(Math.random()*1001)}`},{value:40,left:"18.7372px",bottom:"59px",angle:240,id:`minute-40-${Math.floor(Math.random()*1001)}`},{value:45,left:"4px",bottom:"114px",angle:270,id:`minute-45-${Math.floor(Math.random()*1001)}`},{value:50,left:"18.7372px",bottom:"169px",angle:300,id:`minute-50-${Math.floor(Math.random()*1001)}`},{value:55,left:"59px",bottom:"209.263px",angle:330,id:`minute-55-${Math.floor(Math.random()*1001)}`}]},MT=Y.forwardRef(({...e},t)=>{const n=k.useRef(null),i=k.useRef(null),[s,r]=k.useState(!1),[o,a]=k.useState(0),[l,c]=k.useState(0),{setActiveHour:u,format:d,activeHour:h,minHour:f,maxHour:p,minPeriod:m,maxPeriod:v,period:y,mode:g,setMode:x,activeMinute:_,setActiveMinute:w,setHandAnimation:S,handAnimation:C,maxMinute:M,minMinute:P,hourAngle:T,setHourAngle:A,minuteAngle:E,setMinuteAngle:z,increment:N,switchHoursToMinutesOnClick:L,bodyId:R}=k.useContext(nf),B=d==="24h"?bp.hours:bp.hours.filter(O=>O.value<13&&O.value!==0),D=bp.minutes,[$,F]=k.useState("calc(40% + 1px)"),V=k.useCallback(A4,[]),W=O=>{O.preventDefault(),r(!0)},et=O=>{O.preventDefault(),r(!1),g==="hours"&&(L&&x("minutes"),S(!0))},Z=k.useCallback(O=>{var U;const{width:lt,top:ct,left:kt}=(U=n.current)==null?void 0:U.getBoundingClientRect(),{clientX:it,clientY:Lt}="touches"in O?O.touches[0]:O,Ct={x:lt/2,y:-lt/2},Qt={x:it-kt,y:ct-Lt},ft=Math.round(V(Ct,Qt)+360)%360;if(g==="hours"){const wt=30*Math.round(ft/30);let dt=wt/30;if(d==="24h"){const{radius:jt}=K_(o),{radius:pt}=K_(l);ST(Ct,Qt)<(jt+pt)/2-16&&(dt+=12)}Ki(dt,p,f,y,v,m)||(u(dt),A(wt))}else if(ft===0)vp(f,p,h,0,M,P,y,v,m)||(w(0),z(360));else{const wt=N?30:6,dt=wt*Math.round(ft/wt);vp(f,p,h,dt/6,M,P,y,v,m)||(w(dt/6===60?0:dt/6),z(dt))}},[V,h,M,P,v,m,g,y,w,p,f,u,l,o,d,A,z,N]);return k.useEffect(()=>{n.current&&a(n.current.offsetWidth),i.current&&c(i.current.offsetWidth)},[]),k.useEffect(()=>(s&&D4(document,"mouseup mousemove mouseleave mouseover touchstart touchmove touchend",Z),()=>{E4(document,"mouseup mousemove mouseleave mouseover touchstart touchmove touchend",Z)}),[s,Z]),k.useEffect(()=>{const O=B.find(U=>U.value===h);O!==void 0&&(O.value>12||O.value===24?F("21.5%"):F("calc(40% + 1px)"))},[B,h]),b.jsx("div",{id:R,className:"timepicker-clock-wrapper d-flex justify-content-center flex-column align-items-center",ref:t,...e,children:b.jsxs("div",{onMouseDown:O=>W(O),onMouseUp:O=>et(O),ref:n,className:"timepicker-clock timepicker-clock-animation",children:[b.jsx("span",{className:"timepicker-middle-dot position-absolute"}),b.jsx("div",{className:`timepicker-hand-pointer position-absolute ${C&&"timepicker-transform"}`,style:{transform:`rotateZ(${g==="hours"?T:E}deg)`,height:g==="hours"?$:"calc(40% + 1px)"},children:b.jsx("div",{className:"timepicker-circle position-absolute",style:{backgroundColor:"rgb(25, 118, 210)"}})}),g==="hours"&&d==="24h"&&b.jsx("div",{ref:i,className:"timepicker-clock-inner",children:B.map(O=>{if(O.value>12||O.value===0)return b.jsx("span",{id:O.id,className:`timepicker-time-tips-inner ${Ki(O.value,p,f,y,v,m)&&"disabled"} ${O.value===h&&"active"}`,style:{left:O.left,bottom:O.bottom},children:b.jsx("span",{className:"timepicker-tips-inner-element",children:O.value===24?"00":O.value})},O.id)})}),g==="hours"&&B.map(O=>{if(d==="24h"){if(O.value<13&&O.value!==0)return b.jsx("span",{id:O.id,className:`timepicker-time-tips-hours ${Ki(O.value,p,f,y,v,m)&&"disabled"} ${O.value===h&&"active"}`,style:{left:O.left,bottom:O.bottom},children:b.jsx("span",{className:"timepicker-tips-element",children:O.value})},O.id)}else return b.jsx("span",{id:O.id,className:`timepicker-time-tips-hours ${Ki(O.value,p,f,y,v,m)&&"disabled"} ${O.value===h&&"active"}`,style:{left:O.left,bottom:O.bottom},children:b.jsx("span",{className:"timepicker-tips-element",children:O.value})},O.id)}),g==="minutes"&&D.map(O=>b.jsx("span",{id:O.id,className:`timepicker-time-tips-minutes ${vp(f,p,h,O.value,M,P,y,v,m)&&"disabled"} ${_===O.value&&"active"}`,style:{left:O.left,bottom:O.bottom},children:b.jsx("span",{className:"timepicker-tips-element",children:O.value<10?`0${O.value}`:O.value})},O.id))]})})});MT.displayName="MDBTimePickerClock";const CT=Y.forwardRef(({...e},t)=>{const{setInputValue:n,cancelLabel:i,submitLabel:s,clearLabel:r,activeHour:o,period:a,activeMinute:l,maxHour:c,maxMinute:u,minHour:d,minMinute:h,maxPeriod:f,minPeriod:p,defaultValue:m,setActiveHour:v,setActiveMinute:y,setPeriod:g,format:x,setHourAngle:_,setMinuteAngle:w,onChange:S,onCloseHandler:C,setMode:M}=k.useContext(nf);return b.jsx("div",{className:"timepicker-footer",ref:t,...e,children:b.jsxs("div",{className:"w-100 d-flex justify-content-between",children:[b.jsx(Zt,{onClick:()=>{if(m!==""&&m!==void 0){const{hour:P,minute:T,defaultPeriod:A}=ld(m);x==="24h"?(v(P===0?24:P),P===0?_(360):P>12?_((P-12)*30):_(P*30)):(v(P),_(P*30),g(A)),y(T),w(T*6),n(m),S==null||S(m)}else v(12),_(360),y(0),w(360),n(""),S==null||S(""),g(x==="24h"?"":"AM");M("hours")},type:"button",color:"none",className:"timepicker-button timepicker-clear",tabIndex:0,children:r}),b.jsx(Zt,{onClick:()=>C==null?void 0:C(),type:"button",color:"none",className:"timepicker-button timepicker-cancel",tabIndex:0,children:i}),b.jsx(Zt,{onClick:()=>{if(Ki(o,c,d,a,f,p)||Ki(l,u,h,a,f,p))return;C==null||C();const P=o===24?"00":o<10?`0${o}`:o,T=l<10?`0${l}`:l,A=`${P}:${T} ${a}`.trim();n(A),S==null||S(A)},type:"button",color:"none",className:"timepicker-button timepicker-submit",tabIndex:0,children:s})]})})});CT.displayName="MDBTimePickerFooter";const L4=({isOpen:e,inline:t})=>{k.useEffect(()=>{if(t)return;const n=window.innerWidth>document.documentElement.clientWidth&&window.innerWidth>=576,i=`${window.innerWidth-document.documentElement.clientWidth}px`;return e&&n?(document.body.style.overflow="hidden",document.body.style.paddingRight=i):(document.body.style.overflow="",document.body.style.paddingRight=""),()=>{document.body.style.overflow="",document.body.style.paddingRight=""}},[e,t])},R4=({className:e,isOpen:t,wrapperRef:n,inline:i,referenceElement:s,onOpened:r,onClosed:o})=>{const[a,l]=k.useState(null),c=I("timepicker-modal",!i&&"position-fixed",e),u=I("timepicker-wrapper","animation","h-100","d-flex","align-items-center","justify-content-center","flex-column",i?"timepicker-wrapper-inline":"position-fixed","fade",t&&"show"),{styles:d,attributes:h}=Oh(s,a,{placement:"bottom-start"}),f=p=>{p.opacity===0?o():r()};return L4({isOpen:t,inline:i}),b.jsx(b.Fragment,{children:b.jsx(aa,{children:b.jsx(Zy,{children:t&&(i?b.jsx(Jo.div,{className:c,style:d.popper,...h.popper,role:"dialog",ref:l,tabIndex:-1,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onAnimationComplete:p=>f(p),children:b.jsx("div",{ref:n,className:u,children:b.jsx("div",{className:"d-flex align-items-center justify-content-center flex-column shadow timepicker-container",style:{overflowY:"inherit"},children:b.jsx("div",{className:"d-flex flex-column timepicker-elements justify-content-around timepicker-elements-inline",children:b.jsx(ig,{})})})})}):b.jsx(Jo.div,{className:c,role:"dialog",tabIndex:-1,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},onAnimationComplete:p=>f(p),children:b.jsx("div",{ref:n,className:u,children:b.jsxs("div",{className:"d-flex align-items-center justify-content-center flex-column shadow timepicker-container",children:[b.jsxs("div",{className:"d-flex flex-column timepicker-elements justify-content-around",children:[b.jsx(ig,{}),b.jsx(MT,{})]}),b.jsx(CT,{})]})})}))})})})},G_=(e,t,n,i,s)=>{const r=n?55:59,o=n?5:1;let a;s?a=i>=r?0:i+o:a=i<=0?r:i-o,e(a),t(a*6)},Au=(e,t,n,i,s,r)=>{if(r&&e==="24h"){let l=t;r==="isLeft"&&(l=t<=12?t+12:t),r==="isRight"&&(l=t>12?t-12:t),n(l),i(l*30);return}const o=e==="12h"?12:24;let a=t===1?o:t-1;s?a=t===o?1:t+1:a=t===1?o:t-1,n(a),i(a*30)},q_=(e,t,n)=>{const i=n==null?void 0:n.querySelectorAll('[tabindex="0"]');i&&i[t]&&(i[t].focus(),t===i.length-1?e(0):e(t+1))},N4=(e,t,n,i,s,r)=>{var o;!t&&e.target===n&&r&&(r==null||r()),t&&e.target!==n&&!(n!=null&&n.contains(e.target))&&e.target!==(i==null?void 0:i.parentNode)&&!((o=i==null?void 0:i.parentNode)!=null&&o.contains(e.target))&&s&&(r==null||r())},Q_="ArrowLeft",Z_="ArrowUp",J_="ArrowRight",tw="ArrowDown",ew="Enter",nw="Escape",iw="Tab",PT=k.forwardRef(({isInDatetimepicker:e,onDatetimepickerModeSwitch:t,datetimepickerRef:n,className:i,defaultValue:s,value:r,minHour:o,maxHour:a,maxTime:l,minTime:c,noIcon:u=!1,inputID:d,justInput:h=!1,inputClasses:f,inputLabel:p,invalidLabel:m,clearLabel:v,submitLabel:y,cancelLabel:g,format:x="12h",timePickerClasses:_,customIcon:w="far fa-clock",customIconSize:S="sm",btnIcon:C=!0,inline:M=!1,increment:P=!1,onChange:T,inputStyle:A,onOpen:E,onOpened:z,onClose:N,onClosed:L,disableFuture:R,disablePast:B,disabled:D=!1,amLabel:$="AM",pmLabel:F="PM",switchHoursToMinutesOnClick:V=!0,headId:W="",bodyId:et="",open:Z,style:O,...U},lt)=>{const ct=k.useMemo(()=>s instanceof Date?xp(s,x):s,[]),kt=k.useMemo(()=>r instanceof Date?xp(r,x):r,[r,x]),[it,Lt]=k.useState(!1),[Ct,Qt]=k.useState(!1),ft=ef(Ct,Z),[wt,dt]=k.useState(kt||ct||""),[jt,pt]=k.useState(!1),[xt,J]=k.useState(12),[mt,q]=k.useState(0),[ye,Dt]=k.useState(x==="24h"?"":"AM"),[he,Un]=k.useState(a||24),[Yn,Mn]=k.useState(o||1),[Si,dn]=k.useState(59),[Mi,as]=k.useState(0),[ls,Ci]=k.useState(""),[Pi,Ke]=k.useState(""),[Xn,Ti]=k.useState("hours"),[j,Q]=k.useState(!1),[It,nt]=k.useState(360),[Tt,Oe]=k.useState(360),[cs,ai]=k.useState(null),[Kn,Me]=k.useState(0);s instanceof Date&&(s=xp(s,x));const Kr=k.useId(),Gr=d??Kr,Cn={input:p??"Select a time",invalid:m??"Invalid Time Format",clear:v??"Clear",submit:y??"Ok",cancel:g??"Cancel"},ca=I("timepicker",i),Dc=I("timepicker-input",jt&&"is-invalid",f),sf=k.useRef(null),G=k.useRef(null),X=k.useRef(null),rt=k.useRef(null);k.useImperativeHandle(lt,()=>rt.current,[rt]);const ht=Rt=>{dt(Rt.target.value),T==null||T(Rt.target.value)},hn=Rt=>{h&&(Rt.target.blur(),E==null||E())},us=k.useCallback(()=>{Qt(!1),N==null||N()},[N]),Ge=k.useCallback(()=>{Qt(!0),E==null||E()},[E]),fn=k.useCallback(()=>{Lt(!1),L==null||L(),Ti("hours"),Me(0)},[L]),NT=k.useCallback(()=>{Lt(!0),z==null||z()},[z]),rf=k.useCallback(Rt=>{it&&N4(Rt,M,X.current,rt.current,ft,us)},[X,M,rt,ft,us,it]),of=k.useCallback(Rt=>{var Pn,pn;const{key:A0}=Rt,ua=document.activeElement,jT=ua===((Pn=X.current)==null?void 0:Pn.querySelector(".timepicker-hour")),$T=ua===((pn=X.current)==null?void 0:pn.querySelector(".timepicker-minute")),IT=ua==null?void 0:ua.closest('.timepicker-modal [tabindex="0"]');if(![tw,Z_,nw,iw,ew,Q_,J_].includes(A0))return;M&&!IT&&q_(Me,0,X.current),Rt.preventDefault();const Ec=!M&&Xn==="hours"||M&&jT,O0=!M&&Xn==="minutes"||M&&$T;switch(A0){case nw:return N==null?void 0:N();case Z_:if(Ec)return Au(x,xt,J,nt,!0);if(O0)return G_(q,Oe,P,mt,!0);break;case tw:if(Ec)return Au(x,xt,J,nt,!1);if(O0)return G_(q,Oe,P,mt,!1);break;case Q_:if(Ec&&!M)return Au(x,xt,J,nt,!1,"isLeft");break;case J_:if(Ec&&!M)return Au(x,xt,J,nt,!0,"isRight");break;case iw:q_(Me,Kn,X.current);break;case ew:ua.click();break}},[xt,x,Xn,mt,P,M,Kn,N]);return k.useEffect(()=>{if(!B&&!R)return;const{hours:Rt,minutes:Pn,period:pn}=O4(x);if(B)return Mn(Rt),as(Pn),Ci(pn);if(R)return Un(Rt),dn(Pn),Ke(pn)},[R,B,x]),k.useEffect(()=>(ft&&it&&(document.addEventListener("click",rf),document.addEventListener("keydown",of)),()=>{document.removeEventListener("click",rf),document.removeEventListener("keydown",of)}),[ft,it,rf,of]),k.useEffect(()=>{if(l){const{hour:Rt,minute:Pn,defaultPeriod:pn}=ld(l);Un(Rt),dn(Pn),pn!==void 0&&Ke(pn)}if(c){const{hour:Rt,minute:Pn,defaultPeriod:pn}=ld(c);Mn(Rt),as(Pn),pn!==void 0&&Ci(pn)}},[l,c]),k.useEffect(()=>{typeof r=="string"&&r&&X_(r,x)&&dt(r)},[r,x]),k.useEffect(()=>{if(X_(wt,x)||wt===""){if(pt(!1),wt!==""){const{hour:Rt,minute:Pn,defaultPeriod:pn}=ld(wt);x==="24h"?(J(Rt===0?24:Rt),Rt===0?nt(360):Rt>12?nt((Rt-12)*30):nt(Rt*30)):(J(Rt),nt(Rt*30),Dt(pn)),q(Pn),Oe(Pn*6)}}else pt(!0)},[wt,x]),k.useEffect(()=>{let Rt;return j&&(Rt=setTimeout(()=>{Q(!1)},400)),()=>{clearTimeout(Rt)}},[j]),b.jsx(b.Fragment,{children:b.jsx(nf.Provider,{value:{isInDatetimepicker:e,onDatetimepickerModeSwitch:t,show:ft,setInputValue:dt,submitLabel:Cn.submit,clearLabel:Cn.clear,cancelLabel:Cn.cancel,activeHour:xt,activeMinute:mt,setActiveHour:J,setActiveMinute:q,format:x,period:ye,setPeriod:Dt,defaultValue:s,maxHour:he,minHour:Yn,maxPeriod:Pi,minPeriod:ls,mode:Xn,setMode:Ti,setHandAnimation:Q,handAnimation:j,minMinute:Mi,maxMinute:Si,hourAngle:It,setHourAngle:nt,minuteAngle:Tt,setMinuteAngle:Oe,inline:M,increment:P,onChange:T,onOpen:E,onClose:N,onCloseHandler:us,amLabel:$,pmLabel:F,switchHoursToMinutesOnClick:V,headId:W,bodyId:et},children:b.jsxs(b.Fragment,{children:[b.jsx("div",{className:ca,ref:M?ai:sf,style:{...O,height:"fit-content"},...U,children:!e&&b.jsx(wi,{onFocus:hn,ref:rt,labelRef:G,className:Dc,label:Cn.input,id:Gr,value:wt,onChange:ht,wrapperClass:"timepicker",style:A,disabled:D,onClick:()=>{h&&Ge()},children:!h&&!u&&(C?b.jsx(Zt,{className:"timepicker-toggle-button",onClick:Ge,color:"none",tabIndex:0,type:"button",disabled:D,style:{pointerEvents:D?"none":"auto"},children:b.jsx("i",{className:`${w} ${S} timepicker-icon`})}):b.jsx("i",{onClick:Ge,className:`${w} ${S} timepicker-icon timepicker-toggle-button`}))})}),b.jsx(R4,{isOpen:ft,wrapperRef:X,referenceElement:n||cs,inline:M,className:_,onClosed:fn,onOpened:NT})]})})})});PT.displayName="MDBTimepicker";const j4=({className:e,dropdown:t,children:n,styles:i,attributes:s,setPopperElement:r,style:o,onClosed:a,onOpened:l})=>{const c={initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3}},u=I("datepicker-dropdown-container",e),d=I("datepicker-modal-container",e),h=f=>{f.opacity===0?a==null||a():l==null||l()};return b.jsx(b.Fragment,{children:t?b.jsx(Jo.div,{style:{position:"absolute",zIndex:1065,...i.popper},...s.popper,ref:r,className:u,tabIndex:-1,...c,onAnimationComplete:f=>h(f),children:n}):b.jsx(Jo.div,{...c,className:d,style:o,onAnimationComplete:f=>h(f),children:n})})},Ce={closeOnEsc:!0,title:"Select date",okBtnText:"Ok",clearBtnText:"Clear",cancelBtnText:"Cancel",customIcon:"far fa-calendar",customHeader:"",inputLabel:"Select a date",monthsFull:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],views:"days",format:"dd/mm/yyyy",weekdaysFull:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],weekdaysNarrow:["S","M","T","W","T","F","S"],startDay:0};function Te(e){return e.getDate()}function sw(e){return e.getDay()}function Pt(e){return e.getMonth()}function ot(e){return e.getFullYear()}function $4(e,t,n){const i=n,s=i>0?7-i:0,r=new Date(e,t).getDay()+s;return r>=7?r-7:r}function I4(e){return e.getDate()===rc(e)}function sg(e){return I4(e)?rc(new Date(ot(e),Pt(e)+1,1)):Te(e)}function rc(e){return F4(e).getDate()}function F4(e){return Or(e.getFullYear(),e.getMonth()+1,0)}function Ro(){return new Date}function Ln(e,t){return Je(e,t*12)}function Je(e,t){const n=Or(e.getFullYear(),e.getMonth()+t,e.getDate()),i=Te(e),s=Te(n);return i!==s&&n.setDate(0),n}function eo(e,t){return Or(e.getFullYear(),e.getMonth(),e.getDate()+t)}function Or(e,t,n){const i=new Date(e,t,n);return e>=0&&e<100&&i.setFullYear(i.getFullYear()-1900),i}function rg(e){return!Number.isNaN(e.getTime())}function rw(e,t){return ot(e)-ot(t)||Pt(e)-Pt(t)||Te(e)-Te(t)}function vs(e,t){return e.setHours(0,0,0,0),t.setHours(0,0,0,0),e.getTime()===t.getTime()}function ow(e){return parseInt(e,10)<10?`0${e}`:e}function og(e,t){const n=ot(e)-TT(0,null,null);return B4(n,t)}function B4(e,t){return(e%t+t)%t}function TT(e,t,n){let i=0;return n?i=ot(n)-e+1:t&&(i=ot(t)),i}function No(e,t,n,i){const s=t&&rw(e,t)<=0,r=n&&rw(e,n)>=0,o=i&&i(e)===!1;return!!(s||r||o)}function ag(e,t,n,i,s,r){const o=i&&ot(i),a=i&&Pt(i),l=n&&ot(n),c=n&&Pt(n),u=new Date().getFullYear(),d=new Date().getMonth();if(r&&u===t&&ed||r&&u>t||s&&uo||t===o&&e>a:!1,f=c&&l?tr)return!0;const o=t&&ot(t),a=n&&ot(n),l=a?e>a:!1,c=o?en===e)}function aw(e,t,n,i,s){return s?DT(e,s,t,n,i,s):!1}function lw(e,t,n,i,s){return i?DT(e,i,t,n,i,s):!1}function DT(e,t,n,i,s,r){if(n==="days")return ot(e)===ot(t)&&Pt(e)===Pt(t);if(n==="months")return ot(e)===ot(t);if(n==="years"){const o=TT(i,s,r);return Math.floor((ot(e)-o)/i)===Math.floor((ot(t)-o)/i)}return!1}function lh(e,t,n,i){let s;if(t){const r=V4(t);if(r){r[0]!==r[1]?s=r[0]+r[1]:s=r[0];const o=new RegExp(`[${s}]`),a=e.split(o),l=t==null?void 0:t.split(o),c=(t==null?void 0:t.indexOf("mmm"))!==-1,u=[];l==null||l.forEach((m,v)=>{m.indexOf("yy")!==-1&&(u[0]={value:a[v],format:m}),m.indexOf("m")!==-1&&(u[1]={value:a[v],format:m}),m.indexOf("d")!==-1&&m.length<=2&&(u[2]={value:a[v],format:m})});let d;(t==null?void 0:t.indexOf("mmmm"))!==-1?d=n:d=i;const h=Number(u[0].value),f=c?z4(u[1].value,d):Number(u[1].value)-1,p=Number(u[2].value);return Or(h,f,p)}}}function cw(e,t,n,i,s,r){const o=Te(e),a=ow(Te(e).toString()),l=n[sw(e)],c=i[sw(e)],u=Pt(e),d=ow((Pt(e)+1).toString()),h=s[Pt(e)],f=r[Pt(e)],p=ot(e).toString().length===2?ot(e):ot(e).toString().slice(2,4),m=ot(e),v=t.split(/(d{1,4}|m{1,4}|y{4}|yy|!.)/g);let y="";return v.forEach(g=>{switch(g){case"dddd":g=g.replace(g,c);break;case"ddd":g=g.replace(g,l);break;case"dd":g=g.replace(g,a);break;case"d":g=g.replace(g,o.toString());break;case"mmmm":g=g.replace(g,f);break;case"mmm":g=g.replace(g,h);break;case"mm":g=g.replace(g,d);break;case"m":g=g.replace(g,u.toString());break;case"yyyy":g=g.replace(g,m.toString());break;case"yy":g=g.replace(g,p.toString());break}y+=g}),y}const ET=(e,t)=>{if(!t)return!1;const n=new Date;return n.setHours(0,0,0,0)===e.setHours(0,0,0,0)?!1:et?e>new Date:!1,ir=Y.createContext({view:"days",setView:null,activeDate:new Date,setActiveDate:null,selectedDate:new Date,setSelectedDate:null,weekdaysShort:[],monthsShort:[],monthsFull:[],min:void 0,max:void 0,weekdaysFull:[],yearScope:[],tabCount:0,inline:!1,disableFuture:!1,disablePast:!1}),W4=({clearBtnText:e="Clear",cancelBtnText:t="Cancel",okBtnText:n="Ok",setValue:i,selectDate:s,onClose:r})=>{const{setActiveDate:o,setSelectedDate:a,selectedDate:l,isInDatetimepicker:c,onDatetimepickerModeSwitch:u}=k.useContext(ir),d=h=>{h.currentTarget.blur(),o(new Date),a(void 0),i("")};return b.jsxs("div",{className:"datepicker-footer",children:[b.jsx("button",{tabIndex:0,onClick:h=>d(h),className:"datepicker-footer-btn datepicker-clear-btn",children:e}),b.jsx("button",{tabIndex:0,onClick:()=>r==null?void 0:r(),className:"datepicker-footer-btn datepicker-cancel-btn",children:t}),b.jsx("button",{tabIndex:0,onClick:()=>{s(l),c&&(u==null||u()),r==null||r()},className:"datepicker-footer-btn datepicker-ok-btn",children:n})]})},H4=(e,t,n)=>{const i=document.createElement("button"),s=document.createElement("div");i.id=`datepicker-toggle-${Math.floor(Math.random()*10001)}`,i.tabIndex=0,i.type="button",i.style.pointerEvents="auto";const r=document.createElement("i");r.className=`${e} fa-${t} datepicker-icon`,n&&i.appendChild(r);const o=n?i:r;return o.classList.add("datepicker-toggle-button"),{div:s,selector:o}},U4=(e,t,n,i,s,r)=>{const o=[],a=Pt(e),l=Pt(Je(e,-1)),c=Pt(Je(e,1)),u=ot(e),d=$4(u,a,r),h=rc(e),f=rc(Je(e,-1)),p=7;let m=1,v=!1;for(let y=1;yh&&(m=1,v=!1);const _=Or(u,v?a:c,m);g.push({date:_,currentMonth:v,isSelected:t&&vs(_,t),isToday:vs(_,Ro()),dayNumber:Te(_),disabled:No(_,n,i,s)}),m++}o.push(g)}return o},Y4=e=>{const t=[],n=e[0];let i=[];for(let s=0;s<24;s++)if(i.push(n+s),i.length===4){const r=i;t.push(r),i=[]}return t},X4=e=>{const t=[];let n=[];return e.forEach(i=>{if(n.push(i),n.length===4){const s=n;t.push(s),n=[]}}),t},K4=({filter:e,startWeekdays:t,startDay:n,inlineDayClick:i,selectOnClick:s,selectDate:r,onClose:o})=>{const{min:a,max:l,setActiveDate:c,setSelectedDate:u,activeDate:d,selectedDate:h,tabCount:f,disableFuture:p,disablePast:m}=k.useContext(ir),v=y=>{!No(y,a,l,e)&&(c(y),u(y),i(y),s&&(r(y),o==null||o()))};return b.jsxs("table",{className:"datepicker-table",children:[b.jsx("thead",{children:b.jsx("tr",{children:t.map((y,g)=>b.jsx("th",{className:"datepicker-day-heading",scope:"col",children:y},g))})}),b.jsx("tbody",{className:"datepicker-table-body",children:U4(d,h,a,l,e,n).map((y,g)=>b.jsx("tr",{children:y.map((x,_)=>b.jsx("td",{onClick:()=>v(x.date),tabIndex:vs(x.date,d)?0:void 0,className:I("datepicker-cell","datepicker-small-cell","datepicker-day-cell",x.isToday&&"current",x.isSelected&&"selected",x.disabled&&"disabled",f===3&&vs(x.date,d)&&"focused",Pt(d)!==Pt(x.date)&&"disabled",AT(x.date,p)&&"disabled",ET(x.date,m)&&"disabled"),children:b.jsx("div",{className:"datepicker-cell-content datepicker-small-cell-content",style:{display:x.currentMonth?"block":"none"},children:x.dayNumber})},_))},g))})]})},G4=()=>{const{yearScope:e,setView:t,setActiveDate:n,activeDate:i,selectedDate:s,tabCount:r,min:o,max:a,disableFuture:l,disablePast:c}=k.useContext(ir);return b.jsx("table",{className:"datepicker-table",children:b.jsx("tbody",{className:"datepicker-table-body",children:Y4(e).map((u,d)=>b.jsx("tr",{children:u.map(h=>b.jsx("td",{onClick:()=>{n(new Date(h,Pt(i),Te(i))),t("months")},tabIndex:h===ot(i)?0:void 0,className:I("datepicker-cell","datepicker-large-cell","datepicker-year-cell",s&&h===ot(s)&&"selected",r===3&&h===ot(i)&&"focused",lg(h,o,a,l,c)&&"disabled",ot(Ro())===h&&"current"),children:b.jsx("div",{className:"datepicker-cell-content datepicker-large-cell-content",children:h})},h))},d))})})},q4=()=>{const{monthsShort:e,setActiveDate:t,setView:n,activeDate:i,selectedDate:s,tabCount:r,min:o,max:a,disableFuture:l,disablePast:c}=k.useContext(ir);return b.jsx("table",{className:"datepicker-table",children:b.jsx("tbody",{className:"datepicker-table-body",children:X4(e).map((u,d)=>b.jsx("tr",{children:u.map(h=>b.jsx("td",{onClick:()=>{t(new Date(ot(i),e.indexOf(h),sg(i))),n("days")},tabIndex:e.indexOf(h)===Pt(i)?0:void 0,className:I("datepicker-cell","datepicker-large-cell","datepicker-month-cell",s&&e.indexOf(h)===Pt(s)&&ot(i)===ot(s)&&"selected",r===3&&e.indexOf(h)===Pt(i)&&"focused",Pt(Ro())===e.indexOf(h)&&ot(Ro())===ot(i)&&"current",ag(e.indexOf(h),ot(i),o,a,l,c)&&"disabled"),children:b.jsx("div",{className:"datepicker-cell-content datepicker-large-cell-content",children:h})},e.indexOf(h)))},d))})})},Q4=({title:e,customHeader:t})=>{const{weekdaysShort:n,monthsShort:i,selectedDate:s,isInDatetimepicker:r,onDatetimepickerModeSwitch:o}=k.useContext(ir),a=s||new Date;return b.jsxs("div",{className:"datepicker-header",children:[b.jsx("div",{className:"datepicker-title",children:b.jsx("span",{className:"datepicker-title-text",children:e})}),b.jsxs("div",{className:"datepicker-date",children:[!t&&b.jsxs("span",{className:"datepicker-date-text",children:[n[a.getDay()],", ",i[a.getMonth()]," ",a.getDate()]}),t&&t]}),r&&b.jsxs("div",{className:"buttons-container",children:[b.jsx("button",{type:"button",className:"datepicker-button-toggle",children:b.jsx("i",{className:"far fa-calendar datepicker-toggle-icon"})}),b.jsx("button",{type:"button",className:"timepicker-button-toggle",onClick:o,children:b.jsx("i",{className:"far fa-clock fa-sm timepicker-icon"})})]})]})},Z4=()=>{const{view:e,setView:t,activeDate:n,setActiveDate:i,monthsFull:s,min:r,max:o,yearScope:a}=k.useContext(ir),l=c=>{if(e==="days"){const u=c?new Date(ot(n),Pt(n)+1,sg(n)):new Date(ot(n),Pt(n)-1,sg(n));c?!aw(Je(u,-1),"days",1,r,o)&&i(u):!lw(Je(u,1),"days",1,r,o)&&i(u)}else if(e==="years"){const u=c?new Date(ot(n)+24,Pt(n),Te(n)):new Date(ot(n)-24,Pt(n),Te(n));c?o?a[0]+24ot(r)&&i(u):i(u)}else if(e==="months"){const u=c?new Date(ot(n)+1,Pt(n),Te(n)):new Date(ot(n)-1,Pt(n),Te(n));c?!aw(Ln(u,-1),"months",1,r,o)&&i(u):!lw(Ln(u,1),"months",1,r,o)&&i(u)}};return b.jsxs("div",{className:"datepicker-date-controls",children:[e==="days"&&b.jsxs("button",{tabIndex:0,className:"datepicker-view-change-button",onClick:()=>t("years"),children:[s[n.getMonth()]," ",n.getFullYear()]}),e==="years"&&b.jsxs("button",{tabIndex:0,className:"datepicker-view-change-button",onClick:()=>t("days"),children:[a[0]," - ",a[1]]}),e==="months"&&b.jsx("button",{tabIndex:0,className:"datepicker-view-change-button",onClick:()=>t("days"),children:ot(n)}),b.jsxs("div",{className:"datepicker-arrow-controls",children:[b.jsx("button",{tabIndex:0,className:"datepicker-previous-button",onClick:()=>l(!1)}),b.jsx("button",{tabIndex:0,className:"datepicker-next-button",onClick:()=>l(!0)})]})]})},J4=({labelText:e,inline:t,setReferenceElement:n,inputClasses:i,value:s,style:r,inputStyle:o,icon:a,input:l,inputId:c,inputToggle:u,setDatepickerValue:d,format:h,onOpenHandler:f,...p})=>{const{monthsFull:m,monthsShort:v,setSelectedDate:y,setActiveDate:g}=k.useContext(ir),x=I(s?"active":"",i),_=k.useRef(null);return k.useEffect(()=>{var w;if(u)return;const S=(w=_.current)==null?void 0:w.parentNode,{div:C,selector:M}=H4(a,"sm",!0);return S==null||S.insertBefore(C,_.current),S==null||S.insertBefore(M,_.current),M.addEventListener("click",()=>f==null?void 0:f()),()=>{M.removeEventListener("click",()=>f==null?void 0:f()),S==null||S.removeChild(M)}},[a,f,u]),b.jsx(wi,{className:x,label:e,id:c,ref:t?n:l,labelRef:_,wrapperClass:"datepicker",value:s,onChange:w=>{const S=lh(w.target.value,h,m,v);d(w.target.value),S&&rg(S)?(g(S),y(S)):(g(new Date),y(void 0))},style:o,wrapperStyle:r,onClick:()=>{u&&(f==null||f())},...p})},x0="ArrowLeft",b0="ArrowUp",_0="ArrowRight",w0="ArrowDown",k0="Home",S0="End",M0="PageUp",C0="PageDown",P0="Enter",T0=" ",t8=(e,t,n,i,s,r,o,a,l,c)=>{switch(e){case x0:t(u=>eo(u,-1));break;case _0:t(u=>eo(u,1));break;case b0:t(u=>eo(u,-7));break;case w0:t(u=>eo(u,7));break;case k0:t(u=>eo(u,1-Te(u)));break;case S0:t(u=>eo(u,rc(u)-Te(u)));break;case M0:t(u=>Je(u,-1));break;case C0:t(u=>Je(u,1));break;case P0:if(No(n,i,s,o)||ET(n,c)||AT(n,l))return;a(n),r(n);break;case T0:if(!o||o(n)){if(No(n,i,s,o))return;a(n),r(n)}break;default:return}},e8=(e,t,n,i,s,r,o,a,l)=>{switch(e){case x0:n(c=>Ln(c,-1));break;case _0:n(c=>Ln(c,1));break;case b0:n(c=>Ln(c,-4));break;case w0:n(c=>Ln(c,4));break;case k0:n(c=>Ln(c,-og(c,24)));break;case S0:n(c=>Ln(c,24-og(c,24)-1));break;case M0:n(c=>Ln(c,-24));break;case C0:n(c=>Ln(c,24));break;case P0:!lg(ot(t),i,s,a,l)&&r("months");break;case T0:!lg(ot(t),i,s,a,l)&&o(t);return;default:return}},n8=(e,t,n,i,s,r,o,a,l,c)=>{switch(e){case x0:n(u=>Je(u,-1));break;case _0:n(u=>Je(u,1));break;case b0:n(u=>Je(u,-4));break;case w0:n(u=>Je(u,4));break;case k0:n(u=>Je(u,-Pt(u)));break;case S0:n(u=>Je(u,11-Pt(u)));break;case M0:n(u=>Ln(u,-1));break;case C0:n(u=>Ln(u,1));break;case P0:!ag(Pt(t),ot(t),i,s,l,c)&&r("days");break;case T0:!ag(Pt(t),ot(t),i,s,l,c)&&o(t);return;default:return}},i8=({closeOnEsc:e,isOpen:t,activeDate:n,setActiveDate:i,min:s,max:r,view:o,setView:a,setSelectedDate:l,filter:c,setInlineDate:u,disableFuture:d,disablePast:h,onClose:f})=>{const[p,m]=k.useState(3),v=k.useRef(null),y=k.useCallback(g=>{var x,_,w;if(e&&g.key==="Escape"&&(f==null||f()),g.preventDefault(),!g.shiftKey&&g.key==="Tab"){const S=(x=v.current)==null?void 0:x.querySelectorAll('[tabindex="0"]');S&&(p===S.length-1?m(0):m(p+1))}else if(g.key==="Enter")p!==3&&document.activeElement&&document.activeElement.click();else if(g.shiftKey&&g.key==="Tab"){const S=(_=v.current)==null?void 0:_.querySelectorAll('[tabindex="0"]');S&&m(p===0?S.length-1:p-1)}(w=v.current)!=null&&w.querySelector(".focused")&&p!==4&&(o==="days"?t8(g.key,i,n,s,r,l,c,u,d,h):o==="years"?e8(g.key,n,i,s,r,a,l,d,h):o==="months"&&n8(g.key,n,i,s,r,a,l,c,d,h))},[n,o,c,r,s,e,p,a,i,l,u,d,h,f]);return k.useEffect(()=>{var g,x;const _=(g=v.current)==null?void 0:g.querySelectorAll('[tabindex="0"]');if(_){const w=_[p];if(w.tagName!=="TD"){w.focus();const S=(x=v.current)==null?void 0:x.querySelector(".focused");S==null||S.classList.remove("focused")}else _[p-1].blur(),w.classList.add("focused")}},[p]),k.useEffect(()=>{t||m(3)},[t]),k.useEffect(()=>{m(3)},[o]),k.useEffect(()=>{if(t)return document.addEventListener("keydown",y),()=>{document.removeEventListener("keydown",y)}},[y,t]),{tabCount:p,modalRef:v}},s8=({isOpen:e,inline:t})=>{k.useEffect(()=>{const n=window.innerWidth>document.documentElement.clientWidth&&window.innerWidth>=576;if(!t)return e&&n?(document.body.style.overflow="hidden",document.body.style.paddingRight="17px"):(document.body.style.overflow="",document.body.style.paddingRight=""),()=>{document.body.style.overflow="",document.body.style.paddingRight=""}},[e,t])},r8=({isOpened:e,isOpen:t,inline:n,popperElement:i,referenceElement:s,backdropRef:r,onCloseHandler:o})=>{const a=k.useCallback(l=>{var c;n?!(i!=null&&i.contains(l.target))&&!((c=s==null?void 0:s.parentNode)!=null&&c.contains(l.target))&&!l.target.classList.contains("datepicker-view-change-button")&&!l.target.classList.contains("datepicker-large-cell-content")&&t&&o():l.target===r.current&&t&&o()},[i,s,r,n,t,o]);k.useEffect(()=>(e&&document.addEventListener("click",a),()=>{document.removeEventListener("click",a)}),[e,a])},OT=k.forwardRef(({datetimepickerRef:e,isInDatetimepicker:t,onDatetimepickerModeSwitch:n,closeOnEsc:i=Ce.closeOnEsc,customHeader:s,title:r=Ce.title,weekdaysNarrow:o=Ce.weekdaysNarrow,monthsFull:a=Ce.monthsFull,monthsShort:l=Ce.monthsShort,weekdaysFull:c=Ce.weekdaysFull,weekdaysShort:u=Ce.weekdaysShort,disableFuture:d,disablePast:h,filter:f,inline:p,className:m,min:v,max:y,format:g=Ce.format,okBtnText:x=Ce.okBtnText,clearBtnText:_=Ce.clearBtnText,cancelBtnText:w=Ce.cancelBtnText,inputToggle:S,customIcon:C=Ce.customIcon,inputId:M,inputLabel:P=Ce.inputLabel,inputStyle:T,startDay:A=Ce.startDay,views:E=Ce.views,style:z,defaultValue:N="",onChange:L,onClose:R,onClosed:B,onOpen:D,onOpened:$,getFormattedDateValues:F,value:V,wrapperClass:W,selectOnClick:et=!1,open:Z,disablePortal:O,...U},lt)=>{const[ct,kt]=k.useState(!1),[it,Lt]=k.useState(!1),Ct=ef(it,Z),[Qt,ft]=k.useState(new Date),[wt,dt]=k.useState(new Date),[jt,pt]=k.useState(E),[xt,J]=k.useState(V||N),[mt,q]=k.useState(),[ye,Dt]=k.useState(),[he,Un]=k.useState(o),[Yn,Mn]=k.useState([0,0]),Si=k.useRef(null),dn=k.useRef(null),Mi=k.useRef(N&&!0),{styles:as,attributes:ls}=Oh(e||ye,mt,{placement:"bottom-start",modifiers:[VM]});k.useImperativeHandle(lt,()=>p?ye:dn.current,[p,ye]);const Ci=nt=>{if(p&&p){const Tt=cw(nt,g,u,c,l,a);J(Tt),t&&(n==null||n()),Ke()}},Pi=nt=>{const Tt=nt&&cw(nt,g,u,c,l,a);Tt&&J(Tt)},Ke=k.useCallback(()=>{Lt(!1),R==null||R()},[R]),Xn=k.useCallback(()=>{Lt(!0),D==null||D()},[D]),Ti=k.useCallback(()=>{kt(!1),B==null||B()},[B]),j=k.useCallback(()=>{kt(!0),$==null||$()},[$]),{tabCount:Q,modalRef:It}=i8({closeOnEsc:i,isOpen:Ct,activeDate:Qt,setActiveDate:ft,min:v,max:y,view:jt,setView:pt,setSelectedDate:dt,filter:f,setInlineDate:Ci,disableFuture:d,disablePast:h});return s8({isOpen:Ct,inline:p}),r8({isOpened:ct,isOpen:Ct,inline:p,referenceElement:ye,popperElement:mt,backdropRef:Si,onCloseHandler:Ke}),k.useEffect(()=>{const nt=ot(Qt),Tt=og(Qt,24),Oe=nt-Tt;Mn([Oe,Oe+23])},[Qt]),k.useEffect(()=>{const nt=o.slice(A).concat(o.slice(0,A));Un(nt)},[o,A]),k.useEffect(()=>{if(!Ct)return;const nt=p?ye:dn.current,Tt=nt==null?void 0:nt.parentNode,Oe=Tt==null?void 0:Tt.querySelector("button");Oe?Oe.blur():nt==null||nt.blur()},[Ct,dn,ye,p,D]),k.useEffect(()=>{Z&&!Ct&&!ct&&(D==null||D(),Lt(!0))},[Z,Ct,ct,D]),k.useEffect(()=>{if(!Mi.current)return;const nt=lh(xt,g,a,l);nt&&rg(nt)&&(ft(nt),dt(nt)),Mi.current=!1},[N,xt,g,a,l]),k.useEffect(()=>{const nt=V&&lh(V,g,a,l);nt&&rg(nt)&&(ft(nt),dt(nt),J(V)),V===""&&(ft(new Date),dt(void 0),J(V))},[V,g,a,l]),k.useEffect(()=>{Ct||(pt(E),xt||(ft(new Date),dt(void 0)))},[Ct,E,xt]),k.useEffect(()=>{L==null||L(xt,Qt)},[xt]),k.useEffect(()=>{const nt=wt||new Date,Tt=String(nt.getDate()),Oe=u[nt.getDay()],cs=c[nt.getDay()],ai=l[nt.getMonth()],Kn=a[nt.getMonth()],Me=String(nt.getFullYear()),Kr=Me.slice(-2);F==null||F({dayNumber:Tt,weekdayShort:Oe,weekdayFull:cs,monthShort:ai,monthFull:Kn,yearFull:Me,yearShort:Kr})},[wt]),b.jsx(ir.Provider,{value:{isInDatetimepicker:t,onDatetimepickerModeSwitch:n,view:jt,setView:pt,activeDate:Qt,setActiveDate:ft,selectedDate:wt,setSelectedDate:dt,weekdaysShort:u,monthsShort:l,monthsFull:a,min:v,max:y,weekdaysFull:c,yearScope:Yn,tabCount:Q,isOpen:Ct,disablePast:h,disableFuture:d},children:b.jsxs(b.Fragment,{children:[!t&&b.jsx(J4,{inputClasses:m,labelText:P,inline:p,setReferenceElement:Dt,value:xt,setDatepickerValue:J,style:z,inputStyle:T,format:g,icon:C,input:dn,inputToggle:S,onOpenHandler:Xn,...U}),b.jsx(aa,{disablePortal:O,children:b.jsx(Zy,{children:Ct&&b.jsxs(b.Fragment,{children:[b.jsxs(j4,{className:W,dropdown:p,styles:as,attributes:ls,setPopperElement:q,onClosed:Ti,onOpened:j,children:[!p&&b.jsx(Q4,{title:r,customHeader:s,onClose:Ke}),b.jsxs("div",{className:"datepicker-main",ref:It,children:[b.jsx(Z4,{}),b.jsxs("div",{className:"datepicker-view",children:[jt==="days"&&b.jsx(K4,{startWeekdays:he,startDay:A,filter:f,inlineDayClick:Ci,selectDate:Pi,selectOnClick:et,onClose:Ke}),jt==="years"&&b.jsx(G4,{}),jt==="months"&&b.jsx(q4,{})]}),!p&&b.jsx(W4,{okBtnText:x,clearBtnText:_,cancelBtnText:w,setValue:J,selectDate:Pi,onClose:Ke})]})]},"datepicker-modal-container"),!p&&b.jsx(Jo.div,{className:"datepicker-backdrop",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},ref:Si})]})})})]})})});OT.displayName="MDBDatepicker";const o8=e=>{const t=/^([0-1]?[0-9]|2[0-3]):[0-5][0-9] [APap][mM]$/,n=/^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])?$/;return e.match(t)||e.match(n)},a8=e=>e&&Object.prototype.toString.call(e)==="[object Date]"&&!isNaN(e.getTime()),uw=300,l8=k.forwardRef(({className:e,label:t="Select Date and Time",labelStyle:n,labelClass:i,labelRef:s,inputClass:r="",inputRef:o,inline:a,disabled:l,defaultTime:c="",defaultDate:u="",value:d,invalidLabel:h,inputToggle:f=!1,timepickerOptions:p,datepickerOptions:m,showFormat:v,dateFormat:y="dd/mm/yyyy",timeFormat:g="12h",appendValidationInfo:x=!0,onChange:_,onOpen:w,onClose:S,onDatepickerOpen:C,onDatepickerClose:M,onTimepickerOpen:P,onTimepickerClose:T,...A},E)=>{const z=k.useRef(!1),[N,L]=k.useState(!1),[R,B]=k.useState(!1),[D,$]=k.useState(u),[F,V]=k.useState(c),[W,et]=k.useState(""),Z=k.useRef(),O=D?W.split(",")[0]:null,U=F?W.split(", ")[1]:null,lt=I("form-outline","datetimepicker",e),ct=()=>{const pt=O&&lh(O,y,Ce.monthsFull,Ce.monthsShort);return W&&!O&&!U||O&&!a8(pt)||U&&!o8(U)?r+" is-invalid":r},kt=k.useCallback(pt=>{$(pt)},[]),it=k.useCallback(pt=>{V(pt)},[]),Lt=k.useCallback(()=>{B(!1),z.current=!1,M==null||M()},[M]),Ct=k.useCallback(()=>{T==null||T(),L(!1),z.current=!1},[T]),Qt=k.useCallback(()=>{C==null||C()},[C]),ft=k.useCallback(()=>{P==null||P()},[P]),wt=()=>{B(!0),w==null||w(),z.current=!0},dt=k.useCallback(()=>{R?(B(!1),setTimeout(()=>{L(!0)},uw)):N&&(L(!1),setTimeout(()=>{B(!0)},uw))},[R,N]);k.useEffect(()=>{!F||!D||(_==null||_(`${D}, ${F}`),!d&&et(`${D}, ${F}`))},[F,D,_,d]),k.useEffect(()=>{d&&(et(d),_==null||_(d))},[d,_]),k.useEffect(()=>{!R&&!N&&!z.current&&(S==null||S())},[R,N,S]);const jt=pt=>{et(pt);const[xt,J]=pt.split(", ");$(xt||""),V(J||"")};return b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:lt,ref:Z,...A,children:[b.jsx(wi,{label:t,labelStyle:n,labelClass:i,ref:o||E,labelRef:s,placeholder:v?`${y}, ${g}`:void 0,value:d||W,onChange:pt=>{jt(pt.target.value),_==null||_(pt.target.value)},className:x?ct():r,disabled:l,onClick:()=>{f&&wt()},children:h&&b.jsx("div",{className:"invalid-feedback",children:h})}),!f&&b.jsx("button",{type:"button",className:"datetimepicker-toggle-button",onClick:wt,disabled:l,style:{pointerEvents:l?"none":"initial"},children:b.jsx("i",{className:"far fa-calendar datepicker-toggle-icon"})})]}),b.jsx(OT,{...m,inline:a,onChange:kt,format:y,datetimepickerRef:Z.current,defaultValue:u,value:D,onClose:Lt,onOpen:Qt,isInDatetimepicker:!0,open:R,onDatetimepickerModeSwitch:dt}),b.jsx(PT,{...p,inline:a,onChange:it,format:g,datetimepickerRef:Z.current,defaultValue:c,value:F,onClose:Ct,onOpen:ft,isInDatetimepicker:!0,open:N,onDatetimepickerModeSwitch:dt})]})});l8.displayName="MDBDateTimepicker";const c8=Y.forwardRef(({className:e,color:t,children:n,...i},s)=>{const r=I("toast-header",t&&`bg-${t}`,t&&t!=="light"&&"text-white",e);return b.jsx("div",{className:r,ref:s,...i,children:n})});c8.displayName="MDBToastHeader";const u8=Y.forwardRef(({className:e,children:t,color:n,...i},s)=>{const r=I("toast-body",n&&n!=="light"&&"text-white",e);return b.jsx("div",{className:r,ref:s,...i,children:t})});u8.displayName="MDBToastBody";const d8=Y.forwardRef(({className:e,white:t,children:n,...i},s)=>{const r=I("btn-close",t&&"btn-close-white",e);return b.jsx(Zt,{className:r,color:"none",ref:s,...i,children:n})});d8.displayName="MDBToastClose";const h8=0,f8=({selectedElements:e,optionHeight:t,data:n,multiple:i,selectAll:s,handleSelectAll:r,handleOptionClick:o,selectAllLabel:a,selectData:l,activeElementIndex:c,noResults:u,search:d})=>{const h=k.useMemo(()=>l.filter(v=>v.optgroup).map(v=>v.optgroup),[l]),f=k.useMemo(()=>{let v=0;return l.map(y=>(y.optgroup&&v++,{...y,groupIndex:v}))},[l]),p=k.useMemo(()=>l.filter(v=>!v.optgroup&&!v.hidden).length===0,[l]),m=v=>f.map(y=>{if(!y.optgroup&&v===y.groupIndex)return b.jsxs("div",{className:I("select-option",e.includes(y.elementPosition)&&"selected",y.disabled&&"disabled",y.hidden&&"d-none",c===y.elementPosition&&"active"),role:"option",style:{height:t},onClick:()=>o(y),children:[b.jsxs("span",{className:"select-option-text",children:[i&&b.jsx(oh,{disabled:y.disabled,disableWrapper:!0,checked:e.includes(y.elementPosition),readOnly:!0}),y.text,y.secondaryText&&b.jsx("span",{className:"select-option-secondary-text",children:y.secondaryText})]}),y.icon&&b.jsx("span",{className:"select-option-icon-container",children:b.jsx("img",{className:"select-option-icon rounded-circle",src:y.icon})})]},y.elementPosition)});return b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:"select-options-list",children:[i&&s&&!p&&b.jsx("div",{className:I("select-option",e.length===n.filter(v=>!v.disabled).length&&"selected",c===-1&&"active"),role:"option",onClick:r,style:{height:t},children:b.jsxs("span",{className:"select-option-text",children:[b.jsx(oh,{disableWrapper:!0,checked:n.filter(v=>!v.disabled&&!v.optgroup).length===e.length,readOnly:!0}),a]})}),m(h8),!p&&(h==null?void 0:h.map((v,y)=>{const g=m(y+1).filter(x=>x!==void 0);if(g.length!==0)return b.jsxs("div",{className:"select-option-group",children:[b.jsx("label",{className:"select-option-group-label",style:{height:t},children:v}),g]},`select-option-group ${v} ${y}`)}))]}),d&&p&&b.jsx("div",{className:"select-no-results",style:{height:t},children:u})]})},_p="ArrowUp",wp="ArrowDown",dw="Enter",hw="Escape",fw="Tab",p8=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;no.includes(a))||!r.every(a=>i[a]===s[a]))return!1}return!0},m8=e=>e.map((t,n)=>({...t,elementPosition:n})),g8={open:{opacity:1,transform:"scaleY(1)",transition:{duration:.2}},closed:{opacity:0,transform:"scaleY(0.8)",transition:{duration:.2}}},Ra=-1,D0=k.forwardRef(({data:e,className:t,inputClassName:n,optionHeight:i=38,visibleOptions:s=5,disabled:r,placeholder:o,label:a,clearBtn:l,children:c,multiple:u,displayedLabels:d=5,optionsSelectedLabel:h="options selected",selectAll:f=!0,selectAllLabel:p="Select all",size:m,openRef:v,contrast:y=!1,open:g,onOpen:x,onOpened:_,onClose:w,onClosed:S,onValueChange:C,onChange:M,search:P=!1,searchLabel:T="Search...",searchFn:A,autoSelect:E=!1,noResultsText:z="No results",validation:N=!1,validFeedback:L="Valid",invalidFeedback:R="Invalid",preventFirstSelection:B=!1,value:D,animationVariants:$,disablePortal:F,...V},W)=>{const[et,Z]=k.useState(!1),O=ef(et,g),[U,lt]=k.useState(!0),[ct,kt]=k.useState(null),[it,Lt]=k.useState(),[Ct,Qt]=k.useState();k.useImperativeHandle(W,()=>it,[it]);const[ft,wt]=k.useState(""),[dt,jt]=k.useState(""),[pt,xt]=k.useState(()=>f?Ra:e.findIndex(G=>!G.disabled)),[J,mt]=k.useState([]),[q,ye]=k.useState([]),[Dt,he]=k.useState(q),[Un,Yn]=k.useState(""),[Mn,Si]=k.useState(0),[dn,Mi]=k.useState(!1),as=I("select-wrapper",t),ls=I("select-input",o&&"placeholder-active",O&&"focused",n),Ci=I(O||ct&&a?"active":"",a&&"select-label"),Pi=I("select-dropdown",O&&"open"),{styles:Ke,attributes:Xn}=Oh(it,Ct,{placement:"bottom-start"}),Ti=k.useRef(null),j=k.useRef(null),Q=k.useRef(null),It=k.useMemo(()=>u&&f?s+1:s,[f,s,u]);k.useEffect(()=>{if(!dt)return he(q);if(A&&dt){const G=A(dt,q);return he(G||[])}he(()=>q.filter(G=>{var X;return((X=G.text)==null?void 0:X.toLocaleLowerCase().includes(dt.toLocaleLowerCase()))||G.optgroup}))},[dt,q,A,ft]),k.useEffect(()=>{O&&dt&&xt(-1)},[O,dt]),k.useEffect(()=>{if(!N)return;const G=J.every(ht=>q[ht].value),X=J.every(ht=>!q[ht].disabled),rt=J.length>0;!u&&(!rt||!G||!X)||u&&(!rt||!X)?it==null||it.setCustomValidity(R):it==null||it.setCustomValidity("")},[N,R,J,it,q,ft,u]);const nt=G=>{if(q.length===0)return;const X=j.current,rt=X.offsetHeight,ht=X.scrollTop,hn=q.filter(Ge=>Ge.hidden&&Ge.elementPosition(u&&f?-2:-1)){const Ge=(us-hn)*i,fn=Ge+i>ht+rt;Ge{const G=rt=>Dt.findIndex(ht=>ht.elementPosition==rt);let X=pt;for(;X{let G=pt;for(;G>=0;){G-=1;const X=Dt.findIndex(ht=>ht.elementPosition==G)!=-1,rt=G>=0&&(q[G].disabled||q[G].hidden||q[G].optgroup);if(G<=0&&(!X||rt))return u&&f?G=-1:pt;if(X&&!rt)break}return G},cs=G=>{const{key:X}=G;if([_p,wp,dw,fw,hw].includes(X)){if(X===fw)return E&&ca(Dt[pt]),it==null||it.focus(),Z(!1);if(G.preventDefault(),G.altKey&&(X===wp||X===_p))return O?w==null||w():x==null||x(),Z(!O);if(X===wp){const rt=Tt();return O?(nt(rt),xt(rt)):u?Z(!0):mt([rt])}if(X===_p){const rt=Oe();return O?(nt(rt),xt(rt)):u?Z(!0):mt([rt])}if(X===dw){const rt=Dt.findIndex(ht=>ht.elementPosition==pt);return O?pt===Ra?Kr():ca(Dt[rt]):(x==null||x(),Z(!0))}if(X===hw)return Z(!1),it==null?void 0:it.focus()}},ai=k.useCallback(()=>{Z(G=>!G)},[]),Kn=k.useCallback(G=>{if(v&&v.current===G.target)return;const X=Ct&&Ct!==null,rt=it&&it!==null,ht=!(Ct!=null&&Ct.contains(G.target))&&!(it!=null&&it.contains(G.target)),hn=G.target===Q.current;X&&O&&rt&&ht&&!hn&&(Z(!1),w==null||w())},[Ct,it,O,w,v]);k.useEffect(()=>{const G=m8(e);p8(G,q)||ye(G)},[e,q]);const Me=k.useCallback(()=>{O&&Yn(`${it==null?void 0:it.offsetWidth}px`)},[it,O]),Kr=()=>{if(!u||!f)return;if(J.length===e.filter(X=>!X.disabled&&!X.optgroup).length)return mt([]),C==null||C([]),M==null||M([]),Cn([]);const G=q==null?void 0:q.filter(X=>!X.disabled&&!X.optgroup).map(X=>X.elementPosition);return mt(G),C==null||C(e.filter(X=>!X.disabled)),M==null||M(e.filter(X=>!X.disabled)),Cn(G)},Gr=k.useCallback(()=>{if(q.length===0)return;let G=J[0];const X=G===void 0,rt=G>=q.length;if(dn&&!u){if(X&&B||!dn||u||rt)return;X&&(G=0);const ht=q[G].value,hn=String(q[G].text);hn?(kt(ht?null:hn),wt(ht?hn:"")):(kt(null),wt(ht?" ":""))}},[u,dn,J,q,B]),Cn=k.useCallback(G=>{const X=d===-1||G.length>d;if(G.length<=0&&(kt(null),wt("")),X)return kt(null),wt(`${G.length} ${h}`);const rt=G.map(fn=>q[fn].text||"").filter(fn=>fn!==""),ht=G.map(fn=>q[fn].value||"").filter(fn=>fn!==""),hn=rt.findIndex(fn=>fn!=="")===-1,us=ht.length>0,Ge=rt.join(", ");hn?(kt(null),wt(us?" ":"")):us?(wt(Ge),kt(null)):(wt(""),kt(Ge))},[d,h,q]);k.useEffect(()=>{Gr()},[J,Gr]);const ca=G=>{if(!G||G.disabled)return;const{elementPosition:X}=G;if(u){const rt=J.includes(X)?J.filter(ht=>ht!==X):[...J,X];return mt(rt),C==null||C(rt.map(ht=>e[ht])),M==null||M(rt.map(ht=>e[ht])),Cn(rt)}return mt([X]),Z(!1),C==null||C(e[X]),M==null||M(e[X]),w==null||w(),it==null?void 0:it.focus()};k.useEffect(()=>{Mi(!0)},[]),k.useEffect(()=>{if(u){const X=q.filter(rt=>rt.defaultSelected).map(rt=>rt.elementPosition);return Cn(X),mt(X)}let G=q.findIndex(X=>X.defaultSelected);G===Ra&&!B&&(G=q.findIndex(X=>!X.disabled&&!X.hidden)),G!==Ra&&mt([G])},[q,Cn,u,B]),k.useEffect(()=>{if(O&&P&&J.length===0)return xt(Ra);O||(J.length>0?xt(Math.max(...J)):xt(0))},[Dt,O,P,J]),k.useEffect(()=>{Si(It*i)},[It,i]),k.useEffect(()=>{Me()},[Me]),k.useEffect(()=>(O&&(window.addEventListener("click",Kn),window.addEventListener("resize",Me)),()=>{window.removeEventListener("click",Kn),window.removeEventListener("resize",Me)}),[Kn,Me,O]),k.useEffect(()=>{if(v){const G=v.current;return G==null||G.addEventListener("click",ai),()=>{G==null||G.removeEventListener("click",ai)}}},[v,ai]),k.useEffect(()=>{if(!D)return;const G=Array.isArray(D)?D:[D],X=q.filter(ht=>ht.value&&G.includes(ht.value)).map(ht=>ht.elementPosition);if(X.toString()===J.toString())return;const rt=u?X.map(ht=>q[ht]):q[X[0]];C==null||C(rt),M==null||M(rt),mt(X),u?Cn(X):Gr()},[D,q,u,C,M,J,Gr,Cn]);const Dc=k.useCallback(()=>{r||(it==null||it.focus(),O?w==null||w():x==null||x(),Z(!O))},[r,O,x,w,it]),sf=k.useCallback(G=>{var X;G==="open"&&(lt(!1),_==null||_(),P&&((X=Ti.current)==null||X.focus())),G==="closed"&&(lt(!0),S==null||S(),P&&jt(""))},[_,S,P]);return b.jsx("div",{className:as,...V,children:b.jsxs(b.Fragment,{children:[b.jsxs(wi,{ref:Lt,onClick:Dc,onKeyDown:cs,className:ls,value:ft,readonly:!N,required:N,disabled:r,placeholder:ct?void 0:o,label:a,labelClass:Ci,size:m,contrast:y,children:[N&&b.jsxs(b.Fragment,{children:[b.jsx("div",{className:"invalid-feedback",children:R}),b.jsx("div",{className:"valid-feedback",children:L})]}),ct&&b.jsx("div",{className:"form-label select-fake-value active",children:ct}),l&&(ft.length>0||ct)&&b.jsx("span",{tabIndex:0,className:`select-clear-btn d-block ${r?"pe-none":""}`,role:"button",onClick:()=>{wt(""),mt([]),C==null||C(u?[]:{}),M==null||M(u?[]:{})},children:"✕"}),b.jsx("span",{className:`select-arrow ${r?"pe-none":""}`,ref:Q,onClick:Dc,style:{cursor:"pointer"}})]}),(e==null?void 0:e.length)>0&&(O||!U)&&b.jsx(aa,{disablePortal:F,children:b.jsx("div",{style:{...Ke.popper,width:Un,zIndex:1070},...Xn.popper,ref:Qt,className:"select-dropdown-container",children:b.jsx(Zy,{children:O&&b.jsxs(Jo.div,{variants:{...g8,...$},initial:"closed",animate:"open",exit:"closed",tabIndex:0,className:Pi,onAnimationStart:()=>{lt(!1)},onAnimationComplete:sf,children:[P&&b.jsx("div",{className:"input-group",children:b.jsx("input",{onKeyDown:cs,onChange:G=>jt(G.target.value),ref:Ti,type:"text",className:"form-control select-filter-input",role:"searchbox",placeholder:T})}),b.jsx("div",{className:"select-options-wrapper",ref:j,style:{maxHeight:`${Mn}px`},children:b.jsx(f8,{data:e,selectData:Dt,selectedElements:J,optionHeight:i,visibleOptions:It,handleOptionClick:ca,handleSelectAll:Kr,selectAll:f,selectAllLabel:p,multiple:u,activeElementIndex:pt,noResults:z,search:P})}),c&&b.jsx("div",{className:"select-custom-content",children:c})]})})})})]})})});D0.displayName="MDBSelectV2";const Tc=k.createContext({isLoading:!1,activePage:0,setActivePage:null,sort:{column:"",option:""},fixedHeader:!1,handleSort:null}),y8=({fullPagination:e,rowsText:t="Rows per page:",selectValue:n,setSelectValue:i,activeDataLength:s,entriesOptions:r=[10,25,50,200],fullDataLength:o,allText:a="All",ofText:l="of"})=>{const{isLoading:c,activePage:u,setActivePage:d}=k.useContext(Tc),h=u===0||c,f=s<=n*(u+1)||c,p=u===Math.floor(s/n),m=r.map(g=>({text:g.toString(),value:g,defaultSelected:n===g}));m.push({text:a,value:o,defaultSelected:n===o});const v=g=>{g instanceof Array||(i(g.value),d(0))},y=`${u*n+1} - ${(u+1)*n>s?s:(u+1)*n} ${l} ${s}`;return b.jsxs("div",{className:"datatable-pagination",children:[b.jsxs("div",{className:"datatable-select-wrapper",children:[b.jsx("p",{className:"datatable-select-text",children:t}),b.jsx(D0,{onValueChange:v,data:m,disabled:c})]}),b.jsx("div",{className:"datatable-pagination-nav",children:y}),b.jsxs("div",{className:"datatable-pagination-buttons",children:[e&&b.jsx(Zt,{disabled:h,onClick:()=>d(0),className:"datatable-pagination-button datatable-pagination-start",color:"link",children:b.jsx(sn,{icon:"angle-double-left"})}),b.jsx(Zt,{disabled:h,onClick:()=>d(u-1),className:"datatable-pagination-button datatable-pagination-left",color:"link",children:b.jsx(sn,{icon:"chevron-left"})}),b.jsx(Zt,{disabled:f,onClick:()=>d(u+1),className:"datatable-pagination-button datatable-pagination-right",color:"link",children:b.jsx(sn,{icon:"chevron-right"})}),e&&b.jsx(Zt,{disabled:p,onClick:()=>d(Math.floor(s/n)),className:"datatable-pagination-button datatable-pagination-end",color:"link",children:b.jsx(sn,{icon:"angle-double-right"})})]})]})},pw=(e,t,n)=>{const i=s=>s.toString().toLowerCase().includes(t.toLowerCase());return e.filter(s=>{if(n&&typeof n=="string")return i(s[n]);let r=Object.values(s);return n&&Array.isArray(n)&&(r=Object.keys(s).filter(o=>n.includes(o)).map(o=>s[o])),r.filter(o=>i(o)).length>0})},v8=(e,t,n)=>Object.assign([],e).sort((i,s)=>{const r=typeof i[t]=="string"?i[t].toLowerCase():i[t],o=typeof s[t]=="string"?s[t].toLowerCase():s[t];return ro?n==="desc"?-1:1:0}),LT=e=>e.every(t=>typeof t=="string"),E0=e=>!e.every(t=>typeof t=="string"),x8=e=>Array.isArray(e),mw=e=>!Array.isArray(e),b8=({search:e,advancedSearch:t,searchValue:n,setSearchValue:i,searchInputProps:s,label:r="Search",setAdvancedSearchValue:o})=>b.jsxs(b.Fragment,{children:[e&&b.jsx(wi,{value:n,onChange:a=>i(a.target.value),label:r,className:"mb-4",...s}),t&&b.jsxs(yT,{className:"mb-4",children:[b.jsx("input",{className:"form-control",value:n,onChange:a=>i(a.target.value),...s}),b.jsx(Zt,{className:"datatable-advanced-search",onClick:()=>o(t(n)),children:b.jsx(sn,{icon:"search"})})]})]}),_8=({dataColumns:e})=>{const{sort:t,fixedHeader:n,handleSort:i}=k.useContext(Tc),[s,r]=k.useState("rotate(0deg)"),o=a=>I("datatable-sort-icon",`${a===t.column&&"active"}`);return k.useEffect(()=>{const a=t.option==="desc"?"rotate(180deg)":"rotate(0deg)";r(a)},[t.option]),b.jsx(b.Fragment,{children:e.map((a,l)=>b.jsxs("th",{className:n?"fixed-cell":"",style:{cursor:"pointer"},scope:"row",onClick:()=>i(a),children:[b.jsx(sn,{fas:!0,icon:"arrow-up",className:o(a),style:{transform:a===t.column?s:"rotate(0deg)"}}),a]},l))})},w8=({dataColumns:e})=>{const[t,n]=k.useState("rotate(0deg)"),{sort:i,fixedHeader:s,handleSort:r,isLoading:o}=k.useContext(Tc),a=l=>I("datatable-sort-icon",`${l===i.column&&"active"}`);return k.useEffect(()=>{const l=i.option==="desc"?"rotate(180deg)":"rotate(0deg)";n(l)},[i.option]),b.jsx(b.Fragment,{children:e.map((l,c)=>{const{fixedValue:u,fixed:d,label:h}=l,f=l.sort!==!1&&!o,p={cursor:I(f&&"pointer"),left:d==="left"?u||0:void 0,right:d==="right"?u||0:void 0},m=I((s||d)&&"fixed-cell");return b.jsxs("th",{className:m,style:p,scope:"row",onClick:()=>f&&r(h),children:[f&&b.jsx(sn,{fas:!0,icon:"arrow-up",className:a(h),style:{transform:i.column===h?t:"rotate(0deg)"}}),h]},c)})})},k8=({row:e,dataColumns:t,format:n,editable:i})=>b.jsx(b.Fragment,{children:t.map((s,r)=>{const{field:o,fixed:a,width:l,fixedValue:c,columnSelector:u}=s,d=e[o],h=Number(d),f=n==null?void 0:n(o,h?Number(d):String(d)),p={minWidth:l,maxWidth:l,left:a==="left"&&(c||0),right:a==="right"&&(c||0),...f},m=I(a&&"fixed-cell",u&&`mdb-datatable-${u}`);return b.jsx("td",{contentEditable:i,className:m,style:p,children:d},r)})}),S8=({row:e,editable:t})=>b.jsx(b.Fragment,{children:e.map((n,i)=>b.jsx("td",{contentEditable:t,children:n},i))}),M8=({activeData:e,dataRows:t,isOnThePage:n,noFoundMessage:i,dataColumns:s,onRowClick:r,selectable:o,handleRowSelect:a,selectedRows:l,format:c,editable:u})=>{const{isLoading:d}=k.useContext(Tc),h=e.length,f=s.length,p=(m,v)=>{m.target.nodeName!=="INPUT"&&(r==null||r(v))};return b.jsxs(H3,{className:"datatable-body",children:[e.map((m,v)=>{const y=t.indexOf(m),g=l.includes(y),x=I(g&&"active",mw(m)&&m.rowSelector&&`mdb-datatable-${m.rowSelector}`);if(n(v))return b.jsxs("tr",{onClick:_=>p(_,m),className:x,style:{cursor:r&&"pointer"},children:[o&&b.jsx("td",{children:b.jsx(oh,{checked:g,onChange:()=>a(y)})}),x8(m)&&b.jsx(S8,{editable:u,row:m}),mw(m)&&E0(s)&&b.jsx(k8,{editable:u,row:m,dataColumns:s,format:c})]},v)}),!h&&!d&&b.jsx("tr",{className:"datatable-results-info",children:b.jsx("td",{colSpan:f,className:"text-center",children:i})})]})},C8=({dataColumns:e,dataRows:t,sort:n,searchValue:i,advancedSearch:s,advancedSearchValue:r})=>{const[o,a]=k.useState(t);return k.useEffect(()=>{const{column:l,option:c}=n,{phrase:u,columns:d}=r;let h;if(l){let f,p=0;E0(e)&&(f=e.find(m=>m.label===l)),LT(e)&&(p=e.indexOf(l)),h=v8(t,f?f.field:p,c)}i&&!s&&(h=pw(h||t,i,void 0)),u&&(h=pw(h||t,u,d)),a(h||t)},[n,t,e,i,s,r]),o},P8=Y.forwardRef(({advancedSearch:e,allText:t,className:n,bordered:i,borderless:s,borderColor:r="",color:o="",dark:a,entries:l=10,editable:c,entriesOptions:u,fixedHeader:d,fullPagination:h,hover:f,format:p,loaderClass:m="bg-primary",isLoading:v,loadingMessage:y="Loading results...",maxWidth:g="",maxHeight:x="",multi:_,noFoundMessage:w="No matching results found",pagination:S=!0,selectable:C,sortField:M="",searchInputProps:P,sortOrder:T="asc",sm:A,striped:E,rowsText:z,data:N={columns:[],rows:[]},search:L,onSelectRow:R,onRowClick:B,searchLabel:D,ofText:$,...F},V)=>{const[W,et]=k.useState(0),[Z,O]=k.useState(l),[U,lt]=k.useState({column:"",option:""}),[ct,kt]=k.useState([]),[it,Lt]=k.useState(""),[Ct,Qt]=k.useState({phrase:"",columns:""}),ft=C8({dataColumns:N.columns,dataRows:N.rows,sort:U,searchValue:it,advancedSearch:e,advancedSearchValue:Ct}),wt=I("datatable",f&&"datatable-hover",o&&`bg-${o}`,a&&"datatable-dark",i&&"datatable-bordered",s&&"datatable-borderless",r&&`border-${r}`,E&&"datatable-striped",A&&"datatable-sm",v&&"datatable-loading",n),dt=J=>W*Z<=J&&J<(W+1)*Z,jt=J=>{const{column:mt,option:q}=U;lt(mt===J?q==="asc"?{...U,option:"desc"}:{column:"",option:""}:{column:J,option:"asc"})},pt=J=>{const mt=J.currentTarget.checked,q=mt?Array.from({length:N.rows.length},(Dt,he)=>he):[],ye=q.map(Dt=>ft[Dt]);R==null||R(ye,q,mt),kt(q)},xt=J=>{const mt=ct.includes(J);let q;_?mt?q=ct.filter(he=>he!==J):q=[...ct,J]:mt?q=[]:q=[J];const ye=q.map(he=>ft[he]),Dt=q.length===N.rows.length;R==null||R(ye,q,Dt),kt(q)};return k.useEffect(()=>{M&<({column:M,option:T})},[M,T]),k.useEffect(()=>{et(0)},[it]),b.jsxs(Tc.Provider,{value:{isLoading:v,activePage:W,setActivePage:et,sort:U,fixedHeader:d,handleSort:jt},children:[b.jsx(b8,{search:L,advancedSearch:e,searchValue:it,setSearchValue:Lt,searchInputProps:P,label:D,setAdvancedSearchValue:Qt}),b.jsxs("div",{className:wt,ref:V,style:{maxWidth:g},...F,children:[b.jsx(k4,{className:"datatable-inner table-responsive ps",style:{overflow:"auto",position:"relative",maxWidth:g,maxHeight:x},children:b.jsxs(z3,{className:"datatable-table",children:[b.jsx(W3,{className:"datatable-header",children:b.jsxs("tr",{children:[C&&b.jsx("th",{className:d?"fixed-cell":"",children:_&&b.jsx(oh,{checked:ct.length===N.rows.length,onChange:pt})}),LT(N.columns)&&b.jsx(_8,{dataColumns:N.columns}),E0(N.columns)&&b.jsx(w8,{dataColumns:N.columns})]})}),b.jsx(M8,{activeData:ft,dataColumns:N.columns,dataRows:N.rows,isOnThePage:dt,onRowClick:B,format:p,handleRowSelect:xt,selectedRows:ct,selectable:C,noFoundMessage:w,editable:c})]})}),v&&b.jsxs(b.Fragment,{children:[b.jsx("div",{className:"datatable-loader bg-light}",children:b.jsx("span",{className:"datatable-loader-inner",children:b.jsx("span",{className:I("datatable-progress",m)})})}),b.jsx("p",{className:"text-center text-muted my-4",children:y})]}),S&&b.jsx(y8,{fullPagination:h,selectValue:Z,setSelectValue:O,activeDataLength:ft.length,rowsText:z,entriesOptions:u,fullDataLength:N.rows.length,allText:t,ofText:$})]})]})});P8.displayName="MDBDatatable";h0.register(...i3||[]);Y.createContext({activeItem:1,setActiveItem:null,prevActive:{current:1},setHeight:null,completed:[],noEditable:!1,isAnimating:{current:!1},linear:!1,formRef:{current:null},validate:{target:0,after:0},setValidate:null,type:"horizontal",stepsLength:0,onValid:void 0,onInvalid:void 0,mobileProgress:!1,disableHeadSteps:!1,animations:!0});Y.createContext({activeItem:0,dynamic:!1,dynamicStyle:{color:"",icon:""},setDynamicStyle:null,setActiveItem:null,hoveredItem:0,setHoveredItem:null,readonly:!1,onChange:void 0});const T8=Y.forwardRef(({backdrop:e=!0,backdropColor:t="black",backdropOpacity:n=.4,color:i,className:s,loadingText:r="Loading...",isOpen:o,fullScreen:a,overflow:l=!0,parentRef:c,spinnerElement:u=b.jsx(hT,{className:"loading-icon",role:"status"}),textClassName:d,textStyles:h,tag:f="div",...p},m)=>{const v=I("loading-text",d),y=I(a?"loading-full":"loading","loading-spinner",a?"position-fixed":"position-absolute",i&&`text-${i}`,s),g=I("loading-backdrop",!a&&"position-absolute");k.useEffect(()=>{const w=c==null?void 0:c.current;if(w)return w.classList.add("position-relative"),()=>{w.classList.remove("position-relative")}},[c]),k.useEffect(()=>{if(a&&l)return o?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}},[a,o,l]);const x=b.jsxs(f,{className:y,ref:m,...p,children:[u,b.jsx("span",{className:v,style:h,children:r})]}),_=b.jsx("div",{className:g,style:{opacity:n,backgroundColor:t}});return b.jsx(b.Fragment,{children:o!==!1&&b.jsx(b.Fragment,{children:a?b.jsxs(aa,{children:[x,_]}):b.jsxs(b.Fragment,{children:[x,e&&_]})})})});T8.displayName="MDBLoadingManagement";const D8=({isOpened:e,inputRef:t,dropdownEl:n,setOpenState:i,onClose:s})=>{const r=k.useCallback(o=>{if(!n)return;const a=t.current===o.target,l=n===o.target,c=n.contains(o.target);e&&!a&&!l&&!c&&(i(!1),s==null||s())},[e,i,n,t,s]);k.useEffect(()=>(document.addEventListener("click",r),()=>{document.removeEventListener("click",r)}),[r])},E8=({inputRef:e,dropdownEl:t})=>{const n=k.useCallback(()=>{if(!e.current||!t)return;const{width:i}=window.getComputedStyle(e.current);t.style.width=i},[t,e]);k.useEffect(()=>(n(),window.addEventListener("resize",n),()=>{window.removeEventListener("resize",n)}),[n])},A8=({isOpen:e})=>{const[t,n]=k.useState(!1);return k.useEffect(()=>{let i;return e?n(!0):i=setTimeout(()=>{n(!1)},100),()=>{clearTimeout(i)}},[e]),t},O8=({className:e,customContent:t=null,inputRef:n,isOpen:i,isOpened:s,children:r,setOpenState:o,listHeight:a="190px",onOpened:l,onClose:c,onClosed:u,...d})=>{const[h,f]=k.useState(null),[p,m]=k.useState(null),v=k.useMemo(()=>[{name:"matchReferenceWidth",enabled:!0,fn:({state:S,instance:C})=>{if(!p)return;const M=p.offsetWidth,P=S.rects.reference.width;Math.round(M)!==Math.round(P)&&(p.style.width=`${P}px`,C.update())},phase:"beforeWrite",requires:["computeStyles"]}],[p]),y=A8({isOpen:i}),{styles:g,attributes:x,update:_}=Oh(h,p,{modifiers:v}),w=I("autocomplete-dropdown",i&&"open",e);return D8({isOpened:s,setOpenState:o,dropdownEl:p,inputRef:n,onClose:c}),E8({inputRef:n,dropdownEl:p}),k.useEffect(()=>{n.current&&f(n.current)},[n]),k.useEffect(()=>{i&&(_==null||_())},[i,_,y]),b.jsx(b.Fragment,{children:b.jsx(aa,{children:b.jsx("div",{className:"autocomplete-dropdown-container",ref:m,...d,style:g.popper,...x.popper,onTransitionEnd:S=>{S.propertyName==="opacity"&&(y?l==null||l():u==null||u())},children:b.jsxs("div",{className:w,children:[b.jsx("ul",{className:"autocomplete-items-list",role:"listbox",style:{maxHeight:a,display:y?"block":"none"},children:r}),t]})})})})},L8=({className:e,isActive:t,children:n,onSelect:i,value:s,...r})=>{const o=I("autocomplete-item",t&&"active",e),a=k.useRef(null);return k.useEffect(()=>{!t||!a.current||a.current.scrollIntoView({block:"nearest"})},[t]),b.jsx("li",{className:o,onClick:()=>i(s),ref:a,...r,children:n})},R8=({isOpen:e,setOpenState:t,length:n})=>{const[i,s]=k.useState(-1),r=k.useCallback(o=>{const a=o.key==="Tab",l=o.key==="Escape",c=o.key==="ArrowUp",u=o.key==="ArrowDown",d=o.key==="Home",h=o.key==="End",f=o.key==="Enter",p=o.altKey,m=n-1;if(!e)return s(-1);if(l||f||a||p&&c)return t(!1);if(u){o.preventDefault(),s(v=>v===m?m:v+1);return}if(c){o.preventDefault(),s(v=>v===0?0:v-1);return}if(d&&i!==-1){o.preventDefault(),s(0);return}if(h&&i!==-1){o.preventDefault(),s(m);return}},[e,t,n,i]);return k.useEffect(()=>{s(-1)},[n]),k.useEffect(()=>(document.addEventListener("keydown",r),()=>{document.removeEventListener("keydown",r)}),[r]),i},N8=Y.forwardRef(({open:e,autoSelect:t,className:n,customContent:i,data:s=[],displayValue:r,value:o,isLoading:a,listHeight:l,noResults:c="No results found",itemContent:u,onSelect:d,onSearch:h,onChange:f,onClose:p,onClosed:m,onOpen:v,onOpened:y,...g},x)=>{const _=k.useRef(null),[w,S]=k.useState(!1),[C,M]=k.useState(!1),P=ef(w,e),[T,A]=k.useState(""),E=k.useMemo(()=>o!==void 0?o:T,[o,T]),z=R8({isOpen:P,setOpenState:S,length:s.length});k.useImperativeHandle(x,()=>_.current);const N=I(P&&"focused","autocomplete-input",n),L=I((P||E)&&"active","autocomplete-label"),R=()=>{S(!0),v==null||v(),_.current&&!_.current.value&&(h==null||h(""))},B=$=>r?r($):$,D=$=>{S(!1),_.current&&(_.current.value=$,h==null||h($),d==null||d($),f==null||f($),p==null||p(),A($))};return b.jsxs(b.Fragment,{children:[b.jsx(wi,{autoComplete:"off",onKeyDown:$=>{const F=$.key==="Enter",V=$.key==="Tab";if(!w)return S(!0);z!==-1&&(F||t&&V)&&D(B(s[z]))},onChange:$=>{h==null||h($.target.value),f==null||f($.target.value),A($.target.value)},onFocus:R,className:N,labelClass:L,ref:_,role:"combobox",value:E,...g,children:a&&b.jsx("div",{className:"autocomplete-loader spinner-border",children:b.jsx("span",{className:"sr-only",children:"Loading..."})})}),b.jsxs(O8,{isOpen:P,isOpened:C,inputRef:_,setOpenState:S,customContent:i,listHeight:l,onClose:p,onOpened:()=>{y==null||y(),M(!0)},onClosed:()=>{m==null||m(),M(!1)},children:[s.length===0&&b.jsx("li",{className:"autocomplete-item autocomplete-no-results",children:c}),s.map(($,F)=>b.jsx(L8,{isActive:z===F,value:B($),onSelect:D,children:u?u($):B($)},F))]})]})});N8.displayName="MDBAutocomplete";const j8=Y.forwardRef(({className:e,icon:t,tag:n="p",children:i,...s},r)=>{const o=I("popconfirm-message",e);return b.jsxs(n,{className:o,ref:r,...s,children:[t&&b.jsx("span",{className:"popconfirm-icon-container",children:t}),b.jsx("span",{className:"popconfirm-message-text",children:i})]})});j8.displayName="MDBPopconfirmMessage";const $8=Y.forwardRef(({className:e,tag:t="div",zoomLevel:n=1,fontAwesome:i="free",children:s,lightboxRef:r,onOpen:o,onClose:a,onSlide:l,onZoomIn:c,onZoomOut:u,disablePortal:d,...h},f)=>{const p=k.useRef(null),m=k.useRef(null),v=r||m,y=k.useRef(null),[g,x]=k.useState(!1),[_,w]=k.useState(0),[S,C]=k.useState(!1),[M,P]=k.useState([]),[T,A]=k.useState(""),[E,z]=k.useState(1),[N,L]=k.useState(!1),[R,B]=k.useState(),[D,$]=k.useState(!1),F=k.useRef(!1),V=k.useRef(!1),W=k.useRef(),et=k.useRef(),Z=k.useRef(),O=k.useRef(),U=k.useRef(),lt=k.useRef(),ct=k.useRef(),kt=I("lightbox",e),it=I(i==="pro"&&"fontawesome-pro"),Lt=I("lightbox-gallery-close-btn",i==="pro"&&"fontawesome-pro"),Ct=I("lightbox-gallery-fullscreen-btn",i==="pro"&&"fontawesome-pro",S&&"active"),Qt=I("lightbox-gallery-zoom-btn",i==="pro"&&"fontawesome-pro",E>1&&"active"),ft=k.useMemo(()=>document.documentElement.dir==="rtl",[]),wt=()=>{F.current=!0,setTimeout(()=>{F.current=!1},400)},dt=k.useCallback(j=>{let Q=j;return Q>M.length-1?Q=0:Q<0&&(Q=M.length-1),M[Q].classList.contains("lightbox-disabled")?dt(Q-1):Q},[M]),jt=k.useCallback(()=>{E>=3||(z(j=>j+n),c==null||c())},[c,E,n]),pt=k.useCallback(()=>{var j;const Q=(j=p.current)==null?void 0:j.querySelector(".lightbox-gallery-item.active");Q!=null&&Q.parentElement&&(Q.parentElement.style.left="0",Q.parentElement.style.top="0",Q.style.transition="all 0.5s ease-out",Q.style.left="0",Q.style.top="0",ls(Q),setTimeout(()=>{Q.style.transition="none"},500))},[]),xt=k.useCallback(()=>{E-n===1&&pt(),!(E<=1)&&(z(j=>j-n),u==null||u())},[u,pt,E,n]),J=k.useCallback(()=>{var j;p.current&&Array.from((j=p.current)==null?void 0:j.querySelectorAll(".lightbox-gallery-item")).forEach(Q=>{ls(Q)})},[]),mt=k.useCallback(()=>{S&&document.exitFullscreen&&document.exitFullscreen(),setTimeout(()=>{document.body.classList.remove("disabled-scroll"),document.body.classList.remove("replace-scrollbar")}),x(!1),z(1),L(!1),J(),a==null||a()},[J,S,a]),q=k.useCallback(j=>{if(F.current||M.length<=1)return _;let Q=0;switch(j){case"left":Q=_-1;break;case"right":Q=_+1;break;case"last":Q=M.length-1;break;case"first":Q=0;break}wt();const It=dt(Q);w(It),z(1),L(!1),setTimeout(()=>{var nt;const Tt=(nt=p.current)==null?void 0:nt.querySelector(".lightbox-gallery-item.active");J(),A(Tt.getAttribute("data-mdb-caption"))},300),l==null||l()},[_,J,M.length,l,dt]),ye=k.useCallback(j=>{if(g)switch(j.nativeEvent.key){case"ArrowRight":q(ft?"left":"right");break;case"ArrowLeft":q(ft?"right":"left");break;case"Escape":mt();break;case"Home":q("first");break;case"End":q("last");break;case"ArrowUp":jt();break;case"ArrowDown":xt();break}},[mt,q,jt,xt,g,ft]),Dt=k.useCallback(j=>{document.body.classList.add("disabled-scroll"),document.documentElement.scrollHeight>document.documentElement.clientHeight&&document.body.classList.add("replace-scrollbar"),x(!0),w(j),L(!1),J(),setTimeout(()=>{var Q;const It=(Q=p.current)==null?void 0:Q.querySelector(".lightbox-gallery-item.active");A(It.getAttribute("data-mdb-caption"))},0),o==null||o()},[J,o]);k.useImperativeHandle(f,()=>({outsideAccess(j){Dt(j)}}));const he=k.useCallback(()=>{(document.webkitIsFullScreen||document.mozFullScreen||document.msFullscreenElement)===void 0&&C(!1)},[]),Un=()=>{var j,Q,It;if(!S){(Q=(j=p.current)==null?void 0:j.requestFullscreen)==null||Q.call(j),C(!0);return}(It=document.exitFullscreen)==null||It.call(document),C(!1)},Yn=j=>{j.nativeEvent.preventDefault();const Q=j.nativeEvent instanceof TouchEvent?j.nativeEvent.touches[0]:j.nativeEvent,It=Q.clientX,nt=Q.clientY;j.nativeEvent instanceof TouchEvent&&j.type==="touchstart"&&j.nativeEvent.touches.length>1&&($(!0),B(j.nativeEvent.touches));const Tt=j.target;Z.current=parseFloat(Tt.style.left),O.current=parseFloat(Tt.style.top),W.current=parseFloat(Tt.style.left),et.current=parseFloat(Tt.style.top),U.current=It*(1/E)-W.current,lt.current=nt*(1/E)-et.current,L(!0)},Mn=j=>{if(j.type==="touchmove"&&j.nativeEvent instanceof TouchEvent&&j.nativeEvent.targetTouches.length>1&&(j.nativeEvent.preventDefault(),as(j)),!N||D)return;const Q=j.nativeEvent instanceof TouchEvent?j.nativeEvent.touches[0]:j.nativeEvent,It=Q.clientX,nt=Q.clientY,Tt=j.target;if(E!==1){W.current=It*(1/E)-U.current,et.current=nt*(1/E)-lt.current,Tt.style.left=`${W.current}px`,Tt.style.top=`${et.current}px`;return}M.length<=1||(W.current=It*(1/E)-U.current,Tt.style.left=`${W.current}px`)},Si=k.useCallback(()=>{if(!(E!==1||M.length<=1||!W.current||D)){if(W.current-(Z.current||0)>0){q(ft?"right":"left");return}q(ft?"left":"right")}},[q,D,ft,M.length,E]),dn=k.useCallback(j=>{D||(j.nativeEvent instanceof TouchEvent&&!j.nativeEvent.touches&&Xn(j),E!==1?xt():jt())},[jt,xt,D,E]),Mi=j=>{if(L(!1),j.nativeEvent instanceof MouseEvent){Si(),L(!1);return}if(D&&j.targetTouches.length===0){$(!1),B(void 0);return}L(!1),Si()},as=j=>{if(!R)return;const Q=Math.hypot(R[1].pageX-R[0].pageX,R[1].pageY-R[0].pageY),It=Math.hypot(j.nativeEvent.touches[1].pageX-j.nativeEvent.touches[0].pageX,j.nativeEvent.touches[1].pageY-j.nativeEvent.touches[0].pageY),nt=Math.abs(Q-It),Tt=j.nativeEvent.view.screen.width;nt<=Tt*.03||(Q<=It?jt():xt(),B(j.nativeEvent.touches))},ls=j=>{j.parentElement&&(j.width>=j.height?(j.style.width="100%",j.style.maxWidth="100%",j.style.height="auto",j.style.top=`${(j.parentElement.offsetHeight-j.height)/2}px`,j.style.left="0"):(j.style.height="100%",j.style.maxHeight="100%",j.style.width="auto",j.style.left=`${(j.parentElement.offsetWidth-j.width)/2}px`,j.style.top="0"),j.width>=j.parentElement.offsetWidth&&(j.style.width=`${j.parentElement.offsetWidth}px`,j.style.height="auto",j.style.left="0",j.style.top=`${(j.parentElement.offsetHeight-j.height)/2}px`),j.height>=j.parentElement.offsetHeight&&(j.style.height=`${j.parentElement.offsetHeight}px`,j.style.width="auto",j.style.top="0",j.style.left=`${(j.parentElement.offsetWidth-j.width)/2}px`),W.current=parseFloat(j.style.left)||0,et.current=parseFloat(j.style.top)||0)},Ci=j=>{const Q=j.getAttribute("data-mdb-img")?j.getAttribute("data-mdb-img"):j.getAttribute("src")?j.getAttribute("src"):"",It=j.getAttribute("alt")?j.getAttribute("alt"):j.getAttribute("data-mdb-caption")?j.getAttribute("data-mdb-caption"):"",nt=j.getAttribute("data-mdb-caption")?j.getAttribute("data-mdb-caption"):j.getAttribute("alt")?j.getAttribute("alt"):"";return{source:Q,alt:It,caption:nt}},Pi=k.useCallback(()=>{const j=[...v.current.querySelectorAll(".lightbox-item")].filter(Q=>!Q.classList.contains("lightbox-disabled"));P(j)},[v]),Ke=k.useCallback(()=>{J()},[J]),Xn=j=>{W.current=window.innerWidth/2-j.nativeEvent.offsetX-50,et.current=window.innerHeight/2-j.nativeEvent.offsetY-50;const Q=j.target;Q.style.left=`${W.current}px`,Q.style.top=`${et.current}px`,Q.style.transition="all 0.5s ease-out",setTimeout(()=>{Q.style.transition="none"},500)},Ti=j=>{if(j.deltaY>0)return xt();E>=3||(Xn(j),jt())};return k.useEffect(()=>{Pi()},[Pi]),k.useEffect(()=>{M.length&&J()},[J,M]),k.useEffect(()=>(M.forEach((j,Q)=>{!j.classList.contains("lightbox-disabled")&&j.addEventListener("click",()=>Dt(Q))}),()=>{M.forEach((j,Q)=>{j.removeEventListener("click",()=>Dt(Q))})}),[Dt,M]),k.useEffect(()=>(window.addEventListener("resize",Ke),window.addEventListener("fullscreenchange",he),()=>{window.removeEventListener("resize",Ke),window.removeEventListener("fullscreenchange",he)}),[he,Ke]),k.useEffect(()=>{const j=document.querySelector("meta[name=viewport]");if(ct.current||(ct.current=(j==null?void 0:j.getAttribute("content"))||""),!g){V.current=!1,j==null||j.setAttribute("content",ct.current);return}setTimeout(()=>{var Q;V.current=!0,(Q=y.current)==null||Q.focus(),j==null||j.setAttribute("content",`${ct.current} user-scalable=no`)},300)},[g]),b.jsxs(b.Fragment,{children:[b.jsx(t,{ref:v,className:kt,...h,children:s}),b.jsx(aa,{disablePortal:d,children:b.jsxs("div",{className:"lightbox-gallery",onClick:j=>j.target.tagName==="DIV"&&mt(),onKeyUp:ye,ref:p,style:{opacity:g?1:0,pointerEvents:g?"initial":"none",visibility:g?"visible":"hidden"},children:[b.jsx("div",{className:"lightbox-gallery-loader"}),b.jsxs("div",{className:"lightbox-gallery-toolbar",children:[b.jsx("div",{className:"lightbox-gallery-left-tools",children:b.jsx("p",{className:"lightbox-gallery-counter",children:`${_+1} / ${M.length}`})}),b.jsxs("div",{className:"lightbox-gallery-right-tools",children:[b.jsx("button",{className:Ct,onClick:Un}),b.jsx("button",{"aria-label":E>1?"Zoom out":"Zoom in",className:Qt,onClick:()=>E>1?xt():jt()}),b.jsx("button",{className:Lt,onClick:mt})]})]}),b.jsx("div",{className:"lightbox-gallery-content",style:{transform:g?"scale(1)":"scale(0.25)",transition:"all 0.5s ease-out"},children:M.map((j,Q)=>{const{source:It,alt:nt,caption:Tt}=Ci(j),Oe=Q===_?1:0,cs=Q===_?E:0,ai=_===M.length-1&&Q===0&&M.length>1,Kn=_===0&&Q===M.length-1&&M.length>1;let Me;return _Q&&!ai||Kn?Me="-100%":Me="0%",b.jsx("div",{className:"lightbox-gallery-image",style:{position:"absolute",opacity:Oe,left:g?Me:"0%",transform:`scale(${cs})`,transition:_===Q||V.current?"all 0.5s ease-out":"none"},children:b.jsx("img",{src:It||"",alt:nt||"","data-mdb-caption":Tt||"",onMouseDown:Yn,onMouseMove:Mn,onMouseUp:Mi,onWheel:Ti,onTouchStart:Yn,onTouchMove:Mn,onTouchEnd:Mi,onDoubleClick:dn,className:`lightbox-gallery-item ${_===Q&&"active"}`})},Q)})}),b.jsx("div",{className:"lightbox-gallery-arrow-left",children:b.jsx("button",{"aria-label":"Previous",className:it,onClick:()=>q("left")})}),b.jsx("div",{className:"lightbox-gallery-arrow-right",children:b.jsx("button",{"aria-label":"Next",className:it,onClick:()=>q("right"),ref:y})}),b.jsx("div",{className:"lightbox-gallery-caption-wrapper",children:b.jsx("p",{className:"lightbox-gallery-caption",children:T})})]})})]})});$8.displayName="MDBLightbox";const I8=Y.forwardRef(({className:e,fullscreenSrc:t,disabled:n,caption:i,...s},r)=>{const o=I("lightbox-item",n&&"lightbox-disabled",e);return b.jsx("img",{ref:r,"data-mdb-caption":i,"data-mdb-img":t,className:o,...s})});I8.displayName="MDBLightboxItem";const F8=Y.forwardRef(({className:e,...t},n)=>{const[i,s]=k.useState(!1),r=k.useCallback(()=>{const a=document.documentElement.scrollTop;s(!!a)},[]),o=I(i&&"navbar-scrolled","navbar-scroll",e);return k.useEffect(()=>{window.addEventListener("scroll",r)},[r]),b.jsx(pT,{className:o,ref:n,...t})});F8.displayName="MDBAnimatedNavbar";const RT=k.forwardRef(({className:e,closeIcon:t,tag:n="div",color:i,size:s,children:r,onDelete:o,...a},l)=>{const[c,u]=k.useState(!0),d=I("chip",s&&`chip-${s}`,i&&`chip-outline btn-outline-${i}`,e);return c?b.jsxs(n,{ref:l,className:d,...a,children:[r,t&&b.jsx("i",{className:"close fas fa-times",onClick:()=>{o==null||o(r),u(!1)}})]}):null});RT.displayName="MDBChip";const B8=Y.forwardRef(({className:e,value:t="",id:n,labelId:i,labelClass:s,label:r,onChange:o,labelRef:a,labelStyle:l,readonly:c,editable:u,onAdd:d,onDelete:h,initialValues:f=[],...p},m)=>{const v=k.useRef(null),y=a??v,g=k.useRef(null);k.useImperativeHandle(m,()=>g.current);const[x,_]=k.useState(f),[w,S]=k.useState(null),[C,M]=k.useState(0),[P,T]=k.useState(null),[A,E]=k.useState(t),z=x.length>0||A.length>0,N=I("form-outline","chips-input-wrapper",x.length>0&&"chips-padding chips-transition"),L=I("form-control",z&&"active",e),R=I("form-label",s);k.useEffect(()=>{!y.current||y.current.clientWidth===0||M(y.current.clientWidth*.8+8)},[y]);const B=()=>{y.current&&M(y.current.clientWidth*.8+8)},D=O=>{E(O.target.value),o==null||o(O)},$=O=>{A.length||((O.key==="ArrowLeft"||O.key==="ArrowDown")&&T(U=>U?U-1:x.length-1),(O.key==="ArrowRight"||O.key==="ArrowUp")&&T(U=>U===x.length-1||U===null?0:U+1),O.key==="Backspace"&&P!==null&&F(P)),O.key==="Enter"&&A.trim().length&&(d==null||d(A),_([...x,{tag:A}]),E(""))},F=O=>{const U=x.find((lt,ct)=>O===ct);if(U){h==null||h(U==null?void 0:U.tag);const lt=x.filter((ct,kt)=>O!==kt);_(lt),T(null)}},V=(O,U)=>{u&&S(U)},W=(O,U)=>{if(!u)return;const lt=O.currentTarget.textContent,ct=x.map((kt,it)=>it===U&<?{tag:lt}:kt);lt?_(ct):F(U),S(null),T(null)},et=(O,U)=>{O.key==="Enter"&&u&&w!==null&&W(O,U)},Z=()=>{A.trim().length&&(d==null||d(A),_([...x,{tag:A}]),E(""))};return b.jsx("div",{className:"chips chips-placeholder",children:b.jsxs("div",{className:N,children:[x.map((O,U)=>b.jsx(RT,{contentEditable:w===U,suppressContentEditableWarning:!0,onDoubleClick:lt=>V(lt,U),onDelete:()=>F(U),onKeyDown:lt=>et(lt,U),closeIcon:w!==U,className:I("btn",U===P&&"active"),children:O.tag},`${Math.random()}-${U}`)),b.jsx("input",{type:"text",readOnly:c,className:L,onChange:D,onFocus:B,onKeyDown:$,onBlur:()=>Z(),value:A,id:n,ref:g,...p}),r&&b.jsx("label",{className:R,style:l,id:i,htmlFor:n,ref:y,children:r}),b.jsxs("div",{className:"form-notch",children:[b.jsx("div",{className:"form-notch-leading"}),b.jsx("div",{className:"form-notch-middle",style:{width:C}}),b.jsx("div",{className:"form-notch-trailing"})]})]})})});B8.displayName="MDBChipsInput";function V8(){const[e,t]=k.useState(""),[n,i]=k.useState(""),[s,r]=k.useState(""),[o,a]=k.useState(null),[l,c]=k.useState(!1),[u,d]=k.useState([]),[h,f]=k.useState(!1),[p,m]=k.useState(null),[v,y]=k.useState(null),g=k.useRef(null);k.useEffect(()=>{if(l&&o&&o.plot_data&&g&&g.current){const M=g.current.getContext("2d");M&&new by(M,{type:"line",data:{labels:o.plot_data.n,datasets:[{label:"n^log_b(a)",data:o.plot_data.n_log_b_a,borderColor:"blue",borderWidth:1,fill:!1},{label:"f(n)",data:o.plot_data.f_n,borderColor:"red",borderWidth:2,fill:!1,borderDash:[5,5]},{label:"Time Complexity",data:o.plot_data.time_complexity,borderColor:"green",borderWidth:2,fill:!1,borderDash:[10,5]}]},options:{scales:{y:{beginAtZero:!0,title:{display:!0,text:"Function Value",color:"#888",font:{size:12}},ticks:{}},x:{grid:{display:!0},ticks:{callback:function(P){return Number(P).toFixed(0)}},title:{display:!0,text:"Input Size (n)",color:"#888",font:{size:12}}}},plugins:{legend:{display:!0,position:"top",labels:{boxWidth:20,padding:10}},tooltip:{enabled:!0}},elements:{line:{borderWidth:1},point:{radius:0}},responsive:!0,maintainAspectRatio:!1}})}},[l,o]),k.useEffect(()=>{(async()=>{try{const P=await fetch("http://master-theorem-aws-test2-dev.us-west-2.elasticbeanstalk.com/api/algorithms");if(!P.ok)throw new Error("Network response was not ok");const T=await P.json();d(T)}catch(P){console.error("Failed to fetch algorithms:",P)}})()},[]);const x=M=>{if(M===-1)f(!1),t(""),i(""),r(""),y(null);else{const P=u.find(T=>T.id===M);P&&(t(P.a.toString()),i(P.b.toString()),r(P.k.toString()),f(!0),y(P))}},_=async M=>{M.preventDefault(),await w(M)},w=async M=>{M.preventDefault(),c(!1),m(v);try{const P=await fetch("http://master-theorem-aws-test2-dev.us-west-2.elasticbeanstalk.com/api/evaluate/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({a:e,b:n,k:s})});if(!P.ok)throw new Error("Network response was not ok");const T=await P.json();a(T),c(!0)}catch(P){console.error("There was a problem with your fetch operation:",P)}},S=M=>{var P;if(Array.isArray(M))console.log("Multiple selections are not supported.");else{const T=parseInt(((P=M.value)==null?void 0:P.toString())||"-1",10);x(T)}},C=[{text:"User Input",value:"-1"},...u.map(M=>({text:M.name,value:M.id.toString()}))];return b.jsxs(b.Fragment,{children:[b.jsxs(rd,{alignment:"center",children:[b.jsx(od,{children:b.jsx("h1",{className:"main-header",children:"Evaluate Master Theorem"})}),b.jsxs(eg,{children:[b.jsx(fT,{children:b.jsx("span",{className:"card-title",children:"Enter the values of a, b, and k to evaluate the Master Theorem:"})}),b.jsxs("form",{onSubmit:_,children:[b.jsx(wi,{label:"a (number of subproblems)",id:"aInput",type:"number",min:"1",className:"my-4",value:e,onChange:M=>t(M.target.value),disabled:h}),b.jsx(wi,{label:"b (factor by which problem size is reduced)",id:"bInput",type:"number",min:"2",className:"my-4",value:n,onChange:M=>i(M.target.value),disabled:h}),b.jsx(wi,{label:"k (exponent in the work outside of recursive calls)",id:"kInput",type:"number",min:"0",className:"my-4",value:s,onChange:M=>r(M.target.value),disabled:h}),b.jsx("div",{className:"my-4",children:b.jsx(D0,{data:C,label:"Choose Algorithm or Enter Values",onChange:S})}),b.jsx(Zt,{onClick:w,className:"btn-block",children:"Evaluate"})]})]})]}),l&&o&&b.jsxs(rd,{className:"my-4",children:[b.jsx(od,{children:b.jsx("h2",{children:"Evaluation"})}),b.jsxs(eg,{className:"evaluation-card-body",children:[b.jsx("canvas",{ref:g,id:"myChart",className:"mb-3"}),b.jsxs(ad,{children:[b.jsx("strong",{children:"Recurrence Relation: "}),b.jsx("span",{dangerouslySetInnerHTML:{__html:o.recurrence_relation}})]}),b.jsxs(ad,{children:[b.jsx("strong",{children:"Evaluation: "}),b.jsx("span",{dangerouslySetInnerHTML:{__html:o.case}})]}),b.jsxs(ad,{children:[b.jsx("strong",{children:"Time Complexity: "}),b.jsx("span",{dangerouslySetInnerHTML:{__html:o.complexity}})]})]}),p&&b.jsxs(b.Fragment,{children:[b.jsxs("h4",{children:[p.name," Algorithm"]}),b.jsxs(ng,{alwaysOpen:!0,initialActive:1,children:[b.jsx(oo,{className:"left-align",collapseId:1,headerTitle:b.jsxs(b.Fragment,{children:[b.jsx(sn,{fas:!0,icon:"question-circle"}),"   Algorithm Description"]}),children:b.jsx("article",{children:p.description})}),b.jsx(oo,{collapseId:2,headerTitle:b.jsxs(b.Fragment,{children:[b.jsx(sn,{fab:!0,icon:"python"}),"   Python Code"]}),children:b.jsx("pre",{className:"left-align",children:b.jsx("code",{children:p.python_code})})})]})]})]}),b.jsxs(rd,{alignment:"center",className:"my-4",children:[b.jsx(od,{children:b.jsx("h2",{children:"About the Master Theorem"})}),b.jsxs(ng,{initialActive:1,children:[b.jsx(oo,{className:"left-align",collapseId:1,headerTitle:"What is the Master Theorem?",children:b.jsxs("article",{children:[b.jsxs("p",{children:["The ",b.jsx("strong",{children:"Master Theorem"})," offers a straightforward way to determine the time complexity of recursive algorithms, especially those that follow the divide and conquer approach. This theorem simplifies the process of analyzing how efficiently an algorithm runs as the size of its input increases. It is particularly useful for computer scientists and software engineers to predict algorithm performance without the need for detailed benchmarks."]}),b.jsx("p",{children:"The following parameters are required to evaluate an algorithm using the Master Theorem:"}),b.jsxs("ul",{children:[b.jsxs("li",{children:[b.jsx("strong",{children:"a"})," = the number of recursive subproblems."]}),b.jsxs("li",{children:[b.jsx("strong",{children:"b"})," = the factor by which the problem size is reduced."]}),b.jsxs("li",{children:[b.jsx("strong",{children:"k"})," = the exponent in the work done outside of the recursive function."]})]})]})}),b.jsx(oo,{className:"left-align",collapseId:2,headerTitle:"Decoding the Master Recurrence",children:b.jsxs("article",{children:[b.jsx("p",{children:"The Master Theorem can only be used to evaluate recursive algorithms with the following recurrence relation:"}),b.jsx("p",{className:"text-center",children:b.jsx("strong",{children:"T(n) = aT(n/b) + f(n)"})}),b.jsxs("p",{children:["This equation is the heart of the Master Theorem. and is called the ",b.jsx("strong",{children:"Master Recurrence"}),". It captures the essence of divide and conquer algorithms:"]}),b.jsxs("ul",{children:[b.jsxs("li",{children:[b.jsx("strong",{children:"T(n)"})," is the total time complexity we aim to find."]}),b.jsxs("li",{children:[b.jsx("strong",{children:"aT(n/b)"})," represents the time taken by the recursive subproblems."]}),b.jsxs("li",{children:[b.jsx("strong",{children:"f(n)"})," is the time taken by the work done outside the recursive calls, such as dividing the problem or combining the results."]})]}),b.jsx("p",{children:"Evaluating the Master Theorem involves comparing the rate of growth of two separate functions:"}),b.jsxs("ul",{children:[b.jsx("p",{className:"text-center",children:b.jsxs("strong",{children:["n",b.jsx("sup",{children:"logb(a)"})," + f(n)"]})}),b.jsxs("li",{children:[b.jsxs("strong",{children:["n",b.jsxs("sup",{children:["log",b.jsx("sub",{children:"b"}),"(a)"]})]})," ","is also known as the ",b.jsx("strong",{children:"watershed function."})]}),b.jsxs("li",{children:[b.jsx("strong",{children:"f(n)"})," is also known as the"," ",b.jsx("strong",{children:"driving function."})]})]}),b.jsx("p",{children:"Comparing the growth rate of these 2 functions results in either of 3 possible cases."})]})}),b.jsx(oo,{className:"left-align",collapseId:3,headerTitle:"The 3 Cases of the Master Theorem",children:b.jsxs("article",{children:[b.jsxs("p",{children:[b.jsx("strong",{children:"Case 1"}),": n",b.jsxs("sup",{children:["log",b.jsx("sub",{children:"b"}),"(a)"]})," ","grows asymptotically and polynomially greater than f(n):"]}),b.jsx("p",{className:"text-center",children:b.jsxs("strong",{children:["T(n) = n",b.jsxs("sup",{children:["log",b.jsx("sub",{children:"b"}),"(a)"]})]})}),b.jsxs("p",{children:[b.jsx("strong",{children:"Case 2:"})," n",b.jsxs("sup",{children:["log",b.jsx("sub",{children:"b"}),"(a)"]})," ","and f(n) grow at the same rate:"]}),b.jsx("p",{className:"text-center",children:b.jsxs("strong",{children:["T(n) = n",b.jsx("sup",{children:"k"})," log(n)"]})}),b.jsxs("p",{children:[b.jsx("strong",{children:"Case 3:"})," f(n) grows assymptotically and polynomially greater than n",b.jsxs("sup",{children:["log",b.jsx("sub",{children:"b"}),"(a)"]})," ","(and also fulfills the regularity condition",b.jsx("sup",{children:"*"}),") :"]}),b.jsx("p",{className:"text-center",children:b.jsxs("strong",{children:["T(n) = f(n",b.jsx("sup",{children:"k"}),")"]})}),b.jsxs("ul",{children:[b.jsxs("li",{children:[b.jsx("strong",{children:"Case 1"})," occurs when the split subproblems dominate the overall time complexity. It implies that as we break the problem down, the sheer number of subproblems is the primary driver of the complexity."]}),b.jsxs("li",{children:[b.jsx("strong",{children:"Case 2"})," occurs when the work done at each level of recursion is just as significant as the number of subproblems. This balance means the time complexity is a combination of the dividing/conquering work and the depth of the recursion."]}),b.jsxs("li",{children:[b.jsx("strong",{children:"Case 3"})," highlights scenarios where the work done outside the recursive calls (combining solutions, for instance) is the main factor determining the time complexity. This is typically seen in algorithms where merging or processing results is more intensive than breaking down the problem."]})]}),b.jsx("p",{children:b.jsxs("small",{children:[b.jsx("strong",{children:"*"})," Please note that this app evaluates n",b.jsxs("sup",{children:["log",b.jsx("sub",{children:"b"}),"(a)"]}),"and f(n",b.jsx("sup",{children:"k"}),") using their exponents and does not assess the regularity condition in Case 3, or whether the difference in growth between these two functions is polynomial. The regularity condition ensures that the work done at the recursive levels does not grow too quickly compared to the work done to divide the problem and combine the results. This condition helps maintain the integrity of the complexity analysis provided by the theorem."]})})]})})]})]})]})}Sp.createRoot(document.getElementById("root")).render(b.jsx(Y.StrictMode,{children:b.jsx(V8,{})})); + */function mi(e){return getComputedStyle(e)}function Ze(e,t){for(var n in t){var i=t[n];typeof i=="number"&&(i=i+"px"),e.style[n]=i}return e}function Eu(e){var t=document.createElement("div");return t.className=e,t}var W_=typeof Element<"u"&&(Element.prototype.matches||Element.prototype.webkitMatchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector);function Ts(e,t){if(!W_)throw new Error("No element matching method supported");return W_.call(e,t)}function Mo(e){e.remove?e.remove():e.parentNode&&e.parentNode.removeChild(e)}function H_(e,t){return Array.prototype.filter.call(e.children,function(n){return Ts(n,t)})}var pe={main:"ps",rtl:"ps__rtl",element:{thumb:function(e){return"ps__thumb-"+e},rail:function(e){return"ps__rail-"+e},consuming:"ps__child--consume"},state:{focus:"ps--focus",clicking:"ps--clicking",active:function(e){return"ps--active-"+e},scrolling:function(e){return"ps--scrolling-"+e}}},xT={x:null,y:null};function bT(e,t){var n=e.element.classList,i=pe.state.scrolling(t);n.contains(i)?clearTimeout(xT[t]):n.add(i)}function _T(e,t){xT[t]=setTimeout(function(){return e.isAlive&&e.element.classList.remove(pe.state.scrolling(t))},e.settings.scrollingThreshold)}function d4(e,t){bT(e,t),_T(e,t)}var Pc=function(e){this.element=e,this.handlers={}},wT={isEmpty:{configurable:!0}};Pc.prototype.bind=function(e,t){typeof this.handlers[e]>"u"&&(this.handlers[e]=[]),this.handlers[e].push(t),this.element.addEventListener(e,t,!1)};Pc.prototype.unbind=function(e,t){var n=this;this.handlers[e]=this.handlers[e].filter(function(i){return t&&i!==t?!0:(n.element.removeEventListener(e,i,!1),!1)})};Pc.prototype.unbindAll=function(){for(var e in this.handlers)this.unbind(e)};wT.isEmpty.get=function(){var e=this;return Object.keys(this.handlers).every(function(t){return e.handlers[t].length===0})};Object.defineProperties(Pc.prototype,wT);var la=function(){this.eventElements=[]};la.prototype.eventElement=function(e){var t=this.eventElements.filter(function(n){return n.element===e})[0];return t||(t=new Pc(e),this.eventElements.push(t)),t};la.prototype.bind=function(e,t,n){this.eventElement(e).bind(t,n)};la.prototype.unbind=function(e,t,n){var i=this.eventElement(e);i.unbind(t,n),i.isEmpty&&this.eventElements.splice(this.eventElements.indexOf(i),1)};la.prototype.unbindAll=function(){this.eventElements.forEach(function(e){return e.unbindAll()}),this.eventElements=[]};la.prototype.once=function(e,t,n){var i=this.eventElement(e),s=function(r){i.unbind(t,s),n(r)};i.bind(t,s)};function Au(e){if(typeof window.CustomEvent=="function")return new CustomEvent(e);var t=document.createEvent("CustomEvent");return t.initCustomEvent(e,!1,!1,void 0),t}function ah(e,t,n,i,s){i===void 0&&(i=!0),s===void 0&&(s=!1);var r;if(t==="top")r=["contentHeight","containerHeight","scrollTop","y","up","down"];else if(t==="left")r=["contentWidth","containerWidth","scrollLeft","x","left","right"];else throw new Error("A proper axis should be provided");h4(e,n,r,i,s)}function h4(e,t,n,i,s){var r=n[0],o=n[1],a=n[2],l=n[3],c=n[4],u=n[5];i===void 0&&(i=!0),s===void 0&&(s=!1);var d=e.element;e.reach[l]=null,d[a]<1&&(e.reach[l]="start"),d[a]>e[r]-e[o]-1&&(e.reach[l]="end"),t&&(d.dispatchEvent(Au("ps-scroll-"+l)),t<0?d.dispatchEvent(Au("ps-scroll-"+c)):t>0&&d.dispatchEvent(Au("ps-scroll-"+u)),i&&d4(e,l)),e.reach[l]&&(t||s)&&d.dispatchEvent(Au("ps-"+l+"-reach-"+e.reach[l]))}function Jt(e){return parseInt(e,10)||0}function f4(e){return Ts(e,"input,[contenteditable]")||Ts(e,"select,[contenteditable]")||Ts(e,"textarea,[contenteditable]")||Ts(e,"button,[contenteditable]")}function p4(e){var t=mi(e);return Jt(t.width)+Jt(t.paddingLeft)+Jt(t.paddingRight)+Jt(t.borderLeftWidth)+Jt(t.borderRightWidth)}var ao={isWebKit:typeof document<"u"&&"WebkitAppearance"in document.documentElement.style,supportsTouch:typeof window<"u"&&("ontouchstart"in window||"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>0||window.DocumentTouch&&document instanceof window.DocumentTouch),supportsIePointer:typeof navigator<"u"&&navigator.msMaxTouchPoints,isChrome:typeof navigator<"u"&&/Chrome/i.test(navigator&&navigator.userAgent)};function ss(e){var t=e.element,n=Math.floor(t.scrollTop),i=t.getBoundingClientRect();e.containerWidth=Math.round(i.width),e.containerHeight=Math.round(i.height),e.contentWidth=t.scrollWidth,e.contentHeight=t.scrollHeight,t.contains(e.scrollbarXRail)||(H_(t,pe.element.rail("x")).forEach(function(s){return Mo(s)}),t.appendChild(e.scrollbarXRail)),t.contains(e.scrollbarYRail)||(H_(t,pe.element.rail("y")).forEach(function(s){return Mo(s)}),t.appendChild(e.scrollbarYRail)),!e.settings.suppressScrollX&&e.containerWidth+e.settings.scrollXMarginOffset=e.railXWidth-e.scrollbarXWidth&&(e.scrollbarXLeft=e.railXWidth-e.scrollbarXWidth),e.scrollbarYTop>=e.railYHeight-e.scrollbarYHeight&&(e.scrollbarYTop=e.railYHeight-e.scrollbarYHeight),m4(t,e),e.scrollbarXActive?t.classList.add(pe.state.active("x")):(t.classList.remove(pe.state.active("x")),e.scrollbarXWidth=0,e.scrollbarXLeft=0,t.scrollLeft=e.isRtl===!0?e.contentWidth:0),e.scrollbarYActive?t.classList.add(pe.state.active("y")):(t.classList.remove(pe.state.active("y")),e.scrollbarYHeight=0,e.scrollbarYTop=0,t.scrollTop=0)}function U_(e,t){return e.settings.minScrollbarLength&&(t=Math.max(t,e.settings.minScrollbarLength)),e.settings.maxScrollbarLength&&(t=Math.min(t,e.settings.maxScrollbarLength)),t}function m4(e,t){var n={width:t.railXWidth},i=Math.floor(e.scrollTop);t.isRtl?n.left=t.negativeScrollAdjustment+e.scrollLeft+t.containerWidth-t.contentWidth:n.left=e.scrollLeft,t.isScrollbarXUsingBottom?n.bottom=t.scrollbarXBottom-i:n.top=t.scrollbarXTop+i,Ze(t.scrollbarXRail,n);var s={top:i,height:t.railYHeight};t.isScrollbarYUsingRight?t.isRtl?s.right=t.contentWidth-(t.negativeScrollAdjustment+e.scrollLeft)-t.scrollbarYRight-t.scrollbarYOuterWidth-9:s.right=t.scrollbarYRight-e.scrollLeft:t.isRtl?s.left=t.negativeScrollAdjustment+e.scrollLeft+t.containerWidth*2-t.contentWidth-t.scrollbarYLeft-t.scrollbarYOuterWidth:s.left=t.scrollbarYLeft+e.scrollLeft,Ze(t.scrollbarYRail,s),Ze(t.scrollbarX,{left:t.scrollbarXLeft,width:t.scrollbarXWidth-t.railBorderXWidth}),Ze(t.scrollbarY,{top:t.scrollbarYTop,height:t.scrollbarYHeight-t.railBorderYWidth})}function g4(e){e.element,e.event.bind(e.scrollbarY,"mousedown",function(t){return t.stopPropagation()}),e.event.bind(e.scrollbarYRail,"mousedown",function(t){var n=t.pageY-window.pageYOffset-e.scrollbarYRail.getBoundingClientRect().top,i=n>e.scrollbarYTop?1:-1;e.element.scrollTop+=i*e.containerHeight,ss(e),t.stopPropagation()}),e.event.bind(e.scrollbarX,"mousedown",function(t){return t.stopPropagation()}),e.event.bind(e.scrollbarXRail,"mousedown",function(t){var n=t.pageX-window.pageXOffset-e.scrollbarXRail.getBoundingClientRect().left,i=n>e.scrollbarXLeft?1:-1;e.element.scrollLeft+=i*e.containerWidth,ss(e),t.stopPropagation()})}function y4(e){Y_(e,["containerWidth","contentWidth","pageX","railXWidth","scrollbarX","scrollbarXWidth","scrollLeft","x","scrollbarXRail"]),Y_(e,["containerHeight","contentHeight","pageY","railYHeight","scrollbarY","scrollbarYHeight","scrollTop","y","scrollbarYRail"])}function Y_(e,t){var n=t[0],i=t[1],s=t[2],r=t[3],o=t[4],a=t[5],l=t[6],c=t[7],u=t[8],d=e.element,h=null,f=null,p=null;function m(g){g.touches&&g.touches[0]&&(g[s]=g.touches[0].pageY),d[l]=h+p*(g[s]-f),bT(e,c),ss(e),g.stopPropagation(),g.type.startsWith("touch")&&g.changedTouches.length>1&&g.preventDefault()}function v(){_T(e,c),e[u].classList.remove(pe.state.clicking),e.event.unbind(e.ownerDocument,"mousemove",m)}function y(g,x){h=d[l],x&&g.touches&&(g[s]=g.touches[0].pageY),f=g[s],p=(e[i]-e[n])/(e[r]-e[a]),x?e.event.bind(e.ownerDocument,"touchmove",m):(e.event.bind(e.ownerDocument,"mousemove",m),e.event.once(e.ownerDocument,"mouseup",v),g.preventDefault()),e[u].classList.add(pe.state.clicking),g.stopPropagation()}e.event.bind(e[o],"mousedown",function(g){y(g)}),e.event.bind(e[o],"touchstart",function(g){y(g,!0)})}function v4(e){var t=e.element,n=function(){return Ts(t,":hover")},i=function(){return Ts(e.scrollbarX,":focus")||Ts(e.scrollbarY,":focus")};function s(r,o){var a=Math.floor(t.scrollTop);if(r===0){if(!e.scrollbarYActive)return!1;if(a===0&&o>0||a>=e.contentHeight-e.containerHeight&&o<0)return!e.settings.wheelPropagation}var l=t.scrollLeft;if(o===0){if(!e.scrollbarXActive)return!1;if(l===0&&r<0||l>=e.contentWidth-e.containerWidth&&r>0)return!e.settings.wheelPropagation}return!0}e.event.bind(e.ownerDocument,"keydown",function(r){if(!(r.isDefaultPrevented&&r.isDefaultPrevented()||r.defaultPrevented)&&!(!n()&&!i())){var o=document.activeElement?document.activeElement:e.ownerDocument.activeElement;if(o){if(o.tagName==="IFRAME")o=o.contentDocument.activeElement;else for(;o.shadowRoot;)o=o.shadowRoot.activeElement;if(f4(o))return}var a=0,l=0;switch(r.which){case 37:r.metaKey?a=-e.contentWidth:r.altKey?a=-e.containerWidth:a=-30;break;case 38:r.metaKey?l=e.contentHeight:r.altKey?l=e.containerHeight:l=30;break;case 39:r.metaKey?a=e.contentWidth:r.altKey?a=e.containerWidth:a=30;break;case 40:r.metaKey?l=-e.contentHeight:r.altKey?l=-e.containerHeight:l=-30;break;case 32:r.shiftKey?l=e.containerHeight:l=-e.containerHeight;break;case 33:l=e.containerHeight;break;case 34:l=-e.containerHeight;break;case 36:l=e.contentHeight;break;case 35:l=-e.contentHeight;break;default:return}e.settings.suppressScrollX&&a!==0||e.settings.suppressScrollY&&l!==0||(t.scrollTop-=l,t.scrollLeft+=a,ss(e),s(a,l)&&r.preventDefault())}})}function x4(e){var t=e.element;function n(o,a){var l=Math.floor(t.scrollTop),c=t.scrollTop===0,u=l+t.offsetHeight===t.scrollHeight,d=t.scrollLeft===0,h=t.scrollLeft+t.offsetWidth===t.scrollWidth,f;return Math.abs(a)>Math.abs(o)?f=c||u:f=d||h,f?!e.settings.wheelPropagation:!0}function i(o){var a=o.deltaX,l=-1*o.deltaY;return(typeof a>"u"||typeof l>"u")&&(a=-1*o.wheelDeltaX/6,l=o.wheelDeltaY/6),o.deltaMode&&o.deltaMode===1&&(a*=10,l*=10),a!==a&&l!==l&&(a=0,l=o.wheelDelta),o.shiftKey?[-l,-a]:[a,l]}function s(o,a,l){if(!ao.isWebKit&&t.querySelector("select:focus"))return!0;if(!t.contains(o))return!1;for(var c=o;c&&c!==t;){if(c.classList.contains(pe.element.consuming))return!0;var u=mi(c);if(l&&u.overflowY.match(/(scroll|auto)/)){var d=c.scrollHeight-c.clientHeight;if(d>0&&(c.scrollTop>0&&l<0||c.scrollTop0))return!0}if(a&&u.overflowX.match(/(scroll|auto)/)){var h=c.scrollWidth-c.clientWidth;if(h>0&&(c.scrollLeft>0&&a<0||c.scrollLeft0))return!0}c=c.parentNode}return!1}function r(o){var a=i(o),l=a[0],c=a[1];if(!s(o.target,l,c)){var u=!1;e.settings.useBothWheelAxes?e.scrollbarYActive&&!e.scrollbarXActive?(c?t.scrollTop-=c*e.settings.wheelSpeed:t.scrollTop+=l*e.settings.wheelSpeed,u=!0):e.scrollbarXActive&&!e.scrollbarYActive&&(l?t.scrollLeft+=l*e.settings.wheelSpeed:t.scrollLeft-=c*e.settings.wheelSpeed,u=!0):(t.scrollTop-=c*e.settings.wheelSpeed,t.scrollLeft+=l*e.settings.wheelSpeed),ss(e),u=u||n(l,c),u&&!o.ctrlKey&&(o.stopPropagation(),o.preventDefault())}}typeof window.onwheel<"u"?e.event.bind(t,"wheel",r):typeof window.onmousewheel<"u"&&e.event.bind(t,"mousewheel",r)}function b4(e){if(!ao.supportsTouch&&!ao.supportsIePointer)return;var t=e.element;function n(p,m){var v=Math.floor(t.scrollTop),y=t.scrollLeft,g=Math.abs(p),x=Math.abs(m);if(x>g){if(m<0&&v===e.contentHeight-e.containerHeight||m>0&&v===0)return window.scrollY===0&&m>0&&ao.isChrome}else if(g>x&&(p<0&&y===e.contentWidth-e.containerWidth||p>0&&y===0))return!0;return!0}function i(p,m){t.scrollTop-=m,t.scrollLeft-=p,ss(e)}var s={},r=0,o={},a=null;function l(p){return p.targetTouches?p.targetTouches[0]:p}function c(p){return p.pointerType&&p.pointerType==="pen"&&p.buttons===0?!1:!!(p.targetTouches&&p.targetTouches.length===1||p.pointerType&&p.pointerType!=="mouse"&&p.pointerType!==p.MSPOINTER_TYPE_MOUSE)}function u(p){if(c(p)){var m=l(p);s.pageX=m.pageX,s.pageY=m.pageY,r=new Date().getTime(),a!==null&&clearInterval(a)}}function d(p,m,v){if(!t.contains(p))return!1;for(var y=p;y&&y!==t;){if(y.classList.contains(pe.element.consuming))return!0;var g=mi(y);if(v&&g.overflowY.match(/(scroll|auto)/)){var x=y.scrollHeight-y.clientHeight;if(x>0&&(y.scrollTop>0&&v<0||y.scrollTop0))return!0}if(m&&g.overflowX.match(/(scroll|auto)/)){var _=y.scrollWidth-y.clientWidth;if(_>0&&(y.scrollLeft>0&&m<0||y.scrollLeft<_&&m>0))return!0}y=y.parentNode}return!1}function h(p){if(c(p)){var m=l(p),v={pageX:m.pageX,pageY:m.pageY},y=v.pageX-s.pageX,g=v.pageY-s.pageY;if(d(p.target,y,g))return;i(y,g),s=v;var x=new Date().getTime(),_=x-r;_>0&&(o.x=y/_,o.y=g/_,r=x),n(y,g)&&p.preventDefault()}}function f(){e.settings.swipeEasing&&(clearInterval(a),a=setInterval(function(){if(e.isInitialized){clearInterval(a);return}if(!o.x&&!o.y){clearInterval(a);return}if(Math.abs(o.x)<.01&&Math.abs(o.y)<.01){clearInterval(a);return}if(!e.element){clearInterval(a);return}i(o.x*30,o.y*30),o.x*=.8,o.y*=.8},10))}ao.supportsTouch?(e.event.bind(t,"touchstart",u),e.event.bind(t,"touchmove",h),e.event.bind(t,"touchend",f)):ao.supportsIePointer&&(window.PointerEvent?(e.event.bind(t,"pointerdown",u),e.event.bind(t,"pointermove",h),e.event.bind(t,"pointerup",f)):window.MSPointerEvent&&(e.event.bind(t,"MSPointerDown",u),e.event.bind(t,"MSPointerMove",h),e.event.bind(t,"MSPointerUp",f)))}var _4=function(){return{handlers:["click-rail","drag-thumb","keyboard","wheel","touch"],maxScrollbarLength:null,minScrollbarLength:null,scrollingThreshold:1e3,scrollXMarginOffset:0,scrollYMarginOffset:0,suppressScrollX:!1,suppressScrollY:!1,swipeEasing:!0,useBothWheelAxes:!1,wheelPropagation:!0,wheelSpeed:1}},w4={"click-rail":g4,"drag-thumb":y4,keyboard:v4,wheel:x4,touch:b4},Tc=function(e,t){var n=this;if(t===void 0&&(t={}),typeof e=="string"&&(e=document.querySelector(e)),!e||!e.nodeName)throw new Error("no element is specified to initialize PerfectScrollbar");this.element=e,e.classList.add(pe.main),this.settings=_4();for(var i in t)this.settings[i]=t[i];this.containerWidth=null,this.containerHeight=null,this.contentWidth=null,this.contentHeight=null;var s=function(){return e.classList.add(pe.state.focus)},r=function(){return e.classList.remove(pe.state.focus)};this.isRtl=mi(e).direction==="rtl",this.isRtl===!0&&e.classList.add(pe.rtl),this.isNegativeScroll=function(){var l=e.scrollLeft,c=null;return e.scrollLeft=-1,c=e.scrollLeft<0,e.scrollLeft=l,c}(),this.negativeScrollAdjustment=this.isNegativeScroll?e.scrollWidth-e.clientWidth:0,this.event=new la,this.ownerDocument=e.ownerDocument||document,this.scrollbarXRail=Eu(pe.element.rail("x")),e.appendChild(this.scrollbarXRail),this.scrollbarX=Eu(pe.element.thumb("x")),this.scrollbarXRail.appendChild(this.scrollbarX),this.scrollbarX.setAttribute("tabindex",0),this.event.bind(this.scrollbarX,"focus",s),this.event.bind(this.scrollbarX,"blur",r),this.scrollbarXActive=null,this.scrollbarXWidth=null,this.scrollbarXLeft=null;var o=mi(this.scrollbarXRail);this.scrollbarXBottom=parseInt(o.bottom,10),isNaN(this.scrollbarXBottom)?(this.isScrollbarXUsingBottom=!1,this.scrollbarXTop=Jt(o.top)):this.isScrollbarXUsingBottom=!0,this.railBorderXWidth=Jt(o.borderLeftWidth)+Jt(o.borderRightWidth),Ze(this.scrollbarXRail,{display:"block"}),this.railXMarginWidth=Jt(o.marginLeft)+Jt(o.marginRight),Ze(this.scrollbarXRail,{display:""}),this.railXWidth=null,this.railXRatio=null,this.scrollbarYRail=Eu(pe.element.rail("y")),e.appendChild(this.scrollbarYRail),this.scrollbarY=Eu(pe.element.thumb("y")),this.scrollbarYRail.appendChild(this.scrollbarY),this.scrollbarY.setAttribute("tabindex",0),this.event.bind(this.scrollbarY,"focus",s),this.event.bind(this.scrollbarY,"blur",r),this.scrollbarYActive=null,this.scrollbarYHeight=null,this.scrollbarYTop=null;var a=mi(this.scrollbarYRail);this.scrollbarYRight=parseInt(a.right,10),isNaN(this.scrollbarYRight)?(this.isScrollbarYUsingRight=!1,this.scrollbarYLeft=Jt(a.left)):this.isScrollbarYUsingRight=!0,this.scrollbarYOuterWidth=this.isRtl?p4(this.scrollbarY):null,this.railBorderYWidth=Jt(a.borderTopWidth)+Jt(a.borderBottomWidth),Ze(this.scrollbarYRail,{display:"block"}),this.railYMarginHeight=Jt(a.marginTop)+Jt(a.marginBottom),Ze(this.scrollbarYRail,{display:""}),this.railYHeight=null,this.railYRatio=null,this.reach={x:e.scrollLeft<=0?"start":e.scrollLeft>=this.contentWidth-this.containerWidth?"end":null,y:e.scrollTop<=0?"start":e.scrollTop>=this.contentHeight-this.containerHeight?"end":null},this.isAlive=!0,this.settings.handlers.forEach(function(l){return w4[l](n)}),this.lastScrollTop=Math.floor(e.scrollTop),this.lastScrollLeft=e.scrollLeft,this.event.bind(this.element,"scroll",function(l){return n.onScroll(l)}),ss(this)};Tc.prototype.update=function(){this.isAlive&&(this.negativeScrollAdjustment=this.isNegativeScroll?this.element.scrollWidth-this.element.clientWidth:0,Ze(this.scrollbarXRail,{display:"block"}),Ze(this.scrollbarYRail,{display:"block"}),this.railXMarginWidth=Jt(mi(this.scrollbarXRail).marginLeft)+Jt(mi(this.scrollbarXRail).marginRight),this.railYMarginHeight=Jt(mi(this.scrollbarYRail).marginTop)+Jt(mi(this.scrollbarYRail).marginBottom),Ze(this.scrollbarXRail,{display:"none"}),Ze(this.scrollbarYRail,{display:"none"}),ss(this),ah(this,"top",0,!1,!0),ah(this,"left",0,!1,!0),Ze(this.scrollbarXRail,{display:""}),Ze(this.scrollbarYRail,{display:""}))};Tc.prototype.onScroll=function(e){this.isAlive&&(ss(this),ah(this,"top",this.element.scrollTop-this.lastScrollTop),ah(this,"left",this.element.scrollLeft-this.lastScrollLeft),this.lastScrollTop=Math.floor(this.element.scrollTop),this.lastScrollLeft=this.element.scrollLeft)};Tc.prototype.destroy=function(){this.isAlive&&(this.event.unbindAll(),Mo(this.scrollbarX),Mo(this.scrollbarY),Mo(this.scrollbarXRail),Mo(this.scrollbarYRail),this.removePsClasses(),this.element=null,this.scrollbarX=null,this.scrollbarY=null,this.scrollbarXRail=null,this.scrollbarYRail=null,this.isAlive=!1)};Tc.prototype.removePsClasses=function(){this.element.className=this.element.className.split(" ").filter(function(e){return!e.match(/^ps([-_].+|)$/)}).join(" ")};const k4=({className:e,sidenav:t,tag:n="div",handlers:i=["click-rail","drag-thumb","keyboard","wheel","touch"],wheelSpeed:s=1,wheelPropagation:r=!0,swipeEasing:o=!0,minScrollbarLength:a,maxScrollbarLength:l,scrollingThreshold:c=1e3,useBothWheelAxes:u=!1,suppressScrollX:d=!1,suppressScrollY:h=!1,scrollXMarginOffset:f=0,scrollYMarginOffset:p=0,scrollBarRef:m,onScrollY:v,onScrollX:y,onScrollUp:g,onScrollDown:x,onScrollLeft:_,onScrollRight:w,onYReachStart:S,onYReachEnd:C,onXReachStart:M,onXReachEnd:P,children:T,options:A,...E})=>{const z=I(t&&"sidenav-menu",e),N=k.useRef(null),R=k.useRef(null);return k.useEffect(()=>{let L=null;const B=[],D={handlers:i,wheelSpeed:s,wheelPropagation:r,swipeEasing:o,minScrollbarLength:a,maxScrollbarLength:l,scrollingThreshold:c,useBothWheelAxes:u,suppressScrollX:d,suppressScrollY:h,scrollXMarginOffset:f,scrollYMarginOffset:p,...A};if(!N.current)return;L=N.current,R.current=new Tc(L,D);const $={"ps-scroll-y":v,"ps-scroll-x":y,"ps-scroll-up":g,"ps-scroll-down":x,"ps-scroll-left":_,"ps-scroll-right":w,"ps-y-reach-start":S,"ps-y-reach-end":C,"ps-x-reach-start":M,"ps-x-reach-end":P};return Object.keys($).forEach(F=>{const V=$[F];if(typeof V=="function"&&L){const W=()=>V(L);B.push({eventName:F,handler:W}),L.addEventListener(F,W)}}),m&&m(R.current),()=>{var F;B.forEach(V=>{L==null||L.removeEventListener(V.eventName,V.handler)}),(F=R.current)==null||F.destroy(),R.current=null}},[i,s,r,o,a,l,c,u,d,h,f,p,m,v,y,g,x,_,w,S,C,M,P,A]),b.jsx(n,{className:z,ref:N,...E,children:T})},S4=Y.createContext({color:"primary"}),M4=Y.forwardRef(({className:e,children:t,...n},i)=>{const s=I("sidenav-menu",e);return b.jsx("ul",{className:s,ref:i,...n,children:t})});M4.displayName="MDBSideNavMenu";const C4=Y.forwardRef(({className:e,children:t,...n},i)=>{const s=I("sidenav-item",e);return b.jsx("li",{className:s,ref:i,...n,children:t})});C4.displayName="MDBSideNavItem";const P4=Y.forwardRef(({className:e,icon:t,iconClasses:n,iconAngle:i=180,shouldBeExpanded:s,children:r,active:o,tag:a="a",...l},c)=>{const{color:u}=k.useContext(S4),d=I("sidenav-link",o&&"active",e),h=I("rotate-icon",n),[f,p]=k.useState(s?i:0);return k.useEffect(()=>{p(s?i:0)},[s,i]),b.jsxs(v0,{rippleTag:a,onKeyDown:m=>{m.key==="Enter"&&m.target.click()},tabIndex:1,rippleColor:u,className:d,ref:c,...l,children:[r,t&&b.jsx(sn,{icon:t,style:{transform:`rotate(${f}deg)`},className:h})]})});P4.displayName="MDBSideNavLink";const kT=Y.forwardRef(({className:e,centered:t,children:n,size:i,scrollable:s,tag:r="div",...o},a)=>{const l=I("modal-dialog",s&&"modal-dialog-scrollable",t&&"modal-dialog-centered",i&&`modal-${i}`,e);return b.jsx(r,{className:l,...o,ref:a,children:n})});kT.displayName="MDBModalDialog";const T4=Y.forwardRef(({className:e,side:t,frame:n,position:i,children:s,tag:r="div",...o},a)=>{const l=I(t&&"modal-side",n&&"modal-frame",i&&`modal-${i}`,e);return b.jsx(kT,{className:l,...o,tag:r,ref:a,children:s})});T4.displayName="MDBModalDialog";const nf=Y.createContext({onDatetimepickerModeSwitch:()=>null,isInDatetimepicker:!1,setInputValue:null,setActiveHour:null,setActiveMinute:null,setPeriod:null,setMode:null,setHandAnimation:null,setMinuteAngle:null,setHourAngle:null,submitLabel:"",clearLabel:"",cancelLabel:"",activeHour:12,activeMinute:12,format:"12h",period:"",defaultValue:"",minHour:0,maxHour:23,minPeriod:"",maxPeriod:"",mode:"hours",handAnimation:!1,maxMinute:59,minMinute:0,minuteAngle:360,hourAngle:360,inline:!1,increment:!1,onChange:()=>null,onOpen:()=>null,onClose:()=>null,onCloseHandler:()=>null,amLabel:"AM",pmLabel:"PM",switchHoursToMinutesOnClick:!0,headId:"",bodyId:""}),ld=e=>{const t=e.split(":"),n=t[0],i=t[1].split(" ")[1],s=t[1].split(" ")[0];return{hour:parseInt(n),minute:parseInt(s),defaultPeriod:i}},X_=(e,t)=>(t==="24h"?/^([01]\d|2[0-3])(:[0-5]\d)$/:/^(0?[1-9]|1[012])(:[0-5]\d) [APap][mM]$/).test(e),Ki=(e,t,n,i,s,r)=>{let o=!1;return t&&(s!==""?e>t&&i===s&&(o=!0):e>t&&(o=!0)),n&&(r!==""?eKi(i,s,r,o,a,l)&&(n===t||n===e),D4=(e,t,n)=>{t.split(" ").forEach(i=>{e.addEventListener(i,n)})},E4=(e,t,n)=>{t.split(" ").forEach(i=>{e.removeEventListener(i,n)})},ST=(e,t)=>{const n=t.x-e.x,i=t.y-e.y;return Math.sqrt(n*n+i*i)},A4=(e,t)=>{const n=2*Math.atan2(t.y-e.y-ST(e,t),t.x-e.x);return Math.abs(n*180/Math.PI)},K_=e=>({radius:(e-32)/2-4}),O4=e=>{const t=new Date;let n=t.getHours();const i=t.getMinutes();if(e==="24h")return{hours:n,minutes:i,period:""};const s=n>=12?"PM":"AM";return n=n%12,n=n||12,{hours:n,minutes:i,period:s}},xp=(e,t)=>{const n=e.getMinutes();let i=e.getHours(),s;i===24&&(i=0);const r=i>=12?"PM":"AM";return t=="24h"?s=i<10?`0${i}:${n}`:`${i}:${n}`:t=="12h"&&(s=`${(i+24)%12||12}:${n} ${r}`),s},ig=Y.forwardRef(({...e},t)=>{const{activeHour:n,format:i,period:s,setPeriod:r,mode:o,setMode:a,activeMinute:l,setHandAnimation:c,inline:u,setActiveHour:d,setActiveMinute:h,maxHour:f,maxMinute:p,minHour:m,minMinute:v,maxPeriod:y,minPeriod:g,setInputValue:x,increment:_,submitLabel:w,onChange:S,onCloseHandler:C,amLabel:M,pmLabel:P,headId:T,show:A,onDatetimepickerModeSwitch:E,isInDatetimepicker:z}=k.useContext(nf),N=D=>{a(D),c(!0)},R=()=>{if(Ki(n,f,m,s,y,g)||Ki(l,p,v,s,y,g)||!A)return;C==null||C();const D=n===24?"00":n<10?`0${n}`:n,$=l<10?`0${l}`:l,F=`${D}:${$} ${s}`.trim();x(F),S==null||S(F)},L=(D,$)=>{const F=i==="12h"?12:24;if($.type==="click")return d(D?V=>V===F?1:V+1:V=>V===1?F:V-1);if($.type==="mousedown"){const V=setTimeout(()=>{const et=setInterval(()=>{d(D?O=>O===F?1:O+1:O=>O===1?F:O-1)},100),Z=()=>{clearInterval(et),document.removeEventListener("mouseup",Z)};document.addEventListener("mouseup",Z)},300),W=()=>{clearTimeout(V),document.removeEventListener("mouseup",W)};document.addEventListener("mouseup",W)}},B=(D,$)=>{const F=_?55:59,V=_?5:1;if($.type==="click")return h(D?W=>W>=F?0:W+V:W=>W-V<0?F:W-V);if($.type==="mousedown"){const W=setTimeout(()=>{const Z=setInterval(()=>{h(D?U=>U>=F?0:U+V:U=>U-V<0?F:U-V)},100),O=()=>{clearInterval(Z),document.removeEventListener("mouseup",O)};document.addEventListener("mouseup",O)},300),et=()=>{clearTimeout(W),document.removeEventListener("mouseup",et)};document.addEventListener("mouseup",et)}};return u?b.jsx("div",{id:T,className:"timepicker-head d-flex flex-row align-items-center justify-content-center timepicker-head-inline",style:{paddingRight:"0px"},ref:t,...e,children:b.jsxs("div",{className:"timepicker-head-content d-flex w-100 justify-content-evenly align-items-center",children:[b.jsxs("div",{className:"timepicker-current-wrapper",children:[b.jsxs("span",{className:"position-relative h-100 timepicker-inline-hour-icons",children:[b.jsx(sn,{fas:!0,icon:"chevron-up",style:{display:"flex"},className:"position-absolute text-white timepicker-icon-up timepicker-icon-inline-hour",onClick:D=>L(!0,D),onMouseDown:D=>L(!0,D)}),b.jsx(Zt,{type:"button",color:"none",onClick:()=>{N("hours")},className:`timepicker-current timepicker-current-inline timepicker-hour ${o==="hours"&&"active"}`,tabIndex:0,style:{pointerEvents:o==="hours"?"none":void 0},onFocus:()=>{N("hours")},children:n===24?"00":n<10?`0${n}`:n}),b.jsx(sn,{fas:!0,icon:"chevron-down",style:{display:"flex"},className:"position-absolute text-white timepicker-icon-down timepicker-icon-inline-hour",onClick:D=>L(!1,D),onMouseDown:D=>L(!1,D)})]}),b.jsx(Zt,{color:"none",className:"timepicker-dot timepicker-current-inline",disabled:!0,children:":"}),b.jsxs("span",{className:"position-relative h-100 timepicker-inline-minutes-icons",children:[b.jsx(sn,{fas:!0,icon:"chevron-up",style:{display:"flex"},className:"position-absolute text-white timepicker-icon-up timepicker-icon-inline-minute",onClick:D=>B(!0,D),onMouseDown:D=>B(!0,D)}),b.jsx(Zt,{onClick:()=>{N("minutes")},type:"button",color:"none",className:`timepicker-current timepicker-current-inline timepicker-minute ${o==="minutes"&&"active"}`,tabIndex:0,style:{pointerEvents:o==="minutes"?"none":void 0},onFocus:()=>{N("minutes")},children:l<10?`0${l}`:l}),b.jsx(sn,{fas:!0,icon:"chevron-down",style:{display:"flex"},className:"position-absolute text-white timepicker-icon-down timepicker-icon-inline-minute",onClick:D=>B(!1,D),onMouseDown:D=>B(!1,D)})]})]}),b.jsxs("div",{className:"d-flex justify-content-center timepicker-mode-wrapper",children:[i==="12h"&&b.jsxs(b.Fragment,{children:[b.jsx(Zt,{onClick:()=>r("AM"),type:"button",color:"none",className:`timepicker-hour-mode timepicker-am me-2 ms-4 ${s.toLowerCase()==="am"&&"active"}`,tabIndex:0,children:M}),b.jsx(Zt,{onClick:()=>r("PM"),type:"button",color:"none",className:`timepicker-hour-mode timepicker-pm ${s.toLowerCase()==="pm"&&"active"}`,tabIndex:0,children:P})]}),b.jsx(Zt,{type:"button",color:"none",className:"timepicker-button timepicker-submit timepicker-submit-inline py-1 px-2 mb-0",tabIndex:0,onClick:R,children:w})]})]})}):b.jsxs(b.Fragment,{children:[b.jsx("div",{id:T,className:"timepicker-head d-flex flex-row align-items-center justify-content-center",style:{paddingRight:"0px"},ref:t,...e,children:b.jsxs("div",{className:"timepicker-head-content d-flex w-100 justify-content-evenly",style:{paddingRight:i==="24h"?"50px":""},children:[b.jsxs("div",{className:"timepicker-current-wrapper",children:[b.jsx("span",{className:"position-relative h-100",children:b.jsx(Zt,{type:"button",color:"none",onClick:()=>{N("hours")},className:`timepicker-current timepicker-hour ${o==="hours"&&"active"}`,tabIndex:0,style:{pointerEvents:o==="hours"?"none":void 0},children:n===24?"00":n<10?`0${n}`:n})}),b.jsx(Zt,{color:"none",className:"timepicker-dot",disabled:!0,children:":"}),b.jsx("span",{className:"position-relative h-100",children:b.jsx(Zt,{onClick:()=>{N("minutes")},type:"button",color:"none",className:`timepicker-current timepicker-minute ${o==="minutes"&&"active"}`,tabIndex:0,style:{pointerEvents:o==="minutes"?"none":void 0},children:l<10?`0${l}`:l})})]}),i==="12h"&&b.jsxs("div",{className:"d-flex flex-column justify-content-center timepicker-mode-wrapper",children:[b.jsx(Zt,{onClick:()=>r("AM"),type:"button",color:"none",className:`timepicker-hour-mode timepicker-am ${s.toLowerCase()==="am"&&"active"}`,tabIndex:0,children:M}),b.jsx(Zt,{onClick:()=>r("PM"),type:"button",color:"none",className:`timepicker-hour-mode timepicker-pm ${s.toLowerCase()==="pm"&&"active"}`,tabIndex:0,children:P})]})]})}),z&&b.jsxs("div",{className:"buttons-container",children:[b.jsx("button",{type:"button",className:"datepicker-button-toggle",onClick:E,children:b.jsx("i",{className:"far fa-calendar datepicker-toggle-icon"})}),b.jsx("button",{type:"button",className:"timepicker-button-toggle",children:b.jsx("i",{className:"far fa-clock fa-sm timepicker-icon"})})]})]})});ig.displayName="MDBTimePickerHeader";const bp={hours:[{value:1,left:"169px",bottom:"209.263px",angle:30,id:`hour-1-${Math.floor(Math.random()*1001)}`},{value:2,left:"209.263px",bottom:"169px",angle:60,id:`hour-2-${Math.floor(Math.random()*1001)}`},{value:3,left:"224px",bottom:"114px",angle:90,id:`hour-3-${Math.floor(Math.random()*1001)}`},{value:4,left:"209.263px",bottom:"59px",angle:120,id:`hour-4-${Math.floor(Math.random()*1001)}`},{value:5,left:"169px",bottom:"18.7372px",angle:150,id:`hour-5-${Math.floor(Math.random()*1001)}`},{value:6,left:"114px",bottom:"4px",angle:180,id:`hour-6-${Math.floor(Math.random()*1001)}`},{value:7,left:"59px",bottom:"18.7372px",angle:210,id:`hour-7-${Math.floor(Math.random()*1001)}`},{value:8,left:"18.7372px",bottom:"59px",angle:240,id:`hour-8-${Math.floor(Math.random()*1001)}`},{value:9,left:"4px",bottom:"114px",angle:270,id:`hour-9-${Math.floor(Math.random()*1001)}`},{value:10,left:"18.7372px",bottom:"169px",angle:300,id:`hour-10-${Math.floor(Math.random()*1001)}`},{value:11,left:"59px",bottom:"209.263px",angle:330,id:`hour-11-${Math.floor(Math.random()*1001)}`},{value:12,left:"114px",bottom:"224px",angle:360,id:`hour-12-${Math.floor(Math.random()*1001)}`},{value:13,left:"94px",bottom:"115.962px",angle:30,id:`hour-13-${Math.floor(Math.random()*1001)}`},{value:14,left:"115.962px",bottom:"94px",angle:60,id:`hour-14-${Math.floor(Math.random()*1001)}`},{value:15,left:"124px",bottom:"64px",angle:90,id:`hour-15-${Math.floor(Math.random()*1001)}`},{value:16,left:"115.962px",bottom:"34px",angle:120,id:`hour-16-${Math.floor(Math.random()*1001)}`},{value:17,left:"94px",bottom:"12.0385px",angle:150,id:`hour-17-${Math.floor(Math.random()*1001)}`},{value:18,left:"64px",bottom:"4px",angle:180,id:`hour-18-${Math.floor(Math.random()*1001)}`},{value:19,left:"34px",bottom:"12.0385px",angle:210,id:`hour-19-${Math.floor(Math.random()*1001)}`},{value:20,left:"12.0385px",bottom:"34px",angle:240,id:`hour-20-${Math.floor(Math.random()*1001)}`},{value:21,left:"4px",bottom:"64px",angle:270,id:`hour-21-${Math.floor(Math.random()*1001)}`},{value:22,left:"12.0385px",bottom:"94px",angle:300,id:`hour-22-${Math.floor(Math.random()*1001)}`},{value:23,left:"34px",bottom:"115.962px",angle:330,id:`hour-23-${Math.floor(Math.random()*1001)}`},{value:24,left:"64px",bottom:"124px",angle:360,id:`hour-0-${Math.floor(Math.random()*1001)}`}],minutes:[{value:0,left:"114px",bottom:"224px",angle:360,id:`minute-0-${Math.floor(Math.random()*1001)}`},{value:5,left:"169px",bottom:"209.263px",angle:30,id:`minute-5-${Math.floor(Math.random()*1001)}`},{value:10,left:"209.263px",bottom:"169px",angle:60,id:`minute-10-${Math.floor(Math.random()*1001)}`},{value:15,left:"224px",bottom:"114px",angle:90,id:`minute-15-${Math.floor(Math.random()*1001)}`},{value:20,left:"209.263px",bottom:"59px",angle:120,id:`minute-20-${Math.floor(Math.random()*1001)}`},{value:25,left:"169px",bottom:"18.7372px",angle:150,id:`minute-25-${Math.floor(Math.random()*1001)}`},{value:30,left:"114px",bottom:"4px",angle:180,id:`minute-30-${Math.floor(Math.random()*1001)}`},{value:35,left:"59px",bottom:"18.7372px",angle:210,id:`minute-35-${Math.floor(Math.random()*1001)}`},{value:40,left:"18.7372px",bottom:"59px",angle:240,id:`minute-40-${Math.floor(Math.random()*1001)}`},{value:45,left:"4px",bottom:"114px",angle:270,id:`minute-45-${Math.floor(Math.random()*1001)}`},{value:50,left:"18.7372px",bottom:"169px",angle:300,id:`minute-50-${Math.floor(Math.random()*1001)}`},{value:55,left:"59px",bottom:"209.263px",angle:330,id:`minute-55-${Math.floor(Math.random()*1001)}`}]},MT=Y.forwardRef(({...e},t)=>{const n=k.useRef(null),i=k.useRef(null),[s,r]=k.useState(!1),[o,a]=k.useState(0),[l,c]=k.useState(0),{setActiveHour:u,format:d,activeHour:h,minHour:f,maxHour:p,minPeriod:m,maxPeriod:v,period:y,mode:g,setMode:x,activeMinute:_,setActiveMinute:w,setHandAnimation:S,handAnimation:C,maxMinute:M,minMinute:P,hourAngle:T,setHourAngle:A,minuteAngle:E,setMinuteAngle:z,increment:N,switchHoursToMinutesOnClick:R,bodyId:L}=k.useContext(nf),B=d==="24h"?bp.hours:bp.hours.filter(O=>O.value<13&&O.value!==0),D=bp.minutes,[$,F]=k.useState("calc(40% + 1px)"),V=k.useCallback(A4,[]),W=O=>{O.preventDefault(),r(!0)},et=O=>{O.preventDefault(),r(!1),g==="hours"&&(R&&x("minutes"),S(!0))},Z=k.useCallback(O=>{var U;const{width:lt,top:ct,left:kt}=(U=n.current)==null?void 0:U.getBoundingClientRect(),{clientX:it,clientY:Rt}="touches"in O?O.touches[0]:O,Ct={x:lt/2,y:-lt/2},Qt={x:it-kt,y:ct-Rt},ft=Math.round(V(Ct,Qt)+360)%360;if(g==="hours"){const wt=30*Math.round(ft/30);let dt=wt/30;if(d==="24h"){const{radius:jt}=K_(o),{radius:pt}=K_(l);ST(Ct,Qt)<(jt+pt)/2-16&&(dt+=12)}Ki(dt,p,f,y,v,m)||(u(dt),A(wt))}else if(ft===0)vp(f,p,h,0,M,P,y,v,m)||(w(0),z(360));else{const wt=N?30:6,dt=wt*Math.round(ft/wt);vp(f,p,h,dt/6,M,P,y,v,m)||(w(dt/6===60?0:dt/6),z(dt))}},[V,h,M,P,v,m,g,y,w,p,f,u,l,o,d,A,z,N]);return k.useEffect(()=>{n.current&&a(n.current.offsetWidth),i.current&&c(i.current.offsetWidth)},[]),k.useEffect(()=>(s&&D4(document,"mouseup mousemove mouseleave mouseover touchstart touchmove touchend",Z),()=>{E4(document,"mouseup mousemove mouseleave mouseover touchstart touchmove touchend",Z)}),[s,Z]),k.useEffect(()=>{const O=B.find(U=>U.value===h);O!==void 0&&(O.value>12||O.value===24?F("21.5%"):F("calc(40% + 1px)"))},[B,h]),b.jsx("div",{id:L,className:"timepicker-clock-wrapper d-flex justify-content-center flex-column align-items-center",ref:t,...e,children:b.jsxs("div",{onMouseDown:O=>W(O),onMouseUp:O=>et(O),ref:n,className:"timepicker-clock timepicker-clock-animation",children:[b.jsx("span",{className:"timepicker-middle-dot position-absolute"}),b.jsx("div",{className:`timepicker-hand-pointer position-absolute ${C&&"timepicker-transform"}`,style:{transform:`rotateZ(${g==="hours"?T:E}deg)`,height:g==="hours"?$:"calc(40% + 1px)"},children:b.jsx("div",{className:"timepicker-circle position-absolute",style:{backgroundColor:"rgb(25, 118, 210)"}})}),g==="hours"&&d==="24h"&&b.jsx("div",{ref:i,className:"timepicker-clock-inner",children:B.map(O=>{if(O.value>12||O.value===0)return b.jsx("span",{id:O.id,className:`timepicker-time-tips-inner ${Ki(O.value,p,f,y,v,m)&&"disabled"} ${O.value===h&&"active"}`,style:{left:O.left,bottom:O.bottom},children:b.jsx("span",{className:"timepicker-tips-inner-element",children:O.value===24?"00":O.value})},O.id)})}),g==="hours"&&B.map(O=>{if(d==="24h"){if(O.value<13&&O.value!==0)return b.jsx("span",{id:O.id,className:`timepicker-time-tips-hours ${Ki(O.value,p,f,y,v,m)&&"disabled"} ${O.value===h&&"active"}`,style:{left:O.left,bottom:O.bottom},children:b.jsx("span",{className:"timepicker-tips-element",children:O.value})},O.id)}else return b.jsx("span",{id:O.id,className:`timepicker-time-tips-hours ${Ki(O.value,p,f,y,v,m)&&"disabled"} ${O.value===h&&"active"}`,style:{left:O.left,bottom:O.bottom},children:b.jsx("span",{className:"timepicker-tips-element",children:O.value})},O.id)}),g==="minutes"&&D.map(O=>b.jsx("span",{id:O.id,className:`timepicker-time-tips-minutes ${vp(f,p,h,O.value,M,P,y,v,m)&&"disabled"} ${_===O.value&&"active"}`,style:{left:O.left,bottom:O.bottom},children:b.jsx("span",{className:"timepicker-tips-element",children:O.value<10?`0${O.value}`:O.value})},O.id))]})})});MT.displayName="MDBTimePickerClock";const CT=Y.forwardRef(({...e},t)=>{const{setInputValue:n,cancelLabel:i,submitLabel:s,clearLabel:r,activeHour:o,period:a,activeMinute:l,maxHour:c,maxMinute:u,minHour:d,minMinute:h,maxPeriod:f,minPeriod:p,defaultValue:m,setActiveHour:v,setActiveMinute:y,setPeriod:g,format:x,setHourAngle:_,setMinuteAngle:w,onChange:S,onCloseHandler:C,setMode:M}=k.useContext(nf);return b.jsx("div",{className:"timepicker-footer",ref:t,...e,children:b.jsxs("div",{className:"w-100 d-flex justify-content-between",children:[b.jsx(Zt,{onClick:()=>{if(m!==""&&m!==void 0){const{hour:P,minute:T,defaultPeriod:A}=ld(m);x==="24h"?(v(P===0?24:P),P===0?_(360):P>12?_((P-12)*30):_(P*30)):(v(P),_(P*30),g(A)),y(T),w(T*6),n(m),S==null||S(m)}else v(12),_(360),y(0),w(360),n(""),S==null||S(""),g(x==="24h"?"":"AM");M("hours")},type:"button",color:"none",className:"timepicker-button timepicker-clear",tabIndex:0,children:r}),b.jsx(Zt,{onClick:()=>C==null?void 0:C(),type:"button",color:"none",className:"timepicker-button timepicker-cancel",tabIndex:0,children:i}),b.jsx(Zt,{onClick:()=>{if(Ki(o,c,d,a,f,p)||Ki(l,u,h,a,f,p))return;C==null||C();const P=o===24?"00":o<10?`0${o}`:o,T=l<10?`0${l}`:l,A=`${P}:${T} ${a}`.trim();n(A),S==null||S(A)},type:"button",color:"none",className:"timepicker-button timepicker-submit",tabIndex:0,children:s})]})})});CT.displayName="MDBTimePickerFooter";const R4=({isOpen:e,inline:t})=>{k.useEffect(()=>{if(t)return;const n=window.innerWidth>document.documentElement.clientWidth&&window.innerWidth>=576,i=`${window.innerWidth-document.documentElement.clientWidth}px`;return e&&n?(document.body.style.overflow="hidden",document.body.style.paddingRight=i):(document.body.style.overflow="",document.body.style.paddingRight=""),()=>{document.body.style.overflow="",document.body.style.paddingRight=""}},[e,t])},L4=({className:e,isOpen:t,wrapperRef:n,inline:i,referenceElement:s,onOpened:r,onClosed:o})=>{const[a,l]=k.useState(null),c=I("timepicker-modal",!i&&"position-fixed",e),u=I("timepicker-wrapper","animation","h-100","d-flex","align-items-center","justify-content-center","flex-column",i?"timepicker-wrapper-inline":"position-fixed","fade",t&&"show"),{styles:d,attributes:h}=Oh(s,a,{placement:"bottom-start"}),f=p=>{p.opacity===0?o():r()};return R4({isOpen:t,inline:i}),b.jsx(b.Fragment,{children:b.jsx(aa,{children:b.jsx(Zy,{children:t&&(i?b.jsx(Jo.div,{className:c,style:d.popper,...h.popper,role:"dialog",ref:l,tabIndex:-1,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onAnimationComplete:p=>f(p),children:b.jsx("div",{ref:n,className:u,children:b.jsx("div",{className:"d-flex align-items-center justify-content-center flex-column shadow timepicker-container",style:{overflowY:"inherit"},children:b.jsx("div",{className:"d-flex flex-column timepicker-elements justify-content-around timepicker-elements-inline",children:b.jsx(ig,{})})})})}):b.jsx(Jo.div,{className:c,role:"dialog",tabIndex:-1,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},onAnimationComplete:p=>f(p),children:b.jsx("div",{ref:n,className:u,children:b.jsxs("div",{className:"d-flex align-items-center justify-content-center flex-column shadow timepicker-container",children:[b.jsxs("div",{className:"d-flex flex-column timepicker-elements justify-content-around",children:[b.jsx(ig,{}),b.jsx(MT,{})]}),b.jsx(CT,{})]})})}))})})})},G_=(e,t,n,i,s)=>{const r=n?55:59,o=n?5:1;let a;s?a=i>=r?0:i+o:a=i<=0?r:i-o,e(a),t(a*6)},Ou=(e,t,n,i,s,r)=>{if(r&&e==="24h"){let l=t;r==="isLeft"&&(l=t<=12?t+12:t),r==="isRight"&&(l=t>12?t-12:t),n(l),i(l*30);return}const o=e==="12h"?12:24;let a=t===1?o:t-1;s?a=t===o?1:t+1:a=t===1?o:t-1,n(a),i(a*30)},q_=(e,t,n)=>{const i=n==null?void 0:n.querySelectorAll('[tabindex="0"]');i&&i[t]&&(i[t].focus(),t===i.length-1?e(0):e(t+1))},N4=(e,t,n,i,s,r)=>{var o;!t&&e.target===n&&r&&(r==null||r()),t&&e.target!==n&&!(n!=null&&n.contains(e.target))&&e.target!==(i==null?void 0:i.parentNode)&&!((o=i==null?void 0:i.parentNode)!=null&&o.contains(e.target))&&s&&(r==null||r())},Q_="ArrowLeft",Z_="ArrowUp",J_="ArrowRight",tw="ArrowDown",ew="Enter",nw="Escape",iw="Tab",PT=k.forwardRef(({isInDatetimepicker:e,onDatetimepickerModeSwitch:t,datetimepickerRef:n,className:i,defaultValue:s,value:r,minHour:o,maxHour:a,maxTime:l,minTime:c,noIcon:u=!1,inputID:d,justInput:h=!1,inputClasses:f,inputLabel:p,invalidLabel:m,clearLabel:v,submitLabel:y,cancelLabel:g,format:x="12h",timePickerClasses:_,customIcon:w="far fa-clock",customIconSize:S="sm",btnIcon:C=!0,inline:M=!1,increment:P=!1,onChange:T,inputStyle:A,onOpen:E,onOpened:z,onClose:N,onClosed:R,disableFuture:L,disablePast:B,disabled:D=!1,amLabel:$="AM",pmLabel:F="PM",switchHoursToMinutesOnClick:V=!0,headId:W="",bodyId:et="",open:Z,style:O,...U},lt)=>{const ct=k.useMemo(()=>s instanceof Date?xp(s,x):s,[]),kt=k.useMemo(()=>r instanceof Date?xp(r,x):r,[r,x]),[it,Rt]=k.useState(!1),[Ct,Qt]=k.useState(!1),ft=ef(Ct,Z),[wt,dt]=k.useState(kt||ct||""),[jt,pt]=k.useState(!1),[xt,J]=k.useState(12),[mt,q]=k.useState(0),[ye,Dt]=k.useState(x==="24h"?"":"AM"),[he,Un]=k.useState(a||24),[Yn,Mn]=k.useState(o||1),[Si,dn]=k.useState(59),[Mi,as]=k.useState(0),[ls,Ci]=k.useState(""),[Pi,Ke]=k.useState(""),[Xn,Ti]=k.useState("hours"),[j,Q]=k.useState(!1),[It,nt]=k.useState(360),[Tt,Oe]=k.useState(360),[cs,ai]=k.useState(null),[Kn,Me]=k.useState(0);s instanceof Date&&(s=xp(s,x));const Kr=k.useId(),Gr=d??Kr,Cn={input:p??"Select a time",invalid:m??"Invalid Time Format",clear:v??"Clear",submit:y??"Ok",cancel:g??"Cancel"},ca=I("timepicker",i),Ec=I("timepicker-input",jt&&"is-invalid",f),sf=k.useRef(null),G=k.useRef(null),X=k.useRef(null),rt=k.useRef(null);k.useImperativeHandle(lt,()=>rt.current,[rt]);const ht=Lt=>{dt(Lt.target.value),T==null||T(Lt.target.value)},hn=Lt=>{h&&(Lt.target.blur(),E==null||E())},us=k.useCallback(()=>{Qt(!1),N==null||N()},[N]),Ge=k.useCallback(()=>{Qt(!0),E==null||E()},[E]),fn=k.useCallback(()=>{Rt(!1),R==null||R(),Ti("hours"),Me(0)},[R]),NT=k.useCallback(()=>{Rt(!0),z==null||z()},[z]),rf=k.useCallback(Lt=>{it&&N4(Lt,M,X.current,rt.current,ft,us)},[X,M,rt,ft,us,it]),of=k.useCallback(Lt=>{var Pn,pn;const{key:A0}=Lt,ua=document.activeElement,jT=ua===((Pn=X.current)==null?void 0:Pn.querySelector(".timepicker-hour")),$T=ua===((pn=X.current)==null?void 0:pn.querySelector(".timepicker-minute")),IT=ua==null?void 0:ua.closest('.timepicker-modal [tabindex="0"]');if(![tw,Z_,nw,iw,ew,Q_,J_].includes(A0))return;M&&!IT&&q_(Me,0,X.current),Lt.preventDefault();const Ac=!M&&Xn==="hours"||M&&jT,O0=!M&&Xn==="minutes"||M&&$T;switch(A0){case nw:return N==null?void 0:N();case Z_:if(Ac)return Ou(x,xt,J,nt,!0);if(O0)return G_(q,Oe,P,mt,!0);break;case tw:if(Ac)return Ou(x,xt,J,nt,!1);if(O0)return G_(q,Oe,P,mt,!1);break;case Q_:if(Ac&&!M)return Ou(x,xt,J,nt,!1,"isLeft");break;case J_:if(Ac&&!M)return Ou(x,xt,J,nt,!0,"isRight");break;case iw:q_(Me,Kn,X.current);break;case ew:ua.click();break}},[xt,x,Xn,mt,P,M,Kn,N]);return k.useEffect(()=>{if(!B&&!L)return;const{hours:Lt,minutes:Pn,period:pn}=O4(x);if(B)return Mn(Lt),as(Pn),Ci(pn);if(L)return Un(Lt),dn(Pn),Ke(pn)},[L,B,x]),k.useEffect(()=>(ft&&it&&(document.addEventListener("click",rf),document.addEventListener("keydown",of)),()=>{document.removeEventListener("click",rf),document.removeEventListener("keydown",of)}),[ft,it,rf,of]),k.useEffect(()=>{if(l){const{hour:Lt,minute:Pn,defaultPeriod:pn}=ld(l);Un(Lt),dn(Pn),pn!==void 0&&Ke(pn)}if(c){const{hour:Lt,minute:Pn,defaultPeriod:pn}=ld(c);Mn(Lt),as(Pn),pn!==void 0&&Ci(pn)}},[l,c]),k.useEffect(()=>{typeof r=="string"&&r&&X_(r,x)&&dt(r)},[r,x]),k.useEffect(()=>{if(X_(wt,x)||wt===""){if(pt(!1),wt!==""){const{hour:Lt,minute:Pn,defaultPeriod:pn}=ld(wt);x==="24h"?(J(Lt===0?24:Lt),Lt===0?nt(360):Lt>12?nt((Lt-12)*30):nt(Lt*30)):(J(Lt),nt(Lt*30),Dt(pn)),q(Pn),Oe(Pn*6)}}else pt(!0)},[wt,x]),k.useEffect(()=>{let Lt;return j&&(Lt=setTimeout(()=>{Q(!1)},400)),()=>{clearTimeout(Lt)}},[j]),b.jsx(b.Fragment,{children:b.jsx(nf.Provider,{value:{isInDatetimepicker:e,onDatetimepickerModeSwitch:t,show:ft,setInputValue:dt,submitLabel:Cn.submit,clearLabel:Cn.clear,cancelLabel:Cn.cancel,activeHour:xt,activeMinute:mt,setActiveHour:J,setActiveMinute:q,format:x,period:ye,setPeriod:Dt,defaultValue:s,maxHour:he,minHour:Yn,maxPeriod:Pi,minPeriod:ls,mode:Xn,setMode:Ti,setHandAnimation:Q,handAnimation:j,minMinute:Mi,maxMinute:Si,hourAngle:It,setHourAngle:nt,minuteAngle:Tt,setMinuteAngle:Oe,inline:M,increment:P,onChange:T,onOpen:E,onClose:N,onCloseHandler:us,amLabel:$,pmLabel:F,switchHoursToMinutesOnClick:V,headId:W,bodyId:et},children:b.jsxs(b.Fragment,{children:[b.jsx("div",{className:ca,ref:M?ai:sf,style:{...O,height:"fit-content"},...U,children:!e&&b.jsx(wi,{onFocus:hn,ref:rt,labelRef:G,className:Ec,label:Cn.input,id:Gr,value:wt,onChange:ht,wrapperClass:"timepicker",style:A,disabled:D,onClick:()=>{h&&Ge()},children:!h&&!u&&(C?b.jsx(Zt,{className:"timepicker-toggle-button",onClick:Ge,color:"none",tabIndex:0,type:"button",disabled:D,style:{pointerEvents:D?"none":"auto"},children:b.jsx("i",{className:`${w} ${S} timepicker-icon`})}):b.jsx("i",{onClick:Ge,className:`${w} ${S} timepicker-icon timepicker-toggle-button`}))})}),b.jsx(L4,{isOpen:ft,wrapperRef:X,referenceElement:n||cs,inline:M,className:_,onClosed:fn,onOpened:NT})]})})})});PT.displayName="MDBTimepicker";const j4=({className:e,dropdown:t,children:n,styles:i,attributes:s,setPopperElement:r,style:o,onClosed:a,onOpened:l})=>{const c={initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3}},u=I("datepicker-dropdown-container",e),d=I("datepicker-modal-container",e),h=f=>{f.opacity===0?a==null||a():l==null||l()};return b.jsx(b.Fragment,{children:t?b.jsx(Jo.div,{style:{position:"absolute",zIndex:1065,...i.popper},...s.popper,ref:r,className:u,tabIndex:-1,...c,onAnimationComplete:f=>h(f),children:n}):b.jsx(Jo.div,{...c,className:d,style:o,onAnimationComplete:f=>h(f),children:n})})},Ce={closeOnEsc:!0,title:"Select date",okBtnText:"Ok",clearBtnText:"Clear",cancelBtnText:"Cancel",customIcon:"far fa-calendar",customHeader:"",inputLabel:"Select a date",monthsFull:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],views:"days",format:"dd/mm/yyyy",weekdaysFull:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],weekdaysNarrow:["S","M","T","W","T","F","S"],startDay:0};function Te(e){return e.getDate()}function sw(e){return e.getDay()}function Pt(e){return e.getMonth()}function ot(e){return e.getFullYear()}function $4(e,t,n){const i=n,s=i>0?7-i:0,r=new Date(e,t).getDay()+s;return r>=7?r-7:r}function I4(e){return e.getDate()===oc(e)}function sg(e){return I4(e)?oc(new Date(ot(e),Pt(e)+1,1)):Te(e)}function oc(e){return F4(e).getDate()}function F4(e){return Or(e.getFullYear(),e.getMonth()+1,0)}function Lo(){return new Date}function Rn(e,t){return Je(e,t*12)}function Je(e,t){const n=Or(e.getFullYear(),e.getMonth()+t,e.getDate()),i=Te(e),s=Te(n);return i!==s&&n.setDate(0),n}function eo(e,t){return Or(e.getFullYear(),e.getMonth(),e.getDate()+t)}function Or(e,t,n){const i=new Date(e,t,n);return e>=0&&e<100&&i.setFullYear(i.getFullYear()-1900),i}function rg(e){return!Number.isNaN(e.getTime())}function rw(e,t){return ot(e)-ot(t)||Pt(e)-Pt(t)||Te(e)-Te(t)}function vs(e,t){return e.setHours(0,0,0,0),t.setHours(0,0,0,0),e.getTime()===t.getTime()}function ow(e){return parseInt(e,10)<10?`0${e}`:e}function og(e,t){const n=ot(e)-TT(0,null,null);return B4(n,t)}function B4(e,t){return(e%t+t)%t}function TT(e,t,n){let i=0;return n?i=ot(n)-e+1:t&&(i=ot(t)),i}function No(e,t,n,i){const s=t&&rw(e,t)<=0,r=n&&rw(e,n)>=0,o=i&&i(e)===!1;return!!(s||r||o)}function ag(e,t,n,i,s,r){const o=i&&ot(i),a=i&&Pt(i),l=n&&ot(n),c=n&&Pt(n),u=new Date().getFullYear(),d=new Date().getMonth();if(r&&u===t&&ed||r&&u>t||s&&uo||t===o&&e>a:!1,f=c&&l?tr)return!0;const o=t&&ot(t),a=n&&ot(n),l=a?e>a:!1,c=o?en===e)}function aw(e,t,n,i,s){return s?DT(e,s,t,n,i,s):!1}function lw(e,t,n,i,s){return i?DT(e,i,t,n,i,s):!1}function DT(e,t,n,i,s,r){if(n==="days")return ot(e)===ot(t)&&Pt(e)===Pt(t);if(n==="months")return ot(e)===ot(t);if(n==="years"){const o=TT(i,s,r);return Math.floor((ot(e)-o)/i)===Math.floor((ot(t)-o)/i)}return!1}function lh(e,t,n,i){let s;if(t){const r=V4(t);if(r){r[0]!==r[1]?s=r[0]+r[1]:s=r[0];const o=new RegExp(`[${s}]`),a=e.split(o),l=t==null?void 0:t.split(o),c=(t==null?void 0:t.indexOf("mmm"))!==-1,u=[];l==null||l.forEach((m,v)=>{m.indexOf("yy")!==-1&&(u[0]={value:a[v],format:m}),m.indexOf("m")!==-1&&(u[1]={value:a[v],format:m}),m.indexOf("d")!==-1&&m.length<=2&&(u[2]={value:a[v],format:m})});let d;(t==null?void 0:t.indexOf("mmmm"))!==-1?d=n:d=i;const h=Number(u[0].value),f=c?z4(u[1].value,d):Number(u[1].value)-1,p=Number(u[2].value);return Or(h,f,p)}}}function cw(e,t,n,i,s,r){const o=Te(e),a=ow(Te(e).toString()),l=n[sw(e)],c=i[sw(e)],u=Pt(e),d=ow((Pt(e)+1).toString()),h=s[Pt(e)],f=r[Pt(e)],p=ot(e).toString().length===2?ot(e):ot(e).toString().slice(2,4),m=ot(e),v=t.split(/(d{1,4}|m{1,4}|y{4}|yy|!.)/g);let y="";return v.forEach(g=>{switch(g){case"dddd":g=g.replace(g,c);break;case"ddd":g=g.replace(g,l);break;case"dd":g=g.replace(g,a);break;case"d":g=g.replace(g,o.toString());break;case"mmmm":g=g.replace(g,f);break;case"mmm":g=g.replace(g,h);break;case"mm":g=g.replace(g,d);break;case"m":g=g.replace(g,u.toString());break;case"yyyy":g=g.replace(g,m.toString());break;case"yy":g=g.replace(g,p.toString());break}y+=g}),y}const ET=(e,t)=>{if(!t)return!1;const n=new Date;return n.setHours(0,0,0,0)===e.setHours(0,0,0,0)?!1:et?e>new Date:!1,ir=Y.createContext({view:"days",setView:null,activeDate:new Date,setActiveDate:null,selectedDate:new Date,setSelectedDate:null,weekdaysShort:[],monthsShort:[],monthsFull:[],min:void 0,max:void 0,weekdaysFull:[],yearScope:[],tabCount:0,inline:!1,disableFuture:!1,disablePast:!1}),W4=({clearBtnText:e="Clear",cancelBtnText:t="Cancel",okBtnText:n="Ok",setValue:i,selectDate:s,onClose:r})=>{const{setActiveDate:o,setSelectedDate:a,selectedDate:l,isInDatetimepicker:c,onDatetimepickerModeSwitch:u}=k.useContext(ir),d=h=>{h.currentTarget.blur(),o(new Date),a(void 0),i("")};return b.jsxs("div",{className:"datepicker-footer",children:[b.jsx("button",{tabIndex:0,onClick:h=>d(h),className:"datepicker-footer-btn datepicker-clear-btn",children:e}),b.jsx("button",{tabIndex:0,onClick:()=>r==null?void 0:r(),className:"datepicker-footer-btn datepicker-cancel-btn",children:t}),b.jsx("button",{tabIndex:0,onClick:()=>{s(l),c&&(u==null||u()),r==null||r()},className:"datepicker-footer-btn datepicker-ok-btn",children:n})]})},H4=(e,t,n)=>{const i=document.createElement("button"),s=document.createElement("div");i.id=`datepicker-toggle-${Math.floor(Math.random()*10001)}`,i.tabIndex=0,i.type="button",i.style.pointerEvents="auto";const r=document.createElement("i");r.className=`${e} fa-${t} datepicker-icon`,n&&i.appendChild(r);const o=n?i:r;return o.classList.add("datepicker-toggle-button"),{div:s,selector:o}},U4=(e,t,n,i,s,r)=>{const o=[],a=Pt(e),l=Pt(Je(e,-1)),c=Pt(Je(e,1)),u=ot(e),d=$4(u,a,r),h=oc(e),f=oc(Je(e,-1)),p=7;let m=1,v=!1;for(let y=1;yh&&(m=1,v=!1);const _=Or(u,v?a:c,m);g.push({date:_,currentMonth:v,isSelected:t&&vs(_,t),isToday:vs(_,Lo()),dayNumber:Te(_),disabled:No(_,n,i,s)}),m++}o.push(g)}return o},Y4=e=>{const t=[],n=e[0];let i=[];for(let s=0;s<24;s++)if(i.push(n+s),i.length===4){const r=i;t.push(r),i=[]}return t},X4=e=>{const t=[];let n=[];return e.forEach(i=>{if(n.push(i),n.length===4){const s=n;t.push(s),n=[]}}),t},K4=({filter:e,startWeekdays:t,startDay:n,inlineDayClick:i,selectOnClick:s,selectDate:r,onClose:o})=>{const{min:a,max:l,setActiveDate:c,setSelectedDate:u,activeDate:d,selectedDate:h,tabCount:f,disableFuture:p,disablePast:m}=k.useContext(ir),v=y=>{!No(y,a,l,e)&&(c(y),u(y),i(y),s&&(r(y),o==null||o()))};return b.jsxs("table",{className:"datepicker-table",children:[b.jsx("thead",{children:b.jsx("tr",{children:t.map((y,g)=>b.jsx("th",{className:"datepicker-day-heading",scope:"col",children:y},g))})}),b.jsx("tbody",{className:"datepicker-table-body",children:U4(d,h,a,l,e,n).map((y,g)=>b.jsx("tr",{children:y.map((x,_)=>b.jsx("td",{onClick:()=>v(x.date),tabIndex:vs(x.date,d)?0:void 0,className:I("datepicker-cell","datepicker-small-cell","datepicker-day-cell",x.isToday&&"current",x.isSelected&&"selected",x.disabled&&"disabled",f===3&&vs(x.date,d)&&"focused",Pt(d)!==Pt(x.date)&&"disabled",AT(x.date,p)&&"disabled",ET(x.date,m)&&"disabled"),children:b.jsx("div",{className:"datepicker-cell-content datepicker-small-cell-content",style:{display:x.currentMonth?"block":"none"},children:x.dayNumber})},_))},g))})]})},G4=()=>{const{yearScope:e,setView:t,setActiveDate:n,activeDate:i,selectedDate:s,tabCount:r,min:o,max:a,disableFuture:l,disablePast:c}=k.useContext(ir);return b.jsx("table",{className:"datepicker-table",children:b.jsx("tbody",{className:"datepicker-table-body",children:Y4(e).map((u,d)=>b.jsx("tr",{children:u.map(h=>b.jsx("td",{onClick:()=>{n(new Date(h,Pt(i),Te(i))),t("months")},tabIndex:h===ot(i)?0:void 0,className:I("datepicker-cell","datepicker-large-cell","datepicker-year-cell",s&&h===ot(s)&&"selected",r===3&&h===ot(i)&&"focused",lg(h,o,a,l,c)&&"disabled",ot(Lo())===h&&"current"),children:b.jsx("div",{className:"datepicker-cell-content datepicker-large-cell-content",children:h})},h))},d))})})},q4=()=>{const{monthsShort:e,setActiveDate:t,setView:n,activeDate:i,selectedDate:s,tabCount:r,min:o,max:a,disableFuture:l,disablePast:c}=k.useContext(ir);return b.jsx("table",{className:"datepicker-table",children:b.jsx("tbody",{className:"datepicker-table-body",children:X4(e).map((u,d)=>b.jsx("tr",{children:u.map(h=>b.jsx("td",{onClick:()=>{t(new Date(ot(i),e.indexOf(h),sg(i))),n("days")},tabIndex:e.indexOf(h)===Pt(i)?0:void 0,className:I("datepicker-cell","datepicker-large-cell","datepicker-month-cell",s&&e.indexOf(h)===Pt(s)&&ot(i)===ot(s)&&"selected",r===3&&e.indexOf(h)===Pt(i)&&"focused",Pt(Lo())===e.indexOf(h)&&ot(Lo())===ot(i)&&"current",ag(e.indexOf(h),ot(i),o,a,l,c)&&"disabled"),children:b.jsx("div",{className:"datepicker-cell-content datepicker-large-cell-content",children:h})},e.indexOf(h)))},d))})})},Q4=({title:e,customHeader:t})=>{const{weekdaysShort:n,monthsShort:i,selectedDate:s,isInDatetimepicker:r,onDatetimepickerModeSwitch:o}=k.useContext(ir),a=s||new Date;return b.jsxs("div",{className:"datepicker-header",children:[b.jsx("div",{className:"datepicker-title",children:b.jsx("span",{className:"datepicker-title-text",children:e})}),b.jsxs("div",{className:"datepicker-date",children:[!t&&b.jsxs("span",{className:"datepicker-date-text",children:[n[a.getDay()],", ",i[a.getMonth()]," ",a.getDate()]}),t&&t]}),r&&b.jsxs("div",{className:"buttons-container",children:[b.jsx("button",{type:"button",className:"datepicker-button-toggle",children:b.jsx("i",{className:"far fa-calendar datepicker-toggle-icon"})}),b.jsx("button",{type:"button",className:"timepicker-button-toggle",onClick:o,children:b.jsx("i",{className:"far fa-clock fa-sm timepicker-icon"})})]})]})},Z4=()=>{const{view:e,setView:t,activeDate:n,setActiveDate:i,monthsFull:s,min:r,max:o,yearScope:a}=k.useContext(ir),l=c=>{if(e==="days"){const u=c?new Date(ot(n),Pt(n)+1,sg(n)):new Date(ot(n),Pt(n)-1,sg(n));c?!aw(Je(u,-1),"days",1,r,o)&&i(u):!lw(Je(u,1),"days",1,r,o)&&i(u)}else if(e==="years"){const u=c?new Date(ot(n)+24,Pt(n),Te(n)):new Date(ot(n)-24,Pt(n),Te(n));c?o?a[0]+24ot(r)&&i(u):i(u)}else if(e==="months"){const u=c?new Date(ot(n)+1,Pt(n),Te(n)):new Date(ot(n)-1,Pt(n),Te(n));c?!aw(Rn(u,-1),"months",1,r,o)&&i(u):!lw(Rn(u,1),"months",1,r,o)&&i(u)}};return b.jsxs("div",{className:"datepicker-date-controls",children:[e==="days"&&b.jsxs("button",{tabIndex:0,className:"datepicker-view-change-button",onClick:()=>t("years"),children:[s[n.getMonth()]," ",n.getFullYear()]}),e==="years"&&b.jsxs("button",{tabIndex:0,className:"datepicker-view-change-button",onClick:()=>t("days"),children:[a[0]," - ",a[1]]}),e==="months"&&b.jsx("button",{tabIndex:0,className:"datepicker-view-change-button",onClick:()=>t("days"),children:ot(n)}),b.jsxs("div",{className:"datepicker-arrow-controls",children:[b.jsx("button",{tabIndex:0,className:"datepicker-previous-button",onClick:()=>l(!1)}),b.jsx("button",{tabIndex:0,className:"datepicker-next-button",onClick:()=>l(!0)})]})]})},J4=({labelText:e,inline:t,setReferenceElement:n,inputClasses:i,value:s,style:r,inputStyle:o,icon:a,input:l,inputId:c,inputToggle:u,setDatepickerValue:d,format:h,onOpenHandler:f,...p})=>{const{monthsFull:m,monthsShort:v,setSelectedDate:y,setActiveDate:g}=k.useContext(ir),x=I(s?"active":"",i),_=k.useRef(null);return k.useEffect(()=>{var w;if(u)return;const S=(w=_.current)==null?void 0:w.parentNode,{div:C,selector:M}=H4(a,"sm",!0);return S==null||S.insertBefore(C,_.current),S==null||S.insertBefore(M,_.current),M.addEventListener("click",()=>f==null?void 0:f()),()=>{M.removeEventListener("click",()=>f==null?void 0:f()),S==null||S.removeChild(M)}},[a,f,u]),b.jsx(wi,{className:x,label:e,id:c,ref:t?n:l,labelRef:_,wrapperClass:"datepicker",value:s,onChange:w=>{const S=lh(w.target.value,h,m,v);d(w.target.value),S&&rg(S)?(g(S),y(S)):(g(new Date),y(void 0))},style:o,wrapperStyle:r,onClick:()=>{u&&(f==null||f())},...p})},x0="ArrowLeft",b0="ArrowUp",_0="ArrowRight",w0="ArrowDown",k0="Home",S0="End",M0="PageUp",C0="PageDown",P0="Enter",T0=" ",t8=(e,t,n,i,s,r,o,a,l,c)=>{switch(e){case x0:t(u=>eo(u,-1));break;case _0:t(u=>eo(u,1));break;case b0:t(u=>eo(u,-7));break;case w0:t(u=>eo(u,7));break;case k0:t(u=>eo(u,1-Te(u)));break;case S0:t(u=>eo(u,oc(u)-Te(u)));break;case M0:t(u=>Je(u,-1));break;case C0:t(u=>Je(u,1));break;case P0:if(No(n,i,s,o)||ET(n,c)||AT(n,l))return;a(n),r(n);break;case T0:if(!o||o(n)){if(No(n,i,s,o))return;a(n),r(n)}break;default:return}},e8=(e,t,n,i,s,r,o,a,l)=>{switch(e){case x0:n(c=>Rn(c,-1));break;case _0:n(c=>Rn(c,1));break;case b0:n(c=>Rn(c,-4));break;case w0:n(c=>Rn(c,4));break;case k0:n(c=>Rn(c,-og(c,24)));break;case S0:n(c=>Rn(c,24-og(c,24)-1));break;case M0:n(c=>Rn(c,-24));break;case C0:n(c=>Rn(c,24));break;case P0:!lg(ot(t),i,s,a,l)&&r("months");break;case T0:!lg(ot(t),i,s,a,l)&&o(t);return;default:return}},n8=(e,t,n,i,s,r,o,a,l,c)=>{switch(e){case x0:n(u=>Je(u,-1));break;case _0:n(u=>Je(u,1));break;case b0:n(u=>Je(u,-4));break;case w0:n(u=>Je(u,4));break;case k0:n(u=>Je(u,-Pt(u)));break;case S0:n(u=>Je(u,11-Pt(u)));break;case M0:n(u=>Rn(u,-1));break;case C0:n(u=>Rn(u,1));break;case P0:!ag(Pt(t),ot(t),i,s,l,c)&&r("days");break;case T0:!ag(Pt(t),ot(t),i,s,l,c)&&o(t);return;default:return}},i8=({closeOnEsc:e,isOpen:t,activeDate:n,setActiveDate:i,min:s,max:r,view:o,setView:a,setSelectedDate:l,filter:c,setInlineDate:u,disableFuture:d,disablePast:h,onClose:f})=>{const[p,m]=k.useState(3),v=k.useRef(null),y=k.useCallback(g=>{var x,_,w;if(e&&g.key==="Escape"&&(f==null||f()),g.preventDefault(),!g.shiftKey&&g.key==="Tab"){const S=(x=v.current)==null?void 0:x.querySelectorAll('[tabindex="0"]');S&&(p===S.length-1?m(0):m(p+1))}else if(g.key==="Enter")p!==3&&document.activeElement&&document.activeElement.click();else if(g.shiftKey&&g.key==="Tab"){const S=(_=v.current)==null?void 0:_.querySelectorAll('[tabindex="0"]');S&&m(p===0?S.length-1:p-1)}(w=v.current)!=null&&w.querySelector(".focused")&&p!==4&&(o==="days"?t8(g.key,i,n,s,r,l,c,u,d,h):o==="years"?e8(g.key,n,i,s,r,a,l,d,h):o==="months"&&n8(g.key,n,i,s,r,a,l,c,d,h))},[n,o,c,r,s,e,p,a,i,l,u,d,h,f]);return k.useEffect(()=>{var g,x;const _=(g=v.current)==null?void 0:g.querySelectorAll('[tabindex="0"]');if(_){const w=_[p];if(w.tagName!=="TD"){w.focus();const S=(x=v.current)==null?void 0:x.querySelector(".focused");S==null||S.classList.remove("focused")}else _[p-1].blur(),w.classList.add("focused")}},[p]),k.useEffect(()=>{t||m(3)},[t]),k.useEffect(()=>{m(3)},[o]),k.useEffect(()=>{if(t)return document.addEventListener("keydown",y),()=>{document.removeEventListener("keydown",y)}},[y,t]),{tabCount:p,modalRef:v}},s8=({isOpen:e,inline:t})=>{k.useEffect(()=>{const n=window.innerWidth>document.documentElement.clientWidth&&window.innerWidth>=576;if(!t)return e&&n?(document.body.style.overflow="hidden",document.body.style.paddingRight="17px"):(document.body.style.overflow="",document.body.style.paddingRight=""),()=>{document.body.style.overflow="",document.body.style.paddingRight=""}},[e,t])},r8=({isOpened:e,isOpen:t,inline:n,popperElement:i,referenceElement:s,backdropRef:r,onCloseHandler:o})=>{const a=k.useCallback(l=>{var c;n?!(i!=null&&i.contains(l.target))&&!((c=s==null?void 0:s.parentNode)!=null&&c.contains(l.target))&&!l.target.classList.contains("datepicker-view-change-button")&&!l.target.classList.contains("datepicker-large-cell-content")&&t&&o():l.target===r.current&&t&&o()},[i,s,r,n,t,o]);k.useEffect(()=>(e&&document.addEventListener("click",a),()=>{document.removeEventListener("click",a)}),[e,a])},OT=k.forwardRef(({datetimepickerRef:e,isInDatetimepicker:t,onDatetimepickerModeSwitch:n,closeOnEsc:i=Ce.closeOnEsc,customHeader:s,title:r=Ce.title,weekdaysNarrow:o=Ce.weekdaysNarrow,monthsFull:a=Ce.monthsFull,monthsShort:l=Ce.monthsShort,weekdaysFull:c=Ce.weekdaysFull,weekdaysShort:u=Ce.weekdaysShort,disableFuture:d,disablePast:h,filter:f,inline:p,className:m,min:v,max:y,format:g=Ce.format,okBtnText:x=Ce.okBtnText,clearBtnText:_=Ce.clearBtnText,cancelBtnText:w=Ce.cancelBtnText,inputToggle:S,customIcon:C=Ce.customIcon,inputId:M,inputLabel:P=Ce.inputLabel,inputStyle:T,startDay:A=Ce.startDay,views:E=Ce.views,style:z,defaultValue:N="",onChange:R,onClose:L,onClosed:B,onOpen:D,onOpened:$,getFormattedDateValues:F,value:V,wrapperClass:W,selectOnClick:et=!1,open:Z,disablePortal:O,...U},lt)=>{const[ct,kt]=k.useState(!1),[it,Rt]=k.useState(!1),Ct=ef(it,Z),[Qt,ft]=k.useState(new Date),[wt,dt]=k.useState(new Date),[jt,pt]=k.useState(E),[xt,J]=k.useState(V||N),[mt,q]=k.useState(),[ye,Dt]=k.useState(),[he,Un]=k.useState(o),[Yn,Mn]=k.useState([0,0]),Si=k.useRef(null),dn=k.useRef(null),Mi=k.useRef(N&&!0),{styles:as,attributes:ls}=Oh(e||ye,mt,{placement:"bottom-start",modifiers:[VM]});k.useImperativeHandle(lt,()=>p?ye:dn.current,[p,ye]);const Ci=nt=>{if(p&&p){const Tt=cw(nt,g,u,c,l,a);J(Tt),t&&(n==null||n()),Ke()}},Pi=nt=>{const Tt=nt&&cw(nt,g,u,c,l,a);Tt&&J(Tt)},Ke=k.useCallback(()=>{Rt(!1),L==null||L()},[L]),Xn=k.useCallback(()=>{Rt(!0),D==null||D()},[D]),Ti=k.useCallback(()=>{kt(!1),B==null||B()},[B]),j=k.useCallback(()=>{kt(!0),$==null||$()},[$]),{tabCount:Q,modalRef:It}=i8({closeOnEsc:i,isOpen:Ct,activeDate:Qt,setActiveDate:ft,min:v,max:y,view:jt,setView:pt,setSelectedDate:dt,filter:f,setInlineDate:Ci,disableFuture:d,disablePast:h});return s8({isOpen:Ct,inline:p}),r8({isOpened:ct,isOpen:Ct,inline:p,referenceElement:ye,popperElement:mt,backdropRef:Si,onCloseHandler:Ke}),k.useEffect(()=>{const nt=ot(Qt),Tt=og(Qt,24),Oe=nt-Tt;Mn([Oe,Oe+23])},[Qt]),k.useEffect(()=>{const nt=o.slice(A).concat(o.slice(0,A));Un(nt)},[o,A]),k.useEffect(()=>{if(!Ct)return;const nt=p?ye:dn.current,Tt=nt==null?void 0:nt.parentNode,Oe=Tt==null?void 0:Tt.querySelector("button");Oe?Oe.blur():nt==null||nt.blur()},[Ct,dn,ye,p,D]),k.useEffect(()=>{Z&&!Ct&&!ct&&(D==null||D(),Rt(!0))},[Z,Ct,ct,D]),k.useEffect(()=>{if(!Mi.current)return;const nt=lh(xt,g,a,l);nt&&rg(nt)&&(ft(nt),dt(nt)),Mi.current=!1},[N,xt,g,a,l]),k.useEffect(()=>{const nt=V&&lh(V,g,a,l);nt&&rg(nt)&&(ft(nt),dt(nt),J(V)),V===""&&(ft(new Date),dt(void 0),J(V))},[V,g,a,l]),k.useEffect(()=>{Ct||(pt(E),xt||(ft(new Date),dt(void 0)))},[Ct,E,xt]),k.useEffect(()=>{R==null||R(xt,Qt)},[xt]),k.useEffect(()=>{const nt=wt||new Date,Tt=String(nt.getDate()),Oe=u[nt.getDay()],cs=c[nt.getDay()],ai=l[nt.getMonth()],Kn=a[nt.getMonth()],Me=String(nt.getFullYear()),Kr=Me.slice(-2);F==null||F({dayNumber:Tt,weekdayShort:Oe,weekdayFull:cs,monthShort:ai,monthFull:Kn,yearFull:Me,yearShort:Kr})},[wt]),b.jsx(ir.Provider,{value:{isInDatetimepicker:t,onDatetimepickerModeSwitch:n,view:jt,setView:pt,activeDate:Qt,setActiveDate:ft,selectedDate:wt,setSelectedDate:dt,weekdaysShort:u,monthsShort:l,monthsFull:a,min:v,max:y,weekdaysFull:c,yearScope:Yn,tabCount:Q,isOpen:Ct,disablePast:h,disableFuture:d},children:b.jsxs(b.Fragment,{children:[!t&&b.jsx(J4,{inputClasses:m,labelText:P,inline:p,setReferenceElement:Dt,value:xt,setDatepickerValue:J,style:z,inputStyle:T,format:g,icon:C,input:dn,inputToggle:S,onOpenHandler:Xn,...U}),b.jsx(aa,{disablePortal:O,children:b.jsx(Zy,{children:Ct&&b.jsxs(b.Fragment,{children:[b.jsxs(j4,{className:W,dropdown:p,styles:as,attributes:ls,setPopperElement:q,onClosed:Ti,onOpened:j,children:[!p&&b.jsx(Q4,{title:r,customHeader:s,onClose:Ke}),b.jsxs("div",{className:"datepicker-main",ref:It,children:[b.jsx(Z4,{}),b.jsxs("div",{className:"datepicker-view",children:[jt==="days"&&b.jsx(K4,{startWeekdays:he,startDay:A,filter:f,inlineDayClick:Ci,selectDate:Pi,selectOnClick:et,onClose:Ke}),jt==="years"&&b.jsx(G4,{}),jt==="months"&&b.jsx(q4,{})]}),!p&&b.jsx(W4,{okBtnText:x,clearBtnText:_,cancelBtnText:w,setValue:J,selectDate:Pi,onClose:Ke})]})]},"datepicker-modal-container"),!p&&b.jsx(Jo.div,{className:"datepicker-backdrop",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},ref:Si})]})})})]})})});OT.displayName="MDBDatepicker";const o8=e=>{const t=/^([0-1]?[0-9]|2[0-3]):[0-5][0-9] [APap][mM]$/,n=/^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])?$/;return e.match(t)||e.match(n)},a8=e=>e&&Object.prototype.toString.call(e)==="[object Date]"&&!isNaN(e.getTime()),uw=300,l8=k.forwardRef(({className:e,label:t="Select Date and Time",labelStyle:n,labelClass:i,labelRef:s,inputClass:r="",inputRef:o,inline:a,disabled:l,defaultTime:c="",defaultDate:u="",value:d,invalidLabel:h,inputToggle:f=!1,timepickerOptions:p,datepickerOptions:m,showFormat:v,dateFormat:y="dd/mm/yyyy",timeFormat:g="12h",appendValidationInfo:x=!0,onChange:_,onOpen:w,onClose:S,onDatepickerOpen:C,onDatepickerClose:M,onTimepickerOpen:P,onTimepickerClose:T,...A},E)=>{const z=k.useRef(!1),[N,R]=k.useState(!1),[L,B]=k.useState(!1),[D,$]=k.useState(u),[F,V]=k.useState(c),[W,et]=k.useState(""),Z=k.useRef(),O=D?W.split(",")[0]:null,U=F?W.split(", ")[1]:null,lt=I("form-outline","datetimepicker",e),ct=()=>{const pt=O&&lh(O,y,Ce.monthsFull,Ce.monthsShort);return W&&!O&&!U||O&&!a8(pt)||U&&!o8(U)?r+" is-invalid":r},kt=k.useCallback(pt=>{$(pt)},[]),it=k.useCallback(pt=>{V(pt)},[]),Rt=k.useCallback(()=>{B(!1),z.current=!1,M==null||M()},[M]),Ct=k.useCallback(()=>{T==null||T(),R(!1),z.current=!1},[T]),Qt=k.useCallback(()=>{C==null||C()},[C]),ft=k.useCallback(()=>{P==null||P()},[P]),wt=()=>{B(!0),w==null||w(),z.current=!0},dt=k.useCallback(()=>{L?(B(!1),setTimeout(()=>{R(!0)},uw)):N&&(R(!1),setTimeout(()=>{B(!0)},uw))},[L,N]);k.useEffect(()=>{!F||!D||(_==null||_(`${D}, ${F}`),!d&&et(`${D}, ${F}`))},[F,D,_,d]),k.useEffect(()=>{d&&(et(d),_==null||_(d))},[d,_]),k.useEffect(()=>{!L&&!N&&!z.current&&(S==null||S())},[L,N,S]);const jt=pt=>{et(pt);const[xt,J]=pt.split(", ");$(xt||""),V(J||"")};return b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:lt,ref:Z,...A,children:[b.jsx(wi,{label:t,labelStyle:n,labelClass:i,ref:o||E,labelRef:s,placeholder:v?`${y}, ${g}`:void 0,value:d||W,onChange:pt=>{jt(pt.target.value),_==null||_(pt.target.value)},className:x?ct():r,disabled:l,onClick:()=>{f&&wt()},children:h&&b.jsx("div",{className:"invalid-feedback",children:h})}),!f&&b.jsx("button",{type:"button",className:"datetimepicker-toggle-button",onClick:wt,disabled:l,style:{pointerEvents:l?"none":"initial"},children:b.jsx("i",{className:"far fa-calendar datepicker-toggle-icon"})})]}),b.jsx(OT,{...m,inline:a,onChange:kt,format:y,datetimepickerRef:Z.current,defaultValue:u,value:D,onClose:Rt,onOpen:Qt,isInDatetimepicker:!0,open:L,onDatetimepickerModeSwitch:dt}),b.jsx(PT,{...p,inline:a,onChange:it,format:g,datetimepickerRef:Z.current,defaultValue:c,value:F,onClose:Ct,onOpen:ft,isInDatetimepicker:!0,open:N,onDatetimepickerModeSwitch:dt})]})});l8.displayName="MDBDateTimepicker";const c8=Y.forwardRef(({className:e,color:t,children:n,...i},s)=>{const r=I("toast-header",t&&`bg-${t}`,t&&t!=="light"&&"text-white",e);return b.jsx("div",{className:r,ref:s,...i,children:n})});c8.displayName="MDBToastHeader";const u8=Y.forwardRef(({className:e,children:t,color:n,...i},s)=>{const r=I("toast-body",n&&n!=="light"&&"text-white",e);return b.jsx("div",{className:r,ref:s,...i,children:t})});u8.displayName="MDBToastBody";const d8=Y.forwardRef(({className:e,white:t,children:n,...i},s)=>{const r=I("btn-close",t&&"btn-close-white",e);return b.jsx(Zt,{className:r,color:"none",ref:s,...i,children:n})});d8.displayName="MDBToastClose";const h8=0,f8=({selectedElements:e,optionHeight:t,data:n,multiple:i,selectAll:s,handleSelectAll:r,handleOptionClick:o,selectAllLabel:a,selectData:l,activeElementIndex:c,noResults:u,search:d})=>{const h=k.useMemo(()=>l.filter(v=>v.optgroup).map(v=>v.optgroup),[l]),f=k.useMemo(()=>{let v=0;return l.map(y=>(y.optgroup&&v++,{...y,groupIndex:v}))},[l]),p=k.useMemo(()=>l.filter(v=>!v.optgroup&&!v.hidden).length===0,[l]),m=v=>f.map(y=>{if(!y.optgroup&&v===y.groupIndex)return b.jsxs("div",{className:I("select-option",e.includes(y.elementPosition)&&"selected",y.disabled&&"disabled",y.hidden&&"d-none",c===y.elementPosition&&"active"),role:"option",style:{height:t},onClick:()=>o(y),children:[b.jsxs("span",{className:"select-option-text",children:[i&&b.jsx(oh,{disabled:y.disabled,disableWrapper:!0,checked:e.includes(y.elementPosition),readOnly:!0}),y.text,y.secondaryText&&b.jsx("span",{className:"select-option-secondary-text",children:y.secondaryText})]}),y.icon&&b.jsx("span",{className:"select-option-icon-container",children:b.jsx("img",{className:"select-option-icon rounded-circle",src:y.icon})})]},y.elementPosition)});return b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:"select-options-list",children:[i&&s&&!p&&b.jsx("div",{className:I("select-option",e.length===n.filter(v=>!v.disabled).length&&"selected",c===-1&&"active"),role:"option",onClick:r,style:{height:t},children:b.jsxs("span",{className:"select-option-text",children:[b.jsx(oh,{disableWrapper:!0,checked:n.filter(v=>!v.disabled&&!v.optgroup).length===e.length,readOnly:!0}),a]})}),m(h8),!p&&(h==null?void 0:h.map((v,y)=>{const g=m(y+1).filter(x=>x!==void 0);if(g.length!==0)return b.jsxs("div",{className:"select-option-group",children:[b.jsx("label",{className:"select-option-group-label",style:{height:t},children:v}),g]},`select-option-group ${v} ${y}`)}))]}),d&&p&&b.jsx("div",{className:"select-no-results",style:{height:t},children:u})]})},_p="ArrowUp",wp="ArrowDown",dw="Enter",hw="Escape",fw="Tab",p8=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;no.includes(a))||!r.every(a=>i[a]===s[a]))return!1}return!0},m8=e=>e.map((t,n)=>({...t,elementPosition:n})),g8={open:{opacity:1,transform:"scaleY(1)",transition:{duration:.2}},closed:{opacity:0,transform:"scaleY(0.8)",transition:{duration:.2}}},La=-1,D0=k.forwardRef(({data:e,className:t,inputClassName:n,optionHeight:i=38,visibleOptions:s=5,disabled:r,placeholder:o,label:a,clearBtn:l,children:c,multiple:u,displayedLabels:d=5,optionsSelectedLabel:h="options selected",selectAll:f=!0,selectAllLabel:p="Select all",size:m,openRef:v,contrast:y=!1,open:g,onOpen:x,onOpened:_,onClose:w,onClosed:S,onValueChange:C,onChange:M,search:P=!1,searchLabel:T="Search...",searchFn:A,autoSelect:E=!1,noResultsText:z="No results",validation:N=!1,validFeedback:R="Valid",invalidFeedback:L="Invalid",preventFirstSelection:B=!1,value:D,animationVariants:$,disablePortal:F,...V},W)=>{const[et,Z]=k.useState(!1),O=ef(et,g),[U,lt]=k.useState(!0),[ct,kt]=k.useState(null),[it,Rt]=k.useState(),[Ct,Qt]=k.useState();k.useImperativeHandle(W,()=>it,[it]);const[ft,wt]=k.useState(""),[dt,jt]=k.useState(""),[pt,xt]=k.useState(()=>f?La:e.findIndex(G=>!G.disabled)),[J,mt]=k.useState([]),[q,ye]=k.useState([]),[Dt,he]=k.useState(q),[Un,Yn]=k.useState(""),[Mn,Si]=k.useState(0),[dn,Mi]=k.useState(!1),as=I("select-wrapper",t),ls=I("select-input",o&&"placeholder-active",O&&"focused",n),Ci=I(O||ct&&a?"active":"",a&&"select-label"),Pi=I("select-dropdown",O&&"open"),{styles:Ke,attributes:Xn}=Oh(it,Ct,{placement:"bottom-start"}),Ti=k.useRef(null),j=k.useRef(null),Q=k.useRef(null),It=k.useMemo(()=>u&&f?s+1:s,[f,s,u]);k.useEffect(()=>{if(!dt)return he(q);if(A&&dt){const G=A(dt,q);return he(G||[])}he(()=>q.filter(G=>{var X;return((X=G.text)==null?void 0:X.toLocaleLowerCase().includes(dt.toLocaleLowerCase()))||G.optgroup}))},[dt,q,A,ft]),k.useEffect(()=>{O&&dt&&xt(-1)},[O,dt]),k.useEffect(()=>{if(!N)return;const G=J.every(ht=>q[ht].value),X=J.every(ht=>!q[ht].disabled),rt=J.length>0;!u&&(!rt||!G||!X)||u&&(!rt||!X)?it==null||it.setCustomValidity(L):it==null||it.setCustomValidity("")},[N,L,J,it,q,ft,u]);const nt=G=>{if(q.length===0)return;const X=j.current,rt=X.offsetHeight,ht=X.scrollTop,hn=q.filter(Ge=>Ge.hidden&&Ge.elementPosition(u&&f?-2:-1)){const Ge=(us-hn)*i,fn=Ge+i>ht+rt;Ge{const G=rt=>Dt.findIndex(ht=>ht.elementPosition==rt);let X=pt;for(;X{let G=pt;for(;G>=0;){G-=1;const X=Dt.findIndex(ht=>ht.elementPosition==G)!=-1,rt=G>=0&&(q[G].disabled||q[G].hidden||q[G].optgroup);if(G<=0&&(!X||rt))return u&&f?G=-1:pt;if(X&&!rt)break}return G},cs=G=>{const{key:X}=G;if([_p,wp,dw,fw,hw].includes(X)){if(X===fw)return E&&ca(Dt[pt]),it==null||it.focus(),Z(!1);if(G.preventDefault(),G.altKey&&(X===wp||X===_p))return O?w==null||w():x==null||x(),Z(!O);if(X===wp){const rt=Tt();return O?(nt(rt),xt(rt)):u?Z(!0):mt([rt])}if(X===_p){const rt=Oe();return O?(nt(rt),xt(rt)):u?Z(!0):mt([rt])}if(X===dw){const rt=Dt.findIndex(ht=>ht.elementPosition==pt);return O?pt===La?Kr():ca(Dt[rt]):(x==null||x(),Z(!0))}if(X===hw)return Z(!1),it==null?void 0:it.focus()}},ai=k.useCallback(()=>{Z(G=>!G)},[]),Kn=k.useCallback(G=>{if(v&&v.current===G.target)return;const X=Ct&&Ct!==null,rt=it&&it!==null,ht=!(Ct!=null&&Ct.contains(G.target))&&!(it!=null&&it.contains(G.target)),hn=G.target===Q.current;X&&O&&rt&&ht&&!hn&&(Z(!1),w==null||w())},[Ct,it,O,w,v]);k.useEffect(()=>{const G=m8(e);p8(G,q)||ye(G)},[e,q]);const Me=k.useCallback(()=>{O&&Yn(`${it==null?void 0:it.offsetWidth}px`)},[it,O]),Kr=()=>{if(!u||!f)return;if(J.length===e.filter(X=>!X.disabled&&!X.optgroup).length)return mt([]),C==null||C([]),M==null||M([]),Cn([]);const G=q==null?void 0:q.filter(X=>!X.disabled&&!X.optgroup).map(X=>X.elementPosition);return mt(G),C==null||C(e.filter(X=>!X.disabled)),M==null||M(e.filter(X=>!X.disabled)),Cn(G)},Gr=k.useCallback(()=>{if(q.length===0)return;let G=J[0];const X=G===void 0,rt=G>=q.length;if(dn&&!u){if(X&&B||!dn||u||rt)return;X&&(G=0);const ht=q[G].value,hn=String(q[G].text);hn?(kt(ht?null:hn),wt(ht?hn:"")):(kt(null),wt(ht?" ":""))}},[u,dn,J,q,B]),Cn=k.useCallback(G=>{const X=d===-1||G.length>d;if(G.length<=0&&(kt(null),wt("")),X)return kt(null),wt(`${G.length} ${h}`);const rt=G.map(fn=>q[fn].text||"").filter(fn=>fn!==""),ht=G.map(fn=>q[fn].value||"").filter(fn=>fn!==""),hn=rt.findIndex(fn=>fn!=="")===-1,us=ht.length>0,Ge=rt.join(", ");hn?(kt(null),wt(us?" ":"")):us?(wt(Ge),kt(null)):(wt(""),kt(Ge))},[d,h,q]);k.useEffect(()=>{Gr()},[J,Gr]);const ca=G=>{if(!G||G.disabled)return;const{elementPosition:X}=G;if(u){const rt=J.includes(X)?J.filter(ht=>ht!==X):[...J,X];return mt(rt),C==null||C(rt.map(ht=>e[ht])),M==null||M(rt.map(ht=>e[ht])),Cn(rt)}return mt([X]),Z(!1),C==null||C(e[X]),M==null||M(e[X]),w==null||w(),it==null?void 0:it.focus()};k.useEffect(()=>{Mi(!0)},[]),k.useEffect(()=>{if(u){const X=q.filter(rt=>rt.defaultSelected).map(rt=>rt.elementPosition);return Cn(X),mt(X)}let G=q.findIndex(X=>X.defaultSelected);G===La&&!B&&(G=q.findIndex(X=>!X.disabled&&!X.hidden)),G!==La&&mt([G])},[q,Cn,u,B]),k.useEffect(()=>{if(O&&P&&J.length===0)return xt(La);O||(J.length>0?xt(Math.max(...J)):xt(0))},[Dt,O,P,J]),k.useEffect(()=>{Si(It*i)},[It,i]),k.useEffect(()=>{Me()},[Me]),k.useEffect(()=>(O&&(window.addEventListener("click",Kn),window.addEventListener("resize",Me)),()=>{window.removeEventListener("click",Kn),window.removeEventListener("resize",Me)}),[Kn,Me,O]),k.useEffect(()=>{if(v){const G=v.current;return G==null||G.addEventListener("click",ai),()=>{G==null||G.removeEventListener("click",ai)}}},[v,ai]),k.useEffect(()=>{if(!D)return;const G=Array.isArray(D)?D:[D],X=q.filter(ht=>ht.value&&G.includes(ht.value)).map(ht=>ht.elementPosition);if(X.toString()===J.toString())return;const rt=u?X.map(ht=>q[ht]):q[X[0]];C==null||C(rt),M==null||M(rt),mt(X),u?Cn(X):Gr()},[D,q,u,C,M,J,Gr,Cn]);const Ec=k.useCallback(()=>{r||(it==null||it.focus(),O?w==null||w():x==null||x(),Z(!O))},[r,O,x,w,it]),sf=k.useCallback(G=>{var X;G==="open"&&(lt(!1),_==null||_(),P&&((X=Ti.current)==null||X.focus())),G==="closed"&&(lt(!0),S==null||S(),P&&jt(""))},[_,S,P]);return b.jsx("div",{className:as,...V,children:b.jsxs(b.Fragment,{children:[b.jsxs(wi,{ref:Rt,onClick:Ec,onKeyDown:cs,className:ls,value:ft,readonly:!N,required:N,disabled:r,placeholder:ct?void 0:o,label:a,labelClass:Ci,size:m,contrast:y,children:[N&&b.jsxs(b.Fragment,{children:[b.jsx("div",{className:"invalid-feedback",children:L}),b.jsx("div",{className:"valid-feedback",children:R})]}),ct&&b.jsx("div",{className:"form-label select-fake-value active",children:ct}),l&&(ft.length>0||ct)&&b.jsx("span",{tabIndex:0,className:`select-clear-btn d-block ${r?"pe-none":""}`,role:"button",onClick:()=>{wt(""),mt([]),C==null||C(u?[]:{}),M==null||M(u?[]:{})},children:"✕"}),b.jsx("span",{className:`select-arrow ${r?"pe-none":""}`,ref:Q,onClick:Ec,style:{cursor:"pointer"}})]}),(e==null?void 0:e.length)>0&&(O||!U)&&b.jsx(aa,{disablePortal:F,children:b.jsx("div",{style:{...Ke.popper,width:Un,zIndex:1070},...Xn.popper,ref:Qt,className:"select-dropdown-container",children:b.jsx(Zy,{children:O&&b.jsxs(Jo.div,{variants:{...g8,...$},initial:"closed",animate:"open",exit:"closed",tabIndex:0,className:Pi,onAnimationStart:()=>{lt(!1)},onAnimationComplete:sf,children:[P&&b.jsx("div",{className:"input-group",children:b.jsx("input",{onKeyDown:cs,onChange:G=>jt(G.target.value),ref:Ti,type:"text",className:"form-control select-filter-input",role:"searchbox",placeholder:T})}),b.jsx("div",{className:"select-options-wrapper",ref:j,style:{maxHeight:`${Mn}px`},children:b.jsx(f8,{data:e,selectData:Dt,selectedElements:J,optionHeight:i,visibleOptions:It,handleOptionClick:ca,handleSelectAll:Kr,selectAll:f,selectAllLabel:p,multiple:u,activeElementIndex:pt,noResults:z,search:P})}),c&&b.jsx("div",{className:"select-custom-content",children:c})]})})})})]})})});D0.displayName="MDBSelectV2";const Dc=k.createContext({isLoading:!1,activePage:0,setActivePage:null,sort:{column:"",option:""},fixedHeader:!1,handleSort:null}),y8=({fullPagination:e,rowsText:t="Rows per page:",selectValue:n,setSelectValue:i,activeDataLength:s,entriesOptions:r=[10,25,50,200],fullDataLength:o,allText:a="All",ofText:l="of"})=>{const{isLoading:c,activePage:u,setActivePage:d}=k.useContext(Dc),h=u===0||c,f=s<=n*(u+1)||c,p=u===Math.floor(s/n),m=r.map(g=>({text:g.toString(),value:g,defaultSelected:n===g}));m.push({text:a,value:o,defaultSelected:n===o});const v=g=>{g instanceof Array||(i(g.value),d(0))},y=`${u*n+1} - ${(u+1)*n>s?s:(u+1)*n} ${l} ${s}`;return b.jsxs("div",{className:"datatable-pagination",children:[b.jsxs("div",{className:"datatable-select-wrapper",children:[b.jsx("p",{className:"datatable-select-text",children:t}),b.jsx(D0,{onValueChange:v,data:m,disabled:c})]}),b.jsx("div",{className:"datatable-pagination-nav",children:y}),b.jsxs("div",{className:"datatable-pagination-buttons",children:[e&&b.jsx(Zt,{disabled:h,onClick:()=>d(0),className:"datatable-pagination-button datatable-pagination-start",color:"link",children:b.jsx(sn,{icon:"angle-double-left"})}),b.jsx(Zt,{disabled:h,onClick:()=>d(u-1),className:"datatable-pagination-button datatable-pagination-left",color:"link",children:b.jsx(sn,{icon:"chevron-left"})}),b.jsx(Zt,{disabled:f,onClick:()=>d(u+1),className:"datatable-pagination-button datatable-pagination-right",color:"link",children:b.jsx(sn,{icon:"chevron-right"})}),e&&b.jsx(Zt,{disabled:p,onClick:()=>d(Math.floor(s/n)),className:"datatable-pagination-button datatable-pagination-end",color:"link",children:b.jsx(sn,{icon:"angle-double-right"})})]})]})},pw=(e,t,n)=>{const i=s=>s.toString().toLowerCase().includes(t.toLowerCase());return e.filter(s=>{if(n&&typeof n=="string")return i(s[n]);let r=Object.values(s);return n&&Array.isArray(n)&&(r=Object.keys(s).filter(o=>n.includes(o)).map(o=>s[o])),r.filter(o=>i(o)).length>0})},v8=(e,t,n)=>Object.assign([],e).sort((i,s)=>{const r=typeof i[t]=="string"?i[t].toLowerCase():i[t],o=typeof s[t]=="string"?s[t].toLowerCase():s[t];return ro?n==="desc"?-1:1:0}),RT=e=>e.every(t=>typeof t=="string"),E0=e=>!e.every(t=>typeof t=="string"),x8=e=>Array.isArray(e),mw=e=>!Array.isArray(e),b8=({search:e,advancedSearch:t,searchValue:n,setSearchValue:i,searchInputProps:s,label:r="Search",setAdvancedSearchValue:o})=>b.jsxs(b.Fragment,{children:[e&&b.jsx(wi,{value:n,onChange:a=>i(a.target.value),label:r,className:"mb-4",...s}),t&&b.jsxs(yT,{className:"mb-4",children:[b.jsx("input",{className:"form-control",value:n,onChange:a=>i(a.target.value),...s}),b.jsx(Zt,{className:"datatable-advanced-search",onClick:()=>o(t(n)),children:b.jsx(sn,{icon:"search"})})]})]}),_8=({dataColumns:e})=>{const{sort:t,fixedHeader:n,handleSort:i}=k.useContext(Dc),[s,r]=k.useState("rotate(0deg)"),o=a=>I("datatable-sort-icon",`${a===t.column&&"active"}`);return k.useEffect(()=>{const a=t.option==="desc"?"rotate(180deg)":"rotate(0deg)";r(a)},[t.option]),b.jsx(b.Fragment,{children:e.map((a,l)=>b.jsxs("th",{className:n?"fixed-cell":"",style:{cursor:"pointer"},scope:"row",onClick:()=>i(a),children:[b.jsx(sn,{fas:!0,icon:"arrow-up",className:o(a),style:{transform:a===t.column?s:"rotate(0deg)"}}),a]},l))})},w8=({dataColumns:e})=>{const[t,n]=k.useState("rotate(0deg)"),{sort:i,fixedHeader:s,handleSort:r,isLoading:o}=k.useContext(Dc),a=l=>I("datatable-sort-icon",`${l===i.column&&"active"}`);return k.useEffect(()=>{const l=i.option==="desc"?"rotate(180deg)":"rotate(0deg)";n(l)},[i.option]),b.jsx(b.Fragment,{children:e.map((l,c)=>{const{fixedValue:u,fixed:d,label:h}=l,f=l.sort!==!1&&!o,p={cursor:I(f&&"pointer"),left:d==="left"?u||0:void 0,right:d==="right"?u||0:void 0},m=I((s||d)&&"fixed-cell");return b.jsxs("th",{className:m,style:p,scope:"row",onClick:()=>f&&r(h),children:[f&&b.jsx(sn,{fas:!0,icon:"arrow-up",className:a(h),style:{transform:i.column===h?t:"rotate(0deg)"}}),h]},c)})})},k8=({row:e,dataColumns:t,format:n,editable:i})=>b.jsx(b.Fragment,{children:t.map((s,r)=>{const{field:o,fixed:a,width:l,fixedValue:c,columnSelector:u}=s,d=e[o],h=Number(d),f=n==null?void 0:n(o,h?Number(d):String(d)),p={minWidth:l,maxWidth:l,left:a==="left"&&(c||0),right:a==="right"&&(c||0),...f},m=I(a&&"fixed-cell",u&&`mdb-datatable-${u}`);return b.jsx("td",{contentEditable:i,className:m,style:p,children:d},r)})}),S8=({row:e,editable:t})=>b.jsx(b.Fragment,{children:e.map((n,i)=>b.jsx("td",{contentEditable:t,children:n},i))}),M8=({activeData:e,dataRows:t,isOnThePage:n,noFoundMessage:i,dataColumns:s,onRowClick:r,selectable:o,handleRowSelect:a,selectedRows:l,format:c,editable:u})=>{const{isLoading:d}=k.useContext(Dc),h=e.length,f=s.length,p=(m,v)=>{m.target.nodeName!=="INPUT"&&(r==null||r(v))};return b.jsxs(H3,{className:"datatable-body",children:[e.map((m,v)=>{const y=t.indexOf(m),g=l.includes(y),x=I(g&&"active",mw(m)&&m.rowSelector&&`mdb-datatable-${m.rowSelector}`);if(n(v))return b.jsxs("tr",{onClick:_=>p(_,m),className:x,style:{cursor:r&&"pointer"},children:[o&&b.jsx("td",{children:b.jsx(oh,{checked:g,onChange:()=>a(y)})}),x8(m)&&b.jsx(S8,{editable:u,row:m}),mw(m)&&E0(s)&&b.jsx(k8,{editable:u,row:m,dataColumns:s,format:c})]},v)}),!h&&!d&&b.jsx("tr",{className:"datatable-results-info",children:b.jsx("td",{colSpan:f,className:"text-center",children:i})})]})},C8=({dataColumns:e,dataRows:t,sort:n,searchValue:i,advancedSearch:s,advancedSearchValue:r})=>{const[o,a]=k.useState(t);return k.useEffect(()=>{const{column:l,option:c}=n,{phrase:u,columns:d}=r;let h;if(l){let f,p=0;E0(e)&&(f=e.find(m=>m.label===l)),RT(e)&&(p=e.indexOf(l)),h=v8(t,f?f.field:p,c)}i&&!s&&(h=pw(h||t,i,void 0)),u&&(h=pw(h||t,u,d)),a(h||t)},[n,t,e,i,s,r]),o},P8=Y.forwardRef(({advancedSearch:e,allText:t,className:n,bordered:i,borderless:s,borderColor:r="",color:o="",dark:a,entries:l=10,editable:c,entriesOptions:u,fixedHeader:d,fullPagination:h,hover:f,format:p,loaderClass:m="bg-primary",isLoading:v,loadingMessage:y="Loading results...",maxWidth:g="",maxHeight:x="",multi:_,noFoundMessage:w="No matching results found",pagination:S=!0,selectable:C,sortField:M="",searchInputProps:P,sortOrder:T="asc",sm:A,striped:E,rowsText:z,data:N={columns:[],rows:[]},search:R,onSelectRow:L,onRowClick:B,searchLabel:D,ofText:$,...F},V)=>{const[W,et]=k.useState(0),[Z,O]=k.useState(l),[U,lt]=k.useState({column:"",option:""}),[ct,kt]=k.useState([]),[it,Rt]=k.useState(""),[Ct,Qt]=k.useState({phrase:"",columns:""}),ft=C8({dataColumns:N.columns,dataRows:N.rows,sort:U,searchValue:it,advancedSearch:e,advancedSearchValue:Ct}),wt=I("datatable",f&&"datatable-hover",o&&`bg-${o}`,a&&"datatable-dark",i&&"datatable-bordered",s&&"datatable-borderless",r&&`border-${r}`,E&&"datatable-striped",A&&"datatable-sm",v&&"datatable-loading",n),dt=J=>W*Z<=J&&J<(W+1)*Z,jt=J=>{const{column:mt,option:q}=U;lt(mt===J?q==="asc"?{...U,option:"desc"}:{column:"",option:""}:{column:J,option:"asc"})},pt=J=>{const mt=J.currentTarget.checked,q=mt?Array.from({length:N.rows.length},(Dt,he)=>he):[],ye=q.map(Dt=>ft[Dt]);L==null||L(ye,q,mt),kt(q)},xt=J=>{const mt=ct.includes(J);let q;_?mt?q=ct.filter(he=>he!==J):q=[...ct,J]:mt?q=[]:q=[J];const ye=q.map(he=>ft[he]),Dt=q.length===N.rows.length;L==null||L(ye,q,Dt),kt(q)};return k.useEffect(()=>{M&<({column:M,option:T})},[M,T]),k.useEffect(()=>{et(0)},[it]),b.jsxs(Dc.Provider,{value:{isLoading:v,activePage:W,setActivePage:et,sort:U,fixedHeader:d,handleSort:jt},children:[b.jsx(b8,{search:R,advancedSearch:e,searchValue:it,setSearchValue:Rt,searchInputProps:P,label:D,setAdvancedSearchValue:Qt}),b.jsxs("div",{className:wt,ref:V,style:{maxWidth:g},...F,children:[b.jsx(k4,{className:"datatable-inner table-responsive ps",style:{overflow:"auto",position:"relative",maxWidth:g,maxHeight:x},children:b.jsxs(z3,{className:"datatable-table",children:[b.jsx(W3,{className:"datatable-header",children:b.jsxs("tr",{children:[C&&b.jsx("th",{className:d?"fixed-cell":"",children:_&&b.jsx(oh,{checked:ct.length===N.rows.length,onChange:pt})}),RT(N.columns)&&b.jsx(_8,{dataColumns:N.columns}),E0(N.columns)&&b.jsx(w8,{dataColumns:N.columns})]})}),b.jsx(M8,{activeData:ft,dataColumns:N.columns,dataRows:N.rows,isOnThePage:dt,onRowClick:B,format:p,handleRowSelect:xt,selectedRows:ct,selectable:C,noFoundMessage:w,editable:c})]})}),v&&b.jsxs(b.Fragment,{children:[b.jsx("div",{className:"datatable-loader bg-light}",children:b.jsx("span",{className:"datatable-loader-inner",children:b.jsx("span",{className:I("datatable-progress",m)})})}),b.jsx("p",{className:"text-center text-muted my-4",children:y})]}),S&&b.jsx(y8,{fullPagination:h,selectValue:Z,setSelectValue:O,activeDataLength:ft.length,rowsText:z,entriesOptions:u,fullDataLength:N.rows.length,allText:t,ofText:$})]})]})});P8.displayName="MDBDatatable";h0.register(...i3||[]);Y.createContext({activeItem:1,setActiveItem:null,prevActive:{current:1},setHeight:null,completed:[],noEditable:!1,isAnimating:{current:!1},linear:!1,formRef:{current:null},validate:{target:0,after:0},setValidate:null,type:"horizontal",stepsLength:0,onValid:void 0,onInvalid:void 0,mobileProgress:!1,disableHeadSteps:!1,animations:!0});Y.createContext({activeItem:0,dynamic:!1,dynamicStyle:{color:"",icon:""},setDynamicStyle:null,setActiveItem:null,hoveredItem:0,setHoveredItem:null,readonly:!1,onChange:void 0});const T8=Y.forwardRef(({backdrop:e=!0,backdropColor:t="black",backdropOpacity:n=.4,color:i,className:s,loadingText:r="Loading...",isOpen:o,fullScreen:a,overflow:l=!0,parentRef:c,spinnerElement:u=b.jsx(hT,{className:"loading-icon",role:"status"}),textClassName:d,textStyles:h,tag:f="div",...p},m)=>{const v=I("loading-text",d),y=I(a?"loading-full":"loading","loading-spinner",a?"position-fixed":"position-absolute",i&&`text-${i}`,s),g=I("loading-backdrop",!a&&"position-absolute");k.useEffect(()=>{const w=c==null?void 0:c.current;if(w)return w.classList.add("position-relative"),()=>{w.classList.remove("position-relative")}},[c]),k.useEffect(()=>{if(a&&l)return o?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}},[a,o,l]);const x=b.jsxs(f,{className:y,ref:m,...p,children:[u,b.jsx("span",{className:v,style:h,children:r})]}),_=b.jsx("div",{className:g,style:{opacity:n,backgroundColor:t}});return b.jsx(b.Fragment,{children:o!==!1&&b.jsx(b.Fragment,{children:a?b.jsxs(aa,{children:[x,_]}):b.jsxs(b.Fragment,{children:[x,e&&_]})})})});T8.displayName="MDBLoadingManagement";const D8=({isOpened:e,inputRef:t,dropdownEl:n,setOpenState:i,onClose:s})=>{const r=k.useCallback(o=>{if(!n)return;const a=t.current===o.target,l=n===o.target,c=n.contains(o.target);e&&!a&&!l&&!c&&(i(!1),s==null||s())},[e,i,n,t,s]);k.useEffect(()=>(document.addEventListener("click",r),()=>{document.removeEventListener("click",r)}),[r])},E8=({inputRef:e,dropdownEl:t})=>{const n=k.useCallback(()=>{if(!e.current||!t)return;const{width:i}=window.getComputedStyle(e.current);t.style.width=i},[t,e]);k.useEffect(()=>(n(),window.addEventListener("resize",n),()=>{window.removeEventListener("resize",n)}),[n])},A8=({isOpen:e})=>{const[t,n]=k.useState(!1);return k.useEffect(()=>{let i;return e?n(!0):i=setTimeout(()=>{n(!1)},100),()=>{clearTimeout(i)}},[e]),t},O8=({className:e,customContent:t=null,inputRef:n,isOpen:i,isOpened:s,children:r,setOpenState:o,listHeight:a="190px",onOpened:l,onClose:c,onClosed:u,...d})=>{const[h,f]=k.useState(null),[p,m]=k.useState(null),v=k.useMemo(()=>[{name:"matchReferenceWidth",enabled:!0,fn:({state:S,instance:C})=>{if(!p)return;const M=p.offsetWidth,P=S.rects.reference.width;Math.round(M)!==Math.round(P)&&(p.style.width=`${P}px`,C.update())},phase:"beforeWrite",requires:["computeStyles"]}],[p]),y=A8({isOpen:i}),{styles:g,attributes:x,update:_}=Oh(h,p,{modifiers:v}),w=I("autocomplete-dropdown",i&&"open",e);return D8({isOpened:s,setOpenState:o,dropdownEl:p,inputRef:n,onClose:c}),E8({inputRef:n,dropdownEl:p}),k.useEffect(()=>{n.current&&f(n.current)},[n]),k.useEffect(()=>{i&&(_==null||_())},[i,_,y]),b.jsx(b.Fragment,{children:b.jsx(aa,{children:b.jsx("div",{className:"autocomplete-dropdown-container",ref:m,...d,style:g.popper,...x.popper,onTransitionEnd:S=>{S.propertyName==="opacity"&&(y?l==null||l():u==null||u())},children:b.jsxs("div",{className:w,children:[b.jsx("ul",{className:"autocomplete-items-list",role:"listbox",style:{maxHeight:a,display:y?"block":"none"},children:r}),t]})})})})},R8=({className:e,isActive:t,children:n,onSelect:i,value:s,...r})=>{const o=I("autocomplete-item",t&&"active",e),a=k.useRef(null);return k.useEffect(()=>{!t||!a.current||a.current.scrollIntoView({block:"nearest"})},[t]),b.jsx("li",{className:o,onClick:()=>i(s),ref:a,...r,children:n})},L8=({isOpen:e,setOpenState:t,length:n})=>{const[i,s]=k.useState(-1),r=k.useCallback(o=>{const a=o.key==="Tab",l=o.key==="Escape",c=o.key==="ArrowUp",u=o.key==="ArrowDown",d=o.key==="Home",h=o.key==="End",f=o.key==="Enter",p=o.altKey,m=n-1;if(!e)return s(-1);if(l||f||a||p&&c)return t(!1);if(u){o.preventDefault(),s(v=>v===m?m:v+1);return}if(c){o.preventDefault(),s(v=>v===0?0:v-1);return}if(d&&i!==-1){o.preventDefault(),s(0);return}if(h&&i!==-1){o.preventDefault(),s(m);return}},[e,t,n,i]);return k.useEffect(()=>{s(-1)},[n]),k.useEffect(()=>(document.addEventListener("keydown",r),()=>{document.removeEventListener("keydown",r)}),[r]),i},N8=Y.forwardRef(({open:e,autoSelect:t,className:n,customContent:i,data:s=[],displayValue:r,value:o,isLoading:a,listHeight:l,noResults:c="No results found",itemContent:u,onSelect:d,onSearch:h,onChange:f,onClose:p,onClosed:m,onOpen:v,onOpened:y,...g},x)=>{const _=k.useRef(null),[w,S]=k.useState(!1),[C,M]=k.useState(!1),P=ef(w,e),[T,A]=k.useState(""),E=k.useMemo(()=>o!==void 0?o:T,[o,T]),z=L8({isOpen:P,setOpenState:S,length:s.length});k.useImperativeHandle(x,()=>_.current);const N=I(P&&"focused","autocomplete-input",n),R=I((P||E)&&"active","autocomplete-label"),L=()=>{S(!0),v==null||v(),_.current&&!_.current.value&&(h==null||h(""))},B=$=>r?r($):$,D=$=>{S(!1),_.current&&(_.current.value=$,h==null||h($),d==null||d($),f==null||f($),p==null||p(),A($))};return b.jsxs(b.Fragment,{children:[b.jsx(wi,{autoComplete:"off",onKeyDown:$=>{const F=$.key==="Enter",V=$.key==="Tab";if(!w)return S(!0);z!==-1&&(F||t&&V)&&D(B(s[z]))},onChange:$=>{h==null||h($.target.value),f==null||f($.target.value),A($.target.value)},onFocus:L,className:N,labelClass:R,ref:_,role:"combobox",value:E,...g,children:a&&b.jsx("div",{className:"autocomplete-loader spinner-border",children:b.jsx("span",{className:"sr-only",children:"Loading..."})})}),b.jsxs(O8,{isOpen:P,isOpened:C,inputRef:_,setOpenState:S,customContent:i,listHeight:l,onClose:p,onOpened:()=>{y==null||y(),M(!0)},onClosed:()=>{m==null||m(),M(!1)},children:[s.length===0&&b.jsx("li",{className:"autocomplete-item autocomplete-no-results",children:c}),s.map(($,F)=>b.jsx(R8,{isActive:z===F,value:B($),onSelect:D,children:u?u($):B($)},F))]})]})});N8.displayName="MDBAutocomplete";const j8=Y.forwardRef(({className:e,icon:t,tag:n="p",children:i,...s},r)=>{const o=I("popconfirm-message",e);return b.jsxs(n,{className:o,ref:r,...s,children:[t&&b.jsx("span",{className:"popconfirm-icon-container",children:t}),b.jsx("span",{className:"popconfirm-message-text",children:i})]})});j8.displayName="MDBPopconfirmMessage";const $8=Y.forwardRef(({className:e,tag:t="div",zoomLevel:n=1,fontAwesome:i="free",children:s,lightboxRef:r,onOpen:o,onClose:a,onSlide:l,onZoomIn:c,onZoomOut:u,disablePortal:d,...h},f)=>{const p=k.useRef(null),m=k.useRef(null),v=r||m,y=k.useRef(null),[g,x]=k.useState(!1),[_,w]=k.useState(0),[S,C]=k.useState(!1),[M,P]=k.useState([]),[T,A]=k.useState(""),[E,z]=k.useState(1),[N,R]=k.useState(!1),[L,B]=k.useState(),[D,$]=k.useState(!1),F=k.useRef(!1),V=k.useRef(!1),W=k.useRef(),et=k.useRef(),Z=k.useRef(),O=k.useRef(),U=k.useRef(),lt=k.useRef(),ct=k.useRef(),kt=I("lightbox",e),it=I(i==="pro"&&"fontawesome-pro"),Rt=I("lightbox-gallery-close-btn",i==="pro"&&"fontawesome-pro"),Ct=I("lightbox-gallery-fullscreen-btn",i==="pro"&&"fontawesome-pro",S&&"active"),Qt=I("lightbox-gallery-zoom-btn",i==="pro"&&"fontawesome-pro",E>1&&"active"),ft=k.useMemo(()=>document.documentElement.dir==="rtl",[]),wt=()=>{F.current=!0,setTimeout(()=>{F.current=!1},400)},dt=k.useCallback(j=>{let Q=j;return Q>M.length-1?Q=0:Q<0&&(Q=M.length-1),M[Q].classList.contains("lightbox-disabled")?dt(Q-1):Q},[M]),jt=k.useCallback(()=>{E>=3||(z(j=>j+n),c==null||c())},[c,E,n]),pt=k.useCallback(()=>{var j;const Q=(j=p.current)==null?void 0:j.querySelector(".lightbox-gallery-item.active");Q!=null&&Q.parentElement&&(Q.parentElement.style.left="0",Q.parentElement.style.top="0",Q.style.transition="all 0.5s ease-out",Q.style.left="0",Q.style.top="0",ls(Q),setTimeout(()=>{Q.style.transition="none"},500))},[]),xt=k.useCallback(()=>{E-n===1&&pt(),!(E<=1)&&(z(j=>j-n),u==null||u())},[u,pt,E,n]),J=k.useCallback(()=>{var j;p.current&&Array.from((j=p.current)==null?void 0:j.querySelectorAll(".lightbox-gallery-item")).forEach(Q=>{ls(Q)})},[]),mt=k.useCallback(()=>{S&&document.exitFullscreen&&document.exitFullscreen(),setTimeout(()=>{document.body.classList.remove("disabled-scroll"),document.body.classList.remove("replace-scrollbar")}),x(!1),z(1),R(!1),J(),a==null||a()},[J,S,a]),q=k.useCallback(j=>{if(F.current||M.length<=1)return _;let Q=0;switch(j){case"left":Q=_-1;break;case"right":Q=_+1;break;case"last":Q=M.length-1;break;case"first":Q=0;break}wt();const It=dt(Q);w(It),z(1),R(!1),setTimeout(()=>{var nt;const Tt=(nt=p.current)==null?void 0:nt.querySelector(".lightbox-gallery-item.active");J(),A(Tt.getAttribute("data-mdb-caption"))},300),l==null||l()},[_,J,M.length,l,dt]),ye=k.useCallback(j=>{if(g)switch(j.nativeEvent.key){case"ArrowRight":q(ft?"left":"right");break;case"ArrowLeft":q(ft?"right":"left");break;case"Escape":mt();break;case"Home":q("first");break;case"End":q("last");break;case"ArrowUp":jt();break;case"ArrowDown":xt();break}},[mt,q,jt,xt,g,ft]),Dt=k.useCallback(j=>{document.body.classList.add("disabled-scroll"),document.documentElement.scrollHeight>document.documentElement.clientHeight&&document.body.classList.add("replace-scrollbar"),x(!0),w(j),R(!1),J(),setTimeout(()=>{var Q;const It=(Q=p.current)==null?void 0:Q.querySelector(".lightbox-gallery-item.active");A(It.getAttribute("data-mdb-caption"))},0),o==null||o()},[J,o]);k.useImperativeHandle(f,()=>({outsideAccess(j){Dt(j)}}));const he=k.useCallback(()=>{(document.webkitIsFullScreen||document.mozFullScreen||document.msFullscreenElement)===void 0&&C(!1)},[]),Un=()=>{var j,Q,It;if(!S){(Q=(j=p.current)==null?void 0:j.requestFullscreen)==null||Q.call(j),C(!0);return}(It=document.exitFullscreen)==null||It.call(document),C(!1)},Yn=j=>{j.nativeEvent.preventDefault();const Q=j.nativeEvent instanceof TouchEvent?j.nativeEvent.touches[0]:j.nativeEvent,It=Q.clientX,nt=Q.clientY;j.nativeEvent instanceof TouchEvent&&j.type==="touchstart"&&j.nativeEvent.touches.length>1&&($(!0),B(j.nativeEvent.touches));const Tt=j.target;Z.current=parseFloat(Tt.style.left),O.current=parseFloat(Tt.style.top),W.current=parseFloat(Tt.style.left),et.current=parseFloat(Tt.style.top),U.current=It*(1/E)-W.current,lt.current=nt*(1/E)-et.current,R(!0)},Mn=j=>{if(j.type==="touchmove"&&j.nativeEvent instanceof TouchEvent&&j.nativeEvent.targetTouches.length>1&&(j.nativeEvent.preventDefault(),as(j)),!N||D)return;const Q=j.nativeEvent instanceof TouchEvent?j.nativeEvent.touches[0]:j.nativeEvent,It=Q.clientX,nt=Q.clientY,Tt=j.target;if(E!==1){W.current=It*(1/E)-U.current,et.current=nt*(1/E)-lt.current,Tt.style.left=`${W.current}px`,Tt.style.top=`${et.current}px`;return}M.length<=1||(W.current=It*(1/E)-U.current,Tt.style.left=`${W.current}px`)},Si=k.useCallback(()=>{if(!(E!==1||M.length<=1||!W.current||D)){if(W.current-(Z.current||0)>0){q(ft?"right":"left");return}q(ft?"left":"right")}},[q,D,ft,M.length,E]),dn=k.useCallback(j=>{D||(j.nativeEvent instanceof TouchEvent&&!j.nativeEvent.touches&&Xn(j),E!==1?xt():jt())},[jt,xt,D,E]),Mi=j=>{if(R(!1),j.nativeEvent instanceof MouseEvent){Si(),R(!1);return}if(D&&j.targetTouches.length===0){$(!1),B(void 0);return}R(!1),Si()},as=j=>{if(!L)return;const Q=Math.hypot(L[1].pageX-L[0].pageX,L[1].pageY-L[0].pageY),It=Math.hypot(j.nativeEvent.touches[1].pageX-j.nativeEvent.touches[0].pageX,j.nativeEvent.touches[1].pageY-j.nativeEvent.touches[0].pageY),nt=Math.abs(Q-It),Tt=j.nativeEvent.view.screen.width;nt<=Tt*.03||(Q<=It?jt():xt(),B(j.nativeEvent.touches))},ls=j=>{j.parentElement&&(j.width>=j.height?(j.style.width="100%",j.style.maxWidth="100%",j.style.height="auto",j.style.top=`${(j.parentElement.offsetHeight-j.height)/2}px`,j.style.left="0"):(j.style.height="100%",j.style.maxHeight="100%",j.style.width="auto",j.style.left=`${(j.parentElement.offsetWidth-j.width)/2}px`,j.style.top="0"),j.width>=j.parentElement.offsetWidth&&(j.style.width=`${j.parentElement.offsetWidth}px`,j.style.height="auto",j.style.left="0",j.style.top=`${(j.parentElement.offsetHeight-j.height)/2}px`),j.height>=j.parentElement.offsetHeight&&(j.style.height=`${j.parentElement.offsetHeight}px`,j.style.width="auto",j.style.top="0",j.style.left=`${(j.parentElement.offsetWidth-j.width)/2}px`),W.current=parseFloat(j.style.left)||0,et.current=parseFloat(j.style.top)||0)},Ci=j=>{const Q=j.getAttribute("data-mdb-img")?j.getAttribute("data-mdb-img"):j.getAttribute("src")?j.getAttribute("src"):"",It=j.getAttribute("alt")?j.getAttribute("alt"):j.getAttribute("data-mdb-caption")?j.getAttribute("data-mdb-caption"):"",nt=j.getAttribute("data-mdb-caption")?j.getAttribute("data-mdb-caption"):j.getAttribute("alt")?j.getAttribute("alt"):"";return{source:Q,alt:It,caption:nt}},Pi=k.useCallback(()=>{const j=[...v.current.querySelectorAll(".lightbox-item")].filter(Q=>!Q.classList.contains("lightbox-disabled"));P(j)},[v]),Ke=k.useCallback(()=>{J()},[J]),Xn=j=>{W.current=window.innerWidth/2-j.nativeEvent.offsetX-50,et.current=window.innerHeight/2-j.nativeEvent.offsetY-50;const Q=j.target;Q.style.left=`${W.current}px`,Q.style.top=`${et.current}px`,Q.style.transition="all 0.5s ease-out",setTimeout(()=>{Q.style.transition="none"},500)},Ti=j=>{if(j.deltaY>0)return xt();E>=3||(Xn(j),jt())};return k.useEffect(()=>{Pi()},[Pi]),k.useEffect(()=>{M.length&&J()},[J,M]),k.useEffect(()=>(M.forEach((j,Q)=>{!j.classList.contains("lightbox-disabled")&&j.addEventListener("click",()=>Dt(Q))}),()=>{M.forEach((j,Q)=>{j.removeEventListener("click",()=>Dt(Q))})}),[Dt,M]),k.useEffect(()=>(window.addEventListener("resize",Ke),window.addEventListener("fullscreenchange",he),()=>{window.removeEventListener("resize",Ke),window.removeEventListener("fullscreenchange",he)}),[he,Ke]),k.useEffect(()=>{const j=document.querySelector("meta[name=viewport]");if(ct.current||(ct.current=(j==null?void 0:j.getAttribute("content"))||""),!g){V.current=!1,j==null||j.setAttribute("content",ct.current);return}setTimeout(()=>{var Q;V.current=!0,(Q=y.current)==null||Q.focus(),j==null||j.setAttribute("content",`${ct.current} user-scalable=no`)},300)},[g]),b.jsxs(b.Fragment,{children:[b.jsx(t,{ref:v,className:kt,...h,children:s}),b.jsx(aa,{disablePortal:d,children:b.jsxs("div",{className:"lightbox-gallery",onClick:j=>j.target.tagName==="DIV"&&mt(),onKeyUp:ye,ref:p,style:{opacity:g?1:0,pointerEvents:g?"initial":"none",visibility:g?"visible":"hidden"},children:[b.jsx("div",{className:"lightbox-gallery-loader"}),b.jsxs("div",{className:"lightbox-gallery-toolbar",children:[b.jsx("div",{className:"lightbox-gallery-left-tools",children:b.jsx("p",{className:"lightbox-gallery-counter",children:`${_+1} / ${M.length}`})}),b.jsxs("div",{className:"lightbox-gallery-right-tools",children:[b.jsx("button",{className:Ct,onClick:Un}),b.jsx("button",{"aria-label":E>1?"Zoom out":"Zoom in",className:Qt,onClick:()=>E>1?xt():jt()}),b.jsx("button",{className:Rt,onClick:mt})]})]}),b.jsx("div",{className:"lightbox-gallery-content",style:{transform:g?"scale(1)":"scale(0.25)",transition:"all 0.5s ease-out"},children:M.map((j,Q)=>{const{source:It,alt:nt,caption:Tt}=Ci(j),Oe=Q===_?1:0,cs=Q===_?E:0,ai=_===M.length-1&&Q===0&&M.length>1,Kn=_===0&&Q===M.length-1&&M.length>1;let Me;return _Q&&!ai||Kn?Me="-100%":Me="0%",b.jsx("div",{className:"lightbox-gallery-image",style:{position:"absolute",opacity:Oe,left:g?Me:"0%",transform:`scale(${cs})`,transition:_===Q||V.current?"all 0.5s ease-out":"none"},children:b.jsx("img",{src:It||"",alt:nt||"","data-mdb-caption":Tt||"",onMouseDown:Yn,onMouseMove:Mn,onMouseUp:Mi,onWheel:Ti,onTouchStart:Yn,onTouchMove:Mn,onTouchEnd:Mi,onDoubleClick:dn,className:`lightbox-gallery-item ${_===Q&&"active"}`})},Q)})}),b.jsx("div",{className:"lightbox-gallery-arrow-left",children:b.jsx("button",{"aria-label":"Previous",className:it,onClick:()=>q("left")})}),b.jsx("div",{className:"lightbox-gallery-arrow-right",children:b.jsx("button",{"aria-label":"Next",className:it,onClick:()=>q("right"),ref:y})}),b.jsx("div",{className:"lightbox-gallery-caption-wrapper",children:b.jsx("p",{className:"lightbox-gallery-caption",children:T})})]})})]})});$8.displayName="MDBLightbox";const I8=Y.forwardRef(({className:e,fullscreenSrc:t,disabled:n,caption:i,...s},r)=>{const o=I("lightbox-item",n&&"lightbox-disabled",e);return b.jsx("img",{ref:r,"data-mdb-caption":i,"data-mdb-img":t,className:o,...s})});I8.displayName="MDBLightboxItem";const F8=Y.forwardRef(({className:e,...t},n)=>{const[i,s]=k.useState(!1),r=k.useCallback(()=>{const a=document.documentElement.scrollTop;s(!!a)},[]),o=I(i&&"navbar-scrolled","navbar-scroll",e);return k.useEffect(()=>{window.addEventListener("scroll",r)},[r]),b.jsx(pT,{className:o,ref:n,...t})});F8.displayName="MDBAnimatedNavbar";const LT=k.forwardRef(({className:e,closeIcon:t,tag:n="div",color:i,size:s,children:r,onDelete:o,...a},l)=>{const[c,u]=k.useState(!0),d=I("chip",s&&`chip-${s}`,i&&`chip-outline btn-outline-${i}`,e);return c?b.jsxs(n,{ref:l,className:d,...a,children:[r,t&&b.jsx("i",{className:"close fas fa-times",onClick:()=>{o==null||o(r),u(!1)}})]}):null});LT.displayName="MDBChip";const B8=Y.forwardRef(({className:e,value:t="",id:n,labelId:i,labelClass:s,label:r,onChange:o,labelRef:a,labelStyle:l,readonly:c,editable:u,onAdd:d,onDelete:h,initialValues:f=[],...p},m)=>{const v=k.useRef(null),y=a??v,g=k.useRef(null);k.useImperativeHandle(m,()=>g.current);const[x,_]=k.useState(f),[w,S]=k.useState(null),[C,M]=k.useState(0),[P,T]=k.useState(null),[A,E]=k.useState(t),z=x.length>0||A.length>0,N=I("form-outline","chips-input-wrapper",x.length>0&&"chips-padding chips-transition"),R=I("form-control",z&&"active",e),L=I("form-label",s);k.useEffect(()=>{!y.current||y.current.clientWidth===0||M(y.current.clientWidth*.8+8)},[y]);const B=()=>{y.current&&M(y.current.clientWidth*.8+8)},D=O=>{E(O.target.value),o==null||o(O)},$=O=>{A.length||((O.key==="ArrowLeft"||O.key==="ArrowDown")&&T(U=>U?U-1:x.length-1),(O.key==="ArrowRight"||O.key==="ArrowUp")&&T(U=>U===x.length-1||U===null?0:U+1),O.key==="Backspace"&&P!==null&&F(P)),O.key==="Enter"&&A.trim().length&&(d==null||d(A),_([...x,{tag:A}]),E(""))},F=O=>{const U=x.find((lt,ct)=>O===ct);if(U){h==null||h(U==null?void 0:U.tag);const lt=x.filter((ct,kt)=>O!==kt);_(lt),T(null)}},V=(O,U)=>{u&&S(U)},W=(O,U)=>{if(!u)return;const lt=O.currentTarget.textContent,ct=x.map((kt,it)=>it===U&<?{tag:lt}:kt);lt?_(ct):F(U),S(null),T(null)},et=(O,U)=>{O.key==="Enter"&&u&&w!==null&&W(O,U)},Z=()=>{A.trim().length&&(d==null||d(A),_([...x,{tag:A}]),E(""))};return b.jsx("div",{className:"chips chips-placeholder",children:b.jsxs("div",{className:N,children:[x.map((O,U)=>b.jsx(LT,{contentEditable:w===U,suppressContentEditableWarning:!0,onDoubleClick:lt=>V(lt,U),onDelete:()=>F(U),onKeyDown:lt=>et(lt,U),closeIcon:w!==U,className:I("btn",U===P&&"active"),children:O.tag},`${Math.random()}-${U}`)),b.jsx("input",{type:"text",readOnly:c,className:R,onChange:D,onFocus:B,onKeyDown:$,onBlur:()=>Z(),value:A,id:n,ref:g,...p}),r&&b.jsx("label",{className:L,style:l,id:i,htmlFor:n,ref:y,children:r}),b.jsxs("div",{className:"form-notch",children:[b.jsx("div",{className:"form-notch-leading"}),b.jsx("div",{className:"form-notch-middle",style:{width:C}}),b.jsx("div",{className:"form-notch-trailing"})]})]})})});B8.displayName="MDBChipsInput";const V8="Case 3: Θ(nk)";function z8(){const[e,t]=k.useState(""),[n,i]=k.useState(""),[s,r]=k.useState(""),[o,a]=k.useState(null),[l,c]=k.useState(!1),[u,d]=k.useState([]),[h,f]=k.useState(!1),[p,m]=k.useState(null),[v,y]=k.useState(null),g=k.useRef(null);k.useEffect(()=>{if(l&&o&&o.plot_data&&g&&g.current){const M=g.current.getContext("2d");M&&new by(M,{type:"line",data:{labels:o.plot_data.n,datasets:[{label:"n^log_b(a)",data:o.plot_data.n_log_b_a,borderColor:"blue",borderWidth:1,fill:!1},{label:"f(n)",data:o.plot_data.f_n,borderColor:"red",borderWidth:2,fill:!1,borderDash:[5,5]},{label:"Time Complexity",data:o.plot_data.time_complexity,borderColor:"green",borderWidth:2,fill:!1,borderDash:[10,5]}]},options:{scales:{y:{beginAtZero:!0,title:{display:!0,text:"Function Value",color:"#888",font:{size:12}},ticks:{}},x:{grid:{display:!0},ticks:{callback:function(P){return Number(P).toFixed(0)}},title:{display:!0,text:"Input Size (n)",color:"#888",font:{size:12}}}},plugins:{legend:{display:!0,position:"top",labels:{boxWidth:20,padding:10}},tooltip:{enabled:!0}},elements:{line:{borderWidth:1},point:{radius:0}},responsive:!0,maintainAspectRatio:!1}})}},[l,o]),k.useEffect(()=>{(async()=>{try{const P=await fetch("http://master-theorem-aws-test2-dev.us-west-2.elasticbeanstalk.com/api/algorithms");if(!P.ok)throw new Error("Network response was not ok");const T=await P.json();d(T)}catch(P){console.error("Failed to fetch algorithms:",P)}})()},[]);const x=M=>{if(M===-1)f(!1),t(""),i(""),r(""),y(null);else{const P=u.find(T=>T.id===M);P&&(t(P.a.toString()),i(P.b.toString()),r(P.k.toString()),f(!0),y(P))}},_=async M=>{M.preventDefault(),await w(M)},w=async M=>{M.preventDefault(),c(!1),m(v);try{const P=await fetch("http://master-theorem-aws-test2-dev.us-west-2.elasticbeanstalk.com/api/evaluate/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({a:e,b:n,k:s})});if(!P.ok)throw new Error("Network response was not ok");const T=await P.json();a(T),c(!0)}catch(P){console.error("There was a problem with your fetch operation:",P)}},S=M=>{var P;if(Array.isArray(M))console.log("Multiple selections are not supported.");else{const T=parseInt(((P=M.value)==null?void 0:P.toString())||"-1",10);x(T)}},C=[{text:"User Input",value:"-1"},...u.map(M=>({text:M.name,value:M.id.toString()}))];return b.jsxs(b.Fragment,{children:[b.jsxs(od,{alignment:"center",children:[b.jsx(ad,{children:b.jsx("h1",{className:"main-header",children:"Evaluate Master Theorem"})}),b.jsxs(eg,{children:[b.jsx(fT,{children:b.jsx("span",{className:"card-title",children:"Enter the values of a, b, and k to evaluate the Master Theorem:"})}),b.jsxs("form",{onSubmit:_,children:[b.jsx(wi,{label:"a (number of subproblems)",id:"aInput",type:"number",min:"1",className:"my-4",value:e,onChange:M=>t(M.target.value),disabled:h}),b.jsx(wi,{label:"b (factor by which problem size is reduced)",id:"bInput",type:"number",min:"2",className:"my-4",value:n,onChange:M=>i(M.target.value),disabled:h}),b.jsx(wi,{label:"k (exponent in the work outside of recursive calls)",id:"kInput",type:"number",min:"0",className:"my-4",value:s,onChange:M=>r(M.target.value),disabled:h}),b.jsx("div",{className:"my-4",children:b.jsx(D0,{data:C,label:"Choose Algorithm or Enter Values",onChange:S})}),b.jsx(Zt,{onClick:w,className:"btn-block",children:"Evaluate"})]})]})]}),l&&o&&b.jsxs(od,{className:"my-4",children:[b.jsx(ad,{children:b.jsx("h2",{children:"Evaluation"})}),b.jsxs(eg,{className:"evaluation-card-body",children:[b.jsx("canvas",{ref:g,id:"myChart",className:"mb-3"}),b.jsxs(el,{children:[b.jsx("strong",{children:"Recurrence Relation: "}),b.jsx("span",{dangerouslySetInnerHTML:{__html:o.recurrence_relation}})]}),b.jsxs(el,{children:[b.jsx("strong",{children:"Evaluation: "}),b.jsx("span",{dangerouslySetInnerHTML:{__html:o.case}})]}),o.case.includes(V8)&&b.jsxs(el,{children:[b.jsx("strong",{children:"Regularity Condition Met:"})," ",o.regularity_condition_met!==void 0&&(o.regularity_condition_met?"Yes":"No")]}),b.jsxs(el,{children:[b.jsx("strong",{children:"Time Complexity: "}),b.jsx("span",{dangerouslySetInnerHTML:{__html:o.complexity}})]})]}),p&&b.jsxs(b.Fragment,{children:[b.jsxs("h4",{children:[p.name," Algorithm"]}),b.jsxs(ng,{alwaysOpen:!0,initialActive:1,children:[b.jsx(oo,{className:"left-align",collapseId:1,headerTitle:b.jsxs(b.Fragment,{children:[b.jsx(sn,{fas:!0,icon:"question-circle"}),"   Algorithm Description"]}),children:b.jsx("article",{children:p.description})}),b.jsx(oo,{collapseId:2,headerTitle:b.jsxs(b.Fragment,{children:[b.jsx(sn,{fab:!0,icon:"python"}),"   Python Code"]}),children:b.jsx("pre",{className:"left-align",children:b.jsx("code",{children:p.python_code})})})]})]})]}),b.jsxs(od,{alignment:"center",className:"my-4",children:[b.jsx(ad,{children:b.jsx("h2",{children:"About the Master Theorem"})}),b.jsxs(ng,{initialActive:1,children:[b.jsx(oo,{className:"left-align",collapseId:1,headerTitle:"What is the Master Theorem?",children:b.jsxs("article",{children:[b.jsxs("p",{children:["The ",b.jsx("strong",{children:"Master Theorem"})," offers a straightforward way to determine the time complexity of recursive algorithms, especially those that follow the divide and conquer approach. This theorem simplifies the process of analyzing how efficiently an algorithm runs as the size of its input increases. It is particularly useful for computer scientists and software engineers to predict algorithm performance without the need for detailed benchmarks."]}),b.jsx("p",{children:"The following parameters are required to evaluate an algorithm using the Master Theorem:"}),b.jsxs("ul",{children:[b.jsxs("li",{children:[b.jsx("strong",{children:"a"})," = the number of recursive subproblems."]}),b.jsxs("li",{children:[b.jsx("strong",{children:"b"})," = the factor by which the problem size is reduced."]}),b.jsxs("li",{children:[b.jsx("strong",{children:"k"})," = the exponent in the work done outside of the recursive function."]})]})]})}),b.jsx(oo,{className:"left-align",collapseId:2,headerTitle:"Decoding the Master Recurrence",children:b.jsxs("article",{children:[b.jsx("p",{children:"The Master Theorem can only be used to evaluate recursive algorithms with the following recurrence relation:"}),b.jsx("p",{className:"text-center",children:b.jsx("strong",{children:"T(n) = aT(n/b) + f(n)"})}),b.jsxs("p",{children:["This equation is the heart of the Master Theorem. and is called the ",b.jsx("strong",{children:"Master Recurrence"}),". It captures the essence of divide and conquer algorithms:"]}),b.jsxs("ul",{children:[b.jsxs("li",{children:[b.jsx("strong",{children:"T(n)"})," is the total time complexity we aim to find."]}),b.jsxs("li",{children:[b.jsx("strong",{children:"aT(n/b)"})," represents the time taken by the recursive subproblems."]}),b.jsxs("li",{children:[b.jsx("strong",{children:"f(n)"})," is the time taken by the work done outside the recursive calls, such as dividing the problem or combining the results."]})]}),b.jsx("p",{children:"Evaluating the Master Theorem involves comparing the rate of growth of two separate functions:"}),b.jsxs("ul",{children:[b.jsx("p",{className:"text-center",children:b.jsxs("strong",{children:["n",b.jsx("sup",{children:"logb(a)"})," + f(n)"]})}),b.jsxs("li",{children:[b.jsxs("strong",{children:["n",b.jsxs("sup",{children:["log",b.jsx("sub",{children:"b"}),"(a)"]})]})," ","is also known as the ",b.jsx("strong",{children:"watershed function."})]}),b.jsxs("li",{children:[b.jsx("strong",{children:"f(n)"})," is also known as the"," ",b.jsx("strong",{children:"driving function."})]})]}),b.jsx("p",{children:"Comparing the growth rate of these 2 functions results in either of 3 possible cases."})]})}),b.jsx(oo,{className:"left-align",collapseId:3,headerTitle:"The 3 Cases of the Master Theorem",children:b.jsxs("article",{children:[b.jsxs("p",{children:[b.jsx("strong",{children:"Case 1"}),": n",b.jsxs("sup",{children:["log",b.jsx("sub",{children:"b"}),"(a)"]})," ","grows asymptotically and polynomially greater than f(n):"]}),b.jsx("p",{className:"text-center",children:b.jsxs("strong",{children:["T(n) = n",b.jsxs("sup",{children:["log",b.jsx("sub",{children:"b"}),"(a)"]})]})}),b.jsxs("p",{children:[b.jsx("strong",{children:"Case 2:"})," n",b.jsxs("sup",{children:["log",b.jsx("sub",{children:"b"}),"(a)"]})," ","and f(n) grow at the same rate:"]}),b.jsx("p",{className:"text-center",children:b.jsxs("strong",{children:["T(n) = n",b.jsx("sup",{children:"k"})," log(n)"]})}),b.jsxs("p",{children:[b.jsx("strong",{children:"Case 3:"})," f(n) grows assymptotically and polynomially greater than n",b.jsxs("sup",{children:["log",b.jsx("sub",{children:"b"}),"(a)"]})," ","(and must also fulfill the"," ",b.jsxs("strong",{children:["regularity condition",b.jsx("sup",{children:"*"}),")"]})," ",":"]}),b.jsx("p",{className:"text-center",children:b.jsxs("strong",{children:["T(n) = f(n",b.jsx("sup",{children:"k"}),")"]})}),b.jsxs("ul",{children:[b.jsxs("li",{children:[b.jsx("strong",{children:"Case 1"})," occurs when the split subproblems dominate the overall time complexity. It implies that as we break the problem down, the sheer number of subproblems is the primary driver of the complexity."]}),b.jsxs("li",{children:[b.jsx("strong",{children:"Case 2"})," occurs when the work done at each level of recursion is just as significant as the number of subproblems. This balance means the time complexity is a combination of the dividing/conquering work and the depth of the recursion."]}),b.jsxs("li",{children:[b.jsx("strong",{children:"Case 3"})," highlights scenarios where the work done outside the recursive calls (combining solutions, for instance) is the main factor determining the time complexity. This is typically seen in algorithms where merging or processing results is more intensive than breaking down the problem."]})]}),b.jsx("p",{children:b.jsxs("small",{children:[b.jsx("strong",{children:"* "}),"The regularity condition ensures that the work done at the recursive levels does not grow too quickly compared to the work done to divide the problem and combine the results. This condition helps maintain the integrity of the complexity analysis provided by the theorem."]})})]})})]})]})]})}Sp.createRoot(document.getElementById("root")).render(b.jsx(Y.StrictMode,{children:b.jsx(z8,{})})); diff --git a/static/index.html b/static/index.html index efeeec2..0ee5fa4 100644 --- a/static/index.html +++ b/static/index.html @@ -7,7 +7,7 @@ Evaluate Master Theorem - + diff --git a/staticfiles/assets/index-HE6f1_nl.js b/staticfiles/assets/index-C14P8ZTk.js similarity index 88% rename from staticfiles/assets/index-HE6f1_nl.js rename to staticfiles/assets/index-C14P8ZTk.js index a1417ae..21bbe8f 100644 --- a/staticfiles/assets/index-HE6f1_nl.js +++ b/staticfiles/assets/index-C14P8ZTk.js @@ -6,7 +6,7 @@ var FT=Object.defineProperty;var BT=(e,t,n)=>t in e?FT(e,t,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var oc=Symbol.for("react.element"),VT=Symbol.for("react.portal"),zT=Symbol.for("react.fragment"),WT=Symbol.for("react.strict_mode"),HT=Symbol.for("react.profiler"),UT=Symbol.for("react.provider"),YT=Symbol.for("react.context"),XT=Symbol.for("react.forward_ref"),KT=Symbol.for("react.suspense"),GT=Symbol.for("react.memo"),qT=Symbol.for("react.lazy"),L0=Symbol.iterator;function QT(e){return e===null||typeof e!="object"?null:(e=L0&&e[L0]||e["@@iterator"],typeof e=="function"?e:null)}var xw={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},bw=Object.assign,_w={};function ia(e,t,n){this.props=e,this.context=t,this.refs=_w,this.updater=n||xw}ia.prototype.isReactComponent={};ia.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};ia.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function ww(){}ww.prototype=ia.prototype;function cg(e,t,n){this.props=e,this.context=t,this.refs=_w,this.updater=n||xw}var ug=cg.prototype=new ww;ug.constructor=cg;bw(ug,ia.prototype);ug.isPureReactComponent=!0;var R0=Array.isArray,kw=Object.prototype.hasOwnProperty,dg={current:null},Sw={key:!0,ref:!0,__self:!0,__source:!0};function Mw(e,t,n){var i,s={},r=null,o=null;if(t!=null)for(i in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(r=""+t.key),t)kw.call(t,i)&&!Sw.hasOwnProperty(i)&&(s[i]=t[i]);var a=arguments.length-2;if(a===1)s.children=n;else if(1t in e?FT(e,t,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */(function(e){function t(D,$){var F=D.length;D.push($);t:for(;0>>1,W=D[V];if(0>>1;Vs(O,F))Us(lt,O)?(D[V]=lt,D[U]=F,V=U):(D[V]=O,D[Z]=F,V=Z);else if(Us(lt,F))D[V]=lt,D[U]=F,V=U;else break t}}return $}function s(D,$){var F=D.sortIndex-$.sortIndex;return F!==0?F:D.id-$.id}if(typeof performance=="object"&&typeof performance.now=="function"){var r=performance;e.unstable_now=function(){return r.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var l=[],c=[],u=1,d=null,h=3,f=!1,p=!1,m=!1,v=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(D){for(var $=n(c);$!==null;){if($.callback===null)i(c);else if($.startTime<=D)i(c),$.sortIndex=$.expirationTime,t(l,$);else break;$=n(c)}}function _(D){if(m=!1,x(D),!p)if(n(l)!==null)p=!0,R(w);else{var $=n(c);$!==null&&B(_,$.startTime-D)}}function w(D,$){p=!1,m&&(m=!1,y(M),M=-1),f=!0;var F=h;try{for(x($),d=n(l);d!==null&&(!(d.expirationTime>$)||D&&!A());){var V=d.callback;if(typeof V=="function"){d.callback=null,h=d.priorityLevel;var W=V(d.expirationTime<=$);$=e.unstable_now(),typeof W=="function"?d.callback=W:d===n(l)&&i(l),x($)}else i(l);d=n(l)}if(d!==null)var et=!0;else{var Z=n(c);Z!==null&&B(_,Z.startTime-$),et=!1}return et}finally{d=null,h=F,f=!1}}var S=!1,C=null,M=-1,P=5,T=-1;function A(){return!(e.unstable_now()-TD||125V?(D.sortIndex=F,t(c,D),n(l)===null&&D===n(c)&&(m?(y(M),M=-1):m=!0,B(_,F-V))):(D.sortIndex=W,t(l,D),p||f||(p=!0,R(w))),D},e.unstable_shouldYield=A,e.unstable_wrapCallback=function(D){var $=h;return function(){var F=h;h=$;try{return D.apply(this,arguments)}finally{h=F}}}})(Dw);Tw.exports=Dw;var lD=Tw.exports;/** + */(function(e){function t(D,$){var F=D.length;D.push($);t:for(;0>>1,W=D[V];if(0>>1;Vs(O,F))Us(lt,O)?(D[V]=lt,D[U]=F,V=U):(D[V]=O,D[Z]=F,V=Z);else if(Us(lt,F))D[V]=lt,D[U]=F,V=U;else break t}}return $}function s(D,$){var F=D.sortIndex-$.sortIndex;return F!==0?F:D.id-$.id}if(typeof performance=="object"&&typeof performance.now=="function"){var r=performance;e.unstable_now=function(){return r.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var l=[],c=[],u=1,d=null,h=3,f=!1,p=!1,m=!1,v=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(D){for(var $=n(c);$!==null;){if($.callback===null)i(c);else if($.startTime<=D)i(c),$.sortIndex=$.expirationTime,t(l,$);else break;$=n(c)}}function _(D){if(m=!1,x(D),!p)if(n(l)!==null)p=!0,L(w);else{var $=n(c);$!==null&&B(_,$.startTime-D)}}function w(D,$){p=!1,m&&(m=!1,y(M),M=-1),f=!0;var F=h;try{for(x($),d=n(l);d!==null&&(!(d.expirationTime>$)||D&&!A());){var V=d.callback;if(typeof V=="function"){d.callback=null,h=d.priorityLevel;var W=V(d.expirationTime<=$);$=e.unstable_now(),typeof W=="function"?d.callback=W:d===n(l)&&i(l),x($)}else i(l);d=n(l)}if(d!==null)var et=!0;else{var Z=n(c);Z!==null&&B(_,Z.startTime-$),et=!1}return et}finally{d=null,h=F,f=!1}}var S=!1,C=null,M=-1,P=5,T=-1;function A(){return!(e.unstable_now()-TD||125V?(D.sortIndex=F,t(c,D),n(l)===null&&D===n(c)&&(m?(y(M),M=-1):m=!0,B(_,F-V))):(D.sortIndex=W,t(l,D),p||f||(p=!0,L(w))),D},e.unstable_shouldYield=A,e.unstable_wrapCallback=function(D){var $=h;return function(){var F=h;h=$;try{return D.apply(this,arguments)}finally{h=F}}}})(Dw);Tw.exports=Dw;var lD=Tw.exports;/** * @license React * react-dom.production.min.js * @@ -30,31 +30,31 @@ var FT=Object.defineProperty;var BT=(e,t,n)=>t in e?FT(e,t,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Ew=k,_n=lD;function H(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Mp=Object.prototype.hasOwnProperty,cD=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,j0={},$0={};function uD(e){return Mp.call($0,e)?!0:Mp.call(j0,e)?!1:cD.test(e)?$0[e]=!0:(j0[e]=!0,!1)}function dD(e,t,n,i){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return i?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function hD(e,t,n,i){if(t===null||typeof t>"u"||dD(e,t,n,i))return!0;if(i)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Xe(e,t,n,i,s,r,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=i,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=r,this.removeEmptyString=o}var Ee={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ee[e]=new Xe(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ee[t]=new Xe(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ee[e]=new Xe(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ee[e]=new Xe(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Ee[e]=new Xe(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ee[e]=new Xe(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ee[e]=new Xe(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ee[e]=new Xe(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ee[e]=new Xe(e,5,!1,e.toLowerCase(),null,!1,!1)});var fg=/[\-:]([a-z])/g;function pg(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(fg,pg);Ee[t]=new Xe(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(fg,pg);Ee[t]=new Xe(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(fg,pg);Ee[t]=new Xe(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ee[e]=new Xe(e,1,!1,e.toLowerCase(),null,!1,!1)});Ee.xlinkHref=new Xe("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ee[e]=new Xe(e,1,!1,e.toLowerCase(),null,!0,!0)});function mg(e,t,n,i){var s=Ee.hasOwnProperty(t)?Ee[t]:null;(s!==null?s.type!==0:i||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Mp=Object.prototype.hasOwnProperty,cD=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,j0={},$0={};function uD(e){return Mp.call($0,e)?!0:Mp.call(j0,e)?!1:cD.test(e)?$0[e]=!0:(j0[e]=!0,!1)}function dD(e,t,n,i){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return i?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function hD(e,t,n,i){if(t===null||typeof t>"u"||dD(e,t,n,i))return!0;if(i)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Xe(e,t,n,i,s,r,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=i,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=r,this.removeEmptyString=o}var Ee={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ee[e]=new Xe(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ee[t]=new Xe(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ee[e]=new Xe(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ee[e]=new Xe(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Ee[e]=new Xe(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ee[e]=new Xe(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ee[e]=new Xe(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ee[e]=new Xe(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ee[e]=new Xe(e,5,!1,e.toLowerCase(),null,!1,!1)});var fg=/[\-:]([a-z])/g;function pg(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(fg,pg);Ee[t]=new Xe(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(fg,pg);Ee[t]=new Xe(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(fg,pg);Ee[t]=new Xe(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ee[e]=new Xe(e,1,!1,e.toLowerCase(),null,!1,!1)});Ee.xlinkHref=new Xe("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ee[e]=new Xe(e,1,!1,e.toLowerCase(),null,!0,!0)});function mg(e,t,n,i){var s=Ee.hasOwnProperty(t)?Ee[t]:null;(s!==null?s.type!==0:i||!(2a||s[o]!==r[a]){var l=` -`+s[o].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=o&&0<=a);break}}}finally{cf=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ha(e):""}function fD(e){switch(e.tag){case 5:return Ha(e.type);case 16:return Ha("Lazy");case 13:return Ha("Suspense");case 19:return Ha("SuspenseList");case 0:case 2:case 15:return e=uf(e.type,!1),e;case 11:return e=uf(e.type.render,!1),e;case 1:return e=uf(e.type,!0),e;default:return""}}function Dp(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case co:return"Fragment";case lo:return"Portal";case Cp:return"Profiler";case gg:return"StrictMode";case Pp:return"Suspense";case Tp:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Lw:return(e.displayName||"Context")+".Consumer";case Ow:return(e._context.displayName||"Context")+".Provider";case yg:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case vg:return t=e.displayName||null,t!==null?t:Dp(e.type)||"Memo";case ms:t=e._payload,e=e._init;try{return Dp(e(t))}catch{}}return null}function pD(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Dp(t);case 8:return t===gg?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Bs(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Nw(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function mD(e){var t=Nw(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),i=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,r=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(o){i=""+o,r.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(o){i=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Lc(e){e._valueTracker||(e._valueTracker=mD(e))}function jw(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),i="";return e&&(i=Nw(e)?e.checked?"true":"false":e.value),e=i,e!==n?(t.setValue(e),!0):!1}function cd(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Ep(e,t){var n=t.checked;return se({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function F0(e,t){var n=t.defaultValue==null?"":t.defaultValue,i=t.checked!=null?t.checked:t.defaultChecked;n=Bs(t.value!=null?t.value:n),e._wrapperState={initialChecked:i,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function $w(e,t){t=t.checked,t!=null&&mg(e,"checked",t,!1)}function Ap(e,t){$w(e,t);var n=Bs(t.value),i=t.type;if(n!=null)i==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(i==="submit"||i==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Op(e,t.type,n):t.hasOwnProperty("defaultValue")&&Op(e,t.type,Bs(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function B0(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var i=t.type;if(!(i!=="submit"&&i!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Op(e,t,n){(t!=="number"||cd(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ua=Array.isArray;function Co(e,t,n,i){if(e=e.options,t){t={};for(var s=0;s"+t.valueOf().toString()+"",t=Rc.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Cl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var el={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},gD=["Webkit","ms","Moz","O"];Object.keys(el).forEach(function(e){gD.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),el[t]=el[e]})});function Vw(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||el.hasOwnProperty(e)&&el[e]?(""+t).trim():t+"px"}function zw(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var i=n.indexOf("--")===0,s=Vw(n,t[n],i);n==="float"&&(n="cssFloat"),i?e.setProperty(n,s):e[n]=s}}var yD=se({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Np(e,t){if(t){if(yD[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(H(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(H(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(H(61))}if(t.style!=null&&typeof t.style!="object")throw Error(H(62))}}function jp(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var $p=null;function xg(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ip=null,Po=null,To=null;function W0(e){if(e=cc(e)){if(typeof Ip!="function")throw Error(H(280));var t=e.stateNode;t&&(t=ph(t),Ip(e.stateNode,e.type,t))}}function Ww(e){Po?To?To.push(e):To=[e]:Po=e}function Hw(){if(Po){var e=Po,t=To;if(To=Po=null,W0(e),t)for(e=0;e>>=0,e===0?32:31-(TD(e)/DD|0)|0}var Nc=64,jc=4194304;function Ya(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function fd(e,t){var n=e.pendingLanes;if(n===0)return 0;var i=0,s=e.suspendedLanes,r=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~s;a!==0?i=Ya(a):(r&=o,r!==0&&(i=Ya(r)))}else o=n&~s,o!==0?i=Ya(o):r!==0&&(i=Ya(r));if(i===0)return 0;if(t!==0&&t!==i&&!(t&s)&&(s=i&-i,r=t&-t,s>=r||s===16&&(r&4194240)!==0))return t;if(i&4&&(i|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=i;0n;n++)t.push(e);return t}function ac(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ei(t),e[t]=n}function LD(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var i=e.eventTimes;for(e=e.expirationTimes;0=il),Z0=" ",J0=!1;function uk(e,t){switch(e){case"keyup":return aE.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function dk(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var uo=!1;function cE(e,t){switch(e){case"compositionend":return dk(t);case"keypress":return t.which!==32?null:(J0=!0,Z0);case"textInput":return e=t.data,e===Z0&&J0?null:e;default:return null}}function uE(e,t){if(uo)return e==="compositionend"||!Pg&&uk(e,t)?(e=lk(),zu=Sg=_s=null,uo=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=i}t:{for(;n;){if(n.nextSibling){n=n.nextSibling;break t}n=n.parentNode}n=void 0}n=iv(n)}}function mk(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?mk(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function gk(){for(var e=window,t=cd();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=cd(e.document)}return t}function Tg(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function xE(e){var t=gk(),n=e.focusedElem,i=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&mk(n.ownerDocument.documentElement,n)){if(i!==null&&Tg(n)){if(t=i.start,e=i.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=n.textContent.length,r=Math.min(i.start,s);i=i.end===void 0?r:Math.min(i.end,s),!e.extend&&r>i&&(s=i,i=r,r=s),s=sv(n,r);var o=sv(n,i);s&&o&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),r>i?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,ho=null,Hp=null,rl=null,Up=!1;function rv(e,t,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Up||ho==null||ho!==cd(i)||(i=ho,"selectionStart"in i&&Tg(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),rl&&Ol(rl,i)||(rl=i,i=gd(Hp,"onSelect"),0mo||(e.current=Qp[mo],Qp[mo]=null,mo--)}function Bt(e,t){mo++,Qp[mo]=e.current,e.current=t}var Vs={},Ve=Gs(Vs),rn=Gs(!1),Lr=Vs;function $o(e,t){var n=e.type.contextTypes;if(!n)return Vs;var i=e.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===t)return i.__reactInternalMemoizedMaskedChildContext;var s={},r;for(r in n)s[r]=t[r];return i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function on(e){return e=e.childContextTypes,e!=null}function vd(){Yt(rn),Yt(Ve)}function hv(e,t,n){if(Ve.current!==Vs)throw Error(H(168));Bt(Ve,t),Bt(rn,n)}function Mk(e,t,n){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!="function")return n;i=i.getChildContext();for(var s in i)if(!(s in t))throw Error(H(108,pD(e)||"Unknown",s));return se({},n,i)}function xd(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Vs,Lr=Ve.current,Bt(Ve,e),Bt(rn,rn.current),!0}function fv(e,t,n){var i=e.stateNode;if(!i)throw Error(H(169));n?(e=Mk(e,t,Lr),i.__reactInternalMemoizedMergedChildContext=e,Yt(rn),Yt(Ve),Bt(Ve,e)):Yt(rn),Bt(rn,n)}var ji=null,mh=!1,Sf=!1;function Ck(e){ji===null?ji=[e]:ji.push(e)}function AE(e){mh=!0,Ck(e)}function qs(){if(!Sf&&ji!==null){Sf=!0;var e=0,t=Ot;try{var n=ji;for(Ot=1;e>=o,s-=o,Fi=1<<32-ei(t)+s|n<M?(P=C,C=null):P=C.sibling;var T=h(y,C,x[M],_);if(T===null){C===null&&(C=P);break}e&&C&&T.alternate===null&&t(y,C),g=r(T,g,M),S===null?w=T:S.sibling=T,S=T,C=P}if(M===x.length)return n(y,C),Gt&&dr(y,M),w;if(C===null){for(;MM?(P=C,C=null):P=C.sibling;var A=h(y,C,T.value,_);if(A===null){C===null&&(C=P);break}e&&C&&A.alternate===null&&t(y,C),g=r(A,g,M),S===null?w=A:S.sibling=A,S=A,C=P}if(T.done)return n(y,C),Gt&&dr(y,M),w;if(C===null){for(;!T.done;M++,T=x.next())T=d(y,T.value,_),T!==null&&(g=r(T,g,M),S===null?w=T:S.sibling=T,S=T);return Gt&&dr(y,M),w}for(C=i(y,C);!T.done;M++,T=x.next())T=f(C,y,M,T.value,_),T!==null&&(e&&T.alternate!==null&&C.delete(T.key===null?M:T.key),g=r(T,g,M),S===null?w=T:S.sibling=T,S=T);return e&&C.forEach(function(E){return t(y,E)}),Gt&&dr(y,M),w}function v(y,g,x,_){if(typeof x=="object"&&x!==null&&x.type===co&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Oc:t:{for(var w=x.key,S=g;S!==null;){if(S.key===w){if(w=x.type,w===co){if(S.tag===7){n(y,S.sibling),g=s(S,x.props.children),g.return=y,y=g;break t}}else if(S.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===ms&&bv(w)===S.type){n(y,S.sibling),g=s(S,x.props),g.ref=ga(y,S,x),g.return=y,y=g;break t}n(y,S);break}else t(y,S);S=S.sibling}x.type===co?(g=Mr(x.props.children,y.mode,_,x.key),g.return=y,y=g):(_=qu(x.type,x.key,x.props,null,y.mode,_),_.ref=ga(y,g,x),_.return=y,y=_)}return o(y);case lo:t:{for(S=x.key;g!==null;){if(g.key===S)if(g.tag===4&&g.stateNode.containerInfo===x.containerInfo&&g.stateNode.implementation===x.implementation){n(y,g.sibling),g=s(g,x.children||[]),g.return=y,y=g;break t}else{n(y,g);break}else t(y,g);g=g.sibling}g=Of(x,y.mode,_),g.return=y,y=g}return o(y);case ms:return S=x._init,v(y,g,S(x._payload),_)}if(Ua(x))return p(y,g,x,_);if(da(x))return m(y,g,x,_);Wc(y,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,g!==null&&g.tag===6?(n(y,g.sibling),g=s(g,x),g.return=y,y=g):(n(y,g),g=Af(x,y.mode,_),g.return=y,y=g),o(y)):n(y,g)}return v}var Fo=Rk(!0),Nk=Rk(!1),uc={},yi=Gs(uc),jl=Gs(uc),$l=Gs(uc);function wr(e){if(e===uc)throw Error(H(174));return e}function $g(e,t){switch(Bt($l,t),Bt(jl,e),Bt(yi,uc),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Rp(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Rp(t,e)}Yt(yi),Bt(yi,t)}function Bo(){Yt(yi),Yt(jl),Yt($l)}function jk(e){wr($l.current);var t=wr(yi.current),n=Rp(t,e.type);t!==n&&(Bt(jl,e),Bt(yi,n))}function Ig(e){jl.current===e&&(Yt(yi),Yt(jl))}var te=Gs(0);function Md(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Mf=[];function Fg(){for(var e=0;en?n:4,e(!0);var i=Cf.transition;Cf.transition={};try{e(!1),t()}finally{Ot=n,Cf.transition=i}}function Zk(){return Vn().memoizedState}function NE(e,t,n){var i=Ns(e);if(n={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null},Jk(e))tS(t,n);else if(n=Ek(e,t,n,i),n!==null){var s=Ue();ni(n,e,i,s),eS(n,t,i)}}function jE(e,t,n){var i=Ns(e),s={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null};if(Jk(e))tS(t,s);else{var r=e.alternate;if(e.lanes===0&&(r===null||r.lanes===0)&&(r=t.lastRenderedReducer,r!==null))try{var o=t.lastRenderedState,a=r(o,n);if(s.hasEagerState=!0,s.eagerState=a,ii(a,o)){var l=t.interleaved;l===null?(s.next=s,Ng(t)):(s.next=l.next,l.next=s),t.interleaved=s;return}}catch{}finally{}n=Ek(e,t,s,i),n!==null&&(s=Ue(),ni(n,e,i,s),eS(n,t,i))}}function Jk(e){var t=e.alternate;return e===ie||t!==null&&t===ie}function tS(e,t){ol=Cd=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function eS(e,t,n){if(n&4194240){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,_g(e,n)}}var Pd={readContext:Bn,useCallback:Le,useContext:Le,useEffect:Le,useImperativeHandle:Le,useInsertionEffect:Le,useLayoutEffect:Le,useMemo:Le,useReducer:Le,useRef:Le,useState:Le,useDebugValue:Le,useDeferredValue:Le,useTransition:Le,useMutableSource:Le,useSyncExternalStore:Le,useId:Le,unstable_isNewReconciler:!1},$E={readContext:Bn,useCallback:function(e,t){return di().memoizedState=[e,t===void 0?null:t],e},useContext:Bn,useEffect:wv,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Yu(4194308,4,Xk.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Yu(4194308,4,e,t)},useInsertionEffect:function(e,t){return Yu(4,2,e,t)},useMemo:function(e,t){var n=di();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var i=di();return t=n!==void 0?n(t):t,i.memoizedState=i.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},i.queue=e,e=e.dispatch=NE.bind(null,ie,e),[i.memoizedState,e]},useRef:function(e){var t=di();return e={current:e},t.memoizedState=e},useState:_v,useDebugValue:Hg,useDeferredValue:function(e){return di().memoizedState=e},useTransition:function(){var e=_v(!1),t=e[0];return e=RE.bind(null,e[1]),di().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var i=ie,s=di();if(Gt){if(n===void 0)throw Error(H(407));n=n()}else{if(n=t(),Se===null)throw Error(H(349));Nr&30||Fk(i,t,n)}s.memoizedState=n;var r={value:n,getSnapshot:t};return s.queue=r,wv(Vk.bind(null,i,r,e),[e]),i.flags|=2048,Bl(9,Bk.bind(null,i,r,n,t),void 0,null),n},useId:function(){var e=di(),t=Se.identifierPrefix;if(Gt){var n=Bi,i=Fi;n=(i&~(1<<32-ei(i)-1)).toString(32)+n,t=":"+t+"R"+n,n=Il++,0")&&(l=l.replace("",e.displayName)),l}while(1<=o&&0<=a);break}}}finally{cf=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ha(e):""}function fD(e){switch(e.tag){case 5:return Ha(e.type);case 16:return Ha("Lazy");case 13:return Ha("Suspense");case 19:return Ha("SuspenseList");case 0:case 2:case 15:return e=uf(e.type,!1),e;case 11:return e=uf(e.type.render,!1),e;case 1:return e=uf(e.type,!0),e;default:return""}}function Dp(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case co:return"Fragment";case lo:return"Portal";case Cp:return"Profiler";case gg:return"StrictMode";case Pp:return"Suspense";case Tp:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Rw:return(e.displayName||"Context")+".Consumer";case Ow:return(e._context.displayName||"Context")+".Provider";case yg:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case vg:return t=e.displayName||null,t!==null?t:Dp(e.type)||"Memo";case ms:t=e._payload,e=e._init;try{return Dp(e(t))}catch{}}return null}function pD(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Dp(t);case 8:return t===gg?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Bs(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Nw(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function mD(e){var t=Nw(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),i=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,r=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(o){i=""+o,r.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(o){i=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Lc(e){e._valueTracker||(e._valueTracker=mD(e))}function jw(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),i="";return e&&(i=Nw(e)?e.checked?"true":"false":e.value),e=i,e!==n?(t.setValue(e),!0):!1}function cd(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Ep(e,t){var n=t.checked;return se({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function F0(e,t){var n=t.defaultValue==null?"":t.defaultValue,i=t.checked!=null?t.checked:t.defaultChecked;n=Bs(t.value!=null?t.value:n),e._wrapperState={initialChecked:i,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function $w(e,t){t=t.checked,t!=null&&mg(e,"checked",t,!1)}function Ap(e,t){$w(e,t);var n=Bs(t.value),i=t.type;if(n!=null)i==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(i==="submit"||i==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Op(e,t.type,n):t.hasOwnProperty("defaultValue")&&Op(e,t.type,Bs(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function B0(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var i=t.type;if(!(i!=="submit"&&i!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Op(e,t,n){(t!=="number"||cd(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ua=Array.isArray;function Co(e,t,n,i){if(e=e.options,t){t={};for(var s=0;s"+t.valueOf().toString()+"",t=Nc.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Pl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var nl={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},gD=["Webkit","ms","Moz","O"];Object.keys(nl).forEach(function(e){gD.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),nl[t]=nl[e]})});function Vw(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||nl.hasOwnProperty(e)&&nl[e]?(""+t).trim():t+"px"}function zw(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var i=n.indexOf("--")===0,s=Vw(n,t[n],i);n==="float"&&(n="cssFloat"),i?e.setProperty(n,s):e[n]=s}}var yD=se({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Np(e,t){if(t){if(yD[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(H(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(H(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(H(61))}if(t.style!=null&&typeof t.style!="object")throw Error(H(62))}}function jp(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var $p=null;function xg(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ip=null,Po=null,To=null;function W0(e){if(e=uc(e)){if(typeof Ip!="function")throw Error(H(280));var t=e.stateNode;t&&(t=ph(t),Ip(e.stateNode,e.type,t))}}function Ww(e){Po?To?To.push(e):To=[e]:Po=e}function Hw(){if(Po){var e=Po,t=To;if(To=Po=null,W0(e),t)for(e=0;e>>=0,e===0?32:31-(TD(e)/DD|0)|0}var jc=64,$c=4194304;function Ya(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function fd(e,t){var n=e.pendingLanes;if(n===0)return 0;var i=0,s=e.suspendedLanes,r=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~s;a!==0?i=Ya(a):(r&=o,r!==0&&(i=Ya(r)))}else o=n&~s,o!==0?i=Ya(o):r!==0&&(i=Ya(r));if(i===0)return 0;if(t!==0&&t!==i&&!(t&s)&&(s=i&-i,r=t&-t,s>=r||s===16&&(r&4194240)!==0))return t;if(i&4&&(i|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=i;0n;n++)t.push(e);return t}function lc(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ei(t),e[t]=n}function RD(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var i=e.eventTimes;for(e=e.expirationTimes;0=sl),Z0=" ",J0=!1;function uk(e,t){switch(e){case"keyup":return aE.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function dk(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var uo=!1;function cE(e,t){switch(e){case"compositionend":return dk(t);case"keypress":return t.which!==32?null:(J0=!0,Z0);case"textInput":return e=t.data,e===Z0&&J0?null:e;default:return null}}function uE(e,t){if(uo)return e==="compositionend"||!Pg&&uk(e,t)?(e=lk(),Wu=Sg=_s=null,uo=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=i}t:{for(;n;){if(n.nextSibling){n=n.nextSibling;break t}n=n.parentNode}n=void 0}n=iv(n)}}function mk(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?mk(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function gk(){for(var e=window,t=cd();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=cd(e.document)}return t}function Tg(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function xE(e){var t=gk(),n=e.focusedElem,i=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&mk(n.ownerDocument.documentElement,n)){if(i!==null&&Tg(n)){if(t=i.start,e=i.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=n.textContent.length,r=Math.min(i.start,s);i=i.end===void 0?r:Math.min(i.end,s),!e.extend&&r>i&&(s=i,i=r,r=s),s=sv(n,r);var o=sv(n,i);s&&o&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),r>i?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,ho=null,Hp=null,ol=null,Up=!1;function rv(e,t,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Up||ho==null||ho!==cd(i)||(i=ho,"selectionStart"in i&&Tg(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),ol&&Rl(ol,i)||(ol=i,i=gd(Hp,"onSelect"),0mo||(e.current=Qp[mo],Qp[mo]=null,mo--)}function Bt(e,t){mo++,Qp[mo]=e.current,e.current=t}var Vs={},Ve=Gs(Vs),rn=Gs(!1),Rr=Vs;function $o(e,t){var n=e.type.contextTypes;if(!n)return Vs;var i=e.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===t)return i.__reactInternalMemoizedMaskedChildContext;var s={},r;for(r in n)s[r]=t[r];return i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function on(e){return e=e.childContextTypes,e!=null}function vd(){Yt(rn),Yt(Ve)}function hv(e,t,n){if(Ve.current!==Vs)throw Error(H(168));Bt(Ve,t),Bt(rn,n)}function Mk(e,t,n){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!="function")return n;i=i.getChildContext();for(var s in i)if(!(s in t))throw Error(H(108,pD(e)||"Unknown",s));return se({},n,i)}function xd(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Vs,Rr=Ve.current,Bt(Ve,e),Bt(rn,rn.current),!0}function fv(e,t,n){var i=e.stateNode;if(!i)throw Error(H(169));n?(e=Mk(e,t,Rr),i.__reactInternalMemoizedMergedChildContext=e,Yt(rn),Yt(Ve),Bt(Ve,e)):Yt(rn),Bt(rn,n)}var ji=null,mh=!1,Sf=!1;function Ck(e){ji===null?ji=[e]:ji.push(e)}function AE(e){mh=!0,Ck(e)}function qs(){if(!Sf&&ji!==null){Sf=!0;var e=0,t=Ot;try{var n=ji;for(Ot=1;e>=o,s-=o,Fi=1<<32-ei(t)+s|n<M?(P=C,C=null):P=C.sibling;var T=h(y,C,x[M],_);if(T===null){C===null&&(C=P);break}e&&C&&T.alternate===null&&t(y,C),g=r(T,g,M),S===null?w=T:S.sibling=T,S=T,C=P}if(M===x.length)return n(y,C),Gt&&dr(y,M),w;if(C===null){for(;MM?(P=C,C=null):P=C.sibling;var A=h(y,C,T.value,_);if(A===null){C===null&&(C=P);break}e&&C&&A.alternate===null&&t(y,C),g=r(A,g,M),S===null?w=A:S.sibling=A,S=A,C=P}if(T.done)return n(y,C),Gt&&dr(y,M),w;if(C===null){for(;!T.done;M++,T=x.next())T=d(y,T.value,_),T!==null&&(g=r(T,g,M),S===null?w=T:S.sibling=T,S=T);return Gt&&dr(y,M),w}for(C=i(y,C);!T.done;M++,T=x.next())T=f(C,y,M,T.value,_),T!==null&&(e&&T.alternate!==null&&C.delete(T.key===null?M:T.key),g=r(T,g,M),S===null?w=T:S.sibling=T,S=T);return e&&C.forEach(function(E){return t(y,E)}),Gt&&dr(y,M),w}function v(y,g,x,_){if(typeof x=="object"&&x!==null&&x.type===co&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Rc:t:{for(var w=x.key,S=g;S!==null;){if(S.key===w){if(w=x.type,w===co){if(S.tag===7){n(y,S.sibling),g=s(S,x.props.children),g.return=y,y=g;break t}}else if(S.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===ms&&bv(w)===S.type){n(y,S.sibling),g=s(S,x.props),g.ref=ga(y,S,x),g.return=y,y=g;break t}n(y,S);break}else t(y,S);S=S.sibling}x.type===co?(g=Mr(x.props.children,y.mode,_,x.key),g.return=y,y=g):(_=Qu(x.type,x.key,x.props,null,y.mode,_),_.ref=ga(y,g,x),_.return=y,y=_)}return o(y);case lo:t:{for(S=x.key;g!==null;){if(g.key===S)if(g.tag===4&&g.stateNode.containerInfo===x.containerInfo&&g.stateNode.implementation===x.implementation){n(y,g.sibling),g=s(g,x.children||[]),g.return=y,y=g;break t}else{n(y,g);break}else t(y,g);g=g.sibling}g=Of(x,y.mode,_),g.return=y,y=g}return o(y);case ms:return S=x._init,v(y,g,S(x._payload),_)}if(Ua(x))return p(y,g,x,_);if(da(x))return m(y,g,x,_);Hc(y,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,g!==null&&g.tag===6?(n(y,g.sibling),g=s(g,x),g.return=y,y=g):(n(y,g),g=Af(x,y.mode,_),g.return=y,y=g),o(y)):n(y,g)}return v}var Fo=Lk(!0),Nk=Lk(!1),dc={},yi=Gs(dc),$l=Gs(dc),Il=Gs(dc);function wr(e){if(e===dc)throw Error(H(174));return e}function $g(e,t){switch(Bt(Il,t),Bt($l,e),Bt(yi,dc),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Lp(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Lp(t,e)}Yt(yi),Bt(yi,t)}function Bo(){Yt(yi),Yt($l),Yt(Il)}function jk(e){wr(Il.current);var t=wr(yi.current),n=Lp(t,e.type);t!==n&&(Bt($l,e),Bt(yi,n))}function Ig(e){$l.current===e&&(Yt(yi),Yt($l))}var te=Gs(0);function Md(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Mf=[];function Fg(){for(var e=0;en?n:4,e(!0);var i=Cf.transition;Cf.transition={};try{e(!1),t()}finally{Ot=n,Cf.transition=i}}function Zk(){return Vn().memoizedState}function NE(e,t,n){var i=Ns(e);if(n={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null},Jk(e))tS(t,n);else if(n=Ek(e,t,n,i),n!==null){var s=Ue();ni(n,e,i,s),eS(n,t,i)}}function jE(e,t,n){var i=Ns(e),s={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null};if(Jk(e))tS(t,s);else{var r=e.alternate;if(e.lanes===0&&(r===null||r.lanes===0)&&(r=t.lastRenderedReducer,r!==null))try{var o=t.lastRenderedState,a=r(o,n);if(s.hasEagerState=!0,s.eagerState=a,ii(a,o)){var l=t.interleaved;l===null?(s.next=s,Ng(t)):(s.next=l.next,l.next=s),t.interleaved=s;return}}catch{}finally{}n=Ek(e,t,s,i),n!==null&&(s=Ue(),ni(n,e,i,s),eS(n,t,i))}}function Jk(e){var t=e.alternate;return e===ie||t!==null&&t===ie}function tS(e,t){al=Cd=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function eS(e,t,n){if(n&4194240){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,_g(e,n)}}var Pd={readContext:Bn,useCallback:Re,useContext:Re,useEffect:Re,useImperativeHandle:Re,useInsertionEffect:Re,useLayoutEffect:Re,useMemo:Re,useReducer:Re,useRef:Re,useState:Re,useDebugValue:Re,useDeferredValue:Re,useTransition:Re,useMutableSource:Re,useSyncExternalStore:Re,useId:Re,unstable_isNewReconciler:!1},$E={readContext:Bn,useCallback:function(e,t){return di().memoizedState=[e,t===void 0?null:t],e},useContext:Bn,useEffect:wv,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Xu(4194308,4,Xk.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Xu(4194308,4,e,t)},useInsertionEffect:function(e,t){return Xu(4,2,e,t)},useMemo:function(e,t){var n=di();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var i=di();return t=n!==void 0?n(t):t,i.memoizedState=i.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},i.queue=e,e=e.dispatch=NE.bind(null,ie,e),[i.memoizedState,e]},useRef:function(e){var t=di();return e={current:e},t.memoizedState=e},useState:_v,useDebugValue:Hg,useDeferredValue:function(e){return di().memoizedState=e},useTransition:function(){var e=_v(!1),t=e[0];return e=LE.bind(null,e[1]),di().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var i=ie,s=di();if(Gt){if(n===void 0)throw Error(H(407));n=n()}else{if(n=t(),Se===null)throw Error(H(349));Nr&30||Fk(i,t,n)}s.memoizedState=n;var r={value:n,getSnapshot:t};return s.queue=r,wv(Vk.bind(null,i,r,e),[e]),i.flags|=2048,Vl(9,Bk.bind(null,i,r,n,t),void 0,null),n},useId:function(){var e=di(),t=Se.identifierPrefix;if(Gt){var n=Bi,i=Fi;n=(i&~(1<<32-ei(i)-1)).toString(32)+n,t=":"+t+"R"+n,n=Fl++,0<\/script>",e=e.removeChild(e.firstChild)):typeof i.is=="string"?e=o.createElement(n,{is:i.is}):(e=o.createElement(n),n==="select"&&(o=e,i.multiple?o.multiple=!0:i.size&&(o.size=i.size))):e=o.createElementNS(e,n),e[fi]=t,e[Nl]=i,uS(e,t,!1,!1),t.stateNode=e;t:{switch(o=jp(n,i),n){case"dialog":Wt("cancel",e),Wt("close",e),s=i;break;case"iframe":case"object":case"embed":Wt("load",e),s=i;break;case"video":case"audio":for(s=0;szo&&(t.flags|=128,i=!0,ya(r,!1),t.lanes=4194304)}else{if(!i)if(e=Md(o),e!==null){if(t.flags|=128,i=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ya(r,!0),r.tail===null&&r.tailMode==="hidden"&&!o.alternate&&!Gt)return Re(t),null}else 2*le()-r.renderingStartTime>zo&&n!==1073741824&&(t.flags|=128,i=!0,ya(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(n=r.last,n!==null?n.sibling=o:t.child=o,r.last=o)}return r.tail!==null?(t=r.tail,r.rendering=t,r.tail=t.sibling,r.renderingStartTime=le(),t.sibling=null,n=te.current,Bt(te,i?n&1|2:n&1),t):(Re(t),null);case 22:case 23:return qg(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?gn&1073741824&&(Re(t),t.subtreeFlags&6&&(t.flags|=8192)):Re(t),null;case 24:return null;case 25:return null}throw Error(H(156,t.tag))}function UE(e,t){switch(Eg(t),t.tag){case 1:return on(t.type)&&vd(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Bo(),Yt(rn),Yt(Ve),Fg(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ig(t),null;case 13:if(Yt(te),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(H(340));Io()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Yt(te),null;case 4:return Bo(),null;case 10:return Rg(t.type._context),null;case 22:case 23:return qg(),null;case 24:return null;default:return null}}var Uc=!1,Ie=!1,YE=typeof WeakSet=="function"?WeakSet:Set,tt=null;function xo(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(i){re(e,t,i)}else n.current=null}function cm(e,t,n){try{n()}catch(i){re(e,t,i)}}var Av=!1;function XE(e,t){if(Yp=pd,e=gk(),Tg(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else t:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var s=i.anchorOffset,r=i.focusNode;i=i.focusOffset;try{n.nodeType,r.nodeType}catch{n=null;break t}var o=0,a=-1,l=-1,c=0,u=0,d=e,h=null;e:for(;;){for(var f;d!==n||s!==0&&d.nodeType!==3||(a=o+s),d!==r||i!==0&&d.nodeType!==3||(l=o+i),d.nodeType===3&&(o+=d.nodeValue.length),(f=d.firstChild)!==null;)h=d,d=f;for(;;){if(d===e)break e;if(h===n&&++c===s&&(a=o),h===r&&++u===i&&(l=o),(f=d.nextSibling)!==null)break;d=h,h=d.parentNode}d=f}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Xp={focusedElem:e,selectionRange:n},pd=!1,tt=t;tt!==null;)if(t=tt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,tt=e;else for(;tt!==null;){t=tt;try{var p=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var m=p.memoizedProps,v=p.memoizedState,y=t.stateNode,g=y.getSnapshotBeforeUpdate(t.elementType===t.type?m:qn(t.type,m),v);y.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(H(163))}}catch(_){re(t,t.return,_)}if(e=t.sibling,e!==null){e.return=t.return,tt=e;break}tt=t.return}return p=Av,Av=!1,p}function al(e,t,n){var i=t.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var s=i=i.next;do{if((s.tag&e)===e){var r=s.destroy;s.destroy=void 0,r!==void 0&&cm(t,n,r)}s=s.next}while(s!==i)}}function vh(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var i=n.create;n.destroy=i()}n=n.next}while(n!==t)}}function um(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function fS(e){var t=e.alternate;t!==null&&(e.alternate=null,fS(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[fi],delete t[Nl],delete t[qp],delete t[DE],delete t[EE])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function pS(e){return e.tag===5||e.tag===3||e.tag===4}function Ov(e){t:for(;;){for(;e.sibling===null;){if(e.return===null||pS(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue t;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function dm(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=yd));else if(i!==4&&(e=e.child,e!==null))for(dm(e,t,n),e=e.sibling;e!==null;)dm(e,t,n),e=e.sibling}function hm(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(i!==4&&(e=e.child,e!==null))for(hm(e,t,n),e=e.sibling;e!==null;)hm(e,t,n),e=e.sibling}var Pe=null,Qn=!1;function ds(e,t,n){for(n=n.child;n!==null;)mS(e,t,n),n=n.sibling}function mS(e,t,n){if(gi&&typeof gi.onCommitFiberUnmount=="function")try{gi.onCommitFiberUnmount(uh,n)}catch{}switch(n.tag){case 5:Ie||xo(n,t);case 6:var i=Pe,s=Qn;Pe=null,ds(e,t,n),Pe=i,Qn=s,Pe!==null&&(Qn?(e=Pe,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Pe.removeChild(n.stateNode));break;case 18:Pe!==null&&(Qn?(e=Pe,n=n.stateNode,e.nodeType===8?kf(e.parentNode,n):e.nodeType===1&&kf(e,n),El(e)):kf(Pe,n.stateNode));break;case 4:i=Pe,s=Qn,Pe=n.stateNode.containerInfo,Qn=!0,ds(e,t,n),Pe=i,Qn=s;break;case 0:case 11:case 14:case 15:if(!Ie&&(i=n.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){s=i=i.next;do{var r=s,o=r.destroy;r=r.tag,o!==void 0&&(r&2||r&4)&&cm(n,t,o),s=s.next}while(s!==i)}ds(e,t,n);break;case 1:if(!Ie&&(xo(n,t),i=n.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=n.memoizedProps,i.state=n.memoizedState,i.componentWillUnmount()}catch(a){re(n,t,a)}ds(e,t,n);break;case 21:ds(e,t,n);break;case 22:n.mode&1?(Ie=(i=Ie)||n.memoizedState!==null,ds(e,t,n),Ie=i):ds(e,t,n);break;default:ds(e,t,n)}}function Lv(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new YE),t.forEach(function(i){var s=nA.bind(null,e,i);n.has(i)||(n.add(i),i.then(s,s))})}}function Gn(e,t){var n=t.deletions;if(n!==null)for(var i=0;is&&(s=o),i&=~r}if(i=s,i=le()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*GE(i/1960))-i,10e?16:e,ws===null)var i=!1;else{if(e=ws,ws=null,Ed=0,St&6)throw Error(H(331));var s=St;for(St|=4,tt=e.current;tt!==null;){var r=tt,o=r.child;if(tt.flags&16){var a=r.deletions;if(a!==null){for(var l=0;lle()-Kg?Sr(e,0):Xg|=n),an(e,t)}function kS(e,t){t===0&&(e.mode&1?(t=jc,jc<<=1,!(jc&130023424)&&(jc=4194304)):t=1);var n=Ue();e=ts(e,t),e!==null&&(ac(e,t,n),an(e,n))}function eA(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),kS(e,n)}function nA(e,t){var n=0;switch(e.tag){case 13:var i=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(H(314))}i!==null&&i.delete(t),kS(e,n)}var SS;SS=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||rn.current)nn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return nn=!1,WE(e,t,n);nn=!!(e.flags&131072)}else nn=!1,Gt&&t.flags&1048576&&Pk(t,_d,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;Xu(e,t),e=t.pendingProps;var s=$o(t,Ve.current);Eo(t,n),s=Vg(null,t,i,e,s,n);var r=zg();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,on(i)?(r=!0,xd(t)):r=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,jg(t),s.updater=gh,t.stateNode=s,s._reactInternals=t,nm(t,i,e,n),t=rm(null,t,i,!0,r,n)):(t.tag=0,Gt&&r&&Dg(t),He(null,t,s,n),t=t.child),t;case 16:i=t.elementType;t:{switch(Xu(e,t),e=t.pendingProps,s=i._init,i=s(i._payload),t.type=i,s=t.tag=sA(i),e=qn(i,e),s){case 0:t=sm(null,t,i,e,n);break t;case 1:t=Tv(null,t,i,e,n);break t;case 11:t=Cv(null,t,i,e,n);break t;case 14:t=Pv(null,t,i,qn(i.type,e),n);break t}throw Error(H(306,i,""))}return t;case 0:return i=t.type,s=t.pendingProps,s=t.elementType===i?s:qn(i,s),sm(e,t,i,s,n);case 1:return i=t.type,s=t.pendingProps,s=t.elementType===i?s:qn(i,s),Tv(e,t,i,s,n);case 3:t:{if(aS(t),e===null)throw Error(H(387));i=t.pendingProps,r=t.memoizedState,s=r.element,Ak(e,t),Sd(t,i,null,n);var o=t.memoizedState;if(i=o.element,r.isDehydrated)if(r={element:i,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=r,t.memoizedState=r,t.flags&256){s=Vo(Error(H(423)),t),t=Dv(e,t,i,n,s);break t}else if(i!==s){s=Vo(Error(H(424)),t),t=Dv(e,t,i,n,s);break t}else for(xn=Os(t.stateNode.containerInfo.firstChild),bn=t,Gt=!0,Zn=null,n=Nk(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Io(),i===s){t=es(e,t,n);break t}He(e,t,i,n)}t=t.child}return t;case 5:return jk(t),e===null&&Jp(t),i=t.type,s=t.pendingProps,r=e!==null?e.memoizedProps:null,o=s.children,Kp(i,s)?o=null:r!==null&&Kp(i,r)&&(t.flags|=32),oS(e,t),He(e,t,o,n),t.child;case 6:return e===null&&Jp(t),null;case 13:return lS(e,t,n);case 4:return $g(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Fo(t,null,i,n):He(e,t,i,n),t.child;case 11:return i=t.type,s=t.pendingProps,s=t.elementType===i?s:qn(i,s),Cv(e,t,i,s,n);case 7:return He(e,t,t.pendingProps,n),t.child;case 8:return He(e,t,t.pendingProps.children,n),t.child;case 12:return He(e,t,t.pendingProps.children,n),t.child;case 10:t:{if(i=t.type._context,s=t.pendingProps,r=t.memoizedProps,o=s.value,Bt(wd,i._currentValue),i._currentValue=o,r!==null)if(ii(r.value,o)){if(r.children===s.children&&!rn.current){t=es(e,t,n);break t}}else for(r=t.child,r!==null&&(r.return=t);r!==null;){var a=r.dependencies;if(a!==null){o=r.child;for(var l=a.firstContext;l!==null;){if(l.context===i){if(r.tag===1){l=Gi(-1,n&-n),l.tag=2;var c=r.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}r.lanes|=n,l=r.alternate,l!==null&&(l.lanes|=n),tm(r.return,n,t),a.lanes|=n;break}l=l.next}}else if(r.tag===10)o=r.type===t.type?null:r.child;else if(r.tag===18){if(o=r.return,o===null)throw Error(H(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),tm(o,n,t),o=r.sibling}else o=r.child;if(o!==null)o.return=r;else for(o=r;o!==null;){if(o===t){o=null;break}if(r=o.sibling,r!==null){r.return=o.return,o=r;break}o=o.return}r=o}He(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,i=t.pendingProps.children,Eo(t,n),s=Bn(s),i=i(s),t.flags|=1,He(e,t,i,n),t.child;case 14:return i=t.type,s=qn(i,t.pendingProps),s=qn(i.type,s),Pv(e,t,i,s,n);case 15:return sS(e,t,t.type,t.pendingProps,n);case 17:return i=t.type,s=t.pendingProps,s=t.elementType===i?s:qn(i,s),Xu(e,t),t.tag=1,on(i)?(e=!0,xd(t)):e=!1,Eo(t,n),Lk(t,i,s),nm(t,i,s,n),rm(null,t,i,!0,e,n);case 19:return cS(e,t,n);case 22:return rS(e,t,n)}throw Error(H(156,t.tag))};function MS(e,t){return Qw(e,t)}function iA(e,t,n,i){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function $n(e,t,n,i){return new iA(e,t,n,i)}function Zg(e){return e=e.prototype,!(!e||!e.isReactComponent)}function sA(e){if(typeof e=="function")return Zg(e)?1:0;if(e!=null){if(e=e.$$typeof,e===yg)return 11;if(e===vg)return 14}return 2}function js(e,t){var n=e.alternate;return n===null?(n=$n(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function qu(e,t,n,i,s,r){var o=2;if(i=e,typeof e=="function")Zg(e)&&(o=1);else if(typeof e=="string")o=5;else t:switch(e){case co:return Mr(n.children,s,r,t);case gg:o=8,s|=8;break;case Cp:return e=$n(12,n,t,s|2),e.elementType=Cp,e.lanes=r,e;case Pp:return e=$n(13,n,t,s),e.elementType=Pp,e.lanes=r,e;case Tp:return e=$n(19,n,t,s),e.elementType=Tp,e.lanes=r,e;case Rw:return bh(n,s,r,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Ow:o=10;break t;case Lw:o=9;break t;case yg:o=11;break t;case vg:o=14;break t;case ms:o=16,i=null;break t}throw Error(H(130,e==null?e:typeof e,""))}return t=$n(o,n,t,s),t.elementType=e,t.type=i,t.lanes=r,t}function Mr(e,t,n,i){return e=$n(7,e,i,t),e.lanes=n,e}function bh(e,t,n,i){return e=$n(22,e,i,t),e.elementType=Rw,e.lanes=n,e.stateNode={isHidden:!1},e}function Af(e,t,n){return e=$n(6,e,null,t),e.lanes=n,e}function Of(e,t,n){return t=$n(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function rA(e,t,n,i,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=hf(0),this.expirationTimes=hf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=hf(0),this.identifierPrefix=i,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Jg(e,t,n,i,s,r,o,a,l){return e=new rA(e,t,n,a,l),t===1?(t=1,r===!0&&(t|=8)):t=0,r=$n(3,null,null,t),e.current=r,r.stateNode=e,r.memoizedState={element:i,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},jg(r),e}function oA(e,t,n){var i=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(DS)}catch(e){console.error(e)}}DS(),Pw.exports=kn;var iy=Pw.exports,Vv=iy;Sp.createRoot=Vv.createRoot,Sp.hydrateRoot=Vv.hydrateRoot;/*! +`+r.stack}return{value:e,source:t,stack:s,digest:null}}function Df(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function im(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var BE=typeof WeakMap=="function"?WeakMap:Map;function nS(e,t,n){n=Gi(-1,n),n.tag=3,n.payload={element:null};var i=t.value;return n.callback=function(){Dd||(Dd=!0,fm=i),im(e,t)},n}function iS(e,t,n){n=Gi(-1,n),n.tag=3;var i=e.type.getDerivedStateFromError;if(typeof i=="function"){var s=t.value;n.payload=function(){return i(s)},n.callback=function(){im(e,t)}}var r=e.stateNode;return r!==null&&typeof r.componentDidCatch=="function"&&(n.callback=function(){im(e,t),typeof i!="function"&&(Ls===null?Ls=new Set([this]):Ls.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function kv(e,t,n){var i=e.pingCache;if(i===null){i=e.pingCache=new BE;var s=new Set;i.set(t,s)}else s=i.get(t),s===void 0&&(s=new Set,i.set(t,s));s.has(n)||(s.add(n),e=tA.bind(null,e,t,n),t.then(e,e))}function Sv(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Mv(e,t,n,i,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Gi(-1,1),t.tag=2,Rs(n,t,1))),n.lanes|=1),e)}var VE=rs.ReactCurrentOwner,nn=!1;function He(e,t,n,i){t.child=e===null?Nk(t,null,n,i):Fo(t,e.child,n,i)}function Cv(e,t,n,i,s){n=n.render;var r=t.ref;return Eo(t,s),i=Vg(e,t,n,i,r,s),n=zg(),e!==null&&!nn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,es(e,t,s)):(Gt&&n&&Dg(t),t.flags|=1,He(e,t,i,s),t.child)}function Pv(e,t,n,i,s){if(e===null){var r=n.type;return typeof r=="function"&&!Zg(r)&&r.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=r,sS(e,t,r,i,s)):(e=Qu(n.type,null,i,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(r=e.child,!(e.lanes&s)){var o=r.memoizedProps;if(n=n.compare,n=n!==null?n:Rl,n(o,i)&&e.ref===t.ref)return es(e,t,s)}return t.flags|=1,e=js(r,i),e.ref=t.ref,e.return=t,t.child=e}function sS(e,t,n,i,s){if(e!==null){var r=e.memoizedProps;if(Rl(r,i)&&e.ref===t.ref)if(nn=!1,t.pendingProps=i=r,(e.lanes&s)!==0)e.flags&131072&&(nn=!0);else return t.lanes=e.lanes,es(e,t,s)}return sm(e,t,n,i,s)}function rS(e,t,n){var i=t.pendingProps,s=i.children,r=e!==null?e.memoizedState:null;if(i.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Bt(bo,gn),gn|=n;else{if(!(n&1073741824))return e=r!==null?r.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Bt(bo,gn),gn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=r!==null?r.baseLanes:n,Bt(bo,gn),gn|=i}else r!==null?(i=r.baseLanes|n,t.memoizedState=null):i=n,Bt(bo,gn),gn|=i;return He(e,t,s,n),t.child}function oS(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function sm(e,t,n,i,s){var r=on(n)?Rr:Ve.current;return r=$o(t,r),Eo(t,s),n=Vg(e,t,n,i,r,s),i=zg(),e!==null&&!nn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,es(e,t,s)):(Gt&&i&&Dg(t),t.flags|=1,He(e,t,n,s),t.child)}function Tv(e,t,n,i,s){if(on(n)){var r=!0;xd(t)}else r=!1;if(Eo(t,s),t.stateNode===null)Ku(e,t),Rk(t,n,i),nm(t,n,i,s),i=!0;else if(e===null){var o=t.stateNode,a=t.memoizedProps;o.props=a;var l=o.context,c=n.contextType;typeof c=="object"&&c!==null?c=Bn(c):(c=on(n)?Rr:Ve.current,c=$o(t,c));var u=n.getDerivedStateFromProps,d=typeof u=="function"||typeof o.getSnapshotBeforeUpdate=="function";d||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==i||l!==c)&&xv(t,o,i,c),gs=!1;var h=t.memoizedState;o.state=h,Sd(t,i,o,s),l=t.memoizedState,a!==i||h!==l||rn.current||gs?(typeof u=="function"&&(em(t,n,u,i),l=t.memoizedState),(a=gs||vv(t,n,a,i,h,l,c))?(d||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=l),o.props=i,o.state=l,o.context=c,i=a):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{o=t.stateNode,Ak(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:qn(t.type,a),o.props=c,d=t.pendingProps,h=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=Bn(l):(l=on(n)?Rr:Ve.current,l=$o(t,l));var f=n.getDerivedStateFromProps;(u=typeof f=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==d||h!==l)&&xv(t,o,i,l),gs=!1,h=t.memoizedState,o.state=h,Sd(t,i,o,s);var p=t.memoizedState;a!==d||h!==p||rn.current||gs?(typeof f=="function"&&(em(t,n,f,i),p=t.memoizedState),(c=gs||vv(t,n,c,i,h,p,l)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(i,p,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(i,p,l)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=p),o.props=i,o.state=p,o.context=l,i=c):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),i=!1)}return rm(e,t,n,i,r,s)}function rm(e,t,n,i,s,r){oS(e,t);var o=(t.flags&128)!==0;if(!i&&!o)return s&&fv(t,n,!1),es(e,t,r);i=t.stateNode,VE.current=t;var a=o&&typeof n.getDerivedStateFromError!="function"?null:i.render();return t.flags|=1,e!==null&&o?(t.child=Fo(t,e.child,null,r),t.child=Fo(t,null,a,r)):He(e,t,a,r),t.memoizedState=i.state,s&&fv(t,n,!0),t.child}function aS(e){var t=e.stateNode;t.pendingContext?hv(e,t.pendingContext,t.pendingContext!==t.context):t.context&&hv(e,t.context,!1),$g(e,t.containerInfo)}function Dv(e,t,n,i,s){return Io(),Ag(s),t.flags|=256,He(e,t,n,i),t.child}var om={dehydrated:null,treeContext:null,retryLane:0};function am(e){return{baseLanes:e,cachePool:null,transitions:null}}function lS(e,t,n){var i=t.pendingProps,s=te.current,r=!1,o=(t.flags&128)!==0,a;if((a=o)||(a=e!==null&&e.memoizedState===null?!1:(s&2)!==0),a?(r=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),Bt(te,s&1),e===null)return Jp(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=i.children,e=i.fallback,r?(i=t.mode,r=t.child,o={mode:"hidden",children:o},!(i&1)&&r!==null?(r.childLanes=0,r.pendingProps=o):r=bh(o,i,0,null),e=Mr(e,i,n,null),r.return=t,e.return=t,r.sibling=e,t.child=r,t.child.memoizedState=am(n),t.memoizedState=om,e):Ug(t,o));if(s=e.memoizedState,s!==null&&(a=s.dehydrated,a!==null))return zE(e,t,o,i,a,s,n);if(r){r=i.fallback,o=t.mode,s=e.child,a=s.sibling;var l={mode:"hidden",children:i.children};return!(o&1)&&t.child!==s?(i=t.child,i.childLanes=0,i.pendingProps=l,t.deletions=null):(i=js(s,l),i.subtreeFlags=s.subtreeFlags&14680064),a!==null?r=js(a,r):(r=Mr(r,o,n,null),r.flags|=2),r.return=t,i.return=t,i.sibling=r,t.child=i,i=r,r=t.child,o=e.child.memoizedState,o=o===null?am(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},r.memoizedState=o,r.childLanes=e.childLanes&~n,t.memoizedState=om,i}return r=e.child,e=r.sibling,i=js(r,{mode:"visible",children:i.children}),!(t.mode&1)&&(i.lanes=n),i.return=t,i.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=i,t.memoizedState=null,i}function Ug(e,t){return t=bh({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Uc(e,t,n,i){return i!==null&&Ag(i),Fo(t,e.child,null,n),e=Ug(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function zE(e,t,n,i,s,r,o){if(n)return t.flags&256?(t.flags&=-257,i=Df(Error(H(422))),Uc(e,t,o,i)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(r=i.fallback,s=t.mode,i=bh({mode:"visible",children:i.children},s,0,null),r=Mr(r,s,o,null),r.flags|=2,i.return=t,r.return=t,i.sibling=r,t.child=i,t.mode&1&&Fo(t,e.child,null,o),t.child.memoizedState=am(o),t.memoizedState=om,r);if(!(t.mode&1))return Uc(e,t,o,null);if(s.data==="$!"){if(i=s.nextSibling&&s.nextSibling.dataset,i)var a=i.dgst;return i=a,r=Error(H(419)),i=Df(r,i,void 0),Uc(e,t,o,i)}if(a=(o&e.childLanes)!==0,nn||a){if(i=Se,i!==null){switch(o&-o){case 4:s=2;break;case 16:s=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(i.suspendedLanes|o)?0:s,s!==0&&s!==r.retryLane&&(r.retryLane=s,ts(e,s),ni(i,e,s,-1))}return Qg(),i=Df(Error(H(421))),Uc(e,t,o,i)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=eA.bind(null,e),s._reactRetry=t,null):(e=r.treeContext,xn=Os(s.nextSibling),bn=t,Gt=!0,Zn=null,e!==null&&(Ln[Nn++]=Fi,Ln[Nn++]=Bi,Ln[Nn++]=Lr,Fi=e.id,Bi=e.overflow,Lr=t),t=Ug(t,i.children),t.flags|=4096,t)}function Ev(e,t,n){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),tm(e.return,t,n)}function Ef(e,t,n,i,s){var r=e.memoizedState;r===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:s}:(r.isBackwards=t,r.rendering=null,r.renderingStartTime=0,r.last=i,r.tail=n,r.tailMode=s)}function cS(e,t,n){var i=t.pendingProps,s=i.revealOrder,r=i.tail;if(He(e,t,i.children,n),i=te.current,i&2)i=i&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)t:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ev(e,n,t);else if(e.tag===19)Ev(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break t;for(;e.sibling===null;){if(e.return===null||e.return===t)break t;e=e.return}e.sibling.return=e.return,e=e.sibling}i&=1}if(Bt(te,i),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&Md(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),Ef(t,!1,s,n,r);break;case"backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&Md(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}Ef(t,!0,n,null,r);break;case"together":Ef(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ku(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function es(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),jr|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(H(153));if(t.child!==null){for(e=t.child,n=js(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=js(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function WE(e,t,n){switch(t.tag){case 3:aS(t),Io();break;case 5:jk(t);break;case 1:on(t.type)&&xd(t);break;case 4:$g(t,t.stateNode.containerInfo);break;case 10:var i=t.type._context,s=t.memoizedProps.value;Bt(wd,i._currentValue),i._currentValue=s;break;case 13:if(i=t.memoizedState,i!==null)return i.dehydrated!==null?(Bt(te,te.current&1),t.flags|=128,null):n&t.child.childLanes?lS(e,t,n):(Bt(te,te.current&1),e=es(e,t,n),e!==null?e.sibling:null);Bt(te,te.current&1);break;case 19:if(i=(n&t.childLanes)!==0,e.flags&128){if(i)return cS(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),Bt(te,te.current),i)break;return null;case 22:case 23:return t.lanes=0,rS(e,t,n)}return es(e,t,n)}var uS,lm,dS,hS;uS=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};lm=function(){};dS=function(e,t,n,i){var s=e.memoizedProps;if(s!==i){e=t.stateNode,wr(yi.current);var r=null;switch(n){case"input":s=Ep(e,s),i=Ep(e,i),r=[];break;case"select":s=se({},s,{value:void 0}),i=se({},i,{value:void 0}),r=[];break;case"textarea":s=Rp(e,s),i=Rp(e,i),r=[];break;default:typeof s.onClick!="function"&&typeof i.onClick=="function"&&(e.onclick=yd)}Np(n,i);var o;n=null;for(c in s)if(!i.hasOwnProperty(c)&&s.hasOwnProperty(c)&&s[c]!=null)if(c==="style"){var a=s[c];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(Cl.hasOwnProperty(c)?r||(r=[]):(r=r||[]).push(c,null));for(c in i){var l=i[c];if(a=s!=null?s[c]:void 0,i.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(n||(n={}),n[o]=l[o])}else n||(r||(r=[]),r.push(c,n)),n=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(r=r||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(r=r||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(Cl.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&Wt("scroll",e),r||a===l||(r=[])):(r=r||[]).push(c,l))}n&&(r=r||[]).push("style",n);var c=r;(t.updateQueue=c)&&(t.flags|=4)}};hS=function(e,t,n,i){n!==i&&(t.flags|=4)};function ya(e,t){if(!Gt)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function Le(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,i=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,i|=s.subtreeFlags&14680064,i|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,i|=s.subtreeFlags,i|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=i,e.childLanes=n,t}function HE(e,t,n){var i=t.pendingProps;switch(Eg(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Le(t),null;case 1:return on(t.type)&&vd(),Le(t),null;case 3:return i=t.stateNode,Bo(),Yt(rn),Yt(Ve),Fg(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Wc(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Zn!==null&&(gm(Zn),Zn=null))),lm(e,t),Le(t),null;case 5:Ig(t);var s=wr(Il.current);if(n=t.type,e!==null&&t.stateNode!=null)dS(e,t,n,i,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(t.stateNode===null)throw Error(H(166));return Le(t),null}if(e=wr(yi.current),Wc(t)){i=t.stateNode,n=t.type;var r=t.memoizedProps;switch(i[fi]=t,i[jl]=r,e=(t.mode&1)!==0,n){case"dialog":Wt("cancel",i),Wt("close",i);break;case"iframe":case"object":case"embed":Wt("load",i);break;case"video":case"audio":for(s=0;s<\/script>",e=e.removeChild(e.firstChild)):typeof i.is=="string"?e=o.createElement(n,{is:i.is}):(e=o.createElement(n),n==="select"&&(o=e,i.multiple?o.multiple=!0:i.size&&(o.size=i.size))):e=o.createElementNS(e,n),e[fi]=t,e[jl]=i,uS(e,t,!1,!1),t.stateNode=e;t:{switch(o=jp(n,i),n){case"dialog":Wt("cancel",e),Wt("close",e),s=i;break;case"iframe":case"object":case"embed":Wt("load",e),s=i;break;case"video":case"audio":for(s=0;szo&&(t.flags|=128,i=!0,ya(r,!1),t.lanes=4194304)}else{if(!i)if(e=Md(o),e!==null){if(t.flags|=128,i=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ya(r,!0),r.tail===null&&r.tailMode==="hidden"&&!o.alternate&&!Gt)return Le(t),null}else 2*le()-r.renderingStartTime>zo&&n!==1073741824&&(t.flags|=128,i=!0,ya(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(n=r.last,n!==null?n.sibling=o:t.child=o,r.last=o)}return r.tail!==null?(t=r.tail,r.rendering=t,r.tail=t.sibling,r.renderingStartTime=le(),t.sibling=null,n=te.current,Bt(te,i?n&1|2:n&1),t):(Le(t),null);case 22:case 23:return qg(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?gn&1073741824&&(Le(t),t.subtreeFlags&6&&(t.flags|=8192)):Le(t),null;case 24:return null;case 25:return null}throw Error(H(156,t.tag))}function UE(e,t){switch(Eg(t),t.tag){case 1:return on(t.type)&&vd(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Bo(),Yt(rn),Yt(Ve),Fg(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ig(t),null;case 13:if(Yt(te),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(H(340));Io()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Yt(te),null;case 4:return Bo(),null;case 10:return Lg(t.type._context),null;case 22:case 23:return qg(),null;case 24:return null;default:return null}}var Yc=!1,Ie=!1,YE=typeof WeakSet=="function"?WeakSet:Set,tt=null;function xo(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(i){re(e,t,i)}else n.current=null}function cm(e,t,n){try{n()}catch(i){re(e,t,i)}}var Av=!1;function XE(e,t){if(Yp=pd,e=gk(),Tg(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else t:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var s=i.anchorOffset,r=i.focusNode;i=i.focusOffset;try{n.nodeType,r.nodeType}catch{n=null;break t}var o=0,a=-1,l=-1,c=0,u=0,d=e,h=null;e:for(;;){for(var f;d!==n||s!==0&&d.nodeType!==3||(a=o+s),d!==r||i!==0&&d.nodeType!==3||(l=o+i),d.nodeType===3&&(o+=d.nodeValue.length),(f=d.firstChild)!==null;)h=d,d=f;for(;;){if(d===e)break e;if(h===n&&++c===s&&(a=o),h===r&&++u===i&&(l=o),(f=d.nextSibling)!==null)break;d=h,h=d.parentNode}d=f}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Xp={focusedElem:e,selectionRange:n},pd=!1,tt=t;tt!==null;)if(t=tt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,tt=e;else for(;tt!==null;){t=tt;try{var p=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var m=p.memoizedProps,v=p.memoizedState,y=t.stateNode,g=y.getSnapshotBeforeUpdate(t.elementType===t.type?m:qn(t.type,m),v);y.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(H(163))}}catch(_){re(t,t.return,_)}if(e=t.sibling,e!==null){e.return=t.return,tt=e;break}tt=t.return}return p=Av,Av=!1,p}function ll(e,t,n){var i=t.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var s=i=i.next;do{if((s.tag&e)===e){var r=s.destroy;s.destroy=void 0,r!==void 0&&cm(t,n,r)}s=s.next}while(s!==i)}}function vh(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var i=n.create;n.destroy=i()}n=n.next}while(n!==t)}}function um(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function fS(e){var t=e.alternate;t!==null&&(e.alternate=null,fS(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[fi],delete t[jl],delete t[qp],delete t[DE],delete t[EE])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function pS(e){return e.tag===5||e.tag===3||e.tag===4}function Ov(e){t:for(;;){for(;e.sibling===null;){if(e.return===null||pS(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue t;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function dm(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=yd));else if(i!==4&&(e=e.child,e!==null))for(dm(e,t,n),e=e.sibling;e!==null;)dm(e,t,n),e=e.sibling}function hm(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(i!==4&&(e=e.child,e!==null))for(hm(e,t,n),e=e.sibling;e!==null;)hm(e,t,n),e=e.sibling}var Pe=null,Qn=!1;function ds(e,t,n){for(n=n.child;n!==null;)mS(e,t,n),n=n.sibling}function mS(e,t,n){if(gi&&typeof gi.onCommitFiberUnmount=="function")try{gi.onCommitFiberUnmount(uh,n)}catch{}switch(n.tag){case 5:Ie||xo(n,t);case 6:var i=Pe,s=Qn;Pe=null,ds(e,t,n),Pe=i,Qn=s,Pe!==null&&(Qn?(e=Pe,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Pe.removeChild(n.stateNode));break;case 18:Pe!==null&&(Qn?(e=Pe,n=n.stateNode,e.nodeType===8?kf(e.parentNode,n):e.nodeType===1&&kf(e,n),Al(e)):kf(Pe,n.stateNode));break;case 4:i=Pe,s=Qn,Pe=n.stateNode.containerInfo,Qn=!0,ds(e,t,n),Pe=i,Qn=s;break;case 0:case 11:case 14:case 15:if(!Ie&&(i=n.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){s=i=i.next;do{var r=s,o=r.destroy;r=r.tag,o!==void 0&&(r&2||r&4)&&cm(n,t,o),s=s.next}while(s!==i)}ds(e,t,n);break;case 1:if(!Ie&&(xo(n,t),i=n.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=n.memoizedProps,i.state=n.memoizedState,i.componentWillUnmount()}catch(a){re(n,t,a)}ds(e,t,n);break;case 21:ds(e,t,n);break;case 22:n.mode&1?(Ie=(i=Ie)||n.memoizedState!==null,ds(e,t,n),Ie=i):ds(e,t,n);break;default:ds(e,t,n)}}function Rv(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new YE),t.forEach(function(i){var s=nA.bind(null,e,i);n.has(i)||(n.add(i),i.then(s,s))})}}function Gn(e,t){var n=t.deletions;if(n!==null)for(var i=0;is&&(s=o),i&=~r}if(i=s,i=le()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*GE(i/1960))-i,10e?16:e,ws===null)var i=!1;else{if(e=ws,ws=null,Ed=0,St&6)throw Error(H(331));var s=St;for(St|=4,tt=e.current;tt!==null;){var r=tt,o=r.child;if(tt.flags&16){var a=r.deletions;if(a!==null){for(var l=0;lle()-Kg?Sr(e,0):Xg|=n),an(e,t)}function kS(e,t){t===0&&(e.mode&1?(t=$c,$c<<=1,!($c&130023424)&&($c=4194304)):t=1);var n=Ue();e=ts(e,t),e!==null&&(lc(e,t,n),an(e,n))}function eA(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),kS(e,n)}function nA(e,t){var n=0;switch(e.tag){case 13:var i=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(H(314))}i!==null&&i.delete(t),kS(e,n)}var SS;SS=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||rn.current)nn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return nn=!1,WE(e,t,n);nn=!!(e.flags&131072)}else nn=!1,Gt&&t.flags&1048576&&Pk(t,_d,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;Ku(e,t),e=t.pendingProps;var s=$o(t,Ve.current);Eo(t,n),s=Vg(null,t,i,e,s,n);var r=zg();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,on(i)?(r=!0,xd(t)):r=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,jg(t),s.updater=gh,t.stateNode=s,s._reactInternals=t,nm(t,i,e,n),t=rm(null,t,i,!0,r,n)):(t.tag=0,Gt&&r&&Dg(t),He(null,t,s,n),t=t.child),t;case 16:i=t.elementType;t:{switch(Ku(e,t),e=t.pendingProps,s=i._init,i=s(i._payload),t.type=i,s=t.tag=sA(i),e=qn(i,e),s){case 0:t=sm(null,t,i,e,n);break t;case 1:t=Tv(null,t,i,e,n);break t;case 11:t=Cv(null,t,i,e,n);break t;case 14:t=Pv(null,t,i,qn(i.type,e),n);break t}throw Error(H(306,i,""))}return t;case 0:return i=t.type,s=t.pendingProps,s=t.elementType===i?s:qn(i,s),sm(e,t,i,s,n);case 1:return i=t.type,s=t.pendingProps,s=t.elementType===i?s:qn(i,s),Tv(e,t,i,s,n);case 3:t:{if(aS(t),e===null)throw Error(H(387));i=t.pendingProps,r=t.memoizedState,s=r.element,Ak(e,t),Sd(t,i,null,n);var o=t.memoizedState;if(i=o.element,r.isDehydrated)if(r={element:i,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=r,t.memoizedState=r,t.flags&256){s=Vo(Error(H(423)),t),t=Dv(e,t,i,n,s);break t}else if(i!==s){s=Vo(Error(H(424)),t),t=Dv(e,t,i,n,s);break t}else for(xn=Os(t.stateNode.containerInfo.firstChild),bn=t,Gt=!0,Zn=null,n=Nk(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Io(),i===s){t=es(e,t,n);break t}He(e,t,i,n)}t=t.child}return t;case 5:return jk(t),e===null&&Jp(t),i=t.type,s=t.pendingProps,r=e!==null?e.memoizedProps:null,o=s.children,Kp(i,s)?o=null:r!==null&&Kp(i,r)&&(t.flags|=32),oS(e,t),He(e,t,o,n),t.child;case 6:return e===null&&Jp(t),null;case 13:return lS(e,t,n);case 4:return $g(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Fo(t,null,i,n):He(e,t,i,n),t.child;case 11:return i=t.type,s=t.pendingProps,s=t.elementType===i?s:qn(i,s),Cv(e,t,i,s,n);case 7:return He(e,t,t.pendingProps,n),t.child;case 8:return He(e,t,t.pendingProps.children,n),t.child;case 12:return He(e,t,t.pendingProps.children,n),t.child;case 10:t:{if(i=t.type._context,s=t.pendingProps,r=t.memoizedProps,o=s.value,Bt(wd,i._currentValue),i._currentValue=o,r!==null)if(ii(r.value,o)){if(r.children===s.children&&!rn.current){t=es(e,t,n);break t}}else for(r=t.child,r!==null&&(r.return=t);r!==null;){var a=r.dependencies;if(a!==null){o=r.child;for(var l=a.firstContext;l!==null;){if(l.context===i){if(r.tag===1){l=Gi(-1,n&-n),l.tag=2;var c=r.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}r.lanes|=n,l=r.alternate,l!==null&&(l.lanes|=n),tm(r.return,n,t),a.lanes|=n;break}l=l.next}}else if(r.tag===10)o=r.type===t.type?null:r.child;else if(r.tag===18){if(o=r.return,o===null)throw Error(H(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),tm(o,n,t),o=r.sibling}else o=r.child;if(o!==null)o.return=r;else for(o=r;o!==null;){if(o===t){o=null;break}if(r=o.sibling,r!==null){r.return=o.return,o=r;break}o=o.return}r=o}He(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,i=t.pendingProps.children,Eo(t,n),s=Bn(s),i=i(s),t.flags|=1,He(e,t,i,n),t.child;case 14:return i=t.type,s=qn(i,t.pendingProps),s=qn(i.type,s),Pv(e,t,i,s,n);case 15:return sS(e,t,t.type,t.pendingProps,n);case 17:return i=t.type,s=t.pendingProps,s=t.elementType===i?s:qn(i,s),Ku(e,t),t.tag=1,on(i)?(e=!0,xd(t)):e=!1,Eo(t,n),Rk(t,i,s),nm(t,i,s,n),rm(null,t,i,!0,e,n);case 19:return cS(e,t,n);case 22:return rS(e,t,n)}throw Error(H(156,t.tag))};function MS(e,t){return Qw(e,t)}function iA(e,t,n,i){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function $n(e,t,n,i){return new iA(e,t,n,i)}function Zg(e){return e=e.prototype,!(!e||!e.isReactComponent)}function sA(e){if(typeof e=="function")return Zg(e)?1:0;if(e!=null){if(e=e.$$typeof,e===yg)return 11;if(e===vg)return 14}return 2}function js(e,t){var n=e.alternate;return n===null?(n=$n(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Qu(e,t,n,i,s,r){var o=2;if(i=e,typeof e=="function")Zg(e)&&(o=1);else if(typeof e=="string")o=5;else t:switch(e){case co:return Mr(n.children,s,r,t);case gg:o=8,s|=8;break;case Cp:return e=$n(12,n,t,s|2),e.elementType=Cp,e.lanes=r,e;case Pp:return e=$n(13,n,t,s),e.elementType=Pp,e.lanes=r,e;case Tp:return e=$n(19,n,t,s),e.elementType=Tp,e.lanes=r,e;case Lw:return bh(n,s,r,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Ow:o=10;break t;case Rw:o=9;break t;case yg:o=11;break t;case vg:o=14;break t;case ms:o=16,i=null;break t}throw Error(H(130,e==null?e:typeof e,""))}return t=$n(o,n,t,s),t.elementType=e,t.type=i,t.lanes=r,t}function Mr(e,t,n,i){return e=$n(7,e,i,t),e.lanes=n,e}function bh(e,t,n,i){return e=$n(22,e,i,t),e.elementType=Lw,e.lanes=n,e.stateNode={isHidden:!1},e}function Af(e,t,n){return e=$n(6,e,null,t),e.lanes=n,e}function Of(e,t,n){return t=$n(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function rA(e,t,n,i,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=hf(0),this.expirationTimes=hf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=hf(0),this.identifierPrefix=i,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Jg(e,t,n,i,s,r,o,a,l){return e=new rA(e,t,n,a,l),t===1?(t=1,r===!0&&(t|=8)):t=0,r=$n(3,null,null,t),e.current=r,r.stateNode=e,r.memoizedState={element:i,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},jg(r),e}function oA(e,t,n){var i=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(DS)}catch(e){console.error(e)}}DS(),Pw.exports=kn;var iy=Pw.exports,Vv=iy;Sp.createRoot=Vv.createRoot,Sp.hydrateRoot=Vv.hydrateRoot;/*! * @kurkle/color v0.3.2 * https://github.com/kurkle/color#readme * (c) 2023 Jukka Kurkela * Released under the MIT License - */function dc(e){return e+.5|0}const ks=(e,t,n)=>Math.max(Math.min(e,n),t);function Ka(e){return ks(dc(e*2.55),0,255)}function $s(e){return ks(dc(e*255),0,255)}function $i(e){return ks(dc(e/2.55)/100,0,1)}function zv(e){return ks(dc(e*100),0,100)}const Tn={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},ym=[..."0123456789ABCDEF"],dA=e=>ym[e&15],hA=e=>ym[(e&240)>>4]+ym[e&15],Kc=e=>(e&240)>>4===(e&15),fA=e=>Kc(e.r)&&Kc(e.g)&&Kc(e.b)&&Kc(e.a);function pA(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&Tn[e[1]]*17,g:255&Tn[e[2]]*17,b:255&Tn[e[3]]*17,a:t===5?Tn[e[4]]*17:255}:(t===7||t===9)&&(n={r:Tn[e[1]]<<4|Tn[e[2]],g:Tn[e[3]]<<4|Tn[e[4]],b:Tn[e[5]]<<4|Tn[e[6]],a:t===9?Tn[e[7]]<<4|Tn[e[8]]:255})),n}const mA=(e,t)=>e<255?t(e):"";function gA(e){var t=fA(e)?dA:hA;return e?"#"+t(e.r)+t(e.g)+t(e.b)+mA(e.a,t):void 0}const yA=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function ES(e,t,n){const i=t*Math.min(n,1-n),s=(r,o=(r+e/30)%12)=>n-i*Math.max(Math.min(o-3,9-o,1),-1);return[s(0),s(8),s(4)]}function vA(e,t,n){const i=(s,r=(s+e/60)%6)=>n-n*t*Math.max(Math.min(r,4-r,1),0);return[i(5),i(3),i(1)]}function xA(e,t,n){const i=ES(e,1,.5);let s;for(t+n>1&&(s=1/(t+n),t*=s,n*=s),s=0;s<3;s++)i[s]*=1-t-n,i[s]+=t;return i}function bA(e,t,n,i,s){return e===s?(t-n)/i+(t.5?u/(2-r-o):u/(r+o),l=bA(n,i,s,u,r),l=l*60+.5),[l|0,c||0,a]}function ry(e,t,n,i){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,i)).map($s)}function oy(e,t,n){return ry(ES,e,t,n)}function _A(e,t,n){return ry(xA,e,t,n)}function wA(e,t,n){return ry(vA,e,t,n)}function AS(e){return(e%360+360)%360}function kA(e){const t=yA.exec(e);let n=255,i;if(!t)return;t[5]!==i&&(n=t[6]?Ka(+t[5]):$s(+t[5]));const s=AS(+t[2]),r=+t[3]/100,o=+t[4]/100;return t[1]==="hwb"?i=_A(s,r,o):t[1]==="hsv"?i=wA(s,r,o):i=oy(s,r,o),{r:i[0],g:i[1],b:i[2],a:n}}function SA(e,t){var n=sy(e);n[0]=AS(n[0]+t),n=oy(n),e.r=n[0],e.g=n[1],e.b=n[2]}function MA(e){if(!e)return;const t=sy(e),n=t[0],i=zv(t[1]),s=zv(t[2]);return e.a<255?`hsla(${n}, ${i}%, ${s}%, ${$i(e.a)})`:`hsl(${n}, ${i}%, ${s}%)`}const Wv={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Hv={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function CA(){const e={},t=Object.keys(Hv),n=Object.keys(Wv);let i,s,r,o,a;for(i=0;i>16&255,r>>8&255,r&255]}return e}let Gc;function PA(e){Gc||(Gc=CA(),Gc.transparent=[0,0,0,0]);const t=Gc[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const TA=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function DA(e){const t=TA.exec(e);let n=255,i,s,r;if(t){if(t[7]!==i){const o=+t[7];n=t[8]?Ka(o):ks(o*255,0,255)}return i=+t[1],s=+t[3],r=+t[5],i=255&(t[2]?Ka(i):ks(i,0,255)),s=255&(t[4]?Ka(s):ks(s,0,255)),r=255&(t[6]?Ka(r):ks(r,0,255)),{r:i,g:s,b:r,a:n}}}function EA(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${$i(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const Lf=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,Qr=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function AA(e,t,n){const i=Qr($i(e.r)),s=Qr($i(e.g)),r=Qr($i(e.b));return{r:$s(Lf(i+n*(Qr($i(t.r))-i))),g:$s(Lf(s+n*(Qr($i(t.g))-s))),b:$s(Lf(r+n*(Qr($i(t.b))-r))),a:e.a+n*(t.a-e.a)}}function qc(e,t,n){if(e){let i=sy(e);i[t]=Math.max(0,Math.min(i[t]+i[t]*n,t===0?360:1)),i=oy(i),e.r=i[0],e.g=i[1],e.b=i[2]}}function OS(e,t){return e&&Object.assign(t||{},e)}function Uv(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=$s(e[3]))):(t=OS(e,{r:0,g:0,b:0,a:1}),t.a=$s(t.a)),t}function OA(e){return e.charAt(0)==="r"?DA(e):kA(e)}let LS=class vm{constructor(t){if(t instanceof vm)return t;const n=typeof t;let i;n==="object"?i=Uv(t):n==="string"&&(i=pA(t)||PA(t)||OA(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=OS(this._rgb);return t&&(t.a=$i(t.a)),t}set rgb(t){this._rgb=Uv(t)}rgbString(){return this._valid?EA(this._rgb):void 0}hexString(){return this._valid?gA(this._rgb):void 0}hslString(){return this._valid?MA(this._rgb):void 0}mix(t,n){if(t){const i=this.rgb,s=t.rgb;let r;const o=n===r?.5:n,a=2*o-1,l=i.a-s.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;r=1-c,i.r=255&c*i.r+r*s.r+.5,i.g=255&c*i.g+r*s.g+.5,i.b=255&c*i.b+r*s.b+.5,i.a=o*i.a+(1-o)*s.a,this.rgb=i}return this}interpolate(t,n){return t&&(this._rgb=AA(this._rgb,t._rgb,n)),this}clone(){return new vm(this.rgb)}alpha(t){return this._rgb.a=$s(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=dc(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=n,this}opaquer(t){const n=this._rgb;return n.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return qc(this._rgb,2,t),this}darken(t){return qc(this._rgb,2,-t),this}saturate(t){return qc(this._rgb,1,t),this}desaturate(t){return qc(this._rgb,1,-t),this}rotate(t){return SA(this._rgb,t),this}};/*! + */function hc(e){return e+.5|0}const ks=(e,t,n)=>Math.max(Math.min(e,n),t);function Ka(e){return ks(hc(e*2.55),0,255)}function $s(e){return ks(hc(e*255),0,255)}function $i(e){return ks(hc(e/2.55)/100,0,1)}function zv(e){return ks(hc(e*100),0,100)}const Tn={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},ym=[..."0123456789ABCDEF"],dA=e=>ym[e&15],hA=e=>ym[(e&240)>>4]+ym[e&15],Gc=e=>(e&240)>>4===(e&15),fA=e=>Gc(e.r)&&Gc(e.g)&&Gc(e.b)&&Gc(e.a);function pA(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&Tn[e[1]]*17,g:255&Tn[e[2]]*17,b:255&Tn[e[3]]*17,a:t===5?Tn[e[4]]*17:255}:(t===7||t===9)&&(n={r:Tn[e[1]]<<4|Tn[e[2]],g:Tn[e[3]]<<4|Tn[e[4]],b:Tn[e[5]]<<4|Tn[e[6]],a:t===9?Tn[e[7]]<<4|Tn[e[8]]:255})),n}const mA=(e,t)=>e<255?t(e):"";function gA(e){var t=fA(e)?dA:hA;return e?"#"+t(e.r)+t(e.g)+t(e.b)+mA(e.a,t):void 0}const yA=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function ES(e,t,n){const i=t*Math.min(n,1-n),s=(r,o=(r+e/30)%12)=>n-i*Math.max(Math.min(o-3,9-o,1),-1);return[s(0),s(8),s(4)]}function vA(e,t,n){const i=(s,r=(s+e/60)%6)=>n-n*t*Math.max(Math.min(r,4-r,1),0);return[i(5),i(3),i(1)]}function xA(e,t,n){const i=ES(e,1,.5);let s;for(t+n>1&&(s=1/(t+n),t*=s,n*=s),s=0;s<3;s++)i[s]*=1-t-n,i[s]+=t;return i}function bA(e,t,n,i,s){return e===s?(t-n)/i+(t.5?u/(2-r-o):u/(r+o),l=bA(n,i,s,u,r),l=l*60+.5),[l|0,c||0,a]}function ry(e,t,n,i){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,i)).map($s)}function oy(e,t,n){return ry(ES,e,t,n)}function _A(e,t,n){return ry(xA,e,t,n)}function wA(e,t,n){return ry(vA,e,t,n)}function AS(e){return(e%360+360)%360}function kA(e){const t=yA.exec(e);let n=255,i;if(!t)return;t[5]!==i&&(n=t[6]?Ka(+t[5]):$s(+t[5]));const s=AS(+t[2]),r=+t[3]/100,o=+t[4]/100;return t[1]==="hwb"?i=_A(s,r,o):t[1]==="hsv"?i=wA(s,r,o):i=oy(s,r,o),{r:i[0],g:i[1],b:i[2],a:n}}function SA(e,t){var n=sy(e);n[0]=AS(n[0]+t),n=oy(n),e.r=n[0],e.g=n[1],e.b=n[2]}function MA(e){if(!e)return;const t=sy(e),n=t[0],i=zv(t[1]),s=zv(t[2]);return e.a<255?`hsla(${n}, ${i}%, ${s}%, ${$i(e.a)})`:`hsl(${n}, ${i}%, ${s}%)`}const Wv={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Hv={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function CA(){const e={},t=Object.keys(Hv),n=Object.keys(Wv);let i,s,r,o,a;for(i=0;i>16&255,r>>8&255,r&255]}return e}let qc;function PA(e){qc||(qc=CA(),qc.transparent=[0,0,0,0]);const t=qc[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const TA=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function DA(e){const t=TA.exec(e);let n=255,i,s,r;if(t){if(t[7]!==i){const o=+t[7];n=t[8]?Ka(o):ks(o*255,0,255)}return i=+t[1],s=+t[3],r=+t[5],i=255&(t[2]?Ka(i):ks(i,0,255)),s=255&(t[4]?Ka(s):ks(s,0,255)),r=255&(t[6]?Ka(r):ks(r,0,255)),{r:i,g:s,b:r,a:n}}}function EA(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${$i(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const Rf=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,Qr=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function AA(e,t,n){const i=Qr($i(e.r)),s=Qr($i(e.g)),r=Qr($i(e.b));return{r:$s(Rf(i+n*(Qr($i(t.r))-i))),g:$s(Rf(s+n*(Qr($i(t.g))-s))),b:$s(Rf(r+n*(Qr($i(t.b))-r))),a:e.a+n*(t.a-e.a)}}function Qc(e,t,n){if(e){let i=sy(e);i[t]=Math.max(0,Math.min(i[t]+i[t]*n,t===0?360:1)),i=oy(i),e.r=i[0],e.g=i[1],e.b=i[2]}}function OS(e,t){return e&&Object.assign(t||{},e)}function Uv(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=$s(e[3]))):(t=OS(e,{r:0,g:0,b:0,a:1}),t.a=$s(t.a)),t}function OA(e){return e.charAt(0)==="r"?DA(e):kA(e)}let RS=class vm{constructor(t){if(t instanceof vm)return t;const n=typeof t;let i;n==="object"?i=Uv(t):n==="string"&&(i=pA(t)||PA(t)||OA(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=OS(this._rgb);return t&&(t.a=$i(t.a)),t}set rgb(t){this._rgb=Uv(t)}rgbString(){return this._valid?EA(this._rgb):void 0}hexString(){return this._valid?gA(this._rgb):void 0}hslString(){return this._valid?MA(this._rgb):void 0}mix(t,n){if(t){const i=this.rgb,s=t.rgb;let r;const o=n===r?.5:n,a=2*o-1,l=i.a-s.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;r=1-c,i.r=255&c*i.r+r*s.r+.5,i.g=255&c*i.g+r*s.g+.5,i.b=255&c*i.b+r*s.b+.5,i.a=o*i.a+(1-o)*s.a,this.rgb=i}return this}interpolate(t,n){return t&&(this._rgb=AA(this._rgb,t._rgb,n)),this}clone(){return new vm(this.rgb)}alpha(t){return this._rgb.a=$s(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=hc(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=n,this}opaquer(t){const n=this._rgb;return n.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Qc(this._rgb,2,t),this}darken(t){return Qc(this._rgb,2,-t),this}saturate(t){return Qc(this._rgb,1,t),this}desaturate(t){return Qc(this._rgb,1,-t),this}rotate(t){return SA(this._rgb,t),this}};/*! * Chart.js v4.4.2 * https://www.chartjs.org * (c) 2024 Chart.js Contributors * Released under the MIT License - */function Di(){}const LA=(()=>{let e=0;return()=>e++})();function bt(e){return e===null||typeof e>"u"}function Ut(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 gt(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function oe(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function mn(e,t){return oe(e)?e:t}function at(e,t){return typeof e>"u"?t:e}const RA=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,RS=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function $t(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function Et(e,t,n,i){let s,r,o;if(Ut(e))if(r=e.length,i)for(s=r-1;s>=0;s--)t.call(n,e[s],s);else for(s=0;se,x:e=>e.x,y:e=>e.y};function $A(e){const t=e.split("."),n=[];let i="";for(const s of t)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(n.push(i),i="");return n}function IA(e){const t=$A(e);return n=>{for(const i of t){if(i==="")break;n=n&&n[i]}return n}}function zs(e,t){return(Yv[t]||(Yv[t]=IA(t)))(e)}function ay(e){return e.charAt(0).toUpperCase()+e.slice(1)}const zl=e=>typeof e<"u",Ws=e=>typeof e=="function",Xv=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function FA(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const Kt=Math.PI,Xt=2*Kt,BA=Xt+Kt,Nd=Number.POSITIVE_INFINITY,VA=Kt/180,ue=Kt/2,sr=Kt/4,Kv=Kt*2/3,Ss=Math.log10,vi=Math.sign;function dl(e,t,n){return Math.abs(e-t)s-r).pop(),t}function Wo(e){return!isNaN(parseFloat(e))&&isFinite(e)}function WA(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function jS(e,t,n){let i,s,r;for(i=0,s=e.length;il&&c=Math.min(t,n)-i&&e<=Math.max(t,n)+i}function cy(e,t,n){n=n||(o=>e[o]1;)r=s+i>>1,n(r)?s=r:i=r;return{lo:s,hi:i}}const zi=(e,t,n,i)=>cy(e,n,i?s=>{const r=e[s][t];return re[s][t]cy(e,n,i=>e[i][t]>=n);function XA(e,t,n){let i=0,s=e.length;for(;ii&&e[s-1]>n;)s--;return i>0||s{const i="_onData"+ay(n),s=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...r){const o=s.apply(this,r);return e._chartjs.listeners.forEach(a=>{typeof a[i]=="function"&&a[i](...r)}),o}})})}function Qv(e,t){const n=e._chartjs;if(!n)return;const i=n.listeners,s=i.indexOf(t);s!==-1&&i.splice(s,1),!(i.length>0)&&(IS.forEach(r=>{delete e[r]}),delete e._chartjs)}function FS(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const BS=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function VS(e,t){let n=[],i=!1;return function(...s){n=s,i||(i=!0,BS.call(window,()=>{i=!1,e.apply(t,n)}))}}function GA(e,t){let n;return function(...i){return t?(clearTimeout(n),n=setTimeout(e,t,i)):e.apply(this,i),t}}const uy=e=>e==="start"?"left":e==="end"?"right":"center",Ne=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,qA=(e,t,n,i)=>e===(i?"left":"right")?n:e==="center"?(t+n)/2:t;function zS(e,t,n){const i=t.length;let s=0,r=i;if(e._sorted){const{iScale:o,_parsed:a}=e,l=o.axis,{min:c,max:u,minDefined:d,maxDefined:h}=o.getUserBounds();d&&(s=we(Math.min(zi(a,l,c).lo,n?i:zi(t,l,o.getPixelForValue(c)).lo),0,i-1)),h?r=we(Math.max(zi(a,o.axis,u,!0).hi+1,n?0:zi(t,l,o.getPixelForValue(u),!0).hi+1),s,i)-s:r=i-s}return{start:s,count:r}}function WS(e){const{xScale:t,yScale:n,_scaleRanges:i}=e,s={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!i)return e._scaleRanges=s,!0;const r=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==n.min||i.ymax!==n.max;return Object.assign(i,s),r}const Qc=e=>e===0||e===1,Zv=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*Xt/n)),Jv=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*Xt/n)+1,hl={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*ue)+1,easeOutSine:e=>Math.sin(e*ue),easeInOutSine:e=>-.5*(Math.cos(Kt*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>Qc(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=>Qc(e)?e:Zv(e,.075,.3),easeOutElastic:e=>Qc(e)?e:Jv(e,.075,.3),easeInOutElastic(e){return Qc(e)?e:e<.5?.5*Zv(e*2,.1125,.45):.5+.5*Jv(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-hl.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?hl.easeInBounce(e*2)*.5:hl.easeOutBounce(e*2-1)*.5+.5};function dy(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function tx(e){return dy(e)?e:new LS(e)}function Rf(e){return dy(e)?e:new LS(e).saturate(.5).darken(.1).hexString()}const QA=["x","y","borderWidth","radius","tension"],ZA=["color","borderColor","backgroundColor"];function JA(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:ZA},numbers:{type:"number",properties:QA}}),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 tO(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const ex=new Map;function eO(e,t){t=t||{};const n=e+JSON.stringify(t);let i=ex.get(n);return i||(i=new Intl.NumberFormat(e,t),ex.set(n,i)),i}function hc(e,t,n){return eO(t,n).format(e)}const HS={values(e){return Ut(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const i=this.chart.options.locale;let s,r=e;if(n.length>1){const c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),r=nO(e,n)}const o=Ss(Math.abs(r)),a=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),hc(e,i,l)},logarithmic(e,t,n){if(e===0)return"0";const i=n[t].significand||e/Math.pow(10,Math.floor(Ss(e)));return[1,2,3,5,10,15].includes(i)||t>.8*n.length?HS.numeric.call(this,e,t,n):""}};function nO(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 Mh={formatters:HS};function iO(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:Mh.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 Fr=Object.create(null),bm=Object.create(null);function fl(e,t){if(!t)return e;const n=t.split(".");for(let i=0,s=n.length;ii.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=(i,s)=>Rf(s.backgroundColor),this.hoverBorderColor=(i,s)=>Rf(s.borderColor),this.hoverColor=(i,s)=>Rf(s.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 Nf(this,t,n)}get(t){return fl(this,t)}describe(t,n){return Nf(bm,t,n)}override(t,n){return Nf(Fr,t,n)}route(t,n,i,s){const r=fl(this,t),o=fl(this,i),a="_"+n;Object.defineProperties(r,{[a]:{value:r[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],c=o[s];return gt(l)?Object.assign({},c,l):at(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}};var ne=new sO({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[JA,tO,iO]);function rO(e){return!e||bt(e.size)||bt(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function jd(e,t,n,i,s){let r=t[s];return r||(r=t[s]=e.measureText(s).width,n.push(s)),r>i&&(i=r),i}function oO(e,t,n,i){i=i||{};let s=i.data=i.data||{},r=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(s=i.data={},r=i.garbageCollect=[],i.font=t),e.save(),e.font=t;let o=0;const a=n.length;let l,c,u,d,h;for(l=0;ln.length){for(l=0;l0&&e.stroke()}}function Wi(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.xt.top-n&&e.y0&&r.strokeColor!=="";let l,c;for(e.save(),e.font=s.string,cO(e,r),l=0;l+e||0;function hy(e,t){const n={},i=gt(t),s=i?Object.keys(t):t,r=gt(e)?i?o=>at(e[o],e[t[o]]):o=>e[o]:()=>e;for(const o of s)n[o]=mO(r(o));return n}function YS(e){return hy(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Cr(e){return hy(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Ae(e){const t=YS(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function ge(e,t){e=e||{},t=t||ne.font;let n=at(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let i=at(e.style,t.style);i&&!(""+i).match(fO)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:at(e.family,t.family),lineHeight:pO(at(e.lineHeight,t.lineHeight),n),size:n,style:i,weight:at(e.weight,t.weight),string:""};return s.string=rO(s),s}function Ht(e,t,n,i){let s=!0,r,o,a;for(r=0,o=e.length;rn&&a===0?0:a+l;return{min:o(i,-Math.abs(r)),max:o(s,r)}}function Qs(e,t){return Object.assign(Object.create(e),t)}function fy(e,t=[""],n,i,s=()=>e[0]){const r=n||e;typeof i>"u"&&(i=qS("_fallback",e));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:r,_fallback:i,_getTarget:s,override:a=>fy([a,...e],t,r,i)};return new Proxy(o,{deleteProperty(a,l){return delete a[l],delete a._keys,delete e[0][l],!0},get(a,l){return KS(a,l,()=>SO(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return sx(a).includes(l)},ownKeys(a){return sx(a)},set(a,l,c){const u=a._storage||(a._storage=s());return a[l]=u[l]=c,delete a._keys,!0}})}function Ho(e,t,n,i){const s={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:XS(e,i),setContext:r=>Ho(e,r,n,i),override:r=>Ho(e.override(r),t,n,i)};return new Proxy(s,{deleteProperty(r,o){return delete r[o],delete e[o],!0},get(r,o,a){return KS(r,o,()=>vO(r,o,a))},getOwnPropertyDescriptor(r,o){return r._descriptors.allKeys?Reflect.has(e,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,o)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(r,o){return Reflect.has(e,o)},ownKeys(){return Reflect.ownKeys(e)},set(r,o,a){return e[o]=a,delete r[o],!0}})}function XS(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:i=t.indexable,_allKeys:s=t.allKeys}=e;return{allKeys:s,scriptable:n,indexable:i,isScriptable:Ws(n)?n:()=>n,isIndexable:Ws(i)?i:()=>i}}const yO=(e,t)=>e?e+ay(t):t,py=(e,t)=>gt(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function KS(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];const i=n();return e[t]=i,i}function vO(e,t,n){const{_proxy:i,_context:s,_subProxy:r,_descriptors:o}=e;let a=i[t];return Ws(a)&&o.isScriptable(t)&&(a=xO(t,a,e,n)),Ut(a)&&a.length&&(a=bO(t,a,e,o.isIndexable)),py(t,a)&&(a=Ho(a,s,r&&r[t],o)),a}function xO(e,t,n,i){const{_proxy:s,_context:r,_subProxy:o,_stack:a}=n;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);a.add(e);let l=t(r,o||i);return a.delete(e),py(e,l)&&(l=my(s._scopes,s,e,l)),l}function bO(e,t,n,i){const{_proxy:s,_context:r,_subProxy:o,_descriptors:a}=n;if(typeof r.index<"u"&&i(e))return t[r.index%t.length];if(gt(t[0])){const l=t,c=s._scopes.filter(u=>u!==l);t=[];for(const u of l){const d=my(c,s,e,u);t.push(Ho(d,r,o&&o[e],a))}}return t}function GS(e,t,n){return Ws(e)?e(t,n):e}const _O=(e,t)=>e===!0?t:typeof e=="string"?zs(t,e):void 0;function wO(e,t,n,i,s){for(const r of t){const o=_O(n,r);if(o){e.add(o);const a=GS(o._fallback,n,s);if(typeof a<"u"&&a!==n&&a!==i)return a}else if(o===!1&&typeof i<"u"&&n!==i)return null}return!1}function my(e,t,n,i){const s=t._rootScopes,r=GS(t._fallback,n,i),o=[...e,...s],a=new Set;a.add(i);let l=ix(a,o,n,r||n,i);return l===null||typeof r<"u"&&r!==n&&(l=ix(a,o,r,l,i),l===null)?!1:fy(Array.from(a),[""],s,r,()=>kO(t,n,i))}function ix(e,t,n,i,s){for(;n;)n=wO(e,t,n,i,s);return n}function kO(e,t,n){const i=e._getTarget();t in i||(i[t]={});const s=i[t];return Ut(s)&>(n)?n:s||{}}function SO(e,t,n,i){let s;for(const r of t)if(s=qS(yO(r,e),n),typeof s<"u")return py(e,s)?my(n,i,e,s):s}function qS(e,t){for(const n of t){if(!n)continue;const i=n[e];if(typeof i<"u")return i}}function sx(e){let t=e._keys;return t||(t=e._keys=MO(e._scopes)),t}function MO(e){const t=new Set;for(const n of e)for(const i of Object.keys(n).filter(s=>!s.startsWith("_")))t.add(i);return Array.from(t)}function QS(e,t,n,i){const{iScale:s}=e,{key:r="r"}=this._parsing,o=new Array(i);let a,l,c,u;for(a=0,l=i;ate==="x"?"y":"x";function PO(e,t,n,i){const s=e.skip?t:e,r=t,o=n.skip?t:n,a=xm(r,s),l=xm(o,r);let c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const d=i*c,h=i*u;return{previous:{x:r.x-d*(o.x-s.x),y:r.y-d*(o.y-s.y)},next:{x:r.x+h*(o.x-s.x),y:r.y+h*(o.y-s.y)}}}function TO(e,t,n){const i=e.length;let s,r,o,a,l,c=Uo(e,0);for(let u=0;u!c.skip)),t.cubicInterpolationMode==="monotone")EO(e,s);else{let c=i?e[e.length-1]:e[0];for(r=0,o=e.length;re.ownerDocument.defaultView.getComputedStyle(e,null);function LO(e,t){return Th(e).getPropertyValue(t)}const RO=["top","right","bottom","left"];function Pr(e,t,n){const i={};n=n?"-"+n:"";for(let s=0;s<4;s++){const r=RO[s];i[r]=parseFloat(e[t+"-"+r+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const NO=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function jO(e,t){const n=e.touches,i=n&&n.length?n[0]:e,{offsetX:s,offsetY:r}=i;let o=!1,a,l;if(NO(s,r,e.target))a=s,l=r;else{const c=t.getBoundingClientRect();a=i.clientX-c.left,l=i.clientY-c.top,o=!0}return{x:a,y:l,box:o}}function fr(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:i}=t,s=Th(n),r=s.boxSizing==="border-box",o=Pr(s,"padding"),a=Pr(s,"border","width"),{x:l,y:c,box:u}=jO(e,n),d=o.left+(u&&a.left),h=o.top+(u&&a.top);let{width:f,height:p}=t;return r&&(f-=o.width+a.width,p-=o.height+a.height),{x:Math.round((l-d)/f*n.width/i),y:Math.round((c-h)/p*n.height/i)}}function $O(e,t,n){let i,s;if(t===void 0||n===void 0){const r=yy(e);if(!r)t=e.clientWidth,n=e.clientHeight;else{const o=r.getBoundingClientRect(),a=Th(r),l=Pr(a,"border","width"),c=Pr(a,"padding");t=o.width-c.width-l.width,n=o.height-c.height-l.height,i=$d(a.maxWidth,r,"clientWidth"),s=$d(a.maxHeight,r,"clientHeight")}}return{width:t,height:n,maxWidth:i||Nd,maxHeight:s||Nd}}const Jc=e=>Math.round(e*10)/10;function IO(e,t,n,i){const s=Th(e),r=Pr(s,"margin"),o=$d(s.maxWidth,e,"clientWidth")||Nd,a=$d(s.maxHeight,e,"clientHeight")||Nd,l=$O(e,t,n);let{width:c,height:u}=l;if(s.boxSizing==="content-box"){const h=Pr(s,"border","width"),f=Pr(s,"padding");c-=f.width+h.width,u-=f.height+h.height}return c=Math.max(0,c-r.width),u=Math.max(0,i?c/i:u-r.height),c=Jc(Math.min(c,o,l.maxWidth)),u=Jc(Math.min(u,a,l.maxHeight)),c&&!u&&(u=Jc(c/2)),(t!==void 0||n!==void 0)&&i&&l.height&&u>l.height&&(u=l.height,c=Jc(Math.floor(u*i))),{width:c,height:u}}function rx(e,t,n){const i=t||1,s=Math.floor(e.height*i),r=Math.floor(e.width*i);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!==i||o.height!==s||o.width!==r?(e.currentDevicePixelRatio=i,o.height=s,o.width=r,e.ctx.setTransform(i,0,0,i,0,0),!0):!1}const FO=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};gy()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function ox(e,t){const n=LO(e,t),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function pr(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function BO(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:i==="middle"?n<.5?e.y:t.y:i==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function VO(e,t,n,i){const s={x:e.cp2x,y:e.cp2y},r={x:t.cp1x,y:t.cp1y},o=pr(e,s,n),a=pr(s,r,n),l=pr(r,t,n),c=pr(o,a,n),u=pr(a,l,n);return pr(c,u,n)}const zO=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,i){return n-i},leftForLtr(n,i){return n-i}}},WO=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function Oo(e,t,n){return e?zO(t,n):WO()}function JS(e,t){let n,i;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,i=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=i)}function tM(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function eM(e){return e==="angle"?{between:Wl,compare:HA,normalize:yn}:{between:Vi,compare:(t,n)=>t-n,normalize:t=>t}}function ax({start:e,end:t,count:n,loop:i,style:s}){return{start:e%n,end:t%n,loop:i&&(t-e+1)%n===0,style:s}}function HO(e,t,n){const{property:i,start:s,end:r}=n,{between:o,normalize:a}=eM(i),l=t.length;let{start:c,end:u,loop:d}=e,h,f;if(d){for(c+=l,u+=l,h=0,f=l;hl(s,x,y)&&a(s,x)!==0,w=()=>a(r,y)===0||l(r,x,y),S=()=>m||_(),C=()=>!m||w();for(let M=u,P=u;M<=d;++M)g=t[M%o],!g.skip&&(y=c(g[i]),y!==x&&(m=l(y,s,r),v===null&&S()&&(v=a(y,s)===0?M:P),v!==null&&C()&&(p.push(ax({start:v,end:M,loop:h,count:o,style:f})),v=null),P=M,x=y));return v!==null&&p.push(ax({start:v,end:d,loop:h,count:o,style:f})),p}function iM(e,t){const n=[],i=e.segments;for(let s=0;ss&&e[r%t].skip;)r--;return r%=t,{start:s,end:r}}function YO(e,t,n,i){const s=e.length,r=[];let o=t,a=e[t],l;for(l=t+1;l<=n;++l){const c=e[l%s];c.skip||c.stop?a.skip||(i=!1,r.push({start:t%s,end:(l-1)%s,loop:i}),t=o=c.stop?l:null):(o=l,a.skip&&(t=l)),a=c}return o!==null&&r.push({start:t%s,end:o%s,loop:i}),r}function XO(e,t){const n=e.points,i=e.options.spanGaps,s=n.length;if(!s)return[];const r=!!e._loop,{start:o,end:a}=UO(n,s,r,i);if(i===!0)return lx(e,[{start:o,end:a,loop:r}],n,t);const l=a{let e=0;return()=>e++})();function bt(e){return e===null||typeof e>"u"}function Ut(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 gt(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function oe(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function mn(e,t){return oe(e)?e:t}function at(e,t){return typeof e>"u"?t:e}const LA=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,LS=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function $t(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function Et(e,t,n,i){let s,r,o;if(Ut(e))if(r=e.length,i)for(s=r-1;s>=0;s--)t.call(n,e[s],s);else for(s=0;se,x:e=>e.x,y:e=>e.y};function $A(e){const t=e.split("."),n=[];let i="";for(const s of t)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(n.push(i),i="");return n}function IA(e){const t=$A(e);return n=>{for(const i of t){if(i==="")break;n=n&&n[i]}return n}}function zs(e,t){return(Yv[t]||(Yv[t]=IA(t)))(e)}function ay(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Wl=e=>typeof e<"u",Ws=e=>typeof e=="function",Xv=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function FA(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const Kt=Math.PI,Xt=2*Kt,BA=Xt+Kt,Nd=Number.POSITIVE_INFINITY,VA=Kt/180,ue=Kt/2,sr=Kt/4,Kv=Kt*2/3,Ss=Math.log10,vi=Math.sign;function hl(e,t,n){return Math.abs(e-t)s-r).pop(),t}function Wo(e){return!isNaN(parseFloat(e))&&isFinite(e)}function WA(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function jS(e,t,n){let i,s,r;for(i=0,s=e.length;il&&c=Math.min(t,n)-i&&e<=Math.max(t,n)+i}function cy(e,t,n){n=n||(o=>e[o]1;)r=s+i>>1,n(r)?s=r:i=r;return{lo:s,hi:i}}const zi=(e,t,n,i)=>cy(e,n,i?s=>{const r=e[s][t];return re[s][t]cy(e,n,i=>e[i][t]>=n);function XA(e,t,n){let i=0,s=e.length;for(;ii&&e[s-1]>n;)s--;return i>0||s{const i="_onData"+ay(n),s=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...r){const o=s.apply(this,r);return e._chartjs.listeners.forEach(a=>{typeof a[i]=="function"&&a[i](...r)}),o}})})}function Qv(e,t){const n=e._chartjs;if(!n)return;const i=n.listeners,s=i.indexOf(t);s!==-1&&i.splice(s,1),!(i.length>0)&&(IS.forEach(r=>{delete e[r]}),delete e._chartjs)}function FS(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const BS=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function VS(e,t){let n=[],i=!1;return function(...s){n=s,i||(i=!0,BS.call(window,()=>{i=!1,e.apply(t,n)}))}}function GA(e,t){let n;return function(...i){return t?(clearTimeout(n),n=setTimeout(e,t,i)):e.apply(this,i),t}}const uy=e=>e==="start"?"left":e==="end"?"right":"center",Ne=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,qA=(e,t,n,i)=>e===(i?"left":"right")?n:e==="center"?(t+n)/2:t;function zS(e,t,n){const i=t.length;let s=0,r=i;if(e._sorted){const{iScale:o,_parsed:a}=e,l=o.axis,{min:c,max:u,minDefined:d,maxDefined:h}=o.getUserBounds();d&&(s=we(Math.min(zi(a,l,c).lo,n?i:zi(t,l,o.getPixelForValue(c)).lo),0,i-1)),h?r=we(Math.max(zi(a,o.axis,u,!0).hi+1,n?0:zi(t,l,o.getPixelForValue(u),!0).hi+1),s,i)-s:r=i-s}return{start:s,count:r}}function WS(e){const{xScale:t,yScale:n,_scaleRanges:i}=e,s={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!i)return e._scaleRanges=s,!0;const r=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==n.min||i.ymax!==n.max;return Object.assign(i,s),r}const Zc=e=>e===0||e===1,Zv=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*Xt/n)),Jv=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*Xt/n)+1,fl={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*ue)+1,easeOutSine:e=>Math.sin(e*ue),easeInOutSine:e=>-.5*(Math.cos(Kt*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>Zc(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=>Zc(e)?e:Zv(e,.075,.3),easeOutElastic:e=>Zc(e)?e:Jv(e,.075,.3),easeInOutElastic(e){return Zc(e)?e:e<.5?.5*Zv(e*2,.1125,.45):.5+.5*Jv(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-fl.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?fl.easeInBounce(e*2)*.5:fl.easeOutBounce(e*2-1)*.5+.5};function dy(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function tx(e){return dy(e)?e:new RS(e)}function Lf(e){return dy(e)?e:new RS(e).saturate(.5).darken(.1).hexString()}const QA=["x","y","borderWidth","radius","tension"],ZA=["color","borderColor","backgroundColor"];function JA(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:ZA},numbers:{type:"number",properties:QA}}),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 tO(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const ex=new Map;function eO(e,t){t=t||{};const n=e+JSON.stringify(t);let i=ex.get(n);return i||(i=new Intl.NumberFormat(e,t),ex.set(n,i)),i}function fc(e,t,n){return eO(t,n).format(e)}const HS={values(e){return Ut(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const i=this.chart.options.locale;let s,r=e;if(n.length>1){const c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),r=nO(e,n)}const o=Ss(Math.abs(r)),a=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),fc(e,i,l)},logarithmic(e,t,n){if(e===0)return"0";const i=n[t].significand||e/Math.pow(10,Math.floor(Ss(e)));return[1,2,3,5,10,15].includes(i)||t>.8*n.length?HS.numeric.call(this,e,t,n):""}};function nO(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 Mh={formatters:HS};function iO(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:Mh.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 Fr=Object.create(null),bm=Object.create(null);function pl(e,t){if(!t)return e;const n=t.split(".");for(let i=0,s=n.length;ii.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=(i,s)=>Lf(s.backgroundColor),this.hoverBorderColor=(i,s)=>Lf(s.borderColor),this.hoverColor=(i,s)=>Lf(s.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 Nf(this,t,n)}get(t){return pl(this,t)}describe(t,n){return Nf(bm,t,n)}override(t,n){return Nf(Fr,t,n)}route(t,n,i,s){const r=pl(this,t),o=pl(this,i),a="_"+n;Object.defineProperties(r,{[a]:{value:r[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],c=o[s];return gt(l)?Object.assign({},c,l):at(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}};var ne=new sO({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[JA,tO,iO]);function rO(e){return!e||bt(e.size)||bt(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function jd(e,t,n,i,s){let r=t[s];return r||(r=t[s]=e.measureText(s).width,n.push(s)),r>i&&(i=r),i}function oO(e,t,n,i){i=i||{};let s=i.data=i.data||{},r=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(s=i.data={},r=i.garbageCollect=[],i.font=t),e.save(),e.font=t;let o=0;const a=n.length;let l,c,u,d,h;for(l=0;ln.length){for(l=0;l0&&e.stroke()}}function Wi(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.xt.top-n&&e.y0&&r.strokeColor!=="";let l,c;for(e.save(),e.font=s.string,cO(e,r),l=0;l+e||0;function hy(e,t){const n={},i=gt(t),s=i?Object.keys(t):t,r=gt(e)?i?o=>at(e[o],e[t[o]]):o=>e[o]:()=>e;for(const o of s)n[o]=mO(r(o));return n}function YS(e){return hy(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Cr(e){return hy(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Ae(e){const t=YS(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function ge(e,t){e=e||{},t=t||ne.font;let n=at(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let i=at(e.style,t.style);i&&!(""+i).match(fO)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:at(e.family,t.family),lineHeight:pO(at(e.lineHeight,t.lineHeight),n),size:n,style:i,weight:at(e.weight,t.weight),string:""};return s.string=rO(s),s}function Ht(e,t,n,i){let s=!0,r,o,a;for(r=0,o=e.length;rn&&a===0?0:a+l;return{min:o(i,-Math.abs(r)),max:o(s,r)}}function Qs(e,t){return Object.assign(Object.create(e),t)}function fy(e,t=[""],n,i,s=()=>e[0]){const r=n||e;typeof i>"u"&&(i=qS("_fallback",e));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:r,_fallback:i,_getTarget:s,override:a=>fy([a,...e],t,r,i)};return new Proxy(o,{deleteProperty(a,l){return delete a[l],delete a._keys,delete e[0][l],!0},get(a,l){return KS(a,l,()=>SO(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return sx(a).includes(l)},ownKeys(a){return sx(a)},set(a,l,c){const u=a._storage||(a._storage=s());return a[l]=u[l]=c,delete a._keys,!0}})}function Ho(e,t,n,i){const s={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:XS(e,i),setContext:r=>Ho(e,r,n,i),override:r=>Ho(e.override(r),t,n,i)};return new Proxy(s,{deleteProperty(r,o){return delete r[o],delete e[o],!0},get(r,o,a){return KS(r,o,()=>vO(r,o,a))},getOwnPropertyDescriptor(r,o){return r._descriptors.allKeys?Reflect.has(e,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,o)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(r,o){return Reflect.has(e,o)},ownKeys(){return Reflect.ownKeys(e)},set(r,o,a){return e[o]=a,delete r[o],!0}})}function XS(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:i=t.indexable,_allKeys:s=t.allKeys}=e;return{allKeys:s,scriptable:n,indexable:i,isScriptable:Ws(n)?n:()=>n,isIndexable:Ws(i)?i:()=>i}}const yO=(e,t)=>e?e+ay(t):t,py=(e,t)=>gt(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function KS(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];const i=n();return e[t]=i,i}function vO(e,t,n){const{_proxy:i,_context:s,_subProxy:r,_descriptors:o}=e;let a=i[t];return Ws(a)&&o.isScriptable(t)&&(a=xO(t,a,e,n)),Ut(a)&&a.length&&(a=bO(t,a,e,o.isIndexable)),py(t,a)&&(a=Ho(a,s,r&&r[t],o)),a}function xO(e,t,n,i){const{_proxy:s,_context:r,_subProxy:o,_stack:a}=n;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);a.add(e);let l=t(r,o||i);return a.delete(e),py(e,l)&&(l=my(s._scopes,s,e,l)),l}function bO(e,t,n,i){const{_proxy:s,_context:r,_subProxy:o,_descriptors:a}=n;if(typeof r.index<"u"&&i(e))return t[r.index%t.length];if(gt(t[0])){const l=t,c=s._scopes.filter(u=>u!==l);t=[];for(const u of l){const d=my(c,s,e,u);t.push(Ho(d,r,o&&o[e],a))}}return t}function GS(e,t,n){return Ws(e)?e(t,n):e}const _O=(e,t)=>e===!0?t:typeof e=="string"?zs(t,e):void 0;function wO(e,t,n,i,s){for(const r of t){const o=_O(n,r);if(o){e.add(o);const a=GS(o._fallback,n,s);if(typeof a<"u"&&a!==n&&a!==i)return a}else if(o===!1&&typeof i<"u"&&n!==i)return null}return!1}function my(e,t,n,i){const s=t._rootScopes,r=GS(t._fallback,n,i),o=[...e,...s],a=new Set;a.add(i);let l=ix(a,o,n,r||n,i);return l===null||typeof r<"u"&&r!==n&&(l=ix(a,o,r,l,i),l===null)?!1:fy(Array.from(a),[""],s,r,()=>kO(t,n,i))}function ix(e,t,n,i,s){for(;n;)n=wO(e,t,n,i,s);return n}function kO(e,t,n){const i=e._getTarget();t in i||(i[t]={});const s=i[t];return Ut(s)&>(n)?n:s||{}}function SO(e,t,n,i){let s;for(const r of t)if(s=qS(yO(r,e),n),typeof s<"u")return py(e,s)?my(n,i,e,s):s}function qS(e,t){for(const n of t){if(!n)continue;const i=n[e];if(typeof i<"u")return i}}function sx(e){let t=e._keys;return t||(t=e._keys=MO(e._scopes)),t}function MO(e){const t=new Set;for(const n of e)for(const i of Object.keys(n).filter(s=>!s.startsWith("_")))t.add(i);return Array.from(t)}function QS(e,t,n,i){const{iScale:s}=e,{key:r="r"}=this._parsing,o=new Array(i);let a,l,c,u;for(a=0,l=i;ate==="x"?"y":"x";function PO(e,t,n,i){const s=e.skip?t:e,r=t,o=n.skip?t:n,a=xm(r,s),l=xm(o,r);let c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const d=i*c,h=i*u;return{previous:{x:r.x-d*(o.x-s.x),y:r.y-d*(o.y-s.y)},next:{x:r.x+h*(o.x-s.x),y:r.y+h*(o.y-s.y)}}}function TO(e,t,n){const i=e.length;let s,r,o,a,l,c=Uo(e,0);for(let u=0;u!c.skip)),t.cubicInterpolationMode==="monotone")EO(e,s);else{let c=i?e[e.length-1]:e[0];for(r=0,o=e.length;re.ownerDocument.defaultView.getComputedStyle(e,null);function RO(e,t){return Th(e).getPropertyValue(t)}const LO=["top","right","bottom","left"];function Pr(e,t,n){const i={};n=n?"-"+n:"";for(let s=0;s<4;s++){const r=LO[s];i[r]=parseFloat(e[t+"-"+r+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const NO=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function jO(e,t){const n=e.touches,i=n&&n.length?n[0]:e,{offsetX:s,offsetY:r}=i;let o=!1,a,l;if(NO(s,r,e.target))a=s,l=r;else{const c=t.getBoundingClientRect();a=i.clientX-c.left,l=i.clientY-c.top,o=!0}return{x:a,y:l,box:o}}function fr(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:i}=t,s=Th(n),r=s.boxSizing==="border-box",o=Pr(s,"padding"),a=Pr(s,"border","width"),{x:l,y:c,box:u}=jO(e,n),d=o.left+(u&&a.left),h=o.top+(u&&a.top);let{width:f,height:p}=t;return r&&(f-=o.width+a.width,p-=o.height+a.height),{x:Math.round((l-d)/f*n.width/i),y:Math.round((c-h)/p*n.height/i)}}function $O(e,t,n){let i,s;if(t===void 0||n===void 0){const r=yy(e);if(!r)t=e.clientWidth,n=e.clientHeight;else{const o=r.getBoundingClientRect(),a=Th(r),l=Pr(a,"border","width"),c=Pr(a,"padding");t=o.width-c.width-l.width,n=o.height-c.height-l.height,i=$d(a.maxWidth,r,"clientWidth"),s=$d(a.maxHeight,r,"clientHeight")}}return{width:t,height:n,maxWidth:i||Nd,maxHeight:s||Nd}}const tu=e=>Math.round(e*10)/10;function IO(e,t,n,i){const s=Th(e),r=Pr(s,"margin"),o=$d(s.maxWidth,e,"clientWidth")||Nd,a=$d(s.maxHeight,e,"clientHeight")||Nd,l=$O(e,t,n);let{width:c,height:u}=l;if(s.boxSizing==="content-box"){const h=Pr(s,"border","width"),f=Pr(s,"padding");c-=f.width+h.width,u-=f.height+h.height}return c=Math.max(0,c-r.width),u=Math.max(0,i?c/i:u-r.height),c=tu(Math.min(c,o,l.maxWidth)),u=tu(Math.min(u,a,l.maxHeight)),c&&!u&&(u=tu(c/2)),(t!==void 0||n!==void 0)&&i&&l.height&&u>l.height&&(u=l.height,c=tu(Math.floor(u*i))),{width:c,height:u}}function rx(e,t,n){const i=t||1,s=Math.floor(e.height*i),r=Math.floor(e.width*i);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!==i||o.height!==s||o.width!==r?(e.currentDevicePixelRatio=i,o.height=s,o.width=r,e.ctx.setTransform(i,0,0,i,0,0),!0):!1}const FO=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};gy()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function ox(e,t){const n=RO(e,t),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function pr(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function BO(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:i==="middle"?n<.5?e.y:t.y:i==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function VO(e,t,n,i){const s={x:e.cp2x,y:e.cp2y},r={x:t.cp1x,y:t.cp1y},o=pr(e,s,n),a=pr(s,r,n),l=pr(r,t,n),c=pr(o,a,n),u=pr(a,l,n);return pr(c,u,n)}const zO=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,i){return n-i},leftForLtr(n,i){return n-i}}},WO=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function Oo(e,t,n){return e?zO(t,n):WO()}function JS(e,t){let n,i;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,i=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=i)}function tM(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function eM(e){return e==="angle"?{between:Hl,compare:HA,normalize:yn}:{between:Vi,compare:(t,n)=>t-n,normalize:t=>t}}function ax({start:e,end:t,count:n,loop:i,style:s}){return{start:e%n,end:t%n,loop:i&&(t-e+1)%n===0,style:s}}function HO(e,t,n){const{property:i,start:s,end:r}=n,{between:o,normalize:a}=eM(i),l=t.length;let{start:c,end:u,loop:d}=e,h,f;if(d){for(c+=l,u+=l,h=0,f=l;hl(s,x,y)&&a(s,x)!==0,w=()=>a(r,y)===0||l(r,x,y),S=()=>m||_(),C=()=>!m||w();for(let M=u,P=u;M<=d;++M)g=t[M%o],!g.skip&&(y=c(g[i]),y!==x&&(m=l(y,s,r),v===null&&S()&&(v=a(y,s)===0?M:P),v!==null&&C()&&(p.push(ax({start:v,end:M,loop:h,count:o,style:f})),v=null),P=M,x=y));return v!==null&&p.push(ax({start:v,end:d,loop:h,count:o,style:f})),p}function iM(e,t){const n=[],i=e.segments;for(let s=0;ss&&e[r%t].skip;)r--;return r%=t,{start:s,end:r}}function YO(e,t,n,i){const s=e.length,r=[];let o=t,a=e[t],l;for(l=t+1;l<=n;++l){const c=e[l%s];c.skip||c.stop?a.skip||(i=!1,r.push({start:t%s,end:(l-1)%s,loop:i}),t=o=c.stop?l:null):(o=l,a.skip&&(t=l)),a=c}return o!==null&&r.push({start:t%s,end:o%s,loop:i}),r}function XO(e,t){const n=e.points,i=e.options.spanGaps,s=n.length;if(!s)return[];const r=!!e._loop,{start:o,end:a}=UO(n,s,r,i);if(i===!0)return lx(e,[{start:o,end:a,loop:r}],n,t);const l=aa({chart:t,initial:n.initial,numSteps:o,currentStep:Math.min(i-n.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=BS.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const r=i.items;let o=r.length-1,a=!1,l;for(;o>=0;--o)l=r[o],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),a=!0):(r[o]=r[r.length-1],r.pop());a&&(s.draw(),this._notify(s,i,t,"progress")),r.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),n+=r.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let i=n.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,i)),i}listen(t,n,i){this._getAnims(t).listeners[n].push(i)}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((i,s)=>Math.max(i,s._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 i=n.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}};var Ai=new qO;const ux="transparent",QO={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const i=tx(e||ux),s=i.valid&&tx(t||ux);return s&&s.valid?s.mix(i,n).hexString():t},number(e,t,n){return e+(t-e)*n}};let ZO=class{constructor(t,n,i,s){const r=n[i];s=Ht([t.to,s,r,t.from]);const o=Ht([t.from,r,s]);this._active=!0,this._fn=t.fn||QO[t.type||typeof o],this._easing=hl[t.easing]||hl.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=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(t,n,i){if(this._active){this._notify(!1);const s=this._target[this._prop],r=i-this._start,o=this._duration-r;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=Ht([t.to,n,s,t.from]),this._from=Ht([t.from,s,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,i=this._duration,s=this._prop,r=this._from,o=this._loop,a=this._to;let l;if(this._active=r!==a&&(o||n1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(r,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,i)=>{t.push({res:n,rej:i})})}_notify(t){const n=t?"res":"rej",i=this._promises||[];for(let s=0;s{const r=t[s];if(!gt(r))return;const o={};for(const a of n)o[a]=r[a];(Ut(r.properties)&&r.properties||[s]).forEach(a=>{(a===s||!i.has(a))&&i.set(a,o)})})}_animateOptions(t,n){const i=n.options,s=t2(t,i);if(!s)return[];const r=this._createAnimations(s,i);return i.$shared&&JO(t.options.$animations,i).then(()=>{t.options=i},()=>{}),r}_createAnimations(t,n){const i=this._properties,s=[],r=t.$animations||(t.$animations={}),o=Object.keys(n),a=Date.now();let l;for(l=o.length-1;l>=0;--l){const c=o[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,n));continue}const u=n[c];let d=r[c];const h=i.get(c);if(d)if(h&&d.active()){d.update(h,u,a);continue}else d.cancel();if(!h||!h.duration){t[c]=u;continue}r[c]=d=new ZO(h,t,c,u),s.push(d)}return s}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const i=this._createAnimations(t,n);if(i.length)return Ai.add(this._chart,i),!0}};function JO(e,t){const n=[],i=Object.keys(t);for(let s=0;s0||!n&&r<0)return s.index}return null}function mx(e,t){const{chart:n,_cachedMeta:i}=e,s=n._stacks||(n._stacks={}),{iScale:r,vScale:o,index:a}=i,l=r.axis,c=o.axis,u=s2(r,o,i),d=t.length;let h;for(let f=0;fn[i].axis===t).shift()}function a2(e,t){return Qs(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function l2(e,t,n){return Qs(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function xa(e,t){const n=e.controller.index,i=e.vScale&&e.vScale.axis;if(i){t=t||e._parsed;for(const s of t){const r=s._stacks;if(!r||r[i]===void 0||r[i][n]===void 0)return;delete r[i][n],r[i]._visualValues!==void 0&&r[i]._visualValues[n]!==void 0&&delete r[i]._visualValues[n]}}}const $f=e=>e==="reset"||e==="none",gx=(e,t)=>t?e:Object.assign({},e),c2=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:rM(n,!0),values:null};var Na;let Zs=(Na=class{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=fx(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&&xa(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,i=this.getDataset(),s=(d,h,f,p)=>d==="x"?h:d==="r"?p:f,r=n.xAxisID=at(i.xAxisID,jf(t,"x")),o=n.yAxisID=at(i.yAxisID,jf(t,"y")),a=n.rAxisID=at(i.rAxisID,jf(t,"r")),l=n.indexAxis,c=n.iAxisID=s(l,r,o,a),u=n.vAxisID=s(l,o,r,a);n.xScale=this.getScaleForId(r),n.yScale=this.getScaleForId(o),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(u)}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&&Qv(this._data,this),t._stacked&&xa(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),i=this._data;if(gt(n))this._data=i2(n);else if(i!==n){if(i){Qv(i,this);const s=this._cachedMeta;xa(s),s._parsed=[]}n&&Object.isExtensible(n)&&KA(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,i=this.getDataset();let s=!1;this._dataCheck();const r=n._stacked;n._stacked=fx(n.vScale,n),n.stack!==i.stack&&(s=!0,xa(n),n.stack=i.stack),this._resyncElements(t),(s||r!==n._stacked)&&mx(this,n._parsed)}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:i,_data:s}=this,{iScale:r,_stacked:o}=i,a=r.axis;let l=t===0&&n===s.length?!0:i._sorted,c=t>0&&i._parsed[t-1],u,d,h;if(this._parsing===!1)i._parsed=s,i._sorted=!0,h=s;else{Ut(s[t])?h=this.parseArrayData(i,s,t,n):gt(s[t])?h=this.parseObjectData(i,s,t,n):h=this.parsePrimitiveData(i,s,t,n);const f=()=>d[a]===null||c&&d[a]m||d=0;--h)if(!p()){this.updateRangeFromParsed(c,t,f,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,i=[];let s,r,o;for(s=0,r=n.length;s=0&&tthis.getContext(i,s,n),m=c.resolveNamedOptions(h,f,p,d);return m.$shared&&(m.$shared=l,r[o]=Object.freeze(gx(m,l))),m}_resolveAnimations(t,n,i){const s=this.chart,r=this._cachedDataOpts,o=`animation-${n}`,a=r[o];if(a)return a;let l;if(s.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,n),h=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(h,this.getContext(t,i,n))}const c=new sM(s,l&&l.animations);return l&&l._cacheable&&(r[o]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||$f(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const i=this.resolveDataElementOptions(t,n),s=this._sharedOptions,r=this.getSharedOptions(i),o=this.includeOptions(n,r)||r!==s;return this.updateSharedOptions(r,n,i),{sharedOptions:r,includeOptions:o}}updateElement(t,n,i,s){$f(s)?Object.assign(t,i):this._resolveAnimations(n,s).update(t,i)}updateSharedOptions(t,n,i){t&&!$f(n)&&this._resolveAnimations(void 0,n).update(t,i)}_setStyle(t,n,i,s){t.active=s;const r=this.getStyle(n,s);this._resolveAnimations(n,i,s).update(t,{options:!s&&this.getSharedOptions(r)||r})}removeHoverStyle(t,n,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,n,i){this._setStyle(t,i,"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,i=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const s=i.length,r=n.length,o=Math.min(r,s);o&&this.parse(0,o),r>s?this._insertElements(s,r-s,t):r{for(c.length+=n,a=c.length-1;a>=o;a--)c[a]=c[a-n]};for(l(r),a=t;as-r))}return e._cache.$bar}function d2(e){const t=e.iScale,n=u2(t,e.type);let i=t._length,s,r,o,a;const l=()=>{o===32767||o===-32768||(zl(a)&&(i=Math.min(i,Math.abs(o-a)||i)),a=o)};for(s=0,r=n.length;s0?s[e-1]:null,a=eMath.abs(a)&&(l=a,c=o),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:r,min:o,max:a}}function oM(e,t,n,i){return Ut(e)?p2(e,t,n,i):t[n.axis]=n.parse(e,i),t}function yx(e,t,n,i){const s=e.iScale,r=e.vScale,o=s.getLabels(),a=s===r,l=[];let c,u,d,h;for(c=n,u=n+i;c=n?1:-1)}function g2(e){let t,n,i,s,r;return e.horizontal?(t=e.base>e.x,n="left",i="right"):(t=e.basel.controller.options.grouped),r=i.options.stacked,o=[],a=l=>{const c=l.controller.getParsed(n),u=c&&c[l.vScale.axis];if(bt(u)||isNaN(u))return!0};for(const l of s)if(!(n!==void 0&&a(l))&&((r===!1||o.indexOf(l.stack)===-1||r===void 0&&l.stack===void 0)&&o.push(l.stack),l.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,n,i){const s=this._getStacks(t,i),r=n!==void 0?s.indexOf(n):-1;return r===-1?s.length-1:r}_getRuler(){const t=this.options,n=this._cachedMeta,i=n.iScale,s=[];let r,o;for(r=0,o=n.data.length;r=0;--i)n=Math.max(n,t[i].size(this.resolveDataElementOptions(i))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:r}=n,o=this.getParsed(t),a=s.getLabelForValue(o.x),l=r.getLabelForValue(o.y),c=o._custom;return{label:i[t]||"",value:"("+a+", "+l+(c?", "+c:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,i,s){const r=s==="reset",{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(n,s),u=o.axis,d=a.axis;for(let h=n;hWl(x,a,l,!0)?1:Math.max(_,_*n,w,w*n),p=(x,_,w)=>Wl(x,a,l,!0)?-1:Math.min(_,_*n,w,w*n),m=f(0,c,d),v=f(ue,u,h),y=p(Kt,c,d),g=p(Kt+ue,u,h);i=(m-y)/2,s=(v-g)/2,r=-(m+y)/2,o=-(v+g)/2}return{ratioX:i,ratioY:s,offsetX:r,offsetY:o}}var no;let vy=(no=class extends Zs{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 i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let r=l=>+i[l];if(gt(i[t])){const{key:l="value"}=this._parsing;r=c=>+zs(i[c],l)}let o,a;for(o=t,a=t+n;o0&&!isNaN(t)?Xt*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=hc(n._parsed[t],i.options.locale);return{label:s[t]||"",value:r}}getMaxBorderWidth(t){let n=0;const i=this.chart;let s,r,o,a,l;if(!t){for(s=0,r=i.data.datasets.length;st!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),K(no,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return n.labels.map((r,o)=>{const l=t.getDatasetMeta(0).controller.getStyle(o);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(o),index:o}})}return[]}},onClick(t,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}}}),no);var Ia;let k2=(Ia=class extends Zs{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:i,data:s=[],_dataset:r}=n,o=this.chart._animationsDisabled;let{start:a,count:l}=zS(n,s,o);this._drawStart=a,this._drawCount=l,WS(n)&&(a=0,l=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!r._decimated,i.points=s;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:c},t),this.updateElements(s,a,l,t)}updateElements(t,n,i,s){const r=s==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(n,s),h=o.axis,f=a.axis,{spanGaps:p,segment:m}=this.options,v=Wo(p)?p:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||r||s==="none",g=n+i,x=t.length;let _=n>0&&this.getParsed(n-1);for(let w=0;w=g){C.skip=!0;continue}const M=this.getParsed(w),P=bt(M[f]),T=C[h]=o.getPixelForValue(M[h],w),A=C[f]=r||P?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,M,l):M[f],w);C.skip=isNaN(T)||isNaN(A)||P,C.stop=w>0&&Math.abs(M[h]-_[h])>v,m&&(C.parsed=M,C.raw=c.data[w]),d&&(C.options=u||this.resolveDataElementOptions(w,S.active?"active":s)),y||this.updateElement(S,w,C,s),_=M}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,i=n.options&&n.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const r=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,r,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}},K(Ia,"id","line"),K(Ia,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),K(Ia,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}}),Ia);var Fa;let aM=(Fa=class extends Zs{constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=hc(n._parsed[t].r,i.options.locale);return{label:s[t]||"",value:r}}parseObjectData(t,n,i,s){return QS.bind(this)(t,n,i,s)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,s)=>{const r=this.getParsed(s).r;!isNaN(r)&&this.chart.getDataVisibility(s)&&(rn.max&&(n.max=r))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,i=t.options,s=Math.min(n.right-n.left,n.bottom-n.top),r=Math.max(s/2,0),o=Math.max(i.cutoutPercentage?r/100*i.cutoutPercentage:1,0),a=(r-o)/t.getVisibleDatasetCount();this.outerRadius=r-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,n,i,s){const r=s==="reset",o=this.chart,l=o.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,d=c.yCenter,h=c.getIndexAngle(0)-.5*Kt;let f=h,p;const m=360/this.countVisibleElements();for(p=0;p{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&n++}),n}_computeAngle(t,n,i){return this.chart.getDataVisibility(t)?Jn(this.resolveDataElementOptions(t,n).angle||i):0}},K(Fa,"id","polarArea"),K(Fa,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),K(Fa,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return n.labels.map((r,o)=>{const l=t.getDatasetMeta(0).controller.getStyle(o);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(o),index:o}})}return[]}},onClick(t,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}}),Fa);var Ou;let S2=(Ou=class extends vy{},K(Ou,"id","pie"),K(Ou,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"}),Ou);var Ba;let M2=(Ba=class extends Zs{getLabelAndValue(t){const n=this._cachedMeta.vScale,i=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(i[n.axis])}}parseObjectData(t,n,i,s){return QS.bind(this)(t,n,i,s)}update(t){const n=this._cachedMeta,i=n.dataset,s=n.data||[],r=n.iScale.getLabels();if(i.points=s,t!=="resize"){const o=this.resolveDatasetElementOptions(t);this.options.showLine||(o.borderWidth=0);const a={_loop:!0,_fullLoop:r.length===s.length,options:o};this.updateElement(i,void 0,a,t)}this.updateElements(s,0,s.length,t)}updateElements(t,n,i,s){const r=this._cachedMeta.rScale,o=s==="reset";for(let a=n;a0&&this.getParsed(n-1);for(let _=n;_0&&Math.abs(S[f]-x[f])>y,v&&(C.parsed=S,C.raw=c.data[_]),h&&(C.options=d||this.resolveDataElementOptions(_,w.active?"active":s)),g||this.updateElement(w,_,C,s),x=S}this.updateSharedOptions(d,s,u)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let a=0;for(let l=n.length-1;l>=0;--l)a=Math.max(a,n[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!n.length)return s;const r=n[0].size(this.resolveDataElementOptions(0)),o=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(s,r,o)/2}},K(Va,"id","scatter"),K(Va,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),K(Va,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}}),Va);var P2=Object.freeze({__proto__:null,BarController:b2,BubbleController:_2,DoughnutController:vy,LineController:k2,PieController:S2,PolarAreaController:aM,RadarController:M2,ScatterController:C2});function or(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class xy{constructor(t){K(this,"options");this.options=t||{}}static override(t){Object.assign(xy.prototype,t)}init(){}formats(){return or()}parse(){return or()}format(){return or()}add(){return or()}diff(){return or()}startOf(){return or()}endOf(){return or()}}var T2={_date:xy};function D2(e,t,n,i){const{controller:s,data:r,_sorted:o}=e,a=s._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&o&&r.length){const l=a._reversePixels?YA:zi;if(i){if(s._sharedOptions){const c=r[0],u=typeof c.getRange=="function"&&c.getRange(t);if(u){const d=l(r,t,n-u),h=l(r,t,n+u);return{lo:d.lo,hi:h.hi}}}}else return l(r,t,n)}return{lo:0,hi:r.length-1}}function fc(e,t,n,i,s){const r=e.getSortedVisibleDatasetMetas(),o=n[t];for(let a=0,l=r.length;a{l[o](t[n],s)&&(r.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,s))}),i&&!a?[]:r}var L2={evaluateInteractionItems:fc,modes:{index(e,t,n,i){const s=fr(t,e),r=n.axis||"x",o=n.includeInvisible||!1,a=n.intersect?Ff(e,s,r,i,o):Bf(e,s,r,!1,i,o),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(e,t,n,i){const s=fr(t,e),r=n.axis||"xy",o=n.includeInvisible||!1;let a=n.intersect?Ff(e,s,r,i,o):Bf(e,s,r,!1,i,o);if(a.length>0){const l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let u=0;un.pos===t)}function _x(e,t){return e.filter(n=>lM.indexOf(n.pos)===-1&&n.box.axis===t)}function _a(e,t){return e.sort((n,i)=>{const s=t?i:n,r=t?n:i;return s.weight===r.weight?s.index-r.index:s.weight-r.weight})}function R2(e){const t=[];let n,i,s,r,o,a;for(n=0,i=(e||[]).length;nc.box.fullSize),!0),i=_a(ba(t,"left"),!0),s=_a(ba(t,"right")),r=_a(ba(t,"top"),!0),o=_a(ba(t,"bottom")),a=_x(t,"x"),l=_x(t,"y");return{fullSize:n,leftAndTop:i.concat(r),rightAndBottom:s.concat(l).concat(o).concat(a),chartArea:ba(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:r.concat(o).concat(a)}}function wx(e,t,n,i){return Math.max(e[n],t[n])+Math.max(e[i],t[i])}function cM(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 I2(e,t,n,i){const{pos:s,box:r}=n,o=e.maxPadding;if(!gt(s)){n.size&&(e[s]-=n.size);const d=i[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?r.height:r.width),n.size=d.size/d.count,e[s]+=n.size}r.getPadding&&cM(o,r.getPadding());const a=Math.max(0,t.outerWidth-wx(o,e,"left","right")),l=Math.max(0,t.outerHeight-wx(o,e,"top","bottom")),c=a!==e.w,u=l!==e.h;return e.w=a,e.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function F2(e){const t=e.maxPadding;function n(i){const s=Math.max(t[i]-e[i],0);return e[i]+=s,s}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function B2(e,t){const n=t.maxPadding;function i(s){const r={left:0,top:0,right:0,bottom:0};return s.forEach(o=>{r[o]=Math.max(t[o],n[o])}),r}return i(e?["left","right"]:["top","bottom"])}function Ga(e,t,n,i){const s=[];let r,o,a,l,c,u;for(r=0,o=e.length,c=0;r{typeof m.beforeLayout=="function"&&m.beforeLayout()});const u=l.reduce((m,v)=>v.box.options&&v.box.options.display===!1?m:m+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:s,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/u,hBoxMaxHeight:o/2}),h=Object.assign({},s);cM(h,Ae(i));const f=Object.assign({maxPadding:h,w:r,h:o,x:s.left,y:s.top},s),p=j2(l.concat(c),d);Ga(a.fullSize,f,d,p),Ga(l,f,d,p),Ga(c,f,d,p)&&Ga(l,f,d,p),F2(f),kx(a.leftAndTop,f,d,p),f.x+=f.w,f.y+=f.h,kx(a.rightAndBottom,f,d,p),e.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},Et(a.chartArea,m=>{const v=m.box;Object.assign(v,e.chartArea),v.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};let uM=class{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,i){}removeEventListener(t,n,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,i,s){return n=Math.max(0,n||t.width),i=i||t.height,{width:n,height:Math.max(0,s?Math.floor(n/s):i)}}isAttached(t){return!0}updateConfig(t){}},V2=class extends uM{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}};const Qu="$chartjs",z2={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Sx=e=>e===null||e==="";function W2(e,t){const n=e.style,i=e.getAttribute("height"),s=e.getAttribute("width");if(e[Qu]={initial:{height:i,width:s,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",Sx(s)){const r=ox(e,"width");r!==void 0&&(e.width=r)}if(Sx(i))if(e.style.height==="")e.height=e.width/(t||2);else{const r=ox(e,"height");r!==void 0&&(e.height=r)}return e}const dM=FO?{passive:!0}:!1;function H2(e,t,n){e&&e.addEventListener(t,n,dM)}function U2(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,dM)}function Y2(e,t){const n=z2[e.type]||e.type,{x:i,y:s}=fr(e,t);return{type:n,chart:t,native:e,x:i!==void 0?i:null,y:s!==void 0?s:null}}function Id(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function X2(e,t,n){const i=e.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||Id(a.addedNodes,i),o=o&&!Id(a.removedNodes,i);o&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}function K2(e,t,n){const i=e.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||Id(a.removedNodes,i),o=o&&!Id(a.addedNodes,i);o&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}const Ul=new Map;let Mx=0;function hM(){const e=window.devicePixelRatio;e!==Mx&&(Mx=e,Ul.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function G2(e,t){Ul.size||window.addEventListener("resize",hM),Ul.set(e,t)}function q2(e){Ul.delete(e),Ul.size||window.removeEventListener("resize",hM)}function Q2(e,t,n){const i=e.canvas,s=i&&yy(i);if(!s)return;const r=VS((a,l)=>{const c=s.clientWidth;n(a,l),c{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||r(c,u)});return o.observe(s),G2(e,r),o}function Vf(e,t,n){n&&n.disconnect(),t==="resize"&&q2(e)}function Z2(e,t,n){const i=e.canvas,s=VS(r=>{e.ctx!==null&&n(Y2(r,e))},e);return H2(i,t,s),s}let J2=class extends uM{acquireContext(t,n){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(W2(t,n),i):null}releaseContext(t){const n=t.canvas;if(!n[Qu])return!1;const i=n[Qu].initial;["height","width"].forEach(r=>{const o=i[r];bt(o)?n.removeAttribute(r):n.setAttribute(r,o)});const s=i.style||{};return Object.keys(s).forEach(r=>{n.style[r]=s[r]}),n.width=n.width,delete n[Qu],!0}addEventListener(t,n,i){this.removeEventListener(t,n);const s=t.$proxies||(t.$proxies={}),o={attach:X2,detach:K2,resize:Q2}[n]||Z2;s[n]=o(t,n,i)}removeEventListener(t,n){const i=t.$proxies||(t.$proxies={}),s=i[n];if(!s)return;({attach:Vf,detach:Vf,resize:Vf}[n]||U2)(t,n,s),i[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,i,s){return IO(t,n,i,s)}isAttached(t){const n=yy(t);return!!(n&&n.isConnected)}};function tL(e){return!gy()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?V2:J2}var Lu;let os=(Lu=class{constructor(){K(this,"x");K(this,"y");K(this,"active",!1);K(this,"options");K(this,"$animations")}tooltipPosition(t){const{x:n,y:i}=this.getProps(["x","y"],t);return{x:n,y:i}}hasValue(){return Wo(this.x)&&Wo(this.y)}getProps(t,n){const i=this.$animations;if(!n||!i)return this;const s={};return t.forEach(r=>{s[r]=i[r]&&i[r].active()?i[r]._to:this[r]}),s}},K(Lu,"defaults",{}),K(Lu,"defaultRoutes"),Lu);function eL(e,t){const n=e.options.ticks,i=nL(e),s=Math.min(n.maxTicksLimit||i,i),r=n.major.enabled?sL(t):[],o=r.length,a=r[0],l=r[o-1],c=[];if(o>s)return rL(t,c,r,o/s),c;const u=iL(r,t,s);if(o>0){let d,h;const f=o>1?Math.round((l-a)/(o-1)):null;for(eu(t,c,u,bt(f)?0:a-f,a),d=0,h=o-1;ds)return l}return Math.max(s,1)}function sL(e){const t=[];let n,i;for(n=0,i=e.length;ne==="left"?"right":e==="right"?"left":e,Cx=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,Px=(e,t)=>Math.min(t||e,e);function Tx(e,t){const n=[],i=e.length/t,s=e.length;let r=0;for(;ro+a)))return l}function cL(e,t){Et(e,n=>{const i=n.gc,s=i.length/2;let r;if(s>t){for(r=0;ri?i:n,i=s&&n>i?n:i,{min:mn(n,mn(i,n)),max:mn(i,mn(n,i))}}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(){$t(this.options.beforeUpdate,[this])}update(t,n,i){const{beginAtZero:s,grace:r,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=gO(this,r,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a=r||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const u=this._getLabelSizes(),d=u.widest.width,h=u.highest.height,f=we(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/i:f/(i-1),d+6>a&&(a=f/(i-(t.offset?.5:1)),l=this.maxHeight-wa(t.grid)-n.padding-Dx(t.title,this.chart.options.font),c=Math.sqrt(d*d+h*h),o=ly(Math.min(Math.asin(we((u.highest.height+6)/a,-1,1)),Math.asin(we(l/c,-1,1))-Math.asin(we(h/c,-1,1)))),o=Math.max(s,Math.min(r,o))),this.labelRotation=o}afterCalculateLabelRotation(){$t(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){$t(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:i,title:s,grid:r}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const l=Dx(s,n.options.font);if(a?(t.width=this.maxWidth,t.height=wa(r)+l):(t.height=this.maxHeight,t.width=wa(r)+l),i.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:h}=this._getLabelSizes(),f=i.padding*2,p=Jn(this.labelRotation),m=Math.cos(p),v=Math.sin(p);if(a){const y=i.mirror?0:v*d.width+m*h.height;t.height=Math.min(this.maxHeight,t.height+y+f)}else{const y=i.mirror?0:m*d.width+v*h.height;t.width=Math.min(this.maxWidth,t.width+y+f)}this._calculatePadding(c,u,v,m)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,i,s){const{ticks:{align:r,padding:o},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,f=0;l?c?(h=s*t.width,f=i*n.height):(h=i*t.height,f=s*n.width):r==="start"?f=n.width:r==="end"?h=t.width:r!=="inner"&&(h=t.width/2,f=n.width/2),this.paddingLeft=Math.max((h-u+o)*this.width/(this.width-u),0),this.paddingRight=Math.max((f-d+o)*this.width/(this.width-d),0)}else{let u=n.height/2,d=t.height/2;r==="start"?(u=0,d=t.height):r==="end"&&(u=n.height,d=0),this.paddingTop=u+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(){$t(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,i;for(n=0,i=t.length;n({width:o[P]||0,height:a[P]||0});return{first:M(0),last:M(n-1),widest:M(S),highest:M(C),widths:o,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return UA(this._alignToPixels?rr(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&&ta*s?a/i:l/s:l*s0}_computeGridLineItems(t){const n=this.axis,i=this.chart,s=this.options,{grid:r,position:o,border:a}=s,l=r.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),h=wa(r),f=[],p=a.setContext(this.getContext()),m=p.display?p.width:0,v=m/2,y=function(R){return rr(i,R,m)};let g,x,_,w,S,C,M,P,T,A,E,z;if(o==="top")g=y(this.bottom),C=this.bottom-h,P=g-v,A=y(t.top)+v,z=t.bottom;else if(o==="bottom")g=y(this.top),A=t.top,z=y(t.bottom)-v,C=g+v,P=this.top+h;else if(o==="left")g=y(this.right),S=this.right-h,M=g-v,T=y(t.left)+v,E=t.right;else if(o==="right")g=y(this.left),T=t.left,E=y(t.right)-v,S=g+v,M=this.left+h;else if(n==="x"){if(o==="center")g=y((t.top+t.bottom)/2+.5);else if(gt(o)){const R=Object.keys(o)[0],B=o[R];g=y(this.chart.scales[R].getPixelForValue(B))}A=t.top,z=t.bottom,C=g+v,P=C+h}else if(n==="y"){if(o==="center")g=y((t.left+t.right)/2);else if(gt(o)){const R=Object.keys(o)[0],B=o[R];g=y(this.chart.scales[R].getPixelForValue(B))}S=g-v,M=S-h,T=t.left,E=t.right}const N=at(s.ticks.maxTicksLimit,d),L=Math.max(1,Math.ceil(d/N));for(x=0;x0&&(U-=Z/2);break}V={left:U,top:O,width:Z+W.width,height:et+W.height,color:L.backdropColor}}v.push({label:_,font:P,textOffset:E,options:{rotation:m,color:B,strokeColor:D,strokeWidth:$,textAlign:F,textBaseline:z,translation:[w,S],backdrop:V}})}return v}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Jn(this.labelRotation))return t==="top"?"left":"right";let s="center";return n.align==="start"?s="left":n.align==="end"?s="right":n.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:i,mirror:s,padding:r}}=this.options,o=this._getLabelSizes(),a=t+r,l=o.widest.width;let c,u;return n==="left"?s?(u=this.right+r,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?s?(u=this.left+r,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_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:i,top:s,width:r,height:o}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(i,s,r,o),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const s=this.ticks.findIndex(r=>r.value===t);return s>=0?n.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const n=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let r,o;const a=(l,c,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(n.display)for(r=0,o=s.length;r{this.draw(r)}}]:[{z:i,draw:r=>{this.drawBackground(),this.drawGrid(r),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:n,draw:r=>{this.drawLabels(r)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let r,o;for(r=0,o=n.length;r{const i=n.split("."),s=i.pop(),r=[e].concat(i).join("."),o=t[n].split("."),a=o.pop(),l=o.join(".");ne.route(r,s,l,a)})}function gL(e){return"id"in e&&"defaults"in e}let yL=class{constructor(){this.controllers=new nu(Zs,"datasets",!0),this.elements=new nu(os,"elements"),this.plugins=new nu(Object,"plugins"),this.scales=new nu(pc,"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,i){[...n].forEach(s=>{const r=i||this._getRegistryForType(s);i||r.isForType(s)||r===this.plugins&&s.id?this._exec(t,r,s):Et(s,o=>{const a=i||this._getRegistryForType(o);this._exec(t,a,o)})})}_exec(t,n,i){const s=ay(t);$t(i["before"+s],[],i),n[t](i),$t(i["after"+s],[],i)}_getRegistryForType(t){for(let n=0;nr.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(s(n,i),t,"stop"),this._notify(s(i,n),t,"start")}};function xL(e){const t={},n=[],i=Object.keys(hi.plugins.items);for(let r=0;r1&&Ex(e[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function Ax(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function CL(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(i=>i.xAxisID===e||i.yAxisID===e);if(n.length)return Ax(e,"x",n[0])||Ax(e,"y",n[0])}return{}}function PL(e,t){const n=Fr[e.type]||{scales:{}},i=t.scales||{},s=wm(e.type,t),r=Object.create(null);return Object.keys(i).forEach(o=>{const a=i[o];if(!gt(a))return console.error(`Invalid scale configuration for scale: ${o}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const l=km(o,a,CL(o,e),ne.scales[a.type]),c=SL(l,s),u=n.scales||{};r[o]=ul(Object.create(null),[{axis:l},a,u[l],u[c]])}),e.data.datasets.forEach(o=>{const a=o.type||e.type,l=o.indexAxis||wm(a,t),u=(Fr[a]||{}).scales||{};Object.keys(u).forEach(d=>{const h=kL(d,l),f=o[h+"AxisID"]||h;r[f]=r[f]||Object.create(null),ul(r[f],[{axis:h},i[f],u[d]])})}),Object.keys(r).forEach(o=>{const a=r[o];ul(a,[ne.scales[a.type],ne.scale])}),r}function pM(e){const t=e.options||(e.options={});t.plugins=at(t.plugins,{}),t.scales=PL(e,t)}function mM(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function TL(e){return e=e||{},e.data=mM(e.data),pM(e),e}const Ox=new Map,gM=new Set;function iu(e,t){let n=Ox.get(e);return n||(n=t(),Ox.set(e,n),gM.add(n)),n}const ka=(e,t,n)=>{const i=zs(t,n);i!==void 0&&e.add(i)};let DL=class{constructor(t){this._config=TL(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=mM(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(),pM(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return iu(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return iu(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return iu(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,i=this.type;return iu(`${i}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const i=this._scopeCache;let s=i.get(t);return(!s||n)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,n,i){const{options:s,type:r}=this,o=this._cachedScopes(t,i),a=o.get(n);if(a)return a;const l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(d=>ka(l,t,d))),u.forEach(d=>ka(l,s,d)),u.forEach(d=>ka(l,Fr[r]||{},d)),u.forEach(d=>ka(l,ne,d)),u.forEach(d=>ka(l,bm,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),gM.has(n)&&o.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,Fr[n]||{},ne.datasets[n]||{},{type:n},ne,bm]}resolveNamedOptions(t,n,i,s=[""]){const r={$shared:!0},{resolver:o,subPrefixes:a}=Lx(this._resolverCache,t,s);let l=o;if(AL(o,n)){r.$shared=!1,i=Ws(i)?i():i;const c=this.createResolver(t,i,a);l=Ho(o,i,c)}for(const c of n)r[c]=l[c];return r}createResolver(t,n,i=[""],s){const{resolver:r}=Lx(this._resolverCache,t,i);return gt(n)?Ho(r,n,void 0,s):r}};function Lx(e,t,n){let i=e.get(t);i||(i=new Map,e.set(t,i));const s=n.join();let r=i.get(s);return r||(r={resolver:fy(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},i.set(s,r)),r}const EL=e=>gt(e)&&Object.getOwnPropertyNames(e).some(t=>Ws(e[t]));function AL(e,t){const{isScriptable:n,isIndexable:i}=XS(e);for(const s of t){const r=n(s),o=i(s),a=(o||r)&&e[s];if(r&&(Ws(a)||EL(a))||o&&Ut(a))return!0}return!1}var OL="4.4.2";const LL=["top","bottom","left","right","chartArea"];function Rx(e,t){return e==="top"||e==="bottom"||LL.indexOf(e)===-1&&t==="x"}function Nx(e,t){return function(n,i){return n[e]===i[e]?n[t]-i[t]:n[e]-i[e]}}function jx(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),$t(n&&n.onComplete,[e],t)}function RL(e){const t=e.chart,n=t.options.animation;$t(n&&n.onProgress,[e],t)}function yM(e){return gy()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Zu={},$x=e=>{const t=yM(e);return Object.values(Zu).filter(n=>n.canvas===t).pop()};function NL(e,t,n){const i=Object.keys(e);for(const s of i){const r=+s;if(r>=t){const o=e[s];delete e[s],(n>0||r>t)&&(e[r+n]=o)}}}function jL(e,t,n,i){return!n||e.type==="mouseout"?null:i?t:e}function su(e,t,n){return e.options.clip?e[n]:t[n]}function $L(e,t){const{xScale:n,yScale:i}=e;return n&&i?{left:su(n,t,"left"),right:su(n,t,"right"),top:su(i,t,"top"),bottom:su(i,t,"bottom")}:t}var fs;let by=(fs=class{static register(...t){hi.add(...t),Ix()}static unregister(...t){hi.remove(...t),Ix()}constructor(t,n){const i=this.config=new DL(n),s=yM(t),r=$x(s);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||tL(s)),this.platform.updateConfig(i);const a=this.platform.acquireContext(s,o.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=LA(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,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 vL,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=GA(d=>this.update(d),o.resizeDelay||0),this._dataChanges=[],Zu[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Ai.listen(this,"complete",jx),Ai.listen(this,"progress",RL),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:i,height:s,_aspectRatio:r}=this;return bt(t)?n&&r?r:s?i/s: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 hi}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():rx(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return nx(this.canvas,this.ctx),this}stop(){return Ai.stop(this),this}resize(t,n){Ai.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const i=this.options,s=this.canvas,r=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,t,n,r),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,rx(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),$t(i.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Et(n,(i,s)=>{i.id=s})}buildOrUpdateScales(){const t=this.options,n=t.scales,i=this.scales,s=Object.keys(i).reduce((o,a)=>(o[a]=!1,o),{});let r=[];n&&(r=r.concat(Object.keys(n).map(o=>{const a=n[o],l=km(o,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),Et(r,o=>{const a=o.options,l=a.id,c=km(l,a),u=at(a.type,o.dtype);(a.position===void 0||Rx(a.position,c)!==Rx(o.dposition))&&(a.position=o.dposition),s[l]=!0;let d=null;if(l in i&&i[l].type===u)d=i[l];else{const h=hi.getScale(u);d=new h({id:l,type:u,ctx:this.ctx,chart:this}),i[d.id]=d}d.init(a,t)}),Et(s,(o,a)=>{o||delete i[a]}),Et(i,o=>{Fe.configure(this,o,o.options),Fe.addBox(this,o)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,i=t.length;if(t.sort((s,r)=>s.index-r.index),i>n){for(let s=n;sn.length&&delete this._stacks,t.forEach((i,s)=>{n.filter(r=>r===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=n.length;i{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const i=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let c=0,u=this.data.datasets.length;c{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Nx("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Et(this.scales,t=>{Fe.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Xv(n,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:r}of n){const o=i==="_removeElements"?-r:r;NL(t,s,o)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,i=r=>new Set(t.filter(o=>o[0]===r).map((o,a)=>a+","+o.splice(1).join(","))),s=i(0);for(let r=1;rr.split(",")).map(r=>({method:r[1],start:+r[2],count:+r[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Fe.update(this,this.width,this.height,t);const n=this.chartArea,i=n.width<=0||n.height<=0;this._layers=[],Et(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,r)=>{s._idx=r}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,i=this.data.datasets.length;n=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,i=t._clip,s=!i.disabled,r=$L(t,this.chartArea),o={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(s&&Ch(n,{left:i.left===!1?0:r.left-i.left,right:i.right===!1?this.width:r.right+i.right,top:i.top===!1?0:r.top-i.top,bottom:i.bottom===!1?this.height:r.bottom+i.bottom}),t.controller.draw(),s&&Ph(n),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return Wi(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,i,s){const r=L2.modes[n];return typeof r=="function"?r(this,t,i,s):[]}getDatasetMeta(t){const n=this.data.datasets[t],i=this._metasets;let s=i.filter(r=>r&&r._dataset===n).pop();return s||(s={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},i.push(s)),s}getContext(){return this.$context||(this.$context=Qs(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!n.hidden}setDatasetVisibility(t,n){const i=this.getDatasetMeta(t);i.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,i){const s=i?"show":"hide",r=this.getDatasetMeta(t),o=r.controller._resolveAnimations(void 0,s);zl(n)?(r.data[n].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(r,{visible:i}),this.update(a=>a.datasetIndex===t?s: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(),Ai.remove(this),t=0,n=this.data.datasets.length;t{n.addEventListener(this,r,o),t[r]=o},s=(r,o,a)=>{r.offsetX=o,r.offsetY=a,this._eventHandler(r)};Et(this.options.events,r=>i(r,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,i=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},r=(l,c)=>{this.canvas&&this.resize(l,c)};let o;const a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",r),i("detach",o)};o=()=>{this.attached=!1,s("resize",r),this._stop(),this._resize(0,0),i("attach",a)},n.isAttached(this.canvas)?a():o()}unbindEvents(){Et(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Et(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,i){const s=i?"set":"remove";let r,o,a,l;for(n==="dataset"&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=t.length;a{const a=this.getDatasetMeta(r);if(!a)throw new Error("No dataset found at index "+r);return{datasetIndex:r,element:a.data[o],index:o}});!Ld(i,n)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,n))}notifyPlugins(t,n,i){return this._plugins.notify(this,t,n,i)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,i){const s=this.options.hover,r=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),o=r(n,t),a=i?t:r(t,n);o.length&&this.updateHoverStyle(o,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,n){const i={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},s=o=>(o.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const r=this._handleEvent(t,n,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(r||i.changed)&&this.render(),this}_handleEvent(t,n,i){const{_active:s=[],options:r}=this,o=n,a=this._getActiveElements(t,s,i,o),l=FA(t),c=jL(t,this._lastEvent,i,l);i&&(this._lastEvent=null,$t(r.onHover,[t,a,this],this),l&&$t(r.onClick,[t,a,this],this));const u=!Ld(a,s);return(u||n)&&(this._active=a,this._updateHoverStyles(a,s,n)),this._lastEvent=c,u}_getActiveElements(t,n,i,s){if(t.type==="mouseout")return[];if(!i)return n;const r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,s)}},K(fs,"defaults",ne),K(fs,"instances",Zu),K(fs,"overrides",Fr),K(fs,"registry",hi),K(fs,"version",OL),K(fs,"getChart",$x),fs);function Ix(){return Et(by.instances,e=>e._plugins.invalidate())}function IL(e,t,n){const{startAngle:i,pixelMargin:s,x:r,y:o,outerRadius:a,innerRadius:l}=t;let c=s/a;e.beginPath(),e.arc(r,o,a,i-c,n+c),l>s?(c=s/l,e.arc(r,o,l,n+c,i-c,!0)):e.arc(r,o,s,n+ue,i-ue),e.closePath(),e.clip()}function FL(e){return hy(e,["outerStart","outerEnd","innerStart","innerEnd"])}function BL(e,t,n,i){const s=FL(e.options.borderRadius),r=(n-t)/2,o=Math.min(r,i*t/2),a=l=>{const c=(n-Math.min(r,l))*i/2;return we(l,0,Math.min(r,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:we(s.innerStart,0,o),innerEnd:we(s.innerEnd,0,o)}}function Zr(e,t,n,i){return{x:n+e*Math.cos(t),y:i+e*Math.sin(t)}}function Fd(e,t,n,i,s,r){const{x:o,y:a,startAngle:l,pixelMargin:c,innerRadius:u}=t,d=Math.max(t.outerRadius+i+n-c,0),h=u>0?u+i+n+c:0;let f=0;const p=s-l;if(i){const L=u>0?u-i:0,R=d>0?d-i:0,B=(L+R)/2,D=B!==0?p*B/(B+i):p;f=(p-D)/2}const m=Math.max(.001,p*d-n/Kt)/d,v=(p-m)/2,y=l+v+f,g=s-v-f,{outerStart:x,outerEnd:_,innerStart:w,innerEnd:S}=BL(t,h,d,g-y),C=d-x,M=d-_,P=y+x/C,T=g-_/M,A=h+w,E=h+S,z=y+w/A,N=g-S/E;if(e.beginPath(),r){const L=(P+T)/2;if(e.arc(o,a,d,P,L),e.arc(o,a,d,L,T),_>0){const $=Zr(M,T,o,a);e.arc($.x,$.y,_,T,g+ue)}const R=Zr(E,g,o,a);if(e.lineTo(R.x,R.y),S>0){const $=Zr(E,N,o,a);e.arc($.x,$.y,S,g+ue,N+Math.PI)}const B=(g-S/h+(y+w/h))/2;if(e.arc(o,a,h,g-S/h,B,!0),e.arc(o,a,h,B,y+w/h,!0),w>0){const $=Zr(A,z,o,a);e.arc($.x,$.y,w,z+Math.PI,y-ue)}const D=Zr(C,y,o,a);if(e.lineTo(D.x,D.y),x>0){const $=Zr(C,P,o,a);e.arc($.x,$.y,x,y-ue,P)}}else{e.moveTo(o,a);const L=Math.cos(P)*d+o,R=Math.sin(P)*d+a;e.lineTo(L,R);const B=Math.cos(T)*d+o,D=Math.sin(T)*d+a;e.lineTo(B,D)}e.closePath()}function VL(e,t,n,i,s){const{fullCircles:r,startAngle:o,circumference:a}=t;let l=t.endAngle;if(r){Fd(e,t,n,i,l,s);for(let c=0;c=Xt||Wl(o,l,c),v=Vi(a,u+f,d+f);return m&&v}getCenterPoint(n){const{x:i,y:s,startAngle:r,endAngle:o,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:c,spacing:u}=this.options,d=(r+o)/2,h=(a+l+u+c)/2;return{x:i+Math.cos(d)*h,y:s+Math.sin(d)*h}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:i,circumference:s}=this,r=(i.offset||0)/4,o=(i.spacing||0)/2,a=i.circular;if(this.pixelMargin=i.borderAlign==="inner"?.33:0,this.fullCircles=s>Xt?Math.floor(s/Xt):0,s===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const l=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(l)*r,Math.sin(l)*r);const c=1-Math.sin(Math.min(Kt,s||0)),u=r*c;n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,VL(n,this,u,o,a),zL(n,this,u,o,a),n.restore()}},K(io,"id","arc"),K(io,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),K(io,"defaultRoutes",{backgroundColor:"backgroundColor"}),K(io,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"}),io);function xM(e,t,n=t){e.lineCap=at(n.borderCapStyle,t.borderCapStyle),e.setLineDash(at(n.borderDash,t.borderDash)),e.lineDashOffset=at(n.borderDashOffset,t.borderDashOffset),e.lineJoin=at(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=at(n.borderWidth,t.borderWidth),e.strokeStyle=at(n.borderColor,t.borderColor)}function WL(e,t,n){e.lineTo(n.x,n.y)}function HL(e){return e.stepped?aO:e.tension||e.cubicInterpolationMode==="monotone"?lO:WL}function bM(e,t,n={}){const i=e.length,{start:s=0,end:r=i-1}=n,{start:o,end:a}=t,l=Math.max(s,o),c=Math.min(r,a),u=sa&&r>a;return{count:i,start:l,loop:t.loop,ilen:c(o+(c?a-_:_))%r,x=()=>{m!==v&&(e.lineTo(u,v),e.lineTo(u,m),e.lineTo(u,y))};for(l&&(f=s[g(0)],e.moveTo(f.x,f.y)),h=0;h<=a;++h){if(f=s[g(h)],f.skip)continue;const _=f.x,w=f.y,S=_|0;S===p?(wv&&(v=w),u=(d*u+_)/++d):(x(),e.lineTo(_,w),p=S,d=0,m=v=w),y=w}x()}function Sm(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?YL:UL}function XL(e){return e.stepped?BO:e.tension||e.cubicInterpolationMode==="monotone"?VO:pr}function KL(e,t,n,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,n,i)&&s.closePath()),xM(e,t.options),e.stroke(s)}function GL(e,t,n,i){const{segments:s,options:r}=t,o=Sm(t);for(const a of s)xM(e,r,a.style),e.beginPath(),o(e,t,a,{start:n,end:n+i-1})&&e.closePath(),e.stroke()}const qL=typeof Path2D=="function";function QL(e,t,n,i){qL&&!t.options.segment?KL(e,t,n,i):GL(e,t,n,i)}var so;let Dh=(so=class extends os{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 i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;OO(this._points,i,t,s,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=XO(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,i=t.length;return i&&n[t[i-1].end]}interpolate(t,n){const i=this.options,s=t[n],r=this.points,o=iM(this,{property:n,start:s,end:s});if(!o.length)return;const a=[],l=XL(i);let c,u;for(c=0,u=o.length;ct!=="borderDash"&&t!=="fill"}),so);function Fx(e,t,n,i){const s=e.options,{[n]:r}=e.getProps([n],i);return Math.abs(t-r)e.replace("rgb(","rgba(").replace(")",", 0.5)"));function SM(e){return Mm[e%Mm.length]}function MM(e){return Bx[e%Bx.length]}function sR(e,t){return e.borderColor=SM(t),e.backgroundColor=MM(t),++t}function rR(e,t){return e.backgroundColor=e.data.map(()=>SM(t++)),t}function oR(e,t){return e.backgroundColor=e.data.map(()=>MM(t++)),t}function aR(e){let t=0;return(n,i)=>{const s=e.getDatasetMeta(i).controller;s instanceof vy?t=rR(n,t):s instanceof aM?t=oR(n,t):s&&(t=sR(n,t))}}function Vx(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function lR(e){return e&&(e.borderColor||e.backgroundColor)}var cR={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:i},options:s}=e.config,{elements:r}=s;if(!n.forceOverride&&(Vx(i)||lR(s)||r&&Vx(r)))return;const o=aR(e);i.forEach(o)}};function uR(e,t,n,i,s){const r=s.samples||i;if(r>=n)return e.slice(t,t+n);const o=[],a=(n-2)/(r-2);let l=0;const c=t+n-1;let u=t,d,h,f,p,m;for(o[l++]=e[u],d=0;df&&(f=p,h=e[g],m=g);o[l++]=h,u=m}return o[l++]=e[c],o}function dR(e,t,n,i){let s=0,r=0,o,a,l,c,u,d,h,f,p,m;const v=[],y=t+n-1,g=e[t].x,_=e[y].x-g;for(o=t;om&&(m=c,h=o),s=(r*s+a.x)/++r;else{const S=o-1;if(!bt(d)&&!bt(h)){const C=Math.min(d,h),M=Math.max(d,h);C!==f&&C!==S&&v.push({...e[C],x:s}),M!==f&&M!==S&&v.push({...e[M],x:s})}o>0&&S!==f&&v.push(e[S]),v.push(a),u=w,r=0,p=m=c,d=h=f=o}}return v}function CM(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function zx(e){e.data.datasets.forEach(t=>{CM(t)})}function hR(e,t){const n=t.length;let i=0,s;const{iScale:r}=e,{min:o,max:a,minDefined:l,maxDefined:c}=r.getUserBounds();return l&&(i=we(zi(t,r.axis,o).lo,0,n-1)),c?s=we(zi(t,r.axis,a).hi+1,i,n)-i:s=n-i,{start:i,count:s}}var fR={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){zx(e);return}const i=e.width;e.data.datasets.forEach((s,r)=>{const{_data:o,indexAxis:a}=s,l=e.getDatasetMeta(r),c=o||s.data;if(Ht([a,e.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const u=e.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||e.options.parsing)return;let{start:d,count:h}=hR(l,c);const f=n.threshold||4*i;if(h<=f){CM(s);return}bt(o)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(m){this._data=m}}));let p;switch(n.algorithm){case"lttb":p=uR(c,d,h,i,n);break;case"min-max":p=dR(c,d,h,i);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}s._decimated=p})},destroy(e){zx(e)}};function pR(e,t,n){const i=e.segments,s=e.points,r=t.points,o=[];for(const a of i){let{start:l,end:c}=a;c=_y(l,c,s);const u=Cm(n,s[l],s[c],a.loop);if(!t.segments){o.push({source:a,target:u,start:s[l],end:s[c]});continue}const d=iM(t,u);for(const h of d){const f=Cm(n,r[h.start],r[h.end],h.loop),p=nM(a,s,f);for(const m of p)o.push({source:m,target:h,start:{[n]:Wx(u,f,"start",Math.max)},end:{[n]:Wx(u,f,"end",Math.min)}})}}return o}function Cm(e,t,n,i){if(i)return;let s=t[e],r=n[e];return e==="angle"&&(s=yn(s),r=yn(r)),{property:e,start:s,end:r}}function mR(e,t){const{x:n=null,y:i=null}=e||{},s=t.points,r=[];return t.segments.forEach(({start:o,end:a})=>{a=_y(o,a,s);const l=s[o],c=s[a];i!==null?(r.push({x:l.x,y:i}),r.push({x:c.x,y:i})):n!==null&&(r.push({x:n,y:l.y}),r.push({x:n,y:c.y}))}),r}function _y(e,t,n){for(;t>e;t--){const i=n[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function Wx(e,t,n,i){return e&&t?i(e[n],t[n]):e?e[n]:t?t[n]:0}function PM(e,t){let n=[],i=!1;return Ut(e)?(i=!0,n=e):n=mR(e,t),n.length?new Dh({points:n,options:{tension:0},_loop:i,_fullLoop:i}):null}function Hx(e){return e&&e.fill!==!1}function gR(e,t,n){let s=e[t].fill;const r=[t];let o;if(!n)return s;for(;s!==!1&&r.indexOf(s)===-1;){if(!oe(s))return s;if(o=e[s],!o)return!1;if(o.visible)return s;r.push(s),s=o.fill}return!1}function yR(e,t,n){const i=_R(e);if(gt(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return oe(s)&&Math.floor(s)===s?vR(i[0],t,s,n):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function vR(e,t,n,i){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=i?!1:n}function xR(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:gt(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function bR(e,t,n){let i;return e==="start"?i=n:e==="end"?i=t.options.reverse?t.min:t.max:gt(e)?i=e.value:i=t.getBaseValue(),i}function _R(e){const t=e.options,n=t.fill;let i=at(n&&n.target,n);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function wR(e){const{scale:t,index:n,line:i}=e,s=[],r=i.segments,o=i.points,a=kR(t,n);a.push(PM({x:null,y:t.bottom},i));for(let l=0;l=0;--o){const a=s[o].$filler;a&&(a.line.updateControlPoints(r,a.axis),i&&a.fill&&Hf(e.ctx,a,r))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const i=e.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const r=i[s].$filler;Hx(r)&&Hf(e.ctx,r,e.chartArea)}},beforeDatasetDraw(e,t,n){const i=t.meta.$filler;!Hx(i)||n.drawTime!=="beforeDatasetDraw"||Hf(e.ctx,i,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Kx=(e,t)=>{let{boxHeight:n=t,boxWidth:i=t}=e;return e.usePointStyle&&(n=Math.min(n,t),i=e.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:n,itemHeight:Math.max(t,n)}},RR=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;let Gx=class extends os{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,i){this.maxWidth=t,this.maxHeight=n,this._margins=i,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=$t(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(i=>t.filter(i,this.chart.data))),t.sort&&(n=n.sort((i,s)=>t.sort(i,s,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 i=t.labels,s=ge(i.font),r=s.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Kx(i,r);let c,u;n.font=s.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(o,r,a,l)+10):(u=this.maxHeight,c=this._fitCols(o,s,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,n,i,s){const{ctx:r,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=s+a;let d=t;r.textAlign="left",r.textBaseline="middle";let h=-1,f=-u;return this.legendItems.forEach((p,m)=>{const v=i+n/2+r.measureText(p.text).width;(m===0||c[c.length-1]+v+2*a>o)&&(d+=u,c[c.length-(m>0?0:1)]=0,f+=u,h++),l[m]={left:0,top:f,row:h,width:v,height:s},c[c.length-1]+=v+a}),d}_fitCols(t,n,i,s){const{ctx:r,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=o-t;let d=a,h=0,f=0,p=0,m=0;return this.legendItems.forEach((v,y)=>{const{itemWidth:g,itemHeight:x}=NR(i,n,r,v,s);y>0&&f+x+2*a>u&&(d+=h+a,c.push({width:h,height:f}),p+=h+a,m++,h=f=0),l[y]={left:p,top:f,col:m,width:g,height:x},h=Math.max(h,g),f+=x+a}),d+=h,c.push({width:h,height:f}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:i,labels:{padding:s},rtl:r}}=this,o=Oo(r,this.left,this.width);if(this.isHorizontal()){let a=0,l=Ne(i,this.left+s,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=Ne(i,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+t+s,c.left=o.leftForLtr(o.x(l),c.width),l+=c.width+s}else{let a=0,l=Ne(i,this.top+t+s,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=Ne(i,this.top+t+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=o.leftForLtr(o.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Ch(t,this),this._draw(),Ph(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:i,ctx:s}=this,{align:r,labels:o}=t,a=ne.color,l=Oo(t.rtl,this.left,this.width),c=ge(o.font),{padding:u}=o,d=c.size,h=d/2;let f;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:p,boxHeight:m,itemHeight:v}=Kx(o,d),y=function(S,C,M){if(isNaN(p)||p<=0||isNaN(m)||m<0)return;s.save();const P=at(M.lineWidth,1);if(s.fillStyle=at(M.fillStyle,a),s.lineCap=at(M.lineCap,"butt"),s.lineDashOffset=at(M.lineDashOffset,0),s.lineJoin=at(M.lineJoin,"miter"),s.lineWidth=P,s.strokeStyle=at(M.strokeStyle,a),s.setLineDash(at(M.lineDash,[])),o.usePointStyle){const T={radius:m*Math.SQRT2/2,pointStyle:M.pointStyle,rotation:M.rotation,borderWidth:P},A=l.xPlus(S,p/2),E=C+h;US(s,T,A,E,o.pointStyleWidth&&p)}else{const T=C+Math.max((d-m)/2,0),A=l.leftForLtr(S,p),E=Cr(M.borderRadius);s.beginPath(),Object.values(E).some(z=>z!==0)?Hl(s,{x:A,y:T,w:p,h:m,radius:E}):s.rect(A,T,p,m),s.fill(),P!==0&&s.stroke()}s.restore()},g=function(S,C,M){Br(s,M.text,S,C+v/2,c,{strikethrough:M.hidden,textAlign:l.textAlign(M.textAlign)})},x=this.isHorizontal(),_=this._computeTitleHeight();x?f={x:Ne(r,this.left+u,this.right-i[0]),y:this.top+u+_,line:0}:f={x:this.left+u,y:Ne(r,this.top+_+u,this.bottom-n[0].height),line:0},JS(this.ctx,t.textDirection);const w=v+u;this.legendItems.forEach((S,C)=>{s.strokeStyle=S.fontColor,s.fillStyle=S.fontColor;const M=s.measureText(S.text).width,P=l.textAlign(S.textAlign||(S.textAlign=o.textAlign)),T=p+h+M;let A=f.x,E=f.y;l.setWidth(this.width),x?C>0&&A+T+u>this.right&&(E=f.y+=w,f.line++,A=f.x=Ne(r,this.left+u,this.right-i[f.line])):C>0&&E+w>this.bottom&&(A=f.x=A+n[f.line].width+u,f.line++,E=f.y=Ne(r,this.top+_+u,this.bottom-n[f.line].height));const z=l.x(A);if(y(z,E,S),A=qA(P,A+p+h,x?A+T:this.right,t.rtl),g(l.x(A),E,S),x)f.x+=T+u;else if(typeof S.text!="string"){const N=c.lineHeight;f.y+=DM(S,N)+u}else f.y+=w}),tM(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,i=ge(n.font),s=Ae(n.padding);if(!n.display)return;const r=Oo(t.rtl,this.left,this.width),o=this.ctx,a=n.position,l=i.size/2,c=s.top+l;let u,d=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),u=this.top+c,d=Ne(t.align,d,this.right-h);else{const p=this.columnSizes.reduce((m,v)=>Math.max(m,v.height),0);u=c+Ne(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const f=Ne(a,d,d+h);o.textAlign=r.textAlign(uy(a)),o.textBaseline="middle",o.strokeStyle=n.color,o.fillStyle=n.color,o.font=i.string,Br(o,n.text,f,u,i)}_computeTitleHeight(){const t=this.options.title,n=ge(t.font),i=Ae(t.padding);return t.display?n.lineHeight+i.height:0}_getLegendItemAt(t,n){let i,s,r;if(Vi(t,this.left,this.right)&&Vi(n,this.top,this.bottom)){for(r=this.legendHitBoxes,i=0;ir.length>o.length?r:o)),t+n.size/2+i.measureText(s).width}function $R(e,t,n){let i=e;return typeof t.text!="string"&&(i=DM(t,n)),i}function DM(e,t){const n=e.text?e.text.length:0;return t*n}function IR(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var FR={id:"legend",_element:Gx,start(e,t,n){const i=e.legend=new Gx({ctx:e.ctx,options:n,chart:e});Fe.configure(e,i,n),Fe.addBox(e,i)},stop(e){Fe.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const i=e.legend;Fe.configure(e,i,n),i.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 i=t.datasetIndex,s=n.chart;s.isDatasetVisible(i)?(s.hide(i),t.hidden=!0):(s.show(i),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:i,textAlign:s,color:r,useBorderRadius:o,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),u=Ae(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:r,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:i||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:o&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};let wy=class extends os{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 i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const s=Ut(i.text)?i.text.length:1;this._padding=Ae(i.padding);const r=s*ge(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:i,bottom:s,right:r,options:o}=this,a=o.align;let l=0,c,u,d;return this.isHorizontal()?(u=Ne(a,i,r),d=n+t,c=r-i):(o.position==="left"?(u=i+t,d=Ne(a,s,n),l=Kt*-.5):(u=r-t,d=Ne(a,n,s),l=Kt*.5),c=s-n),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const i=ge(n.font),r=i.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(r);Br(t,n.text,0,0,i,{color:n.color,maxWidth:l,rotation:c,textAlign:uy(n.align),textBaseline:"middle",translation:[o,a]})}};function BR(e,t){const n=new wy({ctx:e.ctx,options:t,chart:e});Fe.configure(e,n,t),Fe.addBox(e,n),e.titleBlock=n}var VR={id:"title",_element:wy,start(e,t,n){BR(e,n)},stop(e){const t=e.titleBlock;Fe.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const i=e.titleBlock;Fe.configure(e,i,n),i.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 ru=new WeakMap;var zR={id:"subtitle",start(e,t,n){const i=new wy({ctx:e.ctx,options:n,chart:e});Fe.configure(e,i,n),Fe.addBox(e,i),ru.set(e,i)},stop(e){Fe.removeBox(e,ru.get(e)),ru.delete(e)},beforeUpdate(e,t,n){const i=ru.get(e);Fe.configure(e,i,n),i.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const qa={average(e){if(!e.length)return!1;let t,n,i=new Set,s=0,r=0;for(t=0,n=e.length;ta+l)/i.size,y:s/r}},nearest(e,t){if(!e.length)return!1;let n=t.x,i=t.y,s=Number.POSITIVE_INFINITY,r,o,a;for(r=0,o=e.length;ra({chart:t,initial:n.initial,numSteps:o,currentStep:Math.min(i-n.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=BS.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const r=i.items;let o=r.length-1,a=!1,l;for(;o>=0;--o)l=r[o],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),a=!0):(r[o]=r[r.length-1],r.pop());a&&(s.draw(),this._notify(s,i,t,"progress")),r.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),n+=r.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let i=n.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,i)),i}listen(t,n,i){this._getAnims(t).listeners[n].push(i)}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((i,s)=>Math.max(i,s._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 i=n.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}};var Ai=new qO;const ux="transparent",QO={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const i=tx(e||ux),s=i.valid&&tx(t||ux);return s&&s.valid?s.mix(i,n).hexString():t},number(e,t,n){return e+(t-e)*n}};let ZO=class{constructor(t,n,i,s){const r=n[i];s=Ht([t.to,s,r,t.from]);const o=Ht([t.from,r,s]);this._active=!0,this._fn=t.fn||QO[t.type||typeof o],this._easing=fl[t.easing]||fl.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=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(t,n,i){if(this._active){this._notify(!1);const s=this._target[this._prop],r=i-this._start,o=this._duration-r;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=Ht([t.to,n,s,t.from]),this._from=Ht([t.from,s,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,i=this._duration,s=this._prop,r=this._from,o=this._loop,a=this._to;let l;if(this._active=r!==a&&(o||n1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(r,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,i)=>{t.push({res:n,rej:i})})}_notify(t){const n=t?"res":"rej",i=this._promises||[];for(let s=0;s{const r=t[s];if(!gt(r))return;const o={};for(const a of n)o[a]=r[a];(Ut(r.properties)&&r.properties||[s]).forEach(a=>{(a===s||!i.has(a))&&i.set(a,o)})})}_animateOptions(t,n){const i=n.options,s=t2(t,i);if(!s)return[];const r=this._createAnimations(s,i);return i.$shared&&JO(t.options.$animations,i).then(()=>{t.options=i},()=>{}),r}_createAnimations(t,n){const i=this._properties,s=[],r=t.$animations||(t.$animations={}),o=Object.keys(n),a=Date.now();let l;for(l=o.length-1;l>=0;--l){const c=o[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,n));continue}const u=n[c];let d=r[c];const h=i.get(c);if(d)if(h&&d.active()){d.update(h,u,a);continue}else d.cancel();if(!h||!h.duration){t[c]=u;continue}r[c]=d=new ZO(h,t,c,u),s.push(d)}return s}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const i=this._createAnimations(t,n);if(i.length)return Ai.add(this._chart,i),!0}};function JO(e,t){const n=[],i=Object.keys(t);for(let s=0;s0||!n&&r<0)return s.index}return null}function mx(e,t){const{chart:n,_cachedMeta:i}=e,s=n._stacks||(n._stacks={}),{iScale:r,vScale:o,index:a}=i,l=r.axis,c=o.axis,u=s2(r,o,i),d=t.length;let h;for(let f=0;fn[i].axis===t).shift()}function a2(e,t){return Qs(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function l2(e,t,n){return Qs(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function xa(e,t){const n=e.controller.index,i=e.vScale&&e.vScale.axis;if(i){t=t||e._parsed;for(const s of t){const r=s._stacks;if(!r||r[i]===void 0||r[i][n]===void 0)return;delete r[i][n],r[i]._visualValues!==void 0&&r[i]._visualValues[n]!==void 0&&delete r[i]._visualValues[n]}}}const $f=e=>e==="reset"||e==="none",gx=(e,t)=>t?e:Object.assign({},e),c2=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:rM(n,!0),values:null};var Na;let Zs=(Na=class{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=fx(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&&xa(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,i=this.getDataset(),s=(d,h,f,p)=>d==="x"?h:d==="r"?p:f,r=n.xAxisID=at(i.xAxisID,jf(t,"x")),o=n.yAxisID=at(i.yAxisID,jf(t,"y")),a=n.rAxisID=at(i.rAxisID,jf(t,"r")),l=n.indexAxis,c=n.iAxisID=s(l,r,o,a),u=n.vAxisID=s(l,o,r,a);n.xScale=this.getScaleForId(r),n.yScale=this.getScaleForId(o),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(u)}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&&Qv(this._data,this),t._stacked&&xa(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),i=this._data;if(gt(n))this._data=i2(n);else if(i!==n){if(i){Qv(i,this);const s=this._cachedMeta;xa(s),s._parsed=[]}n&&Object.isExtensible(n)&&KA(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,i=this.getDataset();let s=!1;this._dataCheck();const r=n._stacked;n._stacked=fx(n.vScale,n),n.stack!==i.stack&&(s=!0,xa(n),n.stack=i.stack),this._resyncElements(t),(s||r!==n._stacked)&&mx(this,n._parsed)}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:i,_data:s}=this,{iScale:r,_stacked:o}=i,a=r.axis;let l=t===0&&n===s.length?!0:i._sorted,c=t>0&&i._parsed[t-1],u,d,h;if(this._parsing===!1)i._parsed=s,i._sorted=!0,h=s;else{Ut(s[t])?h=this.parseArrayData(i,s,t,n):gt(s[t])?h=this.parseObjectData(i,s,t,n):h=this.parsePrimitiveData(i,s,t,n);const f=()=>d[a]===null||c&&d[a]m||d=0;--h)if(!p()){this.updateRangeFromParsed(c,t,f,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,i=[];let s,r,o;for(s=0,r=n.length;s=0&&tthis.getContext(i,s,n),m=c.resolveNamedOptions(h,f,p,d);return m.$shared&&(m.$shared=l,r[o]=Object.freeze(gx(m,l))),m}_resolveAnimations(t,n,i){const s=this.chart,r=this._cachedDataOpts,o=`animation-${n}`,a=r[o];if(a)return a;let l;if(s.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,n),h=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(h,this.getContext(t,i,n))}const c=new sM(s,l&&l.animations);return l&&l._cacheable&&(r[o]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||$f(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const i=this.resolveDataElementOptions(t,n),s=this._sharedOptions,r=this.getSharedOptions(i),o=this.includeOptions(n,r)||r!==s;return this.updateSharedOptions(r,n,i),{sharedOptions:r,includeOptions:o}}updateElement(t,n,i,s){$f(s)?Object.assign(t,i):this._resolveAnimations(n,s).update(t,i)}updateSharedOptions(t,n,i){t&&!$f(n)&&this._resolveAnimations(void 0,n).update(t,i)}_setStyle(t,n,i,s){t.active=s;const r=this.getStyle(n,s);this._resolveAnimations(n,i,s).update(t,{options:!s&&this.getSharedOptions(r)||r})}removeHoverStyle(t,n,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,n,i){this._setStyle(t,i,"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,i=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const s=i.length,r=n.length,o=Math.min(r,s);o&&this.parse(0,o),r>s?this._insertElements(s,r-s,t):r{for(c.length+=n,a=c.length-1;a>=o;a--)c[a]=c[a-n]};for(l(r),a=t;as-r))}return e._cache.$bar}function d2(e){const t=e.iScale,n=u2(t,e.type);let i=t._length,s,r,o,a;const l=()=>{o===32767||o===-32768||(Wl(a)&&(i=Math.min(i,Math.abs(o-a)||i)),a=o)};for(s=0,r=n.length;s0?s[e-1]:null,a=eMath.abs(a)&&(l=a,c=o),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:r,min:o,max:a}}function oM(e,t,n,i){return Ut(e)?p2(e,t,n,i):t[n.axis]=n.parse(e,i),t}function yx(e,t,n,i){const s=e.iScale,r=e.vScale,o=s.getLabels(),a=s===r,l=[];let c,u,d,h;for(c=n,u=n+i;c=n?1:-1)}function g2(e){let t,n,i,s,r;return e.horizontal?(t=e.base>e.x,n="left",i="right"):(t=e.basel.controller.options.grouped),r=i.options.stacked,o=[],a=l=>{const c=l.controller.getParsed(n),u=c&&c[l.vScale.axis];if(bt(u)||isNaN(u))return!0};for(const l of s)if(!(n!==void 0&&a(l))&&((r===!1||o.indexOf(l.stack)===-1||r===void 0&&l.stack===void 0)&&o.push(l.stack),l.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,n,i){const s=this._getStacks(t,i),r=n!==void 0?s.indexOf(n):-1;return r===-1?s.length-1:r}_getRuler(){const t=this.options,n=this._cachedMeta,i=n.iScale,s=[];let r,o;for(r=0,o=n.data.length;r=0;--i)n=Math.max(n,t[i].size(this.resolveDataElementOptions(i))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:r}=n,o=this.getParsed(t),a=s.getLabelForValue(o.x),l=r.getLabelForValue(o.y),c=o._custom;return{label:i[t]||"",value:"("+a+", "+l+(c?", "+c:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,i,s){const r=s==="reset",{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(n,s),u=o.axis,d=a.axis;for(let h=n;hHl(x,a,l,!0)?1:Math.max(_,_*n,w,w*n),p=(x,_,w)=>Hl(x,a,l,!0)?-1:Math.min(_,_*n,w,w*n),m=f(0,c,d),v=f(ue,u,h),y=p(Kt,c,d),g=p(Kt+ue,u,h);i=(m-y)/2,s=(v-g)/2,r=-(m+y)/2,o=-(v+g)/2}return{ratioX:i,ratioY:s,offsetX:r,offsetY:o}}var no;let vy=(no=class extends Zs{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 i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let r=l=>+i[l];if(gt(i[t])){const{key:l="value"}=this._parsing;r=c=>+zs(i[c],l)}let o,a;for(o=t,a=t+n;o0&&!isNaN(t)?Xt*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=fc(n._parsed[t],i.options.locale);return{label:s[t]||"",value:r}}getMaxBorderWidth(t){let n=0;const i=this.chart;let s,r,o,a,l;if(!t){for(s=0,r=i.data.datasets.length;st!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),K(no,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return n.labels.map((r,o)=>{const l=t.getDatasetMeta(0).controller.getStyle(o);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(o),index:o}})}return[]}},onClick(t,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}}}),no);var Ia;let k2=(Ia=class extends Zs{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:i,data:s=[],_dataset:r}=n,o=this.chart._animationsDisabled;let{start:a,count:l}=zS(n,s,o);this._drawStart=a,this._drawCount=l,WS(n)&&(a=0,l=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!r._decimated,i.points=s;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:c},t),this.updateElements(s,a,l,t)}updateElements(t,n,i,s){const r=s==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(n,s),h=o.axis,f=a.axis,{spanGaps:p,segment:m}=this.options,v=Wo(p)?p:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||r||s==="none",g=n+i,x=t.length;let _=n>0&&this.getParsed(n-1);for(let w=0;w=g){C.skip=!0;continue}const M=this.getParsed(w),P=bt(M[f]),T=C[h]=o.getPixelForValue(M[h],w),A=C[f]=r||P?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,M,l):M[f],w);C.skip=isNaN(T)||isNaN(A)||P,C.stop=w>0&&Math.abs(M[h]-_[h])>v,m&&(C.parsed=M,C.raw=c.data[w]),d&&(C.options=u||this.resolveDataElementOptions(w,S.active?"active":s)),y||this.updateElement(S,w,C,s),_=M}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,i=n.options&&n.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const r=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,r,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}},K(Ia,"id","line"),K(Ia,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),K(Ia,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}}),Ia);var Fa;let aM=(Fa=class extends Zs{constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=fc(n._parsed[t].r,i.options.locale);return{label:s[t]||"",value:r}}parseObjectData(t,n,i,s){return QS.bind(this)(t,n,i,s)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,s)=>{const r=this.getParsed(s).r;!isNaN(r)&&this.chart.getDataVisibility(s)&&(rn.max&&(n.max=r))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,i=t.options,s=Math.min(n.right-n.left,n.bottom-n.top),r=Math.max(s/2,0),o=Math.max(i.cutoutPercentage?r/100*i.cutoutPercentage:1,0),a=(r-o)/t.getVisibleDatasetCount();this.outerRadius=r-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,n,i,s){const r=s==="reset",o=this.chart,l=o.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,d=c.yCenter,h=c.getIndexAngle(0)-.5*Kt;let f=h,p;const m=360/this.countVisibleElements();for(p=0;p{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&n++}),n}_computeAngle(t,n,i){return this.chart.getDataVisibility(t)?Jn(this.resolveDataElementOptions(t,n).angle||i):0}},K(Fa,"id","polarArea"),K(Fa,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),K(Fa,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return n.labels.map((r,o)=>{const l=t.getDatasetMeta(0).controller.getStyle(o);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(o),index:o}})}return[]}},onClick(t,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}}),Fa);var Ru;let S2=(Ru=class extends vy{},K(Ru,"id","pie"),K(Ru,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"}),Ru);var Ba;let M2=(Ba=class extends Zs{getLabelAndValue(t){const n=this._cachedMeta.vScale,i=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(i[n.axis])}}parseObjectData(t,n,i,s){return QS.bind(this)(t,n,i,s)}update(t){const n=this._cachedMeta,i=n.dataset,s=n.data||[],r=n.iScale.getLabels();if(i.points=s,t!=="resize"){const o=this.resolveDatasetElementOptions(t);this.options.showLine||(o.borderWidth=0);const a={_loop:!0,_fullLoop:r.length===s.length,options:o};this.updateElement(i,void 0,a,t)}this.updateElements(s,0,s.length,t)}updateElements(t,n,i,s){const r=this._cachedMeta.rScale,o=s==="reset";for(let a=n;a0&&this.getParsed(n-1);for(let _=n;_0&&Math.abs(S[f]-x[f])>y,v&&(C.parsed=S,C.raw=c.data[_]),h&&(C.options=d||this.resolveDataElementOptions(_,w.active?"active":s)),g||this.updateElement(w,_,C,s),x=S}this.updateSharedOptions(d,s,u)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let a=0;for(let l=n.length-1;l>=0;--l)a=Math.max(a,n[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!n.length)return s;const r=n[0].size(this.resolveDataElementOptions(0)),o=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(s,r,o)/2}},K(Va,"id","scatter"),K(Va,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),K(Va,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}}),Va);var P2=Object.freeze({__proto__:null,BarController:b2,BubbleController:_2,DoughnutController:vy,LineController:k2,PieController:S2,PolarAreaController:aM,RadarController:M2,ScatterController:C2});function or(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class xy{constructor(t){K(this,"options");this.options=t||{}}static override(t){Object.assign(xy.prototype,t)}init(){}formats(){return or()}parse(){return or()}format(){return or()}add(){return or()}diff(){return or()}startOf(){return or()}endOf(){return or()}}var T2={_date:xy};function D2(e,t,n,i){const{controller:s,data:r,_sorted:o}=e,a=s._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&o&&r.length){const l=a._reversePixels?YA:zi;if(i){if(s._sharedOptions){const c=r[0],u=typeof c.getRange=="function"&&c.getRange(t);if(u){const d=l(r,t,n-u),h=l(r,t,n+u);return{lo:d.lo,hi:h.hi}}}}else return l(r,t,n)}return{lo:0,hi:r.length-1}}function pc(e,t,n,i,s){const r=e.getSortedVisibleDatasetMetas(),o=n[t];for(let a=0,l=r.length;a{l[o](t[n],s)&&(r.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,s))}),i&&!a?[]:r}var R2={evaluateInteractionItems:pc,modes:{index(e,t,n,i){const s=fr(t,e),r=n.axis||"x",o=n.includeInvisible||!1,a=n.intersect?Ff(e,s,r,i,o):Bf(e,s,r,!1,i,o),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(e,t,n,i){const s=fr(t,e),r=n.axis||"xy",o=n.includeInvisible||!1;let a=n.intersect?Ff(e,s,r,i,o):Bf(e,s,r,!1,i,o);if(a.length>0){const l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let u=0;un.pos===t)}function _x(e,t){return e.filter(n=>lM.indexOf(n.pos)===-1&&n.box.axis===t)}function _a(e,t){return e.sort((n,i)=>{const s=t?i:n,r=t?n:i;return s.weight===r.weight?s.index-r.index:s.weight-r.weight})}function L2(e){const t=[];let n,i,s,r,o,a;for(n=0,i=(e||[]).length;nc.box.fullSize),!0),i=_a(ba(t,"left"),!0),s=_a(ba(t,"right")),r=_a(ba(t,"top"),!0),o=_a(ba(t,"bottom")),a=_x(t,"x"),l=_x(t,"y");return{fullSize:n,leftAndTop:i.concat(r),rightAndBottom:s.concat(l).concat(o).concat(a),chartArea:ba(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:r.concat(o).concat(a)}}function wx(e,t,n,i){return Math.max(e[n],t[n])+Math.max(e[i],t[i])}function cM(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 I2(e,t,n,i){const{pos:s,box:r}=n,o=e.maxPadding;if(!gt(s)){n.size&&(e[s]-=n.size);const d=i[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?r.height:r.width),n.size=d.size/d.count,e[s]+=n.size}r.getPadding&&cM(o,r.getPadding());const a=Math.max(0,t.outerWidth-wx(o,e,"left","right")),l=Math.max(0,t.outerHeight-wx(o,e,"top","bottom")),c=a!==e.w,u=l!==e.h;return e.w=a,e.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function F2(e){const t=e.maxPadding;function n(i){const s=Math.max(t[i]-e[i],0);return e[i]+=s,s}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function B2(e,t){const n=t.maxPadding;function i(s){const r={left:0,top:0,right:0,bottom:0};return s.forEach(o=>{r[o]=Math.max(t[o],n[o])}),r}return i(e?["left","right"]:["top","bottom"])}function Ga(e,t,n,i){const s=[];let r,o,a,l,c,u;for(r=0,o=e.length,c=0;r{typeof m.beforeLayout=="function"&&m.beforeLayout()});const u=l.reduce((m,v)=>v.box.options&&v.box.options.display===!1?m:m+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:s,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/u,hBoxMaxHeight:o/2}),h=Object.assign({},s);cM(h,Ae(i));const f=Object.assign({maxPadding:h,w:r,h:o,x:s.left,y:s.top},s),p=j2(l.concat(c),d);Ga(a.fullSize,f,d,p),Ga(l,f,d,p),Ga(c,f,d,p)&&Ga(l,f,d,p),F2(f),kx(a.leftAndTop,f,d,p),f.x+=f.w,f.y+=f.h,kx(a.rightAndBottom,f,d,p),e.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},Et(a.chartArea,m=>{const v=m.box;Object.assign(v,e.chartArea),v.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};let uM=class{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,i){}removeEventListener(t,n,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,i,s){return n=Math.max(0,n||t.width),i=i||t.height,{width:n,height:Math.max(0,s?Math.floor(n/s):i)}}isAttached(t){return!0}updateConfig(t){}},V2=class extends uM{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}};const Zu="$chartjs",z2={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Sx=e=>e===null||e==="";function W2(e,t){const n=e.style,i=e.getAttribute("height"),s=e.getAttribute("width");if(e[Zu]={initial:{height:i,width:s,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",Sx(s)){const r=ox(e,"width");r!==void 0&&(e.width=r)}if(Sx(i))if(e.style.height==="")e.height=e.width/(t||2);else{const r=ox(e,"height");r!==void 0&&(e.height=r)}return e}const dM=FO?{passive:!0}:!1;function H2(e,t,n){e&&e.addEventListener(t,n,dM)}function U2(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,dM)}function Y2(e,t){const n=z2[e.type]||e.type,{x:i,y:s}=fr(e,t);return{type:n,chart:t,native:e,x:i!==void 0?i:null,y:s!==void 0?s:null}}function Id(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function X2(e,t,n){const i=e.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||Id(a.addedNodes,i),o=o&&!Id(a.removedNodes,i);o&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}function K2(e,t,n){const i=e.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||Id(a.removedNodes,i),o=o&&!Id(a.addedNodes,i);o&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}const Yl=new Map;let Mx=0;function hM(){const e=window.devicePixelRatio;e!==Mx&&(Mx=e,Yl.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function G2(e,t){Yl.size||window.addEventListener("resize",hM),Yl.set(e,t)}function q2(e){Yl.delete(e),Yl.size||window.removeEventListener("resize",hM)}function Q2(e,t,n){const i=e.canvas,s=i&&yy(i);if(!s)return;const r=VS((a,l)=>{const c=s.clientWidth;n(a,l),c{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||r(c,u)});return o.observe(s),G2(e,r),o}function Vf(e,t,n){n&&n.disconnect(),t==="resize"&&q2(e)}function Z2(e,t,n){const i=e.canvas,s=VS(r=>{e.ctx!==null&&n(Y2(r,e))},e);return H2(i,t,s),s}let J2=class extends uM{acquireContext(t,n){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(W2(t,n),i):null}releaseContext(t){const n=t.canvas;if(!n[Zu])return!1;const i=n[Zu].initial;["height","width"].forEach(r=>{const o=i[r];bt(o)?n.removeAttribute(r):n.setAttribute(r,o)});const s=i.style||{};return Object.keys(s).forEach(r=>{n.style[r]=s[r]}),n.width=n.width,delete n[Zu],!0}addEventListener(t,n,i){this.removeEventListener(t,n);const s=t.$proxies||(t.$proxies={}),o={attach:X2,detach:K2,resize:Q2}[n]||Z2;s[n]=o(t,n,i)}removeEventListener(t,n){const i=t.$proxies||(t.$proxies={}),s=i[n];if(!s)return;({attach:Vf,detach:Vf,resize:Vf}[n]||U2)(t,n,s),i[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,i,s){return IO(t,n,i,s)}isAttached(t){const n=yy(t);return!!(n&&n.isConnected)}};function tR(e){return!gy()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?V2:J2}var Lu;let os=(Lu=class{constructor(){K(this,"x");K(this,"y");K(this,"active",!1);K(this,"options");K(this,"$animations")}tooltipPosition(t){const{x:n,y:i}=this.getProps(["x","y"],t);return{x:n,y:i}}hasValue(){return Wo(this.x)&&Wo(this.y)}getProps(t,n){const i=this.$animations;if(!n||!i)return this;const s={};return t.forEach(r=>{s[r]=i[r]&&i[r].active()?i[r]._to:this[r]}),s}},K(Lu,"defaults",{}),K(Lu,"defaultRoutes"),Lu);function eR(e,t){const n=e.options.ticks,i=nR(e),s=Math.min(n.maxTicksLimit||i,i),r=n.major.enabled?sR(t):[],o=r.length,a=r[0],l=r[o-1],c=[];if(o>s)return rR(t,c,r,o/s),c;const u=iR(r,t,s);if(o>0){let d,h;const f=o>1?Math.round((l-a)/(o-1)):null;for(nu(t,c,u,bt(f)?0:a-f,a),d=0,h=o-1;ds)return l}return Math.max(s,1)}function sR(e){const t=[];let n,i;for(n=0,i=e.length;ne==="left"?"right":e==="right"?"left":e,Cx=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,Px=(e,t)=>Math.min(t||e,e);function Tx(e,t){const n=[],i=e.length/t,s=e.length;let r=0;for(;ro+a)))return l}function cR(e,t){Et(e,n=>{const i=n.gc,s=i.length/2;let r;if(s>t){for(r=0;ri?i:n,i=s&&n>i?n:i,{min:mn(n,mn(i,n)),max:mn(i,mn(n,i))}}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(){$t(this.options.beforeUpdate,[this])}update(t,n,i){const{beginAtZero:s,grace:r,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=gO(this,r,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a=r||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const u=this._getLabelSizes(),d=u.widest.width,h=u.highest.height,f=we(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/i:f/(i-1),d+6>a&&(a=f/(i-(t.offset?.5:1)),l=this.maxHeight-wa(t.grid)-n.padding-Dx(t.title,this.chart.options.font),c=Math.sqrt(d*d+h*h),o=ly(Math.min(Math.asin(we((u.highest.height+6)/a,-1,1)),Math.asin(we(l/c,-1,1))-Math.asin(we(h/c,-1,1)))),o=Math.max(s,Math.min(r,o))),this.labelRotation=o}afterCalculateLabelRotation(){$t(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){$t(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:i,title:s,grid:r}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const l=Dx(s,n.options.font);if(a?(t.width=this.maxWidth,t.height=wa(r)+l):(t.height=this.maxHeight,t.width=wa(r)+l),i.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:h}=this._getLabelSizes(),f=i.padding*2,p=Jn(this.labelRotation),m=Math.cos(p),v=Math.sin(p);if(a){const y=i.mirror?0:v*d.width+m*h.height;t.height=Math.min(this.maxHeight,t.height+y+f)}else{const y=i.mirror?0:m*d.width+v*h.height;t.width=Math.min(this.maxWidth,t.width+y+f)}this._calculatePadding(c,u,v,m)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,i,s){const{ticks:{align:r,padding:o},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,f=0;l?c?(h=s*t.width,f=i*n.height):(h=i*t.height,f=s*n.width):r==="start"?f=n.width:r==="end"?h=t.width:r!=="inner"&&(h=t.width/2,f=n.width/2),this.paddingLeft=Math.max((h-u+o)*this.width/(this.width-u),0),this.paddingRight=Math.max((f-d+o)*this.width/(this.width-d),0)}else{let u=n.height/2,d=t.height/2;r==="start"?(u=0,d=t.height):r==="end"&&(u=n.height,d=0),this.paddingTop=u+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(){$t(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,i;for(n=0,i=t.length;n({width:o[P]||0,height:a[P]||0});return{first:M(0),last:M(n-1),widest:M(S),highest:M(C),widths:o,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return UA(this._alignToPixels?rr(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&&ta*s?a/i:l/s:l*s0}_computeGridLineItems(t){const n=this.axis,i=this.chart,s=this.options,{grid:r,position:o,border:a}=s,l=r.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),h=wa(r),f=[],p=a.setContext(this.getContext()),m=p.display?p.width:0,v=m/2,y=function(L){return rr(i,L,m)};let g,x,_,w,S,C,M,P,T,A,E,z;if(o==="top")g=y(this.bottom),C=this.bottom-h,P=g-v,A=y(t.top)+v,z=t.bottom;else if(o==="bottom")g=y(this.top),A=t.top,z=y(t.bottom)-v,C=g+v,P=this.top+h;else if(o==="left")g=y(this.right),S=this.right-h,M=g-v,T=y(t.left)+v,E=t.right;else if(o==="right")g=y(this.left),T=t.left,E=y(t.right)-v,S=g+v,M=this.left+h;else if(n==="x"){if(o==="center")g=y((t.top+t.bottom)/2+.5);else if(gt(o)){const L=Object.keys(o)[0],B=o[L];g=y(this.chart.scales[L].getPixelForValue(B))}A=t.top,z=t.bottom,C=g+v,P=C+h}else if(n==="y"){if(o==="center")g=y((t.left+t.right)/2);else if(gt(o)){const L=Object.keys(o)[0],B=o[L];g=y(this.chart.scales[L].getPixelForValue(B))}S=g-v,M=S-h,T=t.left,E=t.right}const N=at(s.ticks.maxTicksLimit,d),R=Math.max(1,Math.ceil(d/N));for(x=0;x0&&(U-=Z/2);break}V={left:U,top:O,width:Z+W.width,height:et+W.height,color:R.backdropColor}}v.push({label:_,font:P,textOffset:E,options:{rotation:m,color:B,strokeColor:D,strokeWidth:$,textAlign:F,textBaseline:z,translation:[w,S],backdrop:V}})}return v}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Jn(this.labelRotation))return t==="top"?"left":"right";let s="center";return n.align==="start"?s="left":n.align==="end"?s="right":n.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:i,mirror:s,padding:r}}=this.options,o=this._getLabelSizes(),a=t+r,l=o.widest.width;let c,u;return n==="left"?s?(u=this.right+r,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?s?(u=this.left+r,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_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:i,top:s,width:r,height:o}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(i,s,r,o),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const s=this.ticks.findIndex(r=>r.value===t);return s>=0?n.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const n=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let r,o;const a=(l,c,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(n.display)for(r=0,o=s.length;r{this.draw(r)}}]:[{z:i,draw:r=>{this.drawBackground(),this.drawGrid(r),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:n,draw:r=>{this.drawLabels(r)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let r,o;for(r=0,o=n.length;r{const i=n.split("."),s=i.pop(),r=[e].concat(i).join("."),o=t[n].split("."),a=o.pop(),l=o.join(".");ne.route(r,s,l,a)})}function gR(e){return"id"in e&&"defaults"in e}let yR=class{constructor(){this.controllers=new iu(Zs,"datasets",!0),this.elements=new iu(os,"elements"),this.plugins=new iu(Object,"plugins"),this.scales=new iu(mc,"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,i){[...n].forEach(s=>{const r=i||this._getRegistryForType(s);i||r.isForType(s)||r===this.plugins&&s.id?this._exec(t,r,s):Et(s,o=>{const a=i||this._getRegistryForType(o);this._exec(t,a,o)})})}_exec(t,n,i){const s=ay(t);$t(i["before"+s],[],i),n[t](i),$t(i["after"+s],[],i)}_getRegistryForType(t){for(let n=0;nr.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(s(n,i),t,"stop"),this._notify(s(i,n),t,"start")}};function xR(e){const t={},n=[],i=Object.keys(hi.plugins.items);for(let r=0;r1&&Ex(e[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function Ax(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function CR(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(i=>i.xAxisID===e||i.yAxisID===e);if(n.length)return Ax(e,"x",n[0])||Ax(e,"y",n[0])}return{}}function PR(e,t){const n=Fr[e.type]||{scales:{}},i=t.scales||{},s=wm(e.type,t),r=Object.create(null);return Object.keys(i).forEach(o=>{const a=i[o];if(!gt(a))return console.error(`Invalid scale configuration for scale: ${o}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const l=km(o,a,CR(o,e),ne.scales[a.type]),c=SR(l,s),u=n.scales||{};r[o]=dl(Object.create(null),[{axis:l},a,u[l],u[c]])}),e.data.datasets.forEach(o=>{const a=o.type||e.type,l=o.indexAxis||wm(a,t),u=(Fr[a]||{}).scales||{};Object.keys(u).forEach(d=>{const h=kR(d,l),f=o[h+"AxisID"]||h;r[f]=r[f]||Object.create(null),dl(r[f],[{axis:h},i[f],u[d]])})}),Object.keys(r).forEach(o=>{const a=r[o];dl(a,[ne.scales[a.type],ne.scale])}),r}function pM(e){const t=e.options||(e.options={});t.plugins=at(t.plugins,{}),t.scales=PR(e,t)}function mM(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function TR(e){return e=e||{},e.data=mM(e.data),pM(e),e}const Ox=new Map,gM=new Set;function su(e,t){let n=Ox.get(e);return n||(n=t(),Ox.set(e,n),gM.add(n)),n}const ka=(e,t,n)=>{const i=zs(t,n);i!==void 0&&e.add(i)};let DR=class{constructor(t){this._config=TR(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=mM(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(),pM(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return su(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return su(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return su(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,i=this.type;return su(`${i}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const i=this._scopeCache;let s=i.get(t);return(!s||n)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,n,i){const{options:s,type:r}=this,o=this._cachedScopes(t,i),a=o.get(n);if(a)return a;const l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(d=>ka(l,t,d))),u.forEach(d=>ka(l,s,d)),u.forEach(d=>ka(l,Fr[r]||{},d)),u.forEach(d=>ka(l,ne,d)),u.forEach(d=>ka(l,bm,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),gM.has(n)&&o.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,Fr[n]||{},ne.datasets[n]||{},{type:n},ne,bm]}resolveNamedOptions(t,n,i,s=[""]){const r={$shared:!0},{resolver:o,subPrefixes:a}=Rx(this._resolverCache,t,s);let l=o;if(AR(o,n)){r.$shared=!1,i=Ws(i)?i():i;const c=this.createResolver(t,i,a);l=Ho(o,i,c)}for(const c of n)r[c]=l[c];return r}createResolver(t,n,i=[""],s){const{resolver:r}=Rx(this._resolverCache,t,i);return gt(n)?Ho(r,n,void 0,s):r}};function Rx(e,t,n){let i=e.get(t);i||(i=new Map,e.set(t,i));const s=n.join();let r=i.get(s);return r||(r={resolver:fy(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},i.set(s,r)),r}const ER=e=>gt(e)&&Object.getOwnPropertyNames(e).some(t=>Ws(e[t]));function AR(e,t){const{isScriptable:n,isIndexable:i}=XS(e);for(const s of t){const r=n(s),o=i(s),a=(o||r)&&e[s];if(r&&(Ws(a)||ER(a))||o&&Ut(a))return!0}return!1}var OR="4.4.2";const RR=["top","bottom","left","right","chartArea"];function Lx(e,t){return e==="top"||e==="bottom"||RR.indexOf(e)===-1&&t==="x"}function Nx(e,t){return function(n,i){return n[e]===i[e]?n[t]-i[t]:n[e]-i[e]}}function jx(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),$t(n&&n.onComplete,[e],t)}function LR(e){const t=e.chart,n=t.options.animation;$t(n&&n.onProgress,[e],t)}function yM(e){return gy()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Ju={},$x=e=>{const t=yM(e);return Object.values(Ju).filter(n=>n.canvas===t).pop()};function NR(e,t,n){const i=Object.keys(e);for(const s of i){const r=+s;if(r>=t){const o=e[s];delete e[s],(n>0||r>t)&&(e[r+n]=o)}}}function jR(e,t,n,i){return!n||e.type==="mouseout"?null:i?t:e}function ru(e,t,n){return e.options.clip?e[n]:t[n]}function $R(e,t){const{xScale:n,yScale:i}=e;return n&&i?{left:ru(n,t,"left"),right:ru(n,t,"right"),top:ru(i,t,"top"),bottom:ru(i,t,"bottom")}:t}var fs;let by=(fs=class{static register(...t){hi.add(...t),Ix()}static unregister(...t){hi.remove(...t),Ix()}constructor(t,n){const i=this.config=new DR(n),s=yM(t),r=$x(s);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||tR(s)),this.platform.updateConfig(i);const a=this.platform.acquireContext(s,o.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=RA(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,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 vR,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=GA(d=>this.update(d),o.resizeDelay||0),this._dataChanges=[],Ju[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Ai.listen(this,"complete",jx),Ai.listen(this,"progress",LR),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:i,height:s,_aspectRatio:r}=this;return bt(t)?n&&r?r:s?i/s: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 hi}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():rx(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return nx(this.canvas,this.ctx),this}stop(){return Ai.stop(this),this}resize(t,n){Ai.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const i=this.options,s=this.canvas,r=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,t,n,r),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,rx(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),$t(i.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Et(n,(i,s)=>{i.id=s})}buildOrUpdateScales(){const t=this.options,n=t.scales,i=this.scales,s=Object.keys(i).reduce((o,a)=>(o[a]=!1,o),{});let r=[];n&&(r=r.concat(Object.keys(n).map(o=>{const a=n[o],l=km(o,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),Et(r,o=>{const a=o.options,l=a.id,c=km(l,a),u=at(a.type,o.dtype);(a.position===void 0||Lx(a.position,c)!==Lx(o.dposition))&&(a.position=o.dposition),s[l]=!0;let d=null;if(l in i&&i[l].type===u)d=i[l];else{const h=hi.getScale(u);d=new h({id:l,type:u,ctx:this.ctx,chart:this}),i[d.id]=d}d.init(a,t)}),Et(s,(o,a)=>{o||delete i[a]}),Et(i,o=>{Fe.configure(this,o,o.options),Fe.addBox(this,o)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,i=t.length;if(t.sort((s,r)=>s.index-r.index),i>n){for(let s=n;sn.length&&delete this._stacks,t.forEach((i,s)=>{n.filter(r=>r===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=n.length;i{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const i=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let c=0,u=this.data.datasets.length;c{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Nx("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Et(this.scales,t=>{Fe.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Xv(n,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:r}of n){const o=i==="_removeElements"?-r:r;NR(t,s,o)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,i=r=>new Set(t.filter(o=>o[0]===r).map((o,a)=>a+","+o.splice(1).join(","))),s=i(0);for(let r=1;rr.split(",")).map(r=>({method:r[1],start:+r[2],count:+r[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Fe.update(this,this.width,this.height,t);const n=this.chartArea,i=n.width<=0||n.height<=0;this._layers=[],Et(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,r)=>{s._idx=r}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,i=this.data.datasets.length;n=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,i=t._clip,s=!i.disabled,r=$R(t,this.chartArea),o={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(s&&Ch(n,{left:i.left===!1?0:r.left-i.left,right:i.right===!1?this.width:r.right+i.right,top:i.top===!1?0:r.top-i.top,bottom:i.bottom===!1?this.height:r.bottom+i.bottom}),t.controller.draw(),s&&Ph(n),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return Wi(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,i,s){const r=R2.modes[n];return typeof r=="function"?r(this,t,i,s):[]}getDatasetMeta(t){const n=this.data.datasets[t],i=this._metasets;let s=i.filter(r=>r&&r._dataset===n).pop();return s||(s={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},i.push(s)),s}getContext(){return this.$context||(this.$context=Qs(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!n.hidden}setDatasetVisibility(t,n){const i=this.getDatasetMeta(t);i.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,i){const s=i?"show":"hide",r=this.getDatasetMeta(t),o=r.controller._resolveAnimations(void 0,s);Wl(n)?(r.data[n].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(r,{visible:i}),this.update(a=>a.datasetIndex===t?s: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(),Ai.remove(this),t=0,n=this.data.datasets.length;t{n.addEventListener(this,r,o),t[r]=o},s=(r,o,a)=>{r.offsetX=o,r.offsetY=a,this._eventHandler(r)};Et(this.options.events,r=>i(r,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,i=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},r=(l,c)=>{this.canvas&&this.resize(l,c)};let o;const a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",r),i("detach",o)};o=()=>{this.attached=!1,s("resize",r),this._stop(),this._resize(0,0),i("attach",a)},n.isAttached(this.canvas)?a():o()}unbindEvents(){Et(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Et(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,i){const s=i?"set":"remove";let r,o,a,l;for(n==="dataset"&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=t.length;a{const a=this.getDatasetMeta(r);if(!a)throw new Error("No dataset found at index "+r);return{datasetIndex:r,element:a.data[o],index:o}});!Rd(i,n)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,n))}notifyPlugins(t,n,i){return this._plugins.notify(this,t,n,i)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,i){const s=this.options.hover,r=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),o=r(n,t),a=i?t:r(t,n);o.length&&this.updateHoverStyle(o,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,n){const i={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},s=o=>(o.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const r=this._handleEvent(t,n,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(r||i.changed)&&this.render(),this}_handleEvent(t,n,i){const{_active:s=[],options:r}=this,o=n,a=this._getActiveElements(t,s,i,o),l=FA(t),c=jR(t,this._lastEvent,i,l);i&&(this._lastEvent=null,$t(r.onHover,[t,a,this],this),l&&$t(r.onClick,[t,a,this],this));const u=!Rd(a,s);return(u||n)&&(this._active=a,this._updateHoverStyles(a,s,n)),this._lastEvent=c,u}_getActiveElements(t,n,i,s){if(t.type==="mouseout")return[];if(!i)return n;const r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,s)}},K(fs,"defaults",ne),K(fs,"instances",Ju),K(fs,"overrides",Fr),K(fs,"registry",hi),K(fs,"version",OR),K(fs,"getChart",$x),fs);function Ix(){return Et(by.instances,e=>e._plugins.invalidate())}function IR(e,t,n){const{startAngle:i,pixelMargin:s,x:r,y:o,outerRadius:a,innerRadius:l}=t;let c=s/a;e.beginPath(),e.arc(r,o,a,i-c,n+c),l>s?(c=s/l,e.arc(r,o,l,n+c,i-c,!0)):e.arc(r,o,s,n+ue,i-ue),e.closePath(),e.clip()}function FR(e){return hy(e,["outerStart","outerEnd","innerStart","innerEnd"])}function BR(e,t,n,i){const s=FR(e.options.borderRadius),r=(n-t)/2,o=Math.min(r,i*t/2),a=l=>{const c=(n-Math.min(r,l))*i/2;return we(l,0,Math.min(r,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:we(s.innerStart,0,o),innerEnd:we(s.innerEnd,0,o)}}function Zr(e,t,n,i){return{x:n+e*Math.cos(t),y:i+e*Math.sin(t)}}function Fd(e,t,n,i,s,r){const{x:o,y:a,startAngle:l,pixelMargin:c,innerRadius:u}=t,d=Math.max(t.outerRadius+i+n-c,0),h=u>0?u+i+n+c:0;let f=0;const p=s-l;if(i){const R=u>0?u-i:0,L=d>0?d-i:0,B=(R+L)/2,D=B!==0?p*B/(B+i):p;f=(p-D)/2}const m=Math.max(.001,p*d-n/Kt)/d,v=(p-m)/2,y=l+v+f,g=s-v-f,{outerStart:x,outerEnd:_,innerStart:w,innerEnd:S}=BR(t,h,d,g-y),C=d-x,M=d-_,P=y+x/C,T=g-_/M,A=h+w,E=h+S,z=y+w/A,N=g-S/E;if(e.beginPath(),r){const R=(P+T)/2;if(e.arc(o,a,d,P,R),e.arc(o,a,d,R,T),_>0){const $=Zr(M,T,o,a);e.arc($.x,$.y,_,T,g+ue)}const L=Zr(E,g,o,a);if(e.lineTo(L.x,L.y),S>0){const $=Zr(E,N,o,a);e.arc($.x,$.y,S,g+ue,N+Math.PI)}const B=(g-S/h+(y+w/h))/2;if(e.arc(o,a,h,g-S/h,B,!0),e.arc(o,a,h,B,y+w/h,!0),w>0){const $=Zr(A,z,o,a);e.arc($.x,$.y,w,z+Math.PI,y-ue)}const D=Zr(C,y,o,a);if(e.lineTo(D.x,D.y),x>0){const $=Zr(C,P,o,a);e.arc($.x,$.y,x,y-ue,P)}}else{e.moveTo(o,a);const R=Math.cos(P)*d+o,L=Math.sin(P)*d+a;e.lineTo(R,L);const B=Math.cos(T)*d+o,D=Math.sin(T)*d+a;e.lineTo(B,D)}e.closePath()}function VR(e,t,n,i,s){const{fullCircles:r,startAngle:o,circumference:a}=t;let l=t.endAngle;if(r){Fd(e,t,n,i,l,s);for(let c=0;c=Xt||Hl(o,l,c),v=Vi(a,u+f,d+f);return m&&v}getCenterPoint(n){const{x:i,y:s,startAngle:r,endAngle:o,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:c,spacing:u}=this.options,d=(r+o)/2,h=(a+l+u+c)/2;return{x:i+Math.cos(d)*h,y:s+Math.sin(d)*h}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:i,circumference:s}=this,r=(i.offset||0)/4,o=(i.spacing||0)/2,a=i.circular;if(this.pixelMargin=i.borderAlign==="inner"?.33:0,this.fullCircles=s>Xt?Math.floor(s/Xt):0,s===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const l=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(l)*r,Math.sin(l)*r);const c=1-Math.sin(Math.min(Kt,s||0)),u=r*c;n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,VR(n,this,u,o,a),zR(n,this,u,o,a),n.restore()}},K(io,"id","arc"),K(io,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),K(io,"defaultRoutes",{backgroundColor:"backgroundColor"}),K(io,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"}),io);function xM(e,t,n=t){e.lineCap=at(n.borderCapStyle,t.borderCapStyle),e.setLineDash(at(n.borderDash,t.borderDash)),e.lineDashOffset=at(n.borderDashOffset,t.borderDashOffset),e.lineJoin=at(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=at(n.borderWidth,t.borderWidth),e.strokeStyle=at(n.borderColor,t.borderColor)}function WR(e,t,n){e.lineTo(n.x,n.y)}function HR(e){return e.stepped?aO:e.tension||e.cubicInterpolationMode==="monotone"?lO:WR}function bM(e,t,n={}){const i=e.length,{start:s=0,end:r=i-1}=n,{start:o,end:a}=t,l=Math.max(s,o),c=Math.min(r,a),u=sa&&r>a;return{count:i,start:l,loop:t.loop,ilen:c(o+(c?a-_:_))%r,x=()=>{m!==v&&(e.lineTo(u,v),e.lineTo(u,m),e.lineTo(u,y))};for(l&&(f=s[g(0)],e.moveTo(f.x,f.y)),h=0;h<=a;++h){if(f=s[g(h)],f.skip)continue;const _=f.x,w=f.y,S=_|0;S===p?(wv&&(v=w),u=(d*u+_)/++d):(x(),e.lineTo(_,w),p=S,d=0,m=v=w),y=w}x()}function Sm(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?YR:UR}function XR(e){return e.stepped?BO:e.tension||e.cubicInterpolationMode==="monotone"?VO:pr}function KR(e,t,n,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,n,i)&&s.closePath()),xM(e,t.options),e.stroke(s)}function GR(e,t,n,i){const{segments:s,options:r}=t,o=Sm(t);for(const a of s)xM(e,r,a.style),e.beginPath(),o(e,t,a,{start:n,end:n+i-1})&&e.closePath(),e.stroke()}const qR=typeof Path2D=="function";function QR(e,t,n,i){qR&&!t.options.segment?KR(e,t,n,i):GR(e,t,n,i)}var so;let Dh=(so=class extends os{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 i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;OO(this._points,i,t,s,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=XO(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,i=t.length;return i&&n[t[i-1].end]}interpolate(t,n){const i=this.options,s=t[n],r=this.points,o=iM(this,{property:n,start:s,end:s});if(!o.length)return;const a=[],l=XR(i);let c,u;for(c=0,u=o.length;ct!=="borderDash"&&t!=="fill"}),so);function Fx(e,t,n,i){const s=e.options,{[n]:r}=e.getProps([n],i);return Math.abs(t-r)e.replace("rgb(","rgba(").replace(")",", 0.5)"));function SM(e){return Mm[e%Mm.length]}function MM(e){return Bx[e%Bx.length]}function sL(e,t){return e.borderColor=SM(t),e.backgroundColor=MM(t),++t}function rL(e,t){return e.backgroundColor=e.data.map(()=>SM(t++)),t}function oL(e,t){return e.backgroundColor=e.data.map(()=>MM(t++)),t}function aL(e){let t=0;return(n,i)=>{const s=e.getDatasetMeta(i).controller;s instanceof vy?t=rL(n,t):s instanceof aM?t=oL(n,t):s&&(t=sL(n,t))}}function Vx(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function lL(e){return e&&(e.borderColor||e.backgroundColor)}var cL={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:i},options:s}=e.config,{elements:r}=s;if(!n.forceOverride&&(Vx(i)||lL(s)||r&&Vx(r)))return;const o=aL(e);i.forEach(o)}};function uL(e,t,n,i,s){const r=s.samples||i;if(r>=n)return e.slice(t,t+n);const o=[],a=(n-2)/(r-2);let l=0;const c=t+n-1;let u=t,d,h,f,p,m;for(o[l++]=e[u],d=0;df&&(f=p,h=e[g],m=g);o[l++]=h,u=m}return o[l++]=e[c],o}function dL(e,t,n,i){let s=0,r=0,o,a,l,c,u,d,h,f,p,m;const v=[],y=t+n-1,g=e[t].x,_=e[y].x-g;for(o=t;om&&(m=c,h=o),s=(r*s+a.x)/++r;else{const S=o-1;if(!bt(d)&&!bt(h)){const C=Math.min(d,h),M=Math.max(d,h);C!==f&&C!==S&&v.push({...e[C],x:s}),M!==f&&M!==S&&v.push({...e[M],x:s})}o>0&&S!==f&&v.push(e[S]),v.push(a),u=w,r=0,p=m=c,d=h=f=o}}return v}function CM(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function zx(e){e.data.datasets.forEach(t=>{CM(t)})}function hL(e,t){const n=t.length;let i=0,s;const{iScale:r}=e,{min:o,max:a,minDefined:l,maxDefined:c}=r.getUserBounds();return l&&(i=we(zi(t,r.axis,o).lo,0,n-1)),c?s=we(zi(t,r.axis,a).hi+1,i,n)-i:s=n-i,{start:i,count:s}}var fL={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){zx(e);return}const i=e.width;e.data.datasets.forEach((s,r)=>{const{_data:o,indexAxis:a}=s,l=e.getDatasetMeta(r),c=o||s.data;if(Ht([a,e.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const u=e.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||e.options.parsing)return;let{start:d,count:h}=hL(l,c);const f=n.threshold||4*i;if(h<=f){CM(s);return}bt(o)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(m){this._data=m}}));let p;switch(n.algorithm){case"lttb":p=uL(c,d,h,i,n);break;case"min-max":p=dL(c,d,h,i);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}s._decimated=p})},destroy(e){zx(e)}};function pL(e,t,n){const i=e.segments,s=e.points,r=t.points,o=[];for(const a of i){let{start:l,end:c}=a;c=_y(l,c,s);const u=Cm(n,s[l],s[c],a.loop);if(!t.segments){o.push({source:a,target:u,start:s[l],end:s[c]});continue}const d=iM(t,u);for(const h of d){const f=Cm(n,r[h.start],r[h.end],h.loop),p=nM(a,s,f);for(const m of p)o.push({source:m,target:h,start:{[n]:Wx(u,f,"start",Math.max)},end:{[n]:Wx(u,f,"end",Math.min)}})}}return o}function Cm(e,t,n,i){if(i)return;let s=t[e],r=n[e];return e==="angle"&&(s=yn(s),r=yn(r)),{property:e,start:s,end:r}}function mL(e,t){const{x:n=null,y:i=null}=e||{},s=t.points,r=[];return t.segments.forEach(({start:o,end:a})=>{a=_y(o,a,s);const l=s[o],c=s[a];i!==null?(r.push({x:l.x,y:i}),r.push({x:c.x,y:i})):n!==null&&(r.push({x:n,y:l.y}),r.push({x:n,y:c.y}))}),r}function _y(e,t,n){for(;t>e;t--){const i=n[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function Wx(e,t,n,i){return e&&t?i(e[n],t[n]):e?e[n]:t?t[n]:0}function PM(e,t){let n=[],i=!1;return Ut(e)?(i=!0,n=e):n=mL(e,t),n.length?new Dh({points:n,options:{tension:0},_loop:i,_fullLoop:i}):null}function Hx(e){return e&&e.fill!==!1}function gL(e,t,n){let s=e[t].fill;const r=[t];let o;if(!n)return s;for(;s!==!1&&r.indexOf(s)===-1;){if(!oe(s))return s;if(o=e[s],!o)return!1;if(o.visible)return s;r.push(s),s=o.fill}return!1}function yL(e,t,n){const i=_L(e);if(gt(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return oe(s)&&Math.floor(s)===s?vL(i[0],t,s,n):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function vL(e,t,n,i){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=i?!1:n}function xL(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:gt(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function bL(e,t,n){let i;return e==="start"?i=n:e==="end"?i=t.options.reverse?t.min:t.max:gt(e)?i=e.value:i=t.getBaseValue(),i}function _L(e){const t=e.options,n=t.fill;let i=at(n&&n.target,n);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function wL(e){const{scale:t,index:n,line:i}=e,s=[],r=i.segments,o=i.points,a=kL(t,n);a.push(PM({x:null,y:t.bottom},i));for(let l=0;l=0;--o){const a=s[o].$filler;a&&(a.line.updateControlPoints(r,a.axis),i&&a.fill&&Hf(e.ctx,a,r))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const i=e.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const r=i[s].$filler;Hx(r)&&Hf(e.ctx,r,e.chartArea)}},beforeDatasetDraw(e,t,n){const i=t.meta.$filler;!Hx(i)||n.drawTime!=="beforeDatasetDraw"||Hf(e.ctx,i,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Kx=(e,t)=>{let{boxHeight:n=t,boxWidth:i=t}=e;return e.usePointStyle&&(n=Math.min(n,t),i=e.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:n,itemHeight:Math.max(t,n)}},LL=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;let Gx=class extends os{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,i){this.maxWidth=t,this.maxHeight=n,this._margins=i,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=$t(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(i=>t.filter(i,this.chart.data))),t.sort&&(n=n.sort((i,s)=>t.sort(i,s,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 i=t.labels,s=ge(i.font),r=s.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Kx(i,r);let c,u;n.font=s.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(o,r,a,l)+10):(u=this.maxHeight,c=this._fitCols(o,s,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,n,i,s){const{ctx:r,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=s+a;let d=t;r.textAlign="left",r.textBaseline="middle";let h=-1,f=-u;return this.legendItems.forEach((p,m)=>{const v=i+n/2+r.measureText(p.text).width;(m===0||c[c.length-1]+v+2*a>o)&&(d+=u,c[c.length-(m>0?0:1)]=0,f+=u,h++),l[m]={left:0,top:f,row:h,width:v,height:s},c[c.length-1]+=v+a}),d}_fitCols(t,n,i,s){const{ctx:r,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=o-t;let d=a,h=0,f=0,p=0,m=0;return this.legendItems.forEach((v,y)=>{const{itemWidth:g,itemHeight:x}=NL(i,n,r,v,s);y>0&&f+x+2*a>u&&(d+=h+a,c.push({width:h,height:f}),p+=h+a,m++,h=f=0),l[y]={left:p,top:f,col:m,width:g,height:x},h=Math.max(h,g),f+=x+a}),d+=h,c.push({width:h,height:f}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:i,labels:{padding:s},rtl:r}}=this,o=Oo(r,this.left,this.width);if(this.isHorizontal()){let a=0,l=Ne(i,this.left+s,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=Ne(i,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+t+s,c.left=o.leftForLtr(o.x(l),c.width),l+=c.width+s}else{let a=0,l=Ne(i,this.top+t+s,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=Ne(i,this.top+t+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=o.leftForLtr(o.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Ch(t,this),this._draw(),Ph(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:i,ctx:s}=this,{align:r,labels:o}=t,a=ne.color,l=Oo(t.rtl,this.left,this.width),c=ge(o.font),{padding:u}=o,d=c.size,h=d/2;let f;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:p,boxHeight:m,itemHeight:v}=Kx(o,d),y=function(S,C,M){if(isNaN(p)||p<=0||isNaN(m)||m<0)return;s.save();const P=at(M.lineWidth,1);if(s.fillStyle=at(M.fillStyle,a),s.lineCap=at(M.lineCap,"butt"),s.lineDashOffset=at(M.lineDashOffset,0),s.lineJoin=at(M.lineJoin,"miter"),s.lineWidth=P,s.strokeStyle=at(M.strokeStyle,a),s.setLineDash(at(M.lineDash,[])),o.usePointStyle){const T={radius:m*Math.SQRT2/2,pointStyle:M.pointStyle,rotation:M.rotation,borderWidth:P},A=l.xPlus(S,p/2),E=C+h;US(s,T,A,E,o.pointStyleWidth&&p)}else{const T=C+Math.max((d-m)/2,0),A=l.leftForLtr(S,p),E=Cr(M.borderRadius);s.beginPath(),Object.values(E).some(z=>z!==0)?Ul(s,{x:A,y:T,w:p,h:m,radius:E}):s.rect(A,T,p,m),s.fill(),P!==0&&s.stroke()}s.restore()},g=function(S,C,M){Br(s,M.text,S,C+v/2,c,{strikethrough:M.hidden,textAlign:l.textAlign(M.textAlign)})},x=this.isHorizontal(),_=this._computeTitleHeight();x?f={x:Ne(r,this.left+u,this.right-i[0]),y:this.top+u+_,line:0}:f={x:this.left+u,y:Ne(r,this.top+_+u,this.bottom-n[0].height),line:0},JS(this.ctx,t.textDirection);const w=v+u;this.legendItems.forEach((S,C)=>{s.strokeStyle=S.fontColor,s.fillStyle=S.fontColor;const M=s.measureText(S.text).width,P=l.textAlign(S.textAlign||(S.textAlign=o.textAlign)),T=p+h+M;let A=f.x,E=f.y;l.setWidth(this.width),x?C>0&&A+T+u>this.right&&(E=f.y+=w,f.line++,A=f.x=Ne(r,this.left+u,this.right-i[f.line])):C>0&&E+w>this.bottom&&(A=f.x=A+n[f.line].width+u,f.line++,E=f.y=Ne(r,this.top+_+u,this.bottom-n[f.line].height));const z=l.x(A);if(y(z,E,S),A=qA(P,A+p+h,x?A+T:this.right,t.rtl),g(l.x(A),E,S),x)f.x+=T+u;else if(typeof S.text!="string"){const N=c.lineHeight;f.y+=DM(S,N)+u}else f.y+=w}),tM(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,i=ge(n.font),s=Ae(n.padding);if(!n.display)return;const r=Oo(t.rtl,this.left,this.width),o=this.ctx,a=n.position,l=i.size/2,c=s.top+l;let u,d=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),u=this.top+c,d=Ne(t.align,d,this.right-h);else{const p=this.columnSizes.reduce((m,v)=>Math.max(m,v.height),0);u=c+Ne(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const f=Ne(a,d,d+h);o.textAlign=r.textAlign(uy(a)),o.textBaseline="middle",o.strokeStyle=n.color,o.fillStyle=n.color,o.font=i.string,Br(o,n.text,f,u,i)}_computeTitleHeight(){const t=this.options.title,n=ge(t.font),i=Ae(t.padding);return t.display?n.lineHeight+i.height:0}_getLegendItemAt(t,n){let i,s,r;if(Vi(t,this.left,this.right)&&Vi(n,this.top,this.bottom)){for(r=this.legendHitBoxes,i=0;ir.length>o.length?r:o)),t+n.size/2+i.measureText(s).width}function $L(e,t,n){let i=e;return typeof t.text!="string"&&(i=DM(t,n)),i}function DM(e,t){const n=e.text?e.text.length:0;return t*n}function IL(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var FL={id:"legend",_element:Gx,start(e,t,n){const i=e.legend=new Gx({ctx:e.ctx,options:n,chart:e});Fe.configure(e,i,n),Fe.addBox(e,i)},stop(e){Fe.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const i=e.legend;Fe.configure(e,i,n),i.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 i=t.datasetIndex,s=n.chart;s.isDatasetVisible(i)?(s.hide(i),t.hidden=!0):(s.show(i),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:i,textAlign:s,color:r,useBorderRadius:o,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),u=Ae(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:r,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:i||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:o&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};let wy=class extends os{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 i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const s=Ut(i.text)?i.text.length:1;this._padding=Ae(i.padding);const r=s*ge(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:i,bottom:s,right:r,options:o}=this,a=o.align;let l=0,c,u,d;return this.isHorizontal()?(u=Ne(a,i,r),d=n+t,c=r-i):(o.position==="left"?(u=i+t,d=Ne(a,s,n),l=Kt*-.5):(u=r-t,d=Ne(a,n,s),l=Kt*.5),c=s-n),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const i=ge(n.font),r=i.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(r);Br(t,n.text,0,0,i,{color:n.color,maxWidth:l,rotation:c,textAlign:uy(n.align),textBaseline:"middle",translation:[o,a]})}};function BL(e,t){const n=new wy({ctx:e.ctx,options:t,chart:e});Fe.configure(e,n,t),Fe.addBox(e,n),e.titleBlock=n}var VL={id:"title",_element:wy,start(e,t,n){BL(e,n)},stop(e){const t=e.titleBlock;Fe.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const i=e.titleBlock;Fe.configure(e,i,n),i.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 ou=new WeakMap;var zL={id:"subtitle",start(e,t,n){const i=new wy({ctx:e.ctx,options:n,chart:e});Fe.configure(e,i,n),Fe.addBox(e,i),ou.set(e,i)},stop(e){Fe.removeBox(e,ou.get(e)),ou.delete(e)},beforeUpdate(e,t,n){const i=ou.get(e);Fe.configure(e,i,n),i.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const qa={average(e){if(!e.length)return!1;let t,n,i=new Set,s=0,r=0;for(t=0,n=e.length;ta+l)/i.size,y:s/r}},nearest(e,t){if(!e.length)return!1;let n=t.x,i=t.y,s=Number.POSITIVE_INFINITY,r,o,a;for(r=0,o=e.length;r-1?e.split(` -`):e}function WR(e,t){const{element:n,datasetIndex:i,index:s}=t,r=e.getDatasetMeta(i).controller,{label:o,value:a}=r.getLabelAndValue(s);return{chart:e,label:o,parsed:r.getParsed(s),raw:e.data.datasets[i].data[s],formattedValue:a,dataset:r.getDataset(),dataIndex:s,datasetIndex:i,element:n}}function qx(e,t){const n=e.chart.ctx,{body:i,footer:s,title:r}=e,{boxWidth:o,boxHeight:a}=t,l=ge(t.bodyFont),c=ge(t.titleFont),u=ge(t.footerFont),d=r.length,h=s.length,f=i.length,p=Ae(t.padding);let m=p.height,v=0,y=i.reduce((_,w)=>_+w.before.length+w.lines.length+w.after.length,0);if(y+=e.beforeBody.length+e.afterBody.length,d&&(m+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),y){const _=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;m+=f*_+(y-f)*l.lineHeight+(y-1)*t.bodySpacing}h&&(m+=t.footerMarginTop+h*u.lineHeight+(h-1)*t.footerSpacing);let g=0;const x=function(_){v=Math.max(v,n.measureText(_).width+g)};return n.save(),n.font=c.string,Et(e.title,x),n.font=l.string,Et(e.beforeBody.concat(e.afterBody),x),g=t.displayColors?o+2+t.boxPadding:0,Et(i,_=>{Et(_.before,x),Et(_.lines,x),Et(_.after,x)}),g=0,n.font=u.string,Et(e.footer,x),n.restore(),v+=p.width,{width:v,height:m}}function HR(e,t){const{y:n,height:i}=t;return ne.height-i/2?"bottom":"center"}function UR(e,t,n,i){const{x:s,width:r}=i,o=n.caretSize+n.caretPadding;if(e==="left"&&s+r+o>t.width||e==="right"&&s-r-o<0)return!0}function YR(e,t,n,i){const{x:s,width:r}=n,{width:o,chartArea:{left:a,right:l}}=e;let c="center";return i==="center"?c=s<=(a+l)/2?"left":"right":s<=r/2?c="left":s>=o-r/2&&(c="right"),UR(c,e,t,n)&&(c="center"),c}function Qx(e,t,n){const i=n.yAlign||t.yAlign||HR(e,n);return{xAlign:n.xAlign||t.xAlign||YR(e,t,n,i),yAlign:i}}function XR(e,t){let{x:n,width:i}=e;return t==="right"?n-=i:t==="center"&&(n-=i/2),n}function KR(e,t,n){let{y:i,height:s}=e;return t==="top"?i+=n:t==="bottom"?i-=s+n:i-=s/2,i}function Zx(e,t,n,i){const{caretSize:s,caretPadding:r,cornerRadius:o}=e,{xAlign:a,yAlign:l}=n,c=s+r,{topLeft:u,topRight:d,bottomLeft:h,bottomRight:f}=Cr(o);let p=XR(t,a);const m=KR(t,l,c);return l==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(u,h)+s:a==="right"&&(p+=Math.max(d,f)+s),{x:we(p,0,i.width-t.width),y:we(m,0,i.height-t.height)}}function ou(e,t,n){const i=Ae(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-i.right:e.x+i.left}function Jx(e){return ci([],Oi(e))}function GR(e,t,n){return Qs(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function tb(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const EM={beforeTitle:Di,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,i=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex"u"?EM[t].call(n,i):s}var kp;let eb=(kp=class extends os{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,i=this.options.setContext(this.getContext()),s=i.enabled&&n.options.animation&&i.animations,r=new sM(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=GR(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:i}=n,s=qe(i,"beforeTitle",this,t),r=qe(i,"title",this,t),o=qe(i,"afterTitle",this,t);let a=[];return a=ci(a,Oi(s)),a=ci(a,Oi(r)),a=ci(a,Oi(o)),a}getBeforeBody(t,n){return Jx(qe(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:i}=n,s=[];return Et(t,r=>{const o={before:[],lines:[],after:[]},a=tb(i,r);ci(o.before,Oi(qe(a,"beforeLabel",this,r))),ci(o.lines,qe(a,"label",this,r)),ci(o.after,Oi(qe(a,"afterLabel",this,r))),s.push(o)}),s}getAfterBody(t,n){return Jx(qe(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:i}=n,s=qe(i,"beforeFooter",this,t),r=qe(i,"footer",this,t),o=qe(i,"afterFooter",this,t);let a=[];return a=ci(a,Oi(s)),a=ci(a,Oi(r)),a=ci(a,Oi(o)),a}_createItems(t){const n=this._active,i=this.chart.data,s=[],r=[],o=[];let a=[],l,c;for(l=0,c=n.length;lt.filter(u,d,h,i))),t.itemSort&&(a=a.sort((u,d)=>t.itemSort(u,d,i))),Et(a,u=>{const d=tb(t.callbacks,u);s.push(qe(d,"labelColor",this,u)),r.push(qe(d,"labelPointStyle",this,u)),o.push(qe(d,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=r,this.labelTextColors=o,this.dataPoints=a,a}update(t,n){const i=this.options.setContext(this.getContext()),s=this._active;let r,o=[];if(!s.length)this.opacity!==0&&(r={opacity:0});else{const a=qa[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const l=this._size=qx(this,i),c=Object.assign({},a,l),u=Qx(this.chart,i,c),d=Zx(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,r={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,i,s){const r=this.getCaretPosition(t,i,s);n.lineTo(r.x1,r.y1),n.lineTo(r.x2,r.y2),n.lineTo(r.x3,r.y3)}getCaretPosition(t,n,i){const{xAlign:s,yAlign:r}=this,{caretSize:o,cornerRadius:a}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=Cr(a),{x:h,y:f}=t,{width:p,height:m}=n;let v,y,g,x,_,w;return r==="center"?(_=f+m/2,s==="left"?(v=h,y=v-o,x=_+o,w=_-o):(v=h+p,y=v+o,x=_-o,w=_+o),g=v):(s==="left"?y=h+Math.max(l,u)+o:s==="right"?y=h+p-Math.max(c,d)-o:y=this.caretX,r==="top"?(x=f,_=x-o,v=y-o,g=y+o):(x=f+m,_=x+o,v=y+o,g=y-o),w=x),{x1:v,x2:y,x3:g,y1:x,y2:_,y3:w}}drawTitle(t,n,i){const s=this.title,r=s.length;let o,a,l;if(r){const c=Oo(i.rtl,this.x,this.width);for(t.x=ou(this,i.titleAlign,i),n.textAlign=c.textAlign(i.titleAlign),n.textBaseline="middle",o=ge(i.titleFont),a=i.titleSpacing,n.fillStyle=i.titleColor,n.font=o.string,l=0;lg!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,Hl(t,{x:m,y:p,w:c,h:l,radius:y}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),Hl(t,{x:v,y:p+1,w:c-2,h:l-2,radius:y}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(m,p,c,l),t.strokeRect(m,p,c,l),t.fillStyle=o.backgroundColor,t.fillRect(v,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,n,i){const{body:s}=this,{bodySpacing:r,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=i,d=ge(i.bodyFont);let h=d.lineHeight,f=0;const p=Oo(i.rtl,this.x,this.width),m=function(M){n.fillText(M,p.x(t.x+f),t.y+h/2),t.y+=h+r},v=p.textAlign(o);let y,g,x,_,w,S,C;for(n.textAlign=o,n.textBaseline="middle",n.font=d.string,t.x=ou(this,v,i),n.fillStyle=i.bodyColor,Et(this.beforeBody,m),f=a&&v!=="right"?o==="center"?c/2+u:c+2+u:0,_=0,S=s.length;_0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,i=this.$animations,s=i&&i.x,r=i&&i.y;if(s||r){const o=qa[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=qx(this,t),l=Object.assign({},o,this._size),c=Qx(n,t,l),u=Zx(t,l,c,n);(s._to!==u.x||r._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(n);const s={width:this.width,height:this.height},r={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=Ae(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(r,t,s,n),JS(t,n.textDirection),r.y+=o.top,this.drawTitle(r,t,n),this.drawBody(r,t,n),this.drawFooter(r,t,n),tM(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const i=this._active,s=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),r=!Ld(i,s),o=this._positionChanged(s,n);(r||o)&&(this._active=s,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,i=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,r=this._active||[],o=this._getActiveElements(t,r,n,i),a=this._positionChanged(o,t),l=n||!Ld(o,r)||a;return l&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,i,s){const r=this.options;if(t.type==="mouseout")return[];if(!s)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const o=this.chart.getElementsAtEventForMode(t,r.mode,r,i);return r.reverse&&o.reverse(),o}_positionChanged(t,n){const{caretX:i,caretY:s,options:r}=this,o=qa[r.position].call(this,t,n);return o!==!1&&(i!==o.x||s!==o.y)}},K(kp,"positioners",qa),kp);var qR={id:"tooltip",_element:eb,positioners:qa,afterInit(e,t,n){n&&(e.tooltip=new eb({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:EM},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"]},QR=Object.freeze({__proto__:null,Colors:cR,Decimation:fR,Filler:LR,Legend:FR,SubTitle:zR,Title:VR,Tooltip:qR});const ZR=(e,t,n,i)=>(typeof t=="string"?(n=e.push(t)-1,i.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function JR(e,t,n,i){const s=e.indexOf(t);if(s===-1)return ZR(e,t,n,i);const r=e.lastIndexOf(t);return s!==r?n:s}const tN=(e,t)=>e===null?null:we(Math.round(e),0,t);function nb(e){const t=this.getLabels();return e>=0&&en.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}},K(Ru,"id","category"),K(Ru,"defaults",{ticks:{callback:nb}}),Ru);function nN(e,t){const n=[],{bounds:s,step:r,min:o,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:h}=e,f=r||1,p=u-1,{min:m,max:v}=t,y=!bt(o),g=!bt(a),x=!bt(c),_=(v-m)/(d+1);let w=Gv((v-m)/p/f)*f,S,C,M,P;if(w<1e-14&&!y&&!g)return[{value:m},{value:v}];P=Math.ceil(v/w)-Math.floor(m/w),P>p&&(w=Gv(P*w/p/f)*f),bt(l)||(S=Math.pow(10,l),w=Math.ceil(w*S)/S),s==="ticks"?(C=Math.floor(m/w)*w,M=Math.ceil(v/w)*w):(C=m,M=v),y&&g&&r&&WA((a-o)/r,w/1e3)?(P=Math.round(Math.min((a-o)/w,u)),w=(a-o)/P,C=o,M=a):x?(C=y?o:C,M=g?a:M,P=c-1,w=(M-C)/P):(P=(M-C)/w,dl(P,Math.round(P),w/1e3)?P=Math.round(P):P=Math.ceil(P));const T=Math.max(qv(w),qv(C));S=Math.pow(10,bt(l)?T:l),C=Math.round(C*S)/S,M=Math.round(M*S)/S;let A=0;for(y&&(h&&C!==o?(n.push({value:o}),Ca)break;n.push({value:E})}return g&&h&&M!==a?n.length&&dl(n[n.length-1].value,a,ib(a,_,e))?n[n.length-1].value=a:n.push({value:a}):(!g||M===a)&&n.push({value:M}),n}function ib(e,t,{horizontal:n,minRotation:i}){const s=Jn(i),r=(n?Math.sin(s):Math.cos(s))||.001,o=.75*t*(""+e).length;return Math.min(t/r,o)}let Bd=class extends pc{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 bt(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:i}=this.getUserBounds();let{min:s,max:r}=this;const o=l=>s=n?s:l,a=l=>r=i?r:l;if(t){const l=vi(s),c=vi(r);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(s===r){let l=r===0?1:Math.abs(r*.05);a(r+l),t||o(s-l)}this.min=s,this.max=r}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:i}=t,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),n=n||11),n&&(s=Math.min(n,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,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},r=this._range||this,o=nN(s,r);return t.bounds==="ticks"&&jS(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,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-n)/Math.max(t.length-1,1)/2;n-=s,i+=s}this._startValue=n,this._endValue=i,this._valueRange=i-n}getLabelForValue(t){return hc(t,this.chart.options.locale,this.options.ticks.format)}};var Nu;let iN=(Nu=class extends Bd{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=oe(t)?t:0,this.max=oe(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,i=Jn(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,r.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}},K(Nu,"id","linear"),K(Nu,"defaults",{ticks:{callback:Mh.formatters.numeric}}),Nu);const Yl=e=>Math.floor(Ss(e)),ar=(e,t)=>Math.pow(10,Yl(e)+t);function sb(e){return e/Math.pow(10,Yl(e))===1}function rb(e,t,n){const i=Math.pow(10,n),s=Math.floor(e/i);return Math.ceil(t/i)-s}function sN(e,t){const n=t-e;let i=Yl(n);for(;rb(e,t,i)>10;)i++;for(;rb(e,t,i)<10;)i--;return Math.min(i,Yl(e))}function rN(e,{min:t,max:n}){t=mn(e.min,t);const i=[],s=Yl(t);let r=sN(t,n),o=r<0?Math.pow(10,Math.abs(r)):1;const a=Math.pow(10,r),l=s>r?Math.pow(10,s):0,c=Math.round((t-l)*o)/o,u=Math.floor((t-l)/a/10)*a*10;let d=Math.floor((c-u)/Math.pow(10,r)),h=mn(e.min,Math.round((l+u+d*Math.pow(10,r))*o)/o);for(;h=10?d=d<15?15:20:d++,d>=20&&(r++,d=2,o=r>=0?1:o),h=Math.round((l+u+d*Math.pow(10,r))*o)/o;const f=mn(e.max,h);return i.push({value:f,major:sb(f),significand:d}),i}var ju;let oN=(ju=class extends pc{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const i=Bd.prototype.parse.apply(this,[t,n]);if(i===0){this._zero=!0;return}return oe(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=oe(t)?Math.max(0,t):null,this.max=oe(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!oe(this._userMin)&&(this.min=t===ar(this.min,0)?ar(this.min,-1):ar(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let i=this.min,s=this.max;const r=a=>i=t?i:a,o=a=>s=n?s:a;i===s&&(i<=0?(r(1),o(10)):(r(ar(i,-1)),o(ar(s,1)))),i<=0&&r(ar(s,-1)),s<=0&&o(ar(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},i=rN(n,this);return t.bounds==="ticks"&&jS(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":hc(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Ss(t),this._valueRange=Ss(this.max)-Ss(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Ss(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}},K(ju,"id","logarithmic"),K(ju,"defaults",{ticks:{callback:Mh.formatters.logarithmic,major:{enabled:!0}}}),ju);function Pm(e){const t=e.ticks;if(t.display&&e.display){const n=Ae(t.backdropPadding);return at(t.font&&t.font.size,ne.font.size)+n.height}return 0}function aN(e,t,n){return n=Ut(n)?n:[n],{w:oO(e,t.string,n),h:n.length*t.lineHeight}}function ob(e,t,n,i,s){return e===i||e===s?{start:t-n/2,end:t+n/2}:es?{start:t-n,end:t}:{start:t,end:t+n}}function lN(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),i=[],s=[],r=e._pointLabels.length,o=e.options.pointLabels,a=o.centerPointLabels?Kt/r:0;for(let l=0;lt.r&&(a=(i.end-t.r)/r,e.r=Math.max(e.r,t.r+a)),s.startt.b&&(l=(s.end-t.b)/o,e.b=Math.max(e.b,t.b+l))}function uN(e,t,n){const i=e.drawingArea,{extra:s,additionalAngle:r,padding:o,size:a}=n,l=e.getPointPosition(t,i+s+o,r),c=Math.round(ly(yn(l.angle+ue))),u=mN(l.y,a.h,c),d=fN(c),h=pN(l.x,a.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:h,top:u,right:h+a.w,bottom:u+a.h}}function dN(e,t){if(!t)return!0;const{left:n,top:i,right:s,bottom:r}=e;return!(Wi({x:n,y:i},t)||Wi({x:n,y:r},t)||Wi({x:s,y:i},t)||Wi({x:s,y:r},t))}function hN(e,t,n){const i=[],s=e._pointLabels.length,r=e.options,{centerPointLabels:o,display:a}=r.pointLabels,l={extra:Pm(r)/2,additionalAngle:o?Kt/s:0};let c;for(let u=0;u270||n<90)&&(e-=t),e}function gN(e,t,n){const{left:i,top:s,right:r,bottom:o}=n,{backdropColor:a}=t;if(!bt(a)){const l=Cr(t.borderRadius),c=Ae(t.backdropPadding);e.fillStyle=a;const u=i-c.left,d=s-c.top,h=r-i+c.width,f=o-s+c.height;Object.values(l).some(p=>p!==0)?(e.beginPath(),Hl(e,{x:u,y:d,w:h,h:f,radius:l}),e.fill()):e.fillRect(u,d,h,f)}}function yN(e,t){const{ctx:n,options:{pointLabels:i}}=e;for(let s=t-1;s>=0;s--){const r=e._pointLabelItems[s];if(!r.visible)continue;const o=i.setContext(e.getPointLabelContext(s));gN(n,o,r);const a=ge(o.font),{x:l,y:c,textAlign:u}=r;Br(n,e._pointLabels[s],l,c+a.lineHeight/2,a,{color:o.color,textAlign:u,textBaseline:"middle"})}}function AM(e,t,n,i){const{ctx:s}=e;if(n)s.arc(e.xCenter,e.yCenter,t,0,Xt);else{let r=e.getPointPosition(0,t);s.moveTo(r.x,r.y);for(let o=1;o{const s=$t(this.options.pointLabels.callback,[n,i],this);return s||s===0?s:""}).filter((n,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?lN(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,i,s){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,i,s))}getIndexAngle(t){const n=Xt/(this._pointLabels.length||1),i=this.options.startAngle||0;return yn(t*n+Jn(i))}getDistanceFromCenterForValue(t){if(bt(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(bt(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{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const h=this.getContext(d),f=s.setContext(h),p=r.setContext(h);vN(this,f,l,o,p)}}),i.display){for(t.save(),a=o-1;a>=0;a--){const u=i.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:h}=u;!h||!d||(t.lineWidth=h,t.strokeStyle=d,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,i=n.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let r,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!n.reverse)return;const c=i.setContext(this.getContext(l)),u=ge(c.font);if(r=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,o=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const d=Ae(c.backdropPadding);t.fillRect(-o/2-d.left,-r-u.size/2-d.top,o+d.width,u.size+d.height)}Br(t,a.label,0,-r,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}},K(ro,"id","radialLinear"),K(ro,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Mh.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),K(ro,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),K(ro,"descriptors",{angleLines:{_fallback:"grid"}}),ro);const Eh={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}},tn=Object.keys(Eh);function ab(e,t){return e-t}function lb(e,t){if(bt(t))return null;const n=e._adapter,{parser:i,round:s,isoWeekday:r}=e._parseOpts;let o=t;return typeof i=="function"&&(o=i(o)),oe(o)||(o=typeof i=="string"?n.parse(o,i):n.parse(o)),o===null?null:(s&&(o=s==="week"&&(Wo(r)||r===!0)?n.startOf(o,"isoWeek",r):n.startOf(o,s)),+o)}function cb(e,t,n,i){const s=tn.length;for(let r=tn.indexOf(e);r=tn.indexOf(n);r--){const o=tn[r];if(Eh[o].common&&e._adapter.diff(s,i,o)>=t-1)return o}return tn[n?tn.indexOf(n):0]}function wN(e){for(let t=tn.indexOf(e)+1,n=tn.length;t=t?n[i]:n[s];e[r]=!0}}function kN(e,t,n,i){const s=e._adapter,r=+s.startOf(t[0].value,i),o=t[t.length-1].value;let a,l;for(a=r;a<=o;a=+s.add(a,1,i))l=n[a],l>=0&&(t[l].major=!0);return t}function db(e,t,n){const i=[],s={},r=t.length;let o,a;for(o=0;o+t.value))}initOffsets(t=[]){let n=0,i=0,s,r;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?n=1-s:n=(this.getDecimalForValue(t[1])-s)/2,r=this.getDecimalForValue(t[t.length-1]),t.length===1?i=r:i=(r-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;n=we(n,0,o),i=we(i,0,o),this._offsets={start:n,end:i,factor:1/(n+1+i)}}_generate(){const t=this._adapter,n=this.min,i=this.max,s=this.options,r=s.time,o=r.unit||cb(r.minUnit,n,i,this._getLabelCapacity(n)),a=at(s.ticks.stepSize,1),l=o==="week"?r.isoWeekday:!1,c=Wo(l)||l===!0,u={};let d=n,h,f;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":o),t.diff(i,n,o)>1e5*a)throw new Error(n+" and "+i+" are too far apart with stepSize of "+a+" "+o);const p=s.ticks.source==="data"&&this.getDataTimestamps();for(h=d,f=0;h+m)}getLabelForValue(t){const n=this._adapter,i=this.options.time;return i.tooltipFormat?n.format(t,i.tooltipFormat):n.format(t,i.displayFormats.datetime)}format(t,n){const s=this.options.time.displayFormats,r=this._unit,o=n||s[r];return this._adapter.format(t,o)}_tickFormatFunction(t,n,i,s){const r=this.options,o=r.ticks.callback;if(o)return $t(o,[t,n,i],this);const a=r.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],d=c&&a[c],h=i[n],f=c&&d&&h&&h.major;return this._adapter.format(t,s||(f?d:u))}generateTickLabels(t){let n,i,s;for(n=0,i=t.length;n0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,i;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(n=0,i=s.length;n=e[i].pos&&t<=e[s].pos&&({lo:i,hi:s}=zi(e,"pos",t)),{pos:r,time:a}=e[i],{pos:o,time:l}=e[s]):(t>=e[i].time&&t<=e[s].time&&({lo:i,hi:s}=zi(e,"time",t)),{time:r,pos:a}=e[i],{time:o,pos:l}=e[s]);const c=o-r;return c?a+(l-a)*(t-r)/c:a}var Iu;let SN=(Iu=class extends Tm{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=au(n,this.min),this._tableRange=au(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:i}=this,s=[],r=[];let o,a,l,c,u;for(o=0,a=t.length;o=n&&c<=i&&s.push(c);if(s.length<2)return[{time:n,pos:0},{time:i,pos:1}];for(o=0,a=s.length;os-r)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),i=this.getLabelTimestamps();return n.length&&i.length?t=this.normalize(n.concat(i)):t=n.length?n:i,t=this._cache.all=t,t}getDecimalForValue(t){return(au(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return au(this._table,i*this._tableRange+this._minPos,!0)}},K(Iu,"id","timeseries"),K(Iu,"defaults",Tm.defaults),Iu);var MN=Object.freeze({__proto__:null,CategoryScale:eN,LinearScale:iN,LogarithmicScale:oN,RadialLinearScale:bN,TimeScale:Tm,TimeSeriesScale:SN});const CN=[P2,iR,QR,MN];by.register(...CN);function OM(e){var t,n,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t"u")return!1;var t=si(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function FN(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var i=t.styles[n]||{},s=t.attributes[n]||{},r=t.elements[n];!Fn(r)||!ki(r)||(Object.assign(r.style,i),Object.keys(s).forEach(function(o){var a=s[o];a===!1?r.removeAttribute(o):r.setAttribute(o,a===!0?"":a)}))})}function BN(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(i){var s=t.elements[i],r=t.attributes[i]||{},o=Object.keys(t.styles.hasOwnProperty(i)?t.styles[i]:n[i]),a=o.reduce(function(l,c){return l[c]="",l},{});!Fn(s)||!ki(s)||(Object.assign(s.style,a),Object.keys(r).forEach(function(l){s.removeAttribute(l)}))})}}const VN={name:"applyStyles",enabled:!0,phase:"write",fn:FN,effect:BN,requires:["computeStyles"]};function xi(e){return e.split("-")[0]}var Tr=Math.max,Vd=Math.min,Ko=Math.round;function Go(e,t){t===void 0&&(t=!1);var n=e.getBoundingClientRect(),i=1,s=1;if(Fn(e)&&t){var r=e.offsetHeight,o=e.offsetWidth;o>0&&(i=Ko(n.width)/o||1),r>0&&(s=Ko(n.height)/r||1)}return{width:n.width/i,height:n.height/s,top:n.top/s,right:n.right/i,bottom:n.bottom/s,left:n.left/i,x:n.left/i,y:n.top/s}}function My(e){var t=Go(e),n=e.offsetWidth,i=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-i)<=1&&(i=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:i}}function NM(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Sy(n)){var i=t;do{if(i&&e.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function ns(e){return si(e).getComputedStyle(e)}function zN(e){return["table","td","th"].indexOf(ki(e))>=0}function Js(e){return((Xo(e)?e.ownerDocument:e.document)||window.document).documentElement}function Ah(e){return ki(e)==="html"?e:e.assignedSlot||e.parentNode||(Sy(e)?e.host:null)||Js(e)}function mb(e){return!Fn(e)||ns(e).position==="fixed"?null:e.offsetParent}function WN(e){var t=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,n=navigator.userAgent.indexOf("Trident")!==-1;if(n&&Fn(e)){var i=ns(e);if(i.position==="fixed")return null}var s=Ah(e);for(Sy(s)&&(s=s.host);Fn(s)&&["html","body"].indexOf(ki(s))<0;){var r=ns(s);if(r.transform!=="none"||r.perspective!=="none"||r.contain==="paint"||["transform","perspective"].indexOf(r.willChange)!==-1||t&&r.willChange==="filter"||t&&r.filter&&r.filter!=="none")return s;s=s.parentNode}return null}function gc(e){for(var t=si(e),n=mb(e);n&&zN(n)&&ns(n).position==="static";)n=mb(n);return n&&(ki(n)==="html"||ki(n)==="body"&&ns(n).position==="static")?t:n||WN(e)||t}function Cy(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function pl(e,t,n){return Tr(e,Vd(t,n))}function HN(e,t,n){var i=pl(e,t,n);return i>n?n:i}function jM(){return{top:0,right:0,bottom:0,left:0}}function $M(e){return Object.assign({},jM(),e)}function IM(e,t){return t.reduce(function(n,i){return n[i]=e,n},{})}var UN=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,$M(typeof t!="number"?t:IM(t,mc))};function YN(e){var t,n=e.state,i=e.name,s=e.options,r=n.elements.arrow,o=n.modifiersData.popperOffsets,a=xi(n.placement),l=Cy(a),c=[cn,Wn].indexOf(a)>=0,u=c?"height":"width";if(!(!r||!o)){var d=UN(s.padding,n),h=My(r),f=l==="y"?ln:cn,p=l==="y"?zn:Wn,m=n.rects.reference[u]+n.rects.reference[l]-o[l]-n.rects.popper[u],v=o[l]-n.rects.reference[l],y=gc(r),g=y?l==="y"?y.clientHeight||0:y.clientWidth||0:0,x=m/2-v/2,_=d[f],w=g-h[u]-d[p],S=g/2-h[u]/2+x,C=pl(_,S,w),M=l;n.modifiersData[i]=(t={},t[M]=C,t.centerOffset=C-S,t)}}function XN(e){var t=e.state,n=e.options,i=n.element,s=i===void 0?"[data-popper-arrow]":i;s!=null&&(typeof s=="string"&&(s=t.elements.popper.querySelector(s),!s)||NM(t.elements.popper,s)&&(t.elements.arrow=s))}const KN={name:"arrow",enabled:!0,phase:"main",fn:YN,effect:XN,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function qo(e){return e.split("-")[1]}var GN={top:"auto",right:"auto",bottom:"auto",left:"auto"};function qN(e){var t=e.x,n=e.y,i=window,s=i.devicePixelRatio||1;return{x:Ko(t*s)/s||0,y:Ko(n*s)/s||0}}function gb(e){var t,n=e.popper,i=e.popperRect,s=e.placement,r=e.variation,o=e.offsets,a=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,d=e.isFixed,h=o.x,f=h===void 0?0:h,p=o.y,m=p===void 0?0:p,v=typeof u=="function"?u({x:f,y:m}):{x:f,y:m};f=v.x,m=v.y;var y=o.hasOwnProperty("x"),g=o.hasOwnProperty("y"),x=cn,_=ln,w=window;if(c){var S=gc(n),C="clientHeight",M="clientWidth";if(S===si(n)&&(S=Js(n),ns(S).position!=="static"&&a==="absolute"&&(C="scrollHeight",M="scrollWidth")),S=S,s===ln||(s===cn||s===Wn)&&r===Xl){_=zn;var P=d&&S===w&&w.visualViewport?w.visualViewport.height:S[C];m-=P-i.height,m*=l?1:-1}if(s===cn||(s===ln||s===zn)&&r===Xl){x=Wn;var T=d&&S===w&&w.visualViewport?w.visualViewport.width:S[M];f-=T-i.width,f*=l?1:-1}}var A=Object.assign({position:a},c&&GN),E=u===!0?qN({x:f,y:m}):{x:f,y:m};if(f=E.x,m=E.y,l){var z;return Object.assign({},A,(z={},z[_]=g?"0":"",z[x]=y?"0":"",z.transform=(w.devicePixelRatio||1)<=1?"translate("+f+"px, "+m+"px)":"translate3d("+f+"px, "+m+"px, 0)",z))}return Object.assign({},A,(t={},t[_]=g?m+"px":"",t[x]=y?f+"px":"",t.transform="",t))}function QN(e){var t=e.state,n=e.options,i=n.gpuAcceleration,s=i===void 0?!0:i,r=n.adaptive,o=r===void 0?!0:r,a=n.roundOffsets,l=a===void 0?!0:a,c={placement:xi(t.placement),variation:qo(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:s,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,gb(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,gb(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const ZN={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:QN,data:{}};var lu={passive:!0};function JN(e){var t=e.state,n=e.instance,i=e.options,s=i.scroll,r=s===void 0?!0:s,o=i.resize,a=o===void 0?!0:o,l=si(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return r&&c.forEach(function(u){u.addEventListener("scroll",n.update,lu)}),a&&l.addEventListener("resize",n.update,lu),function(){r&&c.forEach(function(u){u.removeEventListener("scroll",n.update,lu)}),a&&l.removeEventListener("resize",n.update,lu)}}const tj={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:JN,data:{}};var ej={left:"right",right:"left",bottom:"top",top:"bottom"};function Ju(e){return e.replace(/left|right|bottom|top/g,function(t){return ej[t]})}var nj={start:"end",end:"start"};function yb(e){return e.replace(/start|end/g,function(t){return nj[t]})}function Py(e){var t=si(e),n=t.pageXOffset,i=t.pageYOffset;return{scrollLeft:n,scrollTop:i}}function Ty(e){return Go(Js(e)).left+Py(e).scrollLeft}function ij(e){var t=si(e),n=Js(e),i=t.visualViewport,s=n.clientWidth,r=n.clientHeight,o=0,a=0;return i&&(s=i.width,r=i.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(o=i.offsetLeft,a=i.offsetTop)),{width:s,height:r,x:o+Ty(e),y:a}}function sj(e){var t,n=Js(e),i=Py(e),s=(t=e.ownerDocument)==null?void 0:t.body,r=Tr(n.scrollWidth,n.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),o=Tr(n.scrollHeight,n.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-i.scrollLeft+Ty(e),l=-i.scrollTop;return ns(s||n).direction==="rtl"&&(a+=Tr(n.clientWidth,s?s.clientWidth:0)-r),{width:r,height:o,x:a,y:l}}function Dy(e){var t=ns(e),n=t.overflow,i=t.overflowX,s=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+s+i)}function FM(e){return["html","body","#document"].indexOf(ki(e))>=0?e.ownerDocument.body:Fn(e)&&Dy(e)?e:FM(Ah(e))}function ml(e,t){var n;t===void 0&&(t=[]);var i=FM(e),s=i===((n=e.ownerDocument)==null?void 0:n.body),r=si(i),o=s?[r].concat(r.visualViewport||[],Dy(i)?i:[]):i,a=t.concat(o);return s?a:a.concat(ml(Ah(o)))}function Dm(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function rj(e){var t=Go(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}function vb(e,t){return t===LM?Dm(ij(e)):Xo(t)?rj(t):Dm(sj(Js(e)))}function oj(e){var t=ml(Ah(e)),n=["absolute","fixed"].indexOf(ns(e).position)>=0,i=n&&Fn(e)?gc(e):e;return Xo(i)?t.filter(function(s){return Xo(s)&&NM(s,i)&&ki(s)!=="body"}):[]}function aj(e,t,n){var i=t==="clippingParents"?oj(e):[].concat(t),s=[].concat(i,[n]),r=s[0],o=s.reduce(function(a,l){var c=vb(e,l);return a.top=Tr(c.top,a.top),a.right=Vd(c.right,a.right),a.bottom=Vd(c.bottom,a.bottom),a.left=Tr(c.left,a.left),a},vb(e,r));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function BM(e){var t=e.reference,n=e.element,i=e.placement,s=i?xi(i):null,r=i?qo(i):null,o=t.x+t.width/2-n.width/2,a=t.y+t.height/2-n.height/2,l;switch(s){case ln:l={x:o,y:t.y-n.height};break;case zn:l={x:o,y:t.y+t.height};break;case Wn:l={x:t.x+t.width,y:a};break;case cn:l={x:t.x-n.width,y:a};break;default:l={x:t.x,y:t.y}}var c=s?Cy(s):null;if(c!=null){var u=c==="y"?"height":"width";switch(r){case Yo:l[c]=l[c]-(t[u]/2-n[u]/2);break;case Xl:l[c]=l[c]+(t[u]/2-n[u]/2);break}}return l}function Kl(e,t){t===void 0&&(t={});var n=t,i=n.placement,s=i===void 0?e.placement:i,r=n.boundary,o=r===void 0?PN:r,a=n.rootBoundary,l=a===void 0?LM:a,c=n.elementContext,u=c===void 0?Sa:c,d=n.altBoundary,h=d===void 0?!1:d,f=n.padding,p=f===void 0?0:f,m=$M(typeof p!="number"?p:IM(p,mc)),v=u===Sa?TN:Sa,y=e.rects.popper,g=e.elements[h?v:u],x=aj(Xo(g)?g:g.contextElement||Js(e.elements.popper),o,l),_=Go(e.elements.reference),w=BM({reference:_,element:y,strategy:"absolute",placement:s}),S=Dm(Object.assign({},y,w)),C=u===Sa?S:_,M={top:x.top-C.top+m.top,bottom:C.bottom-x.bottom+m.bottom,left:x.left-C.left+m.left,right:C.right-x.right+m.right},P=e.modifiersData.offset;if(u===Sa&&P){var T=P[s];Object.keys(M).forEach(function(A){var E=[Wn,zn].indexOf(A)>=0?1:-1,z=[ln,zn].indexOf(A)>=0?"y":"x";M[A]+=T[z]*E})}return M}function lj(e,t){t===void 0&&(t={});var n=t,i=n.placement,s=n.boundary,r=n.rootBoundary,o=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=l===void 0?RM:l,u=qo(i),d=u?a?pb:pb.filter(function(p){return qo(p)===u}):mc,h=d.filter(function(p){return c.indexOf(p)>=0});h.length===0&&(h=d);var f=h.reduce(function(p,m){return p[m]=Kl(e,{placement:m,boundary:s,rootBoundary:r,padding:o})[xi(m)],p},{});return Object.keys(f).sort(function(p,m){return f[p]-f[m]})}function cj(e){if(xi(e)===ky)return[];var t=Ju(e);return[yb(e),t,yb(t)]}function uj(e){var t=e.state,n=e.options,i=e.name;if(!t.modifiersData[i]._skip){for(var s=n.mainAxis,r=s===void 0?!0:s,o=n.altAxis,a=o===void 0?!0:o,l=n.fallbackPlacements,c=n.padding,u=n.boundary,d=n.rootBoundary,h=n.altBoundary,f=n.flipVariations,p=f===void 0?!0:f,m=n.allowedAutoPlacements,v=t.options.placement,y=xi(v),g=y===v,x=l||(g||!p?[Ju(v)]:cj(v)),_=[v].concat(x).reduce(function(Z,O){return Z.concat(xi(O)===ky?lj(t,{placement:O,boundary:u,rootBoundary:d,padding:c,flipVariations:p,allowedAutoPlacements:m}):O)},[]),w=t.rects.reference,S=t.rects.popper,C=new Map,M=!0,P=_[0],T=0;T<_.length;T++){var A=_[T],E=xi(A),z=qo(A)===Yo,N=[ln,zn].indexOf(E)>=0,L=N?"width":"height",R=Kl(t,{placement:A,boundary:u,rootBoundary:d,altBoundary:h,padding:c}),B=N?z?Wn:cn:z?zn:ln;w[L]>S[L]&&(B=Ju(B));var D=Ju(B),$=[];if(r&&$.push(R[E]<=0),a&&$.push(R[B]<=0,R[D]<=0),$.every(function(Z){return Z})){P=A,M=!1;break}C.set(A,$)}if(M)for(var F=p?3:1,V=function(O){var U=_.find(function(lt){var ct=C.get(lt);if(ct)return ct.slice(0,O).every(function(kt){return kt})});if(U)return P=U,"break"},W=F;W>0;W--){var et=V(W);if(et==="break")break}t.placement!==P&&(t.modifiersData[i]._skip=!0,t.placement=P,t.reset=!0)}}const VM={name:"flip",enabled:!0,phase:"main",fn:uj,requiresIfExists:["offset"],data:{_skip:!1}};function xb(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function bb(e){return[ln,Wn,zn,cn].some(function(t){return e[t]>=0})}function dj(e){var t=e.state,n=e.name,i=t.rects.reference,s=t.rects.popper,r=t.modifiersData.preventOverflow,o=Kl(t,{elementContext:"reference"}),a=Kl(t,{altBoundary:!0}),l=xb(o,i),c=xb(a,s,r),u=bb(l),d=bb(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}const hj={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:dj};function fj(e,t,n){var i=xi(e),s=[cn,ln].indexOf(i)>=0?-1:1,r=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,o=r[0],a=r[1];return o=o||0,a=(a||0)*s,[cn,Wn].indexOf(i)>=0?{x:a,y:o}:{x:o,y:a}}function pj(e){var t=e.state,n=e.options,i=e.name,s=n.offset,r=s===void 0?[0,0]:s,o=RM.reduce(function(u,d){return u[d]=fj(d,t.rects,r),u},{}),a=o[t.placement],l=a.x,c=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[i]=o}const mj={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:pj};function gj(e){var t=e.state,n=e.name;t.modifiersData[n]=BM({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const yj={name:"popperOffsets",enabled:!0,phase:"read",fn:gj,data:{}};function vj(e){return e==="x"?"y":"x"}function xj(e){var t=e.state,n=e.options,i=e.name,s=n.mainAxis,r=s===void 0?!0:s,o=n.altAxis,a=o===void 0?!1:o,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,d=n.padding,h=n.tether,f=h===void 0?!0:h,p=n.tetherOffset,m=p===void 0?0:p,v=Kl(t,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),y=xi(t.placement),g=qo(t.placement),x=!g,_=Cy(y),w=vj(_),S=t.modifiersData.popperOffsets,C=t.rects.reference,M=t.rects.popper,P=typeof m=="function"?m(Object.assign({},t.rects,{placement:t.placement})):m,T=typeof P=="number"?{mainAxis:P,altAxis:P}:Object.assign({mainAxis:0,altAxis:0},P),A=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,E={x:0,y:0};if(S){if(r){var z,N=_==="y"?ln:cn,L=_==="y"?zn:Wn,R=_==="y"?"height":"width",B=S[_],D=B+v[N],$=B-v[L],F=f?-M[R]/2:0,V=g===Yo?C[R]:M[R],W=g===Yo?-M[R]:-C[R],et=t.elements.arrow,Z=f&&et?My(et):{width:0,height:0},O=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:jM(),U=O[N],lt=O[L],ct=pl(0,C[R],Z[R]),kt=x?C[R]/2-F-ct-U-T.mainAxis:V-ct-U-T.mainAxis,it=x?-C[R]/2+F+ct+lt+T.mainAxis:W+ct+lt+T.mainAxis,Lt=t.elements.arrow&&gc(t.elements.arrow),Ct=Lt?_==="y"?Lt.clientTop||0:Lt.clientLeft||0:0,Qt=(z=A==null?void 0:A[_])!=null?z:0,ft=B+kt-Qt-Ct,wt=B+it-Qt,dt=pl(f?Vd(D,ft):D,B,f?Tr($,wt):$);S[_]=dt,E[_]=dt-B}if(a){var jt,pt=_==="x"?ln:cn,xt=_==="x"?zn:Wn,J=S[w],mt=w==="y"?"height":"width",q=J+v[pt],ye=J-v[xt],Dt=[ln,cn].indexOf(y)!==-1,he=(jt=A==null?void 0:A[w])!=null?jt:0,Un=Dt?q:J-C[mt]-M[mt]-he+T.altAxis,Yn=Dt?J+C[mt]+M[mt]-he-T.altAxis:ye,Mn=f&&Dt?HN(Un,J,Yn):pl(f?Un:q,J,f?Yn:ye);S[w]=Mn,E[w]=Mn-J}t.modifiersData[i]=E}}const bj={name:"preventOverflow",enabled:!0,phase:"main",fn:xj,requiresIfExists:["offset"]};function _j(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function wj(e){return e===si(e)||!Fn(e)?Py(e):_j(e)}function kj(e){var t=e.getBoundingClientRect(),n=Ko(t.width)/e.offsetWidth||1,i=Ko(t.height)/e.offsetHeight||1;return n!==1||i!==1}function Sj(e,t,n){n===void 0&&(n=!1);var i=Fn(t),s=Fn(t)&&kj(t),r=Js(t),o=Go(e,s),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!n)&&((ki(t)!=="body"||Dy(r))&&(a=wj(t)),Fn(t)?(l=Go(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):r&&(l.x=Ty(r))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function Mj(e){var t=new Map,n=new Set,i=[];e.forEach(function(r){t.set(r.name,r)});function s(r){n.add(r.name);var o=[].concat(r.requires||[],r.requiresIfExists||[]);o.forEach(function(a){if(!n.has(a)){var l=t.get(a);l&&s(l)}}),i.push(r)}return e.forEach(function(r){n.has(r.name)||s(r)}),i}function Cj(e){var t=Mj(e);return IN.reduce(function(n,i){return n.concat(t.filter(function(s){return s.phase===i}))},[])}function Pj(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function Tj(e){var t=e.reduce(function(n,i){var s=n[i.name];return n[i.name]=s?Object.assign({},s,i,{options:Object.assign({},s.options,i.options),data:Object.assign({},s.data,i.data)}):i,n},{});return Object.keys(t).map(function(n){return t[n]})}var _b={placement:"bottom",modifiers:[],strategy:"absolute"};function wb(){for(var e=arguments.length,t=new Array(e),n=0;ne,isStatic:!1,reducedMotion:"never"}),Lh=k.createContext({}),Rh=k.createContext(null),Nh=typeof document<"u",Ey=Nh?k.useLayoutEffect:k.useEffect,WM=k.createContext({strict:!1}),Ay=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),Fj="framerAppearId",HM="data-"+Ay(Fj);function Bj(e,t,n,i){const{visualElement:s}=k.useContext(Lh),r=k.useContext(WM),o=k.useContext(Rh),a=k.useContext(zM).reducedMotion,l=k.useRef();i=i||r.renderer,!l.current&&i&&(l.current=i(e,{visualState:t,parent:s,props:n,presenceContext:o,blockInitialAnimation:o?o.initial===!1:!1,reducedMotionConfig:a}));const c=l.current;k.useInsertionEffect(()=>{c&&c.update(n,o)});const u=k.useRef(!!(n[HM]&&!window.HandoffComplete));return Ey(()=>{c&&(c.render(),u.current&&c.animationState&&c.animationState.animateChanges())}),k.useEffect(()=>{c&&(c.updateFeatures(),!u.current&&c.animationState&&c.animationState.animateChanges(),u.current&&(u.current=!1,window.HandoffComplete=!0))}),c}function _o(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Vj(e,t,n){return k.useCallback(i=>{i&&e.mount&&e.mount(i),t&&(i?t.mount(i):t.unmount()),n&&(typeof n=="function"?n(i):_o(n)&&(n.current=i))},[t])}function Gl(e){return typeof e=="string"||Array.isArray(e)}function jh(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const Oy=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ly=["initial",...Oy];function $h(e){return jh(e.animate)||Ly.some(t=>Gl(e[t]))}function UM(e){return!!($h(e)||e.variants)}function zj(e,t){if($h(e)){const{initial:n,animate:i}=e;return{initial:n===!1||Gl(n)?n:void 0,animate:Gl(i)?i:void 0}}return e.inherit!==!1?t:{}}function Wj(e){const{initial:t,animate:n}=zj(e,k.useContext(Lh));return k.useMemo(()=>({initial:t,animate:n}),[kb(t),kb(n)])}function kb(e){return Array.isArray(e)?e.join(" "):e}const Sb={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},ql={};for(const e in Sb)ql[e]={isEnabled:t=>Sb[e].some(n=>!!t[n])};function Hj(e){for(const t in e)ql[t]={...ql[t],...e[t]}}const Ry=k.createContext({}),YM=k.createContext({}),Uj=Symbol.for("motionComponentSymbol");function Yj({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:i,Component:s}){e&&Hj(e);function r(a,l){let c;const u={...k.useContext(zM),...a,layoutId:Xj(a)},{isStatic:d}=u,h=Wj(a),f=i(a,d);if(!d&&Nh){h.visualElement=Bj(s,f,u,t);const p=k.useContext(YM),m=k.useContext(WM).strict;h.visualElement&&(c=h.visualElement.loadFeatures(u,m,e,p))}return k.createElement(Lh.Provider,{value:h},c&&h.visualElement?k.createElement(c,{visualElement:h.visualElement,...u}):null,n(s,a,Vj(f,h.visualElement,l),f,d,h.visualElement))}const o=k.forwardRef(r);return o[Uj]=s,o}function Xj({layoutId:e}){const t=k.useContext(Ry).id;return t&&e!==void 0?t+"-"+e:e}function Kj(e){function t(i,s={}){return Yj(e(i,s))}if(typeof Proxy>"u")return t;const n=new Map;return new Proxy(t,{get:(i,s)=>(n.has(s)||n.set(s,t(s)),n.get(s))})}const Gj=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Ny(e){return typeof e!="string"||e.includes("-")?!1:!!(Gj.indexOf(e)>-1||/[A-Z]/.test(e))}const zd={};function qj(e){Object.assign(zd,e)}const yc=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ur=new Set(yc);function XM(e,{layout:t,layoutId:n}){return Ur.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!zd[e]||e==="opacity")}const un=e=>!!(e&&e.getVelocity),Qj={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Zj=yc.length;function Jj(e,{enableHardwareAcceleration:t=!0,allowTransformNone:n=!0},i,s){let r="";for(let o=0;ot=>typeof t=="string"&&t.startsWith(e),GM=KM("--"),Em=KM("var(--"),t$=/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,e$=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Hs=(e,t,n)=>Math.min(Math.max(n,e),t),Yr={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},gl={...Yr,transform:e=>Hs(0,1,e)},cu={...Yr,default:1},yl=e=>Math.round(e*1e5)/1e5,Ih=/(-)?([\d]*\.?[\d])+/g,qM=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,n$=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function vc(e){return typeof e=="string"}const xc=e=>({test:t=>vc(t)&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),ps=xc("deg"),bi=xc("%"),st=xc("px"),i$=xc("vh"),s$=xc("vw"),Mb={...bi,parse:e=>bi.parse(e)/100,transform:e=>bi.transform(e*100)},Cb={...Yr,transform:Math.round},QM={borderWidth:st,borderTopWidth:st,borderRightWidth:st,borderBottomWidth:st,borderLeftWidth:st,borderRadius:st,radius:st,borderTopLeftRadius:st,borderTopRightRadius:st,borderBottomRightRadius:st,borderBottomLeftRadius:st,width:st,maxWidth:st,height:st,maxHeight:st,size:st,top:st,right:st,bottom:st,left:st,padding:st,paddingTop:st,paddingRight:st,paddingBottom:st,paddingLeft:st,margin:st,marginTop:st,marginRight:st,marginBottom:st,marginLeft:st,rotate:ps,rotateX:ps,rotateY:ps,rotateZ:ps,scale:cu,scaleX:cu,scaleY:cu,scaleZ:cu,skew:ps,skewX:ps,skewY:ps,distance:st,translateX:st,translateY:st,translateZ:st,x:st,y:st,z:st,perspective:st,transformPerspective:st,opacity:gl,originX:Mb,originY:Mb,originZ:st,zIndex:Cb,fillOpacity:gl,strokeOpacity:gl,numOctaves:Cb};function jy(e,t,n,i){const{style:s,vars:r,transform:o,transformOrigin:a}=e;let l=!1,c=!1,u=!0;for(const d in t){const h=t[d];if(GM(d)){r[d]=h;continue}const f=QM[d],p=e$(h,f);if(Ur.has(d)){if(l=!0,o[d]=p,!u)continue;h!==(f.default||0)&&(u=!1)}else d.startsWith("origin")?(c=!0,a[d]=p):s[d]=p}if(t.transform||(l||i?s.transform=Jj(e.transform,n,u,i):s.transform&&(s.transform="none")),c){const{originX:d="50%",originY:h="50%",originZ:f=0}=a;s.transformOrigin=`${d} ${h} ${f}`}}const $y=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function ZM(e,t,n){for(const i in t)!un(t[i])&&!XM(i,n)&&(e[i]=t[i])}function r$({transformTemplate:e},t,n){return k.useMemo(()=>{const i=$y();return jy(i,t,{enableHardwareAcceleration:!n},e),Object.assign({},i.vars,i.style)},[t])}function o$(e,t,n){const i=e.style||{},s={};return ZM(s,i,e),Object.assign(s,r$(e,t,n)),e.transformValues?e.transformValues(s):s}function a$(e,t,n){const i={},s=o$(e,t,n);return e.drag&&e.dragListener!==!1&&(i.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(i.tabIndex=0),i.style=s,i}const l$=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Wd(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||l$.has(e)}let JM=e=>!Wd(e);function c$(e){e&&(JM=t=>t.startsWith("on")?!Wd(t):e(t))}try{c$(require("@emotion/is-prop-valid").default)}catch{}function u$(e,t,n){const i={};for(const s in e)s==="values"&&typeof e.values=="object"||(JM(s)||n===!0&&Wd(s)||!t&&!Wd(s)||e.draggable&&s.startsWith("onDrag"))&&(i[s]=e[s]);return i}function Pb(e,t,n){return typeof e=="string"?e:st.transform(t+n*e)}function d$(e,t,n){const i=Pb(t,e.x,e.width),s=Pb(n,e.y,e.height);return`${i} ${s}`}const h$={offset:"stroke-dashoffset",array:"stroke-dasharray"},f$={offset:"strokeDashoffset",array:"strokeDasharray"};function p$(e,t,n=1,i=0,s=!0){e.pathLength=1;const r=s?h$:f$;e[r.offset]=st.transform(-i);const o=st.transform(t),a=st.transform(n);e[r.array]=`${o} ${a}`}function Iy(e,{attrX:t,attrY:n,attrScale:i,originX:s,originY:r,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...c},u,d,h){if(jy(e,c,u,h),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:p,dimensions:m}=e;f.transform&&(m&&(p.transform=f.transform),delete f.transform),m&&(s!==void 0||r!==void 0||p.transform)&&(p.transformOrigin=d$(m,s!==void 0?s:.5,r!==void 0?r:.5)),t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),i!==void 0&&(f.scale=i),o!==void 0&&p$(f,o,a,l,!1)}const tC=()=>({...$y(),attrs:{}}),Fy=e=>typeof e=="string"&&e.toLowerCase()==="svg";function m$(e,t,n,i){const s=k.useMemo(()=>{const r=tC();return Iy(r,t,{enableHardwareAcceleration:!1},Fy(i),e.transformTemplate),{...r.attrs,style:{...r.style}}},[t]);if(e.style){const r={};ZM(r,e.style,e),s.style={...r,...s.style}}return s}function g$(e=!1){return(n,i,s,{latestValues:r},o)=>{const l=(Ny(n)?m$:a$)(i,r,o,n),u={...u$(i,typeof n=="string",e),...l,ref:s},{children:d}=i,h=k.useMemo(()=>un(d)?d.get():d,[d]);return k.createElement(n,{...u,children:h})}}function eC(e,{style:t,vars:n},i,s){Object.assign(e.style,t,s&&s.getProjectionStyles(i));for(const r in n)e.style.setProperty(r,n[r])}const nC=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function iC(e,t,n,i){eC(e,t,void 0,i);for(const s in t.attrs)e.setAttribute(nC.has(s)?s:Ay(s),t.attrs[s])}function By(e,t){const{style:n}=e,i={};for(const s in n)(un(n[s])||t.style&&un(t.style[s])||XM(s,e))&&(i[s]=n[s]);return i}function sC(e,t){const n=By(e,t);for(const i in e)if(un(e[i])||un(t[i])){const s=yc.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;n[s]=e[i]}return n}function Vy(e,t,n,i={},s={}){return typeof t=="function"&&(t=t(n!==void 0?n:e.custom,i,s)),typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"&&(t=t(n!==void 0?n:e.custom,i,s)),t}function rC(e){const t=k.useRef(null);return t.current===null&&(t.current=e()),t.current}const Hd=e=>Array.isArray(e),y$=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),v$=e=>Hd(e)?e[e.length-1]||0:e;function ed(e){const t=un(e)?e.get():e;return y$(t)?t.toValue():t}function x$({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},i,s,r){const o={latestValues:b$(i,s,r,e),renderState:t()};return n&&(o.mount=a=>n(i,a,o)),o}const oC=e=>(t,n)=>{const i=k.useContext(Lh),s=k.useContext(Rh),r=()=>x$(e,t,i,s);return n?r():rC(r)};function b$(e,t,n,i){const s={},r=i(e,{});for(const h in r)s[h]=ed(r[h]);let{initial:o,animate:a}=e;const l=$h(e),c=UM(e);t&&c&&!l&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||o===!1;const d=u?a:o;return d&&typeof d!="boolean"&&!jh(d)&&(Array.isArray(d)?d:[d]).forEach(f=>{const p=Vy(e,f);if(!p)return;const{transitionEnd:m,transition:v,...y}=p;for(const g in y){let x=y[g];if(Array.isArray(x)){const _=u?x.length-1:0;x=x[_]}x!==null&&(s[g]=x)}for(const g in m)s[g]=m[g]}),s}const ce=e=>e;class Tb{constructor(){this.order=[],this.scheduled=new Set}add(t){if(!this.scheduled.has(t))return this.scheduled.add(t),this.order.push(t),!0}remove(t){const n=this.order.indexOf(t);n!==-1&&(this.order.splice(n,1),this.scheduled.delete(t))}clear(){this.order.length=0,this.scheduled.clear()}}function _$(e){let t=new Tb,n=new Tb,i=0,s=!1,r=!1;const o=new WeakSet,a={schedule:(l,c=!1,u=!1)=>{const d=u&&s,h=d?t:n;return c&&o.add(l),h.add(l)&&d&&s&&(i=t.order.length),l},cancel:l=>{n.remove(l),o.delete(l)},process:l=>{if(s){r=!0;return}if(s=!0,[t,n]=[n,t],n.clear(),i=t.order.length,i)for(let c=0;c(d[h]=_$(()=>n=!0),d),{}),o=d=>r[d].process(s),a=()=>{const d=performance.now();n=!1,s.delta=i?1e3/60:Math.max(Math.min(d-s.timestamp,w$),1),s.timestamp=d,s.isProcessing=!0,uu.forEach(o),s.isProcessing=!1,n&&t&&(i=!1,e(a))},l=()=>{n=!0,i=!0,s.isProcessing||e(a)};return{schedule:uu.reduce((d,h)=>{const f=r[h];return d[h]=(p,m=!1,v=!1)=>(n||l(),f.schedule(p,m,v)),d},{}),cancel:d=>uu.forEach(h=>r[h].cancel(d)),state:s,steps:r}}const{schedule:zt,cancel:is,state:je,steps:Uf}=k$(typeof requestAnimationFrame<"u"?requestAnimationFrame:ce,!0),S$={useVisualState:oC({scrapeMotionValuesFromProps:sC,createRenderState:tC,onMount:(e,t,{renderState:n,latestValues:i})=>{zt.read(()=>{try{n.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}}),zt.render(()=>{Iy(n,i,{enableHardwareAcceleration:!1},Fy(t.tagName),e.transformTemplate),iC(t,n)})}})},M$={useVisualState:oC({scrapeMotionValuesFromProps:By,createRenderState:$y})};function C$(e,{forwardMotionProps:t=!1},n,i){return{...Ny(e)?S$:M$,preloadedFeatures:n,useRender:g$(t),createVisualElement:i,Component:e}}function Hi(e,t,n,i={passive:!0}){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n)}const aC=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function Fh(e,t="page"){return{point:{x:e[t+"X"],y:e[t+"Y"]}}}const P$=e=>t=>aC(t)&&e(t,Fh(t));function qi(e,t,n,i){return Hi(e,t,P$(n),i)}const T$=(e,t)=>n=>t(e(n)),Is=(...e)=>e.reduce(T$);function lC(e){let t=null;return()=>{const n=()=>{t=null};return t===null?(t=e,n):!1}}const Db=lC("dragHorizontal"),Eb=lC("dragVertical");function cC(e){let t=!1;if(e==="y")t=Eb();else if(e==="x")t=Db();else{const n=Db(),i=Eb();n&&i?t=()=>{n(),i()}:(n&&n(),i&&i())}return t}function uC(){const e=cC(!0);return e?(e(),!1):!0}class tr{constructor(t){this.isMounted=!1,this.node=t}update(){}}function Ab(e,t){const n="pointer"+(t?"enter":"leave"),i="onHover"+(t?"Start":"End"),s=(r,o)=>{if(r.pointerType==="touch"||uC())return;const a=e.getProps();e.animationState&&a.whileHover&&e.animationState.setActive("whileHover",t),a[i]&&zt.update(()=>a[i](r,o))};return qi(e.current,n,s,{passive:!e.getProps()[i]})}class D$ extends tr{mount(){this.unmount=Is(Ab(this.node,!0),Ab(this.node,!1))}unmount(){}}class E$ extends tr{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Is(Hi(this.node.current,"focus",()=>this.onFocus()),Hi(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const dC=(e,t)=>t?e===t?!0:dC(e,t.parentElement):!1;function Yf(e,t){if(!t)return;const n=new PointerEvent("pointer"+e);t(n,Fh(n))}class A$ extends tr{constructor(){super(...arguments),this.removeStartListeners=ce,this.removeEndListeners=ce,this.removeAccessibleListeners=ce,this.startPointerPress=(t,n)=>{if(this.isPressing)return;this.removeEndListeners();const i=this.node.getProps(),r=qi(window,"pointerup",(a,l)=>{if(!this.checkPressEnd())return;const{onTap:c,onTapCancel:u,globalTapTarget:d}=this.node.getProps();zt.update(()=>{!d&&!dC(this.node.current,a.target)?u&&u(a,l):c&&c(a,l)})},{passive:!(i.onTap||i.onPointerUp)}),o=qi(window,"pointercancel",(a,l)=>this.cancelPress(a,l),{passive:!(i.onTapCancel||i.onPointerCancel)});this.removeEndListeners=Is(r,o),this.startPress(t,n)},this.startAccessiblePress=()=>{const t=r=>{if(r.key!=="Enter"||this.isPressing)return;const o=a=>{a.key!=="Enter"||!this.checkPressEnd()||Yf("up",(l,c)=>{const{onTap:u}=this.node.getProps();u&&zt.update(()=>u(l,c))})};this.removeEndListeners(),this.removeEndListeners=Hi(this.node.current,"keyup",o),Yf("down",(a,l)=>{this.startPress(a,l)})},n=Hi(this.node.current,"keydown",t),i=()=>{this.isPressing&&Yf("cancel",(r,o)=>this.cancelPress(r,o))},s=Hi(this.node.current,"blur",i);this.removeAccessibleListeners=Is(n,s)}}startPress(t,n){this.isPressing=!0;const{onTapStart:i,whileTap:s}=this.node.getProps();s&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),i&&zt.update(()=>i(t,n))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!uC()}cancelPress(t,n){if(!this.checkPressEnd())return;const{onTapCancel:i}=this.node.getProps();i&&zt.update(()=>i(t,n))}mount(){const t=this.node.getProps(),n=qi(t.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),i=Hi(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=Is(n,i)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const Am=new WeakMap,Xf=new WeakMap,O$=e=>{const t=Am.get(e.target);t&&t(e)},L$=e=>{e.forEach(O$)};function R$({root:e,...t}){const n=e||document;Xf.has(n)||Xf.set(n,{});const i=Xf.get(n),s=JSON.stringify(t);return i[s]||(i[s]=new IntersectionObserver(L$,{root:e,...t})),i[s]}function N$(e,t,n){const i=R$(t);return Am.set(e,n),i.observe(e),()=>{Am.delete(e),i.unobserve(e)}}const j$={some:0,all:1};class $$ extends tr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:i,amount:s="some",once:r}=t,o={root:n?n.current:void 0,rootMargin:i,threshold:typeof s=="number"?s:j$[s]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,r&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:d}=this.node.getProps(),h=c?u:d;h&&h(l)};return N$(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(I$(t,n))&&this.startObserver()}unmount(){}}function I$({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const F$={inView:{Feature:$$},tap:{Feature:A$},focus:{Feature:E$},hover:{Feature:D$}};function hC(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let i=0;it[i]=n.get()),t}function V$(e){const t={};return e.values.forEach((n,i)=>t[i]=n.getVelocity()),t}function Bh(e,t,n){const i=e.getProps();return Vy(i,t,n!==void 0?n:i.custom,B$(e),V$(e))}let zy=ce;const Dr=e=>e*1e3,Qi=e=>e/1e3,z$={current:!1},fC=e=>Array.isArray(e)&&typeof e[0]=="number";function pC(e){return!!(!e||typeof e=="string"&&mC[e]||fC(e)||Array.isArray(e)&&e.every(pC))}const Qa=([e,t,n,i])=>`cubic-bezier(${e}, ${t}, ${n}, ${i})`,mC={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Qa([0,.65,.55,1]),circOut:Qa([.55,0,1,.45]),backIn:Qa([.31,.01,.66,-.59]),backOut:Qa([.33,1.53,.69,.99])};function gC(e){if(e)return fC(e)?Qa(e):Array.isArray(e)?e.map(gC):mC[e]}function W$(e,t,n,{delay:i=0,duration:s,repeat:r=0,repeatType:o="loop",ease:a,times:l}={}){const c={[t]:n};l&&(c.offset=l);const u=gC(a);return Array.isArray(u)&&(c.easing=u),e.animate(c,{delay:i,duration:s,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:r+1,direction:o==="reverse"?"alternate":"normal"})}function H$(e,{repeat:t,repeatType:n="loop"}){const i=t&&n!=="loop"&&t%2===1?0:e.length-1;return e[i]}const yC=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,U$=1e-7,Y$=12;function X$(e,t,n,i,s){let r,o,a=0;do o=t+(n-t)/2,r=yC(o,i,s)-e,r>0?n=o:t=o;while(Math.abs(r)>U$&&++aX$(r,0,1,e,n);return r=>r===0||r===1?r:yC(s(r),t,i)}const K$=bc(.42,0,1,1),G$=bc(0,0,.58,1),vC=bc(.42,0,.58,1),q$=e=>Array.isArray(e)&&typeof e[0]!="number",xC=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,bC=e=>t=>1-e(1-t),Wy=e=>1-Math.sin(Math.acos(e)),_C=bC(Wy),Q$=xC(Wy),wC=bc(.33,1.53,.69,.99),Hy=bC(wC),Z$=xC(Hy),J$=e=>(e*=2)<1?.5*Hy(e):.5*(2-Math.pow(2,-10*(e-1))),tI={linear:ce,easeIn:K$,easeInOut:vC,easeOut:G$,circIn:Wy,circInOut:Q$,circOut:_C,backIn:Hy,backInOut:Z$,backOut:wC,anticipate:J$},Ob=e=>{if(Array.isArray(e)){zy(e.length===4);const[t,n,i,s]=e;return bc(t,n,i,s)}else if(typeof e=="string")return tI[e];return e},Uy=(e,t)=>n=>!!(vc(n)&&n$.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),kC=(e,t,n)=>i=>{if(!vc(i))return i;const[s,r,o,a]=i.match(Ih);return{[e]:parseFloat(s),[t]:parseFloat(r),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},eI=e=>Hs(0,255,e),Kf={...Yr,transform:e=>Math.round(eI(e))},kr={test:Uy("rgb","red"),parse:kC("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:i=1})=>"rgba("+Kf.transform(e)+", "+Kf.transform(t)+", "+Kf.transform(n)+", "+yl(gl.transform(i))+")"};function nI(e){let t="",n="",i="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),i=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),i=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,i+=i,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}}const Om={test:Uy("#"),parse:nI,transform:kr.transform},wo={test:Uy("hsl","hue"),parse:kC("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:i=1})=>"hsla("+Math.round(e)+", "+bi.transform(yl(t))+", "+bi.transform(yl(n))+", "+yl(gl.transform(i))+")"},We={test:e=>kr.test(e)||Om.test(e)||wo.test(e),parse:e=>kr.test(e)?kr.parse(e):wo.test(e)?wo.parse(e):Om.parse(e),transform:e=>vc(e)?e:e.hasOwnProperty("red")?kr.transform(e):wo.transform(e)},ee=(e,t,n)=>-n*e+n*t+e;function Gf(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function iI({hue:e,saturation:t,lightness:n,alpha:i}){e/=360,t/=100,n/=100;let s=0,r=0,o=0;if(!t)s=r=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;s=Gf(l,a,e+1/3),r=Gf(l,a,e),o=Gf(l,a,e-1/3)}return{red:Math.round(s*255),green:Math.round(r*255),blue:Math.round(o*255),alpha:i}}const qf=(e,t,n)=>{const i=e*e;return Math.sqrt(Math.max(0,n*(t*t-i)+i))},sI=[Om,kr,wo],rI=e=>sI.find(t=>t.test(e));function Lb(e){const t=rI(e);let n=t.parse(e);return t===wo&&(n=iI(n)),n}const SC=(e,t)=>{const n=Lb(e),i=Lb(t),s={...n};return r=>(s.red=qf(n.red,i.red,r),s.green=qf(n.green,i.green,r),s.blue=qf(n.blue,i.blue,r),s.alpha=ee(n.alpha,i.alpha,r),kr.transform(s))};function oI(e){var t,n;return isNaN(e)&&vc(e)&&(((t=e.match(Ih))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(qM))===null||n===void 0?void 0:n.length)||0)>0}const MC={regex:t$,countKey:"Vars",token:"${v}",parse:ce},CC={regex:qM,countKey:"Colors",token:"${c}",parse:We.parse},PC={regex:Ih,countKey:"Numbers",token:"${n}",parse:Yr.parse};function Qf(e,{regex:t,countKey:n,token:i,parse:s}){const r=e.tokenised.match(t);r&&(e["num"+n]=r.length,e.tokenised=e.tokenised.replace(t,i),e.values.push(...r.map(s)))}function Ud(e){const t=e.toString(),n={value:t,tokenised:t,values:[],numVars:0,numColors:0,numNumbers:0};return n.value.includes("var(--")&&Qf(n,MC),Qf(n,CC),Qf(n,PC),n}function TC(e){return Ud(e).values}function DC(e){const{values:t,numColors:n,numVars:i,tokenised:s}=Ud(e),r=t.length;return o=>{let a=s;for(let l=0;ltypeof e=="number"?0:e;function lI(e){const t=TC(e);return DC(e)(t.map(aI))}const Us={test:oI,parse:TC,createTransformer:DC,getAnimatableNone:lI},EC=(e,t)=>n=>`${n>0?t:e}`;function AC(e,t){return typeof e=="number"?n=>ee(e,t,n):We.test(e)?SC(e,t):e.startsWith("var(")?EC(e,t):LC(e,t)}const OC=(e,t)=>{const n=[...e],i=n.length,s=e.map((r,o)=>AC(r,t[o]));return r=>{for(let o=0;o{const n={...e,...t},i={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(i[s]=AC(e[s],t[s]));return s=>{for(const r in i)n[r]=i[r](s);return n}},LC=(e,t)=>{const n=Us.createTransformer(t),i=Ud(e),s=Ud(t);return i.numVars===s.numVars&&i.numColors===s.numColors&&i.numNumbers>=s.numNumbers?Is(OC(i.values,s.values),n):EC(e,t)},Ql=(e,t,n)=>{const i=t-e;return i===0?1:(n-e)/i},Rb=(e,t)=>n=>ee(e,t,n);function uI(e){return typeof e=="number"?Rb:typeof e=="string"?We.test(e)?SC:LC:Array.isArray(e)?OC:typeof e=="object"?cI:Rb}function dI(e,t,n){const i=[],s=n||uI(e[0]),r=e.length-1;for(let o=0;ot[0];e[0]>e[r-1]&&(e=[...e].reverse(),t=[...t].reverse());const o=dI(t,i,s),a=o.length,l=c=>{let u=0;if(a>1)for(;ul(Hs(e[0],e[r-1],c)):l}function hI(e,t){const n=e[e.length-1];for(let i=1;i<=t;i++){const s=Ql(0,t,i);e.push(ee(n,1,s))}}function fI(e){const t=[0];return hI(t,e.length-1),t}function pI(e,t){return e.map(n=>n*t)}function mI(e,t){return e.map(()=>t||vC).splice(0,e.length-1)}function Yd({duration:e=300,keyframes:t,times:n,ease:i="easeInOut"}){const s=q$(i)?i.map(Ob):Ob(i),r={done:!1,value:t[0]},o=pI(n&&n.length===t.length?n:fI(t),e),a=RC(o,t,{ease:Array.isArray(s)?s:mI(t,s)});return{calculatedDuration:e,next:l=>(r.value=a(l),r.done=l>=e,r)}}function NC(e,t){return t?e*(1e3/t):0}const gI=5;function jC(e,t,n){const i=Math.max(t-gI,0);return NC(n-e(i),t-i)}const Zf=.001,yI=.01,vI=10,xI=.05,bI=1;function _I({duration:e=800,bounce:t=.25,velocity:n=0,mass:i=1}){let s,r,o=1-t;o=Hs(xI,bI,o),e=Hs(yI,vI,Qi(e)),o<1?(s=c=>{const u=c*o,d=u*e,h=u-n,f=Lm(c,o),p=Math.exp(-d);return Zf-h/f*p},r=c=>{const d=c*o*e,h=d*n+n,f=Math.pow(o,2)*Math.pow(c,2)*e,p=Math.exp(-d),m=Lm(Math.pow(c,2),o);return(-s(c)+Zf>0?-1:1)*((h-f)*p)/m}):(s=c=>{const u=Math.exp(-c*e),d=(c-n)*e+1;return-Zf+u*d},r=c=>{const u=Math.exp(-c*e),d=(n-c)*(e*e);return u*d});const a=5/e,l=kI(s,r,a);if(e=Dr(e),isNaN(l))return{stiffness:100,damping:10,duration:e};{const c=Math.pow(l,2)*i;return{stiffness:c,damping:o*2*Math.sqrt(i*c),duration:e}}}const wI=12;function kI(e,t,n){let i=n;for(let s=1;se[n]!==void 0)}function CI(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!Nb(e,MI)&&Nb(e,SI)){const n=_I(e);t={...t,...n,mass:1},t.isResolvedFromDuration=!0}return t}function $C({keyframes:e,restDelta:t,restSpeed:n,...i}){const s=e[0],r=e[e.length-1],o={done:!1,value:s},{stiffness:a,damping:l,mass:c,duration:u,velocity:d,isResolvedFromDuration:h}=CI({...i,velocity:-Qi(i.velocity||0)}),f=d||0,p=l/(2*Math.sqrt(a*c)),m=r-s,v=Qi(Math.sqrt(a/c)),y=Math.abs(m)<5;n||(n=y?.01:2),t||(t=y?.005:.5);let g;if(p<1){const x=Lm(v,p);g=_=>{const w=Math.exp(-p*v*_);return r-w*((f+p*v*m)/x*Math.sin(x*_)+m*Math.cos(x*_))}}else if(p===1)g=x=>r-Math.exp(-v*x)*(m+(f+v*m)*x);else{const x=v*Math.sqrt(p*p-1);g=_=>{const w=Math.exp(-p*v*_),S=Math.min(x*_,300);return r-w*((f+p*v*m)*Math.sinh(S)+x*m*Math.cosh(S))/x}}return{calculatedDuration:h&&u||null,next:x=>{const _=g(x);if(h)o.done=x>=u;else{let w=f;x!==0&&(p<1?w=jC(g,x,_):w=0);const S=Math.abs(w)<=n,C=Math.abs(r-_)<=t;o.done=S&&C}return o.value=o.done?r:_,o}}}function jb({keyframes:e,velocity:t=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:u}){const d=e[0],h={done:!1,value:d},f=M=>a!==void 0&&Ml,p=M=>a===void 0?l:l===void 0||Math.abs(a-M)-m*Math.exp(-M/i),x=M=>y+g(M),_=M=>{const P=g(M),T=x(M);h.done=Math.abs(P)<=c,h.value=h.done?y:T};let w,S;const C=M=>{f(h.value)&&(w=M,S=$C({keyframes:[h.value,p(h.value)],velocity:jC(x,M,h.value),damping:s,stiffness:r,restDelta:c,restSpeed:u}))};return C(0),{calculatedDuration:null,next:M=>{let P=!1;return!S&&w===void 0&&(P=!0,_(M),C(M)),w!==void 0&&M>w?S.next(M-w):(!P&&_(M),h)}}}const PI=e=>{const t=({timestamp:n})=>e(n);return{start:()=>zt.update(t,!0),stop:()=>is(t),now:()=>je.isProcessing?je.timestamp:performance.now()}},$b=2e4;function Ib(e){let t=0;const n=50;let i=e.next(t);for(;!i.done&&t<$b;)t+=n,i=e.next(t);return t>=$b?1/0:t}const TI={decay:jb,inertia:jb,tween:Yd,keyframes:Yd,spring:$C};function Xd({autoplay:e=!0,delay:t=0,driver:n=PI,keyframes:i,type:s="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:a="loop",onPlay:l,onStop:c,onComplete:u,onUpdate:d,...h}){let f=1,p=!1,m,v;const y=()=>{v=new Promise(V=>{m=V})};y();let g;const x=TI[s]||Yd;let _;x!==Yd&&typeof i[0]!="number"&&(_=RC([0,100],i,{clamp:!1}),i=[0,100]);const w=x({...h,keyframes:i});let S;a==="mirror"&&(S=x({...h,keyframes:[...i].reverse(),velocity:-(h.velocity||0)}));let C="idle",M=null,P=null,T=null;w.calculatedDuration===null&&r&&(w.calculatedDuration=Ib(w));const{calculatedDuration:A}=w;let E=1/0,z=1/0;A!==null&&(E=A+o,z=E*(r+1)-o);let N=0;const L=V=>{if(P===null)return;f>0&&(P=Math.min(P,V)),f<0&&(P=Math.min(V-z/f,P)),M!==null?N=M:N=Math.round(V-P)*f;const W=N-t*(f>=0?1:-1),et=f>=0?W<0:W>z;N=Math.max(W,0),C==="finished"&&M===null&&(N=z);let Z=N,O=w;if(r){const kt=Math.min(N,z)/E;let it=Math.floor(kt),Lt=kt%1;!Lt&&kt>=1&&(Lt=1),Lt===1&&it--,it=Math.min(it,r+1),!!(it%2)&&(a==="reverse"?(Lt=1-Lt,o&&(Lt-=o/E)):a==="mirror"&&(O=S)),Z=Hs(0,1,Lt)*E}const U=et?{done:!1,value:i[0]}:O.next(Z);_&&(U.value=_(U.value));let{done:lt}=U;!et&&A!==null&&(lt=f>=0?N>=z:N<=0);const ct=M===null&&(C==="finished"||C==="running"&<);return d&&d(U.value),ct&&D(),U},R=()=>{g&&g.stop(),g=void 0},B=()=>{C="idle",R(),m(),y(),P=T=null},D=()=>{C="finished",u&&u(),R(),m()},$=()=>{if(p)return;g||(g=n(L));const V=g.now();l&&l(),M!==null?P=V-M:(!P||C==="finished")&&(P=V),C==="finished"&&y(),T=P,M=null,C="running",g.start()};e&&$();const F={then(V,W){return v.then(V,W)},get time(){return Qi(N)},set time(V){V=Dr(V),N=V,M!==null||!g||f===0?M=V:P=g.now()-V/f},get duration(){const V=w.calculatedDuration===null?Ib(w):w.calculatedDuration;return Qi(V)},get speed(){return f},set speed(V){V===f||!g||(f=V,F.time=Qi(N))},get state(){return C},play:$,pause:()=>{C="paused",M=N},stop:()=>{p=!0,C!=="idle"&&(C="idle",c&&c(),B())},cancel:()=>{T!==null&&L(T),B()},complete:()=>{C="finished"},sample:V=>(P=0,L(V))};return F}function DI(e){let t;return()=>(t===void 0&&(t=e()),t)}const EI=DI(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),AI=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),du=10,OI=2e4,LI=(e,t)=>t.type==="spring"||e==="backgroundColor"||!pC(t.ease);function RI(e,t,{onUpdate:n,onComplete:i,...s}){if(!(EI()&&AI.has(t)&&!s.repeatDelay&&s.repeatType!=="mirror"&&s.damping!==0&&s.type!=="inertia"))return!1;let o=!1,a,l,c=!1;const u=()=>{l=new Promise(x=>{a=x})};u();let{keyframes:d,duration:h=300,ease:f,times:p}=s;if(LI(t,s)){const x=Xd({...s,repeat:0,delay:0});let _={done:!1,value:d[0]};const w=[];let S=0;for(;!_.done&&S{c=!1,m.cancel()},y=()=>{c=!0,zt.update(v),a(),u()};return m.onfinish=()=>{c||(e.set(H$(d,s)),i&&i(),y())},{then(x,_){return l.then(x,_)},attachTimeline(x){return m.timeline=x,m.onfinish=null,ce},get time(){return Qi(m.currentTime||0)},set time(x){m.currentTime=Dr(x)},get speed(){return m.playbackRate},set speed(x){m.playbackRate=x},get duration(){return Qi(h)},play:()=>{o||(m.play(),is(v))},pause:()=>m.pause(),stop:()=>{if(o=!0,m.playState==="idle")return;const{currentTime:x}=m;if(x){const _=Xd({...s,autoplay:!1});e.setWithVelocity(_.sample(x-du).value,_.sample(x).value,du)}y()},complete:()=>{c||m.finish()},cancel:y}}function NI({keyframes:e,delay:t,onUpdate:n,onComplete:i}){const s=()=>(n&&n(e[e.length-1]),i&&i(),{time:0,speed:1,duration:0,play:ce,pause:ce,stop:ce,then:r=>(r(),Promise.resolve()),cancel:ce,complete:ce});return t?Xd({keyframes:[0,1],duration:0,delay:t,onComplete:s}):s()}const jI={type:"spring",stiffness:500,damping:25,restSpeed:10},$I=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),II={type:"keyframes",duration:.8},FI={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},BI=(e,{keyframes:t})=>t.length>2?II:Ur.has(e)?e.startsWith("scale")?$I(t[1]):jI:FI,Rm=(e,t)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Us.test(t)||t==="0")&&!t.startsWith("url(")),VI=new Set(["brightness","contrast","saturate","opacity"]);function zI(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[i]=n.match(Ih)||[];if(!i)return e;const s=n.replace(i,"");let r=VI.has(t)?1:0;return i!==n&&(r*=100),t+"("+r+s+")"}const WI=/([a-z-]*)\(.*?\)/g,Nm={...Us,getAnimatableNone:e=>{const t=e.match(WI);return t?t.map(zI).join(" "):e}},HI={...QM,color:We,backgroundColor:We,outlineColor:We,fill:We,stroke:We,borderColor:We,borderTopColor:We,borderRightColor:We,borderBottomColor:We,borderLeftColor:We,filter:Nm,WebkitFilter:Nm},Yy=e=>HI[e];function IC(e,t){let n=Yy(e);return n!==Nm&&(n=Us),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const FC=e=>/^0[^.\s]+$/.test(e);function UI(e){if(typeof e=="number")return e===0;if(e!==null)return e==="none"||e==="0"||FC(e)}function YI(e,t,n,i){const s=Rm(t,n);let r;Array.isArray(n)?r=[...n]:r=[null,n];const o=i.from!==void 0?i.from:e.get();let a;const l=[];for(let c=0;cs=>{const r=Xy(i,e)||{},o=r.delay||i.delay||0;let{elapsed:a=0}=i;a=a-Dr(o);const l=YI(t,e,n,r),c=l[0],u=l[l.length-1],d=Rm(e,c),h=Rm(e,u);let f={keyframes:l,velocity:t.getVelocity(),ease:"easeOut",...r,delay:-a,onUpdate:p=>{t.set(p),r.onUpdate&&r.onUpdate(p)},onComplete:()=>{s(),r.onComplete&&r.onComplete()}};if(XI(r)||(f={...f,...BI(e,f)}),f.duration&&(f.duration=Dr(f.duration)),f.repeatDelay&&(f.repeatDelay=Dr(f.repeatDelay)),!d||!h||z$.current||r.type===!1||KI.skipAnimations)return NI(f);if(!i.isHandoff&&t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate){const p=RI(t,e,f);if(p)return p}return Xd(f)};function Kd(e){return!!(un(e)&&e.add)}const BC=e=>/^\-?\d*\.?\d+$/.test(e);function Gy(e,t){e.indexOf(t)===-1&&e.push(t)}function qy(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Qy{constructor(){this.subscriptions=[]}add(t){return Gy(this.subscriptions,t),()=>qy(this.subscriptions,t)}notify(t,n,i){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,i);else for(let r=0;r!isNaN(parseFloat(e));class qI{constructor(t,n={}){this.version="10.18.0",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(i,s=!0)=>{this.prev=this.current,this.current=i;const{delta:r,timestamp:o}=je;this.lastUpdated!==o&&(this.timeDelta=r,this.lastUpdated=o,zt.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),s&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>zt.postRender(this.velocityCheck),this.velocityCheck=({timestamp:i})=>{i!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=GI(this.current),this.owner=n.owner}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Qy);const i=this.events[t].add(n);return t==="change"?()=>{i(),zt.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,i){this.set(n),this.prev=t,this.timeDelta=i}jump(t){this.updateAndNotify(t),this.prev=t,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?NC(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Qo(e,t){return new qI(e,t)}const VC=e=>t=>t.test(e),QI={test:e=>e==="auto",parse:e=>e},zC=[Yr,st,bi,ps,s$,i$,QI],Ma=e=>zC.find(VC(e)),ZI=[...zC,We,Us],JI=e=>ZI.find(VC(e));function tF(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Qo(n))}function eF(e,t){const n=Bh(e,t);let{transitionEnd:i={},transition:s={},...r}=n?e.makeTargetAnimatable(n,!1):{};r={...r,...i};for(const o in r){const a=v$(r[o]);tF(e,o,a)}}function nF(e,t,n){var i,s;const r=Object.keys(t).filter(a=>!e.hasValue(a)),o=r.length;if(o)for(let a=0;al.remove(d))),c.push(v)}return o&&Promise.all(c).then(()=>{o&&eF(e,o)}),c}function jm(e,t,n={}){const i=Bh(e,t,n.custom);let{transition:s=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const r=i?()=>Promise.all(WC(e,i,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:c=0,staggerChildren:u,staggerDirection:d}=s;return aF(e,t,c+l,u,d,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[l,c]=a==="beforeChildren"?[r,o]:[o,r];return l().then(()=>c())}else return Promise.all([r(),o(n.delay)])}function aF(e,t,n=0,i=0,s=1,r){const o=[],a=(e.variantChildren.size-1)*i,l=s===1?(c=0)=>c*i:(c=0)=>a-c*i;return Array.from(e.variantChildren).sort(lF).forEach((c,u)=>{c.notify("AnimationStart",t),o.push(jm(c,t,{...r,delay:n+l(u)}).then(()=>c.notify("AnimationComplete",t)))}),Promise.all(o)}function lF(e,t){return e.sortNodePosition(t)}function cF(e,t,n={}){e.notify("AnimationStart",t);let i;if(Array.isArray(t)){const s=t.map(r=>jm(e,r,n));i=Promise.all(s)}else if(typeof t=="string")i=jm(e,t,n);else{const s=typeof t=="function"?Bh(e,t,n.custom):t;i=Promise.all(WC(e,s,n))}return i.then(()=>e.notify("AnimationComplete",t))}const uF=[...Oy].reverse(),dF=Oy.length;function hF(e){return t=>Promise.all(t.map(({animation:n,options:i})=>cF(e,n,i)))}function fF(e){let t=hF(e);const n=mF();let i=!0;const s=(l,c)=>{const u=Bh(e,c);if(u){const{transition:d,transitionEnd:h,...f}=u;l={...l,...f,...h}}return l};function r(l){t=l(e)}function o(l,c){const u=e.getProps(),d=e.getVariantContext(!0)||{},h=[],f=new Set;let p={},m=1/0;for(let y=0;ym&&w,T=!1;const A=Array.isArray(_)?_:[_];let E=A.reduce(s,{});S===!1&&(E={});const{prevResolvedValues:z={}}=x,N={...z,...E},L=R=>{P=!0,f.has(R)&&(T=!0,f.delete(R)),x.needsAnimating[R]=!0};for(const R in N){const B=E[R],D=z[R];if(p.hasOwnProperty(R))continue;let $=!1;Hd(B)&&Hd(D)?$=!hC(B,D):$=B!==D,$?B!==void 0?L(R):f.add(R):B!==void 0&&f.has(R)?L(R):x.protectedKeys[R]=!0}x.prevProp=_,x.prevResolvedValues=E,x.isActive&&(p={...p,...E}),i&&e.blockInitialAnimation&&(P=!1),P&&(!C||T)&&h.push(...A.map(R=>({animation:R,options:{type:g,...l}})))}if(f.size){const y={};f.forEach(g=>{const x=e.getBaseTarget(g);x!==void 0&&(y[g]=x)}),h.push({animation:y})}let v=!!h.length;return i&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(v=!1),i=!1,v?t(h):Promise.resolve()}function a(l,c,u){var d;if(n[l].isActive===c)return Promise.resolve();(d=e.variantChildren)===null||d===void 0||d.forEach(f=>{var p;return(p=f.animationState)===null||p===void 0?void 0:p.setActive(l,c)}),n[l].isActive=c;const h=o(u,l);for(const f in n)n[f].protectedKeys={};return h}return{animateChanges:o,setActive:a,setAnimateFunction:r,getState:()=>n}}function pF(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!hC(t,e):!1}function lr(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function mF(){return{animate:lr(!0),whileInView:lr(),whileHover:lr(),whileTap:lr(),whileDrag:lr(),whileFocus:lr(),exit:lr()}}class gF extends tr{constructor(t){super(t),t.animationState||(t.animationState=fF(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();this.unmount(),jh(t)&&(this.unmount=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){}}let yF=0;class vF extends tr{constructor(){super(...arguments),this.id=yF++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n,custom:i}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===s)return;const r=this.node.animationState.setActive("exit",!t,{custom:i??this.node.getProps().custom});n&&!t&&r.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const xF={animation:{Feature:gF},exit:{Feature:vF}},Fb=(e,t)=>Math.abs(e-t);function bF(e,t){const n=Fb(e.x,t.x),i=Fb(e.y,t.y);return Math.sqrt(n**2+i**2)}class HC{constructor(t,n,{transformPagePoint:i,contextWindow:s,dragSnapToOrigin:r=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=tp(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,f=bF(d.offset,{x:0,y:0})>=3;if(!h&&!f)return;const{point:p}=d,{timestamp:m}=je;this.history.push({...p,timestamp:m});const{onStart:v,onMove:y}=this.handlers;h||(v&&v(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,d)},this.handlePointerMove=(d,h)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=Jf(h,this.transformPagePoint),zt.update(this.updatePoint,!0)},this.handlePointerUp=(d,h)=>{this.end();const{onEnd:f,onSessionEnd:p,resumeAnimation:m}=this.handlers;if(this.dragSnapToOrigin&&m&&m(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=tp(d.type==="pointercancel"?this.lastMoveEventInfo:Jf(h,this.transformPagePoint),this.history);this.startEvent&&f&&f(d,v),p&&p(d,v)},!aC(t))return;this.dragSnapToOrigin=r,this.handlers=n,this.transformPagePoint=i,this.contextWindow=s||window;const o=Fh(t),a=Jf(o,this.transformPagePoint),{point:l}=a,{timestamp:c}=je;this.history=[{...l,timestamp:c}];const{onSessionStart:u}=n;u&&u(t,tp(a,this.history)),this.removeListeners=Is(qi(this.contextWindow,"pointermove",this.handlePointerMove),qi(this.contextWindow,"pointerup",this.handlePointerUp),qi(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),is(this.updatePoint)}}function Jf(e,t){return t?{point:t(e.point)}:e}function Bb(e,t){return{x:e.x-t.x,y:e.y-t.y}}function tp({point:e},t){return{point:e,delta:Bb(e,UC(t)),offset:Bb(e,_F(t)),velocity:wF(t,.1)}}function _F(e){return e[0]}function UC(e){return e[e.length-1]}function wF(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,i=null;const s=UC(e);for(;n>=0&&(i=e[n],!(s.timestamp-i.timestamp>Dr(t)));)n--;if(!i)return{x:0,y:0};const r=Qi(s.timestamp-i.timestamp);if(r===0)return{x:0,y:0};const o={x:(s.x-i.x)/r,y:(s.y-i.y)/r};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function wn(e){return e.max-e.min}function $m(e,t=0,n=.01){return Math.abs(e-t)<=n}function Vb(e,t,n,i=.5){e.origin=i,e.originPoint=ee(t.min,t.max,e.origin),e.scale=wn(n)/wn(t),($m(e.scale,1,1e-4)||isNaN(e.scale))&&(e.scale=1),e.translate=ee(n.min,n.max,e.origin)-e.originPoint,($m(e.translate)||isNaN(e.translate))&&(e.translate=0)}function vl(e,t,n,i){Vb(e.x,t.x,n.x,i?i.originX:void 0),Vb(e.y,t.y,n.y,i?i.originY:void 0)}function zb(e,t,n){e.min=n.min+t.min,e.max=e.min+wn(t)}function kF(e,t,n){zb(e.x,t.x,n.x),zb(e.y,t.y,n.y)}function Wb(e,t,n){e.min=t.min-n.min,e.max=e.min+wn(t)}function xl(e,t,n){Wb(e.x,t.x,n.x),Wb(e.y,t.y,n.y)}function SF(e,{min:t,max:n},i){return t!==void 0&&en&&(e=i?ee(n,e,i.max):Math.min(e,n)),e}function Hb(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function MF(e,{top:t,left:n,bottom:i,right:s}){return{x:Hb(e.x,n,s),y:Hb(e.y,t,i)}}function Ub(e,t){let n=t.min-e.min,i=t.max-e.max;return t.max-t.mini?n=Ql(t.min,t.max-i,e.min):i>s&&(n=Ql(e.min,e.max-s,t.min)),Hs(0,1,n)}function TF(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Im=.35;function DF(e=Im){return e===!1?e=0:e===!0&&(e=Im),{x:Yb(e,"left","right"),y:Yb(e,"top","bottom")}}function Yb(e,t,n){return{min:Xb(e,t),max:Xb(e,n)}}function Xb(e,t){return typeof e=="number"?e:e[t]||0}const Kb=()=>({translate:0,scale:1,origin:0,originPoint:0}),ko=()=>({x:Kb(),y:Kb()}),Gb=()=>({min:0,max:0}),fe=()=>({x:Gb(),y:Gb()});function An(e){return[e("x"),e("y")]}function YC({top:e,left:t,right:n,bottom:i}){return{x:{min:t,max:n},y:{min:e,max:i}}}function EF({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function AF(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),i=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}function ep(e){return e===void 0||e===1}function Fm({scale:e,scaleX:t,scaleY:n}){return!ep(e)||!ep(t)||!ep(n)}function mr(e){return Fm(e)||XC(e)||e.z||e.rotate||e.rotateX||e.rotateY}function XC(e){return qb(e.x)||qb(e.y)}function qb(e){return e&&e!=="0%"}function Gd(e,t,n){const i=e-n,s=t*i;return n+s}function Qb(e,t,n,i,s){return s!==void 0&&(e=Gd(e,s,i)),Gd(e,n,i)+t}function Bm(e,t=0,n=1,i,s){e.min=Qb(e.min,t,n,i,s),e.max=Qb(e.max,t,n,i,s)}function KC(e,{x:t,y:n}){Bm(e.x,t.translate,t.scale,t.originPoint),Bm(e.y,n.translate,n.scale,n.originPoint)}function OF(e,t,n,i=!1){const s=n.length;if(!s)return;t.x=t.y=1;let r,o;for(let a=0;a1.0000000000001||e<.999999999999?e:1}function ys(e,t){e.min=e.min+t,e.max=e.max+t}function Jb(e,t,[n,i,s]){const r=t[s]!==void 0?t[s]:.5,o=ee(e.min,e.max,r);Bm(e,t[n],t[i],o,t.scale)}const LF=["x","scaleX","originX"],RF=["y","scaleY","originY"];function So(e,t){Jb(e.x,t,LF),Jb(e.y,t,RF)}function GC(e,t){return YC(AF(e.getBoundingClientRect(),t))}function NF(e,t,n){const i=GC(e,n),{scroll:s}=t;return s&&(ys(i.x,s.offset.x),ys(i.y,s.offset.y)),i}const qC=({current:e})=>e?e.ownerDocument.defaultView:null,jF=new WeakMap;class $F{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=fe(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const s=u=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Fh(u,"page").point)},r=(u,d)=>{const{drag:h,dragPropagation:f,onDragStart:p}=this.getProps();if(h&&!f&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=cC(h),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),An(v=>{let y=this.getAxisMotionValue(v).get()||0;if(bi.test(y)){const{projection:g}=this.visualElement;if(g&&g.layout){const x=g.layout.layoutBox[v];x&&(y=wn(x)*(parseFloat(y)/100))}}this.originPoint[v]=y}),p&&zt.update(()=>p(u,d),!1,!0);const{animationState:m}=this.visualElement;m&&m.setActive("whileDrag",!0)},o=(u,d)=>{const{dragPropagation:h,dragDirectionLock:f,onDirectionLock:p,onDrag:m}=this.getProps();if(!h&&!this.openGlobalLock)return;const{offset:v}=d;if(f&&this.currentDirection===null){this.currentDirection=IF(v),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",d.point,v),this.updateAxis("y",d.point,v),this.visualElement.render(),m&&m(u,d)},a=(u,d)=>this.stop(u,d),l=()=>An(u=>{var d;return this.getAnimationState(u)==="paused"&&((d=this.getAxisMotionValue(u).animation)===null||d===void 0?void 0:d.play())}),{dragSnapToOrigin:c}=this.getProps();this.panSession=new HC(t,{onSessionStart:s,onStart:r,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,contextWindow:qC(this.visualElement)})}stop(t,n){const i=this.isDragging;if(this.cancel(),!i)return;const{velocity:s}=n;this.startAnimation(s);const{onDragEnd:r}=this.getProps();r&&zt.update(()=>r(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:i}=this.getProps();!i&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,i){const{drag:s}=this.getProps();if(!i||!hu(t,s,this.currentDirection))return;const r=this.getAxisMotionValue(t);let o=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(o=SF(o,this.constraints[t],this.elastic[t])),r.set(o)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:i}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,r=this.constraints;n&&_o(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&s?this.constraints=MF(s.layoutBox,n):this.constraints=!1,this.elastic=DF(i),r!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&An(o=>{this.getAxisMotionValue(o)&&(this.constraints[o]=TF(s.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!_o(t))return!1;const i=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const r=NF(i,s.root,this.visualElement.getTransformPagePoint());let o=CF(s.layout.layoutBox,r);if(n){const a=n(EF(o));this.hasMutatedConstraints=!!a,a&&(o=YC(a))}return o}startAnimation(t){const{drag:n,dragMomentum:i,dragElastic:s,dragTransition:r,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=An(u=>{if(!hu(u,n,this.currentDirection))return;let d=l&&l[u]||{};o&&(d={min:0,max:0});const h=s?200:1e6,f=s?40:1e7,p={type:"inertia",velocity:i?t[u]:0,bounceStiffness:h,bounceDamping:f,timeConstant:750,restDelta:1,restSpeed:10,...r,...d};return this.startAxisValueAnimation(u,p)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const i=this.getAxisMotionValue(t);return i.start(Ky(t,i,0,n))}stopAnimation(){An(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){An(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n="_drag"+t.toUpperCase(),i=this.visualElement.getProps(),s=i[n];return s||this.visualElement.getValue(t,(i.initial?i.initial[t]:void 0)||0)}snapToCursor(t){An(n=>{const{drag:i}=this.getProps();if(!hu(n,i,this.currentDirection))return;const{projection:s}=this.visualElement,r=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:a}=s.layout.layoutBox[n];r.set(t[n]-ee(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!_o(n)||!i||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};An(o=>{const a=this.getAxisMotionValue(o);if(a){const l=a.get();s[o]=PF({min:l,max:l},this.constraints[o])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),An(o=>{if(!hu(o,t,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(ee(l,c,s[o]))})}addListeners(){if(!this.visualElement.current)return;jF.set(this.visualElement,this);const t=this.visualElement.current,n=qi(t,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),i=()=>{const{dragConstraints:l}=this.getProps();_o(l)&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,r=s.addEventListener("measure",i);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),i();const o=Hi(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(An(u=>{const d=this.getAxisMotionValue(u);d&&(this.originPoint[u]+=l[u].translate,d.set(d.get()+l[u].translate))}),this.visualElement.render())});return()=>{o(),n(),r(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:i=!1,dragPropagation:s=!1,dragConstraints:r=!1,dragElastic:o=Im,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:i,dragPropagation:s,dragConstraints:r,dragElastic:o,dragMomentum:a}}}function hu(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function IF(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class FF extends tr{constructor(t){super(t),this.removeGroupControls=ce,this.removeListeners=ce,this.controls=new $F(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ce}unmount(){this.removeGroupControls(),this.removeListeners()}}const t1=e=>(t,n)=>{e&&zt.update(()=>e(t,n))};class BF extends tr{constructor(){super(...arguments),this.removePointerDownListener=ce}onPointerDown(t){this.session=new HC(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:qC(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:i,onPanEnd:s}=this.node.getProps();return{onSessionStart:t1(t),onStart:t1(n),onMove:i,onEnd:(r,o)=>{delete this.session,s&&zt.update(()=>s(r,o))}}}mount(){this.removePointerDownListener=qi(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function VF(){const e=k.useContext(Rh);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:n,register:i}=e,s=k.useId();return k.useEffect(()=>i(s),[]),!t&&n?[!1,()=>n&&n(s)]:[!0]}const nd={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function e1(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Ca={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(st.test(e))e=parseFloat(e);else return e;const n=e1(e,t.target.x),i=e1(e,t.target.y);return`${n}% ${i}%`}},zF={correct:(e,{treeScale:t,projectionDelta:n})=>{const i=e,s=Us.parse(e);if(s.length>5)return i;const r=Us.createTransformer(e),o=typeof s[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;s[0+o]/=a,s[1+o]/=l;const c=ee(a,l,.5);return typeof s[2+o]=="number"&&(s[2+o]/=c),typeof s[3+o]=="number"&&(s[3+o]/=c),r(s)}};class WF extends Y.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i,layoutId:s}=this.props,{projection:r}=t;qj(HF),r&&(n.group&&n.group.add(r),i&&i.register&&s&&i.register(r),r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,onExitComplete:()=>this.safeToRemove()})),nd.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:i,drag:s,isPresent:r}=this.props,o=i.projection;return o&&(o.isPresent=r,s||t.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),t.isPresent!==r&&(r?o.promote():o.relegate()||zt.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),queueMicrotask(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i}=this.props,{projection:s}=t;s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),i&&i.deregister&&i.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function QC(e){const[t,n]=VF(),i=k.useContext(Ry);return Y.createElement(WF,{...e,layoutGroup:i,switchLayoutGroup:k.useContext(YM),isPresent:t,safeToRemove:n})}const HF={borderRadius:{...Ca,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ca,borderTopRightRadius:Ca,borderBottomLeftRadius:Ca,borderBottomRightRadius:Ca,boxShadow:zF},ZC=["TopLeft","TopRight","BottomLeft","BottomRight"],UF=ZC.length,n1=e=>typeof e=="string"?parseFloat(e):e,i1=e=>typeof e=="number"||st.test(e);function YF(e,t,n,i,s,r){s?(e.opacity=ee(0,n.opacity!==void 0?n.opacity:1,XF(i)),e.opacityExit=ee(t.opacity!==void 0?t.opacity:1,0,KF(i))):r&&(e.opacity=ee(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,i));for(let o=0;oit?1:n(Ql(e,t,i))}function r1(e,t){e.min=t.min,e.max=t.max}function Dn(e,t){r1(e.x,t.x),r1(e.y,t.y)}function o1(e,t,n,i,s){return e-=t,e=Gd(e,1/n,i),s!==void 0&&(e=Gd(e,1/s,i)),e}function GF(e,t=0,n=1,i=.5,s,r=e,o=e){if(bi.test(t)&&(t=parseFloat(t),t=ee(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=ee(r.min,r.max,i);e===r&&(a-=t),e.min=o1(e.min,t,n,a,s),e.max=o1(e.max,t,n,a,s)}function a1(e,t,[n,i,s],r,o){GF(e,t[n],t[i],t[s],t.scale,r,o)}const qF=["x","scaleX","originX"],QF=["y","scaleY","originY"];function l1(e,t,n,i){a1(e.x,t,qF,n?n.x:void 0,i?i.x:void 0),a1(e.y,t,QF,n?n.y:void 0,i?i.y:void 0)}function c1(e){return e.translate===0&&e.scale===1}function tP(e){return c1(e.x)&&c1(e.y)}function ZF(e,t){return e.x.min===t.x.min&&e.x.max===t.x.max&&e.y.min===t.y.min&&e.y.max===t.y.max}function eP(e,t){return Math.round(e.x.min)===Math.round(t.x.min)&&Math.round(e.x.max)===Math.round(t.x.max)&&Math.round(e.y.min)===Math.round(t.y.min)&&Math.round(e.y.max)===Math.round(t.y.max)}function u1(e){return wn(e.x)/wn(e.y)}class JF{constructor(){this.members=[]}add(t){Gy(this.members,t),t.scheduleRender()}remove(t){if(qy(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(s=>t===s);if(n===0)return!1;let i;for(let s=n;s>=0;s--){const r=this.members[s];if(r.isPresent!==!1){i=r;break}}return i?(this.promote(i),!0):!1}promote(t,n){const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.instance&&i.scheduleRender(),t.scheduleRender(),t.resumeFrom=i,n&&(t.resumeFrom.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:s}=t.options;s===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:i}=t;n.onExitComplete&&n.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function d1(e,t,n){let i="";const s=e.x.translate/t.x,r=e.y.translate/t.y;if((s||r)&&(i=`translate3d(${s}px, ${r}px, 0) `),(t.x!==1||t.y!==1)&&(i+=`scale(${1/t.x}, ${1/t.y}) `),n){const{rotate:l,rotateX:c,rotateY:u}=n;l&&(i+=`rotate(${l}deg) `),c&&(i+=`rotateX(${c}deg) `),u&&(i+=`rotateY(${u}deg) `)}const o=e.x.scale*t.x,a=e.y.scale*t.y;return(o!==1||a!==1)&&(i+=`scale(${o}, ${a})`),i||"none"}const tB=(e,t)=>e.depth-t.depth;class eB{constructor(){this.children=[],this.isDirty=!1}add(t){Gy(this.children,t),this.isDirty=!0}remove(t){qy(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(tB),this.isDirty=!1,this.children.forEach(t)}}function nB(e,t){const n=performance.now(),i=({timestamp:s})=>{const r=s-n;r>=t&&(is(i),e(r-t))};return zt.read(i,!0),()=>is(i)}function iB(e){window.MotionDebug&&window.MotionDebug.record(e)}function sB(e){return e instanceof SVGElement&&e.tagName!=="svg"}function rB(e,t,n){const i=un(e)?e:Qo(e);return i.start(Ky("",i,t,n)),i.animation}const h1=["","X","Y","Z"],oB={visibility:"hidden"},f1=1e3;let aB=0;const gr={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function nP({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:i,resetTransform:s}){return class{constructor(o={},a=t==null?void 0:t()){this.id=aB++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,gr.totalNodes=gr.resolvedTargetDeltas=gr.recalculatedProjection=0,this.nodes.forEach(uB),this.nodes.forEach(mB),this.nodes.forEach(gB),this.nodes.forEach(dB),iB(gr)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;lthis.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=nB(h,250),nd.hasAnimatedSinceResize&&(nd.hasAnimatedSinceResize=!1,this.nodes.forEach(m1))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&u&&(l||c)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:h,hasRelativeTargetChanged:f,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||u.getDefaultTransition()||_B,{onLayoutAnimationStart:v,onLayoutAnimationComplete:y}=u.getProps(),g=!this.targetLayout||!eP(this.targetLayout,p)||f,x=!h&&f;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||x||h&&(g||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,x);const _={...Xy(m,"layout"),onPlay:v,onComplete:y};(u.shouldReduceMotion||this.options.layoutRoot)&&(_.delay=0,_.type=!1),this.startAnimation(_)}else h||m1(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,is(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(yB),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;uthis.update()))}clearAllSnapshots(){this.nodes.forEach(hB),this.sharedNodes.forEach(vB)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,zt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){zt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{const w=_/1e3;g1(d.x,o.x,w),g1(d.y,o.y,w),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(xl(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),xB(this.relativeTarget,this.relativeTargetOrigin,h,w),x&&ZF(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=fe()),Dn(x,this.relativeTarget)),m&&(this.animationValues=u,YF(u,c,this.latestValues,w,g,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=w},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(is(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=zt.update(()=>{nd.hasAnimatedSinceResize=!0,this.currentAnimation=rB(0,f1,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(f1),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=o;if(!(!a||!l||!c)){if(this!==o&&this.layout&&c&&iP(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||fe();const d=wn(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+d;const h=wn(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+h}Dn(a,l),So(a,u),vl(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new JF),this.sharedNodes.get(o).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.rotate||l.rotateX||l.rotateY||l.rotateZ)&&(a=!0),!a)return;const c={};for(let u=0;u{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(p1),this.root.sharedNodes.clear()}}}function lB(e){e.updateLayout()}function cB(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:i,measuredBox:s}=e.layout,{animationType:r}=e.options,o=n.source!==e.layout.source;r==="size"?An(d=>{const h=o?n.measuredBox[d]:n.layoutBox[d],f=wn(h);h.min=i[d].min,h.max=h.min+f}):iP(r,n.layoutBox,i)&&An(d=>{const h=o?n.measuredBox[d]:n.layoutBox[d],f=wn(i[d]);h.max=h.min+f,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+f)});const a=ko();vl(a,i,n.layoutBox);const l=ko();o?vl(l,e.applyTransform(s,!0),n.measuredBox):vl(l,i,n.layoutBox);const c=!tP(a);let u=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:h,layout:f}=d;if(h&&f){const p=fe();xl(p,n.layoutBox,h.layoutBox);const m=fe();xl(m,i,f.layoutBox),eP(p,m)||(u=!0),d.options.layoutRoot&&(e.relativeTarget=m,e.relativeTargetOrigin=p,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:i,snapshot:n,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeTargetChanged:u})}else if(e.isLead()){const{onExitComplete:i}=e.options;i&&i()}e.options.transition=void 0}function uB(e){gr.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function dB(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function hB(e){e.clearSnapshot()}function p1(e){e.clearMeasurements()}function fB(e){e.isLayoutDirty=!1}function pB(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function m1(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function mB(e){e.resolveTargetDelta()}function gB(e){e.calcProjection()}function yB(e){e.resetRotation()}function vB(e){e.removeLeadSnapshot()}function g1(e,t,n){e.translate=ee(t.translate,0,n),e.scale=ee(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function y1(e,t,n,i){e.min=ee(t.min,n.min,i),e.max=ee(t.max,n.max,i)}function xB(e,t,n,i){y1(e.x,t.x,n.x,i),y1(e.y,t.y,n.y,i)}function bB(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const _B={duration:.45,ease:[.4,0,.1,1]},v1=e=>typeof navigator<"u"&&navigator.userAgent.toLowerCase().includes(e),x1=v1("applewebkit/")&&!v1("chrome/")?Math.round:ce;function b1(e){e.min=x1(e.min),e.max=x1(e.max)}function wB(e){b1(e.x),b1(e.y)}function iP(e,t,n){return e==="position"||e==="preserve-aspect"&&!$m(u1(t),u1(n),.2)}const kB=nP({attachResizeListener:(e,t)=>Hi(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),np={current:void 0},sP=nP({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!np.current){const e=new kB({});e.mount(window),e.setOptions({layoutScroll:!0}),np.current=e}return np.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),SB={pan:{Feature:BF},drag:{Feature:FF,ProjectionNode:sP,MeasureLayout:QC}},MB=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function CB(e){const t=MB.exec(e);if(!t)return[,];const[,n,i]=t;return[n,i]}function Vm(e,t,n=1){const[i,s]=CB(e);if(!i)return;const r=window.getComputedStyle(t).getPropertyValue(i);if(r){const o=r.trim();return BC(o)?parseFloat(o):o}else return Em(s)?Vm(s,t,n+1):s}function PB(e,{...t},n){const i=e.current;if(!(i instanceof Element))return{target:t,transitionEnd:n};n&&(n={...n}),e.values.forEach(s=>{const r=s.get();if(!Em(r))return;const o=Vm(r,i);o&&s.set(o)});for(const s in t){const r=t[s];if(!Em(r))continue;const o=Vm(r,i);o&&(t[s]=o,n||(n={}),n[s]===void 0&&(n[s]=r))}return{target:t,transitionEnd:n}}const TB=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),rP=e=>TB.has(e),DB=e=>Object.keys(e).some(rP),_1=e=>e===Yr||e===st,w1=(e,t)=>parseFloat(e.split(", ")[t]),k1=(e,t)=>(n,{transform:i})=>{if(i==="none"||!i)return 0;const s=i.match(/^matrix3d\((.+)\)$/);if(s)return w1(s[1],t);{const r=i.match(/^matrix\((.+)\)$/);return r?w1(r[1],e):0}},EB=new Set(["x","y","z"]),AB=yc.filter(e=>!EB.has(e));function OB(e){const t=[];return AB.forEach(n=>{const i=e.getValue(n);i!==void 0&&(t.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),t.length&&e.render(),t}const Zo={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:k1(4,13),y:k1(5,14)};Zo.translateX=Zo.x;Zo.translateY=Zo.y;const LB=(e,t,n)=>{const i=t.measureViewportBox(),s=t.current,r=getComputedStyle(s),{display:o}=r,a={};o==="none"&&t.setStaticValue("display",e.display||"block"),n.forEach(c=>{a[c]=Zo[c](i,r)}),t.render();const l=t.measureViewportBox();return n.forEach(c=>{const u=t.getValue(c);u&&u.jump(a[c]),e[c]=Zo[c](l,r)}),e},RB=(e,t,n={},i={})=>{t={...t},i={...i};const s=Object.keys(t).filter(rP);let r=[],o=!1;const a=[];if(s.forEach(l=>{const c=e.getValue(l);if(!e.hasValue(l))return;let u=n[l],d=Ma(u);const h=t[l];let f;if(Hd(h)){const p=h.length,m=h[0]===null?1:0;u=h[m],d=Ma(u);for(let v=m;v=0?window.pageYOffset:null,c=LB(t,e,a);return r.length&&r.forEach(([u,d])=>{e.getValue(u).set(d)}),e.render(),Nh&&l!==null&&window.scrollTo({top:l}),{target:c,transitionEnd:i}}else return{target:t,transitionEnd:i}};function NB(e,t,n,i){return DB(t)?RB(e,t,n,i):{target:t,transitionEnd:i}}const jB=(e,t,n,i)=>{const s=PB(e,t,i);return t=s.target,i=s.transitionEnd,NB(e,t,n,i)},zm={current:null},oP={current:!1};function $B(){if(oP.current=!0,!!Nh)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>zm.current=e.matches;e.addListener(t),t()}else zm.current=!1}function IB(e,t,n){const{willChange:i}=t;for(const s in t){const r=t[s],o=n[s];if(un(r))e.addValue(s,r),Kd(i)&&i.add(s);else if(un(o))e.addValue(s,Qo(r,{owner:e})),Kd(i)&&i.remove(s);else if(o!==r)if(e.hasValue(s)){const a=e.getValue(s);!a.hasAnimated&&a.set(r)}else{const a=e.getStaticValue(s);e.addValue(s,Qo(a!==void 0?a:r,{owner:e}))}}for(const s in n)t[s]===void 0&&e.removeValue(s);return t}const S1=new WeakMap,aP=Object.keys(ql),FB=aP.length,M1=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],BB=Ly.length;class VB{constructor({parent:t,props:n,presenceContext:i,reducedMotionConfig:s,visualState:r},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>zt.render(this.render,!1,!0);const{latestValues:a,renderState:l}=r;this.latestValues=a,this.baseTarget={...a},this.initialValues=n.initial?{...a}:{},this.renderState=l,this.parent=t,this.props=n,this.presenceContext=i,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=o,this.isControllingVariants=$h(n),this.isVariantNode=UM(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:c,...u}=this.scrapeMotionValuesFromProps(n,{});for(const d in u){const h=u[d];a[d]!==void 0&&un(h)&&(h.set(a[d],!1),Kd(c)&&c.add(d))}}scrapeMotionValuesFromProps(t,n){return{}}mount(t){this.current=t,S1.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,i)=>this.bindToMotionValue(i,n)),oP.current||$B(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:zm.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){S1.delete(this.current),this.projection&&this.projection.unmount(),is(this.notifyUpdate),is(this.render),this.valueSubscriptions.forEach(t=>t()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features)this.features[t].unmount();this.current=null}bindToMotionValue(t,n){const i=Ur.has(t),s=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&zt.update(this.notifyUpdate,!1,!0),i&&this.projection&&(this.projection.isTransformDirty=!0)}),r=n.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(t,()=>{s(),r()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}loadFeatures({children:t,...n},i,s,r){let o,a;for(let l=0;lthis.scheduleRender(),animationType:typeof c=="string"?c:"both",initialPromotionConfig:r,layoutScroll:h,layoutRoot:f})}return a}updateFeatures(){for(const t in this.features){const n=this.features[t];n.isMounted?n.update():(n.mount(),n.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):fe()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}makeTargetAnimatable(t,n=!0){return this.makeTargetAnimatableFromInstance(t,this.props,n)}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let i=0;in.variantChildren.delete(t)}addValue(t,n){n!==this.values.get(t)&&(this.removeValue(t),this.bindToMotionValue(t,n)),this.values.set(t,n),this.latestValues[t]=n.get()}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let i=this.values.get(t);return i===void 0&&n!==void 0&&(i=Qo(n,{owner:this}),this.addValue(t,i)),i}readValue(t){var n;return this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(n=this.getBaseTargetFromProps(this.props,t))!==null&&n!==void 0?n:this.readValueFromInstance(this.current,t,this.options)}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:i}=this.props,s=typeof i=="string"||typeof i=="object"?(n=Vy(this.props,i))===null||n===void 0?void 0:n[t]:void 0;if(i&&s!==void 0)return s;const r=this.getBaseTargetFromProps(this.props,t);return r!==void 0&&!un(r)?r:this.initialValues[t]!==void 0&&s===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Qy),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class lP extends VB{sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:i}){delete n[t],delete i[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:n,...i},{transformValues:s},r){let o=sF(i,t||{},this);if(s&&(n&&(n=s(n)),i&&(i=s(i)),o&&(o=s(o))),r){nF(this,i,o);const a=jB(this,i,o,n);n=a.transitionEnd,i=a.target}return{transition:t,transitionEnd:n,...i}}}function zB(e){return window.getComputedStyle(e)}class WB extends lP{constructor(){super(...arguments),this.type="html"}readValueFromInstance(t,n){if(Ur.has(n)){const i=Yy(n);return i&&i.default||0}else{const i=zB(t),s=(GM(n)?i.getPropertyValue(n):i[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return GC(t,n)}build(t,n,i,s){jy(t,n,i,s.transformTemplate)}scrapeMotionValuesFromProps(t,n){return By(t,n)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;un(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}renderInstance(t,n,i,s){eC(t,n,i,s)}}class HB extends lP{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Ur.has(n)){const i=Yy(n);return i&&i.default||0}return n=nC.has(n)?n:Ay(n),t.getAttribute(n)}measureInstanceViewportBox(){return fe()}scrapeMotionValuesFromProps(t,n){return sC(t,n)}build(t,n,i,s){Iy(t,n,i,this.isSVGTag,s.transformTemplate)}renderInstance(t,n,i,s){iC(t,n,i,s)}mount(t){this.isSVGTag=Fy(t.tagName),super.mount(t)}}const UB=(e,t)=>Ny(e)?new HB(t,{enableHardwareAcceleration:!1}):new WB(t,{enableHardwareAcceleration:!0}),YB={layout:{ProjectionNode:sP,MeasureLayout:QC}},XB={...xF,...F$,...SB,...YB},Jo=Kj((e,t)=>C$(e,t,XB,UB));function cP(){const e=k.useRef(!1);return Ey(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function KB(){const e=cP(),[t,n]=k.useState(0),i=k.useCallback(()=>{e.current&&n(t+1)},[t]);return[k.useCallback(()=>zt.postRender(i),[i]),t]}class GB extends k.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const i=this.props.sizeRef.current;i.height=n.offsetHeight||0,i.width=n.offsetWidth||0,i.top=n.offsetTop,i.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function qB({children:e,isPresent:t}){const n=k.useId(),i=k.useRef(null),s=k.useRef({width:0,height:0,top:0,left:0});return k.useInsertionEffect(()=>{const{width:r,height:o,top:a,left:l}=s.current;if(t||!i.current||!r||!o)return;i.current.dataset.motionPopId=n;const c=document.createElement("style");return document.head.appendChild(c),c.sheet&&c.sheet.insertRule(` +`):e}function WL(e,t){const{element:n,datasetIndex:i,index:s}=t,r=e.getDatasetMeta(i).controller,{label:o,value:a}=r.getLabelAndValue(s);return{chart:e,label:o,parsed:r.getParsed(s),raw:e.data.datasets[i].data[s],formattedValue:a,dataset:r.getDataset(),dataIndex:s,datasetIndex:i,element:n}}function qx(e,t){const n=e.chart.ctx,{body:i,footer:s,title:r}=e,{boxWidth:o,boxHeight:a}=t,l=ge(t.bodyFont),c=ge(t.titleFont),u=ge(t.footerFont),d=r.length,h=s.length,f=i.length,p=Ae(t.padding);let m=p.height,v=0,y=i.reduce((_,w)=>_+w.before.length+w.lines.length+w.after.length,0);if(y+=e.beforeBody.length+e.afterBody.length,d&&(m+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),y){const _=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;m+=f*_+(y-f)*l.lineHeight+(y-1)*t.bodySpacing}h&&(m+=t.footerMarginTop+h*u.lineHeight+(h-1)*t.footerSpacing);let g=0;const x=function(_){v=Math.max(v,n.measureText(_).width+g)};return n.save(),n.font=c.string,Et(e.title,x),n.font=l.string,Et(e.beforeBody.concat(e.afterBody),x),g=t.displayColors?o+2+t.boxPadding:0,Et(i,_=>{Et(_.before,x),Et(_.lines,x),Et(_.after,x)}),g=0,n.font=u.string,Et(e.footer,x),n.restore(),v+=p.width,{width:v,height:m}}function HL(e,t){const{y:n,height:i}=t;return ne.height-i/2?"bottom":"center"}function UL(e,t,n,i){const{x:s,width:r}=i,o=n.caretSize+n.caretPadding;if(e==="left"&&s+r+o>t.width||e==="right"&&s-r-o<0)return!0}function YL(e,t,n,i){const{x:s,width:r}=n,{width:o,chartArea:{left:a,right:l}}=e;let c="center";return i==="center"?c=s<=(a+l)/2?"left":"right":s<=r/2?c="left":s>=o-r/2&&(c="right"),UL(c,e,t,n)&&(c="center"),c}function Qx(e,t,n){const i=n.yAlign||t.yAlign||HL(e,n);return{xAlign:n.xAlign||t.xAlign||YL(e,t,n,i),yAlign:i}}function XL(e,t){let{x:n,width:i}=e;return t==="right"?n-=i:t==="center"&&(n-=i/2),n}function KL(e,t,n){let{y:i,height:s}=e;return t==="top"?i+=n:t==="bottom"?i-=s+n:i-=s/2,i}function Zx(e,t,n,i){const{caretSize:s,caretPadding:r,cornerRadius:o}=e,{xAlign:a,yAlign:l}=n,c=s+r,{topLeft:u,topRight:d,bottomLeft:h,bottomRight:f}=Cr(o);let p=XL(t,a);const m=KL(t,l,c);return l==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(u,h)+s:a==="right"&&(p+=Math.max(d,f)+s),{x:we(p,0,i.width-t.width),y:we(m,0,i.height-t.height)}}function au(e,t,n){const i=Ae(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-i.right:e.x+i.left}function Jx(e){return ci([],Oi(e))}function GL(e,t,n){return Qs(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function tb(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const EM={beforeTitle:Di,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,i=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex"u"?EM[t].call(n,i):s}var kp;let eb=(kp=class extends os{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,i=this.options.setContext(this.getContext()),s=i.enabled&&n.options.animation&&i.animations,r=new sM(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=GL(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:i}=n,s=qe(i,"beforeTitle",this,t),r=qe(i,"title",this,t),o=qe(i,"afterTitle",this,t);let a=[];return a=ci(a,Oi(s)),a=ci(a,Oi(r)),a=ci(a,Oi(o)),a}getBeforeBody(t,n){return Jx(qe(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:i}=n,s=[];return Et(t,r=>{const o={before:[],lines:[],after:[]},a=tb(i,r);ci(o.before,Oi(qe(a,"beforeLabel",this,r))),ci(o.lines,qe(a,"label",this,r)),ci(o.after,Oi(qe(a,"afterLabel",this,r))),s.push(o)}),s}getAfterBody(t,n){return Jx(qe(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:i}=n,s=qe(i,"beforeFooter",this,t),r=qe(i,"footer",this,t),o=qe(i,"afterFooter",this,t);let a=[];return a=ci(a,Oi(s)),a=ci(a,Oi(r)),a=ci(a,Oi(o)),a}_createItems(t){const n=this._active,i=this.chart.data,s=[],r=[],o=[];let a=[],l,c;for(l=0,c=n.length;lt.filter(u,d,h,i))),t.itemSort&&(a=a.sort((u,d)=>t.itemSort(u,d,i))),Et(a,u=>{const d=tb(t.callbacks,u);s.push(qe(d,"labelColor",this,u)),r.push(qe(d,"labelPointStyle",this,u)),o.push(qe(d,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=r,this.labelTextColors=o,this.dataPoints=a,a}update(t,n){const i=this.options.setContext(this.getContext()),s=this._active;let r,o=[];if(!s.length)this.opacity!==0&&(r={opacity:0});else{const a=qa[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const l=this._size=qx(this,i),c=Object.assign({},a,l),u=Qx(this.chart,i,c),d=Zx(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,r={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,i,s){const r=this.getCaretPosition(t,i,s);n.lineTo(r.x1,r.y1),n.lineTo(r.x2,r.y2),n.lineTo(r.x3,r.y3)}getCaretPosition(t,n,i){const{xAlign:s,yAlign:r}=this,{caretSize:o,cornerRadius:a}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=Cr(a),{x:h,y:f}=t,{width:p,height:m}=n;let v,y,g,x,_,w;return r==="center"?(_=f+m/2,s==="left"?(v=h,y=v-o,x=_+o,w=_-o):(v=h+p,y=v+o,x=_-o,w=_+o),g=v):(s==="left"?y=h+Math.max(l,u)+o:s==="right"?y=h+p-Math.max(c,d)-o:y=this.caretX,r==="top"?(x=f,_=x-o,v=y-o,g=y+o):(x=f+m,_=x+o,v=y+o,g=y-o),w=x),{x1:v,x2:y,x3:g,y1:x,y2:_,y3:w}}drawTitle(t,n,i){const s=this.title,r=s.length;let o,a,l;if(r){const c=Oo(i.rtl,this.x,this.width);for(t.x=au(this,i.titleAlign,i),n.textAlign=c.textAlign(i.titleAlign),n.textBaseline="middle",o=ge(i.titleFont),a=i.titleSpacing,n.fillStyle=i.titleColor,n.font=o.string,l=0;lg!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,Ul(t,{x:m,y:p,w:c,h:l,radius:y}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),Ul(t,{x:v,y:p+1,w:c-2,h:l-2,radius:y}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(m,p,c,l),t.strokeRect(m,p,c,l),t.fillStyle=o.backgroundColor,t.fillRect(v,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,n,i){const{body:s}=this,{bodySpacing:r,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=i,d=ge(i.bodyFont);let h=d.lineHeight,f=0;const p=Oo(i.rtl,this.x,this.width),m=function(M){n.fillText(M,p.x(t.x+f),t.y+h/2),t.y+=h+r},v=p.textAlign(o);let y,g,x,_,w,S,C;for(n.textAlign=o,n.textBaseline="middle",n.font=d.string,t.x=au(this,v,i),n.fillStyle=i.bodyColor,Et(this.beforeBody,m),f=a&&v!=="right"?o==="center"?c/2+u:c+2+u:0,_=0,S=s.length;_0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,i=this.$animations,s=i&&i.x,r=i&&i.y;if(s||r){const o=qa[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=qx(this,t),l=Object.assign({},o,this._size),c=Qx(n,t,l),u=Zx(t,l,c,n);(s._to!==u.x||r._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(n);const s={width:this.width,height:this.height},r={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=Ae(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(r,t,s,n),JS(t,n.textDirection),r.y+=o.top,this.drawTitle(r,t,n),this.drawBody(r,t,n),this.drawFooter(r,t,n),tM(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const i=this._active,s=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),r=!Rd(i,s),o=this._positionChanged(s,n);(r||o)&&(this._active=s,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,i=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,r=this._active||[],o=this._getActiveElements(t,r,n,i),a=this._positionChanged(o,t),l=n||!Rd(o,r)||a;return l&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,i,s){const r=this.options;if(t.type==="mouseout")return[];if(!s)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const o=this.chart.getElementsAtEventForMode(t,r.mode,r,i);return r.reverse&&o.reverse(),o}_positionChanged(t,n){const{caretX:i,caretY:s,options:r}=this,o=qa[r.position].call(this,t,n);return o!==!1&&(i!==o.x||s!==o.y)}},K(kp,"positioners",qa),kp);var qL={id:"tooltip",_element:eb,positioners:qa,afterInit(e,t,n){n&&(e.tooltip=new eb({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:EM},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"]},QL=Object.freeze({__proto__:null,Colors:cL,Decimation:fL,Filler:RL,Legend:FL,SubTitle:zL,Title:VL,Tooltip:qL});const ZL=(e,t,n,i)=>(typeof t=="string"?(n=e.push(t)-1,i.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function JL(e,t,n,i){const s=e.indexOf(t);if(s===-1)return ZL(e,t,n,i);const r=e.lastIndexOf(t);return s!==r?n:s}const tN=(e,t)=>e===null?null:we(Math.round(e),0,t);function nb(e){const t=this.getLabels();return e>=0&&en.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}},K(Nu,"id","category"),K(Nu,"defaults",{ticks:{callback:nb}}),Nu);function nN(e,t){const n=[],{bounds:s,step:r,min:o,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:h}=e,f=r||1,p=u-1,{min:m,max:v}=t,y=!bt(o),g=!bt(a),x=!bt(c),_=(v-m)/(d+1);let w=Gv((v-m)/p/f)*f,S,C,M,P;if(w<1e-14&&!y&&!g)return[{value:m},{value:v}];P=Math.ceil(v/w)-Math.floor(m/w),P>p&&(w=Gv(P*w/p/f)*f),bt(l)||(S=Math.pow(10,l),w=Math.ceil(w*S)/S),s==="ticks"?(C=Math.floor(m/w)*w,M=Math.ceil(v/w)*w):(C=m,M=v),y&&g&&r&&WA((a-o)/r,w/1e3)?(P=Math.round(Math.min((a-o)/w,u)),w=(a-o)/P,C=o,M=a):x?(C=y?o:C,M=g?a:M,P=c-1,w=(M-C)/P):(P=(M-C)/w,hl(P,Math.round(P),w/1e3)?P=Math.round(P):P=Math.ceil(P));const T=Math.max(qv(w),qv(C));S=Math.pow(10,bt(l)?T:l),C=Math.round(C*S)/S,M=Math.round(M*S)/S;let A=0;for(y&&(h&&C!==o?(n.push({value:o}),Ca)break;n.push({value:E})}return g&&h&&M!==a?n.length&&hl(n[n.length-1].value,a,ib(a,_,e))?n[n.length-1].value=a:n.push({value:a}):(!g||M===a)&&n.push({value:M}),n}function ib(e,t,{horizontal:n,minRotation:i}){const s=Jn(i),r=(n?Math.sin(s):Math.cos(s))||.001,o=.75*t*(""+e).length;return Math.min(t/r,o)}let Bd=class extends mc{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 bt(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:i}=this.getUserBounds();let{min:s,max:r}=this;const o=l=>s=n?s:l,a=l=>r=i?r:l;if(t){const l=vi(s),c=vi(r);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(s===r){let l=r===0?1:Math.abs(r*.05);a(r+l),t||o(s-l)}this.min=s,this.max=r}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:i}=t,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),n=n||11),n&&(s=Math.min(n,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,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},r=this._range||this,o=nN(s,r);return t.bounds==="ticks"&&jS(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,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-n)/Math.max(t.length-1,1)/2;n-=s,i+=s}this._startValue=n,this._endValue=i,this._valueRange=i-n}getLabelForValue(t){return fc(t,this.chart.options.locale,this.options.ticks.format)}};var ju;let iN=(ju=class extends Bd{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=oe(t)?t:0,this.max=oe(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,i=Jn(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,r.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}},K(ju,"id","linear"),K(ju,"defaults",{ticks:{callback:Mh.formatters.numeric}}),ju);const Xl=e=>Math.floor(Ss(e)),ar=(e,t)=>Math.pow(10,Xl(e)+t);function sb(e){return e/Math.pow(10,Xl(e))===1}function rb(e,t,n){const i=Math.pow(10,n),s=Math.floor(e/i);return Math.ceil(t/i)-s}function sN(e,t){const n=t-e;let i=Xl(n);for(;rb(e,t,i)>10;)i++;for(;rb(e,t,i)<10;)i--;return Math.min(i,Xl(e))}function rN(e,{min:t,max:n}){t=mn(e.min,t);const i=[],s=Xl(t);let r=sN(t,n),o=r<0?Math.pow(10,Math.abs(r)):1;const a=Math.pow(10,r),l=s>r?Math.pow(10,s):0,c=Math.round((t-l)*o)/o,u=Math.floor((t-l)/a/10)*a*10;let d=Math.floor((c-u)/Math.pow(10,r)),h=mn(e.min,Math.round((l+u+d*Math.pow(10,r))*o)/o);for(;h=10?d=d<15?15:20:d++,d>=20&&(r++,d=2,o=r>=0?1:o),h=Math.round((l+u+d*Math.pow(10,r))*o)/o;const f=mn(e.max,h);return i.push({value:f,major:sb(f),significand:d}),i}var $u;let oN=($u=class extends mc{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const i=Bd.prototype.parse.apply(this,[t,n]);if(i===0){this._zero=!0;return}return oe(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=oe(t)?Math.max(0,t):null,this.max=oe(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!oe(this._userMin)&&(this.min=t===ar(this.min,0)?ar(this.min,-1):ar(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let i=this.min,s=this.max;const r=a=>i=t?i:a,o=a=>s=n?s:a;i===s&&(i<=0?(r(1),o(10)):(r(ar(i,-1)),o(ar(s,1)))),i<=0&&r(ar(s,-1)),s<=0&&o(ar(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},i=rN(n,this);return t.bounds==="ticks"&&jS(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":fc(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Ss(t),this._valueRange=Ss(this.max)-Ss(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Ss(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}},K($u,"id","logarithmic"),K($u,"defaults",{ticks:{callback:Mh.formatters.logarithmic,major:{enabled:!0}}}),$u);function Pm(e){const t=e.ticks;if(t.display&&e.display){const n=Ae(t.backdropPadding);return at(t.font&&t.font.size,ne.font.size)+n.height}return 0}function aN(e,t,n){return n=Ut(n)?n:[n],{w:oO(e,t.string,n),h:n.length*t.lineHeight}}function ob(e,t,n,i,s){return e===i||e===s?{start:t-n/2,end:t+n/2}:es?{start:t-n,end:t}:{start:t,end:t+n}}function lN(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),i=[],s=[],r=e._pointLabels.length,o=e.options.pointLabels,a=o.centerPointLabels?Kt/r:0;for(let l=0;lt.r&&(a=(i.end-t.r)/r,e.r=Math.max(e.r,t.r+a)),s.startt.b&&(l=(s.end-t.b)/o,e.b=Math.max(e.b,t.b+l))}function uN(e,t,n){const i=e.drawingArea,{extra:s,additionalAngle:r,padding:o,size:a}=n,l=e.getPointPosition(t,i+s+o,r),c=Math.round(ly(yn(l.angle+ue))),u=mN(l.y,a.h,c),d=fN(c),h=pN(l.x,a.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:h,top:u,right:h+a.w,bottom:u+a.h}}function dN(e,t){if(!t)return!0;const{left:n,top:i,right:s,bottom:r}=e;return!(Wi({x:n,y:i},t)||Wi({x:n,y:r},t)||Wi({x:s,y:i},t)||Wi({x:s,y:r},t))}function hN(e,t,n){const i=[],s=e._pointLabels.length,r=e.options,{centerPointLabels:o,display:a}=r.pointLabels,l={extra:Pm(r)/2,additionalAngle:o?Kt/s:0};let c;for(let u=0;u270||n<90)&&(e-=t),e}function gN(e,t,n){const{left:i,top:s,right:r,bottom:o}=n,{backdropColor:a}=t;if(!bt(a)){const l=Cr(t.borderRadius),c=Ae(t.backdropPadding);e.fillStyle=a;const u=i-c.left,d=s-c.top,h=r-i+c.width,f=o-s+c.height;Object.values(l).some(p=>p!==0)?(e.beginPath(),Ul(e,{x:u,y:d,w:h,h:f,radius:l}),e.fill()):e.fillRect(u,d,h,f)}}function yN(e,t){const{ctx:n,options:{pointLabels:i}}=e;for(let s=t-1;s>=0;s--){const r=e._pointLabelItems[s];if(!r.visible)continue;const o=i.setContext(e.getPointLabelContext(s));gN(n,o,r);const a=ge(o.font),{x:l,y:c,textAlign:u}=r;Br(n,e._pointLabels[s],l,c+a.lineHeight/2,a,{color:o.color,textAlign:u,textBaseline:"middle"})}}function AM(e,t,n,i){const{ctx:s}=e;if(n)s.arc(e.xCenter,e.yCenter,t,0,Xt);else{let r=e.getPointPosition(0,t);s.moveTo(r.x,r.y);for(let o=1;o{const s=$t(this.options.pointLabels.callback,[n,i],this);return s||s===0?s:""}).filter((n,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?lN(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,i,s){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,i,s))}getIndexAngle(t){const n=Xt/(this._pointLabels.length||1),i=this.options.startAngle||0;return yn(t*n+Jn(i))}getDistanceFromCenterForValue(t){if(bt(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(bt(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{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const h=this.getContext(d),f=s.setContext(h),p=r.setContext(h);vN(this,f,l,o,p)}}),i.display){for(t.save(),a=o-1;a>=0;a--){const u=i.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:h}=u;!h||!d||(t.lineWidth=h,t.strokeStyle=d,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,i=n.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let r,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!n.reverse)return;const c=i.setContext(this.getContext(l)),u=ge(c.font);if(r=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,o=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const d=Ae(c.backdropPadding);t.fillRect(-o/2-d.left,-r-u.size/2-d.top,o+d.width,u.size+d.height)}Br(t,a.label,0,-r,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}},K(ro,"id","radialLinear"),K(ro,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Mh.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),K(ro,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),K(ro,"descriptors",{angleLines:{_fallback:"grid"}}),ro);const Eh={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}},tn=Object.keys(Eh);function ab(e,t){return e-t}function lb(e,t){if(bt(t))return null;const n=e._adapter,{parser:i,round:s,isoWeekday:r}=e._parseOpts;let o=t;return typeof i=="function"&&(o=i(o)),oe(o)||(o=typeof i=="string"?n.parse(o,i):n.parse(o)),o===null?null:(s&&(o=s==="week"&&(Wo(r)||r===!0)?n.startOf(o,"isoWeek",r):n.startOf(o,s)),+o)}function cb(e,t,n,i){const s=tn.length;for(let r=tn.indexOf(e);r=tn.indexOf(n);r--){const o=tn[r];if(Eh[o].common&&e._adapter.diff(s,i,o)>=t-1)return o}return tn[n?tn.indexOf(n):0]}function wN(e){for(let t=tn.indexOf(e)+1,n=tn.length;t=t?n[i]:n[s];e[r]=!0}}function kN(e,t,n,i){const s=e._adapter,r=+s.startOf(t[0].value,i),o=t[t.length-1].value;let a,l;for(a=r;a<=o;a=+s.add(a,1,i))l=n[a],l>=0&&(t[l].major=!0);return t}function db(e,t,n){const i=[],s={},r=t.length;let o,a;for(o=0;o+t.value))}initOffsets(t=[]){let n=0,i=0,s,r;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?n=1-s:n=(this.getDecimalForValue(t[1])-s)/2,r=this.getDecimalForValue(t[t.length-1]),t.length===1?i=r:i=(r-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;n=we(n,0,o),i=we(i,0,o),this._offsets={start:n,end:i,factor:1/(n+1+i)}}_generate(){const t=this._adapter,n=this.min,i=this.max,s=this.options,r=s.time,o=r.unit||cb(r.minUnit,n,i,this._getLabelCapacity(n)),a=at(s.ticks.stepSize,1),l=o==="week"?r.isoWeekday:!1,c=Wo(l)||l===!0,u={};let d=n,h,f;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":o),t.diff(i,n,o)>1e5*a)throw new Error(n+" and "+i+" are too far apart with stepSize of "+a+" "+o);const p=s.ticks.source==="data"&&this.getDataTimestamps();for(h=d,f=0;h+m)}getLabelForValue(t){const n=this._adapter,i=this.options.time;return i.tooltipFormat?n.format(t,i.tooltipFormat):n.format(t,i.displayFormats.datetime)}format(t,n){const s=this.options.time.displayFormats,r=this._unit,o=n||s[r];return this._adapter.format(t,o)}_tickFormatFunction(t,n,i,s){const r=this.options,o=r.ticks.callback;if(o)return $t(o,[t,n,i],this);const a=r.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],d=c&&a[c],h=i[n],f=c&&d&&h&&h.major;return this._adapter.format(t,s||(f?d:u))}generateTickLabels(t){let n,i,s;for(n=0,i=t.length;n0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,i;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(n=0,i=s.length;n=e[i].pos&&t<=e[s].pos&&({lo:i,hi:s}=zi(e,"pos",t)),{pos:r,time:a}=e[i],{pos:o,time:l}=e[s]):(t>=e[i].time&&t<=e[s].time&&({lo:i,hi:s}=zi(e,"time",t)),{time:r,pos:a}=e[i],{time:o,pos:l}=e[s]);const c=o-r;return c?a+(l-a)*(t-r)/c:a}var Fu;let SN=(Fu=class extends Tm{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=lu(n,this.min),this._tableRange=lu(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:i}=this,s=[],r=[];let o,a,l,c,u;for(o=0,a=t.length;o=n&&c<=i&&s.push(c);if(s.length<2)return[{time:n,pos:0},{time:i,pos:1}];for(o=0,a=s.length;os-r)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),i=this.getLabelTimestamps();return n.length&&i.length?t=this.normalize(n.concat(i)):t=n.length?n:i,t=this._cache.all=t,t}getDecimalForValue(t){return(lu(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return lu(this._table,i*this._tableRange+this._minPos,!0)}},K(Fu,"id","timeseries"),K(Fu,"defaults",Tm.defaults),Fu);var MN=Object.freeze({__proto__:null,CategoryScale:eN,LinearScale:iN,LogarithmicScale:oN,RadialLinearScale:bN,TimeScale:Tm,TimeSeriesScale:SN});const CN=[P2,iL,QL,MN];by.register(...CN);function OM(e){var t,n,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t"u")return!1;var t=si(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function FN(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var i=t.styles[n]||{},s=t.attributes[n]||{},r=t.elements[n];!Fn(r)||!ki(r)||(Object.assign(r.style,i),Object.keys(s).forEach(function(o){var a=s[o];a===!1?r.removeAttribute(o):r.setAttribute(o,a===!0?"":a)}))})}function BN(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(i){var s=t.elements[i],r=t.attributes[i]||{},o=Object.keys(t.styles.hasOwnProperty(i)?t.styles[i]:n[i]),a=o.reduce(function(l,c){return l[c]="",l},{});!Fn(s)||!ki(s)||(Object.assign(s.style,a),Object.keys(r).forEach(function(l){s.removeAttribute(l)}))})}}const VN={name:"applyStyles",enabled:!0,phase:"write",fn:FN,effect:BN,requires:["computeStyles"]};function xi(e){return e.split("-")[0]}var Tr=Math.max,Vd=Math.min,Ko=Math.round;function Go(e,t){t===void 0&&(t=!1);var n=e.getBoundingClientRect(),i=1,s=1;if(Fn(e)&&t){var r=e.offsetHeight,o=e.offsetWidth;o>0&&(i=Ko(n.width)/o||1),r>0&&(s=Ko(n.height)/r||1)}return{width:n.width/i,height:n.height/s,top:n.top/s,right:n.right/i,bottom:n.bottom/s,left:n.left/i,x:n.left/i,y:n.top/s}}function My(e){var t=Go(e),n=e.offsetWidth,i=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-i)<=1&&(i=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:i}}function NM(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Sy(n)){var i=t;do{if(i&&e.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function ns(e){return si(e).getComputedStyle(e)}function zN(e){return["table","td","th"].indexOf(ki(e))>=0}function Js(e){return((Xo(e)?e.ownerDocument:e.document)||window.document).documentElement}function Ah(e){return ki(e)==="html"?e:e.assignedSlot||e.parentNode||(Sy(e)?e.host:null)||Js(e)}function mb(e){return!Fn(e)||ns(e).position==="fixed"?null:e.offsetParent}function WN(e){var t=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,n=navigator.userAgent.indexOf("Trident")!==-1;if(n&&Fn(e)){var i=ns(e);if(i.position==="fixed")return null}var s=Ah(e);for(Sy(s)&&(s=s.host);Fn(s)&&["html","body"].indexOf(ki(s))<0;){var r=ns(s);if(r.transform!=="none"||r.perspective!=="none"||r.contain==="paint"||["transform","perspective"].indexOf(r.willChange)!==-1||t&&r.willChange==="filter"||t&&r.filter&&r.filter!=="none")return s;s=s.parentNode}return null}function yc(e){for(var t=si(e),n=mb(e);n&&zN(n)&&ns(n).position==="static";)n=mb(n);return n&&(ki(n)==="html"||ki(n)==="body"&&ns(n).position==="static")?t:n||WN(e)||t}function Cy(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function ml(e,t,n){return Tr(e,Vd(t,n))}function HN(e,t,n){var i=ml(e,t,n);return i>n?n:i}function jM(){return{top:0,right:0,bottom:0,left:0}}function $M(e){return Object.assign({},jM(),e)}function IM(e,t){return t.reduce(function(n,i){return n[i]=e,n},{})}var UN=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,$M(typeof t!="number"?t:IM(t,gc))};function YN(e){var t,n=e.state,i=e.name,s=e.options,r=n.elements.arrow,o=n.modifiersData.popperOffsets,a=xi(n.placement),l=Cy(a),c=[cn,Wn].indexOf(a)>=0,u=c?"height":"width";if(!(!r||!o)){var d=UN(s.padding,n),h=My(r),f=l==="y"?ln:cn,p=l==="y"?zn:Wn,m=n.rects.reference[u]+n.rects.reference[l]-o[l]-n.rects.popper[u],v=o[l]-n.rects.reference[l],y=yc(r),g=y?l==="y"?y.clientHeight||0:y.clientWidth||0:0,x=m/2-v/2,_=d[f],w=g-h[u]-d[p],S=g/2-h[u]/2+x,C=ml(_,S,w),M=l;n.modifiersData[i]=(t={},t[M]=C,t.centerOffset=C-S,t)}}function XN(e){var t=e.state,n=e.options,i=n.element,s=i===void 0?"[data-popper-arrow]":i;s!=null&&(typeof s=="string"&&(s=t.elements.popper.querySelector(s),!s)||NM(t.elements.popper,s)&&(t.elements.arrow=s))}const KN={name:"arrow",enabled:!0,phase:"main",fn:YN,effect:XN,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function qo(e){return e.split("-")[1]}var GN={top:"auto",right:"auto",bottom:"auto",left:"auto"};function qN(e){var t=e.x,n=e.y,i=window,s=i.devicePixelRatio||1;return{x:Ko(t*s)/s||0,y:Ko(n*s)/s||0}}function gb(e){var t,n=e.popper,i=e.popperRect,s=e.placement,r=e.variation,o=e.offsets,a=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,d=e.isFixed,h=o.x,f=h===void 0?0:h,p=o.y,m=p===void 0?0:p,v=typeof u=="function"?u({x:f,y:m}):{x:f,y:m};f=v.x,m=v.y;var y=o.hasOwnProperty("x"),g=o.hasOwnProperty("y"),x=cn,_=ln,w=window;if(c){var S=yc(n),C="clientHeight",M="clientWidth";if(S===si(n)&&(S=Js(n),ns(S).position!=="static"&&a==="absolute"&&(C="scrollHeight",M="scrollWidth")),S=S,s===ln||(s===cn||s===Wn)&&r===Kl){_=zn;var P=d&&S===w&&w.visualViewport?w.visualViewport.height:S[C];m-=P-i.height,m*=l?1:-1}if(s===cn||(s===ln||s===zn)&&r===Kl){x=Wn;var T=d&&S===w&&w.visualViewport?w.visualViewport.width:S[M];f-=T-i.width,f*=l?1:-1}}var A=Object.assign({position:a},c&&GN),E=u===!0?qN({x:f,y:m}):{x:f,y:m};if(f=E.x,m=E.y,l){var z;return Object.assign({},A,(z={},z[_]=g?"0":"",z[x]=y?"0":"",z.transform=(w.devicePixelRatio||1)<=1?"translate("+f+"px, "+m+"px)":"translate3d("+f+"px, "+m+"px, 0)",z))}return Object.assign({},A,(t={},t[_]=g?m+"px":"",t[x]=y?f+"px":"",t.transform="",t))}function QN(e){var t=e.state,n=e.options,i=n.gpuAcceleration,s=i===void 0?!0:i,r=n.adaptive,o=r===void 0?!0:r,a=n.roundOffsets,l=a===void 0?!0:a,c={placement:xi(t.placement),variation:qo(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:s,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,gb(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,gb(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const ZN={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:QN,data:{}};var cu={passive:!0};function JN(e){var t=e.state,n=e.instance,i=e.options,s=i.scroll,r=s===void 0?!0:s,o=i.resize,a=o===void 0?!0:o,l=si(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return r&&c.forEach(function(u){u.addEventListener("scroll",n.update,cu)}),a&&l.addEventListener("resize",n.update,cu),function(){r&&c.forEach(function(u){u.removeEventListener("scroll",n.update,cu)}),a&&l.removeEventListener("resize",n.update,cu)}}const tj={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:JN,data:{}};var ej={left:"right",right:"left",bottom:"top",top:"bottom"};function td(e){return e.replace(/left|right|bottom|top/g,function(t){return ej[t]})}var nj={start:"end",end:"start"};function yb(e){return e.replace(/start|end/g,function(t){return nj[t]})}function Py(e){var t=si(e),n=t.pageXOffset,i=t.pageYOffset;return{scrollLeft:n,scrollTop:i}}function Ty(e){return Go(Js(e)).left+Py(e).scrollLeft}function ij(e){var t=si(e),n=Js(e),i=t.visualViewport,s=n.clientWidth,r=n.clientHeight,o=0,a=0;return i&&(s=i.width,r=i.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(o=i.offsetLeft,a=i.offsetTop)),{width:s,height:r,x:o+Ty(e),y:a}}function sj(e){var t,n=Js(e),i=Py(e),s=(t=e.ownerDocument)==null?void 0:t.body,r=Tr(n.scrollWidth,n.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),o=Tr(n.scrollHeight,n.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-i.scrollLeft+Ty(e),l=-i.scrollTop;return ns(s||n).direction==="rtl"&&(a+=Tr(n.clientWidth,s?s.clientWidth:0)-r),{width:r,height:o,x:a,y:l}}function Dy(e){var t=ns(e),n=t.overflow,i=t.overflowX,s=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+s+i)}function FM(e){return["html","body","#document"].indexOf(ki(e))>=0?e.ownerDocument.body:Fn(e)&&Dy(e)?e:FM(Ah(e))}function gl(e,t){var n;t===void 0&&(t=[]);var i=FM(e),s=i===((n=e.ownerDocument)==null?void 0:n.body),r=si(i),o=s?[r].concat(r.visualViewport||[],Dy(i)?i:[]):i,a=t.concat(o);return s?a:a.concat(gl(Ah(o)))}function Dm(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function rj(e){var t=Go(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}function vb(e,t){return t===RM?Dm(ij(e)):Xo(t)?rj(t):Dm(sj(Js(e)))}function oj(e){var t=gl(Ah(e)),n=["absolute","fixed"].indexOf(ns(e).position)>=0,i=n&&Fn(e)?yc(e):e;return Xo(i)?t.filter(function(s){return Xo(s)&&NM(s,i)&&ki(s)!=="body"}):[]}function aj(e,t,n){var i=t==="clippingParents"?oj(e):[].concat(t),s=[].concat(i,[n]),r=s[0],o=s.reduce(function(a,l){var c=vb(e,l);return a.top=Tr(c.top,a.top),a.right=Vd(c.right,a.right),a.bottom=Vd(c.bottom,a.bottom),a.left=Tr(c.left,a.left),a},vb(e,r));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function BM(e){var t=e.reference,n=e.element,i=e.placement,s=i?xi(i):null,r=i?qo(i):null,o=t.x+t.width/2-n.width/2,a=t.y+t.height/2-n.height/2,l;switch(s){case ln:l={x:o,y:t.y-n.height};break;case zn:l={x:o,y:t.y+t.height};break;case Wn:l={x:t.x+t.width,y:a};break;case cn:l={x:t.x-n.width,y:a};break;default:l={x:t.x,y:t.y}}var c=s?Cy(s):null;if(c!=null){var u=c==="y"?"height":"width";switch(r){case Yo:l[c]=l[c]-(t[u]/2-n[u]/2);break;case Kl:l[c]=l[c]+(t[u]/2-n[u]/2);break}}return l}function Gl(e,t){t===void 0&&(t={});var n=t,i=n.placement,s=i===void 0?e.placement:i,r=n.boundary,o=r===void 0?PN:r,a=n.rootBoundary,l=a===void 0?RM:a,c=n.elementContext,u=c===void 0?Sa:c,d=n.altBoundary,h=d===void 0?!1:d,f=n.padding,p=f===void 0?0:f,m=$M(typeof p!="number"?p:IM(p,gc)),v=u===Sa?TN:Sa,y=e.rects.popper,g=e.elements[h?v:u],x=aj(Xo(g)?g:g.contextElement||Js(e.elements.popper),o,l),_=Go(e.elements.reference),w=BM({reference:_,element:y,strategy:"absolute",placement:s}),S=Dm(Object.assign({},y,w)),C=u===Sa?S:_,M={top:x.top-C.top+m.top,bottom:C.bottom-x.bottom+m.bottom,left:x.left-C.left+m.left,right:C.right-x.right+m.right},P=e.modifiersData.offset;if(u===Sa&&P){var T=P[s];Object.keys(M).forEach(function(A){var E=[Wn,zn].indexOf(A)>=0?1:-1,z=[ln,zn].indexOf(A)>=0?"y":"x";M[A]+=T[z]*E})}return M}function lj(e,t){t===void 0&&(t={});var n=t,i=n.placement,s=n.boundary,r=n.rootBoundary,o=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=l===void 0?LM:l,u=qo(i),d=u?a?pb:pb.filter(function(p){return qo(p)===u}):gc,h=d.filter(function(p){return c.indexOf(p)>=0});h.length===0&&(h=d);var f=h.reduce(function(p,m){return p[m]=Gl(e,{placement:m,boundary:s,rootBoundary:r,padding:o})[xi(m)],p},{});return Object.keys(f).sort(function(p,m){return f[p]-f[m]})}function cj(e){if(xi(e)===ky)return[];var t=td(e);return[yb(e),t,yb(t)]}function uj(e){var t=e.state,n=e.options,i=e.name;if(!t.modifiersData[i]._skip){for(var s=n.mainAxis,r=s===void 0?!0:s,o=n.altAxis,a=o===void 0?!0:o,l=n.fallbackPlacements,c=n.padding,u=n.boundary,d=n.rootBoundary,h=n.altBoundary,f=n.flipVariations,p=f===void 0?!0:f,m=n.allowedAutoPlacements,v=t.options.placement,y=xi(v),g=y===v,x=l||(g||!p?[td(v)]:cj(v)),_=[v].concat(x).reduce(function(Z,O){return Z.concat(xi(O)===ky?lj(t,{placement:O,boundary:u,rootBoundary:d,padding:c,flipVariations:p,allowedAutoPlacements:m}):O)},[]),w=t.rects.reference,S=t.rects.popper,C=new Map,M=!0,P=_[0],T=0;T<_.length;T++){var A=_[T],E=xi(A),z=qo(A)===Yo,N=[ln,zn].indexOf(E)>=0,R=N?"width":"height",L=Gl(t,{placement:A,boundary:u,rootBoundary:d,altBoundary:h,padding:c}),B=N?z?Wn:cn:z?zn:ln;w[R]>S[R]&&(B=td(B));var D=td(B),$=[];if(r&&$.push(L[E]<=0),a&&$.push(L[B]<=0,L[D]<=0),$.every(function(Z){return Z})){P=A,M=!1;break}C.set(A,$)}if(M)for(var F=p?3:1,V=function(O){var U=_.find(function(lt){var ct=C.get(lt);if(ct)return ct.slice(0,O).every(function(kt){return kt})});if(U)return P=U,"break"},W=F;W>0;W--){var et=V(W);if(et==="break")break}t.placement!==P&&(t.modifiersData[i]._skip=!0,t.placement=P,t.reset=!0)}}const VM={name:"flip",enabled:!0,phase:"main",fn:uj,requiresIfExists:["offset"],data:{_skip:!1}};function xb(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function bb(e){return[ln,Wn,zn,cn].some(function(t){return e[t]>=0})}function dj(e){var t=e.state,n=e.name,i=t.rects.reference,s=t.rects.popper,r=t.modifiersData.preventOverflow,o=Gl(t,{elementContext:"reference"}),a=Gl(t,{altBoundary:!0}),l=xb(o,i),c=xb(a,s,r),u=bb(l),d=bb(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}const hj={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:dj};function fj(e,t,n){var i=xi(e),s=[cn,ln].indexOf(i)>=0?-1:1,r=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,o=r[0],a=r[1];return o=o||0,a=(a||0)*s,[cn,Wn].indexOf(i)>=0?{x:a,y:o}:{x:o,y:a}}function pj(e){var t=e.state,n=e.options,i=e.name,s=n.offset,r=s===void 0?[0,0]:s,o=LM.reduce(function(u,d){return u[d]=fj(d,t.rects,r),u},{}),a=o[t.placement],l=a.x,c=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[i]=o}const mj={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:pj};function gj(e){var t=e.state,n=e.name;t.modifiersData[n]=BM({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const yj={name:"popperOffsets",enabled:!0,phase:"read",fn:gj,data:{}};function vj(e){return e==="x"?"y":"x"}function xj(e){var t=e.state,n=e.options,i=e.name,s=n.mainAxis,r=s===void 0?!0:s,o=n.altAxis,a=o===void 0?!1:o,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,d=n.padding,h=n.tether,f=h===void 0?!0:h,p=n.tetherOffset,m=p===void 0?0:p,v=Gl(t,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),y=xi(t.placement),g=qo(t.placement),x=!g,_=Cy(y),w=vj(_),S=t.modifiersData.popperOffsets,C=t.rects.reference,M=t.rects.popper,P=typeof m=="function"?m(Object.assign({},t.rects,{placement:t.placement})):m,T=typeof P=="number"?{mainAxis:P,altAxis:P}:Object.assign({mainAxis:0,altAxis:0},P),A=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,E={x:0,y:0};if(S){if(r){var z,N=_==="y"?ln:cn,R=_==="y"?zn:Wn,L=_==="y"?"height":"width",B=S[_],D=B+v[N],$=B-v[R],F=f?-M[L]/2:0,V=g===Yo?C[L]:M[L],W=g===Yo?-M[L]:-C[L],et=t.elements.arrow,Z=f&&et?My(et):{width:0,height:0},O=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:jM(),U=O[N],lt=O[R],ct=ml(0,C[L],Z[L]),kt=x?C[L]/2-F-ct-U-T.mainAxis:V-ct-U-T.mainAxis,it=x?-C[L]/2+F+ct+lt+T.mainAxis:W+ct+lt+T.mainAxis,Rt=t.elements.arrow&&yc(t.elements.arrow),Ct=Rt?_==="y"?Rt.clientTop||0:Rt.clientLeft||0:0,Qt=(z=A==null?void 0:A[_])!=null?z:0,ft=B+kt-Qt-Ct,wt=B+it-Qt,dt=ml(f?Vd(D,ft):D,B,f?Tr($,wt):$);S[_]=dt,E[_]=dt-B}if(a){var jt,pt=_==="x"?ln:cn,xt=_==="x"?zn:Wn,J=S[w],mt=w==="y"?"height":"width",q=J+v[pt],ye=J-v[xt],Dt=[ln,cn].indexOf(y)!==-1,he=(jt=A==null?void 0:A[w])!=null?jt:0,Un=Dt?q:J-C[mt]-M[mt]-he+T.altAxis,Yn=Dt?J+C[mt]+M[mt]-he-T.altAxis:ye,Mn=f&&Dt?HN(Un,J,Yn):ml(f?Un:q,J,f?Yn:ye);S[w]=Mn,E[w]=Mn-J}t.modifiersData[i]=E}}const bj={name:"preventOverflow",enabled:!0,phase:"main",fn:xj,requiresIfExists:["offset"]};function _j(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function wj(e){return e===si(e)||!Fn(e)?Py(e):_j(e)}function kj(e){var t=e.getBoundingClientRect(),n=Ko(t.width)/e.offsetWidth||1,i=Ko(t.height)/e.offsetHeight||1;return n!==1||i!==1}function Sj(e,t,n){n===void 0&&(n=!1);var i=Fn(t),s=Fn(t)&&kj(t),r=Js(t),o=Go(e,s),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!n)&&((ki(t)!=="body"||Dy(r))&&(a=wj(t)),Fn(t)?(l=Go(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):r&&(l.x=Ty(r))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function Mj(e){var t=new Map,n=new Set,i=[];e.forEach(function(r){t.set(r.name,r)});function s(r){n.add(r.name);var o=[].concat(r.requires||[],r.requiresIfExists||[]);o.forEach(function(a){if(!n.has(a)){var l=t.get(a);l&&s(l)}}),i.push(r)}return e.forEach(function(r){n.has(r.name)||s(r)}),i}function Cj(e){var t=Mj(e);return IN.reduce(function(n,i){return n.concat(t.filter(function(s){return s.phase===i}))},[])}function Pj(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function Tj(e){var t=e.reduce(function(n,i){var s=n[i.name];return n[i.name]=s?Object.assign({},s,i,{options:Object.assign({},s.options,i.options),data:Object.assign({},s.data,i.data)}):i,n},{});return Object.keys(t).map(function(n){return t[n]})}var _b={placement:"bottom",modifiers:[],strategy:"absolute"};function wb(){for(var e=arguments.length,t=new Array(e),n=0;ne,isStatic:!1,reducedMotion:"never"}),Rh=k.createContext({}),Lh=k.createContext(null),Nh=typeof document<"u",Ey=Nh?k.useLayoutEffect:k.useEffect,WM=k.createContext({strict:!1}),Ay=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),Fj="framerAppearId",HM="data-"+Ay(Fj);function Bj(e,t,n,i){const{visualElement:s}=k.useContext(Rh),r=k.useContext(WM),o=k.useContext(Lh),a=k.useContext(zM).reducedMotion,l=k.useRef();i=i||r.renderer,!l.current&&i&&(l.current=i(e,{visualState:t,parent:s,props:n,presenceContext:o,blockInitialAnimation:o?o.initial===!1:!1,reducedMotionConfig:a}));const c=l.current;k.useInsertionEffect(()=>{c&&c.update(n,o)});const u=k.useRef(!!(n[HM]&&!window.HandoffComplete));return Ey(()=>{c&&(c.render(),u.current&&c.animationState&&c.animationState.animateChanges())}),k.useEffect(()=>{c&&(c.updateFeatures(),!u.current&&c.animationState&&c.animationState.animateChanges(),u.current&&(u.current=!1,window.HandoffComplete=!0))}),c}function _o(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Vj(e,t,n){return k.useCallback(i=>{i&&e.mount&&e.mount(i),t&&(i?t.mount(i):t.unmount()),n&&(typeof n=="function"?n(i):_o(n)&&(n.current=i))},[t])}function ql(e){return typeof e=="string"||Array.isArray(e)}function jh(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const Oy=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ry=["initial",...Oy];function $h(e){return jh(e.animate)||Ry.some(t=>ql(e[t]))}function UM(e){return!!($h(e)||e.variants)}function zj(e,t){if($h(e)){const{initial:n,animate:i}=e;return{initial:n===!1||ql(n)?n:void 0,animate:ql(i)?i:void 0}}return e.inherit!==!1?t:{}}function Wj(e){const{initial:t,animate:n}=zj(e,k.useContext(Rh));return k.useMemo(()=>({initial:t,animate:n}),[kb(t),kb(n)])}function kb(e){return Array.isArray(e)?e.join(" "):e}const Sb={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Ql={};for(const e in Sb)Ql[e]={isEnabled:t=>Sb[e].some(n=>!!t[n])};function Hj(e){for(const t in e)Ql[t]={...Ql[t],...e[t]}}const Ly=k.createContext({}),YM=k.createContext({}),Uj=Symbol.for("motionComponentSymbol");function Yj({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:i,Component:s}){e&&Hj(e);function r(a,l){let c;const u={...k.useContext(zM),...a,layoutId:Xj(a)},{isStatic:d}=u,h=Wj(a),f=i(a,d);if(!d&&Nh){h.visualElement=Bj(s,f,u,t);const p=k.useContext(YM),m=k.useContext(WM).strict;h.visualElement&&(c=h.visualElement.loadFeatures(u,m,e,p))}return k.createElement(Rh.Provider,{value:h},c&&h.visualElement?k.createElement(c,{visualElement:h.visualElement,...u}):null,n(s,a,Vj(f,h.visualElement,l),f,d,h.visualElement))}const o=k.forwardRef(r);return o[Uj]=s,o}function Xj({layoutId:e}){const t=k.useContext(Ly).id;return t&&e!==void 0?t+"-"+e:e}function Kj(e){function t(i,s={}){return Yj(e(i,s))}if(typeof Proxy>"u")return t;const n=new Map;return new Proxy(t,{get:(i,s)=>(n.has(s)||n.set(s,t(s)),n.get(s))})}const Gj=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Ny(e){return typeof e!="string"||e.includes("-")?!1:!!(Gj.indexOf(e)>-1||/[A-Z]/.test(e))}const zd={};function qj(e){Object.assign(zd,e)}const vc=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ur=new Set(vc);function XM(e,{layout:t,layoutId:n}){return Ur.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!zd[e]||e==="opacity")}const un=e=>!!(e&&e.getVelocity),Qj={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Zj=vc.length;function Jj(e,{enableHardwareAcceleration:t=!0,allowTransformNone:n=!0},i,s){let r="";for(let o=0;ot=>typeof t=="string"&&t.startsWith(e),GM=KM("--"),Em=KM("var(--"),t$=/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,e$=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Hs=(e,t,n)=>Math.min(Math.max(n,e),t),Yr={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},yl={...Yr,transform:e=>Hs(0,1,e)},uu={...Yr,default:1},vl=e=>Math.round(e*1e5)/1e5,Ih=/(-)?([\d]*\.?[\d])+/g,qM=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,n$=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function xc(e){return typeof e=="string"}const bc=e=>({test:t=>xc(t)&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),ps=bc("deg"),bi=bc("%"),st=bc("px"),i$=bc("vh"),s$=bc("vw"),Mb={...bi,parse:e=>bi.parse(e)/100,transform:e=>bi.transform(e*100)},Cb={...Yr,transform:Math.round},QM={borderWidth:st,borderTopWidth:st,borderRightWidth:st,borderBottomWidth:st,borderLeftWidth:st,borderRadius:st,radius:st,borderTopLeftRadius:st,borderTopRightRadius:st,borderBottomRightRadius:st,borderBottomLeftRadius:st,width:st,maxWidth:st,height:st,maxHeight:st,size:st,top:st,right:st,bottom:st,left:st,padding:st,paddingTop:st,paddingRight:st,paddingBottom:st,paddingLeft:st,margin:st,marginTop:st,marginRight:st,marginBottom:st,marginLeft:st,rotate:ps,rotateX:ps,rotateY:ps,rotateZ:ps,scale:uu,scaleX:uu,scaleY:uu,scaleZ:uu,skew:ps,skewX:ps,skewY:ps,distance:st,translateX:st,translateY:st,translateZ:st,x:st,y:st,z:st,perspective:st,transformPerspective:st,opacity:yl,originX:Mb,originY:Mb,originZ:st,zIndex:Cb,fillOpacity:yl,strokeOpacity:yl,numOctaves:Cb};function jy(e,t,n,i){const{style:s,vars:r,transform:o,transformOrigin:a}=e;let l=!1,c=!1,u=!0;for(const d in t){const h=t[d];if(GM(d)){r[d]=h;continue}const f=QM[d],p=e$(h,f);if(Ur.has(d)){if(l=!0,o[d]=p,!u)continue;h!==(f.default||0)&&(u=!1)}else d.startsWith("origin")?(c=!0,a[d]=p):s[d]=p}if(t.transform||(l||i?s.transform=Jj(e.transform,n,u,i):s.transform&&(s.transform="none")),c){const{originX:d="50%",originY:h="50%",originZ:f=0}=a;s.transformOrigin=`${d} ${h} ${f}`}}const $y=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function ZM(e,t,n){for(const i in t)!un(t[i])&&!XM(i,n)&&(e[i]=t[i])}function r$({transformTemplate:e},t,n){return k.useMemo(()=>{const i=$y();return jy(i,t,{enableHardwareAcceleration:!n},e),Object.assign({},i.vars,i.style)},[t])}function o$(e,t,n){const i=e.style||{},s={};return ZM(s,i,e),Object.assign(s,r$(e,t,n)),e.transformValues?e.transformValues(s):s}function a$(e,t,n){const i={},s=o$(e,t,n);return e.drag&&e.dragListener!==!1&&(i.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(i.tabIndex=0),i.style=s,i}const l$=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Wd(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||l$.has(e)}let JM=e=>!Wd(e);function c$(e){e&&(JM=t=>t.startsWith("on")?!Wd(t):e(t))}try{c$(require("@emotion/is-prop-valid").default)}catch{}function u$(e,t,n){const i={};for(const s in e)s==="values"&&typeof e.values=="object"||(JM(s)||n===!0&&Wd(s)||!t&&!Wd(s)||e.draggable&&s.startsWith("onDrag"))&&(i[s]=e[s]);return i}function Pb(e,t,n){return typeof e=="string"?e:st.transform(t+n*e)}function d$(e,t,n){const i=Pb(t,e.x,e.width),s=Pb(n,e.y,e.height);return`${i} ${s}`}const h$={offset:"stroke-dashoffset",array:"stroke-dasharray"},f$={offset:"strokeDashoffset",array:"strokeDasharray"};function p$(e,t,n=1,i=0,s=!0){e.pathLength=1;const r=s?h$:f$;e[r.offset]=st.transform(-i);const o=st.transform(t),a=st.transform(n);e[r.array]=`${o} ${a}`}function Iy(e,{attrX:t,attrY:n,attrScale:i,originX:s,originY:r,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...c},u,d,h){if(jy(e,c,u,h),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:p,dimensions:m}=e;f.transform&&(m&&(p.transform=f.transform),delete f.transform),m&&(s!==void 0||r!==void 0||p.transform)&&(p.transformOrigin=d$(m,s!==void 0?s:.5,r!==void 0?r:.5)),t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),i!==void 0&&(f.scale=i),o!==void 0&&p$(f,o,a,l,!1)}const tC=()=>({...$y(),attrs:{}}),Fy=e=>typeof e=="string"&&e.toLowerCase()==="svg";function m$(e,t,n,i){const s=k.useMemo(()=>{const r=tC();return Iy(r,t,{enableHardwareAcceleration:!1},Fy(i),e.transformTemplate),{...r.attrs,style:{...r.style}}},[t]);if(e.style){const r={};ZM(r,e.style,e),s.style={...r,...s.style}}return s}function g$(e=!1){return(n,i,s,{latestValues:r},o)=>{const l=(Ny(n)?m$:a$)(i,r,o,n),u={...u$(i,typeof n=="string",e),...l,ref:s},{children:d}=i,h=k.useMemo(()=>un(d)?d.get():d,[d]);return k.createElement(n,{...u,children:h})}}function eC(e,{style:t,vars:n},i,s){Object.assign(e.style,t,s&&s.getProjectionStyles(i));for(const r in n)e.style.setProperty(r,n[r])}const nC=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function iC(e,t,n,i){eC(e,t,void 0,i);for(const s in t.attrs)e.setAttribute(nC.has(s)?s:Ay(s),t.attrs[s])}function By(e,t){const{style:n}=e,i={};for(const s in n)(un(n[s])||t.style&&un(t.style[s])||XM(s,e))&&(i[s]=n[s]);return i}function sC(e,t){const n=By(e,t);for(const i in e)if(un(e[i])||un(t[i])){const s=vc.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;n[s]=e[i]}return n}function Vy(e,t,n,i={},s={}){return typeof t=="function"&&(t=t(n!==void 0?n:e.custom,i,s)),typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"&&(t=t(n!==void 0?n:e.custom,i,s)),t}function rC(e){const t=k.useRef(null);return t.current===null&&(t.current=e()),t.current}const Hd=e=>Array.isArray(e),y$=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),v$=e=>Hd(e)?e[e.length-1]||0:e;function nd(e){const t=un(e)?e.get():e;return y$(t)?t.toValue():t}function x$({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},i,s,r){const o={latestValues:b$(i,s,r,e),renderState:t()};return n&&(o.mount=a=>n(i,a,o)),o}const oC=e=>(t,n)=>{const i=k.useContext(Rh),s=k.useContext(Lh),r=()=>x$(e,t,i,s);return n?r():rC(r)};function b$(e,t,n,i){const s={},r=i(e,{});for(const h in r)s[h]=nd(r[h]);let{initial:o,animate:a}=e;const l=$h(e),c=UM(e);t&&c&&!l&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||o===!1;const d=u?a:o;return d&&typeof d!="boolean"&&!jh(d)&&(Array.isArray(d)?d:[d]).forEach(f=>{const p=Vy(e,f);if(!p)return;const{transitionEnd:m,transition:v,...y}=p;for(const g in y){let x=y[g];if(Array.isArray(x)){const _=u?x.length-1:0;x=x[_]}x!==null&&(s[g]=x)}for(const g in m)s[g]=m[g]}),s}const ce=e=>e;class Tb{constructor(){this.order=[],this.scheduled=new Set}add(t){if(!this.scheduled.has(t))return this.scheduled.add(t),this.order.push(t),!0}remove(t){const n=this.order.indexOf(t);n!==-1&&(this.order.splice(n,1),this.scheduled.delete(t))}clear(){this.order.length=0,this.scheduled.clear()}}function _$(e){let t=new Tb,n=new Tb,i=0,s=!1,r=!1;const o=new WeakSet,a={schedule:(l,c=!1,u=!1)=>{const d=u&&s,h=d?t:n;return c&&o.add(l),h.add(l)&&d&&s&&(i=t.order.length),l},cancel:l=>{n.remove(l),o.delete(l)},process:l=>{if(s){r=!0;return}if(s=!0,[t,n]=[n,t],n.clear(),i=t.order.length,i)for(let c=0;c(d[h]=_$(()=>n=!0),d),{}),o=d=>r[d].process(s),a=()=>{const d=performance.now();n=!1,s.delta=i?1e3/60:Math.max(Math.min(d-s.timestamp,w$),1),s.timestamp=d,s.isProcessing=!0,du.forEach(o),s.isProcessing=!1,n&&t&&(i=!1,e(a))},l=()=>{n=!0,i=!0,s.isProcessing||e(a)};return{schedule:du.reduce((d,h)=>{const f=r[h];return d[h]=(p,m=!1,v=!1)=>(n||l(),f.schedule(p,m,v)),d},{}),cancel:d=>du.forEach(h=>r[h].cancel(d)),state:s,steps:r}}const{schedule:zt,cancel:is,state:je,steps:Uf}=k$(typeof requestAnimationFrame<"u"?requestAnimationFrame:ce,!0),S$={useVisualState:oC({scrapeMotionValuesFromProps:sC,createRenderState:tC,onMount:(e,t,{renderState:n,latestValues:i})=>{zt.read(()=>{try{n.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}}),zt.render(()=>{Iy(n,i,{enableHardwareAcceleration:!1},Fy(t.tagName),e.transformTemplate),iC(t,n)})}})},M$={useVisualState:oC({scrapeMotionValuesFromProps:By,createRenderState:$y})};function C$(e,{forwardMotionProps:t=!1},n,i){return{...Ny(e)?S$:M$,preloadedFeatures:n,useRender:g$(t),createVisualElement:i,Component:e}}function Hi(e,t,n,i={passive:!0}){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n)}const aC=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function Fh(e,t="page"){return{point:{x:e[t+"X"],y:e[t+"Y"]}}}const P$=e=>t=>aC(t)&&e(t,Fh(t));function qi(e,t,n,i){return Hi(e,t,P$(n),i)}const T$=(e,t)=>n=>t(e(n)),Is=(...e)=>e.reduce(T$);function lC(e){let t=null;return()=>{const n=()=>{t=null};return t===null?(t=e,n):!1}}const Db=lC("dragHorizontal"),Eb=lC("dragVertical");function cC(e){let t=!1;if(e==="y")t=Eb();else if(e==="x")t=Db();else{const n=Db(),i=Eb();n&&i?t=()=>{n(),i()}:(n&&n(),i&&i())}return t}function uC(){const e=cC(!0);return e?(e(),!1):!0}class tr{constructor(t){this.isMounted=!1,this.node=t}update(){}}function Ab(e,t){const n="pointer"+(t?"enter":"leave"),i="onHover"+(t?"Start":"End"),s=(r,o)=>{if(r.pointerType==="touch"||uC())return;const a=e.getProps();e.animationState&&a.whileHover&&e.animationState.setActive("whileHover",t),a[i]&&zt.update(()=>a[i](r,o))};return qi(e.current,n,s,{passive:!e.getProps()[i]})}class D$ extends tr{mount(){this.unmount=Is(Ab(this.node,!0),Ab(this.node,!1))}unmount(){}}class E$ extends tr{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Is(Hi(this.node.current,"focus",()=>this.onFocus()),Hi(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const dC=(e,t)=>t?e===t?!0:dC(e,t.parentElement):!1;function Yf(e,t){if(!t)return;const n=new PointerEvent("pointer"+e);t(n,Fh(n))}class A$ extends tr{constructor(){super(...arguments),this.removeStartListeners=ce,this.removeEndListeners=ce,this.removeAccessibleListeners=ce,this.startPointerPress=(t,n)=>{if(this.isPressing)return;this.removeEndListeners();const i=this.node.getProps(),r=qi(window,"pointerup",(a,l)=>{if(!this.checkPressEnd())return;const{onTap:c,onTapCancel:u,globalTapTarget:d}=this.node.getProps();zt.update(()=>{!d&&!dC(this.node.current,a.target)?u&&u(a,l):c&&c(a,l)})},{passive:!(i.onTap||i.onPointerUp)}),o=qi(window,"pointercancel",(a,l)=>this.cancelPress(a,l),{passive:!(i.onTapCancel||i.onPointerCancel)});this.removeEndListeners=Is(r,o),this.startPress(t,n)},this.startAccessiblePress=()=>{const t=r=>{if(r.key!=="Enter"||this.isPressing)return;const o=a=>{a.key!=="Enter"||!this.checkPressEnd()||Yf("up",(l,c)=>{const{onTap:u}=this.node.getProps();u&&zt.update(()=>u(l,c))})};this.removeEndListeners(),this.removeEndListeners=Hi(this.node.current,"keyup",o),Yf("down",(a,l)=>{this.startPress(a,l)})},n=Hi(this.node.current,"keydown",t),i=()=>{this.isPressing&&Yf("cancel",(r,o)=>this.cancelPress(r,o))},s=Hi(this.node.current,"blur",i);this.removeAccessibleListeners=Is(n,s)}}startPress(t,n){this.isPressing=!0;const{onTapStart:i,whileTap:s}=this.node.getProps();s&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),i&&zt.update(()=>i(t,n))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!uC()}cancelPress(t,n){if(!this.checkPressEnd())return;const{onTapCancel:i}=this.node.getProps();i&&zt.update(()=>i(t,n))}mount(){const t=this.node.getProps(),n=qi(t.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),i=Hi(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=Is(n,i)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const Am=new WeakMap,Xf=new WeakMap,O$=e=>{const t=Am.get(e.target);t&&t(e)},R$=e=>{e.forEach(O$)};function L$({root:e,...t}){const n=e||document;Xf.has(n)||Xf.set(n,{});const i=Xf.get(n),s=JSON.stringify(t);return i[s]||(i[s]=new IntersectionObserver(R$,{root:e,...t})),i[s]}function N$(e,t,n){const i=L$(t);return Am.set(e,n),i.observe(e),()=>{Am.delete(e),i.unobserve(e)}}const j$={some:0,all:1};class $$ extends tr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:i,amount:s="some",once:r}=t,o={root:n?n.current:void 0,rootMargin:i,threshold:typeof s=="number"?s:j$[s]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,r&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:d}=this.node.getProps(),h=c?u:d;h&&h(l)};return N$(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(I$(t,n))&&this.startObserver()}unmount(){}}function I$({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const F$={inView:{Feature:$$},tap:{Feature:A$},focus:{Feature:E$},hover:{Feature:D$}};function hC(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let i=0;it[i]=n.get()),t}function V$(e){const t={};return e.values.forEach((n,i)=>t[i]=n.getVelocity()),t}function Bh(e,t,n){const i=e.getProps();return Vy(i,t,n!==void 0?n:i.custom,B$(e),V$(e))}let zy=ce;const Dr=e=>e*1e3,Qi=e=>e/1e3,z$={current:!1},fC=e=>Array.isArray(e)&&typeof e[0]=="number";function pC(e){return!!(!e||typeof e=="string"&&mC[e]||fC(e)||Array.isArray(e)&&e.every(pC))}const Qa=([e,t,n,i])=>`cubic-bezier(${e}, ${t}, ${n}, ${i})`,mC={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Qa([0,.65,.55,1]),circOut:Qa([.55,0,1,.45]),backIn:Qa([.31,.01,.66,-.59]),backOut:Qa([.33,1.53,.69,.99])};function gC(e){if(e)return fC(e)?Qa(e):Array.isArray(e)?e.map(gC):mC[e]}function W$(e,t,n,{delay:i=0,duration:s,repeat:r=0,repeatType:o="loop",ease:a,times:l}={}){const c={[t]:n};l&&(c.offset=l);const u=gC(a);return Array.isArray(u)&&(c.easing=u),e.animate(c,{delay:i,duration:s,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:r+1,direction:o==="reverse"?"alternate":"normal"})}function H$(e,{repeat:t,repeatType:n="loop"}){const i=t&&n!=="loop"&&t%2===1?0:e.length-1;return e[i]}const yC=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,U$=1e-7,Y$=12;function X$(e,t,n,i,s){let r,o,a=0;do o=t+(n-t)/2,r=yC(o,i,s)-e,r>0?n=o:t=o;while(Math.abs(r)>U$&&++aX$(r,0,1,e,n);return r=>r===0||r===1?r:yC(s(r),t,i)}const K$=_c(.42,0,1,1),G$=_c(0,0,.58,1),vC=_c(.42,0,.58,1),q$=e=>Array.isArray(e)&&typeof e[0]!="number",xC=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,bC=e=>t=>1-e(1-t),Wy=e=>1-Math.sin(Math.acos(e)),_C=bC(Wy),Q$=xC(Wy),wC=_c(.33,1.53,.69,.99),Hy=bC(wC),Z$=xC(Hy),J$=e=>(e*=2)<1?.5*Hy(e):.5*(2-Math.pow(2,-10*(e-1))),tI={linear:ce,easeIn:K$,easeInOut:vC,easeOut:G$,circIn:Wy,circInOut:Q$,circOut:_C,backIn:Hy,backInOut:Z$,backOut:wC,anticipate:J$},Ob=e=>{if(Array.isArray(e)){zy(e.length===4);const[t,n,i,s]=e;return _c(t,n,i,s)}else if(typeof e=="string")return tI[e];return e},Uy=(e,t)=>n=>!!(xc(n)&&n$.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),kC=(e,t,n)=>i=>{if(!xc(i))return i;const[s,r,o,a]=i.match(Ih);return{[e]:parseFloat(s),[t]:parseFloat(r),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},eI=e=>Hs(0,255,e),Kf={...Yr,transform:e=>Math.round(eI(e))},kr={test:Uy("rgb","red"),parse:kC("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:i=1})=>"rgba("+Kf.transform(e)+", "+Kf.transform(t)+", "+Kf.transform(n)+", "+vl(yl.transform(i))+")"};function nI(e){let t="",n="",i="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),i=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),i=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,i+=i,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}}const Om={test:Uy("#"),parse:nI,transform:kr.transform},wo={test:Uy("hsl","hue"),parse:kC("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:i=1})=>"hsla("+Math.round(e)+", "+bi.transform(vl(t))+", "+bi.transform(vl(n))+", "+vl(yl.transform(i))+")"},We={test:e=>kr.test(e)||Om.test(e)||wo.test(e),parse:e=>kr.test(e)?kr.parse(e):wo.test(e)?wo.parse(e):Om.parse(e),transform:e=>xc(e)?e:e.hasOwnProperty("red")?kr.transform(e):wo.transform(e)},ee=(e,t,n)=>-n*e+n*t+e;function Gf(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function iI({hue:e,saturation:t,lightness:n,alpha:i}){e/=360,t/=100,n/=100;let s=0,r=0,o=0;if(!t)s=r=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;s=Gf(l,a,e+1/3),r=Gf(l,a,e),o=Gf(l,a,e-1/3)}return{red:Math.round(s*255),green:Math.round(r*255),blue:Math.round(o*255),alpha:i}}const qf=(e,t,n)=>{const i=e*e;return Math.sqrt(Math.max(0,n*(t*t-i)+i))},sI=[Om,kr,wo],rI=e=>sI.find(t=>t.test(e));function Rb(e){const t=rI(e);let n=t.parse(e);return t===wo&&(n=iI(n)),n}const SC=(e,t)=>{const n=Rb(e),i=Rb(t),s={...n};return r=>(s.red=qf(n.red,i.red,r),s.green=qf(n.green,i.green,r),s.blue=qf(n.blue,i.blue,r),s.alpha=ee(n.alpha,i.alpha,r),kr.transform(s))};function oI(e){var t,n;return isNaN(e)&&xc(e)&&(((t=e.match(Ih))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(qM))===null||n===void 0?void 0:n.length)||0)>0}const MC={regex:t$,countKey:"Vars",token:"${v}",parse:ce},CC={regex:qM,countKey:"Colors",token:"${c}",parse:We.parse},PC={regex:Ih,countKey:"Numbers",token:"${n}",parse:Yr.parse};function Qf(e,{regex:t,countKey:n,token:i,parse:s}){const r=e.tokenised.match(t);r&&(e["num"+n]=r.length,e.tokenised=e.tokenised.replace(t,i),e.values.push(...r.map(s)))}function Ud(e){const t=e.toString(),n={value:t,tokenised:t,values:[],numVars:0,numColors:0,numNumbers:0};return n.value.includes("var(--")&&Qf(n,MC),Qf(n,CC),Qf(n,PC),n}function TC(e){return Ud(e).values}function DC(e){const{values:t,numColors:n,numVars:i,tokenised:s}=Ud(e),r=t.length;return o=>{let a=s;for(let l=0;ltypeof e=="number"?0:e;function lI(e){const t=TC(e);return DC(e)(t.map(aI))}const Us={test:oI,parse:TC,createTransformer:DC,getAnimatableNone:lI},EC=(e,t)=>n=>`${n>0?t:e}`;function AC(e,t){return typeof e=="number"?n=>ee(e,t,n):We.test(e)?SC(e,t):e.startsWith("var(")?EC(e,t):RC(e,t)}const OC=(e,t)=>{const n=[...e],i=n.length,s=e.map((r,o)=>AC(r,t[o]));return r=>{for(let o=0;o{const n={...e,...t},i={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(i[s]=AC(e[s],t[s]));return s=>{for(const r in i)n[r]=i[r](s);return n}},RC=(e,t)=>{const n=Us.createTransformer(t),i=Ud(e),s=Ud(t);return i.numVars===s.numVars&&i.numColors===s.numColors&&i.numNumbers>=s.numNumbers?Is(OC(i.values,s.values),n):EC(e,t)},Zl=(e,t,n)=>{const i=t-e;return i===0?1:(n-e)/i},Lb=(e,t)=>n=>ee(e,t,n);function uI(e){return typeof e=="number"?Lb:typeof e=="string"?We.test(e)?SC:RC:Array.isArray(e)?OC:typeof e=="object"?cI:Lb}function dI(e,t,n){const i=[],s=n||uI(e[0]),r=e.length-1;for(let o=0;ot[0];e[0]>e[r-1]&&(e=[...e].reverse(),t=[...t].reverse());const o=dI(t,i,s),a=o.length,l=c=>{let u=0;if(a>1)for(;ul(Hs(e[0],e[r-1],c)):l}function hI(e,t){const n=e[e.length-1];for(let i=1;i<=t;i++){const s=Zl(0,t,i);e.push(ee(n,1,s))}}function fI(e){const t=[0];return hI(t,e.length-1),t}function pI(e,t){return e.map(n=>n*t)}function mI(e,t){return e.map(()=>t||vC).splice(0,e.length-1)}function Yd({duration:e=300,keyframes:t,times:n,ease:i="easeInOut"}){const s=q$(i)?i.map(Ob):Ob(i),r={done:!1,value:t[0]},o=pI(n&&n.length===t.length?n:fI(t),e),a=LC(o,t,{ease:Array.isArray(s)?s:mI(t,s)});return{calculatedDuration:e,next:l=>(r.value=a(l),r.done=l>=e,r)}}function NC(e,t){return t?e*(1e3/t):0}const gI=5;function jC(e,t,n){const i=Math.max(t-gI,0);return NC(n-e(i),t-i)}const Zf=.001,yI=.01,vI=10,xI=.05,bI=1;function _I({duration:e=800,bounce:t=.25,velocity:n=0,mass:i=1}){let s,r,o=1-t;o=Hs(xI,bI,o),e=Hs(yI,vI,Qi(e)),o<1?(s=c=>{const u=c*o,d=u*e,h=u-n,f=Rm(c,o),p=Math.exp(-d);return Zf-h/f*p},r=c=>{const d=c*o*e,h=d*n+n,f=Math.pow(o,2)*Math.pow(c,2)*e,p=Math.exp(-d),m=Rm(Math.pow(c,2),o);return(-s(c)+Zf>0?-1:1)*((h-f)*p)/m}):(s=c=>{const u=Math.exp(-c*e),d=(c-n)*e+1;return-Zf+u*d},r=c=>{const u=Math.exp(-c*e),d=(n-c)*(e*e);return u*d});const a=5/e,l=kI(s,r,a);if(e=Dr(e),isNaN(l))return{stiffness:100,damping:10,duration:e};{const c=Math.pow(l,2)*i;return{stiffness:c,damping:o*2*Math.sqrt(i*c),duration:e}}}const wI=12;function kI(e,t,n){let i=n;for(let s=1;se[n]!==void 0)}function CI(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!Nb(e,MI)&&Nb(e,SI)){const n=_I(e);t={...t,...n,mass:1},t.isResolvedFromDuration=!0}return t}function $C({keyframes:e,restDelta:t,restSpeed:n,...i}){const s=e[0],r=e[e.length-1],o={done:!1,value:s},{stiffness:a,damping:l,mass:c,duration:u,velocity:d,isResolvedFromDuration:h}=CI({...i,velocity:-Qi(i.velocity||0)}),f=d||0,p=l/(2*Math.sqrt(a*c)),m=r-s,v=Qi(Math.sqrt(a/c)),y=Math.abs(m)<5;n||(n=y?.01:2),t||(t=y?.005:.5);let g;if(p<1){const x=Rm(v,p);g=_=>{const w=Math.exp(-p*v*_);return r-w*((f+p*v*m)/x*Math.sin(x*_)+m*Math.cos(x*_))}}else if(p===1)g=x=>r-Math.exp(-v*x)*(m+(f+v*m)*x);else{const x=v*Math.sqrt(p*p-1);g=_=>{const w=Math.exp(-p*v*_),S=Math.min(x*_,300);return r-w*((f+p*v*m)*Math.sinh(S)+x*m*Math.cosh(S))/x}}return{calculatedDuration:h&&u||null,next:x=>{const _=g(x);if(h)o.done=x>=u;else{let w=f;x!==0&&(p<1?w=jC(g,x,_):w=0);const S=Math.abs(w)<=n,C=Math.abs(r-_)<=t;o.done=S&&C}return o.value=o.done?r:_,o}}}function jb({keyframes:e,velocity:t=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:u}){const d=e[0],h={done:!1,value:d},f=M=>a!==void 0&&Ml,p=M=>a===void 0?l:l===void 0||Math.abs(a-M)-m*Math.exp(-M/i),x=M=>y+g(M),_=M=>{const P=g(M),T=x(M);h.done=Math.abs(P)<=c,h.value=h.done?y:T};let w,S;const C=M=>{f(h.value)&&(w=M,S=$C({keyframes:[h.value,p(h.value)],velocity:jC(x,M,h.value),damping:s,stiffness:r,restDelta:c,restSpeed:u}))};return C(0),{calculatedDuration:null,next:M=>{let P=!1;return!S&&w===void 0&&(P=!0,_(M),C(M)),w!==void 0&&M>w?S.next(M-w):(!P&&_(M),h)}}}const PI=e=>{const t=({timestamp:n})=>e(n);return{start:()=>zt.update(t,!0),stop:()=>is(t),now:()=>je.isProcessing?je.timestamp:performance.now()}},$b=2e4;function Ib(e){let t=0;const n=50;let i=e.next(t);for(;!i.done&&t<$b;)t+=n,i=e.next(t);return t>=$b?1/0:t}const TI={decay:jb,inertia:jb,tween:Yd,keyframes:Yd,spring:$C};function Xd({autoplay:e=!0,delay:t=0,driver:n=PI,keyframes:i,type:s="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:a="loop",onPlay:l,onStop:c,onComplete:u,onUpdate:d,...h}){let f=1,p=!1,m,v;const y=()=>{v=new Promise(V=>{m=V})};y();let g;const x=TI[s]||Yd;let _;x!==Yd&&typeof i[0]!="number"&&(_=LC([0,100],i,{clamp:!1}),i=[0,100]);const w=x({...h,keyframes:i});let S;a==="mirror"&&(S=x({...h,keyframes:[...i].reverse(),velocity:-(h.velocity||0)}));let C="idle",M=null,P=null,T=null;w.calculatedDuration===null&&r&&(w.calculatedDuration=Ib(w));const{calculatedDuration:A}=w;let E=1/0,z=1/0;A!==null&&(E=A+o,z=E*(r+1)-o);let N=0;const R=V=>{if(P===null)return;f>0&&(P=Math.min(P,V)),f<0&&(P=Math.min(V-z/f,P)),M!==null?N=M:N=Math.round(V-P)*f;const W=N-t*(f>=0?1:-1),et=f>=0?W<0:W>z;N=Math.max(W,0),C==="finished"&&M===null&&(N=z);let Z=N,O=w;if(r){const kt=Math.min(N,z)/E;let it=Math.floor(kt),Rt=kt%1;!Rt&&kt>=1&&(Rt=1),Rt===1&&it--,it=Math.min(it,r+1),!!(it%2)&&(a==="reverse"?(Rt=1-Rt,o&&(Rt-=o/E)):a==="mirror"&&(O=S)),Z=Hs(0,1,Rt)*E}const U=et?{done:!1,value:i[0]}:O.next(Z);_&&(U.value=_(U.value));let{done:lt}=U;!et&&A!==null&&(lt=f>=0?N>=z:N<=0);const ct=M===null&&(C==="finished"||C==="running"&<);return d&&d(U.value),ct&&D(),U},L=()=>{g&&g.stop(),g=void 0},B=()=>{C="idle",L(),m(),y(),P=T=null},D=()=>{C="finished",u&&u(),L(),m()},$=()=>{if(p)return;g||(g=n(R));const V=g.now();l&&l(),M!==null?P=V-M:(!P||C==="finished")&&(P=V),C==="finished"&&y(),T=P,M=null,C="running",g.start()};e&&$();const F={then(V,W){return v.then(V,W)},get time(){return Qi(N)},set time(V){V=Dr(V),N=V,M!==null||!g||f===0?M=V:P=g.now()-V/f},get duration(){const V=w.calculatedDuration===null?Ib(w):w.calculatedDuration;return Qi(V)},get speed(){return f},set speed(V){V===f||!g||(f=V,F.time=Qi(N))},get state(){return C},play:$,pause:()=>{C="paused",M=N},stop:()=>{p=!0,C!=="idle"&&(C="idle",c&&c(),B())},cancel:()=>{T!==null&&R(T),B()},complete:()=>{C="finished"},sample:V=>(P=0,R(V))};return F}function DI(e){let t;return()=>(t===void 0&&(t=e()),t)}const EI=DI(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),AI=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),hu=10,OI=2e4,RI=(e,t)=>t.type==="spring"||e==="backgroundColor"||!pC(t.ease);function LI(e,t,{onUpdate:n,onComplete:i,...s}){if(!(EI()&&AI.has(t)&&!s.repeatDelay&&s.repeatType!=="mirror"&&s.damping!==0&&s.type!=="inertia"))return!1;let o=!1,a,l,c=!1;const u=()=>{l=new Promise(x=>{a=x})};u();let{keyframes:d,duration:h=300,ease:f,times:p}=s;if(RI(t,s)){const x=Xd({...s,repeat:0,delay:0});let _={done:!1,value:d[0]};const w=[];let S=0;for(;!_.done&&S{c=!1,m.cancel()},y=()=>{c=!0,zt.update(v),a(),u()};return m.onfinish=()=>{c||(e.set(H$(d,s)),i&&i(),y())},{then(x,_){return l.then(x,_)},attachTimeline(x){return m.timeline=x,m.onfinish=null,ce},get time(){return Qi(m.currentTime||0)},set time(x){m.currentTime=Dr(x)},get speed(){return m.playbackRate},set speed(x){m.playbackRate=x},get duration(){return Qi(h)},play:()=>{o||(m.play(),is(v))},pause:()=>m.pause(),stop:()=>{if(o=!0,m.playState==="idle")return;const{currentTime:x}=m;if(x){const _=Xd({...s,autoplay:!1});e.setWithVelocity(_.sample(x-hu).value,_.sample(x).value,hu)}y()},complete:()=>{c||m.finish()},cancel:y}}function NI({keyframes:e,delay:t,onUpdate:n,onComplete:i}){const s=()=>(n&&n(e[e.length-1]),i&&i(),{time:0,speed:1,duration:0,play:ce,pause:ce,stop:ce,then:r=>(r(),Promise.resolve()),cancel:ce,complete:ce});return t?Xd({keyframes:[0,1],duration:0,delay:t,onComplete:s}):s()}const jI={type:"spring",stiffness:500,damping:25,restSpeed:10},$I=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),II={type:"keyframes",duration:.8},FI={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},BI=(e,{keyframes:t})=>t.length>2?II:Ur.has(e)?e.startsWith("scale")?$I(t[1]):jI:FI,Lm=(e,t)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Us.test(t)||t==="0")&&!t.startsWith("url(")),VI=new Set(["brightness","contrast","saturate","opacity"]);function zI(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[i]=n.match(Ih)||[];if(!i)return e;const s=n.replace(i,"");let r=VI.has(t)?1:0;return i!==n&&(r*=100),t+"("+r+s+")"}const WI=/([a-z-]*)\(.*?\)/g,Nm={...Us,getAnimatableNone:e=>{const t=e.match(WI);return t?t.map(zI).join(" "):e}},HI={...QM,color:We,backgroundColor:We,outlineColor:We,fill:We,stroke:We,borderColor:We,borderTopColor:We,borderRightColor:We,borderBottomColor:We,borderLeftColor:We,filter:Nm,WebkitFilter:Nm},Yy=e=>HI[e];function IC(e,t){let n=Yy(e);return n!==Nm&&(n=Us),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const FC=e=>/^0[^.\s]+$/.test(e);function UI(e){if(typeof e=="number")return e===0;if(e!==null)return e==="none"||e==="0"||FC(e)}function YI(e,t,n,i){const s=Lm(t,n);let r;Array.isArray(n)?r=[...n]:r=[null,n];const o=i.from!==void 0?i.from:e.get();let a;const l=[];for(let c=0;cs=>{const r=Xy(i,e)||{},o=r.delay||i.delay||0;let{elapsed:a=0}=i;a=a-Dr(o);const l=YI(t,e,n,r),c=l[0],u=l[l.length-1],d=Lm(e,c),h=Lm(e,u);let f={keyframes:l,velocity:t.getVelocity(),ease:"easeOut",...r,delay:-a,onUpdate:p=>{t.set(p),r.onUpdate&&r.onUpdate(p)},onComplete:()=>{s(),r.onComplete&&r.onComplete()}};if(XI(r)||(f={...f,...BI(e,f)}),f.duration&&(f.duration=Dr(f.duration)),f.repeatDelay&&(f.repeatDelay=Dr(f.repeatDelay)),!d||!h||z$.current||r.type===!1||KI.skipAnimations)return NI(f);if(!i.isHandoff&&t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate){const p=LI(t,e,f);if(p)return p}return Xd(f)};function Kd(e){return!!(un(e)&&e.add)}const BC=e=>/^\-?\d*\.?\d+$/.test(e);function Gy(e,t){e.indexOf(t)===-1&&e.push(t)}function qy(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Qy{constructor(){this.subscriptions=[]}add(t){return Gy(this.subscriptions,t),()=>qy(this.subscriptions,t)}notify(t,n,i){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,i);else for(let r=0;r!isNaN(parseFloat(e));class qI{constructor(t,n={}){this.version="10.18.0",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(i,s=!0)=>{this.prev=this.current,this.current=i;const{delta:r,timestamp:o}=je;this.lastUpdated!==o&&(this.timeDelta=r,this.lastUpdated=o,zt.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),s&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>zt.postRender(this.velocityCheck),this.velocityCheck=({timestamp:i})=>{i!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=GI(this.current),this.owner=n.owner}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Qy);const i=this.events[t].add(n);return t==="change"?()=>{i(),zt.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,i){this.set(n),this.prev=t,this.timeDelta=i}jump(t){this.updateAndNotify(t),this.prev=t,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?NC(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Qo(e,t){return new qI(e,t)}const VC=e=>t=>t.test(e),QI={test:e=>e==="auto",parse:e=>e},zC=[Yr,st,bi,ps,s$,i$,QI],Ma=e=>zC.find(VC(e)),ZI=[...zC,We,Us],JI=e=>ZI.find(VC(e));function tF(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Qo(n))}function eF(e,t){const n=Bh(e,t);let{transitionEnd:i={},transition:s={},...r}=n?e.makeTargetAnimatable(n,!1):{};r={...r,...i};for(const o in r){const a=v$(r[o]);tF(e,o,a)}}function nF(e,t,n){var i,s;const r=Object.keys(t).filter(a=>!e.hasValue(a)),o=r.length;if(o)for(let a=0;al.remove(d))),c.push(v)}return o&&Promise.all(c).then(()=>{o&&eF(e,o)}),c}function jm(e,t,n={}){const i=Bh(e,t,n.custom);let{transition:s=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const r=i?()=>Promise.all(WC(e,i,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:c=0,staggerChildren:u,staggerDirection:d}=s;return aF(e,t,c+l,u,d,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[l,c]=a==="beforeChildren"?[r,o]:[o,r];return l().then(()=>c())}else return Promise.all([r(),o(n.delay)])}function aF(e,t,n=0,i=0,s=1,r){const o=[],a=(e.variantChildren.size-1)*i,l=s===1?(c=0)=>c*i:(c=0)=>a-c*i;return Array.from(e.variantChildren).sort(lF).forEach((c,u)=>{c.notify("AnimationStart",t),o.push(jm(c,t,{...r,delay:n+l(u)}).then(()=>c.notify("AnimationComplete",t)))}),Promise.all(o)}function lF(e,t){return e.sortNodePosition(t)}function cF(e,t,n={}){e.notify("AnimationStart",t);let i;if(Array.isArray(t)){const s=t.map(r=>jm(e,r,n));i=Promise.all(s)}else if(typeof t=="string")i=jm(e,t,n);else{const s=typeof t=="function"?Bh(e,t,n.custom):t;i=Promise.all(WC(e,s,n))}return i.then(()=>e.notify("AnimationComplete",t))}const uF=[...Oy].reverse(),dF=Oy.length;function hF(e){return t=>Promise.all(t.map(({animation:n,options:i})=>cF(e,n,i)))}function fF(e){let t=hF(e);const n=mF();let i=!0;const s=(l,c)=>{const u=Bh(e,c);if(u){const{transition:d,transitionEnd:h,...f}=u;l={...l,...f,...h}}return l};function r(l){t=l(e)}function o(l,c){const u=e.getProps(),d=e.getVariantContext(!0)||{},h=[],f=new Set;let p={},m=1/0;for(let y=0;ym&&w,T=!1;const A=Array.isArray(_)?_:[_];let E=A.reduce(s,{});S===!1&&(E={});const{prevResolvedValues:z={}}=x,N={...z,...E},R=L=>{P=!0,f.has(L)&&(T=!0,f.delete(L)),x.needsAnimating[L]=!0};for(const L in N){const B=E[L],D=z[L];if(p.hasOwnProperty(L))continue;let $=!1;Hd(B)&&Hd(D)?$=!hC(B,D):$=B!==D,$?B!==void 0?R(L):f.add(L):B!==void 0&&f.has(L)?R(L):x.protectedKeys[L]=!0}x.prevProp=_,x.prevResolvedValues=E,x.isActive&&(p={...p,...E}),i&&e.blockInitialAnimation&&(P=!1),P&&(!C||T)&&h.push(...A.map(L=>({animation:L,options:{type:g,...l}})))}if(f.size){const y={};f.forEach(g=>{const x=e.getBaseTarget(g);x!==void 0&&(y[g]=x)}),h.push({animation:y})}let v=!!h.length;return i&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(v=!1),i=!1,v?t(h):Promise.resolve()}function a(l,c,u){var d;if(n[l].isActive===c)return Promise.resolve();(d=e.variantChildren)===null||d===void 0||d.forEach(f=>{var p;return(p=f.animationState)===null||p===void 0?void 0:p.setActive(l,c)}),n[l].isActive=c;const h=o(u,l);for(const f in n)n[f].protectedKeys={};return h}return{animateChanges:o,setActive:a,setAnimateFunction:r,getState:()=>n}}function pF(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!hC(t,e):!1}function lr(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function mF(){return{animate:lr(!0),whileInView:lr(),whileHover:lr(),whileTap:lr(),whileDrag:lr(),whileFocus:lr(),exit:lr()}}class gF extends tr{constructor(t){super(t),t.animationState||(t.animationState=fF(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();this.unmount(),jh(t)&&(this.unmount=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){}}let yF=0;class vF extends tr{constructor(){super(...arguments),this.id=yF++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n,custom:i}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===s)return;const r=this.node.animationState.setActive("exit",!t,{custom:i??this.node.getProps().custom});n&&!t&&r.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const xF={animation:{Feature:gF},exit:{Feature:vF}},Fb=(e,t)=>Math.abs(e-t);function bF(e,t){const n=Fb(e.x,t.x),i=Fb(e.y,t.y);return Math.sqrt(n**2+i**2)}class HC{constructor(t,n,{transformPagePoint:i,contextWindow:s,dragSnapToOrigin:r=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=tp(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,f=bF(d.offset,{x:0,y:0})>=3;if(!h&&!f)return;const{point:p}=d,{timestamp:m}=je;this.history.push({...p,timestamp:m});const{onStart:v,onMove:y}=this.handlers;h||(v&&v(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,d)},this.handlePointerMove=(d,h)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=Jf(h,this.transformPagePoint),zt.update(this.updatePoint,!0)},this.handlePointerUp=(d,h)=>{this.end();const{onEnd:f,onSessionEnd:p,resumeAnimation:m}=this.handlers;if(this.dragSnapToOrigin&&m&&m(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=tp(d.type==="pointercancel"?this.lastMoveEventInfo:Jf(h,this.transformPagePoint),this.history);this.startEvent&&f&&f(d,v),p&&p(d,v)},!aC(t))return;this.dragSnapToOrigin=r,this.handlers=n,this.transformPagePoint=i,this.contextWindow=s||window;const o=Fh(t),a=Jf(o,this.transformPagePoint),{point:l}=a,{timestamp:c}=je;this.history=[{...l,timestamp:c}];const{onSessionStart:u}=n;u&&u(t,tp(a,this.history)),this.removeListeners=Is(qi(this.contextWindow,"pointermove",this.handlePointerMove),qi(this.contextWindow,"pointerup",this.handlePointerUp),qi(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),is(this.updatePoint)}}function Jf(e,t){return t?{point:t(e.point)}:e}function Bb(e,t){return{x:e.x-t.x,y:e.y-t.y}}function tp({point:e},t){return{point:e,delta:Bb(e,UC(t)),offset:Bb(e,_F(t)),velocity:wF(t,.1)}}function _F(e){return e[0]}function UC(e){return e[e.length-1]}function wF(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,i=null;const s=UC(e);for(;n>=0&&(i=e[n],!(s.timestamp-i.timestamp>Dr(t)));)n--;if(!i)return{x:0,y:0};const r=Qi(s.timestamp-i.timestamp);if(r===0)return{x:0,y:0};const o={x:(s.x-i.x)/r,y:(s.y-i.y)/r};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function wn(e){return e.max-e.min}function $m(e,t=0,n=.01){return Math.abs(e-t)<=n}function Vb(e,t,n,i=.5){e.origin=i,e.originPoint=ee(t.min,t.max,e.origin),e.scale=wn(n)/wn(t),($m(e.scale,1,1e-4)||isNaN(e.scale))&&(e.scale=1),e.translate=ee(n.min,n.max,e.origin)-e.originPoint,($m(e.translate)||isNaN(e.translate))&&(e.translate=0)}function xl(e,t,n,i){Vb(e.x,t.x,n.x,i?i.originX:void 0),Vb(e.y,t.y,n.y,i?i.originY:void 0)}function zb(e,t,n){e.min=n.min+t.min,e.max=e.min+wn(t)}function kF(e,t,n){zb(e.x,t.x,n.x),zb(e.y,t.y,n.y)}function Wb(e,t,n){e.min=t.min-n.min,e.max=e.min+wn(t)}function bl(e,t,n){Wb(e.x,t.x,n.x),Wb(e.y,t.y,n.y)}function SF(e,{min:t,max:n},i){return t!==void 0&&en&&(e=i?ee(n,e,i.max):Math.min(e,n)),e}function Hb(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function MF(e,{top:t,left:n,bottom:i,right:s}){return{x:Hb(e.x,n,s),y:Hb(e.y,t,i)}}function Ub(e,t){let n=t.min-e.min,i=t.max-e.max;return t.max-t.mini?n=Zl(t.min,t.max-i,e.min):i>s&&(n=Zl(e.min,e.max-s,t.min)),Hs(0,1,n)}function TF(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Im=.35;function DF(e=Im){return e===!1?e=0:e===!0&&(e=Im),{x:Yb(e,"left","right"),y:Yb(e,"top","bottom")}}function Yb(e,t,n){return{min:Xb(e,t),max:Xb(e,n)}}function Xb(e,t){return typeof e=="number"?e:e[t]||0}const Kb=()=>({translate:0,scale:1,origin:0,originPoint:0}),ko=()=>({x:Kb(),y:Kb()}),Gb=()=>({min:0,max:0}),fe=()=>({x:Gb(),y:Gb()});function An(e){return[e("x"),e("y")]}function YC({top:e,left:t,right:n,bottom:i}){return{x:{min:t,max:n},y:{min:e,max:i}}}function EF({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function AF(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),i=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}function ep(e){return e===void 0||e===1}function Fm({scale:e,scaleX:t,scaleY:n}){return!ep(e)||!ep(t)||!ep(n)}function mr(e){return Fm(e)||XC(e)||e.z||e.rotate||e.rotateX||e.rotateY}function XC(e){return qb(e.x)||qb(e.y)}function qb(e){return e&&e!=="0%"}function Gd(e,t,n){const i=e-n,s=t*i;return n+s}function Qb(e,t,n,i,s){return s!==void 0&&(e=Gd(e,s,i)),Gd(e,n,i)+t}function Bm(e,t=0,n=1,i,s){e.min=Qb(e.min,t,n,i,s),e.max=Qb(e.max,t,n,i,s)}function KC(e,{x:t,y:n}){Bm(e.x,t.translate,t.scale,t.originPoint),Bm(e.y,n.translate,n.scale,n.originPoint)}function OF(e,t,n,i=!1){const s=n.length;if(!s)return;t.x=t.y=1;let r,o;for(let a=0;a1.0000000000001||e<.999999999999?e:1}function ys(e,t){e.min=e.min+t,e.max=e.max+t}function Jb(e,t,[n,i,s]){const r=t[s]!==void 0?t[s]:.5,o=ee(e.min,e.max,r);Bm(e,t[n],t[i],o,t.scale)}const RF=["x","scaleX","originX"],LF=["y","scaleY","originY"];function So(e,t){Jb(e.x,t,RF),Jb(e.y,t,LF)}function GC(e,t){return YC(AF(e.getBoundingClientRect(),t))}function NF(e,t,n){const i=GC(e,n),{scroll:s}=t;return s&&(ys(i.x,s.offset.x),ys(i.y,s.offset.y)),i}const qC=({current:e})=>e?e.ownerDocument.defaultView:null,jF=new WeakMap;class $F{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=fe(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const s=u=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Fh(u,"page").point)},r=(u,d)=>{const{drag:h,dragPropagation:f,onDragStart:p}=this.getProps();if(h&&!f&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=cC(h),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),An(v=>{let y=this.getAxisMotionValue(v).get()||0;if(bi.test(y)){const{projection:g}=this.visualElement;if(g&&g.layout){const x=g.layout.layoutBox[v];x&&(y=wn(x)*(parseFloat(y)/100))}}this.originPoint[v]=y}),p&&zt.update(()=>p(u,d),!1,!0);const{animationState:m}=this.visualElement;m&&m.setActive("whileDrag",!0)},o=(u,d)=>{const{dragPropagation:h,dragDirectionLock:f,onDirectionLock:p,onDrag:m}=this.getProps();if(!h&&!this.openGlobalLock)return;const{offset:v}=d;if(f&&this.currentDirection===null){this.currentDirection=IF(v),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",d.point,v),this.updateAxis("y",d.point,v),this.visualElement.render(),m&&m(u,d)},a=(u,d)=>this.stop(u,d),l=()=>An(u=>{var d;return this.getAnimationState(u)==="paused"&&((d=this.getAxisMotionValue(u).animation)===null||d===void 0?void 0:d.play())}),{dragSnapToOrigin:c}=this.getProps();this.panSession=new HC(t,{onSessionStart:s,onStart:r,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,contextWindow:qC(this.visualElement)})}stop(t,n){const i=this.isDragging;if(this.cancel(),!i)return;const{velocity:s}=n;this.startAnimation(s);const{onDragEnd:r}=this.getProps();r&&zt.update(()=>r(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:i}=this.getProps();!i&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,i){const{drag:s}=this.getProps();if(!i||!fu(t,s,this.currentDirection))return;const r=this.getAxisMotionValue(t);let o=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(o=SF(o,this.constraints[t],this.elastic[t])),r.set(o)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:i}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,r=this.constraints;n&&_o(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&s?this.constraints=MF(s.layoutBox,n):this.constraints=!1,this.elastic=DF(i),r!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&An(o=>{this.getAxisMotionValue(o)&&(this.constraints[o]=TF(s.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!_o(t))return!1;const i=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const r=NF(i,s.root,this.visualElement.getTransformPagePoint());let o=CF(s.layout.layoutBox,r);if(n){const a=n(EF(o));this.hasMutatedConstraints=!!a,a&&(o=YC(a))}return o}startAnimation(t){const{drag:n,dragMomentum:i,dragElastic:s,dragTransition:r,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=An(u=>{if(!fu(u,n,this.currentDirection))return;let d=l&&l[u]||{};o&&(d={min:0,max:0});const h=s?200:1e6,f=s?40:1e7,p={type:"inertia",velocity:i?t[u]:0,bounceStiffness:h,bounceDamping:f,timeConstant:750,restDelta:1,restSpeed:10,...r,...d};return this.startAxisValueAnimation(u,p)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const i=this.getAxisMotionValue(t);return i.start(Ky(t,i,0,n))}stopAnimation(){An(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){An(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n="_drag"+t.toUpperCase(),i=this.visualElement.getProps(),s=i[n];return s||this.visualElement.getValue(t,(i.initial?i.initial[t]:void 0)||0)}snapToCursor(t){An(n=>{const{drag:i}=this.getProps();if(!fu(n,i,this.currentDirection))return;const{projection:s}=this.visualElement,r=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:a}=s.layout.layoutBox[n];r.set(t[n]-ee(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!_o(n)||!i||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};An(o=>{const a=this.getAxisMotionValue(o);if(a){const l=a.get();s[o]=PF({min:l,max:l},this.constraints[o])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),An(o=>{if(!fu(o,t,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(ee(l,c,s[o]))})}addListeners(){if(!this.visualElement.current)return;jF.set(this.visualElement,this);const t=this.visualElement.current,n=qi(t,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),i=()=>{const{dragConstraints:l}=this.getProps();_o(l)&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,r=s.addEventListener("measure",i);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),i();const o=Hi(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(An(u=>{const d=this.getAxisMotionValue(u);d&&(this.originPoint[u]+=l[u].translate,d.set(d.get()+l[u].translate))}),this.visualElement.render())});return()=>{o(),n(),r(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:i=!1,dragPropagation:s=!1,dragConstraints:r=!1,dragElastic:o=Im,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:i,dragPropagation:s,dragConstraints:r,dragElastic:o,dragMomentum:a}}}function fu(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function IF(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class FF extends tr{constructor(t){super(t),this.removeGroupControls=ce,this.removeListeners=ce,this.controls=new $F(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ce}unmount(){this.removeGroupControls(),this.removeListeners()}}const t1=e=>(t,n)=>{e&&zt.update(()=>e(t,n))};class BF extends tr{constructor(){super(...arguments),this.removePointerDownListener=ce}onPointerDown(t){this.session=new HC(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:qC(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:i,onPanEnd:s}=this.node.getProps();return{onSessionStart:t1(t),onStart:t1(n),onMove:i,onEnd:(r,o)=>{delete this.session,s&&zt.update(()=>s(r,o))}}}mount(){this.removePointerDownListener=qi(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function VF(){const e=k.useContext(Lh);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:n,register:i}=e,s=k.useId();return k.useEffect(()=>i(s),[]),!t&&n?[!1,()=>n&&n(s)]:[!0]}const id={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function e1(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Ca={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(st.test(e))e=parseFloat(e);else return e;const n=e1(e,t.target.x),i=e1(e,t.target.y);return`${n}% ${i}%`}},zF={correct:(e,{treeScale:t,projectionDelta:n})=>{const i=e,s=Us.parse(e);if(s.length>5)return i;const r=Us.createTransformer(e),o=typeof s[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;s[0+o]/=a,s[1+o]/=l;const c=ee(a,l,.5);return typeof s[2+o]=="number"&&(s[2+o]/=c),typeof s[3+o]=="number"&&(s[3+o]/=c),r(s)}};class WF extends Y.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i,layoutId:s}=this.props,{projection:r}=t;qj(HF),r&&(n.group&&n.group.add(r),i&&i.register&&s&&i.register(r),r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,onExitComplete:()=>this.safeToRemove()})),id.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:i,drag:s,isPresent:r}=this.props,o=i.projection;return o&&(o.isPresent=r,s||t.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),t.isPresent!==r&&(r?o.promote():o.relegate()||zt.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),queueMicrotask(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i}=this.props,{projection:s}=t;s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),i&&i.deregister&&i.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function QC(e){const[t,n]=VF(),i=k.useContext(Ly);return Y.createElement(WF,{...e,layoutGroup:i,switchLayoutGroup:k.useContext(YM),isPresent:t,safeToRemove:n})}const HF={borderRadius:{...Ca,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ca,borderTopRightRadius:Ca,borderBottomLeftRadius:Ca,borderBottomRightRadius:Ca,boxShadow:zF},ZC=["TopLeft","TopRight","BottomLeft","BottomRight"],UF=ZC.length,n1=e=>typeof e=="string"?parseFloat(e):e,i1=e=>typeof e=="number"||st.test(e);function YF(e,t,n,i,s,r){s?(e.opacity=ee(0,n.opacity!==void 0?n.opacity:1,XF(i)),e.opacityExit=ee(t.opacity!==void 0?t.opacity:1,0,KF(i))):r&&(e.opacity=ee(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,i));for(let o=0;oit?1:n(Zl(e,t,i))}function r1(e,t){e.min=t.min,e.max=t.max}function Dn(e,t){r1(e.x,t.x),r1(e.y,t.y)}function o1(e,t,n,i,s){return e-=t,e=Gd(e,1/n,i),s!==void 0&&(e=Gd(e,1/s,i)),e}function GF(e,t=0,n=1,i=.5,s,r=e,o=e){if(bi.test(t)&&(t=parseFloat(t),t=ee(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=ee(r.min,r.max,i);e===r&&(a-=t),e.min=o1(e.min,t,n,a,s),e.max=o1(e.max,t,n,a,s)}function a1(e,t,[n,i,s],r,o){GF(e,t[n],t[i],t[s],t.scale,r,o)}const qF=["x","scaleX","originX"],QF=["y","scaleY","originY"];function l1(e,t,n,i){a1(e.x,t,qF,n?n.x:void 0,i?i.x:void 0),a1(e.y,t,QF,n?n.y:void 0,i?i.y:void 0)}function c1(e){return e.translate===0&&e.scale===1}function tP(e){return c1(e.x)&&c1(e.y)}function ZF(e,t){return e.x.min===t.x.min&&e.x.max===t.x.max&&e.y.min===t.y.min&&e.y.max===t.y.max}function eP(e,t){return Math.round(e.x.min)===Math.round(t.x.min)&&Math.round(e.x.max)===Math.round(t.x.max)&&Math.round(e.y.min)===Math.round(t.y.min)&&Math.round(e.y.max)===Math.round(t.y.max)}function u1(e){return wn(e.x)/wn(e.y)}class JF{constructor(){this.members=[]}add(t){Gy(this.members,t),t.scheduleRender()}remove(t){if(qy(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(s=>t===s);if(n===0)return!1;let i;for(let s=n;s>=0;s--){const r=this.members[s];if(r.isPresent!==!1){i=r;break}}return i?(this.promote(i),!0):!1}promote(t,n){const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.instance&&i.scheduleRender(),t.scheduleRender(),t.resumeFrom=i,n&&(t.resumeFrom.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:s}=t.options;s===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:i}=t;n.onExitComplete&&n.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function d1(e,t,n){let i="";const s=e.x.translate/t.x,r=e.y.translate/t.y;if((s||r)&&(i=`translate3d(${s}px, ${r}px, 0) `),(t.x!==1||t.y!==1)&&(i+=`scale(${1/t.x}, ${1/t.y}) `),n){const{rotate:l,rotateX:c,rotateY:u}=n;l&&(i+=`rotate(${l}deg) `),c&&(i+=`rotateX(${c}deg) `),u&&(i+=`rotateY(${u}deg) `)}const o=e.x.scale*t.x,a=e.y.scale*t.y;return(o!==1||a!==1)&&(i+=`scale(${o}, ${a})`),i||"none"}const tB=(e,t)=>e.depth-t.depth;class eB{constructor(){this.children=[],this.isDirty=!1}add(t){Gy(this.children,t),this.isDirty=!0}remove(t){qy(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(tB),this.isDirty=!1,this.children.forEach(t)}}function nB(e,t){const n=performance.now(),i=({timestamp:s})=>{const r=s-n;r>=t&&(is(i),e(r-t))};return zt.read(i,!0),()=>is(i)}function iB(e){window.MotionDebug&&window.MotionDebug.record(e)}function sB(e){return e instanceof SVGElement&&e.tagName!=="svg"}function rB(e,t,n){const i=un(e)?e:Qo(e);return i.start(Ky("",i,t,n)),i.animation}const h1=["","X","Y","Z"],oB={visibility:"hidden"},f1=1e3;let aB=0;const gr={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function nP({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:i,resetTransform:s}){return class{constructor(o={},a=t==null?void 0:t()){this.id=aB++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,gr.totalNodes=gr.resolvedTargetDeltas=gr.recalculatedProjection=0,this.nodes.forEach(uB),this.nodes.forEach(mB),this.nodes.forEach(gB),this.nodes.forEach(dB),iB(gr)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;lthis.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=nB(h,250),id.hasAnimatedSinceResize&&(id.hasAnimatedSinceResize=!1,this.nodes.forEach(m1))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&u&&(l||c)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:h,hasRelativeTargetChanged:f,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||u.getDefaultTransition()||_B,{onLayoutAnimationStart:v,onLayoutAnimationComplete:y}=u.getProps(),g=!this.targetLayout||!eP(this.targetLayout,p)||f,x=!h&&f;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||x||h&&(g||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,x);const _={...Xy(m,"layout"),onPlay:v,onComplete:y};(u.shouldReduceMotion||this.options.layoutRoot)&&(_.delay=0,_.type=!1),this.startAnimation(_)}else h||m1(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,is(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(yB),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;uthis.update()))}clearAllSnapshots(){this.nodes.forEach(hB),this.sharedNodes.forEach(vB)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,zt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){zt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{const w=_/1e3;g1(d.x,o.x,w),g1(d.y,o.y,w),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(bl(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),xB(this.relativeTarget,this.relativeTargetOrigin,h,w),x&&ZF(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=fe()),Dn(x,this.relativeTarget)),m&&(this.animationValues=u,YF(u,c,this.latestValues,w,g,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=w},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(is(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=zt.update(()=>{id.hasAnimatedSinceResize=!0,this.currentAnimation=rB(0,f1,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(f1),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=o;if(!(!a||!l||!c)){if(this!==o&&this.layout&&c&&iP(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||fe();const d=wn(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+d;const h=wn(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+h}Dn(a,l),So(a,u),xl(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new JF),this.sharedNodes.get(o).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.rotate||l.rotateX||l.rotateY||l.rotateZ)&&(a=!0),!a)return;const c={};for(let u=0;u{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(p1),this.root.sharedNodes.clear()}}}function lB(e){e.updateLayout()}function cB(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:i,measuredBox:s}=e.layout,{animationType:r}=e.options,o=n.source!==e.layout.source;r==="size"?An(d=>{const h=o?n.measuredBox[d]:n.layoutBox[d],f=wn(h);h.min=i[d].min,h.max=h.min+f}):iP(r,n.layoutBox,i)&&An(d=>{const h=o?n.measuredBox[d]:n.layoutBox[d],f=wn(i[d]);h.max=h.min+f,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+f)});const a=ko();xl(a,i,n.layoutBox);const l=ko();o?xl(l,e.applyTransform(s,!0),n.measuredBox):xl(l,i,n.layoutBox);const c=!tP(a);let u=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:h,layout:f}=d;if(h&&f){const p=fe();bl(p,n.layoutBox,h.layoutBox);const m=fe();bl(m,i,f.layoutBox),eP(p,m)||(u=!0),d.options.layoutRoot&&(e.relativeTarget=m,e.relativeTargetOrigin=p,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:i,snapshot:n,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeTargetChanged:u})}else if(e.isLead()){const{onExitComplete:i}=e.options;i&&i()}e.options.transition=void 0}function uB(e){gr.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function dB(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function hB(e){e.clearSnapshot()}function p1(e){e.clearMeasurements()}function fB(e){e.isLayoutDirty=!1}function pB(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function m1(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function mB(e){e.resolveTargetDelta()}function gB(e){e.calcProjection()}function yB(e){e.resetRotation()}function vB(e){e.removeLeadSnapshot()}function g1(e,t,n){e.translate=ee(t.translate,0,n),e.scale=ee(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function y1(e,t,n,i){e.min=ee(t.min,n.min,i),e.max=ee(t.max,n.max,i)}function xB(e,t,n,i){y1(e.x,t.x,n.x,i),y1(e.y,t.y,n.y,i)}function bB(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const _B={duration:.45,ease:[.4,0,.1,1]},v1=e=>typeof navigator<"u"&&navigator.userAgent.toLowerCase().includes(e),x1=v1("applewebkit/")&&!v1("chrome/")?Math.round:ce;function b1(e){e.min=x1(e.min),e.max=x1(e.max)}function wB(e){b1(e.x),b1(e.y)}function iP(e,t,n){return e==="position"||e==="preserve-aspect"&&!$m(u1(t),u1(n),.2)}const kB=nP({attachResizeListener:(e,t)=>Hi(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),np={current:void 0},sP=nP({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!np.current){const e=new kB({});e.mount(window),e.setOptions({layoutScroll:!0}),np.current=e}return np.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),SB={pan:{Feature:BF},drag:{Feature:FF,ProjectionNode:sP,MeasureLayout:QC}},MB=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function CB(e){const t=MB.exec(e);if(!t)return[,];const[,n,i]=t;return[n,i]}function Vm(e,t,n=1){const[i,s]=CB(e);if(!i)return;const r=window.getComputedStyle(t).getPropertyValue(i);if(r){const o=r.trim();return BC(o)?parseFloat(o):o}else return Em(s)?Vm(s,t,n+1):s}function PB(e,{...t},n){const i=e.current;if(!(i instanceof Element))return{target:t,transitionEnd:n};n&&(n={...n}),e.values.forEach(s=>{const r=s.get();if(!Em(r))return;const o=Vm(r,i);o&&s.set(o)});for(const s in t){const r=t[s];if(!Em(r))continue;const o=Vm(r,i);o&&(t[s]=o,n||(n={}),n[s]===void 0&&(n[s]=r))}return{target:t,transitionEnd:n}}const TB=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),rP=e=>TB.has(e),DB=e=>Object.keys(e).some(rP),_1=e=>e===Yr||e===st,w1=(e,t)=>parseFloat(e.split(", ")[t]),k1=(e,t)=>(n,{transform:i})=>{if(i==="none"||!i)return 0;const s=i.match(/^matrix3d\((.+)\)$/);if(s)return w1(s[1],t);{const r=i.match(/^matrix\((.+)\)$/);return r?w1(r[1],e):0}},EB=new Set(["x","y","z"]),AB=vc.filter(e=>!EB.has(e));function OB(e){const t=[];return AB.forEach(n=>{const i=e.getValue(n);i!==void 0&&(t.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),t.length&&e.render(),t}const Zo={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:k1(4,13),y:k1(5,14)};Zo.translateX=Zo.x;Zo.translateY=Zo.y;const RB=(e,t,n)=>{const i=t.measureViewportBox(),s=t.current,r=getComputedStyle(s),{display:o}=r,a={};o==="none"&&t.setStaticValue("display",e.display||"block"),n.forEach(c=>{a[c]=Zo[c](i,r)}),t.render();const l=t.measureViewportBox();return n.forEach(c=>{const u=t.getValue(c);u&&u.jump(a[c]),e[c]=Zo[c](l,r)}),e},LB=(e,t,n={},i={})=>{t={...t},i={...i};const s=Object.keys(t).filter(rP);let r=[],o=!1;const a=[];if(s.forEach(l=>{const c=e.getValue(l);if(!e.hasValue(l))return;let u=n[l],d=Ma(u);const h=t[l];let f;if(Hd(h)){const p=h.length,m=h[0]===null?1:0;u=h[m],d=Ma(u);for(let v=m;v=0?window.pageYOffset:null,c=RB(t,e,a);return r.length&&r.forEach(([u,d])=>{e.getValue(u).set(d)}),e.render(),Nh&&l!==null&&window.scrollTo({top:l}),{target:c,transitionEnd:i}}else return{target:t,transitionEnd:i}};function NB(e,t,n,i){return DB(t)?LB(e,t,n,i):{target:t,transitionEnd:i}}const jB=(e,t,n,i)=>{const s=PB(e,t,i);return t=s.target,i=s.transitionEnd,NB(e,t,n,i)},zm={current:null},oP={current:!1};function $B(){if(oP.current=!0,!!Nh)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>zm.current=e.matches;e.addListener(t),t()}else zm.current=!1}function IB(e,t,n){const{willChange:i}=t;for(const s in t){const r=t[s],o=n[s];if(un(r))e.addValue(s,r),Kd(i)&&i.add(s);else if(un(o))e.addValue(s,Qo(r,{owner:e})),Kd(i)&&i.remove(s);else if(o!==r)if(e.hasValue(s)){const a=e.getValue(s);!a.hasAnimated&&a.set(r)}else{const a=e.getStaticValue(s);e.addValue(s,Qo(a!==void 0?a:r,{owner:e}))}}for(const s in n)t[s]===void 0&&e.removeValue(s);return t}const S1=new WeakMap,aP=Object.keys(Ql),FB=aP.length,M1=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],BB=Ry.length;class VB{constructor({parent:t,props:n,presenceContext:i,reducedMotionConfig:s,visualState:r},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>zt.render(this.render,!1,!0);const{latestValues:a,renderState:l}=r;this.latestValues=a,this.baseTarget={...a},this.initialValues=n.initial?{...a}:{},this.renderState=l,this.parent=t,this.props=n,this.presenceContext=i,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=o,this.isControllingVariants=$h(n),this.isVariantNode=UM(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:c,...u}=this.scrapeMotionValuesFromProps(n,{});for(const d in u){const h=u[d];a[d]!==void 0&&un(h)&&(h.set(a[d],!1),Kd(c)&&c.add(d))}}scrapeMotionValuesFromProps(t,n){return{}}mount(t){this.current=t,S1.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,i)=>this.bindToMotionValue(i,n)),oP.current||$B(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:zm.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){S1.delete(this.current),this.projection&&this.projection.unmount(),is(this.notifyUpdate),is(this.render),this.valueSubscriptions.forEach(t=>t()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features)this.features[t].unmount();this.current=null}bindToMotionValue(t,n){const i=Ur.has(t),s=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&zt.update(this.notifyUpdate,!1,!0),i&&this.projection&&(this.projection.isTransformDirty=!0)}),r=n.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(t,()=>{s(),r()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}loadFeatures({children:t,...n},i,s,r){let o,a;for(let l=0;lthis.scheduleRender(),animationType:typeof c=="string"?c:"both",initialPromotionConfig:r,layoutScroll:h,layoutRoot:f})}return a}updateFeatures(){for(const t in this.features){const n=this.features[t];n.isMounted?n.update():(n.mount(),n.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):fe()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}makeTargetAnimatable(t,n=!0){return this.makeTargetAnimatableFromInstance(t,this.props,n)}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let i=0;in.variantChildren.delete(t)}addValue(t,n){n!==this.values.get(t)&&(this.removeValue(t),this.bindToMotionValue(t,n)),this.values.set(t,n),this.latestValues[t]=n.get()}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let i=this.values.get(t);return i===void 0&&n!==void 0&&(i=Qo(n,{owner:this}),this.addValue(t,i)),i}readValue(t){var n;return this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(n=this.getBaseTargetFromProps(this.props,t))!==null&&n!==void 0?n:this.readValueFromInstance(this.current,t,this.options)}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:i}=this.props,s=typeof i=="string"||typeof i=="object"?(n=Vy(this.props,i))===null||n===void 0?void 0:n[t]:void 0;if(i&&s!==void 0)return s;const r=this.getBaseTargetFromProps(this.props,t);return r!==void 0&&!un(r)?r:this.initialValues[t]!==void 0&&s===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Qy),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class lP extends VB{sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:i}){delete n[t],delete i[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:n,...i},{transformValues:s},r){let o=sF(i,t||{},this);if(s&&(n&&(n=s(n)),i&&(i=s(i)),o&&(o=s(o))),r){nF(this,i,o);const a=jB(this,i,o,n);n=a.transitionEnd,i=a.target}return{transition:t,transitionEnd:n,...i}}}function zB(e){return window.getComputedStyle(e)}class WB extends lP{constructor(){super(...arguments),this.type="html"}readValueFromInstance(t,n){if(Ur.has(n)){const i=Yy(n);return i&&i.default||0}else{const i=zB(t),s=(GM(n)?i.getPropertyValue(n):i[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return GC(t,n)}build(t,n,i,s){jy(t,n,i,s.transformTemplate)}scrapeMotionValuesFromProps(t,n){return By(t,n)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;un(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}renderInstance(t,n,i,s){eC(t,n,i,s)}}class HB extends lP{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Ur.has(n)){const i=Yy(n);return i&&i.default||0}return n=nC.has(n)?n:Ay(n),t.getAttribute(n)}measureInstanceViewportBox(){return fe()}scrapeMotionValuesFromProps(t,n){return sC(t,n)}build(t,n,i,s){Iy(t,n,i,this.isSVGTag,s.transformTemplate)}renderInstance(t,n,i,s){iC(t,n,i,s)}mount(t){this.isSVGTag=Fy(t.tagName),super.mount(t)}}const UB=(e,t)=>Ny(e)?new HB(t,{enableHardwareAcceleration:!1}):new WB(t,{enableHardwareAcceleration:!0}),YB={layout:{ProjectionNode:sP,MeasureLayout:QC}},XB={...xF,...F$,...SB,...YB},Jo=Kj((e,t)=>C$(e,t,XB,UB));function cP(){const e=k.useRef(!1);return Ey(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function KB(){const e=cP(),[t,n]=k.useState(0),i=k.useCallback(()=>{e.current&&n(t+1)},[t]);return[k.useCallback(()=>zt.postRender(i),[i]),t]}class GB extends k.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const i=this.props.sizeRef.current;i.height=n.offsetHeight||0,i.width=n.offsetWidth||0,i.top=n.offsetTop,i.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function qB({children:e,isPresent:t}){const n=k.useId(),i=k.useRef(null),s=k.useRef({width:0,height:0,top:0,left:0});return k.useInsertionEffect(()=>{const{width:r,height:o,top:a,left:l}=s.current;if(t||!i.current||!r||!o)return;i.current.dataset.motionPopId=n;const c=document.createElement("style");return document.head.appendChild(c),c.sheet&&c.sheet.insertRule(` [data-motion-pop-id="${n}"] { position: absolute !important; width: ${r}px !important; @@ -62,31 +62,31 @@ Error generating stack: `+r.message+` top: ${a}px !important; left: ${l}px !important; } - `),()=>{document.head.removeChild(c)}},[t]),k.createElement(GB,{isPresent:t,childRef:i,sizeRef:s},k.cloneElement(e,{ref:i}))}const ip=({children:e,initial:t,isPresent:n,onExitComplete:i,custom:s,presenceAffectsLayout:r,mode:o})=>{const a=rC(QB),l=k.useId(),c=k.useMemo(()=>({id:l,initial:t,isPresent:n,custom:s,onExitComplete:u=>{a.set(u,!0);for(const d of a.values())if(!d)return;i&&i()},register:u=>(a.set(u,!1),()=>a.delete(u))}),r?void 0:[n]);return k.useMemo(()=>{a.forEach((u,d)=>a.set(d,!1))},[n]),k.useEffect(()=>{!n&&!a.size&&i&&i()},[n]),o==="popLayout"&&(e=k.createElement(qB,{isPresent:n},e)),k.createElement(Rh.Provider,{value:c},e)};function QB(){return new Map}function ZB(e){return k.useEffect(()=>()=>e(),[])}const yr=e=>e.key||"";function JB(e,t){e.forEach(n=>{const i=yr(n);t.set(i,n)})}function tV(e){const t=[];return k.Children.forEach(e,n=>{k.isValidElement(n)&&t.push(n)}),t}const Zy=({children:e,custom:t,initial:n=!0,onExitComplete:i,exitBeforeEnter:s,presenceAffectsLayout:r=!0,mode:o="sync"})=>{const a=k.useContext(Ry).forceRender||KB()[0],l=cP(),c=tV(e);let u=c;const d=k.useRef(new Map).current,h=k.useRef(u),f=k.useRef(new Map).current,p=k.useRef(!0);if(Ey(()=>{p.current=!1,JB(c,f),h.current=u}),ZB(()=>{p.current=!0,f.clear(),d.clear()}),p.current)return k.createElement(k.Fragment,null,u.map(g=>k.createElement(ip,{key:yr(g),isPresent:!0,initial:n?void 0:!1,presenceAffectsLayout:r,mode:o},g)));u=[...u];const m=h.current.map(yr),v=c.map(yr),y=m.length;for(let g=0;g{if(v.indexOf(x)!==-1)return;const _=f.get(x);if(!_)return;const w=m.indexOf(x);let S=g;if(!S){const C=()=>{d.delete(x);const M=Array.from(f.keys()).filter(P=>!v.includes(P));if(M.forEach(P=>f.delete(P)),h.current=c.filter(P=>{const T=yr(P);return T===x||M.includes(T)}),!d.size){if(l.current===!1)return;a(),i&&i()}};S=k.createElement(ip,{key:yr(_),isPresent:!1,onExitComplete:C,custom:t,presenceAffectsLayout:r,mode:o},_),d.set(x,S)}u.splice(w,0,S)}),u=u.map(g=>{const x=g.key;return d.has(x)?g:k.createElement(ip,{key:yr(g),isPresent:!0,presenceAffectsLayout:r,mode:o},g)}),k.createElement(k.Fragment,null,d.size?u:u.map(g=>k.cloneElement(g)))};/*! + `),()=>{document.head.removeChild(c)}},[t]),k.createElement(GB,{isPresent:t,childRef:i,sizeRef:s},k.cloneElement(e,{ref:i}))}const ip=({children:e,initial:t,isPresent:n,onExitComplete:i,custom:s,presenceAffectsLayout:r,mode:o})=>{const a=rC(QB),l=k.useId(),c=k.useMemo(()=>({id:l,initial:t,isPresent:n,custom:s,onExitComplete:u=>{a.set(u,!0);for(const d of a.values())if(!d)return;i&&i()},register:u=>(a.set(u,!1),()=>a.delete(u))}),r?void 0:[n]);return k.useMemo(()=>{a.forEach((u,d)=>a.set(d,!1))},[n]),k.useEffect(()=>{!n&&!a.size&&i&&i()},[n]),o==="popLayout"&&(e=k.createElement(qB,{isPresent:n},e)),k.createElement(Lh.Provider,{value:c},e)};function QB(){return new Map}function ZB(e){return k.useEffect(()=>()=>e(),[])}const yr=e=>e.key||"";function JB(e,t){e.forEach(n=>{const i=yr(n);t.set(i,n)})}function tV(e){const t=[];return k.Children.forEach(e,n=>{k.isValidElement(n)&&t.push(n)}),t}const Zy=({children:e,custom:t,initial:n=!0,onExitComplete:i,exitBeforeEnter:s,presenceAffectsLayout:r=!0,mode:o="sync"})=>{const a=k.useContext(Ly).forceRender||KB()[0],l=cP(),c=tV(e);let u=c;const d=k.useRef(new Map).current,h=k.useRef(u),f=k.useRef(new Map).current,p=k.useRef(!0);if(Ey(()=>{p.current=!1,JB(c,f),h.current=u}),ZB(()=>{p.current=!0,f.clear(),d.clear()}),p.current)return k.createElement(k.Fragment,null,u.map(g=>k.createElement(ip,{key:yr(g),isPresent:!0,initial:n?void 0:!1,presenceAffectsLayout:r,mode:o},g)));u=[...u];const m=h.current.map(yr),v=c.map(yr),y=m.length;for(let g=0;g{if(v.indexOf(x)!==-1)return;const _=f.get(x);if(!_)return;const w=m.indexOf(x);let S=g;if(!S){const C=()=>{d.delete(x);const M=Array.from(f.keys()).filter(P=>!v.includes(P));if(M.forEach(P=>f.delete(P)),h.current=c.filter(P=>{const T=yr(P);return T===x||M.includes(T)}),!d.size){if(l.current===!1)return;a(),i&&i()}};S=k.createElement(ip,{key:yr(_),isPresent:!1,onExitComplete:C,custom:t,presenceAffectsLayout:r,mode:o},_),d.set(x,S)}u.splice(w,0,S)}),u=u.map(g=>{const x=g.key;return d.has(x)?g:k.createElement(ip,{key:yr(g),isPresent:!0,presenceAffectsLayout:r,mode:o},g)}),k.createElement(k.Fragment,null,d.size?u:u.map(g=>k.cloneElement(g)))};/*! * chartjs-plugin-datalabels v2.2.0 * https://chartjs-plugin-datalabels.netlify.app * (c) 2017-2022 chartjs-plugin-datalabels contributors * Released under the MIT license - */var C1=function(){if(typeof window<"u"){if(window.devicePixelRatio)return window.devicePixelRatio;var e=window.screen;if(e)return(e.deviceXDPI||1)/(e.logicalXDPI||1)}return 1}(),id={toTextLines:function(e){var t=[],n;for(e=[].concat(e);e.length;)n=e.pop(),typeof n=="string"?t.unshift.apply(t,n.split(` -`)):Array.isArray(n)?e.push.apply(e,n):bt(e)||t.unshift(""+n);return t},textSize:function(e,t,n){var i=[].concat(t),s=i.length,r=e.font,o=0,a;for(e.font=n.string,a=0;an.right&&(i|=dP),tn.bottom&&(i|=hP),i}function iV(e,t){for(var n=e.x0,i=e.y0,s=e.x1,r=e.y1,o=fu(n,i,t),a=fu(s,r,t),l,c,u;!(!(o|a)||o&a);)l=o||a,l&fP?(c=n+(s-n)*(t.top-i)/(r-i),u=t.top):l&hP?(c=n+(s-n)*(t.bottom-i)/(r-i),u=t.bottom):l&dP?(u=i+(r-i)*(t.right-n)/(s-n),c=t.right):l&uP&&(u=i+(r-i)*(t.left-n)/(s-n),c=t.left),l===o?(n=c,i=u,o=fu(n,i,t)):(s=c,r=u,a=fu(s,r,t));return{x0:n,x1:s,y0:i,y1:r}}function pu(e,t){var n=t.anchor,i=e,s,r;return t.clamp&&(i=iV(i,t.area)),n==="start"?(s=i.x0,r=i.y0):n==="end"?(s=i.x1,r=i.y1):(s=(i.x0+i.x1)/2,r=(i.y0+i.y1)/2),eV(s,r,e.vx,e.vy,t.align)}var mu={arc:function(e,t){var n=(e.startAngle+e.endAngle)/2,i=Math.cos(n),s=Math.sin(n),r=e.innerRadius,o=e.outerRadius;return pu({x0:e.x+i*r,y0:e.y+s*r,x1:e.x+i*o,y1:e.y+s*o,vx:i,vy:s},t)},point:function(e,t){var n=sp(e,t.origin),i=n.x*e.options.radius,s=n.y*e.options.radius;return pu({x0:e.x-i,y0:e.y-s,x1:e.x+i,y1:e.y+s,vx:n.x,vy:n.y},t)},bar:function(e,t){var n=sp(e,t.origin),i=e.x,s=e.y,r=0,o=0;return e.horizontal?(i=Math.min(e.x,e.base),r=Math.abs(e.base-e.x)):(s=Math.min(e.y,e.base),o=Math.abs(e.base-e.y)),pu({x0:i,y0:s+o,x1:i+r,y1:s,vx:n.x,vy:n.y},t)},fallback:function(e,t){var n=sp(e,t.origin);return pu({x0:e.x,y0:e.y,x1:e.x+(e.width||0),y1:e.y+(e.height||0),vx:n.x,vy:n.y},t)}},Ui=id.rasterize;function sV(e){var t=e.borderWidth||0,n=e.padding,i=e.size.height,s=e.size.width,r=-s/2,o=-i/2;return{frame:{x:r-n.left-t,y:o-n.top-t,w:s+n.width+t*2,h:i+n.height+t*2},text:{x:r,y:o,w:s,h:i}}}function rV(e,t){var n=t.chart.getDatasetMeta(t.datasetIndex).vScale;if(!n)return null;if(n.xCenter!==void 0&&n.yCenter!==void 0)return{x:n.xCenter,y:n.yCenter};var i=n.getBasePixel();return e.horizontal?{x:i,y:null}:{x:null,y:i}}function oV(e){return e instanceof vM?mu.arc:e instanceof _M?mu.point:e instanceof kM?mu.bar:mu.fallback}function aV(e,t,n,i,s,r){var o=Math.PI/2;if(r){var a=Math.min(r,s/2,i/2),l=t+a,c=n+a,u=t+i-a,d=n+s-a;e.moveTo(t,c),li.x+i.w+n*2||e.y>i.y+i.h+n*2)},intersects:function(e){var t=this._points(),n=e._points(),i=[gu(t[0],t[1]),gu(t[0],t[3])],s,r,o;for(this._rotation!==e._rotation&&i.push(gu(n[0],n[1]),gu(n[0],n[3])),s=0;sn.right&&(i|=dP),tn.bottom&&(i|=hP),i}function iV(e,t){for(var n=e.x0,i=e.y0,s=e.x1,r=e.y1,o=pu(n,i,t),a=pu(s,r,t),l,c,u;!(!(o|a)||o&a);)l=o||a,l&fP?(c=n+(s-n)*(t.top-i)/(r-i),u=t.top):l&hP?(c=n+(s-n)*(t.bottom-i)/(r-i),u=t.bottom):l&dP?(u=i+(r-i)*(t.right-n)/(s-n),c=t.right):l&uP&&(u=i+(r-i)*(t.left-n)/(s-n),c=t.left),l===o?(n=c,i=u,o=pu(n,i,t)):(s=c,r=u,a=pu(s,r,t));return{x0:n,x1:s,y0:i,y1:r}}function mu(e,t){var n=t.anchor,i=e,s,r;return t.clamp&&(i=iV(i,t.area)),n==="start"?(s=i.x0,r=i.y0):n==="end"?(s=i.x1,r=i.y1):(s=(i.x0+i.x1)/2,r=(i.y0+i.y1)/2),eV(s,r,e.vx,e.vy,t.align)}var gu={arc:function(e,t){var n=(e.startAngle+e.endAngle)/2,i=Math.cos(n),s=Math.sin(n),r=e.innerRadius,o=e.outerRadius;return mu({x0:e.x+i*r,y0:e.y+s*r,x1:e.x+i*o,y1:e.y+s*o,vx:i,vy:s},t)},point:function(e,t){var n=sp(e,t.origin),i=n.x*e.options.radius,s=n.y*e.options.radius;return mu({x0:e.x-i,y0:e.y-s,x1:e.x+i,y1:e.y+s,vx:n.x,vy:n.y},t)},bar:function(e,t){var n=sp(e,t.origin),i=e.x,s=e.y,r=0,o=0;return e.horizontal?(i=Math.min(e.x,e.base),r=Math.abs(e.base-e.x)):(s=Math.min(e.y,e.base),o=Math.abs(e.base-e.y)),mu({x0:i,y0:s+o,x1:i+r,y1:s,vx:n.x,vy:n.y},t)},fallback:function(e,t){var n=sp(e,t.origin);return mu({x0:e.x,y0:e.y,x1:e.x+(e.width||0),y1:e.y+(e.height||0),vx:n.x,vy:n.y},t)}},Ui=sd.rasterize;function sV(e){var t=e.borderWidth||0,n=e.padding,i=e.size.height,s=e.size.width,r=-s/2,o=-i/2;return{frame:{x:r-n.left-t,y:o-n.top-t,w:s+n.width+t*2,h:i+n.height+t*2},text:{x:r,y:o,w:s,h:i}}}function rV(e,t){var n=t.chart.getDatasetMeta(t.datasetIndex).vScale;if(!n)return null;if(n.xCenter!==void 0&&n.yCenter!==void 0)return{x:n.xCenter,y:n.yCenter};var i=n.getBasePixel();return e.horizontal?{x:i,y:null}:{x:null,y:i}}function oV(e){return e instanceof vM?gu.arc:e instanceof _M?gu.point:e instanceof kM?gu.bar:gu.fallback}function aV(e,t,n,i,s,r){var o=Math.PI/2;if(r){var a=Math.min(r,s/2,i/2),l=t+a,c=n+a,u=t+i-a,d=n+s-a;e.moveTo(t,c),li.x+i.w+n*2||e.y>i.y+i.h+n*2)},intersects:function(e){var t=this._points(),n=e._points(),i=[yu(t[0],t[1]),yu(t[0],t[3])],s,r,o;for(this._rotation!==e._rotation&&i.push(yu(n[0],n[1]),yu(n[0],n[3])),s=0;s"u"}function Vt(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 yt(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}const de=e=>(typeof e=="number"||e instanceof Number)&&isFinite(+e);function On(e,t){return de(e)?e:t}function ut(e,t){return typeof e>"u"?t:e}const yV=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:e/t,pP=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function Ft(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function At(e,t,n,i){let s,r,o;if(Vt(e))if(r=e.length,i)for(s=r-1;s>=0;s--)t.call(n,e[s],s);else for(s=0;se,x:e=>e.x,y:e=>e.y};function Ys(e,t){return(T1[t]||(T1[t]=bV(t)))(e)}function bV(e){const t=_V(e);return n=>{for(const i of t){if(i==="")break;n=n&&n[i]}return n}}function _V(e){const t=e.split("."),n=[];let i="";for(const s of t)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(n.push(i),i="");return n}function Jy(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Hn=e=>typeof e<"u",Xs=e=>typeof e=="function",D1=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function wV(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const qt=Math.PI,Nt=2*qt,kV=Nt+qt,Zd=Number.POSITIVE_INFINITY,SV=qt/180,ae=qt/2,Ta=qt/4,E1=qt*2/3,jn=Math.log10,_i=Math.sign;function A1(e){const t=Math.round(e);e=_l(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(jn(e))),i=e/n;return(i<=1?1:i<=2?2:i<=5?5:10)*n}function MV(e){const t=[],n=Math.sqrt(e);let i;for(i=1;is-r).pop(),t}function ta(e){return!isNaN(parseFloat(e))&&isFinite(e)}function _l(e,t,n){return Math.abs(e-t)=e}function gP(e,t,n){let i,s,r;for(i=0,s=e.length;il&&c=Math.min(t,n)-i&&e<=Math.max(t,n)+i}function e0(e,t,n){n=n||(o=>e[o]1;)r=s+i>>1,n(r)?s=r:i=r;return{lo:s,hi:i}}const Xi=(e,t,n,i)=>e0(e,n,i?s=>e[s][t]<=n:s=>e[s][t]e0(e,n,i=>e[i][t]>=n);function EV(e,t,n){let i=0,s=e.length;for(;ii&&e[s-1]>n;)s--;return i>0||s{const i="_onData"+Jy(n),s=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...r){const o=s.apply(this,r);return e._chartjs.listeners.forEach(a=>{typeof a[i]=="function"&&a[i](...r)}),o}})})}function L1(e,t){const n=e._chartjs;if(!n)return;const i=n.listeners,s=i.indexOf(t);s!==-1&&i.splice(s,1),!(i.length>0)&&(vP.forEach(r=>{delete e[r]}),delete e._chartjs)}function xP(e){const t=new Set;let n,i;for(n=0,i=e.length;n"u"?function(e){return e()}:window.requestAnimationFrame}();function _P(e,t,n){const i=n||(o=>Array.prototype.slice.call(o));let s=!1,r=[];return function(...o){r=i(o),s||(s=!0,bP.call(window,()=>{s=!1,e.apply(t,r)}))}}function OV(e,t){let n;return function(...i){return t?(clearTimeout(n),n=setTimeout(e,t,i)):e.apply(this,i),t}}const n0=e=>e==="start"?"left":e==="end"?"right":"center",$e=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,LV=(e,t,n,i)=>e===(i?"left":"right")?n:e==="center"?(t+n)/2:t;function wP(e,t,n){const i=t.length;let s=0,r=i;if(e._sorted){const{iScale:o,_parsed:a}=e,l=o.axis,{min:c,max:u,minDefined:d,maxDefined:h}=o.getUserBounds();d&&(s=ke(Math.min(Xi(a,o.axis,c).lo,n?i:Xi(t,l,o.getPixelForValue(c)).lo),0,i-1)),h?r=ke(Math.max(Xi(a,o.axis,u,!0).hi+1,n?0:Xi(t,l,o.getPixelForValue(u),!0).hi+1),s,i)-s:r=i-s}return{start:s,count:r}}function kP(e){const{xScale:t,yScale:n,_scaleRanges:i}=e,s={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!i)return e._scaleRanges=s,!0;const r=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==n.min||i.ymax!==n.max;return Object.assign(i,s),r}const yu=e=>e===0||e===1,R1=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*Nt/n)),N1=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*Nt/n)+1,wl={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*ae)+1,easeOutSine:e=>Math.sin(e*ae),easeInOutSine:e=>-.5*(Math.cos(qt*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=>yu(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=>yu(e)?e:R1(e,.075,.3),easeOutElastic:e=>yu(e)?e:N1(e,.075,.3),easeInOutElastic(e){return yu(e)?e:e<.5?.5*R1(e*2,.1125,.45):.5+.5*N1(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-wl.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?wl.easeInBounce(e*2)*.5:wl.easeOutBounce(e*2-1)*.5+.5};/*! + */function Ei(){}const gV=function(){let e=0;return function(){return e++}}();function Mt(e){return e===null||typeof e>"u"}function Vt(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 yt(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}const de=e=>(typeof e=="number"||e instanceof Number)&&isFinite(+e);function On(e,t){return de(e)?e:t}function ut(e,t){return typeof e>"u"?t:e}const yV=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:e/t,pP=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function Ft(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function At(e,t,n,i){let s,r,o;if(Vt(e))if(r=e.length,i)for(s=r-1;s>=0;s--)t.call(n,e[s],s);else for(s=0;se,x:e=>e.x,y:e=>e.y};function Ys(e,t){return(T1[t]||(T1[t]=bV(t)))(e)}function bV(e){const t=_V(e);return n=>{for(const i of t){if(i==="")break;n=n&&n[i]}return n}}function _V(e){const t=e.split("."),n=[];let i="";for(const s of t)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(n.push(i),i="");return n}function Jy(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Hn=e=>typeof e<"u",Xs=e=>typeof e=="function",D1=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function wV(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const qt=Math.PI,Nt=2*qt,kV=Nt+qt,Zd=Number.POSITIVE_INFINITY,SV=qt/180,ae=qt/2,Ta=qt/4,E1=qt*2/3,jn=Math.log10,_i=Math.sign;function A1(e){const t=Math.round(e);e=wl(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(jn(e))),i=e/n;return(i<=1?1:i<=2?2:i<=5?5:10)*n}function MV(e){const t=[],n=Math.sqrt(e);let i;for(i=1;is-r).pop(),t}function ta(e){return!isNaN(parseFloat(e))&&isFinite(e)}function wl(e,t,n){return Math.abs(e-t)=e}function gP(e,t,n){let i,s,r;for(i=0,s=e.length;il&&c=Math.min(t,n)-i&&e<=Math.max(t,n)+i}function e0(e,t,n){n=n||(o=>e[o]1;)r=s+i>>1,n(r)?s=r:i=r;return{lo:s,hi:i}}const Xi=(e,t,n,i)=>e0(e,n,i?s=>e[s][t]<=n:s=>e[s][t]e0(e,n,i=>e[i][t]>=n);function EV(e,t,n){let i=0,s=e.length;for(;ii&&e[s-1]>n;)s--;return i>0||s{const i="_onData"+Jy(n),s=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...r){const o=s.apply(this,r);return e._chartjs.listeners.forEach(a=>{typeof a[i]=="function"&&a[i](...r)}),o}})})}function R1(e,t){const n=e._chartjs;if(!n)return;const i=n.listeners,s=i.indexOf(t);s!==-1&&i.splice(s,1),!(i.length>0)&&(vP.forEach(r=>{delete e[r]}),delete e._chartjs)}function xP(e){const t=new Set;let n,i;for(n=0,i=e.length;n"u"?function(e){return e()}:window.requestAnimationFrame}();function _P(e,t,n){const i=n||(o=>Array.prototype.slice.call(o));let s=!1,r=[];return function(...o){r=i(o),s||(s=!0,bP.call(window,()=>{s=!1,e.apply(t,r)}))}}function OV(e,t){let n;return function(...i){return t?(clearTimeout(n),n=setTimeout(e,t,i)):e.apply(this,i),t}}const n0=e=>e==="start"?"left":e==="end"?"right":"center",$e=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,RV=(e,t,n,i)=>e===(i?"left":"right")?n:e==="center"?(t+n)/2:t;function wP(e,t,n){const i=t.length;let s=0,r=i;if(e._sorted){const{iScale:o,_parsed:a}=e,l=o.axis,{min:c,max:u,minDefined:d,maxDefined:h}=o.getUserBounds();d&&(s=ke(Math.min(Xi(a,o.axis,c).lo,n?i:Xi(t,l,o.getPixelForValue(c)).lo),0,i-1)),h?r=ke(Math.max(Xi(a,o.axis,u,!0).hi+1,n?0:Xi(t,l,o.getPixelForValue(u),!0).hi+1),s,i)-s:r=i-s}return{start:s,count:r}}function kP(e){const{xScale:t,yScale:n,_scaleRanges:i}=e,s={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!i)return e._scaleRanges=s,!0;const r=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==n.min||i.ymax!==n.max;return Object.assign(i,s),r}const vu=e=>e===0||e===1,L1=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*Nt/n)),N1=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*Nt/n)+1,kl={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*ae)+1,easeOutSine:e=>Math.sin(e*ae),easeInOutSine:e=>-.5*(Math.cos(qt*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=>vu(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=>vu(e)?e:L1(e,.075,.3),easeOutElastic:e=>vu(e)?e:N1(e,.075,.3),easeInOutElastic(e){return vu(e)?e:e<.5?.5*L1(e*2,.1125,.45):.5+.5*N1(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-kl.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?kl.easeInBounce(e*2)*.5:kl.easeOutBounce(e*2-1)*.5+.5};/*! * @kurkle/color v0.2.1 * https://github.com/kurkle/color#readme * (c) 2022 Jukka Kurkela * Released under the MIT License - */function _c(e){return e+.5|0}const Cs=(e,t,n)=>Math.max(Math.min(e,n),t);function Za(e){return Cs(_c(e*2.55),0,255)}function Fs(e){return Cs(_c(e*255),0,255)}function Ii(e){return Cs(_c(e/2.55)/100,0,1)}function j1(e){return Cs(_c(e*100),0,100)}const En={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Hm=[..."0123456789ABCDEF"],RV=e=>Hm[e&15],NV=e=>Hm[(e&240)>>4]+Hm[e&15],vu=e=>(e&240)>>4===(e&15),jV=e=>vu(e.r)&&vu(e.g)&&vu(e.b)&&vu(e.a);function $V(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&En[e[1]]*17,g:255&En[e[2]]*17,b:255&En[e[3]]*17,a:t===5?En[e[4]]*17:255}:(t===7||t===9)&&(n={r:En[e[1]]<<4|En[e[2]],g:En[e[3]]<<4|En[e[4]],b:En[e[5]]<<4|En[e[6]],a:t===9?En[e[7]]<<4|En[e[8]]:255})),n}const IV=(e,t)=>e<255?t(e):"";function FV(e){var t=jV(e)?RV:NV;return e?"#"+t(e.r)+t(e.g)+t(e.b)+IV(e.a,t):void 0}const BV=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function SP(e,t,n){const i=t*Math.min(n,1-n),s=(r,o=(r+e/30)%12)=>n-i*Math.max(Math.min(o-3,9-o,1),-1);return[s(0),s(8),s(4)]}function VV(e,t,n){const i=(s,r=(s+e/60)%6)=>n-n*t*Math.max(Math.min(r,4-r,1),0);return[i(5),i(3),i(1)]}function zV(e,t,n){const i=SP(e,1,.5);let s;for(t+n>1&&(s=1/(t+n),t*=s,n*=s),s=0;s<3;s++)i[s]*=1-t-n,i[s]+=t;return i}function WV(e,t,n,i,s){return e===s?(t-n)/i+(t.5?u/(2-r-o):u/(r+o),l=WV(n,i,s,u,r),l=l*60+.5),[l|0,c||0,a]}function s0(e,t,n,i){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,i)).map(Fs)}function r0(e,t,n){return s0(SP,e,t,n)}function HV(e,t,n){return s0(zV,e,t,n)}function UV(e,t,n){return s0(VV,e,t,n)}function MP(e){return(e%360+360)%360}function YV(e){const t=BV.exec(e);let n=255,i;if(!t)return;t[5]!==i&&(n=t[6]?Za(+t[5]):Fs(+t[5]));const s=MP(+t[2]),r=+t[3]/100,o=+t[4]/100;return t[1]==="hwb"?i=HV(s,r,o):t[1]==="hsv"?i=UV(s,r,o):i=r0(s,r,o),{r:i[0],g:i[1],b:i[2],a:n}}function XV(e,t){var n=i0(e);n[0]=MP(n[0]+t),n=r0(n),e.r=n[0],e.g=n[1],e.b=n[2]}function KV(e){if(!e)return;const t=i0(e),n=t[0],i=j1(t[1]),s=j1(t[2]);return e.a<255?`hsla(${n}, ${i}%, ${s}%, ${Ii(e.a)})`:`hsl(${n}, ${i}%, ${s}%)`}const $1={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},I1={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function GV(){const e={},t=Object.keys(I1),n=Object.keys($1);let i,s,r,o,a;for(i=0;i>16&255,r>>8&255,r&255]}return e}let xu;function qV(e){xu||(xu=GV(),xu.transparent=[0,0,0,0]);const t=xu[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const QV=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function ZV(e){const t=QV.exec(e);let n=255,i,s,r;if(t){if(t[7]!==i){const o=+t[7];n=t[8]?Za(o):Cs(o*255,0,255)}return i=+t[1],s=+t[3],r=+t[5],i=255&(t[2]?Za(i):Cs(i,0,255)),s=255&(t[4]?Za(s):Cs(s,0,255)),r=255&(t[6]?Za(r):Cs(r,0,255)),{r:i,g:s,b:r,a:n}}}function JV(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${Ii(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const rp=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,Jr=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function tz(e,t,n){const i=Jr(Ii(e.r)),s=Jr(Ii(e.g)),r=Jr(Ii(e.b));return{r:Fs(rp(i+n*(Jr(Ii(t.r))-i))),g:Fs(rp(s+n*(Jr(Ii(t.g))-s))),b:Fs(rp(r+n*(Jr(Ii(t.b))-r))),a:e.a+n*(t.a-e.a)}}function bu(e,t,n){if(e){let i=i0(e);i[t]=Math.max(0,Math.min(i[t]+i[t]*n,t===0?360:1)),i=r0(i),e.r=i[0],e.g=i[1],e.b=i[2]}}function CP(e,t){return e&&Object.assign(t||{},e)}function F1(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=Fs(e[3]))):(t=CP(e,{r:0,g:0,b:0,a:1}),t.a=Fs(t.a)),t}function ez(e){return e.charAt(0)==="r"?ZV(e):YV(e)}class Jd{constructor(t){if(t instanceof Jd)return t;const n=typeof t;let i;n==="object"?i=F1(t):n==="string"&&(i=$V(t)||qV(t)||ez(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=CP(this._rgb);return t&&(t.a=Ii(t.a)),t}set rgb(t){this._rgb=F1(t)}rgbString(){return this._valid?JV(this._rgb):void 0}hexString(){return this._valid?FV(this._rgb):void 0}hslString(){return this._valid?KV(this._rgb):void 0}mix(t,n){if(t){const i=this.rgb,s=t.rgb;let r;const o=n===r?.5:n,a=2*o-1,l=i.a-s.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;r=1-c,i.r=255&c*i.r+r*s.r+.5,i.g=255&c*i.g+r*s.g+.5,i.b=255&c*i.b+r*s.b+.5,i.a=o*i.a+(1-o)*s.a,this.rgb=i}return this}interpolate(t,n){return t&&(this._rgb=tz(this._rgb,t._rgb,n)),this}clone(){return new Jd(this.rgb)}alpha(t){return this._rgb.a=Fs(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=_c(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=n,this}opaquer(t){const n=this._rgb;return n.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return bu(this._rgb,2,t),this}darken(t){return bu(this._rgb,2,-t),this}saturate(t){return bu(this._rgb,1,t),this}desaturate(t){return bu(this._rgb,1,-t),this}rotate(t){return XV(this._rgb,t),this}}function PP(e){return new Jd(e)}function TP(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function B1(e){return TP(e)?e:PP(e)}function op(e){return TP(e)?e:PP(e).saturate(.5).darken(.1).hexString()}const Vr=Object.create(null),Um=Object.create(null);function kl(e,t){if(!t)return e;const n=t.split(".");for(let i=0,s=n.length;in.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=(n,i)=>op(i.backgroundColor),this.hoverBorderColor=(n,i)=>op(i.borderColor),this.hoverColor=(n,i)=>op(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)}set(t,n){return ap(this,t,n)}get(t){return kl(this,t)}describe(t,n){return ap(Um,t,n)}override(t,n){return ap(Vr,t,n)}route(t,n,i,s){const r=kl(this,t),o=kl(this,i),a="_"+n;Object.defineProperties(r,{[a]:{value:r[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],c=o[s];return yt(l)?Object.assign({},c,l):ut(l,c)},set(l){this[a]=l}}})}}var _t=new nz({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function iz(e){return!e||Mt(e.size)||Mt(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function th(e,t,n,i,s){let r=t[s];return r||(r=t[s]=e.measureText(s).width,n.push(s)),r>i&&(i=r),i}function sz(e,t,n,i){i=i||{};let s=i.data=i.data||{},r=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(s=i.data={},r=i.garbageCollect=[],i.font=t),e.save(),e.font=t;let o=0;const a=n.length;let l,c,u,d,h;for(l=0;ln.length){for(l=0;l0&&e.stroke()}}function tc(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.xt.top-n&&e.y0&&r.strokeColor!=="";let l,c;for(e.save(),e.font=s.string,az(e,r),l=0;l+e||0;function o0(e,t){const n={},i=yt(t),s=i?Object.keys(t):t,r=yt(e)?i?o=>ut(e[o],e[t[o]]):o=>e[o]:()=>e;for(const o of s)n[o]=hz(r(o));return n}function EP(e){return o0(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Er(e){return o0(e,["topLeft","topRight","bottomLeft","bottomRight"])}function ze(e){const t=EP(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function be(e,t){e=e||{},t=t||_t.font;let n=ut(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let i=ut(e.style,t.style);i&&!(""+i).match(uz)&&(console.warn('Invalid font style specified: "'+i+'"'),i="");const s={family:ut(e.family,t.family),lineHeight:dz(ut(e.lineHeight,t.lineHeight),n),size:n,style:i,weight:ut(e.weight,t.weight),string:""};return s.string=iz(s),s}function Ja(e,t,n,i){let s=!0,r,o,a;for(r=0,o=e.length;rn&&a===0?0:a+l;return{min:o(i,-Math.abs(r)),max:o(s,r)}}function er(e,t){return Object.assign(Object.create(e),t)}function a0(e,t=[""],n=e,i,s=()=>e[0]){Hn(i)||(i=RP("_fallback",e));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:n,_fallback:i,_getTarget:s,override:o=>a0([o,...e],t,n,i)};return new Proxy(r,{deleteProperty(o,a){return delete o[a],delete o._keys,delete e[0][a],!0},get(o,a){return OP(o,a,()=>_z(a,t,e,o))},getOwnPropertyDescriptor(o,a){return Reflect.getOwnPropertyDescriptor(o._scopes[0],a)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(o,a){return W1(o).includes(a)},ownKeys(o){return W1(o)},set(o,a,l){const c=o._storage||(o._storage=s());return o[a]=c[a]=l,delete o._keys,!0}})}function ea(e,t,n,i){const s={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:AP(e,i),setContext:r=>ea(e,r,n,i),override:r=>ea(e.override(r),t,n,i)};return new Proxy(s,{deleteProperty(r,o){return delete r[o],delete e[o],!0},get(r,o,a){return OP(r,o,()=>mz(r,o,a))},getOwnPropertyDescriptor(r,o){return r._descriptors.allKeys?Reflect.has(e,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,o)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(r,o){return Reflect.has(e,o)},ownKeys(){return Reflect.ownKeys(e)},set(r,o,a){return e[o]=a,delete r[o],!0}})}function AP(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:i=t.indexable,_allKeys:s=t.allKeys}=e;return{allKeys:s,scriptable:n,indexable:i,isScriptable:Xs(n)?n:()=>n,isIndexable:Xs(i)?i:()=>i}}const pz=(e,t)=>e?e+Jy(t):t,l0=(e,t)=>yt(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function OP(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];const i=n();return e[t]=i,i}function mz(e,t,n){const{_proxy:i,_context:s,_subProxy:r,_descriptors:o}=e;let a=i[t];return Xs(a)&&o.isScriptable(t)&&(a=gz(t,a,e,n)),Vt(a)&&a.length&&(a=yz(t,a,e,o.isIndexable)),l0(t,a)&&(a=ea(a,s,r&&r[t],o)),a}function gz(e,t,n,i){const{_proxy:s,_context:r,_subProxy:o,_stack:a}=n;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);return a.add(e),t=t(r,o||i),a.delete(e),l0(e,t)&&(t=c0(s._scopes,s,e,t)),t}function yz(e,t,n,i){const{_proxy:s,_context:r,_subProxy:o,_descriptors:a}=n;if(Hn(r.index)&&i(e))t=t[r.index%t.length];else if(yt(t[0])){const l=t,c=s._scopes.filter(u=>u!==l);t=[];for(const u of l){const d=c0(c,s,e,u);t.push(ea(d,r,o&&o[e],a))}}return t}function LP(e,t,n){return Xs(e)?e(t,n):e}const vz=(e,t)=>e===!0?t:typeof e=="string"?Ys(t,e):void 0;function xz(e,t,n,i,s){for(const r of t){const o=vz(n,r);if(o){e.add(o);const a=LP(o._fallback,n,s);if(Hn(a)&&a!==n&&a!==i)return a}else if(o===!1&&Hn(i)&&n!==i)return null}return!1}function c0(e,t,n,i){const s=t._rootScopes,r=LP(t._fallback,n,i),o=[...e,...s],a=new Set;a.add(i);let l=z1(a,o,n,r||n,i);return l===null||Hn(r)&&r!==n&&(l=z1(a,o,r,l,i),l===null)?!1:a0(Array.from(a),[""],s,r,()=>bz(t,n,i))}function z1(e,t,n,i,s){for(;n;)n=xz(e,t,n,i,s);return n}function bz(e,t,n){const i=e._getTarget();t in i||(i[t]={});const s=i[t];return Vt(s)&&yt(n)?n:s}function _z(e,t,n,i){let s;for(const r of t)if(s=RP(pz(r,e),n),Hn(s))return l0(e,s)?c0(n,i,e,s):s}function RP(e,t){for(const n of t){if(!n)continue;const i=n[e];if(Hn(i))return i}}function W1(e){let t=e._keys;return t||(t=e._keys=wz(e._scopes)),t}function wz(e){const t=new Set;for(const n of e)for(const i of Object.keys(n).filter(s=>!s.startsWith("_")))t.add(i);return Array.from(t)}function NP(e,t,n,i){const{iScale:s}=e,{key:r="r"}=this._parsing,o=new Array(i);let a,l,c,u;for(a=0,l=i;ate==="x"?"y":"x";function Sz(e,t,n,i){const s=e.skip?t:e,r=t,o=n.skip?t:n,a=Wm(r,s),l=Wm(o,r);let c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const d=i*c,h=i*u;return{previous:{x:r.x-d*(o.x-s.x),y:r.y-d*(o.y-s.y)},next:{x:r.x+h*(o.x-s.x),y:r.y+h*(o.y-s.y)}}}function Mz(e,t,n){const i=e.length;let s,r,o,a,l,c=na(e,0);for(let u=0;u!c.skip)),t.cubicInterpolationMode==="monotone")Pz(e,s);else{let c=i?e[e.length-1]:e[0];for(r=0,o=e.length;rwindow.getComputedStyle(e,null);function Ez(e,t){return Wh(e).getPropertyValue(t)}const Az=["top","right","bottom","left"];function Ar(e,t,n){const i={};n=n?"-"+n:"";for(let s=0;s<4;s++){const r=Az[s];i[r]=parseFloat(e[t+"-"+r+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Oz=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function Lz(e,t){const n=e.touches,i=n&&n.length?n[0]:e,{offsetX:s,offsetY:r}=i;let o=!1,a,l;if(Oz(s,r,e.target))a=s,l=r;else{const c=t.getBoundingClientRect();a=i.clientX-c.left,l=i.clientY-c.top,o=!0}return{x:a,y:l,box:o}}function vr(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:i}=t,s=Wh(n),r=s.boxSizing==="border-box",o=Ar(s,"padding"),a=Ar(s,"border","width"),{x:l,y:c,box:u}=Lz(e,n),d=o.left+(u&&a.left),h=o.top+(u&&a.top);let{width:f,height:p}=t;return r&&(f-=o.width+a.width,p-=o.height+a.height),{x:Math.round((l-d)/f*n.width/i),y:Math.round((c-h)/p*n.height/i)}}function Rz(e,t,n){let i,s;if(t===void 0||n===void 0){const r=u0(e);if(!r)t=e.clientWidth,n=e.clientHeight;else{const o=r.getBoundingClientRect(),a=Wh(r),l=Ar(a,"border","width"),c=Ar(a,"padding");t=o.width-c.width-l.width,n=o.height-c.height-l.height,i=eh(a.maxWidth,r,"clientWidth"),s=eh(a.maxHeight,r,"clientHeight")}}return{width:t,height:n,maxWidth:i||Zd,maxHeight:s||Zd}}const lp=e=>Math.round(e*10)/10;function Nz(e,t,n,i){const s=Wh(e),r=Ar(s,"margin"),o=eh(s.maxWidth,e,"clientWidth")||Zd,a=eh(s.maxHeight,e,"clientHeight")||Zd,l=Rz(e,t,n);let{width:c,height:u}=l;if(s.boxSizing==="content-box"){const d=Ar(s,"border","width"),h=Ar(s,"padding");c-=h.width+d.width,u-=h.height+d.height}return c=Math.max(0,c-r.width),u=Math.max(0,i?Math.floor(c/i):u-r.height),c=lp(Math.min(c,o,l.maxWidth)),u=lp(Math.min(u,a,l.maxHeight)),c&&!u&&(u=lp(c/2)),{width:c,height:u}}function H1(e,t,n){const i=t||1,s=Math.floor(e.height*i),r=Math.floor(e.width*i);e.height=s/i,e.width=r/i;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!==i||o.height!==s||o.width!==r?(e.currentDevicePixelRatio=i,o.height=s,o.width=r,e.ctx.setTransform(i,0,0,i,0,0),!0):!1}const jz=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch{}return e}();function U1(e,t){const n=Ez(e,t),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function xr(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function $z(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:i==="middle"?n<.5?e.y:t.y:i==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function Iz(e,t,n,i){const s={x:e.cp2x,y:e.cp2y},r={x:t.cp1x,y:t.cp1y},o=xr(e,s,n),a=xr(s,r,n),l=xr(r,t,n),c=xr(o,a,n),u=xr(a,l,n);return xr(c,u,n)}const Y1=new Map;function Fz(e,t){t=t||{};const n=e+JSON.stringify(t);let i=Y1.get(n);return i||(i=new Intl.NumberFormat(e,t),Y1.set(n,i)),i}function wc(e,t,n){return Fz(t,n).format(e)}const Bz=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,i){return n-i},leftForLtr(n,i){return n-i}}},Vz=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function Lo(e,t,n){return e?Bz(t,n):Vz()}function IP(e,t){let n,i;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,i=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=i)}function FP(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function BP(e){return e==="angle"?{between:Jl,compare:PV,normalize:vn}:{between:Yi,compare:(t,n)=>t-n,normalize:t=>t}}function X1({start:e,end:t,count:n,loop:i,style:s}){return{start:e%n,end:t%n,loop:i&&(t-e+1)%n===0,style:s}}function zz(e,t,n){const{property:i,start:s,end:r}=n,{between:o,normalize:a}=BP(i),l=t.length;let{start:c,end:u,loop:d}=e,h,f;if(d){for(c+=l,u+=l,h=0,f=l;hl(s,x,y)&&a(s,x)!==0,w=()=>a(r,y)===0||l(r,x,y),S=()=>m||_(),C=()=>!m||w();for(let M=u,P=u;M<=d;++M)g=t[M%o],!g.skip&&(y=c(g[i]),y!==x&&(m=l(y,s,r),v===null&&S()&&(v=a(y,s)===0?M:P),v!==null&&C()&&(p.push(X1({start:v,end:M,loop:h,count:o,style:f})),v=null),P=M,x=y));return v!==null&&p.push(X1({start:v,end:d,loop:h,count:o,style:f})),p}function zP(e,t){const n=[],i=e.segments;for(let s=0;ss&&e[r%t].skip;)r--;return r%=t,{start:s,end:r}}function Hz(e,t,n,i){const s=e.length,r=[];let o=t,a=e[t],l;for(l=t+1;l<=n;++l){const c=e[l%s];c.skip||c.stop?a.skip||(i=!1,r.push({start:t%s,end:(l-1)%s,loop:i}),t=o=c.stop?l:null):(o=l,a.skip&&(t=l)),a=c}return o!==null&&r.push({start:t%s,end:o%s,loop:i}),r}function Uz(e,t){const n=e.points,i=e.options.spanGaps,s=n.length;if(!s)return[];const r=!!e._loop,{start:o,end:a}=Wz(n,s,r,i);if(i===!0)return K1(e,[{start:o,end:a,loop:r}],n,t);const l=aMath.max(Math.min(e,n),t);function Za(e){return Cs(wc(e*2.55),0,255)}function Fs(e){return Cs(wc(e*255),0,255)}function Ii(e){return Cs(wc(e/2.55)/100,0,1)}function j1(e){return Cs(wc(e*100),0,100)}const En={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Hm=[..."0123456789ABCDEF"],LV=e=>Hm[e&15],NV=e=>Hm[(e&240)>>4]+Hm[e&15],xu=e=>(e&240)>>4===(e&15),jV=e=>xu(e.r)&&xu(e.g)&&xu(e.b)&&xu(e.a);function $V(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&En[e[1]]*17,g:255&En[e[2]]*17,b:255&En[e[3]]*17,a:t===5?En[e[4]]*17:255}:(t===7||t===9)&&(n={r:En[e[1]]<<4|En[e[2]],g:En[e[3]]<<4|En[e[4]],b:En[e[5]]<<4|En[e[6]],a:t===9?En[e[7]]<<4|En[e[8]]:255})),n}const IV=(e,t)=>e<255?t(e):"";function FV(e){var t=jV(e)?LV:NV;return e?"#"+t(e.r)+t(e.g)+t(e.b)+IV(e.a,t):void 0}const BV=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function SP(e,t,n){const i=t*Math.min(n,1-n),s=(r,o=(r+e/30)%12)=>n-i*Math.max(Math.min(o-3,9-o,1),-1);return[s(0),s(8),s(4)]}function VV(e,t,n){const i=(s,r=(s+e/60)%6)=>n-n*t*Math.max(Math.min(r,4-r,1),0);return[i(5),i(3),i(1)]}function zV(e,t,n){const i=SP(e,1,.5);let s;for(t+n>1&&(s=1/(t+n),t*=s,n*=s),s=0;s<3;s++)i[s]*=1-t-n,i[s]+=t;return i}function WV(e,t,n,i,s){return e===s?(t-n)/i+(t.5?u/(2-r-o):u/(r+o),l=WV(n,i,s,u,r),l=l*60+.5),[l|0,c||0,a]}function s0(e,t,n,i){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,i)).map(Fs)}function r0(e,t,n){return s0(SP,e,t,n)}function HV(e,t,n){return s0(zV,e,t,n)}function UV(e,t,n){return s0(VV,e,t,n)}function MP(e){return(e%360+360)%360}function YV(e){const t=BV.exec(e);let n=255,i;if(!t)return;t[5]!==i&&(n=t[6]?Za(+t[5]):Fs(+t[5]));const s=MP(+t[2]),r=+t[3]/100,o=+t[4]/100;return t[1]==="hwb"?i=HV(s,r,o):t[1]==="hsv"?i=UV(s,r,o):i=r0(s,r,o),{r:i[0],g:i[1],b:i[2],a:n}}function XV(e,t){var n=i0(e);n[0]=MP(n[0]+t),n=r0(n),e.r=n[0],e.g=n[1],e.b=n[2]}function KV(e){if(!e)return;const t=i0(e),n=t[0],i=j1(t[1]),s=j1(t[2]);return e.a<255?`hsla(${n}, ${i}%, ${s}%, ${Ii(e.a)})`:`hsl(${n}, ${i}%, ${s}%)`}const $1={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},I1={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function GV(){const e={},t=Object.keys(I1),n=Object.keys($1);let i,s,r,o,a;for(i=0;i>16&255,r>>8&255,r&255]}return e}let bu;function qV(e){bu||(bu=GV(),bu.transparent=[0,0,0,0]);const t=bu[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const QV=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function ZV(e){const t=QV.exec(e);let n=255,i,s,r;if(t){if(t[7]!==i){const o=+t[7];n=t[8]?Za(o):Cs(o*255,0,255)}return i=+t[1],s=+t[3],r=+t[5],i=255&(t[2]?Za(i):Cs(i,0,255)),s=255&(t[4]?Za(s):Cs(s,0,255)),r=255&(t[6]?Za(r):Cs(r,0,255)),{r:i,g:s,b:r,a:n}}}function JV(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${Ii(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const rp=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,Jr=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function tz(e,t,n){const i=Jr(Ii(e.r)),s=Jr(Ii(e.g)),r=Jr(Ii(e.b));return{r:Fs(rp(i+n*(Jr(Ii(t.r))-i))),g:Fs(rp(s+n*(Jr(Ii(t.g))-s))),b:Fs(rp(r+n*(Jr(Ii(t.b))-r))),a:e.a+n*(t.a-e.a)}}function _u(e,t,n){if(e){let i=i0(e);i[t]=Math.max(0,Math.min(i[t]+i[t]*n,t===0?360:1)),i=r0(i),e.r=i[0],e.g=i[1],e.b=i[2]}}function CP(e,t){return e&&Object.assign(t||{},e)}function F1(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=Fs(e[3]))):(t=CP(e,{r:0,g:0,b:0,a:1}),t.a=Fs(t.a)),t}function ez(e){return e.charAt(0)==="r"?ZV(e):YV(e)}class Jd{constructor(t){if(t instanceof Jd)return t;const n=typeof t;let i;n==="object"?i=F1(t):n==="string"&&(i=$V(t)||qV(t)||ez(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=CP(this._rgb);return t&&(t.a=Ii(t.a)),t}set rgb(t){this._rgb=F1(t)}rgbString(){return this._valid?JV(this._rgb):void 0}hexString(){return this._valid?FV(this._rgb):void 0}hslString(){return this._valid?KV(this._rgb):void 0}mix(t,n){if(t){const i=this.rgb,s=t.rgb;let r;const o=n===r?.5:n,a=2*o-1,l=i.a-s.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;r=1-c,i.r=255&c*i.r+r*s.r+.5,i.g=255&c*i.g+r*s.g+.5,i.b=255&c*i.b+r*s.b+.5,i.a=o*i.a+(1-o)*s.a,this.rgb=i}return this}interpolate(t,n){return t&&(this._rgb=tz(this._rgb,t._rgb,n)),this}clone(){return new Jd(this.rgb)}alpha(t){return this._rgb.a=Fs(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=wc(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=n,this}opaquer(t){const n=this._rgb;return n.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return _u(this._rgb,2,t),this}darken(t){return _u(this._rgb,2,-t),this}saturate(t){return _u(this._rgb,1,t),this}desaturate(t){return _u(this._rgb,1,-t),this}rotate(t){return XV(this._rgb,t),this}}function PP(e){return new Jd(e)}function TP(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function B1(e){return TP(e)?e:PP(e)}function op(e){return TP(e)?e:PP(e).saturate(.5).darken(.1).hexString()}const Vr=Object.create(null),Um=Object.create(null);function Sl(e,t){if(!t)return e;const n=t.split(".");for(let i=0,s=n.length;in.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=(n,i)=>op(i.backgroundColor),this.hoverBorderColor=(n,i)=>op(i.borderColor),this.hoverColor=(n,i)=>op(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)}set(t,n){return ap(this,t,n)}get(t){return Sl(this,t)}describe(t,n){return ap(Um,t,n)}override(t,n){return ap(Vr,t,n)}route(t,n,i,s){const r=Sl(this,t),o=Sl(this,i),a="_"+n;Object.defineProperties(r,{[a]:{value:r[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],c=o[s];return yt(l)?Object.assign({},c,l):ut(l,c)},set(l){this[a]=l}}})}}var _t=new nz({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function iz(e){return!e||Mt(e.size)||Mt(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function th(e,t,n,i,s){let r=t[s];return r||(r=t[s]=e.measureText(s).width,n.push(s)),r>i&&(i=r),i}function sz(e,t,n,i){i=i||{};let s=i.data=i.data||{},r=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(s=i.data={},r=i.garbageCollect=[],i.font=t),e.save(),e.font=t;let o=0;const a=n.length;let l,c,u,d,h;for(l=0;ln.length){for(l=0;l0&&e.stroke()}}function ec(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.xt.top-n&&e.y0&&r.strokeColor!=="";let l,c;for(e.save(),e.font=s.string,az(e,r),l=0;l+e||0;function o0(e,t){const n={},i=yt(t),s=i?Object.keys(t):t,r=yt(e)?i?o=>ut(e[o],e[t[o]]):o=>e[o]:()=>e;for(const o of s)n[o]=hz(r(o));return n}function EP(e){return o0(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Er(e){return o0(e,["topLeft","topRight","bottomLeft","bottomRight"])}function ze(e){const t=EP(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function be(e,t){e=e||{},t=t||_t.font;let n=ut(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let i=ut(e.style,t.style);i&&!(""+i).match(uz)&&(console.warn('Invalid font style specified: "'+i+'"'),i="");const s={family:ut(e.family,t.family),lineHeight:dz(ut(e.lineHeight,t.lineHeight),n),size:n,style:i,weight:ut(e.weight,t.weight),string:""};return s.string=iz(s),s}function Ja(e,t,n,i){let s=!0,r,o,a;for(r=0,o=e.length;rn&&a===0?0:a+l;return{min:o(i,-Math.abs(r)),max:o(s,r)}}function er(e,t){return Object.assign(Object.create(e),t)}function a0(e,t=[""],n=e,i,s=()=>e[0]){Hn(i)||(i=LP("_fallback",e));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:n,_fallback:i,_getTarget:s,override:o=>a0([o,...e],t,n,i)};return new Proxy(r,{deleteProperty(o,a){return delete o[a],delete o._keys,delete e[0][a],!0},get(o,a){return OP(o,a,()=>_z(a,t,e,o))},getOwnPropertyDescriptor(o,a){return Reflect.getOwnPropertyDescriptor(o._scopes[0],a)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(o,a){return W1(o).includes(a)},ownKeys(o){return W1(o)},set(o,a,l){const c=o._storage||(o._storage=s());return o[a]=c[a]=l,delete o._keys,!0}})}function ea(e,t,n,i){const s={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:AP(e,i),setContext:r=>ea(e,r,n,i),override:r=>ea(e.override(r),t,n,i)};return new Proxy(s,{deleteProperty(r,o){return delete r[o],delete e[o],!0},get(r,o,a){return OP(r,o,()=>mz(r,o,a))},getOwnPropertyDescriptor(r,o){return r._descriptors.allKeys?Reflect.has(e,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,o)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(r,o){return Reflect.has(e,o)},ownKeys(){return Reflect.ownKeys(e)},set(r,o,a){return e[o]=a,delete r[o],!0}})}function AP(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:i=t.indexable,_allKeys:s=t.allKeys}=e;return{allKeys:s,scriptable:n,indexable:i,isScriptable:Xs(n)?n:()=>n,isIndexable:Xs(i)?i:()=>i}}const pz=(e,t)=>e?e+Jy(t):t,l0=(e,t)=>yt(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function OP(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];const i=n();return e[t]=i,i}function mz(e,t,n){const{_proxy:i,_context:s,_subProxy:r,_descriptors:o}=e;let a=i[t];return Xs(a)&&o.isScriptable(t)&&(a=gz(t,a,e,n)),Vt(a)&&a.length&&(a=yz(t,a,e,o.isIndexable)),l0(t,a)&&(a=ea(a,s,r&&r[t],o)),a}function gz(e,t,n,i){const{_proxy:s,_context:r,_subProxy:o,_stack:a}=n;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);return a.add(e),t=t(r,o||i),a.delete(e),l0(e,t)&&(t=c0(s._scopes,s,e,t)),t}function yz(e,t,n,i){const{_proxy:s,_context:r,_subProxy:o,_descriptors:a}=n;if(Hn(r.index)&&i(e))t=t[r.index%t.length];else if(yt(t[0])){const l=t,c=s._scopes.filter(u=>u!==l);t=[];for(const u of l){const d=c0(c,s,e,u);t.push(ea(d,r,o&&o[e],a))}}return t}function RP(e,t,n){return Xs(e)?e(t,n):e}const vz=(e,t)=>e===!0?t:typeof e=="string"?Ys(t,e):void 0;function xz(e,t,n,i,s){for(const r of t){const o=vz(n,r);if(o){e.add(o);const a=RP(o._fallback,n,s);if(Hn(a)&&a!==n&&a!==i)return a}else if(o===!1&&Hn(i)&&n!==i)return null}return!1}function c0(e,t,n,i){const s=t._rootScopes,r=RP(t._fallback,n,i),o=[...e,...s],a=new Set;a.add(i);let l=z1(a,o,n,r||n,i);return l===null||Hn(r)&&r!==n&&(l=z1(a,o,r,l,i),l===null)?!1:a0(Array.from(a),[""],s,r,()=>bz(t,n,i))}function z1(e,t,n,i,s){for(;n;)n=xz(e,t,n,i,s);return n}function bz(e,t,n){const i=e._getTarget();t in i||(i[t]={});const s=i[t];return Vt(s)&&yt(n)?n:s}function _z(e,t,n,i){let s;for(const r of t)if(s=LP(pz(r,e),n),Hn(s))return l0(e,s)?c0(n,i,e,s):s}function LP(e,t){for(const n of t){if(!n)continue;const i=n[e];if(Hn(i))return i}}function W1(e){let t=e._keys;return t||(t=e._keys=wz(e._scopes)),t}function wz(e){const t=new Set;for(const n of e)for(const i of Object.keys(n).filter(s=>!s.startsWith("_")))t.add(i);return Array.from(t)}function NP(e,t,n,i){const{iScale:s}=e,{key:r="r"}=this._parsing,o=new Array(i);let a,l,c,u;for(a=0,l=i;ate==="x"?"y":"x";function Sz(e,t,n,i){const s=e.skip?t:e,r=t,o=n.skip?t:n,a=Wm(r,s),l=Wm(o,r);let c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const d=i*c,h=i*u;return{previous:{x:r.x-d*(o.x-s.x),y:r.y-d*(o.y-s.y)},next:{x:r.x+h*(o.x-s.x),y:r.y+h*(o.y-s.y)}}}function Mz(e,t,n){const i=e.length;let s,r,o,a,l,c=na(e,0);for(let u=0;u!c.skip)),t.cubicInterpolationMode==="monotone")Pz(e,s);else{let c=i?e[e.length-1]:e[0];for(r=0,o=e.length;rwindow.getComputedStyle(e,null);function Ez(e,t){return Wh(e).getPropertyValue(t)}const Az=["top","right","bottom","left"];function Ar(e,t,n){const i={};n=n?"-"+n:"";for(let s=0;s<4;s++){const r=Az[s];i[r]=parseFloat(e[t+"-"+r+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Oz=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function Rz(e,t){const n=e.touches,i=n&&n.length?n[0]:e,{offsetX:s,offsetY:r}=i;let o=!1,a,l;if(Oz(s,r,e.target))a=s,l=r;else{const c=t.getBoundingClientRect();a=i.clientX-c.left,l=i.clientY-c.top,o=!0}return{x:a,y:l,box:o}}function vr(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:i}=t,s=Wh(n),r=s.boxSizing==="border-box",o=Ar(s,"padding"),a=Ar(s,"border","width"),{x:l,y:c,box:u}=Rz(e,n),d=o.left+(u&&a.left),h=o.top+(u&&a.top);let{width:f,height:p}=t;return r&&(f-=o.width+a.width,p-=o.height+a.height),{x:Math.round((l-d)/f*n.width/i),y:Math.round((c-h)/p*n.height/i)}}function Lz(e,t,n){let i,s;if(t===void 0||n===void 0){const r=u0(e);if(!r)t=e.clientWidth,n=e.clientHeight;else{const o=r.getBoundingClientRect(),a=Wh(r),l=Ar(a,"border","width"),c=Ar(a,"padding");t=o.width-c.width-l.width,n=o.height-c.height-l.height,i=eh(a.maxWidth,r,"clientWidth"),s=eh(a.maxHeight,r,"clientHeight")}}return{width:t,height:n,maxWidth:i||Zd,maxHeight:s||Zd}}const lp=e=>Math.round(e*10)/10;function Nz(e,t,n,i){const s=Wh(e),r=Ar(s,"margin"),o=eh(s.maxWidth,e,"clientWidth")||Zd,a=eh(s.maxHeight,e,"clientHeight")||Zd,l=Lz(e,t,n);let{width:c,height:u}=l;if(s.boxSizing==="content-box"){const d=Ar(s,"border","width"),h=Ar(s,"padding");c-=h.width+d.width,u-=h.height+d.height}return c=Math.max(0,c-r.width),u=Math.max(0,i?Math.floor(c/i):u-r.height),c=lp(Math.min(c,o,l.maxWidth)),u=lp(Math.min(u,a,l.maxHeight)),c&&!u&&(u=lp(c/2)),{width:c,height:u}}function H1(e,t,n){const i=t||1,s=Math.floor(e.height*i),r=Math.floor(e.width*i);e.height=s/i,e.width=r/i;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!==i||o.height!==s||o.width!==r?(e.currentDevicePixelRatio=i,o.height=s,o.width=r,e.ctx.setTransform(i,0,0,i,0,0),!0):!1}const jz=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch{}return e}();function U1(e,t){const n=Ez(e,t),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function xr(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function $z(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:i==="middle"?n<.5?e.y:t.y:i==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function Iz(e,t,n,i){const s={x:e.cp2x,y:e.cp2y},r={x:t.cp1x,y:t.cp1y},o=xr(e,s,n),a=xr(s,r,n),l=xr(r,t,n),c=xr(o,a,n),u=xr(a,l,n);return xr(c,u,n)}const Y1=new Map;function Fz(e,t){t=t||{};const n=e+JSON.stringify(t);let i=Y1.get(n);return i||(i=new Intl.NumberFormat(e,t),Y1.set(n,i)),i}function kc(e,t,n){return Fz(t,n).format(e)}const Bz=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,i){return n-i},leftForLtr(n,i){return n-i}}},Vz=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function Ro(e,t,n){return e?Bz(t,n):Vz()}function IP(e,t){let n,i;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,i=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=i)}function FP(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function BP(e){return e==="angle"?{between:tc,compare:PV,normalize:vn}:{between:Yi,compare:(t,n)=>t-n,normalize:t=>t}}function X1({start:e,end:t,count:n,loop:i,style:s}){return{start:e%n,end:t%n,loop:i&&(t-e+1)%n===0,style:s}}function zz(e,t,n){const{property:i,start:s,end:r}=n,{between:o,normalize:a}=BP(i),l=t.length;let{start:c,end:u,loop:d}=e,h,f;if(d){for(c+=l,u+=l,h=0,f=l;hl(s,x,y)&&a(s,x)!==0,w=()=>a(r,y)===0||l(r,x,y),S=()=>m||_(),C=()=>!m||w();for(let M=u,P=u;M<=d;++M)g=t[M%o],!g.skip&&(y=c(g[i]),y!==x&&(m=l(y,s,r),v===null&&S()&&(v=a(y,s)===0?M:P),v!==null&&C()&&(p.push(X1({start:v,end:M,loop:h,count:o,style:f})),v=null),P=M,x=y));return v!==null&&p.push(X1({start:v,end:d,loop:h,count:o,style:f})),p}function zP(e,t){const n=[],i=e.segments;for(let s=0;ss&&e[r%t].skip;)r--;return r%=t,{start:s,end:r}}function Hz(e,t,n,i){const s=e.length,r=[];let o=t,a=e[t],l;for(l=t+1;l<=n;++l){const c=e[l%s];c.skip||c.stop?a.skip||(i=!1,r.push({start:t%s,end:(l-1)%s,loop:i}),t=o=c.stop?l:null):(o=l,a.skip&&(t=l)),a=c}return o!==null&&r.push({start:t%s,end:o%s,loop:i}),r}function Uz(e,t){const n=e.points,i=e.options.spanGaps,s=n.length;if(!s)return[];const r=!!e._loop,{start:o,end:a}=Wz(n,s,r,i);if(i===!0)return K1(e,[{start:o,end:a,loop:r}],n,t);const l=aa({chart:t,initial:n.initial,numSteps:o,currentStep:Math.min(i-n.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=bP.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const r=i.items;let o=r.length-1,a=!1,l;for(;o>=0;--o)l=r[o],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),a=!0):(r[o]=r[r.length-1],r.pop());a&&(s.draw(),this._notify(s,i,t,"progress")),r.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),n+=r.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let i=n.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,i)),i}listen(t,n,i){this._getAnims(t).listeners[n].push(i)}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((i,s)=>Math.max(i,s._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 i=n.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Li=new Kz;const q1="transparent",Gz={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const i=B1(e||q1),s=i.valid&&B1(t||q1);return s&&s.valid?s.mix(i,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class qz{constructor(t,n,i,s){const r=n[i];s=Ja([t.to,s,r,t.from]);const o=Ja([t.from,r,s]);this._active=!0,this._fn=t.fn||Gz[t.type||typeof o],this._easing=wl[t.easing]||wl.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=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(t,n,i){if(this._active){this._notify(!1);const s=this._target[this._prop],r=i-this._start,o=this._duration-r;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=Ja([t.to,n,s,t.from]),this._from=Ja([t.from,s,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,i=this._duration,s=this._prop,r=this._from,o=this._loop,a=this._to;let l;if(this._active=r!==a&&(o||n1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(r,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,i)=>{t.push({res:n,rej:i})})}_notify(t){const n=t?"res":"rej",i=this._promises||[];for(let s=0;se!=="onProgress"&&e!=="onComplete"&&e!=="fn"});_t.set("animations",{colors:{type:"color",properties:Zz},numbers:{type:"number",properties:Qz}});_t.describe("animations",{_fallback:"animation"});_t.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:e=>e|0}}}});class WP{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!yt(t))return;const n=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const s=t[i];if(!yt(s))return;const r={};for(const o of Jz)r[o]=s[o];(Vt(s.properties)&&s.properties||[i]).forEach(o=>{(o===i||!n.has(o))&&n.set(o,r)})})}_animateOptions(t,n){const i=n.options,s=e5(t,i);if(!s)return[];const r=this._createAnimations(s,i);return i.$shared&&t5(t.options.$animations,i).then(()=>{t.options=i},()=>{}),r}_createAnimations(t,n){const i=this._properties,s=[],r=t.$animations||(t.$animations={}),o=Object.keys(n),a=Date.now();let l;for(l=o.length-1;l>=0;--l){const c=o[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,n));continue}const u=n[c];let d=r[c];const h=i.get(c);if(d)if(h&&d.active()){d.update(h,u,a);continue}else d.cancel();if(!h||!h.duration){t[c]=u;continue}r[c]=d=new qz(h,t,c,u),s.push(d)}return s}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const i=this._createAnimations(t,n);if(i.length)return Li.add(this._chart,i),!0}}function t5(e,t){const n=[],i=Object.keys(t);for(let s=0;s0||!n&&r<0)return s.index}return null}function e_(e,t){const{chart:n,_cachedMeta:i}=e,s=n._stacks||(n._stacks={}),{iScale:r,vScale:o,index:a}=i,l=r.axis,c=o.axis,u=r5(r,o,i),d=t.length;let h;for(let f=0;fn[i].axis===t).shift()}function l5(e,t){return er(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function c5(e,t,n){return er(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function Da(e,t){const n=e.controller.index,i=e.vScale&&e.vScale.axis;if(i){t=t||e._parsed;for(const s of t){const r=s._stacks;if(!r||r[i]===void 0||r[i][n]===void 0)return;delete r[i][n]}}}const up=e=>e==="reset"||e==="none",n_=(e,t)=>t?e:Object.assign({},e),u5=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:HP(n,!0),values:null};class ri{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.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=J1(t.vScale,t),this.addElements()}updateIndex(t){this.index!==t&&Da(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,i=this.getDataset(),s=(d,h,f,p)=>d==="x"?h:d==="r"?p:f,r=n.xAxisID=ut(i.xAxisID,cp(t,"x")),o=n.yAxisID=ut(i.yAxisID,cp(t,"y")),a=n.rAxisID=ut(i.rAxisID,cp(t,"r")),l=n.indexAxis,c=n.iAxisID=s(l,r,o,a),u=n.vAxisID=s(l,o,r,a);n.xScale=this.getScaleForId(r),n.yScale=this.getScaleForId(o),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(u)}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&&L1(this._data,this),t._stacked&&Da(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),i=this._data;if(yt(n))this._data=s5(n);else if(i!==n){if(i){L1(i,this);const s=this._cachedMeta;Da(s),s._parsed=[]}n&&Object.isExtensible(n)&&AV(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,i=this.getDataset();let s=!1;this._dataCheck();const r=n._stacked;n._stacked=J1(n.vScale,n),n.stack!==i.stack&&(s=!0,Da(n),n.stack=i.stack),this._resyncElements(t),(s||r!==n._stacked)&&e_(this,n._parsed)}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:i,_data:s}=this,{iScale:r,_stacked:o}=i,a=r.axis;let l=t===0&&n===s.length?!0:i._sorted,c=t>0&&i._parsed[t-1],u,d,h;if(this._parsing===!1)i._parsed=s,i._sorted=!0,h=s;else{Vt(s[t])?h=this.parseArrayData(i,s,t,n):yt(s[t])?h=this.parseObjectData(i,s,t,n):h=this.parsePrimitiveData(i,s,t,n);const f=()=>d[a]===null||c&&d[a]m||d=0;--h)if(!p()){this.updateRangeFromParsed(c,t,f,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,i=[];let s,r,o;for(s=0,r=n.length;s=0&&tthis.getContext(i,s),m=c.resolveNamedOptions(h,f,p,d);return m.$shared&&(m.$shared=l,r[o]=Object.freeze(n_(m,l))),m}_resolveAnimations(t,n,i){const s=this.chart,r=this._cachedDataOpts,o=`animation-${n}`,a=r[o];if(a)return a;let l;if(s.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,n),h=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(h,this.getContext(t,i,n))}const c=new WP(s,l&&l.animations);return l&&l._cacheable&&(r[o]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||up(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const i=this.resolveDataElementOptions(t,n),s=this._sharedOptions,r=this.getSharedOptions(i),o=this.includeOptions(n,r)||r!==s;return this.updateSharedOptions(r,n,i),{sharedOptions:r,includeOptions:o}}updateElement(t,n,i,s){up(s)?Object.assign(t,i):this._resolveAnimations(n,s).update(t,i)}updateSharedOptions(t,n,i){t&&!up(n)&&this._resolveAnimations(void 0,n).update(t,i)}_setStyle(t,n,i,s){t.active=s;const r=this.getStyle(n,s);this._resolveAnimations(n,i,s).update(t,{options:!s&&this.getSharedOptions(r)||r})}removeHoverStyle(t,n,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,n,i){this._setStyle(t,i,"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,i=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const s=i.length,r=n.length,o=Math.min(r,s);o&&this.parse(0,o),r>s?this._insertElements(s,r-s,t):r{for(c.length+=n,a=c.length-1;a>=o;a--)c[a]=c[a-n]};for(l(r),a=t;as-r))}return e._cache.$bar}function h5(e){const t=e.iScale,n=d5(t,e.type);let i=t._length,s,r,o,a;const l=()=>{o===32767||o===-32768||(Hn(a)&&(i=Math.min(i,Math.abs(o-a)||i)),a=o)};for(s=0,r=n.length;s0?s[e-1]:null,a=eMath.abs(a)&&(l=a,c=o),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:r,min:o,max:a}}function UP(e,t,n,i){return Vt(e)?m5(e,t,n,i):t[n.axis]=n.parse(e,i),t}function i_(e,t,n,i){const s=e.iScale,r=e.vScale,o=s.getLabels(),a=s===r,l=[];let c,u,d,h;for(c=n,u=n+i;c=n?1:-1)}function y5(e){let t,n,i,s,r;return e.horizontal?(t=e.base>e.x,n="left",i="right"):(t=e.basel.controller.options.grouped),r=i.options.stacked,o=[],a=l=>{const c=l.controller.getParsed(n),u=c&&c[l.vScale.axis];if(Mt(u)||isNaN(u))return!0};for(const l of s)if(!(n!==void 0&&a(l))&&((r===!1||o.indexOf(l.stack)===-1||r===void 0&&l.stack===void 0)&&o.push(l.stack),l.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,n,i){const s=this._getStacks(t,i),r=n!==void 0?s.indexOf(n):-1;return r===-1?s.length-1:r}_getRuler(){const t=this.options,n=this._cachedMeta,i=n.iScale,s=[];let r,o;for(r=0,o=n.data.length;r=0;--i)n=Math.max(n,t[i].size(this.resolveDataElementOptions(i))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,{xScale:i,yScale:s}=n,r=this.getParsed(t),o=i.getLabelForValue(r.x),a=s.getLabelForValue(r.y),l=r._custom;return{label:n.label,value:"("+o+", "+a+(l?", "+l:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,i,s){const r=s==="reset",{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(n,s),u=o.axis,d=a.axis;for(let h=n;hJl(x,a,l,!0)?1:Math.max(_,_*n,w,w*n),p=(x,_,w)=>Jl(x,a,l,!0)?-1:Math.min(_,_*n,w,w*n),m=f(0,c,d),v=f(ae,u,h),y=p(qt,c,d),g=p(qt+ae,u,h);i=(m-y)/2,s=(v-g)/2,r=-(m+y)/2,o=-(v+g)/2}return{ratioX:i,ratioY:s,offsetX:r,offsetY:o}}class oa extends ri{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 i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let r=l=>+i[l];if(yt(i[t])){const{key:l="value"}=this._parsing;r=c=>+Ys(i[c],l)}let o,a;for(o=t,a=t+n;o0&&!isNaN(t)?Nt*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=wc(n._parsed[t],i.options.locale);return{label:s[t]||"",value:r}}getMaxBorderWidth(t){let n=0;const i=this.chart;let s,r,o,a,l;if(!t){for(s=0,r=i.data.datasets.length;se!=="spacing",_indexable:e=>e!=="spacing"};oa.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const t=e.data;if(t.labels.length&&t.datasets.length){const{labels:{pointStyle:n}}=e.legend.options;return t.labels.map((i,s)=>{const o=e.getDatasetMeta(0).controller.getStyle(s);return{text:i,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:n,hidden:!e.getDataVisibility(s),index:s}})}return[]}},onClick(e,t,n){n.chart.toggleDataVisibility(t.index),n.chart.update()}},tooltip:{callbacks:{title(){return""},label(e){let t=e.label;const n=": "+e.formattedValue;return Vt(t)?(t=t.slice(),t[0]+=n):t+=n,t}}}}};class Yh extends ri{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:i,data:s=[],_dataset:r}=n,o=this.chart._animationsDisabled;let{start:a,count:l}=wP(n,s,o);this._drawStart=a,this._drawCount=l,kP(n)&&(a=0,l=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!r._decimated,i.points=s;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:c},t),this.updateElements(s,a,l,t)}updateElements(t,n,i,s){const r=s==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(n,s),h=o.axis,f=a.axis,{spanGaps:p,segment:m}=this.options,v=ta(p)?p:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||r||s==="none";let g=n>0&&this.getParsed(n-1);for(let x=n;x0&&Math.abs(w[h]-g[h])>v,m&&(S.parsed=w,S.raw=c.data[x]),d&&(S.options=u||this.resolveDataElementOptions(x,_.active?"active":s)),y||this.updateElement(_,x,S,s),g=w}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,i=n.options&&n.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const r=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,r,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}Yh.id="line";Yh.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};Yh.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class Xh extends ri{constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=wc(n._parsed[t].r,i.options.locale);return{label:s[t]||"",value:r}}parseObjectData(t,n,i,s){return NP.bind(this)(t,n,i,s)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,s)=>{const r=this.getParsed(s).r;!isNaN(r)&&this.chart.getDataVisibility(s)&&(rn.max&&(n.max=r))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,i=t.options,s=Math.min(n.right-n.left,n.bottom-n.top),r=Math.max(s/2,0),o=Math.max(i.cutoutPercentage?r/100*i.cutoutPercentage:1,0),a=(r-o)/t.getVisibleDatasetCount();this.outerRadius=r-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,n,i,s){const r=s==="reset",o=this.chart,l=o.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,d=c.yCenter,h=c.getIndexAngle(0)-.5*qt;let f=h,p;const m=360/this.countVisibleElements();for(p=0;p{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&n++}),n}_computeAngle(t,n,i){return this.chart.getDataVisibility(t)?ti(this.resolveDataElementOptions(t,n).angle||i):0}}Xh.id="polarArea";Xh.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};Xh.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const t=e.data;if(t.labels.length&&t.datasets.length){const{labels:{pointStyle:n}}=e.legend.options;return t.labels.map((i,s)=>{const o=e.getDatasetMeta(0).controller.getStyle(s);return{text:i,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:n,hidden:!e.getDataVisibility(s),index:s}})}return[]}},onClick(e,t,n){n.chart.toggleDataVisibility(t.index),n.chart.update()}},tooltip:{callbacks:{title(){return""},label(e){return e.chart.data.labels[e.dataIndex]+": "+e.formattedValue}}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class d0 extends oa{}d0.id="pie";d0.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class Kh extends ri{getLabelAndValue(t){const n=this._cachedMeta.vScale,i=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(i[n.axis])}}parseObjectData(t,n,i,s){return NP.bind(this)(t,n,i,s)}update(t){const n=this._cachedMeta,i=n.dataset,s=n.data||[],r=n.iScale.getLabels();if(i.points=s,t!=="resize"){const o=this.resolveDatasetElementOptions(t);this.options.showLine||(o.borderWidth=0);const a={_loop:!0,_fullLoop:r.length===s.length,options:o};this.updateElement(i,void 0,a,t)}this.updateElements(s,0,s.length,t)}updateElements(t,n,i,s){const r=this._cachedMeta.rScale,o=s==="reset";for(let a=n;a{s[r]=i[r]&&i[r].active()?i[r]._to:this[r]}),s}};oi.defaults={};oi.defaultRoutes=void 0;const YP={values(e){return Vt(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const i=this.chart.options.locale;let s,r=e;if(n.length>1){const c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),r=w5(e,n)}const o=jn(Math.abs(r)),a=Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),wc(e,i,l)},logarithmic(e,t,n){if(e===0)return"0";const i=e/Math.pow(10,Math.floor(jn(e)));return i===1||i===2||i===5?YP.numeric.call(this,e,t,n):""}};function w5(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 Gh={formatters:YP};_t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth: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:Gh.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}});_t.route("scale.ticks","color","","color");_t.route("scale.grid","color","","borderColor");_t.route("scale.grid","borderColor","","borderColor");_t.route("scale.title","color","","color");_t.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"});_t.describe("scales",{_fallback:"scale"});_t.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"});function k5(e,t){const n=e.options.ticks,i=n.maxTicksLimit||S5(e),s=n.major.enabled?C5(t):[],r=s.length,o=s[0],a=s[r-1],l=[];if(r>i)return P5(t,l,s,r/i),l;const c=M5(s,t,i);if(r>0){let u,d;const h=r>1?Math.round((a-o)/(r-1)):null;for(wu(t,l,c,Mt(h)?0:o-h,o),u=0,d=r-1;us)return l}return Math.max(s,1)}function C5(e){const t=[];let n,i;for(n=0,i=e.length;ne==="left"?"right":e==="right"?"left":e,o_=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n;function a_(e,t){const n=[],i=e.length/t,s=e.length;let r=0;for(;ro+a)))return l}function A5(e,t){At(e,n=>{const i=n.gc,s=i.length/2;let r;if(s>t){for(r=0;ri?i:n,i=s&&n>i?n:i,{min:On(n,On(i,n)),max:On(i,On(n,i))}}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||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Ft(this.options.beforeUpdate,[this])}update(t,n,i){const{beginAtZero:s,grace:r,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=fz(this,r,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a=r||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const u=this._getLabelSizes(),d=u.widest.width,h=u.highest.height,f=ke(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/i:f/(i-1),d+6>a&&(a=f/(i-(t.offset?.5:1)),l=this.maxHeight-Ea(t.grid)-n.padding-l_(t.title,this.chart.options.font),c=Math.sqrt(d*d+h*h),o=t0(Math.min(Math.asin(ke((u.highest.height+6)/a,-1,1)),Math.asin(ke(l/c,-1,1))-Math.asin(ke(h/c,-1,1)))),o=Math.max(s,Math.min(r,o))),this.labelRotation=o}afterCalculateLabelRotation(){Ft(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Ft(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:i,title:s,grid:r}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const l=l_(s,n.options.font);if(a?(t.width=this.maxWidth,t.height=Ea(r)+l):(t.height=this.maxHeight,t.width=Ea(r)+l),i.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:h}=this._getLabelSizes(),f=i.padding*2,p=ti(this.labelRotation),m=Math.cos(p),v=Math.sin(p);if(a){const y=i.mirror?0:v*d.width+m*h.height;t.height=Math.min(this.maxHeight,t.height+y+f)}else{const y=i.mirror?0:m*d.width+v*h.height;t.width=Math.min(this.maxWidth,t.width+y+f)}this._calculatePadding(c,u,v,m)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,i,s){const{ticks:{align:r,padding:o},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,f=0;l?c?(h=s*t.width,f=i*n.height):(h=i*t.height,f=s*n.width):r==="start"?f=n.width:r==="end"?h=t.width:r!=="inner"&&(h=t.width/2,f=n.width/2),this.paddingLeft=Math.max((h-u+o)*this.width/(this.width-u),0),this.paddingRight=Math.max((f-d+o)*this.width/(this.width-d),0)}else{let u=n.height/2,d=t.height/2;r==="start"?(u=0,d=t.height):r==="end"&&(u=n.height,d=0),this.paddingTop=u+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(){Ft(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,i;for(n=0,i=t.length;n({width:r[C]||0,height:o[C]||0});return{first:S(0),last:S(n-1),widest:S(_),highest:S(w),widths:r,heights:o}}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 TV(this._alignToPixels?cr(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&&ta*s?a/i:l/s:l*s0}_computeGridLineItems(t){const n=this.axis,i=this.chart,s=this.options,{grid:r,position:o}=s,a=r.offset,l=this.isHorizontal(),u=this.ticks.length+(a?1:0),d=Ea(r),h=[],f=r.setContext(this.getContext()),p=f.drawBorder?f.borderWidth:0,m=p/2,v=function(L){return cr(i,L,p)};let y,g,x,_,w,S,C,M,P,T,A,E;if(o==="top")y=v(this.bottom),S=this.bottom-d,M=y-m,T=v(t.top)+m,E=t.bottom;else if(o==="bottom")y=v(this.top),T=t.top,E=v(t.bottom)-m,S=y+m,M=this.top+d;else if(o==="left")y=v(this.right),w=this.right-d,C=y-m,P=v(t.left)+m,A=t.right;else if(o==="right")y=v(this.left),P=t.left,A=v(t.right)-m,w=y+m,C=this.left+d;else if(n==="x"){if(o==="center")y=v((t.top+t.bottom)/2+.5);else if(yt(o)){const L=Object.keys(o)[0],R=o[L];y=v(this.chart.scales[L].getPixelForValue(R))}T=t.top,E=t.bottom,S=y+m,M=S+d}else if(n==="y"){if(o==="center")y=v((t.left+t.right)/2);else if(yt(o)){const L=Object.keys(o)[0],R=o[L];y=v(this.chart.scales[L].getPixelForValue(R))}w=y-m,C=w-d,P=t.left,A=t.right}const z=ut(s.ticks.maxTicksLimit,u),N=Math.max(1,Math.ceil(u/z));for(g=0;gr.value===t);return s>=0?n.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const n=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let r,o;const a=(l,c,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(n.display)for(r=0,o=s.length;r{this.draw(s)}}]:[{z:i,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:i+1,draw:()=>{this.drawBorder()}},{z:n,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let r,o;for(r=0,o=n.length;r{const i=n.split("."),s=i.pop(),r=[e].concat(i).join("."),o=t[n].split("."),a=o.pop(),l=o.join(".");_t.route(r,s,l,a)})}function I5(e){return"id"in e&&"defaults"in e}class F5{constructor(){this.controllers=new ku(ri,"datasets",!0),this.elements=new ku(oi,"elements"),this.plugins=new ku(Object,"plugins"),this.scales=new ku(Xr,"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,i){[...n].forEach(s=>{const r=i||this._getRegistryForType(s);i||r.isForType(s)||r===this.plugins&&s.id?this._exec(t,r,s):At(s,o=>{const a=i||this._getRegistryForType(o);this._exec(t,a,o)})})}_exec(t,n,i){const s=Jy(t);Ft(i["before"+s],[],i),n[t](i),Ft(i["after"+s],[],i)}_getRegistryForType(t){for(let n=0;n0&&this.getParsed(n-1);for(let _=n;_0&&Math.abs(S[f]-x[f])>y,v&&(C.parsed=S,C.raw=c.data[_]),h&&(C.options=d||this.resolveDataElementOptions(_,w.active?"active":s)),g||this.updateElement(w,_,C,s),x=S}this.updateSharedOptions(d,s,u)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let a=0;for(let l=n.length-1;l>=0;--l)a=Math.max(a,n[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!n.length)return s;const r=n[0].size(this.resolveDataElementOptions(0)),o=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(s,r,o)/2}}qh.id="scatter";qh.defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};qh.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title(){return""},label(e){return"("+e.label+", "+e.formattedValue+")"}}}},scales:{x:{type:"linear"},y:{type:"linear"}}};var B5=Object.freeze({__proto__:null,BarController:Hh,BubbleController:Uh,DoughnutController:oa,LineController:Yh,PolarAreaController:Xh,PieController:d0,RadarController:Kh,ScatterController:qh});function ur(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Xm{constructor(t){this.options=t||{}}init(t){}formats(){return ur()}parse(t,n){return ur()}format(t,n){return ur()}add(t,n,i){return ur()}diff(t,n,i){return ur()}startOf(t,n,i){return ur()}endOf(t,n){return ur()}}Xm.override=function(e){Object.assign(Xm.prototype,e)};var V5={_date:Xm};function z5(e,t,n,i){const{controller:s,data:r,_sorted:o}=e,a=s._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&o&&r.length){const l=a._reversePixels?DV:Xi;if(i){if(s._sharedOptions){const c=r[0],u=typeof c.getRange=="function"&&c.getRange(t);if(u){const d=l(r,t,n-u),h=l(r,t,n+u);return{lo:d.lo,hi:h.hi}}}}else return l(r,t,n)}return{lo:0,hi:r.length-1}}function kc(e,t,n,i,s){const r=e.getSortedVisibleDatasetMetas(),o=n[t];for(let a=0,l=r.length;a{l[o](t[n],s)&&(r.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,s))}),i&&!a?[]:r}var Y5={evaluateInteractionItems:kc,modes:{index(e,t,n,i){const s=vr(t,e),r=n.axis||"x",o=n.includeInvisible||!1,a=n.intersect?hp(e,s,r,i,o):fp(e,s,r,!1,i,o),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(e,t,n,i){const s=vr(t,e),r=n.axis||"xy",o=n.includeInvisible||!1;let a=n.intersect?hp(e,s,r,i,o):fp(e,s,r,!1,i,o);if(a.length>0){const l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let u=0;un.pos===t)}function u_(e,t){return e.filter(n=>XP.indexOf(n.pos)===-1&&n.box.axis===t)}function Oa(e,t){return e.sort((n,i)=>{const s=t?i:n,r=t?n:i;return s.weight===r.weight?s.index-r.index:s.weight-r.weight})}function X5(e){const t=[];let n,i,s,r,o,a;for(n=0,i=(e||[]).length;nc.box.fullSize),!0),i=Oa(Aa(t,"left"),!0),s=Oa(Aa(t,"right")),r=Oa(Aa(t,"top"),!0),o=Oa(Aa(t,"bottom")),a=u_(t,"x"),l=u_(t,"y");return{fullSize:n,leftAndTop:i.concat(r),rightAndBottom:s.concat(l).concat(o).concat(a),chartArea:Aa(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:r.concat(o).concat(a)}}function d_(e,t,n,i){return Math.max(e[n],t[n])+Math.max(e[i],t[i])}function KP(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 Q5(e,t,n,i){const{pos:s,box:r}=n,o=e.maxPadding;if(!yt(s)){n.size&&(e[s]-=n.size);const d=i[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?r.height:r.width),n.size=d.size/d.count,e[s]+=n.size}r.getPadding&&KP(o,r.getPadding());const a=Math.max(0,t.outerWidth-d_(o,e,"left","right")),l=Math.max(0,t.outerHeight-d_(o,e,"top","bottom")),c=a!==e.w,u=l!==e.h;return e.w=a,e.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function Z5(e){const t=e.maxPadding;function n(i){const s=Math.max(t[i]-e[i],0);return e[i]+=s,s}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function J5(e,t){const n=t.maxPadding;function i(s){const r={left:0,top:0,right:0,bottom:0};return s.forEach(o=>{r[o]=Math.max(t[o],n[o])}),r}return i(e?["left","right"]:["top","bottom"])}function tl(e,t,n,i){const s=[];let r,o,a,l,c,u;for(r=0,o=e.length,c=0;r{typeof m.beforeLayout=="function"&&m.beforeLayout()});const u=l.reduce((m,v)=>v.box.options&&v.box.options.display===!1?m:m+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:s,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/u,hBoxMaxHeight:o/2}),h=Object.assign({},s);KP(h,ze(i));const f=Object.assign({maxPadding:h,w:r,h:o,x:s.left,y:s.top},s),p=G5(l.concat(c),d);tl(a.fullSize,f,d,p),tl(l,f,d,p),tl(c,f,d,p)&&tl(l,f,d,p),Z5(f),h_(a.leftAndTop,f,d,p),f.x+=f.w,f.y+=f.h,h_(a.rightAndBottom,f,d,p),e.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},At(a.chartArea,m=>{const v=m.box;Object.assign(v,e.chartArea),v.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class GP{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,i){}removeEventListener(t,n,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,i,s){return n=Math.max(0,n||t.width),i=i||t.height,{width:n,height:Math.max(0,s?Math.floor(n/s):i)}}isAttached(t){return!0}updateConfig(t){}}class tW extends GP{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const sd="$chartjs",eW={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},f_=e=>e===null||e==="";function nW(e,t){const n=e.style,i=e.getAttribute("height"),s=e.getAttribute("width");if(e[sd]={initial:{height:i,width:s,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",f_(s)){const r=U1(e,"width");r!==void 0&&(e.width=r)}if(f_(i))if(e.style.height==="")e.height=e.width/(t||2);else{const r=U1(e,"height");r!==void 0&&(e.height=r)}return e}const qP=jz?{passive:!0}:!1;function iW(e,t,n){e.addEventListener(t,n,qP)}function sW(e,t,n){e.canvas.removeEventListener(t,n,qP)}function rW(e,t){const n=eW[e.type]||e.type,{x:i,y:s}=vr(e,t);return{type:n,chart:t,native:e,x:i!==void 0?i:null,y:s!==void 0?s:null}}function nh(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function oW(e,t,n){const i=e.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||nh(a.addedNodes,i),o=o&&!nh(a.removedNodes,i);o&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}function aW(e,t,n){const i=e.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||nh(a.removedNodes,i),o=o&&!nh(a.addedNodes,i);o&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}const nc=new Map;let p_=0;function QP(){const e=window.devicePixelRatio;e!==p_&&(p_=e,nc.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function lW(e,t){nc.size||window.addEventListener("resize",QP),nc.set(e,t)}function cW(e){nc.delete(e),nc.size||window.removeEventListener("resize",QP)}function uW(e,t,n){const i=e.canvas,s=i&&u0(i);if(!s)return;const r=_P((a,l)=>{const c=s.clientWidth;n(a,l),c{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||r(c,u)});return o.observe(s),lW(e,r),o}function pp(e,t,n){n&&n.disconnect(),t==="resize"&&cW(e)}function dW(e,t,n){const i=e.canvas,s=_P(r=>{e.ctx!==null&&n(rW(r,e))},e,r=>{const o=r[0];return[o,o.offsetX,o.offsetY]});return iW(i,t,s),s}class hW extends GP{acquireContext(t,n){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(nW(t,n),i):null}releaseContext(t){const n=t.canvas;if(!n[sd])return!1;const i=n[sd].initial;["height","width"].forEach(r=>{const o=i[r];Mt(o)?n.removeAttribute(r):n.setAttribute(r,o)});const s=i.style||{};return Object.keys(s).forEach(r=>{n.style[r]=s[r]}),n.width=n.width,delete n[sd],!0}addEventListener(t,n,i){this.removeEventListener(t,n);const s=t.$proxies||(t.$proxies={}),o={attach:oW,detach:aW,resize:uW}[n]||dW;s[n]=o(t,n,i)}removeEventListener(t,n){const i=t.$proxies||(t.$proxies={}),s=i[n];if(!s)return;({attach:pp,detach:pp,resize:pp}[n]||sW)(t,n,s),i[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,i,s){return Nz(t,n,i,s)}isAttached(t){const n=u0(t);return!!(n&&n.isConnected)}}function fW(e){return!$P()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?tW:hW}class pW{constructor(){this._init=[]}notify(t,n,i,s){n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const r=s?this._descriptors(t).filter(s):this._descriptors(t),o=this._notify(r,t,n,i);return n==="afterDestroy"&&(this._notify(r,t,"stop"),this._notify(this._init,t,"uninstall")),o}_notify(t,n,i,s){s=s||{};for(const r of t){const o=r.plugin,a=o[i],l=[n,s,r.options];if(Ft(a,l,o)===!1&&s.cancelable)return!1}return!0}invalidate(){Mt(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 i=t&&t.config,s=ut(i.options&&i.options.plugins,{}),r=mW(i);return s===!1&&!n?[]:yW(t,r,s,n)}_notifyStateChanges(t){const n=this._oldCache||[],i=this._cache,s=(r,o)=>r.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(s(n,i),t,"stop"),this._notify(s(i,n),t,"start")}}function mW(e){const t={},n=[],i=Object.keys(pi.plugins.items);for(let r=0;r{const l=i[a];if(!yt(l))return console.error(`Invalid scale configuration for scale: ${a}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const c=Gm(a,l),u=bW(c,s),d=n.scales||{};r[c]=r[c]||a,o[a]=bl(Object.create(null),[{axis:c},l,d[c],d[u]])}),e.data.datasets.forEach(a=>{const l=a.type||e.type,c=a.indexAxis||Km(l,t),d=(Vr[l]||{}).scales||{};Object.keys(d).forEach(h=>{const f=xW(h,c),p=a[f+"AxisID"]||r[f]||f;o[p]=o[p]||Object.create(null),bl(o[p],[{axis:f},i[p],d[h]])})}),Object.keys(o).forEach(a=>{const l=o[a];bl(l,[_t.scales[l.type],_t.scale])}),o}function ZP(e){const t=e.options||(e.options={});t.plugins=ut(t.plugins,{}),t.scales=wW(e,t)}function JP(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function kW(e){return e=e||{},e.data=JP(e.data),ZP(e),e}const m_=new Map,tT=new Set;function Mu(e,t){let n=m_.get(e);return n||(n=t(),m_.set(e,n),tT.add(n)),n}const La=(e,t,n)=>{const i=Ys(t,n);i!==void 0&&e.add(i)};class SW{constructor(t){this._config=kW(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=JP(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(),ZP(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Mu(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return Mu(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return Mu(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,i=this.type;return Mu(`${i}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const i=this._scopeCache;let s=i.get(t);return(!s||n)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,n,i){const{options:s,type:r}=this,o=this._cachedScopes(t,i),a=o.get(n);if(a)return a;const l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(d=>La(l,t,d))),u.forEach(d=>La(l,s,d)),u.forEach(d=>La(l,Vr[r]||{},d)),u.forEach(d=>La(l,_t,d)),u.forEach(d=>La(l,Um,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),tT.has(n)&&o.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,Vr[n]||{},_t.datasets[n]||{},{type:n},_t,Um]}resolveNamedOptions(t,n,i,s=[""]){const r={$shared:!0},{resolver:o,subPrefixes:a}=g_(this._resolverCache,t,s);let l=o;if(CW(o,n)){r.$shared=!1,i=Xs(i)?i():i;const c=this.createResolver(t,i,a);l=ea(o,i,c)}for(const c of n)r[c]=l[c];return r}createResolver(t,n,i=[""],s){const{resolver:r}=g_(this._resolverCache,t,i);return yt(n)?ea(r,n,void 0,s):r}}function g_(e,t,n){let i=e.get(t);i||(i=new Map,e.set(t,i));const s=n.join();let r=i.get(s);return r||(r={resolver:a0(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},i.set(s,r)),r}const MW=e=>yt(e)&&Object.getOwnPropertyNames(e).reduce((t,n)=>t||Xs(e[n]),!1);function CW(e,t){const{isScriptable:n,isIndexable:i}=AP(e);for(const s of t){const r=n(s),o=i(s),a=(o||r)&&e[s];if(r&&(Xs(a)||MW(a))||o&&Vt(a))return!0}return!1}var PW="3.9.1";const TW=["top","bottom","left","right","chartArea"];function y_(e,t){return e==="top"||e==="bottom"||TW.indexOf(e)===-1&&t==="x"}function v_(e,t){return function(n,i){return n[e]===i[e]?n[t]-i[t]:n[e]-i[e]}}function x_(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),Ft(n&&n.onComplete,[e],t)}function DW(e){const t=e.chart,n=t.options.animation;Ft(n&&n.onProgress,[e],t)}function eT(e){return $P()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const ih={},nT=e=>{const t=eT(e);return Object.values(ih).filter(n=>n.canvas===t).pop()};function EW(e,t,n){const i=Object.keys(e);for(const s of i){const r=+s;if(r>=t){const o=e[s];delete e[s],(n>0||r>t)&&(e[r+n]=o)}}}function AW(e,t,n,i){return!n||e.type==="mouseout"?null:i?t:e}class h0{constructor(t,n){const i=this.config=new SW(n),s=eT(t),r=nT(s);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||fW(s)),this.platform.updateConfig(i);const a=this.platform.acquireContext(s,o.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=gV(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,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 pW,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=OV(d=>this.update(d),o.resizeDelay||0),this._dataChanges=[],ih[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Li.listen(this,"complete",x_),Li.listen(this,"progress",DW),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:i,height:s,_aspectRatio:r}=this;return Mt(t)?n&&r?r:s?i/s: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}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():H1(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return V1(this.canvas,this.ctx),this}stop(){return Li.stop(this),this}resize(t,n){Li.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const i=this.options,s=this.canvas,r=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,t,n,r),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,H1(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),Ft(i.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};At(n,(i,s)=>{i.id=s})}buildOrUpdateScales(){const t=this.options,n=t.scales,i=this.scales,s=Object.keys(i).reduce((o,a)=>(o[a]=!1,o),{});let r=[];n&&(r=r.concat(Object.keys(n).map(o=>{const a=n[o],l=Gm(o,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),At(r,o=>{const a=o.options,l=a.id,c=Gm(l,a),u=ut(a.type,o.dtype);(a.position===void 0||y_(a.position,c)!==y_(o.dposition))&&(a.position=o.dposition),s[l]=!0;let d=null;if(l in i&&i[l].type===u)d=i[l];else{const h=pi.getScale(u);d=new h({id:l,type:u,ctx:this.ctx,chart:this}),i[d.id]=d}d.init(a,t)}),At(s,(o,a)=>{o||delete i[a]}),At(i,o=>{Be.configure(this,o,o.options),Be.addBox(this,o)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,i=t.length;if(t.sort((s,r)=>s.index-r.index),i>n){for(let s=n;sn.length&&delete this._stacks,t.forEach((i,s)=>{n.filter(r=>r===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=n.length;i{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const i=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let c=0,u=this.data.datasets.length;c{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(v_("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){At(this.scales,t=>{Be.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!D1(n,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:r}of n){const o=i==="_removeElements"?-r:r;EW(t,s,o)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,i=r=>new Set(t.filter(o=>o[0]===r).map((o,a)=>a+","+o.splice(1).join(","))),s=i(0);for(let r=1;rr.split(",")).map(r=>({method:r[1],start:+r[2],count:+r[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Be.update(this,this.width,this.height,t);const n=this.chartArea,i=n.width<=0||n.height<=0;this._layers=[],At(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,r)=>{s._idx=r}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,i=this.data.datasets.length;n=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,i=t._clip,s=!i.disabled,r=this.chartArea,o={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(s&&Vh(n,{left:i.left===!1?0:r.left-i.left,right:i.right===!1?this.width:r.right+i.right,top:i.top===!1?0:r.top-i.top,bottom:i.bottom===!1?this.height:r.bottom+i.bottom}),t.controller.draw(),s&&zh(n),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return tc(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,i,s){const r=Y5.modes[n];return typeof r=="function"?r(this,t,i,s):[]}getDatasetMeta(t){const n=this.data.datasets[t],i=this._metasets;let s=i.filter(r=>r&&r._dataset===n).pop();return s||(s={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},i.push(s)),s}getContext(){return this.$context||(this.$context=er(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!n.hidden}setDatasetVisibility(t,n){const i=this.getDatasetMeta(t);i.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,i){const s=i?"show":"hide",r=this.getDatasetMeta(t),o=r.controller._resolveAnimations(void 0,s);Hn(n)?(r.data[n].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(r,{visible:i}),this.update(a=>a.datasetIndex===t?s: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(),Li.remove(this),t=0,n=this.data.datasets.length;t{n.addEventListener(this,r,o),t[r]=o},s=(r,o,a)=>{r.offsetX=o,r.offsetY=a,this._eventHandler(r)};At(this.options.events,r=>i(r,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,i=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},r=(l,c)=>{this.canvas&&this.resize(l,c)};let o;const a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",r),i("detach",o)};o=()=>{this.attached=!1,s("resize",r),this._stop(),this._resize(0,0),i("attach",a)},n.isAttached(this.canvas)?a():o()}unbindEvents(){At(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},At(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,i){const s=i?"set":"remove";let r,o,a,l;for(n==="dataset"&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=t.length;a{const a=this.getDatasetMeta(r);if(!a)throw new Error("No dataset found at index "+r);return{datasetIndex:r,element:a.data[o],index:o}});!qd(i,n)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,n))}notifyPlugins(t,n,i){return this._plugins.notify(this,t,n,i)}_updateHoverStyles(t,n,i){const s=this.options.hover,r=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),o=r(n,t),a=i?t:r(t,n);o.length&&this.updateHoverStyle(o,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,n){const i={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},s=o=>(o.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const r=this._handleEvent(t,n,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(r||i.changed)&&this.render(),this}_handleEvent(t,n,i){const{_active:s=[],options:r}=this,o=n,a=this._getActiveElements(t,s,i,o),l=wV(t),c=AW(t,this._lastEvent,i,l);i&&(this._lastEvent=null,Ft(r.onHover,[t,a,this],this),l&&Ft(r.onClick,[t,a,this],this));const u=!qd(a,s);return(u||n)&&(this._active=a,this._updateHoverStyles(a,s,n)),this._lastEvent=c,u}_getActiveElements(t,n,i,s){if(t.type==="mouseout")return[];if(!i)return n;const r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,s)}}const b_=()=>At(h0.instances,e=>e._plugins.invalidate()),hs=!0;Object.defineProperties(h0,{defaults:{enumerable:hs,value:_t},instances:{enumerable:hs,value:ih},overrides:{enumerable:hs,value:Vr},registry:{enumerable:hs,value:pi},version:{enumerable:hs,value:PW},getChart:{enumerable:hs,value:nT},register:{enumerable:hs,value:(...e)=>{pi.add(...e),b_()}},unregister:{enumerable:hs,value:(...e)=>{pi.remove(...e),b_()}}});function iT(e,t,n){const{startAngle:i,pixelMargin:s,x:r,y:o,outerRadius:a,innerRadius:l}=t;let c=s/a;e.beginPath(),e.arc(r,o,a,i-c,n+c),l>s?(c=s/l,e.arc(r,o,l,n+c,i-c,!0)):e.arc(r,o,s,n+ae,i-ae),e.closePath(),e.clip()}function OW(e){return o0(e,["outerStart","outerEnd","innerStart","innerEnd"])}function LW(e,t,n,i){const s=OW(e.options.borderRadius),r=(n-t)/2,o=Math.min(r,i*t/2),a=l=>{const c=(n-Math.min(r,l))*i/2;return ke(l,0,Math.min(r,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:ke(s.innerStart,0,o),innerEnd:ke(s.innerEnd,0,o)}}function to(e,t,n,i){return{x:n+e*Math.cos(t),y:i+e*Math.sin(t)}}function qm(e,t,n,i,s,r){const{x:o,y:a,startAngle:l,pixelMargin:c,innerRadius:u}=t,d=Math.max(t.outerRadius+i+n-c,0),h=u>0?u+i+n+c:0;let f=0;const p=s-l;if(i){const L=u>0?u-i:0,R=d>0?d-i:0,B=(L+R)/2,D=B!==0?p*B/(B+i):p;f=(p-D)/2}const m=Math.max(.001,p*d-n/qt)/d,v=(p-m)/2,y=l+v+f,g=s-v-f,{outerStart:x,outerEnd:_,innerStart:w,innerEnd:S}=LW(t,h,d,g-y),C=d-x,M=d-_,P=y+x/C,T=g-_/M,A=h+w,E=h+S,z=y+w/A,N=g-S/E;if(e.beginPath(),r){if(e.arc(o,a,d,P,T),_>0){const B=to(M,T,o,a);e.arc(B.x,B.y,_,T,g+ae)}const L=to(E,g,o,a);if(e.lineTo(L.x,L.y),S>0){const B=to(E,N,o,a);e.arc(B.x,B.y,S,g+ae,N+Math.PI)}if(e.arc(o,a,h,g-S/h,y+w/h,!0),w>0){const B=to(A,z,o,a);e.arc(B.x,B.y,w,z+Math.PI,y-ae)}const R=to(C,y,o,a);if(e.lineTo(R.x,R.y),x>0){const B=to(C,P,o,a);e.arc(B.x,B.y,x,y-ae,P)}}else{e.moveTo(o,a);const L=Math.cos(P)*d+o,R=Math.sin(P)*d+a;e.lineTo(L,R);const B=Math.cos(T)*d+o,D=Math.sin(T)*d+a;e.lineTo(B,D)}e.closePath()}function RW(e,t,n,i,s){const{fullCircles:r,startAngle:o,circumference:a}=t;let l=t.endAngle;if(r){qm(e,t,n,i,o+Nt,s);for(let c=0;c=Nt||Jl(r,a,l),m=Yi(o,c+h,u+h);return p&&m}getCenterPoint(t){const{x:n,y:i,startAngle:s,endAngle:r,innerRadius:o,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:l,spacing:c}=this.options,u=(s+r)/2,d=(o+a+c+l)/2;return{x:n+Math.cos(u)*d,y:i+Math.sin(u)*d}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:n,circumference:i}=this,s=(n.offset||0)/2,r=(n.spacing||0)/2,o=n.circular;if(this.pixelMargin=n.borderAlign==="inner"?.33:0,this.fullCircles=i>Nt?Math.floor(i/Nt):0,i===0||this.innerRadius<0||this.outerRadius<0)return;t.save();let a=0;if(s){a=s/2;const c=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(c)*a,Math.sin(c)*a),this.circumference>=qt&&(a=s)}t.fillStyle=n.backgroundColor,t.strokeStyle=n.borderColor;const l=RW(t,this,a,r,o);jW(t,this,a,r,l,o),t.restore()}}Qh.id="arc";Qh.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};Qh.defaultRoutes={backgroundColor:"backgroundColor"};function sT(e,t,n=t){e.lineCap=ut(n.borderCapStyle,t.borderCapStyle),e.setLineDash(ut(n.borderDash,t.borderDash)),e.lineDashOffset=ut(n.borderDashOffset,t.borderDashOffset),e.lineJoin=ut(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=ut(n.borderWidth,t.borderWidth),e.strokeStyle=ut(n.borderColor,t.borderColor)}function $W(e,t,n){e.lineTo(n.x,n.y)}function IW(e){return e.stepped?rz:e.tension||e.cubicInterpolationMode==="monotone"?oz:$W}function rT(e,t,n={}){const i=e.length,{start:s=0,end:r=i-1}=n,{start:o,end:a}=t,l=Math.max(s,o),c=Math.min(r,a),u=sa&&r>a;return{count:i,start:l,loop:t.loop,ilen:c(o+(c?a-_:_))%r,x=()=>{m!==v&&(e.lineTo(u,v),e.lineTo(u,m),e.lineTo(u,y))};for(l&&(f=s[g(0)],e.moveTo(f.x,f.y)),h=0;h<=a;++h){if(f=s[g(h)],f.skip)continue;const _=f.x,w=f.y,S=_|0;S===p?(wv&&(v=w),u=(d*u+_)/++d):(x(),e.lineTo(_,w),p=S,d=0,m=v=w),y=w}x()}function Qm(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?BW:FW}function VW(e){return e.stepped?$z:e.tension||e.cubicInterpolationMode==="monotone"?Iz:xr}function zW(e,t,n,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,n,i)&&s.closePath()),sT(e,t.options),e.stroke(s)}function WW(e,t,n,i){const{segments:s,options:r}=t,o=Qm(t);for(const a of s)sT(e,r,a.style),e.beginPath(),o(e,t,a,{start:n,end:n+i-1})&&e.closePath(),e.stroke()}const HW=typeof Path2D=="function";function UW(e,t,n,i){HW&&!t.options.segment?zW(e,t,n,i):WW(e,t,n,i)}class nr extends oi{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 i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;Dz(this._points,i,t,s,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=Uz(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,i=t.length;return i&&n[t[i-1].end]}interpolate(t,n){const i=this.options,s=t[n],r=this.points,o=zP(this,{property:n,start:s,end:s});if(!o.length)return;const a=[],l=VW(i);let c,u;for(c=0,u=o.length;ce!=="borderDash"&&e!=="fill"};function __(e,t,n,i){const s=e.options,{[n]:r}=e.getProps([n],i);return Math.abs(t-r)=n)return e.slice(t,t+n);const o=[],a=(n-2)/(r-2);let l=0;const c=t+n-1;let u=t,d,h,f,p,m;for(o[l++]=e[u],d=0;df&&(f=p,h=e[g],m=g);o[l++]=h,u=m}return o[l++]=e[c],o}function JW(e,t,n,i){let s=0,r=0,o,a,l,c,u,d,h,f,p,m;const v=[],y=t+n-1,g=e[t].x,_=e[y].x-g;for(o=t;om&&(m=c,h=o),s=(r*s+a.x)/++r;else{const S=o-1;if(!Mt(d)&&!Mt(h)){const C=Math.min(d,h),M=Math.max(d,h);C!==f&&C!==S&&v.push({...e[C],x:s}),M!==f&&M!==S&&v.push({...e[M],x:s})}o>0&&S!==f&&v.push(e[S]),v.push(a),u=w,r=0,p=m=c,d=h=f=o}}return v}function aT(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{value:t})}}function w_(e){e.data.datasets.forEach(t=>{aT(t)})}function tH(e,t){const n=t.length;let i=0,s;const{iScale:r}=e,{min:o,max:a,minDefined:l,maxDefined:c}=r.getUserBounds();return l&&(i=ke(Xi(t,r.axis,o).lo,0,n-1)),c?s=ke(Xi(t,r.axis,a).hi+1,i,n)-i:s=n-i,{start:i,count:s}}var eH={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){w_(e);return}const i=e.width;e.data.datasets.forEach((s,r)=>{const{_data:o,indexAxis:a}=s,l=e.getDatasetMeta(r),c=o||s.data;if(Ja([a,e.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const u=e.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||e.options.parsing)return;let{start:d,count:h}=tH(l,c);const f=n.threshold||4*i;if(h<=f){aT(s);return}Mt(o)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(m){this._data=m}}));let p;switch(n.algorithm){case"lttb":p=ZW(c,d,h,i,n);break;case"min-max":p=JW(c,d,h,i);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}s._decimated=p})},destroy(e){w_(e)}};function nH(e,t,n){const i=e.segments,s=e.points,r=t.points,o=[];for(const a of i){let{start:l,end:c}=a;c=f0(l,c,s);const u=Zm(n,s[l],s[c],a.loop);if(!t.segments){o.push({source:a,target:u,start:s[l],end:s[c]});continue}const d=zP(t,u);for(const h of d){const f=Zm(n,r[h.start],r[h.end],h.loop),p=VP(a,s,f);for(const m of p)o.push({source:m,target:h,start:{[n]:k_(u,f,"start",Math.max)},end:{[n]:k_(u,f,"end",Math.min)}})}}return o}function Zm(e,t,n,i){if(i)return;let s=t[e],r=n[e];return e==="angle"&&(s=vn(s),r=vn(r)),{property:e,start:s,end:r}}function iH(e,t){const{x:n=null,y:i=null}=e||{},s=t.points,r=[];return t.segments.forEach(({start:o,end:a})=>{a=f0(o,a,s);const l=s[o],c=s[a];i!==null?(r.push({x:l.x,y:i}),r.push({x:c.x,y:i})):n!==null&&(r.push({x:n,y:l.y}),r.push({x:n,y:c.y}))}),r}function f0(e,t,n){for(;t>e;t--){const i=n[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function k_(e,t,n,i){return e&&t?i(e[n],t[n]):e?e[n]:t?t[n]:0}function lT(e,t){let n=[],i=!1;return Vt(e)?(i=!0,n=e):n=iH(e,t),n.length?new nr({points:n,options:{tension:0},_loop:i,_fullLoop:i}):null}function S_(e){return e&&e.fill!==!1}function sH(e,t,n){let s=e[t].fill;const r=[t];let o;if(!n)return s;for(;s!==!1&&r.indexOf(s)===-1;){if(!de(s))return s;if(o=e[s],!o)return!1;if(o.visible)return s;r.push(s),s=o.fill}return!1}function rH(e,t,n){const i=cH(e);if(yt(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return de(s)&&Math.floor(s)===s?oH(i[0],t,s,n):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function oH(e,t,n,i){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=i?!1:n}function aH(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:yt(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function lH(e,t,n){let i;return e==="start"?i=n:e==="end"?i=t.options.reverse?t.min:t.max:yt(e)?i=e.value:i=t.getBaseValue(),i}function cH(e){const t=e.options,n=t.fill;let i=ut(n&&n.target,n);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function uH(e){const{scale:t,index:n,line:i}=e,s=[],r=i.segments,o=i.points,a=dH(t,n);a.push(lT({x:null,y:t.bottom},i));for(let l=0;l=0;--o){const a=s[o].$filler;a&&(a.line.updateControlPoints(r,a.axis),i&&a.fill&&yp(e.ctx,a,r))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const i=e.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const r=i[s].$filler;S_(r)&&yp(e.ctx,r,e.chartArea)}},beforeDatasetDraw(e,t,n){const i=t.meta.$filler;!S_(i)||n.drawTime!=="beforeDatasetDraw"||yp(e.ctx,i,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const T_=(e,t)=>{let{boxHeight:n=t,boxWidth:i=t}=e;return e.usePointStyle&&(n=Math.min(n,t),i=e.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:n,itemHeight:Math.max(t,n)}},wH=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class D_ extends oi{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,i){this.maxWidth=t,this.maxHeight=n,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let n=Ft(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(i=>t.filter(i,this.chart.data))),t.sort&&(n=n.sort((i,s)=>t.sort(i,s,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 i=t.labels,s=be(i.font),r=s.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=T_(i,r);let c,u;n.font=s.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(o,r,a,l)+10):(u=this.maxHeight,c=this._fitCols(o,r,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,n,i,s){const{ctx:r,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=s+a;let d=t;r.textAlign="left",r.textBaseline="middle";let h=-1,f=-u;return this.legendItems.forEach((p,m)=>{const v=i+n/2+r.measureText(p.text).width;(m===0||c[c.length-1]+v+2*a>o)&&(d+=u,c[c.length-(m>0?0:1)]=0,f+=u,h++),l[m]={left:0,top:f,row:h,width:v,height:s},c[c.length-1]+=v+a}),d}_fitCols(t,n,i,s){const{ctx:r,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=o-t;let d=a,h=0,f=0,p=0,m=0;return this.legendItems.forEach((v,y)=>{const g=i+n/2+r.measureText(v.text).width;y>0&&f+s+2*a>u&&(d+=h+a,c.push({width:h,height:f}),p+=h+a,m++,h=f=0),l[y]={left:p,top:f,col:m,width:g,height:s},h=Math.max(h,g),f+=s+a}),d+=h,c.push({width:h,height:f}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:i,labels:{padding:s},rtl:r}}=this,o=Lo(r,this.left,this.width);if(this.isHorizontal()){let a=0,l=$e(i,this.left+s,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=$e(i,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+t+s,c.left=o.leftForLtr(o.x(l),c.width),l+=c.width+s}else{let a=0,l=$e(i,this.top+t+s,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=$e(i,this.top+t+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=o.leftForLtr(o.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Vh(t,this),this._draw(),zh(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:i,ctx:s}=this,{align:r,labels:o}=t,a=_t.color,l=Lo(t.rtl,this.left,this.width),c=be(o.font),{color:u,padding:d}=o,h=c.size,f=h/2;let p;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:m,boxHeight:v,itemHeight:y}=T_(o,h),g=function(C,M,P){if(isNaN(m)||m<=0||isNaN(v)||v<0)return;s.save();const T=ut(P.lineWidth,1);if(s.fillStyle=ut(P.fillStyle,a),s.lineCap=ut(P.lineCap,"butt"),s.lineDashOffset=ut(P.lineDashOffset,0),s.lineJoin=ut(P.lineJoin,"miter"),s.lineWidth=T,s.strokeStyle=ut(P.strokeStyle,a),s.setLineDash(ut(P.lineDash,[])),o.usePointStyle){const A={radius:v*Math.SQRT2/2,pointStyle:P.pointStyle,rotation:P.rotation,borderWidth:T},E=l.xPlus(C,m/2),z=M+f;DP(s,A,E,z,o.pointStyleWidth&&m)}else{const A=M+Math.max((h-v)/2,0),E=l.leftForLtr(C,m),z=Er(P.borderRadius);s.beginPath(),Object.values(z).some(N=>N!==0)?ec(s,{x:E,y:A,w:m,h:v,radius:z}):s.rect(E,A,m,v),s.fill(),T!==0&&s.stroke()}s.restore()},x=function(C,M,P){zr(s,P.text,C,M+y/2,c,{strikethrough:P.hidden,textAlign:l.textAlign(P.textAlign)})},_=this.isHorizontal(),w=this._computeTitleHeight();_?p={x:$e(r,this.left+d,this.right-i[0]),y:this.top+d+w,line:0}:p={x:this.left+d,y:$e(r,this.top+w+d,this.bottom-n[0].height),line:0},IP(this.ctx,t.textDirection);const S=y+d;this.legendItems.forEach((C,M)=>{s.strokeStyle=C.fontColor||u,s.fillStyle=C.fontColor||u;const P=s.measureText(C.text).width,T=l.textAlign(C.textAlign||(C.textAlign=o.textAlign)),A=m+f+P;let E=p.x,z=p.y;l.setWidth(this.width),_?M>0&&E+A+d>this.right&&(z=p.y+=S,p.line++,E=p.x=$e(r,this.left+d,this.right-i[p.line])):M>0&&z+S>this.bottom&&(E=p.x=E+n[p.line].width+d,p.line++,z=p.y=$e(r,this.top+w+d,this.bottom-n[p.line].height));const N=l.x(E);g(N,z,C),E=LV(T,E+m+f,_?E+A:this.right,t.rtl),x(l.x(E),z,C),_?p.x+=A+d:p.y+=S}),FP(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,i=be(n.font),s=ze(n.padding);if(!n.display)return;const r=Lo(t.rtl,this.left,this.width),o=this.ctx,a=n.position,l=i.size/2,c=s.top+l;let u,d=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),u=this.top+c,d=$e(t.align,d,this.right-h);else{const p=this.columnSizes.reduce((m,v)=>Math.max(m,v.height),0);u=c+$e(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const f=$e(a,d,d+h);o.textAlign=r.textAlign(n0(a)),o.textBaseline="middle",o.strokeStyle=n.color,o.fillStyle=n.color,o.font=i.string,zr(o,n.text,f,u,i)}_computeTitleHeight(){const t=this.options.title,n=be(t.font),i=ze(t.padding);return t.display?n.lineHeight+i.height:0}_getLegendItemAt(t,n){let i,s,r;if(Yi(t,this.left,this.right)&&Yi(n,this.top,this.bottom)){for(r=this.legendHitBoxes,i=0;ie.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:i,textAlign:s,color:r}}=e.legend.options;return e._getSortedDatasetMetas().map(o=>{const a=o.controller.getStyle(n?0:void 0),l=ze(a.borderWidth);return{text:t[o.index].label,fillStyle:a.backgroundColor,fontColor:r,hidden:!o.visible,lineCap:a.borderCapStyle,lineDash:a.borderDash,lineDashOffset:a.borderDashOffset,lineJoin:a.borderJoinStyle,lineWidth:(l.width+l.height)/4,strokeStyle:a.borderColor,pointStyle:i||a.pointStyle,rotation:a.rotation,textAlign:s||a.textAlign,borderRadius:0,datasetIndex:o.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 p0 extends oi{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 i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const s=Vt(i.text)?i.text.length:1;this._padding=ze(i.padding);const r=s*be(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:i,bottom:s,right:r,options:o}=this,a=o.align;let l=0,c,u,d;return this.isHorizontal()?(u=$e(a,i,r),d=n+t,c=r-i):(o.position==="left"?(u=i+t,d=$e(a,s,n),l=qt*-.5):(u=r-t,d=$e(a,n,s),l=qt*.5),c=s-n),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const i=be(n.font),r=i.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(r);zr(t,n.text,0,0,i,{color:n.color,maxWidth:l,rotation:c,textAlign:n0(n.align),textBaseline:"middle",translation:[o,a]})}}function MH(e,t){const n=new p0({ctx:e.ctx,options:t,chart:e});Be.configure(e,n,t),Be.addBox(e,n),e.titleBlock=n}var CH={id:"title",_element:p0,start(e,t,n){MH(e,n)},stop(e){const t=e.titleBlock;Be.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const i=e.titleBlock;Be.configure(e,i,n),i.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 Cu=new WeakMap;var PH={id:"subtitle",start(e,t,n){const i=new p0({ctx:e.ctx,options:n,chart:e});Be.configure(e,i,n),Be.addBox(e,i),Cu.set(e,i)},stop(e){Be.removeBox(e,Cu.get(e)),Cu.delete(e)},beforeUpdate(e,t,n){const i=Cu.get(e);Be.configure(e,i,n),i.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Sl={average(e){if(!e.length)return!1;let t,n,i=0,s=0,r=0;for(t=0,n=e.length;ta({chart:t,initial:n.initial,numSteps:o,currentStep:Math.min(i-n.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=bP.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const r=i.items;let o=r.length-1,a=!1,l;for(;o>=0;--o)l=r[o],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),a=!0):(r[o]=r[r.length-1],r.pop());a&&(s.draw(),this._notify(s,i,t,"progress")),r.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),n+=r.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let i=n.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,i)),i}listen(t,n,i){this._getAnims(t).listeners[n].push(i)}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((i,s)=>Math.max(i,s._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 i=n.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Ri=new Kz;const q1="transparent",Gz={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const i=B1(e||q1),s=i.valid&&B1(t||q1);return s&&s.valid?s.mix(i,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class qz{constructor(t,n,i,s){const r=n[i];s=Ja([t.to,s,r,t.from]);const o=Ja([t.from,r,s]);this._active=!0,this._fn=t.fn||Gz[t.type||typeof o],this._easing=kl[t.easing]||kl.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=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(t,n,i){if(this._active){this._notify(!1);const s=this._target[this._prop],r=i-this._start,o=this._duration-r;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=Ja([t.to,n,s,t.from]),this._from=Ja([t.from,s,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,i=this._duration,s=this._prop,r=this._from,o=this._loop,a=this._to;let l;if(this._active=r!==a&&(o||n1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(r,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,i)=>{t.push({res:n,rej:i})})}_notify(t){const n=t?"res":"rej",i=this._promises||[];for(let s=0;se!=="onProgress"&&e!=="onComplete"&&e!=="fn"});_t.set("animations",{colors:{type:"color",properties:Zz},numbers:{type:"number",properties:Qz}});_t.describe("animations",{_fallback:"animation"});_t.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:e=>e|0}}}});class WP{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!yt(t))return;const n=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const s=t[i];if(!yt(s))return;const r={};for(const o of Jz)r[o]=s[o];(Vt(s.properties)&&s.properties||[i]).forEach(o=>{(o===i||!n.has(o))&&n.set(o,r)})})}_animateOptions(t,n){const i=n.options,s=e5(t,i);if(!s)return[];const r=this._createAnimations(s,i);return i.$shared&&t5(t.options.$animations,i).then(()=>{t.options=i},()=>{}),r}_createAnimations(t,n){const i=this._properties,s=[],r=t.$animations||(t.$animations={}),o=Object.keys(n),a=Date.now();let l;for(l=o.length-1;l>=0;--l){const c=o[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,n));continue}const u=n[c];let d=r[c];const h=i.get(c);if(d)if(h&&d.active()){d.update(h,u,a);continue}else d.cancel();if(!h||!h.duration){t[c]=u;continue}r[c]=d=new qz(h,t,c,u),s.push(d)}return s}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const i=this._createAnimations(t,n);if(i.length)return Ri.add(this._chart,i),!0}}function t5(e,t){const n=[],i=Object.keys(t);for(let s=0;s0||!n&&r<0)return s.index}return null}function e_(e,t){const{chart:n,_cachedMeta:i}=e,s=n._stacks||(n._stacks={}),{iScale:r,vScale:o,index:a}=i,l=r.axis,c=o.axis,u=r5(r,o,i),d=t.length;let h;for(let f=0;fn[i].axis===t).shift()}function l5(e,t){return er(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function c5(e,t,n){return er(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function Da(e,t){const n=e.controller.index,i=e.vScale&&e.vScale.axis;if(i){t=t||e._parsed;for(const s of t){const r=s._stacks;if(!r||r[i]===void 0||r[i][n]===void 0)return;delete r[i][n]}}}const up=e=>e==="reset"||e==="none",n_=(e,t)=>t?e:Object.assign({},e),u5=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:HP(n,!0),values:null};class ri{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.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=J1(t.vScale,t),this.addElements()}updateIndex(t){this.index!==t&&Da(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,i=this.getDataset(),s=(d,h,f,p)=>d==="x"?h:d==="r"?p:f,r=n.xAxisID=ut(i.xAxisID,cp(t,"x")),o=n.yAxisID=ut(i.yAxisID,cp(t,"y")),a=n.rAxisID=ut(i.rAxisID,cp(t,"r")),l=n.indexAxis,c=n.iAxisID=s(l,r,o,a),u=n.vAxisID=s(l,o,r,a);n.xScale=this.getScaleForId(r),n.yScale=this.getScaleForId(o),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(u)}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&&R1(this._data,this),t._stacked&&Da(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),i=this._data;if(yt(n))this._data=s5(n);else if(i!==n){if(i){R1(i,this);const s=this._cachedMeta;Da(s),s._parsed=[]}n&&Object.isExtensible(n)&&AV(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,i=this.getDataset();let s=!1;this._dataCheck();const r=n._stacked;n._stacked=J1(n.vScale,n),n.stack!==i.stack&&(s=!0,Da(n),n.stack=i.stack),this._resyncElements(t),(s||r!==n._stacked)&&e_(this,n._parsed)}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:i,_data:s}=this,{iScale:r,_stacked:o}=i,a=r.axis;let l=t===0&&n===s.length?!0:i._sorted,c=t>0&&i._parsed[t-1],u,d,h;if(this._parsing===!1)i._parsed=s,i._sorted=!0,h=s;else{Vt(s[t])?h=this.parseArrayData(i,s,t,n):yt(s[t])?h=this.parseObjectData(i,s,t,n):h=this.parsePrimitiveData(i,s,t,n);const f=()=>d[a]===null||c&&d[a]m||d=0;--h)if(!p()){this.updateRangeFromParsed(c,t,f,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,i=[];let s,r,o;for(s=0,r=n.length;s=0&&tthis.getContext(i,s),m=c.resolveNamedOptions(h,f,p,d);return m.$shared&&(m.$shared=l,r[o]=Object.freeze(n_(m,l))),m}_resolveAnimations(t,n,i){const s=this.chart,r=this._cachedDataOpts,o=`animation-${n}`,a=r[o];if(a)return a;let l;if(s.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,n),h=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(h,this.getContext(t,i,n))}const c=new WP(s,l&&l.animations);return l&&l._cacheable&&(r[o]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||up(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const i=this.resolveDataElementOptions(t,n),s=this._sharedOptions,r=this.getSharedOptions(i),o=this.includeOptions(n,r)||r!==s;return this.updateSharedOptions(r,n,i),{sharedOptions:r,includeOptions:o}}updateElement(t,n,i,s){up(s)?Object.assign(t,i):this._resolveAnimations(n,s).update(t,i)}updateSharedOptions(t,n,i){t&&!up(n)&&this._resolveAnimations(void 0,n).update(t,i)}_setStyle(t,n,i,s){t.active=s;const r=this.getStyle(n,s);this._resolveAnimations(n,i,s).update(t,{options:!s&&this.getSharedOptions(r)||r})}removeHoverStyle(t,n,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,n,i){this._setStyle(t,i,"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,i=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const s=i.length,r=n.length,o=Math.min(r,s);o&&this.parse(0,o),r>s?this._insertElements(s,r-s,t):r{for(c.length+=n,a=c.length-1;a>=o;a--)c[a]=c[a-n]};for(l(r),a=t;as-r))}return e._cache.$bar}function h5(e){const t=e.iScale,n=d5(t,e.type);let i=t._length,s,r,o,a;const l=()=>{o===32767||o===-32768||(Hn(a)&&(i=Math.min(i,Math.abs(o-a)||i)),a=o)};for(s=0,r=n.length;s0?s[e-1]:null,a=eMath.abs(a)&&(l=a,c=o),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:r,min:o,max:a}}function UP(e,t,n,i){return Vt(e)?m5(e,t,n,i):t[n.axis]=n.parse(e,i),t}function i_(e,t,n,i){const s=e.iScale,r=e.vScale,o=s.getLabels(),a=s===r,l=[];let c,u,d,h;for(c=n,u=n+i;c=n?1:-1)}function y5(e){let t,n,i,s,r;return e.horizontal?(t=e.base>e.x,n="left",i="right"):(t=e.basel.controller.options.grouped),r=i.options.stacked,o=[],a=l=>{const c=l.controller.getParsed(n),u=c&&c[l.vScale.axis];if(Mt(u)||isNaN(u))return!0};for(const l of s)if(!(n!==void 0&&a(l))&&((r===!1||o.indexOf(l.stack)===-1||r===void 0&&l.stack===void 0)&&o.push(l.stack),l.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,n,i){const s=this._getStacks(t,i),r=n!==void 0?s.indexOf(n):-1;return r===-1?s.length-1:r}_getRuler(){const t=this.options,n=this._cachedMeta,i=n.iScale,s=[];let r,o;for(r=0,o=n.data.length;r=0;--i)n=Math.max(n,t[i].size(this.resolveDataElementOptions(i))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,{xScale:i,yScale:s}=n,r=this.getParsed(t),o=i.getLabelForValue(r.x),a=s.getLabelForValue(r.y),l=r._custom;return{label:n.label,value:"("+o+", "+a+(l?", "+l:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,i,s){const r=s==="reset",{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(n,s),u=o.axis,d=a.axis;for(let h=n;htc(x,a,l,!0)?1:Math.max(_,_*n,w,w*n),p=(x,_,w)=>tc(x,a,l,!0)?-1:Math.min(_,_*n,w,w*n),m=f(0,c,d),v=f(ae,u,h),y=p(qt,c,d),g=p(qt+ae,u,h);i=(m-y)/2,s=(v-g)/2,r=-(m+y)/2,o=-(v+g)/2}return{ratioX:i,ratioY:s,offsetX:r,offsetY:o}}class oa extends ri{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 i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let r=l=>+i[l];if(yt(i[t])){const{key:l="value"}=this._parsing;r=c=>+Ys(i[c],l)}let o,a;for(o=t,a=t+n;o0&&!isNaN(t)?Nt*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=kc(n._parsed[t],i.options.locale);return{label:s[t]||"",value:r}}getMaxBorderWidth(t){let n=0;const i=this.chart;let s,r,o,a,l;if(!t){for(s=0,r=i.data.datasets.length;se!=="spacing",_indexable:e=>e!=="spacing"};oa.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const t=e.data;if(t.labels.length&&t.datasets.length){const{labels:{pointStyle:n}}=e.legend.options;return t.labels.map((i,s)=>{const o=e.getDatasetMeta(0).controller.getStyle(s);return{text:i,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:n,hidden:!e.getDataVisibility(s),index:s}})}return[]}},onClick(e,t,n){n.chart.toggleDataVisibility(t.index),n.chart.update()}},tooltip:{callbacks:{title(){return""},label(e){let t=e.label;const n=": "+e.formattedValue;return Vt(t)?(t=t.slice(),t[0]+=n):t+=n,t}}}}};class Yh extends ri{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:i,data:s=[],_dataset:r}=n,o=this.chart._animationsDisabled;let{start:a,count:l}=wP(n,s,o);this._drawStart=a,this._drawCount=l,kP(n)&&(a=0,l=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!r._decimated,i.points=s;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:c},t),this.updateElements(s,a,l,t)}updateElements(t,n,i,s){const r=s==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(n,s),h=o.axis,f=a.axis,{spanGaps:p,segment:m}=this.options,v=ta(p)?p:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||r||s==="none";let g=n>0&&this.getParsed(n-1);for(let x=n;x0&&Math.abs(w[h]-g[h])>v,m&&(S.parsed=w,S.raw=c.data[x]),d&&(S.options=u||this.resolveDataElementOptions(x,_.active?"active":s)),y||this.updateElement(_,x,S,s),g=w}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,i=n.options&&n.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const r=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,r,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}Yh.id="line";Yh.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};Yh.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class Xh extends ri{constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=kc(n._parsed[t].r,i.options.locale);return{label:s[t]||"",value:r}}parseObjectData(t,n,i,s){return NP.bind(this)(t,n,i,s)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,s)=>{const r=this.getParsed(s).r;!isNaN(r)&&this.chart.getDataVisibility(s)&&(rn.max&&(n.max=r))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,i=t.options,s=Math.min(n.right-n.left,n.bottom-n.top),r=Math.max(s/2,0),o=Math.max(i.cutoutPercentage?r/100*i.cutoutPercentage:1,0),a=(r-o)/t.getVisibleDatasetCount();this.outerRadius=r-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,n,i,s){const r=s==="reset",o=this.chart,l=o.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,d=c.yCenter,h=c.getIndexAngle(0)-.5*qt;let f=h,p;const m=360/this.countVisibleElements();for(p=0;p{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&n++}),n}_computeAngle(t,n,i){return this.chart.getDataVisibility(t)?ti(this.resolveDataElementOptions(t,n).angle||i):0}}Xh.id="polarArea";Xh.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};Xh.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const t=e.data;if(t.labels.length&&t.datasets.length){const{labels:{pointStyle:n}}=e.legend.options;return t.labels.map((i,s)=>{const o=e.getDatasetMeta(0).controller.getStyle(s);return{text:i,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:n,hidden:!e.getDataVisibility(s),index:s}})}return[]}},onClick(e,t,n){n.chart.toggleDataVisibility(t.index),n.chart.update()}},tooltip:{callbacks:{title(){return""},label(e){return e.chart.data.labels[e.dataIndex]+": "+e.formattedValue}}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class d0 extends oa{}d0.id="pie";d0.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class Kh extends ri{getLabelAndValue(t){const n=this._cachedMeta.vScale,i=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(i[n.axis])}}parseObjectData(t,n,i,s){return NP.bind(this)(t,n,i,s)}update(t){const n=this._cachedMeta,i=n.dataset,s=n.data||[],r=n.iScale.getLabels();if(i.points=s,t!=="resize"){const o=this.resolveDatasetElementOptions(t);this.options.showLine||(o.borderWidth=0);const a={_loop:!0,_fullLoop:r.length===s.length,options:o};this.updateElement(i,void 0,a,t)}this.updateElements(s,0,s.length,t)}updateElements(t,n,i,s){const r=this._cachedMeta.rScale,o=s==="reset";for(let a=n;a{s[r]=i[r]&&i[r].active()?i[r]._to:this[r]}),s}};oi.defaults={};oi.defaultRoutes=void 0;const YP={values(e){return Vt(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const i=this.chart.options.locale;let s,r=e;if(n.length>1){const c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),r=w5(e,n)}const o=jn(Math.abs(r)),a=Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),kc(e,i,l)},logarithmic(e,t,n){if(e===0)return"0";const i=e/Math.pow(10,Math.floor(jn(e)));return i===1||i===2||i===5?YP.numeric.call(this,e,t,n):""}};function w5(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 Gh={formatters:YP};_t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth: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:Gh.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}});_t.route("scale.ticks","color","","color");_t.route("scale.grid","color","","borderColor");_t.route("scale.grid","borderColor","","borderColor");_t.route("scale.title","color","","color");_t.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"});_t.describe("scales",{_fallback:"scale"});_t.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"});function k5(e,t){const n=e.options.ticks,i=n.maxTicksLimit||S5(e),s=n.major.enabled?C5(t):[],r=s.length,o=s[0],a=s[r-1],l=[];if(r>i)return P5(t,l,s,r/i),l;const c=M5(s,t,i);if(r>0){let u,d;const h=r>1?Math.round((a-o)/(r-1)):null;for(ku(t,l,c,Mt(h)?0:o-h,o),u=0,d=r-1;us)return l}return Math.max(s,1)}function C5(e){const t=[];let n,i;for(n=0,i=e.length;ne==="left"?"right":e==="right"?"left":e,o_=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n;function a_(e,t){const n=[],i=e.length/t,s=e.length;let r=0;for(;ro+a)))return l}function A5(e,t){At(e,n=>{const i=n.gc,s=i.length/2;let r;if(s>t){for(r=0;ri?i:n,i=s&&n>i?n:i,{min:On(n,On(i,n)),max:On(i,On(n,i))}}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||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Ft(this.options.beforeUpdate,[this])}update(t,n,i){const{beginAtZero:s,grace:r,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=fz(this,r,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a=r||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const u=this._getLabelSizes(),d=u.widest.width,h=u.highest.height,f=ke(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/i:f/(i-1),d+6>a&&(a=f/(i-(t.offset?.5:1)),l=this.maxHeight-Ea(t.grid)-n.padding-l_(t.title,this.chart.options.font),c=Math.sqrt(d*d+h*h),o=t0(Math.min(Math.asin(ke((u.highest.height+6)/a,-1,1)),Math.asin(ke(l/c,-1,1))-Math.asin(ke(h/c,-1,1)))),o=Math.max(s,Math.min(r,o))),this.labelRotation=o}afterCalculateLabelRotation(){Ft(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Ft(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:i,title:s,grid:r}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const l=l_(s,n.options.font);if(a?(t.width=this.maxWidth,t.height=Ea(r)+l):(t.height=this.maxHeight,t.width=Ea(r)+l),i.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:h}=this._getLabelSizes(),f=i.padding*2,p=ti(this.labelRotation),m=Math.cos(p),v=Math.sin(p);if(a){const y=i.mirror?0:v*d.width+m*h.height;t.height=Math.min(this.maxHeight,t.height+y+f)}else{const y=i.mirror?0:m*d.width+v*h.height;t.width=Math.min(this.maxWidth,t.width+y+f)}this._calculatePadding(c,u,v,m)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,i,s){const{ticks:{align:r,padding:o},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,f=0;l?c?(h=s*t.width,f=i*n.height):(h=i*t.height,f=s*n.width):r==="start"?f=n.width:r==="end"?h=t.width:r!=="inner"&&(h=t.width/2,f=n.width/2),this.paddingLeft=Math.max((h-u+o)*this.width/(this.width-u),0),this.paddingRight=Math.max((f-d+o)*this.width/(this.width-d),0)}else{let u=n.height/2,d=t.height/2;r==="start"?(u=0,d=t.height):r==="end"&&(u=n.height,d=0),this.paddingTop=u+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(){Ft(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,i;for(n=0,i=t.length;n({width:r[C]||0,height:o[C]||0});return{first:S(0),last:S(n-1),widest:S(_),highest:S(w),widths:r,heights:o}}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 TV(this._alignToPixels?cr(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&&ta*s?a/i:l/s:l*s0}_computeGridLineItems(t){const n=this.axis,i=this.chart,s=this.options,{grid:r,position:o}=s,a=r.offset,l=this.isHorizontal(),u=this.ticks.length+(a?1:0),d=Ea(r),h=[],f=r.setContext(this.getContext()),p=f.drawBorder?f.borderWidth:0,m=p/2,v=function(R){return cr(i,R,p)};let y,g,x,_,w,S,C,M,P,T,A,E;if(o==="top")y=v(this.bottom),S=this.bottom-d,M=y-m,T=v(t.top)+m,E=t.bottom;else if(o==="bottom")y=v(this.top),T=t.top,E=v(t.bottom)-m,S=y+m,M=this.top+d;else if(o==="left")y=v(this.right),w=this.right-d,C=y-m,P=v(t.left)+m,A=t.right;else if(o==="right")y=v(this.left),P=t.left,A=v(t.right)-m,w=y+m,C=this.left+d;else if(n==="x"){if(o==="center")y=v((t.top+t.bottom)/2+.5);else if(yt(o)){const R=Object.keys(o)[0],L=o[R];y=v(this.chart.scales[R].getPixelForValue(L))}T=t.top,E=t.bottom,S=y+m,M=S+d}else if(n==="y"){if(o==="center")y=v((t.left+t.right)/2);else if(yt(o)){const R=Object.keys(o)[0],L=o[R];y=v(this.chart.scales[R].getPixelForValue(L))}w=y-m,C=w-d,P=t.left,A=t.right}const z=ut(s.ticks.maxTicksLimit,u),N=Math.max(1,Math.ceil(u/z));for(g=0;gr.value===t);return s>=0?n.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const n=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let r,o;const a=(l,c,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(n.display)for(r=0,o=s.length;r{this.draw(s)}}]:[{z:i,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:i+1,draw:()=>{this.drawBorder()}},{z:n,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let r,o;for(r=0,o=n.length;r{const i=n.split("."),s=i.pop(),r=[e].concat(i).join("."),o=t[n].split("."),a=o.pop(),l=o.join(".");_t.route(r,s,l,a)})}function I5(e){return"id"in e&&"defaults"in e}class F5{constructor(){this.controllers=new Su(ri,"datasets",!0),this.elements=new Su(oi,"elements"),this.plugins=new Su(Object,"plugins"),this.scales=new Su(Xr,"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,i){[...n].forEach(s=>{const r=i||this._getRegistryForType(s);i||r.isForType(s)||r===this.plugins&&s.id?this._exec(t,r,s):At(s,o=>{const a=i||this._getRegistryForType(o);this._exec(t,a,o)})})}_exec(t,n,i){const s=Jy(t);Ft(i["before"+s],[],i),n[t](i),Ft(i["after"+s],[],i)}_getRegistryForType(t){for(let n=0;n0&&this.getParsed(n-1);for(let _=n;_0&&Math.abs(S[f]-x[f])>y,v&&(C.parsed=S,C.raw=c.data[_]),h&&(C.options=d||this.resolveDataElementOptions(_,w.active?"active":s)),g||this.updateElement(w,_,C,s),x=S}this.updateSharedOptions(d,s,u)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let a=0;for(let l=n.length-1;l>=0;--l)a=Math.max(a,n[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!n.length)return s;const r=n[0].size(this.resolveDataElementOptions(0)),o=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(s,r,o)/2}}qh.id="scatter";qh.defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};qh.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title(){return""},label(e){return"("+e.label+", "+e.formattedValue+")"}}}},scales:{x:{type:"linear"},y:{type:"linear"}}};var B5=Object.freeze({__proto__:null,BarController:Hh,BubbleController:Uh,DoughnutController:oa,LineController:Yh,PolarAreaController:Xh,PieController:d0,RadarController:Kh,ScatterController:qh});function ur(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Xm{constructor(t){this.options=t||{}}init(t){}formats(){return ur()}parse(t,n){return ur()}format(t,n){return ur()}add(t,n,i){return ur()}diff(t,n,i){return ur()}startOf(t,n,i){return ur()}endOf(t,n){return ur()}}Xm.override=function(e){Object.assign(Xm.prototype,e)};var V5={_date:Xm};function z5(e,t,n,i){const{controller:s,data:r,_sorted:o}=e,a=s._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&o&&r.length){const l=a._reversePixels?DV:Xi;if(i){if(s._sharedOptions){const c=r[0],u=typeof c.getRange=="function"&&c.getRange(t);if(u){const d=l(r,t,n-u),h=l(r,t,n+u);return{lo:d.lo,hi:h.hi}}}}else return l(r,t,n)}return{lo:0,hi:r.length-1}}function Sc(e,t,n,i,s){const r=e.getSortedVisibleDatasetMetas(),o=n[t];for(let a=0,l=r.length;a{l[o](t[n],s)&&(r.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,s))}),i&&!a?[]:r}var Y5={evaluateInteractionItems:Sc,modes:{index(e,t,n,i){const s=vr(t,e),r=n.axis||"x",o=n.includeInvisible||!1,a=n.intersect?hp(e,s,r,i,o):fp(e,s,r,!1,i,o),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(e,t,n,i){const s=vr(t,e),r=n.axis||"xy",o=n.includeInvisible||!1;let a=n.intersect?hp(e,s,r,i,o):fp(e,s,r,!1,i,o);if(a.length>0){const l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let u=0;un.pos===t)}function u_(e,t){return e.filter(n=>XP.indexOf(n.pos)===-1&&n.box.axis===t)}function Oa(e,t){return e.sort((n,i)=>{const s=t?i:n,r=t?n:i;return s.weight===r.weight?s.index-r.index:s.weight-r.weight})}function X5(e){const t=[];let n,i,s,r,o,a;for(n=0,i=(e||[]).length;nc.box.fullSize),!0),i=Oa(Aa(t,"left"),!0),s=Oa(Aa(t,"right")),r=Oa(Aa(t,"top"),!0),o=Oa(Aa(t,"bottom")),a=u_(t,"x"),l=u_(t,"y");return{fullSize:n,leftAndTop:i.concat(r),rightAndBottom:s.concat(l).concat(o).concat(a),chartArea:Aa(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:r.concat(o).concat(a)}}function d_(e,t,n,i){return Math.max(e[n],t[n])+Math.max(e[i],t[i])}function KP(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 Q5(e,t,n,i){const{pos:s,box:r}=n,o=e.maxPadding;if(!yt(s)){n.size&&(e[s]-=n.size);const d=i[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?r.height:r.width),n.size=d.size/d.count,e[s]+=n.size}r.getPadding&&KP(o,r.getPadding());const a=Math.max(0,t.outerWidth-d_(o,e,"left","right")),l=Math.max(0,t.outerHeight-d_(o,e,"top","bottom")),c=a!==e.w,u=l!==e.h;return e.w=a,e.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function Z5(e){const t=e.maxPadding;function n(i){const s=Math.max(t[i]-e[i],0);return e[i]+=s,s}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function J5(e,t){const n=t.maxPadding;function i(s){const r={left:0,top:0,right:0,bottom:0};return s.forEach(o=>{r[o]=Math.max(t[o],n[o])}),r}return i(e?["left","right"]:["top","bottom"])}function tl(e,t,n,i){const s=[];let r,o,a,l,c,u;for(r=0,o=e.length,c=0;r{typeof m.beforeLayout=="function"&&m.beforeLayout()});const u=l.reduce((m,v)=>v.box.options&&v.box.options.display===!1?m:m+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:s,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/u,hBoxMaxHeight:o/2}),h=Object.assign({},s);KP(h,ze(i));const f=Object.assign({maxPadding:h,w:r,h:o,x:s.left,y:s.top},s),p=G5(l.concat(c),d);tl(a.fullSize,f,d,p),tl(l,f,d,p),tl(c,f,d,p)&&tl(l,f,d,p),Z5(f),h_(a.leftAndTop,f,d,p),f.x+=f.w,f.y+=f.h,h_(a.rightAndBottom,f,d,p),e.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},At(a.chartArea,m=>{const v=m.box;Object.assign(v,e.chartArea),v.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class GP{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,i){}removeEventListener(t,n,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,i,s){return n=Math.max(0,n||t.width),i=i||t.height,{width:n,height:Math.max(0,s?Math.floor(n/s):i)}}isAttached(t){return!0}updateConfig(t){}}class tW extends GP{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const rd="$chartjs",eW={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},f_=e=>e===null||e==="";function nW(e,t){const n=e.style,i=e.getAttribute("height"),s=e.getAttribute("width");if(e[rd]={initial:{height:i,width:s,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",f_(s)){const r=U1(e,"width");r!==void 0&&(e.width=r)}if(f_(i))if(e.style.height==="")e.height=e.width/(t||2);else{const r=U1(e,"height");r!==void 0&&(e.height=r)}return e}const qP=jz?{passive:!0}:!1;function iW(e,t,n){e.addEventListener(t,n,qP)}function sW(e,t,n){e.canvas.removeEventListener(t,n,qP)}function rW(e,t){const n=eW[e.type]||e.type,{x:i,y:s}=vr(e,t);return{type:n,chart:t,native:e,x:i!==void 0?i:null,y:s!==void 0?s:null}}function nh(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function oW(e,t,n){const i=e.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||nh(a.addedNodes,i),o=o&&!nh(a.removedNodes,i);o&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}function aW(e,t,n){const i=e.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||nh(a.removedNodes,i),o=o&&!nh(a.addedNodes,i);o&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}const ic=new Map;let p_=0;function QP(){const e=window.devicePixelRatio;e!==p_&&(p_=e,ic.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function lW(e,t){ic.size||window.addEventListener("resize",QP),ic.set(e,t)}function cW(e){ic.delete(e),ic.size||window.removeEventListener("resize",QP)}function uW(e,t,n){const i=e.canvas,s=i&&u0(i);if(!s)return;const r=_P((a,l)=>{const c=s.clientWidth;n(a,l),c{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||r(c,u)});return o.observe(s),lW(e,r),o}function pp(e,t,n){n&&n.disconnect(),t==="resize"&&cW(e)}function dW(e,t,n){const i=e.canvas,s=_P(r=>{e.ctx!==null&&n(rW(r,e))},e,r=>{const o=r[0];return[o,o.offsetX,o.offsetY]});return iW(i,t,s),s}class hW extends GP{acquireContext(t,n){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(nW(t,n),i):null}releaseContext(t){const n=t.canvas;if(!n[rd])return!1;const i=n[rd].initial;["height","width"].forEach(r=>{const o=i[r];Mt(o)?n.removeAttribute(r):n.setAttribute(r,o)});const s=i.style||{};return Object.keys(s).forEach(r=>{n.style[r]=s[r]}),n.width=n.width,delete n[rd],!0}addEventListener(t,n,i){this.removeEventListener(t,n);const s=t.$proxies||(t.$proxies={}),o={attach:oW,detach:aW,resize:uW}[n]||dW;s[n]=o(t,n,i)}removeEventListener(t,n){const i=t.$proxies||(t.$proxies={}),s=i[n];if(!s)return;({attach:pp,detach:pp,resize:pp}[n]||sW)(t,n,s),i[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,i,s){return Nz(t,n,i,s)}isAttached(t){const n=u0(t);return!!(n&&n.isConnected)}}function fW(e){return!$P()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?tW:hW}class pW{constructor(){this._init=[]}notify(t,n,i,s){n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const r=s?this._descriptors(t).filter(s):this._descriptors(t),o=this._notify(r,t,n,i);return n==="afterDestroy"&&(this._notify(r,t,"stop"),this._notify(this._init,t,"uninstall")),o}_notify(t,n,i,s){s=s||{};for(const r of t){const o=r.plugin,a=o[i],l=[n,s,r.options];if(Ft(a,l,o)===!1&&s.cancelable)return!1}return!0}invalidate(){Mt(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 i=t&&t.config,s=ut(i.options&&i.options.plugins,{}),r=mW(i);return s===!1&&!n?[]:yW(t,r,s,n)}_notifyStateChanges(t){const n=this._oldCache||[],i=this._cache,s=(r,o)=>r.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(s(n,i),t,"stop"),this._notify(s(i,n),t,"start")}}function mW(e){const t={},n=[],i=Object.keys(pi.plugins.items);for(let r=0;r{const l=i[a];if(!yt(l))return console.error(`Invalid scale configuration for scale: ${a}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const c=Gm(a,l),u=bW(c,s),d=n.scales||{};r[c]=r[c]||a,o[a]=_l(Object.create(null),[{axis:c},l,d[c],d[u]])}),e.data.datasets.forEach(a=>{const l=a.type||e.type,c=a.indexAxis||Km(l,t),d=(Vr[l]||{}).scales||{};Object.keys(d).forEach(h=>{const f=xW(h,c),p=a[f+"AxisID"]||r[f]||f;o[p]=o[p]||Object.create(null),_l(o[p],[{axis:f},i[p],d[h]])})}),Object.keys(o).forEach(a=>{const l=o[a];_l(l,[_t.scales[l.type],_t.scale])}),o}function ZP(e){const t=e.options||(e.options={});t.plugins=ut(t.plugins,{}),t.scales=wW(e,t)}function JP(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function kW(e){return e=e||{},e.data=JP(e.data),ZP(e),e}const m_=new Map,tT=new Set;function Cu(e,t){let n=m_.get(e);return n||(n=t(),m_.set(e,n),tT.add(n)),n}const Ra=(e,t,n)=>{const i=Ys(t,n);i!==void 0&&e.add(i)};class SW{constructor(t){this._config=kW(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=JP(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(),ZP(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Cu(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return Cu(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return Cu(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,i=this.type;return Cu(`${i}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const i=this._scopeCache;let s=i.get(t);return(!s||n)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,n,i){const{options:s,type:r}=this,o=this._cachedScopes(t,i),a=o.get(n);if(a)return a;const l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(d=>Ra(l,t,d))),u.forEach(d=>Ra(l,s,d)),u.forEach(d=>Ra(l,Vr[r]||{},d)),u.forEach(d=>Ra(l,_t,d)),u.forEach(d=>Ra(l,Um,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),tT.has(n)&&o.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,Vr[n]||{},_t.datasets[n]||{},{type:n},_t,Um]}resolveNamedOptions(t,n,i,s=[""]){const r={$shared:!0},{resolver:o,subPrefixes:a}=g_(this._resolverCache,t,s);let l=o;if(CW(o,n)){r.$shared=!1,i=Xs(i)?i():i;const c=this.createResolver(t,i,a);l=ea(o,i,c)}for(const c of n)r[c]=l[c];return r}createResolver(t,n,i=[""],s){const{resolver:r}=g_(this._resolverCache,t,i);return yt(n)?ea(r,n,void 0,s):r}}function g_(e,t,n){let i=e.get(t);i||(i=new Map,e.set(t,i));const s=n.join();let r=i.get(s);return r||(r={resolver:a0(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},i.set(s,r)),r}const MW=e=>yt(e)&&Object.getOwnPropertyNames(e).reduce((t,n)=>t||Xs(e[n]),!1);function CW(e,t){const{isScriptable:n,isIndexable:i}=AP(e);for(const s of t){const r=n(s),o=i(s),a=(o||r)&&e[s];if(r&&(Xs(a)||MW(a))||o&&Vt(a))return!0}return!1}var PW="3.9.1";const TW=["top","bottom","left","right","chartArea"];function y_(e,t){return e==="top"||e==="bottom"||TW.indexOf(e)===-1&&t==="x"}function v_(e,t){return function(n,i){return n[e]===i[e]?n[t]-i[t]:n[e]-i[e]}}function x_(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),Ft(n&&n.onComplete,[e],t)}function DW(e){const t=e.chart,n=t.options.animation;Ft(n&&n.onProgress,[e],t)}function eT(e){return $P()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const ih={},nT=e=>{const t=eT(e);return Object.values(ih).filter(n=>n.canvas===t).pop()};function EW(e,t,n){const i=Object.keys(e);for(const s of i){const r=+s;if(r>=t){const o=e[s];delete e[s],(n>0||r>t)&&(e[r+n]=o)}}}function AW(e,t,n,i){return!n||e.type==="mouseout"?null:i?t:e}class h0{constructor(t,n){const i=this.config=new SW(n),s=eT(t),r=nT(s);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||fW(s)),this.platform.updateConfig(i);const a=this.platform.acquireContext(s,o.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=gV(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,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 pW,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=OV(d=>this.update(d),o.resizeDelay||0),this._dataChanges=[],ih[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Ri.listen(this,"complete",x_),Ri.listen(this,"progress",DW),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:i,height:s,_aspectRatio:r}=this;return Mt(t)?n&&r?r:s?i/s: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}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():H1(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return V1(this.canvas,this.ctx),this}stop(){return Ri.stop(this),this}resize(t,n){Ri.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const i=this.options,s=this.canvas,r=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,t,n,r),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,H1(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),Ft(i.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};At(n,(i,s)=>{i.id=s})}buildOrUpdateScales(){const t=this.options,n=t.scales,i=this.scales,s=Object.keys(i).reduce((o,a)=>(o[a]=!1,o),{});let r=[];n&&(r=r.concat(Object.keys(n).map(o=>{const a=n[o],l=Gm(o,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),At(r,o=>{const a=o.options,l=a.id,c=Gm(l,a),u=ut(a.type,o.dtype);(a.position===void 0||y_(a.position,c)!==y_(o.dposition))&&(a.position=o.dposition),s[l]=!0;let d=null;if(l in i&&i[l].type===u)d=i[l];else{const h=pi.getScale(u);d=new h({id:l,type:u,ctx:this.ctx,chart:this}),i[d.id]=d}d.init(a,t)}),At(s,(o,a)=>{o||delete i[a]}),At(i,o=>{Be.configure(this,o,o.options),Be.addBox(this,o)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,i=t.length;if(t.sort((s,r)=>s.index-r.index),i>n){for(let s=n;sn.length&&delete this._stacks,t.forEach((i,s)=>{n.filter(r=>r===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=n.length;i{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const i=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let c=0,u=this.data.datasets.length;c{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(v_("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){At(this.scales,t=>{Be.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!D1(n,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:r}of n){const o=i==="_removeElements"?-r:r;EW(t,s,o)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,i=r=>new Set(t.filter(o=>o[0]===r).map((o,a)=>a+","+o.splice(1).join(","))),s=i(0);for(let r=1;rr.split(",")).map(r=>({method:r[1],start:+r[2],count:+r[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Be.update(this,this.width,this.height,t);const n=this.chartArea,i=n.width<=0||n.height<=0;this._layers=[],At(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,r)=>{s._idx=r}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,i=this.data.datasets.length;n=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,i=t._clip,s=!i.disabled,r=this.chartArea,o={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(s&&Vh(n,{left:i.left===!1?0:r.left-i.left,right:i.right===!1?this.width:r.right+i.right,top:i.top===!1?0:r.top-i.top,bottom:i.bottom===!1?this.height:r.bottom+i.bottom}),t.controller.draw(),s&&zh(n),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return ec(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,i,s){const r=Y5.modes[n];return typeof r=="function"?r(this,t,i,s):[]}getDatasetMeta(t){const n=this.data.datasets[t],i=this._metasets;let s=i.filter(r=>r&&r._dataset===n).pop();return s||(s={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},i.push(s)),s}getContext(){return this.$context||(this.$context=er(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!n.hidden}setDatasetVisibility(t,n){const i=this.getDatasetMeta(t);i.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,i){const s=i?"show":"hide",r=this.getDatasetMeta(t),o=r.controller._resolveAnimations(void 0,s);Hn(n)?(r.data[n].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(r,{visible:i}),this.update(a=>a.datasetIndex===t?s: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(),Ri.remove(this),t=0,n=this.data.datasets.length;t{n.addEventListener(this,r,o),t[r]=o},s=(r,o,a)=>{r.offsetX=o,r.offsetY=a,this._eventHandler(r)};At(this.options.events,r=>i(r,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,i=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},r=(l,c)=>{this.canvas&&this.resize(l,c)};let o;const a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",r),i("detach",o)};o=()=>{this.attached=!1,s("resize",r),this._stop(),this._resize(0,0),i("attach",a)},n.isAttached(this.canvas)?a():o()}unbindEvents(){At(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},At(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,i){const s=i?"set":"remove";let r,o,a,l;for(n==="dataset"&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=t.length;a{const a=this.getDatasetMeta(r);if(!a)throw new Error("No dataset found at index "+r);return{datasetIndex:r,element:a.data[o],index:o}});!qd(i,n)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,n))}notifyPlugins(t,n,i){return this._plugins.notify(this,t,n,i)}_updateHoverStyles(t,n,i){const s=this.options.hover,r=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),o=r(n,t),a=i?t:r(t,n);o.length&&this.updateHoverStyle(o,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,n){const i={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},s=o=>(o.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const r=this._handleEvent(t,n,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(r||i.changed)&&this.render(),this}_handleEvent(t,n,i){const{_active:s=[],options:r}=this,o=n,a=this._getActiveElements(t,s,i,o),l=wV(t),c=AW(t,this._lastEvent,i,l);i&&(this._lastEvent=null,Ft(r.onHover,[t,a,this],this),l&&Ft(r.onClick,[t,a,this],this));const u=!qd(a,s);return(u||n)&&(this._active=a,this._updateHoverStyles(a,s,n)),this._lastEvent=c,u}_getActiveElements(t,n,i,s){if(t.type==="mouseout")return[];if(!i)return n;const r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,s)}}const b_=()=>At(h0.instances,e=>e._plugins.invalidate()),hs=!0;Object.defineProperties(h0,{defaults:{enumerable:hs,value:_t},instances:{enumerable:hs,value:ih},overrides:{enumerable:hs,value:Vr},registry:{enumerable:hs,value:pi},version:{enumerable:hs,value:PW},getChart:{enumerable:hs,value:nT},register:{enumerable:hs,value:(...e)=>{pi.add(...e),b_()}},unregister:{enumerable:hs,value:(...e)=>{pi.remove(...e),b_()}}});function iT(e,t,n){const{startAngle:i,pixelMargin:s,x:r,y:o,outerRadius:a,innerRadius:l}=t;let c=s/a;e.beginPath(),e.arc(r,o,a,i-c,n+c),l>s?(c=s/l,e.arc(r,o,l,n+c,i-c,!0)):e.arc(r,o,s,n+ae,i-ae),e.closePath(),e.clip()}function OW(e){return o0(e,["outerStart","outerEnd","innerStart","innerEnd"])}function RW(e,t,n,i){const s=OW(e.options.borderRadius),r=(n-t)/2,o=Math.min(r,i*t/2),a=l=>{const c=(n-Math.min(r,l))*i/2;return ke(l,0,Math.min(r,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:ke(s.innerStart,0,o),innerEnd:ke(s.innerEnd,0,o)}}function to(e,t,n,i){return{x:n+e*Math.cos(t),y:i+e*Math.sin(t)}}function qm(e,t,n,i,s,r){const{x:o,y:a,startAngle:l,pixelMargin:c,innerRadius:u}=t,d=Math.max(t.outerRadius+i+n-c,0),h=u>0?u+i+n+c:0;let f=0;const p=s-l;if(i){const R=u>0?u-i:0,L=d>0?d-i:0,B=(R+L)/2,D=B!==0?p*B/(B+i):p;f=(p-D)/2}const m=Math.max(.001,p*d-n/qt)/d,v=(p-m)/2,y=l+v+f,g=s-v-f,{outerStart:x,outerEnd:_,innerStart:w,innerEnd:S}=RW(t,h,d,g-y),C=d-x,M=d-_,P=y+x/C,T=g-_/M,A=h+w,E=h+S,z=y+w/A,N=g-S/E;if(e.beginPath(),r){if(e.arc(o,a,d,P,T),_>0){const B=to(M,T,o,a);e.arc(B.x,B.y,_,T,g+ae)}const R=to(E,g,o,a);if(e.lineTo(R.x,R.y),S>0){const B=to(E,N,o,a);e.arc(B.x,B.y,S,g+ae,N+Math.PI)}if(e.arc(o,a,h,g-S/h,y+w/h,!0),w>0){const B=to(A,z,o,a);e.arc(B.x,B.y,w,z+Math.PI,y-ae)}const L=to(C,y,o,a);if(e.lineTo(L.x,L.y),x>0){const B=to(C,P,o,a);e.arc(B.x,B.y,x,y-ae,P)}}else{e.moveTo(o,a);const R=Math.cos(P)*d+o,L=Math.sin(P)*d+a;e.lineTo(R,L);const B=Math.cos(T)*d+o,D=Math.sin(T)*d+a;e.lineTo(B,D)}e.closePath()}function LW(e,t,n,i,s){const{fullCircles:r,startAngle:o,circumference:a}=t;let l=t.endAngle;if(r){qm(e,t,n,i,o+Nt,s);for(let c=0;c=Nt||tc(r,a,l),m=Yi(o,c+h,u+h);return p&&m}getCenterPoint(t){const{x:n,y:i,startAngle:s,endAngle:r,innerRadius:o,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:l,spacing:c}=this.options,u=(s+r)/2,d=(o+a+c+l)/2;return{x:n+Math.cos(u)*d,y:i+Math.sin(u)*d}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:n,circumference:i}=this,s=(n.offset||0)/2,r=(n.spacing||0)/2,o=n.circular;if(this.pixelMargin=n.borderAlign==="inner"?.33:0,this.fullCircles=i>Nt?Math.floor(i/Nt):0,i===0||this.innerRadius<0||this.outerRadius<0)return;t.save();let a=0;if(s){a=s/2;const c=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(c)*a,Math.sin(c)*a),this.circumference>=qt&&(a=s)}t.fillStyle=n.backgroundColor,t.strokeStyle=n.borderColor;const l=LW(t,this,a,r,o);jW(t,this,a,r,l,o),t.restore()}}Qh.id="arc";Qh.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};Qh.defaultRoutes={backgroundColor:"backgroundColor"};function sT(e,t,n=t){e.lineCap=ut(n.borderCapStyle,t.borderCapStyle),e.setLineDash(ut(n.borderDash,t.borderDash)),e.lineDashOffset=ut(n.borderDashOffset,t.borderDashOffset),e.lineJoin=ut(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=ut(n.borderWidth,t.borderWidth),e.strokeStyle=ut(n.borderColor,t.borderColor)}function $W(e,t,n){e.lineTo(n.x,n.y)}function IW(e){return e.stepped?rz:e.tension||e.cubicInterpolationMode==="monotone"?oz:$W}function rT(e,t,n={}){const i=e.length,{start:s=0,end:r=i-1}=n,{start:o,end:a}=t,l=Math.max(s,o),c=Math.min(r,a),u=sa&&r>a;return{count:i,start:l,loop:t.loop,ilen:c(o+(c?a-_:_))%r,x=()=>{m!==v&&(e.lineTo(u,v),e.lineTo(u,m),e.lineTo(u,y))};for(l&&(f=s[g(0)],e.moveTo(f.x,f.y)),h=0;h<=a;++h){if(f=s[g(h)],f.skip)continue;const _=f.x,w=f.y,S=_|0;S===p?(wv&&(v=w),u=(d*u+_)/++d):(x(),e.lineTo(_,w),p=S,d=0,m=v=w),y=w}x()}function Qm(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?BW:FW}function VW(e){return e.stepped?$z:e.tension||e.cubicInterpolationMode==="monotone"?Iz:xr}function zW(e,t,n,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,n,i)&&s.closePath()),sT(e,t.options),e.stroke(s)}function WW(e,t,n,i){const{segments:s,options:r}=t,o=Qm(t);for(const a of s)sT(e,r,a.style),e.beginPath(),o(e,t,a,{start:n,end:n+i-1})&&e.closePath(),e.stroke()}const HW=typeof Path2D=="function";function UW(e,t,n,i){HW&&!t.options.segment?zW(e,t,n,i):WW(e,t,n,i)}class nr extends oi{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 i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;Dz(this._points,i,t,s,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=Uz(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,i=t.length;return i&&n[t[i-1].end]}interpolate(t,n){const i=this.options,s=t[n],r=this.points,o=zP(this,{property:n,start:s,end:s});if(!o.length)return;const a=[],l=VW(i);let c,u;for(c=0,u=o.length;ce!=="borderDash"&&e!=="fill"};function __(e,t,n,i){const s=e.options,{[n]:r}=e.getProps([n],i);return Math.abs(t-r)=n)return e.slice(t,t+n);const o=[],a=(n-2)/(r-2);let l=0;const c=t+n-1;let u=t,d,h,f,p,m;for(o[l++]=e[u],d=0;df&&(f=p,h=e[g],m=g);o[l++]=h,u=m}return o[l++]=e[c],o}function JW(e,t,n,i){let s=0,r=0,o,a,l,c,u,d,h,f,p,m;const v=[],y=t+n-1,g=e[t].x,_=e[y].x-g;for(o=t;om&&(m=c,h=o),s=(r*s+a.x)/++r;else{const S=o-1;if(!Mt(d)&&!Mt(h)){const C=Math.min(d,h),M=Math.max(d,h);C!==f&&C!==S&&v.push({...e[C],x:s}),M!==f&&M!==S&&v.push({...e[M],x:s})}o>0&&S!==f&&v.push(e[S]),v.push(a),u=w,r=0,p=m=c,d=h=f=o}}return v}function aT(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{value:t})}}function w_(e){e.data.datasets.forEach(t=>{aT(t)})}function tH(e,t){const n=t.length;let i=0,s;const{iScale:r}=e,{min:o,max:a,minDefined:l,maxDefined:c}=r.getUserBounds();return l&&(i=ke(Xi(t,r.axis,o).lo,0,n-1)),c?s=ke(Xi(t,r.axis,a).hi+1,i,n)-i:s=n-i,{start:i,count:s}}var eH={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){w_(e);return}const i=e.width;e.data.datasets.forEach((s,r)=>{const{_data:o,indexAxis:a}=s,l=e.getDatasetMeta(r),c=o||s.data;if(Ja([a,e.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const u=e.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||e.options.parsing)return;let{start:d,count:h}=tH(l,c);const f=n.threshold||4*i;if(h<=f){aT(s);return}Mt(o)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(m){this._data=m}}));let p;switch(n.algorithm){case"lttb":p=ZW(c,d,h,i,n);break;case"min-max":p=JW(c,d,h,i);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}s._decimated=p})},destroy(e){w_(e)}};function nH(e,t,n){const i=e.segments,s=e.points,r=t.points,o=[];for(const a of i){let{start:l,end:c}=a;c=f0(l,c,s);const u=Zm(n,s[l],s[c],a.loop);if(!t.segments){o.push({source:a,target:u,start:s[l],end:s[c]});continue}const d=zP(t,u);for(const h of d){const f=Zm(n,r[h.start],r[h.end],h.loop),p=VP(a,s,f);for(const m of p)o.push({source:m,target:h,start:{[n]:k_(u,f,"start",Math.max)},end:{[n]:k_(u,f,"end",Math.min)}})}}return o}function Zm(e,t,n,i){if(i)return;let s=t[e],r=n[e];return e==="angle"&&(s=vn(s),r=vn(r)),{property:e,start:s,end:r}}function iH(e,t){const{x:n=null,y:i=null}=e||{},s=t.points,r=[];return t.segments.forEach(({start:o,end:a})=>{a=f0(o,a,s);const l=s[o],c=s[a];i!==null?(r.push({x:l.x,y:i}),r.push({x:c.x,y:i})):n!==null&&(r.push({x:n,y:l.y}),r.push({x:n,y:c.y}))}),r}function f0(e,t,n){for(;t>e;t--){const i=n[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function k_(e,t,n,i){return e&&t?i(e[n],t[n]):e?e[n]:t?t[n]:0}function lT(e,t){let n=[],i=!1;return Vt(e)?(i=!0,n=e):n=iH(e,t),n.length?new nr({points:n,options:{tension:0},_loop:i,_fullLoop:i}):null}function S_(e){return e&&e.fill!==!1}function sH(e,t,n){let s=e[t].fill;const r=[t];let o;if(!n)return s;for(;s!==!1&&r.indexOf(s)===-1;){if(!de(s))return s;if(o=e[s],!o)return!1;if(o.visible)return s;r.push(s),s=o.fill}return!1}function rH(e,t,n){const i=cH(e);if(yt(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return de(s)&&Math.floor(s)===s?oH(i[0],t,s,n):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function oH(e,t,n,i){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=i?!1:n}function aH(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:yt(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function lH(e,t,n){let i;return e==="start"?i=n:e==="end"?i=t.options.reverse?t.min:t.max:yt(e)?i=e.value:i=t.getBaseValue(),i}function cH(e){const t=e.options,n=t.fill;let i=ut(n&&n.target,n);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function uH(e){const{scale:t,index:n,line:i}=e,s=[],r=i.segments,o=i.points,a=dH(t,n);a.push(lT({x:null,y:t.bottom},i));for(let l=0;l=0;--o){const a=s[o].$filler;a&&(a.line.updateControlPoints(r,a.axis),i&&a.fill&&yp(e.ctx,a,r))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const i=e.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const r=i[s].$filler;S_(r)&&yp(e.ctx,r,e.chartArea)}},beforeDatasetDraw(e,t,n){const i=t.meta.$filler;!S_(i)||n.drawTime!=="beforeDatasetDraw"||yp(e.ctx,i,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const T_=(e,t)=>{let{boxHeight:n=t,boxWidth:i=t}=e;return e.usePointStyle&&(n=Math.min(n,t),i=e.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:n,itemHeight:Math.max(t,n)}},wH=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class D_ extends oi{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,i){this.maxWidth=t,this.maxHeight=n,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let n=Ft(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(i=>t.filter(i,this.chart.data))),t.sort&&(n=n.sort((i,s)=>t.sort(i,s,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 i=t.labels,s=be(i.font),r=s.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=T_(i,r);let c,u;n.font=s.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(o,r,a,l)+10):(u=this.maxHeight,c=this._fitCols(o,r,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,n,i,s){const{ctx:r,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=s+a;let d=t;r.textAlign="left",r.textBaseline="middle";let h=-1,f=-u;return this.legendItems.forEach((p,m)=>{const v=i+n/2+r.measureText(p.text).width;(m===0||c[c.length-1]+v+2*a>o)&&(d+=u,c[c.length-(m>0?0:1)]=0,f+=u,h++),l[m]={left:0,top:f,row:h,width:v,height:s},c[c.length-1]+=v+a}),d}_fitCols(t,n,i,s){const{ctx:r,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=o-t;let d=a,h=0,f=0,p=0,m=0;return this.legendItems.forEach((v,y)=>{const g=i+n/2+r.measureText(v.text).width;y>0&&f+s+2*a>u&&(d+=h+a,c.push({width:h,height:f}),p+=h+a,m++,h=f=0),l[y]={left:p,top:f,col:m,width:g,height:s},h=Math.max(h,g),f+=s+a}),d+=h,c.push({width:h,height:f}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:i,labels:{padding:s},rtl:r}}=this,o=Ro(r,this.left,this.width);if(this.isHorizontal()){let a=0,l=$e(i,this.left+s,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=$e(i,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+t+s,c.left=o.leftForLtr(o.x(l),c.width),l+=c.width+s}else{let a=0,l=$e(i,this.top+t+s,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=$e(i,this.top+t+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=o.leftForLtr(o.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Vh(t,this),this._draw(),zh(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:i,ctx:s}=this,{align:r,labels:o}=t,a=_t.color,l=Ro(t.rtl,this.left,this.width),c=be(o.font),{color:u,padding:d}=o,h=c.size,f=h/2;let p;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:m,boxHeight:v,itemHeight:y}=T_(o,h),g=function(C,M,P){if(isNaN(m)||m<=0||isNaN(v)||v<0)return;s.save();const T=ut(P.lineWidth,1);if(s.fillStyle=ut(P.fillStyle,a),s.lineCap=ut(P.lineCap,"butt"),s.lineDashOffset=ut(P.lineDashOffset,0),s.lineJoin=ut(P.lineJoin,"miter"),s.lineWidth=T,s.strokeStyle=ut(P.strokeStyle,a),s.setLineDash(ut(P.lineDash,[])),o.usePointStyle){const A={radius:v*Math.SQRT2/2,pointStyle:P.pointStyle,rotation:P.rotation,borderWidth:T},E=l.xPlus(C,m/2),z=M+f;DP(s,A,E,z,o.pointStyleWidth&&m)}else{const A=M+Math.max((h-v)/2,0),E=l.leftForLtr(C,m),z=Er(P.borderRadius);s.beginPath(),Object.values(z).some(N=>N!==0)?nc(s,{x:E,y:A,w:m,h:v,radius:z}):s.rect(E,A,m,v),s.fill(),T!==0&&s.stroke()}s.restore()},x=function(C,M,P){zr(s,P.text,C,M+y/2,c,{strikethrough:P.hidden,textAlign:l.textAlign(P.textAlign)})},_=this.isHorizontal(),w=this._computeTitleHeight();_?p={x:$e(r,this.left+d,this.right-i[0]),y:this.top+d+w,line:0}:p={x:this.left+d,y:$e(r,this.top+w+d,this.bottom-n[0].height),line:0},IP(this.ctx,t.textDirection);const S=y+d;this.legendItems.forEach((C,M)=>{s.strokeStyle=C.fontColor||u,s.fillStyle=C.fontColor||u;const P=s.measureText(C.text).width,T=l.textAlign(C.textAlign||(C.textAlign=o.textAlign)),A=m+f+P;let E=p.x,z=p.y;l.setWidth(this.width),_?M>0&&E+A+d>this.right&&(z=p.y+=S,p.line++,E=p.x=$e(r,this.left+d,this.right-i[p.line])):M>0&&z+S>this.bottom&&(E=p.x=E+n[p.line].width+d,p.line++,z=p.y=$e(r,this.top+w+d,this.bottom-n[p.line].height));const N=l.x(E);g(N,z,C),E=RV(T,E+m+f,_?E+A:this.right,t.rtl),x(l.x(E),z,C),_?p.x+=A+d:p.y+=S}),FP(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,i=be(n.font),s=ze(n.padding);if(!n.display)return;const r=Ro(t.rtl,this.left,this.width),o=this.ctx,a=n.position,l=i.size/2,c=s.top+l;let u,d=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),u=this.top+c,d=$e(t.align,d,this.right-h);else{const p=this.columnSizes.reduce((m,v)=>Math.max(m,v.height),0);u=c+$e(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const f=$e(a,d,d+h);o.textAlign=r.textAlign(n0(a)),o.textBaseline="middle",o.strokeStyle=n.color,o.fillStyle=n.color,o.font=i.string,zr(o,n.text,f,u,i)}_computeTitleHeight(){const t=this.options.title,n=be(t.font),i=ze(t.padding);return t.display?n.lineHeight+i.height:0}_getLegendItemAt(t,n){let i,s,r;if(Yi(t,this.left,this.right)&&Yi(n,this.top,this.bottom)){for(r=this.legendHitBoxes,i=0;ie.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:i,textAlign:s,color:r}}=e.legend.options;return e._getSortedDatasetMetas().map(o=>{const a=o.controller.getStyle(n?0:void 0),l=ze(a.borderWidth);return{text:t[o.index].label,fillStyle:a.backgroundColor,fontColor:r,hidden:!o.visible,lineCap:a.borderCapStyle,lineDash:a.borderDash,lineDashOffset:a.borderDashOffset,lineJoin:a.borderJoinStyle,lineWidth:(l.width+l.height)/4,strokeStyle:a.borderColor,pointStyle:i||a.pointStyle,rotation:a.rotation,textAlign:s||a.textAlign,borderRadius:0,datasetIndex:o.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 p0 extends oi{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 i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const s=Vt(i.text)?i.text.length:1;this._padding=ze(i.padding);const r=s*be(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:i,bottom:s,right:r,options:o}=this,a=o.align;let l=0,c,u,d;return this.isHorizontal()?(u=$e(a,i,r),d=n+t,c=r-i):(o.position==="left"?(u=i+t,d=$e(a,s,n),l=qt*-.5):(u=r-t,d=$e(a,n,s),l=qt*.5),c=s-n),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const i=be(n.font),r=i.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(r);zr(t,n.text,0,0,i,{color:n.color,maxWidth:l,rotation:c,textAlign:n0(n.align),textBaseline:"middle",translation:[o,a]})}}function MH(e,t){const n=new p0({ctx:e.ctx,options:t,chart:e});Be.configure(e,n,t),Be.addBox(e,n),e.titleBlock=n}var CH={id:"title",_element:p0,start(e,t,n){MH(e,n)},stop(e){const t=e.titleBlock;Be.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const i=e.titleBlock;Be.configure(e,i,n),i.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 Pu=new WeakMap;var PH={id:"subtitle",start(e,t,n){const i=new p0({ctx:e.ctx,options:n,chart:e});Be.configure(e,i,n),Be.addBox(e,i),Pu.set(e,i)},stop(e){Be.removeBox(e,Pu.get(e)),Pu.delete(e)},beforeUpdate(e,t,n){const i=Pu.get(e);Be.configure(e,i,n),i.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Ml={average(e){if(!e.length)return!1;let t,n,i=0,s=0,r=0;for(t=0,n=e.length;t-1?e.split(` -`):e}function TH(e,t){const{element:n,datasetIndex:i,index:s}=t,r=e.getDatasetMeta(i).controller,{label:o,value:a}=r.getLabelAndValue(s);return{chart:e,label:o,parsed:r.getParsed(s),raw:e.data.datasets[i].data[s],formattedValue:a,dataset:r.getDataset(),dataIndex:s,datasetIndex:i,element:n}}function E_(e,t){const n=e.chart.ctx,{body:i,footer:s,title:r}=e,{boxWidth:o,boxHeight:a}=t,l=be(t.bodyFont),c=be(t.titleFont),u=be(t.footerFont),d=r.length,h=s.length,f=i.length,p=ze(t.padding);let m=p.height,v=0,y=i.reduce((_,w)=>_+w.before.length+w.lines.length+w.after.length,0);if(y+=e.beforeBody.length+e.afterBody.length,d&&(m+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),y){const _=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;m+=f*_+(y-f)*l.lineHeight+(y-1)*t.bodySpacing}h&&(m+=t.footerMarginTop+h*u.lineHeight+(h-1)*t.footerSpacing);let g=0;const x=function(_){v=Math.max(v,n.measureText(_).width+g)};return n.save(),n.font=c.string,At(e.title,x),n.font=l.string,At(e.beforeBody.concat(e.afterBody),x),g=t.displayColors?o+2+t.boxPadding:0,At(i,_=>{At(_.before,x),At(_.lines,x),At(_.after,x)}),g=0,n.font=u.string,At(e.footer,x),n.restore(),v+=p.width,{width:v,height:m}}function DH(e,t){const{y:n,height:i}=t;return ne.height-i/2?"bottom":"center"}function EH(e,t,n,i){const{x:s,width:r}=i,o=n.caretSize+n.caretPadding;if(e==="left"&&s+r+o>t.width||e==="right"&&s-r-o<0)return!0}function AH(e,t,n,i){const{x:s,width:r}=n,{width:o,chartArea:{left:a,right:l}}=e;let c="center";return i==="center"?c=s<=(a+l)/2?"left":"right":s<=r/2?c="left":s>=o-r/2&&(c="right"),EH(c,e,t,n)&&(c="center"),c}function A_(e,t,n){const i=n.yAlign||t.yAlign||DH(e,n);return{xAlign:n.xAlign||t.xAlign||AH(e,t,n,i),yAlign:i}}function OH(e,t){let{x:n,width:i}=e;return t==="right"?n-=i:t==="center"&&(n-=i/2),n}function LH(e,t,n){let{y:i,height:s}=e;return t==="top"?i+=n:t==="bottom"?i-=s+n:i-=s/2,i}function O_(e,t,n,i){const{caretSize:s,caretPadding:r,cornerRadius:o}=e,{xAlign:a,yAlign:l}=n,c=s+r,{topLeft:u,topRight:d,bottomLeft:h,bottomRight:f}=Er(o);let p=OH(t,a);const m=LH(t,l,c);return l==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(u,h)+s:a==="right"&&(p+=Math.max(d,f)+s),{x:ke(p,0,i.width-t.width),y:ke(m,0,i.height-t.height)}}function Pu(e,t,n){const i=ze(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-i.right:e.x+i.left}function L_(e){return ui([],Ri(e))}function RH(e,t,n){return er(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function R_(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}class Jm extends oi{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||t._chart,this._chart=this.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,i=this.options.setContext(this.getContext()),s=i.enabled&&n.options.animation&&i.animations,r=new WP(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=RH(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:i}=n,s=i.beforeTitle.apply(this,[t]),r=i.title.apply(this,[t]),o=i.afterTitle.apply(this,[t]);let a=[];return a=ui(a,Ri(s)),a=ui(a,Ri(r)),a=ui(a,Ri(o)),a}getBeforeBody(t,n){return L_(n.callbacks.beforeBody.apply(this,[t]))}getBody(t,n){const{callbacks:i}=n,s=[];return At(t,r=>{const o={before:[],lines:[],after:[]},a=R_(i,r);ui(o.before,Ri(a.beforeLabel.call(this,r))),ui(o.lines,a.label.call(this,r)),ui(o.after,Ri(a.afterLabel.call(this,r))),s.push(o)}),s}getAfterBody(t,n){return L_(n.callbacks.afterBody.apply(this,[t]))}getFooter(t,n){const{callbacks:i}=n,s=i.beforeFooter.apply(this,[t]),r=i.footer.apply(this,[t]),o=i.afterFooter.apply(this,[t]);let a=[];return a=ui(a,Ri(s)),a=ui(a,Ri(r)),a=ui(a,Ri(o)),a}_createItems(t){const n=this._active,i=this.chart.data,s=[],r=[],o=[];let a=[],l,c;for(l=0,c=n.length;lt.filter(u,d,h,i))),t.itemSort&&(a=a.sort((u,d)=>t.itemSort(u,d,i))),At(a,u=>{const d=R_(t.callbacks,u);s.push(d.labelColor.call(this,u)),r.push(d.labelPointStyle.call(this,u)),o.push(d.labelTextColor.call(this,u))}),this.labelColors=s,this.labelPointStyles=r,this.labelTextColors=o,this.dataPoints=a,a}update(t,n){const i=this.options.setContext(this.getContext()),s=this._active;let r,o=[];if(!s.length)this.opacity!==0&&(r={opacity:0});else{const a=Sl[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const l=this._size=E_(this,i),c=Object.assign({},a,l),u=A_(this.chart,i,c),d=O_(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,r={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,i,s){const r=this.getCaretPosition(t,i,s);n.lineTo(r.x1,r.y1),n.lineTo(r.x2,r.y2),n.lineTo(r.x3,r.y3)}getCaretPosition(t,n,i){const{xAlign:s,yAlign:r}=this,{caretSize:o,cornerRadius:a}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=Er(a),{x:h,y:f}=t,{width:p,height:m}=n;let v,y,g,x,_,w;return r==="center"?(_=f+m/2,s==="left"?(v=h,y=v-o,x=_+o,w=_-o):(v=h+p,y=v+o,x=_-o,w=_+o),g=v):(s==="left"?y=h+Math.max(l,u)+o:s==="right"?y=h+p-Math.max(c,d)-o:y=this.caretX,r==="top"?(x=f,_=x-o,v=y-o,g=y+o):(x=f+m,_=x+o,v=y+o,g=y-o),w=x),{x1:v,x2:y,x3:g,y1:x,y2:_,y3:w}}drawTitle(t,n,i){const s=this.title,r=s.length;let o,a,l;if(r){const c=Lo(i.rtl,this.x,this.width);for(t.x=Pu(this,i.titleAlign,i),n.textAlign=c.textAlign(i.titleAlign),n.textBaseline="middle",o=be(i.titleFont),a=i.titleSpacing,n.fillStyle=i.titleColor,n.font=o.string,l=0;lx!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,ec(t,{x:v,y:m,w:c,h:l,radius:g}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),ec(t,{x:y,y:m+1,w:c-2,h:l-2,radius:g}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(v,m,c,l),t.strokeRect(v,m,c,l),t.fillStyle=o.backgroundColor,t.fillRect(y,m+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,n,i){const{body:s}=this,{bodySpacing:r,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=i,d=be(i.bodyFont);let h=d.lineHeight,f=0;const p=Lo(i.rtl,this.x,this.width),m=function(M){n.fillText(M,p.x(t.x+f),t.y+h/2),t.y+=h+r},v=p.textAlign(o);let y,g,x,_,w,S,C;for(n.textAlign=o,n.textBaseline="middle",n.font=d.string,t.x=Pu(this,v,i),n.fillStyle=i.bodyColor,At(this.beforeBody,m),f=a&&v!=="right"?o==="center"?c/2+u:c+2+u:0,_=0,S=s.length;_0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,i=this.$animations,s=i&&i.x,r=i&&i.y;if(s||r){const o=Sl[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=E_(this,t),l=Object.assign({},o,this._size),c=A_(n,t,l),u=O_(t,l,c,n);(s._to!==u.x||r._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(n);const s={width:this.width,height:this.height},r={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=ze(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(r,t,s,n),IP(t,n.textDirection),r.y+=o.top,this.drawTitle(r,t,n),this.drawBody(r,t,n),this.drawFooter(r,t,n),FP(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const i=this._active,s=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),r=!qd(i,s),o=this._positionChanged(s,n);(r||o)&&(this._active=s,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,i=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,r=this._active||[],o=this._getActiveElements(t,r,n,i),a=this._positionChanged(o,t),l=n||!qd(o,r)||a;return l&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,i,s){const r=this.options;if(t.type==="mouseout")return[];if(!s)return n;const o=this.chart.getElementsAtEventForMode(t,r.mode,r,i);return r.reverse&&o.reverse(),o}_positionChanged(t,n){const{caretX:i,caretY:s,options:r}=this,o=Sl[r.position].call(this,t,n);return o!==!1&&(i!==o.x||s!==o.y)}}Jm.positioners=Sl;var NH={id:"tooltip",_element:Jm,positioners:Sl,afterInit(e,t,n){n&&(e.tooltip=new Jm({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)===!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:{beforeTitle:Ei,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,i=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndexe!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},jH=Object.freeze({__proto__:null,Decimation:eH,Filler:_H,Legend:SH,SubTitle:PH,Title:CH,Tooltip:NH});const $H=(e,t,n,i)=>(typeof t=="string"?(n=e.push(t)-1,i.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function IH(e,t,n,i){const s=e.indexOf(t);if(s===-1)return $H(e,t,n,i);const r=e.lastIndexOf(t);return s!==r?n:s}const FH=(e,t)=>e===null?null:ke(Math.round(e),0,t);class sh extends Xr{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const i=this.getLabels();for(const{index:s,label:r}of n)i[s]===r&&i.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(Mt(t))return null;const i=this.getLabels();return n=isFinite(n)&&i[n]===t?n:IH(i,t,ut(n,t),this._addedLabels),FH(n,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),n||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,n=this.max,i=this.options.offset,s=[];let r=this.getLabels();r=t===0&&n===r.length-1?r:r.slice(t,n+1),this._valueRange=Math.max(r.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let o=t;o<=n;o++)s.push({value:o});return s}getLabelForValue(t){const n=this.getLabels();return t>=0&&tn.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}sh.id="category";sh.defaults={ticks:{callback:sh.prototype.getLabelForValue}};function BH(e,t){const n=[],{bounds:s,step:r,min:o,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:h}=e,f=r||1,p=u-1,{min:m,max:v}=t,y=!Mt(o),g=!Mt(a),x=!Mt(c),_=(v-m)/(d+1);let w=A1((v-m)/p/f)*f,S,C,M,P;if(w<1e-14&&!y&&!g)return[{value:m},{value:v}];P=Math.ceil(v/w)-Math.floor(m/w),P>p&&(w=A1(P*w/p/f)*f),Mt(l)||(S=Math.pow(10,l),w=Math.ceil(w*S)/S),s==="ticks"?(C=Math.floor(m/w)*w,M=Math.ceil(v/w)*w):(C=m,M=v),y&&g&&r&&CV((a-o)/r,w/1e3)?(P=Math.round(Math.min((a-o)/w,u)),w=(a-o)/P,C=o,M=a):x?(C=y?o:C,M=g?a:M,P=c-1,w=(M-C)/P):(P=(M-C)/w,_l(P,Math.round(P),w/1e3)?P=Math.round(P):P=Math.ceil(P));const T=Math.max(O1(w),O1(C));S=Math.pow(10,Mt(l)?T:l),C=Math.round(C*S)/S,M=Math.round(M*S)/S;let A=0;for(y&&(h&&C!==o?(n.push({value:o}),Cs=n?s:l,a=l=>r=i?r:l;if(t){const l=_i(s),c=_i(r);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(s===r){let l=1;(r>=Number.MAX_SAFE_INTEGER||s<=Number.MIN_SAFE_INTEGER)&&(l=Math.abs(r*.05)),a(r+l),t||o(s-l)}this.min=s,this.max=r}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:i}=t,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),n=n||11),n&&(s=Math.min(n,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,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},r=this._range||this,o=BH(s,r);return t.bounds==="ticks"&&gP(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,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-n)/Math.max(t.length-1,1)/2;n-=s,i+=s}this._startValue=n,this._endValue=i,this._valueRange=i-n}getLabelForValue(t){return wc(t,this.chart.options.locale,this.options.ticks.format)}}class m0 extends rh{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=de(t)?t:0,this.max=de(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,i=ti(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,r.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}m0.id="linear";m0.defaults={ticks:{callback:Gh.formatters.numeric}};function j_(e){return e/Math.pow(10,Math.floor(jn(e)))===1}function VH(e,t){const n=Math.floor(jn(t.max)),i=Math.ceil(t.max/Math.pow(10,n)),s=[];let r=On(e.min,Math.pow(10,Math.floor(jn(t.min)))),o=Math.floor(jn(r)),a=Math.floor(r/Math.pow(10,o)),l=o<0?Math.pow(10,Math.abs(o)):1;do s.push({value:r,major:j_(r)}),++a,a===10&&(a=1,++o,l=o>=0?1:l),r=Math.round(a*Math.pow(10,o)*l)/l;while(o0?i:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=de(t)?Math.max(0,t):null,this.max=de(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let i=this.min,s=this.max;const r=l=>i=t?i:l,o=l=>s=n?s:l,a=(l,c)=>Math.pow(10,Math.floor(jn(l))+c);i===s&&(i<=0?(r(1),o(10)):(r(a(i,-1)),o(a(s,1)))),i<=0&&r(a(s,-1)),s<=0&&o(a(i,1)),this._zero&&this.min!==this._suggestedMin&&i===a(this.min,0)&&r(a(i,-1)),this.min=i,this.max=s}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},i=VH(n,this);return t.bounds==="ticks"&&gP(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":wc(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=jn(t),this._valueRange=jn(this.max)-jn(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(jn(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}g0.id="logarithmic";g0.defaults={ticks:{callback:Gh.formatters.logarithmic,major:{enabled:!0}}};function tg(e){const t=e.ticks;if(t.display&&e.display){const n=ze(t.backdropPadding);return ut(t.font&&t.font.size,_t.font.size)+n.height}return 0}function zH(e,t,n){return n=Vt(n)?n:[n],{w:sz(e,t.string,n),h:n.length*t.lineHeight}}function $_(e,t,n,i,s){return e===i||e===s?{start:t-n/2,end:t+n/2}:es?{start:t-n,end:t}:{start:t,end:t+n}}function WH(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),i=[],s=[],r=e._pointLabels.length,o=e.options.pointLabels,a=o.centerPointLabels?qt/r:0;for(let l=0;lt.r&&(a=(i.end-t.r)/r,e.r=Math.max(e.r,t.r+a)),s.startt.b&&(l=(s.end-t.b)/o,e.b=Math.max(e.b,t.b+l))}function UH(e,t,n){const i=[],s=e._pointLabels.length,r=e.options,o=tg(r)/2,a=e.drawingArea,l=r.pointLabels.centerPointLabels?qt/s:0;for(let c=0;c270||n<90)&&(e-=t),e}function GH(e,t){const{ctx:n,options:{pointLabels:i}}=e;for(let s=t-1;s>=0;s--){const r=i.setContext(e.getPointLabelContext(s)),o=be(r.font),{x:a,y:l,textAlign:c,left:u,top:d,right:h,bottom:f}=e._pointLabelItems[s],{backdropColor:p}=r;if(!Mt(p)){const m=Er(r.borderRadius),v=ze(r.backdropPadding);n.fillStyle=p;const y=u-v.left,g=d-v.top,x=h-u+v.width,_=f-d+v.height;Object.values(m).some(w=>w!==0)?(n.beginPath(),ec(n,{x:y,y:g,w:x,h:_,radius:m}),n.fill()):n.fillRect(y,g,x,_)}zr(n,e._pointLabels[s],a,l+o.lineHeight/2,o,{color:r.color,textAlign:c,textBaseline:"middle"})}}function uT(e,t,n,i){const{ctx:s}=e;if(n)s.arc(e.xCenter,e.yCenter,t,0,Nt);else{let r=e.getPointPosition(0,t);s.moveTo(r.x,r.y);for(let o=1;o{const s=Ft(this.options.pointLabels.callback,[n,i],this);return s||s===0?s:""}).filter((n,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?WH(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,i,s){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,i,s))}getIndexAngle(t){const n=Nt/(this._pointLabels.length||1),i=this.options.startAngle||0;return vn(t*n+ti(i))}getDistanceFromCenterForValue(t){if(Mt(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(Mt(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{if(u!==0){a=this.getDistanceFromCenterForValue(c.value);const d=s.setContext(this.getContext(u-1));qH(this,d,a,r)}}),i.display){for(t.save(),o=r-1;o>=0;o--){const c=i.setContext(this.getPointLabelContext(o)),{color:u,lineWidth:d}=c;!d||!u||(t.lineWidth=d,t.strokeStyle=u,t.setLineDash(c.borderDash),t.lineDashOffset=c.borderDashOffset,a=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),l=this.getPointPosition(o,a),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,i=n.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let r,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&!n.reverse)return;const c=i.setContext(this.getContext(l)),u=be(c.font);if(r=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,o=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const d=ze(c.backdropPadding);t.fillRect(-o/2-d.left,-r-u.size/2-d.top,o+d.width,u.size+d.height)}zr(t,a.label,0,-r,u,{color:c.color})}),t.restore()}drawTitle(){}}Sc.id="radialLinear";Sc.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Gh.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(e){return e},padding:5,centerPointLabels:!1}};Sc.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};Sc.descriptors={angleLines:{_fallback:"grid"}};const tf={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}},en=Object.keys(tf);function ZH(e,t){return e-t}function I_(e,t){if(Mt(t))return null;const n=e._adapter,{parser:i,round:s,isoWeekday:r}=e._parseOpts;let o=t;return typeof i=="function"&&(o=i(o)),de(o)||(o=typeof i=="string"?n.parse(o,i):n.parse(o)),o===null?null:(s&&(o=s==="week"&&(ta(r)||r===!0)?n.startOf(o,"isoWeek",r):n.startOf(o,s)),+o)}function F_(e,t,n,i){const s=en.length;for(let r=en.indexOf(e);r=en.indexOf(n);r--){const o=en[r];if(tf[o].common&&e._adapter.diff(s,i,o)>=t-1)return o}return en[n?en.indexOf(n):0]}function t3(e){for(let t=en.indexOf(e)+1,n=en.length;t=t?n[i]:n[s];e[r]=!0}}function e3(e,t,n,i){const s=e._adapter,r=+s.startOf(t[0].value,i),o=t[t.length-1].value;let a,l;for(a=r;a<=o;a=+s.add(a,1,i))l=n[a],l>=0&&(t[l].major=!0);return t}function V_(e,t,n){const i=[],s={},r=t.length;let o,a;for(o=0;o+t.value))}initOffsets(t){let n=0,i=0,s,r;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?n=1-s:n=(this.getDecimalForValue(t[1])-s)/2,r=this.getDecimalForValue(t[t.length-1]),t.length===1?i=r:i=(r-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;n=ke(n,0,o),i=ke(i,0,o),this._offsets={start:n,end:i,factor:1/(n+1+i)}}_generate(){const t=this._adapter,n=this.min,i=this.max,s=this.options,r=s.time,o=r.unit||F_(r.minUnit,n,i,this._getLabelCapacity(n)),a=ut(r.stepSize,1),l=o==="week"?r.isoWeekday:!1,c=ta(l)||l===!0,u={};let d=n,h,f;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":o),t.diff(i,n,o)>1e5*a)throw new Error(n+" and "+i+" are too far apart with stepSize of "+a+" "+o);const p=s.ticks.source==="data"&&this.getDataTimestamps();for(h=d,f=0;hm-v).map(m=>+m)}getLabelForValue(t){const n=this._adapter,i=this.options.time;return i.tooltipFormat?n.format(t,i.tooltipFormat):n.format(t,i.displayFormats.datetime)}_tickFormatFunction(t,n,i,s){const r=this.options,o=r.time.displayFormats,a=this._unit,l=this._majorUnit,c=a&&o[a],u=l&&o[l],d=i[n],h=l&&u&&d&&d.major,f=this._adapter.format(t,s||(h?u:c)),p=r.ticks.callback;return p?Ft(p,[f,n,i],this):f}generateTickLabels(t){let n,i,s;for(n=0,i=t.length;n0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,i;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(n=0,i=s.length;n=e[i].pos&&t<=e[s].pos&&({lo:i,hi:s}=Xi(e,"pos",t)),{pos:r,time:a}=e[i],{pos:o,time:l}=e[s]):(t>=e[i].time&&t<=e[s].time&&({lo:i,hi:s}=Xi(e,"time",t)),{time:r,pos:a}=e[i],{time:o,pos:l}=e[s]);const c=o-r;return c?a+(l-a)*(t-r)/c:a}class y0 extends Mc{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=Tu(n,this.min),this._tableRange=Tu(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:i}=this,s=[],r=[];let o,a,l,c,u;for(o=0,a=t.length;o=n&&c<=i&&s.push(c);if(s.length<2)return[{time:n,pos:0},{time:i,pos:1}];for(o=0,a=s.length;o.dropdown-menu{right:0!important}.select-input-label-active{color:#1266f1!important}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();const g3=Y.forwardRef(({breakpoint:e,fluid:t,children:n,className:i,tag:s="div",...r},o)=>{const a=I(`${t?"container-fluid":`container${e?"-"+e:""}`}`,i);return b.jsx(s,{className:a,...r,ref:o,children:n})});g3.displayName="MDBContainer";const y3=Y.forwardRef(({center:e,children:t,className:n,end:i,lg:s,md:r,offsetLg:o,offsetMd:a,offsetSm:l,order:c,size:u,sm:d,start:h,tag:f="div",xl:p,xxl:m,xs:v,...y},g)=>{const x=I(u&&`col-${u}`,v&&`col-xs-${v}`,d&&`col-sm-${d}`,r&&`col-md-${r}`,s&&`col-lg-${s}`,p&&`col-xl-${p}`,m&&`col-xxl-${m}`,!u&&!v&&!d&&!r&&!s&&!p&&!m?"col":"",c&&`order-${c}`,h&&"align-self-start",e&&"align-self-center",i&&"align-self-end",l&&`offset-sm-${l}`,a&&`offset-md-${a}`,o&&`offset-lg-${o}`,n);return b.jsx(f,{className:x,ref:g,...y,children:t})});y3.displayName="MDBCol";const v3=Y.forwardRef(({className:e,color:t="primary",pill:n,light:i,dot:s,tag:r="span",children:o,notification:a,...l},c)=>{const u=I("badge",i?t&&`badge-${t}`:t&&`bg-${t}`,s&&"badge-dot",n&&"rounded-pill",a&&"badge-notification",e);return b.jsx(r,{className:u,ref:c,...l,children:o})});v3.displayName="MDBBadge";const x3=({...e})=>{const[t,n]=k.useState(!1),i=I("ripple-wave",t&&"active");return k.useEffect(()=>{const s=setTimeout(()=>{n(!0)},50);return()=>{clearTimeout(s)}},[]),b.jsx("div",{className:i,...e})},b3=(...e)=>{const t=Y.useRef();return Y.useEffect(()=>{e.forEach(n=>{n&&(typeof n=="function"?n(t.current):n.current=t.current)})},[e]),t},v0=Y.forwardRef(({className:e,rippleTag:t="div",rippleCentered:n,rippleDuration:i=500,rippleUnbound:s,rippleRadius:r=0,rippleColor:o="dark",children:a,onMouseDown:l,...c},u)=>{const d=k.useRef(null),h=b3(u,d),f="rgba({{color}}, 0.2) 0, rgba({{color}}, 0.3) 40%, rgba({{color}}, 0.4) 50%, rgba({{color}}, 0.5) 60%, rgba({{color}}, 0) 70%",p=[0,0,0],m=["primary","secondary","success","danger","warning","info","light","dark"],[v,y]=k.useState([]),[g,x]=k.useState(!1),_=I("ripple","ripple-surface",s&&"ripple-surface-unbound",g&&`ripple-surface-${o}`,e),w=()=>{if(m.find(T=>T===(o==null?void 0:o.toLowerCase())))return x(!0);{const T=S(o).join(",");return`radial-gradient(circle, ${f.split("{{color}}").join(`${T}`)})`}},S=T=>{const A=N=>(N.length<7&&(N=`#${N[1]}${N[1]}${N[2]}${N[2]}${N[3]}${N[3]}`),[parseInt(N.substr(1,2),16),parseInt(N.substr(3,2),16),parseInt(N.substr(5,2),16)]),E=N=>{const L=document.body.appendChild(document.createElement("fictum")),R="rgb(1, 2, 3)";return L.style.color=R,L.style.color!==R||(L.style.color=N,L.style.color===R||L.style.color==="")?p:(N=getComputedStyle(L).color,document.body.removeChild(L),N)},z=N=>(N=N.match(/[.\d]+/g).map(L=>+Number(L)),N.length=3,N);return T.toLowerCase()==="transparent"?p:T[0]==="#"?A(T):(T.indexOf("rgb")===-1&&(T=E(T)),T.indexOf("rgb")===0?z(T):p)},C=T=>{const{offsetX:A,offsetY:E,height:z,width:N}=T,L=E<=z/2,R=A<=N/2,B=(W,et)=>Math.sqrt(W**2+et**2),D=E===z/2&&A===N/2,$={first:L===!0&&R===!1,second:L===!0&&R===!0,third:L===!1&&R===!0,fourth:L===!1&&R===!1},F={topLeft:B(A,E),topRight:B(N-A,E),bottomLeft:B(A,z-E),bottomRight:B(N-A,z-E)};let V=0;return D||$.fourth?V=F.topLeft:$.third?V=F.topRight:$.second?V=F.bottomRight:$.first&&(V=F.bottomLeft),V*2},M=T=>{var A;const E=(A=h.current)==null?void 0:A.getBoundingClientRect(),z=T.clientX-E.left,N=T.clientY-E.top,L=E.height,R=E.width,B={offsetX:n?L/2:z,offsetY:n?R/2:N,height:L,width:R},D={delay:i&&i*.5,duration:i&&i-i*.5},$=C(B),F=r||$/2,V={left:n?`${R/2-F}px`:`${z-F}px`,top:n?`${L/2-F}px`:`${N-F}px`,height:r?`${r*2}px`:`${$}px`,width:r?`${r*2}px`:`${$}px`,transitionDelay:`0s, ${D.delay}ms`,transitionDuration:`${i}ms, ${D.duration}ms`};return g?V:{...V,backgroundImage:`${w()}`}},P=T=>{const A=M(T),E=v.concat(A);y(E),l&&l(T)};return k.useEffect(()=>{const T=setTimeout(()=>{v.length>0&&y(v.splice(1,v.length-1))},i);return()=>{clearTimeout(T)}},[i,v]),b.jsxs(t,{className:_,onMouseDown:T=>P(T),ref:h,...c,children:[a,v.map((T,A)=>b.jsx(x3,{style:T},A))]})});v0.displayName="MDBRipple";const Zt=Y.forwardRef(({className:e,color:t="primary",outline:n,children:i,rounded:s,disabled:r,floating:o,size:a,href:l,block:c,active:u,toggle:d,noRipple:h,tag:f="button",role:p="button",...m},v)=>{const[y,g]=k.useState(u||!1);let x;const _=t&&["light","link"].includes(t)||n?"dark":"light";t!=="none"?n?t?x=`btn-outline-${t}`:x="btn-outline-primary":t?x=`btn-${t}`:x="btn-primary":x="";const w=I(t!=="none"&&"btn",x,s&&"btn-rounded",o&&"btn-floating",a&&`btn-${a}`,`${(l||f!=="button")&&r?"disabled":""}`,c&&"btn-block",y&&"active",e);return l&&f!=="a"&&(f="a"),["hr","img","input"].includes(f)||h?b.jsx(f,{className:w,onClick:d?()=>{g(!y)}:void 0,disabled:r&&f==="button"?!0:void 0,href:l,ref:v,role:p,...m,children:i}):b.jsx(v0,{rippleTag:f,rippleColor:_,className:w,onClick:d?()=>{g(!y)}:void 0,disabled:r&&f==="button"?!0:void 0,href:l,ref:v,role:p,...m,children:i})});Zt.displayName="MDBBtn";const _3=Y.forwardRef(({className:e,children:t,shadow:n,toolbar:i,size:s,vertical:r,tag:o="div",role:a="group",...l},c)=>{let u;i?u="btn-toolbar":r?u="btn-group-vertical":u="btn-group";const d=I(u,n&&`shadow-${n}`,s&&`btn-group-${s}`,e);return b.jsx(o,{className:d,ref:c,role:a,...l,children:t})});_3.displayName="MDBBtnGroup";const hT=Y.forwardRef(({className:e,children:t,tag:n="div",color:i,grow:s,size:r,...o},a)=>{const l=I(`${s?"spinner-grow":"spinner-border"}`,i&&`text-${i}`,`${r?s?"spinner-grow-"+r:"spinner-border-"+r:""}`,e);return b.jsx(n,{className:l,ref:a,...o,children:t})});hT.displayName="MDBSpinner";const rd=Y.forwardRef(({className:e,children:t,border:n,background:i,tag:s="div",shadow:r,alignment:o,...a},l)=>{const c=I("card",n&&`border border-${n}`,i&&`bg-${i}`,r&&`shadow-${r}`,o&&`text-${o}`,e);return b.jsx(s,{className:c,ref:l,...a,children:t})});rd.displayName="MDBCard";const od=Y.forwardRef(({className:e,children:t,border:n,background:i,tag:s="div",...r},o)=>{const a=I("card-header",n&&`border-${n}`,i&&`bg-${i}`,e);return b.jsx(s,{className:a,...r,ref:o,children:t})});od.displayName="MDBCardHeader";const w3=Y.forwardRef(({className:e,children:t,tag:n="p",...i},s)=>{const r=I("card-subtitle",e);return b.jsx(n,{className:r,...i,ref:s,children:t})});w3.displayName="MDBCardSubTitle";const fT=Y.forwardRef(({className:e,children:t,tag:n="h5",...i},s)=>{const r=I("card-title",e);return b.jsx(n,{className:r,...i,ref:s,children:t})});fT.displayName="MDBCardTitle";const ad=Y.forwardRef(({className:e,children:t,tag:n="p",...i},s)=>{const r=I("card-text",e);return b.jsx(n,{className:r,...i,ref:s,children:t})});ad.displayName="MDBCardText";const eg=Y.forwardRef(({className:e,children:t,tag:n="div",...i},s)=>{const r=I("card-body",e);return b.jsx(n,{className:r,...i,ref:s,children:t})});eg.displayName="MDBCardBody";const k3=Y.forwardRef(({className:e,children:t,border:n,background:i,tag:s="div",...r},o)=>{const a=I("card-footer",n&&`border-${n}`,i&&`bg-${i}`,e);return b.jsx(s,{className:a,...r,ref:o,children:t})});k3.displayName="MDBCardFooter";const S3=Y.forwardRef(({className:e,children:t,tag:n="div",...i},s)=>{const r=I("card-img-overlay",e);return b.jsx(n,{className:r,...i,ref:s,children:t})});S3.displayName="MDBCardOverlay";const M3=Y.forwardRef(({className:e,children:t,tag:n="div",...i},s)=>{const r=I("card-group",e);return b.jsx(n,{className:r,...i,ref:s,children:t})});M3.displayName="MDBCardGroup";const C3=Y.forwardRef(({className:e,tag:t="ul",horizontal:n,horizontalSize:i,light:s,numbered:r,children:o,small:a,...l},c)=>{const u=I("list-group",n&&(i?`list-group-horizontal-${i}`:"list-group-horizontal"),s&&"list-group-light",r&&"list-group-numbered",a&&"list-group-small",e);return b.jsx(t,{className:u,ref:c,...l,children:o})});C3.displayName="MDBListGroup";const P3=Y.forwardRef(({className:e,tag:t="li",active:n,disabled:i,action:s,color:r,children:o,noBorders:a,...l},c)=>{const u=t==="button",d=I("list-group-item",n&&"active",i&&!u&&"disabled",s&&"list-group-item-action",r&&`list-group-item-${r}`,a&&"border-0",e);return b.jsx(t,{className:d,disabled:u&&i,ref:c,...l,children:o})});P3.displayName="MDBListGroupItem";const aa=({children:e,containerRef:t,disablePortal:n})=>{const[i,s]=k.useState(!1);return k.useEffect(()=>{!n&&s(!0)},[n]),n?b.jsx(b.Fragment,{children:e}):i?iy.createPortal(b.jsx(b.Fragment,{children:e}),(t==null?void 0:t.current)||document.body):null},T3=Y.forwardRef(({around:e,between:t,bottom:n,center:i,children:s,className:r,evenly:o,end:a,middle:l,start:c,tag:u="div",top:d,...h},f)=>{const p=I("row",e&&"justify-content-around",t&&"justify-content-between",n&&"align-self-end",i&&"justify-content-center",o&&"justifty-content-evenly",a&&"justify-content-end",l&&"align-self-center",c&&"justify-content-start",d&&"align-self-start",r);return b.jsx(u,{className:p,...h,ref:f,children:s})});T3.displayName="MDBRow";const sn=({animate:e,className:t,icon:n,fab:i,fas:s,fal:r,far:o,flag:a,spin:l,fixed:c,flip:u,list:d,size:h,pull:f,pulse:p,color:m,border:v,rotate:y,inverse:g,stack:x,iconType:_,children:w,...S})=>{let C;a?C="flag":i?C="fab":s?C="fas":o?C="far":r?C="fal":C="fa";const M=I(_?`fa-${_}`:C,e&&`fa-${e}`,a?`flag-${a}`:n&&`fa-${n}`,h&&`fa-${h}`,m&&`text-${m}`,v&&"fa-border",y&&`fa-rotate-${y}`,f&&`fa-pull-${f}`,l&&!e&&"fa-spin",d&&"fa-li",c&&"fa-fw",p&&!e&&"fa-pulse",g&&"fa-inverse",u&&`fa-flip-${u}`,x&&`fa-stack-${x}`,t);return b.jsx("i",{className:M,...S,children:w})},D3=Y.forwardRef(({className:e,children:t,tag:n="p",variant:i,color:s,blockquote:r,note:o,noteColor:a,listUnStyled:l,listInLine:c,...u},d)=>{const h=I(i&&i,r&&"blockquote",o&&"note",s&&`text-${s}`,a&&`note-${a}`,l&&"list-unstyled",c&&"list-inline",e);return r&&(n="blockquote"),(l||c)&&(n="ul"),b.jsx(n,{className:h,ref:d,...u,children:t})});D3.displayName="MDBTypography";const E3=Y.forwardRef(({className:e,color:t,uppercase:n,bold:i,children:s,...r},o)=>{const a=I("breadcrumb",i&&"font-weight-bold",t&&`text-${t}`,n&&"text-uppercase",e);return b.jsx("nav",{"aria-label":"breadcrumb",children:b.jsx("ol",{className:a,ref:o,...r,children:s})})});E3.displayName="MDBBreadcrumb";const A3=Y.forwardRef(({className:e,active:t,current:n="page",children:i,...s},r)=>{const o=I("breadcrumb-item",t&&"active",e);return b.jsx("li",{className:o,ref:r,"aria-current":t&&n,...s,children:i})});A3.displayName="MDBBreadcrumbItem";const O3=e=>{if(e!==!1)return`navbar-expand-${e}`},pT=Y.forwardRef(({className:e,children:t,light:n,dark:i,scrolling:s,fixed:r,sticky:o,scrollingNavbarOffset:a,color:l,transparent:c,expand:u,tag:d="nav",bgColor:h,...f},p)=>{const[m,v]=k.useState(!1),y=I({"navbar-light":n,"navbar-dark":i,"scrolling-navbar":s||a,"top-nav-collapse":m,[`text-${l}`]:l&&c?m:l},r&&`fixed-${r}`,o&&"sticky-top","navbar",u&&O3(u),h&&`bg-${h}`,e),g=k.useCallback(()=>{a&&window.pageYOffset>a?v(!0):v(!1)},[a]);return k.useEffect(()=>((s||a)&&window.addEventListener("scroll",g),()=>{window.removeEventListener("scroll",g)}),[g,s,a]),b.jsx(d,{className:y,role:"navigation",...f,ref:p,children:t})});pT.displayName="MDBNavbar";const L3=Y.forwardRef(({children:e,className:t="",disabled:n=!1,active:i=!1,tag:s="a",...r},o)=>{const a=I("nav-link",n?"disabled":i?"active":"",t);return b.jsx(s,{"data-test":"nav-link",className:a,style:{cursor:"pointer"},ref:o,...r,children:e})});L3.displayName="MDBNavbarLink";const R3=Y.forwardRef(({className:e,children:t,tag:n="a",...i},s)=>{const r=I("navbar-brand",e);return b.jsx(n,{className:r,ref:s,...i,children:t})});R3.displayName="MDBNavbarBrand";const N3=Y.forwardRef(({children:e,className:t,active:n,text:i,tag:s="li",...r},o)=>{const a=I("nav-item",n&&"active",i&&"navbar-text",t);return b.jsx(s,{...r,className:a,ref:o,children:e})});N3.displayName="MDBNavbarItem";const j3=Y.forwardRef(({children:e,className:t,right:n,fullWidth:i=!0,left:s,tag:r="ul",...o},a)=>{const l=I("navbar-nav",i&&"w-100",n&&"ms-auto",s&&"me-auto",t);return b.jsx(r,{className:l,ref:a,...o,children:e})});j3.displayName="MDBNavbarNav";const $3=Y.forwardRef(({children:e,className:t,tag:n="button",...i},s)=>{const r=I("navbar-toggler",t);return b.jsx(n,{...i,className:r,ref:s,children:e})});$3.displayName="MDBNavbarToggler";const I3=Y.forwardRef(({children:e,bgColor:t,color:n,className:i,...s},r)=>{const o=I(t&&`bg-${t}`,n&&`text-${n}`,i);return b.jsx("footer",{className:o,...s,ref:r,children:e})});I3.displayName="MDBFooter";const F3=Y.forwardRef(({children:e,size:t,circle:n,center:i,end:s,start:r,className:o,...a},l)=>{const c=I("pagination",i&&"justify-content-center",n&&"pagination-circle",s&&"justify-content-end",t&&`pagination-${t}`,r&&"justify-content-start",o);return b.jsx("ul",{className:c,...a,ref:l,children:e})});F3.displayName="MDBPagination";const B3=Y.forwardRef(({children:e,className:t,tag:n="a",...i},s)=>{const r=I("page-link",t);return b.jsx(n,{className:r,...i,ref:s,children:e})});B3.displayName="MDBPaginationLink";const V3=Y.forwardRef(({children:e,className:t,active:n,disabled:i,...s},r)=>{const o=I("page-item",n&&"active",i&&"disabled",t);return b.jsx("li",{className:o,...s,ref:r,children:e})});V3.displayName="MDBPaginationItem";const z3=({className:e,classNameResponsive:t,responsive:n,align:i,borderColor:s,bordered:r,borderless:o,children:a,color:l,hover:c,small:u,striped:d,...h})=>{const f=I("table",i&&`align-${i}`,s&&`border-${s}`,r&&"table-bordered",o&&"table-borderless",l&&`table-${l}`,c&&"table-hover",u&&"table-sm",d&&"table-striped",e),p=k.useMemo(()=>b.jsx("table",{className:f,...h,children:a}),[a,f,h]);if(n){const m=I(typeof n=="string"?`table-responsive-${n}`:"table-responsive",t);return b.jsx("div",{className:m,children:p})}else return p},W3=({className:e,children:t,dark:n,light:i,...s})=>{const r=I(n&&"table-dark",i&&"table-light",e);return b.jsx("thead",{className:r,...s,children:t})},H3=({className:e,children:t,...n})=>{const i=I(e);return b.jsx("tbody",{className:i,...n,children:t})},mT=Y.forwardRef(({animated:e,children:t,className:n,style:i,tag:s="div",valuenow:r,valuemax:o,striped:a,bgColor:l,valuemin:c,width:u,...d},h)=>{const f=I("progress-bar",l&&`bg-${l}`,a&&"progress-bar-striped",e&&"progress-bar-animated",n),p={width:`${u}%`,...i};return b.jsx(s,{className:f,style:p,ref:h,role:"progressbar",...d,"aria-valuenow":Number(u)??r,"aria-valuemin":Number(c),"aria-valuemax":Number(o),children:t})});mT.displayName="MDBProgressBar";const U3=Y.forwardRef(({className:e,children:t,tag:n="div",height:i,style:s,...r},o)=>{const a=I("progress",e),l={height:`${i}px`,...s};return b.jsx(n,{className:a,ref:o,style:l,...r,children:Y.Children.map(t,c=>{if(!Y.isValidElement(c)||c.type!==mT){console.error("Progress component only allows ProgressBar as child");return}else return c})})});U3.displayName="MDBProgress";const Y3=e=>{const[t,n]=k.useState(!1),[i,s]=k.useState(null);return k.useEffect(()=>{s(()=>new IntersectionObserver(([r])=>{n(r.isIntersecting)}))},[]),k.useEffect(()=>{if(!(!e.current||!i))return i.observe(e.current),()=>i.disconnect()},[i,e]),t},ef=(e,t)=>k.useMemo(()=>t!==void 0?t:e,[t,e]),wi=Y.forwardRef(({className:e,size:t,contrast:n,value:i,defaultValue:s,id:r,labelClass:o,wrapperClass:a,wrapperStyle:l,wrapperTag:c="div",label:u,onChange:d,children:h,labelRef:f,labelStyle:p,type:m,onBlur:v,readonly:y=!1,showCounter:g=!1,...x},_)=>{var w;const[S,C]=k.useState(s),M=k.useMemo(()=>i!==void 0?i:S,[i,S]),[P,T]=k.useState(0),[A,E]=k.useState(!1),[z,N]=k.useState(0),L=k.useRef(null),R=Y3(L),B=k.useRef(null),D=f||B;k.useImperativeHandle(_,()=>L.current);const $=I("form-outline",n&&"form-white",a),F=I("form-control",A&&"active",m==="date"&&"active",t&&`form-control-${t}`,e),V=I("form-label",o),W=k.useCallback(()=>{var O;(O=D.current)!=null&&O.clientWidth&&T(D.current.clientWidth*.8+8)},[D]),et=O=>{C(O.target.value),g&&N(O.target.value.length),d==null||d(O)},Z=k.useCallback(O=>{L.current&&(E(!!M),v&&v(O))},[M,v]);return k.useEffect(()=>{W()},[(w=D.current)==null?void 0:w.clientWidth,W,R]),k.useEffect(()=>{if(M)return E(!0);E(!1)},[M]),b.jsxs(c,{className:$,style:l,children:[b.jsx("input",{type:m,readOnly:y,className:F,onBlur:Z,onChange:et,onFocus:W,value:i,defaultValue:s,id:r,ref:L,...x}),u&&b.jsx("label",{className:V,style:p,htmlFor:r,ref:D,children:u}),b.jsxs("div",{className:"form-notch",children:[b.jsx("div",{className:"form-notch-leading"}),b.jsx("div",{className:"form-notch-middle",style:{width:P}}),b.jsx("div",{className:"form-notch-trailing"})]}),h,g&&x.maxLength&&b.jsx("div",{className:"form-helper",children:b.jsx("div",{className:"form-counter",children:`${z}/${x.maxLength}`})})]})});wi.displayName="MDBInput";const gT=k.forwardRef(({className:e,inputRef:t,labelClass:n,wrapperClass:i,labelStyle:s,wrapperTag:r="div",wrapperStyle:o,label:a,inline:l,btn:c,id:u,btnColor:d,disableWrapper:h,toggleSwitch:f,...p},m)=>{let v="form-check-input",y="form-check-label";c&&(v="btn-check",d?y=`btn btn-${d}`:y="btn btn-primary");const g=I(a&&!c&&"form-check",l&&!c&&"form-check-inline",f&&"form-switch",i),x=I(v,e),_=I(y,n),w=b.jsxs(b.Fragment,{children:[b.jsx("input",{className:x,id:u,ref:t,...p}),a&&b.jsx("label",{className:_,style:s,htmlFor:u,children:a})]});return b.jsx(b.Fragment,{children:h?w:b.jsx(r,{style:o,className:g,ref:m,children:w})})});gT.displayName="InputTemplate";const oh=({...e})=>b.jsx(gT,{type:"checkbox",...e}),X3=({className:e,children:t,open:n=!1,id:i,navbar:s,tag:r="div",collapseRef:o,style:a,onOpen:l,onClose:c,...u})=>{const[d,h]=k.useState(!1),[f,p]=k.useState(void 0),[m,v]=k.useState(!1),y=I(m?"collapsing":"collapse",!m&&d&&"show",s&&"navbar-collapse",e),g=k.useRef(null),x=o??g,_=k.useCallback(()=>{d&&p(void 0)},[d]);return k.useEffect(()=>{var w;f===void 0&&d&&p((w=x==null?void 0:x.current)==null?void 0:w.scrollHeight)},[f,d,x]),k.useEffect(()=>{d!==n&&(n?l==null||l():c==null||c(),h(n)),d&&v(!0);const w=setTimeout(()=>{v(!1)},350);return()=>{clearTimeout(w)}},[n,d,l,c]),k.useEffect(()=>{var w;p(d?(w=x==null?void 0:x.current)==null?void 0:w.scrollHeight:0)},[d,x,t]),k.useEffect(()=>(window.addEventListener("resize",_),()=>{window.removeEventListener("resize",_)}),[_]),b.jsx(r,{style:{height:f,...a},id:i,className:y,...u,ref:x,children:t})};k.createContext(null);const K3=Y.forwardRef(({className:e,children:t,tag:n="div",...i},s)=>{const r=I("modal-content",e);return b.jsx(n,{className:r,...i,ref:s,children:t})});K3.displayName="MDBModalContent";const G3=Y.forwardRef(({className:e,children:t,tag:n="div",...i},s)=>{const r=I("modal-header",e);return b.jsx(n,{className:r,...i,ref:s,children:t})});G3.displayName="MDBModalHeader";const q3=Y.forwardRef(({className:e,children:t,tag:n="h5",...i},s)=>{const r=I("modal-title",e);return b.jsx(n,{className:r,...i,ref:s,children:t})});q3.displayName="MDBModalTitle";const Q3=Y.forwardRef(({className:e,children:t,tag:n="div",...i},s)=>{const r=I("modal-body",e);return b.jsx(n,{className:r,...i,ref:s,children:t})});Q3.displayName="MDBModalBody";const Z3=Y.forwardRef(({className:e,children:t,tag:n="div",...i},s)=>{const r=I("modal-footer",e);return b.jsx(n,{className:r,...i,ref:s,children:t})});Z3.displayName="MDBModalFooter";Y.createContext({activeElement:null,setTargets:null});const J3=k.forwardRef(({className:e,labelClass:t,labelStyle:n,inputRef:i,size:s,label:r,id:o,...a},l)=>{const c=I("form-control",`form-control-${s}`,e),u=I("form-label",t),d=k.useRef(null);return k.useImperativeHandle(l,()=>d.current||(i==null?void 0:i.current)),b.jsxs(b.Fragment,{children:[r&&b.jsx("label",{className:u,style:n,htmlFor:o,children:r}),b.jsx("input",{className:c,type:"file",id:o,ref:d,...a})]})});J3.displayName="MDBFile";const yT=Y.forwardRef(({className:e,children:t,noBorder:n,textBefore:i,textAfter:s,noWrap:r,tag:o="div",textTag:a="span",textClass:l,size:c,textProps:u,...d},h)=>{const f=I("input-group",r&&"flex-nowrap",c&&`input-group-${c}`,e),p=I("input-group-text",n&&"border-0",l),m=v=>b.jsx(b.Fragment,{children:v&&Array.isArray(v)?v.map((y,g)=>b.jsx(a,{className:p,...u,children:y},g)):b.jsx(a,{className:p,...u,children:v})});return b.jsxs(o,{className:f,ref:h,...d,children:[i&&m(i),t,s&&m(s)]})});yT.displayName="MDBInputGroup";const t4=Y.forwardRef(({className:e,children:t,isValidated:n=!1,onReset:i,onSubmit:s,noValidate:r=!0,...o},a)=>{const[l,c]=k.useState(n),u=I("needs-validation",l&&"was-validated",e),d=f=>{f.preventDefault(),c(!0),s&&s(f)},h=f=>{f.preventDefault(),c(!1),i&&i(f)};return k.useEffect(()=>{c(n)},[n]),b.jsx("form",{className:u,onSubmit:d,onReset:h,ref:a,noValidate:r,...o,children:t})});t4.displayName="MDBValidation";const e4=Y.forwardRef(({className:e,fill:t,pills:n,justify:i,children:s,...r},o)=>{const a=I("nav",n?"nav-pills":"nav-tabs",t&&"nav-fill",i&&"nav-justified",e);return b.jsx("ul",{className:a,ref:o,...r,children:s})});e4.displayName="MDBTabs";const n4=Y.forwardRef(({className:e,children:t,style:n,tag:i="li",...s},r)=>{const o=I("nav-item",e);return b.jsx(i,{className:o,style:{cursor:"pointer",...n},role:"presentation",ref:r,...s,children:t})});n4.displayName="MDBTabsItem";const i4=Y.forwardRef(({className:e,color:t,active:n,onOpen:i,onClose:s,children:r,...o},a)=>{const l=I("nav-link",n&&"active",t&&`bg-${t}`,e);return k.useEffect(()=>{n?i==null||i():s==null||s()},[n]),b.jsx("a",{className:l,ref:a,...o,children:r})});i4.displayName="MDBTabsLink";const s4=Y.forwardRef(({className:e,tag:t="div",children:n,...i},s)=>{const r=I("tab-content",e);return b.jsx(t,{className:r,ref:s,...i,children:n})});s4.displayName="MDBTabsContent";const r4=Y.forwardRef(({className:e,tag:t="div",open:n,children:i,...s},r)=>{const[o,a]=k.useState(!1),l=I("tab-pane","fade",o&&"show",n&&"active",e);return k.useEffect(()=>{let c;return n?c=setTimeout(()=>{a(!0)},100):a(!1),()=>{clearTimeout(c)}},[n]),b.jsx(t,{className:l,role:"tabpanel",ref:r,...s,children:i})});r4.displayName="MDBTabsPane";k.createContext({active:0});const vT=Y.createContext({activeItem:0,setActiveItem:null,alwaysOpen:!1,initialActive:0}),ng=Y.forwardRef(({alwaysOpen:e,borderless:t,className:n,flush:i,active:s,initialActive:r=0,tag:o="div",children:a,onChange:l,...c},u)=>{const d=k.useMemo(()=>typeof s<"u",[s]),h=I("accordion",i&&"accordion-flush",t&&"accordion-borderless",n),[f,p]=k.useState(r);return b.jsx(o,{className:h,ref:u,...c,children:b.jsx(vT.Provider,{value:{activeItem:d?s:f,setActiveItem:p,alwaysOpen:e,initialActive:r,onChange:l},children:a})})});ng.displayName="MDBAccordion";const oo=Y.forwardRef(({className:e,bodyClassName:t,bodyStyle:n,headerClassName:i,collapseId:s,headerTitle:r,headerStyle:o,btnClassName:a,tag:l="div",children:c,...u},d)=>{const{activeItem:h,setActiveItem:f,alwaysOpen:p,onChange:m}=k.useContext(vT),v=k.useMemo(()=>Array.isArray(h)?h.includes(s):h===s,[h,s]),y=I("accordion-item",e),g=I("accordion-header",i),x=I("accordion-body",t),_=I("accordion-button",!v&&"collapsed",a),w=k.useCallback(S=>{let C=S;Array.isArray(h)?h.includes(S)?C=h.filter(M=>M!==S):C=p?[...h,S]:[S]:(C=h===S?0:S,p&&(C=[C])),m==null||m(C),f(C)},[m,h,f,p]);return b.jsxs(l,{className:y,ref:d,...u,children:[b.jsx("h2",{className:g,style:o,children:b.jsx("button",{onClick:()=>w(s),className:_,type:"button",children:r})}),b.jsx(X3,{id:s.toString(),open:v,children:b.jsx("div",{className:x,style:n,children:c})})]})});oo.displayName="MDBAccordionItem";const o4=Y.forwardRef(({className:e,open:t,tag:n="div",children:i,...s},r)=>{const o=I("select-dropdown",t&&"open",e);return b.jsx(n,{className:o,...s,ref:r,children:i})});o4.displayName="MDBSelectDropdown";const a4=Y.forwardRef(({className:e,tag:t="span",children:n,...i},s)=>{const r=I("select-option-icon-container",e);return b.jsx(t,{className:r,...i,ref:s,children:n})});a4.displayName="MDBSelectIconContainer";const l4=Y.forwardRef(({className:e,tag:t="img",children:n,...i},s)=>{const r=I("select-option-icon",e);return b.jsx(t,{className:r,...i,ref:s,children:n})});l4.displayName="MDBSelectOptionIcon";const c4=Y.forwardRef(({className:e,tag:t="div",children:n,...i},s)=>{const r=I("select-options-list",e);return b.jsx(t,{className:r,...i,ref:s,children:n})});c4.displayName="MDBSelectOptionsList";const u4=Y.forwardRef(({className:e,tag:t="div",children:n,maxHeight:i,...s},r)=>{const o=I("select-options-wrapper",e);return b.jsx(t,{className:o,style:{maxHeight:i},...s,ref:r,children:n})});u4.displayName="MDBSelectOptionsWrapper";/*! +`):e}function TH(e,t){const{element:n,datasetIndex:i,index:s}=t,r=e.getDatasetMeta(i).controller,{label:o,value:a}=r.getLabelAndValue(s);return{chart:e,label:o,parsed:r.getParsed(s),raw:e.data.datasets[i].data[s],formattedValue:a,dataset:r.getDataset(),dataIndex:s,datasetIndex:i,element:n}}function E_(e,t){const n=e.chart.ctx,{body:i,footer:s,title:r}=e,{boxWidth:o,boxHeight:a}=t,l=be(t.bodyFont),c=be(t.titleFont),u=be(t.footerFont),d=r.length,h=s.length,f=i.length,p=ze(t.padding);let m=p.height,v=0,y=i.reduce((_,w)=>_+w.before.length+w.lines.length+w.after.length,0);if(y+=e.beforeBody.length+e.afterBody.length,d&&(m+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),y){const _=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;m+=f*_+(y-f)*l.lineHeight+(y-1)*t.bodySpacing}h&&(m+=t.footerMarginTop+h*u.lineHeight+(h-1)*t.footerSpacing);let g=0;const x=function(_){v=Math.max(v,n.measureText(_).width+g)};return n.save(),n.font=c.string,At(e.title,x),n.font=l.string,At(e.beforeBody.concat(e.afterBody),x),g=t.displayColors?o+2+t.boxPadding:0,At(i,_=>{At(_.before,x),At(_.lines,x),At(_.after,x)}),g=0,n.font=u.string,At(e.footer,x),n.restore(),v+=p.width,{width:v,height:m}}function DH(e,t){const{y:n,height:i}=t;return ne.height-i/2?"bottom":"center"}function EH(e,t,n,i){const{x:s,width:r}=i,o=n.caretSize+n.caretPadding;if(e==="left"&&s+r+o>t.width||e==="right"&&s-r-o<0)return!0}function AH(e,t,n,i){const{x:s,width:r}=n,{width:o,chartArea:{left:a,right:l}}=e;let c="center";return i==="center"?c=s<=(a+l)/2?"left":"right":s<=r/2?c="left":s>=o-r/2&&(c="right"),EH(c,e,t,n)&&(c="center"),c}function A_(e,t,n){const i=n.yAlign||t.yAlign||DH(e,n);return{xAlign:n.xAlign||t.xAlign||AH(e,t,n,i),yAlign:i}}function OH(e,t){let{x:n,width:i}=e;return t==="right"?n-=i:t==="center"&&(n-=i/2),n}function RH(e,t,n){let{y:i,height:s}=e;return t==="top"?i+=n:t==="bottom"?i-=s+n:i-=s/2,i}function O_(e,t,n,i){const{caretSize:s,caretPadding:r,cornerRadius:o}=e,{xAlign:a,yAlign:l}=n,c=s+r,{topLeft:u,topRight:d,bottomLeft:h,bottomRight:f}=Er(o);let p=OH(t,a);const m=RH(t,l,c);return l==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(u,h)+s:a==="right"&&(p+=Math.max(d,f)+s),{x:ke(p,0,i.width-t.width),y:ke(m,0,i.height-t.height)}}function Tu(e,t,n){const i=ze(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-i.right:e.x+i.left}function R_(e){return ui([],Li(e))}function LH(e,t,n){return er(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function L_(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}class Jm extends oi{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||t._chart,this._chart=this.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,i=this.options.setContext(this.getContext()),s=i.enabled&&n.options.animation&&i.animations,r=new WP(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=LH(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:i}=n,s=i.beforeTitle.apply(this,[t]),r=i.title.apply(this,[t]),o=i.afterTitle.apply(this,[t]);let a=[];return a=ui(a,Li(s)),a=ui(a,Li(r)),a=ui(a,Li(o)),a}getBeforeBody(t,n){return R_(n.callbacks.beforeBody.apply(this,[t]))}getBody(t,n){const{callbacks:i}=n,s=[];return At(t,r=>{const o={before:[],lines:[],after:[]},a=L_(i,r);ui(o.before,Li(a.beforeLabel.call(this,r))),ui(o.lines,a.label.call(this,r)),ui(o.after,Li(a.afterLabel.call(this,r))),s.push(o)}),s}getAfterBody(t,n){return R_(n.callbacks.afterBody.apply(this,[t]))}getFooter(t,n){const{callbacks:i}=n,s=i.beforeFooter.apply(this,[t]),r=i.footer.apply(this,[t]),o=i.afterFooter.apply(this,[t]);let a=[];return a=ui(a,Li(s)),a=ui(a,Li(r)),a=ui(a,Li(o)),a}_createItems(t){const n=this._active,i=this.chart.data,s=[],r=[],o=[];let a=[],l,c;for(l=0,c=n.length;lt.filter(u,d,h,i))),t.itemSort&&(a=a.sort((u,d)=>t.itemSort(u,d,i))),At(a,u=>{const d=L_(t.callbacks,u);s.push(d.labelColor.call(this,u)),r.push(d.labelPointStyle.call(this,u)),o.push(d.labelTextColor.call(this,u))}),this.labelColors=s,this.labelPointStyles=r,this.labelTextColors=o,this.dataPoints=a,a}update(t,n){const i=this.options.setContext(this.getContext()),s=this._active;let r,o=[];if(!s.length)this.opacity!==0&&(r={opacity:0});else{const a=Ml[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const l=this._size=E_(this,i),c=Object.assign({},a,l),u=A_(this.chart,i,c),d=O_(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,r={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,i,s){const r=this.getCaretPosition(t,i,s);n.lineTo(r.x1,r.y1),n.lineTo(r.x2,r.y2),n.lineTo(r.x3,r.y3)}getCaretPosition(t,n,i){const{xAlign:s,yAlign:r}=this,{caretSize:o,cornerRadius:a}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=Er(a),{x:h,y:f}=t,{width:p,height:m}=n;let v,y,g,x,_,w;return r==="center"?(_=f+m/2,s==="left"?(v=h,y=v-o,x=_+o,w=_-o):(v=h+p,y=v+o,x=_-o,w=_+o),g=v):(s==="left"?y=h+Math.max(l,u)+o:s==="right"?y=h+p-Math.max(c,d)-o:y=this.caretX,r==="top"?(x=f,_=x-o,v=y-o,g=y+o):(x=f+m,_=x+o,v=y+o,g=y-o),w=x),{x1:v,x2:y,x3:g,y1:x,y2:_,y3:w}}drawTitle(t,n,i){const s=this.title,r=s.length;let o,a,l;if(r){const c=Ro(i.rtl,this.x,this.width);for(t.x=Tu(this,i.titleAlign,i),n.textAlign=c.textAlign(i.titleAlign),n.textBaseline="middle",o=be(i.titleFont),a=i.titleSpacing,n.fillStyle=i.titleColor,n.font=o.string,l=0;lx!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,nc(t,{x:v,y:m,w:c,h:l,radius:g}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),nc(t,{x:y,y:m+1,w:c-2,h:l-2,radius:g}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(v,m,c,l),t.strokeRect(v,m,c,l),t.fillStyle=o.backgroundColor,t.fillRect(y,m+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,n,i){const{body:s}=this,{bodySpacing:r,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=i,d=be(i.bodyFont);let h=d.lineHeight,f=0;const p=Ro(i.rtl,this.x,this.width),m=function(M){n.fillText(M,p.x(t.x+f),t.y+h/2),t.y+=h+r},v=p.textAlign(o);let y,g,x,_,w,S,C;for(n.textAlign=o,n.textBaseline="middle",n.font=d.string,t.x=Tu(this,v,i),n.fillStyle=i.bodyColor,At(this.beforeBody,m),f=a&&v!=="right"?o==="center"?c/2+u:c+2+u:0,_=0,S=s.length;_0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,i=this.$animations,s=i&&i.x,r=i&&i.y;if(s||r){const o=Ml[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=E_(this,t),l=Object.assign({},o,this._size),c=A_(n,t,l),u=O_(t,l,c,n);(s._to!==u.x||r._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(n);const s={width:this.width,height:this.height},r={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=ze(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(r,t,s,n),IP(t,n.textDirection),r.y+=o.top,this.drawTitle(r,t,n),this.drawBody(r,t,n),this.drawFooter(r,t,n),FP(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const i=this._active,s=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),r=!qd(i,s),o=this._positionChanged(s,n);(r||o)&&(this._active=s,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,i=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,r=this._active||[],o=this._getActiveElements(t,r,n,i),a=this._positionChanged(o,t),l=n||!qd(o,r)||a;return l&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,i,s){const r=this.options;if(t.type==="mouseout")return[];if(!s)return n;const o=this.chart.getElementsAtEventForMode(t,r.mode,r,i);return r.reverse&&o.reverse(),o}_positionChanged(t,n){const{caretX:i,caretY:s,options:r}=this,o=Ml[r.position].call(this,t,n);return o!==!1&&(i!==o.x||s!==o.y)}}Jm.positioners=Ml;var NH={id:"tooltip",_element:Jm,positioners:Ml,afterInit(e,t,n){n&&(e.tooltip=new Jm({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)===!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:{beforeTitle:Ei,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,i=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndexe!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},jH=Object.freeze({__proto__:null,Decimation:eH,Filler:_H,Legend:SH,SubTitle:PH,Title:CH,Tooltip:NH});const $H=(e,t,n,i)=>(typeof t=="string"?(n=e.push(t)-1,i.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function IH(e,t,n,i){const s=e.indexOf(t);if(s===-1)return $H(e,t,n,i);const r=e.lastIndexOf(t);return s!==r?n:s}const FH=(e,t)=>e===null?null:ke(Math.round(e),0,t);class sh extends Xr{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const i=this.getLabels();for(const{index:s,label:r}of n)i[s]===r&&i.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(Mt(t))return null;const i=this.getLabels();return n=isFinite(n)&&i[n]===t?n:IH(i,t,ut(n,t),this._addedLabels),FH(n,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),n||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,n=this.max,i=this.options.offset,s=[];let r=this.getLabels();r=t===0&&n===r.length-1?r:r.slice(t,n+1),this._valueRange=Math.max(r.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let o=t;o<=n;o++)s.push({value:o});return s}getLabelForValue(t){const n=this.getLabels();return t>=0&&tn.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}sh.id="category";sh.defaults={ticks:{callback:sh.prototype.getLabelForValue}};function BH(e,t){const n=[],{bounds:s,step:r,min:o,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:h}=e,f=r||1,p=u-1,{min:m,max:v}=t,y=!Mt(o),g=!Mt(a),x=!Mt(c),_=(v-m)/(d+1);let w=A1((v-m)/p/f)*f,S,C,M,P;if(w<1e-14&&!y&&!g)return[{value:m},{value:v}];P=Math.ceil(v/w)-Math.floor(m/w),P>p&&(w=A1(P*w/p/f)*f),Mt(l)||(S=Math.pow(10,l),w=Math.ceil(w*S)/S),s==="ticks"?(C=Math.floor(m/w)*w,M=Math.ceil(v/w)*w):(C=m,M=v),y&&g&&r&&CV((a-o)/r,w/1e3)?(P=Math.round(Math.min((a-o)/w,u)),w=(a-o)/P,C=o,M=a):x?(C=y?o:C,M=g?a:M,P=c-1,w=(M-C)/P):(P=(M-C)/w,wl(P,Math.round(P),w/1e3)?P=Math.round(P):P=Math.ceil(P));const T=Math.max(O1(w),O1(C));S=Math.pow(10,Mt(l)?T:l),C=Math.round(C*S)/S,M=Math.round(M*S)/S;let A=0;for(y&&(h&&C!==o?(n.push({value:o}),Cs=n?s:l,a=l=>r=i?r:l;if(t){const l=_i(s),c=_i(r);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(s===r){let l=1;(r>=Number.MAX_SAFE_INTEGER||s<=Number.MIN_SAFE_INTEGER)&&(l=Math.abs(r*.05)),a(r+l),t||o(s-l)}this.min=s,this.max=r}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:i}=t,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),n=n||11),n&&(s=Math.min(n,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,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},r=this._range||this,o=BH(s,r);return t.bounds==="ticks"&&gP(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,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-n)/Math.max(t.length-1,1)/2;n-=s,i+=s}this._startValue=n,this._endValue=i,this._valueRange=i-n}getLabelForValue(t){return kc(t,this.chart.options.locale,this.options.ticks.format)}}class m0 extends rh{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=de(t)?t:0,this.max=de(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,i=ti(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,r.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}m0.id="linear";m0.defaults={ticks:{callback:Gh.formatters.numeric}};function j_(e){return e/Math.pow(10,Math.floor(jn(e)))===1}function VH(e,t){const n=Math.floor(jn(t.max)),i=Math.ceil(t.max/Math.pow(10,n)),s=[];let r=On(e.min,Math.pow(10,Math.floor(jn(t.min)))),o=Math.floor(jn(r)),a=Math.floor(r/Math.pow(10,o)),l=o<0?Math.pow(10,Math.abs(o)):1;do s.push({value:r,major:j_(r)}),++a,a===10&&(a=1,++o,l=o>=0?1:l),r=Math.round(a*Math.pow(10,o)*l)/l;while(o0?i:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=de(t)?Math.max(0,t):null,this.max=de(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let i=this.min,s=this.max;const r=l=>i=t?i:l,o=l=>s=n?s:l,a=(l,c)=>Math.pow(10,Math.floor(jn(l))+c);i===s&&(i<=0?(r(1),o(10)):(r(a(i,-1)),o(a(s,1)))),i<=0&&r(a(s,-1)),s<=0&&o(a(i,1)),this._zero&&this.min!==this._suggestedMin&&i===a(this.min,0)&&r(a(i,-1)),this.min=i,this.max=s}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},i=VH(n,this);return t.bounds==="ticks"&&gP(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":kc(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=jn(t),this._valueRange=jn(this.max)-jn(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(jn(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}g0.id="logarithmic";g0.defaults={ticks:{callback:Gh.formatters.logarithmic,major:{enabled:!0}}};function tg(e){const t=e.ticks;if(t.display&&e.display){const n=ze(t.backdropPadding);return ut(t.font&&t.font.size,_t.font.size)+n.height}return 0}function zH(e,t,n){return n=Vt(n)?n:[n],{w:sz(e,t.string,n),h:n.length*t.lineHeight}}function $_(e,t,n,i,s){return e===i||e===s?{start:t-n/2,end:t+n/2}:es?{start:t-n,end:t}:{start:t,end:t+n}}function WH(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),i=[],s=[],r=e._pointLabels.length,o=e.options.pointLabels,a=o.centerPointLabels?qt/r:0;for(let l=0;lt.r&&(a=(i.end-t.r)/r,e.r=Math.max(e.r,t.r+a)),s.startt.b&&(l=(s.end-t.b)/o,e.b=Math.max(e.b,t.b+l))}function UH(e,t,n){const i=[],s=e._pointLabels.length,r=e.options,o=tg(r)/2,a=e.drawingArea,l=r.pointLabels.centerPointLabels?qt/s:0;for(let c=0;c270||n<90)&&(e-=t),e}function GH(e,t){const{ctx:n,options:{pointLabels:i}}=e;for(let s=t-1;s>=0;s--){const r=i.setContext(e.getPointLabelContext(s)),o=be(r.font),{x:a,y:l,textAlign:c,left:u,top:d,right:h,bottom:f}=e._pointLabelItems[s],{backdropColor:p}=r;if(!Mt(p)){const m=Er(r.borderRadius),v=ze(r.backdropPadding);n.fillStyle=p;const y=u-v.left,g=d-v.top,x=h-u+v.width,_=f-d+v.height;Object.values(m).some(w=>w!==0)?(n.beginPath(),nc(n,{x:y,y:g,w:x,h:_,radius:m}),n.fill()):n.fillRect(y,g,x,_)}zr(n,e._pointLabels[s],a,l+o.lineHeight/2,o,{color:r.color,textAlign:c,textBaseline:"middle"})}}function uT(e,t,n,i){const{ctx:s}=e;if(n)s.arc(e.xCenter,e.yCenter,t,0,Nt);else{let r=e.getPointPosition(0,t);s.moveTo(r.x,r.y);for(let o=1;o{const s=Ft(this.options.pointLabels.callback,[n,i],this);return s||s===0?s:""}).filter((n,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?WH(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,i,s){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,i,s))}getIndexAngle(t){const n=Nt/(this._pointLabels.length||1),i=this.options.startAngle||0;return vn(t*n+ti(i))}getDistanceFromCenterForValue(t){if(Mt(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(Mt(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{if(u!==0){a=this.getDistanceFromCenterForValue(c.value);const d=s.setContext(this.getContext(u-1));qH(this,d,a,r)}}),i.display){for(t.save(),o=r-1;o>=0;o--){const c=i.setContext(this.getPointLabelContext(o)),{color:u,lineWidth:d}=c;!d||!u||(t.lineWidth=d,t.strokeStyle=u,t.setLineDash(c.borderDash),t.lineDashOffset=c.borderDashOffset,a=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),l=this.getPointPosition(o,a),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,i=n.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let r,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&!n.reverse)return;const c=i.setContext(this.getContext(l)),u=be(c.font);if(r=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,o=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const d=ze(c.backdropPadding);t.fillRect(-o/2-d.left,-r-u.size/2-d.top,o+d.width,u.size+d.height)}zr(t,a.label,0,-r,u,{color:c.color})}),t.restore()}drawTitle(){}}Mc.id="radialLinear";Mc.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Gh.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(e){return e},padding:5,centerPointLabels:!1}};Mc.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};Mc.descriptors={angleLines:{_fallback:"grid"}};const tf={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}},en=Object.keys(tf);function ZH(e,t){return e-t}function I_(e,t){if(Mt(t))return null;const n=e._adapter,{parser:i,round:s,isoWeekday:r}=e._parseOpts;let o=t;return typeof i=="function"&&(o=i(o)),de(o)||(o=typeof i=="string"?n.parse(o,i):n.parse(o)),o===null?null:(s&&(o=s==="week"&&(ta(r)||r===!0)?n.startOf(o,"isoWeek",r):n.startOf(o,s)),+o)}function F_(e,t,n,i){const s=en.length;for(let r=en.indexOf(e);r=en.indexOf(n);r--){const o=en[r];if(tf[o].common&&e._adapter.diff(s,i,o)>=t-1)return o}return en[n?en.indexOf(n):0]}function t3(e){for(let t=en.indexOf(e)+1,n=en.length;t=t?n[i]:n[s];e[r]=!0}}function e3(e,t,n,i){const s=e._adapter,r=+s.startOf(t[0].value,i),o=t[t.length-1].value;let a,l;for(a=r;a<=o;a=+s.add(a,1,i))l=n[a],l>=0&&(t[l].major=!0);return t}function V_(e,t,n){const i=[],s={},r=t.length;let o,a;for(o=0;o+t.value))}initOffsets(t){let n=0,i=0,s,r;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?n=1-s:n=(this.getDecimalForValue(t[1])-s)/2,r=this.getDecimalForValue(t[t.length-1]),t.length===1?i=r:i=(r-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;n=ke(n,0,o),i=ke(i,0,o),this._offsets={start:n,end:i,factor:1/(n+1+i)}}_generate(){const t=this._adapter,n=this.min,i=this.max,s=this.options,r=s.time,o=r.unit||F_(r.minUnit,n,i,this._getLabelCapacity(n)),a=ut(r.stepSize,1),l=o==="week"?r.isoWeekday:!1,c=ta(l)||l===!0,u={};let d=n,h,f;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":o),t.diff(i,n,o)>1e5*a)throw new Error(n+" and "+i+" are too far apart with stepSize of "+a+" "+o);const p=s.ticks.source==="data"&&this.getDataTimestamps();for(h=d,f=0;hm-v).map(m=>+m)}getLabelForValue(t){const n=this._adapter,i=this.options.time;return i.tooltipFormat?n.format(t,i.tooltipFormat):n.format(t,i.displayFormats.datetime)}_tickFormatFunction(t,n,i,s){const r=this.options,o=r.time.displayFormats,a=this._unit,l=this._majorUnit,c=a&&o[a],u=l&&o[l],d=i[n],h=l&&u&&d&&d.major,f=this._adapter.format(t,s||(h?u:c)),p=r.ticks.callback;return p?Ft(p,[f,n,i],this):f}generateTickLabels(t){let n,i,s;for(n=0,i=t.length;n0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,i;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(n=0,i=s.length;n=e[i].pos&&t<=e[s].pos&&({lo:i,hi:s}=Xi(e,"pos",t)),{pos:r,time:a}=e[i],{pos:o,time:l}=e[s]):(t>=e[i].time&&t<=e[s].time&&({lo:i,hi:s}=Xi(e,"time",t)),{time:r,pos:a}=e[i],{time:o,pos:l}=e[s]);const c=o-r;return c?a+(l-a)*(t-r)/c:a}class y0 extends Cc{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=Du(n,this.min),this._tableRange=Du(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:i}=this,s=[],r=[];let o,a,l,c,u;for(o=0,a=t.length;o=n&&c<=i&&s.push(c);if(s.length<2)return[{time:n,pos:0},{time:i,pos:1}];for(o=0,a=s.length;o.dropdown-menu{right:0!important}.select-input-label-active{color:#1266f1!important}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();const g3=Y.forwardRef(({breakpoint:e,fluid:t,children:n,className:i,tag:s="div",...r},o)=>{const a=I(`${t?"container-fluid":`container${e?"-"+e:""}`}`,i);return b.jsx(s,{className:a,...r,ref:o,children:n})});g3.displayName="MDBContainer";const y3=Y.forwardRef(({center:e,children:t,className:n,end:i,lg:s,md:r,offsetLg:o,offsetMd:a,offsetSm:l,order:c,size:u,sm:d,start:h,tag:f="div",xl:p,xxl:m,xs:v,...y},g)=>{const x=I(u&&`col-${u}`,v&&`col-xs-${v}`,d&&`col-sm-${d}`,r&&`col-md-${r}`,s&&`col-lg-${s}`,p&&`col-xl-${p}`,m&&`col-xxl-${m}`,!u&&!v&&!d&&!r&&!s&&!p&&!m?"col":"",c&&`order-${c}`,h&&"align-self-start",e&&"align-self-center",i&&"align-self-end",l&&`offset-sm-${l}`,a&&`offset-md-${a}`,o&&`offset-lg-${o}`,n);return b.jsx(f,{className:x,ref:g,...y,children:t})});y3.displayName="MDBCol";const v3=Y.forwardRef(({className:e,color:t="primary",pill:n,light:i,dot:s,tag:r="span",children:o,notification:a,...l},c)=>{const u=I("badge",i?t&&`badge-${t}`:t&&`bg-${t}`,s&&"badge-dot",n&&"rounded-pill",a&&"badge-notification",e);return b.jsx(r,{className:u,ref:c,...l,children:o})});v3.displayName="MDBBadge";const x3=({...e})=>{const[t,n]=k.useState(!1),i=I("ripple-wave",t&&"active");return k.useEffect(()=>{const s=setTimeout(()=>{n(!0)},50);return()=>{clearTimeout(s)}},[]),b.jsx("div",{className:i,...e})},b3=(...e)=>{const t=Y.useRef();return Y.useEffect(()=>{e.forEach(n=>{n&&(typeof n=="function"?n(t.current):n.current=t.current)})},[e]),t},v0=Y.forwardRef(({className:e,rippleTag:t="div",rippleCentered:n,rippleDuration:i=500,rippleUnbound:s,rippleRadius:r=0,rippleColor:o="dark",children:a,onMouseDown:l,...c},u)=>{const d=k.useRef(null),h=b3(u,d),f="rgba({{color}}, 0.2) 0, rgba({{color}}, 0.3) 40%, rgba({{color}}, 0.4) 50%, rgba({{color}}, 0.5) 60%, rgba({{color}}, 0) 70%",p=[0,0,0],m=["primary","secondary","success","danger","warning","info","light","dark"],[v,y]=k.useState([]),[g,x]=k.useState(!1),_=I("ripple","ripple-surface",s&&"ripple-surface-unbound",g&&`ripple-surface-${o}`,e),w=()=>{if(m.find(T=>T===(o==null?void 0:o.toLowerCase())))return x(!0);{const T=S(o).join(",");return`radial-gradient(circle, ${f.split("{{color}}").join(`${T}`)})`}},S=T=>{const A=N=>(N.length<7&&(N=`#${N[1]}${N[1]}${N[2]}${N[2]}${N[3]}${N[3]}`),[parseInt(N.substr(1,2),16),parseInt(N.substr(3,2),16),parseInt(N.substr(5,2),16)]),E=N=>{const R=document.body.appendChild(document.createElement("fictum")),L="rgb(1, 2, 3)";return R.style.color=L,R.style.color!==L||(R.style.color=N,R.style.color===L||R.style.color==="")?p:(N=getComputedStyle(R).color,document.body.removeChild(R),N)},z=N=>(N=N.match(/[.\d]+/g).map(R=>+Number(R)),N.length=3,N);return T.toLowerCase()==="transparent"?p:T[0]==="#"?A(T):(T.indexOf("rgb")===-1&&(T=E(T)),T.indexOf("rgb")===0?z(T):p)},C=T=>{const{offsetX:A,offsetY:E,height:z,width:N}=T,R=E<=z/2,L=A<=N/2,B=(W,et)=>Math.sqrt(W**2+et**2),D=E===z/2&&A===N/2,$={first:R===!0&&L===!1,second:R===!0&&L===!0,third:R===!1&&L===!0,fourth:R===!1&&L===!1},F={topLeft:B(A,E),topRight:B(N-A,E),bottomLeft:B(A,z-E),bottomRight:B(N-A,z-E)};let V=0;return D||$.fourth?V=F.topLeft:$.third?V=F.topRight:$.second?V=F.bottomRight:$.first&&(V=F.bottomLeft),V*2},M=T=>{var A;const E=(A=h.current)==null?void 0:A.getBoundingClientRect(),z=T.clientX-E.left,N=T.clientY-E.top,R=E.height,L=E.width,B={offsetX:n?R/2:z,offsetY:n?L/2:N,height:R,width:L},D={delay:i&&i*.5,duration:i&&i-i*.5},$=C(B),F=r||$/2,V={left:n?`${L/2-F}px`:`${z-F}px`,top:n?`${R/2-F}px`:`${N-F}px`,height:r?`${r*2}px`:`${$}px`,width:r?`${r*2}px`:`${$}px`,transitionDelay:`0s, ${D.delay}ms`,transitionDuration:`${i}ms, ${D.duration}ms`};return g?V:{...V,backgroundImage:`${w()}`}},P=T=>{const A=M(T),E=v.concat(A);y(E),l&&l(T)};return k.useEffect(()=>{const T=setTimeout(()=>{v.length>0&&y(v.splice(1,v.length-1))},i);return()=>{clearTimeout(T)}},[i,v]),b.jsxs(t,{className:_,onMouseDown:T=>P(T),ref:h,...c,children:[a,v.map((T,A)=>b.jsx(x3,{style:T},A))]})});v0.displayName="MDBRipple";const Zt=Y.forwardRef(({className:e,color:t="primary",outline:n,children:i,rounded:s,disabled:r,floating:o,size:a,href:l,block:c,active:u,toggle:d,noRipple:h,tag:f="button",role:p="button",...m},v)=>{const[y,g]=k.useState(u||!1);let x;const _=t&&["light","link"].includes(t)||n?"dark":"light";t!=="none"?n?t?x=`btn-outline-${t}`:x="btn-outline-primary":t?x=`btn-${t}`:x="btn-primary":x="";const w=I(t!=="none"&&"btn",x,s&&"btn-rounded",o&&"btn-floating",a&&`btn-${a}`,`${(l||f!=="button")&&r?"disabled":""}`,c&&"btn-block",y&&"active",e);return l&&f!=="a"&&(f="a"),["hr","img","input"].includes(f)||h?b.jsx(f,{className:w,onClick:d?()=>{g(!y)}:void 0,disabled:r&&f==="button"?!0:void 0,href:l,ref:v,role:p,...m,children:i}):b.jsx(v0,{rippleTag:f,rippleColor:_,className:w,onClick:d?()=>{g(!y)}:void 0,disabled:r&&f==="button"?!0:void 0,href:l,ref:v,role:p,...m,children:i})});Zt.displayName="MDBBtn";const _3=Y.forwardRef(({className:e,children:t,shadow:n,toolbar:i,size:s,vertical:r,tag:o="div",role:a="group",...l},c)=>{let u;i?u="btn-toolbar":r?u="btn-group-vertical":u="btn-group";const d=I(u,n&&`shadow-${n}`,s&&`btn-group-${s}`,e);return b.jsx(o,{className:d,ref:c,role:a,...l,children:t})});_3.displayName="MDBBtnGroup";const hT=Y.forwardRef(({className:e,children:t,tag:n="div",color:i,grow:s,size:r,...o},a)=>{const l=I(`${s?"spinner-grow":"spinner-border"}`,i&&`text-${i}`,`${r?s?"spinner-grow-"+r:"spinner-border-"+r:""}`,e);return b.jsx(n,{className:l,ref:a,...o,children:t})});hT.displayName="MDBSpinner";const od=Y.forwardRef(({className:e,children:t,border:n,background:i,tag:s="div",shadow:r,alignment:o,...a},l)=>{const c=I("card",n&&`border border-${n}`,i&&`bg-${i}`,r&&`shadow-${r}`,o&&`text-${o}`,e);return b.jsx(s,{className:c,ref:l,...a,children:t})});od.displayName="MDBCard";const ad=Y.forwardRef(({className:e,children:t,border:n,background:i,tag:s="div",...r},o)=>{const a=I("card-header",n&&`border-${n}`,i&&`bg-${i}`,e);return b.jsx(s,{className:a,...r,ref:o,children:t})});ad.displayName="MDBCardHeader";const w3=Y.forwardRef(({className:e,children:t,tag:n="p",...i},s)=>{const r=I("card-subtitle",e);return b.jsx(n,{className:r,...i,ref:s,children:t})});w3.displayName="MDBCardSubTitle";const fT=Y.forwardRef(({className:e,children:t,tag:n="h5",...i},s)=>{const r=I("card-title",e);return b.jsx(n,{className:r,...i,ref:s,children:t})});fT.displayName="MDBCardTitle";const el=Y.forwardRef(({className:e,children:t,tag:n="p",...i},s)=>{const r=I("card-text",e);return b.jsx(n,{className:r,...i,ref:s,children:t})});el.displayName="MDBCardText";const eg=Y.forwardRef(({className:e,children:t,tag:n="div",...i},s)=>{const r=I("card-body",e);return b.jsx(n,{className:r,...i,ref:s,children:t})});eg.displayName="MDBCardBody";const k3=Y.forwardRef(({className:e,children:t,border:n,background:i,tag:s="div",...r},o)=>{const a=I("card-footer",n&&`border-${n}`,i&&`bg-${i}`,e);return b.jsx(s,{className:a,...r,ref:o,children:t})});k3.displayName="MDBCardFooter";const S3=Y.forwardRef(({className:e,children:t,tag:n="div",...i},s)=>{const r=I("card-img-overlay",e);return b.jsx(n,{className:r,...i,ref:s,children:t})});S3.displayName="MDBCardOverlay";const M3=Y.forwardRef(({className:e,children:t,tag:n="div",...i},s)=>{const r=I("card-group",e);return b.jsx(n,{className:r,...i,ref:s,children:t})});M3.displayName="MDBCardGroup";const C3=Y.forwardRef(({className:e,tag:t="ul",horizontal:n,horizontalSize:i,light:s,numbered:r,children:o,small:a,...l},c)=>{const u=I("list-group",n&&(i?`list-group-horizontal-${i}`:"list-group-horizontal"),s&&"list-group-light",r&&"list-group-numbered",a&&"list-group-small",e);return b.jsx(t,{className:u,ref:c,...l,children:o})});C3.displayName="MDBListGroup";const P3=Y.forwardRef(({className:e,tag:t="li",active:n,disabled:i,action:s,color:r,children:o,noBorders:a,...l},c)=>{const u=t==="button",d=I("list-group-item",n&&"active",i&&!u&&"disabled",s&&"list-group-item-action",r&&`list-group-item-${r}`,a&&"border-0",e);return b.jsx(t,{className:d,disabled:u&&i,ref:c,...l,children:o})});P3.displayName="MDBListGroupItem";const aa=({children:e,containerRef:t,disablePortal:n})=>{const[i,s]=k.useState(!1);return k.useEffect(()=>{!n&&s(!0)},[n]),n?b.jsx(b.Fragment,{children:e}):i?iy.createPortal(b.jsx(b.Fragment,{children:e}),(t==null?void 0:t.current)||document.body):null},T3=Y.forwardRef(({around:e,between:t,bottom:n,center:i,children:s,className:r,evenly:o,end:a,middle:l,start:c,tag:u="div",top:d,...h},f)=>{const p=I("row",e&&"justify-content-around",t&&"justify-content-between",n&&"align-self-end",i&&"justify-content-center",o&&"justifty-content-evenly",a&&"justify-content-end",l&&"align-self-center",c&&"justify-content-start",d&&"align-self-start",r);return b.jsx(u,{className:p,...h,ref:f,children:s})});T3.displayName="MDBRow";const sn=({animate:e,className:t,icon:n,fab:i,fas:s,fal:r,far:o,flag:a,spin:l,fixed:c,flip:u,list:d,size:h,pull:f,pulse:p,color:m,border:v,rotate:y,inverse:g,stack:x,iconType:_,children:w,...S})=>{let C;a?C="flag":i?C="fab":s?C="fas":o?C="far":r?C="fal":C="fa";const M=I(_?`fa-${_}`:C,e&&`fa-${e}`,a?`flag-${a}`:n&&`fa-${n}`,h&&`fa-${h}`,m&&`text-${m}`,v&&"fa-border",y&&`fa-rotate-${y}`,f&&`fa-pull-${f}`,l&&!e&&"fa-spin",d&&"fa-li",c&&"fa-fw",p&&!e&&"fa-pulse",g&&"fa-inverse",u&&`fa-flip-${u}`,x&&`fa-stack-${x}`,t);return b.jsx("i",{className:M,...S,children:w})},D3=Y.forwardRef(({className:e,children:t,tag:n="p",variant:i,color:s,blockquote:r,note:o,noteColor:a,listUnStyled:l,listInLine:c,...u},d)=>{const h=I(i&&i,r&&"blockquote",o&&"note",s&&`text-${s}`,a&&`note-${a}`,l&&"list-unstyled",c&&"list-inline",e);return r&&(n="blockquote"),(l||c)&&(n="ul"),b.jsx(n,{className:h,ref:d,...u,children:t})});D3.displayName="MDBTypography";const E3=Y.forwardRef(({className:e,color:t,uppercase:n,bold:i,children:s,...r},o)=>{const a=I("breadcrumb",i&&"font-weight-bold",t&&`text-${t}`,n&&"text-uppercase",e);return b.jsx("nav",{"aria-label":"breadcrumb",children:b.jsx("ol",{className:a,ref:o,...r,children:s})})});E3.displayName="MDBBreadcrumb";const A3=Y.forwardRef(({className:e,active:t,current:n="page",children:i,...s},r)=>{const o=I("breadcrumb-item",t&&"active",e);return b.jsx("li",{className:o,ref:r,"aria-current":t&&n,...s,children:i})});A3.displayName="MDBBreadcrumbItem";const O3=e=>{if(e!==!1)return`navbar-expand-${e}`},pT=Y.forwardRef(({className:e,children:t,light:n,dark:i,scrolling:s,fixed:r,sticky:o,scrollingNavbarOffset:a,color:l,transparent:c,expand:u,tag:d="nav",bgColor:h,...f},p)=>{const[m,v]=k.useState(!1),y=I({"navbar-light":n,"navbar-dark":i,"scrolling-navbar":s||a,"top-nav-collapse":m,[`text-${l}`]:l&&c?m:l},r&&`fixed-${r}`,o&&"sticky-top","navbar",u&&O3(u),h&&`bg-${h}`,e),g=k.useCallback(()=>{a&&window.pageYOffset>a?v(!0):v(!1)},[a]);return k.useEffect(()=>((s||a)&&window.addEventListener("scroll",g),()=>{window.removeEventListener("scroll",g)}),[g,s,a]),b.jsx(d,{className:y,role:"navigation",...f,ref:p,children:t})});pT.displayName="MDBNavbar";const R3=Y.forwardRef(({children:e,className:t="",disabled:n=!1,active:i=!1,tag:s="a",...r},o)=>{const a=I("nav-link",n?"disabled":i?"active":"",t);return b.jsx(s,{"data-test":"nav-link",className:a,style:{cursor:"pointer"},ref:o,...r,children:e})});R3.displayName="MDBNavbarLink";const L3=Y.forwardRef(({className:e,children:t,tag:n="a",...i},s)=>{const r=I("navbar-brand",e);return b.jsx(n,{className:r,ref:s,...i,children:t})});L3.displayName="MDBNavbarBrand";const N3=Y.forwardRef(({children:e,className:t,active:n,text:i,tag:s="li",...r},o)=>{const a=I("nav-item",n&&"active",i&&"navbar-text",t);return b.jsx(s,{...r,className:a,ref:o,children:e})});N3.displayName="MDBNavbarItem";const j3=Y.forwardRef(({children:e,className:t,right:n,fullWidth:i=!0,left:s,tag:r="ul",...o},a)=>{const l=I("navbar-nav",i&&"w-100",n&&"ms-auto",s&&"me-auto",t);return b.jsx(r,{className:l,ref:a,...o,children:e})});j3.displayName="MDBNavbarNav";const $3=Y.forwardRef(({children:e,className:t,tag:n="button",...i},s)=>{const r=I("navbar-toggler",t);return b.jsx(n,{...i,className:r,ref:s,children:e})});$3.displayName="MDBNavbarToggler";const I3=Y.forwardRef(({children:e,bgColor:t,color:n,className:i,...s},r)=>{const o=I(t&&`bg-${t}`,n&&`text-${n}`,i);return b.jsx("footer",{className:o,...s,ref:r,children:e})});I3.displayName="MDBFooter";const F3=Y.forwardRef(({children:e,size:t,circle:n,center:i,end:s,start:r,className:o,...a},l)=>{const c=I("pagination",i&&"justify-content-center",n&&"pagination-circle",s&&"justify-content-end",t&&`pagination-${t}`,r&&"justify-content-start",o);return b.jsx("ul",{className:c,...a,ref:l,children:e})});F3.displayName="MDBPagination";const B3=Y.forwardRef(({children:e,className:t,tag:n="a",...i},s)=>{const r=I("page-link",t);return b.jsx(n,{className:r,...i,ref:s,children:e})});B3.displayName="MDBPaginationLink";const V3=Y.forwardRef(({children:e,className:t,active:n,disabled:i,...s},r)=>{const o=I("page-item",n&&"active",i&&"disabled",t);return b.jsx("li",{className:o,...s,ref:r,children:e})});V3.displayName="MDBPaginationItem";const z3=({className:e,classNameResponsive:t,responsive:n,align:i,borderColor:s,bordered:r,borderless:o,children:a,color:l,hover:c,small:u,striped:d,...h})=>{const f=I("table",i&&`align-${i}`,s&&`border-${s}`,r&&"table-bordered",o&&"table-borderless",l&&`table-${l}`,c&&"table-hover",u&&"table-sm",d&&"table-striped",e),p=k.useMemo(()=>b.jsx("table",{className:f,...h,children:a}),[a,f,h]);if(n){const m=I(typeof n=="string"?`table-responsive-${n}`:"table-responsive",t);return b.jsx("div",{className:m,children:p})}else return p},W3=({className:e,children:t,dark:n,light:i,...s})=>{const r=I(n&&"table-dark",i&&"table-light",e);return b.jsx("thead",{className:r,...s,children:t})},H3=({className:e,children:t,...n})=>{const i=I(e);return b.jsx("tbody",{className:i,...n,children:t})},mT=Y.forwardRef(({animated:e,children:t,className:n,style:i,tag:s="div",valuenow:r,valuemax:o,striped:a,bgColor:l,valuemin:c,width:u,...d},h)=>{const f=I("progress-bar",l&&`bg-${l}`,a&&"progress-bar-striped",e&&"progress-bar-animated",n),p={width:`${u}%`,...i};return b.jsx(s,{className:f,style:p,ref:h,role:"progressbar",...d,"aria-valuenow":Number(u)??r,"aria-valuemin":Number(c),"aria-valuemax":Number(o),children:t})});mT.displayName="MDBProgressBar";const U3=Y.forwardRef(({className:e,children:t,tag:n="div",height:i,style:s,...r},o)=>{const a=I("progress",e),l={height:`${i}px`,...s};return b.jsx(n,{className:a,ref:o,style:l,...r,children:Y.Children.map(t,c=>{if(!Y.isValidElement(c)||c.type!==mT){console.error("Progress component only allows ProgressBar as child");return}else return c})})});U3.displayName="MDBProgress";const Y3=e=>{const[t,n]=k.useState(!1),[i,s]=k.useState(null);return k.useEffect(()=>{s(()=>new IntersectionObserver(([r])=>{n(r.isIntersecting)}))},[]),k.useEffect(()=>{if(!(!e.current||!i))return i.observe(e.current),()=>i.disconnect()},[i,e]),t},ef=(e,t)=>k.useMemo(()=>t!==void 0?t:e,[t,e]),wi=Y.forwardRef(({className:e,size:t,contrast:n,value:i,defaultValue:s,id:r,labelClass:o,wrapperClass:a,wrapperStyle:l,wrapperTag:c="div",label:u,onChange:d,children:h,labelRef:f,labelStyle:p,type:m,onBlur:v,readonly:y=!1,showCounter:g=!1,...x},_)=>{var w;const[S,C]=k.useState(s),M=k.useMemo(()=>i!==void 0?i:S,[i,S]),[P,T]=k.useState(0),[A,E]=k.useState(!1),[z,N]=k.useState(0),R=k.useRef(null),L=Y3(R),B=k.useRef(null),D=f||B;k.useImperativeHandle(_,()=>R.current);const $=I("form-outline",n&&"form-white",a),F=I("form-control",A&&"active",m==="date"&&"active",t&&`form-control-${t}`,e),V=I("form-label",o),W=k.useCallback(()=>{var O;(O=D.current)!=null&&O.clientWidth&&T(D.current.clientWidth*.8+8)},[D]),et=O=>{C(O.target.value),g&&N(O.target.value.length),d==null||d(O)},Z=k.useCallback(O=>{R.current&&(E(!!M),v&&v(O))},[M,v]);return k.useEffect(()=>{W()},[(w=D.current)==null?void 0:w.clientWidth,W,L]),k.useEffect(()=>{if(M)return E(!0);E(!1)},[M]),b.jsxs(c,{className:$,style:l,children:[b.jsx("input",{type:m,readOnly:y,className:F,onBlur:Z,onChange:et,onFocus:W,value:i,defaultValue:s,id:r,ref:R,...x}),u&&b.jsx("label",{className:V,style:p,htmlFor:r,ref:D,children:u}),b.jsxs("div",{className:"form-notch",children:[b.jsx("div",{className:"form-notch-leading"}),b.jsx("div",{className:"form-notch-middle",style:{width:P}}),b.jsx("div",{className:"form-notch-trailing"})]}),h,g&&x.maxLength&&b.jsx("div",{className:"form-helper",children:b.jsx("div",{className:"form-counter",children:`${z}/${x.maxLength}`})})]})});wi.displayName="MDBInput";const gT=k.forwardRef(({className:e,inputRef:t,labelClass:n,wrapperClass:i,labelStyle:s,wrapperTag:r="div",wrapperStyle:o,label:a,inline:l,btn:c,id:u,btnColor:d,disableWrapper:h,toggleSwitch:f,...p},m)=>{let v="form-check-input",y="form-check-label";c&&(v="btn-check",d?y=`btn btn-${d}`:y="btn btn-primary");const g=I(a&&!c&&"form-check",l&&!c&&"form-check-inline",f&&"form-switch",i),x=I(v,e),_=I(y,n),w=b.jsxs(b.Fragment,{children:[b.jsx("input",{className:x,id:u,ref:t,...p}),a&&b.jsx("label",{className:_,style:s,htmlFor:u,children:a})]});return b.jsx(b.Fragment,{children:h?w:b.jsx(r,{style:o,className:g,ref:m,children:w})})});gT.displayName="InputTemplate";const oh=({...e})=>b.jsx(gT,{type:"checkbox",...e}),X3=({className:e,children:t,open:n=!1,id:i,navbar:s,tag:r="div",collapseRef:o,style:a,onOpen:l,onClose:c,...u})=>{const[d,h]=k.useState(!1),[f,p]=k.useState(void 0),[m,v]=k.useState(!1),y=I(m?"collapsing":"collapse",!m&&d&&"show",s&&"navbar-collapse",e),g=k.useRef(null),x=o??g,_=k.useCallback(()=>{d&&p(void 0)},[d]);return k.useEffect(()=>{var w;f===void 0&&d&&p((w=x==null?void 0:x.current)==null?void 0:w.scrollHeight)},[f,d,x]),k.useEffect(()=>{d!==n&&(n?l==null||l():c==null||c(),h(n)),d&&v(!0);const w=setTimeout(()=>{v(!1)},350);return()=>{clearTimeout(w)}},[n,d,l,c]),k.useEffect(()=>{var w;p(d?(w=x==null?void 0:x.current)==null?void 0:w.scrollHeight:0)},[d,x,t]),k.useEffect(()=>(window.addEventListener("resize",_),()=>{window.removeEventListener("resize",_)}),[_]),b.jsx(r,{style:{height:f,...a},id:i,className:y,...u,ref:x,children:t})};k.createContext(null);const K3=Y.forwardRef(({className:e,children:t,tag:n="div",...i},s)=>{const r=I("modal-content",e);return b.jsx(n,{className:r,...i,ref:s,children:t})});K3.displayName="MDBModalContent";const G3=Y.forwardRef(({className:e,children:t,tag:n="div",...i},s)=>{const r=I("modal-header",e);return b.jsx(n,{className:r,...i,ref:s,children:t})});G3.displayName="MDBModalHeader";const q3=Y.forwardRef(({className:e,children:t,tag:n="h5",...i},s)=>{const r=I("modal-title",e);return b.jsx(n,{className:r,...i,ref:s,children:t})});q3.displayName="MDBModalTitle";const Q3=Y.forwardRef(({className:e,children:t,tag:n="div",...i},s)=>{const r=I("modal-body",e);return b.jsx(n,{className:r,...i,ref:s,children:t})});Q3.displayName="MDBModalBody";const Z3=Y.forwardRef(({className:e,children:t,tag:n="div",...i},s)=>{const r=I("modal-footer",e);return b.jsx(n,{className:r,...i,ref:s,children:t})});Z3.displayName="MDBModalFooter";Y.createContext({activeElement:null,setTargets:null});const J3=k.forwardRef(({className:e,labelClass:t,labelStyle:n,inputRef:i,size:s,label:r,id:o,...a},l)=>{const c=I("form-control",`form-control-${s}`,e),u=I("form-label",t),d=k.useRef(null);return k.useImperativeHandle(l,()=>d.current||(i==null?void 0:i.current)),b.jsxs(b.Fragment,{children:[r&&b.jsx("label",{className:u,style:n,htmlFor:o,children:r}),b.jsx("input",{className:c,type:"file",id:o,ref:d,...a})]})});J3.displayName="MDBFile";const yT=Y.forwardRef(({className:e,children:t,noBorder:n,textBefore:i,textAfter:s,noWrap:r,tag:o="div",textTag:a="span",textClass:l,size:c,textProps:u,...d},h)=>{const f=I("input-group",r&&"flex-nowrap",c&&`input-group-${c}`,e),p=I("input-group-text",n&&"border-0",l),m=v=>b.jsx(b.Fragment,{children:v&&Array.isArray(v)?v.map((y,g)=>b.jsx(a,{className:p,...u,children:y},g)):b.jsx(a,{className:p,...u,children:v})});return b.jsxs(o,{className:f,ref:h,...d,children:[i&&m(i),t,s&&m(s)]})});yT.displayName="MDBInputGroup";const t4=Y.forwardRef(({className:e,children:t,isValidated:n=!1,onReset:i,onSubmit:s,noValidate:r=!0,...o},a)=>{const[l,c]=k.useState(n),u=I("needs-validation",l&&"was-validated",e),d=f=>{f.preventDefault(),c(!0),s&&s(f)},h=f=>{f.preventDefault(),c(!1),i&&i(f)};return k.useEffect(()=>{c(n)},[n]),b.jsx("form",{className:u,onSubmit:d,onReset:h,ref:a,noValidate:r,...o,children:t})});t4.displayName="MDBValidation";const e4=Y.forwardRef(({className:e,fill:t,pills:n,justify:i,children:s,...r},o)=>{const a=I("nav",n?"nav-pills":"nav-tabs",t&&"nav-fill",i&&"nav-justified",e);return b.jsx("ul",{className:a,ref:o,...r,children:s})});e4.displayName="MDBTabs";const n4=Y.forwardRef(({className:e,children:t,style:n,tag:i="li",...s},r)=>{const o=I("nav-item",e);return b.jsx(i,{className:o,style:{cursor:"pointer",...n},role:"presentation",ref:r,...s,children:t})});n4.displayName="MDBTabsItem";const i4=Y.forwardRef(({className:e,color:t,active:n,onOpen:i,onClose:s,children:r,...o},a)=>{const l=I("nav-link",n&&"active",t&&`bg-${t}`,e);return k.useEffect(()=>{n?i==null||i():s==null||s()},[n]),b.jsx("a",{className:l,ref:a,...o,children:r})});i4.displayName="MDBTabsLink";const s4=Y.forwardRef(({className:e,tag:t="div",children:n,...i},s)=>{const r=I("tab-content",e);return b.jsx(t,{className:r,ref:s,...i,children:n})});s4.displayName="MDBTabsContent";const r4=Y.forwardRef(({className:e,tag:t="div",open:n,children:i,...s},r)=>{const[o,a]=k.useState(!1),l=I("tab-pane","fade",o&&"show",n&&"active",e);return k.useEffect(()=>{let c;return n?c=setTimeout(()=>{a(!0)},100):a(!1),()=>{clearTimeout(c)}},[n]),b.jsx(t,{className:l,role:"tabpanel",ref:r,...s,children:i})});r4.displayName="MDBTabsPane";k.createContext({active:0});const vT=Y.createContext({activeItem:0,setActiveItem:null,alwaysOpen:!1,initialActive:0}),ng=Y.forwardRef(({alwaysOpen:e,borderless:t,className:n,flush:i,active:s,initialActive:r=0,tag:o="div",children:a,onChange:l,...c},u)=>{const d=k.useMemo(()=>typeof s<"u",[s]),h=I("accordion",i&&"accordion-flush",t&&"accordion-borderless",n),[f,p]=k.useState(r);return b.jsx(o,{className:h,ref:u,...c,children:b.jsx(vT.Provider,{value:{activeItem:d?s:f,setActiveItem:p,alwaysOpen:e,initialActive:r,onChange:l},children:a})})});ng.displayName="MDBAccordion";const oo=Y.forwardRef(({className:e,bodyClassName:t,bodyStyle:n,headerClassName:i,collapseId:s,headerTitle:r,headerStyle:o,btnClassName:a,tag:l="div",children:c,...u},d)=>{const{activeItem:h,setActiveItem:f,alwaysOpen:p,onChange:m}=k.useContext(vT),v=k.useMemo(()=>Array.isArray(h)?h.includes(s):h===s,[h,s]),y=I("accordion-item",e),g=I("accordion-header",i),x=I("accordion-body",t),_=I("accordion-button",!v&&"collapsed",a),w=k.useCallback(S=>{let C=S;Array.isArray(h)?h.includes(S)?C=h.filter(M=>M!==S):C=p?[...h,S]:[S]:(C=h===S?0:S,p&&(C=[C])),m==null||m(C),f(C)},[m,h,f,p]);return b.jsxs(l,{className:y,ref:d,...u,children:[b.jsx("h2",{className:g,style:o,children:b.jsx("button",{onClick:()=>w(s),className:_,type:"button",children:r})}),b.jsx(X3,{id:s.toString(),open:v,children:b.jsx("div",{className:x,style:n,children:c})})]})});oo.displayName="MDBAccordionItem";const o4=Y.forwardRef(({className:e,open:t,tag:n="div",children:i,...s},r)=>{const o=I("select-dropdown",t&&"open",e);return b.jsx(n,{className:o,...s,ref:r,children:i})});o4.displayName="MDBSelectDropdown";const a4=Y.forwardRef(({className:e,tag:t="span",children:n,...i},s)=>{const r=I("select-option-icon-container",e);return b.jsx(t,{className:r,...i,ref:s,children:n})});a4.displayName="MDBSelectIconContainer";const l4=Y.forwardRef(({className:e,tag:t="img",children:n,...i},s)=>{const r=I("select-option-icon",e);return b.jsx(t,{className:r,...i,ref:s,children:n})});l4.displayName="MDBSelectOptionIcon";const c4=Y.forwardRef(({className:e,tag:t="div",children:n,...i},s)=>{const r=I("select-options-list",e);return b.jsx(t,{className:r,...i,ref:s,children:n})});c4.displayName="MDBSelectOptionsList";const u4=Y.forwardRef(({className:e,tag:t="div",children:n,maxHeight:i,...s},r)=>{const o=I("select-options-wrapper",e);return b.jsx(t,{className:o,style:{maxHeight:i},...s,ref:r,children:n})});u4.displayName="MDBSelectOptionsWrapper";/*! * perfect-scrollbar v1.5.3 * Copyright 2021 Hyunje Jun, MDBootstrap and Contributors * Licensed under MIT - */function mi(e){return getComputedStyle(e)}function Ze(e,t){for(var n in t){var i=t[n];typeof i=="number"&&(i=i+"px"),e.style[n]=i}return e}function Du(e){var t=document.createElement("div");return t.className=e,t}var W_=typeof Element<"u"&&(Element.prototype.matches||Element.prototype.webkitMatchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector);function Ts(e,t){if(!W_)throw new Error("No element matching method supported");return W_.call(e,t)}function Mo(e){e.remove?e.remove():e.parentNode&&e.parentNode.removeChild(e)}function H_(e,t){return Array.prototype.filter.call(e.children,function(n){return Ts(n,t)})}var pe={main:"ps",rtl:"ps__rtl",element:{thumb:function(e){return"ps__thumb-"+e},rail:function(e){return"ps__rail-"+e},consuming:"ps__child--consume"},state:{focus:"ps--focus",clicking:"ps--clicking",active:function(e){return"ps--active-"+e},scrolling:function(e){return"ps--scrolling-"+e}}},xT={x:null,y:null};function bT(e,t){var n=e.element.classList,i=pe.state.scrolling(t);n.contains(i)?clearTimeout(xT[t]):n.add(i)}function _T(e,t){xT[t]=setTimeout(function(){return e.isAlive&&e.element.classList.remove(pe.state.scrolling(t))},e.settings.scrollingThreshold)}function d4(e,t){bT(e,t),_T(e,t)}var Cc=function(e){this.element=e,this.handlers={}},wT={isEmpty:{configurable:!0}};Cc.prototype.bind=function(e,t){typeof this.handlers[e]>"u"&&(this.handlers[e]=[]),this.handlers[e].push(t),this.element.addEventListener(e,t,!1)};Cc.prototype.unbind=function(e,t){var n=this;this.handlers[e]=this.handlers[e].filter(function(i){return t&&i!==t?!0:(n.element.removeEventListener(e,i,!1),!1)})};Cc.prototype.unbindAll=function(){for(var e in this.handlers)this.unbind(e)};wT.isEmpty.get=function(){var e=this;return Object.keys(this.handlers).every(function(t){return e.handlers[t].length===0})};Object.defineProperties(Cc.prototype,wT);var la=function(){this.eventElements=[]};la.prototype.eventElement=function(e){var t=this.eventElements.filter(function(n){return n.element===e})[0];return t||(t=new Cc(e),this.eventElements.push(t)),t};la.prototype.bind=function(e,t,n){this.eventElement(e).bind(t,n)};la.prototype.unbind=function(e,t,n){var i=this.eventElement(e);i.unbind(t,n),i.isEmpty&&this.eventElements.splice(this.eventElements.indexOf(i),1)};la.prototype.unbindAll=function(){this.eventElements.forEach(function(e){return e.unbindAll()}),this.eventElements=[]};la.prototype.once=function(e,t,n){var i=this.eventElement(e),s=function(r){i.unbind(t,s),n(r)};i.bind(t,s)};function Eu(e){if(typeof window.CustomEvent=="function")return new CustomEvent(e);var t=document.createEvent("CustomEvent");return t.initCustomEvent(e,!1,!1,void 0),t}function ah(e,t,n,i,s){i===void 0&&(i=!0),s===void 0&&(s=!1);var r;if(t==="top")r=["contentHeight","containerHeight","scrollTop","y","up","down"];else if(t==="left")r=["contentWidth","containerWidth","scrollLeft","x","left","right"];else throw new Error("A proper axis should be provided");h4(e,n,r,i,s)}function h4(e,t,n,i,s){var r=n[0],o=n[1],a=n[2],l=n[3],c=n[4],u=n[5];i===void 0&&(i=!0),s===void 0&&(s=!1);var d=e.element;e.reach[l]=null,d[a]<1&&(e.reach[l]="start"),d[a]>e[r]-e[o]-1&&(e.reach[l]="end"),t&&(d.dispatchEvent(Eu("ps-scroll-"+l)),t<0?d.dispatchEvent(Eu("ps-scroll-"+c)):t>0&&d.dispatchEvent(Eu("ps-scroll-"+u)),i&&d4(e,l)),e.reach[l]&&(t||s)&&d.dispatchEvent(Eu("ps-"+l+"-reach-"+e.reach[l]))}function Jt(e){return parseInt(e,10)||0}function f4(e){return Ts(e,"input,[contenteditable]")||Ts(e,"select,[contenteditable]")||Ts(e,"textarea,[contenteditable]")||Ts(e,"button,[contenteditable]")}function p4(e){var t=mi(e);return Jt(t.width)+Jt(t.paddingLeft)+Jt(t.paddingRight)+Jt(t.borderLeftWidth)+Jt(t.borderRightWidth)}var ao={isWebKit:typeof document<"u"&&"WebkitAppearance"in document.documentElement.style,supportsTouch:typeof window<"u"&&("ontouchstart"in window||"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>0||window.DocumentTouch&&document instanceof window.DocumentTouch),supportsIePointer:typeof navigator<"u"&&navigator.msMaxTouchPoints,isChrome:typeof navigator<"u"&&/Chrome/i.test(navigator&&navigator.userAgent)};function ss(e){var t=e.element,n=Math.floor(t.scrollTop),i=t.getBoundingClientRect();e.containerWidth=Math.round(i.width),e.containerHeight=Math.round(i.height),e.contentWidth=t.scrollWidth,e.contentHeight=t.scrollHeight,t.contains(e.scrollbarXRail)||(H_(t,pe.element.rail("x")).forEach(function(s){return Mo(s)}),t.appendChild(e.scrollbarXRail)),t.contains(e.scrollbarYRail)||(H_(t,pe.element.rail("y")).forEach(function(s){return Mo(s)}),t.appendChild(e.scrollbarYRail)),!e.settings.suppressScrollX&&e.containerWidth+e.settings.scrollXMarginOffset=e.railXWidth-e.scrollbarXWidth&&(e.scrollbarXLeft=e.railXWidth-e.scrollbarXWidth),e.scrollbarYTop>=e.railYHeight-e.scrollbarYHeight&&(e.scrollbarYTop=e.railYHeight-e.scrollbarYHeight),m4(t,e),e.scrollbarXActive?t.classList.add(pe.state.active("x")):(t.classList.remove(pe.state.active("x")),e.scrollbarXWidth=0,e.scrollbarXLeft=0,t.scrollLeft=e.isRtl===!0?e.contentWidth:0),e.scrollbarYActive?t.classList.add(pe.state.active("y")):(t.classList.remove(pe.state.active("y")),e.scrollbarYHeight=0,e.scrollbarYTop=0,t.scrollTop=0)}function U_(e,t){return e.settings.minScrollbarLength&&(t=Math.max(t,e.settings.minScrollbarLength)),e.settings.maxScrollbarLength&&(t=Math.min(t,e.settings.maxScrollbarLength)),t}function m4(e,t){var n={width:t.railXWidth},i=Math.floor(e.scrollTop);t.isRtl?n.left=t.negativeScrollAdjustment+e.scrollLeft+t.containerWidth-t.contentWidth:n.left=e.scrollLeft,t.isScrollbarXUsingBottom?n.bottom=t.scrollbarXBottom-i:n.top=t.scrollbarXTop+i,Ze(t.scrollbarXRail,n);var s={top:i,height:t.railYHeight};t.isScrollbarYUsingRight?t.isRtl?s.right=t.contentWidth-(t.negativeScrollAdjustment+e.scrollLeft)-t.scrollbarYRight-t.scrollbarYOuterWidth-9:s.right=t.scrollbarYRight-e.scrollLeft:t.isRtl?s.left=t.negativeScrollAdjustment+e.scrollLeft+t.containerWidth*2-t.contentWidth-t.scrollbarYLeft-t.scrollbarYOuterWidth:s.left=t.scrollbarYLeft+e.scrollLeft,Ze(t.scrollbarYRail,s),Ze(t.scrollbarX,{left:t.scrollbarXLeft,width:t.scrollbarXWidth-t.railBorderXWidth}),Ze(t.scrollbarY,{top:t.scrollbarYTop,height:t.scrollbarYHeight-t.railBorderYWidth})}function g4(e){e.element,e.event.bind(e.scrollbarY,"mousedown",function(t){return t.stopPropagation()}),e.event.bind(e.scrollbarYRail,"mousedown",function(t){var n=t.pageY-window.pageYOffset-e.scrollbarYRail.getBoundingClientRect().top,i=n>e.scrollbarYTop?1:-1;e.element.scrollTop+=i*e.containerHeight,ss(e),t.stopPropagation()}),e.event.bind(e.scrollbarX,"mousedown",function(t){return t.stopPropagation()}),e.event.bind(e.scrollbarXRail,"mousedown",function(t){var n=t.pageX-window.pageXOffset-e.scrollbarXRail.getBoundingClientRect().left,i=n>e.scrollbarXLeft?1:-1;e.element.scrollLeft+=i*e.containerWidth,ss(e),t.stopPropagation()})}function y4(e){Y_(e,["containerWidth","contentWidth","pageX","railXWidth","scrollbarX","scrollbarXWidth","scrollLeft","x","scrollbarXRail"]),Y_(e,["containerHeight","contentHeight","pageY","railYHeight","scrollbarY","scrollbarYHeight","scrollTop","y","scrollbarYRail"])}function Y_(e,t){var n=t[0],i=t[1],s=t[2],r=t[3],o=t[4],a=t[5],l=t[6],c=t[7],u=t[8],d=e.element,h=null,f=null,p=null;function m(g){g.touches&&g.touches[0]&&(g[s]=g.touches[0].pageY),d[l]=h+p*(g[s]-f),bT(e,c),ss(e),g.stopPropagation(),g.type.startsWith("touch")&&g.changedTouches.length>1&&g.preventDefault()}function v(){_T(e,c),e[u].classList.remove(pe.state.clicking),e.event.unbind(e.ownerDocument,"mousemove",m)}function y(g,x){h=d[l],x&&g.touches&&(g[s]=g.touches[0].pageY),f=g[s],p=(e[i]-e[n])/(e[r]-e[a]),x?e.event.bind(e.ownerDocument,"touchmove",m):(e.event.bind(e.ownerDocument,"mousemove",m),e.event.once(e.ownerDocument,"mouseup",v),g.preventDefault()),e[u].classList.add(pe.state.clicking),g.stopPropagation()}e.event.bind(e[o],"mousedown",function(g){y(g)}),e.event.bind(e[o],"touchstart",function(g){y(g,!0)})}function v4(e){var t=e.element,n=function(){return Ts(t,":hover")},i=function(){return Ts(e.scrollbarX,":focus")||Ts(e.scrollbarY,":focus")};function s(r,o){var a=Math.floor(t.scrollTop);if(r===0){if(!e.scrollbarYActive)return!1;if(a===0&&o>0||a>=e.contentHeight-e.containerHeight&&o<0)return!e.settings.wheelPropagation}var l=t.scrollLeft;if(o===0){if(!e.scrollbarXActive)return!1;if(l===0&&r<0||l>=e.contentWidth-e.containerWidth&&r>0)return!e.settings.wheelPropagation}return!0}e.event.bind(e.ownerDocument,"keydown",function(r){if(!(r.isDefaultPrevented&&r.isDefaultPrevented()||r.defaultPrevented)&&!(!n()&&!i())){var o=document.activeElement?document.activeElement:e.ownerDocument.activeElement;if(o){if(o.tagName==="IFRAME")o=o.contentDocument.activeElement;else for(;o.shadowRoot;)o=o.shadowRoot.activeElement;if(f4(o))return}var a=0,l=0;switch(r.which){case 37:r.metaKey?a=-e.contentWidth:r.altKey?a=-e.containerWidth:a=-30;break;case 38:r.metaKey?l=e.contentHeight:r.altKey?l=e.containerHeight:l=30;break;case 39:r.metaKey?a=e.contentWidth:r.altKey?a=e.containerWidth:a=30;break;case 40:r.metaKey?l=-e.contentHeight:r.altKey?l=-e.containerHeight:l=-30;break;case 32:r.shiftKey?l=e.containerHeight:l=-e.containerHeight;break;case 33:l=e.containerHeight;break;case 34:l=-e.containerHeight;break;case 36:l=e.contentHeight;break;case 35:l=-e.contentHeight;break;default:return}e.settings.suppressScrollX&&a!==0||e.settings.suppressScrollY&&l!==0||(t.scrollTop-=l,t.scrollLeft+=a,ss(e),s(a,l)&&r.preventDefault())}})}function x4(e){var t=e.element;function n(o,a){var l=Math.floor(t.scrollTop),c=t.scrollTop===0,u=l+t.offsetHeight===t.scrollHeight,d=t.scrollLeft===0,h=t.scrollLeft+t.offsetWidth===t.scrollWidth,f;return Math.abs(a)>Math.abs(o)?f=c||u:f=d||h,f?!e.settings.wheelPropagation:!0}function i(o){var a=o.deltaX,l=-1*o.deltaY;return(typeof a>"u"||typeof l>"u")&&(a=-1*o.wheelDeltaX/6,l=o.wheelDeltaY/6),o.deltaMode&&o.deltaMode===1&&(a*=10,l*=10),a!==a&&l!==l&&(a=0,l=o.wheelDelta),o.shiftKey?[-l,-a]:[a,l]}function s(o,a,l){if(!ao.isWebKit&&t.querySelector("select:focus"))return!0;if(!t.contains(o))return!1;for(var c=o;c&&c!==t;){if(c.classList.contains(pe.element.consuming))return!0;var u=mi(c);if(l&&u.overflowY.match(/(scroll|auto)/)){var d=c.scrollHeight-c.clientHeight;if(d>0&&(c.scrollTop>0&&l<0||c.scrollTop0))return!0}if(a&&u.overflowX.match(/(scroll|auto)/)){var h=c.scrollWidth-c.clientWidth;if(h>0&&(c.scrollLeft>0&&a<0||c.scrollLeft0))return!0}c=c.parentNode}return!1}function r(o){var a=i(o),l=a[0],c=a[1];if(!s(o.target,l,c)){var u=!1;e.settings.useBothWheelAxes?e.scrollbarYActive&&!e.scrollbarXActive?(c?t.scrollTop-=c*e.settings.wheelSpeed:t.scrollTop+=l*e.settings.wheelSpeed,u=!0):e.scrollbarXActive&&!e.scrollbarYActive&&(l?t.scrollLeft+=l*e.settings.wheelSpeed:t.scrollLeft-=c*e.settings.wheelSpeed,u=!0):(t.scrollTop-=c*e.settings.wheelSpeed,t.scrollLeft+=l*e.settings.wheelSpeed),ss(e),u=u||n(l,c),u&&!o.ctrlKey&&(o.stopPropagation(),o.preventDefault())}}typeof window.onwheel<"u"?e.event.bind(t,"wheel",r):typeof window.onmousewheel<"u"&&e.event.bind(t,"mousewheel",r)}function b4(e){if(!ao.supportsTouch&&!ao.supportsIePointer)return;var t=e.element;function n(p,m){var v=Math.floor(t.scrollTop),y=t.scrollLeft,g=Math.abs(p),x=Math.abs(m);if(x>g){if(m<0&&v===e.contentHeight-e.containerHeight||m>0&&v===0)return window.scrollY===0&&m>0&&ao.isChrome}else if(g>x&&(p<0&&y===e.contentWidth-e.containerWidth||p>0&&y===0))return!0;return!0}function i(p,m){t.scrollTop-=m,t.scrollLeft-=p,ss(e)}var s={},r=0,o={},a=null;function l(p){return p.targetTouches?p.targetTouches[0]:p}function c(p){return p.pointerType&&p.pointerType==="pen"&&p.buttons===0?!1:!!(p.targetTouches&&p.targetTouches.length===1||p.pointerType&&p.pointerType!=="mouse"&&p.pointerType!==p.MSPOINTER_TYPE_MOUSE)}function u(p){if(c(p)){var m=l(p);s.pageX=m.pageX,s.pageY=m.pageY,r=new Date().getTime(),a!==null&&clearInterval(a)}}function d(p,m,v){if(!t.contains(p))return!1;for(var y=p;y&&y!==t;){if(y.classList.contains(pe.element.consuming))return!0;var g=mi(y);if(v&&g.overflowY.match(/(scroll|auto)/)){var x=y.scrollHeight-y.clientHeight;if(x>0&&(y.scrollTop>0&&v<0||y.scrollTop0))return!0}if(m&&g.overflowX.match(/(scroll|auto)/)){var _=y.scrollWidth-y.clientWidth;if(_>0&&(y.scrollLeft>0&&m<0||y.scrollLeft<_&&m>0))return!0}y=y.parentNode}return!1}function h(p){if(c(p)){var m=l(p),v={pageX:m.pageX,pageY:m.pageY},y=v.pageX-s.pageX,g=v.pageY-s.pageY;if(d(p.target,y,g))return;i(y,g),s=v;var x=new Date().getTime(),_=x-r;_>0&&(o.x=y/_,o.y=g/_,r=x),n(y,g)&&p.preventDefault()}}function f(){e.settings.swipeEasing&&(clearInterval(a),a=setInterval(function(){if(e.isInitialized){clearInterval(a);return}if(!o.x&&!o.y){clearInterval(a);return}if(Math.abs(o.x)<.01&&Math.abs(o.y)<.01){clearInterval(a);return}if(!e.element){clearInterval(a);return}i(o.x*30,o.y*30),o.x*=.8,o.y*=.8},10))}ao.supportsTouch?(e.event.bind(t,"touchstart",u),e.event.bind(t,"touchmove",h),e.event.bind(t,"touchend",f)):ao.supportsIePointer&&(window.PointerEvent?(e.event.bind(t,"pointerdown",u),e.event.bind(t,"pointermove",h),e.event.bind(t,"pointerup",f)):window.MSPointerEvent&&(e.event.bind(t,"MSPointerDown",u),e.event.bind(t,"MSPointerMove",h),e.event.bind(t,"MSPointerUp",f)))}var _4=function(){return{handlers:["click-rail","drag-thumb","keyboard","wheel","touch"],maxScrollbarLength:null,minScrollbarLength:null,scrollingThreshold:1e3,scrollXMarginOffset:0,scrollYMarginOffset:0,suppressScrollX:!1,suppressScrollY:!1,swipeEasing:!0,useBothWheelAxes:!1,wheelPropagation:!0,wheelSpeed:1}},w4={"click-rail":g4,"drag-thumb":y4,keyboard:v4,wheel:x4,touch:b4},Pc=function(e,t){var n=this;if(t===void 0&&(t={}),typeof e=="string"&&(e=document.querySelector(e)),!e||!e.nodeName)throw new Error("no element is specified to initialize PerfectScrollbar");this.element=e,e.classList.add(pe.main),this.settings=_4();for(var i in t)this.settings[i]=t[i];this.containerWidth=null,this.containerHeight=null,this.contentWidth=null,this.contentHeight=null;var s=function(){return e.classList.add(pe.state.focus)},r=function(){return e.classList.remove(pe.state.focus)};this.isRtl=mi(e).direction==="rtl",this.isRtl===!0&&e.classList.add(pe.rtl),this.isNegativeScroll=function(){var l=e.scrollLeft,c=null;return e.scrollLeft=-1,c=e.scrollLeft<0,e.scrollLeft=l,c}(),this.negativeScrollAdjustment=this.isNegativeScroll?e.scrollWidth-e.clientWidth:0,this.event=new la,this.ownerDocument=e.ownerDocument||document,this.scrollbarXRail=Du(pe.element.rail("x")),e.appendChild(this.scrollbarXRail),this.scrollbarX=Du(pe.element.thumb("x")),this.scrollbarXRail.appendChild(this.scrollbarX),this.scrollbarX.setAttribute("tabindex",0),this.event.bind(this.scrollbarX,"focus",s),this.event.bind(this.scrollbarX,"blur",r),this.scrollbarXActive=null,this.scrollbarXWidth=null,this.scrollbarXLeft=null;var o=mi(this.scrollbarXRail);this.scrollbarXBottom=parseInt(o.bottom,10),isNaN(this.scrollbarXBottom)?(this.isScrollbarXUsingBottom=!1,this.scrollbarXTop=Jt(o.top)):this.isScrollbarXUsingBottom=!0,this.railBorderXWidth=Jt(o.borderLeftWidth)+Jt(o.borderRightWidth),Ze(this.scrollbarXRail,{display:"block"}),this.railXMarginWidth=Jt(o.marginLeft)+Jt(o.marginRight),Ze(this.scrollbarXRail,{display:""}),this.railXWidth=null,this.railXRatio=null,this.scrollbarYRail=Du(pe.element.rail("y")),e.appendChild(this.scrollbarYRail),this.scrollbarY=Du(pe.element.thumb("y")),this.scrollbarYRail.appendChild(this.scrollbarY),this.scrollbarY.setAttribute("tabindex",0),this.event.bind(this.scrollbarY,"focus",s),this.event.bind(this.scrollbarY,"blur",r),this.scrollbarYActive=null,this.scrollbarYHeight=null,this.scrollbarYTop=null;var a=mi(this.scrollbarYRail);this.scrollbarYRight=parseInt(a.right,10),isNaN(this.scrollbarYRight)?(this.isScrollbarYUsingRight=!1,this.scrollbarYLeft=Jt(a.left)):this.isScrollbarYUsingRight=!0,this.scrollbarYOuterWidth=this.isRtl?p4(this.scrollbarY):null,this.railBorderYWidth=Jt(a.borderTopWidth)+Jt(a.borderBottomWidth),Ze(this.scrollbarYRail,{display:"block"}),this.railYMarginHeight=Jt(a.marginTop)+Jt(a.marginBottom),Ze(this.scrollbarYRail,{display:""}),this.railYHeight=null,this.railYRatio=null,this.reach={x:e.scrollLeft<=0?"start":e.scrollLeft>=this.contentWidth-this.containerWidth?"end":null,y:e.scrollTop<=0?"start":e.scrollTop>=this.contentHeight-this.containerHeight?"end":null},this.isAlive=!0,this.settings.handlers.forEach(function(l){return w4[l](n)}),this.lastScrollTop=Math.floor(e.scrollTop),this.lastScrollLeft=e.scrollLeft,this.event.bind(this.element,"scroll",function(l){return n.onScroll(l)}),ss(this)};Pc.prototype.update=function(){this.isAlive&&(this.negativeScrollAdjustment=this.isNegativeScroll?this.element.scrollWidth-this.element.clientWidth:0,Ze(this.scrollbarXRail,{display:"block"}),Ze(this.scrollbarYRail,{display:"block"}),this.railXMarginWidth=Jt(mi(this.scrollbarXRail).marginLeft)+Jt(mi(this.scrollbarXRail).marginRight),this.railYMarginHeight=Jt(mi(this.scrollbarYRail).marginTop)+Jt(mi(this.scrollbarYRail).marginBottom),Ze(this.scrollbarXRail,{display:"none"}),Ze(this.scrollbarYRail,{display:"none"}),ss(this),ah(this,"top",0,!1,!0),ah(this,"left",0,!1,!0),Ze(this.scrollbarXRail,{display:""}),Ze(this.scrollbarYRail,{display:""}))};Pc.prototype.onScroll=function(e){this.isAlive&&(ss(this),ah(this,"top",this.element.scrollTop-this.lastScrollTop),ah(this,"left",this.element.scrollLeft-this.lastScrollLeft),this.lastScrollTop=Math.floor(this.element.scrollTop),this.lastScrollLeft=this.element.scrollLeft)};Pc.prototype.destroy=function(){this.isAlive&&(this.event.unbindAll(),Mo(this.scrollbarX),Mo(this.scrollbarY),Mo(this.scrollbarXRail),Mo(this.scrollbarYRail),this.removePsClasses(),this.element=null,this.scrollbarX=null,this.scrollbarY=null,this.scrollbarXRail=null,this.scrollbarYRail=null,this.isAlive=!1)};Pc.prototype.removePsClasses=function(){this.element.className=this.element.className.split(" ").filter(function(e){return!e.match(/^ps([-_].+|)$/)}).join(" ")};const k4=({className:e,sidenav:t,tag:n="div",handlers:i=["click-rail","drag-thumb","keyboard","wheel","touch"],wheelSpeed:s=1,wheelPropagation:r=!0,swipeEasing:o=!0,minScrollbarLength:a,maxScrollbarLength:l,scrollingThreshold:c=1e3,useBothWheelAxes:u=!1,suppressScrollX:d=!1,suppressScrollY:h=!1,scrollXMarginOffset:f=0,scrollYMarginOffset:p=0,scrollBarRef:m,onScrollY:v,onScrollX:y,onScrollUp:g,onScrollDown:x,onScrollLeft:_,onScrollRight:w,onYReachStart:S,onYReachEnd:C,onXReachStart:M,onXReachEnd:P,children:T,options:A,...E})=>{const z=I(t&&"sidenav-menu",e),N=k.useRef(null),L=k.useRef(null);return k.useEffect(()=>{let R=null;const B=[],D={handlers:i,wheelSpeed:s,wheelPropagation:r,swipeEasing:o,minScrollbarLength:a,maxScrollbarLength:l,scrollingThreshold:c,useBothWheelAxes:u,suppressScrollX:d,suppressScrollY:h,scrollXMarginOffset:f,scrollYMarginOffset:p,...A};if(!N.current)return;R=N.current,L.current=new Pc(R,D);const $={"ps-scroll-y":v,"ps-scroll-x":y,"ps-scroll-up":g,"ps-scroll-down":x,"ps-scroll-left":_,"ps-scroll-right":w,"ps-y-reach-start":S,"ps-y-reach-end":C,"ps-x-reach-start":M,"ps-x-reach-end":P};return Object.keys($).forEach(F=>{const V=$[F];if(typeof V=="function"&&R){const W=()=>V(R);B.push({eventName:F,handler:W}),R.addEventListener(F,W)}}),m&&m(L.current),()=>{var F;B.forEach(V=>{R==null||R.removeEventListener(V.eventName,V.handler)}),(F=L.current)==null||F.destroy(),L.current=null}},[i,s,r,o,a,l,c,u,d,h,f,p,m,v,y,g,x,_,w,S,C,M,P,A]),b.jsx(n,{className:z,ref:N,...E,children:T})},S4=Y.createContext({color:"primary"}),M4=Y.forwardRef(({className:e,children:t,...n},i)=>{const s=I("sidenav-menu",e);return b.jsx("ul",{className:s,ref:i,...n,children:t})});M4.displayName="MDBSideNavMenu";const C4=Y.forwardRef(({className:e,children:t,...n},i)=>{const s=I("sidenav-item",e);return b.jsx("li",{className:s,ref:i,...n,children:t})});C4.displayName="MDBSideNavItem";const P4=Y.forwardRef(({className:e,icon:t,iconClasses:n,iconAngle:i=180,shouldBeExpanded:s,children:r,active:o,tag:a="a",...l},c)=>{const{color:u}=k.useContext(S4),d=I("sidenav-link",o&&"active",e),h=I("rotate-icon",n),[f,p]=k.useState(s?i:0);return k.useEffect(()=>{p(s?i:0)},[s,i]),b.jsxs(v0,{rippleTag:a,onKeyDown:m=>{m.key==="Enter"&&m.target.click()},tabIndex:1,rippleColor:u,className:d,ref:c,...l,children:[r,t&&b.jsx(sn,{icon:t,style:{transform:`rotate(${f}deg)`},className:h})]})});P4.displayName="MDBSideNavLink";const kT=Y.forwardRef(({className:e,centered:t,children:n,size:i,scrollable:s,tag:r="div",...o},a)=>{const l=I("modal-dialog",s&&"modal-dialog-scrollable",t&&"modal-dialog-centered",i&&`modal-${i}`,e);return b.jsx(r,{className:l,...o,ref:a,children:n})});kT.displayName="MDBModalDialog";const T4=Y.forwardRef(({className:e,side:t,frame:n,position:i,children:s,tag:r="div",...o},a)=>{const l=I(t&&"modal-side",n&&"modal-frame",i&&`modal-${i}`,e);return b.jsx(kT,{className:l,...o,tag:r,ref:a,children:s})});T4.displayName="MDBModalDialog";const nf=Y.createContext({onDatetimepickerModeSwitch:()=>null,isInDatetimepicker:!1,setInputValue:null,setActiveHour:null,setActiveMinute:null,setPeriod:null,setMode:null,setHandAnimation:null,setMinuteAngle:null,setHourAngle:null,submitLabel:"",clearLabel:"",cancelLabel:"",activeHour:12,activeMinute:12,format:"12h",period:"",defaultValue:"",minHour:0,maxHour:23,minPeriod:"",maxPeriod:"",mode:"hours",handAnimation:!1,maxMinute:59,minMinute:0,minuteAngle:360,hourAngle:360,inline:!1,increment:!1,onChange:()=>null,onOpen:()=>null,onClose:()=>null,onCloseHandler:()=>null,amLabel:"AM",pmLabel:"PM",switchHoursToMinutesOnClick:!0,headId:"",bodyId:""}),ld=e=>{const t=e.split(":"),n=t[0],i=t[1].split(" ")[1],s=t[1].split(" ")[0];return{hour:parseInt(n),minute:parseInt(s),defaultPeriod:i}},X_=(e,t)=>(t==="24h"?/^([01]\d|2[0-3])(:[0-5]\d)$/:/^(0?[1-9]|1[012])(:[0-5]\d) [APap][mM]$/).test(e),Ki=(e,t,n,i,s,r)=>{let o=!1;return t&&(s!==""?e>t&&i===s&&(o=!0):e>t&&(o=!0)),n&&(r!==""?eKi(i,s,r,o,a,l)&&(n===t||n===e),D4=(e,t,n)=>{t.split(" ").forEach(i=>{e.addEventListener(i,n)})},E4=(e,t,n)=>{t.split(" ").forEach(i=>{e.removeEventListener(i,n)})},ST=(e,t)=>{const n=t.x-e.x,i=t.y-e.y;return Math.sqrt(n*n+i*i)},A4=(e,t)=>{const n=2*Math.atan2(t.y-e.y-ST(e,t),t.x-e.x);return Math.abs(n*180/Math.PI)},K_=e=>({radius:(e-32)/2-4}),O4=e=>{const t=new Date;let n=t.getHours();const i=t.getMinutes();if(e==="24h")return{hours:n,minutes:i,period:""};const s=n>=12?"PM":"AM";return n=n%12,n=n||12,{hours:n,minutes:i,period:s}},xp=(e,t)=>{const n=e.getMinutes();let i=e.getHours(),s;i===24&&(i=0);const r=i>=12?"PM":"AM";return t=="24h"?s=i<10?`0${i}:${n}`:`${i}:${n}`:t=="12h"&&(s=`${(i+24)%12||12}:${n} ${r}`),s},ig=Y.forwardRef(({...e},t)=>{const{activeHour:n,format:i,period:s,setPeriod:r,mode:o,setMode:a,activeMinute:l,setHandAnimation:c,inline:u,setActiveHour:d,setActiveMinute:h,maxHour:f,maxMinute:p,minHour:m,minMinute:v,maxPeriod:y,minPeriod:g,setInputValue:x,increment:_,submitLabel:w,onChange:S,onCloseHandler:C,amLabel:M,pmLabel:P,headId:T,show:A,onDatetimepickerModeSwitch:E,isInDatetimepicker:z}=k.useContext(nf),N=D=>{a(D),c(!0)},L=()=>{if(Ki(n,f,m,s,y,g)||Ki(l,p,v,s,y,g)||!A)return;C==null||C();const D=n===24?"00":n<10?`0${n}`:n,$=l<10?`0${l}`:l,F=`${D}:${$} ${s}`.trim();x(F),S==null||S(F)},R=(D,$)=>{const F=i==="12h"?12:24;if($.type==="click")return d(D?V=>V===F?1:V+1:V=>V===1?F:V-1);if($.type==="mousedown"){const V=setTimeout(()=>{const et=setInterval(()=>{d(D?O=>O===F?1:O+1:O=>O===1?F:O-1)},100),Z=()=>{clearInterval(et),document.removeEventListener("mouseup",Z)};document.addEventListener("mouseup",Z)},300),W=()=>{clearTimeout(V),document.removeEventListener("mouseup",W)};document.addEventListener("mouseup",W)}},B=(D,$)=>{const F=_?55:59,V=_?5:1;if($.type==="click")return h(D?W=>W>=F?0:W+V:W=>W-V<0?F:W-V);if($.type==="mousedown"){const W=setTimeout(()=>{const Z=setInterval(()=>{h(D?U=>U>=F?0:U+V:U=>U-V<0?F:U-V)},100),O=()=>{clearInterval(Z),document.removeEventListener("mouseup",O)};document.addEventListener("mouseup",O)},300),et=()=>{clearTimeout(W),document.removeEventListener("mouseup",et)};document.addEventListener("mouseup",et)}};return u?b.jsx("div",{id:T,className:"timepicker-head d-flex flex-row align-items-center justify-content-center timepicker-head-inline",style:{paddingRight:"0px"},ref:t,...e,children:b.jsxs("div",{className:"timepicker-head-content d-flex w-100 justify-content-evenly align-items-center",children:[b.jsxs("div",{className:"timepicker-current-wrapper",children:[b.jsxs("span",{className:"position-relative h-100 timepicker-inline-hour-icons",children:[b.jsx(sn,{fas:!0,icon:"chevron-up",style:{display:"flex"},className:"position-absolute text-white timepicker-icon-up timepicker-icon-inline-hour",onClick:D=>R(!0,D),onMouseDown:D=>R(!0,D)}),b.jsx(Zt,{type:"button",color:"none",onClick:()=>{N("hours")},className:`timepicker-current timepicker-current-inline timepicker-hour ${o==="hours"&&"active"}`,tabIndex:0,style:{pointerEvents:o==="hours"?"none":void 0},onFocus:()=>{N("hours")},children:n===24?"00":n<10?`0${n}`:n}),b.jsx(sn,{fas:!0,icon:"chevron-down",style:{display:"flex"},className:"position-absolute text-white timepicker-icon-down timepicker-icon-inline-hour",onClick:D=>R(!1,D),onMouseDown:D=>R(!1,D)})]}),b.jsx(Zt,{color:"none",className:"timepicker-dot timepicker-current-inline",disabled:!0,children:":"}),b.jsxs("span",{className:"position-relative h-100 timepicker-inline-minutes-icons",children:[b.jsx(sn,{fas:!0,icon:"chevron-up",style:{display:"flex"},className:"position-absolute text-white timepicker-icon-up timepicker-icon-inline-minute",onClick:D=>B(!0,D),onMouseDown:D=>B(!0,D)}),b.jsx(Zt,{onClick:()=>{N("minutes")},type:"button",color:"none",className:`timepicker-current timepicker-current-inline timepicker-minute ${o==="minutes"&&"active"}`,tabIndex:0,style:{pointerEvents:o==="minutes"?"none":void 0},onFocus:()=>{N("minutes")},children:l<10?`0${l}`:l}),b.jsx(sn,{fas:!0,icon:"chevron-down",style:{display:"flex"},className:"position-absolute text-white timepicker-icon-down timepicker-icon-inline-minute",onClick:D=>B(!1,D),onMouseDown:D=>B(!1,D)})]})]}),b.jsxs("div",{className:"d-flex justify-content-center timepicker-mode-wrapper",children:[i==="12h"&&b.jsxs(b.Fragment,{children:[b.jsx(Zt,{onClick:()=>r("AM"),type:"button",color:"none",className:`timepicker-hour-mode timepicker-am me-2 ms-4 ${s.toLowerCase()==="am"&&"active"}`,tabIndex:0,children:M}),b.jsx(Zt,{onClick:()=>r("PM"),type:"button",color:"none",className:`timepicker-hour-mode timepicker-pm ${s.toLowerCase()==="pm"&&"active"}`,tabIndex:0,children:P})]}),b.jsx(Zt,{type:"button",color:"none",className:"timepicker-button timepicker-submit timepicker-submit-inline py-1 px-2 mb-0",tabIndex:0,onClick:L,children:w})]})]})}):b.jsxs(b.Fragment,{children:[b.jsx("div",{id:T,className:"timepicker-head d-flex flex-row align-items-center justify-content-center",style:{paddingRight:"0px"},ref:t,...e,children:b.jsxs("div",{className:"timepicker-head-content d-flex w-100 justify-content-evenly",style:{paddingRight:i==="24h"?"50px":""},children:[b.jsxs("div",{className:"timepicker-current-wrapper",children:[b.jsx("span",{className:"position-relative h-100",children:b.jsx(Zt,{type:"button",color:"none",onClick:()=>{N("hours")},className:`timepicker-current timepicker-hour ${o==="hours"&&"active"}`,tabIndex:0,style:{pointerEvents:o==="hours"?"none":void 0},children:n===24?"00":n<10?`0${n}`:n})}),b.jsx(Zt,{color:"none",className:"timepicker-dot",disabled:!0,children:":"}),b.jsx("span",{className:"position-relative h-100",children:b.jsx(Zt,{onClick:()=>{N("minutes")},type:"button",color:"none",className:`timepicker-current timepicker-minute ${o==="minutes"&&"active"}`,tabIndex:0,style:{pointerEvents:o==="minutes"?"none":void 0},children:l<10?`0${l}`:l})})]}),i==="12h"&&b.jsxs("div",{className:"d-flex flex-column justify-content-center timepicker-mode-wrapper",children:[b.jsx(Zt,{onClick:()=>r("AM"),type:"button",color:"none",className:`timepicker-hour-mode timepicker-am ${s.toLowerCase()==="am"&&"active"}`,tabIndex:0,children:M}),b.jsx(Zt,{onClick:()=>r("PM"),type:"button",color:"none",className:`timepicker-hour-mode timepicker-pm ${s.toLowerCase()==="pm"&&"active"}`,tabIndex:0,children:P})]})]})}),z&&b.jsxs("div",{className:"buttons-container",children:[b.jsx("button",{type:"button",className:"datepicker-button-toggle",onClick:E,children:b.jsx("i",{className:"far fa-calendar datepicker-toggle-icon"})}),b.jsx("button",{type:"button",className:"timepicker-button-toggle",children:b.jsx("i",{className:"far fa-clock fa-sm timepicker-icon"})})]})]})});ig.displayName="MDBTimePickerHeader";const bp={hours:[{value:1,left:"169px",bottom:"209.263px",angle:30,id:`hour-1-${Math.floor(Math.random()*1001)}`},{value:2,left:"209.263px",bottom:"169px",angle:60,id:`hour-2-${Math.floor(Math.random()*1001)}`},{value:3,left:"224px",bottom:"114px",angle:90,id:`hour-3-${Math.floor(Math.random()*1001)}`},{value:4,left:"209.263px",bottom:"59px",angle:120,id:`hour-4-${Math.floor(Math.random()*1001)}`},{value:5,left:"169px",bottom:"18.7372px",angle:150,id:`hour-5-${Math.floor(Math.random()*1001)}`},{value:6,left:"114px",bottom:"4px",angle:180,id:`hour-6-${Math.floor(Math.random()*1001)}`},{value:7,left:"59px",bottom:"18.7372px",angle:210,id:`hour-7-${Math.floor(Math.random()*1001)}`},{value:8,left:"18.7372px",bottom:"59px",angle:240,id:`hour-8-${Math.floor(Math.random()*1001)}`},{value:9,left:"4px",bottom:"114px",angle:270,id:`hour-9-${Math.floor(Math.random()*1001)}`},{value:10,left:"18.7372px",bottom:"169px",angle:300,id:`hour-10-${Math.floor(Math.random()*1001)}`},{value:11,left:"59px",bottom:"209.263px",angle:330,id:`hour-11-${Math.floor(Math.random()*1001)}`},{value:12,left:"114px",bottom:"224px",angle:360,id:`hour-12-${Math.floor(Math.random()*1001)}`},{value:13,left:"94px",bottom:"115.962px",angle:30,id:`hour-13-${Math.floor(Math.random()*1001)}`},{value:14,left:"115.962px",bottom:"94px",angle:60,id:`hour-14-${Math.floor(Math.random()*1001)}`},{value:15,left:"124px",bottom:"64px",angle:90,id:`hour-15-${Math.floor(Math.random()*1001)}`},{value:16,left:"115.962px",bottom:"34px",angle:120,id:`hour-16-${Math.floor(Math.random()*1001)}`},{value:17,left:"94px",bottom:"12.0385px",angle:150,id:`hour-17-${Math.floor(Math.random()*1001)}`},{value:18,left:"64px",bottom:"4px",angle:180,id:`hour-18-${Math.floor(Math.random()*1001)}`},{value:19,left:"34px",bottom:"12.0385px",angle:210,id:`hour-19-${Math.floor(Math.random()*1001)}`},{value:20,left:"12.0385px",bottom:"34px",angle:240,id:`hour-20-${Math.floor(Math.random()*1001)}`},{value:21,left:"4px",bottom:"64px",angle:270,id:`hour-21-${Math.floor(Math.random()*1001)}`},{value:22,left:"12.0385px",bottom:"94px",angle:300,id:`hour-22-${Math.floor(Math.random()*1001)}`},{value:23,left:"34px",bottom:"115.962px",angle:330,id:`hour-23-${Math.floor(Math.random()*1001)}`},{value:24,left:"64px",bottom:"124px",angle:360,id:`hour-0-${Math.floor(Math.random()*1001)}`}],minutes:[{value:0,left:"114px",bottom:"224px",angle:360,id:`minute-0-${Math.floor(Math.random()*1001)}`},{value:5,left:"169px",bottom:"209.263px",angle:30,id:`minute-5-${Math.floor(Math.random()*1001)}`},{value:10,left:"209.263px",bottom:"169px",angle:60,id:`minute-10-${Math.floor(Math.random()*1001)}`},{value:15,left:"224px",bottom:"114px",angle:90,id:`minute-15-${Math.floor(Math.random()*1001)}`},{value:20,left:"209.263px",bottom:"59px",angle:120,id:`minute-20-${Math.floor(Math.random()*1001)}`},{value:25,left:"169px",bottom:"18.7372px",angle:150,id:`minute-25-${Math.floor(Math.random()*1001)}`},{value:30,left:"114px",bottom:"4px",angle:180,id:`minute-30-${Math.floor(Math.random()*1001)}`},{value:35,left:"59px",bottom:"18.7372px",angle:210,id:`minute-35-${Math.floor(Math.random()*1001)}`},{value:40,left:"18.7372px",bottom:"59px",angle:240,id:`minute-40-${Math.floor(Math.random()*1001)}`},{value:45,left:"4px",bottom:"114px",angle:270,id:`minute-45-${Math.floor(Math.random()*1001)}`},{value:50,left:"18.7372px",bottom:"169px",angle:300,id:`minute-50-${Math.floor(Math.random()*1001)}`},{value:55,left:"59px",bottom:"209.263px",angle:330,id:`minute-55-${Math.floor(Math.random()*1001)}`}]},MT=Y.forwardRef(({...e},t)=>{const n=k.useRef(null),i=k.useRef(null),[s,r]=k.useState(!1),[o,a]=k.useState(0),[l,c]=k.useState(0),{setActiveHour:u,format:d,activeHour:h,minHour:f,maxHour:p,minPeriod:m,maxPeriod:v,period:y,mode:g,setMode:x,activeMinute:_,setActiveMinute:w,setHandAnimation:S,handAnimation:C,maxMinute:M,minMinute:P,hourAngle:T,setHourAngle:A,minuteAngle:E,setMinuteAngle:z,increment:N,switchHoursToMinutesOnClick:L,bodyId:R}=k.useContext(nf),B=d==="24h"?bp.hours:bp.hours.filter(O=>O.value<13&&O.value!==0),D=bp.minutes,[$,F]=k.useState("calc(40% + 1px)"),V=k.useCallback(A4,[]),W=O=>{O.preventDefault(),r(!0)},et=O=>{O.preventDefault(),r(!1),g==="hours"&&(L&&x("minutes"),S(!0))},Z=k.useCallback(O=>{var U;const{width:lt,top:ct,left:kt}=(U=n.current)==null?void 0:U.getBoundingClientRect(),{clientX:it,clientY:Lt}="touches"in O?O.touches[0]:O,Ct={x:lt/2,y:-lt/2},Qt={x:it-kt,y:ct-Lt},ft=Math.round(V(Ct,Qt)+360)%360;if(g==="hours"){const wt=30*Math.round(ft/30);let dt=wt/30;if(d==="24h"){const{radius:jt}=K_(o),{radius:pt}=K_(l);ST(Ct,Qt)<(jt+pt)/2-16&&(dt+=12)}Ki(dt,p,f,y,v,m)||(u(dt),A(wt))}else if(ft===0)vp(f,p,h,0,M,P,y,v,m)||(w(0),z(360));else{const wt=N?30:6,dt=wt*Math.round(ft/wt);vp(f,p,h,dt/6,M,P,y,v,m)||(w(dt/6===60?0:dt/6),z(dt))}},[V,h,M,P,v,m,g,y,w,p,f,u,l,o,d,A,z,N]);return k.useEffect(()=>{n.current&&a(n.current.offsetWidth),i.current&&c(i.current.offsetWidth)},[]),k.useEffect(()=>(s&&D4(document,"mouseup mousemove mouseleave mouseover touchstart touchmove touchend",Z),()=>{E4(document,"mouseup mousemove mouseleave mouseover touchstart touchmove touchend",Z)}),[s,Z]),k.useEffect(()=>{const O=B.find(U=>U.value===h);O!==void 0&&(O.value>12||O.value===24?F("21.5%"):F("calc(40% + 1px)"))},[B,h]),b.jsx("div",{id:R,className:"timepicker-clock-wrapper d-flex justify-content-center flex-column align-items-center",ref:t,...e,children:b.jsxs("div",{onMouseDown:O=>W(O),onMouseUp:O=>et(O),ref:n,className:"timepicker-clock timepicker-clock-animation",children:[b.jsx("span",{className:"timepicker-middle-dot position-absolute"}),b.jsx("div",{className:`timepicker-hand-pointer position-absolute ${C&&"timepicker-transform"}`,style:{transform:`rotateZ(${g==="hours"?T:E}deg)`,height:g==="hours"?$:"calc(40% + 1px)"},children:b.jsx("div",{className:"timepicker-circle position-absolute",style:{backgroundColor:"rgb(25, 118, 210)"}})}),g==="hours"&&d==="24h"&&b.jsx("div",{ref:i,className:"timepicker-clock-inner",children:B.map(O=>{if(O.value>12||O.value===0)return b.jsx("span",{id:O.id,className:`timepicker-time-tips-inner ${Ki(O.value,p,f,y,v,m)&&"disabled"} ${O.value===h&&"active"}`,style:{left:O.left,bottom:O.bottom},children:b.jsx("span",{className:"timepicker-tips-inner-element",children:O.value===24?"00":O.value})},O.id)})}),g==="hours"&&B.map(O=>{if(d==="24h"){if(O.value<13&&O.value!==0)return b.jsx("span",{id:O.id,className:`timepicker-time-tips-hours ${Ki(O.value,p,f,y,v,m)&&"disabled"} ${O.value===h&&"active"}`,style:{left:O.left,bottom:O.bottom},children:b.jsx("span",{className:"timepicker-tips-element",children:O.value})},O.id)}else return b.jsx("span",{id:O.id,className:`timepicker-time-tips-hours ${Ki(O.value,p,f,y,v,m)&&"disabled"} ${O.value===h&&"active"}`,style:{left:O.left,bottom:O.bottom},children:b.jsx("span",{className:"timepicker-tips-element",children:O.value})},O.id)}),g==="minutes"&&D.map(O=>b.jsx("span",{id:O.id,className:`timepicker-time-tips-minutes ${vp(f,p,h,O.value,M,P,y,v,m)&&"disabled"} ${_===O.value&&"active"}`,style:{left:O.left,bottom:O.bottom},children:b.jsx("span",{className:"timepicker-tips-element",children:O.value<10?`0${O.value}`:O.value})},O.id))]})})});MT.displayName="MDBTimePickerClock";const CT=Y.forwardRef(({...e},t)=>{const{setInputValue:n,cancelLabel:i,submitLabel:s,clearLabel:r,activeHour:o,period:a,activeMinute:l,maxHour:c,maxMinute:u,minHour:d,minMinute:h,maxPeriod:f,minPeriod:p,defaultValue:m,setActiveHour:v,setActiveMinute:y,setPeriod:g,format:x,setHourAngle:_,setMinuteAngle:w,onChange:S,onCloseHandler:C,setMode:M}=k.useContext(nf);return b.jsx("div",{className:"timepicker-footer",ref:t,...e,children:b.jsxs("div",{className:"w-100 d-flex justify-content-between",children:[b.jsx(Zt,{onClick:()=>{if(m!==""&&m!==void 0){const{hour:P,minute:T,defaultPeriod:A}=ld(m);x==="24h"?(v(P===0?24:P),P===0?_(360):P>12?_((P-12)*30):_(P*30)):(v(P),_(P*30),g(A)),y(T),w(T*6),n(m),S==null||S(m)}else v(12),_(360),y(0),w(360),n(""),S==null||S(""),g(x==="24h"?"":"AM");M("hours")},type:"button",color:"none",className:"timepicker-button timepicker-clear",tabIndex:0,children:r}),b.jsx(Zt,{onClick:()=>C==null?void 0:C(),type:"button",color:"none",className:"timepicker-button timepicker-cancel",tabIndex:0,children:i}),b.jsx(Zt,{onClick:()=>{if(Ki(o,c,d,a,f,p)||Ki(l,u,h,a,f,p))return;C==null||C();const P=o===24?"00":o<10?`0${o}`:o,T=l<10?`0${l}`:l,A=`${P}:${T} ${a}`.trim();n(A),S==null||S(A)},type:"button",color:"none",className:"timepicker-button timepicker-submit",tabIndex:0,children:s})]})})});CT.displayName="MDBTimePickerFooter";const L4=({isOpen:e,inline:t})=>{k.useEffect(()=>{if(t)return;const n=window.innerWidth>document.documentElement.clientWidth&&window.innerWidth>=576,i=`${window.innerWidth-document.documentElement.clientWidth}px`;return e&&n?(document.body.style.overflow="hidden",document.body.style.paddingRight=i):(document.body.style.overflow="",document.body.style.paddingRight=""),()=>{document.body.style.overflow="",document.body.style.paddingRight=""}},[e,t])},R4=({className:e,isOpen:t,wrapperRef:n,inline:i,referenceElement:s,onOpened:r,onClosed:o})=>{const[a,l]=k.useState(null),c=I("timepicker-modal",!i&&"position-fixed",e),u=I("timepicker-wrapper","animation","h-100","d-flex","align-items-center","justify-content-center","flex-column",i?"timepicker-wrapper-inline":"position-fixed","fade",t&&"show"),{styles:d,attributes:h}=Oh(s,a,{placement:"bottom-start"}),f=p=>{p.opacity===0?o():r()};return L4({isOpen:t,inline:i}),b.jsx(b.Fragment,{children:b.jsx(aa,{children:b.jsx(Zy,{children:t&&(i?b.jsx(Jo.div,{className:c,style:d.popper,...h.popper,role:"dialog",ref:l,tabIndex:-1,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onAnimationComplete:p=>f(p),children:b.jsx("div",{ref:n,className:u,children:b.jsx("div",{className:"d-flex align-items-center justify-content-center flex-column shadow timepicker-container",style:{overflowY:"inherit"},children:b.jsx("div",{className:"d-flex flex-column timepicker-elements justify-content-around timepicker-elements-inline",children:b.jsx(ig,{})})})})}):b.jsx(Jo.div,{className:c,role:"dialog",tabIndex:-1,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},onAnimationComplete:p=>f(p),children:b.jsx("div",{ref:n,className:u,children:b.jsxs("div",{className:"d-flex align-items-center justify-content-center flex-column shadow timepicker-container",children:[b.jsxs("div",{className:"d-flex flex-column timepicker-elements justify-content-around",children:[b.jsx(ig,{}),b.jsx(MT,{})]}),b.jsx(CT,{})]})})}))})})})},G_=(e,t,n,i,s)=>{const r=n?55:59,o=n?5:1;let a;s?a=i>=r?0:i+o:a=i<=0?r:i-o,e(a),t(a*6)},Au=(e,t,n,i,s,r)=>{if(r&&e==="24h"){let l=t;r==="isLeft"&&(l=t<=12?t+12:t),r==="isRight"&&(l=t>12?t-12:t),n(l),i(l*30);return}const o=e==="12h"?12:24;let a=t===1?o:t-1;s?a=t===o?1:t+1:a=t===1?o:t-1,n(a),i(a*30)},q_=(e,t,n)=>{const i=n==null?void 0:n.querySelectorAll('[tabindex="0"]');i&&i[t]&&(i[t].focus(),t===i.length-1?e(0):e(t+1))},N4=(e,t,n,i,s,r)=>{var o;!t&&e.target===n&&r&&(r==null||r()),t&&e.target!==n&&!(n!=null&&n.contains(e.target))&&e.target!==(i==null?void 0:i.parentNode)&&!((o=i==null?void 0:i.parentNode)!=null&&o.contains(e.target))&&s&&(r==null||r())},Q_="ArrowLeft",Z_="ArrowUp",J_="ArrowRight",tw="ArrowDown",ew="Enter",nw="Escape",iw="Tab",PT=k.forwardRef(({isInDatetimepicker:e,onDatetimepickerModeSwitch:t,datetimepickerRef:n,className:i,defaultValue:s,value:r,minHour:o,maxHour:a,maxTime:l,minTime:c,noIcon:u=!1,inputID:d,justInput:h=!1,inputClasses:f,inputLabel:p,invalidLabel:m,clearLabel:v,submitLabel:y,cancelLabel:g,format:x="12h",timePickerClasses:_,customIcon:w="far fa-clock",customIconSize:S="sm",btnIcon:C=!0,inline:M=!1,increment:P=!1,onChange:T,inputStyle:A,onOpen:E,onOpened:z,onClose:N,onClosed:L,disableFuture:R,disablePast:B,disabled:D=!1,amLabel:$="AM",pmLabel:F="PM",switchHoursToMinutesOnClick:V=!0,headId:W="",bodyId:et="",open:Z,style:O,...U},lt)=>{const ct=k.useMemo(()=>s instanceof Date?xp(s,x):s,[]),kt=k.useMemo(()=>r instanceof Date?xp(r,x):r,[r,x]),[it,Lt]=k.useState(!1),[Ct,Qt]=k.useState(!1),ft=ef(Ct,Z),[wt,dt]=k.useState(kt||ct||""),[jt,pt]=k.useState(!1),[xt,J]=k.useState(12),[mt,q]=k.useState(0),[ye,Dt]=k.useState(x==="24h"?"":"AM"),[he,Un]=k.useState(a||24),[Yn,Mn]=k.useState(o||1),[Si,dn]=k.useState(59),[Mi,as]=k.useState(0),[ls,Ci]=k.useState(""),[Pi,Ke]=k.useState(""),[Xn,Ti]=k.useState("hours"),[j,Q]=k.useState(!1),[It,nt]=k.useState(360),[Tt,Oe]=k.useState(360),[cs,ai]=k.useState(null),[Kn,Me]=k.useState(0);s instanceof Date&&(s=xp(s,x));const Kr=k.useId(),Gr=d??Kr,Cn={input:p??"Select a time",invalid:m??"Invalid Time Format",clear:v??"Clear",submit:y??"Ok",cancel:g??"Cancel"},ca=I("timepicker",i),Dc=I("timepicker-input",jt&&"is-invalid",f),sf=k.useRef(null),G=k.useRef(null),X=k.useRef(null),rt=k.useRef(null);k.useImperativeHandle(lt,()=>rt.current,[rt]);const ht=Rt=>{dt(Rt.target.value),T==null||T(Rt.target.value)},hn=Rt=>{h&&(Rt.target.blur(),E==null||E())},us=k.useCallback(()=>{Qt(!1),N==null||N()},[N]),Ge=k.useCallback(()=>{Qt(!0),E==null||E()},[E]),fn=k.useCallback(()=>{Lt(!1),L==null||L(),Ti("hours"),Me(0)},[L]),NT=k.useCallback(()=>{Lt(!0),z==null||z()},[z]),rf=k.useCallback(Rt=>{it&&N4(Rt,M,X.current,rt.current,ft,us)},[X,M,rt,ft,us,it]),of=k.useCallback(Rt=>{var Pn,pn;const{key:A0}=Rt,ua=document.activeElement,jT=ua===((Pn=X.current)==null?void 0:Pn.querySelector(".timepicker-hour")),$T=ua===((pn=X.current)==null?void 0:pn.querySelector(".timepicker-minute")),IT=ua==null?void 0:ua.closest('.timepicker-modal [tabindex="0"]');if(![tw,Z_,nw,iw,ew,Q_,J_].includes(A0))return;M&&!IT&&q_(Me,0,X.current),Rt.preventDefault();const Ec=!M&&Xn==="hours"||M&&jT,O0=!M&&Xn==="minutes"||M&&$T;switch(A0){case nw:return N==null?void 0:N();case Z_:if(Ec)return Au(x,xt,J,nt,!0);if(O0)return G_(q,Oe,P,mt,!0);break;case tw:if(Ec)return Au(x,xt,J,nt,!1);if(O0)return G_(q,Oe,P,mt,!1);break;case Q_:if(Ec&&!M)return Au(x,xt,J,nt,!1,"isLeft");break;case J_:if(Ec&&!M)return Au(x,xt,J,nt,!0,"isRight");break;case iw:q_(Me,Kn,X.current);break;case ew:ua.click();break}},[xt,x,Xn,mt,P,M,Kn,N]);return k.useEffect(()=>{if(!B&&!R)return;const{hours:Rt,minutes:Pn,period:pn}=O4(x);if(B)return Mn(Rt),as(Pn),Ci(pn);if(R)return Un(Rt),dn(Pn),Ke(pn)},[R,B,x]),k.useEffect(()=>(ft&&it&&(document.addEventListener("click",rf),document.addEventListener("keydown",of)),()=>{document.removeEventListener("click",rf),document.removeEventListener("keydown",of)}),[ft,it,rf,of]),k.useEffect(()=>{if(l){const{hour:Rt,minute:Pn,defaultPeriod:pn}=ld(l);Un(Rt),dn(Pn),pn!==void 0&&Ke(pn)}if(c){const{hour:Rt,minute:Pn,defaultPeriod:pn}=ld(c);Mn(Rt),as(Pn),pn!==void 0&&Ci(pn)}},[l,c]),k.useEffect(()=>{typeof r=="string"&&r&&X_(r,x)&&dt(r)},[r,x]),k.useEffect(()=>{if(X_(wt,x)||wt===""){if(pt(!1),wt!==""){const{hour:Rt,minute:Pn,defaultPeriod:pn}=ld(wt);x==="24h"?(J(Rt===0?24:Rt),Rt===0?nt(360):Rt>12?nt((Rt-12)*30):nt(Rt*30)):(J(Rt),nt(Rt*30),Dt(pn)),q(Pn),Oe(Pn*6)}}else pt(!0)},[wt,x]),k.useEffect(()=>{let Rt;return j&&(Rt=setTimeout(()=>{Q(!1)},400)),()=>{clearTimeout(Rt)}},[j]),b.jsx(b.Fragment,{children:b.jsx(nf.Provider,{value:{isInDatetimepicker:e,onDatetimepickerModeSwitch:t,show:ft,setInputValue:dt,submitLabel:Cn.submit,clearLabel:Cn.clear,cancelLabel:Cn.cancel,activeHour:xt,activeMinute:mt,setActiveHour:J,setActiveMinute:q,format:x,period:ye,setPeriod:Dt,defaultValue:s,maxHour:he,minHour:Yn,maxPeriod:Pi,minPeriod:ls,mode:Xn,setMode:Ti,setHandAnimation:Q,handAnimation:j,minMinute:Mi,maxMinute:Si,hourAngle:It,setHourAngle:nt,minuteAngle:Tt,setMinuteAngle:Oe,inline:M,increment:P,onChange:T,onOpen:E,onClose:N,onCloseHandler:us,amLabel:$,pmLabel:F,switchHoursToMinutesOnClick:V,headId:W,bodyId:et},children:b.jsxs(b.Fragment,{children:[b.jsx("div",{className:ca,ref:M?ai:sf,style:{...O,height:"fit-content"},...U,children:!e&&b.jsx(wi,{onFocus:hn,ref:rt,labelRef:G,className:Dc,label:Cn.input,id:Gr,value:wt,onChange:ht,wrapperClass:"timepicker",style:A,disabled:D,onClick:()=>{h&&Ge()},children:!h&&!u&&(C?b.jsx(Zt,{className:"timepicker-toggle-button",onClick:Ge,color:"none",tabIndex:0,type:"button",disabled:D,style:{pointerEvents:D?"none":"auto"},children:b.jsx("i",{className:`${w} ${S} timepicker-icon`})}):b.jsx("i",{onClick:Ge,className:`${w} ${S} timepicker-icon timepicker-toggle-button`}))})}),b.jsx(R4,{isOpen:ft,wrapperRef:X,referenceElement:n||cs,inline:M,className:_,onClosed:fn,onOpened:NT})]})})})});PT.displayName="MDBTimepicker";const j4=({className:e,dropdown:t,children:n,styles:i,attributes:s,setPopperElement:r,style:o,onClosed:a,onOpened:l})=>{const c={initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3}},u=I("datepicker-dropdown-container",e),d=I("datepicker-modal-container",e),h=f=>{f.opacity===0?a==null||a():l==null||l()};return b.jsx(b.Fragment,{children:t?b.jsx(Jo.div,{style:{position:"absolute",zIndex:1065,...i.popper},...s.popper,ref:r,className:u,tabIndex:-1,...c,onAnimationComplete:f=>h(f),children:n}):b.jsx(Jo.div,{...c,className:d,style:o,onAnimationComplete:f=>h(f),children:n})})},Ce={closeOnEsc:!0,title:"Select date",okBtnText:"Ok",clearBtnText:"Clear",cancelBtnText:"Cancel",customIcon:"far fa-calendar",customHeader:"",inputLabel:"Select a date",monthsFull:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],views:"days",format:"dd/mm/yyyy",weekdaysFull:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],weekdaysNarrow:["S","M","T","W","T","F","S"],startDay:0};function Te(e){return e.getDate()}function sw(e){return e.getDay()}function Pt(e){return e.getMonth()}function ot(e){return e.getFullYear()}function $4(e,t,n){const i=n,s=i>0?7-i:0,r=new Date(e,t).getDay()+s;return r>=7?r-7:r}function I4(e){return e.getDate()===rc(e)}function sg(e){return I4(e)?rc(new Date(ot(e),Pt(e)+1,1)):Te(e)}function rc(e){return F4(e).getDate()}function F4(e){return Or(e.getFullYear(),e.getMonth()+1,0)}function Ro(){return new Date}function Ln(e,t){return Je(e,t*12)}function Je(e,t){const n=Or(e.getFullYear(),e.getMonth()+t,e.getDate()),i=Te(e),s=Te(n);return i!==s&&n.setDate(0),n}function eo(e,t){return Or(e.getFullYear(),e.getMonth(),e.getDate()+t)}function Or(e,t,n){const i=new Date(e,t,n);return e>=0&&e<100&&i.setFullYear(i.getFullYear()-1900),i}function rg(e){return!Number.isNaN(e.getTime())}function rw(e,t){return ot(e)-ot(t)||Pt(e)-Pt(t)||Te(e)-Te(t)}function vs(e,t){return e.setHours(0,0,0,0),t.setHours(0,0,0,0),e.getTime()===t.getTime()}function ow(e){return parseInt(e,10)<10?`0${e}`:e}function og(e,t){const n=ot(e)-TT(0,null,null);return B4(n,t)}function B4(e,t){return(e%t+t)%t}function TT(e,t,n){let i=0;return n?i=ot(n)-e+1:t&&(i=ot(t)),i}function No(e,t,n,i){const s=t&&rw(e,t)<=0,r=n&&rw(e,n)>=0,o=i&&i(e)===!1;return!!(s||r||o)}function ag(e,t,n,i,s,r){const o=i&&ot(i),a=i&&Pt(i),l=n&&ot(n),c=n&&Pt(n),u=new Date().getFullYear(),d=new Date().getMonth();if(r&&u===t&&ed||r&&u>t||s&&uo||t===o&&e>a:!1,f=c&&l?tr)return!0;const o=t&&ot(t),a=n&&ot(n),l=a?e>a:!1,c=o?en===e)}function aw(e,t,n,i,s){return s?DT(e,s,t,n,i,s):!1}function lw(e,t,n,i,s){return i?DT(e,i,t,n,i,s):!1}function DT(e,t,n,i,s,r){if(n==="days")return ot(e)===ot(t)&&Pt(e)===Pt(t);if(n==="months")return ot(e)===ot(t);if(n==="years"){const o=TT(i,s,r);return Math.floor((ot(e)-o)/i)===Math.floor((ot(t)-o)/i)}return!1}function lh(e,t,n,i){let s;if(t){const r=V4(t);if(r){r[0]!==r[1]?s=r[0]+r[1]:s=r[0];const o=new RegExp(`[${s}]`),a=e.split(o),l=t==null?void 0:t.split(o),c=(t==null?void 0:t.indexOf("mmm"))!==-1,u=[];l==null||l.forEach((m,v)=>{m.indexOf("yy")!==-1&&(u[0]={value:a[v],format:m}),m.indexOf("m")!==-1&&(u[1]={value:a[v],format:m}),m.indexOf("d")!==-1&&m.length<=2&&(u[2]={value:a[v],format:m})});let d;(t==null?void 0:t.indexOf("mmmm"))!==-1?d=n:d=i;const h=Number(u[0].value),f=c?z4(u[1].value,d):Number(u[1].value)-1,p=Number(u[2].value);return Or(h,f,p)}}}function cw(e,t,n,i,s,r){const o=Te(e),a=ow(Te(e).toString()),l=n[sw(e)],c=i[sw(e)],u=Pt(e),d=ow((Pt(e)+1).toString()),h=s[Pt(e)],f=r[Pt(e)],p=ot(e).toString().length===2?ot(e):ot(e).toString().slice(2,4),m=ot(e),v=t.split(/(d{1,4}|m{1,4}|y{4}|yy|!.)/g);let y="";return v.forEach(g=>{switch(g){case"dddd":g=g.replace(g,c);break;case"ddd":g=g.replace(g,l);break;case"dd":g=g.replace(g,a);break;case"d":g=g.replace(g,o.toString());break;case"mmmm":g=g.replace(g,f);break;case"mmm":g=g.replace(g,h);break;case"mm":g=g.replace(g,d);break;case"m":g=g.replace(g,u.toString());break;case"yyyy":g=g.replace(g,m.toString());break;case"yy":g=g.replace(g,p.toString());break}y+=g}),y}const ET=(e,t)=>{if(!t)return!1;const n=new Date;return n.setHours(0,0,0,0)===e.setHours(0,0,0,0)?!1:et?e>new Date:!1,ir=Y.createContext({view:"days",setView:null,activeDate:new Date,setActiveDate:null,selectedDate:new Date,setSelectedDate:null,weekdaysShort:[],monthsShort:[],monthsFull:[],min:void 0,max:void 0,weekdaysFull:[],yearScope:[],tabCount:0,inline:!1,disableFuture:!1,disablePast:!1}),W4=({clearBtnText:e="Clear",cancelBtnText:t="Cancel",okBtnText:n="Ok",setValue:i,selectDate:s,onClose:r})=>{const{setActiveDate:o,setSelectedDate:a,selectedDate:l,isInDatetimepicker:c,onDatetimepickerModeSwitch:u}=k.useContext(ir),d=h=>{h.currentTarget.blur(),o(new Date),a(void 0),i("")};return b.jsxs("div",{className:"datepicker-footer",children:[b.jsx("button",{tabIndex:0,onClick:h=>d(h),className:"datepicker-footer-btn datepicker-clear-btn",children:e}),b.jsx("button",{tabIndex:0,onClick:()=>r==null?void 0:r(),className:"datepicker-footer-btn datepicker-cancel-btn",children:t}),b.jsx("button",{tabIndex:0,onClick:()=>{s(l),c&&(u==null||u()),r==null||r()},className:"datepicker-footer-btn datepicker-ok-btn",children:n})]})},H4=(e,t,n)=>{const i=document.createElement("button"),s=document.createElement("div");i.id=`datepicker-toggle-${Math.floor(Math.random()*10001)}`,i.tabIndex=0,i.type="button",i.style.pointerEvents="auto";const r=document.createElement("i");r.className=`${e} fa-${t} datepicker-icon`,n&&i.appendChild(r);const o=n?i:r;return o.classList.add("datepicker-toggle-button"),{div:s,selector:o}},U4=(e,t,n,i,s,r)=>{const o=[],a=Pt(e),l=Pt(Je(e,-1)),c=Pt(Je(e,1)),u=ot(e),d=$4(u,a,r),h=rc(e),f=rc(Je(e,-1)),p=7;let m=1,v=!1;for(let y=1;yh&&(m=1,v=!1);const _=Or(u,v?a:c,m);g.push({date:_,currentMonth:v,isSelected:t&&vs(_,t),isToday:vs(_,Ro()),dayNumber:Te(_),disabled:No(_,n,i,s)}),m++}o.push(g)}return o},Y4=e=>{const t=[],n=e[0];let i=[];for(let s=0;s<24;s++)if(i.push(n+s),i.length===4){const r=i;t.push(r),i=[]}return t},X4=e=>{const t=[];let n=[];return e.forEach(i=>{if(n.push(i),n.length===4){const s=n;t.push(s),n=[]}}),t},K4=({filter:e,startWeekdays:t,startDay:n,inlineDayClick:i,selectOnClick:s,selectDate:r,onClose:o})=>{const{min:a,max:l,setActiveDate:c,setSelectedDate:u,activeDate:d,selectedDate:h,tabCount:f,disableFuture:p,disablePast:m}=k.useContext(ir),v=y=>{!No(y,a,l,e)&&(c(y),u(y),i(y),s&&(r(y),o==null||o()))};return b.jsxs("table",{className:"datepicker-table",children:[b.jsx("thead",{children:b.jsx("tr",{children:t.map((y,g)=>b.jsx("th",{className:"datepicker-day-heading",scope:"col",children:y},g))})}),b.jsx("tbody",{className:"datepicker-table-body",children:U4(d,h,a,l,e,n).map((y,g)=>b.jsx("tr",{children:y.map((x,_)=>b.jsx("td",{onClick:()=>v(x.date),tabIndex:vs(x.date,d)?0:void 0,className:I("datepicker-cell","datepicker-small-cell","datepicker-day-cell",x.isToday&&"current",x.isSelected&&"selected",x.disabled&&"disabled",f===3&&vs(x.date,d)&&"focused",Pt(d)!==Pt(x.date)&&"disabled",AT(x.date,p)&&"disabled",ET(x.date,m)&&"disabled"),children:b.jsx("div",{className:"datepicker-cell-content datepicker-small-cell-content",style:{display:x.currentMonth?"block":"none"},children:x.dayNumber})},_))},g))})]})},G4=()=>{const{yearScope:e,setView:t,setActiveDate:n,activeDate:i,selectedDate:s,tabCount:r,min:o,max:a,disableFuture:l,disablePast:c}=k.useContext(ir);return b.jsx("table",{className:"datepicker-table",children:b.jsx("tbody",{className:"datepicker-table-body",children:Y4(e).map((u,d)=>b.jsx("tr",{children:u.map(h=>b.jsx("td",{onClick:()=>{n(new Date(h,Pt(i),Te(i))),t("months")},tabIndex:h===ot(i)?0:void 0,className:I("datepicker-cell","datepicker-large-cell","datepicker-year-cell",s&&h===ot(s)&&"selected",r===3&&h===ot(i)&&"focused",lg(h,o,a,l,c)&&"disabled",ot(Ro())===h&&"current"),children:b.jsx("div",{className:"datepicker-cell-content datepicker-large-cell-content",children:h})},h))},d))})})},q4=()=>{const{monthsShort:e,setActiveDate:t,setView:n,activeDate:i,selectedDate:s,tabCount:r,min:o,max:a,disableFuture:l,disablePast:c}=k.useContext(ir);return b.jsx("table",{className:"datepicker-table",children:b.jsx("tbody",{className:"datepicker-table-body",children:X4(e).map((u,d)=>b.jsx("tr",{children:u.map(h=>b.jsx("td",{onClick:()=>{t(new Date(ot(i),e.indexOf(h),sg(i))),n("days")},tabIndex:e.indexOf(h)===Pt(i)?0:void 0,className:I("datepicker-cell","datepicker-large-cell","datepicker-month-cell",s&&e.indexOf(h)===Pt(s)&&ot(i)===ot(s)&&"selected",r===3&&e.indexOf(h)===Pt(i)&&"focused",Pt(Ro())===e.indexOf(h)&&ot(Ro())===ot(i)&&"current",ag(e.indexOf(h),ot(i),o,a,l,c)&&"disabled"),children:b.jsx("div",{className:"datepicker-cell-content datepicker-large-cell-content",children:h})},e.indexOf(h)))},d))})})},Q4=({title:e,customHeader:t})=>{const{weekdaysShort:n,monthsShort:i,selectedDate:s,isInDatetimepicker:r,onDatetimepickerModeSwitch:o}=k.useContext(ir),a=s||new Date;return b.jsxs("div",{className:"datepicker-header",children:[b.jsx("div",{className:"datepicker-title",children:b.jsx("span",{className:"datepicker-title-text",children:e})}),b.jsxs("div",{className:"datepicker-date",children:[!t&&b.jsxs("span",{className:"datepicker-date-text",children:[n[a.getDay()],", ",i[a.getMonth()]," ",a.getDate()]}),t&&t]}),r&&b.jsxs("div",{className:"buttons-container",children:[b.jsx("button",{type:"button",className:"datepicker-button-toggle",children:b.jsx("i",{className:"far fa-calendar datepicker-toggle-icon"})}),b.jsx("button",{type:"button",className:"timepicker-button-toggle",onClick:o,children:b.jsx("i",{className:"far fa-clock fa-sm timepicker-icon"})})]})]})},Z4=()=>{const{view:e,setView:t,activeDate:n,setActiveDate:i,monthsFull:s,min:r,max:o,yearScope:a}=k.useContext(ir),l=c=>{if(e==="days"){const u=c?new Date(ot(n),Pt(n)+1,sg(n)):new Date(ot(n),Pt(n)-1,sg(n));c?!aw(Je(u,-1),"days",1,r,o)&&i(u):!lw(Je(u,1),"days",1,r,o)&&i(u)}else if(e==="years"){const u=c?new Date(ot(n)+24,Pt(n),Te(n)):new Date(ot(n)-24,Pt(n),Te(n));c?o?a[0]+24ot(r)&&i(u):i(u)}else if(e==="months"){const u=c?new Date(ot(n)+1,Pt(n),Te(n)):new Date(ot(n)-1,Pt(n),Te(n));c?!aw(Ln(u,-1),"months",1,r,o)&&i(u):!lw(Ln(u,1),"months",1,r,o)&&i(u)}};return b.jsxs("div",{className:"datepicker-date-controls",children:[e==="days"&&b.jsxs("button",{tabIndex:0,className:"datepicker-view-change-button",onClick:()=>t("years"),children:[s[n.getMonth()]," ",n.getFullYear()]}),e==="years"&&b.jsxs("button",{tabIndex:0,className:"datepicker-view-change-button",onClick:()=>t("days"),children:[a[0]," - ",a[1]]}),e==="months"&&b.jsx("button",{tabIndex:0,className:"datepicker-view-change-button",onClick:()=>t("days"),children:ot(n)}),b.jsxs("div",{className:"datepicker-arrow-controls",children:[b.jsx("button",{tabIndex:0,className:"datepicker-previous-button",onClick:()=>l(!1)}),b.jsx("button",{tabIndex:0,className:"datepicker-next-button",onClick:()=>l(!0)})]})]})},J4=({labelText:e,inline:t,setReferenceElement:n,inputClasses:i,value:s,style:r,inputStyle:o,icon:a,input:l,inputId:c,inputToggle:u,setDatepickerValue:d,format:h,onOpenHandler:f,...p})=>{const{monthsFull:m,monthsShort:v,setSelectedDate:y,setActiveDate:g}=k.useContext(ir),x=I(s?"active":"",i),_=k.useRef(null);return k.useEffect(()=>{var w;if(u)return;const S=(w=_.current)==null?void 0:w.parentNode,{div:C,selector:M}=H4(a,"sm",!0);return S==null||S.insertBefore(C,_.current),S==null||S.insertBefore(M,_.current),M.addEventListener("click",()=>f==null?void 0:f()),()=>{M.removeEventListener("click",()=>f==null?void 0:f()),S==null||S.removeChild(M)}},[a,f,u]),b.jsx(wi,{className:x,label:e,id:c,ref:t?n:l,labelRef:_,wrapperClass:"datepicker",value:s,onChange:w=>{const S=lh(w.target.value,h,m,v);d(w.target.value),S&&rg(S)?(g(S),y(S)):(g(new Date),y(void 0))},style:o,wrapperStyle:r,onClick:()=>{u&&(f==null||f())},...p})},x0="ArrowLeft",b0="ArrowUp",_0="ArrowRight",w0="ArrowDown",k0="Home",S0="End",M0="PageUp",C0="PageDown",P0="Enter",T0=" ",t8=(e,t,n,i,s,r,o,a,l,c)=>{switch(e){case x0:t(u=>eo(u,-1));break;case _0:t(u=>eo(u,1));break;case b0:t(u=>eo(u,-7));break;case w0:t(u=>eo(u,7));break;case k0:t(u=>eo(u,1-Te(u)));break;case S0:t(u=>eo(u,rc(u)-Te(u)));break;case M0:t(u=>Je(u,-1));break;case C0:t(u=>Je(u,1));break;case P0:if(No(n,i,s,o)||ET(n,c)||AT(n,l))return;a(n),r(n);break;case T0:if(!o||o(n)){if(No(n,i,s,o))return;a(n),r(n)}break;default:return}},e8=(e,t,n,i,s,r,o,a,l)=>{switch(e){case x0:n(c=>Ln(c,-1));break;case _0:n(c=>Ln(c,1));break;case b0:n(c=>Ln(c,-4));break;case w0:n(c=>Ln(c,4));break;case k0:n(c=>Ln(c,-og(c,24)));break;case S0:n(c=>Ln(c,24-og(c,24)-1));break;case M0:n(c=>Ln(c,-24));break;case C0:n(c=>Ln(c,24));break;case P0:!lg(ot(t),i,s,a,l)&&r("months");break;case T0:!lg(ot(t),i,s,a,l)&&o(t);return;default:return}},n8=(e,t,n,i,s,r,o,a,l,c)=>{switch(e){case x0:n(u=>Je(u,-1));break;case _0:n(u=>Je(u,1));break;case b0:n(u=>Je(u,-4));break;case w0:n(u=>Je(u,4));break;case k0:n(u=>Je(u,-Pt(u)));break;case S0:n(u=>Je(u,11-Pt(u)));break;case M0:n(u=>Ln(u,-1));break;case C0:n(u=>Ln(u,1));break;case P0:!ag(Pt(t),ot(t),i,s,l,c)&&r("days");break;case T0:!ag(Pt(t),ot(t),i,s,l,c)&&o(t);return;default:return}},i8=({closeOnEsc:e,isOpen:t,activeDate:n,setActiveDate:i,min:s,max:r,view:o,setView:a,setSelectedDate:l,filter:c,setInlineDate:u,disableFuture:d,disablePast:h,onClose:f})=>{const[p,m]=k.useState(3),v=k.useRef(null),y=k.useCallback(g=>{var x,_,w;if(e&&g.key==="Escape"&&(f==null||f()),g.preventDefault(),!g.shiftKey&&g.key==="Tab"){const S=(x=v.current)==null?void 0:x.querySelectorAll('[tabindex="0"]');S&&(p===S.length-1?m(0):m(p+1))}else if(g.key==="Enter")p!==3&&document.activeElement&&document.activeElement.click();else if(g.shiftKey&&g.key==="Tab"){const S=(_=v.current)==null?void 0:_.querySelectorAll('[tabindex="0"]');S&&m(p===0?S.length-1:p-1)}(w=v.current)!=null&&w.querySelector(".focused")&&p!==4&&(o==="days"?t8(g.key,i,n,s,r,l,c,u,d,h):o==="years"?e8(g.key,n,i,s,r,a,l,d,h):o==="months"&&n8(g.key,n,i,s,r,a,l,c,d,h))},[n,o,c,r,s,e,p,a,i,l,u,d,h,f]);return k.useEffect(()=>{var g,x;const _=(g=v.current)==null?void 0:g.querySelectorAll('[tabindex="0"]');if(_){const w=_[p];if(w.tagName!=="TD"){w.focus();const S=(x=v.current)==null?void 0:x.querySelector(".focused");S==null||S.classList.remove("focused")}else _[p-1].blur(),w.classList.add("focused")}},[p]),k.useEffect(()=>{t||m(3)},[t]),k.useEffect(()=>{m(3)},[o]),k.useEffect(()=>{if(t)return document.addEventListener("keydown",y),()=>{document.removeEventListener("keydown",y)}},[y,t]),{tabCount:p,modalRef:v}},s8=({isOpen:e,inline:t})=>{k.useEffect(()=>{const n=window.innerWidth>document.documentElement.clientWidth&&window.innerWidth>=576;if(!t)return e&&n?(document.body.style.overflow="hidden",document.body.style.paddingRight="17px"):(document.body.style.overflow="",document.body.style.paddingRight=""),()=>{document.body.style.overflow="",document.body.style.paddingRight=""}},[e,t])},r8=({isOpened:e,isOpen:t,inline:n,popperElement:i,referenceElement:s,backdropRef:r,onCloseHandler:o})=>{const a=k.useCallback(l=>{var c;n?!(i!=null&&i.contains(l.target))&&!((c=s==null?void 0:s.parentNode)!=null&&c.contains(l.target))&&!l.target.classList.contains("datepicker-view-change-button")&&!l.target.classList.contains("datepicker-large-cell-content")&&t&&o():l.target===r.current&&t&&o()},[i,s,r,n,t,o]);k.useEffect(()=>(e&&document.addEventListener("click",a),()=>{document.removeEventListener("click",a)}),[e,a])},OT=k.forwardRef(({datetimepickerRef:e,isInDatetimepicker:t,onDatetimepickerModeSwitch:n,closeOnEsc:i=Ce.closeOnEsc,customHeader:s,title:r=Ce.title,weekdaysNarrow:o=Ce.weekdaysNarrow,monthsFull:a=Ce.monthsFull,monthsShort:l=Ce.monthsShort,weekdaysFull:c=Ce.weekdaysFull,weekdaysShort:u=Ce.weekdaysShort,disableFuture:d,disablePast:h,filter:f,inline:p,className:m,min:v,max:y,format:g=Ce.format,okBtnText:x=Ce.okBtnText,clearBtnText:_=Ce.clearBtnText,cancelBtnText:w=Ce.cancelBtnText,inputToggle:S,customIcon:C=Ce.customIcon,inputId:M,inputLabel:P=Ce.inputLabel,inputStyle:T,startDay:A=Ce.startDay,views:E=Ce.views,style:z,defaultValue:N="",onChange:L,onClose:R,onClosed:B,onOpen:D,onOpened:$,getFormattedDateValues:F,value:V,wrapperClass:W,selectOnClick:et=!1,open:Z,disablePortal:O,...U},lt)=>{const[ct,kt]=k.useState(!1),[it,Lt]=k.useState(!1),Ct=ef(it,Z),[Qt,ft]=k.useState(new Date),[wt,dt]=k.useState(new Date),[jt,pt]=k.useState(E),[xt,J]=k.useState(V||N),[mt,q]=k.useState(),[ye,Dt]=k.useState(),[he,Un]=k.useState(o),[Yn,Mn]=k.useState([0,0]),Si=k.useRef(null),dn=k.useRef(null),Mi=k.useRef(N&&!0),{styles:as,attributes:ls}=Oh(e||ye,mt,{placement:"bottom-start",modifiers:[VM]});k.useImperativeHandle(lt,()=>p?ye:dn.current,[p,ye]);const Ci=nt=>{if(p&&p){const Tt=cw(nt,g,u,c,l,a);J(Tt),t&&(n==null||n()),Ke()}},Pi=nt=>{const Tt=nt&&cw(nt,g,u,c,l,a);Tt&&J(Tt)},Ke=k.useCallback(()=>{Lt(!1),R==null||R()},[R]),Xn=k.useCallback(()=>{Lt(!0),D==null||D()},[D]),Ti=k.useCallback(()=>{kt(!1),B==null||B()},[B]),j=k.useCallback(()=>{kt(!0),$==null||$()},[$]),{tabCount:Q,modalRef:It}=i8({closeOnEsc:i,isOpen:Ct,activeDate:Qt,setActiveDate:ft,min:v,max:y,view:jt,setView:pt,setSelectedDate:dt,filter:f,setInlineDate:Ci,disableFuture:d,disablePast:h});return s8({isOpen:Ct,inline:p}),r8({isOpened:ct,isOpen:Ct,inline:p,referenceElement:ye,popperElement:mt,backdropRef:Si,onCloseHandler:Ke}),k.useEffect(()=>{const nt=ot(Qt),Tt=og(Qt,24),Oe=nt-Tt;Mn([Oe,Oe+23])},[Qt]),k.useEffect(()=>{const nt=o.slice(A).concat(o.slice(0,A));Un(nt)},[o,A]),k.useEffect(()=>{if(!Ct)return;const nt=p?ye:dn.current,Tt=nt==null?void 0:nt.parentNode,Oe=Tt==null?void 0:Tt.querySelector("button");Oe?Oe.blur():nt==null||nt.blur()},[Ct,dn,ye,p,D]),k.useEffect(()=>{Z&&!Ct&&!ct&&(D==null||D(),Lt(!0))},[Z,Ct,ct,D]),k.useEffect(()=>{if(!Mi.current)return;const nt=lh(xt,g,a,l);nt&&rg(nt)&&(ft(nt),dt(nt)),Mi.current=!1},[N,xt,g,a,l]),k.useEffect(()=>{const nt=V&&lh(V,g,a,l);nt&&rg(nt)&&(ft(nt),dt(nt),J(V)),V===""&&(ft(new Date),dt(void 0),J(V))},[V,g,a,l]),k.useEffect(()=>{Ct||(pt(E),xt||(ft(new Date),dt(void 0)))},[Ct,E,xt]),k.useEffect(()=>{L==null||L(xt,Qt)},[xt]),k.useEffect(()=>{const nt=wt||new Date,Tt=String(nt.getDate()),Oe=u[nt.getDay()],cs=c[nt.getDay()],ai=l[nt.getMonth()],Kn=a[nt.getMonth()],Me=String(nt.getFullYear()),Kr=Me.slice(-2);F==null||F({dayNumber:Tt,weekdayShort:Oe,weekdayFull:cs,monthShort:ai,monthFull:Kn,yearFull:Me,yearShort:Kr})},[wt]),b.jsx(ir.Provider,{value:{isInDatetimepicker:t,onDatetimepickerModeSwitch:n,view:jt,setView:pt,activeDate:Qt,setActiveDate:ft,selectedDate:wt,setSelectedDate:dt,weekdaysShort:u,monthsShort:l,monthsFull:a,min:v,max:y,weekdaysFull:c,yearScope:Yn,tabCount:Q,isOpen:Ct,disablePast:h,disableFuture:d},children:b.jsxs(b.Fragment,{children:[!t&&b.jsx(J4,{inputClasses:m,labelText:P,inline:p,setReferenceElement:Dt,value:xt,setDatepickerValue:J,style:z,inputStyle:T,format:g,icon:C,input:dn,inputToggle:S,onOpenHandler:Xn,...U}),b.jsx(aa,{disablePortal:O,children:b.jsx(Zy,{children:Ct&&b.jsxs(b.Fragment,{children:[b.jsxs(j4,{className:W,dropdown:p,styles:as,attributes:ls,setPopperElement:q,onClosed:Ti,onOpened:j,children:[!p&&b.jsx(Q4,{title:r,customHeader:s,onClose:Ke}),b.jsxs("div",{className:"datepicker-main",ref:It,children:[b.jsx(Z4,{}),b.jsxs("div",{className:"datepicker-view",children:[jt==="days"&&b.jsx(K4,{startWeekdays:he,startDay:A,filter:f,inlineDayClick:Ci,selectDate:Pi,selectOnClick:et,onClose:Ke}),jt==="years"&&b.jsx(G4,{}),jt==="months"&&b.jsx(q4,{})]}),!p&&b.jsx(W4,{okBtnText:x,clearBtnText:_,cancelBtnText:w,setValue:J,selectDate:Pi,onClose:Ke})]})]},"datepicker-modal-container"),!p&&b.jsx(Jo.div,{className:"datepicker-backdrop",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},ref:Si})]})})})]})})});OT.displayName="MDBDatepicker";const o8=e=>{const t=/^([0-1]?[0-9]|2[0-3]):[0-5][0-9] [APap][mM]$/,n=/^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])?$/;return e.match(t)||e.match(n)},a8=e=>e&&Object.prototype.toString.call(e)==="[object Date]"&&!isNaN(e.getTime()),uw=300,l8=k.forwardRef(({className:e,label:t="Select Date and Time",labelStyle:n,labelClass:i,labelRef:s,inputClass:r="",inputRef:o,inline:a,disabled:l,defaultTime:c="",defaultDate:u="",value:d,invalidLabel:h,inputToggle:f=!1,timepickerOptions:p,datepickerOptions:m,showFormat:v,dateFormat:y="dd/mm/yyyy",timeFormat:g="12h",appendValidationInfo:x=!0,onChange:_,onOpen:w,onClose:S,onDatepickerOpen:C,onDatepickerClose:M,onTimepickerOpen:P,onTimepickerClose:T,...A},E)=>{const z=k.useRef(!1),[N,L]=k.useState(!1),[R,B]=k.useState(!1),[D,$]=k.useState(u),[F,V]=k.useState(c),[W,et]=k.useState(""),Z=k.useRef(),O=D?W.split(",")[0]:null,U=F?W.split(", ")[1]:null,lt=I("form-outline","datetimepicker",e),ct=()=>{const pt=O&&lh(O,y,Ce.monthsFull,Ce.monthsShort);return W&&!O&&!U||O&&!a8(pt)||U&&!o8(U)?r+" is-invalid":r},kt=k.useCallback(pt=>{$(pt)},[]),it=k.useCallback(pt=>{V(pt)},[]),Lt=k.useCallback(()=>{B(!1),z.current=!1,M==null||M()},[M]),Ct=k.useCallback(()=>{T==null||T(),L(!1),z.current=!1},[T]),Qt=k.useCallback(()=>{C==null||C()},[C]),ft=k.useCallback(()=>{P==null||P()},[P]),wt=()=>{B(!0),w==null||w(),z.current=!0},dt=k.useCallback(()=>{R?(B(!1),setTimeout(()=>{L(!0)},uw)):N&&(L(!1),setTimeout(()=>{B(!0)},uw))},[R,N]);k.useEffect(()=>{!F||!D||(_==null||_(`${D}, ${F}`),!d&&et(`${D}, ${F}`))},[F,D,_,d]),k.useEffect(()=>{d&&(et(d),_==null||_(d))},[d,_]),k.useEffect(()=>{!R&&!N&&!z.current&&(S==null||S())},[R,N,S]);const jt=pt=>{et(pt);const[xt,J]=pt.split(", ");$(xt||""),V(J||"")};return b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:lt,ref:Z,...A,children:[b.jsx(wi,{label:t,labelStyle:n,labelClass:i,ref:o||E,labelRef:s,placeholder:v?`${y}, ${g}`:void 0,value:d||W,onChange:pt=>{jt(pt.target.value),_==null||_(pt.target.value)},className:x?ct():r,disabled:l,onClick:()=>{f&&wt()},children:h&&b.jsx("div",{className:"invalid-feedback",children:h})}),!f&&b.jsx("button",{type:"button",className:"datetimepicker-toggle-button",onClick:wt,disabled:l,style:{pointerEvents:l?"none":"initial"},children:b.jsx("i",{className:"far fa-calendar datepicker-toggle-icon"})})]}),b.jsx(OT,{...m,inline:a,onChange:kt,format:y,datetimepickerRef:Z.current,defaultValue:u,value:D,onClose:Lt,onOpen:Qt,isInDatetimepicker:!0,open:R,onDatetimepickerModeSwitch:dt}),b.jsx(PT,{...p,inline:a,onChange:it,format:g,datetimepickerRef:Z.current,defaultValue:c,value:F,onClose:Ct,onOpen:ft,isInDatetimepicker:!0,open:N,onDatetimepickerModeSwitch:dt})]})});l8.displayName="MDBDateTimepicker";const c8=Y.forwardRef(({className:e,color:t,children:n,...i},s)=>{const r=I("toast-header",t&&`bg-${t}`,t&&t!=="light"&&"text-white",e);return b.jsx("div",{className:r,ref:s,...i,children:n})});c8.displayName="MDBToastHeader";const u8=Y.forwardRef(({className:e,children:t,color:n,...i},s)=>{const r=I("toast-body",n&&n!=="light"&&"text-white",e);return b.jsx("div",{className:r,ref:s,...i,children:t})});u8.displayName="MDBToastBody";const d8=Y.forwardRef(({className:e,white:t,children:n,...i},s)=>{const r=I("btn-close",t&&"btn-close-white",e);return b.jsx(Zt,{className:r,color:"none",ref:s,...i,children:n})});d8.displayName="MDBToastClose";const h8=0,f8=({selectedElements:e,optionHeight:t,data:n,multiple:i,selectAll:s,handleSelectAll:r,handleOptionClick:o,selectAllLabel:a,selectData:l,activeElementIndex:c,noResults:u,search:d})=>{const h=k.useMemo(()=>l.filter(v=>v.optgroup).map(v=>v.optgroup),[l]),f=k.useMemo(()=>{let v=0;return l.map(y=>(y.optgroup&&v++,{...y,groupIndex:v}))},[l]),p=k.useMemo(()=>l.filter(v=>!v.optgroup&&!v.hidden).length===0,[l]),m=v=>f.map(y=>{if(!y.optgroup&&v===y.groupIndex)return b.jsxs("div",{className:I("select-option",e.includes(y.elementPosition)&&"selected",y.disabled&&"disabled",y.hidden&&"d-none",c===y.elementPosition&&"active"),role:"option",style:{height:t},onClick:()=>o(y),children:[b.jsxs("span",{className:"select-option-text",children:[i&&b.jsx(oh,{disabled:y.disabled,disableWrapper:!0,checked:e.includes(y.elementPosition),readOnly:!0}),y.text,y.secondaryText&&b.jsx("span",{className:"select-option-secondary-text",children:y.secondaryText})]}),y.icon&&b.jsx("span",{className:"select-option-icon-container",children:b.jsx("img",{className:"select-option-icon rounded-circle",src:y.icon})})]},y.elementPosition)});return b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:"select-options-list",children:[i&&s&&!p&&b.jsx("div",{className:I("select-option",e.length===n.filter(v=>!v.disabled).length&&"selected",c===-1&&"active"),role:"option",onClick:r,style:{height:t},children:b.jsxs("span",{className:"select-option-text",children:[b.jsx(oh,{disableWrapper:!0,checked:n.filter(v=>!v.disabled&&!v.optgroup).length===e.length,readOnly:!0}),a]})}),m(h8),!p&&(h==null?void 0:h.map((v,y)=>{const g=m(y+1).filter(x=>x!==void 0);if(g.length!==0)return b.jsxs("div",{className:"select-option-group",children:[b.jsx("label",{className:"select-option-group-label",style:{height:t},children:v}),g]},`select-option-group ${v} ${y}`)}))]}),d&&p&&b.jsx("div",{className:"select-no-results",style:{height:t},children:u})]})},_p="ArrowUp",wp="ArrowDown",dw="Enter",hw="Escape",fw="Tab",p8=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;no.includes(a))||!r.every(a=>i[a]===s[a]))return!1}return!0},m8=e=>e.map((t,n)=>({...t,elementPosition:n})),g8={open:{opacity:1,transform:"scaleY(1)",transition:{duration:.2}},closed:{opacity:0,transform:"scaleY(0.8)",transition:{duration:.2}}},Ra=-1,D0=k.forwardRef(({data:e,className:t,inputClassName:n,optionHeight:i=38,visibleOptions:s=5,disabled:r,placeholder:o,label:a,clearBtn:l,children:c,multiple:u,displayedLabels:d=5,optionsSelectedLabel:h="options selected",selectAll:f=!0,selectAllLabel:p="Select all",size:m,openRef:v,contrast:y=!1,open:g,onOpen:x,onOpened:_,onClose:w,onClosed:S,onValueChange:C,onChange:M,search:P=!1,searchLabel:T="Search...",searchFn:A,autoSelect:E=!1,noResultsText:z="No results",validation:N=!1,validFeedback:L="Valid",invalidFeedback:R="Invalid",preventFirstSelection:B=!1,value:D,animationVariants:$,disablePortal:F,...V},W)=>{const[et,Z]=k.useState(!1),O=ef(et,g),[U,lt]=k.useState(!0),[ct,kt]=k.useState(null),[it,Lt]=k.useState(),[Ct,Qt]=k.useState();k.useImperativeHandle(W,()=>it,[it]);const[ft,wt]=k.useState(""),[dt,jt]=k.useState(""),[pt,xt]=k.useState(()=>f?Ra:e.findIndex(G=>!G.disabled)),[J,mt]=k.useState([]),[q,ye]=k.useState([]),[Dt,he]=k.useState(q),[Un,Yn]=k.useState(""),[Mn,Si]=k.useState(0),[dn,Mi]=k.useState(!1),as=I("select-wrapper",t),ls=I("select-input",o&&"placeholder-active",O&&"focused",n),Ci=I(O||ct&&a?"active":"",a&&"select-label"),Pi=I("select-dropdown",O&&"open"),{styles:Ke,attributes:Xn}=Oh(it,Ct,{placement:"bottom-start"}),Ti=k.useRef(null),j=k.useRef(null),Q=k.useRef(null),It=k.useMemo(()=>u&&f?s+1:s,[f,s,u]);k.useEffect(()=>{if(!dt)return he(q);if(A&&dt){const G=A(dt,q);return he(G||[])}he(()=>q.filter(G=>{var X;return((X=G.text)==null?void 0:X.toLocaleLowerCase().includes(dt.toLocaleLowerCase()))||G.optgroup}))},[dt,q,A,ft]),k.useEffect(()=>{O&&dt&&xt(-1)},[O,dt]),k.useEffect(()=>{if(!N)return;const G=J.every(ht=>q[ht].value),X=J.every(ht=>!q[ht].disabled),rt=J.length>0;!u&&(!rt||!G||!X)||u&&(!rt||!X)?it==null||it.setCustomValidity(R):it==null||it.setCustomValidity("")},[N,R,J,it,q,ft,u]);const nt=G=>{if(q.length===0)return;const X=j.current,rt=X.offsetHeight,ht=X.scrollTop,hn=q.filter(Ge=>Ge.hidden&&Ge.elementPosition(u&&f?-2:-1)){const Ge=(us-hn)*i,fn=Ge+i>ht+rt;Ge{const G=rt=>Dt.findIndex(ht=>ht.elementPosition==rt);let X=pt;for(;X{let G=pt;for(;G>=0;){G-=1;const X=Dt.findIndex(ht=>ht.elementPosition==G)!=-1,rt=G>=0&&(q[G].disabled||q[G].hidden||q[G].optgroup);if(G<=0&&(!X||rt))return u&&f?G=-1:pt;if(X&&!rt)break}return G},cs=G=>{const{key:X}=G;if([_p,wp,dw,fw,hw].includes(X)){if(X===fw)return E&&ca(Dt[pt]),it==null||it.focus(),Z(!1);if(G.preventDefault(),G.altKey&&(X===wp||X===_p))return O?w==null||w():x==null||x(),Z(!O);if(X===wp){const rt=Tt();return O?(nt(rt),xt(rt)):u?Z(!0):mt([rt])}if(X===_p){const rt=Oe();return O?(nt(rt),xt(rt)):u?Z(!0):mt([rt])}if(X===dw){const rt=Dt.findIndex(ht=>ht.elementPosition==pt);return O?pt===Ra?Kr():ca(Dt[rt]):(x==null||x(),Z(!0))}if(X===hw)return Z(!1),it==null?void 0:it.focus()}},ai=k.useCallback(()=>{Z(G=>!G)},[]),Kn=k.useCallback(G=>{if(v&&v.current===G.target)return;const X=Ct&&Ct!==null,rt=it&&it!==null,ht=!(Ct!=null&&Ct.contains(G.target))&&!(it!=null&&it.contains(G.target)),hn=G.target===Q.current;X&&O&&rt&&ht&&!hn&&(Z(!1),w==null||w())},[Ct,it,O,w,v]);k.useEffect(()=>{const G=m8(e);p8(G,q)||ye(G)},[e,q]);const Me=k.useCallback(()=>{O&&Yn(`${it==null?void 0:it.offsetWidth}px`)},[it,O]),Kr=()=>{if(!u||!f)return;if(J.length===e.filter(X=>!X.disabled&&!X.optgroup).length)return mt([]),C==null||C([]),M==null||M([]),Cn([]);const G=q==null?void 0:q.filter(X=>!X.disabled&&!X.optgroup).map(X=>X.elementPosition);return mt(G),C==null||C(e.filter(X=>!X.disabled)),M==null||M(e.filter(X=>!X.disabled)),Cn(G)},Gr=k.useCallback(()=>{if(q.length===0)return;let G=J[0];const X=G===void 0,rt=G>=q.length;if(dn&&!u){if(X&&B||!dn||u||rt)return;X&&(G=0);const ht=q[G].value,hn=String(q[G].text);hn?(kt(ht?null:hn),wt(ht?hn:"")):(kt(null),wt(ht?" ":""))}},[u,dn,J,q,B]),Cn=k.useCallback(G=>{const X=d===-1||G.length>d;if(G.length<=0&&(kt(null),wt("")),X)return kt(null),wt(`${G.length} ${h}`);const rt=G.map(fn=>q[fn].text||"").filter(fn=>fn!==""),ht=G.map(fn=>q[fn].value||"").filter(fn=>fn!==""),hn=rt.findIndex(fn=>fn!=="")===-1,us=ht.length>0,Ge=rt.join(", ");hn?(kt(null),wt(us?" ":"")):us?(wt(Ge),kt(null)):(wt(""),kt(Ge))},[d,h,q]);k.useEffect(()=>{Gr()},[J,Gr]);const ca=G=>{if(!G||G.disabled)return;const{elementPosition:X}=G;if(u){const rt=J.includes(X)?J.filter(ht=>ht!==X):[...J,X];return mt(rt),C==null||C(rt.map(ht=>e[ht])),M==null||M(rt.map(ht=>e[ht])),Cn(rt)}return mt([X]),Z(!1),C==null||C(e[X]),M==null||M(e[X]),w==null||w(),it==null?void 0:it.focus()};k.useEffect(()=>{Mi(!0)},[]),k.useEffect(()=>{if(u){const X=q.filter(rt=>rt.defaultSelected).map(rt=>rt.elementPosition);return Cn(X),mt(X)}let G=q.findIndex(X=>X.defaultSelected);G===Ra&&!B&&(G=q.findIndex(X=>!X.disabled&&!X.hidden)),G!==Ra&&mt([G])},[q,Cn,u,B]),k.useEffect(()=>{if(O&&P&&J.length===0)return xt(Ra);O||(J.length>0?xt(Math.max(...J)):xt(0))},[Dt,O,P,J]),k.useEffect(()=>{Si(It*i)},[It,i]),k.useEffect(()=>{Me()},[Me]),k.useEffect(()=>(O&&(window.addEventListener("click",Kn),window.addEventListener("resize",Me)),()=>{window.removeEventListener("click",Kn),window.removeEventListener("resize",Me)}),[Kn,Me,O]),k.useEffect(()=>{if(v){const G=v.current;return G==null||G.addEventListener("click",ai),()=>{G==null||G.removeEventListener("click",ai)}}},[v,ai]),k.useEffect(()=>{if(!D)return;const G=Array.isArray(D)?D:[D],X=q.filter(ht=>ht.value&&G.includes(ht.value)).map(ht=>ht.elementPosition);if(X.toString()===J.toString())return;const rt=u?X.map(ht=>q[ht]):q[X[0]];C==null||C(rt),M==null||M(rt),mt(X),u?Cn(X):Gr()},[D,q,u,C,M,J,Gr,Cn]);const Dc=k.useCallback(()=>{r||(it==null||it.focus(),O?w==null||w():x==null||x(),Z(!O))},[r,O,x,w,it]),sf=k.useCallback(G=>{var X;G==="open"&&(lt(!1),_==null||_(),P&&((X=Ti.current)==null||X.focus())),G==="closed"&&(lt(!0),S==null||S(),P&&jt(""))},[_,S,P]);return b.jsx("div",{className:as,...V,children:b.jsxs(b.Fragment,{children:[b.jsxs(wi,{ref:Lt,onClick:Dc,onKeyDown:cs,className:ls,value:ft,readonly:!N,required:N,disabled:r,placeholder:ct?void 0:o,label:a,labelClass:Ci,size:m,contrast:y,children:[N&&b.jsxs(b.Fragment,{children:[b.jsx("div",{className:"invalid-feedback",children:R}),b.jsx("div",{className:"valid-feedback",children:L})]}),ct&&b.jsx("div",{className:"form-label select-fake-value active",children:ct}),l&&(ft.length>0||ct)&&b.jsx("span",{tabIndex:0,className:`select-clear-btn d-block ${r?"pe-none":""}`,role:"button",onClick:()=>{wt(""),mt([]),C==null||C(u?[]:{}),M==null||M(u?[]:{})},children:"✕"}),b.jsx("span",{className:`select-arrow ${r?"pe-none":""}`,ref:Q,onClick:Dc,style:{cursor:"pointer"}})]}),(e==null?void 0:e.length)>0&&(O||!U)&&b.jsx(aa,{disablePortal:F,children:b.jsx("div",{style:{...Ke.popper,width:Un,zIndex:1070},...Xn.popper,ref:Qt,className:"select-dropdown-container",children:b.jsx(Zy,{children:O&&b.jsxs(Jo.div,{variants:{...g8,...$},initial:"closed",animate:"open",exit:"closed",tabIndex:0,className:Pi,onAnimationStart:()=>{lt(!1)},onAnimationComplete:sf,children:[P&&b.jsx("div",{className:"input-group",children:b.jsx("input",{onKeyDown:cs,onChange:G=>jt(G.target.value),ref:Ti,type:"text",className:"form-control select-filter-input",role:"searchbox",placeholder:T})}),b.jsx("div",{className:"select-options-wrapper",ref:j,style:{maxHeight:`${Mn}px`},children:b.jsx(f8,{data:e,selectData:Dt,selectedElements:J,optionHeight:i,visibleOptions:It,handleOptionClick:ca,handleSelectAll:Kr,selectAll:f,selectAllLabel:p,multiple:u,activeElementIndex:pt,noResults:z,search:P})}),c&&b.jsx("div",{className:"select-custom-content",children:c})]})})})})]})})});D0.displayName="MDBSelectV2";const Tc=k.createContext({isLoading:!1,activePage:0,setActivePage:null,sort:{column:"",option:""},fixedHeader:!1,handleSort:null}),y8=({fullPagination:e,rowsText:t="Rows per page:",selectValue:n,setSelectValue:i,activeDataLength:s,entriesOptions:r=[10,25,50,200],fullDataLength:o,allText:a="All",ofText:l="of"})=>{const{isLoading:c,activePage:u,setActivePage:d}=k.useContext(Tc),h=u===0||c,f=s<=n*(u+1)||c,p=u===Math.floor(s/n),m=r.map(g=>({text:g.toString(),value:g,defaultSelected:n===g}));m.push({text:a,value:o,defaultSelected:n===o});const v=g=>{g instanceof Array||(i(g.value),d(0))},y=`${u*n+1} - ${(u+1)*n>s?s:(u+1)*n} ${l} ${s}`;return b.jsxs("div",{className:"datatable-pagination",children:[b.jsxs("div",{className:"datatable-select-wrapper",children:[b.jsx("p",{className:"datatable-select-text",children:t}),b.jsx(D0,{onValueChange:v,data:m,disabled:c})]}),b.jsx("div",{className:"datatable-pagination-nav",children:y}),b.jsxs("div",{className:"datatable-pagination-buttons",children:[e&&b.jsx(Zt,{disabled:h,onClick:()=>d(0),className:"datatable-pagination-button datatable-pagination-start",color:"link",children:b.jsx(sn,{icon:"angle-double-left"})}),b.jsx(Zt,{disabled:h,onClick:()=>d(u-1),className:"datatable-pagination-button datatable-pagination-left",color:"link",children:b.jsx(sn,{icon:"chevron-left"})}),b.jsx(Zt,{disabled:f,onClick:()=>d(u+1),className:"datatable-pagination-button datatable-pagination-right",color:"link",children:b.jsx(sn,{icon:"chevron-right"})}),e&&b.jsx(Zt,{disabled:p,onClick:()=>d(Math.floor(s/n)),className:"datatable-pagination-button datatable-pagination-end",color:"link",children:b.jsx(sn,{icon:"angle-double-right"})})]})]})},pw=(e,t,n)=>{const i=s=>s.toString().toLowerCase().includes(t.toLowerCase());return e.filter(s=>{if(n&&typeof n=="string")return i(s[n]);let r=Object.values(s);return n&&Array.isArray(n)&&(r=Object.keys(s).filter(o=>n.includes(o)).map(o=>s[o])),r.filter(o=>i(o)).length>0})},v8=(e,t,n)=>Object.assign([],e).sort((i,s)=>{const r=typeof i[t]=="string"?i[t].toLowerCase():i[t],o=typeof s[t]=="string"?s[t].toLowerCase():s[t];return ro?n==="desc"?-1:1:0}),LT=e=>e.every(t=>typeof t=="string"),E0=e=>!e.every(t=>typeof t=="string"),x8=e=>Array.isArray(e),mw=e=>!Array.isArray(e),b8=({search:e,advancedSearch:t,searchValue:n,setSearchValue:i,searchInputProps:s,label:r="Search",setAdvancedSearchValue:o})=>b.jsxs(b.Fragment,{children:[e&&b.jsx(wi,{value:n,onChange:a=>i(a.target.value),label:r,className:"mb-4",...s}),t&&b.jsxs(yT,{className:"mb-4",children:[b.jsx("input",{className:"form-control",value:n,onChange:a=>i(a.target.value),...s}),b.jsx(Zt,{className:"datatable-advanced-search",onClick:()=>o(t(n)),children:b.jsx(sn,{icon:"search"})})]})]}),_8=({dataColumns:e})=>{const{sort:t,fixedHeader:n,handleSort:i}=k.useContext(Tc),[s,r]=k.useState("rotate(0deg)"),o=a=>I("datatable-sort-icon",`${a===t.column&&"active"}`);return k.useEffect(()=>{const a=t.option==="desc"?"rotate(180deg)":"rotate(0deg)";r(a)},[t.option]),b.jsx(b.Fragment,{children:e.map((a,l)=>b.jsxs("th",{className:n?"fixed-cell":"",style:{cursor:"pointer"},scope:"row",onClick:()=>i(a),children:[b.jsx(sn,{fas:!0,icon:"arrow-up",className:o(a),style:{transform:a===t.column?s:"rotate(0deg)"}}),a]},l))})},w8=({dataColumns:e})=>{const[t,n]=k.useState("rotate(0deg)"),{sort:i,fixedHeader:s,handleSort:r,isLoading:o}=k.useContext(Tc),a=l=>I("datatable-sort-icon",`${l===i.column&&"active"}`);return k.useEffect(()=>{const l=i.option==="desc"?"rotate(180deg)":"rotate(0deg)";n(l)},[i.option]),b.jsx(b.Fragment,{children:e.map((l,c)=>{const{fixedValue:u,fixed:d,label:h}=l,f=l.sort!==!1&&!o,p={cursor:I(f&&"pointer"),left:d==="left"?u||0:void 0,right:d==="right"?u||0:void 0},m=I((s||d)&&"fixed-cell");return b.jsxs("th",{className:m,style:p,scope:"row",onClick:()=>f&&r(h),children:[f&&b.jsx(sn,{fas:!0,icon:"arrow-up",className:a(h),style:{transform:i.column===h?t:"rotate(0deg)"}}),h]},c)})})},k8=({row:e,dataColumns:t,format:n,editable:i})=>b.jsx(b.Fragment,{children:t.map((s,r)=>{const{field:o,fixed:a,width:l,fixedValue:c,columnSelector:u}=s,d=e[o],h=Number(d),f=n==null?void 0:n(o,h?Number(d):String(d)),p={minWidth:l,maxWidth:l,left:a==="left"&&(c||0),right:a==="right"&&(c||0),...f},m=I(a&&"fixed-cell",u&&`mdb-datatable-${u}`);return b.jsx("td",{contentEditable:i,className:m,style:p,children:d},r)})}),S8=({row:e,editable:t})=>b.jsx(b.Fragment,{children:e.map((n,i)=>b.jsx("td",{contentEditable:t,children:n},i))}),M8=({activeData:e,dataRows:t,isOnThePage:n,noFoundMessage:i,dataColumns:s,onRowClick:r,selectable:o,handleRowSelect:a,selectedRows:l,format:c,editable:u})=>{const{isLoading:d}=k.useContext(Tc),h=e.length,f=s.length,p=(m,v)=>{m.target.nodeName!=="INPUT"&&(r==null||r(v))};return b.jsxs(H3,{className:"datatable-body",children:[e.map((m,v)=>{const y=t.indexOf(m),g=l.includes(y),x=I(g&&"active",mw(m)&&m.rowSelector&&`mdb-datatable-${m.rowSelector}`);if(n(v))return b.jsxs("tr",{onClick:_=>p(_,m),className:x,style:{cursor:r&&"pointer"},children:[o&&b.jsx("td",{children:b.jsx(oh,{checked:g,onChange:()=>a(y)})}),x8(m)&&b.jsx(S8,{editable:u,row:m}),mw(m)&&E0(s)&&b.jsx(k8,{editable:u,row:m,dataColumns:s,format:c})]},v)}),!h&&!d&&b.jsx("tr",{className:"datatable-results-info",children:b.jsx("td",{colSpan:f,className:"text-center",children:i})})]})},C8=({dataColumns:e,dataRows:t,sort:n,searchValue:i,advancedSearch:s,advancedSearchValue:r})=>{const[o,a]=k.useState(t);return k.useEffect(()=>{const{column:l,option:c}=n,{phrase:u,columns:d}=r;let h;if(l){let f,p=0;E0(e)&&(f=e.find(m=>m.label===l)),LT(e)&&(p=e.indexOf(l)),h=v8(t,f?f.field:p,c)}i&&!s&&(h=pw(h||t,i,void 0)),u&&(h=pw(h||t,u,d)),a(h||t)},[n,t,e,i,s,r]),o},P8=Y.forwardRef(({advancedSearch:e,allText:t,className:n,bordered:i,borderless:s,borderColor:r="",color:o="",dark:a,entries:l=10,editable:c,entriesOptions:u,fixedHeader:d,fullPagination:h,hover:f,format:p,loaderClass:m="bg-primary",isLoading:v,loadingMessage:y="Loading results...",maxWidth:g="",maxHeight:x="",multi:_,noFoundMessage:w="No matching results found",pagination:S=!0,selectable:C,sortField:M="",searchInputProps:P,sortOrder:T="asc",sm:A,striped:E,rowsText:z,data:N={columns:[],rows:[]},search:L,onSelectRow:R,onRowClick:B,searchLabel:D,ofText:$,...F},V)=>{const[W,et]=k.useState(0),[Z,O]=k.useState(l),[U,lt]=k.useState({column:"",option:""}),[ct,kt]=k.useState([]),[it,Lt]=k.useState(""),[Ct,Qt]=k.useState({phrase:"",columns:""}),ft=C8({dataColumns:N.columns,dataRows:N.rows,sort:U,searchValue:it,advancedSearch:e,advancedSearchValue:Ct}),wt=I("datatable",f&&"datatable-hover",o&&`bg-${o}`,a&&"datatable-dark",i&&"datatable-bordered",s&&"datatable-borderless",r&&`border-${r}`,E&&"datatable-striped",A&&"datatable-sm",v&&"datatable-loading",n),dt=J=>W*Z<=J&&J<(W+1)*Z,jt=J=>{const{column:mt,option:q}=U;lt(mt===J?q==="asc"?{...U,option:"desc"}:{column:"",option:""}:{column:J,option:"asc"})},pt=J=>{const mt=J.currentTarget.checked,q=mt?Array.from({length:N.rows.length},(Dt,he)=>he):[],ye=q.map(Dt=>ft[Dt]);R==null||R(ye,q,mt),kt(q)},xt=J=>{const mt=ct.includes(J);let q;_?mt?q=ct.filter(he=>he!==J):q=[...ct,J]:mt?q=[]:q=[J];const ye=q.map(he=>ft[he]),Dt=q.length===N.rows.length;R==null||R(ye,q,Dt),kt(q)};return k.useEffect(()=>{M&<({column:M,option:T})},[M,T]),k.useEffect(()=>{et(0)},[it]),b.jsxs(Tc.Provider,{value:{isLoading:v,activePage:W,setActivePage:et,sort:U,fixedHeader:d,handleSort:jt},children:[b.jsx(b8,{search:L,advancedSearch:e,searchValue:it,setSearchValue:Lt,searchInputProps:P,label:D,setAdvancedSearchValue:Qt}),b.jsxs("div",{className:wt,ref:V,style:{maxWidth:g},...F,children:[b.jsx(k4,{className:"datatable-inner table-responsive ps",style:{overflow:"auto",position:"relative",maxWidth:g,maxHeight:x},children:b.jsxs(z3,{className:"datatable-table",children:[b.jsx(W3,{className:"datatable-header",children:b.jsxs("tr",{children:[C&&b.jsx("th",{className:d?"fixed-cell":"",children:_&&b.jsx(oh,{checked:ct.length===N.rows.length,onChange:pt})}),LT(N.columns)&&b.jsx(_8,{dataColumns:N.columns}),E0(N.columns)&&b.jsx(w8,{dataColumns:N.columns})]})}),b.jsx(M8,{activeData:ft,dataColumns:N.columns,dataRows:N.rows,isOnThePage:dt,onRowClick:B,format:p,handleRowSelect:xt,selectedRows:ct,selectable:C,noFoundMessage:w,editable:c})]})}),v&&b.jsxs(b.Fragment,{children:[b.jsx("div",{className:"datatable-loader bg-light}",children:b.jsx("span",{className:"datatable-loader-inner",children:b.jsx("span",{className:I("datatable-progress",m)})})}),b.jsx("p",{className:"text-center text-muted my-4",children:y})]}),S&&b.jsx(y8,{fullPagination:h,selectValue:Z,setSelectValue:O,activeDataLength:ft.length,rowsText:z,entriesOptions:u,fullDataLength:N.rows.length,allText:t,ofText:$})]})]})});P8.displayName="MDBDatatable";h0.register(...i3||[]);Y.createContext({activeItem:1,setActiveItem:null,prevActive:{current:1},setHeight:null,completed:[],noEditable:!1,isAnimating:{current:!1},linear:!1,formRef:{current:null},validate:{target:0,after:0},setValidate:null,type:"horizontal",stepsLength:0,onValid:void 0,onInvalid:void 0,mobileProgress:!1,disableHeadSteps:!1,animations:!0});Y.createContext({activeItem:0,dynamic:!1,dynamicStyle:{color:"",icon:""},setDynamicStyle:null,setActiveItem:null,hoveredItem:0,setHoveredItem:null,readonly:!1,onChange:void 0});const T8=Y.forwardRef(({backdrop:e=!0,backdropColor:t="black",backdropOpacity:n=.4,color:i,className:s,loadingText:r="Loading...",isOpen:o,fullScreen:a,overflow:l=!0,parentRef:c,spinnerElement:u=b.jsx(hT,{className:"loading-icon",role:"status"}),textClassName:d,textStyles:h,tag:f="div",...p},m)=>{const v=I("loading-text",d),y=I(a?"loading-full":"loading","loading-spinner",a?"position-fixed":"position-absolute",i&&`text-${i}`,s),g=I("loading-backdrop",!a&&"position-absolute");k.useEffect(()=>{const w=c==null?void 0:c.current;if(w)return w.classList.add("position-relative"),()=>{w.classList.remove("position-relative")}},[c]),k.useEffect(()=>{if(a&&l)return o?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}},[a,o,l]);const x=b.jsxs(f,{className:y,ref:m,...p,children:[u,b.jsx("span",{className:v,style:h,children:r})]}),_=b.jsx("div",{className:g,style:{opacity:n,backgroundColor:t}});return b.jsx(b.Fragment,{children:o!==!1&&b.jsx(b.Fragment,{children:a?b.jsxs(aa,{children:[x,_]}):b.jsxs(b.Fragment,{children:[x,e&&_]})})})});T8.displayName="MDBLoadingManagement";const D8=({isOpened:e,inputRef:t,dropdownEl:n,setOpenState:i,onClose:s})=>{const r=k.useCallback(o=>{if(!n)return;const a=t.current===o.target,l=n===o.target,c=n.contains(o.target);e&&!a&&!l&&!c&&(i(!1),s==null||s())},[e,i,n,t,s]);k.useEffect(()=>(document.addEventListener("click",r),()=>{document.removeEventListener("click",r)}),[r])},E8=({inputRef:e,dropdownEl:t})=>{const n=k.useCallback(()=>{if(!e.current||!t)return;const{width:i}=window.getComputedStyle(e.current);t.style.width=i},[t,e]);k.useEffect(()=>(n(),window.addEventListener("resize",n),()=>{window.removeEventListener("resize",n)}),[n])},A8=({isOpen:e})=>{const[t,n]=k.useState(!1);return k.useEffect(()=>{let i;return e?n(!0):i=setTimeout(()=>{n(!1)},100),()=>{clearTimeout(i)}},[e]),t},O8=({className:e,customContent:t=null,inputRef:n,isOpen:i,isOpened:s,children:r,setOpenState:o,listHeight:a="190px",onOpened:l,onClose:c,onClosed:u,...d})=>{const[h,f]=k.useState(null),[p,m]=k.useState(null),v=k.useMemo(()=>[{name:"matchReferenceWidth",enabled:!0,fn:({state:S,instance:C})=>{if(!p)return;const M=p.offsetWidth,P=S.rects.reference.width;Math.round(M)!==Math.round(P)&&(p.style.width=`${P}px`,C.update())},phase:"beforeWrite",requires:["computeStyles"]}],[p]),y=A8({isOpen:i}),{styles:g,attributes:x,update:_}=Oh(h,p,{modifiers:v}),w=I("autocomplete-dropdown",i&&"open",e);return D8({isOpened:s,setOpenState:o,dropdownEl:p,inputRef:n,onClose:c}),E8({inputRef:n,dropdownEl:p}),k.useEffect(()=>{n.current&&f(n.current)},[n]),k.useEffect(()=>{i&&(_==null||_())},[i,_,y]),b.jsx(b.Fragment,{children:b.jsx(aa,{children:b.jsx("div",{className:"autocomplete-dropdown-container",ref:m,...d,style:g.popper,...x.popper,onTransitionEnd:S=>{S.propertyName==="opacity"&&(y?l==null||l():u==null||u())},children:b.jsxs("div",{className:w,children:[b.jsx("ul",{className:"autocomplete-items-list",role:"listbox",style:{maxHeight:a,display:y?"block":"none"},children:r}),t]})})})})},L8=({className:e,isActive:t,children:n,onSelect:i,value:s,...r})=>{const o=I("autocomplete-item",t&&"active",e),a=k.useRef(null);return k.useEffect(()=>{!t||!a.current||a.current.scrollIntoView({block:"nearest"})},[t]),b.jsx("li",{className:o,onClick:()=>i(s),ref:a,...r,children:n})},R8=({isOpen:e,setOpenState:t,length:n})=>{const[i,s]=k.useState(-1),r=k.useCallback(o=>{const a=o.key==="Tab",l=o.key==="Escape",c=o.key==="ArrowUp",u=o.key==="ArrowDown",d=o.key==="Home",h=o.key==="End",f=o.key==="Enter",p=o.altKey,m=n-1;if(!e)return s(-1);if(l||f||a||p&&c)return t(!1);if(u){o.preventDefault(),s(v=>v===m?m:v+1);return}if(c){o.preventDefault(),s(v=>v===0?0:v-1);return}if(d&&i!==-1){o.preventDefault(),s(0);return}if(h&&i!==-1){o.preventDefault(),s(m);return}},[e,t,n,i]);return k.useEffect(()=>{s(-1)},[n]),k.useEffect(()=>(document.addEventListener("keydown",r),()=>{document.removeEventListener("keydown",r)}),[r]),i},N8=Y.forwardRef(({open:e,autoSelect:t,className:n,customContent:i,data:s=[],displayValue:r,value:o,isLoading:a,listHeight:l,noResults:c="No results found",itemContent:u,onSelect:d,onSearch:h,onChange:f,onClose:p,onClosed:m,onOpen:v,onOpened:y,...g},x)=>{const _=k.useRef(null),[w,S]=k.useState(!1),[C,M]=k.useState(!1),P=ef(w,e),[T,A]=k.useState(""),E=k.useMemo(()=>o!==void 0?o:T,[o,T]),z=R8({isOpen:P,setOpenState:S,length:s.length});k.useImperativeHandle(x,()=>_.current);const N=I(P&&"focused","autocomplete-input",n),L=I((P||E)&&"active","autocomplete-label"),R=()=>{S(!0),v==null||v(),_.current&&!_.current.value&&(h==null||h(""))},B=$=>r?r($):$,D=$=>{S(!1),_.current&&(_.current.value=$,h==null||h($),d==null||d($),f==null||f($),p==null||p(),A($))};return b.jsxs(b.Fragment,{children:[b.jsx(wi,{autoComplete:"off",onKeyDown:$=>{const F=$.key==="Enter",V=$.key==="Tab";if(!w)return S(!0);z!==-1&&(F||t&&V)&&D(B(s[z]))},onChange:$=>{h==null||h($.target.value),f==null||f($.target.value),A($.target.value)},onFocus:R,className:N,labelClass:L,ref:_,role:"combobox",value:E,...g,children:a&&b.jsx("div",{className:"autocomplete-loader spinner-border",children:b.jsx("span",{className:"sr-only",children:"Loading..."})})}),b.jsxs(O8,{isOpen:P,isOpened:C,inputRef:_,setOpenState:S,customContent:i,listHeight:l,onClose:p,onOpened:()=>{y==null||y(),M(!0)},onClosed:()=>{m==null||m(),M(!1)},children:[s.length===0&&b.jsx("li",{className:"autocomplete-item autocomplete-no-results",children:c}),s.map(($,F)=>b.jsx(L8,{isActive:z===F,value:B($),onSelect:D,children:u?u($):B($)},F))]})]})});N8.displayName="MDBAutocomplete";const j8=Y.forwardRef(({className:e,icon:t,tag:n="p",children:i,...s},r)=>{const o=I("popconfirm-message",e);return b.jsxs(n,{className:o,ref:r,...s,children:[t&&b.jsx("span",{className:"popconfirm-icon-container",children:t}),b.jsx("span",{className:"popconfirm-message-text",children:i})]})});j8.displayName="MDBPopconfirmMessage";const $8=Y.forwardRef(({className:e,tag:t="div",zoomLevel:n=1,fontAwesome:i="free",children:s,lightboxRef:r,onOpen:o,onClose:a,onSlide:l,onZoomIn:c,onZoomOut:u,disablePortal:d,...h},f)=>{const p=k.useRef(null),m=k.useRef(null),v=r||m,y=k.useRef(null),[g,x]=k.useState(!1),[_,w]=k.useState(0),[S,C]=k.useState(!1),[M,P]=k.useState([]),[T,A]=k.useState(""),[E,z]=k.useState(1),[N,L]=k.useState(!1),[R,B]=k.useState(),[D,$]=k.useState(!1),F=k.useRef(!1),V=k.useRef(!1),W=k.useRef(),et=k.useRef(),Z=k.useRef(),O=k.useRef(),U=k.useRef(),lt=k.useRef(),ct=k.useRef(),kt=I("lightbox",e),it=I(i==="pro"&&"fontawesome-pro"),Lt=I("lightbox-gallery-close-btn",i==="pro"&&"fontawesome-pro"),Ct=I("lightbox-gallery-fullscreen-btn",i==="pro"&&"fontawesome-pro",S&&"active"),Qt=I("lightbox-gallery-zoom-btn",i==="pro"&&"fontawesome-pro",E>1&&"active"),ft=k.useMemo(()=>document.documentElement.dir==="rtl",[]),wt=()=>{F.current=!0,setTimeout(()=>{F.current=!1},400)},dt=k.useCallback(j=>{let Q=j;return Q>M.length-1?Q=0:Q<0&&(Q=M.length-1),M[Q].classList.contains("lightbox-disabled")?dt(Q-1):Q},[M]),jt=k.useCallback(()=>{E>=3||(z(j=>j+n),c==null||c())},[c,E,n]),pt=k.useCallback(()=>{var j;const Q=(j=p.current)==null?void 0:j.querySelector(".lightbox-gallery-item.active");Q!=null&&Q.parentElement&&(Q.parentElement.style.left="0",Q.parentElement.style.top="0",Q.style.transition="all 0.5s ease-out",Q.style.left="0",Q.style.top="0",ls(Q),setTimeout(()=>{Q.style.transition="none"},500))},[]),xt=k.useCallback(()=>{E-n===1&&pt(),!(E<=1)&&(z(j=>j-n),u==null||u())},[u,pt,E,n]),J=k.useCallback(()=>{var j;p.current&&Array.from((j=p.current)==null?void 0:j.querySelectorAll(".lightbox-gallery-item")).forEach(Q=>{ls(Q)})},[]),mt=k.useCallback(()=>{S&&document.exitFullscreen&&document.exitFullscreen(),setTimeout(()=>{document.body.classList.remove("disabled-scroll"),document.body.classList.remove("replace-scrollbar")}),x(!1),z(1),L(!1),J(),a==null||a()},[J,S,a]),q=k.useCallback(j=>{if(F.current||M.length<=1)return _;let Q=0;switch(j){case"left":Q=_-1;break;case"right":Q=_+1;break;case"last":Q=M.length-1;break;case"first":Q=0;break}wt();const It=dt(Q);w(It),z(1),L(!1),setTimeout(()=>{var nt;const Tt=(nt=p.current)==null?void 0:nt.querySelector(".lightbox-gallery-item.active");J(),A(Tt.getAttribute("data-mdb-caption"))},300),l==null||l()},[_,J,M.length,l,dt]),ye=k.useCallback(j=>{if(g)switch(j.nativeEvent.key){case"ArrowRight":q(ft?"left":"right");break;case"ArrowLeft":q(ft?"right":"left");break;case"Escape":mt();break;case"Home":q("first");break;case"End":q("last");break;case"ArrowUp":jt();break;case"ArrowDown":xt();break}},[mt,q,jt,xt,g,ft]),Dt=k.useCallback(j=>{document.body.classList.add("disabled-scroll"),document.documentElement.scrollHeight>document.documentElement.clientHeight&&document.body.classList.add("replace-scrollbar"),x(!0),w(j),L(!1),J(),setTimeout(()=>{var Q;const It=(Q=p.current)==null?void 0:Q.querySelector(".lightbox-gallery-item.active");A(It.getAttribute("data-mdb-caption"))},0),o==null||o()},[J,o]);k.useImperativeHandle(f,()=>({outsideAccess(j){Dt(j)}}));const he=k.useCallback(()=>{(document.webkitIsFullScreen||document.mozFullScreen||document.msFullscreenElement)===void 0&&C(!1)},[]),Un=()=>{var j,Q,It;if(!S){(Q=(j=p.current)==null?void 0:j.requestFullscreen)==null||Q.call(j),C(!0);return}(It=document.exitFullscreen)==null||It.call(document),C(!1)},Yn=j=>{j.nativeEvent.preventDefault();const Q=j.nativeEvent instanceof TouchEvent?j.nativeEvent.touches[0]:j.nativeEvent,It=Q.clientX,nt=Q.clientY;j.nativeEvent instanceof TouchEvent&&j.type==="touchstart"&&j.nativeEvent.touches.length>1&&($(!0),B(j.nativeEvent.touches));const Tt=j.target;Z.current=parseFloat(Tt.style.left),O.current=parseFloat(Tt.style.top),W.current=parseFloat(Tt.style.left),et.current=parseFloat(Tt.style.top),U.current=It*(1/E)-W.current,lt.current=nt*(1/E)-et.current,L(!0)},Mn=j=>{if(j.type==="touchmove"&&j.nativeEvent instanceof TouchEvent&&j.nativeEvent.targetTouches.length>1&&(j.nativeEvent.preventDefault(),as(j)),!N||D)return;const Q=j.nativeEvent instanceof TouchEvent?j.nativeEvent.touches[0]:j.nativeEvent,It=Q.clientX,nt=Q.clientY,Tt=j.target;if(E!==1){W.current=It*(1/E)-U.current,et.current=nt*(1/E)-lt.current,Tt.style.left=`${W.current}px`,Tt.style.top=`${et.current}px`;return}M.length<=1||(W.current=It*(1/E)-U.current,Tt.style.left=`${W.current}px`)},Si=k.useCallback(()=>{if(!(E!==1||M.length<=1||!W.current||D)){if(W.current-(Z.current||0)>0){q(ft?"right":"left");return}q(ft?"left":"right")}},[q,D,ft,M.length,E]),dn=k.useCallback(j=>{D||(j.nativeEvent instanceof TouchEvent&&!j.nativeEvent.touches&&Xn(j),E!==1?xt():jt())},[jt,xt,D,E]),Mi=j=>{if(L(!1),j.nativeEvent instanceof MouseEvent){Si(),L(!1);return}if(D&&j.targetTouches.length===0){$(!1),B(void 0);return}L(!1),Si()},as=j=>{if(!R)return;const Q=Math.hypot(R[1].pageX-R[0].pageX,R[1].pageY-R[0].pageY),It=Math.hypot(j.nativeEvent.touches[1].pageX-j.nativeEvent.touches[0].pageX,j.nativeEvent.touches[1].pageY-j.nativeEvent.touches[0].pageY),nt=Math.abs(Q-It),Tt=j.nativeEvent.view.screen.width;nt<=Tt*.03||(Q<=It?jt():xt(),B(j.nativeEvent.touches))},ls=j=>{j.parentElement&&(j.width>=j.height?(j.style.width="100%",j.style.maxWidth="100%",j.style.height="auto",j.style.top=`${(j.parentElement.offsetHeight-j.height)/2}px`,j.style.left="0"):(j.style.height="100%",j.style.maxHeight="100%",j.style.width="auto",j.style.left=`${(j.parentElement.offsetWidth-j.width)/2}px`,j.style.top="0"),j.width>=j.parentElement.offsetWidth&&(j.style.width=`${j.parentElement.offsetWidth}px`,j.style.height="auto",j.style.left="0",j.style.top=`${(j.parentElement.offsetHeight-j.height)/2}px`),j.height>=j.parentElement.offsetHeight&&(j.style.height=`${j.parentElement.offsetHeight}px`,j.style.width="auto",j.style.top="0",j.style.left=`${(j.parentElement.offsetWidth-j.width)/2}px`),W.current=parseFloat(j.style.left)||0,et.current=parseFloat(j.style.top)||0)},Ci=j=>{const Q=j.getAttribute("data-mdb-img")?j.getAttribute("data-mdb-img"):j.getAttribute("src")?j.getAttribute("src"):"",It=j.getAttribute("alt")?j.getAttribute("alt"):j.getAttribute("data-mdb-caption")?j.getAttribute("data-mdb-caption"):"",nt=j.getAttribute("data-mdb-caption")?j.getAttribute("data-mdb-caption"):j.getAttribute("alt")?j.getAttribute("alt"):"";return{source:Q,alt:It,caption:nt}},Pi=k.useCallback(()=>{const j=[...v.current.querySelectorAll(".lightbox-item")].filter(Q=>!Q.classList.contains("lightbox-disabled"));P(j)},[v]),Ke=k.useCallback(()=>{J()},[J]),Xn=j=>{W.current=window.innerWidth/2-j.nativeEvent.offsetX-50,et.current=window.innerHeight/2-j.nativeEvent.offsetY-50;const Q=j.target;Q.style.left=`${W.current}px`,Q.style.top=`${et.current}px`,Q.style.transition="all 0.5s ease-out",setTimeout(()=>{Q.style.transition="none"},500)},Ti=j=>{if(j.deltaY>0)return xt();E>=3||(Xn(j),jt())};return k.useEffect(()=>{Pi()},[Pi]),k.useEffect(()=>{M.length&&J()},[J,M]),k.useEffect(()=>(M.forEach((j,Q)=>{!j.classList.contains("lightbox-disabled")&&j.addEventListener("click",()=>Dt(Q))}),()=>{M.forEach((j,Q)=>{j.removeEventListener("click",()=>Dt(Q))})}),[Dt,M]),k.useEffect(()=>(window.addEventListener("resize",Ke),window.addEventListener("fullscreenchange",he),()=>{window.removeEventListener("resize",Ke),window.removeEventListener("fullscreenchange",he)}),[he,Ke]),k.useEffect(()=>{const j=document.querySelector("meta[name=viewport]");if(ct.current||(ct.current=(j==null?void 0:j.getAttribute("content"))||""),!g){V.current=!1,j==null||j.setAttribute("content",ct.current);return}setTimeout(()=>{var Q;V.current=!0,(Q=y.current)==null||Q.focus(),j==null||j.setAttribute("content",`${ct.current} user-scalable=no`)},300)},[g]),b.jsxs(b.Fragment,{children:[b.jsx(t,{ref:v,className:kt,...h,children:s}),b.jsx(aa,{disablePortal:d,children:b.jsxs("div",{className:"lightbox-gallery",onClick:j=>j.target.tagName==="DIV"&&mt(),onKeyUp:ye,ref:p,style:{opacity:g?1:0,pointerEvents:g?"initial":"none",visibility:g?"visible":"hidden"},children:[b.jsx("div",{className:"lightbox-gallery-loader"}),b.jsxs("div",{className:"lightbox-gallery-toolbar",children:[b.jsx("div",{className:"lightbox-gallery-left-tools",children:b.jsx("p",{className:"lightbox-gallery-counter",children:`${_+1} / ${M.length}`})}),b.jsxs("div",{className:"lightbox-gallery-right-tools",children:[b.jsx("button",{className:Ct,onClick:Un}),b.jsx("button",{"aria-label":E>1?"Zoom out":"Zoom in",className:Qt,onClick:()=>E>1?xt():jt()}),b.jsx("button",{className:Lt,onClick:mt})]})]}),b.jsx("div",{className:"lightbox-gallery-content",style:{transform:g?"scale(1)":"scale(0.25)",transition:"all 0.5s ease-out"},children:M.map((j,Q)=>{const{source:It,alt:nt,caption:Tt}=Ci(j),Oe=Q===_?1:0,cs=Q===_?E:0,ai=_===M.length-1&&Q===0&&M.length>1,Kn=_===0&&Q===M.length-1&&M.length>1;let Me;return _Q&&!ai||Kn?Me="-100%":Me="0%",b.jsx("div",{className:"lightbox-gallery-image",style:{position:"absolute",opacity:Oe,left:g?Me:"0%",transform:`scale(${cs})`,transition:_===Q||V.current?"all 0.5s ease-out":"none"},children:b.jsx("img",{src:It||"",alt:nt||"","data-mdb-caption":Tt||"",onMouseDown:Yn,onMouseMove:Mn,onMouseUp:Mi,onWheel:Ti,onTouchStart:Yn,onTouchMove:Mn,onTouchEnd:Mi,onDoubleClick:dn,className:`lightbox-gallery-item ${_===Q&&"active"}`})},Q)})}),b.jsx("div",{className:"lightbox-gallery-arrow-left",children:b.jsx("button",{"aria-label":"Previous",className:it,onClick:()=>q("left")})}),b.jsx("div",{className:"lightbox-gallery-arrow-right",children:b.jsx("button",{"aria-label":"Next",className:it,onClick:()=>q("right"),ref:y})}),b.jsx("div",{className:"lightbox-gallery-caption-wrapper",children:b.jsx("p",{className:"lightbox-gallery-caption",children:T})})]})})]})});$8.displayName="MDBLightbox";const I8=Y.forwardRef(({className:e,fullscreenSrc:t,disabled:n,caption:i,...s},r)=>{const o=I("lightbox-item",n&&"lightbox-disabled",e);return b.jsx("img",{ref:r,"data-mdb-caption":i,"data-mdb-img":t,className:o,...s})});I8.displayName="MDBLightboxItem";const F8=Y.forwardRef(({className:e,...t},n)=>{const[i,s]=k.useState(!1),r=k.useCallback(()=>{const a=document.documentElement.scrollTop;s(!!a)},[]),o=I(i&&"navbar-scrolled","navbar-scroll",e);return k.useEffect(()=>{window.addEventListener("scroll",r)},[r]),b.jsx(pT,{className:o,ref:n,...t})});F8.displayName="MDBAnimatedNavbar";const RT=k.forwardRef(({className:e,closeIcon:t,tag:n="div",color:i,size:s,children:r,onDelete:o,...a},l)=>{const[c,u]=k.useState(!0),d=I("chip",s&&`chip-${s}`,i&&`chip-outline btn-outline-${i}`,e);return c?b.jsxs(n,{ref:l,className:d,...a,children:[r,t&&b.jsx("i",{className:"close fas fa-times",onClick:()=>{o==null||o(r),u(!1)}})]}):null});RT.displayName="MDBChip";const B8=Y.forwardRef(({className:e,value:t="",id:n,labelId:i,labelClass:s,label:r,onChange:o,labelRef:a,labelStyle:l,readonly:c,editable:u,onAdd:d,onDelete:h,initialValues:f=[],...p},m)=>{const v=k.useRef(null),y=a??v,g=k.useRef(null);k.useImperativeHandle(m,()=>g.current);const[x,_]=k.useState(f),[w,S]=k.useState(null),[C,M]=k.useState(0),[P,T]=k.useState(null),[A,E]=k.useState(t),z=x.length>0||A.length>0,N=I("form-outline","chips-input-wrapper",x.length>0&&"chips-padding chips-transition"),L=I("form-control",z&&"active",e),R=I("form-label",s);k.useEffect(()=>{!y.current||y.current.clientWidth===0||M(y.current.clientWidth*.8+8)},[y]);const B=()=>{y.current&&M(y.current.clientWidth*.8+8)},D=O=>{E(O.target.value),o==null||o(O)},$=O=>{A.length||((O.key==="ArrowLeft"||O.key==="ArrowDown")&&T(U=>U?U-1:x.length-1),(O.key==="ArrowRight"||O.key==="ArrowUp")&&T(U=>U===x.length-1||U===null?0:U+1),O.key==="Backspace"&&P!==null&&F(P)),O.key==="Enter"&&A.trim().length&&(d==null||d(A),_([...x,{tag:A}]),E(""))},F=O=>{const U=x.find((lt,ct)=>O===ct);if(U){h==null||h(U==null?void 0:U.tag);const lt=x.filter((ct,kt)=>O!==kt);_(lt),T(null)}},V=(O,U)=>{u&&S(U)},W=(O,U)=>{if(!u)return;const lt=O.currentTarget.textContent,ct=x.map((kt,it)=>it===U&<?{tag:lt}:kt);lt?_(ct):F(U),S(null),T(null)},et=(O,U)=>{O.key==="Enter"&&u&&w!==null&&W(O,U)},Z=()=>{A.trim().length&&(d==null||d(A),_([...x,{tag:A}]),E(""))};return b.jsx("div",{className:"chips chips-placeholder",children:b.jsxs("div",{className:N,children:[x.map((O,U)=>b.jsx(RT,{contentEditable:w===U,suppressContentEditableWarning:!0,onDoubleClick:lt=>V(lt,U),onDelete:()=>F(U),onKeyDown:lt=>et(lt,U),closeIcon:w!==U,className:I("btn",U===P&&"active"),children:O.tag},`${Math.random()}-${U}`)),b.jsx("input",{type:"text",readOnly:c,className:L,onChange:D,onFocus:B,onKeyDown:$,onBlur:()=>Z(),value:A,id:n,ref:g,...p}),r&&b.jsx("label",{className:R,style:l,id:i,htmlFor:n,ref:y,children:r}),b.jsxs("div",{className:"form-notch",children:[b.jsx("div",{className:"form-notch-leading"}),b.jsx("div",{className:"form-notch-middle",style:{width:C}}),b.jsx("div",{className:"form-notch-trailing"})]})]})})});B8.displayName="MDBChipsInput";function V8(){const[e,t]=k.useState(""),[n,i]=k.useState(""),[s,r]=k.useState(""),[o,a]=k.useState(null),[l,c]=k.useState(!1),[u,d]=k.useState([]),[h,f]=k.useState(!1),[p,m]=k.useState(null),[v,y]=k.useState(null),g=k.useRef(null);k.useEffect(()=>{if(l&&o&&o.plot_data&&g&&g.current){const M=g.current.getContext("2d");M&&new by(M,{type:"line",data:{labels:o.plot_data.n,datasets:[{label:"n^log_b(a)",data:o.plot_data.n_log_b_a,borderColor:"blue",borderWidth:1,fill:!1},{label:"f(n)",data:o.plot_data.f_n,borderColor:"red",borderWidth:2,fill:!1,borderDash:[5,5]},{label:"Time Complexity",data:o.plot_data.time_complexity,borderColor:"green",borderWidth:2,fill:!1,borderDash:[10,5]}]},options:{scales:{y:{beginAtZero:!0,title:{display:!0,text:"Function Value",color:"#888",font:{size:12}},ticks:{}},x:{grid:{display:!0},ticks:{callback:function(P){return Number(P).toFixed(0)}},title:{display:!0,text:"Input Size (n)",color:"#888",font:{size:12}}}},plugins:{legend:{display:!0,position:"top",labels:{boxWidth:20,padding:10}},tooltip:{enabled:!0}},elements:{line:{borderWidth:1},point:{radius:0}},responsive:!0,maintainAspectRatio:!1}})}},[l,o]),k.useEffect(()=>{(async()=>{try{const P=await fetch("http://master-theorem-aws-test2-dev.us-west-2.elasticbeanstalk.com/api/algorithms");if(!P.ok)throw new Error("Network response was not ok");const T=await P.json();d(T)}catch(P){console.error("Failed to fetch algorithms:",P)}})()},[]);const x=M=>{if(M===-1)f(!1),t(""),i(""),r(""),y(null);else{const P=u.find(T=>T.id===M);P&&(t(P.a.toString()),i(P.b.toString()),r(P.k.toString()),f(!0),y(P))}},_=async M=>{M.preventDefault(),await w(M)},w=async M=>{M.preventDefault(),c(!1),m(v);try{const P=await fetch("http://master-theorem-aws-test2-dev.us-west-2.elasticbeanstalk.com/api/evaluate/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({a:e,b:n,k:s})});if(!P.ok)throw new Error("Network response was not ok");const T=await P.json();a(T),c(!0)}catch(P){console.error("There was a problem with your fetch operation:",P)}},S=M=>{var P;if(Array.isArray(M))console.log("Multiple selections are not supported.");else{const T=parseInt(((P=M.value)==null?void 0:P.toString())||"-1",10);x(T)}},C=[{text:"User Input",value:"-1"},...u.map(M=>({text:M.name,value:M.id.toString()}))];return b.jsxs(b.Fragment,{children:[b.jsxs(rd,{alignment:"center",children:[b.jsx(od,{children:b.jsx("h1",{className:"main-header",children:"Evaluate Master Theorem"})}),b.jsxs(eg,{children:[b.jsx(fT,{children:b.jsx("span",{className:"card-title",children:"Enter the values of a, b, and k to evaluate the Master Theorem:"})}),b.jsxs("form",{onSubmit:_,children:[b.jsx(wi,{label:"a (number of subproblems)",id:"aInput",type:"number",min:"1",className:"my-4",value:e,onChange:M=>t(M.target.value),disabled:h}),b.jsx(wi,{label:"b (factor by which problem size is reduced)",id:"bInput",type:"number",min:"2",className:"my-4",value:n,onChange:M=>i(M.target.value),disabled:h}),b.jsx(wi,{label:"k (exponent in the work outside of recursive calls)",id:"kInput",type:"number",min:"0",className:"my-4",value:s,onChange:M=>r(M.target.value),disabled:h}),b.jsx("div",{className:"my-4",children:b.jsx(D0,{data:C,label:"Choose Algorithm or Enter Values",onChange:S})}),b.jsx(Zt,{onClick:w,className:"btn-block",children:"Evaluate"})]})]})]}),l&&o&&b.jsxs(rd,{className:"my-4",children:[b.jsx(od,{children:b.jsx("h2",{children:"Evaluation"})}),b.jsxs(eg,{className:"evaluation-card-body",children:[b.jsx("canvas",{ref:g,id:"myChart",className:"mb-3"}),b.jsxs(ad,{children:[b.jsx("strong",{children:"Recurrence Relation: "}),b.jsx("span",{dangerouslySetInnerHTML:{__html:o.recurrence_relation}})]}),b.jsxs(ad,{children:[b.jsx("strong",{children:"Evaluation: "}),b.jsx("span",{dangerouslySetInnerHTML:{__html:o.case}})]}),b.jsxs(ad,{children:[b.jsx("strong",{children:"Time Complexity: "}),b.jsx("span",{dangerouslySetInnerHTML:{__html:o.complexity}})]})]}),p&&b.jsxs(b.Fragment,{children:[b.jsxs("h4",{children:[p.name," Algorithm"]}),b.jsxs(ng,{alwaysOpen:!0,initialActive:1,children:[b.jsx(oo,{className:"left-align",collapseId:1,headerTitle:b.jsxs(b.Fragment,{children:[b.jsx(sn,{fas:!0,icon:"question-circle"}),"   Algorithm Description"]}),children:b.jsx("article",{children:p.description})}),b.jsx(oo,{collapseId:2,headerTitle:b.jsxs(b.Fragment,{children:[b.jsx(sn,{fab:!0,icon:"python"}),"   Python Code"]}),children:b.jsx("pre",{className:"left-align",children:b.jsx("code",{children:p.python_code})})})]})]})]}),b.jsxs(rd,{alignment:"center",className:"my-4",children:[b.jsx(od,{children:b.jsx("h2",{children:"About the Master Theorem"})}),b.jsxs(ng,{initialActive:1,children:[b.jsx(oo,{className:"left-align",collapseId:1,headerTitle:"What is the Master Theorem?",children:b.jsxs("article",{children:[b.jsxs("p",{children:["The ",b.jsx("strong",{children:"Master Theorem"})," offers a straightforward way to determine the time complexity of recursive algorithms, especially those that follow the divide and conquer approach. This theorem simplifies the process of analyzing how efficiently an algorithm runs as the size of its input increases. It is particularly useful for computer scientists and software engineers to predict algorithm performance without the need for detailed benchmarks."]}),b.jsx("p",{children:"The following parameters are required to evaluate an algorithm using the Master Theorem:"}),b.jsxs("ul",{children:[b.jsxs("li",{children:[b.jsx("strong",{children:"a"})," = the number of recursive subproblems."]}),b.jsxs("li",{children:[b.jsx("strong",{children:"b"})," = the factor by which the problem size is reduced."]}),b.jsxs("li",{children:[b.jsx("strong",{children:"k"})," = the exponent in the work done outside of the recursive function."]})]})]})}),b.jsx(oo,{className:"left-align",collapseId:2,headerTitle:"Decoding the Master Recurrence",children:b.jsxs("article",{children:[b.jsx("p",{children:"The Master Theorem can only be used to evaluate recursive algorithms with the following recurrence relation:"}),b.jsx("p",{className:"text-center",children:b.jsx("strong",{children:"T(n) = aT(n/b) + f(n)"})}),b.jsxs("p",{children:["This equation is the heart of the Master Theorem. and is called the ",b.jsx("strong",{children:"Master Recurrence"}),". It captures the essence of divide and conquer algorithms:"]}),b.jsxs("ul",{children:[b.jsxs("li",{children:[b.jsx("strong",{children:"T(n)"})," is the total time complexity we aim to find."]}),b.jsxs("li",{children:[b.jsx("strong",{children:"aT(n/b)"})," represents the time taken by the recursive subproblems."]}),b.jsxs("li",{children:[b.jsx("strong",{children:"f(n)"})," is the time taken by the work done outside the recursive calls, such as dividing the problem or combining the results."]})]}),b.jsx("p",{children:"Evaluating the Master Theorem involves comparing the rate of growth of two separate functions:"}),b.jsxs("ul",{children:[b.jsx("p",{className:"text-center",children:b.jsxs("strong",{children:["n",b.jsx("sup",{children:"logb(a)"})," + f(n)"]})}),b.jsxs("li",{children:[b.jsxs("strong",{children:["n",b.jsxs("sup",{children:["log",b.jsx("sub",{children:"b"}),"(a)"]})]})," ","is also known as the ",b.jsx("strong",{children:"watershed function."})]}),b.jsxs("li",{children:[b.jsx("strong",{children:"f(n)"})," is also known as the"," ",b.jsx("strong",{children:"driving function."})]})]}),b.jsx("p",{children:"Comparing the growth rate of these 2 functions results in either of 3 possible cases."})]})}),b.jsx(oo,{className:"left-align",collapseId:3,headerTitle:"The 3 Cases of the Master Theorem",children:b.jsxs("article",{children:[b.jsxs("p",{children:[b.jsx("strong",{children:"Case 1"}),": n",b.jsxs("sup",{children:["log",b.jsx("sub",{children:"b"}),"(a)"]})," ","grows asymptotically and polynomially greater than f(n):"]}),b.jsx("p",{className:"text-center",children:b.jsxs("strong",{children:["T(n) = n",b.jsxs("sup",{children:["log",b.jsx("sub",{children:"b"}),"(a)"]})]})}),b.jsxs("p",{children:[b.jsx("strong",{children:"Case 2:"})," n",b.jsxs("sup",{children:["log",b.jsx("sub",{children:"b"}),"(a)"]})," ","and f(n) grow at the same rate:"]}),b.jsx("p",{className:"text-center",children:b.jsxs("strong",{children:["T(n) = n",b.jsx("sup",{children:"k"})," log(n)"]})}),b.jsxs("p",{children:[b.jsx("strong",{children:"Case 3:"})," f(n) grows assymptotically and polynomially greater than n",b.jsxs("sup",{children:["log",b.jsx("sub",{children:"b"}),"(a)"]})," ","(and also fulfills the regularity condition",b.jsx("sup",{children:"*"}),") :"]}),b.jsx("p",{className:"text-center",children:b.jsxs("strong",{children:["T(n) = f(n",b.jsx("sup",{children:"k"}),")"]})}),b.jsxs("ul",{children:[b.jsxs("li",{children:[b.jsx("strong",{children:"Case 1"})," occurs when the split subproblems dominate the overall time complexity. It implies that as we break the problem down, the sheer number of subproblems is the primary driver of the complexity."]}),b.jsxs("li",{children:[b.jsx("strong",{children:"Case 2"})," occurs when the work done at each level of recursion is just as significant as the number of subproblems. This balance means the time complexity is a combination of the dividing/conquering work and the depth of the recursion."]}),b.jsxs("li",{children:[b.jsx("strong",{children:"Case 3"})," highlights scenarios where the work done outside the recursive calls (combining solutions, for instance) is the main factor determining the time complexity. This is typically seen in algorithms where merging or processing results is more intensive than breaking down the problem."]})]}),b.jsx("p",{children:b.jsxs("small",{children:[b.jsx("strong",{children:"*"})," Please note that this app evaluates n",b.jsxs("sup",{children:["log",b.jsx("sub",{children:"b"}),"(a)"]}),"and f(n",b.jsx("sup",{children:"k"}),") using their exponents and does not assess the regularity condition in Case 3, or whether the difference in growth between these two functions is polynomial. The regularity condition ensures that the work done at the recursive levels does not grow too quickly compared to the work done to divide the problem and combine the results. This condition helps maintain the integrity of the complexity analysis provided by the theorem."]})})]})})]})]})]})}Sp.createRoot(document.getElementById("root")).render(b.jsx(Y.StrictMode,{children:b.jsx(V8,{})})); + */function mi(e){return getComputedStyle(e)}function Ze(e,t){for(var n in t){var i=t[n];typeof i=="number"&&(i=i+"px"),e.style[n]=i}return e}function Eu(e){var t=document.createElement("div");return t.className=e,t}var W_=typeof Element<"u"&&(Element.prototype.matches||Element.prototype.webkitMatchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector);function Ts(e,t){if(!W_)throw new Error("No element matching method supported");return W_.call(e,t)}function Mo(e){e.remove?e.remove():e.parentNode&&e.parentNode.removeChild(e)}function H_(e,t){return Array.prototype.filter.call(e.children,function(n){return Ts(n,t)})}var pe={main:"ps",rtl:"ps__rtl",element:{thumb:function(e){return"ps__thumb-"+e},rail:function(e){return"ps__rail-"+e},consuming:"ps__child--consume"},state:{focus:"ps--focus",clicking:"ps--clicking",active:function(e){return"ps--active-"+e},scrolling:function(e){return"ps--scrolling-"+e}}},xT={x:null,y:null};function bT(e,t){var n=e.element.classList,i=pe.state.scrolling(t);n.contains(i)?clearTimeout(xT[t]):n.add(i)}function _T(e,t){xT[t]=setTimeout(function(){return e.isAlive&&e.element.classList.remove(pe.state.scrolling(t))},e.settings.scrollingThreshold)}function d4(e,t){bT(e,t),_T(e,t)}var Pc=function(e){this.element=e,this.handlers={}},wT={isEmpty:{configurable:!0}};Pc.prototype.bind=function(e,t){typeof this.handlers[e]>"u"&&(this.handlers[e]=[]),this.handlers[e].push(t),this.element.addEventListener(e,t,!1)};Pc.prototype.unbind=function(e,t){var n=this;this.handlers[e]=this.handlers[e].filter(function(i){return t&&i!==t?!0:(n.element.removeEventListener(e,i,!1),!1)})};Pc.prototype.unbindAll=function(){for(var e in this.handlers)this.unbind(e)};wT.isEmpty.get=function(){var e=this;return Object.keys(this.handlers).every(function(t){return e.handlers[t].length===0})};Object.defineProperties(Pc.prototype,wT);var la=function(){this.eventElements=[]};la.prototype.eventElement=function(e){var t=this.eventElements.filter(function(n){return n.element===e})[0];return t||(t=new Pc(e),this.eventElements.push(t)),t};la.prototype.bind=function(e,t,n){this.eventElement(e).bind(t,n)};la.prototype.unbind=function(e,t,n){var i=this.eventElement(e);i.unbind(t,n),i.isEmpty&&this.eventElements.splice(this.eventElements.indexOf(i),1)};la.prototype.unbindAll=function(){this.eventElements.forEach(function(e){return e.unbindAll()}),this.eventElements=[]};la.prototype.once=function(e,t,n){var i=this.eventElement(e),s=function(r){i.unbind(t,s),n(r)};i.bind(t,s)};function Au(e){if(typeof window.CustomEvent=="function")return new CustomEvent(e);var t=document.createEvent("CustomEvent");return t.initCustomEvent(e,!1,!1,void 0),t}function ah(e,t,n,i,s){i===void 0&&(i=!0),s===void 0&&(s=!1);var r;if(t==="top")r=["contentHeight","containerHeight","scrollTop","y","up","down"];else if(t==="left")r=["contentWidth","containerWidth","scrollLeft","x","left","right"];else throw new Error("A proper axis should be provided");h4(e,n,r,i,s)}function h4(e,t,n,i,s){var r=n[0],o=n[1],a=n[2],l=n[3],c=n[4],u=n[5];i===void 0&&(i=!0),s===void 0&&(s=!1);var d=e.element;e.reach[l]=null,d[a]<1&&(e.reach[l]="start"),d[a]>e[r]-e[o]-1&&(e.reach[l]="end"),t&&(d.dispatchEvent(Au("ps-scroll-"+l)),t<0?d.dispatchEvent(Au("ps-scroll-"+c)):t>0&&d.dispatchEvent(Au("ps-scroll-"+u)),i&&d4(e,l)),e.reach[l]&&(t||s)&&d.dispatchEvent(Au("ps-"+l+"-reach-"+e.reach[l]))}function Jt(e){return parseInt(e,10)||0}function f4(e){return Ts(e,"input,[contenteditable]")||Ts(e,"select,[contenteditable]")||Ts(e,"textarea,[contenteditable]")||Ts(e,"button,[contenteditable]")}function p4(e){var t=mi(e);return Jt(t.width)+Jt(t.paddingLeft)+Jt(t.paddingRight)+Jt(t.borderLeftWidth)+Jt(t.borderRightWidth)}var ao={isWebKit:typeof document<"u"&&"WebkitAppearance"in document.documentElement.style,supportsTouch:typeof window<"u"&&("ontouchstart"in window||"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>0||window.DocumentTouch&&document instanceof window.DocumentTouch),supportsIePointer:typeof navigator<"u"&&navigator.msMaxTouchPoints,isChrome:typeof navigator<"u"&&/Chrome/i.test(navigator&&navigator.userAgent)};function ss(e){var t=e.element,n=Math.floor(t.scrollTop),i=t.getBoundingClientRect();e.containerWidth=Math.round(i.width),e.containerHeight=Math.round(i.height),e.contentWidth=t.scrollWidth,e.contentHeight=t.scrollHeight,t.contains(e.scrollbarXRail)||(H_(t,pe.element.rail("x")).forEach(function(s){return Mo(s)}),t.appendChild(e.scrollbarXRail)),t.contains(e.scrollbarYRail)||(H_(t,pe.element.rail("y")).forEach(function(s){return Mo(s)}),t.appendChild(e.scrollbarYRail)),!e.settings.suppressScrollX&&e.containerWidth+e.settings.scrollXMarginOffset=e.railXWidth-e.scrollbarXWidth&&(e.scrollbarXLeft=e.railXWidth-e.scrollbarXWidth),e.scrollbarYTop>=e.railYHeight-e.scrollbarYHeight&&(e.scrollbarYTop=e.railYHeight-e.scrollbarYHeight),m4(t,e),e.scrollbarXActive?t.classList.add(pe.state.active("x")):(t.classList.remove(pe.state.active("x")),e.scrollbarXWidth=0,e.scrollbarXLeft=0,t.scrollLeft=e.isRtl===!0?e.contentWidth:0),e.scrollbarYActive?t.classList.add(pe.state.active("y")):(t.classList.remove(pe.state.active("y")),e.scrollbarYHeight=0,e.scrollbarYTop=0,t.scrollTop=0)}function U_(e,t){return e.settings.minScrollbarLength&&(t=Math.max(t,e.settings.minScrollbarLength)),e.settings.maxScrollbarLength&&(t=Math.min(t,e.settings.maxScrollbarLength)),t}function m4(e,t){var n={width:t.railXWidth},i=Math.floor(e.scrollTop);t.isRtl?n.left=t.negativeScrollAdjustment+e.scrollLeft+t.containerWidth-t.contentWidth:n.left=e.scrollLeft,t.isScrollbarXUsingBottom?n.bottom=t.scrollbarXBottom-i:n.top=t.scrollbarXTop+i,Ze(t.scrollbarXRail,n);var s={top:i,height:t.railYHeight};t.isScrollbarYUsingRight?t.isRtl?s.right=t.contentWidth-(t.negativeScrollAdjustment+e.scrollLeft)-t.scrollbarYRight-t.scrollbarYOuterWidth-9:s.right=t.scrollbarYRight-e.scrollLeft:t.isRtl?s.left=t.negativeScrollAdjustment+e.scrollLeft+t.containerWidth*2-t.contentWidth-t.scrollbarYLeft-t.scrollbarYOuterWidth:s.left=t.scrollbarYLeft+e.scrollLeft,Ze(t.scrollbarYRail,s),Ze(t.scrollbarX,{left:t.scrollbarXLeft,width:t.scrollbarXWidth-t.railBorderXWidth}),Ze(t.scrollbarY,{top:t.scrollbarYTop,height:t.scrollbarYHeight-t.railBorderYWidth})}function g4(e){e.element,e.event.bind(e.scrollbarY,"mousedown",function(t){return t.stopPropagation()}),e.event.bind(e.scrollbarYRail,"mousedown",function(t){var n=t.pageY-window.pageYOffset-e.scrollbarYRail.getBoundingClientRect().top,i=n>e.scrollbarYTop?1:-1;e.element.scrollTop+=i*e.containerHeight,ss(e),t.stopPropagation()}),e.event.bind(e.scrollbarX,"mousedown",function(t){return t.stopPropagation()}),e.event.bind(e.scrollbarXRail,"mousedown",function(t){var n=t.pageX-window.pageXOffset-e.scrollbarXRail.getBoundingClientRect().left,i=n>e.scrollbarXLeft?1:-1;e.element.scrollLeft+=i*e.containerWidth,ss(e),t.stopPropagation()})}function y4(e){Y_(e,["containerWidth","contentWidth","pageX","railXWidth","scrollbarX","scrollbarXWidth","scrollLeft","x","scrollbarXRail"]),Y_(e,["containerHeight","contentHeight","pageY","railYHeight","scrollbarY","scrollbarYHeight","scrollTop","y","scrollbarYRail"])}function Y_(e,t){var n=t[0],i=t[1],s=t[2],r=t[3],o=t[4],a=t[5],l=t[6],c=t[7],u=t[8],d=e.element,h=null,f=null,p=null;function m(g){g.touches&&g.touches[0]&&(g[s]=g.touches[0].pageY),d[l]=h+p*(g[s]-f),bT(e,c),ss(e),g.stopPropagation(),g.type.startsWith("touch")&&g.changedTouches.length>1&&g.preventDefault()}function v(){_T(e,c),e[u].classList.remove(pe.state.clicking),e.event.unbind(e.ownerDocument,"mousemove",m)}function y(g,x){h=d[l],x&&g.touches&&(g[s]=g.touches[0].pageY),f=g[s],p=(e[i]-e[n])/(e[r]-e[a]),x?e.event.bind(e.ownerDocument,"touchmove",m):(e.event.bind(e.ownerDocument,"mousemove",m),e.event.once(e.ownerDocument,"mouseup",v),g.preventDefault()),e[u].classList.add(pe.state.clicking),g.stopPropagation()}e.event.bind(e[o],"mousedown",function(g){y(g)}),e.event.bind(e[o],"touchstart",function(g){y(g,!0)})}function v4(e){var t=e.element,n=function(){return Ts(t,":hover")},i=function(){return Ts(e.scrollbarX,":focus")||Ts(e.scrollbarY,":focus")};function s(r,o){var a=Math.floor(t.scrollTop);if(r===0){if(!e.scrollbarYActive)return!1;if(a===0&&o>0||a>=e.contentHeight-e.containerHeight&&o<0)return!e.settings.wheelPropagation}var l=t.scrollLeft;if(o===0){if(!e.scrollbarXActive)return!1;if(l===0&&r<0||l>=e.contentWidth-e.containerWidth&&r>0)return!e.settings.wheelPropagation}return!0}e.event.bind(e.ownerDocument,"keydown",function(r){if(!(r.isDefaultPrevented&&r.isDefaultPrevented()||r.defaultPrevented)&&!(!n()&&!i())){var o=document.activeElement?document.activeElement:e.ownerDocument.activeElement;if(o){if(o.tagName==="IFRAME")o=o.contentDocument.activeElement;else for(;o.shadowRoot;)o=o.shadowRoot.activeElement;if(f4(o))return}var a=0,l=0;switch(r.which){case 37:r.metaKey?a=-e.contentWidth:r.altKey?a=-e.containerWidth:a=-30;break;case 38:r.metaKey?l=e.contentHeight:r.altKey?l=e.containerHeight:l=30;break;case 39:r.metaKey?a=e.contentWidth:r.altKey?a=e.containerWidth:a=30;break;case 40:r.metaKey?l=-e.contentHeight:r.altKey?l=-e.containerHeight:l=-30;break;case 32:r.shiftKey?l=e.containerHeight:l=-e.containerHeight;break;case 33:l=e.containerHeight;break;case 34:l=-e.containerHeight;break;case 36:l=e.contentHeight;break;case 35:l=-e.contentHeight;break;default:return}e.settings.suppressScrollX&&a!==0||e.settings.suppressScrollY&&l!==0||(t.scrollTop-=l,t.scrollLeft+=a,ss(e),s(a,l)&&r.preventDefault())}})}function x4(e){var t=e.element;function n(o,a){var l=Math.floor(t.scrollTop),c=t.scrollTop===0,u=l+t.offsetHeight===t.scrollHeight,d=t.scrollLeft===0,h=t.scrollLeft+t.offsetWidth===t.scrollWidth,f;return Math.abs(a)>Math.abs(o)?f=c||u:f=d||h,f?!e.settings.wheelPropagation:!0}function i(o){var a=o.deltaX,l=-1*o.deltaY;return(typeof a>"u"||typeof l>"u")&&(a=-1*o.wheelDeltaX/6,l=o.wheelDeltaY/6),o.deltaMode&&o.deltaMode===1&&(a*=10,l*=10),a!==a&&l!==l&&(a=0,l=o.wheelDelta),o.shiftKey?[-l,-a]:[a,l]}function s(o,a,l){if(!ao.isWebKit&&t.querySelector("select:focus"))return!0;if(!t.contains(o))return!1;for(var c=o;c&&c!==t;){if(c.classList.contains(pe.element.consuming))return!0;var u=mi(c);if(l&&u.overflowY.match(/(scroll|auto)/)){var d=c.scrollHeight-c.clientHeight;if(d>0&&(c.scrollTop>0&&l<0||c.scrollTop0))return!0}if(a&&u.overflowX.match(/(scroll|auto)/)){var h=c.scrollWidth-c.clientWidth;if(h>0&&(c.scrollLeft>0&&a<0||c.scrollLeft0))return!0}c=c.parentNode}return!1}function r(o){var a=i(o),l=a[0],c=a[1];if(!s(o.target,l,c)){var u=!1;e.settings.useBothWheelAxes?e.scrollbarYActive&&!e.scrollbarXActive?(c?t.scrollTop-=c*e.settings.wheelSpeed:t.scrollTop+=l*e.settings.wheelSpeed,u=!0):e.scrollbarXActive&&!e.scrollbarYActive&&(l?t.scrollLeft+=l*e.settings.wheelSpeed:t.scrollLeft-=c*e.settings.wheelSpeed,u=!0):(t.scrollTop-=c*e.settings.wheelSpeed,t.scrollLeft+=l*e.settings.wheelSpeed),ss(e),u=u||n(l,c),u&&!o.ctrlKey&&(o.stopPropagation(),o.preventDefault())}}typeof window.onwheel<"u"?e.event.bind(t,"wheel",r):typeof window.onmousewheel<"u"&&e.event.bind(t,"mousewheel",r)}function b4(e){if(!ao.supportsTouch&&!ao.supportsIePointer)return;var t=e.element;function n(p,m){var v=Math.floor(t.scrollTop),y=t.scrollLeft,g=Math.abs(p),x=Math.abs(m);if(x>g){if(m<0&&v===e.contentHeight-e.containerHeight||m>0&&v===0)return window.scrollY===0&&m>0&&ao.isChrome}else if(g>x&&(p<0&&y===e.contentWidth-e.containerWidth||p>0&&y===0))return!0;return!0}function i(p,m){t.scrollTop-=m,t.scrollLeft-=p,ss(e)}var s={},r=0,o={},a=null;function l(p){return p.targetTouches?p.targetTouches[0]:p}function c(p){return p.pointerType&&p.pointerType==="pen"&&p.buttons===0?!1:!!(p.targetTouches&&p.targetTouches.length===1||p.pointerType&&p.pointerType!=="mouse"&&p.pointerType!==p.MSPOINTER_TYPE_MOUSE)}function u(p){if(c(p)){var m=l(p);s.pageX=m.pageX,s.pageY=m.pageY,r=new Date().getTime(),a!==null&&clearInterval(a)}}function d(p,m,v){if(!t.contains(p))return!1;for(var y=p;y&&y!==t;){if(y.classList.contains(pe.element.consuming))return!0;var g=mi(y);if(v&&g.overflowY.match(/(scroll|auto)/)){var x=y.scrollHeight-y.clientHeight;if(x>0&&(y.scrollTop>0&&v<0||y.scrollTop0))return!0}if(m&&g.overflowX.match(/(scroll|auto)/)){var _=y.scrollWidth-y.clientWidth;if(_>0&&(y.scrollLeft>0&&m<0||y.scrollLeft<_&&m>0))return!0}y=y.parentNode}return!1}function h(p){if(c(p)){var m=l(p),v={pageX:m.pageX,pageY:m.pageY},y=v.pageX-s.pageX,g=v.pageY-s.pageY;if(d(p.target,y,g))return;i(y,g),s=v;var x=new Date().getTime(),_=x-r;_>0&&(o.x=y/_,o.y=g/_,r=x),n(y,g)&&p.preventDefault()}}function f(){e.settings.swipeEasing&&(clearInterval(a),a=setInterval(function(){if(e.isInitialized){clearInterval(a);return}if(!o.x&&!o.y){clearInterval(a);return}if(Math.abs(o.x)<.01&&Math.abs(o.y)<.01){clearInterval(a);return}if(!e.element){clearInterval(a);return}i(o.x*30,o.y*30),o.x*=.8,o.y*=.8},10))}ao.supportsTouch?(e.event.bind(t,"touchstart",u),e.event.bind(t,"touchmove",h),e.event.bind(t,"touchend",f)):ao.supportsIePointer&&(window.PointerEvent?(e.event.bind(t,"pointerdown",u),e.event.bind(t,"pointermove",h),e.event.bind(t,"pointerup",f)):window.MSPointerEvent&&(e.event.bind(t,"MSPointerDown",u),e.event.bind(t,"MSPointerMove",h),e.event.bind(t,"MSPointerUp",f)))}var _4=function(){return{handlers:["click-rail","drag-thumb","keyboard","wheel","touch"],maxScrollbarLength:null,minScrollbarLength:null,scrollingThreshold:1e3,scrollXMarginOffset:0,scrollYMarginOffset:0,suppressScrollX:!1,suppressScrollY:!1,swipeEasing:!0,useBothWheelAxes:!1,wheelPropagation:!0,wheelSpeed:1}},w4={"click-rail":g4,"drag-thumb":y4,keyboard:v4,wheel:x4,touch:b4},Tc=function(e,t){var n=this;if(t===void 0&&(t={}),typeof e=="string"&&(e=document.querySelector(e)),!e||!e.nodeName)throw new Error("no element is specified to initialize PerfectScrollbar");this.element=e,e.classList.add(pe.main),this.settings=_4();for(var i in t)this.settings[i]=t[i];this.containerWidth=null,this.containerHeight=null,this.contentWidth=null,this.contentHeight=null;var s=function(){return e.classList.add(pe.state.focus)},r=function(){return e.classList.remove(pe.state.focus)};this.isRtl=mi(e).direction==="rtl",this.isRtl===!0&&e.classList.add(pe.rtl),this.isNegativeScroll=function(){var l=e.scrollLeft,c=null;return e.scrollLeft=-1,c=e.scrollLeft<0,e.scrollLeft=l,c}(),this.negativeScrollAdjustment=this.isNegativeScroll?e.scrollWidth-e.clientWidth:0,this.event=new la,this.ownerDocument=e.ownerDocument||document,this.scrollbarXRail=Eu(pe.element.rail("x")),e.appendChild(this.scrollbarXRail),this.scrollbarX=Eu(pe.element.thumb("x")),this.scrollbarXRail.appendChild(this.scrollbarX),this.scrollbarX.setAttribute("tabindex",0),this.event.bind(this.scrollbarX,"focus",s),this.event.bind(this.scrollbarX,"blur",r),this.scrollbarXActive=null,this.scrollbarXWidth=null,this.scrollbarXLeft=null;var o=mi(this.scrollbarXRail);this.scrollbarXBottom=parseInt(o.bottom,10),isNaN(this.scrollbarXBottom)?(this.isScrollbarXUsingBottom=!1,this.scrollbarXTop=Jt(o.top)):this.isScrollbarXUsingBottom=!0,this.railBorderXWidth=Jt(o.borderLeftWidth)+Jt(o.borderRightWidth),Ze(this.scrollbarXRail,{display:"block"}),this.railXMarginWidth=Jt(o.marginLeft)+Jt(o.marginRight),Ze(this.scrollbarXRail,{display:""}),this.railXWidth=null,this.railXRatio=null,this.scrollbarYRail=Eu(pe.element.rail("y")),e.appendChild(this.scrollbarYRail),this.scrollbarY=Eu(pe.element.thumb("y")),this.scrollbarYRail.appendChild(this.scrollbarY),this.scrollbarY.setAttribute("tabindex",0),this.event.bind(this.scrollbarY,"focus",s),this.event.bind(this.scrollbarY,"blur",r),this.scrollbarYActive=null,this.scrollbarYHeight=null,this.scrollbarYTop=null;var a=mi(this.scrollbarYRail);this.scrollbarYRight=parseInt(a.right,10),isNaN(this.scrollbarYRight)?(this.isScrollbarYUsingRight=!1,this.scrollbarYLeft=Jt(a.left)):this.isScrollbarYUsingRight=!0,this.scrollbarYOuterWidth=this.isRtl?p4(this.scrollbarY):null,this.railBorderYWidth=Jt(a.borderTopWidth)+Jt(a.borderBottomWidth),Ze(this.scrollbarYRail,{display:"block"}),this.railYMarginHeight=Jt(a.marginTop)+Jt(a.marginBottom),Ze(this.scrollbarYRail,{display:""}),this.railYHeight=null,this.railYRatio=null,this.reach={x:e.scrollLeft<=0?"start":e.scrollLeft>=this.contentWidth-this.containerWidth?"end":null,y:e.scrollTop<=0?"start":e.scrollTop>=this.contentHeight-this.containerHeight?"end":null},this.isAlive=!0,this.settings.handlers.forEach(function(l){return w4[l](n)}),this.lastScrollTop=Math.floor(e.scrollTop),this.lastScrollLeft=e.scrollLeft,this.event.bind(this.element,"scroll",function(l){return n.onScroll(l)}),ss(this)};Tc.prototype.update=function(){this.isAlive&&(this.negativeScrollAdjustment=this.isNegativeScroll?this.element.scrollWidth-this.element.clientWidth:0,Ze(this.scrollbarXRail,{display:"block"}),Ze(this.scrollbarYRail,{display:"block"}),this.railXMarginWidth=Jt(mi(this.scrollbarXRail).marginLeft)+Jt(mi(this.scrollbarXRail).marginRight),this.railYMarginHeight=Jt(mi(this.scrollbarYRail).marginTop)+Jt(mi(this.scrollbarYRail).marginBottom),Ze(this.scrollbarXRail,{display:"none"}),Ze(this.scrollbarYRail,{display:"none"}),ss(this),ah(this,"top",0,!1,!0),ah(this,"left",0,!1,!0),Ze(this.scrollbarXRail,{display:""}),Ze(this.scrollbarYRail,{display:""}))};Tc.prototype.onScroll=function(e){this.isAlive&&(ss(this),ah(this,"top",this.element.scrollTop-this.lastScrollTop),ah(this,"left",this.element.scrollLeft-this.lastScrollLeft),this.lastScrollTop=Math.floor(this.element.scrollTop),this.lastScrollLeft=this.element.scrollLeft)};Tc.prototype.destroy=function(){this.isAlive&&(this.event.unbindAll(),Mo(this.scrollbarX),Mo(this.scrollbarY),Mo(this.scrollbarXRail),Mo(this.scrollbarYRail),this.removePsClasses(),this.element=null,this.scrollbarX=null,this.scrollbarY=null,this.scrollbarXRail=null,this.scrollbarYRail=null,this.isAlive=!1)};Tc.prototype.removePsClasses=function(){this.element.className=this.element.className.split(" ").filter(function(e){return!e.match(/^ps([-_].+|)$/)}).join(" ")};const k4=({className:e,sidenav:t,tag:n="div",handlers:i=["click-rail","drag-thumb","keyboard","wheel","touch"],wheelSpeed:s=1,wheelPropagation:r=!0,swipeEasing:o=!0,minScrollbarLength:a,maxScrollbarLength:l,scrollingThreshold:c=1e3,useBothWheelAxes:u=!1,suppressScrollX:d=!1,suppressScrollY:h=!1,scrollXMarginOffset:f=0,scrollYMarginOffset:p=0,scrollBarRef:m,onScrollY:v,onScrollX:y,onScrollUp:g,onScrollDown:x,onScrollLeft:_,onScrollRight:w,onYReachStart:S,onYReachEnd:C,onXReachStart:M,onXReachEnd:P,children:T,options:A,...E})=>{const z=I(t&&"sidenav-menu",e),N=k.useRef(null),R=k.useRef(null);return k.useEffect(()=>{let L=null;const B=[],D={handlers:i,wheelSpeed:s,wheelPropagation:r,swipeEasing:o,minScrollbarLength:a,maxScrollbarLength:l,scrollingThreshold:c,useBothWheelAxes:u,suppressScrollX:d,suppressScrollY:h,scrollXMarginOffset:f,scrollYMarginOffset:p,...A};if(!N.current)return;L=N.current,R.current=new Tc(L,D);const $={"ps-scroll-y":v,"ps-scroll-x":y,"ps-scroll-up":g,"ps-scroll-down":x,"ps-scroll-left":_,"ps-scroll-right":w,"ps-y-reach-start":S,"ps-y-reach-end":C,"ps-x-reach-start":M,"ps-x-reach-end":P};return Object.keys($).forEach(F=>{const V=$[F];if(typeof V=="function"&&L){const W=()=>V(L);B.push({eventName:F,handler:W}),L.addEventListener(F,W)}}),m&&m(R.current),()=>{var F;B.forEach(V=>{L==null||L.removeEventListener(V.eventName,V.handler)}),(F=R.current)==null||F.destroy(),R.current=null}},[i,s,r,o,a,l,c,u,d,h,f,p,m,v,y,g,x,_,w,S,C,M,P,A]),b.jsx(n,{className:z,ref:N,...E,children:T})},S4=Y.createContext({color:"primary"}),M4=Y.forwardRef(({className:e,children:t,...n},i)=>{const s=I("sidenav-menu",e);return b.jsx("ul",{className:s,ref:i,...n,children:t})});M4.displayName="MDBSideNavMenu";const C4=Y.forwardRef(({className:e,children:t,...n},i)=>{const s=I("sidenav-item",e);return b.jsx("li",{className:s,ref:i,...n,children:t})});C4.displayName="MDBSideNavItem";const P4=Y.forwardRef(({className:e,icon:t,iconClasses:n,iconAngle:i=180,shouldBeExpanded:s,children:r,active:o,tag:a="a",...l},c)=>{const{color:u}=k.useContext(S4),d=I("sidenav-link",o&&"active",e),h=I("rotate-icon",n),[f,p]=k.useState(s?i:0);return k.useEffect(()=>{p(s?i:0)},[s,i]),b.jsxs(v0,{rippleTag:a,onKeyDown:m=>{m.key==="Enter"&&m.target.click()},tabIndex:1,rippleColor:u,className:d,ref:c,...l,children:[r,t&&b.jsx(sn,{icon:t,style:{transform:`rotate(${f}deg)`},className:h})]})});P4.displayName="MDBSideNavLink";const kT=Y.forwardRef(({className:e,centered:t,children:n,size:i,scrollable:s,tag:r="div",...o},a)=>{const l=I("modal-dialog",s&&"modal-dialog-scrollable",t&&"modal-dialog-centered",i&&`modal-${i}`,e);return b.jsx(r,{className:l,...o,ref:a,children:n})});kT.displayName="MDBModalDialog";const T4=Y.forwardRef(({className:e,side:t,frame:n,position:i,children:s,tag:r="div",...o},a)=>{const l=I(t&&"modal-side",n&&"modal-frame",i&&`modal-${i}`,e);return b.jsx(kT,{className:l,...o,tag:r,ref:a,children:s})});T4.displayName="MDBModalDialog";const nf=Y.createContext({onDatetimepickerModeSwitch:()=>null,isInDatetimepicker:!1,setInputValue:null,setActiveHour:null,setActiveMinute:null,setPeriod:null,setMode:null,setHandAnimation:null,setMinuteAngle:null,setHourAngle:null,submitLabel:"",clearLabel:"",cancelLabel:"",activeHour:12,activeMinute:12,format:"12h",period:"",defaultValue:"",minHour:0,maxHour:23,minPeriod:"",maxPeriod:"",mode:"hours",handAnimation:!1,maxMinute:59,minMinute:0,minuteAngle:360,hourAngle:360,inline:!1,increment:!1,onChange:()=>null,onOpen:()=>null,onClose:()=>null,onCloseHandler:()=>null,amLabel:"AM",pmLabel:"PM",switchHoursToMinutesOnClick:!0,headId:"",bodyId:""}),ld=e=>{const t=e.split(":"),n=t[0],i=t[1].split(" ")[1],s=t[1].split(" ")[0];return{hour:parseInt(n),minute:parseInt(s),defaultPeriod:i}},X_=(e,t)=>(t==="24h"?/^([01]\d|2[0-3])(:[0-5]\d)$/:/^(0?[1-9]|1[012])(:[0-5]\d) [APap][mM]$/).test(e),Ki=(e,t,n,i,s,r)=>{let o=!1;return t&&(s!==""?e>t&&i===s&&(o=!0):e>t&&(o=!0)),n&&(r!==""?eKi(i,s,r,o,a,l)&&(n===t||n===e),D4=(e,t,n)=>{t.split(" ").forEach(i=>{e.addEventListener(i,n)})},E4=(e,t,n)=>{t.split(" ").forEach(i=>{e.removeEventListener(i,n)})},ST=(e,t)=>{const n=t.x-e.x,i=t.y-e.y;return Math.sqrt(n*n+i*i)},A4=(e,t)=>{const n=2*Math.atan2(t.y-e.y-ST(e,t),t.x-e.x);return Math.abs(n*180/Math.PI)},K_=e=>({radius:(e-32)/2-4}),O4=e=>{const t=new Date;let n=t.getHours();const i=t.getMinutes();if(e==="24h")return{hours:n,minutes:i,period:""};const s=n>=12?"PM":"AM";return n=n%12,n=n||12,{hours:n,minutes:i,period:s}},xp=(e,t)=>{const n=e.getMinutes();let i=e.getHours(),s;i===24&&(i=0);const r=i>=12?"PM":"AM";return t=="24h"?s=i<10?`0${i}:${n}`:`${i}:${n}`:t=="12h"&&(s=`${(i+24)%12||12}:${n} ${r}`),s},ig=Y.forwardRef(({...e},t)=>{const{activeHour:n,format:i,period:s,setPeriod:r,mode:o,setMode:a,activeMinute:l,setHandAnimation:c,inline:u,setActiveHour:d,setActiveMinute:h,maxHour:f,maxMinute:p,minHour:m,minMinute:v,maxPeriod:y,minPeriod:g,setInputValue:x,increment:_,submitLabel:w,onChange:S,onCloseHandler:C,amLabel:M,pmLabel:P,headId:T,show:A,onDatetimepickerModeSwitch:E,isInDatetimepicker:z}=k.useContext(nf),N=D=>{a(D),c(!0)},R=()=>{if(Ki(n,f,m,s,y,g)||Ki(l,p,v,s,y,g)||!A)return;C==null||C();const D=n===24?"00":n<10?`0${n}`:n,$=l<10?`0${l}`:l,F=`${D}:${$} ${s}`.trim();x(F),S==null||S(F)},L=(D,$)=>{const F=i==="12h"?12:24;if($.type==="click")return d(D?V=>V===F?1:V+1:V=>V===1?F:V-1);if($.type==="mousedown"){const V=setTimeout(()=>{const et=setInterval(()=>{d(D?O=>O===F?1:O+1:O=>O===1?F:O-1)},100),Z=()=>{clearInterval(et),document.removeEventListener("mouseup",Z)};document.addEventListener("mouseup",Z)},300),W=()=>{clearTimeout(V),document.removeEventListener("mouseup",W)};document.addEventListener("mouseup",W)}},B=(D,$)=>{const F=_?55:59,V=_?5:1;if($.type==="click")return h(D?W=>W>=F?0:W+V:W=>W-V<0?F:W-V);if($.type==="mousedown"){const W=setTimeout(()=>{const Z=setInterval(()=>{h(D?U=>U>=F?0:U+V:U=>U-V<0?F:U-V)},100),O=()=>{clearInterval(Z),document.removeEventListener("mouseup",O)};document.addEventListener("mouseup",O)},300),et=()=>{clearTimeout(W),document.removeEventListener("mouseup",et)};document.addEventListener("mouseup",et)}};return u?b.jsx("div",{id:T,className:"timepicker-head d-flex flex-row align-items-center justify-content-center timepicker-head-inline",style:{paddingRight:"0px"},ref:t,...e,children:b.jsxs("div",{className:"timepicker-head-content d-flex w-100 justify-content-evenly align-items-center",children:[b.jsxs("div",{className:"timepicker-current-wrapper",children:[b.jsxs("span",{className:"position-relative h-100 timepicker-inline-hour-icons",children:[b.jsx(sn,{fas:!0,icon:"chevron-up",style:{display:"flex"},className:"position-absolute text-white timepicker-icon-up timepicker-icon-inline-hour",onClick:D=>L(!0,D),onMouseDown:D=>L(!0,D)}),b.jsx(Zt,{type:"button",color:"none",onClick:()=>{N("hours")},className:`timepicker-current timepicker-current-inline timepicker-hour ${o==="hours"&&"active"}`,tabIndex:0,style:{pointerEvents:o==="hours"?"none":void 0},onFocus:()=>{N("hours")},children:n===24?"00":n<10?`0${n}`:n}),b.jsx(sn,{fas:!0,icon:"chevron-down",style:{display:"flex"},className:"position-absolute text-white timepicker-icon-down timepicker-icon-inline-hour",onClick:D=>L(!1,D),onMouseDown:D=>L(!1,D)})]}),b.jsx(Zt,{color:"none",className:"timepicker-dot timepicker-current-inline",disabled:!0,children:":"}),b.jsxs("span",{className:"position-relative h-100 timepicker-inline-minutes-icons",children:[b.jsx(sn,{fas:!0,icon:"chevron-up",style:{display:"flex"},className:"position-absolute text-white timepicker-icon-up timepicker-icon-inline-minute",onClick:D=>B(!0,D),onMouseDown:D=>B(!0,D)}),b.jsx(Zt,{onClick:()=>{N("minutes")},type:"button",color:"none",className:`timepicker-current timepicker-current-inline timepicker-minute ${o==="minutes"&&"active"}`,tabIndex:0,style:{pointerEvents:o==="minutes"?"none":void 0},onFocus:()=>{N("minutes")},children:l<10?`0${l}`:l}),b.jsx(sn,{fas:!0,icon:"chevron-down",style:{display:"flex"},className:"position-absolute text-white timepicker-icon-down timepicker-icon-inline-minute",onClick:D=>B(!1,D),onMouseDown:D=>B(!1,D)})]})]}),b.jsxs("div",{className:"d-flex justify-content-center timepicker-mode-wrapper",children:[i==="12h"&&b.jsxs(b.Fragment,{children:[b.jsx(Zt,{onClick:()=>r("AM"),type:"button",color:"none",className:`timepicker-hour-mode timepicker-am me-2 ms-4 ${s.toLowerCase()==="am"&&"active"}`,tabIndex:0,children:M}),b.jsx(Zt,{onClick:()=>r("PM"),type:"button",color:"none",className:`timepicker-hour-mode timepicker-pm ${s.toLowerCase()==="pm"&&"active"}`,tabIndex:0,children:P})]}),b.jsx(Zt,{type:"button",color:"none",className:"timepicker-button timepicker-submit timepicker-submit-inline py-1 px-2 mb-0",tabIndex:0,onClick:R,children:w})]})]})}):b.jsxs(b.Fragment,{children:[b.jsx("div",{id:T,className:"timepicker-head d-flex flex-row align-items-center justify-content-center",style:{paddingRight:"0px"},ref:t,...e,children:b.jsxs("div",{className:"timepicker-head-content d-flex w-100 justify-content-evenly",style:{paddingRight:i==="24h"?"50px":""},children:[b.jsxs("div",{className:"timepicker-current-wrapper",children:[b.jsx("span",{className:"position-relative h-100",children:b.jsx(Zt,{type:"button",color:"none",onClick:()=>{N("hours")},className:`timepicker-current timepicker-hour ${o==="hours"&&"active"}`,tabIndex:0,style:{pointerEvents:o==="hours"?"none":void 0},children:n===24?"00":n<10?`0${n}`:n})}),b.jsx(Zt,{color:"none",className:"timepicker-dot",disabled:!0,children:":"}),b.jsx("span",{className:"position-relative h-100",children:b.jsx(Zt,{onClick:()=>{N("minutes")},type:"button",color:"none",className:`timepicker-current timepicker-minute ${o==="minutes"&&"active"}`,tabIndex:0,style:{pointerEvents:o==="minutes"?"none":void 0},children:l<10?`0${l}`:l})})]}),i==="12h"&&b.jsxs("div",{className:"d-flex flex-column justify-content-center timepicker-mode-wrapper",children:[b.jsx(Zt,{onClick:()=>r("AM"),type:"button",color:"none",className:`timepicker-hour-mode timepicker-am ${s.toLowerCase()==="am"&&"active"}`,tabIndex:0,children:M}),b.jsx(Zt,{onClick:()=>r("PM"),type:"button",color:"none",className:`timepicker-hour-mode timepicker-pm ${s.toLowerCase()==="pm"&&"active"}`,tabIndex:0,children:P})]})]})}),z&&b.jsxs("div",{className:"buttons-container",children:[b.jsx("button",{type:"button",className:"datepicker-button-toggle",onClick:E,children:b.jsx("i",{className:"far fa-calendar datepicker-toggle-icon"})}),b.jsx("button",{type:"button",className:"timepicker-button-toggle",children:b.jsx("i",{className:"far fa-clock fa-sm timepicker-icon"})})]})]})});ig.displayName="MDBTimePickerHeader";const bp={hours:[{value:1,left:"169px",bottom:"209.263px",angle:30,id:`hour-1-${Math.floor(Math.random()*1001)}`},{value:2,left:"209.263px",bottom:"169px",angle:60,id:`hour-2-${Math.floor(Math.random()*1001)}`},{value:3,left:"224px",bottom:"114px",angle:90,id:`hour-3-${Math.floor(Math.random()*1001)}`},{value:4,left:"209.263px",bottom:"59px",angle:120,id:`hour-4-${Math.floor(Math.random()*1001)}`},{value:5,left:"169px",bottom:"18.7372px",angle:150,id:`hour-5-${Math.floor(Math.random()*1001)}`},{value:6,left:"114px",bottom:"4px",angle:180,id:`hour-6-${Math.floor(Math.random()*1001)}`},{value:7,left:"59px",bottom:"18.7372px",angle:210,id:`hour-7-${Math.floor(Math.random()*1001)}`},{value:8,left:"18.7372px",bottom:"59px",angle:240,id:`hour-8-${Math.floor(Math.random()*1001)}`},{value:9,left:"4px",bottom:"114px",angle:270,id:`hour-9-${Math.floor(Math.random()*1001)}`},{value:10,left:"18.7372px",bottom:"169px",angle:300,id:`hour-10-${Math.floor(Math.random()*1001)}`},{value:11,left:"59px",bottom:"209.263px",angle:330,id:`hour-11-${Math.floor(Math.random()*1001)}`},{value:12,left:"114px",bottom:"224px",angle:360,id:`hour-12-${Math.floor(Math.random()*1001)}`},{value:13,left:"94px",bottom:"115.962px",angle:30,id:`hour-13-${Math.floor(Math.random()*1001)}`},{value:14,left:"115.962px",bottom:"94px",angle:60,id:`hour-14-${Math.floor(Math.random()*1001)}`},{value:15,left:"124px",bottom:"64px",angle:90,id:`hour-15-${Math.floor(Math.random()*1001)}`},{value:16,left:"115.962px",bottom:"34px",angle:120,id:`hour-16-${Math.floor(Math.random()*1001)}`},{value:17,left:"94px",bottom:"12.0385px",angle:150,id:`hour-17-${Math.floor(Math.random()*1001)}`},{value:18,left:"64px",bottom:"4px",angle:180,id:`hour-18-${Math.floor(Math.random()*1001)}`},{value:19,left:"34px",bottom:"12.0385px",angle:210,id:`hour-19-${Math.floor(Math.random()*1001)}`},{value:20,left:"12.0385px",bottom:"34px",angle:240,id:`hour-20-${Math.floor(Math.random()*1001)}`},{value:21,left:"4px",bottom:"64px",angle:270,id:`hour-21-${Math.floor(Math.random()*1001)}`},{value:22,left:"12.0385px",bottom:"94px",angle:300,id:`hour-22-${Math.floor(Math.random()*1001)}`},{value:23,left:"34px",bottom:"115.962px",angle:330,id:`hour-23-${Math.floor(Math.random()*1001)}`},{value:24,left:"64px",bottom:"124px",angle:360,id:`hour-0-${Math.floor(Math.random()*1001)}`}],minutes:[{value:0,left:"114px",bottom:"224px",angle:360,id:`minute-0-${Math.floor(Math.random()*1001)}`},{value:5,left:"169px",bottom:"209.263px",angle:30,id:`minute-5-${Math.floor(Math.random()*1001)}`},{value:10,left:"209.263px",bottom:"169px",angle:60,id:`minute-10-${Math.floor(Math.random()*1001)}`},{value:15,left:"224px",bottom:"114px",angle:90,id:`minute-15-${Math.floor(Math.random()*1001)}`},{value:20,left:"209.263px",bottom:"59px",angle:120,id:`minute-20-${Math.floor(Math.random()*1001)}`},{value:25,left:"169px",bottom:"18.7372px",angle:150,id:`minute-25-${Math.floor(Math.random()*1001)}`},{value:30,left:"114px",bottom:"4px",angle:180,id:`minute-30-${Math.floor(Math.random()*1001)}`},{value:35,left:"59px",bottom:"18.7372px",angle:210,id:`minute-35-${Math.floor(Math.random()*1001)}`},{value:40,left:"18.7372px",bottom:"59px",angle:240,id:`minute-40-${Math.floor(Math.random()*1001)}`},{value:45,left:"4px",bottom:"114px",angle:270,id:`minute-45-${Math.floor(Math.random()*1001)}`},{value:50,left:"18.7372px",bottom:"169px",angle:300,id:`minute-50-${Math.floor(Math.random()*1001)}`},{value:55,left:"59px",bottom:"209.263px",angle:330,id:`minute-55-${Math.floor(Math.random()*1001)}`}]},MT=Y.forwardRef(({...e},t)=>{const n=k.useRef(null),i=k.useRef(null),[s,r]=k.useState(!1),[o,a]=k.useState(0),[l,c]=k.useState(0),{setActiveHour:u,format:d,activeHour:h,minHour:f,maxHour:p,minPeriod:m,maxPeriod:v,period:y,mode:g,setMode:x,activeMinute:_,setActiveMinute:w,setHandAnimation:S,handAnimation:C,maxMinute:M,minMinute:P,hourAngle:T,setHourAngle:A,minuteAngle:E,setMinuteAngle:z,increment:N,switchHoursToMinutesOnClick:R,bodyId:L}=k.useContext(nf),B=d==="24h"?bp.hours:bp.hours.filter(O=>O.value<13&&O.value!==0),D=bp.minutes,[$,F]=k.useState("calc(40% + 1px)"),V=k.useCallback(A4,[]),W=O=>{O.preventDefault(),r(!0)},et=O=>{O.preventDefault(),r(!1),g==="hours"&&(R&&x("minutes"),S(!0))},Z=k.useCallback(O=>{var U;const{width:lt,top:ct,left:kt}=(U=n.current)==null?void 0:U.getBoundingClientRect(),{clientX:it,clientY:Rt}="touches"in O?O.touches[0]:O,Ct={x:lt/2,y:-lt/2},Qt={x:it-kt,y:ct-Rt},ft=Math.round(V(Ct,Qt)+360)%360;if(g==="hours"){const wt=30*Math.round(ft/30);let dt=wt/30;if(d==="24h"){const{radius:jt}=K_(o),{radius:pt}=K_(l);ST(Ct,Qt)<(jt+pt)/2-16&&(dt+=12)}Ki(dt,p,f,y,v,m)||(u(dt),A(wt))}else if(ft===0)vp(f,p,h,0,M,P,y,v,m)||(w(0),z(360));else{const wt=N?30:6,dt=wt*Math.round(ft/wt);vp(f,p,h,dt/6,M,P,y,v,m)||(w(dt/6===60?0:dt/6),z(dt))}},[V,h,M,P,v,m,g,y,w,p,f,u,l,o,d,A,z,N]);return k.useEffect(()=>{n.current&&a(n.current.offsetWidth),i.current&&c(i.current.offsetWidth)},[]),k.useEffect(()=>(s&&D4(document,"mouseup mousemove mouseleave mouseover touchstart touchmove touchend",Z),()=>{E4(document,"mouseup mousemove mouseleave mouseover touchstart touchmove touchend",Z)}),[s,Z]),k.useEffect(()=>{const O=B.find(U=>U.value===h);O!==void 0&&(O.value>12||O.value===24?F("21.5%"):F("calc(40% + 1px)"))},[B,h]),b.jsx("div",{id:L,className:"timepicker-clock-wrapper d-flex justify-content-center flex-column align-items-center",ref:t,...e,children:b.jsxs("div",{onMouseDown:O=>W(O),onMouseUp:O=>et(O),ref:n,className:"timepicker-clock timepicker-clock-animation",children:[b.jsx("span",{className:"timepicker-middle-dot position-absolute"}),b.jsx("div",{className:`timepicker-hand-pointer position-absolute ${C&&"timepicker-transform"}`,style:{transform:`rotateZ(${g==="hours"?T:E}deg)`,height:g==="hours"?$:"calc(40% + 1px)"},children:b.jsx("div",{className:"timepicker-circle position-absolute",style:{backgroundColor:"rgb(25, 118, 210)"}})}),g==="hours"&&d==="24h"&&b.jsx("div",{ref:i,className:"timepicker-clock-inner",children:B.map(O=>{if(O.value>12||O.value===0)return b.jsx("span",{id:O.id,className:`timepicker-time-tips-inner ${Ki(O.value,p,f,y,v,m)&&"disabled"} ${O.value===h&&"active"}`,style:{left:O.left,bottom:O.bottom},children:b.jsx("span",{className:"timepicker-tips-inner-element",children:O.value===24?"00":O.value})},O.id)})}),g==="hours"&&B.map(O=>{if(d==="24h"){if(O.value<13&&O.value!==0)return b.jsx("span",{id:O.id,className:`timepicker-time-tips-hours ${Ki(O.value,p,f,y,v,m)&&"disabled"} ${O.value===h&&"active"}`,style:{left:O.left,bottom:O.bottom},children:b.jsx("span",{className:"timepicker-tips-element",children:O.value})},O.id)}else return b.jsx("span",{id:O.id,className:`timepicker-time-tips-hours ${Ki(O.value,p,f,y,v,m)&&"disabled"} ${O.value===h&&"active"}`,style:{left:O.left,bottom:O.bottom},children:b.jsx("span",{className:"timepicker-tips-element",children:O.value})},O.id)}),g==="minutes"&&D.map(O=>b.jsx("span",{id:O.id,className:`timepicker-time-tips-minutes ${vp(f,p,h,O.value,M,P,y,v,m)&&"disabled"} ${_===O.value&&"active"}`,style:{left:O.left,bottom:O.bottom},children:b.jsx("span",{className:"timepicker-tips-element",children:O.value<10?`0${O.value}`:O.value})},O.id))]})})});MT.displayName="MDBTimePickerClock";const CT=Y.forwardRef(({...e},t)=>{const{setInputValue:n,cancelLabel:i,submitLabel:s,clearLabel:r,activeHour:o,period:a,activeMinute:l,maxHour:c,maxMinute:u,minHour:d,minMinute:h,maxPeriod:f,minPeriod:p,defaultValue:m,setActiveHour:v,setActiveMinute:y,setPeriod:g,format:x,setHourAngle:_,setMinuteAngle:w,onChange:S,onCloseHandler:C,setMode:M}=k.useContext(nf);return b.jsx("div",{className:"timepicker-footer",ref:t,...e,children:b.jsxs("div",{className:"w-100 d-flex justify-content-between",children:[b.jsx(Zt,{onClick:()=>{if(m!==""&&m!==void 0){const{hour:P,minute:T,defaultPeriod:A}=ld(m);x==="24h"?(v(P===0?24:P),P===0?_(360):P>12?_((P-12)*30):_(P*30)):(v(P),_(P*30),g(A)),y(T),w(T*6),n(m),S==null||S(m)}else v(12),_(360),y(0),w(360),n(""),S==null||S(""),g(x==="24h"?"":"AM");M("hours")},type:"button",color:"none",className:"timepicker-button timepicker-clear",tabIndex:0,children:r}),b.jsx(Zt,{onClick:()=>C==null?void 0:C(),type:"button",color:"none",className:"timepicker-button timepicker-cancel",tabIndex:0,children:i}),b.jsx(Zt,{onClick:()=>{if(Ki(o,c,d,a,f,p)||Ki(l,u,h,a,f,p))return;C==null||C();const P=o===24?"00":o<10?`0${o}`:o,T=l<10?`0${l}`:l,A=`${P}:${T} ${a}`.trim();n(A),S==null||S(A)},type:"button",color:"none",className:"timepicker-button timepicker-submit",tabIndex:0,children:s})]})})});CT.displayName="MDBTimePickerFooter";const R4=({isOpen:e,inline:t})=>{k.useEffect(()=>{if(t)return;const n=window.innerWidth>document.documentElement.clientWidth&&window.innerWidth>=576,i=`${window.innerWidth-document.documentElement.clientWidth}px`;return e&&n?(document.body.style.overflow="hidden",document.body.style.paddingRight=i):(document.body.style.overflow="",document.body.style.paddingRight=""),()=>{document.body.style.overflow="",document.body.style.paddingRight=""}},[e,t])},L4=({className:e,isOpen:t,wrapperRef:n,inline:i,referenceElement:s,onOpened:r,onClosed:o})=>{const[a,l]=k.useState(null),c=I("timepicker-modal",!i&&"position-fixed",e),u=I("timepicker-wrapper","animation","h-100","d-flex","align-items-center","justify-content-center","flex-column",i?"timepicker-wrapper-inline":"position-fixed","fade",t&&"show"),{styles:d,attributes:h}=Oh(s,a,{placement:"bottom-start"}),f=p=>{p.opacity===0?o():r()};return R4({isOpen:t,inline:i}),b.jsx(b.Fragment,{children:b.jsx(aa,{children:b.jsx(Zy,{children:t&&(i?b.jsx(Jo.div,{className:c,style:d.popper,...h.popper,role:"dialog",ref:l,tabIndex:-1,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onAnimationComplete:p=>f(p),children:b.jsx("div",{ref:n,className:u,children:b.jsx("div",{className:"d-flex align-items-center justify-content-center flex-column shadow timepicker-container",style:{overflowY:"inherit"},children:b.jsx("div",{className:"d-flex flex-column timepicker-elements justify-content-around timepicker-elements-inline",children:b.jsx(ig,{})})})})}):b.jsx(Jo.div,{className:c,role:"dialog",tabIndex:-1,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},onAnimationComplete:p=>f(p),children:b.jsx("div",{ref:n,className:u,children:b.jsxs("div",{className:"d-flex align-items-center justify-content-center flex-column shadow timepicker-container",children:[b.jsxs("div",{className:"d-flex flex-column timepicker-elements justify-content-around",children:[b.jsx(ig,{}),b.jsx(MT,{})]}),b.jsx(CT,{})]})})}))})})})},G_=(e,t,n,i,s)=>{const r=n?55:59,o=n?5:1;let a;s?a=i>=r?0:i+o:a=i<=0?r:i-o,e(a),t(a*6)},Ou=(e,t,n,i,s,r)=>{if(r&&e==="24h"){let l=t;r==="isLeft"&&(l=t<=12?t+12:t),r==="isRight"&&(l=t>12?t-12:t),n(l),i(l*30);return}const o=e==="12h"?12:24;let a=t===1?o:t-1;s?a=t===o?1:t+1:a=t===1?o:t-1,n(a),i(a*30)},q_=(e,t,n)=>{const i=n==null?void 0:n.querySelectorAll('[tabindex="0"]');i&&i[t]&&(i[t].focus(),t===i.length-1?e(0):e(t+1))},N4=(e,t,n,i,s,r)=>{var o;!t&&e.target===n&&r&&(r==null||r()),t&&e.target!==n&&!(n!=null&&n.contains(e.target))&&e.target!==(i==null?void 0:i.parentNode)&&!((o=i==null?void 0:i.parentNode)!=null&&o.contains(e.target))&&s&&(r==null||r())},Q_="ArrowLeft",Z_="ArrowUp",J_="ArrowRight",tw="ArrowDown",ew="Enter",nw="Escape",iw="Tab",PT=k.forwardRef(({isInDatetimepicker:e,onDatetimepickerModeSwitch:t,datetimepickerRef:n,className:i,defaultValue:s,value:r,minHour:o,maxHour:a,maxTime:l,minTime:c,noIcon:u=!1,inputID:d,justInput:h=!1,inputClasses:f,inputLabel:p,invalidLabel:m,clearLabel:v,submitLabel:y,cancelLabel:g,format:x="12h",timePickerClasses:_,customIcon:w="far fa-clock",customIconSize:S="sm",btnIcon:C=!0,inline:M=!1,increment:P=!1,onChange:T,inputStyle:A,onOpen:E,onOpened:z,onClose:N,onClosed:R,disableFuture:L,disablePast:B,disabled:D=!1,amLabel:$="AM",pmLabel:F="PM",switchHoursToMinutesOnClick:V=!0,headId:W="",bodyId:et="",open:Z,style:O,...U},lt)=>{const ct=k.useMemo(()=>s instanceof Date?xp(s,x):s,[]),kt=k.useMemo(()=>r instanceof Date?xp(r,x):r,[r,x]),[it,Rt]=k.useState(!1),[Ct,Qt]=k.useState(!1),ft=ef(Ct,Z),[wt,dt]=k.useState(kt||ct||""),[jt,pt]=k.useState(!1),[xt,J]=k.useState(12),[mt,q]=k.useState(0),[ye,Dt]=k.useState(x==="24h"?"":"AM"),[he,Un]=k.useState(a||24),[Yn,Mn]=k.useState(o||1),[Si,dn]=k.useState(59),[Mi,as]=k.useState(0),[ls,Ci]=k.useState(""),[Pi,Ke]=k.useState(""),[Xn,Ti]=k.useState("hours"),[j,Q]=k.useState(!1),[It,nt]=k.useState(360),[Tt,Oe]=k.useState(360),[cs,ai]=k.useState(null),[Kn,Me]=k.useState(0);s instanceof Date&&(s=xp(s,x));const Kr=k.useId(),Gr=d??Kr,Cn={input:p??"Select a time",invalid:m??"Invalid Time Format",clear:v??"Clear",submit:y??"Ok",cancel:g??"Cancel"},ca=I("timepicker",i),Ec=I("timepicker-input",jt&&"is-invalid",f),sf=k.useRef(null),G=k.useRef(null),X=k.useRef(null),rt=k.useRef(null);k.useImperativeHandle(lt,()=>rt.current,[rt]);const ht=Lt=>{dt(Lt.target.value),T==null||T(Lt.target.value)},hn=Lt=>{h&&(Lt.target.blur(),E==null||E())},us=k.useCallback(()=>{Qt(!1),N==null||N()},[N]),Ge=k.useCallback(()=>{Qt(!0),E==null||E()},[E]),fn=k.useCallback(()=>{Rt(!1),R==null||R(),Ti("hours"),Me(0)},[R]),NT=k.useCallback(()=>{Rt(!0),z==null||z()},[z]),rf=k.useCallback(Lt=>{it&&N4(Lt,M,X.current,rt.current,ft,us)},[X,M,rt,ft,us,it]),of=k.useCallback(Lt=>{var Pn,pn;const{key:A0}=Lt,ua=document.activeElement,jT=ua===((Pn=X.current)==null?void 0:Pn.querySelector(".timepicker-hour")),$T=ua===((pn=X.current)==null?void 0:pn.querySelector(".timepicker-minute")),IT=ua==null?void 0:ua.closest('.timepicker-modal [tabindex="0"]');if(![tw,Z_,nw,iw,ew,Q_,J_].includes(A0))return;M&&!IT&&q_(Me,0,X.current),Lt.preventDefault();const Ac=!M&&Xn==="hours"||M&&jT,O0=!M&&Xn==="minutes"||M&&$T;switch(A0){case nw:return N==null?void 0:N();case Z_:if(Ac)return Ou(x,xt,J,nt,!0);if(O0)return G_(q,Oe,P,mt,!0);break;case tw:if(Ac)return Ou(x,xt,J,nt,!1);if(O0)return G_(q,Oe,P,mt,!1);break;case Q_:if(Ac&&!M)return Ou(x,xt,J,nt,!1,"isLeft");break;case J_:if(Ac&&!M)return Ou(x,xt,J,nt,!0,"isRight");break;case iw:q_(Me,Kn,X.current);break;case ew:ua.click();break}},[xt,x,Xn,mt,P,M,Kn,N]);return k.useEffect(()=>{if(!B&&!L)return;const{hours:Lt,minutes:Pn,period:pn}=O4(x);if(B)return Mn(Lt),as(Pn),Ci(pn);if(L)return Un(Lt),dn(Pn),Ke(pn)},[L,B,x]),k.useEffect(()=>(ft&&it&&(document.addEventListener("click",rf),document.addEventListener("keydown",of)),()=>{document.removeEventListener("click",rf),document.removeEventListener("keydown",of)}),[ft,it,rf,of]),k.useEffect(()=>{if(l){const{hour:Lt,minute:Pn,defaultPeriod:pn}=ld(l);Un(Lt),dn(Pn),pn!==void 0&&Ke(pn)}if(c){const{hour:Lt,minute:Pn,defaultPeriod:pn}=ld(c);Mn(Lt),as(Pn),pn!==void 0&&Ci(pn)}},[l,c]),k.useEffect(()=>{typeof r=="string"&&r&&X_(r,x)&&dt(r)},[r,x]),k.useEffect(()=>{if(X_(wt,x)||wt===""){if(pt(!1),wt!==""){const{hour:Lt,minute:Pn,defaultPeriod:pn}=ld(wt);x==="24h"?(J(Lt===0?24:Lt),Lt===0?nt(360):Lt>12?nt((Lt-12)*30):nt(Lt*30)):(J(Lt),nt(Lt*30),Dt(pn)),q(Pn),Oe(Pn*6)}}else pt(!0)},[wt,x]),k.useEffect(()=>{let Lt;return j&&(Lt=setTimeout(()=>{Q(!1)},400)),()=>{clearTimeout(Lt)}},[j]),b.jsx(b.Fragment,{children:b.jsx(nf.Provider,{value:{isInDatetimepicker:e,onDatetimepickerModeSwitch:t,show:ft,setInputValue:dt,submitLabel:Cn.submit,clearLabel:Cn.clear,cancelLabel:Cn.cancel,activeHour:xt,activeMinute:mt,setActiveHour:J,setActiveMinute:q,format:x,period:ye,setPeriod:Dt,defaultValue:s,maxHour:he,minHour:Yn,maxPeriod:Pi,minPeriod:ls,mode:Xn,setMode:Ti,setHandAnimation:Q,handAnimation:j,minMinute:Mi,maxMinute:Si,hourAngle:It,setHourAngle:nt,minuteAngle:Tt,setMinuteAngle:Oe,inline:M,increment:P,onChange:T,onOpen:E,onClose:N,onCloseHandler:us,amLabel:$,pmLabel:F,switchHoursToMinutesOnClick:V,headId:W,bodyId:et},children:b.jsxs(b.Fragment,{children:[b.jsx("div",{className:ca,ref:M?ai:sf,style:{...O,height:"fit-content"},...U,children:!e&&b.jsx(wi,{onFocus:hn,ref:rt,labelRef:G,className:Ec,label:Cn.input,id:Gr,value:wt,onChange:ht,wrapperClass:"timepicker",style:A,disabled:D,onClick:()=>{h&&Ge()},children:!h&&!u&&(C?b.jsx(Zt,{className:"timepicker-toggle-button",onClick:Ge,color:"none",tabIndex:0,type:"button",disabled:D,style:{pointerEvents:D?"none":"auto"},children:b.jsx("i",{className:`${w} ${S} timepicker-icon`})}):b.jsx("i",{onClick:Ge,className:`${w} ${S} timepicker-icon timepicker-toggle-button`}))})}),b.jsx(L4,{isOpen:ft,wrapperRef:X,referenceElement:n||cs,inline:M,className:_,onClosed:fn,onOpened:NT})]})})})});PT.displayName="MDBTimepicker";const j4=({className:e,dropdown:t,children:n,styles:i,attributes:s,setPopperElement:r,style:o,onClosed:a,onOpened:l})=>{const c={initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3}},u=I("datepicker-dropdown-container",e),d=I("datepicker-modal-container",e),h=f=>{f.opacity===0?a==null||a():l==null||l()};return b.jsx(b.Fragment,{children:t?b.jsx(Jo.div,{style:{position:"absolute",zIndex:1065,...i.popper},...s.popper,ref:r,className:u,tabIndex:-1,...c,onAnimationComplete:f=>h(f),children:n}):b.jsx(Jo.div,{...c,className:d,style:o,onAnimationComplete:f=>h(f),children:n})})},Ce={closeOnEsc:!0,title:"Select date",okBtnText:"Ok",clearBtnText:"Clear",cancelBtnText:"Cancel",customIcon:"far fa-calendar",customHeader:"",inputLabel:"Select a date",monthsFull:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],views:"days",format:"dd/mm/yyyy",weekdaysFull:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],weekdaysNarrow:["S","M","T","W","T","F","S"],startDay:0};function Te(e){return e.getDate()}function sw(e){return e.getDay()}function Pt(e){return e.getMonth()}function ot(e){return e.getFullYear()}function $4(e,t,n){const i=n,s=i>0?7-i:0,r=new Date(e,t).getDay()+s;return r>=7?r-7:r}function I4(e){return e.getDate()===oc(e)}function sg(e){return I4(e)?oc(new Date(ot(e),Pt(e)+1,1)):Te(e)}function oc(e){return F4(e).getDate()}function F4(e){return Or(e.getFullYear(),e.getMonth()+1,0)}function Lo(){return new Date}function Rn(e,t){return Je(e,t*12)}function Je(e,t){const n=Or(e.getFullYear(),e.getMonth()+t,e.getDate()),i=Te(e),s=Te(n);return i!==s&&n.setDate(0),n}function eo(e,t){return Or(e.getFullYear(),e.getMonth(),e.getDate()+t)}function Or(e,t,n){const i=new Date(e,t,n);return e>=0&&e<100&&i.setFullYear(i.getFullYear()-1900),i}function rg(e){return!Number.isNaN(e.getTime())}function rw(e,t){return ot(e)-ot(t)||Pt(e)-Pt(t)||Te(e)-Te(t)}function vs(e,t){return e.setHours(0,0,0,0),t.setHours(0,0,0,0),e.getTime()===t.getTime()}function ow(e){return parseInt(e,10)<10?`0${e}`:e}function og(e,t){const n=ot(e)-TT(0,null,null);return B4(n,t)}function B4(e,t){return(e%t+t)%t}function TT(e,t,n){let i=0;return n?i=ot(n)-e+1:t&&(i=ot(t)),i}function No(e,t,n,i){const s=t&&rw(e,t)<=0,r=n&&rw(e,n)>=0,o=i&&i(e)===!1;return!!(s||r||o)}function ag(e,t,n,i,s,r){const o=i&&ot(i),a=i&&Pt(i),l=n&&ot(n),c=n&&Pt(n),u=new Date().getFullYear(),d=new Date().getMonth();if(r&&u===t&&ed||r&&u>t||s&&uo||t===o&&e>a:!1,f=c&&l?tr)return!0;const o=t&&ot(t),a=n&&ot(n),l=a?e>a:!1,c=o?en===e)}function aw(e,t,n,i,s){return s?DT(e,s,t,n,i,s):!1}function lw(e,t,n,i,s){return i?DT(e,i,t,n,i,s):!1}function DT(e,t,n,i,s,r){if(n==="days")return ot(e)===ot(t)&&Pt(e)===Pt(t);if(n==="months")return ot(e)===ot(t);if(n==="years"){const o=TT(i,s,r);return Math.floor((ot(e)-o)/i)===Math.floor((ot(t)-o)/i)}return!1}function lh(e,t,n,i){let s;if(t){const r=V4(t);if(r){r[0]!==r[1]?s=r[0]+r[1]:s=r[0];const o=new RegExp(`[${s}]`),a=e.split(o),l=t==null?void 0:t.split(o),c=(t==null?void 0:t.indexOf("mmm"))!==-1,u=[];l==null||l.forEach((m,v)=>{m.indexOf("yy")!==-1&&(u[0]={value:a[v],format:m}),m.indexOf("m")!==-1&&(u[1]={value:a[v],format:m}),m.indexOf("d")!==-1&&m.length<=2&&(u[2]={value:a[v],format:m})});let d;(t==null?void 0:t.indexOf("mmmm"))!==-1?d=n:d=i;const h=Number(u[0].value),f=c?z4(u[1].value,d):Number(u[1].value)-1,p=Number(u[2].value);return Or(h,f,p)}}}function cw(e,t,n,i,s,r){const o=Te(e),a=ow(Te(e).toString()),l=n[sw(e)],c=i[sw(e)],u=Pt(e),d=ow((Pt(e)+1).toString()),h=s[Pt(e)],f=r[Pt(e)],p=ot(e).toString().length===2?ot(e):ot(e).toString().slice(2,4),m=ot(e),v=t.split(/(d{1,4}|m{1,4}|y{4}|yy|!.)/g);let y="";return v.forEach(g=>{switch(g){case"dddd":g=g.replace(g,c);break;case"ddd":g=g.replace(g,l);break;case"dd":g=g.replace(g,a);break;case"d":g=g.replace(g,o.toString());break;case"mmmm":g=g.replace(g,f);break;case"mmm":g=g.replace(g,h);break;case"mm":g=g.replace(g,d);break;case"m":g=g.replace(g,u.toString());break;case"yyyy":g=g.replace(g,m.toString());break;case"yy":g=g.replace(g,p.toString());break}y+=g}),y}const ET=(e,t)=>{if(!t)return!1;const n=new Date;return n.setHours(0,0,0,0)===e.setHours(0,0,0,0)?!1:et?e>new Date:!1,ir=Y.createContext({view:"days",setView:null,activeDate:new Date,setActiveDate:null,selectedDate:new Date,setSelectedDate:null,weekdaysShort:[],monthsShort:[],monthsFull:[],min:void 0,max:void 0,weekdaysFull:[],yearScope:[],tabCount:0,inline:!1,disableFuture:!1,disablePast:!1}),W4=({clearBtnText:e="Clear",cancelBtnText:t="Cancel",okBtnText:n="Ok",setValue:i,selectDate:s,onClose:r})=>{const{setActiveDate:o,setSelectedDate:a,selectedDate:l,isInDatetimepicker:c,onDatetimepickerModeSwitch:u}=k.useContext(ir),d=h=>{h.currentTarget.blur(),o(new Date),a(void 0),i("")};return b.jsxs("div",{className:"datepicker-footer",children:[b.jsx("button",{tabIndex:0,onClick:h=>d(h),className:"datepicker-footer-btn datepicker-clear-btn",children:e}),b.jsx("button",{tabIndex:0,onClick:()=>r==null?void 0:r(),className:"datepicker-footer-btn datepicker-cancel-btn",children:t}),b.jsx("button",{tabIndex:0,onClick:()=>{s(l),c&&(u==null||u()),r==null||r()},className:"datepicker-footer-btn datepicker-ok-btn",children:n})]})},H4=(e,t,n)=>{const i=document.createElement("button"),s=document.createElement("div");i.id=`datepicker-toggle-${Math.floor(Math.random()*10001)}`,i.tabIndex=0,i.type="button",i.style.pointerEvents="auto";const r=document.createElement("i");r.className=`${e} fa-${t} datepicker-icon`,n&&i.appendChild(r);const o=n?i:r;return o.classList.add("datepicker-toggle-button"),{div:s,selector:o}},U4=(e,t,n,i,s,r)=>{const o=[],a=Pt(e),l=Pt(Je(e,-1)),c=Pt(Je(e,1)),u=ot(e),d=$4(u,a,r),h=oc(e),f=oc(Je(e,-1)),p=7;let m=1,v=!1;for(let y=1;yh&&(m=1,v=!1);const _=Or(u,v?a:c,m);g.push({date:_,currentMonth:v,isSelected:t&&vs(_,t),isToday:vs(_,Lo()),dayNumber:Te(_),disabled:No(_,n,i,s)}),m++}o.push(g)}return o},Y4=e=>{const t=[],n=e[0];let i=[];for(let s=0;s<24;s++)if(i.push(n+s),i.length===4){const r=i;t.push(r),i=[]}return t},X4=e=>{const t=[];let n=[];return e.forEach(i=>{if(n.push(i),n.length===4){const s=n;t.push(s),n=[]}}),t},K4=({filter:e,startWeekdays:t,startDay:n,inlineDayClick:i,selectOnClick:s,selectDate:r,onClose:o})=>{const{min:a,max:l,setActiveDate:c,setSelectedDate:u,activeDate:d,selectedDate:h,tabCount:f,disableFuture:p,disablePast:m}=k.useContext(ir),v=y=>{!No(y,a,l,e)&&(c(y),u(y),i(y),s&&(r(y),o==null||o()))};return b.jsxs("table",{className:"datepicker-table",children:[b.jsx("thead",{children:b.jsx("tr",{children:t.map((y,g)=>b.jsx("th",{className:"datepicker-day-heading",scope:"col",children:y},g))})}),b.jsx("tbody",{className:"datepicker-table-body",children:U4(d,h,a,l,e,n).map((y,g)=>b.jsx("tr",{children:y.map((x,_)=>b.jsx("td",{onClick:()=>v(x.date),tabIndex:vs(x.date,d)?0:void 0,className:I("datepicker-cell","datepicker-small-cell","datepicker-day-cell",x.isToday&&"current",x.isSelected&&"selected",x.disabled&&"disabled",f===3&&vs(x.date,d)&&"focused",Pt(d)!==Pt(x.date)&&"disabled",AT(x.date,p)&&"disabled",ET(x.date,m)&&"disabled"),children:b.jsx("div",{className:"datepicker-cell-content datepicker-small-cell-content",style:{display:x.currentMonth?"block":"none"},children:x.dayNumber})},_))},g))})]})},G4=()=>{const{yearScope:e,setView:t,setActiveDate:n,activeDate:i,selectedDate:s,tabCount:r,min:o,max:a,disableFuture:l,disablePast:c}=k.useContext(ir);return b.jsx("table",{className:"datepicker-table",children:b.jsx("tbody",{className:"datepicker-table-body",children:Y4(e).map((u,d)=>b.jsx("tr",{children:u.map(h=>b.jsx("td",{onClick:()=>{n(new Date(h,Pt(i),Te(i))),t("months")},tabIndex:h===ot(i)?0:void 0,className:I("datepicker-cell","datepicker-large-cell","datepicker-year-cell",s&&h===ot(s)&&"selected",r===3&&h===ot(i)&&"focused",lg(h,o,a,l,c)&&"disabled",ot(Lo())===h&&"current"),children:b.jsx("div",{className:"datepicker-cell-content datepicker-large-cell-content",children:h})},h))},d))})})},q4=()=>{const{monthsShort:e,setActiveDate:t,setView:n,activeDate:i,selectedDate:s,tabCount:r,min:o,max:a,disableFuture:l,disablePast:c}=k.useContext(ir);return b.jsx("table",{className:"datepicker-table",children:b.jsx("tbody",{className:"datepicker-table-body",children:X4(e).map((u,d)=>b.jsx("tr",{children:u.map(h=>b.jsx("td",{onClick:()=>{t(new Date(ot(i),e.indexOf(h),sg(i))),n("days")},tabIndex:e.indexOf(h)===Pt(i)?0:void 0,className:I("datepicker-cell","datepicker-large-cell","datepicker-month-cell",s&&e.indexOf(h)===Pt(s)&&ot(i)===ot(s)&&"selected",r===3&&e.indexOf(h)===Pt(i)&&"focused",Pt(Lo())===e.indexOf(h)&&ot(Lo())===ot(i)&&"current",ag(e.indexOf(h),ot(i),o,a,l,c)&&"disabled"),children:b.jsx("div",{className:"datepicker-cell-content datepicker-large-cell-content",children:h})},e.indexOf(h)))},d))})})},Q4=({title:e,customHeader:t})=>{const{weekdaysShort:n,monthsShort:i,selectedDate:s,isInDatetimepicker:r,onDatetimepickerModeSwitch:o}=k.useContext(ir),a=s||new Date;return b.jsxs("div",{className:"datepicker-header",children:[b.jsx("div",{className:"datepicker-title",children:b.jsx("span",{className:"datepicker-title-text",children:e})}),b.jsxs("div",{className:"datepicker-date",children:[!t&&b.jsxs("span",{className:"datepicker-date-text",children:[n[a.getDay()],", ",i[a.getMonth()]," ",a.getDate()]}),t&&t]}),r&&b.jsxs("div",{className:"buttons-container",children:[b.jsx("button",{type:"button",className:"datepicker-button-toggle",children:b.jsx("i",{className:"far fa-calendar datepicker-toggle-icon"})}),b.jsx("button",{type:"button",className:"timepicker-button-toggle",onClick:o,children:b.jsx("i",{className:"far fa-clock fa-sm timepicker-icon"})})]})]})},Z4=()=>{const{view:e,setView:t,activeDate:n,setActiveDate:i,monthsFull:s,min:r,max:o,yearScope:a}=k.useContext(ir),l=c=>{if(e==="days"){const u=c?new Date(ot(n),Pt(n)+1,sg(n)):new Date(ot(n),Pt(n)-1,sg(n));c?!aw(Je(u,-1),"days",1,r,o)&&i(u):!lw(Je(u,1),"days",1,r,o)&&i(u)}else if(e==="years"){const u=c?new Date(ot(n)+24,Pt(n),Te(n)):new Date(ot(n)-24,Pt(n),Te(n));c?o?a[0]+24ot(r)&&i(u):i(u)}else if(e==="months"){const u=c?new Date(ot(n)+1,Pt(n),Te(n)):new Date(ot(n)-1,Pt(n),Te(n));c?!aw(Rn(u,-1),"months",1,r,o)&&i(u):!lw(Rn(u,1),"months",1,r,o)&&i(u)}};return b.jsxs("div",{className:"datepicker-date-controls",children:[e==="days"&&b.jsxs("button",{tabIndex:0,className:"datepicker-view-change-button",onClick:()=>t("years"),children:[s[n.getMonth()]," ",n.getFullYear()]}),e==="years"&&b.jsxs("button",{tabIndex:0,className:"datepicker-view-change-button",onClick:()=>t("days"),children:[a[0]," - ",a[1]]}),e==="months"&&b.jsx("button",{tabIndex:0,className:"datepicker-view-change-button",onClick:()=>t("days"),children:ot(n)}),b.jsxs("div",{className:"datepicker-arrow-controls",children:[b.jsx("button",{tabIndex:0,className:"datepicker-previous-button",onClick:()=>l(!1)}),b.jsx("button",{tabIndex:0,className:"datepicker-next-button",onClick:()=>l(!0)})]})]})},J4=({labelText:e,inline:t,setReferenceElement:n,inputClasses:i,value:s,style:r,inputStyle:o,icon:a,input:l,inputId:c,inputToggle:u,setDatepickerValue:d,format:h,onOpenHandler:f,...p})=>{const{monthsFull:m,monthsShort:v,setSelectedDate:y,setActiveDate:g}=k.useContext(ir),x=I(s?"active":"",i),_=k.useRef(null);return k.useEffect(()=>{var w;if(u)return;const S=(w=_.current)==null?void 0:w.parentNode,{div:C,selector:M}=H4(a,"sm",!0);return S==null||S.insertBefore(C,_.current),S==null||S.insertBefore(M,_.current),M.addEventListener("click",()=>f==null?void 0:f()),()=>{M.removeEventListener("click",()=>f==null?void 0:f()),S==null||S.removeChild(M)}},[a,f,u]),b.jsx(wi,{className:x,label:e,id:c,ref:t?n:l,labelRef:_,wrapperClass:"datepicker",value:s,onChange:w=>{const S=lh(w.target.value,h,m,v);d(w.target.value),S&&rg(S)?(g(S),y(S)):(g(new Date),y(void 0))},style:o,wrapperStyle:r,onClick:()=>{u&&(f==null||f())},...p})},x0="ArrowLeft",b0="ArrowUp",_0="ArrowRight",w0="ArrowDown",k0="Home",S0="End",M0="PageUp",C0="PageDown",P0="Enter",T0=" ",t8=(e,t,n,i,s,r,o,a,l,c)=>{switch(e){case x0:t(u=>eo(u,-1));break;case _0:t(u=>eo(u,1));break;case b0:t(u=>eo(u,-7));break;case w0:t(u=>eo(u,7));break;case k0:t(u=>eo(u,1-Te(u)));break;case S0:t(u=>eo(u,oc(u)-Te(u)));break;case M0:t(u=>Je(u,-1));break;case C0:t(u=>Je(u,1));break;case P0:if(No(n,i,s,o)||ET(n,c)||AT(n,l))return;a(n),r(n);break;case T0:if(!o||o(n)){if(No(n,i,s,o))return;a(n),r(n)}break;default:return}},e8=(e,t,n,i,s,r,o,a,l)=>{switch(e){case x0:n(c=>Rn(c,-1));break;case _0:n(c=>Rn(c,1));break;case b0:n(c=>Rn(c,-4));break;case w0:n(c=>Rn(c,4));break;case k0:n(c=>Rn(c,-og(c,24)));break;case S0:n(c=>Rn(c,24-og(c,24)-1));break;case M0:n(c=>Rn(c,-24));break;case C0:n(c=>Rn(c,24));break;case P0:!lg(ot(t),i,s,a,l)&&r("months");break;case T0:!lg(ot(t),i,s,a,l)&&o(t);return;default:return}},n8=(e,t,n,i,s,r,o,a,l,c)=>{switch(e){case x0:n(u=>Je(u,-1));break;case _0:n(u=>Je(u,1));break;case b0:n(u=>Je(u,-4));break;case w0:n(u=>Je(u,4));break;case k0:n(u=>Je(u,-Pt(u)));break;case S0:n(u=>Je(u,11-Pt(u)));break;case M0:n(u=>Rn(u,-1));break;case C0:n(u=>Rn(u,1));break;case P0:!ag(Pt(t),ot(t),i,s,l,c)&&r("days");break;case T0:!ag(Pt(t),ot(t),i,s,l,c)&&o(t);return;default:return}},i8=({closeOnEsc:e,isOpen:t,activeDate:n,setActiveDate:i,min:s,max:r,view:o,setView:a,setSelectedDate:l,filter:c,setInlineDate:u,disableFuture:d,disablePast:h,onClose:f})=>{const[p,m]=k.useState(3),v=k.useRef(null),y=k.useCallback(g=>{var x,_,w;if(e&&g.key==="Escape"&&(f==null||f()),g.preventDefault(),!g.shiftKey&&g.key==="Tab"){const S=(x=v.current)==null?void 0:x.querySelectorAll('[tabindex="0"]');S&&(p===S.length-1?m(0):m(p+1))}else if(g.key==="Enter")p!==3&&document.activeElement&&document.activeElement.click();else if(g.shiftKey&&g.key==="Tab"){const S=(_=v.current)==null?void 0:_.querySelectorAll('[tabindex="0"]');S&&m(p===0?S.length-1:p-1)}(w=v.current)!=null&&w.querySelector(".focused")&&p!==4&&(o==="days"?t8(g.key,i,n,s,r,l,c,u,d,h):o==="years"?e8(g.key,n,i,s,r,a,l,d,h):o==="months"&&n8(g.key,n,i,s,r,a,l,c,d,h))},[n,o,c,r,s,e,p,a,i,l,u,d,h,f]);return k.useEffect(()=>{var g,x;const _=(g=v.current)==null?void 0:g.querySelectorAll('[tabindex="0"]');if(_){const w=_[p];if(w.tagName!=="TD"){w.focus();const S=(x=v.current)==null?void 0:x.querySelector(".focused");S==null||S.classList.remove("focused")}else _[p-1].blur(),w.classList.add("focused")}},[p]),k.useEffect(()=>{t||m(3)},[t]),k.useEffect(()=>{m(3)},[o]),k.useEffect(()=>{if(t)return document.addEventListener("keydown",y),()=>{document.removeEventListener("keydown",y)}},[y,t]),{tabCount:p,modalRef:v}},s8=({isOpen:e,inline:t})=>{k.useEffect(()=>{const n=window.innerWidth>document.documentElement.clientWidth&&window.innerWidth>=576;if(!t)return e&&n?(document.body.style.overflow="hidden",document.body.style.paddingRight="17px"):(document.body.style.overflow="",document.body.style.paddingRight=""),()=>{document.body.style.overflow="",document.body.style.paddingRight=""}},[e,t])},r8=({isOpened:e,isOpen:t,inline:n,popperElement:i,referenceElement:s,backdropRef:r,onCloseHandler:o})=>{const a=k.useCallback(l=>{var c;n?!(i!=null&&i.contains(l.target))&&!((c=s==null?void 0:s.parentNode)!=null&&c.contains(l.target))&&!l.target.classList.contains("datepicker-view-change-button")&&!l.target.classList.contains("datepicker-large-cell-content")&&t&&o():l.target===r.current&&t&&o()},[i,s,r,n,t,o]);k.useEffect(()=>(e&&document.addEventListener("click",a),()=>{document.removeEventListener("click",a)}),[e,a])},OT=k.forwardRef(({datetimepickerRef:e,isInDatetimepicker:t,onDatetimepickerModeSwitch:n,closeOnEsc:i=Ce.closeOnEsc,customHeader:s,title:r=Ce.title,weekdaysNarrow:o=Ce.weekdaysNarrow,monthsFull:a=Ce.monthsFull,monthsShort:l=Ce.monthsShort,weekdaysFull:c=Ce.weekdaysFull,weekdaysShort:u=Ce.weekdaysShort,disableFuture:d,disablePast:h,filter:f,inline:p,className:m,min:v,max:y,format:g=Ce.format,okBtnText:x=Ce.okBtnText,clearBtnText:_=Ce.clearBtnText,cancelBtnText:w=Ce.cancelBtnText,inputToggle:S,customIcon:C=Ce.customIcon,inputId:M,inputLabel:P=Ce.inputLabel,inputStyle:T,startDay:A=Ce.startDay,views:E=Ce.views,style:z,defaultValue:N="",onChange:R,onClose:L,onClosed:B,onOpen:D,onOpened:$,getFormattedDateValues:F,value:V,wrapperClass:W,selectOnClick:et=!1,open:Z,disablePortal:O,...U},lt)=>{const[ct,kt]=k.useState(!1),[it,Rt]=k.useState(!1),Ct=ef(it,Z),[Qt,ft]=k.useState(new Date),[wt,dt]=k.useState(new Date),[jt,pt]=k.useState(E),[xt,J]=k.useState(V||N),[mt,q]=k.useState(),[ye,Dt]=k.useState(),[he,Un]=k.useState(o),[Yn,Mn]=k.useState([0,0]),Si=k.useRef(null),dn=k.useRef(null),Mi=k.useRef(N&&!0),{styles:as,attributes:ls}=Oh(e||ye,mt,{placement:"bottom-start",modifiers:[VM]});k.useImperativeHandle(lt,()=>p?ye:dn.current,[p,ye]);const Ci=nt=>{if(p&&p){const Tt=cw(nt,g,u,c,l,a);J(Tt),t&&(n==null||n()),Ke()}},Pi=nt=>{const Tt=nt&&cw(nt,g,u,c,l,a);Tt&&J(Tt)},Ke=k.useCallback(()=>{Rt(!1),L==null||L()},[L]),Xn=k.useCallback(()=>{Rt(!0),D==null||D()},[D]),Ti=k.useCallback(()=>{kt(!1),B==null||B()},[B]),j=k.useCallback(()=>{kt(!0),$==null||$()},[$]),{tabCount:Q,modalRef:It}=i8({closeOnEsc:i,isOpen:Ct,activeDate:Qt,setActiveDate:ft,min:v,max:y,view:jt,setView:pt,setSelectedDate:dt,filter:f,setInlineDate:Ci,disableFuture:d,disablePast:h});return s8({isOpen:Ct,inline:p}),r8({isOpened:ct,isOpen:Ct,inline:p,referenceElement:ye,popperElement:mt,backdropRef:Si,onCloseHandler:Ke}),k.useEffect(()=>{const nt=ot(Qt),Tt=og(Qt,24),Oe=nt-Tt;Mn([Oe,Oe+23])},[Qt]),k.useEffect(()=>{const nt=o.slice(A).concat(o.slice(0,A));Un(nt)},[o,A]),k.useEffect(()=>{if(!Ct)return;const nt=p?ye:dn.current,Tt=nt==null?void 0:nt.parentNode,Oe=Tt==null?void 0:Tt.querySelector("button");Oe?Oe.blur():nt==null||nt.blur()},[Ct,dn,ye,p,D]),k.useEffect(()=>{Z&&!Ct&&!ct&&(D==null||D(),Rt(!0))},[Z,Ct,ct,D]),k.useEffect(()=>{if(!Mi.current)return;const nt=lh(xt,g,a,l);nt&&rg(nt)&&(ft(nt),dt(nt)),Mi.current=!1},[N,xt,g,a,l]),k.useEffect(()=>{const nt=V&&lh(V,g,a,l);nt&&rg(nt)&&(ft(nt),dt(nt),J(V)),V===""&&(ft(new Date),dt(void 0),J(V))},[V,g,a,l]),k.useEffect(()=>{Ct||(pt(E),xt||(ft(new Date),dt(void 0)))},[Ct,E,xt]),k.useEffect(()=>{R==null||R(xt,Qt)},[xt]),k.useEffect(()=>{const nt=wt||new Date,Tt=String(nt.getDate()),Oe=u[nt.getDay()],cs=c[nt.getDay()],ai=l[nt.getMonth()],Kn=a[nt.getMonth()],Me=String(nt.getFullYear()),Kr=Me.slice(-2);F==null||F({dayNumber:Tt,weekdayShort:Oe,weekdayFull:cs,monthShort:ai,monthFull:Kn,yearFull:Me,yearShort:Kr})},[wt]),b.jsx(ir.Provider,{value:{isInDatetimepicker:t,onDatetimepickerModeSwitch:n,view:jt,setView:pt,activeDate:Qt,setActiveDate:ft,selectedDate:wt,setSelectedDate:dt,weekdaysShort:u,monthsShort:l,monthsFull:a,min:v,max:y,weekdaysFull:c,yearScope:Yn,tabCount:Q,isOpen:Ct,disablePast:h,disableFuture:d},children:b.jsxs(b.Fragment,{children:[!t&&b.jsx(J4,{inputClasses:m,labelText:P,inline:p,setReferenceElement:Dt,value:xt,setDatepickerValue:J,style:z,inputStyle:T,format:g,icon:C,input:dn,inputToggle:S,onOpenHandler:Xn,...U}),b.jsx(aa,{disablePortal:O,children:b.jsx(Zy,{children:Ct&&b.jsxs(b.Fragment,{children:[b.jsxs(j4,{className:W,dropdown:p,styles:as,attributes:ls,setPopperElement:q,onClosed:Ti,onOpened:j,children:[!p&&b.jsx(Q4,{title:r,customHeader:s,onClose:Ke}),b.jsxs("div",{className:"datepicker-main",ref:It,children:[b.jsx(Z4,{}),b.jsxs("div",{className:"datepicker-view",children:[jt==="days"&&b.jsx(K4,{startWeekdays:he,startDay:A,filter:f,inlineDayClick:Ci,selectDate:Pi,selectOnClick:et,onClose:Ke}),jt==="years"&&b.jsx(G4,{}),jt==="months"&&b.jsx(q4,{})]}),!p&&b.jsx(W4,{okBtnText:x,clearBtnText:_,cancelBtnText:w,setValue:J,selectDate:Pi,onClose:Ke})]})]},"datepicker-modal-container"),!p&&b.jsx(Jo.div,{className:"datepicker-backdrop",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},ref:Si})]})})})]})})});OT.displayName="MDBDatepicker";const o8=e=>{const t=/^([0-1]?[0-9]|2[0-3]):[0-5][0-9] [APap][mM]$/,n=/^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])?$/;return e.match(t)||e.match(n)},a8=e=>e&&Object.prototype.toString.call(e)==="[object Date]"&&!isNaN(e.getTime()),uw=300,l8=k.forwardRef(({className:e,label:t="Select Date and Time",labelStyle:n,labelClass:i,labelRef:s,inputClass:r="",inputRef:o,inline:a,disabled:l,defaultTime:c="",defaultDate:u="",value:d,invalidLabel:h,inputToggle:f=!1,timepickerOptions:p,datepickerOptions:m,showFormat:v,dateFormat:y="dd/mm/yyyy",timeFormat:g="12h",appendValidationInfo:x=!0,onChange:_,onOpen:w,onClose:S,onDatepickerOpen:C,onDatepickerClose:M,onTimepickerOpen:P,onTimepickerClose:T,...A},E)=>{const z=k.useRef(!1),[N,R]=k.useState(!1),[L,B]=k.useState(!1),[D,$]=k.useState(u),[F,V]=k.useState(c),[W,et]=k.useState(""),Z=k.useRef(),O=D?W.split(",")[0]:null,U=F?W.split(", ")[1]:null,lt=I("form-outline","datetimepicker",e),ct=()=>{const pt=O&&lh(O,y,Ce.monthsFull,Ce.monthsShort);return W&&!O&&!U||O&&!a8(pt)||U&&!o8(U)?r+" is-invalid":r},kt=k.useCallback(pt=>{$(pt)},[]),it=k.useCallback(pt=>{V(pt)},[]),Rt=k.useCallback(()=>{B(!1),z.current=!1,M==null||M()},[M]),Ct=k.useCallback(()=>{T==null||T(),R(!1),z.current=!1},[T]),Qt=k.useCallback(()=>{C==null||C()},[C]),ft=k.useCallback(()=>{P==null||P()},[P]),wt=()=>{B(!0),w==null||w(),z.current=!0},dt=k.useCallback(()=>{L?(B(!1),setTimeout(()=>{R(!0)},uw)):N&&(R(!1),setTimeout(()=>{B(!0)},uw))},[L,N]);k.useEffect(()=>{!F||!D||(_==null||_(`${D}, ${F}`),!d&&et(`${D}, ${F}`))},[F,D,_,d]),k.useEffect(()=>{d&&(et(d),_==null||_(d))},[d,_]),k.useEffect(()=>{!L&&!N&&!z.current&&(S==null||S())},[L,N,S]);const jt=pt=>{et(pt);const[xt,J]=pt.split(", ");$(xt||""),V(J||"")};return b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:lt,ref:Z,...A,children:[b.jsx(wi,{label:t,labelStyle:n,labelClass:i,ref:o||E,labelRef:s,placeholder:v?`${y}, ${g}`:void 0,value:d||W,onChange:pt=>{jt(pt.target.value),_==null||_(pt.target.value)},className:x?ct():r,disabled:l,onClick:()=>{f&&wt()},children:h&&b.jsx("div",{className:"invalid-feedback",children:h})}),!f&&b.jsx("button",{type:"button",className:"datetimepicker-toggle-button",onClick:wt,disabled:l,style:{pointerEvents:l?"none":"initial"},children:b.jsx("i",{className:"far fa-calendar datepicker-toggle-icon"})})]}),b.jsx(OT,{...m,inline:a,onChange:kt,format:y,datetimepickerRef:Z.current,defaultValue:u,value:D,onClose:Rt,onOpen:Qt,isInDatetimepicker:!0,open:L,onDatetimepickerModeSwitch:dt}),b.jsx(PT,{...p,inline:a,onChange:it,format:g,datetimepickerRef:Z.current,defaultValue:c,value:F,onClose:Ct,onOpen:ft,isInDatetimepicker:!0,open:N,onDatetimepickerModeSwitch:dt})]})});l8.displayName="MDBDateTimepicker";const c8=Y.forwardRef(({className:e,color:t,children:n,...i},s)=>{const r=I("toast-header",t&&`bg-${t}`,t&&t!=="light"&&"text-white",e);return b.jsx("div",{className:r,ref:s,...i,children:n})});c8.displayName="MDBToastHeader";const u8=Y.forwardRef(({className:e,children:t,color:n,...i},s)=>{const r=I("toast-body",n&&n!=="light"&&"text-white",e);return b.jsx("div",{className:r,ref:s,...i,children:t})});u8.displayName="MDBToastBody";const d8=Y.forwardRef(({className:e,white:t,children:n,...i},s)=>{const r=I("btn-close",t&&"btn-close-white",e);return b.jsx(Zt,{className:r,color:"none",ref:s,...i,children:n})});d8.displayName="MDBToastClose";const h8=0,f8=({selectedElements:e,optionHeight:t,data:n,multiple:i,selectAll:s,handleSelectAll:r,handleOptionClick:o,selectAllLabel:a,selectData:l,activeElementIndex:c,noResults:u,search:d})=>{const h=k.useMemo(()=>l.filter(v=>v.optgroup).map(v=>v.optgroup),[l]),f=k.useMemo(()=>{let v=0;return l.map(y=>(y.optgroup&&v++,{...y,groupIndex:v}))},[l]),p=k.useMemo(()=>l.filter(v=>!v.optgroup&&!v.hidden).length===0,[l]),m=v=>f.map(y=>{if(!y.optgroup&&v===y.groupIndex)return b.jsxs("div",{className:I("select-option",e.includes(y.elementPosition)&&"selected",y.disabled&&"disabled",y.hidden&&"d-none",c===y.elementPosition&&"active"),role:"option",style:{height:t},onClick:()=>o(y),children:[b.jsxs("span",{className:"select-option-text",children:[i&&b.jsx(oh,{disabled:y.disabled,disableWrapper:!0,checked:e.includes(y.elementPosition),readOnly:!0}),y.text,y.secondaryText&&b.jsx("span",{className:"select-option-secondary-text",children:y.secondaryText})]}),y.icon&&b.jsx("span",{className:"select-option-icon-container",children:b.jsx("img",{className:"select-option-icon rounded-circle",src:y.icon})})]},y.elementPosition)});return b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:"select-options-list",children:[i&&s&&!p&&b.jsx("div",{className:I("select-option",e.length===n.filter(v=>!v.disabled).length&&"selected",c===-1&&"active"),role:"option",onClick:r,style:{height:t},children:b.jsxs("span",{className:"select-option-text",children:[b.jsx(oh,{disableWrapper:!0,checked:n.filter(v=>!v.disabled&&!v.optgroup).length===e.length,readOnly:!0}),a]})}),m(h8),!p&&(h==null?void 0:h.map((v,y)=>{const g=m(y+1).filter(x=>x!==void 0);if(g.length!==0)return b.jsxs("div",{className:"select-option-group",children:[b.jsx("label",{className:"select-option-group-label",style:{height:t},children:v}),g]},`select-option-group ${v} ${y}`)}))]}),d&&p&&b.jsx("div",{className:"select-no-results",style:{height:t},children:u})]})},_p="ArrowUp",wp="ArrowDown",dw="Enter",hw="Escape",fw="Tab",p8=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;no.includes(a))||!r.every(a=>i[a]===s[a]))return!1}return!0},m8=e=>e.map((t,n)=>({...t,elementPosition:n})),g8={open:{opacity:1,transform:"scaleY(1)",transition:{duration:.2}},closed:{opacity:0,transform:"scaleY(0.8)",transition:{duration:.2}}},La=-1,D0=k.forwardRef(({data:e,className:t,inputClassName:n,optionHeight:i=38,visibleOptions:s=5,disabled:r,placeholder:o,label:a,clearBtn:l,children:c,multiple:u,displayedLabels:d=5,optionsSelectedLabel:h="options selected",selectAll:f=!0,selectAllLabel:p="Select all",size:m,openRef:v,contrast:y=!1,open:g,onOpen:x,onOpened:_,onClose:w,onClosed:S,onValueChange:C,onChange:M,search:P=!1,searchLabel:T="Search...",searchFn:A,autoSelect:E=!1,noResultsText:z="No results",validation:N=!1,validFeedback:R="Valid",invalidFeedback:L="Invalid",preventFirstSelection:B=!1,value:D,animationVariants:$,disablePortal:F,...V},W)=>{const[et,Z]=k.useState(!1),O=ef(et,g),[U,lt]=k.useState(!0),[ct,kt]=k.useState(null),[it,Rt]=k.useState(),[Ct,Qt]=k.useState();k.useImperativeHandle(W,()=>it,[it]);const[ft,wt]=k.useState(""),[dt,jt]=k.useState(""),[pt,xt]=k.useState(()=>f?La:e.findIndex(G=>!G.disabled)),[J,mt]=k.useState([]),[q,ye]=k.useState([]),[Dt,he]=k.useState(q),[Un,Yn]=k.useState(""),[Mn,Si]=k.useState(0),[dn,Mi]=k.useState(!1),as=I("select-wrapper",t),ls=I("select-input",o&&"placeholder-active",O&&"focused",n),Ci=I(O||ct&&a?"active":"",a&&"select-label"),Pi=I("select-dropdown",O&&"open"),{styles:Ke,attributes:Xn}=Oh(it,Ct,{placement:"bottom-start"}),Ti=k.useRef(null),j=k.useRef(null),Q=k.useRef(null),It=k.useMemo(()=>u&&f?s+1:s,[f,s,u]);k.useEffect(()=>{if(!dt)return he(q);if(A&&dt){const G=A(dt,q);return he(G||[])}he(()=>q.filter(G=>{var X;return((X=G.text)==null?void 0:X.toLocaleLowerCase().includes(dt.toLocaleLowerCase()))||G.optgroup}))},[dt,q,A,ft]),k.useEffect(()=>{O&&dt&&xt(-1)},[O,dt]),k.useEffect(()=>{if(!N)return;const G=J.every(ht=>q[ht].value),X=J.every(ht=>!q[ht].disabled),rt=J.length>0;!u&&(!rt||!G||!X)||u&&(!rt||!X)?it==null||it.setCustomValidity(L):it==null||it.setCustomValidity("")},[N,L,J,it,q,ft,u]);const nt=G=>{if(q.length===0)return;const X=j.current,rt=X.offsetHeight,ht=X.scrollTop,hn=q.filter(Ge=>Ge.hidden&&Ge.elementPosition(u&&f?-2:-1)){const Ge=(us-hn)*i,fn=Ge+i>ht+rt;Ge{const G=rt=>Dt.findIndex(ht=>ht.elementPosition==rt);let X=pt;for(;X{let G=pt;for(;G>=0;){G-=1;const X=Dt.findIndex(ht=>ht.elementPosition==G)!=-1,rt=G>=0&&(q[G].disabled||q[G].hidden||q[G].optgroup);if(G<=0&&(!X||rt))return u&&f?G=-1:pt;if(X&&!rt)break}return G},cs=G=>{const{key:X}=G;if([_p,wp,dw,fw,hw].includes(X)){if(X===fw)return E&&ca(Dt[pt]),it==null||it.focus(),Z(!1);if(G.preventDefault(),G.altKey&&(X===wp||X===_p))return O?w==null||w():x==null||x(),Z(!O);if(X===wp){const rt=Tt();return O?(nt(rt),xt(rt)):u?Z(!0):mt([rt])}if(X===_p){const rt=Oe();return O?(nt(rt),xt(rt)):u?Z(!0):mt([rt])}if(X===dw){const rt=Dt.findIndex(ht=>ht.elementPosition==pt);return O?pt===La?Kr():ca(Dt[rt]):(x==null||x(),Z(!0))}if(X===hw)return Z(!1),it==null?void 0:it.focus()}},ai=k.useCallback(()=>{Z(G=>!G)},[]),Kn=k.useCallback(G=>{if(v&&v.current===G.target)return;const X=Ct&&Ct!==null,rt=it&&it!==null,ht=!(Ct!=null&&Ct.contains(G.target))&&!(it!=null&&it.contains(G.target)),hn=G.target===Q.current;X&&O&&rt&&ht&&!hn&&(Z(!1),w==null||w())},[Ct,it,O,w,v]);k.useEffect(()=>{const G=m8(e);p8(G,q)||ye(G)},[e,q]);const Me=k.useCallback(()=>{O&&Yn(`${it==null?void 0:it.offsetWidth}px`)},[it,O]),Kr=()=>{if(!u||!f)return;if(J.length===e.filter(X=>!X.disabled&&!X.optgroup).length)return mt([]),C==null||C([]),M==null||M([]),Cn([]);const G=q==null?void 0:q.filter(X=>!X.disabled&&!X.optgroup).map(X=>X.elementPosition);return mt(G),C==null||C(e.filter(X=>!X.disabled)),M==null||M(e.filter(X=>!X.disabled)),Cn(G)},Gr=k.useCallback(()=>{if(q.length===0)return;let G=J[0];const X=G===void 0,rt=G>=q.length;if(dn&&!u){if(X&&B||!dn||u||rt)return;X&&(G=0);const ht=q[G].value,hn=String(q[G].text);hn?(kt(ht?null:hn),wt(ht?hn:"")):(kt(null),wt(ht?" ":""))}},[u,dn,J,q,B]),Cn=k.useCallback(G=>{const X=d===-1||G.length>d;if(G.length<=0&&(kt(null),wt("")),X)return kt(null),wt(`${G.length} ${h}`);const rt=G.map(fn=>q[fn].text||"").filter(fn=>fn!==""),ht=G.map(fn=>q[fn].value||"").filter(fn=>fn!==""),hn=rt.findIndex(fn=>fn!=="")===-1,us=ht.length>0,Ge=rt.join(", ");hn?(kt(null),wt(us?" ":"")):us?(wt(Ge),kt(null)):(wt(""),kt(Ge))},[d,h,q]);k.useEffect(()=>{Gr()},[J,Gr]);const ca=G=>{if(!G||G.disabled)return;const{elementPosition:X}=G;if(u){const rt=J.includes(X)?J.filter(ht=>ht!==X):[...J,X];return mt(rt),C==null||C(rt.map(ht=>e[ht])),M==null||M(rt.map(ht=>e[ht])),Cn(rt)}return mt([X]),Z(!1),C==null||C(e[X]),M==null||M(e[X]),w==null||w(),it==null?void 0:it.focus()};k.useEffect(()=>{Mi(!0)},[]),k.useEffect(()=>{if(u){const X=q.filter(rt=>rt.defaultSelected).map(rt=>rt.elementPosition);return Cn(X),mt(X)}let G=q.findIndex(X=>X.defaultSelected);G===La&&!B&&(G=q.findIndex(X=>!X.disabled&&!X.hidden)),G!==La&&mt([G])},[q,Cn,u,B]),k.useEffect(()=>{if(O&&P&&J.length===0)return xt(La);O||(J.length>0?xt(Math.max(...J)):xt(0))},[Dt,O,P,J]),k.useEffect(()=>{Si(It*i)},[It,i]),k.useEffect(()=>{Me()},[Me]),k.useEffect(()=>(O&&(window.addEventListener("click",Kn),window.addEventListener("resize",Me)),()=>{window.removeEventListener("click",Kn),window.removeEventListener("resize",Me)}),[Kn,Me,O]),k.useEffect(()=>{if(v){const G=v.current;return G==null||G.addEventListener("click",ai),()=>{G==null||G.removeEventListener("click",ai)}}},[v,ai]),k.useEffect(()=>{if(!D)return;const G=Array.isArray(D)?D:[D],X=q.filter(ht=>ht.value&&G.includes(ht.value)).map(ht=>ht.elementPosition);if(X.toString()===J.toString())return;const rt=u?X.map(ht=>q[ht]):q[X[0]];C==null||C(rt),M==null||M(rt),mt(X),u?Cn(X):Gr()},[D,q,u,C,M,J,Gr,Cn]);const Ec=k.useCallback(()=>{r||(it==null||it.focus(),O?w==null||w():x==null||x(),Z(!O))},[r,O,x,w,it]),sf=k.useCallback(G=>{var X;G==="open"&&(lt(!1),_==null||_(),P&&((X=Ti.current)==null||X.focus())),G==="closed"&&(lt(!0),S==null||S(),P&&jt(""))},[_,S,P]);return b.jsx("div",{className:as,...V,children:b.jsxs(b.Fragment,{children:[b.jsxs(wi,{ref:Rt,onClick:Ec,onKeyDown:cs,className:ls,value:ft,readonly:!N,required:N,disabled:r,placeholder:ct?void 0:o,label:a,labelClass:Ci,size:m,contrast:y,children:[N&&b.jsxs(b.Fragment,{children:[b.jsx("div",{className:"invalid-feedback",children:L}),b.jsx("div",{className:"valid-feedback",children:R})]}),ct&&b.jsx("div",{className:"form-label select-fake-value active",children:ct}),l&&(ft.length>0||ct)&&b.jsx("span",{tabIndex:0,className:`select-clear-btn d-block ${r?"pe-none":""}`,role:"button",onClick:()=>{wt(""),mt([]),C==null||C(u?[]:{}),M==null||M(u?[]:{})},children:"✕"}),b.jsx("span",{className:`select-arrow ${r?"pe-none":""}`,ref:Q,onClick:Ec,style:{cursor:"pointer"}})]}),(e==null?void 0:e.length)>0&&(O||!U)&&b.jsx(aa,{disablePortal:F,children:b.jsx("div",{style:{...Ke.popper,width:Un,zIndex:1070},...Xn.popper,ref:Qt,className:"select-dropdown-container",children:b.jsx(Zy,{children:O&&b.jsxs(Jo.div,{variants:{...g8,...$},initial:"closed",animate:"open",exit:"closed",tabIndex:0,className:Pi,onAnimationStart:()=>{lt(!1)},onAnimationComplete:sf,children:[P&&b.jsx("div",{className:"input-group",children:b.jsx("input",{onKeyDown:cs,onChange:G=>jt(G.target.value),ref:Ti,type:"text",className:"form-control select-filter-input",role:"searchbox",placeholder:T})}),b.jsx("div",{className:"select-options-wrapper",ref:j,style:{maxHeight:`${Mn}px`},children:b.jsx(f8,{data:e,selectData:Dt,selectedElements:J,optionHeight:i,visibleOptions:It,handleOptionClick:ca,handleSelectAll:Kr,selectAll:f,selectAllLabel:p,multiple:u,activeElementIndex:pt,noResults:z,search:P})}),c&&b.jsx("div",{className:"select-custom-content",children:c})]})})})})]})})});D0.displayName="MDBSelectV2";const Dc=k.createContext({isLoading:!1,activePage:0,setActivePage:null,sort:{column:"",option:""},fixedHeader:!1,handleSort:null}),y8=({fullPagination:e,rowsText:t="Rows per page:",selectValue:n,setSelectValue:i,activeDataLength:s,entriesOptions:r=[10,25,50,200],fullDataLength:o,allText:a="All",ofText:l="of"})=>{const{isLoading:c,activePage:u,setActivePage:d}=k.useContext(Dc),h=u===0||c,f=s<=n*(u+1)||c,p=u===Math.floor(s/n),m=r.map(g=>({text:g.toString(),value:g,defaultSelected:n===g}));m.push({text:a,value:o,defaultSelected:n===o});const v=g=>{g instanceof Array||(i(g.value),d(0))},y=`${u*n+1} - ${(u+1)*n>s?s:(u+1)*n} ${l} ${s}`;return b.jsxs("div",{className:"datatable-pagination",children:[b.jsxs("div",{className:"datatable-select-wrapper",children:[b.jsx("p",{className:"datatable-select-text",children:t}),b.jsx(D0,{onValueChange:v,data:m,disabled:c})]}),b.jsx("div",{className:"datatable-pagination-nav",children:y}),b.jsxs("div",{className:"datatable-pagination-buttons",children:[e&&b.jsx(Zt,{disabled:h,onClick:()=>d(0),className:"datatable-pagination-button datatable-pagination-start",color:"link",children:b.jsx(sn,{icon:"angle-double-left"})}),b.jsx(Zt,{disabled:h,onClick:()=>d(u-1),className:"datatable-pagination-button datatable-pagination-left",color:"link",children:b.jsx(sn,{icon:"chevron-left"})}),b.jsx(Zt,{disabled:f,onClick:()=>d(u+1),className:"datatable-pagination-button datatable-pagination-right",color:"link",children:b.jsx(sn,{icon:"chevron-right"})}),e&&b.jsx(Zt,{disabled:p,onClick:()=>d(Math.floor(s/n)),className:"datatable-pagination-button datatable-pagination-end",color:"link",children:b.jsx(sn,{icon:"angle-double-right"})})]})]})},pw=(e,t,n)=>{const i=s=>s.toString().toLowerCase().includes(t.toLowerCase());return e.filter(s=>{if(n&&typeof n=="string")return i(s[n]);let r=Object.values(s);return n&&Array.isArray(n)&&(r=Object.keys(s).filter(o=>n.includes(o)).map(o=>s[o])),r.filter(o=>i(o)).length>0})},v8=(e,t,n)=>Object.assign([],e).sort((i,s)=>{const r=typeof i[t]=="string"?i[t].toLowerCase():i[t],o=typeof s[t]=="string"?s[t].toLowerCase():s[t];return ro?n==="desc"?-1:1:0}),RT=e=>e.every(t=>typeof t=="string"),E0=e=>!e.every(t=>typeof t=="string"),x8=e=>Array.isArray(e),mw=e=>!Array.isArray(e),b8=({search:e,advancedSearch:t,searchValue:n,setSearchValue:i,searchInputProps:s,label:r="Search",setAdvancedSearchValue:o})=>b.jsxs(b.Fragment,{children:[e&&b.jsx(wi,{value:n,onChange:a=>i(a.target.value),label:r,className:"mb-4",...s}),t&&b.jsxs(yT,{className:"mb-4",children:[b.jsx("input",{className:"form-control",value:n,onChange:a=>i(a.target.value),...s}),b.jsx(Zt,{className:"datatable-advanced-search",onClick:()=>o(t(n)),children:b.jsx(sn,{icon:"search"})})]})]}),_8=({dataColumns:e})=>{const{sort:t,fixedHeader:n,handleSort:i}=k.useContext(Dc),[s,r]=k.useState("rotate(0deg)"),o=a=>I("datatable-sort-icon",`${a===t.column&&"active"}`);return k.useEffect(()=>{const a=t.option==="desc"?"rotate(180deg)":"rotate(0deg)";r(a)},[t.option]),b.jsx(b.Fragment,{children:e.map((a,l)=>b.jsxs("th",{className:n?"fixed-cell":"",style:{cursor:"pointer"},scope:"row",onClick:()=>i(a),children:[b.jsx(sn,{fas:!0,icon:"arrow-up",className:o(a),style:{transform:a===t.column?s:"rotate(0deg)"}}),a]},l))})},w8=({dataColumns:e})=>{const[t,n]=k.useState("rotate(0deg)"),{sort:i,fixedHeader:s,handleSort:r,isLoading:o}=k.useContext(Dc),a=l=>I("datatable-sort-icon",`${l===i.column&&"active"}`);return k.useEffect(()=>{const l=i.option==="desc"?"rotate(180deg)":"rotate(0deg)";n(l)},[i.option]),b.jsx(b.Fragment,{children:e.map((l,c)=>{const{fixedValue:u,fixed:d,label:h}=l,f=l.sort!==!1&&!o,p={cursor:I(f&&"pointer"),left:d==="left"?u||0:void 0,right:d==="right"?u||0:void 0},m=I((s||d)&&"fixed-cell");return b.jsxs("th",{className:m,style:p,scope:"row",onClick:()=>f&&r(h),children:[f&&b.jsx(sn,{fas:!0,icon:"arrow-up",className:a(h),style:{transform:i.column===h?t:"rotate(0deg)"}}),h]},c)})})},k8=({row:e,dataColumns:t,format:n,editable:i})=>b.jsx(b.Fragment,{children:t.map((s,r)=>{const{field:o,fixed:a,width:l,fixedValue:c,columnSelector:u}=s,d=e[o],h=Number(d),f=n==null?void 0:n(o,h?Number(d):String(d)),p={minWidth:l,maxWidth:l,left:a==="left"&&(c||0),right:a==="right"&&(c||0),...f},m=I(a&&"fixed-cell",u&&`mdb-datatable-${u}`);return b.jsx("td",{contentEditable:i,className:m,style:p,children:d},r)})}),S8=({row:e,editable:t})=>b.jsx(b.Fragment,{children:e.map((n,i)=>b.jsx("td",{contentEditable:t,children:n},i))}),M8=({activeData:e,dataRows:t,isOnThePage:n,noFoundMessage:i,dataColumns:s,onRowClick:r,selectable:o,handleRowSelect:a,selectedRows:l,format:c,editable:u})=>{const{isLoading:d}=k.useContext(Dc),h=e.length,f=s.length,p=(m,v)=>{m.target.nodeName!=="INPUT"&&(r==null||r(v))};return b.jsxs(H3,{className:"datatable-body",children:[e.map((m,v)=>{const y=t.indexOf(m),g=l.includes(y),x=I(g&&"active",mw(m)&&m.rowSelector&&`mdb-datatable-${m.rowSelector}`);if(n(v))return b.jsxs("tr",{onClick:_=>p(_,m),className:x,style:{cursor:r&&"pointer"},children:[o&&b.jsx("td",{children:b.jsx(oh,{checked:g,onChange:()=>a(y)})}),x8(m)&&b.jsx(S8,{editable:u,row:m}),mw(m)&&E0(s)&&b.jsx(k8,{editable:u,row:m,dataColumns:s,format:c})]},v)}),!h&&!d&&b.jsx("tr",{className:"datatable-results-info",children:b.jsx("td",{colSpan:f,className:"text-center",children:i})})]})},C8=({dataColumns:e,dataRows:t,sort:n,searchValue:i,advancedSearch:s,advancedSearchValue:r})=>{const[o,a]=k.useState(t);return k.useEffect(()=>{const{column:l,option:c}=n,{phrase:u,columns:d}=r;let h;if(l){let f,p=0;E0(e)&&(f=e.find(m=>m.label===l)),RT(e)&&(p=e.indexOf(l)),h=v8(t,f?f.field:p,c)}i&&!s&&(h=pw(h||t,i,void 0)),u&&(h=pw(h||t,u,d)),a(h||t)},[n,t,e,i,s,r]),o},P8=Y.forwardRef(({advancedSearch:e,allText:t,className:n,bordered:i,borderless:s,borderColor:r="",color:o="",dark:a,entries:l=10,editable:c,entriesOptions:u,fixedHeader:d,fullPagination:h,hover:f,format:p,loaderClass:m="bg-primary",isLoading:v,loadingMessage:y="Loading results...",maxWidth:g="",maxHeight:x="",multi:_,noFoundMessage:w="No matching results found",pagination:S=!0,selectable:C,sortField:M="",searchInputProps:P,sortOrder:T="asc",sm:A,striped:E,rowsText:z,data:N={columns:[],rows:[]},search:R,onSelectRow:L,onRowClick:B,searchLabel:D,ofText:$,...F},V)=>{const[W,et]=k.useState(0),[Z,O]=k.useState(l),[U,lt]=k.useState({column:"",option:""}),[ct,kt]=k.useState([]),[it,Rt]=k.useState(""),[Ct,Qt]=k.useState({phrase:"",columns:""}),ft=C8({dataColumns:N.columns,dataRows:N.rows,sort:U,searchValue:it,advancedSearch:e,advancedSearchValue:Ct}),wt=I("datatable",f&&"datatable-hover",o&&`bg-${o}`,a&&"datatable-dark",i&&"datatable-bordered",s&&"datatable-borderless",r&&`border-${r}`,E&&"datatable-striped",A&&"datatable-sm",v&&"datatable-loading",n),dt=J=>W*Z<=J&&J<(W+1)*Z,jt=J=>{const{column:mt,option:q}=U;lt(mt===J?q==="asc"?{...U,option:"desc"}:{column:"",option:""}:{column:J,option:"asc"})},pt=J=>{const mt=J.currentTarget.checked,q=mt?Array.from({length:N.rows.length},(Dt,he)=>he):[],ye=q.map(Dt=>ft[Dt]);L==null||L(ye,q,mt),kt(q)},xt=J=>{const mt=ct.includes(J);let q;_?mt?q=ct.filter(he=>he!==J):q=[...ct,J]:mt?q=[]:q=[J];const ye=q.map(he=>ft[he]),Dt=q.length===N.rows.length;L==null||L(ye,q,Dt),kt(q)};return k.useEffect(()=>{M&<({column:M,option:T})},[M,T]),k.useEffect(()=>{et(0)},[it]),b.jsxs(Dc.Provider,{value:{isLoading:v,activePage:W,setActivePage:et,sort:U,fixedHeader:d,handleSort:jt},children:[b.jsx(b8,{search:R,advancedSearch:e,searchValue:it,setSearchValue:Rt,searchInputProps:P,label:D,setAdvancedSearchValue:Qt}),b.jsxs("div",{className:wt,ref:V,style:{maxWidth:g},...F,children:[b.jsx(k4,{className:"datatable-inner table-responsive ps",style:{overflow:"auto",position:"relative",maxWidth:g,maxHeight:x},children:b.jsxs(z3,{className:"datatable-table",children:[b.jsx(W3,{className:"datatable-header",children:b.jsxs("tr",{children:[C&&b.jsx("th",{className:d?"fixed-cell":"",children:_&&b.jsx(oh,{checked:ct.length===N.rows.length,onChange:pt})}),RT(N.columns)&&b.jsx(_8,{dataColumns:N.columns}),E0(N.columns)&&b.jsx(w8,{dataColumns:N.columns})]})}),b.jsx(M8,{activeData:ft,dataColumns:N.columns,dataRows:N.rows,isOnThePage:dt,onRowClick:B,format:p,handleRowSelect:xt,selectedRows:ct,selectable:C,noFoundMessage:w,editable:c})]})}),v&&b.jsxs(b.Fragment,{children:[b.jsx("div",{className:"datatable-loader bg-light}",children:b.jsx("span",{className:"datatable-loader-inner",children:b.jsx("span",{className:I("datatable-progress",m)})})}),b.jsx("p",{className:"text-center text-muted my-4",children:y})]}),S&&b.jsx(y8,{fullPagination:h,selectValue:Z,setSelectValue:O,activeDataLength:ft.length,rowsText:z,entriesOptions:u,fullDataLength:N.rows.length,allText:t,ofText:$})]})]})});P8.displayName="MDBDatatable";h0.register(...i3||[]);Y.createContext({activeItem:1,setActiveItem:null,prevActive:{current:1},setHeight:null,completed:[],noEditable:!1,isAnimating:{current:!1},linear:!1,formRef:{current:null},validate:{target:0,after:0},setValidate:null,type:"horizontal",stepsLength:0,onValid:void 0,onInvalid:void 0,mobileProgress:!1,disableHeadSteps:!1,animations:!0});Y.createContext({activeItem:0,dynamic:!1,dynamicStyle:{color:"",icon:""},setDynamicStyle:null,setActiveItem:null,hoveredItem:0,setHoveredItem:null,readonly:!1,onChange:void 0});const T8=Y.forwardRef(({backdrop:e=!0,backdropColor:t="black",backdropOpacity:n=.4,color:i,className:s,loadingText:r="Loading...",isOpen:o,fullScreen:a,overflow:l=!0,parentRef:c,spinnerElement:u=b.jsx(hT,{className:"loading-icon",role:"status"}),textClassName:d,textStyles:h,tag:f="div",...p},m)=>{const v=I("loading-text",d),y=I(a?"loading-full":"loading","loading-spinner",a?"position-fixed":"position-absolute",i&&`text-${i}`,s),g=I("loading-backdrop",!a&&"position-absolute");k.useEffect(()=>{const w=c==null?void 0:c.current;if(w)return w.classList.add("position-relative"),()=>{w.classList.remove("position-relative")}},[c]),k.useEffect(()=>{if(a&&l)return o?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}},[a,o,l]);const x=b.jsxs(f,{className:y,ref:m,...p,children:[u,b.jsx("span",{className:v,style:h,children:r})]}),_=b.jsx("div",{className:g,style:{opacity:n,backgroundColor:t}});return b.jsx(b.Fragment,{children:o!==!1&&b.jsx(b.Fragment,{children:a?b.jsxs(aa,{children:[x,_]}):b.jsxs(b.Fragment,{children:[x,e&&_]})})})});T8.displayName="MDBLoadingManagement";const D8=({isOpened:e,inputRef:t,dropdownEl:n,setOpenState:i,onClose:s})=>{const r=k.useCallback(o=>{if(!n)return;const a=t.current===o.target,l=n===o.target,c=n.contains(o.target);e&&!a&&!l&&!c&&(i(!1),s==null||s())},[e,i,n,t,s]);k.useEffect(()=>(document.addEventListener("click",r),()=>{document.removeEventListener("click",r)}),[r])},E8=({inputRef:e,dropdownEl:t})=>{const n=k.useCallback(()=>{if(!e.current||!t)return;const{width:i}=window.getComputedStyle(e.current);t.style.width=i},[t,e]);k.useEffect(()=>(n(),window.addEventListener("resize",n),()=>{window.removeEventListener("resize",n)}),[n])},A8=({isOpen:e})=>{const[t,n]=k.useState(!1);return k.useEffect(()=>{let i;return e?n(!0):i=setTimeout(()=>{n(!1)},100),()=>{clearTimeout(i)}},[e]),t},O8=({className:e,customContent:t=null,inputRef:n,isOpen:i,isOpened:s,children:r,setOpenState:o,listHeight:a="190px",onOpened:l,onClose:c,onClosed:u,...d})=>{const[h,f]=k.useState(null),[p,m]=k.useState(null),v=k.useMemo(()=>[{name:"matchReferenceWidth",enabled:!0,fn:({state:S,instance:C})=>{if(!p)return;const M=p.offsetWidth,P=S.rects.reference.width;Math.round(M)!==Math.round(P)&&(p.style.width=`${P}px`,C.update())},phase:"beforeWrite",requires:["computeStyles"]}],[p]),y=A8({isOpen:i}),{styles:g,attributes:x,update:_}=Oh(h,p,{modifiers:v}),w=I("autocomplete-dropdown",i&&"open",e);return D8({isOpened:s,setOpenState:o,dropdownEl:p,inputRef:n,onClose:c}),E8({inputRef:n,dropdownEl:p}),k.useEffect(()=>{n.current&&f(n.current)},[n]),k.useEffect(()=>{i&&(_==null||_())},[i,_,y]),b.jsx(b.Fragment,{children:b.jsx(aa,{children:b.jsx("div",{className:"autocomplete-dropdown-container",ref:m,...d,style:g.popper,...x.popper,onTransitionEnd:S=>{S.propertyName==="opacity"&&(y?l==null||l():u==null||u())},children:b.jsxs("div",{className:w,children:[b.jsx("ul",{className:"autocomplete-items-list",role:"listbox",style:{maxHeight:a,display:y?"block":"none"},children:r}),t]})})})})},R8=({className:e,isActive:t,children:n,onSelect:i,value:s,...r})=>{const o=I("autocomplete-item",t&&"active",e),a=k.useRef(null);return k.useEffect(()=>{!t||!a.current||a.current.scrollIntoView({block:"nearest"})},[t]),b.jsx("li",{className:o,onClick:()=>i(s),ref:a,...r,children:n})},L8=({isOpen:e,setOpenState:t,length:n})=>{const[i,s]=k.useState(-1),r=k.useCallback(o=>{const a=o.key==="Tab",l=o.key==="Escape",c=o.key==="ArrowUp",u=o.key==="ArrowDown",d=o.key==="Home",h=o.key==="End",f=o.key==="Enter",p=o.altKey,m=n-1;if(!e)return s(-1);if(l||f||a||p&&c)return t(!1);if(u){o.preventDefault(),s(v=>v===m?m:v+1);return}if(c){o.preventDefault(),s(v=>v===0?0:v-1);return}if(d&&i!==-1){o.preventDefault(),s(0);return}if(h&&i!==-1){o.preventDefault(),s(m);return}},[e,t,n,i]);return k.useEffect(()=>{s(-1)},[n]),k.useEffect(()=>(document.addEventListener("keydown",r),()=>{document.removeEventListener("keydown",r)}),[r]),i},N8=Y.forwardRef(({open:e,autoSelect:t,className:n,customContent:i,data:s=[],displayValue:r,value:o,isLoading:a,listHeight:l,noResults:c="No results found",itemContent:u,onSelect:d,onSearch:h,onChange:f,onClose:p,onClosed:m,onOpen:v,onOpened:y,...g},x)=>{const _=k.useRef(null),[w,S]=k.useState(!1),[C,M]=k.useState(!1),P=ef(w,e),[T,A]=k.useState(""),E=k.useMemo(()=>o!==void 0?o:T,[o,T]),z=L8({isOpen:P,setOpenState:S,length:s.length});k.useImperativeHandle(x,()=>_.current);const N=I(P&&"focused","autocomplete-input",n),R=I((P||E)&&"active","autocomplete-label"),L=()=>{S(!0),v==null||v(),_.current&&!_.current.value&&(h==null||h(""))},B=$=>r?r($):$,D=$=>{S(!1),_.current&&(_.current.value=$,h==null||h($),d==null||d($),f==null||f($),p==null||p(),A($))};return b.jsxs(b.Fragment,{children:[b.jsx(wi,{autoComplete:"off",onKeyDown:$=>{const F=$.key==="Enter",V=$.key==="Tab";if(!w)return S(!0);z!==-1&&(F||t&&V)&&D(B(s[z]))},onChange:$=>{h==null||h($.target.value),f==null||f($.target.value),A($.target.value)},onFocus:L,className:N,labelClass:R,ref:_,role:"combobox",value:E,...g,children:a&&b.jsx("div",{className:"autocomplete-loader spinner-border",children:b.jsx("span",{className:"sr-only",children:"Loading..."})})}),b.jsxs(O8,{isOpen:P,isOpened:C,inputRef:_,setOpenState:S,customContent:i,listHeight:l,onClose:p,onOpened:()=>{y==null||y(),M(!0)},onClosed:()=>{m==null||m(),M(!1)},children:[s.length===0&&b.jsx("li",{className:"autocomplete-item autocomplete-no-results",children:c}),s.map(($,F)=>b.jsx(R8,{isActive:z===F,value:B($),onSelect:D,children:u?u($):B($)},F))]})]})});N8.displayName="MDBAutocomplete";const j8=Y.forwardRef(({className:e,icon:t,tag:n="p",children:i,...s},r)=>{const o=I("popconfirm-message",e);return b.jsxs(n,{className:o,ref:r,...s,children:[t&&b.jsx("span",{className:"popconfirm-icon-container",children:t}),b.jsx("span",{className:"popconfirm-message-text",children:i})]})});j8.displayName="MDBPopconfirmMessage";const $8=Y.forwardRef(({className:e,tag:t="div",zoomLevel:n=1,fontAwesome:i="free",children:s,lightboxRef:r,onOpen:o,onClose:a,onSlide:l,onZoomIn:c,onZoomOut:u,disablePortal:d,...h},f)=>{const p=k.useRef(null),m=k.useRef(null),v=r||m,y=k.useRef(null),[g,x]=k.useState(!1),[_,w]=k.useState(0),[S,C]=k.useState(!1),[M,P]=k.useState([]),[T,A]=k.useState(""),[E,z]=k.useState(1),[N,R]=k.useState(!1),[L,B]=k.useState(),[D,$]=k.useState(!1),F=k.useRef(!1),V=k.useRef(!1),W=k.useRef(),et=k.useRef(),Z=k.useRef(),O=k.useRef(),U=k.useRef(),lt=k.useRef(),ct=k.useRef(),kt=I("lightbox",e),it=I(i==="pro"&&"fontawesome-pro"),Rt=I("lightbox-gallery-close-btn",i==="pro"&&"fontawesome-pro"),Ct=I("lightbox-gallery-fullscreen-btn",i==="pro"&&"fontawesome-pro",S&&"active"),Qt=I("lightbox-gallery-zoom-btn",i==="pro"&&"fontawesome-pro",E>1&&"active"),ft=k.useMemo(()=>document.documentElement.dir==="rtl",[]),wt=()=>{F.current=!0,setTimeout(()=>{F.current=!1},400)},dt=k.useCallback(j=>{let Q=j;return Q>M.length-1?Q=0:Q<0&&(Q=M.length-1),M[Q].classList.contains("lightbox-disabled")?dt(Q-1):Q},[M]),jt=k.useCallback(()=>{E>=3||(z(j=>j+n),c==null||c())},[c,E,n]),pt=k.useCallback(()=>{var j;const Q=(j=p.current)==null?void 0:j.querySelector(".lightbox-gallery-item.active");Q!=null&&Q.parentElement&&(Q.parentElement.style.left="0",Q.parentElement.style.top="0",Q.style.transition="all 0.5s ease-out",Q.style.left="0",Q.style.top="0",ls(Q),setTimeout(()=>{Q.style.transition="none"},500))},[]),xt=k.useCallback(()=>{E-n===1&&pt(),!(E<=1)&&(z(j=>j-n),u==null||u())},[u,pt,E,n]),J=k.useCallback(()=>{var j;p.current&&Array.from((j=p.current)==null?void 0:j.querySelectorAll(".lightbox-gallery-item")).forEach(Q=>{ls(Q)})},[]),mt=k.useCallback(()=>{S&&document.exitFullscreen&&document.exitFullscreen(),setTimeout(()=>{document.body.classList.remove("disabled-scroll"),document.body.classList.remove("replace-scrollbar")}),x(!1),z(1),R(!1),J(),a==null||a()},[J,S,a]),q=k.useCallback(j=>{if(F.current||M.length<=1)return _;let Q=0;switch(j){case"left":Q=_-1;break;case"right":Q=_+1;break;case"last":Q=M.length-1;break;case"first":Q=0;break}wt();const It=dt(Q);w(It),z(1),R(!1),setTimeout(()=>{var nt;const Tt=(nt=p.current)==null?void 0:nt.querySelector(".lightbox-gallery-item.active");J(),A(Tt.getAttribute("data-mdb-caption"))},300),l==null||l()},[_,J,M.length,l,dt]),ye=k.useCallback(j=>{if(g)switch(j.nativeEvent.key){case"ArrowRight":q(ft?"left":"right");break;case"ArrowLeft":q(ft?"right":"left");break;case"Escape":mt();break;case"Home":q("first");break;case"End":q("last");break;case"ArrowUp":jt();break;case"ArrowDown":xt();break}},[mt,q,jt,xt,g,ft]),Dt=k.useCallback(j=>{document.body.classList.add("disabled-scroll"),document.documentElement.scrollHeight>document.documentElement.clientHeight&&document.body.classList.add("replace-scrollbar"),x(!0),w(j),R(!1),J(),setTimeout(()=>{var Q;const It=(Q=p.current)==null?void 0:Q.querySelector(".lightbox-gallery-item.active");A(It.getAttribute("data-mdb-caption"))},0),o==null||o()},[J,o]);k.useImperativeHandle(f,()=>({outsideAccess(j){Dt(j)}}));const he=k.useCallback(()=>{(document.webkitIsFullScreen||document.mozFullScreen||document.msFullscreenElement)===void 0&&C(!1)},[]),Un=()=>{var j,Q,It;if(!S){(Q=(j=p.current)==null?void 0:j.requestFullscreen)==null||Q.call(j),C(!0);return}(It=document.exitFullscreen)==null||It.call(document),C(!1)},Yn=j=>{j.nativeEvent.preventDefault();const Q=j.nativeEvent instanceof TouchEvent?j.nativeEvent.touches[0]:j.nativeEvent,It=Q.clientX,nt=Q.clientY;j.nativeEvent instanceof TouchEvent&&j.type==="touchstart"&&j.nativeEvent.touches.length>1&&($(!0),B(j.nativeEvent.touches));const Tt=j.target;Z.current=parseFloat(Tt.style.left),O.current=parseFloat(Tt.style.top),W.current=parseFloat(Tt.style.left),et.current=parseFloat(Tt.style.top),U.current=It*(1/E)-W.current,lt.current=nt*(1/E)-et.current,R(!0)},Mn=j=>{if(j.type==="touchmove"&&j.nativeEvent instanceof TouchEvent&&j.nativeEvent.targetTouches.length>1&&(j.nativeEvent.preventDefault(),as(j)),!N||D)return;const Q=j.nativeEvent instanceof TouchEvent?j.nativeEvent.touches[0]:j.nativeEvent,It=Q.clientX,nt=Q.clientY,Tt=j.target;if(E!==1){W.current=It*(1/E)-U.current,et.current=nt*(1/E)-lt.current,Tt.style.left=`${W.current}px`,Tt.style.top=`${et.current}px`;return}M.length<=1||(W.current=It*(1/E)-U.current,Tt.style.left=`${W.current}px`)},Si=k.useCallback(()=>{if(!(E!==1||M.length<=1||!W.current||D)){if(W.current-(Z.current||0)>0){q(ft?"right":"left");return}q(ft?"left":"right")}},[q,D,ft,M.length,E]),dn=k.useCallback(j=>{D||(j.nativeEvent instanceof TouchEvent&&!j.nativeEvent.touches&&Xn(j),E!==1?xt():jt())},[jt,xt,D,E]),Mi=j=>{if(R(!1),j.nativeEvent instanceof MouseEvent){Si(),R(!1);return}if(D&&j.targetTouches.length===0){$(!1),B(void 0);return}R(!1),Si()},as=j=>{if(!L)return;const Q=Math.hypot(L[1].pageX-L[0].pageX,L[1].pageY-L[0].pageY),It=Math.hypot(j.nativeEvent.touches[1].pageX-j.nativeEvent.touches[0].pageX,j.nativeEvent.touches[1].pageY-j.nativeEvent.touches[0].pageY),nt=Math.abs(Q-It),Tt=j.nativeEvent.view.screen.width;nt<=Tt*.03||(Q<=It?jt():xt(),B(j.nativeEvent.touches))},ls=j=>{j.parentElement&&(j.width>=j.height?(j.style.width="100%",j.style.maxWidth="100%",j.style.height="auto",j.style.top=`${(j.parentElement.offsetHeight-j.height)/2}px`,j.style.left="0"):(j.style.height="100%",j.style.maxHeight="100%",j.style.width="auto",j.style.left=`${(j.parentElement.offsetWidth-j.width)/2}px`,j.style.top="0"),j.width>=j.parentElement.offsetWidth&&(j.style.width=`${j.parentElement.offsetWidth}px`,j.style.height="auto",j.style.left="0",j.style.top=`${(j.parentElement.offsetHeight-j.height)/2}px`),j.height>=j.parentElement.offsetHeight&&(j.style.height=`${j.parentElement.offsetHeight}px`,j.style.width="auto",j.style.top="0",j.style.left=`${(j.parentElement.offsetWidth-j.width)/2}px`),W.current=parseFloat(j.style.left)||0,et.current=parseFloat(j.style.top)||0)},Ci=j=>{const Q=j.getAttribute("data-mdb-img")?j.getAttribute("data-mdb-img"):j.getAttribute("src")?j.getAttribute("src"):"",It=j.getAttribute("alt")?j.getAttribute("alt"):j.getAttribute("data-mdb-caption")?j.getAttribute("data-mdb-caption"):"",nt=j.getAttribute("data-mdb-caption")?j.getAttribute("data-mdb-caption"):j.getAttribute("alt")?j.getAttribute("alt"):"";return{source:Q,alt:It,caption:nt}},Pi=k.useCallback(()=>{const j=[...v.current.querySelectorAll(".lightbox-item")].filter(Q=>!Q.classList.contains("lightbox-disabled"));P(j)},[v]),Ke=k.useCallback(()=>{J()},[J]),Xn=j=>{W.current=window.innerWidth/2-j.nativeEvent.offsetX-50,et.current=window.innerHeight/2-j.nativeEvent.offsetY-50;const Q=j.target;Q.style.left=`${W.current}px`,Q.style.top=`${et.current}px`,Q.style.transition="all 0.5s ease-out",setTimeout(()=>{Q.style.transition="none"},500)},Ti=j=>{if(j.deltaY>0)return xt();E>=3||(Xn(j),jt())};return k.useEffect(()=>{Pi()},[Pi]),k.useEffect(()=>{M.length&&J()},[J,M]),k.useEffect(()=>(M.forEach((j,Q)=>{!j.classList.contains("lightbox-disabled")&&j.addEventListener("click",()=>Dt(Q))}),()=>{M.forEach((j,Q)=>{j.removeEventListener("click",()=>Dt(Q))})}),[Dt,M]),k.useEffect(()=>(window.addEventListener("resize",Ke),window.addEventListener("fullscreenchange",he),()=>{window.removeEventListener("resize",Ke),window.removeEventListener("fullscreenchange",he)}),[he,Ke]),k.useEffect(()=>{const j=document.querySelector("meta[name=viewport]");if(ct.current||(ct.current=(j==null?void 0:j.getAttribute("content"))||""),!g){V.current=!1,j==null||j.setAttribute("content",ct.current);return}setTimeout(()=>{var Q;V.current=!0,(Q=y.current)==null||Q.focus(),j==null||j.setAttribute("content",`${ct.current} user-scalable=no`)},300)},[g]),b.jsxs(b.Fragment,{children:[b.jsx(t,{ref:v,className:kt,...h,children:s}),b.jsx(aa,{disablePortal:d,children:b.jsxs("div",{className:"lightbox-gallery",onClick:j=>j.target.tagName==="DIV"&&mt(),onKeyUp:ye,ref:p,style:{opacity:g?1:0,pointerEvents:g?"initial":"none",visibility:g?"visible":"hidden"},children:[b.jsx("div",{className:"lightbox-gallery-loader"}),b.jsxs("div",{className:"lightbox-gallery-toolbar",children:[b.jsx("div",{className:"lightbox-gallery-left-tools",children:b.jsx("p",{className:"lightbox-gallery-counter",children:`${_+1} / ${M.length}`})}),b.jsxs("div",{className:"lightbox-gallery-right-tools",children:[b.jsx("button",{className:Ct,onClick:Un}),b.jsx("button",{"aria-label":E>1?"Zoom out":"Zoom in",className:Qt,onClick:()=>E>1?xt():jt()}),b.jsx("button",{className:Rt,onClick:mt})]})]}),b.jsx("div",{className:"lightbox-gallery-content",style:{transform:g?"scale(1)":"scale(0.25)",transition:"all 0.5s ease-out"},children:M.map((j,Q)=>{const{source:It,alt:nt,caption:Tt}=Ci(j),Oe=Q===_?1:0,cs=Q===_?E:0,ai=_===M.length-1&&Q===0&&M.length>1,Kn=_===0&&Q===M.length-1&&M.length>1;let Me;return _Q&&!ai||Kn?Me="-100%":Me="0%",b.jsx("div",{className:"lightbox-gallery-image",style:{position:"absolute",opacity:Oe,left:g?Me:"0%",transform:`scale(${cs})`,transition:_===Q||V.current?"all 0.5s ease-out":"none"},children:b.jsx("img",{src:It||"",alt:nt||"","data-mdb-caption":Tt||"",onMouseDown:Yn,onMouseMove:Mn,onMouseUp:Mi,onWheel:Ti,onTouchStart:Yn,onTouchMove:Mn,onTouchEnd:Mi,onDoubleClick:dn,className:`lightbox-gallery-item ${_===Q&&"active"}`})},Q)})}),b.jsx("div",{className:"lightbox-gallery-arrow-left",children:b.jsx("button",{"aria-label":"Previous",className:it,onClick:()=>q("left")})}),b.jsx("div",{className:"lightbox-gallery-arrow-right",children:b.jsx("button",{"aria-label":"Next",className:it,onClick:()=>q("right"),ref:y})}),b.jsx("div",{className:"lightbox-gallery-caption-wrapper",children:b.jsx("p",{className:"lightbox-gallery-caption",children:T})})]})})]})});$8.displayName="MDBLightbox";const I8=Y.forwardRef(({className:e,fullscreenSrc:t,disabled:n,caption:i,...s},r)=>{const o=I("lightbox-item",n&&"lightbox-disabled",e);return b.jsx("img",{ref:r,"data-mdb-caption":i,"data-mdb-img":t,className:o,...s})});I8.displayName="MDBLightboxItem";const F8=Y.forwardRef(({className:e,...t},n)=>{const[i,s]=k.useState(!1),r=k.useCallback(()=>{const a=document.documentElement.scrollTop;s(!!a)},[]),o=I(i&&"navbar-scrolled","navbar-scroll",e);return k.useEffect(()=>{window.addEventListener("scroll",r)},[r]),b.jsx(pT,{className:o,ref:n,...t})});F8.displayName="MDBAnimatedNavbar";const LT=k.forwardRef(({className:e,closeIcon:t,tag:n="div",color:i,size:s,children:r,onDelete:o,...a},l)=>{const[c,u]=k.useState(!0),d=I("chip",s&&`chip-${s}`,i&&`chip-outline btn-outline-${i}`,e);return c?b.jsxs(n,{ref:l,className:d,...a,children:[r,t&&b.jsx("i",{className:"close fas fa-times",onClick:()=>{o==null||o(r),u(!1)}})]}):null});LT.displayName="MDBChip";const B8=Y.forwardRef(({className:e,value:t="",id:n,labelId:i,labelClass:s,label:r,onChange:o,labelRef:a,labelStyle:l,readonly:c,editable:u,onAdd:d,onDelete:h,initialValues:f=[],...p},m)=>{const v=k.useRef(null),y=a??v,g=k.useRef(null);k.useImperativeHandle(m,()=>g.current);const[x,_]=k.useState(f),[w,S]=k.useState(null),[C,M]=k.useState(0),[P,T]=k.useState(null),[A,E]=k.useState(t),z=x.length>0||A.length>0,N=I("form-outline","chips-input-wrapper",x.length>0&&"chips-padding chips-transition"),R=I("form-control",z&&"active",e),L=I("form-label",s);k.useEffect(()=>{!y.current||y.current.clientWidth===0||M(y.current.clientWidth*.8+8)},[y]);const B=()=>{y.current&&M(y.current.clientWidth*.8+8)},D=O=>{E(O.target.value),o==null||o(O)},$=O=>{A.length||((O.key==="ArrowLeft"||O.key==="ArrowDown")&&T(U=>U?U-1:x.length-1),(O.key==="ArrowRight"||O.key==="ArrowUp")&&T(U=>U===x.length-1||U===null?0:U+1),O.key==="Backspace"&&P!==null&&F(P)),O.key==="Enter"&&A.trim().length&&(d==null||d(A),_([...x,{tag:A}]),E(""))},F=O=>{const U=x.find((lt,ct)=>O===ct);if(U){h==null||h(U==null?void 0:U.tag);const lt=x.filter((ct,kt)=>O!==kt);_(lt),T(null)}},V=(O,U)=>{u&&S(U)},W=(O,U)=>{if(!u)return;const lt=O.currentTarget.textContent,ct=x.map((kt,it)=>it===U&<?{tag:lt}:kt);lt?_(ct):F(U),S(null),T(null)},et=(O,U)=>{O.key==="Enter"&&u&&w!==null&&W(O,U)},Z=()=>{A.trim().length&&(d==null||d(A),_([...x,{tag:A}]),E(""))};return b.jsx("div",{className:"chips chips-placeholder",children:b.jsxs("div",{className:N,children:[x.map((O,U)=>b.jsx(LT,{contentEditable:w===U,suppressContentEditableWarning:!0,onDoubleClick:lt=>V(lt,U),onDelete:()=>F(U),onKeyDown:lt=>et(lt,U),closeIcon:w!==U,className:I("btn",U===P&&"active"),children:O.tag},`${Math.random()}-${U}`)),b.jsx("input",{type:"text",readOnly:c,className:R,onChange:D,onFocus:B,onKeyDown:$,onBlur:()=>Z(),value:A,id:n,ref:g,...p}),r&&b.jsx("label",{className:L,style:l,id:i,htmlFor:n,ref:y,children:r}),b.jsxs("div",{className:"form-notch",children:[b.jsx("div",{className:"form-notch-leading"}),b.jsx("div",{className:"form-notch-middle",style:{width:C}}),b.jsx("div",{className:"form-notch-trailing"})]})]})})});B8.displayName="MDBChipsInput";const V8="Case 3: Θ(nk)";function z8(){const[e,t]=k.useState(""),[n,i]=k.useState(""),[s,r]=k.useState(""),[o,a]=k.useState(null),[l,c]=k.useState(!1),[u,d]=k.useState([]),[h,f]=k.useState(!1),[p,m]=k.useState(null),[v,y]=k.useState(null),g=k.useRef(null);k.useEffect(()=>{if(l&&o&&o.plot_data&&g&&g.current){const M=g.current.getContext("2d");M&&new by(M,{type:"line",data:{labels:o.plot_data.n,datasets:[{label:"n^log_b(a)",data:o.plot_data.n_log_b_a,borderColor:"blue",borderWidth:1,fill:!1},{label:"f(n)",data:o.plot_data.f_n,borderColor:"red",borderWidth:2,fill:!1,borderDash:[5,5]},{label:"Time Complexity",data:o.plot_data.time_complexity,borderColor:"green",borderWidth:2,fill:!1,borderDash:[10,5]}]},options:{scales:{y:{beginAtZero:!0,title:{display:!0,text:"Function Value",color:"#888",font:{size:12}},ticks:{}},x:{grid:{display:!0},ticks:{callback:function(P){return Number(P).toFixed(0)}},title:{display:!0,text:"Input Size (n)",color:"#888",font:{size:12}}}},plugins:{legend:{display:!0,position:"top",labels:{boxWidth:20,padding:10}},tooltip:{enabled:!0}},elements:{line:{borderWidth:1},point:{radius:0}},responsive:!0,maintainAspectRatio:!1}})}},[l,o]),k.useEffect(()=>{(async()=>{try{const P=await fetch("http://master-theorem-aws-test2-dev.us-west-2.elasticbeanstalk.com/api/algorithms");if(!P.ok)throw new Error("Network response was not ok");const T=await P.json();d(T)}catch(P){console.error("Failed to fetch algorithms:",P)}})()},[]);const x=M=>{if(M===-1)f(!1),t(""),i(""),r(""),y(null);else{const P=u.find(T=>T.id===M);P&&(t(P.a.toString()),i(P.b.toString()),r(P.k.toString()),f(!0),y(P))}},_=async M=>{M.preventDefault(),await w(M)},w=async M=>{M.preventDefault(),c(!1),m(v);try{const P=await fetch("http://master-theorem-aws-test2-dev.us-west-2.elasticbeanstalk.com/api/evaluate/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({a:e,b:n,k:s})});if(!P.ok)throw new Error("Network response was not ok");const T=await P.json();a(T),c(!0)}catch(P){console.error("There was a problem with your fetch operation:",P)}},S=M=>{var P;if(Array.isArray(M))console.log("Multiple selections are not supported.");else{const T=parseInt(((P=M.value)==null?void 0:P.toString())||"-1",10);x(T)}},C=[{text:"User Input",value:"-1"},...u.map(M=>({text:M.name,value:M.id.toString()}))];return b.jsxs(b.Fragment,{children:[b.jsxs(od,{alignment:"center",children:[b.jsx(ad,{children:b.jsx("h1",{className:"main-header",children:"Evaluate Master Theorem"})}),b.jsxs(eg,{children:[b.jsx(fT,{children:b.jsx("span",{className:"card-title",children:"Enter the values of a, b, and k to evaluate the Master Theorem:"})}),b.jsxs("form",{onSubmit:_,children:[b.jsx(wi,{label:"a (number of subproblems)",id:"aInput",type:"number",min:"1",className:"my-4",value:e,onChange:M=>t(M.target.value),disabled:h}),b.jsx(wi,{label:"b (factor by which problem size is reduced)",id:"bInput",type:"number",min:"2",className:"my-4",value:n,onChange:M=>i(M.target.value),disabled:h}),b.jsx(wi,{label:"k (exponent in the work outside of recursive calls)",id:"kInput",type:"number",min:"0",className:"my-4",value:s,onChange:M=>r(M.target.value),disabled:h}),b.jsx("div",{className:"my-4",children:b.jsx(D0,{data:C,label:"Choose Algorithm or Enter Values",onChange:S})}),b.jsx(Zt,{onClick:w,className:"btn-block",children:"Evaluate"})]})]})]}),l&&o&&b.jsxs(od,{className:"my-4",children:[b.jsx(ad,{children:b.jsx("h2",{children:"Evaluation"})}),b.jsxs(eg,{className:"evaluation-card-body",children:[b.jsx("canvas",{ref:g,id:"myChart",className:"mb-3"}),b.jsxs(el,{children:[b.jsx("strong",{children:"Recurrence Relation: "}),b.jsx("span",{dangerouslySetInnerHTML:{__html:o.recurrence_relation}})]}),b.jsxs(el,{children:[b.jsx("strong",{children:"Evaluation: "}),b.jsx("span",{dangerouslySetInnerHTML:{__html:o.case}})]}),o.case.includes(V8)&&b.jsxs(el,{children:[b.jsx("strong",{children:"Regularity Condition Met:"})," ",o.regularity_condition_met!==void 0&&(o.regularity_condition_met?"Yes":"No")]}),b.jsxs(el,{children:[b.jsx("strong",{children:"Time Complexity: "}),b.jsx("span",{dangerouslySetInnerHTML:{__html:o.complexity}})]})]}),p&&b.jsxs(b.Fragment,{children:[b.jsxs("h4",{children:[p.name," Algorithm"]}),b.jsxs(ng,{alwaysOpen:!0,initialActive:1,children:[b.jsx(oo,{className:"left-align",collapseId:1,headerTitle:b.jsxs(b.Fragment,{children:[b.jsx(sn,{fas:!0,icon:"question-circle"}),"   Algorithm Description"]}),children:b.jsx("article",{children:p.description})}),b.jsx(oo,{collapseId:2,headerTitle:b.jsxs(b.Fragment,{children:[b.jsx(sn,{fab:!0,icon:"python"}),"   Python Code"]}),children:b.jsx("pre",{className:"left-align",children:b.jsx("code",{children:p.python_code})})})]})]})]}),b.jsxs(od,{alignment:"center",className:"my-4",children:[b.jsx(ad,{children:b.jsx("h2",{children:"About the Master Theorem"})}),b.jsxs(ng,{initialActive:1,children:[b.jsx(oo,{className:"left-align",collapseId:1,headerTitle:"What is the Master Theorem?",children:b.jsxs("article",{children:[b.jsxs("p",{children:["The ",b.jsx("strong",{children:"Master Theorem"})," offers a straightforward way to determine the time complexity of recursive algorithms, especially those that follow the divide and conquer approach. This theorem simplifies the process of analyzing how efficiently an algorithm runs as the size of its input increases. It is particularly useful for computer scientists and software engineers to predict algorithm performance without the need for detailed benchmarks."]}),b.jsx("p",{children:"The following parameters are required to evaluate an algorithm using the Master Theorem:"}),b.jsxs("ul",{children:[b.jsxs("li",{children:[b.jsx("strong",{children:"a"})," = the number of recursive subproblems."]}),b.jsxs("li",{children:[b.jsx("strong",{children:"b"})," = the factor by which the problem size is reduced."]}),b.jsxs("li",{children:[b.jsx("strong",{children:"k"})," = the exponent in the work done outside of the recursive function."]})]})]})}),b.jsx(oo,{className:"left-align",collapseId:2,headerTitle:"Decoding the Master Recurrence",children:b.jsxs("article",{children:[b.jsx("p",{children:"The Master Theorem can only be used to evaluate recursive algorithms with the following recurrence relation:"}),b.jsx("p",{className:"text-center",children:b.jsx("strong",{children:"T(n) = aT(n/b) + f(n)"})}),b.jsxs("p",{children:["This equation is the heart of the Master Theorem. and is called the ",b.jsx("strong",{children:"Master Recurrence"}),". It captures the essence of divide and conquer algorithms:"]}),b.jsxs("ul",{children:[b.jsxs("li",{children:[b.jsx("strong",{children:"T(n)"})," is the total time complexity we aim to find."]}),b.jsxs("li",{children:[b.jsx("strong",{children:"aT(n/b)"})," represents the time taken by the recursive subproblems."]}),b.jsxs("li",{children:[b.jsx("strong",{children:"f(n)"})," is the time taken by the work done outside the recursive calls, such as dividing the problem or combining the results."]})]}),b.jsx("p",{children:"Evaluating the Master Theorem involves comparing the rate of growth of two separate functions:"}),b.jsxs("ul",{children:[b.jsx("p",{className:"text-center",children:b.jsxs("strong",{children:["n",b.jsx("sup",{children:"logb(a)"})," + f(n)"]})}),b.jsxs("li",{children:[b.jsxs("strong",{children:["n",b.jsxs("sup",{children:["log",b.jsx("sub",{children:"b"}),"(a)"]})]})," ","is also known as the ",b.jsx("strong",{children:"watershed function."})]}),b.jsxs("li",{children:[b.jsx("strong",{children:"f(n)"})," is also known as the"," ",b.jsx("strong",{children:"driving function."})]})]}),b.jsx("p",{children:"Comparing the growth rate of these 2 functions results in either of 3 possible cases."})]})}),b.jsx(oo,{className:"left-align",collapseId:3,headerTitle:"The 3 Cases of the Master Theorem",children:b.jsxs("article",{children:[b.jsxs("p",{children:[b.jsx("strong",{children:"Case 1"}),": n",b.jsxs("sup",{children:["log",b.jsx("sub",{children:"b"}),"(a)"]})," ","grows asymptotically and polynomially greater than f(n):"]}),b.jsx("p",{className:"text-center",children:b.jsxs("strong",{children:["T(n) = n",b.jsxs("sup",{children:["log",b.jsx("sub",{children:"b"}),"(a)"]})]})}),b.jsxs("p",{children:[b.jsx("strong",{children:"Case 2:"})," n",b.jsxs("sup",{children:["log",b.jsx("sub",{children:"b"}),"(a)"]})," ","and f(n) grow at the same rate:"]}),b.jsx("p",{className:"text-center",children:b.jsxs("strong",{children:["T(n) = n",b.jsx("sup",{children:"k"})," log(n)"]})}),b.jsxs("p",{children:[b.jsx("strong",{children:"Case 3:"})," f(n) grows assymptotically and polynomially greater than n",b.jsxs("sup",{children:["log",b.jsx("sub",{children:"b"}),"(a)"]})," ","(and must also fulfill the"," ",b.jsxs("strong",{children:["regularity condition",b.jsx("sup",{children:"*"}),")"]})," ",":"]}),b.jsx("p",{className:"text-center",children:b.jsxs("strong",{children:["T(n) = f(n",b.jsx("sup",{children:"k"}),")"]})}),b.jsxs("ul",{children:[b.jsxs("li",{children:[b.jsx("strong",{children:"Case 1"})," occurs when the split subproblems dominate the overall time complexity. It implies that as we break the problem down, the sheer number of subproblems is the primary driver of the complexity."]}),b.jsxs("li",{children:[b.jsx("strong",{children:"Case 2"})," occurs when the work done at each level of recursion is just as significant as the number of subproblems. This balance means the time complexity is a combination of the dividing/conquering work and the depth of the recursion."]}),b.jsxs("li",{children:[b.jsx("strong",{children:"Case 3"})," highlights scenarios where the work done outside the recursive calls (combining solutions, for instance) is the main factor determining the time complexity. This is typically seen in algorithms where merging or processing results is more intensive than breaking down the problem."]})]}),b.jsx("p",{children:b.jsxs("small",{children:[b.jsx("strong",{children:"* "}),"The regularity condition ensures that the work done at the recursive levels does not grow too quickly compared to the work done to divide the problem and combine the results. This condition helps maintain the integrity of the complexity analysis provided by the theorem."]})})]})})]})]})]})}Sp.createRoot(document.getElementById("root")).render(b.jsx(Y.StrictMode,{children:b.jsx(z8,{})})); diff --git a/staticfiles/index.html b/staticfiles/index.html index efeeec2..0ee5fa4 100644 --- a/staticfiles/index.html +++ b/staticfiles/index.html @@ -7,7 +7,7 @@ Evaluate Master Theorem - +