@deskhero/dh_ui 2.49.8 → 2.50.0
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.
- package/dist/dh_ui.es.js +18 -6
- package/dist/dh_ui.umd.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +4 -2
- package/dist/adapters/editorjs/EditorjsTransformer.d.ts +0 -3
- package/dist/adapters/tiptap/SimpleTemplate.vue.d.ts +0 -29
- package/dist/adapters/tiptap/TiptapTransformer.d.ts +0 -3
- package/dist/adapters/tiptap/TiptapView.vue.d.ts +0 -73
- package/dist/adapters/tiptap/composables/useScrollDetector.d.ts +0 -8
- package/dist/components/TextEditor.vue.d.ts +0 -81
- package/dist/components/VerificationCode.vue.d.ts +0 -45
- package/dist/factories/EditorFactory.d.ts +0 -19
- package/dist/models/EditorTransformer.d.ts +0 -5
package/dist/dh_ui.umd.js
CHANGED
|
@@ -16,7 +16,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
16
16
|
* Released under the MIT License
|
|
17
17
|
*/class T6{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,i,r){const o=t.listeners[r],s=t.duration;o.forEach(a=>a({chart:e,initial:t.initial,numSteps:s,currentStep:Math.min(i-t.start,s)}))}_refresh(){this._request||(this._running=!0,this._request=$4.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,r)=>{if(!i.running||!i.items.length)return;const o=i.items;let s=o.length-1,a=!1,l;for(;s>=0;--s)l=o[s],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(e),a=!0):(o[s]=o[o.length-1],o.pop());a&&(r.draw(),this._notify(r,i,e,"progress")),o.length||(i.running=!1,this._notify(r,i,e,"complete"),i.initial=!1),t+=o.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){const t=this._charts;let i=t.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,i)),i}listen(e,t,i){this._getAnims(e).listeners[t].push(i)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((i,r)=>Math.max(i,r._duration),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const i=t.items;let r=i.length-1;for(;r>=0;--r)i[r].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var sr=new T6;const ID="transparent",x6={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=eD(n||ID),r=i.valid&&eD(e||ID);return r&&r.valid?r.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class z6{constructor(e,t,i,r){const o=t[i];r=Jd([e.to,r,o,e.from]);const s=Jd([e.from,o,r]);this._active=!0,this._fn=e.fn||x6[e.type||typeof s],this._easing=Ml[e.easing]||Ml.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=i,this._from=s,this._to=r,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const r=this._target[this._prop],o=i-this._start,s=this._duration-o;this._start=i,this._duration=Math.floor(Math.max(s,e.duration)),this._total+=o,this._loop=!!e.loop,this._to=Jd([e.to,t,r,e.from]),this._from=Jd([e.from,r,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,i=this._duration,r=this._prop,o=this._from,s=this._loop,a=this._to;let l;if(this._active=o!==a&&(s||t<i),!this._active){this._target[r]=a,this._notify(!0);return}if(t<0){this._target[r]=o;return}l=t/i%2,l=s&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[r]=this._fn(o,a,l)}wait(){const e=this._promises||(this._promises=[]);return new Promise((t,i)=>{e.push({res:t,rej:i})})}_notify(e){const t=e?"res":"rej",i=this._promises||[];for(let r=0;r<i.length;r++)i[r][t]()}}class DD{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!Se(e))return;const t=Object.keys(zt.animation),i=this._properties;Object.getOwnPropertyNames(e).forEach(r=>{const o=e[r];if(!Se(o))return;const s={};for(const a of t)s[a]=o[a];(Xe(o.properties)&&o.properties||[r]).forEach(a=>{(a===r||!i.has(a))&&i.set(a,s)})})}_animateOptions(e,t){const i=t.options,r=b6(e,i);if(!r)return[];const o=this._createAnimations(r,i);return i.$shared&&A6(e.options.$animations,i).then(()=>{e.options=i},()=>{}),o}_createAnimations(e,t){const i=this._properties,r=[],o=e.$animations||(e.$animations={}),s=Object.keys(t),a=Date.now();let l;for(l=s.length-1;l>=0;--l){const u=s[l];if(u.charAt(0)==="$")continue;if(u==="options"){r.push(...this._animateOptions(e,t));continue}const d=t[u];let M=o[u];const h=i.get(u);if(M)if(h&&M.active()){M.update(h,d,a);continue}else M.cancel();if(!h||!h.duration){e[u]=d;continue}o[u]=M=new z6(h,e,u,d),r.push(M)}return r}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}const i=this._createAnimations(e,t);if(i.length)return sr.add(this._chart,i),!0}}function A6(n,e){const t=[],i=Object.keys(e);for(let r=0;r<i.length;r++){const o=n[i[r]];o&&o.active()&&t.push(o.wait())}return Promise.all(t)}function b6(n,e){if(!e)return;let t=n.options;if(!t){n.options=e;return}return t.$shared&&(n.options=t=Object.assign({},t,{$shared:!1,$animations:{}})),t}function TD(n,e){const t=n&&n.options||{},i=t.reverse,r=t.min===void 0?e:0,o=t.max===void 0?e:0;return{start:i?o:r,end:i?r:o}}function L6(n,e,t){if(t===!1)return!1;const i=TD(n,t),r=TD(e,t);return{top:r.end,right:i.end,bottom:r.start,left:i.start}}function k6(n){let e,t,i,r;return Se(n)?(e=n.top,t=n.right,i=n.bottom,r=n.left):e=t=i=r=n,{top:e,right:t,bottom:i,left:r,disabled:n===!1}}function xD(n,e){const t=[],i=n._getSortedDatasetMetas(e);let r,o;for(r=0,o=i.length;r<o;++r)t.push(i[r].index);return t}function zD(n,e,t,i={}){const r=n.keys,o=i.mode==="single";let s,a,l,u;if(e!==null){for(s=0,a=r.length;s<a;++s){if(l=+r[s],l===t){if(i.all)continue;break}u=n.values[l],ft(u)&&(o||e===0||Si(e)===Si(u))&&(e+=u)}return e}}function C6(n){const e=Object.keys(n),t=new Array(e.length);let i,r,o;for(i=0,r=e.length;i<r;++i)o=e[i],t[i]={x:o,y:n[o]};return t}function AD(n,e){const t=n&&n.options.stacked;return t||t===void 0&&e.stack!==void 0}function w6(n,e,t){return`${n.id}.${e.id}.${t.stack||t.type}`}function E6(n){const{min:e,max:t,minDefined:i,maxDefined:r}=n.getUserBounds();return{min:i?e:Number.NEGATIVE_INFINITY,max:r?t:Number.POSITIVE_INFINITY}}function S6(n,e,t){const i=n[e]||(n[e]={});return i[t]||(i[t]={})}function bD(n,e,t,i){for(const r of e.getMatchingVisibleMetas(i).reverse()){const o=n[r.index];if(t&&o>0||!t&&o<0)return r.index}return null}function LD(n,e){const{chart:t,_cachedMeta:i}=n,r=t._stacks||(t._stacks={}),{iScale:o,vScale:s,index:a}=i,l=o.axis,u=s.axis,d=w6(o,s,i),M=e.length;let h;for(let g=0;g<M;++g){const f=e[g],{[l]:p,[u]:N}=f,y=f._stacks||(f._stacks={});h=y[u]=S6(r,d,p),h[a]=N,h._top=bD(h,s,!0,i.type),h._bottom=bD(h,s,!1,i.type);const j=h._visualValues||(h._visualValues={});j[a]=N}}function TN(n,e){const t=n.scales;return Object.keys(t).filter(i=>t[i].axis===e).shift()}function O6(n,e){return Vr(n,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function v6(n,e,t){return Vr(n,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:t,index:e,mode:"default",type:"data"})}function fl(n,e){const t=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){e=e||n._parsed;for(const r of e){const o=r._stacks;if(!o||o[i]===void 0||o[i][t]===void 0)return;delete o[i][t],o[i]._visualValues!==void 0&&o[i]._visualValues[t]!==void 0&&delete o[i]._visualValues[t]}}}const xN=n=>n==="reset"||n==="none",kD=(n,e)=>e?n:Object.assign({},n),U6=(n,e,t)=>n&&!e.hidden&&e._stacked&&{keys:xD(t,!0),values:null};class Zs{constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,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 e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=AD(e.vScale,e),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(e){this.index!==e&&fl(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,t=this._cachedMeta,i=this.getDataset(),r=(M,h,g,f)=>M==="x"?h:M==="r"?f:g,o=t.xAxisID=Ye(i.xAxisID,TN(e,"x")),s=t.yAxisID=Ye(i.yAxisID,TN(e,"y")),a=t.rAxisID=Ye(i.rAxisID,TN(e,"r")),l=t.indexAxis,u=t.iAxisID=r(l,o,s,a),d=t.vAxisID=r(l,s,o,a);t.xScale=this.getScaleForId(o),t.yScale=this.getScaleForId(s),t.rScale=this.getScaleForId(a),t.iScale=this.getScaleForId(u),t.vScale=this.getScaleForId(d)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&H4(this._data,this),e._stacked&&fl(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),i=this._data;if(Se(t))this._data=C6(t);else if(i!==t){if(i){H4(i,this);const r=this._cachedMeta;fl(r),r._parsed=[]}t&&Object.isExtensible(t)&&NV(t,this),this._syncList=[],this._data=t}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const t=this._cachedMeta,i=this.getDataset();let r=!1;this._dataCheck();const o=t._stacked;t._stacked=AD(t.vScale,t),t.stack!==i.stack&&(r=!0,fl(t),t.stack=i.stack),this._resyncElements(e),(r||o!==t._stacked)&&LD(this,t._parsed)}configure(){const e=this.chart.config,t=e.datasetScopeKeys(this._type),i=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){const{_cachedMeta:i,_data:r}=this,{iScale:o,_stacked:s}=i,a=o.axis;let l=e===0&&t===r.length?!0:i._sorted,u=e>0&&i._parsed[e-1],d,M,h;if(this._parsing===!1)i._parsed=r,i._sorted=!0,h=r;else{Xe(r[e])?h=this.parseArrayData(i,r,e,t):Se(r[e])?h=this.parseObjectData(i,r,e,t):h=this.parsePrimitiveData(i,r,e,t);const g=()=>M[a]===null||u&&M[a]<u[a];for(d=0;d<t;++d)i._parsed[d+e]=M=h[d],l&&(g()&&(l=!1),u=M);i._sorted=l}s&&LD(this,h)}parsePrimitiveData(e,t,i,r){const{iScale:o,vScale:s}=e,a=o.axis,l=s.axis,u=o.getLabels(),d=o===s,M=new Array(r);let h,g,f;for(h=0,g=r;h<g;++h)f=h+i,M[h]={[a]:d||o.parse(u[f],f),[l]:s.parse(t[f],f)};return M}parseArrayData(e,t,i,r){const{xScale:o,yScale:s}=e,a=new Array(r);let l,u,d,M;for(l=0,u=r;l<u;++l)d=l+i,M=t[d],a[l]={x:o.parse(M[0],d),y:s.parse(M[1],d)};return a}parseObjectData(e,t,i,r){const{xScale:o,yScale:s}=e,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,u=new Array(r);let d,M,h,g;for(d=0,M=r;d<M;++d)h=d+i,g=t[h],u[d]={x:o.parse(_s(g,a),h),y:s.parse(_s(g,l),h)};return u}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,t,i){const r=this.chart,o=this._cachedMeta,s=t[e.axis],a={keys:xD(r,!0),values:t._stacks[e.axis]._visualValues};return zD(a,s,o.index,{mode:i})}updateRangeFromParsed(e,t,i,r){const o=i[t.axis];let s=o===null?NaN:o;const a=r&&i._stacks[t.axis];r&&a&&(r.values=a,s=zD(r,o,this._cachedMeta.index)),e.min=Math.min(e.min,s),e.max=Math.max(e.max,s)}getMinMax(e,t){const i=this._cachedMeta,r=i._parsed,o=i._sorted&&e===i.iScale,s=r.length,a=this._getOtherScale(e),l=U6(t,i,this.chart),u={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:d,max:M}=E6(a);let h,g;function f(){g=r[h];const p=g[a.axis];return!ft(g[e.axis])||d>p||M<p}for(h=0;h<s&&!(!f()&&(this.updateRangeFromParsed(u,e,g,l),o));++h);if(o){for(h=s-1;h>=0;--h)if(!f()){this.updateRangeFromParsed(u,e,g,l);break}}return u}getAllParsedValues(e){const t=this._cachedMeta._parsed,i=[];let r,o,s;for(r=0,o=t.length;r<o;++r)s=t[r][e.axis],ft(s)&&i.push(s);return i}getMaxOverflow(){return!1}getLabelAndValue(e){const t=this._cachedMeta,i=t.iScale,r=t.vScale,o=this.getParsed(e);return{label:i?""+i.getLabelForValue(o[i.axis]):"",value:r?""+r.getLabelForValue(o[r.axis]):""}}_update(e){const t=this._cachedMeta;this.update(e||"default"),t._clip=k6(Ye(this.options.clip,L6(t.xScale,t.yScale,this.getMaxOverflow())))}update(e){}draw(){const e=this._ctx,t=this.chart,i=this._cachedMeta,r=i.data||[],o=t.chartArea,s=[],a=this._drawStart||0,l=this._drawCount||r.length-a,u=this.options.drawActiveElementsOnTop;let d;for(i.dataset&&i.dataset.draw(e,o,a,l),d=a;d<a+l;++d){const M=r[d];M.hidden||(M.active&&u?s.push(M):M.draw(e,o))}for(d=0;d<s.length;++d)s[d].draw(e,o)}getStyle(e,t){const i=t?"active":"default";return e===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(e||0,i)}getContext(e,t,i){const r=this.getDataset();let o;if(e>=0&&e<this._cachedMeta.data.length){const s=this._cachedMeta.data[e];o=s.$context||(s.$context=v6(this.getContext(),e,s)),o.parsed=this.getParsed(e),o.raw=r.data[e],o.index=o.dataIndex=e}else o=this.$context||(this.$context=O6(this.chart.getContext(),this.index)),o.dataset=r,o.index=o.datasetIndex=this.index;return o.active=!!t,o.mode=i,o}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,t){return this._resolveElementOptions(this.dataElementType.id,t,e)}_resolveElementOptions(e,t="default",i){const r=t==="active",o=this._cachedDataOpts,s=e+"-"+t,a=o[s],l=this.enableOptionSharing&&ll(i);if(a)return kD(a,l);const u=this.chart.config,d=u.datasetElementScopeKeys(this._type,e),M=r?[`${e}Hover`,"hover",e,""]:[e,""],h=u.getOptionScopes(this.getDataset(),d),g=Object.keys(zt.elements[e]),f=()=>this.getContext(i,r,t),p=u.resolveNamedOptions(h,g,f,M);return p.$shared&&(p.$shared=l,o[s]=Object.freeze(kD(p,l))),p}_resolveAnimations(e,t,i){const r=this.chart,o=this._cachedDataOpts,s=`animation-${t}`,a=o[s];if(a)return a;let l;if(r.options.animation!==!1){const d=this.chart.config,M=d.datasetAnimationScopeKeys(this._type,t),h=d.getOptionScopes(this.getDataset(),M);l=d.createResolver(h,this.getContext(e,i,t))}const u=new DD(r,l&&l.animations);return l&&l._cacheable&&(o[s]=Object.freeze(u)),u}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,t){return!t||xN(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){const i=this.resolveDataElementOptions(e,t),r=this._sharedOptions,o=this.getSharedOptions(i),s=this.includeOptions(t,o)||o!==r;return this.updateSharedOptions(o,t,i),{sharedOptions:o,includeOptions:s}}updateElement(e,t,i,r){xN(r)?Object.assign(e,i):this._resolveAnimations(t,r).update(e,i)}updateSharedOptions(e,t,i){e&&!xN(t)&&this._resolveAnimations(void 0,t).update(e,i)}_setStyle(e,t,i,r){e.active=r;const o=this.getStyle(t,r);this._resolveAnimations(t,i,r).update(e,{options:!r&&this.getSharedOptions(o)||o})}removeHoverStyle(e,t,i){this._setStyle(e,i,"active",!1)}setHoverStyle(e,t,i){this._setStyle(e,i,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const t=this._data,i=this._cachedMeta.data;for(const[a,l,u]of this._syncList)this[a](l,u);this._syncList=[];const r=i.length,o=t.length,s=Math.min(o,r);s&&this.parse(0,s),o>r?this._insertElements(r,o-r,e):o<r&&this._removeElements(o,r-o)}_insertElements(e,t,i=!0){const r=this._cachedMeta,o=r.data,s=e+t;let a;const l=u=>{for(u.length+=t,a=u.length-1;a>=s;a--)u[a]=u[a-t]};for(l(o),a=e;a<s;++a)o[a]=new this.dataElementType;this._parsing&&l(r._parsed),this.parse(e,t),i&&this.updateElements(o,e,t,"reset")}updateElements(e,t,i,r){}_removeElements(e,t){const i=this._cachedMeta;if(this._parsing){const r=i._parsed.splice(e,t);i._stacked&&fl(i,r)}i.data.splice(e,t)}_sync(e){if(this._parsing)this._syncList.push(e);else{const[t,i,r]=e;this[t](i,r)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){const e=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-e,e])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(e,t){t&&this._sync(["_removeElements",e,t]);const i=arguments.length-2;i&&this._sync(["_insertElements",e,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}ne(Zs,"defaults",{}),ne(Zs,"datasetElementType",null),ne(Zs,"dataElementType",null);function Q6(n,e){if(!n._cache.$bar){const t=n.getMatchingVisibleMetas(e);let i=[];for(let r=0,o=t.length;r<o;r++)i=i.concat(t[r].controller.getAllParsedValues(n));n._cache.$bar=G4(i.sort((r,o)=>r-o))}return n._cache.$bar}function Y6(n){const e=n.iScale,t=Q6(e,n.type);let i=e._length,r,o,s,a;const l=()=>{s===32767||s===-32768||(ll(a)&&(i=Math.min(i,Math.abs(s-a)||i)),a=s)};for(r=0,o=t.length;r<o;++r)s=e.getPixelForValue(t[r]),l();for(a=void 0,r=0,o=e.ticks.length;r<o;++r)s=e.getPixelForTick(r),l();return i}function _6(n,e,t,i){const r=t.barThickness;let o,s;return Be(r)?(o=e.min*t.categoryPercentage,s=t.barPercentage):(o=r*i,s=1),{chunk:o/i,ratio:s,start:e.pixels[n]-o/2}}function R6(n,e,t,i){const r=e.pixels,o=r[n];let s=n>0?r[n-1]:null,a=n<r.length-1?r[n+1]:null;const l=t.categoryPercentage;s===null&&(s=o-(a===null?e.end-e.start:a-o)),a===null&&(a=o+o-s);const u=o-(o-Math.min(s,a))/2*l;return{chunk:Math.abs(a-s)/2*l/i,ratio:t.barPercentage,start:u}}function V6(n,e,t,i){const r=t.parse(n[0],i),o=t.parse(n[1],i),s=Math.min(r,o),a=Math.max(r,o);let l=s,u=a;Math.abs(s)>Math.abs(a)&&(l=a,u=s),e[t.axis]=u,e._custom={barStart:l,barEnd:u,start:r,end:o,min:s,max:a}}function CD(n,e,t,i){return Xe(n)?V6(n,e,t,i):e[t.axis]=t.parse(n,i),e}function wD(n,e,t,i){const r=n.iScale,o=n.vScale,s=r.getLabels(),a=r===o,l=[];let u,d,M,h;for(u=t,d=t+i;u<d;++u)h=e[u],M={},M[r.axis]=a||r.parse(s[u],u),l.push(CD(h,M,o,u));return l}function zN(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function B6(n,e,t){return n!==0?Si(n):(e.isHorizontal()?1:-1)*(e.min>=t?1:-1)}function Z6(n){let e,t,i,r,o;return n.horizontal?(e=n.base>n.x,t="left",i="right"):(e=n.base<n.y,t="bottom",i="top"),e?(r="end",o="start"):(r="start",o="end"),{start:t,end:i,reverse:e,top:r,bottom:o}}function P6(n,e,t,i){let r=e.borderSkipped;const o={};if(!r){n.borderSkipped=o;return}if(r===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:s,end:a,reverse:l,top:u,bottom:d}=Z6(n);r==="middle"&&t&&(n.enableBorderRadius=!0,(t._top||0)===i?r=u:(t._bottom||0)===i?r=d:(o[ED(d,s,a,l)]=!0,r=u)),o[ED(r,s,a,l)]=!0,n.borderSkipped=o}function ED(n,e,t,i){return i?(n=W6(n,e,t),n=SD(n,t,e)):n=SD(n,e,t),n}function W6(n,e,t){return n===e?t:n===t?e:n}function SD(n,e,t){return n==="start"?e:n==="end"?t:n}function F6(n,{inflateAmount:e},t){n.inflateAmount=e==="auto"?t===1?.33:0:e}class tM extends Zs{parsePrimitiveData(e,t,i,r){return wD(e,t,i,r)}parseArrayData(e,t,i,r){return wD(e,t,i,r)}parseObjectData(e,t,i,r){const{iScale:o,vScale:s}=e,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,u=o.axis==="x"?a:l,d=s.axis==="x"?a:l,M=[];let h,g,f,p;for(h=i,g=i+r;h<g;++h)p=t[h],f={},f[o.axis]=o.parse(_s(p,u),h),M.push(CD(_s(p,d),f,s,h));return M}updateRangeFromParsed(e,t,i,r){super.updateRangeFromParsed(e,t,i,r);const o=i._custom;o&&t===this._cachedMeta.vScale&&(e.min=Math.min(e.min,o.min),e.max=Math.max(e.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(e){const t=this._cachedMeta,{iScale:i,vScale:r}=t,o=this.getParsed(e),s=o._custom,a=zN(s)?"["+s.start+", "+s.end+"]":""+r.getLabelForValue(o[r.axis]);return{label:""+i.getLabelForValue(o[i.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const e=this._cachedMeta;e.stack=this.getDataset().stack}update(e){const t=this._cachedMeta;this.updateElements(t.data,0,t.data.length,e)}updateElements(e,t,i,r){const o=r==="reset",{index:s,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),u=a.isHorizontal(),d=this._getRuler(),{sharedOptions:M,includeOptions:h}=this._getSharedOptions(t,r);for(let g=t;g<t+i;g++){const f=this.getParsed(g),p=o||Be(f[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(g),N=this._calculateBarIndexPixels(g,d),y=(f._stacks||{})[a.axis],j={horizontal:u,base:p.base,enableBorderRadius:!y||zN(f._custom)||s===y._top||s===y._bottom,x:u?p.head:N.center,y:u?N.center:p.head,height:u?N.size:Math.abs(p.size),width:u?Math.abs(p.size):N.size};h&&(j.options=M||this.resolveDataElementOptions(g,e[g].active?"active":r));const A=j.options||e[g].options;P6(j,A,y,s),F6(j,A,d.ratio),this.updateElement(e[g],g,j,r)}}_getStacks(e,t){const{iScale:i}=this._cachedMeta,r=i.getMatchingVisibleMetas(this._type).filter(l=>l.controller.options.grouped),o=i.options.stacked,s=[],a=l=>{const u=l.controller.getParsed(t),d=u&&u[l.vScale.axis];if(Be(d)||isNaN(d))return!0};for(const l of r)if(!(t!==void 0&&a(l))&&((o===!1||s.indexOf(l.stack)===-1||o===void 0&&l.stack===void 0)&&s.push(l.stack),l.index===e))break;return s.length||s.push(void 0),s}_getStackCount(e){return this._getStacks(void 0,e).length}_getStackIndex(e,t,i){const r=this._getStacks(e,i),o=t!==void 0?r.indexOf(t):-1;return o===-1?r.length-1:o}_getRuler(){const e=this.options,t=this._cachedMeta,i=t.iScale,r=[];let o,s;for(o=0,s=t.data.length;o<s;++o)r.push(i.getPixelForValue(this.getParsed(o)[i.axis],o));const a=e.barThickness;return{min:a||Y6(t),pixels:r,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:e.grouped,ratio:a?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){const{_cachedMeta:{vScale:t,_stacked:i,index:r},options:{base:o,minBarLength:s}}=this,a=o||0,l=this.getParsed(e),u=l._custom,d=zN(u);let M=l[t.axis],h=0,g=i?this.applyStack(t,l,i):M,f,p;g!==M&&(h=g-M,g=M),d&&(M=u.barStart,g=u.barEnd-u.barStart,M!==0&&Si(M)!==Si(u.barEnd)&&(h=0),h+=M);const N=!Be(o)&&!d?o:h;let y=t.getPixelForValue(N);if(this.chart.getDataVisibility(e)?f=t.getPixelForValue(h+g):f=y,p=f-y,Math.abs(p)<s){p=B6(p,t,a)*s,M===a&&(y-=p/2);const j=t.getPixelForDecimal(0),A=t.getPixelForDecimal(1),w=Math.min(j,A),k=Math.max(j,A);y=Math.max(Math.min(y,k),w),f=y+p,i&&!d&&(l._stacks[t.axis]._visualValues[r]=t.getValueForPixel(f)-t.getValueForPixel(y))}if(y===t.getPixelForValue(a)){const j=Si(p)*t.getLineWidthForValue(a)/2;y+=j,p-=j}return{size:p,base:y,head:f,center:f+p/2}}_calculateBarIndexPixels(e,t){const i=t.scale,r=this.options,o=r.skipNull,s=Ye(r.maxBarThickness,1/0);let a,l;if(t.grouped){const u=o?this._getStackCount(e):t.stackCount,d=r.barThickness==="flex"?R6(e,t,r,u):_6(e,t,r,u),M=this._getStackIndex(this.index,this._cachedMeta.stack,o?e:void 0);a=d.start+d.chunk*M+d.chunk/2,l=Math.min(s,d.chunk*d.ratio)}else a=i.getPixelForValue(this.getParsed(e)[i.axis],e),l=Math.min(s,t.min*t.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const e=this._cachedMeta,t=e.vScale,i=e.data,r=i.length;let o=0;for(;o<r;++o)this.getParsed(o)[t.axis]!==null&&i[o].draw(this._ctx)}}ne(tM,"id","bar"),ne(tM,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),ne(tM,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class nM extends Zs{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const t=this._cachedMeta,{dataset:i,data:r=[],_dataset:o}=t,s=this.chart._animationsDisabled;let{start:a,count:l}=jV(t,r,s);this._drawStart=a,this._drawCount=l,mV(t)&&(a=0,l=r.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!o._decimated,i.points=r;const u=this.resolveDatasetElementOptions(e);this.options.showLine||(u.borderWidth=0),u.segment=this.options.segment,this.updateElement(i,void 0,{animated:!s,options:u},e),this.updateElements(r,a,l,e)}updateElements(e,t,i,r){const o=r==="reset",{iScale:s,vScale:a,_stacked:l,_dataset:u}=this._cachedMeta,{sharedOptions:d,includeOptions:M}=this._getSharedOptions(t,r),h=s.axis,g=a.axis,{spanGaps:f,segment:p}=this.options,N=ul(f)?f:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||o||r==="none",j=t+i,A=e.length;let w=t>0&&this.getParsed(t-1);for(let k=0;k<A;++k){const L=e[k],E=y?L:{};if(k<t||k>=j){E.skip=!0;continue}const T=this.getParsed(k),x=Be(T[g]),b=E[h]=s.getPixelForValue(T[h],k),m=E[g]=o||x?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,T,l):T[g],k);E.skip=isNaN(b)||isNaN(m)||x,E.stop=k>0&&Math.abs(T[h]-w[h])>N,p&&(E.parsed=T,E.raw=u.data[k]),M&&(E.options=d||this.resolveDataElementOptions(k,L.active?"active":r)),y||this.updateElement(L,k,E,r),w=T}}getMaxOverflow(){const e=this._cachedMeta,t=e.dataset,i=t.options&&t.options.borderWidth||0,r=e.data||[];if(!r.length)return i;const o=r[0].size(this.resolveDataElementOptions(0)),s=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(i,o,s)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}ne(nM,"id","line"),ne(nM,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),ne(nM,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});function Ro(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class AN{constructor(e){ne(this,"options");this.options=e||{}}static override(e){Object.assign(AN.prototype,e)}init(){}formats(){return Ro()}parse(){return Ro()}format(){return Ro()}add(){return Ro()}diff(){return Ro()}startOf(){return Ro()}endOf(){return Ro()}}var H6={_date:AN};function G6(n,e,t,i){const{controller:r,data:o,_sorted:s}=n,a=r._cachedMeta.iScale;if(a&&e===a.axis&&e!=="r"&&s&&o.length){const l=a._reversePixels?fV:Oo;if(i){if(r._sharedOptions){const u=o[0],d=typeof u.getRange=="function"&&u.getRange(e);if(d){const M=l(o,e,t-d),h=l(o,e,t+d);return{lo:M.lo,hi:h.hi}}}}else return l(o,e,t)}return{lo:0,hi:o.length-1}}function pl(n,e,t,i,r){const o=n.getSortedVisibleDatasetMetas(),s=t[e];for(let a=0,l=o.length;a<l;++a){const{index:u,data:d}=o[a],{lo:M,hi:h}=G6(o[a],e,s,r);for(let g=M;g<=h;++g){const f=d[g];f.skip||i(f,u,g)}}}function $6(n){const e=n.indexOf("x")!==-1,t=n.indexOf("y")!==-1;return function(i,r){const o=e?Math.abs(i.x-r.x):0,s=t?Math.abs(i.y-r.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(s,2))}}function bN(n,e,t,i,r){const o=[];return!r&&!n.isPointInArea(e)||pl(n,t,e,function(a,l,u){!r&&!or(a,n.chartArea,0)||a.inRange(e.x,e.y,i)&&o.push({element:a,datasetIndex:l,index:u})},!0),o}function J6(n,e,t,i){let r=[];function o(s,a,l){const{startAngle:u,endAngle:d}=s.getProps(["startAngle","endAngle"],i),{angle:M}=MV(s,{x:e.x,y:e.y});W4(M,u,d)&&r.push({element:s,datasetIndex:a,index:l})}return pl(n,t,e,o),r}function X6(n,e,t,i,r,o){let s=[];const a=$6(t);let l=Number.POSITIVE_INFINITY;function u(d,M,h){const g=d.inRange(e.x,e.y,r);if(i&&!g)return;const f=d.getCenterPoint(r);if(!(!!o||n.isPointInArea(f))&&!g)return;const N=a(e,f);N<l?(s=[{element:d,datasetIndex:M,index:h}],l=N):N===l&&s.push({element:d,datasetIndex:M,index:h})}return pl(n,t,e,u),s}function LN(n,e,t,i,r,o){return!o&&!n.isPointInArea(e)?[]:t==="r"&&!i?J6(n,e,t,r):X6(n,e,t,i,r,o)}function OD(n,e,t,i,r){const o=[],s=t==="x"?"inXRange":"inYRange";let a=!1;return pl(n,t,e,(l,u,d)=>{l[s](e[t],r)&&(o.push({element:l,datasetIndex:u,index:d}),a=a||l.inRange(e.x,e.y,r))}),i&&!a?[]:o}var K6={evaluateInteractionItems:pl,modes:{index(n,e,t,i){const r=Yo(e,n),o=t.axis||"x",s=t.includeInvisible||!1,a=t.intersect?bN(n,r,o,i,s):LN(n,r,o,!1,i,s),l=[];return a.length?(n.getSortedVisibleDatasetMetas().forEach(u=>{const d=a[0].index,M=u.data[d];M&&!M.skip&&l.push({element:M,datasetIndex:u.index,index:d})}),l):[]},dataset(n,e,t,i){const r=Yo(e,n),o=t.axis||"xy",s=t.includeInvisible||!1;let a=t.intersect?bN(n,r,o,i,s):LN(n,r,o,!1,i,s);if(a.length>0){const l=a[0].datasetIndex,u=n.getDatasetMeta(l).data;a=[];for(let d=0;d<u.length;++d)a.push({element:u[d],datasetIndex:l,index:d})}return a},point(n,e,t,i){const r=Yo(e,n),o=t.axis||"xy",s=t.includeInvisible||!1;return bN(n,r,o,i,s)},nearest(n,e,t,i){const r=Yo(e,n),o=t.axis||"xy",s=t.includeInvisible||!1;return LN(n,r,o,t.intersect,i,s)},x(n,e,t,i){const r=Yo(e,n);return OD(n,r,"x",t.intersect,i)},y(n,e,t,i){const r=Yo(e,n);return OD(n,r,"y",t.intersect,i)}}};const vD=["left","top","right","bottom"];function Nl(n,e){return n.filter(t=>t.pos===e)}function UD(n,e){return n.filter(t=>vD.indexOf(t.pos)===-1&&t.box.axis===e)}function yl(n,e){return n.sort((t,i)=>{const r=e?i:t,o=e?t:i;return r.weight===o.weight?r.index-o.index:r.weight-o.weight})}function q6(n){const e=[];let t,i,r,o,s,a;for(t=0,i=(n||[]).length;t<i;++t)r=n[t],{position:o,options:{stack:s,stackWeight:a=1}}=r,e.push({index:t,box:r,pos:o,horizontal:r.isHorizontal(),weight:r.weight,stack:s&&o+s,stackWeight:a});return e}function eB(n){const e={};for(const t of n){const{stack:i,pos:r,stackWeight:o}=t;if(!i||!vD.includes(r))continue;const s=e[i]||(e[i]={count:0,placed:0,weight:0,size:0});s.count++,s.weight+=o}return e}function tB(n,e){const t=eB(n),{vBoxMaxWidth:i,hBoxMaxHeight:r}=e;let o,s,a;for(o=0,s=n.length;o<s;++o){a=n[o];const{fullSize:l}=a.box,u=t[a.stack],d=u&&a.stackWeight/u.weight;a.horizontal?(a.width=d?d*i:l&&e.availableWidth,a.height=r):(a.width=i,a.height=d?d*r:l&&e.availableHeight)}return t}function nB(n){const e=q6(n),t=yl(e.filter(u=>u.box.fullSize),!0),i=yl(Nl(e,"left"),!0),r=yl(Nl(e,"right")),o=yl(Nl(e,"top"),!0),s=yl(Nl(e,"bottom")),a=UD(e,"x"),l=UD(e,"y");return{fullSize:t,leftAndTop:i.concat(o),rightAndBottom:r.concat(l).concat(s).concat(a),chartArea:Nl(e,"chartArea"),vertical:i.concat(r).concat(l),horizontal:o.concat(s).concat(a)}}function QD(n,e,t,i){return Math.max(n[t],e[t])+Math.max(n[i],e[i])}function YD(n,e){n.top=Math.max(n.top,e.top),n.left=Math.max(n.left,e.left),n.bottom=Math.max(n.bottom,e.bottom),n.right=Math.max(n.right,e.right)}function iB(n,e,t,i){const{pos:r,box:o}=t,s=n.maxPadding;if(!Se(r)){t.size&&(n[r]-=t.size);const M=i[t.stack]||{size:0,count:1};M.size=Math.max(M.size,t.horizontal?o.height:o.width),t.size=M.size/M.count,n[r]+=t.size}o.getPadding&&YD(s,o.getPadding());const a=Math.max(0,e.outerWidth-QD(s,n,"left","right")),l=Math.max(0,e.outerHeight-QD(s,n,"top","bottom")),u=a!==n.w,d=l!==n.h;return n.w=a,n.h=l,t.horizontal?{same:u,other:d}:{same:d,other:u}}function rB(n){const e=n.maxPadding;function t(i){const r=Math.max(e[i]-n[i],0);return n[i]+=r,r}n.y+=t("top"),n.x+=t("left"),t("right"),t("bottom")}function oB(n,e){const t=e.maxPadding;function i(r){const o={left:0,top:0,right:0,bottom:0};return r.forEach(s=>{o[s]=Math.max(e[s],t[s])}),o}return i(n?["left","right"]:["top","bottom"])}function jl(n,e,t,i){const r=[];let o,s,a,l,u,d;for(o=0,s=n.length,u=0;o<s;++o){a=n[o],l=a.box,l.update(a.width||e.w,a.height||e.h,oB(a.horizontal,e));const{same:M,other:h}=iB(e,t,a,i);u|=M&&r.length,d=d||h,l.fullSize||r.push(a)}return u&&jl(r,e,t,i)||d}function iM(n,e,t,i,r){n.top=t,n.left=e,n.right=e+i,n.bottom=t+r,n.width=i,n.height=r}function _D(n,e,t,i){const r=t.padding;let{x:o,y:s}=e;for(const a of n){const l=a.box,u=i[a.stack]||{count:1,placed:0,weight:1},d=a.stackWeight/u.weight||1;if(a.horizontal){const M=e.w*d,h=u.size||l.height;ll(u.start)&&(s=u.start),l.fullSize?iM(l,r.left,s,t.outerWidth-r.right-r.left,h):iM(l,e.left+u.placed,s,M,h),u.start=s,u.placed+=M,s=l.bottom}else{const M=e.h*d,h=u.size||l.width;ll(u.start)&&(o=u.start),l.fullSize?iM(l,o,r.top,h,t.outerHeight-r.bottom-r.top):iM(l,o,e.top+u.placed,h,M),u.start=o,u.placed+=M,o=l.right}}e.x=o,e.y=s}var Br={addBox(n,e){n.boxes||(n.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},n.boxes.push(e)},removeBox(n,e){const t=n.boxes?n.boxes.indexOf(e):-1;t!==-1&&n.boxes.splice(t,1)},configure(n,e,t){e.fullSize=t.fullSize,e.position=t.position,e.weight=t.weight},update(n,e,t,i){if(!n)return;const r=_n(n.options.layout.padding),o=Math.max(e-r.width,0),s=Math.max(t-r.height,0),a=nB(n.boxes),l=a.vertical,u=a.horizontal;Ze(n.boxes,p=>{typeof p.beforeLayout=="function"&&p.beforeLayout()});const d=l.reduce((p,N)=>N.box.options&&N.box.options.display===!1?p:p+1,0)||1,M=Object.freeze({outerWidth:e,outerHeight:t,padding:r,availableWidth:o,availableHeight:s,vBoxMaxWidth:o/2/d,hBoxMaxHeight:s/2}),h=Object.assign({},r);YD(h,_n(i));const g=Object.assign({maxPadding:h,w:o,h:s,x:r.left,y:r.top},r),f=tB(l.concat(u),M);jl(a.fullSize,g,M,f),jl(l,g,M,f),jl(u,g,M,f)&&jl(l,g,M,f),rB(g),_D(a.leftAndTop,g,M,f),g.x+=g.w,g.y+=g.h,_D(a.rightAndBottom,g,M,f),n.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},Ze(a.chartArea,p=>{const N=p.box;Object.assign(N,n.chartArea),N.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})})}};class RD{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,i){}removeEventListener(e,t,i){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,i,r){return t=Math.max(0,t||e.width),i=i||e.height,{width:t,height:Math.max(0,r?Math.floor(t/r):i)}}isAttached(e){return!0}updateConfig(e){}}class sB extends RD{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const rM="$chartjs",aB={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},VD=n=>n===null||n==="";function lB(n,e){const t=n.style,i=n.getAttribute("height"),r=n.getAttribute("width");if(n[rM]={initial:{height:i,width:r,style:{display:t.display,height:t.height,width:t.width}}},t.display=t.display||"block",t.boxSizing=t.boxSizing||"border-box",VD(r)){const o=gD(n,"width");o!==void 0&&(n.width=o)}if(VD(i))if(n.style.height==="")n.height=n.width/(e||2);else{const o=gD(n,"height");o!==void 0&&(n.height=o)}return n}const BD=u6?{passive:!0}:!1;function cB(n,e,t){n&&n.addEventListener(e,t,BD)}function uB(n,e,t){n&&n.canvas&&n.canvas.removeEventListener(e,t,BD)}function dB(n,e){const t=aB[n.type]||n.type,{x:i,y:r}=Yo(n,e);return{type:t,chart:e,native:n,x:i!==void 0?i:null,y:r!==void 0?r:null}}function oM(n,e){for(const t of n)if(t===e||t.contains(e))return!0}function MB(n,e,t){const i=n.canvas,r=new MutationObserver(o=>{let s=!1;for(const a of o)s=s||oM(a.addedNodes,i),s=s&&!oM(a.removedNodes,i);s&&t()});return r.observe(document,{childList:!0,subtree:!0}),r}function hB(n,e,t){const i=n.canvas,r=new MutationObserver(o=>{let s=!1;for(const a of o)s=s||oM(a.removedNodes,i),s=s&&!oM(a.addedNodes,i);s&&t()});return r.observe(document,{childList:!0,subtree:!0}),r}const ml=new Map;let ZD=0;function PD(){const n=window.devicePixelRatio;n!==ZD&&(ZD=n,ml.forEach((e,t)=>{t.currentDevicePixelRatio!==n&&e()}))}function gB(n,e){ml.size||window.addEventListener("resize",PD),ml.set(n,e)}function fB(n){ml.delete(n),ml.size||window.removeEventListener("resize",PD)}function pB(n,e,t){const i=n.canvas,r=i&&IN(i);if(!r)return;const o=J4((a,l)=>{const u=r.clientWidth;t(a,l),u<r.clientWidth&&t()},window),s=new ResizeObserver(a=>{const l=a[0],u=l.contentRect.width,d=l.contentRect.height;u===0&&d===0||o(u,d)});return s.observe(r),gB(n,o),s}function kN(n,e,t){t&&t.disconnect(),e==="resize"&&fB(n)}function NB(n,e,t){const i=n.canvas,r=J4(o=>{n.ctx!==null&&t(dB(o,n))},n);return cB(i,e,r),r}class yB extends RD{acquireContext(e,t){const i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(lB(e,t),i):null}releaseContext(e){const t=e.canvas;if(!t[rM])return!1;const i=t[rM].initial;["height","width"].forEach(o=>{const s=i[o];Be(s)?t.removeAttribute(o):t.setAttribute(o,s)});const r=i.style||{};return Object.keys(r).forEach(o=>{t.style[o]=r[o]}),t.width=t.width,delete t[rM],!0}addEventListener(e,t,i){this.removeEventListener(e,t);const r=e.$proxies||(e.$proxies={}),s={attach:MB,detach:hB,resize:pB}[t]||NB;r[t]=s(e,t,i)}removeEventListener(e,t){const i=e.$proxies||(e.$proxies={}),r=i[t];if(!r)return;({attach:kN,detach:kN,resize:kN}[t]||uB)(e,t,r),i[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,i,r){return c6(e,t,i,r)}isAttached(e){const t=IN(e);return!!(t&&t.isConnected)}}function jB(n){return!mN()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?sB:yB}let Vo=($g=class{constructor(){ne(this,"x");ne(this,"y");ne(this,"active",!1);ne(this,"options");ne(this,"$animations")}tooltipPosition(e){const{x:t,y:i}=this.getProps(["x","y"],e);return{x:t,y:i}}hasValue(){return ul(this.x)&&ul(this.y)}getProps(e,t){const i=this.$animations;if(!t||!i)return this;const r={};return e.forEach(o=>{r[o]=i[o]&&i[o].active()?i[o]._to:this[o]}),r}},ne($g,"defaults",{}),ne($g,"defaultRoutes"),$g);function mB(n,e){const t=n.options.ticks,i=IB(n),r=Math.min(t.maxTicksLimit||i,i),o=t.major.enabled?TB(e):[],s=o.length,a=o[0],l=o[s-1],u=[];if(s>r)return xB(e,u,o,s/r),u;const d=DB(o,e,r);if(s>0){let M,h;const g=s>1?Math.round((l-a)/(s-1)):null;for(sM(e,u,d,Be(g)?0:a-g,a),M=0,h=s-1;M<h;M++)sM(e,u,d,o[M],o[M+1]);return sM(e,u,d,l,Be(g)?e.length:l+g),u}return sM(e,u,d),u}function IB(n){const e=n.options.offset,t=n._tickSize(),i=n._length/t+(e?0:1),r=n._maxLength/t;return Math.floor(Math.min(i,r))}function DB(n,e,t){const i=zB(n),r=e.length/t;if(!i)return Math.max(r,1);const o=uV(i);for(let s=0,a=o.length-1;s<a;s++){const l=o[s];if(l>r)return l}return Math.max(r,1)}function TB(n){const e=[];let t,i;for(t=0,i=n.length;t<i;t++)n[t].major&&e.push(t);return e}function xB(n,e,t,i){let r=0,o=t[0],s;for(i=Math.ceil(i),s=0;s<n.length;s++)s===o&&(e.push(n[s]),r++,o=t[r*i])}function sM(n,e,t,i,r){const o=Ye(i,0),s=Math.min(Ye(r,n.length),n.length);let a=0,l,u,d;for(t=Math.ceil(t),r&&(l=r-i,t=l/Math.floor(l/t)),d=o;d<0;)a++,d=Math.round(o+a*t);for(u=Math.max(o,0);u<s;u++)u===d&&(e.push(n[u]),a++,d=Math.round(o+a*t))}function zB(n){const e=n.length;let t,i;if(e<2)return!1;for(i=n[0],t=1;t<e;++t)if(n[t]-n[t-1]!==i)return!1;return i}const AB=n=>n==="left"?"right":n==="right"?"left":n,WD=(n,e,t)=>e==="top"||e==="left"?n[e]+t:n[e]-t,FD=(n,e)=>Math.min(e||n,n);function HD(n,e){const t=[],i=n.length/e,r=n.length;let o=0;for(;o<r;o+=i)t.push(n[Math.floor(o)]);return t}function bB(n,e,t){const i=n.ticks.length,r=Math.min(e,i-1),o=n._startPixel,s=n._endPixel,a=1e-6;let l=n.getPixelForTick(r),u;if(!(t&&(i===1?u=Math.max(l-o,s-l):e===0?u=(n.getPixelForTick(1)-l)/2:u=(l-n.getPixelForTick(r-1))/2,l+=r<e?u:-u,l<o-a||l>s+a)))return l}function LB(n,e){Ze(n,t=>{const i=t.gc,r=i.length/2;let o;if(r>e){for(o=0;o<r;++o)delete t.data[i[o]];i.splice(0,r)}})}function Il(n){return n.drawTicks?n.tickLength:0}function GD(n,e){if(!n.display)return 0;const t=dn(n.font,e),i=_n(n.padding);return(Xe(n.text)?n.text.length:1)*t.lineHeight+i.height}function kB(n,e){return Vr(n,{scale:e,type:"scale"})}function CB(n,e,t){return Vr(n,{tick:t,index:e,type:"tick"})}function wB(n,e,t){let i=X4(n);return(t&&e!=="right"||!t&&e==="right")&&(i=AB(i)),i}function EB(n,e,t,i){const{top:r,left:o,bottom:s,right:a,chart:l}=n,{chartArea:u,scales:d}=l;let M=0,h,g,f;const p=s-r,N=a-o;if(n.isHorizontal()){if(g=dl(i,o,a),Se(t)){const y=Object.keys(t)[0],j=t[y];f=d[y].getPixelForValue(j)+p-e}else t==="center"?f=(u.bottom+u.top)/2+p-e:f=WD(n,t,e);h=a-o}else{if(Se(t)){const y=Object.keys(t)[0],j=t[y];g=d[y].getPixelForValue(j)-N+e}else t==="center"?g=(u.left+u.right)/2-N+e:g=WD(n,t,e);f=dl(i,s,r),M=t==="left"?-Un:Un}return{titleX:g,titleY:f,maxWidth:h,rotation:M}}class Bo extends Vo{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.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(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,t){return e}getUserBounds(){let{_userMin:e,_userMax:t,_suggestedMin:i,_suggestedMax:r}=this;return e=On(e,Number.POSITIVE_INFINITY),t=On(t,Number.NEGATIVE_INFINITY),i=On(i,Number.POSITIVE_INFINITY),r=On(r,Number.NEGATIVE_INFINITY),{min:On(e,i),max:On(t,r),minDefined:ft(e),maxDefined:ft(t)}}getMinMax(e){let{min:t,max:i,minDefined:r,maxDefined:o}=this.getUserBounds(),s;if(r&&o)return{min:t,max:i};const a=this.getMatchingVisibleMetas();for(let l=0,u=a.length;l<u;++l)s=a[l].controller.getMinMax(this,e),r||(t=Math.min(t,s.min)),o||(i=Math.max(i,s.max));return t=o&&t>i?i:t,i=r&&t>i?t:i,{min:On(t,On(i,t)),max:On(i,On(t,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){pt(this.options.beforeUpdate,[this])}update(e,t,i){const{beginAtZero:r,grace:o,ticks:s}=this.options,a=s.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=VV(this,o,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?HD(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),s.display&&(s.autoSkip||s.source==="auto")&&(this.ticks=mB(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e=this.options.reverse,t,i;this.isHorizontal()?(t=this.left,i=this.right):(t=this.top,i=this.bottom,e=!e),this._startPixel=t,this._endPixel=i,this._reversePixels=e,this._length=i-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){pt(this.options.afterUpdate,[this])}beforeSetDimensions(){pt(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(){pt(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),pt(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){pt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){const t=this.options.ticks;let i,r,o;for(i=0,r=e.length;i<r;i++)o=e[i],o.label=pt(t.callback,[o.value,i,e],this)}afterTickToLabelConversion(){pt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){pt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,t=e.ticks,i=FD(this.ticks.length,e.ticks.maxTicksLimit),r=t.minRotation||0,o=t.maxRotation;let s=r,a,l,u;if(!this._isVisible()||!t.display||r>=o||i<=1||!this.isHorizontal()){this.labelRotation=r;return}const d=this._getLabelSizes(),M=d.widest.width,h=d.highest.height,g=Yn(this.chart.width-M,0,this.maxWidth);a=e.offset?this.maxWidth/i:g/(i-1),M+6>a&&(a=g/(i-(e.offset?.5:1)),l=this.maxHeight-Il(e.grid)-t.padding-GD(e.title,this.chart.options.font),u=Math.sqrt(M*M+h*h),s=sN(Math.min(Math.asin(Yn((d.highest.height+6)/a,-1,1)),Math.asin(Yn(l/u,-1,1))-Math.asin(Yn(h/u,-1,1)))),s=Math.max(r,Math.min(o,s))),this.labelRotation=s}afterCalculateLabelRotation(){pt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){pt(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:t,options:{ticks:i,title:r,grid:o}}=this,s=this._isVisible(),a=this.isHorizontal();if(s){const l=GD(r,t.options.font);if(a?(e.width=this.maxWidth,e.height=Il(o)+l):(e.height=this.maxHeight,e.width=Il(o)+l),i.display&&this.ticks.length){const{first:u,last:d,widest:M,highest:h}=this._getLabelSizes(),g=i.padding*2,f=Rr(this.labelRotation),p=Math.cos(f),N=Math.sin(f);if(a){const y=i.mirror?0:N*M.width+p*h.height;e.height=Math.min(this.maxHeight,e.height+y+g)}else{const y=i.mirror?0:p*M.width+N*h.height;e.width=Math.min(this.maxWidth,e.width+y+g)}this._calculatePadding(u,d,N,p)}}this._handleMargins(),a?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,i,r){const{ticks:{align:o,padding:s},position:a}=this.options,l=this.labelRotation!==0,u=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const d=this.getPixelForTick(0)-this.left,M=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,g=0;l?u?(h=r*e.width,g=i*t.height):(h=i*e.height,g=r*t.width):o==="start"?g=t.width:o==="end"?h=e.width:o!=="inner"&&(h=e.width/2,g=t.width/2),this.paddingLeft=Math.max((h-d+s)*this.width/(this.width-d),0),this.paddingRight=Math.max((g-M+s)*this.width/(this.width-M),0)}else{let d=t.height/2,M=e.height/2;o==="start"?(d=0,M=e.height):o==="end"&&(d=t.height,M=0),this.paddingTop=d+s,this.paddingBottom=M+s}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){pt(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:t}=this.options;return t==="top"||t==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let t,i;for(t=0,i=e.length;t<i;t++)Be(e[t].label)&&(e.splice(t,1),i--,t--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){const t=this.options.ticks.sampleSize;let i=this.ticks;t<i.length&&(i=HD(i,t)),this._labelSizes=e=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,t,i){const{ctx:r,_longestTextCache:o}=this,s=[],a=[],l=Math.floor(t/FD(t,i));let u=0,d=0,M,h,g,f,p,N,y,j,A,w,k;for(M=0;M<t;M+=l){if(f=e[M].label,p=this._resolveTickFontOptions(M),r.font=N=p.string,y=o[N]=o[N]||{data:{},gc:[]},j=p.lineHeight,A=w=0,!Be(f)&&!Xe(f))A=Gd(r,y.data,y.gc,A,f),w=j;else if(Xe(f))for(h=0,g=f.length;h<g;++h)k=f[h],!Be(k)&&!Xe(k)&&(A=Gd(r,y.data,y.gc,A,k),w+=j);s.push(A),a.push(w),u=Math.max(A,u),d=Math.max(w,d)}LB(o,t);const L=s.indexOf(u),E=a.indexOf(d),T=x=>({width:s[x]||0,height:a[x]||0});return{first:T(0),last:T(t-1),widest:T(L),highest:T(E),widths:s,heights:a}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const t=this._startPixel+e*this._length;return gV(this._alignToPixels?Uo(this.chart,t,0):t)}getDecimalForPixel(e){const t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){const t=this.ticks||[];if(e>=0&&e<t.length){const i=t[e];return i.$context||(i.$context=CB(this.getContext(),e,i))}return this.$context||(this.$context=kB(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,t=Rr(this.labelRotation),i=Math.abs(Math.cos(t)),r=Math.abs(Math.sin(t)),o=this._getLabelSizes(),s=e.autoSkipPadding||0,a=o?o.widest.width+s:0,l=o?o.highest.height+s:0;return this.isHorizontal()?l*i>a*r?a/i:l/r:l*r<a*i?l/i:a/r}_isVisible(){const e=this.options.display;return e!=="auto"?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){const t=this.axis,i=this.chart,r=this.options,{grid:o,position:s,border:a}=r,l=o.offset,u=this.isHorizontal(),M=this.ticks.length+(l?1:0),h=Il(o),g=[],f=a.setContext(this.getContext()),p=f.display?f.width:0,N=p/2,y=function(S){return Uo(i,S,p)};let j,A,w,k,L,E,T,x,b,m,I,D;if(s==="top")j=y(this.bottom),E=this.bottom-h,x=j-N,m=y(e.top)+N,D=e.bottom;else if(s==="bottom")j=y(this.top),m=e.top,D=y(e.bottom)-N,E=j+N,x=this.top+h;else if(s==="left")j=y(this.right),L=this.right-h,T=j-N,b=y(e.left)+N,I=e.right;else if(s==="right")j=y(this.left),b=e.left,I=y(e.right)-N,L=j+N,T=this.left+h;else if(t==="x"){if(s==="center")j=y((e.top+e.bottom)/2+.5);else if(Se(s)){const S=Object.keys(s)[0],O=s[S];j=y(this.chart.scales[S].getPixelForValue(O))}m=e.top,D=e.bottom,E=j+N,x=E+h}else if(t==="y"){if(s==="center")j=y((e.left+e.right)/2);else if(Se(s)){const S=Object.keys(s)[0],O=s[S];j=y(this.chart.scales[S].getPixelForValue(O))}L=j-N,T=L-h,b=e.left,I=e.right}const C=Ye(r.ticks.maxTicksLimit,M),z=Math.max(1,Math.ceil(M/C));for(A=0;A<M;A+=z){const S=this.getContext(A),O=o.setContext(S),v=a.setContext(S),Y=O.lineWidth,W=O.color,Q=v.dash||[],U=v.dashOffset,_=O.tickWidth,K=O.tickColor,q=O.tickBorderDash||[],F=O.tickBorderDashOffset;w=bB(this,A,l),w!==void 0&&(k=Uo(i,w,Y),u?L=T=b=I=k:E=x=m=D=k,g.push({tx1:L,ty1:E,tx2:T,ty2:x,x1:b,y1:m,x2:I,y2:D,width:Y,color:W,borderDash:Q,borderDashOffset:U,tickWidth:_,tickColor:K,tickBorderDash:q,tickBorderDashOffset:F}))}return this._ticksLength=M,this._borderValue=j,g}_computeLabelItems(e){const t=this.axis,i=this.options,{position:r,ticks:o}=i,s=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:u,padding:d,mirror:M}=o,h=Il(i.grid),g=h+d,f=M?-d:g,p=-Rr(this.labelRotation),N=[];let y,j,A,w,k,L,E,T,x,b,m,I,D="middle";if(r==="top")L=this.bottom-f,E=this._getXAxisLabelAlignment();else if(r==="bottom")L=this.top+f,E=this._getXAxisLabelAlignment();else if(r==="left"){const z=this._getYAxisLabelAlignment(h);E=z.textAlign,k=z.x}else if(r==="right"){const z=this._getYAxisLabelAlignment(h);E=z.textAlign,k=z.x}else if(t==="x"){if(r==="center")L=(e.top+e.bottom)/2+g;else if(Se(r)){const z=Object.keys(r)[0],S=r[z];L=this.chart.scales[z].getPixelForValue(S)+g}E=this._getXAxisLabelAlignment()}else if(t==="y"){if(r==="center")k=(e.left+e.right)/2-g;else if(Se(r)){const z=Object.keys(r)[0],S=r[z];k=this.chart.scales[z].getPixelForValue(S)}E=this._getYAxisLabelAlignment(h).textAlign}t==="y"&&(l==="start"?D="top":l==="end"&&(D="bottom"));const C=this._getLabelSizes();for(y=0,j=a.length;y<j;++y){A=a[y],w=A.label;const z=o.setContext(this.getContext(y));T=this.getPixelForTick(y)+o.labelOffset,x=this._resolveTickFontOptions(y),b=x.lineHeight,m=Xe(w)?w.length:1;const S=m/2,O=z.color,v=z.textStrokeColor,Y=z.textStrokeWidth;let W=E;s?(k=T,E==="inner"&&(y===j-1?W=this.options.reverse?"left":"right":y===0?W=this.options.reverse?"right":"left":W="center"),r==="top"?u==="near"||p!==0?I=-m*b+b/2:u==="center"?I=-C.highest.height/2-S*b+b:I=-C.highest.height+b/2:u==="near"||p!==0?I=b/2:u==="center"?I=C.highest.height/2-S*b:I=C.highest.height-m*b,M&&(I*=-1),p!==0&&!z.showLabelBackdrop&&(k+=b/2*Math.sin(p))):(L=T,I=(1-m)*b/2);let Q;if(z.showLabelBackdrop){const U=_n(z.backdropPadding),_=C.heights[y],K=C.widths[y];let q=I-U.top,F=0-U.left;switch(D){case"middle":q-=_/2;break;case"bottom":q-=_;break}switch(E){case"center":F-=K/2;break;case"right":F-=K;break;case"inner":y===j-1?F-=K:y>0&&(F-=K/2);break}Q={left:F,top:q,width:K+U.width,height:_+U.height,color:z.backdropColor}}N.push({label:w,font:x,textOffset:I,options:{rotation:p,color:O,strokeColor:v,strokeWidth:Y,textAlign:W,textBaseline:D,translation:[k,L],backdrop:Q}})}return N}_getXAxisLabelAlignment(){const{position:e,ticks:t}=this.options;if(-Rr(this.labelRotation))return e==="top"?"left":"right";let r="center";return t.align==="start"?r="left":t.align==="end"?r="right":t.align==="inner"&&(r="inner"),r}_getYAxisLabelAlignment(e){const{position:t,ticks:{crossAlign:i,mirror:r,padding:o}}=this.options,s=this._getLabelSizes(),a=e+o,l=s.widest.width;let u,d;return t==="left"?r?(d=this.right+o,i==="near"?u="left":i==="center"?(u="center",d+=l/2):(u="right",d+=l)):(d=this.right-a,i==="near"?u="right":i==="center"?(u="center",d-=l/2):(u="left",d=this.left)):t==="right"?r?(d=this.left+o,i==="near"?u="right":i==="center"?(u="center",d-=l/2):(u="left",d-=l)):(d=this.left+a,i==="near"?u="left":i==="center"?(u="center",d+=l/2):(u="right",d=this.right)):u="right",{textAlign:u,x:d}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,t=this.options.position;if(t==="left"||t==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(t==="top"||t==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){const{ctx:e,options:{backgroundColor:t},left:i,top:r,width:o,height:s}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(i,r,o,s),e.restore())}getLineWidthForValue(e){const t=this.options.grid;if(!this._isVisible()||!t.display)return 0;const r=this.ticks.findIndex(o=>o.value===e);return r>=0?t.setContext(this.getContext(r)).lineWidth:0}drawGrid(e){const t=this.options.grid,i=this.ctx,r=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let o,s;const a=(l,u,d)=>{!d.width||!d.color||(i.save(),i.lineWidth=d.width,i.strokeStyle=d.color,i.setLineDash(d.borderDash||[]),i.lineDashOffset=d.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(u.x,u.y),i.stroke(),i.restore())};if(t.display)for(o=0,s=r.length;o<s;++o){const l=r[o];t.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),t.drawTicks&&a({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:e,ctx:t,options:{border:i,grid:r}}=this,o=i.setContext(this.getContext()),s=i.display?o.width:0;if(!s)return;const a=r.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let u,d,M,h;this.isHorizontal()?(u=Uo(e,this.left,s)-s/2,d=Uo(e,this.right,a)+a/2,M=h=l):(M=Uo(e,this.top,s)-s/2,h=Uo(e,this.bottom,a)+a/2,u=d=l),t.save(),t.lineWidth=o.width,t.strokeStyle=o.color,t.beginPath(),t.moveTo(u,M),t.lineTo(d,h),t.stroke(),t.restore()}drawLabels(e){if(!this.options.ticks.display)return;const i=this.ctx,r=this._computeLabelArea();r&&fN(i,r);const o=this.getLabelItems(e);for(const s of o){const a=s.options,l=s.font,u=s.label,d=s.textOffset;gl(i,u,0,d,l,a)}r&&pN(i)}drawTitle(){const{ctx:e,options:{position:t,title:i,reverse:r}}=this;if(!i.display)return;const o=dn(i.font),s=_n(i.padding),a=i.align;let l=o.lineHeight/2;t==="bottom"||t==="center"||Se(t)?(l+=s.bottom,Xe(i.text)&&(l+=o.lineHeight*(i.text.length-1))):l+=s.top;const{titleX:u,titleY:d,maxWidth:M,rotation:h}=EB(this,l,t,a);gl(e,i.text,0,0,o,{color:i.color,maxWidth:M,rotation:h,textAlign:wB(a,t,r),textBaseline:"middle",translation:[u,d]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){const e=this.options,t=e.ticks&&e.ticks.z||0,i=Ye(e.grid&&e.grid.z,-1),r=Ye(e.border&&e.border.z,0);return!this._isVisible()||this.draw!==Bo.prototype.draw?[{z:t,draw:o=>{this.draw(o)}}]:[{z:i,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:r,draw:()=>{this.drawBorder()}},{z:t,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(e){const t=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",r=[];let o,s;for(o=0,s=t.length;o<s;++o){const a=t[o];a[i]===this.id&&(!e||a.type===e)&&r.push(a)}return r}_resolveTickFontOptions(e){const t=this.options.ticks.setContext(this.getContext(e));return dn(t.font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class aM{constructor(e,t,i){this.type=e,this.scope=t,this.override=i,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){const t=Object.getPrototypeOf(e);let i;vB(t)&&(i=this.register(t));const r=this.items,o=e.id,s=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+e);return o in r||(r[o]=e,SB(e,s,i),this.override&&zt.override(e.id,e.overrides)),s}get(e){return this.items[e]}unregister(e){const t=this.items,i=e.id,r=this.scope;i in t&&delete t[i],r&&i in zt[r]&&(delete zt[r][i],this.override&&delete vo[i])}}function SB(n,e,t){const i=sl(Object.create(null),[t?zt.get(t):{},zt.get(e),n.defaults]);zt.set(e,i),n.defaultRoutes&&OB(e,n.defaultRoutes),n.descriptors&&zt.describe(e,n.descriptors)}function OB(n,e){Object.keys(e).forEach(t=>{const i=t.split("."),r=i.pop(),o=[n].concat(i).join("."),s=e[t].split("."),a=s.pop(),l=s.join(".");zt.route(o,r,l,a)})}function vB(n){return"id"in n&&"defaults"in n}class UB{constructor(){this.controllers=new aM(Zs,"datasets",!0),this.elements=new aM(Vo,"elements"),this.plugins=new aM(Object,"plugins"),this.scales=new aM(Bo,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,t,i){[...t].forEach(r=>{const o=i||this._getRegistryForType(r);i||o.isForType(r)||o===this.plugins&&r.id?this._exec(e,o,r):Ze(r,s=>{const a=i||this._getRegistryForType(s);this._exec(e,a,s)})})}_exec(e,t,i){const r=oN(e);pt(i["before"+r],[],i),t[e](i),pt(i["after"+r],[],i)}_getRegistryForType(e){for(let t=0;t<this._typedRegistries.length;t++){const i=this._typedRegistries[t];if(i.isForType(e))return i}return this.plugins}_get(e,t,i){const r=t.get(e);if(r===void 0)throw new Error('"'+e+'" is not a registered '+i+".");return r}}var Oi=new UB;class QB{constructor(){this._init=[]}notify(e,t,i,r){t==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install"));const o=r?this._descriptors(e).filter(r):this._descriptors(e),s=this._notify(o,e,t,i);return t==="afterDestroy"&&(this._notify(o,e,"stop"),this._notify(this._init,e,"uninstall")),s}_notify(e,t,i,r){r=r||{};for(const o of e){const s=o.plugin,a=s[i],l=[t,r,o.options];if(pt(a,l,s)===!1&&r.cancelable)return!1}return!0}invalidate(){Be(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const t=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),t}_createDescriptors(e,t){const i=e&&e.config,r=Ye(i.options&&i.options.plugins,{}),o=YB(i);return r===!1&&!t?[]:RB(e,o,r,t)}_notifyStateChanges(e){const t=this._oldCache||[],i=this._cache,r=(o,s)=>o.filter(a=>!s.some(l=>a.plugin.id===l.plugin.id));this._notify(r(t,i),e,"stop"),this._notify(r(i,t),e,"start")}}function YB(n){const e={},t=[],i=Object.keys(Oi.plugins.items);for(let o=0;o<i.length;o++)t.push(Oi.getPlugin(i[o]));const r=n.plugins||[];for(let o=0;o<r.length;o++){const s=r[o];t.indexOf(s)===-1&&(t.push(s),e[s.id]=!0)}return{plugins:t,localIds:e}}function _B(n,e){return!e&&n===!1?null:n===!0?{}:n}function RB(n,{plugins:e,localIds:t},i,r){const o=[],s=n.getContext();for(const a of e){const l=a.id,u=_B(i[l],r);u!==null&&o.push({plugin:a,options:VB(n.config,{plugin:a,local:t[l]},u,s)})}return o}function VB(n,{plugin:e,local:t},i,r){const o=n.pluginScopeKeys(e),s=n.getOptionScopes(i,o);return t&&e.defaults&&s.push(e.defaults),n.createResolver(s,r,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function CN(n,e){const t=zt.datasets[n]||{};return((e.datasets||{})[n]||{}).indexAxis||e.indexAxis||t.indexAxis||"x"}function BB(n,e){let t=n;return n==="_index_"?t=e:n==="_value_"&&(t=e==="x"?"y":"x"),t}function ZB(n,e){return n===e?"_index_":"_value_"}function $D(n){if(n==="x"||n==="y"||n==="r")return n}function PB(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function wN(n,...e){if($D(n))return n;for(const t of e){const i=t.axis||PB(t.position)||n.length>1&&$D(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function JD(n,e,t){if(t[e+"AxisID"]===n)return{axis:e}}function WB(n,e){if(e.data&&e.data.datasets){const t=e.data.datasets.filter(i=>i.xAxisID===n||i.yAxisID===n);if(t.length)return JD(n,"x",t[0])||JD(n,"y",t[0])}return{}}function FB(n,e){const t=vo[n.type]||{scales:{}},i=e.scales||{},r=CN(n.type,e),o=Object.create(null);return Object.keys(i).forEach(s=>{const a=i[s];if(!Se(a))return console.error(`Invalid scale configuration for scale: ${s}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${s}`);const l=wN(s,a,WB(s,n),zt.scales[a.type]),u=ZB(l,r),d=t.scales||{};o[s]=al(Object.create(null),[{axis:l},a,d[l],d[u]])}),n.data.datasets.forEach(s=>{const a=s.type||n.type,l=s.indexAxis||CN(a,e),d=(vo[a]||{}).scales||{};Object.keys(d).forEach(M=>{const h=BB(M,l),g=s[h+"AxisID"]||h;o[g]=o[g]||Object.create(null),al(o[g],[{axis:h},i[g],d[M]])})}),Object.keys(o).forEach(s=>{const a=o[s];al(a,[zt.scales[a.type],zt.scale])}),o}function XD(n){const e=n.options||(n.options={});e.plugins=Ye(e.plugins,{}),e.scales=FB(n,e)}function KD(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function HB(n){return n=n||{},n.data=KD(n.data),XD(n),n}const qD=new Map,e2=new Set;function lM(n,e){let t=qD.get(n);return t||(t=e(),qD.set(n,t),e2.add(t)),t}const Dl=(n,e,t)=>{const i=_s(e,t);i!==void 0&&n.add(i)};class GB{constructor(e){this._config=HB(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=KD(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),XD(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return lM(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return lM(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return lM(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){const t=e.id,i=this.type;return lM(`${i}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){const i=this._scopeCache;let r=i.get(e);return(!r||t)&&(r=new Map,i.set(e,r)),r}getOptionScopes(e,t,i){const{options:r,type:o}=this,s=this._cachedScopes(e,i),a=s.get(t);if(a)return a;const l=new Set;t.forEach(d=>{e&&(l.add(e),d.forEach(M=>Dl(l,e,M))),d.forEach(M=>Dl(l,r,M)),d.forEach(M=>Dl(l,vo[o]||{},M)),d.forEach(M=>Dl(l,zt,M)),d.forEach(M=>Dl(l,MN,M))});const u=Array.from(l);return u.length===0&&u.push(Object.create(null)),e2.has(t)&&s.set(t,u),u}chartOptionScopes(){const{options:e,type:t}=this;return[e,vo[t]||{},zt.datasets[t]||{},{type:t},zt,MN]}resolveNamedOptions(e,t,i,r=[""]){const o={$shared:!0},{resolver:s,subPrefixes:a}=t2(this._resolverCache,e,r);let l=s;if(JB(s,t)){o.$shared=!1,i=Yr(i)?i():i;const u=this.createResolver(e,i,a);l=Vs(s,i,u)}for(const u of t)o[u]=l[u];return o}createResolver(e,t,i=[""],r){const{resolver:o}=t2(this._resolverCache,e,i);return Se(t)?Vs(o,t,void 0,r):o}}function t2(n,e,t){let i=n.get(e);i||(i=new Map,n.set(e,i));const r=t.join();let o=i.get(r);return o||(o={resolver:NN(e,t),subPrefixes:t.filter(a=>!a.toLowerCase().includes("hover"))},i.set(r,o)),o}const $B=n=>Se(n)&&Object.getOwnPropertyNames(n).some(e=>Yr(n[e]));function JB(n,e){const{isScriptable:t,isIndexable:i}=sD(n);for(const r of e){const o=t(r),s=i(r),a=(s||o)&&n[r];if(o&&(Yr(a)||$B(a))||s&&Xe(a))return!0}return!1}var XB="4.4.2";const KB=["top","bottom","left","right","chartArea"];function n2(n,e){return n==="top"||n==="bottom"||KB.indexOf(n)===-1&&e==="x"}function i2(n,e){return function(t,i){return t[n]===i[n]?t[e]-i[e]:t[n]-i[n]}}function r2(n){const e=n.chart,t=e.options.animation;e.notifyPlugins("afterRender"),pt(t&&t.onComplete,[n],e)}function qB(n){const e=n.chart,t=e.options.animation;pt(t&&t.onProgress,[n],e)}function o2(n){return mN()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const cM={},s2=n=>{const e=o2(n);return Object.values(cM).filter(t=>t.canvas===e).pop()};function e7(n,e,t){const i=Object.keys(n);for(const r of i){const o=+r;if(o>=e){const s=n[r];delete n[r],(t>0||o>e)&&(n[o+t]=s)}}}function t7(n,e,t,i){return!t||n.type==="mouseout"?null:i?e:n}function uM(n,e,t){return n.options.clip?n[t]:e[t]}function n7(n,e){const{xScale:t,yScale:i}=n;return t&&i?{left:uM(t,e,"left"),right:uM(t,e,"right"),top:uM(i,e,"top"),bottom:uM(i,e,"bottom")}:e}let Tl=(Io=class{static register(...e){Oi.add(...e),a2()}static unregister(...e){Oi.remove(...e),a2()}constructor(e,t){const i=this.config=new GB(t),r=o2(e),o=s2(r);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const s=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||jB(r)),this.platform.updateConfig(i);const a=this.platform.acquireContext(r,s.aspectRatio),l=a&&a.canvas,u=l&&l.height,d=l&&l.width;if(this.id=tV(),this.ctx=a,this.canvas=l,this.width=d,this.height=u,this._options=s,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 QB,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=yV(M=>this.update(M),s.resizeDelay||0),this._dataChanges=[],cM[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}sr.listen(this,"complete",r2),sr.listen(this,"progress",qB),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:i,height:r,_aspectRatio:o}=this;return Be(e)?t&&o?o:r?i/r:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return Oi}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():hD(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return iD(this.canvas,this.ctx),this}stop(){return sr.stop(this),this}resize(e,t){sr.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){const i=this.options,r=this.canvas,o=i.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(r,e,t,o),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,hD(this,a,!0)&&(this.notifyPlugins("resize",{size:s}),pt(i.onResize,[this,s],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const t=this.options.scales||{};Ze(t,(i,r)=>{i.id=r})}buildOrUpdateScales(){const e=this.options,t=e.scales,i=this.scales,r=Object.keys(i).reduce((s,a)=>(s[a]=!1,s),{});let o=[];t&&(o=o.concat(Object.keys(t).map(s=>{const a=t[s],l=wN(s,a),u=l==="r",d=l==="x";return{options:a,dposition:u?"chartArea":d?"bottom":"left",dtype:u?"radialLinear":d?"category":"linear"}}))),Ze(o,s=>{const a=s.options,l=a.id,u=wN(l,a),d=Ye(a.type,s.dtype);(a.position===void 0||n2(a.position,u)!==n2(s.dposition))&&(a.position=s.dposition),r[l]=!0;let M=null;if(l in i&&i[l].type===d)M=i[l];else{const h=Oi.getScale(d);M=new h({id:l,type:d,ctx:this.ctx,chart:this}),i[M.id]=M}M.init(a,e)}),Ze(r,(s,a)=>{s||delete i[a]}),Ze(i,s=>{Br.configure(this,s,s.options),Br.addBox(this,s)})}_updateMetasets(){const e=this._metasets,t=this.data.datasets.length,i=e.length;if(e.sort((r,o)=>r.index-o.index),i>t){for(let r=t;r<i;++r)this._destroyDatasetMeta(r);e.splice(t,i-t)}this._sortedMetasets=e.slice(0).sort(i2("order","index"))}_removeUnreferencedMetasets(){const{_metasets:e,data:{datasets:t}}=this;e.length>t.length&&delete this._stacks,e.forEach((i,r)=>{t.filter(o=>o===i._dataset).length===0&&this._destroyDatasetMeta(r)})}buildOrUpdateControllers(){const e=[],t=this.data.datasets;let i,r;for(this._removeUnreferencedMetasets(),i=0,r=t.length;i<r;i++){const o=t[i];let s=this.getDatasetMeta(i);const a=o.type||this.config.type;if(s.type&&s.type!==a&&(this._destroyDatasetMeta(i),s=this.getDatasetMeta(i)),s.type=a,s.indexAxis=o.indexAxis||CN(a,this.options),s.order=o.order||0,s.index=i,s.label=""+o.label,s.visible=this.isDatasetVisible(i),s.controller)s.controller.updateIndex(i),s.controller.linkScales();else{const l=Oi.getController(a),{datasetElementType:u,dataElementType:d}=zt.datasets[a];Object.assign(l,{dataElementType:Oi.getElement(d),datasetElementType:u&&Oi.getElement(u)}),s.controller=new l(this,i),e.push(s.controller)}}return this._updateMetasets(),e}_resetElements(){Ze(this.data.datasets,(e,t)=>{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const t=this.config;t.update();const i=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let s=0;for(let u=0,d=this.data.datasets.length;u<d;u++){const{controller:M}=this.getDatasetMeta(u),h=!r&&o.indexOf(M)===-1;M.buildOrUpdateElements(h),s=Math.max(+M.getMaxOverflow(),s)}s=this._minPadding=i.layout.autoPadding?s:0,this._updateLayout(s),r||Ze(o,u=>{u.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(i2("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Ze(this.scales,e=>{Br.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,t=new Set(Object.keys(this._listeners)),i=new Set(e.events);(!R4(t,i)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(const{method:i,start:r,count:o}of t){const s=i==="_removeElements"?-o:o;e7(e,r,s)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const t=this.data.datasets.length,i=o=>new Set(e.filter(s=>s[0]===o).map((s,a)=>a+","+s.splice(1).join(","))),r=i(0);for(let o=1;o<t;o++)if(!R4(r,i(o)))return;return Array.from(r).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Br.update(this,this.width,this.height,e);const t=this.chartArea,i=t.width<=0||t.height<=0;this._layers=[],Ze(this.boxes,r=>{i&&r.position==="chartArea"||(r.configure&&r.configure(),this._layers.push(...r._layers()))},this),this._layers.forEach((r,o)=>{r._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let t=0,i=this.data.datasets.length;t<i;++t)this.getDatasetMeta(t).controller.configure();for(let t=0,i=this.data.datasets.length;t<i;++t)this._updateDataset(t,Yr(e)?e({datasetIndex:t}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,t){const i=this.getDatasetMeta(e),r={meta:i,index:e,mode:t,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",r)!==!1&&(i.controller._update(t),r.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",r))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(sr.has(this)?this.attached&&!sr.running(this)&&sr.start(this):(this.draw(),r2({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){const{width:i,height:r}=this._resizeBeforeDraw;this._resize(i,r),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const t=this._layers;for(e=0;e<t.length&&t[e].z<=0;++e)t[e].draw(this.chartArea);for(this._drawDatasets();e<t.length;++e)t[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(e){const t=this._sortedMetasets,i=[];let r,o;for(r=0,o=t.length;r<o;++r){const s=t[r];(!e||s.visible)&&i.push(s)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const e=this.getSortedVisibleDatasetMetas();for(let t=e.length-1;t>=0;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const t=this.ctx,i=e._clip,r=!i.disabled,o=n7(e,this.chartArea),s={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(r&&fN(t,{left:i.left===!1?0:o.left-i.left,right:i.right===!1?this.width:o.right+i.right,top:i.top===!1?0:o.top-i.top,bottom:i.bottom===!1?this.height:o.bottom+i.bottom}),e.controller.draw(),r&&pN(t),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(e){return or(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,i,r){const o=K6.modes[t];return typeof o=="function"?o(this,e,i,r):[]}getDatasetMeta(e){const t=this.data.datasets[e],i=this._metasets;let r=i.filter(o=>o&&o._dataset===t).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},i.push(r)),r}getContext(){return this.$context||(this.$context=Vr(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const t=this.data.datasets[e];if(!t)return!1;const i=this.getDatasetMeta(e);return typeof i.hidden=="boolean"?!i.hidden:!t.hidden}setDatasetVisibility(e,t){const i=this.getDatasetMeta(e);i.hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,i){const r=i?"show":"hide",o=this.getDatasetMeta(e),s=o.controller._resolveAnimations(void 0,r);ll(t)?(o.data[t].hidden=!i,this.update()):(this.setDatasetVisibility(e,i),s.update(o,{visible:i}),this.update(a=>a.datasetIndex===e?r:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){const t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),sr.remove(this),e=0,t=this.data.datasets.length;e<t;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:e,ctx:t}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),iD(e,t),this.platform.releaseContext(t),this.canvas=null,this.ctx=null),delete cM[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const e=this._listeners,t=this.platform,i=(o,s)=>{t.addEventListener(this,o,s),e[o]=s},r=(o,s,a)=>{o.offsetX=s,o.offsetY=a,this._eventHandler(o)};Ze(this.options.events,o=>i(o,r))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,t=this.platform,i=(l,u)=>{t.addEventListener(this,l,u),e[l]=u},r=(l,u)=>{e[l]&&(t.removeEventListener(this,l,u),delete e[l])},o=(l,u)=>{this.canvas&&this.resize(l,u)};let s;const a=()=>{r("attach",a),this.attached=!0,this.resize(),i("resize",o),i("detach",s)};s=()=>{this.attached=!1,r("resize",o),this._stop(),this._resize(0,0),i("attach",a)},t.isAttached(this.canvas)?a():s()}unbindEvents(){Ze(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},Ze(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,i){const r=i?"set":"remove";let o,s,a,l;for(t==="dataset"&&(o=this.getDatasetMeta(e[0].datasetIndex),o.controller["_"+r+"DatasetHoverStyle"]()),a=0,l=e.length;a<l;++a){s=e[a];const u=s&&this.getDatasetMeta(s.datasetIndex).controller;u&&u[r+"HoverStyle"](s.element,s.datasetIndex,s.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const t=this._active||[],i=e.map(({datasetIndex:o,index:s})=>{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[s],index:s}});!Bd(i,t)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,t))}notifyPlugins(e,t,i){return this._plugins.notify(this,e,t,i)}isPluginEnabled(e){return this._plugins._cache.filter(t=>t.plugin.id===e).length===1}_updateHoverStyles(e,t,i){const r=this.options.hover,o=(l,u)=>l.filter(d=>!u.some(M=>d.datasetIndex===M.datasetIndex&&d.index===M.index)),s=o(t,e),a=i?e:o(e,t);s.length&&this.updateHoverStyle(s,r.mode,!1),a.length&&r.mode&&this.updateHoverStyle(a,r.mode,!0)}_eventHandler(e,t){const i={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},r=s=>(s.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",i,r)===!1)return;const o=this._handleEvent(e,t,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,r),(o||i.changed)&&this.render(),this}_handleEvent(e,t,i){const{_active:r=[],options:o}=this,s=t,a=this._getActiveElements(e,r,i,s),l=aV(e),u=t7(e,this._lastEvent,i,l);i&&(this._lastEvent=null,pt(o.onHover,[e,a,this],this),l&&pt(o.onClick,[e,a,this],this));const d=!Bd(a,r);return(d||t)&&(this._active=a,this._updateHoverStyles(a,r,t)),this._lastEvent=u,d}_getActiveElements(e,t,i,r){if(e.type==="mouseout")return[];if(!i)return t;const o=this.options.hover;return this.getElementsAtEventForMode(e,o.mode,o,r)}},ne(Io,"defaults",zt),ne(Io,"instances",cM),ne(Io,"overrides",vo),ne(Io,"registry",Oi),ne(Io,"version",XB),ne(Io,"getChart",s2),Io);function a2(){return Ze(Tl.instances,n=>n._plugins.invalidate())}function l2(n,e,t=e){n.lineCap=Ye(t.borderCapStyle,e.borderCapStyle),n.setLineDash(Ye(t.borderDash,e.borderDash)),n.lineDashOffset=Ye(t.borderDashOffset,e.borderDashOffset),n.lineJoin=Ye(t.borderJoinStyle,e.borderJoinStyle),n.lineWidth=Ye(t.borderWidth,e.borderWidth),n.strokeStyle=Ye(t.borderColor,e.borderColor)}function i7(n,e,t){n.lineTo(t.x,t.y)}function r7(n){return n.stepped?EV:n.tension||n.cubicInterpolationMode==="monotone"?SV:i7}function c2(n,e,t={}){const i=n.length,{start:r=0,end:o=i-1}=t,{start:s,end:a}=e,l=Math.max(r,s),u=Math.min(o,a),d=r<s&&o<s||r>a&&o>a;return{count:i,start:l,loop:e.loop,ilen:u<l&&!d?i+u-l:u-l}}function o7(n,e,t,i){const{points:r,options:o}=e,{count:s,start:a,loop:l,ilen:u}=c2(r,t,i),d=r7(o);let{move:M=!0,reverse:h}=i||{},g,f,p;for(g=0;g<=u;++g)f=r[(a+(h?u-g:g))%s],!f.skip&&(M?(n.moveTo(f.x,f.y),M=!1):d(n,p,f,h,o.stepped),p=f);return l&&(f=r[(a+(h?u:0))%s],d(n,p,f,h,o.stepped)),!!l}function s7(n,e,t,i){const r=e.points,{count:o,start:s,ilen:a}=c2(r,t,i),{move:l=!0,reverse:u}=i||{};let d=0,M=0,h,g,f,p,N,y;const j=w=>(s+(u?a-w:w))%o,A=()=>{p!==N&&(n.lineTo(d,N),n.lineTo(d,p),n.lineTo(d,y))};for(l&&(g=r[j(0)],n.moveTo(g.x,g.y)),h=0;h<=a;++h){if(g=r[j(h)],g.skip)continue;const w=g.x,k=g.y,L=w|0;L===f?(k<p?p=k:k>N&&(N=k),d=(M*d+w)/++M):(A(),n.lineTo(w,k),f=L,M=0,p=N=k),y=k}A()}function EN(n){const e=n.options,t=e.borderDash&&e.borderDash.length;return!n._decimated&&!n._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!t?s7:o7}function a7(n){return n.stepped?d6:n.tension||n.cubicInterpolationMode==="monotone"?M6:_o}function l7(n,e,t,i){let r=e._path;r||(r=e._path=new Path2D,e.path(r,t,i)&&r.closePath()),l2(n,e.options),n.stroke(r)}function c7(n,e,t,i){const{segments:r,options:o}=e,s=EN(e);for(const a of r)l2(n,o,a.style),n.beginPath(),s(n,e,a,{start:t,end:t+i-1})&&n.closePath(),n.stroke()}const u7=typeof Path2D=="function";function d7(n,e,t,i){u7&&!e.options.segment?l7(n,e,t,i):c7(n,e,t,i)}class Zr extends Vo{constructor(e){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,e&&Object.assign(this,e)}updateControlPoints(e,t){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const r=i.spanGaps?this._loop:this._fullLoop;i6(this._points,i,e,r,t),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=m6(this,this.options.segment))}first(){const e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){const e=this.segments,t=this.points,i=e.length;return i&&t[e[i-1].end]}interpolate(e,t){const i=this.options,r=e[t],o=this.points,s=yD(this,{property:t,start:r,end:r});if(!s.length)return;const a=[],l=a7(i);let u,d;for(u=0,d=s.length;u<d;++u){const{start:M,end:h}=s[u],g=o[M],f=o[h];if(g===f){a.push(g);continue}const p=Math.abs((r-g[t])/(f[t]-g[t])),N=l(g,f,p,i.stepped);N[t]=e[t],a.push(N)}return a.length===1?a[0]:a}pathSegment(e,t,i){return EN(this)(e,this,t,i)}path(e,t,i){const r=this.segments,o=EN(this);let s=this._loop;t=t||0,i=i||this.points.length-t;for(const a of r)s&=o(e,this,a,{start:t,end:t+i-1});return!!s}draw(e,t,i,r){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(e.save(),d7(e,this,i,r),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}ne(Zr,"id","line"),ne(Zr,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),ne(Zr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),ne(Zr,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"&&e!=="fill"});function u2(n,e,t,i){const r=n.options,{[t]:o}=n.getProps([t],i);return Math.abs(e-o)<r.radius+r.hitRadius}class dM extends Vo{constructor(t){super();ne(this,"parsed");ne(this,"skip");ne(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,i,r){const o=this.options,{x:s,y:a}=this.getProps(["x","y"],r);return Math.pow(t-s,2)+Math.pow(i-a,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(t,i){return u2(this,t,"x",i)}inYRange(t,i){return u2(this,t,"y",i)}getCenterPoint(t){const{x:i,y:r}=this.getProps(["x","y"],t);return{x:i,y:r}}size(t){t=t||this.options||{};let i=t.radius||0;i=Math.max(i,i&&t.hoverRadius||0);const r=i&&t.borderWidth||0;return(i+r)*2}draw(t,i){const r=this.options;this.skip||r.radius<.1||!or(this,i,this.size(r)/2)||(t.strokeStyle=r.borderColor,t.lineWidth=r.borderWidth,t.fillStyle=r.backgroundColor,gN(t,r,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}ne(dM,"id","point"),ne(dM,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),ne(dM,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function d2(n,e){const{x:t,y:i,base:r,width:o,height:s}=n.getProps(["x","y","base","width","height"],e);let a,l,u,d,M;return n.horizontal?(M=s/2,a=Math.min(t,r),l=Math.max(t,r),u=i-M,d=i+M):(M=o/2,a=t-M,l=t+M,u=Math.min(i,r),d=Math.max(i,r)),{left:a,top:u,right:l,bottom:d}}function Pr(n,e,t,i){return n?0:Yn(e,t,i)}function M7(n,e,t){const i=n.options.borderWidth,r=n.borderSkipped,o=oD(i);return{t:Pr(r.top,o.top,0,t),r:Pr(r.right,o.right,0,e),b:Pr(r.bottom,o.bottom,0,t),l:Pr(r.left,o.left,0,e)}}function h7(n,e,t){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),r=n.options.borderRadius,o=Rs(r),s=Math.min(e,t),a=n.borderSkipped,l=i||Se(r);return{topLeft:Pr(!l||a.top||a.left,o.topLeft,0,s),topRight:Pr(!l||a.top||a.right,o.topRight,0,s),bottomLeft:Pr(!l||a.bottom||a.left,o.bottomLeft,0,s),bottomRight:Pr(!l||a.bottom||a.right,o.bottomRight,0,s)}}function g7(n){const e=d2(n),t=e.right-e.left,i=e.bottom-e.top,r=M7(n,t/2,i/2),o=h7(n,t/2,i/2);return{outer:{x:e.left,y:e.top,w:t,h:i,radius:o},inner:{x:e.left+r.l,y:e.top+r.t,w:t-r.l-r.r,h:i-r.t-r.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(r.t,r.l)),topRight:Math.max(0,o.topRight-Math.max(r.t,r.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(r.b,r.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(r.b,r.r))}}}}function SN(n,e,t,i){const r=e===null,o=t===null,a=n&&!(r&&o)&&d2(n,i);return a&&(r||Wd(e,a.left,a.right))&&(o||Wd(t,a.top,a.bottom))}function f7(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function p7(n,e){n.rect(e.x,e.y,e.w,e.h)}function ON(n,e,t={}){const i=n.x!==t.x?-e:0,r=n.y!==t.y?-e:0,o=(n.x+n.w!==t.x+t.w?e:0)-i,s=(n.y+n.h!==t.y+t.h?e:0)-r;return{x:n.x+i,y:n.y+r,w:n.w+o,h:n.h+s,radius:n.radius}}class MM extends Vo{constructor(e){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,e&&Object.assign(this,e)}draw(e){const{inflateAmount:t,options:{borderColor:i,backgroundColor:r}}=this,{inner:o,outer:s}=g7(this),a=f7(s.radius)?$d:p7;e.save(),(s.w!==o.w||s.h!==o.h)&&(e.beginPath(),a(e,ON(s,t,o)),e.clip(),a(e,ON(o,-t,s)),e.fillStyle=i,e.fill("evenodd")),e.beginPath(),a(e,ON(o,t)),e.fillStyle=r,e.fill(),e.restore()}inRange(e,t,i){return SN(this,e,t,i)}inXRange(e,t){return SN(this,e,null,t)}inYRange(e,t){return SN(this,null,e,t)}getCenterPoint(e){const{x:t,y:i,base:r,horizontal:o}=this.getProps(["x","y","base","horizontal"],e);return{x:o?(t+r)/2:t,y:o?i:(i+r)/2}}getRange(e){return e==="x"?this.width/2:this.height/2}}ne(MM,"id","bar"),ne(MM,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),ne(MM,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function N7(n,e,t){const i=n.segments,r=n.points,o=e.points,s=[];for(const a of i){let{start:l,end:u}=a;u=UN(l,u,r);const d=vN(t,r[l],r[u],a.loop);if(!e.segments){s.push({source:a,target:d,start:r[l],end:r[u]});continue}const M=yD(e,d);for(const h of M){const g=vN(t,o[h.start],o[h.end],h.loop),f=ND(a,r,g);for(const p of f)s.push({source:p,target:h,start:{[t]:M2(d,g,"start",Math.max)},end:{[t]:M2(d,g,"end",Math.min)}})}}return s}function vN(n,e,t,i){if(i)return;let r=e[n],o=t[n];return n==="angle"&&(r=Qn(r),o=Qn(o)),{property:n,start:r,end:o}}function y7(n,e){const{x:t=null,y:i=null}=n||{},r=e.points,o=[];return e.segments.forEach(({start:s,end:a})=>{a=UN(s,a,r);const l=r[s],u=r[a];i!==null?(o.push({x:l.x,y:i}),o.push({x:u.x,y:i})):t!==null&&(o.push({x:t,y:l.y}),o.push({x:t,y:u.y}))}),o}function UN(n,e,t){for(;e>n;e--){const i=t[e];if(!isNaN(i.x)&&!isNaN(i.y))break}return e}function M2(n,e,t,i){return n&&e?i(n[t],e[t]):n?n[t]:e?e[t]:0}function h2(n,e){let t=[],i=!1;return Xe(n)?(i=!0,t=n):t=y7(n,e),t.length?new Zr({points:t,options:{tension:0},_loop:i,_fullLoop:i}):null}function g2(n){return n&&n.fill!==!1}function j7(n,e,t){let r=n[e].fill;const o=[e];let s;if(!t)return r;for(;r!==!1&&o.indexOf(r)===-1;){if(!ft(r))return r;if(s=n[r],!s)return!1;if(s.visible)return r;o.push(r),r=s.fill}return!1}function m7(n,e,t){const i=x7(n);if(Se(i))return isNaN(i.value)?!1:i;let r=parseFloat(i);return ft(r)&&Math.floor(r)===r?I7(i[0],e,r,t):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function I7(n,e,t,i){return(n==="-"||n==="+")&&(t=e+t),t===e||t<0||t>=i?!1:t}function D7(n,e){let t=null;return n==="start"?t=e.bottom:n==="end"?t=e.top:Se(n)?t=e.getPixelForValue(n.value):e.getBasePixel&&(t=e.getBasePixel()),t}function T7(n,e,t){let i;return n==="start"?i=t:n==="end"?i=e.options.reverse?e.min:e.max:Se(n)?i=n.value:i=e.getBaseValue(),i}function x7(n){const e=n.options,t=e.fill;let i=Ye(t&&t.target,t);return i===void 0&&(i=!!e.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function z7(n){const{scale:e,index:t,line:i}=n,r=[],o=i.segments,s=i.points,a=A7(e,t);a.push(h2({x:null,y:e.bottom},i));for(let l=0;l<o.length;l++){const u=o[l];for(let d=u.start;d<=u.end;d++)b7(r,s[d],a)}return new Zr({points:r,options:{}})}function A7(n,e){const t=[],i=n.getMatchingVisibleMetas("line");for(let r=0;r<i.length;r++){const o=i[r];if(o.index===e)break;o.hidden||t.unshift(o.dataset)}return t}function b7(n,e,t){const i=[];for(let r=0;r<t.length;r++){const o=t[r],{first:s,last:a,point:l}=L7(o,e,"x");if(!(!l||s&&a)){if(s)i.unshift(l);else if(n.push(l),!a)break}}n.push(...i)}function L7(n,e,t){const i=n.interpolate(e,t);if(!i)return{};const r=i[t],o=n.segments,s=n.points;let a=!1,l=!1;for(let u=0;u<o.length;u++){const d=o[u],M=s[d.start][t],h=s[d.end][t];if(Wd(r,M,h)){a=r===M,l=r===h;break}}return{first:a,last:l,point:i}}class f2{constructor(e){this.x=e.x,this.y=e.y,this.radius=e.radius}pathSegment(e,t,i){const{x:r,y:o,radius:s}=this;return t=t||{start:0,end:vn},e.arc(r,o,s,t.end,t.start,!0),!i.bounds}interpolate(e){const{x:t,y:i,radius:r}=this,o=e.angle;return{x:t+Math.cos(o)*r,y:i+Math.sin(o)*r,angle:o}}}function k7(n){const{chart:e,fill:t,line:i}=n;if(ft(t))return C7(e,t);if(t==="stack")return z7(n);if(t==="shape")return!0;const r=w7(n);return r instanceof f2?r:h2(r,i)}function C7(n,e){const t=n.getDatasetMeta(e);return t&&n.isDatasetVisible(e)?t.dataset:null}function w7(n){return(n.scale||{}).getPointPositionForValue?S7(n):E7(n)}function E7(n){const{scale:e={},fill:t}=n,i=D7(t,e);if(ft(i)){const r=e.isHorizontal();return{x:r?i:null,y:r?null:i}}return null}function S7(n){const{scale:e,fill:t}=n,i=e.options,r=e.getLabels().length,o=i.reverse?e.max:e.min,s=T7(t,e,o),a=[];if(i.grid.circular){const l=e.getPointPositionForValue(0,o);return new f2({x:l.x,y:l.y,radius:e.getDistanceFromCenterForValue(s)})}for(let l=0;l<r;++l)a.push(e.getPointPositionForValue(l,s));return a}function QN(n,e,t){const i=k7(e),{line:r,scale:o,axis:s}=e,a=r.options,l=a.fill,u=a.backgroundColor,{above:d=u,below:M=u}=l||{};i&&r.points.length&&(fN(n,t),O7(n,{line:r,target:i,above:d,below:M,area:t,scale:o,axis:s}),pN(n))}function O7(n,e){const{line:t,target:i,above:r,below:o,area:s,scale:a}=e,l=t._loop?"angle":e.axis;n.save(),l==="x"&&o!==r&&(p2(n,i,s.top),N2(n,{line:t,target:i,color:r,scale:a,property:l}),n.restore(),n.save(),p2(n,i,s.bottom)),N2(n,{line:t,target:i,color:o,scale:a,property:l}),n.restore()}function p2(n,e,t){const{segments:i,points:r}=e;let o=!0,s=!1;n.beginPath();for(const a of i){const{start:l,end:u}=a,d=r[l],M=r[UN(l,u,r)];o?(n.moveTo(d.x,d.y),o=!1):(n.lineTo(d.x,t),n.lineTo(d.x,d.y)),s=!!e.pathSegment(n,a,{move:s}),s?n.closePath():n.lineTo(M.x,t)}n.lineTo(e.first().x,t),n.closePath(),n.clip()}function N2(n,e){const{line:t,target:i,property:r,color:o,scale:s}=e,a=N7(t,i,r);for(const{source:l,target:u,start:d,end:M}of a){const{style:{backgroundColor:h=o}={}}=l,g=i!==!0;n.save(),n.fillStyle=h,v7(n,s,g&&vN(r,d,M)),n.beginPath();const f=!!t.pathSegment(n,l);let p;if(g){f?n.closePath():y2(n,i,M,r);const N=!!i.pathSegment(n,u,{move:f,reverse:!0});p=f&&N,p||y2(n,i,d,r)}n.closePath(),n.fill(p?"evenodd":"nonzero"),n.restore()}}function v7(n,e,t){const{top:i,bottom:r}=e.chart.chartArea,{property:o,start:s,end:a}=t||{};o==="x"&&(n.beginPath(),n.rect(s,i,a-s,r-i),n.clip())}function y2(n,e,t,i){const r=e.interpolate(t,i);r&&n.lineTo(r.x,r.y)}var U7={id:"filler",afterDatasetsUpdate(n,e,t){const i=(n.data.datasets||[]).length,r=[];let o,s,a,l;for(s=0;s<i;++s)o=n.getDatasetMeta(s),a=o.dataset,l=null,a&&a.options&&a instanceof Zr&&(l={visible:n.isDatasetVisible(s),index:s,fill:m7(a,s,i),chart:n,axis:o.controller.options.indexAxis,scale:o.vScale,line:a}),o.$filler=l,r.push(l);for(s=0;s<i;++s)l=r[s],!(!l||l.fill===!1)&&(l.fill=j7(r,s,t.propagate))},beforeDraw(n,e,t){const i=t.drawTime==="beforeDraw",r=n.getSortedVisibleDatasetMetas(),o=n.chartArea;for(let s=r.length-1;s>=0;--s){const a=r[s].$filler;a&&(a.line.updateControlPoints(o,a.axis),i&&a.fill&&QN(n.ctx,a,o))}},beforeDatasetsDraw(n,e,t){if(t.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let r=i.length-1;r>=0;--r){const o=i[r].$filler;g2(o)&&QN(n.ctx,o,n.chartArea)}},beforeDatasetDraw(n,e,t){const i=e.meta.$filler;!g2(i)||t.drawTime!=="beforeDatasetDraw"||QN(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};class j2 extends Vo{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.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(e,t){const i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=e,this.height=this.bottom=t;const r=Xe(i.text)?i.text.length:1;this._padding=_n(i.padding);const o=r*dn(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const e=this.options.position;return e==="top"||e==="bottom"}_drawArgs(e){const{top:t,left:i,bottom:r,right:o,options:s}=this,a=s.align;let l=0,u,d,M;return this.isHorizontal()?(d=dl(a,i,o),M=t+e,u=o-i):(s.position==="left"?(d=i+e,M=dl(a,r,t),l=Ct*-.5):(d=o-e,M=dl(a,t,r),l=Ct*.5),u=r-t),{titleX:d,titleY:M,maxWidth:u,rotation:l}}draw(){const e=this.ctx,t=this.options;if(!t.display)return;const i=dn(t.font),o=i.lineHeight/2+this._padding.top,{titleX:s,titleY:a,maxWidth:l,rotation:u}=this._drawArgs(o);gl(e,t.text,0,0,i,{color:t.color,maxWidth:l,rotation:u,textAlign:X4(t.align),textBaseline:"middle",translation:[s,a]})}}function Q7(n,e){const t=new j2({ctx:n.ctx,options:e,chart:n});Br.configure(n,t,e),Br.addBox(n,t),n.titleBlock=t}var Y7={id:"title",_element:j2,start(n,e,t){Q7(n,t)},stop(n){const e=n.titleBlock;Br.removeBox(n,e),delete n.titleBlock},beforeUpdate(n,e,t){const i=n.titleBlock;Br.configure(n,i,t),i.options=t},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 xl={average(n){if(!n.length)return!1;let e,t,i=new Set,r=0,o=0;for(e=0,t=n.length;e<t;++e){const a=n[e].element;if(a&&a.hasValue()){const l=a.tooltipPosition();i.add(l.x),r+=l.y,++o}}return{x:[...i].reduce((a,l)=>a+l)/i.size,y:r/o}},nearest(n,e){if(!n.length)return!1;let t=e.x,i=e.y,r=Number.POSITIVE_INFINITY,o,s,a;for(o=0,s=n.length;o<s;++o){const l=n[o].element;if(l&&l.hasValue()){const u=l.getCenterPoint(),d=aN(e,u);d<r&&(r=d,a=l)}}if(a){const l=a.tooltipPosition();t=l.x,i=l.y}return{x:t,y:i}}};function vi(n,e){return e&&(Xe(e)?Array.prototype.push.apply(n,e):n.push(e)),n}function ar(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
|
|
18
18
|
`)>-1?n.split(`
|
|
19
|
-
`):n}function _7(n,e){const{element:t,datasetIndex:i,index:r}=e,o=n.getDatasetMeta(i).controller,{label:s,value:a}=o.getLabelAndValue(r);return{chart:n,label:s,parsed:o.getParsed(r),raw:n.data.datasets[i].data[r],formattedValue:a,dataset:o.getDataset(),dataIndex:r,datasetIndex:i,element:t}}function m2(n,e){const t=n.chart.ctx,{body:i,footer:r,title:o}=n,{boxWidth:s,boxHeight:a}=e,l=dn(e.bodyFont),u=dn(e.titleFont),d=dn(e.footerFont),M=o.length,h=r.length,g=i.length,f=_n(e.padding);let p=f.height,N=0,y=i.reduce((w,k)=>w+k.before.length+k.lines.length+k.after.length,0);if(y+=n.beforeBody.length+n.afterBody.length,M&&(p+=M*u.lineHeight+(M-1)*e.titleSpacing+e.titleMarginBottom),y){const w=e.displayColors?Math.max(a,l.lineHeight):l.lineHeight;p+=g*w+(y-g)*l.lineHeight+(y-1)*e.bodySpacing}h&&(p+=e.footerMarginTop+h*d.lineHeight+(h-1)*e.footerSpacing);let j=0;const A=function(w){N=Math.max(N,t.measureText(w).width+j)};return t.save(),t.font=u.string,Ze(n.title,A),t.font=l.string,Ze(n.beforeBody.concat(n.afterBody),A),j=e.displayColors?s+2+e.boxPadding:0,Ze(i,w=>{Ze(w.before,A),Ze(w.lines,A),Ze(w.after,A)}),j=0,t.font=d.string,Ze(n.footer,A),t.restore(),N+=f.width,{width:N,height:p}}function R7(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function V7(n,e,t,i){const{x:r,width:o}=i,s=t.caretSize+t.caretPadding;if(n==="left"&&r+o+s>e.width||n==="right"&&r-o-s<0)return!0}function B7(n,e,t,i){const{x:r,width:o}=t,{width:s,chartArea:{left:a,right:l}}=n;let u="center";return i==="center"?u=r<=(a+l)/2?"left":"right":r<=o/2?u="left":r>=s-o/2&&(u="right"),V7(u,n,e,t)&&(u="center"),u}function I2(n,e,t){const i=t.yAlign||e.yAlign||R7(n,t);return{xAlign:t.xAlign||e.xAlign||B7(n,e,t,i),yAlign:i}}function Z7(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function P7(n,e,t){let{y:i,height:r}=n;return e==="top"?i+=t:e==="bottom"?i-=r+t:i-=r/2,i}function D2(n,e,t,i){const{caretSize:r,caretPadding:o,cornerRadius:s}=n,{xAlign:a,yAlign:l}=t,u=r+o,{topLeft:d,topRight:M,bottomLeft:h,bottomRight:g}=Rs(s);let f=Z7(e,a);const p=P7(e,l,u);return l==="center"?a==="left"?f+=u:a==="right"&&(f-=u):a==="left"?f-=Math.max(d,h)+r:a==="right"&&(f+=Math.max(M,g)+r),{x:Yn(f,0,i.width-e.width),y:Yn(p,0,i.height-e.height)}}function hM(n,e,t){const i=_n(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function T2(n){return vi([],ar(n))}function W7(n,e,t){return Vr(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function x2(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}const z2={beforeTitle:rr,title(n){if(n.length>0){const e=n[0],t=e.chart.data.labels,i=t?t.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(i>0&&e.dataIndex<i)return t[e.dataIndex]}return""},afterTitle:rr,beforeBody:rr,beforeLabel:rr,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let e=n.dataset.label||"";e&&(e+=": ");const t=n.formattedValue;return Be(t)||(e+=t),e},labelColor(n){const t=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{borderColor:t.borderColor,backgroundColor:t.backgroundColor,borderWidth:t.borderWidth,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(n){const t=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:t.pointStyle,rotation:t.rotation}},afterLabel:rr,afterBody:rr,beforeFooter:rr,footer:rr,afterFooter:rr};function In(n,e,t,i){const r=n[e].call(t,i);return typeof r>"u"?z2[e].call(t,i):r}class YN extends Vo{constructor(e){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=e.chart,this.options=e.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(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const t=this.chart,i=this.options.setContext(this.getContext()),r=i.enabled&&t.options.animation&&i.animations,o=new DD(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=W7(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:i}=t,r=In(i,"beforeTitle",this,e),o=In(i,"title",this,e),s=In(i,"afterTitle",this,e);let a=[];return a=vi(a,ar(r)),a=vi(a,ar(o)),a=vi(a,ar(s)),a}getBeforeBody(e,t){return T2(In(t.callbacks,"beforeBody",this,e))}getBody(e,t){const{callbacks:i}=t,r=[];return Ze(e,o=>{const s={before:[],lines:[],after:[]},a=x2(i,o);vi(s.before,ar(In(a,"beforeLabel",this,o))),vi(s.lines,In(a,"label",this,o)),vi(s.after,ar(In(a,"afterLabel",this,o))),r.push(s)}),r}getAfterBody(e,t){return T2(In(t.callbacks,"afterBody",this,e))}getFooter(e,t){const{callbacks:i}=t,r=In(i,"beforeFooter",this,e),o=In(i,"footer",this,e),s=In(i,"afterFooter",this,e);let a=[];return a=vi(a,ar(r)),a=vi(a,ar(o)),a=vi(a,ar(s)),a}_createItems(e){const t=this._active,i=this.chart.data,r=[],o=[],s=[];let a=[],l,u;for(l=0,u=t.length;l<u;++l)a.push(_7(this.chart,t[l]));return e.filter&&(a=a.filter((d,M,h)=>e.filter(d,M,h,i))),e.itemSort&&(a=a.sort((d,M)=>e.itemSort(d,M,i))),Ze(a,d=>{const M=x2(e.callbacks,d);r.push(In(M,"labelColor",this,d)),o.push(In(M,"labelPointStyle",this,d)),s.push(In(M,"labelTextColor",this,d))}),this.labelColors=r,this.labelPointStyles=o,this.labelTextColors=s,this.dataPoints=a,a}update(e,t){const i=this.options.setContext(this.getContext()),r=this._active;let o,s=[];if(!r.length)this.opacity!==0&&(o={opacity:0});else{const a=xl[i.position].call(this,r,this._eventPosition);s=this._createItems(i),this.title=this.getTitle(s,i),this.beforeBody=this.getBeforeBody(s,i),this.body=this.getBody(s,i),this.afterBody=this.getAfterBody(s,i),this.footer=this.getFooter(s,i);const l=this._size=m2(this,i),u=Object.assign({},a,l),d=I2(this.chart,i,u),M=D2(i,u,d,this.chart);this.xAlign=d.xAlign,this.yAlign=d.yAlign,o={opacity:1,x:M.x,y:M.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=s,this.$context=void 0,o&&this._resolveAnimations().update(this,o),e&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,i,r){const o=this.getCaretPosition(e,i,r);t.lineTo(o.x1,o.y1),t.lineTo(o.x2,o.y2),t.lineTo(o.x3,o.y3)}getCaretPosition(e,t,i){const{xAlign:r,yAlign:o}=this,{caretSize:s,cornerRadius:a}=i,{topLeft:l,topRight:u,bottomLeft:d,bottomRight:M}=Rs(a),{x:h,y:g}=e,{width:f,height:p}=t;let N,y,j,A,w,k;return o==="center"?(w=g+p/2,r==="left"?(N=h,y=N-s,A=w+s,k=w-s):(N=h+f,y=N+s,A=w-s,k=w+s),j=N):(r==="left"?y=h+Math.max(l,d)+s:r==="right"?y=h+f-Math.max(u,M)-s:y=this.caretX,o==="top"?(A=g,w=A-s,N=y-s,j=y+s):(A=g+p,w=A+s,N=y+s,j=y-s),k=A),{x1:N,x2:y,x3:j,y1:A,y2:w,y3:k}}drawTitle(e,t,i){const r=this.title,o=r.length;let s,a,l;if(o){const u=DN(i.rtl,this.x,this.width);for(e.x=hM(this,i.titleAlign,i),t.textAlign=u.textAlign(i.titleAlign),t.textBaseline="middle",s=dn(i.titleFont),a=i.titleSpacing,t.fillStyle=i.titleColor,t.font=s.string,l=0;l<o;++l)t.fillText(r[l],u.x(e.x),e.y+s.lineHeight/2),e.y+=s.lineHeight+a,l+1===o&&(e.y+=i.titleMarginBottom-a)}}_drawColorBox(e,t,i,r,o){const s=this.labelColors[i],a=this.labelPointStyles[i],{boxHeight:l,boxWidth:u}=o,d=dn(o.bodyFont),M=hM(this,"left",o),h=r.x(M),g=l<d.lineHeight?(d.lineHeight-l)/2:0,f=t.y+g;if(o.usePointStyle){const p={radius:Math.min(u,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},N=r.leftForLtr(h,u)+u/2,y=f+l/2;e.strokeStyle=o.multiKeyBackground,e.fillStyle=o.multiKeyBackground,gN(e,p,N,y),e.strokeStyle=s.borderColor,e.fillStyle=s.backgroundColor,gN(e,p,N,y)}else{e.lineWidth=Se(s.borderWidth)?Math.max(...Object.values(s.borderWidth)):s.borderWidth||1,e.strokeStyle=s.borderColor,e.setLineDash(s.borderDash||[]),e.lineDashOffset=s.borderDashOffset||0;const p=r.leftForLtr(h,u),N=r.leftForLtr(r.xPlus(h,1),u-2),y=Rs(s.borderRadius);Object.values(y).some(j=>j!==0)?(e.beginPath(),e.fillStyle=o.multiKeyBackground,$d(e,{x:p,y:f,w:u,h:l,radius:y}),e.fill(),e.stroke(),e.fillStyle=s.backgroundColor,e.beginPath(),$d(e,{x:N,y:f+1,w:u-2,h:l-2,radius:y}),e.fill()):(e.fillStyle=o.multiKeyBackground,e.fillRect(p,f,u,l),e.strokeRect(p,f,u,l),e.fillStyle=s.backgroundColor,e.fillRect(N,f+1,u-2,l-2))}e.fillStyle=this.labelTextColors[i]}drawBody(e,t,i){const{body:r}=this,{bodySpacing:o,bodyAlign:s,displayColors:a,boxHeight:l,boxWidth:u,boxPadding:d}=i,M=dn(i.bodyFont);let h=M.lineHeight,g=0;const f=DN(i.rtl,this.x,this.width),p=function(T){t.fillText(T,f.x(e.x+g),e.y+h/2),e.y+=h+o},N=f.textAlign(s);let y,j,A,w,k,L,E;for(t.textAlign=s,t.textBaseline="middle",t.font=M.string,e.x=hM(this,N,i),t.fillStyle=i.bodyColor,Ze(this.beforeBody,p),g=a&&N!=="right"?s==="center"?u/2+d:u+2+d:0,w=0,L=r.length;w<L;++w){for(y=r[w],j=this.labelTextColors[w],t.fillStyle=j,Ze(y.before,p),A=y.lines,a&&A.length&&(this._drawColorBox(t,e,w,f,i),h=Math.max(M.lineHeight,l)),k=0,E=A.length;k<E;++k)p(A[k]),h=M.lineHeight;Ze(y.after,p)}g=0,h=M.lineHeight,Ze(this.afterBody,p),e.y-=o}drawFooter(e,t,i){const r=this.footer,o=r.length;let s,a;if(o){const l=DN(i.rtl,this.x,this.width);for(e.x=hM(this,i.footerAlign,i),e.y+=i.footerMarginTop,t.textAlign=l.textAlign(i.footerAlign),t.textBaseline="middle",s=dn(i.footerFont),t.fillStyle=i.footerColor,t.font=s.string,a=0;a<o;++a)t.fillText(r[a],l.x(e.x),e.y+s.lineHeight/2),e.y+=s.lineHeight+i.footerSpacing}}drawBackground(e,t,i,r){const{xAlign:o,yAlign:s}=this,{x:a,y:l}=e,{width:u,height:d}=i,{topLeft:M,topRight:h,bottomLeft:g,bottomRight:f}=Rs(r.cornerRadius);t.fillStyle=r.backgroundColor,t.strokeStyle=r.borderColor,t.lineWidth=r.borderWidth,t.beginPath(),t.moveTo(a+M,l),s==="top"&&this.drawCaret(e,t,i,r),t.lineTo(a+u-h,l),t.quadraticCurveTo(a+u,l,a+u,l+h),s==="center"&&o==="right"&&this.drawCaret(e,t,i,r),t.lineTo(a+u,l+d-f),t.quadraticCurveTo(a+u,l+d,a+u-f,l+d),s==="bottom"&&this.drawCaret(e,t,i,r),t.lineTo(a+g,l+d),t.quadraticCurveTo(a,l+d,a,l+d-g),s==="center"&&o==="left"&&this.drawCaret(e,t,i,r),t.lineTo(a,l+M),t.quadraticCurveTo(a,l,a+M,l),t.closePath(),t.fill(),r.borderWidth>0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,i=this.$animations,r=i&&i.x,o=i&&i.y;if(r||o){const s=xl[e.position].call(this,this._active,this._eventPosition);if(!s)return;const a=this._size=m2(this,e),l=Object.assign({},s,this._size),u=I2(t,e,l),d=D2(e,l,u,t);(r._to!==d.x||o._to!==d.y)&&(this.xAlign=u.xAlign,this.yAlign=u.yAlign,this.width=a.width,this.height=a.height,this.caretX=s.x,this.caretY=s.y,this._resolveAnimations().update(this,d))}}_willRender(){return!!this.opacity}draw(e){const t=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(t);const r={width:this.width,height:this.height},o={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const s=_n(t.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&a&&(e.save(),e.globalAlpha=i,this.drawBackground(o,e,r,t),f6(e,t.textDirection),o.y+=s.top,this.drawTitle(o,e,t),this.drawBody(o,e,t),this.drawFooter(o,e,t),p6(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){const i=this._active,r=e.map(({datasetIndex:a,index:l})=>{const u=this.chart.getDatasetMeta(a);if(!u)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:u.data[l],index:l}}),o=!Bd(i,r),s=this._positionChanged(r,t);(o||s)&&(this._active=r,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,i=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const r=this.options,o=this._active||[],s=this._getActiveElements(e,o,t,i),a=this._positionChanged(s,e),l=t||!Bd(s,o)||a;return l&&(this._active=s,(r.enabled||r.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),l}_getActiveElements(e,t,i,r){const o=this.options;if(e.type==="mouseout")return[];if(!r)return t.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const s=this.chart.getElementsAtEventForMode(e,o.mode,o,i);return o.reverse&&s.reverse(),s}_positionChanged(e,t){const{caretX:i,caretY:r,options:o}=this,s=xl[o.position].call(this,e,t);return s!==!1&&(i!==s.x||r!==s.y)}}ne(YN,"positioners",xl);var A2={id:"tooltip",_element:YN,positioners:xl,afterInit(n,e,t){t&&(n.tooltip=new YN({chart:n,options:t}))},beforeUpdate(n,e,t){n.tooltip&&n.tooltip.initialize(t)},reset(n,e,t){n.tooltip&&n.tooltip.initialize(t)},afterDraw(n){const e=n.tooltip;if(e&&e._willRender()){const t={tooltip:e};if(n.notifyPlugins("beforeTooltipDraw",{...t,cancelable:!0})===!1)return;e.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",t)}},afterEvent(n,e){if(n.tooltip){const t=e.replay;n.tooltip.handleEvent(e.event,t,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,e)=>e.bodyFont.size,boxWidth:(n,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:z2},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const F7=(n,e,t,i)=>(typeof e=="string"?(t=n.push(e)-1,i.unshift({index:t,label:e})):isNaN(e)&&(t=null),t);function H7(n,e,t,i){const r=n.indexOf(e);if(r===-1)return F7(n,e,t,i);const o=n.lastIndexOf(e);return r!==o?t:r}const G7=(n,e)=>n===null?null:Yn(Math.round(n),0,e);function b2(n){const e=this.getLabels();return n>=0&&n<e.length?e[n]:n}class gM extends Bo{constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const t=this._addedLabels;if(t.length){const i=this.getLabels();for(const{index:r,label:o}of t)i[r]===o&&i.splice(r,1);this._addedLabels=[]}super.init(e)}parse(e,t){if(Be(e))return null;const i=this.getLabels();return t=isFinite(t)&&i[t]===e?t:H7(i,e,Ye(t,e),this._addedLabels),G7(t,i.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let{min:i,max:r}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(i=0),t||(r=this.getLabels().length-1)),this.min=i,this.max=r}buildTicks(){const e=this.min,t=this.max,i=this.options.offset,r=[];let o=this.getLabels();o=e===0&&t===o.length-1?o:o.slice(e,t+1),this._valueRange=Math.max(o.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let s=e;s<=t;s++)r.push({value:s});return r}getLabelForValue(e){return b2.call(this,e)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(e){return typeof e!="number"&&(e=this.parse(e)),e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}ne(gM,"id","category"),ne(gM,"defaults",{ticks:{callback:b2}});function $7(n,e){const t=[],{bounds:r,step:o,min:s,max:a,precision:l,count:u,maxTicks:d,maxDigits:M,includeBounds:h}=n,g=o||1,f=d-1,{min:p,max:N}=e,y=!Be(s),j=!Be(a),A=!Be(u),w=(N-p)/(M+1);let k=B4((N-p)/f/g)*g,L,E,T,x;if(k<1e-14&&!y&&!j)return[{value:p},{value:N}];x=Math.ceil(N/k)-Math.floor(p/k),x>f&&(k=B4(x*k/f/g)*g),Be(l)||(L=Math.pow(10,l),k=Math.ceil(k*L)/L),r==="ticks"?(E=Math.floor(p/k)*k,T=Math.ceil(N/k)*k):(E=p,T=N),y&&j&&o&&dV((a-s)/o,k/1e3)?(x=Math.round(Math.min((a-s)/k,d)),k=(a-s)/x,E=s,T=a):A?(E=y?s:E,T=j?a:T,x=u-1,k=(T-E)/x):(x=(T-E)/k,cl(x,Math.round(x),k/1e3)?x=Math.round(x):x=Math.ceil(x));const b=Math.max(P4(k),P4(E));L=Math.pow(10,Be(l)?b:l),E=Math.round(E*L)/L,T=Math.round(T*L)/L;let m=0;for(y&&(h&&E!==s?(t.push({value:s}),E<s&&m++,cl(Math.round((E+m*k)*L)/L,s,L2(s,w,n))&&m++):E<s&&m++);m<x;++m){const I=Math.round((E+m*k)*L)/L;if(j&&I>a)break;t.push({value:I})}return j&&h&&T!==a?t.length&&cl(t[t.length-1].value,a,L2(a,w,n))?t[t.length-1].value=a:t.push({value:a}):(!j||T===a)&&t.push({value:T}),t}function L2(n,e,{horizontal:t,minRotation:i}){const r=Rr(i),o=(t?Math.sin(r):Math.cos(r))||.001,s=.75*e*(""+n).length;return Math.min(e/o,s)}class fM extends Bo{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,t){return Be(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:t,maxDefined:i}=this.getUserBounds();let{min:r,max:o}=this;const s=l=>r=t?r:l,a=l=>o=i?o:l;if(e){const l=Si(r),u=Si(o);l<0&&u<0?a(0):l>0&&u>0&&s(0)}if(r===o){let l=o===0?1:Math.abs(o*.05);a(o+l),e||s(r-l)}this.min=r,this.max=o}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:t,stepSize:i}=e,r;return i?(r=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,r>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${r} ticks. Limiting to 1000.`),r=1e3)):(r=this.computeTickLimit(),t=t||11),t&&(r=Math.min(t,r)),r}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,t=e.ticks;let i=this.getTickLimit();i=Math.max(2,i);const r={maxTicks:i,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==!1},o=this._range||this,s=$7(r,o);return e.bounds==="ticks"&&Z4(s,this,"value"),e.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){const e=this.ticks;let t=this.min,i=this.max;if(super.configure(),this.options.offset&&e.length){const r=(i-t)/Math.max(e.length-1,1)/2;t-=r,i+=r}this._startValue=t,this._endValue=i,this._valueRange=i-t}getLabelForValue(e){return dN(e,this.chart.options.locale,this.options.ticks.format)}}class pM extends fM{determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=ft(e)?e:0,this.max=ft(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,i=Rr(this.options.ticks.minRotation),r=(e?Math.sin(i):Math.cos(i))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,o.lineHeight/r))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}ne(pM,"id","linear"),ne(pM,"defaults",{ticks:{callback:Hd.formatters.numeric}});const zl=n=>Math.floor(_r(n)),Zo=(n,e)=>Math.pow(10,zl(n)+e);function k2(n){return n/Math.pow(10,zl(n))===1}function C2(n,e,t){const i=Math.pow(10,t),r=Math.floor(n/i);return Math.ceil(e/i)-r}function J7(n,e){const t=e-n;let i=zl(t);for(;C2(n,e,i)>10;)i++;for(;C2(n,e,i)<10;)i--;return Math.min(i,zl(n))}function X7(n,{min:e,max:t}){e=On(n.min,e);const i=[],r=zl(e);let o=J7(e,t),s=o<0?Math.pow(10,Math.abs(o)):1;const a=Math.pow(10,o),l=r>o?Math.pow(10,r):0,u=Math.round((e-l)*s)/s,d=Math.floor((e-l)/a/10)*a*10;let M=Math.floor((u-d)/Math.pow(10,o)),h=On(n.min,Math.round((l+d+M*Math.pow(10,o))*s)/s);for(;h<t;)i.push({value:h,major:k2(h),significand:M}),M>=10?M=M<15?15:20:M++,M>=20&&(o++,M=2,s=o>=0?1:s),h=Math.round((l+d+M*Math.pow(10,o))*s)/s;const g=On(n.max,h);return i.push({value:g,major:k2(g),significand:M}),i}class w2 extends Bo{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,t){const i=fM.prototype.parse.apply(this,[e,t]);if(i===0){this._zero=!0;return}return ft(i)&&i>0?i:null}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=ft(e)?Math.max(0,e):null,this.max=ft(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!ft(this._userMin)&&(this.min=e===Zo(this.min,0)?Zo(this.min,-1):Zo(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let i=this.min,r=this.max;const o=a=>i=e?i:a,s=a=>r=t?r:a;i===r&&(i<=0?(o(1),s(10)):(o(Zo(i,-1)),s(Zo(r,1)))),i<=0&&o(Zo(r,-1)),r<=0&&s(Zo(i,1)),this.min=i,this.max=r}buildTicks(){const e=this.options,t={min:this._userMin,max:this._userMax},i=X7(t,this);return e.bounds==="ticks"&&Z4(i,this,"value"),e.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(e){return e===void 0?"0":dN(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=_r(e),this._valueRange=_r(this.max)-_r(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(_r(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const t=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+t*this._valueRange)}}ne(w2,"id","logarithmic"),ne(w2,"defaults",{ticks:{callback:Hd.formatters.logarithmic,major:{enabled:!0}}});function _N(n){const e=n.ticks;if(e.display&&n.display){const t=_n(e.backdropPadding);return Ye(e.font&&e.font.size,zt.font.size)+t.height}return 0}function K7(n,e,t){return t=Xe(t)?t:[t],{w:CV(n,e.string,t),h:t.length*e.lineHeight}}function E2(n,e,t,i,r){return n===i||n===r?{start:e-t/2,end:e+t/2}:n<i||n>r?{start:e-t,end:e}:{start:e,end:e+t}}function q7(n){const e={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},t=Object.assign({},e),i=[],r=[],o=n._pointLabels.length,s=n.options.pointLabels,a=s.centerPointLabels?Ct/o:0;for(let l=0;l<o;l++){const u=s.setContext(n.getPointLabelContext(l));r[l]=u.padding;const d=n.getPointPosition(l,n.drawingArea+r[l],a),M=dn(u.font),h=K7(n.ctx,M,n._pointLabels[l]);i[l]=h;const g=Qn(n.getIndexAngle(l)+a),f=Math.round(sN(g)),p=E2(f,d.x,h.w,0,180),N=E2(f,d.y,h.h,90,270);e8(t,e,g,p,N)}n.setCenterPoint(e.l-t.l,t.r-e.r,e.t-t.t,t.b-e.b),n._pointLabelItems=i8(n,i,r)}function e8(n,e,t,i,r){const o=Math.abs(Math.sin(t)),s=Math.abs(Math.cos(t));let a=0,l=0;i.start<e.l?(a=(e.l-i.start)/o,n.l=Math.min(n.l,e.l-a)):i.end>e.r&&(a=(i.end-e.r)/o,n.r=Math.max(n.r,e.r+a)),r.start<e.t?(l=(e.t-r.start)/s,n.t=Math.min(n.t,e.t-l)):r.end>e.b&&(l=(r.end-e.b)/s,n.b=Math.max(n.b,e.b+l))}function t8(n,e,t){const i=n.drawingArea,{extra:r,additionalAngle:o,padding:s,size:a}=t,l=n.getPointPosition(e,i+r+s,o),u=Math.round(sN(Qn(l.angle+Un))),d=s8(l.y,a.h,u),M=r8(u),h=o8(l.x,a.w,M);return{visible:!0,x:l.x,y:d,textAlign:M,left:h,top:d,right:h+a.w,bottom:d+a.h}}function n8(n,e){if(!e)return!0;const{left:t,top:i,right:r,bottom:o}=n;return!(or({x:t,y:i},e)||or({x:t,y:o},e)||or({x:r,y:i},e)||or({x:r,y:o},e))}function i8(n,e,t){const i=[],r=n._pointLabels.length,o=n.options,{centerPointLabels:s,display:a}=o.pointLabels,l={extra:_N(o)/2,additionalAngle:s?Ct/r:0};let u;for(let d=0;d<r;d++){l.padding=t[d],l.size=e[d];const M=t8(n,d,l);i.push(M),a==="auto"&&(M.visible=n8(M,u),M.visible&&(u=M))}return i}function r8(n){return n===0||n===180?"center":n<180?"left":"right"}function o8(n,e,t){return t==="right"?n-=e:t==="center"&&(n-=e/2),n}function s8(n,e,t){return t===90||t===270?n-=e/2:(t>270||t<90)&&(n-=e),n}function a8(n,e,t){const{left:i,top:r,right:o,bottom:s}=t,{backdropColor:a}=e;if(!Be(a)){const l=Rs(e.borderRadius),u=_n(e.backdropPadding);n.fillStyle=a;const d=i-u.left,M=r-u.top,h=o-i+u.width,g=s-r+u.height;Object.values(l).some(f=>f!==0)?(n.beginPath(),$d(n,{x:d,y:M,w:h,h:g,radius:l}),n.fill()):n.fillRect(d,M,h,g)}}function l8(n,e){const{ctx:t,options:{pointLabels:i}}=n;for(let r=e-1;r>=0;r--){const o=n._pointLabelItems[r];if(!o.visible)continue;const s=i.setContext(n.getPointLabelContext(r));a8(t,s,o);const a=dn(s.font),{x:l,y:u,textAlign:d}=o;gl(t,n._pointLabels[r],l,u+a.lineHeight/2,a,{color:s.color,textAlign:d,textBaseline:"middle"})}}function S2(n,e,t,i){const{ctx:r}=n;if(t)r.arc(n.xCenter,n.yCenter,e,0,vn);else{let o=n.getPointPosition(0,e);r.moveTo(o.x,o.y);for(let s=1;s<i;s++)o=n.getPointPosition(s,e),r.lineTo(o.x,o.y)}}function c8(n,e,t,i,r){const o=n.ctx,s=e.circular,{color:a,lineWidth:l}=e;!s&&!i||!a||!l||t<0||(o.save(),o.strokeStyle=a,o.lineWidth=l,o.setLineDash(r.dash),o.lineDashOffset=r.dashOffset,o.beginPath(),S2(n,t,s,i),o.closePath(),o.stroke(),o.restore())}function u8(n,e,t){return Vr(n,{label:t,index:e,type:"pointLabel"})}class NM extends fM{constructor(e){super(e),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const e=this._padding=_n(_N(this.options)/2),t=this.width=this.maxWidth-e.width,i=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+t/2+e.left),this.yCenter=Math.floor(this.top+i/2+e.top),this.drawingArea=Math.floor(Math.min(t,i)/2)}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!1);this.min=ft(e)&&!isNaN(e)?e:0,this.max=ft(t)&&!isNaN(t)?t:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/_N(this.options))}generateTickLabels(e){fM.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((t,i)=>{const r=pt(this.options.pointLabels.callback,[t,i],this);return r||r===0?r:""}).filter((t,i)=>this.chart.getDataVisibility(i))}fit(){const e=this.options;e.display&&e.pointLabels.display?q7(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,t,i,r){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((i-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,i,r))}getIndexAngle(e){const t=vn/(this._pointLabels.length||1),i=this.options.startAngle||0;return Qn(e*t+Rr(i))}getDistanceFromCenterForValue(e){if(Be(e))return NaN;const t=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*t:(e-this.min)*t}getValueForDistanceFromCenter(e){if(Be(e))return NaN;const t=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t}getPointLabelContext(e){const t=this._pointLabels||[];if(e>=0&&e<t.length){const i=t[e];return u8(this.getContext(),e,i)}}getPointPosition(e,t,i=0){const r=this.getIndexAngle(e)-Un+i;return{x:Math.cos(r)*t+this.xCenter,y:Math.sin(r)*t+this.yCenter,angle:r}}getPointPositionForValue(e,t){return this.getPointPosition(e,this.getDistanceFromCenterForValue(t))}getBasePosition(e){return this.getPointPositionForValue(e||0,this.getBaseValue())}getPointLabelPosition(e){const{left:t,top:i,right:r,bottom:o}=this._pointLabelItems[e];return{left:t,top:i,right:r,bottom:o}}drawBackground(){const{backgroundColor:e,grid:{circular:t}}=this.options;if(e){const i=this.ctx;i.save(),i.beginPath(),S2(this,this.getDistanceFromCenterForValue(this._endValue),t,this._pointLabels.length),i.closePath(),i.fillStyle=e,i.fill(),i.restore()}}drawGrid(){const e=this.ctx,t=this.options,{angleLines:i,grid:r,border:o}=t,s=this._pointLabels.length;let a,l,u;if(t.pointLabels.display&&l8(this,s),r.display&&this.ticks.forEach((d,M)=>{if(M!==0||M===0&&this.min<0){l=this.getDistanceFromCenterForValue(d.value);const h=this.getContext(M),g=r.setContext(h),f=o.setContext(h);c8(this,g,l,s,f)}}),i.display){for(e.save(),a=s-1;a>=0;a--){const d=i.setContext(this.getPointLabelContext(a)),{color:M,lineWidth:h}=d;!h||!M||(e.lineWidth=h,e.strokeStyle=M,e.setLineDash(d.borderDash),e.lineDashOffset=d.borderDashOffset,l=this.getDistanceFromCenterForValue(t.ticks.reverse?this.min:this.max),u=this.getPointPosition(a,l),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(u.x,u.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,t=this.options,i=t.ticks;if(!i.display)return;const r=this.getIndexAngle(0);let o,s;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(r),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!t.reverse)return;const u=i.setContext(this.getContext(l)),d=dn(u.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),u.showLabelBackdrop){e.font=d.string,s=e.measureText(a.label).width,e.fillStyle=u.backdropColor;const M=_n(u.backdropPadding);e.fillRect(-s/2-M.left,-o-d.size/2-M.top,s+M.width,d.size+M.height)}gl(e,a.label,0,-o,d,{color:u.color,strokeColor:u.textStrokeColor,strokeWidth:u.textStrokeWidth})}),e.restore()}drawTitle(){}}ne(NM,"id","radialLinear"),ne(NM,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Hd.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(e){return e},padding:5,centerPointLabels:!1}}),ne(NM,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),ne(NM,"descriptors",{angleLines:{_fallback:"grid"}});const yM={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}},Dn=Object.keys(yM);function O2(n,e){return n-e}function v2(n,e){if(Be(e))return null;const t=n._adapter,{parser:i,round:r,isoWeekday:o}=n._parseOpts;let s=e;return typeof i=="function"&&(s=i(s)),ft(s)||(s=typeof i=="string"?t.parse(s,i):t.parse(s)),s===null?null:(r&&(s=r==="week"&&(ul(o)||o===!0)?t.startOf(s,"isoWeek",o):t.startOf(s,r)),+s)}function U2(n,e,t,i){const r=Dn.length;for(let o=Dn.indexOf(n);o<r-1;++o){const s=yM[Dn[o]],a=s.steps?s.steps:Number.MAX_SAFE_INTEGER;if(s.common&&Math.ceil((t-e)/(a*s.size))<=i)return Dn[o]}return Dn[r-1]}function d8(n,e,t,i,r){for(let o=Dn.length-1;o>=Dn.indexOf(t);o--){const s=Dn[o];if(yM[s].common&&n._adapter.diff(r,i,s)>=e-1)return s}return Dn[t?Dn.indexOf(t):0]}function M8(n){for(let e=Dn.indexOf(n)+1,t=Dn.length;e<t;++e)if(yM[Dn[e]].common)return Dn[e]}function Q2(n,e,t){if(!t)n[e]=!0;else if(t.length){const{lo:i,hi:r}=lN(t,e),o=t[i]>=e?t[i]:t[r];n[o]=!0}}function h8(n,e,t,i){const r=n._adapter,o=+r.startOf(e[0].value,i),s=e[e.length-1].value;let a,l;for(a=o;a<=s;a=+r.add(a,1,i))l=t[a],l>=0&&(e[l].major=!0);return e}function Y2(n,e,t){const i=[],r={},o=e.length;let s,a;for(s=0;s<o;++s)a=e[s],r[a]=s,i.push({value:a,major:!1});return o===0||!t?i:h8(n,i,r,t)}class jM extends Bo{constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,t={}){const i=e.time||(e.time={}),r=this._adapter=new H6._date(e.adapters.date);r.init(t),al(i.displayFormats,r.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(e),this._normalized=t.normalized}parse(e,t){return e===void 0?null:v2(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,t=this._adapter,i=e.time.unit||"day";let{min:r,max:o,minDefined:s,maxDefined:a}=this.getUserBounds();function l(u){!s&&!isNaN(u.min)&&(r=Math.min(r,u.min)),!a&&!isNaN(u.max)&&(o=Math.max(o,u.max))}(!s||!a)&&(l(this._getLabelBounds()),(e.bounds!=="ticks"||e.ticks.source!=="labels")&&l(this.getMinMax(!1))),r=ft(r)&&!isNaN(r)?r:+t.startOf(Date.now(),i),o=ft(o)&&!isNaN(o)?o:+t.endOf(Date.now(),i)+1,this.min=Math.min(r,o-1),this.max=Math.max(r+1,o)}_getLabelBounds(){const e=this.getLabelTimestamps();let t=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return e.length&&(t=e[0],i=e[e.length-1]),{min:t,max:i}}buildTicks(){const e=this.options,t=e.time,i=e.ticks,r=i.source==="labels"?this.getLabelTimestamps():this._generate();e.bounds==="ticks"&&r.length&&(this.min=this._userMin||r[0],this.max=this._userMax||r[r.length-1]);const o=this.min,s=this.max,a=pV(r,o,s);return this._unit=t.unit||(i.autoSkip?U2(t.minUnit,this.min,this.max,this._getLabelCapacity(o)):d8(this,a.length,t.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:M8(this._unit),this.initOffsets(r),e.reverse&&a.reverse(),Y2(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let t=0,i=0,r,o;this.options.offset&&e.length&&(r=this.getDecimalForValue(e[0]),e.length===1?t=1-r:t=(this.getDecimalForValue(e[1])-r)/2,o=this.getDecimalForValue(e[e.length-1]),e.length===1?i=o:i=(o-this.getDecimalForValue(e[e.length-2]))/2);const s=e.length<3?.5:.25;t=Yn(t,0,s),i=Yn(i,0,s),this._offsets={start:t,end:i,factor:1/(t+1+i)}}_generate(){const e=this._adapter,t=this.min,i=this.max,r=this.options,o=r.time,s=o.unit||U2(o.minUnit,t,i,this._getLabelCapacity(t)),a=Ye(r.ticks.stepSize,1),l=s==="week"?o.isoWeekday:!1,u=ul(l)||l===!0,d={};let M=t,h,g;if(u&&(M=+e.startOf(M,"isoWeek",l)),M=+e.startOf(M,u?"day":s),e.diff(i,t,s)>1e5*a)throw new Error(t+" and "+i+" are too far apart with stepSize of "+a+" "+s);const f=r.ticks.source==="data"&&this.getDataTimestamps();for(h=M,g=0;h<i;h=+e.add(h,a,s),g++)Q2(d,h,f);return(h===i||r.bounds==="ticks"||g===1)&&Q2(d,h,f),Object.keys(d).sort(O2).map(p=>+p)}getLabelForValue(e){const t=this._adapter,i=this.options.time;return i.tooltipFormat?t.format(e,i.tooltipFormat):t.format(e,i.displayFormats.datetime)}format(e,t){const r=this.options.time.displayFormats,o=this._unit,s=t||r[o];return this._adapter.format(e,s)}_tickFormatFunction(e,t,i,r){const o=this.options,s=o.ticks.callback;if(s)return pt(s,[e,t,i],this);const a=o.time.displayFormats,l=this._unit,u=this._majorUnit,d=l&&a[l],M=u&&a[u],h=i[t],g=u&&M&&h&&h.major;return this._adapter.format(e,r||(g?M:d))}generateTickLabels(e){let t,i,r;for(t=0,i=e.length;t<i;++t)r=e[t],r.label=this._tickFormatFunction(r.value,t,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const t=this._offsets,i=this.getDecimalForValue(e);return this.getPixelForDecimal((t.start+i)*t.factor)}getValueForPixel(e){const t=this._offsets,i=this.getDecimalForPixel(e)/t.factor-t.end;return this.min+i*(this.max-this.min)}_getLabelSize(e){const t=this.options.ticks,i=this.ctx.measureText(e).width,r=Rr(this.isHorizontal()?t.maxRotation:t.minRotation),o=Math.cos(r),s=Math.sin(r),a=this._resolveTickFontOptions(0).size;return{w:i*o+a*s,h:i*s+a*o}}_getLabelCapacity(e){const t=this.options.time,i=t.displayFormats,r=i[t.unit]||i.millisecond,o=this._tickFormatFunction(e,0,Y2(this,[e],this._majorUnit),r),s=this._getLabelSize(o),a=Math.floor(this.isHorizontal()?this.width/s.w:this.height/s.h)-1;return a>0?a:1}getDataTimestamps(){let e=this._cache.data||[],t,i;if(e.length)return e;const r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(t=0,i=r.length;t<i;++t)e=e.concat(r[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){const e=this._cache.labels||[];let t,i;if(e.length)return e;const r=this.getLabels();for(t=0,i=r.length;t<i;++t)e.push(v2(this,r[t]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return G4(e.sort(O2))}}ne(jM,"id","time"),ne(jM,"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 mM(n,e,t){let i=0,r=n.length-1,o,s,a,l;t?(e>=n[i].pos&&e<=n[r].pos&&({lo:i,hi:r}=Oo(n,"pos",e)),{pos:o,time:a}=n[i],{pos:s,time:l}=n[r]):(e>=n[i].time&&e<=n[r].time&&({lo:i,hi:r}=Oo(n,"time",e)),{time:o,pos:a}=n[i],{time:s,pos:l}=n[r]);const u=s-o;return u?a+(l-a)*(e-o)/u:a}class _2 extends jM{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=mM(t,this.min),this._tableRange=mM(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:t,max:i}=this,r=[],o=[];let s,a,l,u,d;for(s=0,a=e.length;s<a;++s)u=e[s],u>=t&&u<=i&&r.push(u);if(r.length<2)return[{time:t,pos:0},{time:i,pos:1}];for(s=0,a=r.length;s<a;++s)d=r[s+1],l=r[s-1],u=r[s],Math.round((d+l)/2)!==u&&o.push({time:u,pos:s/(a-1)});return o}_generate(){const e=this.min,t=this.max;let i=super.getDataTimestamps();return(!i.includes(e)||!i.length)&&i.splice(0,0,e),(!i.includes(t)||i.length===1)&&i.push(t),i.sort((r,o)=>r-o)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const t=this.getDataTimestamps(),i=this.getLabelTimestamps();return t.length&&i.length?e=this.normalize(t.concat(i)):e=t.length?t:i,e=this._cache.all=e,e}getDecimalForValue(e){return(mM(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const t=this._offsets,i=this.getDecimalForPixel(e)/t.factor-t.end;return mM(this._table,i*this._tableRange+this._minPos,!0)}}ne(_2,"id","timeseries"),ne(_2,"defaults",jM.defaults);const R2={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},g8={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...R2,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},f8=c.version[0]==="2"?(n,e)=>Object.assign(n,{attrs:e}):(n,e)=>Object.assign(n,e);function Ps(n){return c.isProxy(n)?c.toRaw(n):n}function p8(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n;return c.isProxy(e)?new Proxy(n,{}):n}function N8(n,e){const t=n.options;t&&e&&Object.assign(t,e)}function V2(n,e){n.labels=e}function B2(n,e,t){const i=[];n.datasets=e.map(r=>{const o=n.datasets.find(s=>s[t]===r[t]);return!o||!r.data||i.includes(o)?{...r}:(i.push(o),Object.assign(o,r),o)})}function y8(n,e){const t={labels:[],datasets:[]};return V2(t,n.labels),B2(t,n.datasets,e),t}const j8=c.defineComponent({props:g8,setup(n,e){let{expose:t,slots:i}=e;const r=c.ref(null),o=c.shallowRef(null);t({chart:o});const s=()=>{if(!r.value)return;const{type:u,data:d,options:M,plugins:h,datasetIdKey:g}=n,f=y8(d,g),p=p8(f,d);o.value=new Tl(r.value,{type:u,data:p,options:{...M},plugins:h})},a=()=>{const u=c.toRaw(o.value);u&&(n.destroyDelay>0?setTimeout(()=>{u.destroy(),o.value=null},n.destroyDelay):(u.destroy(),o.value=null))},l=u=>{u.update(n.updateMode)};return c.onMounted(s),c.onUnmounted(a),c.watch([()=>n.options,()=>n.data],(u,d)=>{let[M,h]=u,[g,f]=d;const p=c.toRaw(o.value);if(!p)return;let N=!1;if(M){const y=Ps(M),j=Ps(g);y&&y!==j&&(N8(p,y),N=!0)}if(h){const y=Ps(h.labels),j=Ps(f.labels),A=Ps(h.datasets),w=Ps(f.datasets);y!==j&&(V2(p.config.data,y),N=!0),A&&A!==w&&(B2(p.config.data,A,n.datasetIdKey),N=!0)}N&&c.nextTick(()=>{l(p)})},{deep:!0}),()=>c.h("canvas",{role:"img",ariaLabel:n.ariaLabel,ariaDescribedby:n.ariaDescribedby,ref:r},[c.h("p",{},[i.default?i.default():""])])}});function Z2(n,e){return Tl.register(e),c.defineComponent({props:R2,setup(t,i){let{expose:r}=i;const o=c.shallowRef(null),s=a=>{o.value=a==null?void 0:a.chart};return r({chart:o}),()=>c.h(j8,f8({ref:s},{type:n,...t}))}})}const m8=Z2("bar",tM),I8=Z2("line",nM),Fpe="",D8={name:"MultiRangeSlider",props:{baseClassName:{type:String,default:"multi-range-slider"},min:{type:Number},max:{type:Number},minValue:{type:Number},maxValue:{type:Number},step:{type:Number,default:1},preventWheel:{type:Boolean,default:!1},ruler:{type:Boolean,default:!0},label:{type:Boolean,default:!0},labels:{type:Array},minCaption:{type:String},maxCaption:{type:String},rangeMargin:{type:Number}},data(){let n=this.labels||[],e=this.min===void 0?0:this.min,t=n.length?n.length-1:100,i=this.max===void 0?t:this.max,r=this.minValue===void 0?25:this.minValue;n.length&&this.minValue===void 0&&(r=1);let o=this.maxValue||75;if(n.length&&this.maxValue===void 0&&(o=n.length-2),i<=e)throw new Error("Invalid props min or max");if(r>o)throw new Error("Invalid props minValue or maxValue");let s=this.rangeMargin===void 0?this.step:this.rangeMargin,a=s%this.step;return a&&(s=s+this.step-a),{valueMin:r<e?e:r,valueMax:o>i?i:o,interVal:null,startX:null,mouseMoveCounter:null,barBox:null,barValue:0,rangeMarginValue:s}},methods:{onBarLeftClick(){this.valueMin-this.step>=this.minimum?this.valueMin-=this.step:this.valueMin=this.minimum},onInnerBarLeftClick(){this.valueMin+this.rangeMarginValue<this.valueMax&&(this.valueMin+=this.step)},onBarRightClick(){this.valueMax+this.step<=this.maximum?this.valueMax+=this.step:this.valueMax=this.maximum},onInnerBarRightClick(){this.valueMax-this.rangeMarginValue>this.valueMin&&(this.valueMax-=this.step)},onInputMinChange(n){let e=parseFloat(n.target.value);e<=this.valueMax-this.rangeMarginValue&&e>=this.minimum?this.valueMin=e:n.target.value=this.valueMin},onInputMaxChange(n){let e=parseFloat(n.target.value);e>=this.valueMin+this.rangeMarginValue&&e<=this.maximum?this.valueMax=e:n.target.value=this.valueMax},onLeftThumbMousedown(n){if(n.preventDefault(),this.startX=n.clientX,n.type==="touchstart")if(n.touches.length===1)this.startX=n.touches[0].clientX;else return;this.mouseMoveCounter=0,this.barValue=this.valueMin,this.barBox=n.target.parentNode.getBoundingClientRect(),document.addEventListener("mousemove",this.onLeftThumbMousemove),document.addEventListener("mouseup",this.onLeftThumbMouseup),document.addEventListener("touchmove",this.onLeftThumbMousemove),document.addEventListener("touchend",this.onLeftThumbMouseup)},onLeftThumbMousemove(n){this.mouseMoveCounter++;let e=n.clientX;n.type==="touchmove"&&(e=n.touches[0].clientX);let i=(e-this.startX)/this.barBox.width,r=this.barValue+(this.maximum-this.minimum)*i,o=r%this.step;r-=o,r<this.minimum?r=this.minimum:r>this.valueMax-this.rangeMarginValue&&(r=this.valueMax-this.rangeMarginValue),this.valueMin=r},onLeftThumbMouseup(){document.removeEventListener("mousemove",this.onLeftThumbMousemove),document.removeEventListener("mouseup",this.onLeftThumbMouseup),document.removeEventListener("touchmove",this.onLeftThumbMousemove),document.removeEventListener("touchend",this.onLeftThumbMouseup)},onRightThumbMousedown(n){if(n.preventDefault(),this.startX=n.clientX,n.type==="touchstart")if(n.touches.length===1)this.startX=n.touches[0].clientX;else return;this.mouseMoveCounter=0,this.barValue=this.valueMax,this.barBox=n.target.parentNode.getBoundingClientRect(),document.addEventListener("mousemove",this.onRightThumbMousemove),document.addEventListener("mouseup",this.onRightThumbMouseup),document.addEventListener("touchmove",this.onRightThumbMousemove),document.addEventListener("touchend",this.onRightThumbMouseup)},onRightThumbMousemove(n){this.mouseMoveCounter++;let e=n.clientX;n.type==="touchmove"&&(e=n.touches[0].clientX);let i=(e-this.startX)/this.barBox.width,r=this.barValue+(this.maximum-this.minimum)*i,o=r%this.step;r-=o,r<this.valueMin+this.rangeMarginValue?r=this.valueMin+this.rangeMarginValue:r>this.maximum&&(r=this.maximum),this.valueMax=r},onRightThumbMouseup(){document.removeEventListener("mousemove",this.onRightThumbMousemove),document.removeEventListener("mouseup",this.onRightThumbMouseup),document.removeEventListener("touchmove",this.onRightThumbMousemove),document.removeEventListener("touchend",this.onRightThumbMouseup)},onMouseWheel(n){if(this.preventWheel===!0||!n.shiftKey&&!n.ctrlKey)return;let e=this.step;n.deltaY<0&&(e=-e),n.shiftKey&&n.ctrlKey?this.valueMin+e>=this.minimum&&this.valueMax+e<=this.maximum&&(this.valueMin=this.valueMin+e,this.valueMax=this.valueMax+e):n.ctrlKey?(e=this.valueMax+e,e<this.valueMin+this.rangeMarginValue?e=this.valueMin+this.rangeMarginValue:e>this.maximum&&(e=this.maximum),this.valueMax=e):n.shiftKey&&(e=this.valueMin+e,e<this.minimum?e=this.minimum:e>this.valueMax-this.rangeMarginValue&&(e=this.valueMax-this.rangeMarginValue),this.valueMin=e)},triggerInput(){let n=0;this.step.toString().includes(".")&&(n=2);let e={min:this.minimum,max:this.maximum,minValue:parseFloat(this.valueMin.toFixed(n)),maxValue:parseFloat(this.valueMax.toFixed(n))};this.$emit("input",e)}},computed:{minimum(){return this.min===void 0?0:this.min},maximum(){let n=this.labels||[],e=n.length?n.length-1:100;return this.max===void 0?e:this.max},stepCount(){let n=this.labels||[];return n.length?n.length-1:Math.floor((this.maximum-this.minimum)/this.step)},subStepCount(){return(this.labels||[]).length&&this.step>1?(this.maximum-this.minimum)/this.step:0},barMin(){return(this.valueMin-this.minimum)/(this.maximum-this.minimum)*100},barMax(){return 100-(this.valueMax-this.minimum)/(this.maximum-this.minimum)*100},barMinVal(){let n=0;return this.step.toString().includes(".")&&(n=2),(this.valueMin||0).toFixed(n)},barMaxVal(){let n=0;return this.step.toString().includes(".")&&(n=2),(this.valueMax||100).toFixed(n)},scaleLabels(){let n=this.labels||[];return n.length===0&&(n=[],n.push(this.minimum),n.push(this.maximum)),n}},watch:{valueMin(){this.triggerInput()},valueMax(){this.triggerInput()},minValue(n){this.valueMin=n<this.minimum?this.minimum:n},maxValue(n){this.valueMax=n>this.maximum?this.maximum:n}},mounted(){}},T8={class:"bar"},x8=["min","max","step","value"],z8={class:"caption"},A8={class:"min-caption"},b8={class:"bar-inner"},L8=["min","max","step","value"],k8={class:"caption"},C8={class:"max-caption"},w8={key:0,class:"ruler"},E8={key:1,class:"sub-ruler"},S8={key:2,class:"labels"};function O8(n,e,t,i,r,o){return c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass([t.baseClassName,r.rangeMarginValue===0?"zero-ranage-margin":""]),onMousewheel:e[10]||(e[10]=c.withModifiers((...s)=>o.onMouseWheel&&o.onMouseWheel(...s),["prevent","stop"]))},[c.createElementVNode("div",T8,[c.createElementVNode("div",{class:"bar-left",style:c.normalizeStyle({width:o.barMin+"%"}),onClick:e[0]||(e[0]=(...s)=>o.onBarLeftClick&&o.onBarLeftClick(...s))},null,4),c.createElementVNode("input",{class:"input-type-range input-type-range-min",type:"range",min:o.minimum,max:o.maximum,step:t.step,value:r.valueMin,onInput:e[1]||(e[1]=c.withModifiers((...s)=>o.onInputMinChange&&o.onInputMinChange(...s),["stop","prevent"]))},null,40,x8),c.createElementVNode("div",{class:"thumb thumb-left",onMousedown:e[2]||(e[2]=(...s)=>o.onLeftThumbMousedown&&o.onLeftThumbMousedown(...s)),onTouchstart:e[3]||(e[3]=(...s)=>o.onLeftThumbMousedown&&o.onLeftThumbMousedown(...s))},[c.createElementVNode("div",z8,[c.createElementVNode("span",A8,c.toDisplayString(t.minCaption||o.barMinVal),1)])],32),c.createElementVNode("div",b8,[c.createElementVNode("div",{class:"bar-inner-left",onClick:e[4]||(e[4]=(...s)=>o.onInnerBarLeftClick&&o.onInnerBarLeftClick(...s))}),c.createElementVNode("div",{class:"bar-inner-right",onClick:e[5]||(e[5]=(...s)=>o.onInnerBarRightClick&&o.onInnerBarRightClick(...s))})]),c.createElementVNode("input",{class:"input-type-range input-type-range-max",type:"range",min:o.minimum,max:o.maximum,step:t.step,value:r.valueMax,onInput:e[6]||(e[6]=c.withModifiers((...s)=>o.onInputMaxChange&&o.onInputMaxChange(...s),["stop","prevent"]))},null,40,L8),c.createElementVNode("div",{class:"thumb thumb-right",onMousedown:e[7]||(e[7]=(...s)=>o.onRightThumbMousedown&&o.onRightThumbMousedown(...s)),onTouchstart:e[8]||(e[8]=(...s)=>o.onRightThumbMousedown&&o.onRightThumbMousedown(...s))},[c.createElementVNode("div",k8,[c.createElementVNode("span",C8,c.toDisplayString(t.maxCaption||o.barMaxVal),1)])],32),c.createElementVNode("div",{class:"bar-right",style:c.normalizeStyle({width:o.barMax+"%"}),onClick:e[9]||(e[9]=(...s)=>o.onBarRightClick&&o.onBarRightClick(...s))},null,4)]),t.ruler?(c.openBlock(),c.createElementBlock("div",w8,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(o.stepCount,s=>(c.openBlock(),c.createElementBlock("div",{key:s,class:"ruler-rule"}))),128))])):c.createCommentVNode("",!0),o.subStepCount?(c.openBlock(),c.createElementBlock("div",E8,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(o.subStepCount,s=>(c.openBlock(),c.createElementBlock("div",{key:s,class:"ruler-sub-rule"}))),128))])):c.createCommentVNode("",!0),t.label?(c.openBlock(),c.createElementBlock("div",S8,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(o.scaleLabels,s=>(c.openBlock(),c.createElementBlock("div",{class:"label",key:s},c.toDisplayString(s),1))),128))])):c.createCommentVNode("",!0)],34)}const v8=ce(D8,[["render",O8]]),Hpe="";Tl.register(A2,MM,gM,pM);const U8=c.defineComponent({components:{Bar:m8,MultiRangeSlider:v8},emits:["update","update:model-value"],props:{numberRange:{type:Array,default:()=>[{key:0,count:10}]},width:{type:Number,default:200},height:{type:Number,default:50},chartId:{type:String,default:"bar-chart"},datasetIdKey:{type:String,default:"label"},includeForm:{type:Boolean,default:!1},isMatch:{type:Boolean,default:!0},isExclude:{type:Boolean,default:!1},isDisable:{type:Boolean,default:!1},modelValue:{type:Object,required:!1,default:null}},data(){var n,e,t,i;return{chartData:{labels:[],datasets:[{labels:"",data:[],backgroundColor:[((n=getComputedStyle(document.documentElement).getPropertyValue("--dh-number-range-active"))==null?void 0:n.trim())||"#5ea9e5"],borderRadius:1,hoverBackgroundColor:((e=getComputedStyle(document.documentElement).getPropertyValue("--dh-number-range-inactive"))==null?void 0:e.trim())||"#e0e0e0"}]},chartOptions:{responsive:!0,plugins:{legend:{display:!1}},scales:{x:{display:!1,grid:{display:!1},ticks:{display:!0}},y:{display:!1,grid:{display:!1},ticks:{display:!1}}}},min:0,max:this.numberRange.length-1,validated:!1,activeColor:((t=getComputedStyle(document.documentElement).getPropertyValue("--dh-number-range-active"))==null?void 0:t.trim())||"#5ea9e5",inactiveColor:((i=getComputedStyle(document.documentElement).getPropertyValue("--dh-number-range-inactive"))==null?void 0:i.trim())||"#e0e0e0"}},computed:{getRangeLength(){return this.numberRange.length},getFirstKey(){return this.numberRange[0].key},getLastKey(){return this.numberRange[this.getRangeLength-1].key},getMinKey(){return this.numberRange[this.min].key},getMinCaption(){return`${this.getMinKey}`},getMaxCaption(){return`${this.getMaxKey}`},getMaxKey(){return this.numberRange[this.max].key},getLastIndex(){return this.numberRange.length-1}},watch:{modelValue(n){this.max=this.numberRange.findIndex(e=>e.key==n.maxKey),this.min=this.numberRange.findIndex(e=>e.key==n.minKey)}},mounted(){var i,r;const n=document.documentElement,e=(i=getComputedStyle(n).getPropertyValue("--dh-number-range-active"))==null?void 0:i.trim(),t=(r=getComputedStyle(n).getPropertyValue("--dh-number-range-inactive"))==null?void 0:r.trim();e&&(this.activeColor=e),t&&(this.inactiveColor=t),this.setChartData(this.numberRange),this.isDisable&&this.missingFilter(),this.$props.modelValue&&(this.max=this.numberRange.findIndex(o=>o.key===this.$props.modelValue.maxKey),this.min=this.numberRange.findIndex(o=>o.key===this.$props.modelValue.minKey)),this.triggerChartDataUpdate()},methods:{updateRange(){const n=this.getMinKey,e=this.getMaxKey;this.$props.modelValue&&this.$emit("update:model-value",{minKey:n,maxKey:e}),this.$emit("update",{minKey:n,maxKey:e})},updateBarChart(n){const{minValue:e,maxValue:t}=n;this.min=e,this.max=t,this.isDisable||(this.isExclude?this.excludeFilter():this.matchFilter())},matchFilter(){if(!this.isDisable){var n=this.chartData.datasets[0].data;this.chartData.datasets[0].backgroundColor=[];for(let e=0;e<=n.length;e++)e>=this.min&&e<=this.max?this.chartData.datasets[0].backgroundColor.push(this.activeColor):this.chartData.datasets[0].backgroundColor.push(this.inactiveColor);this.triggerChartDataUpdate()}},excludeFilter(){if(!this.isDisable){var n=this.chartData.datasets[0].data;this.chartData.datasets[0].backgroundColor=[];for(let e=0;e<n.length;e++)e>=this.min&&e<=this.max?this.chartData.datasets[0].backgroundColor.push(this.inactiveColor):this.chartData.datasets[0].backgroundColor.push(this.activeColor);this.triggerChartDataUpdate()}},missingFilter(){this.validated=!this.validated;var n=this.chartData.datasets[0].data;if(this.chartData.datasets[0].backgroundColor=[],this.validated)for(let e=1;e<=n.length;e++)this.chartData.datasets[0].backgroundColor.push(this.inactiveColor);else this.isMatch&&this.matchFilter(),this.isExclude&&this.excludeFilter()},changeMin(n){let e=parseInt(n.target.value);this.min=e||0,this.isMatch&&!this.isDisable&&this.matchFilter(),this.isExclude&&!this.isDisable&&this.excludeFilter()},changeMax(n){let e=parseInt(n.target.value);this.max=e,this.isMatch&&!this.isDisable&&this.matchFilter(),this.isExclude&&!this.isDisable&&this.excludeFilter()},setChartData(n){let e=this.chartData.labels,t=[];for(let i=0;i<n.length;i++)e.push(n[i].key),t.push(n[i].count);this.chartData.datasets[0].data=t},triggerChartDataUpdate(){this.$nextTick(()=>{this.chartData={...this.chartData,datasets:[...this.chartData.datasets]}})}}}),Gpe="",Q8={class:"dh-range-container"},Y8={class:"bar-chart"},_8={key:0,class:"input-group-section"},R8={class:"input-group sb-input"},V8=["disabled","max","value"],B8={class:"input-group sb-input"},Z8=["disabled","max","min","value"];function P8(n,e,t,i,r,o){const s=c.resolveComponent("Bar"),a=c.resolveComponent("MultiRangeSlider");return c.openBlock(),c.createElementBlock("div",Q8,[c.createElementVNode("div",Y8,[c.createElementVNode("div",null,[c.createVNode(s,{"chart-id":n.chartId,data:n.chartData,"dataset-id-key":n.datasetIdKey,height:n.height,options:n.chartOptions,width:n.width},null,8,["chart-id","data","dataset-id-key","height","options","width"])]),c.createVNode(a,{"base-class-name":`multi-range-slider range-slider ${n.isDisable}`,label:!1,max:n.getLastIndex,"max-caption":n.getMaxCaption,"max-value":n.max,min:0,"min-caption":n.getMinCaption,"min-value":n.min,"range-margin":0,ruler:!1,step:1,onInput:n.updateBarChart},null,8,["base-class-name","max","max-caption","max-value","min-caption","min-value","onInput"])]),n.includeForm?(c.openBlock(),c.createElementBlock("div",_8,[c.createElementVNode("div",R8,[c.createElementVNode("label",{class:c.normalizeClass(`dh-body-2 input-to ${n.validated?"disable":""}`)}," From ",2),c.createElementVNode("input",{class:"form-input text",disabled:n.validated,max:n.max,min:"1",placeholder:"From",type:"number",value:n.getMinKey,onInput:e[0]||(e[0]=l=>n.changeMin(l))},null,40,V8)]),c.createElementVNode("div",B8,[c.createElementVNode("label",{class:c.normalizeClass(`dh-body-2 input-to ${n.validated?"disable":""}`)}," To ",2),c.createElementVNode("input",{class:"form-input text",disabled:n.validated,max:n.max,min:n.min,placeholder:"To",type:"number",value:n.getMaxKey,onInput:e[1]||(e[1]=l=>n.changeMax(l))},null,40,Z8)])])):c.createCommentVNode("",!0),c.renderSlot(n.$slots,"input",{},void 0,!0),c.createElementVNode("button",{class:"btn",onClick:e[2]||(e[2]=l=>n.updateRange())},"Apply")])}const P2=ce(U8,[["render",P8],["__scopeId","data-v-8840d311"]]),$pe="",Jpe="",W2=n=>(c.pushScopeId("data-v-fea4582b"),n=n(),c.popScopeId(),n),W8={id:"dp-container"},F8=W2(()=>c.createElementVNode("div",{class:"dp__calendar_range"},[c.createElementVNode("p",null,"From"),c.createElementVNode("p",null,"To")],-1)),H8={class:"dp__multi"},G8=["value"],$8=["value"],J8=["onClick"],X8=["onClick"],K8=["onClick"],q8=["onClick"],eZ=["onClick"],tZ=["onClick"],nZ=["onClick"],iZ=["onClick"],rZ=W2(()=>c.createElementVNode("div",{id:"tags",class:"dp__calendar_tags"},null,-1)),oZ=ce({__name:"AdvancedDatePicker",props:{numberRange:{type:Array,required:!0}},emits:["update"],setup(n,{emit:e}){const t=c.ref(["",""]),i=c.ref(null),r=c.ref(null),o=c.ref(null),s=c.ref(!1),a=c.ref([{label:"Today",range:[new Date,new Date],slot:"today"},{label:"Previous week",range:[$I(GI(new Date)),GI(new Date)],slot:"previousWeek"},{label:"This week",range:[$I(new Date),jU(new Date)],slot:"week"},{label:"Next week",range:[IU(new Date),mU(new Date().setDate(new Date().getDate()+7))],slot:"nextWeek"},{label:"This month",range:[cu(new Date),lu(new Date)],slot:"currentMonth"},{label:"Previous month",range:[cu(Jn(new Date,1)),lu(Jn(new Date,1))],slot:"previousMonth"},{label:"Last 3 months",range:[cu(Jn(new Date,3)),lu(Jn(new Date,1))],slot:"threeMonths"},{label:"Last 6 months",range:[cu(Jn(new Date,6)),lu(Jn(new Date,1))],slot:"sixMonths"},{label:"Last year",range:[ZE(new Date),BE(new Date)],slot:"yearly"}]),l=h=>{t.value=h,e("update",t.value)};function u(h){r.value=h.target.value,t.value=[h.target.value,i.value]}function d(h){i.value=h.target.value,t.value=[r.value,h.target.value]}c.onMounted(()=>{o.value.openMenu()});function M(){o.value.openMenu()}return(h,g)=>(c.openBlock(),c.createElementBlock("div",W8,[F8,c.createVNode(c.unref(Yd),{ref_key:"datePicker",ref:o,modelValue:t.value,"onUpdate:modelValue":[g[2]||(g[2]=f=>t.value=f),l],"auto-apply":"","day-names":["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],"enable-time-picker":!1,"model-type":"dd/MM/yyyy","multi-calendars":"","multi-calendars-solo":"","multi-static":!1,offset:12,position:"left","preset-ranges":a.value,range:"","select-text":"Apply","text-input":"",uid:"advanced",onClosed:M},{"dp-input":c.withCtx(()=>[c.createElementVNode("div",H8,[c.createElementVNode("input",{class:"dp__input dp__multi_input",placeholder:"MM/DD/YYYY",type:"text",value:r.value?r.value:t.value[0],onInput:g[0]||(g[0]=f=>u(f))},null,40,G8),c.createElementVNode("input",{class:"dp__input dp__multi_input",placeholder:"MM/DD/YYYY",type:"text",value:i.value?i.value:t.value[1],onInput:g[1]||(g[1]=f=>d(f))},null,40,$8)])]),"arrow-left":c.withCtx(()=>[c.createVNode(Ae,{"icon-name":"previous",size:20})]),"arrow-right":c.withCtx(()=>[c.createVNode(Ae,{"icon-name":"next",size:20})]),"calendar-icon":c.withCtx(()=>[c.createTextVNode(" Back ")]),"clear-icon":c.withCtx(()=>[]),"action-preview":c.withCtx(()=>[]),"action-select":c.withCtx(()=>[]),previousWeek:c.withCtx(({label:f,range:p,presetDateRange:N})=>[(c.openBlock(),c.createBlock(c.Teleport,{to:"#tags"},[c.createElementVNode("span",{onClick:y=>N(p)},c.toDisplayString(f),9,J8)]))]),week:c.withCtx(({label:f,range:p,presetDateRange:N})=>[(c.openBlock(),c.createBlock(c.Teleport,{to:"#tags"},[c.createElementVNode("span",{onClick:y=>N(p)},c.toDisplayString(f),9,X8)]))]),nextWeek:c.withCtx(({label:f,range:p,presetDateRange:N})=>[(c.openBlock(),c.createBlock(c.Teleport,{to:"#tags"},[c.createElementVNode("span",{onClick:y=>N(p)},c.toDisplayString(f),9,K8)]))]),currentMonth:c.withCtx(({label:f,range:p,presetDateRange:N})=>[(c.openBlock(),c.createBlock(c.Teleport,{to:"#tags"},[c.createElementVNode("span",{onClick:y=>N(p)},c.toDisplayString(f),9,q8)]))]),previousMonth:c.withCtx(({label:f,range:p,presetDateRange:N})=>[(c.openBlock(),c.createBlock(c.Teleport,{to:"#tags"},[c.createElementVNode("span",{onClick:y=>N(p)},c.toDisplayString(f),9,eZ)]))]),threeMonths:c.withCtx(({label:f,range:p,presetDateRange:N})=>[(c.openBlock(),c.createBlock(c.Teleport,{to:"#tags"},[c.createElementVNode("span",{onClick:y=>N(p)},c.toDisplayString(f),9,tZ)]))]),sixMonths:c.withCtx(({label:f,range:p,presetDateRange:N})=>[(c.openBlock(),c.createBlock(c.Teleport,{to:"#tags"},[c.createElementVNode("span",{onClick:y=>N(p)},c.toDisplayString(f),9,nZ)]))]),yearly:c.withCtx(({label:f,range:p,presetDateRange:N})=>[(c.openBlock(),c.createBlock(c.Teleport,{to:"#tags"},[c.createElementVNode("span",{onClick:y=>N(p)},c.toDisplayString(f),9,iZ)]))]),_:1},8,["modelValue","preset-ranges"]),c.createVNode(P2,{class:"dp__calendar_range_number","number-range":n.numberRange,steps:1},{input:c.withCtx(()=>[rZ]),filter:c.withCtx(()=>[c.createVNode(C4,{data:s.value,label:"Include time",onChange:g[3]||(g[3]=f=>s.value=f)},null,8,["data"])]),_:1},8,["number-range"])]))}},[["__scopeId","data-v-fea4582b"]]),sZ=c.defineComponent({components:{DhIcon:Ae},props:{mainText:{type:String,default:"Advanced"},filterMissingText:{type:String,default:"Filter Missing"},matchText:{type:String,default:"Match"},excludeText:{type:String,default:"Exclude"}},data(){return{activeFilter:!1,isFilterMissing:!1,isMatch:!1,isExclude:!1}},emits:["match","exclude","filter_missing"],mounted(){this.isMatch=!0},methods:{toggleFilter(){this.activeFilter=!this.activeFilter},matchFilter(){this.isMatch=!0,this.isExclude=!1,this.$emit("match",this.isMatch)},excludeFilter(){this.isMatch=!1,this.isExclude=!0,this.$emit("exclude",this.isExclude)},missingFilter(){this.isFilterMissing=!this.isFilterMissing,this.$emit("filter_missing",this.isFilterMissing),this.isFilterMissing&&this.isMatch?this.matchFilter():this.isFilterMissing&&this.isExclude&&this.excludeFilter()}}}),aZ={class:"dh-advanced-filter-container"},lZ={class:"advance_section"},cZ={key:0},uZ={class:"list-none"},dZ=["checked"],MZ=["checked"],hZ=["checked"];function gZ(n,e,t,i,r,o){const s=c.resolveComponent("dh-icon");return c.openBlock(),c.createElementBlock("div",aZ,[c.createElementVNode("div",lZ,[c.createElementVNode("span",{class:"toggle-icon",onClick:e[0]||(e[0]=a=>n.toggleFilter())},[c.createTextVNode(c.toDisplayString(n.mainText)+" ",1),c.createVNode(s,{"icon-name":n.activeFilter?"arrow-up":"arrow-down",size:20},null,8,["icon-name"])]),n.activeFilter?(c.openBlock(),c.createElementBlock("div",cZ,[c.renderSlot(n.$slots,"default"),c.createElementVNode("ul",uZ,[c.createElementVNode("li",null,[c.createElementVNode("label",null,[c.createElementVNode("input",{checked:n.isFilterMissing,name:"number_filter",type:"checkbox",onChange:e[1]||(e[1]=a=>n.missingFilter())},null,40,dZ),c.createTextVNode(" "+c.toDisplayString(n.filterMissingText),1)])]),c.createElementVNode("li",null,[c.createElementVNode("label",null,[c.createElementVNode("input",{checked:n.isMatch,name:"number_filter",type:"radio",onChange:e[2]||(e[2]=a=>n.matchFilter())},null,40,MZ),c.createTextVNode(" "+c.toDisplayString(n.matchText),1)]),c.createElementVNode("label",null,[c.createElementVNode("input",{checked:n.isExclude,name:"number_filter",type:"radio",onChange:e[3]||(e[3]=a=>n.excludeFilter())},null,40,hZ),c.createTextVNode(" "+c.toDisplayString(n.excludeText),1)])])])])):c.createCommentVNode("",!0)])])}const fZ=ce(sZ,[["render",gZ]]),F2=n=>{const e=parseInt(n.replace("#",""),16),t=e>>16&255,i=e>>8&255,r=e&255;return`${t}, ${i}, ${r}`},H2=n=>({"--custom-color":`rgb(${n})`,"--custom-color-light":`rgb(${n}, 0.3)`,"--custom-color-lighter":`rgba(${n}, 0.06)`}),pZ=n=>{const e=`
|
|
19
|
+
`):n}function _7(n,e){const{element:t,datasetIndex:i,index:r}=e,o=n.getDatasetMeta(i).controller,{label:s,value:a}=o.getLabelAndValue(r);return{chart:n,label:s,parsed:o.getParsed(r),raw:n.data.datasets[i].data[r],formattedValue:a,dataset:o.getDataset(),dataIndex:r,datasetIndex:i,element:t}}function m2(n,e){const t=n.chart.ctx,{body:i,footer:r,title:o}=n,{boxWidth:s,boxHeight:a}=e,l=dn(e.bodyFont),u=dn(e.titleFont),d=dn(e.footerFont),M=o.length,h=r.length,g=i.length,f=_n(e.padding);let p=f.height,N=0,y=i.reduce((w,k)=>w+k.before.length+k.lines.length+k.after.length,0);if(y+=n.beforeBody.length+n.afterBody.length,M&&(p+=M*u.lineHeight+(M-1)*e.titleSpacing+e.titleMarginBottom),y){const w=e.displayColors?Math.max(a,l.lineHeight):l.lineHeight;p+=g*w+(y-g)*l.lineHeight+(y-1)*e.bodySpacing}h&&(p+=e.footerMarginTop+h*d.lineHeight+(h-1)*e.footerSpacing);let j=0;const A=function(w){N=Math.max(N,t.measureText(w).width+j)};return t.save(),t.font=u.string,Ze(n.title,A),t.font=l.string,Ze(n.beforeBody.concat(n.afterBody),A),j=e.displayColors?s+2+e.boxPadding:0,Ze(i,w=>{Ze(w.before,A),Ze(w.lines,A),Ze(w.after,A)}),j=0,t.font=d.string,Ze(n.footer,A),t.restore(),N+=f.width,{width:N,height:p}}function R7(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function V7(n,e,t,i){const{x:r,width:o}=i,s=t.caretSize+t.caretPadding;if(n==="left"&&r+o+s>e.width||n==="right"&&r-o-s<0)return!0}function B7(n,e,t,i){const{x:r,width:o}=t,{width:s,chartArea:{left:a,right:l}}=n;let u="center";return i==="center"?u=r<=(a+l)/2?"left":"right":r<=o/2?u="left":r>=s-o/2&&(u="right"),V7(u,n,e,t)&&(u="center"),u}function I2(n,e,t){const i=t.yAlign||e.yAlign||R7(n,t);return{xAlign:t.xAlign||e.xAlign||B7(n,e,t,i),yAlign:i}}function Z7(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function P7(n,e,t){let{y:i,height:r}=n;return e==="top"?i+=t:e==="bottom"?i-=r+t:i-=r/2,i}function D2(n,e,t,i){const{caretSize:r,caretPadding:o,cornerRadius:s}=n,{xAlign:a,yAlign:l}=t,u=r+o,{topLeft:d,topRight:M,bottomLeft:h,bottomRight:g}=Rs(s);let f=Z7(e,a);const p=P7(e,l,u);return l==="center"?a==="left"?f+=u:a==="right"&&(f-=u):a==="left"?f-=Math.max(d,h)+r:a==="right"&&(f+=Math.max(M,g)+r),{x:Yn(f,0,i.width-e.width),y:Yn(p,0,i.height-e.height)}}function hM(n,e,t){const i=_n(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function T2(n){return vi([],ar(n))}function W7(n,e,t){return Vr(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function x2(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}const z2={beforeTitle:rr,title(n){if(n.length>0){const e=n[0],t=e.chart.data.labels,i=t?t.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(i>0&&e.dataIndex<i)return t[e.dataIndex]}return""},afterTitle:rr,beforeBody:rr,beforeLabel:rr,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let e=n.dataset.label||"";e&&(e+=": ");const t=n.formattedValue;return Be(t)||(e+=t),e},labelColor(n){const t=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{borderColor:t.borderColor,backgroundColor:t.backgroundColor,borderWidth:t.borderWidth,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(n){const t=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:t.pointStyle,rotation:t.rotation}},afterLabel:rr,afterBody:rr,beforeFooter:rr,footer:rr,afterFooter:rr};function In(n,e,t,i){const r=n[e].call(t,i);return typeof r>"u"?z2[e].call(t,i):r}class YN extends Vo{constructor(e){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=e.chart,this.options=e.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(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const t=this.chart,i=this.options.setContext(this.getContext()),r=i.enabled&&t.options.animation&&i.animations,o=new DD(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=W7(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:i}=t,r=In(i,"beforeTitle",this,e),o=In(i,"title",this,e),s=In(i,"afterTitle",this,e);let a=[];return a=vi(a,ar(r)),a=vi(a,ar(o)),a=vi(a,ar(s)),a}getBeforeBody(e,t){return T2(In(t.callbacks,"beforeBody",this,e))}getBody(e,t){const{callbacks:i}=t,r=[];return Ze(e,o=>{const s={before:[],lines:[],after:[]},a=x2(i,o);vi(s.before,ar(In(a,"beforeLabel",this,o))),vi(s.lines,In(a,"label",this,o)),vi(s.after,ar(In(a,"afterLabel",this,o))),r.push(s)}),r}getAfterBody(e,t){return T2(In(t.callbacks,"afterBody",this,e))}getFooter(e,t){const{callbacks:i}=t,r=In(i,"beforeFooter",this,e),o=In(i,"footer",this,e),s=In(i,"afterFooter",this,e);let a=[];return a=vi(a,ar(r)),a=vi(a,ar(o)),a=vi(a,ar(s)),a}_createItems(e){const t=this._active,i=this.chart.data,r=[],o=[],s=[];let a=[],l,u;for(l=0,u=t.length;l<u;++l)a.push(_7(this.chart,t[l]));return e.filter&&(a=a.filter((d,M,h)=>e.filter(d,M,h,i))),e.itemSort&&(a=a.sort((d,M)=>e.itemSort(d,M,i))),Ze(a,d=>{const M=x2(e.callbacks,d);r.push(In(M,"labelColor",this,d)),o.push(In(M,"labelPointStyle",this,d)),s.push(In(M,"labelTextColor",this,d))}),this.labelColors=r,this.labelPointStyles=o,this.labelTextColors=s,this.dataPoints=a,a}update(e,t){const i=this.options.setContext(this.getContext()),r=this._active;let o,s=[];if(!r.length)this.opacity!==0&&(o={opacity:0});else{const a=xl[i.position].call(this,r,this._eventPosition);s=this._createItems(i),this.title=this.getTitle(s,i),this.beforeBody=this.getBeforeBody(s,i),this.body=this.getBody(s,i),this.afterBody=this.getAfterBody(s,i),this.footer=this.getFooter(s,i);const l=this._size=m2(this,i),u=Object.assign({},a,l),d=I2(this.chart,i,u),M=D2(i,u,d,this.chart);this.xAlign=d.xAlign,this.yAlign=d.yAlign,o={opacity:1,x:M.x,y:M.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=s,this.$context=void 0,o&&this._resolveAnimations().update(this,o),e&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,i,r){const o=this.getCaretPosition(e,i,r);t.lineTo(o.x1,o.y1),t.lineTo(o.x2,o.y2),t.lineTo(o.x3,o.y3)}getCaretPosition(e,t,i){const{xAlign:r,yAlign:o}=this,{caretSize:s,cornerRadius:a}=i,{topLeft:l,topRight:u,bottomLeft:d,bottomRight:M}=Rs(a),{x:h,y:g}=e,{width:f,height:p}=t;let N,y,j,A,w,k;return o==="center"?(w=g+p/2,r==="left"?(N=h,y=N-s,A=w+s,k=w-s):(N=h+f,y=N+s,A=w-s,k=w+s),j=N):(r==="left"?y=h+Math.max(l,d)+s:r==="right"?y=h+f-Math.max(u,M)-s:y=this.caretX,o==="top"?(A=g,w=A-s,N=y-s,j=y+s):(A=g+p,w=A+s,N=y+s,j=y-s),k=A),{x1:N,x2:y,x3:j,y1:A,y2:w,y3:k}}drawTitle(e,t,i){const r=this.title,o=r.length;let s,a,l;if(o){const u=DN(i.rtl,this.x,this.width);for(e.x=hM(this,i.titleAlign,i),t.textAlign=u.textAlign(i.titleAlign),t.textBaseline="middle",s=dn(i.titleFont),a=i.titleSpacing,t.fillStyle=i.titleColor,t.font=s.string,l=0;l<o;++l)t.fillText(r[l],u.x(e.x),e.y+s.lineHeight/2),e.y+=s.lineHeight+a,l+1===o&&(e.y+=i.titleMarginBottom-a)}}_drawColorBox(e,t,i,r,o){const s=this.labelColors[i],a=this.labelPointStyles[i],{boxHeight:l,boxWidth:u}=o,d=dn(o.bodyFont),M=hM(this,"left",o),h=r.x(M),g=l<d.lineHeight?(d.lineHeight-l)/2:0,f=t.y+g;if(o.usePointStyle){const p={radius:Math.min(u,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},N=r.leftForLtr(h,u)+u/2,y=f+l/2;e.strokeStyle=o.multiKeyBackground,e.fillStyle=o.multiKeyBackground,gN(e,p,N,y),e.strokeStyle=s.borderColor,e.fillStyle=s.backgroundColor,gN(e,p,N,y)}else{e.lineWidth=Se(s.borderWidth)?Math.max(...Object.values(s.borderWidth)):s.borderWidth||1,e.strokeStyle=s.borderColor,e.setLineDash(s.borderDash||[]),e.lineDashOffset=s.borderDashOffset||0;const p=r.leftForLtr(h,u),N=r.leftForLtr(r.xPlus(h,1),u-2),y=Rs(s.borderRadius);Object.values(y).some(j=>j!==0)?(e.beginPath(),e.fillStyle=o.multiKeyBackground,$d(e,{x:p,y:f,w:u,h:l,radius:y}),e.fill(),e.stroke(),e.fillStyle=s.backgroundColor,e.beginPath(),$d(e,{x:N,y:f+1,w:u-2,h:l-2,radius:y}),e.fill()):(e.fillStyle=o.multiKeyBackground,e.fillRect(p,f,u,l),e.strokeRect(p,f,u,l),e.fillStyle=s.backgroundColor,e.fillRect(N,f+1,u-2,l-2))}e.fillStyle=this.labelTextColors[i]}drawBody(e,t,i){const{body:r}=this,{bodySpacing:o,bodyAlign:s,displayColors:a,boxHeight:l,boxWidth:u,boxPadding:d}=i,M=dn(i.bodyFont);let h=M.lineHeight,g=0;const f=DN(i.rtl,this.x,this.width),p=function(T){t.fillText(T,f.x(e.x+g),e.y+h/2),e.y+=h+o},N=f.textAlign(s);let y,j,A,w,k,L,E;for(t.textAlign=s,t.textBaseline="middle",t.font=M.string,e.x=hM(this,N,i),t.fillStyle=i.bodyColor,Ze(this.beforeBody,p),g=a&&N!=="right"?s==="center"?u/2+d:u+2+d:0,w=0,L=r.length;w<L;++w){for(y=r[w],j=this.labelTextColors[w],t.fillStyle=j,Ze(y.before,p),A=y.lines,a&&A.length&&(this._drawColorBox(t,e,w,f,i),h=Math.max(M.lineHeight,l)),k=0,E=A.length;k<E;++k)p(A[k]),h=M.lineHeight;Ze(y.after,p)}g=0,h=M.lineHeight,Ze(this.afterBody,p),e.y-=o}drawFooter(e,t,i){const r=this.footer,o=r.length;let s,a;if(o){const l=DN(i.rtl,this.x,this.width);for(e.x=hM(this,i.footerAlign,i),e.y+=i.footerMarginTop,t.textAlign=l.textAlign(i.footerAlign),t.textBaseline="middle",s=dn(i.footerFont),t.fillStyle=i.footerColor,t.font=s.string,a=0;a<o;++a)t.fillText(r[a],l.x(e.x),e.y+s.lineHeight/2),e.y+=s.lineHeight+i.footerSpacing}}drawBackground(e,t,i,r){const{xAlign:o,yAlign:s}=this,{x:a,y:l}=e,{width:u,height:d}=i,{topLeft:M,topRight:h,bottomLeft:g,bottomRight:f}=Rs(r.cornerRadius);t.fillStyle=r.backgroundColor,t.strokeStyle=r.borderColor,t.lineWidth=r.borderWidth,t.beginPath(),t.moveTo(a+M,l),s==="top"&&this.drawCaret(e,t,i,r),t.lineTo(a+u-h,l),t.quadraticCurveTo(a+u,l,a+u,l+h),s==="center"&&o==="right"&&this.drawCaret(e,t,i,r),t.lineTo(a+u,l+d-f),t.quadraticCurveTo(a+u,l+d,a+u-f,l+d),s==="bottom"&&this.drawCaret(e,t,i,r),t.lineTo(a+g,l+d),t.quadraticCurveTo(a,l+d,a,l+d-g),s==="center"&&o==="left"&&this.drawCaret(e,t,i,r),t.lineTo(a,l+M),t.quadraticCurveTo(a,l,a+M,l),t.closePath(),t.fill(),r.borderWidth>0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,i=this.$animations,r=i&&i.x,o=i&&i.y;if(r||o){const s=xl[e.position].call(this,this._active,this._eventPosition);if(!s)return;const a=this._size=m2(this,e),l=Object.assign({},s,this._size),u=I2(t,e,l),d=D2(e,l,u,t);(r._to!==d.x||o._to!==d.y)&&(this.xAlign=u.xAlign,this.yAlign=u.yAlign,this.width=a.width,this.height=a.height,this.caretX=s.x,this.caretY=s.y,this._resolveAnimations().update(this,d))}}_willRender(){return!!this.opacity}draw(e){const t=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(t);const r={width:this.width,height:this.height},o={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const s=_n(t.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&a&&(e.save(),e.globalAlpha=i,this.drawBackground(o,e,r,t),f6(e,t.textDirection),o.y+=s.top,this.drawTitle(o,e,t),this.drawBody(o,e,t),this.drawFooter(o,e,t),p6(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){const i=this._active,r=e.map(({datasetIndex:a,index:l})=>{const u=this.chart.getDatasetMeta(a);if(!u)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:u.data[l],index:l}}),o=!Bd(i,r),s=this._positionChanged(r,t);(o||s)&&(this._active=r,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,i=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const r=this.options,o=this._active||[],s=this._getActiveElements(e,o,t,i),a=this._positionChanged(s,e),l=t||!Bd(s,o)||a;return l&&(this._active=s,(r.enabled||r.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),l}_getActiveElements(e,t,i,r){const o=this.options;if(e.type==="mouseout")return[];if(!r)return t.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const s=this.chart.getElementsAtEventForMode(e,o.mode,o,i);return o.reverse&&s.reverse(),s}_positionChanged(e,t){const{caretX:i,caretY:r,options:o}=this,s=xl[o.position].call(this,e,t);return s!==!1&&(i!==s.x||r!==s.y)}}ne(YN,"positioners",xl);var A2={id:"tooltip",_element:YN,positioners:xl,afterInit(n,e,t){t&&(n.tooltip=new YN({chart:n,options:t}))},beforeUpdate(n,e,t){n.tooltip&&n.tooltip.initialize(t)},reset(n,e,t){n.tooltip&&n.tooltip.initialize(t)},afterDraw(n){const e=n.tooltip;if(e&&e._willRender()){const t={tooltip:e};if(n.notifyPlugins("beforeTooltipDraw",{...t,cancelable:!0})===!1)return;e.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",t)}},afterEvent(n,e){if(n.tooltip){const t=e.replay;n.tooltip.handleEvent(e.event,t,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,e)=>e.bodyFont.size,boxWidth:(n,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:z2},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const F7=(n,e,t,i)=>(typeof e=="string"?(t=n.push(e)-1,i.unshift({index:t,label:e})):isNaN(e)&&(t=null),t);function H7(n,e,t,i){const r=n.indexOf(e);if(r===-1)return F7(n,e,t,i);const o=n.lastIndexOf(e);return r!==o?t:r}const G7=(n,e)=>n===null?null:Yn(Math.round(n),0,e);function b2(n){const e=this.getLabels();return n>=0&&n<e.length?e[n]:n}class gM extends Bo{constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const t=this._addedLabels;if(t.length){const i=this.getLabels();for(const{index:r,label:o}of t)i[r]===o&&i.splice(r,1);this._addedLabels=[]}super.init(e)}parse(e,t){if(Be(e))return null;const i=this.getLabels();return t=isFinite(t)&&i[t]===e?t:H7(i,e,Ye(t,e),this._addedLabels),G7(t,i.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let{min:i,max:r}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(i=0),t||(r=this.getLabels().length-1)),this.min=i,this.max=r}buildTicks(){const e=this.min,t=this.max,i=this.options.offset,r=[];let o=this.getLabels();o=e===0&&t===o.length-1?o:o.slice(e,t+1),this._valueRange=Math.max(o.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let s=e;s<=t;s++)r.push({value:s});return r}getLabelForValue(e){return b2.call(this,e)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(e){return typeof e!="number"&&(e=this.parse(e)),e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}ne(gM,"id","category"),ne(gM,"defaults",{ticks:{callback:b2}});function $7(n,e){const t=[],{bounds:r,step:o,min:s,max:a,precision:l,count:u,maxTicks:d,maxDigits:M,includeBounds:h}=n,g=o||1,f=d-1,{min:p,max:N}=e,y=!Be(s),j=!Be(a),A=!Be(u),w=(N-p)/(M+1);let k=B4((N-p)/f/g)*g,L,E,T,x;if(k<1e-14&&!y&&!j)return[{value:p},{value:N}];x=Math.ceil(N/k)-Math.floor(p/k),x>f&&(k=B4(x*k/f/g)*g),Be(l)||(L=Math.pow(10,l),k=Math.ceil(k*L)/L),r==="ticks"?(E=Math.floor(p/k)*k,T=Math.ceil(N/k)*k):(E=p,T=N),y&&j&&o&&dV((a-s)/o,k/1e3)?(x=Math.round(Math.min((a-s)/k,d)),k=(a-s)/x,E=s,T=a):A?(E=y?s:E,T=j?a:T,x=u-1,k=(T-E)/x):(x=(T-E)/k,cl(x,Math.round(x),k/1e3)?x=Math.round(x):x=Math.ceil(x));const b=Math.max(P4(k),P4(E));L=Math.pow(10,Be(l)?b:l),E=Math.round(E*L)/L,T=Math.round(T*L)/L;let m=0;for(y&&(h&&E!==s?(t.push({value:s}),E<s&&m++,cl(Math.round((E+m*k)*L)/L,s,L2(s,w,n))&&m++):E<s&&m++);m<x;++m){const I=Math.round((E+m*k)*L)/L;if(j&&I>a)break;t.push({value:I})}return j&&h&&T!==a?t.length&&cl(t[t.length-1].value,a,L2(a,w,n))?t[t.length-1].value=a:t.push({value:a}):(!j||T===a)&&t.push({value:T}),t}function L2(n,e,{horizontal:t,minRotation:i}){const r=Rr(i),o=(t?Math.sin(r):Math.cos(r))||.001,s=.75*e*(""+n).length;return Math.min(e/o,s)}class fM extends Bo{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,t){return Be(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:t,maxDefined:i}=this.getUserBounds();let{min:r,max:o}=this;const s=l=>r=t?r:l,a=l=>o=i?o:l;if(e){const l=Si(r),u=Si(o);l<0&&u<0?a(0):l>0&&u>0&&s(0)}if(r===o){let l=o===0?1:Math.abs(o*.05);a(o+l),e||s(r-l)}this.min=r,this.max=o}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:t,stepSize:i}=e,r;return i?(r=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,r>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${r} ticks. Limiting to 1000.`),r=1e3)):(r=this.computeTickLimit(),t=t||11),t&&(r=Math.min(t,r)),r}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,t=e.ticks;let i=this.getTickLimit();i=Math.max(2,i);const r={maxTicks:i,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==!1},o=this._range||this,s=$7(r,o);return e.bounds==="ticks"&&Z4(s,this,"value"),e.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){const e=this.ticks;let t=this.min,i=this.max;if(super.configure(),this.options.offset&&e.length){const r=(i-t)/Math.max(e.length-1,1)/2;t-=r,i+=r}this._startValue=t,this._endValue=i,this._valueRange=i-t}getLabelForValue(e){return dN(e,this.chart.options.locale,this.options.ticks.format)}}class pM extends fM{determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=ft(e)?e:0,this.max=ft(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,i=Rr(this.options.ticks.minRotation),r=(e?Math.sin(i):Math.cos(i))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,o.lineHeight/r))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}ne(pM,"id","linear"),ne(pM,"defaults",{ticks:{callback:Hd.formatters.numeric}});const zl=n=>Math.floor(_r(n)),Zo=(n,e)=>Math.pow(10,zl(n)+e);function k2(n){return n/Math.pow(10,zl(n))===1}function C2(n,e,t){const i=Math.pow(10,t),r=Math.floor(n/i);return Math.ceil(e/i)-r}function J7(n,e){const t=e-n;let i=zl(t);for(;C2(n,e,i)>10;)i++;for(;C2(n,e,i)<10;)i--;return Math.min(i,zl(n))}function X7(n,{min:e,max:t}){e=On(n.min,e);const i=[],r=zl(e);let o=J7(e,t),s=o<0?Math.pow(10,Math.abs(o)):1;const a=Math.pow(10,o),l=r>o?Math.pow(10,r):0,u=Math.round((e-l)*s)/s,d=Math.floor((e-l)/a/10)*a*10;let M=Math.floor((u-d)/Math.pow(10,o)),h=On(n.min,Math.round((l+d+M*Math.pow(10,o))*s)/s);for(;h<t;)i.push({value:h,major:k2(h),significand:M}),M>=10?M=M<15?15:20:M++,M>=20&&(o++,M=2,s=o>=0?1:s),h=Math.round((l+d+M*Math.pow(10,o))*s)/s;const g=On(n.max,h);return i.push({value:g,major:k2(g),significand:M}),i}class w2 extends Bo{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,t){const i=fM.prototype.parse.apply(this,[e,t]);if(i===0){this._zero=!0;return}return ft(i)&&i>0?i:null}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=ft(e)?Math.max(0,e):null,this.max=ft(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!ft(this._userMin)&&(this.min=e===Zo(this.min,0)?Zo(this.min,-1):Zo(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let i=this.min,r=this.max;const o=a=>i=e?i:a,s=a=>r=t?r:a;i===r&&(i<=0?(o(1),s(10)):(o(Zo(i,-1)),s(Zo(r,1)))),i<=0&&o(Zo(r,-1)),r<=0&&s(Zo(i,1)),this.min=i,this.max=r}buildTicks(){const e=this.options,t={min:this._userMin,max:this._userMax},i=X7(t,this);return e.bounds==="ticks"&&Z4(i,this,"value"),e.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(e){return e===void 0?"0":dN(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=_r(e),this._valueRange=_r(this.max)-_r(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(_r(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const t=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+t*this._valueRange)}}ne(w2,"id","logarithmic"),ne(w2,"defaults",{ticks:{callback:Hd.formatters.logarithmic,major:{enabled:!0}}});function _N(n){const e=n.ticks;if(e.display&&n.display){const t=_n(e.backdropPadding);return Ye(e.font&&e.font.size,zt.font.size)+t.height}return 0}function K7(n,e,t){return t=Xe(t)?t:[t],{w:CV(n,e.string,t),h:t.length*e.lineHeight}}function E2(n,e,t,i,r){return n===i||n===r?{start:e-t/2,end:e+t/2}:n<i||n>r?{start:e-t,end:e}:{start:e,end:e+t}}function q7(n){const e={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},t=Object.assign({},e),i=[],r=[],o=n._pointLabels.length,s=n.options.pointLabels,a=s.centerPointLabels?Ct/o:0;for(let l=0;l<o;l++){const u=s.setContext(n.getPointLabelContext(l));r[l]=u.padding;const d=n.getPointPosition(l,n.drawingArea+r[l],a),M=dn(u.font),h=K7(n.ctx,M,n._pointLabels[l]);i[l]=h;const g=Qn(n.getIndexAngle(l)+a),f=Math.round(sN(g)),p=E2(f,d.x,h.w,0,180),N=E2(f,d.y,h.h,90,270);e8(t,e,g,p,N)}n.setCenterPoint(e.l-t.l,t.r-e.r,e.t-t.t,t.b-e.b),n._pointLabelItems=i8(n,i,r)}function e8(n,e,t,i,r){const o=Math.abs(Math.sin(t)),s=Math.abs(Math.cos(t));let a=0,l=0;i.start<e.l?(a=(e.l-i.start)/o,n.l=Math.min(n.l,e.l-a)):i.end>e.r&&(a=(i.end-e.r)/o,n.r=Math.max(n.r,e.r+a)),r.start<e.t?(l=(e.t-r.start)/s,n.t=Math.min(n.t,e.t-l)):r.end>e.b&&(l=(r.end-e.b)/s,n.b=Math.max(n.b,e.b+l))}function t8(n,e,t){const i=n.drawingArea,{extra:r,additionalAngle:o,padding:s,size:a}=t,l=n.getPointPosition(e,i+r+s,o),u=Math.round(sN(Qn(l.angle+Un))),d=s8(l.y,a.h,u),M=r8(u),h=o8(l.x,a.w,M);return{visible:!0,x:l.x,y:d,textAlign:M,left:h,top:d,right:h+a.w,bottom:d+a.h}}function n8(n,e){if(!e)return!0;const{left:t,top:i,right:r,bottom:o}=n;return!(or({x:t,y:i},e)||or({x:t,y:o},e)||or({x:r,y:i},e)||or({x:r,y:o},e))}function i8(n,e,t){const i=[],r=n._pointLabels.length,o=n.options,{centerPointLabels:s,display:a}=o.pointLabels,l={extra:_N(o)/2,additionalAngle:s?Ct/r:0};let u;for(let d=0;d<r;d++){l.padding=t[d],l.size=e[d];const M=t8(n,d,l);i.push(M),a==="auto"&&(M.visible=n8(M,u),M.visible&&(u=M))}return i}function r8(n){return n===0||n===180?"center":n<180?"left":"right"}function o8(n,e,t){return t==="right"?n-=e:t==="center"&&(n-=e/2),n}function s8(n,e,t){return t===90||t===270?n-=e/2:(t>270||t<90)&&(n-=e),n}function a8(n,e,t){const{left:i,top:r,right:o,bottom:s}=t,{backdropColor:a}=e;if(!Be(a)){const l=Rs(e.borderRadius),u=_n(e.backdropPadding);n.fillStyle=a;const d=i-u.left,M=r-u.top,h=o-i+u.width,g=s-r+u.height;Object.values(l).some(f=>f!==0)?(n.beginPath(),$d(n,{x:d,y:M,w:h,h:g,radius:l}),n.fill()):n.fillRect(d,M,h,g)}}function l8(n,e){const{ctx:t,options:{pointLabels:i}}=n;for(let r=e-1;r>=0;r--){const o=n._pointLabelItems[r];if(!o.visible)continue;const s=i.setContext(n.getPointLabelContext(r));a8(t,s,o);const a=dn(s.font),{x:l,y:u,textAlign:d}=o;gl(t,n._pointLabels[r],l,u+a.lineHeight/2,a,{color:s.color,textAlign:d,textBaseline:"middle"})}}function S2(n,e,t,i){const{ctx:r}=n;if(t)r.arc(n.xCenter,n.yCenter,e,0,vn);else{let o=n.getPointPosition(0,e);r.moveTo(o.x,o.y);for(let s=1;s<i;s++)o=n.getPointPosition(s,e),r.lineTo(o.x,o.y)}}function c8(n,e,t,i,r){const o=n.ctx,s=e.circular,{color:a,lineWidth:l}=e;!s&&!i||!a||!l||t<0||(o.save(),o.strokeStyle=a,o.lineWidth=l,o.setLineDash(r.dash),o.lineDashOffset=r.dashOffset,o.beginPath(),S2(n,t,s,i),o.closePath(),o.stroke(),o.restore())}function u8(n,e,t){return Vr(n,{label:t,index:e,type:"pointLabel"})}class NM extends fM{constructor(e){super(e),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const e=this._padding=_n(_N(this.options)/2),t=this.width=this.maxWidth-e.width,i=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+t/2+e.left),this.yCenter=Math.floor(this.top+i/2+e.top),this.drawingArea=Math.floor(Math.min(t,i)/2)}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!1);this.min=ft(e)&&!isNaN(e)?e:0,this.max=ft(t)&&!isNaN(t)?t:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/_N(this.options))}generateTickLabels(e){fM.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((t,i)=>{const r=pt(this.options.pointLabels.callback,[t,i],this);return r||r===0?r:""}).filter((t,i)=>this.chart.getDataVisibility(i))}fit(){const e=this.options;e.display&&e.pointLabels.display?q7(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,t,i,r){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((i-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,i,r))}getIndexAngle(e){const t=vn/(this._pointLabels.length||1),i=this.options.startAngle||0;return Qn(e*t+Rr(i))}getDistanceFromCenterForValue(e){if(Be(e))return NaN;const t=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*t:(e-this.min)*t}getValueForDistanceFromCenter(e){if(Be(e))return NaN;const t=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t}getPointLabelContext(e){const t=this._pointLabels||[];if(e>=0&&e<t.length){const i=t[e];return u8(this.getContext(),e,i)}}getPointPosition(e,t,i=0){const r=this.getIndexAngle(e)-Un+i;return{x:Math.cos(r)*t+this.xCenter,y:Math.sin(r)*t+this.yCenter,angle:r}}getPointPositionForValue(e,t){return this.getPointPosition(e,this.getDistanceFromCenterForValue(t))}getBasePosition(e){return this.getPointPositionForValue(e||0,this.getBaseValue())}getPointLabelPosition(e){const{left:t,top:i,right:r,bottom:o}=this._pointLabelItems[e];return{left:t,top:i,right:r,bottom:o}}drawBackground(){const{backgroundColor:e,grid:{circular:t}}=this.options;if(e){const i=this.ctx;i.save(),i.beginPath(),S2(this,this.getDistanceFromCenterForValue(this._endValue),t,this._pointLabels.length),i.closePath(),i.fillStyle=e,i.fill(),i.restore()}}drawGrid(){const e=this.ctx,t=this.options,{angleLines:i,grid:r,border:o}=t,s=this._pointLabels.length;let a,l,u;if(t.pointLabels.display&&l8(this,s),r.display&&this.ticks.forEach((d,M)=>{if(M!==0||M===0&&this.min<0){l=this.getDistanceFromCenterForValue(d.value);const h=this.getContext(M),g=r.setContext(h),f=o.setContext(h);c8(this,g,l,s,f)}}),i.display){for(e.save(),a=s-1;a>=0;a--){const d=i.setContext(this.getPointLabelContext(a)),{color:M,lineWidth:h}=d;!h||!M||(e.lineWidth=h,e.strokeStyle=M,e.setLineDash(d.borderDash),e.lineDashOffset=d.borderDashOffset,l=this.getDistanceFromCenterForValue(t.ticks.reverse?this.min:this.max),u=this.getPointPosition(a,l),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(u.x,u.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,t=this.options,i=t.ticks;if(!i.display)return;const r=this.getIndexAngle(0);let o,s;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(r),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!t.reverse)return;const u=i.setContext(this.getContext(l)),d=dn(u.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),u.showLabelBackdrop){e.font=d.string,s=e.measureText(a.label).width,e.fillStyle=u.backdropColor;const M=_n(u.backdropPadding);e.fillRect(-s/2-M.left,-o-d.size/2-M.top,s+M.width,d.size+M.height)}gl(e,a.label,0,-o,d,{color:u.color,strokeColor:u.textStrokeColor,strokeWidth:u.textStrokeWidth})}),e.restore()}drawTitle(){}}ne(NM,"id","radialLinear"),ne(NM,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Hd.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(e){return e},padding:5,centerPointLabels:!1}}),ne(NM,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),ne(NM,"descriptors",{angleLines:{_fallback:"grid"}});const yM={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}},Dn=Object.keys(yM);function O2(n,e){return n-e}function v2(n,e){if(Be(e))return null;const t=n._adapter,{parser:i,round:r,isoWeekday:o}=n._parseOpts;let s=e;return typeof i=="function"&&(s=i(s)),ft(s)||(s=typeof i=="string"?t.parse(s,i):t.parse(s)),s===null?null:(r&&(s=r==="week"&&(ul(o)||o===!0)?t.startOf(s,"isoWeek",o):t.startOf(s,r)),+s)}function U2(n,e,t,i){const r=Dn.length;for(let o=Dn.indexOf(n);o<r-1;++o){const s=yM[Dn[o]],a=s.steps?s.steps:Number.MAX_SAFE_INTEGER;if(s.common&&Math.ceil((t-e)/(a*s.size))<=i)return Dn[o]}return Dn[r-1]}function d8(n,e,t,i,r){for(let o=Dn.length-1;o>=Dn.indexOf(t);o--){const s=Dn[o];if(yM[s].common&&n._adapter.diff(r,i,s)>=e-1)return s}return Dn[t?Dn.indexOf(t):0]}function M8(n){for(let e=Dn.indexOf(n)+1,t=Dn.length;e<t;++e)if(yM[Dn[e]].common)return Dn[e]}function Q2(n,e,t){if(!t)n[e]=!0;else if(t.length){const{lo:i,hi:r}=lN(t,e),o=t[i]>=e?t[i]:t[r];n[o]=!0}}function h8(n,e,t,i){const r=n._adapter,o=+r.startOf(e[0].value,i),s=e[e.length-1].value;let a,l;for(a=o;a<=s;a=+r.add(a,1,i))l=t[a],l>=0&&(e[l].major=!0);return e}function Y2(n,e,t){const i=[],r={},o=e.length;let s,a;for(s=0;s<o;++s)a=e[s],r[a]=s,i.push({value:a,major:!1});return o===0||!t?i:h8(n,i,r,t)}class jM extends Bo{constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,t={}){const i=e.time||(e.time={}),r=this._adapter=new H6._date(e.adapters.date);r.init(t),al(i.displayFormats,r.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(e),this._normalized=t.normalized}parse(e,t){return e===void 0?null:v2(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,t=this._adapter,i=e.time.unit||"day";let{min:r,max:o,minDefined:s,maxDefined:a}=this.getUserBounds();function l(u){!s&&!isNaN(u.min)&&(r=Math.min(r,u.min)),!a&&!isNaN(u.max)&&(o=Math.max(o,u.max))}(!s||!a)&&(l(this._getLabelBounds()),(e.bounds!=="ticks"||e.ticks.source!=="labels")&&l(this.getMinMax(!1))),r=ft(r)&&!isNaN(r)?r:+t.startOf(Date.now(),i),o=ft(o)&&!isNaN(o)?o:+t.endOf(Date.now(),i)+1,this.min=Math.min(r,o-1),this.max=Math.max(r+1,o)}_getLabelBounds(){const e=this.getLabelTimestamps();let t=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return e.length&&(t=e[0],i=e[e.length-1]),{min:t,max:i}}buildTicks(){const e=this.options,t=e.time,i=e.ticks,r=i.source==="labels"?this.getLabelTimestamps():this._generate();e.bounds==="ticks"&&r.length&&(this.min=this._userMin||r[0],this.max=this._userMax||r[r.length-1]);const o=this.min,s=this.max,a=pV(r,o,s);return this._unit=t.unit||(i.autoSkip?U2(t.minUnit,this.min,this.max,this._getLabelCapacity(o)):d8(this,a.length,t.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:M8(this._unit),this.initOffsets(r),e.reverse&&a.reverse(),Y2(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let t=0,i=0,r,o;this.options.offset&&e.length&&(r=this.getDecimalForValue(e[0]),e.length===1?t=1-r:t=(this.getDecimalForValue(e[1])-r)/2,o=this.getDecimalForValue(e[e.length-1]),e.length===1?i=o:i=(o-this.getDecimalForValue(e[e.length-2]))/2);const s=e.length<3?.5:.25;t=Yn(t,0,s),i=Yn(i,0,s),this._offsets={start:t,end:i,factor:1/(t+1+i)}}_generate(){const e=this._adapter,t=this.min,i=this.max,r=this.options,o=r.time,s=o.unit||U2(o.minUnit,t,i,this._getLabelCapacity(t)),a=Ye(r.ticks.stepSize,1),l=s==="week"?o.isoWeekday:!1,u=ul(l)||l===!0,d={};let M=t,h,g;if(u&&(M=+e.startOf(M,"isoWeek",l)),M=+e.startOf(M,u?"day":s),e.diff(i,t,s)>1e5*a)throw new Error(t+" and "+i+" are too far apart with stepSize of "+a+" "+s);const f=r.ticks.source==="data"&&this.getDataTimestamps();for(h=M,g=0;h<i;h=+e.add(h,a,s),g++)Q2(d,h,f);return(h===i||r.bounds==="ticks"||g===1)&&Q2(d,h,f),Object.keys(d).sort(O2).map(p=>+p)}getLabelForValue(e){const t=this._adapter,i=this.options.time;return i.tooltipFormat?t.format(e,i.tooltipFormat):t.format(e,i.displayFormats.datetime)}format(e,t){const r=this.options.time.displayFormats,o=this._unit,s=t||r[o];return this._adapter.format(e,s)}_tickFormatFunction(e,t,i,r){const o=this.options,s=o.ticks.callback;if(s)return pt(s,[e,t,i],this);const a=o.time.displayFormats,l=this._unit,u=this._majorUnit,d=l&&a[l],M=u&&a[u],h=i[t],g=u&&M&&h&&h.major;return this._adapter.format(e,r||(g?M:d))}generateTickLabels(e){let t,i,r;for(t=0,i=e.length;t<i;++t)r=e[t],r.label=this._tickFormatFunction(r.value,t,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const t=this._offsets,i=this.getDecimalForValue(e);return this.getPixelForDecimal((t.start+i)*t.factor)}getValueForPixel(e){const t=this._offsets,i=this.getDecimalForPixel(e)/t.factor-t.end;return this.min+i*(this.max-this.min)}_getLabelSize(e){const t=this.options.ticks,i=this.ctx.measureText(e).width,r=Rr(this.isHorizontal()?t.maxRotation:t.minRotation),o=Math.cos(r),s=Math.sin(r),a=this._resolveTickFontOptions(0).size;return{w:i*o+a*s,h:i*s+a*o}}_getLabelCapacity(e){const t=this.options.time,i=t.displayFormats,r=i[t.unit]||i.millisecond,o=this._tickFormatFunction(e,0,Y2(this,[e],this._majorUnit),r),s=this._getLabelSize(o),a=Math.floor(this.isHorizontal()?this.width/s.w:this.height/s.h)-1;return a>0?a:1}getDataTimestamps(){let e=this._cache.data||[],t,i;if(e.length)return e;const r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(t=0,i=r.length;t<i;++t)e=e.concat(r[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){const e=this._cache.labels||[];let t,i;if(e.length)return e;const r=this.getLabels();for(t=0,i=r.length;t<i;++t)e.push(v2(this,r[t]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return G4(e.sort(O2))}}ne(jM,"id","time"),ne(jM,"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 mM(n,e,t){let i=0,r=n.length-1,o,s,a,l;t?(e>=n[i].pos&&e<=n[r].pos&&({lo:i,hi:r}=Oo(n,"pos",e)),{pos:o,time:a}=n[i],{pos:s,time:l}=n[r]):(e>=n[i].time&&e<=n[r].time&&({lo:i,hi:r}=Oo(n,"time",e)),{time:o,pos:a}=n[i],{time:s,pos:l}=n[r]);const u=s-o;return u?a+(l-a)*(e-o)/u:a}class _2 extends jM{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=mM(t,this.min),this._tableRange=mM(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:t,max:i}=this,r=[],o=[];let s,a,l,u,d;for(s=0,a=e.length;s<a;++s)u=e[s],u>=t&&u<=i&&r.push(u);if(r.length<2)return[{time:t,pos:0},{time:i,pos:1}];for(s=0,a=r.length;s<a;++s)d=r[s+1],l=r[s-1],u=r[s],Math.round((d+l)/2)!==u&&o.push({time:u,pos:s/(a-1)});return o}_generate(){const e=this.min,t=this.max;let i=super.getDataTimestamps();return(!i.includes(e)||!i.length)&&i.splice(0,0,e),(!i.includes(t)||i.length===1)&&i.push(t),i.sort((r,o)=>r-o)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const t=this.getDataTimestamps(),i=this.getLabelTimestamps();return t.length&&i.length?e=this.normalize(t.concat(i)):e=t.length?t:i,e=this._cache.all=e,e}getDecimalForValue(e){return(mM(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const t=this._offsets,i=this.getDecimalForPixel(e)/t.factor-t.end;return mM(this._table,i*this._tableRange+this._minPos,!0)}}ne(_2,"id","timeseries"),ne(_2,"defaults",jM.defaults);const R2={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},g8={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...R2,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},f8=c.version[0]==="2"?(n,e)=>Object.assign(n,{attrs:e}):(n,e)=>Object.assign(n,e);function Ps(n){return c.isProxy(n)?c.toRaw(n):n}function p8(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n;return c.isProxy(e)?new Proxy(n,{}):n}function N8(n,e){const t=n.options;t&&e&&Object.assign(t,e)}function V2(n,e){n.labels=e}function B2(n,e,t){const i=[];n.datasets=e.map(r=>{const o=n.datasets.find(s=>s[t]===r[t]);return!o||!r.data||i.includes(o)?{...r}:(i.push(o),Object.assign(o,r),o)})}function y8(n,e){const t={labels:[],datasets:[]};return V2(t,n.labels),B2(t,n.datasets,e),t}const j8=c.defineComponent({props:g8,setup(n,e){let{expose:t,slots:i}=e;const r=c.ref(null),o=c.shallowRef(null);t({chart:o});const s=()=>{if(!r.value)return;const{type:u,data:d,options:M,plugins:h,datasetIdKey:g}=n,f=y8(d,g),p=p8(f,d);o.value=new Tl(r.value,{type:u,data:p,options:{...M},plugins:h})},a=()=>{const u=c.toRaw(o.value);u&&(n.destroyDelay>0?setTimeout(()=>{u.destroy(),o.value=null},n.destroyDelay):(u.destroy(),o.value=null))},l=u=>{u.update(n.updateMode)};return c.onMounted(s),c.onUnmounted(a),c.watch([()=>n.options,()=>n.data],(u,d)=>{let[M,h]=u,[g,f]=d;const p=c.toRaw(o.value);if(!p)return;let N=!1;if(M){const y=Ps(M),j=Ps(g);y&&y!==j&&(N8(p,y),N=!0)}if(h){const y=Ps(h.labels),j=Ps(f.labels),A=Ps(h.datasets),w=Ps(f.datasets);y!==j&&(V2(p.config.data,y),N=!0),A&&A!==w&&(B2(p.config.data,A,n.datasetIdKey),N=!0)}N&&c.nextTick(()=>{l(p)})},{deep:!0}),()=>c.h("canvas",{role:"img",ariaLabel:n.ariaLabel,ariaDescribedby:n.ariaDescribedby,ref:r},[c.h("p",{},[i.default?i.default():""])])}});function Z2(n,e){return Tl.register(e),c.defineComponent({props:R2,setup(t,i){let{expose:r}=i;const o=c.shallowRef(null),s=a=>{o.value=a==null?void 0:a.chart};return r({chart:o}),()=>c.h(j8,f8({ref:s},{type:n,...t}))}})}const m8=Z2("bar",tM),I8=Z2("line",nM),Fpe="",D8={name:"MultiRangeSlider",props:{baseClassName:{type:String,default:"multi-range-slider"},min:{type:Number},max:{type:Number},minValue:{type:Number},maxValue:{type:Number},step:{type:Number,default:1},preventWheel:{type:Boolean,default:!1},ruler:{type:Boolean,default:!0},label:{type:Boolean,default:!0},labels:{type:Array},minCaption:{type:String},maxCaption:{type:String},rangeMargin:{type:Number}},data(){let n=this.labels||[],e=this.min===void 0?0:this.min,t=n.length?n.length-1:100,i=this.max===void 0?t:this.max,r=this.minValue===void 0?25:this.minValue;n.length&&this.minValue===void 0&&(r=1);let o=this.maxValue||75;if(n.length&&this.maxValue===void 0&&(o=n.length-2),i<=e)throw new Error("Invalid props min or max");if(r>o)throw new Error("Invalid props minValue or maxValue");let s=this.rangeMargin===void 0?this.step:this.rangeMargin,a=s%this.step;return a&&(s=s+this.step-a),{valueMin:r<e?e:r,valueMax:o>i?i:o,interVal:null,startX:null,mouseMoveCounter:null,barBox:null,barValue:0,rangeMarginValue:s}},methods:{onBarLeftClick(){this.valueMin-this.step>=this.minimum?this.valueMin-=this.step:this.valueMin=this.minimum},onInnerBarLeftClick(){this.valueMin+this.rangeMarginValue<this.valueMax&&(this.valueMin+=this.step)},onBarRightClick(){this.valueMax+this.step<=this.maximum?this.valueMax+=this.step:this.valueMax=this.maximum},onInnerBarRightClick(){this.valueMax-this.rangeMarginValue>this.valueMin&&(this.valueMax-=this.step)},onInputMinChange(n){let e=parseFloat(n.target.value);e<=this.valueMax-this.rangeMarginValue&&e>=this.minimum?this.valueMin=e:n.target.value=this.valueMin},onInputMaxChange(n){let e=parseFloat(n.target.value);e>=this.valueMin+this.rangeMarginValue&&e<=this.maximum?this.valueMax=e:n.target.value=this.valueMax},onLeftThumbMousedown(n){if(n.preventDefault(),this.startX=n.clientX,n.type==="touchstart")if(n.touches.length===1)this.startX=n.touches[0].clientX;else return;this.mouseMoveCounter=0,this.barValue=this.valueMin,this.barBox=n.target.parentNode.getBoundingClientRect(),document.addEventListener("mousemove",this.onLeftThumbMousemove),document.addEventListener("mouseup",this.onLeftThumbMouseup),document.addEventListener("touchmove",this.onLeftThumbMousemove),document.addEventListener("touchend",this.onLeftThumbMouseup)},onLeftThumbMousemove(n){this.mouseMoveCounter++;let e=n.clientX;n.type==="touchmove"&&(e=n.touches[0].clientX);let i=(e-this.startX)/this.barBox.width,r=this.barValue+(this.maximum-this.minimum)*i,o=r%this.step;r-=o,r<this.minimum?r=this.minimum:r>this.valueMax-this.rangeMarginValue&&(r=this.valueMax-this.rangeMarginValue),this.valueMin=r},onLeftThumbMouseup(){document.removeEventListener("mousemove",this.onLeftThumbMousemove),document.removeEventListener("mouseup",this.onLeftThumbMouseup),document.removeEventListener("touchmove",this.onLeftThumbMousemove),document.removeEventListener("touchend",this.onLeftThumbMouseup)},onRightThumbMousedown(n){if(n.preventDefault(),this.startX=n.clientX,n.type==="touchstart")if(n.touches.length===1)this.startX=n.touches[0].clientX;else return;this.mouseMoveCounter=0,this.barValue=this.valueMax,this.barBox=n.target.parentNode.getBoundingClientRect(),document.addEventListener("mousemove",this.onRightThumbMousemove),document.addEventListener("mouseup",this.onRightThumbMouseup),document.addEventListener("touchmove",this.onRightThumbMousemove),document.addEventListener("touchend",this.onRightThumbMouseup)},onRightThumbMousemove(n){this.mouseMoveCounter++;let e=n.clientX;n.type==="touchmove"&&(e=n.touches[0].clientX);let i=(e-this.startX)/this.barBox.width,r=this.barValue+(this.maximum-this.minimum)*i,o=r%this.step;r-=o,r<this.valueMin+this.rangeMarginValue?r=this.valueMin+this.rangeMarginValue:r>this.maximum&&(r=this.maximum),this.valueMax=r},onRightThumbMouseup(){document.removeEventListener("mousemove",this.onRightThumbMousemove),document.removeEventListener("mouseup",this.onRightThumbMouseup),document.removeEventListener("touchmove",this.onRightThumbMousemove),document.removeEventListener("touchend",this.onRightThumbMouseup)},onMouseWheel(n){if(this.preventWheel===!0||!n.shiftKey&&!n.ctrlKey)return;let e=this.step;n.deltaY<0&&(e=-e),n.shiftKey&&n.ctrlKey?this.valueMin+e>=this.minimum&&this.valueMax+e<=this.maximum&&(this.valueMin=this.valueMin+e,this.valueMax=this.valueMax+e):n.ctrlKey?(e=this.valueMax+e,e<this.valueMin+this.rangeMarginValue?e=this.valueMin+this.rangeMarginValue:e>this.maximum&&(e=this.maximum),this.valueMax=e):n.shiftKey&&(e=this.valueMin+e,e<this.minimum?e=this.minimum:e>this.valueMax-this.rangeMarginValue&&(e=this.valueMax-this.rangeMarginValue),this.valueMin=e)},triggerInput(){let n=0;this.step.toString().includes(".")&&(n=2);let e={min:this.minimum,max:this.maximum,minValue:parseFloat(this.valueMin.toFixed(n)),maxValue:parseFloat(this.valueMax.toFixed(n))};this.$emit("input",e)}},computed:{minimum(){return this.min===void 0?0:this.min},maximum(){let n=this.labels||[],e=n.length?n.length-1:100;return this.max===void 0?e:this.max},stepCount(){let n=this.labels||[];return n.length?n.length-1:Math.floor((this.maximum-this.minimum)/this.step)},subStepCount(){return(this.labels||[]).length&&this.step>1?(this.maximum-this.minimum)/this.step:0},barMin(){return(this.valueMin-this.minimum)/(this.maximum-this.minimum)*100},barMax(){return 100-(this.valueMax-this.minimum)/(this.maximum-this.minimum)*100},barMinVal(){let n=0;return this.step.toString().includes(".")&&(n=2),(this.valueMin||0).toFixed(n)},barMaxVal(){let n=0;return this.step.toString().includes(".")&&(n=2),(this.valueMax||100).toFixed(n)},scaleLabels(){let n=this.labels||[];return n.length===0&&(n=[],n.push(this.minimum),n.push(this.maximum)),n}},watch:{valueMin(){this.triggerInput()},valueMax(){this.triggerInput()},minValue(n){this.valueMin=n<this.minimum?this.minimum:n},maxValue(n){this.valueMax=n>this.maximum?this.maximum:n}},mounted(){}},T8={class:"bar"},x8=["min","max","step","value"],z8={class:"caption"},A8={class:"min-caption"},b8={class:"bar-inner"},L8=["min","max","step","value"],k8={class:"caption"},C8={class:"max-caption"},w8={key:0,class:"ruler"},E8={key:1,class:"sub-ruler"},S8={key:2,class:"labels"};function O8(n,e,t,i,r,o){return c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass([t.baseClassName,r.rangeMarginValue===0?"zero-ranage-margin":""]),onMousewheel:e[10]||(e[10]=c.withModifiers((...s)=>o.onMouseWheel&&o.onMouseWheel(...s),["prevent","stop"]))},[c.createElementVNode("div",T8,[c.createElementVNode("div",{class:"bar-left",style:c.normalizeStyle({width:o.barMin+"%"}),onClick:e[0]||(e[0]=(...s)=>o.onBarLeftClick&&o.onBarLeftClick(...s))},null,4),c.createElementVNode("input",{class:"input-type-range input-type-range-min",type:"range",min:o.minimum,max:o.maximum,step:t.step,value:r.valueMin,onInput:e[1]||(e[1]=c.withModifiers((...s)=>o.onInputMinChange&&o.onInputMinChange(...s),["stop","prevent"]))},null,40,x8),c.createElementVNode("div",{class:"thumb thumb-left",onMousedown:e[2]||(e[2]=(...s)=>o.onLeftThumbMousedown&&o.onLeftThumbMousedown(...s)),onTouchstart:e[3]||(e[3]=(...s)=>o.onLeftThumbMousedown&&o.onLeftThumbMousedown(...s))},[c.createElementVNode("div",z8,[c.createElementVNode("span",A8,c.toDisplayString(t.minCaption||o.barMinVal),1)])],32),c.createElementVNode("div",b8,[c.createElementVNode("div",{class:"bar-inner-left",onClick:e[4]||(e[4]=(...s)=>o.onInnerBarLeftClick&&o.onInnerBarLeftClick(...s))}),c.createElementVNode("div",{class:"bar-inner-right",onClick:e[5]||(e[5]=(...s)=>o.onInnerBarRightClick&&o.onInnerBarRightClick(...s))})]),c.createElementVNode("input",{class:"input-type-range input-type-range-max",type:"range",min:o.minimum,max:o.maximum,step:t.step,value:r.valueMax,onInput:e[6]||(e[6]=c.withModifiers((...s)=>o.onInputMaxChange&&o.onInputMaxChange(...s),["stop","prevent"]))},null,40,L8),c.createElementVNode("div",{class:"thumb thumb-right",onMousedown:e[7]||(e[7]=(...s)=>o.onRightThumbMousedown&&o.onRightThumbMousedown(...s)),onTouchstart:e[8]||(e[8]=(...s)=>o.onRightThumbMousedown&&o.onRightThumbMousedown(...s))},[c.createElementVNode("div",k8,[c.createElementVNode("span",C8,c.toDisplayString(t.maxCaption||o.barMaxVal),1)])],32),c.createElementVNode("div",{class:"bar-right",style:c.normalizeStyle({width:o.barMax+"%"}),onClick:e[9]||(e[9]=(...s)=>o.onBarRightClick&&o.onBarRightClick(...s))},null,4)]),t.ruler?(c.openBlock(),c.createElementBlock("div",w8,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(o.stepCount,s=>(c.openBlock(),c.createElementBlock("div",{key:s,class:"ruler-rule"}))),128))])):c.createCommentVNode("",!0),o.subStepCount?(c.openBlock(),c.createElementBlock("div",E8,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(o.subStepCount,s=>(c.openBlock(),c.createElementBlock("div",{key:s,class:"ruler-sub-rule"}))),128))])):c.createCommentVNode("",!0),t.label?(c.openBlock(),c.createElementBlock("div",S8,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(o.scaleLabels,s=>(c.openBlock(),c.createElementBlock("div",{class:"label",key:s},c.toDisplayString(s),1))),128))])):c.createCommentVNode("",!0)],34)}const v8=ce(D8,[["render",O8]]),Hpe="";Tl.register(A2,MM,gM,pM);const U8=c.defineComponent({components:{Bar:m8,MultiRangeSlider:v8},emits:["update","update:model-value"],props:{numberRange:{type:Array,default:()=>[{key:0,count:10}]},width:{type:Number,default:200},height:{type:Number,default:50},chartId:{type:String,default:"bar-chart"},datasetIdKey:{type:String,default:"label"},includeForm:{type:Boolean,default:!1},isMatch:{type:Boolean,default:!0},isExclude:{type:Boolean,default:!1},isDisable:{type:Boolean,default:!1},modelValue:{type:Object,required:!1,default:null}},data(){var n,e,t,i;return{chartData:{labels:[],datasets:[{labels:"",data:[],backgroundColor:[((n=getComputedStyle(document.documentElement).getPropertyValue("--dh-number-range-active"))==null?void 0:n.trim())||"#5ea9e5"],borderRadius:1,hoverBackgroundColor:((e=getComputedStyle(document.documentElement).getPropertyValue("--dh-number-range-inactive"))==null?void 0:e.trim())||"#e0e0e0"}]},chartOptions:{responsive:!0,plugins:{legend:{display:!1}},scales:{x:{display:!1,grid:{display:!1},ticks:{display:!0}},y:{display:!1,grid:{display:!1},ticks:{display:!1}}}},min:0,max:this.numberRange.length-1,validated:!1,activeColor:((t=getComputedStyle(document.documentElement).getPropertyValue("--dh-number-range-active"))==null?void 0:t.trim())||"#5ea9e5",inactiveColor:((i=getComputedStyle(document.documentElement).getPropertyValue("--dh-number-range-inactive"))==null?void 0:i.trim())||"#e0e0e0"}},computed:{getRangeLength(){return this.numberRange.length},getFirstKey(){return this.numberRange[0].key},getLastKey(){return this.numberRange[this.getRangeLength-1].key},getMinKey(){return this.numberRange[this.min].key},getMinCaption(){return`${this.getMinKey}`},getMaxCaption(){return`${this.getMaxKey}`},getMaxKey(){return this.numberRange[this.max].key},getLastIndex(){return this.numberRange.length-1}},watch:{modelValue(n){this.max=this.numberRange.findIndex(e=>e.key==n.maxKey),this.min=this.numberRange.findIndex(e=>e.key==n.minKey)}},mounted(){var i,r;const n=document.documentElement,e=(i=getComputedStyle(n).getPropertyValue("--dh-number-range-active"))==null?void 0:i.trim(),t=(r=getComputedStyle(n).getPropertyValue("--dh-number-range-inactive"))==null?void 0:r.trim();e&&(this.activeColor=e),t&&(this.inactiveColor=t),this.setChartData(this.numberRange),this.isDisable&&this.missingFilter(),this.$props.modelValue&&(this.max=this.numberRange.findIndex(o=>o.key===this.$props.modelValue.maxKey),this.min=this.numberRange.findIndex(o=>o.key===this.$props.modelValue.minKey)),this.triggerChartDataUpdate()},methods:{updateRange(){const n=this.getMinKey,e=this.getMaxKey;this.$props.modelValue&&this.$emit("update:model-value",{minKey:n,maxKey:e}),this.$emit("update",{minKey:n,maxKey:e})},updateBarChart(n){const{minValue:e,maxValue:t}=n;this.min=e,this.max=t,this.isDisable||(this.isExclude?this.excludeFilter():this.matchFilter())},matchFilter(){if(!this.isDisable){var n=this.chartData.datasets[0].data;this.chartData.datasets[0].backgroundColor=[];for(let e=0;e<=n.length;e++)e>=this.min&&e<=this.max?this.chartData.datasets[0].backgroundColor.push(this.activeColor):this.chartData.datasets[0].backgroundColor.push(this.inactiveColor);this.triggerChartDataUpdate()}},excludeFilter(){if(!this.isDisable){var n=this.chartData.datasets[0].data;this.chartData.datasets[0].backgroundColor=[];for(let e=0;e<n.length;e++)e>=this.min&&e<=this.max?this.chartData.datasets[0].backgroundColor.push(this.inactiveColor):this.chartData.datasets[0].backgroundColor.push(this.activeColor);this.triggerChartDataUpdate()}},missingFilter(){this.validated=!this.validated;var n=this.chartData.datasets[0].data;if(this.chartData.datasets[0].backgroundColor=[],this.validated)for(let e=1;e<=n.length;e++)this.chartData.datasets[0].backgroundColor.push(this.inactiveColor);else this.isMatch&&this.matchFilter(),this.isExclude&&this.excludeFilter()},changeMin(n){let e=parseInt(n.target.value);this.min=e||0,this.isMatch&&!this.isDisable&&this.matchFilter(),this.isExclude&&!this.isDisable&&this.excludeFilter()},changeMax(n){let e=parseInt(n.target.value);this.max=e,this.isMatch&&!this.isDisable&&this.matchFilter(),this.isExclude&&!this.isDisable&&this.excludeFilter()},setChartData(n){let e=this.chartData.labels,t=[];for(let i=0;i<n.length;i++)e.push(n[i].key),t.push(n[i].count);this.chartData.datasets[0].data=t},triggerChartDataUpdate(){this.$nextTick(()=>{this.chartData={...this.chartData,datasets:[...this.chartData.datasets]}})}}}),Gpe="",Q8={class:"dh-range-container"},Y8={class:"bar-chart"},_8={key:0,class:"input-group-section"},R8={class:"input-group sb-input"},V8=["disabled","max","value"],B8={class:"input-group sb-input"},Z8=["disabled","max","min","value"];function P8(n,e,t,i,r,o){const s=c.resolveComponent("Bar"),a=c.resolveComponent("MultiRangeSlider");return c.openBlock(),c.createElementBlock("div",Q8,[c.createElementVNode("div",Y8,[c.createElementVNode("div",null,[c.createVNode(s,{"chart-id":n.chartId,data:n.chartData,"dataset-id-key":n.datasetIdKey,height:n.height,options:n.chartOptions,width:n.width},null,8,["chart-id","data","dataset-id-key","height","options","width"])]),c.createVNode(a,{"base-class-name":`multi-range-slider range-slider ${n.isDisable}`,label:!1,max:n.getLastIndex,"max-caption":n.getMaxCaption,"max-value":n.max,min:0,"min-caption":n.getMinCaption,"min-value":n.min,"range-margin":0,ruler:!1,step:1,onInput:n.updateBarChart},null,8,["base-class-name","max","max-caption","max-value","min-caption","min-value","onInput"])]),n.includeForm?(c.openBlock(),c.createElementBlock("div",_8,[c.createElementVNode("div",R8,[c.createElementVNode("label",{class:c.normalizeClass(`dh-body-2 input-to ${n.validated?"disable":""}`)}," From ",2),c.createElementVNode("input",{class:"form-input text",disabled:n.validated,max:n.max,min:"1",placeholder:"From",type:"number",value:n.getMinKey,onInput:e[0]||(e[0]=l=>n.changeMin(l))},null,40,V8)]),c.createElementVNode("div",B8,[c.createElementVNode("label",{class:c.normalizeClass(`dh-body-2 input-to ${n.validated?"disable":""}`)}," To ",2),c.createElementVNode("input",{class:"form-input text",disabled:n.validated,max:n.max,min:n.min,placeholder:"To",type:"number",value:n.getMaxKey,onInput:e[1]||(e[1]=l=>n.changeMax(l))},null,40,Z8)])])):c.createCommentVNode("",!0),c.renderSlot(n.$slots,"input",{},void 0,!0),c.createElementVNode("button",{class:"btn",onClick:e[2]||(e[2]=l=>n.updateRange())},"Apply")])}const P2=ce(U8,[["render",P8],["__scopeId","data-v-e2a7124c"]]),$pe="",Jpe="",W2=n=>(c.pushScopeId("data-v-fea4582b"),n=n(),c.popScopeId(),n),W8={id:"dp-container"},F8=W2(()=>c.createElementVNode("div",{class:"dp__calendar_range"},[c.createElementVNode("p",null,"From"),c.createElementVNode("p",null,"To")],-1)),H8={class:"dp__multi"},G8=["value"],$8=["value"],J8=["onClick"],X8=["onClick"],K8=["onClick"],q8=["onClick"],eZ=["onClick"],tZ=["onClick"],nZ=["onClick"],iZ=["onClick"],rZ=W2(()=>c.createElementVNode("div",{id:"tags",class:"dp__calendar_tags"},null,-1)),oZ=ce({__name:"AdvancedDatePicker",props:{numberRange:{type:Array,required:!0}},emits:["update"],setup(n,{emit:e}){const t=c.ref(["",""]),i=c.ref(null),r=c.ref(null),o=c.ref(null),s=c.ref(!1),a=c.ref([{label:"Today",range:[new Date,new Date],slot:"today"},{label:"Previous week",range:[$I(GI(new Date)),GI(new Date)],slot:"previousWeek"},{label:"This week",range:[$I(new Date),jU(new Date)],slot:"week"},{label:"Next week",range:[IU(new Date),mU(new Date().setDate(new Date().getDate()+7))],slot:"nextWeek"},{label:"This month",range:[cu(new Date),lu(new Date)],slot:"currentMonth"},{label:"Previous month",range:[cu(Jn(new Date,1)),lu(Jn(new Date,1))],slot:"previousMonth"},{label:"Last 3 months",range:[cu(Jn(new Date,3)),lu(Jn(new Date,1))],slot:"threeMonths"},{label:"Last 6 months",range:[cu(Jn(new Date,6)),lu(Jn(new Date,1))],slot:"sixMonths"},{label:"Last year",range:[ZE(new Date),BE(new Date)],slot:"yearly"}]),l=h=>{t.value=h,e("update",t.value)};function u(h){r.value=h.target.value,t.value=[h.target.value,i.value]}function d(h){i.value=h.target.value,t.value=[r.value,h.target.value]}c.onMounted(()=>{o.value.openMenu()});function M(){o.value.openMenu()}return(h,g)=>(c.openBlock(),c.createElementBlock("div",W8,[F8,c.createVNode(c.unref(Yd),{ref_key:"datePicker",ref:o,modelValue:t.value,"onUpdate:modelValue":[g[2]||(g[2]=f=>t.value=f),l],"auto-apply":"","day-names":["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],"enable-time-picker":!1,"model-type":"dd/MM/yyyy","multi-calendars":"","multi-calendars-solo":"","multi-static":!1,offset:12,position:"left","preset-ranges":a.value,range:"","select-text":"Apply","text-input":"",uid:"advanced",onClosed:M},{"dp-input":c.withCtx(()=>[c.createElementVNode("div",H8,[c.createElementVNode("input",{class:"dp__input dp__multi_input",placeholder:"MM/DD/YYYY",type:"text",value:r.value?r.value:t.value[0],onInput:g[0]||(g[0]=f=>u(f))},null,40,G8),c.createElementVNode("input",{class:"dp__input dp__multi_input",placeholder:"MM/DD/YYYY",type:"text",value:i.value?i.value:t.value[1],onInput:g[1]||(g[1]=f=>d(f))},null,40,$8)])]),"arrow-left":c.withCtx(()=>[c.createVNode(Ae,{"icon-name":"previous",size:20})]),"arrow-right":c.withCtx(()=>[c.createVNode(Ae,{"icon-name":"next",size:20})]),"calendar-icon":c.withCtx(()=>[c.createTextVNode(" Back ")]),"clear-icon":c.withCtx(()=>[]),"action-preview":c.withCtx(()=>[]),"action-select":c.withCtx(()=>[]),previousWeek:c.withCtx(({label:f,range:p,presetDateRange:N})=>[(c.openBlock(),c.createBlock(c.Teleport,{to:"#tags"},[c.createElementVNode("span",{onClick:y=>N(p)},c.toDisplayString(f),9,J8)]))]),week:c.withCtx(({label:f,range:p,presetDateRange:N})=>[(c.openBlock(),c.createBlock(c.Teleport,{to:"#tags"},[c.createElementVNode("span",{onClick:y=>N(p)},c.toDisplayString(f),9,X8)]))]),nextWeek:c.withCtx(({label:f,range:p,presetDateRange:N})=>[(c.openBlock(),c.createBlock(c.Teleport,{to:"#tags"},[c.createElementVNode("span",{onClick:y=>N(p)},c.toDisplayString(f),9,K8)]))]),currentMonth:c.withCtx(({label:f,range:p,presetDateRange:N})=>[(c.openBlock(),c.createBlock(c.Teleport,{to:"#tags"},[c.createElementVNode("span",{onClick:y=>N(p)},c.toDisplayString(f),9,q8)]))]),previousMonth:c.withCtx(({label:f,range:p,presetDateRange:N})=>[(c.openBlock(),c.createBlock(c.Teleport,{to:"#tags"},[c.createElementVNode("span",{onClick:y=>N(p)},c.toDisplayString(f),9,eZ)]))]),threeMonths:c.withCtx(({label:f,range:p,presetDateRange:N})=>[(c.openBlock(),c.createBlock(c.Teleport,{to:"#tags"},[c.createElementVNode("span",{onClick:y=>N(p)},c.toDisplayString(f),9,tZ)]))]),sixMonths:c.withCtx(({label:f,range:p,presetDateRange:N})=>[(c.openBlock(),c.createBlock(c.Teleport,{to:"#tags"},[c.createElementVNode("span",{onClick:y=>N(p)},c.toDisplayString(f),9,nZ)]))]),yearly:c.withCtx(({label:f,range:p,presetDateRange:N})=>[(c.openBlock(),c.createBlock(c.Teleport,{to:"#tags"},[c.createElementVNode("span",{onClick:y=>N(p)},c.toDisplayString(f),9,iZ)]))]),_:1},8,["modelValue","preset-ranges"]),c.createVNode(P2,{class:"dp__calendar_range_number","number-range":n.numberRange,steps:1},{input:c.withCtx(()=>[rZ]),filter:c.withCtx(()=>[c.createVNode(C4,{data:s.value,label:"Include time",onChange:g[3]||(g[3]=f=>s.value=f)},null,8,["data"])]),_:1},8,["number-range"])]))}},[["__scopeId","data-v-fea4582b"]]),sZ=c.defineComponent({components:{DhIcon:Ae},props:{mainText:{type:String,default:"Advanced"},filterMissingText:{type:String,default:"Filter Missing"},matchText:{type:String,default:"Match"},excludeText:{type:String,default:"Exclude"}},data(){return{activeFilter:!1,isFilterMissing:!1,isMatch:!1,isExclude:!1}},emits:["match","exclude","filter_missing"],mounted(){this.isMatch=!0},methods:{toggleFilter(){this.activeFilter=!this.activeFilter},matchFilter(){this.isMatch=!0,this.isExclude=!1,this.$emit("match",this.isMatch)},excludeFilter(){this.isMatch=!1,this.isExclude=!0,this.$emit("exclude",this.isExclude)},missingFilter(){this.isFilterMissing=!this.isFilterMissing,this.$emit("filter_missing",this.isFilterMissing),this.isFilterMissing&&this.isMatch?this.matchFilter():this.isFilterMissing&&this.isExclude&&this.excludeFilter()}}}),aZ={class:"dh-advanced-filter-container"},lZ={class:"advance_section"},cZ={key:0},uZ={class:"list-none"},dZ=["checked"],MZ=["checked"],hZ=["checked"];function gZ(n,e,t,i,r,o){const s=c.resolveComponent("dh-icon");return c.openBlock(),c.createElementBlock("div",aZ,[c.createElementVNode("div",lZ,[c.createElementVNode("span",{class:"toggle-icon",onClick:e[0]||(e[0]=a=>n.toggleFilter())},[c.createTextVNode(c.toDisplayString(n.mainText)+" ",1),c.createVNode(s,{"icon-name":n.activeFilter?"arrow-up":"arrow-down",size:20},null,8,["icon-name"])]),n.activeFilter?(c.openBlock(),c.createElementBlock("div",cZ,[c.renderSlot(n.$slots,"default"),c.createElementVNode("ul",uZ,[c.createElementVNode("li",null,[c.createElementVNode("label",null,[c.createElementVNode("input",{checked:n.isFilterMissing,name:"number_filter",type:"checkbox",onChange:e[1]||(e[1]=a=>n.missingFilter())},null,40,dZ),c.createTextVNode(" "+c.toDisplayString(n.filterMissingText),1)])]),c.createElementVNode("li",null,[c.createElementVNode("label",null,[c.createElementVNode("input",{checked:n.isMatch,name:"number_filter",type:"radio",onChange:e[2]||(e[2]=a=>n.matchFilter())},null,40,MZ),c.createTextVNode(" "+c.toDisplayString(n.matchText),1)]),c.createElementVNode("label",null,[c.createElementVNode("input",{checked:n.isExclude,name:"number_filter",type:"radio",onChange:e[3]||(e[3]=a=>n.excludeFilter())},null,40,hZ),c.createTextVNode(" "+c.toDisplayString(n.excludeText),1)])])])])):c.createCommentVNode("",!0)])])}const fZ=ce(sZ,[["render",gZ]]),F2=n=>{const e=parseInt(n.replace("#",""),16),t=e>>16&255,i=e>>8&255,r=e&255;return`${t}, ${i}, ${r}`},H2=n=>({"--custom-color":`rgb(${n})`,"--custom-color-light":`rgb(${n}, 0.3)`,"--custom-color-lighter":`rgba(${n}, 0.06)`}),pZ=n=>{const e=`
|
|
20
20
|
<svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg">
|
|
21
21
|
<rect
|
|
22
22
|
width="100%"
|