var Ix=Object.defineProperty;var Fx=(n,t,e)=>t in n?Ix(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var U=(n,t,e)=>(Fx(n,typeof t!="symbol"?t+"":t,e),e);import{c as Ei}from"./antdv-4c8751a8.js";var Bx=Object.defineProperty,zx=(n,t,e)=>t in n?Bx(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,ft=(n,t,e)=>(zx(n,typeof t!="symbol"?t+"":t,e),e);let ur=[];const Ku=n=>{for(const t of ur)if(t.status==="running")try{for(const e of t.funcs)e(n-t.startTime)}catch(e){t.destroy(),console.error(e)}requestAnimationFrame(Ku)};requestAnimationFrame(Ku);class Wx{constructor(){ft(this,"funcs",[]),ft(this,"status","stop"),ft(this,"startTime",0),this.status="running",ur.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(i=>i===t);if(e===-1)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",ur=ur.filter(t=>t!==this)}}class qu{constructor(){ft(this,"timing"),ft(this,"relation","absolute"),ft(this,"easeTime",0),ft(this,"applying",{}),ft(this,"getTime",Date.now),ft(this,"ticker",new Wx),ft(this,"value",{}),ft(this,"listener",{}),this.timing=t=>t}async all(){if(Object.values(this.applying).every(t=>t===!0))throw new ReferenceError("There is no animates to be waited.");await new Promise(t=>{const e=()=>{Object.values(this.applying).every(i=>i===!1)&&(this.unlisten("end",e),t("all animated."))};this.listen("end",e)})}async n(t){const e=Object.values(this.applying).filter(r=>r===!0).length;if(e{const a=()=>{i++,i===t&&(this.unlisten("end",a),r(`${t} animated.`))};this.listen("end",a)})}async w(t){if(this.applying[t]===!1)throw new ReferenceError(`The ${t} animate is not animating.`);await new Promise(e=>{const i=()=>{this.applying[t]===!1&&(this.unlisten("end",i),e(`${t} animated.`))};this.listen("end",i)})}listen(t,e){var i;(i=this.listener)[t]!=null||(i[t]=[]),this.listener[t].push(e)}unlisten(t,e){const i=this.listener[t].findIndex(r=>r===e);if(i===-1)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(i=>t.includes(i[0]));for(const[i,r]of e)for(const a of r)a(this,i)}}function ba(n){return n!=null}async function GM(n){return new Promise(t=>setTimeout(t,n))}class KM extends qu{constructor(){super(),ft(this,"shakeTiming"),ft(this,"path"),ft(this,"multiTiming"),ft(this,"value",{}),ft(this,"size",1),ft(this,"angle",0),ft(this,"targetValue",{system:{move:[0,0],moveAs:[0,0],resize:0,rotate:0,shake:0,"@@bind":[]},custom:{}}),ft(this,"animateFn",{system:{move:[()=>0,()=>0],moveAs:()=>0,resize:()=>0,rotate:()=>0,shake:()=>0,"@@bind":()=>0},custom:{}}),ft(this,"ox",0),ft(this,"oy",0),ft(this,"sx",0),ft(this,"sy",0),ft(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(ba(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 typeof t(0)=="number"?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 this.applying["@@bind"]===!0&&this.end(!1,"@@bind"),this.bindInfo=t,this}unbind(){return this.applying["@@bind"]===!0&&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){this.applying.shake===!0&&this.end(!0,"shake"),this.applying.shake=!0;const{easeTime:i,shakeTiming:r}=this,a=this.getTime();this.hook("start","shakestart");const l=()=>{const c=this.getTime()-a;c>i&&(this.ticker.remove(l),this.applying.shake=!1,this.sx=0,this.sy=0,this.hook("end","shakeend"));const u=c/i,f=r(u);this.sx=f*t,this.sy=f*e};return this.ticker.add(l),this.animateFn.system.shake=l,this}moveAs(t){this.applying.moveAs&&this.end(!0,"moveAs"),this.applying.moveAs=!0,this.path=t;const{easeTime:e,relation:i,timing:r}=this,a=this.getTime(),[l,c]=[this.x,this.y],[u,f]=(()=>{if(i==="absolute")return t(1);{const[p,_]=t(1);return[l+p,c+_]}})();this.hook("start","movestart");const g=()=>{const p=this.getTime()-a;if(p>e){this.end(!0,"moveAs");return}const _=p/e,[y,w]=t(r(_));i==="absolute"?(this.ox=y,this.oy=w):(this.ox=l+y,this.oy=c+w)};return this.ticker.add(g,!0),this.animateFn.system.moveAs=g,this.targetValue.system.moveAs=[u,f],this}register(t,e){if(typeof this.value[t]=="number")return this.error(`Property ${t} has been regietered twice.`,"reregister");this.value[t]=e,this.applying[t]=!1}apply(t,e,i=!1){this.applying[t]===!0&&this.end(!1,t),t in this.value||this.error(`You are trying to execute nonexistent property ${t}.`),this.applying[t]=!0;const r=this.value[t],a=this.getTime(),{timing:l,relation:c,easeTime:u}=this,f=c==="absolute"?e-r:e;this.hook("start");const g=()=>{const p=this.getTime()-a;if(p>u){this.end(!1,t);return}const _=p/u,y=l(_);this.value[t]=r+y*f};return this.ticker.add(g,i),this.animateFn.custom[t]=g,this.targetValue.custom[t]=f+r,this}applyMulti(t=!1){this.applying["@@bind"]===!0&&this.end(!1,"@@bind"),this.applying["@@bind"]=!0;const e=this.bindInfo,i=e.map(g=>this.value[g]),r=this.getTime(),{multiTiming:a,relation:l,easeTime:c}=this,u=a(1);if(u.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: ${u.length}`);this.hook("start");const f=()=>{const g=this.getTime()-r;if(g>c){this.end(!1,"@@bind");return}const p=g/c,_=a(p);e.forEach((y,w)=>{l==="absolute"?this.value[y]=_[w]:this.value[y]=i[w]+_[w]})};return this.ticker.add(f,t),this.animateFn.custom["@@bind"]=f,this.targetValue.system["@@bind"]=u,this}applySys(t,e,i){i!=="move"&&this.applying[i]===!0&&this.end(!0,i),this.applying[i]=!0;const r=this[t],a=this.getTime(),l=this.timing,c=this.relation,u=this.easeTime,f=c==="absolute"?e-r:e;this.hook("start",`${i}start`);const g=()=>{const p=this.getTime()-a;if(p>u){this.end(!0,i);return}const _=p/u,y=l(_);this[t]=r+f*y,t!=="oy"&&this.hook(i)};this.ticker.add(g,!0),t==="ox"?this.animateFn.system.move[0]=g:t==="oy"?this.animateFn.system.move[1]=g:this.animateFn.system[i]=g,i==="move"?(t==="ox"&&(this.targetValue.system.move[0]=f+r),t==="oy"&&(this.targetValue.system.move[1]=f+r)):i!=="shake"&&(this.targetValue.system[i]=f+r)}error(t,e){throw e==="repeat"?new Error(`Cannot execute the same animation twice. Info: ${t}`):e==="reregister"?new Error(`Cannot register a animated property twice. Info: ${t}`):new Error(t)}end(t,e){if(t===!0)if(this.applying[e]=!1,e==="move"?(this.ticker.remove(this.animateFn.system.move[0]),this.ticker.remove(this.animateFn.system.move[1])):e==="moveAs"?this.ticker.remove(this.animateFn.system.moveAs):e==="@@bind"?this.ticker.remove(this.animateFn.system["@@bind"]):this.ticker.remove(this.animateFn.system[e]),e==="move"){const[i,r]=this.targetValue.system.move;this.ox=i,this.oy=r,this.hook("moveend","end")}else if(e==="moveAs"){const[i,r]=this.targetValue.system.moveAs;this.ox=i,this.oy=r,this.hook("moveend","end")}else e==="rotate"?(this.angle=this.targetValue.system.rotate,this.hook("rotateend","end")):e==="resize"?(this.size=this.targetValue.system.resize,this.hook("resizeend","end")):e==="@@bind"?this.bindInfo.forEach((i,r)=>{this.value[i]=this.targetValue.system["@@bind"][r]}):(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")}}class qM extends qu{constructor(){super(),ft(this,"now",{}),ft(this,"target",{}),ft(this,"transitionFn",{}),ft(this,"value"),ft(this,"handleSet",(t,e,i)=>(this.transition(e,i),!0)),ft(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(!ba(this.now[t]))return this.now[t]=e,this;this.applying[t]&&this.end(t,!0),this.applying[t]=!0,this.hook("start");const i=this.getTime(),r=this.easeTime,a=this.timing,l=this.now[t],c=e+(this.relation==="absolute"?0:l),u=c-l;this.target[t]=c;const f=()=>{const g=this.getTime()-i;g>=r&&this.end(t);const p=g/r;this.now[t]=a(p)*u+l,this.hook("running")};return this.transitionFn[t]=f,this.ticker.add(f),this}end(t,e=!1){const i=this.transitionFn[t];if(!ba(i))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 xa=(...n)=>n.reduce((t,e)=>t+e,0),ra=n=>{if(n===0)return 1;let t=n;for(;n>1;)n--,t*=n;return t},ju=(n,t)=>Math.round(ra(t)/(ra(n)*ra(t-n))),fr=(n,t,e=i=>1-t(1-i))=>n==="in"?t:n==="out"?e:n==="in-out"?i=>i<.5?t(i*2)/2:.5+e((i-.5)*2)/2:i=>i<.5?e(i*2)/2:.5+t((i-.5)*2)/2,Nx=Math.cosh(2),Hx=Math.acosh(2),Vx=Math.tanh(3);function jM(){return n=>n}function ZM(...n){const t=[0].concat(n);t.push(1);const e=t.length,i=Array(e).fill(0).map((r,a)=>ju(a,e-1));return r=>{const a=i.map((l,c)=>l*t[c]*(1-r)**(e-c-1)*r**c);return xa(...a)}}function JM(n,t){if(!Number.isInteger(n))throw new TypeError("The first parameter of power timing function only allow integer.");return fr(t,e=>e**n)}function QM(n,t){if(n==="sin")return fr(t,e=>(Math.cosh(e*2)-1)/(Nx-1));if(n==="tan"){const e=i=>Math.tanh(i*3)*1/Vx;return fr(t,i=>1-e(1-i),e)}if(n==="sec"){const e=i=>1/Math.cosh(i);return fr(t,i=>1-(e(i*Hx)-.5)*2)}throw new TypeError("Unexpected parameters are delivered in hyper timing function.")}function tS(n,t,...e){const i=[n].concat(e);i.push(t);const r=i.length,a=Array(r).fill(0).map((l,c)=>ju(c,r-1));return l=>{const c=a.map((f,g)=>f*i[g][0]*(1-l)**(r-g-1)*l**g),u=a.map((f,g)=>f*i[g][1]*(1-l)**(r-g-1)*l**g);return[xa(...c),xa(...u)]}}var ya={},Ux={get exports(){return ya},set exports(n){ya=n}};/** * @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 */(function(n,t){(function(){var e,i="4.17.21",r=200,a="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",l="Expected a function",c="Invalid `variable` option passed into `_.template`",u="__lodash_hash_undefined__",f=500,g="__lodash_placeholder__",p=1,_=2,y=4,w=1,M=2,A=1,C=2,O=4,I=8,F=16,L=32,W=64,z=128,N=256,Y=512,J=30,Q="...",at=800,Rt=16,Vt=1,ht=2,_t=3,dt=1/0,Lt=9007199254740991,Bt=17976931348623157e292,Me=0/0,Kt=4294967295,nn=Kt-1,vn=Kt>>>1,wn=[["ary",z],["bind",A],["bindKey",C],["curry",I],["curryRight",F],["flip",Y],["partial",L],["partialRight",W],["rearg",N]],fe="[object Arguments]",Re="[object Array]",jf="[object AsyncFunction]",fi="[object Boolean]",di="[object Date]",Zf="[object DOMException]",as="[object Error]",ls="[object Function]",Za="[object GeneratorFunction]",Se="[object Map]",gi="[object Number]",Jf="[object Null]",Ne="[object Object]",Ja="[object Promise]",Qf="[object Proxy]",pi="[object RegExp]",Ae="[object Set]",mi="[object String]",cs="[object Symbol]",td="[object Undefined]",_i="[object WeakMap]",ed="[object WeakSet]",bi="[object ArrayBuffer]",Yn="[object DataView]",Br="[object Float32Array]",zr="[object Float64Array]",Wr="[object Int8Array]",Nr="[object Int16Array]",Hr="[object Int32Array]",Vr="[object Uint8Array]",Ur="[object Uint8ClampedArray]",$r="[object Uint16Array]",Yr="[object Uint32Array]",nd=/\b__p \+= '';/g,id=/\b(__p \+=) '' \+/g,sd=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Qa=/&(?:amp|lt|gt|quot|#39);/g,tl=/[&<>"']/g,rd=RegExp(Qa.source),od=RegExp(tl.source),ad=/<%-([\s\S]+?)%>/g,ld=/<%([\s\S]+?)%>/g,el=/<%=([\s\S]+?)%>/g,cd=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,hd=/^\w*$/,ud=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Xr=/[\\^$.*+?()[\]{}|]/g,fd=RegExp(Xr.source),Gr=/^\s+/,dd=/\s/,gd=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,pd=/\{\n\/\* \[wrapped with (.+)\] \*/,md=/,? & /,_d=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,bd=/[()=,{}\[\]\/\s]/,xd=/\\(\\)?/g,yd=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,nl=/\w*$/,vd=/^[-+]0x[0-9a-f]+$/i,wd=/^0b[01]+$/i,Md=/^\[object .+?Constructor\]$/,Sd=/^0o[0-7]+$/i,Ad=/^(?:0|[1-9]\d*)$/,kd=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,hs=/($^)/,Pd=/['\n\r\u2028\u2029\\]/g,us="\\ud800-\\udfff",Cd="\\u0300-\\u036f",Td="\\ufe20-\\ufe2f",Od="\\u20d0-\\u20ff",il=Cd+Td+Od,sl="\\u2700-\\u27bf",rl="a-z\\xdf-\\xf6\\xf8-\\xff",Dd="\\xac\\xb1\\xd7\\xf7",Ld="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Rd="\\u2000-\\u206f",Ed=" \\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",ol="A-Z\\xc0-\\xd6\\xd8-\\xde",al="\\ufe0e\\ufe0f",ll=Dd+Ld+Rd+Ed,Kr="['’]",Id="["+us+"]",cl="["+ll+"]",fs="["+il+"]",hl="\\d+",Fd="["+sl+"]",ul="["+rl+"]",fl="[^"+us+ll+hl+sl+rl+ol+"]",qr="\\ud83c[\\udffb-\\udfff]",Bd="(?:"+fs+"|"+qr+")",dl="[^"+us+"]",jr="(?:\\ud83c[\\udde6-\\uddff]){2}",Zr="[\\ud800-\\udbff][\\udc00-\\udfff]",Xn="["+ol+"]",gl="\\u200d",pl="(?:"+ul+"|"+fl+")",zd="(?:"+Xn+"|"+fl+")",ml="(?:"+Kr+"(?:d|ll|m|re|s|t|ve))?",_l="(?:"+Kr+"(?:D|LL|M|RE|S|T|VE))?",bl=Bd+"?",xl="["+al+"]?",Wd="(?:"+gl+"(?:"+[dl,jr,Zr].join("|")+")"+xl+bl+")*",Nd="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Hd="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",yl=xl+bl+Wd,Vd="(?:"+[Fd,jr,Zr].join("|")+")"+yl,Ud="(?:"+[dl+fs+"?",fs,jr,Zr,Id].join("|")+")",$d=RegExp(Kr,"g"),Yd=RegExp(fs,"g"),Jr=RegExp(qr+"(?="+qr+")|"+Ud+yl,"g"),Xd=RegExp([Xn+"?"+ul+"+"+ml+"(?="+[cl,Xn,"$"].join("|")+")",zd+"+"+_l+"(?="+[cl,Xn+pl,"$"].join("|")+")",Xn+"?"+pl+"+"+ml,Xn+"+"+_l,Hd,Nd,hl,Vd].join("|"),"g"),Gd=RegExp("["+gl+us+il+al+"]"),Kd=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,qd=["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"],jd=-1,yt={};yt[Br]=yt[zr]=yt[Wr]=yt[Nr]=yt[Hr]=yt[Vr]=yt[Ur]=yt[$r]=yt[Yr]=!0,yt[fe]=yt[Re]=yt[bi]=yt[fi]=yt[Yn]=yt[di]=yt[as]=yt[ls]=yt[Se]=yt[gi]=yt[Ne]=yt[pi]=yt[Ae]=yt[mi]=yt[_i]=!1;var bt={};bt[fe]=bt[Re]=bt[bi]=bt[Yn]=bt[fi]=bt[di]=bt[Br]=bt[zr]=bt[Wr]=bt[Nr]=bt[Hr]=bt[Se]=bt[gi]=bt[Ne]=bt[pi]=bt[Ae]=bt[mi]=bt[cs]=bt[Vr]=bt[Ur]=bt[$r]=bt[Yr]=!0,bt[as]=bt[ls]=bt[_i]=!1;var Zd={À:"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"},Jd={"&":"&","<":"<",">":">",'"':""","'":"'"},Qd={"&":"&","<":"<",">":">",""":'"',"'":"'"},tg={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},eg=parseFloat,ng=parseInt,vl=typeof Ei=="object"&&Ei&&Ei.Object===Object&&Ei,ig=typeof self=="object"&&self&&self.Object===Object&&self,Nt=vl||ig||Function("return this")(),Qr=t&&!t.nodeType&&t,Mn=Qr&&!0&&n&&!n.nodeType&&n,wl=Mn&&Mn.exports===Qr,to=wl&&vl.process,de=function(){try{var k=Mn&&Mn.require&&Mn.require("util").types;return k||to&&to.binding&&to.binding("util")}catch(D){}}(),Ml=de&&de.isArrayBuffer,Sl=de&&de.isDate,Al=de&&de.isMap,kl=de&&de.isRegExp,Pl=de&&de.isSet,Cl=de&&de.isTypedArray;function se(k,D,T){switch(T.length){case 0:return k.call(D);case 1:return k.call(D,T[0]);case 2:return k.call(D,T[0],T[1]);case 3:return k.call(D,T[0],T[1],T[2])}return k.apply(D,T)}function sg(k,D,T,V){for(var q=-1,ct=k==null?0:k.length;++q-1}function eo(k,D,T){for(var V=-1,q=k==null?0:k.length;++V-1;);return T}function Fl(k,D){for(var T=k.length;T--&&Gn(D,k[T],0)>-1;);return T}function dg(k,D){for(var T=k.length,V=0;T--;)k[T]===D&&++V;return V}var gg=ro(Zd),pg=ro(Jd);function mg(k){return"\\"+tg[k]}function _g(k,D){return k==null?e:k[D]}function Kn(k){return Gd.test(k)}function bg(k){return Kd.test(k)}function xg(k){for(var D,T=[];!(D=k.next()).done;)T.push(D.value);return T}function co(k){var D=-1,T=Array(k.size);return k.forEach(function(V,q){T[++D]=[q,V]}),T}function Bl(k,D){return function(T){return k(D(T))}}function on(k,D){for(var T=-1,V=k.length,q=0,ct=[];++T-1}function op(s,o){var h=this.__data__,d=Os(h,s);return d<0?(++this.size,h.push([s,o])):h[d][1]=o,this}He.prototype.clear=np,He.prototype.delete=ip,He.prototype.get=sp,He.prototype.has=rp,He.prototype.set=op;function Ve(s){var o=-1,h=s==null?0:s.length;for(this.clear();++o=o?s:o)),s}function _e(s,o,h,d,m,x){var v,S=o&p,P=o&_,R=o&y;if(h&&(v=m?h(s,d,m,x):h(s)),v!==e)return v;if(!At(s))return s;var E=j(s);if(E){if(v=hm(s),!S)return Jt(s,v)}else{var B=$t(s),H=B==ls||B==Za;if(fn(s))return xc(s,S);if(B==Ne||B==fe||H&&!m){if(v=P||H?{}:zc(s),!S)return P?Qp(s,wp(v,s)):Jp(s,ql(v,s))}else{if(!bt[B])return m?s:{};v=um(s,B,S)}}x||(x=new Pe);var $=x.get(s);if($)return $;x.set(s,v),dh(s)?s.forEach(function(K){v.add(_e(K,o,h,K,s,x))}):uh(s)&&s.forEach(function(K,it){v.set(it,_e(K,o,h,it,s,x))});var G=R?P?Fo:Io:P?te:zt,et=E?e:G(s);return ge(et||s,function(K,it){et&&(it=K,K=s[it]),Ai(v,it,_e(K,o,h,it,s,x))}),v}function Mp(s){var o=zt(s);return function(h){return jl(h,s,o)}}function jl(s,o,h){var d=h.length;if(s==null)return!d;for(s=mt(s);d--;){var m=h[d],x=o[m],v=s[m];if(v===e&&!(m in s)||!x(v))return!1}return!0}function Zl(s,o,h){if(typeof s!="function")throw new pe(l);return Li(function(){s.apply(e,h)},o)}function ki(s,o,h,d){var m=-1,x=ds,v=!0,S=s.length,P=[],R=o.length;if(!S)return P;h&&(o=Mt(o,re(h))),d?(x=eo,v=!1):o.length>=r&&(x=xi,v=!1,o=new kn(o));t:for(;++mm?0:m+h),d=d===e||d>m?m:tt(d),d<0&&(d+=m),d=h>d?0:ph(d);h0&&h(S)?o>1?Ht(S,o-1,h,d,m):rn(m,S):d||(m[m.length]=S)}return m}var _o=Ac(),tc=Ac(!0);function Ee(s,o){return s&&_o(s,o,zt)}function bo(s,o){return s&&tc(s,o,zt)}function Ls(s,o){return sn(o,function(h){return Ge(s[h])})}function Cn(s,o){o=hn(o,s);for(var h=0,d=o.length;s!=null&&ho}function kp(s,o){return s!=null&>.call(s,o)}function Pp(s,o){return s!=null&&o in mt(s)}function Cp(s,o,h){return s>=Ut(o,h)&&s=120&&E.length>=120)?new kn(v&&E):e}E=s[0];var B=-1,H=S[0];t:for(;++B-1;)S!==s&&Ms.call(S,P,1),Ms.call(s,P,1);return s}function uc(s,o){for(var h=s?o.length:0,d=h-1;h--;){var m=o[h];if(h==d||m!==x){var x=m;Xe(m)?Ms.call(s,m,1):Co(s,m)}}return s}function Ao(s,o){return s+ks(Yl()*(o-s+1))}function Hp(s,o,h,d){for(var m=-1,x=It(As((o-s)/(h||1)),0),v=T(x);x--;)v[d?x:++m]=s,s+=h;return v}function ko(s,o){var h="";if(!s||o<1||o>Lt)return h;do o%2&&(h+=s),o=ks(o/2),o&&(s+=s);while(o);return h}function nt(s,o){return Uo(Hc(s,o,ee),s+"")}function Vp(s){return Kl(ri(s))}function Up(s,o){var h=ri(s);return Us(h,Pn(o,0,h.length))}function Ti(s,o,h,d){if(!At(s))return s;o=hn(o,s);for(var m=-1,x=o.length,v=x-1,S=s;S!=null&&++mm?0:m+o),h=h>m?m:h,h<0&&(h+=m),m=o>h?0:h-o>>>0,o>>>=0;for(var x=T(m);++d>>1,v=s[x];v!==null&&!ae(v)&&(h?v<=o:v=r){var R=o?null:im(s);if(R)return ps(R);v=!1,m=xi,P=new kn}else P=o?[]:S;t:for(;++d=d?s:be(s,o,h)}var bc=Eg||function(s){return Nt.clearTimeout(s)};function xc(s,o){if(o)return s.slice();var h=s.length,d=Nl?Nl(h):new s.constructor(h);return s.copy(d),d}function Lo(s){var o=new s.constructor(s.byteLength);return new vs(o).set(new vs(s)),o}function Kp(s,o){var h=o?Lo(s.buffer):s.buffer;return new s.constructor(h,s.byteOffset,s.byteLength)}function qp(s){var o=new s.constructor(s.source,nl.exec(s));return o.lastIndex=s.lastIndex,o}function jp(s){return Si?mt(Si.call(s)):{}}function yc(s,o){var h=o?Lo(s.buffer):s.buffer;return new s.constructor(h,s.byteOffset,s.length)}function vc(s,o){if(s!==o){var h=s!==e,d=s===null,m=s===s,x=ae(s),v=o!==e,S=o===null,P=o===o,R=ae(o);if(!S&&!R&&!x&&s>o||x&&v&&P&&!S&&!R||d&&v&&P||!h&&P||!m)return 1;if(!d&&!x&&!R&&s=S)return P;var R=h[d];return P*(R=="desc"?-1:1)}}return s.index-o.index}function wc(s,o,h,d){for(var m=-1,x=s.length,v=h.length,S=-1,P=o.length,R=It(x-v,0),E=T(P+R),B=!d;++S1?h[m-1]:e,v=m>2?h[2]:e;for(x=s.length>3&&typeof x=="function"?(m--,x):e,v&&jt(h[0],h[1],v)&&(x=m<3?e:x,m=1),o=mt(o);++d-1?m[x?o[v]:v]:e}}function Cc(s){return Ye(function(o){var h=o.length,d=h,m=me.prototype.thru;for(s&&o.reverse();d--;){var x=o[d];if(typeof x!="function")throw new pe(l);if(m&&!v&&Hs(x)=="wrapper")var v=new me([],!0)}for(d=v?d:h;++d1&&ot.reverse(),E&&PS))return!1;var R=x.get(s),E=x.get(o);if(R&&E)return R==o&&E==s;var B=-1,H=!0,$=h&M?new kn:e;for(x.set(s,o),x.set(o,s);++B1?"& ":"")+o[d],o=o.join(h>2?", ":" "),s.replace(gd,`{ /* [wrapped with `+o+`] */ `)}function dm(s){return j(s)||Dn(s)||!!(Ul&&s&&s[Ul])}function Xe(s,o){var h=typeof s;return o=o==null?Lt:o,!!o&&(h=="number"||h!="symbol"&&Ad.test(s))&&s>-1&&s%1==0&&s0){if(++o>=at)return arguments[0]}else o=0;return s.apply(e,arguments)}}function Us(s,o){var h=-1,d=s.length,m=d-1;for(o=o===e?d:o;++h1?s[o-1]:e;return h=typeof h=="function"?(s.pop(),h):e,Qc(s,h)});function th(s){var o=b(s);return o.__chain__=!0,o}function S_(s,o){return o(s),s}function $s(s,o){return o(s)}var A_=Ye(function(s){var o=s.length,h=o?s[0]:0,d=this.__wrapped__,m=function(x){return mo(x,s)};return o>1||this.__actions__.length||!(d instanceof st)||!Xe(h)?this.thru(m):(d=d.slice(h,+h+(o?1:0)),d.__actions__.push({func:$s,args:[m],thisArg:e}),new me(d,this.__chain__).thru(function(x){return o&&!x.length&&x.push(e),x}))});function k_(){return th(this)}function P_(){return new me(this.value(),this.__chain__)}function C_(){this.__values__===e&&(this.__values__=gh(this.value()));var s=this.__index__>=this.__values__.length,o=s?e:this.__values__[this.__index__++];return{done:s,value:o}}function T_(){return this}function O_(s){for(var o,h=this;h instanceof Ts;){var d=Gc(h);d.__index__=0,d.__values__=e,o?m.__wrapped__=d:o=d;var m=d;h=h.__wrapped__}return m.__wrapped__=s,o}function D_(){var s=this.__wrapped__;if(s instanceof st){var o=s;return this.__actions__.length&&(o=new st(this)),o=o.reverse(),o.__actions__.push({func:$s,args:[$o],thisArg:e}),new me(o,this.__chain__)}return this.thru($o)}function L_(){return mc(this.__wrapped__,this.__actions__)}var R_=Fs(function(s,o,h){gt.call(s,h)?++s[h]:Ue(s,h,1)});function E_(s,o,h){var d=j(s)?Tl:Sp;return h&&jt(s,o,h)&&(o=e),d(s,X(o,3))}function I_(s,o){var h=j(s)?sn:Ql;return h(s,X(o,3))}var F_=Pc(Kc),B_=Pc(qc);function z_(s,o){return Ht(Ys(s,o),1)}function W_(s,o){return Ht(Ys(s,o),dt)}function N_(s,o,h){return h=h===e?1:tt(h),Ht(Ys(s,o),h)}function eh(s,o){var h=j(s)?ge:ln;return h(s,X(o,3))}function nh(s,o){var h=j(s)?rg:Jl;return h(s,X(o,3))}var H_=Fs(function(s,o,h){gt.call(s,h)?s[h].push(o):Ue(s,h,[o])});function V_(s,o,h,d){s=Qt(s)?s:ri(s),h=h&&!d?tt(h):0;var m=s.length;return h<0&&(h=It(m+h,0)),js(s)?h<=m&&s.indexOf(o,h)>-1:!!m&&Gn(s,o,h)>-1}var U_=nt(function(s,o,h){var d=-1,m=typeof o=="function",x=Qt(s)?T(s.length):[];return ln(s,function(v){x[++d]=m?se(o,v,h):Pi(v,o,h)}),x}),$_=Fs(function(s,o,h){Ue(s,h,o)});function Ys(s,o){var h=j(s)?Mt:rc;return h(s,X(o,3))}function Y_(s,o,h,d){return s==null?[]:(j(o)||(o=o==null?[]:[o]),h=d?e:h,j(h)||(h=h==null?[]:[h]),cc(s,o,h))}var X_=Fs(function(s,o,h){s[h?0:1].push(o)},function(){return[[],[]]});function G_(s,o,h){var d=j(s)?no:Rl,m=arguments.length<3;return d(s,X(o,4),h,m,ln)}function K_(s,o,h){var d=j(s)?og:Rl,m=arguments.length<3;return d(s,X(o,4),h,m,Jl)}function q_(s,o){var h=j(s)?sn:Ql;return h(s,Ks(X(o,3)))}function j_(s){var o=j(s)?Kl:Vp;return o(s)}function Z_(s,o,h){(h?jt(s,o,h):o===e)?o=1:o=tt(o);var d=j(s)?xp:Up;return d(s,o)}function J_(s){var o=j(s)?yp:Yp;return o(s)}function Q_(s){if(s==null)return 0;if(Qt(s))return js(s)?qn(s):s.length;var o=$t(s);return o==Se||o==Ae?s.size:wo(s).length}function t0(s,o,h){var d=j(s)?io:Xp;return h&&jt(s,o,h)&&(o=e),d(s,X(o,3))}var e0=nt(function(s,o){if(s==null)return[];var h=o.length;return h>1&&jt(s,o[0],o[1])?o=[]:h>2&&jt(o[0],o[1],o[2])&&(o=[o[0]]),cc(s,Ht(o,1),[])}),Xs=Ig||function(){return Nt.Date.now()};function n0(s,o){if(typeof o!="function")throw new pe(l);return s=tt(s),function(){if(--s<1)return o.apply(this,arguments)}}function ih(s,o,h){return o=h?e:o,o=s&&o==null?s.length:o,$e(s,z,e,e,e,e,o)}function sh(s,o){var h;if(typeof o!="function")throw new pe(l);return s=tt(s),function(){return--s>0&&(h=o.apply(this,arguments)),s<=1&&(o=e),h}}var Xo=nt(function(s,o,h){var d=A;if(h.length){var m=on(h,ii(Xo));d|=L}return $e(s,d,o,h,m)}),rh=nt(function(s,o,h){var d=A|C;if(h.length){var m=on(h,ii(rh));d|=L}return $e(o,d,s,h,m)});function oh(s,o,h){o=h?e:o;var d=$e(s,I,e,e,e,e,e,o);return d.placeholder=oh.placeholder,d}function ah(s,o,h){o=h?e:o;var d=$e(s,F,e,e,e,e,e,o);return d.placeholder=ah.placeholder,d}function lh(s,o,h){var d,m,x,v,S,P,R=0,E=!1,B=!1,H=!0;if(typeof s!="function")throw new pe(l);o=ye(o)||0,At(h)&&(E=!!h.leading,B="maxWait"in h,x=B?It(ye(h.maxWait)||0,o):x,H="trailing"in h?!!h.trailing:H);function $(Ot){var Te=d,qe=m;return d=m=e,R=Ot,v=s.apply(qe,Te),v}function G(Ot){return R=Ot,S=Li(it,o),E?$(Ot):v}function et(Ot){var Te=Ot-P,qe=Ot-R,Ph=o-Te;return B?Ut(Ph,x-qe):Ph}function K(Ot){var Te=Ot-P,qe=Ot-R;return P===e||Te>=o||Te<0||B&&qe>=x}function it(){var Ot=Xs();if(K(Ot))return ot(Ot);S=Li(it,et(Ot))}function ot(Ot){return S=e,H&&d?$(Ot):(d=m=e,v)}function le(){S!==e&&bc(S),R=0,d=P=m=S=e}function Zt(){return S===e?v:ot(Xs())}function ce(){var Ot=Xs(),Te=K(Ot);if(d=arguments,m=this,P=Ot,Te){if(S===e)return G(P);if(B)return bc(S),S=Li(it,o),$(P)}return S===e&&(S=Li(it,o)),v}return ce.cancel=le,ce.flush=Zt,ce}var i0=nt(function(s,o){return Zl(s,1,o)}),s0=nt(function(s,o,h){return Zl(s,ye(o)||0,h)});function r0(s){return $e(s,Y)}function Gs(s,o){if(typeof s!="function"||o!=null&&typeof o!="function")throw new pe(l);var h=function(){var d=arguments,m=o?o.apply(this,d):d[0],x=h.cache;if(x.has(m))return x.get(m);var v=s.apply(this,d);return h.cache=x.set(m,v)||x,v};return h.cache=new(Gs.Cache||Ve),h}Gs.Cache=Ve;function Ks(s){if(typeof s!="function")throw new pe(l);return function(){var o=arguments;switch(o.length){case 0:return!s.call(this);case 1:return!s.call(this,o[0]);case 2:return!s.call(this,o[0],o[1]);case 3:return!s.call(this,o[0],o[1],o[2])}return!s.apply(this,o)}}function o0(s){return sh(2,s)}var a0=Gp(function(s,o){o=o.length==1&&j(o[0])?Mt(o[0],re(X())):Mt(Ht(o,1),re(X()));var h=o.length;return nt(function(d){for(var m=-1,x=Ut(d.length,h);++m=o}),Dn=nc(function(){return arguments}())?nc:function(s){return kt(s)&>.call(s,"callee")&&!Vl.call(s,"callee")},j=T.isArray,w0=Ml?re(Ml):Op;function Qt(s){return s!=null&&qs(s.length)&&!Ge(s)}function Tt(s){return kt(s)&&Qt(s)}function M0(s){return s===!0||s===!1||kt(s)&&qt(s)==fi}var fn=Bg||sa,S0=Sl?re(Sl):Dp;function A0(s){return kt(s)&&s.nodeType===1&&!Ri(s)}function k0(s){if(s==null)return!0;if(Qt(s)&&(j(s)||typeof s=="string"||typeof s.splice=="function"||fn(s)||si(s)||Dn(s)))return!s.length;var o=$t(s);if(o==Se||o==Ae)return!s.size;if(Di(s))return!wo(s).length;for(var h in s)if(gt.call(s,h))return!1;return!0}function P0(s,o){return Ci(s,o)}function C0(s,o,h){h=typeof h=="function"?h:e;var d=h?h(s,o):e;return d===e?Ci(s,o,e,h):!!d}function Ko(s){if(!kt(s))return!1;var o=qt(s);return o==as||o==Zf||typeof s.message=="string"&&typeof s.name=="string"&&!Ri(s)}function T0(s){return typeof s=="number"&&$l(s)}function Ge(s){if(!At(s))return!1;var o=qt(s);return o==ls||o==Za||o==jf||o==Qf}function hh(s){return typeof s=="number"&&s==tt(s)}function qs(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=Lt}function At(s){var o=typeof s;return s!=null&&(o=="object"||o=="function")}function kt(s){return s!=null&&typeof s=="object"}var uh=Al?re(Al):Rp;function O0(s,o){return s===o||vo(s,o,zo(o))}function D0(s,o,h){return h=typeof h=="function"?h:e,vo(s,o,zo(o),h)}function L0(s){return fh(s)&&s!=+s}function R0(s){if(mm(s))throw new q(a);return ic(s)}function E0(s){return s===null}function I0(s){return s==null}function fh(s){return typeof s=="number"||kt(s)&&qt(s)==gi}function Ri(s){if(!kt(s)||qt(s)!=Ne)return!1;var o=ws(s);if(o===null)return!0;var h=gt.call(o,"constructor")&&o.constructor;return typeof h=="function"&&h instanceof h&&bs.call(h)==Dg}var qo=kl?re(kl):Ep;function F0(s){return hh(s)&&s>=-Lt&&s<=Lt}var dh=Pl?re(Pl):Ip;function js(s){return typeof s=="string"||!j(s)&&kt(s)&&qt(s)==mi}function ae(s){return typeof s=="symbol"||kt(s)&&qt(s)==cs}var si=Cl?re(Cl):Fp;function B0(s){return s===e}function z0(s){return kt(s)&&$t(s)==_i}function W0(s){return kt(s)&&qt(s)==ed}var N0=Ns(Mo),H0=Ns(function(s,o){return s<=o});function gh(s){if(!s)return[];if(Qt(s))return js(s)?ke(s):Jt(s);if(yi&&s[yi])return xg(s[yi]());var o=$t(s),h=o==Se?co:o==Ae?ps:ri;return h(s)}function Ke(s){if(!s)return s===0?s:0;if(s=ye(s),s===dt||s===-dt){var o=s<0?-1:1;return o*Bt}return s===s?s:0}function tt(s){var o=Ke(s),h=o%1;return o===o?h?o-h:o:0}function ph(s){return s?Pn(tt(s),0,Kt):0}function ye(s){if(typeof s=="number")return s;if(ae(s))return Me;if(At(s)){var o=typeof s.valueOf=="function"?s.valueOf():s;s=At(o)?o+"":o}if(typeof s!="string")return s===0?s:+s;s=El(s);var h=wd.test(s);return h||Sd.test(s)?ng(s.slice(2),h?2:8):vd.test(s)?Me:+s}function mh(s){return Ie(s,te(s))}function V0(s){return s?Pn(tt(s),-Lt,Lt):s===0?s:0}function ut(s){return s==null?"":oe(s)}var U0=ei(function(s,o){if(Di(o)||Qt(o)){Ie(o,zt(o),s);return}for(var h in o)gt.call(o,h)&&Ai(s,h,o[h])}),_h=ei(function(s,o){Ie(o,te(o),s)}),Zs=ei(function(s,o,h,d){Ie(o,te(o),s,d)}),$0=ei(function(s,o,h,d){Ie(o,zt(o),s,d)}),Y0=Ye(mo);function X0(s,o){var h=ti(s);return o==null?h:ql(h,o)}var G0=nt(function(s,o){s=mt(s);var h=-1,d=o.length,m=d>2?o[2]:e;for(m&&jt(o[0],o[1],m)&&(d=1);++h1),x}),Ie(s,Fo(s),h),d&&(h=_e(h,p|_|y,sm));for(var m=o.length;m--;)Co(h,o[m]);return h});function ub(s,o){return xh(s,Ks(X(o)))}var fb=Ye(function(s,o){return s==null?{}:Wp(s,o)});function xh(s,o){if(s==null)return{};var h=Mt(Fo(s),function(d){return[d]});return o=X(o),hc(s,h,function(d,m){return o(d,m[0])})}function db(s,o,h){o=hn(o,s);var d=-1,m=o.length;for(m||(m=1,s=e);++do){var d=s;s=o,o=d}if(h||s%1||o%1){var m=Yl();return Ut(s+m*(o-s+eg("1e-"+((m+"").length-1))),o)}return Ao(s,o)}var Sb=ni(function(s,o,h){return o=o.toLowerCase(),s+(h?wh(o):o)});function wh(s){return Jo(ut(s).toLowerCase())}function Mh(s){return s=ut(s),s&&s.replace(kd,gg).replace(Yd,"")}function Ab(s,o,h){s=ut(s),o=oe(o);var d=s.length;h=h===e?d:Pn(tt(h),0,d);var m=h;return h-=o.length,h>=0&&s.slice(h,m)==o}function kb(s){return s=ut(s),s&&od.test(s)?s.replace(tl,pg):s}function Pb(s){return s=ut(s),s&&fd.test(s)?s.replace(Xr,"\\$&"):s}var Cb=ni(function(s,o,h){return s+(h?"-":"")+o.toLowerCase()}),Tb=ni(function(s,o,h){return s+(h?" ":"")+o.toLowerCase()}),Ob=kc("toLowerCase");function Db(s,o,h){s=ut(s),o=tt(o);var d=o?qn(s):0;if(!o||d>=o)return s;var m=(o-d)/2;return Ws(ks(m),h)+s+Ws(As(m),h)}function Lb(s,o,h){s=ut(s),o=tt(o);var d=o?qn(s):0;return o&&d>>0,h?(s=ut(s),s&&(typeof o=="string"||o!=null&&!qo(o))&&(o=oe(o),!o&&Kn(s))?un(ke(s),0,h):s.split(o,h)):[]}var Wb=ni(function(s,o,h){return s+(h?" ":"")+Jo(o)});function Nb(s,o,h){return s=ut(s),h=h==null?0:Pn(tt(h),0,s.length),o=oe(o),s.slice(h,h+o.length)==o}function Hb(s,o,h){var d=b.templateSettings;h&&jt(s,o,h)&&(o=e),s=ut(s),o=Zs({},o,d,Rc);var m=Zs({},o.imports,d.imports,Rc),x=zt(m),v=lo(m,x),S,P,R=0,E=o.interpolate||hs,B="__p += '",H=ho((o.escape||hs).source+"|"+E.source+"|"+(E===el?yd:hs).source+"|"+(o.evaluate||hs).source+"|$","g"),$="//# sourceURL="+(gt.call(o,"sourceURL")?(o.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++jd+"]")+` `;s.replace(H,function(K,it,ot,le,Zt,ce){return ot||(ot=le),B+=s.slice(R,ce).replace(Pd,mg),it&&(S=!0,B+=`' + __e(`+it+`) + '`),Zt&&(P=!0,B+=`'; `+Zt+`; __p += '`),ot&&(B+=`' + ((__t = (`+ot+`)) == null ? '' : __t) + '`),R=ce+K.length,K}),B+=`'; `;var G=gt.call(o,"variable")&&o.variable;if(!G)B=`with (obj) { `+B+` } `;else if(bd.test(G))throw new q(c);B=(P?B.replace(nd,""):B).replace(id,"$1").replace(sd,"$1;"),B="function("+(G||"obj")+`) { `+(G?"":`obj || (obj = {}); `)+"var __t, __p = ''"+(S?", __e = _.escape":"")+(P?`, __j = Array.prototype.join; function print() { __p += __j.call(arguments, '') } `:`; `)+B+`return __p }`;var et=Ah(function(){return ct(x,$+"return "+B).apply(e,v)});if(et.source=B,Ko(et))throw et;return et}function Vb(s){return ut(s).toLowerCase()}function Ub(s){return ut(s).toUpperCase()}function $b(s,o,h){if(s=ut(s),s&&(h||o===e))return El(s);if(!s||!(o=oe(o)))return s;var d=ke(s),m=ke(o),x=Il(d,m),v=Fl(d,m)+1;return un(d,x,v).join("")}function Yb(s,o,h){if(s=ut(s),s&&(h||o===e))return s.slice(0,zl(s)+1);if(!s||!(o=oe(o)))return s;var d=ke(s),m=Fl(d,ke(o))+1;return un(d,0,m).join("")}function Xb(s,o,h){if(s=ut(s),s&&(h||o===e))return s.replace(Gr,"");if(!s||!(o=oe(o)))return s;var d=ke(s),m=Il(d,ke(o));return un(d,m).join("")}function Gb(s,o){var h=J,d=Q;if(At(o)){var m="separator"in o?o.separator:m;h="length"in o?tt(o.length):h,d="omission"in o?oe(o.omission):d}s=ut(s);var x=s.length;if(Kn(s)){var v=ke(s);x=v.length}if(h>=x)return s;var S=h-qn(d);if(S<1)return d;var P=v?un(v,0,S).join(""):s.slice(0,S);if(m===e)return P+d;if(v&&(S+=P.length-S),qo(m)){if(s.slice(S).search(m)){var R,E=P;for(m.global||(m=ho(m.source,ut(nl.exec(m))+"g")),m.lastIndex=0;R=m.exec(E);)var B=R.index;P=P.slice(0,B===e?S:B)}}else if(s.indexOf(oe(m),S)!=S){var H=P.lastIndexOf(m);H>-1&&(P=P.slice(0,H))}return P+d}function Kb(s){return s=ut(s),s&&rd.test(s)?s.replace(Qa,Mg):s}var qb=ni(function(s,o,h){return s+(h?" ":"")+o.toUpperCase()}),Jo=kc("toUpperCase");function Sh(s,o,h){return s=ut(s),o=h?e:o,o===e?bg(s)?kg(s):cg(s):s.match(o)||[]}var Ah=nt(function(s,o){try{return se(s,e,o)}catch(h){return Ko(h)?h:new q(h)}}),jb=Ye(function(s,o){return ge(o,function(h){h=Fe(h),Ue(s,h,Xo(s[h],s))}),s});function Zb(s){var o=s==null?0:s.length,h=X();return s=o?Mt(s,function(d){if(typeof d[1]!="function")throw new pe(l);return[h(d[0]),d[1]]}):[],nt(function(d){for(var m=-1;++mLt)return[];var h=Kt,d=Ut(s,Kt);o=X(o),s-=Kt;for(var m=ao(d,o);++h0||o<0)?new st(h):(s<0?h=h.takeRight(-s):s&&(h=h.drop(s)),o!==e&&(o=tt(o),h=o<0?h.dropRight(-o):h.take(o-s)),h)},st.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},st.prototype.toArray=function(){return this.take(Kt)},Ee(st.prototype,function(s,o){var h=/^(?:filter|find|map|reject)|While$/.test(o),d=/^(?:head|last)$/.test(o),m=b[d?"take"+(o=="last"?"Right":""):o],x=d||/^find/.test(o);m&&(b.prototype[o]=function(){var v=this.__wrapped__,S=d?[1]:arguments,P=v instanceof st,R=S[0],E=P||j(v),B=function(it){var ot=m.apply(b,rn([it],S));return d&&H?ot[0]:ot};E&&h&&typeof R=="function"&&R.length!=1&&(P=E=!1);var H=this.__chain__,$=!!this.__actions__.length,G=x&&!H,et=P&&!$;if(!x&&E){v=et?v:new st(this);var K=s.apply(v,S);return K.__actions__.push({func:$s,args:[B],thisArg:e}),new me(K,H)}return G&&et?s.apply(this,S):(K=this.thru(B),G?d?K.value()[0]:K.value():K)})}),ge(["pop","push","shift","sort","splice","unshift"],function(s){var o=ms[s],h=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",d=/^(?:pop|shift)$/.test(s);b.prototype[s]=function(){var m=arguments;if(d&&!this.__chain__){var x=this.value();return o.apply(j(x)?x:[],m)}return this[h](function(v){return o.apply(j(v)?v:[],m)})}}),Ee(st.prototype,function(s,o){var h=b[o];if(h){var d=h.name+"";gt.call(Qn,d)||(Qn[d]=[]),Qn[d].push({name:o,func:h})}}),Qn[Bs(e,C).name]=[{name:"wrapper",func:e}],st.prototype.clone=Kg,st.prototype.reverse=qg,st.prototype.value=jg,b.prototype.at=A_,b.prototype.chain=k_,b.prototype.commit=P_,b.prototype.next=C_,b.prototype.plant=O_,b.prototype.reverse=D_,b.prototype.toJSON=b.prototype.valueOf=b.prototype.value=L_,b.prototype.first=b.prototype.head,yi&&(b.prototype[yi]=T_),b},jn=Pg();Mn?((Mn.exports=jn)._=jn,Qr._=jn):Nt._=jn}).call(Ei)})(Ux,ya);/*! * @kurkle/color v0.3.2 * https://github.com/kurkle/color#readme * (c) 2023 Jukka Kurkela * Released under the MIT License */function ss(n){return n+.5|0}const dn=(n,t,e)=>Math.max(Math.min(n,e),t);function Ni(n){return dn(ss(n*2.55),0,255)}function _n(n){return dn(ss(n*255),0,255)}function Qe(n){return dn(ss(n/2.55)/100,0,1)}function Ch(n){return dn(ss(n*100),0,100)}const ve={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},va=[..."0123456789ABCDEF"],$x=n=>va[n&15],Yx=n=>va[(n&240)>>4]+va[n&15],Js=n=>(n&240)>>4===(n&15),Xx=n=>Js(n.r)&&Js(n.g)&&Js(n.b)&&Js(n.a);function Gx(n){var t=n.length,e;return n[0]==="#"&&(t===4||t===5?e={r:255&ve[n[1]]*17,g:255&ve[n[2]]*17,b:255&ve[n[3]]*17,a:t===5?ve[n[4]]*17:255}:(t===7||t===9)&&(e={r:ve[n[1]]<<4|ve[n[2]],g:ve[n[3]]<<4|ve[n[4]],b:ve[n[5]]<<4|ve[n[6]],a:t===9?ve[n[7]]<<4|ve[n[8]]:255})),e}const Kx=(n,t)=>n<255?t(n):"";function qx(n){var t=Xx(n)?$x:Yx;return n?"#"+t(n.r)+t(n.g)+t(n.b)+Kx(n.a,t):void 0}const jx=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Zu(n,t,e){const i=t*Math.min(e,1-e),r=(a,l=(a+n/30)%12)=>e-i*Math.max(Math.min(l-3,9-l,1),-1);return[r(0),r(8),r(4)]}function Zx(n,t,e){const i=(r,a=(r+n/60)%6)=>e-e*t*Math.max(Math.min(a,4-a,1),0);return[i(5),i(3),i(1)]}function Jx(n,t,e){const i=Zu(n,1,.5);let r;for(t+e>1&&(r=1/(t+e),t*=r,e*=r),r=0;r<3;r++)i[r]*=1-t-e,i[r]+=t;return i}function Qx(n,t,e,i,r){return n===r?(t-e)/i+(t.5?g/(2-a-l):g/(a+l),u=Qx(e,i,r,g,a),u=u*60+.5),[u|0,f||0,c]}function Ba(n,t,e,i){return(Array.isArray(t)?n(t[0],t[1],t[2]):n(t,e,i)).map(_n)}function za(n,t,e){return Ba(Zu,n,t,e)}function ty(n,t,e){return Ba(Jx,n,t,e)}function ey(n,t,e){return Ba(Zx,n,t,e)}function Ju(n){return(n%360+360)%360}function ny(n){const t=jx.exec(n);let e=255,i;if(!t)return;t[5]!==i&&(e=t[6]?Ni(+t[5]):_n(+t[5]));const r=Ju(+t[2]),a=+t[3]/100,l=+t[4]/100;return t[1]==="hwb"?i=ty(r,a,l):t[1]==="hsv"?i=ey(r,a,l):i=za(r,a,l),{r:i[0],g:i[1],b:i[2],a:e}}function iy(n,t){var e=Fa(n);e[0]=Ju(e[0]+t),e=za(e),n.r=e[0],n.g=e[1],n.b=e[2]}function sy(n){if(!n)return;const t=Fa(n),e=t[0],i=Ch(t[1]),r=Ch(t[2]);return n.a<255?`hsla(${e}, ${i}%, ${r}%, ${Qe(n.a)})`:`hsl(${e}, ${i}%, ${r}%)`}const Th={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Oh={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function ry(){const n={},t=Object.keys(Oh),e=Object.keys(Th);let i,r,a,l,c;for(i=0;i>16&255,a>>8&255,a&255]}return n}let Qs;function oy(n){Qs||(Qs=ry(),Qs.transparent=[0,0,0,0]);const t=Qs[n.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const ay=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function ly(n){const t=ay.exec(n);let e=255,i,r,a;if(t){if(t[7]!==i){const l=+t[7];e=t[8]?Ni(l):dn(l*255,0,255)}return i=+t[1],r=+t[3],a=+t[5],i=255&(t[2]?Ni(i):dn(i,0,255)),r=255&(t[4]?Ni(r):dn(r,0,255)),a=255&(t[6]?Ni(a):dn(a,0,255)),{r:i,g:r,b:a,a:e}}}function cy(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${Qe(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const oa=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,oi=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function hy(n,t,e){const i=oi(Qe(n.r)),r=oi(Qe(n.g)),a=oi(Qe(n.b));return{r:_n(oa(i+e*(oi(Qe(t.r))-i))),g:_n(oa(r+e*(oi(Qe(t.g))-r))),b:_n(oa(a+e*(oi(Qe(t.b))-a))),a:n.a+e*(t.a-n.a)}}function tr(n,t,e){if(n){let i=Fa(n);i[t]=Math.max(0,Math.min(i[t]+i[t]*e,t===0?360:1)),i=za(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function Qu(n,t){return n&&Object.assign(t||{},n)}function Dh(n){var t={r:0,g:0,b:0,a:255};return Array.isArray(n)?n.length>=3&&(t={r:n[0],g:n[1],b:n[2],a:255},n.length>3&&(t.a=_n(n[3]))):(t=Qu(n,{r:0,g:0,b:0,a:1}),t.a=_n(t.a)),t}function uy(n){return n.charAt(0)==="r"?ly(n):ny(n)}class ji{constructor(t){if(t instanceof ji)return t;const e=typeof t;let i;e==="object"?i=Dh(t):e==="string"&&(i=Gx(t)||oy(t)||uy(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Qu(this._rgb);return t&&(t.a=Qe(t.a)),t}set rgb(t){this._rgb=Dh(t)}rgbString(){return this._valid?cy(this._rgb):void 0}hexString(){return this._valid?qx(this._rgb):void 0}hslString(){return this._valid?sy(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,r=t.rgb;let a;const l=e===a?.5:e,c=2*l-1,u=i.a-r.a,f=((c*u===-1?c:(c+u)/(1+c*u))+1)/2;a=1-f,i.r=255&f*i.r+a*r.r+.5,i.g=255&f*i.g+a*r.g+.5,i.b=255&f*i.b+a*r.b+.5,i.a=l*i.a+(1-l)*r.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=hy(this._rgb,t._rgb,e)),this}clone(){return new ji(this.rgb)}alpha(t){return this._rgb.a=_n(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=ss(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.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 tr(this._rgb,2,t),this}darken(t){return tr(this._rgb,2,-t),this}saturate(t){return tr(this._rgb,1,t),this}desaturate(t){return tr(this._rgb,1,-t),this}rotate(t){return iy(this._rgb,t),this}}/*! * Chart.js v4.2.1 * https://www.chartjs.org * (c) 2023 Chart.js Contributors * Released under the MIT License */function je(){}const fy=(()=>{let n=0;return()=>n++})();function lt(n){return n===null||typeof n>"u"}function vt(n){if(Array.isArray&&Array.isArray(n))return!0;const t=Object.prototype.toString.call(n);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function rt(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function Pt(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function he(n,t){return Pt(n)?n:t}function Z(n,t){return typeof n>"u"?t:n}const dy=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/t,tf=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*t:+n;function xt(n,t,e){if(n&&typeof n.call=="function")return n.apply(e,t)}function pt(n,t,e,i){let r,a,l;if(vt(n))if(a=n.length,i)for(r=a-1;r>=0;r--)t.call(e,n[r],r);else for(r=0;rn,x:n=>n.x,y:n=>n.y};function my(n){const t=n.split("."),e=[];let i="";for(const r of t)i+=r,i.endsWith("\\")?i=i.slice(0,-1)+".":(e.push(i),i="");return e}function _y(n){const t=my(n);return e=>{for(const i of t){if(i==="")break;e=e&&e[i]}return e}}function bn(n,t){return(Lh[t]||(Lh[t]=_y(t)))(n)}function Wa(n){return n.charAt(0).toUpperCase()+n.slice(1)}const we=n=>typeof n<"u",xn=n=>typeof n=="function",Rh=(n,t)=>{if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0};function by(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const St=Math.PI,wt=2*St,xy=wt+St,Ar=Number.POSITIVE_INFINITY,yy=St/180,Ct=St/2,Ln=St/4,Eh=St*2/3,gn=Math.log10,We=Math.sign;function Xi(n,t,e){return Math.abs(n-t)r-a).pop(),t}function ci(n){return!isNaN(parseFloat(n))&&isFinite(n)}function wy(n,t){const e=Math.round(n);return e-t<=n&&e+t>=n}function nf(n,t,e){let i,r,a;for(i=0,r=n.length;iu&&f=Math.min(t,e)-i&&n<=Math.max(t,e)+i}function Ha(n,t,e){e=e||(l=>n[l]1;)a=r+i>>1,e(a)?r=a:i=a;return{lo:r,hi:i}}const en=(n,t,e,i)=>Ha(n,e,i?r=>{const a=n[r][t];return an[r][t]Ha(n,e,i=>n[i][t]>=e);function ky(n,t,e){let i=0,r=n.length;for(;ii&&n[r-1]>e;)r--;return i>0||r{const i="_onData"+Wa(e),r=n[e];Object.defineProperty(n,e,{configurable:!0,enumerable:!1,value(...a){const l=r.apply(this,a);return n._chartjs.listeners.forEach(c=>{typeof c[i]=="function"&&c[i](...a)}),l}})})}function Bh(n,t){const e=n._chartjs;if(!e)return;const i=e.listeners,r=i.indexOf(t);r!==-1&&i.splice(r,1),!(i.length>0)&&(rf.forEach(a=>{delete n[a]}),delete n._chartjs)}function of(n){const t=new Set;let e,i;for(e=0,i=n.length;e"u"?function(n){return n()}:window.requestAnimationFrame}();function lf(n,t){let e=[],i=!1;return function(...r){e=r,i||(i=!0,af.call(window,()=>{i=!1,n.apply(t,e)}))}}function Cy(n,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(n,t,i)):n.apply(this,i),t}}const Va=n=>n==="start"?"left":n==="end"?"right":"center",Yt=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2,Ty=(n,t,e,i)=>n===(i?"left":"right")?e:n==="center"?(t+e)/2:t;function cf(n,t,e){const i=t.length;let r=0,a=i;if(n._sorted){const{iScale:l,_parsed:c}=n,u=l.axis,{min:f,max:g,minDefined:p,maxDefined:_}=l.getUserBounds();p&&(r=Wt(Math.min(en(c,l.axis,f).lo,e?i:en(t,u,l.getPixelForValue(f)).lo),0,i-1)),_?a=Wt(Math.max(en(c,l.axis,g,!0).hi+1,e?0:en(t,u,l.getPixelForValue(g),!0).hi+1),r,i)-r:a=i-r}return{start:r,count:a}}function hf(n){const{xScale:t,yScale:e,_scaleRanges:i}=n,r={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!i)return n._scaleRanges=r,!0;const a=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==e.min||i.ymax!==e.max;return Object.assign(i,r),a}const er=n=>n===0||n===1,zh=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*wt/e)),Wh=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*wt/e)+1,Gi={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*Ct)+1,easeOutSine:n=>Math.sin(n*Ct),easeInOutSine:n=>-.5*(Math.cos(St*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>er(n)?n:n<.5?.5*Math.pow(2,10*(n*2-1)):.5*(-Math.pow(2,-10*(n*2-1))+2),easeInCirc:n=>n>=1?n:-(Math.sqrt(1-n*n)-1),easeOutCirc:n=>Math.sqrt(1-(n-=1)*n),easeInOutCirc:n=>(n/=.5)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1),easeInElastic:n=>er(n)?n:zh(n,.075,.3),easeOutElastic:n=>er(n)?n:Wh(n,.075,.3),easeInOutElastic(n){return er(n)?n:n<.5?.5*zh(n*2,.1125,.45):.5+.5*Wh(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let t=1.70158;return(n/=.5)<1?.5*(n*n*(((t*=1.525)+1)*n-t)):.5*((n-=2)*n*(((t*=1.525)+1)*n+t)+2)},easeInBounce:n=>1-Gi.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?Gi.easeInBounce(n*2)*.5:Gi.easeOutBounce(n*2-1)*.5+.5};function uf(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Nh(n){return uf(n)?n:new ji(n)}function aa(n){return uf(n)?n:new ji(n).saturate(.5).darken(.1).hexString()}const Oy=["x","y","borderWidth","radius","tension"],Dy=["color","borderColor","backgroundColor"];function Ly(n){n.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),n.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),n.set("animations",{colors:{type:"color",properties:Dy},numbers:{type:"number",properties:Oy}}),n.describe("animations",{_fallback:"animation"}),n.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function Ry(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Hh=new Map;function Ey(n,t){t=t||{};const e=n+JSON.stringify(t);let i=Hh.get(e);return i||(i=new Intl.NumberFormat(n,t),Hh.set(e,i)),i}function rs(n,t,e){return Ey(t,e).format(n)}const ff={values(n){return vt(n)?n:""+n},numeric(n,t,e){if(n===0)return"0";const i=this.chart.options.locale;let r,a=n;if(e.length>1){const f=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(f<1e-4||f>1e15)&&(r="scientific"),a=Iy(n,e)}const l=gn(Math.abs(a)),c=Math.max(Math.min(-1*Math.floor(l),20),0),u={notation:r,minimumFractionDigits:c,maximumFractionDigits:c};return Object.assign(u,this.options.ticks.format),rs(n,i,u)},logarithmic(n,t,e){if(n===0)return"0";const i=e[t].significand||n/Math.pow(10,Math.floor(gn(n)));return[1,2,3,5,10,15].includes(i)||t>.8*e.length?ff.numeric.call(this,n,t,e):""}};function Iy(n,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&n!==Math.floor(n)&&(e=n-Math.floor(n)),e}var Lr={formatters:ff};function Fy(n){n.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:Lr.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const Vn=Object.create(null),Ma=Object.create(null);function Ki(n,t){if(!t)return n;const e=t.split(".");for(let i=0,r=e.length;ii.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,r)=>aa(r.backgroundColor),this.hoverBorderColor=(i,r)=>aa(r.borderColor),this.hoverColor=(i,r)=>aa(r.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 la(this,t,e)}get(t){return Ki(this,t)}describe(t,e){return la(Ma,t,e)}override(t,e){return la(Vn,t,e)}route(t,e,i,r){const a=Ki(this,t),l=Ki(this,i),c="_"+e;Object.defineProperties(a,{[c]:{value:a[e],writable:!0},[e]:{enumerable:!0,get(){const u=this[c],f=l[r];return rt(u)?Object.assign({},f,u):Z(u,f)},set(u){this[c]=u}}})}apply(t){t.forEach(e=>e(this))}}var Dt=new By({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Ly,Ry,Fy]);function zy(n){return!n||lt(n.size)||lt(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function kr(n,t,e,i,r){let a=t[r];return a||(a=t[r]=n.measureText(r).width,e.push(r)),a>i&&(i=a),i}function Wy(n,t,e,i){i=i||{};let r=i.data=i.data||{},a=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(r=i.data={},a=i.garbageCollect=[],i.font=t),n.save(),n.font=t;let l=0;const c=e.length;let u,f,g,p,_;for(u=0;ue.length){for(u=0;u0&&n.stroke()}}function Qi(n,t,e){return e=e||.5,!t||n&&n.x>t.left-e&&n.xt.top-e&&n.y0&&a.strokeColor!=="";let u,f;for(n.save(),n.font=r.string,Vy(n,a),u=0;u+n||0;function Ua(n,t){const e={},i=rt(t),r=i?Object.keys(t):t,a=rt(n)?i?l=>Z(n[l],n[t[l]]):l=>n[l]:()=>n;for(const l of r)e[l]=Ky(a(l));return e}function gf(n){return Ua(n,{top:"y",right:"x",bottom:"y",left:"x"})}function Nn(n){return Ua(n,["topLeft","topRight","bottomLeft","bottomRight"])}function Gt(n){const t=gf(n);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Ft(n,t){n=n||{},t=t||Dt.font;let e=Z(n.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=Z(n.style,t.style);i&&!(""+i).match(Xy)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const r={family:Z(n.family,t.family),lineHeight:Gy(Z(n.lineHeight,t.lineHeight),e),size:e,style:i,weight:Z(n.weight,t.weight),string:""};return r.string=zy(r),r}function Hi(n,t,e,i){let r=!0,a,l,c;for(a=0,l=n.length;ae&&c===0?0:c+u;return{min:l(i,-Math.abs(a)),max:l(r,a)}}function yn(n,t){return Object.assign(Object.create(n),t)}function $a(n,t=[""],e=n,i,r=()=>n[0]){we(i)||(i=bf("_fallback",n));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:e,_fallback:i,_getTarget:r,override:l=>$a([l,...n],t,e,i)};return new Proxy(a,{deleteProperty(l,c){return delete l[c],delete l._keys,delete n[0][c],!0},get(l,c){return mf(l,c,()=>iv(c,t,n,l))},getOwnPropertyDescriptor(l,c){return Reflect.getOwnPropertyDescriptor(l._scopes[0],c)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(l,c){return $h(l).includes(c)},ownKeys(l){return $h(l)},set(l,c,u){const f=l._storage||(l._storage=r());return l[c]=f[c]=u,delete l._keys,!0}})}function hi(n,t,e,i){const r={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:pf(n,i),setContext:a=>hi(n,a,e,i),override:a=>hi(n.override(a),t,e,i)};return new Proxy(r,{deleteProperty(a,l){return delete a[l],delete n[l],!0},get(a,l,c){return mf(a,l,()=>Zy(a,l,c))},getOwnPropertyDescriptor(a,l){return a._descriptors.allKeys?Reflect.has(n,l)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,l)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(a,l){return Reflect.has(n,l)},ownKeys(){return Reflect.ownKeys(n)},set(a,l,c){return n[l]=c,delete a[l],!0}})}function pf(n,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:i=t.indexable,_allKeys:r=t.allKeys}=n;return{allKeys:r,scriptable:e,indexable:i,isScriptable:xn(e)?e:()=>e,isIndexable:xn(i)?i:()=>i}}const jy=(n,t)=>n?n+Wa(t):t,Ya=(n,t)=>rt(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function mf(n,t,e){if(Object.prototype.hasOwnProperty.call(n,t))return n[t];const i=e();return n[t]=i,i}function Zy(n,t,e){const{_proxy:i,_context:r,_subProxy:a,_descriptors:l}=n;let c=i[t];return xn(c)&&l.isScriptable(t)&&(c=Jy(t,c,n,e)),vt(c)&&c.length&&(c=Qy(t,c,n,l.isIndexable)),Ya(t,c)&&(c=hi(c,r,a&&a[t],l)),c}function Jy(n,t,e,i){const{_proxy:r,_context:a,_subProxy:l,_stack:c}=e;if(c.has(n))throw new Error("Recursion detected: "+Array.from(c).join("->")+"->"+n);return c.add(n),t=t(a,l||i),c.delete(n),Ya(n,t)&&(t=Xa(r._scopes,r,n,t)),t}function Qy(n,t,e,i){const{_proxy:r,_context:a,_subProxy:l,_descriptors:c}=e;if(we(a.index)&&i(n))t=t[a.index%t.length];else if(rt(t[0])){const u=t,f=r._scopes.filter(g=>g!==u);t=[];for(const g of u){const p=Xa(f,r,n,g);t.push(hi(p,a,l&&l[n],c))}}return t}function _f(n,t,e){return xn(n)?n(t,e):n}const tv=(n,t)=>n===!0?t:typeof n=="string"?bn(t,n):void 0;function ev(n,t,e,i,r){for(const a of t){const l=tv(e,a);if(l){n.add(l);const c=_f(l._fallback,e,r);if(we(c)&&c!==e&&c!==i)return c}else if(l===!1&&we(i)&&e!==i)return null}return!1}function Xa(n,t,e,i){const r=t._rootScopes,a=_f(t._fallback,e,i),l=[...n,...r],c=new Set;c.add(i);let u=Uh(c,l,e,a||e,i);return u===null||we(a)&&a!==e&&(u=Uh(c,l,a,u,i),u===null)?!1:$a(Array.from(c),[""],r,a,()=>nv(t,e,i))}function Uh(n,t,e,i,r){for(;e;)e=ev(n,t,e,i,r);return e}function nv(n,t,e){const i=n._getTarget();t in i||(i[t]={});const r=i[t];return vt(r)&&rt(e)?e:r||{}}function iv(n,t,e,i){let r;for(const a of t)if(r=bf(jy(a,n),e),we(r))return Ya(n,r)?Xa(e,i,n,r):r}function bf(n,t){for(const e of t){if(!e)continue;const i=e[n];if(we(i))return i}}function $h(n){let t=n._keys;return t||(t=n._keys=sv(n._scopes)),t}function sv(n){const t=new Set;for(const e of n)for(const i of Object.keys(e).filter(r=>!r.startsWith("_")))t.add(i);return Array.from(t)}function xf(n,t,e,i){const{iScale:r}=n,{key:a="r"}=this._parsing,l=new Array(i);let c,u,f,g;for(c=0,u=i;ctn==="x"?"y":"x";function ov(n,t,e,i){const r=n.skip?t:n,a=t,l=e.skip?t:e,c=wa(a,r),u=wa(l,a);let f=c/(c+u),g=u/(c+u);f=isNaN(f)?0:f,g=isNaN(g)?0:g;const p=i*f,_=i*g;return{previous:{x:a.x-p*(l.x-r.x),y:a.y-p*(l.y-r.y)},next:{x:a.x+_*(l.x-r.x),y:a.y+_*(l.y-r.y)}}}function av(n,t,e){const i=n.length;let r,a,l,c,u,f=ui(n,0);for(let g=0;g!f.skip)),t.cubicInterpolationMode==="monotone")cv(n,r);else{let f=i?n[n.length-1]:n[0];for(a=0,l=n.length;an.ownerDocument.defaultView.getComputedStyle(n,null);function fv(n,t){return Ir(n).getPropertyValue(t)}const dv=["top","right","bottom","left"];function Hn(n,t,e){const i={};e=e?"-"+e:"";for(let r=0;r<4;r++){const a=dv[r];i[a]=parseFloat(n[t+"-"+a+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const gv=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function pv(n,t){const e=n.touches,i=e&&e.length?e[0]:n,{offsetX:r,offsetY:a}=i;let l=!1,c,u;if(gv(r,a,n.target))c=r,u=a;else{const f=t.getBoundingClientRect();c=i.clientX-f.left,u=i.clientY-f.top,l=!0}return{x:c,y:u,box:l}}function Fn(n,t){if("native"in n)return n;const{canvas:e,currentDevicePixelRatio:i}=t,r=Ir(e),a=r.boxSizing==="border-box",l=Hn(r,"padding"),c=Hn(r,"border","width"),{x:u,y:f,box:g}=pv(n,e),p=l.left+(g&&c.left),_=l.top+(g&&c.top);let{width:y,height:w}=t;return a&&(y-=l.width+c.width,w-=l.height+c.height),{x:Math.round((u-p)/y*e.width/i),y:Math.round((f-_)/w*e.height/i)}}function mv(n,t,e){let i,r;if(t===void 0||e===void 0){const a=Ga(n);if(!a)t=n.clientWidth,e=n.clientHeight;else{const l=a.getBoundingClientRect(),c=Ir(a),u=Hn(c,"border","width"),f=Hn(c,"padding");t=l.width-f.width-u.width,e=l.height-f.height-u.height,i=Pr(c.maxWidth,a,"clientWidth"),r=Pr(c.maxHeight,a,"clientHeight")}}return{width:t,height:e,maxWidth:i||Ar,maxHeight:r||Ar}}const ir=n=>Math.round(n*10)/10;function _v(n,t,e,i){const r=Ir(n),a=Hn(r,"margin"),l=Pr(r.maxWidth,n,"clientWidth")||Ar,c=Pr(r.maxHeight,n,"clientHeight")||Ar,u=mv(n,t,e);let{width:f,height:g}=u;if(r.boxSizing==="content-box"){const _=Hn(r,"border","width"),y=Hn(r,"padding");f-=y.width+_.width,g-=y.height+_.height}return f=Math.max(0,f-a.width),g=Math.max(0,i?f/i:g-a.height),f=ir(Math.min(f,l,u.maxWidth)),g=ir(Math.min(g,c,u.maxHeight)),f&&!g&&(g=ir(f/2)),(t!==void 0||e!==void 0)&&i&&u.height&&g>u.height&&(g=u.height,f=ir(Math.floor(g*i))),{width:f,height:g}}function Yh(n,t,e){const i=t||1,r=Math.floor(n.height*i),a=Math.floor(n.width*i);n.height=Math.floor(n.height),n.width=Math.floor(n.width);const l=n.canvas;return l.style&&(e||!l.style.height&&!l.style.width)&&(l.style.height=`${n.height}px`,l.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||l.height!==r||l.width!==a?(n.currentDevicePixelRatio=i,l.height=r,l.width=a,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const bv=function(){let n=!1;try{const t={get passive(){return n=!0,!1}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch(t){}return n}();function Xh(n,t){const e=fv(n,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Bn(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function xv(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:i==="middle"?e<.5?n.y:t.y:i==="after"?e<1?n.y:t.y:e>0?t.y:n.y}}function yv(n,t,e,i){const r={x:n.cp2x,y:n.cp2y},a={x:t.cp1x,y:t.cp1y},l=Bn(n,r,e),c=Bn(r,a,e),u=Bn(a,t,e),f=Bn(l,c,e),g=Bn(c,u,e);return Bn(f,g,e)}const vv=function(n,t){return{x(e){return n+n+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,i){return e-i},leftForLtr(e,i){return e-i}}},wv=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function li(n,t,e){return n?vv(t,e):wv()}function wf(n,t){let e,i;(t==="ltr"||t==="rtl")&&(e=n.canvas.style,i=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),n.prevTextDirection=i)}function Mf(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function Sf(n){return n==="angle"?{between:Ji,compare:My,normalize:ue}:{between:tn,compare:(t,e)=>t-e,normalize:t=>t}}function Gh({start:n,end:t,count:e,loop:i,style:r}){return{start:n%e,end:t%e,loop:i&&(t-n+1)%e===0,style:r}}function Mv(n,t,e){const{property:i,start:r,end:a}=e,{between:l,normalize:c}=Sf(i),u=t.length;let{start:f,end:g,loop:p}=n,_,y;if(p){for(f+=u,g+=u,_=0,y=u;_u(r,I,C)&&c(r,I)!==0,L=()=>c(a,C)===0||u(a,I,C),W=()=>M||F(),z=()=>!M||L();for(let N=g,Y=g;N<=p;++N)O=t[N%l],!O.skip&&(C=f(O[i]),C!==I&&(M=u(C,r,a),A===null&&W()&&(A=c(C,r)===0?N:Y),A!==null&&z()&&(w.push(Gh({start:A,end:N,loop:_,count:l,style:y})),A=null),Y=N,I=C));return A!==null&&w.push(Gh({start:A,end:p,loop:_,count:l,style:y})),w}function kf(n,t){const e=[],i=n.segments;for(let r=0;rr&&n[a%t].skip;)a--;return a%=t,{start:r,end:a}}function Av(n,t,e,i){const r=n.length,a=[];let l=t,c=n[t],u;for(u=t+1;u<=e;++u){const f=n[u%r];f.skip||f.stop?c.skip||(i=!1,a.push({start:t%r,end:(u-1)%r,loop:i}),t=l=f.stop?u:null):(l=u,c.skip&&(t=u)),c=f}return l!==null&&a.push({start:t%r,end:l%r,loop:i}),a}function kv(n,t){const e=n.points,i=n.options.spanGaps,r=e.length;if(!r)return[];const a=!!n._loop,{start:l,end:c}=Sv(e,r,a,i);if(i===!0)return Kh(n,[{start:l,end:c,loop:a}],e,t);const u=cc({chart:t,initial:e.initial,numSteps:l,currentStep:Math.min(i-e.start,l)}))}_refresh(){this._request||(this._running=!0,this._request=af.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,r)=>{if(!i.running||!i.items.length)return;const a=i.items;let l=a.length-1,c=!1,u;for(;l>=0;--l)u=a[l],u._active?(u._total>i.duration&&(i.duration=u._total),u.tick(t),c=!0):(a[l]=a[a.length-1],a.pop());c&&(r.draw(),this._notify(r,i,t,"progress")),a.length||(i.running=!1,this._notify(r,i,t,"complete"),i.initial=!1),e+=a.length}),this._lastDate=t,e===0&&(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((i,r)=>Math.max(i,r._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 r=i.length-1;for(;r>=0;--r)i[r].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Ze=new Tv;const jh="transparent",Ov={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const i=Nh(n||jh),r=i.valid&&Nh(t||jh);return r&&r.valid?r.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class Dv{constructor(t,e,i,r){const a=e[i];r=Hi([t.to,r,a,t.from]);const l=Hi([t.from,a,r]);this._active=!0,this._fn=t.fn||Ov[t.type||typeof l],this._easing=Gi[t.easing]||Gi.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=l,this._to=r,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const r=this._target[this._prop],a=i-this._start,l=this._duration-a;this._start=i,this._duration=Math.floor(Math.max(l,t.duration)),this._total+=a,this._loop=!!t.loop,this._to=Hi([t.to,e,r,t.from]),this._from=Hi([t.from,r,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,r=this._prop,a=this._from,l=this._loop,c=this._to;let u;if(this._active=a!==c&&(l||e1?2-u:u,u=this._easing(Math.min(1,Math.max(0,u))),this._target[r]=this._fn(a,c,u)}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 r=0;r{const a=t[r];if(!rt(a))return;const l={};for(const c of e)l[c]=a[c];(vt(a.properties)&&a.properties||[r]).forEach(c=>{(c===r||!i.has(c))&&i.set(c,l)})})}_animateOptions(t,e){const i=e.options,r=Rv(t,i);if(!r)return[];const a=this._createAnimations(r,i);return i.$shared&&Lv(t.options.$animations,i).then(()=>{t.options=i},()=>{}),a}_createAnimations(t,e){const i=this._properties,r=[],a=t.$animations||(t.$animations={}),l=Object.keys(e),c=Date.now();let u;for(u=l.length-1;u>=0;--u){const f=l[u];if(f.charAt(0)==="$")continue;if(f==="options"){r.push(...this._animateOptions(t,e));continue}const g=e[f];let p=a[f];const _=i.get(f);if(p)if(_&&p.active()){p.update(_,g,c);continue}else p.cancel();if(!_||!_.duration){t[f]=g;continue}a[f]=p=new Dv(_,t,f,g),r.push(p)}return r}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const i=this._createAnimations(t,e);if(i.length)return Ze.add(this._chart,i),!0}}function Lv(n,t){const e=[],i=Object.keys(t);for(let r=0;r0||!e&&a<0)return r.index}return null}function eu(n,t){const{chart:e,_cachedMeta:i}=n,r=e._stacks||(e._stacks={}),{iScale:a,vScale:l,index:c}=i,u=a.axis,f=l.axis,g=Bv(a,l,i),p=t.length;let _;for(let y=0;ye[i].axis===t).shift()}function Nv(n,t){return yn(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Hv(n,t,e){return yn(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Ii(n,t){const e=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){t=t||n._parsed;for(const r of t){const a=r._stacks;if(!a||a[i]===void 0||a[i][e]===void 0)return;delete a[i][e],a[i]._visualValues!==void 0&&a[i]._visualValues[e]!==void 0&&delete a[i]._visualValues[e]}}}const ha=n=>n==="reset"||n==="none",nu=(n,t)=>t?n:Object.assign({},n),Vv=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:Cf(e,!0),values:null};class De{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=Qh(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&&Ii(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),r=(p,_,y,w)=>p==="x"?_:p==="r"?w:y,a=e.xAxisID=Z(i.xAxisID,ca(t,"x")),l=e.yAxisID=Z(i.yAxisID,ca(t,"y")),c=e.rAxisID=Z(i.rAxisID,ca(t,"r")),u=e.indexAxis,f=e.iAxisID=r(u,a,l,c),g=e.vAxisID=r(u,l,a,c);e.xScale=this.getScaleForId(a),e.yScale=this.getScaleForId(l),e.rScale=this.getScaleForId(c),e.iScale=this.getScaleForId(f),e.vScale=this.getScaleForId(g)}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&&Bh(this._data,this),t._stacked&&Ii(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(rt(e))this._data=Fv(e);else if(i!==e){if(i){Bh(i,this);const r=this._cachedMeta;Ii(r),r._parsed=[]}e&&Object.isExtensible(e)&&Py(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let r=!1;this._dataCheck();const a=e._stacked;e._stacked=Qh(e.vScale,e),e.stack!==i.stack&&(r=!0,Ii(e),e.stack=i.stack),this._resyncElements(t),(r||a!==e._stacked)&&eu(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:r}=this,{iScale:a,_stacked:l}=i,c=a.axis;let u=t===0&&e===r.length?!0:i._sorted,f=t>0&&i._parsed[t-1],g,p,_;if(this._parsing===!1)i._parsed=r,i._sorted=!0,_=r;else{vt(r[t])?_=this.parseArrayData(i,r,t,e):rt(r[t])?_=this.parseObjectData(i,r,t,e):_=this.parsePrimitiveData(i,r,t,e);const y=()=>p[c]===null||f&&p[c]M||p=0;--_)if(!w()){this.updateRangeFromParsed(f,t,y,u);break}}return f}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let r,a,l;for(r=0,a=e.length;r=0&&tthis.getContext(i,r,e),M=f.resolveNamedOptions(_,y,w,p);return M.$shared&&(M.$shared=u,a[l]=Object.freeze(nu(M,u))),M}_resolveAnimations(t,e,i){const r=this.chart,a=this._cachedDataOpts,l=`animation-${e}`,c=a[l];if(c)return c;let u;if(r.options.animation!==!1){const g=this.chart.config,p=g.datasetAnimationScopeKeys(this._type,e),_=g.getOptionScopes(this.getDataset(),p);u=g.createResolver(_,this.getContext(t,i,e))}const f=new Pf(r,u&&u.animations);return u&&u._cacheable&&(a[l]=Object.freeze(f)),f}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||ha(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),r=this._sharedOptions,a=this.getSharedOptions(i),l=this.includeOptions(e,a)||a!==r;return this.updateSharedOptions(a,e,i),{sharedOptions:a,includeOptions:l}}updateElement(t,e,i,r){ha(r)?Object.assign(t,i):this._resolveAnimations(e,r).update(t,i)}updateSharedOptions(t,e,i){t&&!ha(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,r){t.active=r;const a=this.getStyle(e,r);this._resolveAnimations(e,i,r).update(t,{options:!r&&this.getSharedOptions(a)||a})}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[c,u,f]of this._syncList)this[c](u,f);this._syncList=[];const r=i.length,a=e.length,l=Math.min(a,r);l&&this.parse(0,l),a>r?this._insertElements(r,a-r,t):a{for(f.length+=e,c=f.length-1;c>=l;c--)f[c]=f[c-e]};for(u(a),c=t;cr-a))}return n._cache.$bar}function $v(n){const t=n.iScale,e=Uv(t,n.type);let i=t._length,r,a,l,c;const u=()=>{l===32767||l===-32768||(we(c)&&(i=Math.min(i,Math.abs(l-c)||i)),c=l)};for(r=0,a=e.length;r0?r[n-1]:null,c=nMath.abs(c)&&(u=c,f=l),t[e.axis]=f,t._custom={barStart:u,barEnd:f,start:r,end:a,min:l,max:c}}function Tf(n,t,e,i){return vt(n)?Gv(n,t,e,i):t[e.axis]=e.parse(n,i),t}function iu(n,t,e,i){const r=n.iScale,a=n.vScale,l=r.getLabels(),c=r===a,u=[];let f,g,p,_;for(f=e,g=e+i;f=e?1:-1)}function qv(n){let t,e,i,r,a;return n.horizontal?(t=n.base>n.x,e="left",i="right"):(t=n.baseu.controller.options.grouped),a=i.options.stacked,l=[],c=u=>{const f=u.controller.getParsed(e),g=f&&f[u.vScale.axis];if(lt(g)||isNaN(g))return!0};for(const u of r)if(!(e!==void 0&&c(u))&&((a===!1||l.indexOf(u.stack)===-1||a===void 0&&u.stack===void 0)&&l.push(u.stack),u.index===t))break;return l.length||l.push(void 0),l}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const r=this._getStacks(t,i),a=e!==void 0?r.indexOf(e):-1;return a===-1?r.length-1:a}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,r=[];let a,l;for(a=0,l=e.data.length;a=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:r,yScale:a}=e,l=this.getParsed(t),c=r.getLabelForValue(l.x),u=a.getLabelForValue(l.y),f=l._custom;return{label:i[t]||"",value:"("+c+", "+u+(f?", "+f:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,r){const a=r==="reset",{iScale:l,vScale:c}=this._cachedMeta,{sharedOptions:u,includeOptions:f}=this._getSharedOptions(e,r),g=l.axis,p=c.axis;for(let _=e;_Ji(I,c,u,!0)?1:Math.max(F,F*e,L,L*e),w=(I,F,L)=>Ji(I,c,u,!0)?-1:Math.min(F,F*e,L,L*e),M=y(0,f,p),A=y(Ct,g,_),C=w(St,f,p),O=w(St+Ct,g,_);i=(M-C)/2,r=(A-O)/2,a=-(M+C)/2,l=-(A+O)/2}return{ratioX:i,ratioY:r,offsetX:a,offsetY:l}}class Wn extends De{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,r=this._cachedMeta;if(this._parsing===!1)r._parsed=i;else{let a=u=>+i[u];if(rt(i[t])){const{key:u="value"}=this._parsing;a=f=>+bn(i[f],u)}let l,c;for(l=t,c=t+e;l0&&!isNaN(t)?wt*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,r=i.data.labels||[],a=rs(e._parsed[t],i.options.locale);return{label:r[t]||"",value:a}}getMaxBorderWidth(t){let e=0;const i=this.chart;let r,a,l,c,u;if(!t){for(r=0,a=i.data.datasets.length;rt!=="spacing",_indexable:t=>t!=="spacing"}),U(Wn,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:r}}=t.legend.options;return e.labels.map((a,l)=>{const u=t.getDatasetMeta(0).controller.getStyle(l);return{text:a,fillStyle:u.backgroundColor,strokeStyle:u.borderColor,fontColor:r,lineWidth:u.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(l),index:l}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}});class pr extends De{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:r=[],_dataset:a}=e,l=this.chart._animationsDisabled;let{start:c,count:u}=cf(e,r,l);this._drawStart=c,this._drawCount=u,hf(e)&&(c=0,u=r.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!a._decimated,i.points=r;const f=this.resolveDatasetElementOptions(t);this.options.showLine||(f.borderWidth=0),f.segment=this.options.segment,this.updateElement(i,void 0,{animated:!l,options:f},t),this.updateElements(r,c,u,t)}updateElements(t,e,i,r){const a=r==="reset",{iScale:l,vScale:c,_stacked:u,_dataset:f}=this._cachedMeta,{sharedOptions:g,includeOptions:p}=this._getSharedOptions(e,r),_=l.axis,y=c.axis,{spanGaps:w,segment:M}=this.options,A=ci(w)?w:Number.POSITIVE_INFINITY,C=this.chart._animationsDisabled||a||r==="none",O=e+i,I=t.length;let F=e>0&&this.getParsed(e-1);for(let L=0;L=O){z.skip=!0;continue}const N=this.getParsed(L),Y=lt(N[y]),J=z[_]=l.getPixelForValue(N[_],L),Q=z[y]=a||Y?c.getBasePixel():c.getPixelForValue(u?this.applyStack(c,N,u):N[y],L);z.skip=isNaN(J)||isNaN(Q)||Y,z.stop=L>0&&Math.abs(N[_]-F[_])>A,M&&(z.parsed=N,z.raw=f.data[L]),p&&(z.options=g||this.resolveDataElementOptions(L,W.active?"active":r)),C||this.updateElement(W,L,z,r),F=N}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,r=t.data||[];if(!r.length)return i;const a=r[0].size(this.resolveDataElementOptions(0)),l=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(i,a,l)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}U(pr,"id","line"),U(pr,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),U(pr,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class qi extends De{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,r=i.data.labels||[],a=rs(e._parsed[t].r,i.options.locale);return{label:r[t]||"",value:a}}parseObjectData(t,e,i,r){return xf.bind(this)(t,e,i,r)}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((i,r)=>{const a=this.getParsed(r).r;!isNaN(a)&&this.chart.getDataVisibility(r)&&(ae.max&&(e.max=a))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,r=Math.min(e.right-e.left,e.bottom-e.top),a=Math.max(r/2,0),l=Math.max(i.cutoutPercentage?a/100*i.cutoutPercentage:1,0),c=(a-l)/t.getVisibleDatasetCount();this.outerRadius=a-c*this.index,this.innerRadius=this.outerRadius-c}updateElements(t,e,i,r){const a=r==="reset",l=this.chart,u=l.options.animation,f=this._cachedMeta.rScale,g=f.xCenter,p=f.yCenter,_=f.getIndexAngle(0)-.5*St;let y=_,w;const M=360/this.countVisibleElements();for(w=0;w{!isNaN(this.getParsed(r).r)&&this.chart.getDataVisibility(r)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?Oe(this.resolveDataElementOptions(t,e).angle||i):0}}U(qi,"id","polarArea"),U(qi,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),U(qi,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:r}}=t.legend.options;return e.labels.map((a,l)=>{const u=t.getDatasetMeta(0).controller.getStyle(l);return{text:a,fillStyle:u.backgroundColor,strokeStyle:u.borderColor,fontColor:r,lineWidth:u.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(l),index:l}})}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 Aa extends Wn{}U(Aa,"id","pie"),U(Aa,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class mr extends De{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,r){return xf.bind(this)(t,e,i,r)}update(t){const e=this._cachedMeta,i=e.dataset,r=e.data||[],a=e.iScale.getLabels();if(i.points=r,t!=="resize"){const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0);const c={_loop:!0,_fullLoop:a.length===r.length,options:l};this.updateElement(i,void 0,c,t)}this.updateElements(r,0,r.length,t)}updateElements(t,e,i,r){const a=this._cachedMeta.rScale,l=r==="reset";for(let c=e;c0&&this.getParsed(e-1);for(let F=e;F0&&Math.abs(W[y]-I[y])>C,A&&(z.parsed=W,z.raw=f.data[F]),_&&(z.options=p||this.resolveDataElementOptions(F,L.active?"active":r)),O||this.updateElement(L,F,z,r),I=W}this.updateSharedOptions(p,r,g)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let c=0;for(let u=e.length-1;u>=0;--u)c=Math.max(c,e[u].size(this.resolveDataElementOptions(u))/2);return c>0&&c}const i=t.dataset,r=i.options&&i.options.borderWidth||0;if(!e.length)return r;const a=e[0].size(this.resolveDataElementOptions(0)),l=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(r,a,l)/2}}U(_r,"id","scatter"),U(_r,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),U(_r,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var t1=Object.freeze({__proto__:null,BarController:dr,BubbleController:gr,DoughnutController:Wn,LineController:pr,PolarAreaController:qi,PieController:Aa,RadarController:mr,ScatterController:_r});function En(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Ka{static override(t){Object.assign(Ka.prototype,t)}constructor(t){this.options=t||{}}init(){}formats(){return En()}parse(){return En()}format(){return En()}add(){return En()}diff(){return En()}startOf(){return En()}endOf(){return En()}}var e1={_date:Ka};function n1(n,t,e,i){const{controller:r,data:a,_sorted:l}=n,c=r._cachedMeta.iScale;if(c&&t===c.axis&&t!=="r"&&l&&a.length){const u=c._reversePixels?Ay:en;if(i){if(r._sharedOptions){const f=a[0],g=typeof f.getRange=="function"&&f.getRange(t);if(g){const p=u(a,t,e-g),_=u(a,t,e+g);return{lo:p.lo,hi:_.hi}}}}else return u(a,t,e)}return{lo:0,hi:a.length-1}}function os(n,t,e,i,r){const a=n.getSortedVisibleDatasetMetas(),l=e[t];for(let c=0,u=a.length;c{u[l](t[e],r)&&(a.push({element:u,datasetIndex:f,index:g}),c=c||u.inRange(t.x,t.y,r))}),i&&!c?[]:a}var o1={evaluateInteractionItems:os,modes:{index(n,t,e,i){const r=Fn(t,n),a=e.axis||"x",l=e.includeInvisible||!1,c=e.intersect?fa(n,r,a,i,l):da(n,r,a,!1,i,l),u=[];return c.length?(n.getSortedVisibleDatasetMetas().forEach(f=>{const g=c[0].index,p=f.data[g];p&&!p.skip&&u.push({element:p,datasetIndex:f.index,index:g})}),u):[]},dataset(n,t,e,i){const r=Fn(t,n),a=e.axis||"xy",l=e.includeInvisible||!1;let c=e.intersect?fa(n,r,a,i,l):da(n,r,a,!1,i,l);if(c.length>0){const u=c[0].datasetIndex,f=n.getDatasetMeta(u).data;c=[];for(let g=0;ge.pos===t)}function au(n,t){return n.filter(e=>Of.indexOf(e.pos)===-1&&e.box.axis===t)}function Bi(n,t){return n.sort((e,i)=>{const r=t?i:e,a=t?e:i;return r.weight===a.weight?r.index-a.index:r.weight-a.weight})}function a1(n){const t=[];let e,i,r,a,l,c;for(e=0,i=(n||[]).length;ef.box.fullSize),!0),i=Bi(Fi(t,"left"),!0),r=Bi(Fi(t,"right")),a=Bi(Fi(t,"top"),!0),l=Bi(Fi(t,"bottom")),c=au(t,"x"),u=au(t,"y");return{fullSize:e,leftAndTop:i.concat(a),rightAndBottom:r.concat(u).concat(l).concat(c),chartArea:Fi(t,"chartArea"),vertical:i.concat(r).concat(u),horizontal:a.concat(l).concat(c)}}function lu(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function Df(n,t){n.top=Math.max(n.top,t.top),n.left=Math.max(n.left,t.left),n.bottom=Math.max(n.bottom,t.bottom),n.right=Math.max(n.right,t.right)}function u1(n,t,e,i){const{pos:r,box:a}=e,l=n.maxPadding;if(!rt(r)){e.size&&(n[r]-=e.size);const p=i[e.stack]||{size:0,count:1};p.size=Math.max(p.size,e.horizontal?a.height:a.width),e.size=p.size/p.count,n[r]+=e.size}a.getPadding&&Df(l,a.getPadding());const c=Math.max(0,t.outerWidth-lu(l,n,"left","right")),u=Math.max(0,t.outerHeight-lu(l,n,"top","bottom")),f=c!==n.w,g=u!==n.h;return n.w=c,n.h=u,e.horizontal?{same:f,other:g}:{same:g,other:f}}function f1(n){const t=n.maxPadding;function e(i){const r=Math.max(t[i]-n[i],0);return n[i]+=r,r}n.y+=e("top"),n.x+=e("left"),e("right"),e("bottom")}function d1(n,t){const e=t.maxPadding;function i(r){const a={left:0,top:0,right:0,bottom:0};return r.forEach(l=>{a[l]=Math.max(t[l],e[l])}),a}return i(n?["left","right"]:["top","bottom"])}function Vi(n,t,e,i){const r=[];let a,l,c,u,f,g;for(a=0,l=n.length,f=0;a{typeof M.beforeLayout=="function"&&M.beforeLayout()});const g=u.reduce((M,A)=>A.box.options&&A.box.options.display===!1?M:M+1,0)||1,p=Object.freeze({outerWidth:t,outerHeight:e,padding:r,availableWidth:a,availableHeight:l,vBoxMaxWidth:a/2/g,hBoxMaxHeight:l/2}),_=Object.assign({},r);Df(_,Gt(i));const y=Object.assign({maxPadding:_,w:a,h:l,x:r.left,y:r.top},r),w=c1(u.concat(f),p);Vi(c.fullSize,y,p,w),Vi(u,y,p,w),Vi(f,y,p,w)&&Vi(u,y,p,w),f1(y),cu(c.leftAndTop,y,p,w),y.x+=y.w,y.y+=y.h,cu(c.rightAndBottom,y,p,w),n.chartArea={left:y.left,top:y.top,right:y.left+y.w,bottom:y.top+y.h,height:y.h,width:y.w},pt(c.chartArea,M=>{const A=M.box;Object.assign(A,n.chartArea),A.update(y.w,y.h,{left:0,top:0,right:0,bottom:0})})}};class Lf{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,r){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,r?Math.floor(e/r):i)}}isAttached(t){return!0}updateConfig(t){}}class g1 extends Lf{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const br="$chartjs",p1={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},hu=n=>n===null||n==="";function m1(n,t){const e=n.style,i=n.getAttribute("height"),r=n.getAttribute("width");if(n[br]={initial:{height:i,width:r,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",hu(r)){const a=Xh(n,"width");a!==void 0&&(n.width=a)}if(hu(i))if(n.style.height==="")n.height=n.width/(t||2);else{const a=Xh(n,"height");a!==void 0&&(n.height=a)}return n}const Rf=bv?{passive:!0}:!1;function _1(n,t,e){n.addEventListener(t,e,Rf)}function b1(n,t,e){n.canvas.removeEventListener(t,e,Rf)}function x1(n,t){const e=p1[n.type]||n.type,{x:i,y:r}=Fn(n,t);return{type:e,chart:t,native:n,x:i!==void 0?i:null,y:r!==void 0?r:null}}function Cr(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function y1(n,t,e){const i=n.canvas,r=new MutationObserver(a=>{let l=!1;for(const c of a)l=l||Cr(c.addedNodes,i),l=l&&!Cr(c.removedNodes,i);l&&e()});return r.observe(document,{childList:!0,subtree:!0}),r}function v1(n,t,e){const i=n.canvas,r=new MutationObserver(a=>{let l=!1;for(const c of a)l=l||Cr(c.removedNodes,i),l=l&&!Cr(c.addedNodes,i);l&&e()});return r.observe(document,{childList:!0,subtree:!0}),r}const es=new Map;let uu=0;function Ef(){const n=window.devicePixelRatio;n!==uu&&(uu=n,es.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function w1(n,t){es.size||window.addEventListener("resize",Ef),es.set(n,t)}function M1(n){es.delete(n),es.size||window.removeEventListener("resize",Ef)}function S1(n,t,e){const i=n.canvas,r=i&&Ga(i);if(!r)return;const a=lf((c,u)=>{const f=r.clientWidth;e(c,u),f{const u=c[0],f=u.contentRect.width,g=u.contentRect.height;f===0&&g===0||a(f,g)});return l.observe(r),w1(n,a),l}function ga(n,t,e){e&&e.disconnect(),t==="resize"&&M1(n)}function A1(n,t,e){const i=n.canvas,r=lf(a=>{n.ctx!==null&&e(x1(a,n))},n);return _1(i,t,r),r}class k1 extends Lf{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(m1(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[br])return!1;const i=e[br].initial;["height","width"].forEach(a=>{const l=i[a];lt(l)?e.removeAttribute(a):e.setAttribute(a,l)});const r=i.style||{};return Object.keys(r).forEach(a=>{e.style[a]=r[a]}),e.width=e.width,delete e[br],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const r=t.$proxies||(t.$proxies={}),l={attach:y1,detach:v1,resize:S1}[e]||A1;r[e]=l(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),r=i[e];if(!r)return;({attach:ga,detach:ga,resize:ga}[e]||b1)(t,e,r),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,r){return _v(t,e,i,r)}isAttached(t){const e=Ga(t);return!!(e&&e.isConnected)}}function P1(n){return!vf()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?g1:k1}class Le{constructor(){U(this,"active",!1)}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return ci(this.x)&&ci(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const r={};return t.forEach(a=>{r[a]=i[a]&&i[a].active()?i[a]._to:this[a]}),r}}U(Le,"defaults",{}),U(Le,"defaultRoutes");function C1(n,t){const e=n.options.ticks,i=T1(n),r=Math.min(e.maxTicksLimit||i,i),a=e.major.enabled?D1(t):[],l=a.length,c=a[0],u=a[l-1],f=[];if(l>r)return L1(t,f,a,l/r),f;const g=O1(a,t,r);if(l>0){let p,_;const y=l>1?Math.round((u-c)/(l-1)):null;for(rr(t,f,g,lt(y)?0:c-y,c),p=0,_=l-1;p<_;p++)rr(t,f,g,a[p],a[p+1]);return rr(t,f,g,u,lt(y)?t.length:u+y),f}return rr(t,f,g),f}function T1(n){const t=n.options.offset,e=n._tickSize(),i=n._length/e+(t?0:1),r=n._maxLength/e;return Math.floor(Math.min(i,r))}function O1(n,t,e){const i=R1(n),r=t.length/e;if(!i)return Math.max(r,1);const a=vy(i);for(let l=0,c=a.length-1;lr)return u}return Math.max(r,1)}function D1(n){const t=[];let e,i;for(e=0,i=n.length;en==="left"?"right":n==="right"?"left":n,fu=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,du=(n,t)=>Math.min(t||n,n);function gu(n,t){const e=[],i=n.length/t,r=n.length;let a=0;for(;al+c)))return u}function F1(n,t){pt(n,e=>{const i=e.gc,r=i.length/2;let a;if(r>t){for(a=0;ai?i:e,i=r&&e>i?e:i,{min:he(e,he(i,e)),max:he(i,he(e,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){xt(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:r,grace:a,ticks:l}=this.options,c=l.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=qy(this,a,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const u=c=a||i<=1||!this.isHorizontal()){this.labelRotation=r;return}const g=this._getLabelSizes(),p=g.widest.width,_=g.highest.height,y=Wt(this.chart.width-p,0,this.maxWidth);c=t.offset?this.maxWidth/i:y/(i-1),p+6>c&&(c=y/(i-(t.offset?.5:1)),u=this.maxHeight-zi(t.grid)-e.padding-pu(t.title,this.chart.options.font),f=Math.sqrt(p*p+_*_),l=Na(Math.min(Math.asin(Wt((g.highest.height+6)/c,-1,1)),Math.asin(Wt(u/f,-1,1))-Math.asin(Wt(_/f,-1,1)))),l=Math.max(r,Math.min(a,l))),this.labelRotation=l}afterCalculateLabelRotation(){xt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){xt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:r,grid:a}}=this,l=this._isVisible(),c=this.isHorizontal();if(l){const u=pu(r,e.options.font);if(c?(t.width=this.maxWidth,t.height=zi(a)+u):(t.height=this.maxHeight,t.width=zi(a)+u),i.display&&this.ticks.length){const{first:f,last:g,widest:p,highest:_}=this._getLabelSizes(),y=i.padding*2,w=Oe(this.labelRotation),M=Math.cos(w),A=Math.sin(w);if(c){const C=i.mirror?0:A*p.width+M*_.height;t.height=Math.min(this.maxHeight,t.height+C+y)}else{const C=i.mirror?0:M*p.width+A*_.height;t.width=Math.min(this.maxWidth,t.width+C+y)}this._calculatePadding(f,g,A,M)}}this._handleMargins(),c?(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,r){const{ticks:{align:a,padding:l},position:c}=this.options,u=this.labelRotation!==0,f=c!=="top"&&this.axis==="x";if(this.isHorizontal()){const g=this.getPixelForTick(0)-this.left,p=this.right-this.getPixelForTick(this.ticks.length-1);let _=0,y=0;u?f?(_=r*t.width,y=i*e.height):(_=i*t.height,y=r*e.width):a==="start"?y=e.width:a==="end"?_=t.width:a!=="inner"&&(_=t.width/2,y=e.width/2),this.paddingLeft=Math.max((_-g+l)*this.width/(this.width-g),0),this.paddingRight=Math.max((y-p+l)*this.width/(this.width-p),0)}else{let g=e.height/2,p=t.height/2;a==="start"?(g=0,p=t.height):a==="end"&&(g=e.height,p=0),this.paddingTop=g+l,this.paddingBottom=p+l}}_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(){xt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,i;for(e=0,i=t.length;e({width:l[Y]||0,height:c[Y]||0});return{first:N(0),last:N(e-1),widest:N(W),highest:N(z),widths:l,heights:c}}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 Sy(this._alignToPixels?Rn(this.chart,e,0):e)}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&&tc*r?c/i:u/r:u*r0}_computeGridLineItems(t){const e=this.axis,i=this.chart,r=this.options,{grid:a,position:l,border:c}=r,u=a.offset,f=this.isHorizontal(),p=this.ticks.length+(u?1:0),_=zi(a),y=[],w=c.setContext(this.getContext()),M=w.display?w.width:0,A=M/2,C=function(_t){return Rn(i,_t,M)};let O,I,F,L,W,z,N,Y,J,Q,at,Rt;if(l==="top")O=C(this.bottom),z=this.bottom-_,Y=O-A,Q=C(t.top)+A,Rt=t.bottom;else if(l==="bottom")O=C(this.top),Q=t.top,Rt=C(t.bottom)-A,z=O+A,Y=this.top+_;else if(l==="left")O=C(this.right),W=this.right-_,N=O-A,J=C(t.left)+A,at=t.right;else if(l==="right")O=C(this.left),J=t.left,at=C(t.right)-A,W=O+A,N=this.left+_;else if(e==="x"){if(l==="center")O=C((t.top+t.bottom)/2+.5);else if(rt(l)){const _t=Object.keys(l)[0],dt=l[_t];O=C(this.chart.scales[_t].getPixelForValue(dt))}Q=t.top,Rt=t.bottom,z=O+A,Y=z+_}else if(e==="y"){if(l==="center")O=C((t.left+t.right)/2);else if(rt(l)){const _t=Object.keys(l)[0],dt=l[_t];O=C(this.chart.scales[_t].getPixelForValue(dt))}W=O-A,N=W-_,J=t.left,at=t.right}const Vt=Z(r.ticks.maxTicksLimit,p),ht=Math.max(1,Math.ceil(p/Vt));for(I=0;Ia.value===t);return r>=0?e.setContext(this.getContext(r)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,r=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let a,l;const c=(u,f,g)=>{!g.width||!g.color||(i.save(),i.lineWidth=g.width,i.strokeStyle=g.color,i.setLineDash(g.borderDash||[]),i.lineDashOffset=g.borderDashOffset,i.beginPath(),i.moveTo(u.x,u.y),i.lineTo(f.x,f.y),i.stroke(),i.restore())};if(e.display)for(a=0,l=r.length;a{this.draw(a)}}]:[{z:i,draw:a=>{this.drawBackground(),this.drawGrid(a),this.drawTitle()}},{z:r,draw:()=>{this.drawBorder()}},{z:e,draw:a=>{this.drawLabels(a)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",r=[];let a,l;for(a=0,l=e.length;a{const i=e.split("."),r=i.pop(),a=[n].concat(i).join("."),l=t[e].split("."),c=l.pop(),u=l.join(".");Dt.route(a,r,u,c)})}function U1(n){return"id"in n&&"defaults"in n}class $1{constructor(){this.controllers=new or(De,"datasets",!0),this.elements=new or(Le,"elements"),this.plugins=new or(Object,"plugins"),this.scales=new or($n,"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(r=>{const a=i||this._getRegistryForType(r);i||a.isForType(r)||a===this.plugins&&r.id?this._exec(t,a,r):pt(r,l=>{const c=i||this._getRegistryForType(l);this._exec(t,c,l)})})}_exec(t,e,i){const r=Wa(t);xt(i["before"+r],[],i),e[t](i),xt(i["after"+r],[],i)}_getRegistryForType(t){for(let e=0;ea.filter(c=>!l.some(u=>c.plugin.id===u.plugin.id));this._notify(r(e,i),t,"stop"),this._notify(r(i,e),t,"start")}}function X1(n){const t={},e=[],i=Object.keys(ze.plugins.items);for(let a=0;a1&&Tr(n[0].toLowerCase(),t),n))return n;throw new Error(`Cannot determine type of '${name}' axis. Please provide 'axis' or 'position' option.`)}function Q1(n,t){const e=Vn[n.type]||{scales:{}},i=t.scales||{},r=ka(n.type,t),a=Object.create(null);return Object.keys(i).forEach(l=>{const c=i[l];if(!rt(c))return console.error(`Invalid scale configuration for scale: ${l}`);if(c._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${l}`);const u=Tr(l,c),f=Z1(u,r),g=e.scales||{};a[l]=Yi(Object.create(null),[{axis:u},c,g[u],g[f]])}),n.data.datasets.forEach(l=>{const c=l.type||n.type,u=l.indexAxis||ka(c,t),g=(Vn[c]||{}).scales||{};Object.keys(g).forEach(p=>{const _=j1(p,u),y=l[_+"AxisID"]||_;a[y]=a[y]||Object.create(null),Yi(a[y],[{axis:_},i[y],g[p]])})}),Object.keys(a).forEach(l=>{const c=a[l];Yi(c,[Dt.scales[c.type],Dt.scale])}),a}function If(n){const t=n.options||(n.options={});t.plugins=Z(t.plugins,{}),t.scales=Q1(n,t)}function Ff(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function tw(n){return n=n||{},n.data=Ff(n.data),If(n),n}const mu=new Map,Bf=new Set;function ar(n,t){let e=mu.get(n);return e||(e=t(),mu.set(n,e),Bf.add(e)),e}const Wi=(n,t,e)=>{const i=bn(t,e);i!==void 0&&n.add(i)};class ew{constructor(t){this._config=tw(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=Ff(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(),If(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return ar(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return ar(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return ar(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return ar(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let r=i.get(t);return(!r||e)&&(r=new Map,i.set(t,r)),r}getOptionScopes(t,e,i){const{options:r,type:a}=this,l=this._cachedScopes(t,i),c=l.get(e);if(c)return c;const u=new Set;e.forEach(g=>{t&&(u.add(t),g.forEach(p=>Wi(u,t,p))),g.forEach(p=>Wi(u,r,p)),g.forEach(p=>Wi(u,Vn[a]||{},p)),g.forEach(p=>Wi(u,Dt,p)),g.forEach(p=>Wi(u,Ma,p))});const f=Array.from(u);return f.length===0&&f.push(Object.create(null)),Bf.has(e)&&l.set(e,f),f}chartOptionScopes(){const{options:t,type:e}=this;return[t,Vn[e]||{},Dt.datasets[e]||{},{type:e},Dt,Ma]}resolveNamedOptions(t,e,i,r=[""]){const a={$shared:!0},{resolver:l,subPrefixes:c}=_u(this._resolverCache,t,r);let u=l;if(iw(l,e)){a.$shared=!1,i=xn(i)?i():i;const f=this.createResolver(t,i,c);u=hi(l,i,f)}for(const f of e)a[f]=u[f];return a}createResolver(t,e,i=[""],r){const{resolver:a}=_u(this._resolverCache,t,i);return rt(e)?hi(a,e,void 0,r):a}}function _u(n,t,e){let i=n.get(t);i||(i=new Map,n.set(t,i));const r=e.join();let a=i.get(r);return a||(a={resolver:$a(t,e),subPrefixes:e.filter(c=>!c.toLowerCase().includes("hover"))},i.set(r,a)),a}const nw=n=>rt(n)&&Object.getOwnPropertyNames(n).reduce((t,e)=>t||xn(n[e]),!1);function iw(n,t){const{isScriptable:e,isIndexable:i}=pf(n);for(const r of t){const a=e(r),l=i(r),c=(l||a)&&n[r];if(a&&(xn(c)||nw(c))||l&&vt(c))return!0}return!1}var sw="4.2.1";const rw=["top","bottom","left","right","chartArea"];function bu(n,t){return n==="top"||n==="bottom"||rw.indexOf(n)===-1&&t==="x"}function xu(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function yu(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),xt(e&&e.onComplete,[n],t)}function ow(n){const t=n.chart,e=t.options.animation;xt(e&&e.onProgress,[n],t)}function zf(n){return vf()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const xr={},vu=n=>{const t=zf(n);return Object.values(xr).filter(e=>e.canvas===t).pop()};function aw(n,t,e){const i=Object.keys(n);for(const r of i){const a=+r;if(a>=t){const l=n[r];delete n[r],(e>0||a>t)&&(n[a+e]=l)}}}function lw(n,t,e,i){return!e||n.type==="mouseout"?null:i?t:n}function cw(n){const{xScale:t,yScale:e}=n;if(t&&e)return{left:t.left,right:t.right,top:e.top,bottom:e.bottom}}class zn{static register(...t){ze.add(...t),wu()}static unregister(...t){ze.remove(...t),wu()}constructor(t,e){const i=this.config=new ew(e),r=zf(t),a=vu(r);if(a)throw new Error("Canvas is already in use. Chart with ID '"+a.id+"' must be destroyed before the canvas with ID '"+a.canvas.id+"' can be reused.");const l=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||P1(r)),this.platform.updateConfig(i);const c=this.platform.acquireContext(r,l.aspectRatio),u=c&&c.canvas,f=u&&u.height,g=u&&u.width;if(this.id=fy(),this.ctx=c,this.canvas=u,this.width=g,this.height=f,this._options=l,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 Y1,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Cy(p=>this.update(p),l.resizeDelay||0),this._dataChanges=[],xr[this.id]=this,!c||!u){console.error("Failed to create chart: can't acquire context from the given item");return}Ze.listen(this,"complete",yu),Ze.listen(this,"progress",ow),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:r,_aspectRatio:a}=this;return lt(t)?e&&a?a:r?i/r: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 ze}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Yh(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Vh(this.canvas,this.ctx),this}stop(){return Ze.stop(this),this}resize(t,e){Ze.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,r=this.canvas,a=i.maintainAspectRatio&&this.aspectRatio,l=this.platform.getMaximumSize(r,t,e,a),c=i.devicePixelRatio||this.platform.getDevicePixelRatio(),u=this.width?"resize":"attach";this.width=l.width,this.height=l.height,this._aspectRatio=this.aspectRatio,Yh(this,c,!0)&&(this.notifyPlugins("resize",{size:l}),xt(i.onResize,[this,l],this),this.attached&&this._doResize(u)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};pt(e,(i,r)=>{i.id=r})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,r=Object.keys(i).reduce((l,c)=>(l[c]=!1,l),{});let a=[];e&&(a=a.concat(Object.keys(e).map(l=>{const c=e[l],u=Tr(l,c),f=u==="r",g=u==="x";return{options:c,dposition:f?"chartArea":g?"bottom":"left",dtype:f?"radialLinear":g?"category":"linear"}}))),pt(a,l=>{const c=l.options,u=c.id,f=Tr(u,c),g=Z(c.type,l.dtype);(c.position===void 0||bu(c.position,f)!==bu(l.dposition))&&(c.position=l.dposition),r[u]=!0;let p=null;if(u in i&&i[u].type===g)p=i[u];else{const _=ze.getScale(g);p=new _({id:u,type:g,ctx:this.ctx,chart:this}),i[p.id]=p}p.init(c,t)}),pt(r,(l,c)=>{l||delete i[c]}),pt(i,l=>{Xt.configure(this,l,l.options),Xt.addBox(this,l)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((r,a)=>r.index-a.index),i>e){for(let r=e;re.length&&delete this._stacks,t.forEach((i,r)=>{e.filter(a=>a===i._dataset).length===0&&this._destroyDatasetMeta(r)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,r;for(this._removeUnreferencedMetasets(),i=0,r=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()),r=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const a=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let l=0;for(let f=0,g=this.data.datasets.length;f{f.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(xu("z","_idx"));const{_active:c,_lastEvent:u}=this;u?this._eventHandler(u,!0):c.length&&this._updateHoverStyles(c,c,!0),this.render()}_updateScales(){pt(this.scales,t=>{Xt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Rh(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:r,count:a}of e){const l=i==="_removeElements"?-a:a;aw(t,r,l)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=a=>new Set(t.filter(l=>l[0]===a).map((l,c)=>c+","+l.splice(1).join(","))),r=i(0);for(let a=1;aa.split(",")).map(a=>({method:a[1],start:+a[2],count:+a[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Xt.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],pt(this.boxes,r=>{i&&r.position==="chartArea"||(r.configure&&r.configure(),this._layers.push(...r._layers()))},this),this._layers.forEach((r,a)=>{r._idx=a}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,i=this.data.datasets.length;e=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,r=!i.disabled,a=cw(t)||this.chartArea,l={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",l)!==!1&&(r&&Rr(e,{left:i.left===!1?0:a.left-i.left,right:i.right===!1?this.width:a.right+i.right,top:i.top===!1?0:a.top-i.top,bottom:i.bottom===!1?this.height:a.bottom+i.bottom}),t.controller.draw(),r&&Er(e),l.cancelable=!1,this.notifyPlugins("afterDatasetDraw",l))}isPointInArea(t){return Qi(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,r){const a=o1.modes[e];return typeof a=="function"?a(this,t,i,r):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let r=i.filter(a=>a&&a._dataset===e).pop();return r||(r={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(r)),r}getContext(){return this.$context||(this.$context=yn(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 typeof i.hidden=="boolean"?!i.hidden:!e.hidden}setDatasetVisibility(t,e){const i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const r=i?"show":"hide",a=this.getDatasetMeta(t),l=a.controller._resolveAnimations(void 0,r);we(e)?(a.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),l.update(a,{visible:i}),this.update(c=>c.datasetIndex===t?r: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(),Ze.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,a,l),t[a]=l},r=(a,l,c)=>{a.offsetX=l,a.offsetY=c,this._eventHandler(a)};pt(this.options.events,a=>i(a,r))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(u,f)=>{e.addEventListener(this,u,f),t[u]=f},r=(u,f)=>{t[u]&&(e.removeEventListener(this,u,f),delete t[u])},a=(u,f)=>{this.canvas&&this.resize(u,f)};let l;const c=()=>{r("attach",c),this.attached=!0,this.resize(),i("resize",a),i("detach",l)};l=()=>{this.attached=!1,r("resize",a),this._stop(),this._resize(0,0),i("attach",c)},e.isAttached(this.canvas)?c():l()}unbindEvents(){pt(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},pt(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const r=i?"set":"remove";let a,l,c,u;for(e==="dataset"&&(a=this.getDatasetMeta(t[0].datasetIndex),a.controller["_"+r+"DatasetHoverStyle"]()),c=0,u=t.length;c{const c=this.getDatasetMeta(a);if(!c)throw new Error("No dataset found at index "+a);return{datasetIndex:a,element:c.data[l],index:l}});!Mr(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 this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,i){const r=this.options.hover,a=(u,f)=>u.filter(g=>!f.some(p=>g.datasetIndex===p.datasetIndex&&g.index===p.index)),l=a(e,t),c=i?t:a(t,e);l.length&&this.updateHoverStyle(l,r.mode,!1),c.length&&r.mode&&this.updateHoverStyle(c,r.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},r=l=>(l.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,r)===!1)return;const a=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,r),(a||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:r=[],options:a}=this,l=e,c=this._getActiveElements(t,r,i,l),u=by(t),f=lw(t,this._lastEvent,i,u);i&&(this._lastEvent=null,xt(a.onHover,[t,c,this],this),u&&xt(a.onClick,[t,c,this],this));const g=!Mr(c,r);return(g||e)&&(this._active=c,this._updateHoverStyles(c,r,e)),this._lastEvent=f,g}_getActiveElements(t,e,i,r){if(t.type==="mouseout")return[];if(!i)return e;const a=this.options.hover;return this.getElementsAtEventForMode(t,a.mode,a,r)}}U(zn,"defaults",Dt),U(zn,"instances",xr),U(zn,"overrides",Vn),U(zn,"registry",ze),U(zn,"version",sw),U(zn,"getChart",vu);function wu(){return pt(zn.instances,n=>n._plugins.invalidate())}function hw(n,t,e){const{startAngle:i,pixelMargin:r,x:a,y:l,outerRadius:c,innerRadius:u}=t;let f=r/c;n.beginPath(),n.arc(a,l,c,i-f,e+f),u>r?(f=r/u,n.arc(a,l,u,e+f,i-f,!0)):n.arc(a,l,r,e+Ct,i-Ct),n.closePath(),n.clip()}function uw(n){return Ua(n,["outerStart","outerEnd","innerStart","innerEnd"])}function fw(n,t,e,i){const r=uw(n.options.borderRadius),a=(e-t)/2,l=Math.min(a,i*t/2),c=u=>{const f=(e-Math.min(a,u))*i/2;return Wt(u,0,Math.min(a,f))};return{outerStart:c(r.outerStart),outerEnd:c(r.outerEnd),innerStart:Wt(r.innerStart,0,l),innerEnd:Wt(r.innerEnd,0,l)}}function ai(n,t,e,i){return{x:e+n*Math.cos(t),y:i+n*Math.sin(t)}}function Or(n,t,e,i,r,a){const{x:l,y:c,startAngle:u,pixelMargin:f,innerRadius:g}=t,p=Math.max(t.outerRadius+i+e-f,0),_=g>0?g+i+e+f:0;let y=0;const w=r-u;if(i){const ht=g>0?g-i:0,_t=p>0?p-i:0,dt=(ht+_t)/2,Lt=dt!==0?w*dt/(dt+i):w;y=(w-Lt)/2}const M=Math.max(.001,w*p-e/St)/p,A=(w-M)/2,C=u+A+y,O=r-A-y,{outerStart:I,outerEnd:F,innerStart:L,innerEnd:W}=fw(t,_,p,O-C),z=p-I,N=p-F,Y=C+I/z,J=O-F/N,Q=_+L,at=_+W,Rt=C+L/Q,Vt=O-W/at;if(n.beginPath(),a){const ht=(Y+J)/2;if(n.arc(l,c,p,Y,ht),n.arc(l,c,p,ht,J),F>0){const Bt=ai(N,J,l,c);n.arc(Bt.x,Bt.y,F,J,O+Ct)}const _t=ai(at,O,l,c);if(n.lineTo(_t.x,_t.y),W>0){const Bt=ai(at,Vt,l,c);n.arc(Bt.x,Bt.y,W,O+Ct,Vt+Math.PI)}const dt=(O-W/_+(C+L/_))/2;if(n.arc(l,c,_,O-W/_,dt,!0),n.arc(l,c,_,dt,C+L/_,!0),L>0){const Bt=ai(Q,Rt,l,c);n.arc(Bt.x,Bt.y,L,Rt+Math.PI,C-Ct)}const Lt=ai(z,C,l,c);if(n.lineTo(Lt.x,Lt.y),I>0){const Bt=ai(z,Y,l,c);n.arc(Bt.x,Bt.y,I,C-Ct,Y)}}else{n.moveTo(l,c);const ht=Math.cos(Y)*p+l,_t=Math.sin(Y)*p+c;n.lineTo(ht,_t);const dt=Math.cos(J)*p+l,Lt=Math.sin(J)*p+c;n.lineTo(dt,Lt)}n.closePath()}function dw(n,t,e,i,r){const{fullCircles:a,startAngle:l,circumference:c}=t;let u=t.endAngle;if(a){Or(n,t,e,i,u,r);for(let f=0;f=wt||Ji(a,c,u),M=tn(l,f+_,g+_);return w&&M}getCenterPoint(t){const{x:e,y:i,startAngle:r,endAngle:a,innerRadius:l,outerRadius:c}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:u,spacing:f}=this.options,g=(r+a)/2,p=(l+c+f+u)/2;return{x:e+Math.cos(g)*p,y:i+Math.sin(g)*p}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,r=(e.offset||0)/4,a=(e.spacing||0)/2,l=e.circular;if(this.pixelMargin=e.borderAlign==="inner"?.33:0,this.fullCircles=i>wt?Math.floor(i/wt):0,i===0||this.innerRadius<0||this.outerRadius<0)return;t.save();const c=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(c)*r,Math.sin(c)*r);const u=1-Math.sin(Math.min(St,i||0)),f=r*u;t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,dw(t,this,f,a,l),gw(t,this,f,a,l),t.restore()}}U(yr,"id","arc"),U(yr,"defaults",{borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),U(yr,"defaultRoutes",{backgroundColor:"backgroundColor"});function Wf(n,t,e=t){n.lineCap=Z(e.borderCapStyle,t.borderCapStyle),n.setLineDash(Z(e.borderDash,t.borderDash)),n.lineDashOffset=Z(e.borderDashOffset,t.borderDashOffset),n.lineJoin=Z(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=Z(e.borderWidth,t.borderWidth),n.strokeStyle=Z(e.borderColor,t.borderColor)}function pw(n,t,e){n.lineTo(e.x,e.y)}function mw(n){return n.stepped?Ny:n.tension||n.cubicInterpolationMode==="monotone"?Hy:pw}function Nf(n,t,e={}){const i=n.length,{start:r=0,end:a=i-1}=e,{start:l,end:c}=t,u=Math.max(r,l),f=Math.min(a,c),g=rc&&a>c;return{count:i,start:u,loop:t.loop,ilen:f(l+(f?c-F:F))%a,I=()=>{M!==A&&(n.lineTo(g,A),n.lineTo(g,M),n.lineTo(g,C))};for(u&&(y=r[O(0)],n.moveTo(y.x,y.y)),_=0;_<=c;++_){if(y=r[O(_)],y.skip)continue;const F=y.x,L=y.y,W=F|0;W===w?(LA&&(A=L),g=(p*g+F)/++p):(I(),n.lineTo(F,L),w=W,p=0,M=A=L),C=L}I()}function Pa(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?bw:_w}function xw(n){return n.stepped?xv:n.tension||n.cubicInterpolationMode==="monotone"?yv:Bn}function yw(n,t,e,i){let r=t._path;r||(r=t._path=new Path2D,t.path(r,e,i)&&r.closePath()),Wf(n,t.options),n.stroke(r)}function vw(n,t,e,i){const{segments:r,options:a}=t,l=Pa(t);for(const c of r)Wf(n,a,c.style),n.beginPath(),l(n,t,c,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}const ww=typeof Path2D=="function";function Mw(n,t,e,i){ww&&!t.options.segment?yw(n,t,e,i):vw(n,t,e,i)}class pn extends Le{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||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const r=i.spanGaps?this._loop:this._fullLoop;uv(this._points,i,t,r,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=kv(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,r=t[e],a=this.points,l=kf(this,{property:e,start:r,end:r});if(!l.length)return;const c=[],u=xw(i);let f,g;for(f=0,g=l.length;ft!=="borderDash"&&t!=="fill"});function Mu(n,t,e,i){const r=n.options,{[e]:a}=n.getProps([e],i);return Math.abs(t-a)n.replace("rgb(","rgba(").replace(")",", 0.5)"));function Vf(n){return Ca[n%Ca.length]}function Uf(n){return Su[n%Su.length]}function Ow(n,t){return n.borderColor=Vf(t),n.backgroundColor=Uf(t),++t}function Dw(n,t){return n.backgroundColor=n.data.map(()=>Vf(t++)),t}function Lw(n,t){return n.backgroundColor=n.data.map(()=>Uf(t++)),t}function Rw(n){let t=0;return(e,i)=>{const r=n.getDatasetMeta(i).controller;r instanceof Wn?t=Dw(e,t):r instanceof qi?t=Lw(e,t):r&&(t=Ow(e,t))}}function Au(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function Ew(n){return n&&(n.borderColor||n.backgroundColor)}var Iw={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(n,t,e){if(!e.enabled)return;const{data:{datasets:i},options:r}=n.config,{elements:a}=r;if(!e.forceOverride&&(Au(i)||Ew(r)||a&&Au(a)))return;const l=Rw(n);i.forEach(l)}};function Fw(n,t,e,i,r){const a=r.samples||i;if(a>=e)return n.slice(t,t+e);const l=[],c=(e-2)/(a-2);let u=0;const f=t+e-1;let g=t,p,_,y,w,M;for(l[u++]=n[g],p=0;py&&(y=w,_=n[O],M=O);l[u++]=_,g=M}return l[u++]=n[f],l}function Bw(n,t,e,i){let r=0,a=0,l,c,u,f,g,p,_,y,w,M;const A=[],C=t+e-1,O=n[t].x,F=n[C].x-O;for(l=t;lM&&(M=f,_=l),r=(a*r+c.x)/++a;else{const W=l-1;if(!lt(p)&&!lt(_)){const z=Math.min(p,_),N=Math.max(p,_);z!==y&&z!==W&&A.push({...n[z],x:r}),N!==y&&N!==W&&A.push({...n[N],x:r})}l>0&&W!==y&&A.push(n[W]),A.push(c),g=L,a=0,w=M=f,p=_=y=l}}return A}function $f(n){if(n._decimated){const t=n._data;delete n._decimated,delete n._data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function ku(n){n.data.datasets.forEach(t=>{$f(t)})}function zw(n,t){const e=t.length;let i=0,r;const{iScale:a}=n,{min:l,max:c,minDefined:u,maxDefined:f}=a.getUserBounds();return u&&(i=Wt(en(t,a.axis,l).lo,0,e-1)),f?r=Wt(en(t,a.axis,c).hi+1,i,e)-i:r=e-i,{start:i,count:r}}var Ww={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){ku(n);return}const i=n.width;n.data.datasets.forEach((r,a)=>{const{_data:l,indexAxis:c}=r,u=n.getDatasetMeta(a),f=l||r.data;if(Hi([c,n.options.indexAxis])==="y"||!u.controller.supportsDecimation)return;const g=n.scales[u.xAxisID];if(g.type!=="linear"&&g.type!=="time"||n.options.parsing)return;let{start:p,count:_}=zw(u,f);const y=e.threshold||4*i;if(_<=y){$f(r);return}lt(l)&&(r._data=f,delete r.data,Object.defineProperty(r,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(M){this._data=M}}));let w;switch(e.algorithm){case"lttb":w=Fw(f,p,_,i,e);break;case"min-max":w=Bw(f,p,_,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}r._decimated=w})},destroy(n){ku(n)}};function Nw(n,t,e){const i=n.segments,r=n.points,a=t.points,l=[];for(const c of i){let{start:u,end:f}=c;f=qa(u,f,r);const g=Ta(e,r[u],r[f],c.loop);if(!t.segments){l.push({source:c,target:g,start:r[u],end:r[f]});continue}const p=kf(t,g);for(const _ of p){const y=Ta(e,a[_.start],a[_.end],_.loop),w=Af(c,r,y);for(const M of w)l.push({source:M,target:_,start:{[e]:Pu(g,y,"start",Math.max)},end:{[e]:Pu(g,y,"end",Math.min)}})}}return l}function Ta(n,t,e,i){if(i)return;let r=t[n],a=e[n];return n==="angle"&&(r=ue(r),a=ue(a)),{property:n,start:r,end:a}}function Hw(n,t){const{x:e=null,y:i=null}=n||{},r=t.points,a=[];return t.segments.forEach(({start:l,end:c})=>{c=qa(l,c,r);const u=r[l],f=r[c];i!==null?(a.push({x:u.x,y:i}),a.push({x:f.x,y:i})):e!==null&&(a.push({x:e,y:u.y}),a.push({x:e,y:f.y}))}),a}function qa(n,t,e){for(;t>n;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function Pu(n,t,e,i){return n&&t?i(n[e],t[e]):n?n[e]:t?t[e]:0}function Yf(n,t){let e=[],i=!1;return vt(n)?(i=!0,e=n):e=Hw(n,t),e.length?new pn({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function Cu(n){return n&&n.fill!==!1}function Vw(n,t,e){let r=n[t].fill;const a=[t];let l;if(!e)return r;for(;r!==!1&&a.indexOf(r)===-1;){if(!Pt(r))return r;if(l=n[r],!l)return!1;if(l.visible)return r;a.push(r),r=l.fill}return!1}function Uw(n,t,e){const i=Gw(n);if(rt(i))return isNaN(i.value)?!1:i;let r=parseFloat(i);return Pt(r)&&Math.floor(r)===r?$w(i[0],t,r,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function $w(n,t,e,i){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function Yw(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:rt(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function Xw(n,t,e){let i;return n==="start"?i=e:n==="end"?i=t.options.reverse?t.min:t.max:rt(n)?i=n.value:i=t.getBaseValue(),i}function Gw(n){const t=n.options,e=t.fill;let i=Z(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function Kw(n){const{scale:t,index:e,line:i}=n,r=[],a=i.segments,l=i.points,c=qw(t,e);c.push(Yf({x:null,y:t.bottom},i));for(let u=0;u=0;--l){const c=r[l].$filler;c&&(c.line.updateControlPoints(a,c.axis),i&&c.fill&&_a(n.ctx,c,a))}},beforeDatasetsDraw(n,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let r=i.length-1;r>=0;--r){const a=i[r].$filler;Cu(a)&&_a(n.ctx,a,n.chartArea)}},beforeDatasetDraw(n,t,e){const i=t.meta.$filler;!Cu(i)||e.drawTime!=="beforeDatasetDraw"||_a(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Lu=(n,t)=>{let{boxHeight:e=t,boxWidth:i=t}=n;return n.usePointStyle&&(e=Math.min(e,t),i=n.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:e,itemHeight:Math.max(t,e)}},oM=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class Ru extends Le{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=xt(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(i=>t.filter(i,this.chart.data))),t.sort&&(e=e.sort((i,r)=>t.sort(i,r,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const i=t.labels,r=Ft(i.font),a=r.size,l=this._computeTitleHeight(),{boxWidth:c,itemHeight:u}=Lu(i,a);let f,g;e.font=r.string,this.isHorizontal()?(f=this.maxWidth,g=this._fitRows(l,a,c,u)+10):(g=this.maxHeight,f=this._fitCols(l,r,c,u)+10),this.width=Math.min(f,t.maxWidth||this.maxWidth),this.height=Math.min(g,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,r){const{ctx:a,maxWidth:l,options:{labels:{padding:c}}}=this,u=this.legendHitBoxes=[],f=this.lineWidths=[0],g=r+c;let p=t;a.textAlign="left",a.textBaseline="middle";let _=-1,y=-g;return this.legendItems.forEach((w,M)=>{const A=i+e/2+a.measureText(w.text).width;(M===0||f[f.length-1]+A+2*c>l)&&(p+=g,f[f.length-(M>0?0:1)]=0,y+=g,_++),u[M]={left:0,top:y,row:_,width:A,height:r},f[f.length-1]+=A+c}),p}_fitCols(t,e,i,r){const{ctx:a,maxHeight:l,options:{labels:{padding:c}}}=this,u=this.legendHitBoxes=[],f=this.columnSizes=[],g=l-t;let p=c,_=0,y=0,w=0,M=0;return this.legendItems.forEach((A,C)=>{const{itemWidth:O,itemHeight:I}=aM(i,e,a,A,r);C>0&&y+I+2*c>g&&(p+=_+c,f.push({width:_,height:y}),w+=_+c,M++,_=y=0),u[C]={left:w,top:y,col:M,width:O,height:I},_=Math.max(_,O),y+=I+c}),p+=_,f.push({width:_,height:y}),p}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:r},rtl:a}}=this,l=li(a,this.left,this.width);if(this.isHorizontal()){let c=0,u=Yt(i,this.left+r,this.right-this.lineWidths[c]);for(const f of e)c!==f.row&&(c=f.row,u=Yt(i,this.left+r,this.right-this.lineWidths[c])),f.top+=this.top+t+r,f.left=l.leftForLtr(l.x(u),f.width),u+=f.width+r}else{let c=0,u=Yt(i,this.top+t+r,this.bottom-this.columnSizes[c].height);for(const f of e)f.col!==c&&(c=f.col,u=Yt(i,this.top+t+r,this.bottom-this.columnSizes[c].height)),f.top=u,f.left+=this.left+r,f.left=l.leftForLtr(l.x(f.left),f.width),u+=f.height+r}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Rr(t,this),this._draw(),Er(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:r}=this,{align:a,labels:l}=t,c=Dt.color,u=li(t.rtl,this.left,this.width),f=Ft(l.font),{padding:g}=l,p=f.size,_=p/2;let y;this.drawTitle(),r.textAlign=u.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=f.string;const{boxWidth:w,boxHeight:M,itemHeight:A}=Lu(l,p),C=function(W,z,N){if(isNaN(w)||w<=0||isNaN(M)||M<0)return;r.save();const Y=Z(N.lineWidth,1);if(r.fillStyle=Z(N.fillStyle,c),r.lineCap=Z(N.lineCap,"butt"),r.lineDashOffset=Z(N.lineDashOffset,0),r.lineJoin=Z(N.lineJoin,"miter"),r.lineWidth=Y,r.strokeStyle=Z(N.strokeStyle,c),r.setLineDash(Z(N.lineDash,[])),l.usePointStyle){const J={radius:M*Math.SQRT2/2,pointStyle:N.pointStyle,rotation:N.rotation,borderWidth:Y},Q=u.xPlus(W,w/2),at=z+_;df(r,J,Q,at,l.pointStyleWidth&&w)}else{const J=z+Math.max((p-M)/2,0),Q=u.leftForLtr(W,w),at=Nn(N.borderRadius);r.beginPath(),Object.values(at).some(Rt=>Rt!==0)?ts(r,{x:Q,y:J,w,h:M,radius:at}):r.rect(Q,J,w,M),r.fill(),Y!==0&&r.stroke()}r.restore()},O=function(W,z,N){Un(r,N.text,W,z+A/2,f,{strikethrough:N.hidden,textAlign:u.textAlign(N.textAlign)})},I=this.isHorizontal(),F=this._computeTitleHeight();I?y={x:Yt(a,this.left+g,this.right-i[0]),y:this.top+g+F,line:0}:y={x:this.left+g,y:Yt(a,this.top+F+g,this.bottom-e[0].height),line:0},wf(this.ctx,t.textDirection);const L=A+g;this.legendItems.forEach((W,z)=>{r.strokeStyle=W.fontColor,r.fillStyle=W.fontColor;const N=r.measureText(W.text).width,Y=u.textAlign(W.textAlign||(W.textAlign=l.textAlign)),J=w+_+N;let Q=y.x,at=y.y;u.setWidth(this.width),I?z>0&&Q+J+g>this.right&&(at=y.y+=L,y.line++,Q=y.x=Yt(a,this.left+g,this.right-i[y.line])):z>0&&at+L>this.bottom&&(Q=y.x=Q+e[y.line].width+g,y.line++,at=y.y=Yt(a,this.top+F+g,this.bottom-e[y.line].height));const Rt=u.x(Q);if(C(Rt,at,W),Q=Ty(Y,Q+w+_,I?Q+J:this.right,t.rtl),O(u.x(Q),at,W),I)y.x+=J+g;else if(typeof W.text!="string"){const Vt=f.lineHeight;y.y+=Gf(W,Vt)}else y.y+=L}),Mf(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=Ft(e.font),r=Gt(e.padding);if(!e.display)return;const a=li(t.rtl,this.left,this.width),l=this.ctx,c=e.position,u=i.size/2,f=r.top+u;let g,p=this.left,_=this.width;if(this.isHorizontal())_=Math.max(...this.lineWidths),g=this.top+f,p=Yt(t.align,p,this.right-_);else{const w=this.columnSizes.reduce((M,A)=>Math.max(M,A.height),0);g=f+Yt(t.align,this.top,this.bottom-w-t.labels.padding-this._computeTitleHeight())}const y=Yt(c,p,p+_);l.textAlign=a.textAlign(Va(c)),l.textBaseline="middle",l.strokeStyle=e.color,l.fillStyle=e.color,l.font=i.string,Un(l,e.text,y,g,i)}_computeTitleHeight(){const t=this.options.title,e=Ft(t.font),i=Gt(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,r,a;if(tn(t,this.left,this.right)&&tn(e,this.top,this.bottom)){for(a=this.legendHitBoxes,i=0;ia.length>l.length?a:l)),t+e.size/2+i.measureText(r).width}function cM(n,t,e){let i=n;return typeof t.text!="string"&&(i=Gf(t,e)),i}function Gf(n,t){const e=n.text?n.text.length+.5:0;return t*e}function hM(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var uM={id:"legend",_element:Ru,start(n,t,e){const i=n.legend=new Ru({ctx:n.ctx,options:e,chart:n});Xt.configure(n,i,e),Xt.addBox(n,i)},stop(n){Xt.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const i=n.legend;Xt.configure(n,i,e),i.options=e},afterUpdate(n){const t=n.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(n,t){t.replay||n.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(n,t,e){const i=t.datasetIndex,r=e.chart;r.isDatasetVisible(i)?(r.hide(i),t.hidden=!0):(r.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:n=>n.chart.options.color,boxWidth:40,padding:10,generateLabels(n){const t=n.data.datasets,{labels:{usePointStyle:e,pointStyle:i,textAlign:r,color:a,useBorderRadius:l,borderRadius:c}}=n.legend.options;return n._getSortedDatasetMetas().map(u=>{const f=u.controller.getStyle(e?0:void 0),g=Gt(f.borderWidth);return{text:t[u.index].label,fillStyle:f.backgroundColor,fontColor:a,hidden:!u.visible,lineCap:f.borderCapStyle,lineDash:f.borderDash,lineDashOffset:f.borderDashOffset,lineJoin:f.borderJoinStyle,lineWidth:(g.width+g.height)/4,strokeStyle:f.borderColor,pointStyle:i||f.pointStyle,rotation:f.rotation,textAlign:r||f.textAlign,borderRadius:l&&(c||f.borderRadius),datasetIndex:u.index}},this)}},title:{color:n=>n.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:n=>!n.startsWith("on"),labels:{_scriptable:n=>!["generateLabels","filter","sort"].includes(n)}}};class ja extends Le{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){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const r=vt(i.text)?i.text.length:1;this._padding=Gt(i.padding);const a=r*Ft(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=a:this.width=a}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:i,bottom:r,right:a,options:l}=this,c=l.align;let u=0,f,g,p;return this.isHorizontal()?(g=Yt(c,i,a),p=e+t,f=a-i):(l.position==="left"?(g=i+t,p=Yt(c,r,e),u=St*-.5):(g=a-t,p=Yt(c,e,r),u=St*.5),f=r-e),{titleX:g,titleY:p,maxWidth:f,rotation:u}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=Ft(e.font),a=i.lineHeight/2+this._padding.top,{titleX:l,titleY:c,maxWidth:u,rotation:f}=this._drawArgs(a);Un(t,e.text,0,0,i,{color:e.color,maxWidth:u,rotation:f,textAlign:Va(e.align),textBaseline:"middle",translation:[l,c]})}}function fM(n,t){const e=new ja({ctx:n.ctx,options:t,chart:n});Xt.configure(n,e,t),Xt.addBox(n,e),n.titleBlock=e}var dM={id:"title",_element:ja,start(n,t,e){fM(n,e)},stop(n){const t=n.titleBlock;Xt.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){const i=n.titleBlock;Xt.configure(n,i,e),i.options=e},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 lr=new WeakMap;var gM={id:"subtitle",start(n,t,e){const i=new ja({ctx:n.ctx,options:e,chart:n});Xt.configure(n,i,e),Xt.addBox(n,i),lr.set(n,i)},stop(n){Xt.removeBox(n,lr.get(n)),lr.delete(n)},beforeUpdate(n,t,e){const i=lr.get(n);Xt.configure(n,i,e),i.options=e},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 Ui={average(n){if(!n.length)return!1;let t,e,i=0,r=0,a=0;for(t=0,e=n.length;t-1?n.split(` `):n}function pM(n,t){const{element:e,datasetIndex:i,index:r}=t,a=n.getDatasetMeta(i).controller,{label:l,value:c}=a.getLabelAndValue(r);return{chart:n,label:l,parsed:a.getParsed(r),raw:n.data.datasets[i].data[r],formattedValue:c,dataset:a.getDataset(),dataIndex:r,datasetIndex:i,element:e}}function Eu(n,t){const e=n.chart.ctx,{body:i,footer:r,title:a}=n,{boxWidth:l,boxHeight:c}=t,u=Ft(t.bodyFont),f=Ft(t.titleFont),g=Ft(t.footerFont),p=a.length,_=r.length,y=i.length,w=Gt(t.padding);let M=w.height,A=0,C=i.reduce((F,L)=>F+L.before.length+L.lines.length+L.after.length,0);if(C+=n.beforeBody.length+n.afterBody.length,p&&(M+=p*f.lineHeight+(p-1)*t.titleSpacing+t.titleMarginBottom),C){const F=t.displayColors?Math.max(c,u.lineHeight):u.lineHeight;M+=y*F+(C-y)*u.lineHeight+(C-1)*t.bodySpacing}_&&(M+=t.footerMarginTop+_*g.lineHeight+(_-1)*t.footerSpacing);let O=0;const I=function(F){A=Math.max(A,e.measureText(F).width+O)};return e.save(),e.font=f.string,pt(n.title,I),e.font=u.string,pt(n.beforeBody.concat(n.afterBody),I),O=t.displayColors?l+2+t.boxPadding:0,pt(i,F=>{pt(F.before,I),pt(F.lines,I),pt(F.after,I)}),O=0,e.font=g.string,pt(n.footer,I),e.restore(),A+=w.width,{width:A,height:M}}function mM(n,t){const{y:e,height:i}=t;return en.height-i/2?"bottom":"center"}function _M(n,t,e,i){const{x:r,width:a}=i,l=e.caretSize+e.caretPadding;if(n==="left"&&r+a+l>t.width||n==="right"&&r-a-l<0)return!0}function bM(n,t,e,i){const{x:r,width:a}=e,{width:l,chartArea:{left:c,right:u}}=n;let f="center";return i==="center"?f=r<=(c+u)/2?"left":"right":r<=a/2?f="left":r>=l-a/2&&(f="right"),_M(f,n,t,e)&&(f="center"),f}function Iu(n,t,e){const i=e.yAlign||t.yAlign||mM(n,e);return{xAlign:e.xAlign||t.xAlign||bM(n,t,e,i),yAlign:i}}function xM(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function yM(n,t,e){let{y:i,height:r}=n;return t==="top"?i+=e:t==="bottom"?i-=r+e:i-=r/2,i}function Fu(n,t,e,i){const{caretSize:r,caretPadding:a,cornerRadius:l}=n,{xAlign:c,yAlign:u}=e,f=r+a,{topLeft:g,topRight:p,bottomLeft:_,bottomRight:y}=Nn(l);let w=xM(t,c);const M=yM(t,u,f);return u==="center"?c==="left"?w+=f:c==="right"&&(w-=f):c==="left"?w-=Math.max(g,_)+r:c==="right"&&(w+=Math.max(p,y)+r),{x:Wt(w,0,i.width-t.width),y:Wt(M,0,i.height-t.height)}}function cr(n,t,e){const i=Gt(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function Bu(n){return Be([],Je(n))}function vM(n,t,e){return yn(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function zu(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const Kf={beforeTitle:je,title(n){if(n.length>0){const t=n[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex"u"?Kf[t].call(e,i):r}class Oa extends Le{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),r=i.enabled&&e.options.animation&&i.animations,a=new Pf(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(a)),a}getContext(){return this.$context||(this.$context=vM(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,r=ne(i,"beforeTitle",this,t),a=ne(i,"title",this,t),l=ne(i,"afterTitle",this,t);let c=[];return c=Be(c,Je(r)),c=Be(c,Je(a)),c=Be(c,Je(l)),c}getBeforeBody(t,e){return Bu(ne(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,r=[];return pt(t,a=>{const l={before:[],lines:[],after:[]},c=zu(i,a);Be(l.before,Je(ne(c,"beforeLabel",this,a))),Be(l.lines,ne(c,"label",this,a)),Be(l.after,Je(ne(c,"afterLabel",this,a))),r.push(l)}),r}getAfterBody(t,e){return Bu(ne(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,r=ne(i,"beforeFooter",this,t),a=ne(i,"footer",this,t),l=ne(i,"afterFooter",this,t);let c=[];return c=Be(c,Je(r)),c=Be(c,Je(a)),c=Be(c,Je(l)),c}_createItems(t){const e=this._active,i=this.chart.data,r=[],a=[],l=[];let c=[],u,f;for(u=0,f=e.length;ut.filter(g,p,_,i))),t.itemSort&&(c=c.sort((g,p)=>t.itemSort(g,p,i))),pt(c,g=>{const p=zu(t.callbacks,g);r.push(ne(p,"labelColor",this,g)),a.push(ne(p,"labelPointStyle",this,g)),l.push(ne(p,"labelTextColor",this,g))}),this.labelColors=r,this.labelPointStyles=a,this.labelTextColors=l,this.dataPoints=c,c}update(t,e){const i=this.options.setContext(this.getContext()),r=this._active;let a,l=[];if(!r.length)this.opacity!==0&&(a={opacity:0});else{const c=Ui[i.position].call(this,r,this._eventPosition);l=this._createItems(i),this.title=this.getTitle(l,i),this.beforeBody=this.getBeforeBody(l,i),this.body=this.getBody(l,i),this.afterBody=this.getAfterBody(l,i),this.footer=this.getFooter(l,i);const u=this._size=Eu(this,i),f=Object.assign({},c,u),g=Iu(this.chart,i,f),p=Fu(i,f,g,this.chart);this.xAlign=g.xAlign,this.yAlign=g.yAlign,a={opacity:1,x:p.x,y:p.y,width:u.width,height:u.height,caretX:c.x,caretY:c.y}}this._tooltipItems=l,this.$context=void 0,a&&this._resolveAnimations().update(this,a),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,r){const a=this.getCaretPosition(t,i,r);e.lineTo(a.x1,a.y1),e.lineTo(a.x2,a.y2),e.lineTo(a.x3,a.y3)}getCaretPosition(t,e,i){const{xAlign:r,yAlign:a}=this,{caretSize:l,cornerRadius:c}=i,{topLeft:u,topRight:f,bottomLeft:g,bottomRight:p}=Nn(c),{x:_,y}=t,{width:w,height:M}=e;let A,C,O,I,F,L;return a==="center"?(F=y+M/2,r==="left"?(A=_,C=A-l,I=F+l,L=F-l):(A=_+w,C=A+l,I=F-l,L=F+l),O=A):(r==="left"?C=_+Math.max(u,g)+l:r==="right"?C=_+w-Math.max(f,p)-l:C=this.caretX,a==="top"?(I=y,F=I-l,A=C-l,O=C+l):(I=y+M,F=I+l,A=C+l,O=C-l),L=I),{x1:A,x2:C,x3:O,y1:I,y2:F,y3:L}}drawTitle(t,e,i){const r=this.title,a=r.length;let l,c,u;if(a){const f=li(i.rtl,this.x,this.width);for(t.x=cr(this,i.titleAlign,i),e.textAlign=f.textAlign(i.titleAlign),e.textBaseline="middle",l=Ft(i.titleFont),c=i.titleSpacing,e.fillStyle=i.titleColor,e.font=l.string,u=0;uI!==0)?(t.beginPath(),t.fillStyle=a.multiKeyBackground,ts(t,{x:A,y:M,w:f,h:u,radius:O}),t.fill(),t.stroke(),t.fillStyle=l.backgroundColor,t.beginPath(),ts(t,{x:C,y:M+1,w:f-2,h:u-2,radius:O}),t.fill()):(t.fillStyle=a.multiKeyBackground,t.fillRect(A,M,f,u),t.strokeRect(A,M,f,u),t.fillStyle=l.backgroundColor,t.fillRect(C,M+1,f-2,u-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:r}=this,{bodySpacing:a,bodyAlign:l,displayColors:c,boxHeight:u,boxWidth:f,boxPadding:g}=i,p=Ft(i.bodyFont);let _=p.lineHeight,y=0;const w=li(i.rtl,this.x,this.width),M=function(N){e.fillText(N,w.x(t.x+y),t.y+_/2),t.y+=_+a},A=w.textAlign(l);let C,O,I,F,L,W,z;for(e.textAlign=l,e.textBaseline="middle",e.font=p.string,t.x=cr(this,A,i),e.fillStyle=i.bodyColor,pt(this.beforeBody,M),y=c&&A!=="right"?l==="center"?f/2+g:f+2+g:0,F=0,W=r.length;F0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,r=i&&i.x,a=i&&i.y;if(r||a){const l=Ui[t.position].call(this,this._active,this._eventPosition);if(!l)return;const c=this._size=Eu(this,t),u=Object.assign({},l,this._size),f=Iu(e,t,u),g=Fu(t,u,f,e);(r._to!==g.x||a._to!==g.y)&&(this.xAlign=f.xAlign,this.yAlign=f.yAlign,this.width=c.width,this.height=c.height,this.caretX=l.x,this.caretY=l.y,this._resolveAnimations().update(this,g))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const r={width:this.width,height:this.height},a={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const l=Gt(e.padding),c=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&c&&(t.save(),t.globalAlpha=i,this.drawBackground(a,t,r,e),wf(t,e.textDirection),a.y+=l.top,this.drawTitle(a,t,e),this.drawBody(a,t,e),this.drawFooter(a,t,e),Mf(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,r=t.map(({datasetIndex:c,index:u})=>{const f=this.chart.getDatasetMeta(c);if(!f)throw new Error("Cannot find a dataset at index "+c);return{datasetIndex:c,element:f.data[u],index:u}}),a=!Mr(i,r),l=this._positionChanged(r,e);(a||l)&&(this._active=r,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const r=this.options,a=this._active||[],l=this._getActiveElements(t,a,e,i),c=this._positionChanged(l,t),u=e||!Mr(l,a)||c;return u&&(this._active=l,(r.enabled||r.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),u}_getActiveElements(t,e,i,r){const a=this.options;if(t.type==="mouseout")return[];if(!r)return e;const l=this.chart.getElementsAtEventForMode(t,a.mode,a,i);return a.reverse&&l.reverse(),l}_positionChanged(t,e){const{caretX:i,caretY:r,options:a}=this,l=Ui[a.position].call(this,t,e);return l!==!1&&(i!==l.x||r!==l.y)}}U(Oa,"positioners",Ui);var wM={id:"tooltip",_element:Oa,positioners:Ui,afterInit(n,t,e){e&&(n.tooltip=new Oa({chart:n,options:e}))},beforeUpdate(n,t,e){n.tooltip&&n.tooltip.initialize(e)},reset(n,t,e){n.tooltip&&n.tooltip.initialize(e)},afterDraw(n){const t=n.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(n.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",e)}},afterEvent(n,t){if(n.tooltip){const e=t.replay;n.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,t)=>t.bodyFont.size,boxWidth:(n,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Kf},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},MM=Object.freeze({__proto__:null,Colors:Iw,Decimation:Ww,Filler:rM,Legend:uM,SubTitle:gM,Title:dM,Tooltip:wM});const SM=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function AM(n,t,e,i){const r=n.indexOf(t);if(r===-1)return SM(n,t,e,i);const a=n.lastIndexOf(t);return r!==a?e:r}const kM=(n,t)=>n===null?null:Wt(Math.round(n),0,t);function Wu(n){const t=this.getLabels();return n>=0&&ne.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}U(Da,"id","category"),U(Da,"defaults",{ticks:{callback:Wu}});function PM(n,t){const e=[],{bounds:r,step:a,min:l,max:c,precision:u,count:f,maxTicks:g,maxDigits:p,includeBounds:_}=n,y=a||1,w=g-1,{min:M,max:A}=t,C=!lt(l),O=!lt(c),I=!lt(f),F=(A-M)/(p+1);let L=Ih((A-M)/w/y)*y,W,z,N,Y;if(L<1e-14&&!C&&!O)return[{value:M},{value:A}];Y=Math.ceil(A/L)-Math.floor(M/L),Y>w&&(L=Ih(Y*L/w/y)*y),lt(u)||(W=Math.pow(10,u),L=Math.ceil(L*W)/W),r==="ticks"?(z=Math.floor(M/L)*L,N=Math.ceil(A/L)*L):(z=M,N=A),C&&O&&a&&wy((c-l)/a,L/1e3)?(Y=Math.round(Math.min((c-l)/L,g)),L=(c-l)/Y,z=l,N=c):I?(z=C?l:z,N=O?c:N,Y=f-1,L=(N-z)/Y):(Y=(N-z)/L,Xi(Y,Math.round(Y),L/1e3)?Y=Math.round(Y):Y=Math.ceil(Y));const J=Math.max(Fh(L),Fh(z));W=Math.pow(10,lt(u)?J:u),z=Math.round(z*W)/W,N=Math.round(N*W)/W;let Q=0;for(C&&(_&&z!==l?(e.push({value:l}),zr=e?r:u,c=u=>a=i?a:u;if(t){const u=We(r),f=We(a);u<0&&f<0?c(0):u>0&&f>0&&l(0)}if(r===a){let u=a===0?1:Math.abs(a*.05);c(a+u),t||l(r-u)}this.min=r,this.max=a}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:i}=t,r;return i?(r=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,r>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${r} ticks. Limiting to 1000.`),r=1e3)):(r=this.computeTickLimit(),e=e||11),e&&(r=Math.min(e,r)),r}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const r={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:e.includeBounds!==!1},a=this._range||this,l=PM(r,a);return t.bounds==="ticks"&&nf(l,this,"value"),t.reverse?(l.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),l}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const r=(i-e)/Math.max(t.length-1,1)/2;e-=r,i+=r}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return rs(t,this.chart.options.locale,this.options.ticks.format)}}class La extends Dr{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Pt(t)?t:0,this.max=Pt(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=Oe(this.options.ticks.minRotation),r=(t?Math.sin(i):Math.cos(i))||.001,a=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,a.lineHeight/r))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}U(La,"id","linear"),U(La,"defaults",{ticks:{callback:Lr.formatters.numeric}});const ns=n=>Math.floor(gn(n)),In=(n,t)=>Math.pow(10,ns(n)+t);function Hu(n){return n/Math.pow(10,ns(n))===1}function Vu(n,t,e){const i=Math.pow(10,e),r=Math.floor(n/i);return Math.ceil(t/i)-r}function CM(n,t){const e=t-n;let i=ns(e);for(;Vu(n,t,i)>10;)i++;for(;Vu(n,t,i)<10;)i--;return Math.min(i,ns(n))}function TM(n,{min:t,max:e}){t=he(n.min,t);const i=[],r=ns(t);let a=CM(t,e),l=a<0?Math.pow(10,Math.abs(a)):1;const c=Math.pow(10,a),u=r>a?Math.pow(10,r):0,f=Math.round((t-u)*l)/l,g=Math.floor((t-u)/c/10)*c*10;let p=Math.floor((f-g)/Math.pow(10,a)),_=he(n.min,Math.round((u+g+p*Math.pow(10,a))*l)/l);for(;_=10?p=p<15?15:20:p++,p>=20&&(a++,p=2,l=a>=0?1:l),_=Math.round((u+g+p*Math.pow(10,a))*l)/l;const y=he(n.max,_);return i.push({value:y,major:Hu(y),significand:p}),i}class Ra extends $n{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=Dr.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return Pt(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Pt(t)?Math.max(0,t):null,this.max=Pt(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Pt(this._userMin)&&(this.min=t===In(this.min,0)?In(this.min,-1):In(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,r=this.max;const a=c=>i=t?i:c,l=c=>r=e?r:c;i===r&&(i<=0?(a(1),l(10)):(a(In(i,-1)),l(In(r,1)))),i<=0&&a(In(r,-1)),r<=0&&l(In(i,1)),this.min=i,this.max=r}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=TM(e,this);return t.bounds==="ticks"&&nf(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":rs(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=gn(t),this._valueRange=gn(this.max)-gn(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(gn(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}U(Ra,"id","logarithmic"),U(Ra,"defaults",{ticks:{callback:Lr.formatters.logarithmic,major:{enabled:!0}}});function Ea(n){const t=n.ticks;if(t.display&&n.display){const e=Gt(t.backdropPadding);return Z(t.font&&t.font.size,Dt.font.size)+e.height}return 0}function OM(n,t,e){return e=vt(e)?e:[e],{w:Wy(n,t.string,e),h:e.length*t.lineHeight}}function Uu(n,t,e,i,r){return n===i||n===r?{start:t-e/2,end:t+e/2}:nr?{start:t-e,end:t}:{start:t,end:t+e}}function DM(n){const t={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},e=Object.assign({},t),i=[],r=[],a=n._pointLabels.length,l=n.options.pointLabels,c=l.centerPointLabels?St/a:0;for(let u=0;ut.r&&(c=(i.end-t.r)/a,n.r=Math.max(n.r,t.r+c)),r.startt.b&&(u=(r.end-t.b)/l,n.b=Math.max(n.b,t.b+u))}function RM(n,t,e){const i=[],r=n._pointLabels.length,a=n.options,l=Ea(a)/2,c=n.drawingArea,u=a.pointLabels.centerPointLabels?St/r:0;for(let f=0;f270||e<90)&&(n-=t),n}function BM(n,t){const{ctx:e,options:{pointLabels:i}}=n;for(let r=t-1;r>=0;r--){const a=i.setContext(n.getPointLabelContext(r)),l=Ft(a.font),{x:c,y:u,textAlign:f,left:g,top:p,right:_,bottom:y}=n._pointLabelItems[r],{backdropColor:w}=a;if(!lt(w)){const M=Nn(a.borderRadius),A=Gt(a.backdropPadding);e.fillStyle=w;const C=g-A.left,O=p-A.top,I=_-g+A.width,F=y-p+A.height;Object.values(M).some(L=>L!==0)?(e.beginPath(),ts(e,{x:C,y:O,w:I,h:F,radius:M}),e.fill()):e.fillRect(C,O,I,F)}Un(e,n._pointLabels[r],c,u+l.lineHeight/2,l,{color:a.color,textAlign:f,textBaseline:"middle"})}}function qf(n,t,e,i){const{ctx:r}=n;if(e)r.arc(n.xCenter,n.yCenter,t,0,wt);else{let a=n.getPointPosition(0,t);r.moveTo(a.x,a.y);for(let l=1;l{const r=xt(this.options.pointLabels.callback,[e,i],this);return r||r===0?r:""}).filter((e,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?DM(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,r){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,r))}getIndexAngle(t){const e=wt/(this._pointLabels.length||1),i=this.options.startAngle||0;return ue(t*e+Oe(i))}getDistanceFromCenterForValue(t){if(lt(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(lt(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{if(p!==0){u=this.getDistanceFromCenterForValue(g.value);const _=this.getContext(p),y=r.setContext(_),w=a.setContext(_);zM(this,y,u,l,w)}}),i.display){for(t.save(),c=l-1;c>=0;c--){const g=i.setContext(this.getPointLabelContext(c)),{color:p,lineWidth:_}=g;!_||!p||(t.lineWidth=_,t.strokeStyle=p,t.setLineDash(g.borderDash),t.lineDashOffset=g.borderDashOffset,u=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),f=this.getPointPosition(c,u),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(f.x,f.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const r=this.getIndexAngle(0);let a,l;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(r),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((c,u)=>{if(u===0&&!e.reverse)return;const f=i.setContext(this.getContext(u)),g=Ft(f.font);if(a=this.getDistanceFromCenterForValue(this.ticks[u].value),f.showLabelBackdrop){t.font=g.string,l=t.measureText(c.label).width,t.fillStyle=f.backdropColor;const p=Gt(f.backdropPadding);t.fillRect(-l/2-p.left,-a-g.size/2-p.top,l+p.width,g.size+p.height)}Un(t,c.label,0,-a,g,{color:f.color})}),t.restore()}drawTitle(){}}U($i,"id","radialLinear"),U($i,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Lr.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),U($i,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),U($i,"descriptors",{angleLines:{_fallback:"grid"}});const Fr={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}},ie=Object.keys(Fr);function NM(n,t){return n-t}function $u(n,t){if(lt(t))return null;const e=n._adapter,{parser:i,round:r,isoWeekday:a}=n._parseOpts;let l=t;return typeof i=="function"&&(l=i(l)),Pt(l)||(l=typeof i=="string"?e.parse(l,i):e.parse(l)),l===null?null:(r&&(l=r==="week"&&(ci(a)||a===!0)?e.startOf(l,"isoWeek",a):e.startOf(l,r)),+l)}function Yu(n,t,e,i){const r=ie.length;for(let a=ie.indexOf(n);a=ie.indexOf(e);a--){const l=ie[a];if(Fr[l].common&&n._adapter.diff(r,i,l)>=t-1)return l}return ie[e?ie.indexOf(e):0]}function VM(n){for(let t=ie.indexOf(n)+1,e=ie.length;t=t?e[i]:e[r];n[a]=!0}}function UM(n,t,e,i){const r=n._adapter,a=+r.startOf(t[0].value,i),l=t[t.length-1].value;let c,u;for(c=a;c<=l;c=+r.add(c,1,i))u=e[c],u>=0&&(t[u].major=!0);return t}function Gu(n,t,e){const i=[],r={},a=t.length;let l,c;for(l=0;l+t.value))}initOffsets(t=[]){let e=0,i=0,r,a;this.options.offset&&t.length&&(r=this.getDecimalForValue(t[0]),t.length===1?e=1-r:e=(this.getDecimalForValue(t[1])-r)/2,a=this.getDecimalForValue(t[t.length-1]),t.length===1?i=a:i=(a-this.getDecimalForValue(t[t.length-2]))/2);const l=t.length<3?.5:.25;e=Wt(e,0,l),i=Wt(i,0,l),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter,e=this.min,i=this.max,r=this.options,a=r.time,l=a.unit||Yu(a.minUnit,e,i,this._getLabelCapacity(e)),c=Z(r.ticks.stepSize,1),u=l==="week"?a.isoWeekday:!1,f=ci(u)||u===!0,g={};let p=e,_,y;if(f&&(p=+t.startOf(p,"isoWeek",u)),p=+t.startOf(p,f?"day":l),t.diff(i,e,l)>1e5*c)throw new Error(e+" and "+i+" are too far apart with stepSize of "+c+" "+l);const w=r.ticks.source==="data"&&this.getDataTimestamps();for(_=p,y=0;_M-A).map(M=>+M)}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 r=this.options.time.displayFormats,a=this._unit,l=e||r[a];return this._adapter.format(t,l)}_tickFormatFunction(t,e,i,r){const a=this.options,l=a.ticks.callback;if(l)return xt(l,[t,e,i],this);const c=a.time.displayFormats,u=this._unit,f=this._majorUnit,g=u&&c[u],p=f&&c[f],_=i[e],y=f&&p&&_&&_.major;return this._adapter.format(t,r||(y?p:g))}generateTickLabels(t){let e,i,r;for(e=0,i=t.length;e0?c:1}getDataTimestamps(){let t=this._cache.data||[],e,i;if(t.length)return t;const r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(e=0,i=r.length;e=n[i].pos&&t<=n[r].pos&&({lo:i,hi:r}=en(n,"pos",t)),{pos:a,time:c}=n[i],{pos:l,time:u}=n[r]):(t>=n[i].time&&t<=n[r].time&&({lo:i,hi:r}=en(n,"time",t)),{time:a,pos:c}=n[i],{time:l,pos:u}=n[r]);const f=l-a;return f?c+(u-c)*(t-a)/f:c}class Ia extends is{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=hr(e,this.min),this._tableRange=hr(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,r=[],a=[];let l,c,u,f,g;for(l=0,c=t.length;l=e&&f<=i&&r.push(f);if(r.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(l=0,c=r.length;l