@pb33f/cowboy-components 0.7.1 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -20,7 +20,7 @@ let BeefyChart = class BeefyChart extends Colorful {
|
|
|
20
20
|
this.chartType = 'line';
|
|
21
21
|
}
|
|
22
22
|
updateChart() {
|
|
23
|
-
if (this.chart) {
|
|
23
|
+
if (this.chart && this.chart.data && this.datasets && this.datasets.length > 0) {
|
|
24
24
|
this.chart.data.labels = this.labels;
|
|
25
25
|
this.chart.data.datasets = this.datasets;
|
|
26
26
|
this.chart.update();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(E,V){typeof exports=="object"&&typeof module<"u"?V(require("lit"),require("lit/decorators.js"),require("prismjs"),require("monaco-editor"),require("@shoelace-style/shoelace/dist/components/dropdown/dropdown.js"),require("@shoelace-style/shoelace/dist/components/menu/menu.js"),require("@shoelace-style/shoelace/dist/components/menu-item/menu-item.js"),require("@shoelace-style/shoelace/dist/components/carousel/carousel.js"),require("@shoelace-style/shoelace/dist/components/carousel-item/carousel-item.js"),require("@shoelace-style/shoelace/dist/components/drawer/drawer.js"),require("@shoelace-style/shoelace/dist/components/copy-button/copy-button.js"),require("@shoelace-style/shoelace/dist/components/format-number/format-number.js"),require("@shoelace-style/shoelace/dist/components/split-panel/split-panel.js"),require("@shoelace-style/shoelace/dist/components/tab-group/tab-group.js"),require("@shoelace-style/shoelace/dist/components/tab-panel/tab-panel.js"),require("@shoelace-style/shoelace/dist/components/tab/tab.js"),require("@shoelace-style/shoelace/dist/components/switch/switch.js"),require("@shoelace-style/shoelace/dist/components/dialog/dialog.js"),require("@shoelace-style/shoelace/dist/components/alert/alert.js"),require("@shoelace-style/shoelace/dist/components/badge/badge.js"),require("@shoelace-style/shoelace/dist/components/avatar/avatar.js"),require("@shoelace-style/shoelace/dist/components/breadcrumb/breadcrumb.js"),require("@shoelace-style/shoelace/dist/components/card/card.js"),require("@shoelace-style/shoelace/dist/components/textarea/textarea.js"),require("@shoelace-style/shoelace/dist/components/radio-group/radio-group.js"),require("@shoelace-style/shoelace/dist/components/radio-button/radio-button.js"),require("@shoelace-style/shoelace/dist/components/checkbox/checkbox.js"),require("@shoelace-style/shoelace/dist/components/select/select.js"),require("@shoelace-style/shoelace/dist/components/option/option.js"),require("@shoelace-style/shoelace/dist/components/radio/radio.js"),require("@shoelace-style/shoelace/dist/components/popup/popup.js"),require("@shoelace-style/shoelace/dist/components/icon-button/icon-button.js"),require("@shoelace-style/shoelace/dist/components/tree/tree.js"),require("@shoelace-style/shoelace/dist/components/tree-item/tree-item.js"),require("@shoelace-style/shoelace/dist/components/range/range.js"),require("@shoelace-style/shoelace/dist/utilities/form.js"),require("@shoelace-style/shoelace/dist/components/format-bytes/format-bytes.js"),require("@shoelace-style/shoelace/dist/components/animation/animation.js"),require("@shoelace-style/shoelace/dist/components/format-date/format-date.js"),require("@shoelace-style/shoelace/dist/components/relative-time/relative-time.js"),require("@shoelace-style/shoelace/dist/utilities/base-path.js")):typeof define=="function"&&define.amd?define(["lit","lit/decorators.js","prismjs","monaco-editor","@shoelace-style/shoelace/dist/components/dropdown/dropdown.js","@shoelace-style/shoelace/dist/components/menu/menu.js","@shoelace-style/shoelace/dist/components/menu-item/menu-item.js","@shoelace-style/shoelace/dist/components/carousel/carousel.js","@shoelace-style/shoelace/dist/components/carousel-item/carousel-item.js","@shoelace-style/shoelace/dist/components/drawer/drawer.js","@shoelace-style/shoelace/dist/components/copy-button/copy-button.js","@shoelace-style/shoelace/dist/components/format-number/format-number.js","@shoelace-style/shoelace/dist/components/split-panel/split-panel.js","@shoelace-style/shoelace/dist/components/tab-group/tab-group.js","@shoelace-style/shoelace/dist/components/tab-panel/tab-panel.js","@shoelace-style/shoelace/dist/components/tab/tab.js","@shoelace-style/shoelace/dist/components/switch/switch.js","@shoelace-style/shoelace/dist/components/dialog/dialog.js","@shoelace-style/shoelace/dist/components/alert/alert.js","@shoelace-style/shoelace/dist/components/badge/badge.js","@shoelace-style/shoelace/dist/components/avatar/avatar.js","@shoelace-style/shoelace/dist/components/breadcrumb/breadcrumb.js","@shoelace-style/shoelace/dist/components/card/card.js","@shoelace-style/shoelace/dist/components/textarea/textarea.js","@shoelace-style/shoelace/dist/components/radio-group/radio-group.js","@shoelace-style/shoelace/dist/components/radio-button/radio-button.js","@shoelace-style/shoelace/dist/components/checkbox/checkbox.js","@shoelace-style/shoelace/dist/components/select/select.js","@shoelace-style/shoelace/dist/components/option/option.js","@shoelace-style/shoelace/dist/components/radio/radio.js","@shoelace-style/shoelace/dist/components/popup/popup.js","@shoelace-style/shoelace/dist/components/icon-button/icon-button.js","@shoelace-style/shoelace/dist/components/tree/tree.js","@shoelace-style/shoelace/dist/components/tree-item/tree-item.js","@shoelace-style/shoelace/dist/components/range/range.js","@shoelace-style/shoelace/dist/utilities/form.js","@shoelace-style/shoelace/dist/components/format-bytes/format-bytes.js","@shoelace-style/shoelace/dist/components/animation/animation.js","@shoelace-style/shoelace/dist/components/format-date/format-date.js","@shoelace-style/shoelace/dist/components/relative-time/relative-time.js","@shoelace-style/shoelace/dist/utilities/base-path.js"],V):(E=typeof globalThis<"u"?globalThis:E||self,V(E.lit,E["lit/decorators"].js,E.prismjs,E
|
|
1
|
+
(function(E,V){typeof exports=="object"&&typeof module<"u"?V(require("lit"),require("lit/decorators.js"),require("prismjs"),require("monaco-editor"),require("@shoelace-style/shoelace/dist/components/dropdown/dropdown.js"),require("@shoelace-style/shoelace/dist/components/menu/menu.js"),require("@shoelace-style/shoelace/dist/components/menu-item/menu-item.js"),require("@shoelace-style/shoelace/dist/components/carousel/carousel.js"),require("@shoelace-style/shoelace/dist/components/carousel-item/carousel-item.js"),require("@shoelace-style/shoelace/dist/components/drawer/drawer.js"),require("@shoelace-style/shoelace/dist/components/copy-button/copy-button.js"),require("@shoelace-style/shoelace/dist/components/format-number/format-number.js"),require("@shoelace-style/shoelace/dist/components/split-panel/split-panel.js"),require("@shoelace-style/shoelace/dist/components/tab-group/tab-group.js"),require("@shoelace-style/shoelace/dist/components/tab-panel/tab-panel.js"),require("@shoelace-style/shoelace/dist/components/tab/tab.js"),require("@shoelace-style/shoelace/dist/components/switch/switch.js"),require("@shoelace-style/shoelace/dist/components/dialog/dialog.js"),require("@shoelace-style/shoelace/dist/components/alert/alert.js"),require("@shoelace-style/shoelace/dist/components/badge/badge.js"),require("@shoelace-style/shoelace/dist/components/avatar/avatar.js"),require("@shoelace-style/shoelace/dist/components/breadcrumb/breadcrumb.js"),require("@shoelace-style/shoelace/dist/components/card/card.js"),require("@shoelace-style/shoelace/dist/components/textarea/textarea.js"),require("@shoelace-style/shoelace/dist/components/radio-group/radio-group.js"),require("@shoelace-style/shoelace/dist/components/radio-button/radio-button.js"),require("@shoelace-style/shoelace/dist/components/checkbox/checkbox.js"),require("@shoelace-style/shoelace/dist/components/select/select.js"),require("@shoelace-style/shoelace/dist/components/option/option.js"),require("@shoelace-style/shoelace/dist/components/radio/radio.js"),require("@shoelace-style/shoelace/dist/components/popup/popup.js"),require("@shoelace-style/shoelace/dist/components/icon-button/icon-button.js"),require("@shoelace-style/shoelace/dist/components/tree/tree.js"),require("@shoelace-style/shoelace/dist/components/tree-item/tree-item.js"),require("@shoelace-style/shoelace/dist/components/range/range.js"),require("@shoelace-style/shoelace/dist/utilities/form.js"),require("@shoelace-style/shoelace/dist/components/format-bytes/format-bytes.js"),require("@shoelace-style/shoelace/dist/components/animation/animation.js"),require("@shoelace-style/shoelace/dist/components/format-date/format-date.js"),require("@shoelace-style/shoelace/dist/components/relative-time/relative-time.js"),require("@shoelace-style/shoelace/dist/utilities/base-path.js")):typeof define=="function"&&define.amd?define(["lit","lit/decorators.js","prismjs","monaco-editor","@shoelace-style/shoelace/dist/components/dropdown/dropdown.js","@shoelace-style/shoelace/dist/components/menu/menu.js","@shoelace-style/shoelace/dist/components/menu-item/menu-item.js","@shoelace-style/shoelace/dist/components/carousel/carousel.js","@shoelace-style/shoelace/dist/components/carousel-item/carousel-item.js","@shoelace-style/shoelace/dist/components/drawer/drawer.js","@shoelace-style/shoelace/dist/components/copy-button/copy-button.js","@shoelace-style/shoelace/dist/components/format-number/format-number.js","@shoelace-style/shoelace/dist/components/split-panel/split-panel.js","@shoelace-style/shoelace/dist/components/tab-group/tab-group.js","@shoelace-style/shoelace/dist/components/tab-panel/tab-panel.js","@shoelace-style/shoelace/dist/components/tab/tab.js","@shoelace-style/shoelace/dist/components/switch/switch.js","@shoelace-style/shoelace/dist/components/dialog/dialog.js","@shoelace-style/shoelace/dist/components/alert/alert.js","@shoelace-style/shoelace/dist/components/badge/badge.js","@shoelace-style/shoelace/dist/components/avatar/avatar.js","@shoelace-style/shoelace/dist/components/breadcrumb/breadcrumb.js","@shoelace-style/shoelace/dist/components/card/card.js","@shoelace-style/shoelace/dist/components/textarea/textarea.js","@shoelace-style/shoelace/dist/components/radio-group/radio-group.js","@shoelace-style/shoelace/dist/components/radio-button/radio-button.js","@shoelace-style/shoelace/dist/components/checkbox/checkbox.js","@shoelace-style/shoelace/dist/components/select/select.js","@shoelace-style/shoelace/dist/components/option/option.js","@shoelace-style/shoelace/dist/components/radio/radio.js","@shoelace-style/shoelace/dist/components/popup/popup.js","@shoelace-style/shoelace/dist/components/icon-button/icon-button.js","@shoelace-style/shoelace/dist/components/tree/tree.js","@shoelace-style/shoelace/dist/components/tree-item/tree-item.js","@shoelace-style/shoelace/dist/components/range/range.js","@shoelace-style/shoelace/dist/utilities/form.js","@shoelace-style/shoelace/dist/components/format-bytes/format-bytes.js","@shoelace-style/shoelace/dist/components/animation/animation.js","@shoelace-style/shoelace/dist/components/format-date/format-date.js","@shoelace-style/shoelace/dist/components/relative-time/relative-time.js","@shoelace-style/shoelace/dist/utilities/base-path.js"],V):(E=typeof globalThis<"u"?globalThis:E||self,V(E.lit,E["lit/decorators"].js,E.prismjs,E["monaco-editor"],null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,E.form_js,null,null,null,null,E.basePath))})(this,function(E,V,fl,f4,Qan,Jan,eun,tun,nun,iun,run,sun,oun,cun,lun,aun,uun,hun,fun,dun,pun,gun,bun,mun,wun,vun,yun,xun,kun,Cun,Mun,Lun,Sun,Iun,Aun,s6e,Pun,Eun,$un,Nun,Kvt){"use strict";var Yan=Object.defineProperty;var Uvt=E=>{throw TypeError(E)};var Zan=(E,V,fl)=>V in E?Yan(E,V,{enumerable:!0,configurable:!0,writable:!0,value:fl}):E[V]=fl;var en=(E,V,fl)=>Zan(E,typeof V!="symbol"?V+"":V,fl),Xan=(E,V,fl)=>V.has(E)||Uvt("Cannot "+fl);var qvt=(E,V,fl)=>V.has(E)?Uvt("Cannot add the same private member more than once"):V instanceof WeakSet?V.add(E):V.set(E,fl);var cee=(E,V,fl)=>(Xan(E,V,"access private method"),fl);var D8,r6e,Gvt;function Wvt(h){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(h){for(const l in h)if(l!=="default"){const d=Object.getOwnPropertyDescriptor(h,l);Object.defineProperty(c,l,d.get?d:{enumerable:!0,get:()=>h[l]})}}return c.default=h,Object.freeze(c)}const Ko=Wvt(f4),Vvt=E.css`
|
|
2
2
|
:host {
|
|
3
3
|
display: flex;
|
|
4
4
|
column-gap: 10px;
|
|
@@ -11771,7 +11771,7 @@ ${Sxt(h)}`}}))}render(){var L,A,I,N,O;let h=E.html``,c=E.html``,l=E.html``,d=E.h
|
|
|
11771
11771
|
* Released under the MIT License
|
|
11772
11772
|
*/class fMt{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(c,l,d,p){const m=l.listeners[p],v=l.duration;m.forEach(C=>C({chart:c,initial:l.initial,numSteps:v,currentStep:Math.min(d-l.start,v)}))}_refresh(){this._request||(this._running=!0,this._request=Q8e.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(c=Date.now()){let l=0;this._charts.forEach((d,p)=>{if(!d.running||!d.items.length)return;const m=d.items;let v=m.length-1,C=!1,L;for(;v>=0;--v)L=m[v],L._active?(L._total>d.duration&&(d.duration=L._total),L.tick(c),C=!0):(m[v]=m[m.length-1],m.pop());C&&(p.draw(),this._notify(p,d,c,"progress")),m.length||(d.running=!1,this._notify(p,d,c,"complete"),d.initial=!1),l+=m.length}),this._lastDate=c,l===0&&(this._running=!1)}_getAnims(c){const l=this._charts;let d=l.get(c);return d||(d={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},l.set(c,d)),d}listen(c,l,d){this._getAnims(c).listeners[l].push(d)}add(c,l){!l||!l.length||this._getAnims(c).items.push(...l)}has(c){return this._getAnims(c).items.length>0}start(c){const l=this._charts.get(c);l&&(l.running=!0,l.start=Date.now(),l.duration=l.items.reduce((d,p)=>Math.max(d,p._duration),0),this._refresh())}running(c){if(!this._running)return!1;const l=this._charts.get(c);return!(!l||!l.running||!l.items.length)}stop(c){const l=this._charts.get(c);if(!l||!l.items.length)return;const d=l.items;let p=d.length-1;for(;p>=0;--p)d[p].cancel();l.items=[],this._notify(c,l,Date.now(),"complete")}remove(c){return this._charts.delete(c)}}var dv=new fMt;const A9e="transparent",dMt={boolean(h,c,l){return l>.5?c:h},color(h,c,l){const d=r9e(h||A9e),p=d.valid&&r9e(c||A9e);return p&&p.valid?p.mix(d,l).hexString():c},number(h,c,l){return h+(c-h)*l}};class pMt{constructor(c,l,d,p){const m=l[d];p=lE([c.to,p,m,c.from]);const v=lE([c.from,m,p]);this._active=!0,this._fn=c.fn||dMt[c.type||typeof v],this._easing=rE[c.easing]||rE.linear,this._start=Math.floor(Date.now()+(c.delay||0)),this._duration=this._total=Math.floor(c.duration),this._loop=!!c.loop,this._target=l,this._prop=d,this._from=v,this._to=p,this._promises=void 0}active(){return this._active}update(c,l,d){if(this._active){this._notify(!1);const p=this._target[this._prop],m=d-this._start,v=this._duration-m;this._start=d,this._duration=Math.floor(Math.max(v,c.duration)),this._total+=m,this._loop=!!c.loop,this._to=lE([c.to,l,p,c.from]),this._from=lE([c.from,p,l])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(c){const l=c-this._start,d=this._duration,p=this._prop,m=this._from,v=this._loop,C=this._to;let L;if(this._active=m!==C&&(v||l<d),!this._active){this._target[p]=C,this._notify(!0);return}if(l<0){this._target[p]=m;return}L=l/d%2,L=v&&L>1?2-L:L,L=this._easing(Math.min(1,Math.max(0,L))),this._target[p]=this._fn(m,C,L)}wait(){const c=this._promises||(this._promises=[]);return new Promise((l,d)=>{c.push({res:l,rej:d})})}_notify(c){const l=c?"res":"rej",d=this._promises||[];for(let p=0;p<d.length;p++)d[p][l]()}}class P9e{constructor(c,l){this._chart=c,this._properties=new Map,this.configure(l)}configure(c){if(!yo(c))return;const l=Object.keys(Bl.animation),d=this._properties;Object.getOwnPropertyNames(c).forEach(p=>{const m=c[p];if(!yo(m))return;const v={};for(const C of l)v[C]=m[C];(Rl(m.properties)&&m.properties||[p]).forEach(C=>{(C===p||!d.has(C))&&d.set(C,v)})})}_animateOptions(c,l){const d=l.options,p=bMt(c,d);if(!p)return[];const m=this._createAnimations(p,d);return d.$shared&&gMt(c.options.$animations,d).then(()=>{c.options=d},()=>{}),m}_createAnimations(c,l){const d=this._properties,p=[],m=c.$animations||(c.$animations={}),v=Object.keys(l),C=Date.now();let L;for(L=v.length-1;L>=0;--L){const A=v[L];if(A.charAt(0)==="$")continue;if(A==="options"){p.push(...this._animateOptions(c,l));continue}const I=l[A];let N=m[A];const O=d.get(A);if(N)if(O&&N.active()){N.update(O,I,C);continue}else N.cancel();if(!O||!O.duration){c[A]=I;continue}m[A]=N=new pMt(O,c,A,I),p.push(N)}return p}update(c,l){if(this._properties.size===0){Object.assign(c,l);return}const d=this._createAnimations(c,l);if(d.length)return dv.add(this._chart,d),!0}}function gMt(h,c){const l=[],d=Object.keys(c);for(let p=0;p<d.length;p++){const m=h[d[p]];m&&m.active()&&l.push(m.wait())}return Promise.all(l)}function bMt(h,c){if(!c)return;let l=h.options;if(!l){h.options=c;return}return l.$shared&&(h.options=l=Object.assign({},l,{$shared:!1,$animations:{}})),l}function E9e(h,c){const l=h&&h.options||{},d=l.reverse,p=l.min===void 0?c:0,m=l.max===void 0?c:0;return{start:d?m:p,end:d?p:m}}function mMt(h,c,l){if(l===!1)return!1;const d=E9e(h,l),p=E9e(c,l);return{top:p.end,right:d.end,bottom:p.start,left:d.start}}function wMt(h){let c,l,d,p;return yo(h)?(c=h.top,l=h.right,d=h.bottom,p=h.left):c=l=d=p=h,{top:c,right:l,bottom:d,left:p,disabled:h===!1}}function $9e(h,c){const l=[],d=h._getSortedDatasetMetas(c);let p,m;for(p=0,m=d.length;p<m;++p)l.push(d[p].index);return l}function N9e(h,c,l,d={}){const p=h.keys,m=d.mode==="single";let v,C,L,A;if(c===null)return;let I=!1;for(v=0,C=p.length;v<C;++v){if(L=+p[v],L===l){if(I=!0,d.all)continue;break}A=h.values[L],ja(A)&&(m||c===0||Q2(c)===Q2(A))&&(c+=A)}return!I&&!d.all?0:c}function vMt(h,c){const{iScale:l,vScale:d}=c,p=l.axis==="x"?"x":"y",m=d.axis==="x"?"x":"y",v=Object.keys(h),C=new Array(v.length);let L,A,I;for(L=0,A=v.length;L<A;++L)I=v[L],C[L]={[p]:I,[m]:h[I]};return C}function qte(h,c){const l=h&&h.options.stacked;return l||l===void 0&&c.stack!==void 0}function yMt(h,c,l){return`${h.id}.${c.id}.${l.stack||l.type}`}function xMt(h){const{min:c,max:l,minDefined:d,maxDefined:p}=h.getUserBounds();return{min:d?c:Number.NEGATIVE_INFINITY,max:p?l:Number.POSITIVE_INFINITY}}function kMt(h,c,l){const d=h[c]||(h[c]={});return d[l]||(d[l]={})}function D9e(h,c,l,d){for(const p of c.getMatchingVisibleMetas(d).reverse()){const m=h[p.index];if(l&&m>0||!l&&m<0)return p.index}return null}function T9e(h,c){const{chart:l,_cachedMeta:d}=h,p=l._stacks||(l._stacks={}),{iScale:m,vScale:v,index:C}=d,L=m.axis,A=v.axis,I=yMt(m,v,d),N=c.length;let O;for(let j=0;j<N;++j){const q=c[j],{[L]:ne,[A]:ie}=q,re=q._stacks||(q._stacks={});O=re[A]=kMt(p,I,ne),O[C]=ie,O._top=D9e(O,v,!0,d.type),O._bottom=D9e(O,v,!1,d.type);const te=O._visualValues||(O._visualValues={});te[C]=ie}}function Gte(h,c){const l=h.scales;return Object.keys(l).filter(d=>l[d].axis===c).shift()}function CMt(h,c){return D4(h,{active:!1,dataset:void 0,datasetIndex:c,index:c,mode:"default",type:"dataset"})}function MMt(h,c,l){return D4(h,{active:!1,dataIndex:c,parsed:void 0,raw:void 0,element:l,index:c,mode:"default",type:"data"})}function aE(h,c){const l=h.controller.index,d=h.vScale&&h.vScale.axis;if(d){c=c||h._parsed;for(const p of c){const m=p._stacks;if(!m||m[d]===void 0||m[d][l]===void 0)return;delete m[d][l],m[d]._visualValues!==void 0&&m[d]._visualValues[l]!==void 0&&delete m[d]._visualValues[l]}}}const Kte=h=>h==="reset"||h==="none",O9e=(h,c)=>c?h:Object.assign({},h),LMt=(h,c,l)=>h&&!c.hidden&&c._stacked&&{keys:$9e(l,!0),values:null};class om{constructor(c,l){this.chart=c,this._ctx=c.ctx,this.index=l,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const c=this._cachedMeta;this.configure(),this.linkScales(),c._stacked=qte(c.vScale,c),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(c){this.index!==c&&aE(this._cachedMeta),this.index=c}linkScales(){const c=this.chart,l=this._cachedMeta,d=this.getDataset(),p=(N,O,j,q)=>N==="x"?O:N==="r"?q:j,m=l.xAxisID=vs(d.xAxisID,Gte(c,"x")),v=l.yAxisID=vs(d.yAxisID,Gte(c,"y")),C=l.rAxisID=vs(d.rAxisID,Gte(c,"r")),L=l.indexAxis,A=l.iAxisID=p(L,m,v,C),I=l.vAxisID=p(L,v,m,C);l.xScale=this.getScaleForId(m),l.yScale=this.getScaleForId(v),l.rScale=this.getScaleForId(C),l.iScale=this.getScaleForId(A),l.vScale=this.getScaleForId(I)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(c){return this.chart.scales[c]}_getOtherScale(c){const l=this._cachedMeta;return c===l.iScale?l.vScale:l.iScale}reset(){this._update("reset")}_destroy(){const c=this._cachedMeta;this._data&&Z8e(this._data,this),c._stacked&&aE(c)}_dataCheck(){const c=this.getDataset(),l=c.data||(c.data=[]),d=this._data;if(yo(l)){const p=this._cachedMeta;this._data=vMt(l,p)}else if(d!==l){if(d){Z8e(d,this);const p=this._cachedMeta;aE(p),p._parsed=[]}l&&Object.isExtensible(l)&&uCt(l,this),this._syncList=[],this._data=l}}addElements(){const c=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(c.dataset=new this.datasetElementType)}buildOrUpdateElements(c){const l=this._cachedMeta,d=this.getDataset();let p=!1;this._dataCheck();const m=l._stacked;l._stacked=qte(l.vScale,l),l.stack!==d.stack&&(p=!0,aE(l),l.stack=d.stack),this._resyncElements(c),(p||m!==l._stacked)&&(T9e(this,l._parsed),l._stacked=qte(l.vScale,l))}configure(){const c=this.chart.config,l=c.datasetScopeKeys(this._type),d=c.getOptionScopes(this.getDataset(),l,!0);this.options=c.createResolver(d,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(c,l){const{_cachedMeta:d,_data:p}=this,{iScale:m,_stacked:v}=d,C=m.axis;let L=c===0&&l===p.length?!0:d._sorted,A=c>0&&d._parsed[c-1],I,N,O;if(this._parsing===!1)d._parsed=p,d._sorted=!0,O=p;else{Rl(p[c])?O=this.parseArrayData(d,p,c,l):yo(p[c])?O=this.parseObjectData(d,p,c,l):O=this.parsePrimitiveData(d,p,c,l);const j=()=>N[C]===null||A&&N[C]<A[C];for(I=0;I<l;++I)d._parsed[I+c]=N=O[I],L&&(j()&&(L=!1),A=N);d._sorted=L}v&&T9e(this,O)}parsePrimitiveData(c,l,d,p){const{iScale:m,vScale:v}=c,C=m.axis,L=v.axis,A=m.getLabels(),I=m===v,N=new Array(p);let O,j,q;for(O=0,j=p;O<j;++O)q=O+d,N[O]={[C]:I||m.parse(A[q],q),[L]:v.parse(l[q],q)};return N}parseArrayData(c,l,d,p){const{xScale:m,yScale:v}=c,C=new Array(p);let L,A,I,N;for(L=0,A=p;L<A;++L)I=L+d,N=l[I],C[L]={x:m.parse(N[0],I),y:v.parse(N[1],I)};return C}parseObjectData(c,l,d,p){const{xScale:m,yScale:v}=c,{xAxisKey:C="x",yAxisKey:L="y"}=this._parsing,A=new Array(p);let I,N,O,j;for(I=0,N=p;I<N;++I)O=I+d,j=l[O],A[I]={x:m.parse(E4(j,C),O),y:v.parse(E4(j,L),O)};return A}getParsed(c){return this._cachedMeta._parsed[c]}getDataElement(c){return this._cachedMeta.data[c]}applyStack(c,l,d){const p=this.chart,m=this._cachedMeta,v=l[c.axis],C={keys:$9e(p,!0),values:l._stacks[c.axis]._visualValues};return N9e(C,v,m.index,{mode:d})}updateRangeFromParsed(c,l,d,p){const m=d[l.axis];let v=m===null?NaN:m;const C=p&&d._stacks[l.axis];p&&C&&(p.values=C,v=N9e(p,m,this._cachedMeta.index)),c.min=Math.min(c.min,v),c.max=Math.max(c.max,v)}getMinMax(c,l){const d=this._cachedMeta,p=d._parsed,m=d._sorted&&c===d.iScale,v=p.length,C=this._getOtherScale(c),L=LMt(l,d,this.chart),A={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:I,max:N}=xMt(C);let O,j;function q(){j=p[O];const ne=j[C.axis];return!ja(j[c.axis])||I>ne||N<ne}for(O=0;O<v&&!(!q()&&(this.updateRangeFromParsed(A,c,j,L),m));++O);if(m){for(O=v-1;O>=0;--O)if(!q()){this.updateRangeFromParsed(A,c,j,L);break}}return A}getAllParsedValues(c){const l=this._cachedMeta._parsed,d=[];let p,m,v;for(p=0,m=l.length;p<m;++p)v=l[p][c.axis],ja(v)&&d.push(v);return d}getMaxOverflow(){return!1}getLabelAndValue(c){const l=this._cachedMeta,d=l.iScale,p=l.vScale,m=this.getParsed(c);return{label:d?""+d.getLabelForValue(m[d.axis]):"",value:p?""+p.getLabelForValue(m[p.axis]):""}}_update(c){const l=this._cachedMeta;this.update(c||"default"),l._clip=wMt(vs(this.options.clip,mMt(l.xScale,l.yScale,this.getMaxOverflow())))}update(c){}draw(){const c=this._ctx,l=this.chart,d=this._cachedMeta,p=d.data||[],m=l.chartArea,v=[],C=this._drawStart||0,L=this._drawCount||p.length-C,A=this.options.drawActiveElementsOnTop;let I;for(d.dataset&&d.dataset.draw(c,m,C,L),I=C;I<C+L;++I){const N=p[I];N.hidden||(N.active&&A?v.push(N):N.draw(c,m))}for(I=0;I<v.length;++I)v[I].draw(c,m)}getStyle(c,l){const d=l?"active":"default";return c===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(d):this.resolveDataElementOptions(c||0,d)}getContext(c,l,d){const p=this.getDataset();let m;if(c>=0&&c<this._cachedMeta.data.length){const v=this._cachedMeta.data[c];m=v.$context||(v.$context=MMt(this.getContext(),c,v)),m.parsed=this.getParsed(c),m.raw=p.data[c],m.index=m.dataIndex=c}else m=this.$context||(this.$context=CMt(this.chart.getContext(),this.index)),m.dataset=p,m.index=m.datasetIndex=this.index;return m.active=!!l,m.mode=d,m}resolveDatasetElementOptions(c){return this._resolveElementOptions(this.datasetElementType.id,c)}resolveDataElementOptions(c,l){return this._resolveElementOptions(this.dataElementType.id,l,c)}_resolveElementOptions(c,l="default",d){const p=l==="active",m=this._cachedDataOpts,v=c+"-"+l,C=m[v],L=this.enableOptionSharing&&tE(d);if(C)return O9e(C,L);const A=this.chart.config,I=A.datasetElementScopeKeys(this._type,c),N=p?[`${c}Hover`,"hover",c,""]:[c,""],O=A.getOptionScopes(this.getDataset(),I),j=Object.keys(Bl.elements[c]),q=()=>this.getContext(d,p,l),ne=A.resolveNamedOptions(O,j,q,N);return ne.$shared&&(ne.$shared=L,m[v]=Object.freeze(O9e(ne,L))),ne}_resolveAnimations(c,l,d){const p=this.chart,m=this._cachedDataOpts,v=`animation-${l}`,C=m[v];if(C)return C;let L;if(p.options.animation!==!1){const I=this.chart.config,N=I.datasetAnimationScopeKeys(this._type,l),O=I.getOptionScopes(this.getDataset(),N);L=I.createResolver(O,this.getContext(c,d,l))}const A=new P9e(p,L&&L.animations);return L&&L._cacheable&&(m[v]=Object.freeze(A)),A}getSharedOptions(c){if(c.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},c))}includeOptions(c,l){return!l||Kte(c)||this.chart._animationsDisabled}_getSharedOptions(c,l){const d=this.resolveDataElementOptions(c,l),p=this._sharedOptions,m=this.getSharedOptions(d),v=this.includeOptions(l,m)||m!==p;return this.updateSharedOptions(m,l,d),{sharedOptions:m,includeOptions:v}}updateElement(c,l,d,p){Kte(p)?Object.assign(c,d):this._resolveAnimations(l,p).update(c,d)}updateSharedOptions(c,l,d){c&&!Kte(l)&&this._resolveAnimations(void 0,l).update(c,d)}_setStyle(c,l,d,p){c.active=p;const m=this.getStyle(l,p);this._resolveAnimations(l,d,p).update(c,{options:!p&&this.getSharedOptions(m)||m})}removeHoverStyle(c,l,d){this._setStyle(c,d,"active",!1)}setHoverStyle(c,l,d){this._setStyle(c,d,"active",!0)}_removeDatasetHoverStyle(){const c=this._cachedMeta.dataset;c&&this._setStyle(c,void 0,"active",!1)}_setDatasetHoverStyle(){const c=this._cachedMeta.dataset;c&&this._setStyle(c,void 0,"active",!0)}_resyncElements(c){const l=this._data,d=this._cachedMeta.data;for(const[C,L,A]of this._syncList)this[C](L,A);this._syncList=[];const p=d.length,m=l.length,v=Math.min(m,p);v&&this.parse(0,v),m>p?this._insertElements(p,m-p,c):m<p&&this._removeElements(m,p-m)}_insertElements(c,l,d=!0){const p=this._cachedMeta,m=p.data,v=c+l;let C;const L=A=>{for(A.length+=l,C=A.length-1;C>=v;C--)A[C]=A[C-l]};for(L(m),C=c;C<v;++C)m[C]=new this.dataElementType;this._parsing&&L(p._parsed),this.parse(c,l),d&&this.updateElements(m,c,l,"reset")}updateElements(c,l,d,p){}_removeElements(c,l){const d=this._cachedMeta;if(this._parsing){const p=d._parsed.splice(c,l);d._stacked&&aE(d,p)}d.data.splice(c,l)}_sync(c){if(this._parsing)this._syncList.push(c);else{const[l,d,p]=c;this[l](d,p)}this.chart._dataChanges.push([this.index,...c])}_onDataPush(){const c=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-c,c])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(c,l){l&&this._sync(["_removeElements",c,l]);const d=arguments.length-2;d&&this._sync(["_insertElements",c,d])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}en(om,"defaults",{}),en(om,"datasetElementType",null),en(om,"dataElementType",null);function SMt(h,c){if(!h._cache.$bar){const l=h.getMatchingVisibleMetas(c);let d=[];for(let p=0,m=l.length;p<m;p++)d=d.concat(l[p].controller.getAllParsedValues(h));h._cache.$bar=X8e(d.sort((p,m)=>p-m))}return h._cache.$bar}function IMt(h){const c=h.iScale,l=SMt(c,h.type);let d=c._length,p,m,v,C;const L=()=>{v===32767||v===-32768||(tE(C)&&(d=Math.min(d,Math.abs(v-C)||d)),C=v)};for(p=0,m=l.length;p<m;++p)v=c.getPixelForValue(l[p]),L();for(C=void 0,p=0,m=c.ticks.length;p<m;++p)v=c.getPixelForTick(p),L();return d}function AMt(h,c,l,d){const p=l.barThickness;let m,v;return ao(p)?(m=c.min*l.categoryPercentage,v=l.barPercentage):(m=p*d,v=1),{chunk:m/d,ratio:v,start:c.pixels[h]-m/2}}function PMt(h,c,l,d){const p=c.pixels,m=p[h];let v=h>0?p[h-1]:null,C=h<p.length-1?p[h+1]:null;const L=l.categoryPercentage;v===null&&(v=m-(C===null?c.end-c.start:C-m)),C===null&&(C=m+m-v);const A=m-(m-Math.min(v,C))/2*L;return{chunk:Math.abs(C-v)/2*L/d,ratio:l.barPercentage,start:A}}function EMt(h,c,l,d){const p=l.parse(h[0],d),m=l.parse(h[1],d),v=Math.min(p,m),C=Math.max(p,m);let L=v,A=C;Math.abs(v)>Math.abs(C)&&(L=C,A=v),c[l.axis]=A,c._custom={barStart:L,barEnd:A,start:p,end:m,min:v,max:C}}function j9e(h,c,l,d){return Rl(h)?EMt(h,c,l,d):c[l.axis]=l.parse(h,d),c}function _9e(h,c,l,d){const p=h.iScale,m=h.vScale,v=p.getLabels(),C=p===m,L=[];let A,I,N,O;for(A=l,I=l+d;A<I;++A)O=c[A],N={},N[p.axis]=C||p.parse(v[A],A),L.push(j9e(O,N,m,A));return L}function Wte(h){return h&&h.barStart!==void 0&&h.barEnd!==void 0}function $Mt(h,c,l){return h!==0?Q2(h):(c.isHorizontal()?1:-1)*(c.min>=l?1:-1)}function NMt(h){let c,l,d,p,m;return h.horizontal?(c=h.base>h.x,l="left",d="right"):(c=h.base<h.y,l="bottom",d="top"),c?(p="end",m="start"):(p="start",m="end"),{start:l,end:d,reverse:c,top:p,bottom:m}}function DMt(h,c,l,d){let p=c.borderSkipped;const m={};if(!p){h.borderSkipped=m;return}if(p===!0){h.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:v,end:C,reverse:L,top:A,bottom:I}=NMt(h);p==="middle"&&l&&(h.enableBorderRadius=!0,(l._top||0)===d?p=A:(l._bottom||0)===d?p=I:(m[R9e(I,v,C,L)]=!0,p=A)),m[R9e(p,v,C,L)]=!0,h.borderSkipped=m}function R9e(h,c,l,d){return d?(h=TMt(h,c,l),h=B9e(h,l,c)):h=B9e(h,c,l),h}function TMt(h,c,l){return h===c?l:h===l?c:h}function B9e(h,c,l){return h==="start"?c:h==="end"?l:h}function OMt(h,{inflateAmount:c},l){h.inflateAmount=c==="auto"?l===1?.33:0:c}class _F extends om{parsePrimitiveData(c,l,d,p){return _9e(c,l,d,p)}parseArrayData(c,l,d,p){return _9e(c,l,d,p)}parseObjectData(c,l,d,p){const{iScale:m,vScale:v}=c,{xAxisKey:C="x",yAxisKey:L="y"}=this._parsing,A=m.axis==="x"?C:L,I=v.axis==="x"?C:L,N=[];let O,j,q,ne;for(O=d,j=d+p;O<j;++O)ne=l[O],q={},q[m.axis]=m.parse(E4(ne,A),O),N.push(j9e(E4(ne,I),q,v,O));return N}updateRangeFromParsed(c,l,d,p){super.updateRangeFromParsed(c,l,d,p);const m=d._custom;m&&l===this._cachedMeta.vScale&&(c.min=Math.min(c.min,m.min),c.max=Math.max(c.max,m.max))}getMaxOverflow(){return 0}getLabelAndValue(c){const l=this._cachedMeta,{iScale:d,vScale:p}=l,m=this.getParsed(c),v=m._custom,C=Wte(v)?"["+v.start+", "+v.end+"]":""+p.getLabelForValue(m[p.axis]);return{label:""+d.getLabelForValue(m[d.axis]),value:C}}initialize(){this.enableOptionSharing=!0,super.initialize();const c=this._cachedMeta;c.stack=this.getDataset().stack}update(c){const l=this._cachedMeta;this.updateElements(l.data,0,l.data.length,c)}updateElements(c,l,d,p){const m=p==="reset",{index:v,_cachedMeta:{vScale:C}}=this,L=C.getBasePixel(),A=C.isHorizontal(),I=this._getRuler(),{sharedOptions:N,includeOptions:O}=this._getSharedOptions(l,p);for(let j=l;j<l+d;j++){const q=this.getParsed(j),ne=m||ao(q[C.axis])?{base:L,head:L}:this._calculateBarValuePixels(j),ie=this._calculateBarIndexPixels(j,I),re=(q._stacks||{})[C.axis],te={horizontal:A,base:ne.base,enableBorderRadius:!re||Wte(q._custom)||v===re._top||v===re._bottom,x:A?ne.head:ie.center,y:A?ie.center:ne.head,height:A?ie.size:Math.abs(ne.size),width:A?Math.abs(ne.size):ie.size};O&&(te.options=N||this.resolveDataElementOptions(j,c[j].active?"active":p));const X=te.options||c[j].options;DMt(te,X,re,v),OMt(te,X,I.ratio),this.updateElement(c[j],j,te,p)}}_getStacks(c,l){const{iScale:d}=this._cachedMeta,p=d.getMatchingVisibleMetas(this._type).filter(I=>I.controller.options.grouped),m=d.options.stacked,v=[],C=this._cachedMeta.controller.getParsed(l),L=C&&C[d.axis],A=I=>{const N=I._parsed.find(j=>j[d.axis]===L),O=N&&N[I.vScale.axis];if(ao(O)||isNaN(O))return!0};for(const I of p)if(!(l!==void 0&&A(I))&&((m===!1||v.indexOf(I.stack)===-1||m===void 0&&I.stack===void 0)&&v.push(I.stack),I.index===c))break;return v.length||v.push(void 0),v}_getStackCount(c){return this._getStacks(void 0,c).length}_getStackIndex(c,l,d){const p=this._getStacks(c,d),m=l!==void 0?p.indexOf(l):-1;return m===-1?p.length-1:m}_getRuler(){const c=this.options,l=this._cachedMeta,d=l.iScale,p=[];let m,v;for(m=0,v=l.data.length;m<v;++m)p.push(d.getPixelForValue(this.getParsed(m)[d.axis],m));const C=c.barThickness;return{min:C||IMt(l),pixels:p,start:d._startPixel,end:d._endPixel,stackCount:this._getStackCount(),scale:d,grouped:c.grouped,ratio:C?1:c.categoryPercentage*c.barPercentage}}_calculateBarValuePixels(c){const{_cachedMeta:{vScale:l,_stacked:d,index:p},options:{base:m,minBarLength:v}}=this,C=m||0,L=this.getParsed(c),A=L._custom,I=Wte(A);let N=L[l.axis],O=0,j=d?this.applyStack(l,L,d):N,q,ne;j!==N&&(O=j-N,j=N),I&&(N=A.barStart,j=A.barEnd-A.barStart,N!==0&&Q2(N)!==Q2(A.barEnd)&&(O=0),O+=N);const ie=!ao(m)&&!I?m:O;let re=l.getPixelForValue(ie);if(this.chart.getDataVisibility(c)?q=l.getPixelForValue(O+j):q=re,ne=q-re,Math.abs(ne)<v){ne=$Mt(ne,l,C)*v,N===C&&(re-=ne/2);const te=l.getPixelForDecimal(0),X=l.getPixelForDecimal(1),Z=Math.min(te,X),le=Math.max(te,X);re=Math.max(Math.min(re,le),Z),q=re+ne,d&&!I&&(L._stacks[l.axis]._visualValues[p]=l.getValueForPixel(q)-l.getValueForPixel(re))}if(re===l.getPixelForValue(C)){const te=Q2(ne)*l.getLineWidthForValue(C)/2;re+=te,ne-=te}return{size:ne,base:re,head:q,center:q+ne/2}}_calculateBarIndexPixels(c,l){const d=l.scale,p=this.options,m=p.skipNull,v=vs(p.maxBarThickness,1/0);let C,L;if(l.grouped){const A=m?this._getStackCount(c):l.stackCount,I=p.barThickness==="flex"?PMt(c,l,p,A):AMt(c,l,p,A),N=this._getStackIndex(this.index,this._cachedMeta.stack,m?c:void 0);C=I.start+I.chunk*N+I.chunk/2,L=Math.min(v,I.chunk*I.ratio)}else C=d.getPixelForValue(this.getParsed(c)[d.axis],c),L=Math.min(v,l.min*l.ratio);return{base:C-L/2,head:C+L/2,center:C,size:L}}draw(){const c=this._cachedMeta,l=c.vScale,d=c.data,p=d.length;let m=0;for(;m<p;++m)this.getParsed(m)[l.axis]!==null&&!d[m].hidden&&d[m].draw(this._ctx)}}en(_F,"id","bar"),en(_F,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),en(_F,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class RF extends om{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(c,l,d,p){const m=super.parsePrimitiveData(c,l,d,p);for(let v=0;v<m.length;v++)m[v]._custom=this.resolveDataElementOptions(v+d).radius;return m}parseArrayData(c,l,d,p){const m=super.parseArrayData(c,l,d,p);for(let v=0;v<m.length;v++){const C=l[d+v];m[v]._custom=vs(C[2],this.resolveDataElementOptions(v+d).radius)}return m}parseObjectData(c,l,d,p){const m=super.parseObjectData(c,l,d,p);for(let v=0;v<m.length;v++){const C=l[d+v];m[v]._custom=vs(C&&C.r&&+C.r,this.resolveDataElementOptions(v+d).radius)}return m}getMaxOverflow(){const c=this._cachedMeta.data;let l=0;for(let d=c.length-1;d>=0;--d)l=Math.max(l,c[d].size(this.resolveDataElementOptions(d))/2);return l>0&&l}getLabelAndValue(c){const l=this._cachedMeta,d=this.chart.data.labels||[],{xScale:p,yScale:m}=l,v=this.getParsed(c),C=p.getLabelForValue(v.x),L=m.getLabelForValue(v.y),A=v._custom;return{label:d[c]||"",value:"("+C+", "+L+(A?", "+A:"")+")"}}update(c){const l=this._cachedMeta.data;this.updateElements(l,0,l.length,c)}updateElements(c,l,d,p){const m=p==="reset",{iScale:v,vScale:C}=this._cachedMeta,{sharedOptions:L,includeOptions:A}=this._getSharedOptions(l,p),I=v.axis,N=C.axis;for(let O=l;O<l+d;O++){const j=c[O],q=!m&&this.getParsed(O),ne={},ie=ne[I]=m?v.getPixelForDecimal(.5):v.getPixelForValue(q[I]),re=ne[N]=m?C.getBasePixel():C.getPixelForValue(q[N]);ne.skip=isNaN(ie)||isNaN(re),A&&(ne.options=L||this.resolveDataElementOptions(O,j.active?"active":p),m&&(ne.options.radius=0)),this.updateElement(j,O,ne,p)}}resolveDataElementOptions(c,l){const d=this.getParsed(c);let p=super.resolveDataElementOptions(c,l);p.$shared&&(p=Object.assign({},p,{$shared:!1}));const m=p.radius;return l!=="active"&&(p.radius=0),p.radius+=vs(d&&d._custom,m),p}}en(RF,"id","bubble"),en(RF,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),en(RF,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function jMt(h,c,l){let d=1,p=1,m=0,v=0;if(c<Al){const C=h,L=C+c,A=Math.cos(C),I=Math.sin(C),N=Math.cos(L),O=Math.sin(L),j=(X,Z,le)=>iE(X,C,L,!0)?1:Math.max(Z,Z*l,le,le*l),q=(X,Z,le)=>iE(X,C,L,!0)?-1:Math.min(Z,Z*l,le,le*l),ne=j(0,A,N),ie=j(ou,I,O),re=q(Il,A,N),te=q(Il+ou,I,O);d=(ne-re)/2,p=(ie-te)/2,m=-(ne+re)/2,v=-(ie+te)/2}return{ratioX:d,ratioY:p,offsetX:m,offsetY:v}}class A8 extends om{constructor(c,l){super(c,l),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(c,l){const d=this.getDataset().data,p=this._cachedMeta;if(this._parsing===!1)p._parsed=d;else{let m=L=>+d[L];if(yo(d[c])){const{key:L="value"}=this._parsing;m=A=>+E4(d[A],L)}let v,C;for(v=c,C=c+l;v<C;++v)p._parsed[v]=m(v)}}_getRotation(){return sm(this.options.rotation-90)}_getCircumference(){return sm(this.options.circumference)}_getRotationExtents(){let c=Al,l=-Al;for(let d=0;d<this.chart.data.datasets.length;++d)if(this.chart.isDatasetVisible(d)&&this.chart.getDatasetMeta(d).type===this._type){const p=this.chart.getDatasetMeta(d).controller,m=p._getRotation(),v=p._getCircumference();c=Math.min(c,m),l=Math.max(l,m+v)}return{rotation:c,circumference:l-c}}update(c){const l=this.chart,{chartArea:d}=l,p=this._cachedMeta,m=p.data,v=this.getMaxBorderWidth()+this.getMaxOffset(m)+this.options.spacing,C=Math.max((Math.min(d.width,d.height)-v)/2,0),L=Math.min(Ykt(this.options.cutout,C),1),A=this._getRingWeight(this.index),{circumference:I,rotation:N}=this._getRotationExtents(),{ratioX:O,ratioY:j,offsetX:q,offsetY:ne}=jMt(N,I,L),ie=(d.width-v)/O,re=(d.height-v)/j,te=Math.max(Math.min(ie,re)/2,0),X=F8e(this.options.radius,te),Z=Math.max(X*L,0),le=(X-Z)/this._getVisibleDatasetWeightTotal();this.offsetX=q*X,this.offsetY=ne*X,p.total=this.calculateTotal(),this.outerRadius=X-le*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-le*A,0),this.updateElements(m,0,m.length,c)}_circumference(c,l){const d=this.options,p=this._cachedMeta,m=this._getCircumference();return l&&d.animation.animateRotate||!this.chart.getDataVisibility(c)||p._parsed[c]===null||p.data[c].hidden?0:this.calculateCircumference(p._parsed[c]*m/Al)}updateElements(c,l,d,p){const m=p==="reset",v=this.chart,C=v.chartArea,A=v.options.animation,I=(C.left+C.right)/2,N=(C.top+C.bottom)/2,O=m&&A.animateScale,j=O?0:this.innerRadius,q=O?0:this.outerRadius,{sharedOptions:ne,includeOptions:ie}=this._getSharedOptions(l,p);let re=this._getRotation(),te;for(te=0;te<l;++te)re+=this._circumference(te,m);for(te=l;te<l+d;++te){const X=this._circumference(te,m),Z=c[te],le={x:I+this.offsetX,y:N+this.offsetY,startAngle:re,endAngle:re+X,circumference:X,outerRadius:q,innerRadius:j};ie&&(le.options=ne||this.resolveDataElementOptions(te,Z.active?"active":p)),re+=X,this.updateElement(Z,te,le,p)}}calculateTotal(){const c=this._cachedMeta,l=c.data;let d=0,p;for(p=0;p<l.length;p++){const m=c._parsed[p];m!==null&&!isNaN(m)&&this.chart.getDataVisibility(p)&&!l[p].hidden&&(d+=Math.abs(m))}return d}calculateCircumference(c){const l=this._cachedMeta.total;return l>0&&!isNaN(c)?Al*(Math.abs(c)/l):0}getLabelAndValue(c){const l=this._cachedMeta,d=this.chart,p=d.data.labels||[],m=sE(l._parsed[c],d.options.locale);return{label:p[c]||"",value:m}}getMaxBorderWidth(c){let l=0;const d=this.chart;let p,m,v,C,L;if(!c){for(p=0,m=d.data.datasets.length;p<m;++p)if(d.isDatasetVisible(p)){v=d.getDatasetMeta(p),c=v.data,C=v.controller;break}}if(!c)return 0;for(p=0,m=c.length;p<m;++p)L=C.resolveDataElementOptions(p),L.borderAlign!=="inner"&&(l=Math.max(l,L.borderWidth||0,L.hoverBorderWidth||0));return l}getMaxOffset(c){let l=0;for(let d=0,p=c.length;d<p;++d){const m=this.resolveDataElementOptions(d);l=Math.max(l,m.offset||0,m.hoverOffset||0)}return l}_getRingWeightOffset(c){let l=0;for(let d=0;d<c;++d)this.chart.isDatasetVisible(d)&&(l+=this._getRingWeight(d));return l}_getRingWeight(c){return Math.max(vs(this.chart.data.datasets[c].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}en(A8,"id","doughnut"),en(A8,"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"}),en(A8,"descriptors",{_scriptable:c=>c!=="spacing",_indexable:c=>c!=="spacing"&&!c.startsWith("borderDash")&&!c.startsWith("hoverBorderDash")}),en(A8,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(c){const l=c.data;if(l.labels.length&&l.datasets.length){const{labels:{pointStyle:d,color:p}}=c.legend.options;return l.labels.map((m,v)=>{const L=c.getDatasetMeta(0).controller.getStyle(v);return{text:m,fillStyle:L.backgroundColor,strokeStyle:L.borderColor,fontColor:p,lineWidth:L.borderWidth,pointStyle:d,hidden:!c.getDataVisibility(v),index:v}})}return[]}},onClick(c,l,d){d.chart.toggleDataVisibility(l.index),d.chart.update()}}}});class BF extends om{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(c){const l=this._cachedMeta,{dataset:d,data:p=[],_dataset:m}=l,v=this.chart._animationsDisabled;let{start:C,count:L}=e9e(l,p,v);this._drawStart=C,this._drawCount=L,t9e(l)&&(C=0,L=p.length),d._chart=this.chart,d._datasetIndex=this.index,d._decimated=!!m._decimated,d.points=p;const A=this.resolveDatasetElementOptions(c);this.options.showLine||(A.borderWidth=0),A.segment=this.options.segment,this.updateElement(d,void 0,{animated:!v,options:A},c),this.updateElements(p,C,L,c)}updateElements(c,l,d,p){const m=p==="reset",{iScale:v,vScale:C,_stacked:L,_dataset:A}=this._cachedMeta,{sharedOptions:I,includeOptions:N}=this._getSharedOptions(l,p),O=v.axis,j=C.axis,{spanGaps:q,segment:ne}=this.options,ie=gM(q)?q:Number.POSITIVE_INFINITY,re=this.chart._animationsDisabled||m||p==="none",te=l+d,X=c.length;let Z=l>0&&this.getParsed(l-1);for(let le=0;le<X;++le){const Le=c[le],he=re?Le:{};if(le<l||le>=te){he.skip=!0;continue}const Ce=this.getParsed(le),G=ao(Ce[j]),kt=he[O]=v.getPixelForValue(Ce[O],le),Fe=he[j]=m||G?C.getBasePixel():C.getPixelForValue(L?this.applyStack(C,Ce,L):Ce[j],le);he.skip=isNaN(kt)||isNaN(Fe)||G,he.stop=le>0&&Math.abs(Ce[O]-Z[O])>ie,ne&&(he.parsed=Ce,he.raw=A.data[le]),N&&(he.options=I||this.resolveDataElementOptions(le,Le.active?"active":p)),re||this.updateElement(Le,le,he,p),Z=Ce}}getMaxOverflow(){const c=this._cachedMeta,l=c.dataset,d=l.options&&l.options.borderWidth||0,p=c.data||[];if(!p.length)return d;const m=p[0].size(this.resolveDataElementOptions(0)),v=p[p.length-1].size(this.resolveDataElementOptions(p.length-1));return Math.max(d,m,v)/2}draw(){const c=this._cachedMeta;c.dataset.updateControlPoints(this.chart.chartArea,c.iScale.axis),super.draw()}}en(BF,"id","line"),en(BF,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),en(BF,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class uE extends om{constructor(c,l){super(c,l),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(c){const l=this._cachedMeta,d=this.chart,p=d.data.labels||[],m=sE(l._parsed[c].r,d.options.locale);return{label:p[c]||"",value:m}}parseObjectData(c,l,d,p){return b9e.bind(this)(c,l,d,p)}update(c){const l=this._cachedMeta.data;this._updateRadius(),this.updateElements(l,0,l.length,c)}getMinMax(){const c=this._cachedMeta,l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return c.data.forEach((d,p)=>{const m=this.getParsed(p).r;!isNaN(m)&&this.chart.getDataVisibility(p)&&(m<l.min&&(l.min=m),m>l.max&&(l.max=m))}),l}_updateRadius(){const c=this.chart,l=c.chartArea,d=c.options,p=Math.min(l.right-l.left,l.bottom-l.top),m=Math.max(p/2,0),v=Math.max(d.cutoutPercentage?m/100*d.cutoutPercentage:1,0),C=(m-v)/c.getVisibleDatasetCount();this.outerRadius=m-C*this.index,this.innerRadius=this.outerRadius-C}updateElements(c,l,d,p){const m=p==="reset",v=this.chart,L=v.options.animation,A=this._cachedMeta.rScale,I=A.xCenter,N=A.yCenter,O=A.getIndexAngle(0)-.5*Il;let j=O,q;const ne=360/this.countVisibleElements();for(q=0;q<l;++q)j+=this._computeAngle(q,p,ne);for(q=l;q<l+d;q++){const ie=c[q];let re=j,te=j+this._computeAngle(q,p,ne),X=v.getDataVisibility(q)?A.getDistanceFromCenterForValue(this.getParsed(q).r):0;j=te,m&&(L.animateScale&&(X=0),L.animateRotate&&(re=te=O));const Z={x:I,y:N,innerRadius:0,outerRadius:X,startAngle:re,endAngle:te,options:this.resolveDataElementOptions(q,ie.active?"active":p)};this.updateElement(ie,q,Z,p)}}countVisibleElements(){const c=this._cachedMeta;let l=0;return c.data.forEach((d,p)=>{!isNaN(this.getParsed(p).r)&&this.chart.getDataVisibility(p)&&l++}),l}_computeAngle(c,l,d){return this.chart.getDataVisibility(c)?sm(this.resolveDataElementOptions(c,l).angle||d):0}}en(uE,"id","polarArea"),en(uE,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),en(uE,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(c){const l=c.data;if(l.labels.length&&l.datasets.length){const{labels:{pointStyle:d,color:p}}=c.legend.options;return l.labels.map((m,v)=>{const L=c.getDatasetMeta(0).controller.getStyle(v);return{text:m,fillStyle:L.backgroundColor,strokeStyle:L.borderColor,fontColor:p,lineWidth:L.borderWidth,pointStyle:d,hidden:!c.getDataVisibility(v),index:v}})}return[]}},onClick(c,l,d){d.chart.toggleDataVisibility(l.index),d.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class Vte extends A8{}en(Vte,"id","pie"),en(Vte,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class FF extends om{getLabelAndValue(c){const l=this._cachedMeta.vScale,d=this.getParsed(c);return{label:l.getLabels()[c],value:""+l.getLabelForValue(d[l.axis])}}parseObjectData(c,l,d,p){return b9e.bind(this)(c,l,d,p)}update(c){const l=this._cachedMeta,d=l.dataset,p=l.data||[],m=l.iScale.getLabels();if(d.points=p,c!=="resize"){const v=this.resolveDatasetElementOptions(c);this.options.showLine||(v.borderWidth=0);const C={_loop:!0,_fullLoop:m.length===p.length,options:v};this.updateElement(d,void 0,C,c)}this.updateElements(p,0,p.length,c)}updateElements(c,l,d,p){const m=this._cachedMeta.rScale,v=p==="reset";for(let C=l;C<l+d;C++){const L=c[C],A=this.resolveDataElementOptions(C,L.active?"active":p),I=m.getPointPositionForValue(C,this.getParsed(C).r),N=v?m.xCenter:I.x,O=v?m.yCenter:I.y,j={x:N,y:O,angle:I.angle,skip:isNaN(N)||isNaN(O),options:A};this.updateElement(L,C,j,p)}}}en(FF,"id","radar"),en(FF,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),en(FF,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class zF extends om{getLabelAndValue(c){const l=this._cachedMeta,d=this.chart.data.labels||[],{xScale:p,yScale:m}=l,v=this.getParsed(c),C=p.getLabelForValue(v.x),L=m.getLabelForValue(v.y);return{label:d[c]||"",value:"("+C+", "+L+")"}}update(c){const l=this._cachedMeta,{data:d=[]}=l,p=this.chart._animationsDisabled;let{start:m,count:v}=e9e(l,d,p);if(this._drawStart=m,this._drawCount=v,t9e(l)&&(m=0,v=d.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:C,_dataset:L}=l;C._chart=this.chart,C._datasetIndex=this.index,C._decimated=!!L._decimated,C.points=d;const A=this.resolveDatasetElementOptions(c);A.segment=this.options.segment,this.updateElement(C,void 0,{animated:!p,options:A},c)}else this.datasetElementType&&(delete l.dataset,this.datasetElementType=!1);this.updateElements(d,m,v,c)}addElements(){const{showLine:c}=this.options;!this.datasetElementType&&c&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(c,l,d,p){const m=p==="reset",{iScale:v,vScale:C,_stacked:L,_dataset:A}=this._cachedMeta,I=this.resolveDataElementOptions(l,p),N=this.getSharedOptions(I),O=this.includeOptions(p,N),j=v.axis,q=C.axis,{spanGaps:ne,segment:ie}=this.options,re=gM(ne)?ne:Number.POSITIVE_INFINITY,te=this.chart._animationsDisabled||m||p==="none";let X=l>0&&this.getParsed(l-1);for(let Z=l;Z<l+d;++Z){const le=c[Z],Le=this.getParsed(Z),he=te?le:{},Ce=ao(Le[q]),G=he[j]=v.getPixelForValue(Le[j],Z),kt=he[q]=m||Ce?C.getBasePixel():C.getPixelForValue(L?this.applyStack(C,Le,L):Le[q],Z);he.skip=isNaN(G)||isNaN(kt)||Ce,he.stop=Z>0&&Math.abs(Le[j]-X[j])>re,ie&&(he.parsed=Le,he.raw=A.data[Z]),O&&(he.options=N||this.resolveDataElementOptions(Z,le.active?"active":p)),te||this.updateElement(le,Z,he,p),X=Le}this.updateSharedOptions(N,p,I)}getMaxOverflow(){const c=this._cachedMeta,l=c.data||[];if(!this.options.showLine){let C=0;for(let L=l.length-1;L>=0;--L)C=Math.max(C,l[L].size(this.resolveDataElementOptions(L))/2);return C>0&&C}const d=c.dataset,p=d.options&&d.options.borderWidth||0;if(!l.length)return p;const m=l[0].size(this.resolveDataElementOptions(0)),v=l[l.length-1].size(this.resolveDataElementOptions(l.length-1));return Math.max(p,m,v)/2}}en(zF,"id","scatter"),en(zF,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),en(zF,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var _Mt=Object.freeze({__proto__:null,BarController:_F,BubbleController:RF,DoughnutController:A8,LineController:BF,PieController:Vte,PolarAreaController:uE,RadarController:FF,ScatterController:zF});function P8(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Yte{constructor(c){en(this,"options");this.options=c||{}}static override(c){Object.assign(Yte.prototype,c)}init(){}formats(){return P8()}parse(){return P8()}format(){return P8()}add(){return P8()}diff(){return P8()}startOf(){return P8()}endOf(){return P8()}}var RMt={_date:Yte};function BMt(h,c,l,d){const{controller:p,data:m,_sorted:v}=h,C=p._cachedMeta.iScale,L=h.dataset&&h.dataset.options?h.dataset.options.spanGaps:null;if(C&&c===C.axis&&c!=="r"&&v&&m.length){const A=C._reversePixels?lCt:hv;if(d){if(p._sharedOptions){const I=m[0],N=typeof I.getRange=="function"&&I.getRange(c);if(N){const O=A(m,c,l-N),j=A(m,c,l+N);return{lo:O.lo,hi:j.hi}}}}else{const I=A(m,c,l);if(L){const{vScale:N}=p._cachedMeta,{_parsed:O}=h,j=O.slice(0,I.lo+1).reverse().findIndex(ne=>!ao(ne[N.axis]));I.lo-=Math.max(0,j);const q=O.slice(I.hi).findIndex(ne=>!ao(ne[N.axis]));I.hi+=Math.max(0,q)}return I}}return{lo:0,hi:m.length-1}}function hE(h,c,l,d,p){const m=h.getSortedVisibleDatasetMetas(),v=l[c];for(let C=0,L=m.length;C<L;++C){const{index:A,data:I}=m[C],{lo:N,hi:O}=BMt(m[C],c,v,p);for(let j=N;j<=O;++j){const q=I[j];q.skip||d(q,A,j)}}}function FMt(h){const c=h.indexOf("x")!==-1,l=h.indexOf("y")!==-1;return function(d,p){const m=c?Math.abs(d.x-p.x):0,v=l?Math.abs(d.y-p.y):0;return Math.sqrt(Math.pow(m,2)+Math.pow(v,2))}}function Zte(h,c,l,d,p){const m=[];return!p&&!h.isPointInArea(c)||hE(h,l,c,function(C,L,A){!p&&!fv(C,h.chartArea,0)||C.inRange(c.x,c.y,d)&&m.push({element:C,datasetIndex:L,index:A})},!0),m}function zMt(h,c,l,d){let p=[];function m(v,C,L){const{startAngle:A,endAngle:I}=v.getProps(["startAngle","endAngle"],d),{angle:N}=V8e(v,{x:c.x,y:c.y});iE(N,A,I)&&p.push({element:v,datasetIndex:C,index:L})}return hE(h,l,c,m),p}function HMt(h,c,l,d,p,m){let v=[];const C=FMt(l);let L=Number.POSITIVE_INFINITY;function A(I,N,O){const j=I.inRange(c.x,c.y,p);if(d&&!j)return;const q=I.getCenterPoint(p);if(!(!!m||h.isPointInArea(q))&&!j)return;const ie=C(c,q);ie<L?(v=[{element:I,datasetIndex:N,index:O}],L=ie):ie===L&&v.push({element:I,datasetIndex:N,index:O})}return hE(h,l,c,A),v}function Xte(h,c,l,d,p,m){return!m&&!h.isPointInArea(c)?[]:l==="r"&&!d?zMt(h,c,l,p):HMt(h,c,l,d,p,m)}function F9e(h,c,l,d,p){const m=[],v=l==="x"?"inXRange":"inYRange";let C=!1;return hE(h,l,c,(L,A,I)=>{L[v]&&L[v](c[l],p)&&(m.push({element:L,datasetIndex:A,index:I}),C=C||L.inRange(c.x,c.y,p))}),d&&!C?[]:m}var UMt={evaluateInteractionItems:hE,modes:{index(h,c,l,d){const p=S8(c,h),m=l.axis||"x",v=l.includeInvisible||!1,C=l.intersect?Zte(h,p,m,d,v):Xte(h,p,m,!1,d,v),L=[];return C.length?(h.getSortedVisibleDatasetMetas().forEach(A=>{const I=C[0].index,N=A.data[I];N&&!N.skip&&L.push({element:N,datasetIndex:A.index,index:I})}),L):[]},dataset(h,c,l,d){const p=S8(c,h),m=l.axis||"xy",v=l.includeInvisible||!1;let C=l.intersect?Zte(h,p,m,d,v):Xte(h,p,m,!1,d,v);if(C.length>0){const L=C[0].datasetIndex,A=h.getDatasetMeta(L).data;C=[];for(let I=0;I<A.length;++I)C.push({element:A[I],datasetIndex:L,index:I})}return C},point(h,c,l,d){const p=S8(c,h),m=l.axis||"xy",v=l.includeInvisible||!1;return Zte(h,p,m,d,v)},nearest(h,c,l,d){const p=S8(c,h),m=l.axis||"xy",v=l.includeInvisible||!1;return Xte(h,p,m,l.intersect,d,v)},x(h,c,l,d){const p=S8(c,h);return F9e(h,p,"x",l.intersect,d)},y(h,c,l,d){const p=S8(c,h);return F9e(h,p,"y",l.intersect,d)}}};const z9e=["left","top","right","bottom"];function fE(h,c){return h.filter(l=>l.pos===c)}function H9e(h,c){return h.filter(l=>z9e.indexOf(l.pos)===-1&&l.box.axis===c)}function dE(h,c){return h.sort((l,d)=>{const p=c?d:l,m=c?l:d;return p.weight===m.weight?p.index-m.index:p.weight-m.weight})}function qMt(h){const c=[];let l,d,p,m,v,C;for(l=0,d=(h||[]).length;l<d;++l)p=h[l],{position:m,options:{stack:v,stackWeight:C=1}}=p,c.push({index:l,box:p,pos:m,horizontal:p.isHorizontal(),weight:p.weight,stack:v&&m+v,stackWeight:C});return c}function GMt(h){const c={};for(const l of h){const{stack:d,pos:p,stackWeight:m}=l;if(!d||!z9e.includes(p))continue;const v=c[d]||(c[d]={count:0,placed:0,weight:0,size:0});v.count++,v.weight+=m}return c}function KMt(h,c){const l=GMt(h),{vBoxMaxWidth:d,hBoxMaxHeight:p}=c;let m,v,C;for(m=0,v=h.length;m<v;++m){C=h[m];const{fullSize:L}=C.box,A=l[C.stack],I=A&&C.stackWeight/A.weight;C.horizontal?(C.width=I?I*d:L&&c.availableWidth,C.height=p):(C.width=d,C.height=I?I*p:L&&c.availableHeight)}return l}function WMt(h){const c=qMt(h),l=dE(c.filter(A=>A.box.fullSize),!0),d=dE(fE(c,"left"),!0),p=dE(fE(c,"right")),m=dE(fE(c,"top"),!0),v=dE(fE(c,"bottom")),C=H9e(c,"x"),L=H9e(c,"y");return{fullSize:l,leftAndTop:d.concat(m),rightAndBottom:p.concat(L).concat(v).concat(C),chartArea:fE(c,"chartArea"),vertical:d.concat(p).concat(L),horizontal:m.concat(v).concat(C)}}function U9e(h,c,l,d){return Math.max(h[l],c[l])+Math.max(h[d],c[d])}function q9e(h,c){h.top=Math.max(h.top,c.top),h.left=Math.max(h.left,c.left),h.bottom=Math.max(h.bottom,c.bottom),h.right=Math.max(h.right,c.right)}function VMt(h,c,l,d){const{pos:p,box:m}=l,v=h.maxPadding;if(!yo(p)){l.size&&(h[p]-=l.size);const N=d[l.stack]||{size:0,count:1};N.size=Math.max(N.size,l.horizontal?m.height:m.width),l.size=N.size/N.count,h[p]+=l.size}m.getPadding&&q9e(v,m.getPadding());const C=Math.max(0,c.outerWidth-U9e(v,h,"left","right")),L=Math.max(0,c.outerHeight-U9e(v,h,"top","bottom")),A=C!==h.w,I=L!==h.h;return h.w=C,h.h=L,l.horizontal?{same:A,other:I}:{same:I,other:A}}function YMt(h){const c=h.maxPadding;function l(d){const p=Math.max(c[d]-h[d],0);return h[d]+=p,p}h.y+=l("top"),h.x+=l("left"),l("right"),l("bottom")}function ZMt(h,c){const l=c.maxPadding;function d(p){const m={left:0,top:0,right:0,bottom:0};return p.forEach(v=>{m[v]=Math.max(c[v],l[v])}),m}return d(h?["left","right"]:["top","bottom"])}function pE(h,c,l,d){const p=[];let m,v,C,L,A,I;for(m=0,v=h.length,A=0;m<v;++m){C=h[m],L=C.box,L.update(C.width||c.w,C.height||c.h,ZMt(C.horizontal,c));const{same:N,other:O}=VMt(c,l,C,d);A|=N&&p.length,I=I||O,L.fullSize||p.push(C)}return A&&pE(p,c,l,d)||I}function HF(h,c,l,d,p){h.top=l,h.left=c,h.right=c+d,h.bottom=l+p,h.width=d,h.height=p}function G9e(h,c,l,d){const p=l.padding;let{x:m,y:v}=c;for(const C of h){const L=C.box,A=d[C.stack]||{count:1,placed:0,weight:1},I=C.stackWeight/A.weight||1;if(C.horizontal){const N=c.w*I,O=A.size||L.height;tE(A.start)&&(v=A.start),L.fullSize?HF(L,p.left,v,l.outerWidth-p.right-p.left,O):HF(L,c.left+A.placed,v,N,O),A.start=v,A.placed+=N,v=L.bottom}else{const N=c.h*I,O=A.size||L.width;tE(A.start)&&(m=A.start),L.fullSize?HF(L,m,p.top,O,l.outerHeight-p.bottom-p.top):HF(L,m,c.top+A.placed,O,N),A.start=m,A.placed+=N,m=L.right}}c.x=m,c.y=v}var Qf={addBox(h,c){h.boxes||(h.boxes=[]),c.fullSize=c.fullSize||!1,c.position=c.position||"top",c.weight=c.weight||0,c._layers=c._layers||function(){return[{z:0,draw(l){c.draw(l)}}]},h.boxes.push(c)},removeBox(h,c){const l=h.boxes?h.boxes.indexOf(c):-1;l!==-1&&h.boxes.splice(l,1)},configure(h,c,l){c.fullSize=l.fullSize,c.position=l.position,c.weight=l.weight},update(h,c,l,d){if(!h)return;const p=Xf(h.options.layout.padding),m=Math.max(c-p.width,0),v=Math.max(l-p.height,0),C=WMt(h.boxes),L=C.vertical,A=C.horizontal;Mc(h.boxes,ne=>{typeof ne.beforeLayout=="function"&&ne.beforeLayout()});const I=L.reduce((ne,ie)=>ie.box.options&&ie.box.options.display===!1?ne:ne+1,0)||1,N=Object.freeze({outerWidth:c,outerHeight:l,padding:p,availableWidth:m,availableHeight:v,vBoxMaxWidth:m/2/I,hBoxMaxHeight:v/2}),O=Object.assign({},p);q9e(O,Xf(d));const j=Object.assign({maxPadding:O,w:m,h:v,x:p.left,y:p.top},p),q=KMt(L.concat(A),N);pE(C.fullSize,j,N,q),pE(L,j,N,q),pE(A,j,N,q)&&pE(L,j,N,q),YMt(j),G9e(C.leftAndTop,j,N,q),j.x+=j.w,j.y+=j.h,G9e(C.rightAndBottom,j,N,q),h.chartArea={left:j.left,top:j.top,right:j.left+j.w,bottom:j.top+j.h,height:j.h,width:j.w},Mc(C.chartArea,ne=>{const ie=ne.box;Object.assign(ie,h.chartArea),ie.update(j.w,j.h,{left:0,top:0,right:0,bottom:0})})}};class K9e{acquireContext(c,l){}releaseContext(c){return!1}addEventListener(c,l,d){}removeEventListener(c,l,d){}getDevicePixelRatio(){return 1}getMaximumSize(c,l,d,p){return l=Math.max(0,l||c.width),d=d||c.height,{width:l,height:Math.max(0,p?Math.floor(l/p):d)}}isAttached(c){return!0}updateConfig(c){}}class XMt extends K9e{acquireContext(c){return c&&c.getContext&&c.getContext("2d")||null}updateConfig(c){c.options.animation=!1}}const UF="$chartjs",QMt={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},W9e=h=>h===null||h==="";function JMt(h,c){const l=h.style,d=h.getAttribute("height"),p=h.getAttribute("width");if(h[UF]={initial:{height:d,width:p,style:{display:l.display,height:l.height,width:l.width}}},l.display=l.display||"block",l.boxSizing=l.boxSizing||"border-box",W9e(p)){const m=v9e(h,"width");m!==void 0&&(h.width=m)}if(W9e(d))if(h.style.height==="")h.height=h.width/(c||2);else{const m=v9e(h,"height");m!==void 0&&(h.height=m)}return h}const V9e=tMt?{passive:!0}:!1;function eLt(h,c,l){h&&h.addEventListener(c,l,V9e)}function tLt(h,c,l){h&&h.canvas&&h.canvas.removeEventListener(c,l,V9e)}function nLt(h,c){const l=QMt[h.type]||h.type,{x:d,y:p}=S8(h,c);return{type:l,chart:c,native:h,x:d!==void 0?d:null,y:p!==void 0?p:null}}function qF(h,c){for(const l of h)if(l===c||l.contains(c))return!0}function iLt(h,c,l){const d=h.canvas,p=new MutationObserver(m=>{let v=!1;for(const C of m)v=v||qF(C.addedNodes,d),v=v&&!qF(C.removedNodes,d);v&&l()});return p.observe(document,{childList:!0,subtree:!0}),p}function rLt(h,c,l){const d=h.canvas,p=new MutationObserver(m=>{let v=!1;for(const C of m)v=v||qF(C.removedNodes,d),v=v&&!qF(C.addedNodes,d);v&&l()});return p.observe(document,{childList:!0,subtree:!0}),p}const gE=new Map;let Y9e=0;function Z9e(){const h=window.devicePixelRatio;h!==Y9e&&(Y9e=h,gE.forEach((c,l)=>{l.currentDevicePixelRatio!==h&&c()}))}function sLt(h,c){gE.size||window.addEventListener("resize",Z9e),gE.set(h,c)}function oLt(h){gE.delete(h),gE.size||window.removeEventListener("resize",Z9e)}function cLt(h,c,l){const d=h.canvas,p=d&&Ute(d);if(!p)return;const m=J8e((C,L)=>{const A=p.clientWidth;l(C,L),A<p.clientWidth&&l()},window),v=new ResizeObserver(C=>{const L=C[0],A=L.contentRect.width,I=L.contentRect.height;A===0&&I===0||m(A,I)});return v.observe(p),sLt(h,m),v}function Qte(h,c,l){l&&l.disconnect(),c==="resize"&&oLt(h)}function lLt(h,c,l){const d=h.canvas,p=J8e(m=>{h.ctx!==null&&l(nLt(m,h))},h);return eLt(d,c,p),p}class aLt extends K9e{acquireContext(c,l){const d=c&&c.getContext&&c.getContext("2d");return d&&d.canvas===c?(JMt(c,l),d):null}releaseContext(c){const l=c.canvas;if(!l[UF])return!1;const d=l[UF].initial;["height","width"].forEach(m=>{const v=d[m];ao(v)?l.removeAttribute(m):l.setAttribute(m,v)});const p=d.style||{};return Object.keys(p).forEach(m=>{l.style[m]=p[m]}),l.width=l.width,delete l[UF],!0}addEventListener(c,l,d){this.removeEventListener(c,l);const p=c.$proxies||(c.$proxies={}),v={attach:iLt,detach:rLt,resize:cLt}[l]||lLt;p[l]=v(c,l,d)}removeEventListener(c,l){const d=c.$proxies||(c.$proxies={}),p=d[l];if(!p)return;({attach:Qte,detach:Qte,resize:Qte}[l]||tLt)(c,l,p),d[l]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(c,l,d,p){return eMt(c,l,d,p)}isAttached(c){const l=c&&Ute(c);return!!(l&&l.isConnected)}}function uLt(h){return!Hte()||typeof OffscreenCanvas<"u"&&h instanceof OffscreenCanvas?XMt:aLt}class cm{constructor(){en(this,"x");en(this,"y");en(this,"active",!1);en(this,"options");en(this,"$animations")}tooltipPosition(c){const{x:l,y:d}=this.getProps(["x","y"],c);return{x:l,y:d}}hasValue(){return gM(this.x)&&gM(this.y)}getProps(c,l){const d=this.$animations;if(!l||!d)return this;const p={};return c.forEach(m=>{p[m]=d[m]&&d[m].active()?d[m]._to:this[m]}),p}}en(cm,"defaults",{}),en(cm,"defaultRoutes");function hLt(h,c){const l=h.options.ticks,d=fLt(h),p=Math.min(l.maxTicksLimit||d,d),m=l.major.enabled?pLt(c):[],v=m.length,C=m[0],L=m[v-1],A=[];if(v>p)return gLt(c,A,m,v/p),A;const I=dLt(m,c,p);if(v>0){let N,O;const j=v>1?Math.round((L-C)/(v-1)):null;for(GF(c,A,I,ao(j)?0:C-j,C),N=0,O=v-1;N<O;N++)GF(c,A,I,m[N],m[N+1]);return GF(c,A,I,L,ao(j)?c.length:L+j),A}return GF(c,A,I),A}function fLt(h){const c=h.options.offset,l=h._tickSize(),d=h._length/l+(c?0:1),p=h._maxLength/l;return Math.floor(Math.min(d,p))}function dLt(h,c,l){const d=bLt(h),p=c.length/l;if(!d)return Math.max(p,1);const m=iCt(d);for(let v=0,C=m.length-1;v<C;v++){const L=m[v];if(L>p)return L}return Math.max(p,1)}function pLt(h){const c=[];let l,d;for(l=0,d=h.length;l<d;l++)h[l].major&&c.push(l);return c}function gLt(h,c,l,d){let p=0,m=l[0],v;for(d=Math.ceil(d),v=0;v<h.length;v++)v===m&&(c.push(h[v]),p++,m=l[p*d])}function GF(h,c,l,d,p){const m=vs(d,0),v=Math.min(vs(p,h.length),h.length);let C=0,L,A,I;for(l=Math.ceil(l),p&&(L=p-d,l=L/Math.floor(L/l)),I=m;I<0;)C++,I=Math.round(m+C*l);for(A=Math.max(m,0);A<v;A++)A===I&&(c.push(h[A]),C++,I=Math.round(m+C*l))}function bLt(h){const c=h.length;let l,d;if(c<2)return!1;for(d=h[0],l=1;l<c;++l)if(h[l]-h[l-1]!==d)return!1;return d}const mLt=h=>h==="left"?"right":h==="right"?"left":h,X9e=(h,c,l)=>c==="top"||c==="left"?h[c]+l:h[c]-l,Q9e=(h,c)=>Math.min(c||h,h);function J9e(h,c){const l=[],d=h.length/c,p=h.length;let m=0;for(;m<p;m+=d)l.push(h[Math.floor(m)]);return l}function wLt(h,c,l){const d=h.ticks.length,p=Math.min(c,d-1),m=h._startPixel,v=h._endPixel,C=1e-6;let L=h.getPixelForTick(p),A;if(!(l&&(d===1?A=Math.max(L-m,v-L):c===0?A=(h.getPixelForTick(1)-L)/2:A=(L-h.getPixelForTick(p-1))/2,L+=p<c?A:-A,L<m-C||L>v+C)))return L}function vLt(h,c){Mc(h,l=>{const d=l.gc,p=d.length/2;let m;if(p>c){for(m=0;m<p;++m)delete l.data[d[m]];d.splice(0,p)}})}function bE(h){return h.drawTicks?h.tickLength:0}function e7e(h,c){if(!h.display)return 0;const l=sh(h.font,c),d=Xf(h.padding);return(Rl(h.text)?h.text.length:1)*l.lineHeight+d.height}function yLt(h,c){return D4(h,{scale:c,type:"scale"})}function xLt(h,c,l){return D4(h,{tick:l,index:c,type:"tick"})}function kLt(h,c,l){let d=Nte(h);return(l&&c!=="right"||!l&&c==="right")&&(d=mLt(d)),d}function CLt(h,c,l,d){const{top:p,left:m,bottom:v,right:C,chart:L}=h,{chartArea:A,scales:I}=L;let N=0,O,j,q;const ne=v-p,ie=C-m;if(h.isHorizontal()){if(j=Zf(d,m,C),yo(l)){const re=Object.keys(l)[0],te=l[re];q=I[re].getPixelForValue(te)+ne-c}else l==="center"?q=(A.bottom+A.top)/2+ne-c:q=X9e(h,l,c);O=C-m}else{if(yo(l)){const re=Object.keys(l)[0],te=l[re];j=I[re].getPixelForValue(te)-ie+c}else l==="center"?j=(A.left+A.right)/2-ie+c:j=X9e(h,l,c);q=Zf(d,v,p),N=l==="left"?-ou:ou}return{titleX:j,titleY:q,maxWidth:O,rotation:N}}class E8 extends cm{constructor(c){super(),this.id=c.id,this.type=c.type,this.options=void 0,this.ctx=c.ctx,this.chart=c.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(c){this.options=c.setContext(this.getContext()),this.axis=c.axis,this._userMin=this.parse(c.min),this._userMax=this.parse(c.max),this._suggestedMin=this.parse(c.suggestedMin),this._suggestedMax=this.parse(c.suggestedMax)}parse(c,l){return c}getUserBounds(){let{_userMin:c,_userMax:l,_suggestedMin:d,_suggestedMax:p}=this;return c=Vp(c,Number.POSITIVE_INFINITY),l=Vp(l,Number.NEGATIVE_INFINITY),d=Vp(d,Number.POSITIVE_INFINITY),p=Vp(p,Number.NEGATIVE_INFINITY),{min:Vp(c,d),max:Vp(l,p),minDefined:ja(c),maxDefined:ja(l)}}getMinMax(c){let{min:l,max:d,minDefined:p,maxDefined:m}=this.getUserBounds(),v;if(p&&m)return{min:l,max:d};const C=this.getMatchingVisibleMetas();for(let L=0,A=C.length;L<A;++L)v=C[L].controller.getMinMax(this,c),p||(l=Math.min(l,v.min)),m||(d=Math.max(d,v.max));return l=m&&l>d?d:l,d=p&&l>d?l:d,{min:Vp(l,Vp(d,l)),max:Vp(d,Vp(l,d))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const c=this.chart.data;return this.options.labels||(this.isHorizontal()?c.xLabels:c.yLabels)||c.labels||[]}getLabelItems(c=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(c))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){dl(this.options.beforeUpdate,[this])}update(c,l,d){const{beginAtZero:p,grace:m,ticks:v}=this.options,C=v.sampleSize;this.beforeUpdate(),this.maxWidth=c,this.maxHeight=l,this._margins=d=Object.assign({left:0,right:0,top:0,bottom:0},d),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+d.left+d.right:this.height+d.top+d.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=NCt(this,m,p),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const L=C<this.ticks.length;this._convertTicksToLabels(L?J9e(this.ticks,C):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),v.display&&(v.autoSkip||v.source==="auto")&&(this.ticks=hLt(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),L&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let c=this.options.reverse,l,d;this.isHorizontal()?(l=this.left,d=this.right):(l=this.top,d=this.bottom,c=!c),this._startPixel=l,this._endPixel=d,this._reversePixels=c,this._length=d-l,this._alignToPixels=this.options.alignToPixels}afterUpdate(){dl(this.options.afterUpdate,[this])}beforeSetDimensions(){dl(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(){dl(this.options.afterSetDimensions,[this])}_callHooks(c){this.chart.notifyPlugins(c,this.getContext()),dl(this.options[c],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){dl(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(c){const l=this.options.ticks;let d,p,m;for(d=0,p=c.length;d<p;d++)m=c[d],m.label=dl(l.callback,[m.value,d,c],this)}afterTickToLabelConversion(){dl(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){dl(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const c=this.options,l=c.ticks,d=Q9e(this.ticks.length,c.ticks.maxTicksLimit),p=l.minRotation||0,m=l.maxRotation;let v=p,C,L,A;if(!this._isVisible()||!l.display||p>=m||d<=1||!this.isHorizontal()){this.labelRotation=p;return}const I=this._getLabelSizes(),N=I.widest.width,O=I.highest.height,j=_h(this.chart.width-N,0,this.maxWidth);C=c.offset?this.maxWidth/d:j/(d-1),N+6>C&&(C=j/(d-(c.offset?.5:1)),L=this.maxHeight-bE(c.grid)-l.padding-e7e(c.title,this.chart.options.font),A=Math.sqrt(N*N+O*O),v=Pte(Math.min(Math.asin(_h((I.highest.height+6)/C,-1,1)),Math.asin(_h(L/A,-1,1))-Math.asin(_h(O/A,-1,1)))),v=Math.max(p,Math.min(m,v))),this.labelRotation=v}afterCalculateLabelRotation(){dl(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){dl(this.options.beforeFit,[this])}fit(){const c={width:0,height:0},{chart:l,options:{ticks:d,title:p,grid:m}}=this,v=this._isVisible(),C=this.isHorizontal();if(v){const L=e7e(p,l.options.font);if(C?(c.width=this.maxWidth,c.height=bE(m)+L):(c.height=this.maxHeight,c.width=bE(m)+L),d.display&&this.ticks.length){const{first:A,last:I,widest:N,highest:O}=this._getLabelSizes(),j=d.padding*2,q=sm(this.labelRotation),ne=Math.cos(q),ie=Math.sin(q);if(C){const re=d.mirror?0:ie*N.width+ne*O.height;c.height=Math.min(this.maxHeight,c.height+re+j)}else{const re=d.mirror?0:ne*N.width+ie*O.height;c.width=Math.min(this.maxWidth,c.width+re+j)}this._calculatePadding(A,I,ie,ne)}}this._handleMargins(),C?(this.width=this._length=l.width-this._margins.left-this._margins.right,this.height=c.height):(this.width=c.width,this.height=this._length=l.height-this._margins.top-this._margins.bottom)}_calculatePadding(c,l,d,p){const{ticks:{align:m,padding:v},position:C}=this.options,L=this.labelRotation!==0,A=C!=="top"&&this.axis==="x";if(this.isHorizontal()){const I=this.getPixelForTick(0)-this.left,N=this.right-this.getPixelForTick(this.ticks.length-1);let O=0,j=0;L?A?(O=p*c.width,j=d*l.height):(O=d*c.height,j=p*l.width):m==="start"?j=l.width:m==="end"?O=c.width:m!=="inner"&&(O=c.width/2,j=l.width/2),this.paddingLeft=Math.max((O-I+v)*this.width/(this.width-I),0),this.paddingRight=Math.max((j-N+v)*this.width/(this.width-N),0)}else{let I=l.height/2,N=c.height/2;m==="start"?(I=0,N=c.height):m==="end"&&(I=l.height,N=0),this.paddingTop=I+v,this.paddingBottom=N+v}}_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(){dl(this.options.afterFit,[this])}isHorizontal(){const{axis:c,position:l}=this.options;return l==="top"||l==="bottom"||c==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(c){this.beforeTickToLabelConversion(),this.generateTickLabels(c);let l,d;for(l=0,d=c.length;l<d;l++)ao(c[l].label)&&(c.splice(l,1),d--,l--);this.afterTickToLabelConversion()}_getLabelSizes(){let c=this._labelSizes;if(!c){const l=this.options.ticks.sampleSize;let d=this.ticks;l<d.length&&(d=J9e(d,l)),this._labelSizes=c=this._computeLabelSizes(d,d.length,this.options.ticks.maxTicksLimit)}return c}_computeLabelSizes(c,l,d){const{ctx:p,_longestTextCache:m}=this,v=[],C=[],L=Math.floor(l/Q9e(l,d));let A=0,I=0,N,O,j,q,ne,ie,re,te,X,Z,le;for(N=0;N<l;N+=L){if(q=c[N].label,ne=this._resolveTickFontOptions(N),p.font=ie=ne.string,re=m[ie]=m[ie]||{data:{},gc:[]},te=ne.lineHeight,X=Z=0,!ao(q)&&!Rl(q))X=EF(p,re.data,re.gc,X,q),Z=te;else if(Rl(q))for(O=0,j=q.length;O<j;++O)le=q[O],!ao(le)&&!Rl(le)&&(X=EF(p,re.data,re.gc,X,le),Z+=te);v.push(X),C.push(Z),A=Math.max(X,A),I=Math.max(Z,I)}vLt(m,l);const Le=v.indexOf(A),he=C.indexOf(I),Ce=G=>({width:v[G]||0,height:C[G]||0});return{first:Ce(0),last:Ce(l-1),widest:Ce(Le),highest:Ce(he),widths:v,heights:C}}getLabelForValue(c){return c}getPixelForValue(c,l){return NaN}getValueForPixel(c){}getPixelForTick(c){const l=this.ticks;return c<0||c>l.length-1?null:this.getPixelForValue(l[c].value)}getPixelForDecimal(c){this._reversePixels&&(c=1-c);const l=this._startPixel+c*this._length;return cCt(this._alignToPixels?k8(this.chart,l,0):l)}getDecimalForPixel(c){const l=(c-this._startPixel)/this._length;return this._reversePixels?1-l:l}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:c,max:l}=this;return c<0&&l<0?l:c>0&&l>0?c:0}getContext(c){const l=this.ticks||[];if(c>=0&&c<l.length){const d=l[c];return d.$context||(d.$context=xLt(this.getContext(),c,d))}return this.$context||(this.$context=yLt(this.chart.getContext(),this))}_tickSize(){const c=this.options.ticks,l=sm(this.labelRotation),d=Math.abs(Math.cos(l)),p=Math.abs(Math.sin(l)),m=this._getLabelSizes(),v=c.autoSkipPadding||0,C=m?m.widest.width+v:0,L=m?m.highest.height+v:0;return this.isHorizontal()?L*d>C*p?C/d:L/p:L*p<C*d?L/d:C/p}_isVisible(){const c=this.options.display;return c!=="auto"?!!c:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(c){const l=this.axis,d=this.chart,p=this.options,{grid:m,position:v,border:C}=p,L=m.offset,A=this.isHorizontal(),N=this.ticks.length+(L?1:0),O=bE(m),j=[],q=C.setContext(this.getContext()),ne=q.display?q.width:0,ie=ne/2,re=function(Ft){return k8(d,Ft,ne)};let te,X,Z,le,Le,he,Ce,G,kt,Fe,Ke,yt;if(v==="top")te=re(this.bottom),he=this.bottom-O,G=te-ie,Fe=re(c.top)+ie,yt=c.bottom;else if(v==="bottom")te=re(this.top),Fe=c.top,yt=re(c.bottom)-ie,he=te+ie,G=this.top+O;else if(v==="left")te=re(this.right),Le=this.right-O,Ce=te-ie,kt=re(c.left)+ie,Ke=c.right;else if(v==="right")te=re(this.left),kt=c.left,Ke=re(c.right)-ie,Le=te+ie,Ce=this.left+O;else if(l==="x"){if(v==="center")te=re((c.top+c.bottom)/2+.5);else if(yo(v)){const Ft=Object.keys(v)[0],Zt=v[Ft];te=re(this.chart.scales[Ft].getPixelForValue(Zt))}Fe=c.top,yt=c.bottom,he=te+ie,G=he+O}else if(l==="y"){if(v==="center")te=re((c.left+c.right)/2);else if(yo(v)){const Ft=Object.keys(v)[0],Zt=v[Ft];te=re(this.chart.scales[Ft].getPixelForValue(Zt))}Le=te-ie,Ce=Le-O,kt=c.left,Ke=c.right}const Tt=vs(p.ticks.maxTicksLimit,N),xt=Math.max(1,Math.ceil(N/Tt));for(X=0;X<N;X+=xt){const Ft=this.getContext(X),Zt=m.setContext(Ft),xn=C.setContext(Ft),_n=Zt.lineWidth,Qn=Zt.color,ji=xn.dash||[],pr=xn.dashOffset,ko=Zt.tickWidth,zr=Zt.tickColor,Lc=Zt.tickBorderDash||[],ca=Zt.tickBorderDashOffset;Z=wLt(this,X,L),Z!==void 0&&(le=k8(d,Z,_n),A?Le=Ce=kt=Ke=le:he=G=Fe=yt=le,j.push({tx1:Le,ty1:he,tx2:Ce,ty2:G,x1:kt,y1:Fe,x2:Ke,y2:yt,width:_n,color:Qn,borderDash:ji,borderDashOffset:pr,tickWidth:ko,tickColor:zr,tickBorderDash:Lc,tickBorderDashOffset:ca}))}return this._ticksLength=N,this._borderValue=te,j}_computeLabelItems(c){const l=this.axis,d=this.options,{position:p,ticks:m}=d,v=this.isHorizontal(),C=this.ticks,{align:L,crossAlign:A,padding:I,mirror:N}=m,O=bE(d.grid),j=O+I,q=N?-I:j,ne=-sm(this.labelRotation),ie=[];let re,te,X,Z,le,Le,he,Ce,G,kt,Fe,Ke,yt="middle";if(p==="top")Le=this.bottom-q,he=this._getXAxisLabelAlignment();else if(p==="bottom")Le=this.top+q,he=this._getXAxisLabelAlignment();else if(p==="left"){const xt=this._getYAxisLabelAlignment(O);he=xt.textAlign,le=xt.x}else if(p==="right"){const xt=this._getYAxisLabelAlignment(O);he=xt.textAlign,le=xt.x}else if(l==="x"){if(p==="center")Le=(c.top+c.bottom)/2+j;else if(yo(p)){const xt=Object.keys(p)[0],Ft=p[xt];Le=this.chart.scales[xt].getPixelForValue(Ft)+j}he=this._getXAxisLabelAlignment()}else if(l==="y"){if(p==="center")le=(c.left+c.right)/2-j;else if(yo(p)){const xt=Object.keys(p)[0],Ft=p[xt];le=this.chart.scales[xt].getPixelForValue(Ft)}he=this._getYAxisLabelAlignment(O).textAlign}l==="y"&&(L==="start"?yt="top":L==="end"&&(yt="bottom"));const Tt=this._getLabelSizes();for(re=0,te=C.length;re<te;++re){X=C[re],Z=X.label;const xt=m.setContext(this.getContext(re));Ce=this.getPixelForTick(re)+m.labelOffset,G=this._resolveTickFontOptions(re),kt=G.lineHeight,Fe=Rl(Z)?Z.length:1;const Ft=Fe/2,Zt=xt.color,xn=xt.textStrokeColor,_n=xt.textStrokeWidth;let Qn=he;v?(le=Ce,he==="inner"&&(re===te-1?Qn=this.options.reverse?"left":"right":re===0?Qn=this.options.reverse?"right":"left":Qn="center"),p==="top"?A==="near"||ne!==0?Ke=-Fe*kt+kt/2:A==="center"?Ke=-Tt.highest.height/2-Ft*kt+kt:Ke=-Tt.highest.height+kt/2:A==="near"||ne!==0?Ke=kt/2:A==="center"?Ke=Tt.highest.height/2-Ft*kt:Ke=Tt.highest.height-Fe*kt,N&&(Ke*=-1),ne!==0&&!xt.showLabelBackdrop&&(le+=kt/2*Math.sin(ne))):(Le=Ce,Ke=(1-Fe)*kt/2);let ji;if(xt.showLabelBackdrop){const pr=Xf(xt.backdropPadding),ko=Tt.heights[re],zr=Tt.widths[re];let Lc=Ke-pr.top,ca=0-pr.left;switch(yt){case"middle":Lc-=ko/2;break;case"bottom":Lc-=ko;break}switch(he){case"center":ca-=zr/2;break;case"right":ca-=zr;break;case"inner":re===te-1?ca-=zr:re>0&&(ca-=zr/2);break}ji={left:ca,top:Lc,width:zr+pr.width,height:ko+pr.height,color:xt.backdropColor}}ie.push({label:Z,font:G,textOffset:Ke,options:{rotation:ne,color:Zt,strokeColor:xn,strokeWidth:_n,textAlign:Qn,textBaseline:yt,translation:[le,Le],backdrop:ji}})}return ie}_getXAxisLabelAlignment(){const{position:c,ticks:l}=this.options;if(-sm(this.labelRotation))return c==="top"?"left":"right";let p="center";return l.align==="start"?p="left":l.align==="end"?p="right":l.align==="inner"&&(p="inner"),p}_getYAxisLabelAlignment(c){const{position:l,ticks:{crossAlign:d,mirror:p,padding:m}}=this.options,v=this._getLabelSizes(),C=c+m,L=v.widest.width;let A,I;return l==="left"?p?(I=this.right+m,d==="near"?A="left":d==="center"?(A="center",I+=L/2):(A="right",I+=L)):(I=this.right-C,d==="near"?A="right":d==="center"?(A="center",I-=L/2):(A="left",I=this.left)):l==="right"?p?(I=this.left+m,d==="near"?A="right":d==="center"?(A="center",I-=L/2):(A="left",I-=L)):(I=this.left+C,d==="near"?A="left":d==="center"?(A="center",I+=L/2):(A="right",I=this.right)):A="right",{textAlign:A,x:I}}_computeLabelArea(){if(this.options.ticks.mirror)return;const c=this.chart,l=this.options.position;if(l==="left"||l==="right")return{top:0,left:this.left,bottom:c.height,right:this.right};if(l==="top"||l==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:c.width}}drawBackground(){const{ctx:c,options:{backgroundColor:l},left:d,top:p,width:m,height:v}=this;l&&(c.save(),c.fillStyle=l,c.fillRect(d,p,m,v),c.restore())}getLineWidthForValue(c){const l=this.options.grid;if(!this._isVisible()||!l.display)return 0;const p=this.ticks.findIndex(m=>m.value===c);return p>=0?l.setContext(this.getContext(p)).lineWidth:0}drawGrid(c){const l=this.options.grid,d=this.ctx,p=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(c));let m,v;const C=(L,A,I)=>{!I.width||!I.color||(d.save(),d.lineWidth=I.width,d.strokeStyle=I.color,d.setLineDash(I.borderDash||[]),d.lineDashOffset=I.borderDashOffset,d.beginPath(),d.moveTo(L.x,L.y),d.lineTo(A.x,A.y),d.stroke(),d.restore())};if(l.display)for(m=0,v=p.length;m<v;++m){const L=p[m];l.drawOnChartArea&&C({x:L.x1,y:L.y1},{x:L.x2,y:L.y2},L),l.drawTicks&&C({x:L.tx1,y:L.ty1},{x:L.tx2,y:L.ty2},{color:L.tickColor,width:L.tickWidth,borderDash:L.tickBorderDash,borderDashOffset:L.tickBorderDashOffset})}}drawBorder(){const{chart:c,ctx:l,options:{border:d,grid:p}}=this,m=d.setContext(this.getContext()),v=d.display?m.width:0;if(!v)return;const C=p.setContext(this.getContext(0)).lineWidth,L=this._borderValue;let A,I,N,O;this.isHorizontal()?(A=k8(c,this.left,v)-v/2,I=k8(c,this.right,C)+C/2,N=O=L):(N=k8(c,this.top,v)-v/2,O=k8(c,this.bottom,C)+C/2,A=I=L),l.save(),l.lineWidth=m.width,l.strokeStyle=m.color,l.beginPath(),l.moveTo(A,N),l.lineTo(I,O),l.stroke(),l.restore()}drawLabels(c){if(!this.options.ticks.display)return;const d=this.ctx,p=this._computeLabelArea();p&&$F(d,p);const m=this.getLabelItems(c);for(const v of m){const C=v.options,L=v.font,A=v.label,I=v.textOffset;C8(d,A,0,I,L,C)}p&&NF(d)}drawTitle(){const{ctx:c,options:{position:l,title:d,reverse:p}}=this;if(!d.display)return;const m=sh(d.font),v=Xf(d.padding),C=d.align;let L=m.lineHeight/2;l==="bottom"||l==="center"||yo(l)?(L+=v.bottom,Rl(d.text)&&(L+=m.lineHeight*(d.text.length-1))):L+=v.top;const{titleX:A,titleY:I,maxWidth:N,rotation:O}=CLt(this,L,l,C);C8(c,d.text,0,0,m,{color:d.color,maxWidth:N,rotation:O,textAlign:kLt(C,l,p),textBaseline:"middle",translation:[A,I]})}draw(c){this._isVisible()&&(this.drawBackground(),this.drawGrid(c),this.drawBorder(),this.drawTitle(),this.drawLabels(c))}_layers(){const c=this.options,l=c.ticks&&c.ticks.z||0,d=vs(c.grid&&c.grid.z,-1),p=vs(c.border&&c.border.z,0);return!this._isVisible()||this.draw!==E8.prototype.draw?[{z:l,draw:m=>{this.draw(m)}}]:[{z:d,draw:m=>{this.drawBackground(),this.drawGrid(m),this.drawTitle()}},{z:p,draw:()=>{this.drawBorder()}},{z:l,draw:m=>{this.drawLabels(m)}}]}getMatchingVisibleMetas(c){const l=this.chart.getSortedVisibleDatasetMetas(),d=this.axis+"AxisID",p=[];let m,v;for(m=0,v=l.length;m<v;++m){const C=l[m];C[d]===this.id&&(!c||C.type===c)&&p.push(C)}return p}_resolveTickFontOptions(c){const l=this.options.ticks.setContext(this.getContext(c));return sh(l.font)}_maxDigits(){const c=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/c}}class KF{constructor(c,l,d){this.type=c,this.scope=l,this.override=d,this.items=Object.create(null)}isForType(c){return Object.prototype.isPrototypeOf.call(this.type.prototype,c.prototype)}register(c){const l=Object.getPrototypeOf(c);let d;SLt(l)&&(d=this.register(l));const p=this.items,m=c.id,v=this.scope+"."+m;if(!m)throw new Error("class does not have id: "+c);return m in p||(p[m]=c,MLt(c,v,d),this.override&&Bl.override(c.id,c.overrides)),v}get(c){return this.items[c]}unregister(c){const l=this.items,d=c.id,p=this.scope;d in l&&delete l[d],p&&d in Bl[p]&&(delete Bl[p][d],this.override&&delete x8[d])}}function MLt(h,c,l){const d=JP(Object.create(null),[l?Bl.get(l):{},Bl.get(c),h.defaults]);Bl.set(c,d),h.defaultRoutes&&LLt(c,h.defaultRoutes),h.descriptors&&Bl.describe(c,h.descriptors)}function LLt(h,c){Object.keys(c).forEach(l=>{const d=l.split("."),p=d.pop(),m=[h].concat(d).join("."),v=c[l].split("."),C=v.pop(),L=v.join(".");Bl.route(m,p,L,C)})}function SLt(h){return"id"in h&&"defaults"in h}class ILt{constructor(){this.controllers=new KF(om,"datasets",!0),this.elements=new KF(cm,"elements"),this.plugins=new KF(Object,"plugins"),this.scales=new KF(E8,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...c){this._each("register",c)}remove(...c){this._each("unregister",c)}addControllers(...c){this._each("register",c,this.controllers)}addElements(...c){this._each("register",c,this.elements)}addPlugins(...c){this._each("register",c,this.plugins)}addScales(...c){this._each("register",c,this.scales)}getController(c){return this._get(c,this.controllers,"controller")}getElement(c){return this._get(c,this.elements,"element")}getPlugin(c){return this._get(c,this.plugins,"plugin")}getScale(c){return this._get(c,this.scales,"scale")}removeControllers(...c){this._each("unregister",c,this.controllers)}removeElements(...c){this._each("unregister",c,this.elements)}removePlugins(...c){this._each("unregister",c,this.plugins)}removeScales(...c){this._each("unregister",c,this.scales)}_each(c,l,d){[...l].forEach(p=>{const m=d||this._getRegistryForType(p);d||m.isForType(p)||m===this.plugins&&p.id?this._exec(c,m,p):Mc(p,v=>{const C=d||this._getRegistryForType(v);this._exec(c,C,v)})})}_exec(c,l,d){const p=Ate(c);dl(d["before"+p],[],d),l[c](d),dl(d["after"+p],[],d)}_getRegistryForType(c){for(let l=0;l<this._typedRegistries.length;l++){const d=this._typedRegistries[l];if(d.isForType(c))return d}return this.plugins}_get(c,l,d){const p=l.get(c);if(p===void 0)throw new Error('"'+c+'" is not a registered '+d+".");return p}}var J2=new ILt;class ALt{constructor(){this._init=[]}notify(c,l,d,p){l==="beforeInit"&&(this._init=this._createDescriptors(c,!0),this._notify(this._init,c,"install"));const m=p?this._descriptors(c).filter(p):this._descriptors(c),v=this._notify(m,c,l,d);return l==="afterDestroy"&&(this._notify(m,c,"stop"),this._notify(this._init,c,"uninstall")),v}_notify(c,l,d,p){p=p||{};for(const m of c){const v=m.plugin,C=v[d],L=[l,p,m.options];if(dl(C,L,v)===!1&&p.cancelable)return!1}return!0}invalidate(){ao(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(c){if(this._cache)return this._cache;const l=this._cache=this._createDescriptors(c);return this._notifyStateChanges(c),l}_createDescriptors(c,l){const d=c&&c.config,p=vs(d.options&&d.options.plugins,{}),m=PLt(d);return p===!1&&!l?[]:$Lt(c,m,p,l)}_notifyStateChanges(c){const l=this._oldCache||[],d=this._cache,p=(m,v)=>m.filter(C=>!v.some(L=>C.plugin.id===L.plugin.id));this._notify(p(l,d),c,"stop"),this._notify(p(d,l),c,"start")}}function PLt(h){const c={},l=[],d=Object.keys(J2.plugins.items);for(let m=0;m<d.length;m++)l.push(J2.getPlugin(d[m]));const p=h.plugins||[];for(let m=0;m<p.length;m++){const v=p[m];l.indexOf(v)===-1&&(l.push(v),c[v.id]=!0)}return{plugins:l,localIds:c}}function ELt(h,c){return!c&&h===!1?null:h===!0?{}:h}function $Lt(h,{plugins:c,localIds:l},d,p){const m=[],v=h.getContext();for(const C of c){const L=C.id,A=ELt(d[L],p);A!==null&&m.push({plugin:C,options:NLt(h.config,{plugin:C,local:l[L]},A,v)})}return m}function NLt(h,{plugin:c,local:l},d,p){const m=h.pluginScopeKeys(c),v=h.getOptionScopes(d,m);return l&&c.defaults&&v.push(c.defaults),h.createResolver(v,p,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Jte(h,c){const l=Bl.datasets[h]||{};return((c.datasets||{})[h]||{}).indexAxis||c.indexAxis||l.indexAxis||"x"}function DLt(h,c){let l=h;return h==="_index_"?l=c:h==="_value_"&&(l=c==="x"?"y":"x"),l}function TLt(h,c){return h===c?"_index_":"_value_"}function t7e(h){if(h==="x"||h==="y"||h==="r")return h}function OLt(h){if(h==="top"||h==="bottom")return"x";if(h==="left"||h==="right")return"y"}function ene(h,...c){if(t7e(h))return h;for(const l of c){const d=l.axis||OLt(l.position)||h.length>1&&t7e(h[0].toLowerCase());if(d)return d}throw new Error(`Cannot determine type of '${h}' axis. Please provide 'axis' or 'position' option.`)}function n7e(h,c,l){if(l[c+"AxisID"]===h)return{axis:c}}function jLt(h,c){if(c.data&&c.data.datasets){const l=c.data.datasets.filter(d=>d.xAxisID===h||d.yAxisID===h);if(l.length)return n7e(h,"x",l[0])||n7e(h,"y",l[0])}return{}}function _Lt(h,c){const l=x8[h.type]||{scales:{}},d=c.scales||{},p=Jte(h.type,c),m=Object.create(null);return Object.keys(d).forEach(v=>{const C=d[v];if(!yo(C))return console.error(`Invalid scale configuration for scale: ${v}`);if(C._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${v}`);const L=ene(v,C,jLt(v,h),Bl.scales[C.type]),A=TLt(L,p),I=l.scales||{};m[v]=eE(Object.create(null),[{axis:L},C,I[L],I[A]])}),h.data.datasets.forEach(v=>{const C=v.type||h.type,L=v.indexAxis||Jte(C,c),I=(x8[C]||{}).scales||{};Object.keys(I).forEach(N=>{const O=DLt(N,L),j=v[O+"AxisID"]||O;m[j]=m[j]||Object.create(null),eE(m[j],[{axis:O},d[j],I[N]])})}),Object.keys(m).forEach(v=>{const C=m[v];eE(C,[Bl.scales[C.type],Bl.scale])}),m}function i7e(h){const c=h.options||(h.options={});c.plugins=vs(c.plugins,{}),c.scales=_Lt(h,c)}function r7e(h){return h=h||{},h.datasets=h.datasets||[],h.labels=h.labels||[],h}function RLt(h){return h=h||{},h.data=r7e(h.data),i7e(h),h}const s7e=new Map,o7e=new Set;function WF(h,c){let l=s7e.get(h);return l||(l=c(),s7e.set(h,l),o7e.add(l)),l}const mE=(h,c,l)=>{const d=E4(c,l);d!==void 0&&h.add(d)};class BLt{constructor(c){this._config=RLt(c),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(c){this._config.type=c}get data(){return this._config.data}set data(c){this._config.data=r7e(c)}get options(){return this._config.options}set options(c){this._config.options=c}get plugins(){return this._config.plugins}update(){const c=this._config;this.clearCache(),i7e(c)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(c){return WF(c,()=>[[`datasets.${c}`,""]])}datasetAnimationScopeKeys(c,l){return WF(`${c}.transition.${l}`,()=>[[`datasets.${c}.transitions.${l}`,`transitions.${l}`],[`datasets.${c}`,""]])}datasetElementScopeKeys(c,l){return WF(`${c}-${l}`,()=>[[`datasets.${c}.elements.${l}`,`datasets.${c}`,`elements.${l}`,""]])}pluginScopeKeys(c){const l=c.id,d=this.type;return WF(`${d}-plugin-${l}`,()=>[[`plugins.${l}`,...c.additionalOptionScopes||[]]])}_cachedScopes(c,l){const d=this._scopeCache;let p=d.get(c);return(!p||l)&&(p=new Map,d.set(c,p)),p}getOptionScopes(c,l,d){const{options:p,type:m}=this,v=this._cachedScopes(c,d),C=v.get(l);if(C)return C;const L=new Set;l.forEach(I=>{c&&(L.add(c),I.forEach(N=>mE(L,c,N))),I.forEach(N=>mE(L,p,N)),I.forEach(N=>mE(L,x8[m]||{},N)),I.forEach(N=>mE(L,Bl,N)),I.forEach(N=>mE(L,Ote,N))});const A=Array.from(L);return A.length===0&&A.push(Object.create(null)),o7e.has(l)&&v.set(l,A),A}chartOptionScopes(){const{options:c,type:l}=this;return[c,x8[l]||{},Bl.datasets[l]||{},{type:l},Bl,Ote]}resolveNamedOptions(c,l,d,p=[""]){const m={$shared:!0},{resolver:v,subPrefixes:C}=c7e(this._resolverCache,c,p);let L=v;if(zLt(v,l)){m.$shared=!1,d=$4(d)?d():d;const A=this.createResolver(c,d,C);L=bM(v,d,A)}for(const A of l)m[A]=L[A];return m}createResolver(c,l,d=[""],p){const{resolver:m}=c7e(this._resolverCache,c,d);return yo(l)?bM(m,l,void 0,p):m}}function c7e(h,c,l){let d=h.get(c);d||(d=new Map,h.set(c,d));const p=l.join();let m=d.get(p);return m||(m={resolver:Bte(c,l),subPrefixes:l.filter(C=>!C.toLowerCase().includes("hover"))},d.set(p,m)),m}const FLt=h=>yo(h)&&Object.getOwnPropertyNames(h).some(c=>$4(h[c]));function zLt(h,c){const{isScriptable:l,isIndexable:d}=u9e(h);for(const p of c){const m=l(p),v=d(p),C=(v||m)&&h[p];if(m&&($4(C)||FLt(C))||v&&Rl(C))return!0}return!1}var HLt="4.4.8";const ULt=["top","bottom","left","right","chartArea"];function l7e(h,c){return h==="top"||h==="bottom"||ULt.indexOf(h)===-1&&c==="x"}function a7e(h,c){return function(l,d){return l[h]===d[h]?l[c]-d[c]:l[h]-d[h]}}function u7e(h){const c=h.chart,l=c.options.animation;c.notifyPlugins("afterRender"),dl(l&&l.onComplete,[h],c)}function qLt(h){const c=h.chart,l=c.options.animation;dl(l&&l.onProgress,[h],c)}function h7e(h){return Hte()&&typeof h=="string"?h=document.getElementById(h):h&&h.length&&(h=h[0]),h&&h.canvas&&(h=h.canvas),h}const VF={},f7e=h=>{const c=h7e(h);return Object.values(VF).filter(l=>l.canvas===c).pop()};function GLt(h,c,l){const d=Object.keys(h);for(const p of d){const m=+p;if(m>=c){const v=h[p];delete h[p],(l>0||m>c)&&(h[m+l]=v)}}}function KLt(h,c,l,d){return!l||h.type==="mouseout"?null:d?c:h}function YF(h,c,l){return h.options.clip?h[l]:c[l]}function WLt(h,c){const{xScale:l,yScale:d}=h;return l&&d?{left:YF(l,c,"left"),right:YF(l,c,"right"),top:YF(d,c,"top"),bottom:YF(d,c,"bottom")}:c}class ew{static register(...c){J2.add(...c),d7e()}static unregister(...c){J2.remove(...c),d7e()}constructor(c,l){const d=this.config=new BLt(l),p=h7e(c),m=f7e(p);if(m)throw new Error("Canvas is already in use. Chart with ID '"+m.id+"' must be destroyed before the canvas with ID '"+m.canvas.id+"' can be reused.");const v=d.createResolver(d.chartOptionScopes(),this.getContext());this.platform=new(d.platform||uLt(p)),this.platform.updateConfig(d);const C=this.platform.acquireContext(p,v.aspectRatio),L=C&&C.canvas,A=L&&L.height,I=L&&L.width;if(this.id=Vkt(),this.ctx=C,this.canvas=L,this.width=I,this.height=A,this._options=v,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 ALt,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=hCt(N=>this.update(N),v.resizeDelay||0),this._dataChanges=[],VF[this.id]=this,!C||!L){console.error("Failed to create chart: can't acquire context from the given item");return}dv.listen(this,"complete",u7e),dv.listen(this,"progress",qLt),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:c,maintainAspectRatio:l},width:d,height:p,_aspectRatio:m}=this;return ao(c)?l&&m?m:p?d/p:null:c}get data(){return this.config.data}set data(c){this.config.data=c}get options(){return this._options}set options(c){this.config.options=c}get registry(){return J2}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():w9e(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return c9e(this.canvas,this.ctx),this}stop(){return dv.stop(this),this}resize(c,l){dv.running(this)?this._resizeBeforeDraw={width:c,height:l}:this._resize(c,l)}_resize(c,l){const d=this.options,p=this.canvas,m=d.maintainAspectRatio&&this.aspectRatio,v=this.platform.getMaximumSize(p,c,l,m),C=d.devicePixelRatio||this.platform.getDevicePixelRatio(),L=this.width?"resize":"attach";this.width=v.width,this.height=v.height,this._aspectRatio=this.aspectRatio,w9e(this,C,!0)&&(this.notifyPlugins("resize",{size:v}),dl(d.onResize,[this,v],this),this.attached&&this._doResize(L)&&this.render())}ensureScalesHaveIDs(){const l=this.options.scales||{};Mc(l,(d,p)=>{d.id=p})}buildOrUpdateScales(){const c=this.options,l=c.scales,d=this.scales,p=Object.keys(d).reduce((v,C)=>(v[C]=!1,v),{});let m=[];l&&(m=m.concat(Object.keys(l).map(v=>{const C=l[v],L=ene(v,C),A=L==="r",I=L==="x";return{options:C,dposition:A?"chartArea":I?"bottom":"left",dtype:A?"radialLinear":I?"category":"linear"}}))),Mc(m,v=>{const C=v.options,L=C.id,A=ene(L,C),I=vs(C.type,v.dtype);(C.position===void 0||l7e(C.position,A)!==l7e(v.dposition))&&(C.position=v.dposition),p[L]=!0;let N=null;if(L in d&&d[L].type===I)N=d[L];else{const O=J2.getScale(I);N=new O({id:L,type:I,ctx:this.ctx,chart:this}),d[N.id]=N}N.init(C,c)}),Mc(p,(v,C)=>{v||delete d[C]}),Mc(d,v=>{Qf.configure(this,v,v.options),Qf.addBox(this,v)})}_updateMetasets(){const c=this._metasets,l=this.data.datasets.length,d=c.length;if(c.sort((p,m)=>p.index-m.index),d>l){for(let p=l;p<d;++p)this._destroyDatasetMeta(p);c.splice(l,d-l)}this._sortedMetasets=c.slice(0).sort(a7e("order","index"))}_removeUnreferencedMetasets(){const{_metasets:c,data:{datasets:l}}=this;c.length>l.length&&delete this._stacks,c.forEach((d,p)=>{l.filter(m=>m===d._dataset).length===0&&this._destroyDatasetMeta(p)})}buildOrUpdateControllers(){const c=[],l=this.data.datasets;let d,p;for(this._removeUnreferencedMetasets(),d=0,p=l.length;d<p;d++){const m=l[d];let v=this.getDatasetMeta(d);const C=m.type||this.config.type;if(v.type&&v.type!==C&&(this._destroyDatasetMeta(d),v=this.getDatasetMeta(d)),v.type=C,v.indexAxis=m.indexAxis||Jte(C,this.options),v.order=m.order||0,v.index=d,v.label=""+m.label,v.visible=this.isDatasetVisible(d),v.controller)v.controller.updateIndex(d),v.controller.linkScales();else{const L=J2.getController(C),{datasetElementType:A,dataElementType:I}=Bl.datasets[C];Object.assign(L,{dataElementType:J2.getElement(I),datasetElementType:A&&J2.getElement(A)}),v.controller=new L(this,d),c.push(v.controller)}}return this._updateMetasets(),c}_resetElements(){Mc(this.data.datasets,(c,l)=>{this.getDatasetMeta(l).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(c){const l=this.config;l.update();const d=this._options=l.createResolver(l.chartOptionScopes(),this.getContext()),p=this._animationsDisabled=!d.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:c,cancelable:!0})===!1)return;const m=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let v=0;for(let A=0,I=this.data.datasets.length;A<I;A++){const{controller:N}=this.getDatasetMeta(A),O=!p&&m.indexOf(N)===-1;N.buildOrUpdateElements(O),v=Math.max(+N.getMaxOverflow(),v)}v=this._minPadding=d.layout.autoPadding?v:0,this._updateLayout(v),p||Mc(m,A=>{A.reset()}),this._updateDatasets(c),this.notifyPlugins("afterUpdate",{mode:c}),this._layers.sort(a7e("z","_idx"));const{_active:C,_lastEvent:L}=this;L?this._eventHandler(L,!0):C.length&&this._updateHoverStyles(C,C,!0),this.render()}_updateScales(){Mc(this.scales,c=>{Qf.removeBox(this,c)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const c=this.options,l=new Set(Object.keys(this._listeners)),d=new Set(c.events);(!U8e(l,d)||!!this._responsiveListeners!==c.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:c}=this,l=this._getUniformDataChanges()||[];for(const{method:d,start:p,count:m}of l){const v=d==="_removeElements"?-m:m;GLt(c,p,v)}}_getUniformDataChanges(){const c=this._dataChanges;if(!c||!c.length)return;this._dataChanges=[];const l=this.data.datasets.length,d=m=>new Set(c.filter(v=>v[0]===m).map((v,C)=>C+","+v.splice(1).join(","))),p=d(0);for(let m=1;m<l;m++)if(!U8e(p,d(m)))return;return Array.from(p).map(m=>m.split(",")).map(m=>({method:m[1],start:+m[2],count:+m[3]}))}_updateLayout(c){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Qf.update(this,this.width,this.height,c);const l=this.chartArea,d=l.width<=0||l.height<=0;this._layers=[],Mc(this.boxes,p=>{d&&p.position==="chartArea"||(p.configure&&p.configure(),this._layers.push(...p._layers()))},this),this._layers.forEach((p,m)=>{p._idx=m}),this.notifyPlugins("afterLayout")}_updateDatasets(c){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:c,cancelable:!0})!==!1){for(let l=0,d=this.data.datasets.length;l<d;++l)this.getDatasetMeta(l).controller.configure();for(let l=0,d=this.data.datasets.length;l<d;++l)this._updateDataset(l,$4(c)?c({datasetIndex:l}):c);this.notifyPlugins("afterDatasetsUpdate",{mode:c})}}_updateDataset(c,l){const d=this.getDatasetMeta(c),p={meta:d,index:c,mode:l,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",p)!==!1&&(d.controller._update(l),p.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",p))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(dv.has(this)?this.attached&&!dv.running(this)&&dv.start(this):(this.draw(),u7e({chart:this})))}draw(){let c;if(this._resizeBeforeDraw){const{width:d,height:p}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(d,p)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const l=this._layers;for(c=0;c<l.length&&l[c].z<=0;++c)l[c].draw(this.chartArea);for(this._drawDatasets();c<l.length;++c)l[c].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(c){const l=this._sortedMetasets,d=[];let p,m;for(p=0,m=l.length;p<m;++p){const v=l[p];(!c||v.visible)&&d.push(v)}return d}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const c=this.getSortedVisibleDatasetMetas();for(let l=c.length-1;l>=0;--l)this._drawDataset(c[l]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(c){const l=this.ctx,d=c._clip,p=!d.disabled,m=WLt(c,this.chartArea),v={meta:c,index:c.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",v)!==!1&&(p&&$F(l,{left:d.left===!1?0:m.left-d.left,right:d.right===!1?this.width:m.right+d.right,top:d.top===!1?0:m.top-d.top,bottom:d.bottom===!1?this.height:m.bottom+d.bottom}),c.controller.draw(),p&&NF(l),v.cancelable=!1,this.notifyPlugins("afterDatasetDraw",v))}isPointInArea(c){return fv(c,this.chartArea,this._minPadding)}getElementsAtEventForMode(c,l,d,p){const m=UMt.modes[l];return typeof m=="function"?m(this,c,d,p):[]}getDatasetMeta(c){const l=this.data.datasets[c],d=this._metasets;let p=d.filter(m=>m&&m._dataset===l).pop();return p||(p={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:l&&l.order||0,index:c,_dataset:l,_parsed:[],_sorted:!1},d.push(p)),p}getContext(){return this.$context||(this.$context=D4(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(c){const l=this.data.datasets[c];if(!l)return!1;const d=this.getDatasetMeta(c);return typeof d.hidden=="boolean"?!d.hidden:!l.hidden}setDatasetVisibility(c,l){const d=this.getDatasetMeta(c);d.hidden=!l}toggleDataVisibility(c){this._hiddenIndices[c]=!this._hiddenIndices[c]}getDataVisibility(c){return!this._hiddenIndices[c]}_updateVisibility(c,l,d){const p=d?"show":"hide",m=this.getDatasetMeta(c),v=m.controller._resolveAnimations(void 0,p);tE(l)?(m.data[l].hidden=!d,this.update()):(this.setDatasetVisibility(c,d),v.update(m,{visible:d}),this.update(C=>C.datasetIndex===c?p:void 0))}hide(c,l){this._updateVisibility(c,l,!1)}show(c,l){this._updateVisibility(c,l,!0)}_destroyDatasetMeta(c){const l=this._metasets[c];l&&l.controller&&l.controller._destroy(),delete this._metasets[c]}_stop(){let c,l;for(this.stop(),dv.remove(this),c=0,l=this.data.datasets.length;c<l;++c)this._destroyDatasetMeta(c)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:c,ctx:l}=this;this._stop(),this.config.clearCache(),c&&(this.unbindEvents(),c9e(c,l),this.platform.releaseContext(l),this.canvas=null,this.ctx=null),delete VF[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...c){return this.canvas.toDataURL(...c)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const c=this._listeners,l=this.platform,d=(m,v)=>{l.addEventListener(this,m,v),c[m]=v},p=(m,v,C)=>{m.offsetX=v,m.offsetY=C,this._eventHandler(m)};Mc(this.options.events,m=>d(m,p))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const c=this._responsiveListeners,l=this.platform,d=(L,A)=>{l.addEventListener(this,L,A),c[L]=A},p=(L,A)=>{c[L]&&(l.removeEventListener(this,L,A),delete c[L])},m=(L,A)=>{this.canvas&&this.resize(L,A)};let v;const C=()=>{p("attach",C),this.attached=!0,this.resize(),d("resize",m),d("detach",v)};v=()=>{this.attached=!1,p("resize",m),this._stop(),this._resize(0,0),d("attach",C)},l.isAttached(this.canvas)?C():v()}unbindEvents(){Mc(this._listeners,(c,l)=>{this.platform.removeEventListener(this,l,c)}),this._listeners={},Mc(this._responsiveListeners,(c,l)=>{this.platform.removeEventListener(this,l,c)}),this._responsiveListeners=void 0}updateHoverStyle(c,l,d){const p=d?"set":"remove";let m,v,C,L;for(l==="dataset"&&(m=this.getDatasetMeta(c[0].datasetIndex),m.controller["_"+p+"DatasetHoverStyle"]()),C=0,L=c.length;C<L;++C){v=c[C];const A=v&&this.getDatasetMeta(v.datasetIndex).controller;A&&A[p+"HoverStyle"](v.element,v.datasetIndex,v.index)}}getActiveElements(){return this._active||[]}setActiveElements(c){const l=this._active||[],d=c.map(({datasetIndex:m,index:v})=>{const C=this.getDatasetMeta(m);if(!C)throw new Error("No dataset found at index "+m);return{datasetIndex:m,element:C.data[v],index:v}});!LF(d,l)&&(this._active=d,this._lastEvent=null,this._updateHoverStyles(d,l))}notifyPlugins(c,l,d){return this._plugins.notify(this,c,l,d)}isPluginEnabled(c){return this._plugins._cache.filter(l=>l.plugin.id===c).length===1}_updateHoverStyles(c,l,d){const p=this.options.hover,m=(L,A)=>L.filter(I=>!A.some(N=>I.datasetIndex===N.datasetIndex&&I.index===N.index)),v=m(l,c),C=d?c:m(c,l);v.length&&this.updateHoverStyle(v,p.mode,!1),C.length&&p.mode&&this.updateHoverStyle(C,p.mode,!0)}_eventHandler(c,l){const d={event:c,replay:l,cancelable:!0,inChartArea:this.isPointInArea(c)},p=v=>(v.options.events||this.options.events).includes(c.native.type);if(this.notifyPlugins("beforeEvent",d,p)===!1)return;const m=this._handleEvent(c,l,d.inChartArea);return d.cancelable=!1,this.notifyPlugins("afterEvent",d,p),(m||d.changed)&&this.render(),this}_handleEvent(c,l,d){const{_active:p=[],options:m}=this,v=l,C=this._getActiveElements(c,p,d,v),L=eCt(c),A=KLt(c,this._lastEvent,d,L);d&&(this._lastEvent=null,dl(m.onHover,[c,C,this],this),L&&dl(m.onClick,[c,C,this],this));const I=!LF(C,p);return(I||l)&&(this._active=C,this._updateHoverStyles(C,p,l)),this._lastEvent=A,I}_getActiveElements(c,l,d,p){if(c.type==="mouseout")return[];if(!d)return l;const m=this.options.hover;return this.getElementsAtEventForMode(c,m.mode,m,p)}}en(ew,"defaults",Bl),en(ew,"instances",VF),en(ew,"overrides",x8),en(ew,"registry",J2),en(ew,"version",HLt),en(ew,"getChart",f7e);function d7e(){return Mc(ew.instances,h=>h._plugins.invalidate())}function VLt(h,c,l){const{startAngle:d,pixelMargin:p,x:m,y:v,outerRadius:C,innerRadius:L}=c;let A=p/C;h.beginPath(),h.arc(m,v,C,d-A,l+A),L>p?(A=p/L,h.arc(m,v,L,l+A,d-A,!0)):h.arc(m,v,p,l+ou,d-ou),h.closePath(),h.clip()}function YLt(h){return Rte(h,["outerStart","outerEnd","innerStart","innerEnd"])}function ZLt(h,c,l,d){const p=YLt(h.options.borderRadius),m=(l-c)/2,v=Math.min(m,d*c/2),C=L=>{const A=(l-Math.min(m,L))*d/2;return _h(L,0,Math.min(m,A))};return{outerStart:C(p.outerStart),outerEnd:C(p.outerEnd),innerStart:_h(p.innerStart,0,v),innerEnd:_h(p.innerEnd,0,v)}}function vM(h,c,l,d){return{x:l+h*Math.cos(c),y:d+h*Math.sin(c)}}function ZF(h,c,l,d,p,m){const{x:v,y:C,startAngle:L,pixelMargin:A,innerRadius:I}=c,N=Math.max(c.outerRadius+d+l-A,0),O=I>0?I+d+l+A:0;let j=0;const q=p-L;if(d){const xt=I>0?I-d:0,Ft=N>0?N-d:0,Zt=(xt+Ft)/2,xn=Zt!==0?q*Zt/(Zt+d):q;j=(q-xn)/2}const ne=Math.max(.001,q*N-l/Il)/N,ie=(q-ne)/2,re=L+ie+j,te=p-ie-j,{outerStart:X,outerEnd:Z,innerStart:le,innerEnd:Le}=ZLt(c,O,N,te-re),he=N-X,Ce=N-Z,G=re+X/he,kt=te-Z/Ce,Fe=O+le,Ke=O+Le,yt=re+le/Fe,Tt=te-Le/Ke;if(h.beginPath(),m){const xt=(G+kt)/2;if(h.arc(v,C,N,G,xt),h.arc(v,C,N,xt,kt),Z>0){const _n=vM(Ce,kt,v,C);h.arc(_n.x,_n.y,Z,kt,te+ou)}const Ft=vM(Ke,te,v,C);if(h.lineTo(Ft.x,Ft.y),Le>0){const _n=vM(Ke,Tt,v,C);h.arc(_n.x,_n.y,Le,te+ou,Tt+Math.PI)}const Zt=(te-Le/O+(re+le/O))/2;if(h.arc(v,C,O,te-Le/O,Zt,!0),h.arc(v,C,O,Zt,re+le/O,!0),le>0){const _n=vM(Fe,yt,v,C);h.arc(_n.x,_n.y,le,yt+Math.PI,re-ou)}const xn=vM(he,re,v,C);if(h.lineTo(xn.x,xn.y),X>0){const _n=vM(he,G,v,C);h.arc(_n.x,_n.y,X,re-ou,G)}}else{h.moveTo(v,C);const xt=Math.cos(G)*N+v,Ft=Math.sin(G)*N+C;h.lineTo(xt,Ft);const Zt=Math.cos(kt)*N+v,xn=Math.sin(kt)*N+C;h.lineTo(Zt,xn)}h.closePath()}function XLt(h,c,l,d,p){const{fullCircles:m,startAngle:v,circumference:C}=c;let L=c.endAngle;if(m){ZF(h,c,l,d,L,p);for(let A=0;A<m;++A)h.fill();isNaN(C)||(L=v+(C%Al||Al))}return ZF(h,c,l,d,L,p),h.fill(),L}function QLt(h,c,l,d,p){const{fullCircles:m,startAngle:v,circumference:C,options:L}=c,{borderWidth:A,borderJoinStyle:I,borderDash:N,borderDashOffset:O}=L,j=L.borderAlign==="inner";if(!A)return;h.setLineDash(N||[]),h.lineDashOffset=O,j?(h.lineWidth=A*2,h.lineJoin=I||"round"):(h.lineWidth=A,h.lineJoin=I||"bevel");let q=c.endAngle;if(m){ZF(h,c,l,d,q,p);for(let ne=0;ne<m;++ne)h.stroke();isNaN(C)||(q=v+(C%Al||Al))}j&&VLt(h,c,q),m||(ZF(h,c,l,d,q,p),h.stroke())}class wE extends cm{constructor(l){super();en(this,"circumference");en(this,"endAngle");en(this,"fullCircles");en(this,"innerRadius");en(this,"outerRadius");en(this,"pixelMargin");en(this,"startAngle");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,l&&Object.assign(this,l)}inRange(l,d,p){const m=this.getProps(["x","y"],p),{angle:v,distance:C}=V8e(m,{x:l,y:d}),{startAngle:L,endAngle:A,innerRadius:I,outerRadius:N,circumference:O}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],p),j=(this.options.spacing+this.options.borderWidth)/2,q=vs(O,A-L),ne=iE(v,L,A)&&L!==A,ie=q>=Al||ne,re=uv(C,I+j,N+j);return ie&&re}getCenterPoint(l){const{x:d,y:p,startAngle:m,endAngle:v,innerRadius:C,outerRadius:L}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],l),{offset:A,spacing:I}=this.options,N=(m+v)/2,O=(C+L+I+A)/2;return{x:d+Math.cos(N)*O,y:p+Math.sin(N)*O}}tooltipPosition(l){return this.getCenterPoint(l)}draw(l){const{options:d,circumference:p}=this,m=(d.offset||0)/4,v=(d.spacing||0)/2,C=d.circular;if(this.pixelMargin=d.borderAlign==="inner"?.33:0,this.fullCircles=p>Al?Math.floor(p/Al):0,p===0||this.innerRadius<0||this.outerRadius<0)return;l.save();const L=(this.startAngle+this.endAngle)/2;l.translate(Math.cos(L)*m,Math.sin(L)*m);const A=1-Math.sin(Math.min(Il,p||0)),I=m*A;l.fillStyle=d.backgroundColor,l.strokeStyle=d.borderColor,XLt(l,this,I,v,C),QLt(l,this,I,v,C),l.restore()}}en(wE,"id","arc"),en(wE,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),en(wE,"defaultRoutes",{backgroundColor:"backgroundColor"}),en(wE,"descriptors",{_scriptable:!0,_indexable:l=>l!=="borderDash"});function p7e(h,c,l=c){h.lineCap=vs(l.borderCapStyle,c.borderCapStyle),h.setLineDash(vs(l.borderDash,c.borderDash)),h.lineDashOffset=vs(l.borderDashOffset,c.borderDashOffset),h.lineJoin=vs(l.borderJoinStyle,c.borderJoinStyle),h.lineWidth=vs(l.borderWidth,c.borderWidth),h.strokeStyle=vs(l.borderColor,c.borderColor)}function JLt(h,c,l){h.lineTo(l.x,l.y)}function eSt(h){return h.stepped?CCt:h.tension||h.cubicInterpolationMode==="monotone"?MCt:JLt}function g7e(h,c,l={}){const d=h.length,{start:p=0,end:m=d-1}=l,{start:v,end:C}=c,L=Math.max(p,v),A=Math.min(m,C),I=p<v&&m<v||p>C&&m>C;return{count:d,start:L,loop:c.loop,ilen:A<L&&!I?d+A-L:A-L}}function tSt(h,c,l,d){const{points:p,options:m}=c,{count:v,start:C,loop:L,ilen:A}=g7e(p,l,d),I=eSt(m);let{move:N=!0,reverse:O}=d||{},j,q,ne;for(j=0;j<=A;++j)q=p[(C+(O?A-j:j))%v],!q.skip&&(N?(h.moveTo(q.x,q.y),N=!1):I(h,ne,q,O,m.stepped),ne=q);return L&&(q=p[(C+(O?A:0))%v],I(h,ne,q,O,m.stepped)),!!L}function nSt(h,c,l,d){const p=c.points,{count:m,start:v,ilen:C}=g7e(p,l,d),{move:L=!0,reverse:A}=d||{};let I=0,N=0,O,j,q,ne,ie,re;const te=Z=>(v+(A?C-Z:Z))%m,X=()=>{ne!==ie&&(h.lineTo(I,ie),h.lineTo(I,ne),h.lineTo(I,re))};for(L&&(j=p[te(0)],h.moveTo(j.x,j.y)),O=0;O<=C;++O){if(j=p[te(O)],j.skip)continue;const Z=j.x,le=j.y,Le=Z|0;Le===q?(le<ne?ne=le:le>ie&&(ie=le),I=(N*I+Z)/++N):(X(),h.lineTo(Z,le),q=Le,N=0,ne=ie=le),re=le}X()}function tne(h){const c=h.options,l=c.borderDash&&c.borderDash.length;return!h._decimated&&!h._loop&&!c.tension&&c.cubicInterpolationMode!=="monotone"&&!c.stepped&&!l?nSt:tSt}function iSt(h){return h.stepped?nMt:h.tension||h.cubicInterpolationMode==="monotone"?iMt:I8}function rSt(h,c,l,d){let p=c._path;p||(p=c._path=new Path2D,c.path(p,l,d)&&p.closePath()),p7e(h,c.options),h.stroke(p)}function sSt(h,c,l,d){const{segments:p,options:m}=c,v=tne(c);for(const C of p)p7e(h,m,C.style),h.beginPath(),v(h,c,C,{start:l,end:l+d-1})&&h.closePath(),h.stroke()}const oSt=typeof Path2D=="function";function cSt(h,c,l,d){oSt&&!c.options.segment?rSt(h,c,l,d):sSt(h,c,l,d)}class T4 extends cm{constructor(c){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,c&&Object.assign(this,c)}updateControlPoints(c,l){const d=this.options;if((d.tension||d.cubicInterpolationMode==="monotone")&&!d.stepped&&!this._pointsUpdated){const p=d.spanGaps?this._loop:this._fullLoop;VCt(this._points,d,c,p,l),this._pointsUpdated=!0}}set points(c){this._points=c,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=aMt(this,this.options.segment))}first(){const c=this.segments,l=this.points;return c.length&&l[c[0].start]}last(){const c=this.segments,l=this.points,d=c.length;return d&&l[c[d-1].end]}interpolate(c,l){const d=this.options,p=c[l],m=this.points,v=L9e(this,{property:l,start:p,end:p});if(!v.length)return;const C=[],L=iSt(d);let A,I;for(A=0,I=v.length;A<I;++A){const{start:N,end:O}=v[A],j=m[N],q=m[O];if(j===q){C.push(j);continue}const ne=Math.abs((p-j[l])/(q[l]-j[l])),ie=L(j,q,ne,d.stepped);ie[l]=c[l],C.push(ie)}return C.length===1?C[0]:C}pathSegment(c,l,d){return tne(this)(c,this,l,d)}path(c,l,d){const p=this.segments,m=tne(this);let v=this._loop;l=l||0,d=d||this.points.length-l;for(const C of p)v&=m(c,this,C,{start:l,end:l+d-1});return!!v}draw(c,l,d,p){const m=this.options||{};(this.points||[]).length&&m.borderWidth&&(c.save(),cSt(c,this,d,p),c.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}en(T4,"id","line"),en(T4,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),en(T4,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),en(T4,"descriptors",{_scriptable:!0,_indexable:c=>c!=="borderDash"&&c!=="fill"});function b7e(h,c,l,d){const p=h.options,{[l]:m}=h.getProps([l],d);return Math.abs(c-m)<p.radius+p.hitRadius}class XF extends cm{constructor(l){super();en(this,"parsed");en(this,"skip");en(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,l&&Object.assign(this,l)}inRange(l,d,p){const m=this.options,{x:v,y:C}=this.getProps(["x","y"],p);return Math.pow(l-v,2)+Math.pow(d-C,2)<Math.pow(m.hitRadius+m.radius,2)}inXRange(l,d){return b7e(this,l,"x",d)}inYRange(l,d){return b7e(this,l,"y",d)}getCenterPoint(l){const{x:d,y:p}=this.getProps(["x","y"],l);return{x:d,y:p}}size(l){l=l||this.options||{};let d=l.radius||0;d=Math.max(d,d&&l.hoverRadius||0);const p=d&&l.borderWidth||0;return(d+p)*2}draw(l,d){const p=this.options;this.skip||p.radius<.1||!fv(this,d,this.size(p)/2)||(l.strokeStyle=p.borderColor,l.lineWidth=p.borderWidth,l.fillStyle=p.backgroundColor,_te(l,p,this.x,this.y))}getRange(){const l=this.options||{};return l.radius+l.hitRadius}}en(XF,"id","point"),en(XF,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),en(XF,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function m7e(h,c){const{x:l,y:d,base:p,width:m,height:v}=h.getProps(["x","y","base","width","height"],c);let C,L,A,I,N;return h.horizontal?(N=v/2,C=Math.min(l,p),L=Math.max(l,p),A=d-N,I=d+N):(N=m/2,C=l-N,L=l+N,A=Math.min(d,p),I=Math.max(d,p)),{left:C,top:A,right:L,bottom:I}}function O4(h,c,l,d){return h?0:_h(c,l,d)}function lSt(h,c,l){const d=h.options.borderWidth,p=h.borderSkipped,m=a9e(d);return{t:O4(p.top,m.top,0,l),r:O4(p.right,m.right,0,c),b:O4(p.bottom,m.bottom,0,l),l:O4(p.left,m.left,0,c)}}function aSt(h,c,l){const{enableBorderRadius:d}=h.getProps(["enableBorderRadius"]),p=h.options.borderRadius,m=M8(p),v=Math.min(c,l),C=h.borderSkipped,L=d||yo(p);return{topLeft:O4(!L||C.top||C.left,m.topLeft,0,v),topRight:O4(!L||C.top||C.right,m.topRight,0,v),bottomLeft:O4(!L||C.bottom||C.left,m.bottomLeft,0,v),bottomRight:O4(!L||C.bottom||C.right,m.bottomRight,0,v)}}function uSt(h){const c=m7e(h),l=c.right-c.left,d=c.bottom-c.top,p=lSt(h,l/2,d/2),m=aSt(h,l/2,d/2);return{outer:{x:c.left,y:c.top,w:l,h:d,radius:m},inner:{x:c.left+p.l,y:c.top+p.t,w:l-p.l-p.r,h:d-p.t-p.b,radius:{topLeft:Math.max(0,m.topLeft-Math.max(p.t,p.l)),topRight:Math.max(0,m.topRight-Math.max(p.t,p.r)),bottomLeft:Math.max(0,m.bottomLeft-Math.max(p.b,p.l)),bottomRight:Math.max(0,m.bottomRight-Math.max(p.b,p.r))}}}}function nne(h,c,l,d){const p=c===null,m=l===null,C=h&&!(p&&m)&&m7e(h,d);return C&&(p||uv(c,C.left,C.right))&&(m||uv(l,C.top,C.bottom))}function hSt(h){return h.topLeft||h.topRight||h.bottomLeft||h.bottomRight}function fSt(h,c){h.rect(c.x,c.y,c.w,c.h)}function ine(h,c,l={}){const d=h.x!==l.x?-c:0,p=h.y!==l.y?-c:0,m=(h.x+h.w!==l.x+l.w?c:0)-d,v=(h.y+h.h!==l.y+l.h?c:0)-p;return{x:h.x+d,y:h.y+p,w:h.w+m,h:h.h+v,radius:h.radius}}class QF extends cm{constructor(c){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,c&&Object.assign(this,c)}draw(c){const{inflateAmount:l,options:{borderColor:d,backgroundColor:p}}=this,{inner:m,outer:v}=uSt(this),C=hSt(v.radius)?cE:fSt;c.save(),(v.w!==m.w||v.h!==m.h)&&(c.beginPath(),C(c,ine(v,l,m)),c.clip(),C(c,ine(m,-l,v)),c.fillStyle=d,c.fill("evenodd")),c.beginPath(),C(c,ine(m,l)),c.fillStyle=p,c.fill(),c.restore()}inRange(c,l,d){return nne(this,c,l,d)}inXRange(c,l){return nne(this,c,null,l)}inYRange(c,l){return nne(this,null,c,l)}getCenterPoint(c){const{x:l,y:d,base:p,horizontal:m}=this.getProps(["x","y","base","horizontal"],c);return{x:m?(l+p)/2:l,y:m?d:(d+p)/2}}getRange(c){return c==="x"?this.width/2:this.height/2}}en(QF,"id","bar"),en(QF,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),en(QF,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var dSt=Object.freeze({__proto__:null,ArcElement:wE,BarElement:QF,LineElement:T4,PointElement:XF});const rne=["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)"],w7e=rne.map(h=>h.replace("rgb(","rgba(").replace(")",", 0.5)"));function v7e(h){return rne[h%rne.length]}function y7e(h){return w7e[h%w7e.length]}function pSt(h,c){return h.borderColor=v7e(c),h.backgroundColor=y7e(c),++c}function gSt(h,c){return h.backgroundColor=h.data.map(()=>v7e(c++)),c}function bSt(h,c){return h.backgroundColor=h.data.map(()=>y7e(c++)),c}function mSt(h){let c=0;return(l,d)=>{const p=h.getDatasetMeta(d).controller;p instanceof A8?c=gSt(l,c):p instanceof uE?c=bSt(l,c):p&&(c=pSt(l,c))}}function x7e(h){let c;for(c in h)if(h[c].borderColor||h[c].backgroundColor)return!0;return!1}function wSt(h){return h&&(h.borderColor||h.backgroundColor)}function vSt(){return Bl.borderColor!=="rgba(0,0,0,0.1)"||Bl.backgroundColor!=="rgba(0,0,0,0.1)"}var ySt={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(h,c,l){if(!l.enabled)return;const{data:{datasets:d},options:p}=h.config,{elements:m}=p,v=x7e(d)||wSt(p)||m&&x7e(m)||vSt();if(!l.forceOverride&&v)return;const C=mSt(h);d.forEach(C)}};function xSt(h,c,l,d,p){const m=p.samples||d;if(m>=l)return h.slice(c,c+l);const v=[],C=(l-2)/(m-2);let L=0;const A=c+l-1;let I=c,N,O,j,q,ne;for(v[L++]=h[I],N=0;N<m-2;N++){let ie=0,re=0,te;const X=Math.floor((N+1)*C)+1+c,Z=Math.min(Math.floor((N+2)*C)+1,l)+c,le=Z-X;for(te=X;te<Z;te++)ie+=h[te].x,re+=h[te].y;ie/=le,re/=le;const Le=Math.floor(N*C)+1+c,he=Math.min(Math.floor((N+1)*C)+1,l)+c,{x:Ce,y:G}=h[I];for(j=q=-1,te=Le;te<he;te++)q=.5*Math.abs((Ce-ie)*(h[te].y-G)-(Ce-h[te].x)*(re-G)),q>j&&(j=q,O=h[te],ne=te);v[L++]=O,I=ne}return v[L++]=h[A],v}function kSt(h,c,l,d){let p=0,m=0,v,C,L,A,I,N,O,j,q,ne;const ie=[],re=c+l-1,te=h[c].x,Z=h[re].x-te;for(v=c;v<c+l;++v){C=h[v],L=(C.x-te)/Z*d,A=C.y;const le=L|0;if(le===I)A<q?(q=A,N=v):A>ne&&(ne=A,O=v),p=(m*p+C.x)/++m;else{const Le=v-1;if(!ao(N)&&!ao(O)){const he=Math.min(N,O),Ce=Math.max(N,O);he!==j&&he!==Le&&ie.push({...h[he],x:p}),Ce!==j&&Ce!==Le&&ie.push({...h[Ce],x:p})}v>0&&Le!==j&&ie.push(h[Le]),ie.push(C),I=le,m=0,q=ne=A,N=O=j=v}}return ie}function k7e(h){if(h._decimated){const c=h._data;delete h._decimated,delete h._data,Object.defineProperty(h,"data",{configurable:!0,enumerable:!0,writable:!0,value:c})}}function C7e(h){h.data.datasets.forEach(c=>{k7e(c)})}function CSt(h,c){const l=c.length;let d=0,p;const{iScale:m}=h,{min:v,max:C,minDefined:L,maxDefined:A}=m.getUserBounds();return L&&(d=_h(hv(c,m.axis,v).lo,0,l-1)),A?p=_h(hv(c,m.axis,C).hi+1,d,l)-d:p=l-d,{start:d,count:p}}var MSt={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(h,c,l)=>{if(!l.enabled){C7e(h);return}const d=h.width;h.data.datasets.forEach((p,m)=>{const{_data:v,indexAxis:C}=p,L=h.getDatasetMeta(m),A=v||p.data;if(lE([C,h.options.indexAxis])==="y"||!L.controller.supportsDecimation)return;const I=h.scales[L.xAxisID];if(I.type!=="linear"&&I.type!=="time"||h.options.parsing)return;let{start:N,count:O}=CSt(L,A);const j=l.threshold||4*d;if(O<=j){k7e(p);return}ao(v)&&(p._data=A,delete p.data,Object.defineProperty(p,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(ne){this._data=ne}}));let q;switch(l.algorithm){case"lttb":q=xSt(A,N,O,d,l);break;case"min-max":q=kSt(A,N,O,d);break;default:throw new Error(`Unsupported decimation algorithm '${l.algorithm}'`)}p._decimated=q})},destroy(h){C7e(h)}};function LSt(h,c,l){const d=h.segments,p=h.points,m=c.points,v=[];for(const C of d){let{start:L,end:A}=C;A=one(L,A,p);const I=sne(l,p[L],p[A],C.loop);if(!c.segments){v.push({source:C,target:I,start:p[L],end:p[A]});continue}const N=L9e(c,I);for(const O of N){const j=sne(l,m[O.start],m[O.end],O.loop),q=M9e(C,p,j);for(const ne of q)v.push({source:ne,target:O,start:{[l]:M7e(I,j,"start",Math.max)},end:{[l]:M7e(I,j,"end",Math.min)}})}}return v}function sne(h,c,l,d){if(d)return;let p=c[h],m=l[h];return h==="angle"&&(p=Yp(p),m=Yp(m)),{property:h,start:p,end:m}}function SSt(h,c){const{x:l=null,y:d=null}=h||{},p=c.points,m=[];return c.segments.forEach(({start:v,end:C})=>{C=one(v,C,p);const L=p[v],A=p[C];d!==null?(m.push({x:L.x,y:d}),m.push({x:A.x,y:d})):l!==null&&(m.push({x:l,y:L.y}),m.push({x:l,y:A.y}))}),m}function one(h,c,l){for(;c>h;c--){const d=l[c];if(!isNaN(d.x)&&!isNaN(d.y))break}return c}function M7e(h,c,l,d){return h&&c?d(h[l],c[l]):h?h[l]:c?c[l]:0}function L7e(h,c){let l=[],d=!1;return Rl(h)?(d=!0,l=h):l=SSt(h,c),l.length?new T4({points:l,options:{tension:0},_loop:d,_fullLoop:d}):null}function S7e(h){return h&&h.fill!==!1}function ISt(h,c,l){let p=h[c].fill;const m=[c];let v;if(!l)return p;for(;p!==!1&&m.indexOf(p)===-1;){if(!ja(p))return p;if(v=h[p],!v)return!1;if(v.visible)return p;m.push(p),p=v.fill}return!1}function ASt(h,c,l){const d=NSt(h);if(yo(d))return isNaN(d.value)?!1:d;let p=parseFloat(d);return ja(p)&&Math.floor(p)===p?PSt(d[0],c,p,l):["origin","start","end","stack","shape"].indexOf(d)>=0&&d}function PSt(h,c,l,d){return(h==="-"||h==="+")&&(l=c+l),l===c||l<0||l>=d?!1:l}function ESt(h,c){let l=null;return h==="start"?l=c.bottom:h==="end"?l=c.top:yo(h)?l=c.getPixelForValue(h.value):c.getBasePixel&&(l=c.getBasePixel()),l}function $St(h,c,l){let d;return h==="start"?d=l:h==="end"?d=c.options.reverse?c.min:c.max:yo(h)?d=h.value:d=c.getBaseValue(),d}function NSt(h){const c=h.options,l=c.fill;let d=vs(l&&l.target,l);return d===void 0&&(d=!!c.backgroundColor),d===!1||d===null?!1:d===!0?"origin":d}function DSt(h){const{scale:c,index:l,line:d}=h,p=[],m=d.segments,v=d.points,C=TSt(c,l);C.push(L7e({x:null,y:c.bottom},d));for(let L=0;L<m.length;L++){const A=m[L];for(let I=A.start;I<=A.end;I++)OSt(p,v[I],C)}return new T4({points:p,options:{}})}function TSt(h,c){const l=[],d=h.getMatchingVisibleMetas("line");for(let p=0;p<d.length;p++){const m=d[p];if(m.index===c)break;m.hidden||l.unshift(m.dataset)}return l}function OSt(h,c,l){const d=[];for(let p=0;p<l.length;p++){const m=l[p],{first:v,last:C,point:L}=jSt(m,c,"x");if(!(!L||v&&C)){if(v)d.unshift(L);else if(h.push(L),!C)break}}h.push(...d)}function jSt(h,c,l){const d=h.interpolate(c,l);if(!d)return{};const p=d[l],m=h.segments,v=h.points;let C=!1,L=!1;for(let A=0;A<m.length;A++){const I=m[A],N=v[I.start][l],O=v[I.end][l];if(uv(p,N,O)){C=p===N,L=p===O;break}}return{first:C,last:L,point:d}}class I7e{constructor(c){this.x=c.x,this.y=c.y,this.radius=c.radius}pathSegment(c,l,d){const{x:p,y:m,radius:v}=this;return l=l||{start:0,end:Al},c.arc(p,m,v,l.end,l.start,!0),!d.bounds}interpolate(c){const{x:l,y:d,radius:p}=this,m=c.angle;return{x:l+Math.cos(m)*p,y:d+Math.sin(m)*p,angle:m}}}function _St(h){const{chart:c,fill:l,line:d}=h;if(ja(l))return RSt(c,l);if(l==="stack")return DSt(h);if(l==="shape")return!0;const p=BSt(h);return p instanceof I7e?p:L7e(p,d)}function RSt(h,c){const l=h.getDatasetMeta(c);return l&&h.isDatasetVisible(c)?l.dataset:null}function BSt(h){return(h.scale||{}).getPointPositionForValue?zSt(h):FSt(h)}function FSt(h){const{scale:c={},fill:l}=h,d=ESt(l,c);if(ja(d)){const p=c.isHorizontal();return{x:p?d:null,y:p?null:d}}return null}function zSt(h){const{scale:c,fill:l}=h,d=c.options,p=c.getLabels().length,m=d.reverse?c.max:c.min,v=$St(l,c,m),C=[];if(d.grid.circular){const L=c.getPointPositionForValue(0,m);return new I7e({x:L.x,y:L.y,radius:c.getDistanceFromCenterForValue(v)})}for(let L=0;L<p;++L)C.push(c.getPointPositionForValue(L,v));return C}function cne(h,c,l){const d=_St(c),{line:p,scale:m,axis:v}=c,C=p.options,L=C.fill,A=C.backgroundColor,{above:I=A,below:N=A}=L||{};d&&p.points.length&&($F(h,l),HSt(h,{line:p,target:d,above:I,below:N,area:l,scale:m,axis:v}),NF(h))}function HSt(h,c){const{line:l,target:d,above:p,below:m,area:v,scale:C}=c,L=l._loop?"angle":c.axis;h.save(),L==="x"&&m!==p&&(A7e(h,d,v.top),P7e(h,{line:l,target:d,color:p,scale:C,property:L}),h.restore(),h.save(),A7e(h,d,v.bottom)),P7e(h,{line:l,target:d,color:m,scale:C,property:L}),h.restore()}function A7e(h,c,l){const{segments:d,points:p}=c;let m=!0,v=!1;h.beginPath();for(const C of d){const{start:L,end:A}=C,I=p[L],N=p[one(L,A,p)];m?(h.moveTo(I.x,I.y),m=!1):(h.lineTo(I.x,l),h.lineTo(I.x,I.y)),v=!!c.pathSegment(h,C,{move:v}),v?h.closePath():h.lineTo(N.x,l)}h.lineTo(c.first().x,l),h.closePath(),h.clip()}function P7e(h,c){const{line:l,target:d,property:p,color:m,scale:v}=c,C=LSt(l,d,p);for(const{source:L,target:A,start:I,end:N}of C){const{style:{backgroundColor:O=m}={}}=L,j=d!==!0;h.save(),h.fillStyle=O,USt(h,v,j&&sne(p,I,N)),h.beginPath();const q=!!l.pathSegment(h,L);let ne;if(j){q?h.closePath():E7e(h,d,N,p);const ie=!!d.pathSegment(h,A,{move:q,reverse:!0});ne=q&&ie,ne||E7e(h,d,I,p)}h.closePath(),h.fill(ne?"evenodd":"nonzero"),h.restore()}}function USt(h,c,l){const{top:d,bottom:p}=c.chart.chartArea,{property:m,start:v,end:C}=l||{};m==="x"&&(h.beginPath(),h.rect(v,d,C-v,p-d),h.clip())}function E7e(h,c,l,d){const p=c.interpolate(l,d);p&&h.lineTo(p.x,p.y)}var qSt={id:"filler",afterDatasetsUpdate(h,c,l){const d=(h.data.datasets||[]).length,p=[];let m,v,C,L;for(v=0;v<d;++v)m=h.getDatasetMeta(v),C=m.dataset,L=null,C&&C.options&&C instanceof T4&&(L={visible:h.isDatasetVisible(v),index:v,fill:ASt(C,v,d),chart:h,axis:m.controller.options.indexAxis,scale:m.vScale,line:C}),m.$filler=L,p.push(L);for(v=0;v<d;++v)L=p[v],!(!L||L.fill===!1)&&(L.fill=ISt(p,v,l.propagate))},beforeDraw(h,c,l){const d=l.drawTime==="beforeDraw",p=h.getSortedVisibleDatasetMetas(),m=h.chartArea;for(let v=p.length-1;v>=0;--v){const C=p[v].$filler;C&&(C.line.updateControlPoints(m,C.axis),d&&C.fill&&cne(h.ctx,C,m))}},beforeDatasetsDraw(h,c,l){if(l.drawTime!=="beforeDatasetsDraw")return;const d=h.getSortedVisibleDatasetMetas();for(let p=d.length-1;p>=0;--p){const m=d[p].$filler;S7e(m)&&cne(h.ctx,m,h.chartArea)}},beforeDatasetDraw(h,c,l){const d=c.meta.$filler;!S7e(d)||l.drawTime!=="beforeDatasetDraw"||cne(h.ctx,d,h.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const $7e=(h,c)=>{let{boxHeight:l=c,boxWidth:d=c}=h;return h.usePointStyle&&(l=Math.min(l,c),d=h.pointStyleWidth||Math.min(d,c)),{boxWidth:d,boxHeight:l,itemHeight:Math.max(c,l)}},GSt=(h,c)=>h!==null&&c!==null&&h.datasetIndex===c.datasetIndex&&h.index===c.index;class N7e extends cm{constructor(c){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=c.chart,this.options=c.options,this.ctx=c.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(c,l,d){this.maxWidth=c,this.maxHeight=l,this._margins=d,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const c=this.options.labels||{};let l=dl(c.generateLabels,[this.chart],this)||[];c.filter&&(l=l.filter(d=>c.filter(d,this.chart.data))),c.sort&&(l=l.sort((d,p)=>c.sort(d,p,this.chart.data))),this.options.reverse&&l.reverse(),this.legendItems=l}fit(){const{options:c,ctx:l}=this;if(!c.display){this.width=this.height=0;return}const d=c.labels,p=sh(d.font),m=p.size,v=this._computeTitleHeight(),{boxWidth:C,itemHeight:L}=$7e(d,m);let A,I;l.font=p.string,this.isHorizontal()?(A=this.maxWidth,I=this._fitRows(v,m,C,L)+10):(I=this.maxHeight,A=this._fitCols(v,p,C,L)+10),this.width=Math.min(A,c.maxWidth||this.maxWidth),this.height=Math.min(I,c.maxHeight||this.maxHeight)}_fitRows(c,l,d,p){const{ctx:m,maxWidth:v,options:{labels:{padding:C}}}=this,L=this.legendHitBoxes=[],A=this.lineWidths=[0],I=p+C;let N=c;m.textAlign="left",m.textBaseline="middle";let O=-1,j=-I;return this.legendItems.forEach((q,ne)=>{const ie=d+l/2+m.measureText(q.text).width;(ne===0||A[A.length-1]+ie+2*C>v)&&(N+=I,A[A.length-(ne>0?0:1)]=0,j+=I,O++),L[ne]={left:0,top:j,row:O,width:ie,height:p},A[A.length-1]+=ie+C}),N}_fitCols(c,l,d,p){const{ctx:m,maxHeight:v,options:{labels:{padding:C}}}=this,L=this.legendHitBoxes=[],A=this.columnSizes=[],I=v-c;let N=C,O=0,j=0,q=0,ne=0;return this.legendItems.forEach((ie,re)=>{const{itemWidth:te,itemHeight:X}=KSt(d,l,m,ie,p);re>0&&j+X+2*C>I&&(N+=O+C,A.push({width:O,height:j}),q+=O+C,ne++,O=j=0),L[re]={left:q,top:j,col:ne,width:te,height:X},O=Math.max(O,te),j+=X+C}),N+=O,A.push({width:O,height:j}),N}adjustHitBoxes(){if(!this.options.display)return;const c=this._computeTitleHeight(),{legendHitBoxes:l,options:{align:d,labels:{padding:p},rtl:m}}=this,v=wM(m,this.left,this.width);if(this.isHorizontal()){let C=0,L=Zf(d,this.left+p,this.right-this.lineWidths[C]);for(const A of l)C!==A.row&&(C=A.row,L=Zf(d,this.left+p,this.right-this.lineWidths[C])),A.top+=this.top+c+p,A.left=v.leftForLtr(v.x(L),A.width),L+=A.width+p}else{let C=0,L=Zf(d,this.top+c+p,this.bottom-this.columnSizes[C].height);for(const A of l)A.col!==C&&(C=A.col,L=Zf(d,this.top+c+p,this.bottom-this.columnSizes[C].height)),A.top=L,A.left+=this.left+p,A.left=v.leftForLtr(v.x(A.left),A.width),L+=A.height+p}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const c=this.ctx;$F(c,this),this._draw(),NF(c)}}_draw(){const{options:c,columnSizes:l,lineWidths:d,ctx:p}=this,{align:m,labels:v}=c,C=Bl.color,L=wM(c.rtl,this.left,this.width),A=sh(v.font),{padding:I}=v,N=A.size,O=N/2;let j;this.drawTitle(),p.textAlign=L.textAlign("left"),p.textBaseline="middle",p.lineWidth=.5,p.font=A.string;const{boxWidth:q,boxHeight:ne,itemHeight:ie}=$7e(v,N),re=function(Le,he,Ce){if(isNaN(q)||q<=0||isNaN(ne)||ne<0)return;p.save();const G=vs(Ce.lineWidth,1);if(p.fillStyle=vs(Ce.fillStyle,C),p.lineCap=vs(Ce.lineCap,"butt"),p.lineDashOffset=vs(Ce.lineDashOffset,0),p.lineJoin=vs(Ce.lineJoin,"miter"),p.lineWidth=G,p.strokeStyle=vs(Ce.strokeStyle,C),p.setLineDash(vs(Ce.lineDash,[])),v.usePointStyle){const kt={radius:ne*Math.SQRT2/2,pointStyle:Ce.pointStyle,rotation:Ce.rotation,borderWidth:G},Fe=L.xPlus(Le,q/2),Ke=he+O;l9e(p,kt,Fe,Ke,v.pointStyleWidth&&q)}else{const kt=he+Math.max((N-ne)/2,0),Fe=L.leftForLtr(Le,q),Ke=M8(Ce.borderRadius);p.beginPath(),Object.values(Ke).some(yt=>yt!==0)?cE(p,{x:Fe,y:kt,w:q,h:ne,radius:Ke}):p.rect(Fe,kt,q,ne),p.fill(),G!==0&&p.stroke()}p.restore()},te=function(Le,he,Ce){C8(p,Ce.text,Le,he+ie/2,A,{strikethrough:Ce.hidden,textAlign:L.textAlign(Ce.textAlign)})},X=this.isHorizontal(),Z=this._computeTitleHeight();X?j={x:Zf(m,this.left+I,this.right-d[0]),y:this.top+I+Z,line:0}:j={x:this.left+I,y:Zf(m,this.top+Z+I,this.bottom-l[0].height),line:0},y9e(this.ctx,c.textDirection);const le=ie+I;this.legendItems.forEach((Le,he)=>{p.strokeStyle=Le.fontColor,p.fillStyle=Le.fontColor;const Ce=p.measureText(Le.text).width,G=L.textAlign(Le.textAlign||(Le.textAlign=v.textAlign)),kt=q+O+Ce;let Fe=j.x,Ke=j.y;L.setWidth(this.width),X?he>0&&Fe+kt+I>this.right&&(Ke=j.y+=le,j.line++,Fe=j.x=Zf(m,this.left+I,this.right-d[j.line])):he>0&&Ke+le>this.bottom&&(Fe=j.x=Fe+l[j.line].width+I,j.line++,Ke=j.y=Zf(m,this.top+Z+I,this.bottom-l[j.line].height));const yt=L.x(Fe);if(re(yt,Ke,Le),Fe=fCt(G,Fe+q+O,X?Fe+kt:this.right,c.rtl),te(L.x(Fe),Ke,Le),X)j.x+=kt+I;else if(typeof Le.text!="string"){const Tt=A.lineHeight;j.y+=D7e(Le,Tt)+I}else j.y+=le}),x9e(this.ctx,c.textDirection)}drawTitle(){const c=this.options,l=c.title,d=sh(l.font),p=Xf(l.padding);if(!l.display)return;const m=wM(c.rtl,this.left,this.width),v=this.ctx,C=l.position,L=d.size/2,A=p.top+L;let I,N=this.left,O=this.width;if(this.isHorizontal())O=Math.max(...this.lineWidths),I=this.top+A,N=Zf(c.align,N,this.right-O);else{const q=this.columnSizes.reduce((ne,ie)=>Math.max(ne,ie.height),0);I=A+Zf(c.align,this.top,this.bottom-q-c.labels.padding-this._computeTitleHeight())}const j=Zf(C,N,N+O);v.textAlign=m.textAlign(Nte(C)),v.textBaseline="middle",v.strokeStyle=l.color,v.fillStyle=l.color,v.font=d.string,C8(v,l.text,j,I,d)}_computeTitleHeight(){const c=this.options.title,l=sh(c.font),d=Xf(c.padding);return c.display?l.lineHeight+d.height:0}_getLegendItemAt(c,l){let d,p,m;if(uv(c,this.left,this.right)&&uv(l,this.top,this.bottom)){for(m=this.legendHitBoxes,d=0;d<m.length;++d)if(p=m[d],uv(c,p.left,p.left+p.width)&&uv(l,p.top,p.top+p.height))return this.legendItems[d]}return null}handleEvent(c){const l=this.options;if(!YSt(c.type,l))return;const d=this._getLegendItemAt(c.x,c.y);if(c.type==="mousemove"||c.type==="mouseout"){const p=this._hoveredItem,m=GSt(p,d);p&&!m&&dl(l.onLeave,[c,p,this],this),this._hoveredItem=d,d&&!m&&dl(l.onHover,[c,d,this],this)}else d&&dl(l.onClick,[c,d,this],this)}}function KSt(h,c,l,d,p){const m=WSt(d,h,c,l),v=VSt(p,d,c.lineHeight);return{itemWidth:m,itemHeight:v}}function WSt(h,c,l,d){let p=h.text;return p&&typeof p!="string"&&(p=p.reduce((m,v)=>m.length>v.length?m:v)),c+l.size/2+d.measureText(p).width}function VSt(h,c,l){let d=h;return typeof c.text!="string"&&(d=D7e(c,l)),d}function D7e(h,c){const l=h.text?h.text.length:0;return c*l}function YSt(h,c){return!!((h==="mousemove"||h==="mouseout")&&(c.onHover||c.onLeave)||c.onClick&&(h==="click"||h==="mouseup"))}var ZSt={id:"legend",_element:N7e,start(h,c,l){const d=h.legend=new N7e({ctx:h.ctx,options:l,chart:h});Qf.configure(h,d,l),Qf.addBox(h,d)},stop(h){Qf.removeBox(h,h.legend),delete h.legend},beforeUpdate(h,c,l){const d=h.legend;Qf.configure(h,d,l),d.options=l},afterUpdate(h){const c=h.legend;c.buildLabels(),c.adjustHitBoxes()},afterEvent(h,c){c.replay||h.legend.handleEvent(c.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(h,c,l){const d=c.datasetIndex,p=l.chart;p.isDatasetVisible(d)?(p.hide(d),c.hidden=!0):(p.show(d),c.hidden=!1)},onHover:null,onLeave:null,labels:{color:h=>h.chart.options.color,boxWidth:40,padding:10,generateLabels(h){const c=h.data.datasets,{labels:{usePointStyle:l,pointStyle:d,textAlign:p,color:m,useBorderRadius:v,borderRadius:C}}=h.legend.options;return h._getSortedDatasetMetas().map(L=>{const A=L.controller.getStyle(l?0:void 0),I=Xf(A.borderWidth);return{text:c[L.index].label,fillStyle:A.backgroundColor,fontColor:m,hidden:!L.visible,lineCap:A.borderCapStyle,lineDash:A.borderDash,lineDashOffset:A.borderDashOffset,lineJoin:A.borderJoinStyle,lineWidth:(I.width+I.height)/4,strokeStyle:A.borderColor,pointStyle:d||A.pointStyle,rotation:A.rotation,textAlign:p||A.textAlign,borderRadius:v&&(C||A.borderRadius),datasetIndex:L.index}},this)}},title:{color:h=>h.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:h=>!h.startsWith("on"),labels:{_scriptable:h=>!["generateLabels","filter","sort"].includes(h)}}};class lne extends cm{constructor(c){super(),this.chart=c.chart,this.options=c.options,this.ctx=c.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(c,l){const d=this.options;if(this.left=0,this.top=0,!d.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=c,this.height=this.bottom=l;const p=Rl(d.text)?d.text.length:1;this._padding=Xf(d.padding);const m=p*sh(d.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=m:this.width=m}isHorizontal(){const c=this.options.position;return c==="top"||c==="bottom"}_drawArgs(c){const{top:l,left:d,bottom:p,right:m,options:v}=this,C=v.align;let L=0,A,I,N;return this.isHorizontal()?(I=Zf(C,d,m),N=l+c,A=m-d):(v.position==="left"?(I=d+c,N=Zf(C,p,l),L=Il*-.5):(I=m-c,N=Zf(C,l,p),L=Il*.5),A=p-l),{titleX:I,titleY:N,maxWidth:A,rotation:L}}draw(){const c=this.ctx,l=this.options;if(!l.display)return;const d=sh(l.font),m=d.lineHeight/2+this._padding.top,{titleX:v,titleY:C,maxWidth:L,rotation:A}=this._drawArgs(m);C8(c,l.text,0,0,d,{color:l.color,maxWidth:L,rotation:A,textAlign:Nte(l.align),textBaseline:"middle",translation:[v,C]})}}function XSt(h,c){const l=new lne({ctx:h.ctx,options:c,chart:h});Qf.configure(h,l,c),Qf.addBox(h,l),h.titleBlock=l}var QSt={id:"title",_element:lne,start(h,c,l){XSt(h,l)},stop(h){const c=h.titleBlock;Qf.removeBox(h,c),delete h.titleBlock},beforeUpdate(h,c,l){const d=h.titleBlock;Qf.configure(h,d,l),d.options=l},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const JF=new WeakMap;var JSt={id:"subtitle",start(h,c,l){const d=new lne({ctx:h.ctx,options:l,chart:h});Qf.configure(h,d,l),Qf.addBox(h,d),JF.set(h,d)},stop(h){Qf.removeBox(h,JF.get(h)),JF.delete(h)},beforeUpdate(h,c,l){const d=JF.get(h);Qf.configure(h,d,l),d.options=l},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const vE={average(h){if(!h.length)return!1;let c,l,d=new Set,p=0,m=0;for(c=0,l=h.length;c<l;++c){const C=h[c].element;if(C&&C.hasValue()){const L=C.tooltipPosition();d.add(L.x),p+=L.y,++m}}return m===0||d.size===0?!1:{x:[...d].reduce((C,L)=>C+L)/d.size,y:p/m}},nearest(h,c){if(!h.length)return!1;let l=c.x,d=c.y,p=Number.POSITIVE_INFINITY,m,v,C;for(m=0,v=h.length;m<v;++m){const L=h[m].element;if(L&&L.hasValue()){const A=L.getCenterPoint(),I=Ete(c,A);I<p&&(p=I,C=L)}}if(C){const L=C.tooltipPosition();l=L.x,d=L.y}return{x:l,y:d}}};function tw(h,c){return c&&(Rl(c)?Array.prototype.push.apply(h,c):h.push(c)),h}function pv(h){return(typeof h=="string"||h instanceof String)&&h.indexOf(`
|
|
11773
11773
|
`)>-1?h.split(`
|
|
11774
|
-
`):h}function eIt(h,c){const{element:l,datasetIndex:d,index:p}=c,m=h.getDatasetMeta(d).controller,{label:v,value:C}=m.getLabelAndValue(p);return{chart:h,label:v,parsed:m.getParsed(p),raw:h.data.datasets[d].data[p],formattedValue:C,dataset:m.getDataset(),dataIndex:p,datasetIndex:d,element:l}}function T7e(h,c){const l=h.chart.ctx,{body:d,footer:p,title:m}=h,{boxWidth:v,boxHeight:C}=c,L=sh(c.bodyFont),A=sh(c.titleFont),I=sh(c.footerFont),N=m.length,O=p.length,j=d.length,q=Xf(c.padding);let ne=q.height,ie=0,re=d.reduce((Z,le)=>Z+le.before.length+le.lines.length+le.after.length,0);if(re+=h.beforeBody.length+h.afterBody.length,N&&(ne+=N*A.lineHeight+(N-1)*c.titleSpacing+c.titleMarginBottom),re){const Z=c.displayColors?Math.max(C,L.lineHeight):L.lineHeight;ne+=j*Z+(re-j)*L.lineHeight+(re-1)*c.bodySpacing}O&&(ne+=c.footerMarginTop+O*I.lineHeight+(O-1)*c.footerSpacing);let te=0;const X=function(Z){ie=Math.max(ie,l.measureText(Z).width+te)};return l.save(),l.font=A.string,Mc(h.title,X),l.font=L.string,Mc(h.beforeBody.concat(h.afterBody),X),te=c.displayColors?v+2+c.boxPadding:0,Mc(d,Z=>{Mc(Z.before,X),Mc(Z.lines,X),Mc(Z.after,X)}),te=0,l.font=I.string,Mc(h.footer,X),l.restore(),ie+=q.width,{width:ie,height:ne}}function tIt(h,c){const{y:l,height:d}=c;return l<d/2?"top":l>h.height-d/2?"bottom":"center"}function nIt(h,c,l,d){const{x:p,width:m}=d,v=l.caretSize+l.caretPadding;if(h==="left"&&p+m+v>c.width||h==="right"&&p-m-v<0)return!0}function iIt(h,c,l,d){const{x:p,width:m}=l,{width:v,chartArea:{left:C,right:L}}=h;let A="center";return d==="center"?A=p<=(C+L)/2?"left":"right":p<=m/2?A="left":p>=v-m/2&&(A="right"),nIt(A,h,c,l)&&(A="center"),A}function O7e(h,c,l){const d=l.yAlign||c.yAlign||tIt(h,l);return{xAlign:l.xAlign||c.xAlign||iIt(h,c,l,d),yAlign:d}}function rIt(h,c){let{x:l,width:d}=h;return c==="right"?l-=d:c==="center"&&(l-=d/2),l}function sIt(h,c,l){let{y:d,height:p}=h;return c==="top"?d+=l:c==="bottom"?d-=p+l:d-=p/2,d}function j7e(h,c,l,d){const{caretSize:p,caretPadding:m,cornerRadius:v}=h,{xAlign:C,yAlign:L}=l,A=p+m,{topLeft:I,topRight:N,bottomLeft:O,bottomRight:j}=M8(v);let q=rIt(c,C);const ne=sIt(c,L,A);return L==="center"?C==="left"?q+=A:C==="right"&&(q-=A):C==="left"?q-=Math.max(I,O)+p:C==="right"&&(q+=Math.max(N,j)+p),{x:_h(q,0,d.width-c.width),y:_h(ne,0,d.height-c.height)}}function ez(h,c,l){const d=Xf(l.padding);return c==="center"?h.x+h.width/2:c==="right"?h.x+h.width-d.right:h.x+d.left}function _7e(h){return tw([],pv(h))}function oIt(h,c,l){return D4(h,{tooltip:c,tooltipItems:l,type:"tooltip"})}function R7e(h,c){const l=c&&c.dataset&&c.dataset.tooltip&&c.dataset.tooltip.callbacks;return l?h.override(l):h}const B7e={beforeTitle:av,title(h){if(h.length>0){const c=h[0],l=c.chart.data.labels,d=l?l.length:0;if(this&&this.options&&this.options.mode==="dataset")return c.dataset.label||"";if(c.label)return c.label;if(d>0&&c.dataIndex<d)return l[c.dataIndex]}return""},afterTitle:av,beforeBody:av,beforeLabel:av,label(h){if(this&&this.options&&this.options.mode==="dataset")return h.label+": "+h.formattedValue||h.formattedValue;let c=h.dataset.label||"";c&&(c+=": ");const l=h.formattedValue;return ao(l)||(c+=l),c},labelColor(h){const l=h.chart.getDatasetMeta(h.datasetIndex).controller.getStyle(h.dataIndex);return{borderColor:l.borderColor,backgroundColor:l.backgroundColor,borderWidth:l.borderWidth,borderDash:l.borderDash,borderDashOffset:l.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(h){const l=h.chart.getDatasetMeta(h.datasetIndex).controller.getStyle(h.dataIndex);return{pointStyle:l.pointStyle,rotation:l.rotation}},afterLabel:av,afterBody:av,beforeFooter:av,footer:av,afterFooter:av};function j1(h,c,l,d){const p=h[c].call(l,d);return typeof p>"u"?B7e[c].call(l,d):p}class ane extends cm{constructor(c){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=c.chart,this.options=c.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(c){this.options=c,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const c=this._cachedAnimations;if(c)return c;const l=this.chart,d=this.options.setContext(this.getContext()),p=d.enabled&&l.options.animation&&d.animations,m=new P9e(this.chart,p);return p._cacheable&&(this._cachedAnimations=Object.freeze(m)),m}getContext(){return this.$context||(this.$context=oIt(this.chart.getContext(),this,this._tooltipItems))}getTitle(c,l){const{callbacks:d}=l,p=j1(d,"beforeTitle",this,c),m=j1(d,"title",this,c),v=j1(d,"afterTitle",this,c);let C=[];return C=tw(C,pv(p)),C=tw(C,pv(m)),C=tw(C,pv(v)),C}getBeforeBody(c,l){return _7e(j1(l.callbacks,"beforeBody",this,c))}getBody(c,l){const{callbacks:d}=l,p=[];return Mc(c,m=>{const v={before:[],lines:[],after:[]},C=R7e(d,m);tw(v.before,pv(j1(C,"beforeLabel",this,m))),tw(v.lines,j1(C,"label",this,m)),tw(v.after,pv(j1(C,"afterLabel",this,m))),p.push(v)}),p}getAfterBody(c,l){return _7e(j1(l.callbacks,"afterBody",this,c))}getFooter(c,l){const{callbacks:d}=l,p=j1(d,"beforeFooter",this,c),m=j1(d,"footer",this,c),v=j1(d,"afterFooter",this,c);let C=[];return C=tw(C,pv(p)),C=tw(C,pv(m)),C=tw(C,pv(v)),C}_createItems(c){const l=this._active,d=this.chart.data,p=[],m=[],v=[];let C=[],L,A;for(L=0,A=l.length;L<A;++L)C.push(eIt(this.chart,l[L]));return c.filter&&(C=C.filter((I,N,O)=>c.filter(I,N,O,d))),c.itemSort&&(C=C.sort((I,N)=>c.itemSort(I,N,d))),Mc(C,I=>{const N=R7e(c.callbacks,I);p.push(j1(N,"labelColor",this,I)),m.push(j1(N,"labelPointStyle",this,I)),v.push(j1(N,"labelTextColor",this,I))}),this.labelColors=p,this.labelPointStyles=m,this.labelTextColors=v,this.dataPoints=C,C}update(c,l){const d=this.options.setContext(this.getContext()),p=this._active;let m,v=[];if(!p.length)this.opacity!==0&&(m={opacity:0});else{const C=vE[d.position].call(this,p,this._eventPosition);v=this._createItems(d),this.title=this.getTitle(v,d),this.beforeBody=this.getBeforeBody(v,d),this.body=this.getBody(v,d),this.afterBody=this.getAfterBody(v,d),this.footer=this.getFooter(v,d);const L=this._size=T7e(this,d),A=Object.assign({},C,L),I=O7e(this.chart,d,A),N=j7e(d,A,I,this.chart);this.xAlign=I.xAlign,this.yAlign=I.yAlign,m={opacity:1,x:N.x,y:N.y,width:L.width,height:L.height,caretX:C.x,caretY:C.y}}this._tooltipItems=v,this.$context=void 0,m&&this._resolveAnimations().update(this,m),c&&d.external&&d.external.call(this,{chart:this.chart,tooltip:this,replay:l})}drawCaret(c,l,d,p){const m=this.getCaretPosition(c,d,p);l.lineTo(m.x1,m.y1),l.lineTo(m.x2,m.y2),l.lineTo(m.x3,m.y3)}getCaretPosition(c,l,d){const{xAlign:p,yAlign:m}=this,{caretSize:v,cornerRadius:C}=d,{topLeft:L,topRight:A,bottomLeft:I,bottomRight:N}=M8(C),{x:O,y:j}=c,{width:q,height:ne}=l;let ie,re,te,X,Z,le;return m==="center"?(Z=j+ne/2,p==="left"?(ie=O,re=ie-v,X=Z+v,le=Z-v):(ie=O+q,re=ie+v,X=Z-v,le=Z+v),te=ie):(p==="left"?re=O+Math.max(L,I)+v:p==="right"?re=O+q-Math.max(A,N)-v:re=this.caretX,m==="top"?(X=j,Z=X-v,ie=re-v,te=re+v):(X=j+ne,Z=X+v,ie=re+v,te=re-v),le=X),{x1:ie,x2:re,x3:te,y1:X,y2:Z,y3:le}}drawTitle(c,l,d){const p=this.title,m=p.length;let v,C,L;if(m){const A=wM(d.rtl,this.x,this.width);for(c.x=ez(this,d.titleAlign,d),l.textAlign=A.textAlign(d.titleAlign),l.textBaseline="middle",v=sh(d.titleFont),C=d.titleSpacing,l.fillStyle=d.titleColor,l.font=v.string,L=0;L<m;++L)l.fillText(p[L],A.x(c.x),c.y+v.lineHeight/2),c.y+=v.lineHeight+C,L+1===m&&(c.y+=d.titleMarginBottom-C)}}_drawColorBox(c,l,d,p,m){const v=this.labelColors[d],C=this.labelPointStyles[d],{boxHeight:L,boxWidth:A}=m,I=sh(m.bodyFont),N=ez(this,"left",m),O=p.x(N),j=L<I.lineHeight?(I.lineHeight-L)/2:0,q=l.y+j;if(m.usePointStyle){const ne={radius:Math.min(A,L)/2,pointStyle:C.pointStyle,rotation:C.rotation,borderWidth:1},ie=p.leftForLtr(O,A)+A/2,re=q+L/2;c.strokeStyle=m.multiKeyBackground,c.fillStyle=m.multiKeyBackground,_te(c,ne,ie,re),c.strokeStyle=v.borderColor,c.fillStyle=v.backgroundColor,_te(c,ne,ie,re)}else{c.lineWidth=yo(v.borderWidth)?Math.max(...Object.values(v.borderWidth)):v.borderWidth||1,c.strokeStyle=v.borderColor,c.setLineDash(v.borderDash||[]),c.lineDashOffset=v.borderDashOffset||0;const ne=p.leftForLtr(O,A),ie=p.leftForLtr(p.xPlus(O,1),A-2),re=M8(v.borderRadius);Object.values(re).some(te=>te!==0)?(c.beginPath(),c.fillStyle=m.multiKeyBackground,cE(c,{x:ne,y:q,w:A,h:L,radius:re}),c.fill(),c.stroke(),c.fillStyle=v.backgroundColor,c.beginPath(),cE(c,{x:ie,y:q+1,w:A-2,h:L-2,radius:re}),c.fill()):(c.fillStyle=m.multiKeyBackground,c.fillRect(ne,q,A,L),c.strokeRect(ne,q,A,L),c.fillStyle=v.backgroundColor,c.fillRect(ie,q+1,A-2,L-2))}c.fillStyle=this.labelTextColors[d]}drawBody(c,l,d){const{body:p}=this,{bodySpacing:m,bodyAlign:v,displayColors:C,boxHeight:L,boxWidth:A,boxPadding:I}=d,N=sh(d.bodyFont);let O=N.lineHeight,j=0;const q=wM(d.rtl,this.x,this.width),ne=function(Ce){l.fillText(Ce,q.x(c.x+j),c.y+O/2),c.y+=O+m},ie=q.textAlign(v);let re,te,X,Z,le,Le,he;for(l.textAlign=v,l.textBaseline="middle",l.font=N.string,c.x=ez(this,ie,d),l.fillStyle=d.bodyColor,Mc(this.beforeBody,ne),j=C&&ie!=="right"?v==="center"?A/2+I:A+2+I:0,Z=0,Le=p.length;Z<Le;++Z){for(re=p[Z],te=this.labelTextColors[Z],l.fillStyle=te,Mc(re.before,ne),X=re.lines,C&&X.length&&(this._drawColorBox(l,c,Z,q,d),O=Math.max(N.lineHeight,L)),le=0,he=X.length;le<he;++le)ne(X[le]),O=N.lineHeight;Mc(re.after,ne)}j=0,O=N.lineHeight,Mc(this.afterBody,ne),c.y-=m}drawFooter(c,l,d){const p=this.footer,m=p.length;let v,C;if(m){const L=wM(d.rtl,this.x,this.width);for(c.x=ez(this,d.footerAlign,d),c.y+=d.footerMarginTop,l.textAlign=L.textAlign(d.footerAlign),l.textBaseline="middle",v=sh(d.footerFont),l.fillStyle=d.footerColor,l.font=v.string,C=0;C<m;++C)l.fillText(p[C],L.x(c.x),c.y+v.lineHeight/2),c.y+=v.lineHeight+d.footerSpacing}}drawBackground(c,l,d,p){const{xAlign:m,yAlign:v}=this,{x:C,y:L}=c,{width:A,height:I}=d,{topLeft:N,topRight:O,bottomLeft:j,bottomRight:q}=M8(p.cornerRadius);l.fillStyle=p.backgroundColor,l.strokeStyle=p.borderColor,l.lineWidth=p.borderWidth,l.beginPath(),l.moveTo(C+N,L),v==="top"&&this.drawCaret(c,l,d,p),l.lineTo(C+A-O,L),l.quadraticCurveTo(C+A,L,C+A,L+O),v==="center"&&m==="right"&&this.drawCaret(c,l,d,p),l.lineTo(C+A,L+I-q),l.quadraticCurveTo(C+A,L+I,C+A-q,L+I),v==="bottom"&&this.drawCaret(c,l,d,p),l.lineTo(C+j,L+I),l.quadraticCurveTo(C,L+I,C,L+I-j),v==="center"&&m==="left"&&this.drawCaret(c,l,d,p),l.lineTo(C,L+N),l.quadraticCurveTo(C,L,C+N,L),l.closePath(),l.fill(),p.borderWidth>0&&l.stroke()}_updateAnimationTarget(c){const l=this.chart,d=this.$animations,p=d&&d.x,m=d&&d.y;if(p||m){const v=vE[c.position].call(this,this._active,this._eventPosition);if(!v)return;const C=this._size=T7e(this,c),L=Object.assign({},v,this._size),A=O7e(l,c,L),I=j7e(c,L,A,l);(p._to!==I.x||m._to!==I.y)&&(this.xAlign=A.xAlign,this.yAlign=A.yAlign,this.width=C.width,this.height=C.height,this.caretX=v.x,this.caretY=v.y,this._resolveAnimations().update(this,I))}}_willRender(){return!!this.opacity}draw(c){const l=this.options.setContext(this.getContext());let d=this.opacity;if(!d)return;this._updateAnimationTarget(l);const p={width:this.width,height:this.height},m={x:this.x,y:this.y};d=Math.abs(d)<.001?0:d;const v=Xf(l.padding),C=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;l.enabled&&C&&(c.save(),c.globalAlpha=d,this.drawBackground(m,c,p,l),y9e(c,l.textDirection),m.y+=v.top,this.drawTitle(m,c,l),this.drawBody(m,c,l),this.drawFooter(m,c,l),x9e(c,l.textDirection),c.restore())}getActiveElements(){return this._active||[]}setActiveElements(c,l){const d=this._active,p=c.map(({datasetIndex:C,index:L})=>{const A=this.chart.getDatasetMeta(C);if(!A)throw new Error("Cannot find a dataset at index "+C);return{datasetIndex:C,element:A.data[L],index:L}}),m=!LF(d,p),v=this._positionChanged(p,l);(m||v)&&(this._active=p,this._eventPosition=l,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(c,l,d=!0){if(l&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const p=this.options,m=this._active||[],v=this._getActiveElements(c,m,l,d),C=this._positionChanged(v,c),L=l||!LF(v,m)||C;return L&&(this._active=v,(p.enabled||p.external)&&(this._eventPosition={x:c.x,y:c.y},this.update(!0,l))),L}_getActiveElements(c,l,d,p){const m=this.options;if(c.type==="mouseout")return[];if(!p)return l.filter(C=>this.chart.data.datasets[C.datasetIndex]&&this.chart.getDatasetMeta(C.datasetIndex).controller.getParsed(C.index)!==void 0);const v=this.chart.getElementsAtEventForMode(c,m.mode,m,d);return m.reverse&&v.reverse(),v}_positionChanged(c,l){const{caretX:d,caretY:p,options:m}=this,v=vE[m.position].call(this,c,l);return v!==!1&&(d!==v.x||p!==v.y)}}en(ane,"positioners",vE);var cIt={id:"tooltip",_element:ane,positioners:vE,afterInit(h,c,l){l&&(h.tooltip=new ane({chart:h,options:l}))},beforeUpdate(h,c,l){h.tooltip&&h.tooltip.initialize(l)},reset(h,c,l){h.tooltip&&h.tooltip.initialize(l)},afterDraw(h){const c=h.tooltip;if(c&&c._willRender()){const l={tooltip:c};if(h.notifyPlugins("beforeTooltipDraw",{...l,cancelable:!0})===!1)return;c.draw(h.ctx),h.notifyPlugins("afterTooltipDraw",l)}},afterEvent(h,c){if(h.tooltip){const l=c.replay;h.tooltip.handleEvent(c.event,l,c.inChartArea)&&(c.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:(h,c)=>c.bodyFont.size,boxWidth:(h,c)=>c.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:B7e},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:h=>h!=="filter"&&h!=="itemSort"&&h!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},lIt=Object.freeze({__proto__:null,Colors:ySt,Decimation:MSt,Filler:qSt,Legend:ZSt,SubTitle:JSt,Title:QSt,Tooltip:cIt});const aIt=(h,c,l,d)=>(typeof c=="string"?(l=h.push(c)-1,d.unshift({index:l,label:c})):isNaN(c)&&(l=null),l);function uIt(h,c,l,d){const p=h.indexOf(c);if(p===-1)return aIt(h,c,l,d);const m=h.lastIndexOf(c);return p!==m?l:p}const hIt=(h,c)=>h===null?null:_h(Math.round(h),0,c);function F7e(h){const c=this.getLabels();return h>=0&&h<c.length?c[h]:h}class une extends E8{constructor(c){super(c),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(c){const l=this._addedLabels;if(l.length){const d=this.getLabels();for(const{index:p,label:m}of l)d[p]===m&&d.splice(p,1);this._addedLabels=[]}super.init(c)}parse(c,l){if(ao(c))return null;const d=this.getLabels();return l=isFinite(l)&&d[l]===c?l:uIt(d,c,vs(l,c),this._addedLabels),hIt(l,d.length-1)}determineDataLimits(){const{minDefined:c,maxDefined:l}=this.getUserBounds();let{min:d,max:p}=this.getMinMax(!0);this.options.bounds==="ticks"&&(c||(d=0),l||(p=this.getLabels().length-1)),this.min=d,this.max=p}buildTicks(){const c=this.min,l=this.max,d=this.options.offset,p=[];let m=this.getLabels();m=c===0&&l===m.length-1?m:m.slice(c,l+1),this._valueRange=Math.max(m.length-(d?0:1),1),this._startValue=this.min-(d?.5:0);for(let v=c;v<=l;v++)p.push({value:v});return p}getLabelForValue(c){return F7e.call(this,c)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(c){return typeof c!="number"&&(c=this.parse(c)),c===null?NaN:this.getPixelForDecimal((c-this._startValue)/this._valueRange)}getPixelForTick(c){const l=this.ticks;return c<0||c>l.length-1?null:this.getPixelForValue(l[c].value)}getValueForPixel(c){return Math.round(this._startValue+this.getDecimalForPixel(c)*this._valueRange)}getBasePixel(){return this.bottom}}en(une,"id","category"),en(une,"defaults",{ticks:{callback:F7e}});function fIt(h,c){const l=[],{bounds:p,step:m,min:v,max:C,precision:L,count:A,maxTicks:I,maxDigits:N,includeBounds:O}=h,j=m||1,q=I-1,{min:ne,max:ie}=c,re=!ao(v),te=!ao(C),X=!ao(A),Z=(ie-ne)/(N+1);let le=G8e((ie-ne)/q/j)*j,Le,he,Ce,G;if(le<1e-14&&!re&&!te)return[{value:ne},{value:ie}];G=Math.ceil(ie/le)-Math.floor(ne/le),G>q&&(le=G8e(G*le/q/j)*j),ao(L)||(Le=Math.pow(10,L),le=Math.ceil(le*Le)/Le),p==="ticks"?(he=Math.floor(ne/le)*le,Ce=Math.ceil(ie/le)*le):(he=ne,Ce=ie),re&&te&&m&&sCt((C-v)/m,le/1e3)?(G=Math.round(Math.min((C-v)/le,I)),le=(C-v)/G,he=v,Ce=C):X?(he=re?v:he,Ce=te?C:Ce,G=A-1,le=(Ce-he)/G):(G=(Ce-he)/le,nE(G,Math.round(G),le/1e3)?G=Math.round(G):G=Math.ceil(G));const kt=Math.max(W8e(le),W8e(he));Le=Math.pow(10,ao(L)?kt:L),he=Math.round(he*Le)/Le,Ce=Math.round(Ce*Le)/Le;let Fe=0;for(re&&(O&&he!==v?(l.push({value:v}),he<v&&Fe++,nE(Math.round((he+Fe*le)*Le)/Le,v,z7e(v,Z,h))&&Fe++):he<v&&Fe++);Fe<G;++Fe){const Ke=Math.round((he+Fe*le)*Le)/Le;if(te&&Ke>C)break;l.push({value:Ke})}return te&&O&&Ce!==C?l.length&&nE(l[l.length-1].value,C,z7e(C,Z,h))?l[l.length-1].value=C:l.push({value:C}):(!te||Ce===C)&&l.push({value:Ce}),l}function z7e(h,c,{horizontal:l,minRotation:d}){const p=sm(d),m=(l?Math.sin(p):Math.cos(p))||.001,v=.75*c*(""+h).length;return Math.min(c/m,v)}class tz extends E8{constructor(c){super(c),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(c,l){return ao(c)||(typeof c=="number"||c instanceof Number)&&!isFinite(+c)?null:+c}handleTickRangeOptions(){const{beginAtZero:c}=this.options,{minDefined:l,maxDefined:d}=this.getUserBounds();let{min:p,max:m}=this;const v=L=>p=l?p:L,C=L=>m=d?m:L;if(c){const L=Q2(p),A=Q2(m);L<0&&A<0?C(0):L>0&&A>0&&v(0)}if(p===m){let L=m===0?1:Math.abs(m*.05);C(m+L),c||v(p-L)}this.min=p,this.max=m}getTickLimit(){const c=this.options.ticks;let{maxTicksLimit:l,stepSize:d}=c,p;return d?(p=Math.ceil(this.max/d)-Math.floor(this.min/d)+1,p>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${d} would result generating up to ${p} ticks. Limiting to 1000.`),p=1e3)):(p=this.computeTickLimit(),l=l||11),l&&(p=Math.min(l,p)),p}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const c=this.options,l=c.ticks;let d=this.getTickLimit();d=Math.max(2,d);const p={maxTicks:d,bounds:c.bounds,min:c.min,max:c.max,precision:l.precision,step:l.stepSize,count:l.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:l.minRotation||0,includeBounds:l.includeBounds!==!1},m=this._range||this,v=fIt(p,m);return c.bounds==="ticks"&&K8e(v,this,"value"),c.reverse?(v.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),v}configure(){const c=this.ticks;let l=this.min,d=this.max;if(super.configure(),this.options.offset&&c.length){const p=(d-l)/Math.max(c.length-1,1)/2;l-=p,d+=p}this._startValue=l,this._endValue=d,this._valueRange=d-l}getLabelForValue(c){return sE(c,this.chart.options.locale,this.options.ticks.format)}}class hne extends tz{determineDataLimits(){const{min:c,max:l}=this.getMinMax(!0);this.min=ja(c)?c:0,this.max=ja(l)?l:1,this.handleTickRangeOptions()}computeTickLimit(){const c=this.isHorizontal(),l=c?this.width:this.height,d=sm(this.options.ticks.minRotation),p=(c?Math.sin(d):Math.cos(d))||.001,m=this._resolveTickFontOptions(0);return Math.ceil(l/Math.min(40,m.lineHeight/p))}getPixelForValue(c){return c===null?NaN:this.getPixelForDecimal((c-this._startValue)/this._valueRange)}getValueForPixel(c){return this._startValue+this.getDecimalForPixel(c)*this._valueRange}}en(hne,"id","linear"),en(hne,"defaults",{ticks:{callback:PF.formatters.numeric}});const yE=h=>Math.floor(N4(h)),$8=(h,c)=>Math.pow(10,yE(h)+c);function H7e(h){return h/Math.pow(10,yE(h))===1}function U7e(h,c,l){const d=Math.pow(10,l),p=Math.floor(h/d);return Math.ceil(c/d)-p}function dIt(h,c){const l=c-h;let d=yE(l);for(;U7e(h,c,d)>10;)d++;for(;U7e(h,c,d)<10;)d--;return Math.min(d,yE(h))}function pIt(h,{min:c,max:l}){c=Vp(h.min,c);const d=[],p=yE(c);let m=dIt(c,l),v=m<0?Math.pow(10,Math.abs(m)):1;const C=Math.pow(10,m),L=p>m?Math.pow(10,p):0,A=Math.round((c-L)*v)/v,I=Math.floor((c-L)/C/10)*C*10;let N=Math.floor((A-I)/Math.pow(10,m)),O=Vp(h.min,Math.round((L+I+N*Math.pow(10,m))*v)/v);for(;O<l;)d.push({value:O,major:H7e(O),significand:N}),N>=10?N=N<15?15:20:N++,N>=20&&(m++,N=2,v=m>=0?1:v),O=Math.round((L+I+N*Math.pow(10,m))*v)/v;const j=Vp(h.max,O);return d.push({value:j,major:H7e(j),significand:N}),d}class fne extends E8{constructor(c){super(c),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(c,l){const d=tz.prototype.parse.apply(this,[c,l]);if(d===0){this._zero=!0;return}return ja(d)&&d>0?d:null}determineDataLimits(){const{min:c,max:l}=this.getMinMax(!0);this.min=ja(c)?Math.max(0,c):null,this.max=ja(l)?Math.max(0,l):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!ja(this._userMin)&&(this.min=c===$8(this.min,0)?$8(this.min,-1):$8(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:c,maxDefined:l}=this.getUserBounds();let d=this.min,p=this.max;const m=C=>d=c?d:C,v=C=>p=l?p:C;d===p&&(d<=0?(m(1),v(10)):(m($8(d,-1)),v($8(p,1)))),d<=0&&m($8(p,-1)),p<=0&&v($8(d,1)),this.min=d,this.max=p}buildTicks(){const c=this.options,l={min:this._userMin,max:this._userMax},d=pIt(l,this);return c.bounds==="ticks"&&K8e(d,this,"value"),c.reverse?(d.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),d}getLabelForValue(c){return c===void 0?"0":sE(c,this.chart.options.locale,this.options.ticks.format)}configure(){const c=this.min;super.configure(),this._startValue=N4(c),this._valueRange=N4(this.max)-N4(c)}getPixelForValue(c){return(c===void 0||c===0)&&(c=this.min),c===null||isNaN(c)?NaN:this.getPixelForDecimal(c===this.min?0:(N4(c)-this._startValue)/this._valueRange)}getValueForPixel(c){const l=this.getDecimalForPixel(c);return Math.pow(10,this._startValue+l*this._valueRange)}}en(fne,"id","logarithmic"),en(fne,"defaults",{ticks:{callback:PF.formatters.logarithmic,major:{enabled:!0}}});function dne(h){const c=h.ticks;if(c.display&&h.display){const l=Xf(c.backdropPadding);return vs(c.font&&c.font.size,Bl.font.size)+l.height}return 0}function gIt(h,c,l){return l=Rl(l)?l:[l],{w:kCt(h,c.string,l),h:l.length*c.lineHeight}}function q7e(h,c,l,d,p){return h===d||h===p?{start:c-l/2,end:c+l/2}:h<d||h>p?{start:c-l,end:c}:{start:c,end:c+l}}function bIt(h){const c={l:h.left+h._padding.left,r:h.right-h._padding.right,t:h.top+h._padding.top,b:h.bottom-h._padding.bottom},l=Object.assign({},c),d=[],p=[],m=h._pointLabels.length,v=h.options.pointLabels,C=v.centerPointLabels?Il/m:0;for(let L=0;L<m;L++){const A=v.setContext(h.getPointLabelContext(L));p[L]=A.padding;const I=h.getPointPosition(L,h.drawingArea+p[L],C),N=sh(A.font),O=gIt(h.ctx,N,h._pointLabels[L]);d[L]=O;const j=Yp(h.getIndexAngle(L)+C),q=Math.round(Pte(j)),ne=q7e(q,I.x,O.w,0,180),ie=q7e(q,I.y,O.h,90,270);mIt(l,c,j,ne,ie)}h.setCenterPoint(c.l-l.l,l.r-c.r,c.t-l.t,l.b-c.b),h._pointLabelItems=yIt(h,d,p)}function mIt(h,c,l,d,p){const m=Math.abs(Math.sin(l)),v=Math.abs(Math.cos(l));let C=0,L=0;d.start<c.l?(C=(c.l-d.start)/m,h.l=Math.min(h.l,c.l-C)):d.end>c.r&&(C=(d.end-c.r)/m,h.r=Math.max(h.r,c.r+C)),p.start<c.t?(L=(c.t-p.start)/v,h.t=Math.min(h.t,c.t-L)):p.end>c.b&&(L=(p.end-c.b)/v,h.b=Math.max(h.b,c.b+L))}function wIt(h,c,l){const d=h.drawingArea,{extra:p,additionalAngle:m,padding:v,size:C}=l,L=h.getPointPosition(c,d+p+v,m),A=Math.round(Pte(Yp(L.angle+ou))),I=CIt(L.y,C.h,A),N=xIt(A),O=kIt(L.x,C.w,N);return{visible:!0,x:L.x,y:I,textAlign:N,left:O,top:I,right:O+C.w,bottom:I+C.h}}function vIt(h,c){if(!c)return!0;const{left:l,top:d,right:p,bottom:m}=h;return!(fv({x:l,y:d},c)||fv({x:l,y:m},c)||fv({x:p,y:d},c)||fv({x:p,y:m},c))}function yIt(h,c,l){const d=[],p=h._pointLabels.length,m=h.options,{centerPointLabels:v,display:C}=m.pointLabels,L={extra:dne(m)/2,additionalAngle:v?Il/p:0};let A;for(let I=0;I<p;I++){L.padding=l[I],L.size=c[I];const N=wIt(h,I,L);d.push(N),C==="auto"&&(N.visible=vIt(N,A),N.visible&&(A=N))}return d}function xIt(h){return h===0||h===180?"center":h<180?"left":"right"}function kIt(h,c,l){return l==="right"?h-=c:l==="center"&&(h-=c/2),h}function CIt(h,c,l){return l===90||l===270?h-=c/2:(l>270||l<90)&&(h-=c),h}function MIt(h,c,l){const{left:d,top:p,right:m,bottom:v}=l,{backdropColor:C}=c;if(!ao(C)){const L=M8(c.borderRadius),A=Xf(c.backdropPadding);h.fillStyle=C;const I=d-A.left,N=p-A.top,O=m-d+A.width,j=v-p+A.height;Object.values(L).some(q=>q!==0)?(h.beginPath(),cE(h,{x:I,y:N,w:O,h:j,radius:L}),h.fill()):h.fillRect(I,N,O,j)}}function LIt(h,c){const{ctx:l,options:{pointLabels:d}}=h;for(let p=c-1;p>=0;p--){const m=h._pointLabelItems[p];if(!m.visible)continue;const v=d.setContext(h.getPointLabelContext(p));MIt(l,v,m);const C=sh(v.font),{x:L,y:A,textAlign:I}=m;C8(l,h._pointLabels[p],L,A+C.lineHeight/2,C,{color:v.color,textAlign:I,textBaseline:"middle"})}}function G7e(h,c,l,d){const{ctx:p}=h;if(l)p.arc(h.xCenter,h.yCenter,c,0,Al);else{let m=h.getPointPosition(0,c);p.moveTo(m.x,m.y);for(let v=1;v<d;v++)m=h.getPointPosition(v,c),p.lineTo(m.x,m.y)}}function SIt(h,c,l,d,p){const m=h.ctx,v=c.circular,{color:C,lineWidth:L}=c;!v&&!d||!C||!L||l<0||(m.save(),m.strokeStyle=C,m.lineWidth=L,m.setLineDash(p.dash||[]),m.lineDashOffset=p.dashOffset,m.beginPath(),G7e(h,l,v,d),m.closePath(),m.stroke(),m.restore())}function IIt(h,c,l){return D4(h,{label:l,index:c,type:"pointLabel"})}class xE extends tz{constructor(c){super(c),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const c=this._padding=Xf(dne(this.options)/2),l=this.width=this.maxWidth-c.width,d=this.height=this.maxHeight-c.height;this.xCenter=Math.floor(this.left+l/2+c.left),this.yCenter=Math.floor(this.top+d/2+c.top),this.drawingArea=Math.floor(Math.min(l,d)/2)}determineDataLimits(){const{min:c,max:l}=this.getMinMax(!1);this.min=ja(c)&&!isNaN(c)?c:0,this.max=ja(l)&&!isNaN(l)?l:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/dne(this.options))}generateTickLabels(c){tz.prototype.generateTickLabels.call(this,c),this._pointLabels=this.getLabels().map((l,d)=>{const p=dl(this.options.pointLabels.callback,[l,d],this);return p||p===0?p:""}).filter((l,d)=>this.chart.getDataVisibility(d))}fit(){const c=this.options;c.display&&c.pointLabels.display?bIt(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(c,l,d,p){this.xCenter+=Math.floor((c-l)/2),this.yCenter+=Math.floor((d-p)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(c,l,d,p))}getIndexAngle(c){const l=Al/(this._pointLabels.length||1),d=this.options.startAngle||0;return Yp(c*l+sm(d))}getDistanceFromCenterForValue(c){if(ao(c))return NaN;const l=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-c)*l:(c-this.min)*l}getValueForDistanceFromCenter(c){if(ao(c))return NaN;const l=c/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-l:this.min+l}getPointLabelContext(c){const l=this._pointLabels||[];if(c>=0&&c<l.length){const d=l[c];return IIt(this.getContext(),c,d)}}getPointPosition(c,l,d=0){const p=this.getIndexAngle(c)-ou+d;return{x:Math.cos(p)*l+this.xCenter,y:Math.sin(p)*l+this.yCenter,angle:p}}getPointPositionForValue(c,l){return this.getPointPosition(c,this.getDistanceFromCenterForValue(l))}getBasePosition(c){return this.getPointPositionForValue(c||0,this.getBaseValue())}getPointLabelPosition(c){const{left:l,top:d,right:p,bottom:m}=this._pointLabelItems[c];return{left:l,top:d,right:p,bottom:m}}drawBackground(){const{backgroundColor:c,grid:{circular:l}}=this.options;if(c){const d=this.ctx;d.save(),d.beginPath(),G7e(this,this.getDistanceFromCenterForValue(this._endValue),l,this._pointLabels.length),d.closePath(),d.fillStyle=c,d.fill(),d.restore()}}drawGrid(){const c=this.ctx,l=this.options,{angleLines:d,grid:p,border:m}=l,v=this._pointLabels.length;let C,L,A;if(l.pointLabels.display&&LIt(this,v),p.display&&this.ticks.forEach((I,N)=>{if(N!==0||N===0&&this.min<0){L=this.getDistanceFromCenterForValue(I.value);const O=this.getContext(N),j=p.setContext(O),q=m.setContext(O);SIt(this,j,L,v,q)}}),d.display){for(c.save(),C=v-1;C>=0;C--){const I=d.setContext(this.getPointLabelContext(C)),{color:N,lineWidth:O}=I;!O||!N||(c.lineWidth=O,c.strokeStyle=N,c.setLineDash(I.borderDash),c.lineDashOffset=I.borderDashOffset,L=this.getDistanceFromCenterForValue(l.reverse?this.min:this.max),A=this.getPointPosition(C,L),c.beginPath(),c.moveTo(this.xCenter,this.yCenter),c.lineTo(A.x,A.y),c.stroke())}c.restore()}}drawBorder(){}drawLabels(){const c=this.ctx,l=this.options,d=l.ticks;if(!d.display)return;const p=this.getIndexAngle(0);let m,v;c.save(),c.translate(this.xCenter,this.yCenter),c.rotate(p),c.textAlign="center",c.textBaseline="middle",this.ticks.forEach((C,L)=>{if(L===0&&this.min>=0&&!l.reverse)return;const A=d.setContext(this.getContext(L)),I=sh(A.font);if(m=this.getDistanceFromCenterForValue(this.ticks[L].value),A.showLabelBackdrop){c.font=I.string,v=c.measureText(C.label).width,c.fillStyle=A.backdropColor;const N=Xf(A.backdropPadding);c.fillRect(-v/2-N.left,-m-I.size/2-N.top,v+N.width,I.size+N.height)}C8(c,C.label,0,-m,I,{color:A.color,strokeColor:A.textStrokeColor,strokeWidth:A.textStrokeWidth})}),c.restore()}drawTitle(){}}en(xE,"id","radialLinear"),en(xE,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:PF.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(c){return c},padding:5,centerPointLabels:!1}}),en(xE,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),en(xE,"descriptors",{angleLines:{_fallback:"grid"}});const nz={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}},_1=Object.keys(nz);function K7e(h,c){return h-c}function W7e(h,c){if(ao(c))return null;const l=h._adapter,{parser:d,round:p,isoWeekday:m}=h._parseOpts;let v=c;return typeof d=="function"&&(v=d(v)),ja(v)||(v=typeof d=="string"?l.parse(v,d):l.parse(v)),v===null?null:(p&&(v=p==="week"&&(gM(m)||m===!0)?l.startOf(v,"isoWeek",m):l.startOf(v,p)),+v)}function V7e(h,c,l,d){const p=_1.length;for(let m=_1.indexOf(h);m<p-1;++m){const v=nz[_1[m]],C=v.steps?v.steps:Number.MAX_SAFE_INTEGER;if(v.common&&Math.ceil((l-c)/(C*v.size))<=d)return _1[m]}return _1[p-1]}function AIt(h,c,l,d,p){for(let m=_1.length-1;m>=_1.indexOf(l);m--){const v=_1[m];if(nz[v].common&&h._adapter.diff(p,d,v)>=c-1)return v}return _1[l?_1.indexOf(l):0]}function PIt(h){for(let c=_1.indexOf(h)+1,l=_1.length;c<l;++c)if(nz[_1[c]].common)return _1[c]}function Y7e(h,c,l){if(!l)h[c]=!0;else if(l.length){const{lo:d,hi:p}=$te(l,c),m=l[d]>=c?l[d]:l[p];h[m]=!0}}function EIt(h,c,l,d){const p=h._adapter,m=+p.startOf(c[0].value,d),v=c[c.length-1].value;let C,L;for(C=m;C<=v;C=+p.add(C,1,d))L=l[C],L>=0&&(c[L].major=!0);return c}function Z7e(h,c,l){const d=[],p={},m=c.length;let v,C;for(v=0;v<m;++v)C=c[v],p[C]=v,d.push({value:C,major:!1});return m===0||!l?d:EIt(h,d,p,l)}class kE extends E8{constructor(c){super(c),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(c,l={}){const d=c.time||(c.time={}),p=this._adapter=new RMt._date(c.adapters.date);p.init(l),eE(d.displayFormats,p.formats()),this._parseOpts={parser:d.parser,round:d.round,isoWeekday:d.isoWeekday},super.init(c),this._normalized=l.normalized}parse(c,l){return c===void 0?null:W7e(this,c)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const c=this.options,l=this._adapter,d=c.time.unit||"day";let{min:p,max:m,minDefined:v,maxDefined:C}=this.getUserBounds();function L(A){!v&&!isNaN(A.min)&&(p=Math.min(p,A.min)),!C&&!isNaN(A.max)&&(m=Math.max(m,A.max))}(!v||!C)&&(L(this._getLabelBounds()),(c.bounds!=="ticks"||c.ticks.source!=="labels")&&L(this.getMinMax(!1))),p=ja(p)&&!isNaN(p)?p:+l.startOf(Date.now(),d),m=ja(m)&&!isNaN(m)?m:+l.endOf(Date.now(),d)+1,this.min=Math.min(p,m-1),this.max=Math.max(p+1,m)}_getLabelBounds(){const c=this.getLabelTimestamps();let l=Number.POSITIVE_INFINITY,d=Number.NEGATIVE_INFINITY;return c.length&&(l=c[0],d=c[c.length-1]),{min:l,max:d}}buildTicks(){const c=this.options,l=c.time,d=c.ticks,p=d.source==="labels"?this.getLabelTimestamps():this._generate();c.bounds==="ticks"&&p.length&&(this.min=this._userMin||p[0],this.max=this._userMax||p[p.length-1]);const m=this.min,v=this.max,C=aCt(p,m,v);return this._unit=l.unit||(d.autoSkip?V7e(l.minUnit,this.min,this.max,this._getLabelCapacity(m)):AIt(this,C.length,l.minUnit,this.min,this.max)),this._majorUnit=!d.major.enabled||this._unit==="year"?void 0:PIt(this._unit),this.initOffsets(p),c.reverse&&C.reverse(),Z7e(this,C,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(c=>+c.value))}initOffsets(c=[]){let l=0,d=0,p,m;this.options.offset&&c.length&&(p=this.getDecimalForValue(c[0]),c.length===1?l=1-p:l=(this.getDecimalForValue(c[1])-p)/2,m=this.getDecimalForValue(c[c.length-1]),c.length===1?d=m:d=(m-this.getDecimalForValue(c[c.length-2]))/2);const v=c.length<3?.5:.25;l=_h(l,0,v),d=_h(d,0,v),this._offsets={start:l,end:d,factor:1/(l+1+d)}}_generate(){const c=this._adapter,l=this.min,d=this.max,p=this.options,m=p.time,v=m.unit||V7e(m.minUnit,l,d,this._getLabelCapacity(l)),C=vs(p.ticks.stepSize,1),L=v==="week"?m.isoWeekday:!1,A=gM(L)||L===!0,I={};let N=l,O,j;if(A&&(N=+c.startOf(N,"isoWeek",L)),N=+c.startOf(N,A?"day":v),c.diff(d,l,v)>1e5*C)throw new Error(l+" and "+d+" are too far apart with stepSize of "+C+" "+v);const q=p.ticks.source==="data"&&this.getDataTimestamps();for(O=N,j=0;O<d;O=+c.add(O,C,v),j++)Y7e(I,O,q);return(O===d||p.bounds==="ticks"||j===1)&&Y7e(I,O,q),Object.keys(I).sort(K7e).map(ne=>+ne)}getLabelForValue(c){const l=this._adapter,d=this.options.time;return d.tooltipFormat?l.format(c,d.tooltipFormat):l.format(c,d.displayFormats.datetime)}format(c,l){const p=this.options.time.displayFormats,m=this._unit,v=l||p[m];return this._adapter.format(c,v)}_tickFormatFunction(c,l,d,p){const m=this.options,v=m.ticks.callback;if(v)return dl(v,[c,l,d],this);const C=m.time.displayFormats,L=this._unit,A=this._majorUnit,I=L&&C[L],N=A&&C[A],O=d[l],j=A&&N&&O&&O.major;return this._adapter.format(c,p||(j?N:I))}generateTickLabels(c){let l,d,p;for(l=0,d=c.length;l<d;++l)p=c[l],p.label=this._tickFormatFunction(p.value,l,c)}getDecimalForValue(c){return c===null?NaN:(c-this.min)/(this.max-this.min)}getPixelForValue(c){const l=this._offsets,d=this.getDecimalForValue(c);return this.getPixelForDecimal((l.start+d)*l.factor)}getValueForPixel(c){const l=this._offsets,d=this.getDecimalForPixel(c)/l.factor-l.end;return this.min+d*(this.max-this.min)}_getLabelSize(c){const l=this.options.ticks,d=this.ctx.measureText(c).width,p=sm(this.isHorizontal()?l.maxRotation:l.minRotation),m=Math.cos(p),v=Math.sin(p),C=this._resolveTickFontOptions(0).size;return{w:d*m+C*v,h:d*v+C*m}}_getLabelCapacity(c){const l=this.options.time,d=l.displayFormats,p=d[l.unit]||d.millisecond,m=this._tickFormatFunction(c,0,Z7e(this,[c],this._majorUnit),p),v=this._getLabelSize(m),C=Math.floor(this.isHorizontal()?this.width/v.w:this.height/v.h)-1;return C>0?C:1}getDataTimestamps(){let c=this._cache.data||[],l,d;if(c.length)return c;const p=this.getMatchingVisibleMetas();if(this._normalized&&p.length)return this._cache.data=p[0].controller.getAllParsedValues(this);for(l=0,d=p.length;l<d;++l)c=c.concat(p[l].controller.getAllParsedValues(this));return this._cache.data=this.normalize(c)}getLabelTimestamps(){const c=this._cache.labels||[];let l,d;if(c.length)return c;const p=this.getLabels();for(l=0,d=p.length;l<d;++l)c.push(W7e(this,p[l]));return this._cache.labels=this._normalized?c:this.normalize(c)}normalize(c){return X8e(c.sort(K7e))}}en(kE,"id","time"),en(kE,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function iz(h,c,l){let d=0,p=h.length-1,m,v,C,L;l?(c>=h[d].pos&&c<=h[p].pos&&({lo:d,hi:p}=hv(h,"pos",c)),{pos:m,time:C}=h[d],{pos:v,time:L}=h[p]):(c>=h[d].time&&c<=h[p].time&&({lo:d,hi:p}=hv(h,"time",c)),{time:m,pos:C}=h[d],{time:v,pos:L}=h[p]);const A=v-m;return A?C+(L-C)*(c-m)/A:C}class pne extends kE{constructor(c){super(c),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const c=this._getTimestampsForTable(),l=this._table=this.buildLookupTable(c);this._minPos=iz(l,this.min),this._tableRange=iz(l,this.max)-this._minPos,super.initOffsets(c)}buildLookupTable(c){const{min:l,max:d}=this,p=[],m=[];let v,C,L,A,I;for(v=0,C=c.length;v<C;++v)A=c[v],A>=l&&A<=d&&p.push(A);if(p.length<2)return[{time:l,pos:0},{time:d,pos:1}];for(v=0,C=p.length;v<C;++v)I=p[v+1],L=p[v-1],A=p[v],Math.round((I+L)/2)!==A&&m.push({time:A,pos:v/(C-1)});return m}_generate(){const c=this.min,l=this.max;let d=super.getDataTimestamps();return(!d.includes(c)||!d.length)&&d.splice(0,0,c),(!d.includes(l)||d.length===1)&&d.push(l),d.sort((p,m)=>p-m)}_getTimestampsForTable(){let c=this._cache.all||[];if(c.length)return c;const l=this.getDataTimestamps(),d=this.getLabelTimestamps();return l.length&&d.length?c=this.normalize(l.concat(d)):c=l.length?l:d,c=this._cache.all=c,c}getDecimalForValue(c){return(iz(this._table,c)-this._minPos)/this._tableRange}getValueForPixel(c){const l=this._offsets,d=this.getDecimalForPixel(c)/l.factor-l.end;return iz(this._table,d*this._tableRange+this._minPos,!0)}}en(pne,"id","timeseries"),en(pne,"defaults",kE.defaults);var $It=Object.freeze({__proto__:null,CategoryScale:une,LinearScale:hne,LogarithmicScale:fne,RadialLinearScale:xE,TimeScale:kE,TimeSeriesScale:pne});const NIt=[_Mt,dSt,lIt,$It];ew.register(...NIt);var DIt=Object.defineProperty,TIt=Object.getOwnPropertyDescriptor,nw=(h,c,l,d)=>{for(var p=d>1?void 0:d?TIt(c,l):c,m=h.length-1,v;m>=0;m--)(v=h[m])&&(p=(d?v(c,l,p):v(p))||p);return d&&p&&DIt(c,l,p),p};let wg=class extends xF{constructor(){super(),this.title="chart",this.legend=!1,this.height=458,this.width=800,this.smallTitle=!1,this.stepSize=1,this.chartType="line"}updateChart(){this.chart&&(this.chart.data.labels=this.labels,this.chart.data.datasets=this.datasets,this.chart.update())}buildChart(){var c;let h=this.titleFont;this.smallTitle&&(h=this.fontBold),this.chart&&this.chart.destroy(),this.chart=new ew((c=this.shadowRoot)==null?void 0:c.querySelector("#chart"),{type:this.chartType,data:{labels:this.labels,datasets:this.datasets},options:{responsive:!0,elements:{point:{borderColor:this.secondary,backgroundColor:this.secondary,pointStyle:"rect",radius:4,pointBorderColor:this.background}},scales:{x:{ticks:{font:this.smallFont,color:this.secondary},border:{color:this.secondary}},y:{min:0,ticks:{stepSize:this.stepSize,font:this.font,color:this.secondary},border:{color:this.secondary}}},layout:{autoPadding:!1},plugins:{tooltip:{titleFont:this.fontBold,bodyFont:this.font,titleColor:this.primary,displayColors:!1,borderColor:this.tertiary,borderWidth:1,cornerRadius:0},title:{display:!0,text:this.title,font:h,color:this.primary,align:"start"},legend:{display:this.legend,position:"bottom",maxHeight:40,labels:{color:"rgb(255, 255, 255)",font:this.mediumFont,pointStyle:"line",boxHeight:1}}}}})}firstUpdated(){super.firstUpdated(),this.buildChart()}render(){return E.html`
|
|
11774
|
+
`):h}function eIt(h,c){const{element:l,datasetIndex:d,index:p}=c,m=h.getDatasetMeta(d).controller,{label:v,value:C}=m.getLabelAndValue(p);return{chart:h,label:v,parsed:m.getParsed(p),raw:h.data.datasets[d].data[p],formattedValue:C,dataset:m.getDataset(),dataIndex:p,datasetIndex:d,element:l}}function T7e(h,c){const l=h.chart.ctx,{body:d,footer:p,title:m}=h,{boxWidth:v,boxHeight:C}=c,L=sh(c.bodyFont),A=sh(c.titleFont),I=sh(c.footerFont),N=m.length,O=p.length,j=d.length,q=Xf(c.padding);let ne=q.height,ie=0,re=d.reduce((Z,le)=>Z+le.before.length+le.lines.length+le.after.length,0);if(re+=h.beforeBody.length+h.afterBody.length,N&&(ne+=N*A.lineHeight+(N-1)*c.titleSpacing+c.titleMarginBottom),re){const Z=c.displayColors?Math.max(C,L.lineHeight):L.lineHeight;ne+=j*Z+(re-j)*L.lineHeight+(re-1)*c.bodySpacing}O&&(ne+=c.footerMarginTop+O*I.lineHeight+(O-1)*c.footerSpacing);let te=0;const X=function(Z){ie=Math.max(ie,l.measureText(Z).width+te)};return l.save(),l.font=A.string,Mc(h.title,X),l.font=L.string,Mc(h.beforeBody.concat(h.afterBody),X),te=c.displayColors?v+2+c.boxPadding:0,Mc(d,Z=>{Mc(Z.before,X),Mc(Z.lines,X),Mc(Z.after,X)}),te=0,l.font=I.string,Mc(h.footer,X),l.restore(),ie+=q.width,{width:ie,height:ne}}function tIt(h,c){const{y:l,height:d}=c;return l<d/2?"top":l>h.height-d/2?"bottom":"center"}function nIt(h,c,l,d){const{x:p,width:m}=d,v=l.caretSize+l.caretPadding;if(h==="left"&&p+m+v>c.width||h==="right"&&p-m-v<0)return!0}function iIt(h,c,l,d){const{x:p,width:m}=l,{width:v,chartArea:{left:C,right:L}}=h;let A="center";return d==="center"?A=p<=(C+L)/2?"left":"right":p<=m/2?A="left":p>=v-m/2&&(A="right"),nIt(A,h,c,l)&&(A="center"),A}function O7e(h,c,l){const d=l.yAlign||c.yAlign||tIt(h,l);return{xAlign:l.xAlign||c.xAlign||iIt(h,c,l,d),yAlign:d}}function rIt(h,c){let{x:l,width:d}=h;return c==="right"?l-=d:c==="center"&&(l-=d/2),l}function sIt(h,c,l){let{y:d,height:p}=h;return c==="top"?d+=l:c==="bottom"?d-=p+l:d-=p/2,d}function j7e(h,c,l,d){const{caretSize:p,caretPadding:m,cornerRadius:v}=h,{xAlign:C,yAlign:L}=l,A=p+m,{topLeft:I,topRight:N,bottomLeft:O,bottomRight:j}=M8(v);let q=rIt(c,C);const ne=sIt(c,L,A);return L==="center"?C==="left"?q+=A:C==="right"&&(q-=A):C==="left"?q-=Math.max(I,O)+p:C==="right"&&(q+=Math.max(N,j)+p),{x:_h(q,0,d.width-c.width),y:_h(ne,0,d.height-c.height)}}function ez(h,c,l){const d=Xf(l.padding);return c==="center"?h.x+h.width/2:c==="right"?h.x+h.width-d.right:h.x+d.left}function _7e(h){return tw([],pv(h))}function oIt(h,c,l){return D4(h,{tooltip:c,tooltipItems:l,type:"tooltip"})}function R7e(h,c){const l=c&&c.dataset&&c.dataset.tooltip&&c.dataset.tooltip.callbacks;return l?h.override(l):h}const B7e={beforeTitle:av,title(h){if(h.length>0){const c=h[0],l=c.chart.data.labels,d=l?l.length:0;if(this&&this.options&&this.options.mode==="dataset")return c.dataset.label||"";if(c.label)return c.label;if(d>0&&c.dataIndex<d)return l[c.dataIndex]}return""},afterTitle:av,beforeBody:av,beforeLabel:av,label(h){if(this&&this.options&&this.options.mode==="dataset")return h.label+": "+h.formattedValue||h.formattedValue;let c=h.dataset.label||"";c&&(c+=": ");const l=h.formattedValue;return ao(l)||(c+=l),c},labelColor(h){const l=h.chart.getDatasetMeta(h.datasetIndex).controller.getStyle(h.dataIndex);return{borderColor:l.borderColor,backgroundColor:l.backgroundColor,borderWidth:l.borderWidth,borderDash:l.borderDash,borderDashOffset:l.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(h){const l=h.chart.getDatasetMeta(h.datasetIndex).controller.getStyle(h.dataIndex);return{pointStyle:l.pointStyle,rotation:l.rotation}},afterLabel:av,afterBody:av,beforeFooter:av,footer:av,afterFooter:av};function j1(h,c,l,d){const p=h[c].call(l,d);return typeof p>"u"?B7e[c].call(l,d):p}class ane extends cm{constructor(c){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=c.chart,this.options=c.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(c){this.options=c,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const c=this._cachedAnimations;if(c)return c;const l=this.chart,d=this.options.setContext(this.getContext()),p=d.enabled&&l.options.animation&&d.animations,m=new P9e(this.chart,p);return p._cacheable&&(this._cachedAnimations=Object.freeze(m)),m}getContext(){return this.$context||(this.$context=oIt(this.chart.getContext(),this,this._tooltipItems))}getTitle(c,l){const{callbacks:d}=l,p=j1(d,"beforeTitle",this,c),m=j1(d,"title",this,c),v=j1(d,"afterTitle",this,c);let C=[];return C=tw(C,pv(p)),C=tw(C,pv(m)),C=tw(C,pv(v)),C}getBeforeBody(c,l){return _7e(j1(l.callbacks,"beforeBody",this,c))}getBody(c,l){const{callbacks:d}=l,p=[];return Mc(c,m=>{const v={before:[],lines:[],after:[]},C=R7e(d,m);tw(v.before,pv(j1(C,"beforeLabel",this,m))),tw(v.lines,j1(C,"label",this,m)),tw(v.after,pv(j1(C,"afterLabel",this,m))),p.push(v)}),p}getAfterBody(c,l){return _7e(j1(l.callbacks,"afterBody",this,c))}getFooter(c,l){const{callbacks:d}=l,p=j1(d,"beforeFooter",this,c),m=j1(d,"footer",this,c),v=j1(d,"afterFooter",this,c);let C=[];return C=tw(C,pv(p)),C=tw(C,pv(m)),C=tw(C,pv(v)),C}_createItems(c){const l=this._active,d=this.chart.data,p=[],m=[],v=[];let C=[],L,A;for(L=0,A=l.length;L<A;++L)C.push(eIt(this.chart,l[L]));return c.filter&&(C=C.filter((I,N,O)=>c.filter(I,N,O,d))),c.itemSort&&(C=C.sort((I,N)=>c.itemSort(I,N,d))),Mc(C,I=>{const N=R7e(c.callbacks,I);p.push(j1(N,"labelColor",this,I)),m.push(j1(N,"labelPointStyle",this,I)),v.push(j1(N,"labelTextColor",this,I))}),this.labelColors=p,this.labelPointStyles=m,this.labelTextColors=v,this.dataPoints=C,C}update(c,l){const d=this.options.setContext(this.getContext()),p=this._active;let m,v=[];if(!p.length)this.opacity!==0&&(m={opacity:0});else{const C=vE[d.position].call(this,p,this._eventPosition);v=this._createItems(d),this.title=this.getTitle(v,d),this.beforeBody=this.getBeforeBody(v,d),this.body=this.getBody(v,d),this.afterBody=this.getAfterBody(v,d),this.footer=this.getFooter(v,d);const L=this._size=T7e(this,d),A=Object.assign({},C,L),I=O7e(this.chart,d,A),N=j7e(d,A,I,this.chart);this.xAlign=I.xAlign,this.yAlign=I.yAlign,m={opacity:1,x:N.x,y:N.y,width:L.width,height:L.height,caretX:C.x,caretY:C.y}}this._tooltipItems=v,this.$context=void 0,m&&this._resolveAnimations().update(this,m),c&&d.external&&d.external.call(this,{chart:this.chart,tooltip:this,replay:l})}drawCaret(c,l,d,p){const m=this.getCaretPosition(c,d,p);l.lineTo(m.x1,m.y1),l.lineTo(m.x2,m.y2),l.lineTo(m.x3,m.y3)}getCaretPosition(c,l,d){const{xAlign:p,yAlign:m}=this,{caretSize:v,cornerRadius:C}=d,{topLeft:L,topRight:A,bottomLeft:I,bottomRight:N}=M8(C),{x:O,y:j}=c,{width:q,height:ne}=l;let ie,re,te,X,Z,le;return m==="center"?(Z=j+ne/2,p==="left"?(ie=O,re=ie-v,X=Z+v,le=Z-v):(ie=O+q,re=ie+v,X=Z-v,le=Z+v),te=ie):(p==="left"?re=O+Math.max(L,I)+v:p==="right"?re=O+q-Math.max(A,N)-v:re=this.caretX,m==="top"?(X=j,Z=X-v,ie=re-v,te=re+v):(X=j+ne,Z=X+v,ie=re+v,te=re-v),le=X),{x1:ie,x2:re,x3:te,y1:X,y2:Z,y3:le}}drawTitle(c,l,d){const p=this.title,m=p.length;let v,C,L;if(m){const A=wM(d.rtl,this.x,this.width);for(c.x=ez(this,d.titleAlign,d),l.textAlign=A.textAlign(d.titleAlign),l.textBaseline="middle",v=sh(d.titleFont),C=d.titleSpacing,l.fillStyle=d.titleColor,l.font=v.string,L=0;L<m;++L)l.fillText(p[L],A.x(c.x),c.y+v.lineHeight/2),c.y+=v.lineHeight+C,L+1===m&&(c.y+=d.titleMarginBottom-C)}}_drawColorBox(c,l,d,p,m){const v=this.labelColors[d],C=this.labelPointStyles[d],{boxHeight:L,boxWidth:A}=m,I=sh(m.bodyFont),N=ez(this,"left",m),O=p.x(N),j=L<I.lineHeight?(I.lineHeight-L)/2:0,q=l.y+j;if(m.usePointStyle){const ne={radius:Math.min(A,L)/2,pointStyle:C.pointStyle,rotation:C.rotation,borderWidth:1},ie=p.leftForLtr(O,A)+A/2,re=q+L/2;c.strokeStyle=m.multiKeyBackground,c.fillStyle=m.multiKeyBackground,_te(c,ne,ie,re),c.strokeStyle=v.borderColor,c.fillStyle=v.backgroundColor,_te(c,ne,ie,re)}else{c.lineWidth=yo(v.borderWidth)?Math.max(...Object.values(v.borderWidth)):v.borderWidth||1,c.strokeStyle=v.borderColor,c.setLineDash(v.borderDash||[]),c.lineDashOffset=v.borderDashOffset||0;const ne=p.leftForLtr(O,A),ie=p.leftForLtr(p.xPlus(O,1),A-2),re=M8(v.borderRadius);Object.values(re).some(te=>te!==0)?(c.beginPath(),c.fillStyle=m.multiKeyBackground,cE(c,{x:ne,y:q,w:A,h:L,radius:re}),c.fill(),c.stroke(),c.fillStyle=v.backgroundColor,c.beginPath(),cE(c,{x:ie,y:q+1,w:A-2,h:L-2,radius:re}),c.fill()):(c.fillStyle=m.multiKeyBackground,c.fillRect(ne,q,A,L),c.strokeRect(ne,q,A,L),c.fillStyle=v.backgroundColor,c.fillRect(ie,q+1,A-2,L-2))}c.fillStyle=this.labelTextColors[d]}drawBody(c,l,d){const{body:p}=this,{bodySpacing:m,bodyAlign:v,displayColors:C,boxHeight:L,boxWidth:A,boxPadding:I}=d,N=sh(d.bodyFont);let O=N.lineHeight,j=0;const q=wM(d.rtl,this.x,this.width),ne=function(Ce){l.fillText(Ce,q.x(c.x+j),c.y+O/2),c.y+=O+m},ie=q.textAlign(v);let re,te,X,Z,le,Le,he;for(l.textAlign=v,l.textBaseline="middle",l.font=N.string,c.x=ez(this,ie,d),l.fillStyle=d.bodyColor,Mc(this.beforeBody,ne),j=C&&ie!=="right"?v==="center"?A/2+I:A+2+I:0,Z=0,Le=p.length;Z<Le;++Z){for(re=p[Z],te=this.labelTextColors[Z],l.fillStyle=te,Mc(re.before,ne),X=re.lines,C&&X.length&&(this._drawColorBox(l,c,Z,q,d),O=Math.max(N.lineHeight,L)),le=0,he=X.length;le<he;++le)ne(X[le]),O=N.lineHeight;Mc(re.after,ne)}j=0,O=N.lineHeight,Mc(this.afterBody,ne),c.y-=m}drawFooter(c,l,d){const p=this.footer,m=p.length;let v,C;if(m){const L=wM(d.rtl,this.x,this.width);for(c.x=ez(this,d.footerAlign,d),c.y+=d.footerMarginTop,l.textAlign=L.textAlign(d.footerAlign),l.textBaseline="middle",v=sh(d.footerFont),l.fillStyle=d.footerColor,l.font=v.string,C=0;C<m;++C)l.fillText(p[C],L.x(c.x),c.y+v.lineHeight/2),c.y+=v.lineHeight+d.footerSpacing}}drawBackground(c,l,d,p){const{xAlign:m,yAlign:v}=this,{x:C,y:L}=c,{width:A,height:I}=d,{topLeft:N,topRight:O,bottomLeft:j,bottomRight:q}=M8(p.cornerRadius);l.fillStyle=p.backgroundColor,l.strokeStyle=p.borderColor,l.lineWidth=p.borderWidth,l.beginPath(),l.moveTo(C+N,L),v==="top"&&this.drawCaret(c,l,d,p),l.lineTo(C+A-O,L),l.quadraticCurveTo(C+A,L,C+A,L+O),v==="center"&&m==="right"&&this.drawCaret(c,l,d,p),l.lineTo(C+A,L+I-q),l.quadraticCurveTo(C+A,L+I,C+A-q,L+I),v==="bottom"&&this.drawCaret(c,l,d,p),l.lineTo(C+j,L+I),l.quadraticCurveTo(C,L+I,C,L+I-j),v==="center"&&m==="left"&&this.drawCaret(c,l,d,p),l.lineTo(C,L+N),l.quadraticCurveTo(C,L,C+N,L),l.closePath(),l.fill(),p.borderWidth>0&&l.stroke()}_updateAnimationTarget(c){const l=this.chart,d=this.$animations,p=d&&d.x,m=d&&d.y;if(p||m){const v=vE[c.position].call(this,this._active,this._eventPosition);if(!v)return;const C=this._size=T7e(this,c),L=Object.assign({},v,this._size),A=O7e(l,c,L),I=j7e(c,L,A,l);(p._to!==I.x||m._to!==I.y)&&(this.xAlign=A.xAlign,this.yAlign=A.yAlign,this.width=C.width,this.height=C.height,this.caretX=v.x,this.caretY=v.y,this._resolveAnimations().update(this,I))}}_willRender(){return!!this.opacity}draw(c){const l=this.options.setContext(this.getContext());let d=this.opacity;if(!d)return;this._updateAnimationTarget(l);const p={width:this.width,height:this.height},m={x:this.x,y:this.y};d=Math.abs(d)<.001?0:d;const v=Xf(l.padding),C=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;l.enabled&&C&&(c.save(),c.globalAlpha=d,this.drawBackground(m,c,p,l),y9e(c,l.textDirection),m.y+=v.top,this.drawTitle(m,c,l),this.drawBody(m,c,l),this.drawFooter(m,c,l),x9e(c,l.textDirection),c.restore())}getActiveElements(){return this._active||[]}setActiveElements(c,l){const d=this._active,p=c.map(({datasetIndex:C,index:L})=>{const A=this.chart.getDatasetMeta(C);if(!A)throw new Error("Cannot find a dataset at index "+C);return{datasetIndex:C,element:A.data[L],index:L}}),m=!LF(d,p),v=this._positionChanged(p,l);(m||v)&&(this._active=p,this._eventPosition=l,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(c,l,d=!0){if(l&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const p=this.options,m=this._active||[],v=this._getActiveElements(c,m,l,d),C=this._positionChanged(v,c),L=l||!LF(v,m)||C;return L&&(this._active=v,(p.enabled||p.external)&&(this._eventPosition={x:c.x,y:c.y},this.update(!0,l))),L}_getActiveElements(c,l,d,p){const m=this.options;if(c.type==="mouseout")return[];if(!p)return l.filter(C=>this.chart.data.datasets[C.datasetIndex]&&this.chart.getDatasetMeta(C.datasetIndex).controller.getParsed(C.index)!==void 0);const v=this.chart.getElementsAtEventForMode(c,m.mode,m,d);return m.reverse&&v.reverse(),v}_positionChanged(c,l){const{caretX:d,caretY:p,options:m}=this,v=vE[m.position].call(this,c,l);return v!==!1&&(d!==v.x||p!==v.y)}}en(ane,"positioners",vE);var cIt={id:"tooltip",_element:ane,positioners:vE,afterInit(h,c,l){l&&(h.tooltip=new ane({chart:h,options:l}))},beforeUpdate(h,c,l){h.tooltip&&h.tooltip.initialize(l)},reset(h,c,l){h.tooltip&&h.tooltip.initialize(l)},afterDraw(h){const c=h.tooltip;if(c&&c._willRender()){const l={tooltip:c};if(h.notifyPlugins("beforeTooltipDraw",{...l,cancelable:!0})===!1)return;c.draw(h.ctx),h.notifyPlugins("afterTooltipDraw",l)}},afterEvent(h,c){if(h.tooltip){const l=c.replay;h.tooltip.handleEvent(c.event,l,c.inChartArea)&&(c.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:(h,c)=>c.bodyFont.size,boxWidth:(h,c)=>c.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:B7e},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:h=>h!=="filter"&&h!=="itemSort"&&h!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},lIt=Object.freeze({__proto__:null,Colors:ySt,Decimation:MSt,Filler:qSt,Legend:ZSt,SubTitle:JSt,Title:QSt,Tooltip:cIt});const aIt=(h,c,l,d)=>(typeof c=="string"?(l=h.push(c)-1,d.unshift({index:l,label:c})):isNaN(c)&&(l=null),l);function uIt(h,c,l,d){const p=h.indexOf(c);if(p===-1)return aIt(h,c,l,d);const m=h.lastIndexOf(c);return p!==m?l:p}const hIt=(h,c)=>h===null?null:_h(Math.round(h),0,c);function F7e(h){const c=this.getLabels();return h>=0&&h<c.length?c[h]:h}class une extends E8{constructor(c){super(c),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(c){const l=this._addedLabels;if(l.length){const d=this.getLabels();for(const{index:p,label:m}of l)d[p]===m&&d.splice(p,1);this._addedLabels=[]}super.init(c)}parse(c,l){if(ao(c))return null;const d=this.getLabels();return l=isFinite(l)&&d[l]===c?l:uIt(d,c,vs(l,c),this._addedLabels),hIt(l,d.length-1)}determineDataLimits(){const{minDefined:c,maxDefined:l}=this.getUserBounds();let{min:d,max:p}=this.getMinMax(!0);this.options.bounds==="ticks"&&(c||(d=0),l||(p=this.getLabels().length-1)),this.min=d,this.max=p}buildTicks(){const c=this.min,l=this.max,d=this.options.offset,p=[];let m=this.getLabels();m=c===0&&l===m.length-1?m:m.slice(c,l+1),this._valueRange=Math.max(m.length-(d?0:1),1),this._startValue=this.min-(d?.5:0);for(let v=c;v<=l;v++)p.push({value:v});return p}getLabelForValue(c){return F7e.call(this,c)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(c){return typeof c!="number"&&(c=this.parse(c)),c===null?NaN:this.getPixelForDecimal((c-this._startValue)/this._valueRange)}getPixelForTick(c){const l=this.ticks;return c<0||c>l.length-1?null:this.getPixelForValue(l[c].value)}getValueForPixel(c){return Math.round(this._startValue+this.getDecimalForPixel(c)*this._valueRange)}getBasePixel(){return this.bottom}}en(une,"id","category"),en(une,"defaults",{ticks:{callback:F7e}});function fIt(h,c){const l=[],{bounds:p,step:m,min:v,max:C,precision:L,count:A,maxTicks:I,maxDigits:N,includeBounds:O}=h,j=m||1,q=I-1,{min:ne,max:ie}=c,re=!ao(v),te=!ao(C),X=!ao(A),Z=(ie-ne)/(N+1);let le=G8e((ie-ne)/q/j)*j,Le,he,Ce,G;if(le<1e-14&&!re&&!te)return[{value:ne},{value:ie}];G=Math.ceil(ie/le)-Math.floor(ne/le),G>q&&(le=G8e(G*le/q/j)*j),ao(L)||(Le=Math.pow(10,L),le=Math.ceil(le*Le)/Le),p==="ticks"?(he=Math.floor(ne/le)*le,Ce=Math.ceil(ie/le)*le):(he=ne,Ce=ie),re&&te&&m&&sCt((C-v)/m,le/1e3)?(G=Math.round(Math.min((C-v)/le,I)),le=(C-v)/G,he=v,Ce=C):X?(he=re?v:he,Ce=te?C:Ce,G=A-1,le=(Ce-he)/G):(G=(Ce-he)/le,nE(G,Math.round(G),le/1e3)?G=Math.round(G):G=Math.ceil(G));const kt=Math.max(W8e(le),W8e(he));Le=Math.pow(10,ao(L)?kt:L),he=Math.round(he*Le)/Le,Ce=Math.round(Ce*Le)/Le;let Fe=0;for(re&&(O&&he!==v?(l.push({value:v}),he<v&&Fe++,nE(Math.round((he+Fe*le)*Le)/Le,v,z7e(v,Z,h))&&Fe++):he<v&&Fe++);Fe<G;++Fe){const Ke=Math.round((he+Fe*le)*Le)/Le;if(te&&Ke>C)break;l.push({value:Ke})}return te&&O&&Ce!==C?l.length&&nE(l[l.length-1].value,C,z7e(C,Z,h))?l[l.length-1].value=C:l.push({value:C}):(!te||Ce===C)&&l.push({value:Ce}),l}function z7e(h,c,{horizontal:l,minRotation:d}){const p=sm(d),m=(l?Math.sin(p):Math.cos(p))||.001,v=.75*c*(""+h).length;return Math.min(c/m,v)}class tz extends E8{constructor(c){super(c),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(c,l){return ao(c)||(typeof c=="number"||c instanceof Number)&&!isFinite(+c)?null:+c}handleTickRangeOptions(){const{beginAtZero:c}=this.options,{minDefined:l,maxDefined:d}=this.getUserBounds();let{min:p,max:m}=this;const v=L=>p=l?p:L,C=L=>m=d?m:L;if(c){const L=Q2(p),A=Q2(m);L<0&&A<0?C(0):L>0&&A>0&&v(0)}if(p===m){let L=m===0?1:Math.abs(m*.05);C(m+L),c||v(p-L)}this.min=p,this.max=m}getTickLimit(){const c=this.options.ticks;let{maxTicksLimit:l,stepSize:d}=c,p;return d?(p=Math.ceil(this.max/d)-Math.floor(this.min/d)+1,p>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${d} would result generating up to ${p} ticks. Limiting to 1000.`),p=1e3)):(p=this.computeTickLimit(),l=l||11),l&&(p=Math.min(l,p)),p}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const c=this.options,l=c.ticks;let d=this.getTickLimit();d=Math.max(2,d);const p={maxTicks:d,bounds:c.bounds,min:c.min,max:c.max,precision:l.precision,step:l.stepSize,count:l.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:l.minRotation||0,includeBounds:l.includeBounds!==!1},m=this._range||this,v=fIt(p,m);return c.bounds==="ticks"&&K8e(v,this,"value"),c.reverse?(v.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),v}configure(){const c=this.ticks;let l=this.min,d=this.max;if(super.configure(),this.options.offset&&c.length){const p=(d-l)/Math.max(c.length-1,1)/2;l-=p,d+=p}this._startValue=l,this._endValue=d,this._valueRange=d-l}getLabelForValue(c){return sE(c,this.chart.options.locale,this.options.ticks.format)}}class hne extends tz{determineDataLimits(){const{min:c,max:l}=this.getMinMax(!0);this.min=ja(c)?c:0,this.max=ja(l)?l:1,this.handleTickRangeOptions()}computeTickLimit(){const c=this.isHorizontal(),l=c?this.width:this.height,d=sm(this.options.ticks.minRotation),p=(c?Math.sin(d):Math.cos(d))||.001,m=this._resolveTickFontOptions(0);return Math.ceil(l/Math.min(40,m.lineHeight/p))}getPixelForValue(c){return c===null?NaN:this.getPixelForDecimal((c-this._startValue)/this._valueRange)}getValueForPixel(c){return this._startValue+this.getDecimalForPixel(c)*this._valueRange}}en(hne,"id","linear"),en(hne,"defaults",{ticks:{callback:PF.formatters.numeric}});const yE=h=>Math.floor(N4(h)),$8=(h,c)=>Math.pow(10,yE(h)+c);function H7e(h){return h/Math.pow(10,yE(h))===1}function U7e(h,c,l){const d=Math.pow(10,l),p=Math.floor(h/d);return Math.ceil(c/d)-p}function dIt(h,c){const l=c-h;let d=yE(l);for(;U7e(h,c,d)>10;)d++;for(;U7e(h,c,d)<10;)d--;return Math.min(d,yE(h))}function pIt(h,{min:c,max:l}){c=Vp(h.min,c);const d=[],p=yE(c);let m=dIt(c,l),v=m<0?Math.pow(10,Math.abs(m)):1;const C=Math.pow(10,m),L=p>m?Math.pow(10,p):0,A=Math.round((c-L)*v)/v,I=Math.floor((c-L)/C/10)*C*10;let N=Math.floor((A-I)/Math.pow(10,m)),O=Vp(h.min,Math.round((L+I+N*Math.pow(10,m))*v)/v);for(;O<l;)d.push({value:O,major:H7e(O),significand:N}),N>=10?N=N<15?15:20:N++,N>=20&&(m++,N=2,v=m>=0?1:v),O=Math.round((L+I+N*Math.pow(10,m))*v)/v;const j=Vp(h.max,O);return d.push({value:j,major:H7e(j),significand:N}),d}class fne extends E8{constructor(c){super(c),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(c,l){const d=tz.prototype.parse.apply(this,[c,l]);if(d===0){this._zero=!0;return}return ja(d)&&d>0?d:null}determineDataLimits(){const{min:c,max:l}=this.getMinMax(!0);this.min=ja(c)?Math.max(0,c):null,this.max=ja(l)?Math.max(0,l):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!ja(this._userMin)&&(this.min=c===$8(this.min,0)?$8(this.min,-1):$8(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:c,maxDefined:l}=this.getUserBounds();let d=this.min,p=this.max;const m=C=>d=c?d:C,v=C=>p=l?p:C;d===p&&(d<=0?(m(1),v(10)):(m($8(d,-1)),v($8(p,1)))),d<=0&&m($8(p,-1)),p<=0&&v($8(d,1)),this.min=d,this.max=p}buildTicks(){const c=this.options,l={min:this._userMin,max:this._userMax},d=pIt(l,this);return c.bounds==="ticks"&&K8e(d,this,"value"),c.reverse?(d.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),d}getLabelForValue(c){return c===void 0?"0":sE(c,this.chart.options.locale,this.options.ticks.format)}configure(){const c=this.min;super.configure(),this._startValue=N4(c),this._valueRange=N4(this.max)-N4(c)}getPixelForValue(c){return(c===void 0||c===0)&&(c=this.min),c===null||isNaN(c)?NaN:this.getPixelForDecimal(c===this.min?0:(N4(c)-this._startValue)/this._valueRange)}getValueForPixel(c){const l=this.getDecimalForPixel(c);return Math.pow(10,this._startValue+l*this._valueRange)}}en(fne,"id","logarithmic"),en(fne,"defaults",{ticks:{callback:PF.formatters.logarithmic,major:{enabled:!0}}});function dne(h){const c=h.ticks;if(c.display&&h.display){const l=Xf(c.backdropPadding);return vs(c.font&&c.font.size,Bl.font.size)+l.height}return 0}function gIt(h,c,l){return l=Rl(l)?l:[l],{w:kCt(h,c.string,l),h:l.length*c.lineHeight}}function q7e(h,c,l,d,p){return h===d||h===p?{start:c-l/2,end:c+l/2}:h<d||h>p?{start:c-l,end:c}:{start:c,end:c+l}}function bIt(h){const c={l:h.left+h._padding.left,r:h.right-h._padding.right,t:h.top+h._padding.top,b:h.bottom-h._padding.bottom},l=Object.assign({},c),d=[],p=[],m=h._pointLabels.length,v=h.options.pointLabels,C=v.centerPointLabels?Il/m:0;for(let L=0;L<m;L++){const A=v.setContext(h.getPointLabelContext(L));p[L]=A.padding;const I=h.getPointPosition(L,h.drawingArea+p[L],C),N=sh(A.font),O=gIt(h.ctx,N,h._pointLabels[L]);d[L]=O;const j=Yp(h.getIndexAngle(L)+C),q=Math.round(Pte(j)),ne=q7e(q,I.x,O.w,0,180),ie=q7e(q,I.y,O.h,90,270);mIt(l,c,j,ne,ie)}h.setCenterPoint(c.l-l.l,l.r-c.r,c.t-l.t,l.b-c.b),h._pointLabelItems=yIt(h,d,p)}function mIt(h,c,l,d,p){const m=Math.abs(Math.sin(l)),v=Math.abs(Math.cos(l));let C=0,L=0;d.start<c.l?(C=(c.l-d.start)/m,h.l=Math.min(h.l,c.l-C)):d.end>c.r&&(C=(d.end-c.r)/m,h.r=Math.max(h.r,c.r+C)),p.start<c.t?(L=(c.t-p.start)/v,h.t=Math.min(h.t,c.t-L)):p.end>c.b&&(L=(p.end-c.b)/v,h.b=Math.max(h.b,c.b+L))}function wIt(h,c,l){const d=h.drawingArea,{extra:p,additionalAngle:m,padding:v,size:C}=l,L=h.getPointPosition(c,d+p+v,m),A=Math.round(Pte(Yp(L.angle+ou))),I=CIt(L.y,C.h,A),N=xIt(A),O=kIt(L.x,C.w,N);return{visible:!0,x:L.x,y:I,textAlign:N,left:O,top:I,right:O+C.w,bottom:I+C.h}}function vIt(h,c){if(!c)return!0;const{left:l,top:d,right:p,bottom:m}=h;return!(fv({x:l,y:d},c)||fv({x:l,y:m},c)||fv({x:p,y:d},c)||fv({x:p,y:m},c))}function yIt(h,c,l){const d=[],p=h._pointLabels.length,m=h.options,{centerPointLabels:v,display:C}=m.pointLabels,L={extra:dne(m)/2,additionalAngle:v?Il/p:0};let A;for(let I=0;I<p;I++){L.padding=l[I],L.size=c[I];const N=wIt(h,I,L);d.push(N),C==="auto"&&(N.visible=vIt(N,A),N.visible&&(A=N))}return d}function xIt(h){return h===0||h===180?"center":h<180?"left":"right"}function kIt(h,c,l){return l==="right"?h-=c:l==="center"&&(h-=c/2),h}function CIt(h,c,l){return l===90||l===270?h-=c/2:(l>270||l<90)&&(h-=c),h}function MIt(h,c,l){const{left:d,top:p,right:m,bottom:v}=l,{backdropColor:C}=c;if(!ao(C)){const L=M8(c.borderRadius),A=Xf(c.backdropPadding);h.fillStyle=C;const I=d-A.left,N=p-A.top,O=m-d+A.width,j=v-p+A.height;Object.values(L).some(q=>q!==0)?(h.beginPath(),cE(h,{x:I,y:N,w:O,h:j,radius:L}),h.fill()):h.fillRect(I,N,O,j)}}function LIt(h,c){const{ctx:l,options:{pointLabels:d}}=h;for(let p=c-1;p>=0;p--){const m=h._pointLabelItems[p];if(!m.visible)continue;const v=d.setContext(h.getPointLabelContext(p));MIt(l,v,m);const C=sh(v.font),{x:L,y:A,textAlign:I}=m;C8(l,h._pointLabels[p],L,A+C.lineHeight/2,C,{color:v.color,textAlign:I,textBaseline:"middle"})}}function G7e(h,c,l,d){const{ctx:p}=h;if(l)p.arc(h.xCenter,h.yCenter,c,0,Al);else{let m=h.getPointPosition(0,c);p.moveTo(m.x,m.y);for(let v=1;v<d;v++)m=h.getPointPosition(v,c),p.lineTo(m.x,m.y)}}function SIt(h,c,l,d,p){const m=h.ctx,v=c.circular,{color:C,lineWidth:L}=c;!v&&!d||!C||!L||l<0||(m.save(),m.strokeStyle=C,m.lineWidth=L,m.setLineDash(p.dash||[]),m.lineDashOffset=p.dashOffset,m.beginPath(),G7e(h,l,v,d),m.closePath(),m.stroke(),m.restore())}function IIt(h,c,l){return D4(h,{label:l,index:c,type:"pointLabel"})}class xE extends tz{constructor(c){super(c),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const c=this._padding=Xf(dne(this.options)/2),l=this.width=this.maxWidth-c.width,d=this.height=this.maxHeight-c.height;this.xCenter=Math.floor(this.left+l/2+c.left),this.yCenter=Math.floor(this.top+d/2+c.top),this.drawingArea=Math.floor(Math.min(l,d)/2)}determineDataLimits(){const{min:c,max:l}=this.getMinMax(!1);this.min=ja(c)&&!isNaN(c)?c:0,this.max=ja(l)&&!isNaN(l)?l:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/dne(this.options))}generateTickLabels(c){tz.prototype.generateTickLabels.call(this,c),this._pointLabels=this.getLabels().map((l,d)=>{const p=dl(this.options.pointLabels.callback,[l,d],this);return p||p===0?p:""}).filter((l,d)=>this.chart.getDataVisibility(d))}fit(){const c=this.options;c.display&&c.pointLabels.display?bIt(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(c,l,d,p){this.xCenter+=Math.floor((c-l)/2),this.yCenter+=Math.floor((d-p)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(c,l,d,p))}getIndexAngle(c){const l=Al/(this._pointLabels.length||1),d=this.options.startAngle||0;return Yp(c*l+sm(d))}getDistanceFromCenterForValue(c){if(ao(c))return NaN;const l=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-c)*l:(c-this.min)*l}getValueForDistanceFromCenter(c){if(ao(c))return NaN;const l=c/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-l:this.min+l}getPointLabelContext(c){const l=this._pointLabels||[];if(c>=0&&c<l.length){const d=l[c];return IIt(this.getContext(),c,d)}}getPointPosition(c,l,d=0){const p=this.getIndexAngle(c)-ou+d;return{x:Math.cos(p)*l+this.xCenter,y:Math.sin(p)*l+this.yCenter,angle:p}}getPointPositionForValue(c,l){return this.getPointPosition(c,this.getDistanceFromCenterForValue(l))}getBasePosition(c){return this.getPointPositionForValue(c||0,this.getBaseValue())}getPointLabelPosition(c){const{left:l,top:d,right:p,bottom:m}=this._pointLabelItems[c];return{left:l,top:d,right:p,bottom:m}}drawBackground(){const{backgroundColor:c,grid:{circular:l}}=this.options;if(c){const d=this.ctx;d.save(),d.beginPath(),G7e(this,this.getDistanceFromCenterForValue(this._endValue),l,this._pointLabels.length),d.closePath(),d.fillStyle=c,d.fill(),d.restore()}}drawGrid(){const c=this.ctx,l=this.options,{angleLines:d,grid:p,border:m}=l,v=this._pointLabels.length;let C,L,A;if(l.pointLabels.display&&LIt(this,v),p.display&&this.ticks.forEach((I,N)=>{if(N!==0||N===0&&this.min<0){L=this.getDistanceFromCenterForValue(I.value);const O=this.getContext(N),j=p.setContext(O),q=m.setContext(O);SIt(this,j,L,v,q)}}),d.display){for(c.save(),C=v-1;C>=0;C--){const I=d.setContext(this.getPointLabelContext(C)),{color:N,lineWidth:O}=I;!O||!N||(c.lineWidth=O,c.strokeStyle=N,c.setLineDash(I.borderDash),c.lineDashOffset=I.borderDashOffset,L=this.getDistanceFromCenterForValue(l.reverse?this.min:this.max),A=this.getPointPosition(C,L),c.beginPath(),c.moveTo(this.xCenter,this.yCenter),c.lineTo(A.x,A.y),c.stroke())}c.restore()}}drawBorder(){}drawLabels(){const c=this.ctx,l=this.options,d=l.ticks;if(!d.display)return;const p=this.getIndexAngle(0);let m,v;c.save(),c.translate(this.xCenter,this.yCenter),c.rotate(p),c.textAlign="center",c.textBaseline="middle",this.ticks.forEach((C,L)=>{if(L===0&&this.min>=0&&!l.reverse)return;const A=d.setContext(this.getContext(L)),I=sh(A.font);if(m=this.getDistanceFromCenterForValue(this.ticks[L].value),A.showLabelBackdrop){c.font=I.string,v=c.measureText(C.label).width,c.fillStyle=A.backdropColor;const N=Xf(A.backdropPadding);c.fillRect(-v/2-N.left,-m-I.size/2-N.top,v+N.width,I.size+N.height)}C8(c,C.label,0,-m,I,{color:A.color,strokeColor:A.textStrokeColor,strokeWidth:A.textStrokeWidth})}),c.restore()}drawTitle(){}}en(xE,"id","radialLinear"),en(xE,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:PF.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(c){return c},padding:5,centerPointLabels:!1}}),en(xE,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),en(xE,"descriptors",{angleLines:{_fallback:"grid"}});const nz={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}},_1=Object.keys(nz);function K7e(h,c){return h-c}function W7e(h,c){if(ao(c))return null;const l=h._adapter,{parser:d,round:p,isoWeekday:m}=h._parseOpts;let v=c;return typeof d=="function"&&(v=d(v)),ja(v)||(v=typeof d=="string"?l.parse(v,d):l.parse(v)),v===null?null:(p&&(v=p==="week"&&(gM(m)||m===!0)?l.startOf(v,"isoWeek",m):l.startOf(v,p)),+v)}function V7e(h,c,l,d){const p=_1.length;for(let m=_1.indexOf(h);m<p-1;++m){const v=nz[_1[m]],C=v.steps?v.steps:Number.MAX_SAFE_INTEGER;if(v.common&&Math.ceil((l-c)/(C*v.size))<=d)return _1[m]}return _1[p-1]}function AIt(h,c,l,d,p){for(let m=_1.length-1;m>=_1.indexOf(l);m--){const v=_1[m];if(nz[v].common&&h._adapter.diff(p,d,v)>=c-1)return v}return _1[l?_1.indexOf(l):0]}function PIt(h){for(let c=_1.indexOf(h)+1,l=_1.length;c<l;++c)if(nz[_1[c]].common)return _1[c]}function Y7e(h,c,l){if(!l)h[c]=!0;else if(l.length){const{lo:d,hi:p}=$te(l,c),m=l[d]>=c?l[d]:l[p];h[m]=!0}}function EIt(h,c,l,d){const p=h._adapter,m=+p.startOf(c[0].value,d),v=c[c.length-1].value;let C,L;for(C=m;C<=v;C=+p.add(C,1,d))L=l[C],L>=0&&(c[L].major=!0);return c}function Z7e(h,c,l){const d=[],p={},m=c.length;let v,C;for(v=0;v<m;++v)C=c[v],p[C]=v,d.push({value:C,major:!1});return m===0||!l?d:EIt(h,d,p,l)}class kE extends E8{constructor(c){super(c),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(c,l={}){const d=c.time||(c.time={}),p=this._adapter=new RMt._date(c.adapters.date);p.init(l),eE(d.displayFormats,p.formats()),this._parseOpts={parser:d.parser,round:d.round,isoWeekday:d.isoWeekday},super.init(c),this._normalized=l.normalized}parse(c,l){return c===void 0?null:W7e(this,c)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const c=this.options,l=this._adapter,d=c.time.unit||"day";let{min:p,max:m,minDefined:v,maxDefined:C}=this.getUserBounds();function L(A){!v&&!isNaN(A.min)&&(p=Math.min(p,A.min)),!C&&!isNaN(A.max)&&(m=Math.max(m,A.max))}(!v||!C)&&(L(this._getLabelBounds()),(c.bounds!=="ticks"||c.ticks.source!=="labels")&&L(this.getMinMax(!1))),p=ja(p)&&!isNaN(p)?p:+l.startOf(Date.now(),d),m=ja(m)&&!isNaN(m)?m:+l.endOf(Date.now(),d)+1,this.min=Math.min(p,m-1),this.max=Math.max(p+1,m)}_getLabelBounds(){const c=this.getLabelTimestamps();let l=Number.POSITIVE_INFINITY,d=Number.NEGATIVE_INFINITY;return c.length&&(l=c[0],d=c[c.length-1]),{min:l,max:d}}buildTicks(){const c=this.options,l=c.time,d=c.ticks,p=d.source==="labels"?this.getLabelTimestamps():this._generate();c.bounds==="ticks"&&p.length&&(this.min=this._userMin||p[0],this.max=this._userMax||p[p.length-1]);const m=this.min,v=this.max,C=aCt(p,m,v);return this._unit=l.unit||(d.autoSkip?V7e(l.minUnit,this.min,this.max,this._getLabelCapacity(m)):AIt(this,C.length,l.minUnit,this.min,this.max)),this._majorUnit=!d.major.enabled||this._unit==="year"?void 0:PIt(this._unit),this.initOffsets(p),c.reverse&&C.reverse(),Z7e(this,C,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(c=>+c.value))}initOffsets(c=[]){let l=0,d=0,p,m;this.options.offset&&c.length&&(p=this.getDecimalForValue(c[0]),c.length===1?l=1-p:l=(this.getDecimalForValue(c[1])-p)/2,m=this.getDecimalForValue(c[c.length-1]),c.length===1?d=m:d=(m-this.getDecimalForValue(c[c.length-2]))/2);const v=c.length<3?.5:.25;l=_h(l,0,v),d=_h(d,0,v),this._offsets={start:l,end:d,factor:1/(l+1+d)}}_generate(){const c=this._adapter,l=this.min,d=this.max,p=this.options,m=p.time,v=m.unit||V7e(m.minUnit,l,d,this._getLabelCapacity(l)),C=vs(p.ticks.stepSize,1),L=v==="week"?m.isoWeekday:!1,A=gM(L)||L===!0,I={};let N=l,O,j;if(A&&(N=+c.startOf(N,"isoWeek",L)),N=+c.startOf(N,A?"day":v),c.diff(d,l,v)>1e5*C)throw new Error(l+" and "+d+" are too far apart with stepSize of "+C+" "+v);const q=p.ticks.source==="data"&&this.getDataTimestamps();for(O=N,j=0;O<d;O=+c.add(O,C,v),j++)Y7e(I,O,q);return(O===d||p.bounds==="ticks"||j===1)&&Y7e(I,O,q),Object.keys(I).sort(K7e).map(ne=>+ne)}getLabelForValue(c){const l=this._adapter,d=this.options.time;return d.tooltipFormat?l.format(c,d.tooltipFormat):l.format(c,d.displayFormats.datetime)}format(c,l){const p=this.options.time.displayFormats,m=this._unit,v=l||p[m];return this._adapter.format(c,v)}_tickFormatFunction(c,l,d,p){const m=this.options,v=m.ticks.callback;if(v)return dl(v,[c,l,d],this);const C=m.time.displayFormats,L=this._unit,A=this._majorUnit,I=L&&C[L],N=A&&C[A],O=d[l],j=A&&N&&O&&O.major;return this._adapter.format(c,p||(j?N:I))}generateTickLabels(c){let l,d,p;for(l=0,d=c.length;l<d;++l)p=c[l],p.label=this._tickFormatFunction(p.value,l,c)}getDecimalForValue(c){return c===null?NaN:(c-this.min)/(this.max-this.min)}getPixelForValue(c){const l=this._offsets,d=this.getDecimalForValue(c);return this.getPixelForDecimal((l.start+d)*l.factor)}getValueForPixel(c){const l=this._offsets,d=this.getDecimalForPixel(c)/l.factor-l.end;return this.min+d*(this.max-this.min)}_getLabelSize(c){const l=this.options.ticks,d=this.ctx.measureText(c).width,p=sm(this.isHorizontal()?l.maxRotation:l.minRotation),m=Math.cos(p),v=Math.sin(p),C=this._resolveTickFontOptions(0).size;return{w:d*m+C*v,h:d*v+C*m}}_getLabelCapacity(c){const l=this.options.time,d=l.displayFormats,p=d[l.unit]||d.millisecond,m=this._tickFormatFunction(c,0,Z7e(this,[c],this._majorUnit),p),v=this._getLabelSize(m),C=Math.floor(this.isHorizontal()?this.width/v.w:this.height/v.h)-1;return C>0?C:1}getDataTimestamps(){let c=this._cache.data||[],l,d;if(c.length)return c;const p=this.getMatchingVisibleMetas();if(this._normalized&&p.length)return this._cache.data=p[0].controller.getAllParsedValues(this);for(l=0,d=p.length;l<d;++l)c=c.concat(p[l].controller.getAllParsedValues(this));return this._cache.data=this.normalize(c)}getLabelTimestamps(){const c=this._cache.labels||[];let l,d;if(c.length)return c;const p=this.getLabels();for(l=0,d=p.length;l<d;++l)c.push(W7e(this,p[l]));return this._cache.labels=this._normalized?c:this.normalize(c)}normalize(c){return X8e(c.sort(K7e))}}en(kE,"id","time"),en(kE,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function iz(h,c,l){let d=0,p=h.length-1,m,v,C,L;l?(c>=h[d].pos&&c<=h[p].pos&&({lo:d,hi:p}=hv(h,"pos",c)),{pos:m,time:C}=h[d],{pos:v,time:L}=h[p]):(c>=h[d].time&&c<=h[p].time&&({lo:d,hi:p}=hv(h,"time",c)),{time:m,pos:C}=h[d],{time:v,pos:L}=h[p]);const A=v-m;return A?C+(L-C)*(c-m)/A:C}class pne extends kE{constructor(c){super(c),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const c=this._getTimestampsForTable(),l=this._table=this.buildLookupTable(c);this._minPos=iz(l,this.min),this._tableRange=iz(l,this.max)-this._minPos,super.initOffsets(c)}buildLookupTable(c){const{min:l,max:d}=this,p=[],m=[];let v,C,L,A,I;for(v=0,C=c.length;v<C;++v)A=c[v],A>=l&&A<=d&&p.push(A);if(p.length<2)return[{time:l,pos:0},{time:d,pos:1}];for(v=0,C=p.length;v<C;++v)I=p[v+1],L=p[v-1],A=p[v],Math.round((I+L)/2)!==A&&m.push({time:A,pos:v/(C-1)});return m}_generate(){const c=this.min,l=this.max;let d=super.getDataTimestamps();return(!d.includes(c)||!d.length)&&d.splice(0,0,c),(!d.includes(l)||d.length===1)&&d.push(l),d.sort((p,m)=>p-m)}_getTimestampsForTable(){let c=this._cache.all||[];if(c.length)return c;const l=this.getDataTimestamps(),d=this.getLabelTimestamps();return l.length&&d.length?c=this.normalize(l.concat(d)):c=l.length?l:d,c=this._cache.all=c,c}getDecimalForValue(c){return(iz(this._table,c)-this._minPos)/this._tableRange}getValueForPixel(c){const l=this._offsets,d=this.getDecimalForPixel(c)/l.factor-l.end;return iz(this._table,d*this._tableRange+this._minPos,!0)}}en(pne,"id","timeseries"),en(pne,"defaults",kE.defaults);var $It=Object.freeze({__proto__:null,CategoryScale:une,LinearScale:hne,LogarithmicScale:fne,RadialLinearScale:xE,TimeScale:kE,TimeSeriesScale:pne});const NIt=[_Mt,dSt,lIt,$It];ew.register(...NIt);var DIt=Object.defineProperty,TIt=Object.getOwnPropertyDescriptor,nw=(h,c,l,d)=>{for(var p=d>1?void 0:d?TIt(c,l):c,m=h.length-1,v;m>=0;m--)(v=h[m])&&(p=(d?v(c,l,p):v(p))||p);return d&&p&&DIt(c,l,p),p};let wg=class extends xF{constructor(){super(),this.title="chart",this.legend=!1,this.height=458,this.width=800,this.smallTitle=!1,this.stepSize=1,this.chartType="line"}updateChart(){this.chart&&this.chart.data&&this.datasets&&this.datasets.length>0&&(this.chart.data.labels=this.labels,this.chart.data.datasets=this.datasets,this.chart.update())}buildChart(){var c;let h=this.titleFont;this.smallTitle&&(h=this.fontBold),this.chart&&this.chart.destroy(),this.chart=new ew((c=this.shadowRoot)==null?void 0:c.querySelector("#chart"),{type:this.chartType,data:{labels:this.labels,datasets:this.datasets},options:{responsive:!0,elements:{point:{borderColor:this.secondary,backgroundColor:this.secondary,pointStyle:"rect",radius:4,pointBorderColor:this.background}},scales:{x:{ticks:{font:this.smallFont,color:this.secondary},border:{color:this.secondary}},y:{min:0,ticks:{stepSize:this.stepSize,font:this.font,color:this.secondary},border:{color:this.secondary}}},layout:{autoPadding:!1},plugins:{tooltip:{titleFont:this.fontBold,bodyFont:this.font,titleColor:this.primary,displayColors:!1,borderColor:this.tertiary,borderWidth:1,cornerRadius:0},title:{display:!0,text:this.title,font:h,color:this.primary,align:"start"},legend:{display:this.legend,position:"bottom",maxHeight:40,labels:{color:"rgb(255, 255, 255)",font:this.mediumFont,pointStyle:"line",boxHeight:1}}}}})}firstUpdated(){super.firstUpdated(),this.buildChart()}render(){return E.html`
|
|
11775
11775
|
<canvas id="chart" style="width: ${this.width}px; height: ${this.height}px; "></canvas>
|
|
11776
11776
|
`}};wg.styles=E.css`
|
|
11777
11777
|
:host {
|
package/package.json
CHANGED