n.length){for(l=0;l0&&e.stroke()}}function Js(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.xt.top-n&&e.y0&&o.strokeColor!=="";let l,c;for(e.save(),e.font=i.string,JB(e,o),l=0;l+e||0;function Xf(e,t){const n={},s=st(t),i=s?Object.keys(t):t,o=st(e)?s?r=>Ge(e[r],e[t[r]]):r=>e[r]:()=>e;for(const r of i)n[r]=n4(o(r));return n}function F0(e){return Xf(e,{top:"y",right:"x",bottom:"y",left:"x"})}function $o(e){return Xf(e,["topLeft","topRight","bottomLeft","bottomRight"])}function fn(e){const t=F0(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Ut(e,t){e=e||{},t=t||Et.font;let n=Ge(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let s=Ge(e.style,t.style);s&&!(""+s).match(e4)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);const i={family:Ge(e.family,t.family),lineHeight:t4(Ge(e.lineHeight,t.lineHeight),n),size:n,style:s,weight:Ge(e.weight,t.weight),string:""};return i.string=UB(i),i}function ca(e,t,n,s){let i=!0,o,r,a;for(o=0,r=e.length;on&&a===0?0:a+l;return{min:r(s,-Math.abs(o)),max:r(i,o)}}function Ki(e,t){return Object.assign(Object.create(e),t)}function Qf(e,t=[""],n,s,i=()=>e[0]){const o=n||e;typeof s>"u"&&(s=j0("_fallback",e));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:o,_fallback:s,_getTarget:i,override:a=>Qf([a,...e],t,o,s)};return new Proxy(r,{deleteProperty(a,l){return delete a[l],delete a._keys,delete e[0][l],!0},get(a,l){return V0(a,l,()=>d4(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return i_(a).includes(l)},ownKeys(a){return i_(a)},set(a,l,c){const u=a._storage||(a._storage=i());return a[l]=u[l]=c,delete a._keys,!0}})}function Tr(e,t,n,s){const i={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:B0(e,s),setContext:o=>Tr(e,o,n,s),override:o=>Tr(e.override(o),t,n,s)};return new Proxy(i,{deleteProperty(o,r){return delete o[r],delete e[r],!0},get(o,r,a){return V0(o,r,()=>o4(o,r,a))},getOwnPropertyDescriptor(o,r){return o._descriptors.allKeys?Reflect.has(e,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,r)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(o,r){return Reflect.has(e,r)},ownKeys(){return Reflect.ownKeys(e)},set(o,r,a){return e[r]=a,delete o[r],!0}})}function B0(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:s=t.indexable,_allKeys:i=t.allKeys}=e;return{allKeys:i,scriptable:n,indexable:s,isScriptable:Vi(n)?n:()=>n,isIndexable:Vi(s)?s:()=>s}}const i4=(e,t)=>e?e+Uf(t):t,Zf=(e,t)=>st(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function V0(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];const s=n();return e[t]=s,s}function o4(e,t,n){const{_proxy:s,_context:i,_subProxy:o,_descriptors:r}=e;let a=s[t];return Vi(a)&&r.isScriptable(t)&&(a=r4(t,a,e,n)),bt(a)&&a.length&&(a=a4(t,a,e,r.isIndexable)),Zf(t,a)&&(a=Tr(a,i,o&&o[t],r)),a}function r4(e,t,n,s){const{_proxy:i,_context:o,_subProxy:r,_stack:a}=n;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);a.add(e);let l=t(o,r||s);return a.delete(e),Zf(e,l)&&(l=ep(i._scopes,i,e,l)),l}function a4(e,t,n,s){const{_proxy:i,_context:o,_subProxy:r,_descriptors:a}=n;if(typeof o.index<"u"&&s(e))return t[o.index%t.length];if(st(t[0])){const l=t,c=i._scopes.filter(u=>u!==l);t=[];for(const u of l){const d=ep(c,i,e,u);t.push(Tr(d,o,r&&r[e],a))}}return t}function H0(e,t,n){return Vi(e)?e(t,n):e}const l4=(e,t)=>e===!0?t:typeof e=="string"?Bi(t,e):void 0;function c4(e,t,n,s,i){for(const o of t){const r=l4(n,o);if(r){e.add(r);const a=H0(r._fallback,n,i);if(typeof a<"u"&&a!==n&&a!==s)return a}else if(r===!1&&typeof s<"u"&&n!==s)return null}return!1}function ep(e,t,n,s){const i=t._rootScopes,o=H0(t._fallback,n,s),r=[...e,...i],a=new Set;a.add(s);let l=s_(a,r,n,o||n,s);return l===null||typeof o<"u"&&o!==n&&(l=s_(a,r,o,l,s),l===null)?!1:Qf(Array.from(a),[""],i,o,()=>u4(t,n,s))}function s_(e,t,n,s,i){for(;n;)n=c4(e,t,n,s,i);return n}function u4(e,t,n){const s=e._getTarget();t in s||(s[t]={});const i=s[t];return bt(i)&&st(n)?n:i||{}}function d4(e,t,n,s){let i;for(const o of t)if(i=j0(i4(o,e),n),typeof i<"u")return Zf(e,i)?ep(n,s,e,i):i}function j0(e,t){for(const n of t){if(!n)continue;const s=n[e];if(typeof s<"u")return s}}function i_(e){let t=e._keys;return t||(t=e._keys=h4(e._scopes)),t}function h4(e){const t=new Set;for(const n of e)for(const s of Object.keys(n).filter(i=>!i.startsWith("_")))t.add(s);return Array.from(t)}function W0(e,t,n,s){const{iScale:i}=e,{key:o="r"}=this._parsing,r=new Array(s);let a,l,c,u;for(a=0,l=s;ate==="x"?"y":"x";function p4(e,t,n,s){const i=e.skip?t:e,o=t,r=n.skip?t:n,a=ch(o,i),l=ch(r,o);let c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const d=s*c,f=s*u;return{previous:{x:o.x-d*(r.x-i.x),y:o.y-d*(r.y-i.y)},next:{x:o.x+f*(r.x-i.x),y:o.y+f*(r.y-i.y)}}}function m4(e,t,n){const s=e.length;let i,o,r,a,l,c=Mr(e,0);for(let u=0;u!c.skip)),t.cubicInterpolationMode==="monotone")_4(e,i);else{let c=s?e[e.length-1]:e[0];for(o=0,r=e.length;oe.ownerDocument.defaultView.getComputedStyle(e,null);function y4(e,t){return wu(e).getPropertyValue(t)}const w4=["top","right","bottom","left"];function Ao(e,t,n){const s={};n=n?"-"+n:"";for(let i=0;i<4;i++){const o=w4[i];s[o]=parseFloat(e[t+"-"+o+n])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}const x4=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function k4(e,t){const n=e.touches,s=n&&n.length?n[0]:e,{offsetX:i,offsetY:o}=s;let r=!1,a,l;if(x4(i,o,e.target))a=i,l=o;else{const c=t.getBoundingClientRect();a=s.clientX-c.left,l=s.clientY-c.top,r=!0}return{x:a,y:l,box:r}}function po(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:s}=t,i=wu(n),o=i.boxSizing==="border-box",r=Ao(i,"padding"),a=Ao(i,"border","width"),{x:l,y:c,box:u}=k4(e,n),d=r.left+(u&&a.left),f=r.top+(u&&a.top);let{width:p,height:g}=t;return o&&(p-=r.width+a.width,g-=r.height+a.height),{x:Math.round((l-d)/p*n.width/s),y:Math.round((c-f)/g*n.height/s)}}function S4(e,t,n){let s,i;if(t===void 0||n===void 0){const o=np(e);if(!o)t=e.clientWidth,n=e.clientHeight;else{const r=o.getBoundingClientRect(),a=wu(o),l=Ao(a,"border","width"),c=Ao(a,"padding");t=r.width-c.width-l.width,n=r.height-c.height-l.height,s=Bc(a.maxWidth,o,"clientWidth"),i=Bc(a.maxHeight,o,"clientHeight")}}return{width:t,height:n,maxWidth:s||Nc,maxHeight:i||Nc}}const Ul=e=>Math.round(e*10)/10;function $4(e,t,n,s){const i=wu(e),o=Ao(i,"margin"),r=Bc(i.maxWidth,e,"clientWidth")||Nc,a=Bc(i.maxHeight,e,"clientHeight")||Nc,l=S4(e,t,n);let{width:c,height:u}=l;if(i.boxSizing==="content-box"){const f=Ao(i,"border","width"),p=Ao(i,"padding");c-=p.width+f.width,u-=p.height+f.height}return c=Math.max(0,c-o.width),u=Math.max(0,s?c/s:u-o.height),c=Ul(Math.min(c,r,l.maxWidth)),u=Ul(Math.min(u,a,l.maxHeight)),c&&!u&&(u=Ul(c/2)),(t!==void 0||n!==void 0)&&s&&l.height&&u>l.height&&(u=l.height,c=Ul(Math.floor(u*s))),{width:c,height:u}}function o_(e,t,n){const s=t||1,i=Math.floor(e.height*s),o=Math.floor(e.width*s);e.height=Math.floor(e.height),e.width=Math.floor(e.width);const r=e.canvas;return r.style&&(n||!r.style.height&&!r.style.width)&&(r.style.height=`${e.height}px`,r.style.width=`${e.width}px`),e.currentDevicePixelRatio!==s||r.height!==i||r.width!==o?(e.currentDevicePixelRatio=s,r.height=i,r.width=o,e.ctx.setTransform(s,0,0,s,0,0),!0):!1}const A4=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};tp()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function r_(e,t){const n=y4(e,t),s=n&&n.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function mo(e,t,n,s){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function C4(e,t,n,s){return{x:e.x+n*(t.x-e.x),y:s==="middle"?n<.5?e.y:t.y:s==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function E4(e,t,n,s){const i={x:e.cp2x,y:e.cp2y},o={x:t.cp1x,y:t.cp1y},r=mo(e,i,n),a=mo(i,o,n),l=mo(o,t,n),c=mo(r,a,n),u=mo(a,l,n);return mo(c,u,n)}const P4=function(e,t){return{x(n){return e+e+t-n},setWidth(n){t=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,s){return n-s},leftForLtr(n,s){return n-s}}},T4=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function dr(e,t,n){return e?P4(t,n):T4()}function Y0(e,t){let n,s;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,s=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=s)}function U0(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function K0(e){return e==="angle"?{between:Ga,compare:MB,normalize:Dn}:{between:qs,compare:(t,n)=>t-n,normalize:t=>t}}function a_({start:e,end:t,count:n,loop:s,style:i}){return{start:e%n,end:t%n,loop:s&&(t-e+1)%n===0,style:i}}function M4(e,t,n){const{property:s,start:i,end:o}=n,{between:r,normalize:a}=K0(s),l=t.length;let{start:c,end:u,loop:d}=e,f,p;if(d){for(c+=l,u+=l,f=0,p=l;fl(i,A,w)&&a(i,A)!==0,k=()=>a(o,w)===0||l(o,A,w),y=()=>_||M(),x=()=>!_||k();for(let C=u,P=u;C<=d;++C)$=t[C%r],!$.skip&&(w=c($[s]),w!==A&&(_=l(w,i,o),b===null&&y()&&(b=a(w,i)===0?C:P),b!==null&&x()&&(g.push(a_({start:b,end:C,loop:f,count:r,style:p})),b=null),P=C,A=w));return b!==null&&g.push(a_({start:b,end:d,loop:f,count:r,style:p})),g}function G0(e,t){const n=[],s=e.segments;for(let i=0;ii&&e[o%t].skip;)o--;return o%=t,{start:i,end:o}}function O4(e,t,n,s){const i=e.length,o=[];let r=t,a=e[t],l;for(l=t+1;l<=n;++l){const c=e[l%i];c.skip||c.stop?a.skip||(s=!1,o.push({start:t%i,end:(l-1)%i,loop:s}),t=r=c.stop?l:null):(r=l,a.skip&&(t=l)),a=c}return r!==null&&o.push({start:t%i,end:r%i,loop:s}),o}function I4(e,t){const n=e.points,s=e.options.spanGaps,i=n.length;if(!i)return[];const o=!!e._loop,{start:r,end:a}=D4(n,i,o,s);if(s===!0)return l_(e,[{start:r,end:a,loop:o}],n,t);const l=aa({chart:t,initial:n.initial,numSteps:r,currentStep:Math.min(s-n.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=D0.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((s,i)=>{if(!s.running||!s.items.length)return;const o=s.items;let r=o.length-1,a=!1,l;for(;r>=0;--r)l=o[r],l._active?(l._total>s.duration&&(s.duration=l._total),l.tick(t),a=!0):(o[r]=o[o.length-1],o.pop());a&&(i.draw(),this._notify(i,s,t,"progress")),o.length||(s.running=!1,this._notify(i,s,t,"complete"),s.initial=!1),n+=o.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let s=n.get(t);return s||(s={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,s)),s}listen(t,n,s){this._getAnims(t).listeners[n].push(s)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((s,i)=>Math.max(s,i._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const s=n.items;let i=s.length-1;for(;i>=0;--i)s[i].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Hs=new A4;const u_="transparent",$4={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const s=e_(e||u_),i=s.valid&&e_(t||u_);return i&&i.valid?i.mix(s,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class C4{constructor(t,n,s,i){const o=n[s];i=ca([t.to,i,o,t.from]);const r=ca([t.from,o,i]);this._active=!0,this._fn=t.fn||$4[t.type||typeof r],this._easing=Ea[t.easing]||Ea.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=s,this._from=r,this._to=i,this._promises=void 0}active(){return this._active}update(t,n,s){if(this._active){this._notify(!1);const i=this._target[this._prop],o=s-this._start,r=this._duration-o;this._start=s,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=ca([t.to,n,i,t.from]),this._from=ca([t.from,i,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,s=this._duration,i=this._prop,o=this._from,r=this._loop,a=this._to;let l;if(this._active=o!==a&&(r||n1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[i]=this._fn(o,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,s)=>{t.push({res:n,rej:s})})}_notify(t){const n=t?"res":"rej",s=this._promises||[];for(let i=0;i{const o=t[i];if(!st(o))return;const r={};for(const a of n)r[a]=o[a];(bt(o.properties)&&o.properties||[i]).forEach(a=>{(a===i||!s.has(a))&&s.set(a,r)})})}_animateOptions(t,n){const s=n.options,i=P4(t,s);if(!i)return[];const o=this._createAnimations(i,s);return s.$shared&&E4(t.options.$animations,s).then(()=>{t.options=s},()=>{}),o}_createAnimations(t,n){const s=this._properties,i=[],o=t.$animations||(t.$animations={}),r=Object.keys(n),a=Date.now();let l;for(l=r.length-1;l>=0;--l){const c=r[l];if(c.charAt(0)==="$")continue;if(c==="options"){i.push(...this._animateOptions(t,n));continue}const u=n[c];let d=o[c];const f=s.get(c);if(d)if(f&&d.active()){d.update(f,u,a);continue}else d.cancel();if(!f||!f.duration){t[c]=u;continue}o[c]=d=new C4(f,t,c,u),i.push(d)}return i}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const s=this._createAnimations(t,n);if(s.length)return Hs.add(this._chart,s),!0}}function E4(e,t){const n=[],s=Object.keys(t);for(let i=0;i0||!n&&o<0)return i.index}return null}function g_(e,t){const{chart:n,_cachedMeta:s}=e,i=n._stacks||(n._stacks={}),{iScale:o,vScale:r,index:a}=s,l=o.axis,c=r.axis,u=O4(o,r,s),d=t.length;let f;for(let p=0;pn[s].axis===t).shift()}function L4(e,t){return Ki(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function N4(e,t,n){return Ki(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function ta(e,t){const n=e.controller.index,s=e.vScale&&e.vScale.axis;if(s){t=t||e._parsed;for(const i of t){const o=i._stacks;if(!o||o[s]===void 0||o[s][n]===void 0)return;delete o[s][n],o[s]._visualValues!==void 0&&o[s]._visualValues[n]!==void 0&&delete o[s]._visualValues[n]}}}const yd=e=>e==="reset"||e==="none",m_=(e,t)=>t?e:Object.assign({},e),F4=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:X0(n,!0),values:null};class us{constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=f_(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&ta(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,s=this.getDataset(),i=(d,f,p,m)=>d==="x"?f:d==="r"?m:p,o=n.xAxisID=Ge(s.xAxisID,bd(t,"x")),r=n.yAxisID=Ge(s.yAxisID,bd(t,"y")),a=n.rAxisID=Ge(s.rAxisID,bd(t,"r")),l=n.indexAxis,c=n.iAxisID=i(l,o,r,a),u=n.vAxisID=i(l,r,o,a);n.xScale=this.getScaleForId(o),n.yScale=this.getScaleForId(r),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(u)}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 n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Xm(this._data,this),t._stacked&&ta(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),s=this._data;if(st(n))this._data=D4(n);else if(s!==n){if(s){Xm(s,this);const i=this._cachedMeta;ta(i),i._parsed=[]}n&&Object.isExtensible(n)&&kB(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,s=this.getDataset();let i=!1;this._dataCheck();const o=n._stacked;n._stacked=f_(n.vScale,n),n.stack!==s.stack&&(i=!0,ta(n),n.stack=s.stack),this._resyncElements(t),(i||o!==n._stacked)&&g_(this,n._parsed)}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),s=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(s,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:s,_data:i}=this,{iScale:o,_stacked:r}=s,a=o.axis;let l=t===0&&n===i.length?!0:s._sorted,c=t>0&&s._parsed[t-1],u,d,f;if(this._parsing===!1)s._parsed=i,s._sorted=!0,f=i;else{bt(i[t])?f=this.parseArrayData(s,i,t,n):st(i[t])?f=this.parseObjectData(s,i,t,n):f=this.parsePrimitiveData(s,i,t,n);const p=()=>d[a]===null||c&&d[a]_||d<_}for(f=0;f=0;--f)if(!m()){this.updateRangeFromParsed(c,t,p,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,s=[];let i,o,r;for(i=0,o=n.length;i=0&&tthis.getContext(s,i,n),_=c.resolveNamedOptions(f,p,m,d);return _.$shared&&(_.$shared=l,o[r]=Object.freeze(m_(_,l))),_}_resolveAnimations(t,n,s){const i=this.chart,o=this._cachedDataOpts,r=`animation-${n}`,a=o[r];if(a)return a;let l;if(i.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,n),f=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(f,this.getContext(t,s,n))}const c=new J0(i,l&&l.animations);return l&&l._cacheable&&(o[r]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||yd(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const s=this.resolveDataElementOptions(t,n),i=this._sharedOptions,o=this.getSharedOptions(s),r=this.includeOptions(n,o)||o!==i;return this.updateSharedOptions(o,n,s),{sharedOptions:o,includeOptions:r}}updateElement(t,n,s,i){yd(i)?Object.assign(t,s):this._resolveAnimations(n,i).update(t,s)}updateSharedOptions(t,n,s){t&&!yd(n)&&this._resolveAnimations(void 0,n).update(t,s)}_setStyle(t,n,s,i){t.active=i;const o=this.getStyle(n,i);this._resolveAnimations(n,s,i).update(t,{options:!i&&this.getSharedOptions(o)||o})}removeHoverStyle(t,n,s){this._setStyle(t,s,"active",!1)}setHoverStyle(t,n,s){this._setStyle(t,s,"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 n=this._data,s=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const i=s.length,o=n.length,r=Math.min(o,i);r&&this.parse(0,r),o>i?this._insertElements(i,o-i,t):o{for(c.length+=n,a=c.length-1;a>=r;a--)c[a]=c[a-n]};for(l(o),a=t;ai-o))}return e._cache.$bar}function V4(e){const t=e.iScale,n=B4(t,e.type);let s=t._length,i,o,r,a;const l=()=>{r===32767||r===-32768||(qa(a)&&(s=Math.min(s,Math.abs(r-a)||s)),a=r)};for(i=0,o=n.length;i0?i[e-1]:null,a=eMath.abs(a)&&(l=a,c=r),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:i,end:o,min:r,max:a}}function Q0(e,t,n,s){return bt(e)?W4(e,t,n,s):t[n.axis]=n.parse(e,s),t}function __(e,t,n,s){const i=e.iScale,o=e.vScale,r=i.getLabels(),a=i===o,l=[];let c,u,d,f;for(c=n,u=n+s;c=n?1:-1)}function Y4(e){let t,n,s,i,o;return e.horizontal?(t=e.base>e.x,n="left",s="right"):(t=e.basel.controller.options.grouped),o=s.options.stacked,r=[],a=l=>{const c=l.controller.getParsed(n),u=c&&c[l.vScale.axis];if(ot(u)||isNaN(u))return!0};for(const l of i)if(!(n!==void 0&&a(l))&&((o===!1||r.indexOf(l.stack)===-1||o===void 0&&l.stack===void 0)&&r.push(l.stack),l.index===t))break;return r.length||r.push(void 0),r}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,n,s){const i=this._getStacks(t,s),o=n!==void 0?i.indexOf(n):-1;return o===-1?i.length-1:o}_getRuler(){const t=this.options,n=this._cachedMeta,s=n.iScale,i=[];let o,r;for(o=0,r=n.data.length;o=0;--s)n=Math.max(n,t[s].size(this.resolveDataElementOptions(s))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,s=this.chart.data.labels||[],{xScale:i,yScale:o}=n,r=this.getParsed(t),a=i.getLabelForValue(r.x),l=o.getLabelForValue(r.y),c=r._custom;return{label:s[t]||"",value:"("+a+", "+l+(c?", "+c:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,s,i){const o=i==="reset",{iScale:r,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(n,i),u=r.axis,d=a.axis;for(let f=n;fGa($,a,l,!0)?1:Math.max(M,M*n,k,k*n),m=($,M,k)=>Ga($,a,l,!0)?-1:Math.min(M,M*n,k,k*n),_=p(0,c,d),b=p(Rt,u,f),w=m(wt,c,d),A=m(wt+Rt,u,f);s=(_-w)/2,i=(b-A)/2,o=-(_+w)/2,r=-(b+A)/2}return{ratioX:s,ratioY:i,offsetX:o,offsetY:r}}class or extends us{constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const s=this.getDataset().data,i=this._cachedMeta;if(this._parsing===!1)i._parsed=s;else{let o=l=>+s[l];if(st(s[t])){const{key:l="value"}=this._parsing;o=c=>+Bi(s[c],l)}let r,a;for(r=t,a=t+n;r0&&!isNaN(t)?yt*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,s=this.chart,i=s.data.labels||[],o=dl(n._parsed[t],s.options.locale);return{label:i[t]||"",value:o}}getMaxBorderWidth(t){let n=0;const s=this.chart;let i,o,r,a,l;if(!t){for(i=0,o=s.data.datasets.length;it!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),le(or,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:s,color:i}}=t.legend.options;return n.labels.map((o,r)=>{const l=t.getDatasetMeta(0).controller.getStyle(r);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:i,lineWidth:l.borderWidth,pointStyle:s,hidden:!t.getDataVisibility(r),index:r}})}return[]}},onClick(t,n,s){s.chart.toggleDataVisibility(n.index),s.chart.update()}}}});class Ma extends us{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:s,data:i=[],_dataset:o}=n,r=this.chart._animationsDisabled;let{start:a,count:l}=I0(n,i,r);this._drawStart=a,this._drawCount=l,R0(n)&&(a=0,l=i.length),s._chart=this.chart,s._datasetIndex=this.index,s._decimated=!!o._decimated,s.points=i;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(s,void 0,{animated:!r,options:c},t),this.updateElements(i,a,l,t)}updateElements(t,n,s,i){const o=i==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(n,i),f=r.axis,p=a.axis,{spanGaps:m,segment:_}=this.options,b=Pr(m)?m:Number.POSITIVE_INFINITY,w=this.chart._animationsDisabled||o||i==="none",A=n+s,$=t.length;let M=n>0&&this.getParsed(n-1);for(let k=0;k<$;++k){const y=t[k],x=w?y:{};if(k=A){x.skip=!0;continue}const C=this.getParsed(k),P=ot(C[p]),E=x[f]=r.getPixelForValue(C[f],k),B=x[p]=o||P?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,C,l):C[p],k);x.skip=isNaN(E)||isNaN(B)||P,x.stop=k>0&&Math.abs(C[f]-M[f])>b,_&&(x.parsed=C,x.raw=c.data[k]),d&&(x.options=u||this.resolveDataElementOptions(k,y.active?"active":i)),w||this.updateElement(y,k,x,i),M=C}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,s=n.options&&n.options.borderWidth||0,i=t.data||[];if(!i.length)return s;const o=i[0].size(this.resolveDataElementOptions(0)),r=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(s,o,r)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}le(Ma,"id","line"),le(Ma,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),le(Ma,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class gc extends us{constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,s=this.chart,i=s.data.labels||[],o=dl(n._parsed[t].r,s.options.locale);return{label:i[t]||"",value:o}}parseObjectData(t,n,s,i){return W0.bind(this)(t,n,s,i)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((s,i)=>{const o=this.getParsed(i).r;!isNaN(o)&&this.chart.getDataVisibility(i)&&(on.max&&(n.max=o))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,s=t.options,i=Math.min(n.right-n.left,n.bottom-n.top),o=Math.max(i/2,0),r=Math.max(s.cutoutPercentage?o/100*s.cutoutPercentage:1,0),a=(o-r)/t.getVisibleDatasetCount();this.outerRadius=o-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,n,s,i){const o=i==="reset",r=this.chart,l=r.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,d=c.yCenter,f=c.getIndexAngle(0)-.5*wt;let p=f,m;const _=360/this.countVisibleElements();for(m=0;m{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&n++}),n}_computeAngle(t,n,s){return this.chart.getDataVisibility(t)?as(this.resolveDataElementOptions(t,n).angle||s):0}}le(gc,"id","polarArea"),le(gc,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),le(gc,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:s,color:i}}=t.legend.options;return n.labels.map((o,r)=>{const l=t.getDatasetMeta(0).controller.getStyle(r);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:i,lineWidth:l.borderWidth,pointStyle:s,hidden:!t.getDataVisibility(r),index:r}})}return[]}},onClick(t,n,s){s.chart.toggleDataVisibility(n.index),s.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class hh extends or{}le(hh,"id","pie"),le(hh,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class mc extends us{getLabelAndValue(t){const n=this._cachedMeta.vScale,s=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(s[n.axis])}}parseObjectData(t,n,s,i){return W0.bind(this)(t,n,s,i)}update(t){const n=this._cachedMeta,s=n.dataset,i=n.data||[],o=n.iScale.getLabels();if(s.points=i,t!=="resize"){const r=this.resolveDatasetElementOptions(t);this.options.showLine||(r.borderWidth=0);const a={_loop:!0,_fullLoop:o.length===i.length,options:r};this.updateElement(s,void 0,a,t)}this.updateElements(i,0,i.length,t)}updateElements(t,n,s,i){const o=this._cachedMeta.rScale,r=i==="reset";for(let a=n;a0&&this.getParsed(n-1);for(let M=n;M0&&Math.abs(y[p]-$[p])>w,b&&(x.parsed=y,x.raw=c.data[M]),f&&(x.options=d||this.resolveDataElementOptions(M,k.active?"active":i)),A||this.updateElement(k,M,x,i),$=y}this.updateSharedOptions(d,i,u)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let a=0;for(let l=n.length-1;l>=0;--l)a=Math.max(a,n[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const s=t.dataset,i=s.options&&s.options.borderWidth||0;if(!n.length)return i;const o=n[0].size(this.resolveDataElementOptions(0)),r=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,o,r)/2}}le(_c,"id","scatter"),le(_c,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),le(_c,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});function co(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class sp{constructor(t){le(this,"options");this.options=t||{}}static override(t){Object.assign(sp.prototype,t)}init(){}formats(){return co()}parse(){return co()}format(){return co()}add(){return co()}diff(){return co()}startOf(){return co()}endOf(){return co()}}var J4={_date:sp};function X4(e,t,n,s){const{controller:i,data:o,_sorted:r}=e,a=i._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&r&&o.length){const l=a._reversePixels?wB:Gs;if(s){if(i._sharedOptions){const c=o[0],u=typeof c.getRange=="function"&&c.getRange(t);if(u){const d=l(o,t,n-u),f=l(o,t,n+u);return{lo:d.lo,hi:f.hi}}}}else return l(o,t,n)}return{lo:0,hi:o.length-1}}function hl(e,t,n,s,i){const o=e.getSortedVisibleDatasetMetas(),r=n[t];for(let a=0,l=o.length;a{l[r](t[n],i)&&(o.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,i))}),s&&!a?[]:o}var tV={evaluateInteractionItems:hl,modes:{index(e,t,n,s){const i=po(t,e),o=n.axis||"x",r=n.includeInvisible||!1,a=n.intersect?xd(e,i,o,s,r):kd(e,i,o,!1,s,r),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(e,t,n,s){const i=po(t,e),o=n.axis||"xy",r=n.includeInvisible||!1;let a=n.intersect?xd(e,i,o,s,r):kd(e,i,o,!1,s,r);if(a.length>0){const l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let u=0;un.pos===t)}function w_(e,t){return e.filter(n=>Z0.indexOf(n.pos)===-1&&n.box.axis===t)}function sa(e,t){return e.sort((n,s)=>{const i=t?s:n,o=t?n:s;return i.weight===o.weight?i.index-o.index:i.weight-o.weight})}function nV(e){const t=[];let n,s,i,o,r,a;for(n=0,s=(e||[]).length;nc.box.fullSize),!0),s=sa(na(t,"left"),!0),i=sa(na(t,"right")),o=sa(na(t,"top"),!0),r=sa(na(t,"bottom")),a=w_(t,"x"),l=w_(t,"y");return{fullSize:n,leftAndTop:s.concat(o),rightAndBottom:i.concat(l).concat(r).concat(a),chartArea:na(t,"chartArea"),vertical:s.concat(i).concat(l),horizontal:o.concat(r).concat(a)}}function x_(e,t,n,s){return Math.max(e[n],t[n])+Math.max(e[s],t[s])}function e1(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function rV(e,t,n,s){const{pos:i,box:o}=n,r=e.maxPadding;if(!st(i)){n.size&&(e[i]-=n.size);const d=s[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?o.height:o.width),n.size=d.size/d.count,e[i]+=n.size}o.getPadding&&e1(r,o.getPadding());const a=Math.max(0,t.outerWidth-x_(r,e,"left","right")),l=Math.max(0,t.outerHeight-x_(r,e,"top","bottom")),c=a!==e.w,u=l!==e.h;return e.w=a,e.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function aV(e){const t=e.maxPadding;function n(s){const i=Math.max(t[s]-e[s],0);return e[s]+=i,i}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function lV(e,t){const n=t.maxPadding;function s(i){const o={left:0,top:0,right:0,bottom:0};return i.forEach(r=>{o[r]=Math.max(t[r],n[r])}),o}return s(e?["left","right"]:["top","bottom"])}function ua(e,t,n,s){const i=[];let o,r,a,l,c,u;for(o=0,r=e.length,c=0;o{typeof _.beforeLayout=="function"&&_.beforeLayout()});const u=l.reduce((_,b)=>b.box.options&&b.box.options.display===!1?_:_+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/u,hBoxMaxHeight:r/2}),f=Object.assign({},i);e1(f,fn(s));const p=Object.assign({maxPadding:f,w:o,h:r,x:i.left,y:i.top},i),m=iV(l.concat(c),d);ua(a.fullSize,p,d,m),ua(l,p,d,m),ua(c,p,d,m)&&ua(l,p,d,m),aV(p),k_(a.leftAndTop,p,d,m),p.x+=p.w,p.y+=p.h,k_(a.rightAndBottom,p,d,m),e.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},ut(a.chartArea,_=>{const b=_.box;Object.assign(b,e.chartArea),b.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}};class t1{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,s){}removeEventListener(t,n,s){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,s,i){return n=Math.max(0,n||t.width),s=s||t.height,{width:n,height:Math.max(0,i?Math.floor(n/i):s)}}isAttached(t){return!0}updateConfig(t){}}class cV extends t1{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const vc="$chartjs",uV={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},S_=e=>e===null||e==="";function dV(e,t){const n=e.style,s=e.getAttribute("height"),i=e.getAttribute("width");if(e[vc]={initial:{height:s,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",S_(i)){const o=r_(e,"width");o!==void 0&&(e.width=o)}if(S_(s))if(e.style.height==="")e.height=e.width/(t||2);else{const o=r_(e,"height");o!==void 0&&(e.height=o)}return e}const n1=p4?{passive:!0}:!1;function hV(e,t,n){e.addEventListener(t,n,n1)}function fV(e,t,n){e.canvas.removeEventListener(t,n,n1)}function pV(e,t){const n=uV[e.type]||e.type,{x:s,y:i}=po(e,t);return{type:n,chart:t,native:e,x:s!==void 0?s:null,y:i!==void 0?i:null}}function Vc(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function gV(e,t,n){const s=e.canvas,i=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||Vc(a.addedNodes,s),r=r&&!Vc(a.removedNodes,s);r&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function mV(e,t,n){const s=e.canvas,i=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||Vc(a.removedNodes,s),r=r&&!Vc(a.addedNodes,s);r&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const Xa=new Map;let A_=0;function s1(){const e=window.devicePixelRatio;e!==A_&&(A_=e,Xa.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function _V(e,t){Xa.size||window.addEventListener("resize",s1),Xa.set(e,t)}function vV(e){Xa.delete(e),Xa.size||window.removeEventListener("resize",s1)}function bV(e,t,n){const s=e.canvas,i=s&&np(s);if(!i)return;const o=O0((a,l)=>{const c=i.clientWidth;n(a,l),c{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||o(c,u)});return r.observe(i),_V(e,o),r}function Sd(e,t,n){n&&n.disconnect(),t==="resize"&&vV(e)}function yV(e,t,n){const s=e.canvas,i=O0(o=>{e.ctx!==null&&n(pV(o,e))},e);return hV(s,t,i),i}class wV extends t1{acquireContext(t,n){const s=t&&t.getContext&&t.getContext("2d");return s&&s.canvas===t?(dV(t,n),s):null}releaseContext(t){const n=t.canvas;if(!n[vc])return!1;const s=n[vc].initial;["height","width"].forEach(o=>{const r=s[o];ot(r)?n.removeAttribute(o):n.setAttribute(o,r)});const i=s.style||{};return Object.keys(i).forEach(o=>{n.style[o]=i[o]}),n.width=n.width,delete n[vc],!0}addEventListener(t,n,s){this.removeEventListener(t,n);const i=t.$proxies||(t.$proxies={}),r={attach:gV,detach:mV,resize:bV}[n]||yV;i[n]=r(t,n,s)}removeEventListener(t,n){const s=t.$proxies||(t.$proxies={}),i=s[n];if(!i)return;({attach:Sd,detach:Sd,resize:Sd}[n]||fV)(t,n,i),s[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,s,i){return f4(t,n,s,i)}isAttached(t){const n=np(t);return!!(n&&n.isConnected)}}function xV(e){return!tp()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?cV:wV}var sc;let ri=(sc=class{constructor(){le(this,"x");le(this,"y");le(this,"active",!1);le(this,"options");le(this,"$animations")}tooltipPosition(t){const{x:n,y:s}=this.getProps(["x","y"],t);return{x:n,y:s}}hasValue(){return Pr(this.x)&&Pr(this.y)}getProps(t,n){const s=this.$animations;if(!n||!s)return this;const i={};return t.forEach(o=>{i[o]=s[o]&&s[o].active()?s[o]._to:this[o]}),i}},le(sc,"defaults",{}),le(sc,"defaultRoutes"),sc);function kV(e,t){const n=e.options.ticks,s=SV(e),i=Math.min(n.maxTicksLimit||s,s),o=n.major.enabled?$V(t):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>i)return CV(t,c,o,r/i),c;const u=AV(o,t,i);if(r>0){let d,f;const p=r>1?Math.round((l-a)/(r-1)):null;for(ql(t,c,u,ot(p)?0:a-p,a),d=0,f=r-1;di)return l}return Math.max(i,1)}function $V(e){const t=[];let n,s;for(n=0,s=e.length;ne==="left"?"right":e==="right"?"left":e,$_=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,C_=(e,t)=>Math.min(t||e,e);function E_(e,t){const n=[],s=e.length/t,i=e.length;let o=0;for(;or+a)))return l}function MV(e,t){ut(e,n=>{const s=n.gc,i=s.length/2;let o;if(i>t){for(o=0;os?s:n,s=i&&n>s?n:s,{min:Tn(n,Tn(s,n)),max:Tn(s,Tn(n,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||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){pt(this.options.beforeUpdate,[this])}update(t,n,s){const{beginAtZero:i,grace:o,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=s=Object.assign({left:0,right:0,top:0,bottom:0},s),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+s.left+s.right:this.height+s.top+s.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=YB(this,o,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a=o||s<=1||!this.isHorizontal()){this.labelRotation=i;return}const u=this._getLabelSizes(),d=u.widest.width,f=u.highest.height,p=en(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/s:p/(s-1),d+6>a&&(a=p/(s-(t.offset?.5:1)),l=this.maxHeight-ia(t.grid)-n.padding-P_(t.title,this.chart.options.font),c=Math.sqrt(d*d+f*f),r=Kf(Math.min(Math.asin(en((u.highest.height+6)/a,-1,1)),Math.asin(en(l/c,-1,1))-Math.asin(en(f/c,-1,1)))),r=Math.max(i,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){pt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){pt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:s,title:i,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){const l=P_(i,n.options.font);if(a?(t.width=this.maxWidth,t.height=ia(o)+l):(t.height=this.maxHeight,t.width=ia(o)+l),s.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:f}=this._getLabelSizes(),p=s.padding*2,m=as(this.labelRotation),_=Math.cos(m),b=Math.sin(m);if(a){const w=s.mirror?0:b*d.width+_*f.height;t.height=Math.min(this.maxHeight,t.height+w+p)}else{const w=s.mirror?0:_*d.width+b*f.height;t.width=Math.min(this.maxWidth,t.width+w+p)}this._calculatePadding(c,u,b,_)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,s,i){const{ticks:{align:o,padding:r},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,p=0;l?c?(f=i*t.width,p=s*n.height):(f=s*t.height,p=i*n.width):o==="start"?p=n.width:o==="end"?f=t.width:o!=="inner"&&(f=t.width/2,p=n.width/2),this.paddingLeft=Math.max((f-u+r)*this.width/(this.width-u),0),this.paddingRight=Math.max((p-d+r)*this.width/(this.width-d),0)}else{let u=n.height/2,d=t.height/2;o==="start"?(u=0,d=t.height):o==="end"&&(u=n.height,d=0),this.paddingTop=u+r,this.paddingBottom=d+r}}_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(){pt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,s;for(n=0,s=t.length;n({width:r[P]||0,height:a[P]||0});return{first:C(0),last:C(n-1),widest:C(y),highest:C(x),widths:r,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return yB(this._alignToPixels?lo(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&ta*i?a/s:l/i:l*i0}_computeGridLineItems(t){const n=this.axis,s=this.chart,i=this.options,{grid:o,position:r,border:a}=i,l=o.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),f=ia(o),p=[],m=a.setContext(this.getContext()),_=m.display?m.width:0,b=_/2,w=function(I){return lo(s,I,_)};let A,$,M,k,y,x,C,P,E,B,G,re;if(r==="top")A=w(this.bottom),x=this.bottom-f,P=A-b,B=w(t.top)+b,re=t.bottom;else if(r==="bottom")A=w(this.top),B=t.top,re=w(t.bottom)-b,x=A+b,P=this.top+f;else if(r==="left")A=w(this.right),y=this.right-f,C=A-b,E=w(t.left)+b,G=t.right;else if(r==="right")A=w(this.left),E=t.left,G=w(t.right)-b,y=A+b,C=this.left+f;else if(n==="x"){if(r==="center")A=w((t.top+t.bottom)/2+.5);else if(st(r)){const I=Object.keys(r)[0],V=r[I];A=w(this.chart.scales[I].getPixelForValue(V))}B=t.top,re=t.bottom,x=A+b,P=x+f}else if(n==="y"){if(r==="center")A=w((t.left+t.right)/2);else if(st(r)){const I=Object.keys(r)[0],V=r[I];A=w(this.chart.scales[I].getPixelForValue(V))}y=A-b,C=y-f,E=t.left,G=t.right}const Y=Ge(i.ticks.maxTicksLimit,d),L=Math.max(1,Math.ceil(d/Y));for($=0;$0&&(oe-=R/2);break}we={left:oe,top:ee,width:R+U.width,height:X+U.height,color:L.backdropColor}}b.push({label:M,font:P,textOffset:G,options:{rotation:_,color:V,strokeColor:Q,strokeWidth:Z,textAlign:ce,textBaseline:re,translation:[k,y],backdrop:we}})}return b}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-as(this.labelRotation))return t==="top"?"left":"right";let i="center";return n.align==="start"?i="left":n.align==="end"?i="right":n.align==="inner"&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:s,mirror:i,padding:o}}=this.options,r=this._getLabelSizes(),a=t+o,l=r.widest.width;let c,u;return n==="left"?i?(u=this.right+o,s==="near"?c="left":s==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,s==="near"?c="right":s==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?i?(u=this.left+o,s==="near"?c="right":s==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,s==="near"?c="left":s==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:s,top:i,width:o,height:r}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(s,i,o,r),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const i=this.ticks.findIndex(o=>o.value===t);return i>=0?n.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const n=this.options.grid,s=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,r;const a=(l,c,u)=>{!u.width||!u.color||(s.save(),s.lineWidth=u.width,s.strokeStyle=u.color,s.setLineDash(u.borderDash||[]),s.lineDashOffset=u.borderDashOffset,s.beginPath(),s.moveTo(l.x,l.y),s.lineTo(c.x,c.y),s.stroke(),s.restore())};if(n.display)for(o=0,r=i.length;o{this.draw(o)}}]:[{z:s,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),s=this.axis+"AxisID",i=[];let o,r;for(o=0,r=n.length;o{const s=n.split("."),i=s.pop(),o=[e].concat(s).join("."),r=t[n].split("."),a=r.pop(),l=r.join(".");Ct.route(o,i,l,a)})}function FV(e){return"id"in e&&"defaults"in e}class BV{constructor(){this.controllers=new Gl(us,"datasets",!0),this.elements=new Gl(ri,"elements"),this.plugins=new Gl(Object,"plugins"),this.scales=new Gl(Fo,"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,n,s){[...n].forEach(i=>{const o=s||this._getRegistryForType(i);s||o.isForType(i)||o===this.plugins&&i.id?this._exec(t,o,i):ut(i,r=>{const a=s||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,n,s){const i=Uf(t);pt(s["before"+i],[],s),n[t](s),pt(s["after"+i],[],s)}_getRegistryForType(t){for(let n=0;no.filter(a=>!r.some(l=>a.plugin.id===l.plugin.id));this._notify(i(n,s),t,"stop"),this._notify(i(s,n),t,"start")}}function HV(e){const t={},n=[],s=Object.keys(bs.plugins.items);for(let o=0;o1&&T_(e[0].toLowerCase());if(s)return s}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function M_(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function qV(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(s=>s.xAxisID===e||s.yAxisID===e);if(n.length)return M_(e,"x",n[0])||M_(e,"y",n[0])}return{}}function GV(e,t){const n=Mo[e.type]||{scales:{}},s=t.scales||{},i=fh(e.type,t),o=Object.create(null);return Object.keys(s).forEach(r=>{const a=s[r];if(!st(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);const l=ph(r,a,qV(r,e),Ct.scales[a.type]),c=UV(l,i),u=n.scales||{};o[r]=$a(Object.create(null),[{axis:l},a,u[l],u[c]])}),e.data.datasets.forEach(r=>{const a=r.type||e.type,l=r.indexAxis||fh(a,t),u=(Mo[a]||{}).scales||{};Object.keys(u).forEach(d=>{const f=YV(d,l),p=r[f+"AxisID"]||f;o[p]=o[p]||Object.create(null),$a(o[p],[{axis:f},s[p],u[d]])})}),Object.keys(o).forEach(r=>{const a=o[r];$a(a,[Ct.scales[a.type],Ct.scale])}),o}function i1(e){const t=e.options||(e.options={});t.plugins=Ge(t.plugins,{}),t.scales=GV(e,t)}function o1(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function JV(e){return e=e||{},e.data=o1(e.data),i1(e),e}const D_=new Map,r1=new Set;function Jl(e,t){let n=D_.get(e);return n||(n=t(),D_.set(e,n),r1.add(n)),n}const oa=(e,t,n)=>{const s=Bi(t,n);s!==void 0&&e.add(s)};let XV=class{constructor(t){this._config=JV(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=o1(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(),i1(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Jl(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return Jl(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return Jl(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,s=this.type;return Jl(`${s}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const s=this._scopeCache;let i=s.get(t);return(!i||n)&&(i=new Map,s.set(t,i)),i}getOptionScopes(t,n,s){const{options:i,type:o}=this,r=this._cachedScopes(t,s),a=r.get(n);if(a)return a;const l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(d=>oa(l,t,d))),u.forEach(d=>oa(l,i,d)),u.forEach(d=>oa(l,Mo[o]||{},d)),u.forEach(d=>oa(l,Ct,d)),u.forEach(d=>oa(l,uh,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),r1.has(n)&&r.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,Mo[n]||{},Ct.datasets[n]||{},{type:n},Ct,uh]}resolveNamedOptions(t,n,s,i=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=O_(this._resolverCache,t,i);let l=r;if(ZV(r,n)){o.$shared=!1,s=Vi(s)?s():s;const c=this.createResolver(t,s,a);l=Tr(r,s,c)}for(const c of n)o[c]=l[c];return o}createResolver(t,n,s=[""],i){const{resolver:o}=O_(this._resolverCache,t,s);return st(n)?Tr(o,n,void 0,i):o}};function O_(e,t,n){let s=e.get(t);s||(s=new Map,e.set(t,s));const i=n.join();let o=s.get(i);return o||(o={resolver:Qf(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},s.set(i,o)),o}const QV=e=>st(e)&&Object.getOwnPropertyNames(e).some(t=>Vi(e[t]));function ZV(e,t){const{isScriptable:n,isIndexable:s}=B0(e);for(const i of t){const o=n(i),r=s(i),a=(r||o)&&e[i];if(o&&(Vi(a)||QV(a))||r&&bt(a))return!0}return!1}var e6="4.4.1";const t6=["top","bottom","left","right","chartArea"];function I_(e,t){return e==="top"||e==="bottom"||t6.indexOf(e)===-1&&t==="x"}function R_(e,t){return function(n,s){return n[e]===s[e]?n[t]-s[t]:n[e]-s[e]}}function L_(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),pt(n&&n.onComplete,[e],t)}function n6(e){const t=e.chart,n=t.options.animation;pt(n&&n.onProgress,[e],t)}function a1(e){return tp()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const bc={},N_=e=>{const t=a1(e);return Object.values(bc).filter(n=>n.canvas===t).pop()};function s6(e,t,n){const s=Object.keys(e);for(const i of s){const o=+i;if(o>=t){const r=e[i];delete e[i],(n>0||o>t)&&(e[o+n]=r)}}}function i6(e,t,n,s){return!n||e.type==="mouseout"?null:s?t:e}function Xl(e,t,n){return e.options.clip?e[n]:t[n]}function o6(e,t){const{xScale:n,yScale:s}=e;return n&&s?{left:Xl(n,t,"left"),right:Xl(n,t,"right"),top:Xl(s,t,"top"),bottom:Xl(s,t,"bottom")}:t}var gi;let xu=(gi=class{static register(...t){bs.add(...t),F_()}static unregister(...t){bs.remove(...t),F_()}constructor(t,n){const s=this.config=new XV(n),i=a1(t),o=N_(i);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const r=s.createResolver(s.chartOptionScopes(),this.getContext());this.platform=new(s.platform||xV(i)),this.platform.updateConfig(s);const a=this.platform.acquireContext(i,r.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=lB(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new VV,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=SB(d=>this.update(d),r.resizeDelay||0),this._dataChanges=[],bc[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Hs.listen(this,"complete",L_),Hs.listen(this,"progress",n6),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:s,height:i,_aspectRatio:o}=this;return ot(t)?n&&o?o:i?s/i:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return bs}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():o_(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return n_(this.canvas,this.ctx),this}stop(){return Hs.stop(this),this}resize(t,n){Hs.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const s=this.options,i=this.canvas,o=s.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(i,t,n,o),a=s.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,o_(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),pt(s.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};ut(n,(s,i)=>{s.id=i})}buildOrUpdateScales(){const t=this.options,n=t.scales,s=this.scales,i=Object.keys(s).reduce((r,a)=>(r[a]=!1,r),{});let o=[];n&&(o=o.concat(Object.keys(n).map(r=>{const a=n[r],l=ph(r,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),ut(o,r=>{const a=r.options,l=a.id,c=ph(l,a),u=Ge(a.type,r.dtype);(a.position===void 0||I_(a.position,c)!==I_(r.dposition))&&(a.position=r.dposition),i[l]=!0;let d=null;if(l in s&&s[l].type===u)d=s[l];else{const f=bs.getScale(u);d=new f({id:l,type:u,ctx:this.ctx,chart:this}),s[d.id]=d}d.init(a,t)}),ut(i,(r,a)=>{r||delete s[a]}),ut(s,r=>{Gn.configure(this,r,r.options),Gn.addBox(this,r)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,s=t.length;if(t.sort((i,o)=>i.index-o.index),s>n){for(let i=n;in.length&&delete this._stacks,t.forEach((s,i)=>{n.filter(o=>o===s._dataset).length===0&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let s,i;for(this._removeUnreferencedMetasets(),s=0,i=n.length;s{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const s=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!s.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let c=0,u=this.data.datasets.length;c