PageSourceSearch

https://trains.fyi/_next/static/chunks/6d2b60a9-b1987f57b5499ce8.js

js trains.fyi collected 2026-10-01 12:17:57 UTC 123,691 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2697],{81047:(t,e,i)=>{i.d(e,{Bs:()=>tV,FN:()=>tK,No:()=>tG,P$:()=>M,PP:()=>eh,ZT:()=>w,hE:()=>t3,kc:()=>ec,m_:()=>eo,s$:()=>t2,t1:()=>tF});var s=i(62601);class a{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,s){let a=e.listeners[s],n=e.duration;a.forEach(s=>s({chart:t,initial:e.initial,numSteps:n,currentStep:Math.min(i-e.start,n)}))}_refresh(){this._request||(this._running=!0,this._request=s.r.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,s)=>{let a;if(!i.running||!i.items.length)return;let n=i.items,o=n.length-1,r=!1;for(;o>=0;--o)(a=n[o])._active?(a._total>i.duration&&(i.duration=a._total),a.tick(t),r=!0):(n[o]=n[n.length-1],n.pop());r&&(s.draw(),this._notify(s,i,t,"progress")),n.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=n.length}),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){let e=this._charts,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){let e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((t,e)=>Math.max(t,e._duration),0),this._refresh())}running(t){if(!this._running)return!1;let e=this._charts.get(t);return!!e&&!!e.running&&!!e.items.length}stop(t){let e=this._charts.get(t);if(!e||!e.items.length)return;let i=e.items,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 n=new a;let o="transparent",r={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){let a=(0,s.c)(t||o),n=a.valid&&(0,s.c)(e||o);
1return n&&n.valid?n.mix(a,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class h{constructor(t,e,i,a){const n=e[i];a=(0,s.a)([t.to,a,n,t.from]);const o=(0,s.a)([t.from,n,a]);this._active=!0,this._fn=t.fn||r[t.type||typeof o],this._easing=s.e[t.easing]||s.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=o,this._to=a,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);let a=this._target[this._prop],n=i-this._start,o=this._duration-n;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=n,this._loop=!!t.loop,this._to=(0,s.a)([t.to,e,a,t.from]),this._from=(0,s.a)([t.from,a,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){let e,i=t-this._start,s=this._duration,a=this._prop,n=this._from,o=this._loop,r=this._to;if(this._active=n!==r&&(o||i<s),!this._active){this._target[a]=r,this._notify(!0);return}if(i<0){this._target[a]=n;return}e=i/s%2,e=o&&e>1?2-e:e,e=this._easing(Math.min(1,Math.max(0,e))),this._target[a]=this._fn(n,r,e)}wait(){let t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){let e=t?"res":"rej",i=this._promises||[];for(let t=0;t<i.length;t++)i[t][e]()}}class l{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!(0,s.i)(t))return;let e=Object.keys(s.d.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(a=>{let n=t[a];if(!(0,s.i)(n))return;let o={};for(let t of e)o[t]=n[t];((0,s.b)(n.properties)&&n.properties||[a]).forEach(t=>{t!==a&&i.has(t)||i.set(t,o)})})}_animateOptions(t,e){let i=e.options,s=function(t,e){if(!e)return;let i=t.options;if(!i){t.options=e;return}return i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}})),i}(t,i);if(!s)return[];let a=this._createAnimations(s,i);return i.$shared&&(function(t,e){let i=[],s=Object.keys(e);for(let e=0;e<s.length;e++){let a=t[s[e]];a&&a.active()&&i.push(a.wait())}return Promise.all(i)})(t.options.$animations,i).then(()=>{t.options=i},()=>{}),a}_createAnimations(t,e){let i,s=this._properties,a=[],n=t.$animations||(t.$animations={}),o=Object.keys(e),r=Date.now();for(i=o.length-1;i>=0;--i){let l=o[i];if("$"===l.charAt(0))continue;if("options"===l){a.push(...this._animateOptions(t,e));continue}let d=e[l],c=n[l],u=s.get(l);if(c)if(u&&c.active()){c.update(u,d,r);continue}else c.cancel();if(!u||!u.duration){t[l]=d;continue}n[l]=c=new h(u,t,l,d),a.push(c)}return a}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);let i=this._createAnimations(t,e);if(i.length)return n.add(this._chart,i),!0}}function d(t,e){let i=t&&t.options||{},s=i.reverse,a=void 0===i.min?e:0,n=void 0===i.max?e:0;return{start:s?n:a,end:s?a:n}}function c(t,e){let i,s,a=[],n=t._getSortedDatasetMetas(e);for(i=0,s=n.length;i<s;++i)a.push(n[i].index);return a}function u(t,e,i,a={}){let n,o,r,h,l=t.keys,d="single"===a.mode;if(null===e)return;let c=!1;for(n=0,o=l.length;n<o;++n){if((r=+l[n])===i){if(c=!0,a.all)continue;break}h=t.values[r],(0,s.g)(h)&&(d||0===e||(0,s.s)(e)===(0,s.s)(h))&&(e+=h)}return c||a.all?e:0}function g(t,e){let i=t&&t.options.stacked;return i||void 0===i&&void 0!==e.stack}function p(t,e,i,s){for(let a of e.getMatchingVisibleMetas(s).reverse()){let e=t[a.index];if(i&&e>0||!i&&e<0)return a.index}return null}function f(t,e){let i,{chart:s,_cachedMeta:a}=t,n=s._stacks||(s._stacks={}),{iScale:o,vScale:r,index:h}=a,l=o.axis,d=r.axis,c=`${o.id}.${r.id}.${a.stack||a.type}`,u=e.length;for(let t=0;t<u;++t){let s=e[t],{[l]:o,[d]:u}=s;(i=(s._stacks||(s._stacks={}))[d]=function(t,e,i){let s=t[e]||(t[e]={});return s[i]||(s[i]={})}(n,c,o))[h]=u,i._top=p(i,r,!0,a.type),i._bottom=p(i,r,!1,a.type),(i._visualValues||(i._visualValues={}))[h]=u}}function m(t,e){let i=t.scales;return Object.keys(i).filter(t=>i[t].axis===e).shift()}function _(t,e){let i=t.controller.index,s=t.vScale&&t.vScale.axis;if(s)for(let a of e=e||t._parsed){let t=a._stacks;if(!t||void 0===t[s]||void 0===t[s][i])return;delete t[s][i],void 0!==t[s]._visualValues&&void 0!==t[s]._visualValues[i]&&delete t[s]._visualValues[i]}}let x=t=>"reset"===t||"none"===t,b=(t,e)=>e?t:Object.assign({},t);class v{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(){let t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=g(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&&_(this._cachedMeta),this.index=t}linkScales(){let t=this.chart,e=this._cachedMeta,i=this.getDataset(),a=(t,e,i,s)=>"x"===t?e:"r"===t?s:i,n=e.xAxisID=(0,s.v)(i.xAxisID,m(t,"x")),o=e.yAxisID=(0,s.v)(i.yAxisID,m(t,"y")),r=e.rAxisID=(0,s.v)(i.rAxisID,m(t,"r")),h=e.indexAxis,l=e.iAxisID=a(h,n,o,r),d=e.vAxisID=a(h,o,n,r);e.xScale=this.getScaleForId(n),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(r),e.iScale=this.getScaleForId(l),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){let e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){let t=this._cachedMeta;this._data&&(0,s.u)(this._data,this),t._stacked&&_(t)}_dataCheck(){let t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if((0,s.i)(e)){let t=this._cachedMeta;this._data=function(t,e){let i,s,a,{iScale:n,vScale:o}=e,r="x"===n.axis?"x":"y",h="x"===o.axis?"x":"y",l=Object.keys(t),d=Array(l.length);for(i=0,s=l.length;i<s;++i)a=l[i],d[i]={[r]:a,[h]:t[a]};return d}(e,t)}else if(i!==e){if(i){(0,s.u)(i,this);let t=this._cachedMeta;_(t),t._parsed=[]}
1e&&Object.isExtensible(e)&&(0,s.l)(e,this),this._syncList=[],this._data=e}}addElements(){let t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){let e=this._cachedMeta,i=this.getDataset(),s=!1;this._dataCheck();let a=e._stacked;e._stacked=g(e.vScale,e),e.stack!==i.stack&&(s=!0,_(e),e.stack=i.stack),this._resyncElements(t),(s||a!==e._stacked)&&(f(this,e._parsed),e._stacked=g(e.vScale,e))}configure(){let 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){let i,a,n,{_cachedMeta:o,_data:r}=this,{iScale:h,_stacked:l}=o,d=h.axis,c=0===t&&e===r.length||o._sorted,u=t>0&&o._parsed[t-1];if(!1===this._parsing)o._parsed=r,o._sorted=!0,n=r;else{n=(0,s.b)(r[t])?this.parseArrayData(o,r,t,e):(0,s.i)(r[t])?this.parseObjectData(o,r,t,e):this.parsePrimitiveData(o,r,t,e);let h=()=>null===a[d]||u&&a[d]<u[d];for(i=0;i<e;++i)o._parsed[i+t]=a=n[i],c&&(h()&&(c=!1),u=a);o._sorted=c}l&&f(this,n)}parsePrimitiveData(t,e,i,s){let a,n,{iScale:o,vScale:r}=t,h=o.axis,l=r.axis,d=o.getLabels(),c=o===r,u=Array(s);for(a=0;a<s;++a)n=a+i,u[a]={[h]:c||o.parse(d[n],n),[l]:r.parse(e[n],n)};return u}parseArrayData(t,e,i,s){let a,n,o,{xScale:r,yScale:h}=t,l=Array(s);for(a=0;a<s;++a)o=e[n=a+i],l[a]={x:r.parse(o[0],n),y:h.parse(o[1],n)};return l}parseObjectData(t,e,i,a){let n,o,r,{xScale:h,yScale:l}=t,{xAxisKey:d="x",yAxisKey:c="y"}=this._parsing,u=Array(a);for(n=0;n<a;++n)r=e[o=n+i],u[n]={x:h.parse((0,s.f)(r,d),o),y:l.parse((0,s.f)(r,c),o)};return u}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){let s=this.chart,a=this._cachedMeta,n=e[t.axis];return u({keys:c(s,!0),values:e._stacks[t.axis]._visualValues},n,a.index,{mode:i})}updateRangeFromParsed(t,e,i,s){let a=i[e.axis],n=null===a?NaN:a,o=s&&i._stacks[e.axis];s&&o&&(s.values=o,n=u(s,a,this._cachedMeta.index)),t.min=Math.min(t.min,n),t.max=Math.max(t.max,n)}getMinMax(t,e){let i,a,n,o=this._cachedMeta,r=o._parsed,h=o._sorted&&t===o.iScale,l=r.length,d=this._getOtherScale(t),u=(n=this.chart,e&&!o.hidden&&o._stacked&&{keys:c(n,!0),values:null}),g={min:1/0,max:-1/0},{min:p,max:f}=function(t){let{min:e,max:i,minDefined:s,maxDefined:a}=t.getUserBounds();return{min:s?e:-1/0,max:a?i:1/0}}(d);function m(){let e=(a=r[i])[d.axis];return!(0,s.g)(a[t.axis])||p>e||f<e}for(i=0;i<l&&(m()||(this.updateRangeFromParsed(g,t,a,u),!h));++i);if(h){for(i=l-1;i>=0;--i)if(!m()){this.updateRangeFromParsed(g,t,a,u);break}}return g}getAllParsedValues(t){let e,i,a,n=this._cachedMeta._parsed,o=[];for(e=0,i=n.length;e<i;++e)a=n[e][t.axis],(0,s.g)(a)&&o.push(a);return o}getMaxOverflow(){return!1}getLabelAndValue(t){let e=this._cachedMeta,i=e.iScale,s=e.vScale,a=this.getParsed(t);return{label:i?""+i.getLabelForValue(a[i.axis]):"",value:s?""+s.getLabelForValue(a[s.axis]):""}}_update(t){var e;let i,a,n,o,r=this._cachedMeta;this.update(t||"default"),e=(0,s.v)(this.options.clip,function(t,e,i){if(!1===i)return!1;let s=d(t,i),a=d(e,i);return{top:a.end,right:s.end,bottom:a.start,left:s.start}}(r.xScale,r.yScale,this.getMaxOverflow())),(0,s.i)(e)?(i=e.top,a=e.right,n=e.bottom,o=e.left):i=a=n=o=e,r._clip={top:i,right:a,bottom:n,left:o,disabled:!1===e}}update(t){}draw(){let t,e=this._ctx,i=this.chart,s=this._cachedMeta,a=s.data||[],n=i.chartArea,o=[],r=this._drawStart||0,h=this._drawCount||a.length-r,l=this.options.drawActiveElementsOnTop;for(s.dataset&&s.dataset.draw(e,n,r,h),t=r;t<r+h;++t){let i=a[t];i.hidden||(i.active&&l?o.push(i):i.draw(e,n))}for(t=0;t<o.length;++t)o[t].draw(e,n)}getStyle(t,e){let i=e?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){var a,n,o;let r,h=this.getDataset();if(t>=0&&t<this._cachedMeta.data.length){let e=this._cachedMeta.data[t];(r=e.$context||(a=this.getContext(),e.$context=(0,s.j)(a,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"}))).parsed=this.getParsed(t),r.raw=h.data[t],r.index=r.dataIndex=t}else(r=this.$context||(this.$context=(n=this.chart.getContext(),o=this.index,(0,s.j)(n,{active:!1,dataset:void 0,datasetIndex:o,index:o,mode:"default",type:"dataset"})))).dataset=h,r.index=r.datasetIndex=this.index;return r.active=!!e,r.mode=i,r}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){let a="active"===e,n=this._cachedDataOpts,o=t+"-"+e,r=n[o],h=this.enableOptionSharing&&(0,s.h)(i);if(r)return b(r,h);let l=this.chart.config,d=l.datasetElementScopeKeys(this._type,t),c=a?[`${t}Hover`,"hover",t,""]:[t,""],u=l.getOptionScopes(this.getDataset(),d),g=Object.keys(s.d.elements[t]),p=()=>this.getContext(i,a,e),f=l.resolveNamedOptions(u,g,p,c);return f.$shared&&(f.$shared=h,n[o]=Object.freeze(b(f,h))),f}_resolveAnimations(t,e,i){let s,a=this.chart,n=this._cachedDataOpts,o=`animation-${e}`,r=n[o];if(r)return r;if(!1!==a.options.animation){let a=this.chart.config,n=a.datasetAnimationScopeKeys(this._type,e),o=a.getOptionScopes(this.getDataset(),n);s=a.createResolver(o,this.getContext(t,i,e))}let h=new l(a,s&&s.animations);return s&&s._cacheable&&(n[o]=Object.freeze(h)),h}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||x(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){let i=this.resolveDataElementOptions(t,e),s=this._sharedOptions,a=this.getSharedOptions(i),n=this.includeOptions(e,a)||a!==s;return this.updateSharedOptions(a,e,i),{sharedOptions:a,includeOptions:n}}updateElement(t,e,i,s){x(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!x(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;let a=this.getStyle(e,s);
1this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(a)||a})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){let e=this._data,i=this._cachedMeta.data;for(let[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];let s=i.length,a=e.length,n=Math.min(a,s);n&&this.parse(0,n),a>s?this._insertElements(s,a-s,t):a<s&&this._removeElements(a,s-a)}_insertElements(t,e,i=!0){let s,a=this._cachedMeta,n=a.data,o=t+e,r=t=>{for(t.length+=e,s=t.length-1;s>=o;s--)t[s]=t[s-e]};for(r(n),s=t;s<o;++s)n[s]=new this.dataElementType;this._parsing&&r(a._parsed),this.parse(t,e),i&&this.updateElements(n,t,e,"reset")}updateElements(t,e,i,s){}_removeElements(t,e){let i=this._cachedMeta;if(this._parsing){let s=i._parsed.splice(t,e);i._stacked&&_(i,s)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{let[e,i,s]=t;this[e](i,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){let t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);let i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}class y extends v{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=>"spacing"!==t,_indexable:t=>"spacing"!==t&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let e=t.data;if(e.labels.length&&e.datasets.length){let{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map((e,a)=>{let n=t.getDatasetMeta(0).controller.getStyle(a);return{text:e,fillStyle:n.backgroundColor,strokeStyle:n.borderColor,fontColor:s,lineWidth:n.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(a),index:a}})}return[]}},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){let i=this.getDataset().data,a=this._cachedMeta;if(!1===this._parsing)a._parsed=i;else{let n,o,r=t=>+i[t];if((0,s.i)(i[t])){let{key:t="value"}=this._parsing;r=e=>+(0,s.f)(i[e],t)}for(n=t,o=t+e;n<o;++n)a._parsed[n]=r(n)}}_getRotation(){return(0,s.t)(this.options.rotation-90)}_getCircumference(){return(0,s.t)(this.options.circumference)}_getRotationExtents(){let t=s.T,e=-s.T;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){let s=this.chart.getDatasetMeta(i).controller,a=s._getRotation(),n=s._getCircumference();t=Math.min(t,a),e=Math.max(e,a+n)}return{rotation:t,circumference:e-t}}update(t){let{chartArea:e}=this.chart,i=this._cachedMeta,a=i.data,n=this.getMaxBorderWidth()+this.getMaxOffset(a
1)+this.options.spacing,o=Math.max((Math.min(e.width,e.height)-n)/2,0),r=Math.min((0,s.m)(this.options.cutout,o),1),h=this._getRingWeight(this.index),{circumference:l,rotation:d}=this._getRotationExtents(),{ratioX:c,ratioY:u,offsetX:g,offsetY:p}=function(t,e,i){let a=1,n=1,o=0,r=0;if(e<s.T){let h=t+e,l=Math.cos(t),d=Math.sin(t),c=Math.cos(h),u=Math.sin(h),g=(e,a,n)=>(0,s.p)(e,t,h,!0)?1:Math.max(a,a*i,n,n*i),p=(e,a,n)=>(0,s.p)(e,t,h,!0)?-1:Math.min(a,a*i,n,n*i),f=g(0,l,c),m=g(s.H,d,u),_=p(s.P,l,c),x=p(s.P+s.H,d,u);a=(f-_)/2,n=(m-x)/2,o=-(f+_)/2,r=-(m+x)/2}return{ratioX:a,ratioY:n,offsetX:o,offsetY:r}}(d,l,r),f=Math.max(Math.min((e.width-n)/c,(e.height-n)/u)/2,0),m=(0,s.n)(this.options.radius,f),_=Math.max(m*r,0),x=(m-_)/this._getVisibleDatasetWeightTotal();this.offsetX=g*m,this.offsetY=p*m,i.total=this.calculateTotal(),this.outerRadius=m-x*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-x*h,0),this.updateElements(a,0,a.length,t)}_circumference(t,e){let i=this.options,a=this._cachedMeta,n=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===a._parsed[t]||a.data[t].hidden?0:this.calculateCircumference(a._parsed[t]*n/s.T)}updateElements(t,e,i,s){let a,n="reset"===s,o=this.chart,r=o.chartArea,h=o.options.animation,l=(r.left+r.right)/2,d=(r.top+r.bottom)/2,c=n&&h.animateScale,u=c?0:this.innerRadius,g=c?0:this.outerRadius,{sharedOptions:p,includeOptions:f}=this._getSharedOptions(e,s),m=this._getRotation();for(a=0;a<e;++a)m+=this._circumference(a,n);for(a=e;a<e+i;++a){let e=this._circumference(a,n),i=t[a],o={x:l+this.offsetX,y:d+this.offsetY,startAngle:m,endAngle:m+e,circumference:e,outerRadius:g,innerRadius:u};f&&(o.options=p||this.resolveDataElementOptions(a,i.active?"active":s)),m+=e,this.updateElement(i,a,o,s)}}calculateTotal(){let t,e=this._cachedMeta,i=e.data,s=0;for(t=0;t<i.length;t++){let a=e._parsed[t];null!==a&&!isNaN(a)&&this.chart.getDataVisibility(t)&&!i[t].hidden&&(s+=Math.abs(a))}return s}calculateCircumference(t){let e=this._cachedMeta.total;return e>0&&!isNaN(t)?s.T*(Math.abs(t)/e):0}getLabelAndValue(t){let e=this._cachedMeta,i=this.chart,a=i.data.labels||[],n=(0,s.o)(e._parsed[t],i.options.locale);return{label:a[t]||"",value:n}}getMaxBorderWidth(t){let e,i,s,a,n,o=0,r=this.chart;if(!t){for(e=0,i=r.data.datasets.length;e<i;++e)if(r.isDatasetVisible(e)){t=(s=r.getDatasetMeta(e)).data,a=s.controller;break}}if(!t)return 0;for(e=0,i=t.length;e<i;++e)"inner"!==(n=a.resolveDataElementOptions(e)).borderAlign&&(o=Math.max(o,n.borderWidth||0,n.hoverBorderWidth||0));return o}getMaxOffset(t){let e=0;for(let i=0,s=t.length;i<s;++i){let t=this.resolveDataElementOptions(i);e=Math.max(e,t.offset||0,t.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,s.v)(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class w extends v{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){let e=this._cachedMeta,{dataset:i,data:a=[],_dataset:n}=e,o=this.chart._animationsDisabled,{start:r,count:h}=(0,s.q)(e,a,o);this._drawStart=r,this._drawCount=h,(0,s.w)(e)&&(r=0,h=a.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!n._decimated,i.points=a;let l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:l},t),this.updateElements(a,r,h,t)}updateElements(t,e,i,a){let n="reset"===a,{iScale:o,vScale:r,_stacked:h,_dataset:l}=this._cachedMeta,{sharedOptions:d,includeOptions:c}=this._getSharedOptions(e,a),u=o.axis,g=r.axis,{spanGaps:p,segment:f}=this.options,m=(0,s.x)(p)?p:1/0,_=this.chart._animationsDisabled||n||"none"===a,x=e+i,b=t.length,v=e>0&&this.getParsed(e-1);for(let i=0;i<b;++i){let p=t[i],b=_?p:{};if(i<e||i>=x){b.skip=!0;continue}let y=this.getParsed(i),w=(0,s.k)(y[g]),M=b[u]=o.getPixelForValue(y[u],i),k=b[g]=n||w?r.getBasePixel():r.getPixelForValue(h?this.applyStack(r,y,h):y[g],i);
1b.skip=isNaN(M)||isNaN(k)||w,b.stop=i>0&&Math.abs(y[u]-v[u])>m,f&&(b.parsed=y,b.raw=l.data[i]),c&&(b.options=d||this.resolveDataElementOptions(i,p.active?"active":a)),_||this.updateElement(p,i,b,a),v=y}}getMaxOverflow(){let t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,s=t.data||[];return s.length?Math.max(i,s[0].size(this.resolveDataElementOptions(0)),s[s.length-1].size(this.resolveDataElementOptions(s.length-1)))/2:i}draw(){let t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}class M extends y{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}function k(){throw Error("This method is not implemented: Check that a complete date adapter is provided.")}class S{static override(t){Object.assign(S.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return k()}parse(){return k()}format(){return k()}add(){return k()}diff(){return k()}startOf(){return k()}endOf(){return k()}}function D(t,e,i,a,n){let o=t.getSortedVisibleDatasetMetas(),r=i[e];for(let t=0,i=o.length;t<i;++t){let{index:i,data:h}=o[t],{lo:l,hi:d}=function(t,e,i,a){let{controller:n,data:o,_sorted:r}=t,h=n._cachedMeta.iScale,l=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null;if(h&&e===h.axis&&"r"!==e&&r&&o.length){let r=h._reversePixels?s.A:s.B;if(a){if(n._sharedOptions){let t=o[0],s="function"==typeof t.getRange&&t.getRange(e);if(s){let t=r(o,e,i-s),a=r(o,e,i+s);return{lo:t.lo,hi:a.hi}}}}else{let a=r(o,e,i);if(l){let{vScale:e}=n._cachedMeta,{_parsed:i}=t,o=i.slice(0,a.lo+1).reverse().findIndex(t=>!(0,s.k)(t[e.axis]));a.lo-=Math.max(0,o);let r=i.slice(a.hi).findIndex(t=>!(0,s.k)(t[e.axis]));a.hi+=Math.max(0,r)}return a}}return{lo:0,hi:o.length-1}}(o[t],e,r,n);for(let t=l;t<=d;++t){let e=h[t];e.skip||a(e,i,t)}}}function C(t,e,i,a,n){let o=[];return(n||t.isPointInArea(e))&&D(t,i,e,function(i,r,h){(n||(0,s.C)(i,t.chartArea,0))&&i.inRange(e.x,e.y,a)&&o.push({element:i,datasetIndex:r,index:h})},!0),o}function A(t,e,i,a,n,o){let r,h,l,d,c,u;return o||t.isPointInArea(e)?"r"!==i||a?(r=[],h=-1!==i.indexOf("x"),l=-1!==i.indexOf("y"),d=function(t,e){return Math.sqrt(Math.pow(h?Math.abs(t.x-e.x):0,2)+Math.pow(l?Math.abs(t.y-e.y):0,2))},c=1/0,D(t,i,e,function(i,s,h){let l=i.inRange(e.x,e.y,n);if(a&&!l)return;let u=i.getCenterPoint(n);if(!(o||t.isPointInArea(u))&&!l)return;let g=d(e,u);g<c?(r=[{element:i,datasetIndex:s,index:h}],c=g):g===c&&r.push({element:i,datasetIndex:s,index:h})}),r):(u=[],D(t,i,e,function(t,i,a){let{startAngle:o,endAngle:r}=t.getProps(["startAngle","endAngle"],n),{angle:h}=(0,s.D)(t,{x:e.x,y:e.y});(0,s.p)(h,o,r)&&u.push({element:t,datasetIndex:i,index:a})}),u):[]}function P(t,e,i,s,a){let n=[],o="x"===i?"inXRange":"inYRange",r=!1;return(D(t,i,e,(t,s,h)=>{t[o]&&t[o](e[i],a)&&(n.push({element:t,datasetIndex:s,index:h}),r=r||t.inRange(e.x,e.y,a))}),s&&!r)?[]:n}var O={modes:{index(t,e,i,a){let n=(0,s.z)(e,t),o=i.axis||"x",r=i.includeInvisible||!1,h=i.intersect?C(t,n,o,a,r):A(t,n,o,!1,a,r),l=[];return h.length?(t.getSortedVisibleDatasetMetas().forEach(t=>{let e=h[0].index,i=t.data[e];i&&!i.skip&&l.push({element:i,datasetIndex:t.index,index:e})}),l):[]},dataset(t,e,i,a){let n=(0,s.z)(e,t),o=i.axis||"xy",r=i.includeInvisible||!1,h=i.intersect?C(t,n,o,a,r):A(t,n,o,!1,a,r);if(h.length>0){let e=h[0].datasetIndex,i=t.getDatasetMeta(e).data;h=[];for(let t=0;t<i.length;++t)h.push({element:i[t],datasetIndex:e,index:t})}return h},point(t,e,i,a){let n=(0,s.z)(e,t);return C(t,n,i.axis||"xy",a,i.includeInvisible||!1)},nearest(t,e,i,a){let n=(0,s.z)(e,t),o=i.axis||"xy",r=i.includeInvisible||!1;return A(t,n,o,i.intersect,a,r)},x(t,e,i,a){let n=(0,s.z)(e,t);return P(t,n,"x",i.intersect,a)},y(t,e,i,a){let n=(0,s.z)(e,t);return P(t,n,"y",i.intersect,a)}}};let L=["left","top","right","bottom"];function z(t,e){return t.filter(t=>t.pos===e)}function E(t,e){return t.filter(t=>-1===L.indexOf(t.pos)&&t.box.axis===e)}function T(t,e){return t.sort((t,i)=>{let s=e?i:t,a=e?t:i;return s.weight===a.weight?s.index-a.index:s.weight-a.weight})}function R(t,e,i,s){return Math.max(t[i],e[i])+Math.max(t[s],e[s])}function F(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}
1function H(t,e,i,a){let n,o,r,h,l,d,c=[];for(n=0,o=t.length,l=0;n<o;++n){(h=(r=t[n]).box).update(r.width||e.w,r.height||e.h,function(t,e){let i=e.maxPadding;return function(t){let s={left:0,top:0,right:0,bottom:0};return t.forEach(t=>{s[t]=Math.max(e[t],i[t])}),s}(t?["left","right"]:["top","bottom"])}(r.horizontal,e));let{same:o,other:u}=function(t,e,i,a){let{pos:n,box:o}=i,r=t.maxPadding;if(!(0,s.i)(n)){i.size&&(t[n]-=i.size);let e=a[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?o.height:o.width),i.size=e.size/e.count,t[n]+=i.size}o.getPadding&&F(r,o.getPadding());let h=Math.max(0,e.outerWidth-R(r,t,"left","right")),l=Math.max(0,e.outerHeight-R(r,t,"top","bottom")),d=h!==t.w,c=l!==t.h;return t.w=h,t.h=l,i.horizontal?{same:d,other:c}:{same:c,other:d}}(e,i,r,a);l|=o&&c.length,d=d||u,h.fullSize||c.push(r)}return l&&H(c,e,i,a)||d}function B(t,e,i,s,a){t.top=i,t.left=e,t.right=e+s,t.bottom=i+a,t.width=s,t.height=a}function I(t,e,i,a){let n=i.padding,{x:o,y:r}=e;for(let h of t){let t=h.box,l=a[h.stack]||{count:1,placed:0,weight:1},d=h.stackWeight/l.weight||1;if(h.horizontal){let a=e.w*d,o=l.size||t.height;(0,s.h)(l.start)&&(r=l.start),t.fullSize?B(t,n.left,r,i.outerWidth-n.right-n.left,o):B(t,e.left+l.placed,r,a,o),l.start=r,l.placed+=a,r=t.bottom}else{let a=e.h*d,r=l.size||t.width;(0,s.h)(l.start)&&(o=l.start),t.fullSize?B(t,o,n.top,r,i.outerHeight-n.bottom-n.top):B(t,o,e.top+l.placed,r,a),l.start=o,l.placed+=a,o=t.right}}e.x=o,e.y=r}var V={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},t.boxes.push(e)},removeBox(t,e){let i=t.boxes?t.boxes.indexOf(e):-1;-1!==i&&t.boxes.splice(i,1)},configure(t,e,i){e.fullSize=i.fullSize,e.position=i.position,e.weight=i.weight},update(t,e,i,a){let n,o,r,h,l,d,c,u;if(!t)return;let g=(0,s.E)(t.options.layout.padding),p=Math.max(e-g.width,0),f=Math.max(i-g.height,0),m=(o=T((n=function(t){let e,i,s,a,n,o,r=[];for(e=0,i=(t||[]).length;e<i;++e)s=t[e],({position:a,options:{stack:n,stackWeight:o=1}}=s),r.push({index:e,box:s,pos:a,horizontal:s.isHorizontal(),weight:s.weight,stack:n&&a+n,stackWeight:o});return r}(t.boxes)).filter(t=>t.box.fullSize),!0),r=T(z(n,"left"),!0),h=T(z(n,"right")),l=T(z(n,"top"),!0),d=T(z(n,"bottom")),c=E(n,"x"),u=E(n,"y"),{fullSize:o,leftAndTop:r.concat(l),rightAndBottom:h.concat(u).concat(d).concat(c),chartArea:z(n,"chartArea"),vertical:r.concat(h).concat(u),horizontal:l.concat(d).concat(c)}),_=m.vertical,x=m.horizontal;(0,s.F)(t.boxes,t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()});let b=Object.freeze({outerWidth:e,outerHeight:i,padding:g,availableWidth:p,availableHeight:f,vBoxMaxWidth:p/2/(_.reduce((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1,0)||1),hBoxMaxHeight:f/2}),v=Object.assign({},g);F(v,(0,s.E)(a));let y=Object.assign({maxPadding:v,w:p,h:f,x:g.left,y:g.top},g),w=function(t,e){let i,s,a,n=function(t){let e={};for(let i of t){let{stack:t,pos:s,stackWeight:a}=i;if(!t||!L.includes(s))continue;let n=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});n.count++,n.weight+=a}return e}(t),{vBoxMaxWidth:o,hBoxMaxHeight:r}=e;for(i=0,s=t.length;i<s;++i){let{fullSize:s}=(a=t[i]).box,h=n[a.stack],l=h&&a.stackWeight/h.weight;a.horizontal?(a.width=l?l*o:s&&e.availableWidth,a.height=r):(a.width=o,a.height=l?l*r:s&&e.availableHeight)}return n}(_.concat(x),b);H(m.fullSize,y,b,w),H(_,y,b,w),H(x,y,b,w)&&H(_,y,b,w);let M=y.maxPadding;function k(t){let e=Math.max(M[t]-y[t],0);return y[t]+=e,e}y.y+=k("top"),y.x+=k("left"),k("right"),k("bottom"),I(m.leftAndTop,y,b,w),y.x+=y.w,y.y+=y.h,I(m.rightAndBottom,y,b,w),t.chartArea={left:y.left,top:y.top,right:y.left+y.w,bottom:y.top+y.h,height:y.h,width:y.w},(0,s.F)(m.chartArea,e=>{let i=e.box;Object.assign(i,t.chartArea),i.update(y.w,y.h,{left:0,top:0,right:0,bottom:0})})}};class W{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 j extends W{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}
1let $="$chartjs",N={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},U=t=>null===t||""===t,Q=!!s.K&&{passive:!0};function X(t,e){for(let i of t)if(i===e||i.contains(e))return!0}function G(t,e,i){let s=t.canvas,a=new MutationObserver(t=>{let e=!1;for(let i of t)e=(e=e||X(i.addedNodes,s))&&!X(i.removedNodes,s);e&&i()});return a.observe(document,{childList:!0,subtree:!0}),a}function q(t,e,i){let s=t.canvas,a=new MutationObserver(t=>{let e=!1;for(let i of t)e=(e=e||X(i.removedNodes,s))&&!X(i.addedNodes,s);e&&i()});return a.observe(document,{childList:!0,subtree:!0}),a}let K=new Map,Y=0;function J(){let t=window.devicePixelRatio;t!==Y&&(Y=t,K.forEach((e,i)=>{i.currentDevicePixelRatio!==t&&e()}))}function Z(t,e,i){let a=t.canvas,n=a&&(0,s.I)(a);if(!n)return;let o=(0,s.L)((t,e)=>{let s=n.clientWidth;i(t,e),s<n.clientWidth&&i()},window),r=new ResizeObserver(t=>{let e=t[0],i=e.contentRect.width,s=e.contentRect.height;(0!==i||0!==s)&&o(i,s)});return r.observe(n),K.size||window.addEventListener("resize",J),K.set(t,o),r}function tt(t,e,i){i&&i.disconnect(),"resize"===e&&(K.delete(t),K.size||window.removeEventListener("resize",J))}function te(t,e,i){let a=t.canvas,n=(0,s.L)(e=>{null!==t.ctx&&i(function(t,e){let i=N[t.type]||t.type,{x:a,y:n}=(0,s.z)(t,e);return{type:i,chart:e,native:t,x:void 0!==a?a:null,y:void 0!==n?n:null}}(e,t))},t);return a&&a.addEventListener(e,n,Q),n}class ti extends W{acquireContext(t,e){let i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(!function(t,e){let i=t.style,a=t.getAttribute("height"),n=t.getAttribute("width");if(t[$]={initial:{height:a,width:n,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",U(n)){let e=(0,s.J)(t,"width");void 0!==e&&(t.width=e)}if(U(a))if(""===t.style.height)t.height=t.width/(e||2);else{let e=(0,s.J)(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){let e=t.canvas;if(!e[$])return!1;let i=e[$].initial;["height","width"].forEach(t=>{let a=i[t];(0,s.k)(a)?e.removeAttribute(t):e.setAttribute(t,a)});let a=i.style||{};return Object.keys(a).forEach(t=>{e.style[t]=a[t]}),e.width=e.width,delete e[$],!0}addEventListener(t,e,i){this.removeEventListener(t,e);let s=t.$proxies||(t.$proxies={}),a={attach:G,detach:q,resize:Z}[e]||te;s[e]=a(t,e,i)}removeEventListener(t,e){let i=t.$proxies||(t.$proxies={}),s=i[e];s&&((({attach:tt,detach:tt,resize:tt})[e]||function(t,e,i){t&&t.canvas&&t.canvas.removeEventListener(e,i,Q)})(t,e,s),i[e]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,a){return(0,s.G)(t,e,i,a)}isAttached(t){let e=t&&(0,s.I)(t);return!!(e&&e.isConnected)}}class ts{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){let{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return(0,s.x)(this.x)&&(0,s.x)(this.y)}getProps(t,e){let i=this.$animations;if(!e||!i)return this;let s={};return t.forEach(t=>{s[t]=i[t]&&i[t].active()?i[t]._to:this[t]}),s}}function ta(t,e,i,a,n){let o,r,h,l=(0,s.v)(a,0),d=Math.min((0,s.v)(n,t.length),t.length),c=0;for(i=Math.ceil(i),n&&(i=(o=n-a)/Math.floor(o/i)),h=l;h<0;)h=Math.round(l+ ++c*i);for(r=Math.max(l,0);r<d;r++)r===h&&(e.push(t[r]),h=Math.round(l+ ++c*i))}let tn=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i,to=(t,e)=>Math.min(e||t,t);function tr(t,e){let i=[],s=t.length/e,a=t.length,n=0;for(;n<a;n+=s)i.push(t[Math.floor(n)]);return i}function th(t){return t.drawTicks?t.tickLength:0}function tl(t,e){if(!t.display)return 0;let i=(0,s.a0)(t.font,e),a=(0,s.E)(t.padding);return((0,s.b)(t.text)?t.text.length:1)*i.lineHeight+a.height}class td extends ts{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:a}=this;return t=(0,s.O)(t,1/0),e=(0,s.O)(e,-1/0),i=(0,s.O)(i,1/0),a=(0,s.O)(a,-1/0),{min:(0,s.O)(t,i),max:(0,s.O)(e,a),minDefined:(0,s.g)(t),maxDefined:(0,s.g)(e)}}getMinMax(t){let e,{min:i,max:a,minDefined:n,maxDefined:o}=this.getUserBounds();if(n&&o)return{min:i,max:a};let r=this.getMatchingVisibleMetas();for(let s=0,h=r.length;s<h;++s)e=r[s].controller.getMinMax(this,t),n||(i=Math.min(i,e.min)),o||(a=Math.max(a,e.max));return i=o&&i>a?a:i,a=n&&i>a?i:a,{min:(0,s.O)(i,(0,s.O)(a,i)),max:(0,s.O)(a,(0,s.O)(i,a))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}
1getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){(0,s.Q)(this.options.beforeUpdate,[this])}update(t,e,i){let{beginAtZero:a,grace:n,ticks:o}=this.options,r=o.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,s.R)(this,n,a),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let h=r<this.ticks.length;this._convertTicksToLabels(h?tr(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||"auto"===o.source)&&(this.ticks=function(t,e){var i;let a,n,o=t.options.ticks,r=(a=(i=t).options.offset,n=i._tickSize(),Math.floor(Math.min(i._length/n+ +!a,i._maxLength/n))),h=Math.min(o.maxTicksLimit||r,r),l=o.major.enabled?function(t){let e,i,s=[];for(e=0,i=t.length;e<i;e++)t[e].major&&s.push(e);return s}(e):[],d=l.length,c=l[0],u=l[d-1],g=[];if(d>h)return function(t,e,i,s){let a,n=0,o=i[0];for(s=Math.ceil(s),a=0;a<t.length;a++)a===o&&(e.push(t[a]),o=i[++n*s])}(e,g,l,d/h),g;let p=function(t,e,i){let a=function(t){let e,i,s=t.length;if(s<2)return!1;for(i=t[0],e=1;e<s;++e)if(t[e]-t[e-1]!==i)return!1;return i}(t),n=e.length/i;if(!a)return Math.max(n,1);let o=(0,s.N)(a);for(let t=0,e=o.length-1;t<e;t++){let e=o[t];if(e>n)return e}return Math.max(n,1)}(l,e,h);if(d>0){let t,i,a=d>1?Math.round((u-c)/(d-1)):null;for(ta(e,g,p,(0,s.k)(a)?0:c-a,c),t=0,i=d-1;t<i;t++)ta(e,g,p,l[t],l[t+1]);return ta(e,g,p,u,(0,s.k)(a)?e.length:u+a),g}return ta(e,g,p),g}(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),h&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t,e,i=this.options.reverse;this.isHorizontal()?(t=this.left,e=this.right):(t=this.top,e=this.bottom,i=!i),this._startPixel=t,this._endPixel=e,this._reversePixels=i,this._length=e-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){(0,s.Q)(this.options.afterUpdate,[this])}beforeSetDimensions(){(0,s.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,s.Q)(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),(0,s.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,s.Q)(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){let e,i,a,n=this.options.ticks;for(e=0,i=t.length;e<i;e++)(a=t[e]).label=(0,s.Q)(n.callback,[a.value,e,t],this)}afterTickToLabelConversion(){(0,s.Q)(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){(0,s.Q)(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){let t,e,i,a=this.options,n=a.ticks,o=to(this.ticks.length,a.ticks.maxTicksLimit),r=n.minRotation||0,h=n.maxRotation,l=r;if(!this._isVisible()||!n.display||r>=h||o<=1||!this.isHorizontal()){this.labelRotation=r;return}let d=this._getLabelSizes(),c=d.widest.width,u=d.highest.height,g=(0,s.S)(this.chart.width-c,0,this.maxWidth);c+6>(t=a.offset?this.maxWidth/o:g/(o-1))&&(t=g/(o-(a.offset?.5:1)),e=this.maxHeight-th(a.grid)-n.padding-tl(a.title,this.chart.options.font),i=Math.sqrt(c*c+u*u),l=Math.max(r,Math.min(h,l=(0,s.U)(Math.min(Math.asin((0,s.S)((d.highest.height+6)/t,-1,1)),Math.asin((0,s.S)(e/i,-1,1))-Math.asin((0,s.S)(u/i,-1,1))))))),this.labelRotation=l}afterCalculateLabelRotation(){(0,s.Q)(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){(0,s.Q)(this.options.beforeFit,[this])}fit(){let t={width:0,height:0},{chart:e,options:{ticks:i,title:a,grid:n}}=this,o=this._isVisible(),r=this.isHorizontal();if(o){let o=tl(a,e.options.font);if(r?(t.width=this.maxWidth,t.height=th(n)+o):(t.height=this.maxHeight,t.width=th(n)+o),i.display&&this.ticks.length){let{first:e,last:a,widest:n,highest:o}=this._getLabelSizes(),h=2*i.padding,l=(0,s.t)(this.labelRotation),d=Math.cos(l),c=Math.sin(l);if(r){let e=i.mirror?0:c*n.width+d*o.height;t.height=Math.min(this.maxHeight,t.height+e+h)}else{let e=i.mirror?0:d*n.width+c*o.height;t.width=Math.min(this.maxWidth,t.width+e+h)}this._calculatePadding(e,a,c,d)}}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){let{ticks:{align:a,padding:n},position:o}=this.options,r=0!==this.labelRotation,h="top"!==o&&"x"===this.axis;if(this.isHorizontal()){let o=this.getPixelForTick(0)-this.left,l=this.right-this.getPixelForTick(this.ticks.length-1),d=0,c=0;r?h?(d=s*t.width,c=i*e.height):(d=i*t.height,c=s*e.width):"start"===a?c=e.width:"end"===a?d=t.width:"inner"!==a&&(d=t.width/2,c=e.width/2),this.paddingLeft=Math.max((d-o+n)*this.width/(this.width-o),0),this.paddingRight=Math.max((c-l+n)*this.width/(this.width-l),0)}
1else{let i=e.height/2,s=t.height/2;"start"===a?(i=0,s=t.height):"end"===a&&(i=e.height,s=0),this.paddingTop=i+n,this.paddingBottom=s+n}}_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,s.Q)(this.options.afterFit,[this])}isHorizontal(){let{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e<i;e++)(0,s.k)(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){let e=this.options.ticks.sampleSize,i=this.ticks;e<i.length&&(i=tr(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){let a,n,o,r,h,l,d,c,u,g,p,{ctx:f,_longestTextCache:m}=this,_=[],x=[],b=Math.floor(e/to(e,i)),v=0,y=0;for(a=0;a<e;a+=b){if(r=t[a].label,f.font=l=(h=this._resolveTickFontOptions(a)).string,d=m[l]=m[l]||{data:{},gc:[]},c=h.lineHeight,u=g=0,(0,s.k)(r)||(0,s.b)(r)){if((0,s.b)(r))for(n=0,o=r.length;n<o;++n)p=r[n],(0,s.k)(p)||(0,s.b)(p)||(u=(0,s.V)(f,d.data,d.gc,u,p),g+=c)}else u=(0,s.V)(f,d.data,d.gc,u,r),g=c;_.push(u),x.push(g),v=Math.max(u,v),y=Math.max(g,y)}(0,s.F)(m,t=>{let i,s=t.gc,a=s.length/2;if(a>e){for(i=0;i<a;++i)delete t.data[s[i]];s.splice(0,a)}});let w=_.indexOf(v),M=x.indexOf(y),k=t=>({width:_[t]||0,height:x[t]||0});return{first:k(0),last:k(e-1),widest:k(w),highest:k(M),widths:_,heights:x}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){let e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);let e=this._startPixel+t*this._length;return(0,s.W)(this._alignToPixels?(0,s.X)(this.chart,e,0):e)}getDecimalForPixel(t){let e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){var e,i;let a=this.ticks||[];if(t>=0&&t<a.length){let i=a[t];return i.$context||(e=this.getContext(),i.$context=(0,s.j)(e,{tick:i,index:t,type:"tick"}))}return this.$context||(this.$context=(i=this.chart.getContext(),(0,s.j)(i,{scale:this,type:"scale"})))}_tickSize(){let t=this.options.ticks,e=(0,s.t)(this.labelRotation),i=Math.abs(Math.cos(e)),a=Math.abs(Math.sin(e)),n=this._getLabelSizes(),o=t.autoSkipPadding||0,r=n?n.widest.width+o:0,h=n?n.highest.height+o:0;return this.isHorizontal()?h*i>r*a?r/i:h/a:h*a<r*i?h/i:r/a}_isVisible(){let t=this.options.display;return"auto"!==t?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){let e,i,a,n,o,r,h,l,d,c,u,g,p=this.axis,f=this.chart,m=this.options,{grid:_,position:x,border:b}=m,v=_.offset,y=this.isHorizontal(),w=this.ticks.length+ +!!v,M=th(_),k=[],S=b.setContext(this.getContext()),D=S.display?S.width:0,C=D/2,A=function(t){return(0,s.X)(f,t,D)};if("top"===x)e=A(this.bottom),r=this.bottom-M,l=e-C,c=A(t.top)+C,g=t.bottom;else if("bottom"===x)e=A(this.top),c=t.top,g=A(t.bottom)-C,r=e+C,l=this.top+M;else if("left"===x)e=A(this.right),o=this.right-M,h=e-C,d=A(t.left)+C,u=t.right;else if("right"===x)e=A(this.left),d=t.left,u=A(t.right)-C,o=e+C,h=this.left+M;else if("x"===p){if("center"===x)e=A((t.top+t.bottom)/2+.5);else if((0,s.i)(x)){let t=Object.keys(x)[0],i=x[t];e=A(this.chart.scales[t].getPixelForValue(i))}c=t.top,g=t.bottom,l=(r=e+C)+M}else if("y"===p){if("center"===x)e=A((t.left+t.right)/2);else if((0,s.i)(x)){let t=Object.keys(x)[0],i=x[t];e=A(this.chart.scales[t].getPixelForValue(i))}h=(o=e-C)-M,d=t.left,u=t.right}let P=(0,s.v)(m.ticks.maxTicksLimit,w),O=Math.max(1,Math.ceil(w/P));for(i=0;i<w;i+=O){let t=this.getContext(i),e=_.setContext(t),p=b.setContext(t),m=e.lineWidth,x=e.color,w=p.dash||[],M=p.dashOffset,S=e.tickWidth,D=e.tickColor,C=e.tickBorderDash||[],A=e.tickBorderDashOffset;
1void 0!==(a=function(t,e,i){let s,a=t.ticks.length,n=Math.min(e,a-1),o=t._startPixel,r=t._endPixel,h=t.getPixelForTick(n);if(!i||(s=1===a?Math.max(h-o,r-h):0===e?(t.getPixelForTick(1)-h)/2:(h-t.getPixelForTick(n-1))/2,!((h+=n<e?s:-s)<o-1e-6)&&!(h>r+1e-6)))return h}(this,i,v))&&(n=(0,s.X)(f,a,m),y?o=h=d=u=n:r=l=c=g=n,k.push({tx1:o,ty1:r,tx2:h,ty2:l,x1:d,y1:c,x2:u,y2:g,width:m,color:x,borderDash:w,borderDashOffset:M,tickWidth:S,tickColor:D,tickBorderDash:C,tickBorderDashOffset:A}))}return this._ticksLength=w,this._borderValue=e,k}_computeLabelItems(t){let e,i,a,n,o,r,h,l,d,c,u,g=this.axis,p=this.options,{position:f,ticks:m}=p,_=this.isHorizontal(),x=this.ticks,{align:b,crossAlign:v,padding:y,mirror:w}=m,M=th(p.grid),k=M+y,S=w?-y:k,D=-(0,s.t)(this.labelRotation),C=[],A="middle";if("top"===f)o=this.bottom-S,r=this._getXAxisLabelAlignment();else if("bottom"===f)o=this.top+S,r=this._getXAxisLabelAlignment();else if("left"===f){let t=this._getYAxisLabelAlignment(M);r=t.textAlign,n=t.x}else if("right"===f){let t=this._getYAxisLabelAlignment(M);r=t.textAlign,n=t.x}else if("x"===g){if("center"===f)o=(t.top+t.bottom)/2+k;else if((0,s.i)(f)){let t=Object.keys(f)[0],e=f[t];o=this.chart.scales[t].getPixelForValue(e)+k}r=this._getXAxisLabelAlignment()}else if("y"===g){if("center"===f)n=(t.left+t.right)/2-k;else if((0,s.i)(f)){let t=Object.keys(f)[0],e=f[t];n=this.chart.scales[t].getPixelForValue(e)}r=this._getYAxisLabelAlignment(M).textAlign}"y"===g&&("start"===b?A="top":"end"===b&&(A="bottom"));let P=this._getLabelSizes();for(e=0,i=x.length;e<i;++e){let t;a=x[e].label;let g=m.setContext(this.getContext(e));h=this.getPixelForTick(e)+m.labelOffset,d=(l=this._resolveTickFontOptions(e)).lineHeight;let p=(c=(0,s.b)(a)?a.length:1)/2,b=g.color,y=g.textStrokeColor,M=g.textStrokeWidth,k=r;if(_?(n=h,"inner"===r&&(k=e===i-1?this.options.reverse?"left":"right":0===e?this.options.reverse?"right":"left":"center"),u="top"===f?"near"===v||0!==D?-c*d+d/2:"center"===v?-P.highest.height/2-p*d+d:-P.highest.height+d/2:"near"===v||0!==D?d/2:"center"===v?P.highest.height/2-p*d:P.highest.height-c*d,w&&(u*=-1),0===D||g.showLabelBackdrop||(n+=d/2*Math.sin(D))):(o=h,u=(1-c)*d/2),g.showLabelBackdrop){let a=(0,s.E)(g.backdropPadding),n=P.heights[e],o=P.widths[e],h=u-a.top,l=0-a.left;switch(A){case"middle":h-=n/2;break;case"bottom":h-=n}switch(r){case"center":l-=o/2;break;case"right":l-=o;break;case"inner":e===i-1?l-=o:e>0&&(l-=o/2)}t={left:l,top:h,width:o+a.width,height:n+a.height,color:g.backdropColor}}C.push({label:a,font:l,textOffset:u,options:{rotation:D,color:b,strokeColor:y,strokeWidth:M,textAlign:k,textBaseline:A,translation:[n,o],backdrop:t}})}return C}_getXAxisLabelAlignment(){let{position:t,ticks:e}=this.options;if(-(0,s.t)(this.labelRotation))return"top"===t?"left":"right";let i="center";return"start"===e.align?i="left":"end"===e.align?i="right":"inner"===e.align&&(i="inner"),i}_getYAxisLabelAlignment(t){let e,i,{position:s,ticks:{crossAlign:a,mirror:n,padding:o}}=this.options,r=this._getLabelSizes(),h=t+o,l=r.widest.width;return"left"===s?n?(i=this.right+o,"near"===a?e="left":"center"===a?(e="center",i+=l/2):(e="right",i+=l)):(i=this.right-h,"near"===a?e="right":"center"===a?(e="center",i-=l/2):(e="left",i=this.left)):"right"===s?n?(i=this.left+o,"near"===a?e="right":"center"===a?(e="center",i-=l/2):(e="left",i-=l)):(i=this.left+h,"near"===a?e="left":"center"===a?(e="center",i+=l/2):(e="right",i=this.right)):e="right",{textAlign:e,x:i}}_computeLabelArea(){if(this.options.ticks.mirror)return;let t=this.chart,e=this.options.position;return"left"===e||"right"===e?{top:0,left:this.left,bottom:t.height,right:this.right}
1:"top"===e||"bottom"===e?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){let{ctx:t,options:{backgroundColor:e},left:i,top:s,width:a,height:n}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,s,a,n),t.restore())}getLineWidthForValue(t){let e=this.options.grid;if(!this._isVisible()||!e.display)return 0;let i=this.ticks.findIndex(e=>e.value===t);return i>=0?e.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){let e,i,s=this.options.grid,a=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t)),o=(t,e,i)=>{i.width&&i.color&&(a.save(),a.lineWidth=i.width,a.strokeStyle=i.color,a.setLineDash(i.borderDash||[]),a.lineDashOffset=i.borderDashOffset,a.beginPath(),a.moveTo(t.x,t.y),a.lineTo(e.x,e.y),a.stroke(),a.restore())};if(s.display)for(e=0,i=n.length;e<i;++e){let t=n[e];s.drawOnChartArea&&o({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},t),s.drawTicks&&o({x:t.tx1,y:t.ty1},{x:t.tx2,y:t.ty2},{color:t.tickColor,width:t.tickWidth,borderDash:t.tickBorderDash,borderDashOffset:t.tickBorderDashOffset})}}drawBorder(){let t,e,i,a,{chart:n,ctx:o,options:{border:r,grid:h}}=this,l=r.setContext(this.getContext()),d=r.display?l.width:0;if(!d)return;let c=h.setContext(this.getContext(0)).lineWidth,u=this._borderValue;this.isHorizontal()?(t=(0,s.X)(n,this.left,d)-d/2,e=(0,s.X)(n,this.right,c)+c/2,i=a=u):(i=(0,s.X)(n,this.top,d)-d/2,a=(0,s.X)(n,this.bottom,c)+c/2,t=e=u),o.save(),o.lineWidth=l.width,o.strokeStyle=l.color,o.beginPath(),o.moveTo(t,i),o.lineTo(e,a),o.stroke(),o.restore()}drawLabels(t){if(!this.options.ticks.display)return;let e=this.ctx,i=this._computeLabelArea();for(let a of(i&&(0,s.Y)(e,i),this.getLabelItems(t))){let t=a.options,i=a.font,n=a.label,o=a.textOffset;(0,s.Z)(e,n,0,o,i,t)}i&&(0,s.$)(e)}drawTitle(){let t,e,{ctx:i,options:{position:a,title:n,reverse:o}}=this;if(!n.display)return;let r=(0,s.a0)(n.font),h=(0,s.E)(n.padding),l=n.align,d=r.lineHeight/2;"bottom"===a||"center"===a||(0,s.i)(a)?(d+=h.bottom,(0,s.b)(n.text)&&(d+=r.lineHeight*(n.text.length-1))):d+=h.top;let{titleX:c,titleY:u,maxWidth:g,rotation:p}=function(t,e,i,a){let n,o,r,{top:h,left:l,bottom:d,right:c,chart:u}=t,{chartArea:g,scales:p}=u,f=0,m=d-h,_=c-l;if(t.isHorizontal()){if(o=(0,s.a2)(a,l,c),(0,s.i)(i)){let t=Object.keys(i)[0],s=i[t];r=p[t].getPixelForValue(s)+m-e}else r="center"===i?(g.bottom+g.top)/2+m-e:tn(t,i,e);n=c-l}else{if((0,s.i)(i)){let t=Object.keys(i)[0],s=i[t];o=p[t].getPixelForValue(s)-_+e}else o="center"===i?(g.left+g.right)/2-_+e:tn(t,i,e);r=(0,s.a2)(a,d,h),f="left"===i?-s.H:s.H}return{titleX:o,titleY:r,maxWidth:n,rotation:f}}(this,d,a,l);(0,s.Z)(i,n.text,0,0,r,{color:n.color,maxWidth:g,rotation:p,textAlign:(t=(0,s.a1)(l),(o&&"right"!==a||!o&&"right"===a)&&(t="left"===(e=t)?"right":"right"===e?"left":e),t),textBaseline:"middle",translation:[c,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){let t=this.options,e=t.ticks&&t.ticks.z||0,i=(0,s.v)(t.grid&&t.grid.z,-1),a=(0,s.v)(t.border&&t.border.z,0);return this._isVisible()&&this.draw===td.prototype.draw?[{z:i,draw:t=>{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:a,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){let e,i,s=this.chart.getSortedVisibleDatasetMetas(),a=this.axis+"AxisID",n=[];for(e=0,i=s.length;e<i;++e){let i=s[e];i[a]!==this.id||t&&i.type!==t||n.push(i)}return n}_resolveTickFontOptions(t){let e=this.options.ticks.setContext(this.getContext(t));return(0,s.a0)(e.font)}_maxDigits(){let t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class tc{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){var e,i,a,n,o,r;let h,l,d=Object.getPrototypeOf(t);"id"in(e=d)&&"defaults"in e&&(l=this.register(d));let c=this.items,u=t.id,g=this.scope+"."+u;if(!u)throw Error("class does not have id: "+t);return u in c||(c[u]=t,i=t,a=g,n=l,h=(0,s.a4)(Object.create(null),[n?s.d.get(n):{},s.d.get(a),i.defaults]),s.d.set(a,h),i.defaultRoutes&&(o=a,Object.keys(r=i.defaultRoutes).forEac
1h(t=>{let e=t.split("."),i=e.pop(),a=[o].concat(e).join("."),n=r[t].split("."),h=n.pop(),l=n.join(".");s.d.route(a,i,l,h)})),i.descriptors&&s.d.describe(a,i.descriptors),this.override&&s.d.override(t.id,t.overrides)),g}get(t){return this.items[t]}unregister(t){let e=this.items,i=t.id,a=this.scope;i in e&&delete e[i],a&&i in s.d[a]&&(delete s.d[a][i],this.override&&delete s.a3[i])}}class tu{constructor(){this.controllers=new tc(v,"datasets",!0),this.elements=new tc(ts,"elements"),this.plugins=new tc(Object,"plugins"),this.scales=new tc(td,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(e=>{let a=i||this._getRegistryForType(e);i||a.isForType(e)||a===this.plugins&&e.id?this._exec(t,a,e):(0,s.F)(e,e=>{let s=i||this._getRegistryForType(e);this._exec(t,s,e)})})}_exec(t,e,i){let a=(0,s.a5)(t);(0,s.Q)(i["before"+a],[],i),e[t](i),(0,s.Q)(i["after"+a],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){let i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){let s=e.get(t);if(void 0===s)throw Error('"'+t+'" is not a registered '+i+".");return s}}var tg=new tu;class tp{constructor(){this._init=[]}notify(t,e,i,s){"beforeInit"===e&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));let a=s?this._descriptors(t).filter(s):this._descriptors(t),n=this._notify(a,t,e,i);return"afterDestroy"===e&&(this._notify(a,t,"stop"),this._notify(this._init,t,"uninstall")),n}_notify(t,e,i,a){for(let n of(a=a||{},t)){let t=n.plugin,o=t[i],r=[e,a,n.options];if(!1===(0,s.Q)(o,r,t)&&a.cancelable)return!1}return!0}invalidate(){(0,s.k)(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;let e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){let i=t&&t.config,a=(0,s.v)(i.options&&i.options.plugins,{}),n=function(t){let e={},i=[],s=Object.keys(tg.plugins.items);for(let t=0;t<s.length;t++)i.push(tg.getPlugin(s[t]));let a=t.plugins||[];for(let t=0;t<a.length;t++){let s=a[t];-1===i.indexOf(s)&&(i.push(s),e[s.id]=!0)}return{plugins:i,localIds:e}}(i);return!1!==a||e?function(t,{plugins:e,localIds:i},s,a){let n=[],o=t.getContext();for(let h of e){var r;let e=h.id,l=(r=s[e],a||!1!==r?!0===r?{}:r:null);null!==l&&n.push({plugin:h,options:function(t,{plugin:e,local:i},s,a){let n=t.pluginScopeKeys(e),o=t.getOptionScopes(s,n);return i&&e.defaults&&o.push(e.defaults),t.createResolver(o,a,[""],{scriptable:!1,indexable:!1,allKeys:!0})}(t.config,{plugin:h,local:i[e]},l,o)})}return n}(t,n,a,e):[]}_notifyStateChanges(t){let e=this._oldCache||[],i=this._cache,s=(t,e)=>t.filter(t=>!e.some(e=>t.plugin.id===e.plugin.id));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}}function tf(t,e){let i=s.d.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function tm(t){if("x"===t||"y"===t||"r"===t)return t}function t_(t,...e){if(tm(t))return t;for(let s of e){var i;let e=s.axis||("top"===(i=s.position)||"bottom"===i?"x":"left"===i||"right"===i?"y":void 0)||t.length>1&&tm(t[0].toLowerCase());if(e)return e}throw Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function tx(t,e,i){if(i[e+"AxisID"]===t)return{axis:e}}function tb(t){let e,i,a,n,o=t.options||(t.options={});o.plugins=(0,s.v)(o.plugins,{}),e=s.a3[t.type]||{scales:{}},i=o.scales||{}
1,a=tf(t.type,o),n=Object.create(null),Object.keys(i).forEach(o=>{let r=i[o];if(!(0,s.i)(r))return console.error(`Invalid scale configuration for scale: ${o}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);let h=t_(o,r,function(t,e){if(e.data&&e.data.datasets){let i=e.data.datasets.filter(e=>e.xAxisID===t||e.yAxisID===t);if(i.length)return tx(t,"x",i[0])||tx(t,"y",i[0])}return{}}(o,t),s.d.scales[r.type]),l=h===a?"_index_":"_value_",d=e.scales||{};n[o]=(0,s.ab)(Object.create(null),[{axis:h},r,d[h],d[l]])}),t.data.datasets.forEach(e=>{let a=e.type||t.type,r=e.indexAxis||tf(a,o),h=(s.a3[a]||{}).scales||{};Object.keys(h).forEach(t=>{let a,o=(a=t,"_index_"===t?a=r:"_value_"===t&&(a="x"===r?"y":"x"),a),l=e[o+"AxisID"]||o;n[l]=n[l]||Object.create(null),(0,s.ab)(n[l],[{axis:o},i[l],h[t]])})}),Object.keys(n).forEach(t=>{let e=n[t];(0,s.ab)(e,[s.d.scales[e.type],s.d.scale])}),o.scales=n}function tv(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}let ty=new Map,tw=new Set;function tM(t,e){let i=ty.get(t);return i||(i=e(),ty.set(t,i),tw.add(i)),i}let tk=(t,e,i)=>{let a=(0,s.f)(e,i);void 0!==a&&t.add(a)};class tS{constructor(t){this._config=function(t){return(t=t||{}).data=tv(t.data),tb(t),t}(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=tv(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){let t=this._config;this.clearCache(),tb(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return tM(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return tM(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return tM(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){let e=t.id,i=this.type;return tM(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){let i=this._scopeCache,s=i.get(t);return(!s||e)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,e,i){let{options:a,type:n}=this,o=this._cachedScopes(t,i),r=o.get(e);if(r)return r;let h=new Set;e.forEach(e=>{t&&(h.add(t),e.forEach(e=>tk(h,t,e))),e.forEach(t=>tk(h,a,t)),e.forEach(t=>tk(h,s.a3[n]||{},t)),e.forEach(t=>tk(h,s.d,t)),e.forEach(t=>tk(h,s.a6,t))});let l=Array.from(h);return 0===l.length&&l.push(Object.create(null)),tw.has(e)&&o.set(e,l),l}chartOptionScopes(){let{options:t,type:e}=this;return[t,s.a3[e]||{},s.d.datasets[e]||{},{type:e},s.d,s.a6]}resolveNamedOptions(t,e,i,a=[""]){let n={$shared:!0},{resolver:o,subPrefixes:r}=tD(this._resolverCache,t,a),h=o;if(function(t,e){let{isScriptable:i,isIndexable:a}=(0,s.aa)(t);for(let n of e){let e=i(n),o=a(n),r=(o||e)&&t[n];if(e&&((0,s.a7)(r)||tC(r))||o&&(0,s.b)(r))return!0}return!1}(o,e)){n.$shared=!1,i=(0,s.a7)(i)?i():i;let e=this.createResolver(t,i,r);h=(0,s.a8)(o,i,e)}for(let t of e)n[t]=h[t];return n}createResolver(t,e,i=[""],a){let{resolver:n}=tD(this._resolverCache,t,i);return(0,s.i)(e)?(0,s.a8)(n,e,void 0,a):n}}function tD(t,e,i){let a=t.get(e);a||(a=new Map,t.set(e,a));let n=i.join(),o=a.get(n);return o||(o={resolver:(0,s.a9)(e,i),subPrefixes:i.filter(t=>!t.toLowerCase().includes("hover"))},a.set(n,o)),o}let tC=t=>(0,s.i)(t)&&Object.getOwnPropertyNames(t).some(e=>(0,s.a7)(t[e])),tA=["top","bottom","left","right","chartArea"];function tP(t,e){return"top"===t||"bottom"===t||-1===tA.indexOf(t)&&"x"===e}function tO(t,e){return function(i,s){return i[t]===s[t]?i[e]-s[e]:i[t]-s[t]}}function tL(t){let e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),(0,s.Q)(i&&i.onComplete,[t],e)}function tz(t){let e=t.chart,i=e.options.animation;(0,s.Q)(i&&i.onProgress,[t],e)}function tE(t){return(0,s.M)()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}let tT={},tR=t=>{let e=tE(t);return Object.values(tT).filter(t=>t.canvas===e).pop()};class tF{static defaults=s.d;static instances=tT;static overrides=s.a3;static registry=tg;static version="4.4.9";static getChart=tR;static register(...t){tg.add(...t),tH()}static unregister(...t){tg.remove(...t),tH()}constructor(t,e){const i=this.config=new tS(e),a=tE(t),o=tR(a);if(o)throw Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const r=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||function(t){return!(0,s.M)()||"u">typeof OffscreenCanvas&&t instanceof OffscreenCanvas?j:ti}(a)),this.platform.updateConfig(i);const h=this.platform.acquireContext(a,r.aspectRatio),l=h&&h.canvas,d=l&&l.height,c=l&&l.width;if(this.id=(0,s.ac)(),this.ctx=h,this.canvas=l,this.width=c,this.height=d,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new tp,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=(0,s.ad)(t=>this.update(t),r.resizeDelay||0),this._dataChanges=[],tT[this.id]=this,!h||!l)return void console.error("Failed to create chart: can't acquire context from the given item");n.listen(this,"complete",tL),n.listen(this,"progress",tz),this._initialize(),this.attached&&this.update()}get aspectRatio(){let{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:a,_aspectRatio:n}=this;return(0,s.k)(t)?e&&n?n:a?i/a: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 tg}
1_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():(0,s.ae)(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return(0,s.af)(this.canvas,this.ctx),this}stop(){return n.stop(this),this}resize(t,e){n.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){let i=this.options,a=this.canvas,n=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(a,t,e,n),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),h=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,(0,s.ae)(this,r,!0)&&(this.notifyPlugins("resize",{size:o}),(0,s.Q)(i.onResize,[this,o],this),this.attached&&this._doResize(h)&&this.render())}ensureScalesHaveIDs(){let t=this.options.scales||{};(0,s.F)(t,(t,e)=>{t.id=e})}buildOrUpdateScales(){let t=this.options,e=t.scales,i=this.scales,a=Object.keys(i).reduce((t,e)=>(t[e]=!1,t),{}),n=[];e&&(n=n.concat(Object.keys(e).map(t=>{let i=e[t],s=t_(t,i),a="r"===s,n="x"===s;return{options:i,dposition:a?"chartArea":n?"bottom":"left",dtype:a?"radialLinear":n?"category":"linear"}}))),(0,s.F)(n,e=>{let n=e.options,o=n.id,r=t_(o,n),h=(0,s.v)(n.type,e.dtype);(void 0===n.position||tP(n.position,r)!==tP(e.dposition))&&(n.position=e.dposition),a[o]=!0;let l=null;o in i&&i[o].type===h?l=i[o]:i[(l=new(tg.getScale(h))({id:o,type:h,ctx:this.ctx,chart:this})).id]=l,l.init(n,t)}),(0,s.F)(a,(t,e)=>{t||delete i[e]}),(0,s.F)(i,t=>{V.configure(this,t,t.options),V.addBox(this,t)})}_updateMetasets(){let t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((t,e)=>t.index-e.index),i>e){for(let t=e;t<i;++t)this._destroyDatasetMeta(t);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(tO("order","index"))}_removeUnreferencedMetasets(){let{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((t,i)=>{0===e.filter(e=>e===t._dataset).length&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){let t,e,i=[],a=this.data.datasets;for(this._removeUnreferencedMetasets(),t=0,e=a.length;t<e;t++){let e=a[t],n=this.getDatasetMeta(t),o=e.type||this.config.type;if(n.type&&n.type!==o&&(this._destroyDatasetMeta(t),n=this.getDatasetMeta(t)),n.type=o,n.indexAxis=e.indexAxis||tf(o,this.options),n.order=e.order||0,n.index=t,n.label=""+e.label,n.visible=this.isDatasetVisible(t),n.controller)n.controller.updateIndex(t),n.controller.linkScales();else{let e=tg.getController(o),{datasetElementType:a,dataElementType:r}=s.d.datasets[o];Object.assign(e,{dataElementType:tg.getElement(r),datasetElementType:a&&tg.getElement(a)}),n.controller=new e(this,t),i.push(n.controller)}}return this._updateMetasets(),i}_resetElements(){(0,s.F)(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){let e=this.config;e.update();let i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),a=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;let n=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let t=0,e=this.data.datasets.length;t<e;t++){let{controller:e}=this.getDatasetMeta(t),i=!a&&-1===n.indexOf(e);e.buildOrUpdateElements(i),o=Math.max(+e.getMaxOverflow(),o)}o=this._minPadding=i.layout.autoPadding?o:0,this._updateLayout(o),a||(0,s.F)(n,t=>{t.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(tO("z","_idx"));let{_active:r,_lastEvent:h}=this;h?this._eventHandler(h,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){(0,s.F)(this.scales,t=>{V.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(0,s.ag)(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:t}=this;for(let{method:i,start:s,count:a}of this._getUniformDataChanges()||[]){var e="_removeElements"===i?-a:a;for(let i of Object.keys(t)){let a=+i;
1if(a>=s){let n=t[i];delete t[i],(e>0||a>s)&&(t[a+e]=n)}}}}_getUniformDataChanges(){let t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];let e=this.data.datasets.length,i=e=>new Set(t.filter(t=>t[0]===e).map((t,e)=>e+","+t.splice(1).join(","))),a=i(0);for(let t=1;t<e;t++)if(!(0,s.ag)(a,i(t)))return;return Array.from(a).map(t=>t.split(",")).map(t=>({method:t[1],start:+t[2],count:+t[3]}))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;V.update(this,this.width,this.height,t);let e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],(0,s.F)(this.boxes,t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))},this),this._layers.forEach((t,e)=>{t._idx=e}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t<e;++t)this.getDatasetMeta(t).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,(0,s.a7)(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){let i=this.getDatasetMeta(t),s={meta:i,index:t,mode:e,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",s)&&(i.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(n.has(this)?this.attached&&!n.running(this)&&n.start(this):(this.draw(),tL({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){let{width:t,height:e}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(t,e)}if(this.clear(),this.width<=0||this.height<=0||!1===this.notifyPlugins("beforeDraw",{cancelable:!0}))return;let 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){let e,i,s=this._sortedMetasets,a=[];for(e=0,i=s.length;e<i;++e){let i=s[e];(!t||i.visible)&&a.push(i)}return a}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1===this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;let t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){let e=this.ctx,i={meta:t,index:t.index,cancelable:!0},a=(0,s.ah)(this,t);!1!==this.notifyPlugins("beforeDatasetDraw",i)&&(a&&(0,s.Y)(e,a),t.controller.draw(),a&&(0,s.$)(e),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return(0,s.C)(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){let a=O.modes[e];return"function"==typeof a?a(this,t,i,s):[]}getDatasetMeta(t){let e=this.data.datasets[t],i=this._metasets,s=i.filter(t=>t&&t._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,s.j)(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){let e=this.data.datasets[t];if(!e)return!1;let i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){let a=i?"show":"hide",n=this.getDatasetMeta(t),o=n.controller._resolveAnimations(void 0,a);(0,s.h)(e)?(n.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(n,{visible:i}),this.update(e=>e.datasetIndex===t?a:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){let e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),n.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");let{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),(0,s.af)(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete tT[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){let t=this._listeners,e=this.platform,i=(i,s)=>{e.addEventListener(this,i,s),t[i]=s},a=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};(0,s.F)(this.options.events,t=>i(t,a))}bindResponsiveEvents(){let t;this._responsiveListeners||(this._responsiveListeners={});let e=this._responsiveListeners,i=this.platform,s=(t,s)=>{i.addEventListener(this,t,s),e[t]=s},a=(t,s)=>{e[t]&&(i.removeEventListener(this,t,s),delete e[t])},n=(t,e)=>{this.canvas&&this.resize(t,e)},o=()=>{a("attach",o),this.attached=!0,this.resize(),s("resize",n),s("detach",t)};t=()=>{this.attached=!1,a("resize",n),this._stop(),this._resize(0,0),s("attach",o)},i.isAttached(this.canvas)?o():t()}unbindEvents(){(0,s.F)(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},(0,s.F)(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){let s,a,n,o=i?"set":"remove";for("dataset"===e&&this.getDatasetMeta(t[0].datasetIndex).controller["_"+o+"DatasetHoverStyle"](),a=0,n=t.length;a<n;++a){let e=(s=t[a])&&this.getDatasetMeta(s.datasetIndex).controller;e&&e[o+"HoverStyle"](s.element,s.datasetIndex,s.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){let e=this._active||[],i=t.map(({datasetIndex:t,index:e})=>{let i=this.getDatasetMeta(t);if(!i)throw Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}});(0,s.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 1===this._plugins._cache.filter(e=>e.plugin.id===t).length}_updateHoverStyles(t,e,i){let s=this.options.hover,a=(t,e)=>t.filter(t=>!e.some(e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)),n=a(e,t),o=i?t:a(t,e);n.length&&this.updateHoverStyle(n,s.mode,!1),o.length&&s.mode&&this.updateHoverStyle(o,s.mode,!0)}_eventHandler(t,e){let i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,s))return;let a=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(a||i.changed)&&this.render(),this}_handleEvent(t,e,i){var a;let{_active:n=[],options:o}=this,r=this._getActiveElements(t,n,i,e),h=(0,s.aj)(t),l=(a=this._lastEvent,i&&"mouseout"!==t.type?h?a:t:null);i&&(this._lastEvent=null,(0,s.Q)(o.onHover,[t,r,this],this),h&&(0,s.Q)(o.onClick,[t,r,this],this));let d=!(0,s.ai)(r,n);return(d||e)&&(this._active=r,this._updateHoverStyles(r,n,e)),this._lastEvent=l,d}_getActiveElements(t,e,i,s){if("mouseout"===t.type)return[];if(!i)return e;let a=this.options.hover;return this.getElementsAtEventForMode(t,a.mode,a,s)}}function tH(){return(0,s.F)(tF.instances,t=>t._plugins.invalidate())}function tB(t,e,i,s){return{x:i+t*Math.cos(e),y:s+t*Math.sin(e)}}function tI(t,e,i,a,n,o){var r,h;let l,d,c,u,{x:g,y:p,startAngle:f,pixelMargin:m,innerRadius:_}=e,x=Math.max(e.outerRadius+a+i-m,0),b=_>0?_+a+i+m:0,v=0,y=n-f;if(a){let t=x>0?x-a:0,e=((_>0?_-a:0)+t)/2;v=(y-(0!==e?y*e/(e+a):y))/2}let w=Math.max(.001,y*x-i/s.P)/x,M=(y-w)/2,k=f+M+v,S=n-M-v,{outerStart:D,outerEnd:C,innerStart:A,innerEnd:P}=(r=S-k,h=e.options.borderRadius,l=(0,s.al)(h,["outerStart","outerEnd","innerStart","innerEnd"]),c=Math.min(d=(x-b)/2,r*b/2),{outerStart:(u=t=>{let e=(x-Math.min(d,t))*r/2;return(0,s.S)(t,0,Math.min(d,e))})(l.outerStart),outerEnd:u(l.outerEnd),innerStart:(0,s.S)(l.innerStart,0,c),innerEnd:(0,s.S)(l.innerEnd,0,c)}),O=x-D,L=x-C,z=k+D/O,E=S-C/L,T=b+A,R=b+P,F=k+A/T,H=S-P/R;if(t.beginPath(),o){let e=(z+E)/2;if(t.arc(g,p,x,z,e),t.arc(g,p,x,e,E),C>0){let e=tB(L,E,g,p);t.arc(e.x,e.y,C,E,S+s.H)}let i=tB(R,S,g,p);if(t.lineTo(i.x,i.y),P>0){let e=tB(R,H,g,p);t.arc(e.x,e.y,P,S+s.H,H+Math.PI)}let a=(S-P/b+(k+A/b))/2;if(t.arc(g,p,b,S-P/b,a,!0),t.arc(g,p,b,a,k+A/b,!0),A>0){let e=tB(T,F,g,p);t.arc(e.x,e.y,A,F+Math.PI,k-s.H)}let n=tB(O,k,g,p);if(t.lineTo(n.x,n.y),D>0){let e=tB(O,z,g,p);t.arc(e.x,e.y,D,k-s.H,z)}}else{t.moveTo(g,p);let e=Math.cos(z)*x+g,i=Math.sin(z)*x+p;t.lineTo(e,i);let s=Math.cos(E)*x+g,a=Math.sin(E)*x+p;t.lineTo(s,a)}t.closePath()}class tV extends ts{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};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t};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){let a=this.getProps(["x","y"],i),{angle:n,distance:o}=(0,s.D)(a,{x:t,y:e}),{startAngle:r,endAngle:h,innerRadius:l,outerRadius:d,circumference:c}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),u=(this.options.spacing+this.options.borderWidth)/2,g=(0,s.v)(c,h-r),p=(0,s.p)(n,r,h)&&r!==h,f=g>=s.T||p,m=(0,s.ak)(o,l+u,d+u);return f&&m}getCenterPoint(t){let{x:e,y:i,startAngle:s,endAngle:a,innerRadius:n,outerRadius:o}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:r,spacing:h}=this.options,l=(s+a)/2,d=(n+o+h+r)/2;return{x:e+Math.cos(l)*d,y:i+Math.sin(l)*d}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){let{options:e,circumference:i}=this,a=(e.offset||0)/4,n=(e.spacing||0)/2,o=e.circular;if(this.pixelMargin=.33*("inner"===e.borderAlign),this.fullCircles=i>s.T?Math.floor(i/s.T):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();let r=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(r)*a,Math.sin(r)*a);let h=a*(1-Math.sin(Math.min(s.P,i||0)));t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,function(t,e,
1i,a,n){let{fullCircles:o,startAngle:r,circumference:h}=e,l=e.endAngle;if(o){tI(t,e,i,a,l,n);for(let e=0;e<o;++e)t.fill();isNaN(h)||(l=r+(h%s.T||s.T))}tI(t,e,i,a,l,n),t.fill()}(t,this,h,n,o),function(t,e,i,a,n){let{fullCircles:o,startAngle:r,circumference:h,options:l}=e,{borderWidth:d,borderJoinStyle:c,borderDash:u,borderDashOffset:g}=l,p="inner"===l.borderAlign;if(!d)return;t.setLineDash(u||[]),t.lineDashOffset=g,p?(t.lineWidth=2*d,t.lineJoin=c||"round"):(t.lineWidth=d,t.lineJoin=c||"bevel");let f=e.endAngle;if(o){tI(t,e,i,a,f,n);for(let e=0;e<o;++e)t.stroke();isNaN(h)||(f=r+(h%s.T||s.T))}p&&function(t,e,i){let{startAngle:a,pixelMargin:n,x:o,y:r,outerRadius:h,innerRadius:l}=e,d=n/h;t.beginPath(),t.arc(o,r,h,a-d,i+d),l>n?(d=n/l,t.arc(o,r,l,i+d,a-d,!0)):t.arc(o,r,n,i+s.H,a-s.H),t.closePath(),t.clip()}(t,e,f),o||(tI(t,e,i,a,f,n),t.stroke())}(t,this,h,n,o),t.restore()}}function tW(t,e,i=e){t.lineCap=(0,s.v)(i.borderCapStyle,e.borderCapStyle),t.setLineDash((0,s.v)(i.borderDash,e.borderDash)),t.lineDashOffset=(0,s.v)(i.borderDashOffset,e.borderDashOffset),t.lineJoin=(0,s.v)(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=(0,s.v)(i.borderWidth,e.borderWidth),t.strokeStyle=(0,s.v)(i.borderColor,e.borderColor)}function tj(t,e,i){t.lineTo(i.x,i.y)}function t$(t,e,i={}){let s=t.length,{start:a=0,end:n=s-1}=i,{start:o,end:r}=e,h=Math.max(a,o),l=Math.min(n,r);return{count:s,start:h,loop:e.loop,ilen:l<h&&!(a<o&&n<o||a>r&&n>r)?s+l-h:l-h}}function tN(t,e,i,a){let n,o,r,{points:h,options:l}=e,{count:d,start:c,loop:u,ilen:g}=t$(h,i,a),p=l.stepped?s.as:l.tension||"monotone"===l.cubicInterpolationMode?s.at:tj,{move:f=!0,reverse:m}=a||{};for(n=0;n<=g;++n)(o=h[(c+(m?g-n:n))%d]).skip||(f?(t.moveTo(o.x,o.y),f=!1):p(t,r,o,m,l.stepped),r=o);return u&&p(t,r,o=h[(c+(m?g:0))%d],m,l.stepped),!!u}function tU(t,e,i,s){let a,n,o,r,h,l,d=e.points,{count:c,start:u,ilen:g}=t$(d,i,s),{move:p=!0,reverse:f}=s||{},m=0,_=0,x=t=>(u+(f?g-t:t))%c,b=()=>{r!==h&&(t.lineTo(m,h),t.lineTo(m,r),t.lineTo(m,l))};for(p&&(n=d[x(0)],t.moveTo(n.x,n.y)),a=0;a<=g;++a){if((n=d[x(a)]).skip)continue;let e=n.x,i=n.y,s=0|e;s===o?(i<r?r=i:i>h&&(h=i),m=(_*m+e)/++_):(b(),t.lineTo(e,i),o=s,_=0,r=h=i),l=i}b()}function tQ(t){let e=t.options,i=e.borderDash&&e.borderDash.length;return t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i?tN:tU}let tX="function"==typeof Path2D;class tG extends ts{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=>"borderDash"!==t&&"fill"!==t};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){let i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){let a=i.spanGaps?this._loop:this._fullLoop;(0,s.am)(this._points,i,t,a,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,s.an)(this,this.options.segment))}first(){let t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){let t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){let i,a,n=this.options,o=t[e],r=this.points,h=(0,s.ao)(this,{property:e,start:o,end:o});if(!h.length)return;let l=[],d=n.stepped?s.ap:n.tension||"monotone"===n.cubicInterpolationMode?s.aq:s.ar;for(i=0,a=h.length;i<a;++i){let{start:s,end:a}=h[i],c=r[s],u=r[a];if(c===u){l.push(c);continue}let g=Math.abs((o-c[e])/(u[e]-c[e])),p=d(c,u,g,n.stepped);p[e]=t[e],l.push(p)}return 1===l.length?l[0]:l}pathSegment(t,e,i){return tQ(this)(t,this,e,i)}path(t,e,i){let s=this.segments,a=tQ(this),n=this._loop;for(let o of(e=e||0,i=i||this.points.length-e,s))n&=a(t,this,o,{start:e,end:e+i-1});return!!n}draw(t,e,i,s){let a=this.options||{};(this.points||[]).length&&a.borderWidth&&(t.save(),function(t,e,
1i,s){if(tX&&!e.options.segment){let a;(a=e._path)||(a=e._path=new Path2D,e.path(a,i,s)&&a.closePath()),tW(t,e.options),t.stroke(a)}else!function(t,e,i,s){let{segments:a,options:n}=e,o=tQ(e);for(let r of a)tW(t,n,r.style),t.beginPath(),o(t,e,r,{start:i,end:i+s-1})&&t.closePath(),t.stroke()}(t,e,i,s)}(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function tq(t,e,i,s){let a=t.options,{[i]:n}=t.getProps([i],s);return Math.abs(e-n)<a.radius+a.hitRadius}class tK extends ts{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){let s=this.options,{x:a,y:n}=this.getProps(["x","y"],i);return Math.pow(t-a,2)+Math.pow(e-n,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,e){return tq(this,t,"x",e)}inYRange(t,e){return tq(this,t,"y",e)}getCenterPoint(t){let{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}size(t){let e=(t=t||this.options||{}).radius||0,i=(e=Math.max(e,e&&t.hoverRadius||0))&&t.borderWidth||0;return(e+i)*2}draw(t,e){let i=this.options;!this.skip&&!(i.radius<.1)&&(0,s.C)(this,e,this.size(i)/2)&&(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,(0,s.au)(t,i,this.x,this.y))}getRange(){let t=this.options||{};return t.radius+t.hitRadius}}let tY=["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)"],tJ=tY.map(t=>t.replace("rgb(","rgba(").replace(")",", 0.5)")),tZ=(t,e)=>{let{boxHeight:i=e,boxWidth:s=e}=t;return t.usePointStyle&&(i=Math.min(i,e),s=t.pointStyleWidth||Math.min(s,e)),{boxWidth:s,boxHeight:i,itemHeight:Math.max(e,i)}};class t0 extends ts{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(){let t=this.options.labels||{},e=(0,s.Q)(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(e=>t.filter(e,this.chart.data))),t.sort&&(e=e.sort((e,i)=>t.sort(e,i,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){let t,e,{options:i,ctx:a}=this;if(!i.display){this.width=this.height=0;return}let n=i.labels,o=(0,s.a0)(n.font),r=o.size,h=this._computeTitleHeight(),{boxWidth:l,itemHeight:d}=tZ(n,r);a.font=o.string,this.isHorizontal()?(t=this.maxWidth,e=this._fitRows(h,r,l,d)+10):(e=this.maxHeight,t=this._fitCols(h,o,l,d)+10),this.width=Math.min(t,i.maxWidth||this.maxWidth),this.height=Math.min(e,i.maxHeight||this.maxHeight)}_fitRows(t,e,i,s){let{ctx:a,maxWidth:n,options:{labels:{padding:o}}}=this,r=this.legendHitBoxes=[],h=this.lineWidths=[0],l=s+o,d=t;a.textAlign="left",a.textBaseline="middle";let c=-1,u=-l;return this.legendItems.forEach((t,g)=>{let p=i+e/2+a.measureText(t.text).width;(0===g||h[h.length-1]+p+2*o>n)&&(d+=l,h[h.length-(g>0?0:1)]=0,u+=l,c++),r[g]={left:0,top:u,row:c,width:p,height:s},h[h.length-1]+=p+o}),d}_fitCols(t,e,i,s){let{ctx:a,maxHeight:n,options:{labels:{padding:o}}}=this,r=this.legendHitBoxes=[],h=this.columnSizes=[],l=n-t,d=o,c=0,u=0,g=0,p=0;return this.legendItems.forEach((t,n)=>{var f,m,_,x,b,v,y,w,M,k,S,D;let C,A,{itemWidth:P,itemHeight:O}=(f=i,m=e,_=a,x=t,b=s,{itemWidth:(v=x,y=f,w=m,M=_,(C=v.text)&&"string"!=typeof C&&(C=C.reduce((t,e)=>t.length>e.length?t:e)),y+w.size/2+M.measureText(C).width),itemHeight:(k=b,S=x,D=m.lineHeight,A=k,"string"!=typeof S.text&&(A=t1(S,D)),A)});n>0&&u+O+2*o>l&&(d+=c+o,h.push({width:c,height:u}),g+=c+o,p++,c=u=0),r[n]={left:g,top:u,col:p,width:P,height:O},c=Math.max(c,P),u+=O+o}),d+=c,h.push({width:c,height:u}),d}adjustHitBoxes(){if(!this.options.display)return;let t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:a},rtl:n}}=this,o=(0,s.aA)(n,this.left,this.width);if(this.isHorizontal()){let n=0,r=(0,s.a2)(i,this.left+a,this.right-this.lineWidths[n]);for(let h of e)n!==h.row&&(n=h.row,r=(0,s.a2)(i,this.left+a,this.right-this.lineWidths[n])),h.top+=this.top+t+a,h.left=o.leftForLtr(o.x(r),h.width),r+=h.width+a}else{let n=0,r=(0,s.a2)(i,this.top+t+a,this.bottom-this.columnSizes[n].height);for(let h of e)h.col!==n&&(n=h.col,r=(0,s.a2)(i,this.top+t+a,this.bottom-this.columnSizes[n].height)),h.top=r,h.left+=this.left+a,h.left=o.leftForLtr(o.x(h.left),h.width),r+=h.height+a}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){let t=this.ctx;(0,s.Y)(t,this),this._draw(),(0,s.$)(t)}}_draw(){let t,{options:e,columnSizes:i,lineWidths:a,ctx:n}=this,{align:o,labels:r}=e,h=s.d.color,l=(0,s.aA)(e.rtl,this.left,this.width),d=(0,s.a0)(r.font),{padding:c}=r,u=d.size,g=u/2;this.drawTitle(),n.textAlign=l.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=d.string;let{boxWidth:p,boxHeight:f,itemHeight:m}
1=tZ(r,u),_=function(t,e,i){if(isNaN(p)||p<=0||isNaN(f)||f<0)return;n.save();let a=(0,s.v)(i.lineWidth,1);if(n.fillStyle=(0,s.v)(i.fillStyle,h),n.lineCap=(0,s.v)(i.lineCap,"butt"),n.lineDashOffset=(0,s.v)(i.lineDashOffset,0),n.lineJoin=(0,s.v)(i.lineJoin,"miter"),n.lineWidth=a,n.strokeStyle=(0,s.v)(i.strokeStyle,h),n.setLineDash((0,s.v)(i.lineDash,[])),r.usePointStyle){let o={radius:f*Math.SQRT2/2,pointStyle:i.pointStyle,rotation:i.rotation,borderWidth:a},h=l.xPlus(t,p/2);(0,s.aE)(n,o,h,e+g,r.pointStyleWidth&&p)}else{let o=e+Math.max((u-f)/2,0),r=l.leftForLtr(t,p),h=(0,s.ax)(i.borderRadius);n.beginPath(),Object.values(h).some(t=>0!==t)?(0,s.av)(n,{x:r,y:o,w:p,h:f,radius:h}):n.rect(r,o,p,f),n.fill(),0!==a&&n.stroke()}n.restore()},x=function(t,e,i){(0,s.Z)(n,i.text,t,e+m/2,d,{strikethrough:i.hidden,textAlign:l.textAlign(i.textAlign)})},b=this.isHorizontal(),v=this._computeTitleHeight();t=b?{x:(0,s.a2)(o,this.left+c,this.right-a[0]),y:this.top+c+v,line:0}:{x:this.left+c,y:(0,s.a2)(o,this.top+v+c,this.bottom-i[0].height),line:0},(0,s.aB)(this.ctx,e.textDirection);let y=m+c;this.legendItems.forEach((h,u)=>{n.strokeStyle=h.fontColor,n.fillStyle=h.fontColor;let f=n.measureText(h.text).width,m=l.textAlign(h.textAlign||(h.textAlign=r.textAlign)),w=p+g+f,M=t.x,k=t.y;if(l.setWidth(this.width),b?u>0&&M+w+c>this.right&&(k=t.y+=y,t.line++,M=t.x=(0,s.a2)(o,this.left+c,this.right-a[t.line])):u>0&&k+y>this.bottom&&(M=t.x=M+i[t.line].width+c,t.line++,k=t.y=(0,s.a2)(o,this.top+v+c,this.bottom-i[t.line].height)),_(l.x(M),k,h),M=(0,s.aC)(m,M+p+g,b?M+w:this.right,e.rtl),x(l.x(M),k,h),b)t.x+=w+c;else if("string"!=typeof h.text){let e=d.lineHeight;t.y+=t1(h,e)+c}else t.y+=y}),(0,s.aD)(this.ctx,e.textDirection)}drawTitle(){let t,e=this.options,i=e.title,a=(0,s.a0)(i.font),n=(0,s.E)(i.padding);if(!i.display)return;let o=(0,s.aA)(e.rtl,this.left,this.width),r=this.ctx,h=i.position,l=a.size/2,d=n.top+l,c=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),t=this.top+d,c=(0,s.a2)(e.align,c,this.right-u);else{let i=this.columnSizes.reduce((t,e)=>Math.max(t,e.height),0);t=d+(0,s.a2)(e.align,this.top,this.bottom-i-e.labels.padding-this._computeTitleHeight())}let g=(0,s.a2)(h,c,c+u);r.textAlign=o.textAlign((0,s.a1)(h)),r.textBaseline="middle",r.strokeStyle=i.color,r.fillStyle=i.color,r.font=a.string,(0,s.Z)(r,i.text,g,t,a)}_computeTitleHeight(){let t=this.options.title,e=(0,s.a0)(t.font),i=(0,s.E)(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,a,n;if((0,s.ak)(t,this.left,this.right)&&(0,s.ak)(e,this.top,this.bottom)){for(n=this.legendHitBoxes,i=0;i<n.length;++i)if(a=n[i],(0,s.ak)(t,a.left,a.left+a.width)&&(0,s.ak)(e,a.top,a.top+a.height))return this.legendItems[i]}return null}handleEvent(t){var e,i;let a=this.options;if(e=t.type,i=a,("mousemove"!==e&&"mouseout"!==e||!i.onHover&&!i.onLeave)&&(!i.onClick||"click"!==e&&"mouseup"!==e))return;let n=this._getLegendItemAt(t.x,t.y);if("mousemove"===t.type||"mouseout"===t.type){let e=this._hoveredItem,i=null!==e&&null!==n&&e.datasetIndex===n.datasetIndex&&e.index===n.index;e&&!i&&(0,s.Q)(a.onLeave,[t,e,this],this),this._hoveredItem=n,n&&!i&&(0,s.Q)(a.onHover,[t,n,this],this)}else n&&(0,s.Q)(a.onClick,[t,n,this],this)}}function t1(t,e){return e*(t.text?t.text.length:0)}var t2={id:"legend",_element:t0,start(t,e,i){let s=t.legend=new t0({ctx:t.ctx,options:i,chart:t});V.configure(t,s,i),V.addBox(t,s)},stop(t){V.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,i){let s=t.legend;V.configure(t,s,i),s.options=i},afterUpdate(t){let e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,i){let s=e.datasetIndex,a=i.chart;a.isDatasetVisible(s)?(a.hide(s),e.hidden=!0):(a.show(s),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){let e=t.data.datasets,{labels:{usePointStyle:i,pointStyle:a,textAlign:n,color:o,useBorderRadius:r,borderRadius:h}}=t.legend.options;
1return t._getSortedDatasetMetas().map(t=>{let l=t.controller.getStyle(i?0:void 0),d=(0,s.E)(l.borderWidth);return{text:e[t.index].label,fillStyle:l.backgroundColor,fontColor:o,hidden:!t.visible,lineCap:l.borderCapStyle,lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:(d.width+d.height)/4,strokeStyle:l.borderColor,pointStyle:a||l.pointStyle,rotation:l.rotation,textAlign:n||l.textAlign,borderRadius:r&&(h||l.borderRadius),datasetIndex:t.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class t5 extends ts{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){let 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;let a=(0,s.b)(i.text)?i.text.length:1;this._padding=(0,s.E)(i.padding);let n=a*(0,s.a0)(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=n:this.width=n}isHorizontal(){let t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){let e,i,a,{top:n,left:o,bottom:r,right:h,options:l}=this,d=l.align,c=0;return this.isHorizontal()?(i=(0,s.a2)(d,o,h),a=n+t,e=h-o):("left"===l.position?(i=o+t,a=(0,s.a2)(d,r,n),c=-.5*s.P):(i=h-t,a=(0,s.a2)(d,n,r),c=.5*s.P),e=r-n),{titleX:i,titleY:a,maxWidth:e,rotation:c}}draw(){let t=this.ctx,e=this.options;if(!e.display)return;let i=(0,s.a0)(e.font),a=i.lineHeight/2+this._padding.top,{titleX:n,titleY:o,maxWidth:r,rotation:h}=this._drawArgs(a);(0,s.Z)(t,e.text,0,0,i,{color:e.color,maxWidth:r,rotation:h,textAlign:(0,s.a1)(e.align),textBaseline:"middle",translation:[n,o]})}}var t3={id:"title",_element:t5,start(t,e,i){let s;s=new t5({ctx:t.ctx,options:i,chart:t}),V.configure(t,s,i),V.addBox(t,s),t.titleBlock=s},stop(t){let e=t.titleBlock;V.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){let s=t.titleBlock;V.configure(t,s,i),s.options=i},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};new WeakMap;let t6={average(t){let e,i;if(!t.length)return!1;let s=new Set,a=0,n=0;for(e=0,i=t.length;e<i;++e){let i=t[e].element;if(i&&i.hasValue()){let t=i.tooltipPosition();s.add(t.x),a+=t.y,++n}}return 0!==n&&0!==s.size&&{x:[...s].reduce((t,e)=>t+e)/s.size,y:a/n}},nearest(t,e){let i,a,n;if(!t.length)return!1;let o=e.x,r=e.y,h=1/0;for(i=0,a=t.length;i<a;++i){let a=t[i].element;if(a&&a.hasValue()){let t=a.getCenterPoint(),i=(0,s.aF)(e,t);i<h&&(h=i,n=a)}}if(n){let t=n.tooltipPosition();o=t.x,r=t.y}return{x:o,y:r}}};function t4(t,e){return e&&((0,s.b)(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function t7(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function t8(t,e){let i=t.chart.ctx,{body:a,footer:n,title:o}=t,{boxWidth:r,boxHeight:h}=e,l=(0,s.a0)(e.bodyFont),d=(0,s.a0)(e.titleFont),c=(0,s.a0)(e.footerFont),u=o.length,g=n.length,p=a.length,f=(0,s.E)(e.padding),m=f.height,_=0,x=a.reduce((t,e)=>t+e.before.length+e.lines.length+e.after.length,0);x+=t.beforeBody.length+t.afterBody.length,u&&(m+=u*d.lineHeight+(u-1)*e.titleSpacing+e.titleMarginBottom),x&&(m+=p*(e.displayColors?Math.max(h,l.lineHeight):l.lineHeight)+(x-p)*l.lineHeight+(x-1)*e.bodySpacing),g&&(m+=e.footerMarginTop+g*c.lineHeight+(g-1)*e.footerSpacing);let b=0,v=function(t){_=Math.max(_,i.measureText(t).width+b)};return i.save(),i.font=d.string,(0,s.F)(t.title,v),i.font=l.string,(0,s.F)(t.beforeBody.concat(t.afterBody),v),b=e.displayColors?r+2+e.boxPadding:0,(0,s.F)(a,t=>{(0,s.F)(t.before,v),(0,s.F)(t.lines,v),(0,s.F)(t.after,v)}),b=0,i.font=c.string,(0,s.F)(t.footer,v),i.restore(),{width:_+=f.width,height:m}}
1function t9(t,e,i){let s=i.yAlign||e.yAlign||function(t,e){let{y:i,height:s}=e;return i<s/2?"top":i>t.height-s/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||function(t,e,i,s){let{x:a,width:n}=i,{width:o,chartArea:{left:r,right:h}}=t,l="center";return"center"===s?l=a<=(r+h)/2?"left":"right":a<=n/2?l="left":a>=o-n/2&&(l="right"),function(t,e,i,s){let{x:a,width:n}=s,o=i.caretSize+i.caretPadding;if("left"===t&&a+n+o>e.width||"right"===t&&a-n-o<0)return!0}(l,t,e,i)&&(l="center"),l}(t,e,i,s),yAlign:s}}function et(t,e,i,a){let{caretSize:n,caretPadding:o,cornerRadius:r}=t,{xAlign:h,yAlign:l}=i,d=n+o,{topLeft:c,topRight:u,bottomLeft:g,bottomRight:p}=(0,s.ax)(r),f=function(t,e){let{x:i,width:s}=t;return"right"===e?i-=s:"center"===e&&(i-=s/2),i}(e,h),m=function(t,e,i){let{y:s,height:a}=t;return"top"===e?s+=i:"bottom"===e?s-=a+i:s-=a/2,s}(e,l,d);return"center"===l?"left"===h?f+=d:"right"===h&&(f-=d):"left"===h?f-=Math.max(c,g)+n:"right"===h&&(f+=Math.max(u,p)+n),{x:(0,s.S)(f,0,a.width-e.width),y:(0,s.S)(m,0,a.height-e.height)}}function ee(t,e,i){let a=(0,s.E)(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-a.right:t.x+a.left}function ei(t,e){let i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}let es={beforeTitle:s.aG,title(t){if(t.length>0){let e=t[0],i=e.chart.data.labels,s=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(s>0&&e.dataIndex<s)return i[e.dataIndex]}return""},afterTitle:s.aG,beforeBody:s.aG,beforeLabel:s.aG,label(t){if(this&&this.options&&"dataset"===this.options.mode)return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");let i=t.formattedValue;return(0,s.k)(i)||(e+=i),e},labelColor(t){let e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.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(t){let e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:s.aG,afterBody:s.aG,beforeFooter:s.aG,footer:s.aG,afterFooter:s.aG};function ea(t,e,i,s){let a=t[e].call(i,s);return void 0===a?es[e].call(i,s):a}class en extends ts{static positioners=t6;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){let t=this._cachedAnimations;if(t)return t;let e=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&e.options.animation&&i.animations,a=new l(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(a)),a}getContext(){var t,e;return this.$context||(this.$context=(t=this.chart.getContext(),e=this._tooltipItems,(0,s.j)(t,{tooltip:this,tooltipItems:e,type:"tooltip"})))}getTitle(t,e){let{callbacks:i}=e,s=ea(i,"beforeTitle",this,t),a=ea(i,"title",this,t),n=ea(i,"afterTitle",this,t),o=[];return o=t4(o,t7(s)),o=t4(o,t7(a)),o=t4(o,t7(n))}getBeforeBody(t,e){return t4([],t7(ea(e.callbacks,"beforeBody",this,t)))}getBody(t,e){let{callbacks:i}=e,a=[];return(0,s.F)(t,t=>{let e={before:[],lines:[],after:[]},s=ei(i,t);t4(e.before,t7(ea(s,"beforeLabel",this,t))),t4(e.lines,ea(s,"label",this,t)),t4(e.after,t7(ea(s,"afterLabel",this,t))),a.push(e)}),a}getAfterBody(t,e){return t4([],t7(ea(e.callbacks,"afterBody",this,t)))}getFooter(t,e){let{callbacks:i}=e,s=ea(i,"beforeFooter",this,t),a=ea(i,"footer",this,t),n=ea(i,"afterFooter",this,t),o=[];return o=t4(o,t7(s)),o=t4(o,t7(a)),o=t4(o,t7(n))}_createItems(t){let e,i,a=this._active,n=this.chart.data,o=[],r=[],h=[],l=[];for(e=0,i=a.length;e<i;++e)l.push(function(t,e){let{element:i,datasetIndex:s,index:a}=e,n=t.getDatasetMeta(s).controller,{label:o,value:r}=n.getLabelAndValue(a);return{chart:t,label:o,parsed:n.getParsed(a),raw:t.data.datasets[s].data[a],formattedValue:r,dataset:n.getDataset(),dataIndex:a,datasetIndex:s,element:i}}(this.chart,a[e]));return t.filter&&(l=l.filter((e,i,s)=>t.filter(e,i,s,n))),t.itemSort&&(l=l.sort((e,i)=>t.itemSort(e,i,n))),(0,s.F)(l,e=>{let i=ei(t.callbacks,e);o.push(ea(i,"labelColor",this,e)),r.push(ea(i,"labelPointStyle",this,e)),h.push(ea(i,"labelTextColor",this,e))}),this.labelColors=o,this.labelPointStyles=r,this.labelTextColors=h,this.dataPoints=l,l}update(t,e){let i,s=this.options.setContext(this.getContext()),a=this._active,n=[];if(a.length){let t=t6[s.position].call(this,a,this._eventPosition);n=this._createItems(s),this.title=this.getTitle(n,s),this.beforeBody=this.getBeforeBody(n,s),this.body=this.getBody(n,s),this.afterBody=this.getAfterBody(n,s),this.footer=this.getFooter(n,s);let e=this._size=t8(this,s),o=Object.assign({},t,e),r=t9(this.chart,s,o),h=et(s,o,r,this.chart);this.xAlign=r.xAlign,this.yAlign=r.yAlign,i={opacity:1,x:h.x,y:h.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(i={opacity:0}
1);this._tooltipItems=n,this.$context=void 0,i&&this._resolveAnimations().update(this,i),t&&s.external&&s.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){let a=this.getCaretPosition(t,i,s);e.lineTo(a.x1,a.y1),e.lineTo(a.x2,a.y2),e.lineTo(a.x3,a.y3)}getCaretPosition(t,e,i){let a,n,o,r,h,l,{xAlign:d,yAlign:c}=this,{caretSize:u,cornerRadius:g}=i,{topLeft:p,topRight:f,bottomLeft:m,bottomRight:_}=(0,s.ax)(g),{x:x,y:b}=t,{width:v,height:y}=e;return"center"===c?(h=b+y/2,"left"===d?(n=(a=x)-u,r=h+u,l=h-u):(n=(a=x+v)+u,r=h-u,l=h+u),o=a):(n="left"===d?x+Math.max(p,m)+u:"right"===d?x+v-Math.max(f,_)-u:this.caretX,"top"===c?(h=(r=b)-u,a=n-u,o=n+u):(h=(r=b+y)+u,a=n+u,o=n-u),l=r),{x1:a,x2:n,x3:o,y1:r,y2:h,y3:l}}drawTitle(t,e,i){let a,n,o,r=this.title,h=r.length;if(h){let l=(0,s.aA)(i.rtl,this.x,this.width);for(t.x=ee(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",a=(0,s.a0)(i.titleFont),n=i.titleSpacing,e.fillStyle=i.titleColor,e.font=a.string,o=0;o<h;++o)e.fillText(r[o],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+n,o+1===h&&(t.y+=i.titleMarginBottom-n)}}_drawColorBox(t,e,i,a,n){let o=this.labelColors[i],r=this.labelPointStyles[i],{boxHeight:h,boxWidth:l}=n,d=(0,s.a0)(n.bodyFont),c=ee(this,"left",n),u=a.x(c),g=h<d.lineHeight?(d.lineHeight-h)/2:0,p=e.y+g;if(n.usePointStyle){let e={radius:Math.min(l,h)/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:1},i=a.leftForLtr(u,l)+l/2,d=p+h/2;t.strokeStyle=n.multiKeyBackground,t.fillStyle=n.multiKeyBackground,(0,s.au)(t,e,i,d),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,(0,s.au)(t,e,i,d)}else{t.lineWidth=(0,s.i)(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,t.strokeStyle=o.borderColor,t.setLineDash(o.borderDash||[]),t.lineDashOffset=o.borderDashOffset||0;let e=a.leftForLtr(u,l),i=a.leftForLtr(a.xPlus(u,1),l-2),r=(0,s.ax)(o.borderRadius);Object.values(r).some(t=>0!==t)?(t.beginPath(),t.fillStyle=n.multiKeyBackground,(0,s.av)(t,{x:e,y:p,w:l,h:h,radius:r}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),(0,s.av)(t,{x:i,y:p+1,w:l-2,h:h-2,radius:r}),t.fill()):(t.fillStyle=n.multiKeyBackground,t.fillRect(e,p,l,h),t.strokeRect(e,p,l,h),t.fillStyle=o.backgroundColor,t.fillRect(i,p+1,l-2,h-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){let a,n,o,r,h,l,{body:d}=this,{bodySpacing:c,bodyAlign:u,displayColors:g,boxHeight:p,boxWidth:f,boxPadding:m}=i,_=(0,s.a0)(i.bodyFont),x=_.lineHeight,b=0,v=(0,s.aA)(i.rtl,this.x,this.width),y=function(i){e.fillText(i,v.x(t.x+b),t.y+x/2),t.y+=x+c},w=v.textAlign(u);for(e.textAlign=u,e.textBaseline="middle",e.font=_.string,t.x=ee(this,w,i),e.fillStyle=i.bodyColor,(0,s.F)(this.beforeBody,y),b=g&&"right"!==w?"center"===u?f/2+m:f+2+m:0,o=0,h=d.length;o<h;++o){for(a=d[o],e.fillStyle=this.labelTextColors[o],(0,s.F)(a.before,y),n=a.lines,g&&n.length&&(this._drawColorBox(e,t,o,v,i),x=Math.max(_.lineHeight,p)),r=0,l=n.length;r<l;++r)y(n[r]),x=_.lineHeight;(0,s.F)(a.after,y)}b=0,x=_.lineHeight,(0,s.F)(this.afterBody,y),t.y-=c}drawFooter(t,e,i){let a,n,o=this.footer,r=o.length;if(r){let h=(0,s.aA)(i.rtl,this.x,this.width);for(t.x=ee(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=h.textAlign(i.footerAlign),e.textBaseline="middle",a=(0,s.a0)(i.footerFont),e.fillStyle=i.footerColor,e.font=a.string,n=0;n<r;++n)e.fillText(o[n],h.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+i.footerSpacing}}drawBackground(t,e,i,a){let{xAlign:n,yAlign:o}=this,{x:r,y:h}=t,{width:l,height:d}=i,{topLeft:c,topRight:u,bottomLeft:g,bottomRight:p}=(0,s.ax)(a.cornerRadius);e.fillStyle=a.backgroundColor,e.strokeStyle=a.borderColor,e.lineWidth=a.borderWidth,e.beginPath(),e.moveTo(r+c,h),"top"===o&&this.drawCaret(t,e,i,a),e.lineTo(r+l-u,h),e.quadraticCurveTo(r+l,h,r+l,h+u),"center"===o&&"right"===n&&this.drawCaret(t,e,i,a),e.lineTo(r+l,h+d-p),e.quadraticCurveTo(r+l,h+d,r+l-p,h+d),"bottom"===o&&this.drawCaret(t,e,i,a),e.lineTo(r+g,h+d),e.quadraticCurveTo(r,h+d,r,h+d-g),"center"===o&&"left"===n&&this.drawCaret(t,e,i,a),e.lineTo(r,h+c),e.quadraticCurveTo(r,h,r+c,h),e.closePath(),e.fill(),a.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){let e=this.chart,i=this.$animations,s=i&&i.x,a=i&&i.y;if(s||a){let i=t6[t.position].call(this,this._active,this._eventPosition);if(!i)return;let n=this._size=t8(this,t),o=Object.assign({},i,this._size),r=t9(e,t,o),h=et(t,o,r,e);(s._to!==h.x||a._to!==h.y)&&(this.xAlign=r.xAlign,this.yAlign=r.yAlign,this.width=n.width,this.height=n.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){let e=this.options.setContext(this.getContext()),i=this.opacity;if(!i)return;this._updateAnimationTarget(e);let a={width:this.width,height:this.height},n={x:this.x,y:this.y};i=.001>Math.abs(i)?0:i;let o=(0,s.E)(e.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;
1e.enabled&&r&&(t.save(),t.globalAlpha=i,this.drawBackground(n,t,a,e),(0,s.aB)(t,e.textDirection),n.y+=o.top,this.drawTitle(n,t,e),this.drawBody(n,t,e),this.drawFooter(n,t,e),(0,s.aD)(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){let i=this._active,a=t.map(({datasetIndex:t,index:e})=>{let i=this.chart.getDatasetMeta(t);if(!i)throw Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}),n=!(0,s.ai)(i,a),o=this._positionChanged(a,e);(n||o)&&(this._active=a,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let a=this.options,n=this._active||[],o=this._getActiveElements(t,n,e,i),r=this._positionChanged(o,t),h=e||!(0,s.ai)(o,n)||r;return h&&(this._active=o,(a.enabled||a.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),h}_getActiveElements(t,e,i,s){let a=this.options;if("mouseout"===t.type)return[];if(!s)return e.filter(t=>this.chart.data.datasets[t.datasetIndex]&&void 0!==this.chart.getDatasetMeta(t.datasetIndex).controller.getParsed(t.index));let n=this.chart.getElementsAtEventForMode(t,a.mode,a,i);return a.reverse&&n.reverse(),n}_positionChanged(t,e){let{caretX:i,caretY:s,options:a}=this,n=t6[a.position].call(this,t,e);return!1!==n&&(i!==n.x||s!==n.y)}}var eo={id:"tooltip",_element:en,positioners:t6,afterInit(t,e,i){i&&(t.tooltip=new en({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){let e=t.tooltip;if(e&&e._willRender()){let i={tooltip:e};if(!1===t.notifyPlugins("beforeTooltipDraw",{...i,cancelable:!0}))return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i)}},afterEvent(t,e){if(t.tooltip){let i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:es},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};function er(t){let e=this.getLabels();return t>=0&&t<e.length?e[t]:t}class eh extends td{static id="category";static defaults={ticks:{callback:er}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){let e=this._addedLabels;if(e.length){let t=this.getLabels();for(let{index:i,label:s}of e)t[i]===s&&t.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){let i,a;if((0,s.k)(t))return null;let n=this.getLabels();return i=e=isFinite(e)&&n[e]===t?e:function(t,e,i,s){let a=t.indexOf(e);if(-1===a){var n;return n=i,"string"==typeof e?(n=t.push(e)-1,s.unshift({index:n,label:e})):isNaN(e)&&(n=null),n}return a!==t.lastIndexOf(e)?i:a}(n,t,(0,s.v)(e,t),this._addedLabels),a=n.length-1,null===i?null:(0,s.S)(Math.round(i),0,a)}determineDataLimits(){let{minDefined:t,maxDefined:e}=this.getUserBounds(),{min:i,max:s}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){let t=this.min,e=this.max,i=this.options.offset,s=[],a=this.getLabels();a=0===t&&e===a.length-1?a:a.slice(t,e+1),this._valueRange=Math.max(a.length-!i,1),this._startValue=this.min-.5*!!i;for(let i=t;i<=e;i++)s.push({value:i});return s}getLabelForValue(t){return er.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return"number"!=typeof t&&(t=this.parse(t)),null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){let 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 el(t,e,{horizontal:i,minRotation:a}){let n=(0,s.t)(a),o=(i?Math.sin(n):Math.cos(n))||.001,r=.75*e*(""+t).length;return Math.min(e/o,r)}class ed extends td{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,s.k)(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){let{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds(),{min:a,max:n}=this,o=t=>a=e?a:t,r=t=>n=i?n:t;if(t){let t=(0,s.s)(a),e=(0,s.s)(n);t<0&&e<0?r(0):t>0&&e>0&&o(0)}if(a===n){let e=0===n?1:Math.abs(.05*n);r(n+e),t||o(a-e)}this.min=a,this.max=n}getTickLimit(){let t,{maxTicksLimit:e,stepSize:i}=this.options.ticks;return i?(t=Math.ceil(this.max/i)-Math.floor(this.min/i)+1)>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${t} ticks. Limiting to 1000.`),t=1e3):(t=this.computeTickLimit(),e=e||11),e&&(t=Math.min(e,t)),t}computeTickLimit(){return 1/0}buildTicks(){let t=this.options,e=t.ticks,i=this.getTickLimit(),a=function(t,e){let i,a,n,o,r=[],{bounds:h,step:l,min:d,max:c,precision:u,count:g,maxTicks:p,maxDigits:f,includeBounds:m}=t,_=l||1,x=p-1,{min:b,max:v}=e,y=!(0,s.k)(d),w=!(0,s.k)(c),M=!(0,s.k)(g),k=(v-b)/(f+1),S=(0,s.aI)((v-b)/x/_)*_;if(S<1e-14&&!y&&!w)return[{value:b},{value:v}];(o=Math.ceil(v/S)-Math.floor(b/S))>
1x&&(S=(0,s.aI)(o*S/x/_)*_),(0,s.k)(u)||(S=Math.ceil(S*(i=Math.pow(10,u)))/i),"ticks"===h?(a=Math.floor(b/S)*S,n=Math.ceil(v/S)*S):(a=b,n=v),y&&w&&l&&(0,s.aJ)((c-d)/l,S/1e3)?(o=Math.round(Math.min((c-d)/S,p)),S=(c-d)/o,a=d,n=c):M?(a=y?d:a,S=((n=w?c:n)-a)/(o=g-1)):(o=(n-a)/S,o=(0,s.aK)(o,Math.round(o),S/1e3)?Math.round(o):Math.ceil(o));let D=Math.max((0,s.aL)(S),(0,s.aL)(a));a=Math.round(a*(i=Math.pow(10,(0,s.k)(u)?D:u)))/i,n=Math.round(n*i)/i;let C=0;for(y&&(m&&a!==d?(r.push({value:d}),a<d&&C++,(0,s.aK)(Math.round((a+C*S)*i)/i,d,el(d,k,t))&&C++):a<d&&C++);C<o;++C){let t=Math.round((a+C*S)*i)/i;if(w&&t>c)break;r.push({value:t})}return w&&m&&n!==c?r.length&&(0,s.aK)(r[r.length-1].value,c,el(c,k,t))?r[r.length-1].value=c:r.push({value:c}):w&&n!==c||r.push({value:n}),r}({maxTicks:i=Math.max(2,i),bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},this._range||this);return"ticks"===t.bounds&&(0,s.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(){let t=this.ticks,e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){let 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,s.o)(t,this.chart.options.locale,this.options.ticks.format)}}class ec extends ed{static id="linear";static defaults={ticks:{callback:s.aM.formatters.numeric}};determineDataLimits(){let{min:t,max:e}=this.getMinMax(!0);this.min=(0,s.g)(t)?t:0,this.max=(0,s.g)(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){let t=this.isHorizontal(),e=t?this.width:this.height,i=(0,s.t)(this.options.ticks.minRotation),a=(t?Math.sin(i):Math.cos(i))||.001;return Math.ceil(e/Math.min(40,this._resolveTickFontOptions(0).lineHeight/a))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}s.aM.formatters.logarithmic;s.aM.formatters.numeric;let eu={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}},eg=Object.keys(eu);function ep(t,e){return t-e}function ef(t,e){if((0,s.k)(e))return null;let i=t._adapter,{parser:a,round:n,isoWeekday:o}=t._parseOpts,r=e;return("function"==typeof a&&(r=a(r)),(0,s.g)(r)||(r="string"==typeof a?i.parse(r,a):i.parse(r)),null===r)?null:(n&&(r="week"===n&&((0,s.x)(o)||!0===o)?i.startOf(r,"isoWeek",o):i.startOf(r,n)),+r)}function em(t,e,i,s){let a=eg.length;for(let n=eg.indexOf(t);n<a-1;++n){let t=eu[eg[n]],a=t.steps?t.steps:Number.MAX_SAFE_INTEGER;if(t.common&&Math.ceil((i-e)/(a*t.size))<=s)return eg[n]}return eg[a-1]}function e_(t,e,i){if(i){if(i.length){let{lo:a,hi:n}=(0,s.aQ)(i,e);t[i[a]>=e?i[a]:i[n]]=!0}}else t[e]=!0}function ex(t,e,i){let s,a,n=[],o={},r=e.length;for(s=0;s<r;++s)o[a=e[s]]=s,n.push({value:a,major:!1});return 0!==r&&i?function(t,e,i,s){let a,n,o=t._adapter,r=+o.startOf(e[0].value,s),h=e[e.length-1].value;for(a=r;a<=h;a=+o.add(a,1,s))(n=i[a])>=0&&(e[n].major=!0);return e}(t,n,o,i):n}class eb extends td{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={}){let i=t.time||(t.time={}),a=this._adapter=new S(t.adapters.date);a.init(e),(0,s.ab)(i.displayFormats,a.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:ef(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){let t=this.options,e=this._adapter,i=t.time.unit||"day",{min:a,max:n,minDefined:o,maxDefined:r}=this.getUserBounds();function h(t){o||isNaN(t.min)||(a=Math.min(a,t.min)),r||isNaN(t.max)||(n=Math.max(n,t.max))}o&&r||(h(this._getLabelBounds()),("ticks"!==t.bounds||"labels"!==t.ticks.source)&&h(this.getMinMax(!1))),a=(0,s.g)(a)&&!isNaN(a)?a:+e.startOf(Date.now(),i),n=(0,s.g)(n)&&!isNaN(n)?n:+e.endOf(Date.now(),i)+1,this.min=Math.min(a,n-1),this.max=Math.max(a+1,n)}_getLabelBounds(){let t=this.getLabelTimestamps(),e=1/0,i=-1/0;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){let t=this.options,e=t.time,i=t.ticks,a="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&a.length&&(this.min=this._userMin||a[0],this.max=this._userMax||a[a.length-1]);let n=this.min,o=this.max,r=(0,s.aP)(a,n,o);return this._unit=e.unit||(i.autoSkip?em(e.minUnit,this.min,this.max,this._getLabelCapacity(n)):function(t,e,
1i,s,a){for(let n=eg.length-1;n>=eg.indexOf(i);n--){let i=eg[n];if(eu[i].common&&t._adapter.diff(a,s,i)>=e-1)return i}return eg[i?eg.indexOf(i):0]}(this,r.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(t){for(let e=eg.indexOf(t)+1,i=eg.length;e<i;++e)if(eu[eg[e]].common)return eg[e]}(this._unit):void 0,this.initOffsets(a),t.reverse&&r.reverse(),ex(this,r,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e,i,a=0,n=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),a=1===t.length?1-e:(this.getDecimalForValue(t[1])-e)/2,i=this.getDecimalForValue(t[t.length-1]),n=1===t.length?i:(i-this.getDecimalForValue(t[t.length-2]))/2);let o=t.length<3?.5:.25;a=(0,s.S)(a,0,o),n=(0,s.S)(n,0,o),this._offsets={start:a,end:n,factor:1/(a+1+n)}}_generate(){let t,e,i=this._adapter,a=this.min,n=this.max,o=this.options,r=o.time,h=r.unit||em(r.minUnit,a,n,this._getLabelCapacity(a)),l=(0,s.v)(o.ticks.stepSize,1),d="week"===h&&r.isoWeekday,c=(0,s.x)(d)||!0===d,u={},g=a;if(c&&(g=+i.startOf(g,"isoWeek",d)),g=+i.startOf(g,c?"day":h),i.diff(n,a,h)>1e5*l)throw Error(a+" and "+n+" are too far apart with stepSize of "+l+" "+h);let p="data"===o.ticks.source&&this.getDataTimestamps();for(t=g,e=0;t<n;t=+i.add(t,l,h),e++)e_(u,t,p);return(t===n||"ticks"===o.bounds||1===e)&&e_(u,t,p),Object.keys(u).sort(ep).map(t=>+t)}getLabelForValue(t){let e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){let i=this.options.time.displayFormats,s=this._unit,a=e||i[s];return this._adapter.format(t,a)}_tickFormatFunction(t,e,i,a){let n=this.options,o=n.ticks.callback;if(o)return(0,s.Q)(o,[t,e,i],this);let r=n.time.displayFormats,h=this._unit,l=this._majorUnit,d=h&&r[h],c=l&&r[l],u=i[e],g=l&&c&&u&&u.major;return this._adapter.format(t,a||(g?c:d))}generateTickLabels(t){let e,i,s;for(e=0,i=t.length;e<i;++e)(s=t[e]).label=this._tickFormatFunction(s.value,e,t)}getDecimalForValue(t){return null===t?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){let e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){let e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){let e=this.options.ticks,i=this.ctx.measureText(t).width,a=(0,s.t)(this.isHorizontal()?e.maxRotation:e.minRotation),n=Math.cos(a),o=Math.sin(a),r=this._resolveTickFontOptions(0).size;return{w:i*n+r*o,h:i*o+r*n}}_getLabelCapacity(t){let e=this.options.time,i=e.displayFormats,s=i[e.unit]||i.millisecond,a=this._tickFormatFunction(t,0,ex(this,[t],this._majorUnit),s),n=this._getLabelSize(a),o=Math.floor(this.isHorizontal()?this.width/n.w:this.height/n.h)-1;return o>0?o:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;let s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(t=0,e=s.length;t<e;++t)i=i.concat(s[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(i)}getLabelTimestamps(){let t,e,i=this._cache.labels||[];if(i.length)return i;let s=this.getLabels();for(t=0,e=s.length;t<e;++t)i.push(ef(this,s[t]));return this._cache.labels=this._normalized?i:this.normalize(i)}normalize(t){return(0,s._)(t.sort(ep))}}eb.defaults}}]);

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.