scope360-core 0.0.135 → 0.0.137
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.
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
* Released under the MIT License
|
|
32
32
|
*/class tC{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,n,r,s){const i=n.listeners[s],a=n.duration;i.forEach(l=>l({chart:e,initial:n.initial,numSteps:a,currentStep:Math.min(r-n.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=e2.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let n=0;this._charts.forEach((r,s)=>{if(!r.running||!r.items.length)return;const i=r.items;let a=i.length-1,l=!1,c;for(;a>=0;--a)c=i[a],c._active?(c._total>r.duration&&(r.duration=c._total),c.tick(e),l=!0):(i[a]=i[i.length-1],i.pop());l&&(s.draw(),this._notify(s,r,e,"progress")),i.length||(r.running=!1,this._notify(s,r,e,"complete"),r.initial=!1),n+=i.length}),this._lastDate=e,n===0&&(this._running=!1)}_getAnims(e){const n=this._charts;let r=n.get(e);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(e,r)),r}listen(e,n,r){this._getAnims(e).listeners[n].push(r)}add(e,n){!n||!n.length||this._getAnims(e).items.push(...n)}has(e){return this._getAnims(e).items.length>0}start(e){const n=this._charts.get(e);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((r,s)=>Math.max(r,s._duration),0),this._refresh())}running(e){if(!this._running)return!1;const n=this._charts.get(e);return!(!n||!n.running||!n.items.length)}stop(e){const n=this._charts.get(e);if(!n||!n.items.length)return;const r=n.items;let s=r.length-1;for(;s>=0;--s)r[s].cancel();n.items=[],this._notify(e,n,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var gr=new tC;const v2="transparent",nC={boolean(t,e,n){return n>.5?e:t},color(t,e,n){const r=i2(t||v2),s=r.valid&&i2(e||v2);return s&&s.valid?s.mix(r,n).hexString():e},number(t,e,n){return t+(e-t)*n}};class rC{constructor(e,n,r,s){const i=n[r];s=Ka([e.to,s,i,e.from]);const a=Ka([e.from,i,s]);this._active=!0,this._fn=e.fn||nC[e.type||typeof a],this._easing=Mo[e.easing]||Mo.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=n,this._prop=r,this._from=a,this._to=s,this._promises=void 0}active(){return this._active}update(e,n,r){if(this._active){this._notify(!1);const s=this._target[this._prop],i=r-this._start,a=this._duration-i;this._start=r,this._duration=Math.floor(Math.max(a,e.duration)),this._total+=i,this._loop=!!e.loop,this._to=Ka([e.to,n,s,e.from]),this._from=Ka([e.from,s,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const n=e-this._start,r=this._duration,s=this._prop,i=this._from,a=this._loop,l=this._to;let c;if(this._active=i!==l&&(a||n<r),!this._active){this._target[s]=l,this._notify(!0);return}if(n<0){this._target[s]=i;return}c=n/r%2,c=a&&c>1?2-c:c,c=this._easing(Math.min(1,Math.max(0,c))),this._target[s]=this._fn(i,l,c)}wait(){const e=this._promises||(this._promises=[]);return new Promise((n,r)=>{e.push({res:n,rej:r})})}_notify(e){const n=e?"res":"rej",r=this._promises||[];for(let s=0;s<r.length;s++)r[s][n]()}}class S2{constructor(e,n){this._chart=e,this._properties=new Map,this.configure(n)}configure(e){if(!ve(e))return;const n=Object.keys(mt.animation),r=this._properties;Object.getOwnPropertyNames(e).forEach(s=>{const i=e[s];if(!ve(i))return;const a={};for(const l of n)a[l]=i[l];(tt(i.properties)&&i.properties||[s]).forEach(l=>{(l===s||!r.has(l))&&r.set(l,a)})})}_animateOptions(e,n){const r=n.options,s=iC(e,r);if(!s)return[];const i=this._createAnimations(s,r);return r.$shared&&sC(e.options.$animations,r).then(()=>{e.options=r},()=>{}),i}_createAnimations(e,n){const r=this._properties,s=[],i=e.$animations||(e.$animations={}),a=Object.keys(n),l=Date.now();let c;for(c=a.length-1;c>=0;--c){const d=a[c];if(d.charAt(0)==="$")continue;if(d==="options"){s.push(...this._animateOptions(e,n));continue}const u=n[d];let h=i[d];const f=r.get(d);if(h)if(f&&h.active()){h.update(f,u,l);continue}else h.cancel();if(!f||!f.duration){e[d]=u;continue}i[d]=h=new rC(f,e,d,u),s.push(h)}return s}update(e,n){if(this._properties.size===0){Object.assign(e,n);return}const r=this._createAnimations(e,n);if(r.length)return gr.add(this._chart,r),!0}}function sC(t,e){const n=[],r=Object.keys(e);for(let s=0;s<r.length;s++){const i=t[r[s]];i&&i.active()&&n.push(i.wait())}return Promise.all(n)}function iC(t,e){if(!e)return;let n=t.options;if(!n){t.options=e;return}return n.$shared&&(t.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function T2(t,e){const n=t&&t.options||{},r=n.reverse,s=n.min===void 0?e:0,i=n.max===void 0?e:0;return{start:r?i:s,end:r?s:i}}function oC(t,e,n){if(n===!1)return!1;const r=T2(t,n),s=T2(e,n);return{top:s.end,right:r.end,bottom:s.start,left:r.start}}function aC(t){let e,n,r,s;return ve(t)?(e=t.top,n=t.right,r=t.bottom,s=t.left):e=n=r=s=t,{top:e,right:n,bottom:r,left:s,disabled:t===!1}}function D2(t,e){const n=[],r=t._getSortedDatasetMetas(e);let s,i;for(s=0,i=r.length;s<i;++s)n.push(r[s].index);return n}function O2(t,e,n,r={}){const s=t.keys,i=r.mode==="single";let a,l,c,d;if(e!==null){for(a=0,l=s.length;a<l;++a){if(c=+s[a],c===n){if(r.all)continue;break}d=t.values[c],it(d)&&(i||e===0||wi(e)===wi(d))&&(e+=d)}return e}}function lC(t){const e=Object.keys(t),n=new Array(e.length);let r,s,i;for(r=0,s=e.length;r<s;++r)i=e[r],n[r]={x:i,y:t[i]};return n}function E2(t,e){const n=t&&t.options.stacked;return n||n===void 0&&e.stack!==void 0}function cC(t,e,n){return`${t.id}.${e.id}.${n.stack||n.type}`}function dC(t){const{min:e,max:n,minDefined:r,maxDefined:s}=t.getUserBounds();return{min:r?e:Number.NEGATIVE_INFINITY,max:s?n:Number.POSITIVE_INFINITY}}function uC(t,e,n){const r=t[e]||(t[e]={});return r[n]||(r[n]={})}function $2(t,e,n,r){for(const s of e.getMatchingVisibleMetas(r).reverse()){const i=t[s.index];if(n&&i>0||!n&&i<0)return s.index}return null}function P2(t,e){const{chart:n,_cachedMeta:r}=t,s=n._stacks||(n._stacks={}),{iScale:i,vScale:a,index:l}=r,c=i.axis,d=a.axis,u=cC(i,a,r),h=e.length;let f;for(let m=0;m<h;++m){const g=e[m],{[c]:p,[d]:_}=g,y=g._stacks||(g._stacks={});f=y[d]=uC(s,u,p),f[l]=_,f._top=$2(f,a,!0,r.type),f._bottom=$2(f,a,!1,r.type);const C=f._visualValues||(f._visualValues={});C[l]=_}}function wu(t,e){const n=t.scales;return Object.keys(n).filter(r=>n[r].axis===e).shift()}function hC(t,e){return Jr(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function fC(t,e,n){return Jr(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:n,index:e,mode:"default",type:"data"})}function To(t,e){const n=t.controller.index,r=t.vScale&&t.vScale.axis;if(r){e=e||t._parsed;for(const s of e){const i=s._stacks;if(!i||i[r]===void 0||i[r][n]===void 0)return;delete i[r][n],i[r]._visualValues!==void 0&&i[r]._visualValues[n]!==void 0&&delete i[r]._visualValues[n]}}}const bu=t=>t==="reset"||t==="none",L2=(t,e)=>e?t:Object.assign({},t),mC=(t,e,n)=>t&&!e.hidden&&e._stacked&&{keys:D2(n,!0),values:null};class Do{constructor(e,n){this.chart=e,this._ctx=e.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=E2(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&&To(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,n=this._cachedMeta,r=this.getDataset(),s=(h,f,m,g)=>h==="x"?f:h==="r"?g:m,i=n.xAxisID=Ae(r.xAxisID,wu(e,"x")),a=n.yAxisID=Ae(r.yAxisID,wu(e,"y")),l=n.rAxisID=Ae(r.rAxisID,wu(e,"r")),c=n.indexAxis,d=n.iAxisID=s(c,i,a,l),u=n.vAxisID=s(c,a,i,l);n.xScale=this.getScaleForId(i),n.yScale=this.getScaleForId(a),n.rScale=this.getScaleForId(l),n.iScale=this.getScaleForId(d),n.vScale=this.getScaleForId(u)}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 n=this._cachedMeta;return e===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&J0(this._data,this),e._stacked&&To(e)}_dataCheck(){const e=this.getDataset(),n=e.data||(e.data=[]),r=this._data;if(ve(n))this._data=lC(n);else if(r!==n){if(r){J0(r,this);const s=this._cachedMeta;To(s),s._parsed=[]}n&&Object.isExtensible(n)&&Zb(n,this),this._syncList=[],this._data=n}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const n=this._cachedMeta,r=this.getDataset();let s=!1;this._dataCheck();const i=n._stacked;n._stacked=E2(n.vScale,n),n.stack!==r.stack&&(s=!0,To(n),n.stack=r.stack),this._resyncElements(e),(s||i!==n._stacked)&&P2(this,n._parsed)}configure(){const e=this.chart.config,n=e.datasetScopeKeys(this._type),r=e.getOptionScopes(this.getDataset(),n,!0);this.options=e.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,n){const{_cachedMeta:r,_data:s}=this,{iScale:i,_stacked:a}=r,l=i.axis;let c=e===0&&n===s.length?!0:r._sorted,d=e>0&&r._parsed[e-1],u,h,f;if(this._parsing===!1)r._parsed=s,r._sorted=!0,f=s;else{tt(s[e])?f=this.parseArrayData(r,s,e,n):ve(s[e])?f=this.parseObjectData(r,s,e,n):f=this.parsePrimitiveData(r,s,e,n);const m=()=>h[l]===null||d&&h[l]<d[l];for(u=0;u<n;++u)r._parsed[u+e]=h=f[u],c&&(m()&&(c=!1),d=h);r._sorted=c}a&&P2(this,f)}parsePrimitiveData(e,n,r,s){const{iScale:i,vScale:a}=e,l=i.axis,c=a.axis,d=i.getLabels(),u=i===a,h=new Array(s);let f,m,g;for(f=0,m=s;f<m;++f)g=f+r,h[f]={[l]:u||i.parse(d[g],g),[c]:a.parse(n[g],g)};return h}parseArrayData(e,n,r,s){const{xScale:i,yScale:a}=e,l=new Array(s);let c,d,u,h;for(c=0,d=s;c<d;++c)u=c+r,h=n[u],l[c]={x:i.parse(h[0],u),y:a.parse(h[1],u)};return l}parseObjectData(e,n,r,s){const{xScale:i,yScale:a}=e,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,d=new Array(s);let u,h,f,m;for(u=0,h=s;u<h;++u)f=u+r,m=n[f],d[u]={x:i.parse(Ya(m,l),f),y:a.parse(Ya(m,c),f)};return d}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,n,r){const s=this.chart,i=this._cachedMeta,a=n[e.axis],l={keys:D2(s,!0),values:n._stacks[e.axis]._visualValues};return O2(l,a,i.index,{mode:r})}updateRangeFromParsed(e,n,r,s){const i=r[n.axis];let a=i===null?NaN:i;const l=s&&r._stacks[n.axis];s&&l&&(s.values=l,a=O2(s,i,this._cachedMeta.index)),e.min=Math.min(e.min,a),e.max=Math.max(e.max,a)}getMinMax(e,n){const r=this._cachedMeta,s=r._parsed,i=r._sorted&&e===r.iScale,a=s.length,l=this._getOtherScale(e),c=mC(n,r,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:h}=dC(l);let f,m;function g(){m=s[f];const p=m[l.axis];return!it(m[e.axis])||u>p||h<p}for(f=0;f<a&&!(!g()&&(this.updateRangeFromParsed(d,e,m,c),i));++f);if(i){for(f=a-1;f>=0;--f)if(!g()){this.updateRangeFromParsed(d,e,m,c);break}}return d}getAllParsedValues(e){const n=this._cachedMeta._parsed,r=[];let s,i,a;for(s=0,i=n.length;s<i;++s)a=n[s][e.axis],it(a)&&r.push(a);return r}getMaxOverflow(){return!1}getLabelAndValue(e){const n=this._cachedMeta,r=n.iScale,s=n.vScale,i=this.getParsed(e);return{label:r?""+r.getLabelForValue(i[r.axis]):"",value:s?""+s.getLabelForValue(i[s.axis]):""}}_update(e){const n=this._cachedMeta;this.update(e||"default"),n._clip=aC(Ae(this.options.clip,oC(n.xScale,n.yScale,this.getMaxOverflow())))}update(e){}draw(){const e=this._ctx,n=this.chart,r=this._cachedMeta,s=r.data||[],i=n.chartArea,a=[],l=this._drawStart||0,c=this._drawCount||s.length-l,d=this.options.drawActiveElementsOnTop;let u;for(r.dataset&&r.dataset.draw(e,i,l,c),u=l;u<l+c;++u){const h=s[u];h.hidden||(h.active&&d?a.push(h):h.draw(e,i))}for(u=0;u<a.length;++u)a[u].draw(e,i)}getStyle(e,n){const r=n?"active":"default";return e===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(e||0,r)}getContext(e,n,r){const s=this.getDataset();let i;if(e>=0&&e<this._cachedMeta.data.length){const a=this._cachedMeta.data[e];i=a.$context||(a.$context=fC(this.getContext(),e,a)),i.parsed=this.getParsed(e),i.raw=s.data[e],i.index=i.dataIndex=e}else i=this.$context||(this.$context=hC(this.chart.getContext(),this.index)),i.dataset=s,i.index=i.datasetIndex=this.index;return i.active=!!n,i.mode=r,i}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,n){return this._resolveElementOptions(this.dataElementType.id,n,e)}_resolveElementOptions(e,n="default",r){const s=n==="active",i=this._cachedDataOpts,a=e+"-"+n,l=i[a],c=this.enableOptionSharing&&Wa(r);if(l)return L2(l,c);const d=this.chart.config,u=d.datasetElementScopeKeys(this._type,e),h=s?[`${e}Hover`,"hover",e,""]:[e,""],f=d.getOptionScopes(this.getDataset(),u),m=Object.keys(mt.elements[e]),g=()=>this.getContext(r,s,n),p=d.resolveNamedOptions(f,m,g,h);return p.$shared&&(p.$shared=c,i[a]=Object.freeze(L2(p,c))),p}_resolveAnimations(e,n,r){const s=this.chart,i=this._cachedDataOpts,a=`animation-${n}`,l=i[a];if(l)return l;let c;if(s.options.animation!==!1){const u=this.chart.config,h=u.datasetAnimationScopeKeys(this._type,n),f=u.getOptionScopes(this.getDataset(),h);c=u.createResolver(f,this.getContext(e,r,n))}const d=new S2(s,c&&c.animations);return c&&c._cacheable&&(i[a]=Object.freeze(d)),d}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,n){return!n||bu(e)||this.chart._animationsDisabled}_getSharedOptions(e,n){const r=this.resolveDataElementOptions(e,n),s=this._sharedOptions,i=this.getSharedOptions(r),a=this.includeOptions(n,i)||i!==s;return this.updateSharedOptions(i,n,r),{sharedOptions:i,includeOptions:a}}updateElement(e,n,r,s){bu(s)?Object.assign(e,r):this._resolveAnimations(n,s).update(e,r)}updateSharedOptions(e,n,r){e&&!bu(n)&&this._resolveAnimations(void 0,n).update(e,r)}_setStyle(e,n,r,s){e.active=s;const i=this.getStyle(n,s);this._resolveAnimations(n,r,s).update(e,{options:!s&&this.getSharedOptions(i)||i})}removeHoverStyle(e,n,r){this._setStyle(e,r,"active",!1)}setHoverStyle(e,n,r){this._setStyle(e,r,"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 n=this._data,r=this._cachedMeta.data;for(const[l,c,d]of this._syncList)this[l](c,d);this._syncList=[];const s=r.length,i=n.length,a=Math.min(i,s);a&&this.parse(0,a),i>s?this._insertElements(s,i-s,e):i<s&&this._removeElements(i,s-i)}_insertElements(e,n,r=!0){const s=this._cachedMeta,i=s.data,a=e+n;let l;const c=d=>{for(d.length+=n,l=d.length-1;l>=a;l--)d[l]=d[l-n]};for(c(i),l=e;l<a;++l)i[l]=new this.dataElementType;this._parsing&&c(s._parsed),this.parse(e,n),r&&this.updateElements(i,e,n,"reset")}updateElements(e,n,r,s){}_removeElements(e,n){const r=this._cachedMeta;if(this._parsing){const s=r._parsed.splice(e,n);r._stacked&&To(r,s)}r.data.splice(e,n)}_sync(e){if(this._parsing)this._syncList.push(e);else{const[n,r,s]=e;this[n](r,s)}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,n){n&&this._sync(["_removeElements",e,n]);const r=arguments.length-2;r&&this._sync(["_insertElements",e,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}W(Do,"defaults",{}),W(Do,"datasetElementType",null),W(Do,"dataElementType",null);class tl extends Do{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const n=this._cachedMeta,{dataset:r,data:s=[],_dataset:i}=n,a=this.chart._animationsDisabled;let{start:l,count:c}=Kb(n,s,a);this._drawStart=l,this._drawCount=c,Xb(n)&&(l=0,c=s.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!i._decimated,r.points=s;const d=this.resolveDatasetElementOptions(e);this.options.showLine||(d.borderWidth=0),d.segment=this.options.segment,this.updateElement(r,void 0,{animated:!a,options:d},e),this.updateElements(s,l,c,e)}updateElements(e,n,r,s){const i=s==="reset",{iScale:a,vScale:l,_stacked:c,_dataset:d}=this._cachedMeta,{sharedOptions:u,includeOptions:h}=this._getSharedOptions(n,s),f=a.axis,m=l.axis,{spanGaps:g,segment:p}=this.options,_=xo(g)?g:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||i||s==="none",C=n+r,b=e.length;let S=n>0&&this.getParsed(n-1);for(let M=0;M<b;++M){const T=e[M],v=y?T:{};if(M<n||M>=C){v.skip=!0;continue}const O=this.getParsed(M),E=Ze(O[m]),I=v[f]=a.getPixelForValue(O[f],M),j=v[m]=i||E?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,O,c):O[m],M);v.skip=isNaN(I)||isNaN(j)||E,v.stop=M>0&&Math.abs(O[f]-S[f])>_,p&&(v.parsed=O,v.raw=d.data[M]),h&&(v.options=u||this.resolveDataElementOptions(M,T.active?"active":s)),y||this.updateElement(T,M,v,s),S=O}}getMaxOverflow(){const e=this._cachedMeta,n=e.dataset,r=n.options&&n.options.borderWidth||0,s=e.data||[];if(!s.length)return r;const i=s[0].size(this.resolveDataElementOptions(0)),a=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(r,i,a)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}W(tl,"id","line"),W(tl,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),W(tl,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});function Vs(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class ku{constructor(e){W(this,"options");this.options=e||{}}static override(e){Object.assign(ku.prototype,e)}init(){}formats(){return Vs()}parse(){return Vs()}format(){return Vs()}add(){return Vs()}diff(){return Vs()}startOf(){return Vs()}endOf(){return Vs()}}var pC={_date:ku};function gC(t,e,n,r){const{controller:s,data:i,_sorted:a}=t,l=s._cachedMeta.iScale;if(l&&e===l.axis&&e!=="r"&&a&&i.length){const c=l._reversePixels?Wb:Os;if(r){if(s._sharedOptions){const d=i[0],u=typeof d.getRange=="function"&&d.getRange(e);if(u){const h=c(i,e,n-u),f=c(i,e,n+u);return{lo:h.lo,hi:f.hi}}}}else return c(i,e,n)}return{lo:0,hi:i.length-1}}function Oo(t,e,n,r,s){const i=t.getSortedVisibleDatasetMetas(),a=n[e];for(let l=0,c=i.length;l<c;++l){const{index:d,data:u}=i[l],{lo:h,hi:f}=gC(i[l],e,a,s);for(let m=h;m<=f;++m){const g=u[m];g.skip||r(g,d,m)}}}function _C(t){const e=t.indexOf("x")!==-1,n=t.indexOf("y")!==-1;return function(r,s){const i=e?Math.abs(r.x-s.x):0,a=n?Math.abs(r.y-s.y):0;return Math.sqrt(Math.pow(i,2)+Math.pow(a,2))}}function Cu(t,e,n,r,s){const i=[];return!s&&!t.isPointInArea(e)||Oo(t,n,e,function(l,c,d){!s&&!pr(l,t.chartArea,0)||l.inRange(e.x,e.y,r)&&i.push({element:l,datasetIndex:c,index:d})},!0),i}function yC(t,e,n,r){let s=[];function i(a,l,c){const{startAngle:d,endAngle:u}=a.getProps(["startAngle","endAngle"],r),{angle:h}=zb(a,{x:e.x,y:e.y});K0(h,d,u)&&s.push({element:a,datasetIndex:l,index:c})}return Oo(t,n,e,i),s}function wC(t,e,n,r,s,i){let a=[];const l=_C(n);let c=Number.POSITIVE_INFINITY;function d(u,h,f){const m=u.inRange(e.x,e.y,s);if(r&&!m)return;const g=u.getCenterPoint(s);if(!(!!i||t.isPointInArea(g))&&!m)return;const _=l(e,g);_<c?(a=[{element:u,datasetIndex:h,index:f}],c=_):_===c&&a.push({element:u,datasetIndex:h,index:f})}return Oo(t,n,e,d),a}function xu(t,e,n,r,s,i){return!i&&!t.isPointInArea(e)?[]:n==="r"&&!r?yC(t,e,n,s):wC(t,e,n,r,s,i)}function N2(t,e,n,r,s){const i=[],a=n==="x"?"inXRange":"inYRange";let l=!1;return Oo(t,n,e,(c,d,u)=>{c[a](e[n],s)&&(i.push({element:c,datasetIndex:d,index:u}),l=l||c.inRange(e.x,e.y,s))}),r&&!l?[]:i}var bC={evaluateInteractionItems:Oo,modes:{index(t,e,n,r){const s=Ls(e,t),i=n.axis||"x",a=n.includeInvisible||!1,l=n.intersect?Cu(t,s,i,r,a):xu(t,s,i,!1,r,a),c=[];return l.length?(t.getSortedVisibleDatasetMetas().forEach(d=>{const u=l[0].index,h=d.data[u];h&&!h.skip&&c.push({element:h,datasetIndex:d.index,index:u})}),c):[]},dataset(t,e,n,r){const s=Ls(e,t),i=n.axis||"xy",a=n.includeInvisible||!1;let l=n.intersect?Cu(t,s,i,r,a):xu(t,s,i,!1,r,a);if(l.length>0){const c=l[0].datasetIndex,d=t.getDatasetMeta(c).data;l=[];for(let u=0;u<d.length;++u)l.push({element:d[u],datasetIndex:c,index:u})}return l},point(t,e,n,r){const s=Ls(e,t),i=n.axis||"xy",a=n.includeInvisible||!1;return Cu(t,s,i,r,a)},nearest(t,e,n,r){const s=Ls(e,t),i=n.axis||"xy",a=n.includeInvisible||!1;return xu(t,s,i,n.intersect,r,a)},x(t,e,n,r){const s=Ls(e,t);return N2(t,s,"x",n.intersect,r)},y(t,e,n,r){const s=Ls(e,t);return N2(t,s,"y",n.intersect,r)}}};const V2=["left","top","right","bottom"];function Eo(t,e){return t.filter(n=>n.pos===e)}function B2(t,e){return t.filter(n=>V2.indexOf(n.pos)===-1&&n.box.axis===e)}function $o(t,e){return t.sort((n,r)=>{const s=e?r:n,i=e?n:r;return s.weight===i.weight?s.index-i.index:s.weight-i.weight})}function kC(t){const e=[];let n,r,s,i,a,l;for(n=0,r=(t||[]).length;n<r;++n)s=t[n],{position:i,options:{stack:a,stackWeight:l=1}}=s,e.push({index:n,box:s,pos:i,horizontal:s.isHorizontal(),weight:s.weight,stack:a&&i+a,stackWeight:l});return e}function CC(t){const e={};for(const n of t){const{stack:r,pos:s,stackWeight:i}=n;if(!r||!V2.includes(s))continue;const a=e[r]||(e[r]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=i}return e}function xC(t,e){const n=CC(t),{vBoxMaxWidth:r,hBoxMaxHeight:s}=e;let i,a,l;for(i=0,a=t.length;i<a;++i){l=t[i];const{fullSize:c}=l.box,d=n[l.stack],u=d&&l.stackWeight/d.weight;l.horizontal?(l.width=u?u*r:c&&e.availableWidth,l.height=s):(l.width=r,l.height=u?u*s:c&&e.availableHeight)}return n}function MC(t){const e=kC(t),n=$o(e.filter(d=>d.box.fullSize),!0),r=$o(Eo(e,"left"),!0),s=$o(Eo(e,"right")),i=$o(Eo(e,"top"),!0),a=$o(Eo(e,"bottom")),l=B2(e,"x"),c=B2(e,"y");return{fullSize:n,leftAndTop:r.concat(i),rightAndBottom:s.concat(c).concat(a).concat(l),chartArea:Eo(e,"chartArea"),vertical:r.concat(s).concat(c),horizontal:i.concat(a).concat(l)}}function A2(t,e,n,r){return Math.max(t[n],e[n])+Math.max(t[r],e[r])}function R2(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function vC(t,e,n,r){const{pos:s,box:i}=n,a=t.maxPadding;if(!ve(s)){n.size&&(t[s]-=n.size);const h=r[n.stack]||{size:0,count:1};h.size=Math.max(h.size,n.horizontal?i.height:i.width),n.size=h.size/h.count,t[s]+=n.size}i.getPadding&&R2(a,i.getPadding());const l=Math.max(0,e.outerWidth-A2(a,t,"left","right")),c=Math.max(0,e.outerHeight-A2(a,t,"top","bottom")),d=l!==t.w,u=c!==t.h;return t.w=l,t.h=c,n.horizontal?{same:d,other:u}:{same:u,other:d}}function SC(t){const e=t.maxPadding;function n(r){const s=Math.max(e[r]-t[r],0);return t[r]+=s,s}t.y+=n("top"),t.x+=n("left"),n("right"),n("bottom")}function TC(t,e){const n=e.maxPadding;function r(s){const i={left:0,top:0,right:0,bottom:0};return s.forEach(a=>{i[a]=Math.max(e[a],n[a])}),i}return r(t?["left","right"]:["top","bottom"])}function Po(t,e,n,r){const s=[];let i,a,l,c,d,u;for(i=0,a=t.length,d=0;i<a;++i){l=t[i],c=l.box,c.update(l.width||e.w,l.height||e.h,TC(l.horizontal,e));const{same:h,other:f}=vC(e,n,l,r);d|=h&&s.length,u=u||f,c.fullSize||s.push(l)}return d&&Po(s,e,n,r)||u}function nl(t,e,n,r,s){t.top=n,t.left=e,t.right=e+r,t.bottom=n+s,t.width=r,t.height=s}function F2(t,e,n,r){const s=n.padding;let{x:i,y:a}=e;for(const l of t){const c=l.box,d=r[l.stack]||{count:1,placed:0,weight:1},u=l.stackWeight/d.weight||1;if(l.horizontal){const h=e.w*u,f=d.size||c.height;Wa(d.start)&&(a=d.start),c.fullSize?nl(c,s.left,a,n.outerWidth-s.right-s.left,f):nl(c,e.left+d.placed,a,h,f),d.start=a,d.placed+=h,a=c.bottom}else{const h=e.h*u,f=d.size||c.width;Wa(d.start)&&(i=d.start),c.fullSize?nl(c,i,s.top,f,n.outerHeight-s.bottom-s.top):nl(c,i,e.top+d.placed,f,h),d.start=i,d.placed+=h,i=c.right}}e.x=i,e.y=a}var rl={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(n){e.draw(n)}}]},t.boxes.push(e)},removeBox(t,e){const n=t.boxes?t.boxes.indexOf(e):-1;n!==-1&&t.boxes.splice(n,1)},configure(t,e,n){e.fullSize=n.fullSize,e.position=n.position,e.weight=n.weight},update(t,e,n,r){if(!t)return;const s=gn(t.options.layout.padding),i=Math.max(e-s.width,0),a=Math.max(n-s.height,0),l=MC(t.boxes),c=l.vertical,d=l.horizontal;Re(t.boxes,p=>{typeof p.beforeLayout=="function"&&p.beforeLayout()});const u=c.reduce((p,_)=>_.box.options&&_.box.options.display===!1?p:p+1,0)||1,h=Object.freeze({outerWidth:e,outerHeight:n,padding:s,availableWidth:i,availableHeight:a,vBoxMaxWidth:i/2/u,hBoxMaxHeight:a/2}),f=Object.assign({},s);R2(f,gn(r));const m=Object.assign({maxPadding:f,w:i,h:a,x:s.left,y:s.top},s),g=xC(c.concat(d),h);Po(l.fullSize,m,h,g),Po(c,m,h,g),Po(d,m,h,g)&&Po(c,m,h,g),SC(m),F2(l.leftAndTop,m,h,g),m.x+=m.w,m.y+=m.h,F2(l.rightAndBottom,m,h,g),t.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},Re(l.chartArea,p=>{const _=p.box;Object.assign(_,t.chartArea),_.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class I2{acquireContext(e,n){}releaseContext(e){return!1}addEventListener(e,n,r){}removeEventListener(e,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(e,n,r,s){return n=Math.max(0,n||e.width),r=r||e.height,{width:n,height:Math.max(0,s?Math.floor(n/s):r)}}isAttached(e){return!0}updateConfig(e){}}class DC extends I2{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const sl="$chartjs",OC={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},z2=t=>t===null||t==="";function EC(t,e){const n=t.style,r=t.getAttribute("height"),s=t.getAttribute("width");if(t[sl]={initial:{height:r,width:s,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",z2(s)){const i=y2(t,"width");i!==void 0&&(t.width=i)}if(z2(r))if(t.style.height==="")t.height=t.width/(e||2);else{const i=y2(t,"height");i!==void 0&&(t.height=i)}return t}const H2=Hk?{passive:!0}:!1;function $C(t,e,n){t&&t.addEventListener(e,n,H2)}function PC(t,e,n){t&&t.canvas&&t.canvas.removeEventListener(e,n,H2)}function LC(t,e){const n=OC[t.type]||t.type,{x:r,y:s}=Ls(t,e);return{type:n,chart:e,native:t,x:r!==void 0?r:null,y:s!==void 0?s:null}}function il(t,e){for(const n of t)if(n===e||n.contains(e))return!0}function NC(t,e,n){const r=t.canvas,s=new MutationObserver(i=>{let a=!1;for(const l of i)a=a||il(l.addedNodes,r),a=a&&!il(l.removedNodes,r);a&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}function VC(t,e,n){const r=t.canvas,s=new MutationObserver(i=>{let a=!1;for(const l of i)a=a||il(l.removedNodes,r),a=a&&!il(l.addedNodes,r);a&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}const Lo=new Map;let Y2=0;function W2(){const t=window.devicePixelRatio;t!==Y2&&(Y2=t,Lo.forEach((e,n)=>{n.currentDevicePixelRatio!==t&&e()}))}function BC(t,e){Lo.size||window.addEventListener("resize",W2),Lo.set(t,e)}function AC(t){Lo.delete(t),Lo.size||window.removeEventListener("resize",W2)}function RC(t,e,n){const r=t.canvas,s=r&&_u(r);if(!s)return;const i=t2((l,c)=>{const d=s.clientWidth;n(l,c),d<s.clientWidth&&n()},window),a=new ResizeObserver(l=>{const c=l[0],d=c.contentRect.width,u=c.contentRect.height;d===0&&u===0||i(d,u)});return a.observe(s),BC(t,i),a}function Mu(t,e,n){n&&n.disconnect(),e==="resize"&&AC(t)}function FC(t,e,n){const r=t.canvas,s=t2(i=>{t.ctx!==null&&n(LC(i,t))},t);return $C(r,e,s),s}class IC extends I2{acquireContext(e,n){const r=e&&e.getContext&&e.getContext("2d");return r&&r.canvas===e?(EC(e,n),r):null}releaseContext(e){const n=e.canvas;if(!n[sl])return!1;const r=n[sl].initial;["height","width"].forEach(i=>{const a=r[i];Ze(a)?n.removeAttribute(i):n.setAttribute(i,a)});const s=r.style||{};return Object.keys(s).forEach(i=>{n.style[i]=s[i]}),n.width=n.width,delete n[sl],!0}addEventListener(e,n,r){this.removeEventListener(e,n);const s=e.$proxies||(e.$proxies={}),a={attach:NC,detach:VC,resize:RC}[n]||FC;s[n]=a(e,n,r)}removeEventListener(e,n){const r=e.$proxies||(e.$proxies={}),s=r[n];if(!s)return;({attach:Mu,detach:Mu,resize:Mu}[n]||PC)(e,n,s),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,n,r,s){return zk(e,n,r,s)}isAttached(e){const n=_u(e);return!!(n&&n.isConnected)}}function zC(t){return!gu()||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas?DC:IC}class Bs{constructor(){W(this,"x");W(this,"y");W(this,"active",!1);W(this,"options");W(this,"$animations")}tooltipPosition(e){const{x:n,y:r}=this.getProps(["x","y"],e);return{x:n,y:r}}hasValue(){return xo(this.x)&&xo(this.y)}getProps(e,n){const r=this.$animations;if(!n||!r)return this;const s={};return e.forEach(i=>{s[i]=r[i]&&r[i].active()?r[i]._to:this[i]}),s}}W(Bs,"defaults",{}),W(Bs,"defaultRoutes");function HC(t,e){const n=t.options.ticks,r=YC(t),s=Math.min(n.maxTicksLimit||r,r),i=n.major.enabled?jC(e):[],a=i.length,l=i[0],c=i[a-1],d=[];if(a>s)return ZC(e,d,i,a/s),d;const u=WC(i,e,s);if(a>0){let h,f;const m=a>1?Math.round((c-l)/(a-1)):null;for(ol(e,d,u,Ze(m)?0:l-m,l),h=0,f=a-1;h<f;h++)ol(e,d,u,i[h],i[h+1]);return ol(e,d,u,c,Ze(m)?e.length:c+m),d}return ol(e,d,u),d}function YC(t){const e=t.options.offset,n=t._tickSize(),r=t._length/n+(e?0:1),s=t._maxLength/n;return Math.floor(Math.min(r,s))}function WC(t,e,n){const r=UC(t),s=e.length/n;if(!r)return Math.max(s,1);const i=Fb(r);for(let a=0,l=i.length-1;a<l;a++){const c=i[a];if(c>s)return c}return Math.max(s,1)}function jC(t){const e=[];let n,r;for(n=0,r=t.length;n<r;n++)t[n].major&&e.push(n);return e}function ZC(t,e,n,r){let s=0,i=n[0],a;for(r=Math.ceil(r),a=0;a<t.length;a++)a===i&&(e.push(t[a]),s++,i=n[s*r])}function ol(t,e,n,r,s){const i=Ae(r,0),a=Math.min(Ae(s,t.length),t.length);let l=0,c,d,u;for(n=Math.ceil(n),s&&(c=s-r,n=c/Math.floor(c/n)),u=i;u<0;)l++,u=Math.round(i+l*n);for(d=Math.max(i,0);d<a;d++)d===u&&(e.push(t[d]),l++,u=Math.round(i+l*n))}function UC(t){const e=t.length;let n,r;if(e<2)return!1;for(r=t[0],n=1;n<e;++n)if(t[n]-t[n-1]!==r)return!1;return r}const qC=t=>t==="left"?"right":t==="right"?"left":t,j2=(t,e,n)=>e==="top"||e==="left"?t[e]+n:t[e]-n,Z2=(t,e)=>Math.min(e||t,t);function U2(t,e){const n=[],r=t.length/e,s=t.length;let i=0;for(;i<s;i+=r)n.push(t[Math.floor(i)]);return n}function GC(t,e,n){const r=t.ticks.length,s=Math.min(e,r-1),i=t._startPixel,a=t._endPixel,l=1e-6;let c=t.getPixelForTick(s),d;if(!(n&&(r===1?d=Math.max(c-i,a-c):e===0?d=(t.getPixelForTick(1)-c)/2:d=(c-t.getPixelForTick(s-1))/2,c+=s<e?d:-d,c<i-l||c>a+l)))return c}function KC(t,e){Re(t,n=>{const r=n.gc,s=r.length/2;let i;if(s>e){for(i=0;i<s;++i)delete n.data[r[i]];r.splice(0,s)}})}function No(t){return t.drawTicks?t.tickLength:0}function q2(t,e){if(!t.display)return 0;const n=rn(t.font,e),r=gn(t.padding);return(tt(t.text)?t.text.length:1)*n.lineHeight+r.height}function XC(t,e){return Jr(t,{scale:e,type:"scale"})}function QC(t,e,n){return Jr(t,{tick:n,index:e,type:"tick"})}function JC(t,e,n){let r=Gb(t);return(n&&e!=="right"||!n&&e==="right")&&(r=qC(r)),r}function ex(t,e,n,r){const{top:s,left:i,bottom:a,right:l,chart:c}=t,{chartArea:d,scales:u}=c;let h=0,f,m,g;const p=a-s,_=l-i;if(t.isHorizontal()){if(m=n2(r,i,l),ve(n)){const y=Object.keys(n)[0],C=n[y];g=u[y].getPixelForValue(C)+p-e}else n==="center"?g=(d.bottom+d.top)/2+p-e:g=j2(t,n,e);f=l-i}else{if(ve(n)){const y=Object.keys(n)[0],C=n[y];m=u[y].getPixelForValue(C)-_+e}else n==="center"?m=(d.left+d.right)/2-_+e:m=j2(t,n,e);g=n2(r,a,s),h=n==="left"?-tn:tn}return{titleX:m,titleY:g,maxWidth:f,rotation:h}}class As extends Bs{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,n){return e}getUserBounds(){let{_userMin:e,_userMax:n,_suggestedMin:r,_suggestedMax:s}=this;return e=Jt(e,Number.POSITIVE_INFINITY),n=Jt(n,Number.NEGATIVE_INFINITY),r=Jt(r,Number.POSITIVE_INFINITY),s=Jt(s,Number.NEGATIVE_INFINITY),{min:Jt(e,r),max:Jt(n,s),minDefined:it(e),maxDefined:it(n)}}getMinMax(e){let{min:n,max:r,minDefined:s,maxDefined:i}=this.getUserBounds(),a;if(s&&i)return{min:n,max:r};const l=this.getMatchingVisibleMetas();for(let c=0,d=l.length;c<d;++c)a=l[c].controller.getMinMax(this,e),s||(n=Math.min(n,a.min)),i||(r=Math.max(r,a.max));return n=i&&n>r?r:n,r=s&&n>r?n:r,{min:Jt(n,Jt(r,n)),max:Jt(r,Jt(n,r))}}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(){ot(this.options.beforeUpdate,[this])}update(e,n,r){const{beginAtZero:s,grace:i,ticks:a}=this.options,l=a.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=n,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=wk(this,i,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const c=l<this.ticks.length;this._convertTicksToLabels(c?U2(this.ticks,l):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=HC(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),c&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e=this.options.reverse,n,r;this.isHorizontal()?(n=this.left,r=this.right):(n=this.top,r=this.bottom,e=!e),this._startPixel=n,this._endPixel=r,this._reversePixels=e,this._length=r-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){ot(this.options.afterUpdate,[this])}beforeSetDimensions(){ot(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(){ot(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),ot(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){ot(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){const n=this.options.ticks;let r,s,i;for(r=0,s=e.length;r<s;r++)i=e[r],i.label=ot(n.callback,[i.value,r,e],this)}afterTickToLabelConversion(){ot(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){ot(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,n=e.ticks,r=Z2(this.ticks.length,e.ticks.maxTicksLimit),s=n.minRotation||0,i=n.maxRotation;let a=s,l,c,d;if(!this._isVisible()||!n.display||s>=i||r<=1||!this.isHorizontal()){this.labelRotation=s;return}const u=this._getLabelSizes(),h=u.widest.width,f=u.highest.height,m=pn(this.chart.width-h,0,this.maxWidth);l=e.offset?this.maxWidth/r:m/(r-1),h+6>l&&(l=m/(r-(e.offset?.5:1)),c=this.maxHeight-No(e.grid)-n.padding-q2(e.title,this.chart.options.font),d=Math.sqrt(h*h+f*f),a=tu(Math.min(Math.asin(pn((u.highest.height+6)/l,-1,1)),Math.asin(pn(c/d,-1,1))-Math.asin(pn(f/d,-1,1)))),a=Math.max(s,Math.min(i,a))),this.labelRotation=a}afterCalculateLabelRotation(){ot(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){ot(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:n,options:{ticks:r,title:s,grid:i}}=this,a=this._isVisible(),l=this.isHorizontal();if(a){const c=q2(s,n.options.font);if(l?(e.width=this.maxWidth,e.height=No(i)+c):(e.height=this.maxHeight,e.width=No(i)+c),r.display&&this.ticks.length){const{first:d,last:u,widest:h,highest:f}=this._getLabelSizes(),m=r.padding*2,g=Qr(this.labelRotation),p=Math.cos(g),_=Math.sin(g);if(l){const y=r.mirror?0:_*h.width+p*f.height;e.height=Math.min(this.maxHeight,e.height+y+m)}else{const y=r.mirror?0:p*h.width+_*f.height;e.width=Math.min(this.maxWidth,e.width+y+m)}this._calculatePadding(d,u,_,p)}}this._handleMargins(),l?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,n,r,s){const{ticks:{align:i,padding:a},position:l}=this.options,c=this.labelRotation!==0,d=l!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,m=0;c?d?(f=s*e.width,m=r*n.height):(f=r*e.height,m=s*n.width):i==="start"?m=n.width:i==="end"?f=e.width:i!=="inner"&&(f=e.width/2,m=n.width/2),this.paddingLeft=Math.max((f-u+a)*this.width/(this.width-u),0),this.paddingRight=Math.max((m-h+a)*this.width/(this.width-h),0)}else{let u=n.height/2,h=e.height/2;i==="start"?(u=0,h=e.height):i==="end"&&(u=n.height,h=0),this.paddingTop=u+a,this.paddingBottom=h+a}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){ot(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:n}=this.options;return n==="top"||n==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let n,r;for(n=0,r=e.length;n<r;n++)Ze(e[n].label)&&(e.splice(n,1),r--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){const n=this.options.ticks.sampleSize;let r=this.ticks;n<r.length&&(r=U2(r,n)),this._labelSizes=e=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,n,r){const{ctx:s,_longestTextCache:i}=this,a=[],l=[],c=Math.floor(n/Z2(n,r));let d=0,u=0,h,f,m,g,p,_,y,C,b,S,M;for(h=0;h<n;h+=c){if(g=e[h].label,p=this._resolveTickFontOptions(h),s.font=_=p.string,y=i[_]=i[_]||{data:{},gc:[]},C=p.lineHeight,b=S=0,!Ze(g)&&!tt(g))b=qa(s,y.data,y.gc,b,g),S=C;else if(tt(g))for(f=0,m=g.length;f<m;++f)M=g[f],!Ze(M)&&!tt(M)&&(b=qa(s,y.data,y.gc,b,M),S+=C);a.push(b),l.push(S),d=Math.max(b,d),u=Math.max(S,u)}KC(i,n);const T=a.indexOf(d),v=l.indexOf(u),O=E=>({width:a[E]||0,height:l[E]||0});return{first:O(0),last:O(n-1),widest:O(T),highest:O(v),widths:a,heights:l}}getLabelForValue(e){return e}getPixelForValue(e,n){return NaN}getValueForPixel(e){}getPixelForTick(e){const n=this.ticks;return e<0||e>n.length-1?null:this.getPixelForValue(n[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const n=this._startPixel+e*this._length;return Yb(this._alignToPixels?$s(this.chart,n,0):n)}getDecimalForPixel(e){const n=(e-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:n}=this;return e<0&&n<0?n:e>0&&n>0?e:0}getContext(e){const n=this.ticks||[];if(e>=0&&e<n.length){const r=n[e];return r.$context||(r.$context=QC(this.getContext(),e,r))}return this.$context||(this.$context=XC(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,n=Qr(this.labelRotation),r=Math.abs(Math.cos(n)),s=Math.abs(Math.sin(n)),i=this._getLabelSizes(),a=e.autoSkipPadding||0,l=i?i.widest.width+a:0,c=i?i.highest.height+a:0;return this.isHorizontal()?c*r>l*s?l/r:c/s:c*s<l*r?c/r:l/s}_isVisible(){const e=this.options.display;return e!=="auto"?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){const n=this.axis,r=this.chart,s=this.options,{grid:i,position:a,border:l}=s,c=i.offset,d=this.isHorizontal(),h=this.ticks.length+(c?1:0),f=No(i),m=[],g=l.setContext(this.getContext()),p=g.display?g.width:0,_=p/2,y=function(x){return $s(r,x,p)};let C,b,S,M,T,v,O,E,I,j,$,F;if(a==="top")C=y(this.bottom),v=this.bottom-f,E=C-_,j=y(e.top)+_,F=e.bottom;else if(a==="bottom")C=y(this.top),j=e.top,F=y(e.bottom)-_,v=C+_,E=this.top+f;else if(a==="left")C=y(this.right),T=this.right-f,O=C-_,I=y(e.left)+_,$=e.right;else if(a==="right")C=y(this.left),I=e.left,$=y(e.right)-_,T=C+_,O=this.left+f;else if(n==="x"){if(a==="center")C=y((e.top+e.bottom)/2+.5);else if(ve(a)){const x=Object.keys(a)[0],N=a[x];C=y(this.chart.scales[x].getPixelForValue(N))}j=e.top,F=e.bottom,v=C+_,E=v+f}else if(n==="y"){if(a==="center")C=y((e.left+e.right)/2);else if(ve(a)){const x=Object.keys(a)[0],N=a[x];C=y(this.chart.scales[x].getPixelForValue(N))}T=C-_,O=T-f,I=e.left,$=e.right}const G=Ae(s.ticks.maxTicksLimit,h),D=Math.max(1,Math.ceil(h/G));for(b=0;b<h;b+=D){const x=this.getContext(b),N=i.setContext(x),Z=l.setContext(x),ee=N.lineWidth,U=N.color,P=Z.dash||[],V=Z.dashOffset,k=N.tickWidth,w=N.tickColor,B=N.tickBorderDash||[],z=N.tickBorderDashOffset;S=GC(this,b,c),S!==void 0&&(M=$s(r,S,ee),d?T=O=I=$=M:v=E=j=F=M,m.push({tx1:T,ty1:v,tx2:O,ty2:E,x1:I,y1:j,x2:$,y2:F,width:ee,color:U,borderDash:P,borderDashOffset:V,tickWidth:k,tickColor:w,tickBorderDash:B,tickBorderDashOffset:z}))}return this._ticksLength=h,this._borderValue=C,m}_computeLabelItems(e){const n=this.axis,r=this.options,{position:s,ticks:i}=r,a=this.isHorizontal(),l=this.ticks,{align:c,crossAlign:d,padding:u,mirror:h}=i,f=No(r.grid),m=f+u,g=h?-u:m,p=-Qr(this.labelRotation),_=[];let y,C,b,S,M,T,v,O,E,I,j,$,F="middle";if(s==="top")T=this.bottom-g,v=this._getXAxisLabelAlignment();else if(s==="bottom")T=this.top+g,v=this._getXAxisLabelAlignment();else if(s==="left"){const D=this._getYAxisLabelAlignment(f);v=D.textAlign,M=D.x}else if(s==="right"){const D=this._getYAxisLabelAlignment(f);v=D.textAlign,M=D.x}else if(n==="x"){if(s==="center")T=(e.top+e.bottom)/2+m;else if(ve(s)){const D=Object.keys(s)[0],x=s[D];T=this.chart.scales[D].getPixelForValue(x)+m}v=this._getXAxisLabelAlignment()}else if(n==="y"){if(s==="center")M=(e.left+e.right)/2-m;else if(ve(s)){const D=Object.keys(s)[0],x=s[D];M=this.chart.scales[D].getPixelForValue(x)}v=this._getYAxisLabelAlignment(f).textAlign}n==="y"&&(c==="start"?F="top":c==="end"&&(F="bottom"));const G=this._getLabelSizes();for(y=0,C=l.length;y<C;++y){b=l[y],S=b.label;const D=i.setContext(this.getContext(y));O=this.getPixelForTick(y)+i.labelOffset,E=this._resolveTickFontOptions(y),I=E.lineHeight,j=tt(S)?S.length:1;const x=j/2,N=D.color,Z=D.textStrokeColor,ee=D.textStrokeWidth;let U=v;a?(M=O,v==="inner"&&(y===C-1?U=this.options.reverse?"left":"right":y===0?U=this.options.reverse?"right":"left":U="center"),s==="top"?d==="near"||p!==0?$=-j*I+I/2:d==="center"?$=-G.highest.height/2-x*I+I:$=-G.highest.height+I/2:d==="near"||p!==0?$=I/2:d==="center"?$=G.highest.height/2-x*I:$=G.highest.height-j*I,h&&($*=-1),p!==0&&!D.showLabelBackdrop&&(M+=I/2*Math.sin(p))):(T=O,$=(1-j)*I/2);let P;if(D.showLabelBackdrop){const V=gn(D.backdropPadding),k=G.heights[y],w=G.widths[y];let B=$-V.top,z=0-V.left;switch(F){case"middle":B-=k/2;break;case"bottom":B-=k;break}switch(v){case"center":z-=w/2;break;case"right":z-=w;break;case"inner":y===C-1?z-=w:y>0&&(z-=w/2);break}P={left:z,top:B,width:w+V.width,height:k+V.height,color:D.backdropColor}}_.push({label:S,font:E,textOffset:$,options:{rotation:p,color:N,strokeColor:Z,strokeWidth:ee,textAlign:U,textBaseline:F,translation:[M,T],backdrop:P}})}return _}_getXAxisLabelAlignment(){const{position:e,ticks:n}=this.options;if(-Qr(this.labelRotation))return e==="top"?"left":"right";let s="center";return n.align==="start"?s="left":n.align==="end"?s="right":n.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(e){const{position:n,ticks:{crossAlign:r,mirror:s,padding:i}}=this.options,a=this._getLabelSizes(),l=e+i,c=a.widest.width;let d,u;return n==="left"?s?(u=this.right+i,r==="near"?d="left":r==="center"?(d="center",u+=c/2):(d="right",u+=c)):(u=this.right-l,r==="near"?d="right":r==="center"?(d="center",u-=c/2):(d="left",u=this.left)):n==="right"?s?(u=this.left+i,r==="near"?d="right":r==="center"?(d="center",u-=c/2):(d="left",u-=c)):(u=this.left+l,r==="near"?d="left":r==="center"?(d="center",u+=c/2):(d="right",u=this.right)):d="right",{textAlign:d,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){const{ctx:e,options:{backgroundColor:n},left:r,top:s,width:i,height:a}=this;n&&(e.save(),e.fillStyle=n,e.fillRect(r,s,i,a),e.restore())}getLineWidthForValue(e){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const s=this.ticks.findIndex(i=>i.value===e);return s>=0?n.setContext(this.getContext(s)).lineWidth:0}drawGrid(e){const n=this.options.grid,r=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let i,a;const l=(c,d,u)=>{!u.width||!u.color||(r.save(),r.lineWidth=u.width,r.strokeStyle=u.color,r.setLineDash(u.borderDash||[]),r.lineDashOffset=u.borderDashOffset,r.beginPath(),r.moveTo(c.x,c.y),r.lineTo(d.x,d.y),r.stroke(),r.restore())};if(n.display)for(i=0,a=s.length;i<a;++i){const c=s[i];n.drawOnChartArea&&l({x:c.x1,y:c.y1},{x:c.x2,y:c.y2},c),n.drawTicks&&l({x:c.tx1,y:c.ty1},{x:c.tx2,y:c.ty2},{color:c.tickColor,width:c.tickWidth,borderDash:c.tickBorderDash,borderDashOffset:c.tickBorderDashOffset})}}drawBorder(){const{chart:e,ctx:n,options:{border:r,grid:s}}=this,i=r.setContext(this.getContext()),a=r.display?i.width:0;if(!a)return;const l=s.setContext(this.getContext(0)).lineWidth,c=this._borderValue;let d,u,h,f;this.isHorizontal()?(d=$s(e,this.left,a)-a/2,u=$s(e,this.right,l)+l/2,h=f=c):(h=$s(e,this.top,a)-a/2,f=$s(e,this.bottom,l)+l/2,d=u=c),n.save(),n.lineWidth=i.width,n.strokeStyle=i.color,n.beginPath(),n.moveTo(d,h),n.lineTo(u,f),n.stroke(),n.restore()}drawLabels(e){if(!this.options.ticks.display)return;const r=this.ctx,s=this._computeLabelArea();s&&du(r,s);const i=this.getLabelItems(e);for(const a of i){const l=a.options,c=a.font,d=a.label,u=a.textOffset;Ga(r,d,0,u,c,l)}s&&uu(r)}drawTitle(){const{ctx:e,options:{position:n,title:r,reverse:s}}=this;if(!r.display)return;const i=rn(r.font),a=gn(r.padding),l=r.align;let c=i.lineHeight/2;n==="bottom"||n==="center"||ve(n)?(c+=a.bottom,tt(r.text)&&(c+=i.lineHeight*(r.text.length-1))):c+=a.top;const{titleX:d,titleY:u,maxWidth:h,rotation:f}=ex(this,c,n,l);Ga(e,r.text,0,0,i,{color:r.color,maxWidth:h,rotation:f,textAlign:JC(l,n,s),textBaseline:"middle",translation:[d,u]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){const e=this.options,n=e.ticks&&e.ticks.z||0,r=Ae(e.grid&&e.grid.z,-1),s=Ae(e.border&&e.border.z,0);return!this._isVisible()||this.draw!==As.prototype.draw?[{z:n,draw:i=>{this.draw(i)}}]:[{z:r,draw:i=>{this.drawBackground(),this.drawGrid(i),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:n,draw:i=>{this.drawLabels(i)}}]}getMatchingVisibleMetas(e){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",s=[];let i,a;for(i=0,a=n.length;i<a;++i){const l=n[i];l[r]===this.id&&(!e||l.type===e)&&s.push(l)}return s}_resolveTickFontOptions(e){const n=this.options.ticks.setContext(this.getContext(e));return rn(n.font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class al{constructor(e,n,r){this.type=e,this.scope=n,this.override=r,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){const n=Object.getPrototypeOf(e);let r;rx(n)&&(r=this.register(n));const s=this.items,i=e.id,a=this.scope+"."+i;if(!i)throw new Error("class does not have id: "+e);return i in s||(s[i]=e,tx(e,a,r),this.override&&mt.override(e.id,e.overrides)),a}get(e){return this.items[e]}unregister(e){const n=this.items,r=e.id,s=this.scope;r in n&&delete n[r],s&&r in mt[s]&&(delete mt[s][r],this.override&&delete Es[r])}}function tx(t,e,n){const r=bo(Object.create(null),[n?mt.get(n):{},mt.get(e),t.defaults]);mt.set(e,r),t.defaultRoutes&&nx(e,t.defaultRoutes),t.descriptors&&mt.describe(e,t.descriptors)}function nx(t,e){Object.keys(e).forEach(n=>{const r=n.split("."),s=r.pop(),i=[t].concat(r).join("."),a=e[n].split("."),l=a.pop(),c=a.join(".");mt.route(i,s,c,l)})}function rx(t){return"id"in t&&"defaults"in t}class sx{constructor(){this.controllers=new al(Do,"datasets",!0),this.elements=new al(Bs,"elements"),this.plugins=new al(Object,"plugins"),this.scales=new al(As,"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,n,r){[...n].forEach(s=>{const i=r||this._getRegistryForType(s);r||i.isForType(s)||i===this.plugins&&s.id?this._exec(e,i,s):Re(s,a=>{const l=r||this._getRegistryForType(a);this._exec(e,l,a)})})}_exec(e,n,r){const s=eu(e);ot(r["before"+s],[],r),n[e](r),ot(r["after"+s],[],r)}_getRegistryForType(e){for(let n=0;n<this._typedRegistries.length;n++){const r=this._typedRegistries[n];if(r.isForType(e))return r}return this.plugins}_get(e,n,r){const s=n.get(e);if(s===void 0)throw new Error('"'+e+'" is not a registered '+r+".");return s}}var Xn=new sx;class ix{constructor(){this._init=[]}notify(e,n,r,s){n==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install"));const i=s?this._descriptors(e).filter(s):this._descriptors(e),a=this._notify(i,e,n,r);return n==="afterDestroy"&&(this._notify(i,e,"stop"),this._notify(this._init,e,"uninstall")),a}_notify(e,n,r,s){s=s||{};for(const i of e){const a=i.plugin,l=a[r],c=[n,s,i.options];if(ot(l,c,a)===!1&&s.cancelable)return!1}return!0}invalidate(){Ze(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),n}_createDescriptors(e,n){const r=e&&e.config,s=Ae(r.options&&r.options.plugins,{}),i=ox(r);return s===!1&&!n?[]:lx(e,i,s,n)}_notifyStateChanges(e){const n=this._oldCache||[],r=this._cache,s=(i,a)=>i.filter(l=>!a.some(c=>l.plugin.id===c.plugin.id));this._notify(s(n,r),e,"stop"),this._notify(s(r,n),e,"start")}}function ox(t){const e={},n=[],r=Object.keys(Xn.plugins.items);for(let i=0;i<r.length;i++)n.push(Xn.getPlugin(r[i]));const s=t.plugins||[];for(let i=0;i<s.length;i++){const a=s[i];n.indexOf(a)===-1&&(n.push(a),e[a.id]=!0)}return{plugins:n,localIds:e}}function ax(t,e){return!e&&t===!1?null:t===!0?{}:t}function lx(t,{plugins:e,localIds:n},r,s){const i=[],a=t.getContext();for(const l of e){const c=l.id,d=ax(r[c],s);d!==null&&i.push({plugin:l,options:cx(t.config,{plugin:l,local:n[c]},d,a)})}return i}function cx(t,{plugin:e,local:n},r,s){const i=t.pluginScopeKeys(e),a=t.getOptionScopes(r,i);return n&&e.defaults&&a.push(e.defaults),t.createResolver(a,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function vu(t,e){const n=mt.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||n.indexAxis||"x"}function dx(t,e){let n=t;return t==="_index_"?n=e:t==="_value_"&&(n=e==="x"?"y":"x"),n}function ux(t,e){return t===e?"_index_":"_value_"}function G2(t){if(t==="x"||t==="y"||t==="r")return t}function hx(t){if(t==="top"||t==="bottom")return"x";if(t==="left"||t==="right")return"y"}function Su(t,...e){if(G2(t))return t;for(const n of e){const r=n.axis||hx(n.position)||t.length>1&&G2(t[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function K2(t,e,n){if(n[e+"AxisID"]===t)return{axis:e}}function fx(t,e){if(e.data&&e.data.datasets){const n=e.data.datasets.filter(r=>r.xAxisID===t||r.yAxisID===t);if(n.length)return K2(t,"x",n[0])||K2(t,"y",n[0])}return{}}function mx(t,e){const n=Es[t.type]||{scales:{}},r=e.scales||{},s=vu(t.type,e),i=Object.create(null);return Object.keys(r).forEach(a=>{const l=r[a];if(!ve(l))return console.error(`Invalid scale configuration for scale: ${a}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const c=Su(a,l,fx(a,t),mt.scales[l.type]),d=ux(c,s),u=n.scales||{};i[a]=ko(Object.create(null),[{axis:c},l,u[c],u[d]])}),t.data.datasets.forEach(a=>{const l=a.type||t.type,c=a.indexAxis||vu(l,e),u=(Es[l]||{}).scales||{};Object.keys(u).forEach(h=>{const f=dx(h,c),m=a[f+"AxisID"]||f;i[m]=i[m]||Object.create(null),ko(i[m],[{axis:f},r[m],u[h]])})}),Object.keys(i).forEach(a=>{const l=i[a];ko(l,[mt.scales[l.type],mt.scale])}),i}function X2(t){const e=t.options||(t.options={});e.plugins=Ae(e.plugins,{}),e.scales=mx(t,e)}function Q2(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function px(t){return t=t||{},t.data=Q2(t.data),X2(t),t}const J2=new Map,em=new Set;function ll(t,e){let n=J2.get(t);return n||(n=e(),J2.set(t,n),em.add(n)),n}const Vo=(t,e,n)=>{const r=Ya(e,n);r!==void 0&&t.add(r)};class gx{constructor(e){this._config=px(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=Q2(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(),X2(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return ll(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,n){return ll(`${e}.transition.${n}`,()=>[[`datasets.${e}.transitions.${n}`,`transitions.${n}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,n){return ll(`${e}-${n}`,()=>[[`datasets.${e}.elements.${n}`,`datasets.${e}`,`elements.${n}`,""]])}pluginScopeKeys(e){const n=e.id,r=this.type;return ll(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,n){const r=this._scopeCache;let s=r.get(e);return(!s||n)&&(s=new Map,r.set(e,s)),s}getOptionScopes(e,n,r){const{options:s,type:i}=this,a=this._cachedScopes(e,r),l=a.get(n);if(l)return l;const c=new Set;n.forEach(u=>{e&&(c.add(e),u.forEach(h=>Vo(c,e,h))),u.forEach(h=>Vo(c,s,h)),u.forEach(h=>Vo(c,Es[i]||{},h)),u.forEach(h=>Vo(c,mt,h)),u.forEach(h=>Vo(c,au,h))});const d=Array.from(c);return d.length===0&&d.push(Object.create(null)),em.has(n)&&a.set(n,d),d}chartOptionScopes(){const{options:e,type:n}=this;return[e,Es[n]||{},mt.datasets[n]||{},{type:n},mt,au]}resolveNamedOptions(e,n,r,s=[""]){const i={$shared:!0},{resolver:a,subPrefixes:l}=tm(this._resolverCache,e,s);let c=a;if(yx(a,n)){i.$shared=!1,r=Kr(r)?r():r;const d=this.createResolver(e,r,l);c=bi(a,r,d)}for(const d of n)i[d]=c[d];return i}createResolver(e,n,r=[""],s){const{resolver:i}=tm(this._resolverCache,e,r);return ve(n)?bi(i,n,void 0,s):i}}function tm(t,e,n){let r=t.get(e);r||(r=new Map,t.set(e,r));const s=n.join();let i=r.get(s);return i||(i={resolver:fu(e,n),subPrefixes:n.filter(l=>!l.toLowerCase().includes("hover"))},r.set(s,i)),i}const _x=t=>ve(t)&&Object.getOwnPropertyNames(t).some(e=>Kr(t[e]));function yx(t,e){const{isScriptable:n,isIndexable:r}=d2(t);for(const s of e){const i=n(s),a=r(s),l=(a||i)&&t[s];if(i&&(Kr(l)||_x(l))||a&&tt(l))return!0}return!1}var wx="4.4.2";const bx=["top","bottom","left","right","chartArea"];function nm(t,e){return t==="top"||t==="bottom"||bx.indexOf(t)===-1&&e==="x"}function rm(t,e){return function(n,r){return n[t]===r[t]?n[e]-r[e]:n[t]-r[t]}}function sm(t){const e=t.chart,n=e.options.animation;e.notifyPlugins("afterRender"),ot(n&&n.onComplete,[t],e)}function kx(t){const e=t.chart,n=e.options.animation;ot(n&&n.onProgress,[t],e)}function im(t){return gu()&&typeof t=="string"?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const cl={},om=t=>{const e=im(t);return Object.values(cl).filter(n=>n.canvas===e).pop()};function Cx(t,e,n){const r=Object.keys(t);for(const s of r){const i=+s;if(i>=e){const a=t[s];delete t[s],(n>0||i>e)&&(t[i+n]=a)}}}function xx(t,e,n,r){return!n||t.type==="mouseout"?null:r?e:t}function dl(t,e,n){return t.options.clip?t[n]:e[n]}function Mx(t,e){const{xScale:n,yScale:r}=t;return n&&r?{left:dl(n,e,"left"),right:dl(n,e,"right"),top:dl(r,e,"top"),bottom:dl(r,e,"bottom")}:e}let Bo=(ls=class{static register(...e){Xn.add(...e),am()}static unregister(...e){Xn.remove(...e),am()}constructor(e,n){const r=this.config=new gx(n),s=im(e),i=om(s);if(i)throw new Error("Canvas is already in use. Chart with ID '"+i.id+"' must be destroyed before the canvas with ID '"+i.canvas.id+"' can be reused.");const a=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||zC(s)),this.platform.updateConfig(r);const l=this.platform.acquireContext(s,a.aspectRatio),c=l&&l.canvas,d=c&&c.height,u=c&&c.width;if(this.id=Eb(),this.ctx=l,this.canvas=c,this.width=u,this.height=d,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new ix,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=qb(h=>this.update(h),a.resizeDelay||0),this._dataChanges=[],cl[this.id]=this,!l||!c){console.error("Failed to create chart: can't acquire context from the given item");return}gr.listen(this,"complete",sm),gr.listen(this,"progress",kx),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:n},width:r,height:s,_aspectRatio:i}=this;return Ze(e)?n&&i?i:s?r/s: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 Xn}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():_2(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return l2(this.canvas,this.ctx),this}stop(){return gr.stop(this),this}resize(e,n){gr.running(this)?this._resizeBeforeDraw={width:e,height:n}:this._resize(e,n)}_resize(e,n){const r=this.options,s=this.canvas,i=r.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(s,e,n,i),l=r.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,_2(this,l,!0)&&(this.notifyPlugins("resize",{size:a}),ot(r.onResize,[this,a],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Re(n,(r,s)=>{r.id=s})}buildOrUpdateScales(){const e=this.options,n=e.scales,r=this.scales,s=Object.keys(r).reduce((a,l)=>(a[l]=!1,a),{});let i=[];n&&(i=i.concat(Object.keys(n).map(a=>{const l=n[a],c=Su(a,l),d=c==="r",u=c==="x";return{options:l,dposition:d?"chartArea":u?"bottom":"left",dtype:d?"radialLinear":u?"category":"linear"}}))),Re(i,a=>{const l=a.options,c=l.id,d=Su(c,l),u=Ae(l.type,a.dtype);(l.position===void 0||nm(l.position,d)!==nm(a.dposition))&&(l.position=a.dposition),s[c]=!0;let h=null;if(c in r&&r[c].type===u)h=r[c];else{const f=Xn.getScale(u);h=new f({id:c,type:u,ctx:this.ctx,chart:this}),r[h.id]=h}h.init(l,e)}),Re(s,(a,l)=>{a||delete r[l]}),Re(r,a=>{rl.configure(this,a,a.options),rl.addBox(this,a)})}_updateMetasets(){const e=this._metasets,n=this.data.datasets.length,r=e.length;if(e.sort((s,i)=>s.index-i.index),r>n){for(let s=n;s<r;++s)this._destroyDatasetMeta(s);e.splice(n,r-n)}this._sortedMetasets=e.slice(0).sort(rm("order","index"))}_removeUnreferencedMetasets(){const{_metasets:e,data:{datasets:n}}=this;e.length>n.length&&delete this._stacks,e.forEach((r,s)=>{n.filter(i=>i===r._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const e=[],n=this.data.datasets;let r,s;for(this._removeUnreferencedMetasets(),r=0,s=n.length;r<s;r++){const i=n[r];let a=this.getDatasetMeta(r);const l=i.type||this.config.type;if(a.type&&a.type!==l&&(this._destroyDatasetMeta(r),a=this.getDatasetMeta(r)),a.type=l,a.indexAxis=i.indexAxis||vu(l,this.options),a.order=i.order||0,a.index=r,a.label=""+i.label,a.visible=this.isDatasetVisible(r),a.controller)a.controller.updateIndex(r),a.controller.linkScales();else{const c=Xn.getController(l),{datasetElementType:d,dataElementType:u}=mt.datasets[l];Object.assign(c,{dataElementType:Xn.getElement(u),datasetElementType:d&&Xn.getElement(d)}),a.controller=new c(this,r),e.push(a.controller)}}return this._updateMetasets(),e}_resetElements(){Re(this.data.datasets,(e,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const n=this.config;n.update();const r=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const i=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let d=0,u=this.data.datasets.length;d<u;d++){const{controller:h}=this.getDatasetMeta(d),f=!s&&i.indexOf(h)===-1;h.buildOrUpdateElements(f),a=Math.max(+h.getMaxOverflow(),a)}a=this._minPadding=r.layout.autoPadding?a:0,this._updateLayout(a),s||Re(i,d=>{d.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(rm("z","_idx"));const{_active:l,_lastEvent:c}=this;c?this._eventHandler(c,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){Re(this.scales,e=>{rl.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(e.events);(!j0(n,r)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:s,count:i}of n){const a=r==="_removeElements"?-i:i;Cx(e,s,a)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=i=>new Set(e.filter(a=>a[0]===i).map((a,l)=>l+","+a.splice(1).join(","))),s=r(0);for(let i=1;i<n;i++)if(!j0(s,r(i)))return;return Array.from(s).map(i=>i.split(",")).map(i=>({method:i[1],start:+i[2],count:+i[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;rl.update(this,this.width,this.height,e);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],Re(this.boxes,s=>{r&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,i)=>{s._idx=i}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n<r;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,r=this.data.datasets.length;n<r;++n)this._updateDataset(n,Kr(e)?e({datasetIndex:n}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,n){const r=this.getDatasetMeta(e),s={meta:r,index:e,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(r.controller._update(n),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(gr.has(this)?this.attached&&!gr.running(this)&&gr.start(this):(this.draw(),sm({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){const{width:r,height:s}=this._resizeBeforeDraw;this._resize(r,s),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(e=0;e<n.length&&n[e].z<=0;++e)n[e].draw(this.chartArea);for(this._drawDatasets();e<n.length;++e)n[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(e){const n=this._sortedMetasets,r=[];let s,i;for(s=0,i=n.length;s<i;++s){const a=n[s];(!e||a.visible)&&r.push(a)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const e=this.getSortedVisibleDatasetMetas();for(let n=e.length-1;n>=0;--n)this._drawDataset(e[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const n=this.ctx,r=e._clip,s=!r.disabled,i=Mx(e,this.chartArea),a={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",a)!==!1&&(s&&du(n,{left:r.left===!1?0:i.left-r.left,right:r.right===!1?this.width:i.right+r.right,top:r.top===!1?0:i.top-r.top,bottom:r.bottom===!1?this.height:i.bottom+r.bottom}),e.controller.draw(),s&&uu(n),a.cancelable=!1,this.notifyPlugins("afterDatasetDraw",a))}isPointInArea(e){return pr(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,n,r,s){const i=bC.modes[n];return typeof i=="function"?i(this,e,r,s):[]}getDatasetMeta(e){const n=this.data.datasets[e],r=this._metasets;let s=r.filter(i=>i&&i._dataset===n).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:e,_dataset:n,_parsed:[],_sorted:!1},r.push(s)),s}getContext(){return this.$context||(this.$context=Jr(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const n=this.data.datasets[e];if(!n)return!1;const r=this.getDatasetMeta(e);return typeof r.hidden=="boolean"?!r.hidden:!n.hidden}setDatasetVisibility(e,n){const r=this.getDatasetMeta(e);r.hidden=!n}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,n,r){const s=r?"show":"hide",i=this.getDatasetMeta(e),a=i.controller._resolveAnimations(void 0,s);Wa(n)?(i.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(e,r),a.update(i,{visible:r}),this.update(l=>l.datasetIndex===e?s:void 0))}hide(e,n){this._updateVisibility(e,n,!1)}show(e,n){this._updateVisibility(e,n,!0)}_destroyDatasetMeta(e){const n=this._metasets[e];n&&n.controller&&n.controller._destroy(),delete this._metasets[e]}_stop(){let e,n;for(this.stop(),gr.remove(this),e=0,n=this.data.datasets.length;e<n;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:e,ctx:n}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),l2(e,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete cl[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,n=this.platform,r=(i,a)=>{n.addEventListener(this,i,a),e[i]=a},s=(i,a,l)=>{i.offsetX=a,i.offsetY=l,this._eventHandler(i)};Re(this.options.events,i=>r(i,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,n=this.platform,r=(c,d)=>{n.addEventListener(this,c,d),e[c]=d},s=(c,d)=>{e[c]&&(n.removeEventListener(this,c,d),delete e[c])},i=(c,d)=>{this.canvas&&this.resize(c,d)};let a;const l=()=>{s("attach",l),this.attached=!0,this.resize(),r("resize",i),r("detach",a)};a=()=>{this.attached=!1,s("resize",i),this._stop(),this._resize(0,0),r("attach",l)},n.isAttached(this.canvas)?l():a()}unbindEvents(){Re(this._listeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._listeners={},Re(this._responsiveListeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,n,r){const s=r?"set":"remove";let i,a,l,c;for(n==="dataset"&&(i=this.getDatasetMeta(e[0].datasetIndex),i.controller["_"+s+"DatasetHoverStyle"]()),l=0,c=e.length;l<c;++l){a=e[l];const d=a&&this.getDatasetMeta(a.datasetIndex).controller;d&&d[s+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const n=this._active||[],r=e.map(({datasetIndex:i,index:a})=>{const l=this.getDatasetMeta(i);if(!l)throw new Error("No dataset found at index "+i);return{datasetIndex:i,element:l.data[a],index:a}});!za(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}notifyPlugins(e,n,r){return this._plugins.notify(this,e,n,r)}isPluginEnabled(e){return this._plugins._cache.filter(n=>n.plugin.id===e).length===1}_updateHoverStyles(e,n,r){const s=this.options.hover,i=(c,d)=>c.filter(u=>!d.some(h=>u.datasetIndex===h.datasetIndex&&u.index===h.index)),a=i(n,e),l=r?e:i(e,n);a.length&&this.updateHoverStyle(a,s.mode,!1),l.length&&s.mode&&this.updateHoverStyle(l,s.mode,!0)}_eventHandler(e,n){const r={event:e,replay:n,cancelable:!0,inChartArea:this.isPointInArea(e)},s=a=>(a.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",r,s)===!1)return;const i=this._handleEvent(e,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,s),(i||r.changed)&&this.render(),this}_handleEvent(e,n,r){const{_active:s=[],options:i}=this,a=n,l=this._getActiveElements(e,s,r,a),c=Bb(e),d=xx(e,this._lastEvent,r,c);r&&(this._lastEvent=null,ot(i.onHover,[e,l,this],this),c&&ot(i.onClick,[e,l,this],this));const u=!za(l,s);return(u||n)&&(this._active=l,this._updateHoverStyles(l,s,n)),this._lastEvent=d,u}_getActiveElements(e,n,r,s){if(e.type==="mouseout")return[];if(!r)return n;const i=this.options.hover;return this.getElementsAtEventForMode(e,i.mode,i,s)}},W(ls,"defaults",mt),W(ls,"instances",cl),W(ls,"overrides",Es),W(ls,"registry",Xn),W(ls,"version",wx),W(ls,"getChart",om),ls);function am(){return Re(Bo.instances,t=>t._plugins.invalidate())}function lm(t,e,n=e){t.lineCap=Ae(n.borderCapStyle,e.borderCapStyle),t.setLineDash(Ae(n.borderDash,e.borderDash)),t.lineDashOffset=Ae(n.borderDashOffset,e.borderDashOffset),t.lineJoin=Ae(n.borderJoinStyle,e.borderJoinStyle),t.lineWidth=Ae(n.borderWidth,e.borderWidth),t.strokeStyle=Ae(n.borderColor,e.borderColor)}function vx(t,e,n){t.lineTo(n.x,n.y)}function Sx(t){return t.stepped?ck:t.tension||t.cubicInterpolationMode==="monotone"?dk:vx}function cm(t,e,n={}){const r=t.length,{start:s=0,end:i=r-1}=n,{start:a,end:l}=e,c=Math.max(s,a),d=Math.min(i,l),u=s<a&&i<a||s>l&&i>l;return{count:r,start:c,loop:e.loop,ilen:d<c&&!u?r+d-c:d-c}}function Tx(t,e,n,r){const{points:s,options:i}=e,{count:a,start:l,loop:c,ilen:d}=cm(s,n,r),u=Sx(i);let{move:h=!0,reverse:f}=r||{},m,g,p;for(m=0;m<=d;++m)g=s[(l+(f?d-m:m))%a],!g.skip&&(h?(t.moveTo(g.x,g.y),h=!1):u(t,p,g,f,i.stepped),p=g);return c&&(g=s[(l+(f?d:0))%a],u(t,p,g,f,i.stepped)),!!c}function Dx(t,e,n,r){const s=e.points,{count:i,start:a,ilen:l}=cm(s,n,r),{move:c=!0,reverse:d}=r||{};let u=0,h=0,f,m,g,p,_,y;const C=S=>(a+(d?l-S:S))%i,b=()=>{p!==_&&(t.lineTo(u,_),t.lineTo(u,p),t.lineTo(u,y))};for(c&&(m=s[C(0)],t.moveTo(m.x,m.y)),f=0;f<=l;++f){if(m=s[C(f)],m.skip)continue;const S=m.x,M=m.y,T=S|0;T===g?(M<p?p=M:M>_&&(_=M),u=(h*u+S)/++h):(b(),t.lineTo(S,M),g=T,h=0,p=_=M),y=M}b()}function Tu(t){const e=t.options,n=e.borderDash&&e.borderDash.length;return!t._decimated&&!t._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!n?Dx:Tx}function Ox(t){return t.stepped?Yk:t.tension||t.cubicInterpolationMode==="monotone"?Wk:Ns}function Ex(t,e,n,r){let s=e._path;s||(s=e._path=new Path2D,e.path(s,n,r)&&s.closePath()),lm(t,e.options),t.stroke(s)}function $x(t,e,n,r){const{segments:s,options:i}=e,a=Tu(e);for(const l of s)lm(t,i,l.style),t.beginPath(),a(t,e,l,{start:n,end:n+r-1})&&t.closePath(),t.stroke()}const Px=typeof Path2D=="function";function Lx(t,e,n,r){Px&&!e.options.segment?Ex(t,e,n,r):$x(t,e,n,r)}class _r extends Bs{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,n){const r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){const s=r.spanGaps?this._loop:this._fullLoop;Vk(this._points,r,e,s,n),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=Qk(this,this.options.segment))}first(){const e=this.segments,n=this.points;return e.length&&n[e[0].start]}last(){const e=this.segments,n=this.points,r=e.length;return r&&n[e[r-1].end]}interpolate(e,n){const r=this.options,s=e[n],i=this.points,a=C2(this,{property:n,start:s,end:s});if(!a.length)return;const l=[],c=Ox(r);let d,u;for(d=0,u=a.length;d<u;++d){const{start:h,end:f}=a[d],m=i[h],g=i[f];if(m===g){l.push(m);continue}const p=Math.abs((s-m[n])/(g[n]-m[n])),_=c(m,g,p,r.stepped);_[n]=e[n],l.push(_)}return l.length===1?l[0]:l}pathSegment(e,n,r){return Tu(this)(e,this,n,r)}path(e,n,r){const s=this.segments,i=Tu(this);let a=this._loop;n=n||0,r=r||this.points.length-n;for(const l of s)a&=i(e,this,l,{start:n,end:n+r-1});return!!a}draw(e,n,r,s){const i=this.options||{};(this.points||[]).length&&i.borderWidth&&(e.save(),Lx(e,this,r,s),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}W(_r,"id","line"),W(_r,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),W(_r,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),W(_r,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"&&e!=="fill"});function dm(t,e,n,r){const s=t.options,{[n]:i}=t.getProps([n],r);return Math.abs(e-i)<s.radius+s.hitRadius}class Ao extends Bs{constructor(n){super();W(this,"parsed");W(this,"skip");W(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,n&&Object.assign(this,n)}inRange(n,r,s){const i=this.options,{x:a,y:l}=this.getProps(["x","y"],s);return Math.pow(n-a,2)+Math.pow(r-l,2)<Math.pow(i.hitRadius+i.radius,2)}inXRange(n,r){return dm(this,n,"x",r)}inYRange(n,r){return dm(this,n,"y",r)}getCenterPoint(n){const{x:r,y:s}=this.getProps(["x","y"],n);return{x:r,y:s}}size(n){n=n||this.options||{};let r=n.radius||0;r=Math.max(r,r&&n.hoverRadius||0);const s=r&&n.borderWidth||0;return(r+s)*2}draw(n,r){const s=this.options;this.skip||s.radius<.1||!pr(this,r,this.size(s)/2)||(n.strokeStyle=s.borderColor,n.lineWidth=s.borderWidth,n.fillStyle=s.backgroundColor,cu(n,s,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}W(Ao,"id","point"),W(Ao,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),W(Ao,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Nx(t,e,n){const r=t.segments,s=t.points,i=e.points,a=[];for(const l of r){let{start:c,end:d}=l;d=Ou(c,d,s);const u=Du(n,s[c],s[d],l.loop);if(!e.segments){a.push({source:l,target:u,start:s[c],end:s[d]});continue}const h=C2(e,u);for(const f of h){const m=Du(n,i[f.start],i[f.end],f.loop),g=k2(l,s,m);for(const p of g)a.push({source:p,target:f,start:{[n]:um(u,m,"start",Math.max)},end:{[n]:um(u,m,"end",Math.min)}})}}return a}function Du(t,e,n,r){if(r)return;let s=e[t],i=n[t];return t==="angle"&&(s=nn(s),i=nn(i)),{property:t,start:s,end:i}}function Vx(t,e){const{x:n=null,y:r=null}=t||{},s=e.points,i=[];return e.segments.forEach(({start:a,end:l})=>{l=Ou(a,l,s);const c=s[a],d=s[l];r!==null?(i.push({x:c.x,y:r}),i.push({x:d.x,y:r})):n!==null&&(i.push({x:n,y:c.y}),i.push({x:n,y:d.y}))}),i}function Ou(t,e,n){for(;e>t;e--){const r=n[e];if(!isNaN(r.x)&&!isNaN(r.y))break}return e}function um(t,e,n,r){return t&&e?r(t[n],e[n]):t?t[n]:e?e[n]:0}function hm(t,e){let n=[],r=!1;return tt(t)?(r=!0,n=t):n=Vx(t,e),n.length?new _r({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function fm(t){return t&&t.fill!==!1}function Bx(t,e,n){let s=t[e].fill;const i=[e];let a;if(!n)return s;for(;s!==!1&&i.indexOf(s)===-1;){if(!it(s))return s;if(a=t[s],!a)return!1;if(a.visible)return s;i.push(s),s=a.fill}return!1}function Ax(t,e,n){const r=zx(t);if(ve(r))return isNaN(r.value)?!1:r;let s=parseFloat(r);return it(s)&&Math.floor(s)===s?Rx(r[0],e,s,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function Rx(t,e,n,r){return(t==="-"||t==="+")&&(n=e+n),n===e||n<0||n>=r?!1:n}function Fx(t,e){let n=null;return t==="start"?n=e.bottom:t==="end"?n=e.top:ve(t)?n=e.getPixelForValue(t.value):e.getBasePixel&&(n=e.getBasePixel()),n}function Ix(t,e,n){let r;return t==="start"?r=n:t==="end"?r=e.options.reverse?e.min:e.max:ve(t)?r=t.value:r=e.getBaseValue(),r}function zx(t){const e=t.options,n=e.fill;let r=Ae(n&&n.target,n);return r===void 0&&(r=!!e.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function Hx(t){const{scale:e,index:n,line:r}=t,s=[],i=r.segments,a=r.points,l=Yx(e,n);l.push(hm({x:null,y:e.bottom},r));for(let c=0;c<i.length;c++){const d=i[c];for(let u=d.start;u<=d.end;u++)Wx(s,a[u],l)}return new _r({points:s,options:{}})}function Yx(t,e){const n=[],r=t.getMatchingVisibleMetas("line");for(let s=0;s<r.length;s++){const i=r[s];if(i.index===e)break;i.hidden||n.unshift(i.dataset)}return n}function Wx(t,e,n){const r=[];for(let s=0;s<n.length;s++){const i=n[s],{first:a,last:l,point:c}=jx(i,e,"x");if(!(!c||a&&l)){if(a)r.unshift(c);else if(t.push(c),!l)break}}t.push(...r)}function jx(t,e,n){const r=t.interpolate(e,n);if(!r)return{};const s=r[n],i=t.segments,a=t.points;let l=!1,c=!1;for(let d=0;d<i.length;d++){const u=i[d],h=a[u.start][n],f=a[u.end][n];if(X0(s,h,f)){l=s===h,c=s===f;break}}return{first:l,last:c,point:r}}class mm{constructor(e){this.x=e.x,this.y=e.y,this.radius=e.radius}pathSegment(e,n,r){const{x:s,y:i,radius:a}=this;return n=n||{start:0,end:en},e.arc(s,i,a,n.end,n.start,!0),!r.bounds}interpolate(e){const{x:n,y:r,radius:s}=this,i=e.angle;return{x:n+Math.cos(i)*s,y:r+Math.sin(i)*s,angle:i}}}function Zx(t){const{chart:e,fill:n,line:r}=t;if(it(n))return Ux(e,n);if(n==="stack")return Hx(t);if(n==="shape")return!0;const s=qx(t);return s instanceof mm?s:hm(s,r)}function Ux(t,e){const n=t.getDatasetMeta(e);return n&&t.isDatasetVisible(e)?n.dataset:null}function qx(t){return(t.scale||{}).getPointPositionForValue?Kx(t):Gx(t)}function Gx(t){const{scale:e={},fill:n}=t,r=Fx(n,e);if(it(r)){const s=e.isHorizontal();return{x:s?r:null,y:s?null:r}}return null}function Kx(t){const{scale:e,fill:n}=t,r=e.options,s=e.getLabels().length,i=r.reverse?e.max:e.min,a=Ix(n,e,i),l=[];if(r.grid.circular){const c=e.getPointPositionForValue(0,i);return new mm({x:c.x,y:c.y,radius:e.getDistanceFromCenterForValue(a)})}for(let c=0;c<s;++c)l.push(e.getPointPositionForValue(c,a));return l}function Eu(t,e,n){const r=Zx(e),{line:s,scale:i,axis:a}=e,l=s.options,c=l.fill,d=l.backgroundColor,{above:u=d,below:h=d}=c||{};r&&s.points.length&&(du(t,n),Xx(t,{line:s,target:r,above:u,below:h,area:n,scale:i,axis:a}),uu(t))}function Xx(t,e){const{line:n,target:r,above:s,below:i,area:a,scale:l}=e,c=n._loop?"angle":e.axis;t.save(),c==="x"&&i!==s&&(pm(t,r,a.top),gm(t,{line:n,target:r,color:s,scale:l,property:c}),t.restore(),t.save(),pm(t,r,a.bottom)),gm(t,{line:n,target:r,color:i,scale:l,property:c}),t.restore()}function pm(t,e,n){const{segments:r,points:s}=e;let i=!0,a=!1;t.beginPath();for(const l of r){const{start:c,end:d}=l,u=s[c],h=s[Ou(c,d,s)];i?(t.moveTo(u.x,u.y),i=!1):(t.lineTo(u.x,n),t.lineTo(u.x,u.y)),a=!!e.pathSegment(t,l,{move:a}),a?t.closePath():t.lineTo(h.x,n)}t.lineTo(e.first().x,n),t.closePath(),t.clip()}function gm(t,e){const{line:n,target:r,property:s,color:i,scale:a}=e,l=Nx(n,r,s);for(const{source:c,target:d,start:u,end:h}of l){const{style:{backgroundColor:f=i}={}}=c,m=r!==!0;t.save(),t.fillStyle=f,Qx(t,a,m&&Du(s,u,h)),t.beginPath();const g=!!n.pathSegment(t,c);let p;if(m){g?t.closePath():_m(t,r,h,s);const _=!!r.pathSegment(t,d,{move:g,reverse:!0});p=g&&_,p||_m(t,r,u,s)}t.closePath(),t.fill(p?"evenodd":"nonzero"),t.restore()}}function Qx(t,e,n){const{top:r,bottom:s}=e.chart.chartArea,{property:i,start:a,end:l}=n||{};i==="x"&&(t.beginPath(),t.rect(a,r,l-a,s-r),t.clip())}function _m(t,e,n,r){const s=e.interpolate(n,r);s&&t.lineTo(s.x,s.y)}var ym={id:"filler",afterDatasetsUpdate(t,e,n){const r=(t.data.datasets||[]).length,s=[];let i,a,l,c;for(a=0;a<r;++a)i=t.getDatasetMeta(a),l=i.dataset,c=null,l&&l.options&&l instanceof _r&&(c={visible:t.isDatasetVisible(a),index:a,fill:Ax(l,a,r),chart:t,axis:i.controller.options.indexAxis,scale:i.vScale,line:l}),i.$filler=c,s.push(c);for(a=0;a<r;++a)c=s[a],!(!c||c.fill===!1)&&(c.fill=Bx(s,a,n.propagate))},beforeDraw(t,e,n){const r=n.drawTime==="beforeDraw",s=t.getSortedVisibleDatasetMetas(),i=t.chartArea;for(let a=s.length-1;a>=0;--a){const l=s[a].$filler;l&&(l.line.updateControlPoints(i,l.axis),r&&l.fill&&Eu(t.ctx,l,i))}},beforeDatasetsDraw(t,e,n){if(n.drawTime!=="beforeDatasetsDraw")return;const r=t.getSortedVisibleDatasetMetas();for(let s=r.length-1;s>=0;--s){const i=r[s].$filler;fm(i)&&Eu(t.ctx,i,t.chartArea)}},beforeDatasetDraw(t,e,n){const r=e.meta.$filler;!fm(r)||n.drawTime!=="beforeDatasetDraw"||Eu(t.ctx,r,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Ro={average(t){if(!t.length)return!1;let e,n,r=new Set,s=0,i=0;for(e=0,n=t.length;e<n;++e){const l=t[e].element;if(l&&l.hasValue()){const c=l.tooltipPosition();r.add(c.x),s+=c.y,++i}}return{x:[...r].reduce((l,c)=>l+c)/r.size,y:s/i}},nearest(t,e){if(!t.length)return!1;let n=e.x,r=e.y,s=Number.POSITIVE_INFINITY,i,a,l;for(i=0,a=t.length;i<a;++i){const c=t[i].element;if(c&&c.hasValue()){const d=c.getCenterPoint(),u=nu(e,d);u<s&&(s=u,l=c)}}if(l){const c=l.tooltipPosition();n=c.x,r=c.y}return{x:n,y:r}}};function Qn(t,e){return e&&(tt(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function yr(t){return(typeof t=="string"||t instanceof String)&&t.indexOf(`
|
|
33
33
|
`)>-1?t.split(`
|
|
34
|
-
`):t}function Jx(t,e){const{element:n,datasetIndex:r,index:s}=e,i=t.getDatasetMeta(r).controller,{label:a,value:l}=i.getLabelAndValue(s);return{chart:t,label:a,parsed:i.getParsed(s),raw:t.data.datasets[r].data[s],formattedValue:l,dataset:i.getDataset(),dataIndex:s,datasetIndex:r,element:n}}function wm(t,e){const n=t.chart.ctx,{body:r,footer:s,title:i}=t,{boxWidth:a,boxHeight:l}=e,c=rn(e.bodyFont),d=rn(e.titleFont),u=rn(e.footerFont),h=i.length,f=s.length,m=r.length,g=gn(e.padding);let p=g.height,_=0,y=r.reduce((S,M)=>S+M.before.length+M.lines.length+M.after.length,0);if(y+=t.beforeBody.length+t.afterBody.length,h&&(p+=h*d.lineHeight+(h-1)*e.titleSpacing+e.titleMarginBottom),y){const S=e.displayColors?Math.max(l,c.lineHeight):c.lineHeight;p+=m*S+(y-m)*c.lineHeight+(y-1)*e.bodySpacing}f&&(p+=e.footerMarginTop+f*u.lineHeight+(f-1)*e.footerSpacing);let C=0;const b=function(S){_=Math.max(_,n.measureText(S).width+C)};return n.save(),n.font=d.string,Re(t.title,b),n.font=c.string,Re(t.beforeBody.concat(t.afterBody),b),C=e.displayColors?a+2+e.boxPadding:0,Re(r,S=>{Re(S.before,b),Re(S.lines,b),Re(S.after,b)}),C=0,n.font=u.string,Re(t.footer,b),n.restore(),_+=g.width,{width:_,height:p}}function eM(t,e){const{y:n,height:r}=e;return n<r/2?"top":n>t.height-r/2?"bottom":"center"}function tM(t,e,n,r){const{x:s,width:i}=r,a=n.caretSize+n.caretPadding;if(t==="left"&&s+i+a>e.width||t==="right"&&s-i-a<0)return!0}function nM(t,e,n,r){const{x:s,width:i}=n,{width:a,chartArea:{left:l,right:c}}=t;let d="center";return r==="center"?d=s<=(l+c)/2?"left":"right":s<=i/2?d="left":s>=a-i/2&&(d="right"),tM(d,t,e,n)&&(d="center"),d}function bm(t,e,n){const r=n.yAlign||e.yAlign||eM(t,n);return{xAlign:n.xAlign||e.xAlign||nM(t,e,n,r),yAlign:r}}function rM(t,e){let{x:n,width:r}=t;return e==="right"?n-=r:e==="center"&&(n-=r/2),n}function sM(t,e,n){let{y:r,height:s}=t;return e==="top"?r+=n:e==="bottom"?r-=s+n:r-=s/2,r}function km(t,e,n,r){const{caretSize:s,caretPadding:i,cornerRadius:a}=t,{xAlign:l,yAlign:c}=n,d=s+i,{topLeft:u,topRight:h,bottomLeft:f,bottomRight:m}=So(a);let g=rM(e,l);const p=sM(e,c,d);return c==="center"?l==="left"?g+=d:l==="right"&&(g-=d):l==="left"?g-=Math.max(u,f)+s:l==="right"&&(g+=Math.max(h,m)+s),{x:pn(g,0,r.width-e.width),y:pn(p,0,r.height-e.height)}}function ul(t,e,n){const r=gn(n.padding);return e==="center"?t.x+t.width/2:e==="right"?t.x+t.width-r.right:t.x+r.left}function Cm(t){return Qn([],yr(t))}function iM(t,e,n){return Jr(t,{tooltip:e,tooltipItems:n,type:"tooltip"})}function xm(t,e){const n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?t.override(n):t}const Mm={beforeTitle:mr,title(t){if(t.length>0){const e=t[0],n=e.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(r>0&&e.dataIndex<r)return n[e.dataIndex]}return""},afterTitle:mr,beforeBody:mr,beforeLabel:mr,label(t){if(this&&this.options&&this.options.mode==="dataset")return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const n=t.formattedValue;return Ze(n)||(e+=n),e},labelColor(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:mr,afterBody:mr,beforeFooter:mr,footer:mr,afterFooter:mr};function Ht(t,e,n,r){const s=t[e].call(n,r);return typeof s>"u"?Mm[e].call(n,r):s}class $u extends Bs{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 n=this.chart,r=this.options.setContext(this.getContext()),s=r.enabled&&n.options.animation&&r.animations,i=new S2(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(i)),i}getContext(){return this.$context||(this.$context=iM(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,n){const{callbacks:r}=n,s=Ht(r,"beforeTitle",this,e),i=Ht(r,"title",this,e),a=Ht(r,"afterTitle",this,e);let l=[];return l=Qn(l,yr(s)),l=Qn(l,yr(i)),l=Qn(l,yr(a)),l}getBeforeBody(e,n){return Cm(Ht(n.callbacks,"beforeBody",this,e))}getBody(e,n){const{callbacks:r}=n,s=[];return Re(e,i=>{const a={before:[],lines:[],after:[]},l=xm(r,i);Qn(a.before,yr(Ht(l,"beforeLabel",this,i))),Qn(a.lines,Ht(l,"label",this,i)),Qn(a.after,yr(Ht(l,"afterLabel",this,i))),s.push(a)}),s}getAfterBody(e,n){return Cm(Ht(n.callbacks,"afterBody",this,e))}getFooter(e,n){const{callbacks:r}=n,s=Ht(r,"beforeFooter",this,e),i=Ht(r,"footer",this,e),a=Ht(r,"afterFooter",this,e);let l=[];return l=Qn(l,yr(s)),l=Qn(l,yr(i)),l=Qn(l,yr(a)),l}_createItems(e){const n=this._active,r=this.chart.data,s=[],i=[],a=[];let l=[],c,d;for(c=0,d=n.length;c<d;++c)l.push(Jx(this.chart,n[c]));return e.filter&&(l=l.filter((u,h,f)=>e.filter(u,h,f,r))),e.itemSort&&(l=l.sort((u,h)=>e.itemSort(u,h,r))),Re(l,u=>{const h=xm(e.callbacks,u);s.push(Ht(h,"labelColor",this,u)),i.push(Ht(h,"labelPointStyle",this,u)),a.push(Ht(h,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=i,this.labelTextColors=a,this.dataPoints=l,l}update(e,n){const r=this.options.setContext(this.getContext()),s=this._active;let i,a=[];if(!s.length)this.opacity!==0&&(i={opacity:0});else{const l=Ro[r.position].call(this,s,this._eventPosition);a=this._createItems(r),this.title=this.getTitle(a,r),this.beforeBody=this.getBeforeBody(a,r),this.body=this.getBody(a,r),this.afterBody=this.getAfterBody(a,r),this.footer=this.getFooter(a,r);const c=this._size=wm(this,r),d=Object.assign({},l,c),u=bm(this.chart,r,d),h=km(r,d,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,i={opacity:1,x:h.x,y:h.y,width:c.width,height:c.height,caretX:l.x,caretY:l.y}}this._tooltipItems=a,this.$context=void 0,i&&this._resolveAnimations().update(this,i),e&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(e,n,r,s){const i=this.getCaretPosition(e,r,s);n.lineTo(i.x1,i.y1),n.lineTo(i.x2,i.y2),n.lineTo(i.x3,i.y3)}getCaretPosition(e,n,r){const{xAlign:s,yAlign:i}=this,{caretSize:a,cornerRadius:l}=r,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:h}=So(l),{x:f,y:m}=e,{width:g,height:p}=n;let _,y,C,b,S,M;return i==="center"?(S=m+p/2,s==="left"?(_=f,y=_-a,b=S+a,M=S-a):(_=f+g,y=_+a,b=S-a,M=S+a),C=_):(s==="left"?y=f+Math.max(c,u)+a:s==="right"?y=f+g-Math.max(d,h)-a:y=this.caretX,i==="top"?(b=m,S=b-a,_=y-a,C=y+a):(b=m+p,S=b+a,_=y+a,C=y-a),M=b),{x1:_,x2:y,x3:C,y1:b,y2:S,y3:M}}drawTitle(e,n,r){const s=this.title,i=s.length;let a,l,c;if(i){const d=yu(r.rtl,this.x,this.width);for(e.x=ul(this,r.titleAlign,r),n.textAlign=d.textAlign(r.titleAlign),n.textBaseline="middle",a=rn(r.titleFont),l=r.titleSpacing,n.fillStyle=r.titleColor,n.font=a.string,c=0;c<i;++c)n.fillText(s[c],d.x(e.x),e.y+a.lineHeight/2),e.y+=a.lineHeight+l,c+1===i&&(e.y+=r.titleMarginBottom-l)}}_drawColorBox(e,n,r,s,i){const a=this.labelColors[r],l=this.labelPointStyles[r],{boxHeight:c,boxWidth:d}=i,u=rn(i.bodyFont),h=ul(this,"left",i),f=s.x(h),m=c<u.lineHeight?(u.lineHeight-c)/2:0,g=n.y+m;if(i.usePointStyle){const p={radius:Math.min(d,c)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},_=s.leftForLtr(f,d)+d/2,y=g+c/2;e.strokeStyle=i.multiKeyBackground,e.fillStyle=i.multiKeyBackground,cu(e,p,_,y),e.strokeStyle=a.borderColor,e.fillStyle=a.backgroundColor,cu(e,p,_,y)}else{e.lineWidth=ve(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,e.strokeStyle=a.borderColor,e.setLineDash(a.borderDash||[]),e.lineDashOffset=a.borderDashOffset||0;const p=s.leftForLtr(f,d),_=s.leftForLtr(s.xPlus(f,1),d-2),y=So(a.borderRadius);Object.values(y).some(C=>C!==0)?(e.beginPath(),e.fillStyle=i.multiKeyBackground,hu(e,{x:p,y:g,w:d,h:c,radius:y}),e.fill(),e.stroke(),e.fillStyle=a.backgroundColor,e.beginPath(),hu(e,{x:_,y:g+1,w:d-2,h:c-2,radius:y}),e.fill()):(e.fillStyle=i.multiKeyBackground,e.fillRect(p,g,d,c),e.strokeRect(p,g,d,c),e.fillStyle=a.backgroundColor,e.fillRect(_,g+1,d-2,c-2))}e.fillStyle=this.labelTextColors[r]}drawBody(e,n,r){const{body:s}=this,{bodySpacing:i,bodyAlign:a,displayColors:l,boxHeight:c,boxWidth:d,boxPadding:u}=r,h=rn(r.bodyFont);let f=h.lineHeight,m=0;const g=yu(r.rtl,this.x,this.width),p=function(O){n.fillText(O,g.x(e.x+m),e.y+f/2),e.y+=f+i},_=g.textAlign(a);let y,C,b,S,M,T,v;for(n.textAlign=a,n.textBaseline="middle",n.font=h.string,e.x=ul(this,_,r),n.fillStyle=r.bodyColor,Re(this.beforeBody,p),m=l&&_!=="right"?a==="center"?d/2+u:d+2+u:0,S=0,T=s.length;S<T;++S){for(y=s[S],C=this.labelTextColors[S],n.fillStyle=C,Re(y.before,p),b=y.lines,l&&b.length&&(this._drawColorBox(n,e,S,g,r),f=Math.max(h.lineHeight,c)),M=0,v=b.length;M<v;++M)p(b[M]),f=h.lineHeight;Re(y.after,p)}m=0,f=h.lineHeight,Re(this.afterBody,p),e.y-=i}drawFooter(e,n,r){const s=this.footer,i=s.length;let a,l;if(i){const c=yu(r.rtl,this.x,this.width);for(e.x=ul(this,r.footerAlign,r),e.y+=r.footerMarginTop,n.textAlign=c.textAlign(r.footerAlign),n.textBaseline="middle",a=rn(r.footerFont),n.fillStyle=r.footerColor,n.font=a.string,l=0;l<i;++l)n.fillText(s[l],c.x(e.x),e.y+a.lineHeight/2),e.y+=a.lineHeight+r.footerSpacing}}drawBackground(e,n,r,s){const{xAlign:i,yAlign:a}=this,{x:l,y:c}=e,{width:d,height:u}=r,{topLeft:h,topRight:f,bottomLeft:m,bottomRight:g}=So(s.cornerRadius);n.fillStyle=s.backgroundColor,n.strokeStyle=s.borderColor,n.lineWidth=s.borderWidth,n.beginPath(),n.moveTo(l+h,c),a==="top"&&this.drawCaret(e,n,r,s),n.lineTo(l+d-f,c),n.quadraticCurveTo(l+d,c,l+d,c+f),a==="center"&&i==="right"&&this.drawCaret(e,n,r,s),n.lineTo(l+d,c+u-g),n.quadraticCurveTo(l+d,c+u,l+d-g,c+u),a==="bottom"&&this.drawCaret(e,n,r,s),n.lineTo(l+m,c+u),n.quadraticCurveTo(l,c+u,l,c+u-m),a==="center"&&i==="left"&&this.drawCaret(e,n,r,s),n.lineTo(l,c+h),n.quadraticCurveTo(l,c,l+h,c),n.closePath(),n.fill(),s.borderWidth>0&&n.stroke()}_updateAnimationTarget(e){const n=this.chart,r=this.$animations,s=r&&r.x,i=r&&r.y;if(s||i){const a=Ro[e.position].call(this,this._active,this._eventPosition);if(!a)return;const l=this._size=wm(this,e),c=Object.assign({},a,this._size),d=bm(n,e,c),u=km(e,c,d,n);(s._to!==u.x||i._to!==u.y)&&(this.xAlign=d.xAlign,this.yAlign=d.yAlign,this.width=l.width,this.height=l.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(e){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const s={width:this.width,height:this.height},i={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const a=gn(n.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&l&&(e.save(),e.globalAlpha=r,this.drawBackground(i,e,s,n),Uk(e,n.textDirection),i.y+=a.top,this.drawTitle(i,e,n),this.drawBody(i,e,n),this.drawFooter(i,e,n),qk(e,n.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,n){const r=this._active,s=e.map(({datasetIndex:l,index:c})=>{const d=this.chart.getDatasetMeta(l);if(!d)throw new Error("Cannot find a dataset at index "+l);return{datasetIndex:l,element:d.data[c],index:c}}),i=!za(r,s),a=this._positionChanged(s,n);(i||a)&&(this._active=s,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,i=this._active||[],a=this._getActiveElements(e,i,n,r),l=this._positionChanged(a,e),c=n||!za(a,i)||l;return c&&(this._active=a,(s.enabled||s.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,n))),c}_getActiveElements(e,n,r,s){const i=this.options;if(e.type==="mouseout")return[];if(!s)return n.filter(l=>this.chart.data.datasets[l.datasetIndex]&&this.chart.getDatasetMeta(l.datasetIndex).controller.getParsed(l.index)!==void 0);const a=this.chart.getElementsAtEventForMode(e,i.mode,i,r);return i.reverse&&a.reverse(),a}_positionChanged(e,n){const{caretX:r,caretY:s,options:i}=this,a=Ro[i.position].call(this,e,n);return a!==!1&&(r!==a.x||s!==a.y)}}W($u,"positioners",Ro);var oM={id:"tooltip",_element:$u,positioners:Ro,afterInit(t,e,n){n&&(t.tooltip=new $u({chart:t,options:n}))},beforeUpdate(t,e,n){t.tooltip&&t.tooltip.initialize(n)},reset(t,e,n){t.tooltip&&t.tooltip.initialize(n)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const n={tooltip:e};if(t.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",n)}},afterEvent(t,e){if(t.tooltip){const n=e.replay;t.tooltip.handleEvent(e.event,n,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Mm},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>t!=="filter"&&t!=="itemSort"&&t!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const aM=(t,e,n,r)=>(typeof e=="string"?(n=t.push(e)-1,r.unshift({index:n,label:e})):isNaN(e)&&(n=null),n);function lM(t,e,n,r){const s=t.indexOf(e);if(s===-1)return aM(t,e,n,r);const i=t.lastIndexOf(e);return s!==i?n:s}const cM=(t,e)=>t===null?null:pn(Math.round(t),0,e);function vm(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}class hl extends As{constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:s,label:i}of n)r[s]===i&&r.splice(s,1);this._addedLabels=[]}super.init(e)}parse(e,n){if(Ze(e))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===e?n:lM(r,e,Ae(n,e),this._addedLabels),cM(n,r.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:n}=this.getUserBounds();let{min:r,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(r=0),n||(s=this.getLabels().length-1)),this.min=r,this.max=s}buildTicks(){const e=this.min,n=this.max,r=this.options.offset,s=[];let i=this.getLabels();i=e===0&&n===i.length-1?i:i.slice(e,n+1),this._valueRange=Math.max(i.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let a=e;a<=n;a++)s.push({value:a});return s}getLabelForValue(e){return vm.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 n=this.ticks;return e<0||e>n.length-1?null:this.getPixelForValue(n[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}W(hl,"id","category"),W(hl,"defaults",{ticks:{callback:vm}});function dM(t,e){const n=[],{bounds:s,step:i,min:a,max:l,precision:c,count:d,maxTicks:u,maxDigits:h,includeBounds:f}=t,m=i||1,g=u-1,{min:p,max:_}=e,y=!Ze(a),C=!Ze(l),b=!Ze(d),S=(_-p)/(h+1);let M=U0((_-p)/g/m)*m,T,v,O,E;if(M<1e-14&&!y&&!C)return[{value:p},{value:_}];E=Math.ceil(_/M)-Math.floor(p/M),E>g&&(M=U0(E*M/g/m)*m),Ze(c)||(T=Math.pow(10,c),M=Math.ceil(M*T)/T),s==="ticks"?(v=Math.floor(p/M)*M,O=Math.ceil(_/M)*M):(v=p,O=_),y&&C&&i&&Ib((l-a)/i,M/1e3)?(E=Math.round(Math.min((l-a)/M,u)),M=(l-a)/E,v=a,O=l):b?(v=y?a:v,O=C?l:O,E=d-1,M=(O-v)/E):(E=(O-v)/M,Co(E,Math.round(E),M/1e3)?E=Math.round(E):E=Math.ceil(E));const I=Math.max(G0(M),G0(v));T=Math.pow(10,Ze(c)?I:c),v=Math.round(v*T)/T,O=Math.round(O*T)/T;let j=0;for(y&&(f&&v!==a?(n.push({value:a}),v<a&&j++,Co(Math.round((v+j*M)*T)/T,a,Sm(a,S,t))&&j++):v<a&&j++);j<E;++j){const $=Math.round((v+j*M)*T)/T;if(C&&$>l)break;n.push({value:$})}return C&&f&&O!==l?n.length&&Co(n[n.length-1].value,l,Sm(l,S,t))?n[n.length-1].value=l:n.push({value:l}):(!C||O===l)&&n.push({value:O}),n}function Sm(t,e,{horizontal:n,minRotation:r}){const s=Qr(r),i=(n?Math.sin(s):Math.cos(s))||.001,a=.75*e*(""+t).length;return Math.min(e/i,a)}class fl extends As{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,n){return Ze(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:s,max:i}=this;const a=c=>s=n?s:c,l=c=>i=r?i:c;if(e){const c=wi(s),d=wi(i);c<0&&d<0?l(0):c>0&&d>0&&a(0)}if(s===i){let c=i===0?1:Math.abs(i*.05);l(i+c),e||a(s-c)}this.min=s,this.max=i}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=e,s;return r?(s=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),n=n||11),n&&(s=Math.min(n,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,n=e.ticks;let r=this.getTickLimit();r=Math.max(2,r);const s={maxTicks:r,bounds:e.bounds,min:e.min,max:e.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},i=this._range||this,a=dM(s,i);return e.bounds==="ticks"&&q0(a,this,"value"),e.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const e=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&e.length){const s=(r-n)/Math.max(e.length-1,1)/2;n-=s,r+=s}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(e){return ou(e,this.chart.options.locale,this.options.ticks.format)}}class ml extends fl{determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=it(e)?e:0,this.max=it(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),n=e?this.width:this.height,r=Qr(this.options.ticks.minRotation),s=(e?Math.sin(r):Math.cos(r))||.001,i=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,i.lineHeight/s))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}W(ml,"id","linear"),W(ml,"defaults",{ticks:{callback:Ua.formatters.numeric}});const Fo=t=>Math.floor(Xr(t)),Rs=(t,e)=>Math.pow(10,Fo(t)+e);function Tm(t){return t/Math.pow(10,Fo(t))===1}function Dm(t,e,n){const r=Math.pow(10,n),s=Math.floor(t/r);return Math.ceil(e/r)-s}function uM(t,e){const n=e-t;let r=Fo(n);for(;Dm(t,e,r)>10;)r++;for(;Dm(t,e,r)<10;)r--;return Math.min(r,Fo(t))}function hM(t,{min:e,max:n}){e=Jt(t.min,e);const r=[],s=Fo(e);let i=uM(e,n),a=i<0?Math.pow(10,Math.abs(i)):1;const l=Math.pow(10,i),c=s>i?Math.pow(10,s):0,d=Math.round((e-c)*a)/a,u=Math.floor((e-c)/l/10)*l*10;let h=Math.floor((d-u)/Math.pow(10,i)),f=Jt(t.min,Math.round((c+u+h*Math.pow(10,i))*a)/a);for(;f<n;)r.push({value:f,major:Tm(f),significand:h}),h>=10?h=h<15?15:20:h++,h>=20&&(i++,h=2,a=i>=0?1:a),f=Math.round((c+u+h*Math.pow(10,i))*a)/a;const m=Jt(t.max,f);return r.push({value:m,major:Tm(m),significand:h}),r}class Om extends As{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,n){const r=fl.prototype.parse.apply(this,[e,n]);if(r===0){this._zero=!0;return}return it(r)&&r>0?r:null}determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=it(e)?Math.max(0,e):null,this.max=it(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!it(this._userMin)&&(this.min=e===Rs(this.min,0)?Rs(this.min,-1):Rs(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:n}=this.getUserBounds();let r=this.min,s=this.max;const i=l=>r=e?r:l,a=l=>s=n?s:l;r===s&&(r<=0?(i(1),a(10)):(i(Rs(r,-1)),a(Rs(s,1)))),r<=0&&i(Rs(s,-1)),s<=0&&a(Rs(r,1)),this.min=r,this.max=s}buildTicks(){const e=this.options,n={min:this._userMin,max:this._userMax},r=hM(n,this);return e.bounds==="ticks"&&q0(r,this,"value"),e.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}getLabelForValue(e){return e===void 0?"0":ou(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=Xr(e),this._valueRange=Xr(this.max)-Xr(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(Xr(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const n=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+n*this._valueRange)}}W(Om,"id","logarithmic"),W(Om,"defaults",{ticks:{callback:Ua.formatters.logarithmic,major:{enabled:!0}}});function Pu(t){const e=t.ticks;if(e.display&&t.display){const n=gn(e.backdropPadding);return Ae(e.font&&e.font.size,mt.font.size)+n.height}return 0}function fM(t,e,n){return n=tt(n)?n:[n],{w:ak(t,e.string,n),h:n.length*e.lineHeight}}function Em(t,e,n,r,s){return t===r||t===s?{start:e-n/2,end:e+n/2}:t<r||t>s?{start:e-n,end:e}:{start:e,end:e+n}}function mM(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},n=Object.assign({},e),r=[],s=[],i=t._pointLabels.length,a=t.options.pointLabels,l=a.centerPointLabels?vt/i:0;for(let c=0;c<i;c++){const d=a.setContext(t.getPointLabelContext(c));s[c]=d.padding;const u=t.getPointPosition(c,t.drawingArea+s[c],l),h=rn(d.font),f=fM(t.ctx,h,t._pointLabels[c]);r[c]=f;const m=nn(t.getIndexAngle(c)+l),g=Math.round(tu(m)),p=Em(g,u.x,f.w,0,180),_=Em(g,u.y,f.h,90,270);pM(n,e,m,p,_)}t.setCenterPoint(e.l-n.l,n.r-e.r,e.t-n.t,n.b-e.b),t._pointLabelItems=yM(t,r,s)}function pM(t,e,n,r,s){const i=Math.abs(Math.sin(n)),a=Math.abs(Math.cos(n));let l=0,c=0;r.start<e.l?(l=(e.l-r.start)/i,t.l=Math.min(t.l,e.l-l)):r.end>e.r&&(l=(r.end-e.r)/i,t.r=Math.max(t.r,e.r+l)),s.start<e.t?(c=(e.t-s.start)/a,t.t=Math.min(t.t,e.t-c)):s.end>e.b&&(c=(s.end-e.b)/a,t.b=Math.max(t.b,e.b+c))}function gM(t,e,n){const r=t.drawingArea,{extra:s,additionalAngle:i,padding:a,size:l}=n,c=t.getPointPosition(e,r+s+a,i),d=Math.round(tu(nn(c.angle+tn))),u=kM(c.y,l.h,d),h=wM(d),f=bM(c.x,l.w,h);return{visible:!0,x:c.x,y:u,textAlign:h,left:f,top:u,right:f+l.w,bottom:u+l.h}}function _M(t,e){if(!e)return!0;const{left:n,top:r,right:s,bottom:i}=t;return!(pr({x:n,y:r},e)||pr({x:n,y:i},e)||pr({x:s,y:r},e)||pr({x:s,y:i},e))}function yM(t,e,n){const r=[],s=t._pointLabels.length,i=t.options,{centerPointLabels:a,display:l}=i.pointLabels,c={extra:Pu(i)/2,additionalAngle:a?vt/s:0};let d;for(let u=0;u<s;u++){c.padding=n[u],c.size=e[u];const h=gM(t,u,c);r.push(h),l==="auto"&&(h.visible=_M(h,d),h.visible&&(d=h))}return r}function wM(t){return t===0||t===180?"center":t<180?"left":"right"}function bM(t,e,n){return n==="right"?t-=e:n==="center"&&(t-=e/2),t}function kM(t,e,n){return n===90||n===270?t-=e/2:(n>270||n<90)&&(t-=e),t}function CM(t,e,n){const{left:r,top:s,right:i,bottom:a}=n,{backdropColor:l}=e;if(!Ze(l)){const c=So(e.borderRadius),d=gn(e.backdropPadding);t.fillStyle=l;const u=r-d.left,h=s-d.top,f=i-r+d.width,m=a-s+d.height;Object.values(c).some(g=>g!==0)?(t.beginPath(),hu(t,{x:u,y:h,w:f,h:m,radius:c}),t.fill()):t.fillRect(u,h,f,m)}}function xM(t,e){const{ctx:n,options:{pointLabels:r}}=t;for(let s=e-1;s>=0;s--){const i=t._pointLabelItems[s];if(!i.visible)continue;const a=r.setContext(t.getPointLabelContext(s));CM(n,a,i);const l=rn(a.font),{x:c,y:d,textAlign:u}=i;Ga(n,t._pointLabels[s],c,d+l.lineHeight/2,l,{color:a.color,textAlign:u,textBaseline:"middle"})}}function $m(t,e,n,r){const{ctx:s}=t;if(n)s.arc(t.xCenter,t.yCenter,e,0,en);else{let i=t.getPointPosition(0,e);s.moveTo(i.x,i.y);for(let a=1;a<r;a++)i=t.getPointPosition(a,e),s.lineTo(i.x,i.y)}}function MM(t,e,n,r,s){const i=t.ctx,a=e.circular,{color:l,lineWidth:c}=e;!a&&!r||!l||!c||n<0||(i.save(),i.strokeStyle=l,i.lineWidth=c,i.setLineDash(s.dash),i.lineDashOffset=s.dashOffset,i.beginPath(),$m(t,n,a,r),i.closePath(),i.stroke(),i.restore())}function vM(t,e,n){return Jr(t,{label:n,index:e,type:"pointLabel"})}class pl extends fl{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=gn(Pu(this.options)/2),n=this.width=this.maxWidth-e.width,r=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+n/2+e.left),this.yCenter=Math.floor(this.top+r/2+e.top),this.drawingArea=Math.floor(Math.min(n,r)/2)}determineDataLimits(){const{min:e,max:n}=this.getMinMax(!1);this.min=it(e)&&!isNaN(e)?e:0,this.max=it(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Pu(this.options))}generateTickLabels(e){fl.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((n,r)=>{const s=ot(this.options.pointLabels.callback,[n,r],this);return s||s===0?s:""}).filter((n,r)=>this.chart.getDataVisibility(r))}fit(){const e=this.options;e.display&&e.pointLabels.display?mM(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,n,r,s){this.xCenter+=Math.floor((e-n)/2),this.yCenter+=Math.floor((r-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,n,r,s))}getIndexAngle(e){const n=en/(this._pointLabels.length||1),r=this.options.startAngle||0;return nn(e*n+Qr(r))}getDistanceFromCenterForValue(e){if(Ze(e))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*n:(e-this.min)*n}getValueForDistanceFromCenter(e){if(Ze(e))return NaN;const n=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(e){const n=this._pointLabels||[];if(e>=0&&e<n.length){const r=n[e];return vM(this.getContext(),e,r)}}getPointPosition(e,n,r=0){const s=this.getIndexAngle(e)-tn+r;return{x:Math.cos(s)*n+this.xCenter,y:Math.sin(s)*n+this.yCenter,angle:s}}getPointPositionForValue(e,n){return this.getPointPosition(e,this.getDistanceFromCenterForValue(n))}getBasePosition(e){return this.getPointPositionForValue(e||0,this.getBaseValue())}getPointLabelPosition(e){const{left:n,top:r,right:s,bottom:i}=this._pointLabelItems[e];return{left:n,top:r,right:s,bottom:i}}drawBackground(){const{backgroundColor:e,grid:{circular:n}}=this.options;if(e){const r=this.ctx;r.save(),r.beginPath(),$m(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),r.closePath(),r.fillStyle=e,r.fill(),r.restore()}}drawGrid(){const e=this.ctx,n=this.options,{angleLines:r,grid:s,border:i}=n,a=this._pointLabels.length;let l,c,d;if(n.pointLabels.display&&xM(this,a),s.display&&this.ticks.forEach((u,h)=>{if(h!==0||h===0&&this.min<0){c=this.getDistanceFromCenterForValue(u.value);const f=this.getContext(h),m=s.setContext(f),g=i.setContext(f);MM(this,m,c,a,g)}}),r.display){for(e.save(),l=a-1;l>=0;l--){const u=r.setContext(this.getPointLabelContext(l)),{color:h,lineWidth:f}=u;!f||!h||(e.lineWidth=f,e.strokeStyle=h,e.setLineDash(u.borderDash),e.lineDashOffset=u.borderDashOffset,c=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),d=this.getPointPosition(l,c),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(d.x,d.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,n=this.options,r=n.ticks;if(!r.display)return;const s=this.getIndexAngle(0);let i,a;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(s),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((l,c)=>{if(c===0&&this.min>=0&&!n.reverse)return;const d=r.setContext(this.getContext(c)),u=rn(d.font);if(i=this.getDistanceFromCenterForValue(this.ticks[c].value),d.showLabelBackdrop){e.font=u.string,a=e.measureText(l.label).width,e.fillStyle=d.backdropColor;const h=gn(d.backdropPadding);e.fillRect(-a/2-h.left,-i-u.size/2-h.top,a+h.width,u.size+h.height)}Ga(e,l.label,0,-i,u,{color:d.color,strokeColor:d.textStrokeColor,strokeWidth:d.textStrokeWidth})}),e.restore()}drawTitle(){}}W(pl,"id","radialLinear"),W(pl,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ua.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(e){return e},padding:5,centerPointLabels:!1}}),W(pl,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),W(pl,"descriptors",{angleLines:{_fallback:"grid"}});const gl={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}},Yt=Object.keys(gl);function Pm(t,e){return t-e}function Lm(t,e){if(Ze(e))return null;const n=t._adapter,{parser:r,round:s,isoWeekday:i}=t._parseOpts;let a=e;return typeof r=="function"&&(a=r(a)),it(a)||(a=typeof r=="string"?n.parse(a,r):n.parse(a)),a===null?null:(s&&(a=s==="week"&&(xo(i)||i===!0)?n.startOf(a,"isoWeek",i):n.startOf(a,s)),+a)}function Nm(t,e,n,r){const s=Yt.length;for(let i=Yt.indexOf(t);i<s-1;++i){const a=gl[Yt[i]],l=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((n-e)/(l*a.size))<=r)return Yt[i]}return Yt[s-1]}function SM(t,e,n,r,s){for(let i=Yt.length-1;i>=Yt.indexOf(n);i--){const a=Yt[i];if(gl[a].common&&t._adapter.diff(s,r,a)>=e-1)return a}return Yt[n?Yt.indexOf(n):0]}function TM(t){for(let e=Yt.indexOf(t)+1,n=Yt.length;e<n;++e)if(gl[Yt[e]].common)return Yt[e]}function Vm(t,e,n){if(!n)t[e]=!0;else if(n.length){const{lo:r,hi:s}=ru(n,e),i=n[r]>=e?n[r]:n[s];t[i]=!0}}function DM(t,e,n,r){const s=t._adapter,i=+s.startOf(e[0].value,r),a=e[e.length-1].value;let l,c;for(l=i;l<=a;l=+s.add(l,1,r))c=n[l],c>=0&&(e[c].major=!0);return e}function Bm(t,e,n){const r=[],s={},i=e.length;let a,l;for(a=0;a<i;++a)l=e[a],s[l]=a,r.push({value:l,major:!1});return i===0||!n?r:DM(t,r,s,n)}class _l extends As{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,n={}){const r=e.time||(e.time={}),s=this._adapter=new pC._date(e.adapters.date);s.init(n),ko(r.displayFormats,s.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(e),this._normalized=n.normalized}parse(e,n){return e===void 0?null:Lm(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,n=this._adapter,r=e.time.unit||"day";let{min:s,max:i,minDefined:a,maxDefined:l}=this.getUserBounds();function c(d){!a&&!isNaN(d.min)&&(s=Math.min(s,d.min)),!l&&!isNaN(d.max)&&(i=Math.max(i,d.max))}(!a||!l)&&(c(this._getLabelBounds()),(e.bounds!=="ticks"||e.ticks.source!=="labels")&&c(this.getMinMax(!1))),s=it(s)&&!isNaN(s)?s:+n.startOf(Date.now(),r),i=it(i)&&!isNaN(i)?i:+n.endOf(Date.now(),r)+1,this.min=Math.min(s,i-1),this.max=Math.max(s+1,i)}_getLabelBounds(){const e=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return e.length&&(n=e[0],r=e[e.length-1]),{min:n,max:r}}buildTicks(){const e=this.options,n=e.time,r=e.ticks,s=r.source==="labels"?this.getLabelTimestamps():this._generate();e.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const i=this.min,a=this.max,l=jb(s,i,a);return this._unit=n.unit||(r.autoSkip?Nm(n.minUnit,this.min,this.max,this._getLabelCapacity(i)):SM(this,l.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:TM(this._unit),this.initOffsets(s),e.reverse&&l.reverse(),Bm(this,l,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let n=0,r=0,s,i;this.options.offset&&e.length&&(s=this.getDecimalForValue(e[0]),e.length===1?n=1-s:n=(this.getDecimalForValue(e[1])-s)/2,i=this.getDecimalForValue(e[e.length-1]),e.length===1?r=i:r=(i-this.getDecimalForValue(e[e.length-2]))/2);const a=e.length<3?.5:.25;n=pn(n,0,a),r=pn(r,0,a),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const e=this._adapter,n=this.min,r=this.max,s=this.options,i=s.time,a=i.unit||Nm(i.minUnit,n,r,this._getLabelCapacity(n)),l=Ae(s.ticks.stepSize,1),c=a==="week"?i.isoWeekday:!1,d=xo(c)||c===!0,u={};let h=n,f,m;if(d&&(h=+e.startOf(h,"isoWeek",c)),h=+e.startOf(h,d?"day":a),e.diff(r,n,a)>1e5*l)throw new Error(n+" and "+r+" are too far apart with stepSize of "+l+" "+a);const g=s.ticks.source==="data"&&this.getDataTimestamps();for(f=h,m=0;f<r;f=+e.add(f,l,a),m++)Vm(u,f,g);return(f===r||s.bounds==="ticks"||m===1)&&Vm(u,f,g),Object.keys(u).sort(Pm).map(p=>+p)}getLabelForValue(e){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(e,r.tooltipFormat):n.format(e,r.displayFormats.datetime)}format(e,n){const s=this.options.time.displayFormats,i=this._unit,a=n||s[i];return this._adapter.format(e,a)}_tickFormatFunction(e,n,r,s){const i=this.options,a=i.ticks.callback;if(a)return ot(a,[e,n,r],this);const l=i.time.displayFormats,c=this._unit,d=this._majorUnit,u=c&&l[c],h=d&&l[d],f=r[n],m=d&&h&&f&&f.major;return this._adapter.format(e,s||(m?h:u))}generateTickLabels(e){let n,r,s;for(n=0,r=e.length;n<r;++n)s=e[n],s.label=this._tickFormatFunction(s.value,n,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const n=this._offsets,r=this.getDecimalForValue(e);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(e){const n=this._offsets,r=this.getDecimalForPixel(e)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(e){const n=this.options.ticks,r=this.ctx.measureText(e).width,s=Qr(this.isHorizontal()?n.maxRotation:n.minRotation),i=Math.cos(s),a=Math.sin(s),l=this._resolveTickFontOptions(0).size;return{w:r*i+l*a,h:r*a+l*i}}_getLabelCapacity(e){const n=this.options.time,r=n.displayFormats,s=r[n.unit]||r.millisecond,i=this._tickFormatFunction(e,0,Bm(this,[e],this._majorUnit),s),a=this._getLabelSize(i),l=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return l>0?l:1}getDataTimestamps(){let e=this._cache.data||[],n,r;if(e.length)return e;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(n=0,r=s.length;n<r;++n)e=e.concat(s[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){const e=this._cache.labels||[];let n,r;if(e.length)return e;const s=this.getLabels();for(n=0,r=s.length;n<r;++n)e.push(Lm(this,s[n]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return Ub(e.sort(Pm))}}W(_l,"id","time"),W(_l,"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 yl(t,e,n){let r=0,s=t.length-1,i,a,l,c;n?(e>=t[r].pos&&e<=t[s].pos&&({lo:r,hi:s}=Os(t,"pos",e)),{pos:i,time:l}=t[r],{pos:a,time:c}=t[s]):(e>=t[r].time&&e<=t[s].time&&({lo:r,hi:s}=Os(t,"time",e)),{time:i,pos:l}=t[r],{time:a,pos:c}=t[s]);const d=a-i;return d?l+(c-l)*(e-i)/d:l}class Am extends _l{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(e);this._minPos=yl(n,this.min),this._tableRange=yl(n,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:n,max:r}=this,s=[],i=[];let a,l,c,d,u;for(a=0,l=e.length;a<l;++a)d=e[a],d>=n&&d<=r&&s.push(d);if(s.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(a=0,l=s.length;a<l;++a)u=s[a+1],c=s[a-1],d=s[a],Math.round((u+c)/2)!==d&&i.push({time:d,pos:a/(l-1)});return i}_generate(){const e=this.min,n=this.max;let r=super.getDataTimestamps();return(!r.includes(e)||!r.length)&&r.splice(0,0,e),(!r.includes(n)||r.length===1)&&r.push(n),r.sort((s,i)=>s-i)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?e=this.normalize(n.concat(r)):e=n.length?n:r,e=this._cache.all=e,e}getDecimalForValue(e){return(yl(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const n=this._offsets,r=this.getDecimalForPixel(e)/n.factor-n.end;return yl(this._table,r*this._tableRange+this._minPos,!0)}}W(Am,"id","timeseries"),W(Am,"defaults",_l.defaults);const Rm={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},OM={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...Rm,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},EM=o.version[0]==="2"?(t,e)=>Object.assign(t,{attrs:e}):(t,e)=>Object.assign(t,e);function Ci(t){return o.isProxy(t)?o.toRaw(t):t}function $M(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t;return o.isProxy(e)?new Proxy(t,{}):t}function PM(t,e){const n=t.options;n&&e&&Object.assign(n,e)}function Fm(t,e){t.labels=e}function Im(t,e,n){const r=[];t.datasets=e.map(s=>{const i=t.datasets.find(a=>a[n]===s[n]);return!i||!s.data||r.includes(i)?{...s}:(r.push(i),Object.assign(i,s),i)})}function LM(t,e){const n={labels:[],datasets:[]};return Fm(n,t.labels),Im(n,t.datasets,e),n}const NM=o.defineComponent({props:OM,setup(t,e){let{expose:n,slots:r}=e;const s=o.ref(null),i=o.shallowRef(null);n({chart:i});const a=()=>{if(!s.value)return;const{type:d,data:u,options:h,plugins:f,datasetIdKey:m}=t,g=LM(u,m),p=$M(g,u);i.value=new Bo(s.value,{type:d,data:p,options:{...h},plugins:f})},l=()=>{const d=o.toRaw(i.value);d&&(t.destroyDelay>0?setTimeout(()=>{d.destroy(),i.value=null},t.destroyDelay):(d.destroy(),i.value=null))},c=d=>{d.update(t.updateMode)};return o.onMounted(a),o.onUnmounted(l),o.watch([()=>t.options,()=>t.data],(d,u)=>{let[h,f]=d,[m,g]=u;const p=o.toRaw(i.value);if(!p)return;let _=!1;if(h){const y=Ci(h),C=Ci(m);y&&y!==C&&(PM(p,y),_=!0)}if(f){const y=Ci(f.labels),C=Ci(g.labels),b=Ci(f.datasets),S=Ci(g.datasets);y!==C&&(Fm(p.config.data,y),_=!0),b&&b!==S&&(Im(p.config.data,b,t.datasetIdKey),_=!0)}_&&o.nextTick(()=>{c(p)})},{deep:!0}),()=>o.h("canvas",{role:"img",ariaLabel:t.ariaLabel,ariaDescribedby:t.ariaDescribedby,ref:s},[o.h("p",{},[r.default?r.default():""])])}});function VM(t,e){return Bo.register(e),o.defineComponent({props:Rm,setup(n,r){let{expose:s}=r;const i=o.shallowRef(null),a=l=>{i.value=l==null?void 0:l.chart};return s({chart:i}),()=>o.h(NM,EM({ref:a},{type:t,...n}))}})}const zm=VM("line",tl),BM={class:"chart-container"},Lu={__name:"LineChart",props:{data:{type:Array,required:!0},dataType:{type:String,required:!0},ticksCallback:{type:Function,default:t=>t},borderColor:{type:String,default:"#007AFF"},gradient:{type:Object,default:{height:450,startColor:"rgba(0, 122, 255, 0.1)",endColor:"rgba(0, 122, 255, 0)"}}},setup(t){Bo.register(hl,ml,Ao,_r,oM,ym);const e=t;let n=o.ref(!1);const r=u=>{const h=new Set,f=[];let m=[];switch(e.dataType){case"balanceChartData":m=u.length!==0?u.map(p=>(h.add(p.date),p.balance)):[0,0];break;case"performanceChartData":m=u.length!==0?u.map(p=>(h.add(p.date),p.pnl/p.pnl_to_deposit*100)):[0,0];break}f.push({data:m});const g=Array.from(h);return g.length===1?(g.push(...g),f.forEach(p=>{p.data.push(...p.data)})):g.length===0&&(n.value=!0,g.push(0,0)),{labels:g,datasets:f}},s=o.computed(()=>r(e.data)),i=u=>{const f=u.chart.ctx.createLinearGradient(0,0,0,e.gradient.height);return f.addColorStop(0,e.gradient.startColor),f.addColorStop(1,e.gradient.endColor),f},a=(u,h)=>{let f=document.querySelector(`#${u}-${e.dataType}`);return f||(f=document.createElement("div"),f.classList.add(u),f.setAttribute("id",`${u}-${e.dataType}`),h.canvas.parentNode.appendChild(f)),f},l=u=>{if(!n.value){const{chart:h,tooltip:f}=u,m=a("chart-tooltip",h);if(f.opacity===0){m.style.opacity="0";return}if(f.body){const S=f.title||[],M=f.body.map(v=>v.lines),T=document.createElement("div");for(T.classList.add("chart-tooltip-middle"),T.innerHTML=`<div class="chart-tooltip-content">
|
|
34
|
+
`):t}function Jx(t,e){const{element:n,datasetIndex:r,index:s}=e,i=t.getDatasetMeta(r).controller,{label:a,value:l}=i.getLabelAndValue(s);return{chart:t,label:a,parsed:i.getParsed(s),raw:t.data.datasets[r].data[s],formattedValue:l,dataset:i.getDataset(),dataIndex:s,datasetIndex:r,element:n}}function wm(t,e){const n=t.chart.ctx,{body:r,footer:s,title:i}=t,{boxWidth:a,boxHeight:l}=e,c=rn(e.bodyFont),d=rn(e.titleFont),u=rn(e.footerFont),h=i.length,f=s.length,m=r.length,g=gn(e.padding);let p=g.height,_=0,y=r.reduce((S,M)=>S+M.before.length+M.lines.length+M.after.length,0);if(y+=t.beforeBody.length+t.afterBody.length,h&&(p+=h*d.lineHeight+(h-1)*e.titleSpacing+e.titleMarginBottom),y){const S=e.displayColors?Math.max(l,c.lineHeight):c.lineHeight;p+=m*S+(y-m)*c.lineHeight+(y-1)*e.bodySpacing}f&&(p+=e.footerMarginTop+f*u.lineHeight+(f-1)*e.footerSpacing);let C=0;const b=function(S){_=Math.max(_,n.measureText(S).width+C)};return n.save(),n.font=d.string,Re(t.title,b),n.font=c.string,Re(t.beforeBody.concat(t.afterBody),b),C=e.displayColors?a+2+e.boxPadding:0,Re(r,S=>{Re(S.before,b),Re(S.lines,b),Re(S.after,b)}),C=0,n.font=u.string,Re(t.footer,b),n.restore(),_+=g.width,{width:_,height:p}}function eM(t,e){const{y:n,height:r}=e;return n<r/2?"top":n>t.height-r/2?"bottom":"center"}function tM(t,e,n,r){const{x:s,width:i}=r,a=n.caretSize+n.caretPadding;if(t==="left"&&s+i+a>e.width||t==="right"&&s-i-a<0)return!0}function nM(t,e,n,r){const{x:s,width:i}=n,{width:a,chartArea:{left:l,right:c}}=t;let d="center";return r==="center"?d=s<=(l+c)/2?"left":"right":s<=i/2?d="left":s>=a-i/2&&(d="right"),tM(d,t,e,n)&&(d="center"),d}function bm(t,e,n){const r=n.yAlign||e.yAlign||eM(t,n);return{xAlign:n.xAlign||e.xAlign||nM(t,e,n,r),yAlign:r}}function rM(t,e){let{x:n,width:r}=t;return e==="right"?n-=r:e==="center"&&(n-=r/2),n}function sM(t,e,n){let{y:r,height:s}=t;return e==="top"?r+=n:e==="bottom"?r-=s+n:r-=s/2,r}function km(t,e,n,r){const{caretSize:s,caretPadding:i,cornerRadius:a}=t,{xAlign:l,yAlign:c}=n,d=s+i,{topLeft:u,topRight:h,bottomLeft:f,bottomRight:m}=So(a);let g=rM(e,l);const p=sM(e,c,d);return c==="center"?l==="left"?g+=d:l==="right"&&(g-=d):l==="left"?g-=Math.max(u,f)+s:l==="right"&&(g+=Math.max(h,m)+s),{x:pn(g,0,r.width-e.width),y:pn(p,0,r.height-e.height)}}function ul(t,e,n){const r=gn(n.padding);return e==="center"?t.x+t.width/2:e==="right"?t.x+t.width-r.right:t.x+r.left}function Cm(t){return Qn([],yr(t))}function iM(t,e,n){return Jr(t,{tooltip:e,tooltipItems:n,type:"tooltip"})}function xm(t,e){const n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?t.override(n):t}const Mm={beforeTitle:mr,title(t){if(t.length>0){const e=t[0],n=e.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(r>0&&e.dataIndex<r)return n[e.dataIndex]}return""},afterTitle:mr,beforeBody:mr,beforeLabel:mr,label(t){if(this&&this.options&&this.options.mode==="dataset")return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const n=t.formattedValue;return Ze(n)||(e+=n),e},labelColor(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:mr,afterBody:mr,beforeFooter:mr,footer:mr,afterFooter:mr};function Ht(t,e,n,r){const s=t[e].call(n,r);return typeof s>"u"?Mm[e].call(n,r):s}class $u extends Bs{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 n=this.chart,r=this.options.setContext(this.getContext()),s=r.enabled&&n.options.animation&&r.animations,i=new S2(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(i)),i}getContext(){return this.$context||(this.$context=iM(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,n){const{callbacks:r}=n,s=Ht(r,"beforeTitle",this,e),i=Ht(r,"title",this,e),a=Ht(r,"afterTitle",this,e);let l=[];return l=Qn(l,yr(s)),l=Qn(l,yr(i)),l=Qn(l,yr(a)),l}getBeforeBody(e,n){return Cm(Ht(n.callbacks,"beforeBody",this,e))}getBody(e,n){const{callbacks:r}=n,s=[];return Re(e,i=>{const a={before:[],lines:[],after:[]},l=xm(r,i);Qn(a.before,yr(Ht(l,"beforeLabel",this,i))),Qn(a.lines,Ht(l,"label",this,i)),Qn(a.after,yr(Ht(l,"afterLabel",this,i))),s.push(a)}),s}getAfterBody(e,n){return Cm(Ht(n.callbacks,"afterBody",this,e))}getFooter(e,n){const{callbacks:r}=n,s=Ht(r,"beforeFooter",this,e),i=Ht(r,"footer",this,e),a=Ht(r,"afterFooter",this,e);let l=[];return l=Qn(l,yr(s)),l=Qn(l,yr(i)),l=Qn(l,yr(a)),l}_createItems(e){const n=this._active,r=this.chart.data,s=[],i=[],a=[];let l=[],c,d;for(c=0,d=n.length;c<d;++c)l.push(Jx(this.chart,n[c]));return e.filter&&(l=l.filter((u,h,f)=>e.filter(u,h,f,r))),e.itemSort&&(l=l.sort((u,h)=>e.itemSort(u,h,r))),Re(l,u=>{const h=xm(e.callbacks,u);s.push(Ht(h,"labelColor",this,u)),i.push(Ht(h,"labelPointStyle",this,u)),a.push(Ht(h,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=i,this.labelTextColors=a,this.dataPoints=l,l}update(e,n){const r=this.options.setContext(this.getContext()),s=this._active;let i,a=[];if(!s.length)this.opacity!==0&&(i={opacity:0});else{const l=Ro[r.position].call(this,s,this._eventPosition);a=this._createItems(r),this.title=this.getTitle(a,r),this.beforeBody=this.getBeforeBody(a,r),this.body=this.getBody(a,r),this.afterBody=this.getAfterBody(a,r),this.footer=this.getFooter(a,r);const c=this._size=wm(this,r),d=Object.assign({},l,c),u=bm(this.chart,r,d),h=km(r,d,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,i={opacity:1,x:h.x,y:h.y,width:c.width,height:c.height,caretX:l.x,caretY:l.y}}this._tooltipItems=a,this.$context=void 0,i&&this._resolveAnimations().update(this,i),e&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(e,n,r,s){const i=this.getCaretPosition(e,r,s);n.lineTo(i.x1,i.y1),n.lineTo(i.x2,i.y2),n.lineTo(i.x3,i.y3)}getCaretPosition(e,n,r){const{xAlign:s,yAlign:i}=this,{caretSize:a,cornerRadius:l}=r,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:h}=So(l),{x:f,y:m}=e,{width:g,height:p}=n;let _,y,C,b,S,M;return i==="center"?(S=m+p/2,s==="left"?(_=f,y=_-a,b=S+a,M=S-a):(_=f+g,y=_+a,b=S-a,M=S+a),C=_):(s==="left"?y=f+Math.max(c,u)+a:s==="right"?y=f+g-Math.max(d,h)-a:y=this.caretX,i==="top"?(b=m,S=b-a,_=y-a,C=y+a):(b=m+p,S=b+a,_=y+a,C=y-a),M=b),{x1:_,x2:y,x3:C,y1:b,y2:S,y3:M}}drawTitle(e,n,r){const s=this.title,i=s.length;let a,l,c;if(i){const d=yu(r.rtl,this.x,this.width);for(e.x=ul(this,r.titleAlign,r),n.textAlign=d.textAlign(r.titleAlign),n.textBaseline="middle",a=rn(r.titleFont),l=r.titleSpacing,n.fillStyle=r.titleColor,n.font=a.string,c=0;c<i;++c)n.fillText(s[c],d.x(e.x),e.y+a.lineHeight/2),e.y+=a.lineHeight+l,c+1===i&&(e.y+=r.titleMarginBottom-l)}}_drawColorBox(e,n,r,s,i){const a=this.labelColors[r],l=this.labelPointStyles[r],{boxHeight:c,boxWidth:d}=i,u=rn(i.bodyFont),h=ul(this,"left",i),f=s.x(h),m=c<u.lineHeight?(u.lineHeight-c)/2:0,g=n.y+m;if(i.usePointStyle){const p={radius:Math.min(d,c)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},_=s.leftForLtr(f,d)+d/2,y=g+c/2;e.strokeStyle=i.multiKeyBackground,e.fillStyle=i.multiKeyBackground,cu(e,p,_,y),e.strokeStyle=a.borderColor,e.fillStyle=a.backgroundColor,cu(e,p,_,y)}else{e.lineWidth=ve(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,e.strokeStyle=a.borderColor,e.setLineDash(a.borderDash||[]),e.lineDashOffset=a.borderDashOffset||0;const p=s.leftForLtr(f,d),_=s.leftForLtr(s.xPlus(f,1),d-2),y=So(a.borderRadius);Object.values(y).some(C=>C!==0)?(e.beginPath(),e.fillStyle=i.multiKeyBackground,hu(e,{x:p,y:g,w:d,h:c,radius:y}),e.fill(),e.stroke(),e.fillStyle=a.backgroundColor,e.beginPath(),hu(e,{x:_,y:g+1,w:d-2,h:c-2,radius:y}),e.fill()):(e.fillStyle=i.multiKeyBackground,e.fillRect(p,g,d,c),e.strokeRect(p,g,d,c),e.fillStyle=a.backgroundColor,e.fillRect(_,g+1,d-2,c-2))}e.fillStyle=this.labelTextColors[r]}drawBody(e,n,r){const{body:s}=this,{bodySpacing:i,bodyAlign:a,displayColors:l,boxHeight:c,boxWidth:d,boxPadding:u}=r,h=rn(r.bodyFont);let f=h.lineHeight,m=0;const g=yu(r.rtl,this.x,this.width),p=function(O){n.fillText(O,g.x(e.x+m),e.y+f/2),e.y+=f+i},_=g.textAlign(a);let y,C,b,S,M,T,v;for(n.textAlign=a,n.textBaseline="middle",n.font=h.string,e.x=ul(this,_,r),n.fillStyle=r.bodyColor,Re(this.beforeBody,p),m=l&&_!=="right"?a==="center"?d/2+u:d+2+u:0,S=0,T=s.length;S<T;++S){for(y=s[S],C=this.labelTextColors[S],n.fillStyle=C,Re(y.before,p),b=y.lines,l&&b.length&&(this._drawColorBox(n,e,S,g,r),f=Math.max(h.lineHeight,c)),M=0,v=b.length;M<v;++M)p(b[M]),f=h.lineHeight;Re(y.after,p)}m=0,f=h.lineHeight,Re(this.afterBody,p),e.y-=i}drawFooter(e,n,r){const s=this.footer,i=s.length;let a,l;if(i){const c=yu(r.rtl,this.x,this.width);for(e.x=ul(this,r.footerAlign,r),e.y+=r.footerMarginTop,n.textAlign=c.textAlign(r.footerAlign),n.textBaseline="middle",a=rn(r.footerFont),n.fillStyle=r.footerColor,n.font=a.string,l=0;l<i;++l)n.fillText(s[l],c.x(e.x),e.y+a.lineHeight/2),e.y+=a.lineHeight+r.footerSpacing}}drawBackground(e,n,r,s){const{xAlign:i,yAlign:a}=this,{x:l,y:c}=e,{width:d,height:u}=r,{topLeft:h,topRight:f,bottomLeft:m,bottomRight:g}=So(s.cornerRadius);n.fillStyle=s.backgroundColor,n.strokeStyle=s.borderColor,n.lineWidth=s.borderWidth,n.beginPath(),n.moveTo(l+h,c),a==="top"&&this.drawCaret(e,n,r,s),n.lineTo(l+d-f,c),n.quadraticCurveTo(l+d,c,l+d,c+f),a==="center"&&i==="right"&&this.drawCaret(e,n,r,s),n.lineTo(l+d,c+u-g),n.quadraticCurveTo(l+d,c+u,l+d-g,c+u),a==="bottom"&&this.drawCaret(e,n,r,s),n.lineTo(l+m,c+u),n.quadraticCurveTo(l,c+u,l,c+u-m),a==="center"&&i==="left"&&this.drawCaret(e,n,r,s),n.lineTo(l,c+h),n.quadraticCurveTo(l,c,l+h,c),n.closePath(),n.fill(),s.borderWidth>0&&n.stroke()}_updateAnimationTarget(e){const n=this.chart,r=this.$animations,s=r&&r.x,i=r&&r.y;if(s||i){const a=Ro[e.position].call(this,this._active,this._eventPosition);if(!a)return;const l=this._size=wm(this,e),c=Object.assign({},a,this._size),d=bm(n,e,c),u=km(e,c,d,n);(s._to!==u.x||i._to!==u.y)&&(this.xAlign=d.xAlign,this.yAlign=d.yAlign,this.width=l.width,this.height=l.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(e){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const s={width:this.width,height:this.height},i={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const a=gn(n.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&l&&(e.save(),e.globalAlpha=r,this.drawBackground(i,e,s,n),Uk(e,n.textDirection),i.y+=a.top,this.drawTitle(i,e,n),this.drawBody(i,e,n),this.drawFooter(i,e,n),qk(e,n.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,n){const r=this._active,s=e.map(({datasetIndex:l,index:c})=>{const d=this.chart.getDatasetMeta(l);if(!d)throw new Error("Cannot find a dataset at index "+l);return{datasetIndex:l,element:d.data[c],index:c}}),i=!za(r,s),a=this._positionChanged(s,n);(i||a)&&(this._active=s,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,i=this._active||[],a=this._getActiveElements(e,i,n,r),l=this._positionChanged(a,e),c=n||!za(a,i)||l;return c&&(this._active=a,(s.enabled||s.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,n))),c}_getActiveElements(e,n,r,s){const i=this.options;if(e.type==="mouseout")return[];if(!s)return n.filter(l=>this.chart.data.datasets[l.datasetIndex]&&this.chart.getDatasetMeta(l.datasetIndex).controller.getParsed(l.index)!==void 0);const a=this.chart.getElementsAtEventForMode(e,i.mode,i,r);return i.reverse&&a.reverse(),a}_positionChanged(e,n){const{caretX:r,caretY:s,options:i}=this,a=Ro[i.position].call(this,e,n);return a!==!1&&(r!==a.x||s!==a.y)}}W($u,"positioners",Ro);var oM={id:"tooltip",_element:$u,positioners:Ro,afterInit(t,e,n){n&&(t.tooltip=new $u({chart:t,options:n}))},beforeUpdate(t,e,n){t.tooltip&&t.tooltip.initialize(n)},reset(t,e,n){t.tooltip&&t.tooltip.initialize(n)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const n={tooltip:e};if(t.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",n)}},afterEvent(t,e){if(t.tooltip){const n=e.replay;t.tooltip.handleEvent(e.event,n,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Mm},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>t!=="filter"&&t!=="itemSort"&&t!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const aM=(t,e,n,r)=>(typeof e=="string"?(n=t.push(e)-1,r.unshift({index:n,label:e})):isNaN(e)&&(n=null),n);function lM(t,e,n,r){const s=t.indexOf(e);if(s===-1)return aM(t,e,n,r);const i=t.lastIndexOf(e);return s!==i?n:s}const cM=(t,e)=>t===null?null:pn(Math.round(t),0,e);function vm(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}class hl extends As{constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:s,label:i}of n)r[s]===i&&r.splice(s,1);this._addedLabels=[]}super.init(e)}parse(e,n){if(Ze(e))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===e?n:lM(r,e,Ae(n,e),this._addedLabels),cM(n,r.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:n}=this.getUserBounds();let{min:r,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(r=0),n||(s=this.getLabels().length-1)),this.min=r,this.max=s}buildTicks(){const e=this.min,n=this.max,r=this.options.offset,s=[];let i=this.getLabels();i=e===0&&n===i.length-1?i:i.slice(e,n+1),this._valueRange=Math.max(i.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let a=e;a<=n;a++)s.push({value:a});return s}getLabelForValue(e){return vm.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 n=this.ticks;return e<0||e>n.length-1?null:this.getPixelForValue(n[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}W(hl,"id","category"),W(hl,"defaults",{ticks:{callback:vm}});function dM(t,e){const n=[],{bounds:s,step:i,min:a,max:l,precision:c,count:d,maxTicks:u,maxDigits:h,includeBounds:f}=t,m=i||1,g=u-1,{min:p,max:_}=e,y=!Ze(a),C=!Ze(l),b=!Ze(d),S=(_-p)/(h+1);let M=U0((_-p)/g/m)*m,T,v,O,E;if(M<1e-14&&!y&&!C)return[{value:p},{value:_}];E=Math.ceil(_/M)-Math.floor(p/M),E>g&&(M=U0(E*M/g/m)*m),Ze(c)||(T=Math.pow(10,c),M=Math.ceil(M*T)/T),s==="ticks"?(v=Math.floor(p/M)*M,O=Math.ceil(_/M)*M):(v=p,O=_),y&&C&&i&&Ib((l-a)/i,M/1e3)?(E=Math.round(Math.min((l-a)/M,u)),M=(l-a)/E,v=a,O=l):b?(v=y?a:v,O=C?l:O,E=d-1,M=(O-v)/E):(E=(O-v)/M,Co(E,Math.round(E),M/1e3)?E=Math.round(E):E=Math.ceil(E));const I=Math.max(G0(M),G0(v));T=Math.pow(10,Ze(c)?I:c),v=Math.round(v*T)/T,O=Math.round(O*T)/T;let j=0;for(y&&(f&&v!==a?(n.push({value:a}),v<a&&j++,Co(Math.round((v+j*M)*T)/T,a,Sm(a,S,t))&&j++):v<a&&j++);j<E;++j){const $=Math.round((v+j*M)*T)/T;if(C&&$>l)break;n.push({value:$})}return C&&f&&O!==l?n.length&&Co(n[n.length-1].value,l,Sm(l,S,t))?n[n.length-1].value=l:n.push({value:l}):(!C||O===l)&&n.push({value:O}),n}function Sm(t,e,{horizontal:n,minRotation:r}){const s=Qr(r),i=(n?Math.sin(s):Math.cos(s))||.001,a=.75*e*(""+t).length;return Math.min(e/i,a)}class fl extends As{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,n){return Ze(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:s,max:i}=this;const a=c=>s=n?s:c,l=c=>i=r?i:c;if(e){const c=wi(s),d=wi(i);c<0&&d<0?l(0):c>0&&d>0&&a(0)}if(s===i){let c=i===0?1:Math.abs(i*.05);l(i+c),e||a(s-c)}this.min=s,this.max=i}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=e,s;return r?(s=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),n=n||11),n&&(s=Math.min(n,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,n=e.ticks;let r=this.getTickLimit();r=Math.max(2,r);const s={maxTicks:r,bounds:e.bounds,min:e.min,max:e.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},i=this._range||this,a=dM(s,i);return e.bounds==="ticks"&&q0(a,this,"value"),e.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const e=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&e.length){const s=(r-n)/Math.max(e.length-1,1)/2;n-=s,r+=s}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(e){return ou(e,this.chart.options.locale,this.options.ticks.format)}}class ml extends fl{determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=it(e)?e:0,this.max=it(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),n=e?this.width:this.height,r=Qr(this.options.ticks.minRotation),s=(e?Math.sin(r):Math.cos(r))||.001,i=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,i.lineHeight/s))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}W(ml,"id","linear"),W(ml,"defaults",{ticks:{callback:Ua.formatters.numeric}});const Fo=t=>Math.floor(Xr(t)),Rs=(t,e)=>Math.pow(10,Fo(t)+e);function Tm(t){return t/Math.pow(10,Fo(t))===1}function Dm(t,e,n){const r=Math.pow(10,n),s=Math.floor(t/r);return Math.ceil(e/r)-s}function uM(t,e){const n=e-t;let r=Fo(n);for(;Dm(t,e,r)>10;)r++;for(;Dm(t,e,r)<10;)r--;return Math.min(r,Fo(t))}function hM(t,{min:e,max:n}){e=Jt(t.min,e);const r=[],s=Fo(e);let i=uM(e,n),a=i<0?Math.pow(10,Math.abs(i)):1;const l=Math.pow(10,i),c=s>i?Math.pow(10,s):0,d=Math.round((e-c)*a)/a,u=Math.floor((e-c)/l/10)*l*10;let h=Math.floor((d-u)/Math.pow(10,i)),f=Jt(t.min,Math.round((c+u+h*Math.pow(10,i))*a)/a);for(;f<n;)r.push({value:f,major:Tm(f),significand:h}),h>=10?h=h<15?15:20:h++,h>=20&&(i++,h=2,a=i>=0?1:a),f=Math.round((c+u+h*Math.pow(10,i))*a)/a;const m=Jt(t.max,f);return r.push({value:m,major:Tm(m),significand:h}),r}class Om extends As{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,n){const r=fl.prototype.parse.apply(this,[e,n]);if(r===0){this._zero=!0;return}return it(r)&&r>0?r:null}determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=it(e)?Math.max(0,e):null,this.max=it(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!it(this._userMin)&&(this.min=e===Rs(this.min,0)?Rs(this.min,-1):Rs(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:n}=this.getUserBounds();let r=this.min,s=this.max;const i=l=>r=e?r:l,a=l=>s=n?s:l;r===s&&(r<=0?(i(1),a(10)):(i(Rs(r,-1)),a(Rs(s,1)))),r<=0&&i(Rs(s,-1)),s<=0&&a(Rs(r,1)),this.min=r,this.max=s}buildTicks(){const e=this.options,n={min:this._userMin,max:this._userMax},r=hM(n,this);return e.bounds==="ticks"&&q0(r,this,"value"),e.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}getLabelForValue(e){return e===void 0?"0":ou(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=Xr(e),this._valueRange=Xr(this.max)-Xr(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(Xr(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const n=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+n*this._valueRange)}}W(Om,"id","logarithmic"),W(Om,"defaults",{ticks:{callback:Ua.formatters.logarithmic,major:{enabled:!0}}});function Pu(t){const e=t.ticks;if(e.display&&t.display){const n=gn(e.backdropPadding);return Ae(e.font&&e.font.size,mt.font.size)+n.height}return 0}function fM(t,e,n){return n=tt(n)?n:[n],{w:ak(t,e.string,n),h:n.length*e.lineHeight}}function Em(t,e,n,r,s){return t===r||t===s?{start:e-n/2,end:e+n/2}:t<r||t>s?{start:e-n,end:e}:{start:e,end:e+n}}function mM(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},n=Object.assign({},e),r=[],s=[],i=t._pointLabels.length,a=t.options.pointLabels,l=a.centerPointLabels?vt/i:0;for(let c=0;c<i;c++){const d=a.setContext(t.getPointLabelContext(c));s[c]=d.padding;const u=t.getPointPosition(c,t.drawingArea+s[c],l),h=rn(d.font),f=fM(t.ctx,h,t._pointLabels[c]);r[c]=f;const m=nn(t.getIndexAngle(c)+l),g=Math.round(tu(m)),p=Em(g,u.x,f.w,0,180),_=Em(g,u.y,f.h,90,270);pM(n,e,m,p,_)}t.setCenterPoint(e.l-n.l,n.r-e.r,e.t-n.t,n.b-e.b),t._pointLabelItems=yM(t,r,s)}function pM(t,e,n,r,s){const i=Math.abs(Math.sin(n)),a=Math.abs(Math.cos(n));let l=0,c=0;r.start<e.l?(l=(e.l-r.start)/i,t.l=Math.min(t.l,e.l-l)):r.end>e.r&&(l=(r.end-e.r)/i,t.r=Math.max(t.r,e.r+l)),s.start<e.t?(c=(e.t-s.start)/a,t.t=Math.min(t.t,e.t-c)):s.end>e.b&&(c=(s.end-e.b)/a,t.b=Math.max(t.b,e.b+c))}function gM(t,e,n){const r=t.drawingArea,{extra:s,additionalAngle:i,padding:a,size:l}=n,c=t.getPointPosition(e,r+s+a,i),d=Math.round(tu(nn(c.angle+tn))),u=kM(c.y,l.h,d),h=wM(d),f=bM(c.x,l.w,h);return{visible:!0,x:c.x,y:u,textAlign:h,left:f,top:u,right:f+l.w,bottom:u+l.h}}function _M(t,e){if(!e)return!0;const{left:n,top:r,right:s,bottom:i}=t;return!(pr({x:n,y:r},e)||pr({x:n,y:i},e)||pr({x:s,y:r},e)||pr({x:s,y:i},e))}function yM(t,e,n){const r=[],s=t._pointLabels.length,i=t.options,{centerPointLabels:a,display:l}=i.pointLabels,c={extra:Pu(i)/2,additionalAngle:a?vt/s:0};let d;for(let u=0;u<s;u++){c.padding=n[u],c.size=e[u];const h=gM(t,u,c);r.push(h),l==="auto"&&(h.visible=_M(h,d),h.visible&&(d=h))}return r}function wM(t){return t===0||t===180?"center":t<180?"left":"right"}function bM(t,e,n){return n==="right"?t-=e:n==="center"&&(t-=e/2),t}function kM(t,e,n){return n===90||n===270?t-=e/2:(n>270||n<90)&&(t-=e),t}function CM(t,e,n){const{left:r,top:s,right:i,bottom:a}=n,{backdropColor:l}=e;if(!Ze(l)){const c=So(e.borderRadius),d=gn(e.backdropPadding);t.fillStyle=l;const u=r-d.left,h=s-d.top,f=i-r+d.width,m=a-s+d.height;Object.values(c).some(g=>g!==0)?(t.beginPath(),hu(t,{x:u,y:h,w:f,h:m,radius:c}),t.fill()):t.fillRect(u,h,f,m)}}function xM(t,e){const{ctx:n,options:{pointLabels:r}}=t;for(let s=e-1;s>=0;s--){const i=t._pointLabelItems[s];if(!i.visible)continue;const a=r.setContext(t.getPointLabelContext(s));CM(n,a,i);const l=rn(a.font),{x:c,y:d,textAlign:u}=i;Ga(n,t._pointLabels[s],c,d+l.lineHeight/2,l,{color:a.color,textAlign:u,textBaseline:"middle"})}}function $m(t,e,n,r){const{ctx:s}=t;if(n)s.arc(t.xCenter,t.yCenter,e,0,en);else{let i=t.getPointPosition(0,e);s.moveTo(i.x,i.y);for(let a=1;a<r;a++)i=t.getPointPosition(a,e),s.lineTo(i.x,i.y)}}function MM(t,e,n,r,s){const i=t.ctx,a=e.circular,{color:l,lineWidth:c}=e;!a&&!r||!l||!c||n<0||(i.save(),i.strokeStyle=l,i.lineWidth=c,i.setLineDash(s.dash),i.lineDashOffset=s.dashOffset,i.beginPath(),$m(t,n,a,r),i.closePath(),i.stroke(),i.restore())}function vM(t,e,n){return Jr(t,{label:n,index:e,type:"pointLabel"})}class pl extends fl{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=gn(Pu(this.options)/2),n=this.width=this.maxWidth-e.width,r=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+n/2+e.left),this.yCenter=Math.floor(this.top+r/2+e.top),this.drawingArea=Math.floor(Math.min(n,r)/2)}determineDataLimits(){const{min:e,max:n}=this.getMinMax(!1);this.min=it(e)&&!isNaN(e)?e:0,this.max=it(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Pu(this.options))}generateTickLabels(e){fl.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((n,r)=>{const s=ot(this.options.pointLabels.callback,[n,r],this);return s||s===0?s:""}).filter((n,r)=>this.chart.getDataVisibility(r))}fit(){const e=this.options;e.display&&e.pointLabels.display?mM(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,n,r,s){this.xCenter+=Math.floor((e-n)/2),this.yCenter+=Math.floor((r-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,n,r,s))}getIndexAngle(e){const n=en/(this._pointLabels.length||1),r=this.options.startAngle||0;return nn(e*n+Qr(r))}getDistanceFromCenterForValue(e){if(Ze(e))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*n:(e-this.min)*n}getValueForDistanceFromCenter(e){if(Ze(e))return NaN;const n=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(e){const n=this._pointLabels||[];if(e>=0&&e<n.length){const r=n[e];return vM(this.getContext(),e,r)}}getPointPosition(e,n,r=0){const s=this.getIndexAngle(e)-tn+r;return{x:Math.cos(s)*n+this.xCenter,y:Math.sin(s)*n+this.yCenter,angle:s}}getPointPositionForValue(e,n){return this.getPointPosition(e,this.getDistanceFromCenterForValue(n))}getBasePosition(e){return this.getPointPositionForValue(e||0,this.getBaseValue())}getPointLabelPosition(e){const{left:n,top:r,right:s,bottom:i}=this._pointLabelItems[e];return{left:n,top:r,right:s,bottom:i}}drawBackground(){const{backgroundColor:e,grid:{circular:n}}=this.options;if(e){const r=this.ctx;r.save(),r.beginPath(),$m(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),r.closePath(),r.fillStyle=e,r.fill(),r.restore()}}drawGrid(){const e=this.ctx,n=this.options,{angleLines:r,grid:s,border:i}=n,a=this._pointLabels.length;let l,c,d;if(n.pointLabels.display&&xM(this,a),s.display&&this.ticks.forEach((u,h)=>{if(h!==0||h===0&&this.min<0){c=this.getDistanceFromCenterForValue(u.value);const f=this.getContext(h),m=s.setContext(f),g=i.setContext(f);MM(this,m,c,a,g)}}),r.display){for(e.save(),l=a-1;l>=0;l--){const u=r.setContext(this.getPointLabelContext(l)),{color:h,lineWidth:f}=u;!f||!h||(e.lineWidth=f,e.strokeStyle=h,e.setLineDash(u.borderDash),e.lineDashOffset=u.borderDashOffset,c=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),d=this.getPointPosition(l,c),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(d.x,d.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,n=this.options,r=n.ticks;if(!r.display)return;const s=this.getIndexAngle(0);let i,a;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(s),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((l,c)=>{if(c===0&&this.min>=0&&!n.reverse)return;const d=r.setContext(this.getContext(c)),u=rn(d.font);if(i=this.getDistanceFromCenterForValue(this.ticks[c].value),d.showLabelBackdrop){e.font=u.string,a=e.measureText(l.label).width,e.fillStyle=d.backdropColor;const h=gn(d.backdropPadding);e.fillRect(-a/2-h.left,-i-u.size/2-h.top,a+h.width,u.size+h.height)}Ga(e,l.label,0,-i,u,{color:d.color,strokeColor:d.textStrokeColor,strokeWidth:d.textStrokeWidth})}),e.restore()}drawTitle(){}}W(pl,"id","radialLinear"),W(pl,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ua.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(e){return e},padding:5,centerPointLabels:!1}}),W(pl,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),W(pl,"descriptors",{angleLines:{_fallback:"grid"}});const gl={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}},Yt=Object.keys(gl);function Pm(t,e){return t-e}function Lm(t,e){if(Ze(e))return null;const n=t._adapter,{parser:r,round:s,isoWeekday:i}=t._parseOpts;let a=e;return typeof r=="function"&&(a=r(a)),it(a)||(a=typeof r=="string"?n.parse(a,r):n.parse(a)),a===null?null:(s&&(a=s==="week"&&(xo(i)||i===!0)?n.startOf(a,"isoWeek",i):n.startOf(a,s)),+a)}function Nm(t,e,n,r){const s=Yt.length;for(let i=Yt.indexOf(t);i<s-1;++i){const a=gl[Yt[i]],l=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((n-e)/(l*a.size))<=r)return Yt[i]}return Yt[s-1]}function SM(t,e,n,r,s){for(let i=Yt.length-1;i>=Yt.indexOf(n);i--){const a=Yt[i];if(gl[a].common&&t._adapter.diff(s,r,a)>=e-1)return a}return Yt[n?Yt.indexOf(n):0]}function TM(t){for(let e=Yt.indexOf(t)+1,n=Yt.length;e<n;++e)if(gl[Yt[e]].common)return Yt[e]}function Vm(t,e,n){if(!n)t[e]=!0;else if(n.length){const{lo:r,hi:s}=ru(n,e),i=n[r]>=e?n[r]:n[s];t[i]=!0}}function DM(t,e,n,r){const s=t._adapter,i=+s.startOf(e[0].value,r),a=e[e.length-1].value;let l,c;for(l=i;l<=a;l=+s.add(l,1,r))c=n[l],c>=0&&(e[c].major=!0);return e}function Bm(t,e,n){const r=[],s={},i=e.length;let a,l;for(a=0;a<i;++a)l=e[a],s[l]=a,r.push({value:l,major:!1});return i===0||!n?r:DM(t,r,s,n)}class _l extends As{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,n={}){const r=e.time||(e.time={}),s=this._adapter=new pC._date(e.adapters.date);s.init(n),ko(r.displayFormats,s.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(e),this._normalized=n.normalized}parse(e,n){return e===void 0?null:Lm(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,n=this._adapter,r=e.time.unit||"day";let{min:s,max:i,minDefined:a,maxDefined:l}=this.getUserBounds();function c(d){!a&&!isNaN(d.min)&&(s=Math.min(s,d.min)),!l&&!isNaN(d.max)&&(i=Math.max(i,d.max))}(!a||!l)&&(c(this._getLabelBounds()),(e.bounds!=="ticks"||e.ticks.source!=="labels")&&c(this.getMinMax(!1))),s=it(s)&&!isNaN(s)?s:+n.startOf(Date.now(),r),i=it(i)&&!isNaN(i)?i:+n.endOf(Date.now(),r)+1,this.min=Math.min(s,i-1),this.max=Math.max(s+1,i)}_getLabelBounds(){const e=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return e.length&&(n=e[0],r=e[e.length-1]),{min:n,max:r}}buildTicks(){const e=this.options,n=e.time,r=e.ticks,s=r.source==="labels"?this.getLabelTimestamps():this._generate();e.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const i=this.min,a=this.max,l=jb(s,i,a);return this._unit=n.unit||(r.autoSkip?Nm(n.minUnit,this.min,this.max,this._getLabelCapacity(i)):SM(this,l.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:TM(this._unit),this.initOffsets(s),e.reverse&&l.reverse(),Bm(this,l,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let n=0,r=0,s,i;this.options.offset&&e.length&&(s=this.getDecimalForValue(e[0]),e.length===1?n=1-s:n=(this.getDecimalForValue(e[1])-s)/2,i=this.getDecimalForValue(e[e.length-1]),e.length===1?r=i:r=(i-this.getDecimalForValue(e[e.length-2]))/2);const a=e.length<3?.5:.25;n=pn(n,0,a),r=pn(r,0,a),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const e=this._adapter,n=this.min,r=this.max,s=this.options,i=s.time,a=i.unit||Nm(i.minUnit,n,r,this._getLabelCapacity(n)),l=Ae(s.ticks.stepSize,1),c=a==="week"?i.isoWeekday:!1,d=xo(c)||c===!0,u={};let h=n,f,m;if(d&&(h=+e.startOf(h,"isoWeek",c)),h=+e.startOf(h,d?"day":a),e.diff(r,n,a)>1e5*l)throw new Error(n+" and "+r+" are too far apart with stepSize of "+l+" "+a);const g=s.ticks.source==="data"&&this.getDataTimestamps();for(f=h,m=0;f<r;f=+e.add(f,l,a),m++)Vm(u,f,g);return(f===r||s.bounds==="ticks"||m===1)&&Vm(u,f,g),Object.keys(u).sort(Pm).map(p=>+p)}getLabelForValue(e){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(e,r.tooltipFormat):n.format(e,r.displayFormats.datetime)}format(e,n){const s=this.options.time.displayFormats,i=this._unit,a=n||s[i];return this._adapter.format(e,a)}_tickFormatFunction(e,n,r,s){const i=this.options,a=i.ticks.callback;if(a)return ot(a,[e,n,r],this);const l=i.time.displayFormats,c=this._unit,d=this._majorUnit,u=c&&l[c],h=d&&l[d],f=r[n],m=d&&h&&f&&f.major;return this._adapter.format(e,s||(m?h:u))}generateTickLabels(e){let n,r,s;for(n=0,r=e.length;n<r;++n)s=e[n],s.label=this._tickFormatFunction(s.value,n,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const n=this._offsets,r=this.getDecimalForValue(e);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(e){const n=this._offsets,r=this.getDecimalForPixel(e)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(e){const n=this.options.ticks,r=this.ctx.measureText(e).width,s=Qr(this.isHorizontal()?n.maxRotation:n.minRotation),i=Math.cos(s),a=Math.sin(s),l=this._resolveTickFontOptions(0).size;return{w:r*i+l*a,h:r*a+l*i}}_getLabelCapacity(e){const n=this.options.time,r=n.displayFormats,s=r[n.unit]||r.millisecond,i=this._tickFormatFunction(e,0,Bm(this,[e],this._majorUnit),s),a=this._getLabelSize(i),l=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return l>0?l:1}getDataTimestamps(){let e=this._cache.data||[],n,r;if(e.length)return e;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(n=0,r=s.length;n<r;++n)e=e.concat(s[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){const e=this._cache.labels||[];let n,r;if(e.length)return e;const s=this.getLabels();for(n=0,r=s.length;n<r;++n)e.push(Lm(this,s[n]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return Ub(e.sort(Pm))}}W(_l,"id","time"),W(_l,"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 yl(t,e,n){let r=0,s=t.length-1,i,a,l,c;n?(e>=t[r].pos&&e<=t[s].pos&&({lo:r,hi:s}=Os(t,"pos",e)),{pos:i,time:l}=t[r],{pos:a,time:c}=t[s]):(e>=t[r].time&&e<=t[s].time&&({lo:r,hi:s}=Os(t,"time",e)),{time:i,pos:l}=t[r],{time:a,pos:c}=t[s]);const d=a-i;return d?l+(c-l)*(e-i)/d:l}class Am extends _l{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(e);this._minPos=yl(n,this.min),this._tableRange=yl(n,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:n,max:r}=this,s=[],i=[];let a,l,c,d,u;for(a=0,l=e.length;a<l;++a)d=e[a],d>=n&&d<=r&&s.push(d);if(s.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(a=0,l=s.length;a<l;++a)u=s[a+1],c=s[a-1],d=s[a],Math.round((u+c)/2)!==d&&i.push({time:d,pos:a/(l-1)});return i}_generate(){const e=this.min,n=this.max;let r=super.getDataTimestamps();return(!r.includes(e)||!r.length)&&r.splice(0,0,e),(!r.includes(n)||r.length===1)&&r.push(n),r.sort((s,i)=>s-i)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?e=this.normalize(n.concat(r)):e=n.length?n:r,e=this._cache.all=e,e}getDecimalForValue(e){return(yl(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const n=this._offsets,r=this.getDecimalForPixel(e)/n.factor-n.end;return yl(this._table,r*this._tableRange+this._minPos,!0)}}W(Am,"id","timeseries"),W(Am,"defaults",_l.defaults);const Rm={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},OM={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...Rm,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},EM=o.version[0]==="2"?(t,e)=>Object.assign(t,{attrs:e}):(t,e)=>Object.assign(t,e);function Ci(t){return o.isProxy(t)?o.toRaw(t):t}function $M(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t;return o.isProxy(e)?new Proxy(t,{}):t}function PM(t,e){const n=t.options;n&&e&&Object.assign(n,e)}function Fm(t,e){t.labels=e}function Im(t,e,n){const r=[];t.datasets=e.map(s=>{const i=t.datasets.find(a=>a[n]===s[n]);return!i||!s.data||r.includes(i)?{...s}:(r.push(i),Object.assign(i,s),i)})}function LM(t,e){const n={labels:[],datasets:[]};return Fm(n,t.labels),Im(n,t.datasets,e),n}const NM=o.defineComponent({props:OM,setup(t,e){let{expose:n,slots:r}=e;const s=o.ref(null),i=o.shallowRef(null);n({chart:i});const a=()=>{if(!s.value)return;const{type:d,data:u,options:h,plugins:f,datasetIdKey:m}=t,g=LM(u,m),p=$M(g,u);i.value=new Bo(s.value,{type:d,data:p,options:{...h},plugins:f})},l=()=>{const d=o.toRaw(i.value);d&&(t.destroyDelay>0?setTimeout(()=>{d.destroy(),i.value=null},t.destroyDelay):(d.destroy(),i.value=null))},c=d=>{d.update(t.updateMode)};return o.onMounted(a),o.onUnmounted(l),o.watch([()=>t.options,()=>t.data],(d,u)=>{let[h,f]=d,[m,g]=u;const p=o.toRaw(i.value);if(!p)return;let _=!1;if(h){const y=Ci(h),C=Ci(m);y&&y!==C&&(PM(p,y),_=!0)}if(f){const y=Ci(f.labels),C=Ci(g.labels),b=Ci(f.datasets),S=Ci(g.datasets);y!==C&&(Fm(p.config.data,y),_=!0),b&&b!==S&&(Im(p.config.data,b,t.datasetIdKey),_=!0)}_&&o.nextTick(()=>{c(p)})},{deep:!0}),()=>o.h("canvas",{role:"img",ariaLabel:t.ariaLabel,ariaDescribedby:t.ariaDescribedby,ref:s},[o.h("p",{},[r.default?r.default():""])])}});function VM(t,e){return Bo.register(e),o.defineComponent({props:Rm,setup(n,r){let{expose:s}=r;const i=o.shallowRef(null),a=l=>{i.value=l==null?void 0:l.chart};return s({chart:i}),()=>o.h(NM,EM({ref:a},{type:t,...n}))}})}const zm=VM("line",tl),BM={class:"chart-container"},Lu={__name:"LineChart",props:{data:{type:Array,required:!0},dataType:{type:String,required:!0},ticksCallback:{type:Function,default:t=>t},borderColor:{type:String,default:"#007AFF"},gradient:{type:Object,default:{height:450,startColor:"rgba(0, 122, 255, 0.1)",endColor:"rgba(0, 122, 255, 0)"}}},setup(t){Bo.register(hl,ml,Ao,_r,oM,ym);const e=t;let n=o.reactive({isEmpty:!0});const r=u=>{const h=new Set,f=[];let m=[];switch(e.dataType){case"balanceChartData":m=u.length!==0?u.map(p=>(h.add(p.date),p.balance)):[0,0];break;case"performanceChartData":m=u.length!==0?u.map(p=>(h.add(p.date),p.pnl/p.pnl_to_deposit*100)):[0,0];break}f.push({data:m});const g=Array.from(h);return g.length===1?(g.push(...g),f.forEach(p=>{p.data.push(...p.data)}),n.isEmpty=!1):g.length===0?(n.isEmpty=!0,console.log(n.isEmpty,"isEmptyChart.value"),g.push(0,0)):n.isEmpty=!1,{labels:g,datasets:f}},s=o.computed(()=>r(e.data)),i=u=>{const f=u.chart.ctx.createLinearGradient(0,0,0,e.gradient.height);return f.addColorStop(0,e.gradient.startColor),f.addColorStop(1,e.gradient.endColor),f},a=(u,h)=>{let f=document.querySelector(`#${u}-${e.dataType}`);return f||(f=document.createElement("div"),f.classList.add(u),f.setAttribute("id",`${u}-${e.dataType}`),h.canvas.parentNode.appendChild(f)),f},l=u=>{if(!n.isEmpty){const{chart:h,tooltip:f}=u,m=a("chart-tooltip",h);if(f.opacity===0){m.style.opacity="0";return}if(f.body){const S=f.title||[],M=f.body.map(v=>v.lines),T=document.createElement("div");for(T.classList.add("chart-tooltip-middle"),T.innerHTML=`<div class="chart-tooltip-content">
|
|
35
35
|
${e.dataType==="balanceChartData"?`$${eh(M[0])}`:`${eh(M[0])}%`}
|
|
36
|
-
<span> | ${th(S[0])}, ${X6(S[0])}</span></div>`;m.firstChild;)m.firstChild.remove();m.appendChild(T)}const{offsetLeft:g,offsetTop:p,clientWidth:_}=h.canvas;let y=g+f.caretX;const C=p+f.caretY,b=m.clientWidth;y+b>_&&(y-=b),m.style.opacity="1",m.style.left=y+"px",m.style.top=C+"px"}},c=u=>{const{chart:h}=u,f=a("chart-line",h),m=h.chartArea;h.canvas.addEventListener("mousemove",function(g){const p=h.canvas.getBoundingClientRect(),_=g.clientX-p.left,y=g.clientY-p.top;_>=m.left&&_<=m.right&&y>=m.top&&y<=m.bottom?(f.style.left=_+"px",f.style.top=m.top+"px",f.style.height=m.bottom-m.top+"px",f.style.display="flex"):f.style.display="none"}),h.canvas.addEventListener("mouseout",function(){f.style.display="none"})},d=o.computed(()=>({responsive:!0,maintainAspectRatio:!1,animation:{duration:1500},scales:{x:{ticks:{display:!n.value,callback:function(u){return th(this.getLabelForValue(u)).slice(0,3)},color:"#8E8E93",font:{size:14,weight:400,family:"'SF Pro Display', sans-serif"},padding:15,align:"center"},grid:{display:!1},border:{color:"#EDEDED"}},y:{ticks:{display:!n.value,callback:function(u){return e.ticksCallback(u)},color:"#8E8E93",font:{size:14,weight:400,family:"'SF Pro Display', sans-serif"},padding:15},grid:{color:"#EDEDED",drawTicks:!1},border:{display:!1,dash:[4,4],dashOffset:1}}},plugins:{tooltip:{enabled:!1,position:"nearest",external:l},legend:!1},elements:{line:{backgroundColor:u=>i(u),tension:.3,borderWidth:2,borderColor:e.borderColor,fill:"start",spanGaps:!0},point:{pointStyle:"circle",pointRadius:1,pointHoverRadius:8,pointBackgroundColor:e.borderColor,pointBorderWidth:0,pointHoverBorderWidth:3,pointBorderColor:"#fff",pointHoverBorderColor:"#fff",pointHitRadius:50}},onHover:c}));return(u,h)=>(o.openBlock(),o.createElementBlock("div",BM,[o.createVNode(o.unref(zm),{data:s.value,options:d.value},null,8,["data","options"])]))}},Hm={__name:"SimpleLineChart",props:{data:{type:Array,required:!0},borderColor:{type:String,default:"#56B683"},gradient:{type:Object,default:{height:200,startColor:"rgba(86, 182, 131, 0.1)",endColor:"rgba(86, 182, 131, 0)"}}},setup(t){Bo.register(hl,ml,Ao,_r,ym);const e=t,n=a=>{const l=new Set,c=[],d=a.map(h=>(l.add(h.date),h.balance));return c.push({data:d}),{labels:Array.from(l),datasets:c}},r=o.computed(()=>n(e.data)),s=a=>{const c=a.chart.ctx.createLinearGradient(0,0,0,e.gradient.height);return c.addColorStop(0,e.gradient.startColor),c.addColorStop(1,e.gradient.endColor),c},i=o.ref({responsive:!0,maintainAspectRatio:!1,animation:{duration:1500},interaction:{mode:"index",intersect:!1},scales:{x:{display:!1},y:{display:!1}},plugins:{tooltip:!1,legend:!1},elements:{line:{backgroundColor:a=>s(a),tension:.3,borderWidth:4,borderColor:e.borderColor,fill:"start",spanGaps:!0},point:{pointStyle:!1}}});return(a,l)=>(o.openBlock(),o.createBlock(o.unref(zm),{data:r.value,options:i.value},null,8,["data","options"]))}},AM=t=>(o.pushScopeId("data-v-0fba0097"),t=t(),o.popScopeId(),t),RM={class:"account-balance-widget"},FM={class:"account-balance-widget__top"},IM={class:"account-balance-widget__title-wrapper"},zM=AM(()=>o.createElementVNode("div",{class:"account-balance-widget__title"},"Account Balance",-1)),HM=De({__name:"AccountBalanceWidget",props:{balanceChartData:{type:Array,default:[]},isShare:{type:Boolean,default:!1}},setup(t){const e=o.ref("week"),n=r=>r>=1e3||r<=-1e3?Vt(r/1e3,2)+"k":Vt(r,2);return(r,s)=>(o.openBlock(),o.createElementBlock("div",RM,[o.createElementVNode("div",FM,[o.createElementVNode("div",IM,[zM,o.createVNode(o.unref(fn),{alternative:""},{default:o.withCtx(()=>[o.createTextVNode("Reflects your deposit growth over the previous date. One of the most reliable indicator of profit for a trader. ")]),_:1})]),t.isShare?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(o.unref(Ys),{key:0,modelValue:e.value,"onUpdate:modelValue":s[0]||(s[0]=i=>e.value=i),onOnChange:s[1]||(s[1]=i=>r.$emit("onChange",e.value))},null,8,["modelValue"]))]),o.createVNode(o.unref(Lu),{data:t.balanceChartData,"data-type":"balanceChartData","ticks-callback":n},null,8,["data"])]))}},[["__scopeId","data-v-0fba0097"]]),Nu=t=>(o.pushScopeId("data-v-bea459d0"),t=t(),o.popScopeId(),t),YM={class:"balance-widget"},WM={class:"balance-part"},jM={class:"balance-part__top"},ZM={class:"balance-part__title-wrapper"},UM=Nu(()=>o.createElementVNode("div",{class:"balance-part__title"},"Balance",-1)),qM={class:"balance-part__content"},GM={class:"balance-part__content__wrapper"},KM={class:"balance-part__content__count"},XM={class:"balance-part__content__bitcoin"},QM={key:0,class:"devider"},JM={key:1,class:"personal-target-part"},ev={class:"personal-target-part__top"},tv={class:"personal-target-part__title-wrapper"},nv=Nu(()=>o.createElementVNode("div",{class:"personal-target-part__title"},"Personal target",-1)),rv=Nu(()=>o.createElementVNode("br",null,null,-1)),sv={class:"personal-target-part__content"},iv={class:"personal-target-part__content__current"},ov={class:"personal-target-part__content__from"},av=De({__name:"BalanceWidget",props:{BTC:{type:Number,default:0},USDT:{type:Number,default:0},delta:{type:Number,default:0},balanceChartData:{type:Array,default:[]},currentProfit:{type:Number,default:0},profit:{type:Number,default:0},drawdown:{type:Number,default:0},isPercentage:Boolean,isShare:{type:Boolean,default:!1}},emits:["switchModal"],setup(t,{emit:e}){const n=e,r=t,s=o.ref(!1),i=o.computed(()=>s.value?"****":r.BTC),a=o.computed(()=>s.value?"****":r.USDT),l=()=>{s.value=!s.value};return(c,d)=>(o.openBlock(),o.createElementBlock("div",YM,[o.createElementVNode("div",WM,[o.createElementVNode("div",jM,[o.createElementVNode("div",ZM,[UM,o.createVNode(o.unref(fn),{alternative:""},{default:o.withCtx(()=>[o.createTextVNode("Reflects your deposit size in US Dollars and BTC equivalent and growth over the previous date. One of the most reliable indicator of profit for a trader.")]),_:1})]),t.isShare?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",{key:0,class:"balance-part__visibility-switcher",onClick:l},[o.withDirectives(o.createVNode(o.unref(Ve),{icon:"eye"},null,512),[[o.vShow,s.value]]),o.withDirectives(o.createVNode(o.unref(Ve),{icon:"eye-slash"},null,512),[[o.vShow,!s.value]])]))]),o.createElementVNode("div",qM,[o.createElementVNode("div",GM,[o.createElementVNode("div",KM,o.toDisplayString(o.unref(ln)(a.value)),1),t.delta?(o.openBlock(),o.createBlock(o.unref(Yl),{key:0,"is-hidden":s.value,percentage:"",delta:t.delta},null,8,["is-hidden","delta"])):o.createCommentVNode("",!0)]),o.createElementVNode("div",XM,"= "+o.toDisplayString(i.value)+" BTC",1)]),o.createVNode(o.unref(Hm),{class:"balance-part__chart",data:t.balanceChartData},null,8,["data"])]),t.isShare?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",QM)),t.isShare?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",JM,[o.createElementVNode("div",ev,[o.createElementVNode("div",tv,[nv,o.createVNode(o.unref(fn),{alternative:""},{default:o.withCtx(()=>[o.createTextVNode(" This widget allows you to set a personal profit goal expressed in $ for a certain period "),rv,o.createTextVNode(" Pay attention: in the widget, we calculate Net PNL excluding entry and exit commissions, as well as funding ")]),_:1})]),o.createElementVNode("div",{class:"balance-part__modal-switcher",onClick:d[0]||(d[0]=u=>n("switchModal"))},[o.createVNode(o.unref(Ve),{icon:"settings"})])]),o.createElementVNode("div",sv,[o.createElementVNode("div",iv,o.toDisplayString(o.unref(ln)(t.currentProfit,{isPercentage:t.isPercentage,isFixed:!0})),1),o.createElementVNode("div",ov,"/ "+o.toDisplayString(o.unref(ln)(t.profit,{isPercentage:t.isPercentage,isFixed:!0})),1)]),o.createVNode(o.unref(Yp),{"current-profit":t.currentProfit,drawdown:t.drawdown,profit:t.profit,"is-percentage":t.isPercentage},null,8,["current-profit","drawdown","profit","is-percentage"])]))]))}},[["__scopeId","data-v-bea459d0"]]),Io=t=>(o.pushScopeId("data-v-bd464497"),t=t(),o.popScopeId(),t),lv={class:"calendar-widget"},cv={class:"calendar-widget__calendar"},dv={class:"calendar-widget__top"},uv={class:"calendar-widget__title-wrapper"},hv=Io(()=>o.createElementVNode("div",{class:"calendar-widget__title"},"Calendar",-1)),fv=Io(()=>o.createElementVNode("br",null,null,-1)),mv={class:"stat-calendar"},pv={class:"stat-calendar__week-days"},gv={key:0,class:"stat-calendar__row-wrapper"},_v={class:"stat-calendar__row"},yv=["onClick"],wv=Io(()=>o.createElementVNode("div",{class:"calendar-widget__divider"},null,-1)),bv={key:0,class:"calendar-widget__day"},kv={class:"calendar-widget__day__title"},Cv={class:"calendar-widget__day__content"},xv={class:"calendar-widget__point"},Mv={class:"calendar-widget__point__title"},vv=Io(()=>o.createElementVNode("div",{class:"calendar-widget__point__line"},null,-1)),Sv={class:"calendar-widget__day__trades"},Tv={class:"calendar-widget__point"},Dv={class:"calendar-widget__point__title"},Ov=Io(()=>o.createElementVNode("div",{class:"calendar-widget__point__line"},null,-1)),Ev=De({__name:"CalendarWidget",props:{rows:Array,dailyStatData:Object,currentDate:Date,calendarPointsTop:Array,calendarPointsBottom:Array,isCurrentDate:Function,isCurrentDay:Function},emits:["setNewDate","chooseMonth"],setup(t,{emit:e}){const n=["Su","Mo","Tu","We","Th","Fr","Sa"],r=o.ref(null),s=o.ref(null),i=e,a=l=>{r.value=l.year,s.value=l.month,i("chooseMonth",l)};return o.nextTick(()=>{const l=new Date;r.value=l.getFullYear(),s.value=l.getMonth()}),(l,c)=>{var d,u;return o.openBlock(),o.createElementBlock("div",lv,[o.createElementVNode("div",cv,[o.createElementVNode("div",dv,[o.createElementVNode("div",uv,[hv,o.createVNode(o.unref(fn),{alternative:""},{default:o.withCtx(()=>[o.createTextVNode("Displays profitable days on green, losing days in red and trading days without significant profit or loss in blue. Also when you click on a specific date, more detailed information about trading day is displayed. "),fv,o.createTextVNode("Pay attention: in the widget, we calculate Net PNL excluding entry and exit commissions, as well as funding ")]),_:1})]),t.currentDate?(o.openBlock(),o.createBlock(o.unref(Hp),{key:0,"current-date":t.currentDate,onOnChange:a,year:r.value,"onUpdate:year":c[0]||(c[0]=h=>r.value=h),month:s.value,"onUpdate:month":c[1]||(c[1]=h=>s.value=h)},null,8,["current-date","year","month"])):o.createCommentVNode("",!0)]),o.createElementVNode("div",mv,[o.createElementVNode("div",pv,[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(n,(h,f)=>o.createElementVNode("div",{class:o.normalizeClass(["stat-calendar__week-day",{"-current":t.isCurrentDay(f)}])},o.toDisplayString(h),3)),64))]),t.rows?(o.openBlock(),o.createElementBlock("div",gv,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.rows,h=>(o.openBlock(),o.createElementBlock("div",_v,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(h,f=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["stat-calendar__day",{"-empty":!f.date,"-current":t.isCurrentDate(f.date),"-positive":f.win,"-negative":f.win===!1}]),onClick:m=>i("setNewDate",f.date)},o.toDisplayString(f.date?f.date:""),11,yv))),256))]))),256))])):o.createCommentVNode("",!0)])]),wv,t.dailyStatData&&!t.dailyStatData.isNull?(o.openBlock(),o.createElementBlock("div",bv,[o.createElementVNode("div",kv,o.toDisplayString(t.currentDate.getDate()+" "+t.currentDate.toLocaleString("en-us",{month:"long"})),1),o.createElementVNode("div",Cv,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.calendarPointsTop,h=>(o.openBlock(),o.createElementBlock("div",xv,[o.createElementVNode("div",Mv,o.toDisplayString(h.title),1),vv,o.createElementVNode("div",{class:o.normalizeClass(["calendar-widget__point__value",h.class?h.class:""])},o.toDisplayString(h.value),3)]))),256)),o.createVNode(o.unref(V0),{long:(d=t.dailyStatData)==null?void 0:d.long_count,short:(u=t.dailyStatData)==null?void 0:u.short_count},null,8,["long","short"]),o.createElementVNode("div",Sv,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.calendarPointsBottom,h=>(o.openBlock(),o.createElementBlock("div",Tv,[o.createElementVNode("div",Dv,o.toDisplayString(h.title),1),Ov,o.createVNode(o.unref(Yl),{"is-positive":h.isPositive,"is-negative":h.isNegative,delta:h.value},null,8,["is-positive","is-negative","delta"])]))),256))])])])):(o.openBlock(),o.createBlock(o.unref(qd),{key:1,class:"-empty"}))])}}},[["__scopeId","data-v-bd464497"]]),wl=t=>(o.pushScopeId("data-v-5fe5d142"),t=t(),o.popScopeId(),t),$v={class:"commission-widget"},Pv={class:"commission-widget__content"},Lv={class:"commission-widget__top"},Nv={class:"commission-widget__title-wrapper"},Vv=wl(()=>o.createElementVNode("div",{class:"commission-widget__title"},"Commissions and Fees",-1)),Bv=wl(()=>o.createElementVNode("br",null,null,-1)),Av={class:"commission-widget__info"},Rv={class:"commission-widget__total-wrapper"},Fv=wl(()=>o.createElementVNode("div",{class:"commission-widget__total-wrapper__title"},"Total",-1)),Iv={class:"commission-widget__total-wrapper__total"},zv={class:"commission-widget__total-wrapper__value"},Hv={class:"commission-widget__points"},Yv={class:"commission-widget__point"},Wv={class:"commission-widget__point__title"},jv=wl(()=>o.createElementVNode("div",{class:"commission-widget__point__line"},null,-1)),Zv=De({__name:"CommissionsFeesWidget",props:{commission:Number,commissionPoints:Array},emits:["onChange"],setup(t,{emit:e}){const n=o.ref("week"),r=e;return(s,i)=>(o.openBlock(),o.createElementBlock("div",$v,[o.createElementVNode("div",Pv,[o.createElementVNode("div",Lv,[o.createElementVNode("div",Nv,[Vv,o.createVNode(o.unref(fn),{alternative:""},{default:o.withCtx(()=>[o.createTextVNode("The amount of total commissions and fees for the selected previous period including the current date. This widget also shows commission to profit ratio in $/% and average amount of fees per trade."),Bv,o.createTextVNode("Pay attention: in the widget, we calculate Net PNL excluding entry and exit commissions, as well as funding ")]),_:1})]),o.createVNode(o.unref(Ys),{modelValue:n.value,"onUpdate:modelValue":i[0]||(i[0]=a=>n.value=a),onOnChange:i[1]||(i[1]=a=>r("onChange",n.value))},null,8,["modelValue"])]),o.createElementVNode("div",Av,[o.createElementVNode("div",Rv,[Fv,o.createElementVNode("div",Iv,[o.createElementVNode("div",zv," $"+o.toDisplayString(o.unref(Vt)(t.commission)),1)])]),o.createElementVNode("div",Hv,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.commissionPoints,(a,l)=>(o.openBlock(),o.createElementBlock("div",Yv,[o.createElementVNode("div",Wv,o.toDisplayString(a.title),1),jv,o.createElementVNode("div",{class:o.normalizeClass(["commission-widget__point__value",a.class?a.class:""])},o.toDisplayString(a.value),3)]))),256))])])])]))}},[["__scopeId","data-v-5fe5d142"]]),Ym=t=>(o.pushScopeId("data-v-71fad3e1"),t=t(),o.popScopeId(),t),Uv={class:"performance-widget"},qv={class:"performance-widget__top"},Gv={class:"performance-widget__title-wrapper"},Kv=Ym(()=>o.createElementVNode("div",{class:"performance-widget__title"},"Performance (cumulative)",-1)),Xv=Ym(()=>o.createElementVNode("br",null,null,-1)),Qv=De({__name:"PerformanceWidget",props:{performanceChartData:{type:Array,default:[]},isShare:{type:Boolean,default:!1}},setup(t){const e=o.ref("week"),n=r=>Vt(r,2)+"%";return(r,s)=>(o.openBlock(),o.createElementBlock("div",Uv,[o.createElementVNode("div",qv,[o.createElementVNode("div",Gv,[Kv,o.createVNode(o.unref(fn),{alternative:""},{default:o.withCtx(()=>[o.createTextVNode("The amount of profit for the selected previous period including the current date. This widget shows the growth or loss of the deposit in %. The widget is available as a line graph."),Xv,o.createTextVNode(" Pay attention: in the widget, we calculate Net PNL excluding entry and exit commissions, as well as funding ")]),_:1})]),t.isShare?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(o.unref(Ys),{key:0,modelValue:e.value,"onUpdate:modelValue":s[0]||(s[0]=i=>e.value=i),onOnChange:s[1]||(s[1]=i=>r.$emit("onChange",e.value))},null,8,["modelValue"]))]),o.createVNode(o.unref(Lu),{data:t.performanceChartData,"data-type":"performanceChartData","ticks-callback":n},null,8,["data"])]))}},[["__scopeId","data-v-71fad3e1"]]),bl=t=>(o.pushScopeId("data-v-c52bb3a2"),t=t(),o.popScopeId(),t),Jv={class:"return-widget"},eS={class:"return-widget__content"},tS={class:"return-widget__top"},nS={class:"return-widget__title-wrapper"},rS=bl(()=>o.createElementVNode("div",{class:"return-widget__title"},"Return",-1)),sS=bl(()=>o.createElementVNode("br",null,null,-1)),iS={class:"return-widget__info"},oS={class:"return-widget__total-wrapper"},aS=bl(()=>o.createElementVNode("div",{class:"return-widget__total-wrapper__title"},"Total",-1)),lS={class:"return-widget__total-wrapper__total"},cS={class:"return-widget__points"},dS={class:"return-widget__point"},uS={class:"return-widget__point__title"},hS=bl(()=>o.createElementVNode("div",{class:"return-widget__point__line"},null,-1)),fS=["innerHTML"],mS=De({__name:"ReturnWidget",props:{returnData:Object,isShare:{type:Boolean,default:!1}},emits:["onChange"],setup(t,{emit:e}){const n=o.ref("week"),r=e,s=t,i=o.computed(()=>s.returnData?s.returnData.profit_factor:0),a=o.computed(()=>s.returnData?s.returnData.return_period:0),l=o.computed(()=>[{title:"Average return per trade",value:c.value||0,options:{isPlus:!0,isFixed:!0},class:c.value>=0?"-win":"-loss"},{title:"Daily return",value:d.value||0,options:{isPlus:!0,isFixed:!0},class:d.value>=0?"-win":"-loss"},{title:"Return on winners",value:u.value||0},{title:"Return on losers",value:h.value||0}]),c=o.computed(()=>s.returnData&&s.returnData.avarage_total_return),d=o.computed(()=>s.returnData&&s.returnData.daily),u=o.computed(()=>s.returnData&&s.returnData.win),h=o.computed(()=>s.returnData&&s.returnData.lose),f=o.computed(()=>s.returnData&&s.returnData.period_balance_change_rate),m=o.computed(()=>a.value>0),g=o.computed(()=>a.value<0),p=o.computed(()=>i.value>1?"-positive":"-negative"),_=o.computed(()=>i.value>0?`Your profit factor is ${Vt(i.value,2)}. <br /> You earn ${ln(i.value)} on every $1 loss.`:`Your profit factor is ${Vt(i.value,2)}. <br/> You loss ${ln(Math.abs(i.value))} on every $1 earn. `);return(y,C)=>(o.openBlock(),o.createElementBlock("div",Jv,[o.createElementVNode("div",eS,[o.createElementVNode("div",tS,[o.createElementVNode("div",nS,[rS,o.createVNode(o.unref(fn),{alternative:""},{default:o.withCtx(()=>[o.createTextVNode("The amount of profit in $ and % for the selected previous period including the current date. This widget also shows the amount of profit and loss separately."),sS,o.createTextVNode("Pay attention: in the widget, we calculate Net PNL excluding entry and exit commissions, as well as funding ")]),_:1})]),t.isShare?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(o.unref(Ys),{key:0,modelValue:n.value,"onUpdate:modelValue":C[0]||(C[0]=b=>n.value=b),onOnChange:C[1]||(C[1]=b=>r("onChange",n.value))},null,8,["modelValue"]))]),o.createElementVNode("div",iS,[o.createElementVNode("div",oS,[aS,o.createElementVNode("div",lS,[o.createElementVNode("div",{class:o.normalizeClass(["return-widget__total-wrapper__value",{"-positive":m.value,"-negative":g.value}])},o.toDisplayString(o.unref(ln)(a.value,{isPlus:!0,isFixed:!0})),3),f.value?(o.openBlock(),o.createBlock(o.unref(Yl),{key:0,percentage:"",delta:f.value},null,8,["delta"])):o.createCommentVNode("",!0)])]),o.createElementVNode("div",cS,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(l.value,b=>(o.openBlock(),o.createElementBlock("div",dS,[o.createElementVNode("div",uS,o.toDisplayString(b.title),1),hS,o.createElementVNode("div",{class:o.normalizeClass(["return-widget__point__value",b.class?b.class:""])},o.toDisplayString(o.unref(ln)(b.value,b.options)),3)]))),256))])])]),i.value?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["return-widget__profit",p.value])},[o.createVNode(o.unref(Ve),{icon:"tip",class:"return-widget__profit__icon"}),o.createElementVNode("div",{class:"return-widget__profit__text",innerHTML:_.value},null,8,fS)],2)):o.createCommentVNode("",!0)]))}},[["__scopeId","data-v-c52bb3a2"]]),Vu=t=>(o.pushScopeId("data-v-69c2a2fa"),t=t(),o.popScopeId(),t),pS={class:"top-positions-widget"},gS={class:"top-positions-widget__top"},_S={class:"top-positions-widget__title-wrapper"},yS=Vu(()=>o.createElementVNode("div",{class:"top-positions-widget__title"},"Top-3 Positions",-1)),wS=Vu(()=>o.createElementVNode("br",null,null,-1)),bS={key:0,class:"top-positions-widget__returns"},kS={class:"top-positions-widget__return"},CS={class:"top-positions-widget__return__left"},xS=Vu(()=>o.createElementVNode("div",{class:"top-positions-widget__return__line"},null,-1)),MS={class:"top-positions-widget__return__pair"},vS={class:"top-positions-widget__return__right"},SS={class:"top-positions-widget__return__pnl"},TS=De({__name:"TopPositionsWidget",props:{topPositions:{type:Array,default:[]}},emits:["onChange"],setup(t,{emit:e}){const n=o.ref("week"),r=e;return(s,i)=>(o.openBlock(),o.createElementBlock("div",pS,[o.createElementVNode("div",gS,[o.createElementVNode("div",_S,[yS,o.createVNode(o.unref(fn),{alternative:""},{default:o.withCtx(()=>[o.createTextVNode("Displays 3 most profitable trades of the selected period. You can also see the trading pair and trade profit to balance ratio. "),wS,o.createTextVNode("Pay attention: in the widget, we calculate Net PNL excluding entry and exit commissions, as well as funding ")]),_:1})]),o.createVNode(o.unref(Ys),{modelValue:n.value,"onUpdate:modelValue":i[0]||(i[0]=a=>n.value=a),onOnChange:i[1]||(i[1]=a=>r("onChange",n.value))},null,8,["modelValue"])]),t.topPositions&&t.topPositions.length?(o.openBlock(),o.createElementBlock("div",bS,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.topPositions,a=>(o.openBlock(),o.createElementBlock("div",kS,[o.createElementVNode("div",CS,[xS,o.createElementVNode("div",MS,o.toDisplayString(o.unref(Q6)(a.pair)),1)]),o.createElementVNode("div",vS,[o.createElementVNode("div",SS,o.toDisplayString(o.unref(ln)(a.pnl,{isFixed:!0,isPlus:!0})),1),o.createElementVNode("div",{class:o.normalizeClass(["top-positions-widget__return__roi",a.roi<0?"-negative":"-positive"])},[o.createVNode(o.unref(Ve),{icon:"bxs_up-arrow"}),o.createElementVNode("span",null,o.toDisplayString(o.unref(ln)(a.roi,{isPercentage:!0,isFixed:!0})),1)],2)])]))),256))])):(o.openBlock(),o.createBlock(o.unref(qd),{key:1,title:"No more pair",subtitle:"No data available for the specified period",icon:"coins-add"}))]))}},[["__scopeId","data-v-69c2a2fa"]]),Bu=t=>(o.pushScopeId("data-v-7b67b5c8"),t=t(),o.popScopeId(),t),DS={class:"trade-widget"},OS={class:"trade-widget__content"},ES={class:"trade-widget__top"},$S={class:"trade-widget__title-wrapper"},PS=Bu(()=>o.createElementVNode("div",{class:"trade-widget__title"},"Trades Performance",-1)),LS={class:"trade-widget__info"},NS={class:"trade-widget__total-wrapper"},VS=Bu(()=>o.createElementVNode("div",{class:"trade-widget__total-wrapper__title"},"Total",-1)),BS={class:"trade-widget__total-wrapper__total"},AS={class:"trade-widget__total-wrapper__value"},RS={class:"trade-widget__points"},FS={class:"trade-widget__point"},IS={class:"trade-widget__point__title"},zS=Bu(()=>o.createElementVNode("div",{class:"trade-widget__point__line"},null,-1)),HS=De({__name:"TradePerformanceWidget",props:{totalTrades:Number,tradePoints:Array},emits:["onChange"],setup(t,{emit:e}){const n=o.ref("week"),r=e;return(s,i)=>(o.openBlock(),o.createElementBlock("div",DS,[o.createElementVNode("div",OS,[o.createElementVNode("div",ES,[o.createElementVNode("div",$S,[PS,o.createVNode(o.unref(fn),{alternative:""},{default:o.withCtx(()=>[o.createTextVNode("This widget displays number of total winning & trades. Also it indicates the average number of trades for selected period. ")]),_:1})]),o.createVNode(o.unref(Ys),{modelValue:n.value,"onUpdate:modelValue":i[0]||(i[0]=a=>n.value=a),onOnChange:i[1]||(i[1]=a=>r("onChange",n.value))},null,8,["modelValue"])]),o.createElementVNode("div",LS,[o.createElementVNode("div",NS,[VS,o.createElementVNode("div",BS,[o.createElementVNode("div",AS,o.toDisplayString(t.totalTrades),1)])]),o.createElementVNode("div",RS,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.tradePoints,a=>(o.openBlock(),o.createElementBlock("div",FS,[o.createElementVNode("div",IS,o.toDisplayString(a.title),1),zS,o.createElementVNode("div",{class:o.normalizeClass(["trade-widget__point__value",a.class?a.class:""])},o.toDisplayString(a.value),3)]))),256))])])])]))}},[["__scopeId","data-v-7b67b5c8"]]),kl=t=>(o.pushScopeId("data-v-7a9040de"),t=t(),o.popScopeId(),t),YS={class:"winrate-widget"},WS={class:"winrate-widget__winrate"},jS={class:"winrate-widget__title-wrapper"},ZS=kl(()=>o.createElementVNode("div",{class:"winrate-widget__title"},"Winrate",-1)),US=kl(()=>o.createElementVNode("br",null,null,-1)),qS={class:"winrate-widget__chart"},GS={class:"winrate-widget__data"},KS={class:"winrate-widget__data_value"},XS=kl(()=>o.createElementVNode("div",{class:"winrate-widget__data_title"},"Winrate",-1)),QS={class:"winrate-widget__average-rr"},JS={class:"winrate-widget__title-wrapper"},eT=kl(()=>o.createElementVNode("div",{class:"winrate-widget__title"},"Average RR",-1)),tT=De({__name:"WinrateWidget",props:{winrate:{type:Number,default:0},minRR:{type:Number,default:0},averageRR:{type:Number,default:0},maxRR:{type:Number,default:0}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("div",YS,[o.createElementVNode("div",WS,[o.createElementVNode("div",jS,[ZS,o.createVNode(o.unref(fn),{alternative:""},{default:o.withCtx(()=>[o.createTextVNode("This widget displays the percentage of successful trades and the average RR. "),US,o.createTextVNode("Pay attention: in the widget, we calculate Net PNL excluding entry and exit commissions, as well as funding ")]),_:1})]),o.createElementVNode("div",qS,[o.renderSlot(e.$slots,"roundSlider",{},void 0,!0),o.createElementVNode("div",GS,[o.createElementVNode("div",KS,o.toDisplayString(o.unref(Vt)(t.winrate,2))+"%",1),XS])])]),o.createElementVNode("div",QS,[o.createElementVNode("div",JS,[eT,o.createVNode(o.unref(fn),{alternative:""},{default:o.withCtx(()=>[o.createTextVNode("The risk/reward ratio - marks the prospective reward a trader can earn for every dollar they risk on a trade. ")]),_:1})]),o.createVNode(o.unref(Wm),{avg:t.averageRR,min:t.minRR,max:t.maxRR},null,8,["avg","min","max"])])]))}},[["__scopeId","data-v-7a9040de"]]),nT=t=>(o.pushScopeId("data-v-2f6cbb5e"),t=t(),o.popScopeId(),t),rT={class:"average-rr-line-container"},sT={class:"average-rr-line"},iT={key:0,class:"average-rr-line__progress"},oT=[nT(()=>o.createElementVNode("div",{class:"average-rr-line__dot"},null,-1))],aT={class:"coefficients"},lT={class:"coefficients__value -min"},cT={class:"coefficients__value -avg"},dT={class:"coefficients__value -max"},Wm=De({__name:"AverageRRLine",props:{min:{type:Number,default:0},avg:{type:Number,default:0},max:{type:Number,default:0}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("div",rT,[o.createElementVNode("div",sT,[t.avg&&t.max?(o.openBlock(),o.createElementBlock("div",iT,oT)):o.createCommentVNode("",!0)]),o.createElementVNode("div",aT,[o.createElementVNode("div",lT,o.toDisplayString(t.min),1),o.createElementVNode("div",cT,o.toDisplayString(o.unref(Vt)(t.avg)),1),o.createElementVNode("div",dT,o.toDisplayString(o.unref(Vt)(t.max)),1)])]))}},[["__scopeId","data-v-2f6cbb5e"]]);//! moment.js
|
|
36
|
+
<span> | ${th(S[0])}, ${X6(S[0])}</span></div>`;m.firstChild;)m.firstChild.remove();m.appendChild(T)}const{offsetLeft:g,offsetTop:p,clientWidth:_}=h.canvas;let y=g+f.caretX;const C=p+f.caretY,b=m.clientWidth;y+b>_&&(y-=b),m.style.opacity="1",m.style.left=y+"px",m.style.top=C+"px"}},c=u=>{const{chart:h}=u,f=a("chart-line",h),m=h.chartArea;h.canvas.addEventListener("mousemove",function(g){const p=h.canvas.getBoundingClientRect(),_=g.clientX-p.left,y=g.clientY-p.top;_>=m.left&&_<=m.right&&y>=m.top&&y<=m.bottom?(f.style.left=_+"px",f.style.top=m.top+"px",f.style.height=m.bottom-m.top+"px",f.style.display="flex"):f.style.display="none"}),h.canvas.addEventListener("mouseout",function(){f.style.display="none"})},d=o.computed(()=>(console.log(n.isEmpty,"chartConfig.isEmpty"),{responsive:!0,maintainAspectRatio:!1,animation:{duration:1500},scales:{x:{ticks:{display:!n.isEmpty,callback:function(u){return th(this.getLabelForValue(u)).slice(0,3)},color:"#8E8E93",font:{size:14,weight:400,family:"'SF Pro Display', sans-serif"},padding:15,align:"center"},grid:{display:!1},border:{color:"#EDEDED"}},y:{ticks:{display:!n.isEmpty,callback:function(u){return e.ticksCallback(u)},color:"#8E8E93",font:{size:14,weight:400,family:"'SF Pro Display', sans-serif"},padding:15},grid:{color:"#EDEDED",drawTicks:!1},border:{display:!1,dash:[4,4],dashOffset:1}}},plugins:{tooltip:{enabled:!1,position:"nearest",external:l},legend:!1},elements:{line:{backgroundColor:u=>i(u),tension:.3,borderWidth:2,borderColor:e.borderColor,fill:"start",spanGaps:!0},point:{pointStyle:"circle",pointRadius:1,pointHoverRadius:8,pointBackgroundColor:e.borderColor,pointBorderWidth:0,pointHoverBorderWidth:3,pointBorderColor:"#fff",pointHoverBorderColor:"#fff",pointHitRadius:50}},onHover:c}));return(u,h)=>(o.openBlock(),o.createElementBlock("div",BM,[o.createVNode(o.unref(zm),{data:s.value,options:d.value},null,8,["data","options"])]))}},Hm={__name:"SimpleLineChart",props:{data:{type:Array,required:!0},borderColor:{type:String,default:"#56B683"},gradient:{type:Object,default:{height:200,startColor:"rgba(86, 182, 131, 0.1)",endColor:"rgba(86, 182, 131, 0)"}}},setup(t){Bo.register(hl,ml,Ao,_r,ym);const e=t,n=a=>{const l=new Set,c=[],d=a.map(h=>(l.add(h.date),h.balance));return c.push({data:d}),{labels:Array.from(l),datasets:c}},r=o.computed(()=>n(e.data)),s=a=>{const c=a.chart.ctx.createLinearGradient(0,0,0,e.gradient.height);return c.addColorStop(0,e.gradient.startColor),c.addColorStop(1,e.gradient.endColor),c},i=o.ref({responsive:!0,maintainAspectRatio:!1,animation:{duration:1500},interaction:{mode:"index",intersect:!1},scales:{x:{display:!1},y:{display:!1}},plugins:{tooltip:!1,legend:!1},elements:{line:{backgroundColor:a=>s(a),tension:.3,borderWidth:4,borderColor:e.borderColor,fill:"start",spanGaps:!0},point:{pointStyle:!1}}});return(a,l)=>(o.openBlock(),o.createBlock(o.unref(zm),{data:r.value,options:i.value},null,8,["data","options"]))}},AM=t=>(o.pushScopeId("data-v-0fba0097"),t=t(),o.popScopeId(),t),RM={class:"account-balance-widget"},FM={class:"account-balance-widget__top"},IM={class:"account-balance-widget__title-wrapper"},zM=AM(()=>o.createElementVNode("div",{class:"account-balance-widget__title"},"Account Balance",-1)),HM=De({__name:"AccountBalanceWidget",props:{balanceChartData:{type:Array,default:[]},isShare:{type:Boolean,default:!1}},setup(t){const e=o.ref("week"),n=r=>r>=1e3||r<=-1e3?Vt(r/1e3,2)+"k":Vt(r,2);return(r,s)=>(o.openBlock(),o.createElementBlock("div",RM,[o.createElementVNode("div",FM,[o.createElementVNode("div",IM,[zM,o.createVNode(o.unref(fn),{alternative:""},{default:o.withCtx(()=>[o.createTextVNode("Reflects your deposit growth over the previous date. One of the most reliable indicator of profit for a trader. ")]),_:1})]),t.isShare?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(o.unref(Ys),{key:0,modelValue:e.value,"onUpdate:modelValue":s[0]||(s[0]=i=>e.value=i),onOnChange:s[1]||(s[1]=i=>r.$emit("onChange",e.value))},null,8,["modelValue"]))]),o.createVNode(o.unref(Lu),{data:t.balanceChartData,"data-type":"balanceChartData","ticks-callback":n},null,8,["data"])]))}},[["__scopeId","data-v-0fba0097"]]),Nu=t=>(o.pushScopeId("data-v-bea459d0"),t=t(),o.popScopeId(),t),YM={class:"balance-widget"},WM={class:"balance-part"},jM={class:"balance-part__top"},ZM={class:"balance-part__title-wrapper"},UM=Nu(()=>o.createElementVNode("div",{class:"balance-part__title"},"Balance",-1)),qM={class:"balance-part__content"},GM={class:"balance-part__content__wrapper"},KM={class:"balance-part__content__count"},XM={class:"balance-part__content__bitcoin"},QM={key:0,class:"devider"},JM={key:1,class:"personal-target-part"},ev={class:"personal-target-part__top"},tv={class:"personal-target-part__title-wrapper"},nv=Nu(()=>o.createElementVNode("div",{class:"personal-target-part__title"},"Personal target",-1)),rv=Nu(()=>o.createElementVNode("br",null,null,-1)),sv={class:"personal-target-part__content"},iv={class:"personal-target-part__content__current"},ov={class:"personal-target-part__content__from"},av=De({__name:"BalanceWidget",props:{BTC:{type:Number,default:0},USDT:{type:Number,default:0},delta:{type:Number,default:0},balanceChartData:{type:Array,default:[]},currentProfit:{type:Number,default:0},profit:{type:Number,default:0},drawdown:{type:Number,default:0},isPercentage:Boolean,isShare:{type:Boolean,default:!1}},emits:["switchModal"],setup(t,{emit:e}){const n=e,r=t,s=o.ref(!1),i=o.computed(()=>s.value?"****":r.BTC),a=o.computed(()=>s.value?"****":r.USDT),l=()=>{s.value=!s.value};return(c,d)=>(o.openBlock(),o.createElementBlock("div",YM,[o.createElementVNode("div",WM,[o.createElementVNode("div",jM,[o.createElementVNode("div",ZM,[UM,o.createVNode(o.unref(fn),{alternative:""},{default:o.withCtx(()=>[o.createTextVNode("Reflects your deposit size in US Dollars and BTC equivalent and growth over the previous date. One of the most reliable indicator of profit for a trader.")]),_:1})]),t.isShare?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",{key:0,class:"balance-part__visibility-switcher",onClick:l},[o.withDirectives(o.createVNode(o.unref(Ve),{icon:"eye"},null,512),[[o.vShow,s.value]]),o.withDirectives(o.createVNode(o.unref(Ve),{icon:"eye-slash"},null,512),[[o.vShow,!s.value]])]))]),o.createElementVNode("div",qM,[o.createElementVNode("div",GM,[o.createElementVNode("div",KM,o.toDisplayString(o.unref(ln)(a.value)),1),t.delta?(o.openBlock(),o.createBlock(o.unref(Yl),{key:0,"is-hidden":s.value,percentage:"",delta:t.delta},null,8,["is-hidden","delta"])):o.createCommentVNode("",!0)]),o.createElementVNode("div",XM,"= "+o.toDisplayString(i.value)+" BTC",1)]),o.createVNode(o.unref(Hm),{class:"balance-part__chart",data:t.balanceChartData},null,8,["data"])]),t.isShare?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",QM)),t.isShare?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",JM,[o.createElementVNode("div",ev,[o.createElementVNode("div",tv,[nv,o.createVNode(o.unref(fn),{alternative:""},{default:o.withCtx(()=>[o.createTextVNode(" This widget allows you to set a personal profit goal expressed in $ for a certain period "),rv,o.createTextVNode(" Pay attention: in the widget, we calculate Net PNL excluding entry and exit commissions, as well as funding ")]),_:1})]),o.createElementVNode("div",{class:"balance-part__modal-switcher",onClick:d[0]||(d[0]=u=>n("switchModal"))},[o.createVNode(o.unref(Ve),{icon:"settings"})])]),o.createElementVNode("div",sv,[o.createElementVNode("div",iv,o.toDisplayString(o.unref(ln)(t.currentProfit,{isPercentage:t.isPercentage,isFixed:!0})),1),o.createElementVNode("div",ov,"/ "+o.toDisplayString(o.unref(ln)(t.profit,{isPercentage:t.isPercentage,isFixed:!0})),1)]),o.createVNode(o.unref(Yp),{"current-profit":t.currentProfit,drawdown:t.drawdown,profit:t.profit,"is-percentage":t.isPercentage},null,8,["current-profit","drawdown","profit","is-percentage"])]))]))}},[["__scopeId","data-v-bea459d0"]]),Io=t=>(o.pushScopeId("data-v-bd464497"),t=t(),o.popScopeId(),t),lv={class:"calendar-widget"},cv={class:"calendar-widget__calendar"},dv={class:"calendar-widget__top"},uv={class:"calendar-widget__title-wrapper"},hv=Io(()=>o.createElementVNode("div",{class:"calendar-widget__title"},"Calendar",-1)),fv=Io(()=>o.createElementVNode("br",null,null,-1)),mv={class:"stat-calendar"},pv={class:"stat-calendar__week-days"},gv={key:0,class:"stat-calendar__row-wrapper"},_v={class:"stat-calendar__row"},yv=["onClick"],wv=Io(()=>o.createElementVNode("div",{class:"calendar-widget__divider"},null,-1)),bv={key:0,class:"calendar-widget__day"},kv={class:"calendar-widget__day__title"},Cv={class:"calendar-widget__day__content"},xv={class:"calendar-widget__point"},Mv={class:"calendar-widget__point__title"},vv=Io(()=>o.createElementVNode("div",{class:"calendar-widget__point__line"},null,-1)),Sv={class:"calendar-widget__day__trades"},Tv={class:"calendar-widget__point"},Dv={class:"calendar-widget__point__title"},Ov=Io(()=>o.createElementVNode("div",{class:"calendar-widget__point__line"},null,-1)),Ev=De({__name:"CalendarWidget",props:{rows:Array,dailyStatData:Object,currentDate:Date,calendarPointsTop:Array,calendarPointsBottom:Array,isCurrentDate:Function,isCurrentDay:Function},emits:["setNewDate","chooseMonth"],setup(t,{emit:e}){const n=["Su","Mo","Tu","We","Th","Fr","Sa"],r=o.ref(null),s=o.ref(null),i=e,a=l=>{r.value=l.year,s.value=l.month,i("chooseMonth",l)};return o.nextTick(()=>{const l=new Date;r.value=l.getFullYear(),s.value=l.getMonth()}),(l,c)=>{var d,u;return o.openBlock(),o.createElementBlock("div",lv,[o.createElementVNode("div",cv,[o.createElementVNode("div",dv,[o.createElementVNode("div",uv,[hv,o.createVNode(o.unref(fn),{alternative:""},{default:o.withCtx(()=>[o.createTextVNode("Displays profitable days on green, losing days in red and trading days without significant profit or loss in blue. Also when you click on a specific date, more detailed information about trading day is displayed. "),fv,o.createTextVNode("Pay attention: in the widget, we calculate Net PNL excluding entry and exit commissions, as well as funding ")]),_:1})]),t.currentDate?(o.openBlock(),o.createBlock(o.unref(Hp),{key:0,"current-date":t.currentDate,onOnChange:a,year:r.value,"onUpdate:year":c[0]||(c[0]=h=>r.value=h),month:s.value,"onUpdate:month":c[1]||(c[1]=h=>s.value=h)},null,8,["current-date","year","month"])):o.createCommentVNode("",!0)]),o.createElementVNode("div",mv,[o.createElementVNode("div",pv,[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(n,(h,f)=>o.createElementVNode("div",{class:o.normalizeClass(["stat-calendar__week-day",{"-current":t.isCurrentDay(f)}])},o.toDisplayString(h),3)),64))]),t.rows?(o.openBlock(),o.createElementBlock("div",gv,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.rows,h=>(o.openBlock(),o.createElementBlock("div",_v,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(h,f=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["stat-calendar__day",{"-empty":!f.date,"-current":t.isCurrentDate(f.date),"-positive":f.win,"-negative":f.win===!1}]),onClick:m=>i("setNewDate",f.date)},o.toDisplayString(f.date?f.date:""),11,yv))),256))]))),256))])):o.createCommentVNode("",!0)])]),wv,t.dailyStatData&&!t.dailyStatData.isNull?(o.openBlock(),o.createElementBlock("div",bv,[o.createElementVNode("div",kv,o.toDisplayString(t.currentDate.getDate()+" "+t.currentDate.toLocaleString("en-us",{month:"long"})),1),o.createElementVNode("div",Cv,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.calendarPointsTop,h=>(o.openBlock(),o.createElementBlock("div",xv,[o.createElementVNode("div",Mv,o.toDisplayString(h.title),1),vv,o.createElementVNode("div",{class:o.normalizeClass(["calendar-widget__point__value",h.class?h.class:""])},o.toDisplayString(h.value),3)]))),256)),o.createVNode(o.unref(V0),{long:(d=t.dailyStatData)==null?void 0:d.long_count,short:(u=t.dailyStatData)==null?void 0:u.short_count},null,8,["long","short"]),o.createElementVNode("div",Sv,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.calendarPointsBottom,h=>(o.openBlock(),o.createElementBlock("div",Tv,[o.createElementVNode("div",Dv,o.toDisplayString(h.title),1),Ov,o.createVNode(o.unref(Yl),{"is-positive":h.isPositive,"is-negative":h.isNegative,delta:h.value},null,8,["is-positive","is-negative","delta"])]))),256))])])])):(o.openBlock(),o.createBlock(o.unref(qd),{key:1,class:"-empty"}))])}}},[["__scopeId","data-v-bd464497"]]),wl=t=>(o.pushScopeId("data-v-5fe5d142"),t=t(),o.popScopeId(),t),$v={class:"commission-widget"},Pv={class:"commission-widget__content"},Lv={class:"commission-widget__top"},Nv={class:"commission-widget__title-wrapper"},Vv=wl(()=>o.createElementVNode("div",{class:"commission-widget__title"},"Commissions and Fees",-1)),Bv=wl(()=>o.createElementVNode("br",null,null,-1)),Av={class:"commission-widget__info"},Rv={class:"commission-widget__total-wrapper"},Fv=wl(()=>o.createElementVNode("div",{class:"commission-widget__total-wrapper__title"},"Total",-1)),Iv={class:"commission-widget__total-wrapper__total"},zv={class:"commission-widget__total-wrapper__value"},Hv={class:"commission-widget__points"},Yv={class:"commission-widget__point"},Wv={class:"commission-widget__point__title"},jv=wl(()=>o.createElementVNode("div",{class:"commission-widget__point__line"},null,-1)),Zv=De({__name:"CommissionsFeesWidget",props:{commission:Number,commissionPoints:Array},emits:["onChange"],setup(t,{emit:e}){const n=o.ref("week"),r=e;return(s,i)=>(o.openBlock(),o.createElementBlock("div",$v,[o.createElementVNode("div",Pv,[o.createElementVNode("div",Lv,[o.createElementVNode("div",Nv,[Vv,o.createVNode(o.unref(fn),{alternative:""},{default:o.withCtx(()=>[o.createTextVNode("The amount of total commissions and fees for the selected previous period including the current date. This widget also shows commission to profit ratio in $/% and average amount of fees per trade."),Bv,o.createTextVNode("Pay attention: in the widget, we calculate Net PNL excluding entry and exit commissions, as well as funding ")]),_:1})]),o.createVNode(o.unref(Ys),{modelValue:n.value,"onUpdate:modelValue":i[0]||(i[0]=a=>n.value=a),onOnChange:i[1]||(i[1]=a=>r("onChange",n.value))},null,8,["modelValue"])]),o.createElementVNode("div",Av,[o.createElementVNode("div",Rv,[Fv,o.createElementVNode("div",Iv,[o.createElementVNode("div",zv," $"+o.toDisplayString(o.unref(Vt)(t.commission)),1)])]),o.createElementVNode("div",Hv,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.commissionPoints,(a,l)=>(o.openBlock(),o.createElementBlock("div",Yv,[o.createElementVNode("div",Wv,o.toDisplayString(a.title),1),jv,o.createElementVNode("div",{class:o.normalizeClass(["commission-widget__point__value",a.class?a.class:""])},o.toDisplayString(a.value),3)]))),256))])])])]))}},[["__scopeId","data-v-5fe5d142"]]),Ym=t=>(o.pushScopeId("data-v-71fad3e1"),t=t(),o.popScopeId(),t),Uv={class:"performance-widget"},qv={class:"performance-widget__top"},Gv={class:"performance-widget__title-wrapper"},Kv=Ym(()=>o.createElementVNode("div",{class:"performance-widget__title"},"Performance (cumulative)",-1)),Xv=Ym(()=>o.createElementVNode("br",null,null,-1)),Qv=De({__name:"PerformanceWidget",props:{performanceChartData:{type:Array,default:[]},isShare:{type:Boolean,default:!1}},setup(t){const e=o.ref("week"),n=r=>Vt(r,2)+"%";return(r,s)=>(o.openBlock(),o.createElementBlock("div",Uv,[o.createElementVNode("div",qv,[o.createElementVNode("div",Gv,[Kv,o.createVNode(o.unref(fn),{alternative:""},{default:o.withCtx(()=>[o.createTextVNode("The amount of profit for the selected previous period including the current date. This widget shows the growth or loss of the deposit in %. The widget is available as a line graph."),Xv,o.createTextVNode(" Pay attention: in the widget, we calculate Net PNL excluding entry and exit commissions, as well as funding ")]),_:1})]),t.isShare?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(o.unref(Ys),{key:0,modelValue:e.value,"onUpdate:modelValue":s[0]||(s[0]=i=>e.value=i),onOnChange:s[1]||(s[1]=i=>r.$emit("onChange",e.value))},null,8,["modelValue"]))]),o.createVNode(o.unref(Lu),{data:t.performanceChartData,"data-type":"performanceChartData","ticks-callback":n},null,8,["data"])]))}},[["__scopeId","data-v-71fad3e1"]]),bl=t=>(o.pushScopeId("data-v-c52bb3a2"),t=t(),o.popScopeId(),t),Jv={class:"return-widget"},eS={class:"return-widget__content"},tS={class:"return-widget__top"},nS={class:"return-widget__title-wrapper"},rS=bl(()=>o.createElementVNode("div",{class:"return-widget__title"},"Return",-1)),sS=bl(()=>o.createElementVNode("br",null,null,-1)),iS={class:"return-widget__info"},oS={class:"return-widget__total-wrapper"},aS=bl(()=>o.createElementVNode("div",{class:"return-widget__total-wrapper__title"},"Total",-1)),lS={class:"return-widget__total-wrapper__total"},cS={class:"return-widget__points"},dS={class:"return-widget__point"},uS={class:"return-widget__point__title"},hS=bl(()=>o.createElementVNode("div",{class:"return-widget__point__line"},null,-1)),fS=["innerHTML"],mS=De({__name:"ReturnWidget",props:{returnData:Object,isShare:{type:Boolean,default:!1}},emits:["onChange"],setup(t,{emit:e}){const n=o.ref("week"),r=e,s=t,i=o.computed(()=>s.returnData?s.returnData.profit_factor:0),a=o.computed(()=>s.returnData?s.returnData.return_period:0),l=o.computed(()=>[{title:"Average return per trade",value:c.value||0,options:{isPlus:!0,isFixed:!0},class:c.value>=0?"-win":"-loss"},{title:"Daily return",value:d.value||0,options:{isPlus:!0,isFixed:!0},class:d.value>=0?"-win":"-loss"},{title:"Return on winners",value:u.value||0},{title:"Return on losers",value:h.value||0}]),c=o.computed(()=>s.returnData&&s.returnData.avarage_total_return),d=o.computed(()=>s.returnData&&s.returnData.daily),u=o.computed(()=>s.returnData&&s.returnData.win),h=o.computed(()=>s.returnData&&s.returnData.lose),f=o.computed(()=>s.returnData&&s.returnData.period_balance_change_rate),m=o.computed(()=>a.value>0),g=o.computed(()=>a.value<0),p=o.computed(()=>i.value>1?"-positive":"-negative"),_=o.computed(()=>i.value>0?`Your profit factor is ${Vt(i.value,2)}. <br /> You earn ${ln(i.value)} on every $1 loss.`:`Your profit factor is ${Vt(i.value,2)}. <br/> You loss ${ln(Math.abs(i.value))} on every $1 earn. `);return(y,C)=>(o.openBlock(),o.createElementBlock("div",Jv,[o.createElementVNode("div",eS,[o.createElementVNode("div",tS,[o.createElementVNode("div",nS,[rS,o.createVNode(o.unref(fn),{alternative:""},{default:o.withCtx(()=>[o.createTextVNode("The amount of profit in $ and % for the selected previous period including the current date. This widget also shows the amount of profit and loss separately."),sS,o.createTextVNode("Pay attention: in the widget, we calculate Net PNL excluding entry and exit commissions, as well as funding ")]),_:1})]),t.isShare?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(o.unref(Ys),{key:0,modelValue:n.value,"onUpdate:modelValue":C[0]||(C[0]=b=>n.value=b),onOnChange:C[1]||(C[1]=b=>r("onChange",n.value))},null,8,["modelValue"]))]),o.createElementVNode("div",iS,[o.createElementVNode("div",oS,[aS,o.createElementVNode("div",lS,[o.createElementVNode("div",{class:o.normalizeClass(["return-widget__total-wrapper__value",{"-positive":m.value,"-negative":g.value}])},o.toDisplayString(o.unref(ln)(a.value,{isPlus:!0,isFixed:!0})),3),f.value?(o.openBlock(),o.createBlock(o.unref(Yl),{key:0,percentage:"",delta:f.value},null,8,["delta"])):o.createCommentVNode("",!0)])]),o.createElementVNode("div",cS,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(l.value,b=>(o.openBlock(),o.createElementBlock("div",dS,[o.createElementVNode("div",uS,o.toDisplayString(b.title),1),hS,o.createElementVNode("div",{class:o.normalizeClass(["return-widget__point__value",b.class?b.class:""])},o.toDisplayString(o.unref(ln)(b.value,b.options)),3)]))),256))])])]),i.value?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["return-widget__profit",p.value])},[o.createVNode(o.unref(Ve),{icon:"tip",class:"return-widget__profit__icon"}),o.createElementVNode("div",{class:"return-widget__profit__text",innerHTML:_.value},null,8,fS)],2)):o.createCommentVNode("",!0)]))}},[["__scopeId","data-v-c52bb3a2"]]),Vu=t=>(o.pushScopeId("data-v-69c2a2fa"),t=t(),o.popScopeId(),t),pS={class:"top-positions-widget"},gS={class:"top-positions-widget__top"},_S={class:"top-positions-widget__title-wrapper"},yS=Vu(()=>o.createElementVNode("div",{class:"top-positions-widget__title"},"Top-3 Positions",-1)),wS=Vu(()=>o.createElementVNode("br",null,null,-1)),bS={key:0,class:"top-positions-widget__returns"},kS={class:"top-positions-widget__return"},CS={class:"top-positions-widget__return__left"},xS=Vu(()=>o.createElementVNode("div",{class:"top-positions-widget__return__line"},null,-1)),MS={class:"top-positions-widget__return__pair"},vS={class:"top-positions-widget__return__right"},SS={class:"top-positions-widget__return__pnl"},TS=De({__name:"TopPositionsWidget",props:{topPositions:{type:Array,default:[]}},emits:["onChange"],setup(t,{emit:e}){const n=o.ref("week"),r=e;return(s,i)=>(o.openBlock(),o.createElementBlock("div",pS,[o.createElementVNode("div",gS,[o.createElementVNode("div",_S,[yS,o.createVNode(o.unref(fn),{alternative:""},{default:o.withCtx(()=>[o.createTextVNode("Displays 3 most profitable trades of the selected period. You can also see the trading pair and trade profit to balance ratio. "),wS,o.createTextVNode("Pay attention: in the widget, we calculate Net PNL excluding entry and exit commissions, as well as funding ")]),_:1})]),o.createVNode(o.unref(Ys),{modelValue:n.value,"onUpdate:modelValue":i[0]||(i[0]=a=>n.value=a),onOnChange:i[1]||(i[1]=a=>r("onChange",n.value))},null,8,["modelValue"])]),t.topPositions&&t.topPositions.length?(o.openBlock(),o.createElementBlock("div",bS,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.topPositions,a=>(o.openBlock(),o.createElementBlock("div",kS,[o.createElementVNode("div",CS,[xS,o.createElementVNode("div",MS,o.toDisplayString(o.unref(Q6)(a.pair)),1)]),o.createElementVNode("div",vS,[o.createElementVNode("div",SS,o.toDisplayString(o.unref(ln)(a.pnl,{isFixed:!0,isPlus:!0})),1),o.createElementVNode("div",{class:o.normalizeClass(["top-positions-widget__return__roi",a.roi<0?"-negative":"-positive"])},[o.createVNode(o.unref(Ve),{icon:"bxs_up-arrow"}),o.createElementVNode("span",null,o.toDisplayString(o.unref(ln)(a.roi,{isPercentage:!0,isFixed:!0})),1)],2)])]))),256))])):(o.openBlock(),o.createBlock(o.unref(qd),{key:1,title:"No more pair",subtitle:"No data available for the specified period",icon:"coins-add"}))]))}},[["__scopeId","data-v-69c2a2fa"]]),Bu=t=>(o.pushScopeId("data-v-7b67b5c8"),t=t(),o.popScopeId(),t),DS={class:"trade-widget"},OS={class:"trade-widget__content"},ES={class:"trade-widget__top"},$S={class:"trade-widget__title-wrapper"},PS=Bu(()=>o.createElementVNode("div",{class:"trade-widget__title"},"Trades Performance",-1)),LS={class:"trade-widget__info"},NS={class:"trade-widget__total-wrapper"},VS=Bu(()=>o.createElementVNode("div",{class:"trade-widget__total-wrapper__title"},"Total",-1)),BS={class:"trade-widget__total-wrapper__total"},AS={class:"trade-widget__total-wrapper__value"},RS={class:"trade-widget__points"},FS={class:"trade-widget__point"},IS={class:"trade-widget__point__title"},zS=Bu(()=>o.createElementVNode("div",{class:"trade-widget__point__line"},null,-1)),HS=De({__name:"TradePerformanceWidget",props:{totalTrades:Number,tradePoints:Array},emits:["onChange"],setup(t,{emit:e}){const n=o.ref("week"),r=e;return(s,i)=>(o.openBlock(),o.createElementBlock("div",DS,[o.createElementVNode("div",OS,[o.createElementVNode("div",ES,[o.createElementVNode("div",$S,[PS,o.createVNode(o.unref(fn),{alternative:""},{default:o.withCtx(()=>[o.createTextVNode("This widget displays number of total winning & trades. Also it indicates the average number of trades for selected period. ")]),_:1})]),o.createVNode(o.unref(Ys),{modelValue:n.value,"onUpdate:modelValue":i[0]||(i[0]=a=>n.value=a),onOnChange:i[1]||(i[1]=a=>r("onChange",n.value))},null,8,["modelValue"])]),o.createElementVNode("div",LS,[o.createElementVNode("div",NS,[VS,o.createElementVNode("div",BS,[o.createElementVNode("div",AS,o.toDisplayString(t.totalTrades),1)])]),o.createElementVNode("div",RS,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.tradePoints,a=>(o.openBlock(),o.createElementBlock("div",FS,[o.createElementVNode("div",IS,o.toDisplayString(a.title),1),zS,o.createElementVNode("div",{class:o.normalizeClass(["trade-widget__point__value",a.class?a.class:""])},o.toDisplayString(a.value),3)]))),256))])])])]))}},[["__scopeId","data-v-7b67b5c8"]]),kl=t=>(o.pushScopeId("data-v-7a9040de"),t=t(),o.popScopeId(),t),YS={class:"winrate-widget"},WS={class:"winrate-widget__winrate"},jS={class:"winrate-widget__title-wrapper"},ZS=kl(()=>o.createElementVNode("div",{class:"winrate-widget__title"},"Winrate",-1)),US=kl(()=>o.createElementVNode("br",null,null,-1)),qS={class:"winrate-widget__chart"},GS={class:"winrate-widget__data"},KS={class:"winrate-widget__data_value"},XS=kl(()=>o.createElementVNode("div",{class:"winrate-widget__data_title"},"Winrate",-1)),QS={class:"winrate-widget__average-rr"},JS={class:"winrate-widget__title-wrapper"},eT=kl(()=>o.createElementVNode("div",{class:"winrate-widget__title"},"Average RR",-1)),tT=De({__name:"WinrateWidget",props:{winrate:{type:Number,default:0},minRR:{type:Number,default:0},averageRR:{type:Number,default:0},maxRR:{type:Number,default:0}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("div",YS,[o.createElementVNode("div",WS,[o.createElementVNode("div",jS,[ZS,o.createVNode(o.unref(fn),{alternative:""},{default:o.withCtx(()=>[o.createTextVNode("This widget displays the percentage of successful trades and the average RR. "),US,o.createTextVNode("Pay attention: in the widget, we calculate Net PNL excluding entry and exit commissions, as well as funding ")]),_:1})]),o.createElementVNode("div",qS,[o.renderSlot(e.$slots,"roundSlider",{},void 0,!0),o.createElementVNode("div",GS,[o.createElementVNode("div",KS,o.toDisplayString(o.unref(Vt)(t.winrate,2))+"%",1),XS])])]),o.createElementVNode("div",QS,[o.createElementVNode("div",JS,[eT,o.createVNode(o.unref(fn),{alternative:""},{default:o.withCtx(()=>[o.createTextVNode("The risk/reward ratio - marks the prospective reward a trader can earn for every dollar they risk on a trade. ")]),_:1})]),o.createVNode(o.unref(Wm),{avg:t.averageRR,min:t.minRR,max:t.maxRR},null,8,["avg","min","max"])])]))}},[["__scopeId","data-v-7a9040de"]]),nT=t=>(o.pushScopeId("data-v-2f6cbb5e"),t=t(),o.popScopeId(),t),rT={class:"average-rr-line-container"},sT={class:"average-rr-line"},iT={key:0,class:"average-rr-line__progress"},oT=[nT(()=>o.createElementVNode("div",{class:"average-rr-line__dot"},null,-1))],aT={class:"coefficients"},lT={class:"coefficients__value -min"},cT={class:"coefficients__value -avg"},dT={class:"coefficients__value -max"},Wm=De({__name:"AverageRRLine",props:{min:{type:Number,default:0},avg:{type:Number,default:0},max:{type:Number,default:0}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("div",rT,[o.createElementVNode("div",sT,[t.avg&&t.max?(o.openBlock(),o.createElementBlock("div",iT,oT)):o.createCommentVNode("",!0)]),o.createElementVNode("div",aT,[o.createElementVNode("div",lT,o.toDisplayString(t.min),1),o.createElementVNode("div",cT,o.toDisplayString(o.unref(Vt)(t.avg)),1),o.createElementVNode("div",dT,o.toDisplayString(o.unref(Vt)(t.max)),1)])]))}},[["__scopeId","data-v-2f6cbb5e"]]);//! moment.js
|
|
37
37
|
//! version : 2.30.1
|
|
38
38
|
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
|
|
39
39
|
//! license : MIT
|