!function(){function t(t,e,i){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}System.register(["./antdv-legacy.690b7cec.js"],(function(e,i){"use strict";var n;return{setters:[t=>{n=t.c}],execute:function(){e({O:function(...t){const e=[0].concat(t);e.push(1);const i=e.length,n=Array(i).fill(0).map(((t,e)=>f(e,i-1)));return t=>{const r=n.map(((n,r)=>n*e[r]*(1-t)**(i-r-1)*t**r));return c(...r)}},S:async function(t){return new Promise((e=>setTimeout(e,t)))},a:function(t,e){if("sin"===t)return d(e,(t=>(Math.cosh(2*t)-1)/(p-1)));if("tan"===t){const t=t=>1*Math.tanh(3*t)/m;return d(e,(e=>1-t(1-e)),t)}if("sec"===t){const t=t=>1/Math.cosh(t);return d(e,(e=>1-2*(t(e*g)-.5)))}throw new TypeError("Unexpected parameters are delivered in hyper timing function.")},j:function(){return t=>t}});var i=Object.defineProperty,r=(t,e,n)=>(((t,e,n)=>{e in t?i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n})(t,"symbol"!=typeof e?e+"":e,n),n);let s=[];const o=t=>{for(const i of s)if("running"===i.status)try{for(const e of i.funcs)e(t-i.startTime)}catch(e){i.destroy(),console.error(e)}requestAnimationFrame(o)};requestAnimationFrame(o);class a{constructor(){r(this,"funcs",[]),r(this,"status","stop"),r(this,"startTime",0),this.status="running",s.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",s=s.filter((t=>t!==this))}}e("I",a);class l{constructor(){r(this,"timing"),r(this,"relation","absolute"),r(this,"easeTime",0),r(this,"applying",{}),r(this,"ticker",new a),r(this,"value",{}),r(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{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 h(t){return null!=t}e("R",class extends l{constructor(){super(),r(this,"shakeTiming"),r(this,"path"),r(this,"multiTiming"),r(this,"value",{}),r(this,"size",1),r(this,"angle",0),r(this,"targetValue",{system:{move:[0,0],moveAs:[0,0],resize:0,rotate:0,shake:0,"@@bind":[]},custom:{}}),r(this,"animateFn",{system:{move:[()=>0,()=>0],moveAs:()=>0,resize:()=>0,rotate:()=>0,shake:()=>0,"@@bind":()=>0},custom:{}}),r(this,"ox",0),r(this,"oy",0),r(this,"sx",0),r(this,"sy",0),r(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(h(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=Date.now();this.hook("start","shakestart");const s=()=>{const o=Date.now()-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=Date.now(),[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=Date.now()-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=Date.now(),{timing:s,relation:o,easeTime:a}=this,l="absolute"===o?e-n:e;this.hook("start");const h=()=>{const e=Date.now()-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=Date.now(),{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=Date.now()-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=Date.now(),s=this.timing,o=this.relation,a=this.easeTime,l="absolute"===o?e-n:e;this.hook("start",`${i}start`);const h=()=>{const e=Date.now()-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")}});e("Y",class extends l{constructor(){super(),r(this,"now",{}),r(this,"target",{}),r(this,"transitionFn",{}),r(this,"value"),r(this,"handleSet",((t,e,i)=>(this.transition(e,i),!0))),r(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(!h(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=Date.now(),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 l=()=>{const e=Date.now()-i;e>=n&&this.end(t);const o=e/n;this.now[t]=r(o)*a+s,this.hook("running")};return this.transitionFn[t]=l,this.ticker.add(l),this}end(t,e=!1){if(!h(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 c=(...t)=>t.reduce(((t,e)=>t+e),0),u=t=>{if(0===t)return 1;let e=t;for(;t>1;)e*=--t;return e},f=(t,e)=>Math.round(u(e)/(u(t)*u(e-t))),d=(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,p=Math.cosh(2),g=Math.acosh(2),m=Math.tanh(3);var b=e("l",{exports:{}}); /** * @license * Lodash * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ /*! * @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}!function(t,e){(function(){var i,r=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",o="Expected a function",a="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",h=500,c="__lodash_placeholder__",u=1,f=2,d=4,p=1,g=2,m=1,b=2,_=4,x=8,v=16,y=32,w=64,k=128,M=256,S=512,P=30,A="...",D=800,O=16,C=1,T=2,E=1/0,L=9007199254740991,R=17976931348623157e292,I=NaN,z=4294967295,F=z-1,j=z>>>1,V=[["ary",k],["bind",m],["bindKey",b],["curry",x],["curryRight",v],["flip",S],["partial",y],["partialRight",w],["rearg",M]],B="[object Arguments]",W="[object Array]",N="[object AsyncFunction]",H="[object Boolean]",$="[object Date]",U="[object DOMException]",Y="[object Error]",q="[object Function]",X="[object GeneratorFunction]",K="[object Map]",Z="[object Number]",G="[object Null]",J="[object Object]",Q="[object Promise]",tt="[object Proxy]",et="[object RegExp]",it="[object Set]",nt="[object String]",rt="[object Symbol]",st="[object Undefined]",ot="[object WeakMap]",at="[object WeakSet]",lt="[object ArrayBuffer]",ht="[object DataView]",ct="[object Float32Array]",ut="[object Float64Array]",ft="[object Int8Array]",dt="[object Int16Array]",pt="[object Int32Array]",gt="[object Uint8Array]",mt="[object Uint8ClampedArray]",bt="[object Uint16Array]",_t="[object Uint32Array]",xt=/\b__p \+= '';/g,vt=/\b(__p \+=) '' \+/g,yt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,wt=/&(?:amp|lt|gt|quot|#39);/g,kt=/[&<>"']/g,Mt=RegExp(wt.source),St=RegExp(kt.source),Pt=/<%-([\s\S]+?)%>/g,At=/<%([\s\S]+?)%>/g,Dt=/<%=([\s\S]+?)%>/g,Ot=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ct=/^\w*$/,Tt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Et=/[\\^$.*+?()[\]{}|]/g,Lt=RegExp(Et.source),Rt=/^\s+/,It=/\s/,zt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ft=/\{\n\/\* \[wrapped with (.+)\] \*/,jt=/,? & /,Vt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Bt=/[()=,{}\[\]\/\s]/,Wt=/\\(\\)?/g,Nt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ht=/\w*$/,$t=/^[-+]0x[0-9a-f]+$/i,Ut=/^0b[01]+$/i,Yt=/^\[object .+?Constructor\]$/,qt=/^0o[0-7]+$/i,Xt=/^(?:0|[1-9]\d*)$/,Kt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Zt=/($^)/,Gt=/['\n\r\u2028\u2029\\]/g,Jt="\\ud800-\\udfff",Qt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",te="\\u2700-\\u27bf",ee="a-z\\xdf-\\xf6\\xf8-\\xff",ie="A-Z\\xc0-\\xd6\\xd8-\\xde",ne="\\ufe0e\\ufe0f",re="\\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",se="['’]",oe="["+Jt+"]",ae="["+re+"]",le="["+Qt+"]",he="\\d+",ce="["+te+"]",ue="["+ee+"]",fe="[^"+Jt+re+he+te+ee+ie+"]",de="\\ud83c[\\udffb-\\udfff]",pe="[^"+Jt+"]",ge="(?:\\ud83c[\\udde6-\\uddff]){2}",me="[\\ud800-\\udbff][\\udc00-\\udfff]",be="["+ie+"]",_e="\\u200d",xe="(?:"+ue+"|"+fe+")",ve="(?:"+be+"|"+fe+")",ye="(?:['’](?:d|ll|m|re|s|t|ve))?",we="(?:['’](?:D|LL|M|RE|S|T|VE))?",ke="(?:"+le+"|"+de+")"+"?",Me="["+ne+"]?",Se=Me+ke+("(?:"+_e+"(?:"+[pe,ge,me].join("|")+")"+Me+ke+")*"),Pe="(?:"+[ce,ge,me].join("|")+")"+Se,Ae="(?:"+[pe+le+"?",le,ge,me,oe].join("|")+")",De=RegExp(se,"g"),Oe=RegExp(le,"g"),Ce=RegExp(de+"(?="+de+")|"+Ae+Se,"g"),Te=RegExp([be+"?"+ue+"+"+ye+"(?="+[ae,be,"$"].join("|")+")",ve+"+"+we+"(?="+[ae,be+xe,"$"].join("|")+")",be+"?"+xe+"+"+ye,be+"+"+we,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",he,Pe].join("|"),"g"),Ee=RegExp("["+_e+Jt+Qt+ne+"]"),Le=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Re=["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"],Ie=-1,ze={};ze[ct]=ze[ut]=ze[ft]=ze[dt]=ze[pt]=ze[gt]=ze[mt]=ze[bt]=ze[_t]=!0,ze[B]=ze[W]=ze[lt]=ze[H]=ze[ht]=ze[$]=ze[Y]=ze[q]=ze[K]=ze[Z]=ze[J]=ze[et]=ze[it]=ze[nt]=ze[ot]=!1;var Fe={};Fe[B]=Fe[W]=Fe[lt]=Fe[ht]=Fe[H]=Fe[$]=Fe[ct]=Fe[ut]=Fe[ft]=Fe[dt]=Fe[pt]=Fe[K]=Fe[Z]=Fe[J]=Fe[et]=Fe[it]=Fe[nt]=Fe[rt]=Fe[gt]=Fe[mt]=Fe[bt]=Fe[_t]=!0,Fe[Y]=Fe[q]=Fe[ot]=!1;var je={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ve=parseFloat,Be=parseInt,We="object"==typeof n&&n&&n.Object===Object&&n,Ne="object"==typeof self&&self&&self.Object===Object&&self,He=We||Ne||Function("return this")(),$e=e&&!e.nodeType&&e,Ue=$e&&t&&!t.nodeType&&t,Ye=Ue&&Ue.exports===$e,qe=Ye&&We.process,Xe=function(){try{var t=Ue&&Ue.require&&Ue.require("util").types;return t||qe&&qe.binding&&qe.binding("util")}catch(e){}}(),Ke=Xe&&Xe.isArrayBuffer,Ze=Xe&&Xe.isDate,Ge=Xe&&Xe.isMap,Je=Xe&&Xe.isRegExp,Qe=Xe&&Xe.isSet,ti=Xe&&Xe.isTypedArray;function ei(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 ii(t,e,i,n){for(var r=-1,s=null==t?0:t.length;++r-1}function li(t,e,i){for(var n=-1,r=null==t?0:t.length;++n-1;);return i}function Ti(t,e){for(var i=t.length;i--&&bi(e,t[i],0)>-1;);return i}var Ei=wi({"À":"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"}),Li=wi({"&":"&","<":"<",">":">",'"':""","'":"'"});function Ri(t){return"\\"+je[t]}function Ii(t){return Ee.test(t)}function zi(t){var e=-1,i=Array(t.size);return t.forEach((function(t,n){i[++e]=[n,t]})),i}function Fi(t,e){return function(i){return t(e(i))}}function ji(t,e){for(var i=-1,n=t.length,r=0,s=[];++i",""":'"',"'":"'"});var Ui=function t(e){var n=(e=null==e?He:Ui.defaults(He.Object(),e,Ui.pick(He,Re))).Array,It=e.Date,Jt=e.Error,Qt=e.Function,te=e.Math,ee=e.Object,ie=e.RegExp,ne=e.String,re=e.TypeError,se=n.prototype,oe=Qt.prototype,ae=ee.prototype,le=e["__core-js_shared__"],he=oe.toString,ce=ae.hasOwnProperty,ue=0,fe=function(){var t=/[^.]+$/.exec(le&&le.keys&&le.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),de=ae.toString,pe=he.call(ee),ge=He._,me=ie("^"+he.call(ce).replace(Et,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),be=Ye?e.Buffer:i,_e=e.Symbol,xe=e.Uint8Array,ve=be?be.allocUnsafe:i,ye=Fi(ee.getPrototypeOf,ee),we=ee.create,ke=ae.propertyIsEnumerable,Me=se.splice,Se=_e?_e.isConcatSpreadable:i,Pe=_e?_e.iterator:i,Ae=_e?_e.toStringTag:i,Ce=function(){try{var t=Bs(ee,"defineProperty");return t({},"",{}),t}catch(e){}}(),Ee=e.clearTimeout!==He.clearTimeout&&e.clearTimeout,je=It&&It.now!==He.Date.now&&It.now,We=e.setTimeout!==He.setTimeout&&e.setTimeout,Ne=te.ceil,$e=te.floor,Ue=ee.getOwnPropertySymbols,qe=be?be.isBuffer:i,Xe=e.isFinite,pi=se.join,wi=Fi(ee.keys,ee),Yi=te.max,qi=te.min,Xi=It.now,Ki=e.parseInt,Zi=te.random,Gi=se.reverse,Ji=Bs(e,"DataView"),Qi=Bs(e,"Map"),tn=Bs(e,"Promise"),en=Bs(e,"Set"),nn=Bs(e,"WeakMap"),rn=Bs(ee,"create"),sn=nn&&new nn,on={},an=fo(Ji),ln=fo(Qi),hn=fo(tn),cn=fo(en),un=fo(nn),fn=_e?_e.prototype:i,dn=fn?fn.valueOf:i,pn=fn?fn.toString:i;function gn(t){if(Ca(t)&&!xa(t)&&!(t instanceof xn)){if(t instanceof _n)return t;if(ce.call(t,"__wrapped__"))return po(t)}return new _n(t)}var mn=function(){function t(){}return function(e){if(!Oa(e))return{};if(we)return we(e);t.prototype=e;var n=new t;return t.prototype=i,n}}();function bn(){}function _n(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=i}function xn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=z,this.__views__=[]}function vn(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e=e?t:e)),t}function Fn(t,e,n,r,s,o){var a,l=e&u,h=e&f,c=e&d;if(n&&(a=s?n(t,r,s,o):n(t)),a!==i)return a;if(!Oa(t))return t;var p=xa(t);if(p){if(a=function(t){var e=t.length,i=new t.constructor(e);e&&"string"==typeof t[0]&&ce.call(t,"index")&&(i.index=t.index,i.input=t.input);return i}(t),!l)return rs(t,a)}else{var g=Hs(t),m=g==q||g==X;if(ka(t))return Jr(t,l);if(g==J||g==B||m&&!s){if(a=h||m?{}:Us(t),!l)return h?function(t,e){return ss(t,Ns(t),e)}(t,function(t,e){return t&&ss(e,al(e),t)}(a,t)):function(t,e){return ss(t,Ws(t),e)}(t,Ln(a,t))}else{if(!Fe[g])return s?t:{};a=function(t,e,i){var n=t.constructor;switch(e){case lt:return Qr(t);case H:case $:return new n(+t);case ht:return function(t,e){var i=e?Qr(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.byteLength)}(t,i);case ct:case ut:case ft:case dt:case pt:case gt:case mt:case bt:case _t:return ts(t,i);case K:return new n;case Z:case nt:return new n(t);case et:return function(t){var e=new t.constructor(t.source,Ht.exec(t));return e.lastIndex=t.lastIndex,e}(t);case it:return new n;case rt:return r=t,dn?ee(dn.call(r)):{}}var r}(t,g,l)}}o||(o=new Mn);var b=o.get(t);if(b)return b;o.set(t,a),Ia(t)?t.forEach((function(i){a.add(Fn(i,e,n,i,t,o))})):Ta(t)&&t.forEach((function(i,r){a.set(r,Fn(i,e,n,r,t,o))}));var _=p?i:(c?h?Ls:Es:h?al:ol)(t);return ni(_||t,(function(i,r){_&&(i=t[r=i]),Cn(a,r,Fn(i,e,n,r,t,o))})),a}function jn(t,e,n){var r=n.length;if(null==t)return!r;for(t=ee(t);r--;){var s=n[r],o=e[s],a=t[s];if(a===i&&!(s in t)||!o(a))return!1}return!0}function Vn(t,e,n){if("function"!=typeof t)throw new re(o);return so((function(){t.apply(i,n)}),e)}function Bn(t,e,i,n){var s=-1,o=ai,a=!0,l=t.length,h=[],c=e.length;if(!l)return h;i&&(e=hi(e,Ai(i))),n?(o=li,a=!1):e.length>=r&&(o=Oi,a=!1,e=new kn(e));t:for(;++s-1},yn.prototype.set=function(t,e){var i=this.__data__,n=Tn(i,t);return n<0?(++this.size,i.push([t,e])):i[n][1]=e,this},wn.prototype.clear=function(){this.size=0,this.__data__={hash:new vn,map:new(Qi||yn),string:new vn}},wn.prototype.delete=function(t){var e=js(this,t).delete(t);return this.size-=e?1:0,e},wn.prototype.get=function(t){return js(this,t).get(t)},wn.prototype.has=function(t){return js(this,t).has(t)},wn.prototype.set=function(t,e){var i=js(this,t),n=i.size;return i.set(t,e),this.size+=i.size==n?0:1,this},kn.prototype.add=kn.prototype.push=function(t){return this.__data__.set(t,l),this},kn.prototype.has=function(t){return this.__data__.has(t)},Mn.prototype.clear=function(){this.__data__=new yn,this.size=0},Mn.prototype.delete=function(t){var e=this.__data__,i=e.delete(t);return this.size=e.size,i},Mn.prototype.get=function(t){return this.__data__.get(t)},Mn.prototype.has=function(t){return this.__data__.has(t)},Mn.prototype.set=function(t,e){var i=this.__data__;if(i instanceof yn){var n=i.__data__;if(!Qi||n.length0&&i(a)?e>1?Yn(a,e-1,i,n,r):ci(r,a):n||(r[r.length]=a)}return r}var qn=hs(),Xn=hs(!0);function Kn(t,e){return t&&qn(t,e,ol)}function Zn(t,e){return t&&Xn(t,e,ol)}function Gn(t,e){return oi(e,(function(e){return Pa(t[e])}))}function Jn(t,e){for(var n=0,r=(e=Xr(e,t)).length;null!=t&&ne}function ir(t,e){return null!=t&&ce.call(t,e)}function nr(t,e){return null!=t&&e in ee(t)}function rr(t,e,r){for(var s=r?li:ai,o=t[0].length,a=t.length,l=a,h=n(a),c=1/0,u=[];l--;){var f=t[l];l&&e&&(f=hi(f,Ai(e))),c=qi(f.length,c),h[l]=!r&&(e||o>=120&&f.length>=120)?new kn(l&&f):i}f=t[0];var d=-1,p=h[0];t:for(;++d=a?l:l*("desc"==i[n]?-1:1)}return t.index-e.index}(t,e,i)}))}function vr(t,e,i){for(var n=-1,r=e.length,s={};++n-1;)a!==t&&Me.call(a,l,1),Me.call(t,l,1);return t}function wr(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;qs(r)?Me.call(t,r,1):Br(t,r)}}return t}function kr(t,e){return t+$e(Zi()*(e-t+1))}function Mr(t,e){var i="";if(!t||e<1||e>L)return i;do{e%2&&(i+=t),(e=$e(e/2))&&(t+=t)}while(e);return i}function Sr(t,e){return oo(eo(t,e,El),t+"")}function Pr(t){return Pn(gl(t))}function Ar(t,e){var i=gl(t);return ho(i,zn(e,0,i.length))}function Dr(t,e,n,r){if(!Oa(t))return t;for(var s=-1,o=(e=Xr(e,t)).length,a=o-1,l=t;null!=l&&++ss?0:s+e),(i=i>s?s:i)<0&&(i+=s),s=e>i?0:i-e>>>0,e>>>=0;for(var o=n(s);++r>>1,o=t[s];null!==o&&!Fa(o)&&(i?o<=e:o=r){var c=e?null:Ms(t);if(c)return Vi(c);a=!1,s=Oi,h=new kn}else h=e?[]:l;t:for(;++n=r?t:Er(t,e,n)}var Gr=Ee||function(t){return He.clearTimeout(t)};function Jr(t,e){if(e)return t.slice();var i=t.length,n=ve?ve(i):new t.constructor(i);return t.copy(n),n}function Qr(t){var e=new t.constructor(t.byteLength);return new xe(e).set(new xe(t)),e}function ts(t,e){var i=e?Qr(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.length)}function es(t,e){if(t!==e){var n=t!==i,r=null===t,s=t==t,o=Fa(t),a=e!==i,l=null===e,h=e==e,c=Fa(e);if(!l&&!c&&!o&&t>e||o&&a&&h&&!l&&!c||r&&a&&h||!n&&h||!s)return 1;if(!r&&!o&&!c&&t1?n[s-1]:i,a=s>2?n[2]:i;for(o=t.length>3&&"function"==typeof o?(s--,o):i,a&&Xs(n[0],n[1],a)&&(o=s<3?i:o,s=1),e=ee(e);++r-1?s[o?e[a]:a]:i}}function ps(t){return Ts((function(e){var n=e.length,r=n,s=_n.prototype.thru;for(t&&e.reverse();r--;){var a=e[r];if("function"!=typeof a)throw new re(o);if(s&&!l&&"wrapper"==Is(a))var l=new _n([],!0)}for(r=l?r:n;++r1&&x.reverse(),f&&cl))return!1;var c=o.get(t),u=o.get(e);if(c&&u)return c==e&&u==t;var f=-1,d=!0,m=n&g?new kn:i;for(o.set(t,e),o.set(e,t);++f-1&&t%1==0&&t1?"& ":"")+e[n],e=e.join(i>2?", ":" "),t.replace(zt,"{\n/* [wrapped with "+e+"] */\n")}(n,function(t,e){return ni(V,(function(i){var n="_."+i[0];e&i[1]&&!ai(t,n)&&t.push(n)})),t.sort()}(function(t){var e=t.match(Ft);return e?e[1].split(jt):[]}(n),i)))}function lo(t){var e=0,n=0;return function(){var r=Xi(),s=O-(r-n);if(n=r,s>0){if(++e>=D)return arguments[0]}else e=0;return t.apply(i,arguments)}}function ho(t,e){var n=-1,r=t.length,s=r-1;for(e=e===i?r:e;++n1?t[e-1]:i;return n="function"==typeof n?(t.pop(),n):i,Ro(t,n)}));function Wo(t){var e=gn(t);return e.__chain__=!0,e}function No(t,e){return e(t)}var Ho=Ts((function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,s=function(e){return In(e,t)};return!(e>1||this.__actions__.length)&&r instanceof xn&&qs(n)?((r=r.slice(n,+n+(e?1:0))).__actions__.push({func:No,args:[s],thisArg:i}),new _n(r,this.__chain__).thru((function(t){return e&&!t.length&&t.push(i),t}))):this.thru(s)}));var $o=os((function(t,e,i){ce.call(t,i)?++t[i]:Rn(t,i,1)}));var Uo=ds(_o),Yo=ds(xo);function qo(t,e){return(xa(t)?ni:Wn)(t,Fs(e,3))}function Xo(t,e){return(xa(t)?ri:Nn)(t,Fs(e,3))}var Ko=os((function(t,e,i){ce.call(t,i)?t[i].push(e):Rn(t,i,[e])}));var Zo=Sr((function(t,e,i){var r=-1,s="function"==typeof e,o=ya(t)?n(t.length):[];return Wn(t,(function(t){o[++r]=s?ei(e,t,i):sr(t,e,i)})),o})),Go=os((function(t,e,i){Rn(t,i,e)}));function Jo(t,e){return(xa(t)?hi:pr)(t,Fs(e,3))}var Qo=os((function(t,e,i){t[i?0:1].push(e)}),(function(){return[[],[]]}));var ta=Sr((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]]),xr(t,Yn(e,1),[])})),ea=je||function(){return He.Date.now()};function ia(t,e,n){return e=n?i:e,e=t&&null==e?t.length:e,Ps(t,k,i,i,i,i,e)}function na(t,e){var n;if("function"!=typeof e)throw new re(o);return t=Ha(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=i),n}}var ra=Sr((function(t,e,i){var n=m;if(i.length){var r=ji(i,zs(ra));n|=y}return Ps(t,n,e,i,r)})),sa=Sr((function(t,e,i){var n=m|b;if(i.length){var r=ji(i,zs(sa));n|=y}return Ps(e,n,t,i,r)}));function oa(t,e,n){var r,s,a,l,h,c,u=0,f=!1,d=!1,p=!0;if("function"!=typeof t)throw new re(o);function g(e){var n=r,o=s;return r=s=i,u=e,l=t.apply(o,n)}function m(t){var n=t-c;return c===i||n>=e||n<0||d&&t-u>=a}function b(){var t=ea();if(m(t))return _(t);h=so(b,function(t){var i=e-(t-c);return d?qi(i,a-(t-u)):i}(t))}function _(t){return h=i,p&&r?g(t):(r=s=i,l)}function x(){var t=ea(),n=m(t);if(r=arguments,s=this,c=t,n){if(h===i)return function(t){return u=t,h=so(b,e),f?g(t):l}(c);if(d)return Gr(h),h=so(b,e),g(c)}return h===i&&(h=so(b,e)),l}return e=Ua(e)||0,Oa(n)&&(f=!!n.leading,a=(d="maxWait"in n)?Yi(Ua(n.maxWait)||0,e):a,p="trailing"in n?!!n.trailing:p),x.cancel=function(){h!==i&&Gr(h),u=0,r=c=s=h=i},x.flush=function(){return h===i?l:_(ea())},x}var aa=Sr((function(t,e){return Vn(t,1,e)})),la=Sr((function(t,e,i){return Vn(t,Ua(e)||0,i)}));function ha(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new re(o);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(ha.Cache||wn),i}function ca(t){if("function"!=typeof t)throw new re(o);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)}}ha.Cache=wn;var ua=Kr((function(t,e){var i=(e=1==e.length&&xa(e[0])?hi(e[0],Ai(Fs())):hi(Yn(e,1),Ai(Fs()))).length;return Sr((function(n){for(var r=-1,s=qi(n.length,i);++r=e})),_a=or(function(){return arguments}())?or:function(t){return Ca(t)&&ce.call(t,"callee")&&!ke.call(t,"callee")},xa=n.isArray,va=Ke?Ai(Ke):function(t){return Ca(t)&&tr(t)==lt};function ya(t){return null!=t&&Da(t.length)&&!Pa(t)}function wa(t){return Ca(t)&&ya(t)}var ka=qe||Ul,Ma=Ze?Ai(Ze):function(t){return Ca(t)&&tr(t)==$};function Sa(t){if(!Ca(t))return!1;var e=tr(t);return e==Y||e==U||"string"==typeof t.message&&"string"==typeof t.name&&!La(t)}function Pa(t){if(!Oa(t))return!1;var e=tr(t);return e==q||e==X||e==N||e==tt}function Aa(t){return"number"==typeof t&&t==Ha(t)}function Da(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=L}function Oa(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Ca(t){return null!=t&&"object"==typeof t}var Ta=Ge?Ai(Ge):function(t){return Ca(t)&&Hs(t)==K};function Ea(t){return"number"==typeof t||Ca(t)&&tr(t)==Z}function La(t){if(!Ca(t)||tr(t)!=J)return!1;var e=ye(t);if(null===e)return!0;var i=ce.call(e,"constructor")&&e.constructor;return"function"==typeof i&&i instanceof i&&he.call(i)==pe}var Ra=Je?Ai(Je):function(t){return Ca(t)&&tr(t)==et};var Ia=Qe?Ai(Qe):function(t){return Ca(t)&&Hs(t)==it};function za(t){return"string"==typeof t||!xa(t)&&Ca(t)&&tr(t)==nt}function Fa(t){return"symbol"==typeof t||Ca(t)&&tr(t)==rt}var ja=ti?Ai(ti):function(t){return Ca(t)&&Da(t.length)&&!!ze[tr(t)]};var Va=ys(dr),Ba=ys((function(t,e){return t<=e}));function Wa(t){if(!t)return[];if(ya(t))return za(t)?Ni(t):rs(t);if(Pe&&t[Pe])return function(t){for(var e,i=[];!(e=t.next()).done;)i.push(e.value);return i}(t[Pe]());var e=Hs(t);return(e==K?zi:e==it?Vi:gl)(t)}function Na(t){return t?(t=Ua(t))===E||t===-E?(t<0?-1:1)*R:t==t?t:0:0===t?t:0}function Ha(t){var e=Na(t),i=e%1;return e==e?i?e-i:e:0}function $a(t){return t?zn(Ha(t),0,z):0}function Ua(t){if("number"==typeof t)return t;if(Fa(t))return I;if(Oa(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Oa(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Pi(t);var i=Ut.test(t);return i||qt.test(t)?Be(t.slice(2),i?2:8):$t.test(t)?I:+t}function Ya(t){return ss(t,al(t))}function qa(t){return null==t?"":jr(t)}var Xa=as((function(t,e){if(Js(e)||ya(e))ss(e,ol(e),t);else for(var i in e)ce.call(e,i)&&Cn(t,i,e[i])})),Ka=as((function(t,e){ss(e,al(e),t)})),Za=as((function(t,e,i,n){ss(e,al(e),t,n)})),Ga=as((function(t,e,i,n){ss(e,ol(e),t,n)})),Ja=Ts(In);var Qa=Sr((function(t,e){t=ee(t);var n=-1,r=e.length,s=r>2?e[2]:i;for(s&&Xs(e[0],e[1],s)&&(r=1);++n1),e})),ss(t,Ls(t),i),n&&(i=Fn(i,u|f|d,Os));for(var r=e.length;r--;)Br(i,e[r]);return i}));var ul=Ts((function(t,e){return null==t?{}:function(t,e){return vr(t,e,(function(e,i){return il(t,i)}))}(t,e)}));function fl(t,e){if(null==t)return{};var i=hi(Ls(t),(function(t){return[t]}));return e=Fs(e),vr(t,i,(function(t,i){return e(t,i[0])}))}var dl=Ss(ol),pl=Ss(al);function gl(t){return null==t?[]:Di(t,ol(t))}var ml=us((function(t,e,i){return e=e.toLowerCase(),t+(i?bl(e):e)}));function bl(t){return Sl(qa(t).toLowerCase())}function _l(t){return(t=qa(t))&&t.replace(Kt,Ei).replace(Oe,"")}var xl=us((function(t,e,i){return t+(i?"-":"")+e.toLowerCase()})),vl=us((function(t,e,i){return t+(i?" ":"")+e.toLowerCase()})),yl=cs("toLowerCase");var wl=us((function(t,e,i){return t+(i?"_":"")+e.toLowerCase()}));var kl=us((function(t,e,i){return t+(i?" ":"")+Sl(e)}));var Ml=us((function(t,e,i){return t+(i?" ":"")+e.toUpperCase()})),Sl=cs("toUpperCase");function Pl(t,e,n){return t=qa(t),(e=n?i:e)===i?function(t){return Le.test(t)}(t)?function(t){return t.match(Te)||[]}(t):function(t){return t.match(Vt)||[]}(t):t.match(e)||[]}var Al=Sr((function(t,e){try{return ei(t,i,e)}catch(n){return Sa(n)?n:new Jt(n)}})),Dl=Ts((function(t,e){return ni(e,(function(e){e=uo(e),Rn(t,e,ra(t[e],t))})),t}));function Ol(t){return function(){return t}}var Cl=ps(),Tl=ps(!0);function El(t){return t}function Ll(t){return cr("function"==typeof t?t:Fn(t,u))}var Rl=Sr((function(t,e){return function(i){return sr(i,t,e)}})),Il=Sr((function(t,e){return function(i){return sr(t,i,e)}}));function zl(t,e,i){var n=ol(e),r=Gn(e,n);null!=i||Oa(e)&&(r.length||!n.length)||(i=e,e=t,t=this,r=Gn(e,ol(e)));var s=!(Oa(i)&&"chain"in i&&!i.chain),o=Pa(t);return ni(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__=rs(this.__actions__)).push({func:n,args:arguments,thisArg:t}),i.__chain__=e,i}return n.apply(t,ci([this.value()],arguments))})})),t}function Fl(){}var jl=_s(hi),Vl=_s(si),Bl=_s(di);function Wl(t){return Ks(t)?yi(uo(t)):function(t){return function(e){return Jn(e,t)}}(t)}var Nl=vs(),Hl=vs(!0);function $l(){return[]}function Ul(){return!1}var Yl=bs((function(t,e){return t+e}),0),ql=ks("ceil"),Xl=bs((function(t,e){return t/e}),1),Kl=ks("floor");var Zl,Gl=bs((function(t,e){return t*e}),1),Jl=ks("round"),Ql=bs((function(t,e){return t-e}),0);return gn.after=function(t,e){if("function"!=typeof e)throw new re(o);return t=Ha(t),function(){if(--t<1)return e.apply(this,arguments)}},gn.ary=ia,gn.assign=Xa,gn.assignIn=Ka,gn.assignInWith=Za,gn.assignWith=Ga,gn.at=Ja,gn.before=na,gn.bind=ra,gn.bindAll=Dl,gn.bindKey=sa,gn.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return xa(t)?t:[t]},gn.chain=Wo,gn.chunk=function(t,e,r){e=(r?Xs(t,e,r):e===i)?1:Yi(Ha(e),0);var s=null==t?0:t.length;if(!s||e<1)return[];for(var o=0,a=0,l=n(Ne(s/e));os?0:s+n),(r=r===i||r>s?s:Ha(r))<0&&(r+=s),r=n>r?0:$a(r);n>>0)?(t=qa(t))&&("string"==typeof e||null!=e&&!Ra(e))&&!(e=jr(e))&&Ii(t)?Zr(Ni(t),0,n):t.split(e,n):[]},gn.spread=function(t,e){if("function"!=typeof t)throw new re(o);return e=null==e?0:Yi(Ha(e),0),Sr((function(i){var n=i[e],r=Zr(i,0,e);return n&&ci(r,n),ei(t,this,r)}))},gn.tail=function(t){var e=null==t?0:t.length;return e?Er(t,1,e):[]},gn.take=function(t,e,n){return t&&t.length?Er(t,0,(e=n||e===i?1:Ha(e))<0?0:e):[]},gn.takeRight=function(t,e,n){var r=null==t?0:t.length;return r?Er(t,(e=r-(e=n||e===i?1:Ha(e)))<0?0:e,r):[]},gn.takeRightWhile=function(t,e){return t&&t.length?Nr(t,Fs(e,3),!1,!0):[]},gn.takeWhile=function(t,e){return t&&t.length?Nr(t,Fs(e,3)):[]},gn.tap=function(t,e){return e(t),t},gn.throttle=function(t,e,i){var n=!0,r=!0;if("function"!=typeof t)throw new re(o);return Oa(i)&&(n="leading"in i?!!i.leading:n,r="trailing"in i?!!i.trailing:r),oa(t,e,{leading:n,maxWait:e,trailing:r})},gn.thru=No,gn.toArray=Wa,gn.toPairs=dl,gn.toPairsIn=pl,gn.toPath=function(t){return xa(t)?hi(t,uo):Fa(t)?[t]:rs(co(qa(t)))},gn.toPlainObject=Ya,gn.transform=function(t,e,i){var n=xa(t),r=n||ka(t)||ja(t);if(e=Fs(e,4),null==i){var s=t&&t.constructor;i=r?n?new s:[]:Oa(t)&&Pa(s)?mn(ye(t)):{}}return(r?ni:Kn)(t,(function(t,n,r){return e(i,t,n,r)})),i},gn.unary=function(t){return ia(t,1)},gn.union=Co,gn.unionBy=To,gn.unionWith=Eo,gn.uniq=function(t){return t&&t.length?Vr(t):[]},gn.uniqBy=function(t,e){return t&&t.length?Vr(t,Fs(e,2)):[]},gn.uniqWith=function(t,e){return e="function"==typeof e?e:i,t&&t.length?Vr(t,i,e):[]},gn.unset=function(t,e){return null==t||Br(t,e)},gn.unzip=Lo,gn.unzipWith=Ro,gn.update=function(t,e,i){return null==t?t:Wr(t,e,qr(i))},gn.updateWith=function(t,e,n,r){return r="function"==typeof r?r:i,null==t?t:Wr(t,e,qr(n),r)},gn.values=gl,gn.valuesIn=function(t){return null==t?[]:Di(t,al(t))},gn.without=Io,gn.words=Pl,gn.wrap=function(t,e){return fa(qr(e),t)},gn.xor=zo,gn.xorBy=Fo,gn.xorWith=jo,gn.zip=Vo,gn.zipObject=function(t,e){return Ur(t||[],e||[],Cn)},gn.zipObjectDeep=function(t,e){return Ur(t||[],e||[],Dr)},gn.zipWith=Bo,gn.entries=dl,gn.entriesIn=pl,gn.extend=Ka,gn.extendWith=Za,zl(gn,gn),gn.add=Yl,gn.attempt=Al,gn.camelCase=ml,gn.capitalize=bl,gn.ceil=ql,gn.clamp=function(t,e,n){return n===i&&(n=e,e=i),n!==i&&(n=(n=Ua(n))==n?n:0),e!==i&&(e=(e=Ua(e))==e?e:0),zn(Ua(t),e,n)},gn.clone=function(t){return Fn(t,d)},gn.cloneDeep=function(t){return Fn(t,u|d)},gn.cloneDeepWith=function(t,e){return Fn(t,u|d,e="function"==typeof e?e:i)},gn.cloneWith=function(t,e){return Fn(t,d,e="function"==typeof e?e:i)},gn.conformsTo=function(t,e){return null==e||jn(t,e,ol(e))},gn.deburr=_l,gn.defaultTo=function(t,e){return null==t||t!=t?e:t},gn.divide=Xl,gn.endsWith=function(t,e,n){t=qa(t),e=jr(e);var r=t.length,s=n=n===i?r:zn(Ha(n),0,r);return(n-=e.length)>=0&&t.slice(n,s)==e},gn.eq=ga,gn.escape=function(t){return(t=qa(t))&&St.test(t)?t.replace(kt,Li):t},gn.escapeRegExp=function(t){return(t=qa(t))&&Lt.test(t)?t.replace(Et,"\\$&"):t},gn.every=function(t,e,n){var r=xa(t)?si:Hn;return n&&Xs(t,e,n)&&(e=i),r(t,Fs(e,3))},gn.find=Uo,gn.findIndex=_o,gn.findKey=function(t,e){return gi(t,Fs(e,3),Kn)},gn.findLast=Yo,gn.findLastIndex=xo,gn.findLastKey=function(t,e){return gi(t,Fs(e,3),Zn)},gn.floor=Kl,gn.forEach=qo,gn.forEachRight=Xo,gn.forIn=function(t,e){return null==t?t:qn(t,Fs(e,3),al)},gn.forInRight=function(t,e){return null==t?t:Xn(t,Fs(e,3),al)},gn.forOwn=function(t,e){return t&&Kn(t,Fs(e,3))},gn.forOwnRight=function(t,e){return t&&Zn(t,Fs(e,3))},gn.get=el,gn.gt=ma,gn.gte=ba,gn.has=function(t,e){return null!=t&&$s(t,e,ir)},gn.hasIn=il,gn.head=yo,gn.identity=El,gn.includes=function(t,e,i,n){t=ya(t)?t:gl(t),i=i&&!n?Ha(i):0;var r=t.length;return i<0&&(i=Yi(r+i,0)),za(t)?i<=r&&t.indexOf(e,i)>-1:!!r&&bi(t,e,i)>-1},gn.indexOf=function(t,e,i){var n=null==t?0:t.length;if(!n)return-1;var r=null==i?0:Ha(i);return r<0&&(r=Yi(n+r,0)),bi(t,e,r)},gn.inRange=function(t,e,n){return e=Na(e),n===i?(n=e,e=0):n=Na(n),function(t,e,i){return t>=qi(e,i)&&t=-L&&t<=L},gn.isSet=Ia,gn.isString=za,gn.isSymbol=Fa,gn.isTypedArray=ja,gn.isUndefined=function(t){return t===i},gn.isWeakMap=function(t){return Ca(t)&&Hs(t)==ot},gn.isWeakSet=function(t){return Ca(t)&&tr(t)==at},gn.join=function(t,e){return null==t?"":pi.call(t,e)},gn.kebabCase=xl,gn.last=So,gn.lastIndexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var s=r;return n!==i&&(s=(s=Ha(n))<0?Yi(r+s,0):qi(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):mi(t,xi,s,!0)},gn.lowerCase=vl,gn.lowerFirst=yl,gn.lt=Va,gn.lte=Ba,gn.max=function(t){return t&&t.length?$n(t,El,er):i},gn.maxBy=function(t,e){return t&&t.length?$n(t,Fs(e,2),er):i},gn.mean=function(t){return vi(t,El)},gn.meanBy=function(t,e){return vi(t,Fs(e,2))},gn.min=function(t){return t&&t.length?$n(t,El,dr):i},gn.minBy=function(t,e){return t&&t.length?$n(t,Fs(e,2),dr):i},gn.stubArray=$l,gn.stubFalse=Ul,gn.stubObject=function(){return{}},gn.stubString=function(){return""},gn.stubTrue=function(){return!0},gn.multiply=Gl,gn.nth=function(t,e){return t&&t.length?_r(t,Ha(e)):i},gn.noConflict=function(){return He._===this&&(He._=ge),this},gn.noop=Fl,gn.now=ea,gn.pad=function(t,e,i){t=qa(t);var n=(e=Ha(e))?Wi(t):0;if(!e||n>=e)return t;var r=(e-n)/2;return xs($e(r),i)+t+xs(Ne(r),i)},gn.padEnd=function(t,e,i){t=qa(t);var n=(e=Ha(e))?Wi(t):0;return e&&ne){var r=t;t=e,e=r}if(n||t%1||e%1){var s=Zi();return qi(t+s*(e-t+Ve("1e-"+((s+"").length-1))),e)}return kr(t,e)},gn.reduce=function(t,e,i){var n=xa(t)?ui:ki,r=arguments.length<3;return n(t,Fs(e,4),i,r,Wn)},gn.reduceRight=function(t,e,i){var n=xa(t)?fi:ki,r=arguments.length<3;return n(t,Fs(e,4),i,r,Nn)},gn.repeat=function(t,e,n){return e=(n?Xs(t,e,n):e===i)?1:Ha(e),Mr(qa(t),e)},gn.replace=function(){var t=arguments,e=qa(t[0]);return t.length<3?e:e.replace(t[1],t[2])},gn.result=function(t,e,n){var r=-1,s=(e=Xr(e,t)).length;for(s||(s=1,t=i);++rL)return[];var i=z,n=qi(t,z);e=Fs(e),t-=z;for(var r=Si(n,e);++i=o)return t;var l=n-Wi(r);if(l<1)return r;var h=a?Zr(a,0,l).join(""):t.slice(0,l);if(s===i)return h+r;if(a&&(l+=h.length-l),Ra(s)){if(t.slice(l).search(s)){var c,u=h;for(s.global||(s=ie(s.source,qa(Ht.exec(s))+"g")),s.lastIndex=0;c=s.exec(u);)var f=c.index;h=h.slice(0,f===i?l:f)}}else if(t.indexOf(jr(s),l)!=l){var d=h.lastIndexOf(s);d>-1&&(h=h.slice(0,d))}return h+r},gn.unescape=function(t){return(t=qa(t))&&Mt.test(t)?t.replace(wt,$i):t},gn.uniqueId=function(t){var e=++ue;return qa(t)+e},gn.upperCase=Ml,gn.upperFirst=Sl,gn.each=qo,gn.eachRight=Xo,gn.first=yo,zl(gn,(Zl={},Kn(gn,(function(t,e){ce.call(gn.prototype,e)||(Zl[e]=t)})),Zl),{chain:!1}),gn.VERSION="4.17.21",ni(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){gn[t].placeholder=gn})),ni(["drop","take"],(function(t,e){xn.prototype[t]=function(n){n=n===i?1:Yi(Ha(n),0);var r=this.__filtered__&&!e?new xn(this):this.clone();return r.__filtered__?r.__takeCount__=qi(n,r.__takeCount__):r.__views__.push({size:qi(n,z),type:t+(r.__dir__<0?"Right":"")}),r},xn.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),ni(["filter","map","takeWhile"],(function(t,e){var i=e+1,n=i==C||3==i;xn.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:Fs(t,3),type:i}),e.__filtered__=e.__filtered__||n,e}})),ni(["head","last"],(function(t,e){var i="take"+(e?"Right":"");xn.prototype[t]=function(){return this[i](1).value()[0]}})),ni(["initial","tail"],(function(t,e){var i="drop"+(e?"":"Right");xn.prototype[t]=function(){return this.__filtered__?new xn(this):this[i](1)}})),xn.prototype.compact=function(){return this.filter(El)},xn.prototype.find=function(t){return this.filter(t).head()},xn.prototype.findLast=function(t){return this.reverse().find(t)},xn.prototype.invokeMap=Sr((function(t,e){return"function"==typeof t?new xn(this):this.map((function(i){return sr(i,t,e)}))})),xn.prototype.reject=function(t){return this.filter(ca(Fs(t)))},xn.prototype.slice=function(t,e){t=Ha(t);var n=this;return n.__filtered__&&(t>0||e<0)?new xn(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==i&&(n=(e=Ha(e))<0?n.dropRight(-e):n.take(e-t)),n)},xn.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},xn.prototype.toArray=function(){return this.take(z)},Kn(xn.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),s=gn[r?"take"+("last"==e?"Right":""):e],o=r||/^find/.test(e);s&&(gn.prototype[e]=function(){var e=this.__wrapped__,a=r?[1]:arguments,l=e instanceof xn,h=a[0],c=l||xa(e),u=function(t){var e=s.apply(gn,ci([t],a));return r&&f?e[0]:e};c&&n&&"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 xn(this);var m=t.apply(e,a);return m.__actions__.push({func:No,args:[u],thisArg:i}),new _n(m,f)}return p&&g?t.apply(this,a):(m=this.thru(u),p?r?m.value()[0]:m.value():m)})})),ni(["pop","push","shift","sort","splice","unshift"],(function(t){var e=se[t],i=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",n=/^(?:pop|shift)$/.test(t);gn.prototype[t]=function(){var t=arguments;if(n&&!this.__chain__){var r=this.value();return e.apply(xa(r)?r:[],t)}return this[i]((function(i){return e.apply(xa(i)?i:[],t)}))}})),Kn(xn.prototype,(function(t,e){var i=gn[e];if(i){var n=i.name+"";ce.call(on,n)||(on[n]=[]),on[n].push({name:e,func:i})}})),on[gs(i,b).name]=[{name:"wrapper",func:i}],xn.prototype.clone=function(){var t=new xn(this.__wrapped__);return t.__actions__=rs(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=rs(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=rs(this.__views__),t},xn.prototype.reverse=function(){if(this.__filtered__){var t=new xn(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},xn.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,i=xa(t),n=e<0,r=i?t.length:0,s=function(t,e,i){var n=-1,r=i.length;for(;++n=this.__values__.length;return{done:t,value:t?i:this.__values__[this.__index__++]}},gn.prototype.plant=function(t){for(var e,n=this;n instanceof bn;){var r=po(n);r.__index__=0,r.__values__=i,e?s.__wrapped__=r:e=r;var s=r;n=n.__wrapped__}return s.__wrapped__=t,e},gn.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof xn){var e=t;return this.__actions__.length&&(e=new xn(this)),(e=e.reverse()).__actions__.push({func:No,args:[Oo],thisArg:i}),new _n(e,this.__chain__)}return this.thru(Oo)},gn.prototype.toJSON=gn.prototype.valueOf=gn.prototype.value=function(){return Hr(this.__wrapped__,this.__actions__)},gn.prototype.first=gn.prototype.head,Pe&&(gn.prototype[Pe]=function(){return this}),gn}();Ue?((Ue.exports=Ui)._=Ui,$e._=Ui):He._=Ui}).call(n)}(b,b.exports);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],D=t=>(240&t)>>4==(15&t),O=t=>D(t.r)&&D(t.g)&&D(t.b)&&D(t.a);const C=(t,e)=>t<255?e(t):"";const T=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function E(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 L(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 R(t,e,i){const n=E(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 I(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>16&255,s>>8&255,255&s]}return t}(),N.transparent=[0,0,0,0]);const e=N[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}const $=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;const U=t=>t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,Y=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function q(t,e,i){if(t){let n=I(t);n[e]=Math.max(0,Math.min(n[e]+n[e]*i,0===e?360:1)),n=F(n),t.r=n[0],t.g=n[1],t.b=n[2]}}function X(t,e){return t?Object.assign(e||{},t):t}function K(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=X(t,{r:0,g:0,b:0,a:1})).a=y(e.a),e}function Z(t){return"r"===t.charAt(0)?function(t){const e=$.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):V(t)}class G{constructor(t){if(t instanceof G)return t;const e=typeof t;let i;var n,r,s;"object"===e?i=K(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||H(t)||Z(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=X(this._rgb);return t&&(t.a=w(t.a)),t}set rgb(t){this._rgb=K(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${w(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):void 0;var t}hexString(){return this._valid?(t=this._rgb,e=O(t)?P:A,t?"#"+e(t.r)+e(t.g)+e(t.b)+C(t.a,e):void 0):void 0;var t,e}hslString(){return this._valid?function(t){if(!t)return;const e=I(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=Y(w(t.r)),r=Y(w(t.g)),s=Y(w(t.b));return{r:y(U(n+i*(Y(w(e.r))-n))),g:y(U(r+i*(Y(w(e.g))-r))),b:y(U(s+i*(Y(w(e.b))-s))),a:t.a+i*(e.a-t.a)}}(this._rgb,t._rgb,e)),this}clone(){return new G(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 q(this._rgb,2,t),this}darken(t){return q(this._rgb,2,-t),this}saturate(t){return q(this._rgb,1,t),this}desaturate(t){return q(this._rgb,1,-t),this}rotate(t){return function(t,e){var i=I(t);i[0]=j(i[0]+e),i=F(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 J(){}const Q=(()=>{let t=0;return()=>t++})();function tt(t){return null==t}function et(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 it(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}function nt(t){return("number"==typeof t||t instanceof Number)&&isFinite(+t)}function rt(t,e){return nt(t)?t:e}function st(t,e){return void 0===t?e:t}const ot=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function at(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function lt(t,e,i,n){let r,s,o;if(et(t))if(s=t.length,n)for(r=s-1;r>=0;r--)e.call(i,t[r],r);else for(r=0;rt,x:t=>t.x,y:t=>t.y};function bt(t,e){const i=mt[e]||(mt[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 _t(t){return t.charAt(0).toUpperCase()+t.slice(1)}const xt=t=>void 0!==t,vt=t=>"function"==typeof t,yt=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0};const wt=Math.PI,kt=2*wt,Mt=kt+wt,St=Number.POSITIVE_INFINITY,Pt=wt/180,At=wt/2,Dt=wt/4,Ot=2*wt/3,Ct=Math.log10,Tt=Math.sign;function Et(t,e,i){return Math.abs(t-e)l&&h=Math.min(e,i)-n&&t<=Math.max(e,i)+n}function Yt(t,e,i){i=i||(i=>t[i]1;)n=s+r>>1,i(n)?s=n:r=n;return{lo:s,hi:r}}const qt=(t,e,i,n)=>Yt(t,i,n?n=>{const r=t[n][e];return rt[n][e]Yt(t,i,(n=>t[n][e]>=i));const Kt=["push","pop","shift","splice","unshift"];function Zt(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||(Kt.forEach((e=>{delete t[e]})),delete t._chartjs)}function Gt(t){const e=new Set;let i,n;for(i=0,n=t.length;i{n=!1,t.apply(e,i)})))}}const te=t=>"start"===t?"left":"end"===t?"right":"center",ee=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2;function ie(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=$t(Math.min(qt(a,o.axis,h).lo,i?n:qt(e,l,o.getPixelForValue(h)).lo),0,n-1)),s=f?$t(Math.max(qt(a,o.axis,c,!0).hi+1,i?0:qt(e,l,o.getPixelForValue(c),!0).hi+1),r,n)-r:n-r}return{start:r,count:s}}function ne(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 re=t=>0===t||1===t,se=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*kt/i),oe=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*kt/i)+1,ae={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*At),easeOutSine:t=>Math.sin(t*At),easeInOutSine:t=>-.5*(Math.cos(wt*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=>re(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=>re(t)?t:se(t,.075,.3),easeOutElastic:t=>re(t)?t:oe(t,.075,.3),easeInOutElastic(t){const e=.1125;return re(t)?t:t<.5?.5*se(2*t,e,.45):.5+.5*oe(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-ae.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*ae.easeInBounce(2*t):.5*ae.easeOutBounce(2*t-1)+.5};function le(t){if(t&&"object"==typeof t){const e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function he(t){return le(t)?t:new G(t)}function ce(t){return le(t)?t:new G(t).saturate(.5).darken(.1).hexString()}const ue=["x","y","borderWidth","radius","tension"],fe=["color","borderColor","backgroundColor"];const de=new Map;function pe(t,e,i){return function(t,e){e=e||{};const i=t+JSON.stringify(e);let n=de.get(i);return n||(n=new Intl.NumberFormat(t,e),de.set(i,n)),n}(e,i).format(t)}const ge={values:t=>et(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;Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t));return i}(t,i)}const o=Ct(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),pe(t,n,l)},logarithmic(t,e,i){if(0===t)return"0";const n=i[e].significand||t/Math.pow(10,Math.floor(Ct(t)));return[1,2,3,5,10,15].includes(n)||e>.8*i.length?ge.numeric.call(this,t,e,i):""}};var me={formatters:ge};const be=Object.create(null),_e=Object.create(null);function xe(t,e){if(!e)return t;const i=e.split(".");for(let n=0,r=i.length;nt.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)=>ce(e.backgroundColor),this.hoverBorderColor=(t,e)=>ce(e.borderColor),this.hoverColor=(t,e)=>ce(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 ve(this,t,e)}get(t){return xe(this,t)}describe(t,e){return ve(_e,t,e)}override(t,e){return ve(be,t,e)}route(t,e,i,n){const r=xe(this,t),s=xe(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 it(t)?Object.assign({},e,t):st(t,e)},set(t){this[o]=t}}})}apply(t){t.forEach((t=>t(this)))}}var we=new ye({_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:fe},numbers:{type:"number",properties:ue}}),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:me.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 ke(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 Me(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;li.length){for(l=0;l0&&t.stroke()}}function Oe(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.xe.top-i&&t.y0&&""!==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]);tt(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+t||0;function Ne(t,e){const i={},n=it(e),r=n?Object.keys(e):e,s=it(t)?n?i=>st(t[i],t[e[i]]):e=>t[e]:()=>t;for(const o of r)i[o]=We(s(o));return i}function He(t){return Ne(t,{top:"y",right:"x",bottom:"y",left:"x"})}function $e(t){return Ne(t,["topLeft","topRight","bottomLeft","bottomRight"])}function Ue(t){const e=He(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Ye(t,e){t=t||{},e=e||we.font;let i=st(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));let n=st(t.style,e.style);n&&!(""+n).match(Ve)&&(console.warn('Invalid font style specified: "'+n+'"'),n=void 0);const r={family:st(t.family,e.family),lineHeight:Be(st(t.lineHeight,e.lineHeight),i),size:i,style:n,weight:st(t.weight,e.weight),string:""};return r.string=function(t){return!t||tt(t.size)||tt(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(r),r}function qe(t,e,i,n){let r,s,o,a=!0;for(r=0,s=t.length;rt[0])){xt(n)||(n=oi("_fallback",t));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:i,_fallback:n,_getTarget:r,override:r=>Ke([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)=>ti(i,n,(()=>function(t,e,i,n){let r;for(const s of e)if(r=oi(Je(s,t),i),xt(r))return Qe(t,r)?ri(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)=>ai(t).includes(e),ownKeys:t=>ai(t),set(t,e,i){const n=t._storage||(t._storage=r());return t[e]=n[e]=i,delete t._keys,!0}})}function Ze(t,e,i,n){const r={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:Ge(t,n),setContext:e=>Ze(t,e,i,n),override:r=>Ze(t.override(r),e,i,n)};return new Proxy(r,{deleteProperty:(e,i)=>(delete e[i],delete t[i],!0),get:(t,e,i)=>ti(t,e,(()=>function(t,e,i){const{_proxy:n,_context:r,_subProxy:s,_descriptors:o}=t;let a=n[e];vt(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);a.add(t),e=e(s,o||n),a.delete(t),Qe(t,e)&&(e=ri(r._scopes,r,t,e));return e}(e,a,t,i));et(a)&&a.length&&(a=function(t,e,i,n){const{_proxy:r,_context:s,_subProxy:o,_descriptors:a}=i;if(xt(s.index)&&n(t))e=e[s.index%e.length];else if(it(e[0])){const i=e,n=r._scopes.filter((t=>t!==i));e=[];for(const l of i){const i=ri(n,r,t,l);e.push(Ze(i,s,o&&o[t],a))}}return e}(e,a,t,o.isIndexable));Qe(e,a)&&(a=Ze(a,r,s&&s[e],o));return 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 Ge(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:vt(i)?i:()=>i,isIndexable:vt(n)?n:()=>n}}const Je=(t,e)=>t?t+_t(e):e,Qe=(t,e)=>it(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function ti(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];const n=i();return t[e]=n,n}function ei(t,e,i){return vt(t)?t(e,i):t}const ii=(t,e)=>!0===t?e:"string"==typeof t?bt(e,t):void 0;function ni(t,e,i,n,r){for(const s of e){const e=ii(i,s);if(e){t.add(e);const s=ei(e._fallback,i,r);if(xt(s)&&s!==i&&s!==n)return s}else if(!1===e&&xt(n)&&i!==n)return null}return!1}function ri(t,e,i,n){const r=e._rootScopes,s=ei(e._fallback,i,n),o=[...t,...r],a=new Set;a.add(n);let l=si(a,o,i,s||i,n);return null!==l&&((!xt(s)||s===i||(l=si(a,o,s,l,n),null!==l))&&Ke(Array.from(a),[""],r,s,(()=>function(t,e,i){const n=t._getTarget();e in n||(n[e]={});const r=n[e];if(et(r)&&it(i))return i;return r||{}}(e,i,n))))}function si(t,e,i,n,r){for(;i;)i=ni(t,e,i,n,r);return i}function oi(t,e){for(const i of e){if(!i)continue;const e=i[t];if(xt(e))return e}}function ai(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 li(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;ae"x"===t?"y":"x";function fi(t,e,i,n){const r=t.skip?e:t,s=e,o=i.skip?e:i,a=Bt(s,r),l=Bt(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 di(t,e="x"){const i=ui(e),n=t.length,r=Array(n).fill(0),s=Array(n);let o,a,l,h=ci(t,0);for(o=0;o!t.skip))),"monotone"===e.cubicInterpolationMode)di(t,r);else{let i=n?t[t.length-1]:t[0];for(s=0,o=t.length;st.ownerDocument.defaultView.getComputedStyle(t,null);const vi=["top","right","bottom","left"];function yi(t,e,i){const n={};i=i?"-"+i:"";for(let r=0;r<4;r++){const s=vi[r];n[s]=parseFloat(t[e+"-"+s+i])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}const wi=(t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot);function ki(t,e){if("native"in t)return t;const{canvas:i,currentDevicePixelRatio:n}=e,r=xi(i),s="border-box"===r.boxSizing,o=yi(r,"padding"),a=yi(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(wi(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 Mi=t=>Math.round(10*t)/10;function Si(t,e,i,n){const r=xi(t),s=yi(r,"margin"),o=_i(r.maxWidth,t,"clientWidth")||St,a=_i(r.maxHeight,t,"clientHeight")||St,l=function(t,e,i){let n,r;if(void 0===e||void 0===i){const s=bi(t);if(s){const t=s.getBoundingClientRect(),o=xi(s),a=yi(o,"border","width"),l=yi(o,"padding");e=t.width-l.width-a.width,i=t.height-l.height-a.height,n=_i(o.maxWidth,s,"clientWidth"),r=_i(o.maxHeight,s,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:n||St,maxHeight:r||St}}(t,e,i);let{width:h,height:c}=l;if("content-box"===r.boxSizing){const t=yi(r,"border","width"),e=yi(r,"padding");h-=e.width+t.width,c-=e.height+t.height}h=Math.max(0,h-s.width),c=Math.max(0,n?h/n:c-s.height),h=Mi(Math.min(h,o,l.maxWidth)),c=Mi(Math.min(c,a,l.maxHeight)),h&&!c&&(c=Mi(h/2));return(void 0!==e||void 0!==i)&&n&&l.height&&c>l.height&&(c=l.height,h=Mi(Math.floor(c*n))),{width:h,height:c}}function Pi(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 Ai=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 Di(t,e){const i=function(t,e){return xi(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 Ci(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 Ti(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)}const Ei=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}},Li=function(){return{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}};function Ri(t,e,i){return t?Ei(e,i):Li()}function Ii(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 zi(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function Fi(t){return"angle"===t?{between:Ht,compare:Wt,normalize:Nt}:{between:Ut,compare:(t,e)=>t-e,normalize:t=>t}}function ji({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 Vi(t,e,i){if(!i)return[t];const{property:n,start:r,end:s}=i,o=e.length,{compare:a,between:l,normalize:h}=Fi(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}=Fi(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_||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(ji({start:x,end:w,loop:f,count:o,style:d})),x=null),k=w,b=g));return null!==x&&p.push(ji({start:x,end:u,loop:f,count:o,style:d})),p}function Bi(t,e){const i=[],n=t.segments;for(let r=0;rn({chart:t,initial:e.initial,numSteps:s,currentStep:Math.min(i-e.start,s)})))}_refresh(){this._request||(this._running=!0,this._request=Jt.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 Ui=new $i;const Yi="transparent",qi={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){const n=he(t||Yi),r=n.valid&&he(e||Yi);return r&&r.valid?r.mix(n,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class Xi{constructor(t,e,i,n){const r=e[i];n=qe([t.to,n,r,t.from]);const s=qe([t.from,r,n]);this._active=!0,this._fn=t.fn||qi[t.type||typeof s],this._easing=ae[t.easing]||ae.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=qe([t.to,e,n,t.from]),this._from=qe([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||e1?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{const r=t[n];if(!it(r))return;const s={};for(const t of e)s[t]=r[t];(et(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 void(t.options=e);i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}}));return i}(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{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 Xi(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?(Ui.add(this._chart,i),!0):void 0}}function Zi(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 Gi(t,e){const i=[],n=t._getSortedDatasetMetas(e);let r,s;for(r=0,s=n.length;r0||!i&&e<0)return r.index}return null}function nn(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;di[t].axis===e)).shift()}function sn(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 on=t=>"reset"===t||"none"===t,an=(t,e)=>e?t:Object.assign({},t);class ln{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=Qi(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&&sn(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=st(i.xAxisID,rn(t,"x")),s=e.yAxisID=st(i.yAxisID,rn(t,"y")),o=e.rAxisID=st(i.rAxisID,rn(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&&Zt(this._data,this),t._stacked&&sn(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(it(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{const e="_onData"+_t(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=Qi(e.vScale,e),e.stack!==i.stack&&(n=!0,sn(e),e.stack=i.stack),this._resyncElements(t),(n||r!==e._stacked)&&nn(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=et(n[t])?this.parseArrayData(i,n,t,e):it(n[t])?this.parseObjectData(i,n,t,e):this.parsePrimitiveData(i,n,t,e);const r=()=>null===l[o]||u&&l[o]t&&!e.hidden&&e._stacked&&{keys:Gi(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!nt(f[t.axis])||h>e||c=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=0&&tthis.getContext(i,n,e)),c);return d.$shared&&(d.$shared=a,r[s]=Object.freeze(an(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 Ki(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||on(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){on(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}updateSharedOptions(t,e,i){t&&!on(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{for(t.length+=e,o=t.length-1;o>=s;o--)t[o]=t[o-e]};for(a(r),o=t;ot-e)))}return t._cache.$bar}(e,t.type);let n,r,s,o,a=e._length;const l=()=>{32767!==s&&-32768!==s&&(xt(o)&&(a=Math.min(a,Math.abs(s-o)||a)),o=s)};for(n=0,r=i.length;nMath.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 un(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;ht.x,i="left",n="right"):(e=t.baset.controller.options.grouped)),r=i.options.stacked,s=[],o=t=>{const i=t.controller.getParsed(e),n=i&&i[t.vScale.axis];if(tt(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=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=Tt(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=st(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=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+i[t];if(it(i[t])){const{key:t="value"}=this._parsing;o=e=>+bt(i[e],t)}for(r=t,s=t+e;rHt(t,a,l,!0)?1:Math.max(e,e*i,n,n*i),p=(t,e,n)=>Ht(t,a,l,!0)?-1:Math.min(e,e*i,n,n*i),g=d(0,h,u),m=d(At,c,f),b=p(wt,h,u),_=p(wt+At,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=ot(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/kt)}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;g0&&!isNaN(t)?kt*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],r=pe(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"spacing"!==t,_indexable:t=>"spacing"!==t}),t(xn,"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()}}}});class vn extends ln{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}=ie(e,n,s);this._drawStart=o,this._drawCount=a,ne(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=Rt(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=b){d.skip=!0;continue}const _=this.getParsed(v),y=tt(_[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()}}t(vn,"id","line"),t(vn,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),t(vn,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class yn extends ln{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=pe(e._parsed[t].r,i.options.locale);return{label:n[t]||"",value:r}}parseObjectData(t,e,i,n){return li.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)&&(ne.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*wt;let u,f=c;const d=360/this.countVisibleElements();for(u=0;u{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&e++})),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?zt(this.resolveDataElementOptions(t,e).angle||i):0}}t(yn,"id","polarArea"),t(yn,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),t(yn,"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}}});class wn extends xn{}t(wn,"id","pie"),t(wn,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class kn extends ln{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 li.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;o0&&this.getParsed(e-1);for(let x=e;x0&&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}}t(Mn,"id","scatter"),t(Mn,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),t(Mn,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Sn=Object.freeze({__proto__:null,BarController:bn,BubbleController:_n,DoughnutController:xn,LineController:vn,PolarAreaController:yn,PieController:wn,RadarController:kn,ScatterController:Mn});function Pn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class An{static override(t){Object.assign(An.prototype,t)}constructor(t){this.options=t||{}}init(){}formats(){return Pn()}parse(){return Pn()}format(){return Pn()}add(){return Pn()}diff(){return Pn()}startOf(){return Pn()}endOf(){return Pn()}}var Dn=An;function On(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?Xt:qt;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 Cn(t,e,i,n,r){const s=t.getSortedVisibleDatasetMetas(),o=i[e];for(let a=0,l=s.length;a{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 In={evaluateInteractionItems:Cn,modes:{index(t,e,i,n){const r=ki(e,t),s=i.axis||"x",o=i.includeInvisible||!1,a=i.intersect?Tn(t,r,s,n,o):Ln(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=ki(e,t),s=i.axis||"xy",o=i.includeInvisible||!1;let a=i.intersect?Tn(t,r,s,n,o):Ln(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;tTn(t,ki(e,t),i.axis||"xy",n,i.includeInvisible||!1),nearest(t,e,i,n){const r=ki(e,t),s=i.axis||"xy",o=i.includeInvisible||!1;return Ln(t,r,s,i.intersect,n,o)},x:(t,e,i,n)=>Rn(t,ki(e,t),"x",i.intersect,n),y:(t,e,i,n)=>Rn(t,ki(e,t),"y",i.intersect,n)}};const zn=["left","top","right","bottom"];function Fn(t,e){return t.filter((t=>t.pos===e))}function jn(t,e){return t.filter((t=>-1===zn.indexOf(t.pos)&&t.box.axis===e))}function Vn(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 Bn(t,e){const i=function(t){const e={};for(const i of t){const{stack:t,pos:n,stackWeight:r}=i;if(!t||!zn.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{n[t]=Math.max(e[t],i[t])})),n}return n(t?["left","right"]:["top","bottom"])}function Un(t,e,i,n){const r=[];let s,o,a,l,h,c;for(s=0,o=t.length,h=0;st.box.fullSize)),!0),n=Vn(Fn(e,"left"),!0),r=Vn(Fn(e,"right")),s=Vn(Fn(e,"top"),!0),o=Vn(Fn(e,"bottom")),a=jn(e,"x"),l=jn(e,"y");return{fullSize:i,leftAndTop:n.concat(s),rightAndBottom:r.concat(l).concat(o).concat(a),chartArea:Fn(e,"chartArea"),vertical:n.concat(r).concat(l),horizontal:s.concat(o).concat(a)}}(t.boxes),l=a.vertical,h=a.horizontal;lt(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);Nn(f,Ue(n));const d=Object.assign({maxPadding:f,w:s,h:o,x:r.left,y:r.top},r),p=Bn(l.concat(h),u);Un(a.fullSize,d,u,p),Un(l,d,u,p),Un(h,d,u,p)&&Un(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),qn(a.leftAndTop,d,u,p),d.x+=d.w,d.y+=d.h,qn(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},lt(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 Kn{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 Zn extends Kn{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Gn="$chartjs",Jn={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Qn=t=>null===t||""===t;const tr=!!Ai&&{passive:!0};function er(t,e,i){t.canvas.removeEventListener(e,i,tr)}function ir(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function nr(t,e,i){const n=t.canvas,r=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||ir(i.addedNodes,n),e=e&&!ir(i.removedNodes,n);e&&i()}));return r.observe(document,{childList:!0,subtree:!0}),r}function rr(t,e,i){const n=t.canvas,r=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||ir(i.removedNodes,n),e=e&&!ir(i.addedNodes,n);e&&i()}));return r.observe(document,{childList:!0,subtree:!0}),r}const sr=new Map;let or=0;function ar(){const t=window.devicePixelRatio;t!==or&&(or=t,sr.forEach(((e,i)=>{i.currentDevicePixelRatio!==t&&e()})))}function lr(t,e,i){const n=t.canvas,r=n&&bi(n);if(!r)return;const s=Qt(((t,e)=>{const n=r.clientWidth;i(t,e),n{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){sr.size||window.addEventListener("resize",ar),sr.set(t,e)}(t,s),o}function hr(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){sr.delete(t),sr.size||window.removeEventListener("resize",ar)}(t)}function cr(t,e,i){const n=t.canvas,r=Qt((e=>{null!==t.ctx&&i(function(t,e){const i=Jn[t.type]||t.type,{x:n,y:r}=ki(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,tr)}(n,e,r),r}class ur extends Kn{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[Gn]={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",Qn(r)){const e=Di(t,"width");void 0!==e&&(t.width=e)}if(Qn(n))if(""===t.style.height)t.height=t.width/(e||2);else{const e=Di(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[Gn])return!1;const i=e[Gn].initial;["height","width"].forEach((t=>{const n=i[t];tt(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[Gn],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),r={attach:nr,detach:rr,resize:lr}[e]||cr;n[e]=r(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),n=i[e];if(!n)return;({attach:hr,detach:hr,resize:hr}[e]||er)(t,e,n),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,n){return Si(t,e,i,n)}isAttached(t){const e=bi(t);return!(!e||!e.isConnected)}}class fr{constructor(){t(this,"active",!1)}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return Rt(this.x)&&Rt(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 dr(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;ir)return function(t,e,i,n){let r,s=0,o=i[0];for(n=Math.ceil(n),r=0;rt-e)).pop(),e}(n);for(let o=0,a=s.length-1;or)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(pr(e,h,c,tt(n)?0:a-n,a),t=0,i=o-1;t"left"===t?"right":"right"===t?"left":t,mr=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i,br=(t,e)=>Math.min(e||t,t);function _r(t,e){const i=[],n=t.length/e,r=t.length;let s=0;for(;so+a)))return h}function vr(t){return t.drawTicks?t.tickLength:0}function yr(t,e){if(!t.display)return 0;const i=Ye(t.font,e),n=Ue(t.padding);return(et(t.text)?t.text.length:1)*i.lineHeight+n.height}function wr(t,e,i){let n=te(t);return(i&&"right"!==e||!i&&"right"===e)&&(n=gr(n)),n}class kr extends fr{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=rt(t,Number.POSITIVE_INFINITY),e=rt(e,Number.NEGATIVE_INFINITY),i=rt(i,Number.POSITIVE_INFINITY),n=rt(n,Number.NEGATIVE_INFINITY),{min:rt(t,i),max:rt(e,n),minDefined:nt(t),maxDefined:nt(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;an?n:i,n=r&&i>n?i:n,{min:rt(i,rt(n,i)),max:rt(n,rt(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(){at(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=ot(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=r||i<=1||!this.isHorizontal())return void(this.labelRotation=n);const h=this._getLabelSizes(),c=h.widest.width,u=h.highest.height,f=$t(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-vr(t.grid)-e.padding-yr(t.title,this.chart.options.font),a=Math.sqrt(c*c+u*u),l=Ft(Math.min(Math.asin($t((h.highest.height+6)/s,-1,1)),Math.asin($t(o/a,-1,1))-Math.asin($t(u/a,-1,1)))),l=Math.max(n,Math.min(r,l))),this.labelRotation=l}afterCalculateLabelRotation(){at(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){at(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=yr(n,e.options.font);if(o?(t.width=this.maxWidth,t.height=vr(r)+s):(t.height=this.maxHeight,t.width=vr(r)+s),i.display&&this.ticks.length){const{first:e,last:n,widest:r,highest:s}=this._getLabelSizes(),a=2*i.padding,l=zt(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(){at(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{const i=t.gc,n=i.length/2;let r;if(n>e){for(r=0;r({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 $t(this._alignToPixels?Se(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&&to*n?o/i:a/n:a*n0}_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=vr(r),u=[],f=o.setContext(this.getContext()),d=f.display?f.width:0,p=d/2,g=function(t){return Se(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(it(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(it(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 D=st(n.ticks.maxTicksLimit,h),O=Math.max(1,Math.ceil(h/D));for(b=0;be.value===t));if(i>=0){return e.setContext(this.getContext(i)).lineWidth}return 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{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{const n=i.split("."),r=n.pop(),s=[t].concat(n).join("."),o=e[i].split("."),a=o.pop(),l=o.join(".");we.route(s,r,l,a)}))}(e,t.defaultRoutes);t.descriptors&&we.describe(e,t.descriptors)}(t,s,i),this.override&&we.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 we[n]&&(delete we[n][i],this.override&&delete be[i])}}class Sr{constructor(){this.controllers=new Mr(ln,"datasets",!0),this.elements=new Mr(fr,"elements"),this.plugins=new Mr(Object,"plugins"),this.scales=new Mr(kr,"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):lt(e,(e=>{const n=i||this._getRegistryForType(e);this._exec(t,n,e)}))}))}_exec(t,e,i){const n=_t(t);at(i["before"+n],[],i),e[t](i),at(i["after"+n],[],i)}_getRegistryForType(t){for(let e=0;et.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 Dr(t,e){return e||!1!==t?!0===t?{}:t:null}function Or(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 Cr(t,e){const i=we.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function Tr(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&&Tr(t[0].toLowerCase(),e))return t;throw new Error(`Cannot determine type of '${name}' axis. Please provide 'axis' or 'position' option.`)}function Er(t){const e=t.options||(t.options={});e.plugins=st(e.plugins,{}),e.scales=function(t,e){const i=be[t.type]||{scales:{}},n=e.scales||{},r=Cr(t.type,e),s=Object.create(null);return Object.keys(n).forEach((t=>{const e=n[t];if(!it(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=Tr(t,e),a=function(t,e){return t===e?"_index_":"_value_"}(o,r),l=i.scales||{};s[t]=pt(Object.create(null),[{axis:o},e,l[o],l[a]])})),t.data.datasets.forEach((i=>{const r=i.type||t.type,o=i.indexAxis||Cr(r,e),a=(be[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),pt(s[r],[{axis:e},n[r],a[t]])}))})),Object.keys(s).forEach((t=>{const e=s[t];pt(e,[we.scales[e.type],we.scale])})),s}(t,e)}function Lr(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const Rr=new Map,Ir=new Set;function zr(t,e){let i=Rr.get(t);return i||(i=e(),Rr.set(t,i),Ir.add(i)),i}const Fr=(t,e,i)=>{const n=bt(e,i);void 0!==n&&t.add(n)};class jr{constructor(t){this._config=function(t){return(t=t||{}).data=Lr(t.data),Er(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=Lr(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(),Er(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return zr(t,(()=>[[`datasets.${t}`,""]]))}datasetAnimationScopeKeys(t,e){return zr(`${t}.transition.${e}`,(()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]]))}datasetElementScopeKeys(t,e){return zr(`${t}-${e}`,(()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]]))}pluginScopeKeys(t){const e=t.id;return zr(`${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=>Fr(a,t,e)))),e.forEach((t=>Fr(a,n,t))),e.forEach((t=>Fr(a,be[r]||{},t))),e.forEach((t=>Fr(a,we,t))),e.forEach((t=>Fr(a,_e,t)))}));const l=Array.from(a);return 0===l.length&&l.push(Object.create(null)),Ir.has(e)&&s.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,be[e]||{},we.datasets[e]||{},{type:e},we,_e]}resolveNamedOptions(t,e,i,n=[""]){const r={$shared:!0},{resolver:s,subPrefixes:o}=Vr(this._resolverCache,t,n);let a=s;if(function(t,e){const{isScriptable:i,isIndexable:n}=Ge(t);for(const r of e){const e=i(r),s=n(r),o=(s||e)&&t[r];if(e&&(vt(o)||Br(o))||s&&et(o))return!0}return!1}(s,e)){r.$shared=!1;a=Ze(s,i=vt(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}=Vr(this._resolverCache,t,i);return it(e)?Ze(r,e,void 0,n):r}}function Vr(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);if(!s){s={resolver:Ke(e,i),subPrefixes:i.filter((t=>!t.toLowerCase().includes("hover")))},n.set(r,s)}return s}const Br=t=>it(t)&&Object.getOwnPropertyNames(t).reduce(((e,i)=>e||vt(t[i])),!1);const Wr=["top","bottom","left","right","chartArea"];function Nr(t,e){return"top"===t||"bottom"===t||-1===Wr.indexOf(t)&&"x"===e}function Hr(t,e){return function(i,n){return i[t]===n[t]?i[e]-n[e]:i[t]-n[t]}}function $r(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),at(i&&i.onComplete,[t],e)}function Ur(t){const e=t.chart,i=e.options.animation;at(i&&i.onProgress,[t],e)}function Yr(t){return mi()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const qr={},Xr=t=>{const e=Yr(t);return Object.values(qr).filter((t=>t.canvas===e)).pop()};function Kr(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 Zr{static register(...t){Pr.add(...t),Gr()}static unregister(...t){Pr.remove(...t),Gr()}constructor(t,e){const i=this.config=new jr(e),n=Yr(t),r=Xr(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!mi()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?Zn:ur}(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=Q(),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 Ar,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=[],qr[this.id]=this,o&&a?(Ui.listen(this,"complete",$r),Ui.listen(this,"progress",Ur),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 tt(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 Pr}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Pi(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Pe(this.canvas,this.ctx),this}stop(){return Ui.stop(this),this}resize(t,e){Ui.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,Pi(this,o,!0)&&(this.notifyPlugins("resize",{size:s}),at(i.onResize,[this,s],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){lt(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=Tr(t,i),r="r"===n,s="x"===n;return{options:i,dposition:r?"chartArea":s?"bottom":"left",dtype:r?"radialLinear":s?"category":"linear"}})))),lt(r,(e=>{const r=e.options,s=r.id,o=Tr(s,r),a=st(r.type,e.dtype);void 0!==r.position&&Nr(r.position,o)===Nr(e.dposition)||(r.position=e.dposition),n[s]=!0;let l=null;if(s in i&&i[s].type===a)l=i[s];else{l=new(Pr.getScale(a))({id:s,type:a,ctx:this.ctx,chart:this}),i[l.id]=l}l.init(r,t)})),lt(n,((t,e)=>{t||delete i[e]})),lt(i,(t=>{Xn.configure(this,t,t.options),Xn.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;te.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{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{t.reset()})),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Hr("z","_idx"));const{_active:o,_lastEvent:a}=this;a?this._eventHandler(a,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){lt(this.scales,(t=>{Xn.removeBox(this,t)})),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);yt(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){Kr(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;rt.split(","))).map((t=>({method:t[1],start:+t[2],count:+t[3]})))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;Xn.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],lt(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=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&&Ce(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&&Te(e),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return Oe(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,n){const r=In.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=Xe(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);xt(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(),Ui.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,i,n),t[i]=n},n=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};lt(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(){lt(this._listeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._listeners={},lt(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{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}}));!ht(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,at(r.onHover,[t,o,this],this),a&&at(r.onClick,[t,o,this],this));const h=!ht(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 Gr(){return lt(Zr.instances,(t=>t._plugins.invalidate()))}function Jr(t,e,i,n){const r=Ne(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]);const s=(i-e)/2,o=Math.min(s,n*e/2),a=t=>{const e=(i-Math.min(s,t))*n/2;return $t(t,0,Math.min(s,e))};return{outerStart:a(r.outerStart),outerEnd:a(r.outerEnd),innerStart:$t(r.innerStart,0,o),innerEnd:$t(r.innerEnd,0,o)}}function Qr(t,e,i,n){return{x:i+t*Math.cos(e),y:n+t*Math.sin(e)}}function ts(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/wt)/u)/2,m=l+g+d,b=r-g-d,{outerStart:_,outerEnd:x,innerStart:v,innerEnd:y}=Jr(e,f,u,b-m),w=u-_,k=u-x,M=m+_/w,S=b-x/k,P=f+v,A=f+y,D=m+v/P,O=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=Qr(k,S,o,a);t.arc(e.x,e.y,x,S,b+At)}const i=Qr(A,b,o,a);if(t.lineTo(i.x,i.y),y>0){const e=Qr(A,O,o,a);t.arc(e.x,e.y,y,b+At,O+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=Qr(P,D,o,a);t.arc(e.x,e.y,v,D+Math.PI,m-At)}const r=Qr(w,m,o,a);if(t.lineTo(r.x,r.y),_>0){const e=Qr(w,M,o,a);t.arc(e.x,e.y,_,m-At,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 es(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){ts(t,e,i,n,f,r);for(let e=0;er?(h=r/l,t.arc(s,o,l,i+h,n-h,!0)):t.arc(s,o,r,i+At,n-At),t.closePath(),t.clip()}(t,e,f),s||(ts(t,e,i,n,f,r),t.stroke())}t(Zr,"defaults",we),t(Zr,"instances",qr),t(Zr,"overrides",be),t(Zr,"registry",Pr),t(Zr,"version","4.2.1"),t(Zr,"getChart",Xr),e("C",Zr);class is extends fr{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}=Vt(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=st(c,a-o)>=kt||Ht(r,o,a),d=Ut(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>kt?Math.floor(i/kt):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(wt,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){ts(t,e,i,n,l,r);for(let e=0;ea&&s>a;return{count:n,start:l,loop:e.loop,ilen:h(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?(ip&&(p=i),m=(b*m+e)/++b):(x(),t.lineTo(e,i),f=n,b=0,d=p=i),g=i}x()}function ls(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return!(t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i)?as:os}t(is,"id","arc"),t(is,"defaults",{borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),t(is,"defaultRoutes",{backgroundColor:"backgroundColor"});const hs="function"==typeof Path2D;function cs(t,e,i,n){hs&&!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()),ns(t,e.options),t.stroke(r)}(t,e,i,n):function(t,e,i,n){const{segments:r,options:s}=e,o=ls(e);for(const a of r)ns(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 us extends fr{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;gi(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(;rr&&t[s%e].skip;)s--;return s%=e,{start:r,end:s}}(i,r,s,n);return Wi(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"borderDash"!==t&&"fill"!==t});class ds extends fr{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)t.replace("rgb(","rgba(").replace(")",", 0.5)")));function Ms(t){return ws[t%ws.length]}function Ss(t){return ks[t%ks.length]}function Ps(t){let e=0;return(i,n)=>{const r=t.getDatasetMeta(n).controller;r instanceof xn?e=function(t,e){return t.backgroundColor=t.data.map((()=>Ms(e++))),e}(i,e):r instanceof yn?e=function(t,e){return t.backgroundColor=t.data.map((()=>Ss(e++))),e}(i,e):r&&(e=function(t,e){return t.borderColor=Ms(e),t.backgroundColor=Ss(e),++e}(i,e))}}function As(t){let e;for(e in t)if(t[e].borderColor||t[e].backgroundColor)return!0;return!1}var Ds={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&&(As(n)||(o=r)&&(o.borderColor||o.backgroundColor)||s&&As(s)))return;var o;const a=Ps(t);n.forEach(a)}};function Os(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 Cs(t){t.data.datasets.forEach((t=>{Os(t)}))}var Ts={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,i)=>{if(!i.enabled)return void Cs(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"===qe([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{start:c,count:u}=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=$t(qt(e,s.axis,o).lo,0,i-1)),n=h?$t(qt(e,s.axis,a).hi+1,r,i)-r:i-r,{start:r,count:n}}(a,l);if(u<=(i.threshold||4*n))return void Os(e);let f;switch(tt(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":f=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;cf&&(f=d,u=t[n],p=n);o[l++]=u,g=p}return o[l++]=t[h],o}(l,c,u,n,i);break;case"min-max":f=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;rd&&(d=a,c=r),p=(g*p+s.x)/++g;else{const i=r-1;if(!tt(h)&&!tt(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,c,u,n);break;default:throw new Error(`Unsupported decimation algorithm '${i.algorithm}'`)}e._decimated=f}))},destroy(t){Cs(t)}};function Es(t,e,i,n){if(n)return;let r=e[t],s=i[t];return"angle"===t&&(r=Nt(r),s=Nt(s)),{property:t,start:r,end:s}}function Ls(t,e,i){for(;e>t;e--){const t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function Rs(t,e,i,n){return t&&e?n(t[i],e[i]):t?t[i]:e?e[i]:0}function Is(t,e){let i=[],n=!1;return et(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=Ls(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 us({points:i,options:{tension:0},_loop:n,_fullLoop:n}):null}function zs(t){return t&&!1!==t.fill}function Fs(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(!nt(n))return n;if(s=t[n],!s)return!1;if(s.visible)return n;r.push(n),n=s.fill}return!1}function js(t,e,i){const n=function(t){const e=t.options,i=e.fill;let n=st(i&&i.target,i);void 0===n&&(n=!!e.backgroundColor);if(!1===n||null===n)return!1;if(!0===n)return"origin";return n}(t);if(it(n))return!isNaN(n.value)&&n;let r=parseFloat(n);return nt(r)&&Math.floor(r)===r?function(t,e,i,n){"-"!==t&&"+"!==t||(i=e+i);if(i===e||i<0||i>=n)return!1;return i}(n[0],e,r,i):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function Vs(t,e,i){const n=[];for(let r=0;r=0;--o){const e=r[o].$filler;e&&(e.line.updateControlPoints(s,e.axis),n&&e.fill&&Hs(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;zs(e)&&Hs(t.ctx,e,t.chartArea)}},beforeDatasetDraw(t,e,i){const n=e.meta.$filler;zs(n)&&"beforeDatasetDraw"===i.drawTime&&Hs(t.ctx,n,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Ks=(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 Zs extends fr{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=at(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=Ye(i.font),r=n.size,s=this._computeTitleHeight(),{boxWidth:o,itemHeight:a}=Ks(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;r&&"string"!=typeof r&&(r=r.reduce(((t,e)=>t.length>e.length?t:e)));return e+i.size/2+n.measureText(r).width}(n,t,e,i),o=function(t,e,i){let n=t;"string"!=typeof e.text&&(n=Gs(e,i));return 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=Ri(r,this.left,this.width);if(this.isHorizontal()){let r=0,o=ee(i,this.left+n,this.right-this.lineWidths[r]);for(const a of e)r!==a.row&&(r=a.row,o=ee(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=ee(i,this.top+t+n,this.bottom-this.columnSizes[r].height);for(const a of e)a.col!==r&&(r=a.col,o=ee(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;Ce(t,this),this._draw(),Te(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:n}=this,{align:r,labels:s}=t,o=we.color,a=Ri(t.rtl,this.left,this.width),l=Ye(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}=Ks(s,c),m=this.isHorizontal(),b=this._computeTitleHeight();f=m?{x:ee(r,this.left+h,this.right-i[0]),y:this.top+h+b,line:0}:{x:this.left+h,y:ee(r,this.top+b+h,this.bottom-e[0].height),line:0},Ii(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;a.setWidth(this.width),m?v>0&&M+k+h>this.right&&(S=f.y+=_,f.line++,M=f.x=ee(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=ee(r,this.top+b+h,this.bottom-e[f.line].height));if(function(t,e,i){if(isNaN(d)||d<=0||isNaN(p)||p<0)return;n.save();const r=st(i.lineWidth,1);if(n.fillStyle=st(i.fillStyle,o),n.lineCap=st(i.lineCap,"butt"),n.lineDashOffset=st(i.lineDashOffset,0),n.lineJoin=st(i.lineJoin,"miter"),n.lineWidth=r,n.strokeStyle=st(i.strokeStyle,o),n.setLineDash(st(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);De(n,o,l,e+u,s.pointStyleWidth&&d)}else{const s=e+Math.max((c-p)/2,0),o=a.leftForLtr(t,d),l=$e(i.borderRadius);n.beginPath(),Object.values(l).some((t=>0!==t))?Fe(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){Re(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+=Gs(x,t)}else f.y+=_})),zi(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=Ye(e.font),n=Ue(e.padding);if(!e.display)return;const r=Ri(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=ee(t.align,c,this.right-u);else{const e=this.columnSizes.reduce(((t,e)=>Math.max(t,e.height)),0);h=l+ee(t.align,this.top,this.bottom-e-t.labels.padding-this._computeTitleHeight())}const f=ee(o,c,c+u);s.textAlign=r.textAlign(te(o)),s.textBaseline="middle",s.strokeStyle=e.color,s.fillStyle=e.color,s.font=i.string,Re(s,e.text,f,h,i)}_computeTitleHeight(){const t=this.options.title,e=Ye(t.font),i=Ue(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,n,r;if(Ut(t,this.left,this.right)&&Ut(e,this.top,this.bottom))for(r=this.legendHitBoxes,i=0;inull!==t&&null!==e&&t.datasetIndex===e.datasetIndex&&t.index===e.index)(n,i);n&&!r&&at(e.onLeave,[t,n,this],this),this._hoveredItem=i,i&&!r&&at(e.onHover,[t,i,this],this)}else i&&at(e.onClick,[t,i,this],this)}}function Gs(t,e){return e*(t.text?t.text.length+.5:0)}var Js={id:"legend",_element:Zs,start(t,e,i){const n=t.legend=new Zs({ctx:t.ctx,options:i,chart:t});Xn.configure(t,n,i),Xn.addBox(t,n)},stop(t){Xn.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,i){const n=t.legend;Xn.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=Ue(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 Qs extends fr{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=et(i.text)?i.text.length:1;this._padding=Ue(i.padding);const r=n*Ye(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=ee(o,i,r),h=e+t,a=r-i):("left"===s.position?(l=i+t,h=ee(o,n,e),c=-.5*wt):(l=r-t,h=ee(o,e,n),c=.5*wt),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=Ye(e.font),n=i.lineHeight/2+this._padding.top,{titleX:r,titleY:s,maxWidth:o,rotation:a}=this._drawArgs(n);Re(t,e.text,0,0,i,{color:e.color,maxWidth:o,rotation:a,textAlign:te(e.align),textBaseline:"middle",translation:[r,s]})}}var to={id:"title",_element:Qs,start(t,e,i){!function(t,e){const i=new Qs({ctx:t.ctx,options:e,chart:t});Xn.configure(t,i,e),Xn.addBox(t,i),t.titleBlock=i}(t,i)},stop(t){const e=t.titleBlock;Xn.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){const n=t.titleBlock;Xn.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 eo=new WeakMap;var io={id:"subtitle",start(t,e,i){const n=new Qs({ctx:t.ctx,options:i,chart:t});Xn.configure(t,n,i),Xn.addBox(t,n),eo.set(t,n)},stop(t){Xn.removeBox(t,eo.get(t)),eo.delete(t)},beforeUpdate(t,e,i){const n=eo.get(t);Xn.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 no={average(t){if(!t.length)return!1;let e,i,n=0,r=0,s=0;for(e=0,i=t.length;e-1?t.split("\n"):t}function oo(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 ao(t,e){const i=t.chart.ctx,{body:n,footer:r,title:s}=t,{boxWidth:o,boxHeight:a}=e,l=Ye(e.bodyFont),h=Ye(e.titleFont),c=Ye(e.footerFont),u=s.length,f=r.length,d=n.length,p=Ue(e.padding);let g=p.height,m=0,b=n.reduce(((t,e)=>t+e.before.length+e.lines.length+e.after.length),0);if(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,lt(t.title,x),i.font=l.string,lt(t.beforeBody.concat(t.afterBody),x),_=e.displayColors?o+2+e.boxPadding:0,lt(n,(t=>{lt(t.before,x),lt(t.lines,x),lt(t.after,x)})),_=0,i.font=c.string,lt(t.footer,x),i.restore(),m+=p.width,{width:m,height:g}}function lo(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 ho(t,e,i){const n=i.yAlign||e.yAlign||function(t,e){const{y:i,height:n}=e;return it.height-n/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||lo(t,e,i,n),yAlign:n}}function co(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}=$e(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:$t(p,0,n.width-e.width),y:$t(g,0,n.height-e.height)}}function uo(t,e,i){const n=Ue(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-n.right:t.x+n.left}function fo(t){return ro([],so(t))}function po(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}const go={beforeTitle:J,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{const e={before:[],lines:[],after:[]},r=po(i,t);ro(e.before,so(mo(r,"beforeLabel",this,t))),ro(e.lines,mo(r,"label",this,t)),ro(e.after,so(mo(r,"afterLabel",this,t))),n.push(e)})),n}getAfterBody(t,e){return fo(mo(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,n=mo(i,"beforeFooter",this,t),r=mo(i,"footer",this,t),s=mo(i,"afterFooter",this,t);let o=[];return o=ro(o,so(n)),o=ro(o,so(r)),o=ro(o,so(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;ot.filter(e,n,r,i)))),t.itemSort&&(l=l.sort(((e,n)=>t.itemSort(e,n,i)))),lt(l,(e=>{const i=po(t.callbacks,e);n.push(mo(i,"labelColor",this,e)),r.push(mo(i,"labelPointStyle",this,e)),s.push(mo(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=no[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=ao(this,i),o=Object.assign({},t,e),a=ho(this.chart,i,o),l=co(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}=$e(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=Ri(i.rtl,this.x,this.width);for(t.x=uo(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",s=Ye(i.titleFont),o=i.titleSpacing,e.fillStyle=i.titleColor,e.font=s.string,a=0;a0!==t))?(t.beginPath(),t.fillStyle=r.multiKeyBackground,Fe(t,{x:e,y:p,w:l,h:a,radius:o}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),Fe(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=Ye(i.bodyFont);let u=c.lineHeight,f=0;const d=Ri(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=uo(this,g,i),e.fillStyle=i.bodyColor,lt(this.beforeBody,p),f=o&&"right"!==g?"center"===s?l/2+h:l+2+h:0,x=0,y=n.length;x0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,n=i&&i.x,r=i&&i.y;if(n||r){const i=no[t.position].call(this,this._active,this._eventPosition);if(!i)return;const s=this._size=ao(this,t),o=Object.assign({},i,this._size),a=ho(e,t,o),l=co(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=Ue(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),Ii(t,e.textDirection),r.y+=s.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),zi(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=!ht(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||!ht(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=no[r.position].call(this,t,e);return!1!==s&&(i!==s.x||n!==s.y)}}t(bo,"positioners",no);var _o={id:"tooltip",_element:bo,positioners:no,afterInit(t,e,i){i&&(t.tooltip=new bo({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:go},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"]},xo=Object.freeze({__proto__:null,Colors:Ds,Decimation:Ts,Filler:Xs,Legend:Js,SubTitle:io,Title:to,Tooltip:_o});const vo=(t,e,i,n)=>("string"==typeof e?(i=t.push(e)-1,n.unshift({index:i,label:e})):isNaN(e)&&(i=null),i);function yo(t){const e=this.getLabels();return t>=0&&tnull===t?null:$t(Math.round(t),0,e))(e,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 yo.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}}function ko(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=!tt(s),b=!tt(o),_=!tt(l),x=(g-p)/(c+1);let v,y,w,k,M=Lt((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=Lt(k*M/d/f)*f),tt(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=Et(k,Math.round(k),M/1e3)?Math.round(k):Math.ceil(k));const S=Math.max(jt(M),jt(y));v=Math.pow(10,tt(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}),yn=e?n:t,o=t=>r=i?r:t;if(t){const t=Tt(n),e=Tt(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=ko({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&&It(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 pe(t,this.chart.options.locale,this.options.ticks.format)}}class Po extends So{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=nt(t)?t:0,this.max=nt(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=zt(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}}t(Po,"id","linear"),t(Po,"defaults",{ticks:{callback:me.formatters.numeric}});const Ao=t=>Math.floor(Ct(t)),Do=(t,e)=>Math.pow(10,Ao(t)+e);function Oo(t){return 1===t/Math.pow(10,Ao(t))}function Co(t,e,i){const n=Math.pow(10,i),r=Math.floor(t/n);return Math.ceil(e/n)-r}function To(t,{min:e,max:i}){e=rt(t.min,e);const n=[],r=Ao(e);let s=function(t,e){let i=Ao(e-t);for(;Co(t,e,i)>10;)i++;for(;Co(t,e,i)<10;)i--;return Math.min(i,Ao(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=rt(t.min,Math.round((l+c+u*Math.pow(10,s))*o)/o);for(;f=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=rt(t.max,f);return n.push({value:d,major:Oo(d),significand:u}),n}class Eo extends kr{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=So.prototype.parse.apply(this,[t,e]);if(0!==i)return nt(i)&&i>0?i:null;this._zero=!0}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=nt(t)?Math.max(0,t):null,this.max=nt(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!nt(this._userMin)&&(this.min=t===Do(this.min,0)?Do(this.min,-1):Do(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(Do(i,-1)),s(Do(n,1)))),i<=0&&r(Do(n,-1)),n<=0&&s(Do(i,1)),this.min=i,this.max=n}buildTicks(){const t=this.options,e=To({min:this._userMin,max:this._userMax},this);return"ticks"===t.bounds&&It(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":pe(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Ct(t),this._valueRange=Ct(this.max)-Ct(t)}getPixelForValue(t){return void 0!==t&&0!==t||(t=this.min),null===t||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Ct(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function Lo(t){const e=t.ticks;if(e.display&&t.display){const t=Ue(e.backdropPadding);return st(e.font&&e.font.size,we.font.size)+t.height}return 0}function Ro(t,e,i,n,r){return t===n||t===r?{start:e-i/2,end:e+i/2}:tr?{start:e-i,end:e}:{start:e,end:e+i}}function Io(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?wt/s:0;for(let u=0;ue.r&&(a=(n.end-e.r)/s,t.r=Math.max(t.r,e.r+a)),r.starte.b&&(l=(r.end-e.b)/o,t.b=Math.max(t.b,e.b+l))}function Fo(t){return 0===t||180===t?"center":t<180?"left":"right"}function jo(t,e,i){return"right"===i?t-=e:"center"===i&&(t-=e/2),t}function Vo(t,e,i){return 90===i||270===i?t-=e/2:(i>270||i<90)&&(t-=e),t}function Bo(t,e,i,n){const{ctx:r}=t;if(i)r.arc(t.xCenter,t.yCenter,e,0,kt);else{let i=t.getPointPosition(0,e);r.moveTo(i.x,i.y);for(let s=1;s{const i=at(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?Io(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 Nt(t*(kt/(this._pointLabels.length||1))+zt(this.options.startAngle||0))}getDistanceFromCenterForValue(t){if(tt(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(tt(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=0;r--){const e=n.setContext(t.getPointLabelContext(r)),s=Ye(e.font),{x:o,y:a,textAlign:l,left:h,top:c,right:u,bottom:f}=t._pointLabelItems[r],{backdropColor:d}=e;if(!tt(d)){const t=$e(e.borderRadius),n=Ue(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(),Fe(i,{x:r,y:s,w:o,h:a,radius:t}),i.fill()):i.fillRect(r,s,o,a)}Re(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(),Bo(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=Ye(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=Ue(a.backdropPadding);t.fillRect(-s/2-e.left,-r-l.size/2-e.top,s+e.width,l.size+e.height)}Re(t,n.label,0,-r,l,{color:a.color})})),t.restore()}drawTitle(){}}t(Wo,"id","radialLinear"),t(Wo,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:me.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5,centerPointLabels:!1}}),t(Wo,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),t(Wo,"descriptors",{angleLines:{_fallback:"grid"}});const No={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}},Ho=Object.keys(No);function $o(t,e){return t-e}function Uo(t,e){if(tt(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)),nt(o)||(o="string"==typeof n?i.parse(o,n):i.parse(o)),null===o?null:(r&&(o="week"!==r||!Rt(s)&&!0!==s?i.startOf(o,r):i.startOf(o,"isoWeek",s)),+o)}function Yo(t,e,i,n){const r=Ho.length;for(let s=Ho.indexOf(t);s=e?i[n]:i[r]]=!0}}else t[e]=!0}function Xo(t,e,i){const n=[],r={},s=e.length;let o,a;for(o=0;o=0&&(e[l].major=!0);return e}(t,n,r,i):n}class Ko extends kr{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 Dn(t.adapters.date);n.init(e),pt(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:Uo(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=nt(n)&&!isNaN(n)?n:+e.startOf(Date.now(),i),r=nt(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(;nn&&t[r-1]>i;)r--;return n>0||r=Ho.indexOf(i);s--){const i=Ho[s];if(No[i].common&&t._adapter.diff(r,n,i)>=e-1)return i}return Ho[i?Ho.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=Ho.indexOf(t)+1,i=Ho.length;e+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=$t(n,0,s),r=$t(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||Yo(r.minUnit,e,i,this._getLabelCapacity(e)),o=st(n.ticks.stepSize,1),a="week"===s&&r.isoWeekday,l=Rt(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;ct-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 at(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;e0?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=t[a].pos&&e<=t[l].pos&&({lo:a,hi:l}=qt(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}=qt(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}t(Ko,"id","time"),t(Ko,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});class Go extends Ko{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=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