homebridge-config-ui-x 5.12.1-beta.4 → 5.12.1-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +9 -9
- package/public/{chunk-Q3NZLPIF.js → chunk-2DRLNNDM.js} +1 -1
- package/public/{chunk-W2KCSDQF.js → chunk-2K66PSKD.js} +1 -1
- package/public/{chunk-U5MVAF2Z.js → chunk-2QSUQ4VI.js} +1 -1
- package/public/{chunk-YPN7FV6O.js → chunk-3LY5FRVV.js} +1 -1
- package/public/{chunk-ALOGQFKU.js → chunk-3N3RJBS3.js} +1 -1
- package/public/{chunk-T4UELVH7.js → chunk-4OEYZBSF.js} +1 -1
- package/public/{chunk-SHUCVS7I.js → chunk-4P4VAV7I.js} +1 -1
- package/public/{chunk-KQSZ6SGH.js → chunk-5QHRLSAE.js} +1 -1
- package/public/{chunk-TKVKJ7BH.js → chunk-664C4LX2.js} +1 -1
- package/public/{chunk-AMSZTHK7.js → chunk-6U3YEWBO.js} +1 -1
- package/public/{chunk-QNOVJEHS.js → chunk-A5JF6PDD.js} +1 -1
- package/public/{chunk-EQBPB35I.js → chunk-ATJM3XYR.js} +1 -1
- package/public/{chunk-STRIQHMU.js → chunk-AY35X64S.js} +1 -1
- package/public/{chunk-5GOLEPOT.js → chunk-BRGXDZZE.js} +1 -1
- package/public/{chunk-UOW2U4BJ.js → chunk-BZLBFDQG.js} +1 -1
- package/public/{chunk-A7OA7EDC.js → chunk-C5CMRH2U.js} +1 -1
- package/public/{chunk-A7MBTNVM.js → chunk-CAY6MDP6.js} +1 -1
- package/public/{chunk-DW4GVDBD.js → chunk-CP2QJXVO.js} +1 -1
- package/public/{chunk-SH2LIQC2.js → chunk-FH62LNHX.js} +1 -1
- package/public/{chunk-M5HSZY2K.js → chunk-GDBXX4WT.js} +1 -1
- package/public/{chunk-7SWRANGJ.js → chunk-H2UKSDHZ.js} +1 -1
- package/public/{chunk-AJNVPC3P.js → chunk-JBILFYTL.js} +1 -1
- package/public/{chunk-UUTQE5VH.js → chunk-JPAZUSRO.js} +1 -1
- package/public/{chunk-D4MLVPZP.js → chunk-KIFEAONI.js} +1 -1
- package/public/{chunk-AUCDLTKK.js → chunk-M3DSUNBG.js} +1 -1
- package/public/{chunk-IL3A5BIS.js → chunk-MAJDTCMY.js} +1 -1
- package/public/{chunk-UP6OS2GK.js → chunk-MVT3BOGV.js} +1 -1
- package/public/{chunk-TTY6CFWI.js → chunk-NPMJGEDY.js} +1 -1
- package/public/{chunk-KCDMHC2Q.js → chunk-NYEZF6Y3.js} +1 -1
- package/public/{chunk-LF27VVUY.js → chunk-RMDVYT7X.js} +1 -1
- package/public/{chunk-V2JVDEX6.js → chunk-RWABUVQY.js} +1 -1
- package/public/{chunk-4G3SMV26.js → chunk-S2GJNEOI.js} +1 -1
- package/public/{chunk-EFYVUQZK.js → chunk-TV5ACJCB.js} +1 -1
- package/public/{chunk-CH4W3VJQ.js → chunk-UH3C2FAE.js} +1 -1
- package/public/{chunk-LMPJJK5P.js → chunk-VFMCVZHO.js} +1 -1
- package/public/{chunk-FHRZH5HG.js → chunk-VV4S6PBO.js} +1 -1
- package/public/{chunk-B23NNBW7.js → chunk-VWUZDCBZ.js} +1 -1
- package/public/{chunk-WE4CGPHP.js → chunk-WGTVNYII.js} +1 -1
- package/public/{chunk-Y7OC2MBV.js → chunk-XUP37AHQ.js} +1 -1
- package/public/{chunk-ASKLCERP.js → chunk-Y6B4ENQ3.js} +1 -1
- package/public/{chunk-RRPHHKF2.js → chunk-ZVU2KU6A.js} +1 -1
- package/public/index.html +1 -1
- package/public/{main-ZCE52DX6.js → main-QHHXZV7U.js} +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as Vi}from"./chunk-ZCGZM7LU.js";import{b as En,c as Yt,e as In,f as Fn,h as Bi,m as zn,o as Bn,p as Vn,r as Nn}from"./chunk-RDHUW73W.js";import{a as Ln}from"./chunk-
|
|
1
|
+
import{c as Vi}from"./chunk-ZCGZM7LU.js";import{b as En,c as Yt,e as In,f as Fn,h as Bi,m as zn,o as Bn,p as Vn,r as Nn}from"./chunk-RDHUW73W.js";import{a as Ln}from"./chunk-JPAZUSRO.js";import{e as Rn}from"./chunk-VWUZDCBZ.js";import{Aa as ze,Ab as _n,Bb as Ai,Db as Ti,Eb as Ri,Fb as Ve,Gb as xn,Gc as An,Hb as yn,I as an,Ib as vn,Jb as wn,Kb as Mn,Ob as kn,Pb as Sn,Q as rn,Rb as Cn,Rc as Tn,S as ln,Sb as Li,W as cn,X as Ie,Xb as Ne,Y as hn,Za as ce,Zb as Et,_ as dn,aa as xt,cb as gn,d as en,e as Ee,ga as Ci,gc as Pn,ha as Pi,i as sn,ib as he,ic as Ei,jc as Ii,ka as un,kc as Fi,la as fn,lc as zi,nb as Di,o as nn,oa as Lt,ob as pn,pa as Fe,pb as Be,tb as Oi,v as on,vc as Dn,xa as le,yb as mn,zb as bn,zc as On}from"./chunk-F5MBSCH4.js";import{a as Re,b as Le}from"./chunk-B4AJQJMI.js";function nr(e,i){if(e&1&&(wn(0,"span"),Fi(1),Mn()),e&2){let t=Et().$implicit,s=Et();Ii(s.highlightClass),ce(),zi(t)}}function or(e,i){if(e&1&&(kn(0),Fi(1),Sn()),e&2){let t=Et().$implicit;ce(),zi(t)}}function ar(e,i){if(e&1&&bn(0,nr,2,3,"span",0)(1,or,2,1,"ng-container"),e&2){let t=i.$index;_n(t%2!==0?0:1)}}var rr=(e,i,t)=>({result:e,term:i,formatter:t});function lr(e,i){if(e&1&&vn(0,"ngb-highlight",2),e&2){let t=i.result,s=i.term,n=i.formatter;Ve("result",n(t))("term",s)}}function cr(e,i){}function hr(e,i){if(e&1){let t=Cn();xn(0,"button",3),Ne("mouseenter",function(){let n=Ci(t).$index,o=Et();return Pi(o.markActive(n))})("click",function(){let n=Ci(t).$implicit,o=Et();return Pi(o.select(n))}),Oi(1,cr,0,0,"ng-template",4),yn()}if(e&2){let t=i.$implicit,s=i.$index,n=Et(),o=Pn(1);Ei("active",s===n.activeIdx),Ve("id",n.id+"-"+s),ce(),Ve("ngTemplateOutlet",n.resultTemplate||o)("ngTemplateOutletContext",On(5,rr,t,n.term,n.formatter))}}var dr=(()=>{class e{constructor(){this.highlightClass="ngb-highlight",this.accentSensitive=!0}ngOnChanges(t){!this.accentSensitive&&!String.prototype.normalize&&(console.warn("The `accentSensitive` input in `ngb-highlight` cannot be set to `false` in a browser that does not implement the `String.normalize` function. You will have to include a polyfill in your application to use this feature in the current browser."),this.accentSensitive=!0);let s=Yt(this.result),n=Array.isArray(this.term)?this.term:[this.term],o=c=>this.accentSensitive?c:Bi(c),a=n.map(c=>Fn(o(Yt(c)))).filter(c=>c),r=this.accentSensitive?s:Bi(s),l=a.length?r.split(new RegExp(`(${a.join("|")})`,"gmi")):[s];if(this.accentSensitive)this.parts=l;else{let c=0;this.parts=l.map(h=>s.substring(c,c+=h.length))}}static{this.\u0275fac=function(s){return new(s||e)}}static{this.\u0275cmp=Di({type:e,selectors:[["ngb-highlight"]],inputs:{highlightClass:"highlightClass",result:"result",term:"term",accentSensitive:"accentSensitive"},features:[le],decls:2,vars:0,consts:[[3,"class"]],template:function(s,n){s&1&&Ti(0,ar,2,1,null,null,Ai),s&2&&Ri(n.parts)},styles:[`.ngb-highlight{font-weight:700}
|
|
2
2
|
`],encapsulation:2,changeDetection:0})}}return e})(),ur=(()=>{class e{constructor(){this.editable=!0,this.focusFirst=!0,this.selectOnExact=!1,this.showHint=!1,this.placement=["bottom-start","bottom-end","top-start","top-end"],this.popperOptions=t=>t}static{this.\u0275fac=function(s){return new(s||e)}}static{this.\u0275prov=Ie({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),fr=(()=>{class e{constructor(){this.activeIdx=0,this.focusFirst=!0,this.formatter=Yt,this.selectEvent=new Lt,this.activeChangeEvent=new Lt}hasActive(){return this.activeIdx>-1&&this.activeIdx<this.results.length}getActive(){return this.results[this.activeIdx]}markActive(t){this.activeIdx=t,this._activeChanged()}next(){this.activeIdx===this.results.length-1?this.activeIdx=this.focusFirst?(this.activeIdx+1)%this.results.length:-1:this.activeIdx++,this._activeChanged()}prev(){this.activeIdx<0?this.activeIdx=this.results.length-1:this.activeIdx===0?this.activeIdx=this.focusFirst?this.results.length-1:-1:this.activeIdx--,this._activeChanged()}resetActive(){this.activeIdx=this.focusFirst?0:-1,this._activeChanged()}select(t){this.selectEvent.emit(t)}ngOnInit(){this.resetActive()}_activeChanged(){this.activeChangeEvent.emit(this.activeIdx>=0?this.id+"-"+this.activeIdx:void 0)}static{this.\u0275fac=function(s){return new(s||e)}}static{this.\u0275cmp=Di({type:e,selectors:[["ngb-typeahead-window"]],hostAttrs:["role","listbox"],hostVars:3,hostBindings:function(s,n){s&1&&Ne("mousedown",function(a){return a.preventDefault()}),s&2&&(Li("id",n.id),Ii("dropdown-menu show"+(n.popupClass?" "+n.popupClass:"")))},inputs:{id:"id",focusFirst:"focusFirst",results:"results",term:"term",formatter:"formatter",resultTemplate:"resultTemplate",popupClass:"popupClass"},outputs:{selectEvent:"select",activeChangeEvent:"activeChange"},exportAs:["ngbTypeaheadWindow"],decls:4,vars:0,consts:[["rt",""],["type","button","role","option",1,"dropdown-item",3,"id","active"],[3,"result","term"],["type","button","role","option",1,"dropdown-item",3,"mouseenter","click","id"],[3,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(s,n){s&1&&(Oi(0,lr,1,2,"ng-template",null,0,An),Ti(2,hr,2,9,"button",1,Ai)),s&2&&(ce(2),Ri(n.results))},dependencies:[dr,Rn],encapsulation:2})}}return e})(),gr=0,mu=(()=>{class e{constructor(){this._nativeElement=xt(ze).nativeElement,this._config=xt(ur),this._live=xt(Nn),this._document=xt(fn),this._ngZone=xt(Fe),this._changeDetector=xt(Tn),this._injector=xt(un),this._popupService=new Vn(fr),this._positioning=En(),this._subscription=null,this._closed$=new en,this._inputValueBackup=null,this._inputValueForSelectOnExact=null,this._valueChanges$=on(this._nativeElement,"input").pipe(nn(t=>t.target.value)),this._resubscribeTypeahead$=new Ee(null),this._windowRef=null,this.autocomplete="off",this.container=this._config.container,this.editable=this._config.editable,this.focusFirst=this._config.focusFirst,this.selectOnExact=this._config.selectOnExact,this.showHint=this._config.showHint,this.placement=this._config.placement,this.popperOptions=this._config.popperOptions,this.selectItem=new Lt,this.activeDescendant=null,this.popupId=`ngb-typeahead-${gr++}`,this._onTouched=()=>{},this._onChange=t=>{}}ngOnInit(){this._subscribeToUserInput()}ngOnChanges({ngbTypeahead:t}){t&&!t.firstChange&&(this._unsubscribeFromUserInput(),this._subscribeToUserInput())}ngOnDestroy(){this._closePopup(),this._unsubscribeFromUserInput()}registerOnChange(t){this._onChange=t}registerOnTouched(t){this._onTouched=t}writeValue(t){this._writeInputValue(this._formatItemForInput(t)),this.showHint&&(this._inputValueBackup=t)}setDisabledState(t){this._nativeElement.disabled=t}dismissPopup(){this.isPopupOpen()&&(this._resubscribeTypeahead$.next(null),this._closePopup(),this.showHint&&this._inputValueBackup!==null&&this._writeInputValue(this._inputValueBackup),this._changeDetector.markForCheck())}isPopupOpen(){return this._windowRef!=null}handleBlur(){this._resubscribeTypeahead$.next(null),this._onTouched()}handleKeyDown(t){if(this.isPopupOpen())switch(t.key){case"ArrowDown":t.preventDefault(),this._windowRef.instance.next(),this._showHint();break;case"ArrowUp":t.preventDefault(),this._windowRef.instance.prev(),this._showHint();break;case"Enter":case"Tab":{let s=this._windowRef.instance.getActive();In(s)&&(t.preventDefault(),t.stopPropagation(),this._selectResult(s)),this._closePopup();break}}}_openPopup(){if(!this.isPopupOpen()){this._inputValueBackup=this._nativeElement.value;let{windowRef:t}=this._popupService.open();this._windowRef=t,this._windowRef.setInput("id",this.popupId),this._windowRef.setInput("popupClass",this.popupClass),this._windowRef.instance.selectEvent.subscribe(s=>this._selectResultClosePopup(s)),this._windowRef.instance.activeChangeEvent.subscribe(s=>this.activeDescendant=s),this.container==="body"&&(this._windowRef.location.nativeElement.style.zIndex="1055",this._document.body.appendChild(this._windowRef.location.nativeElement)),this._changeDetector.markForCheck(),this._ngZone.runOutsideAngular(()=>{this._windowRef&&(this._positioning.createPopper({hostElement:this._nativeElement,targetElement:this._windowRef.location.nativeElement,placement:this.placement,updatePopperOptions:s=>this.popperOptions(Bn([0,2])(s))}),this._afterRenderRef=gn({mixedReadWrite:()=>{this._positioning.update()}},{injector:this._injector}))}),zn(this._ngZone,this._document,"outside",()=>this.dismissPopup(),this._closed$,[this._nativeElement,this._windowRef.location.nativeElement])}}_closePopup(){this._popupService.close().subscribe(()=>{this._positioning.destroy(),this._afterRenderRef?.destroy(),this._closed$.next(),this._windowRef=null,this.activeDescendant=null})}_selectResult(t){let s=!1;this.selectItem.emit({item:t,preventDefault:()=>{s=!0}}),this._resubscribeTypeahead$.next(null),s||(this.writeValue(t),this._onChange(t))}_selectResultClosePopup(t){this._selectResult(t),this._closePopup()}_showHint(){if(this.showHint&&this._windowRef?.instance.hasActive()&&this._inputValueBackup!=null){let t=this._inputValueBackup.toLowerCase(),s=this._formatItemForInput(this._windowRef.instance.getActive());t===s.substring(0,this._inputValueBackup.length).toLowerCase()?(this._writeInputValue(this._inputValueBackup+s.substring(this._inputValueBackup.length)),this._nativeElement.setSelectionRange.apply(this._nativeElement,[this._inputValueBackup.length,s.length])):this._writeInputValue(s)}}_formatItemForInput(t){return t!=null&&this.inputFormatter?this.inputFormatter(t):Yt(t)}_writeInputValue(t){this._nativeElement.value=Yt(t)}_subscribeToUserInput(){let t=this._valueChanges$.pipe(ln(s=>{this._inputValueBackup=this.showHint?s:null,this._inputValueForSelectOnExact=this.selectOnExact?s:null,this._onChange(this.editable?s:null)}),this.ngbTypeahead?this.ngbTypeahead:()=>sn([]));this._subscription=this._resubscribeTypeahead$.pipe(rn(()=>t)).subscribe(s=>{!s||s.length===0?this._closePopup():this.selectOnExact&&s.length===1&&this._formatItemForInput(s[0])===this._inputValueForSelectOnExact?(this._selectResult(s[0]),this._closePopup()):(this._openPopup(),this._windowRef.setInput("focusFirst",this.focusFirst),this._windowRef.setInput("results",s),this._windowRef.setInput("term",this._nativeElement.value),this.resultFormatter&&this._windowRef.setInput("formatter",this.resultFormatter),this.resultTemplate&&this._windowRef.setInput("resultTemplate",this.resultTemplate),this._windowRef.instance.resetActive(),this._windowRef.changeDetectorRef.detectChanges(),this._showHint());let n=s?s.length:0;this._live.say(n===0?"No results available":`${n} result${n===1?"":"s"} available`)})}_unsubscribeFromUserInput(){this._subscription&&this._subscription.unsubscribe(),this._subscription=null}static{this.\u0275fac=function(s){return new(s||e)}}static{this.\u0275dir=Be({type:e,selectors:[["input","ngbTypeahead",""]],hostAttrs:["autocapitalize","off","autocorrect","off","role","combobox"],hostVars:7,hostBindings:function(s,n){s&1&&Ne("blur",function(){return n.handleBlur()})("keydown",function(a){return n.handleKeyDown(a)}),s&2&&(Li("autocomplete",n.autocomplete),mn("aria-autocomplete",n.showHint?"both":"list")("aria-activedescendant",n.activeDescendant)("aria-controls",n.isPopupOpen()?n.popupId:null)("aria-expanded",n.isPopupOpen()),Ei("open",n.isPopupOpen()))},inputs:{autocomplete:"autocomplete",container:"container",editable:"editable",focusFirst:"focusFirst",inputFormatter:"inputFormatter",ngbTypeahead:"ngbTypeahead",resultFormatter:"resultFormatter",resultTemplate:"resultTemplate",selectOnExact:"selectOnExact",showHint:"showHint",placement:"placement",popperOptions:"popperOptions",popupClass:"popupClass"},outputs:{selectItem:"selectItem"},exportAs:["ngbTypeahead"],features:[Dn([{provide:Ln,useExisting:cn(()=>e),multi:!0}]),le]})}}return e})(),bu=(()=>{class e{static{this.\u0275fac=function(s){return new(s||e)}}static{this.\u0275mod=pn({type:e})}static{this.\u0275inj=hn({})}}return e})();function fe(e){return e+.5|0}var yt=(e,i,t)=>Math.max(Math.min(e,t),i);function de(e){return yt(fe(e*2.55),0,255)}function vt(e){return yt(fe(e*255),0,255)}function ut(e){return yt(fe(e/2.55)/100,0,1)}function Hn(e){return yt(fe(e*100),0,100)}var et={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},Hi=[..."0123456789ABCDEF"],pr=e=>Hi[e&15],mr=e=>Hi[(e&240)>>4]+Hi[e&15],He=e=>(e&240)>>4===(e&15),br=e=>He(e.r)&&He(e.g)&&He(e.b)&&He(e.a);function _r(e){var i=e.length,t;return e[0]==="#"&&(i===4||i===5?t={r:255&et[e[1]]*17,g:255&et[e[2]]*17,b:255&et[e[3]]*17,a:i===5?et[e[4]]*17:255}:(i===7||i===9)&&(t={r:et[e[1]]<<4|et[e[2]],g:et[e[3]]<<4|et[e[4]],b:et[e[5]]<<4|et[e[6]],a:i===9?et[e[7]]<<4|et[e[8]]:255})),t}var xr=(e,i)=>e<255?i(e):"";function yr(e){var i=br(e)?pr:mr;return e?"#"+i(e.r)+i(e.g)+i(e.b)+xr(e.a,i):void 0}var vr=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Yn(e,i,t){let s=i*Math.min(t,1-t),n=(o,a=(o+e/30)%12)=>t-s*Math.max(Math.min(a-3,9-a,1),-1);return[n(0),n(8),n(4)]}function wr(e,i,t){let s=(n,o=(n+e/60)%6)=>t-t*i*Math.max(Math.min(o,4-o,1),0);return[s(5),s(3),s(1)]}function Mr(e,i,t){let s=Yn(e,1,.5),n;for(i+t>1&&(n=1/(i+t),i*=n,t*=n),n=0;n<3;n++)s[n]*=1-i-t,s[n]+=i;return s}function kr(e,i,t,s,n){return e===n?(i-t)/s+(i<t?6:0):i===n?(t-e)/s+2:(e-i)/s+4}function Wi(e){let t=e.r/255,s=e.g/255,n=e.b/255,o=Math.max(t,s,n),a=Math.min(t,s,n),r=(o+a)/2,l,c,h;return o!==a&&(h=o-a,c=r>.5?h/(2-o-a):h/(o+a),l=kr(t,s,n,h,o),l=l*60+.5),[l|0,c||0,r]}function ji(e,i,t,s){return(Array.isArray(i)?e(i[0],i[1],i[2]):e(i,t,s)).map(vt)}function $i(e,i,t){return ji(Yn,e,i,t)}function Sr(e,i,t){return ji(Mr,e,i,t)}function Cr(e,i,t){return ji(wr,e,i,t)}function Un(e){return(e%360+360)%360}function Pr(e){let i=vr.exec(e),t=255,s;if(!i)return;i[5]!==s&&(t=i[6]?de(+i[5]):vt(+i[5]));let n=Un(+i[2]),o=+i[3]/100,a=+i[4]/100;return i[1]==="hwb"?s=Sr(n,o,a):i[1]==="hsv"?s=Cr(n,o,a):s=$i(n,o,a),{r:s[0],g:s[1],b:s[2],a:t}}function Dr(e,i){var t=Wi(e);t[0]=Un(t[0]+i),t=$i(t),e.r=t[0],e.g=t[1],e.b=t[2]}function Or(e){if(!e)return;let i=Wi(e),t=i[0],s=Hn(i[1]),n=Hn(i[2]);return e.a<255?`hsla(${t}, ${s}%, ${n}%, ${ut(e.a)})`:`hsl(${t}, ${s}%, ${n}%)`}var Wn={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"},jn={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 Ar(){let e={},i=Object.keys(jn),t=Object.keys(Wn),s,n,o,a,r;for(s=0;s<i.length;s++){for(a=r=i[s],n=0;n<t.length;n++)o=t[n],r=r.replace(o,Wn[o]);o=parseInt(jn[a],16),e[r]=[o>>16&255,o>>8&255,o&255]}return e}var We;function Tr(e){We||(We=Ar(),We.transparent=[0,0,0,0]);let i=We[e.toLowerCase()];return i&&{r:i[0],g:i[1],b:i[2],a:i.length===4?i[3]:255}}var Rr=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Lr(e){let i=Rr.exec(e),t=255,s,n,o;if(i){if(i[7]!==s){let a=+i[7];t=i[8]?de(a):yt(a*255,0,255)}return s=+i[1],n=+i[3],o=+i[5],s=255&(i[2]?de(s):yt(s,0,255)),n=255&(i[4]?de(n):yt(n,0,255)),o=255&(i[6]?de(o):yt(o,0,255)),{r:s,g:n,b:o,a:t}}}function Er(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${ut(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}var Ni=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,Ut=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function Ir(e,i,t){let s=Ut(ut(e.r)),n=Ut(ut(e.g)),o=Ut(ut(e.b));return{r:vt(Ni(s+t*(Ut(ut(i.r))-s))),g:vt(Ni(n+t*(Ut(ut(i.g))-n))),b:vt(Ni(o+t*(Ut(ut(i.b))-o))),a:e.a+t*(i.a-e.a)}}function je(e,i,t){if(e){let s=Wi(e);s[i]=Math.max(0,Math.min(s[i]+s[i]*t,i===0?360:1)),s=$i(s),e.r=s[0],e.g=s[1],e.b=s[2]}}function Xn(e,i){return e&&Object.assign(i||{},e)}function $n(e){var i={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(i={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(i.a=vt(e[3]))):(i=Xn(e,{r:0,g:0,b:0,a:1}),i.a=vt(i.a)),i}function Fr(e){return e.charAt(0)==="r"?Lr(e):Pr(e)}var ue=class e{constructor(i){if(i instanceof e)return i;let t=typeof i,s;t==="object"?s=$n(i):t==="string"&&(s=_r(i)||Tr(i)||Fr(i)),this._rgb=s,this._valid=!!s}get valid(){return this._valid}get rgb(){var i=Xn(this._rgb);return i&&(i.a=ut(i.a)),i}set rgb(i){this._rgb=$n(i)}rgbString(){return this._valid?Er(this._rgb):void 0}hexString(){return this._valid?yr(this._rgb):void 0}hslString(){return this._valid?Or(this._rgb):void 0}mix(i,t){if(i){let s=this.rgb,n=i.rgb,o,a=t===o?.5:t,r=2*a-1,l=s.a-n.a,c=((r*l===-1?r:(r+l)/(1+r*l))+1)/2;o=1-c,s.r=255&c*s.r+o*n.r+.5,s.g=255&c*s.g+o*n.g+.5,s.b=255&c*s.b+o*n.b+.5,s.a=a*s.a+(1-a)*n.a,this.rgb=s}return this}interpolate(i,t){return i&&(this._rgb=Ir(this._rgb,i._rgb,t)),this}clone(){return new e(this.rgb)}alpha(i){return this._rgb.a=vt(i),this}clearer(i){let t=this._rgb;return t.a*=1-i,this}greyscale(){let i=this._rgb,t=fe(i.r*.3+i.g*.59+i.b*.11);return i.r=i.g=i.b=t,this}opaquer(i){let t=this._rgb;return t.a*=1+i,this}negate(){let i=this._rgb;return i.r=255-i.r,i.g=255-i.g,i.b=255-i.b,this}lighten(i){return je(this._rgb,2,i),this}darken(i){return je(this._rgb,2,-i),this}saturate(i){return je(this._rgb,1,i),this}desaturate(i){return je(this._rgb,1,-i),this}rotate(i){return Dr(this._rgb,i),this}};function lt(){}var no=(()=>{let e=0;return()=>e++})();function O(e){return e==null}function z(e){if(Array.isArray&&Array.isArray(e))return!0;let i=Object.prototype.toString.call(e);return i.slice(0,7)==="[object"&&i.slice(-6)==="Array]"}function A(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function N(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function Z(e,i){return N(e)?e:i}function C(e,i){return typeof e>"u"?i:e}var oo=(e,i)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/i,Ki=(e,i)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*i:+e;function I(e,i,t){if(e&&typeof e.call=="function")return e.apply(t,i)}function L(e,i,t,s){let n,o,a;if(z(e))if(o=e.length,s)for(n=o-1;n>=0;n--)i.call(t,e[n],n);else for(n=0;n<o;n++)i.call(t,e[n],n);else if(A(e))for(a=Object.keys(e),o=a.length,n=0;n<o;n++)i.call(t,e[a[n]],a[n])}function me(e,i){let t,s,n,o;if(!e||!i||e.length!==i.length)return!1;for(t=0,s=e.length;t<s;++t)if(n=e[t],o=i[t],n.datasetIndex!==o.datasetIndex||n.index!==o.index)return!1;return!0}function Xe(e){if(z(e))return e.map(Xe);if(A(e)){let i=Object.create(null),t=Object.keys(e),s=t.length,n=0;for(;n<s;++n)i[t[n]]=Xe(e[t[n]]);return i}return e}function ao(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function zr(e,i,t,s){if(!ao(e))return;let n=i[e],o=t[e];A(n)&&A(o)?Kt(n,o,s):i[e]=Xe(o)}function Kt(e,i,t){let s=z(i)?i:[i],n=s.length;if(!A(e))return e;t=t||{};let o=t.merger||zr,a;for(let r=0;r<n;++r){if(a=s[r],!A(a))continue;let l=Object.keys(a);for(let c=0,h=l.length;c<h;++c)o(l[c],e,a,t)}return e}function Gt(e,i){return Kt(e,i,{merger:Br})}function Br(e,i,t){if(!ao(e))return;let s=i[e],n=t[e];A(s)&&A(n)?Gt(s,n):Object.prototype.hasOwnProperty.call(i,e)||(i[e]=Xe(n))}var Kn={"":e=>e,x:e=>e.x,y:e=>e.y};function Vr(e){let i=e.split("."),t=[],s="";for(let n of i)s+=n,s.endsWith("\\")?s=s.slice(0,-1)+".":(t.push(s),s="");return t}function Nr(e){let i=Vr(e);return t=>{for(let s of i){if(s==="")break;t=t&&t[s]}return t}}function pt(e,i){return(Kn[i]||(Kn[i]=Nr(i)))(e)}function Ze(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Zt=e=>typeof e<"u",ft=e=>typeof e=="function",qi=(e,i)=>{if(e.size!==i.size)return!1;for(let t of e)if(!i.has(t))return!1;return!0};function ro(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}var R=Math.PI,B=2*R,Hr=B+R,Ke=Number.POSITIVE_INFINITY,Wr=R/180,H=R/2,It=R/4,qn=R*2/3,gt=Math.log10,nt=Math.sign;function Jt(e,i,t){return Math.abs(e-i)<t}function Gi(e){let i=Math.round(e);e=Jt(e,i,e/1e3)?i:e;let t=Math.pow(10,Math.floor(gt(e))),s=e/t;return(s<=1?1:s<=2?2:s<=5?5:10)*t}function lo(e){let i=[],t=Math.sqrt(e),s;for(s=1;s<t;s++)e%s===0&&(i.push(s),i.push(e/s));return t===(t|0)&&i.push(t),i.sort((n,o)=>n-o).pop(),i}function jr(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function Bt(e){return!jr(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function co(e,i){let t=Math.round(e);return t-i<=e&&t+i>=e}function Zi(e,i,t){let s,n,o;for(s=0,n=e.length;s<n;s++)o=e[s][t],isNaN(o)||(i.min=Math.min(i.min,o),i.max=Math.max(i.max,o))}function it(e){return e*(R/180)}function Je(e){return e*(180/R)}function Ji(e){if(!N(e))return;let i=1,t=0;for(;Math.round(e*i)/i!==e;)i*=10,t++;return t}function Qi(e,i){let t=i.x-e.x,s=i.y-e.y,n=Math.sqrt(t*t+s*s),o=Math.atan2(s,t);return o<-.5*R&&(o+=B),{angle:o,distance:n}}function qe(e,i){return Math.sqrt(Math.pow(i.x-e.x,2)+Math.pow(i.y-e.y,2))}function $r(e,i){return(e-i+Hr)%B-R}function U(e){return(e%B+B)%B}function Qt(e,i,t,s){let n=U(e),o=U(i),a=U(t),r=U(o-n),l=U(a-n),c=U(n-o),h=U(n-a);return n===o||n===a||s&&o===a||r>l&&c<h}function $(e,i,t){return Math.max(i,Math.min(t,e))}function ho(e){return $(e,-32768,32767)}function ct(e,i,t,s=1e-6){return e>=Math.min(i,t)-s&&e<=Math.max(i,t)+s}function Qe(e,i,t){t=t||(a=>e[a]<i);let s=e.length-1,n=0,o;for(;s-n>1;)o=n+s>>1,t(o)?n=o:s=o;return{lo:n,hi:s}}var at=(e,i,t,s)=>Qe(e,t,s?n=>{let o=e[n][i];return o<t||o===t&&e[n+1][i]===t}:n=>e[n][i]<t),uo=(e,i,t)=>Qe(e,t,s=>e[s][i]>=t);function fo(e,i,t){let s=0,n=e.length;for(;s<n&&e[s]<i;)s++;for(;n>s&&e[n-1]>t;)n--;return s>0||n<e.length?e.slice(s,n):e}var go=["push","pop","shift","splice","unshift"];function po(e,i){if(e._chartjs){e._chartjs.listeners.push(i);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[i]}}),go.forEach(t=>{let s="_onData"+Ze(t),n=e[t];Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value(...o){let a=n.apply(this,o);return e._chartjs.listeners.forEach(r=>{typeof r[s]=="function"&&r[s](...o)}),a}})})}function ts(e,i){let t=e._chartjs;if(!t)return;let s=t.listeners,n=s.indexOf(i);n!==-1&&s.splice(n,1),!(s.length>0)&&(go.forEach(o=>{delete e[o]}),delete e._chartjs)}function es(e){let i=new Set(e);return i.size===e.length?e:Array.from(i)}var is=(function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame})();function ss(e,i){let t=[],s=!1;return function(...n){t=n,s||(s=!0,is.call(window,()=>{s=!1,e.apply(i,t)}))}}function mo(e,i){let t;return function(...s){return i?(clearTimeout(t),t=setTimeout(e,i,s)):e.apply(this,s),i}}var ti=e=>e==="start"?"left":e==="end"?"right":"center",X=(e,i,t)=>e==="start"?i:e==="end"?t:(i+t)/2,bo=(e,i,t,s)=>e===(s?"left":"right")?t:e==="center"?(i+t)/2:i;function ns(e,i,t){let s=i.length,n=0,o=s;if(e._sorted){let{iScale:a,vScale:r,_parsed:l}=e,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,h=a.axis,{min:d,max:u,minDefined:f,maxDefined:p}=a.getUserBounds();if(f){if(n=Math.min(at(l,h,d).lo,t?s:at(i,h,a.getPixelForValue(d)).lo),c){let g=l.slice(0,n+1).reverse().findIndex(m=>!O(m[r.axis]));n-=Math.max(0,g)}n=$(n,0,s-1)}if(p){let g=Math.max(at(l,a.axis,u,!0).hi+1,t?0:at(i,h,a.getPixelForValue(u),!0).hi+1);if(c){let m=l.slice(g-1).findIndex(b=>!O(b[r.axis]));g+=Math.max(0,m)}o=$(g,n,s)-n}else o=s-n}return{start:n,count:o}}function os(e){let{xScale:i,yScale:t,_scaleRanges:s}=e,n={xmin:i.min,xmax:i.max,ymin:t.min,ymax:t.max};if(!s)return e._scaleRanges=n,!0;let o=s.xmin!==i.min||s.xmax!==i.max||s.ymin!==t.min||s.ymax!==t.max;return Object.assign(s,n),o}var $e=e=>e===0||e===1,Gn=(e,i,t)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-i)*B/t)),Zn=(e,i,t)=>Math.pow(2,-10*e)*Math.sin((e-i)*B/t)+1,Xt={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*H)+1,easeOutSine:e=>Math.sin(e*H),easeInOutSine:e=>-.5*(Math.cos(R*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>$e(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>$e(e)?e:Gn(e,.075,.3),easeOutElastic:e=>$e(e)?e:Zn(e,.075,.3),easeInOutElastic(e){return $e(e)?e:e<.5?.5*Gn(e*2,.1125,.45):.5+.5*Zn(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let i=1.70158;return(e/=.5)<1?.5*(e*e*(((i*=1.525)+1)*e-i)):.5*((e-=2)*e*(((i*=1.525)+1)*e+i)+2)},easeInBounce:e=>1-Xt.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?Xt.easeInBounce(e*2)*.5:Xt.easeOutBounce(e*2-1)*.5+.5};function as(e){if(e&&typeof e=="object"){let i=e.toString();return i==="[object CanvasPattern]"||i==="[object CanvasGradient]"}return!1}function rs(e){return as(e)?e:new ue(e)}function Yi(e){return as(e)?e:new ue(e).saturate(.5).darken(.1).hexString()}var Yr=["x","y","borderWidth","radius","tension"],Ur=["color","borderColor","backgroundColor"];function Xr(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:i=>i!=="onProgress"&&i!=="onComplete"&&i!=="fn"}),e.set("animations",{colors:{type:"color",properties:Ur},numbers:{type:"number",properties:Yr}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:i=>i|0}}}})}function Kr(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}var Jn=new Map;function qr(e,i){i=i||{};let t=e+JSON.stringify(i),s=Jn.get(t);return s||(s=new Intl.NumberFormat(e,i),Jn.set(t,s)),s}function te(e,i,t){return qr(i,t).format(e)}var _o={values(e){return z(e)?e:""+e},numeric(e,i,t){if(e===0)return"0";let s=this.chart.options.locale,n,o=e;if(t.length>1){let c=Math.max(Math.abs(t[0].value),Math.abs(t[t.length-1].value));(c<1e-4||c>1e15)&&(n="scientific"),o=Gr(e,t)}let a=gt(Math.abs(o)),r=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:n,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(l,this.options.ticks.format),te(e,s,l)},logarithmic(e,i,t){if(e===0)return"0";let s=t[i].significand||e/Math.pow(10,Math.floor(gt(e)));return[1,2,3,5,10,15].includes(s)||i>.8*t.length?_o.numeric.call(this,e,i,t):""}};function Gr(e,i){let t=i.length>3?i[2].value-i[1].value:i[1].value-i[0].value;return Math.abs(t)>=1&&e!==Math.floor(e)&&(t=e-Math.floor(e)),t}var be={formatters:_o};function Zr(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(i,t)=>t.lineWidth,tickColor:(i,t)=>t.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:be.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:i=>!i.startsWith("before")&&!i.startsWith("after")&&i!=="callback"&&i!=="parser",_indexable:i=>i!=="borderDash"&&i!=="tickBorderDash"&&i!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:i=>i!=="backdropPadding"&&i!=="callback",_indexable:i=>i!=="backdropPadding"})}var kt=Object.create(null),ei=Object.create(null);function ge(e,i){if(!i)return e;let t=i.split(".");for(let s=0,n=t.length;s<n;++s){let o=t[s];e=e[o]||(e[o]=Object.create(null))}return e}function Ui(e,i,t){return typeof i=="string"?Kt(ge(e,i),t):Kt(ge(e,""),i)}var Xi=class{constructor(i,t){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=s=>s.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=(s,n)=>Yi(n.backgroundColor),this.hoverBorderColor=(s,n)=>Yi(n.borderColor),this.hoverColor=(s,n)=>Yi(n.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(i),this.apply(t)}set(i,t){return Ui(this,i,t)}get(i){return ge(this,i)}describe(i,t){return Ui(ei,i,t)}override(i,t){return Ui(kt,i,t)}route(i,t,s,n){let o=ge(this,i),a=ge(this,s),r="_"+t;Object.defineProperties(o,{[r]:{value:o[t],writable:!0},[t]:{enumerable:!0,get(){let l=this[r],c=a[n];return A(l)?Object.assign({},c,l):C(l,c)},set(l){this[r]=l}}})}apply(i){i.forEach(t=>t(this))}},F=new Xi({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Xr,Kr,Zr]);function Jr(e){return!e||O(e.size)||O(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function pe(e,i,t,s,n){let o=i[n];return o||(o=i[n]=e.measureText(n).width,t.push(n)),o>s&&(s=o),s}function xo(e,i,t,s){s=s||{};let n=s.data=s.data||{},o=s.garbageCollect=s.garbageCollect||[];s.font!==i&&(n=s.data={},o=s.garbageCollect=[],s.font=i),e.save(),e.font=i;let a=0,r=t.length,l,c,h,d,u;for(l=0;l<r;l++)if(d=t[l],d!=null&&!z(d))a=pe(e,n,o,a,d);else if(z(d))for(c=0,h=d.length;c<h;c++)u=d[c],u!=null&&!z(u)&&(a=pe(e,n,o,a,u));e.restore();let f=o.length/2;if(f>t.length){for(l=0;l<f;l++)delete n[o[l]];o.splice(0,f)}return a}function St(e,i,t){let s=e.currentDevicePixelRatio,n=t!==0?Math.max(t/2,.5):0;return Math.round((i-n)*s)/s+n}function ls(e,i){!i&&!e||(i=i||e.getContext("2d"),i.save(),i.resetTransform(),i.clearRect(0,0,e.width,e.height),i.restore())}function ii(e,i,t,s){cs(e,i,t,s,null)}function cs(e,i,t,s,n){let o,a,r,l,c,h,d,u,f=i.pointStyle,p=i.rotation,g=i.radius,m=(p||0)*Wr;if(f&&typeof f=="object"&&(o=f.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){e.save(),e.translate(t,s),e.rotate(m),e.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),e.restore();return}if(!(isNaN(g)||g<=0)){switch(e.beginPath(),f){default:n?e.ellipse(t,s,n/2,g,0,0,B):e.arc(t,s,g,0,B),e.closePath();break;case"triangle":h=n?n/2:g,e.moveTo(t+Math.sin(m)*h,s-Math.cos(m)*g),m+=qn,e.lineTo(t+Math.sin(m)*h,s-Math.cos(m)*g),m+=qn,e.lineTo(t+Math.sin(m)*h,s-Math.cos(m)*g),e.closePath();break;case"rectRounded":c=g*.516,l=g-c,a=Math.cos(m+It)*l,d=Math.cos(m+It)*(n?n/2-c:l),r=Math.sin(m+It)*l,u=Math.sin(m+It)*(n?n/2-c:l),e.arc(t-d,s-r,c,m-R,m-H),e.arc(t+u,s-a,c,m-H,m),e.arc(t+d,s+r,c,m,m+H),e.arc(t-u,s+a,c,m+H,m+R),e.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*g,h=n?n/2:l,e.rect(t-h,s-l,2*h,2*l);break}m+=It;case"rectRot":d=Math.cos(m)*(n?n/2:g),a=Math.cos(m)*g,r=Math.sin(m)*g,u=Math.sin(m)*(n?n/2:g),e.moveTo(t-d,s-r),e.lineTo(t+u,s-a),e.lineTo(t+d,s+r),e.lineTo(t-u,s+a),e.closePath();break;case"crossRot":m+=It;case"cross":d=Math.cos(m)*(n?n/2:g),a=Math.cos(m)*g,r=Math.sin(m)*g,u=Math.sin(m)*(n?n/2:g),e.moveTo(t-d,s-r),e.lineTo(t+d,s+r),e.moveTo(t+u,s-a),e.lineTo(t-u,s+a);break;case"star":d=Math.cos(m)*(n?n/2:g),a=Math.cos(m)*g,r=Math.sin(m)*g,u=Math.sin(m)*(n?n/2:g),e.moveTo(t-d,s-r),e.lineTo(t+d,s+r),e.moveTo(t+u,s-a),e.lineTo(t-u,s+a),m+=It,d=Math.cos(m)*(n?n/2:g),a=Math.cos(m)*g,r=Math.sin(m)*g,u=Math.sin(m)*(n?n/2:g),e.moveTo(t-d,s-r),e.lineTo(t+d,s+r),e.moveTo(t+u,s-a),e.lineTo(t-u,s+a);break;case"line":a=n?n/2:Math.cos(m)*g,r=Math.sin(m)*g,e.moveTo(t-a,s-r),e.lineTo(t+a,s+r);break;case"dash":e.moveTo(t,s),e.lineTo(t+Math.cos(m)*(n?n/2:g),s+Math.sin(m)*g);break;case!1:e.closePath();break}e.fill(),i.borderWidth>0&&e.stroke()}}function rt(e,i,t){return t=t||.5,!i||e&&e.x>i.left-t&&e.x<i.right+t&&e.y>i.top-t&&e.y<i.bottom+t}function _e(e,i){e.save(),e.beginPath(),e.rect(i.left,i.top,i.right-i.left,i.bottom-i.top),e.clip()}function xe(e){e.restore()}function yo(e,i,t,s,n){if(!i)return e.lineTo(t.x,t.y);if(n==="middle"){let o=(i.x+t.x)/2;e.lineTo(o,i.y),e.lineTo(o,t.y)}else n==="after"!=!!s?e.lineTo(i.x,t.y):e.lineTo(t.x,i.y);e.lineTo(t.x,t.y)}function vo(e,i,t,s){if(!i)return e.lineTo(t.x,t.y);e.bezierCurveTo(s?i.cp1x:i.cp2x,s?i.cp1y:i.cp2y,s?t.cp2x:t.cp1x,s?t.cp2y:t.cp1y,t.x,t.y)}function Qr(e,i){i.translation&&e.translate(i.translation[0],i.translation[1]),O(i.rotation)||e.rotate(i.rotation),i.color&&(e.fillStyle=i.color),i.textAlign&&(e.textAlign=i.textAlign),i.textBaseline&&(e.textBaseline=i.textBaseline)}function tl(e,i,t,s,n){if(n.strikethrough||n.underline){let o=e.measureText(s),a=i-o.actualBoundingBoxLeft,r=i+o.actualBoundingBoxRight,l=t-o.actualBoundingBoxAscent,c=t+o.actualBoundingBoxDescent,h=n.strikethrough?(l+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=n.decorationWidth||2,e.moveTo(a,h),e.lineTo(r,h),e.stroke()}}function el(e,i){let t=e.fillStyle;e.fillStyle=i.color,e.fillRect(i.left,i.top,i.width,i.height),e.fillStyle=t}function Ct(e,i,t,s,n,o={}){let a=z(i)?i:[i],r=o.strokeWidth>0&&o.strokeColor!=="",l,c;for(e.save(),e.font=n.string,Qr(e,o),l=0;l<a.length;++l)c=a[l],o.backdrop&&el(e,o.backdrop),r&&(o.strokeColor&&(e.strokeStyle=o.strokeColor),O(o.strokeWidth)||(e.lineWidth=o.strokeWidth),e.strokeText(c,t,s,o.maxWidth)),e.fillText(c,t,s,o.maxWidth),tl(e,t,s,c,o),s+=Number(n.lineHeight);e.restore()}function ee(e,i){let{x:t,y:s,w:n,h:o,radius:a}=i;e.arc(t+a.topLeft,s+a.topLeft,a.topLeft,1.5*R,R,!0),e.lineTo(t,s+o-a.bottomLeft),e.arc(t+a.bottomLeft,s+o-a.bottomLeft,a.bottomLeft,R,H,!0),e.lineTo(t+n-a.bottomRight,s+o),e.arc(t+n-a.bottomRight,s+o-a.bottomRight,a.bottomRight,H,0,!0),e.lineTo(t+n,s+a.topRight),e.arc(t+n-a.topRight,s+a.topRight,a.topRight,0,-H,!0),e.lineTo(t+a.topLeft,s)}var il=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,sl=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function nl(e,i){let t=(""+e).match(il);if(!t||t[1]==="normal")return i*1.2;switch(e=+t[2],t[3]){case"px":return e;case"%":e/=100;break}return i*e}var ol=e=>+e||0;function si(e,i){let t={},s=A(i),n=s?Object.keys(i):i,o=A(e)?s?a=>C(e[a],e[i[a]]):a=>e[a]:()=>e;for(let a of n)t[a]=ol(o(a));return t}function hs(e){return si(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Pt(e){return si(e,["topLeft","topRight","bottomLeft","bottomRight"])}function K(e){let i=hs(e);return i.width=i.left+i.right,i.height=i.top+i.bottom,i}function j(e,i){e=e||{},i=i||F.font;let t=C(e.size,i.size);typeof t=="string"&&(t=parseInt(t,10));let s=C(e.style,i.style);s&&!(""+s).match(sl)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);let n={family:C(e.family,i.family),lineHeight:nl(C(e.lineHeight,i.lineHeight),t),size:t,style:s,weight:C(e.weight,i.weight),string:""};return n.string=Jr(n),n}function ie(e,i,t,s){let n=!0,o,a,r;for(o=0,a=e.length;o<a;++o)if(r=e[o],r!==void 0&&(i!==void 0&&typeof r=="function"&&(r=r(i),n=!1),t!==void 0&&z(r)&&(r=r[t%r.length],n=!1),r!==void 0))return s&&!n&&(s.cacheable=!1),r}function wo(e,i,t){let{min:s,max:n}=e,o=Ki(i,(n-s)/2),a=(r,l)=>t&&r===0?0:r+l;return{min:a(s,-Math.abs(o)),max:a(n,o)}}function mt(e,i){return Object.assign(Object.create(e),i)}function ni(e,i=[""],t,s,n=()=>e[0]){let o=t||e;typeof s>"u"&&(s=So("_fallback",e));let a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:o,_fallback:s,_getTarget:n,override:r=>ni([r,...e],i,o,s)};return new Proxy(a,{deleteProperty(r,l){return delete r[l],delete r._keys,delete e[0][l],!0},get(r,l){return Mo(r,l,()=>fl(l,i,e,r))},getOwnPropertyDescriptor(r,l){return Reflect.getOwnPropertyDescriptor(r._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(r,l){return to(r).includes(l)},ownKeys(r){return to(r)},set(r,l,c){let h=r._storage||(r._storage=n());return r[l]=h[l]=c,delete r._keys,!0}})}function zt(e,i,t,s){let n={_cacheable:!1,_proxy:e,_context:i,_subProxy:t,_stack:new Set,_descriptors:ds(e,s),setContext:o=>zt(e,o,t,s),override:o=>zt(e.override(o),i,t,s)};return new Proxy(n,{deleteProperty(o,a){return delete o[a],delete e[a],!0},get(o,a,r){return Mo(o,a,()=>rl(o,a,r))},getOwnPropertyDescriptor(o,a){return o._descriptors.allKeys?Reflect.has(e,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,a)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(o,a){return Reflect.has(e,a)},ownKeys(){return Reflect.ownKeys(e)},set(o,a,r){return e[a]=r,delete o[a],!0}})}function ds(e,i={scriptable:!0,indexable:!0}){let{_scriptable:t=i.scriptable,_indexable:s=i.indexable,_allKeys:n=i.allKeys}=e;return{allKeys:n,scriptable:t,indexable:s,isScriptable:ft(t)?t:()=>t,isIndexable:ft(s)?s:()=>s}}var al=(e,i)=>e?e+Ze(i):i,us=(e,i)=>A(i)&&e!=="adapters"&&(Object.getPrototypeOf(i)===null||i.constructor===Object);function Mo(e,i,t){if(Object.prototype.hasOwnProperty.call(e,i)||i==="constructor")return e[i];let s=t();return e[i]=s,s}function rl(e,i,t){let{_proxy:s,_context:n,_subProxy:o,_descriptors:a}=e,r=s[i];return ft(r)&&a.isScriptable(i)&&(r=ll(i,r,e,t)),z(r)&&r.length&&(r=cl(i,r,e,a.isIndexable)),us(i,r)&&(r=zt(r,n,o&&o[i],a)),r}function ll(e,i,t,s){let{_proxy:n,_context:o,_subProxy:a,_stack:r}=t;if(r.has(e))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+e);r.add(e);let l=i(o,a||s);return r.delete(e),us(e,l)&&(l=fs(n._scopes,n,e,l)),l}function cl(e,i,t,s){let{_proxy:n,_context:o,_subProxy:a,_descriptors:r}=t;if(typeof o.index<"u"&&s(e))return i[o.index%i.length];if(A(i[0])){let l=i,c=n._scopes.filter(h=>h!==l);i=[];for(let h of l){let d=fs(c,n,e,h);i.push(zt(d,o,a&&a[e],r))}}return i}function ko(e,i,t){return ft(e)?e(i,t):e}var hl=(e,i)=>e===!0?i:typeof e=="string"?pt(i,e):void 0;function dl(e,i,t,s,n){for(let o of i){let a=hl(t,o);if(a){e.add(a);let r=ko(a._fallback,t,n);if(typeof r<"u"&&r!==t&&r!==s)return r}else if(a===!1&&typeof s<"u"&&t!==s)return null}return!1}function fs(e,i,t,s){let n=i._rootScopes,o=ko(i._fallback,t,s),a=[...e,...n],r=new Set;r.add(s);let l=Qn(r,a,t,o||t,s);return l===null||typeof o<"u"&&o!==t&&(l=Qn(r,a,o,l,s),l===null)?!1:ni(Array.from(r),[""],n,o,()=>ul(i,t,s))}function Qn(e,i,t,s,n){for(;t;)t=dl(e,i,t,s,n);return t}function ul(e,i,t){let s=e._getTarget();i in s||(s[i]={});let n=s[i];return z(n)&&A(t)?t:n||{}}function fl(e,i,t,s){let n;for(let o of i)if(n=So(al(o,e),t),typeof n<"u")return us(e,n)?fs(t,s,e,n):n}function So(e,i){for(let t of i){if(!t)continue;let s=t[e];if(typeof s<"u")return s}}function to(e){let i=e._keys;return i||(i=e._keys=gl(e._scopes)),i}function gl(e){let i=new Set;for(let t of e)for(let s of Object.keys(t).filter(n=>!n.startsWith("_")))i.add(s);return Array.from(i)}function gs(e,i,t,s){let{iScale:n}=e,{key:o="r"}=this._parsing,a=new Array(s),r,l,c,h;for(r=0,l=s;r<l;++r)c=r+t,h=i[c],a[r]={r:n.parse(pt(h,o),c)};return a}var pl=Number.EPSILON||1e-14,qt=(e,i)=>i<e.length&&!e[i].skip&&e[i],Co=e=>e==="x"?"y":"x";function ml(e,i,t,s){let n=e.skip?i:e,o=i,a=t.skip?i:t,r=qe(o,n),l=qe(a,o),c=r/(r+l),h=l/(r+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;let d=s*c,u=s*h;return{previous:{x:o.x-d*(a.x-n.x),y:o.y-d*(a.y-n.y)},next:{x:o.x+u*(a.x-n.x),y:o.y+u*(a.y-n.y)}}}function bl(e,i,t){let s=e.length,n,o,a,r,l,c=qt(e,0);for(let h=0;h<s-1;++h)if(l=c,c=qt(e,h+1),!(!l||!c)){if(Jt(i[h],0,pl)){t[h]=t[h+1]=0;continue}n=t[h]/i[h],o=t[h+1]/i[h],r=Math.pow(n,2)+Math.pow(o,2),!(r<=9)&&(a=3/Math.sqrt(r),t[h]=n*a*i[h],t[h+1]=o*a*i[h])}}function _l(e,i,t="x"){let s=Co(t),n=e.length,o,a,r,l=qt(e,0);for(let c=0;c<n;++c){if(a=r,r=l,l=qt(e,c+1),!r)continue;let h=r[t],d=r[s];a&&(o=(h-a[t])/3,r[`cp1${t}`]=h-o,r[`cp1${s}`]=d-o*i[c]),l&&(o=(l[t]-h)/3,r[`cp2${t}`]=h+o,r[`cp2${s}`]=d+o*i[c])}}function xl(e,i="x"){let t=Co(i),s=e.length,n=Array(s).fill(0),o=Array(s),a,r,l,c=qt(e,0);for(a=0;a<s;++a)if(r=l,l=c,c=qt(e,a+1),!!l){if(c){let h=c[i]-l[i];n[a]=h!==0?(c[t]-l[t])/h:0}o[a]=r?c?nt(n[a-1])!==nt(n[a])?0:(n[a-1]+n[a])/2:n[a-1]:n[a]}bl(e,n,o),_l(e,o,i)}function Ye(e,i,t){return Math.max(Math.min(e,t),i)}function yl(e,i){let t,s,n,o,a,r=rt(e[0],i);for(t=0,s=e.length;t<s;++t)a=o,o=r,r=t<s-1&&rt(e[t+1],i),o&&(n=e[t],a&&(n.cp1x=Ye(n.cp1x,i.left,i.right),n.cp1y=Ye(n.cp1y,i.top,i.bottom)),r&&(n.cp2x=Ye(n.cp2x,i.left,i.right),n.cp2y=Ye(n.cp2y,i.top,i.bottom)))}function Po(e,i,t,s,n){let o,a,r,l;if(i.spanGaps&&(e=e.filter(c=>!c.skip)),i.cubicInterpolationMode==="monotone")xl(e,n);else{let c=s?e[e.length-1]:e[0];for(o=0,a=e.length;o<a;++o)r=e[o],l=ml(c,r,e[Math.min(o+1,a-(s?0:1))%a],i.tension),r.cp1x=l.previous.x,r.cp1y=l.previous.y,r.cp2x=l.next.x,r.cp2y=l.next.y,c=r}i.capBezierPoints&&yl(e,t)}function oi(){return typeof window<"u"&&typeof document<"u"}function ai(e){let i=e.parentNode;return i&&i.toString()==="[object ShadowRoot]"&&(i=i.host),i}function Ge(e,i,t){let s;return typeof e=="string"?(s=parseInt(e,10),e.indexOf("%")!==-1&&(s=s/100*i.parentNode[t])):s=e,s}var ri=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function vl(e,i){return ri(e).getPropertyValue(i)}var wl=["top","right","bottom","left"];function Ft(e,i,t){let s={};t=t?"-"+t:"";for(let n=0;n<4;n++){let o=wl[n];s[o]=parseFloat(e[i+"-"+o+t])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}var Ml=(e,i,t)=>(e>0||i>0)&&(!t||!t.shadowRoot);function kl(e,i){let t=e.touches,s=t&&t.length?t[0]:e,{offsetX:n,offsetY:o}=s,a=!1,r,l;if(Ml(n,o,e.target))r=n,l=o;else{let c=i.getBoundingClientRect();r=s.clientX-c.left,l=s.clientY-c.top,a=!0}return{x:r,y:l,box:a}}function Dt(e,i){if("native"in e)return e;let{canvas:t,currentDevicePixelRatio:s}=i,n=ri(t),o=n.boxSizing==="border-box",a=Ft(n,"padding"),r=Ft(n,"border","width"),{x:l,y:c,box:h}=kl(e,t),d=a.left+(h&&r.left),u=a.top+(h&&r.top),{width:f,height:p}=i;return o&&(f-=a.width+r.width,p-=a.height+r.height),{x:Math.round((l-d)/f*t.width/s),y:Math.round((c-u)/p*t.height/s)}}function Sl(e,i,t){let s,n;if(i===void 0||t===void 0){let o=e&&ai(e);if(!o)i=e.clientWidth,t=e.clientHeight;else{let a=o.getBoundingClientRect(),r=ri(o),l=Ft(r,"border","width"),c=Ft(r,"padding");i=a.width-c.width-l.width,t=a.height-c.height-l.height,s=Ge(r.maxWidth,o,"clientWidth"),n=Ge(r.maxHeight,o,"clientHeight")}}return{width:i,height:t,maxWidth:s||Ke,maxHeight:n||Ke}}var Mt=e=>Math.round(e*10)/10;function Do(e,i,t,s){let n=ri(e),o=Ft(n,"margin"),a=Ge(n.maxWidth,e,"clientWidth")||Ke,r=Ge(n.maxHeight,e,"clientHeight")||Ke,l=Sl(e,i,t),{width:c,height:h}=l;if(n.boxSizing==="content-box"){let u=Ft(n,"border","width"),f=Ft(n,"padding");c-=f.width+u.width,h-=f.height+u.height}return c=Math.max(0,c-o.width),h=Math.max(0,s?c/s:h-o.height),c=Mt(Math.min(c,a,l.maxWidth)),h=Mt(Math.min(h,r,l.maxHeight)),c&&!h&&(h=Mt(c/2)),(i!==void 0||t!==void 0)&&s&&l.height&&h>l.height&&(h=l.height,c=Mt(Math.floor(h*s))),{width:c,height:h}}function ps(e,i,t){let s=i||1,n=Mt(e.height*s),o=Mt(e.width*s);e.height=Mt(e.height),e.width=Mt(e.width);let a=e.canvas;return a.style&&(t||!a.style.height&&!a.style.width)&&(a.style.height=`${e.height}px`,a.style.width=`${e.width}px`),e.currentDevicePixelRatio!==s||a.height!==n||a.width!==o?(e.currentDevicePixelRatio=s,a.height=n,a.width=o,e.ctx.setTransform(s,0,0,s,0,0),!0):!1}var Oo=(function(){let e=!1;try{let i={get passive(){return e=!0,!1}};oi()&&(window.addEventListener("test",null,i),window.removeEventListener("test",null,i))}catch{}return e})();function ms(e,i){let t=vl(e,i),s=t&&t.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function wt(e,i,t,s){return{x:e.x+t*(i.x-e.x),y:e.y+t*(i.y-e.y)}}function Ao(e,i,t,s){return{x:e.x+t*(i.x-e.x),y:s==="middle"?t<.5?e.y:i.y:s==="after"?t<1?e.y:i.y:t>0?i.y:e.y}}function To(e,i,t,s){let n={x:e.cp2x,y:e.cp2y},o={x:i.cp1x,y:i.cp1y},a=wt(e,n,t),r=wt(n,o,t),l=wt(o,i,t),c=wt(a,r,t),h=wt(r,l,t);return wt(c,h,t)}var Cl=function(e,i){return{x(t){return e+e+i-t},setWidth(t){i=t},textAlign(t){return t==="center"?t:t==="right"?"left":"right"},xPlus(t,s){return t-s},leftForLtr(t,s){return t-s}}},Pl=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,i){return e+i},leftForLtr(e,i){return e}}};function Vt(e,i,t){return e?Cl(i,t):Pl()}function bs(e,i){let t,s;(i==="ltr"||i==="rtl")&&(t=e.canvas.style,s=[t.getPropertyValue("direction"),t.getPropertyPriority("direction")],t.setProperty("direction",i,"important"),e.prevTextDirection=s)}function _s(e,i){i!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",i[0],i[1]))}function Ro(e){return e==="angle"?{between:Qt,compare:$r,normalize:U}:{between:ct,compare:(i,t)=>i-t,normalize:i=>i}}function eo({start:e,end:i,count:t,loop:s,style:n}){return{start:e%t,end:i%t,loop:s&&(i-e+1)%t===0,style:n}}function Dl(e,i,t){let{property:s,start:n,end:o}=t,{between:a,normalize:r}=Ro(s),l=i.length,{start:c,end:h,loop:d}=e,u,f;if(d){for(c+=l,h+=l,u=0,f=l;u<f&&a(r(i[c%l][s]),n,o);++u)c--,h--;c%=l,h%=l}return h<c&&(h+=l),{start:c,end:h,loop:d,style:e.style}}function xs(e,i,t){if(!t)return[e];let{property:s,start:n,end:o}=t,a=i.length,{compare:r,between:l,normalize:c}=Ro(s),{start:h,end:d,loop:u,style:f}=Dl(e,i,t),p=[],g=!1,m=null,b,_,y,w=()=>l(n,y,b)&&r(n,y)!==0,x=()=>r(o,b)===0||l(o,y,b),v=()=>g||w(),k=()=>!g||x();for(let M=h,S=h;M<=d;++M)_=i[M%a],!_.skip&&(b=c(_[s]),b!==y&&(g=l(b,n,o),m===null&&v()&&(m=r(b,n)===0?M:S),m!==null&&k()&&(p.push(eo({start:m,end:M,loop:u,count:a,style:f})),m=null),S=M,y=b));return m!==null&&p.push(eo({start:m,end:d,loop:u,count:a,style:f})),p}function ys(e,i){let t=[],s=e.segments;for(let n=0;n<s.length;n++){let o=xs(s[n],e.points,i);o.length&&t.push(...o)}return t}function Ol(e,i,t,s){let n=0,o=i-1;if(t&&!s)for(;n<i&&!e[n].skip;)n++;for(;n<i&&e[n].skip;)n++;for(n%=i,t&&(o+=n);o>n&&e[o%i].skip;)o--;return o%=i,{start:n,end:o}}function Al(e,i,t,s){let n=e.length,o=[],a=i,r=e[i],l;for(l=i+1;l<=t;++l){let c=e[l%n];c.skip||c.stop?r.skip||(s=!1,o.push({start:i%n,end:(l-1)%n,loop:s}),i=a=c.stop?l:null):(a=l,r.skip&&(i=l)),r=c}return a!==null&&o.push({start:i%n,end:a%n,loop:s}),o}function Lo(e,i){let t=e.points,s=e.options.spanGaps,n=t.length;if(!n)return[];let o=!!e._loop,{start:a,end:r}=Ol(t,n,o,s);if(s===!0)return io(e,[{start:a,end:r,loop:o}],t,i);let l=r<a?r+n:r,c=!!e._fullLoop&&a===0&&r===n-1;return io(e,Al(t,a,l,c),t,i)}function io(e,i,t,s){return!s||!s.setContext||!t?i:Tl(e,i,t,s)}function Tl(e,i,t,s){let n=e._chart.getContext(),o=so(e.options),{_datasetIndex:a,options:{spanGaps:r}}=e,l=t.length,c=[],h=o,d=i[0].start,u=d;function f(p,g,m,b){let _=r?-1:1;if(p!==g){for(p+=l;t[p%l].skip;)p-=_;for(;t[g%l].skip;)g+=_;p%l!==g%l&&(c.push({start:p%l,end:g%l,loop:m,style:b}),h=b,d=g%l)}}for(let p of i){d=r?d:p.start;let g=t[d%l],m;for(u=d+1;u<=p.end;u++){let b=t[u%l];m=so(s.setContext(mt(n,{type:"segment",p0:g,p1:b,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:a}))),Rl(m,h)&&f(d,u-1,p.loop,h),g=b,h=m}d<u-1&&f(d,u-1,p.loop,h)}return c}function so(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function Rl(e,i){if(!i)return!1;let t=[],s=function(n,o){return as(o)?(t.includes(o)||t.push(o),t.indexOf(o)):o};return JSON.stringify(e,s)!==JSON.stringify(i,s)}function Ue(e,i,t){return e.options.clip?e[t]:i[t]}function Ll(e,i){let{xScale:t,yScale:s}=e;return t&&s?{left:Ue(t,i,"left"),right:Ue(t,i,"right"),top:Ue(s,i,"top"),bottom:Ue(s,i,"bottom")}:i}function vs(e,i){let t=i._clip;if(t.disabled)return!1;let s=Ll(i,e.chartArea);return{left:t.left===!1?0:s.left-(t.left===!0?0:t.left),right:t.right===!1?e.width:s.right+(t.right===!0?0:t.right),top:t.top===!1?0:s.top-(t.top===!0?0:t.top),bottom:t.bottom===!1?e.height:s.bottom+(t.bottom===!0?0:t.bottom)}}var Ls=class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(i,t,s,n){let o=t.listeners[n],a=t.duration;o.forEach(r=>r({chart:i,initial:t.initial,numSteps:a,currentStep:Math.min(s-t.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=is.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(i=Date.now()){let t=0;this._charts.forEach((s,n)=>{if(!s.running||!s.items.length)return;let o=s.items,a=o.length-1,r=!1,l;for(;a>=0;--a)l=o[a],l._active?(l._total>s.duration&&(s.duration=l._total),l.tick(i),r=!0):(o[a]=o[o.length-1],o.pop());r&&(n.draw(),this._notify(n,s,i,"progress")),o.length||(s.running=!1,this._notify(n,s,i,"complete"),s.initial=!1),t+=o.length}),this._lastDate=i,t===0&&(this._running=!1)}_getAnims(i){let t=this._charts,s=t.get(i);return s||(s={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(i,s)),s}listen(i,t,s){this._getAnims(i).listeners[t].push(s)}add(i,t){!t||!t.length||this._getAnims(i).items.push(...t)}has(i){return this._getAnims(i).items.length>0}start(i){let t=this._charts.get(i);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((s,n)=>Math.max(s,n._duration),0),this._refresh())}running(i){if(!this._running)return!1;let t=this._charts.get(i);return!(!t||!t.running||!t.items.length)}stop(i){let t=this._charts.get(i);if(!t||!t.items.length)return;let s=t.items,n=s.length-1;for(;n>=0;--n)s[n].cancel();t.items=[],this._notify(i,t,Date.now(),"complete")}remove(i){return this._charts.delete(i)}},bt=new Ls,Eo="transparent",El={boolean(e,i,t){return t>.5?i:e},color(e,i,t){let s=rs(e||Eo),n=s.valid&&rs(i||Eo);return n&&n.valid?n.mix(s,t).hexString():i},number(e,i,t){return e+(i-e)*t}},Es=class{constructor(i,t,s,n){let o=t[s];n=ie([i.to,n,o,i.from]);let a=ie([i.from,o,n]);this._active=!0,this._fn=i.fn||El[i.type||typeof a],this._easing=Xt[i.easing]||Xt.linear,this._start=Math.floor(Date.now()+(i.delay||0)),this._duration=this._total=Math.floor(i.duration),this._loop=!!i.loop,this._target=t,this._prop=s,this._from=a,this._to=n,this._promises=void 0}active(){return this._active}update(i,t,s){if(this._active){this._notify(!1);let n=this._target[this._prop],o=s-this._start,a=this._duration-o;this._start=s,this._duration=Math.floor(Math.max(a,i.duration)),this._total+=o,this._loop=!!i.loop,this._to=ie([i.to,t,n,i.from]),this._from=ie([i.from,n,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(i){let t=i-this._start,s=this._duration,n=this._prop,o=this._from,a=this._loop,r=this._to,l;if(this._active=o!==r&&(a||t<s),!this._active){this._target[n]=r,this._notify(!0);return}if(t<0){this._target[n]=o;return}l=t/s%2,l=a&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[n]=this._fn(o,r,l)}wait(){let i=this._promises||(this._promises=[]);return new Promise((t,s)=>{i.push({res:t,rej:s})})}_notify(i){let t=i?"res":"rej",s=this._promises||[];for(let n=0;n<s.length;n++)s[n][t]()}},mi=class{constructor(i,t){this._chart=i,this._properties=new Map,this.configure(t)}configure(i){if(!A(i))return;let t=Object.keys(F.animation),s=this._properties;Object.getOwnPropertyNames(i).forEach(n=>{let o=i[n];if(!A(o))return;let a={};for(let r of t)a[r]=o[r];(z(o.properties)&&o.properties||[n]).forEach(r=>{(r===n||!s.has(r))&&s.set(r,a)})})}_animateOptions(i,t){let s=t.options,n=Fl(i,s);if(!n)return[];let o=this._createAnimations(n,s);return s.$shared&&Il(i.options.$animations,s).then(()=>{i.options=s},()=>{}),o}_createAnimations(i,t){let s=this._properties,n=[],o=i.$animations||(i.$animations={}),a=Object.keys(t),r=Date.now(),l;for(l=a.length-1;l>=0;--l){let c=a[l];if(c.charAt(0)==="$")continue;if(c==="options"){n.push(...this._animateOptions(i,t));continue}let h=t[c],d=o[c],u=s.get(c);if(d)if(u&&d.active()){d.update(u,h,r);continue}else d.cancel();if(!u||!u.duration){i[c]=h;continue}o[c]=d=new Es(u,i,c,h),n.push(d)}return n}update(i,t){if(this._properties.size===0){Object.assign(i,t);return}let s=this._createAnimations(i,t);if(s.length)return bt.add(this._chart,s),!0}};function Il(e,i){let t=[],s=Object.keys(i);for(let n=0;n<s.length;n++){let o=e[s[n]];o&&o.active()&&t.push(o.wait())}return Promise.all(t)}function Fl(e,i){if(!i)return;let t=e.options;if(!t){e.options=i;return}return t.$shared&&(e.options=t=Object.assign({},t,{$shared:!1,$animations:{}})),t}function Io(e,i){let t=e&&e.options||{},s=t.reverse,n=t.min===void 0?i:0,o=t.max===void 0?i:0;return{start:s?o:n,end:s?n:o}}function zl(e,i,t){if(t===!1)return!1;let s=Io(e,t),n=Io(i,t);return{top:n.end,right:s.end,bottom:n.start,left:s.start}}function Bl(e){let i,t,s,n;return A(e)?(i=e.top,t=e.right,s=e.bottom,n=e.left):i=t=s=n=e,{top:i,right:t,bottom:s,left:n,disabled:e===!1}}function Ea(e,i){let t=[],s=e._getSortedDatasetMetas(i),n,o;for(n=0,o=s.length;n<o;++n)t.push(s[n].index);return t}function Fo(e,i,t,s={}){let n=e.keys,o=s.mode==="single",a,r,l,c;if(i===null)return;let h=!1;for(a=0,r=n.length;a<r;++a){if(l=+n[a],l===t){if(h=!0,s.all)continue;break}c=e.values[l],N(c)&&(o||i===0||nt(i)===nt(c))&&(i+=c)}return!h&&!s.all?0:i}function Vl(e,i){let{iScale:t,vScale:s}=i,n=t.axis==="x"?"x":"y",o=s.axis==="x"?"x":"y",a=Object.keys(e),r=new Array(a.length),l,c,h;for(l=0,c=a.length;l<c;++l)h=a[l],r[l]={[n]:h,[o]:e[h]};return r}function ws(e,i){let t=e&&e.options.stacked;return t||t===void 0&&i.stack!==void 0}function Nl(e,i,t){return`${e.id}.${i.id}.${t.stack||t.type}`}function Hl(e){let{min:i,max:t,minDefined:s,maxDefined:n}=e.getUserBounds();return{min:s?i:Number.NEGATIVE_INFINITY,max:n?t:Number.POSITIVE_INFINITY}}function Wl(e,i,t){let s=e[i]||(e[i]={});return s[t]||(s[t]={})}function zo(e,i,t,s){for(let n of i.getMatchingVisibleMetas(s).reverse()){let o=e[n.index];if(t&&o>0||!t&&o<0)return n.index}return null}function Bo(e,i){let{chart:t,_cachedMeta:s}=e,n=t._stacks||(t._stacks={}),{iScale:o,vScale:a,index:r}=s,l=o.axis,c=a.axis,h=Nl(o,a,s),d=i.length,u;for(let f=0;f<d;++f){let p=i[f],{[l]:g,[c]:m}=p,b=p._stacks||(p._stacks={});u=b[c]=Wl(n,h,g),u[r]=m,u._top=zo(u,a,!0,s.type),u._bottom=zo(u,a,!1,s.type);let _=u._visualValues||(u._visualValues={});_[r]=m}}function Ms(e,i){let t=e.scales;return Object.keys(t).filter(s=>t[s].axis===i).shift()}function jl(e,i){return mt(e,{active:!1,dataset:void 0,datasetIndex:i,index:i,mode:"default",type:"dataset"})}function $l(e,i,t){return mt(e,{active:!1,dataIndex:i,parsed:void 0,raw:void 0,element:t,index:i,mode:"default",type:"data"})}function ye(e,i){let t=e.controller.index,s=e.vScale&&e.vScale.axis;if(s){i=i||e._parsed;for(let n of i){let o=n._stacks;if(!o||o[s]===void 0||o[s][t]===void 0)return;delete o[s][t],o[s]._visualValues!==void 0&&o[s]._visualValues[t]!==void 0&&delete o[s]._visualValues[t]}}}var ks=e=>e==="reset"||e==="none",Vo=(e,i)=>i?e:Object.assign({},e),Yl=(e,i,t)=>e&&!i.hidden&&i._stacked&&{keys:Ea(t,!0),values:null},At=(()=>{class e{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,s){this.chart=t,this._ctx=t.ctx,this.index=s,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(){let t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=ws(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&&ye(this._cachedMeta),this.index=t}linkScales(){let t=this.chart,s=this._cachedMeta,n=this.getDataset(),o=(u,f,p,g)=>u==="x"?f:u==="r"?g:p,a=s.xAxisID=C(n.xAxisID,Ms(t,"x")),r=s.yAxisID=C(n.yAxisID,Ms(t,"y")),l=s.rAxisID=C(n.rAxisID,Ms(t,"r")),c=s.indexAxis,h=s.iAxisID=o(c,a,r,l),d=s.vAxisID=o(c,r,a,l);s.xScale=this.getScaleForId(a),s.yScale=this.getScaleForId(r),s.rScale=this.getScaleForId(l),s.iScale=this.getScaleForId(h),s.vScale=this.getScaleForId(d)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){let s=this._cachedMeta;return t===s.iScale?s.vScale:s.iScale}reset(){this._update("reset")}_destroy(){let t=this._cachedMeta;this._data&&ts(this._data,this),t._stacked&&ye(t)}_dataCheck(){let t=this.getDataset(),s=t.data||(t.data=[]),n=this._data;if(A(s)){let o=this._cachedMeta;this._data=Vl(s,o)}else if(n!==s){if(n){ts(n,this);let o=this._cachedMeta;ye(o),o._parsed=[]}s&&Object.isExtensible(s)&&po(s,this),this._syncList=[],this._data=s}}addElements(){let t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){let s=this._cachedMeta,n=this.getDataset(),o=!1;this._dataCheck();let a=s._stacked;s._stacked=ws(s.vScale,s),s.stack!==n.stack&&(o=!0,ye(s),s.stack=n.stack),this._resyncElements(t),(o||a!==s._stacked)&&(Bo(this,s._parsed),s._stacked=ws(s.vScale,s))}configure(){let t=this.chart.config,s=t.datasetScopeKeys(this._type),n=t.getOptionScopes(this.getDataset(),s,!0);this.options=t.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,s){let{_cachedMeta:n,_data:o}=this,{iScale:a,_stacked:r}=n,l=a.axis,c=t===0&&s===o.length?!0:n._sorted,h=t>0&&n._parsed[t-1],d,u,f;if(this._parsing===!1)n._parsed=o,n._sorted=!0,f=o;else{z(o[t])?f=this.parseArrayData(n,o,t,s):A(o[t])?f=this.parseObjectData(n,o,t,s):f=this.parsePrimitiveData(n,o,t,s);let p=()=>u[l]===null||h&&u[l]<h[l];for(d=0;d<s;++d)n._parsed[d+t]=u=f[d],c&&(p()&&(c=!1),h=u);n._sorted=c}r&&Bo(this,f)}parsePrimitiveData(t,s,n,o){let{iScale:a,vScale:r}=t,l=a.axis,c=r.axis,h=a.getLabels(),d=a===r,u=new Array(o),f,p,g;for(f=0,p=o;f<p;++f)g=f+n,u[f]={[l]:d||a.parse(h[g],g),[c]:r.parse(s[g],g)};return u}parseArrayData(t,s,n,o){let{xScale:a,yScale:r}=t,l=new Array(o),c,h,d,u;for(c=0,h=o;c<h;++c)d=c+n,u=s[d],l[c]={x:a.parse(u[0],d),y:r.parse(u[1],d)};return l}parseObjectData(t,s,n,o){let{xScale:a,yScale:r}=t,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,h=new Array(o),d,u,f,p;for(d=0,u=o;d<u;++d)f=d+n,p=s[f],h[d]={x:a.parse(pt(p,l),f),y:r.parse(pt(p,c),f)};return h}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,s,n){let o=this.chart,a=this._cachedMeta,r=s[t.axis],l={keys:Ea(o,!0),values:s._stacks[t.axis]._visualValues};return Fo(l,r,a.index,{mode:n})}updateRangeFromParsed(t,s,n,o){let a=n[s.axis],r=a===null?NaN:a,l=o&&n._stacks[s.axis];o&&l&&(o.values=l,r=Fo(o,a,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r)}getMinMax(t,s){let n=this._cachedMeta,o=n._parsed,a=n._sorted&&t===n.iScale,r=o.length,l=this._getOtherScale(t),c=Yl(s,n,this.chart),h={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:d,max:u}=Hl(l),f,p;function g(){p=o[f];let m=p[l.axis];return!N(p[t.axis])||d>m||u<m}for(f=0;f<r&&!(!g()&&(this.updateRangeFromParsed(h,t,p,c),a));++f);if(a){for(f=r-1;f>=0;--f)if(!g()){this.updateRangeFromParsed(h,t,p,c);break}}return h}getAllParsedValues(t){let s=this._cachedMeta._parsed,n=[],o,a,r;for(o=0,a=s.length;o<a;++o)r=s[o][t.axis],N(r)&&n.push(r);return n}getMaxOverflow(){return!1}getLabelAndValue(t){let s=this._cachedMeta,n=s.iScale,o=s.vScale,a=this.getParsed(t);return{label:n?""+n.getLabelForValue(a[n.axis]):"",value:o?""+o.getLabelForValue(a[o.axis]):""}}_update(t){let s=this._cachedMeta;this.update(t||"default"),s._clip=Bl(C(this.options.clip,zl(s.xScale,s.yScale,this.getMaxOverflow())))}update(t){}draw(){let t=this._ctx,s=this.chart,n=this._cachedMeta,o=n.data||[],a=s.chartArea,r=[],l=this._drawStart||0,c=this._drawCount||o.length-l,h=this.options.drawActiveElementsOnTop,d;for(n.dataset&&n.dataset.draw(t,a,l,c),d=l;d<l+c;++d){let u=o[d];u.hidden||(u.active&&h?r.push(u):u.draw(t,a))}for(d=0;d<r.length;++d)r[d].draw(t,a)}getStyle(t,s){let n=s?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(t||0,n)}getContext(t,s,n){let o=this.getDataset(),a;if(t>=0&&t<this._cachedMeta.data.length){let r=this._cachedMeta.data[t];a=r.$context||(r.$context=$l(this.getContext(),t,r)),a.parsed=this.getParsed(t),a.raw=o.data[t],a.index=a.dataIndex=t}else a=this.$context||(this.$context=jl(this.chart.getContext(),this.index)),a.dataset=o,a.index=a.datasetIndex=this.index;return a.active=!!s,a.mode=n,a}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,s){return this._resolveElementOptions(this.dataElementType.id,s,t)}_resolveElementOptions(t,s="default",n){let o=s==="active",a=this._cachedDataOpts,r=t+"-"+s,l=a[r],c=this.enableOptionSharing&&Zt(n);if(l)return Vo(l,c);let h=this.chart.config,d=h.datasetElementScopeKeys(this._type,t),u=o?[`${t}Hover`,"hover",t,""]:[t,""],f=h.getOptionScopes(this.getDataset(),d),p=Object.keys(F.elements[t]),g=()=>this.getContext(n,o,s),m=h.resolveNamedOptions(f,p,g,u);return m.$shared&&(m.$shared=c,a[r]=Object.freeze(Vo(m,c))),m}_resolveAnimations(t,s,n){let o=this.chart,a=this._cachedDataOpts,r=`animation-${s}`,l=a[r];if(l)return l;let c;if(o.options.animation!==!1){let d=this.chart.config,u=d.datasetAnimationScopeKeys(this._type,s),f=d.getOptionScopes(this.getDataset(),u);c=d.createResolver(f,this.getContext(t,n,s))}let h=new mi(o,c&&c.animations);return c&&c._cacheable&&(a[r]=Object.freeze(h)),h}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,s){return!s||ks(t)||this.chart._animationsDisabled}_getSharedOptions(t,s){let n=this.resolveDataElementOptions(t,s),o=this._sharedOptions,a=this.getSharedOptions(n),r=this.includeOptions(s,a)||a!==o;return this.updateSharedOptions(a,s,n),{sharedOptions:a,includeOptions:r}}updateElement(t,s,n,o){ks(o)?Object.assign(t,n):this._resolveAnimations(s,o).update(t,n)}updateSharedOptions(t,s,n){t&&!ks(s)&&this._resolveAnimations(void 0,s).update(t,n)}_setStyle(t,s,n,o){t.active=o;let a=this.getStyle(s,o);this._resolveAnimations(s,n,o).update(t,{options:!o&&this.getSharedOptions(a)||a})}removeHoverStyle(t,s,n){this._setStyle(t,n,"active",!1)}setHoverStyle(t,s,n){this._setStyle(t,n,"active",!0)}_removeDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){let s=this._data,n=this._cachedMeta.data;for(let[l,c,h]of this._syncList)this[l](c,h);this._syncList=[];let o=n.length,a=s.length,r=Math.min(a,o);r&&this.parse(0,r),a>o?this._insertElements(o,a-o,t):a<o&&this._removeElements(a,o-a)}_insertElements(t,s,n=!0){let o=this._cachedMeta,a=o.data,r=t+s,l,c=h=>{for(h.length+=s,l=h.length-1;l>=r;l--)h[l]=h[l-s]};for(c(a),l=t;l<r;++l)a[l]=new this.dataElementType;this._parsing&&c(o._parsed),this.parse(t,s),n&&this.updateElements(a,t,s,"reset")}updateElements(t,s,n,o){}_removeElements(t,s){let n=this._cachedMeta;if(this._parsing){let o=n._parsed.splice(t,s);n._stacked&&ye(n,o)}n.data.splice(t,s)}_sync(t){if(this._parsing)this._syncList.push(t);else{let[s,n,o]=t;this[s](n,o)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){let t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,s){s&&this._sync(["_removeElements",t,s]);let n=arguments.length-2;n&&this._sync(["_insertElements",t,n])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}return e})();function Ul(e,i){if(!e._cache.$bar){let t=e.getMatchingVisibleMetas(i),s=[];for(let n=0,o=t.length;n<o;n++)s=s.concat(t[n].controller.getAllParsedValues(e));e._cache.$bar=es(s.sort((n,o)=>n-o))}return e._cache.$bar}function Xl(e){let i=e.iScale,t=Ul(i,e.type),s=i._length,n,o,a,r,l=()=>{a===32767||a===-32768||(Zt(r)&&(s=Math.min(s,Math.abs(a-r)||s)),r=a)};for(n=0,o=t.length;n<o;++n)a=i.getPixelForValue(t[n]),l();for(r=void 0,n=0,o=i.ticks.length;n<o;++n)a=i.getPixelForTick(n),l();return s}function Kl(e,i,t,s){let n=t.barThickness,o,a;return O(n)?(o=i.min*t.categoryPercentage,a=t.barPercentage):(o=n*s,a=1),{chunk:o/s,ratio:a,start:i.pixels[e]-o/2}}function ql(e,i,t,s){let n=i.pixels,o=n[e],a=e>0?n[e-1]:null,r=e<n.length-1?n[e+1]:null,l=t.categoryPercentage;a===null&&(a=o-(r===null?i.end-i.start:r-o)),r===null&&(r=o+o-a);let c=o-(o-Math.min(a,r))/2*l;return{chunk:Math.abs(r-a)/2*l/s,ratio:t.barPercentage,start:c}}function Gl(e,i,t,s){let n=t.parse(e[0],s),o=t.parse(e[1],s),a=Math.min(n,o),r=Math.max(n,o),l=a,c=r;Math.abs(a)>Math.abs(r)&&(l=r,c=a),i[t.axis]=c,i._custom={barStart:l,barEnd:c,start:n,end:o,min:a,max:r}}function Ia(e,i,t,s){return z(e)?Gl(e,i,t,s):i[t.axis]=t.parse(e,s),i}function No(e,i,t,s){let n=e.iScale,o=e.vScale,a=n.getLabels(),r=n===o,l=[],c,h,d,u;for(c=t,h=t+s;c<h;++c)u=i[c],d={},d[n.axis]=r||n.parse(a[c],c),l.push(Ia(u,d,o,c));return l}function Ss(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function Zl(e,i,t){return e!==0?nt(e):(i.isHorizontal()?1:-1)*(i.min>=t?1:-1)}function Jl(e){let i,t,s,n,o;return e.horizontal?(i=e.base>e.x,t="left",s="right"):(i=e.base<e.y,t="bottom",s="top"),i?(n="end",o="start"):(n="start",o="end"),{start:t,end:s,reverse:i,top:n,bottom:o}}function Ql(e,i,t,s){let n=i.borderSkipped,o={};if(!n){e.borderSkipped=o;return}if(n===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}let{start:a,end:r,reverse:l,top:c,bottom:h}=Jl(e);n==="middle"&&t&&(e.enableBorderRadius=!0,(t._top||0)===s?n=c:(t._bottom||0)===s?n=h:(o[Ho(h,a,r,l)]=!0,n=c)),o[Ho(n,a,r,l)]=!0,e.borderSkipped=o}function Ho(e,i,t,s){return s?(e=tc(e,i,t),e=Wo(e,t,i)):e=Wo(e,i,t),e}function tc(e,i,t){return e===i?t:e===t?i:e}function Wo(e,i,t){return e==="start"?i:e==="end"?t:e}function ec(e,{inflateAmount:i},t){e.inflateAmount=i==="auto"?t===1?.33:0:i}var ic=(()=>{class e extends At{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,s,n,o){return No(t,s,n,o)}parseArrayData(t,s,n,o){return No(t,s,n,o)}parseObjectData(t,s,n,o){let{iScale:a,vScale:r}=t,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,h=a.axis==="x"?l:c,d=r.axis==="x"?l:c,u=[],f,p,g,m;for(f=n,p=n+o;f<p;++f)m=s[f],g={},g[a.axis]=a.parse(pt(m,h),f),u.push(Ia(pt(m,d),g,r,f));return u}updateRangeFromParsed(t,s,n,o){super.updateRangeFromParsed(t,s,n,o);let a=n._custom;a&&s===this._cachedMeta.vScale&&(t.min=Math.min(t.min,a.min),t.max=Math.max(t.max,a.max))}getMaxOverflow(){return 0}getLabelAndValue(t){let s=this._cachedMeta,{iScale:n,vScale:o}=s,a=this.getParsed(t),r=a._custom,l=Ss(r)?"["+r.start+", "+r.end+"]":""+o.getLabelForValue(a[o.axis]);return{label:""+n.getLabelForValue(a[n.axis]),value:l}}initialize(){this.enableOptionSharing=!0,super.initialize();let t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){let s=this._cachedMeta;this.updateElements(s.data,0,s.data.length,t)}updateElements(t,s,n,o){let a=o==="reset",{index:r,_cachedMeta:{vScale:l}}=this,c=l.getBasePixel(),h=l.isHorizontal(),d=this._getRuler(),{sharedOptions:u,includeOptions:f}=this._getSharedOptions(s,o);for(let p=s;p<s+n;p++){let g=this.getParsed(p),m=a||O(g[l.axis])?{base:c,head:c}:this._calculateBarValuePixels(p),b=this._calculateBarIndexPixels(p,d),_=(g._stacks||{})[l.axis],y={horizontal:h,base:m.base,enableBorderRadius:!_||Ss(g._custom)||r===_._top||r===_._bottom,x:h?m.head:b.center,y:h?b.center:m.head,height:h?b.size:Math.abs(m.size),width:h?Math.abs(m.size):b.size};f&&(y.options=u||this.resolveDataElementOptions(p,t[p].active?"active":o));let w=y.options||t[p].options;Ql(y,w,_,r),ec(y,w,d.ratio),this.updateElement(t[p],p,y,o)}}_getStacks(t,s){let{iScale:n}=this._cachedMeta,o=n.getMatchingVisibleMetas(this._type).filter(d=>d.controller.options.grouped),a=n.options.stacked,r=[],l=this._cachedMeta.controller.getParsed(s),c=l&&l[n.axis],h=d=>{let u=d._parsed.find(p=>p[n.axis]===c),f=u&&u[d.vScale.axis];if(O(f)||isNaN(f))return!0};for(let d of o)if(!(s!==void 0&&h(d))&&((a===!1||r.indexOf(d.stack)===-1||a===void 0&&d.stack===void 0)&&r.push(d.stack),d.index===t))break;return r.length||r.push(void 0),r}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){let t=this.chart.scales,s=this.chart.options.indexAxis;return Object.keys(t).filter(n=>t[n].axis===s).shift()}_getAxis(){let t={},s=this.getFirstScaleIdForIndexAxis();for(let n of this.chart.data.datasets)t[C(this.chart.options.indexAxis==="x"?n.xAxisID:n.yAxisID,s)]=!0;return Object.keys(t)}_getStackIndex(t,s,n){let o=this._getStacks(t,n),a=s!==void 0?o.indexOf(s):-1;return a===-1?o.length-1:a}_getRuler(){let t=this.options,s=this._cachedMeta,n=s.iScale,o=[],a,r;for(a=0,r=s.data.length;a<r;++a)o.push(n.getPixelForValue(this.getParsed(a)[n.axis],a));let l=t.barThickness;return{min:l||Xl(s),pixels:o,start:n._startPixel,end:n._endPixel,stackCount:this._getStackCount(),scale:n,grouped:t.grouped,ratio:l?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){let{_cachedMeta:{vScale:s,_stacked:n,index:o},options:{base:a,minBarLength:r}}=this,l=a||0,c=this.getParsed(t),h=c._custom,d=Ss(h),u=c[s.axis],f=0,p=n?this.applyStack(s,c,n):u,g,m;p!==u&&(f=p-u,p=u),d&&(u=h.barStart,p=h.barEnd-h.barStart,u!==0&&nt(u)!==nt(h.barEnd)&&(f=0),f+=u);let b=!O(a)&&!d?a:f,_=s.getPixelForValue(b);if(this.chart.getDataVisibility(t)?g=s.getPixelForValue(f+p):g=_,m=g-_,Math.abs(m)<r){m=Zl(m,s,l)*r,u===l&&(_-=m/2);let y=s.getPixelForDecimal(0),w=s.getPixelForDecimal(1),x=Math.min(y,w),v=Math.max(y,w);_=Math.max(Math.min(_,v),x),g=_+m,n&&!d&&(c._stacks[s.axis]._visualValues[o]=s.getValueForPixel(g)-s.getValueForPixel(_))}if(_===s.getPixelForValue(l)){let y=nt(m)*s.getLineWidthForValue(l)/2;_+=y,m-=y}return{size:m,base:_,head:g,center:g+m/2}}_calculateBarIndexPixels(t,s){let n=s.scale,o=this.options,a=o.skipNull,r=C(o.maxBarThickness,1/0),l,c,h=this._getAxisCount();if(s.grouped){let d=a?this._getStackCount(t):s.stackCount,u=o.barThickness==="flex"?ql(t,s,o,d*h):Kl(t,s,o,d*h),f=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,p=this._getAxis().indexOf(C(f,this.getFirstScaleIdForIndexAxis())),g=this._getStackIndex(this.index,this._cachedMeta.stack,a?t:void 0)+p;l=u.start+u.chunk*g+u.chunk/2,c=Math.min(r,u.chunk*u.ratio)}else l=n.getPixelForValue(this.getParsed(t)[n.axis],t),c=Math.min(r,s.min*s.ratio);return{base:l-c/2,head:l+c/2,center:l,size:c}}draw(){let t=this._cachedMeta,s=t.vScale,n=t.data,o=n.length,a=0;for(;a<o;++a)this.getParsed(a)[s.axis]!==null&&!n[a].hidden&&n[a].draw(this._ctx)}}return e})(),sc=(()=>{class e extends At{static id="bubble";static defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};static overrides={scales:{x:{type:"linear"},y:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,s,n,o){let a=super.parsePrimitiveData(t,s,n,o);for(let r=0;r<a.length;r++)a[r]._custom=this.resolveDataElementOptions(r+n).radius;return a}parseArrayData(t,s,n,o){let a=super.parseArrayData(t,s,n,o);for(let r=0;r<a.length;r++){let l=s[n+r];a[r]._custom=C(l[2],this.resolveDataElementOptions(r+n).radius)}return a}parseObjectData(t,s,n,o){let a=super.parseObjectData(t,s,n,o);for(let r=0;r<a.length;r++){let l=s[n+r];a[r]._custom=C(l&&l.r&&+l.r,this.resolveDataElementOptions(r+n).radius)}return a}getMaxOverflow(){let t=this._cachedMeta.data,s=0;for(let n=t.length-1;n>=0;--n)s=Math.max(s,t[n].size(this.resolveDataElementOptions(n))/2);return s>0&&s}getLabelAndValue(t){let s=this._cachedMeta,n=this.chart.data.labels||[],{xScale:o,yScale:a}=s,r=this.getParsed(t),l=o.getLabelForValue(r.x),c=a.getLabelForValue(r.y),h=r._custom;return{label:n[t]||"",value:"("+l+", "+c+(h?", "+h:"")+")"}}update(t){let s=this._cachedMeta.data;this.updateElements(s,0,s.length,t)}updateElements(t,s,n,o){let a=o==="reset",{iScale:r,vScale:l}=this._cachedMeta,{sharedOptions:c,includeOptions:h}=this._getSharedOptions(s,o),d=r.axis,u=l.axis;for(let f=s;f<s+n;f++){let p=t[f],g=!a&&this.getParsed(f),m={},b=m[d]=a?r.getPixelForDecimal(.5):r.getPixelForValue(g[d]),_=m[u]=a?l.getBasePixel():l.getPixelForValue(g[u]);m.skip=isNaN(b)||isNaN(_),h&&(m.options=c||this.resolveDataElementOptions(f,p.active?"active":o),a&&(m.options.radius=0)),this.updateElement(p,f,m,o)}}resolveDataElementOptions(t,s){let n=this.getParsed(t),o=super.resolveDataElementOptions(t,s);o.$shared&&(o=Object.assign({},o,{$shared:!1}));let a=o.radius;return s!=="active"&&(o.radius=0),o.radius+=C(n&&n._custom,a),o}}return e})();function nc(e,i,t){let s=1,n=1,o=0,a=0;if(i<B){let r=e,l=r+i,c=Math.cos(r),h=Math.sin(r),d=Math.cos(l),u=Math.sin(l),f=(y,w,x)=>Qt(y,r,l,!0)?1:Math.max(w,w*t,x,x*t),p=(y,w,x)=>Qt(y,r,l,!0)?-1:Math.min(w,w*t,x,x*t),g=f(0,c,d),m=f(H,h,u),b=p(R,c,d),_=p(R+H,h,u);s=(g-b)/2,n=(m-_)/2,o=-(g+b)/2,a=-(m+_)/2}return{ratioX:s,ratioY:n,offsetX:o,offsetY:a}}var tn=(()=>{class e extends At{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let s=t.data,{labels:{pointStyle:n,textAlign:o,color:a,useBorderRadius:r,borderRadius:l}}=t.legend.options;return s.labels.length&&s.datasets.length?s.labels.map((c,h)=>{let u=t.getDatasetMeta(0).controller.getStyle(h);return{text:c,fillStyle:u.backgroundColor,fontColor:a,hidden:!t.getDataVisibility(h),lineDash:u.borderDash,lineDashOffset:u.borderDashOffset,lineJoin:u.borderJoinStyle,lineWidth:u.borderWidth,strokeStyle:u.borderColor,textAlign:o,pointStyle:n,borderRadius:r&&(l||u.borderRadius),index:h}}):[]}},onClick(t,s,n){n.chart.toggleDataVisibility(s.index),n.chart.update()}}}};constructor(t,s){super(t,s),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,s){let n=this.getDataset().data,o=this._cachedMeta;if(this._parsing===!1)o._parsed=n;else{let a=c=>+n[c];if(A(n[t])){let{key:c="value"}=this._parsing;a=h=>+pt(n[h],c)}let r,l;for(r=t,l=t+s;r<l;++r)o._parsed[r]=a(r)}}_getRotation(){return it(this.options.rotation-90)}_getCircumference(){return it(this.options.circumference)}_getRotationExtents(){let t=B,s=-B;for(let n=0;n<this.chart.data.datasets.length;++n)if(this.chart.isDatasetVisible(n)&&this.chart.getDatasetMeta(n).type===this._type){let o=this.chart.getDatasetMeta(n).controller,a=o._getRotation(),r=o._getCircumference();t=Math.min(t,a),s=Math.max(s,a+r)}return{rotation:t,circumference:s-t}}update(t){let s=this.chart,{chartArea:n}=s,o=this._cachedMeta,a=o.data,r=this.getMaxBorderWidth()+this.getMaxOffset(a)+this.options.spacing,l=Math.max((Math.min(n.width,n.height)-r)/2,0),c=Math.min(oo(this.options.cutout,l),1),h=this._getRingWeight(this.index),{circumference:d,rotation:u}=this._getRotationExtents(),{ratioX:f,ratioY:p,offsetX:g,offsetY:m}=nc(u,d,c),b=(n.width-r)/f,_=(n.height-r)/p,y=Math.max(Math.min(b,_)/2,0),w=Ki(this.options.radius,y),x=Math.max(w*c,0),v=(w-x)/this._getVisibleDatasetWeightTotal();this.offsetX=g*w,this.offsetY=m*w,o.total=this.calculateTotal(),this.outerRadius=w-v*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-v*h,0),this.updateElements(a,0,a.length,t)}_circumference(t,s){let n=this.options,o=this._cachedMeta,a=this._getCircumference();return s&&n.animation.animateRotate||!this.chart.getDataVisibility(t)||o._parsed[t]===null||o.data[t].hidden?0:this.calculateCircumference(o._parsed[t]*a/B)}updateElements(t,s,n,o){let a=o==="reset",r=this.chart,l=r.chartArea,h=r.options.animation,d=(l.left+l.right)/2,u=(l.top+l.bottom)/2,f=a&&h.animateScale,p=f?0:this.innerRadius,g=f?0:this.outerRadius,{sharedOptions:m,includeOptions:b}=this._getSharedOptions(s,o),_=this._getRotation(),y;for(y=0;y<s;++y)_+=this._circumference(y,a);for(y=s;y<s+n;++y){let w=this._circumference(y,a),x=t[y],v={x:d+this.offsetX,y:u+this.offsetY,startAngle:_,endAngle:_+w,circumference:w,outerRadius:g,innerRadius:p};b&&(v.options=m||this.resolveDataElementOptions(y,x.active?"active":o)),_+=w,this.updateElement(x,y,v,o)}}calculateTotal(){let t=this._cachedMeta,s=t.data,n=0,o;for(o=0;o<s.length;o++){let a=t._parsed[o];a!==null&&!isNaN(a)&&this.chart.getDataVisibility(o)&&!s[o].hidden&&(n+=Math.abs(a))}return n}calculateCircumference(t){let s=this._cachedMeta.total;return s>0&&!isNaN(t)?B*(Math.abs(t)/s):0}getLabelAndValue(t){let s=this._cachedMeta,n=this.chart,o=n.data.labels||[],a=te(s._parsed[t],n.options.locale);return{label:o[t]||"",value:a}}getMaxBorderWidth(t){let s=0,n=this.chart,o,a,r,l,c;if(!t){for(o=0,a=n.data.datasets.length;o<a;++o)if(n.isDatasetVisible(o)){r=n.getDatasetMeta(o),t=r.data,l=r.controller;break}}if(!t)return 0;for(o=0,a=t.length;o<a;++o)c=l.resolveDataElementOptions(o),c.borderAlign!=="inner"&&(s=Math.max(s,c.borderWidth||0,c.hoverBorderWidth||0));return s}getMaxOffset(t){let s=0;for(let n=0,o=t.length;n<o;++n){let a=this.resolveDataElementOptions(n);s=Math.max(s,a.offset||0,a.hoverOffset||0)}return s}_getRingWeightOffset(t){let s=0;for(let n=0;n<t;++n)this.chart.isDatasetVisible(n)&&(s+=this._getRingWeight(n));return s}_getRingWeight(t){return Math.max(C(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}return e})(),oc=(()=>{class e extends At{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){let s=this._cachedMeta,{dataset:n,data:o=[],_dataset:a}=s,r=this.chart._animationsDisabled,{start:l,count:c}=ns(s,o,r);this._drawStart=l,this._drawCount=c,os(s)&&(l=0,c=o.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!a._decimated,n.points=o;let h=this.resolveDatasetElementOptions(t);this.options.showLine||(h.borderWidth=0),h.segment=this.options.segment,this.updateElement(n,void 0,{animated:!r,options:h},t),this.updateElements(o,l,c,t)}updateElements(t,s,n,o){let a=o==="reset",{iScale:r,vScale:l,_stacked:c,_dataset:h}=this._cachedMeta,{sharedOptions:d,includeOptions:u}=this._getSharedOptions(s,o),f=r.axis,p=l.axis,{spanGaps:g,segment:m}=this.options,b=Bt(g)?g:Number.POSITIVE_INFINITY,_=this.chart._animationsDisabled||a||o==="none",y=s+n,w=t.length,x=s>0&&this.getParsed(s-1);for(let v=0;v<w;++v){let k=t[v],M=_?k:{};if(v<s||v>=y){M.skip=!0;continue}let S=this.getParsed(v),D=O(S[p]),P=M[f]=r.getPixelForValue(S[f],v),T=M[p]=a||D?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,S,c):S[p],v);M.skip=isNaN(P)||isNaN(T)||D,M.stop=v>0&&Math.abs(S[f]-x[f])>b,m&&(M.parsed=S,M.raw=h.data[v]),u&&(M.options=d||this.resolveDataElementOptions(v,k.active?"active":o)),_||this.updateElement(k,v,M,o),x=S}}getMaxOverflow(){let t=this._cachedMeta,s=t.dataset,n=s.options&&s.options.borderWidth||0,o=t.data||[];if(!o.length)return n;let a=o[0].size(this.resolveDataElementOptions(0)),r=o[o.length-1].size(this.resolveDataElementOptions(o.length-1));return Math.max(n,a,r)/2}draw(){let t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}return e})(),Fa=(()=>{class e extends At{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let s=t.data;if(s.labels.length&&s.datasets.length){let{labels:{pointStyle:n,color:o}}=t.legend.options;return s.labels.map((a,r)=>{let c=t.getDatasetMeta(0).controller.getStyle(r);return{text:a,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:o,lineWidth:c.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(r),index:r}})}return[]}},onClick(t,s,n){n.chart.toggleDataVisibility(s.index),n.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,s){super(t,s),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){let s=this._cachedMeta,n=this.chart,o=n.data.labels||[],a=te(s._parsed[t].r,n.options.locale);return{label:o[t]||"",value:a}}parseObjectData(t,s,n,o){return gs.bind(this)(t,s,n,o)}update(t){let s=this._cachedMeta.data;this._updateRadius(),this.updateElements(s,0,s.length,t)}getMinMax(){let t=this._cachedMeta,s={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((n,o)=>{let a=this.getParsed(o).r;!isNaN(a)&&this.chart.getDataVisibility(o)&&(a<s.min&&(s.min=a),a>s.max&&(s.max=a))}),s}_updateRadius(){let t=this.chart,s=t.chartArea,n=t.options,o=Math.min(s.right-s.left,s.bottom-s.top),a=Math.max(o/2,0),r=Math.max(n.cutoutPercentage?a/100*n.cutoutPercentage:1,0),l=(a-r)/t.getVisibleDatasetCount();this.outerRadius=a-l*this.index,this.innerRadius=this.outerRadius-l}updateElements(t,s,n,o){let a=o==="reset",r=this.chart,c=r.options.animation,h=this._cachedMeta.rScale,d=h.xCenter,u=h.yCenter,f=h.getIndexAngle(0)-.5*R,p=f,g,m=360/this.countVisibleElements();for(g=0;g<s;++g)p+=this._computeAngle(g,o,m);for(g=s;g<s+n;g++){let b=t[g],_=p,y=p+this._computeAngle(g,o,m),w=r.getDataVisibility(g)?h.getDistanceFromCenterForValue(this.getParsed(g).r):0;p=y,a&&(c.animateScale&&(w=0),c.animateRotate&&(_=y=f));let x={x:d,y:u,innerRadius:0,outerRadius:w,startAngle:_,endAngle:y,options:this.resolveDataElementOptions(g,b.active?"active":o)};this.updateElement(b,g,x,o)}}countVisibleElements(){let t=this._cachedMeta,s=0;return t.data.forEach((n,o)=>{!isNaN(this.getParsed(o).r)&&this.chart.getDataVisibility(o)&&s++}),s}_computeAngle(t,s,n){return this.chart.getDataVisibility(t)?it(this.resolveDataElementOptions(t,s).angle||n):0}}return e})(),ac=(()=>{class e extends tn{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}return e})(),rc=(()=>{class e extends At{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(t){let s=this._cachedMeta.vScale,n=this.getParsed(t);return{label:s.getLabels()[t],value:""+s.getLabelForValue(n[s.axis])}}parseObjectData(t,s,n,o){return gs.bind(this)(t,s,n,o)}update(t){let s=this._cachedMeta,n=s.dataset,o=s.data||[],a=s.iScale.getLabels();if(n.points=o,t!=="resize"){let r=this.resolveDatasetElementOptions(t);this.options.showLine||(r.borderWidth=0);let l={_loop:!0,_fullLoop:a.length===o.length,options:r};this.updateElement(n,void 0,l,t)}this.updateElements(o,0,o.length,t)}updateElements(t,s,n,o){let a=this._cachedMeta.rScale,r=o==="reset";for(let l=s;l<s+n;l++){let c=t[l],h=this.resolveDataElementOptions(l,c.active?"active":o),d=a.getPointPositionForValue(l,this.getParsed(l).r),u=r?a.xCenter:d.x,f=r?a.yCenter:d.y,p={x:u,y:f,angle:d.angle,skip:isNaN(u)||isNaN(f),options:h};this.updateElement(c,l,p,o)}}}return e})(),lc=(()=>{class e extends At{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(t){let s=this._cachedMeta,n=this.chart.data.labels||[],{xScale:o,yScale:a}=s,r=this.getParsed(t),l=o.getLabelForValue(r.x),c=a.getLabelForValue(r.y);return{label:n[t]||"",value:"("+l+", "+c+")"}}update(t){let s=this._cachedMeta,{data:n=[]}=s,o=this.chart._animationsDisabled,{start:a,count:r}=ns(s,n,o);if(this._drawStart=a,this._drawCount=r,os(s)&&(a=0,r=n.length),this.options.showLine){this.datasetElementType||this.addElements();let{dataset:l,_dataset:c}=s;l._chart=this.chart,l._datasetIndex=this.index,l._decimated=!!c._decimated,l.points=n;let h=this.resolveDatasetElementOptions(t);h.segment=this.options.segment,this.updateElement(l,void 0,{animated:!o,options:h},t)}else this.datasetElementType&&(delete s.dataset,this.datasetElementType=!1);this.updateElements(n,a,r,t)}addElements(){let{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,s,n,o){let a=o==="reset",{iScale:r,vScale:l,_stacked:c,_dataset:h}=this._cachedMeta,d=this.resolveDataElementOptions(s,o),u=this.getSharedOptions(d),f=this.includeOptions(o,u),p=r.axis,g=l.axis,{spanGaps:m,segment:b}=this.options,_=Bt(m)?m:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||a||o==="none",w=s>0&&this.getParsed(s-1);for(let x=s;x<s+n;++x){let v=t[x],k=this.getParsed(x),M=y?v:{},S=O(k[g]),D=M[p]=r.getPixelForValue(k[p],x),P=M[g]=a||S?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,k,c):k[g],x);M.skip=isNaN(D)||isNaN(P)||S,M.stop=x>0&&Math.abs(k[p]-w[p])>_,b&&(M.parsed=k,M.raw=h.data[x]),f&&(M.options=u||this.resolveDataElementOptions(x,v.active?"active":o)),y||this.updateElement(v,x,M,o),w=k}this.updateSharedOptions(u,o,d)}getMaxOverflow(){let t=this._cachedMeta,s=t.data||[];if(!this.options.showLine){let l=0;for(let c=s.length-1;c>=0;--c)l=Math.max(l,s[c].size(this.resolveDataElementOptions(c))/2);return l>0&&l}let n=t.dataset,o=n.options&&n.options.borderWidth||0;if(!s.length)return o;let a=s[0].size(this.resolveDataElementOptions(0)),r=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(o,a,r)/2}}return e})(),cc=Object.freeze({__proto__:null,BarController:ic,BubbleController:sc,DoughnutController:tn,LineController:oc,PieController:ac,PolarAreaController:Fa,RadarController:rc,ScatterController:lc});function Nt(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}var Is=class e{static override(i){Object.assign(e.prototype,i)}options;constructor(i){this.options=i||{}}init(){}formats(){return Nt()}parse(){return Nt()}format(){return Nt()}add(){return Nt()}diff(){return Nt()}startOf(){return Nt()}endOf(){return Nt()}},hc={_date:Is};function dc(e,i,t,s){let{controller:n,data:o,_sorted:a}=e,r=n._cachedMeta.iScale,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(r&&i===r.axis&&i!=="r"&&a&&o.length){let c=r._reversePixels?uo:at;if(s){if(n._sharedOptions){let h=o[0],d=typeof h.getRange=="function"&&h.getRange(i);if(d){let u=c(o,i,t-d),f=c(o,i,t+d);return{lo:u.lo,hi:f.hi}}}}else{let h=c(o,i,t);if(l){let{vScale:d}=n._cachedMeta,{_parsed:u}=e,f=u.slice(0,h.lo+1).reverse().findIndex(g=>!O(g[d.axis]));h.lo-=Math.max(0,f);let p=u.slice(h.hi).findIndex(g=>!O(g[d.axis]));h.hi+=Math.max(0,p)}return h}}return{lo:0,hi:o.length-1}}function Ae(e,i,t,s,n){let o=e.getSortedVisibleDatasetMetas(),a=t[i];for(let r=0,l=o.length;r<l;++r){let{index:c,data:h}=o[r],{lo:d,hi:u}=dc(o[r],i,a,n);for(let f=d;f<=u;++f){let p=h[f];p.skip||s(p,c,f)}}}function uc(e){let i=e.indexOf("x")!==-1,t=e.indexOf("y")!==-1;return function(s,n){let o=i?Math.abs(s.x-n.x):0,a=t?Math.abs(s.y-n.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(a,2))}}function Cs(e,i,t,s,n){let o=[];return!n&&!e.isPointInArea(i)||Ae(e,t,i,function(r,l,c){!n&&!rt(r,e.chartArea,0)||r.inRange(i.x,i.y,s)&&o.push({element:r,datasetIndex:l,index:c})},!0),o}function fc(e,i,t,s){let n=[];function o(a,r,l){let{startAngle:c,endAngle:h}=a.getProps(["startAngle","endAngle"],s),{angle:d}=Qi(a,{x:i.x,y:i.y});Qt(d,c,h)&&n.push({element:a,datasetIndex:r,index:l})}return Ae(e,t,i,o),n}function gc(e,i,t,s,n,o){let a=[],r=uc(t),l=Number.POSITIVE_INFINITY;function c(h,d,u){let f=h.inRange(i.x,i.y,n);if(s&&!f)return;let p=h.getCenterPoint(n);if(!(!!o||e.isPointInArea(p))&&!f)return;let m=r(i,p);m<l?(a=[{element:h,datasetIndex:d,index:u}],l=m):m===l&&a.push({element:h,datasetIndex:d,index:u})}return Ae(e,t,i,c),a}function Ps(e,i,t,s,n,o){return!o&&!e.isPointInArea(i)?[]:t==="r"&&!s?fc(e,i,t,n):gc(e,i,t,s,n,o)}function jo(e,i,t,s,n){let o=[],a=t==="x"?"inXRange":"inYRange",r=!1;return Ae(e,t,i,(l,c,h)=>{l[a]&&l[a](i[t],n)&&(o.push({element:l,datasetIndex:c,index:h}),r=r||l.inRange(i.x,i.y,n))}),s&&!r?[]:o}var pc={evaluateInteractionItems:Ae,modes:{index(e,i,t,s){let n=Dt(i,e),o=t.axis||"x",a=t.includeInvisible||!1,r=t.intersect?Cs(e,n,o,s,a):Ps(e,n,o,!1,s,a),l=[];return r.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{let h=r[0].index,d=c.data[h];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:h})}),l):[]},dataset(e,i,t,s){let n=Dt(i,e),o=t.axis||"xy",a=t.includeInvisible||!1,r=t.intersect?Cs(e,n,o,s,a):Ps(e,n,o,!1,s,a);if(r.length>0){let l=r[0].datasetIndex,c=e.getDatasetMeta(l).data;r=[];for(let h=0;h<c.length;++h)r.push({element:c[h],datasetIndex:l,index:h})}return r},point(e,i,t,s){let n=Dt(i,e),o=t.axis||"xy",a=t.includeInvisible||!1;return Cs(e,n,o,s,a)},nearest(e,i,t,s){let n=Dt(i,e),o=t.axis||"xy",a=t.includeInvisible||!1;return Ps(e,n,o,t.intersect,s,a)},x(e,i,t,s){let n=Dt(i,e);return jo(e,n,"x",t.intersect,s)},y(e,i,t,s){let n=Dt(i,e);return jo(e,n,"y",t.intersect,s)}}},za=["left","top","right","bottom"];function ve(e,i){return e.filter(t=>t.pos===i)}function $o(e,i){return e.filter(t=>za.indexOf(t.pos)===-1&&t.box.axis===i)}function we(e,i){return e.sort((t,s)=>{let n=i?s:t,o=i?t:s;return n.weight===o.weight?n.index-o.index:n.weight-o.weight})}function mc(e){let i=[],t,s,n,o,a,r;for(t=0,s=(e||[]).length;t<s;++t)n=e[t],{position:o,options:{stack:a,stackWeight:r=1}}=n,i.push({index:t,box:n,pos:o,horizontal:n.isHorizontal(),weight:n.weight,stack:a&&o+a,stackWeight:r});return i}function bc(e){let i={};for(let t of e){let{stack:s,pos:n,stackWeight:o}=t;if(!s||!za.includes(n))continue;let a=i[s]||(i[s]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=o}return i}function _c(e,i){let t=bc(e),{vBoxMaxWidth:s,hBoxMaxHeight:n}=i,o,a,r;for(o=0,a=e.length;o<a;++o){r=e[o];let{fullSize:l}=r.box,c=t[r.stack],h=c&&r.stackWeight/c.weight;r.horizontal?(r.width=h?h*s:l&&i.availableWidth,r.height=n):(r.width=s,r.height=h?h*n:l&&i.availableHeight)}return t}function xc(e){let i=mc(e),t=we(i.filter(c=>c.box.fullSize),!0),s=we(ve(i,"left"),!0),n=we(ve(i,"right")),o=we(ve(i,"top"),!0),a=we(ve(i,"bottom")),r=$o(i,"x"),l=$o(i,"y");return{fullSize:t,leftAndTop:s.concat(o),rightAndBottom:n.concat(l).concat(a).concat(r),chartArea:ve(i,"chartArea"),vertical:s.concat(n).concat(l),horizontal:o.concat(a).concat(r)}}function Yo(e,i,t,s){return Math.max(e[t],i[t])+Math.max(e[s],i[s])}function Ba(e,i){e.top=Math.max(e.top,i.top),e.left=Math.max(e.left,i.left),e.bottom=Math.max(e.bottom,i.bottom),e.right=Math.max(e.right,i.right)}function yc(e,i,t,s){let{pos:n,box:o}=t,a=e.maxPadding;if(!A(n)){t.size&&(e[n]-=t.size);let d=s[t.stack]||{size:0,count:1};d.size=Math.max(d.size,t.horizontal?o.height:o.width),t.size=d.size/d.count,e[n]+=t.size}o.getPadding&&Ba(a,o.getPadding());let r=Math.max(0,i.outerWidth-Yo(a,e,"left","right")),l=Math.max(0,i.outerHeight-Yo(a,e,"top","bottom")),c=r!==e.w,h=l!==e.h;return e.w=r,e.h=l,t.horizontal?{same:c,other:h}:{same:h,other:c}}function vc(e){let i=e.maxPadding;function t(s){let n=Math.max(i[s]-e[s],0);return e[s]+=n,n}e.y+=t("top"),e.x+=t("left"),t("right"),t("bottom")}function wc(e,i){let t=i.maxPadding;function s(n){let o={left:0,top:0,right:0,bottom:0};return n.forEach(a=>{o[a]=Math.max(i[a],t[a])}),o}return s(e?["left","right"]:["top","bottom"])}function Se(e,i,t,s){let n=[],o,a,r,l,c,h;for(o=0,a=e.length,c=0;o<a;++o){r=e[o],l=r.box,l.update(r.width||i.w,r.height||i.h,wc(r.horizontal,i));let{same:d,other:u}=yc(i,t,r,s);c|=d&&n.length,h=h||u,l.fullSize||n.push(r)}return c&&Se(n,i,t,s)||h}function li(e,i,t,s,n){e.top=t,e.left=i,e.right=i+s,e.bottom=t+n,e.width=s,e.height=n}function Uo(e,i,t,s){let n=t.padding,{x:o,y:a}=i;for(let r of e){let l=r.box,c=s[r.stack]||{count:1,placed:0,weight:1},h=r.stackWeight/c.weight||1;if(r.horizontal){let d=i.w*h,u=c.size||l.height;Zt(c.start)&&(a=c.start),l.fullSize?li(l,n.left,a,t.outerWidth-n.right-n.left,u):li(l,i.left+c.placed,a,d,u),c.start=a,c.placed+=d,a=l.bottom}else{let d=i.h*h,u=c.size||l.width;Zt(c.start)&&(o=c.start),l.fullSize?li(l,o,n.top,u,t.outerHeight-n.bottom-n.top):li(l,o,i.top+c.placed,u,d),c.start=o,c.placed+=d,o=l.right}}i.x=o,i.y=a}var G={addBox(e,i){e.boxes||(e.boxes=[]),i.fullSize=i.fullSize||!1,i.position=i.position||"top",i.weight=i.weight||0,i._layers=i._layers||function(){return[{z:0,draw(t){i.draw(t)}}]},e.boxes.push(i)},removeBox(e,i){let t=e.boxes?e.boxes.indexOf(i):-1;t!==-1&&e.boxes.splice(t,1)},configure(e,i,t){i.fullSize=t.fullSize,i.position=t.position,i.weight=t.weight},update(e,i,t,s){if(!e)return;let n=K(e.options.layout.padding),o=Math.max(i-n.width,0),a=Math.max(t-n.height,0),r=xc(e.boxes),l=r.vertical,c=r.horizontal;L(e.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout()});let h=l.reduce((g,m)=>m.box.options&&m.box.options.display===!1?g:g+1,0)||1,d=Object.freeze({outerWidth:i,outerHeight:t,padding:n,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/h,hBoxMaxHeight:a/2}),u=Object.assign({},n);Ba(u,K(s));let f=Object.assign({maxPadding:u,w:o,h:a,x:n.left,y:n.top},n),p=_c(l.concat(c),d);Se(r.fullSize,f,d,p),Se(l,f,d,p),Se(c,f,d,p)&&Se(l,f,d,p),vc(f),Uo(r.leftAndTop,f,d,p),f.x+=f.w,f.y+=f.h,Uo(r.rightAndBottom,f,d,p),e.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},L(r.chartArea,g=>{let m=g.box;Object.assign(m,e.chartArea),m.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}},bi=class{acquireContext(i,t){}releaseContext(i){return!1}addEventListener(i,t,s){}removeEventListener(i,t,s){}getDevicePixelRatio(){return 1}getMaximumSize(i,t,s,n){return t=Math.max(0,t||i.width),s=s||i.height,{width:t,height:Math.max(0,n?Math.floor(t/n):s)}}isAttached(i){return!0}updateConfig(i){}},Fs=class extends bi{acquireContext(i){return i&&i.getContext&&i.getContext("2d")||null}updateConfig(i){i.options.animation=!1}},gi="$chartjs",Mc={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Xo=e=>e===null||e==="";function kc(e,i){let t=e.style,s=e.getAttribute("height"),n=e.getAttribute("width");if(e[gi]={initial:{height:s,width:n,style:{display:t.display,height:t.height,width:t.width}}},t.display=t.display||"block",t.boxSizing=t.boxSizing||"border-box",Xo(n)){let o=ms(e,"width");o!==void 0&&(e.width=o)}if(Xo(s))if(e.style.height==="")e.height=e.width/(i||2);else{let o=ms(e,"height");o!==void 0&&(e.height=o)}return e}var Va=Oo?{passive:!0}:!1;function Sc(e,i,t){e&&e.addEventListener(i,t,Va)}function Cc(e,i,t){e&&e.canvas&&e.canvas.removeEventListener(i,t,Va)}function Pc(e,i){let t=Mc[e.type]||e.type,{x:s,y:n}=Dt(e,i);return{type:t,chart:i,native:e,x:s!==void 0?s:null,y:n!==void 0?n:null}}function _i(e,i){for(let t of e)if(t===i||t.contains(i))return!0}function Dc(e,i,t){let s=e.canvas,n=new MutationObserver(o=>{let a=!1;for(let r of o)a=a||_i(r.addedNodes,s),a=a&&!_i(r.removedNodes,s);a&&t()});return n.observe(document,{childList:!0,subtree:!0}),n}function Oc(e,i,t){let s=e.canvas,n=new MutationObserver(o=>{let a=!1;for(let r of o)a=a||_i(r.removedNodes,s),a=a&&!_i(r.addedNodes,s);a&&t()});return n.observe(document,{childList:!0,subtree:!0}),n}var Pe=new Map,Ko=0;function Na(){let e=window.devicePixelRatio;e!==Ko&&(Ko=e,Pe.forEach((i,t)=>{t.currentDevicePixelRatio!==e&&i()}))}function Ac(e,i){Pe.size||window.addEventListener("resize",Na),Pe.set(e,i)}function Tc(e){Pe.delete(e),Pe.size||window.removeEventListener("resize",Na)}function Rc(e,i,t){let s=e.canvas,n=s&&ai(s);if(!n)return;let o=ss((r,l)=>{let c=n.clientWidth;t(r,l),c<n.clientWidth&&t()},window),a=new ResizeObserver(r=>{let l=r[0],c=l.contentRect.width,h=l.contentRect.height;c===0&&h===0||o(c,h)});return a.observe(n),Ac(e,o),a}function Ds(e,i,t){t&&t.disconnect(),i==="resize"&&Tc(e)}function Lc(e,i,t){let s=e.canvas,n=ss(o=>{e.ctx!==null&&t(Pc(o,e))},e);return Sc(s,i,n),n}var zs=class extends bi{acquireContext(i,t){let s=i&&i.getContext&&i.getContext("2d");return s&&s.canvas===i?(kc(i,t),s):null}releaseContext(i){let t=i.canvas;if(!t[gi])return!1;let s=t[gi].initial;["height","width"].forEach(o=>{let a=s[o];O(a)?t.removeAttribute(o):t.setAttribute(o,a)});let n=s.style||{};return Object.keys(n).forEach(o=>{t.style[o]=n[o]}),t.width=t.width,delete t[gi],!0}addEventListener(i,t,s){this.removeEventListener(i,t);let n=i.$proxies||(i.$proxies={}),a={attach:Dc,detach:Oc,resize:Rc}[t]||Lc;n[t]=a(i,t,s)}removeEventListener(i,t){let s=i.$proxies||(i.$proxies={}),n=s[t];if(!n)return;({attach:Ds,detach:Ds,resize:Ds}[t]||Cc)(i,t,n),s[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(i,t,s,n){return Do(i,t,s,n)}isAttached(i){let t=i&&ai(i);return!!(t&&t.isConnected)}};function Ec(e){return!oi()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?Fs:zs}var ot=class{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(i){let{x:t,y:s}=this.getProps(["x","y"],i);return{x:t,y:s}}hasValue(){return Bt(this.x)&&Bt(this.y)}getProps(i,t){let s=this.$animations;if(!t||!s)return this;let n={};return i.forEach(o=>{n[o]=s[o]&&s[o].active()?s[o]._to:this[o]}),n}};function Ic(e,i){let t=e.options.ticks,s=Fc(e),n=Math.min(t.maxTicksLimit||s,s),o=t.major.enabled?Bc(i):[],a=o.length,r=o[0],l=o[a-1],c=[];if(a>n)return Vc(i,c,o,a/n),c;let h=zc(o,i,n);if(a>0){let d,u,f=a>1?Math.round((l-r)/(a-1)):null;for(ci(i,c,h,O(f)?0:r-f,r),d=0,u=a-1;d<u;d++)ci(i,c,h,o[d],o[d+1]);return ci(i,c,h,l,O(f)?i.length:l+f),c}return ci(i,c,h),c}function Fc(e){let i=e.options.offset,t=e._tickSize(),s=e._length/t+(i?0:1),n=e._maxLength/t;return Math.floor(Math.min(s,n))}function zc(e,i,t){let s=Nc(e),n=i.length/t;if(!s)return Math.max(n,1);let o=lo(s);for(let a=0,r=o.length-1;a<r;a++){let l=o[a];if(l>n)return l}return Math.max(n,1)}function Bc(e){let i=[],t,s;for(t=0,s=e.length;t<s;t++)e[t].major&&i.push(t);return i}function Vc(e,i,t,s){let n=0,o=t[0],a;for(s=Math.ceil(s),a=0;a<e.length;a++)a===o&&(i.push(e[a]),n++,o=t[n*s])}function ci(e,i,t,s,n){let o=C(s,0),a=Math.min(C(n,e.length),e.length),r=0,l,c,h;for(t=Math.ceil(t),n&&(l=n-s,t=l/Math.floor(l/t)),h=o;h<0;)r++,h=Math.round(o+r*t);for(c=Math.max(o,0);c<a;c++)c===h&&(i.push(e[c]),r++,h=Math.round(o+r*t))}function Nc(e){let i=e.length,t,s;if(i<2)return!1;for(s=e[0],t=1;t<i;++t)if(e[t]-e[t-1]!==s)return!1;return s}var Hc=e=>e==="left"?"right":e==="right"?"left":e,qo=(e,i,t)=>i==="top"||i==="left"?e[i]+t:e[i]-t,Go=(e,i)=>Math.min(i||e,e);function Zo(e,i){let t=[],s=e.length/i,n=e.length,o=0;for(;o<n;o+=s)t.push(e[Math.floor(o)]);return t}function Wc(e,i,t){let s=e.ticks.length,n=Math.min(i,s-1),o=e._startPixel,a=e._endPixel,r=1e-6,l=e.getPixelForTick(n),c;if(!(t&&(s===1?c=Math.max(l-o,a-l):i===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(n-1))/2,l+=n<i?c:-c,l<o-r||l>a+r)))return l}function jc(e,i){L(e,t=>{let s=t.gc,n=s.length/2,o;if(n>i){for(o=0;o<n;++o)delete t.data[s[o]];s.splice(0,n)}})}function Me(e){return e.drawTicks?e.tickLength:0}function Jo(e,i){if(!e.display)return 0;let t=j(e.font,i),s=K(e.padding);return(z(e.text)?e.text.length:1)*t.lineHeight+s.height}function $c(e,i){return mt(e,{scale:i,type:"scale"})}function Yc(e,i,t){return mt(e,{tick:t,index:i,type:"tick"})}function Uc(e,i,t){let s=ti(e);return(t&&i!=="right"||!t&&i==="right")&&(s=Hc(s)),s}function Xc(e,i,t,s){let{top:n,left:o,bottom:a,right:r,chart:l}=e,{chartArea:c,scales:h}=l,d=0,u,f,p,g=a-n,m=r-o;if(e.isHorizontal()){if(f=X(s,o,r),A(t)){let b=Object.keys(t)[0],_=t[b];p=h[b].getPixelForValue(_)+g-i}else t==="center"?p=(c.bottom+c.top)/2+g-i:p=qo(e,t,i);u=r-o}else{if(A(t)){let b=Object.keys(t)[0],_=t[b];f=h[b].getPixelForValue(_)-m+i}else t==="center"?f=(c.left+c.right)/2-m+i:f=qo(e,t,i);p=X(s,a,n),d=t==="left"?-H:H}return{titleX:f,titleY:p,maxWidth:u,rotation:d}}var Wt=class e extends ot{constructor(i){super(),this.id=i.id,this.type=i.type,this.options=void 0,this.ctx=i.ctx,this.chart=i.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(i){this.options=i.setContext(this.getContext()),this.axis=i.axis,this._userMin=this.parse(i.min),this._userMax=this.parse(i.max),this._suggestedMin=this.parse(i.suggestedMin),this._suggestedMax=this.parse(i.suggestedMax)}parse(i,t){return i}getUserBounds(){let{_userMin:i,_userMax:t,_suggestedMin:s,_suggestedMax:n}=this;return i=Z(i,Number.POSITIVE_INFINITY),t=Z(t,Number.NEGATIVE_INFINITY),s=Z(s,Number.POSITIVE_INFINITY),n=Z(n,Number.NEGATIVE_INFINITY),{min:Z(i,s),max:Z(t,n),minDefined:N(i),maxDefined:N(t)}}getMinMax(i){let{min:t,max:s,minDefined:n,maxDefined:o}=this.getUserBounds(),a;if(n&&o)return{min:t,max:s};let r=this.getMatchingVisibleMetas();for(let l=0,c=r.length;l<c;++l)a=r[l].controller.getMinMax(this,i),n||(t=Math.min(t,a.min)),o||(s=Math.max(s,a.max));return t=o&&t>s?s:t,s=n&&t>s?t:s,{min:Z(t,Z(s,t)),max:Z(s,Z(t,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let i=this.chart.data;return this.options.labels||(this.isHorizontal()?i.xLabels:i.yLabels)||i.labels||[]}getLabelItems(i=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(i))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){I(this.options.beforeUpdate,[this])}update(i,t,s){let{beginAtZero:n,grace:o,ticks:a}=this.options,r=a.sampleSize;this.beforeUpdate(),this.maxWidth=i,this.maxHeight=t,this._margins=s=Object.assign({left:0,right:0,top:0,bottom:0},s),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+s.left+s.right:this.height+s.top+s.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=wo(this,o,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let l=r<this.ticks.length;this._convertTicksToLabels(l?Zo(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=Ic(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let i=this.options.reverse,t,s;this.isHorizontal()?(t=this.left,s=this.right):(t=this.top,s=this.bottom,i=!i),this._startPixel=t,this._endPixel=s,this._reversePixels=i,this._length=s-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){I(this.options.afterUpdate,[this])}beforeSetDimensions(){I(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){I(this.options.afterSetDimensions,[this])}_callHooks(i){this.chart.notifyPlugins(i,this.getContext()),I(this.options[i],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){I(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(i){let t=this.options.ticks,s,n,o;for(s=0,n=i.length;s<n;s++)o=i[s],o.label=I(t.callback,[o.value,s,i],this)}afterTickToLabelConversion(){I(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){I(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){let i=this.options,t=i.ticks,s=Go(this.ticks.length,i.ticks.maxTicksLimit),n=t.minRotation||0,o=t.maxRotation,a=n,r,l,c;if(!this._isVisible()||!t.display||n>=o||s<=1||!this.isHorizontal()){this.labelRotation=n;return}let h=this._getLabelSizes(),d=h.widest.width,u=h.highest.height,f=$(this.chart.width-d,0,this.maxWidth);r=i.offset?this.maxWidth/s:f/(s-1),d+6>r&&(r=f/(s-(i.offset?.5:1)),l=this.maxHeight-Me(i.grid)-t.padding-Jo(i.title,this.chart.options.font),c=Math.sqrt(d*d+u*u),a=Je(Math.min(Math.asin($((h.highest.height+6)/r,-1,1)),Math.asin($(l/c,-1,1))-Math.asin($(u/c,-1,1)))),a=Math.max(n,Math.min(o,a))),this.labelRotation=a}afterCalculateLabelRotation(){I(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){I(this.options.beforeFit,[this])}fit(){let i={width:0,height:0},{chart:t,options:{ticks:s,title:n,grid:o}}=this,a=this._isVisible(),r=this.isHorizontal();if(a){let l=Jo(n,t.options.font);if(r?(i.width=this.maxWidth,i.height=Me(o)+l):(i.height=this.maxHeight,i.width=Me(o)+l),s.display&&this.ticks.length){let{first:c,last:h,widest:d,highest:u}=this._getLabelSizes(),f=s.padding*2,p=it(this.labelRotation),g=Math.cos(p),m=Math.sin(p);if(r){let b=s.mirror?0:m*d.width+g*u.height;i.height=Math.min(this.maxHeight,i.height+b+f)}else{let b=s.mirror?0:g*d.width+m*u.height;i.width=Math.min(this.maxWidth,i.width+b+f)}this._calculatePadding(c,h,m,g)}}this._handleMargins(),r?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=i.height):(this.width=i.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(i,t,s,n){let{ticks:{align:o,padding:a},position:r}=this.options,l=this.labelRotation!==0,c=r!=="top"&&this.axis==="x";if(this.isHorizontal()){let h=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1),u=0,f=0;l?c?(u=n*i.width,f=s*t.height):(u=s*i.height,f=n*t.width):o==="start"?f=t.width:o==="end"?u=i.width:o!=="inner"&&(u=i.width/2,f=t.width/2),this.paddingLeft=Math.max((u-h+a)*this.width/(this.width-h),0),this.paddingRight=Math.max((f-d+a)*this.width/(this.width-d),0)}else{let h=t.height/2,d=i.height/2;o==="start"?(h=0,d=i.height):o==="end"&&(h=t.height,d=0),this.paddingTop=h+a,this.paddingBottom=d+a}}_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(){I(this.options.afterFit,[this])}isHorizontal(){let{axis:i,position:t}=this.options;return t==="top"||t==="bottom"||i==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(i){this.beforeTickToLabelConversion(),this.generateTickLabels(i);let t,s;for(t=0,s=i.length;t<s;t++)O(i[t].label)&&(i.splice(t,1),s--,t--);this.afterTickToLabelConversion()}_getLabelSizes(){let i=this._labelSizes;if(!i){let t=this.options.ticks.sampleSize,s=this.ticks;t<s.length&&(s=Zo(s,t)),this._labelSizes=i=this._computeLabelSizes(s,s.length,this.options.ticks.maxTicksLimit)}return i}_computeLabelSizes(i,t,s){let{ctx:n,_longestTextCache:o}=this,a=[],r=[],l=Math.floor(t/Go(t,s)),c=0,h=0,d,u,f,p,g,m,b,_,y,w,x;for(d=0;d<t;d+=l){if(p=i[d].label,g=this._resolveTickFontOptions(d),n.font=m=g.string,b=o[m]=o[m]||{data:{},gc:[]},_=g.lineHeight,y=w=0,!O(p)&&!z(p))y=pe(n,b.data,b.gc,y,p),w=_;else if(z(p))for(u=0,f=p.length;u<f;++u)x=p[u],!O(x)&&!z(x)&&(y=pe(n,b.data,b.gc,y,x),w+=_);a.push(y),r.push(w),c=Math.max(y,c),h=Math.max(w,h)}jc(o,t);let v=a.indexOf(c),k=r.indexOf(h),M=S=>({width:a[S]||0,height:r[S]||0});return{first:M(0),last:M(t-1),widest:M(v),highest:M(k),widths:a,heights:r}}getLabelForValue(i){return i}getPixelForValue(i,t){return NaN}getValueForPixel(i){}getPixelForTick(i){let t=this.ticks;return i<0||i>t.length-1?null:this.getPixelForValue(t[i].value)}getPixelForDecimal(i){this._reversePixels&&(i=1-i);let t=this._startPixel+i*this._length;return ho(this._alignToPixels?St(this.chart,t,0):t)}getDecimalForPixel(i){let t=(i-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:i,max:t}=this;return i<0&&t<0?t:i>0&&t>0?i:0}getContext(i){let t=this.ticks||[];if(i>=0&&i<t.length){let s=t[i];return s.$context||(s.$context=Yc(this.getContext(),i,s))}return this.$context||(this.$context=$c(this.chart.getContext(),this))}_tickSize(){let i=this.options.ticks,t=it(this.labelRotation),s=Math.abs(Math.cos(t)),n=Math.abs(Math.sin(t)),o=this._getLabelSizes(),a=i.autoSkipPadding||0,r=o?o.widest.width+a:0,l=o?o.highest.height+a:0;return this.isHorizontal()?l*s>r*n?r/s:l/n:l*n<r*s?l/s:r/n}_isVisible(){let i=this.options.display;return i!=="auto"?!!i:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(i){let t=this.axis,s=this.chart,n=this.options,{grid:o,position:a,border:r}=n,l=o.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),u=Me(o),f=[],p=r.setContext(this.getContext()),g=p.display?p.width:0,m=g/2,b=function(V){return St(s,V,g)},_,y,w,x,v,k,M,S,D,P,T,Y;if(a==="top")_=b(this.bottom),k=this.bottom-u,S=_-m,P=b(i.top)+m,Y=i.bottom;else if(a==="bottom")_=b(this.top),P=i.top,Y=b(i.bottom)-m,k=_+m,S=this.top+u;else if(a==="left")_=b(this.right),v=this.right-u,M=_-m,D=b(i.left)+m,T=i.right;else if(a==="right")_=b(this.left),D=i.left,T=b(i.right)-m,v=_+m,M=this.left+u;else if(t==="x"){if(a==="center")_=b((i.top+i.bottom)/2+.5);else if(A(a)){let V=Object.keys(a)[0],W=a[V];_=b(this.chart.scales[V].getPixelForValue(W))}P=i.top,Y=i.bottom,k=_+m,S=k+u}else if(t==="y"){if(a==="center")_=b((i.left+i.right)/2);else if(A(a)){let V=Object.keys(a)[0],W=a[V];_=b(this.chart.scales[V].getPixelForValue(W))}v=_-m,M=v-u,D=i.left,T=i.right}let tt=C(n.ticks.maxTicksLimit,d),E=Math.max(1,Math.ceil(d/tt));for(y=0;y<d;y+=E){let V=this.getContext(y),W=o.setContext(V),st=r.setContext(V),q=W.lineWidth,jt=W.color,Te=st.dash||[],$t=st.dashOffset,ae=W.tickWidth,Tt=W.tickColor,re=W.tickBorderDash||[],Rt=W.tickBorderDashOffset;w=Wc(this,y,l),w!==void 0&&(x=St(s,w,q),c?v=M=D=T=x:k=S=P=Y=x,f.push({tx1:v,ty1:k,tx2:M,ty2:S,x1:D,y1:P,x2:T,y2:Y,width:q,color:jt,borderDash:Te,borderDashOffset:$t,tickWidth:ae,tickColor:Tt,tickBorderDash:re,tickBorderDashOffset:Rt}))}return this._ticksLength=d,this._borderValue=_,f}_computeLabelItems(i){let t=this.axis,s=this.options,{position:n,ticks:o}=s,a=this.isHorizontal(),r=this.ticks,{align:l,crossAlign:c,padding:h,mirror:d}=o,u=Me(s.grid),f=u+h,p=d?-h:f,g=-it(this.labelRotation),m=[],b,_,y,w,x,v,k,M,S,D,P,T,Y="middle";if(n==="top")v=this.bottom-p,k=this._getXAxisLabelAlignment();else if(n==="bottom")v=this.top+p,k=this._getXAxisLabelAlignment();else if(n==="left"){let E=this._getYAxisLabelAlignment(u);k=E.textAlign,x=E.x}else if(n==="right"){let E=this._getYAxisLabelAlignment(u);k=E.textAlign,x=E.x}else if(t==="x"){if(n==="center")v=(i.top+i.bottom)/2+f;else if(A(n)){let E=Object.keys(n)[0],V=n[E];v=this.chart.scales[E].getPixelForValue(V)+f}k=this._getXAxisLabelAlignment()}else if(t==="y"){if(n==="center")x=(i.left+i.right)/2-f;else if(A(n)){let E=Object.keys(n)[0],V=n[E];x=this.chart.scales[E].getPixelForValue(V)}k=this._getYAxisLabelAlignment(u).textAlign}t==="y"&&(l==="start"?Y="top":l==="end"&&(Y="bottom"));let tt=this._getLabelSizes();for(b=0,_=r.length;b<_;++b){y=r[b],w=y.label;let E=o.setContext(this.getContext(b));M=this.getPixelForTick(b)+o.labelOffset,S=this._resolveTickFontOptions(b),D=S.lineHeight,P=z(w)?w.length:1;let V=P/2,W=E.color,st=E.textStrokeColor,q=E.textStrokeWidth,jt=k;a?(x=M,k==="inner"&&(b===_-1?jt=this.options.reverse?"left":"right":b===0?jt=this.options.reverse?"right":"left":jt="center"),n==="top"?c==="near"||g!==0?T=-P*D+D/2:c==="center"?T=-tt.highest.height/2-V*D+D:T=-tt.highest.height+D/2:c==="near"||g!==0?T=D/2:c==="center"?T=tt.highest.height/2-V*D:T=tt.highest.height-P*D,d&&(T*=-1),g!==0&&!E.showLabelBackdrop&&(x+=D/2*Math.sin(g))):(v=M,T=(1-P)*D/2);let Te;if(E.showLabelBackdrop){let $t=K(E.backdropPadding),ae=tt.heights[b],Tt=tt.widths[b],re=T-$t.top,Rt=0-$t.left;switch(Y){case"middle":re-=ae/2;break;case"bottom":re-=ae;break}switch(k){case"center":Rt-=Tt/2;break;case"right":Rt-=Tt;break;case"inner":b===_-1?Rt-=Tt:b>0&&(Rt-=Tt/2);break}Te={left:Rt,top:re,width:Tt+$t.width,height:ae+$t.height,color:E.backdropColor}}m.push({label:w,font:S,textOffset:T,options:{rotation:g,color:W,strokeColor:st,strokeWidth:q,textAlign:jt,textBaseline:Y,translation:[x,v],backdrop:Te}})}return m}_getXAxisLabelAlignment(){let{position:i,ticks:t}=this.options;if(-it(this.labelRotation))return i==="top"?"left":"right";let n="center";return t.align==="start"?n="left":t.align==="end"?n="right":t.align==="inner"&&(n="inner"),n}_getYAxisLabelAlignment(i){let{position:t,ticks:{crossAlign:s,mirror:n,padding:o}}=this.options,a=this._getLabelSizes(),r=i+o,l=a.widest.width,c,h;return t==="left"?n?(h=this.right+o,s==="near"?c="left":s==="center"?(c="center",h+=l/2):(c="right",h+=l)):(h=this.right-r,s==="near"?c="right":s==="center"?(c="center",h-=l/2):(c="left",h=this.left)):t==="right"?n?(h=this.left+o,s==="near"?c="right":s==="center"?(c="center",h-=l/2):(c="left",h-=l)):(h=this.left+r,s==="near"?c="left":s==="center"?(c="center",h+=l/2):(c="right",h=this.right)):c="right",{textAlign:c,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;let i=this.chart,t=this.options.position;if(t==="left"||t==="right")return{top:0,left:this.left,bottom:i.height,right:this.right};if(t==="top"||t==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:i.width}}drawBackground(){let{ctx:i,options:{backgroundColor:t},left:s,top:n,width:o,height:a}=this;t&&(i.save(),i.fillStyle=t,i.fillRect(s,n,o,a),i.restore())}getLineWidthForValue(i){let t=this.options.grid;if(!this._isVisible()||!t.display)return 0;let n=this.ticks.findIndex(o=>o.value===i);return n>=0?t.setContext(this.getContext(n)).lineWidth:0}drawGrid(i){let t=this.options.grid,s=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(i)),o,a,r=(l,c,h)=>{!h.width||!h.color||(s.save(),s.lineWidth=h.width,s.strokeStyle=h.color,s.setLineDash(h.borderDash||[]),s.lineDashOffset=h.borderDashOffset,s.beginPath(),s.moveTo(l.x,l.y),s.lineTo(c.x,c.y),s.stroke(),s.restore())};if(t.display)for(o=0,a=n.length;o<a;++o){let l=n[o];t.drawOnChartArea&&r({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),t.drawTicks&&r({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){let{chart:i,ctx:t,options:{border:s,grid:n}}=this,o=s.setContext(this.getContext()),a=s.display?o.width:0;if(!a)return;let r=n.setContext(this.getContext(0)).lineWidth,l=this._borderValue,c,h,d,u;this.isHorizontal()?(c=St(i,this.left,a)-a/2,h=St(i,this.right,r)+r/2,d=u=l):(d=St(i,this.top,a)-a/2,u=St(i,this.bottom,r)+r/2,c=h=l),t.save(),t.lineWidth=o.width,t.strokeStyle=o.color,t.beginPath(),t.moveTo(c,d),t.lineTo(h,u),t.stroke(),t.restore()}drawLabels(i){if(!this.options.ticks.display)return;let s=this.ctx,n=this._computeLabelArea();n&&_e(s,n);let o=this.getLabelItems(i);for(let a of o){let r=a.options,l=a.font,c=a.label,h=a.textOffset;Ct(s,c,0,h,l,r)}n&&xe(s)}drawTitle(){let{ctx:i,options:{position:t,title:s,reverse:n}}=this;if(!s.display)return;let o=j(s.font),a=K(s.padding),r=s.align,l=o.lineHeight/2;t==="bottom"||t==="center"||A(t)?(l+=a.bottom,z(s.text)&&(l+=o.lineHeight*(s.text.length-1))):l+=a.top;let{titleX:c,titleY:h,maxWidth:d,rotation:u}=Xc(this,l,t,r);Ct(i,s.text,0,0,o,{color:s.color,maxWidth:d,rotation:u,textAlign:Uc(r,t,n),textBaseline:"middle",translation:[c,h]})}draw(i){this._isVisible()&&(this.drawBackground(),this.drawGrid(i),this.drawBorder(),this.drawTitle(),this.drawLabels(i))}_layers(){let i=this.options,t=i.ticks&&i.ticks.z||0,s=C(i.grid&&i.grid.z,-1),n=C(i.border&&i.border.z,0);return!this._isVisible()||this.draw!==e.prototype.draw?[{z:t,draw:o=>{this.draw(o)}}]:[{z:s,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:t,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(i){let t=this.chart.getSortedVisibleDatasetMetas(),s=this.axis+"AxisID",n=[],o,a;for(o=0,a=t.length;o<a;++o){let r=t[o];r[s]===this.id&&(!i||r.type===i)&&n.push(r)}return n}_resolveTickFontOptions(i){let t=this.options.ticks.setContext(this.getContext(i));return j(t.font)}_maxDigits(){let i=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/i}},ne=class{constructor(i,t,s){this.type=i,this.scope=t,this.override=s,this.items=Object.create(null)}isForType(i){return Object.prototype.isPrototypeOf.call(this.type.prototype,i.prototype)}register(i){let t=Object.getPrototypeOf(i),s;Gc(t)&&(s=this.register(t));let n=this.items,o=i.id,a=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+i);return o in n||(n[o]=i,Kc(i,a,s),this.override&&F.override(i.id,i.overrides)),a}get(i){return this.items[i]}unregister(i){let t=this.items,s=i.id,n=this.scope;s in t&&delete t[s],n&&s in F[n]&&(delete F[n][s],this.override&&delete kt[s])}};function Kc(e,i,t){let s=Kt(Object.create(null),[t?F.get(t):{},F.get(i),e.defaults]);F.set(i,s),e.defaultRoutes&&qc(i,e.defaultRoutes),e.descriptors&&F.describe(i,e.descriptors)}function qc(e,i){Object.keys(i).forEach(t=>{let s=t.split("."),n=s.pop(),o=[e].concat(s).join("."),a=i[t].split("."),r=a.pop(),l=a.join(".");F.route(o,n,l,r)})}function Gc(e){return"id"in e&&"defaults"in e}var Bs=class{constructor(){this.controllers=new ne(At,"datasets",!0),this.elements=new ne(ot,"elements"),this.plugins=new ne(Object,"plugins"),this.scales=new ne(Wt,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...i){this._each("register",i)}remove(...i){this._each("unregister",i)}addControllers(...i){this._each("register",i,this.controllers)}addElements(...i){this._each("register",i,this.elements)}addPlugins(...i){this._each("register",i,this.plugins)}addScales(...i){this._each("register",i,this.scales)}getController(i){return this._get(i,this.controllers,"controller")}getElement(i){return this._get(i,this.elements,"element")}getPlugin(i){return this._get(i,this.plugins,"plugin")}getScale(i){return this._get(i,this.scales,"scale")}removeControllers(...i){this._each("unregister",i,this.controllers)}removeElements(...i){this._each("unregister",i,this.elements)}removePlugins(...i){this._each("unregister",i,this.plugins)}removeScales(...i){this._each("unregister",i,this.scales)}_each(i,t,s){[...t].forEach(n=>{let o=s||this._getRegistryForType(n);s||o.isForType(n)||o===this.plugins&&n.id?this._exec(i,o,n):L(n,a=>{let r=s||this._getRegistryForType(a);this._exec(i,r,a)})})}_exec(i,t,s){let n=Ze(i);I(s["before"+n],[],s),t[i](s),I(s["after"+n],[],s)}_getRegistryForType(i){for(let t=0;t<this._typedRegistries.length;t++){let s=this._typedRegistries[t];if(s.isForType(i))return s}return this.plugins}_get(i,t,s){let n=t.get(i);if(n===void 0)throw new Error('"'+i+'" is not a registered '+s+".");return n}},dt=new Bs,Vs=class{constructor(){this._init=void 0}notify(i,t,s,n){if(t==="beforeInit"&&(this._init=this._createDescriptors(i,!0),this._notify(this._init,i,"install")),this._init===void 0)return;let o=n?this._descriptors(i).filter(n):this._descriptors(i),a=this._notify(o,i,t,s);return t==="afterDestroy"&&(this._notify(o,i,"stop"),this._notify(this._init,i,"uninstall"),this._init=void 0),a}_notify(i,t,s,n){n=n||{};for(let o of i){let a=o.plugin,r=a[s],l=[t,n,o.options];if(I(r,l,a)===!1&&n.cancelable)return!1}return!0}invalidate(){O(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(i){if(this._cache)return this._cache;let t=this._cache=this._createDescriptors(i);return this._notifyStateChanges(i),t}_createDescriptors(i,t){let s=i&&i.config,n=C(s.options&&s.options.plugins,{}),o=Zc(s);return n===!1&&!t?[]:Qc(i,o,n,t)}_notifyStateChanges(i){let t=this._oldCache||[],s=this._cache,n=(o,a)=>o.filter(r=>!a.some(l=>r.plugin.id===l.plugin.id));this._notify(n(t,s),i,"stop"),this._notify(n(s,t),i,"start")}};function Zc(e){let i={},t=[],s=Object.keys(dt.plugins.items);for(let o=0;o<s.length;o++)t.push(dt.getPlugin(s[o]));let n=e.plugins||[];for(let o=0;o<n.length;o++){let a=n[o];t.indexOf(a)===-1&&(t.push(a),i[a.id]=!0)}return{plugins:t,localIds:i}}function Jc(e,i){return!i&&e===!1?null:e===!0?{}:e}function Qc(e,{plugins:i,localIds:t},s,n){let o=[],a=e.getContext();for(let r of i){let l=r.id,c=Jc(s[l],n);c!==null&&o.push({plugin:r,options:th(e.config,{plugin:r,local:t[l]},c,a)})}return o}function th(e,{plugin:i,local:t},s,n){let o=e.pluginScopeKeys(i),a=e.getOptionScopes(s,o);return t&&i.defaults&&a.push(i.defaults),e.createResolver(a,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Ns(e,i){let t=F.datasets[e]||{};return((i.datasets||{})[e]||{}).indexAxis||i.indexAxis||t.indexAxis||"x"}function eh(e,i){let t=e;return e==="_index_"?t=i:e==="_value_"&&(t=i==="x"?"y":"x"),t}function ih(e,i){return e===i?"_index_":"_value_"}function Qo(e){if(e==="x"||e==="y"||e==="r")return e}function sh(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function Hs(e,...i){if(Qo(e))return e;for(let t of i){let s=t.axis||sh(t.position)||e.length>1&&Qo(e[0].toLowerCase());if(s)return s}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function ta(e,i,t){if(t[i+"AxisID"]===e)return{axis:i}}function nh(e,i){if(i.data&&i.data.datasets){let t=i.data.datasets.filter(s=>s.xAxisID===e||s.yAxisID===e);if(t.length)return ta(e,"x",t[0])||ta(e,"y",t[0])}return{}}function oh(e,i){let t=kt[e.type]||{scales:{}},s=i.scales||{},n=Ns(e.type,i),o=Object.create(null);return Object.keys(s).forEach(a=>{let r=s[a];if(!A(r))return console.error(`Invalid scale configuration for scale: ${a}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);let l=Hs(a,r,nh(a,e),F.scales[r.type]),c=ih(l,n),h=t.scales||{};o[a]=Gt(Object.create(null),[{axis:l},r,h[l],h[c]])}),e.data.datasets.forEach(a=>{let r=a.type||e.type,l=a.indexAxis||Ns(r,i),h=(kt[r]||{}).scales||{};Object.keys(h).forEach(d=>{let u=eh(d,l),f=a[u+"AxisID"]||u;o[f]=o[f]||Object.create(null),Gt(o[f],[{axis:u},s[f],h[d]])})}),Object.keys(o).forEach(a=>{let r=o[a];Gt(r,[F.scales[r.type],F.scale])}),o}function Ha(e){let i=e.options||(e.options={});i.plugins=C(i.plugins,{}),i.scales=oh(e,i)}function Wa(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function ah(e){return e=e||{},e.data=Wa(e.data),Ha(e),e}var ea=new Map,ja=new Set;function hi(e,i){let t=ea.get(e);return t||(t=i(),ea.set(e,t),ja.add(t)),t}var ke=(e,i,t)=>{let s=pt(i,t);s!==void 0&&e.add(s)},Ws=class{constructor(i){this._config=ah(i),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(i){this._config.type=i}get data(){return this._config.data}set data(i){this._config.data=Wa(i)}get options(){return this._config.options}set options(i){this._config.options=i}get plugins(){return this._config.plugins}update(){let i=this._config;this.clearCache(),Ha(i)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(i){return hi(i,()=>[[`datasets.${i}`,""]])}datasetAnimationScopeKeys(i,t){return hi(`${i}.transition.${t}`,()=>[[`datasets.${i}.transitions.${t}`,`transitions.${t}`],[`datasets.${i}`,""]])}datasetElementScopeKeys(i,t){return hi(`${i}-${t}`,()=>[[`datasets.${i}.elements.${t}`,`datasets.${i}`,`elements.${t}`,""]])}pluginScopeKeys(i){let t=i.id,s=this.type;return hi(`${s}-plugin-${t}`,()=>[[`plugins.${t}`,...i.additionalOptionScopes||[]]])}_cachedScopes(i,t){let s=this._scopeCache,n=s.get(i);return(!n||t)&&(n=new Map,s.set(i,n)),n}getOptionScopes(i,t,s){let{options:n,type:o}=this,a=this._cachedScopes(i,s),r=a.get(t);if(r)return r;let l=new Set;t.forEach(h=>{i&&(l.add(i),h.forEach(d=>ke(l,i,d))),h.forEach(d=>ke(l,n,d)),h.forEach(d=>ke(l,kt[o]||{},d)),h.forEach(d=>ke(l,F,d)),h.forEach(d=>ke(l,ei,d))});let c=Array.from(l);return c.length===0&&c.push(Object.create(null)),ja.has(t)&&a.set(t,c),c}chartOptionScopes(){let{options:i,type:t}=this;return[i,kt[t]||{},F.datasets[t]||{},{type:t},F,ei]}resolveNamedOptions(i,t,s,n=[""]){let o={$shared:!0},{resolver:a,subPrefixes:r}=ia(this._resolverCache,i,n),l=a;if(lh(a,t)){o.$shared=!1,s=ft(s)?s():s;let c=this.createResolver(i,s,r);l=zt(a,s,c)}for(let c of t)o[c]=l[c];return o}createResolver(i,t,s=[""],n){let{resolver:o}=ia(this._resolverCache,i,s);return A(t)?zt(o,t,void 0,n):o}};function ia(e,i,t){let s=e.get(i);s||(s=new Map,e.set(i,s));let n=t.join(),o=s.get(n);return o||(o={resolver:ni(i,t),subPrefixes:t.filter(r=>!r.toLowerCase().includes("hover"))},s.set(n,o)),o}var rh=e=>A(e)&&Object.getOwnPropertyNames(e).some(i=>ft(e[i]));function lh(e,i){let{isScriptable:t,isIndexable:s}=ds(e);for(let n of i){let o=t(n),a=s(n),r=(a||o)&&e[n];if(o&&(ft(r)||rh(r))||a&&z(r))return!0}return!1}var ch="4.5.1",hh=["top","bottom","left","right","chartArea"];function sa(e,i){return e==="top"||e==="bottom"||hh.indexOf(e)===-1&&i==="x"}function na(e,i){return function(t,s){return t[e]===s[e]?t[i]-s[i]:t[e]-s[e]}}function oa(e){let i=e.chart,t=i.options.animation;i.notifyPlugins("afterRender"),I(t&&t.onComplete,[e],i)}function dh(e){let i=e.chart,t=i.options.animation;I(t&&t.onProgress,[e],i)}function $a(e){return oi()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}var pi={},aa=e=>{let i=$a(e);return Object.values(pi).filter(t=>t.canvas===i).pop()};function uh(e,i,t){let s=Object.keys(e);for(let n of s){let o=+n;if(o>=i){let a=e[n];delete e[n],(t>0||o>i)&&(e[o+t]=a)}}}function fh(e,i,t,s){return!t||e.type==="mouseout"?null:s?i:e}var wi=(()=>{class e{static defaults=F;static instances=pi;static overrides=kt;static registry=dt;static version=ch;static getChart=aa;static register(...t){dt.add(...t),ra()}static unregister(...t){dt.remove(...t),ra()}constructor(t,s){let n=this.config=new Ws(s),o=$a(t),a=aa(o);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.");let r=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||Ec(o)),this.platform.updateConfig(n);let l=this.platform.acquireContext(o,r.aspectRatio),c=l&&l.canvas,h=c&&c.height,d=c&&c.width;if(this.id=no(),this.ctx=l,this.canvas=c,this.width=d,this.height=h,this._options=r,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 Vs,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=mo(u=>this.update(u),r.resizeDelay||0),this._dataChanges=[],pi[this.id]=this,!l||!c){console.error("Failed to create chart: can't acquire context from the given item");return}bt.listen(this,"complete",oa),bt.listen(this,"progress",dh),this._initialize(),this.attached&&this.update()}get aspectRatio(){let{options:{aspectRatio:t,maintainAspectRatio:s},width:n,height:o,_aspectRatio:a}=this;return O(t)?s&&a?a:o?n/o: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 dt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():ps(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return ls(this.canvas,this.ctx),this}stop(){return bt.stop(this),this}resize(t,s){bt.running(this)?this._resizeBeforeDraw={width:t,height:s}:this._resize(t,s)}_resize(t,s){let n=this.options,o=this.canvas,a=n.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(o,t,s,a),l=n.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,ps(this,l,!0)&&(this.notifyPlugins("resize",{size:r}),I(n.onResize,[this,r],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){let s=this.options.scales||{};L(s,(n,o)=>{n.id=o})}buildOrUpdateScales(){let t=this.options,s=t.scales,n=this.scales,o=Object.keys(n).reduce((r,l)=>(r[l]=!1,r),{}),a=[];s&&(a=a.concat(Object.keys(s).map(r=>{let l=s[r],c=Hs(r,l),h=c==="r",d=c==="x";return{options:l,dposition:h?"chartArea":d?"bottom":"left",dtype:h?"radialLinear":d?"category":"linear"}}))),L(a,r=>{let l=r.options,c=l.id,h=Hs(c,l),d=C(l.type,r.dtype);(l.position===void 0||sa(l.position,h)!==sa(r.dposition))&&(l.position=r.dposition),o[c]=!0;let u=null;if(c in n&&n[c].type===d)u=n[c];else{let f=dt.getScale(d);u=new f({id:c,type:d,ctx:this.ctx,chart:this}),n[u.id]=u}u.init(l,t)}),L(o,(r,l)=>{r||delete n[l]}),L(n,r=>{G.configure(this,r,r.options),G.addBox(this,r)})}_updateMetasets(){let t=this._metasets,s=this.data.datasets.length,n=t.length;if(t.sort((o,a)=>o.index-a.index),n>s){for(let o=s;o<n;++o)this._destroyDatasetMeta(o);t.splice(s,n-s)}this._sortedMetasets=t.slice(0).sort(na("order","index"))}_removeUnreferencedMetasets(){let{_metasets:t,data:{datasets:s}}=this;t.length>s.length&&delete this._stacks,t.forEach((n,o)=>{s.filter(a=>a===n._dataset).length===0&&this._destroyDatasetMeta(o)})}buildOrUpdateControllers(){let t=[],s=this.data.datasets,n,o;for(this._removeUnreferencedMetasets(),n=0,o=s.length;n<o;n++){let a=s[n],r=this.getDatasetMeta(n),l=a.type||this.config.type;if(r.type&&r.type!==l&&(this._destroyDatasetMeta(n),r=this.getDatasetMeta(n)),r.type=l,r.indexAxis=a.indexAxis||Ns(l,this.options),r.order=a.order||0,r.index=n,r.label=""+a.label,r.visible=this.isDatasetVisible(n),r.controller)r.controller.updateIndex(n),r.controller.linkScales();else{let c=dt.getController(l),{datasetElementType:h,dataElementType:d}=F.datasets[l];Object.assign(c,{dataElementType:dt.getElement(d),datasetElementType:h&&dt.getElement(h)}),r.controller=new c(this,n),t.push(r.controller)}}return this._updateMetasets(),t}_resetElements(){L(this.data.datasets,(t,s)=>{this.getDatasetMeta(s).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){let s=this.config;s.update();let n=this._options=s.createResolver(s.chartOptionScopes(),this.getContext()),o=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;let a=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let h=0,d=this.data.datasets.length;h<d;h++){let{controller:u}=this.getDatasetMeta(h),f=!o&&a.indexOf(u)===-1;u.buildOrUpdateElements(f),r=Math.max(+u.getMaxOverflow(),r)}r=this._minPadding=n.layout.autoPadding?r:0,this._updateLayout(r),o||L(a,h=>{h.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(na("z","_idx"));let{_active:l,_lastEvent:c}=this;c?this._eventHandler(c,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){L(this.scales,t=>{G.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let t=this.options,s=new Set(Object.keys(this._listeners)),n=new Set(t.events);(!qi(s,n)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:t}=this,s=this._getUniformDataChanges()||[];for(let{method:n,start:o,count:a}of s){let r=n==="_removeElements"?-a:a;uh(t,o,r)}}_getUniformDataChanges(){let t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];let s=this.data.datasets.length,n=a=>new Set(t.filter(r=>r[0]===a).map((r,l)=>l+","+r.splice(1).join(","))),o=n(0);for(let a=1;a<s;a++)if(!qi(o,n(a)))return;return Array.from(o).map(a=>a.split(",")).map(a=>({method:a[1],start:+a[2],count:+a[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;G.update(this,this.width,this.height,t);let s=this.chartArea,n=s.width<=0||s.height<=0;this._layers=[],L(this.boxes,o=>{n&&o.position==="chartArea"||(o.configure&&o.configure(),this._layers.push(...o._layers()))},this),this._layers.forEach((o,a)=>{o._idx=a}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let s=0,n=this.data.datasets.length;s<n;++s)this.getDatasetMeta(s).controller.configure();for(let s=0,n=this.data.datasets.length;s<n;++s)this._updateDataset(s,ft(t)?t({datasetIndex:s}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,s){let n=this.getDatasetMeta(t),o={meta:n,index:t,mode:s,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",o)!==!1&&(n.controller._update(s),o.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",o))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(bt.has(this)?this.attached&&!bt.running(this)&&bt.start(this):(this.draw(),oa({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){let{width:n,height:o}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(n,o)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;let s=this._layers;for(t=0;t<s.length&&s[t].z<=0;++t)s[t].draw(this.chartArea);for(this._drawDatasets();t<s.length;++t)s[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){let s=this._sortedMetasets,n=[],o,a;for(o=0,a=s.length;o<a;++o){let r=s[o];(!t||r.visible)&&n.push(r)}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;let t=this.getSortedVisibleDatasetMetas();for(let s=t.length-1;s>=0;--s)this._drawDataset(t[s]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){let s=this.ctx,n={meta:t,index:t.index,cancelable:!0},o=vs(this,t);this.notifyPlugins("beforeDatasetDraw",n)!==!1&&(o&&_e(s,o),t.controller.draw(),o&&xe(s),n.cancelable=!1,this.notifyPlugins("afterDatasetDraw",n))}isPointInArea(t){return rt(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,s,n,o){let a=pc.modes[s];return typeof a=="function"?a(this,t,n,o):[]}getDatasetMeta(t){let s=this.data.datasets[t],n=this._metasets,o=n.filter(a=>a&&a._dataset===s).pop();return o||(o={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:s&&s.order||0,index:t,_dataset:s,_parsed:[],_sorted:!1},n.push(o)),o}getContext(){return this.$context||(this.$context=mt(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){let s=this.data.datasets[t];if(!s)return!1;let n=this.getDatasetMeta(t);return typeof n.hidden=="boolean"?!n.hidden:!s.hidden}setDatasetVisibility(t,s){let n=this.getDatasetMeta(t);n.hidden=!s}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,s,n){let o=n?"show":"hide",a=this.getDatasetMeta(t),r=a.controller._resolveAnimations(void 0,o);Zt(s)?(a.data[s].hidden=!n,this.update()):(this.setDatasetVisibility(t,n),r.update(a,{visible:n}),this.update(l=>l.datasetIndex===t?o:void 0))}hide(t,s){this._updateVisibility(t,s,!1)}show(t,s){this._updateVisibility(t,s,!0)}_destroyDatasetMeta(t){let s=this._metasets[t];s&&s.controller&&s.controller._destroy(),delete this._metasets[t]}_stop(){let t,s;for(this.stop(),bt.remove(this),t=0,s=this.data.datasets.length;t<s;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");let{canvas:t,ctx:s}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),ls(t,s),this.platform.releaseContext(s),this.canvas=null,this.ctx=null),delete pi[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){let t=this._listeners,s=this.platform,n=(a,r)=>{s.addEventListener(this,a,r),t[a]=r},o=(a,r,l)=>{a.offsetX=r,a.offsetY=l,this._eventHandler(a)};L(this.options.events,a=>n(a,o))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});let t=this._responsiveListeners,s=this.platform,n=(c,h)=>{s.addEventListener(this,c,h),t[c]=h},o=(c,h)=>{t[c]&&(s.removeEventListener(this,c,h),delete t[c])},a=(c,h)=>{this.canvas&&this.resize(c,h)},r,l=()=>{o("attach",l),this.attached=!0,this.resize(),n("resize",a),n("detach",r)};r=()=>{this.attached=!1,o("resize",a),this._stop(),this._resize(0,0),n("attach",l)},s.isAttached(this.canvas)?l():r()}unbindEvents(){L(this._listeners,(t,s)=>{this.platform.removeEventListener(this,s,t)}),this._listeners={},L(this._responsiveListeners,(t,s)=>{this.platform.removeEventListener(this,s,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,s,n){let o=n?"set":"remove",a,r,l,c;for(s==="dataset"&&(a=this.getDatasetMeta(t[0].datasetIndex),a.controller["_"+o+"DatasetHoverStyle"]()),l=0,c=t.length;l<c;++l){r=t[l];let h=r&&this.getDatasetMeta(r.datasetIndex).controller;h&&h[o+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){let s=this._active||[],n=t.map(({datasetIndex:a,index:r})=>{let l=this.getDatasetMeta(a);if(!l)throw new Error("No dataset found at index "+a);return{datasetIndex:a,element:l.data[r],index:r}});!me(n,s)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,s))}notifyPlugins(t,s,n){return this._plugins.notify(this,t,s,n)}isPluginEnabled(t){return this._plugins._cache.filter(s=>s.plugin.id===t).length===1}_updateHoverStyles(t,s,n){let o=this.options.hover,a=(c,h)=>c.filter(d=>!h.some(u=>d.datasetIndex===u.datasetIndex&&d.index===u.index)),r=a(s,t),l=n?t:a(t,s);r.length&&this.updateHoverStyle(r,o.mode,!1),l.length&&o.mode&&this.updateHoverStyle(l,o.mode,!0)}_eventHandler(t,s){let n={event:t,replay:s,cancelable:!0,inChartArea:this.isPointInArea(t)},o=r=>(r.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",n,o)===!1)return;let a=this._handleEvent(t,s,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,o),(a||n.changed)&&this.render(),this}_handleEvent(t,s,n){let{_active:o=[],options:a}=this,r=s,l=this._getActiveElements(t,o,n,r),c=ro(t),h=fh(t,this._lastEvent,n,c);n&&(this._lastEvent=null,I(a.onHover,[t,l,this],this),c&&I(a.onClick,[t,l,this],this));let d=!me(l,o);return(d||s)&&(this._active=l,this._updateHoverStyles(l,o,s)),this._lastEvent=h,d}_getActiveElements(t,s,n,o){if(t.type==="mouseout")return[];if(!n)return s;let a=this.options.hover;return this.getElementsAtEventForMode(t,a.mode,a,o)}}return e})();function ra(){return L(wi.instances,e=>e._plugins.invalidate())}function gh(e,i,t){let{startAngle:s,x:n,y:o,outerRadius:a,innerRadius:r,options:l}=i,{borderWidth:c,borderJoinStyle:h}=l,d=Math.min(c/a,U(s-t));if(e.beginPath(),e.arc(n,o,a-c/2,s+d/2,t-d/2),r>0){let u=Math.min(c/r,U(s-t));e.arc(n,o,r+c/2,t-u/2,s+u/2,!0)}else{let u=Math.min(c/2,a*U(s-t));if(h==="round")e.arc(n,o,u,t-R/2,s+R/2,!0);else if(h==="bevel"){let f=2*u*u,p=-f*Math.cos(t+R/2)+n,g=-f*Math.sin(t+R/2)+o,m=f*Math.cos(s+R/2)+n,b=f*Math.sin(s+R/2)+o;e.lineTo(p,g),e.lineTo(m,b)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}function ph(e,i,t){let{startAngle:s,pixelMargin:n,x:o,y:a,outerRadius:r,innerRadius:l}=i,c=n/r;e.beginPath(),e.arc(o,a,r,s-c,t+c),l>n?(c=n/l,e.arc(o,a,l,t+c,s-c,!0)):e.arc(o,a,n,t+H,s-H),e.closePath(),e.clip()}function mh(e){return si(e,["outerStart","outerEnd","innerStart","innerEnd"])}function bh(e,i,t,s){let n=mh(e.options.borderRadius),o=(t-i)/2,a=Math.min(o,s*i/2),r=l=>{let c=(t-Math.min(o,l))*s/2;return $(l,0,Math.min(o,c))};return{outerStart:r(n.outerStart),outerEnd:r(n.outerEnd),innerStart:$(n.innerStart,0,a),innerEnd:$(n.innerEnd,0,a)}}function se(e,i,t,s){return{x:t+e*Math.cos(i),y:s+e*Math.sin(i)}}function xi(e,i,t,s,n,o){let{x:a,y:r,startAngle:l,pixelMargin:c,innerRadius:h}=i,d=Math.max(i.outerRadius+s+t-c,0),u=h>0?h+s+t+c:0,f=0,p=n-l;if(s){let E=h>0?h-s:0,V=d>0?d-s:0,W=(E+V)/2,st=W!==0?p*W/(W+s):p;f=(p-st)/2}let g=Math.max(.001,p*d-t/R)/d,m=(p-g)/2,b=l+m+f,_=n-m-f,{outerStart:y,outerEnd:w,innerStart:x,innerEnd:v}=bh(i,u,d,_-b),k=d-y,M=d-w,S=b+y/k,D=_-w/M,P=u+x,T=u+v,Y=b+x/P,tt=_-v/T;if(e.beginPath(),o){let E=(S+D)/2;if(e.arc(a,r,d,S,E),e.arc(a,r,d,E,D),w>0){let q=se(M,D,a,r);e.arc(q.x,q.y,w,D,_+H)}let V=se(T,_,a,r);if(e.lineTo(V.x,V.y),v>0){let q=se(T,tt,a,r);e.arc(q.x,q.y,v,_+H,tt+Math.PI)}let W=(_-v/u+(b+x/u))/2;if(e.arc(a,r,u,_-v/u,W,!0),e.arc(a,r,u,W,b+x/u,!0),x>0){let q=se(P,Y,a,r);e.arc(q.x,q.y,x,Y+Math.PI,b-H)}let st=se(k,b,a,r);if(e.lineTo(st.x,st.y),y>0){let q=se(k,S,a,r);e.arc(q.x,q.y,y,b-H,S)}}else{e.moveTo(a,r);let E=Math.cos(S)*d+a,V=Math.sin(S)*d+r;e.lineTo(E,V);let W=Math.cos(D)*d+a,st=Math.sin(D)*d+r;e.lineTo(W,st)}e.closePath()}function _h(e,i,t,s,n){let{fullCircles:o,startAngle:a,circumference:r}=i,l=i.endAngle;if(o){xi(e,i,t,s,l,n);for(let c=0;c<o;++c)e.fill();isNaN(r)||(l=a+(r%B||B))}return xi(e,i,t,s,l,n),e.fill(),l}function xh(e,i,t,s,n){let{fullCircles:o,startAngle:a,circumference:r,options:l}=i,{borderWidth:c,borderJoinStyle:h,borderDash:d,borderDashOffset:u,borderRadius:f}=l,p=l.borderAlign==="inner";if(!c)return;e.setLineDash(d||[]),e.lineDashOffset=u,p?(e.lineWidth=c*2,e.lineJoin=h||"round"):(e.lineWidth=c,e.lineJoin=h||"bevel");let g=i.endAngle;if(o){xi(e,i,t,s,g,n);for(let m=0;m<o;++m)e.stroke();isNaN(r)||(g=a+(r%B||B))}p&&ph(e,i,g),l.selfJoin&&g-a>=R&&f===0&&h!=="miter"&&gh(e,i,g),o||(xi(e,i,t,s,g,n),e.stroke())}var js=class extends ot{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:i=>i!=="borderDash"};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(i){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,i&&Object.assign(this,i)}inRange(i,t,s){let n=this.getProps(["x","y"],s),{angle:o,distance:a}=Qi(n,{x:i,y:t}),{startAngle:r,endAngle:l,innerRadius:c,outerRadius:h,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),u=(this.options.spacing+this.options.borderWidth)/2,f=C(d,l-r),p=Qt(o,r,l)&&r!==l,g=f>=B||p,m=ct(a,c+u,h+u);return g&&m}getCenterPoint(i){let{x:t,y:s,startAngle:n,endAngle:o,innerRadius:a,outerRadius:r}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],i),{offset:l,spacing:c}=this.options,h=(n+o)/2,d=(a+r+c+l)/2;return{x:t+Math.cos(h)*d,y:s+Math.sin(h)*d}}tooltipPosition(i){return this.getCenterPoint(i)}draw(i){let{options:t,circumference:s}=this,n=(t.offset||0)/4,o=(t.spacing||0)/2,a=t.circular;if(this.pixelMargin=t.borderAlign==="inner"?.33:0,this.fullCircles=s>B?Math.floor(s/B):0,s===0||this.innerRadius<0||this.outerRadius<0)return;i.save();let r=(this.startAngle+this.endAngle)/2;i.translate(Math.cos(r)*n,Math.sin(r)*n);let l=1-Math.sin(Math.min(R,s||0)),c=n*l;i.fillStyle=t.backgroundColor,i.strokeStyle=t.borderColor,_h(i,this,c,o,a),xh(i,this,c,o,a),i.restore()}};function Ya(e,i,t=i){e.lineCap=C(t.borderCapStyle,i.borderCapStyle),e.setLineDash(C(t.borderDash,i.borderDash)),e.lineDashOffset=C(t.borderDashOffset,i.borderDashOffset),e.lineJoin=C(t.borderJoinStyle,i.borderJoinStyle),e.lineWidth=C(t.borderWidth,i.borderWidth),e.strokeStyle=C(t.borderColor,i.borderColor)}function yh(e,i,t){e.lineTo(t.x,t.y)}function vh(e){return e.stepped?yo:e.tension||e.cubicInterpolationMode==="monotone"?vo:yh}function Ua(e,i,t={}){let s=e.length,{start:n=0,end:o=s-1}=t,{start:a,end:r}=i,l=Math.max(n,a),c=Math.min(o,r),h=n<a&&o<a||n>r&&o>r;return{count:s,start:l,loop:i.loop,ilen:c<l&&!h?s+c-l:c-l}}function wh(e,i,t,s){let{points:n,options:o}=i,{count:a,start:r,loop:l,ilen:c}=Ua(n,t,s),h=vh(o),{move:d=!0,reverse:u}=s||{},f,p,g;for(f=0;f<=c;++f)p=n[(r+(u?c-f:f))%a],!p.skip&&(d?(e.moveTo(p.x,p.y),d=!1):h(e,g,p,u,o.stepped),g=p);return l&&(p=n[(r+(u?c:0))%a],h(e,g,p,u,o.stepped)),!!l}function Mh(e,i,t,s){let n=i.points,{count:o,start:a,ilen:r}=Ua(n,t,s),{move:l=!0,reverse:c}=s||{},h=0,d=0,u,f,p,g,m,b,_=w=>(a+(c?r-w:w))%o,y=()=>{g!==m&&(e.lineTo(h,m),e.lineTo(h,g),e.lineTo(h,b))};for(l&&(f=n[_(0)],e.moveTo(f.x,f.y)),u=0;u<=r;++u){if(f=n[_(u)],f.skip)continue;let w=f.x,x=f.y,v=w|0;v===p?(x<g?g=x:x>m&&(m=x),h=(d*h+w)/++d):(y(),e.lineTo(w,x),p=v,d=0,g=m=x),b=x}y()}function $s(e){let i=e.options,t=i.borderDash&&i.borderDash.length;return!e._decimated&&!e._loop&&!i.tension&&i.cubicInterpolationMode!=="monotone"&&!i.stepped&&!t?Mh:wh}function kh(e){return e.stepped?Ao:e.tension||e.cubicInterpolationMode==="monotone"?To:wt}function Sh(e,i,t,s){let n=i._path;n||(n=i._path=new Path2D,i.path(n,t,s)&&n.closePath()),Ya(e,i.options),e.stroke(n)}function Ch(e,i,t,s){let{segments:n,options:o}=i,a=$s(i);for(let r of n)Ya(e,o,r.style),e.beginPath(),a(e,i,r,{start:t,end:t+s-1})&&e.closePath(),e.stroke()}var Ph=typeof Path2D=="function";function Dh(e,i,t,s){Ph&&!i.options.segment?Sh(e,i,t,s):Ch(e,i,t,s)}var Mi=(()=>{class e extends ot{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"};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,s){let n=this.options;if((n.tension||n.cubicInterpolationMode==="monotone")&&!n.stepped&&!this._pointsUpdated){let o=n.spanGaps?this._loop:this._fullLoop;Po(this._points,n,t,o,s),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=Lo(this,this.options.segment))}first(){let t=this.segments,s=this.points;return t.length&&s[t[0].start]}last(){let t=this.segments,s=this.points,n=t.length;return n&&s[t[n-1].end]}interpolate(t,s){let n=this.options,o=t[s],a=this.points,r=ys(this,{property:s,start:o,end:o});if(!r.length)return;let l=[],c=kh(n),h,d;for(h=0,d=r.length;h<d;++h){let{start:u,end:f}=r[h],p=a[u],g=a[f];if(p===g){l.push(p);continue}let m=Math.abs((o-p[s])/(g[s]-p[s])),b=c(p,g,m,n.stepped);b[s]=t[s],l.push(b)}return l.length===1?l[0]:l}pathSegment(t,s,n){return $s(this)(t,this,s,n)}path(t,s,n){let o=this.segments,a=$s(this),r=this._loop;s=s||0,n=n||this.points.length-s;for(let l of o)r&=a(t,this,l,{start:s,end:s+n-1});return!!r}draw(t,s,n,o){let a=this.options||{};(this.points||[]).length&&a.borderWidth&&(t.save(),Dh(t,this,n,o),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}return e})();function la(e,i,t,s){let n=e.options,{[t]:o}=e.getProps([t],s);return Math.abs(i-o)<n.radius+n.hitRadius}var Oh=(()=>{class e extends ot{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,s,n){let o=this.options,{x:a,y:r}=this.getProps(["x","y"],n);return Math.pow(t-a,2)+Math.pow(s-r,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(t,s){return la(this,t,"x",s)}inYRange(t,s){return la(this,t,"y",s)}getCenterPoint(t){let{x:s,y:n}=this.getProps(["x","y"],t);return{x:s,y:n}}size(t){t=t||this.options||{};let s=t.radius||0;s=Math.max(s,s&&t.hoverRadius||0);let n=s&&t.borderWidth||0;return(s+n)*2}draw(t,s){let n=this.options;this.skip||n.radius<.1||!rt(this,s,this.size(n)/2)||(t.strokeStyle=n.borderColor,t.lineWidth=n.borderWidth,t.fillStyle=n.backgroundColor,ii(t,n,this.x,this.y))}getRange(){let t=this.options||{};return t.radius+t.hitRadius}}return e})();function Xa(e,i){let{x:t,y:s,base:n,width:o,height:a}=e.getProps(["x","y","base","width","height"],i),r,l,c,h,d;return e.horizontal?(d=a/2,r=Math.min(t,n),l=Math.max(t,n),c=s-d,h=s+d):(d=o/2,r=t-d,l=t+d,c=Math.min(s,n),h=Math.max(s,n)),{left:r,top:c,right:l,bottom:h}}function Ot(e,i,t,s){return e?0:$(i,t,s)}function Ah(e,i,t){let s=e.options.borderWidth,n=e.borderSkipped,o=hs(s);return{t:Ot(n.top,o.top,0,t),r:Ot(n.right,o.right,0,i),b:Ot(n.bottom,o.bottom,0,t),l:Ot(n.left,o.left,0,i)}}function Th(e,i,t){let{enableBorderRadius:s}=e.getProps(["enableBorderRadius"]),n=e.options.borderRadius,o=Pt(n),a=Math.min(i,t),r=e.borderSkipped,l=s||A(n);return{topLeft:Ot(!l||r.top||r.left,o.topLeft,0,a),topRight:Ot(!l||r.top||r.right,o.topRight,0,a),bottomLeft:Ot(!l||r.bottom||r.left,o.bottomLeft,0,a),bottomRight:Ot(!l||r.bottom||r.right,o.bottomRight,0,a)}}function Rh(e){let i=Xa(e),t=i.right-i.left,s=i.bottom-i.top,n=Ah(e,t/2,s/2),o=Th(e,t/2,s/2);return{outer:{x:i.left,y:i.top,w:t,h:s,radius:o},inner:{x:i.left+n.l,y:i.top+n.t,w:t-n.l-n.r,h:s-n.t-n.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(n.t,n.l)),topRight:Math.max(0,o.topRight-Math.max(n.t,n.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(n.b,n.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(n.b,n.r))}}}}function Os(e,i,t,s){let n=i===null,o=t===null,r=e&&!(n&&o)&&Xa(e,s);return r&&(n||ct(i,r.left,r.right))&&(o||ct(t,r.top,r.bottom))}function Lh(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function Eh(e,i){e.rect(i.x,i.y,i.w,i.h)}function As(e,i,t={}){let s=e.x!==t.x?-i:0,n=e.y!==t.y?-i:0,o=(e.x+e.w!==t.x+t.w?i:0)-s,a=(e.y+e.h!==t.y+t.h?i:0)-n;return{x:e.x+s,y:e.y+n,w:e.w+o,h:e.h+a,radius:e.radius}}var Ys=class extends ot{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(i){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,i&&Object.assign(this,i)}draw(i){let{inflateAmount:t,options:{borderColor:s,backgroundColor:n}}=this,{inner:o,outer:a}=Rh(this),r=Lh(a.radius)?ee:Eh;i.save(),(a.w!==o.w||a.h!==o.h)&&(i.beginPath(),r(i,As(a,t,o)),i.clip(),r(i,As(o,-t,a)),i.fillStyle=s,i.fill("evenodd")),i.beginPath(),r(i,As(o,t)),i.fillStyle=n,i.fill(),i.restore()}inRange(i,t,s){return Os(this,i,t,s)}inXRange(i,t){return Os(this,i,null,t)}inYRange(i,t){return Os(this,null,i,t)}getCenterPoint(i){let{x:t,y:s,base:n,horizontal:o}=this.getProps(["x","y","base","horizontal"],i);return{x:o?(t+n)/2:t,y:o?s:(s+n)/2}}getRange(i){return i==="x"?this.width/2:this.height/2}},Ih=Object.freeze({__proto__:null,ArcElement:js,BarElement:Ys,LineElement:Mi,PointElement:Oh}),Us=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],ca=Us.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function Ka(e){return Us[e%Us.length]}function qa(e){return ca[e%ca.length]}function Fh(e,i){return e.borderColor=Ka(i),e.backgroundColor=qa(i),++i}function zh(e,i){return e.backgroundColor=e.data.map(()=>Ka(i++)),i}function Bh(e,i){return e.backgroundColor=e.data.map(()=>qa(i++)),i}function Vh(e){let i=0;return(t,s)=>{let n=e.getDatasetMeta(s).controller;n instanceof tn?i=zh(t,i):n instanceof Fa?i=Bh(t,i):n&&(i=Fh(t,i))}}function ha(e){let i;for(i in e)if(e[i].borderColor||e[i].backgroundColor)return!0;return!1}function Nh(e){return e&&(e.borderColor||e.backgroundColor)}function Hh(){return F.borderColor!=="rgba(0,0,0,0.1)"||F.backgroundColor!=="rgba(0,0,0,0.1)"}var Wh={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,i,t){if(!t.enabled)return;let{data:{datasets:s},options:n}=e.config,{elements:o}=n,a=ha(s)||Nh(n)||o&&ha(o)||Hh();if(!t.forceOverride&&a)return;let r=Vh(e);s.forEach(r)}};function jh(e,i,t,s,n){let o=n.samples||s;if(o>=t)return e.slice(i,i+t);let a=[],r=(t-2)/(o-2),l=0,c=i+t-1,h=i,d,u,f,p,g;for(a[l++]=e[h],d=0;d<o-2;d++){let m=0,b=0,_,y=Math.floor((d+1)*r)+1+i,w=Math.min(Math.floor((d+2)*r)+1,t)+i,x=w-y;for(_=y;_<w;_++)m+=e[_].x,b+=e[_].y;m/=x,b/=x;let v=Math.floor(d*r)+1+i,k=Math.min(Math.floor((d+1)*r)+1,t)+i,{x:M,y:S}=e[h];for(f=p=-1,_=v;_<k;_++)p=.5*Math.abs((M-m)*(e[_].y-S)-(M-e[_].x)*(b-S)),p>f&&(f=p,u=e[_],g=_);a[l++]=u,h=g}return a[l++]=e[c],a}function $h(e,i,t,s){let n=0,o=0,a,r,l,c,h,d,u,f,p,g,m=[],b=i+t-1,_=e[i].x,w=e[b].x-_;for(a=i;a<i+t;++a){r=e[a],l=(r.x-_)/w*s,c=r.y;let x=l|0;if(x===h)c<p?(p=c,d=a):c>g&&(g=c,u=a),n=(o*n+r.x)/++o;else{let v=a-1;if(!O(d)&&!O(u)){let k=Math.min(d,u),M=Math.max(d,u);k!==f&&k!==v&&m.push(Le(Re({},e[k]),{x:n})),M!==f&&M!==v&&m.push(Le(Re({},e[M]),{x:n}))}a>0&&v!==f&&m.push(e[v]),m.push(r),h=x,o=0,p=g=c,d=u=f=a}}return m}function Ga(e){if(e._decimated){let i=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:i})}}function da(e){e.data.datasets.forEach(i=>{Ga(i)})}function Yh(e,i){let t=i.length,s=0,n,{iScale:o}=e,{min:a,max:r,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(s=$(at(i,o.axis,a).lo,0,t-1)),c?n=$(at(i,o.axis,r).hi+1,s,t)-s:n=t-s,{start:s,count:n}}var Uh={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,i,t)=>{if(!t.enabled){da(e);return}let s=e.width;e.data.datasets.forEach((n,o)=>{let{_data:a,indexAxis:r}=n,l=e.getDatasetMeta(o),c=a||n.data;if(ie([r,e.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;let h=e.scales[l.xAxisID];if(h.type!=="linear"&&h.type!=="time"||e.options.parsing)return;let{start:d,count:u}=Yh(l,c),f=t.threshold||4*s;if(u<=f){Ga(n);return}O(a)&&(n._data=c,delete n.data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(g){this._data=g}}));let p;switch(t.algorithm){case"lttb":p=jh(c,d,u,s,t);break;case"min-max":p=$h(c,d,u,s);break;default:throw new Error(`Unsupported decimation algorithm '${t.algorithm}'`)}n._decimated=p})},destroy(e){da(e)}};function Xh(e,i,t){let s=e.segments,n=e.points,o=i.points,a=[];for(let r of s){let{start:l,end:c}=r;c=ki(l,c,n);let h=Xs(t,n[l],n[c],r.loop);if(!i.segments){a.push({source:r,target:h,start:n[l],end:n[c]});continue}let d=ys(i,h);for(let u of d){let f=Xs(t,o[u.start],o[u.end],u.loop),p=xs(r,n,f);for(let g of p)a.push({source:g,target:u,start:{[t]:ua(h,f,"start",Math.max)},end:{[t]:ua(h,f,"end",Math.min)}})}}return a}function Xs(e,i,t,s){if(s)return;let n=i[e],o=t[e];return e==="angle"&&(n=U(n),o=U(o)),{property:e,start:n,end:o}}function Kh(e,i){let{x:t=null,y:s=null}=e||{},n=i.points,o=[];return i.segments.forEach(({start:a,end:r})=>{r=ki(a,r,n);let l=n[a],c=n[r];s!==null?(o.push({x:l.x,y:s}),o.push({x:c.x,y:s})):t!==null&&(o.push({x:t,y:l.y}),o.push({x:t,y:c.y}))}),o}function ki(e,i,t){for(;i>e;i--){let s=t[i];if(!isNaN(s.x)&&!isNaN(s.y))break}return i}function ua(e,i,t,s){return e&&i?s(e[t],i[t]):e?e[t]:i?i[t]:0}function Za(e,i){let t=[],s=!1;return z(e)?(s=!0,t=e):t=Kh(e,i),t.length?new Mi({points:t,options:{tension:0},_loop:s,_fullLoop:s}):null}function fa(e){return e&&e.fill!==!1}function qh(e,i,t){let n=e[i].fill,o=[i],a;if(!t)return n;for(;n!==!1&&o.indexOf(n)===-1;){if(!N(n))return n;if(a=e[n],!a)return!1;if(a.visible)return n;o.push(n),n=a.fill}return!1}function Gh(e,i,t){let s=td(e);if(A(s))return isNaN(s.value)?!1:s;let n=parseFloat(s);return N(n)&&Math.floor(n)===n?Zh(s[0],i,n,t):["origin","start","end","stack","shape"].indexOf(s)>=0&&s}function Zh(e,i,t,s){return(e==="-"||e==="+")&&(t=i+t),t===i||t<0||t>=s?!1:t}function Jh(e,i){let t=null;return e==="start"?t=i.bottom:e==="end"?t=i.top:A(e)?t=i.getPixelForValue(e.value):i.getBasePixel&&(t=i.getBasePixel()),t}function Qh(e,i,t){let s;return e==="start"?s=t:e==="end"?s=i.options.reverse?i.min:i.max:A(e)?s=e.value:s=i.getBaseValue(),s}function td(e){let i=e.options,t=i.fill,s=C(t&&t.target,t);return s===void 0&&(s=!!i.backgroundColor),s===!1||s===null?!1:s===!0?"origin":s}function ed(e){let{scale:i,index:t,line:s}=e,n=[],o=s.segments,a=s.points,r=id(i,t);r.push(Za({x:null,y:i.bottom},s));for(let l=0;l<o.length;l++){let c=o[l];for(let h=c.start;h<=c.end;h++)sd(n,a[h],r)}return new Mi({points:n,options:{}})}function id(e,i){let t=[],s=e.getMatchingVisibleMetas("line");for(let n=0;n<s.length;n++){let o=s[n];if(o.index===i)break;o.hidden||t.unshift(o.dataset)}return t}function sd(e,i,t){let s=[];for(let n=0;n<t.length;n++){let o=t[n],{first:a,last:r,point:l}=nd(o,i,"x");if(!(!l||a&&r)){if(a)s.unshift(l);else if(e.push(l),!r)break}}e.push(...s)}function nd(e,i,t){let s=e.interpolate(i,t);if(!s)return{};let n=s[t],o=e.segments,a=e.points,r=!1,l=!1;for(let c=0;c<o.length;c++){let h=o[c],d=a[h.start][t],u=a[h.end][t];if(ct(n,d,u)){r=n===d,l=n===u;break}}return{first:r,last:l,point:s}}var yi=class{constructor(i){this.x=i.x,this.y=i.y,this.radius=i.radius}pathSegment(i,t,s){let{x:n,y:o,radius:a}=this;return t=t||{start:0,end:B},i.arc(n,o,a,t.end,t.start,!0),!s.bounds}interpolate(i){let{x:t,y:s,radius:n}=this,o=i.angle;return{x:t+Math.cos(o)*n,y:s+Math.sin(o)*n,angle:o}}};function od(e){let{chart:i,fill:t,line:s}=e;if(N(t))return ad(i,t);if(t==="stack")return ed(e);if(t==="shape")return!0;let n=rd(e);return n instanceof yi?n:Za(n,s)}function ad(e,i){let t=e.getDatasetMeta(i);return t&&e.isDatasetVisible(i)?t.dataset:null}function rd(e){return(e.scale||{}).getPointPositionForValue?cd(e):ld(e)}function ld(e){let{scale:i={},fill:t}=e,s=Jh(t,i);if(N(s)){let n=i.isHorizontal();return{x:n?s:null,y:n?null:s}}return null}function cd(e){let{scale:i,fill:t}=e,s=i.options,n=i.getLabels().length,o=s.reverse?i.max:i.min,a=Qh(t,i,o),r=[];if(s.grid.circular){let l=i.getPointPositionForValue(0,o);return new yi({x:l.x,y:l.y,radius:i.getDistanceFromCenterForValue(a)})}for(let l=0;l<n;++l)r.push(i.getPointPositionForValue(l,a));return r}function Ts(e,i,t){let s=od(i),{chart:n,index:o,line:a,scale:r,axis:l}=i,c=a.options,h=c.fill,d=c.backgroundColor,{above:u=d,below:f=d}=h||{},p=n.getDatasetMeta(o),g=vs(n,p);s&&a.points.length&&(_e(e,t),hd(e,{line:a,target:s,above:u,below:f,area:t,scale:r,axis:l,clip:g}),xe(e))}function hd(e,i){let{line:t,target:s,above:n,below:o,area:a,scale:r,clip:l}=i,c=t._loop?"angle":i.axis;e.save();let h=o;o!==n&&(c==="x"?(ga(e,s,a.top),Rs(e,{line:t,target:s,color:n,scale:r,property:c,clip:l}),e.restore(),e.save(),ga(e,s,a.bottom)):c==="y"&&(pa(e,s,a.left),Rs(e,{line:t,target:s,color:o,scale:r,property:c,clip:l}),e.restore(),e.save(),pa(e,s,a.right),h=n)),Rs(e,{line:t,target:s,color:h,scale:r,property:c,clip:l}),e.restore()}function ga(e,i,t){let{segments:s,points:n}=i,o=!0,a=!1;e.beginPath();for(let r of s){let{start:l,end:c}=r,h=n[l],d=n[ki(l,c,n)];o?(e.moveTo(h.x,h.y),o=!1):(e.lineTo(h.x,t),e.lineTo(h.x,h.y)),a=!!i.pathSegment(e,r,{move:a}),a?e.closePath():e.lineTo(d.x,t)}e.lineTo(i.first().x,t),e.closePath(),e.clip()}function pa(e,i,t){let{segments:s,points:n}=i,o=!0,a=!1;e.beginPath();for(let r of s){let{start:l,end:c}=r,h=n[l],d=n[ki(l,c,n)];o?(e.moveTo(h.x,h.y),o=!1):(e.lineTo(t,h.y),e.lineTo(h.x,h.y)),a=!!i.pathSegment(e,r,{move:a}),a?e.closePath():e.lineTo(t,d.y)}e.lineTo(t,i.first().y),e.closePath(),e.clip()}function Rs(e,i){let{line:t,target:s,property:n,color:o,scale:a,clip:r}=i,l=Xh(t,s,n);for(let{source:c,target:h,start:d,end:u}of l){let{style:{backgroundColor:f=o}={}}=c,p=s!==!0;e.save(),e.fillStyle=f,dd(e,a,r,p&&Xs(n,d,u)),e.beginPath();let g=!!t.pathSegment(e,c),m;if(p){g?e.closePath():ma(e,s,u,n);let b=!!s.pathSegment(e,h,{move:g,reverse:!0});m=g&&b,m||ma(e,s,d,n)}e.closePath(),e.fill(m?"evenodd":"nonzero"),e.restore()}}function dd(e,i,t,s){let n=i.chart.chartArea,{property:o,start:a,end:r}=s||{};if(o==="x"||o==="y"){let l,c,h,d;o==="x"?(l=a,c=n.top,h=r,d=n.bottom):(l=n.left,c=a,h=n.right,d=r),e.beginPath(),t&&(l=Math.max(l,t.left),h=Math.min(h,t.right),c=Math.max(c,t.top),d=Math.min(d,t.bottom)),e.rect(l,c,h-l,d-c),e.clip()}}function ma(e,i,t,s){let n=i.interpolate(t,s);n&&e.lineTo(n.x,n.y)}var ud={id:"filler",afterDatasetsUpdate(e,i,t){let s=(e.data.datasets||[]).length,n=[],o,a,r,l;for(a=0;a<s;++a)o=e.getDatasetMeta(a),r=o.dataset,l=null,r&&r.options&&r instanceof Mi&&(l={visible:e.isDatasetVisible(a),index:a,fill:Gh(r,a,s),chart:e,axis:o.controller.options.indexAxis,scale:o.vScale,line:r}),o.$filler=l,n.push(l);for(a=0;a<s;++a)l=n[a],!(!l||l.fill===!1)&&(l.fill=qh(n,a,t.propagate))},beforeDraw(e,i,t){let s=t.drawTime==="beforeDraw",n=e.getSortedVisibleDatasetMetas(),o=e.chartArea;for(let a=n.length-1;a>=0;--a){let r=n[a].$filler;r&&(r.line.updateControlPoints(o,r.axis),s&&r.fill&&Ts(e.ctx,r,o))}},beforeDatasetsDraw(e,i,t){if(t.drawTime!=="beforeDatasetsDraw")return;let s=e.getSortedVisibleDatasetMetas();for(let n=s.length-1;n>=0;--n){let o=s[n].$filler;fa(o)&&Ts(e.ctx,o,e.chartArea)}},beforeDatasetDraw(e,i,t){let s=i.meta.$filler;!fa(s)||t.drawTime!=="beforeDatasetDraw"||Ts(e.ctx,s,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}},ba=(e,i)=>{let{boxHeight:t=i,boxWidth:s=i}=e;return e.usePointStyle&&(t=Math.min(t,i),s=e.pointStyleWidth||Math.min(s,i)),{boxWidth:s,boxHeight:t,itemHeight:Math.max(i,t)}},fd=(e,i)=>e!==null&&i!==null&&e.datasetIndex===i.datasetIndex&&e.index===i.index,vi=class extends ot{constructor(i){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=i.chart,this.options=i.options,this.ctx=i.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(i,t,s){this.maxWidth=i,this.maxHeight=t,this._margins=s,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(){let i=this.options.labels||{},t=I(i.generateLabels,[this.chart],this)||[];i.filter&&(t=t.filter(s=>i.filter(s,this.chart.data))),i.sort&&(t=t.sort((s,n)=>i.sort(s,n,this.chart.data))),this.options.reverse&&t.reverse(),this.legendItems=t}fit(){let{options:i,ctx:t}=this;if(!i.display){this.width=this.height=0;return}let s=i.labels,n=j(s.font),o=n.size,a=this._computeTitleHeight(),{boxWidth:r,itemHeight:l}=ba(s,o),c,h;t.font=n.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(a,o,r,l)+10):(h=this.maxHeight,c=this._fitCols(a,n,r,l)+10),this.width=Math.min(c,i.maxWidth||this.maxWidth),this.height=Math.min(h,i.maxHeight||this.maxHeight)}_fitRows(i,t,s,n){let{ctx:o,maxWidth:a,options:{labels:{padding:r}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=n+r,d=i;o.textAlign="left",o.textBaseline="middle";let u=-1,f=-h;return this.legendItems.forEach((p,g)=>{let m=s+t/2+o.measureText(p.text).width;(g===0||c[c.length-1]+m+2*r>a)&&(d+=h,c[c.length-(g>0?0:1)]=0,f+=h,u++),l[g]={left:0,top:f,row:u,width:m,height:n},c[c.length-1]+=m+r}),d}_fitCols(i,t,s,n){let{ctx:o,maxHeight:a,options:{labels:{padding:r}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=a-i,d=r,u=0,f=0,p=0,g=0;return this.legendItems.forEach((m,b)=>{let{itemWidth:_,itemHeight:y}=gd(s,t,o,m,n);b>0&&f+y+2*r>h&&(d+=u+r,c.push({width:u,height:f}),p+=u+r,g++,u=f=0),l[b]={left:p,top:f,col:g,width:_,height:y},u=Math.max(u,_),f+=y+r}),d+=u,c.push({width:u,height:f}),d}adjustHitBoxes(){if(!this.options.display)return;let i=this._computeTitleHeight(),{legendHitBoxes:t,options:{align:s,labels:{padding:n},rtl:o}}=this,a=Vt(o,this.left,this.width);if(this.isHorizontal()){let r=0,l=X(s,this.left+n,this.right-this.lineWidths[r]);for(let c of t)r!==c.row&&(r=c.row,l=X(s,this.left+n,this.right-this.lineWidths[r])),c.top+=this.top+i+n,c.left=a.leftForLtr(a.x(l),c.width),l+=c.width+n}else{let r=0,l=X(s,this.top+i+n,this.bottom-this.columnSizes[r].height);for(let c of t)c.col!==r&&(r=c.col,l=X(s,this.top+i+n,this.bottom-this.columnSizes[r].height)),c.top=l,c.left+=this.left+n,c.left=a.leftForLtr(a.x(c.left),c.width),l+=c.height+n}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){let i=this.ctx;_e(i,this),this._draw(),xe(i)}}_draw(){let{options:i,columnSizes:t,lineWidths:s,ctx:n}=this,{align:o,labels:a}=i,r=F.color,l=Vt(i.rtl,this.left,this.width),c=j(a.font),{padding:h}=a,d=c.size,u=d/2,f;this.drawTitle(),n.textAlign=l.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=c.string;let{boxWidth:p,boxHeight:g,itemHeight:m}=ba(a,d),b=function(v,k,M){if(isNaN(p)||p<=0||isNaN(g)||g<0)return;n.save();let S=C(M.lineWidth,1);if(n.fillStyle=C(M.fillStyle,r),n.lineCap=C(M.lineCap,"butt"),n.lineDashOffset=C(M.lineDashOffset,0),n.lineJoin=C(M.lineJoin,"miter"),n.lineWidth=S,n.strokeStyle=C(M.strokeStyle,r),n.setLineDash(C(M.lineDash,[])),a.usePointStyle){let D={radius:g*Math.SQRT2/2,pointStyle:M.pointStyle,rotation:M.rotation,borderWidth:S},P=l.xPlus(v,p/2),T=k+u;cs(n,D,P,T,a.pointStyleWidth&&p)}else{let D=k+Math.max((d-g)/2,0),P=l.leftForLtr(v,p),T=Pt(M.borderRadius);n.beginPath(),Object.values(T).some(Y=>Y!==0)?ee(n,{x:P,y:D,w:p,h:g,radius:T}):n.rect(P,D,p,g),n.fill(),S!==0&&n.stroke()}n.restore()},_=function(v,k,M){Ct(n,M.text,v,k+m/2,c,{strikethrough:M.hidden,textAlign:l.textAlign(M.textAlign)})},y=this.isHorizontal(),w=this._computeTitleHeight();y?f={x:X(o,this.left+h,this.right-s[0]),y:this.top+h+w,line:0}:f={x:this.left+h,y:X(o,this.top+w+h,this.bottom-t[0].height),line:0},bs(this.ctx,i.textDirection);let x=m+h;this.legendItems.forEach((v,k)=>{n.strokeStyle=v.fontColor,n.fillStyle=v.fontColor;let M=n.measureText(v.text).width,S=l.textAlign(v.textAlign||(v.textAlign=a.textAlign)),D=p+u+M,P=f.x,T=f.y;l.setWidth(this.width),y?k>0&&P+D+h>this.right&&(T=f.y+=x,f.line++,P=f.x=X(o,this.left+h,this.right-s[f.line])):k>0&&T+x>this.bottom&&(P=f.x=P+t[f.line].width+h,f.line++,T=f.y=X(o,this.top+w+h,this.bottom-t[f.line].height));let Y=l.x(P);if(b(Y,T,v),P=bo(S,P+p+u,y?P+D:this.right,i.rtl),_(l.x(P),T,v),y)f.x+=D+h;else if(typeof v.text!="string"){let tt=c.lineHeight;f.y+=Ja(v,tt)+h}else f.y+=x}),_s(this.ctx,i.textDirection)}drawTitle(){let i=this.options,t=i.title,s=j(t.font),n=K(t.padding);if(!t.display)return;let o=Vt(i.rtl,this.left,this.width),a=this.ctx,r=t.position,l=s.size/2,c=n.top+l,h,d=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),h=this.top+c,d=X(i.align,d,this.right-u);else{let p=this.columnSizes.reduce((g,m)=>Math.max(g,m.height),0);h=c+X(i.align,this.top,this.bottom-p-i.labels.padding-this._computeTitleHeight())}let f=X(r,d,d+u);a.textAlign=o.textAlign(ti(r)),a.textBaseline="middle",a.strokeStyle=t.color,a.fillStyle=t.color,a.font=s.string,Ct(a,t.text,f,h,s)}_computeTitleHeight(){let i=this.options.title,t=j(i.font),s=K(i.padding);return i.display?t.lineHeight+s.height:0}_getLegendItemAt(i,t){let s,n,o;if(ct(i,this.left,this.right)&&ct(t,this.top,this.bottom)){for(o=this.legendHitBoxes,s=0;s<o.length;++s)if(n=o[s],ct(i,n.left,n.left+n.width)&&ct(t,n.top,n.top+n.height))return this.legendItems[s]}return null}handleEvent(i){let t=this.options;if(!bd(i.type,t))return;let s=this._getLegendItemAt(i.x,i.y);if(i.type==="mousemove"||i.type==="mouseout"){let n=this._hoveredItem,o=fd(n,s);n&&!o&&I(t.onLeave,[i,n,this],this),this._hoveredItem=s,s&&!o&&I(t.onHover,[i,s,this],this)}else s&&I(t.onClick,[i,s,this],this)}};function gd(e,i,t,s,n){let o=pd(s,e,i,t),a=md(n,s,i.lineHeight);return{itemWidth:o,itemHeight:a}}function pd(e,i,t,s){let n=e.text;return n&&typeof n!="string"&&(n=n.reduce((o,a)=>o.length>a.length?o:a)),i+t.size/2+s.measureText(n).width}function md(e,i,t){let s=e;return typeof i.text!="string"&&(s=Ja(i,t)),s}function Ja(e,i){let t=e.text?e.text.length:0;return i*t}function bd(e,i){return!!((e==="mousemove"||e==="mouseout")&&(i.onHover||i.onLeave)||i.onClick&&(e==="click"||e==="mouseup"))}var _d={id:"legend",_element:vi,start(e,i,t){let s=e.legend=new vi({ctx:e.ctx,options:t,chart:e});G.configure(e,s,t),G.addBox(e,s)},stop(e){G.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,i,t){let s=e.legend;G.configure(e,s,t),s.options=t},afterUpdate(e){let i=e.legend;i.buildLabels(),i.adjustHitBoxes()},afterEvent(e,i){i.replay||e.legend.handleEvent(i.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,i,t){let s=i.datasetIndex,n=t.chart;n.isDatasetVisible(s)?(n.hide(s),i.hidden=!0):(n.show(s),i.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){let i=e.data.datasets,{labels:{usePointStyle:t,pointStyle:s,textAlign:n,color:o,useBorderRadius:a,borderRadius:r}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{let c=l.controller.getStyle(t?0:void 0),h=K(c.borderWidth);return{text:i[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:c.borderColor,pointStyle:s||c.pointStyle,rotation:c.rotation,textAlign:n||c.textAlign,borderRadius:a&&(r||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}},De=class extends ot{constructor(i){super(),this.chart=i.chart,this.options=i.options,this.ctx=i.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(i,t){let s=this.options;if(this.left=0,this.top=0,!s.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=i,this.height=this.bottom=t;let n=z(s.text)?s.text.length:1;this._padding=K(s.padding);let o=n*j(s.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){let i=this.options.position;return i==="top"||i==="bottom"}_drawArgs(i){let{top:t,left:s,bottom:n,right:o,options:a}=this,r=a.align,l=0,c,h,d;return this.isHorizontal()?(h=X(r,s,o),d=t+i,c=o-s):(a.position==="left"?(h=s+i,d=X(r,n,t),l=R*-.5):(h=o-i,d=X(r,t,n),l=R*.5),c=n-t),{titleX:h,titleY:d,maxWidth:c,rotation:l}}draw(){let i=this.ctx,t=this.options;if(!t.display)return;let s=j(t.font),o=s.lineHeight/2+this._padding.top,{titleX:a,titleY:r,maxWidth:l,rotation:c}=this._drawArgs(o);Ct(i,t.text,0,0,s,{color:t.color,maxWidth:l,rotation:c,textAlign:ti(t.align),textBaseline:"middle",translation:[a,r]})}};function xd(e,i){let t=new De({ctx:e.ctx,options:i,chart:e});G.configure(e,t,i),G.addBox(e,t),e.titleBlock=t}var yd={id:"title",_element:De,start(e,i,t){xd(e,t)},stop(e){let i=e.titleBlock;G.removeBox(e,i),delete e.titleBlock},beforeUpdate(e,i,t){let s=e.titleBlock;G.configure(e,s,t),s.options=t},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}},di=new WeakMap,vd={id:"subtitle",start(e,i,t){let s=new De({ctx:e.ctx,options:t,chart:e});G.configure(e,s,t),G.addBox(e,s),di.set(e,s)},stop(e){G.removeBox(e,di.get(e)),di.delete(e)},beforeUpdate(e,i,t){let s=di.get(e);G.configure(e,s,t),s.options=t},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}},Ce={average(e){if(!e.length)return!1;let i,t,s=new Set,n=0,o=0;for(i=0,t=e.length;i<t;++i){let r=e[i].element;if(r&&r.hasValue()){let l=r.tooltipPosition();s.add(l.x),n+=l.y,++o}}return o===0||s.size===0?!1:{x:[...s].reduce((r,l)=>r+l)/s.size,y:n/o}},nearest(e,i){if(!e.length)return!1;let t=i.x,s=i.y,n=Number.POSITIVE_INFINITY,o,a,r;for(o=0,a=e.length;o<a;++o){let l=e[o].element;if(l&&l.hasValue()){let c=l.getCenterPoint(),h=qe(i,c);h<n&&(n=h,r=l)}}if(r){let l=r.tooltipPosition();t=l.x,s=l.y}return{x:t,y:s}}};function ht(e,i){return i&&(z(i)?Array.prototype.push.apply(e,i):e.push(i)),e}function _t(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
|
|
3
3
|
`)>-1?e.split(`
|
|
4
4
|
`):e}function wd(e,i){let{element:t,datasetIndex:s,index:n}=i,o=e.getDatasetMeta(s).controller,{label:a,value:r}=o.getLabelAndValue(n);return{chart:e,label:a,parsed:o.getParsed(n),raw:e.data.datasets[s].data[n],formattedValue:r,dataset:o.getDataset(),dataIndex:n,datasetIndex:s,element:t}}function _a(e,i){let t=e.chart.ctx,{body:s,footer:n,title:o}=e,{boxWidth:a,boxHeight:r}=i,l=j(i.bodyFont),c=j(i.titleFont),h=j(i.footerFont),d=o.length,u=n.length,f=s.length,p=K(i.padding),g=p.height,m=0,b=s.reduce((w,x)=>w+x.before.length+x.lines.length+x.after.length,0);if(b+=e.beforeBody.length+e.afterBody.length,d&&(g+=d*c.lineHeight+(d-1)*i.titleSpacing+i.titleMarginBottom),b){let w=i.displayColors?Math.max(r,l.lineHeight):l.lineHeight;g+=f*w+(b-f)*l.lineHeight+(b-1)*i.bodySpacing}u&&(g+=i.footerMarginTop+u*h.lineHeight+(u-1)*i.footerSpacing);let _=0,y=function(w){m=Math.max(m,t.measureText(w).width+_)};return t.save(),t.font=c.string,L(e.title,y),t.font=l.string,L(e.beforeBody.concat(e.afterBody),y),_=i.displayColors?a+2+i.boxPadding:0,L(s,w=>{L(w.before,y),L(w.lines,y),L(w.after,y)}),_=0,t.font=h.string,L(e.footer,y),t.restore(),m+=p.width,{width:m,height:g}}function Md(e,i){let{y:t,height:s}=i;return t<s/2?"top":t>e.height-s/2?"bottom":"center"}function kd(e,i,t,s){let{x:n,width:o}=s,a=t.caretSize+t.caretPadding;if(e==="left"&&n+o+a>i.width||e==="right"&&n-o-a<0)return!0}function Sd(e,i,t,s){let{x:n,width:o}=t,{width:a,chartArea:{left:r,right:l}}=e,c="center";return s==="center"?c=n<=(r+l)/2?"left":"right":n<=o/2?c="left":n>=a-o/2&&(c="right"),kd(c,e,i,t)&&(c="center"),c}function xa(e,i,t){let s=t.yAlign||i.yAlign||Md(e,t);return{xAlign:t.xAlign||i.xAlign||Sd(e,i,t,s),yAlign:s}}function Cd(e,i){let{x:t,width:s}=e;return i==="right"?t-=s:i==="center"&&(t-=s/2),t}function Pd(e,i,t){let{y:s,height:n}=e;return i==="top"?s+=t:i==="bottom"?s-=n+t:s-=n/2,s}function ya(e,i,t,s){let{caretSize:n,caretPadding:o,cornerRadius:a}=e,{xAlign:r,yAlign:l}=t,c=n+o,{topLeft:h,topRight:d,bottomLeft:u,bottomRight:f}=Pt(a),p=Cd(i,r),g=Pd(i,l,c);return l==="center"?r==="left"?p+=c:r==="right"&&(p-=c):r==="left"?p-=Math.max(h,u)+n:r==="right"&&(p+=Math.max(d,f)+n),{x:$(p,0,s.width-i.width),y:$(g,0,s.height-i.height)}}function ui(e,i,t){let s=K(t.padding);return i==="center"?e.x+e.width/2:i==="right"?e.x+e.width-s.right:e.x+s.left}function va(e){return ht([],_t(e))}function Dd(e,i,t){return mt(e,{tooltip:i,tooltipItems:t,type:"tooltip"})}function wa(e,i){let t=i&&i.dataset&&i.dataset.tooltip&&i.dataset.tooltip.callbacks;return t?e.override(t):e}var Qa={beforeTitle:lt,title(e){if(e.length>0){let i=e[0],t=i.chart.data.labels,s=t?t.length:0;if(this&&this.options&&this.options.mode==="dataset")return i.dataset.label||"";if(i.label)return i.label;if(s>0&&i.dataIndex<s)return t[i.dataIndex]}return""},afterTitle:lt,beforeBody:lt,beforeLabel:lt,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let i=e.dataset.label||"";i&&(i+=": ");let t=e.formattedValue;return O(t)||(i+=t),i},labelColor(e){let t=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:t.borderColor,backgroundColor:t.backgroundColor,borderWidth:t.borderWidth,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){let t=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:t.pointStyle,rotation:t.rotation}},afterLabel:lt,afterBody:lt,beforeFooter:lt,footer:lt,afterFooter:lt};function J(e,i,t,s){let n=e[i].call(t,s);return typeof n>"u"?Qa[i].call(t,s):n}var Ma=(()=>{class e extends ot{static positioners=Ce;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(){let t=this._cachedAnimations;if(t)return t;let s=this.chart,n=this.options.setContext(this.getContext()),o=n.enabled&&s.options.animation&&n.animations,a=new mi(this.chart,o);return o._cacheable&&(this._cachedAnimations=Object.freeze(a)),a}getContext(){return this.$context||(this.$context=Dd(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,s){let{callbacks:n}=s,o=J(n,"beforeTitle",this,t),a=J(n,"title",this,t),r=J(n,"afterTitle",this,t),l=[];return l=ht(l,_t(o)),l=ht(l,_t(a)),l=ht(l,_t(r)),l}getBeforeBody(t,s){return va(J(s.callbacks,"beforeBody",this,t))}getBody(t,s){let{callbacks:n}=s,o=[];return L(t,a=>{let r={before:[],lines:[],after:[]},l=wa(n,a);ht(r.before,_t(J(l,"beforeLabel",this,a))),ht(r.lines,J(l,"label",this,a)),ht(r.after,_t(J(l,"afterLabel",this,a))),o.push(r)}),o}getAfterBody(t,s){return va(J(s.callbacks,"afterBody",this,t))}getFooter(t,s){let{callbacks:n}=s,o=J(n,"beforeFooter",this,t),a=J(n,"footer",this,t),r=J(n,"afterFooter",this,t),l=[];return l=ht(l,_t(o)),l=ht(l,_t(a)),l=ht(l,_t(r)),l}_createItems(t){let s=this._active,n=this.chart.data,o=[],a=[],r=[],l=[],c,h;for(c=0,h=s.length;c<h;++c)l.push(wd(this.chart,s[c]));return t.filter&&(l=l.filter((d,u,f)=>t.filter(d,u,f,n))),t.itemSort&&(l=l.sort((d,u)=>t.itemSort(d,u,n))),L(l,d=>{let u=wa(t.callbacks,d);o.push(J(u,"labelColor",this,d)),a.push(J(u,"labelPointStyle",this,d)),r.push(J(u,"labelTextColor",this,d))}),this.labelColors=o,this.labelPointStyles=a,this.labelTextColors=r,this.dataPoints=l,l}update(t,s){let n=this.options.setContext(this.getContext()),o=this._active,a,r=[];if(!o.length)this.opacity!==0&&(a={opacity:0});else{let l=Ce[n.position].call(this,o,this._eventPosition);r=this._createItems(n),this.title=this.getTitle(r,n),this.beforeBody=this.getBeforeBody(r,n),this.body=this.getBody(r,n),this.afterBody=this.getAfterBody(r,n),this.footer=this.getFooter(r,n);let c=this._size=_a(this,n),h=Object.assign({},l,c),d=xa(this.chart,n,h),u=ya(n,h,d,this.chart);this.xAlign=d.xAlign,this.yAlign=d.yAlign,a={opacity:1,x:u.x,y:u.y,width:c.width,height:c.height,caretX:l.x,caretY:l.y}}this._tooltipItems=r,this.$context=void 0,a&&this._resolveAnimations().update(this,a),t&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:s})}drawCaret(t,s,n,o){let a=this.getCaretPosition(t,n,o);s.lineTo(a.x1,a.y1),s.lineTo(a.x2,a.y2),s.lineTo(a.x3,a.y3)}getCaretPosition(t,s,n){let{xAlign:o,yAlign:a}=this,{caretSize:r,cornerRadius:l}=n,{topLeft:c,topRight:h,bottomLeft:d,bottomRight:u}=Pt(l),{x:f,y:p}=t,{width:g,height:m}=s,b,_,y,w,x,v;return a==="center"?(x=p+m/2,o==="left"?(b=f,_=b-r,w=x+r,v=x-r):(b=f+g,_=b+r,w=x-r,v=x+r),y=b):(o==="left"?_=f+Math.max(c,d)+r:o==="right"?_=f+g-Math.max(h,u)-r:_=this.caretX,a==="top"?(w=p,x=w-r,b=_-r,y=_+r):(w=p+m,x=w+r,b=_+r,y=_-r),v=w),{x1:b,x2:_,x3:y,y1:w,y2:x,y3:v}}drawTitle(t,s,n){let o=this.title,a=o.length,r,l,c;if(a){let h=Vt(n.rtl,this.x,this.width);for(t.x=ui(this,n.titleAlign,n),s.textAlign=h.textAlign(n.titleAlign),s.textBaseline="middle",r=j(n.titleFont),l=n.titleSpacing,s.fillStyle=n.titleColor,s.font=r.string,c=0;c<a;++c)s.fillText(o[c],h.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+l,c+1===a&&(t.y+=n.titleMarginBottom-l)}}_drawColorBox(t,s,n,o,a){let r=this.labelColors[n],l=this.labelPointStyles[n],{boxHeight:c,boxWidth:h}=a,d=j(a.bodyFont),u=ui(this,"left",a),f=o.x(u),p=c<d.lineHeight?(d.lineHeight-c)/2:0,g=s.y+p;if(a.usePointStyle){let m={radius:Math.min(h,c)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},b=o.leftForLtr(f,h)+h/2,_=g+c/2;t.strokeStyle=a.multiKeyBackground,t.fillStyle=a.multiKeyBackground,ii(t,m,b,_),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,ii(t,m,b,_)}else{t.lineWidth=A(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;let m=o.leftForLtr(f,h),b=o.leftForLtr(o.xPlus(f,1),h-2),_=Pt(r.borderRadius);Object.values(_).some(y=>y!==0)?(t.beginPath(),t.fillStyle=a.multiKeyBackground,ee(t,{x:m,y:g,w:h,h:c,radius:_}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),ee(t,{x:b,y:g+1,w:h-2,h:c-2,radius:_}),t.fill()):(t.fillStyle=a.multiKeyBackground,t.fillRect(m,g,h,c),t.strokeRect(m,g,h,c),t.fillStyle=r.backgroundColor,t.fillRect(b,g+1,h-2,c-2))}t.fillStyle=this.labelTextColors[n]}drawBody(t,s,n){let{body:o}=this,{bodySpacing:a,bodyAlign:r,displayColors:l,boxHeight:c,boxWidth:h,boxPadding:d}=n,u=j(n.bodyFont),f=u.lineHeight,p=0,g=Vt(n.rtl,this.x,this.width),m=function(S){s.fillText(S,g.x(t.x+p),t.y+f/2),t.y+=f+a},b=g.textAlign(r),_,y,w,x,v,k,M;for(s.textAlign=r,s.textBaseline="middle",s.font=u.string,t.x=ui(this,b,n),s.fillStyle=n.bodyColor,L(this.beforeBody,m),p=l&&b!=="right"?r==="center"?h/2+d:h+2+d:0,x=0,k=o.length;x<k;++x){for(_=o[x],y=this.labelTextColors[x],s.fillStyle=y,L(_.before,m),w=_.lines,l&&w.length&&(this._drawColorBox(s,t,x,g,n),f=Math.max(u.lineHeight,c)),v=0,M=w.length;v<M;++v)m(w[v]),f=u.lineHeight;L(_.after,m)}p=0,f=u.lineHeight,L(this.afterBody,m),t.y-=a}drawFooter(t,s,n){let o=this.footer,a=o.length,r,l;if(a){let c=Vt(n.rtl,this.x,this.width);for(t.x=ui(this,n.footerAlign,n),t.y+=n.footerMarginTop,s.textAlign=c.textAlign(n.footerAlign),s.textBaseline="middle",r=j(n.footerFont),s.fillStyle=n.footerColor,s.font=r.string,l=0;l<a;++l)s.fillText(o[l],c.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+n.footerSpacing}}drawBackground(t,s,n,o){let{xAlign:a,yAlign:r}=this,{x:l,y:c}=t,{width:h,height:d}=n,{topLeft:u,topRight:f,bottomLeft:p,bottomRight:g}=Pt(o.cornerRadius);s.fillStyle=o.backgroundColor,s.strokeStyle=o.borderColor,s.lineWidth=o.borderWidth,s.beginPath(),s.moveTo(l+u,c),r==="top"&&this.drawCaret(t,s,n,o),s.lineTo(l+h-f,c),s.quadraticCurveTo(l+h,c,l+h,c+f),r==="center"&&a==="right"&&this.drawCaret(t,s,n,o),s.lineTo(l+h,c+d-g),s.quadraticCurveTo(l+h,c+d,l+h-g,c+d),r==="bottom"&&this.drawCaret(t,s,n,o),s.lineTo(l+p,c+d),s.quadraticCurveTo(l,c+d,l,c+d-p),r==="center"&&a==="left"&&this.drawCaret(t,s,n,o),s.lineTo(l,c+u),s.quadraticCurveTo(l,c,l+u,c),s.closePath(),s.fill(),o.borderWidth>0&&s.stroke()}_updateAnimationTarget(t){let s=this.chart,n=this.$animations,o=n&&n.x,a=n&&n.y;if(o||a){let r=Ce[t.position].call(this,this._active,this._eventPosition);if(!r)return;let l=this._size=_a(this,t),c=Object.assign({},r,this._size),h=xa(s,t,c),d=ya(t,c,h,s);(o._to!==d.x||a._to!==d.y)&&(this.xAlign=h.xAlign,this.yAlign=h.yAlign,this.width=l.width,this.height=l.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,d))}}_willRender(){return!!this.opacity}draw(t){let s=this.options.setContext(this.getContext()),n=this.opacity;if(!n)return;this._updateAnimationTarget(s);let o={width:this.width,height:this.height},a={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;let r=K(s.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;s.enabled&&l&&(t.save(),t.globalAlpha=n,this.drawBackground(a,t,o,s),bs(t,s.textDirection),a.y+=r.top,this.drawTitle(a,t,s),this.drawBody(a,t,s),this.drawFooter(a,t,s),_s(t,s.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,s){let n=this._active,o=t.map(({datasetIndex:l,index:c})=>{let h=this.chart.getDatasetMeta(l);if(!h)throw new Error("Cannot find a dataset at index "+l);return{datasetIndex:l,element:h.data[c],index:c}}),a=!me(n,o),r=this._positionChanged(o,s);(a||r)&&(this._active=o,this._eventPosition=s,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,s,n=!0){if(s&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let o=this.options,a=this._active||[],r=this._getActiveElements(t,a,s,n),l=this._positionChanged(r,t),c=s||!me(r,a)||l;return c&&(this._active=r,(o.enabled||o.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,s))),c}_getActiveElements(t,s,n,o){let a=this.options;if(t.type==="mouseout")return[];if(!o)return s.filter(l=>this.chart.data.datasets[l.datasetIndex]&&this.chart.getDatasetMeta(l.datasetIndex).controller.getParsed(l.index)!==void 0);let r=this.chart.getElementsAtEventForMode(t,a.mode,a,n);return a.reverse&&r.reverse(),r}_positionChanged(t,s){let{caretX:n,caretY:o,options:a}=this,r=Ce[a.position].call(this,t,s);return r!==!1&&(n!==r.x||o!==r.y)}}return e})(),Od={id:"tooltip",_element:Ma,positioners:Ce,afterInit(e,i,t){t&&(e.tooltip=new Ma({chart:e,options:t}))},beforeUpdate(e,i,t){e.tooltip&&e.tooltip.initialize(t)},reset(e,i,t){e.tooltip&&e.tooltip.initialize(t)},afterDraw(e){let i=e.tooltip;if(i&&i._willRender()){let t={tooltip:i};if(e.notifyPlugins("beforeTooltipDraw",Le(Re({},t),{cancelable:!0}))===!1)return;i.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",t)}},afterEvent(e,i){if(e.tooltip){let t=i.replay;e.tooltip.handleEvent(i.event,t,i.inChartArea)&&(i.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,i)=>i.bodyFont.size,boxWidth:(e,i)=>i.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:Qa},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Ad=Object.freeze({__proto__:null,Colors:Wh,Decimation:Uh,Filler:ud,Legend:_d,SubTitle:vd,Title:yd,Tooltip:Od}),Td=(e,i,t,s)=>(typeof i=="string"?(t=e.push(i)-1,s.unshift({index:t,label:i})):isNaN(i)&&(t=null),t);function Rd(e,i,t,s){let n=e.indexOf(i);if(n===-1)return Td(e,i,t,s);let o=e.lastIndexOf(i);return n!==o?t:n}var Ld=(e,i)=>e===null?null:$(Math.round(e),0,i);function ka(e){let i=this.getLabels();return e>=0&&e<i.length?i[e]:e}var Ed=(()=>{class e extends Wt{static id="category";static defaults={ticks:{callback:ka}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){let s=this._addedLabels;if(s.length){let n=this.getLabels();for(let{index:o,label:a}of s)n[o]===a&&n.splice(o,1);this._addedLabels=[]}super.init(t)}parse(t,s){if(O(t))return null;let n=this.getLabels();return s=isFinite(s)&&n[s]===t?s:Rd(n,t,C(s,t),this._addedLabels),Ld(s,n.length-1)}determineDataLimits(){let{minDefined:t,maxDefined:s}=this.getUserBounds(),{min:n,max:o}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(n=0),s||(o=this.getLabels().length-1)),this.min=n,this.max=o}buildTicks(){let t=this.min,s=this.max,n=this.options.offset,o=[],a=this.getLabels();a=t===0&&s===a.length-1?a:a.slice(t,s+1),this._valueRange=Math.max(a.length-(n?0:1),1),this._startValue=this.min-(n?.5:0);for(let r=t;r<=s;r++)o.push({value:r});return o}getLabelForValue(t){return ka.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){let s=this.ticks;return t<0||t>s.length-1?null:this.getPixelForValue(s[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}return e})();function Id(e,i){let t=[],{bounds:n,step:o,min:a,max:r,precision:l,count:c,maxTicks:h,maxDigits:d,includeBounds:u}=e,f=o||1,p=h-1,{min:g,max:m}=i,b=!O(a),_=!O(r),y=!O(c),w=(m-g)/(d+1),x=Gi((m-g)/p/f)*f,v,k,M,S;if(x<1e-14&&!b&&!_)return[{value:g},{value:m}];S=Math.ceil(m/x)-Math.floor(g/x),S>p&&(x=Gi(S*x/p/f)*f),O(l)||(v=Math.pow(10,l),x=Math.ceil(x*v)/v),n==="ticks"?(k=Math.floor(g/x)*x,M=Math.ceil(m/x)*x):(k=g,M=m),b&&_&&o&&co((r-a)/o,x/1e3)?(S=Math.round(Math.min((r-a)/x,h)),x=(r-a)/S,k=a,M=r):y?(k=b?a:k,M=_?r:M,S=c-1,x=(M-k)/S):(S=(M-k)/x,Jt(S,Math.round(S),x/1e3)?S=Math.round(S):S=Math.ceil(S));let D=Math.max(Ji(x),Ji(k));v=Math.pow(10,O(l)?D:l),k=Math.round(k*v)/v,M=Math.round(M*v)/v;let P=0;for(b&&(u&&k!==a?(t.push({value:a}),k<a&&P++,Jt(Math.round((k+P*x)*v)/v,a,Sa(a,w,e))&&P++):k<a&&P++);P<S;++P){let T=Math.round((k+P*x)*v)/v;if(_&&T>r)break;t.push({value:T})}return _&&u&&M!==r?t.length&&Jt(t[t.length-1].value,r,Sa(r,w,e))?t[t.length-1].value=r:t.push({value:r}):(!_||M===r)&&t.push({value:M}),t}function Sa(e,i,{horizontal:t,minRotation:s}){let n=it(s),o=(t?Math.sin(n):Math.cos(n))||.001,a=.75*i*(""+e).length;return Math.min(i/o,a)}var oe=class extends Wt{constructor(i){super(i),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(i,t){return O(i)||(typeof i=="number"||i instanceof Number)&&!isFinite(+i)?null:+i}handleTickRangeOptions(){let{beginAtZero:i}=this.options,{minDefined:t,maxDefined:s}=this.getUserBounds(),{min:n,max:o}=this,a=l=>n=t?n:l,r=l=>o=s?o:l;if(i){let l=nt(n),c=nt(o);l<0&&c<0?r(0):l>0&&c>0&&a(0)}if(n===o){let l=o===0?1:Math.abs(o*.05);r(o+l),i||a(n-l)}this.min=n,this.max=o}getTickLimit(){let i=this.options.ticks,{maxTicksLimit:t,stepSize:s}=i,n;return s?(n=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),t=t||11),t&&(n=Math.min(t,n)),n}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){let i=this.options,t=i.ticks,s=this.getTickLimit();s=Math.max(2,s);let n={maxTicks:s,bounds:i.bounds,min:i.min,max:i.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==!1},o=this._range||this,a=Id(n,o);return i.bounds==="ticks"&&Zi(a,this,"value"),i.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){let i=this.ticks,t=this.min,s=this.max;if(super.configure(),this.options.offset&&i.length){let n=(s-t)/Math.max(i.length-1,1)/2;t-=n,s+=n}this._startValue=t,this._endValue=s,this._valueRange=s-t}getLabelForValue(i){return te(i,this.chart.options.locale,this.options.ticks.format)}},Ks=class extends oe{static id="linear";static defaults={ticks:{callback:be.formatters.numeric}};determineDataLimits(){let{min:i,max:t}=this.getMinMax(!0);this.min=N(i)?i:0,this.max=N(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){let i=this.isHorizontal(),t=i?this.width:this.height,s=it(this.options.ticks.minRotation),n=(i?Math.sin(s):Math.cos(s))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,o.lineHeight/n))}getPixelForValue(i){return i===null?NaN:this.getPixelForDecimal((i-this._startValue)/this._valueRange)}getValueForPixel(i){return this._startValue+this.getDecimalForPixel(i)*this._valueRange}},Oe=e=>Math.floor(gt(e)),Ht=(e,i)=>Math.pow(10,Oe(e)+i);function Ca(e){return e/Math.pow(10,Oe(e))===1}function Pa(e,i,t){let s=Math.pow(10,t),n=Math.floor(e/s);return Math.ceil(i/s)-n}function Fd(e,i){let t=i-e,s=Oe(t);for(;Pa(e,i,s)>10;)s++;for(;Pa(e,i,s)<10;)s--;return Math.min(s,Oe(e))}function zd(e,{min:i,max:t}){i=Z(e.min,i);let s=[],n=Oe(i),o=Fd(i,t),a=o<0?Math.pow(10,Math.abs(o)):1,r=Math.pow(10,o),l=n>o?Math.pow(10,n):0,c=Math.round((i-l)*a)/a,h=Math.floor((i-l)/r/10)*r*10,d=Math.floor((c-h)/Math.pow(10,o)),u=Z(e.min,Math.round((l+h+d*Math.pow(10,o))*a)/a);for(;u<t;)s.push({value:u,major:Ca(u),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(o++,d=2,a=o>=0?1:a),u=Math.round((l+h+d*Math.pow(10,o))*a)/a;let f=Z(e.max,u);return s.push({value:f,major:Ca(f),significand:d}),s}var qs=class extends Wt{static id="logarithmic";static defaults={ticks:{callback:be.formatters.logarithmic,major:{enabled:!0}}};constructor(i){super(i),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(i,t){let s=oe.prototype.parse.apply(this,[i,t]);if(s===0){this._zero=!0;return}return N(s)&&s>0?s:null}determineDataLimits(){let{min:i,max:t}=this.getMinMax(!0);this.min=N(i)?Math.max(0,i):null,this.max=N(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!N(this._userMin)&&(this.min=i===Ht(this.min,0)?Ht(this.min,-1):Ht(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:i,maxDefined:t}=this.getUserBounds(),s=this.min,n=this.max,o=r=>s=i?s:r,a=r=>n=t?n:r;s===n&&(s<=0?(o(1),a(10)):(o(Ht(s,-1)),a(Ht(n,1)))),s<=0&&o(Ht(n,-1)),n<=0&&a(Ht(s,1)),this.min=s,this.max=n}buildTicks(){let i=this.options,t={min:this._userMin,max:this._userMax},s=zd(t,this);return i.bounds==="ticks"&&Zi(s,this,"value"),i.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}getLabelForValue(i){return i===void 0?"0":te(i,this.chart.options.locale,this.options.ticks.format)}configure(){let i=this.min;super.configure(),this._startValue=gt(i),this._valueRange=gt(this.max)-gt(i)}getPixelForValue(i){return(i===void 0||i===0)&&(i=this.min),i===null||isNaN(i)?NaN:this.getPixelForDecimal(i===this.min?0:(gt(i)-this._startValue)/this._valueRange)}getValueForPixel(i){let t=this.getDecimalForPixel(i);return Math.pow(10,this._startValue+t*this._valueRange)}};function Gs(e){let i=e.ticks;if(i.display&&e.display){let t=K(i.backdropPadding);return C(i.font&&i.font.size,F.font.size)+t.height}return 0}function Bd(e,i,t){return t=z(t)?t:[t],{w:xo(e,i.string,t),h:t.length*i.lineHeight}}function Da(e,i,t,s,n){return e===s||e===n?{start:i-t/2,end:i+t/2}:e<s||e>n?{start:i-t,end:i}:{start:i,end:i+t}}function Vd(e){let i={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},t=Object.assign({},i),s=[],n=[],o=e._pointLabels.length,a=e.options.pointLabels,r=a.centerPointLabels?R/o:0;for(let l=0;l<o;l++){let c=a.setContext(e.getPointLabelContext(l));n[l]=c.padding;let h=e.getPointPosition(l,e.drawingArea+n[l],r),d=j(c.font),u=Bd(e.ctx,d,e._pointLabels[l]);s[l]=u;let f=U(e.getIndexAngle(l)+r),p=Math.round(Je(f)),g=Da(p,h.x,u.w,0,180),m=Da(p,h.y,u.h,90,270);Nd(t,i,f,g,m)}e.setCenterPoint(i.l-t.l,t.r-i.r,i.t-t.t,t.b-i.b),e._pointLabelItems=jd(e,s,n)}function Nd(e,i,t,s,n){let o=Math.abs(Math.sin(t)),a=Math.abs(Math.cos(t)),r=0,l=0;s.start<i.l?(r=(i.l-s.start)/o,e.l=Math.min(e.l,i.l-r)):s.end>i.r&&(r=(s.end-i.r)/o,e.r=Math.max(e.r,i.r+r)),n.start<i.t?(l=(i.t-n.start)/a,e.t=Math.min(e.t,i.t-l)):n.end>i.b&&(l=(n.end-i.b)/a,e.b=Math.max(e.b,i.b+l))}function Hd(e,i,t){let s=e.drawingArea,{extra:n,additionalAngle:o,padding:a,size:r}=t,l=e.getPointPosition(i,s+n+a,o),c=Math.round(Je(U(l.angle+H))),h=Ud(l.y,r.h,c),d=$d(c),u=Yd(l.x,r.w,d);return{visible:!0,x:l.x,y:h,textAlign:d,left:u,top:h,right:u+r.w,bottom:h+r.h}}function Wd(e,i){if(!i)return!0;let{left:t,top:s,right:n,bottom:o}=e;return!(rt({x:t,y:s},i)||rt({x:t,y:o},i)||rt({x:n,y:s},i)||rt({x:n,y:o},i))}function jd(e,i,t){let s=[],n=e._pointLabels.length,o=e.options,{centerPointLabels:a,display:r}=o.pointLabels,l={extra:Gs(o)/2,additionalAngle:a?R/n:0},c;for(let h=0;h<n;h++){l.padding=t[h],l.size=i[h];let d=Hd(e,h,l);s.push(d),r==="auto"&&(d.visible=Wd(d,c),d.visible&&(c=d))}return s}function $d(e){return e===0||e===180?"center":e<180?"left":"right"}function Yd(e,i,t){return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function Ud(e,i,t){return t===90||t===270?e-=i/2:(t>270||t<90)&&(e-=i),e}function Xd(e,i,t){let{left:s,top:n,right:o,bottom:a}=t,{backdropColor:r}=i;if(!O(r)){let l=Pt(i.borderRadius),c=K(i.backdropPadding);e.fillStyle=r;let h=s-c.left,d=n-c.top,u=o-s+c.width,f=a-n+c.height;Object.values(l).some(p=>p!==0)?(e.beginPath(),ee(e,{x:h,y:d,w:u,h:f,radius:l}),e.fill()):e.fillRect(h,d,u,f)}}function Kd(e,i){let{ctx:t,options:{pointLabels:s}}=e;for(let n=i-1;n>=0;n--){let o=e._pointLabelItems[n];if(!o.visible)continue;let a=s.setContext(e.getPointLabelContext(n));Xd(t,a,o);let r=j(a.font),{x:l,y:c,textAlign:h}=o;Ct(t,e._pointLabels[n],l,c+r.lineHeight/2,r,{color:a.color,textAlign:h,textBaseline:"middle"})}}function tr(e,i,t,s){let{ctx:n}=e;if(t)n.arc(e.xCenter,e.yCenter,i,0,B);else{let o=e.getPointPosition(0,i);n.moveTo(o.x,o.y);for(let a=1;a<s;a++)o=e.getPointPosition(a,i),n.lineTo(o.x,o.y)}}function qd(e,i,t,s,n){let o=e.ctx,a=i.circular,{color:r,lineWidth:l}=i;!a&&!s||!r||!l||t<0||(o.save(),o.strokeStyle=r,o.lineWidth=l,o.setLineDash(n.dash||[]),o.lineDashOffset=n.dashOffset,o.beginPath(),tr(e,t,a,s),o.closePath(),o.stroke(),o.restore())}function Gd(e,i,t){return mt(e,{label:t,index:i,type:"pointLabel"})}var Zs=class extends oe{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:be.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(i){return i},padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(i){super(i),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){let i=this._padding=K(Gs(this.options)/2),t=this.width=this.maxWidth-i.width,s=this.height=this.maxHeight-i.height;this.xCenter=Math.floor(this.left+t/2+i.left),this.yCenter=Math.floor(this.top+s/2+i.top),this.drawingArea=Math.floor(Math.min(t,s)/2)}determineDataLimits(){let{min:i,max:t}=this.getMinMax(!1);this.min=N(i)&&!isNaN(i)?i:0,this.max=N(t)&&!isNaN(t)?t:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Gs(this.options))}generateTickLabels(i){oe.prototype.generateTickLabels.call(this,i),this._pointLabels=this.getLabels().map((t,s)=>{let n=I(this.options.pointLabels.callback,[t,s],this);return n||n===0?n:""}).filter((t,s)=>this.chart.getDataVisibility(s))}fit(){let i=this.options;i.display&&i.pointLabels.display?Vd(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(i,t,s,n){this.xCenter+=Math.floor((i-t)/2),this.yCenter+=Math.floor((s-n)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(i,t,s,n))}getIndexAngle(i){let t=B/(this._pointLabels.length||1),s=this.options.startAngle||0;return U(i*t+it(s))}getDistanceFromCenterForValue(i){if(O(i))return NaN;let t=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-i)*t:(i-this.min)*t}getValueForDistanceFromCenter(i){if(O(i))return NaN;let t=i/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t}getPointLabelContext(i){let t=this._pointLabels||[];if(i>=0&&i<t.length){let s=t[i];return Gd(this.getContext(),i,s)}}getPointPosition(i,t,s=0){let n=this.getIndexAngle(i)-H+s;return{x:Math.cos(n)*t+this.xCenter,y:Math.sin(n)*t+this.yCenter,angle:n}}getPointPositionForValue(i,t){return this.getPointPosition(i,this.getDistanceFromCenterForValue(t))}getBasePosition(i){return this.getPointPositionForValue(i||0,this.getBaseValue())}getPointLabelPosition(i){let{left:t,top:s,right:n,bottom:o}=this._pointLabelItems[i];return{left:t,top:s,right:n,bottom:o}}drawBackground(){let{backgroundColor:i,grid:{circular:t}}=this.options;if(i){let s=this.ctx;s.save(),s.beginPath(),tr(this,this.getDistanceFromCenterForValue(this._endValue),t,this._pointLabels.length),s.closePath(),s.fillStyle=i,s.fill(),s.restore()}}drawGrid(){let i=this.ctx,t=this.options,{angleLines:s,grid:n,border:o}=t,a=this._pointLabels.length,r,l,c;if(t.pointLabels.display&&Kd(this,a),n.display&&this.ticks.forEach((h,d)=>{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(h.value);let u=this.getContext(d),f=n.setContext(u),p=o.setContext(u);qd(this,f,l,a,p)}}),s.display){for(i.save(),r=a-1;r>=0;r--){let h=s.setContext(this.getPointLabelContext(r)),{color:d,lineWidth:u}=h;!u||!d||(i.lineWidth=u,i.strokeStyle=d,i.setLineDash(h.borderDash),i.lineDashOffset=h.borderDashOffset,l=this.getDistanceFromCenterForValue(t.reverse?this.min:this.max),c=this.getPointPosition(r,l),i.beginPath(),i.moveTo(this.xCenter,this.yCenter),i.lineTo(c.x,c.y),i.stroke())}i.restore()}}drawBorder(){}drawLabels(){let i=this.ctx,t=this.options,s=t.ticks;if(!s.display)return;let n=this.getIndexAngle(0),o,a;i.save(),i.translate(this.xCenter,this.yCenter),i.rotate(n),i.textAlign="center",i.textBaseline="middle",this.ticks.forEach((r,l)=>{if(l===0&&this.min>=0&&!t.reverse)return;let c=s.setContext(this.getContext(l)),h=j(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){i.font=h.string,a=i.measureText(r.label).width,i.fillStyle=c.backdropColor;let d=K(c.backdropPadding);i.fillRect(-a/2-d.left,-o-h.size/2-d.top,a+d.width,h.size+d.height)}Ct(i,r.label,0,-o,h,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),i.restore()}drawTitle(){}},Si={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}},Q=Object.keys(Si);function Oa(e,i){return e-i}function Aa(e,i){if(O(i))return null;let t=e._adapter,{parser:s,round:n,isoWeekday:o}=e._parseOpts,a=i;return typeof s=="function"&&(a=s(a)),N(a)||(a=typeof s=="string"?t.parse(a,s):t.parse(a)),a===null?null:(n&&(a=n==="week"&&(Bt(o)||o===!0)?t.startOf(a,"isoWeek",o):t.startOf(a,n)),+a)}function Ta(e,i,t,s){let n=Q.length;for(let o=Q.indexOf(e);o<n-1;++o){let a=Si[Q[o]],r=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((t-i)/(r*a.size))<=s)return Q[o]}return Q[n-1]}function Zd(e,i,t,s,n){for(let o=Q.length-1;o>=Q.indexOf(t);o--){let a=Q[o];if(Si[a].common&&e._adapter.diff(n,s,a)>=i-1)return a}return Q[t?Q.indexOf(t):0]}function Jd(e){for(let i=Q.indexOf(e)+1,t=Q.length;i<t;++i)if(Si[Q[i]].common)return Q[i]}function Ra(e,i,t){if(!t)e[i]=!0;else if(t.length){let{lo:s,hi:n}=Qe(t,i),o=t[s]>=i?t[s]:t[n];e[o]=!0}}function Qd(e,i,t,s){let n=e._adapter,o=+n.startOf(i[0].value,s),a=i[i.length-1].value,r,l;for(r=o;r<=a;r=+n.add(r,1,s))l=t[r],l>=0&&(i[l].major=!0);return i}function La(e,i,t){let s=[],n={},o=i.length,a,r;for(a=0;a<o;++a)r=i[a],n[r]=a,s.push({value:r,major:!1});return o===0||!t?s:Qd(e,s,n,t)}var Js=(()=>{class e extends Wt{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,s={}){let n=t.time||(t.time={}),o=this._adapter=new hc._date(t.adapters.date);o.init(s),Gt(n.displayFormats,o.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(t),this._normalized=s.normalized}parse(t,s){return t===void 0?null:Aa(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){let t=this.options,s=this._adapter,n=t.time.unit||"day",{min:o,max:a,minDefined:r,maxDefined:l}=this.getUserBounds();function c(h){!r&&!isNaN(h.min)&&(o=Math.min(o,h.min)),!l&&!isNaN(h.max)&&(a=Math.max(a,h.max))}(!r||!l)&&(c(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&c(this.getMinMax(!1))),o=N(o)&&!isNaN(o)?o:+s.startOf(Date.now(),n),a=N(a)&&!isNaN(a)?a:+s.endOf(Date.now(),n)+1,this.min=Math.min(o,a-1),this.max=Math.max(o+1,a)}_getLabelBounds(){let t=this.getLabelTimestamps(),s=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return t.length&&(s=t[0],n=t[t.length-1]),{min:s,max:n}}buildTicks(){let t=this.options,s=t.time,n=t.ticks,o=n.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&o.length&&(this.min=this._userMin||o[0],this.max=this._userMax||o[o.length-1]);let a=this.min,r=this.max,l=fo(o,a,r);return this._unit=s.unit||(n.autoSkip?Ta(s.minUnit,this.min,this.max,this._getLabelCapacity(a)):Zd(this,l.length,s.minUnit,this.min,this.max)),this._majorUnit=!n.major.enabled||this._unit==="year"?void 0:Jd(this._unit),this.initOffsets(o),t.reverse&&l.reverse(),La(this,l,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let s=0,n=0,o,a;this.options.offset&&t.length&&(o=this.getDecimalForValue(t[0]),t.length===1?s=1-o:s=(this.getDecimalForValue(t[1])-o)/2,a=this.getDecimalForValue(t[t.length-1]),t.length===1?n=a:n=(a-this.getDecimalForValue(t[t.length-2]))/2);let r=t.length<3?.5:.25;s=$(s,0,r),n=$(n,0,r),this._offsets={start:s,end:n,factor:1/(s+1+n)}}_generate(){let t=this._adapter,s=this.min,n=this.max,o=this.options,a=o.time,r=a.unit||Ta(a.minUnit,s,n,this._getLabelCapacity(s)),l=C(o.ticks.stepSize,1),c=r==="week"?a.isoWeekday:!1,h=Bt(c)||c===!0,d={},u=s,f,p;if(h&&(u=+t.startOf(u,"isoWeek",c)),u=+t.startOf(u,h?"day":r),t.diff(n,s,r)>1e5*l)throw new Error(s+" and "+n+" are too far apart with stepSize of "+l+" "+r);let g=o.ticks.source==="data"&&this.getDataTimestamps();for(f=u,p=0;f<n;f=+t.add(f,l,r),p++)Ra(d,f,g);return(f===n||o.bounds==="ticks"||p===1)&&Ra(d,f,g),Object.keys(d).sort(Oa).map(m=>+m)}getLabelForValue(t){let s=this._adapter,n=this.options.time;return n.tooltipFormat?s.format(t,n.tooltipFormat):s.format(t,n.displayFormats.datetime)}format(t,s){let o=this.options.time.displayFormats,a=this._unit,r=s||o[a];return this._adapter.format(t,r)}_tickFormatFunction(t,s,n,o){let a=this.options,r=a.ticks.callback;if(r)return I(r,[t,s,n],this);let l=a.time.displayFormats,c=this._unit,h=this._majorUnit,d=c&&l[c],u=h&&l[h],f=n[s],p=h&&u&&f&&f.major;return this._adapter.format(t,o||(p?u:d))}generateTickLabels(t){let s,n,o;for(s=0,n=t.length;s<n;++s)o=t[s],o.label=this._tickFormatFunction(o.value,s,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){let s=this._offsets,n=this.getDecimalForValue(t);return this.getPixelForDecimal((s.start+n)*s.factor)}getValueForPixel(t){let s=this._offsets,n=this.getDecimalForPixel(t)/s.factor-s.end;return this.min+n*(this.max-this.min)}_getLabelSize(t){let s=this.options.ticks,n=this.ctx.measureText(t).width,o=it(this.isHorizontal()?s.maxRotation:s.minRotation),a=Math.cos(o),r=Math.sin(o),l=this._resolveTickFontOptions(0).size;return{w:n*a+l*r,h:n*r+l*a}}_getLabelCapacity(t){let s=this.options.time,n=s.displayFormats,o=n[s.unit]||n.millisecond,a=this._tickFormatFunction(t,0,La(this,[t],this._majorUnit),o),r=this._getLabelSize(a),l=Math.floor(this.isHorizontal()?this.width/r.w:this.height/r.h)-1;return l>0?l:1}getDataTimestamps(){let t=this._cache.data||[],s,n;if(t.length)return t;let o=this.getMatchingVisibleMetas();if(this._normalized&&o.length)return this._cache.data=o[0].controller.getAllParsedValues(this);for(s=0,n=o.length;s<n;++s)t=t.concat(o[s].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){let t=this._cache.labels||[],s,n;if(t.length)return t;let o=this.getLabels();for(s=0,n=o.length;s<n;++s)t.push(Aa(this,o[s]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return es(t.sort(Oa))}}return e})();function fi(e,i,t){let s=0,n=e.length-1,o,a,r,l;t?(i>=e[s].pos&&i<=e[n].pos&&({lo:s,hi:n}=at(e,"pos",i)),{pos:o,time:r}=e[s],{pos:a,time:l}=e[n]):(i>=e[s].time&&i<=e[n].time&&({lo:s,hi:n}=at(e,"time",i)),{time:o,pos:r}=e[s],{time:a,pos:l}=e[n]);let c=a-o;return c?r+(l-r)*(i-o)/c:r}var Qs=class extends Js{static id="timeseries";static defaults=Js.defaults;constructor(i){super(i),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){let i=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(i);this._minPos=fi(t,this.min),this._tableRange=fi(t,this.max)-this._minPos,super.initOffsets(i)}buildLookupTable(i){let{min:t,max:s}=this,n=[],o=[],a,r,l,c,h;for(a=0,r=i.length;a<r;++a)c=i[a],c>=t&&c<=s&&n.push(c);if(n.length<2)return[{time:t,pos:0},{time:s,pos:1}];for(a=0,r=n.length;a<r;++a)h=n[a+1],l=n[a-1],c=n[a],Math.round((h+l)/2)!==c&&o.push({time:c,pos:a/(r-1)});return o}_generate(){let i=this.min,t=this.max,s=super.getDataTimestamps();return(!s.includes(i)||!s.length)&&s.splice(0,0,i),(!s.includes(t)||s.length===1)&&s.push(t),s.sort((n,o)=>n-o)}_getTimestampsForTable(){let i=this._cache.all||[];if(i.length)return i;let t=this.getDataTimestamps(),s=this.getLabelTimestamps();return t.length&&s.length?i=this.normalize(t.concat(s)):i=t.length?t:s,i=this._cache.all=i,i}getDecimalForValue(i){return(fi(this._table,i)-this._minPos)/this._tableRange}getValueForPixel(i){let t=this._offsets,s=this.getDecimalForPixel(i)/t.factor-t.end;return fi(this._table,s*this._tableRange+this._minPos,!0)}},tu=Object.freeze({__proto__:null,CategoryScale:Ed,LinearScale:Ks,LogarithmicScale:qs,RadialLinearScale:Zs,TimeScale:Js,TimeSeriesScale:Qs}),er=[cc,Ih,Ad,tu];var ir=new dn("Configuration for ngCharts");function Fu(...e){return{registerables:[...er,...e]}}function zu(...e){let i=Vi({},...e);return{provide:ir,useValue:i}}var eu=(()=>{class e{constructor(){this.colorschemesOptions=new Ee(void 0)}setColorschemesOptions(t){this.pColorschemesOptions=t,this.colorschemesOptions.next(t)}getColorschemesOptions(){return this.pColorschemesOptions}static{this.\u0275fac=function(s){return new(s||e)}}static{this.\u0275prov=Ie({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),Bu=(()=>{class e{constructor(t,s,n,o){this.zone=s,this.themeService=n,this.type="bar",this.plugins=[],this.chartClick=new Lt,this.chartHover=new Lt,this.subs=[],this.themeOverrides={},o?.registerables&&wi.register(...o.registerables),o?.defaults&&F.set(o.defaults),this.ctx=t.nativeElement.getContext("2d"),this.subs.push(this.themeService.colorschemesOptions.pipe(an()).subscribe(a=>this.themeChanged(a)))}ngOnChanges(t){let s=["type"],n=Object.getOwnPropertyNames(t);if(n.some(o=>s.includes(o))||n.every(o=>t[o].isFirstChange()))this.render();else{let o=this.getChartConfiguration();this.chart&&(Object.assign(this.chart.config.data,o.data),this.chart.config.plugins&&Object.assign(this.chart.config.plugins,o.plugins),this.chart.config.options&&Object.assign(this.chart.config.options,o.options)),this.update()}}ngOnDestroy(){this.chart&&(this.chart.destroy(),this.chart=void 0),this.subs.forEach(t=>t.unsubscribe())}render(){return this.chart&&this.chart.destroy(),this.zone.runOutsideAngular(()=>this.chart=new wi(this.ctx,this.getChartConfiguration()))}update(t){this.chart&&this.zone.runOutsideAngular(()=>this.chart?.update(t))}hideDataset(t,s){this.chart&&(this.chart.getDatasetMeta(t).hidden=s,this.update())}isDatasetHidden(t){return this.chart?.getDatasetMeta(t)?.hidden}toBase64Image(){return this.chart?.toBase64Image()}themeChanged(t){this.themeOverrides=t,this.chart&&(this.chart.config.options&&Object.assign(this.chart.config.options,this.getChartOptions()),this.update())}getChartOptions(){return Vi({onHover:(t,s)=>{!this.chartHover.observed&&!this.chartHover.observers?.length||this.zone.run(()=>this.chartHover.emit({event:t,active:s}))},onClick:(t,s)=>{!this.chartClick.observed&&!this.chartClick.observers?.length||this.zone.run(()=>this.chartClick.emit({event:t,active:s}))}},this.themeOverrides,this.options,{plugins:{legend:{display:this.legend}}})}getChartConfiguration(){return{type:this.type,data:this.getChartData(),options:this.getChartOptions(),plugins:this.plugins}}getChartData(){return this.data?this.data:{labels:this.labels||[],datasets:this.datasets||[]}}static{this.\u0275fac=function(s){return new(s||e)(he(ze),he(Fe),he(eu),he(ir,8))}}static{this.\u0275dir=Be({type:e,selectors:[["canvas","baseChart",""]],inputs:{type:"type",legend:"legend",data:"data",options:"options",plugins:"plugins",labels:"labels",datasets:"datasets"},outputs:{chartClick:"chartClick",chartHover:"chartHover"},exportAs:["base-chart"],features:[le]})}}return e})();export{mu as a,bu as b,Fu as c,zu as d,Bu as e};
|