vendor: 15,189 bytes, lines 1-6
1"use strict";(globalThis.wpRiseJsonp=globalThis.wpRiseJsonp||[]).push([["defaultVendors-node_modules_pnpm_chart_js_4_5_1_node_modules_chart_js_dist_chart_js"],{33547(ra,te,Ot){Ot.r(te),Ot.d(te,{Animation:()=>ie,Animations:()=>Tt,ArcElement:()=>Ze,BarController:()=>fe,BarElement:()=>oi,BasePlatform:()=>Wt,BasicPlatform:()=>Ce,BubbleController:()=>ge,CategoryScale:()=>Vi,Chart:()=>Je,Colors:()=>di,DatasetController:()=>$,Decimation:()=>gi,DomPlatform:()=>Ee,DoughnutController:()=>gt,Element:()=>N,Filler:()=>ki,Interaction:()=>ke,Legend:()=>Di,LineController:()=>pe,LineElement:()=>ht,LinearScale:()=>Wi,LogarithmicScale:()=>$i,PieController:()=>me,PointElement:()=>si,PolarAreaController:()=>It,RadarController:()=>be,RadialLinearScale:()=>Ui,Scale:()=>X,ScatterController:()=>xe,SubTitle:()=>Ci,Ticks:()=>h.aM,TimeScale:()=>Ct,TimeSeriesScale:()=>Zi,Title:()=>Pi,Tooltip:()=>zi,_adapters:()=>ye,_detectPlatform:()=>Re,animator:()=>W,controllers:()=>_e,defaults:()=>h.d,elements:()=>ai,layouts:()=>E,plugins:()=>Ii,registerables:()=>aa,registry:()=>V,scales:()=>ts});var h=Ot(31228);/*! 2 * Chart.js v4.5.1 3 * https://www.chartjs.org 4 * (c) 2025 Chart.js Contributors 5 * Released under the MIT License 6 */class es{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,s){const o=e.listeners[s],a=e.duration;o.forEach(r=>r({chart:t,initial:e.initial,numSteps:a,currentStep:Math.min(i-e.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=h.r.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const o=i.items;let a=o.length-1,r=!1,l;for(;a>=0;--a)l=o[a],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),r=!0):(o[a]=o[o.length-1],o.pop());r&&(s.draw(),this._notify(s,i,t,"progress")),o.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((i,s)=>Math.max(i,s._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 s=i.length-1;for(;s>=0;--s)i[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var W=new es;const ee="transparent",is={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const i=(0,h.c)(n||ee),s=i.valid&&(0,h.c)(t||ee);return s&&s.valid?s.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class ie{constructor(t,e,i,s){const o=e[i];s=(0,h.a)([t.to,s,o,t.from]);const a=(0,h.a)([t.from,o,s]);this._active=!0,this._fn=t.fn||is[t.type||typeof a],this._easing=h.e[t.easing]||h.e.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=a,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,a=this._duration-o;this._start=i,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=(0,h.a)([t.to,e,s,t.from]),this._from=(0,h.a)([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,s=this._prop,o=this._from,a=this._loop,r=this._to;let l;if(this._active=o!==r&&(a||e<i),!this._active){this._target[s]=r,this._notify(!0);return}if(e<0){this._target[s]=o;return}l=e/i%2,l=a&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(o,r,l)}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 s=0;s<i.length;s++)i[s][e]()}}class Tt{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!(0,h.i)(t))return;const e=Object.keys(h.d.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const o=t[s];if(!(0,h.i)(o))return;const a={};for(const r of e)a[r]=o[r];((0,h.b)(o.properties)&&o.properties||[s]).forEach(r=>{(r===s||!i.has(r))&&i.set(r,a)})})}_animateOptions(t,e){const i=e.options,s=ns(t,i);if(!s)return[];const o=this._createAnimations(s,i);return i.$shared&&ss(t.options.$animations,i).then(()=>{t.options=i},()=>{}),o}_createAnimations(t,e){const i=this._properties,s=[],o=t.$animations||(t.$animations={}),a=Object.keys(e),r=Date.now();let l;for(l=a.length-1;l>=0;--l){const c=a[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,e));continue}const d=e[c];let u=o[c];const f=i.get(c);if(u)if(f&&u.active()){u.update(f,d,r);continue}else u.cancel();if(!f||!f.duration){t[c]=d;continue}o[c]=u=new ie(f,t,c,d),s.push(u)}return s}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const i=this._createAnimations(t,e);if(i.length)return W.add(this._chart,i),!0}}function ss(n,t){const e=[],i=Object.keys(t);for(let s=0;s<i.length;s++){const o=n[i[s]];o&&o.active()&&e.push(o.wait())}return Promise.all(e)}function ns(n,t){if(!t)return;let e=n.options;if(!e){n.options=t;return}return e.$shared&&(n.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function se(n,t){const e=n&&n.options||{},i=e.reverse,s=e.min===void 0?t:0,o=e.max===void 0?t:0;return{start:i?o:s,end:i?s:o}}function os(n,t,e){if(e===!1)return!1;const i=se(n,e),s=se(t,e);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function as(n){let t,e,i,s;return(0,h.i)(n)?(t=n.top,e=n.right,i=n.bottom,s=n.left):t=e=i=s=n,{top:t,right:e,bottom:i,left:s,disabled:n===!1}}function ne(n,t){const e=[],i=n._getSortedDatasetMetas(t);let s,o;for(s=0,o=i.length;s<o;++s)e.push(i[s].index);return e}function oe(n,t,e,i={}){const s=n.keys,o=i.mode==="single";let a,r,l,c;if(t===null)return;let d=!1;for(a=0,r=s.length;a<r;++a){if(l=+s[a],l===e){if(d=!0,i.all)continue;break}c=n.values[l],(0,h.g)(c)&&(o||t===0||(0,h.s)(t)===(0,h.s)(c))&&(t+=c)}return!d&&!i.all?0:t}function rs(n,t){const{iScale:e,vScale:i}=t,s=e.axis==="x"?"x":"y",o=i.axis==="x"?"x":"y",a=Object.keys(n),r=new Array(a.length);let l,c,d;for(l=0,c=a.length;l<c;++l)d=a[l],r[l]={[s]:d,[o]:n[d]};return r}function Et(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function ls(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function hs(n){const{min:t,max:e,minDefined:i,maxDefined:s}=n.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:s?e:Number.POSITIVE_INFINITY}}function cs(n,t,e){const i=n[t]||(n[t]={});return i[e]||(i[e]={})}function ae(n,t,e,i){for(const s of t.getMatchingVisibleMetas(i).reverse()){const o=n[s.index];if(e&&o>0||!e&&o<0)return s.index}return null}function re(n,t){const{chart:e,_cachedMeta:i}=n,s=e._stacks||(e._stacks={}),{iScale:o,vScale:a,index:r}=i,l=o.axis,c=a.axis,d=ls(o,a,i),u=t.length;let f;for(let g=0;g<u;++g){const p=t[g],{[l]:m,[c]:x}=p,b=p._stacks||(p._stacks={});f=b[c]=cs(s,d,m),f[r]=x,f._top=ae(f,a,!0,i.type),f._bottom=ae(f,a,!1,i.type);const _=f._visualValues||(f._visualValues={});_[r]=x}}function Rt(n,t){const e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function ds(n,t){return(0,h.j)(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function us(n,t,e){return(0,h.j)(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function et(n,t){const e=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){t=t||n._parsed;for(const s of t){const o=s._stacks;if(!o||o[i]===void 0||o[i][e]===void 0)return;delete o[i][e],o[i]._visualValues!==void 0&&o[i]._visualValues[e]!==void 0&&delete o[i]._visualValues[e]}}}const Ft=n=>n==="reset"||n==="none",le=(n,t)=>t?n:Object.assign({},n),fs=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:ne(e,!0),values:null};class ${static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Et(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&&et(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(u,f,g,p)=>u==="x"?f:u==="r"?p:g,o=e.xAxisID=(0,h.v)(i.xAxisID,Rt(t,"x")),a=e.yAxisID=(0,h.v)(i.yAxisID,Rt(t,"y")),r=e.rAxisID=(0,h.v)(i.rAxisID,Rt(t,"r")),l=e.indexAxis,c=e.iAxisID=s(l,o,a,r),d=e.vAxisID=s(l,a,o,r);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(r),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(d)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&(0,h.u)(this._data,this),t._stacked&&et(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if((0,h.i)(e)){const s=this._cachedMeta;this._data=rs(e,s)}else if(i!==e){if(i){(0,h.u)(i,this);const s=this._cachedMeta;et(s),s._parsed=[]}e&&Object.isExtensible(e)&&(0,h.l)(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 s=!1;this._dataCheck();const o=e._stacked;e._stacked=Et(e.vScale,e),e.stack!==i.stack&&(s=!0,et(e),e.stack=i.stack),this._resyncElements(t),(s||o!==e._stacked)&&(re(this,e._parsed),e._stacked=Et(e.vScale,e))}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:a}=i,r=o.axis;let l=t===0&&e===s.length?!0:i._sorted,c=t>0&&i._parsed[t-1],d,u,f;if(this._parsing===!1)i._parsed=s,i._sorted=!0,f=s;else{(0,h.b)(s[t])?f=this.parseArrayData(i,s,t,e):(0,h.i)(s[t])?f=this.parseObjectData(i,s,t,e):f=this.parsePrimitiveData(i,s,t,e);const g=()=>u[r]===null||c&&u[r]<c[r];for(d=0;d<e;++d)i._parsed[d+t]=u=f[d],l&&(g()&&(l=!1),c=u);i._sorted=l}a&&re(this,f)}parsePrimitiveData(t,e,i,s){const{iScale:o,vScale:a}=t,r=o.axis,l=a.axis,c=o.getLabels(),d=o===a,u=new Array(s);let f,g,p;for(f=0,g=s;f<g;++f)p=f+i,u[f]={[r]:d||o.parse(c[p],p),[l]:a.parse(e[p],p)};return u}parseArrayData(t,e,i,s){const{xScale:o,yScale:a}=t,r=new Array(s);let l,c,d,u;for(l=0,c=s;l<c;++l)d=l+i,u=e[d],r[l]={x:o.parse(u[0],d),y:a.parse(u[1],d)};return r}parseObjectData(t,e,i,s){const{xScale:o,yScale:a}=t,{xAxisKey:r="x",yAxisKey:l="y"}=this._parsing,c=new Array(s);let d,u,f,g;for(d=0,u=s;d<u;++d)f=d+i,g=e[f],c[d]={x:o.parse((0,h.f)(g,r),f),y:a.parse((0,h.f)(g,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const s=this.chart,o=this._cachedMeta,a=e[t.axis],r={keys:ne(s,!0),values:e._stacks[t.axis]._visualValues};return oe(r,a,o.index,{mode:i})}updateRangeFromParsed(t,e,i,s){const o=i[e.axis];let a=o===null?NaN:o;const r=s&&i._stacks[e.axis];s&&r&&(s.values=r,a=oe(s,o,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,e){const i=this._cachedMeta,s=i._parsed,o=i._sorted&&t===i.iScale,a=s.length,r=this._getOtherScale(t),l=fs(e,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:d,max:u}=hs(r);let f,g;function p(){g=s[f];const m=g[r.axis];return!(0,h.g)(g[t.axis])||d>m||u<m}for(f=0;f<a&&!(!p()&&(this.updateRangeFromParsed(c,t,g,l),o));++f);if(o){for(f=a-1;f>=0;--f)if(!p()){this.updateRangeFromParsed(c,t,g,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let s,o,a;for(s=0,o=e.length;s<o;++s)a=e[s][t.axis],(0,h.g)(a)&&i.push(a);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,s=e.vScale,o=this.getParsed(t);return{label:i?""+i.getLabelForValue(o[i.axis]):"",value:s?""+s.getLabelForValue(o[s.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=as((0,h.v)(this.options.clip,os(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,s=i.data||[],o=e.chartArea,a=[],r=this._drawStart||0,l=this._drawCount||s.length-r,c=this.options.drawActiveElementsOnTop;let d;for(i.dataset&&i.dataset.draw(t,o,r,l),d=r;d<r+l;++d){const u=s[d];u.hidden||(u.active&&c?a.push(u):u.draw(t,o))}for(d=0;d<a.length;++d)a[d].draw(t,o)}getStyle(t,e){const i=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const s=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const a=this._cachedMeta.data[t];o=a.$context||(a.$context=us(this.getContext(),t,a)),o.parsed=this.getParsed(t),o.raw=s.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=ds(this.chart.getContext(),this.index)),o.dataset=s,o.index=o.datasetIndex=this.index;return o.active=!!e,o.mode=i,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const s=e==="active",o=this._cachedDataOpts,a=t+"-"+e,r=o[a],l=this.enableOptionSharing&&(0,h.h)(i);if(r)return le(r,l);const c=this.chart.config,d=c.datasetElementScopeKeys(this._type,t),u=s?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),d),g=Object.keys(h.d.elements[t]),p=()=>this.getContext(i,s,e),m=c.resolveNamedOptions(f,g,p,u);return m.$shared&&(m.$shared=l,o[a]=Object.freeze(le(m,l))),m}_resolveAnimations(t,e,i){const s=this.chart,o=this._cachedDataOpts,a=`animation-${e}
6`,r=o[a];if(r)return r;let l;if(s.options.animation!==!1){const d=this.chart.config,u=d.datasetAnimationScopeKeys(this._type,e),f=d.getOptionScopes(this.getDataset(),u);l=d.createResolver(f,this.getContext(t,i,e))}const c=new Tt(s,l&&l.animations);return l&&l._cacheable&&(o[a]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Ft(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),s=this._sharedOptions,o=this.getSharedOptions(i),a=this.includeOptions(e,o)||o!==s;return this.updateSharedOptions(o,e,i),{sharedOptions:o,includeOptions:a}}updateElement(t,e,i,s){Ft(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!Ft(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;const o=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(o)||o})}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,l,c]of this._syncList)this[r](l,c);this._syncList=[];const s=i.length,o=e.length,a=Math.min(o,s);a&&this.parse(0,a),o>s?this._insertElements(s,o-s,t):o<s&&this._removeElements(o,s-o)}_insertElements(t,e,i=!0){const s=this._cachedMeta,o=s.data,a=t+e;let r;const l=c=>{for(c.length+=e,r=c.length-1;r>=a;r--)c[r]=c[r-e]};for(l(o),r=t;r<a;++r)o[r]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(t,e),i&&this.updateElements(o,t,e,"reset")}updateElements(t,e,i,s){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(t,e);i._stacked&&et(i,s)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,s]=t;this[e](i,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function gs(n,t){if(!n._cache.$bar){const e=n.getMatchingVisibleMetas(t);let i=[];for(let s=0,o=e.length;s<o;s++)i=i.concat(e[s].controller.getAllParsedValues(n));n._cache.$bar=(0,h._)(i.sort((s,o)=>s-o))}return n._cache.$bar}function ps(n){const t=n.iScale,e=gs(t,n.type);let i=t._length,s,o,a,r;const l=()=>{a===32767||a===-32768||((0,h.h)(r)&&(i=Math.min(i,Math.abs(a-r)||i)),r=a)};for(s=0,o=e.length;s<o;++s)a=t.getPixelForValue(e[s]),l();for(r=void 0,s=0,o=t.ticks.length;s<o;++s)a=t.getPixelForTick(s),l();return i}function ms(n,t,e,i){const s=e.barThickness;let o,a;return(0,h.k)(s)?(o=t.min*e.categoryPercentage,a=e.barPercentage):(o=s*i,a=1),{chunk:o/i,ratio:a,start:t.pixels[n]-o/2}}function bs(n,t,e,i){const s=t.pixels,o=s[n];let a=n>0?s[n-1]:null,r=n<s.length-1?s[n+1]:null;const l=e.categoryPercentage;a===null&&(a=o-(r===null?t.end-t.start:r-o)),r===null&&(r=o+o-a);const c=o-(o-Math.min(a,r))/2*l;return{chunk:Math.abs(r-a)/2*l/i,ratio:e.barPercentage,start:c}}function xs(n,t,e,i){const s=e.parse(n[0],i),o=e.parse(n[1],i),a=Math.min(s,o),r=Math.max(s,o);let l=a,c=r;Math.abs(a)>Math.abs(r)&&(l=r,c=a),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:o,min:a,max:r}}
vendor: 6,648 bytes, line 6
6function he(n,t,e,i){return(0,h.b)(n)?xs(n,t,e,i):t[e.axis]=e.parse(n,i),t}function ce(n,t,e,i){const s=n.iScale,o=n.vScale,a=s.getLabels(),r=s===o,l=[];let c,d,u,f;for(c=e,d=e+i;c<d;++c)f=t[c],u={},u[s.axis]=r||s.parse(a[c],c),l.push(he(f,u,o,c));return l}function zt(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function _s(n,t,e){return n!==0?(0,h.s)(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function ys(n){let t,e,i,s,o;return n.horizontal?(t=n.base>n.x,e="left",i="right"):(t=n.base<n.y,e="bottom",i="top"),t?(s="end",o="start"):(s="start",o="end"),{start:e,end:i,reverse:t,top:s,bottom:o}}function vs(n,t,e,i){let s=t.borderSkipped;const o={};if(!s){n.borderSkipped=o;return}if(s===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:r,reverse:l,top:c,bottom:d}=ys(n);s==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===i?s=c:(e._bottom||0)===i?s=d:(o[de(d,a,r,l)]=!0,s=c)),o[de(s,a,r,l)]=!0,n.borderSkipped=o}function de(n,t,e,i){return i?(n=ks(n,t,e),n=ue(n,e,t)):n=ue(n,t,e),n}function ks(n,t,e){return n===t?e:n===e?t:n}function ue(n,t,e){return n==="start"?t:n==="end"?e:n}function Ms(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class fe extends ${static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,e,i,s){return ce(t,e,i,s)}parseArrayData(t,e,i,s){return ce(t,e,i,s)}parseObjectData(t,e,i,s){const{iScale:o,vScale:a}=t,{xAxisKey:r="x",yAxisKey:l="y"}=this._parsing,c=o.axis==="x"?r:l,d=a.axis==="x"?r:l,u=[];let f,g,p,m;for(f=i,g=i+s;f<g;++f)m=e[f],p={},p[o.axis]=o.parse((0,h.f)(m,c),f),u.push(he((0,h.f)(m,d),p,a,f));return u}updateRangeFromParsed(t,e,i,s){super.updateRangeFromParsed(t,e,i,s);const o=i._custom;o&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:s}=e,o=this.getParsed(t),a=o._custom,r=zt(a)?"["+a.start+", "+a.end+"]":""+s.getLabelForValue(o[s.axis]);return{label:""+i.getLabelForValue(o[i.axis]),value:r}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,s){const o=s==="reset",{index:a,_cachedMeta:{vScale:r}}=this,l=r.getBasePixel(),c=r.isHorizontal(),d=this._getRuler(),{sharedOptions:u,includeOptions:f}=this._getSharedOptions(e,s);for(let g=e;g<e+i;g++){const p=this.getParsed(g),m=o||(0,h.k)(p[r.axis])?{base:l,head:l}:this._calculateBarValuePixels(g),x=this._calculateBarIndexPixels(g,d),b=(p._stacks||{})[r.axis],_={horizontal:c,base:m.base,enableBorderRadius:!b||zt(p._custom)||a===b._top||a===b._bottom,x:c?m.head:x.center,y:c?x.center:m.head,height:c?x.size:Math.abs(m.size),width:c?Math.abs(m.size):x.size};f&&(_.options=u||this.resolveDataElementOptions(g,t[g].active?"active":s));const k=_.options||t[g].options;vs(_,k,b,a),Ms(_,k,d.ratio),this.updateElement(t[g],g,_,s)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,s=i.getMatchingVisibleMetas(this._type).filter(d=>d.controller.options.grouped),o=i.options.stacked,a=[],r=this._cachedMeta.controller.getParsed(e),l=r&&r[i.axis],c=d=>{const u=d._parsed.find(g=>g[i.axis]===l),f=u&&u[d.vScale.axis];if((0,h.k)(f)||isNaN(f))return!0};for(const d of s)if(!(e!==void 0&&c(d))&&((o===!1||a.indexOf(d.stack)===-1||o===void 0&&d.stack===void 0)&&a.push(d.stack),d.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,e=this.chart.options.indexAxis;return Object.keys(t).filter(i=>t[i].axis===e).shift()}_getAxis(){const t={},e=this.getFirstScaleIdForIndexAxis();for(const i of this.chart.data.datasets)t[(0,h.v)(this.chart.options.indexAxis==="x"?i.xAxisID:i.yAxisID,e)]=!0;return Object.keys(t)}_getStackIndex(t,e,i){const s=this._getStacks(t,i),o=e!==void 0?s.indexOf(e):-1;return o===-1?s.length-1:o}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,s=[];let o,a;for(o=0,a=e.data.length;o<a;++o)s.push(i.getPixelForValue(this.getParsed(o)[i.axis],o));const r=t.barThickness;return{min:r||ps(e),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:r?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:s},options:{base:o,minBarLength:a}}=this,r=o||0,l=this.getParsed(t),c=l._custom,d=zt(c);let u=l[e.axis],f=0,g=i?this.applyStack(e,l,i):u,p,m;g!==u&&(f=g-u,g=u),d&&(u=c.barStart,g=c.barEnd-c.barStart,u!==0&&(0,h.s)(u)!==(0,h.s)(c.barEnd)&&(f=0),f+=u);const x=!(0,h.k)(o)&&!d?o:f;let b=e.getPixelForValue(x);if(this.chart.getDataVisibility(t)?p=e.getPixelForValue(f+g):p=b,m=p-b,Math.abs(m)<a){m=_s(m,e,r)*a,u===r&&(b-=m/2);const _=e.getPixelForDecimal(0),k=e.getPixelForDecimal(1),v=Math.min(_,k),y=Math.max(_,k);b=Math.max(Math.min(b,y),v),p=b+m,i&&!d&&(l._stacks[e.axis]._visualValues[s]=e.getValueForPixel(p)-e.getValueForPixel(b))}if(b===e.getPixelForValue(r)){const _=(0,h.s)(m)*e.getLineWidthForValue(r)/2;b+=_,m-=_}return{size:m,base:b,head:p,center:p+m/2}}_calculateBarIndexPixels(t,e){const i=e.scale,s=this.options,o=s.skipNull,a=(0,h.v)(s.maxBarThickness,1/0);let r,l;const c=this._getAxisCount();if(e.grouped){const d=o?this._getStackCount(t):e.stackCount,u=s.barThickness==="flex"?bs(t,e,s,d*c):ms(t,e,s,d*c),f=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,g=this._getAxis().indexOf((0,h.v)(f,this.getFirstScaleIdForIndexAxis())),p=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0)+g;r=u.start+u.chunk*p+u.chunk/2,l=Math.min(a,u.chunk*u.ratio)}else r=i.getPixelForValue(this.getParsed(t)[i.axis],t),l=Math.min(a,e.min*e.ratio);return{base:r-l/2,head:r+l/2,center:r,size:l}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,s=i.length;let o=0;for(;o<s;++o)this.getParsed(o)[e.axis]!==null&&!i[o].hidden&&i[o].draw(this._ctx)}}class ge extends ${static id="bubble";static defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};static overrides={scales:{x:{type:"linear"},y:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,super.initialize()}
vendor: 6,050 bytes, line 6
6parsePrimitiveData(t,e,i,s){const o=super.parsePrimitiveData(t,e,i,s);for(let a=0;a<o.length;a++)o[a]._custom=this.resolveDataElementOptions(a+i).radius;return o}parseArrayData(t,e,i,s){const o=super.parseArrayData(t,e,i,s);for(let a=0;a<o.length;a++){const r=e[i+a];o[a]._custom=(0,h.v)(r[2],this.resolveDataElementOptions(a+i).radius)}return o}parseObjectData(t,e,i,s){const o=super.parseObjectData(t,e,i,s);for(let a=0;a<o.length;a++){const r=e[i+a];o[a]._custom=(0,h.v)(r&&r.r&&+r.r,this.resolveDataElementOptions(a+i).radius)}return o}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:o}=e,a=this.getParsed(t),r=s.getLabelForValue(a.x),l=o.getLabelForValue(a.y),c=a._custom;return{label:i[t]||"",value:"("+r+", "+l+(c?", "+c:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,s){const o=s==="reset",{iScale:a,vScale:r}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,s),d=a.axis,u=r.axis;for(let f=e;f<e+i;f++){const g=t[f],p=!o&&this.getParsed(f),m={},x=m[d]=o?a.getPixelForDecimal(.5):a.getPixelForValue(p[d]),b=m[u]=o?r.getBasePixel():r.getPixelForValue(p[u]);m.skip=isNaN(x)||isNaN(b),c&&(m.options=l||this.resolveDataElementOptions(f,g.active?"active":s),o&&(m.options.radius=0)),this.updateElement(g,f,m,s)}}resolveDataElementOptions(t,e){const i=this.getParsed(t);let s=super.resolveDataElementOptions(t,e);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const o=s.radius;return e!=="active"&&(s.radius=0),s.radius+=(0,h.v)(i&&i._custom,o),s}}function Ss(n,t,e){let i=1,s=1,o=0,a=0;if(t<h.T){const r=n,l=r+t,c=Math.cos(r),d=Math.sin(r),u=Math.cos(l),f=Math.sin(l),g=(k,v,y)=>(0,h.p)(k,r,l,!0)?1:Math.max(v,v*e,y,y*e),p=(k,v,y)=>(0,h.p)(k,r,l,!0)?-1:Math.min(v,v*e,y,y*e),m=g(0,c,u),x=g(h.H,d,f),b=p(h.P,c,u),_=p(h.P+h.H,d,f);i=(m-b)/2,s=(x-_)/2,o=-(m+b)/2,a=-(x+_)/2}return{ratioX:i,ratioY:s,offsetX:o,offsetY:a}}class gt extends ${static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data,{labels:{pointStyle:i,textAlign:s,color:o,useBorderRadius:a,borderRadius:r}}=t.legend.options;return e.labels.length&&e.datasets.length?e.labels.map((l,c)=>{const u=t.getDatasetMeta(0).controller.getStyle(c);return{text:l,fillStyle:u.backgroundColor,fontColor:o,hidden:!t.getDataVisibility(c),lineDash:u.borderDash,lineDashOffset:u.borderDashOffset,lineJoin:u.borderJoinStyle,lineWidth:u.borderWidth,strokeStyle:u.borderColor,textAlign:s,pointStyle:i,borderRadius:a&&(r||u.borderRadius),index:c}}):[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}};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(this._parsing===!1)s._parsed=i;else{let o=l=>+i[l];if((0,h.i)(i[t])){const{key:l="value"}=this._parsing;o=c=>+(0,h.f)(i[c],l)}let a,r;for(a=t,r=t+e;a<r;++a)s._parsed[a]=o(a)}}_getRotation(){return(0,h.t)(this.options.rotation-90)}_getCircumference(){return(0,h.t)(this.options.circumference)}_getRotationExtents(){let t=h.T,e=-h.T;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const s=this.chart.getDatasetMeta(i).controller,o=s._getRotation(),a=s._getCircumference();t=Math.min(t,o),e=Math.max(e,o+a)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,s=this._cachedMeta,o=s.data,a=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,r=Math.max((Math.min(i.width,i.height)-a)/2,0),l=Math.min((0,h.m)(this.options.cutout,r),1),c=this._getRingWeight(this.index),{circumference:d,rotation:u}=this._getRotationExtents(),{ratioX:f,ratioY:g,offsetX:p,offsetY:m}=Ss(u,d,l),x=(i.width-a)/f,b=(i.height-a)/g,_=Math.max(Math.min(x,b)/2,0),k=(0,h.n)(this.options.radius,_),v=Math.max(k*l,0),y=(k-v)/this._getVisibleDatasetWeightTotal();this.offsetX=p*k,this.offsetY=m*k,s.total=this.calculateTotal(),this.outerRadius=k-y*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-y*c,0),this.updateElements(o,0,o.length,t)}_circumference(t,e){const i=this.options,s=this._cachedMeta,o=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*o/h.T)}updateElements(t,e,i,s){const o=s==="reset",a=this.chart,r=a.chartArea,c=a.options.animation,d=(r.left+r.right)/2,u=(r.top+r.bottom)/2,f=o&&c.animateScale,g=f?0:this.innerRadius,p=f?0:this.outerRadius,{sharedOptions:m,includeOptions:x}=this._getSharedOptions(e,s);let b=this._getRotation(),_;for(_=0;_<e;++_)b+=this._circumference(_,o);for(_=e;_<e+i;++_){const k=this._circumference(_,o),v=t[_],y={x:d+this.offsetX,y:u+this.offsetY,startAngle:b,endAngle:b+k,circumference:k,outerRadius:p,innerRadius:g};x&&(y.options=m||this.resolveDataElementOptions(_,v.active?"active":s)),b+=k,this.updateElement(v,_,y,s)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let i=0,s;for(s=0;s<e.length;s++){const o=t._parsed[s];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(s)&&!e[s].hidden&&(i+=Math.abs(o))}return i}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?h.T*(Math.abs(t)/e):0}
vendor: 5,653 bytes, line 6
6getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=(0,h.o)(e._parsed[t],i.options.locale);return{label:s[t]||"",value:o}}getMaxBorderWidth(t){let e=0;const i=this.chart;let s,o,a,r,l;if(!t){for(s=0,o=i.data.datasets.length;s<o;++s)if(i.isDatasetVisible(s)){a=i.getDatasetMeta(s),t=a.data,r=a.controller;break}}if(!t)return 0;for(s=0,o=t.length;s<o;++s)l=r.resolveDataElementOptions(s),l.borderAlign!=="inner"&&(e=Math.max(e,l.borderWidth||0,l.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,s=t.length;i<s;++i){const o=this.resolveDataElementOptions(i);e=Math.max(e,o.offset||0,o.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(t){return Math.max((0,h.v)(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class pe extends ${static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:s=[],_dataset:o}=e,a=this.chart._animationsDisabled;let{start:r,count:l}=(0,h.q)(e,s,a);this._drawStart=r,this._drawCount=l,(0,h.w)(e)&&(r=0,l=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!o._decimated,i.points=s;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!a,options:c},t),this.updateElements(s,r,l,t)}updateElements(t,e,i,s){const o=s==="reset",{iScale:a,vScale:r,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:d,includeOptions:u}=this._getSharedOptions(e,s),f=a.axis,g=r.axis,{spanGaps:p,segment:m}=this.options,x=(0,h.x)(p)?p:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||o||s==="none",_=e+i,k=t.length;let v=e>0&&this.getParsed(e-1);for(let y=0;y<k;++y){const M=t[y],S=b?M:{};if(y<e||y>=_){S.skip=!0;continue}const w=this.getParsed(y),D=(0,h.k)(w[g]),P=S[f]=a.getPixelForValue(w[f],y),C=S[g]=o||D?r.getBasePixel():r.getPixelForValue(l?this.applyStack(r,w,l):w[g],y);S.skip=isNaN(P)||isNaN(C)||D,S.stop=y>0&&Math.abs(w[f]-v[f])>x,m&&(S.parsed=w,S.raw=c.data[y]),u&&(S.options=d||this.resolveDataElementOptions(y,M.active?"active":s)),b||this.updateElement(M,y,S,s),v=w}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const o=s[0].size(this.resolveDataElementOptions(0)),a=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,o,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}class It extends ${static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map((o,a)=>{const l=t.getDatasetMeta(0).controller.getStyle(a);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};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=(0,h.o)(e._parsed[t].r,i.options.locale);return{label:s[t]||"",value:o}}parseObjectData(t,e,i,s){return h.y.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,s)=>{const o=this.getParsed(s).r;!isNaN(o)&&this.chart.getDataVisibility(s)&&(o<e.min&&(e.min=o),o>e.max&&(e.max=o))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),o=Math.max(s/2,0),a=Math.max(i.cutoutPercentage?o/100*i.cutoutPercentage:1,0),r=(o-a)/t.getVisibleDatasetCount();this.outerRadius=o-r*this.index,this.innerRadius=this.outerRadius-r}updateElements(t,e,i,s){const o=s==="reset",a=this.chart,l=a.options.animation,c=this._cachedMeta.rScale,d=c.xCenter,u=c.yCenter,f=c.getIndexAngle(0)-.5*h.P;let g=f,p;const m=360/this.countVisibleElements();for(p=0;p<e;++p)g+=this._computeAngle(p,s,m);for(p=e;p<e+i;p++){const x=t[p];let b=g,_=g+this._computeAngle(p,s,m),k=a.getDataVisibility(p)?c.getDistanceFromCenterForValue(this.getParsed(p).r):0;g=_,o&&(l.animateScale&&(k=0),l.animateRotate&&(b=_=f));const v={x:d,y:u,innerRadius:0,outerRadius:k,startAngle:b,endAngle:_,options:this.resolveDataElementOptions(p,x.active?"active":s)};this.updateElement(x,p,v,s)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((i,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?(0,h.t)(this.resolveDataElementOptions(t,e).angle||i):0}}class me extends gt{static id="pie";
vendor: 4,623 bytes, line 6
6static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}class be extends ${static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,s){return h.y.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta,i=e.dataset,s=e.data||[],o=e.iScale.getLabels();if(i.points=s,t!=="resize"){const a=this.resolveDatasetElementOptions(t);this.options.showLine||(a.borderWidth=0);const r={_loop:!0,_fullLoop:o.length===s.length,options:a};this.updateElement(i,void 0,r,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,i,s){const o=this._cachedMeta.rScale,a=s==="reset";for(let r=e;r<e+i;r++){const l=t[r],c=this.resolveDataElementOptions(r,l.active?"active":s),d=o.getPointPositionForValue(r,this.getParsed(r).r),u=a?o.xCenter:d.x,f=a?o.yCenter:d.y,g={x:u,y:f,angle:d.angle,skip:isNaN(u)||isNaN(f),options:c};this.updateElement(l,r,g,s)}}}class xe extends ${static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:o}=e,a=this.getParsed(t),r=s.getLabelForValue(a.x),l=o.getLabelForValue(a.y);return{label:i[t]||"",value:"("+r+", "+l+")"}}update(t){const e=this._cachedMeta,{data:i=[]}=e,s=this.chart._animationsDisabled;let{start:o,count:a}=(0,h.q)(e,i,s);if(this._drawStart=o,this._drawCount=a,(0,h.w)(e)&&(o=0,a=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:r,_dataset:l}=e;r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!l._decimated,r.points=i;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(r,void 0,{animated:!s,options:c},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(i,o,a,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,i,s){const o=s==="reset",{iScale:a,vScale:r,_stacked:l,_dataset:c}=this._cachedMeta,d=this.resolveDataElementOptions(e,s),u=this.getSharedOptions(d),f=this.includeOptions(s,u),g=a.axis,p=r.axis,{spanGaps:m,segment:x}=this.options,b=(0,h.x)(m)?m:Number.POSITIVE_INFINITY,_=this.chart._animationsDisabled||o||s==="none";let k=e>0&&this.getParsed(e-1);for(let v=e;v<e+i;++v){const y=t[v],M=this.getParsed(v),S=_?y:{},w=(0,h.k)(M[p]),D=S[g]=a.getPixelForValue(M[g],v),P=S[p]=o||w?r.getBasePixel():r.getPixelForValue(l?this.applyStack(r,M,l):M[p],v);S.skip=isNaN(D)||isNaN(P)||w,S.stop=v>0&&Math.abs(M[g]-k[g])>b,x&&(S.parsed=M,S.raw=c.data[v]),f&&(S.options=u||this.resolveDataElementOptions(v,y.active?"active":s)),_||this.updateElement(y,v,S,s),k=M}this.updateSharedOptions(u,s,d)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let r=0;for(let l=e.length-1;l>=0;--l)r=Math.max(r,e[l].size(this.resolveDataElementOptions(l))/2);return r>0&&r}const i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!e.length)return s;const o=e[0].size(this.resolveDataElementOptions(0)),a=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(s,o,a)/2}}var _e=Object.freeze({__proto__:null,BarController:fe,BubbleController:ge,DoughnutController:gt,LineController:pe,PieController:me,PolarAreaController:It,RadarController:be,ScatterController:xe});function G(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Bt{static override(t){Object.assign(Bt.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return G()}parse(){return G()}format(){return G()}add(){return G()}diff(){return G()}startOf(){return G()}endOf(){return G()}}var ye={_date:Bt};function ws(n,t,e,i){const{controller:s,data:o,_sorted:a}=n,r=s._cachedMeta.iScale,l=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null;if(r&&t===r.axis&&t!=="r"&&a&&o.length){const c=r._reversePixels?h.A:h.B;if(i){if(s._sharedOptions){const d=o[0],u=typeof d.getRange=="function"&&d.getRange(t);if(u){const f=c(o,t,e-u),g=c(o,t,e+u);return{lo:f.lo,hi:g.hi}}}}else{const d=c(o,t,e);if(l){const{vScale:u}=s._cachedMeta,{_parsed:f}=n,g=f.slice(0,d.lo+1).reverse().findIndex(m=>
vendor: 4,869 bytes, line 6
6!(0,h.k)(m[u.axis]));d.lo-=Math.max(0,g);const p=f.slice(d.hi).findIndex(m=>!(0,h.k)(m[u.axis]));d.hi+=Math.max(0,p)}return d}}return{lo:0,hi:o.length-1}}function it(n,t,e,i,s){const o=n.getSortedVisibleDatasetMetas(),a=e[t];for(let r=0,l=o.length;r<l;++r){const{index:c,data:d}=o[r],{lo:u,hi:f}=ws(o[r],t,a,s);for(let g=u;g<=f;++g){const p=d[g];p.skip||i(p,c,g)}}}function Ds(n){const t=n.indexOf("x")!==-1,e=n.indexOf("y")!==-1;return function(i,s){const o=t?Math.abs(i.x-s.x):0,a=e?Math.abs(i.y-s.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(a,2))}}function Vt(n,t,e,i,s){const o=[];return!s&&!n.isPointInArea(t)||it(n,e,t,function(r,l,c){!s&&!(0,h.C)(r,n.chartArea,0)||r.inRange(t.x,t.y,i)&&o.push({element:r,datasetIndex:l,index:c})},!0),o}function Ps(n,t,e,i){let s=[];function o(a,r,l){const{startAngle:c,endAngle:d}=a.getProps(["startAngle","endAngle"],i),{angle:u}=(0,h.D)(a,{x:t.x,y:t.y});(0,h.p)(u,c,d)&&s.push({element:a,datasetIndex:r,index:l})}return it(n,e,t,o),s}function Cs(n,t,e,i,s,o){let a=[];const r=Ds(e);let l=Number.POSITIVE_INFINITY;function c(d,u,f){const g=d.inRange(t.x,t.y,s);if(i&&!g)return;const p=d.getCenterPoint(s);if(!(!!o||n.isPointInArea(p))&&!g)return;const x=r(t,p);x<l?(a=[{element:d,datasetIndex:u,index:f}],l=x):x===l&&a.push({element:d,datasetIndex:u,index:f})}return it(n,e,t,c),a}function Ht(n,t,e,i,s,o){return!o&&!n.isPointInArea(t)?[]:e==="r"&&!i?Ps(n,t,e,s):Cs(n,t,e,i,s,o)}function ve(n,t,e,i,s){const o=[],a=e==="x"?"inXRange":"inYRange";let r=!1;return it(n,e,t,(l,c,d)=>{l[a]&&l[a](t[e],s)&&(o.push({element:l,datasetIndex:c,index:d}),r=r||l.inRange(t.x,t.y,s))}),i&&!r?[]:o}var ke={evaluateInteractionItems:it,modes:{index(n,t,e,i){const s=(0,h.z)(t,n),o=e.axis||"x",a=e.includeInvisible||!1,r=e.intersect?Vt(n,s,o,i,a):Ht(n,s,o,!1,i,a),l=[];return r.length?(n.getSortedVisibleDatasetMetas().forEach(c=>{const d=r[0].index,u=c.data[d];u&&!u.skip&&l.push({element:u,datasetIndex:c.index,index:d})}),l):[]},dataset(n,t,e,i){const s=(0,h.z)(t,n),o=e.axis||"xy",a=e.includeInvisible||!1;let r=e.intersect?Vt(n,s,o,i,a):Ht(n,s,o,!1,i,a);if(r.length>0){const l=r[0].datasetIndex,c=n.getDatasetMeta(l).data;r=[];for(let d=0;d<c.length;++d)r.push({element:c[d],datasetIndex:l,index:d})}return r},point(n,t,e,i){const s=(0,h.z)(t,n),o=e.axis||"xy",a=e.includeInvisible||!1;return Vt(n,s,o,i,a)},nearest(n,t,e,i){const s=(0,h.z)(t,n),o=e.axis||"xy",a=e.includeInvisible||!1;return Ht(n,s,o,e.intersect,i,a)},x(n,t,e,i){const s=(0,h.z)(t,n);return ve(n,s,"x",e.intersect,i)},y(n,t,e,i){const s=(0,h.z)(t,n);return ve(n,s,"y",e.intersect,i)}}};const Me=["left","top","right","bottom"];function st(n,t){return n.filter(e=>e.pos===t)}function Se(n,t){return n.filter(e=>Me.indexOf(e.pos)===-1&&e.box.axis===t)}function nt(n,t){return n.sort((e,i)=>{const s=t?i:e,o=t?e:i;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function As(n){const t=[];let e,i,s,o,a,r;for(e=0,i=(n||[]).length;e<i;++e)s=n[e],{position:o,options:{stack:a,stackWeight:r=1}}=s,t.push({index:e,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:a&&o+a,stackWeight:r});return t}function Ls(n){const t={};for(const e of n){const{stack:i,pos:s,stackWeight:o}=e;if(!i||!Me.includes(s))continue;const a=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=o}return t}function Os(n,t){const e=Ls(n),{vBoxMaxWidth:i,hBoxMaxHeight:s}=t;let o,a,r;for(o=0,a=n.length;o<a;++o){r=n[o];const{fullSize:l}=r.box,c=e[r.stack],d=c&&r.stackWeight/c.weight;r.horizontal?(r.width=d?d*i:l&&t.availableWidth,r.height=s):(r.width=i,r.height=d?d*s:l&&t.availableHeight)}return e}function Ts(n){const t=As(n),e=nt(t.filter(c=>c.box.fullSize),!0),i=nt(st(t,"left"),!0),s=nt(st(t,"right")),o=nt(st(t,"top"),!0),a=nt(st(t,"bottom")),r=Se(t,"x"),l=Se(t,"y");return{fullSize:e,leftAndTop:i.concat(o),rightAndBottom:s.concat(l).concat(a).concat(r),chartArea:st(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:o.concat(a).concat(r)}}function we(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function De(n,t){n.top=Math.max(n.top,t.top),n.left=Math.max(n.left,t.left),n.bottom=Math.max(n.bottom,t.bottom),n.right=Math.max(n.right,t.right)}function Es(n,t,e,i){const{pos:s,box:o}=e,a=n.maxPadding;if(!(0,h.i)(s)){e.size&&(n[s]-=e.size);const u=i[e.stack]||{size:0,count:1};u.size=Math.max(u.size,e.horizontal?o.height:o.width),e.size=u.size/u.count,n[s]+=e.size}o.getPadding&&De(a,o.getPadding());const r=Math.max(0,t.outerWidth-we(a,n,"left","right")),l=Math.max(0,t.outerHeight-we(a,n,"top","bottom")),c=r!==n.w,d=l!==n.h;return n.w=r,n.h=l,e.horizontal?{same:c,other:d}:{same:d,other:c}}function Rs(n){const t=n.maxPadding;function e(i){const s=Math.max(t[i]-n[i],0);return n[i]+=s,s}n.y+=e("top"),n.x+=e("left"),e("right"),e("bottom")}function Fs(n,t){const e=t.maxPadding;function i(s){const o={left:0,top:0,right:0,bottom:0};
vendor: 5,177 bytes, line 6
6return s.forEach(a=>{o[a]=Math.max(t[a],e[a])}),o}return i(n?["left","right"]:["top","bottom"])}function ot(n,t,e,i){const s=[];let o,a,r,l,c,d;for(o=0,a=n.length,c=0;o<a;++o){r=n[o],l=r.box,l.update(r.width||t.w,r.height||t.h,Fs(r.horizontal,t));const{same:u,other:f}=Es(t,e,r,i);c|=u&&s.length,d=d||f,l.fullSize||s.push(r)}return c&&ot(s,t,e,i)||d}function pt(n,t,e,i,s){n.top=e,n.left=t,n.right=t+i,n.bottom=e+s,n.width=i,n.height=s}function Pe(n,t,e,i){const s=e.padding;let{x:o,y:a}=t;for(const r of n){const l=r.box,c=i[r.stack]||{count:1,placed:0,weight:1},d=r.stackWeight/c.weight||1;if(r.horizontal){const u=t.w*d,f=c.size||l.height;(0,h.h)(c.start)&&(a=c.start),l.fullSize?pt(l,s.left,a,e.outerWidth-s.right-s.left,f):pt(l,t.left+c.placed,a,u,f),c.start=a,c.placed+=u,a=l.bottom}else{const u=t.h*d,f=c.size||l.width;(0,h.h)(c.start)&&(o=c.start),l.fullSize?pt(l,o,s.top,f,e.outerHeight-s.bottom-s.top):pt(l,o,t.top+c.placed,f,u),c.start=o,c.placed+=u,o=l.right}}t.x=o,t.y=a}var E={addBox(n,t){n.boxes||(n.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},n.boxes.push(t)},removeBox(n,t){const e=n.boxes?n.boxes.indexOf(t):-1;e!==-1&&n.boxes.splice(e,1)},configure(n,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(n,t,e,i){if(!n)return;const s=(0,h.E)(n.options.layout.padding),o=Math.max(t-s.width,0),a=Math.max(e-s.height,0),r=Ts(n.boxes),l=r.vertical,c=r.horizontal;(0,h.F)(n.boxes,m=>{typeof m.beforeLayout=="function"&&m.beforeLayout()});const d=l.reduce((m,x)=>x.box.options&&x.box.options.display===!1?m:m+1,0)||1,u=Object.freeze({outerWidth:t,outerHeight:e,padding:s,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/d,hBoxMaxHeight:a/2}),f=Object.assign({},s);De(f,(0,h.E)(i));const g=Object.assign({maxPadding:f,w:o,h:a,x:s.left,y:s.top},s),p=Os(l.concat(c),u);ot(r.fullSize,g,u,p),ot(l,g,u,p),ot(c,g,u,p)&&ot(l,g,u,p),Rs(g),Pe(r.leftAndTop,g,u,p),g.x+=g.w,g.y+=g.h,Pe(r.rightAndBottom,g,u,p),n.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},(0,h.F)(r.chartArea,m=>{const x=m.box;Object.assign(x,n.chartArea),x.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})})}};class Wt{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,s){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):i)}}isAttached(t){return!0}updateConfig(t){}}class Ce extends Wt{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const mt="$chartjs",zs={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Ae=n=>n===null||n==="";function Is(n,t){const e=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[mt]={initial:{height:i,width:s,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Ae(s)){const o=(0,h.J)(n,"width");o!==void 0&&(n.width=o)}if(Ae(i))if(n.style.height==="")n.height=n.width/(t||2);else{const o=(0,h.J)(n,"height");o!==void 0&&(n.height=o)}return n}const Le=h.K?{passive:!0}:!1;function Bs(n,t,e){n&&n.addEventListener(t,e,Le)}function Vs(n,t,e){n&&n.canvas&&n.canvas.removeEventListener(t,e,Le)}function Hs(n,t){const e=zs[n.type]||n.type,{x:i,y:s}=(0,h.z)(n,t);return{type:e,chart:t,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function bt(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function Ws(n,t,e){const i=n.canvas,s=new MutationObserver(o=>{let a=!1;for(const r of o)a=a||bt(r.addedNodes,i),a=a&&!bt(r.removedNodes,i);a&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function Ns(n,t,e){const i=n.canvas,s=new MutationObserver(o=>{let a=!1;for(const r of o)a=a||bt(r.removedNodes,i),a=a&&!bt(r.addedNodes,i);a&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}const at=new Map;let Oe=0;function Te(){const n=window.devicePixelRatio;n!==Oe&&(Oe=n,at.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function js(n,t){at.size||window.addEventListener("resize",Te),at.set(n,t)}function $s(n){at.delete(n),at.size||window.removeEventListener("resize",Te)}function Ys(n,t,e){const i=n.canvas,s=i&&(0,h.I)(i);if(!s)return;const o=(0,h.L)((r,l)=>{const c=s.clientWidth;e(r,l),c<s.clientWidth&&e()},window),a=new ResizeObserver(r=>{const l=r[0],c=l.contentRect.width,d=l.contentRect.height;c===0&&d===0||o(c,d)});return a.observe(s),js(n,o),a}function Nt(n,t,e){e&&e.disconnect(),t==="resize"&&$s(n)}function Xs(n,t,e){const i=n.canvas,s=(0,h.L)(o=>{n.ctx!==null&&e(Hs(o,n))},n);return Bs(i,t,s),s}class Ee extends Wt{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(Is(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[mt])return!1;const i=e[mt].initial;["height","width"].forEach(o=>{const a=i[o];(0,h.k)(a)?e.removeAttribute(o):e.setAttribute(o,a)});const s=i.style||{};
vendor: 5,470 bytes, line 6
6return Object.keys(s).forEach(o=>{e.style[o]=s[o]}),e.width=e.width,delete e[mt],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),a={attach:Ws,detach:Ns,resize:Ys}[e]||Xs;s[e]=a(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];if(!s)return;({attach:Nt,detach:Nt,resize:Nt}[e]||Vs)(t,e,s),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return(0,h.G)(t,e,i,s)}isAttached(t){const e=t&&(0,h.I)(t);return!!(e&&e.isConnected)}}function Re(n){return!(0,h.M)()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?Ce:Ee}class N{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return(0,h.x)(this.x)&&(0,h.x)(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const s={};return t.forEach(o=>{s[o]=i[o]&&i[o].active()?i[o]._to:this[o]}),s}}function Us(n,t){const e=n.options.ticks,i=Gs(n),s=Math.min(e.maxTicksLimit||i,i),o=e.major.enabled?Qs(t):[],a=o.length,r=o[0],l=o[a-1],c=[];if(a>s)return Js(t,c,o,a/s),c;const d=Ks(o,t,s);if(a>0){let u,f;const g=a>1?Math.round((l-r)/(a-1)):null;for(xt(t,c,d,(0,h.k)(g)?0:r-g,r),u=0,f=a-1;u<f;u++)xt(t,c,d,o[u],o[u+1]);return xt(t,c,d,l,(0,h.k)(g)?t.length:l+g),c}return xt(t,c,d),c}function Gs(n){const t=n.options.offset,e=n._tickSize(),i=n._length/e+(t?0:1),s=n._maxLength/e;return Math.floor(Math.min(i,s))}function Ks(n,t,e){const i=qs(n),s=t.length/e;if(!i)return Math.max(s,1);const o=(0,h.N)(i);for(let a=0,r=o.length-1;a<r;a++){const l=o[a];if(l>s)return l}return Math.max(s,1)}function Qs(n){const t=[];let e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function Js(n,t,e,i){let s=0,o=e[0],a;for(i=Math.ceil(i),a=0;a<n.length;a++)a===o&&(t.push(n[a]),s++,o=e[s*i])}function xt(n,t,e,i,s){const o=(0,h.v)(i,0),a=Math.min((0,h.v)(s,n.length),n.length);let r=0,l,c,d;for(e=Math.ceil(e),s&&(l=s-i,e=l/Math.floor(l/e)),d=o;d<0;)r++,d=Math.round(o+r*e);for(c=Math.max(o,0);c<a;c++)c===d&&(t.push(n[c]),r++,d=Math.round(o+r*e))}function qs(n){const t=n.length;let e,i;if(t<2)return!1;for(i=n[0],e=1;e<t;++e)if(n[e]-n[e-1]!==i)return!1;return i}const Zs=n=>n==="left"?"right":n==="right"?"left":n,Fe=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,ze=(n,t)=>Math.min(t||n,n);function Ie(n,t){const e=[],i=n.length/t,s=n.length;let o=0;for(;o<s;o+=i)e.push(n[Math.floor(o)]);return e}function tn(n,t,e){const i=n.ticks.length,s=Math.min(t,i-1),o=n._startPixel,a=n._endPixel,r=1e-6;let l=n.getPixelForTick(s),c;if(!(e&&(i===1?c=Math.max(l-o,a-l):t===0?c=(n.getPixelForTick(1)-l)/2:c=(l-n.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<o-r||l>a+r)))return l}function en(n,t){(0,h.F)(n,e=>{const i=e.gc,s=i.length/2;let o;if(s>t){for(o=0;o<s;++o)delete e.data[i[o]];i.splice(0,s)}})}function rt(n){return n.drawTicks?n.tickLength:0}function Be(n,t){if(!n.display)return 0;const e=(0,h.a0)(n.font,t),i=(0,h.E)(n.padding);return((0,h.b)(n.text)?n.text.length:1)*e.lineHeight+i.height}function sn(n,t){return(0,h.j)(n,{scale:t,type:"scale"})}function nn(n,t,e){return(0,h.j)(n,{tick:e,index:t,type:"tick"})}function on(n,t,e){let i=(0,h.a1)(n);return(e&&t!=="right"||!e&&t==="right")&&(i=Zs(i)),i}function an(n,t,e,i){const{top:s,left:o,bottom:a,right:r,chart:l}=n,{chartArea:c,scales:d}=l;let u=0,f,g,p;const m=a-s,x=r-o;if(n.isHorizontal()){if(g=(0,h.a2)(i,o,r),(0,h.i)(e)){const b=Object.keys(e)[0],_=e[b];p=d[b].getPixelForValue(_)+m-t}else e==="center"?p=(c.bottom+c.top)/2+m-t:p=Fe(n,e,t);f=r-o}else{if((0,h.i)(e)){const b=Object.keys(e)[0],_=e[b];g=d[b].getPixelForValue(_)-x+t}else e==="center"?g=(c.left+c.right)/2-x+t:g=Fe(n,e,t);p=(0,h.a2)(i,a,s),u=e==="left"?-h.H:h.H}return{titleX:g,titleY:p,maxWidth:f,rotation:u}}class X extends N{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:s}=this;return t=(0,h.O)(t,Number.POSITIVE_INFINITY),e=(0,h.O)(e,Number.NEGATIVE_INFINITY),i=(0,h.O)(i,Number.POSITIVE_INFINITY),s=(0,h.O)(s,Number.NEGATIVE_INFINITY),{min:(0,h.O)(t,i),max:(0,h.O)(e,s),minDefined:(0,h.g)(t),maxDefined:(0,h.g)(e)}}getMinMax(t){let{min:e,max:i,minDefined:s,maxDefined:o}=this.getUserBounds(),a;if(s&&o)return{min:e,max:i};const r=this.getMatchingVisibleMetas();for(let l=0,c=r.length;l<c;
vendor: 21,557 bytes, line 6
6++l)a=r[l].controller.getMinMax(this,t),s||(e=Math.min(e,a.min)),o||(i=Math.max(i,a.max));return e=o&&e>i?i:e,i=s&&e>i?e:i,{min:(0,h.O)(e,(0,h.O)(i,e)),max:(0,h.O)(i,(0,h.O)(e,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){(0,h.Q)(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:s,grace:o,ticks:a}=this.options,r=a.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=(0,h.R)(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=r<this.ticks.length;this._convertTicksToLabels(l?Ie(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=Us(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,i;this.isHorizontal()?(e=this.left,i=this.right):(e=this.top,i=this.bottom,t=!t),this._startPixel=e,this._endPixel=i,this._reversePixels=t,this._length=i-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){(0,h.Q)(this.options.afterUpdate,[this])}beforeSetDimensions(){(0,h.Q)(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){(0,h.Q)(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),(0,h.Q)(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){(0,h.Q)(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,s,o;for(i=0,s=t.length;i<s;i++)o=t[i],o.label=(0,h.Q)(e.callback,[o.value,i,t],this)}afterTickToLabelConversion(){(0,h.Q)(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){(0,h.Q)(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=ze(this.ticks.length,t.ticks.maxTicksLimit),s=e.minRotation||0,o=e.maxRotation;let a=s,r,l,c;if(!this._isVisible()||!e.display||s>=o||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const d=this._getLabelSizes(),u=d.widest.width,f=d.highest.height,g=(0,h.S)(this.chart.width-u,0,this.maxWidth);r=t.offset?this.maxWidth/i:g/(i-1),u+6>r&&(r=g/(i-(t.offset?.5:1)),l=this.maxHeight-rt(t.grid)-e.padding-Be(t.title,this.chart.options.font),c=Math.sqrt(u*u+f*f),a=(0,h.U)(Math.min(Math.asin((0,h.S)((d.highest.height+6)/r,-1,1)),Math.asin((0,h.S)(l/c,-1,1))-Math.asin((0,h.S)(f/c,-1,1)))),a=Math.max(s,Math.min(o,a))),this.labelRotation=a}afterCalculateLabelRotation(){(0,h.Q)(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){(0,h.Q)(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:o}}=this,a=this._isVisible(),r=this.isHorizontal();if(a){const l=Be(s,e.options.font);if(r?(t.width=this.maxWidth,t.height=rt(o)+l):(t.height=this.maxHeight,t.width=rt(o)+l),i.display&&this.ticks.length){const{first:c,last:d,widest:u,highest:f}=this._getLabelSizes(),g=i.padding*2,p=(0,h.t)(this.labelRotation),m=Math.cos(p),x=Math.sin(p);if(r){const b=i.mirror?0:x*u.width+m*f.height;t.height=Math.min(this.maxHeight,t.height+b+g)}else{const b=i.mirror?0:m*u.width+x*f.height;t.width=Math.min(this.maxWidth,t.width+b+g)}this._calculatePadding(c,d,x,m)}}this._handleMargins(),r?(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,s){const{ticks:{align:o,padding:a},position:r}=this.options,l=this.labelRotation!==0,c=r!=="top"&&this.axis==="x";if(this.isHorizontal()){const d=this.getPixelForTick(0)-this.left,u=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,g=0;l?c?(f=s*t.width,g=i*e.height):(f=i*t.height,g=s*e.width):o==="start"?g=e.width:o==="end"?f=t.width:o!=="inner"&&(f=t.width/2,g=e.width/2),this.paddingLeft=Math.max((f-d+a)*this.width/(this.width-d),0),this.paddingRight=Math.max((g-u+a)*this.width/(this.width-u),0)}else{let d=e.height/2,u=t.height/2;o==="start"?(d=0,u=t.height):o==="end"&&(d=e.height,u=0),this.paddingTop=d+a,this.paddingBottom=u+a}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){(0,h.Q)(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,i;for(e=0,i=t.length;e<i;e++)(0,h.k)(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=Ie(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:s,_longestTextCache:o}=this,a=[],r=[],l=Math.floor(e/ze(e,i));let c=0,d=0,u,f,g,p,m,x,b,_,k,v,y;for(u=0;u<e;u+=l){if(p=t[u].label,m=this._resolveTickFontOptions(u),s.font=x=m.string,b=o[x]=o[x]||{data:{},gc:[]},_=m.lineHeight,k=v=0,!(0,h.k)(p)&&!(0,h.b)(p))k=(0,h.V)(s,b.data,b.gc,k,p),v=_;else if((0,h.b)(p))for(f=0,g=p.length;f<g;++f)y=p[f],!(0,h.k)(y)&&!(0,h.b)(y)&&(k=(0,h.V)(s,b.data,b.gc,k,y),v+=_);a.push(k),r.push(v),c=Math.max(k,c),d=Math.max(v,d)}en(o,e);const M=a.indexOf(c),S=r.indexOf(d),w=D=>({width:a[D]||0,height:r[D]||0});return{first:w(0),last:w(e-1),widest:w(M),highest:w(S),widths:a,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(0,h.W)(this._alignToPixels?(0,h.X)(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&&t<e.length){const i=e[t];return i.$context||(i.$context=nn(this.getContext(),t,i))}return this.$context||(this.$context=sn(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=(0,h.t)(this.labelRotation),i=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),o=this._getLabelSizes(),a=t.autoSkipPadding||0,r=o?o.widest.width+a:0,l=o?o.highest.height+a:0;return this.isHorizontal()?l*i>r*s?r/i:l/s:l*s<r*i?l/i:r/s}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,s=this.options,{grid:o,position:a,border:r}=s,l=o.offset,c=this.isHorizontal(),u=this.ticks.length+(l?1:0),f=rt(o),g=[],p=r.setContext(this.getContext()),m=p.display?p.width:0,x=m/2,b=function(O){return(0,h.X)(i,O,m)};let _,k,v,y,M,S,w,D,P,C,A,R;if(a==="top")_=b(this.bottom),S=this.bottom-f,D=_-x,C=b(t.top)+x,R=t.bottom;else if(a==="bottom")_=b(this.top),C=t.top,R=b(t.bottom)-x,S=_+x,D=this.top+f;else if(a==="left")_=b(this.right),M=this.right-f,w=_-x,P=b(t.left)+x,A=t.right;else if(a==="right")_=b(this.left),P=t.left,A=b(t.right)-x,M=_+x,w=this.left+f;else if(e==="x"){if(a==="center")_=b((t.top+t.bottom)/2+.5);else if((0,h.i)(a)){const O=Object.keys(a)[0],T=a[O];_=b(this.chart.scales[O].getPixelForValue(T))}C=t.top,R=t.bottom,S=_+x,D=S+f}else if(e==="y"){if(a==="center")_=b((t.left+t.right)/2);else if((0,h.i)(a)){const O=Object.keys(a)[0],T=a[O];_=b(this.chart.scales[O].getPixelForValue(T))}M=_-x,w=M-f,P=t.left,A=t.right}const B=(0,h.v)(s.ticks.maxTicksLimit,u),L=Math.max(1,Math.ceil(u/B));for(k=0;k<u;k+=L){const O=this.getContext(k),T=o.setContext(O),H=r.setContext(O),F=T.lineWidth,Z=T.color,Lt=H.dash||[],tt=H.dashOffset,ut=T.tickWidth,Q=T.tickColor,ft=T.tickBorderDash||[],J=T.tickBorderDashOffset;v=tn(this,k,l),v!==void 0&&(y=(0,h.X)(i,v,F),c?M=w=P=A=y:S=D=C=R=y,g.push({tx1:M,ty1:S,tx2:w,ty2:D,x1:P,y1:C,x2:A,y2:R,width:F,color:Z,borderDash:Lt,borderDashOffset:tt,tickWidth:ut,tickColor:Q,tickBorderDash:ft,tickBorderDashOffset:J}))}return this._ticksLength=u,this._borderValue=_,g}_computeLabelItems(t){const e=this.axis,i=this.options,{position:s,ticks:o}=i,a=this.isHorizontal(),r=this.ticks,{align:l,crossAlign:c,padding:d,mirror:u}=o,f=rt(i.grid),g=f+d,p=u?-d:g,m=-(0,h.t)(this.labelRotation),x=[];let b,_,k,v,y,M,S,w,D,P,C,A,R="middle";if(s==="top")M=this.bottom-p,S=this._getXAxisLabelAlignment();else if(s==="bottom")M=this.top+p,S=this._getXAxisLabelAlignment();else if(s==="left"){const L=this._getYAxisLabelAlignment(f);S=L.textAlign,y=L.x}else if(s==="right"){const L=this._getYAxisLabelAlignment(f);S=L.textAlign,y=L.x}else if(e==="x"){if(s==="center")M=(t.top+t.bottom)/2+g;else if((0,h.i)(s)){const L=Object.keys(s)[0],O=s[L];M=this.chart.scales[L].getPixelForValue(O)+g}S=this._getXAxisLabelAlignment()}else if(e==="y"){if(s==="center")y=(t.left+t.right)/2-g;else if((0,h.i)(s)){const L=Object.keys(s)[0],O=s[L];y=this.chart.scales[L].getPixelForValue(O)}S=this._getYAxisLabelAlignment(f).textAlign}e==="y"&&(l==="start"?R="top":l==="end"&&(R="bottom"));const B=this._getLabelSizes();for(b=0,_=r.length;b<_;++b){k=r[b],v=k.label;const L=o.setContext(this.getContext(b));w=this.getPixelForTick(b)+o.labelOffset,D=this._resolveTickFontOptions(b),P=D.lineHeight,C=(0,h.b)(v)?v.length:1;const O=C/2,T=L.color,H=L.textStrokeColor,F=L.textStrokeWidth;let Z=S;a?(y=w,S==="inner"&&(b===_-1?Z=this.options.reverse?"left":"right":b===0?Z=this.options.reverse?"right":"left":Z="center"),s==="top"?c==="near"||m!==0?A=-C*P+P/2:c==="center"?A=-B.highest.height/2-O*P+P:A=-B.highest.height+P/2:c==="near"||m!==0?A=P/2:c==="center"?A=B.highest.height/2-O*P:A=B.highest.height-C*P,u&&(A*=-1),m!==0&&!L.showLabelBackdrop&&(y+=P/2*Math.sin(m))):(M=w,A=(1-C)*P/2);let Lt;if(L.showLabelBackdrop){const tt=(0,h.E)(L.backdropPadding),ut=B.heights[b],Q=B.widths[b];let ft=A-tt.top,J=0-tt.left;switch(R){case"middle":ft-=ut/2;break;case"bottom":ft-=ut;break}switch(S){case"center":J-=Q/2;break;case"right":J-=Q;break;case"inner":b===_-1?J-=Q:b>0&&(J-=Q/2);break}Lt={left:J,top:ft,width:Q+tt.width,height:ut+tt.height,color:L.backdropColor}}x.push({label:v,font:D,textOffset:A,options:{rotation:m,color:T,strokeColor:H,strokeWidth:F,textAlign:Z,textBaseline:R,translation:[y,M],backdrop:Lt}})}return x}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-(0,h.t)(this.labelRotation))return t==="top"?"left":"right";let s="center";return e.align==="start"?s="left":e.align==="end"?s="right":e.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:s,padding:o}}=this.options,a=this._getLabelSizes(),r=t+o,l=a.widest.width;let c,d;return e==="left"?s?(d=this.right+o,i==="near"?c="left":i==="center"?(c="center",d+=l/2):(c="right",d+=l)):(d=this.right-r,i==="near"?c="right":i==="center"?(c="center",d-=l/2):(c="left",d=this.left)):e==="right"?s?(d=this.left+o,i==="near"?c="right":i==="center"?(c="center",d-=l/2):(c="left",d-=l)):(d=this.left+r,i==="near"?c="left":i==="center"?(c="center",d+=l/2):(c="right",d=this.right)):c="right",{textAlign:c,x:d}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:s,width:o,height:a}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,s,o,a),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const s=this.ticks.findIndex(o=>o.value===t);return s>=0?e.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,a;const r=(l,c,d)=>{!d.width||!d.color||(i.save(),i.lineWidth=d.width,i.strokeStyle=d.color,i.setLineDash(d.borderDash||[]),i.lineDashOffset=d.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(e.display)for(o=0,a=s.length;o<a;++o){const l=s[o];e.drawOnChartArea&&r({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&r({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:i,grid:s}}=this,o=i.setContext(this.getContext()),a=i.display?o.width:0;if(!a)return;const r=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,d,u,f;this.isHorizontal()?(c=(0,h.X)(t,this.left,a)-a/2,d=(0,h.X)(t,this.right,r)+r/2,u=f=l):(u=(0,h.X)(t,this.top,a)-a/2,f=(0,h.X)(t,this.bottom,r)+r/2,c=d=l),e.save(),e.lineWidth=o.width,e.strokeStyle=o.color,e.beginPath(),e.moveTo(c,u),e.lineTo(d,f),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,s=this._computeLabelArea();s&&(0,h.Y)(i,s);const o=this.getLabelItems(t);for(const a of o){const r=a.options,l=a.font,c=a.label,d=a.textOffset;(0,h.Z)(i,c,0,d,l,r)}s&&(0,h.$)(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:s}}=this;if(!i.display)return;const o=(0,h.a0)(i.font),a=(0,h.E)(i.padding),r=i.align;let l=o.lineHeight/2;e==="bottom"||e==="center"||(0,h.i)(e)?(l+=a.bottom,(0,h.b)(i.text)&&(l+=o.lineHeight*(i.text.length-1))):l+=a.top;const{titleX:c,titleY:d,maxWidth:u,rotation:f}=an(this,l,e,r);(0,h.Z)(t,i.text,0,0,o,{color:i.color,maxWidth:u,rotation:f,textAlign:on(r,e,s),textBaseline:"middle",translation:[c,d]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,i=(0,h.v)(t.grid&&t.grid.z,-1),s=(0,h.v)(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==X.prototype.draw?[{z:e,draw:o=>{this.draw(o)}}]:[{z:i,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let o,a;for(o=0,a=e.length;o<a;++o){const r=e[o];r[i]===this.id&&(!t||r.type===t)&&s.push(r)}return s}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return(0,h.a0)(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class _t{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let i;hn(e)&&(i=this.register(e));const s=this.items,o=t.id,a=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in s||(s[o]=t,rn(t,a,i),this.override&&h.d.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,s=this.scope;i in e&&delete e[i],s&&i in h.d[s]&&(delete h.d[s][i],this.override&&delete h.a3[i])}}function rn(n,t,e){const i=(0,h.a4)(Object.create(null),[e?h.d.get(e):{},h.d.get(t),n.defaults]);h.d.set(t,i),n.defaultRoutes&&ln(t,n.defaultRoutes),n.descriptors&&h.d.describe(t,n.descriptors)}function ln(n,t){Object.keys(t).forEach(e=>{const i=e.split("."),s=i.pop(),o=[n].concat(i).join("."),a=t[e].split("."),r=a.pop(),l=a.join(".");h.d.route(o,s,l,r)})}function hn(n){return"id"in n&&"defaults"in n}class cn{constructor(){this.controllers=new _t($,"datasets",!0),this.elements=new _t(N,"elements"),this.plugins=new _t(Object,"plugins"),this.scales=new _t(X,"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(s=>{const o=i||this._getRegistryForType(s);i||o.isForType(s)||o===this.plugins&&s.id?this._exec(t,o,s):(0,h.F)(s,a=>{const r=i||this._getRegistryForType(a);this._exec(t,r,a)})})}_exec(t,e,i){const s=(0,h.a5)(t);(0,h.Q)(i["before"+s],[],i),e[t](i),(0,h.Q)(i["after"+s],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const s=e.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return s}}var V=new cn;class dn{constructor(){this._init=void 0}notify(t,e,i,s){if(e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;const o=s?this._descriptors(t).filter(s):this._descriptors(t),a=this._notify(o,t,e,i);return e==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),a}_notify(t,e,i,s){s=s||{};for(const o of t){const a=o.plugin,r=a[i],l=[e,s,o.options];if((0,h.Q)(r,l,a)===!1&&s.cancelable)return!1}return!0}invalidate(){(0,h.k)(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,s=(0,h.v)(i.options&&i.options.plugins,{}),o=un(i);return s===!1&&!e?[]:gn(t,o,s,e)}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,s=(o,a)=>o.filter(r=>!a.some(l=>r.plugin.id===l.plugin.id));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}}function un(n){const t={},e=[],i=Object.keys(V.plugins.items);for(let o=0;o<i.length;o++)e.push(V.getPlugin(i[o]));const s=n.plugins||[];for(let o=0;o<s.length;o++){const a=s[o];e.indexOf(a)===-1&&(e.push(a),t[a.id]=!0)}return{plugins:e,localIds:t}}function fn(n,t){return!t&&n===!1?null:n===!0?{}:n}function gn(n,{plugins:t,localIds:e},i,s){const o=[],a=n.getContext();for(const r of t){const l=r.id,c=fn(i[l],s);c!==null&&o.push({plugin:r,options:pn(n.config,{plugin:r,local:e[l]},c,a)})}return o}function pn(n,{plugin:t,local:e},i,s){const o=n.pluginScopeKeys(t),a=n.getOptionScopes(i,o);return e&&t.defaults&&a.push(t.defaults),n.createResolver(a,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function jt(n,t){const e=h.d.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function mn(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function bn(n,t){return n===t?"_index_":"_value_"}function Ve(n){if(n==="x"||n==="y"||n==="r")return n}function xn(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function $t(n,...t){if(Ve(n))return n;for(const e of t){const i=e.axis||xn(e.position)||n.length>1&&Ve(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function He(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function _n(n,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(i=>i.xAxisID===n||i.yAxisID===n);if(e.length)return He(n,"x",e[0])||He(n,"y",e[0])}return{}}function yn(n,t){const e=h.a3[n.type]||{scales:{}},i=t.scales||{},s=jt(n.type,t),o=Object.create(null);
6return Object.keys(i).forEach(a=>{const r=i[a];if(!(0,h.i)(r))return console.error(`Invalid scale configuration for scale: ${a}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const l=$t(a,r,_n(a,n),h.d.scales[r.type]),c=bn(l,s),d=e.scales||{};o[a]=(0,h.ab)(Object.create(null),[{axis:l},r,d[l],d[c]])}),n.data.datasets.forEach(a=>{const r=a.type||n.type,l=a.indexAxis||jt(r,t),d=(h.a3[r]||{}).scales||{};Object.keys(d).forEach(u=>{const f=mn(u,l),g=a[f+"AxisID"]||f;o[g]=o[g]||Object.create(null),(0,h.ab)(o[g],[{axis:f},i[g],d[u]])})}),Object.keys(o).forEach(a=>{const r=o[a];(0,h.ab)(r,[h.d.scales[r.type],h.d.scale])}),o}function We(n){const t=n.options||(n.options={});t.plugins=(0,h.v)(t.plugins,{}),t.scales=yn(n,t)}function Ne(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function vn(n){return n=n||{},n.data=Ne(n.data),We(n),n}const je=new Map,$e=new Set;function yt(n,t){let e=je.get(n);return e||(e=t(),je.set(n,e),$e.add(e)),e}const lt=(n,t,e)=>{const i=(0,h.f)(t,e);i!==void 0&&n.add(i)};class kn{constructor(t){this._config=vn(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=Ne(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(),We(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return yt(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return yt(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return yt(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return yt(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let s=i.get(t);return(!s||e)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,e,i){const{options:s,type:o}=this,a=this._cachedScopes(t,i),r=a.get(e);if(r)return r;const l=new Set;e.forEach(d=>{t&&(l.add(t),d.forEach(u=>lt(l,t,u))),d.forEach(u=>lt(l,s,u)),d.forEach(u=>lt(l,h.a3[o]||{},u)),d.forEach(u=>lt(l,h.d,u)),d.forEach(u=>lt(l,h.a6,u))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),$e.has(e)&&a.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,h.a3[e]||{},h.d.datasets[e]||{},{type:e},h.d,h.a6]}resolveNamedOptions(t,e,i,s=[""]){const o={$shared:!0},{resolver:a,subPrefixes:r}=Ye(this._resolverCache,t,s);let l=a;if(Sn(a,e)){o.$shared=!1,i=(0,h.a7)(i)?i():i;const c=this.createResolver(t,i,r);l=(0,h.a8)(a,i,c)}for(const c of e)o[c]=l[c];return o}createResolver(t,e,i=[""],s){const{resolver:o}=Ye(this._resolverCache,t,i);return(0,h.i)(e)?(0,h.a8)(o,e,void 0,s):o}}function Ye(n,t,e){let i=n.get(t);i||(i=new Map,n.set(t,i));const s=e.join();let o=i.get(s);
6return o||(o={resolver:(0,h.a9)(t,e),subPrefixes:e.filter(r=>!r.toLowerCase().includes("hover"))},i.set(s,o)),o}const Mn=n=>(0,h.i)(n)&&Object.getOwnPropertyNames(n).some(t=>(0,h.a7)(n[t]));function Sn(n,t){const{isScriptable:e,isIndexable:i}=(0,h.aa)(n);for(const s of t){const o=e(s),a=i(s),r=(a||o)&&n[s];if(o&&((0,h.a7)(r)||Mn(r))||a&&(0,h.b)(r))return!0}return!1}var wn="4.5.1";const Dn=["top","bottom","left","right","chartArea"];function Xe(n,t){return n==="top"||n==="bottom"||Dn.indexOf(n)===-1&&t==="x"}function Ue(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function Ge(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),(0,h.Q)(e&&e.onComplete,[n],t)}function Pn(n){const t=n.chart,e=t.options.animation;(0,h.Q)(e&&e.onProgress,[n],t)}function Ke(n){return(0,h.M)()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const vt={},Qe=n=>{const t=Ke(n);return Object.values(vt).filter(e=>e.canvas===t).pop()};function Cn(n,t,e){const i=Object.keys(n);for(const s of i){const o=+s;if(o>=t){const a=n[s];delete n[s],(e>0||o>t)&&(n[o+e]=a)}}}function An(n,t,e,i){return!e||n.type==="mouseout"?null:i?t:n}class Je{static defaults=h.d;static instances=vt;static overrides=h.a3;static registry=V;static version=wn;static getChart=Qe;static register(...t){V.add(...t),qe()}static unregister(...t){V.remove(...t),qe()}constructor(t,e){const i=this.config=new kn(e),s=Ke(t),o=Qe(s);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 a=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||Re(s)),this.platform.updateConfig(i);const r=this.platform.acquireContext(s,a.aspectRatio),l=r&&r.canvas,c=l&&l.height,d=l&&l.width;if(this.id=(0,h.ac)(),this.ctx=r,this.canvas=l,this.width=d,this.height=c,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 dn,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=(0,h.ad)(u=>this.update(u),a.resizeDelay||0),this._dataChanges=[],vt[this.id]=this,!r||!l){console.error("Failed to create chart: can't acquire context from the given item");return}W.listen(this,"complete",Ge),W.listen(this,"progress",Pn),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:s,_aspectRatio:o}=this;return(0,h.k)(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}get registry(){return V}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():(0,h.ae)(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return(0,h.af)(this.canvas,this.ctx),this}stop(){return W.stop(this),this}resize(t,e){W.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,a=this.platform.getMaximumSize(s,t,e,o),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,(0,h.ae)(this,r,!0)&&(this.notifyPlugins("resize",{size:a}),(0,h.Q)(i.onResize,[this,a],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};(0,h.F)(e,(i,s)=>{i.id=s})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce((a,r)=>(a[r]=!1,a),{});let o=[];e&&(o=o.concat(Object.keys(e).map(a=>{const r=e[a],l=$t(a,r),c=l==="r",d=l==="x";return{options:r,dposition:c?"chartArea":d?"bottom":"left",dtype:c?"radialLinear":d?"category":"linear"}}))),(0,h.F)(o,a=>{const r=a.options,l=r.id,c=$t(l,r),d=(0,h.v)(r.type,a.dtype);(r.position===void 0||Xe(r.position,c)!==Xe(a.dposition))&&(r.position=a.dposition),s[l]=!0;let u=null;if(l in i&&i[l].type===d)u=i[l];
vendor: 6,067 bytes, line 6
6else{const f=V.getScale(d);u=new f({id:l,type:d,ctx:this.ctx,chart:this}),i[u.id]=u}u.init(r,t)}),(0,h.F)(s,(a,r)=>{a||delete i[r]}),(0,h.F)(i,a=>{E.configure(this,a,a.options),E.addBox(this,a)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((s,o)=>s.index-o.index),i>e){for(let s=e;s<i;++s)this._destroyDatasetMeta(s);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(Ue("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((i,s)=>{e.filter(o=>o===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=e.length;i<s;i++){const o=e[i];let a=this.getDatasetMeta(i);const r=o.type||this.config.type;if(a.type&&a.type!==r&&(this._destroyDatasetMeta(i),a=this.getDatasetMeta(i)),a.type=r,a.indexAxis=o.indexAxis||jt(r,this.options),a.order=o.order||0,a.index=i,a.label=""+o.label,a.visible=this.isDatasetVisible(i),a.controller)a.controller.updateIndex(i),a.controller.linkScales();else{const l=V.getController(r),{datasetElementType:c,dataElementType:d}=h.d.datasets[r];Object.assign(l,{dataElementType:V.getElement(d),datasetElementType:c&&V.getElement(c)}),a.controller=new l(this,i),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){(0,h.F)(this.data.datasets,(t,e)=>{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(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let c=0,d=this.data.datasets.length;c<d;c++){const{controller:u}=this.getDatasetMeta(c),f=!s&&o.indexOf(u)===-1;u.buildOrUpdateElements(f),a=Math.max(+u.getMaxOverflow(),a)}a=this._minPadding=i.layout.autoPadding?a:0,this._updateLayout(a),s||(0,h.F)(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Ue("z","_idx"));const{_active:r,_lastEvent:l}=this;l?this._eventHandler(l,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){(0,h.F)(this.scales,t=>{E.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!(0,h.ag)(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:o}of e){const a=i==="_removeElements"?-o:o;Cn(t,s,a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=o=>new Set(t.filter(a=>a[0]===o).map((a,r)=>r+","+a.splice(1).join(","))),s=i(0);for(let o=1;o<e;o++)if(!(0,h.ag)(s,i(o)))return;return Array.from(s).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;E.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],(0,h.F)(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,o)=>{s._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,i=this.data.datasets.length;e<i;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,(0,h.a7)(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),s={meta:i,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(i.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(W.has(this)?this.attached&&!W.running(this)&&W.start(this):(this.draw(),Ge({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:i,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(i,s)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let s,o;for(s=0,o=e.length;s<o;++s){const a=e[s];(!t||a.visible)&&i.push(a)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i={meta:t,index:t.index,cancelable:!0},s=(0,h.ah)(this,t);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(s&&(0,h.Y)(e,s),t.controller.draw(),s&&(0,h.$)(e),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return(0,h.C)(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){const o=ke.modes[e];return typeof o=="function"?o(this,t,i,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let s=i.filter(o=>o&&o._dataset===e).pop();return s||(s={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(s)),s}getContext(){return this.$context||(this.$context=(0,h.j)(null,{chart:this,type:"chart"}))}
6getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!e.hidden}setDatasetVisibility(t,e){const i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const s=i?"show":"hide",o=this.getDatasetMeta(t),a=o.controller._resolveAnimations(void 0,s);(0,h.h)(e)?(o.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),a.update(o,{visible:i}),this.update(r=>r.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(),W.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),(0,h.af)(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete vt[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(o,a)=>{e.addEventListener(this,o,a),t[o]=a},s=(o,a,r)=>{o.offsetX=a,o.offsetY=r,this._eventHandler(o)};(0,h.F)(this.options.events,o=>i(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let a;const r=()=>{s("attach",r),this.attached=!0,this.resize(),i("resize",o),i("detach",a)};a=()=>{this.attached=!1,s("resize",o),this._stop(),this._resize(0,0),i("attach",r)},e.isAttached(this.canvas)?r():a()}unbindEvents(){(0,h.F)(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},(0,h.F)(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const s=i?"set":"remove";let o,a,r,l;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),r=0,l=t.length;r<l;++r){a=t[r];const c=a&&this.getDatasetMeta(a.datasetIndex).controller;c&&c[s+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map(({datasetIndex:o,index:a})=>{const r=this.getDatasetMeta(o);if(!r)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:r.data[a],index:a}});!(0,h.ai)(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,i){const s=this.options.hover,o=(l,c)=>l.filter(d=>!c.some(u=>d.datasetIndex===u.datasetIndex&&d.index===u.index)),a=o(e,t),r=i?t:o(t,e);a.length&&this.updateHoverStyle(a,s.mode,!1),r.length&&s.mode&&this.updateHoverStyle(r,s.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)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,a=e,r=this._getActiveElements(t,s,i,a),l=(0,h.aj)(t),c=An(t,this._lastEvent,i,l);i&&(this._lastEvent=null,(0,h.Q)(o.onHover,[t,r,this],this),l&&(0,h.Q)(o.onClick,[t,r,this],this));const d=!(0,h.ai)(r,s);return(d||e)&&(this._active=r,this._updateHoverStyles(r,s,e)),this._lastEvent=c,d}_getActiveElements(t,e,i,s){if(t.type==="mouseout")return[];if(!i)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}}function qe(){return(0,h.F)(Je.instances,n=>n._plugins.invalidate())}function Ln(n,t,e){const{startAngle:i,x:s,y:o,outerRadius:a,innerRadius:r,options:l}=t,{borderWidth:c,borderJoinStyle:d}=l,u=Math.min(c/a,(0,h.al)(i-e));if(n.beginPath(),n.arc(s,o,a-c/2,i+u/2,e-u/2),r>0){const f=Math.min(c/r,(0,h.al)(i-e));n.arc(s,o,r+c/2,e-f/2,i+f/2,!0)}else{const f=Math.min(c/2,a*(0,h.al)(i-e));if(d==="round")n.arc(s,o,f,e-h.P/2,i+h.P/2,!0);else if(d==="bevel"){const g=2*f*f,p=-g*Math.cos(e+h.P/2)+s,m=-g*Math.sin(e+h.P/2)+o,x=g*Math.cos(i+h.P/2)+s,b=g*Math.sin(i+h.P/2)+o;n.lineTo(p,m),n.lineTo(x,b)}}n.closePath(),n.moveTo(0,0),n.rect(0,0,n.canvas.width,n.canvas.height),n.clip("evenodd")}function On(n,t,e){const{startAngle:i,pixelMargin:s,x:o,y:a,outerRadius:r,innerRadius:l}=t;
6let c=s/r;n.beginPath(),n.arc(o,a,r,i-c,e+c),l>s?(c=s/l,n.arc(o,a,l,e+c,i-c,!0)):n.arc(o,a,s,e+h.H,i-h.H),n.closePath(),n.clip()}function Tn(n){return(0,h.am)(n,["outerStart","outerEnd","innerStart","innerEnd"])}function En(n,t,e,i){const s=Tn(n.options.borderRadius),o=(e-t)/2,a=Math.min(o,i*t/2),r=l=>{const c=(e-Math.min(o,l))*i/2;return(0,h.S)(l,0,Math.min(o,c))};return{outerStart:r(s.outerStart),outerEnd:r(s.outerEnd),innerStart:(0,h.S)(s.innerStart,0,a),innerEnd:(0,h.S)(s.innerEnd,0,a)}}function q(n,t,e,i){return{x:e+n*Math.cos(t),y:i+n*Math.sin(t)}}function kt(n,t,e,i,s,o){const{x:a,y:r,startAngle:l,pixelMargin:c,innerRadius:d}=t,u=Math.max(t.outerRadius+i+e-c,0),f=d>0?d+i+e+c:0;let g=0;const p=s-l;if(i){const L=d>0?d-i:0,O=u>0?u-i:0,T=(L+O)/2,H=T!==0?p*T/(T+i):p;g=(p-H)/2}const m=Math.max(.001,p*u-e/h.P)/u,x=(p-m)/2,b=l+x+g,_=s-x-g,{outerStart:k,outerEnd:v,innerStart:y,innerEnd:M}=En(t,f,u,_-b),S=u-k,w=u-v,D=b+k/S,P=_-v/w,C=f+y,A=f+M,R=b+y/C,B=_-M/A;if(n.beginPath(),o){const L=(D+P)/2;if(n.arc(a,r,u,D,L),n.arc(a,r,u,L,P),v>0){const F=q(w,P,a,r);n.arc(F.x,F.y,v,P,_+h.H)}const O=q(A,_,a,r);if(n.lineTo(O.x,O.y),M>0){const F=q(A,B,a,r);n.arc(F.x,F.y,M,_+h.H,B+Math.PI)}const T=(_-M/f+(b+y/f))/2;if(n.arc(a,r,f,_-M/f,T,!0),n.arc(a,r,f,T,b+y/f,!0),y>0){const F=q(C,R,a,r);n.arc(F.x,F.y,y,R+Math.PI,b-h.H)}const H=q(S,b,a,r);if(n.lineTo(H.x,H.y),k>0){const F=q(S,D,a,r);n.arc(F.x,F.y,k,b-h.H,D)}}else{n.moveTo(a,r);const L=Math.cos(D)*u+a,O=Math.sin(D)*u+r;n.lineTo(L,O);const T=Math.cos(P)*u+a,H=Math.sin(P)*u+r;n.lineTo(T,H)}n.closePath()}function Rn(n,t,e,i,s){const{fullCircles:o,startAngle:a,circumference:r}=t;let l=t.endAngle;if(o){kt(n,t,e,i,l,s);for(let c=0;c<o;++c)n.fill();isNaN(r)||(l=a+(r%h.T||h.T))}return kt(n,t,e,i,l,s),n.fill(),l}function Fn(n,t,e,i,s){const{fullCircles:o,startAngle:a,circumference:r,options:l}=t,{borderWidth:c,borderJoinStyle:d,borderDash:u,borderDashOffset:f,borderRadius:g}=l,p=l.borderAlign==="inner";if(!c)return;n.setLineDash(u||[]),n.lineDashOffset=f,p?(n.lineWidth=c*2,n.lineJoin=d||"round"):(n.lineWidth=c,n.lineJoin=d||"bevel");let m=t.endAngle;if(o){kt(n,t,e,i,m,s);for(let x=0;x<o;++x)n.stroke();isNaN(r)||(m=a+(r%h.T||h.T))}p&&On(n,t,m),l.selfJoin&&m-a>=h.P&&g===0&&d!=="miter"&&Ln(n,t,m),o||(kt(n,t,e,i,m,s),n.stroke())}class Ze extends N{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;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:a}=(0,h.D)(s,{x:t,y:e}),{startAngle:r,endAngle:l,innerRadius:c,outerRadius:d,circumference:u}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),f=(this.options.spacing+this.options.borderWidth)/2,g=(0,h.v)(u,l-r),p=(0,h.p)(o,r,l)&&r!==l,m=g>=h.T||p,x=(0,h.ak)(a,c+f,d+f);return m&&x}getCenterPoint(t){const{x:e,y:i,startAngle:s,endAngle:o,innerRadius:a,outerRadius:r}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:l,spacing:c}=this.options,d=(s+o)/2,u=(a+r+c+l)/2;return{x:e+Math.cos(d)*u,y:i+Math.sin(d)*u}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,s=(e.offset||0)/4,o=(e.spacing||0)/2,a=e.circular;if(this.pixelMargin=e.borderAlign==="inner"?.33:0,this.fullCircles=i>h.T?Math.floor(i/h.T):0,i===0||this.innerRadius<0||this.outerRadius<0)return;t.save();const r=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(r)*s,Math.sin(r)*s);const l=1-Math.sin(Math.min(h.P,i||0)),c=s*l;t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,Rn(t,this,c,o,a),Fn(t,this,c,o,a),t.restore(
vendor: 9,167 bytes, line 6
6)}}function ti(n,t,e=t){n.lineCap=(0,h.v)(e.borderCapStyle,t.borderCapStyle),n.setLineDash((0,h.v)(e.borderDash,t.borderDash)),n.lineDashOffset=(0,h.v)(e.borderDashOffset,t.borderDashOffset),n.lineJoin=(0,h.v)(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=(0,h.v)(e.borderWidth,t.borderWidth),n.strokeStyle=(0,h.v)(e.borderColor,t.borderColor)}function zn(n,t,e){n.lineTo(e.x,e.y)}function In(n){return n.stepped?h.at:n.tension||n.cubicInterpolationMode==="monotone"?h.au:zn}function ei(n,t,e={}){const i=n.length,{start:s=0,end:o=i-1}=e,{start:a,end:r}=t,l=Math.max(s,a),c=Math.min(o,r),d=s<a&&o<a||s>r&&o>r;return{count:i,start:l,loop:t.loop,ilen:c<l&&!d?i+c-l:c-l}}function Bn(n,t,e,i){const{points:s,options:o}=t,{count:a,start:r,loop:l,ilen:c}=ei(s,e,i),d=In(o);let{move:u=!0,reverse:f}=i||{},g,p,m;for(g=0;g<=c;++g)p=s[(r+(f?c-g:g))%a],!p.skip&&(u?(n.moveTo(p.x,p.y),u=!1):d(n,m,p,f,o.stepped),m=p);return l&&(p=s[(r+(f?c:0))%a],d(n,m,p,f,o.stepped)),!!l}function Vn(n,t,e,i){const s=t.points,{count:o,start:a,ilen:r}=ei(s,e,i),{move:l=!0,reverse:c}=i||{};let d=0,u=0,f,g,p,m,x,b;const _=v=>(a+(c?r-v:v))%o,k=()=>{m!==x&&(n.lineTo(d,x),n.lineTo(d,m),n.lineTo(d,b))};for(l&&(g=s[_(0)],n.moveTo(g.x,g.y)),f=0;f<=r;++f){if(g=s[_(f)],g.skip)continue;const v=g.x,y=g.y,M=v|0;M===p?(y<m?m=y:y>x&&(x=y),d=(u*d+v)/++u):(k(),n.lineTo(v,y),p=M,u=0,m=x=y),b=y}k()}function Yt(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Vn:Bn}function Hn(n){return n.stepped?h.aq:n.tension||n.cubicInterpolationMode==="monotone"?h.ar:h.as}function Wn(n,t,e,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,i)&&s.closePath()),ti(n,t.options),n.stroke(s)}function Nn(n,t,e,i){const{segments:s,options:o}=t,a=Yt(t);for(const r of s)ti(n,o,r.style),n.beginPath(),a(n,t,r,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}const jn=typeof Path2D=="function";function $n(n,t,e,i){jn&&!t.options.segment?Wn(n,t,e,i):Nn(n,t,e,i)}class ht extends N{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;(0,h.an)(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=(0,h.ao)(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,a=(0,h.ap)(this,{property:e,start:s,end:s});if(!a.length)return;const r=[],l=Hn(i);let c,d;for(c=0,d=a.length;c<d;++c){const{start:u,end:f}=a[c],g=o[u],p=o[f];if(g===p){r.push(g);continue}const m=Math.abs((s-g[e])/(p[e]-g[e])),x=l(g,p,m,i.stepped);x[e]=t[e],r.push(x)}return r.length===1?r[0]:r}pathSegment(t,e,i){return Yt(this)(t,this,e,i)}path(t,e,i){const s=this.segments,o=Yt(this);let a=this._loop;e=e||0,i=i||this.points.length-e;for(const r of s)a&=o(t,this,r,{start:e,end:e+i-1});return!!a}draw(t,e,i,s){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),$n(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function ii(n,t,e,i){const s=n.options,{[e]:o}=n.getProps([e],i);return Math.abs(t-o)<s.radius+s.hitRadius}class si extends N{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){const s=this.options,{x:o,y:a}=this.getProps(["x","y"],i);return Math.pow(t-o,2)+Math.pow(e-a,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,e){return ii(this,t,"x",e)}inYRange(t,e){return ii(this,t,"y",e)}getCenterPoint(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}size(t){t=t||this.options||{};let e=t.radius||0;e=Math.max(e,e&&t.hoverRadius||0);const i=e&&t.borderWidth||0;return(e+i)*2}draw(t,e){const i=this.options;this.skip||i.radius<.1||!(0,h.C)(this,e,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,(0,h.av)(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function ni(n,t){const{x:e,y:i,base:s,width:o,height:a}=n.getProps(["x","y","base","width","height"],t);let r,l,c,d,u;return n.horizontal?(u=a/2,r=Math.min(e,s),l=Math.max(e,s),c=i-u,d=i+u):(u=o/2,r=e-u,l=e+u,c=Math.min(i,s),d=Math.max(i,s)),{left:r,top:c,right:l,bottom:d}}function U(n,t,e,i){return n?0:(0,h.S)(t,e,i)}function Yn(n,t,e){const i=n.options.borderWidth,s=n.borderSkipped,o=(0,h.ax)(i);return{t:U(s.top,o.top,0,e),r:U(s.right,o.right,0,t),b:U(s.bottom,o.bottom,0,e),l:U(s.left,o.left,0,t)}}function Xn(n,t,e){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),s=n.options.borderRadius,o=(0,h.ay)(s),a=Math.min(t,e),r=n.borderSkipped,l=i||(0,h.i)(s);return{topLeft:U(!l||r.top||r.left,o.topLeft,0,a),topRight:U(!l||r.top||r.right,o.topRight,0,a),bottomLeft:U(!l||r.bottom||r.left,o.bottomLeft,0,a),bottomRight:U(!l||r.bottom||r.right,o.bottomRight,0,a)}}function Un(n){const t=ni(n),e=t.right-t.left,i=t.bottom-t.top,s=Yn(n,e/2,i/2),o=Xn(n,e/2,i/2);return{outer:{x:t.left,y:t.top,w:e,h:i,radius:o},inner:{x:t.left+s.l,y:t.top+s.t,w:e-s.l-s.r,h:i-s.t-s.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,o.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(s.b,s.r))}}}}function Xt(n,t,e,i){const s=t===null,o=e===null,r=n&&!(s&&o)&&ni(n,i);return r&&(s||(0,h.ak)(t,r.left,r.right))&&(o||(0,h.ak)(e,r.top,r.bottom))}function Gn(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function Kn(n,t){n.rect(t.x,t.y,t.w,t.h)}function Ut(n,t,e={}){const i=n.x!==e.x?-t:0,s=n.y!==e.y?-t:0,o=(n.x+n.w!==e.x+e.w?t:0)-i,a=(n.y+n.h!==e.y+e.h?t:0)-s;return{x:n.x+i,y:n.y+s,w:n.w+o,h:n.h+a,radius:n.radius}}class oi extends N{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:i,backgroundColor:s}}=this,{inner:o,outer:a}=Un(this),r=Gn(a.radius)?h.aw:Kn;t.save(),(a.w!==o.w||a.h!==o.h)&&(t.beginPath(),r(t,Ut(a,e,o)),t.clip(),r(t,Ut(o,-e,a)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),r(t,Ut(o,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,i){return Xt(this,t,e,i)}inXRange(t,e){return Xt(this,t,null,e)}inYRange(t,e){return Xt(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:s,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(e+s)/2:e,y:o?i:(i+s)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}var ai=Object.freeze({__proto__:null,ArcElement:Ze,BarElement:oi,LineElement:ht,PointElement:si});const Gt=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],ri=Gt.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function li(n){return Gt[n%Gt.length]}function hi(n){return ri[n%ri.length]}function Qn(n,t){return n.borderColor=li(t),n.backgroundColor=hi(t),++t}function Jn(n,t){return n.backgroundColor=n.data.map(()=>li(t++)),t}function qn(n,t){return n.backgroundColor=n.data.map(()=>hi(t++)),t}function Zn(n){let t=0;return(e,i)=>{const s=n.getDatasetMeta(i).controller;s instanceof gt?t=Jn(e,t):s instanceof It?t=qn(e,t):s&&(t=Qn(e,t))}}function ci(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function to(n){return n&&(n.borderColor||n.backgroundColor)}function eo(){return h.d.borderColor!=="rgba(0,0,0,0.1)"||h.d.backgroundColor!=="rgba(0,0,0,0.1)"}var di={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(n,t,e){if(!e.enabled)return;const{data:{datasets:i},options:s}=n.config,{elements:o}=s,a=ci(i)||to(s)||o&&ci(o)||eo();if(!e.forceOverride&&a)return;const r=Zn(n);
vendor: 4,090 bytes, line 6
6i.forEach(r)}};function io(n,t,e,i,s){const o=s.samples||i;if(o>=e)return n.slice(t,t+e);const a=[],r=(e-2)/(o-2);let l=0;const c=t+e-1;let d=t,u,f,g,p,m;for(a[l++]=n[d],u=0;u<o-2;u++){let x=0,b=0,_;const k=Math.floor((u+1)*r)+1+t,v=Math.min(Math.floor((u+2)*r)+1,e)+t,y=v-k;for(_=k;_<v;_++)x+=n[_].x,b+=n[_].y;x/=y,b/=y;const M=Math.floor(u*r)+1+t,S=Math.min(Math.floor((u+1)*r)+1,e)+t,{x:w,y:D}=n[d];for(g=p=-1,_=M;_<S;_++)p=.5*Math.abs((w-x)*(n[_].y-D)-(w-n[_].x)*(b-D)),p>g&&(g=p,f=n[_],m=_);a[l++]=f,d=m}return a[l++]=n[c],a}function so(n,t,e,i){let s=0,o=0,a,r,l,c,d,u,f,g,p,m;const x=[],b=t+e-1,_=n[t].x,v=n[b].x-_;for(a=t;a<t+e;++a){r=n[a],l=(r.x-_)/v*i,c=r.y;const y=l|0;if(y===d)c<p?(p=c,u=a):c>m&&(m=c,f=a),s=(o*s+r.x)/++o;else{const M=a-1;if(!(0,h.k)(u)&&!(0,h.k)(f)){const S=Math.min(u,f),w=Math.max(u,f);S!==g&&S!==M&&x.push({...n[S],x:s}),w!==g&&w!==M&&x.push({...n[w],x:s})}a>0&&M!==g&&x.push(n[M]),x.push(r),d=y,o=0,p=m=c,u=f=g=a}}return x}function ui(n){if(n._decimated){const t=n._data;delete n._decimated,delete n._data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function fi(n){n.data.datasets.forEach(t=>{ui(t)})}function no(n,t){const e=t.length;let i=0,s;const{iScale:o}=n,{min:a,max:r,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(i=(0,h.S)((0,h.B)(t,o.axis,a).lo,0,e-1)),c?s=(0,h.S)((0,h.B)(t,o.axis,r).hi+1,i,e)-i:s=e-i,{start:i,count:s}}var gi={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){fi(n);return}const i=n.width;n.data.datasets.forEach((s,o)=>{const{_data:a,indexAxis:r}=s,l=n.getDatasetMeta(o),c=a||s.data;if((0,h.a)([r,n.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const d=n.scales[l.xAxisID];if(d.type!=="linear"&&d.type!=="time"||n.options.parsing)return;let{start:u,count:f}=no(l,c);const g=e.threshold||4*i;if(f<=g){ui(s);return}(0,h.k)(a)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(m){this._data=m}}));let p;switch(e.algorithm){case"lttb":p=io(c,u,f,i,e);break;case"min-max":p=so(c,u,f,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}s._decimated=p})},destroy(n){fi(n)}};function oo(n,t,e){const i=n.segments,s=n.points,o=t.points,a=[];for(const r of i){let{start:l,end:c}=r;c=Mt(l,c,s);const d=Kt(e,s[l],s[c],r.loop);if(!t.segments){a.push({source:r,target:d,start:s[l],end:s[c]});continue}const u=(0,h.ap)(t,d);for(const f of u){const g=Kt(e,o[f.start],o[f.end],f.loop),p=(0,h.az)(r,s,g);for(const m of p)a.push({source:m,target:f,start:{[e]:pi(d,g,"start",Math.max)},end:{[e]:pi(d,g,"end",Math.min)}})}}return a}function Kt(n,t,e,i){if(i)return;let s=t[n],o=e[n];return n==="angle"&&(s=(0,h.al)(s),o=(0,h.al)(o)),{property:n,start:s,end:o}}function ao(n,t){const{x:e=null,y:i=null}=n||{},s=t.points,o=[];return t.segments.forEach(({start:a,end:r})=>{r=Mt(a,r,s);const l=s[a],c=s[r];i!==null?(o.push({x:l.x,y:i}),o.push({x:c.x,y:i})):e!==null&&(o.push({x:e,y:l.y}),o.push({x:e,y:c.y}))}),o}function Mt(n,t,e){for(;t>n;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function pi(n,t,e,i){return n&&t?i(n[e],t[e]):n?n[e]:t?t[e]:0}function mi(n,t){let e=[],i=!1;return(0,h.b)(n)?(i=!0,e=n):e=ao(n,t),e.length?new ht({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function bi(n){return n&&n.fill!==!1}function ro(n,t,e){let s=n[t].fill;const o=[t];let a;if(!e)return s;for(;s!==!1&&o.indexOf(s)===-1;){if(!(0,h.g)(s))return s;if(a=n[s],!a)return!1;if(a.visible)return s;o.push(s),s=a.fill}return!1}function lo(n,t,e){const i=fo(n);if((0,h.i)(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return(0,h.g)(s)&&Math.floor(s)===s?ho(i[0],t,s,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function ho(n,t,e,i){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function co(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:(0,h.i)(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function uo(n,t,e){let i;
vendor: 4,254 bytes, line 6
6return n==="start"?i=e:n==="end"?i=t.options.reverse?t.min:t.max:(0,h.i)(n)?i=n.value:i=t.getBaseValue(),i}function fo(n){const t=n.options,e=t.fill;let i=(0,h.v)(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function go(n){const{scale:t,index:e,line:i}=n,s=[],o=i.segments,a=i.points,r=po(t,e);r.push(mi({x:null,y:t.bottom},i));for(let l=0;l<o.length;l++){const c=o[l];for(let d=c.start;d<=c.end;d++)mo(s,a[d],r)}return new ht({points:s,options:{}})}function po(n,t){const e=[],i=n.getMatchingVisibleMetas("line");for(let s=0;s<i.length;s++){const o=i[s];if(o.index===t)break;o.hidden||e.unshift(o.dataset)}return e}function mo(n,t,e){const i=[];for(let s=0;s<e.length;s++){const o=e[s],{first:a,last:r,point:l}=bo(o,t,"x");if(!(!l||a&&r)){if(a)i.unshift(l);else if(n.push(l),!r)break}}n.push(...i)}function bo(n,t,e){const i=n.interpolate(t,e);if(!i)return{};const s=i[e],o=n.segments,a=n.points;let r=!1,l=!1;for(let c=0;c<o.length;c++){const d=o[c],u=a[d.start][e],f=a[d.end][e];if((0,h.ak)(s,u,f)){r=s===u,l=s===f;break}}return{first:r,last:l,point:i}}class xi{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:s,y:o,radius:a}=this;return e=e||{start:0,end:h.T},t.arc(s,o,a,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:s}=this,o=t.angle;return{x:e+Math.cos(o)*s,y:i+Math.sin(o)*s,angle:o}}}function xo(n){const{chart:t,fill:e,line:i}=n;if((0,h.g)(e))return _o(t,e);if(e==="stack")return go(n);if(e==="shape")return!0;const s=yo(n);return s instanceof xi?s:mi(s,i)}function _o(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function yo(n){return(n.scale||{}).getPointPositionForValue?ko(n):vo(n)}function vo(n){const{scale:t={},fill:e}=n,i=co(e,t);if((0,h.g)(i)){const s=t.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function ko(n){const{scale:t,fill:e}=n,i=t.options,s=t.getLabels().length,o=i.reverse?t.max:t.min,a=uo(e,t,o),r=[];if(i.grid.circular){const l=t.getPointPositionForValue(0,o);return new xi({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(a)})}for(let l=0;l<s;++l)r.push(t.getPointPositionForValue(l,a));return r}function Qt(n,t,e){const i=xo(t),{chart:s,index:o,line:a,scale:r,axis:l}=t,c=a.options,d=c.fill,u=c.backgroundColor,{above:f=u,below:g=u}=d||{},p=s.getDatasetMeta(o),m=(0,h.ah)(s,p);i&&a.points.length&&((0,h.Y)(n,e),Mo(n,{line:a,target:i,above:f,below:g,area:e,scale:r,axis:l,clip:m}),(0,h.$)(n))}function Mo(n,t){const{line:e,target:i,above:s,below:o,area:a,scale:r,clip:l}=t,c=e._loop?"angle":t.axis;n.save();let d=o;o!==s&&(c==="x"?(_i(n,i,a.top),Jt(n,{line:e,target:i,color:s,scale:r,property:c,clip:l}),n.restore(),n.save(),_i(n,i,a.bottom)):c==="y"&&(yi(n,i,a.left),Jt(n,{line:e,target:i,color:o,scale:r,property:c,clip:l}),n.restore(),n.save(),yi(n,i,a.right),d=s)),Jt(n,{line:e,target:i,color:d,scale:r,property:c,clip:l}),n.restore()}function _i(n,t,e){const{segments:i,points:s}=t;let o=!0,a=!1;n.beginPath();for(const r of i){const{start:l,end:c}=r,d=s[l],u=s[Mt(l,c,s)];o?(n.moveTo(d.x,d.y),o=!1):(n.lineTo(d.x,e),n.lineTo(d.x,d.y)),a=!!t.pathSegment(n,r,{move:a}),a?n.closePath():n.lineTo(u.x,e)}n.lineTo(t.first().x,e),n.closePath(),n.clip()}function yi(n,t,e){const{segments:i,points:s}=t;let o=!0,a=!1;n.beginPath();for(const r of i){const{start:l,end:c}=r,d=s[l],u=s[Mt(l,c,s)];o?(n.moveTo(d.x,d.y),o=!1):(n.lineTo(e,d.y),n.lineTo(d.x,d.y)),a=!!t.pathSegment(n,r,{move:a}),a?n.closePath():n.lineTo(e,u.y)}n.lineTo(e,t.first().y),n.closePath(),n.clip()}function Jt(n,t){const{line:e,target:i,property:s,color:o,scale:a,clip:r}=t,l=oo(e,i,s);for(const{source:c,target:d,start:u,end:f}of l){const{style:{backgroundColor:g=o}={}}=c,p=i!==!0;n.save(),n.fillStyle=g,So(n,a,r,p&&Kt(s,u,f)),n.beginPath();const m=!!e.pathSegment(n,c);let x;if(p){m?n.closePath():vi(n,i,f,s);const b=!!i.pathSegment(n,d,{move:m,reverse:!0});x=m&&b,x||vi(n,i,u,s)}n.closePath(),n.fill(x?"evenodd":"nonzero"),n.restore()}}function So(n,t,e,i){const s=t.chart.chartArea,{property:o,start:a,end:r}=i||{};if(o==="x"||o==="y"){let l,c,d,u;o==="x"?(l=a,c=s.top,d=r,u=s.bottom):(l=s.left,c=a,d=s.right,u=r),n.beginPath(),e&&(l=Math.max(l,e.left),d=Math.min(d,e.right),c=Math.max(c,e.to
vendor: 37,461 bytes, lines 6-8
6p),u=Math.min(u,e.bottom)),n.rect(l,c,d-l,u-c),n.clip()}}function vi(n,t,e,i){const s=t.interpolate(e,i);s&&n.lineTo(s.x,s.y)}var ki={id:"filler",afterDatasetsUpdate(n,t,e){const i=(n.data.datasets||[]).length,s=[];let o,a,r,l;for(a=0;a<i;++a)o=n.getDatasetMeta(a),r=o.dataset,l=null,r&&r.options&&r instanceof ht&&(l={visible:n.isDatasetVisible(a),index:a,fill:lo(r,a,i),chart:n,axis:o.controller.options.indexAxis,scale:o.vScale,line:r}),o.$filler=l,s.push(l);for(a=0;a<i;++a)l=s[a],!(!l||l.fill===!1)&&(l.fill=ro(s,a,e.propagate))},beforeDraw(n,t,e){const i=e.drawTime==="beforeDraw",s=n.getSortedVisibleDatasetMetas(),o=n.chartArea;for(let a=s.length-1;a>=0;--a){const r=s[a].$filler;r&&(r.line.updateControlPoints(o,r.axis),i&&r.fill&&Qt(n.ctx,r,o))}},beforeDatasetsDraw(n,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const o=i[s].$filler;bi(o)&&Qt(n.ctx,o,n.chartArea)}},beforeDatasetDraw(n,t,e){const i=t.meta.$filler;!bi(i)||e.drawTime!=="beforeDatasetDraw"||Qt(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Mi=(n,t)=>{let{boxHeight:e=t,boxWidth:i=t}=n;return n.usePointStyle&&(e=Math.min(e,t),i=n.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:e,itemHeight:Math.max(t,e)}},wo=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class Si extends N{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=(0,h.Q)(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(i=>t.filter(i,this.chart.data))),t.sort&&(e=e.sort((i,s)=>t.sort(i,s,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const i=t.labels,s=(0,h.a0)(i.font),o=s.size,a=this._computeTitleHeight(),{boxWidth:r,itemHeight:l}=Mi(i,o);let c,d;e.font=s.string,this.isHorizontal()?(c=this.maxWidth,d=this._fitRows(a,o,r,l)+10):(d=this.maxHeight,c=this._fitCols(a,s,r,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(d,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,s){const{ctx:o,maxWidth:a,options:{labels:{padding:r}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],d=s+r;let u=t;o.textAlign="left",o.textBaseline="middle";let f=-1,g=-d;return this.legendItems.forEach((p,m)=>{const x=i+e/2+o.measureText(p.text).width;(m===0||c[c.length-1]+x+2*r>a)&&(u+=d,c[c.length-(m>0?0:1)]=0,g+=d,f++),l[m]={left:0,top:g,row:f,width:x,height:s},c[c.length-1]+=x+r}),u}_fitCols(t,e,i,s){const{ctx:o,maxHeight:a,options:{labels:{padding:r}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],d=a-t;let u=r,f=0,g=0,p=0,m=0;return this.legendItems.forEach((x,b)=>{const{itemWidth:_,itemHeight:k}=Do(i,e,o,x,s);b>0&&g+k+2*r>d&&(u+=f+r,c.push({width:f,height:g}),p+=f+r,m++,f=g=0),l[b]={left:p,top:g,col:m,width:_,height:k},f=Math.max(f,_),g+=k+r}),u+=f,c.push({width:f,height:g}),u}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:s},rtl:o}}=this,a=(0,h.aA)(o,this.left,this.width);if(this.isHorizontal()){let r=0,l=(0,h.a2)(i,this.left+s,this.right-this.lineWidths[r]);for(const c of e)r!==c.row&&(r=c.row,l=(0,h.a2)(i,this.left+s,this.right-this.lineWidths[r])),c.top+=this.top+t+s,c.left=a.leftForLtr(a.x(l),c.width),l+=c.width+s}else{let r=0,l=(0,h.a2)(i,this.top+t+s,this.bottom-this.columnSizes[r].height);for(const c of e)c.col!==r&&(r=c.col,l=(0,h.a2)(i,this.top+t+s,this.bottom-this.columnSizes[r].height)),c.top=l,c.left+=this.left+s,c.left=a.leftForLtr(a.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;(0,h.Y)(t,this),this._draw(),(0,h.$)(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:s}=this,{align:o,labels:a}=t,r=h.d.color,l=(0,h.aA)(t.rtl,this.left,this.width),c=(0,h.a0)(a.font),{padding:d}=a,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:p,boxHeight:m,itemHeight:x}=Mi(a,u),b=function(M,S,w){if(isNaN(p)||p<=0||isNaN(m)||m<0)return;s.save();const D=(0,h.v)(w.lineWidth,1);if(s.fillStyle=(0,h.v)(w.fillStyle,r),s.lineCap=(0,h.v)(w.lineCap,"butt"),s.lineDashOffset=(0,h.v)(w.lineDashOffset,0),s.lineJoin=(0,h.v)(w.lineJoin,"miter"),s.lineWidth=D,s.strokeStyle=(0,h.v)(w.strokeStyle,r),s.setLineDash((0,h.v)(w.lineDash,[])),a.usePointStyle){const P={radius:m*Math.SQRT2/2,pointStyle:w.pointStyle,rotation:w.rotation,borderWidth:D},C=l.xPlus(M,p/2),A=S+f;(0,h.aE)(s,P,C,A,a.pointStyleWidth&&p)}else{const P=S+Math.max((u-m)/2,0),C=l.leftForLtr(M,p),A=(0,h.ay)(w.borderRadius);s.beginPath(),Object.values(A).some(R=>R!==0)?(0,h.aw)(s,{x:C,y:P,w:p,h:m,radius:A}):s.rect(C,P,p,m),s.fill(),D!==0&&s.stroke()}s.restore()},_=function(M,S,w){(0,h.Z)(s,w.text,M,S+x/2,c,{strikethrough:w.hidden,textAlign:l.textAlign(w.textAlign)})},k=this.isHorizontal(),v=this._computeTitleHeight();k?g={x:(0,h.a2)(o,this.left+d,this.right-i[0]),y:this.top+d+v,line:0}:g={x:this.left+d,y:(0,h.a2)(o,this.top+v+d,this.bottom-e[0].height),line:0},(0,h.aB)(this.ctx,t.textDirection);const y=x+d;this.legendItems.forEach((M,S)=>{s.strokeStyle=M.fontColor,s.fillStyle=M.fontColor;const w=s.measureText(M.text).width,D=l.textAlign(M.textAlign||(M.textAlign=a.textAlign)),P=p+f+w;let C=g.x,A=g.y;l.setWidth(this.width),k?S>0&&C+P+d>this.right&&(A=g.y+=y,g.line++,C=g.x=(0,h.a2)(o,this.left+d,this.right-i[g.line])):S>0&&A+y>this.bottom&&(C=g.x=C+e[g.line].width+d,g.line++,A=g.y=(0,h.a2)(o,this.top+v+d,this.bottom-e[g.line].height));const R=l.x(C);if(b(R,A,M),C=(0,h.aC)(D,C+p+f,k?C+P:this.right,t.rtl),_(l.x(C),A,M),k)g.x+=P+d;else if(typeof M.text!="string"){const B=c.lineHeight;g.y+=wi(M,B)+d}else g.y+=y}),(0,h.aD)(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=(0,h.a0)(e.font),s=(0,h.E)(e.padding);if(!e.display)return;const o=(0,h.aA)(t.rtl,this.left,this.width),a=this.ctx,r=e.position,l=i.size/2,c=s.top+l;let d,u=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),d=this.top+c,u=(0,h.a2)(t.align,u,this.right-f);else{const p=this.columnSizes.reduce((m,x)=>Math.max(m,x.height),0);d=c+(0,h.a2)(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const g=(0,h.a2)(r,u,u+f);a.textAlign=o.textAlign((0,h.a1)(r)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=i.string,(0,h.Z)(a,e.text,g,d,i)}_computeTitleHeight(){const t=this.options.title,e=(0,h.a0)(t.font),i=(0,h.E)(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,o;if((0,h.ak)(t,this.left,this.right)&&(0,h.ak)(e,this.top,this.bottom)){for(o=this.legendHitBoxes,i=0;i<o.length;++i)if(s=o[i],(0,h.ak)(t,s.left,s.left+s.width)&&(0,h.ak)(e,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(t){const e=this.options;if(!Ao(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,o=wo(s,i);s&&!o&&(0,h.Q)(e.onLeave,[t,s,this],this),this._hoveredItem=i,i&&!o&&(0,h.Q)(e.onHover,[t,i,this],this)}else i&&(0,h.Q)(e.onClick,[t,i,this],this)}}function Do(n,t,e,i,s){const o=Po(i,n,t,e),a=Co(s,i,t.lineHeight);return{itemWidth:o,itemHeight:a}}function Po(n,t,e,i){let s=n.text;return s&&typeof s!="string"&&(s=s.reduce((o,a)=>o.length>a.length?o:a)),t+e.size/2+i.measureText(s).width}function Co(n,t,e){let i=n;return typeof t.text!="string"&&(i=wi(t,e)),i}function wi(n,t){const e=n.text?n.text.length:0;return t*e}function Ao(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var Di={id:"legend",_element:Si,start(n,t,e){const i=n.legend=new Si({ctx:n.ctx,options:e,chart:n});E.configure(n,i,e),E.addBox(n,i)},stop(n){E.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const i=n.legend;E.configure(n,i,e),i.options=e},afterUpdate(n){const t=n.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(n,t){t.replay||n.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(n,t,e){const i=t.datasetIndex,s=e.chart;s.isDatasetVisible(i)?(s.hide(i),t.hidden=!0):(s.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:n=>n.chart.options.color,boxWidth:40,padding:10,generateLabels(n){const t=n.data.datasets,{labels:{usePointStyle:e,pointStyle:i,textAlign:s,color:o,useBorderRadius:a,borderRadius:r}}=n.legend.options;return n._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),d=(0,h.E)(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(d.width+d.height)/4,strokeStyle:c.borderColor,pointStyle:i||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:a&&(r||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:n=>n.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:n=>!n.startsWith("on"),labels:{_scriptable:n=>!["generateLabels","filter","sort"].includes(n)}}};class qt extends N{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const s=(0,h.b)(i.text)?i.text.length:1;this._padding=(0,h.E)(i.padding);const o=s*(0,h.a0)(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:i,bottom:s,right:o,options:a}=this,r=a.align;let l=0,c,d,u;return this.isHorizontal()?(d=(0,h.a2)(r,i,o),u=e+t,c=o-i):(a.position==="left"?(d=i+t,u=(0,h.a2)(r,s,e),l=h.P*-.5):(d=o-t,u=(0,h.a2)(r,e,s),l=h.P*.5),c=s-e),{titleX:d,titleY:u,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=(0,h.a0)(e.font),o=i.lineHeight/2+this._padding.top,{titleX:a,titleY:r,maxWidth:l,rotation:c}=this._drawArgs(o);(0,h.Z)(t,e.text,0,0,i,{color:e.color,maxWidth:l,rotation:c,textAlign:(0,h.a1)(e.align),textBaseline:"middle",translation:[a,r]})}}function Lo(n,t){const e=new qt({ctx:n.ctx,options:t,chart:n});E.configure(n,e,t),E.addBox(n,e),n.titleBlock=e}var Pi={id:"title",_element:qt,start(n,t,e){Lo(n,e)},stop(n){const t=n.titleBlock;E.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){const i=n.titleBlock;E.configure(n,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const St=new WeakMap;var Ci={id:"subtitle",start(n,t,e){const i=new qt({ctx:n.ctx,options:e,chart:n});E.configure(n,i,e),E.addBox(n,i),St.set(n,i)},stop(n){E.removeBox(n,St.get(n)),St.delete(n)},beforeUpdate(n,t,e){const i=St.get(n);E.configure(n,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const ct={average(n){if(!n.length)return!1;let t,e,i=new Set,s=0,o=0;for(t=0,e=n.length;t<e;++t){const r=n[t].element;if(r&&r.hasValue()){const l=r.tooltipPosition();i.add(l.x),s+=l.y,++o}}return o===0||i.size===0?!1:{x:[...i].reduce((r,l)=>r+l)/i.size,y:s/o}},nearest(n,t){if(!n.length)return!1;let e=t.x,i=t.y,s=Number.POSITIVE_INFINITY,o,a,r;for(o=0,a=n.length;o<a;++o){const l=n[o].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),d=(0,h.aF)(t,c);d<s&&(s=d,r=l)}}if(r){const l=r.tooltipPosition();e=l.x,i=l.y}return{x:e,y:i}}};function j(n,t){return t&&((0,h.b)(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function Y(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(` 7`)>-1?n.split(` 8`):n}function Oo(n,t){const{element:e,datasetIndex:i,index:s}=t,o=n.getDatasetMeta(i).controller,{label:a,value:r}=o.getLabelAndValue(s);return{chart:n,label:a,parsed:o.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:r,dataset:o.getDataset(),dataIndex:s,datasetIndex:i,element:e}}function Ai(n,t){const e=n.chart.ctx,{body:i,footer:s,title:o}=n,{boxWidth:a,boxHeight:r}=t,l=(0,h.a0)(t.bodyFont),c=(0,h.a0)(t.titleFont),d=(0,h.a0)(t.footerFont),u=o.length,f=s.length,g=i.length,p=(0,h.E)(t.padding);let m=p.height,x=0,b=i.reduce((v,y)=>v+y.before.length+y.lines.length+y.after.length,0);if(b+=n.beforeBody.length+n.afterBody.length,u&&(m+=u*c.lineHeight+(u-1)*t.titleSpacing+t.titleMarginBottom),b){const v=t.displayColors?Math.max(r,l.lineHeight):l.lineHeight;m+=g*v+(b-g)*l.lineHeight+(b-1)*t.bodySpacing}f&&(m+=t.footerMarginTop+f*d.lineHeight+(f-1)*t.footerSpacing);let _=0;const k=function(v){x=Math.max(x,e.measureText(v).width+_)};return e.save(),e.font=c.string,(0,h.F)(n.title,k),e.font=l.string,(0,h.F)(n.beforeBody.concat(n.afterBody),k),_=t.displayColors?a+2+t.boxPadding:0,(0,h.F)(i,v=>{(0,h.F)(v.before,k),(0,h.F)(v.lines,k),(0,h.F)(v.after,k)}),_=0,e.font=d.string,(0,h.F)(n.footer,k),e.restore(),x+=p.width,{width:x,height:m}}function To(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function Eo(n,t,e,i){const{x:s,width:o}=i,a=e.caretSize+e.caretPadding;if(n==="left"&&s+o+a>t.width||n==="right"&&s-o-a<0)return!0}function Ro(n,t,e,i){const{x:s,width:o}=e,{width:a,chartArea:{left:r,right:l}}=n;let c="center";return i==="center"?c=s<=(r+l)/2?"left":"right":s<=o/2?c="left":s>=a-o/2&&(c="right"),Eo(c,n,t,e)&&(c="center"),c}function Li(n,t,e){const i=e.yAlign||t.yAlign||To(n,e);return{xAlign:e.xAlign||t.xAlign||Ro(n,t,e,i),yAlign:i}}function Fo(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function zo(n,t,e){let{y:i,height:s}=n;return t==="top"?i+=e:t==="bottom"?i-=s+e:i-=s/2,i}function Oi(n,t,e,i){const{caretSize:s,caretPadding:o,cornerRadius:a}=n,{xAlign:r,yAlign:l}=e,c=s+o,{topLeft:d,topRight:u,bottomLeft:f,bottomRight:g}=(0,h.ay)(a);let p=Fo(t,r);const m=zo(t,l,c);return l==="center"?r==="left"?p+=c:r==="right"&&(p-=c):r==="left"?p-=Math.max(d,f)+s:r==="right"&&(p+=Math.max(u,g)+s),{x:(0,h.S)(p,0,i.width-t.width),y:(0,h.S)(m,0,i.height-t.height)}}function wt(n,t,e){const i=(0,h.E)(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function Ti(n){return j([],Y(n))}function Io(n,t,e){return(0,h.j)(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Ei(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const Ri={beforeTitle:h.aG,title(n){if(n.length>0){const t=n[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return e[t.dataIndex]}return""},afterTitle:h.aG,beforeBody:h.aG,beforeLabel:h.aG,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let t=n.dataset.label||"";t&&(t+=": ");const e=n.formattedValue;return(0,h.k)(e)||(t+=e),t},labelColor(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:h.aG,afterBody:h.aG,beforeFooter:h.aG,footer:h.aG,afterFooter:h.aG};function z(n,t,e,i){const s=n[t].call(e,i);return typeof s>"u"?Ri[t].call(e,i):s}class Fi extends N{static positioners=ct;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&e.options.animation&&i.animations,o=new Tt(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=Io(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,s=z(i,"beforeTitle",this,t),o=z(i,"title",this,t),a=z(i,"afterTitle",this,t);let r=[];return r=j(r,Y(s)),r=j(r,Y(o)),r=j(r,Y(a)),r}getBeforeBody(t,e){return Ti(z(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,s=[];return(0,h.F)(t,o=>{const a={before:[],lines:[],after:[]},r=Ei(i,o);j(a.before,Y(z(r,"beforeLabel",this,o))),j(a.lines,z(r,"label",this,o)),j(a.after,Y(z(r,"afterLabel",this,o))),s.push(a)}),s}getAfterBody(t,e){return Ti(z(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,s=z(i,"beforeFooter",this,t),o=z(i,"footer",this,t),a=z(i,"afterFooter",this,t);let r=[];return r=j(r,Y(s)),r=j(r,Y(o)),r=j(r,Y(a)),r}_createItems(t){const e=this._active,i=this.chart.data,s=[],o=[],a=[];let r=[],l,c;for(l=0,c=e.length;l<c;++l)r.push(Oo(this.chart,e[l]));return t.filter&&(r=r.filter((d,u,f)=>t.filter(d,u,f,i))),t.itemSort&&(r=r.sort((d,u)=>t.itemSort(d,u,i))),(0,h.F)(r,d=>{const u=Ei(t.callbacks,d);s.push(z(u,"labelColor",this,d)),o.push(z(u,"labelPointStyle",this,d)),a.push(z(u,"labelTextColor",this,d))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=a,this.dataPoints=r,r}update(t,e){const i=this.options.setContext(this.getContext()),s=this._active;let o,a=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{const r=ct[i.position].call(this,s,this._eventPosition);a=this._createItems(i),this.title=this.getTitle(a,i),this.beforeBody=this.getBeforeBody(a,i),this.body=this.getBody(a,i),this.afterBody=this.getAfterBody(a,i),this.footer=this.getFooter(a,i);const l=this._size=Ai(this,i),c=Object.assign({},r,l),d=Li(this.chart,i,c),u=Oi(i,c,d,this.chart);this.xAlign=d.xAlign,this.yAlign=d.yAlign,o={opacity:1,x:u.x,y:u.y,width:l.width,height:l.height,caretX:r.x,caretY:r.y}}this._tooltipItems=a,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){const o=this.getCaretPosition(t,i,s);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,i){const{xAlign:s,yAlign:o}=this,{caretSize:a,cornerRadius:r}=i,{topLeft:l,topRight:c,bottomLeft:d,bottomRight:u}=(0,h.ay)(r),{x:f,y:g}=t,{width:p,height:m}=e;let x,b,_,k,v,y;return o==="center"?(v=g+m/2,s==="left"?(x=f,b=x-a,k=v+a,y=v-a):(x=f+p,b=x+a,k=v-a,y=v+a),_=x):(s==="left"?b=f+Math.max(l,d)+a:s==="right"?b=f+p-Math.max(c,u)-a:b=this.caretX,o==="top"?(k=g,v=k-a,x=b-a,_=b+a):(k=g+m,v=k+a,x=b+a,_=b-a),y=k),{x1:x,x2:b,x3:_,y1:k,y2:v,y3:y}}drawTitle(t,e,i){const s=this.title,o=s.length;let a,r,l;if(o){const c=(0,h.aA)(i.rtl,this.x,this.width);for(t.x=wt(this,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",a=(0,h.a0)(i.titleFont),r=i.titleSpacing,e.fillStyle=i.titleColor,e.font=a.string,l=0;l<o;++l)e.fillText(s[l],c.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+r,l+1===o&&(t.y+=i.titleMarginBottom-r)}}_drawColorBox(t,e,i,s,o){const a=this.labelColors[i],r=this.labelPointStyles[i],{boxHeight:l,boxWidth:c}=o,d=(0,h.a0)(o.bodyFont),u=wt(this,"left",o),f=s.x(u),g=l<d.lineHeight?(d.lineHeight-l)/2:0,p=e.y+g;if(o.usePointStyle){const m={radius:Math.min(c,l)/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:1},x=s.leftForLtr(f,c)+c/2,b=p+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,(0,h.av)(t,m,x,b),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,(0,h.av)(t,m,x,b)}else{t.lineWidth=(0,h.i)(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;const m=s.leftForLtr(f,c),x=s.leftForLtr(s.xPlus(f,1),c-2),b=(0,h.ay)(a.borderRadius);Object.values(b).some(_=>_!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,(0,h.aw)(t,{x:m,y:p,w:c,h:l,radius:b}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),(0,h.aw)(t,{x,y:p+1,w:c-2,h:l-2,radius:b}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(m,p,c,l),t.strokeRect(m,p,c,l),t.fillStyle=a.backgroundColor,t.fillRect(x,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:s}=this,{bodySpacing:o,bodyAlign:a,displayColors:r,boxHeight:l,boxWidth:c,boxPadding:d}=i,u=(0,h.a0)(i.bodyFont);let f=u.lineHeight,g=0;const p=(0,h.aA)(i.rtl,this.x,this.width),m=function(w){e.fillText(w,p.x(t.x+g),t.y+f/2),t.y+=f+o},x=p.textAlign(a);let b,_,k,v,y,M,S;for(e.textAlign=a,e.textBaseline="middle",e.font=u.string,t.x=wt(this,x,i),e.fillStyle=i.bodyColor,(0,h.F)(this.beforeBody,m),g=r&&x!=="right"?a==="center"?c/2+d:c+2+d:0,v=0,M=s.length;v<M;++v){for(b=s[v],_=this.labelTextColors[v],e.fillStyle=_,(0,h.F)(b.before,m),k=b.lines,r&&k.length&&(this._drawColorBox(e,t,v,p,i),f=Math.max(u.lineHeight,l)),y=0,S=k.length;y<S;++y)m(k[y]),f=u.lineHeight;(0,h.F)(b.after,m)}g=0,f=u.lineHeight,(0,h.F)(this.afterBody,m),t.y-=o}drawFooter(t,e,i){const s=this.footer,o=s.length;let a,r;if(o){const l=(0,h.aA)(i.rtl,this.x,this.width);for(t.x=wt(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=l.textAlign(i.footerAlign),e.textBaseline="middle",a=(0,h.a0)(i.footerFont),e.fillStyle=i.footerColor,e.font=a.string,r=0;r<o;++r)e.fillText(s[r],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+i.footerSpacing}}drawBackground(t,e,i,s){const{xAlign:o,yAlign:a}=this,{x:r,y:l}=t,{width:c,height:d}=i,{topLeft:u,topRight:f,bottomLeft:g,bottomRight:p}=(0,h.ay)(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(r+u,l),a==="top"&&this.drawCaret(t,e,i,s),e.lineTo(r+c-f,l),e.quadraticCurveTo(r+c,l,r+c,l+f),a==="center"&&o==="right"&&this.drawCaret(t,e,i,s),e.lineTo(r+c,l+d-p),e.quadraticCurveTo(r+c,l+d,r+c-p,l+d),a==="bottom"&&this.drawCaret(t,e,i,s),e.lineTo(r+g,l+d),e.quadraticCurveTo(r,l+d,r,l+d-g),a==="center"&&o==="left"&&this.drawCaret(t,e,i,s),e.lineTo(r,l+u),e.quadraticCurveTo(r,l,r+u,l),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,s=i&&i.x,o=i&&i.y;if(s||o){const a=ct[t.position].call(this,this._active,this._eventPosition);if(!a)return;const r=this._size=Ai(this,t),l=Object.assign({},a,this._size),c=Li(e,t,l),d=Oi(t,l,c,e);(s._to!==d.x||o._to!==d.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=r.width,this.height=r.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,d))}}_willRender(){return!!this.opacity}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 a=(0,h.E)(e.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&r&&(t.save(),t.globalAlpha=i,this.drawBackground(o,t,s,e),(0,h.aB)(t,e.textDirection),o.y+=a.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),(0,h.aD)(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,s=t.map(({datasetIndex:r,index:l})=>{const c=this.chart.getDatasetMeta(r);if(!c)throw new Error("Cannot find a dataset at index "+r);return{datasetIndex:r,element:c.data[l],index:l}}),o=!(0,h.ai)(i,s),a=this._positionChanged(s,e);(o||a)&&(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||[],a=this._getActiveElements(t,o,e,i),r=this._positionChanged(a,t),l=e||!(0,h.ai)(a,o)||r;return l&&(this._active=a,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,i,s){const o=this.options;if(t.type==="mouseout")return[];if(!s)return e.filter(r=>this.chart.data.datasets[r.datasetIndex]&&this.chart.getDatasetMeta(r.datasetIndex).controller.getParsed(r.index)!==void 0);const a=this.chart.getElementsAtEventForMode(t,o.mode,o,i);return o.reverse&&a.reverse(),a}_positionChanged(t,e){const{caretX:i,caretY:s,options:o}=this,a=ct[o.position].call(this,t,e);return a!==!1&&(i!==a.x||s!==a.y)}}var zi={id:"tooltip",_element:Fi,positioners:ct,afterInit(n,t,e){e&&(n.tooltip=new Fi({chart:n,options:e}))},beforeUpdate(n,t,e){n.tooltip&&n.tooltip.initialize(e)},reset(n,t,e){n.tooltip&&n.tooltip.initialize(e)},afterDraw(n){const t=n.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(n.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",e)}},afterEvent(n,t){if(n.tooltip){const e=t.replay;n.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,t)=>t.bodyFont.size,boxWidth:(n,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Ri},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Ii=Object.freeze({__proto__:null,Colors:di,Decimation:gi,Filler:ki,Legend:Di,SubTitle:Ci,Title:Pi,Tooltip:zi});const Bo=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function Vo(n,t,e,i){const s=n.indexOf(t);if(s===-1)return Bo(n,t,e,i);const o=n.lastIndexOf(t);return s!==o?e:s}const Ho=(n,t)=>n===null?null:(0,h.S)(Math.round(n),0,t);function Bi(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class Vi extends X{static id="category";static defaults={ticks:{callback:Bi}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const i=this.getLabels();for(const{index:s,label:o}of e)i[s]===o&&i.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,e){if((0,h.k)(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:Vo(i,t,(0,h.v)(e,t),this._addedLabels),Ho(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),e||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,s=[];let o=this.getLabels();o=t===0&&e===o.length-1?o:o.slice(t,e+1),this._valueRange=Math.max(o.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let a=t;a<=e;a++)s.push({value:a});return s}getLabelForValue(t){return Bi.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function Wo(n,t){const e=[],{bounds:s,step:o,min:a,max:r,precision:l,count:c,maxTicks:d,maxDigits:u,includeBounds:f}=n,g=o||1,p=d-1,{min:m,max:x}=t,b=!(0,h.k)(a),_=!(0,h.k)(r),k=!(0,h.k)(c),v=(x-m)/(u+1);let y=(0,h.aI)((x-m)/p/g)*g,M,S,w,D;if(y<1e-14&&!b&&!_)return[{value:m},{value:x}];D=Math.ceil(x/y)-Math.floor(m/y),D>p&&(y=(0,h.aI)(D*y/p/g)*g),(0,h.k)(l)||(M=Math.pow(10,l),y=Math.ceil(y*M)/M),s==="ticks"?(S=Math.floor(m/y)*y,w=Math.ceil(x/y)*y):(S=m,w=x),b&&_&&o&&(0,h.aJ)((r-a)/o,y/1e3)?(D=Math.round(Math.min((r-a)/y,d)),y=(r-a)/D,S=a,w=r):k?(S=b?a:S,w=_?r:w,D=c-1,y=(w-S)/D):(D=(w-S)/y,(0,h.aK)(D,Math.round(D),y/1e3)?D=Math.round(D):D=Math.ceil(D));const P=Math.max((0,h.aL)(y),(0,h.aL)(S));M=Math.pow(10,(0,h.k)(l)?P:l),S=Math.round(S*M)/M,w=Math.round(w*M)/M;let C=0;for(b&&(f&&S!==a?(e.push({value:a}),S<a&&C++,(0,h.aK)(Math.round((S+C*y)*M)/M,a,Hi(a,v,n))&&C++):S<a&&C++);C<D;++C){const A=Math.round((S+C*y)*M)/M;if(_&&A>r)break;e.push({value:A})}return _&&f&&w!==r?e.length&&(0,h.aK)(e[e.length-1].value,r,Hi(r,v,n))?e[e.length-1].value=r:e.push({value:r}):(!_||w===r)&&e.push({value:w}),e}function Hi(n,t,{horizontal:e,minRotation:i}){const s=(0,h.t)(i),o=(e?Math.sin(s):Math.cos(s))||.001,a=.75*t*(""+n).length;return Math.min(t/o,a)}class Dt extends X{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return(0,h.k)(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:s,max:o}=this;const a=l=>s=e?s:l,r=l=>o=i?o:l;if(t){const l=(0,h.s)(s),c=(0,h.s)(o);l<0&&c<0?r(0):l>0&&c>0&&a(0)}if(s===o){let l=o===0?1:Math.abs(o*.05);r(o+l),t||a(s-l)}this.min=s,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:i}=t,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),e=e||11),e&&(s=Math.min(e,s)),s}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:e.includeBounds!==!1},o=this._range||this,a=Wo(s,o);return t.bounds==="ticks"&&(0,h.aH)(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-e)/Math.max(t.length-1,1)/2;e-=s,i+=s}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return(0,h.o)(t,this.chart.options.locale,this.options.ticks.format)}}class Wi extends Dt{static id="linear";static defaults={ticks:{callback:h.aM.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=(0,h.g)(t)?t:0,this.max=(0,h.g)(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=(0,h.t)(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 t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const dt=n=>Math.floor((0,h.aN)(n)),K=(n,t)=>Math.pow(10,dt(n)+t);function Ni(n){return n/Math.pow(10,dt(n))===1}function ji(n,t,e){const i=Math.pow(10,e),s=Math.floor(n/i);return Math.ceil(t/i)-s}function No(n,t){const e=t-n;let i=dt(e);for(;ji(n,t,i)>10;)i++;for(;ji(n,t,i)<10;)i--;return Math.min(i,dt(n))}function jo(n,{min:t,max:e}){t=(0,h.O)(n.min,t);const i=[],s=dt(t);let o=No(t,e),a=o<0?Math.pow(10,Math.abs(o)):1;const r=Math.pow(10,o),l=s>o?Math.pow(10,s):0,c=Math.round((t-l)*a)/a,d=Math.floor((t-l)/r/10)*r*10;let u=Math.floor((c-d)/Math.pow(10,o)),f=(0,h.O)(n.min,Math.round((l+d+u*Math.pow(10,o))*a)/a);for(;f<e;)i.push({value:f,major:Ni(f),significand:u}),u>=10?u=u<15?15:20:u++,u>=20&&(o++,u=2,a=o>=0?1:a),f=Math.round((l+d+u*Math.pow(10,o))*a)/a;const g=(0,h.O)(n.max,f);return i.push({value:g,major:Ni(g),significand:u}),i}class $i extends X{static id="logarithmic";static defaults={ticks:{callback:h.aM.formatters.logarithmic,major:{enabled:!0}}};constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=Dt.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return(0,h.g)(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=(0,h.g)(t)?Math.max(0,t):null,this.max=(0,h.g)(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!(0,h.g)(this._userMin)&&(this.min=t===K(this.min,0)?K(this.min,-1):K(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,s=this.max;const o=r=>i=t?i:r,a=r=>s=e?s:r;i===s&&(i<=0?(o(1),a(10)):(o(K(i,-1)),a(K(s,1)))),i<=0&&o(K(s,-1)),s<=0&&a(K(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=jo(e,this);return t.bounds==="ticks"&&(0,h.aH)(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":(0,h.o)(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=(0,h.aN)(t),this._valueRange=(0,h.aN)(this.max)-(0,h.aN)(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:((0,h.aN)(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function Zt(n){const t=n.ticks;if(t.display&&n.display){const e=(0,h.E)(t.backdropPadding);return(0,h.v)(t.font&&t.font.size,h.d.font.size)+e.height}return 0}function $o(n,t,e){return e=(0,h.b)(e)?e:[e],{w:(0,h.aO)(n,t.string,e),h:e.length*t.lineHeight}}function Yi(n,t,e,i,s){return n===i||n===s?{start:t-e/2,end:t+e/2}:n<i||n>s?{start:t-e,end:t}:{start:t,end:t+e}}function Yo(n){const t={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},e=Object.assign({},t),i=[],s=[],o=n._pointLabels.length,a=n.options.pointLabels,r=a.centerPointLabels?h.P/o:0;for(let l=0;l<o;l++){const c=a.setContext(n.getPointLabelContext(l));s[l]=c.padding;const d=n.getPointPosition(l,n.drawingArea+s[l],r),u=(0,h.a0)(c.font),f=$o(n.ctx,u,n._pointLabels[l]);i[l]=f;const g=(0,h.al)(n.getIndexAngle(l)+r),p=Math.round((0,h.U)(g)),m=Yi(p,d.x,f.w,0,180),x=Yi(p,d.y,f.h,90,270);Xo(e,t,g,m,x)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=Ko(n,i,s)}function Xo(n,t,e,i,s){const o=Math.abs(Math.sin(e)),a=Math.abs(Math.cos(e));let r=0,l=0;i.start<t.l?(r=(t.l-i.start)/o,n.l=Math.min(n.l,t.l-r)):i.end>t.r&&(r=(i.end-t.r)/o,n.r=Math.max(n.r,t.r+r)),s.start<t.t?(l=(t.t-s.start)/a,n.t=Math.min(n.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/a,n.b=Math.max(n.b,t.b+l))}function Uo(n,t,e){const i=n.drawingArea,{extra:s,additionalAngle:o,padding:a,size:r}=e,l=n.getPointPosition(t,i+s+a,o),c=Math.round((0,h.U)((0,h.al)(l.angle+h.H))),d=qo(l.y,r.h,c),u=Qo(c),f=Jo(l.x,r.w,u);return{visible:!0,x:l.x,y:d,textAlign:u,left:f,top:d,right:f+r.w,bottom:d+r.h}}function Go(n,t){if(!t)return!0;const{left:e,top:i,right:s,bottom:o}=n;
8return!((0,h.C)({x:e,y:i},t)||(0,h.C)({x:e,y:o},t)||(0,h.C)({x:s,y:i},t)||(0,h.C)({x:s,y:o},t))}function Ko(n,t,e){const i=[],s=n._pointLabels.length,o=n.options,{centerPointLabels:a,display:r}=o.pointLabels,l={extra:Zt(o)/2,additionalAngle:a?h.P/s:0};let c;for(let d=0;d<s;d++){l.padding=e[d],l.size=t[d];const u=Uo(n,d,l);i.push(u),r==="auto"&&(u.visible=Go(u,c),u.visible&&(c=u))}return i}function Qo(n){return n===0||n===180?"center":n<180?"left":"right"}function Jo(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function qo(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function Zo(n,t,e){const{left:i,top:s,right:o,bottom:a}=e,{backdropColor:r}=t;if(!(0,h.k)(r)){const l=(0,h.ay)(t.borderRadius),c=(0,h.E)(t.backdropPadding);n.fillStyle=r;const d=i-c.left,u=s-c.top,f=o-i+c.width,g=a-s+c.height;Object.values(l).some(p=>p!==0)?(n.beginPath(),(0,h.aw)(n,{x:d,y:u,w:f,h:g,radius:l}),n.fill()):n.fillRect(d,u,f,g)}}function ta(n,t){const{ctx:e,options:{pointLabels:i}}=n;for(let s=t-1;s>=0;s--){const o=n._pointLabelItems[s];if(!o.visible)continue;const a=i.setContext(n.getPointLabelContext(s));Zo(e,a,o);const r=(0,h.a0)(a.font),{x:l,y:c,textAlign:d}=o;(0,h.Z)(e,n._pointLabels[s],l,c+r.lineHeight/2,r,{color:a.color,textAlign:d,textBaseline:"middle"})}}function Xi(n,t,e,i){const{ctx:s}=n;if(e)s.arc(n.xCenter,n.yCenter,t,0,h.T);else{let o=n.getPointPosition(0,t);s.moveTo(o.x,o.y);for(let a=1;a<i;a++)o=n.getPointPosition(a,t),s.lineTo(o.x,o.y)}}function ea(n,t,e,i,s){const o=n.ctx,a=t.circular,{color:r,lineWidth:l}=t;!a&&!i||!r||!l||e<0||(o.save(),o.strokeStyle=r,o.lineWidth=l,o.setLineDash(s.dash||[]),o.lineDashOffset=s.dashOffset,o.beginPath(),Xi(n,e,a,i),o.closePath(),o.stroke(),o.restore())}function ia(n,t,e){return(0,h.j)(n,{label:e,index:t,type:"pointLabel"})}class Ui extends Dt{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:h.aM.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=(0,h.E)(Zt(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=(0,h.g)(t)&&!isNaN(t)?t:0,this.max=(0,h.g)(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Zt(this.options))}generateTickLabels(t){Dt.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{const s=(0,h.Q)(this.options.pointLabels.callback,[e,i],this);return s||s===0?s:""}).filter((e,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?Yo(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,s))}getIndexAngle(t){const e=h.T/(this._pointLabels.length||1),i=this.options.startAngle||0;return(0,h.al)(t*e+(0,h.t)(i))}getDistanceFromCenterForValue(t){if((0,h.k)(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((0,h.k)(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<e.length){const i=e[t];return ia(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const s=this.getIndexAngle(t)-h.H+i;return{x:Math.cos(s)*e+this.xCenter,y:Math.sin(s)*e+this.yCenter,angle:s}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:i,right:s,bottom:o}=this._pointLabelItems[t];return{left:e,top:i,right:s,bottom:o}}
vendor: 10,100 bytes, line 8
8drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),Xi(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:s,border:o}=e,a=this._pointLabels.length;let r,l,c;if(e.pointLabels.display&&ta(this,a),s.display&&this.ticks.forEach((d,u)=>{if(u!==0||u===0&&this.min<0){l=this.getDistanceFromCenterForValue(d.value);const f=this.getContext(u),g=s.setContext(f),p=o.setContext(f);ea(this,g,l,a,p)}}),i.display){for(t.save(),r=a-1;r>=0;r--){const d=i.setContext(this.getPointLabelContext(r)),{color:u,lineWidth:f}=d;!f||!u||(t.lineWidth=f,t.strokeStyle=u,t.setLineDash(d.borderDash),t.lineDashOffset=d.borderDashOffset,l=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),c=this.getPointPosition(r,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.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,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((r,l)=>{if(l===0&&this.min>=0&&!e.reverse)return;const c=i.setContext(this.getContext(l)),d=(0,h.a0)(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=d.string,a=t.measureText(r.label).width,t.fillStyle=c.backdropColor;const u=(0,h.E)(c.backdropPadding);t.fillRect(-a/2-u.left,-o-d.size/2-u.top,a+u.width,d.size+u.height)}(0,h.Z)(t,r.label,0,-o,d,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}const Pt={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}},I=Object.keys(Pt);function Gi(n,t){return n-t}function Ki(n,t){if((0,h.k)(t))return null;const e=n._adapter,{parser:i,round:s,isoWeekday:o}=n._parseOpts;let a=t;return typeof i=="function"&&(a=i(a)),(0,h.g)(a)||(a=typeof i=="string"?e.parse(a,i):e.parse(a)),a===null?null:(s&&(a=s==="week"&&((0,h.x)(o)||o===!0)?e.startOf(a,"isoWeek",o):e.startOf(a,s)),+a)}function Qi(n,t,e,i){const s=I.length;for(let o=I.indexOf(n);o<s-1;++o){const a=Pt[I[o]],r=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((e-t)/(r*a.size))<=i)return I[o]}return I[s-1]}function sa(n,t,e,i,s){for(let o=I.length-1;o>=I.indexOf(e);o--){const a=I[o];if(Pt[a].common&&n._adapter.diff(s,i,a)>=t-1)return a}return I[e?I.indexOf(e):0]}function na(n){for(let t=I.indexOf(n)+1,e=I.length;t<e;++t)if(Pt[I[t]].common)return I[t]}function Ji(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:s}=(0,h.aQ)(e,t),o=e[i]>=t?e[i]:e[s];n[o]=!0}}function oa(n,t,e,i){const s=n._adapter,o=+s.startOf(t[0].value,i),a=t[t.length-1].value;let r,l;for(r=o;r<=a;r=+s.add(r,1,i))l=e[r],l>=0&&(t[l].major=!0);return t}function qi(n,t,e){const i=[],s={},o=t.length;let a,r;for(a=0;a<o;++a)r=t[a],s[r]=a,i.push({value:r,major:!1});return o===0||!e?i:oa(n,i,s,e)}class Ct extends X{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const i=t.time||(t.time={}),s=this._adapter=new ye._date(t.adapters.date);s.init(e),(0,h.ab)(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:Ki(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:s,max:o,minDefined:a,maxDefined:r}=this.getUserBounds();function l(c){!a&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!r&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!a||!r)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=(0,h.g)(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),o=(0,h.g)(o)&&!isNaN(o)?o:+e.endOf(Date.now(),i)+1,this.min=Math.min(s,o-1),this.max=Math.max(s+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,s=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const o=this.min,a=this.max,r=(0,h.aP)(s,o,a);return this._unit=e.unit||(i.autoSkip?Qi(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):sa(this,r.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:na(this._unit),this.initOffsets(s),t.reverse&&r.reverse(),qi(this,r,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,i=0,s,o;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?e=1-s:e=(this.getDecimalForValue(t[1])-s)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?i=o:i=(o-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;e=(0,h.S)(e,0,a),i=(0,h.S)(i,0,a),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter,e=this.min,i=this.max,s=this.options,o=s.time,a=o.unit||Qi(o.minUnit,e,i,this._getLabelCapacity(e)),r=(0,h.v)(s.ticks.stepSize,1),l=a==="week"?o.isoWeekday:!1,c=(0,h.x)(l)||l===!0,d={};let u=e,f,g;if(c&&(u=+t.startOf(u,"isoWeek",l)),u=+t.startOf(u,c?"day":a),t.diff(i,e,a)>1e5*r)throw new Error(e+" and "+i+" are too far apart with stepSize of "+r+" "+a);const p=s.ticks.source==="data"&&this.getDataTimestamps();for(f=u,g=0;f<i;f=+t.add(f,r,a),g++)Ji(d,f,p);return(f===i||s.bounds==="ticks"||g===1)&&Ji(d,f,p),Object.keys(d).sort(Gi).map(m=>+m)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const s=this.options.time.displayFormats,o=this._unit,a=e||s[o];return this._adapter.format(t,a)}_tickFormatFunction(t,e,i,s){const o=this.options,a=o.ticks.callback;if(a)return(0,h.Q)(a,[t,e,i],this);const r=o.time.displayFormats,l=this._unit,c=this._majorUnit,d=l&&r[l],u=c&&r[c],f=i[e],g=c&&u&&f&&f.major;return this._adapter.format(t,s||(g?u:d))}generateTickLabels(t){let e,i,s;for(e=0,i=t.length;e<i;++e)s=t[e],s.label=this._tickFormatFunction(s.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,s=(0,h.t)(this.isHorizontal()?e.maxRotation:e.minRotation),o=Math.cos(s),a=Math.sin(s),r=this._resolveTickFontOptions(0).size;return{w:i*o+r*a,h:i*a+r*o}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,s=i[e.unit]||i.millisecond,o=this._tickFormatFunction(t,0,qi(this,[t],this._majorUnit),s),a=this._getLabelSize(o),r=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return r>0?r:1}getDataTimestamps(){let t=this._cache.data||[],e,i;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(e=0,i=s.length;e<i;++e)t=t.concat(s[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const s=this.getLabels();for(e=0,i=s.length;e<i;++e)t.push(Ki(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return(0,h._)(t.sort(Gi))}}function At(n,t,e){let i=0,s=n.length-1,o,a,r,l;e?(t>=n[i].pos&&t<=n[s].pos&&({lo:i,hi:s}=(0,h.B)(n,"pos",t)),{pos:o,time:r}=n[i],{pos:a,time:l}=n[s]):(t>=n[i].time&&t<=n[s].time&&({lo:i,hi:s}=(0,h.B)(n,"time",t)),{time:o,pos:r}=n[i],{time:a,pos:l}=n[s]);const c=a-o;return c?r+(l-r)*(t-o)/c:r}class Zi extends Ct{static id="timeseries";static defaults=Ct.defaults;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=At(e,this.min),this._tableRange=At(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,s=[],o=[];let a,r,l,c,d;for(a=0,r=t.length;a<r;++a)c=t[a],c>=e&&c<=i&&s.push(c);if(s.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(a=0,r=s.length;a<r;++a)d=s[a+1],l=s[a-1],c=s[a],Math.round((d+l)/2)!==c&&o.push({time:c,pos:a/(r-1)});return o}_generate(){const t=this.min,e=this.max;let i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(e)||i.length===1)&&i.push(e),i.sort((s,o)=>s-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return e.length&&i.length?t=this.normalize(e.concat(i)):t=e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(At(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return At(this._table,i*this._tableRange+this._minPos,!0)}}var ts=Object.freeze({__proto__:null,CategoryScale:Vi,LinearScale:Wi,LogarithmicScale:$i,RadialLinearScale:Ui,TimeScale:Ct,TimeSeriesScale:Zi});const aa=[_e,ai,Ii,ts]}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.