(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["third_vendors_002cha~app"],{"9b4a":function(t,e,i){"use strict";i.r(e),i.d(e,"Animation",(function(){return l})),i.d(e,"Animations",(function(){return u})),i.d(e,"ArcElement",(function(){return Si})),i.d(e,"BarController",(function(){return Q})),i.d(e,"BarElement",(function(){return Ji})),i.d(e,"BasePlatform",(function(){return Vt})),i.d(e,"BasicPlatform",(function(){return Bt})),i.d(e,"BubbleController",(function(){return G})),i.d(e,"CategoryScale",(function(){return ds})),i.d(e,"Chart",(function(){return pi})),i.d(e,"DatasetController",(function(){return E})),i.d(e,"Decimation",(function(){return rn})),i.d(e,"DomPlatform",(function(){return re})),i.d(e,"DoughnutController",(function(){return Z})),i.d(e,"Element",(function(){return le})),i.d(e,"Filler",(function(){return Tn})),i.d(e,"Interaction",(function(){return vt})),i.d(e,"Legend",(function(){return zn})),i.d(e,"LineController",(function(){return tt})),i.d(e,"LineElement",(function(){return Bi})),i.d(e,"LinearScale",(function(){return bs})),i.d(e,"LogarithmicScale",(function(){return xs})),i.d(e,"PieController",(function(){return st})),i.d(e,"PointElement",(function(){return Wi})),i.d(e,"PolarAreaController",(function(){return nt})),i.d(e,"RadarController",(function(){return ot})),i.d(e,"RadialLinearScale",(function(){return Ts})),i.d(e,"Scale",(function(){return Ae})),i.d(e,"ScatterController",(function(){return rt})),i.d(e,"SubTitle",(function(){return Wn})),i.d(e,"Ticks",(function(){return de})),i.d(e,"TimeScale",(function(){return Ns})),i.d(e,"TimeSeriesScale",(function(){return Us})),i.d(e,"Title",(function(){return Bn})),i.d(e,"Tooltip",(function(){return rs})),i.d(e,"_adapters",(function(){return ht})),i.d(e,"_detectPlatform",(function(){return ae})),i.d(e,"animator",(function(){return o})),i.d(e,"controllers",(function(){return at})),i.d(e,"elements",(function(){return Zi})),i.d(e,"layouts",(function(){return It})),i.d(e,"plugins",(function(){return as})),i.d(e,"registerables",(function(){return Xs})),i.d(e,"registry",(function(){return Fe})),i.d(e,"scales",(function(){return Ys}));var n=i("dd3d");i.d(e,"defaults",(function(){return n["Ab"]})); /*! * Chart.js v3.7.1 * https://www.chartjs.org * (c) 2022 Chart.js Contributors * Released under the MIT License */ class s{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,n){const s=e.listeners[n],o=e.duration;s.forEach(n=>n({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(i-e.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=n["Ob"].call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,n)=>{if(!i.running||!i.items.length)return;const s=i.items;let o,r=s.length-1,a=!1;for(;r>=0;--r)o=s[r],o._active?(o._total>i.duration&&(i.duration=o._total),o.tick(t),a=!0):(s[r]=s[s.length-1],s.pop());a&&(n.draw(),this._notify(n,i,t,"progress")),s.length||(i.running=!1,this._notify(n,i,t,"complete"),i.initial=!1),e+=s.length}),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((t,e)=>Math.max(t,e._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let n=i.length-1;for(;n>=0;--n)i[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var o=new s;const r="transparent",a={boolean(t,e,i){return i>.5?e:t},color(t,e,i){const s=Object(n["zb"])(t||r),o=s.valid&&Object(n["zb"])(e||r);return o&&o.valid?o.mix(s,i).hexString():e},number(t,e,i){return t+(e-t)*i}};class l{constructor(t,e,i,s){const o=e[i];s=Object(n["C"])([t.to,s,o,t.from]);const r=Object(n["C"])([t.from,o,s]);this._active=!0,this._fn=t.fn||a[t.type||typeof r],this._easing=n["Bb"][t.easing]||n["Bb"].linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=r,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const s=this._target[this._prop],o=i-this._start,r=this._duration-o;this._start=i,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Object(n["C"])([t.to,e,s,t.from]),this._from=Object(n["C"])([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,n=this._prop,s=this._from,o=this._loop,r=this._to;let a;if(this._active=s!==r&&(o||e1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[n]=this._fn(s,r,a))}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let n=0;n"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),n["Ab"].set("animations",{colors:{type:"color",properties:h},numbers:{type:"number",properties:c}}),n["Ab"].describe("animations",{_fallback:"animation"}),n["Ab"].set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}});class u{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!Object(n["Fb"])(t))return;const e=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const s=t[i];if(!Object(n["Fb"])(s))return;const o={};for(const t of d)o[t]=s[t];(Object(n["yb"])(s.properties)&&s.properties||[i]).forEach(t=>{t!==i&&e.has(t)||e.set(t,o)})})}_animateOptions(t,e){const i=e.options,n=g(t,i);if(!n)return[];const s=this._createAnimations(n,i);return i.$shared&&f(t.options.$animations,i).then(()=>{t.options=i},()=>{}),s}_createAnimations(t,e){const i=this._properties,n=[],s=t.$animations||(t.$animations={}),o=Object.keys(e),r=Date.now();let a;for(a=o.length-1;a>=0;--a){const c=o[a];if("$"===c.charAt(0))continue;if("options"===c){n.push(...this._animateOptions(t,e));continue}const h=e[c];let d=s[c];const u=i.get(c);if(d){if(u&&d.active()){d.update(u,h,r);continue}d.cancel()}u&&u.duration?(s[c]=d=new l(u,t,c,h),n.push(d)):t[c]=h}return n}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?(o.add(this._chart,i),!0):void 0}}function f(t,e){const i=[],n=Object.keys(e);for(let s=0;s0||!i&&e<0)return s.index}return null}function k(t,e){const{chart:i,_cachedMeta:n}=t,s=i._stacks||(i._stacks={}),{iScale:o,vScale:r,index:a}=n,l=o.axis,c=r.axis,h=O(o,r,n),d=e.length;let u;for(let f=0;fi[t].axis===e).shift()}function D(t,e){return Object(n["Eb"])(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function P(t,e,i){return Object(n["Eb"])(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:i,index:e,mode:"default",type:"data"})}function A(t,e){const i=t.controller.index,n=t.vScale&&t.vScale.axis;if(n){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[n]||void 0===e[n][i])return;delete e[n][i]}}}const C=t=>"reset"===t||"none"===t,T=(t,e)=>e?t:Object.assign({},t),L=(t,e,i)=>t&&!e.hidden&&e._stacked&&{keys:x(i,!0),values:null};class E{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.$context=void 0,this._syncList=[],this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=v(t.vScale,t),this.addElements()}updateIndex(t){this.index!==t&&A(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(t,e,i,n)=>"x"===t?e:"r"===t?n:i,o=e.xAxisID=Object(n["Sb"])(i.xAxisID,S(t,"x")),r=e.yAxisID=Object(n["Sb"])(i.yAxisID,S(t,"y")),a=e.rAxisID=Object(n["Sb"])(i.rAxisID,S(t,"r")),l=e.indexAxis,c=e.iAxisID=s(l,o,r,a),h=e.vAxisID=s(l,r,o,a);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(r),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Object(n["Rb"])(this._data,this),t._stacked&&A(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(Object(n["Fb"])(e))this._data=y(e);else if(i!==e){if(i){Object(n["Rb"])(i,this);const t=this._cachedMeta;A(t),t._parsed=[]}e&&Object.isExtensible(e)&&Object(n["Ib"])(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let n=!1;this._dataCheck();const s=e._stacked;e._stacked=v(e.vScale,e),e.stack!==i.stack&&(n=!0,A(e),e.stack=i.stack),this._resyncElements(t),(n||s!==e._stacked)&&k(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:s}=this,{iScale:o,_stacked:r}=i,a=o.axis;let l,c,h,d=0===t&&e===s.length||i._sorted,u=t>0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=s,i._sorted=!0,h=s;else{h=Object(n["yb"])(s[t])?this.parseArrayData(i,s,t,e):Object(n["Fb"])(s[t])?this.parseObjectData(i,s,t,e):this.parsePrimitiveData(i,s,t,e);const o=()=>null===c[a]||u&&c[a]e||d=0;--u)if(!g()){this.updateRangeFromParsed(c,t,f,l);break}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let s,o,r;for(s=0,o=e.length;s=0&&tthis.getContext(i,s),b=c.resolveNamedOptions(u,f,g,d);return b.$shared&&(b.$shared=l,o[r]=Object.freeze(T(b,l))),b}_resolveAnimations(t,e,i){const n=this.chart,s=this._cachedDataOpts,o="animation-"+e,r=s[o];if(r)return r;let a;if(!1!==n.options.animation){const n=this.chart.config,s=n.datasetAnimationScopeKeys(this._type,e),o=n.getOptionScopes(this.getDataset(),s);a=n.createResolver(o,this.getContext(t,i,e))}const l=new u(n,a&&a.animations);return a&&a._cacheable&&(s[o]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||C(t)||this.chart._animationsDisabled}updateElement(t,e,i,n){C(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}updateSharedOptions(t,e,i){t&&!C(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,n){t.active=n;const s=this.getStyle(e,n);this._resolveAnimations(e,i,n).update(t,{options:!n&&this.getSharedOptions(s)||s})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[r,a,l]of this._syncList)this[r](a,l);this._syncList=[];const n=i.length,s=e.length,o=Math.min(s,n);o&&this.parse(0,o),s>n?this._insertElements(n,s-n,t):s{for(t.length+=e,r=t.length-1;r>=o;r--)t[r]=t[r-e]};for(a(s),r=t;rt-e))}return t._cache.$bar}function F(t){const e=t.iScale,i=R(e,t.type);let s,o,r,a,l=e._length;const c=()=>{32767!==r&&-32768!==r&&(Object(n["Gb"])(a)&&(l=Math.min(l,Math.abs(r-a)||l)),a=r)};for(s=0,o=i.length;s0?s[t-1]:null,a=tMath.abs(a)&&(l=a,c=r),e[i.axis]=c,e._custom={barStart:l,barEnd:c,start:s,end:o,min:r,max:a}}function B(t,e,i,s){return Object(n["yb"])(t)?V(t,e,i,s):e[i.axis]=i.parse(t,s),e}function H(t,e,i,n){const s=t.iScale,o=t.vScale,r=s.getLabels(),a=s===o,l=[];let c,h,d,u;for(c=i,h=i+n;c=i?1:-1)}function $(t){let e,i,n,s,o;return t.horizontal?(e=t.base>t.x,i="left",n="right"):(e=t.base=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,{xScale:i,yScale:n}=e,s=this.getParsed(t),o=i.getLabelForValue(s.x),r=n.getLabelForValue(s.y),a=s._custom;return{label:e.label,value:"("+o+", "+r+(a?", "+a:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,n){const s="reset"===n,{iScale:o,vScale:r}=this._cachedMeta,a=this.resolveDataElementOptions(e,n),l=this.getSharedOptions(a),c=this.includeOptions(n,l),h=o.axis,d=r.axis;for(let u=e;uObject(n["Mb"])(t,l,c,!0)?1:Math.max(e,e*i,s,s*i),b=(t,e,s)=>Object(n["Mb"])(t,l,c,!0)?-1:Math.min(e,e*i,s,s*i),p=g(0,h,u),m=g(n["i"],d,f),x=b(n["q"],h,u),_=b(n["q"]+n["i"],d,f);s=(p-x)/2,o=(m-_)/2,r=-(p+x)/2,a=-(m+_)/2}return{ratioX:s,ratioY:o,offsetX:r,offsetY:a}}G.id="bubble",G.defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}},G.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title(){return""}}}}};class Z extends E{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,s=this._cachedMeta;if(!1===this._parsing)s._parsed=i;else{let o,r,a=t=>+i[t];if(Object(n["Fb"])(i[t])){const{key:t="value"}=this._parsing;a=e=>+Object(n["Cb"])(i[e],t)}for(o=t,r=t+e;o0&&!isNaN(t)?n["u"]*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=Object(n["Lb"])(e._parsed[t],i.options.locale);return{label:s[t]||"",value:o}}getMaxBorderWidth(t){let e=0;const i=this.chart;let n,s,o,r,a;if(!t)for(n=0,s=i.data.datasets.length;n"spacing"!==t,_indexable:t=>"spacing"!==t},Z.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i}}=t.legend.options;return e.labels.map((e,n)=>{const s=t.getDatasetMeta(0),o=s.controller.getStyle(n);return{text:e,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title(){return""},label(t){let e=t.label;const i=": "+t.formattedValue;return Object(n["yb"])(e)?(e=e.slice(),e[0]+=i):e+=i,e}}}}};class tt extends E{initialize(){this.enableOptionSharing=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:n=[],_dataset:s}=e,o=this.chart._animationsDisabled;let{start:r,count:a}=et(e,n,o);this._drawStart=r,this._drawCount=a,it(e)&&(r=0,a=n.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!s._decimated,i.points=n;const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:l},t),this.updateElements(n,r,a,t)}updateElements(t,e,i,s){const o="reset"===s,{iScale:r,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,h=this.resolveDataElementOptions(e,s),d=this.getSharedOptions(h),u=this.includeOptions(s,d),f=r.axis,g=a.axis,{spanGaps:b,segment:p}=this.options,m=Object(n["Nb"])(b)?b:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||o||"none"===s;let _=e>0&&this.getParsed(e-1);for(let y=e;y0&&i[f]-_[f]>m,p&&(h.parsed=i,h.raw=c.data[y]),u&&(h.options=d||this.resolveDataElementOptions(y,e.active?"active":s)),x||this.updateElement(e,y,h,s),_=i}this.updateSharedOptions(d,s,h)}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return i;const s=n[0].size(this.resolveDataElementOptions(0)),o=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,s,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}function et(t,e,i){const s=e.length;let o=0,r=s;if(t._sorted){const{iScale:a,_parsed:l}=t,c=a.axis,{min:h,max:d,minDefined:u,maxDefined:f}=a.getUserBounds();u&&(o=Object(n["Tb"])(Math.min(Object(n["Ub"])(l,a.axis,h).lo,i?s:Object(n["Ub"])(e,c,a.getPixelForValue(h)).lo),0,s-1)),r=f?Object(n["Tb"])(Math.max(Object(n["Ub"])(l,a.axis,d).hi+1,i?0:Object(n["Ub"])(e,c,a.getPixelForValue(d)).hi+1),o,s)-o:s-o}return{start:o,count:r}}function it(t){const{xScale:e,yScale:i,_scaleRanges:n}=t,s={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!n)return t._scaleRanges=s,!0;const o=n.xmin!==e.min||n.xmax!==e.max||n.ymin!==i.min||n.ymax!==i.max;return Object.assign(n,s),o}tt.id="line",tt.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},tt.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class nt extends E{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=Object(n["Lb"])(e._parsed[t].r,i.options.locale);return{label:s[t]||"",value:o}}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,n=Math.min(e.right-e.left,e.bottom-e.top),s=Math.max(n/2,0),o=Math.max(i.cutoutPercentage?s/100*i.cutoutPercentage:1,0),r=(s-o)/t.getVisibleDatasetCount();this.outerRadius=s-r*this.index,this.innerRadius=this.outerRadius-r}updateElements(t,e,i,s){const o="reset"===s,r=this.chart,a=this.getDataset(),l=r.options,c=l.animation,h=this._cachedMeta.rScale,d=h.xCenter,u=h.yCenter,f=h.getIndexAngle(0)-.5*n["q"];let g,b=f;const p=360/this.countVisibleElements();for(g=0;g{!isNaN(t.data[n])&&this.chart.getDataVisibility(n)&&i++}),i}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?Object(n["Qb"])(this.resolveDataElementOptions(t,e).angle||i):0}}nt.id="polarArea",nt.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},nt.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i}}=t.legend.options;return e.labels.map((e,n)=>{const s=t.getDatasetMeta(0),o=s.controller.getStyle(n);return{text:e,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title(){return""},label(t){return t.chart.data.labels[t.dataIndex]+": "+t.formattedValue}}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class st extends Z{}st.id="pie",st.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class ot extends E{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}update(t){const e=this._cachedMeta,i=e.dataset,n=e.data||[],s=e.iScale.getLabels();if(i.points=n,"resize"!==t){const e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);const o={_loop:!0,_fullLoop:s.length===n.length,options:e};this.updateElement(i,void 0,o,t)}this.updateElements(n,0,n.length,t)}updateElements(t,e,i,n){const s=this.getDataset(),o=this._cachedMeta.rScale,r="reset"===n;for(let a=e;a{t[a](s[r],n)&&o.push({element:t,datasetIndex:e,index:i}),t.inRange(s.x,s.y,n)&&(l=!0)}),i.intersect&&!l?[]:o}var vt={modes:{index(t,e,i,n){const s=dt(e,t),o=i.axis||"x",r=i.intersect?pt(t,s,o,n):_t(t,s,o,!1,n),a=[];return r.length?(t.getSortedVisibleDatasetMetas().forEach(t=>{const e=r[0].index,i=t.data[e];i&&!i.skip&&a.push({element:i,datasetIndex:t.index,index:e})}),a):[]},dataset(t,e,i,n){const s=dt(e,t),o=i.axis||"xy";let r=i.intersect?pt(t,s,o,n):_t(t,s,o,!1,n);if(r.length>0){const e=r[0].datasetIndex,i=t.getDatasetMeta(e).data;r=[];for(let t=0;tt.pos===e)}function jt(t,e){return t.filter(t=>-1===Ot.indexOf(t.pos)&&t.box.axis===e)}function Mt(t,e){return t.sort((t,i)=>{const n=e?i:t,s=e?t:i;return n.weight===s.weight?n.index-s.index:n.weight-s.weight})}function kt(t){const e=[];let i,n,s,o,r,a;for(i=0,n=(t||[]).length;it.box.fullSize),!0),n=Mt(wt(e,"left"),!0),s=Mt(wt(e,"right")),o=Mt(wt(e,"top"),!0),r=Mt(wt(e,"bottom")),a=jt(e,"x"),l=jt(e,"y");return{fullSize:i,leftAndTop:n.concat(o),rightAndBottom:s.concat(l).concat(r).concat(a),chartArea:wt(e,"chartArea"),vertical:n.concat(s).concat(l),horizontal:o.concat(r).concat(a)}}function At(t,e,i,n){return Math.max(t[i],e[i])+Math.max(t[n],e[n])}function Ct(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function Tt(t,e,i,s){const{pos:o,box:r}=i,a=t.maxPadding;if(!Object(n["Fb"])(o)){i.size&&(t[o]-=i.size);const e=s[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?r.height:r.width),i.size=e.size/e.count,t[o]+=i.size}r.getPadding&&Ct(a,r.getPadding());const l=Math.max(0,e.outerWidth-At(a,t,"left","right")),c=Math.max(0,e.outerHeight-At(a,t,"top","bottom")),h=l!==t.w,d=c!==t.h;return t.w=l,t.h=c,i.horizontal?{same:h,other:d}:{same:d,other:h}}function Lt(t){const e=t.maxPadding;function i(i){const n=Math.max(e[i]-t[i],0);return t[i]+=n,n}t.y+=i("top"),t.x+=i("left"),i("right"),i("bottom")}function Et(t,e){const i=e.maxPadding;function n(t){const n={left:0,top:0,right:0,bottom:0};return t.forEach(t=>{n[t]=Math.max(e[t],i[t])}),n}return n(t?["left","right"]:["top","bottom"])}function Rt(t,e,i,n){const s=[];let o,r,a,l,c,h;for(o=0,r=t.length,c=0;o{"function"===typeof t.beforeLayout&&t.beforeLayout()});const d=c.reduce((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1,0)||1,u=Object.freeze({outerWidth:e,outerHeight:i,padding:o,availableWidth:r,availableHeight:a,vBoxMaxWidth:r/2/d,hBoxMaxHeight:a/2}),f=Object.assign({},o);Ct(f,Object(n["d"])(s));const g=Object.assign({maxPadding:f,w:r,h:a,x:o.left,y:o.top},o),b=Dt(c.concat(h),u);Rt(l.fullSize,g,u,b),Rt(c,g,u,b),Rt(h,g,u,b)&&Rt(c,g,u,b),Lt(g),zt(l.leftAndTop,g,u,b),g.x+=g.w,g.y+=g.h,zt(l.rightAndBottom,g,u,b),t.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},Object(n["e"])(l.chartArea,e=>{const i=e.box;Object.assign(i,t.chartArea),i.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})})}};class Vt{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,n){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):i)}}isAttached(t){return!0}updateConfig(t){}}class Bt extends Vt{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Ht="$chartjs",Wt={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Nt=t=>null===t||""===t;function $t(t,e){const i=t.style,s=t.getAttribute("height"),o=t.getAttribute("width");if(t[Ht]={initial:{height:s,width:o,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",Nt(o)){const e=Object(n["h"])(t,"width");void 0!==e&&(t.width=e)}if(Nt(s))if(""===t.style.height)t.height=t.width/(e||2);else{const e=Object(n["h"])(t,"height");void 0!==e&&(t.height=e)}return t}const Ut=!!n["k"]&&{passive:!0};function Yt(t,e,i){t.addEventListener(e,i,Ut)}function Xt(t,e,i){t.canvas.removeEventListener(e,i,Ut)}function qt(t,e){const i=Wt[t.type]||t.type,{x:s,y:o}=Object(n["Vb"])(t,e);return{type:i,chart:e,native:t,x:void 0!==s?s:null,y:void 0!==o?o:null}}function Kt(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function Qt(t,e,i){const n=t.canvas,s=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||Kt(i.addedNodes,n),e=e&&!Kt(i.removedNodes,n);e&&i()});return s.observe(document,{childList:!0,subtree:!0}),s}function Gt(t,e,i){const n=t.canvas,s=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||Kt(i.removedNodes,n),e=e&&!Kt(i.addedNodes,n);e&&i()});return s.observe(document,{childList:!0,subtree:!0}),s}const Jt=new Map;let Zt=0;function te(){const t=window.devicePixelRatio;t!==Zt&&(Zt=t,Jt.forEach((e,i)=>{i.currentDevicePixelRatio!==t&&e()}))}function ee(t,e){Jt.size||window.addEventListener("resize",te),Jt.set(t,e)}function ie(t){Jt.delete(t),Jt.size||window.removeEventListener("resize",te)}function ne(t,e,i){const s=t.canvas,o=s&&Object(n["g"])(s);if(!o)return;const r=Object(n["j"])((t,e)=>{const n=o.clientWidth;i(t,e),n{const e=t[0],i=e.contentRect.width,n=e.contentRect.height;0===i&&0===n||r(i,n)});return a.observe(o),ee(t,r),a}function se(t,e,i){i&&i.disconnect(),"resize"===e&&ie(t)}function oe(t,e,i){const s=t.canvas,o=Object(n["j"])(e=>{null!==t.ctx&&i(qt(e,t))},t,t=>{const e=t[0];return[e,e.offsetX,e.offsetY]});return Yt(s,e,o),o}class re extends Vt{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?($t(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[Ht])return!1;const i=e[Ht].initial;["height","width"].forEach(t=>{const s=i[t];Object(n["Hb"])(s)?e.removeAttribute(t):e.setAttribute(t,s)});const s=i.style||{};return Object.keys(s).forEach(t=>{e.style[t]=s[t]}),e.width=e.width,delete e[Ht],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),s={attach:Qt,detach:Gt,resize:ne},o=s[e]||oe;n[e]=o(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),n=i[e];if(!n)return;const s={attach:se,detach:se,resize:se},o=s[e]||Xt;o(t,e,n),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return Object(n["f"])(t,e,i,s)}isAttached(t){const e=Object(n["g"])(t);return!(!e||!e.isConnected)}}function ae(t){return!Object(n["l"])()||"undefined"!==typeof OffscreenCanvas&&t instanceof OffscreenCanvas?Bt:re}class le{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return Object(n["Nb"])(this.x)&&Object(n["Nb"])(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const n={};return t.forEach(t=>{n[t]=i[t]&&i[t].active()?i[t]._to:this[t]}),n}}le.defaults={},le.defaultRoutes=void 0;const ce={values(t){return Object(n["yb"])(t)?t:""+t},numeric(t,e,i){if(0===t)return"0";const s=this.chart.options.locale;let o,r=t;if(i.length>1){const e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(o="scientific"),r=he(t,i)}const a=Object(n["m"])(Math.abs(r)),l=Math.max(Math.min(-1*Math.floor(a),20),0),c={notation:o,minimumFractionDigits:l,maximumFractionDigits:l};return Object.assign(c,this.options.ticks.format),Object(n["Lb"])(t,s,c)},logarithmic(t,e,i){if(0===t)return"0";const s=t/Math.pow(10,Math.floor(Object(n["m"])(t)));return 1===s||2===s||5===s?ce.numeric.call(this,t,e,i):""}};function he(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t)),i}var de={formatters:ce};function ue(t,e){const i=t.options.ticks,s=i.maxTicksLimit||fe(t),o=i.major.enabled?be(e):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>s)return pe(e,c,o,r/s),c;const h=ge(o,e,s);if(r>0){let t,i;const s=r>1?Math.round((l-a)/(r-1)):null;for(me(e,c,h,Object(n["Hb"])(s)?0:a-s,a),t=0,i=r-1;to)return t}return Math.max(o,1)}function be(t){const e=[];let i,n;for(i=0,n=t.length;ie.lineWidth,tickColor:(t,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:de.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n["Ab"].route("scale.ticks","color","","color"),n["Ab"].route("scale.grid","color","","borderColor"),n["Ab"].route("scale.grid","borderColor","","borderColor"),n["Ab"].route("scale.title","color","","color"),n["Ab"].describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t}),n["Ab"].describe("scales",{_fallback:"scale"}),n["Ab"].describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t});const _e=t=>"left"===t?"right":"right"===t?"left":t,ye=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i;function ve(t,e){const i=[],n=t.length/e,s=t.length;let o=0;for(;or+a)))return c}function we(t,e){Object(n["e"])(t,t=>{const i=t.gc,n=i.length/2;let s;if(n>e){for(s=0;ss?s:i,s=o&&i>s?i:s,{min:Object(n["o"])(i,Object(n["o"])(s,i)),max:Object(n["o"])(s,Object(n["o"])(i,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Object(n["p"])(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:s,grace:o,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Object(n["r"])(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a=o||i<=1||!this.isHorizontal())return void(this.labelRotation=s);const h=this._getLabelSizes(),d=h.widest.width,u=h.highest.height,f=Object(n["Tb"])(this.chart.width-d,0,this.maxWidth);r=t.offset?this.maxWidth/i:f/(i-1),d+6>r&&(r=f/(i-(t.offset?.5:1)),a=this.maxHeight-je(t.grid)-e.padding-Me(t.title,this.chart.options.font),l=Math.sqrt(d*d+u*u),c=Object(n["s"])(Math.min(Math.asin(Object(n["Tb"])((h.highest.height+6)/r,-1,1)),Math.asin(Object(n["Tb"])(a/l,-1,1))-Math.asin(Object(n["Tb"])(u/l,-1,1)))),c=Math.max(s,Math.min(o,c))),this.labelRotation=c}afterCalculateLabelRotation(){Object(n["p"])(this.options.afterCalculateLabelRotation,[this])}beforeFit(){Object(n["p"])(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){const r=Me(s,e.options.font);if(a?(t.width=this.maxWidth,t.height=je(o)+r):(t.height=this.maxHeight,t.width=je(o)+r),i.display&&this.ticks.length){const{first:e,last:s,widest:o,highest:r}=this._getLabelSizes(),l=2*i.padding,c=Object(n["Qb"])(this.labelRotation),h=Math.cos(c),d=Math.sin(c);if(a){const e=i.mirror?0:d*o.width+h*r.height;t.height=Math.min(this.maxHeight,t.height+e+l)}else{const e=i.mirror?0:h*o.width+d*r.height;t.width=Math.min(this.maxWidth,t.width+e+l)}this._calculatePadding(e,s,d,h)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,n){const{ticks:{align:s,padding:o},position:r}=this.options,a=0!==this.labelRotation,l="top"!==r&&"x"===this.axis;if(this.isHorizontal()){const r=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,d=0;a?l?(h=n*t.width,d=i*e.height):(h=i*t.height,d=n*e.width):"start"===s?d=e.width:"end"===s?h=t.width:(h=t.width/2,d=e.width/2),this.paddingLeft=Math.max((h-r+o)*this.width/(this.width-r),0),this.paddingRight=Math.max((d-c+o)*this.width/(this.width-c),0)}else{let i=e.height/2,n=t.height/2;"start"===s?(i=0,n=t.height):"end"===s&&(i=e.height,n=0),this.paddingTop=i+o,this.paddingBottom=n+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Object(n["p"])(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e({width:o[t]||0,height:r[t]||0});return{first:O(0),last:O(e-1),widest:O(y),highest:O(v),widths:o,heights:r}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return Object(n["v"])(this._alignToPixels?Object(n["w"])(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&ta*s?a/i:l/s:l*s0}_computeGridLineItems(t){const e=this.axis,i=this.chart,s=this.options,{grid:o,position:r}=s,a=o.offset,l=this.isHorizontal(),c=this.ticks,h=c.length+(a?1:0),d=je(o),u=[],f=o.setContext(this.getContext()),g=f.drawBorder?f.borderWidth:0,b=g/2,p=function(t){return Object(n["w"])(i,t,g)};let m,x,_,y,v,O,w,j,M,k,S,D;if("top"===r)m=p(this.bottom),O=this.bottom-d,j=m-b,k=p(t.top)+b,D=t.bottom;else if("bottom"===r)m=p(this.top),k=t.top,D=p(t.bottom)-b,O=m+b,j=this.top+d;else if("left"===r)m=p(this.right),v=this.right-d,w=m-b,M=p(t.left)+b,S=t.right;else if("right"===r)m=p(this.left),M=t.left,S=p(t.right)-b,v=m+b,w=this.left+d;else if("x"===e){if("center"===r)m=p((t.top+t.bottom)/2+.5);else if(Object(n["Fb"])(r)){const t=Object.keys(r)[0],e=r[t];m=p(this.chart.scales[t].getPixelForValue(e))}k=t.top,D=t.bottom,O=m+b,j=O+d}else if("y"===e){if("center"===r)m=p((t.left+t.right)/2);else if(Object(n["Fb"])(r)){const t=Object.keys(r)[0],e=r[t];m=p(this.chart.scales[t].getPixelForValue(e))}v=m-b,w=v-d,M=t.left,S=t.right}const P=Object(n["Sb"])(s.ticks.maxTicksLimit,h),A=Math.max(1,Math.ceil(h/P));for(x=0;xe.value===t);if(n>=0){const t=e.setContext(this.getContext(n));return t.lineWidth}return 0}drawGrid(t){const e=this.options.grid,i=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let s,o;const r=(t,e,n)=>{n.width&&n.color&&(i.save(),i.lineWidth=n.width,i.strokeStyle=n.color,i.setLineDash(n.borderDash||[]),i.lineDashOffset=n.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(e.display)for(s=0,o=n.length;s{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:i+1,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",n=[];let s,o;for(s=0,o=e.length;s{const s=i.split("."),o=s.pop(),r=[t].concat(s).join("."),a=e[i].split("."),l=a.pop(),c=a.join(".");n["Ab"].route(r,o,c,l)})}function Ee(t){return"id"in t&&"defaults"in t}class Re{constructor(){this.controllers=new Ce(E,"datasets",!0),this.elements=new Ce(le,"elements"),this.plugins=new Ce(Object,"plugins"),this.scales=new Ce(Ae,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(e=>{const s=i||this._getRegistryForType(e);i||s.isForType(e)||s===this.plugins&&e.id?this._exec(t,s,e):Object(n["e"])(e,e=>{const n=i||this._getRegistryForType(e);this._exec(t,n,e)})})}_exec(t,e,i){const s=Object(n["G"])(t);Object(n["p"])(i["before"+s],[],i),e[t](i),Object(n["p"])(i["after"+s],[],i)}_getRegistryForType(t){for(let e=0;et.filter(t=>!e.some(e=>t.plugin.id===e.plugin.id));this._notify(n(e,i),t,"stop"),this._notify(n(i,e),t,"start")}}function Ie(t){const e=[],i=Object.keys(Fe.plugins.items);for(let s=0;s{const e=s[t];if(!Object(n["Fb"])(e))return console.error("Invalid scale configuration for scale: "+t);if(e._proxy)return console.warn("Ignoring resolver passed as options for scale: "+t);const l=Ye(t,e),c=$e(l,o),h=i.scales||{};r[l]=r[l]||t,a[t]=Object(n["M"])(Object.create(null),[{axis:l},e,h[l],h[c]])}),t.data.datasets.forEach(i=>{const o=i.type||t.type,l=i.indexAxis||We(o,e),c=n["E"][o]||{},h=c.scales||{};Object.keys(h).forEach(t=>{const e=Ne(t,l),o=i[e+"AxisID"]||r[e]||e;a[o]=a[o]||Object.create(null),Object(n["M"])(a[o],[{axis:e},s[o],h[t]])})}),Object.keys(a).forEach(t=>{const e=a[t];Object(n["M"])(e,[n["Ab"].scales[e.type],n["Ab"].scale])}),a}function qe(t){const e=t.options||(t.options={});e.plugins=Object(n["Sb"])(e.plugins,{}),e.scales=Xe(t,e)}function Ke(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function Qe(t){return t=t||{},t.data=Ke(t.data),qe(t),t}const Ge=new Map,Je=new Set;function Ze(t,e){let i=Ge.get(t);return i||(i=e(),Ge.set(t,i),Je.add(i)),i}const ti=(t,e,i)=>{const s=Object(n["Cb"])(e,i);void 0!==s&&t.add(s)};class ei{constructor(t){this._config=Qe(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Ke(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),qe(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Ze(t,()=>[["datasets."+t,""]])}datasetAnimationScopeKeys(t,e){return Ze(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,"transitions."+e],["datasets."+t,""]])}datasetElementScopeKeys(t,e){return Ze(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,"datasets."+t,"elements."+e,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return Ze(`${i}-plugin-${e}`,()=>[["plugins."+e,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let n=i.get(t);return n&&!e||(n=new Map,i.set(t,n)),n}getOptionScopes(t,e,i){const{options:s,type:o}=this,r=this._cachedScopes(t,i),a=r.get(e);if(a)return a;const l=new Set;e.forEach(e=>{t&&(l.add(t),e.forEach(e=>ti(l,t,e))),e.forEach(t=>ti(l,s,t)),e.forEach(t=>ti(l,n["E"][o]||{},t)),e.forEach(t=>ti(l,n["Ab"],t)),e.forEach(t=>ti(l,n["H"],t))});const c=Array.from(l);return 0===c.length&&c.push(Object.create(null)),Je.has(e)&&r.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,n["E"][e]||{},n["Ab"].datasets[e]||{},{type:e},n["Ab"],n["H"]]}resolveNamedOptions(t,e,i,s=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=ii(this._resolverCache,t,s);let l=r;if(si(r,e)){o.$shared=!1,i=Object(n["I"])(i)?i():i;const e=this.createResolver(t,i,a);l=Object(n["J"])(r,i,e)}for(const n of e)o[n]=l[n];return o}createResolver(t,e,i=[""],s){const{resolver:o}=ii(this._resolverCache,t,i);return Object(n["Fb"])(e)?Object(n["J"])(o,e,void 0,s):o}}function ii(t,e,i){let s=t.get(e);s||(s=new Map,t.set(e,s));const o=i.join();let r=s.get(o);if(!r){const t=Object(n["K"])(e,i);r={resolver:t,subPrefixes:i.filter(t=>!t.toLowerCase().includes("hover"))},s.set(o,r)}return r}const ni=t=>Object(n["Fb"])(t)&&Object.getOwnPropertyNames(t).reduce((e,i)=>e||Object(n["I"])(t[i]),!1);function si(t,e){const{isScriptable:i,isIndexable:s}=Object(n["L"])(t);for(const o of e){const e=i(o),r=s(o),a=(r||e)&&t[o];if(e&&(Object(n["I"])(a)||ni(a))||r&&Object(n["yb"])(a))return!0}return!1}var oi="3.7.1";const ri=["top","bottom","left","right","chartArea"];function ai(t,e){return"top"===t||"bottom"===t||-1===ri.indexOf(t)&&"x"===e}function li(t,e){return function(i,n){return i[t]===n[t]?i[e]-n[e]:i[t]-n[t]}}function ci(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),Object(n["p"])(i&&i.onComplete,[t],e)}function hi(t){const e=t.chart,i=e.options.animation;Object(n["p"])(i&&i.onProgress,[t],e)}function di(t){return Object(n["l"])()&&"string"===typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const ui={},fi=t=>{const e=di(t);return Object.values(ui).filter(t=>t.canvas===e).pop()};function gi(t,e,i){const n=Object.keys(t);for(const s of n){const n=+s;if(n>=e){const o=t[s];delete t[s],(i>0||n>e)&&(t[n+i]=o)}}}function bi(t,e,i,n){return i&&"mouseout"!==t.type?n?e:t:null}class pi{constructor(t,e){const i=this.config=new ei(e),s=di(t),r=fi(s);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas can be reused.");const a=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||ae(s)),this.platform.updateConfig(i);const l=this.platform.acquireContext(s,a.aspectRatio),c=l&&l.canvas,h=c&&c.height,d=c&&c.width;this.id=Object(n["Y"])(),this.ctx=l,this.canvas=c,this.width=d,this.height=h,this._options=a,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 ze,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Object(n["Z"])(t=>this.update(t),a.resizeDelay||0),this._dataChanges=[],ui[this.id]=this,l&&c?(o.listen(this,"complete",ci),o.listen(this,"progress",hi),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:s,_aspectRatio:o}=this;return Object(n["Hb"])(t)?e&&o?o:s?i/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Object(n["ab"])(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Object(n["bb"])(this.canvas,this.ctx),this}stop(){return o.stop(this),this}resize(t,e){o.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,s=this.canvas,o=i.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(s,t,e,o),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,Object(n["ab"])(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),Object(n["p"])(i.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const t=this.options,e=t.scales||{};Object(n["e"])(e,(t,e)=>{t.id=e})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce((t,e)=>(t[e]=!1,t),{});let o=[];e&&(o=o.concat(Object.keys(e).map(t=>{const i=e[t],n=Ye(t,i),s="r"===n,o="x"===n;return{options:i,dposition:s?"chartArea":o?"bottom":"left",dtype:s?"radialLinear":o?"category":"linear"}}))),Object(n["e"])(o,e=>{const o=e.options,r=o.id,a=Ye(r,o),l=Object(n["Sb"])(o.type,e.dtype);void 0!==o.position&&ai(o.position,a)===ai(e.dposition)||(o.position=e.dposition),s[r]=!0;let c=null;if(r in i&&i[r].type===l)c=i[r];else{const t=Fe.getScale(l);c=new t({id:r,type:l,ctx:this.ctx,chart:this}),i[c.id]=c}c.init(o,t)}),Object(n["e"])(s,(t,e)=>{t||delete i[e]}),Object(n["e"])(i,t=>{It.configure(this,t,t.options),It.addBox(this,t)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((t,e)=>t.index-e.index),i>e){for(let t=e;te.length&&delete this._stacks,t.forEach((t,i)=>{0===e.filter(e=>e===t._dataset).length&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=e.length;i{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let n=0,c=this.data.datasets.length;n{t.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(li("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Object(n["e"])(this.scales,t=>{It.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);Object(n["cb"])(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:n,count:s}of e){const e="_removeElements"===i?-s:s;gi(t,n,e)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=e=>new Set(t.filter(t=>t[0]===e).map((t,e)=>e+","+t.splice(1).join(","))),s=i(0);for(let o=1;ot.split(",")).map(t=>({method:t[1],start:+t[2],count:+t[3]}))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;It.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],Object(n["e"])(this.boxes,t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))},this),this._layers.forEach((t,e)=>{t._idx=e}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,s=!i.disabled,o=this.chartArea,r={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",r)&&(s&&Object(n["x"])(e,{left:!1===i.left?0:o.left-i.left,right:!1===i.right?this.width:o.right+i.right,top:!1===i.top?0:o.top-i.top,bottom:!1===i.bottom?this.height:o.bottom+i.bottom}),t.controller.draw(),s&&Object(n["z"])(e),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}getElementsAtEventForMode(t,e,i,n){const s=vt.modes[e];return"function"===typeof s?s(this,t,i,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let n=i.filter(t=>t&&t._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(n)),n}getContext(){return this.$context||(this.$context=Object(n["Eb"])(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return"boolean"===typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){const i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const s=i?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,s);Object(n["Gb"])(e)?(o.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),r.update(o,{visible:i}),this.update(e=>e.datasetIndex===t?s:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),o.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,i,n),t[i]=n},s=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};Object(n["e"])(this.options.events,t=>i(t,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,n)=>{e.addEventListener(this,i,n),t[i]=n},n=(i,n)=>{t[i]&&(e.removeEventListener(this,i,n),delete t[i])},s=(t,e)=>{this.canvas&&this.resize(t,e)};let o;const r=()=>{n("attach",r),this.attached=!0,this.resize(),i("resize",s),i("detach",o)};o=()=>{this.attached=!1,n("resize",s),this._stop(),this._resize(0,0),i("attach",r)},e.isAttached(this.canvas)?r():o()}unbindEvents(){Object(n["e"])(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},Object(n["e"])(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const n=i?"set":"remove";let s,o,r,a;for("dataset"===e&&(s=this.getDatasetMeta(t[0].datasetIndex),s.controller["_"+n+"DatasetHoverStyle"]()),r=0,a=t.length;r{const i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}),s=!Object(n["db"])(i,e);s&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}_updateHoverStyles(t,e,i){const n=this.options.hover,s=(t,e)=>t.filter(t=>!e.some(e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)),o=s(e,t),r=i?t:s(t,e);o.length&&this.updateHoverStyle(o,n.mode,!1),r.length&&n.mode&&this.updateHoverStyle(r,n.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:Object(n["Wb"])(t,this.chartArea,this._minPadding)},s=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,s))return;const o=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(o||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:s=[],options:o}=this,r=e,a=this._getActiveElements(t,s,i,r),l=Object(n["eb"])(t),c=bi(t,this._lastEvent,i,l);i&&(this._lastEvent=null,Object(n["p"])(o.onHover,[t,a,this],this),l&&Object(n["p"])(o.onClick,[t,a,this],this));const h=!Object(n["db"])(a,s);return(h||e)&&(this._active=a,this._updateHoverStyles(a,s,e)),this._lastEvent=c,h}_getActiveElements(t,e,i,n){if("mouseout"===t.type)return[];if(!i)return e;const s=this.options.hover;return this.getElementsAtEventForMode(t,s.mode,s,n)}}const mi=()=>Object(n["e"])(pi.instances,t=>t._plugins.invalidate()),xi=!0;function _i(t,e,i){const{startAngle:s,pixelMargin:o,x:r,y:a,outerRadius:l,innerRadius:c}=e;let h=o/l;t.beginPath(),t.arc(r,a,l,s-h,i+h),c>o?(h=o/c,t.arc(r,a,c,i+h,s-h,!0)):t.arc(r,a,o,i+n["i"],s-n["i"]),t.closePath(),t.clip()}function yi(t){return Object(n["gb"])(t,["outerStart","outerEnd","innerStart","innerEnd"])}function vi(t,e,i,s){const o=yi(t.options.borderRadius),r=(i-e)/2,a=Math.min(r,s*e/2),l=t=>{const e=(i-Math.min(r,t))*s/2;return Object(n["Tb"])(t,0,Math.min(r,e))};return{outerStart:l(o.outerStart),outerEnd:l(o.outerEnd),innerStart:Object(n["Tb"])(o.innerStart,0,a),innerEnd:Object(n["Tb"])(o.innerEnd,0,a)}}function Oi(t,e,i,n){return{x:i+t*Math.cos(e),y:n+t*Math.sin(e)}}function wi(t,e,i,s,o){const{x:r,y:a,startAngle:l,pixelMargin:c,innerRadius:h}=e,d=Math.max(e.outerRadius+s+i-c,0),u=h>0?h+s+i+c:0;let f=0;const g=o-l;if(s){const t=h>0?h-s:0,e=d>0?d-s:0,i=(t+e)/2,n=0!==i?g*i/(i+s):g;f=(g-n)/2}const b=Math.max(.001,g*d-i/n["q"])/d,p=(g-b)/2,m=l+p+f,x=o-p-f,{outerStart:_,outerEnd:y,innerStart:v,innerEnd:O}=vi(e,u,d,x-m),w=d-_,j=d-y,M=m+_/w,k=x-y/j,S=u+v,D=u+O,P=m+v/S,A=x-O/D;if(t.beginPath(),t.arc(r,a,d,M,k),y>0){const e=Oi(j,k,r,a);t.arc(e.x,e.y,y,k,x+n["i"])}const C=Oi(D,x,r,a);if(t.lineTo(C.x,C.y),O>0){const e=Oi(D,A,r,a);t.arc(e.x,e.y,O,x+n["i"],A+Math.PI)}if(t.arc(r,a,u,x-O/u,m+v/u,!0),v>0){const e=Oi(S,P,r,a);t.arc(e.x,e.y,v,P+Math.PI,m-n["i"])}const T=Oi(w,m,r,a);if(t.lineTo(T.x,T.y),_>0){const e=Oi(w,M,r,a);t.arc(e.x,e.y,_,m-n["i"],M)}t.closePath()}function ji(t,e,i,s){const{fullCircles:o,startAngle:r,circumference:a}=e;let l=e.endAngle;if(o){wi(t,e,i,s,r+n["u"]);for(let e=0;e{Fe.add(...t),mi()}},unregister:{enumerable:xi,value:(...t)=>{Fe.remove(...t),mi()}}});class Si extends le{constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){const s=this.getProps(["x","y"],i),{angle:o,distance:r}=Object(n["c"])(s,{x:t,y:e}),{startAngle:a,endAngle:l,innerRadius:c,outerRadius:h,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),u=this.options.spacing/2,f=Object(n["Sb"])(d,l-a),g=f>=n["u"]||Object(n["Mb"])(o,a,l),b=Object(n["fb"])(r,c+u,h+u);return g&&b}getCenterPoint(t){const{x:e,y:i,startAngle:n,endAngle:s,innerRadius:o,outerRadius:r}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:a,spacing:l}=this.options,c=(n+s)/2,h=(o+r+l+a)/2;return{x:e+Math.cos(c)*h,y:i+Math.sin(c)*h}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,s=(e.offset||0)/2,o=(e.spacing||0)/2;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>n["u"]?Math.floor(i/n["u"]):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();let r=0;if(s){r=s/2;const e=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(e)*r,Math.sin(e)*r),this.circumference>=n["q"]&&(r=s)}t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor;const a=ji(t,this,r,o);ki(t,this,r,o,a),t.restore()}}function Di(t,e,i=e){t.lineCap=Object(n["Sb"])(i.borderCapStyle,e.borderCapStyle),t.setLineDash(Object(n["Sb"])(i.borderDash,e.borderDash)),t.lineDashOffset=Object(n["Sb"])(i.borderDashOffset,e.borderDashOffset),t.lineJoin=Object(n["Sb"])(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=Object(n["Sb"])(i.borderWidth,e.borderWidth),t.strokeStyle=Object(n["Sb"])(i.borderColor,e.borderColor)}function Pi(t,e,i){t.lineTo(i.x,i.y)}function Ai(t){return t.stepped?n["nb"]:t.tension||"monotone"===t.cubicInterpolationMode?n["ob"]:Pi}function Ci(t,e,i={}){const n=t.length,{start:s=0,end:o=n-1}=i,{start:r,end:a}=e,l=Math.max(s,r),c=Math.min(o,a),h=sa&&o>a;return{count:n,start:l,loop:e.loop,ilen:c(r+(c?a-t:t))%o,_=()=>{f!==g&&(t.lineTo(p,g),t.lineTo(p,f),t.lineTo(p,b))};for(l&&(d=s[x(0)],t.moveTo(d.x,d.y)),h=0;h<=a;++h){if(d=s[x(h)],d.skip)continue;const e=d.x,i=d.y,n=0|e;n===u?(ig&&(g=i),p=(m*p+e)/++m):(_(),t.lineTo(e,i),u=n,m=0,f=g=i),b=i}_()}function Ei(t){const e=t.options,i=e.borderDash&&e.borderDash.length,n=!t._decimated&&!t._loop&&!e.tension&&"monotone"!==e.cubicInterpolationMode&&!e.stepped&&!i;return n?Li:Ti}function Ri(t){return t.stepped?n["kb"]:t.tension||"monotone"===t.cubicInterpolationMode?n["lb"]:n["mb"]}function Fi(t,e,i,n){let s=e._path;s||(s=e._path=new Path2D,e.path(s,i,n)&&s.closePath()),Di(t,e.options),t.stroke(s)}function zi(t,e,i,n){const{segments:s,options:o}=e,r=Ei(e);for(const a of s)Di(t,o,a.style),t.beginPath(),r(t,e,a,{start:i,end:i+n-1})&&t.closePath(),t.stroke()}Si.id="arc",Si.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0},Si.defaultRoutes={backgroundColor:"backgroundColor"};const Ii="function"===typeof Path2D;function Vi(t,e,i,n){Ii&&!e.options.segment?Fi(t,e,i,n):zi(t,e,i,n)}class Bi extends le{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;Object(n["hb"])(this._points,i,t,s,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Object(n["ib"])(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,s=t[e],o=this.points,r=Object(n["jb"])(this,{property:e,start:s,end:s});if(!r.length)return;const a=[],l=Ri(i);let c,h;for(c=0,h=r.length;c"borderDash"!==t&&"fill"!==t};class Wi extends le{constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){const n=this.options,{x:s,y:o}=this.getProps(["x","y"],i);return Math.pow(t-s,2)+Math.pow(e-o,2)=i)return t.slice(e,e+i);const r=[],a=(i-2)/(o-2);let l=0;const c=e+i-1;let h,d,u,f,g,b=e;for(r[l++]=t[b],h=0;hu&&(u=f,d=t[n],g=n);r[l++]=d,b=g}return r[l++]=t[c],r}function en(t,e,i,s){let o,r,a,l,c,h,d,u,f,g,b=0,p=0;const m=[],x=e+i-1,_=t[e].x,y=t[x].x,v=y-_;for(o=e;og&&(g=l,d=o),b=(p*b+r.x)/++p;else{const i=o-1;if(!Object(n["Hb"])(h)&&!Object(n["Hb"])(d)){const e=Math.min(h,d),n=Math.max(h,d);e!==u&&e!==i&&m.push({...t[e],x:b}),n!==u&&n!==i&&m.push({...t[n],x:b})}o>0&&i!==u&&m.push(t[i]),m.push(r),c=e,p=0,f=g=l,h=d=u=o}}return m}function nn(t){if(t._decimated){const e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{value:e})}}function sn(t){t.data.datasets.forEach(t=>{nn(t)})}function on(t,e){const i=e.length;let s,o=0;const{iScale:r}=t,{min:a,max:l,minDefined:c,maxDefined:h}=r.getUserBounds();return c&&(o=Object(n["Tb"])(Object(n["Ub"])(e,r.axis,a).lo,0,i-1)),s=h?Object(n["Tb"])(Object(n["Ub"])(e,r.axis,l).hi+1,o,i)-o:i-o,{start:o,count:s}}var rn={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,i)=>{if(!i.enabled)return void sn(t);const s=t.width;t.data.datasets.forEach((e,o)=>{const{_data:r,indexAxis:a}=e,l=t.getDatasetMeta(o),c=r||e.data;if("y"===Object(n["C"])([a,t.options.indexAxis]))return;if("line"!==l.type)return;const h=t.scales[l.xAxisID];if("linear"!==h.type&&"time"!==h.type)return;if(t.options.parsing)return;let{start:d,count:u}=on(l,c);const f=i.threshold||4*s;if(u<=f)return void nn(e);let g;switch(Object(n["Hb"])(r)&&(e._data=c,delete e.data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(t){this._data=t}})),i.algorithm){case"lttb":g=tn(c,d,u,s,i);break;case"min-max":g=en(c,d,u,s);break;default:throw new Error(`Unsupported decimation algorithm '${i.algorithm}'`)}e._decimated=g})},destroy(t){sn(t)}};function an(t,e){const i=t.getDatasetMeta(e),n=i&&t.isDatasetVisible(e);return n?i.dataset:null}function ln(t){const e=t.options,i=e.fill;let s=Object(n["Sb"])(i&&i.target,i);return void 0===s&&(s=!!e.backgroundColor),!1!==s&&null!==s&&(!0===s?"origin":s)}function cn(t,e,i){const s=ln(t);if(Object(n["Fb"])(s))return!isNaN(s.value)&&s;let o=parseFloat(s);return Object(n["Db"])(o)&&Math.floor(o)===o?("-"!==s[0]&&"+"!==s[0]||(o=e+o),!(o===e||o<0||o>=i)&&o):["origin","start","end","stack","shape"].indexOf(s)>=0&&s}function hn(t){const{scale:e={},fill:i}=t;let s,o=null;return"start"===i?o=e.bottom:"end"===i?o=e.top:Object(n["Fb"])(i)?o=e.getPixelForValue(i.value):e.getBasePixel&&(o=e.getBasePixel()),Object(n["Db"])(o)?(s=e.isHorizontal(),{x:s?o:null,y:s?null:o}):null}class dn{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:s,y:o,radius:r}=this;return e=e||{start:0,end:n["u"]},t.arc(s,o,r,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:n}=this,s=t.angle;return{x:e+Math.cos(s)*n,y:i+Math.sin(s)*n,angle:s}}}function un(t){const{scale:e,fill:i}=t,s=e.options,o=e.getLabels().length,r=[],a=s.reverse?e.max:e.min,l=s.reverse?e.min:e.max;let c,h,d;if(d="start"===i?a:"end"===i?l:Object(n["Fb"])(i)?i.value:e.getBaseValue(),s.grid.circular)return h=e.getPointPositionForValue(0,a),new dn({x:h.x,y:h.y,radius:e.getDistanceFromCenterForValue(d)});for(c=0;ct;e--){const t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function bn(t,e){const{x:i=null,y:n=null}=t||{},s=e.points,o=[];return e.segments.forEach(({start:t,end:e})=>{e=gn(t,e,s);const r=s[t],a=s[e];null!==n?(o.push({x:r.x,y:n}),o.push({x:a.x,y:n})):null!==i&&(o.push({x:i,y:r.y}),o.push({x:i,y:a.y}))}),o}function pn(t){const{scale:e,index:i,line:n}=t,s=[],o=n.segments,r=n.points,a=mn(e,i);a.push(vn({x:null,y:e.bottom},n));for(let l=0;l=0;--r){const e=s[r].$filler;e&&(e.line.updateControlPoints(o,e.axis),n&&Cn(t.ctx,e,o))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;const n=t.getSortedVisibleDatasetMetas();for(let s=n.length-1;s>=0;--s){const e=n[s].$filler;e&&Cn(t.ctx,e,t.chartArea)}},beforeDatasetDraw(t,e,i){const n=e.meta.$filler;n&&!1!==n.fill&&"beforeDatasetDraw"===i.drawTime&&Cn(t.ctx,n,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Ln=(t,e)=>{let{boxHeight:i=e,boxWidth:n=e}=t;return t.usePointStyle&&(i=Math.min(i,e),n=Math.min(n,e)),{boxWidth:n,boxHeight:i,itemHeight:Math.max(e,i)}},En=(t,e)=>null!==t&&null!==e&&t.datasetIndex===e.datasetIndex&&t.index===e.index;class Rn extends le{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=Object(n["p"])(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(e=>t.filter(e,this.chart.data))),t.sort&&(e=e.sort((e,i)=>t.sort(e,i,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display)return void(this.width=this.height=0);const i=t.labels,s=Object(n["A"])(i.font),o=s.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Ln(i,o);let c,h;e.font=s.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(r,o,a,l)+10):(h=this.maxHeight,c=this._fitCols(r,o,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,n){const{ctx:s,maxWidth:o,options:{labels:{padding:r}}}=this,a=this.legendHitBoxes=[],l=this.lineWidths=[0],c=n+r;let h=t;s.textAlign="left",s.textBaseline="middle";let d=-1,u=-c;return this.legendItems.forEach((t,f)=>{const g=i+e/2+s.measureText(t.text).width;(0===f||l[l.length-1]+g+2*r>o)&&(h+=c,l[l.length-(f>0?0:1)]=0,u+=c,d++),a[f]={left:0,top:u,row:d,width:g,height:n},l[l.length-1]+=g+r}),h}_fitCols(t,e,i,n){const{ctx:s,maxHeight:o,options:{labels:{padding:r}}}=this,a=this.legendHitBoxes=[],l=this.columnSizes=[],c=o-t;let h=r,d=0,u=0,f=0,g=0;return this.legendItems.forEach((t,o)=>{const b=i+e/2+s.measureText(t.text).width;o>0&&u+n+2*r>c&&(h+=d+r,l.push({width:d,height:u}),f+=d+r,g++,d=u=0),a[o]={left:f,top:u,col:g,width:b,height:n},d=Math.max(d,b),u+=n+r}),h+=d,l.push({width:d,height:u}),h}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:s},rtl:o}}=this,r=Object(n["vb"])(o,this.left,this.width);if(this.isHorizontal()){let o=0,a=Object(n["D"])(i,this.left+s,this.right-this.lineWidths[o]);for(const l of e)o!==l.row&&(o=l.row,a=Object(n["D"])(i,this.left+s,this.right-this.lineWidths[o])),l.top+=this.top+t+s,l.left=r.leftForLtr(r.x(a),l.width),a+=l.width+s}else{let o=0,a=Object(n["D"])(i,this.top+t+s,this.bottom-this.columnSizes[o].height);for(const l of e)l.col!==o&&(o=l.col,a=Object(n["D"])(i,this.top+t+s,this.bottom-this.columnSizes[o].height)),l.top=a,l.left+=this.left+s,l.left=r.leftForLtr(r.x(l.left),l.width),a+=l.height+s}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const t=this.ctx;Object(n["x"])(t,this),this._draw(),Object(n["z"])(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:s}=this,{align:o,labels:r}=t,a=n["Ab"].color,l=Object(n["vb"])(t.rtl,this.left,this.width),c=Object(n["A"])(r.font),{color:h,padding:d}=r,u=c.size,f=u/2;let g;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:b,boxHeight:p,itemHeight:m}=Ln(r,u),x=function(t,e,i){if(isNaN(b)||b<=0||isNaN(p)||p<0)return;s.save();const o=Object(n["Sb"])(i.lineWidth,1);if(s.fillStyle=Object(n["Sb"])(i.fillStyle,a),s.lineCap=Object(n["Sb"])(i.lineCap,"butt"),s.lineDashOffset=Object(n["Sb"])(i.lineDashOffset,0),s.lineJoin=Object(n["Sb"])(i.lineJoin,"miter"),s.lineWidth=o,s.strokeStyle=Object(n["Sb"])(i.strokeStyle,a),s.setLineDash(Object(n["Sb"])(i.lineDash,[])),r.usePointStyle){const r={radius:b*Math.SQRT2/2,pointStyle:i.pointStyle,rotation:i.rotation,borderWidth:o},a=l.xPlus(t,b/2),c=e+f;Object(n["pb"])(s,r,a,c)}else{const r=e+Math.max((u-p)/2,0),a=l.leftForLtr(t,b),c=Object(n["sb"])(i.borderRadius);s.beginPath(),Object.values(c).some(t=>0!==t)?Object(n["qb"])(s,{x:a,y:r,w:b,h:p,radius:c}):s.rect(a,r,b,p),s.fill(),0!==o&&s.stroke()}s.restore()},_=function(t,e,i){Object(n["y"])(s,i.text,t,e+m/2,c,{strikethrough:i.hidden,textAlign:l.textAlign(i.textAlign)})},y=this.isHorizontal(),v=this._computeTitleHeight();g=y?{x:Object(n["D"])(o,this.left+d,this.right-i[0]),y:this.top+d+v,line:0}:{x:this.left+d,y:Object(n["D"])(o,this.top+v+d,this.bottom-e[0].height),line:0},Object(n["wb"])(this.ctx,t.textDirection);const O=m+d;this.legendItems.forEach((a,c)=>{s.strokeStyle=a.fontColor||h,s.fillStyle=a.fontColor||h;const u=s.measureText(a.text).width,p=l.textAlign(a.textAlign||(a.textAlign=r.textAlign)),m=b+f+u;let w=g.x,j=g.y;l.setWidth(this.width),y?c>0&&w+m+d>this.right&&(j=g.y+=O,g.line++,w=g.x=Object(n["D"])(o,this.left+d,this.right-i[g.line])):c>0&&j+O>this.bottom&&(w=g.x=w+e[g.line].width+d,g.line++,j=g.y=Object(n["D"])(o,this.top+v+d,this.bottom-e[g.line].height));const M=l.x(w);x(M,j,a),w=Object(n["xb"])(p,w+b+f,y?w+m:this.right,t.rtl),_(l.x(w),j,a),y?g.x+=m+d:g.y+=O}),Object(n["N"])(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=Object(n["A"])(e.font),s=Object(n["d"])(e.padding);if(!e.display)return;const o=Object(n["vb"])(t.rtl,this.left,this.width),r=this.ctx,a=e.position,l=i.size/2,c=s.top+l;let h,d=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),h=this.top+c,d=Object(n["D"])(t.align,d,this.right-u);else{const e=this.columnSizes.reduce((t,e)=>Math.max(t,e.height),0);h=c+Object(n["D"])(t.align,this.top,this.bottom-e-t.labels.padding-this._computeTitleHeight())}const f=Object(n["D"])(a,d,d+u);r.textAlign=o.textAlign(Object(n["a"])(a)),r.textBaseline="middle",r.strokeStyle=e.color,r.fillStyle=e.color,r.font=i.string,Object(n["y"])(r,e.text,f,h,i)}_computeTitleHeight(){const t=this.options.title,e=Object(n["A"])(t.font),i=Object(n["d"])(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,o;if(Object(n["fb"])(t,this.left,this.right)&&Object(n["fb"])(e,this.top,this.bottom))for(o=this.legendHitBoxes,i=0;it.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:i,pointStyle:s,textAlign:o,color:r}}=t.legend.options;return t._getSortedDatasetMetas().map(t=>{const a=t.controller.getStyle(i?0:void 0),l=Object(n["d"])(a.borderWidth);return{text:e[t.index].label,fillStyle:a.backgroundColor,fontColor:r,hidden:!t.visible,lineCap:a.borderCapStyle,lineDash:a.borderDash,lineDashOffset:a.borderDashOffset,lineJoin:a.borderJoinStyle,lineWidth:(l.width+l.height)/4,strokeStyle:a.borderColor,pointStyle:s||a.pointStyle,rotation:a.rotation,textAlign:o||a.textAlign,borderRadius:0,datasetIndex:t.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class In extends le{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=t,this.height=this.bottom=e;const s=Object(n["yb"])(i.text)?i.text.length:1;this._padding=Object(n["d"])(i.padding);const o=s*Object(n["A"])(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){const{top:e,left:i,bottom:s,right:o,options:r}=this,a=r.align;let l,c,h,d=0;return this.isHorizontal()?(c=Object(n["D"])(a,i,o),h=e+t,l=o-i):("left"===r.position?(c=i+t,h=Object(n["D"])(a,s,e),d=-.5*n["q"]):(c=o-t,h=Object(n["D"])(a,e,s),d=.5*n["q"]),l=s-e),{titleX:c,titleY:h,maxWidth:l,rotation:d}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=Object(n["A"])(e.font),s=i.lineHeight,o=s/2+this._padding.top,{titleX:r,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(o);Object(n["y"])(t,e.text,0,0,i,{color:e.color,maxWidth:l,rotation:c,textAlign:Object(n["a"])(e.align),textBaseline:"middle",translation:[r,a]})}}function Vn(t,e){const i=new In({ctx:t.ctx,options:e,chart:t});It.configure(t,i,e),It.addBox(t,i),t.titleBlock=i}var Bn={id:"title",_element:In,start(t,e,i){Vn(t,i)},stop(t){const e=t.titleBlock;It.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){const n=t.titleBlock;It.configure(t,n,i),n.options=i},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Hn=new WeakMap;var Wn={id:"subtitle",start(t,e,i){const n=new In({ctx:t.ctx,options:i,chart:t});It.configure(t,n,i),It.addBox(t,n),Hn.set(t,n)},stop(t){It.removeBox(t,Hn.get(t)),Hn.delete(t)},beforeUpdate(t,e,i){const n=Hn.get(t);It.configure(t,n,i),n.options=i},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Nn={average(t){if(!t.length)return!1;let e,i,n=0,s=0,o=0;for(e=0,i=t.length;e-1?t.split("\n"):t}function Yn(t,e){const{element:i,datasetIndex:n,index:s}=e,o=t.getDatasetMeta(n).controller,{label:r,value:a}=o.getLabelAndValue(s);return{chart:t,label:r,parsed:o.getParsed(s),raw:t.data.datasets[n].data[s],formattedValue:a,dataset:o.getDataset(),dataIndex:s,datasetIndex:n,element:i}}function Xn(t,e){const i=t.chart.ctx,{body:s,footer:o,title:r}=t,{boxWidth:a,boxHeight:l}=e,c=Object(n["A"])(e.bodyFont),h=Object(n["A"])(e.titleFont),d=Object(n["A"])(e.footerFont),u=r.length,f=o.length,g=s.length,b=Object(n["d"])(e.padding);let p=b.height,m=0,x=s.reduce((t,e)=>t+e.before.length+e.lines.length+e.after.length,0);if(x+=t.beforeBody.length+t.afterBody.length,u&&(p+=u*h.lineHeight+(u-1)*e.titleSpacing+e.titleMarginBottom),x){const t=e.displayColors?Math.max(l,c.lineHeight):c.lineHeight;p+=g*t+(x-g)*c.lineHeight+(x-1)*e.bodySpacing}f&&(p+=e.footerMarginTop+f*d.lineHeight+(f-1)*e.footerSpacing);let _=0;const y=function(t){m=Math.max(m,i.measureText(t).width+_)};return i.save(),i.font=h.string,Object(n["e"])(t.title,y),i.font=c.string,Object(n["e"])(t.beforeBody.concat(t.afterBody),y),_=e.displayColors?a+2+e.boxPadding:0,Object(n["e"])(s,t=>{Object(n["e"])(t.before,y),Object(n["e"])(t.lines,y),Object(n["e"])(t.after,y)}),_=0,i.font=d.string,Object(n["e"])(t.footer,y),i.restore(),m+=b.width,{width:m,height:p}}function qn(t,e){const{y:i,height:n}=e;return it.height-n/2?"bottom":"center"}function Kn(t,e,i,n){const{x:s,width:o}=n,r=i.caretSize+i.caretPadding;return"left"===t&&s+o+r>e.width||("right"===t&&s-o-r<0||void 0)}function Qn(t,e,i,n){const{x:s,width:o}=i,{width:r,chartArea:{left:a,right:l}}=t;let c="center";return"center"===n?c=s<=(a+l)/2?"left":"right":s<=o/2?c="left":s>=r-o/2&&(c="right"),Kn(c,t,e,i)&&(c="center"),c}function Gn(t,e,i){const n=i.yAlign||e.yAlign||qn(t,i);return{xAlign:i.xAlign||e.xAlign||Qn(t,e,i,n),yAlign:n}}function Jn(t,e){let{x:i,width:n}=t;return"right"===e?i-=n:"center"===e&&(i-=n/2),i}function Zn(t,e,i){let{y:n,height:s}=t;return"top"===e?n+=i:n-="bottom"===e?s+i:s/2,n}function ts(t,e,i,s){const{caretSize:o,caretPadding:r,cornerRadius:a}=t,{xAlign:l,yAlign:c}=i,h=o+r,{topLeft:d,topRight:u,bottomLeft:f,bottomRight:g}=Object(n["sb"])(a);let b=Jn(e,l);const p=Zn(e,c,h);return"center"===c?"left"===l?b+=h:"right"===l&&(b-=h):"left"===l?b-=Math.max(d,f)+o:"right"===l&&(b+=Math.max(u,g)+o),{x:Object(n["Tb"])(b,0,s.width-e.width),y:Object(n["Tb"])(p,0,s.height-e.height)}}function es(t,e,i){const s=Object(n["d"])(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-s.right:t.x+s.left}function is(t){return $n([],Un(t))}function ns(t,e,i){return Object(n["Eb"])(t,{tooltip:e,tooltipItems:i,type:"tooltip"})}function ss(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}class os extends le{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart||t._chart,this._chart=this.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),n=i.enabled&&e.options.animation&&i.animations,s=new u(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=ns(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,n=i.beforeTitle.apply(this,[t]),s=i.title.apply(this,[t]),o=i.afterTitle.apply(this,[t]);let r=[];return r=$n(r,Un(n)),r=$n(r,Un(s)),r=$n(r,Un(o)),r}getBeforeBody(t,e){return is(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){const{callbacks:i}=e,s=[];return Object(n["e"])(t,t=>{const e={before:[],lines:[],after:[]},n=ss(i,t);$n(e.before,Un(n.beforeLabel.call(this,t))),$n(e.lines,n.label.call(this,t)),$n(e.after,Un(n.afterLabel.call(this,t))),s.push(e)}),s}getAfterBody(t,e){return is(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){const{callbacks:i}=e,n=i.beforeFooter.apply(this,[t]),s=i.footer.apply(this,[t]),o=i.afterFooter.apply(this,[t]);let r=[];return r=$n(r,Un(n)),r=$n(r,Un(s)),r=$n(r,Un(o)),r}_createItems(t){const e=this._active,i=this.chart.data,s=[],o=[],r=[];let a,l,c=[];for(a=0,l=e.length;at.filter(e,n,s,i))),t.itemSort&&(c=c.sort((e,n)=>t.itemSort(e,n,i))),Object(n["e"])(c,e=>{const i=ss(t.callbacks,e);s.push(i.labelColor.call(this,e)),o.push(i.labelPointStyle.call(this,e)),r.push(i.labelTextColor.call(this,e))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=c,c}update(t,e){const i=this.options.setContext(this.getContext()),n=this._active;let s,o=[];if(n.length){const t=Nn[i.position].call(this,n,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const e=this._size=Xn(this,i),r=Object.assign({},t,e),a=Gn(this.chart,i,r),l=ts(i,r,a,this.chart);this.xAlign=a.xAlign,this.yAlign=a.yAlign,s={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(s={opacity:0});this._tooltipItems=o,this.$context=void 0,s&&this._resolveAnimations().update(this,s),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,n){const s=this.getCaretPosition(t,i,n);e.lineTo(s.x1,s.y1),e.lineTo(s.x2,s.y2),e.lineTo(s.x3,s.y3)}getCaretPosition(t,e,i){const{xAlign:s,yAlign:o}=this,{caretSize:r,cornerRadius:a}=i,{topLeft:l,topRight:c,bottomLeft:h,bottomRight:d}=Object(n["sb"])(a),{x:u,y:f}=t,{width:g,height:b}=e;let p,m,x,_,y,v;return"center"===o?(y=f+b/2,"left"===s?(p=u,m=p-r,_=y+r,v=y-r):(p=u+g,m=p+r,_=y-r,v=y+r),x=p):(m="left"===s?u+Math.max(l,h)+r:"right"===s?u+g-Math.max(c,d)-r:this.caretX,"top"===o?(_=f,y=_-r,p=m-r,x=m+r):(_=f+b,y=_+r,p=m+r,x=m-r),v=_),{x1:p,x2:m,x3:x,y1:_,y2:y,y3:v}}drawTitle(t,e,i){const s=this.title,o=s.length;let r,a,l;if(o){const c=Object(n["vb"])(i.rtl,this.x,this.width);for(t.x=es(this,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",r=Object(n["A"])(i.titleFont),a=i.titleSpacing,e.fillStyle=i.titleColor,e.font=r.string,l=0;l0!==t)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,Object(n["qb"])(t,{x:e,y:b,w:c,h:l,radius:a}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),Object(n["qb"])(t,{x:i,y:b+1,w:c-2,h:l-2,radius:a}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(e,b,c,l),t.strokeRect(e,b,c,l),t.fillStyle=r.backgroundColor,t.fillRect(i,b+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:s}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:h}=i,d=Object(n["A"])(i.bodyFont);let u=d.lineHeight,f=0;const g=Object(n["vb"])(i.rtl,this.x,this.width),b=function(i){e.fillText(i,g.x(t.x+f),t.y+u/2),t.y+=u+o},p=g.textAlign(r);let m,x,_,y,v,O,w;for(e.textAlign=r,e.textBaseline="middle",e.font=d.string,t.x=es(this,p,i),e.fillStyle=i.bodyColor,Object(n["e"])(this.beforeBody,b),f=a&&"right"!==p?"center"===r?c/2+h:c+2+h:0,y=0,O=s.length;y0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,n=i&&i.x,s=i&&i.y;if(n||s){const i=Nn[t.position].call(this,this._active,this._eventPosition);if(!i)return;const o=this._size=Xn(this,t),r=Object.assign({},i,this._size),a=Gn(e,t,r),l=ts(t,r,a,e);n._to===l.x&&s._to===l.y||(this.xAlign=a.xAlign,this.yAlign=a.yAlign,this.width=o.width,this.height=o.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,l))}}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},o={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const r=Object(n["d"])(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(o,t,s,e),Object(n["wb"])(t,e.textDirection),o.y+=r.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),Object(n["N"])(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,s=t.map(({datasetIndex:t,index:e})=>{const i=this.chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}),o=!Object(n["db"])(i,s),r=this._positionChanged(s,e);(o||r)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,o=this._active||[],r=this._getActiveElements(t,o,e,i),a=this._positionChanged(r,t),l=e||!Object(n["db"])(r,o)||a;return l&&(this._active=r,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,i,n){const s=this.options;if("mouseout"===t.type)return[];if(!n)return e;const o=this.chart.getElementsAtEventForMode(t,s.mode,s,i);return s.reverse&&o.reverse(),o}_positionChanged(t,e){const{caretX:i,caretY:n,options:s}=this,o=Nn[s.position].call(this,t,e);return!1!==o&&(i!==o.x||n!==o.y)}}os.positioners=Nn;var rs={id:"tooltip",_element:os,positioners:Nn,afterInit(t,e,i){i&&(t.tooltip=new os({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){const e=t.tooltip,i={tooltip:e};!1!==t.notifyPlugins("beforeTooltipDraw",i)&&(e&&e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i))},afterEvent(t,e){if(t.tooltip){const i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:n["O"],title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,n=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(n>0&&e.dataIndex"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},as=Object.freeze({__proto__:null,Decimation:rn,Filler:Tn,Legend:zn,SubTitle:Wn,Title:Bn,Tooltip:rs});const ls=(t,e,i,n)=>("string"===typeof e?(i=t.push(e)-1,n.unshift({index:i,label:e})):isNaN(e)&&(i=null),i);function cs(t,e,i,n){const s=t.indexOf(e);if(-1===s)return ls(t,e,i,n);const o=t.lastIndexOf(e);return s!==o?i:s}const hs=(t,e)=>null===t?null:Object(n["Tb"])(Math.round(t),0,e);class ds extends Ae{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const t=this.getLabels();for(const{index:i,label:n}of e)t[i]===n&&t.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(Object(n["Hb"])(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:cs(i,t,Object(n["Sb"])(e,t),this._addedLabels),hs(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:n}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(n=this.getLabels().length-1)),this.min=i,this.max=n}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,n=[];let s=this.getLabels();s=0===t&&e===s.length-1?s:s.slice(t,e+1),this._valueRange=Math.max(s.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let o=t;o<=e;o++)n.push({value:o});return n}getLabelForValue(t){const e=this.getLabels();return t>=0&&te.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function us(t,e){const i=[],s=1e-14,{bounds:o,step:r,min:a,max:l,precision:c,count:h,maxTicks:d,maxDigits:u,includeBounds:f}=t,g=r||1,b=d-1,{min:p,max:m}=e,x=!Object(n["Hb"])(a),_=!Object(n["Hb"])(l),y=!Object(n["Hb"])(h),v=(m-p)/(u+1);let O,w,j,M,k=Object(n["R"])((m-p)/b/g)*g;if(kb&&(k=Object(n["R"])(M*k/b/g)*g),Object(n["Hb"])(c)||(O=Math.pow(10,c),k=Math.ceil(k*O)/O),"ticks"===o?(w=Math.floor(p/k)*k,j=Math.ceil(m/k)*k):(w=p,j=m),x&&_&&r&&Object(n["S"])((l-a)/r,k/1e3)?(M=Math.round(Math.min((l-a)/k,d)),k=(l-a)/M,w=a,j=l):y?(w=x?a:w,j=_?l:j,M=h-1,k=(j-w)/M):(M=(j-w)/k,M=Object(n["T"])(M,Math.round(M),k/1e3)?Math.round(M):Math.ceil(M));const S=Math.max(Object(n["U"])(k),Object(n["U"])(w));O=Math.pow(10,Object(n["Hb"])(c)?S:c),w=Math.round(w*O)/O,j=Math.round(j*O)/O;let D=0;for(x&&(f&&w!==a?(i.push({value:a}),ws=e?s:t,a=t=>o=i?o:t;if(t){const t=Object(n["Pb"])(s),e=Object(n["Pb"])(o);t<0&&e<0?a(0):t>0&&e>0&&r(0)}if(s===o){let e=1;(o>=Number.MAX_SAFE_INTEGER||s<=Number.MIN_SAFE_INTEGER)&&(e=Math.abs(.05*o)),a(o+e),t||r(s-e)}this.min=s,this.max=o}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:n}=t;return n?(e=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},o=this._range||this,r=us(s,o);return"ticks"===t.bounds&&Object(n["Q"])(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const n=(i-e)/Math.max(t.length-1,1)/2;e-=n,i+=n}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return Object(n["Lb"])(t,this.chart.options.locale,this.options.ticks.format)}}class bs extends gs{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Object(n["Db"])(t)?t:0,this.max=Object(n["Db"])(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=Object(n["Qb"])(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/s))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}function ps(t){const e=t/Math.pow(10,Math.floor(Object(n["m"])(t)));return 1===e}function ms(t,e){const i=Math.floor(Object(n["m"])(e.max)),s=Math.ceil(e.max/Math.pow(10,i)),o=[];let r=Object(n["o"])(t.min,Math.pow(10,Math.floor(Object(n["m"])(e.min)))),a=Math.floor(Object(n["m"])(r)),l=Math.floor(r/Math.pow(10,a)),c=a<0?Math.pow(10,Math.abs(a)):1;do{o.push({value:r,major:ps(r)}),++l,10===l&&(l=1,++a,c=a>=0?1:c),r=Math.round(l*Math.pow(10,a)*c)/c}while(a0?i:null;this._zero=!0}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Object(n["Db"])(t)?Math.max(0,t):null,this.max=Object(n["Db"])(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,s=this.max;const o=e=>i=t?i:e,r=t=>s=e?s:t,a=(t,e)=>Math.pow(10,Math.floor(Object(n["m"])(t))+e);i===s&&(i<=0?(o(1),r(10)):(o(a(i,-1)),r(a(s,1)))),i<=0&&o(a(s,-1)),s<=0&&r(a(i,1)),this._zero&&this.min!==this._suggestedMin&&i===a(this.min,0)&&o(a(i,-1)),this.min=i,this.max=s}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=ms(e,this);return"ticks"===t.bounds&&Object(n["Q"])(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return void 0===t?"0":Object(n["Lb"])(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Object(n["m"])(t),this._valueRange=Object(n["m"])(this.max)-Object(n["m"])(t)}getPixelForValue(t){return void 0!==t&&0!==t||(t=this.min),null===t||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Object(n["m"])(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function _s(t){const e=t.ticks;if(e.display&&t.display){const t=Object(n["d"])(e.backdropPadding);return Object(n["Sb"])(e.font&&e.font.size,n["Ab"].font.size)+t.height}return 0}function ys(t,e,i){return i=Object(n["yb"])(i)?i:[i],{w:Object(n["V"])(t,e.string,i),h:i.length*e.lineHeight}}function vs(t,e,i,n,s){return t===n||t===s?{start:e-i/2,end:e+i/2}:ts?{start:e-i,end:e}:{start:e,end:e+i}}function Os(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},i=Object.assign({},e),s=[],o=[],r=t._pointLabels.length,a=t.options.pointLabels,l=a.centerPointLabels?n["q"]/r:0;for(let c=0;ce.r&&(a=(n.end-e.r)/o,t.r=Math.max(t.r,e.r+a)),s.starte.b&&(l=(s.end-e.b)/r,t.b=Math.max(t.b,e.b+l))}function js(t,e,i){const s=[],o=t._pointLabels.length,r=t.options,a=_s(r)/2,l=t.drawingArea,c=r.pointLabels.centerPointLabels?n["q"]/o:0;for(let h=0;h270||i<90)&&(t-=e),t}function Ds(t,e){const{ctx:i,options:{pointLabels:s}}=t;for(let o=e-1;o>=0;o--){const e=s.setContext(t.getPointLabelContext(o)),r=Object(n["A"])(e.font),{x:a,y:l,textAlign:c,left:h,top:d,right:u,bottom:f}=t._pointLabelItems[o],{backdropColor:g}=e;if(!Object(n["Hb"])(g)){const t=Object(n["d"])(e.backdropPadding);i.fillStyle=g,i.fillRect(h-t.left,d-t.top,u-h+t.width,f-d+t.height)}Object(n["y"])(i,t._pointLabels[o],a,l+r.lineHeight/2,r,{color:e.color,textAlign:c,textBaseline:"middle"})}}function Ps(t,e,i,s){const{ctx:o}=t;if(i)o.arc(t.xCenter,t.yCenter,e,0,n["u"]);else{let i=t.getPointPosition(0,e);o.moveTo(i.x,i.y);for(let n=1;n{const i=Object(n["p"])(this.options.pointLabels.callback,[t,e],this);return i||0===i?i:""}).filter((t,e)=>this.chart.getDataVisibility(e))}fit(){const t=this.options;t.display&&t.pointLabels.display?Os(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,n){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-n)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,n))}getIndexAngle(t){const e=n["u"]/(this._pointLabels.length||1),i=this.options.startAngle||0;return Object(n["ub"])(t*e+Object(n["Qb"])(i))}getDistanceFromCenterForValue(t){if(Object(n["Hb"])(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(Object(n["Hb"])(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t{if(0!==e){r=this.getDistanceFromCenterForValue(t.value);const i=n.setContext(this.getContext(e-1));As(this,i,r,s)}}),i.display){for(t.save(),o=s-1;o>=0;o--){const n=i.setContext(this.getPointLabelContext(o)),{color:s,lineWidth:l}=n;l&&s&&(t.lineWidth=l,t.strokeStyle=s,t.setLineDash(n.borderDash),t.lineDashOffset=n.borderDashOffset,r=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),a=this.getPointPosition(o,r),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(a.x,a.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let o,r;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((s,a)=>{if(0===a&&!e.reverse)return;const l=i.setContext(this.getContext(a)),c=Object(n["A"])(l.font);if(o=this.getDistanceFromCenterForValue(this.ticks[a].value),l.showLabelBackdrop){t.font=c.string,r=t.measureText(s.label).width,t.fillStyle=l.backdropColor;const e=Object(n["d"])(l.backdropPadding);t.fillRect(-r/2-e.left,-o-c.size/2-e.top,r+e.width,c.size+e.height)}Object(n["y"])(t,s.label,0,-o,c,{color:l.color})}),t.restore()}drawTitle(){}}Ts.id="radialLinear",Ts.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:de.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}},Ts.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},Ts.descriptors={angleLines:{_fallback:"grid"}};const Ls={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}},Es=Object.keys(Ls);function Rs(t,e){return t-e}function Fs(t,e){if(Object(n["Hb"])(e))return null;const i=t._adapter,{parser:s,round:o,isoWeekday:r}=t._parseOpts;let a=e;return"function"===typeof s&&(a=s(a)),Object(n["Db"])(a)||(a="string"===typeof s?i.parse(a,s):i.parse(a)),null===a?null:(o&&(a="week"!==o||!Object(n["Nb"])(r)&&!0!==r?i.startOf(a,o):i.startOf(a,"isoWeek",r)),+a)}function zs(t,e,i,n){const s=Es.length;for(let o=Es.indexOf(t);o=Es.indexOf(i);o--){const i=Es[o];if(Ls[i].common&&t._adapter.diff(s,n,i)>=e-1)return i}return Es[i?Es.indexOf(i):0]}function Vs(t){for(let e=Es.indexOf(t)+1,i=Es.length;e=e?i[s]:i[o];t[r]=!0}}else t[e]=!0}function Hs(t,e,i,n){const s=t._adapter,o=+s.startOf(e[0].value,n),r=e[e.length-1].value;let a,l;for(a=o;a<=r;a=+s.add(a,1,n))l=i[a],l>=0&&(e[l].major=!0);return e}function Ws(t,e,i){const n=[],s={},o=e.length;let r,a;for(r=0;r1e5*a)throw new Error(e+" and "+i+" are too far apart with stepSize of "+a+" "+r);const g="data"===s.ticks.source&&this.getDataTimestamps();for(d=f,u=0;dt-e).map(t=>+t)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}_tickFormatFunction(t,e,i,s){const o=this.options,r=o.time.displayFormats,a=this._unit,l=this._majorUnit,c=a&&r[a],h=l&&r[l],d=i[e],u=l&&h&&d&&d.major,f=this._adapter.format(t,s||(u?h:c)),g=o.ticks.callback;return g?Object(n["p"])(g,[f,e,i],this):f}generateTickLabels(t){let e,i,n;for(e=0,i=t.length;e0?r:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(t=0,e=n.length;t=t[l].pos&&e<=t[c].pos&&({lo:l,hi:c}=Object(n["Ub"])(t,"pos",e)),({pos:s,time:r}=t[l]),({pos:o,time:a}=t[c])):(e>=t[l].time&&e<=t[c].time&&({lo:l,hi:c}=Object(n["Ub"])(t,"time",e)),({time:s,pos:r}=t[l]),({time:o,pos:a}=t[c]));const h=o-s;return h?r+(a-r)*(e-s)/h:r}Ns.id="time",Ns.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};class Us extends Ns{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=$s(e,this.min),this._tableRange=$s(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,n=[],s=[];let o,r,a,l,c;for(o=0,r=t.length;o=e&&l<=i&&n.push(l);if(n.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(o=0,r=n.length;oArray.prototype.slice.call(t));let o=!1,r=[];return function(...i){r=s(i),o||(o=!0,n.call(window,()=>{o=!1,t.apply(e,r)}))}}function o(t,e){let i;return function(...n){return e?(clearTimeout(i),i=setTimeout(t,e,n)):t.apply(this,n),e}}const r=t=>"start"===t?"left":"end"===t?"right":"center",a=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2,l=(t,e,i,n)=>{const s=n?"left":"right";return t===s?i:"center"===t?(e+i)/2:e};function c(){}const h=function(){let t=0;return function(){return t++}}();function d(t){return null===t||"undefined"===typeof t}function u(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.substr(0,7)&&"Array]"===e.substr(-6)}function f(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}const g=t=>("number"===typeof t||t instanceof Number)&&isFinite(+t);function b(t,e){return g(t)?t:e}function p(t,e){return"undefined"===typeof t?e:t}const m=(t,e)=>"string"===typeof t&&t.endsWith("%")?parseFloat(t)/100:t/e,x=(t,e)=>"string"===typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function _(t,e,i){if(t&&"function"===typeof t.call)return t.apply(i,e)}function y(t,e,i,n){let s,o,r;if(u(t))if(o=t.length,n)for(s=o-1;s>=0;s--)e.call(i,t[s],s);else for(s=0;si)t=t[e.substr(i,n-i)],i=n+1,n=A(e,i);return t}function T(t){return t.charAt(0).toUpperCase()+t.slice(1)}const L=t=>"undefined"!==typeof t,E=t=>"function"===typeof t,R=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0};function F(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}const z=Math.PI,I=2*z,V=I+z,B=Number.POSITIVE_INFINITY,H=z/180,W=z/2,N=z/4,$=2*z/3,U=Math.log10,Y=Math.sign;function X(t){const e=Math.round(t);t=Q(t,e,t/1e3)?e:t;const i=Math.pow(10,Math.floor(U(t))),n=t/i,s=n<=1?1:n<=2?2:n<=5?5:10;return s*i}function q(t){const e=[],i=Math.sqrt(t);let n;for(n=1;nt-e).pop(),e}function K(t){return!isNaN(parseFloat(t))&&isFinite(t)}function Q(t,e,i){return Math.abs(t-e)=t}function J(t,e,i){let n,s,o;for(n=0,s=t.length;nl&&c=Math.min(e,i)-n&&t<=Math.max(e,i)+n}const ht=t=>0===t||1===t,dt=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*I/i),ut=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*I/i)+1,ft={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*W),easeOutSine:t=>Math.sin(t*W),easeInOutSine:t=>-.5*(Math.cos(z*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>ht(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>ht(t)?t:dt(t,.075,.3),easeOutElastic:t=>ht(t)?t:ut(t,.075,.3),easeInOutElastic(t){const e=.1125,i=.45;return ht(t)?t:t<.5?.5*dt(2*t,e,i):.5+.5*ut(2*t-1,e,i)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-ft.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:t=>t<.5?.5*ft.easeInBounce(2*t):.5*ft.easeOutBounce(2*t-1)+.5},gt={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},bt="0123456789ABCDEF",pt=t=>bt[15&t],mt=t=>bt[(240&t)>>4]+bt[15&t],xt=t=>(240&t)>>4===(15&t);function _t(t){return xt(t.r)&&xt(t.g)&&xt(t.b)&&xt(t.a)}function yt(t){var e,i=t.length;return"#"===t[0]&&(4===i||5===i?e={r:255&17*gt[t[1]],g:255&17*gt[t[2]],b:255&17*gt[t[3]],a:5===i?17*gt[t[4]]:255}:7!==i&&9!==i||(e={r:gt[t[1]]<<4|gt[t[2]],g:gt[t[3]]<<4|gt[t[4]],b:gt[t[5]]<<4|gt[t[6]],a:9===i?gt[t[7]]<<4|gt[t[8]]:255})),e}function vt(t){var e=_t(t)?pt:mt;return t?"#"+e(t.r)+e(t.g)+e(t.b)+(t.a<255?e(t.a):""):t}function Ot(t){return t+.5|0}const wt=(t,e,i)=>Math.max(Math.min(t,i),e);function jt(t){return wt(Ot(2.55*t),0,255)}function Mt(t){return wt(Ot(255*t),0,255)}function kt(t){return wt(Ot(t/2.55)/100,0,1)}function St(t){return wt(Ot(100*t),0,100)}const Dt=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Pt(t){const e=Dt.exec(t);let i,n,s,o=255;if(e){if(e[7]!==i){const t=+e[7];o=255&(e[8]?jt(t):255*t)}return i=+e[1],n=+e[3],s=+e[5],i=255&(e[2]?jt(i):i),n=255&(e[4]?jt(n):n),s=255&(e[6]?jt(s):s),{r:i,g:n,b:s,a:o}}}function At(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${kt(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}const Ct=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Tt(t,e,i){const n=e*Math.min(i,1-i),s=(e,s=(e+t/30)%12)=>i-n*Math.max(Math.min(s-3,9-s,1),-1);return[s(0),s(8),s(4)]}function Lt(t,e,i){const n=(n,s=(n+t/60)%6)=>i-i*e*Math.max(Math.min(s,4-s,1),0);return[n(5),n(3),n(1)]}function Et(t,e,i){const n=Tt(t,1,.5);let s;for(e+i>1&&(s=1/(e+i),e*=s,i*=s),s=0;s<3;s++)n[s]*=1-e-i,n[s]+=e;return n}function Rt(t){const e=255,i=t.r/e,n=t.g/e,s=t.b/e,o=Math.max(i,n,s),r=Math.min(i,n,s),a=(o+r)/2;let l,c,h;return o!==r&&(h=o-r,c=a>.5?h/(2-o-r):h/(o+r),l=o===i?(n-s)/h+(n>16&255,o>>8&255,255&o]}return t}let Xt;function qt(t){Xt||(Xt=Yt(),Xt.transparent=[0,0,0,0]);const e=Xt[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}function Kt(t,e,i){if(t){let n=Rt(t);n[e]=Math.max(0,Math.min(n[e]+n[e]*i,0===e?360:1)),n=zt(n),t.r=n[0],t.g=n[1],t.b=n[2]}}function Qt(t,e){return t?Object.assign(e||{},t):t}function Gt(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=Mt(t[3]))):(e=Qt(t,{r:0,g:0,b:0,a:1}),e.a=Mt(e.a)),e}function Jt(t){return"r"===t.charAt(0)?Pt(t):Ht(t)}class Zt{constructor(t){if(t instanceof Zt)return t;const e=typeof t;let i;"object"===e?i=Gt(t):"string"===e&&(i=yt(t)||qt(t)||Jt(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Qt(this._rgb);return t&&(t.a=kt(t.a)),t}set rgb(t){this._rgb=Gt(t)}rgbString(){return this._valid?At(this._rgb):this._rgb}hexString(){return this._valid?vt(this._rgb):this._rgb}hslString(){return this._valid?Nt(this._rgb):this._rgb}mix(t,e){const i=this;if(t){const n=i.rgb,s=t.rgb;let o;const r=e===o?.5:e,a=2*r-1,l=n.a-s.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;o=1-c,n.r=255&c*n.r+o*s.r+.5,n.g=255&c*n.g+o*s.g+.5,n.b=255&c*n.b+o*s.b+.5,n.a=r*n.a+(1-r)*s.a,i.rgb=n}return i}clone(){return new Zt(this.rgb)}alpha(t){return this._rgb.a=Mt(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=Ot(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Kt(this._rgb,2,t),this}darken(t){return Kt(this._rgb,2,-t),this}saturate(t){return Kt(this._rgb,1,t),this}desaturate(t){return Kt(this._rgb,1,-t),this}rotate(t){return Wt(this._rgb,t),this}}function te(t){return new Zt(t)}const ee=t=>t instanceof CanvasGradient||t instanceof CanvasPattern;function ie(t){return ee(t)?t:te(t)}function ne(t){return ee(t)?t:te(t).saturate(.5).darken(.1).hexString()}const se=Object.create(null),oe=Object.create(null);function re(t,e){if(!e)return t;const i=e.split(".");for(let n=0,s=i.length;nt.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>ne(e.backgroundColor),this.hoverBorderColor=(t,e)=>ne(e.borderColor),this.hoverColor=(t,e)=>ne(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t)}set(t,e){return ae(this,t,e)}get(t){return re(this,t)}describe(t,e){return ae(oe,t,e)}override(t,e){return ae(se,t,e)}route(t,e,i,n){const s=re(this,t),o=re(this,i),r="_"+e;Object.defineProperties(s,{[r]:{value:s[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[r],e=o[n];return f(t)?Object.assign({},e,t):p(t,e)},set(t){this[r]=t}}})}}var ce=new le({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function he(t){return!t||d(t.size)||d(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function de(t,e,i,n,s){let o=e[s];return o||(o=e[s]=t.measureText(s).width,i.push(s)),o>n&&(n=o),n}function ue(t,e,i,n){n=n||{};let s=n.data=n.data||{},o=n.garbageCollect=n.garbageCollect||[];n.font!==e&&(s=n.data={},o=n.garbageCollect=[],n.font=e),t.save(),t.font=e;let r=0;const a=i.length;let l,c,h,d,f;for(l=0;li.length){for(l=0;l0&&t.stroke()}}function pe(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.xe.top-i&&t.y0&&""!==o.strokeColor;let l,c;for(t.save(),t.font=s.string,Oe(t,o),l=0;l+t||0;function Pe(t,e){const i={},n=f(e),s=n?Object.keys(e):e,o=f(t)?n?i=>p(t[i],t[e[i]]):e=>t[e]:()=>t;for(const r of s)i[r]=De(o(r));return i}function Ae(t){return Pe(t,{top:"y",right:"x",bottom:"y",left:"x"})}function Ce(t){return Pe(t,["topLeft","topRight","bottomLeft","bottomRight"])}function Te(t){const e=Ae(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Le(t,e){t=t||{},e=e||ce.font;let i=p(t.size,e.size);"string"===typeof i&&(i=parseInt(i,10));let n=p(t.style,e.style);n&&!(""+n).match(ke)&&(console.warn('Invalid font style specified: "'+n+'"'),n="");const s={family:p(t.family,e.family),lineHeight:Se(p(t.lineHeight,e.lineHeight),i),size:i,style:n,weight:p(t.weight,e.weight),string:""};return s.string=he(s),s}function Ee(t,e,i,n){let s,o,r,a=!0;for(s=0,o=t.length;si&&0===t?0:t+e;return{min:r(n,-Math.abs(o)),max:r(s,o)}}function Fe(t,e){return Object.assign(Object.create(t),e)}function ze(t,e,i){i=i||(i=>t[i]1)n=o+s>>1,i(n)?o=n:s=n;return{lo:o,hi:s}}const Ie=(t,e,i)=>ze(t,i,n=>t[n][e]ze(t,i,n=>t[n][e]>=i);function Be(t,e,i){let n=0,s=t.length;while(nn&&t[s-1]>i)s--;return n>0||s{const i="_onData"+T(e),n=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value(...e){const s=n.apply(this,e);return t._chartjs.listeners.forEach(t=>{"function"===typeof t[i]&&t[i](...e)}),s}})}))}function Ne(t,e){const i=t._chartjs;if(!i)return;const n=i.listeners,s=n.indexOf(e);-1!==s&&n.splice(s,1),n.length>0||(He.forEach(e=>{delete t[e]}),delete t._chartjs)}function $e(t){const e=new Set;let i,n;for(i=0,n=t.length;it[0])){L(n)||(n=ai("_fallback",t));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:i,_fallback:n,_getTarget:s,override:s=>Ue([s,...t],e,i,n)};return new Proxy(o,{deleteProperty(e,i){return delete e[i],delete e._keys,delete t[0][i],!0},get(i,n){return Qe(i,n,()=>ri(n,e,t,i))},getOwnPropertyDescriptor(t,e){return Reflect.getOwnPropertyDescriptor(t._scopes[0],e)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(t,e){return li(t).includes(e)},ownKeys(t){return li(t)},set(t,e,i){const n=t._storage||(t._storage=s());return t[e]=n[e]=i,delete t._keys,!0}})}function Ye(t,e,i,n){const s={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:Xe(t,n),setContext:e=>Ye(t,e,i,n),override:s=>Ye(t.override(s),e,i,n)};return new Proxy(s,{deleteProperty(e,i){return delete e[i],delete t[i],!0},get(t,e,i){return Qe(t,e,()=>Ge(t,e,i))},getOwnPropertyDescriptor(e,i){return e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i)},getPrototypeOf(){return Reflect.getPrototypeOf(t)},has(e,i){return Reflect.has(t,i)},ownKeys(){return Reflect.ownKeys(t)},set(e,i,n){return t[i]=n,delete e[i],!0}})}function Xe(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:n=e.indexable,_allKeys:s=e.allKeys}=t;return{allKeys:s,scriptable:i,indexable:n,isScriptable:E(i)?i:()=>i,isIndexable:E(n)?n:()=>n}}const qe=(t,e)=>t?t+T(e):e,Ke=(t,e)=>f(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function Qe(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];const n=i();return t[e]=n,n}function Ge(t,e,i){const{_proxy:n,_context:s,_subProxy:o,_descriptors:r}=t;let a=n[e];return E(a)&&r.isScriptable(e)&&(a=Je(e,a,t,i)),u(a)&&a.length&&(a=Ze(e,a,t,r.isIndexable)),Ke(e,a)&&(a=Ye(a,s,o&&o[e],r)),a}function Je(t,e,i,n){const{_proxy:s,_context:o,_subProxy:r,_stack:a}=i;if(a.has(t))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+t);return a.add(t),e=e(o,r||n),a.delete(t),Ke(t,e)&&(e=ni(s._scopes,s,t,e)),e}function Ze(t,e,i,n){const{_proxy:s,_context:o,_subProxy:r,_descriptors:a}=i;if(L(o.index)&&n(t))e=e[o.index%e.length];else if(f(e[0])){const i=e,n=s._scopes.filter(t=>t!==i);e=[];for(const l of i){const i=ni(n,s,t,l);e.push(Ye(i,o,r&&r[t],a))}}return e}function ti(t,e,i){return E(t)?t(e,i):t}const ei=(t,e)=>!0===t?e:"string"===typeof t?C(e,t):void 0;function ii(t,e,i,n,s){for(const o of e){const e=ei(i,o);if(e){t.add(e);const o=ti(e._fallback,i,s);if(L(o)&&o!==i&&o!==n)return o}else if(!1===e&&L(n)&&i!==n)return null}return!1}function ni(t,e,i,n){const s=e._rootScopes,o=ti(e._fallback,i,n),r=[...t,...s],a=new Set;a.add(n);let l=si(a,r,i,o||i,n);return null!==l&&((!L(o)||o===i||(l=si(a,r,o,l,n),null!==l))&&Ue(Array.from(a),[""],s,o,()=>oi(e,i,n)))}function si(t,e,i,n,s){while(i)i=ii(t,e,i,n,s);return i}function oi(t,e,i){const n=t._getTarget();e in n||(n[e]={});const s=n[e];return u(s)&&f(i)?i:s}function ri(t,e,i,n){let s;for(const o of e)if(s=ai(qe(o,t),i),L(s))return Ke(t,s)?ni(i,n,t,s):s}function ai(t,e){for(const i of e){if(!i)continue;const e=i[t];if(L(e))return e}}function li(t){let e=t._keys;return e||(e=t._keys=ci(t._scopes)),e}function ci(t){const e=new Set;for(const i of t)for(const t of Object.keys(i).filter(t=>!t.startsWith("_")))e.add(t);return Array.from(e)}const hi=Number.EPSILON||1e-14,di=(t,e)=>e"x"===t?"y":"x";function fi(t,e,i,n){const s=t.skip?e:t,o=e,r=i.skip?e:i,a=nt(o,s),l=nt(r,o);let c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const d=n*c,u=n*h;return{previous:{x:o.x-d*(r.x-s.x),y:o.y-d*(r.y-s.y)},next:{x:o.x+u*(r.x-s.x),y:o.y+u*(r.y-s.y)}}}function gi(t,e,i){const n=t.length;let s,o,r,a,l,c=di(t,0);for(let h=0;h!t.skip)),"monotone"===e.cubicInterpolationMode)pi(t,s);else{let i=n?t[t.length-1]:t[0];for(o=0,r=t.length;owindow.getComputedStyle(t,null);function ji(t,e){return wi(t).getPropertyValue(e)}const Mi=["top","right","bottom","left"];function ki(t,e,i){const n={};i=i?"-"+i:"";for(let s=0;s<4;s++){const o=Mi[s];n[o]=parseFloat(t[e+"-"+o+i])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}const Si=(t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot);function Di(t,e){const i=t.native||t,n=i.touches,s=n&&n.length?n[0]:i,{offsetX:o,offsetY:r}=s;let a,l,c=!1;if(Si(o,r,i.target))a=o,l=r;else{const t=e.getBoundingClientRect();a=s.clientX-t.left,l=s.clientY-t.top,c=!0}return{x:a,y:l,box:c}}function Pi(t,e){const{canvas:i,currentDevicePixelRatio:n}=e,s=wi(i),o="border-box"===s.boxSizing,r=ki(s,"padding"),a=ki(s,"border","width"),{x:l,y:c,box:h}=Di(t,i),d=r.left+(h&&a.left),u=r.top+(h&&a.top);let{width:f,height:g}=e;return o&&(f-=r.width+a.width,g-=r.height+a.height),{x:Math.round((l-d)/f*i.width/n),y:Math.round((c-u)/g*i.height/n)}}function Ai(t,e,i){let n,s;if(void 0===e||void 0===i){const o=vi(t);if(o){const t=o.getBoundingClientRect(),r=wi(o),a=ki(r,"border","width"),l=ki(r,"padding");e=t.width-l.width-a.width,i=t.height-l.height-a.height,n=Oi(r.maxWidth,o,"clientWidth"),s=Oi(r.maxHeight,o,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:n||B,maxHeight:s||B}}const Ci=t=>Math.round(10*t)/10;function Ti(t,e,i,n){const s=wi(t),o=ki(s,"margin"),r=Oi(s.maxWidth,t,"clientWidth")||B,a=Oi(s.maxHeight,t,"clientHeight")||B,l=Ai(t,e,i);let{width:c,height:h}=l;if("content-box"===s.boxSizing){const t=ki(s,"border","width"),e=ki(s,"padding");c-=e.width+t.width,h-=e.height+t.height}return c=Math.max(0,c-o.width),h=Math.max(0,n?Math.floor(c/n):h-o.height),c=Ci(Math.min(c,r,l.maxWidth)),h=Ci(Math.min(h,a,l.maxHeight)),c&&!h&&(h=Ci(c/2)),{width:c,height:h}}function Li(t,e,i){const n=e||1,s=Math.floor(t.height*n),o=Math.floor(t.width*n);t.height=s/n,t.width=o/n;const r=t.canvas;return r.style&&(i||!r.style.height&&!r.style.width)&&(r.style.height=t.height+"px",r.style.width=t.width+"px"),(t.currentDevicePixelRatio!==n||r.height!==s||r.width!==o)&&(t.currentDevicePixelRatio=n,r.height=s,r.width=o,t.ctx.setTransform(n,0,0,n,0,0),!0)}const Ei=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(e){}return t}();function Ri(t,e){const i=ji(t,e),n=i&&i.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function Fi(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function zi(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:"middle"===n?i<.5?t.y:e.y:"after"===n?i<1?t.y:e.y:i>0?e.y:t.y}}function Ii(t,e,i,n){const s={x:t.cp2x,y:t.cp2y},o={x:e.cp1x,y:e.cp1y},r=Fi(t,s,i),a=Fi(s,o,i),l=Fi(o,e,i),c=Fi(r,a,i),h=Fi(a,l,i);return Fi(c,h,i)}const Vi=new Map;function Bi(t,e){e=e||{};const i=t+JSON.stringify(e);let n=Vi.get(i);return n||(n=new Intl.NumberFormat(t,e),Vi.set(i,n)),n}function Hi(t,e,i){return Bi(e,i).format(t)}const Wi=function(t,e){return{x(i){return t+t+e-i},setWidth(t){e=t},textAlign(t){return"center"===t?t:"right"===t?"left":"right"},xPlus(t,e){return t-e},leftForLtr(t,e){return t-e}}},Ni=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,e){return t+e},leftForLtr(t,e){return t}}};function $i(t,e,i){return t?Wi(e,i):Ni()}function Ui(t,e){let i,n;"ltr"!==e&&"rtl"!==e||(i=t.canvas.style,n=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=n)}function Yi(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function Xi(t){return"angle"===t?{between:rt,compare:st,normalize:ot}:{between:ct,compare:(t,e)=>t-e,normalize:t=>t}}function qi({start:t,end:e,count:i,loop:n,style:s}){return{start:t%i,end:e%i,loop:n&&(e-t+1)%i===0,style:s}}function Ki(t,e,i){const{property:n,start:s,end:o}=i,{between:r,normalize:a}=Xi(n),l=e.length;let c,h,{start:d,end:u,loop:f}=t;if(f){for(d+=l,u+=l,c=0,h=l;cl(s,m,b)&&0!==a(s,m),v=()=>0===a(o,b)||l(o,m,b),O=()=>x||y(),w=()=>!x||v();for(let j=h,M=h;j<=d;++j)p=e[j%r],p.skip||(b=c(p[n]),b!==m&&(x=l(b,s,o),null===_&&O()&&(_=0===a(b,s)?j:M),null!==_&&w()&&(g.push(qi({start:_,end:j,loop:u,count:r,style:f})),_=null),M=j,m=b));return null!==_&&g.push(qi({start:_,end:d,loop:u,count:r,style:f})),g}function Gi(t,e){const i=[],n=t.segments;for(let s=0;ss&&t[o%e].skip)o--;return o%=e,{start:s,end:o}}function Zi(t,e,i,n){const s=t.length,o=[];let r,a=e,l=t[e];for(r=e+1;r<=i;++r){const i=t[r%s];i.skip||i.stop?l.skip||(n=!1,o.push({start:e%s,end:(r-1)%s,loop:n}),e=a=i.stop?r:null):(a=r,l.skip&&(e=r)),l=i}return null!==a&&o.push({start:e%s,end:a%s,loop:n}),o}function tn(t,e){const i=t.points,n=t.options.spanGaps,s=i.length;if(!s)return[];const o=!!t._loop,{start:r,end:a}=Ji(i,s,o,n);if(!0===n)return en(t,[{start:r,end:a,loop:o}],i,e);const l=a