HumanBreak/assets/common-legacy-4eec4c73.js
2023-04-17 14:09:01 +00:00

30 lines
276 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

System.register(["./antdv-legacy-069f5173.js"],(function(t,e){"use strict";var i;return{setters:[t=>{i=t.c}],execute:function(){t({G:function(t,e){if("sin"===t)return f(e,(t=>(Math.cosh(2*t)-1)/(d-1)));if("tan"===t){const t=t=>1*Math.tanh(3*t)/g;return f(e,(e=>1-t(1-e)),t)}if("sec"===t){const t=t=>1/Math.cosh(t);return f(e,(e=>1-2*(t(e*p)-.5)))}throw new TypeError("Unexpected parameters are delivered in hyper timing function.")},H:function(t,e,...i){const n=[t].concat(i);n.push(e);const r=n.length,s=Array(r).fill(0).map(((t,e)=>u(e,r-1)));return t=>{const e=s.map(((e,i)=>e*n[i][0]*(1-t)**(r-i-1)*t**i)),i=s.map(((e,i)=>e*n[i][1]*(1-t)**(r-i-1)*t**i));return[h(...e),h(...i)]}},O:function(){return t=>t},R:async function(t){return new Promise((e=>setTimeout(e,t)))},a:function(t,e){if(!Number.isInteger(t))throw new TypeError("The first parameter of power timing function only allow integer.");return f(e,(e=>e**t))},q:function(...t){const e=[0].concat(t);e.push(1);const i=e.length,n=Array(i).fill(0).map(((t,e)=>u(e,i-1)));return t=>{const r=n.map(((n,r)=>n*e[r]*(1-t)**(i-r-1)*t**r));return h(...r)}}});var e=Object.defineProperty,n=(t,i,n)=>(((t,i,n)=>{i in t?e(t,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[i]=n})(t,"symbol"!=typeof i?i+"":i,n),n);let r=[];const s=t=>{for(const i of r)if("running"===i.status)try{for(const e of i.funcs)e(t-i.startTime)}catch(e){i.destroy(),console.error(e)}requestAnimationFrame(s)};requestAnimationFrame(s);class o{constructor(){n(this,"funcs",[]),n(this,"status","stop"),n(this,"startTime",0),this.status="running",r.push(this),requestAnimationFrame((t=>this.startTime=t))}add(t,e=!1){return e?this.funcs.unshift(t):this.funcs.push(t),this}remove(t){const e=this.funcs.findIndex((e=>e===t));if(-1===e)throw new ReferenceError("You are going to remove nonexistent ticker function.");return this.funcs.splice(e,1),this}clear(){this.funcs=[]}destroy(){this.clear(),this.stop()}stop(){this.status="stop",r=r.filter((t=>t!==this))}}t("I",o);class a{constructor(){n(this,"timing"),n(this,"relation","absolute"),n(this,"easeTime",0),n(this,"applying",{}),n(this,"getTime",Date.now),n(this,"ticker",new o),n(this,"value",{}),n(this,"listener",{}),this.timing=t=>t}async all(){if(Object.values(this.applying).every((t=>!0===t)))throw new ReferenceError("There is no animates to be waited.");await new Promise((t=>{const e=()=>{Object.values(this.applying).every((t=>!1===t))&&(this.unlisten("end",e),t("all animated."))};this.listen("end",e)}))}async n(t){const e=Object.values(this.applying).filter((t=>!0===t)).length;if(e<t)throw new ReferenceError(`You are trying to wait ${t} animate, but there are only ${e} animate animating.`);let i=0;await new Promise((e=>{const n=()=>{i++,i===t&&(this.unlisten("end",n),e(`${t} animated.`))};this.listen("end",n)}))}async w(t){if(!1===this.applying[t])throw new ReferenceError(`The ${t} animate is not animating.`);await new Promise((e=>{const i=()=>{!1===this.applying[t]&&(this.unlisten("end",i),e(`${t} animated.`))};this.listen("end",i)}))}listen(t,e){var i;null!=(i=this.listener)[t]||(i[t]=[]),this.listener[t].push(e)}unlisten(t,e){const i=this.listener[t].findIndex((t=>t===e));if(-1===i)throw new ReferenceError("You are trying to remove a nonexistent listener.");this.listener[t].splice(i,1)}hook(...t){const e=Object.entries(this.listener).filter((e=>t.includes(e[0])));for(const[i,n]of e)for(const t of n)t(this,i)}}function l(t){return null!=t}t("Y",class extends a{constructor(){super(),n(this,"shakeTiming"),n(this,"path"),n(this,"multiTiming"),n(this,"value",{}),n(this,"size",1),n(this,"angle",0),n(this,"targetValue",{system:{move:[0,0],moveAs:[0,0],resize:0,rotate:0,shake:0,"@@bind":[]},custom:{}}),n(this,"animateFn",{system:{move:[()=>0,()=>0],moveAs:()=>0,resize:()=>0,rotate:()=>0,shake:()=>0,"@@bind":()=>0},custom:{}}),n(this,"ox",0),n(this,"oy",0),n(this,"sx",0),n(this,"sy",0),n(this,"bindInfo",[]),this.timing=t=>t,this.shakeTiming=t=>t,this.multiTiming=t=>[t,t],this.path=t=>[t,t],this.applying={move:!1,scale:!1,rotate:!1,shake:!1},this.ticker.add((()=>{const{running:t}=this.listener;if(l(t))for(const e of t)e(this,"running")}))}get x(){return this.ox+this.sx}get y(){return this.oy+this.sy}mode(t,e=!1){return"number"==typeof t(0)?e?this.shakeTiming=t:this.timing=t:this.multiTiming=t,this}time(t){return this.easeTime=t,this}relative(){return this.relation="relative",this}absolute(){return this.relation="absolute",this}bind(...t){return!0===this.applying["@@bind"]&&this.end(!1,"@@bind"),this.bindInfo=t,this}unbind(){return!0===this.applying["@@bind"]&&this.end(!1,"@@bind"),this.bindInfo=[],this}move(t,e){return this.applying.move&&this.end(!0,"move"),this.applySys("ox",t,"move"),this.applySys("oy",e,"move"),this}rotate(t){return this.applySys("angle",t,"rotate"),this}scale(t){return this.applySys("size",t,"resize"),this}shake(t,e){!0===this.applying.shake&&this.end(!0,"shake"),this.applying.shake=!0;const{easeTime:i,shakeTiming:n}=this,r=this.getTime();this.hook("start","shakestart");const s=()=>{const o=this.getTime()-r;o>i&&(this.ticker.remove(s),this.applying.shake=!1,this.sx=0,this.sy=0,this.hook("end","shakeend"));const a=n(o/i);this.sx=a*t,this.sy=a*e};return this.ticker.add(s),this.animateFn.system.shake=s,this}moveAs(t){this.applying.moveAs&&this.end(!0,"moveAs"),this.applying.moveAs=!0,this.path=t;const{easeTime:e,relation:i,timing:n}=this,r=this.getTime(),[s,o]=[this.x,this.y],[a,l]=(()=>{if("absolute"===i)return t(1);{const[e,i]=t(1);return[s+e,o+i]}})();this.hook("start","movestart");const h=()=>{const a=this.getTime()-r;if(a>e)return void this.end(!0,"moveAs");const l=a/e,[h,c]=t(n(l));"absolute"===i?(this.ox=h,this.oy=c):(this.ox=s+h,this.oy=o+c)};return this.ticker.add(h,!0),this.animateFn.system.moveAs=h,this.targetValue.system.moveAs=[a,l],this}register(t,e){if("number"==typeof this.value[t])return this.error(`Property ${t} has been regietered twice.`,"reregister");this.value[t]=e,this.applying[t]=!1}apply(t,e,i=!1){!0===this.applying[t]&&this.end(!1,t),t in this.value||this.error(`You are trying to execute nonexistent property ${t}.`),this.applying[t]=!0;const n=this.value[t],r=this.getTime(),{timing:s,relation:o,easeTime:a}=this,l="absolute"===o?e-n:e;this.hook("start");const h=()=>{const e=this.getTime()-r;if(e>a)return void this.end(!1,t);const i=s(e/a);this.value[t]=n+i*l};return this.ticker.add(h,i),this.animateFn.custom[t]=h,this.targetValue.custom[t]=l+n,this}applyMulti(t=!1){!0===this.applying["@@bind"]&&this.end(!1,"@@bind"),this.applying["@@bind"]=!0;const e=this.bindInfo,i=e.map((t=>this.value[t])),n=this.getTime(),{multiTiming:r,relation:s,easeTime:o}=this,a=r(1);if(a.length!==i.length)throw new TypeError(`The number of binded animate attributes and timing function returns's length does not match. binded: ${e.length}, timing: ${a.length}`);this.hook("start");const l=()=>{const t=this.getTime()-n;if(t>o)return void this.end(!1,"@@bind");const a=r(t/o);e.forEach(((t,e)=>{this.value[t]="absolute"===s?a[e]:i[e]+a[e]}))};return this.ticker.add(l,t),this.animateFn.custom["@@bind"]=l,this.targetValue.system["@@bind"]=a,this}applySys(t,e,i){"move"!==i&&!0===this.applying[i]&&this.end(!0,i),this.applying[i]=!0;const n=this[t],r=this.getTime(),s=this.timing,o=this.relation,a=this.easeTime,l="absolute"===o?e-n:e;this.hook("start",`${i}start`);const h=()=>{const e=this.getTime()-r;if(e>a)return void this.end(!0,i);const o=s(e/a);this[t]=n+l*o,"oy"!==t&&this.hook(i)};this.ticker.add(h,!0),"ox"===t?this.animateFn.system.move[0]=h:"oy"===t?this.animateFn.system.move[1]=h:this.animateFn.system[i]=h,"move"===i?("ox"===t&&(this.targetValue.system.move[0]=l+n),"oy"===t&&(this.targetValue.system.move[1]=l+n)):"shake"!==i&&(this.targetValue.system[i]=l+n)}error(t,e){throw"repeat"===e?new Error(`Cannot execute the same animation twice. Info: ${t}`):"reregister"===e?new Error(`Cannot register a animated property twice. Info: ${t}`):new Error(t)}end(t,e){if(!0===t)if(this.applying[e]=!1,"move"===e?(this.ticker.remove(this.animateFn.system.move[0]),this.ticker.remove(this.animateFn.system.move[1])):"moveAs"===e?this.ticker.remove(this.animateFn.system.moveAs):"@@bind"===e?this.ticker.remove(this.animateFn.system["@@bind"]):this.ticker.remove(this.animateFn.system[e]),"move"===e){const[t,e]=this.targetValue.system.move;this.ox=t,this.oy=e,this.hook("moveend","end")}else if("moveAs"===e){const[t,e]=this.targetValue.system.moveAs;this.ox=t,this.oy=e,this.hook("moveend","end")}else"rotate"===e?(this.angle=this.targetValue.system.rotate,this.hook("rotateend","end")):"resize"===e?(this.size=this.targetValue.system.resize,this.hook("resizeend","end")):"@@bind"===e?this.bindInfo.forEach(((t,e)=>{this.value[t]=this.targetValue.system["@@bind"][e]})):(this.sx=0,this.sy=0,this.hook("shakeend","end"));else this.applying[e]=!1,this.ticker.remove(this.animateFn.custom[e]),this.value[e]=this.targetValue.custom[e],this.hook("end")}}),t("j",class extends a{constructor(){super(),n(this,"now",{}),n(this,"target",{}),n(this,"transitionFn",{}),n(this,"value"),n(this,"handleSet",((t,e,i)=>(this.transition(e,i),!0))),n(this,"handleGet",((t,e)=>this.now[e])),this.timing=t=>t,this.value=new Proxy(this.target,{set:this.handleSet,get:this.handleGet})}mode(t){return this.timing=t,this}time(t){return this.easeTime=t,this}relative(){return this.relation="relative",this}absolute(){return this.relation="absolute",this}transition(t,e){if(e===this.target[t])return this;if(!l(this.now[t]))return this.now[t]=e,this;this.applying[t]&&this.end(t,!0),this.applying[t]=!0,this.hook("start");const i=this.getTime(),n=this.easeTime,r=this.timing,s=this.now[t],o=e+("absolute"===this.relation?0:s),a=o-s;this.target[t]=o;const h=()=>{const e=this.getTime()-i;e>=n&&this.end(t);const o=e/n;this.now[t]=r(o)*a+s,this.hook("running")};return this.transitionFn[t]=h,this.ticker.add(h),this}end(t,e=!1){if(!l(this.transitionFn[t]))throw new ReferenceError(`You are trying to end an ended transition: ${t}`);this.ticker.remove(this.transitionFn[t]),delete this.transitionFn[t],this.applying[t]=!1,this.hook("end"),e||(this.now[t]=this.target[t])}});const h=(...t)=>t.reduce(((t,e)=>t+e),0),c=t=>{if(0===t)return 1;let e=t;for(;t>1;)e*=--t;return e},u=(t,e)=>Math.round(c(e)/(c(t)*c(e-t))),f=(t,e,i=(t=>1-e(1-t)))=>"in"===t?e:"out"===t?i:"in-out"===t?t=>t<.5?e(2*t)/2:.5+i(2*(t-.5))/2:t=>t<.5?i(2*t)/2:.5+e(2*(t-.5))/2,d=Math.cosh(2),p=Math.acosh(2),g=Math.tanh(3);var m=t("l",{}),b={get exports(){return m},set exports(e){t("l",m=e)}};
/*!
* @kurkle/color v0.3.2
* https://github.com/kurkle/color#readme
* (c) 2023 Jukka Kurkela
* Released under the MIT License
*/
function _(t){return t+.5|0}
/**
* @license
* Lodash <https://lodash.com/>
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/
!function(t,e){(function(){var n,r="Expected a function",s="__lodash_hash_undefined__",o="__lodash_placeholder__",a=16,l=32,h=64,c=128,u=256,f=1/0,d=9007199254740991,p=NaN,g=4294967295,m=[["ary",c],["bind",1],["bindKey",2],["curry",8],["curryRight",a],["flip",512],["partial",l],["partialRight",h],["rearg",u]],b="[object Arguments]",_="[object Array]",x="[object Boolean]",v="[object Date]",y="[object Error]",w="[object Function]",k="[object GeneratorFunction]",M="[object Map]",S="[object Number]",P="[object Object]",A="[object Promise]",O="[object RegExp]",D="[object Set]",C="[object String]",T="[object Symbol]",E="[object WeakMap]",L="[object ArrayBuffer]",R="[object DataView]",I="[object Float32Array]",z="[object Float64Array]",F="[object Int8Array]",j="[object Int16Array]",V="[object Int32Array]",B="[object Uint8Array]",W="[object Uint8ClampedArray]",N="[object Uint16Array]",H="[object Uint32Array]",$=/\b__p \+= '';/g,U=/\b(__p \+=) '' \+/g,Y=/(__e\(.*?\)|\b__t\)) \+\n'';/g,q=/&(?:amp|lt|gt|quot|#39);/g,X=/[&<>"']/g,K=RegExp(q.source),Z=RegExp(X.source),G=/<%-([\s\S]+?)%>/g,J=/<%([\s\S]+?)%>/g,Q=/<%=([\s\S]+?)%>/g,tt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,et=/^\w*$/,it=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,nt=/[\\^$.*+?()[\]{}|]/g,rt=RegExp(nt.source),st=/^\s+/,ot=/\s/,at=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,lt=/\{\n\/\* \[wrapped with (.+)\] \*/,ht=/,? & /,ct=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ut=/[()=,{}\[\]\/\s]/,ft=/\\(\\)?/g,dt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pt=/\w*$/,gt=/^[-+]0x[0-9a-f]+$/i,mt=/^0b[01]+$/i,bt=/^\[object .+?Constructor\]$/,_t=/^0o[0-7]+$/i,xt=/^(?:0|[1-9]\d*)$/,vt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,yt=/($^)/,wt=/['\n\r\u2028\u2029\\]/g,kt="\\ud800-\\udfff",Mt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",St="\\u2700-\\u27bf",Pt="a-z\\xdf-\\xf6\\xf8-\\xff",At="A-Z\\xc0-\\xd6\\xd8-\\xde",Ot="\\ufe0e\\ufe0f",Dt="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ct="[']",Tt="["+kt+"]",Et="["+Dt+"]",Lt="["+Mt+"]",Rt="\\d+",It="["+St+"]",zt="["+Pt+"]",Ft="[^"+kt+Dt+Rt+St+Pt+At+"]",jt="\\ud83c[\\udffb-\\udfff]",Vt="[^"+kt+"]",Bt="(?:\\ud83c[\\udde6-\\uddff]){2}",Wt="[\\ud800-\\udbff][\\udc00-\\udfff]",Nt="["+At+"]",Ht="\\u200d",$t="(?:"+zt+"|"+Ft+")",Ut="(?:"+Nt+"|"+Ft+")",Yt="(?:['](?:d|ll|m|re|s|t|ve))?",qt="(?:['](?:D|LL|M|RE|S|T|VE))?",Xt="(?:"+Lt+"|"+jt+")?",Kt="["+Ot+"]?",Zt=Kt+Xt+"(?:"+Ht+"(?:"+[Vt,Bt,Wt].join("|")+")"+Kt+Xt+")*",Gt="(?:"+[It,Bt,Wt].join("|")+")"+Zt,Jt="(?:"+[Vt+Lt+"?",Lt,Bt,Wt,Tt].join("|")+")",Qt=RegExp(Ct,"g"),te=RegExp(Lt,"g"),ee=RegExp(jt+"(?="+jt+")|"+Jt+Zt,"g"),ie=RegExp([Nt+"?"+zt+"+"+Yt+"(?="+[Et,Nt,"$"].join("|")+")",Ut+"+"+qt+"(?="+[Et,Nt+$t,"$"].join("|")+")",Nt+"?"+$t+"+"+Yt,Nt+"+"+qt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Rt,Gt].join("|"),"g"),ne=RegExp("["+Ht+kt+Mt+Ot+"]"),re=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,se=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],oe=-1,ae={};ae[I]=ae[z]=ae[F]=ae[j]=ae[V]=ae[B]=ae[W]=ae[N]=ae[H]=!0,ae[b]=ae[_]=ae[L]=ae[x]=ae[R]=ae[v]=ae[y]=ae[w]=ae[M]=ae[S]=ae[P]=ae[O]=ae[D]=ae[C]=ae[E]=!1;var le={};le[b]=le[_]=le[L]=le[R]=le[x]=le[v]=le[I]=le[z]=le[F]=le[j]=le[V]=le[M]=le[S]=le[P]=le[O]=le[D]=le[C]=le[T]=le[B]=le[W]=le[N]=le[H]=!0,le[y]=le[w]=le[E]=!1;var he={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ce=parseFloat,ue=parseInt,fe="object"==typeof i&&i&&i.Object===Object&&i,de="object"==typeof self&&self&&self.Object===Object&&self,pe=fe||de||Function("return this")(),ge=e&&!e.nodeType&&e,me=ge&&t&&!t.nodeType&&t,be=me&&me.exports===ge,_e=be&&fe.process,xe=function(){try{var t=me&&me.require&&me.require("util").types;return t||_e&&_e.binding&&_e.binding("util")}catch(e){}}(),ve=xe&&xe.isArrayBuffer,ye=xe&&xe.isDate,we=xe&&xe.isMap,ke=xe&&xe.isRegExp,Me=xe&&xe.isSet,Se=xe&&xe.isTypedArray;function Pe(t,e,i){switch(i.length){case 0:return t.call(e);case 1:return t.call(e,i[0]);case 2:return t.call(e,i[0],i[1]);case 3:return t.call(e,i[0],i[1],i[2])}return t.apply(e,i)}function Ae(t,e,i,n){for(var r=-1,s=null==t?0:t.length;++r<s;){var o=t[r];e(n,o,i(o),t)}return n}function Oe(t,e){for(var i=-1,n=null==t?0:t.length;++i<n&&!1!==e(t[i],i,t););return t}function De(t,e){for(var i=null==t?0:t.length;i--&&!1!==e(t[i],i,t););return t}function Ce(t,e){for(var i=-1,n=null==t?0:t.length;++i<n;)if(!e(t[i],i,t))return!1;return!0}function Te(t,e){for(var i=-1,n=null==t?0:t.length,r=0,s=[];++i<n;){var o=t[i];e(o,i,t)&&(s[r++]=o)}return s}function Ee(t,e){return!(null==t||!t.length)&&Ne(t,e,0)>-1}function Le(t,e,i){for(var n=-1,r=null==t?0:t.length;++n<r;)if(i(e,t[n]))return!0;return!1}function Re(t,e){for(var i=-1,n=null==t?0:t.length,r=Array(n);++i<n;)r[i]=e(t[i],i,t);return r}function Ie(t,e){for(var i=-1,n=e.length,r=t.length;++i<n;)t[r+i]=e[i];return t}function ze(t,e,i,n){var r=-1,s=null==t?0:t.length;for(n&&s&&(i=t[++r]);++r<s;)i=e(i,t[r],r,t);return i}function Fe(t,e,i,n){var r=null==t?0:t.length;for(n&&r&&(i=t[--r]);r--;)i=e(i,t[r],r,t);return i}function je(t,e){for(var i=-1,n=null==t?0:t.length;++i<n;)if(e(t[i],i,t))return!0;return!1}var Ve=Ye("length");function Be(t,e,i){var n;return i(t,(function(t,i,r){if(e(t,i,r))return n=i,!1})),n}function We(t,e,i,n){for(var r=t.length,s=i+(n?1:-1);n?s--:++s<r;)if(e(t[s],s,t))return s;return-1}function Ne(t,e,i){return e==e?function(t,e,i){for(var n=i-1,r=t.length;++n<r;)if(t[n]===e)return n;return-1}(t,e,i):We(t,$e,i)}function He(t,e,i,n){for(var r=i-1,s=t.length;++r<s;)if(n(t[r],e))return r;return-1}function $e(t){return t!=t}function Ue(t,e){var i=null==t?0:t.length;return i?Ke(t,e)/i:p}function Ye(t){return function(e){return null==e?n:e[t]}}function qe(t){return function(e){return null==t?n:t[e]}}function Xe(t,e,i,n,r){return r(t,(function(t,r,s){i=n?(n=!1,t):e(i,t,r,s)})),i}function Ke(t,e){for(var i,r=-1,s=t.length;++r<s;){var o=e(t[r]);o!==n&&(i=i===n?o:i+o)}return i}function Ze(t,e){for(var i=-1,n=Array(t);++i<t;)n[i]=e(i);return n}function Ge(t){return t?t.slice(0,pi(t)+1).replace(st,""):t}function Je(t){return function(e){return t(e)}}function Qe(t,e){return Re(e,(function(e){return t[e]}))}function ti(t,e){return t.has(e)}function ei(t,e){for(var i=-1,n=t.length;++i<n&&Ne(e,t[i],0)>-1;);return i}function ii(t,e){for(var i=t.length;i--&&Ne(e,t[i],0)>-1;);return i}var ni=qe({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),ri=qe({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function si(t){return"\\"+he[t]}function oi(t){return ne.test(t)}function ai(t){var e=-1,i=Array(t.size);return t.forEach((function(t,n){i[++e]=[n,t]})),i}function li(t,e){return function(i){return t(e(i))}}function hi(t,e){for(var i=-1,n=t.length,r=0,s=[];++i<n;){var a=t[i];a!==e&&a!==o||(t[i]=o,s[r++]=i)}return s}function ci(t){var e=-1,i=Array(t.size);return t.forEach((function(t){i[++e]=t})),i}function ui(t){var e=-1,i=Array(t.size);return t.forEach((function(t){i[++e]=[t,t]})),i}function fi(t){return oi(t)?function(t){for(var e=ee.lastIndex=0;ee.test(t);)++e;return e}(t):Ve(t)}function di(t){return oi(t)?function(t){return t.match(ee)||[]}(t):function(t){return t.split("")}(t)}function pi(t){for(var e=t.length;e--&&ot.test(t.charAt(e)););return e}var gi=qe({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),mi=function t(e){var i=(e=null==e?pe:mi.defaults(pe.Object(),e,mi.pick(pe,se))).Array,ot=e.Date,kt=e.Error,Mt=e.Function,St=e.Math,Pt=e.Object,At=e.RegExp,Ot=e.String,Dt=e.TypeError,Ct=i.prototype,Tt=Mt.prototype,Et=Pt.prototype,Lt=e["__core-js_shared__"],Rt=Tt.toString,It=Et.hasOwnProperty,zt=0,Ft=function(){var t=/[^.]+$/.exec(Lt&&Lt.keys&&Lt.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),jt=Et.toString,Vt=Rt.call(Pt),Bt=pe._,Wt=At("^"+Rt.call(It).replace(nt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Nt=be?e.Buffer:n,Ht=e.Symbol,$t=e.Uint8Array,Ut=Nt?Nt.allocUnsafe:n,Yt=li(Pt.getPrototypeOf,Pt),qt=Pt.create,Xt=Et.propertyIsEnumerable,Kt=Ct.splice,Zt=Ht?Ht.isConcatSpreadable:n,Gt=Ht?Ht.iterator:n,Jt=Ht?Ht.toStringTag:n,ee=function(){try{var t=us(Pt,"defineProperty");return t({},"",{}),t}catch(e){}}(),ne=e.clearTimeout!==pe.clearTimeout&&e.clearTimeout,he=ot&&ot.now!==pe.Date.now&&ot.now,fe=e.setTimeout!==pe.setTimeout&&e.setTimeout,de=St.ceil,ge=St.floor,me=Pt.getOwnPropertySymbols,_e=Nt?Nt.isBuffer:n,xe=e.isFinite,Ve=Ct.join,qe=li(Pt.keys,Pt),bi=St.max,_i=St.min,xi=ot.now,vi=e.parseInt,yi=St.random,wi=Ct.reverse,ki=us(e,"DataView"),Mi=us(e,"Map"),Si=us(e,"Promise"),Pi=us(e,"Set"),Ai=us(e,"WeakMap"),Oi=us(Pt,"create"),Di=Ai&&new Ai,Ci={},Ti=Fs(ki),Ei=Fs(Mi),Li=Fs(Si),Ri=Fs(Pi),Ii=Fs(Ai),zi=Ht?Ht.prototype:n,Fi=zi?zi.valueOf:n,ji=zi?zi.toString:n;function Vi(t){if(ea(t)&&!$o(t)&&!(t instanceof Hi)){if(t instanceof Ni)return t;if(It.call(t,"__wrapped__"))return js(t)}return new Ni(t)}var Bi=function(){function t(){}return function(e){if(!ta(e))return{};if(qt)return qt(e);t.prototype=e;var i=new t;return t.prototype=n,i}}();function Wi(){}function Ni(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=n}function Hi(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=g,this.__views__=[]}function $i(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}function Ui(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}function Yi(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}function qi(t){var e=-1,i=null==t?0:t.length;for(this.__data__=new Yi;++e<i;)this.add(t[e])}function Xi(t){var e=this.__data__=new Ui(t);this.size=e.size}function Ki(t,e){var i=$o(t),n=!i&&Ho(t),r=!i&&!n&&Xo(t),s=!i&&!n&&!r&&ha(t),o=i||n||r||s,a=o?Ze(t.length,Ot):[],l=a.length;for(var h in t)!e&&!It.call(t,h)||o&&("length"==h||r&&("offset"==h||"parent"==h)||s&&("buffer"==h||"byteLength"==h||"byteOffset"==h)||_s(h,l))||a.push(h);return a}function Zi(t){var e=t.length;return e?t[Xn(0,e-1)]:n}function Gi(t,e){return Rs(Dr(t),an(e,0,t.length))}function Ji(t){return Rs(Dr(t))}function Qi(t,e,i){(i!==n&&!Bo(t[e],i)||i===n&&!(e in t))&&sn(t,e,i)}function tn(t,e,i){var r=t[e];It.call(t,e)&&Bo(r,i)&&(i!==n||e in t)||sn(t,e,i)}function en(t,e){for(var i=t.length;i--;)if(Bo(t[i][0],e))return i;return-1}function nn(t,e,i,n){return fn(t,(function(t,r,s){e(n,t,i(t),s)})),n}function rn(t,e){return t&&Cr(e,Ta(e),t)}function sn(t,e,i){"__proto__"==e&&ee?ee(t,e,{configurable:!0,enumerable:!0,value:i,writable:!0}):t[e]=i}function on(t,e){for(var r=-1,s=e.length,o=i(s),a=null==t;++r<s;)o[r]=a?n:Pa(t,e[r]);return o}function an(t,e,i){return t==t&&(i!==n&&(t=t<=i?t:i),e!==n&&(t=t>=e?t:e)),t}function ln(t,e,i,r,s,o){var a,l=1&e,h=2&e,c=4&e;if(i&&(a=s?i(t,r,s,o):i(t)),a!==n)return a;if(!ta(t))return t;var u=$o(t);if(u){if(a=function(t){var e=t.length,i=new t.constructor(e);return e&&"string"==typeof t[0]&&It.call(t,"index")&&(i.index=t.index,i.input=t.input),i}(t),!l)return Dr(t,a)}else{var f=ps(t),d=f==w||f==k;if(Xo(t))return kr(t,l);if(f==P||f==b||d&&!s){if(a=h||d?{}:ms(t),!l)return h?function(t,e){return Cr(t,ds(t),e)}(t,function(t,e){return t&&Cr(e,Ea(e),t)}(a,t)):function(t,e){return Cr(t,fs(t),e)}(t,rn(a,t))}else{if(!le[f])return s?t:{};a=function(t,e,i){var n,r=t.constructor;switch(e){case L:return Mr(t);case x:case v:return new r(+t);case R:return function(t,e){var i=e?Mr(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.byteLength)}(t,i);case I:case z:case F:case j:case V:case B:case W:case N:case H:return Sr(t,i);case M:return new r;case S:case C:return new r(t);case O:return function(t){var e=new t.constructor(t.source,pt.exec(t));return e.lastIndex=t.lastIndex,e}(t);case D:return new r;case T:return n=t,Fi?Pt(Fi.call(n)):{}}}(t,f,l)}}o||(o=new Xi);var p=o.get(t);if(p)return p;o.set(t,a),oa(t)?t.forEach((function(n){a.add(ln(n,e,i,n,t,o))})):ia(t)&&t.forEach((function(n,r){a.set(r,ln(n,e,i,r,t,o))}));var g=u?n:(c?h?rs:ns:h?Ea:Ta)(t);return Oe(g||t,(function(n,r){g&&(n=t[r=n]),tn(a,r,ln(n,e,i,r,t,o))})),a}function hn(t,e,i){var r=i.length;if(null==t)return!r;for(t=Pt(t);r--;){var s=i[r],o=e[s],a=t[s];if(a===n&&!(s in t)||!o(a))return!1}return!0}function cn(t,e,i){if("function"!=typeof t)throw new Dt(r);return Cs((function(){t.apply(n,i)}),e)}function un(t,e,i,n){var r=-1,s=Ee,o=!0,a=t.length,l=[],h=e.length;if(!a)return l;i&&(e=Re(e,Je(i))),n?(s=Le,o=!1):e.length>=200&&(s=ti,o=!1,e=new qi(e));t:for(;++r<a;){var c=t[r],u=null==i?c:i(c);if(c=n||0!==c?c:0,o&&u==u){for(var f=h;f--;)if(e[f]===u)continue t;l.push(c)}else s(e,u,n)||l.push(c)}return l}Vi.templateSettings={escape:G,evaluate:J,interpolate:Q,variable:"",imports:{_:Vi}},Vi.prototype=Wi.prototype,Vi.prototype.constructor=Vi,Ni.prototype=Bi(Wi.prototype),Ni.prototype.constructor=Ni,Hi.prototype=Bi(Wi.prototype),Hi.prototype.constructor=Hi,$i.prototype.clear=function(){this.__data__=Oi?Oi(null):{},this.size=0},$i.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},$i.prototype.get=function(t){var e=this.__data__;if(Oi){var i=e[t];return i===s?n:i}return It.call(e,t)?e[t]:n},$i.prototype.has=function(t){var e=this.__data__;return Oi?e[t]!==n:It.call(e,t)},$i.prototype.set=function(t,e){var i=this.__data__;return this.size+=this.has(t)?0:1,i[t]=Oi&&e===n?s:e,this},Ui.prototype.clear=function(){this.__data__=[],this.size=0},Ui.prototype.delete=function(t){var e=this.__data__,i=en(e,t);return!(i<0||(i==e.length-1?e.pop():Kt.call(e,i,1),--this.size,0))},Ui.prototype.get=function(t){var e=this.__data__,i=en(e,t);return i<0?n:e[i][1]},Ui.prototype.has=function(t){return en(this.__data__,t)>-1},Ui.prototype.set=function(t,e){var i=this.__data__,n=en(i,t);return n<0?(++this.size,i.push([t,e])):i[n][1]=e,this},Yi.prototype.clear=function(){this.size=0,this.__data__={hash:new $i,map:new(Mi||Ui),string:new $i}},Yi.prototype.delete=function(t){var e=hs(this,t).delete(t);return this.size-=e?1:0,e},Yi.prototype.get=function(t){return hs(this,t).get(t)},Yi.prototype.has=function(t){return hs(this,t).has(t)},Yi.prototype.set=function(t,e){var i=hs(this,t),n=i.size;return i.set(t,e),this.size+=i.size==n?0:1,this},qi.prototype.add=qi.prototype.push=function(t){return this.__data__.set(t,s),this},qi.prototype.has=function(t){return this.__data__.has(t)},Xi.prototype.clear=function(){this.__data__=new Ui,this.size=0},Xi.prototype.delete=function(t){var e=this.__data__,i=e.delete(t);return this.size=e.size,i},Xi.prototype.get=function(t){return this.__data__.get(t)},Xi.prototype.has=function(t){return this.__data__.has(t)},Xi.prototype.set=function(t,e){var i=this.__data__;if(i instanceof Ui){var n=i.__data__;if(!Mi||n.length<199)return n.push([t,e]),this.size=++i.size,this;i=this.__data__=new Yi(n)}return i.set(t,e),this.size=i.size,this};var fn=Lr(vn),dn=Lr(yn,!0);function pn(t,e){var i=!0;return fn(t,(function(t,n,r){return i=!!e(t,n,r)})),i}function gn(t,e,i){for(var r=-1,s=t.length;++r<s;){var o=t[r],a=e(o);if(null!=a&&(l===n?a==a&&!la(a):i(a,l)))var l=a,h=o}return h}function mn(t,e){var i=[];return fn(t,(function(t,n,r){e(t,n,r)&&i.push(t)})),i}function bn(t,e,i,n,r){var s=-1,o=t.length;for(i||(i=bs),r||(r=[]);++s<o;){var a=t[s];e>0&&i(a)?e>1?bn(a,e-1,i,n,r):Ie(r,a):n||(r[r.length]=a)}return r}var _n=Rr(),xn=Rr(!0);function vn(t,e){return t&&_n(t,e,Ta)}function yn(t,e){return t&&xn(t,e,Ta)}function wn(t,e){return Te(e,(function(e){return Go(t[e])}))}function kn(t,e){for(var i=0,r=(e=xr(e,t)).length;null!=t&&i<r;)t=t[zs(e[i++])];return i&&i==r?t:n}function Mn(t,e,i){var n=e(t);return $o(t)?n:Ie(n,i(t))}function Sn(t){return null==t?t===n?"[object Undefined]":"[object Null]":Jt&&Jt in Pt(t)?function(t){var e=It.call(t,Jt),i=t[Jt];try{t[Jt]=n;var r=!0}catch(o){}var s=jt.call(t);return r&&(e?t[Jt]=i:delete t[Jt]),s}(t):function(t){return jt.call(t)}(t)}function Pn(t,e){return t>e}function An(t,e){return null!=t&&It.call(t,e)}function On(t,e){return null!=t&&e in Pt(t)}function Dn(t,e,r){for(var s=r?Le:Ee,o=t[0].length,a=t.length,l=a,h=i(a),c=1/0,u=[];l--;){var f=t[l];l&&e&&(f=Re(f,Je(e))),c=_i(f.length,c),h[l]=!r&&(e||o>=120&&f.length>=120)?new qi(l&&f):n}f=t[0];var d=-1,p=h[0];t:for(;++d<o&&u.length<c;){var g=f[d],m=e?e(g):g;if(g=r||0!==g?g:0,!(p?ti(p,m):s(u,m,r))){for(l=a;--l;){var b=h[l];if(!(b?ti(b,m):s(t[l],m,r)))continue t}p&&p.push(m),u.push(g)}}return u}function Cn(t,e,i){var r=null==(t=As(t,e=xr(e,t)))?t:t[zs(Ks(e))];return null==r?n:Pe(r,t,i)}function Tn(t){return ea(t)&&Sn(t)==b}function En(t,e,i,r,s){return t===e||(null==t||null==e||!ea(t)&&!ea(e)?t!=t&&e!=e:function(t,e,i,r,s,o){var a=$o(t),l=$o(e),h=a?_:ps(t),c=l?_:ps(e),u=(h=h==b?P:h)==P,f=(c=c==b?P:c)==P,d=h==c;if(d&&Xo(t)){if(!Xo(e))return!1;a=!0,u=!1}if(d&&!u)return o||(o=new Xi),a||ha(t)?es(t,e,i,r,s,o):function(t,e,i,n,r,s,o){switch(i){case R:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case L:return!(t.byteLength!=e.byteLength||!s(new $t(t),new $t(e)));case x:case v:case S:return Bo(+t,+e);case y:return t.name==e.name&&t.message==e.message;case O:case C:return t==e+"";case M:var a=ai;case D:var l=1&n;if(a||(a=ci),t.size!=e.size&&!l)return!1;var h=o.get(t);if(h)return h==e;n|=2,o.set(t,e);var c=es(a(t),a(e),n,r,s,o);return o.delete(t),c;case T:if(Fi)return Fi.call(t)==Fi.call(e)}return!1}(t,e,h,i,r,s,o);if(!(1&i)){var p=u&&It.call(t,"__wrapped__"),g=f&&It.call(e,"__wrapped__");if(p||g){var m=p?t.value():t,w=g?e.value():e;return o||(o=new Xi),s(m,w,i,r,o)}}return!!d&&(o||(o=new Xi),function(t,e,i,r,s,o){var a=1&i,l=ns(t),h=l.length,c=ns(e),u=c.length;if(h!=u&&!a)return!1;for(var f=h;f--;){var d=l[f];if(!(a?d in e:It.call(e,d)))return!1}var p=o.get(t),g=o.get(e);if(p&&g)return p==e&&g==t;var m=!0;o.set(t,e),o.set(e,t);for(var b=a;++f<h;){var _=t[d=l[f]],x=e[d];if(r)var v=a?r(x,_,d,e,t,o):r(_,x,d,t,e,o);if(!(v===n?_===x||s(_,x,i,r,o):v)){m=!1;break}b||(b="constructor"==d)}if(m&&!b){var y=t.constructor,w=e.constructor;y==w||!("constructor"in t)||!("constructor"in e)||"function"==typeof y&&y instanceof y&&"function"==typeof w&&w instanceof w||(m=!1)}return o.delete(t),o.delete(e),m}(t,e,i,r,s,o))}(t,e,i,r,En,s))}function Ln(t,e,i,r){var s=i.length,o=s,a=!r;if(null==t)return!o;for(t=Pt(t);s--;){var l=i[s];if(a&&l[2]?l[1]!==t[l[0]]:!(l[0]in t))return!1}for(;++s<o;){var h=(l=i[s])[0],c=t[h],u=l[1];if(a&&l[2]){if(c===n&&!(h in t))return!1}else{var f=new Xi;if(r)var d=r(c,u,h,t,e,f);if(!(d===n?En(u,c,3,r,f):d))return!1}}return!0}function Rn(t){return!(!ta(t)||(e=t,Ft&&Ft in e))&&(Go(t)?Wt:bt).test(Fs(t));var e}function In(t){return"function"==typeof t?t:null==t?nl:"object"==typeof t?$o(t)?Wn(t[0],t[1]):Bn(t):fl(t)}function zn(t){if(!ks(t))return qe(t);var e=[];for(var i in Pt(t))It.call(t,i)&&"constructor"!=i&&e.push(i);return e}function Fn(t){if(!ta(t))return function(t){var e=[];if(null!=t)for(var i in Pt(t))e.push(i);return e}(t);var e=ks(t),i=[];for(var n in t)("constructor"!=n||!e&&It.call(t,n))&&i.push(n);return i}function jn(t,e){return t<e}function Vn(t,e){var n=-1,r=Yo(t)?i(t.length):[];return fn(t,(function(t,i,s){r[++n]=e(t,i,s)})),r}function Bn(t){var e=cs(t);return 1==e.length&&e[0][2]?Ss(e[0][0],e[0][1]):function(i){return i===t||Ln(i,t,e)}}function Wn(t,e){return vs(t)&&Ms(e)?Ss(zs(t),e):function(i){var r=Pa(i,t);return r===n&&r===e?Aa(i,t):En(e,r,3)}}function Nn(t,e,i,r,s){t!==e&&_n(e,(function(o,a){if(s||(s=new Xi),ta(o))!function(t,e,i,r,s,o,a){var l=Os(t,i),h=Os(e,i),c=a.get(h);if(c)Qi(t,i,c);else{var u=o?o(l,h,i+"",t,e,a):n,f=u===n;if(f){var d=$o(h),p=!d&&Xo(h),g=!d&&!p&&ha(h);u=h,d||p||g?$o(l)?u=l:qo(l)?u=Dr(l):p?(f=!1,u=kr(h,!0)):g?(f=!1,u=Sr(h,!0)):u=[]:ra(h)||Ho(h)?(u=l,Ho(l)?u=ba(l):ta(l)&&!Go(l)||(u=ms(h))):f=!1}f&&(a.set(h,u),s(u,h,r,o,a),a.delete(h)),Qi(t,i,u)}}(t,e,a,i,Nn,r,s);else{var l=r?r(Os(t,a),o,a+"",t,e,s):n;l===n&&(l=o),Qi(t,a,l)}}),Ea)}function Hn(t,e){var i=t.length;if(i)return _s(e+=e<0?i:0,i)?t[e]:n}function $n(t,e,i){e=e.length?Re(e,(function(t){return $o(t)?function(e){return kn(e,1===t.length?t[0]:t)}:t})):[nl];var n=-1;e=Re(e,Je(ls()));var r=Vn(t,(function(t,i,r){var s=Re(e,(function(e){return e(t)}));return{criteria:s,index:++n,value:t}}));return function(t,e){var i=t.length;for(t.sort(e);i--;)t[i]=t[i].value;return t}(r,(function(t,e){return function(t,e,i){for(var n=-1,r=t.criteria,s=e.criteria,o=r.length,a=i.length;++n<o;){var l=Pr(r[n],s[n]);if(l)return n>=a?l:l*("desc"==i[n]?-1:1)}return t.index-e.index}(t,e,i)}))}function Un(t,e,i){for(var n=-1,r=e.length,s={};++n<r;){var o=e[n],a=kn(t,o);i(a,o)&&Qn(s,xr(o,t),a)}return s}function Yn(t,e,i,n){var r=n?He:Ne,s=-1,o=e.length,a=t;for(t===e&&(e=Dr(e)),i&&(a=Re(t,Je(i)));++s<o;)for(var l=0,h=e[s],c=i?i(h):h;(l=r(a,c,l,n))>-1;)a!==t&&Kt.call(a,l,1),Kt.call(t,l,1);return t}function qn(t,e){for(var i=t?e.length:0,n=i-1;i--;){var r=e[i];if(i==n||r!==s){var s=r;_s(r)?Kt.call(t,r,1):ur(t,r)}}return t}function Xn(t,e){return t+ge(yi()*(e-t+1))}function Kn(t,e){var i="";if(!t||e<1||e>d)return i;do{e%2&&(i+=t),(e=ge(e/2))&&(t+=t)}while(e);return i}function Zn(t,e){return Ts(Ps(t,e,nl),t+"")}function Gn(t){return Zi(Ba(t))}function Jn(t,e){var i=Ba(t);return Rs(i,an(e,0,i.length))}function Qn(t,e,i,r){if(!ta(t))return t;for(var s=-1,o=(e=xr(e,t)).length,a=o-1,l=t;null!=l&&++s<o;){var h=zs(e[s]),c=i;if("__proto__"===h||"constructor"===h||"prototype"===h)return t;if(s!=a){var u=l[h];(c=r?r(u,h,l):n)===n&&(c=ta(u)?u:_s(e[s+1])?[]:{})}tn(l,h,c),l=l[h]}return t}var tr=Di?function(t,e){return Di.set(t,e),t}:nl,er=ee?function(t,e){return ee(t,"toString",{configurable:!0,enumerable:!1,value:tl(e),writable:!0})}:nl;function ir(t){return Rs(Ba(t))}function nr(t,e,n){var r=-1,s=t.length;e<0&&(e=-e>s?0:s+e),(n=n>s?s:n)<0&&(n+=s),s=e>n?0:n-e>>>0,e>>>=0;for(var o=i(s);++r<s;)o[r]=t[r+e];return o}function rr(t,e){var i;return fn(t,(function(t,n,r){return!(i=e(t,n,r))})),!!i}function sr(t,e,i){var n=0,r=null==t?n:t.length;if("number"==typeof e&&e==e&&r<=2147483647){for(;n<r;){var s=n+r>>>1,o=t[s];null!==o&&!la(o)&&(i?o<=e:o<e)?n=s+1:r=s}return r}return or(t,e,nl,i)}function or(t,e,i,r){var s=0,o=null==t?0:t.length;if(0===o)return 0;for(var a=(e=i(e))!=e,l=null===e,h=la(e),c=e===n;s<o;){var u=ge((s+o)/2),f=i(t[u]),d=f!==n,p=null===f,g=f==f,m=la(f);if(a)var b=r||g;else b=c?g&&(r||d):l?g&&d&&(r||!p):h?g&&d&&!p&&(r||!m):!p&&!m&&(r?f<=e:f<e);b?s=u+1:o=u}return _i(o,4294967294)}function ar(t,e){for(var i=-1,n=t.length,r=0,s=[];++i<n;){var o=t[i],a=e?e(o):o;if(!i||!Bo(a,l)){var l=a;s[r++]=0===o?0:o}}return s}function lr(t){return"number"==typeof t?t:la(t)?p:+t}function hr(t){if("string"==typeof t)return t;if($o(t))return Re(t,hr)+"";if(la(t))return ji?ji.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function cr(t,e,i){var n=-1,r=Ee,s=t.length,o=!0,a=[],l=a;if(i)o=!1,r=Le;else if(s>=200){var h=e?null:Kr(t);if(h)return ci(h);o=!1,r=ti,l=new qi}else l=e?[]:a;t:for(;++n<s;){var c=t[n],u=e?e(c):c;if(c=i||0!==c?c:0,o&&u==u){for(var f=l.length;f--;)if(l[f]===u)continue t;e&&l.push(u),a.push(c)}else r(l,u,i)||(l!==a&&l.push(u),a.push(c))}return a}function ur(t,e){return null==(t=As(t,e=xr(e,t)))||delete t[zs(Ks(e))]}function fr(t,e,i,n){return Qn(t,e,i(kn(t,e)),n)}function dr(t,e,i,n){for(var r=t.length,s=n?r:-1;(n?s--:++s<r)&&e(t[s],s,t););return i?nr(t,n?0:s,n?s+1:r):nr(t,n?s+1:0,n?r:s)}function pr(t,e){var i=t;return i instanceof Hi&&(i=i.value()),ze(e,(function(t,e){return e.func.apply(e.thisArg,Ie([t],e.args))}),i)}function gr(t,e,n){var r=t.length;if(r<2)return r?cr(t[0]):[];for(var s=-1,o=i(r);++s<r;)for(var a=t[s],l=-1;++l<r;)l!=s&&(o[s]=un(o[s]||a,t[l],e,n));return cr(bn(o,1),e,n)}function mr(t,e,i){for(var r=-1,s=t.length,o=e.length,a={};++r<s;){var l=r<o?e[r]:n;i(a,t[r],l)}return a}function br(t){return qo(t)?t:[]}function _r(t){return"function"==typeof t?t:nl}function xr(t,e){return $o(t)?t:vs(t,e)?[t]:Is(_a(t))}var vr=Zn;function yr(t,e,i){var r=t.length;return i=i===n?r:i,!e&&i>=r?t:nr(t,e,i)}var wr=ne||function(t){return pe.clearTimeout(t)};function kr(t,e){if(e)return t.slice();var i=t.length,n=Ut?Ut(i):new t.constructor(i);return t.copy(n),n}function Mr(t){var e=new t.constructor(t.byteLength);return new $t(e).set(new $t(t)),e}function Sr(t,e){var i=e?Mr(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.length)}function Pr(t,e){if(t!==e){var i=t!==n,r=null===t,s=t==t,o=la(t),a=e!==n,l=null===e,h=e==e,c=la(e);if(!l&&!c&&!o&&t>e||o&&a&&h&&!l&&!c||r&&a&&h||!i&&h||!s)return 1;if(!r&&!o&&!c&&t<e||c&&i&&s&&!r&&!o||l&&i&&s||!a&&s||!h)return-1}return 0}function Ar(t,e,n,r){for(var s=-1,o=t.length,a=n.length,l=-1,h=e.length,c=bi(o-a,0),u=i(h+c),f=!r;++l<h;)u[l]=e[l];for(;++s<a;)(f||s<o)&&(u[n[s]]=t[s]);for(;c--;)u[l++]=t[s++];return u}function Or(t,e,n,r){for(var s=-1,o=t.length,a=-1,l=n.length,h=-1,c=e.length,u=bi(o-l,0),f=i(u+c),d=!r;++s<u;)f[s]=t[s];for(var p=s;++h<c;)f[p+h]=e[h];for(;++a<l;)(d||s<o)&&(f[p+n[a]]=t[s++]);return f}function Dr(t,e){var n=-1,r=t.length;for(e||(e=i(r));++n<r;)e[n]=t[n];return e}function Cr(t,e,i,r){var s=!i;i||(i={});for(var o=-1,a=e.length;++o<a;){var l=e[o],h=r?r(i[l],t[l],l,i,t):n;h===n&&(h=t[l]),s?sn(i,l,h):tn(i,l,h)}return i}function Tr(t,e){return function(i,n){var r=$o(i)?Ae:nn,s=e?e():{};return r(i,t,ls(n,2),s)}}function Er(t){return Zn((function(e,i){var r=-1,s=i.length,o=s>1?i[s-1]:n,a=s>2?i[2]:n;for(o=t.length>3&&"function"==typeof o?(s--,o):n,a&&xs(i[0],i[1],a)&&(o=s<3?n:o,s=1),e=Pt(e);++r<s;){var l=i[r];l&&t(e,l,r,o)}return e}))}function Lr(t,e){return function(i,n){if(null==i)return i;if(!Yo(i))return t(i,n);for(var r=i.length,s=e?r:-1,o=Pt(i);(e?s--:++s<r)&&!1!==n(o[s],s,o););return i}}function Rr(t){return function(e,i,n){for(var r=-1,s=Pt(e),o=n(e),a=o.length;a--;){var l=o[t?a:++r];if(!1===i(s[l],l,s))break}return e}}function Ir(t){return function(e){var i=oi(e=_a(e))?di(e):n,r=i?i[0]:e.charAt(0),s=i?yr(i,1).join(""):e.slice(1);return r[t]()+s}}function zr(t){return function(e){return ze(Ga(Ha(e).replace(Qt,"")),t,"")}}function Fr(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var i=Bi(t.prototype),n=t.apply(i,e);return ta(n)?n:i}}function jr(t){return function(e,i,r){var s=Pt(e);if(!Yo(e)){var o=ls(i,3);e=Ta(e),i=function(t){return o(s[t],t,s)}}var a=t(e,i,r);return a>-1?s[o?e[a]:a]:n}}function Vr(t){return is((function(e){var i=e.length,s=i,o=Ni.prototype.thru;for(t&&e.reverse();s--;){var a=e[s];if("function"!=typeof a)throw new Dt(r);if(o&&!l&&"wrapper"==os(a))var l=new Ni([],!0)}for(s=l?s:i;++s<i;){var h=os(a=e[s]),c="wrapper"==h?ss(a):n;l=c&&ys(c[0])&&424==c[1]&&!c[4].length&&1==c[9]?l[os(c[0])].apply(l,c[3]):1==a.length&&ys(a)?l[h]():l.thru(a)}return function(){var t=arguments,n=t[0];if(l&&1==t.length&&$o(n))return l.plant(n).value();for(var r=0,s=i?e[r].apply(this,t):n;++r<i;)s=e[r].call(this,s);return s}}))}function Br(t,e,r,s,o,a,l,h,u,f){var d=e&c,p=1&e,g=2&e,m=24&e,b=512&e,_=g?n:Fr(t);return function c(){for(var x=arguments.length,v=i(x),y=x;y--;)v[y]=arguments[y];if(m)var w=as(c),k=function(t,e){for(var i=t.length,n=0;i--;)t[i]===e&&++n;return n}(v,w);if(s&&(v=Ar(v,s,o,m)),a&&(v=Or(v,a,l,m)),x-=k,m&&x<f){var M=hi(v,w);return qr(t,e,Br,c.placeholder,r,v,M,h,u,f-x)}var S=p?r:this,P=g?S[t]:t;return x=v.length,h?v=function(t,e){for(var i=t.length,r=_i(e.length,i),s=Dr(t);r--;){var o=e[r];t[r]=_s(o,i)?s[o]:n}return t}(v,h):b&&x>1&&v.reverse(),d&&u<x&&(v.length=u),this&&this!==pe&&this instanceof c&&(P=_||Fr(P)),P.apply(S,v)}}function Wr(t,e){return function(i,n){return function(t,e,i,n){return vn(t,(function(t,r,s){e(n,i(t),r,s)})),n}(i,t,e(n),{})}}function Nr(t,e){return function(i,r){var s;if(i===n&&r===n)return e;if(i!==n&&(s=i),r!==n){if(s===n)return r;"string"==typeof i||"string"==typeof r?(i=hr(i),r=hr(r)):(i=lr(i),r=lr(r)),s=t(i,r)}return s}}function Hr(t){return is((function(e){return e=Re(e,Je(ls())),Zn((function(i){var n=this;return t(e,(function(t){return Pe(t,n,i)}))}))}))}function $r(t,e){var i=(e=e===n?" ":hr(e)).length;if(i<2)return i?Kn(e,t):e;var r=Kn(e,de(t/fi(e)));return oi(e)?yr(di(r),0,t).join(""):r.slice(0,t)}function Ur(t){return function(e,r,s){return s&&"number"!=typeof s&&xs(e,r,s)&&(r=s=n),e=da(e),r===n?(r=e,e=0):r=da(r),function(t,e,n,r){for(var s=-1,o=bi(de((e-t)/(n||1)),0),a=i(o);o--;)a[r?o:++s]=t,t+=n;return a}(e,r,s=s===n?e<r?1:-1:da(s),t)}}function Yr(t){return function(e,i){return"string"==typeof e&&"string"==typeof i||(e=ma(e),i=ma(i)),t(e,i)}}function qr(t,e,i,r,s,o,a,c,u,f){var d=8&e;e|=d?l:h,4&(e&=~(d?h:l))||(e&=-4);var p=[t,e,s,d?o:n,d?a:n,d?n:o,d?n:a,c,u,f],g=i.apply(n,p);return ys(t)&&Ds(g,p),g.placeholder=r,Es(g,t,e)}function Xr(t){var e=St[t];return function(t,i){if(t=ma(t),(i=null==i?0:_i(pa(i),292))&&xe(t)){var n=(_a(t)+"e").split("e");return+((n=(_a(e(n[0]+"e"+(+n[1]+i)))+"e").split("e"))[0]+"e"+(+n[1]-i))}return e(t)}}var Kr=Pi&&1/ci(new Pi([,-0]))[1]==f?function(t){return new Pi(t)}:ll;function Zr(t){return function(e){var i=ps(e);return i==M?ai(e):i==D?ui(e):function(t,e){return Re(e,(function(e){return[e,t[e]]}))}(e,t(e))}}function Gr(t,e,s,f,d,p,g,m){var b=2&e;if(!b&&"function"!=typeof t)throw new Dt(r);var _=f?f.length:0;if(_||(e&=-97,f=d=n),g=g===n?g:bi(pa(g),0),m=m===n?m:pa(m),_-=d?d.length:0,e&h){var x=f,v=d;f=d=n}var y=b?n:ss(t),w=[t,e,s,f,d,x,v,p,g,m];if(y&&function(t,e){var i=t[1],n=e[1],r=i|n,s=r<131,a=n==c&&8==i||n==c&&i==u&&t[7].length<=e[8]||384==n&&e[7].length<=e[8]&&8==i;if(!s&&!a)return t;1&n&&(t[2]=e[2],r|=1&i?0:4);var l=e[3];if(l){var h=t[3];t[3]=h?Ar(h,l,e[4]):l,t[4]=h?hi(t[3],o):e[4]}(l=e[5])&&(h=t[5],t[5]=h?Or(h,l,e[6]):l,t[6]=h?hi(t[5],o):e[6]),(l=e[7])&&(t[7]=l),n&c&&(t[8]=null==t[8]?e[8]:_i(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=r}(w,y),t=w[0],e=w[1],s=w[2],f=w[3],d=w[4],!(m=w[9]=w[9]===n?b?0:t.length:bi(w[9]-_,0))&&24&e&&(e&=-25),e&&1!=e)k=8==e||e==a?function(t,e,r){var s=Fr(t);return function o(){for(var a=arguments.length,l=i(a),h=a,c=as(o);h--;)l[h]=arguments[h];var u=a<3&&l[0]!==c&&l[a-1]!==c?[]:hi(l,c);return(a-=u.length)<r?qr(t,e,Br,o.placeholder,n,l,u,n,n,r-a):Pe(this&&this!==pe&&this instanceof o?s:t,this,l)}}(t,e,m):e!=l&&33!=e||d.length?Br.apply(n,w):function(t,e,n,r){var s=1&e,o=Fr(t);return function e(){for(var a=-1,l=arguments.length,h=-1,c=r.length,u=i(c+l),f=this&&this!==pe&&this instanceof e?o:t;++h<c;)u[h]=r[h];for(;l--;)u[h++]=arguments[++a];return Pe(f,s?n:this,u)}}(t,e,s,f);else var k=function(t,e,i){var n=1&e,r=Fr(t);return function e(){return(this&&this!==pe&&this instanceof e?r:t).apply(n?i:this,arguments)}}(t,e,s);return Es((y?tr:Ds)(k,w),t,e)}function Jr(t,e,i,r){return t===n||Bo(t,Et[i])&&!It.call(r,i)?e:t}function Qr(t,e,i,r,s,o){return ta(t)&&ta(e)&&(o.set(e,t),Nn(t,e,n,Qr,o),o.delete(e)),t}function ts(t){return ra(t)?n:t}function es(t,e,i,r,s,o){var a=1&i,l=t.length,h=e.length;if(l!=h&&!(a&&h>l))return!1;var c=o.get(t),u=o.get(e);if(c&&u)return c==e&&u==t;var f=-1,d=!0,p=2&i?new qi:n;for(o.set(t,e),o.set(e,t);++f<l;){var g=t[f],m=e[f];if(r)var b=a?r(m,g,f,e,t,o):r(g,m,f,t,e,o);if(b!==n){if(b)continue;d=!1;break}if(p){if(!je(e,(function(t,e){if(!ti(p,e)&&(g===t||s(g,t,i,r,o)))return p.push(e)}))){d=!1;break}}else if(g!==m&&!s(g,m,i,r,o)){d=!1;break}}return o.delete(t),o.delete(e),d}function is(t){return Ts(Ps(t,n,$s),t+"")}function ns(t){return Mn(t,Ta,fs)}function rs(t){return Mn(t,Ea,ds)}var ss=Di?function(t){return Di.get(t)}:ll;function os(t){for(var e=t.name+"",i=Ci[e],n=It.call(Ci,e)?i.length:0;n--;){var r=i[n],s=r.func;if(null==s||s==t)return r.name}return e}function as(t){return(It.call(Vi,"placeholder")?Vi:t).placeholder}function ls(){var t=Vi.iteratee||rl;return t=t===rl?In:t,arguments.length?t(arguments[0],arguments[1]):t}function hs(t,e){var i,n,r=t.__data__;return("string"==(n=typeof(i=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==i:null===i)?r["string"==typeof e?"string":"hash"]:r.map}function cs(t){for(var e=Ta(t),i=e.length;i--;){var n=e[i],r=t[n];e[i]=[n,r,Ms(r)]}return e}function us(t,e){var i=function(t,e){return null==t?n:t[e]}(t,e);return Rn(i)?i:n}var fs=me?function(t){return null==t?[]:(t=Pt(t),Te(me(t),(function(e){return Xt.call(t,e)})))}:gl,ds=me?function(t){for(var e=[];t;)Ie(e,fs(t)),t=Yt(t);return e}:gl,ps=Sn;function gs(t,e,i){for(var n=-1,r=(e=xr(e,t)).length,s=!1;++n<r;){var o=zs(e[n]);if(!(s=null!=t&&i(t,o)))break;t=t[o]}return s||++n!=r?s:!!(r=null==t?0:t.length)&&Qo(r)&&_s(o,r)&&($o(t)||Ho(t))}function ms(t){return"function"!=typeof t.constructor||ks(t)?{}:Bi(Yt(t))}function bs(t){return $o(t)||Ho(t)||!!(Zt&&t&&t[Zt])}function _s(t,e){var i=typeof t;return!!(e=null==e?d:e)&&("number"==i||"symbol"!=i&&xt.test(t))&&t>-1&&t%1==0&&t<e}function xs(t,e,i){if(!ta(i))return!1;var n=typeof e;return!!("number"==n?Yo(i)&&_s(e,i.length):"string"==n&&e in i)&&Bo(i[e],t)}function vs(t,e){if($o(t))return!1;var i=typeof t;return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=t&&!la(t))||et.test(t)||!tt.test(t)||null!=e&&t in Pt(e)}function ys(t){var e=os(t),i=Vi[e];if("function"!=typeof i||!(e in Hi.prototype))return!1;if(t===i)return!0;var n=ss(i);return!!n&&t===n[0]}(ki&&ps(new ki(new ArrayBuffer(1)))!=R||Mi&&ps(new Mi)!=M||Si&&ps(Si.resolve())!=A||Pi&&ps(new Pi)!=D||Ai&&ps(new Ai)!=E)&&(ps=function(t){var e=Sn(t),i=e==P?t.constructor:n,r=i?Fs(i):"";if(r)switch(r){case Ti:return R;case Ei:return M;case Li:return A;case Ri:return D;case Ii:return E}return e});var ws=Lt?Go:ml;function ks(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Et)}function Ms(t){return t==t&&!ta(t)}function Ss(t,e){return function(i){return null!=i&&i[t]===e&&(e!==n||t in Pt(i))}}function Ps(t,e,r){return e=bi(e===n?t.length-1:e,0),function(){for(var n=arguments,s=-1,o=bi(n.length-e,0),a=i(o);++s<o;)a[s]=n[e+s];s=-1;for(var l=i(e+1);++s<e;)l[s]=n[s];return l[e]=r(a),Pe(t,this,l)}}function As(t,e){return e.length<2?t:kn(t,nr(e,0,-1))}function Os(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var Ds=Ls(tr),Cs=fe||function(t,e){return pe.setTimeout(t,e)},Ts=Ls(er);function Es(t,e,i){var n=e+"";return Ts(t,function(t,e){var i=e.length;if(!i)return t;var n=i-1;return e[n]=(i>1?"& ":"")+e[n],e=e.join(i>2?", ":" "),t.replace(at,"{\n/* [wrapped with "+e+"] */\n")}(n,function(t,e){return Oe(m,(function(i){var n="_."+i[0];e&i[1]&&!Ee(t,n)&&t.push(n)})),t.sort()}(function(t){var e=t.match(lt);return e?e[1].split(ht):[]}(n),i)))}function Ls(t){var e=0,i=0;return function(){var r=xi(),s=16-(r-i);if(i=r,s>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(n,arguments)}}function Rs(t,e){var i=-1,r=t.length,s=r-1;for(e=e===n?r:e;++i<e;){var o=Xn(i,s),a=t[o];t[o]=t[i],t[i]=a}return t.length=e,t}var Is=function(t){var e=Ro(t,(function(t){return 500===i.size&&i.clear(),t})),i=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(it,(function(t,i,n,r){e.push(n?r.replace(ft,"$1"):i||t)})),e}));function zs(t){if("string"==typeof t||la(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function Fs(t){if(null!=t){try{return Rt.call(t)}catch(e){}try{return t+""}catch(e){}}return""}function js(t){if(t instanceof Hi)return t.clone();var e=new Ni(t.__wrapped__,t.__chain__);return e.__actions__=Dr(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var Vs=Zn((function(t,e){return qo(t)?un(t,bn(e,1,qo,!0)):[]})),Bs=Zn((function(t,e){var i=Ks(e);return qo(i)&&(i=n),qo(t)?un(t,bn(e,1,qo,!0),ls(i,2)):[]})),Ws=Zn((function(t,e){var i=Ks(e);return qo(i)&&(i=n),qo(t)?un(t,bn(e,1,qo,!0),n,i):[]}));function Ns(t,e,i){var n=null==t?0:t.length;if(!n)return-1;var r=null==i?0:pa(i);return r<0&&(r=bi(n+r,0)),We(t,ls(e,3),r)}function Hs(t,e,i){var r=null==t?0:t.length;if(!r)return-1;var s=r-1;return i!==n&&(s=pa(i),s=i<0?bi(r+s,0):_i(s,r-1)),We(t,ls(e,3),s,!0)}function $s(t){return null!=t&&t.length?bn(t,1):[]}function Us(t){return t&&t.length?t[0]:n}var Ys=Zn((function(t){var e=Re(t,br);return e.length&&e[0]===t[0]?Dn(e):[]})),qs=Zn((function(t){var e=Ks(t),i=Re(t,br);return e===Ks(i)?e=n:i.pop(),i.length&&i[0]===t[0]?Dn(i,ls(e,2)):[]})),Xs=Zn((function(t){var e=Ks(t),i=Re(t,br);return(e="function"==typeof e?e:n)&&i.pop(),i.length&&i[0]===t[0]?Dn(i,n,e):[]}));function Ks(t){var e=null==t?0:t.length;return e?t[e-1]:n}var Zs=Zn(Gs);function Gs(t,e){return t&&t.length&&e&&e.length?Yn(t,e):t}var Js=is((function(t,e){var i=null==t?0:t.length,n=on(t,e);return qn(t,Re(e,(function(t){return _s(t,i)?+t:t})).sort(Pr)),n}));function Qs(t){return null==t?t:wi.call(t)}var to=Zn((function(t){return cr(bn(t,1,qo,!0))})),eo=Zn((function(t){var e=Ks(t);return qo(e)&&(e=n),cr(bn(t,1,qo,!0),ls(e,2))})),io=Zn((function(t){var e=Ks(t);return e="function"==typeof e?e:n,cr(bn(t,1,qo,!0),n,e)}));function no(t){if(!t||!t.length)return[];var e=0;return t=Te(t,(function(t){if(qo(t))return e=bi(t.length,e),!0})),Ze(e,(function(e){return Re(t,Ye(e))}))}function ro(t,e){if(!t||!t.length)return[];var i=no(t);return null==e?i:Re(i,(function(t){return Pe(e,n,t)}))}var so=Zn((function(t,e){return qo(t)?un(t,e):[]})),oo=Zn((function(t){return gr(Te(t,qo))})),ao=Zn((function(t){var e=Ks(t);return qo(e)&&(e=n),gr(Te(t,qo),ls(e,2))})),lo=Zn((function(t){var e=Ks(t);return e="function"==typeof e?e:n,gr(Te(t,qo),n,e)})),ho=Zn(no),co=Zn((function(t){var e=t.length,i=e>1?t[e-1]:n;return i="function"==typeof i?(t.pop(),i):n,ro(t,i)}));function uo(t){var e=Vi(t);return e.__chain__=!0,e}function fo(t,e){return e(t)}var po=is((function(t){var e=t.length,i=e?t[0]:0,r=this.__wrapped__,s=function(e){return on(e,t)};return!(e>1||this.__actions__.length)&&r instanceof Hi&&_s(i)?((r=r.slice(i,+i+(e?1:0))).__actions__.push({func:fo,args:[s],thisArg:n}),new Ni(r,this.__chain__).thru((function(t){return e&&!t.length&&t.push(n),t}))):this.thru(s)})),go=Tr((function(t,e,i){It.call(t,i)?++t[i]:sn(t,i,1)})),mo=jr(Ns),bo=jr(Hs);function _o(t,e){return($o(t)?Oe:fn)(t,ls(e,3))}function xo(t,e){return($o(t)?De:dn)(t,ls(e,3))}var vo=Tr((function(t,e,i){It.call(t,i)?t[i].push(e):sn(t,i,[e])})),yo=Zn((function(t,e,n){var r=-1,s="function"==typeof e,o=Yo(t)?i(t.length):[];return fn(t,(function(t){o[++r]=s?Pe(e,t,n):Cn(t,e,n)})),o})),wo=Tr((function(t,e,i){sn(t,i,e)}));function ko(t,e){return($o(t)?Re:Vn)(t,ls(e,3))}var Mo=Tr((function(t,e,i){t[i?0:1].push(e)}),(function(){return[[],[]]})),So=Zn((function(t,e){if(null==t)return[];var i=e.length;return i>1&&xs(t,e[0],e[1])?e=[]:i>2&&xs(e[0],e[1],e[2])&&(e=[e[0]]),$n(t,bn(e,1),[])})),Po=he||function(){return pe.Date.now()};function Ao(t,e,i){return e=i?n:e,e=t&&null==e?t.length:e,Gr(t,c,n,n,n,n,e)}function Oo(t,e){var i;if("function"!=typeof e)throw new Dt(r);return t=pa(t),function(){return--t>0&&(i=e.apply(this,arguments)),t<=1&&(e=n),i}}var Do=Zn((function(t,e,i){var n=1;if(i.length){var r=hi(i,as(Do));n|=l}return Gr(t,n,e,i,r)})),Co=Zn((function(t,e,i){var n=3;if(i.length){var r=hi(i,as(Co));n|=l}return Gr(e,n,t,i,r)}));function To(t,e,i){var s,o,a,l,h,c,u=0,f=!1,d=!1,p=!0;if("function"!=typeof t)throw new Dt(r);function g(e){var i=s,r=o;return s=o=n,u=e,l=t.apply(r,i)}function m(t){var i=t-c;return c===n||i>=e||i<0||d&&t-u>=a}function b(){var t=Po();if(m(t))return _(t);h=Cs(b,function(t){var i=e-(t-c);return d?_i(i,a-(t-u)):i}(t))}function _(t){return h=n,p&&s?g(t):(s=o=n,l)}function x(){var t=Po(),i=m(t);if(s=arguments,o=this,c=t,i){if(h===n)return function(t){return u=t,h=Cs(b,e),f?g(t):l}(c);if(d)return wr(h),h=Cs(b,e),g(c)}return h===n&&(h=Cs(b,e)),l}return e=ma(e)||0,ta(i)&&(f=!!i.leading,a=(d="maxWait"in i)?bi(ma(i.maxWait)||0,e):a,p="trailing"in i?!!i.trailing:p),x.cancel=function(){h!==n&&wr(h),u=0,s=c=o=h=n},x.flush=function(){return h===n?l:_(Po())},x}var Eo=Zn((function(t,e){return cn(t,1,e)})),Lo=Zn((function(t,e,i){return cn(t,ma(e)||0,i)}));function Ro(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new Dt(r);var i=function(){var n=arguments,r=e?e.apply(this,n):n[0],s=i.cache;if(s.has(r))return s.get(r);var o=t.apply(this,n);return i.cache=s.set(r,o)||s,o};return i.cache=new(Ro.Cache||Yi),i}function Io(t){if("function"!=typeof t)throw new Dt(r);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Ro.Cache=Yi;var zo=vr((function(t,e){var i=(e=1==e.length&&$o(e[0])?Re(e[0],Je(ls())):Re(bn(e,1),Je(ls()))).length;return Zn((function(n){for(var r=-1,s=_i(n.length,i);++r<s;)n[r]=e[r].call(this,n[r]);return Pe(t,this,n)}))})),Fo=Zn((function(t,e){var i=hi(e,as(Fo));return Gr(t,l,n,e,i)})),jo=Zn((function(t,e){var i=hi(e,as(jo));return Gr(t,h,n,e,i)})),Vo=is((function(t,e){return Gr(t,u,n,n,n,e)}));function Bo(t,e){return t===e||t!=t&&e!=e}var Wo=Yr(Pn),No=Yr((function(t,e){return t>=e})),Ho=Tn(function(){return arguments}())?Tn:function(t){return ea(t)&&It.call(t,"callee")&&!Xt.call(t,"callee")},$o=i.isArray,Uo=ve?Je(ve):function(t){return ea(t)&&Sn(t)==L};function Yo(t){return null!=t&&Qo(t.length)&&!Go(t)}function qo(t){return ea(t)&&Yo(t)}var Xo=_e||ml,Ko=ye?Je(ye):function(t){return ea(t)&&Sn(t)==v};function Zo(t){if(!ea(t))return!1;var e=Sn(t);return e==y||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!ra(t)}function Go(t){if(!ta(t))return!1;var e=Sn(t);return e==w||e==k||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Jo(t){return"number"==typeof t&&t==pa(t)}function Qo(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=d}function ta(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function ea(t){return null!=t&&"object"==typeof t}var ia=we?Je(we):function(t){return ea(t)&&ps(t)==M};function na(t){return"number"==typeof t||ea(t)&&Sn(t)==S}function ra(t){if(!ea(t)||Sn(t)!=P)return!1;var e=Yt(t);if(null===e)return!0;var i=It.call(e,"constructor")&&e.constructor;return"function"==typeof i&&i instanceof i&&Rt.call(i)==Vt}var sa=ke?Je(ke):function(t){return ea(t)&&Sn(t)==O},oa=Me?Je(Me):function(t){return ea(t)&&ps(t)==D};function aa(t){return"string"==typeof t||!$o(t)&&ea(t)&&Sn(t)==C}function la(t){return"symbol"==typeof t||ea(t)&&Sn(t)==T}var ha=Se?Je(Se):function(t){return ea(t)&&Qo(t.length)&&!!ae[Sn(t)]},ca=Yr(jn),ua=Yr((function(t,e){return t<=e}));function fa(t){if(!t)return[];if(Yo(t))return aa(t)?di(t):Dr(t);if(Gt&&t[Gt])return function(t){for(var e,i=[];!(e=t.next()).done;)i.push(e.value);return i}(t[Gt]());var e=ps(t);return(e==M?ai:e==D?ci:Ba)(t)}function da(t){return t?(t=ma(t))===f||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function pa(t){var e=da(t),i=e%1;return e==e?i?e-i:e:0}function ga(t){return t?an(pa(t),0,g):0}function ma(t){if("number"==typeof t)return t;if(la(t))return p;if(ta(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=ta(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Ge(t);var i=mt.test(t);return i||_t.test(t)?ue(t.slice(2),i?2:8):gt.test(t)?p:+t}function ba(t){return Cr(t,Ea(t))}function _a(t){return null==t?"":hr(t)}var xa=Er((function(t,e){if(ks(e)||Yo(e))Cr(e,Ta(e),t);else for(var i in e)It.call(e,i)&&tn(t,i,e[i])})),va=Er((function(t,e){Cr(e,Ea(e),t)})),ya=Er((function(t,e,i,n){Cr(e,Ea(e),t,n)})),wa=Er((function(t,e,i,n){Cr(e,Ta(e),t,n)})),ka=is(on),Ma=Zn((function(t,e){t=Pt(t);var i=-1,r=e.length,s=r>2?e[2]:n;for(s&&xs(e[0],e[1],s)&&(r=1);++i<r;)for(var o=e[i],a=Ea(o),l=-1,h=a.length;++l<h;){var c=a[l],u=t[c];(u===n||Bo(u,Et[c])&&!It.call(t,c))&&(t[c]=o[c])}return t})),Sa=Zn((function(t){return t.push(n,Qr),Pe(Ra,n,t)}));function Pa(t,e,i){var r=null==t?n:kn(t,e);return r===n?i:r}function Aa(t,e){return null!=t&&gs(t,e,On)}var Oa=Wr((function(t,e,i){null!=e&&"function"!=typeof e.toString&&(e=jt.call(e)),t[e]=i}),tl(nl)),Da=Wr((function(t,e,i){null!=e&&"function"!=typeof e.toString&&(e=jt.call(e)),It.call(t,e)?t[e].push(i):t[e]=[i]}),ls),Ca=Zn(Cn);function Ta(t){return Yo(t)?Ki(t):zn(t)}function Ea(t){return Yo(t)?Ki(t,!0):Fn(t)}var La=Er((function(t,e,i){Nn(t,e,i)})),Ra=Er((function(t,e,i,n){Nn(t,e,i,n)})),Ia=is((function(t,e){var i={};if(null==t)return i;var n=!1;e=Re(e,(function(e){return e=xr(e,t),n||(n=e.length>1),e})),Cr(t,rs(t),i),n&&(i=ln(i,7,ts));for(var r=e.length;r--;)ur(i,e[r]);return i})),za=is((function(t,e){return null==t?{}:function(t,e){return Un(t,e,(function(e,i){return Aa(t,i)}))}(t,e)}));function Fa(t,e){if(null==t)return{};var i=Re(rs(t),(function(t){return[t]}));return e=ls(e),Un(t,i,(function(t,i){return e(t,i[0])}))}var ja=Zr(Ta),Va=Zr(Ea);function Ba(t){return null==t?[]:Qe(t,Ta(t))}var Wa=zr((function(t,e,i){return e=e.toLowerCase(),t+(i?Na(e):e)}));function Na(t){return Za(_a(t).toLowerCase())}function Ha(t){return(t=_a(t))&&t.replace(vt,ni).replace(te,"")}var $a=zr((function(t,e,i){return t+(i?"-":"")+e.toLowerCase()})),Ua=zr((function(t,e,i){return t+(i?" ":"")+e.toLowerCase()})),Ya=Ir("toLowerCase"),qa=zr((function(t,e,i){return t+(i?"_":"")+e.toLowerCase()})),Xa=zr((function(t,e,i){return t+(i?" ":"")+Za(e)})),Ka=zr((function(t,e,i){return t+(i?" ":"")+e.toUpperCase()})),Za=Ir("toUpperCase");function Ga(t,e,i){return t=_a(t),(e=i?n:e)===n?function(t){return re.test(t)}(t)?function(t){return t.match(ie)||[]}(t):function(t){return t.match(ct)||[]}(t):t.match(e)||[]}var Ja=Zn((function(t,e){try{return Pe(t,n,e)}catch(i){return Zo(i)?i:new kt(i)}})),Qa=is((function(t,e){return Oe(e,(function(e){e=zs(e),sn(t,e,Do(t[e],t))})),t}));function tl(t){return function(){return t}}var el=Vr(),il=Vr(!0);function nl(t){return t}function rl(t){return In("function"==typeof t?t:ln(t,1))}var sl=Zn((function(t,e){return function(i){return Cn(i,t,e)}})),ol=Zn((function(t,e){return function(i){return Cn(t,i,e)}}));function al(t,e,i){var n=Ta(e),r=wn(e,n);null!=i||ta(e)&&(r.length||!n.length)||(i=e,e=t,t=this,r=wn(e,Ta(e)));var s=!(ta(i)&&"chain"in i&&!i.chain),o=Go(t);return Oe(r,(function(i){var n=e[i];t[i]=n,o&&(t.prototype[i]=function(){var e=this.__chain__;if(s||e){var i=t(this.__wrapped__);return(i.__actions__=Dr(this.__actions__)).push({func:n,args:arguments,thisArg:t}),i.__chain__=e,i}return n.apply(t,Ie([this.value()],arguments))})})),t}function ll(){}var hl=Hr(Re),cl=Hr(Ce),ul=Hr(je);function fl(t){return vs(t)?Ye(zs(t)):function(t){return function(e){return kn(e,t)}}(t)}var dl=Ur(),pl=Ur(!0);function gl(){return[]}function ml(){return!1}var bl,_l=Nr((function(t,e){return t+e}),0),xl=Xr("ceil"),vl=Nr((function(t,e){return t/e}),1),yl=Xr("floor"),wl=Nr((function(t,e){return t*e}),1),kl=Xr("round"),Ml=Nr((function(t,e){return t-e}),0);return Vi.after=function(t,e){if("function"!=typeof e)throw new Dt(r);return t=pa(t),function(){if(--t<1)return e.apply(this,arguments)}},Vi.ary=Ao,Vi.assign=xa,Vi.assignIn=va,Vi.assignInWith=ya,Vi.assignWith=wa,Vi.at=ka,Vi.before=Oo,Vi.bind=Do,Vi.bindAll=Qa,Vi.bindKey=Co,Vi.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return $o(t)?t:[t]},Vi.chain=uo,Vi.chunk=function(t,e,r){e=(r?xs(t,e,r):e===n)?1:bi(pa(e),0);var s=null==t?0:t.length;if(!s||e<1)return[];for(var o=0,a=0,l=i(de(s/e));o<s;)l[a++]=nr(t,o,o+=e);return l},Vi.compact=function(t){for(var e=-1,i=null==t?0:t.length,n=0,r=[];++e<i;){var s=t[e];s&&(r[n++]=s)}return r},Vi.concat=function(){var t=arguments.length;if(!t)return[];for(var e=i(t-1),n=arguments[0],r=t;r--;)e[r-1]=arguments[r];return Ie($o(n)?Dr(n):[n],bn(e,1))},Vi.cond=function(t){var e=null==t?0:t.length,i=ls();return t=e?Re(t,(function(t){if("function"!=typeof t[1])throw new Dt(r);return[i(t[0]),t[1]]})):[],Zn((function(i){for(var n=-1;++n<e;){var r=t[n];if(Pe(r[0],this,i))return Pe(r[1],this,i)}}))},Vi.conforms=function(t){return function(t){var e=Ta(t);return function(i){return hn(i,t,e)}}(ln(t,1))},Vi.constant=tl,Vi.countBy=go,Vi.create=function(t,e){var i=Bi(t);return null==e?i:rn(i,e)},Vi.curry=function t(e,i,r){var s=Gr(e,8,n,n,n,n,n,i=r?n:i);return s.placeholder=t.placeholder,s},Vi.curryRight=function t(e,i,r){var s=Gr(e,a,n,n,n,n,n,i=r?n:i);return s.placeholder=t.placeholder,s},Vi.debounce=To,Vi.defaults=Ma,Vi.defaultsDeep=Sa,Vi.defer=Eo,Vi.delay=Lo,Vi.difference=Vs,Vi.differenceBy=Bs,Vi.differenceWith=Ws,Vi.drop=function(t,e,i){var r=null==t?0:t.length;return r?nr(t,(e=i||e===n?1:pa(e))<0?0:e,r):[]},Vi.dropRight=function(t,e,i){var r=null==t?0:t.length;return r?nr(t,0,(e=r-(e=i||e===n?1:pa(e)))<0?0:e):[]},Vi.dropRightWhile=function(t,e){return t&&t.length?dr(t,ls(e,3),!0,!0):[]},Vi.dropWhile=function(t,e){return t&&t.length?dr(t,ls(e,3),!0):[]},Vi.fill=function(t,e,i,r){var s=null==t?0:t.length;return s?(i&&"number"!=typeof i&&xs(t,e,i)&&(i=0,r=s),function(t,e,i,r){var s=t.length;for((i=pa(i))<0&&(i=-i>s?0:s+i),(r=r===n||r>s?s:pa(r))<0&&(r+=s),r=i>r?0:ga(r);i<r;)t[i++]=e;return t}(t,e,i,r)):[]},Vi.filter=function(t,e){return($o(t)?Te:mn)(t,ls(e,3))},Vi.flatMap=function(t,e){return bn(ko(t,e),1)},Vi.flatMapDeep=function(t,e){return bn(ko(t,e),f)},Vi.flatMapDepth=function(t,e,i){return i=i===n?1:pa(i),bn(ko(t,e),i)},Vi.flatten=$s,Vi.flattenDeep=function(t){return null!=t&&t.length?bn(t,f):[]},Vi.flattenDepth=function(t,e){return null!=t&&t.length?bn(t,e=e===n?1:pa(e)):[]},Vi.flip=function(t){return Gr(t,512)},Vi.flow=el,Vi.flowRight=il,Vi.fromPairs=function(t){for(var e=-1,i=null==t?0:t.length,n={};++e<i;){var r=t[e];n[r[0]]=r[1]}return n},Vi.functions=function(t){return null==t?[]:wn(t,Ta(t))},Vi.functionsIn=function(t){return null==t?[]:wn(t,Ea(t))},Vi.groupBy=vo,Vi.initial=function(t){return null!=t&&t.length?nr(t,0,-1):[]},Vi.intersection=Ys,Vi.intersectionBy=qs,Vi.intersectionWith=Xs,Vi.invert=Oa,Vi.invertBy=Da,Vi.invokeMap=yo,Vi.iteratee=rl,Vi.keyBy=wo,Vi.keys=Ta,Vi.keysIn=Ea,Vi.map=ko,Vi.mapKeys=function(t,e){var i={};return e=ls(e,3),vn(t,(function(t,n,r){sn(i,e(t,n,r),t)})),i},Vi.mapValues=function(t,e){var i={};return e=ls(e,3),vn(t,(function(t,n,r){sn(i,n,e(t,n,r))})),i},Vi.matches=function(t){return Bn(ln(t,1))},Vi.matchesProperty=function(t,e){return Wn(t,ln(e,1))},Vi.memoize=Ro,Vi.merge=La,Vi.mergeWith=Ra,Vi.method=sl,Vi.methodOf=ol,Vi.mixin=al,Vi.negate=Io,Vi.nthArg=function(t){return t=pa(t),Zn((function(e){return Hn(e,t)}))},Vi.omit=Ia,Vi.omitBy=function(t,e){return Fa(t,Io(ls(e)))},Vi.once=function(t){return Oo(2,t)},Vi.orderBy=function(t,e,i,r){return null==t?[]:($o(e)||(e=null==e?[]:[e]),$o(i=r?n:i)||(i=null==i?[]:[i]),$n(t,e,i))},Vi.over=hl,Vi.overArgs=zo,Vi.overEvery=cl,Vi.overSome=ul,Vi.partial=Fo,Vi.partialRight=jo,Vi.partition=Mo,Vi.pick=za,Vi.pickBy=Fa,Vi.property=fl,Vi.propertyOf=function(t){return function(e){return null==t?n:kn(t,e)}},Vi.pull=Zs,Vi.pullAll=Gs,Vi.pullAllBy=function(t,e,i){return t&&t.length&&e&&e.length?Yn(t,e,ls(i,2)):t},Vi.pullAllWith=function(t,e,i){return t&&t.length&&e&&e.length?Yn(t,e,n,i):t},Vi.pullAt=Js,Vi.range=dl,Vi.rangeRight=pl,Vi.rearg=Vo,Vi.reject=function(t,e){return($o(t)?Te:mn)(t,Io(ls(e,3)))},Vi.remove=function(t,e){var i=[];if(!t||!t.length)return i;var n=-1,r=[],s=t.length;for(e=ls(e,3);++n<s;){var o=t[n];e(o,n,t)&&(i.push(o),r.push(n))}return qn(t,r),i},Vi.rest=function(t,e){if("function"!=typeof t)throw new Dt(r);return Zn(t,e=e===n?e:pa(e))},Vi.reverse=Qs,Vi.sampleSize=function(t,e,i){return e=(i?xs(t,e,i):e===n)?1:pa(e),($o(t)?Gi:Jn)(t,e)},Vi.set=function(t,e,i){return null==t?t:Qn(t,e,i)},Vi.setWith=function(t,e,i,r){return r="function"==typeof r?r:n,null==t?t:Qn(t,e,i,r)},Vi.shuffle=function(t){return($o(t)?Ji:ir)(t)},Vi.slice=function(t,e,i){var r=null==t?0:t.length;return r?(i&&"number"!=typeof i&&xs(t,e,i)?(e=0,i=r):(e=null==e?0:pa(e),i=i===n?r:pa(i)),nr(t,e,i)):[]},Vi.sortBy=So,Vi.sortedUniq=function(t){return t&&t.length?ar(t):[]},Vi.sortedUniqBy=function(t,e){return t&&t.length?ar(t,ls(e,2)):[]},Vi.split=function(t,e,i){return i&&"number"!=typeof i&&xs(t,e,i)&&(e=i=n),(i=i===n?g:i>>>0)?(t=_a(t))&&("string"==typeof e||null!=e&&!sa(e))&&!(e=hr(e))&&oi(t)?yr(di(t),0,i):t.split(e,i):[]},Vi.spread=function(t,e){if("function"!=typeof t)throw new Dt(r);return e=null==e?0:bi(pa(e),0),Zn((function(i){var n=i[e],r=yr(i,0,e);return n&&Ie(r,n),Pe(t,this,r)}))},Vi.tail=function(t){var e=null==t?0:t.length;return e?nr(t,1,e):[]},Vi.take=function(t,e,i){return t&&t.length?nr(t,0,(e=i||e===n?1:pa(e))<0?0:e):[]},Vi.takeRight=function(t,e,i){var r=null==t?0:t.length;return r?nr(t,(e=r-(e=i||e===n?1:pa(e)))<0?0:e,r):[]},Vi.takeRightWhile=function(t,e){return t&&t.length?dr(t,ls(e,3),!1,!0):[]},Vi.takeWhile=function(t,e){return t&&t.length?dr(t,ls(e,3)):[]},Vi.tap=function(t,e){return e(t),t},Vi.throttle=function(t,e,i){var n=!0,s=!0;if("function"!=typeof t)throw new Dt(r);return ta(i)&&(n="leading"in i?!!i.leading:n,s="trailing"in i?!!i.trailing:s),To(t,e,{leading:n,maxWait:e,trailing:s})},Vi.thru=fo,Vi.toArray=fa,Vi.toPairs=ja,Vi.toPairsIn=Va,Vi.toPath=function(t){return $o(t)?Re(t,zs):la(t)?[t]:Dr(Is(_a(t)))},Vi.toPlainObject=ba,Vi.transform=function(t,e,i){var n=$o(t),r=n||Xo(t)||ha(t);if(e=ls(e,4),null==i){var s=t&&t.constructor;i=r?n?new s:[]:ta(t)&&Go(s)?Bi(Yt(t)):{}}return(r?Oe:vn)(t,(function(t,n,r){return e(i,t,n,r)})),i},Vi.unary=function(t){return Ao(t,1)},Vi.union=to,Vi.unionBy=eo,Vi.unionWith=io,Vi.uniq=function(t){return t&&t.length?cr(t):[]},Vi.uniqBy=function(t,e){return t&&t.length?cr(t,ls(e,2)):[]},Vi.uniqWith=function(t,e){return e="function"==typeof e?e:n,t&&t.length?cr(t,n,e):[]},Vi.unset=function(t,e){return null==t||ur(t,e)},Vi.unzip=no,Vi.unzipWith=ro,Vi.update=function(t,e,i){return null==t?t:fr(t,e,_r(i))},Vi.updateWith=function(t,e,i,r){return r="function"==typeof r?r:n,null==t?t:fr(t,e,_r(i),r)},Vi.values=Ba,Vi.valuesIn=function(t){return null==t?[]:Qe(t,Ea(t))},Vi.without=so,Vi.words=Ga,Vi.wrap=function(t,e){return Fo(_r(e),t)},Vi.xor=oo,Vi.xorBy=ao,Vi.xorWith=lo,Vi.zip=ho,Vi.zipObject=function(t,e){return mr(t||[],e||[],tn)},Vi.zipObjectDeep=function(t,e){return mr(t||[],e||[],Qn)},Vi.zipWith=co,Vi.entries=ja,Vi.entriesIn=Va,Vi.extend=va,Vi.extendWith=ya,al(Vi,Vi),Vi.add=_l,Vi.attempt=Ja,Vi.camelCase=Wa,Vi.capitalize=Na,Vi.ceil=xl,Vi.clamp=function(t,e,i){return i===n&&(i=e,e=n),i!==n&&(i=(i=ma(i))==i?i:0),e!==n&&(e=(e=ma(e))==e?e:0),an(ma(t),e,i)},Vi.clone=function(t){return ln(t,4)},Vi.cloneDeep=function(t){return ln(t,5)},Vi.cloneDeepWith=function(t,e){return ln(t,5,e="function"==typeof e?e:n)},Vi.cloneWith=function(t,e){return ln(t,4,e="function"==typeof e?e:n)},Vi.conformsTo=function(t,e){return null==e||hn(t,e,Ta(e))},Vi.deburr=Ha,Vi.defaultTo=function(t,e){return null==t||t!=t?e:t},Vi.divide=vl,Vi.endsWith=function(t,e,i){t=_a(t),e=hr(e);var r=t.length,s=i=i===n?r:an(pa(i),0,r);return(i-=e.length)>=0&&t.slice(i,s)==e},Vi.eq=Bo,Vi.escape=function(t){return(t=_a(t))&&Z.test(t)?t.replace(X,ri):t},Vi.escapeRegExp=function(t){return(t=_a(t))&&rt.test(t)?t.replace(nt,"\\$&"):t},Vi.every=function(t,e,i){var r=$o(t)?Ce:pn;return i&&xs(t,e,i)&&(e=n),r(t,ls(e,3))},Vi.find=mo,Vi.findIndex=Ns,Vi.findKey=function(t,e){return Be(t,ls(e,3),vn)},Vi.findLast=bo,Vi.findLastIndex=Hs,Vi.findLastKey=function(t,e){return Be(t,ls(e,3),yn)},Vi.floor=yl,Vi.forEach=_o,Vi.forEachRight=xo,Vi.forIn=function(t,e){return null==t?t:_n(t,ls(e,3),Ea)},Vi.forInRight=function(t,e){return null==t?t:xn(t,ls(e,3),Ea)},Vi.forOwn=function(t,e){return t&&vn(t,ls(e,3))},Vi.forOwnRight=function(t,e){return t&&yn(t,ls(e,3))},Vi.get=Pa,Vi.gt=Wo,Vi.gte=No,Vi.has=function(t,e){return null!=t&&gs(t,e,An)},Vi.hasIn=Aa,Vi.head=Us,Vi.identity=nl,Vi.includes=function(t,e,i,n){t=Yo(t)?t:Ba(t),i=i&&!n?pa(i):0;var r=t.length;return i<0&&(i=bi(r+i,0)),aa(t)?i<=r&&t.indexOf(e,i)>-1:!!r&&Ne(t,e,i)>-1},Vi.indexOf=function(t,e,i){var n=null==t?0:t.length;if(!n)return-1;var r=null==i?0:pa(i);return r<0&&(r=bi(n+r,0)),Ne(t,e,r)},Vi.inRange=function(t,e,i){return e=da(e),i===n?(i=e,e=0):i=da(i),function(t,e,i){return t>=_i(e,i)&&t<bi(e,i)}(t=ma(t),e,i)},Vi.invoke=Ca,Vi.isArguments=Ho,Vi.isArray=$o,Vi.isArrayBuffer=Uo,Vi.isArrayLike=Yo,Vi.isArrayLikeObject=qo,Vi.isBoolean=function(t){return!0===t||!1===t||ea(t)&&Sn(t)==x},Vi.isBuffer=Xo,Vi.isDate=Ko,Vi.isElement=function(t){return ea(t)&&1===t.nodeType&&!ra(t)},Vi.isEmpty=function(t){if(null==t)return!0;if(Yo(t)&&($o(t)||"string"==typeof t||"function"==typeof t.splice||Xo(t)||ha(t)||Ho(t)))return!t.length;var e=ps(t);if(e==M||e==D)return!t.size;if(ks(t))return!zn(t).length;for(var i in t)if(It.call(t,i))return!1;return!0},Vi.isEqual=function(t,e){return En(t,e)},Vi.isEqualWith=function(t,e,i){var r=(i="function"==typeof i?i:n)?i(t,e):n;return r===n?En(t,e,n,i):!!r},Vi.isError=Zo,Vi.isFinite=function(t){return"number"==typeof t&&xe(t)},Vi.isFunction=Go,Vi.isInteger=Jo,Vi.isLength=Qo,Vi.isMap=ia,Vi.isMatch=function(t,e){return t===e||Ln(t,e,cs(e))},Vi.isMatchWith=function(t,e,i){return i="function"==typeof i?i:n,Ln(t,e,cs(e),i)},Vi.isNaN=function(t){return na(t)&&t!=+t},Vi.isNative=function(t){if(ws(t))throw new kt("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Rn(t)},Vi.isNil=function(t){return null==t},Vi.isNull=function(t){return null===t},Vi.isNumber=na,Vi.isObject=ta,Vi.isObjectLike=ea,Vi.isPlainObject=ra,Vi.isRegExp=sa,Vi.isSafeInteger=function(t){return Jo(t)&&t>=-9007199254740991&&t<=d},Vi.isSet=oa,Vi.isString=aa,Vi.isSymbol=la,Vi.isTypedArray=ha,Vi.isUndefined=function(t){return t===n},Vi.isWeakMap=function(t){return ea(t)&&ps(t)==E},Vi.isWeakSet=function(t){return ea(t)&&"[object WeakSet]"==Sn(t)},Vi.join=function(t,e){return null==t?"":Ve.call(t,e)},Vi.kebabCase=$a,Vi.last=Ks,Vi.lastIndexOf=function(t,e,i){var r=null==t?0:t.length;if(!r)return-1;var s=r;return i!==n&&(s=(s=pa(i))<0?bi(r+s,0):_i(s,r-1)),e==e?function(t,e,i){for(var n=i+1;n--;)if(t[n]===e)return n;return n}(t,e,s):We(t,$e,s,!0)},Vi.lowerCase=Ua,Vi.lowerFirst=Ya,Vi.lt=ca,Vi.lte=ua,Vi.max=function(t){return t&&t.length?gn(t,nl,Pn):n},Vi.maxBy=function(t,e){return t&&t.length?gn(t,ls(e,2),Pn):n},Vi.mean=function(t){return Ue(t,nl)},Vi.meanBy=function(t,e){return Ue(t,ls(e,2))},Vi.min=function(t){return t&&t.length?gn(t,nl,jn):n},Vi.minBy=function(t,e){return t&&t.length?gn(t,ls(e,2),jn):n},Vi.stubArray=gl,Vi.stubFalse=ml,Vi.stubObject=function(){return{}},Vi.stubString=function(){return""},Vi.stubTrue=function(){return!0},Vi.multiply=wl,Vi.nth=function(t,e){return t&&t.length?Hn(t,pa(e)):n},Vi.noConflict=function(){return pe._===this&&(pe._=Bt),this},Vi.noop=ll,Vi.now=Po,Vi.pad=function(t,e,i){t=_a(t);var n=(e=pa(e))?fi(t):0;if(!e||n>=e)return t;var r=(e-n)/2;return $r(ge(r),i)+t+$r(de(r),i)},Vi.padEnd=function(t,e,i){t=_a(t);var n=(e=pa(e))?fi(t):0;return e&&n<e?t+$r(e-n,i):t},Vi.padStart=function(t,e,i){t=_a(t);var n=(e=pa(e))?fi(t):0;return e&&n<e?$r(e-n,i)+t:t},Vi.parseInt=function(t,e,i){return i||null==e?e=0:e&&(e=+e),vi(_a(t).replace(st,""),e||0)},Vi.random=function(t,e,i){if(i&&"boolean"!=typeof i&&xs(t,e,i)&&(e=i=n),i===n&&("boolean"==typeof e?(i=e,e=n):"boolean"==typeof t&&(i=t,t=n)),t===n&&e===n?(t=0,e=1):(t=da(t),e===n?(e=t,t=0):e=da(e)),t>e){var r=t;t=e,e=r}if(i||t%1||e%1){var s=yi();return _i(t+s*(e-t+ce("1e-"+((s+"").length-1))),e)}return Xn(t,e)},Vi.reduce=function(t,e,i){var n=$o(t)?ze:Xe,r=arguments.length<3;return n(t,ls(e,4),i,r,fn)},Vi.reduceRight=function(t,e,i){var n=$o(t)?Fe:Xe,r=arguments.length<3;return n(t,ls(e,4),i,r,dn)},Vi.repeat=function(t,e,i){return e=(i?xs(t,e,i):e===n)?1:pa(e),Kn(_a(t),e)},Vi.replace=function(){var t=arguments,e=_a(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Vi.result=function(t,e,i){var r=-1,s=(e=xr(e,t)).length;for(s||(s=1,t=n);++r<s;){var o=null==t?n:t[zs(e[r])];o===n&&(r=s,o=i),t=Go(o)?o.call(t):o}return t},Vi.round=kl,Vi.runInContext=t,Vi.sample=function(t){return($o(t)?Zi:Gn)(t)},Vi.size=function(t){if(null==t)return 0;if(Yo(t))return aa(t)?fi(t):t.length;var e=ps(t);return e==M||e==D?t.size:zn(t).length},Vi.snakeCase=qa,Vi.some=function(t,e,i){var r=$o(t)?je:rr;return i&&xs(t,e,i)&&(e=n),r(t,ls(e,3))},Vi.sortedIndex=function(t,e){return sr(t,e)},Vi.sortedIndexBy=function(t,e,i){return or(t,e,ls(i,2))},Vi.sortedIndexOf=function(t,e){var i=null==t?0:t.length;if(i){var n=sr(t,e);if(n<i&&Bo(t[n],e))return n}return-1},Vi.sortedLastIndex=function(t,e){return sr(t,e,!0)},Vi.sortedLastIndexBy=function(t,e,i){return or(t,e,ls(i,2),!0)},Vi.sortedLastIndexOf=function(t,e){if(null!=t&&t.length){var i=sr(t,e,!0)-1;if(Bo(t[i],e))return i}return-1},Vi.startCase=Xa,Vi.startsWith=function(t,e,i){return t=_a(t),i=null==i?0:an(pa(i),0,t.length),e=hr(e),t.slice(i,i+e.length)==e},Vi.subtract=Ml,Vi.sum=function(t){return t&&t.length?Ke(t,nl):0},Vi.sumBy=function(t,e){return t&&t.length?Ke(t,ls(e,2)):0},Vi.template=function(t,e,i){var r=Vi.templateSettings;i&&xs(t,e,i)&&(e=n),t=_a(t),e=ya({},e,r,Jr);var s,o,a=ya({},e.imports,r.imports,Jr),l=Ta(a),h=Qe(a,l),c=0,u=e.interpolate||yt,f="__p += '",d=At((e.escape||yt).source+"|"+u.source+"|"+(u===Q?dt:yt).source+"|"+(e.evaluate||yt).source+"|$","g"),p="//# sourceURL="+(It.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++oe+"]")+"\n";t.replace(d,(function(e,i,n,r,a,l){return n||(n=r),f+=t.slice(c,l).replace(wt,si),i&&(s=!0,f+="' +\n__e("+i+") +\n'"),a&&(o=!0,f+="';\n"+a+";\n__p += '"),n&&(f+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),c=l+e.length,e})),f+="';\n";var g=It.call(e,"variable")&&e.variable;if(g){if(ut.test(g))throw new kt("Invalid `variable` option passed into `_.template`")}else f="with (obj) {\n"+f+"\n}\n";f=(o?f.replace($,""):f).replace(U,"$1").replace(Y,"$1;"),f="function("+(g||"obj")+") {\n"+(g?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(s?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+f+"return __p\n}";var m=Ja((function(){return Mt(l,p+"return "+f).apply(n,h)}));if(m.source=f,Zo(m))throw m;return m},Vi.times=function(t,e){if((t=pa(t))<1||t>d)return[];var i=g,n=_i(t,g);e=ls(e),t-=g;for(var r=Ze(n,e);++i<t;)e(i);return r},Vi.toFinite=da,Vi.toInteger=pa,Vi.toLength=ga,Vi.toLower=function(t){return _a(t).toLowerCase()},Vi.toNumber=ma,Vi.toSafeInteger=function(t){return t?an(pa(t),-9007199254740991,d):0===t?t:0},Vi.toString=_a,Vi.toUpper=function(t){return _a(t).toUpperCase()},Vi.trim=function(t,e,i){if((t=_a(t))&&(i||e===n))return Ge(t);if(!t||!(e=hr(e)))return t;var r=di(t),s=di(e);return yr(r,ei(r,s),ii(r,s)+1).join("")},Vi.trimEnd=function(t,e,i){if((t=_a(t))&&(i||e===n))return t.slice(0,pi(t)+1);if(!t||!(e=hr(e)))return t;var r=di(t);return yr(r,0,ii(r,di(e))+1).join("")},Vi.trimStart=function(t,e,i){if((t=_a(t))&&(i||e===n))return t.replace(st,"");if(!t||!(e=hr(e)))return t;var r=di(t);return yr(r,ei(r,di(e))).join("")},Vi.truncate=function(t,e){var i=30,r="...";if(ta(e)){var s="separator"in e?e.separator:s;i="length"in e?pa(e.length):i,r="omission"in e?hr(e.omission):r}var o=(t=_a(t)).length;if(oi(t)){var a=di(t);o=a.length}if(i>=o)return t;var l=i-fi(r);if(l<1)return r;var h=a?yr(a,0,l).join(""):t.slice(0,l);if(s===n)return h+r;if(a&&(l+=h.length-l),sa(s)){if(t.slice(l).search(s)){var c,u=h;for(s.global||(s=At(s.source,_a(pt.exec(s))+"g")),s.lastIndex=0;c=s.exec(u);)var f=c.index;h=h.slice(0,f===n?l:f)}}else if(t.indexOf(hr(s),l)!=l){var d=h.lastIndexOf(s);d>-1&&(h=h.slice(0,d))}return h+r},Vi.unescape=function(t){return(t=_a(t))&&K.test(t)?t.replace(q,gi):t},Vi.uniqueId=function(t){var e=++zt;return _a(t)+e},Vi.upperCase=Ka,Vi.upperFirst=Za,Vi.each=_o,Vi.eachRight=xo,Vi.first=Us,al(Vi,(bl={},vn(Vi,(function(t,e){It.call(Vi.prototype,e)||(bl[e]=t)})),bl),{chain:!1}),Vi.VERSION="4.17.21",Oe(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Vi[t].placeholder=Vi})),Oe(["drop","take"],(function(t,e){Hi.prototype[t]=function(i){i=i===n?1:bi(pa(i),0);var r=this.__filtered__&&!e?new Hi(this):this.clone();return r.__filtered__?r.__takeCount__=_i(i,r.__takeCount__):r.__views__.push({size:_i(i,g),type:t+(r.__dir__<0?"Right":"")}),r},Hi.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),Oe(["filter","map","takeWhile"],(function(t,e){var i=e+1,n=1==i||3==i;Hi.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:ls(t,3),type:i}),e.__filtered__=e.__filtered__||n,e}})),Oe(["head","last"],(function(t,e){var i="take"+(e?"Right":"");Hi.prototype[t]=function(){return this[i](1).value()[0]}})),Oe(["initial","tail"],(function(t,e){var i="drop"+(e?"":"Right");Hi.prototype[t]=function(){return this.__filtered__?new Hi(this):this[i](1)}})),Hi.prototype.compact=function(){return this.filter(nl)},Hi.prototype.find=function(t){return this.filter(t).head()},Hi.prototype.findLast=function(t){return this.reverse().find(t)},Hi.prototype.invokeMap=Zn((function(t,e){return"function"==typeof t?new Hi(this):this.map((function(i){return Cn(i,t,e)}))})),Hi.prototype.reject=function(t){return this.filter(Io(ls(t)))},Hi.prototype.slice=function(t,e){t=pa(t);var i=this;return i.__filtered__&&(t>0||e<0)?new Hi(i):(t<0?i=i.takeRight(-t):t&&(i=i.drop(t)),e!==n&&(i=(e=pa(e))<0?i.dropRight(-e):i.take(e-t)),i)},Hi.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Hi.prototype.toArray=function(){return this.take(g)},vn(Hi.prototype,(function(t,e){var i=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),s=Vi[r?"take"+("last"==e?"Right":""):e],o=r||/^find/.test(e);s&&(Vi.prototype[e]=function(){var e=this.__wrapped__,a=r?[1]:arguments,l=e instanceof Hi,h=a[0],c=l||$o(e),u=function(t){var e=s.apply(Vi,Ie([t],a));return r&&f?e[0]:e};c&&i&&"function"==typeof h&&1!=h.length&&(l=c=!1);var f=this.__chain__,d=!!this.__actions__.length,p=o&&!f,g=l&&!d;if(!o&&c){e=g?e:new Hi(this);var m=t.apply(e,a);return m.__actions__.push({func:fo,args:[u],thisArg:n}),new Ni(m,f)}return p&&g?t.apply(this,a):(m=this.thru(u),p?r?m.value()[0]:m.value():m)})})),Oe(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Ct[t],i=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",n=/^(?:pop|shift)$/.test(t);Vi.prototype[t]=function(){var t=arguments;if(n&&!this.__chain__){var r=this.value();return e.apply($o(r)?r:[],t)}return this[i]((function(i){return e.apply($o(i)?i:[],t)}))}})),vn(Hi.prototype,(function(t,e){var i=Vi[e];if(i){var n=i.name+"";It.call(Ci,n)||(Ci[n]=[]),Ci[n].push({name:e,func:i})}})),Ci[Br(n,2).name]=[{name:"wrapper",func:n}],Hi.prototype.clone=function(){var t=new Hi(this.__wrapped__);return t.__actions__=Dr(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Dr(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Dr(this.__views__),t},Hi.prototype.reverse=function(){if(this.__filtered__){var t=new Hi(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Hi.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,i=$o(t),n=e<0,r=i?t.length:0,s=function(t,e,i){for(var n=-1,r=i.length;++n<r;){var s=i[n],o=s.size;switch(s.type){case"drop":t+=o;break;case"dropRight":e-=o;break;case"take":e=_i(e,t+o);break;case"takeRight":t=bi(t,e-o)}}return{start:t,end:e}}(0,r,this.__views__),o=s.start,a=s.end,l=a-o,h=n?a:o-1,c=this.__iteratees__,u=c.length,f=0,d=_i(l,this.__takeCount__);if(!i||!n&&r==l&&d==l)return pr(t,this.__actions__);var p=[];t:for(;l--&&f<d;){for(var g=-1,m=t[h+=e];++g<u;){var b=c[g],_=b.iteratee,x=b.type,v=_(m);if(2==x)m=v;else if(!v){if(1==x)continue t;break t}}p[f++]=m}return p},Vi.prototype.at=po,Vi.prototype.chain=function(){return uo(this)},Vi.prototype.commit=function(){return new Ni(this.value(),this.__chain__)},Vi.prototype.next=function(){this.__values__===n&&(this.__values__=fa(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?n:this.__values__[this.__index__++]}},Vi.prototype.plant=function(t){for(var e,i=this;i instanceof Wi;){var r=js(i);r.__index__=0,r.__values__=n,e?s.__wrapped__=r:e=r;var s=r;i=i.__wrapped__}return s.__wrapped__=t,e},Vi.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Hi){var e=t;return this.__actions__.length&&(e=new Hi(this)),(e=e.reverse()).__actions__.push({func:fo,args:[Qs],thisArg:n}),new Ni(e,this.__chain__)}return this.thru(Qs)},Vi.prototype.toJSON=Vi.prototype.valueOf=Vi.prototype.value=function(){return pr(this.__wrapped__,this.__actions__)},Vi.prototype.first=Vi.prototype.head,Gt&&(Vi.prototype[Gt]=function(){return this}),Vi}();me?((me.exports=mi)._=mi,ge._=mi):pe._=mi}).call(i)}(b,m);const x=(t,e,i)=>Math.max(Math.min(t,i),e);function v(t){return x(_(2.55*t),0,255)}function y(t){return x(_(255*t),0,255)}function w(t){return x(_(t/2.55)/100,0,1)}function k(t){return x(_(100*t),0,100)}const M={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},S=[..."0123456789ABCDEF"],P=t=>S[15&t],A=t=>S[(240&t)>>4]+S[15&t],O=t=>(240&t)>>4==(15&t);function D(t){var e=(t=>O(t.r)&&O(t.g)&&O(t.b)&&O(t.a))(t)?P:A;return t?"#"+e(t.r)+e(t.g)+e(t.b)+((t,e)=>t<255?e(t):"")(t.a,e):void 0}const C=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function T(t,e,i){const n=e*Math.min(i,1-i),r=(e,r=(e+t/30)%12)=>i-n*Math.max(Math.min(r-3,9-r,1),-1);return[r(0),r(8),r(4)]}function E(t,e,i){const n=(n,r=(n+t/60)%6)=>i-i*e*Math.max(Math.min(r,4-r,1),0);return[n(5),n(3),n(1)]}function L(t,e,i){const n=T(t,1,.5);let r;for(e+i>1&&(r=1/(e+i),e*=r,i*=r),r=0;r<3;r++)n[r]*=1-e-i,n[r]+=e;return n}function R(t){const e=t.r/255,i=t.g/255,n=t.b/255,r=Math.max(e,i,n),s=Math.min(e,i,n),o=(r+s)/2;let a,l,h;return r!==s&&(h=r-s,l=o>.5?h/(2-r-s):h/(r+s),a=function(t,e,i,n,r){return t===r?(e-i)/n+(e<i?6:0):e===r?(i-t)/n+2:(t-e)/n+4}(e,i,n,h,r),a=60*a+.5),[0|a,l||0,o]}function I(t,e,i,n){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,i,n)).map(y)}function z(t,e,i){return I(T,t,e,i)}function F(t){return(t%360+360)%360}function j(t){const e=C.exec(t);let i,n=255;if(!e)return;e[5]!==i&&(n=e[6]?v(+e[5]):y(+e[5]));const r=F(+e[2]),s=+e[3]/100,o=+e[4]/100;return i="hwb"===e[1]?function(t,e,i){return I(L,t,e,i)}(r,s,o):"hsv"===e[1]?function(t,e,i){return I(E,t,e,i)}(r,s,o):z(r,s,o),{r:i[0],g:i[1],b:i[2],a:n}}const V={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"},B={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"};let W;function N(t){W||(W=function(){const t={},e=Object.keys(B),i=Object.keys(V);let n,r,s,o,a;for(n=0;n<e.length;n++){for(o=a=e[n],r=0;r<i.length;r++)s=i[r],a=a.replace(s,V[s]);s=parseInt(B[o],16),t[a]=[s>>16&255,s>>8&255,255&s]}return t}(),W.transparent=[0,0,0,0]);const e=W[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}const H=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/,$=t=>t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,U=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function Y(t,e,i){if(t){let n=R(t);n[e]=Math.max(0,Math.min(n[e]+n[e]*i,0===e?360:1)),n=z(n),t.r=n[0],t.g=n[1],t.b=n[2]}}function q(t,e){return t?Object.assign(e||{},t):t}function X(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=y(t[3]))):(e=q(t,{r:0,g:0,b:0,a:1})).a=y(e.a),e}function K(t){return"r"===t.charAt(0)?function(t){const e=H.exec(t);let i,n,r,s=255;if(e){if(e[7]!==i){const t=+e[7];s=e[8]?v(t):x(255*t,0,255)}return i=+e[1],n=+e[3],r=+e[5],i=255&(e[2]?v(i):x(i,0,255)),n=255&(e[4]?v(n):x(n,0,255)),r=255&(e[6]?v(r):x(r,0,255)),{r:i,g:n,b:r,a:s}}}(t):j(t)}class Z{constructor(t){if(t instanceof Z)return t;const e=typeof t;let i;var n,r,s;"object"===e?i=X(t):"string"===e&&(s=(n=t).length,"#"===n[0]&&(4===s||5===s?r={r:255&17*M[n[1]],g:255&17*M[n[2]],b:255&17*M[n[3]],a:5===s?17*M[n[4]]:255}:7!==s&&9!==s||(r={r:M[n[1]]<<4|M[n[2]],g:M[n[3]]<<4|M[n[4]],b:M[n[5]]<<4|M[n[6]],a:9===s?M[n[7]]<<4|M[n[8]]:255})),i=r||N(t)||K(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=q(this._rgb);return t&&(t.a=w(t.a)),t}set rgb(t){this._rgb=X(t)}rgbString(){return this._valid?function(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${w(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}(this._rgb):void 0}hexString(){return this._valid?D(this._rgb):void 0}hslString(){return this._valid?function(t){if(!t)return;const e=R(t),i=e[0],n=k(e[1]),r=k(e[2]);return t.a<255?`hsla(${i}, ${n}%, ${r}%, ${w(t.a)})`:`hsl(${i}, ${n}%, ${r}%)`}(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,n=t.rgb;let r;const s=e===r?.5:e,o=2*s-1,a=i.a-n.a,l=((o*a==-1?o:(o+a)/(1+o*a))+1)/2;r=1-l,i.r=255&l*i.r+r*n.r+.5,i.g=255&l*i.g+r*n.g+.5,i.b=255&l*i.b+r*n.b+.5,i.a=s*i.a+(1-s)*n.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=function(t,e,i){const n=U(w(t.r)),r=U(w(t.g)),s=U(w(t.b));return{r:y($(n+i*(U(w(e.r))-n))),g:y($(r+i*(U(w(e.g))-r))),b:y($(s+i*(U(w(e.b))-s))),a:t.a+i*(e.a-t.a)}}(this._rgb,t._rgb,e)),this}clone(){return new Z(this.rgb)}alpha(t){return this._rgb.a=y(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=_(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.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 Y(this._rgb,2,t),this}darken(t){return Y(this._rgb,2,-t),this}saturate(t){return Y(this._rgb,1,t),this}desaturate(t){return Y(this._rgb,1,-t),this}rotate(t){return function(t,e){var i=R(t);i[0]=F(i[0]+e),i=z(i),t.r=i[0],t.g=i[1],t.b=i[2]}(this._rgb,t),this}}
/*!
* Chart.js v4.2.1
* https://www.chartjs.org
* (c) 2023 Chart.js Contributors
* Released under the MIT License
*/function G(){}const J=(()=>{let t=0;return()=>t++})();function Q(t){return null==t}function tt(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.slice(0,7)&&"Array]"===e.slice(-6)}function et(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}function it(t){return("number"==typeof t||t instanceof Number)&&isFinite(+t)}function nt(t,e){return it(t)?t:e}function rt(t,e){return void 0===t?e:t}const st=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function ot(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function at(t,e,i,n){let r,s,o;if(tt(t))if(s=t.length,n)for(r=s-1;r>=0;r--)e.call(i,t[r],r);else for(r=0;r<s;r++)e.call(i,t[r],r);else if(et(t))for(o=Object.keys(t),s=o.length,r=0;r<s;r++)e.call(i,t[o[r]],o[r])}function lt(t,e){let i,n,r,s;if(!t||!e||t.length!==e.length)return!1;for(i=0,n=t.length;i<n;++i)if(r=t[i],s=e[i],r.datasetIndex!==s.datasetIndex||r.index!==s.index)return!1;return!0}function ht(t){if(tt(t))return t.map(ht);if(et(t)){const e=Object.create(null),i=Object.keys(t),n=i.length;let r=0;for(;r<n;++r)e[i[r]]=ht(t[i[r]]);return e}return t}function ct(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}function ut(t,e,i,n){if(!ct(t))return;const r=e[t],s=i[t];et(r)&&et(s)?ft(r,s,n):e[t]=ht(s)}function ft(t,e,i){const n=tt(e)?e:[e],r=n.length;if(!et(t))return t;const s=(i=i||{}).merger||ut;let o;for(let a=0;a<r;++a){if(o=n[a],!et(o))continue;const e=Object.keys(o);for(let n=0,r=e.length;n<r;++n)s(e[n],t,o,i)}return t}function dt(t,e){return ft(t,e,{merger:pt})}function pt(t,e,i){if(!ct(t))return;const n=e[t],r=i[t];et(n)&&et(r)?dt(n,r):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=ht(r))}const gt={"":t=>t,x:t=>t.x,y:t=>t.y};function mt(t,e){const i=gt[e]||(gt[e]=function(t){const e=function(t){const e=t.split("."),i=[];let n="";for(const r of e)n+=r,n.endsWith("\\")?n=n.slice(0,-1)+".":(i.push(n),n="");return i}(t);return t=>{for(const i of e){if(""===i)break;t=t&&t[i]}return t}}(e));return i(t)}function bt(t){return t.charAt(0).toUpperCase()+t.slice(1)}const _t=t=>void 0!==t,xt=t=>"function"==typeof t,vt=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0},yt=Math.PI,wt=2*yt,kt=wt+yt,Mt=Number.POSITIVE_INFINITY,St=yt/180,Pt=yt/2,At=yt/4,Ot=2*yt/3,Dt=Math.log10,Ct=Math.sign;function Tt(t,e,i){return Math.abs(t-e)<i}function Et(t){const e=Math.round(t);t=Tt(t,e,t/1e3)?e:t;const i=Math.pow(10,Math.floor(Dt(t))),n=t/i;return(n<=1?1:n<=2?2:n<=5?5:10)*i}function Lt(t){return!isNaN(parseFloat(t))&&isFinite(t)}function Rt(t,e,i){let n,r,s;for(n=0,r=t.length;n<r;n++)s=t[n][i],isNaN(s)||(e.min=Math.min(e.min,s),e.max=Math.max(e.max,s))}function It(t){return t*(yt/180)}function zt(t){return t*(180/yt)}function Ft(t){if(!it(t))return;let e=1,i=0;for(;Math.round(t*e)/e!==t;)e*=10,i++;return i}function jt(t,e){const i=e.x-t.x,n=e.y-t.y,r=Math.sqrt(i*i+n*n);let s=Math.atan2(n,i);return s<-.5*yt&&(s+=wt),{angle:s,distance:r}}function Vt(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Bt(t,e){return(t-e+kt)%wt-yt}function Wt(t){return(t%wt+wt)%wt}function Nt(t,e,i,n){const r=Wt(t),s=Wt(e),o=Wt(i),a=Wt(s-r),l=Wt(o-r),h=Wt(r-s),c=Wt(r-o);return r===s||r===o||n&&s===o||a>l&&h<c}function Ht(t,e,i){return Math.max(e,Math.min(i,t))}function $t(t,e,i,n=1e-6){return t>=Math.min(e,i)-n&&t<=Math.max(e,i)+n}function Ut(t,e,i){i=i||(i=>t[i]<e);let n,r=t.length-1,s=0;for(;r-s>1;)n=s+r>>1,i(n)?s=n:r=n;return{lo:s,hi:r}}const Yt=(t,e,i,n)=>Ut(t,i,n?n=>{const r=t[n][e];return r<i||r===i&&t[n+1][e]===i}:n=>t[n][e]<i),qt=(t,e,i)=>Ut(t,i,(n=>t[n][e]>=i)),Xt=["push","pop","shift","splice","unshift"];function Kt(t,e){const i=t._chartjs;if(!i)return;const n=i.listeners,r=n.indexOf(e);-1!==r&&n.splice(r,1),n.length>0||(Xt.forEach((e=>{delete t[e]})),delete t._chartjs)}function Zt(t){const e=new Set;let i,n;for(i=0,n=t.length;i<n;++i)e.add(t[i]);return e.size===n?t:Array.from(e)}const Gt="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function Jt(t,e){let i=[],n=!1;return function(...r){i=r,n||(n=!0,Gt.call(window,(()=>{n=!1,t.apply(e,i)})))}}const Qt=t=>"start"===t?"left":"end"===t?"right":"center",te=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2;function ee(t,e,i){const n=e.length;let r=0,s=n;if(t._sorted){const{iScale:o,_parsed:a}=t,l=o.axis,{min:h,max:c,minDefined:u,maxDefined:f}=o.getUserBounds();u&&(r=Ht(Math.min(Yt(a,o.axis,h).lo,i?n:Yt(e,l,o.getPixelForValue(h)).lo),0,n-1)),s=f?Ht(Math.max(Yt(a,o.axis,c,!0).hi+1,i?0:Yt(e,l,o.getPixelForValue(c),!0).hi+1),r,n)-r:n-r}return{start:r,count:s}}function ie(t){const{xScale:e,yScale:i,_scaleRanges:n}=t,r={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!n)return t._scaleRanges=r,!0;const s=n.xmin!==e.min||n.xmax!==e.max||n.ymin!==i.min||n.ymax!==i.max;return Object.assign(n,r),s}const ne=t=>0===t||1===t,re=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*wt/i),se=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*wt/i)+1,oe={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*Pt),easeOutSine:t=>Math.sin(t*Pt),easeInOutSine:t=>-.5*(Math.cos(yt*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>ne(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>ne(t)?t:re(t,.075,.3),easeOutElastic:t=>ne(t)?t:se(t,.075,.3),easeInOutElastic(t){const e=.1125;return ne(t)?t:t<.5?.5*re(2*t,e,.45):.5+.5*se(2*t-1,e,.45)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-oe.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:t=>t<.5?.5*oe.easeInBounce(2*t):.5*oe.easeOutBounce(2*t-1)+.5};function ae(t){if(t&&"object"==typeof t){const e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function le(t){return ae(t)?t:new Z(t)}function he(t){return ae(t)?t:new Z(t).saturate(.5).darken(.1).hexString()}const ce=["x","y","borderWidth","radius","tension"],ue=["color","borderColor","backgroundColor"],fe=new Map;function de(t,e,i){return function(t,e){e=e||{};const i=t+JSON.stringify(e);let n=fe.get(i);return n||(n=new Intl.NumberFormat(t,e),fe.set(i,n)),n}(e,i).format(t)}const pe={values:t=>tt(t)?t:""+t,numeric(t,e,i){if(0===t)return"0";const n=this.chart.options.locale;let r,s=t;if(i.length>1){const e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(r="scientific"),s=function(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t)),i}(t,i)}const o=Dt(Math.abs(s)),a=Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:r,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),de(t,n,l)},logarithmic(t,e,i){if(0===t)return"0";const n=i[e].significand||t/Math.pow(10,Math.floor(Dt(t)));return[1,2,3,5,10,15].includes(n)||e>.8*i.length?pe.numeric.call(this,t,e,i):""}};var ge={formatters:pe};const me=Object.create(null),be=Object.create(null);function _e(t,e){if(!e)return t;const i=e.split(".");for(let n=0,r=i.length;n<r;++n){const e=i[n];t=t[e]||(t[e]=Object.create(null))}return t}function xe(t,e,i){return"string"==typeof e?ft(_e(t,e),i):ft(_e(t,""),e)}class ve{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=t=>t.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=(t,e)=>he(e.backgroundColor),this.hoverBorderColor=(t,e)=>he(e.borderColor),this.hoverColor=(t,e)=>he(e.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(e)}set(t,e){return xe(this,t,e)}get(t){return _e(this,t)}describe(t,e){return xe(be,t,e)}override(t,e){return xe(me,t,e)}route(t,e,i,n){const r=_e(this,t),s=_e(this,i),o="_"+e;Object.defineProperties(r,{[o]:{value:r[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[o],e=s[n];return et(t)?Object.assign({},e,t):rt(t,e)},set(t){this[o]=t}}})}apply(t){t.forEach((t=>t(this)))}}var ye=new ve({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[function(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),t.set("animations",{colors:{type:"color",properties:ue},numbers:{type:"number",properties:ce}}),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:t=>0|t}}}})},function(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})},function(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.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:ge.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.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t&&"dash"!==t}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t})}]);function we(t,e,i,n,r){let s=e[r];return s||(s=e[r]=t.measureText(r).width,i.push(r)),s>n&&(n=s),n}function ke(t,e,i,n){let r=(n=n||{}).data=n.data||{},s=n.garbageCollect=n.garbageCollect||[];n.font!==e&&(r=n.data={},s=n.garbageCollect=[],n.font=e),t.save(),t.font=e;let o=0;const a=i.length;let l,h,c,u,f;for(l=0;l<a;l++)if(u=i[l],null!=u&&!0!==tt(u))o=we(t,r,s,o,u);else if(tt(u))for(h=0,c=u.length;h<c;h++)f=u[h],null==f||tt(f)||(o=we(t,r,s,o,f));t.restore();const d=s.length/2;if(d>i.length){for(l=0;l<d;l++)delete r[s[l]];s.splice(0,d)}return o}function Me(t,e,i){const n=t.currentDevicePixelRatio,r=0!==i?Math.max(i/2,.5):0;return Math.round((e-r)*n)/n+r}function Se(t,e){(e=e||t.getContext("2d")).save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore()}function Pe(t,e,i,n){Ae(t,e,i,n,null)}function Ae(t,e,i,n,r){let s,o,a,l,h,c,u,f;const d=e.pointStyle,p=e.rotation,g=e.radius;let m=(p||0)*St;if(d&&"object"==typeof d&&(s=d.toString(),"[object HTMLImageElement]"===s||"[object HTMLCanvasElement]"===s))return t.save(),t.translate(i,n),t.rotate(m),t.drawImage(d,-d.width/2,-d.height/2,d.width,d.height),void t.restore();if(!(isNaN(g)||g<=0)){switch(t.beginPath(),d){default:r?t.ellipse(i,n,r/2,g,0,0,wt):t.arc(i,n,g,0,wt),t.closePath();break;case"triangle":c=r?r/2:g,t.moveTo(i+Math.sin(m)*c,n-Math.cos(m)*g),m+=Ot,t.lineTo(i+Math.sin(m)*c,n-Math.cos(m)*g),m+=Ot,t.lineTo(i+Math.sin(m)*c,n-Math.cos(m)*g),t.closePath();break;case"rectRounded":h=.516*g,l=g-h,o=Math.cos(m+At)*l,u=Math.cos(m+At)*(r?r/2-h:l),a=Math.sin(m+At)*l,f=Math.sin(m+At)*(r?r/2-h:l),t.arc(i-u,n-a,h,m-yt,m-Pt),t.arc(i+f,n-o,h,m-Pt,m),t.arc(i+u,n+a,h,m,m+Pt),t.arc(i-f,n+o,h,m+Pt,m+yt),t.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*g,c=r?r/2:l,t.rect(i-c,n-l,2*c,2*l);break}m+=At;case"rectRot":u=Math.cos(m)*(r?r/2:g),o=Math.cos(m)*g,a=Math.sin(m)*g,f=Math.sin(m)*(r?r/2:g),t.moveTo(i-u,n-a),t.lineTo(i+f,n-o),t.lineTo(i+u,n+a),t.lineTo(i-f,n+o),t.closePath();break;case"crossRot":m+=At;case"cross":u=Math.cos(m)*(r?r/2:g),o=Math.cos(m)*g,a=Math.sin(m)*g,f=Math.sin(m)*(r?r/2:g),t.moveTo(i-u,n-a),t.lineTo(i+u,n+a),t.moveTo(i+f,n-o),t.lineTo(i-f,n+o);break;case"star":u=Math.cos(m)*(r?r/2:g),o=Math.cos(m)*g,a=Math.sin(m)*g,f=Math.sin(m)*(r?r/2:g),t.moveTo(i-u,n-a),t.lineTo(i+u,n+a),t.moveTo(i+f,n-o),t.lineTo(i-f,n+o),m+=At,u=Math.cos(m)*(r?r/2:g),o=Math.cos(m)*g,a=Math.sin(m)*g,f=Math.sin(m)*(r?r/2:g),t.moveTo(i-u,n-a),t.lineTo(i+u,n+a),t.moveTo(i+f,n-o),t.lineTo(i-f,n+o);break;case"line":o=r?r/2:Math.cos(m)*g,a=Math.sin(m)*g,t.moveTo(i-o,n-a),t.lineTo(i+o,n+a);break;case"dash":t.moveTo(i,n),t.lineTo(i+Math.cos(m)*(r?r/2:g),n+Math.sin(m)*g);break;case!1:t.closePath()}t.fill(),e.borderWidth>0&&t.stroke()}}function Oe(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.x<e.right+i&&t.y>e.top-i&&t.y<e.bottom+i}function De(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function Ce(t){t.restore()}function Te(t,e,i,n,r){if(!e)return t.lineTo(i.x,i.y);if("middle"===r){const n=(e.x+i.x)/2;t.lineTo(n,e.y),t.lineTo(n,i.y)}else"after"===r!=!!n?t.lineTo(e.x,i.y):t.lineTo(i.x,e.y);t.lineTo(i.x,i.y)}function Ee(t,e,i,n){if(!e)return t.lineTo(i.x,i.y);t.bezierCurveTo(n?e.cp1x:e.cp2x,n?e.cp1y:e.cp2y,n?i.cp2x:i.cp1x,n?i.cp2y:i.cp1y,i.x,i.y)}function Le(t,e,i,n,r,s={}){const o=tt(e)?e:[e],a=s.strokeWidth>0&&""!==s.strokeColor;let l,h;for(t.save(),t.font=r.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),Q(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,s),l=0;l<o.length;++l)h=o[l],s.backdrop&&Ie(t,s.backdrop),a&&(s.strokeColor&&(t.strokeStyle=s.strokeColor),Q(s.strokeWidth)||(t.lineWidth=s.strokeWidth),t.strokeText(h,i,n,s.maxWidth)),t.fillText(h,i,n,s.maxWidth),Re(t,i,n,h,s),n+=r.lineHeight;t.restore()}function Re(t,e,i,n,r){if(r.strikethrough||r.underline){const s=t.measureText(n),o=e-s.actualBoundingBoxLeft,a=e+s.actualBoundingBoxRight,l=i-s.actualBoundingBoxAscent,h=i+s.actualBoundingBoxDescent,c=r.strikethrough?(l+h)/2:h;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=r.decorationWidth||2,t.moveTo(o,c),t.lineTo(a,c),t.stroke()}}function Ie(t,e){const i=t.fillStyle;t.fillStyle=e.color,t.fillRect(e.left,e.top,e.width,e.height),t.fillStyle=i}function ze(t,e){const{x:i,y:n,w:r,h:s,radius:o}=e;t.arc(i+o.topLeft,n+o.topLeft,o.topLeft,-Pt,yt,!0),t.lineTo(i,n+s-o.bottomLeft),t.arc(i+o.bottomLeft,n+s-o.bottomLeft,o.bottomLeft,yt,Pt,!0),t.lineTo(i+r-o.bottomRight,n+s),t.arc(i+r-o.bottomRight,n+s-o.bottomRight,o.bottomRight,Pt,0,!0),t.lineTo(i+r,n+o.topRight),t.arc(i+r-o.topRight,n+o.topRight,o.topRight,0,-Pt,!0),t.lineTo(i+o.topLeft,n)}const Fe=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,je=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Ve(t,e){const i=(""+t).match(Fe);if(!i||"normal"===i[1])return 1.2*e;switch(t=+i[2],i[3]){case"px":return t;case"%":t/=100}return e*t}const Be=t=>+t||0;function We(t,e){const i={},n=et(e),r=n?Object.keys(e):e,s=et(t)?n?i=>rt(t[i],t[e[i]]):e=>t[e]:()=>t;for(const o of r)i[o]=Be(s(o));return i}function Ne(t){return We(t,{top:"y",right:"x",bottom:"y",left:"x"})}function He(t){return We(t,["topLeft","topRight","bottomLeft","bottomRight"])}function $e(t){const e=Ne(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Ue(t,e){t=t||{},e=e||ye.font;let i=rt(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));let n=rt(t.style,e.style);n&&!(""+n).match(je)&&(console.warn('Invalid font style specified: "'+n+'"'),n=void 0);const r={family:rt(t.family,e.family),lineHeight:Ve(rt(t.lineHeight,e.lineHeight),i),size:i,style:n,weight:rt(t.weight,e.weight),string:""};return r.string=function(t){return!t||Q(t.size)||Q(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(r),r}function Ye(t,e,i,n){let r,s,o,a=!0;for(r=0,s=t.length;r<s;++r)if(o=t[r],void 0!==o&&(void 0!==e&&"function"==typeof o&&(o=o(e),a=!1),void 0!==i&&tt(o)&&(o=o[i%o.length],a=!1),void 0!==o))return n&&!a&&(n.cacheable=!1),o}function qe(t,e){return Object.assign(Object.create(t),e)}function Xe(t,e=[""],i=t,n,r=(()=>t[0])){_t(n)||(n=si("_fallback",t));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:i,_fallback:n,_getTarget:r,override:r=>Xe([r,...t],e,i,n)};return new Proxy(s,{deleteProperty:(e,i)=>(delete e[i],delete e._keys,delete t[0][i],!0),get:(i,n)=>Qe(i,n,(()=>function(t,e,i,n){let r;for(const s of e)if(r=si(Ge(s,t),i),_t(r))return Je(t,r)?ni(i,n,t,r):r}(n,e,t,i))),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>oi(t).includes(e),ownKeys:t=>oi(t),set(t,e,i){const n=t._storage||(t._storage=r());return t[e]=n[e]=i,delete t._keys,!0}})}function Ke(t,e,i,n){const r={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:Ze(t,n),setContext:e=>Ke(t,e,i,n),override:r=>Ke(t.override(r),e,i,n)};return new Proxy(r,{deleteProperty:(e,i)=>(delete e[i],delete t[i],!0),get:(t,e,i)=>Qe(t,e,(()=>function(t,e,i){const{_proxy:n,_context:r,_subProxy:s,_descriptors:o}=t;let a=n[e];return xt(a)&&o.isScriptable(e)&&(a=function(t,e,i,n){const{_proxy:r,_context:s,_subProxy:o,_stack:a}=i;if(a.has(t))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+t);return a.add(t),e=e(s,o||n),a.delete(t),Je(t,e)&&(e=ni(r._scopes,r,t,e)),e}(e,a,t,i)),tt(a)&&a.length&&(a=function(t,e,i,n){const{_proxy:r,_context:s,_subProxy:o,_descriptors:a}=i;if(_t(s.index)&&n(t))e=e[s.index%e.length];else if(et(e[0])){const i=e,n=r._scopes.filter((t=>t!==i));e=[];for(const l of i){const i=ni(n,r,t,l);e.push(Ke(i,s,o&&o[t],a))}}return e}(e,a,t,o.isIndexable)),Je(e,a)&&(a=Ke(a,r,s&&s[e],o)),a}(t,e,i))),getOwnPropertyDescriptor:(e,i)=>e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,i)=>Reflect.has(t,i),ownKeys:()=>Reflect.ownKeys(t),set:(e,i,n)=>(t[i]=n,delete e[i],!0)})}function Ze(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:n=e.indexable,_allKeys:r=e.allKeys}=t;return{allKeys:r,scriptable:i,indexable:n,isScriptable:xt(i)?i:()=>i,isIndexable:xt(n)?n:()=>n}}const Ge=(t,e)=>t?t+bt(e):e,Je=(t,e)=>et(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function Qe(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];const n=i();return t[e]=n,n}function ti(t,e,i){return xt(t)?t(e,i):t}const ei=(t,e)=>!0===t?e:"string"==typeof t?mt(e,t):void 0;function ii(t,e,i,n,r){for(const s of e){const e=ei(i,s);if(e){t.add(e);const s=ti(e._fallback,i,r);if(_t(s)&&s!==i&&s!==n)return s}else if(!1===e&&_t(n)&&i!==n)return null}return!1}function ni(t,e,i,n){const r=e._rootScopes,s=ti(e._fallback,i,n),o=[...t,...r],a=new Set;a.add(n);let l=ri(a,o,i,s||i,n);return null!==l&&(!_t(s)||s===i||(l=ri(a,o,s,l,n),null!==l))&&Xe(Array.from(a),[""],r,s,(()=>function(t,e,i){const n=t._getTarget();e in n||(n[e]={});const r=n[e];return tt(r)&&et(i)?i:r||{}}(e,i,n)))}function ri(t,e,i,n,r){for(;i;)i=ii(t,e,i,n,r);return i}function si(t,e){for(const i of e){if(!i)continue;const e=i[t];if(_t(e))return e}}function oi(t){let e=t._keys;return e||(e=t._keys=function(t){const e=new Set;for(const i of t)for(const t of Object.keys(i).filter((t=>!t.startsWith("_"))))e.add(t);return Array.from(e)}(t._scopes)),e}function ai(t,e,i,n){const{iScale:r}=t,{key:s="r"}=this._parsing,o=new Array(n);let a,l,h,c;for(a=0,l=n;a<l;++a)h=a+i,c=e[h],o[a]={r:r.parse(mt(c,s),h)};return o}const li=Number.EPSILON||1e-14,hi=(t,e)=>e<t.length&&!t[e].skip&&t[e],ci=t=>"x"===t?"y":"x";function ui(t,e,i,n){const r=t.skip?e:t,s=e,o=i.skip?e:i,a=Vt(s,r),l=Vt(o,s);let h=a/(a+l),c=l/(a+l);h=isNaN(h)?0:h,c=isNaN(c)?0:c;const u=n*h,f=n*c;return{previous:{x:s.x-u*(o.x-r.x),y:s.y-u*(o.y-r.y)},next:{x:s.x+f*(o.x-r.x),y:s.y+f*(o.y-r.y)}}}function fi(t,e="x"){const i=ci(e),n=t.length,r=Array(n).fill(0),s=Array(n);let o,a,l,h=hi(t,0);for(o=0;o<n;++o)if(a=l,l=h,h=hi(t,o+1),l){if(h){const t=h[e]-l[e];r[o]=0!==t?(h[i]-l[i])/t:0}s[o]=a?h?Ct(r[o-1])!==Ct(r[o])?0:(r[o-1]+r[o])/2:r[o-1]:r[o]}!function(t,e,i){const n=t.length;let r,s,o,a,l,h=hi(t,0);for(let c=0;c<n-1;++c)l=h,h=hi(t,c+1),l&&h&&(Tt(e[c],0,li)?i[c]=i[c+1]=0:(r=i[c]/e[c],s=i[c+1]/e[c],a=Math.pow(r,2)+Math.pow(s,2),a<=9||(o=3/Math.sqrt(a),i[c]=r*o*e[c],i[c+1]=s*o*e[c])))}(t,r,s),function(t,e,i="x"){const n=ci(i),r=t.length;let s,o,a,l=hi(t,0);for(let h=0;h<r;++h){if(o=a,a=l,l=hi(t,h+1),!a)continue;const r=a[i],c=a[n];o&&(s=(r-o[i])/3,a[`cp1${i}`]=r-s,a[`cp1${n}`]=c-s*e[h]),l&&(s=(l[i]-r)/3,a[`cp2${i}`]=r+s,a[`cp2${n}`]=c+s*e[h])}}(t,s,e)}function di(t,e,i){return Math.max(Math.min(t,i),e)}function pi(t,e,i,n,r){let s,o,a,l;if(e.spanGaps&&(t=t.filter((t=>!t.skip))),"monotone"===e.cubicInterpolationMode)fi(t,r);else{let i=n?t[t.length-1]:t[0];for(s=0,o=t.length;s<o;++s)a=t[s],l=ui(i,a,t[Math.min(s+1,o-(n?0:1))%o],e.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,i=a}e.capBezierPoints&&function(t,e){let i,n,r,s,o,a=Oe(t[0],e);for(i=0,n=t.length;i<n;++i)o=s,s=a,a=i<n-1&&Oe(t[i+1],e),s&&(r=t[i],o&&(r.cp1x=di(r.cp1x,e.left,e.right),r.cp1y=di(r.cp1y,e.top,e.bottom)),a&&(r.cp2x=di(r.cp2x,e.left,e.right),r.cp2y=di(r.cp2y,e.top,e.bottom)))}(t,i)}function gi(){return"undefined"!=typeof window&&"undefined"!=typeof document}function mi(t){let e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e}function bi(t,e,i){let n;return"string"==typeof t?(n=parseInt(t,10),-1!==t.indexOf("%")&&(n=n/100*e.parentNode[i])):n=t,n}const _i=t=>t.ownerDocument.defaultView.getComputedStyle(t,null),xi=["top","right","bottom","left"];function vi(t,e,i){const n={};i=i?"-"+i:"";for(let r=0;r<4;r++){const s=xi[r];n[s]=parseFloat(t[e+"-"+s+i])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}const yi=(t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot);function wi(t,e){if("native"in t)return t;const{canvas:i,currentDevicePixelRatio:n}=e,r=_i(i),s="border-box"===r.boxSizing,o=vi(r,"padding"),a=vi(r,"border","width"),{x:l,y:h,box:c}=function(t,e){const i=t.touches,n=i&&i.length?i[0]:t,{offsetX:r,offsetY:s}=n;let o,a,l=!1;if(yi(r,s,t.target))o=r,a=s;else{const t=e.getBoundingClientRect();o=n.clientX-t.left,a=n.clientY-t.top,l=!0}return{x:o,y:a,box:l}}(t,i),u=o.left+(c&&a.left),f=o.top+(c&&a.top);let{width:d,height:p}=e;return s&&(d-=o.width+a.width,p-=o.height+a.height),{x:Math.round((l-u)/d*i.width/n),y:Math.round((h-f)/p*i.height/n)}}const ki=t=>Math.round(10*t)/10;function Mi(t,e,i,n){const r=_i(t),s=vi(r,"margin"),o=bi(r.maxWidth,t,"clientWidth")||Mt,a=bi(r.maxHeight,t,"clientHeight")||Mt,l=function(t,e,i){let n,r;if(void 0===e||void 0===i){const s=mi(t);if(s){const t=s.getBoundingClientRect(),o=_i(s),a=vi(o,"border","width"),l=vi(o,"padding");e=t.width-l.width-a.width,i=t.height-l.height-a.height,n=bi(o.maxWidth,s,"clientWidth"),r=bi(o.maxHeight,s,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:n||Mt,maxHeight:r||Mt}}(t,e,i);let{width:h,height:c}=l;if("content-box"===r.boxSizing){const t=vi(r,"border","width"),e=vi(r,"padding");h-=e.width+t.width,c-=e.height+t.height}return h=Math.max(0,h-s.width),c=Math.max(0,n?h/n:c-s.height),h=ki(Math.min(h,o,l.maxWidth)),c=ki(Math.min(c,a,l.maxHeight)),h&&!c&&(c=ki(h/2)),(void 0!==e||void 0!==i)&&n&&l.height&&c>l.height&&(c=l.height,h=ki(Math.floor(c*n))),{width:h,height:c}}function Si(t,e,i){const n=e||1,r=Math.floor(t.height*n),s=Math.floor(t.width*n);t.height=Math.floor(t.height),t.width=Math.floor(t.width);const o=t.canvas;return o.style&&(i||!o.style.height&&!o.style.width)&&(o.style.height=`${t.height}px`,o.style.width=`${t.width}px`),(t.currentDevicePixelRatio!==n||o.height!==r||o.width!==s)&&(t.currentDevicePixelRatio=n,o.height=r,o.width=s,t.ctx.setTransform(n,0,0,n,0,0),!0)}const Pi=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(e){}return t}();function Ai(t,e){const i=function(t,e){return _i(t).getPropertyValue(e)}(t,e),n=i&&i.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function Oi(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function Di(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:"middle"===n?i<.5?t.y:e.y:"after"===n?i<1?t.y:e.y:i>0?e.y:t.y}}function Ci(t,e,i,n){const r={x:t.cp2x,y:t.cp2y},s={x:e.cp1x,y:e.cp1y},o=Oi(t,r,i),a=Oi(r,s,i),l=Oi(s,e,i),h=Oi(o,a,i),c=Oi(a,l,i);return Oi(h,c,i)}function Ti(t,e,i){return t?function(t,e){return{x:i=>t+t+e-i,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}}(e,i):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function Ei(t,e){let i,n;"ltr"!==e&&"rtl"!==e||(i=t.canvas.style,n=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=n)}function Li(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function Ri(t){return"angle"===t?{between:Nt,compare:Bt,normalize:Wt}:{between:$t,compare:(t,e)=>t-e,normalize:t=>t}}function Ii({start:t,end:e,count:i,loop:n,style:r}){return{start:t%i,end:e%i,loop:n&&(e-t+1)%i==0,style:r}}function zi(t,e,i){if(!i)return[t];const{property:n,start:r,end:s}=i,o=e.length,{compare:a,between:l,normalize:h}=Ri(n),{start:c,end:u,loop:f,style:d}=function(t,e,i){const{property:n,start:r,end:s}=i,{between:o,normalize:a}=Ri(n),l=e.length;let h,c,{start:u,end:f,loop:d}=t;if(d){for(u+=l,f+=l,h=0,c=l;h<c&&o(a(e[u%l][n]),r,s);++h)u--,f--;u%=l,f%=l}return f<u&&(f+=l),{start:u,end:f,loop:d,style:t.style}}(t,e,i),p=[];let g,m,b,_=!1,x=null;const v=()=>_||l(r,b,g)&&0!==a(r,b),y=()=>!_||0===a(s,g)||l(s,b,g);for(let w=c,k=c;w<=u;++w)m=e[w%o],m.skip||(g=h(m[n]),g!==b&&(_=l(g,r,s),null===x&&v()&&(x=0===a(g,r)?w:k),null!==x&&y()&&(p.push(Ii({start:x,end:w,loop:f,count:o,style:d})),x=null),k=w,b=g));return null!==x&&p.push(Ii({start:x,end:u,loop:f,count:o,style:d})),p}function Fi(t,e){const i=[],n=t.segments;for(let r=0;r<n.length;r++){const s=zi(n[r],t.points,e);s.length&&i.push(...s)}return i}function ji(t,e,i,n){return n&&n.setContext&&i?function(t,e,i,n){const r=t._chart.getContext(),s=Vi(t.options),{_datasetIndex:o,options:{spanGaps:a}}=t,l=i.length,h=[];let c=s,u=e[0].start,f=u;function d(t,e,n,r){const s=a?-1:1;if(t!==e){for(t+=l;i[t%l].skip;)t-=s;for(;i[e%l].skip;)e+=s;t%l!=e%l&&(h.push({start:t%l,end:e%l,loop:n,style:r}),c=r,u=e%l)}}for(const p of e){u=a?u:p.start;let t,e=i[u%l];for(f=u+1;f<=p.end;f++){const s=i[f%l];t=Vi(n.setContext(qe(r,{type:"segment",p0:e,p1:s,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:o}))),Bi(t,c)&&d(u,f-1,p.loop,c),e=s,c=t}u<f-1&&d(u,f-1,p.loop,c)}return h}(t,e,i,n):e}function Vi(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function Bi(t,e){return e&&JSON.stringify(t)!==JSON.stringify(e)}
/*!
* Chart.js v4.2.1
* https://www.chartjs.org
* (c) 2023 Chart.js Contributors
* Released under the MIT License
*/class Wi{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,n){const r=e.listeners[n],s=e.duration;r.forEach((n=>n({chart:t,initial:e.initial,numSteps:s,currentStep:Math.min(i-e.start,s)})))}_refresh(){this._request||(this._running=!0,this._request=Gt.call(window,(()=>{this._update(),this._request=null,this._running&&this._refresh()})))}_update(t=Date.now()){let e=0;this._charts.forEach(((i,n)=>{if(!i.running||!i.items.length)return;const r=i.items;let s,o=r.length-1,a=!1;for(;o>=0;--o)s=r[o],s._active?(s._total>i.duration&&(i.duration=s._total),s.tick(t),a=!0):(r[o]=r[r.length-1],r.pop());a&&(n.draw(),this._notify(n,i,t,"progress")),r.length||(i.running=!1,this._notify(n,i,t,"complete"),i.initial=!1),e+=r.length})),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce(((t,e)=>Math.max(t,e._duration)),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let n=i.length-1;for(;n>=0;--n)i[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Ni=new Wi;const Hi="transparent",$i={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){const n=le(t||Hi),r=n.valid&&le(e||Hi);return r&&r.valid?r.mix(n,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class Ui{constructor(t,e,i,n){const r=e[i];n=Ye([t.to,n,r,t.from]);const s=Ye([t.from,r,n]);this._active=!0,this._fn=t.fn||$i[t.type||typeof s],this._easing=oe[t.easing]||oe.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=s,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const n=this._target[this._prop],r=i-this._start,s=this._duration-r;this._start=i,this._duration=Math.floor(Math.max(s,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=Ye([t.to,e,n,t.from]),this._from=Ye([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,n=this._prop,r=this._from,s=this._loop,o=this._to;let a;if(this._active=r!==o&&(s||e<i),!this._active)return this._target[n]=o,void this._notify(!0);e<0?this._target[n]=r:(a=e/i%2,a=s&&a>1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[n]=this._fn(r,o,a))}wait(){const t=this._promises||(this._promises=[]);return new Promise(((e,i)=>{t.push({res:e,rej:i})}))}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let n=0;n<i.length;n++)i[n][e]()}}class Yi{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!et(t))return;const e=Object.keys(ye.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach((n=>{const r=t[n];if(!et(r))return;const s={};for(const t of e)s[t]=r[t];(tt(r.properties)&&r.properties||[n]).forEach((t=>{t!==n&&i.has(t)||i.set(t,s)}))}))}_animateOptions(t,e){const i=e.options,n=function(t,e){if(!e)return;let i=t.options;if(i)return i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}})),i;t.options=e}(t,i);if(!n)return[];const r=this._createAnimations(n,i);return i.$shared&&function(t,e){const i=[],n=Object.keys(e);for(let r=0;r<n.length;r++){const e=t[n[r]];e&&e.active()&&i.push(e.wait())}return Promise.all(i)}(t.options.$animations,i).then((()=>{t.options=i}),(()=>{})),r}_createAnimations(t,e){const i=this._properties,n=[],r=t.$animations||(t.$animations={}),s=Object.keys(e),o=Date.now();let a;for(a=s.length-1;a>=0;--a){const l=s[a];if("$"===l.charAt(0))continue;if("options"===l){n.push(...this._animateOptions(t,e));continue}const h=e[l];let c=r[l];const u=i.get(l);if(c){if(u&&c.active()){c.update(u,h,o);continue}c.cancel()}u&&u.duration?(r[l]=c=new Ui(u,t,l,h),n.push(c)):t[l]=h}return n}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?(Ni.add(this._chart,i),!0):void 0}}function qi(t,e){const i=t&&t.options||{},n=i.reverse,r=void 0===i.min?e:0,s=void 0===i.max?e:0;return{start:n?s:r,end:n?r:s}}function Xi(t,e){const i=[],n=t._getSortedDatasetMetas(e);let r,s;for(r=0,s=n.length;r<s;++r)i.push(n[r].index);return i}function Ki(t,e,i,n={}){const r=t.keys,s="single"===n.mode;let o,a,l,h;if(null!==e){for(o=0,a=r.length;o<a;++o){if(l=+r[o],l===i){if(n.all)continue;break}h=t.values[l],it(h)&&(s||0===e||Ct(e)===Ct(h))&&(e+=h)}return e}}function Zi(t,e){const i=t&&t.options.stacked;return i||void 0===i&&void 0!==e.stack}function Gi(t,e,i){const n=t[e]||(t[e]={});return n[i]||(n[i]={})}function Ji(t,e,i,n){for(const r of e.getMatchingVisibleMetas(n).reverse()){const e=t[r.index];if(i&&e>0||!i&&e<0)return r.index}return null}function Qi(t,e){const{chart:i,_cachedMeta:n}=t,r=i._stacks||(i._stacks={}),{iScale:s,vScale:o,index:a}=n,l=s.axis,h=o.axis,c=function(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}(s,o,n),u=e.length;let f;for(let d=0;d<u;++d){const t=e[d],{[l]:i,[h]:s}=t;f=(t._stacks||(t._stacks={}))[h]=Gi(r,c,i),f[a]=s,f._top=Ji(f,o,!0,n.type),f._bottom=Ji(f,o,!1,n.type),(f._visualValues||(f._visualValues={}))[a]=s}}function tn(t,e){const i=t.scales;return Object.keys(i).filter((t=>i[t].axis===e)).shift()}function en(t,e){const i=t.controller.index,n=t.vScale&&t.vScale.axis;if(n){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[n]||void 0===e[n][i])return;delete e[n][i],void 0!==e[n]._visualValues&&void 0!==e[n]._visualValues[i]&&delete e[n]._visualValues[i]}}}const nn=t=>"reset"===t||"none"===t,rn=(t,e)=>e?t:Object.assign({},t);class sn{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,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=Zi(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&&en(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),n=(t,e,i,n)=>"x"===t?e:"r"===t?n:i,r=e.xAxisID=rt(i.xAxisID,tn(t,"x")),s=e.yAxisID=rt(i.yAxisID,tn(t,"y")),o=e.rAxisID=rt(i.rAxisID,tn(t,"r")),a=e.indexAxis,l=e.iAxisID=n(a,r,s,o),h=e.vAxisID=n(a,s,r,o);e.xScale=this.getScaleForId(r),e.yScale=this.getScaleForId(s),e.rScale=this.getScaleForId(o),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(h)}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 e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Kt(this._data,this),t._stacked&&en(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(et(e))this._data=function(t){const e=Object.keys(t),i=new Array(e.length);let n,r,s;for(n=0,r=e.length;n<r;++n)s=e[n],i[n]={x:s,y:t[s]};return i}(e);else if(i!==e){if(i){Kt(i,this);const t=this._cachedMeta;en(t),t._parsed=[]}e&&Object.isExtensible(e)&&(r=this,(n=e)._chartjs?n._chartjs.listeners.push(r):(Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[r]}}),Xt.forEach((t=>{const e="_onData"+bt(t),i=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...t){const r=i.apply(this,t);return n._chartjs.listeners.forEach((i=>{"function"==typeof i[e]&&i[e](...t)})),r}})})))),this._syncList=[],this._data=e}var n,r}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let n=!1;this._dataCheck();const r=e._stacked;e._stacked=Zi(e.vScale,e),e.stack!==i.stack&&(n=!0,en(e),e.stack=i.stack),this._resyncElements(t),(n||r!==e._stacked)&&Qi(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:n}=this,{iScale:r,_stacked:s}=i,o=r.axis;let a,l,h,c=0===t&&e===n.length||i._sorted,u=t>0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=n,i._sorted=!0,h=n;else{h=tt(n[t])?this.parseArrayData(i,n,t,e):et(n[t])?this.parseObjectData(i,n,t,e):this.parsePrimitiveData(i,n,t,e);const r=()=>null===l[o]||u&&l[o]<u[o];for(a=0;a<e;++a)i._parsed[a+t]=l=h[a],c&&(r()&&(c=!1),u=l);i._sorted=c}s&&Qi(this,h)}parsePrimitiveData(t,e,i,n){const{iScale:r,vScale:s}=t,o=r.axis,a=s.axis,l=r.getLabels(),h=r===s,c=new Array(n);let u,f,d;for(u=0,f=n;u<f;++u)d=u+i,c[u]={[o]:h||r.parse(l[d],d),[a]:s.parse(e[d],d)};return c}parseArrayData(t,e,i,n){const{xScale:r,yScale:s}=t,o=new Array(n);let a,l,h,c;for(a=0,l=n;a<l;++a)h=a+i,c=e[h],o[a]={x:r.parse(c[0],h),y:s.parse(c[1],h)};return o}parseObjectData(t,e,i,n){const{xScale:r,yScale:s}=t,{xAxisKey:o="x",yAxisKey:a="y"}=this._parsing,l=new Array(n);let h,c,u,f;for(h=0,c=n;h<c;++h)u=h+i,f=e[u],l[h]={x:r.parse(mt(f,o),u),y:s.parse(mt(f,a),u)};return l}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const n=this.chart,r=this._cachedMeta,s=e[t.axis];return Ki({keys:Xi(n,!0),values:e._stacks[t.axis]._visualValues},s,r.index,{mode:i})}updateRangeFromParsed(t,e,i,n){const r=i[e.axis];let s=null===r?NaN:r;const o=n&&i._stacks[e.axis];n&&o&&(n.values=o,s=Ki(n,r,this._cachedMeta.index)),t.min=Math.min(t.min,s),t.max=Math.max(t.max,s)}getMinMax(t,e){const i=this._cachedMeta,n=i._parsed,r=i._sorted&&t===i.iScale,s=n.length,o=this._getOtherScale(t),a=((t,e,i)=>t&&!e.hidden&&e._stacked&&{keys:Xi(i,!0),values:null})(e,i,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:c}=function(t){const{min:e,max:i,minDefined:n,maxDefined:r}=t.getUserBounds();return{min:n?e:Number.NEGATIVE_INFINITY,max:r?i:Number.POSITIVE_INFINITY}}(o);let u,f;function d(){f=n[u];const e=f[o.axis];return!it(f[t.axis])||h>e||c<e}for(u=0;u<s&&(d()||(this.updateRangeFromParsed(l,t,f,a),!r));++u);if(r)for(u=s-1;u>=0;--u)if(!d()){this.updateRangeFromParsed(l,t,f,a);break}return l}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let n,r,s;for(n=0,r=e.length;n<r;++n)s=e[n][t.axis],it(s)&&i.push(s);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,n=e.vScale,r=this.getParsed(t);return{label:i?""+i.getLabelForValue(r[i.axis]):"",value:n?""+n.getLabelForValue(r[n.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=function(t){let e,i,n,r;return et(t)?(e=t.top,i=t.right,n=t.bottom,r=t.left):e=i=n=r=t,{top:e,right:i,bottom:n,left:r,disabled:!1===t}}(rt(this.options.clip,function(t,e,i){if(!1===i)return!1;const n=qi(t,i),r=qi(e,i);return{top:r.end,right:n.end,bottom:r.start,left:n.start}}(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,n=i.data||[],r=e.chartArea,s=[],o=this._drawStart||0,a=this._drawCount||n.length-o,l=this.options.drawActiveElementsOnTop;let h;for(i.dataset&&i.dataset.draw(t,r,o,a),h=o;h<o+a;++h){const e=n[h];e.hidden||(e.active&&l?s.push(e):e.draw(t,r))}for(h=0;h<s.length;++h)s[h].draw(t,r)}getStyle(t,e){const i=e?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const n=this.getDataset();let r;if(t>=0&&t<this._cachedMeta.data.length){const e=this._cachedMeta.data[t];r=e.$context||(e.$context=function(t,e,i){return qe(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:i,index:e,mode:"default",type:"data"})}(this.getContext(),t,e)),r.parsed=this.getParsed(t),r.raw=n.data[t],r.index=r.dataIndex=t}else r=this.$context||(this.$context=function(t,e){return qe(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}(this.chart.getContext(),this.index)),r.dataset=n,r.index=r.datasetIndex=this.index;return r.active=!!e,r.mode=i,r}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const n="active"===e,r=this._cachedDataOpts,s=t+"-"+e,o=r[s],a=this.enableOptionSharing&&_t(i);if(o)return rn(o,a);const l=this.chart.config,h=l.datasetElementScopeKeys(this._type,t),c=n?[`${t}Hover`,"hover",t,""]:[t,""],u=l.getOptionScopes(this.getDataset(),h),f=Object.keys(ye.elements[t]),d=l.resolveNamedOptions(u,f,(()=>this.getContext(i,n,e)),c);return d.$shared&&(d.$shared=a,r[s]=Object.freeze(rn(d,a))),d}_resolveAnimations(t,e,i){const n=this.chart,r=this._cachedDataOpts,s=`animation-${e}`,o=r[s];if(o)return o;let a;if(!1!==n.options.animation){const n=this.chart.config,r=n.datasetAnimationScopeKeys(this._type,e),s=n.getOptionScopes(this.getDataset(),r);a=n.createResolver(s,this.getContext(t,i,e))}const l=new Yi(n,a&&a.animations);return a&&a._cacheable&&(r[s]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||nn(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),n=this._sharedOptions,r=this.getSharedOptions(i),s=this.includeOptions(e,r)||r!==n;return this.updateSharedOptions(r,e,i),{sharedOptions:r,includeOptions:s}}updateElement(t,e,i,n){nn(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}updateSharedOptions(t,e,i){t&&!nn(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,n){t.active=n;const r=this.getStyle(e,n);this._resolveAnimations(e,i,n).update(t,{options:!n&&this.getSharedOptions(r)||r})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,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 e=this._data,i=this._cachedMeta.data;for(const[o,a,l]of this._syncList)this[o](a,l);this._syncList=[];const n=i.length,r=e.length,s=Math.min(r,n);s&&this.parse(0,s),r>n?this._insertElements(n,r-n,t):r<n&&this._removeElements(r,n-r)}_insertElements(t,e,i=!0){const n=this._cachedMeta,r=n.data,s=t+e;let o;const a=t=>{for(t.length+=e,o=t.length-1;o>=s;o--)t[o]=t[o-e]};for(a(r),o=t;o<s;++o)r[o]=new this.dataElementType;this._parsing&&a(n._parsed),this.parse(t,e),i&&this.updateElements(r,t,e,"reset")}updateElements(t,e,i,n){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const n=i._parsed.splice(t,e);i._stacked&&en(i,n)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,n]=t;this[e](i,n)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function on(t){const e=t.iScale,i=function(t,e){if(!t._cache.$bar){const i=t.getMatchingVisibleMetas(e);let n=[];for(let e=0,r=i.length;e<r;e++)n=n.concat(i[e].controller.getAllParsedValues(t));t._cache.$bar=Zt(n.sort(((t,e)=>t-e)))}return t._cache.$bar}(e,t.type);let n,r,s,o,a=e._length;const l=()=>{32767!==s&&-32768!==s&&(_t(o)&&(a=Math.min(a,Math.abs(s-o)||a)),o=s)};for(n=0,r=i.length;n<r;++n)s=e.getPixelForValue(i[n]),l();for(o=void 0,n=0,r=e.ticks.length;n<r;++n)s=e.getPixelForTick(n),l();return a}function an(t,e,i,n){return tt(t)?function(t,e,i,n){const r=i.parse(t[0],n),s=i.parse(t[1],n),o=Math.min(r,s),a=Math.max(r,s);let l=o,h=a;Math.abs(o)>Math.abs(a)&&(l=a,h=o),e[i.axis]=h,e._custom={barStart:l,barEnd:h,start:r,end:s,min:o,max:a}}(t,e,i,n):e[i.axis]=i.parse(t,n),e}function ln(t,e,i,n){const r=t.iScale,s=t.vScale,o=r.getLabels(),a=r===s,l=[];let h,c,u,f;for(h=i,c=i+n;h<c;++h)f=e[h],u={},u[r.axis]=a||r.parse(o[h],h),l.push(an(f,u,s,h));return l}function hn(t){return t&&void 0!==t.barStart&&void 0!==t.barEnd}function cn(t,e,i,n){let r=e.borderSkipped;const s={};if(!r)return void(t.borderSkipped=s);if(!0===r)return void(t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0});const{start:o,end:a,reverse:l,top:h,bottom:c}=function(t){let e,i,n,r,s;return t.horizontal?(e=t.base>t.x,i="left",n="right"):(e=t.base<t.y,i="bottom",n="top"),e?(r="end",s="start"):(r="start",s="end"),{start:i,end:n,reverse:e,top:r,bottom:s}}(t);"middle"===r&&i&&(t.enableBorderRadius=!0,(i._top||0)===n?r=h:(i._bottom||0)===n?r=c:(s[un(c,o,a,l)]=!0,r=h)),s[un(r,o,a,l)]=!0,t.borderSkipped=s}function un(t,e,i,n){var r,s,o;return n?(o=i,t=fn(t=(r=t)===(s=e)?o:r===o?s:r,i,e)):t=fn(t,e,i),t}function fn(t,e,i){return"start"===t?e:"end"===t?i:t}function dn(t,{inflateAmount:e},i){t.inflateAmount="auto"===e?1===i?.33:0:e}class pn extends sn{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:t=>"spacing"!==t,_indexable:t=>"spacing"!==t};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:n}}=t.legend.options;return e.labels.map(((e,r)=>{const s=t.getDatasetMeta(0).controller.getStyle(r);return{text:e,fillStyle:s.backgroundColor,strokeStyle:s.borderColor,fontColor:n,lineWidth:s.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(r),index:r}}))}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}};constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,n=this._cachedMeta;if(!1===this._parsing)n._parsed=i;else{let r,s,o=t=>+i[t];if(et(i[t])){const{key:t="value"}=this._parsing;o=e=>+mt(i[e],t)}for(r=t,s=t+e;r<s;++r)n._parsed[r]=o(r)}}_getRotation(){return It(this.options.rotation-90)}_getCircumference(){return It(this.options.circumference)}_getRotationExtents(){let t=wt,e=-wt;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const n=this.chart.getDatasetMeta(i).controller,r=n._getRotation(),s=n._getCircumference();t=Math.min(t,r),e=Math.max(e,r+s)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,n=this._cachedMeta,r=n.data,s=this.getMaxBorderWidth()+this.getMaxOffset(r)+this.options.spacing,o=Math.max((Math.min(i.width,i.height)-s)/2,0),a=Math.min((l=this.options.cutout,h=o,"string"==typeof l&&l.endsWith("%")?parseFloat(l)/100:+l/h),1);var l,h;const c=this._getRingWeight(this.index),{circumference:u,rotation:f}=this._getRotationExtents(),{ratioX:d,ratioY:p,offsetX:g,offsetY:m}=function(t,e,i){let n=1,r=1,s=0,o=0;if(e<wt){const a=t,l=a+e,h=Math.cos(a),c=Math.sin(a),u=Math.cos(l),f=Math.sin(l),d=(t,e,n)=>Nt(t,a,l,!0)?1:Math.max(e,e*i,n,n*i),p=(t,e,n)=>Nt(t,a,l,!0)?-1:Math.min(e,e*i,n,n*i),g=d(0,h,u),m=d(Pt,c,f),b=p(yt,h,u),_=p(yt+Pt,c,f);n=(g-b)/2,r=(m-_)/2,s=-(g+b)/2,o=-(m+_)/2}return{ratioX:n,ratioY:r,offsetX:s,offsetY:o}}(f,u,a),b=(i.width-s)/d,_=(i.height-s)/p,x=Math.max(Math.min(b,_)/2,0),v=st(this.options.radius,x),y=(v-Math.max(v*a,0))/this._getVisibleDatasetWeightTotal();this.offsetX=g*v,this.offsetY=m*v,n.total=this.calculateTotal(),this.outerRadius=v-y*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-y*c,0),this.updateElements(r,0,r.length,t)}_circumference(t,e){const i=this.options,n=this._cachedMeta,r=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===n._parsed[t]||n.data[t].hidden?0:this.calculateCircumference(n._parsed[t]*r/wt)}updateElements(t,e,i,n){const r="reset"===n,s=this.chart,o=s.chartArea,a=s.options.animation,l=(o.left+o.right)/2,h=(o.top+o.bottom)/2,c=r&&a.animateScale,u=c?0:this.innerRadius,f=c?0:this.outerRadius,{sharedOptions:d,includeOptions:p}=this._getSharedOptions(e,n);let g,m=this._getRotation();for(g=0;g<e;++g)m+=this._circumference(g,r);for(g=e;g<e+i;++g){const e=this._circumference(g,r),i=t[g],s={x:l+this.offsetX,y:h+this.offsetY,startAngle:m,endAngle:m+e,circumference:e,outerRadius:f,innerRadius:u};p&&(s.options=d||this.resolveDataElementOptions(g,i.active?"active":n)),m+=e,this.updateElement(i,g,s,n)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let i,n=0;for(i=0;i<e.length;i++){const r=t._parsed[i];null===r||isNaN(r)||!this.chart.getDataVisibility(i)||e[i].hidden||(n+=Math.abs(r))}return n}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?wt*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],r=de(e._parsed[t],i.options.locale);return{label:n[t]||"",value:r}}getMaxBorderWidth(t){let e=0;const i=this.chart;let n,r,s,o,a;if(!t)for(n=0,r=i.data.datasets.length;n<r;++n)if(i.isDatasetVisible(n)){s=i.getDatasetMeta(n),t=s.data,o=s.controller;break}if(!t)return 0;for(n=0,r=t.length;n<r;++n)a=o.resolveDataElementOptions(n),"inner"!==a.borderAlign&&(e=Math.max(e,a.borderWidth||0,a.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,n=t.length;i<n;++i){const t=this.resolveDataElementOptions(i);e=Math.max(e,t.offset||0,t.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(t){return Math.max(rt(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class gn extends sn{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:n}}=t.legend.options;return e.labels.map(((e,r)=>{const s=t.getDatasetMeta(0).controller.getStyle(r);return{text:e,fillStyle:s.backgroundColor,strokeStyle:s.borderColor,fontColor:n,lineWidth:s.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(r),index:r}}))}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],r=de(e._parsed[t].r,i.options.locale);return{label:n[t]||"",value:r}}parseObjectData(t,e,i,n){return ai.bind(this)(t,e,i,n)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach(((t,i)=>{const n=this.getParsed(i).r;!isNaN(n)&&this.chart.getDataVisibility(i)&&(n<e.min&&(e.min=n),n>e.max&&(e.max=n))})),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,n=Math.min(e.right-e.left,e.bottom-e.top),r=Math.max(n/2,0),s=(r-Math.max(i.cutoutPercentage?r/100*i.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=r-s*this.index,this.innerRadius=this.outerRadius-s}updateElements(t,e,i,n){const r="reset"===n,s=this.chart,o=s.options.animation,a=this._cachedMeta.rScale,l=a.xCenter,h=a.yCenter,c=a.getIndexAngle(0)-.5*yt;let u,f=c;const d=360/this.countVisibleElements();for(u=0;u<e;++u)f+=this._computeAngle(u,n,d);for(u=e;u<e+i;u++){const e=t[u];let i=f,p=f+this._computeAngle(u,n,d),g=s.getDataVisibility(u)?a.getDistanceFromCenterForValue(this.getParsed(u).r):0;f=p,r&&(o.animateScale&&(g=0),o.animateRotate&&(i=p=c));const m={x:l,y:h,innerRadius:0,outerRadius:g,startAngle:i,endAngle:p,options:this.resolveDataElementOptions(u,e.active?"active":n)};this.updateElement(e,u,m,n)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach(((t,i)=>{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&e++})),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?It(this.resolveDataElementOptions(t,e).angle||i):0}}var mn=Object.freeze({__proto__:null,BarController:class extends sn{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,e,i,n){return ln(t,e,i,n)}parseArrayData(t,e,i,n){return ln(t,e,i,n)}parseObjectData(t,e,i,n){const{iScale:r,vScale:s}=t,{xAxisKey:o="x",yAxisKey:a="y"}=this._parsing,l="x"===r.axis?o:a,h="x"===s.axis?o:a,c=[];let u,f,d,p;for(u=i,f=i+n;u<f;++u)p=e[u],d={},d[r.axis]=r.parse(mt(p,l),u),c.push(an(mt(p,h),d,s,u));return c}updateRangeFromParsed(t,e,i,n){super.updateRangeFromParsed(t,e,i,n);const r=i._custom;r&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,r.min),t.max=Math.max(t.max,r.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:n}=e,r=this.getParsed(t),s=r._custom,o=hn(s)?"["+s.start+", "+s.end+"]":""+n.getLabelForValue(r[n.axis]);return{label:""+i.getLabelForValue(r[i.axis]),value:o}}initialize(){this.enableOptionSharing=!0,super.initialize(),this._cachedMeta.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,n){const r="reset"===n,{index:s,_cachedMeta:{vScale:o}}=this,a=o.getBasePixel(),l=o.isHorizontal(),h=this._getRuler(),{sharedOptions:c,includeOptions:u}=this._getSharedOptions(e,n);for(let f=e;f<e+i;f++){const e=this.getParsed(f),i=r||Q(e[o.axis])?{base:a,head:a}:this._calculateBarValuePixels(f),d=this._calculateBarIndexPixels(f,h),p=(e._stacks||{})[o.axis],g={horizontal:l,base:i.base,enableBorderRadius:!p||hn(e._custom)||s===p._top||s===p._bottom,x:l?i.head:d.center,y:l?d.center:i.head,height:l?d.size:Math.abs(i.size),width:l?Math.abs(i.size):d.size};u&&(g.options=c||this.resolveDataElementOptions(f,t[f].active?"active":n));const m=g.options||t[f].options;cn(g,m,p,s),dn(g,m,h.ratio),this.updateElement(t[f],f,g,n)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,n=i.getMatchingVisibleMetas(this._type).filter((t=>t.controller.options.grouped)),r=i.options.stacked,s=[],o=t=>{const i=t.controller.getParsed(e),n=i&&i[t.vScale.axis];if(Q(n)||isNaN(n))return!0};for(const a of n)if((void 0===e||!o(a))&&((!1===r||-1===s.indexOf(a.stack)||void 0===r&&void 0===a.stack)&&s.push(a.stack),a.index===t))break;return s.length||s.push(void 0),s}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const n=this._getStacks(t,i),r=void 0!==e?n.indexOf(e):-1;return-1===r?n.length-1:r}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,n=[];let r,s;for(r=0,s=e.data.length;r<s;++r)n.push(i.getPixelForValue(this.getParsed(r)[i.axis],r));const o=t.barThickness;return{min:o||on(e),pixels:n,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:o?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:n},options:{base:r,minBarLength:s}}=this,o=r||0,a=this.getParsed(t),l=a._custom,h=hn(l);let c,u,f=a[e.axis],d=0,p=i?this.applyStack(e,a,i):f;p!==f&&(d=p-f,p=f),h&&(f=l.barStart,p=l.barEnd-l.barStart,0!==f&&Ct(f)!==Ct(l.barEnd)&&(d=0),d+=f);const g=Q(r)||h?d:r;let m=e.getPixelForValue(g);if(c=this.chart.getDataVisibility(t)?e.getPixelForValue(d+p):m,u=c-m,Math.abs(u)<s){u=function(t,e,i){return 0!==t?Ct(t):(e.isHorizontal()?1:-1)*(e.min>=i?1:-1)}(u,e,o)*s,f===o&&(m-=u/2);const t=e.getPixelForDecimal(0),r=e.getPixelForDecimal(1),l=Math.min(t,r),d=Math.max(t,r);m=Math.max(Math.min(m,d),l),c=m+u,i&&!h&&(a._stacks[e.axis]._visualValues[n]=e.getValueForPixel(c)-e.getValueForPixel(m))}if(m===e.getPixelForValue(o)){const t=Ct(u)*e.getLineWidthForValue(o)/2;m+=t,u-=t}return{size:u,base:m,head:c,center:c+u/2}}_calculateBarIndexPixels(t,e){const i=e.scale,n=this.options,r=n.skipNull,s=rt(n.maxBarThickness,1/0);let o,a;if(e.grouped){const i=r?this._getStackCount(t):e.stackCount,l="flex"===n.barThickness?function(t,e,i,n){const r=e.pixels,s=r[t];let o=t>0?r[t-1]:null,a=t<r.length-1?r[t+1]:null;const l=i.categoryPercentage;null===o&&(o=s-(null===a?e.end-e.start:a-s)),null===a&&(a=s+s-o);const h=s-(s-Math.min(o,a))/2*l;return{chunk:Math.abs(a-o)/2*l/n,ratio:i.barPercentage,start:h}}(t,e,n,i):function(t,e,i,n){const r=i.barThickness;let s,o;return Q(r)?(s=e.min*i.categoryPercentage,o=i.barPercentage):(s=r*n,o=1),{chunk:s/n,ratio:o,start:e.pixels[t]-s/2}}(t,e,n,i),h=this._getStackIndex(this.index,this._cachedMeta.stack,r?t:void 0);o=l.start+l.chunk*h+l.chunk/2,a=Math.min(s,l.chunk*l.ratio)}else o=i.getPixelForValue(this.getParsed(t)[i.axis],t),a=Math.min(s,e.min*e.ratio);return{base:o-a/2,head:o+a/2,center:o,size:a}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,n=i.length;let r=0;for(;r<n;++r)null!==this.getParsed(r)[e.axis]&&i[r].draw(this._ctx)}},BubbleController:class extends sn{static id="bubble";static defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};static overrides={scales:{x:{type:"linear"},y:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,n){const r=super.parsePrimitiveData(t,e,i,n);for(let s=0;s<r.length;s++)r[s]._custom=this.resolveDataElementOptions(s+i).radius;return r}parseArrayData(t,e,i,n){const r=super.parseArrayData(t,e,i,n);for(let s=0;s<r.length;s++){const t=e[i+s];r[s]._custom=rt(t[2],this.resolveDataElementOptions(s+i).radius)}return r}parseObjectData(t,e,i,n){const r=super.parseObjectData(t,e,i,n);for(let s=0;s<r.length;s++){const t=e[i+s];r[s]._custom=rt(t&&t.r&&+t.r,this.resolveDataElementOptions(s+i).radius)}return r}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:n,yScale:r}=e,s=this.getParsed(t),o=n.getLabelForValue(s.x),a=r.getLabelForValue(s.y),l=s._custom;return{label:i[t]||"",value:"("+o+", "+a+(l?", "+l:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,n){const r="reset"===n,{iScale:s,vScale:o}=this._cachedMeta,{sharedOptions:a,includeOptions:l}=this._getSharedOptions(e,n),h=s.axis,c=o.axis;for(let u=e;u<e+i;u++){const e=t[u],i=!r&&this.getParsed(u),f={},d=f[h]=r?s.getPixelForDecimal(.5):s.getPixelForValue(i[h]),p=f[c]=r?o.getBasePixel():o.getPixelForValue(i[c]);f.skip=isNaN(d)||isNaN(p),l&&(f.options=a||this.resolveDataElementOptions(u,e.active?"active":n),r&&(f.options.radius=0)),this.updateElement(e,u,f,n)}}resolveDataElementOptions(t,e){const i=this.getParsed(t);let n=super.resolveDataElementOptions(t,e);n.$shared&&(n=Object.assign({},n,{$shared:!1}));const r=n.radius;return"active"!==e&&(n.radius=0),n.radius+=rt(i&&i._custom,r),n}},DoughnutController:pn,LineController:class extends sn{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:n=[],_dataset:r}=e,s=this.chart._animationsDisabled;let{start:o,count:a}=ee(e,n,s);this._drawStart=o,this._drawCount=a,ie(e)&&(o=0,a=n.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!r._decimated,i.points=n;const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(i,void 0,{animated:!s,options:l},t),this.updateElements(n,o,a,t)}updateElements(t,e,i,n){const r="reset"===n,{iScale:s,vScale:o,_stacked:a,_dataset:l}=this._cachedMeta,{sharedOptions:h,includeOptions:c}=this._getSharedOptions(e,n),u=s.axis,f=o.axis,{spanGaps:d,segment:p}=this.options,g=Lt(d)?d:Number.POSITIVE_INFINITY,m=this.chart._animationsDisabled||r||"none"===n,b=e+i,_=t.length;let x=e>0&&this.getParsed(e-1);for(let v=0;v<_;++v){const i=t[v],d=m?i:{};if(v<e||v>=b){d.skip=!0;continue}const _=this.getParsed(v),y=Q(_[f]),w=d[u]=s.getPixelForValue(_[u],v),k=d[f]=r||y?o.getBasePixel():o.getPixelForValue(a?this.applyStack(o,_,a):_[f],v);d.skip=isNaN(w)||isNaN(k)||y,d.stop=v>0&&Math.abs(_[u]-x[u])>g,p&&(d.parsed=_,d.raw=l.data[v]),c&&(d.options=h||this.resolveDataElementOptions(v,i.active?"active":n)),m||this.updateElement(i,v,d,n),x=_}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return i;const r=n[0].size(this.resolveDataElementOptions(0)),s=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,r,s)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}},PolarAreaController:gn,PieController:class extends pn{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}},RadarController:class extends sn{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,n){return ai.bind(this)(t,e,i,n)}update(t){const e=this._cachedMeta,i=e.dataset,n=e.data||[],r=e.iScale.getLabels();if(i.points=n,"resize"!==t){const e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);const s={_loop:!0,_fullLoop:r.length===n.length,options:e};this.updateElement(i,void 0,s,t)}this.updateElements(n,0,n.length,t)}updateElements(t,e,i,n){const r=this._cachedMeta.rScale,s="reset"===n;for(let o=e;o<e+i;o++){const e=t[o],i=this.resolveDataElementOptions(o,e.active?"active":n),a=r.getPointPositionForValue(o,this.getParsed(o).r),l=s?r.xCenter:a.x,h=s?r.yCenter:a.y,c={x:l,y:h,angle:a.angle,skip:isNaN(l)||isNaN(h),options:i};this.updateElement(e,o,c,n)}}},ScatterController:class extends sn{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:n,yScale:r}=e,s=this.getParsed(t),o=n.getLabelForValue(s.x),a=r.getLabelForValue(s.y);return{label:i[t]||"",value:"("+o+", "+a+")"}}update(t){const e=this._cachedMeta,{data:i=[]}=e,n=this.chart._animationsDisabled;let{start:r,count:s}=ee(e,i,n);if(this._drawStart=r,this._drawCount=s,ie(e)&&(r=0,s=i.length),this.options.showLine){const{dataset:r,_dataset:s}=e;r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!s._decimated,r.points=i;const o=this.resolveDatasetElementOptions(t);o.segment=this.options.segment,this.updateElement(r,void 0,{animated:!n,options:o},t)}this.updateElements(i,r,s,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,i,n){const r="reset"===n,{iScale:s,vScale:o,_stacked:a,_dataset:l}=this._cachedMeta,h=this.resolveDataElementOptions(e,n),c=this.getSharedOptions(h),u=this.includeOptions(n,c),f=s.axis,d=o.axis,{spanGaps:p,segment:g}=this.options,m=Lt(p)?p:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||r||"none"===n;let _=e>0&&this.getParsed(e-1);for(let x=e;x<e+i;++x){const e=t[x],i=this.getParsed(x),h=b?e:{},p=Q(i[d]),v=h[f]=s.getPixelForValue(i[f],x),y=h[d]=r||p?o.getBasePixel():o.getPixelForValue(a?this.applyStack(o,i,a):i[d],x);h.skip=isNaN(v)||isNaN(y)||p,h.stop=x>0&&Math.abs(i[f]-_[f])>m,g&&(h.parsed=i,h.raw=l.data[x]),u&&(h.options=c||this.resolveDataElementOptions(x,e.active?"active":n)),b||this.updateElement(e,x,h,n),_=i}this.updateSharedOptions(c,n,h)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let t=0;for(let i=e.length-1;i>=0;--i)t=Math.max(t,e[i].size(this.resolveDataElementOptions(i))/2);return t>0&&t}const i=t.dataset,n=i.options&&i.options.borderWidth||0;if(!e.length)return n;const r=e[0].size(this.resolveDataElementOptions(0)),s=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(n,r,s)/2}}});function bn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class _n{static override(t){Object.assign(_n.prototype,t)}constructor(t){this.options=t||{}}init(){}formats(){return bn()}parse(){return bn()}format(){return bn()}add(){return bn()}diff(){return bn()}startOf(){return bn()}endOf(){return bn()}}var xn=_n;function vn(t,e,i,n){const{controller:r,data:s,_sorted:o}=t,a=r._cachedMeta.iScale;if(a&&e===a.axis&&"r"!==e&&o&&s.length){const t=a._reversePixels?qt:Yt;if(!n)return t(s,e,i);if(r._sharedOptions){const n=s[0],r="function"==typeof n.getRange&&n.getRange(e);if(r){const n=t(s,e,i-r),o=t(s,e,i+r);return{lo:n.lo,hi:o.hi}}}}return{lo:0,hi:s.length-1}}function yn(t,e,i,n,r){const s=t.getSortedVisibleDatasetMetas(),o=i[e];for(let a=0,l=s.length;a<l;++a){const{index:t,data:i}=s[a],{lo:l,hi:h}=vn(s[a],e,o,r);for(let e=l;e<=h;++e){const r=i[e];r.skip||n(r,t,e)}}}function wn(t,e,i,n,r){const s=[];return r||t.isPointInArea(e)?(yn(t,i,e,(function(i,o,a){(r||Oe(i,t.chartArea,0))&&i.inRange(e.x,e.y,n)&&s.push({element:i,datasetIndex:o,index:a})}),!0),s):s}function kn(t,e,i,n,r,s){let o=[];const a=function(t){const e=-1!==t.indexOf("x"),i=-1!==t.indexOf("y");return function(t,n){const r=e?Math.abs(t.x-n.x):0,s=i?Math.abs(t.y-n.y):0;return Math.sqrt(Math.pow(r,2)+Math.pow(s,2))}}(i);let l=Number.POSITIVE_INFINITY;return yn(t,i,e,(function(i,h,c){const u=i.inRange(e.x,e.y,r);if(n&&!u)return;const f=i.getCenterPoint(r);if(!s&&!t.isPointInArea(f)&&!u)return;const d=a(e,f);d<l?(o=[{element:i,datasetIndex:h,index:c}],l=d):d===l&&o.push({element:i,datasetIndex:h,index:c})})),o}function Mn(t,e,i,n,r,s){return s||t.isPointInArea(e)?"r"!==i||n?kn(t,e,i,n,r,s):function(t,e,i,n){let r=[];return yn(t,i,e,(function(t,i,s){const{startAngle:o,endAngle:a}=t.getProps(["startAngle","endAngle"],n),{angle:l}=jt(t,{x:e.x,y:e.y});Nt(l,o,a)&&r.push({element:t,datasetIndex:i,index:s})})),r}(t,e,i,r):[]}function Sn(t,e,i,n,r){const s=[],o="x"===i?"inXRange":"inYRange";let a=!1;return yn(t,i,e,((t,n,l)=>{t[o](e[i],r)&&(s.push({element:t,datasetIndex:n,index:l}),a=a||t.inRange(e.x,e.y,r))})),n&&!a?[]:s}var Pn={evaluateInteractionItems:yn,modes:{index(t,e,i,n){const r=wi(e,t),s=i.axis||"x",o=i.includeInvisible||!1,a=i.intersect?wn(t,r,s,n,o):Mn(t,r,s,!1,n,o),l=[];return a.length?(t.getSortedVisibleDatasetMetas().forEach((t=>{const e=a[0].index,i=t.data[e];i&&!i.skip&&l.push({element:i,datasetIndex:t.index,index:e})})),l):[]},dataset(t,e,i,n){const r=wi(e,t),s=i.axis||"xy",o=i.includeInvisible||!1;let a=i.intersect?wn(t,r,s,n,o):Mn(t,r,s,!1,n,o);if(a.length>0){const e=a[0].datasetIndex,i=t.getDatasetMeta(e).data;a=[];for(let t=0;t<i.length;++t)a.push({element:i[t],datasetIndex:e,index:t})}return a},point:(t,e,i,n)=>wn(t,wi(e,t),i.axis||"xy",n,i.includeInvisible||!1),nearest(t,e,i,n){const r=wi(e,t),s=i.axis||"xy",o=i.includeInvisible||!1;return Mn(t,r,s,i.intersect,n,o)},x:(t,e,i,n)=>Sn(t,wi(e,t),"x",i.intersect,n),y:(t,e,i,n)=>Sn(t,wi(e,t),"y",i.intersect,n)}};const An=["left","top","right","bottom"];function On(t,e){return t.filter((t=>t.pos===e))}function Dn(t,e){return t.filter((t=>-1===An.indexOf(t.pos)&&t.box.axis===e))}function Cn(t,e){return t.sort(((t,i)=>{const n=e?i:t,r=e?t:i;return n.weight===r.weight?n.index-r.index:n.weight-r.weight}))}function Tn(t,e){const i=function(t){const e={};for(const i of t){const{stack:t,pos:n,stackWeight:r}=i;if(!t||!An.includes(n))continue;const s=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});s.count++,s.weight+=r}return e}(t),{vBoxMaxWidth:n,hBoxMaxHeight:r}=e;let s,o,a;for(s=0,o=t.length;s<o;++s){a=t[s];const{fullSize:o}=a.box,l=i[a.stack],h=l&&a.stackWeight/l.weight;a.horizontal?(a.width=h?h*n:o&&e.availableWidth,a.height=r):(a.width=n,a.height=h?h*r:o&&e.availableHeight)}return i}function En(t,e,i,n){return Math.max(t[i],e[i])+Math.max(t[n],e[n])}function Ln(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function Rn(t,e,i,n){const{pos:r,box:s}=i,o=t.maxPadding;if(!et(r)){i.size&&(t[r]-=i.size);const e=n[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?s.height:s.width),i.size=e.size/e.count,t[r]+=i.size}s.getPadding&&Ln(o,s.getPadding());const a=Math.max(0,e.outerWidth-En(o,t,"left","right")),l=Math.max(0,e.outerHeight-En(o,t,"top","bottom")),h=a!==t.w,c=l!==t.h;return t.w=a,t.h=l,i.horizontal?{same:h,other:c}:{same:c,other:h}}function In(t,e){const i=e.maxPadding;function n(t){const n={left:0,top:0,right:0,bottom:0};return t.forEach((t=>{n[t]=Math.max(e[t],i[t])})),n}return n(t?["left","right"]:["top","bottom"])}function zn(t,e,i,n){const r=[];let s,o,a,l,h,c;for(s=0,o=t.length,h=0;s<o;++s){a=t[s],l=a.box,l.update(a.width||e.w,a.height||e.h,In(a.horizontal,e));const{same:o,other:u}=Rn(e,i,a,n);h|=o&&r.length,c=c||u,l.fullSize||r.push(a)}return h&&zn(r,e,i,n)||c}function Fn(t,e,i,n,r){t.top=i,t.left=e,t.right=e+n,t.bottom=i+r,t.width=n,t.height=r}function jn(t,e,i,n){const r=i.padding;let{x:s,y:o}=e;for(const a of t){const t=a.box,l=n[a.stack]||{count:1,placed:0,weight:1},h=a.stackWeight/l.weight||1;if(a.horizontal){const n=e.w*h,s=l.size||t.height;_t(l.start)&&(o=l.start),t.fullSize?Fn(t,r.left,o,i.outerWidth-r.right-r.left,s):Fn(t,e.left+l.placed,o,n,s),l.start=o,l.placed+=n,o=t.bottom}else{const n=e.h*h,o=l.size||t.width;_t(l.start)&&(s=l.start),t.fullSize?Fn(t,s,r.top,o,i.outerHeight-r.bottom-r.top):Fn(t,s,e.top+l.placed,o,n),l.start=s,l.placed+=n,s=t.right}}e.x=s,e.y=o}var Vn={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},t.boxes.push(e)},removeBox(t,e){const i=t.boxes?t.boxes.indexOf(e):-1;-1!==i&&t.boxes.splice(i,1)},configure(t,e,i){e.fullSize=i.fullSize,e.position=i.position,e.weight=i.weight},update(t,e,i,n){if(!t)return;const r=$e(t.options.layout.padding),s=Math.max(e-r.width,0),o=Math.max(i-r.height,0),a=function(t){const e=function(t){const e=[];let i,n,r,s,o,a;for(i=0,n=(t||[]).length;i<n;++i)r=t[i],({position:s,options:{stack:o,stackWeight:a=1}}=r),e.push({index:i,box:r,pos:s,horizontal:r.isHorizontal(),weight:r.weight,stack:o&&s+o,stackWeight:a});return e}(t),i=Cn(e.filter((t=>t.box.fullSize)),!0),n=Cn(On(e,"left"),!0),r=Cn(On(e,"right")),s=Cn(On(e,"top"),!0),o=Cn(On(e,"bottom")),a=Dn(e,"x"),l=Dn(e,"y");return{fullSize:i,leftAndTop:n.concat(s),rightAndBottom:r.concat(l).concat(o).concat(a),chartArea:On(e,"chartArea"),vertical:n.concat(r).concat(l),horizontal:s.concat(o).concat(a)}}(t.boxes),l=a.vertical,h=a.horizontal;at(t.boxes,(t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()}));const c=l.reduce(((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1),0)||1,u=Object.freeze({outerWidth:e,outerHeight:i,padding:r,availableWidth:s,availableHeight:o,vBoxMaxWidth:s/2/c,hBoxMaxHeight:o/2}),f=Object.assign({},r);Ln(f,$e(n));const d=Object.assign({maxPadding:f,w:s,h:o,x:r.left,y:r.top},r),p=Tn(l.concat(h),u);zn(a.fullSize,d,u,p),zn(l,d,u,p),zn(h,d,u,p)&&zn(l,d,u,p),function(t){const e=t.maxPadding;function i(i){const n=Math.max(e[i]-t[i],0);return t[i]+=n,n}t.y+=i("top"),t.x+=i("left"),i("right"),i("bottom")}(d),jn(a.leftAndTop,d,u,p),d.x+=d.w,d.y+=d.h,jn(a.rightAndBottom,d,u,p),t.chartArea={left:d.left,top:d.top,right:d.left+d.w,bottom:d.top+d.h,height:d.h,width:d.w},at(a.chartArea,(e=>{const i=e.box;Object.assign(i,t.chartArea),i.update(d.w,d.h,{left:0,top:0,right:0,bottom:0})}))}};class Bn{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,n){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):i)}}isAttached(t){return!0}updateConfig(t){}}class Wn extends Bn{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Nn="$chartjs",Hn={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},$n=t=>null===t||""===t,Un=!!Pi&&{passive:!0};function Yn(t,e,i){t.canvas.removeEventListener(e,i,Un)}function qn(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function Xn(t,e,i){const n=t.canvas,r=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||qn(i.addedNodes,n),e=e&&!qn(i.removedNodes,n);e&&i()}));return r.observe(document,{childList:!0,subtree:!0}),r}function Kn(t,e,i){const n=t.canvas,r=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||qn(i.removedNodes,n),e=e&&!qn(i.addedNodes,n);e&&i()}));return r.observe(document,{childList:!0,subtree:!0}),r}const Zn=new Map;let Gn=0;function Jn(){const t=window.devicePixelRatio;t!==Gn&&(Gn=t,Zn.forEach(((e,i)=>{i.currentDevicePixelRatio!==t&&e()})))}function Qn(t,e,i){const n=t.canvas,r=n&&mi(n);if(!r)return;const s=Jt(((t,e)=>{const n=r.clientWidth;i(t,e),n<r.clientWidth&&i()}),window),o=new ResizeObserver((t=>{const e=t[0],i=e.contentRect.width,n=e.contentRect.height;0===i&&0===n||s(i,n)}));return o.observe(r),function(t,e){Zn.size||window.addEventListener("resize",Jn),Zn.set(t,e)}(t,s),o}function tr(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){Zn.delete(t),Zn.size||window.removeEventListener("resize",Jn)}(t)}function er(t,e,i){const n=t.canvas,r=Jt((e=>{null!==t.ctx&&i(function(t,e){const i=Hn[t.type]||t.type,{x:n,y:r}=wi(t,e);return{type:i,chart:e,native:t,x:void 0!==n?n:null,y:void 0!==r?r:null}}(e,t))}),t);return function(t,e,i){t.addEventListener(e,i,Un)}(n,e,r),r}class ir extends Bn{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(function(t,e){const i=t.style,n=t.getAttribute("height"),r=t.getAttribute("width");if(t[Nn]={initial:{height:n,width:r,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",$n(r)){const e=Ai(t,"width");void 0!==e&&(t.width=e)}if($n(n))if(""===t.style.height)t.height=t.width/(e||2);else{const e=Ai(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[Nn])return!1;const i=e[Nn].initial;["height","width"].forEach((t=>{const n=i[t];Q(n)?e.removeAttribute(t):e.setAttribute(t,n)}));const n=i.style||{};return Object.keys(n).forEach((t=>{e.style[t]=n[t]})),e.width=e.width,delete e[Nn],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),r={attach:Xn,detach:Kn,resize:Qn}[e]||er;n[e]=r(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),n=i[e];n&&(({attach:tr,detach:tr,resize:tr}[e]||Yn)(t,e,n),i[e]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,n){return Mi(t,e,i,n)}isAttached(t){const e=mi(t);return!(!e||!e.isConnected)}}class nr{static defaults={};static defaultRoutes=void 0;active=!1;tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return Lt(this.x)&&Lt(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const n={};return t.forEach((t=>{n[t]=i[t]&&i[t].active()?i[t]._to:this[t]})),n}}function rr(t,e){const i=t.options.ticks,n=function(t){const e=t.options.offset,i=t._tickSize(),n=t._length/i+(e?0:1),r=t._maxLength/i;return Math.floor(Math.min(n,r))}(t),r=Math.min(i.maxTicksLimit||n,n),s=i.major.enabled?function(t){const e=[];let i,n;for(i=0,n=t.length;i<n;i++)t[i].major&&e.push(i);return e}(e):[],o=s.length,a=s[0],l=s[o-1],h=[];if(o>r)return function(t,e,i,n){let r,s=0,o=i[0];for(n=Math.ceil(n),r=0;r<t.length;r++)r===o&&(e.push(t[r]),s++,o=i[s*n])}(e,h,s,o/r),h;const c=function(t,e,i){const n=function(t){const e=t.length;let i,n;if(e<2)return!1;for(n=t[0],i=1;i<e;++i)if(t[i]-t[i-1]!==n)return!1;return n}(t),r=e.length/i;if(!n)return Math.max(r,1);const s=function(t){const e=[],i=Math.sqrt(t);let n;for(n=1;n<i;n++)t%n==0&&(e.push(n),e.push(t/n));return i===(0|i)&&e.push(i),e.sort(((t,e)=>t-e)).pop(),e}(n);for(let o=0,a=s.length-1;o<a;o++){const t=s[o];if(t>r)return t}return Math.max(r,1)}(s,e,r);if(o>0){let t,i;const n=o>1?Math.round((l-a)/(o-1)):null;for(sr(e,h,c,Q(n)?0:a-n,a),t=0,i=o-1;t<i;t++)sr(e,h,c,s[t],s[t+1]);return sr(e,h,c,l,Q(n)?e.length:l+n),h}return sr(e,h,c),h}function sr(t,e,i,n,r){const s=rt(n,0),o=Math.min(rt(r,t.length),t.length);let a,l,h,c=0;for(i=Math.ceil(i),r&&(a=r-n,i=a/Math.floor(a/i)),h=s;h<0;)c++,h=Math.round(s+c*i);for(l=Math.max(s,0);l<o;l++)l===h&&(e.push(t[l]),c++,h=Math.round(s+c*i))}const or=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i,ar=(t,e)=>Math.min(e||t,t);function lr(t,e){const i=[],n=t.length/e,r=t.length;let s=0;for(;s<r;s+=n)i.push(t[Math.floor(s)]);return i}function hr(t,e,i){const n=t.ticks.length,r=Math.min(e,n-1),s=t._startPixel,o=t._endPixel,a=1e-6;let l,h=t.getPixelForTick(r);if(!(i&&(l=1===n?Math.max(h-s,o-h):0===e?(t.getPixelForTick(1)-h)/2:(h-t.getPixelForTick(r-1))/2,h+=r<e?l:-l,h<s-a||h>o+a)))return h}function cr(t){return t.drawTicks?t.tickLength:0}function ur(t,e){if(!t.display)return 0;const i=Ue(t.font,e),n=$e(t.padding);return(tt(t.text)?t.text.length:1)*i.lineHeight+n.height}function fr(t,e,i){let n=Qt(t);return(i&&"right"!==e||!i&&"right"===e)&&(n=(t=>"left"===t?"right":"right"===t?"left":t)(n)),n}class dr extends nr{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:n}=this;return t=nt(t,Number.POSITIVE_INFINITY),e=nt(e,Number.NEGATIVE_INFINITY),i=nt(i,Number.POSITIVE_INFINITY),n=nt(n,Number.NEGATIVE_INFINITY),{min:nt(t,i),max:nt(e,n),minDefined:it(t),maxDefined:it(e)}}getMinMax(t){let e,{min:i,max:n,minDefined:r,maxDefined:s}=this.getUserBounds();if(r&&s)return{min:i,max:n};const o=this.getMatchingVisibleMetas();for(let a=0,l=o.length;a<l;++a)e=o[a].controller.getMinMax(this,t),r||(i=Math.min(i,e.min)),s||(n=Math.max(n,e.max));return i=s&&i>n?n:i,n=r&&i>n?i:n,{min:nt(i,nt(n,i)),max:nt(n,nt(i,n))}}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(){ot(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:n,grace:r,ticks:s}=this.options,o=s.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,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=function(t,e,i){const{min:n,max:r}=t,s=st(e,(r-n)/2),o=(t,e)=>i&&0===t?0:t+e;return{min:o(n,-Math.abs(s)),max:o(r,s)}}(this,r,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=o<this.ticks.length;this._convertTicksToLabels(a?lr(this.ticks,o):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),s.display&&(s.autoSkip||"auto"===s.source)&&(this.ticks=rr(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),a&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t,e,i=this.options.reverse;this.isHorizontal()?(t=this.left,e=this.right):(t=this.top,e=this.bottom,i=!i),this._startPixel=t,this._endPixel=e,this._reversePixels=i,this._length=e-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){ot(this.options.afterUpdate,[this])}beforeSetDimensions(){ot(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){ot(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),ot(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){ot(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,n,r;for(i=0,n=t.length;i<n;i++)r=t[i],r.label=ot(e.callback,[r.value,i,t],this)}afterTickToLabelConversion(){ot(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){ot(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=ar(this.ticks.length,t.ticks.maxTicksLimit),n=e.minRotation||0,r=e.maxRotation;let s,o,a,l=n;if(!this._isVisible()||!e.display||n>=r||i<=1||!this.isHorizontal())return void(this.labelRotation=n);const h=this._getLabelSizes(),c=h.widest.width,u=h.highest.height,f=Ht(this.chart.width-c,0,this.maxWidth);s=t.offset?this.maxWidth/i:f/(i-1),c+6>s&&(s=f/(i-(t.offset?.5:1)),o=this.maxHeight-cr(t.grid)-e.padding-ur(t.title,this.chart.options.font),a=Math.sqrt(c*c+u*u),l=zt(Math.min(Math.asin(Ht((h.highest.height+6)/s,-1,1)),Math.asin(Ht(o/a,-1,1))-Math.asin(Ht(u/a,-1,1)))),l=Math.max(n,Math.min(r,l))),this.labelRotation=l}afterCalculateLabelRotation(){ot(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){ot(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:n,grid:r}}=this,s=this._isVisible(),o=this.isHorizontal();if(s){const s=ur(n,e.options.font);if(o?(t.width=this.maxWidth,t.height=cr(r)+s):(t.height=this.maxHeight,t.width=cr(r)+s),i.display&&this.ticks.length){const{first:e,last:n,widest:r,highest:s}=this._getLabelSizes(),a=2*i.padding,l=It(this.labelRotation),h=Math.cos(l),c=Math.sin(l);if(o){const e=i.mirror?0:c*r.width+h*s.height;t.height=Math.min(this.maxHeight,t.height+e+a)}else{const e=i.mirror?0:h*r.width+c*s.height;t.width=Math.min(this.maxWidth,t.width+e+a)}this._calculatePadding(e,n,c,h)}}this._handleMargins(),o?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,n){const{ticks:{align:r,padding:s},position:o}=this.options,a=0!==this.labelRotation,l="top"!==o&&"x"===this.axis;if(this.isHorizontal()){const o=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1);let c=0,u=0;a?l?(c=n*t.width,u=i*e.height):(c=i*t.height,u=n*e.width):"start"===r?u=e.width:"end"===r?c=t.width:"inner"!==r&&(c=t.width/2,u=e.width/2),this.paddingLeft=Math.max((c-o+s)*this.width/(this.width-o),0),this.paddingRight=Math.max((u-h+s)*this.width/(this.width-h),0)}else{let i=e.height/2,n=t.height/2;"start"===r?(i=0,n=t.height):"end"===r&&(i=e.height,n=0),this.paddingTop=i+s,this.paddingBottom=n+s}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){ot(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e<i;e++)Q(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=lr(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:n,_longestTextCache:r}=this,s=[],o=[],a=Math.floor(e/ar(e,i));let l,h,c,u,f,d,p,g,m,b,_,x=0,v=0;for(l=0;l<e;l+=a){if(u=t[l].label,f=this._resolveTickFontOptions(l),n.font=d=f.string,p=r[d]=r[d]||{data:{},gc:[]},g=f.lineHeight,m=b=0,Q(u)||tt(u)){if(tt(u))for(h=0,c=u.length;h<c;++h)_=u[h],Q(_)||tt(_)||(m=we(n,p.data,p.gc,m,_),b+=g)}else m=we(n,p.data,p.gc,m,u),b=g;s.push(m),o.push(b),x=Math.max(m,x),v=Math.max(b,v)}!function(t,e){at(t,(t=>{const i=t.gc,n=i.length/2;let r;if(n>e){for(r=0;r<n;++r)delete t.data[i[r]];i.splice(0,n)}}))}(r,e);const y=s.indexOf(x),w=o.indexOf(v),k=t=>({width:s[t]||0,height:o[t]||0});return{first:k(0),last:k(e-1),widest:k(y),highest:k(w),widths:s,heights:o}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return Ht(this._alignToPixels?Me(this.chart,e,0):e,-32768,32767)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const i=e[t];return i.$context||(i.$context=function(t,e,i){return qe(t,{tick:i,index:e,type:"tick"})}(this.getContext(),t,i))}return this.$context||(this.$context=qe(this.chart.getContext(),{scale:this,type:"scale"}))}_tickSize(){const t=this.options.ticks,e=It(this.labelRotation),i=Math.abs(Math.cos(e)),n=Math.abs(Math.sin(e)),r=this._getLabelSizes(),s=t.autoSkipPadding||0,o=r?r.widest.width+s:0,a=r?r.highest.height+s:0;return this.isHorizontal()?a*i>o*n?o/i:a/n:a*n<o*i?a/i:o/n}_isVisible(){const t=this.options.display;return"auto"!==t?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,n=this.options,{grid:r,position:s,border:o}=n,a=r.offset,l=this.isHorizontal(),h=this.ticks.length+(a?1:0),c=cr(r),u=[],f=o.setContext(this.getContext()),d=f.display?f.width:0,p=d/2,g=function(t){return Me(i,t,d)};let m,b,_,x,v,y,w,k,M,S,P,A;if("top"===s)m=g(this.bottom),y=this.bottom-c,k=m-p,S=g(t.top)+p,A=t.bottom;else if("bottom"===s)m=g(this.top),S=t.top,A=g(t.bottom)-p,y=m+p,k=this.top+c;else if("left"===s)m=g(this.right),v=this.right-c,w=m-p,M=g(t.left)+p,P=t.right;else if("right"===s)m=g(this.left),M=t.left,P=g(t.right)-p,v=m+p,w=this.left+c;else if("x"===e){if("center"===s)m=g((t.top+t.bottom)/2+.5);else if(et(s)){const t=Object.keys(s)[0],e=s[t];m=g(this.chart.scales[t].getPixelForValue(e))}S=t.top,A=t.bottom,y=m+p,k=y+c}else if("y"===e){if("center"===s)m=g((t.left+t.right)/2);else if(et(s)){const t=Object.keys(s)[0],e=s[t];m=g(this.chart.scales[t].getPixelForValue(e))}v=m-p,w=v-c,M=t.left,P=t.right}const O=rt(n.ticks.maxTicksLimit,h),D=Math.max(1,Math.ceil(h/O));for(b=0;b<h;b+=D){const t=this.getContext(b),e=r.setContext(t),n=o.setContext(t),s=e.lineWidth,h=e.color,c=n.dash||[],f=n.dashOffset,d=e.tickWidth,p=e.tickColor,g=e.tickBorderDash||[],m=e.tickBorderDashOffset;_=hr(this,b,a),void 0!==_&&(x=Me(i,_,s),l?v=w=M=P=x:y=k=S=A=x,u.push({tx1:v,ty1:y,tx2:w,ty2:k,x1:M,y1:S,x2:P,y2:A,width:s,color:h,borderDash:c,borderDashOffset:f,tickWidth:d,tickColor:p,tickBorderDash:g,tickBorderDashOffset:m}))}return this._ticksLength=h,this._borderValue=m,u}_computeLabelItems(t){const e=this.axis,i=this.options,{position:n,ticks:r}=i,s=this.isHorizontal(),o=this.ticks,{align:a,crossAlign:l,padding:h,mirror:c}=r,u=cr(i.grid),f=u+h,d=c?-h:f,p=-It(this.labelRotation),g=[];let m,b,_,x,v,y,w,k,M,S,P,A,O="middle";if("top"===n)y=this.bottom-d,w=this._getXAxisLabelAlignment();else if("bottom"===n)y=this.top+d,w=this._getXAxisLabelAlignment();else if("left"===n){const t=this._getYAxisLabelAlignment(u);w=t.textAlign,v=t.x}else if("right"===n){const t=this._getYAxisLabelAlignment(u);w=t.textAlign,v=t.x}else if("x"===e){if("center"===n)y=(t.top+t.bottom)/2+f;else if(et(n)){const t=Object.keys(n)[0],e=n[t];y=this.chart.scales[t].getPixelForValue(e)+f}w=this._getXAxisLabelAlignment()}else if("y"===e){if("center"===n)v=(t.left+t.right)/2-f;else if(et(n)){const t=Object.keys(n)[0],e=n[t];v=this.chart.scales[t].getPixelForValue(e)}w=this._getYAxisLabelAlignment(u).textAlign}"y"===e&&("start"===a?O="top":"end"===a&&(O="bottom"));const D=this._getLabelSizes();for(m=0,b=o.length;m<b;++m){_=o[m],x=_.label;const t=r.setContext(this.getContext(m));k=this.getPixelForTick(m)+r.labelOffset,M=this._resolveTickFontOptions(m),S=M.lineHeight,P=tt(x)?x.length:1;const e=P/2,i=t.color,a=t.textStrokeColor,h=t.textStrokeWidth;let u,f=w;if(s?(v=k,"inner"===w&&(f=m===b-1?this.options.reverse?"left":"right":0===m?this.options.reverse?"right":"left":"center"),A="top"===n?"near"===l||0!==p?-P*S+S/2:"center"===l?-D.highest.height/2-e*S+S:-D.highest.height+S/2:"near"===l||0!==p?S/2:"center"===l?D.highest.height/2-e*S:D.highest.height-P*S,c&&(A*=-1),0===p||t.showLabelBackdrop||(v+=S/2*Math.sin(p))):(y=k,A=(1-P)*S/2),t.showLabelBackdrop){const e=$e(t.backdropPadding),i=D.heights[m],n=D.widths[m];let r=A-e.top,s=0-e.left;switch(O){case"middle":r-=i/2;break;case"bottom":r-=i}switch(w){case"center":s-=n/2;break;case"right":s-=n}u={left:s,top:r,width:n+e.width,height:i+e.height,color:t.backdropColor}}g.push({label:x,font:M,textOffset:A,options:{rotation:p,color:i,strokeColor:a,strokeWidth:h,textAlign:f,textBaseline:O,translation:[v,y],backdrop:u}})}return g}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-It(this.labelRotation))return"top"===t?"left":"right";let i="center";return"start"===e.align?i="left":"end"===e.align?i="right":"inner"===e.align&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:n,padding:r}}=this.options,s=t+r,o=this._getLabelSizes().widest.width;let a,l;return"left"===e?n?(l=this.right+r,"near"===i?a="left":"center"===i?(a="center",l+=o/2):(a="right",l+=o)):(l=this.right-s,"near"===i?a="right":"center"===i?(a="center",l-=o/2):(a="left",l=this.left)):"right"===e?n?(l=this.left+r,"near"===i?a="right":"center"===i?(a="center",l-=o/2):(a="left",l-=o)):(l=this.left+s,"near"===i?a="left":"center"===i?(a="center",l+=o/2):(a="right",l=this.right)):a="right",{textAlign:a,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;return"left"===e||"right"===e?{top:0,left:this.left,bottom:t.height,right:this.right}:"top"===e||"bottom"===e?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:n,width:r,height:s}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,n,r,s),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const i=this.ticks.findIndex((e=>e.value===t));return i>=0?e.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let r,s;const o=(t,e,n)=>{n.width&&n.color&&(i.save(),i.lineWidth=n.width,i.strokeStyle=n.color,i.setLineDash(n.borderDash||[]),i.lineDashOffset=n.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(e.display)for(r=0,s=n.length;r<s;++r){const t=n[r];e.drawOnChartArea&&o({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},t),e.drawTicks&&o({x:t.tx1,y:t.ty1},{x:t.tx2,y:t.ty2},{color:t.tickColor,width:t.tickWidth,borderDash:t.tickBorderDash,borderDashOffset:t.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:i,grid:n}}=this,r=i.setContext(this.getContext()),s=i.display?r.width:0;if(!s)return;const o=n.setContext(this.getContext(0)).lineWidth,a=this._borderValue;let l,h,c,u;this.isHorizontal()?(l=Me(t,this.left,s)-s/2,h=Me(t,this.right,o)+o/2,c=u=a):(c=Me(t,this.top,s)-s/2,u=Me(t,this.bottom,o)+o/2,l=h=a),e.save(),e.lineWidth=r.width,e.strokeStyle=r.color,e.beginPath(),e.moveTo(l,c),e.lineTo(h,u),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const e=this.ctx,i=this._computeLabelArea();i&&De(e,i);const n=this.getLabelItems(t);for(const r of n){const t=r.options,i=r.font;Le(e,r.label,0,r.textOffset,i,t)}i&&Ce(e)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:n}}=this;if(!i.display)return;const r=Ue(i.font),s=$e(i.padding),o=i.align;let a=r.lineHeight/2;"bottom"===e||"center"===e||et(e)?(a+=s.bottom,tt(i.text)&&(a+=r.lineHeight*(i.text.length-1))):a+=s.top;const{titleX:l,titleY:h,maxWidth:c,rotation:u}=function(t,e,i,n){const{top:r,left:s,bottom:o,right:a,chart:l}=t,{chartArea:h,scales:c}=l;let u,f,d,p=0;const g=o-r,m=a-s;if(t.isHorizontal()){if(f=te(n,s,a),et(i)){const t=Object.keys(i)[0],n=i[t];d=c[t].getPixelForValue(n)+g-e}else d="center"===i?(h.bottom+h.top)/2+g-e:or(t,i,e);u=a-s}else{if(et(i)){const t=Object.keys(i)[0],n=i[t];f=c[t].getPixelForValue(n)-m+e}else f="center"===i?(h.left+h.right)/2-m+e:or(t,i,e);d=te(n,o,r),p="left"===i?-Pt:Pt}return{titleX:f,titleY:d,maxWidth:u,rotation:p}}(this,a,e,o);Le(t,i.text,0,0,r,{color:i.color,maxWidth:c,rotation:u,textAlign:fr(o,e,n),textBaseline:"middle",translation:[l,h]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,i=rt(t.grid&&t.grid.z,-1),n=rt(t.border&&t.border.z,0);return this._isVisible()&&this.draw===dr.prototype.draw?[{z:i,draw:t=>{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",n=[];let r,s;for(r=0,s=e.length;r<s;++r){const s=e[r];s[i]!==this.id||t&&s.type!==t||n.push(s)}return n}_resolveTickFontOptions(t){return Ue(this.options.ticks.setContext(this.getContext(t)).font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class pr{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let i;(function(t){return"id"in t&&"defaults"in t})(e)&&(i=this.register(e));const n=this.items,r=t.id,s=this.scope+"."+r;if(!r)throw new Error("class does not have id: "+t);return r in n||(n[r]=t,function(t,e,i){const n=ft(Object.create(null),[i?ye.get(i):{},ye.get(e),t.defaults]);ye.set(e,n),t.defaultRoutes&&function(t,e){Object.keys(e).forEach((i=>{const n=i.split("."),r=n.pop(),s=[t].concat(n).join("."),o=e[i].split("."),a=o.pop(),l=o.join(".");ye.route(s,r,l,a)}))}(e,t.defaultRoutes),t.descriptors&&ye.describe(e,t.descriptors)}(t,s,i),this.override&&ye.override(t.id,t.overrides)),s}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,n=this.scope;i in e&&delete e[i],n&&i in ye[n]&&(delete ye[n][i],this.override&&delete me[i])}}class gr{constructor(){this.controllers=new pr(sn,"datasets",!0),this.elements=new pr(nr,"elements"),this.plugins=new pr(Object,"plugins"),this.scales=new pr(dr,"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,e,i){[...e].forEach((e=>{const n=i||this._getRegistryForType(e);i||n.isForType(e)||n===this.plugins&&e.id?this._exec(t,n,e):at(e,(e=>{const n=i||this._getRegistryForType(e);this._exec(t,n,e)}))}))}_exec(t,e,i){const n=bt(t);ot(i["before"+n],[],i),e[t](i),ot(i["after"+n],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const n=e.get(t);if(void 0===n)throw new Error('"'+t+'" is not a registered '+i+".");return n}}var mr=new gr;class br{constructor(){this._init=[]}notify(t,e,i,n){"beforeInit"===e&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const r=n?this._descriptors(t).filter(n):this._descriptors(t),s=this._notify(r,t,e,i);return"afterDestroy"===e&&(this._notify(r,t,"stop"),this._notify(this._init,t,"uninstall")),s}_notify(t,e,i,n){n=n||{};for(const r of t){const t=r.plugin;if(!1===ot(t[i],[e,n,r.options],t)&&n.cancelable)return!1}return!0}invalidate(){Q(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,n=rt(i.options&&i.options.plugins,{}),r=function(t){const e={},i=[],n=Object.keys(mr.plugins.items);for(let s=0;s<n.length;s++)i.push(mr.getPlugin(n[s]));const r=t.plugins||[];for(let s=0;s<r.length;s++){const t=r[s];-1===i.indexOf(t)&&(i.push(t),e[t.id]=!0)}return{plugins:i,localIds:e}}(i);return!1!==n||e?function(t,{plugins:e,localIds:i},n,r){const s=[],o=t.getContext();for(const a of e){const e=a.id,l=_r(n[e],r);null!==l&&s.push({plugin:a,options:xr(t.config,{plugin:a,local:i[e]},l,o)})}return s}(t,r,n,e):[]}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,n=(t,e)=>t.filter((t=>!e.some((e=>t.plugin.id===e.plugin.id))));this._notify(n(e,i),t,"stop"),this._notify(n(i,e),t,"start")}}function _r(t,e){return e||!1!==t?!0===t?{}:t:null}function xr(t,{plugin:e,local:i},n,r){const s=t.pluginScopeKeys(e),o=t.getOptionScopes(n,s);return i&&e.defaults&&o.push(e.defaults),t.createResolver(o,r,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function vr(t,e){const i=ye.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function yr(t,e){if("x"===t||"y"===t||"r"===t)return t;var i;if(t=e.axis||("top"===(i=e.position)||"bottom"===i?"x":"left"===i||"right"===i?"y":void 0)||t.length>1&&yr(t[0].toLowerCase(),e))return t;throw new Error(`Cannot determine type of '${name}' axis. Please provide 'axis' or 'position' option.`)}function wr(t){const e=t.options||(t.options={});e.plugins=rt(e.plugins,{}),e.scales=function(t,e){const i=me[t.type]||{scales:{}},n=e.scales||{},r=vr(t.type,e),s=Object.create(null);return Object.keys(n).forEach((t=>{const e=n[t];if(!et(e))return console.error(`Invalid scale configuration for scale: ${t}`);if(e._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${t}`);const o=yr(t,e),a=function(t,e){return t===e?"_index_":"_value_"}(o,r),l=i.scales||{};s[t]=dt(Object.create(null),[{axis:o},e,l[o],l[a]])})),t.data.datasets.forEach((i=>{const r=i.type||t.type,o=i.indexAxis||vr(r,e),a=(me[r]||{}).scales||{};Object.keys(a).forEach((t=>{const e=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,o),r=i[e+"AxisID"]||e;s[r]=s[r]||Object.create(null),dt(s[r],[{axis:e},n[r],a[t]])}))})),Object.keys(s).forEach((t=>{const e=s[t];dt(e,[ye.scales[e.type],ye.scale])})),s}(t,e)}function kr(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const Mr=new Map,Sr=new Set;function Pr(t,e){let i=Mr.get(t);return i||(i=e(),Mr.set(t,i),Sr.add(i)),i}const Ar=(t,e,i)=>{const n=mt(e,i);void 0!==n&&t.add(n)};class Or{constructor(t){this._config=function(t){return(t=t||{}).data=kr(t.data),wr(t),t}(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=kr(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(),wr(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Pr(t,(()=>[[`datasets.${t}`,""]]))}datasetAnimationScopeKeys(t,e){return Pr(`${t}.transition.${e}`,(()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]]))}datasetElementScopeKeys(t,e){return Pr(`${t}-${e}`,(()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]]))}pluginScopeKeys(t){const e=t.id;return Pr(`${this.type}-plugin-${e}`,(()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]]))}_cachedScopes(t,e){const i=this._scopeCache;let n=i.get(t);return n&&!e||(n=new Map,i.set(t,n)),n}getOptionScopes(t,e,i){const{options:n,type:r}=this,s=this._cachedScopes(t,i),o=s.get(e);if(o)return o;const a=new Set;e.forEach((e=>{t&&(a.add(t),e.forEach((e=>Ar(a,t,e)))),e.forEach((t=>Ar(a,n,t))),e.forEach((t=>Ar(a,me[r]||{},t))),e.forEach((t=>Ar(a,ye,t))),e.forEach((t=>Ar(a,be,t)))}));const l=Array.from(a);return 0===l.length&&l.push(Object.create(null)),Sr.has(e)&&s.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,me[e]||{},ye.datasets[e]||{},{type:e},ye,be]}resolveNamedOptions(t,e,i,n=[""]){const r={$shared:!0},{resolver:s,subPrefixes:o}=Dr(this._resolverCache,t,n);let a=s;(function(t,e){const{isScriptable:i,isIndexable:n}=Ze(t);for(const r of e){const e=i(r),s=n(r),o=(s||e)&&t[r];if(e&&(xt(o)||Cr(o))||s&&tt(o))return!0}return!1})(s,e)&&(r.$shared=!1,a=Ke(s,i=xt(i)?i():i,this.createResolver(t,i,o)));for(const l of e)r[l]=a[l];return r}createResolver(t,e,i=[""],n){const{resolver:r}=Dr(this._resolverCache,t,i);return et(e)?Ke(r,e,void 0,n):r}}function Dr(t,e,i){let n=t.get(e);n||(n=new Map,t.set(e,n));const r=i.join();let s=n.get(r);return s||(s={resolver:Xe(e,i),subPrefixes:i.filter((t=>!t.toLowerCase().includes("hover")))},n.set(r,s)),s}const Cr=t=>et(t)&&Object.getOwnPropertyNames(t).reduce(((e,i)=>e||xt(t[i])),!1),Tr=["top","bottom","left","right","chartArea"];function Er(t,e){return"top"===t||"bottom"===t||-1===Tr.indexOf(t)&&"x"===e}function Lr(t,e){return function(i,n){return i[t]===n[t]?i[e]-n[e]:i[t]-n[t]}}function Rr(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),ot(i&&i.onComplete,[t],e)}function Ir(t){const e=t.chart,i=e.options.animation;ot(i&&i.onProgress,[t],e)}function zr(t){return gi()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const Fr={},jr=t=>{const e=zr(t);return Object.values(Fr).filter((t=>t.canvas===e)).pop()};function Vr(t,e,i){const n=Object.keys(t);for(const r of n){const n=+r;if(n>=e){const s=t[r];delete t[r],(i>0||n>e)&&(t[n+i]=s)}}}class Br{static defaults=ye;static instances=Fr;static overrides=me;static registry=mr;static version="4.2.1";static getChart=jr;static register(...t){mr.add(...t),Wr()}static unregister(...t){mr.remove(...t),Wr()}constructor(t,e){const i=this.config=new Or(e),n=zr(t),r=jr(n);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 s=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||function(t){return!gi()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?Wn:ir}(n)),this.platform.updateConfig(i);const o=this.platform.acquireContext(n,s.aspectRatio),a=o&&o.canvas,l=a&&a.height,h=a&&a.width;this.id=J(),this.ctx=o,this.canvas=a,this.width=h,this.height=l,this._options=s,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new br,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(t,e){let i;return function(...n){return e?(clearTimeout(i),i=setTimeout(t,e,n)):t.apply(this,n),e}}((t=>this.update(t)),s.resizeDelay||0),this._dataChanges=[],Fr[this.id]=this,o&&a?(Ni.listen(this,"complete",Rr),Ni.listen(this,"progress",Ir),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:n,_aspectRatio:r}=this;return Q(t)?e&&r?r:n?i/n: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 mr}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Si(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Se(this.canvas,this.ctx),this}stop(){return Ni.stop(this),this}resize(t,e){Ni.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,n=this.canvas,r=i.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(n,t,e,r),o=i.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,Si(this,o,!0)&&(this.notifyPlugins("resize",{size:s}),ot(i.onResize,[this,s],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){at(this.options.scales||{},((t,e)=>{t.id=e}))}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,n=Object.keys(i).reduce(((t,e)=>(t[e]=!1,t)),{});let r=[];e&&(r=r.concat(Object.keys(e).map((t=>{const i=e[t],n=yr(t,i),r="r"===n,s="x"===n;return{options:i,dposition:r?"chartArea":s?"bottom":"left",dtype:r?"radialLinear":s?"category":"linear"}})))),at(r,(e=>{const r=e.options,s=r.id,o=yr(s,r),a=rt(r.type,e.dtype);void 0!==r.position&&Er(r.position,o)===Er(e.dposition)||(r.position=e.dposition),n[s]=!0;let l=null;s in i&&i[s].type===a?l=i[s]:(l=new(mr.getScale(a))({id:s,type:a,ctx:this.ctx,chart:this}),i[l.id]=l),l.init(r,t)})),at(n,((t,e)=>{t||delete i[e]})),at(i,(t=>{Vn.configure(this,t,t.options),Vn.addBox(this,t)}))}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort(((t,e)=>t.index-e.index)),i>e){for(let t=e;t<i;++t)this._destroyDatasetMeta(t);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(Lr("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach(((t,i)=>{0===e.filter((e=>e===t._dataset)).length&&this._destroyDatasetMeta(i)}))}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,n;for(this._removeUnreferencedMetasets(),i=0,n=e.length;i<n;i++){const n=e[i];let r=this.getDatasetMeta(i);const s=n.type||this.config.type;if(r.type&&r.type!==s&&(this._destroyDatasetMeta(i),r=this.getDatasetMeta(i)),r.type=s,r.indexAxis=n.indexAxis||vr(s,this.options),r.order=n.order||0,r.index=i,r.label=""+n.label,r.visible=this.isDatasetVisible(i),r.controller)r.controller.updateIndex(i),r.controller.linkScales();else{const e=mr.getController(s),{datasetElementType:n,dataElementType:o}=ye.datasets[s];Object.assign(e,{dataElementType:mr.getElement(o),datasetElementType:n&&mr.getElement(n)}),r.controller=new e(this,i),t.push(r.controller)}}return this._updateMetasets(),t}_resetElements(){at(this.data.datasets,((t,e)=>{this.getDatasetMeta(e).controller.reset()}),this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let s=0;for(let l=0,h=this.data.datasets.length;l<h;l++){const{controller:t}=this.getDatasetMeta(l),e=!n&&-1===r.indexOf(t);t.buildOrUpdateElements(e),s=Math.max(+t.getMaxOverflow(),s)}s=this._minPadding=i.layout.autoPadding?s:0,this._updateLayout(s),n||at(r,(t=>{t.reset()})),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Lr("z","_idx"));const{_active:o,_lastEvent:a}=this;a?this._eventHandler(a,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){at(this.scales,(t=>{Vn.removeBox(this,t)})),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);vt(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:n,count:r}of e)Vr(t,n,"_removeElements"===i?-r:r)}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=e=>new Set(t.filter((t=>t[0]===e)).map(((t,e)=>e+","+t.splice(1).join(",")))),n=i(0);for(let r=1;r<e;r++)if(!vt(n,i(r)))return;return Array.from(n).map((t=>t.split(","))).map((t=>({method:t[1],start:+t[2],count:+t[3]})))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;Vn.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],at(this.boxes,(t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))}),this),this._layers.forEach(((t,e)=>{t._idx=e})),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t<e;++t)this.getDatasetMeta(t).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,xt(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),n={meta:i,index:t,mode:e,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",n)&&(i.controller._update(e),n.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",n))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(Ni.has(this)?this.attached&&!Ni.running(this)&&Ni.start(this):(this.draw(),Rr({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:t,height:e}=this._resizeBeforeDraw;this._resize(t,e),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0)return;if(!1===this.notifyPlugins("beforeDraw",{cancelable:!0}))return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let n,r;for(n=0,r=e.length;n<r;++n){const r=e[n];t&&!r.visible||i.push(r)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1===this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,n=!i.disabled,r=function(t){const{xScale:e,yScale:i}=t;if(e&&i)return{left:e.left,right:e.right,top:i.top,bottom:i.bottom}}(t)||this.chartArea,s={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",s)&&(n&&De(e,{left:!1===i.left?0:r.left-i.left,right:!1===i.right?this.width:r.right+i.right,top:!1===i.top?0:r.top-i.top,bottom:!1===i.bottom?this.height:r.bottom+i.bottom}),t.controller.draw(),n&&Ce(e),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return Oe(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,n){const r=Pn.modes[e];return"function"==typeof r?r(this,t,i,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let n=i.filter((t=>t&&t._dataset===e)).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(n)),n}getContext(){return this.$context||(this.$context=qe(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const n=i?"show":"hide",r=this.getDatasetMeta(t),s=r.controller._resolveAnimations(void 0,n);_t(e)?(r.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),s.update(r,{visible:i}),this.update((e=>e.datasetIndex===t?n:void 0)))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),Ni.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Se(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Fr[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(i,n)=>{e.addEventListener(this,i,n),t[i]=n},n=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};at(this.options.events,(t=>i(t,n)))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,n)=>{e.addEventListener(this,i,n),t[i]=n},n=(i,n)=>{t[i]&&(e.removeEventListener(this,i,n),delete t[i])},r=(t,e)=>{this.canvas&&this.resize(t,e)};let s;const o=()=>{n("attach",o),this.attached=!0,this.resize(),i("resize",r),i("detach",s)};s=()=>{this.attached=!1,n("resize",r),this._stop(),this._resize(0,0),i("attach",o)},e.isAttached(this.canvas)?o():s()}unbindEvents(){at(this._listeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._listeners={},at(this._responsiveListeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const n=i?"set":"remove";let r,s,o,a;for("dataset"===e&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+n+"DatasetHoverStyle"]()),o=0,a=t.length;o<a;++o){s=t[o];const e=s&&this.getDatasetMeta(s.datasetIndex).controller;e&&e[n+"HoverStyle"](s.element,s.datasetIndex,s.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map((({datasetIndex:t,index:e})=>{const i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}));!lt(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return 1===this._plugins._cache.filter((e=>e.plugin.id===t)).length}_updateHoverStyles(t,e,i){const n=this.options.hover,r=(t,e)=>t.filter((t=>!e.some((e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)))),s=r(e,t),o=i?t:r(t,e);s.length&&this.updateHoverStyle(s,n.mode,!1),o.length&&n.mode&&this.updateHoverStyle(o,n.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,n))return;const r=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,n),(r||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:n=[],options:r}=this,s=e,o=this._getActiveElements(t,n,i,s),a=function(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}(t),l=function(t,e,i,n){return i&&"mouseout"!==t.type?n?e:t:null}(t,this._lastEvent,i,a);i&&(this._lastEvent=null,ot(r.onHover,[t,o,this],this),a&&ot(r.onClick,[t,o,this],this));const h=!lt(o,n);return(h||e)&&(this._active=o,this._updateHoverStyles(o,n,e)),this._lastEvent=l,h}_getActiveElements(t,e,i,n){if("mouseout"===t.type)return[];if(!i)return e;const r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,n)}}function Wr(){return at(Br.instances,(t=>t._plugins.invalidate()))}function Nr(t,e,i,n){const r=We(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]),s=(i-e)/2,o=Math.min(s,n*e/2),a=t=>{const e=(i-Math.min(s,t))*n/2;return Ht(t,0,Math.min(s,e))};return{outerStart:a(r.outerStart),outerEnd:a(r.outerEnd),innerStart:Ht(r.innerStart,0,o),innerEnd:Ht(r.innerEnd,0,o)}}function Hr(t,e,i,n){return{x:i+t*Math.cos(e),y:n+t*Math.sin(e)}}function $r(t,e,i,n,r,s){const{x:o,y:a,startAngle:l,pixelMargin:h,innerRadius:c}=e,u=Math.max(e.outerRadius+n+i-h,0),f=c>0?c+n+i+h:0;let d=0;const p=r-l;if(n){const t=((c>0?c-n:0)+(u>0?u-n:0))/2;d=(p-(0!==t?p*t/(t+n):p))/2}const g=(p-Math.max(.001,p*u-i/yt)/u)/2,m=l+g+d,b=r-g-d,{outerStart:_,outerEnd:x,innerStart:v,innerEnd:y}=Nr(e,f,u,b-m),w=u-_,k=u-x,M=m+_/w,S=b-x/k,P=f+v,A=f+y,O=m+v/P,D=b-y/A;if(t.beginPath(),s){const e=(M+S)/2;if(t.arc(o,a,u,M,e),t.arc(o,a,u,e,S),x>0){const e=Hr(k,S,o,a);t.arc(e.x,e.y,x,S,b+Pt)}const i=Hr(A,b,o,a);if(t.lineTo(i.x,i.y),y>0){const e=Hr(A,D,o,a);t.arc(e.x,e.y,y,b+Pt,D+Math.PI)}const n=(b-y/f+(m+v/f))/2;if(t.arc(o,a,f,b-y/f,n,!0),t.arc(o,a,f,n,m+v/f,!0),v>0){const e=Hr(P,O,o,a);t.arc(e.x,e.y,v,O+Math.PI,m-Pt)}const r=Hr(w,m,o,a);if(t.lineTo(r.x,r.y),_>0){const e=Hr(w,M,o,a);t.arc(e.x,e.y,_,m-Pt,M)}}else{t.moveTo(o,a);const e=Math.cos(M)*u+o,i=Math.sin(M)*u+a;t.lineTo(e,i);const n=Math.cos(S)*u+o,r=Math.sin(S)*u+a;t.lineTo(n,r)}t.closePath()}function Ur(t,e,i,n,r){const{fullCircles:s,startAngle:o,circumference:a,options:l}=e,{borderWidth:h,borderJoinStyle:c}=l,u="inner"===l.borderAlign;if(!h)return;u?(t.lineWidth=2*h,t.lineJoin=c||"round"):(t.lineWidth=h,t.lineJoin=c||"bevel");let f=e.endAngle;if(s){$r(t,e,i,n,f,r);for(let e=0;e<s;++e)t.stroke();isNaN(a)||(f=o+(a%wt||wt))}u&&function(t,e,i){const{startAngle:n,pixelMargin:r,x:s,y:o,outerRadius:a,innerRadius:l}=e;let h=r/a;t.beginPath(),t.arc(s,o,a,n-h,i+h),l>r?(h=r/l,t.arc(s,o,l,i+h,n-h,!0)):t.arc(s,o,r,i+Pt,n-Pt),t.closePath(),t.clip()}(t,e,f),s||($r(t,e,i,n,f,r),t.stroke())}function Yr(t,e,i=e){t.lineCap=rt(i.borderCapStyle,e.borderCapStyle),t.setLineDash(rt(i.borderDash,e.borderDash)),t.lineDashOffset=rt(i.borderDashOffset,e.borderDashOffset),t.lineJoin=rt(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=rt(i.borderWidth,e.borderWidth),t.strokeStyle=rt(i.borderColor,e.borderColor)}function qr(t,e,i){t.lineTo(i.x,i.y)}function Xr(t,e,i={}){const n=t.length,{start:r=0,end:s=n-1}=i,{start:o,end:a}=e,l=Math.max(r,o),h=Math.min(s,a),c=r<o&&s<o||r>a&&s>a;return{count:n,start:l,loop:e.loop,ilen:h<l&&!c?n+h-l:h-l}}function Kr(t,e,i,n){const{points:r,options:s}=e,{count:o,start:a,loop:l,ilen:h}=Xr(r,i,n),c=function(t){return t.stepped?Te:t.tension||"monotone"===t.cubicInterpolationMode?Ee:qr}(s);let u,f,d,{move:p=!0,reverse:g}=n||{};for(u=0;u<=h;++u)f=r[(a+(g?h-u:u))%o],f.skip||(p?(t.moveTo(f.x,f.y),p=!1):c(t,d,f,g,s.stepped),d=f);return l&&(f=r[(a+(g?h:0))%o],c(t,d,f,g,s.stepped)),!!l}function Zr(t,e,i,n){const r=e.points,{count:s,start:o,ilen:a}=Xr(r,i,n),{move:l=!0,reverse:h}=n||{};let c,u,f,d,p,g,m=0,b=0;const _=t=>(o+(h?a-t:t))%s,x=()=>{d!==p&&(t.lineTo(m,p),t.lineTo(m,d),t.lineTo(m,g))};for(l&&(u=r[_(0)],t.moveTo(u.x,u.y)),c=0;c<=a;++c){if(u=r[_(c)],u.skip)continue;const e=u.x,i=u.y,n=0|e;n===f?(i<d?d=i:i>p&&(p=i),m=(b*m+e)/++b):(x(),t.lineTo(e,i),f=n,b=0,d=p=i),g=i}x()}function Gr(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i?Kr:Zr}t("C",Br);const Jr="function"==typeof Path2D;function Qr(t,e,i,n){Jr&&!e.options.segment?function(t,e,i,n){let r=e._path;r||(r=e._path=new Path2D,e.path(r,i,n)&&r.closePath()),Yr(t,e.options),t.stroke(r)}(t,e,i,n):function(t,e,i,n){const{segments:r,options:s}=e,o=Gr(e);for(const a of r)Yr(t,s,a.style),t.beginPath(),o(t,e,a,{start:i,end:i+n-1})&&t.closePath(),t.stroke()}(t,e,i,n)}class ts extends nr{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};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,e){const i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){const n=i.spanGaps?this._loop:this._fullLoop;pi(this._points,i,t,n,e),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=function(t,e){const i=t.points,n=t.options.spanGaps,r=i.length;if(!r)return[];const s=!!t._loop,{start:o,end:a}=function(t,e,i,n){let r=0,s=e-1;if(i&&!n)for(;r<e&&!t[r].skip;)r++;for(;r<e&&t[r].skip;)r++;for(r%=e,i&&(s+=r);s>r&&t[s%e].skip;)s--;return s%=e,{start:r,end:s}}(i,r,s,n);return ji(t,!0===n?[{start:o,end:a,loop:s}]:function(t,e,i,n){const r=t.length,s=[];let o,a=e,l=t[e];for(o=e+1;o<=i;++o){const i=t[o%r];i.skip||i.stop?l.skip||(n=!1,s.push({start:e%r,end:(o-1)%r,loop:n}),e=a=i.stop?o:null):(a=o,l.skip&&(e=o)),l=i}return null!==a&&s.push({start:e%r,end:a%r,loop:n}),s}(i,o,a<o?a+r:a,!!t._fullLoop&&0===o&&a===r-1),i,e)}(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,n=t[e],r=this.points,s=Fi(this,{property:e,start:n,end:n});if(!s.length)return;const o=[],a=function(t){return t.stepped?Di:t.tension||"monotone"===t.cubicInterpolationMode?Ci:Oi}(i);let l,h;for(l=0,h=s.length;l<h;++l){const{start:h,end:c}=s[l],u=r[h],f=r[c];if(u===f){o.push(u);continue}const d=a(u,f,Math.abs((n-u[e])/(f[e]-u[e])),i.stepped);d[e]=t[e],o.push(d)}return 1===o.length?o[0]:o}pathSegment(t,e,i){return Gr(this)(t,this,e,i)}path(t,e,i){const n=this.segments,r=Gr(this);let s=this._loop;e=e||0,i=i||this.points.length-e;for(const o of n)s&=r(t,this,o,{start:e,end:e+i-1});return!!s}draw(t,e,i,n){const r=this.options||{};(this.points||[]).length&&r.borderWidth&&(t.save(),Qr(t,this,i,n),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function es(t,e,i,n){const r=t.options,{[i]:s}=t.getProps([i],n);return Math.abs(e-s)<r.radius+r.hitRadius}function is(t,e){const{x:i,y:n,base:r,width:s,height:o}=t.getProps(["x","y","base","width","height"],e);let a,l,h,c,u;return t.horizontal?(u=o/2,a=Math.min(i,r),l=Math.max(i,r),h=n-u,c=n+u):(u=s/2,a=i-u,l=i+u,h=Math.min(n,r),c=Math.max(n,r)),{left:a,top:h,right:l,bottom:c}}function ns(t,e,i,n){return t?0:Ht(e,i,n)}function rs(t){const e=is(t),i=e.right-e.left,n=e.bottom-e.top,r=function(t,e,i){const n=t.options.borderWidth,r=t.borderSkipped,s=Ne(n);return{t:ns(r.top,s.top,0,i),r:ns(r.right,s.right,0,e),b:ns(r.bottom,s.bottom,0,i),l:ns(r.left,s.left,0,e)}}(t,i/2,n/2),s=function(t,e,i){const{enableBorderRadius:n}=t.getProps(["enableBorderRadius"]),r=t.options.borderRadius,s=He(r),o=Math.min(e,i),a=t.borderSkipped,l=n||et(r);return{topLeft:ns(!l||a.top||a.left,s.topLeft,0,o),topRight:ns(!l||a.top||a.right,s.topRight,0,o),bottomLeft:ns(!l||a.bottom||a.left,s.bottomLeft,0,o),bottomRight:ns(!l||a.bottom||a.right,s.bottomRight,0,o)}}(t,i/2,n/2);return{outer:{x:e.left,y:e.top,w:i,h:n,radius:s},inner:{x:e.left+r.l,y:e.top+r.t,w:i-r.l-r.r,h:n-r.t-r.b,radius:{topLeft:Math.max(0,s.topLeft-Math.max(r.t,r.l)),topRight:Math.max(0,s.topRight-Math.max(r.t,r.r)),bottomLeft:Math.max(0,s.bottomLeft-Math.max(r.b,r.l)),bottomRight:Math.max(0,s.bottomRight-Math.max(r.b,r.r))}}}}function ss(t,e,i,n){const r=null===e,s=null===i,o=t&&!(r&&s)&&is(t,n);return o&&(r||$t(e,o.left,o.right))&&(s||$t(i,o.top,o.bottom))}function os(t,e){t.rect(e.x,e.y,e.w,e.h)}function as(t,e,i={}){const n=t.x!==i.x?-e:0,r=t.y!==i.y?-e:0,s=(t.x+t.w!==i.x+i.w?e:0)-n,o=(t.y+t.h!==i.y+i.h?e:0)-r;return{x:t.x+n,y:t.y+r,w:t.w+s,h:t.h+o,radius:t.radius}}var ls=Object.freeze({__proto__:null,ArcElement:class extends nr{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};static defaultRoutes={backgroundColor:"backgroundColor"};constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){const n=this.getProps(["x","y"],i),{angle:r,distance:s}=jt(n,{x:t,y:e}),{startAngle:o,endAngle:a,innerRadius:l,outerRadius:h,circumference:c}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),u=this.options.spacing/2,f=rt(c,a-o)>=wt||Nt(r,o,a),d=$t(s,l+u,h+u);return f&&d}getCenterPoint(t){const{x:e,y:i,startAngle:n,endAngle:r,innerRadius:s,outerRadius:o}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:a,spacing:l}=this.options,h=(n+r)/2,c=(s+o+l+a)/2;return{x:e+Math.cos(h)*c,y:i+Math.sin(h)*c}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,n=(e.offset||0)/4,r=(e.spacing||0)/2,s=e.circular;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>wt?Math.floor(i/wt):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();const o=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(o)*n,Math.sin(o)*n);const a=n*(1-Math.sin(Math.min(yt,i||0)));t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,function(t,e,i,n,r){const{fullCircles:s,startAngle:o,circumference:a}=e;let l=e.endAngle;if(s){$r(t,e,i,n,l,r);for(let e=0;e<s;++e)t.fill();isNaN(a)||(l=o+(a%wt||wt))}$r(t,e,i,n,l,r),t.fill()}(t,this,a,r,s),Ur(t,this,a,r,s),t.restore()}},LineElement:ts,PointElement:class extends nr{static id="point";static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){const n=this.options,{x:r,y:s}=this.getProps(["x","y"],i);return Math.pow(t-r,2)+Math.pow(e-s,2)<Math.pow(n.hitRadius+n.radius,2)}inXRange(t,e){return es(this,t,"x",e)}inYRange(t,e){return es(this,t,"y",e)}getCenterPoint(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}size(t){let e=(t=t||this.options||{}).radius||0;return e=Math.max(e,e&&t.hoverRadius||0),2*(e+(e&&t.borderWidth||0))}draw(t,e){const i=this.options;this.skip||i.radius<.1||!Oe(this,e,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,Pe(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}},BarElement:class extends nr{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:i,backgroundColor:n}}=this,{inner:r,outer:s}=rs(this),o=(a=s.radius).topLeft||a.topRight||a.bottomLeft||a.bottomRight?ze:os;var a;t.save(),s.w===r.w&&s.h===r.h||(t.beginPath(),o(t,as(s,e,r)),t.clip(),o(t,as(r,-e,s)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),o(t,as(r,e)),t.fillStyle=n,t.fill(),t.restore()}inRange(t,e,i){return ss(this,t,e,i)}inXRange(t,e){return ss(this,t,null,e)}inYRange(t,e){return ss(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:n,horizontal:r}=this.getProps(["x","y","base","horizontal"],t);return{x:r?(e+n)/2:e,y:r?i:(i+n)/2}}getRange(t){return"x"===t?this.width/2:this.height/2}}});const hs=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],cs=hs.map((t=>t.replace("rgb(","rgba(").replace(")",", 0.5)")));function us(t){return hs[t%hs.length]}function fs(t){return cs[t%cs.length]}function ds(t){let e=0;return(i,n)=>{const r=t.getDatasetMeta(n).controller;r instanceof pn?e=function(t,e){return t.backgroundColor=t.data.map((()=>us(e++))),e}(i,e):r instanceof gn?e=function(t,e){return t.backgroundColor=t.data.map((()=>fs(e++))),e}(i,e):r&&(e=function(t,e){return t.borderColor=us(e),t.backgroundColor=fs(e),++e}(i,e))}}function ps(t){let e;for(e in t)if(t[e].borderColor||t[e].backgroundColor)return!0;return!1}var gs={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(t,e,i){if(!i.enabled)return;const{data:{datasets:n},options:r}=t.config,{elements:s}=r;if(!i.forceOverride&&(ps(n)||(o=r)&&(o.borderColor||o.backgroundColor)||s&&ps(s)))return;var o;const a=ds(t);n.forEach(a)}};function ms(t){if(t._decimated){const e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{configurable:!0,enumerable:!0,writable:!0,value:e})}}function bs(t){t.data.datasets.forEach((t=>{ms(t)}))}var _s={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,i)=>{if(!i.enabled)return void bs(t);const n=t.width;t.data.datasets.forEach(((e,r)=>{const{_data:s,indexAxis:o}=e,a=t.getDatasetMeta(r),l=s||e.data;if("y"===Ye([o,t.options.indexAxis]))return;if(!a.controller.supportsDecimation)return;const h=t.scales[a.xAxisID];if("linear"!==h.type&&"time"!==h.type)return;if(t.options.parsing)return;let c,{start:u,count:f}=function(t,e){const i=e.length;let n,r=0;const{iScale:s}=t,{min:o,max:a,minDefined:l,maxDefined:h}=s.getUserBounds();return l&&(r=Ht(Yt(e,s.axis,o).lo,0,i-1)),n=h?Ht(Yt(e,s.axis,a).hi+1,r,i)-r:i-r,{start:r,count:n}}(a,l);if(f<=(i.threshold||4*n))ms(e);else{switch(Q(s)&&(e._data=l,delete e.data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(t){this._data=t}})),i.algorithm){case"lttb":c=function(t,e,i,n,r){const s=r.samples||n;if(s>=i)return t.slice(e,e+i);const o=[],a=(i-2)/(s-2);let l=0;const h=e+i-1;let c,u,f,d,p,g=e;for(o[l++]=t[g],c=0;c<s-2;c++){let n,r=0,s=0;const h=Math.floor((c+1)*a)+1+e,m=Math.min(Math.floor((c+2)*a)+1,i)+e,b=m-h;for(n=h;n<m;n++)r+=t[n].x,s+=t[n].y;r/=b,s/=b;const _=Math.floor(c*a)+1+e,x=Math.min(Math.floor((c+1)*a)+1,i)+e,{x:v,y:y}=t[g];for(f=d=-1,n=_;n<x;n++)d=.5*Math.abs((v-r)*(t[n].y-y)-(v-t[n].x)*(s-y)),d>f&&(f=d,u=t[n],p=n);o[l++]=u,g=p}return o[l++]=t[h],o}(l,u,f,n,i);break;case"min-max":c=function(t,e,i,n){let r,s,o,a,l,h,c,u,f,d,p=0,g=0;const m=[],b=e+i-1,_=t[e].x,x=t[b].x-_;for(r=e;r<e+i;++r){s=t[r],o=(s.x-_)/x*n,a=s.y;const e=0|o;if(e===l)a<f?(f=a,h=r):a>d&&(d=a,c=r),p=(g*p+s.x)/++g;else{const i=r-1;if(!Q(h)&&!Q(c)){const e=Math.min(h,c),n=Math.max(h,c);e!==u&&e!==i&&m.push({...t[e],x:p}),n!==u&&n!==i&&m.push({...t[n],x:p})}r>0&&i!==u&&m.push(t[i]),m.push(s),l=e,g=0,f=d=a,h=c=u=r}}return m}(l,u,f,n);break;default:throw new Error(`Unsupported decimation algorithm '${i.algorithm}'`)}e._decimated=c}}))},destroy(t){bs(t)}};function xs(t,e,i,n){if(n)return;let r=e[t],s=i[t];return"angle"===t&&(r=Wt(r),s=Wt(s)),{property:t,start:r,end:s}}function vs(t,e,i){for(;e>t;e--){const t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function ys(t,e,i,n){return t&&e?n(t[i],e[i]):t?t[i]:e?e[i]:0}function ws(t,e){let i=[],n=!1;return tt(t)?(n=!0,i=t):i=function(t,e){const{x:i=null,y:n=null}=t||{},r=e.points,s=[];return e.segments.forEach((({start:t,end:e})=>{e=vs(t,e,r);const o=r[t],a=r[e];null!==n?(s.push({x:o.x,y:n}),s.push({x:a.x,y:n})):null!==i&&(s.push({x:i,y:o.y}),s.push({x:i,y:a.y}))})),s}(t,e),i.length?new ts({points:i,options:{tension:0},_loop:n,_fullLoop:n}):null}function ks(t){return t&&!1!==t.fill}function Ms(t,e,i){let n=t[e].fill;const r=[e];let s;if(!i)return n;for(;!1!==n&&-1===r.indexOf(n);){if(!it(n))return n;if(s=t[n],!s)return!1;if(s.visible)return n;r.push(n),n=s.fill}return!1}function Ss(t,e,i){const n=function(t){const e=t.options,i=e.fill;let n=rt(i&&i.target,i);return void 0===n&&(n=!!e.backgroundColor),!1!==n&&null!==n&&(!0===n?"origin":n)}(t);if(et(n))return!isNaN(n.value)&&n;let r=parseFloat(n);return it(r)&&Math.floor(r)===r?function(t,e,i,n){return"-"!==t&&"+"!==t||(i=e+i),!(i===e||i<0||i>=n)&&i}(n[0],e,r,i):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function Ps(t,e,i){const n=[];for(let r=0;r<i.length;r++){const s=i[r],{first:o,last:a,point:l}=As(s,e,"x");if(!(!l||o&&a))if(o)n.unshift(l);else if(t.push(l),!a)break}t.push(...n)}function As(t,e,i){const n=t.interpolate(e,i);if(!n)return{};const r=n[i],s=t.segments,o=t.points;let a=!1,l=!1;for(let h=0;h<s.length;h++){const t=s[h],e=o[t.start][i],n=o[t.end][i];if($t(r,e,n)){a=r===e,l=r===n;break}}return{first:a,last:l,point:n}}class Os{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:n,y:r,radius:s}=this;return e=e||{start:0,end:wt},t.arc(n,r,s,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:n}=this,r=t.angle;return{x:e+Math.cos(r)*n,y:i+Math.sin(r)*n,angle:r}}}function Ds(t){const{chart:e,fill:i,line:n}=t;if(it(i))return function(t,e){const i=t.getDatasetMeta(e),n=i&&t.isDatasetVisible(e);return n?i.dataset:null}(e,i);if("stack"===i)return function(t){const{scale:e,index:i,line:n}=t,r=[],s=n.segments,o=n.points,a=function(t,e){const i=[],n=t.getMatchingVisibleMetas("line");for(let r=0;r<n.length;r++){const t=n[r];if(t.index===e)break;t.hidden||i.unshift(t.dataset)}return i}(e,i);a.push(ws({x:null,y:e.bottom},n));for(let l=0;l<s.length;l++){const t=s[l];for(let e=t.start;e<=t.end;e++)Ps(r,o[e],a)}return new ts({points:r,options:{}})}(t);if("shape"===i)return!0;const r=function(t){const e=t.scale||{};return e.getPointPositionForValue?function(t){const{scale:e,fill:i}=t,n=e.options,r=e.getLabels().length,s=n.reverse?e.max:e.min,o=function(t,e,i){let n;return n="start"===t?i:"end"===t?e.options.reverse?e.min:e.max:et(t)?t.value:e.getBaseValue(),n}(i,e,s),a=[];if(n.grid.circular){const t=e.getPointPositionForValue(0,s);return new Os({x:t.x,y:t.y,radius:e.getDistanceFromCenterForValue(o)})}for(let l=0;l<r;++l)a.push(e.getPointPositionForValue(l,o));return a}(t):function(t){const{scale:e={},fill:i}=t,n=function(t,e){let i=null;return"start"===t?i=e.bottom:"end"===t?i=e.top:et(t)?i=e.getPixelForValue(t.value):e.getBasePixel&&(i=e.getBasePixel()),i}(i,e);if(it(n)){const t=e.isHorizontal();return{x:t?n:null,y:t?null:n}}return null}(t)}(t);return r instanceof Os?r:ws(r,n)}function Cs(t,e,i){const n=Ds(e),{line:r,scale:s,axis:o}=e,a=r.options,l=a.fill,h=a.backgroundColor,{above:c=h,below:u=h}=l||{};n&&r.points.length&&(De(t,i),function(t,e){const{line:i,target:n,above:r,below:s,area:o,scale:a}=e,l=i._loop?"angle":e.axis;t.save(),"x"===l&&s!==r&&(Ts(t,n,o.top),Es(t,{line:i,target:n,color:r,scale:a,property:l}),t.restore(),t.save(),Ts(t,n,o.bottom)),Es(t,{line:i,target:n,color:s,scale:a,property:l}),t.restore()}(t,{line:r,target:n,above:c,below:u,area:i,scale:s,axis:o}),Ce(t))}function Ts(t,e,i){const{segments:n,points:r}=e;let s=!0,o=!1;t.beginPath();for(const a of n){const{start:n,end:l}=a,h=r[n],c=r[vs(n,l,r)];s?(t.moveTo(h.x,h.y),s=!1):(t.lineTo(h.x,i),t.lineTo(h.x,h.y)),o=!!e.pathSegment(t,a,{move:o}),o?t.closePath():t.lineTo(c.x,i)}t.lineTo(e.first().x,i),t.closePath(),t.clip()}function Es(t,e){const{line:i,target:n,property:r,color:s,scale:o}=e,a=function(t,e,i){const n=t.segments,r=t.points,s=e.points,o=[];for(const a of n){let{start:t,end:n}=a;n=vs(t,n,r);const l=xs(i,r[t],r[n],a.loop);if(!e.segments){o.push({source:a,target:l,start:r[t],end:r[n]});continue}const h=Fi(e,l);for(const e of h){const t=xs(i,s[e.start],s[e.end],e.loop),n=zi(a,r,t);for(const r of n)o.push({source:r,target:e,start:{[i]:ys(l,t,"start",Math.max)},end:{[i]:ys(l,t,"end",Math.min)}})}}return o}(i,n,r);for(const{source:l,target:h,start:c,end:u}of a){const{style:{backgroundColor:e=s}={}}=l,a=!0!==n;t.save(),t.fillStyle=e,Ls(t,o,a&&xs(r,c,u)),t.beginPath();const f=!!i.pathSegment(t,l);let d;if(a){f?t.closePath():Rs(t,n,u,r);const e=!!n.pathSegment(t,h,{move:f,reverse:!0});d=f&&e,d||Rs(t,n,c,r)}t.closePath(),t.fill(d?"evenodd":"nonzero"),t.restore()}}function Ls(t,e,i){const{top:n,bottom:r}=e.chart.chartArea,{property:s,start:o,end:a}=i||{};"x"===s&&(t.beginPath(),t.rect(o,n,a-o,r-n),t.clip())}function Rs(t,e,i,n){const r=e.interpolate(i,n);r&&t.lineTo(r.x,r.y)}var Is={id:"filler",afterDatasetsUpdate(t,e,i){const n=(t.data.datasets||[]).length,r=[];let s,o,a,l;for(o=0;o<n;++o)s=t.getDatasetMeta(o),a=s.dataset,l=null,a&&a.options&&a instanceof ts&&(l={visible:t.isDatasetVisible(o),index:o,fill:Ss(a,o,n),chart:t,axis:s.controller.options.indexAxis,scale:s.vScale,line:a}),s.$filler=l,r.push(l);for(o=0;o<n;++o)l=r[o],l&&!1!==l.fill&&(l.fill=Ms(r,o,i.propagate))},beforeDraw(t,e,i){const n="beforeDraw"===i.drawTime,r=t.getSortedVisibleDatasetMetas(),s=t.chartArea;for(let o=r.length-1;o>=0;--o){const e=r[o].$filler;e&&(e.line.updateControlPoints(s,e.axis),n&&e.fill&&Cs(t.ctx,e,s))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;const n=t.getSortedVisibleDatasetMetas();for(let r=n.length-1;r>=0;--r){const e=n[r].$filler;ks(e)&&Cs(t.ctx,e,t.chartArea)}},beforeDatasetDraw(t,e,i){const n=e.meta.$filler;ks(n)&&"beforeDatasetDraw"===i.drawTime&&Cs(t.ctx,n,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const zs=(t,e)=>{let{boxHeight:i=e,boxWidth:n=e}=t;return t.usePointStyle&&(i=Math.min(i,e),n=t.pointStyleWidth||Math.min(n,e)),{boxWidth:n,boxHeight:i,itemHeight:Math.max(e,i)}};class Fs extends nr{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,e,i){this.maxWidth=t,this.maxHeight=e,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 e=ot(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter((e=>t.filter(e,this.chart.data)))),t.sort&&(e=e.sort(((e,i)=>t.sort(e,i,this.chart.data)))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display)return void(this.width=this.height=0);const i=t.labels,n=Ue(i.font),r=n.size,s=this._computeTitleHeight(),{boxWidth:o,itemHeight:a}=zs(i,r);let l,h;e.font=n.string,this.isHorizontal()?(l=this.maxWidth,h=this._fitRows(s,r,o,a)+10):(h=this.maxHeight,l=this._fitCols(s,n,o,a)+10),this.width=Math.min(l,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,n){const{ctx:r,maxWidth:s,options:{labels:{padding:o}}}=this,a=this.legendHitBoxes=[],l=this.lineWidths=[0],h=n+o;let c=t;r.textAlign="left",r.textBaseline="middle";let u=-1,f=-h;return this.legendItems.forEach(((t,d)=>{const p=i+e/2+r.measureText(t.text).width;(0===d||l[l.length-1]+p+2*o>s)&&(c+=h,l[l.length-(d>0?0:1)]=0,f+=h,u++),a[d]={left:0,top:f,row:u,width:p,height:n},l[l.length-1]+=p+o})),c}_fitCols(t,e,i,n){const{ctx:r,maxHeight:s,options:{labels:{padding:o}}}=this,a=this.legendHitBoxes=[],l=this.columnSizes=[],h=s-t;let c=o,u=0,f=0,d=0,p=0;return this.legendItems.forEach(((t,s)=>{const{itemWidth:g,itemHeight:m}=function(t,e,i,n,r){const s=function(t,e,i,n){let r=t.text;return r&&"string"!=typeof r&&(r=r.reduce(((t,e)=>t.length>e.length?t:e))),e+i.size/2+n.measureText(r).width}(n,t,e,i),o=function(t,e,i){let n=t;return"string"!=typeof e.text&&(n=js(e,i)),n}(r,n,e.lineHeight);return{itemWidth:s,itemHeight:o}}(i,e,r,t,n);s>0&&f+m+2*o>h&&(c+=u+o,l.push({width:u,height:f}),d+=u+o,p++,u=f=0),a[s]={left:d,top:f,col:p,width:g,height:m},u=Math.max(u,g),f+=m+o})),c+=u,l.push({width:u,height:f}),c}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:n},rtl:r}}=this,s=Ti(r,this.left,this.width);if(this.isHorizontal()){let r=0,o=te(i,this.left+n,this.right-this.lineWidths[r]);for(const a of e)r!==a.row&&(r=a.row,o=te(i,this.left+n,this.right-this.lineWidths[r])),a.top+=this.top+t+n,a.left=s.leftForLtr(s.x(o),a.width),o+=a.width+n}else{let r=0,o=te(i,this.top+t+n,this.bottom-this.columnSizes[r].height);for(const a of e)a.col!==r&&(r=a.col,o=te(i,this.top+t+n,this.bottom-this.columnSizes[r].height)),a.top=o,a.left+=this.left+n,a.left=s.leftForLtr(s.x(a.left),a.width),o+=a.height+n}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const t=this.ctx;De(t,this),this._draw(),Ce(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:n}=this,{align:r,labels:s}=t,o=ye.color,a=Ti(t.rtl,this.left,this.width),l=Ue(s.font),{padding:h}=s,c=l.size,u=c/2;let f;this.drawTitle(),n.textAlign=a.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=l.string;const{boxWidth:d,boxHeight:p,itemHeight:g}=zs(s,c),m=this.isHorizontal(),b=this._computeTitleHeight();f=m?{x:te(r,this.left+h,this.right-i[0]),y:this.top+h+b,line:0}:{x:this.left+h,y:te(r,this.top+b+h,this.bottom-e[0].height),line:0},Ei(this.ctx,t.textDirection);const _=g+h;this.legendItems.forEach(((x,v)=>{n.strokeStyle=x.fontColor,n.fillStyle=x.fontColor;const y=n.measureText(x.text).width,w=a.textAlign(x.textAlign||(x.textAlign=s.textAlign)),k=d+u+y;let M=f.x,S=f.y;if(a.setWidth(this.width),m?v>0&&M+k+h>this.right&&(S=f.y+=_,f.line++,M=f.x=te(r,this.left+h,this.right-i[f.line])):v>0&&S+_>this.bottom&&(M=f.x=M+e[f.line].width+h,f.line++,S=f.y=te(r,this.top+b+h,this.bottom-e[f.line].height)),function(t,e,i){if(isNaN(d)||d<=0||isNaN(p)||p<0)return;n.save();const r=rt(i.lineWidth,1);if(n.fillStyle=rt(i.fillStyle,o),n.lineCap=rt(i.lineCap,"butt"),n.lineDashOffset=rt(i.lineDashOffset,0),n.lineJoin=rt(i.lineJoin,"miter"),n.lineWidth=r,n.strokeStyle=rt(i.strokeStyle,o),n.setLineDash(rt(i.lineDash,[])),s.usePointStyle){const o={radius:p*Math.SQRT2/2,pointStyle:i.pointStyle,rotation:i.rotation,borderWidth:r},l=a.xPlus(t,d/2);Ae(n,o,l,e+u,s.pointStyleWidth&&d)}else{const s=e+Math.max((c-p)/2,0),o=a.leftForLtr(t,d),l=He(i.borderRadius);n.beginPath(),Object.values(l).some((t=>0!==t))?ze(n,{x:o,y:s,w:d,h:p,radius:l}):n.rect(o,s,d,p),n.fill(),0!==r&&n.stroke()}n.restore()}(a.x(M),S,x),M=((t,e,i,n)=>t===(n?"left":"right")?i:"center"===t?(e+i)/2:e)(w,M+d+u,m?M+k:this.right,t.rtl),function(t,e,i){Le(n,i.text,t,e+g/2,l,{strikethrough:i.hidden,textAlign:a.textAlign(i.textAlign)})}(a.x(M),S,x),m)f.x+=k+h;else if("string"!=typeof x.text){const t=l.lineHeight;f.y+=js(x,t)}else f.y+=_})),Li(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=Ue(e.font),n=$e(e.padding);if(!e.display)return;const r=Ti(t.rtl,this.left,this.width),s=this.ctx,o=e.position,a=i.size/2,l=n.top+a;let h,c=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),h=this.top+l,c=te(t.align,c,this.right-u);else{const e=this.columnSizes.reduce(((t,e)=>Math.max(t,e.height)),0);h=l+te(t.align,this.top,this.bottom-e-t.labels.padding-this._computeTitleHeight())}const f=te(o,c,c+u);s.textAlign=r.textAlign(Qt(o)),s.textBaseline="middle",s.strokeStyle=e.color,s.fillStyle=e.color,s.font=i.string,Le(s,e.text,f,h,i)}_computeTitleHeight(){const t=this.options.title,e=Ue(t.font),i=$e(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,n,r;if($t(t,this.left,this.right)&&$t(e,this.top,this.bottom))for(r=this.legendHitBoxes,i=0;i<r.length;++i)if(n=r[i],$t(t,n.left,n.left+n.width)&&$t(e,n.top,n.top+n.height))return this.legendItems[i];return null}handleEvent(t){const e=this.options;if(!function(t,e){return!("mousemove"!==t&&"mouseout"!==t||!e.onHover&&!e.onLeave)||!(!e.onClick||"click"!==t&&"mouseup"!==t)}(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if("mousemove"===t.type||"mouseout"===t.type){const n=this._hoveredItem,r=((t,e)=>null!==t&&null!==e&&t.datasetIndex===e.datasetIndex&&t.index===e.index)(n,i);n&&!r&&ot(e.onLeave,[t,n,this],this),this._hoveredItem=i,i&&!r&&ot(e.onHover,[t,i,this],this)}else i&&ot(e.onClick,[t,i,this],this)}}function js(t,e){return e*(t.text?t.text.length+.5:0)}var Vs={id:"legend",_element:Fs,start(t,e,i){const n=t.legend=new Fs({ctx:t.ctx,options:i,chart:t});Vn.configure(t,n,i),Vn.addBox(t,n)},stop(t){Vn.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,i){const n=t.legend;Vn.configure(t,n,i),n.options=i},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,i){const n=e.datasetIndex,r=i.chart;r.isDatasetVisible(n)?(r.hide(n),e.hidden=!0):(r.show(n),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:i,pointStyle:n,textAlign:r,color:s,useBorderRadius:o,borderRadius:a}}=t.legend.options;return t._getSortedDatasetMetas().map((t=>{const l=t.controller.getStyle(i?0:void 0),h=$e(l.borderWidth);return{text:e[t.index].label,fillStyle:l.backgroundColor,fontColor:s,hidden:!t.visible,lineCap:l.borderCapStyle,lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:l.borderColor,pointStyle:n||l.pointStyle,rotation:l.rotation,textAlign:r||l.textAlign,borderRadius:o&&(a||l.borderRadius),datasetIndex:t.index}}),this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class Bs extends nr{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,e){const i=this.options;if(this.left=0,this.top=0,!i.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=t,this.height=this.bottom=e;const n=tt(i.text)?i.text.length:1;this._padding=$e(i.padding);const r=n*Ue(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){const t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){const{top:e,left:i,bottom:n,right:r,options:s}=this,o=s.align;let a,l,h,c=0;return this.isHorizontal()?(l=te(o,i,r),h=e+t,a=r-i):("left"===s.position?(l=i+t,h=te(o,n,e),c=-.5*yt):(l=r-t,h=te(o,e,n),c=.5*yt),a=n-e),{titleX:l,titleY:h,maxWidth:a,rotation:c}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=Ue(e.font),n=i.lineHeight/2+this._padding.top,{titleX:r,titleY:s,maxWidth:o,rotation:a}=this._drawArgs(n);Le(t,e.text,0,0,i,{color:e.color,maxWidth:o,rotation:a,textAlign:Qt(e.align),textBaseline:"middle",translation:[r,s]})}}var Ws={id:"title",_element:Bs,start(t,e,i){!function(t,e){const i=new Bs({ctx:t.ctx,options:e,chart:t});Vn.configure(t,i,e),Vn.addBox(t,i),t.titleBlock=i}(t,i)},stop(t){const e=t.titleBlock;Vn.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){const n=t.titleBlock;Vn.configure(t,n,i),n.options=i},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 Ns=new WeakMap;var Hs={id:"subtitle",start(t,e,i){const n=new Bs({ctx:t.ctx,options:i,chart:t});Vn.configure(t,n,i),Vn.addBox(t,n),Ns.set(t,n)},stop(t){Vn.removeBox(t,Ns.get(t)),Ns.delete(t)},beforeUpdate(t,e,i){const n=Ns.get(t);Vn.configure(t,n,i),n.options=i},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 $s={average(t){if(!t.length)return!1;let e,i,n=0,r=0,s=0;for(e=0,i=t.length;e<i;++e){const i=t[e].element;if(i&&i.hasValue()){const t=i.tooltipPosition();n+=t.x,r+=t.y,++s}}return{x:n/s,y:r/s}},nearest(t,e){if(!t.length)return!1;let i,n,r,s=e.x,o=e.y,a=Number.POSITIVE_INFINITY;for(i=0,n=t.length;i<n;++i){const n=t[i].element;if(n&&n.hasValue()){const t=Vt(e,n.getCenterPoint());t<a&&(a=t,r=n)}}if(r){const t=r.tooltipPosition();s=t.x,o=t.y}return{x:s,y:o}}};function Us(t,e){return e&&(tt(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function Ys(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function qs(t,e){const{element:i,datasetIndex:n,index:r}=e,s=t.getDatasetMeta(n).controller,{label:o,value:a}=s.getLabelAndValue(r);return{chart:t,label:o,parsed:s.getParsed(r),raw:t.data.datasets[n].data[r],formattedValue:a,dataset:s.getDataset(),dataIndex:r,datasetIndex:n,element:i}}function Xs(t,e){const i=t.chart.ctx,{body:n,footer:r,title:s}=t,{boxWidth:o,boxHeight:a}=e,l=Ue(e.bodyFont),h=Ue(e.titleFont),c=Ue(e.footerFont),u=s.length,f=r.length,d=n.length,p=$e(e.padding);let g=p.height,m=0,b=n.reduce(((t,e)=>t+e.before.length+e.lines.length+e.after.length),0);b+=t.beforeBody.length+t.afterBody.length,u&&(g+=u*h.lineHeight+(u-1)*e.titleSpacing+e.titleMarginBottom),b&&(g+=d*(e.displayColors?Math.max(a,l.lineHeight):l.lineHeight)+(b-d)*l.lineHeight+(b-1)*e.bodySpacing),f&&(g+=e.footerMarginTop+f*c.lineHeight+(f-1)*e.footerSpacing);let _=0;const x=function(t){m=Math.max(m,i.measureText(t).width+_)};return i.save(),i.font=h.string,at(t.title,x),i.font=l.string,at(t.beforeBody.concat(t.afterBody),x),_=e.displayColors?o+2+e.boxPadding:0,at(n,(t=>{at(t.before,x),at(t.lines,x),at(t.after,x)})),_=0,i.font=c.string,at(t.footer,x),i.restore(),m+=p.width,{width:m,height:g}}function Ks(t,e,i,n){const{x:r,width:s}=i,{width:o,chartArea:{left:a,right:l}}=t;let h="center";return"center"===n?h=r<=(a+l)/2?"left":"right":r<=s/2?h="left":r>=o-s/2&&(h="right"),function(t,e,i,n){const{x:r,width:s}=n,o=i.caretSize+i.caretPadding;return"left"===t&&r+s+o>e.width||"right"===t&&r-s-o<0||void 0}(h,t,e,i)&&(h="center"),h}function Zs(t,e,i){const n=i.yAlign||e.yAlign||function(t,e){const{y:i,height:n}=e;return i<n/2?"top":i>t.height-n/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||Ks(t,e,i,n),yAlign:n}}function Gs(t,e,i,n){const{caretSize:r,caretPadding:s,cornerRadius:o}=t,{xAlign:a,yAlign:l}=i,h=r+s,{topLeft:c,topRight:u,bottomLeft:f,bottomRight:d}=He(o);let p=function(t,e){let{x:i,width:n}=t;return"right"===e?i-=n:"center"===e&&(i-=n/2),i}(e,a);const g=function(t,e,i){let{y:n,height:r}=t;return"top"===e?n+=i:n-="bottom"===e?r+i:r/2,n}(e,l,h);return"center"===l?"left"===a?p+=h:"right"===a&&(p-=h):"left"===a?p-=Math.max(c,f)+r:"right"===a&&(p+=Math.max(u,d)+r),{x:Ht(p,0,n.width-e.width),y:Ht(g,0,n.height-e.height)}}function Js(t,e,i){const n=$e(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-n.right:t.x+n.left}function Qs(t){return Us([],Ys(t))}function to(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}const eo={beforeTitle:G,title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,n=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(n>0&&e.dataIndex<n)return i[e.dataIndex]}return""},afterTitle:G,beforeBody:G,beforeLabel:G,label(t){if(this&&this.options&&"dataset"===this.options.mode)return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const i=t.formattedValue;return Q(i)||(e+=i),e},labelColor(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:G,afterBody:G,beforeFooter:G,footer:G,afterFooter:G};function io(t,e,i,n){const r=t[e].call(i,n);return void 0===r?eo[e].call(i,n):r}class no extends nr{static positioners=$s;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 e=this.chart,i=this.options.setContext(this.getContext()),n=i.enabled&&e.options.animation&&i.animations,r=new Yi(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=(t=this.chart.getContext(),e=this,i=this._tooltipItems,qe(t,{tooltip:e,tooltipItems:i,type:"tooltip"})));var t,e,i}getTitle(t,e){const{callbacks:i}=e,n=io(i,"beforeTitle",this,t),r=io(i,"title",this,t),s=io(i,"afterTitle",this,t);let o=[];return o=Us(o,Ys(n)),o=Us(o,Ys(r)),o=Us(o,Ys(s)),o}getBeforeBody(t,e){return Qs(io(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,n=[];return at(t,(t=>{const e={before:[],lines:[],after:[]},r=to(i,t);Us(e.before,Ys(io(r,"beforeLabel",this,t))),Us(e.lines,io(r,"label",this,t)),Us(e.after,Ys(io(r,"afterLabel",this,t))),n.push(e)})),n}getAfterBody(t,e){return Qs(io(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,n=io(i,"beforeFooter",this,t),r=io(i,"footer",this,t),s=io(i,"afterFooter",this,t);let o=[];return o=Us(o,Ys(n)),o=Us(o,Ys(r)),o=Us(o,Ys(s)),o}_createItems(t){const e=this._active,i=this.chart.data,n=[],r=[],s=[];let o,a,l=[];for(o=0,a=e.length;o<a;++o)l.push(qs(this.chart,e[o]));return t.filter&&(l=l.filter(((e,n,r)=>t.filter(e,n,r,i)))),t.itemSort&&(l=l.sort(((e,n)=>t.itemSort(e,n,i)))),at(l,(e=>{const i=to(t.callbacks,e);n.push(io(i,"labelColor",this,e)),r.push(io(i,"labelPointStyle",this,e)),s.push(io(i,"labelTextColor",this,e))})),this.labelColors=n,this.labelPointStyles=r,this.labelTextColors=s,this.dataPoints=l,l}update(t,e){const i=this.options.setContext(this.getContext()),n=this._active;let r,s=[];if(n.length){const t=$s[i.position].call(this,n,this._eventPosition);s=this._createItems(i),this.title=this.getTitle(s,i),this.beforeBody=this.getBeforeBody(s,i),this.body=this.getBody(s,i),this.afterBody=this.getAfterBody(s,i),this.footer=this.getFooter(s,i);const e=this._size=Xs(this,i),o=Object.assign({},t,e),a=Zs(this.chart,i,o),l=Gs(i,o,a,this.chart);this.xAlign=a.xAlign,this.yAlign=a.yAlign,r={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(r={opacity:0});this._tooltipItems=s,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,n){const r=this.getCaretPosition(t,i,n);e.lineTo(r.x1,r.y1),e.lineTo(r.x2,r.y2),e.lineTo(r.x3,r.y3)}getCaretPosition(t,e,i){const{xAlign:n,yAlign:r}=this,{caretSize:s,cornerRadius:o}=i,{topLeft:a,topRight:l,bottomLeft:h,bottomRight:c}=He(o),{x:u,y:f}=t,{width:d,height:p}=e;let g,m,b,_,x,v;return"center"===r?(x=f+p/2,"left"===n?(g=u,m=g-s,_=x+s,v=x-s):(g=u+d,m=g+s,_=x-s,v=x+s),b=g):(m="left"===n?u+Math.max(a,h)+s:"right"===n?u+d-Math.max(l,c)-s:this.caretX,"top"===r?(_=f,x=_-s,g=m-s,b=m+s):(_=f+p,x=_+s,g=m+s,b=m-s),v=_),{x1:g,x2:m,x3:b,y1:_,y2:x,y3:v}}drawTitle(t,e,i){const n=this.title,r=n.length;let s,o,a;if(r){const l=Ti(i.rtl,this.x,this.width);for(t.x=Js(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",s=Ue(i.titleFont),o=i.titleSpacing,e.fillStyle=i.titleColor,e.font=s.string,a=0;a<r;++a)e.fillText(n[a],l.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+o,a+1===r&&(t.y+=i.titleMarginBottom-o)}}_drawColorBox(t,e,i,n,r){const s=this.labelColors[i],o=this.labelPointStyles[i],{boxHeight:a,boxWidth:l,boxPadding:h}=r,c=Ue(r.bodyFont),u=Js(this,"left",r),f=n.x(u),d=a<c.lineHeight?(c.lineHeight-a)/2:0,p=e.y+d;if(r.usePointStyle){const e={radius:Math.min(l,a)/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:1},i=n.leftForLtr(f,l)+l/2,h=p+a/2;t.strokeStyle=r.multiKeyBackground,t.fillStyle=r.multiKeyBackground,Pe(t,e,i,h),t.strokeStyle=s.borderColor,t.fillStyle=s.backgroundColor,Pe(t,e,i,h)}else{t.lineWidth=et(s.borderWidth)?Math.max(...Object.values(s.borderWidth)):s.borderWidth||1,t.strokeStyle=s.borderColor,t.setLineDash(s.borderDash||[]),t.lineDashOffset=s.borderDashOffset||0;const e=n.leftForLtr(f,l-h),i=n.leftForLtr(n.xPlus(f,1),l-h-2),o=He(s.borderRadius);Object.values(o).some((t=>0!==t))?(t.beginPath(),t.fillStyle=r.multiKeyBackground,ze(t,{x:e,y:p,w:l,h:a,radius:o}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),ze(t,{x:i,y:p+1,w:l-2,h:a-2,radius:o}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(e,p,l,a),t.strokeRect(e,p,l,a),t.fillStyle=s.backgroundColor,t.fillRect(i,p+1,l-2,a-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:n}=this,{bodySpacing:r,bodyAlign:s,displayColors:o,boxHeight:a,boxWidth:l,boxPadding:h}=i,c=Ue(i.bodyFont);let u=c.lineHeight,f=0;const d=Ti(i.rtl,this.x,this.width),p=function(i){e.fillText(i,d.x(t.x+f),t.y+u/2),t.y+=u+r},g=d.textAlign(s);let m,b,_,x,v,y,w;for(e.textAlign=s,e.textBaseline="middle",e.font=c.string,t.x=Js(this,g,i),e.fillStyle=i.bodyColor,at(this.beforeBody,p),f=o&&"right"!==g?"center"===s?l/2+h:l+2+h:0,x=0,y=n.length;x<y;++x){for(m=n[x],b=this.labelTextColors[x],e.fillStyle=b,at(m.before,p),_=m.lines,o&&_.length&&(this._drawColorBox(e,t,x,d,i),u=Math.max(c.lineHeight,a)),v=0,w=_.length;v<w;++v)p(_[v]),u=c.lineHeight;at(m.after,p)}f=0,u=c.lineHeight,at(this.afterBody,p),t.y-=r}drawFooter(t,e,i){const n=this.footer,r=n.length;let s,o;if(r){const a=Ti(i.rtl,this.x,this.width);for(t.x=Js(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=a.textAlign(i.footerAlign),e.textBaseline="middle",s=Ue(i.footerFont),e.fillStyle=i.footerColor,e.font=s.string,o=0;o<r;++o)e.fillText(n[o],a.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+i.footerSpacing}}drawBackground(t,e,i,n){const{xAlign:r,yAlign:s}=this,{x:o,y:a}=t,{width:l,height:h}=i,{topLeft:c,topRight:u,bottomLeft:f,bottomRight:d}=He(n.cornerRadius);e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.beginPath(),e.moveTo(o+c,a),"top"===s&&this.drawCaret(t,e,i,n),e.lineTo(o+l-u,a),e.quadraticCurveTo(o+l,a,o+l,a+u),"center"===s&&"right"===r&&this.drawCaret(t,e,i,n),e.lineTo(o+l,a+h-d),e.quadraticCurveTo(o+l,a+h,o+l-d,a+h),"bottom"===s&&this.drawCaret(t,e,i,n),e.lineTo(o+f,a+h),e.quadraticCurveTo(o,a+h,o,a+h-f),"center"===s&&"left"===r&&this.drawCaret(t,e,i,n),e.lineTo(o,a+c),e.quadraticCurveTo(o,a,o+c,a),e.closePath(),e.fill(),n.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,n=i&&i.x,r=i&&i.y;if(n||r){const i=$s[t.position].call(this,this._active,this._eventPosition);if(!i)return;const s=this._size=Xs(this,t),o=Object.assign({},i,this._size),a=Zs(e,t,o),l=Gs(t,o,a,e);n._to===l.x&&r._to===l.y||(this.xAlign=a.xAlign,this.yAlign=a.yAlign,this.width=s.width,this.height=s.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,l))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},r={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const s=$e(e.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&o&&(t.save(),t.globalAlpha=i,this.drawBackground(r,t,n,e),Ei(t,e.textDirection),r.y+=s.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),Li(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,n=t.map((({datasetIndex:t,index:e})=>{const i=this.chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}})),r=!lt(i,n),s=this._positionChanged(n,e);(r||s)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,r=this._active||[],s=this._getActiveElements(t,r,e,i),o=this._positionChanged(s,t),a=e||!lt(s,r)||o;return a&&(this._active=s,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),a}_getActiveElements(t,e,i,n){const r=this.options;if("mouseout"===t.type)return[];if(!n)return e;const s=this.chart.getElementsAtEventForMode(t,r.mode,r,i);return r.reverse&&s.reverse(),s}_positionChanged(t,e){const{caretX:i,caretY:n,options:r}=this,s=$s[r.position].call(this,t,e);return!1!==s&&(i!==s.x||n!==s.y)}}var ro={id:"tooltip",_element:no,positioners:$s,afterInit(t,e,i){i&&(t.tooltip=new no({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const i={tooltip:e};if(!1===t.notifyPlugins("beforeTooltipDraw",{...i,cancelable:!0}))return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i)}},afterEvent(t,e){if(t.tooltip){const i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.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:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.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:eo},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},so=Object.freeze({__proto__:null,Colors:gs,Decimation:_s,Filler:Is,Legend:Vs,SubTitle:Hs,Title:Ws,Tooltip:ro});function oo(t,e,i,n){const r=t.indexOf(e);return-1===r?((t,e,i,n)=>("string"==typeof e?(i=t.push(e)-1,n.unshift({index:i,label:e})):isNaN(e)&&(i=null),i))(t,e,i,n):r!==t.lastIndexOf(e)?i:r}function ao(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}function lo(t,e){const i=[],{bounds:n,step:r,min:s,max:o,precision:a,count:l,maxTicks:h,maxDigits:c,includeBounds:u}=t,f=r||1,d=h-1,{min:p,max:g}=e,m=!Q(s),b=!Q(o),_=!Q(l),x=(g-p)/(c+1);let v,y,w,k,M=Et((g-p)/d/f)*f;if(M<1e-14&&!m&&!b)return[{value:p},{value:g}];k=Math.ceil(g/M)-Math.floor(p/M),k>d&&(M=Et(k*M/d/f)*f),Q(a)||(v=Math.pow(10,a),M=Math.ceil(M*v)/v),"ticks"===n?(y=Math.floor(p/M)*M,w=Math.ceil(g/M)*M):(y=p,w=g),m&&b&&r&&function(t,e){const i=Math.round(t);return i-e<=t&&i+e>=t}((o-s)/r,M/1e3)?(k=Math.round(Math.min((o-s)/M,h)),M=(o-s)/k,y=s,w=o):_?(y=m?s:y,w=b?o:w,k=l-1,M=(w-y)/k):(k=(w-y)/M,k=Tt(k,Math.round(k),M/1e3)?Math.round(k):Math.ceil(k));const S=Math.max(Ft(M),Ft(y));v=Math.pow(10,Q(a)?S:a),y=Math.round(y*v)/v,w=Math.round(w*v)/v;let P=0;for(m&&(u&&y!==s?(i.push({value:s}),y<s&&P++,Tt(Math.round((y+P*M)*v)/v,s,ho(s,x,t))&&P++):y<s&&P++);P<k;++P)i.push({value:Math.round((y+P*M)*v)/v});return b&&u&&w!==o?i.length&&Tt(i[i.length-1].value,o,ho(o,x,t))?i[i.length-1].value=o:i.push({value:o}):b&&w!==o||i.push({value:w}),i}function ho(t,e,{horizontal:i,minRotation:n}){const r=It(n),s=(i?Math.sin(r):Math.cos(r))||.001,o=.75*e*(""+t).length;return Math.min(e/s,o)}class co extends dr{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,e){return Q(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:n,max:r}=this;const s=t=>n=e?n:t,o=t=>r=i?r:t;if(t){const t=Ct(n),e=Ct(r);t<0&&e<0?o(0):t>0&&e>0&&s(0)}if(n===r){let e=0===r?1:Math.abs(.05*r);o(r+e),t||s(n-e)}this.min=n,this.max=r}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:n}=t;return n?(e=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const n=lo({maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},this._range||this);return"ticks"===t.bounds&&Rt(n,this,"value"),t.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const n=(i-e)/Math.max(t.length-1,1)/2;e-=n,i+=n}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return de(t,this.chart.options.locale,this.options.ticks.format)}}class uo extends co{static id="linear";static defaults={ticks:{callback:ge.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=it(t)?t:0,this.max=it(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=It(this.options.ticks.minRotation),n=(t?Math.sin(i):Math.cos(i))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,r.lineHeight/n))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const fo=t=>Math.floor(Dt(t)),po=(t,e)=>Math.pow(10,fo(t)+e);function go(t){return 1==t/Math.pow(10,fo(t))}function mo(t,e,i){const n=Math.pow(10,i),r=Math.floor(t/n);return Math.ceil(e/n)-r}function bo(t,{min:e,max:i}){e=nt(t.min,e);const n=[],r=fo(e);let s=function(t,e){let i=fo(e-t);for(;mo(t,e,i)>10;)i++;for(;mo(t,e,i)<10;)i--;return Math.min(i,fo(t))}(e,i),o=s<0?Math.pow(10,Math.abs(s)):1;const a=Math.pow(10,s),l=r>s?Math.pow(10,r):0,h=Math.round((e-l)*o)/o,c=Math.floor((e-l)/a/10)*a*10;let u=Math.floor((h-c)/Math.pow(10,s)),f=nt(t.min,Math.round((l+c+u*Math.pow(10,s))*o)/o);for(;f<i;)n.push({value:f,major:go(f),significand:u}),u>=10?u=u<15?15:20:u++,u>=20&&(s++,u=2,o=s>=0?1:o),f=Math.round((l+c+u*Math.pow(10,s))*o)/o;const d=nt(t.max,f);return n.push({value:d,major:go(d),significand:u}),n}class _o extends dr{static id="logarithmic";static defaults={ticks:{callback:ge.formatters.logarithmic,major:{enabled:!0}}};constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=co.prototype.parse.apply(this,[t,e]);if(0!==i)return it(i)&&i>0?i:null;this._zero=!0}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=it(t)?Math.max(0,t):null,this.max=it(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!it(this._userMin)&&(this.min=t===po(this.min,0)?po(this.min,-1):po(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,n=this.max;const r=e=>i=t?i:e,s=t=>n=e?n:t;i===n&&(i<=0?(r(1),s(10)):(r(po(i,-1)),s(po(n,1)))),i<=0&&r(po(n,-1)),n<=0&&s(po(i,1)),this.min=i,this.max=n}buildTicks(){const t=this.options,e=bo({min:this._userMin,max:this._userMax},this);return"ticks"===t.bounds&&Rt(e,this,"value"),t.reverse?(e.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),e}getLabelForValue(t){return void 0===t?"0":de(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Dt(t),this._valueRange=Dt(this.max)-Dt(t)}getPixelForValue(t){return void 0!==t&&0!==t||(t=this.min),null===t||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Dt(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function xo(t){const e=t.ticks;if(e.display&&t.display){const t=$e(e.backdropPadding);return rt(e.font&&e.font.size,ye.font.size)+t.height}return 0}function vo(t,e,i,n,r){return t===n||t===r?{start:e-i/2,end:e+i/2}:t<n||t>r?{start:e-i,end:e}:{start:e,end:e+i}}function yo(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},i=Object.assign({},e),n=[],r=[],s=t._pointLabels.length,o=t.options.pointLabels,a=o.centerPointLabels?yt/s:0;for(let u=0;u<s;u++){const s=o.setContext(t.getPointLabelContext(u));r[u]=s.padding;const f=t.getPointPosition(u,t.drawingArea+r[u],a),d=Ue(s.font),p=(l=t.ctx,h=d,c=tt(c=t._pointLabels[u])?c:[c],{w:ke(l,h.string,c),h:c.length*h.lineHeight});n[u]=p;const g=Wt(t.getIndexAngle(u)+a),m=Math.round(zt(g));wo(i,e,g,vo(m,f.x,p.w,0,180),vo(m,f.y,p.h,90,270))}var l,h,c;t.setCenterPoint(e.l-i.l,i.r-e.r,e.t-i.t,i.b-e.b),t._pointLabelItems=function(t,e,i){const n=[],r=t._pointLabels.length,s=t.options,o=xo(s)/2,a=t.drawingArea,l=s.pointLabels.centerPointLabels?yt/r:0;for(let h=0;h<r;h++){const r=t.getPointPosition(h,a+o+i[h],l),s=Math.round(zt(Wt(r.angle+Pt))),c=e[h],u=So(r.y,c.h,s),f=ko(s),d=Mo(r.x,c.w,f);n.push({x:r.x,y:u,textAlign:f,left:d,top:u,right:d+c.w,bottom:u+c.h})}return n}(t,n,r)}function wo(t,e,i,n,r){const s=Math.abs(Math.sin(i)),o=Math.abs(Math.cos(i));let a=0,l=0;n.start<e.l?(a=(e.l-n.start)/s,t.l=Math.min(t.l,e.l-a)):n.end>e.r&&(a=(n.end-e.r)/s,t.r=Math.max(t.r,e.r+a)),r.start<e.t?(l=(e.t-r.start)/o,t.t=Math.min(t.t,e.t-l)):r.end>e.b&&(l=(r.end-e.b)/o,t.b=Math.max(t.b,e.b+l))}function ko(t){return 0===t||180===t?"center":t<180?"left":"right"}function Mo(t,e,i){return"right"===i?t-=e:"center"===i&&(t-=e/2),t}function So(t,e,i){return 90===i||270===i?t-=e/2:(i>270||i<90)&&(t-=e),t}function Po(t,e,i,n){const{ctx:r}=t;if(i)r.arc(t.xCenter,t.yCenter,e,0,wt);else{let i=t.getPointPosition(0,e);r.moveTo(i.x,i.y);for(let s=1;s<n;s++)i=t.getPointPosition(s,e),r.lineTo(i.x,i.y)}}class Ao extends co{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:ge.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=$e(xo(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=it(t)&&!isNaN(t)?t:0,this.max=it(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/xo(this.options))}generateTickLabels(t){co.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map(((t,e)=>{const i=ot(this.options.pointLabels.callback,[t,e],this);return i||0===i?i:""})).filter(((t,e)=>this.chart.getDataVisibility(e)))}fit(){const t=this.options;t.display&&t.pointLabels.display?yo(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,n){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-n)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,n))}getIndexAngle(t){return Wt(t*(wt/(this._pointLabels.length||1))+It(this.options.startAngle||0))}getDistanceFromCenterForValue(t){if(Q(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(Q(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const i=e[t];return function(t,e,i){return qe(t,{label:i,index:e,type:"pointLabel"})}(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const n=this.getIndexAngle(t)-Pt+i;return{x:Math.cos(n)*e+this.xCenter,y:Math.sin(n)*e+this.yCenter,angle:n}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:i,right:n,bottom:r}=this._pointLabelItems[t];return{left:e,top:i,right:n,bottom:r}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),Po(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:n,border:r}=e,s=this._pointLabels.length;let o,a,l;if(e.pointLabels.display&&function(t,e){const{ctx:i,options:{pointLabels:n}}=t;for(let r=e-1;r>=0;r--){const e=n.setContext(t.getPointLabelContext(r)),s=Ue(e.font),{x:o,y:a,textAlign:l,left:h,top:c,right:u,bottom:f}=t._pointLabelItems[r],{backdropColor:d}=e;if(!Q(d)){const t=He(e.borderRadius),n=$e(e.backdropPadding);i.fillStyle=d;const r=h-n.left,s=c-n.top,o=u-h+n.width,a=f-c+n.height;Object.values(t).some((t=>0!==t))?(i.beginPath(),ze(i,{x:r,y:s,w:o,h:a,radius:t}),i.fill()):i.fillRect(r,s,o,a)}Le(i,t._pointLabels[r],o,a+s.lineHeight/2,s,{color:e.color,textAlign:l,textBaseline:"middle"})}}(this,s),n.display&&this.ticks.forEach(((t,e)=>{if(0!==e){a=this.getDistanceFromCenterForValue(t.value);const i=this.getContext(e),o=n.setContext(i),l=r.setContext(i);!function(t,e,i,n,r){const s=t.ctx,o=e.circular,{color:a,lineWidth:l}=e;!o&&!n||!a||!l||i<0||(s.save(),s.strokeStyle=a,s.lineWidth=l,s.setLineDash(r.dash),s.lineDashOffset=r.dashOffset,s.beginPath(),Po(t,i,o,n),s.closePath(),s.stroke(),s.restore())}(this,o,a,s,l)}})),i.display){for(t.save(),o=s-1;o>=0;o--){const n=i.setContext(this.getPointLabelContext(o)),{color:r,lineWidth:s}=n;s&&r&&(t.lineWidth=s,t.strokeStyle=r,t.setLineDash(n.borderDash),t.lineDashOffset=n.borderDashOffset,a=this.getDistanceFromCenterForValue(e.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,e=this.options,i=e.ticks;if(!i.display)return;const n=this.getIndexAngle(0);let r,s;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(n),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach(((n,o)=>{if(0===o&&!e.reverse)return;const a=i.setContext(this.getContext(o)),l=Ue(a.font);if(r=this.getDistanceFromCenterForValue(this.ticks[o].value),a.showLabelBackdrop){t.font=l.string,s=t.measureText(n.label).width,t.fillStyle=a.backdropColor;const e=$e(a.backdropPadding);t.fillRect(-s/2-e.left,-r-l.size/2-e.top,s+e.width,l.size+e.height)}Le(t,n.label,0,-r,l,{color:a.color})})),t.restore()}drawTitle(){}}const Oo={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}},Do=Object.keys(Oo);function Co(t,e){return t-e}function To(t,e){if(Q(e))return null;const i=t._adapter,{parser:n,round:r,isoWeekday:s}=t._parseOpts;let o=e;return"function"==typeof n&&(o=n(o)),it(o)||(o="string"==typeof n?i.parse(o,n):i.parse(o)),null===o?null:(r&&(o="week"!==r||!Lt(s)&&!0!==s?i.startOf(o,r):i.startOf(o,"isoWeek",s)),+o)}function Eo(t,e,i,n){const r=Do.length;for(let s=Do.indexOf(t);s<r-1;++s){const t=Oo[Do[s]],r=t.steps?t.steps:Number.MAX_SAFE_INTEGER;if(t.common&&Math.ceil((i-e)/(r*t.size))<=n)return Do[s]}return Do[r-1]}function Lo(t,e,i){if(i){if(i.length){const{lo:n,hi:r}=Ut(i,e);t[i[n]>=e?i[n]:i[r]]=!0}}else t[e]=!0}function Ro(t,e,i){const n=[],r={},s=e.length;let o,a;for(o=0;o<s;++o)a=e[o],r[a]=o,n.push({value:a,major:!1});return 0!==s&&i?function(t,e,i,n){const r=t._adapter,s=+r.startOf(e[0].value,n),o=e[e.length-1].value;let a,l;for(a=s;a<=o;a=+r.add(a,1,n))l=i[a],l>=0&&(e[l].major=!0);return e}(t,n,r,i):n}class Io extends dr{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const i=t.time||(t.time={}),n=this._adapter=new xn(t.adapters.date);n.init(e),dt(i.displayFormats,n.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:To(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:n,max:r,minDefined:s,maxDefined:o}=this.getUserBounds();function a(t){s||isNaN(t.min)||(n=Math.min(n,t.min)),o||isNaN(t.max)||(r=Math.max(r,t.max))}s&&o||(a(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||a(this.getMinMax(!1))),n=it(n)&&!isNaN(n)?n:+e.startOf(Date.now(),i),r=it(r)&&!isNaN(r)?r:+e.endOf(Date.now(),i)+1,this.min=Math.min(n,r-1),this.max=Math.max(n+1,r)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,n="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);const r=this.min,s=function(t,e,i){let n=0,r=t.length;for(;n<r&&t[n]<e;)n++;for(;r>n&&t[r-1]>i;)r--;return n>0||r<t.length?t.slice(n,r):t}(n,r,this.max);return this._unit=e.unit||(i.autoSkip?Eo(e.minUnit,this.min,this.max,this._getLabelCapacity(r)):function(t,e,i,n,r){for(let s=Do.length-1;s>=Do.indexOf(i);s--){const i=Do[s];if(Oo[i].common&&t._adapter.diff(r,n,i)>=e-1)return i}return Do[i?Do.indexOf(i):0]}(this,s.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(t){for(let e=Do.indexOf(t)+1,i=Do.length;e<i;++e)if(Oo[Do[e]].common)return Do[e]}(this._unit):void 0,this.initOffsets(n),t.reverse&&s.reverse(),Ro(this,s,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map((t=>+t.value)))}initOffsets(t=[]){let e,i,n=0,r=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),n=1===t.length?1-e:(this.getDecimalForValue(t[1])-e)/2,i=this.getDecimalForValue(t[t.length-1]),r=1===t.length?i:(i-this.getDecimalForValue(t[t.length-2]))/2);const s=t.length<3?.5:.25;n=Ht(n,0,s),r=Ht(r,0,s),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,e=this.min,i=this.max,n=this.options,r=n.time,s=r.unit||Eo(r.minUnit,e,i,this._getLabelCapacity(e)),o=rt(n.ticks.stepSize,1),a="week"===s&&r.isoWeekday,l=Lt(a)||!0===a,h={};let c,u,f=e;if(l&&(f=+t.startOf(f,"isoWeek",a)),f=+t.startOf(f,l?"day":s),t.diff(i,e,s)>1e5*o)throw new Error(e+" and "+i+" are too far apart with stepSize of "+o+" "+s);const d="data"===n.ticks.source&&this.getDataTimestamps();for(c=f,u=0;c<i;c=+t.add(c,o,s),u++)Lo(h,c,d);return c!==i&&"ticks"!==n.bounds&&1!==u||Lo(h,c,d),Object.keys(h).sort(((t,e)=>t-e)).map((t=>+t))}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const i=this.options.time.displayFormats,n=this._unit,r=e||i[n];return this._adapter.format(t,r)}_tickFormatFunction(t,e,i,n){const r=this.options,s=r.ticks.callback;if(s)return ot(s,[t,e,i],this);const o=r.time.displayFormats,a=this._unit,l=this._majorUnit,h=a&&o[a],c=l&&o[l],u=i[e],f=l&&c&&u&&u.major;return this._adapter.format(t,n||(f?c:h))}generateTickLabels(t){let e,i,n;for(e=0,i=t.length;e<i;++e)n=t[e],n.label=this._tickFormatFunction(n.value,e,t)}getDecimalForValue(t){return null===t?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,n=It(this.isHorizontal()?e.maxRotation:e.minRotation),r=Math.cos(n),s=Math.sin(n),o=this._resolveTickFontOptions(0).size;return{w:i*r+o*s,h:i*s+o*r}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,n=i[e.unit]||i.millisecond,r=this._tickFormatFunction(t,0,Ro(this,[t],this._majorUnit),n),s=this._getLabelSize(r),o=Math.floor(this.isHorizontal()?this.width/s.w:this.height/s.h)-1;return o>0?o:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(t=0,e=n.length;t<e;++t)i=i.concat(n[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(i)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const n=this.getLabels();for(e=0,i=n.length;e<i;++e)t.push(To(this,n[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Zt(t.sort(Co))}}function zo(t,e,i){let n,r,s,o,a=0,l=t.length-1;i?(e>=t[a].pos&&e<=t[l].pos&&({lo:a,hi:l}=Yt(t,"pos",e)),({pos:n,time:s}=t[a]),({pos:r,time:o}=t[l])):(e>=t[a].time&&e<=t[l].time&&({lo:a,hi:l}=Yt(t,"time",e)),({time:n,pos:s}=t[a]),({time:r,pos:o}=t[l]));const h=r-n;return h?s+(o-s)*(e-n)/h:s}var Fo=Object.freeze({__proto__:null,CategoryScale:class extends dr{static id="category";static defaults={ticks:{callback:ao}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const t=this.getLabels();for(const{index:i,label:n}of e)t[i]===n&&t.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(Q(t))return null;const i=this.getLabels();return((t,e)=>null===t?null:Ht(Math.round(t),0,e))(e=isFinite(e)&&i[e]===t?e:oo(i,t,rt(e,t),this._addedLabels),i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:n}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(n=this.getLabels().length-1)),this.min=i,this.max=n}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,n=[];let r=this.getLabels();r=0===t&&e===r.length-1?r:r.slice(t,e+1),this._valueRange=Math.max(r.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let s=t;s<=e;s++)n.push({value:s});return n}getLabelForValue(t){return ao.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return"number"!=typeof t&&(t=this.parse(t)),null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}},LinearScale:uo,LogarithmicScale:_o,RadialLinearScale:Ao,TimeScale:Io,TimeSeriesScale:class extends Io{static id="timeseries";static defaults=Io.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=zo(e,this.min),this._tableRange=zo(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,n=[],r=[];let s,o,a,l,h;for(s=0,o=t.length;s<o;++s)l=t[s],l>=e&&l<=i&&n.push(l);if(n.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(s=0,o=n.length;s<o;++s)h=n[s+1],a=n[s-1],l=n[s],Math.round((h+a)/2)!==l&&r.push({time:l,pos:s/(o-1)});return r}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return t=e.length&&i.length?this.normalize(e.concat(i)):e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(zo(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return zo(this._table,i*this._tableRange+this._minPos,!0)}}});t("r",[mn,ls,so,Fo])}}}));