PageSourceSearch

https://0xmint.io/_next/static/chunks/ee8b1517-20a8b9e2d5554f86.js

js 0xmint.io collected 2026-09-28 06:50:37 UTC 196,005 bytes, 6 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2196],{23148:function(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{De:function(){return plugin_legend},Dx:function(){return plugin_title},ZL:function(){return BarElement},f$:function(){return LinearScale},jn:function(){return LineElement},kL:function(){return Chart},od:function(){return PointElement},u:function(){return plugin_tooltip},uw:function(){return CategoryScale},vn:function(){return BarController}});var _chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(9676),animator=new /*!
2 * Chart.js v4.3.0
3 * https://www.chartjs.org
4 * (c) 2023 Chart.js Contributors
5 * Released under the MIT License
6 */ class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(chart,anims,date,type){let callbacks=anims.listeners[type],numSteps=anims.duration;callbacks.forEach(fn=>fn({chart,initial:anims.initial,numSteps,currentStep:Math.min(date-anims.start,numSteps)}))}_refresh(){this._request||(this._running=!0,this._request=_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.r.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(date=Date.now()){let remaining=0;this._charts.forEach((anims,chart)=>{let item;if(!anims.running||!anims.items.length)return;let items=anims.items,i=items.length-1,draw=!1;for(;i>=0;--i)(item=items[i])._active?(item._total>anims.duration&&(anims.duration=item._total),item.tick(date),draw=!0):(items[i]=items[items.length-1],items.pop());draw&&(chart.draw(),this._notify(chart,anims,date,"progress")),items.length||(anims.running=!1,this._notify(chart,anims,date,"complete"),anims.initial=!1),remaining+=items.length}),this._lastDate=date,0===remaining&&(this._running=!1)}_getAnims(chart){let charts=this._charts,anims=charts.get(chart);return anims||(anims={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},charts.set(chart,anims)),anims}listen(chart,event,cb){this._getAnims(chart).listeners[event].push(cb)}add(chart,items){items&&items.length&&this._getAnims(chart).items.push(...items)}has(chart){return this._getAnims(chart).items.length>0}start(chart){let anims=this._charts.get(chart);anims&&(anims.running=!0,anims.start=Date.now(),anims.duration=anims.items.reduce((acc,cur)=>Math.max(acc,cur._duration),0),this._refresh())}running(chart){if(!this._running)return!1;let anims=this._charts.get(chart);return!!anims&&!!anims.running&&!!anims.items.length}stop(chart){let anims=this._charts.get(chart);if(!anims||!anims.items.length)return;let items=anims.items,i=items.length-1;for(;i>=0;--i)items[i].cancel();anims.items=[],this._notify(chart,anims,Date.now(),"complete")}remove(chart){return this._charts.delete(chart)}};let transparent="transparent",interpolators={boolean:(from,to,factor)=>factor>.5?to:from,color(from,to,factor){let c0=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.c)(from||transparent),c1=c0.valid&&(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.c)(to||transparent);return c1&&c1.valid?c1.mix(c0,factor).hexString():to},number:(from,to,factor)=>from+(to-from)*factor};class Animation{constructor(cfg,target,prop,to){let currentValue=target[prop];to=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.a)([cfg.to,to,currentValue,cfg.from]);let from=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.a)([cfg.from,currentValue,to]);this._active=!0,this._fn=cfg.fn||interpolators[cfg.type||typeof from],this._easing=_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.e[cfg.easing]||_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.e.linear,this._start=Math.floor(Date.now()+(cfg.delay||0)),this._duration=this._total=Math.floor(cfg.duration),this._loop=!!cfg.loop,this._target=target,this._prop=prop,this._from=from,this._to=to,this._promises=void 0}active(){return this._active}update(cfg,to,date){if(this._active){this._notify(!1);let currentValue=this._target[this._prop],elapsed=date-this._start,remain=this._duration-elapsed;this._start=date,this._duration=Math.floor(Math.max(remain,cfg.duration)),this._total+=elapsed,this._loop=!!cfg.loop,this._to=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.a)([cfg.to,to,currentValue,cfg.from]),this._from=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.a)([cfg.from,currentValue,to])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(date){let factor;let elapsed=date-this._start,duration=this._duration,prop=this._prop,from=this._from,loop=this._loop,to=this._to;
6if(this._active=from!==to&&(loop||elapsed<duration),!this._active){this._target[prop]=to,this._notify(!0);return}if(elapsed<0){this._target[prop]=from;return}factor=elapsed/duration%2,factor=loop&&factor>1?2-factor:factor,factor=this._easing(Math.min(1,Math.max(0,factor))),this._target[prop]=this._fn(from,to,factor)}wait(){let promises=this._promises||(this._promises=[]);return new Promise((res,rej)=>{promises.push({res,rej})})}_notify(resolved){let method=resolved?"res":"rej",promises=this._promises||[];for(let i=0;i<promises.length;i++)promises[i][method]()}}class Animations{constructor(chart,config){this._chart=chart,this._properties=new Map,this.configure(config)}configure(config){if(!(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.i)(config))return;let animationOptions=Object.keys(_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.d.animation),animatedProps=this._properties;Object.getOwnPropertyNames(config).forEach(key=>{let cfg=config[key];if(!(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.i)(cfg))return;let resolved={};for(let option of animationOptions)resolved[option]=cfg[option];((0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.b)(cfg.properties)&&cfg.properties||[key]).forEach(prop=>{prop!==key&&animatedProps.has(prop)||animatedProps.set(prop,resolved)})})}_animateOptions(target,values){let newOptions=values.options,options=function(target,newOptions){if(!newOptions)return;let options=target.options;if(!options){target.options=newOptions;return}return options.$shared&&(target.options=options=Object.assign({},options,{$shared:!1,$animations:{}})),options}(target,newOptions);if(!options)return[];let animations=this._createAnimations(options,newOptions);return newOptions.$shared&&(function(animations,properties){let running=[],keys=Object.keys(properties);for(let i=0;i<keys.length;i++){let anim=animations[keys[i]];anim&&anim.active()&&running.push(anim.wait())}return Promise.all(running)})(target.options.$animations,newOptions).then(()=>{target.options=newOptions},()=>{}),animations}_createAnimations(target,values){let i;let animatedProps=this._properties,animations=[],running=target.$animations||(target.$animations={}),props=Object.keys(values),date=Date.now();for(i=props.length-1;i>=0;--i){let prop=props[i];if("$"===prop.charAt(0))continue;if("options"===prop){animations.push(...this._animateOptions(target,values));continue}let value=values[prop],animation=running[prop],cfg=animatedProps.get(prop);if(animation){if(cfg&&animation.active()){animation.update(cfg,value,date);continue}animation.cancel()}if(!cfg||!cfg.duration){target[prop]=value;continue}running[prop]=animation=new Animation(cfg,target,prop,value),animations.push(animation)}return animations}update(target,values){if(0===this._properties.size){Object.assign(target,values);return}let animations=this._createAnimations(target,values);if(animations.length)return animator.add(this._chart,animations),!0}}function scaleClip(scale,allowedOverflow){let opts=scale&&scale.options||{},reverse=opts.reverse,min=void 0===opts.min?allowedOverflow:0,max=void 0===opts.max?allowedOverflow:0;return{start:reverse?max:min,end:reverse?min:max}}function getSortedDatasetIndices(chart,filterVisible){let i,ilen;let keys=[],metasets=chart._getSortedDatasetMetas(filterVisible);for(i=0,ilen=metasets.length;i<ilen;++i)keys.push(metasets[i].index);return keys}function applyStack(stack,value,dsIndex,options={}){let i,ilen,datasetIndex,otherValue;let keys=stack.keys,singleMode="single"===options.mode;if(null!==value){for(i=0,ilen=keys.length;i<ilen;++i){if((datasetIndex=+keys[i])===dsIndex){if(options.all)continue;break}otherValue=stack.values[datasetIndex],(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.g)(otherValue)&&(singleMode||0===value||(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.s)(value)===(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.s)(otherValue))&&(value+=otherValue)}return value}}function isStacked(scale,meta){let stacked=scale&&scale.options.stacked;return stacked||void 0===stacked&&void 0!==meta.stack}function getLastIndexInStack(stack,vScale,positive,type){for(let meta of vScale.getMatchingVisibleMetas(type).reverse()){let value=stack[meta.index];if(positive&&value>0||!positive&&value<0)return meta.index}return null}function updateStacks(controller,parsed){let stack;let{chart,_cachedMeta:meta}=controller,stacks=chart._stacks||(chart._stacks={}),{iScale,vScale,index:datasetIndex}=meta,iAxis=iScale.axis,vAxis=vScale.axis,key=`${iScale.id}.${vScale.id}.${meta.stack||meta.type}`,ilen=parsed.length;for(let i=0;i<ilen;++i){let item=parsed[i],{[iAxis]:index,[vAxis]:value}=item,itemStacks=item._stacks||(item._stacks={});(stack=itemStacks[vAxis]=function(stacks,stackKey,indexValue){let subStack=stacks[stackKey]||(stacks[stackKey]={});return subStack[indexValue]||(subStack[indexValue]={})}(stacks,key,index))[datasetIndex]=value,stack._top=getLastIndexInStack(stack,vScale,!0,meta.type),stack._bottom=getL
6astIndexInStack(stack,vScale,!1,meta.type);let visualValues=stack._visualValues||(stack._visualValues={});visualValues[datasetIndex]=value}}function getFirstScaleId(chart,axis){let scales=chart.scales;return Object.keys(scales).filter(key=>scales[key].axis===axis).shift()}function clearStacks(meta,items){let datasetIndex=meta.controller.index,axis=meta.vScale&&meta.vScale.axis;if(axis)for(let parsed of items=items||meta._parsed){let stacks=parsed._stacks;if(!stacks||void 0===stacks[axis]||void 0===stacks[axis][datasetIndex])return;delete stacks[axis][datasetIndex],void 0!==stacks[axis]._visualValues&&void 0!==stacks[axis]._visualValues[datasetIndex]&&delete stacks[axis]._visualValues[datasetIndex]}}let isDirectUpdateMode=mode=>"reset"===mode||"none"===mode,cloneIfNotShared=(cached,shared)=>shared?cached:Object.assign({},cached),createStack=(canStack,meta,chart)=>canStack&&!meta.hidden&&meta._stacked&&{keys:getSortedDatasetIndices(chart,!0),values:null};class DatasetController{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(chart,datasetIndex){this.chart=chart,this._ctx=chart.ctx,this.index=datasetIndex,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){let meta=this._cachedMeta;this.configure(),this.linkScales(),meta._stacked=isStacked(meta.vScale,meta),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(datasetIndex){this.index!==datasetIndex&&clearStacks(this._cachedMeta),this.index=datasetIndex}linkScales(){let chart=this.chart,meta=this._cachedMeta,dataset=this.getDataset(),chooseId=(axis,x,y,r)=>"x"===axis?x:"r"===axis?r:y,xid=meta.xAxisID=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.v)(dataset.xAxisID,getFirstScaleId(chart,"x")),yid=meta.yAxisID=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.v)(dataset.yAxisID,getFirstScaleId(chart,"y")),rid=meta.rAxisID=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.v)(dataset.rAxisID,getFirstScaleId(chart,"r")),indexAxis=meta.indexAxis,iid=meta.iAxisID=chooseId(indexAxis,xid,yid,rid),vid=meta.vAxisID=chooseId(indexAxis,yid,xid,rid);meta.xScale=this.getScaleForId(xid),meta.yScale=this.getScaleForId(yid),meta.rScale=this.getScaleForId(rid),meta.iScale=this.getScaleForId(iid),meta.vScale=this.getScaleForId(vid)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(scaleID){return this.chart.scales[scaleID]}_getOtherScale(scale){let meta=this._cachedMeta;return scale===meta.iScale?meta.vScale:meta.iScale}reset(){this._update("reset")}_destroy(){let meta=this._cachedMeta;this._data&&(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.u)(this._data,this),meta._stacked&&clearStacks(meta)}_dataCheck(){let dataset=this.getDataset(),data=dataset.data||(dataset.data=[]),_data=this._data;if((0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.i)(data))this._data=function(data){let i,ilen,key;let keys=Object.keys(data),adata=Array(keys.length);for(i=0,ilen=keys.length;i<ilen;++i)key=keys[i],adata[i]={x:key,y:data[key]};return adata}(data);else if(_data!==data){if(_data){(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.u)(_data,this);let meta=this._cachedMeta;clearStacks(meta),meta._parsed=[]}data&&Object.isExtensible(data)&&(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.l)(data,this),this._syncList=[],this._data=data}}addElements(){let meta=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(meta.dataset=new this.datasetElementType)}buildOrUpdateElements(resetNewElements){let meta=this._cachedMeta,dataset=this.getDataset(),stackChanged=!1;this._dataCheck();let oldStacked=meta._stacked;meta._stacked=isStacked(meta.vScale,meta),meta.stack!==dataset.stack&&(stackChanged=!0,clearStacks(meta),meta.stack=dataset.stack),this._resyncElements(resetNewElements),(stackChanged||oldStacked!==meta._stacked)&&updateStacks(this,meta._parsed)}configure(){let config=this.chart.config,scopeKeys=config.datasetScopeKeys(this._type),scopes=config.getOptionScopes(this.getDataset(),scopeKeys,!0);this.options=config.createResolver(scopes,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(start,count){let i,cur,parsed;let{_cachedMeta:meta,_data:data}=this,{iScale,_stacked}=meta,iAxis=iScale.axis,sorted=0===start&&count===data.length||meta._sorted,prev=start>0&&meta._parsed[start-1];if(!1===this._parsing)meta._parsed=data,meta._sorted=!0,parsed=data;else{parsed=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.b)(data[start])?this.parseArrayData(meta,data,start,count):(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.i)(data[start])?this.parseObjectData(meta,data,start,count):this.parsePrimitiveData(meta,data,start,count);let isNotInOrderComparedToPrev=()=>null===cur[iAxis]||prev&&cur[iAxis]<prev[iAxis];for(i=0;i<count;++i)meta._parsed[i+start]=cur=parsed[i],sorted&&(isNotInOrderComparedToPrev()&&(sorted=!1),prev=cur);meta._sorted=sorted}_stacked&&updateStacks(this,parsed)}parsePrimitiveData(meta,data,start,count){let i,index;let{iScale,vScale}=meta,iAxis=iScale.axis,vAxis=vScale.axis,labels=iScale.getLabels(),singleScale=iScale===vScale,parsed=Array(count);for(i=0;i<count;++i)index=i+start,parsed[i]={[iAxis]:singleScale||iScale.parse(labels[index],index),[vAxis]:vScale.parse(data[index],index)};return parsed}parseArrayData(meta,data,start,count){let i,index,item;let{xScale,yScale}=meta,parsed=Array(count);for(i=0;i<count;++i)item=data[index=i+start],parsed[i]={x:xScale.parse(item[0],index),y:yScale.parse(item[1],index)};return parsed}parseObjectData(meta,data,start,count){let i,index,item;let{xScale,yScale}=meta,{xAxisKey="x",yAxisKey="y"}=this._parsing,parsed=Array(count);for(i=0;i<count;++i)item=data[index=i+start],parsed[i]={x:xScale.parse((0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.f)(item,xAxisKey
6),index),y:yScale.parse((0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.f)(item,yAxisKey),index)};return parsed}getParsed(index){return this._cachedMeta._parsed[index]}getDataElement(index){return this._cachedMeta.data[index]}applyStack(scale,parsed,mode){let chart=this.chart,meta=this._cachedMeta,value=parsed[scale.axis],stack={keys:getSortedDatasetIndices(chart,!0),values:parsed._stacks[scale.axis]._visualValues};return applyStack(stack,value,meta.index,{mode})}updateRangeFromParsed(range,scale,parsed,stack){let parsedValue=parsed[scale.axis],value=null===parsedValue?NaN:parsedValue,values=stack&&parsed._stacks[scale.axis];stack&&values&&(stack.values=values,value=applyStack(stack,parsedValue,this._cachedMeta.index)),range.min=Math.min(range.min,value),range.max=Math.max(range.max,value)}getMinMax(scale,canStack){let i,parsed;let meta=this._cachedMeta,_parsed=meta._parsed,sorted=meta._sorted&&scale===meta.iScale,ilen=_parsed.length,otherScale=this._getOtherScale(scale),stack=createStack(canStack,meta,this.chart),range={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:otherMin,max:otherMax}=function(scale){let{min,max,minDefined,maxDefined}=scale.getUserBounds();return{min:minDefined?min:Number.NEGATIVE_INFINITY,max:maxDefined?max:Number.POSITIVE_INFINITY}}(otherScale);function _skip(){parsed=_parsed[i];let otherValue=parsed[otherScale.axis];return!(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.g)(parsed[scale.axis])||otherMin>otherValue||otherMax<otherValue}for(i=0;i<ilen&&(_skip()||(this.updateRangeFromParsed(range,scale,parsed,stack),!sorted));++i);if(sorted){for(i=ilen-1;i>=0;--i)if(!_skip()){this.updateRangeFromParsed(range,scale,parsed,stack);break}}return range}getAllParsedValues(scale){let i,ilen,value;let parsed=this._cachedMeta._parsed,values=[];for(i=0,ilen=parsed.length;i<ilen;++i)value=parsed[i][scale.axis],(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.g)(value)&&values.push(value);return values}getMaxOverflow(){return!1}getLabelAndValue(index){let meta=this._cachedMeta,iScale=meta.iScale,vScale=meta.vScale,parsed=this.getParsed(index);return{label:iScale?""+iScale.getLabelForValue(parsed[iScale.axis]):"",value:vScale?""+vScale.getLabelForValue(parsed[vScale.axis]):""}}_update(mode){var value;let t,r,b,l;let meta=this._cachedMeta;this.update(mode||"default"),meta._clip=(value=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.v)(this.options.clip,function(xScale,yScale,allowedOverflow){if(!1===allowedOverflow)return!1;let x=scaleClip(xScale,allowedOverflow),y=scaleClip(yScale,allowedOverflow);return{top:y.end,right:x.end,bottom:y.start,left:x.start}}(meta.xScale,meta.yScale,this.getMaxOverflow())),(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.i)(value)?(t=value.top,r=value.right,b=value.bottom,l=value.left):t=r=b=l=value,{top:t,right:r,bottom:b,left:l,disabled:!1===value})}update(mode){}draw(){let i;let ctx=this._ctx,chart=this.chart,meta=this._cachedMeta,elements=meta.data||[],area=chart.chartArea,active=[],start=this._drawStart||0,count=this._drawCount||elements.length-start,drawActiveElementsOnTop=this.options.drawActiveElementsOnTop;for(meta.dataset&&meta.dataset.draw(ctx,area,start,count),i=start;i<start+count;++i){let element=elements[i];element.hidden||(element.active&&drawActiveElementsOnTop?active.push(element):element.draw(ctx,area))}for(i=0;i<active.length;++i)active[i].draw(ctx,area)}getStyle(index,active){let mode=active?"active":"default";return void 0===index&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(mode):this.resolveDataElementOptions(index||0,mode)}getContext(index,active,mode){var parent,parent1,index1;let context;let dataset=this.getDataset();if(index>=0&&index<this._cachedMeta.data.length){let element=this._cachedMeta.data[index];(context=element.$context||(element.$context=(parent=this.getContext(),(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.j)(parent,{active:!1,dataIndex:index,parsed:void 0,raw:void 0,element:element,index:index,mode:"default",type:"data"})))).parsed=this.getParsed(index),context.raw=dataset.data[index],context.
vendor: 5,654 bytes, line 6
6index=context.dataIndex=index}else(context=this.$context||(this.$context=(parent1=this.chart.getContext(),index1=this.index,(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.j)(parent1,{active:!1,dataset:void 0,datasetIndex:index1,index:index1,mode:"default",type:"dataset"})))).dataset=dataset,context.index=context.datasetIndex=this.index;return context.active=!!active,context.mode=mode,context}resolveDatasetElementOptions(mode){return this._resolveElementOptions(this.datasetElementType.id,mode)}resolveDataElementOptions(index,mode){return this._resolveElementOptions(this.dataElementType.id,mode,index)}_resolveElementOptions(elementType,mode="default",index){let active="active"===mode,cache=this._cachedDataOpts,cacheKey=elementType+"-"+mode,cached=cache[cacheKey],sharing=this.enableOptionSharing&&(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.h)(index);if(cached)return cloneIfNotShared(cached,sharing);let config=this.chart.config,scopeKeys=config.datasetElementScopeKeys(this._type,elementType),prefixes=active?[`${elementType}Hover`,"hover",elementType,""]:[elementType,""],scopes=config.getOptionScopes(this.getDataset(),scopeKeys),names=Object.keys(_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.d.elements[elementType]),context=()=>this.getContext(index,active,mode),values=config.resolveNamedOptions(scopes,names,context,prefixes);return values.$shared&&(values.$shared=sharing,cache[cacheKey]=Object.freeze(cloneIfNotShared(values,sharing))),values}_resolveAnimations(index,transition,active){let options;let chart=this.chart,cache=this._cachedDataOpts,cacheKey=`animation-${transition}`,cached=cache[cacheKey];if(cached)return cached;if(!1!==chart.options.animation){let config=this.chart.config,scopeKeys=config.datasetAnimationScopeKeys(this._type,transition),scopes=config.getOptionScopes(this.getDataset(),scopeKeys);options=config.createResolver(scopes,this.getContext(index,active,transition))}let animations=new Animations(chart,options&&options.animations);return options&&options._cacheable&&(cache[cacheKey]=Object.freeze(animations)),animations}getSharedOptions(options){if(options.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},options))}includeOptions(mode,sharedOptions){return!sharedOptions||isDirectUpdateMode(mode)||this.chart._animationsDisabled}_getSharedOptions(start,mode){let firstOpts=this.resolveDataElementOptions(start,mode),previouslySharedOptions=this._sharedOptions,sharedOptions=this.getSharedOptions(firstOpts),includeOptions=this.includeOptions(mode,sharedOptions)||sharedOptions!==previouslySharedOptions;return this.updateSharedOptions(sharedOptions,mode,firstOpts),{sharedOptions,includeOptions}}updateElement(element,index,properties,mode){isDirectUpdateMode(mode)?Object.assign(element,properties):this._resolveAnimations(index,mode).update(element,properties)}updateSharedOptions(sharedOptions,mode,newOptions){sharedOptions&&!isDirectUpdateMode(mode)&&this._resolveAnimations(void 0,mode).update(sharedOptions,newOptions)}_setStyle(element,index,mode,active){element.active=active;let options=this.getStyle(index,active);this._resolveAnimations(index,mode,active).update(element,{options:!active&&this.getSharedOptions(options)||options})}removeHoverStyle(element,datasetIndex,index){this._setStyle(element,index,"active",!1)}setHoverStyle(element,datasetIndex,index){this._setStyle(element,index,"active",!0)}_removeDatasetHoverStyle(){let element=this._cachedMeta.dataset;element&&this._setStyle(element,void 0,"active",!1)}_setDatasetHoverStyle(){let element=this._cachedMeta.dataset;element&&this._setStyle(element,void 0,"active",!0)}_resyncElements(resetNewElements){let data=this._data,elements=this._cachedMeta.data;for(let[method,arg1,arg2]of this._syncList)this[method](arg1,arg2);this._syncList=[];let numMeta=elements.length,numData=data.length,count=Math.min(numData,numMeta);count&&this.parse(0,count),numData>numMeta?this._insertElements(numMeta,numData-numMeta,resetNewElements):numData<numMeta&&this._removeElements(numData,numMeta-numData)}_insertElements(start,count,resetNewElements=!0){let i;let meta=this._cachedMeta,data=meta.data,end=start+count,move=arr=>{for(arr.length+=count,i=arr.length-1;i>=end;i--)arr[i]=arr[i-count]};for(move(data),i=start;i<end;++i)data[i]=new this.dataElementType;this._parsing&&move(meta._parsed),this.parse(start,count),resetNewElements&&this.updateElements(data,start,count,"reset")}updateElements(element,start,count,mode){}_removeElements(start,count){let meta=this._cachedMeta;if(this._parsing){let removed=meta._parsed.splice(start,count);meta._stacked&&clearStacks(meta,removed)}meta.data.splice(start,count)}_sync(args){if(this._parsing)this._syncList.push(args);else{let[method,arg1,arg2]=args;this[method](arg1,arg2)}this.chart._dataChanges.push([this.index,...args])}_onDataPush(){let count=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-count,count])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(start,count){count&&this._sync(["_removeElements",start,count]);let newCount=arguments.length-2;newCount&&this._sync(["_insertElements",start,newCount])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function parseValue(entry,item,vScale,i){return(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.b)(entry)?function(entry,item,vScale,i){let startValue=vScale.parse(entry[0],i),endValue=vScale.parse(entry[1],i),min=Math.min(startValue,endValue),max=Math.max(startValue,endValue),barStart=min,barEnd=max;Math.abs(min)>
6Math.abs(max)&&(barStart=max,barEnd=min),item[vScale.axis]=barEnd,item._custom={barStart,barEnd,start:startValue,end:endValue,min,max}}(entry,item,vScale,i):item[vScale.axis]=vScale.parse(entry,i),item}function parseArrayOrPrimitive(meta,data,start,count){let i,ilen,item,entry;let iScale=meta.iScale,vScale=meta.vScale,labels=iScale.getLabels(),singleScale=iScale===vScale,parsed=[];for(i=start,ilen=start+count;i<ilen;++i)entry=data[i],(item={})[iScale.axis]=singleScale||iScale.parse(labels[i],i),parsed.push(parseValue(entry,item,vScale,i));return parsed}function isFloatBar(custom){return custom&&void 0!==custom.barStart&&void 0!==custom.barEnd}function parseEdge(edge,a,b,reverse){var orig;return edge=reverse?startEnd(edge=(orig=edge)===a?b:orig===b?a:orig,b,a):startEnd(edge,a,b)}function startEnd(v,start,end){return"start"===v?start:"end"===v?end:v}class BarController extends DatasetController{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(meta,data,start,count){return parseArrayOrPrimitive(meta,data,start,count)}parseArrayData(meta,data,start,count){return parseArrayOrPrimitive(meta,data,start,count)}parseObjectData(meta,data,start,count){let i,ilen,item,obj;let{iScale,vScale}=meta,{xAxisKey="x",yAxisKey="y"}=this._parsing,iAxisKey="x"===iScale.axis?xAxisKey:yAxisKey,vAxisKey="x"===vScale.axis?xAxisKey:yAxisKey,parsed=[];for(i=start,ilen=start+count;i<ilen;++i)obj=data[i],(item={})[iScale.axis]=iScale.parse((0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.f)(obj,iAxisKey),i),parsed.push(parseValue((0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.f)(obj,vAxisKey),item,vScale,i));return parsed}updateRangeFromParsed(range,scale,parsed,stack){super.updateRangeFromParsed(range,scale,parsed,stack);let custom=parsed._custom;custom&&scale===this._cachedMeta.vScale&&(range.min=Math.min(range.min,custom.min),range.max=Math.max(range.max,custom.max))}getMaxOverflow(){return 0}getLabelAndValue(index){let meta=this._cachedMeta,{iScale,vScale}=meta,parsed=this.getParsed(index),custom=parsed._custom,value=isFloatBar(custom)?"["+custom.start+", "+custom.end+"]":""+vScale.getLabelForValue(parsed[vScale.axis]);return{label:""+iScale.getLabelForValue(parsed[iScale.axis]),value}}initialize(){this.enableOptionSharing=!0,super.initialize();let meta=this._cachedMeta;meta.stack=this.getDataset().stack}update(mode){let meta=this._cachedMeta;this.updateElements(meta.data,0,meta.data.length,mode)}updateElements(bars,start,count,mode){let reset="reset"===mode,{index,_cachedMeta:{vScale}}=this,base=vScale.getBasePixel(),horizontal=vScale.isHorizontal(),ruler=this._getRuler(),{sharedOptions,includeOptions}=this._getSharedOptions(start,mode);for(let i=start;i<start+count;i++){let parsed=this.getParsed(i),vpixels=reset||(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.k)(parsed[vScale.axis])?{base,head:base}:this._calculateBarValuePixels(i),ipixels=this._calculateBarIndexPixels(i,ruler),stack=(parsed._stacks||{})[vScale.axis],properties={horizontal,base:vpixels.base,enableBorderRadius:!stack||isFloatBar(parsed._custom)||index===stack._top||index===stack._bottom,x:horizontal?vpixels.head:ipixels.center,y:horizontal?ipixels.center:vpixels.head,height:horizontal?ipixels.size:Math.abs(vpixels.size),width:horizontal?Math.abs(vpixels.size):ipixels.size};includeOptions&&(properties.options=sharedOptions||this.resolveDataElementOptions(i,bars[i].active?"active":mode));let options=properties.options||bars[i].options;!function(properties,options,stack,index){let reverse,start,end,top,bottom,edge=options.borderSkipped,res={};if(!edge){properties.borderSkipped=res;return}if(!0===edge){properties.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}let{start:start1,end:end1,reverse:reverse1,top:top1,bottom:bottom1}=(properties.horizontal?(reverse=properties.base>properties.x,start="left",end="right"):(reverse=properties.base<properties.y,start="bottom",end="top"),reverse?(top="end",bottom="start"):(top="start",bottom="end"),{start,end,reverse,top,bottom});"middle"===edge&&stack&&(properties.enableBorderRadius=!0,(stack._top||0)===index?edge=top1:(stack._bottom||0)===index?edge=bottom1:(res[parseEdge(bottom1,start1,end1,reverse1)]=!0,edge=top1)),res[parseEdge(edge,start1,end1,reverse1)]=!0,properties.borderSkipped=res}(properties,options,stack,index),function(properties,{inflateAmou
6nt},ratio){properties.inflateAmount="auto"===inflateAmount?1===ratio?.33:0:inflateAmount}(properties,options,ruler.ratio),this.updateElement(bars[i],i,properties,mode)}}_getStacks(last,dataIndex){let{iScale}=this._cachedMeta,metasets=iScale.getMatchingVisibleMetas(this._type).filter(meta=>meta.controller.options.grouped),stacked=iScale.options.stacked,stacks=[],skipNull=meta=>{let parsed=meta.controller.getParsed(dataIndex),val=parsed&&parsed[meta.vScale.axis];if((0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.k)(val)||isNaN(val))return!0};for(let meta of metasets)if(!(void 0!==dataIndex&&skipNull(meta))&&((!1===stacked||-1===stacks.indexOf(meta.stack)||void 0===stacked&&void 0===meta.stack)&&stacks.push(meta.stack),meta.index===last))break;return stacks.length||stacks.push(void 0),stacks}_getStackCount(index){return this._getStacks(void 0,index).length}_getStackIndex(datasetIndex,name,dataIndex){let stacks=this._getStacks(datasetIndex,dataIndex),index=void 0!==name?stacks.indexOf(name):-1;return -1===index?stacks.length-1:index}_getRuler(){let i,ilen;let opts=this.options,meta=this._cachedMeta,iScale=meta.iScale,pixels=[];for(i=0,ilen=meta.data.length;i<ilen;++i)pixels.push(iScale.getPixelForValue(this.getParsed(i)[iScale.axis],i));let barThickness=opts.barThickness,min=barThickness||function(meta){let i,ilen,curr,prev;let scale=meta.iScale,values=function(scale,type){if(!scale._cache.$bar){let visibleMetas=scale.getMatchingVisibleMetas(type),values=[];for(let i=0,ilen=visibleMetas.length;i<ilen;i++)values=values.concat(visibleMetas[i].controller.getAllParsedValues(scale));scale._cache.$bar=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__._)(values.sort((a,b)=>a-b))}return scale._cache.$bar}(scale,meta.type),min=scale._length,updateMinAndPrev=()=>{32767!==curr&&-32768!==curr&&((0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.h)(prev)&&(min=Math.min(min,Math.abs(curr-prev)||min)),prev=curr)};for(i=0,ilen=values.length;i<ilen;++i)curr=scale.getPixelForValue(values[i]),updateMinAndPrev();for(i=0,prev=void 0,ilen=scale.ticks.length;i<ilen;++i)curr=scale.getPixelForTick(i),updateMinAndPrev();return min}(meta);return{min,pixels,start:iScale._startPixel,end:iScale._endPixel,stackCount:this._getStackCount(),scale:iScale,grouped:opts.grouped,ratio:barThickness?1:opts.categoryPercentage*opts.barPercentage}}_calculateBarValuePixels(index){let head,size;let{_cachedMeta:{vScale,_stacked,index:datasetIndex},options:{base:baseValue,minBarLength}}=this,actualBase=baseValue||0,parsed=this.getParsed(index),custom=parsed._custom,floating=isFloatBar(custom),value=parsed[vScale.axis],start=0,length=_stacked?this.applyStack(vScale,parsed,_stacked):value;length!==value&&(start=length-value,length=value),floating&&(value=custom.barStart,length=custom.barEnd-custom.barStart,0!==value&&(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.s)(value)!==(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.s)(custom.barEnd)&&(start=0),start+=value);let startValue=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.k)(baseValue)||floating?start:baseValue,base=vScale.getPixelForValue(startValue);if(Math.abs(size=(head=this.chart.getDataVisibility(index)?vScale.getPixelForValue(start+length):base)-base)<minBarLength){var size1;size=(0!==(size1=size)?(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.s)(size1):(vScale.isHorizontal()?1:-1)*(vScale.min>=actualBase?1:-1))*minBarLength,value===actualBase&&(base-=size/2);let startPixel=vScale.getPixelForDecimal(0),endPixel=vScale.getPixelForDecimal(1);head=(base=Math.max(Math.min(base,Math.max(startPixel,endPixel)),Math.min(startPixel,endPixel)))+size,_stacked&&!floating&&(parsed._stacks[vScale.axis]._visualValues[datasetIndex]=vScale.getValueForPixel(head)-vScale.getValueForPixel(base))}if(base===vScale.getPixelForValue(actualBase)){let halfGrid=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.s)(size)*vScale.getLineWidthForValue(actualBase)/2;base+=halfGrid,size-=halfGrid}return{size,base,head,center:head+size/2}}_calculateBarIndexPixels(index,ruler){let center,size;let scale=ruler.scale,options=this.options,skipNull=options.skipNull,maxBarThickness=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.v)(options.maxBarThickness,1/0);if(ruler.grouped){let stackCount=skipNull?this._getStackCount(index):ruler.stackCount,range="flex"===options.barThickness?function(index,ruler,options,stackCount){let pixels=ruler.pixels,curr=pixels[index],prev=index>0?pixels[index-1]:null,next=index<pixels.length-1?pixels[index+1]:null,percent=options.categoryPercentage;null===prev&&(prev=curr-(null===next?ruler.end-ruler.start:next-curr)),null===next&&(next=curr+curr-prev);let start=curr-(curr-Math.min(prev,next))/2*percent,size=Math.abs(next-prev)/2*percent;return{chunk:size/stackCount,ratio:options.barPercentage,start}}(index,ruler,options,stackCount):function(index,ruler,options,stackCount){let size,ratio;let thickness=options.barThickness;return(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.k)(thickness)?(size=ruler.min*options.categoryPercentage,ratio=options.barPercentage):(size=thickness*stackCount,ratio=1),{chunk:size/stackCount,ratio,start:ruler.pixels[index]-size/2}}(index,ruler,options,stackCount),stackIndex=this._getStackIndex(this.index,this._cachedMeta.stack,skipNull?index:void 0);center=range.start+range.chunk*stackIndex+range.chunk/2,size=Math.min(maxBarThickness,range.chunk*range.ratio)}else center=scale.getPixelForValue(this.getParsed(index)[scale.axis
6],index),size=Math.min(maxBarThickness,ruler.min*ruler.ratio);return{base:center-size/2,head:center+size/2,center,size}}draw(){let meta=this._cachedMeta,vScale=meta.vScale,rects=meta.data,ilen=rects.length,i=0;for(;i<ilen;++i)null!==this.getParsed(i)[vScale.axis]&&rects[i].draw(this._ctx)}}function abstract(){throw Error("This method is not implemented: Check that a complete date adapter is provided.")}class DateAdapterBase{static override(members){Object.assign(DateAdapterBase.prototype,members)}options;constructor(options){this.options=options||{}}init(){}formats(){return abstract()}parse(){return abstract()}format(){return abstract()}add(){return abstract()}diff(){return abstract()}startOf(){return abstract()}endOf(){return abstract()}}function evaluateInteractionItems(chart,axis,position,handler,intersect){let metasets=chart.getSortedVisibleDatasetMetas(),value=position[axis];for(let i=0,ilen=metasets.length;i<ilen;++i){let{index,data}=metasets[i],{lo,hi}=function(metaset,axis,value,intersect){let{controller,data,_sorted}=metaset,iScale=controller._cachedMeta.iScale;if(iScale&&axis===iScale.axis&&"r"!==axis&&_sorted&&data.length){let lookupMethod=iScale._reversePixels?_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.A:_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.B;if(!intersect)return lookupMethod(data,axis,value);if(controller._sharedOptions){let el=data[0],range="function"==typeof el.getRange&&el.getRange(axis);if(range){let start=lookupMethod(data,axis,value-range),end=lookupMethod(data,axis,value+range);return{lo:start.lo,hi:end.hi}}}}return{lo:0,hi:data.length-1}}(metasets[i],axis,value,intersect);for(let j=lo;j<=hi;++j){let element=data[j];element.skip||handler(element,index,j)}}}function getIntersectItems(chart,position,axis,useFinalPosition,includeInvisible){let items=[];return(includeInvisible||chart.isPointInArea(position))&&evaluateInteractionItems(chart,axis,position,function(element,datasetIndex,index){(includeInvisible||(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.C)(element,chart.chartArea,0))&&element.inRange(position.x,position.y,useFinalPosition)&&items.push({element,datasetIndex,index})},!0),items}function getNearestItems(chart,position,axis,intersect,useFinalPosition,includeInvisible){let items;return includeInvisible||chart.isPointInArea(position)?"r"!==axis||intersect?function(chart,position,axis,intersect,useFinalPosition,includeInvisible){let items=[],distanceMetric=function(axis){let useX=-1!==axis.indexOf("x"),useY=-1!==axis.indexOf("y");return function(pt1,pt2){let deltaX=useX?Math.abs(pt1.x-pt2.x):0,deltaY=useY?Math.abs(pt1.y-pt2.y):0;return Math.sqrt(Math.pow(deltaX,2)+Math.pow(deltaY,2))}}(axis),minDistance=Number.POSITIVE_INFINITY;return evaluateInteractionItems(chart,axis,position,function(element,datasetIndex,index){let inRange=element.inRange(position.x,position.y,useFinalPosition);if(intersect&&!inRange)return;let center=element.getCenterPoint(useFinalPosition),pointInArea=!!includeInvisible||chart.isPointInArea(center);if(!pointInArea&&!inRange)return;let distance=distanceMetric(position,center);distance<minDistance?(items=[{element,datasetIndex,index}],minDistance=distance):distance===minDistance&&items.push({element,datasetIndex,index})}),items}(chart,position,axis,intersect,useFinalPosition,includeInvisible):(items=[],evaluateInteractionItems(chart,axis,position,function(element,datasetIndex,index){let{startAngle,endAngle}=element.getProps(["startAngle","endAngle"],useFinalPosition),{angle}=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.D)(element,{x:position.x,y:position.y});(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.p)(angle,startAngle,endAngle)&&items.push({element,datasetIndex,index})}),items):[]}function getAxisItems(chart,position,axis,intersect,useFinalPosition){let items=[],rangeMethod="x"===axis?"inXRange":"inYRange",intersectsItem=!1;return(evaluateInteractionItems(chart,axis,position,(element,datasetIndex,index)=>{element[rangeMethod](position[axis],useFinalPosition)&&(items.push({element,datasetIndex,index}),intersectsItem=intersectsItem||element.inRange(position.x,position.y,useFinalPosition))}),intersect&&!intersectsItem)?[]:items}var Interaction={evaluateInteractionItems,modes:{index(chart,e,options,useFinalPosition){let position=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.z)(e,chart),axis=options.axis||"x",includeInvisible=options.includeInvisible||!1,items=options.intersect?getIntersectItems(chart,position,axis,useFinalPosition,includeInvisible):getNearestItems(chart,position,axis,!1,useFinalPosition,includeInvisible),elements=[];return items.length?(chart.getSortedVisibleDatasetMetas().forEac
6h(meta=>{let index=items[0].index,element=meta.data[index];element&&!element.skip&&elements.push({element,datasetIndex:meta.index,index})}),elements):[]},dataset(chart,e,options,useFinalPosition){let position=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.z)(e,chart),axis=options.axis||"xy",includeInvisible=options.includeInvisible||!1,items=options.intersect?getIntersectItems(chart,position,axis,useFinalPosition,includeInvisible):getNearestItems(chart,position,axis,!1,useFinalPosition,includeInvisible);if(items.length>0){let datasetIndex=items[0].datasetIndex,data=chart.getDatasetMeta(datasetIndex).data;items=[];for(let i=0;i<data.length;++i)items.push({element:data[i],datasetIndex,index:i})}return items},point(chart,e,options,useFinalPosition){let position=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.z)(e,chart),axis=options.axis||"xy",includeInvisible=options.includeInvisible||!1;return getIntersectItems(chart,position,axis,useFinalPosition,includeInvisible)},nearest(chart,e,options,useFinalPosition){let position=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.z)(e,chart),axis=options.axis||"xy",includeInvisible=options.includeInvisible||!1;return getNearestItems(chart,position,axis,options.intersect,useFinalPosition,includeInvisible)},x(chart,e,options,useFinalPosition){let position=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.z)(e,chart);return getAxisItems(chart,position,"x",options.intersect,useFinalPosition)},y(chart,e,options,useFinalPosition){let position=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.z)(e,chart);return getAxisItems(chart,position,"y",options.intersect,useFinalPosition)}}};let STATIC_POSITIONS=["left","top","right","bottom"];function filterByPosition(array,position){return array.filter(v=>v.pos===position)}function filterDynamicPositionByAxis(array,axis){return array.filter(v=>-1===STATIC_POSITIONS.indexOf(v.pos)&&v.box.axis===axis)}function sortByWeight(array,reverse){return array.sort((a,b)=>{let v0=reverse?b:a,v1=reverse?a:b;return v0.weight===v1.weight?v0.index-v1.index:v0.weight-v1.weight})}function getCombinedMax(maxPadding,chartArea,a,b){return Math.max(maxPadding[a],chartArea[a])+Math.max(maxPadding[b],chartArea[b])}function updateMaxPadding(maxPadding,boxPadding){maxPadding.top=Math.max(maxPadding.top,boxPadding.top),maxPadding.left=Math.max(maxPadding.left,boxPadding.left),maxPadding.bottom=Math.max(maxPadding.bottom,boxPadding.bottom),maxPadding.right=Math.max(maxPadding.right,boxPadding.right)}function fitBoxes(boxes,chartArea,params,stacks){let i,ilen,layout,box,refit,changed;let refitBoxes=[];for(i=0,ilen=boxes.length,refit=0;i<ilen;++i){(box=(layout=boxes[i]).box).update(layout.width||chartArea.w,layout.height||chartArea.h,function(horizontal,chartArea){let maxPadding=chartArea.maxPadding;return function(positions){let margin={left:0,top:0,right:0,bottom:0};return positions.forEach(pos=>{margin[pos]=Math.max(chartArea[pos],maxPadding[pos])}),margin}(horizontal?["left","right"]:["top","bottom"])}(layout.horizontal,chartArea));let{same,other}=function(chartArea,params,layout,stacks){let{pos,box}=layout,maxPadding=chartArea.maxPadding;if(!(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.i)(pos)){layout.size&&(chartArea[pos]-=layout.size);let stack=stacks[layout.stack]||{size:0,count:1};stack.size=Math.max(stack.size,layout.horizontal?box.height:box.width),layout.size=stack.size/stack.count,chartArea[pos]+=layout.size}box.getPadding&&updateMaxPadding(maxPadding,box.getPadding());let newWidth=Math.max(0,params.outerWidth-getCombinedMax(maxPadding,chartArea,"left","right")),newHeight=Math.max(0,params.outerHeight-getCombinedMax(maxPadding,chartArea,"top","bottom")),widthChanged=newWidth!==chartArea.w,heightChanged=newHeight!==chartArea.h;return chartArea.w=newWidth,chartArea.h=newHeight,layout.horizontal?{same:widthChanged,other:heightChanged}:{same:heightChanged,other:widthChanged}}(chartArea,params,layout,stacks);refit|=same&&refitBoxes.length,changed=changed||other,box.fullSize||refitBoxes.push(layout)}return refit&&fitBoxes(refitBoxes,chartArea,params,stacks)||changed}function setBoxDims(box,left,top,width,height){box.top=top,box.left=left,box.right=left+width,box.bottom=top+height,box.width=width,box.height=height}function placeBoxes(boxes,chartArea,params,stacks){let userPadding=params.padding,{x,y}=chartArea;for(let layout of boxes){let box=layout.box,stack=stacks[layout.stack]||{count:1,placed:0,weight:1},weight=layout.stackWeight/stack.weight||1;if(layout.horizontal){let width=chartArea.w*weight,height=stack.size||box.height;(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.h)(stack.start)&&(y=stack.start),box.fullSize?setBoxDims(box,userPadding.left,y,params.outerWidth-userPadding.right-userPadding.left,height):setBoxDims(box,chartArea.left+stack.placed,y,width,height),stack.start=y,stack.placed+=width,y=box.bottom}else{let height1=chartArea.h*weight,width1=stack.size||box.width;(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.h)(stack.start)&&(x=stack.start),box.fullSize?setBoxDims(box,x,userPadding.top,width1,params.outerHeight-userPadding.bottom-userPadding.top):setBo
6xDims(box,x,chartArea.top+stack.placed,width1,height1),stack.start=x,stack.placed+=height1,x=box.right}}chartArea.x=x,chartArea.y=y}var layouts={addBox(chart,item){chart.boxes||(chart.boxes=[]),item.fullSize=item.fullSize||!1,item.position=item.position||"top",item.weight=item.weight||0,item._layers=item._layers||function(){return[{z:0,draw(chartArea){item.draw(chartArea)}}]},chart.boxes.push(item)},removeBox(chart,layoutItem){let index=chart.boxes?chart.boxes.indexOf(layoutItem):-1;-1!==index&&chart.boxes.splice(index,1)},configure(chart,item,options){item.fullSize=options.fullSize,item.position=options.position,item.weight=options.weight},update(chart,width,height,minPadding){if(!chart)return;let padding=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.E)(chart.options.layout.padding),availableWidth=Math.max(width-padding.width,0),availableHeight=Math.max(height-padding.height,0),boxes=function(boxes){let layoutBoxes=function(boxes){let i,ilen,box,pos,stack,stackWeight;let layoutBoxes=[];for(i=0,ilen=(boxes||[]).length;i<ilen;++i)box=boxes[i],({position:pos,options:{stack,stackWeight=1}}=box),layoutBoxes.push({index:i,box,pos,horizontal:box.isHorizontal(),weight:box.weight,stack:stack&&pos+stack,stackWeight});return layoutBoxes}(boxes),fullSize=sortByWeight(layoutBoxes.filter(wrap=>wrap.box.fullSize),!0),left=sortByWeight(filterByPosition(layoutBoxes,"left"),!0),right=sortByWeight(filterByPosition(layoutBoxes,"right")),top=sortByWeight(filterByPosition(layoutBoxes,"top"),!0),bottom=sortByWeight(filterByPosition(layoutBoxes,"bottom")),centerHorizontal=filterDynamicPositionByAxis(layoutBoxes,"x"),centerVertical=filterDynamicPositionByAxis(layoutBoxes,"y");return{fullSize,leftAndTop:left.concat(top),rightAndBottom:right.concat(ce
6nterVertical).concat(bottom).concat(centerHorizontal),chartArea:filterByPosition(layoutBoxes,"chartArea"),vertical:left.concat(right).concat(centerVertical),horizontal:top.concat(bottom).concat(centerHorizontal)}}(chart.boxes),verticalBoxes=boxes.vertical,horizontalBoxes=boxes.horizontal;(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.F)(chart.boxes,box=>{"function"==typeof box.beforeLayout&&box.beforeLayout()});let visibleVerticalBoxCount=verticalBoxes.reduce((total,wrap)=>wrap.box.options&&!1===wrap.box.options.display?total:total+1,0)||1,params=Object.freeze({outerWidth:width,outerHeight:height,padding,availableWidth,availableHeight,vBoxMaxWidth:availableWidth/2/visibleVerticalBoxCount,hBoxMaxHeight:availableHeight/2}),maxPadding=Object.assign({},padding);updateMaxPadding(maxPadding,(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.E)(minPadding));let chartArea=Object.assign({maxPadding,w:availableWidth,h:availableHeight,x:padding.left,y:padding.top},padding),stacks=function(layouts,params){let i,ilen,layout;let stacks=function(layouts){let stacks={};for(let wrap of layouts){let{stack,pos,stackWeight}=wrap;if(!stack||!STATIC_POSITIONS.includes(pos))continue;let _stack=stacks[stack]||(stacks[stack]={count:0,placed:0,weight:0,size:0});_stack.count++,_stack.weight+=stackWeight}return stacks}(layouts),{vBoxMaxWidth,hBoxMaxHeight}=params;for(i=0,ilen=layouts.length;i<ilen;++i){layout=layouts[i];let{fullSize}=layout.box,stack=stacks[layout.stack],factor=stack&&layout.stackWeight/stack.weight;layout.horizontal?(layout.width=factor?factor*vBoxMaxWidth:fullSize&&params.availableWidth,layout.height=hBoxMaxHeight):(layout.width=vBoxMaxWidth,layout.height=factor?factor*hBoxMaxHeight:fullSize&&params.availableHeight)}return stacks}(verticalBoxes.concat(horizontalBoxes),params);fitBoxes(boxes.fullSize,chartArea,params,stacks),fitBoxes(verticalBoxes,chartArea,params,stacks),fitBoxes(horizontalBoxes,chartArea,params,stacks)&&fitBoxes(verticalBoxes,chartArea,params,stacks),function(chartArea){let maxPadding=chartArea.maxPadding;function updatePos(pos){let change=Math.max(maxPadding[pos]-chartArea[pos],0);return chartArea[pos]+=change,change}chartArea.y+=updatePos("top"),chartArea.x+=updatePos("left"),updatePos("right"),updatePos("bottom")}(chartArea),placeBoxes(boxes.leftAndTop,chartArea,params,stacks),chartArea.x+=chartArea.w,chartArea.y+=chartArea.h,placeBoxes(boxes.rightAndBottom,chartArea,params,stacks),chart.chartArea={left:chartArea.left,top:chartArea.top,right:chartArea.left+chartArea.w,bottom:chartArea.top+chartArea.h,height:chartArea.h,width:chartArea.w},(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.F)(boxes.chartArea,layout=>{let box=layout.box;Object.assign(box,chart.chartArea),box.update(chartArea.w,chartArea.h,{left:0,top:0,right:0,bottom:0})})}};class BasePlatform{acquireContext(canvas,aspectRatio){}releaseContext(context){return!1}addEventListener(chart,type,listener){}removeEventListener(chart,type,listener){}getDevicePixelRatio(){return 1}getMaximumSize(element,width,height,aspectRatio){return width=Math.max(0,width||element.width),height=height||element.height,{width,height:Math.max(0,aspectRatio?Math.floor(width/aspectRatio):height)}}isAttached(canvas){return!0}updateConfig(config){}}class BasicPlatform extends BasePlatform{acquireContext(item){return item&&item.getContext&&item.getContext("2d")||null}updateConfig(config){config.options.animation=!1}}let EXPANDO_KEY="$chartjs",EVENT_TYPES={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},isNullOrEmpty=value=>null===value||""===value,eventListenerOptions=!!_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.K&&{passive:!0};function removeListener(chart,type,listener){chart.canvas.removeEventListener(type,listener,eventListenerOptions)}function nodeListContains(nodeList,canvas){for(let node of nodeList)if(node===canvas||node.contains(canvas))return!0}function createAttachObserver(chart,type,listener){let canvas=chart.canvas,observer=new MutationObserver(entries=>{let trigger=!1;
6for(let entry of entries)trigger=(trigger=trigger||nodeListContains(entry.addedNodes,canvas))&&!nodeListContains(entry.removedNodes,canvas);trigger&&listener()});return observer.observe(document,{childList:!0,subtree:!0}),observer}function createDetachObserver(chart,type,listener){let canvas=chart.canvas,observer=new MutationObserver(entries=>{let trigger=!1;for(let entry of entries)trigger=(trigger=trigger||nodeListContains(entry.removedNodes,canvas))&&!nodeListContains(entry.addedNodes,canvas);trigger&&listener()});return observer.observe(document,{childList:!0,subtree:!0}),observer}let drpListeningCharts=new Map,oldDevicePixelRatio=0;function onWindowResize(){let dpr=window.devicePixelRatio;dpr!==oldDevicePixelRatio&&(oldDevicePixelRatio=dpr,drpListeningCharts.forEach((resize,chart)=>{chart.currentDevicePixelRatio!==dpr&&resize()}))}function createResizeObserver(chart,type,listener){let canvas=chart.canvas,container=canvas&&(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.I)(canvas);if(!container)return;let resize=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.L)((width,height)=>{let w=container.clientWidth;listener(width,height),w<container.clientWidth&&listener()},window),observer=new ResizeObserver(entries=>{let entry=entries[0],width=entry.contentRect.width,height=entry.contentRect.height;(0!==width||0!==height)&&resize(width,height)});return observer.observe(container),drpListeningCharts.size||window.addEventListener("resize",onWindowResize),drpListeningCharts.set(chart,resize),observer}function releaseObserver(chart,type,observer){observer&&observer.disconnect(),"resize"===type&&(drpListeningCharts.delete(chart),drpListeningCharts.size||window.removeEventListener("resize",onWindowResize))}function createProxyAndListen(chart,type,listener){let canvas=chart.canvas,proxy=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.L)(event=>{null!==chart.ctx&&listener(function(event,chart){let type=EVENT_TYPES[event.type]||event.type,{x,y}=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.z)(event,chart);return{type,chart,native:event,x:void 0!==x?x:null,y:void 0!==y?y:null}}(event,chart))},chart);return!function(node,type,listener){node.addEventListener(type,listener,eventListenerOptions)}(canvas,type,proxy),proxy}class DomPlatform extends BasePlatform{acquireContext(canvas,aspectRatio){let context=canvas&&canvas.getContext&&canvas.getContext("2d");return context&&context.canvas===canvas?(!function(canvas,aspectRatio){let style=canvas.style,renderHeight=canvas.getAttribute("height"),renderWidth=canvas.getAttribute("width");if(canvas[EXPANDO_KEY]={initial:{height:renderHeight,width:renderWidth,style:{display:style.display,height:style.height,width:style.width}}},style.display=style.display||"block",style.boxSizing=style.boxSizing||"border-box",isNullOrEmpty(renderWidth)){let displayWidth=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.J)(canvas,"width");void 0!==displayWidth&&(canvas.width=displayWidth)}if(isNullOrEmpty(renderHeight)){if(""===canvas.style.height)canvas.height=canvas.width/(aspectRatio||2);else{let displayHeight=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.J)(canvas,"height");void 0!==displayHeight&&(canvas.height=displayHeight)}}}(canvas,aspectRatio),context):null}releaseContext(context){let canvas=context.canvas;if(!canvas[EXPANDO_KEY])return!1;let initial=canvas[EXPANDO_KEY].initial;["height","width"].forEach(prop=>{let value=initial[prop];(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.k)(value)?canvas.removeAttribute(prop):canvas.setAttribute(prop,value)});let style=initial.style||{};return Object.keys(style).forEach(key=>{canvas.style[key]=style[key]}),canvas.width=canvas.width,delete canvas[EXPANDO_KEY],!0}addEventListener(chart,type,listener){this.removeEventListener(chart,type);let proxies=chart.$proxies||(chart.$proxies={});proxies[type]=(({attach:createAttachObserver,detach:createDetachObserver,resize:createResizeObserver})[type]||createProxyAndListen)(chart,type,listener)}removeEventListener(chart,type){let proxies=chart.$proxies||(chart.$proxies={}),proxy=proxies[type];proxy&&((({attach:releaseObserver,detach:releaseObserver,resize:releaseObserver})[type]||removeListener)(chart,type,proxy),proxies[type]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(canvas,width,height,aspectRatio){return(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.G)(canvas,width,height,aspectRatio)}isAttached(canvas){let container=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.I)(canvas);return!!(container&&container.isConnected)}}class Element{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(useFinalPosition){let{x,y}=this.getProps(["x","y"],useFinalPosition);return{x,y}}hasValue(){return(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.x)(this.x)&&(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.x)(this.y)}getProps(props,final){let anims=this.$animations;if(!final||!anims)return this;let ret={};return props.forEach(prop=>{ret[prop]=anims[prop]&&anims[prop].active()?anims[prop]._to:this[prop]}),ret}}function skip(ticks,newTicks,spacing,majorStart,majorEnd){let length,i,next;let start=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.v)(majorStart,0),end=Math.min((0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.v)(majorEnd,ticks.length),ticks.length),count=0;for(spacing=Math.ceil(spacing),majorEnd&&(spacing=(length=majorEnd-majorStart)/Math.floor(length/spacing)),next=start;next<0;)next=Math.round(start+ ++count*spacing);for(i=Math.max(start,0);i<end;i++)i===next&&(newTicks.push(ticks[i]),next=Math.round(start+ ++count*spacing))}let reverseAlign=align=>"left"===align?"right":"right"===align?"left":align,offsetFromEdge=(scale,edge,offset)=>"top"===edge||"left"===edge?scale[edge]+offset:scale[edge]-offset,getTicksLimit=(ticksLength,maxTicksLimit)=>Math.min(maxTicksLimit||ticksLength,ticksLength);function sample(arr,numItems){let result=[],increment=arr.length/numItems,len=arr.length,i=0;for(;i<len;i+=increment)result.push(arr[Math.floor(i)]);return result}function getTickMarkLength(options){return options.drawTicks?options.tickLength:0}function getTitleHeight(options,fallback){if(!options.display)return 0;let font=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.a0)(options.font,fallback),padding=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.E)(options.padding),lines=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.b)(options.text)?o
6ptions.text.length:1;return lines*font.lineHeight+padding.height}class Scale extends Element{constructor(cfg){super(),this.id=cfg.id,this.type=cfg.type,this.options=void 0,this.ctx=cfg.ctx,this.chart=cfg.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(options){this.options=options.setContext(this.getContext()),this.axis=options.axis,this._userMin=this.parse(options.min),this._userMax=this.parse(options.max),this._suggestedMin=this.parse(options.suggestedMin),this._suggestedMax=this.parse(options.suggestedMax)}parse(raw,index){return raw}getUserBounds(){let{_userMin,_userMax,_suggestedMin,_suggestedMax}=this;return _userMin=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.O)(_userMin,Number.POSITIVE_INFINITY),_userMax=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.O)(_userMax,Number.NEGATIVE_INFINITY),_suggestedMin=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.O)(_suggestedMin,Number.POSITIVE_INFINITY),_suggestedMax=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.O)(_suggestedMax,Number.NEGATIVE_INFINITY),{min:(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.O)(_userMin,_suggestedMin),max:(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.O)(_userMax,_suggestedMax),minDefined:(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.g)(_userMin),maxDefined:(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.g)(_userMax)}}getMinMax(canStack){let range,{min,max,minDefined,maxDefined}=this.getUserBounds();if(minDefined&&maxDefined)return{min,max};let metas=this.getMatchingVisibleMetas();for(let i=0,ilen=metas.length;i<ilen;++i)range=metas[i].controller.getMinMax(this,canStack),minDefined||(min=Math.min(min,range.min)),maxDefined||(max=Math.max(max,range.max));return min=maxDefined&&min>max?max:min,max=minDefined&&min>max?min:max,{min:(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.O)(min,(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.O)(max,min)),max:(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.O)(max,(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.O)(min,max))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let data=this.chart.data;return this.options.labels||(this.isHorizontal()?data.xLabels:data.yLabels)||data.labels||[]}getLabelItems(chartArea=this.chart.chartArea){let items=this._labelItems||(this._labelItems=this._computeLabelItems(chartArea));return items}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.Q)(this.options.beforeUpdate,[this])}update(maxWidth,maxHeight,margins){let{beginAtZero,grace,ticks:tickOpts}=this.options,sampleSize=tickOpts.sampleSize;this.beforeUpdate(),this.maxWidth=maxWidth,this.maxHeight=maxHeight,this._margins=margins=Object.assign({left:0,right:0,top:0,bottom:0},margins),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+margins.left+margins.right:this.height+margins.top+margins.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.R)(this,grace,beginAtZero),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let samplingEnabled=sampleSize<this.ticks.length;this._convertTicksToLabels(samplingEnabled?sample(this.ticks,sampleSize):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),tickOpts.display&&(tickOpts.autoSkip||"auto"===tickOpts.source)&&(this.ticks=function(scale,ticks){let tickOpts=scale.options.ticks,determinedMaxTicks=function(scale){let offset=scale.options.offset,tickLength=scale._tickSize(),maxScale=scale._length/tickLength+(offset?0:1),maxChart=scale._maxLength/tickLength;return Math.floor(Math.min(maxScale,maxChart))}(scale),ticksLimit=Math.min(tickOpts.maxTicksLimit||determinedMaxTicks,determinedMaxTicks),majorIndices=tickOpts.major.enabled?function(ticks){let i,ilen;let result=[];for(i=0,ilen=ticks.length;i<ilen;i++)ticks[i].major&&result.push(i);return result}(ticks):[],numMajorIndices=majorIndices.length,first=majorIndices[0],last=majorIndices[numMajorIndices-1],newTicks=[];if(numMajorIndices>ticksLimit)return function(ticks,newTicks,majorIndices,spacing){let i,count=0,next=majorIndices[0];for(i=0,spacing=Math.ceil(spacing);i<ticks.length;i++)i===next&&(newTicks.push(ticks[i]),next=majorIndices[++count*spacing])}(ticks,newTicks,majorIndices,numMajorIndices/ticksLimit),newTicks;let spacing=function(majorIndices,ticks,ticksLimit){let evenMajorSpacing=function(arr){let i,diff;let len=arr.length;if(len<2)return!1;for(diff=arr[0],i=1;i<len;++i)if(arr[i]-arr[i-1]!==diff)return!1;return diff}(majorIndices),spacing=ticks.length/ticksLimit;if(!evenMajorSpacing)return Math.max(spacing,1);let factors=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.N)(evenMajorSpacing);for(let i=0,ilen=factors.length-1;i<ilen;i++){let factor=factors[i];if(factor>spacing)return factor}return Math.max(spacing,1)}(majorIndices,ticks,ticksLimit);if(numMajorIndices>0){let i,ilen;let avgMajorSpacing=numMajorIndices>1?Math.round((last-first)/(numMajorIndices-1)):null;for(skip(ticks,newTicks,spacing,(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.k)(avgMajorSpacing)?0:first-avgMajorSpacing,first),i=0,ilen=numMajorIndices-1;i<ilen;i++)skip(ticks,newTicks,spacing,majorIndices[i],majorIndices[i+1]);return skip(ticks,newTicks,spacing,last,(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.k)(avgMajorSpacing)?ticks.length:last+avgMajorSpacing),newTicks}return skip(ticks,newTicks,spacing),newTicks}(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),samplingEnabled&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let startPixel,endPixel,reversePixels=this.options.reverse;this.isHorizontal()?(startPixel=this.left,endPixel=this.right):(startPixel=this.top,endPixel=this.bottom,reversePixels=!reversePixels),this._startPixel=startPixel,this._endPixel=endPixel,this._reversePixels=reversePixels,this._length=endPixel-startPixel,this._alignToPixels=this.options.alignToPixels}afterUpdate(){(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.Q)(this.options.afterUpdate,[this])}beforeSetDimensions(){(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.Q)(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.Q)(this.options.afterSetDimensions,[this])}_callHooks(name){this.chart.notifyPlugins(name,this.getContext()),(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.Q)(this.options[name],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.Q)(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(ticks){let i,ilen,tick;let tickOpts=this.options.ticks;for(i=0,ilen=ticks.length;i<ilen;i++)(tick=ticks[i]).label=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.Q)(tickOpts.callback,[tick.value,i,ticks],this)}afterTickToLabelConversion(){(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.Q)(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.Q)(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){let tickWidth,maxHeight,maxLabelDiagonal;let options=this.options,tickOpts=options.ticks,numTicks=getTicksLimit(this.ticks.length,options.ticks.maxTicksLimit),minRotation=tickOpts.minRotation||0,maxRotation=tickOpts.maxRotation,labelRotation=minRotation;if(!this._isVisible()||!tickOpts.display||minRotation>=maxRotation||numTicks<=1||!this.isHorizontal()){this.labelRotation=minRotation;return}let labelSizes=this._getLabelSizes(),maxLabelWidth=labelSizes.widest.width,maxLabelHeight=labelSizes.highest.height,maxWidth=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.S)(this.chart.width-maxLabelWidth,0,this.maxWidth);maxLabelWidth+6>(tickWidth=options.offset?this.maxWidth/numTicks:maxWidth/(numTicks-1))&&(tickWidth=maxWidth/(numTicks-(options.offset?.5:1)),maxHeight=this.maxHeight-getTickMarkLength(options.grid)-tickOpts.padding-getTitleHeight(options.title,this.chart.options.font),maxLabelDiagonal=Math.sqrt(maxLabelWidth*maxLabelWidth+maxLabelHeight*maxLabelHeight),labelRotation=Math.max(minRotation,Math.min(maxRotation,labelRotation=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.U)(Math.min(Math.asin((0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.S)((labelSizes.highest.height+6)/tickWidth,-1,1)),Math.asin((0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.S)(maxHeight/maxLabelDiagonal,-1,1))-Math.asin((0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.S)(maxLabelHeight/maxLabelDiagonal,-1,1))))))),this.labelRotation=labelRotation}afterCalculateLabelRotation(){(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.Q)(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.Q)(this.options.beforeFit,[this])}fit(){let minSize={width:0,height:0},{chart,options:{ticks:tickOpts,title:titleOpts,grid:gridOpts}}=this,display=this._isVisible(),isHorizontal=this.isHorizontal();if(display){let titleHeight=getTitleHeight(titleOpts,chart.options.font);if(isHorizontal?(minSize.width=this.maxWidth,minSize.height=getTickMarkLength(gridOpts)+titleHeight):(minSize.height=this.maxHeight,minSize.width=getTickMarkLength(gridOpts)+titleHeight),tickOpts.display&&this.ticks.length){let{first,last,widest,highest}=this._getLabelSizes(),tickPadding=2*tickOpts.padding,angleRadians=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.t)(this.labelRotation),cos=Math.cos(angleRadians),sin=Math.sin(angleRadians);if(isHorizontal){let labelHeight=tickOpts.mirror?0:sin*widest.width+cos*highest.height;minSize.height=Math.min(this.maxHeight,minSize.height+labelHeight+tickPadding)}else{let labelWidth=tickOpts.mirror?0:cos*widest.width+sin*highest.height;minSize.width=Math.min(this.maxWidth,minSize.width+labelWidth+tickPadding)}this._calculatePadding(first,last,sin,cos)}}this._handleMargins(),isHorizontal?(this.width=this._length=chart.width-this._margins.left-this._margins.right,this.height=minSize.height):(this.width=minSize.width,this.height=this._length=chart.height-this._margins.top-this._margins.bottom)}_calculatePadding(first,last,sin,cos){let{ticks:{align,padding},position}=this.options,isRotated=0!==this.labelRotation,labelsBelowTicks="top"!==position&&"x"===this.axis;if(this.isHorizontal()){let offsetLeft=this.getPixelForTick(0)-this.left,offsetRight=this.right-this.getPixelForTick(this.ticks.length-1),paddingLeft=0,paddingRight=0;isRotated?labelsBelowTicks?(paddingLeft=cos*first.width,paddingRight=sin*last.height):(paddingLeft=sin*first.height,paddingRight=cos*last.width):"start"===align?paddingRight=last.width:"end"===align?paddingLeft=first.width:"inner"!==align&&(pad
6dingLeft=first.width/2,paddingRight=last.width/2),this.paddingLeft=Math.max((paddingLeft-offsetLeft+padding)*this.width/(this.width-offsetLeft),0),this.paddingRight=Math.max((paddingRight-offsetRight+padding)*this.width/(this.width-offsetRight),0)}else{let paddingTop=last.height/2,paddingBottom=first.height/2;"start"===align?(paddingTop=0,paddingBottom=first.height):"end"===align&&(paddingTop=last.height,paddingBottom=0),this.paddingTop=paddingTop+padding,this.paddingBottom=paddingBottom+padding}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.Q)(this.options.afterFit,[this])}isHorizontal(){let{axis,position}=this.options;return"top"===position||"bottom"===position||"x"===axis}isFullSize(){return this.options.fullSize}_convertTicksToLabels(ticks){let i,ilen;for(this.beforeTickToLabelConversion(),this.generateTickLabels(ticks),i=0,ilen=ticks.length;i<ilen;i++)(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.k)(ticks[i].label)&&(ticks.splice(i,1),ilen--,i--);this.afterTickToLabelConversion()}_getLabelSizes(){let labelSizes=this._labelSizes;if(!labelSizes){let sampleSize=this.options.ticks.sampleSize,ticks=this.ticks;sampleSize<ticks.length&&(ticks=sample(ticks,sampleSize)),this._labelSizes=labelSizes=this._computeLabelSizes(ticks,ticks.length,this.options.ticks.maxTicksLimit)}return labelSizes}_computeLabelSizes(ticks,length,maxTicksLimit){let i,j,jlen,label,tickFont,fontString,cache,lineHeight,width,height,nestedLabel;let{ctx,_longestTextCache:caches}=this,widths=[],heights=[],increment=Math.floor(length/getTicksLimit(length,maxTicksLimit)),widestLabelSize=0,highestLabelSize=0;for(i=0;i<length;i+=increment){if(label=ticks[i].label,tickFont=this._resolveTickFontOptions(i),ctx.font=fontString=tickFont.string,cache=caches[fontString]=caches[fontString]||{data:{},gc:[]},lineHeight=tickFont.lineHeight,width=height=0,(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.k)(label)||(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.b)(label)){if((0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.b)(label))for(j=0,jlen=label.length;j<jlen;++j)nestedLabel=label[j],(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.k)(nestedLabel)||(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.b)(nestedLabel)||(width=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.V)(ctx,cache.data,cache.gc,width,nestedLabel),height+=lineHeight)}else width=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.V)(ctx,cache.data,cache.gc,width,label),height=lineHeight;widths.push(width),heights.push(height),widestLabelSize=Math.max(width,widestLabelSize),highestLabelSize=Math.max(height,highestLabelSize)}(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.F)(caches,cache=>{let i;let gc=cache.gc,gcLen=gc.length/2;if(gcLen>length){for(i=0;i<gcLen;++i)delete cache.data[gc[i]];gc.splice(0,gcLen)}});let widest=widths.indexOf(widestLabelSize),highest=heights.indexOf(highestLabelSize),valueAt=idx=>({width:widths[idx]||0,height:heights[idx]||0});return{first:valueAt(0),last:valueAt(length-1),widest:valueAt(widest),highest:valueAt(highest),widths,heights}}getLabelForValue(value){return value}getPixelForValue(value,index){return NaN}getValueForPixel(pixel){}getPixelForTick(index){let ticks=this.ticks;return index<0||index>ticks.length-1?null:this.getPixelForValue(ticks[index].value)}getPixelForDecimal(decimal){this._reversePixels&&(decimal=1-decimal);let pixel=this._startPixel+decimal*this._length;return(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.W)(this._alignToPixels?(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.X)(this.chart,pixel,0):pixel)}getDecimalForPixel(pixel){let decimal=(pixel-this._startPixel)/this._length;return this._reversePixels?1-decimal:decimal}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min,max}=this;return min<0&&max<0?max:min>0&&max>0?min:0}getContext(index){var parent,parent1;let ticks=this.ticks||[];if(index>=0&&index<ticks.length){let tick=ticks[index];return tick.$context||(tick.$context=(parent=this.getContext(),(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.j)(parent,{tick:tick,index:index,type:"tick"})))}return this.$context||(this.$context=(parent1=this.chart.getContext(),(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.j)(parent1,{scale:this,type:"scale"})))}_tickSize(){let optionTicks=this.options.ticks,rot=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.t)(this.labelRotation),cos=Math.abs(Math.cos(rot)),sin=Math.abs(Math.sin(rot)),labelSizes=this._getLabelSizes(),padding=optionTicks.autoSkipPadding||0,w=labelSizes?labelSizes.widest.width+padding:0,h=labelSizes?labelSizes.highest.height+padding:0;return this.isHorizontal()?h*cos>w*sin?w/cos:h/sin:h*sin<w*cos?h/cos:w/sin}_isVisible(){let display=this.options.display;return"auto"!==display?!!display:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(chartArea){let borderValue,i,lineValue,alignedLineValue,tx1,ty1,tx2,ty2,x1,y1,x2,y2;let axis=this.axis,chart=this.chart,options=this.options,{grid,position,border}
6=options,offset=grid.offset,isHorizontal=this.isHorizontal(),ticks=this.ticks,ticksLength=ticks.length+(offset?1:0),tl=getTickMarkLength(grid),items=[],borderOpts=border.setContext(this.getContext()),axisWidth=borderOpts.display?borderOpts.width:0,axisHalfWidth=axisWidth/2,alignBorderValue=function(pixel){return(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.X)(chart,pixel,axisWidth)};if("top"===position)borderValue=alignBorderValue(this.bottom),ty1=this.bottom-tl,ty2=borderValue-axisHalfWidth,y1=alignBorderValue(chartArea.top)+axisHalfWidth,y2=chartArea.bottom;else if("bottom"===position)borderValue=alignBorderValue(this.top),y1=chartArea.top,y2=alignBorderValue(chartArea.bottom)-axisHalfWidth,ty1=borderValue+axisHalfWidth,ty2=this.top+tl;else if("left"===position)borderValue=alignBorderValue(this.right),tx1=this.right-tl,tx2=borderValue-axisHalfWidth,x1=alignBorderValue(chartArea.left)+axisHalfWidth,x2=chartArea.right;else if("right"===position)borderValue=alignBorderValue(this.left),x1=chartArea.left,x2=alignBorderValue(chartArea.right)-axisHalfWidth,tx1=borderValue+axisHalfWidth,tx2=this.left+tl;else if("x"===axis){if("center"===position)borderValue=alignBorderValue((chartArea.top+chartArea.bottom)/2+.5);else if((0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.i)(position)){let positionAxisID=Object.keys(position)[0],value=position[positionAxisID];borderValue=alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value))}y1=chartArea.top,y2=chartArea.bottom,ty2=(ty1=borderValue+axisHalfWidth)+tl}else if("y"===axis){if("center"===position)borderValue=alignBorderValue((chartArea.left+chartArea.right)/2);else if((0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.i)(position)){let positionAxisID1=Object.keys(position)[0],value1=position[positionAxisID1];borderValue=alignBorderValue(this.chart.scales[positionAxisID1].getPixelForValue(value1))}tx2=(tx1=borderValue-axisHalfWidth)-tl,x1=chartArea.left,x2=chartArea.right}let limit=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.v)(options.ticks.maxTicksLimit,ticksLength),step=Math.max(1,Math.ceil(ticksLength/limit));for(i=0;i<ticksLength;i+=step){let context=this.getContext(i),optsAtIndex=grid.setContext(context),optsAtIndexBorder=border.setContext(context),lineWidth=optsAtIndex.lineWidth,lineColor=optsAtIndex.color,borderDash=optsAtIndexBorder.dash||[],borderDashOffset=optsAtIndexBorder.dashOffset,tickWidth=optsAtIndex.tickWidth,tickColor=optsAtIndex.tickColor,tickBorderDash=optsAtIndex.tickBorderDash||[],tickBorderDashOffset=optsAtIndex.tickBorderDashOffset;void 0!==(lineValue=function(scale,index,offsetGridLines){let offset;let length=scale.ticks.length,validIndex=Math.min(index,length-1),start=scale._startPixel,end=scale._endPixel,lineValue=scale.getPixelForTick(validIndex);if(!offsetGridLines||(offset=1===length?Math.max(lineValue-start,end-lineValue):0===index?(scale.getPixelForTick(1)-lineValue)/2:(lineValue-scale.getPixelForTick(validIndex-1))/2,!((lineValue+=validIndex<index?offset:-offset)<start-1e-6)&&!(lineValue>end+1e-6)))return lineValue}(this,i,offset))&&(alignedLineValue=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.X)(chart,lineValue,lineWidth),isHorizontal?tx1=tx2=x1=x2=alignedLineValue:ty1=ty2=y1=y2=alignedLineValue,items.push({tx1,ty1,tx2,ty2,x1,y1,x2,y2,width:lineWidth,color:lineColor,borderDash,borderDashOffset,tickWidth,tickColor,tickBorderDash,tickBorderDashOffset}))}return this._ticksLength=ticksLength,this._borderValue=borderValue,items}_computeLabelItems(chartArea){let i,ilen,label,x,y,textAlign,pixel,font,lineHeight,lineCount,textOffset;let axis=this.axis,options=this.options,{position,ticks:optionTicks}=options,isHorizontal=this.isHorizontal(),ticks=this.ticks,{align,crossAlign,padding,mirror}=optionTicks,tl=getTickMarkLength(options.grid),tickAndPadding=tl+padding,hTickAndPadding=mirror?-padding:tickAndPadding,rotation=-(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.t)(this.labelRotation),items=[],textBaseline="middle";if("top"===position)y=this.bottom-hTickAndPadding,textAlign=this._getXAxisLabelAlignment();else if("bottom"===position)y=this.top+hTickAndPadding,textAlign=this._getXAxisLabelAlignment();else if("left"===position){let ret=this._getYAxisLabelAlignment(tl);textAlign=ret.textAlign,x=ret.x}else if("right"===position){let ret1=this._getYAxisLabelAlignment(tl);textAlign=ret1.textAlign,x=ret1.x}else if("x"===axis){if("center"===position)y=(chartArea.top+chartArea.bottom)/2+tickAndPadding;else if((0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.i)(position)){let positionAxisID=Object.keys(position)[0],value=position[positionAxisID];y=this.chart.scales[positionAxisID].getPixelForValue(value)+tickAndPadding}textAlign=this._getXAxisLabelAlignment()}else if("y"===axis){if("center"===position)x=(chartArea.left+chartArea.right)/2-tickAndPadding;else if((0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.i)(position)){let positionAxisID1=Object.keys(position)[0],value1=position[positionAxisID1];x=this.chart.scales[positionAxisID1].getPixelForValue(value1)}textAlign=this._getYAxisLabelAlignment(tl).textAlign}"y"===axis&&("start"===align?textBaseline="top":"end"===align&&(textBaseline="bottom"));let labelSizes=this._getLabelSizes();for(i=0,ilen=ticks.length;i<ilen;++i){let backdrop;label=ticks[i].label;let optsAtIndex=optionTicks.setContext(this.getContext(i));pixel=this.getPixelForTick(i)+optionTicks.labelOffset,lineHeight=(font=this._resolveTickFontOptions(i)).lineHeight,lineCount=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.b)(label)?label.length:1;let halfCount=lineCount/2,color=optsAtIndex.color,strokeColor=optsAtIndex.textStrokeColor,strokeWidth=optsAtIndex.textStrokeWidth,tickTextAlign=textAlign;if(isHorizontal?(x=pixel,"inner"===textAlign&&(tickTextAlign=i===ilen-1?this.options.reverse?"left"
6:"right":0===i?this.options.reverse?"right":"left":"center"),textOffset="top"===position?"near"===crossAlign||0!==rotation?-lineCount*lineHeight+lineHeight/2:"center"===crossAlign?-labelSizes.highest.height/2-halfCount*lineHeight+lineHeight:-labelSizes.highest.height+lineHeight/2:"near"===crossAlign||0!==rotation?lineHeight/2:"center"===crossAlign?labelSizes.highest.height/2-halfCount*lineHeight:labelSizes.highest.height-lineCount*lineHeight,mirror&&(textOffset*=-1),0===rotation||optsAtIndex.showLabelBackdrop||(x+=lineHeight/2*Math.sin(rotation))):(y=pixel,textOffset=(1-lineCount)*lineHeight/2),optsAtIndex.showLabelBackdrop){let labelPadding=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.E)(optsAtIndex.backdropPadding),height=labelSizes.heights[i],width=labelSizes.widths[i],top=textOffset-labelPadding.top,left=0-labelPadding.left;switch(textBaseline){case"middle":top-=height/2;break;case"bottom":top-=height}switch(textAlign){case"center":left-=width/2;break;case"right":left-=width}backdrop={left,top,width:width+labelPadding.width,height:height+labelPadding.height,color:optsAtIndex.backdropColor}}items.push({label,font,textOffset,options:{rotation,color,strokeColor,strokeWidth,textAlign:tickTextAlign,textBaseline,translation:[x,y],backdrop}})}return items}_getXAxisLabelAlignment(){let{position,ticks}=this.options,rotation=-(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.t)(this.labelRotation);if(rotation)return"top"===position?"left":"right";let align="center";return"start"===ticks.align?align="left":"end"===ticks.align?align="right":"inner"===ticks.align&&(align="inner"),align}_getYAxisLabelAlignment(tl){let textAlign,x;let{position,ticks:{crossAlign,mirror,padding}}=this.options,labelSizes=this._getLabelSizes(),tickAndPadding=tl+padding,widest=labelSizes.widest.width;return"left"===position?mirror?(x=this.right+padding,"near"===crossAlign?textAlign="left":"center"===crossAlign?(textAlign="center",x+=widest/2):(textAlign="right",x+=widest)):(x=this.right-tickAndPadding,"near"===crossAlign?textAlign="right":"center"===crossAlign?(textAlign="center",x-=widest/2):(textAlign="left",x=this.left)):"right"===position?mirror?(x=this.left+padding,"near"===crossAlign?textAlign="right":"center"===crossAlign?(textAlign="center",x-=widest/2):(textAlign="left",x-=widest)):(x=this.left+tickAndPadding,"near"===crossAlign?textAlign="left":"center"===crossAlign?(textAlign="center",x+=widest/2):(textAlign="right",x=this.right)):textAlign="right",{textAlign,x}}_computeLabelArea(){if(this.options.ticks.mirror)return;let chart=this.chart,position=this.options.position;return"left"===position||"right"===position?{top:0,left:this.left,bottom:chart.height,right:this.right}
6:"top"===position||"bottom"===position?{top:this.top,left:0,bottom:this.bottom,right:chart.width}:void 0}drawBackground(){let{ctx,options:{backgroundColor},left,top,width,height}=this;backgroundColor&&(ctx.save(),ctx.fillStyle=backgroundColor,ctx.fillRect(left,top,width,height),ctx.restore())}getLineWidthForValue(value){let grid=this.options.grid;if(!this._isVisible()||!grid.display)return 0;let ticks=this.ticks,index=ticks.findIndex(t=>t.value===value);if(index>=0){let opts=grid.setContext(this.getContext(index));return opts.lineWidth}return 0}drawGrid(chartArea){let i,ilen;let grid=this.options.grid,ctx=this.ctx,items=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(chartArea)),drawLine=(p1,p2,style)=>{style.width&&style.color&&(ctx.save(),ctx.lineWidth=style.width,ctx.strokeStyle=style.color,ctx.setLineDash(style.borderDash||[]),ctx.lineDashOffset=style.borderDashOffset,ctx.beginPath(),ctx.moveTo(p1.x,p1.y),ctx.lineTo(p2.x,p2.y),ctx.stroke(),ctx.restore())};if(grid.display)for(i=0,ilen=items.length;i<ilen;++i){let item=items[i];grid.drawOnChartArea&&drawLine({x:item.x1,y:item.y1},{x:item.x2,y:item.y2},item),grid.drawTicks&&drawLine({x:item.tx1,y:item.ty1},{x:item.tx2,y:item.ty2},{color:item.tickColor,width:item.tickWidth,borderDash:item.tickBorderDash,borderDashOffset:item.tickBorderDashOffset})}}drawBorder(){let x1,x2,y1,y2;let{chart,ctx,options:{border,grid}}=this,borderOpts=border.setContext(this.getContext()),axisWidth=border.display?borderOpts.width:0;if(!axisWidth)return;let lastLineWidth=grid.setContext(this.getContext(0)).lineWidth,borderValue=this._borderValue;this.isHorizontal()?(x1=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.X)(chart,this.left,axisWidth)-axisWidth/2,x2=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.X)(chart,this.right,lastLineWidth)+lastLineWidth/2,y1=y2=borderValue):(y1=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.X)(chart,this.top,axisWidth)-axisWidth/2,y2=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.X)(chart,this.bottom,lastLineWidth)+lastLineWidth/2,x1=x2=borderValue),ctx.save(),ctx.lineWidth=borderOpts.width,ctx.strokeStyle=borderOpts.color,ctx.beginPath(),ctx.moveTo(x1,y1),ctx.lineTo(x2,y2),ctx.stroke(),ctx.restore()}drawLabels(chartArea){let optionTicks=this.options.ticks;if(!optionTicks.display)return;let ctx=this.ctx,area=this._computeLabelArea();area&&(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.Y)(ctx,area);let items=this.getLabelItems(chartArea);for(let item of items){let renderTextOptions=item.options,tickFont=item.font,label=item.label,y=item.textOffset;(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.Z)(ctx,label,0,y,tickFont,renderTextOptions)}area&&(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.$)(ctx)}drawTitle(){let ret;let{ctx,options:{position,title,reverse}}=this;if(!title.display)return;let font=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.a0)(title.font),padding=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.E)(title.padding),align=title.align,offset=font.lineHeight/2;"bottom"===position||"center"===position||(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.i)(position)?(offset+=padding.bottom,(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.b)(title.text)&&(offset+=font.lineHeight*(title.text.length-1))):offset+=padding.top;let{titleX,titleY,maxWidth,rotation}=function(scale,offset,position,align){let maxWidth,titleX,titleY;let{top,left,bottom,right,chart}=scale,{chartArea,scales}=chart,rotation=0,height=bottom-top,width=right-left;if(scale.isHorizontal()){if(titleX=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.a2)(align,left,right),(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.i)(position)){let positionAxisID=Object.keys(position)[0],value=position[positionAxisID];titleY=scales[positionAxisID].getPixelForValue(value)+height-offset}else titleY="center"===position?(chartArea.bottom+chartArea.top)/2+height-offset:offsetFromEdge(scale,position,offset);maxWidth=right-left}else{if((0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.i)(position)){let positionAxisID1=Object.keys(position)[0],value1=position[positionAxisID1];titleX=scales[positionAxisID1].getPixelForValue(value1)-width+offset}else titleX="center"===position?(chartArea.left+chartArea.right)/2-width+offset:offsetFromEdge(scale,position,offset);titleY=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.a2)(align,bottom,top),rotation="left"===position?-_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.H:_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.H}return{titleX,titleY,maxWidth,rotation}}(this,offset,position,align);(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.Z)(ctx,title.text,0,0,font,{color:title.color,maxWidth,rotation,textAlign:(ret=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.a1)(align),(reverse&&"right"!==position||!reverse&&"right"===position)&&(ret=reverseAlign(ret)),ret),textBaseline:"middle",translation:[titleX,titleY]})}
6draw(chartArea){this._isVisible()&&(this.drawBackground(),this.drawGrid(chartArea),this.drawBorder(),this.drawTitle(),this.drawLabels(chartArea))}_layers(){let opts=this.options,tz=opts.ticks&&opts.ticks.z||0,gz=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.v)(opts.grid&&opts.grid.z,-1),bz=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.v)(opts.border&&opts.border.z,0);return this._isVisible()&&this.draw===Scale.prototype.draw?[{z:gz,draw:chartArea=>{this.drawBackground(),this.drawGrid(chartArea),this.drawTitle()}},{z:bz,draw:()=>{this.drawBorder()}},{z:tz,draw:chartArea=>{this.drawLabels(chartArea)}}]:[{z:tz,draw:chartArea=>{this.draw(chartArea)}}]}getMatchingVisibleMetas(type){let i,ilen;let metas=this.chart.getSortedVisibleDatasetMetas(),axisID=this.axis+"AxisID",result=[];for(i=0,ilen=metas.length;i<ilen;++i){let meta=metas[i];meta[axisID]!==this.id||type&&meta.type!==type||result.push(meta)}return result}_resolveTickFontOptions(index){let opts=this.options.ticks.setContext(this.getContext(index));return(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.a0)(opts.font)}_maxDigits(){let fontSize=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/fontSize}}class TypedRegistry{constructor(type,scope,override){this.type=type,this.scope=scope,this.override=override,this.items=Object.create(null)}isForType(type){return Object.prototype.isPrototypeOf.call(this.type.prototype,type.prototype)}register(item){let parentScope;let proto=Object.getPrototypeOf(item);"id"in proto&&"defaults"in proto&&(parentScope=this.register(proto));let items=this.items,id=item.id,scope=this.scope+"."+id;if(!id)throw Error("class does not have id: "+item);return id in items||(items[id]=item,function(item,scope,parentScope){let itemDefaults=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.a4)(Object.create(null),[parentScope?_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.d.get(parentScope):{},_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.d.get(scope),item.defaults]);_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.d.set(scope,itemDefaults),item.defaultRoutes&&function(scope,routes){Object.keys(routes).forEach(property=>{let propertyParts=property.split("."),sourceName=propertyParts.pop(),sourceScope=[scope].concat(propertyParts).join("."),parts=routes[property].split("."),targetName=parts.pop(),targetScope=parts.join(".");_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.d.route(sourceScope,sourceName,targetScope,targetName)})}(scope,item.defaultRoutes),item.descriptors&&_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.d.describe(scope,item.descriptors)}(item,scope,parentScope),this.override&&_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.d.override(item.id,item.overrides)),scope}get(id){return this.items[id]}unregister(item){let items=this.items,id=item.id,scope=this.scope;id in items&&delete items[id],scope&&id in _chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.d[scope]&&(delete _chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.d[scope][id],this.override&&delete _chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.a3[id])}}var registry=new class{constructor(){this.controllers=new TypedRegistry(DatasetController,"datasets",!0),this.elements=new TypedRegistry(Element,"elements"),this.plugins=new TypedRegistry(Object,"plugins"),this.scales=new TypedRegistry(Scale,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...args){this._each("register",args)}remove(...args){this._each("unregister",args)}addControllers(...args){this._each("register",args,this.controllers)}addElements(...args){this._each("register",args,this.elements)}addPlugins(...args){this._each("register",args,this.plugins)}addScales(...args){this._each("register",args,this.scales)}getController(id){return this._get(id,this.controllers,"controller")}getElement(id){return this._get(id,this.elements,"element")}getPlugin(id){return this._get(id,this.plugins,"plugin")}getScale(id){return this._get(id,this.scales,"scale")}
6removeControllers(...args){this._each("unregister",args,this.controllers)}removeElements(...args){this._each("unregister",args,this.elements)}removePlugins(...args){this._each("unregister",args,this.plugins)}removeScales(...args){this._each("unregister",args,this.scales)}_each(method,args,typedRegistry){[...args].forEach(arg=>{let reg=typedRegistry||this._getRegistryForType(arg);typedRegistry||reg.isForType(arg)||reg===this.plugins&&arg.id?this._exec(method,reg,arg):(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.F)(arg,item=>{let itemReg=typedRegistry||this._getRegistryForType(item);this._exec(method,itemReg,item)})})}_exec(method,registry,component){let camelMethod=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.a5)(method);(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.Q)(component["before"+camelMethod],[],component),registry[method](component),(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.Q)(component["after"+camelMethod],[],component)}_getRegistryForType(type){for(let i=0;i<this._typedRegistries.length;i++){let reg=this._typedRegistries[i];if(reg.isForType(type))return reg}return this.plugins}_get(id,typedRegistry,type){let item=typedRegistry.get(id);if(void 0===item)throw Error('"'+id+'" is not a registered '+type+".");return item}};class PluginService{constructor(){this._init=[]}notify(chart,hook,args,filter){"beforeInit"===hook&&(this._init=this._createDescriptors(chart,!0),this._notify(this._init,chart,"install"));let descriptors=filter?this._descriptors(chart).filter(filter):this._descriptors(chart),result=this._notify(descriptors,chart,hook,args);return"afterDestroy"===hook&&(this._notify(descriptors,chart,"stop"),this._notify(this._init,chart,"uninstall")),result}_notify(descriptors,chart,hook,args){for(let descriptor of(args=args||{},descriptors)){let plugin=descriptor.plugin,method=plugin[hook],params=[chart,args,descriptor.options];if(!1===(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.Q)(method,params,plugin)&&args.cancelable)return!1}return!0}invalidate(){(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.k)(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(chart){if(this._cache)return this._cache;let descriptors=this._cache=this._createDescriptors(chart);return this._notifyStateChanges(chart),descriptors}_createDescriptors(chart,all){let config=chart&&chart.config,options=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.v)(config.options&&config.options.plugins,{}),plugins=function(config){let localIds={},plugins=[],keys=Object.keys(registry.plugins.items);for(let i=0;i<keys.length;i++)plugins.push(registry.getPlugin(keys[i]));let local=config.plugins||[];for(let i1=0;i1<local.length;i1++){let plugin=local[i1];-1===plugins.indexOf(plugin)&&(plugins.push(plugin),localIds[plugin.id]=!0)}return{plugins,localIds}}(config);return!1!==options||all?function(chart,{plugins,localIds},options,all){let result=[],context=chart.getContext();for(let plugin of plugins){var options1;let id=plugin.id,opts=(options1=options[id],all||!1!==options1?!0===options1?{}:options1:null);null!==opts&&result.push({plugin,options:function(config,{plugin,local},opts,context){let keys=config.pluginScopeKeys(plugin),scopes=config.getOptionScopes(opts,keys);return local&&plugin.defaults&&scopes.push(plugin.defaults),config.createResolver(scopes,context,[""],{scriptable:!1,indexable:!1,allKeys:!0})}(chart.config,{plugin,local:localIds[id]},opts,context)})}return result}(chart,plugins,options,all):[]}_notifyStateChanges(chart){let previousDescriptors=this._oldCache||[],descriptors=this._cache,diff=(a,b)=>a.filter(x=>!b.some(y=>x.plugin.id===y.plugin.id));this._notify(diff(previousDescriptors,descriptors),chart,"stop"),this._notify(diff(descriptors,previousDescriptors),chart,"start")}}function getIndexAxis(type,options){let datasetDefaults=_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.d.datasets[type]||{},datasetOptions=(options.datasets||{})[type]||{};return datasetOptions.indexAxis||options.indexAxis||datasetDefaults.indexAxis||"x"}function idMatchesAxis(id){if("x"===id||"y"===id||"r"===id)return id}function determineAxis(id,...scaleOptions){if(idMatchesAxis(id))return id;for(let opts of scaleOptions){var position;let axis=opts.axis||("top"===(position=opts.position)||"bottom"===position?"x":"left"
6===position||"right"===position?"y":void 0)||id.length>1&&idMatchesAxis(id[0].toLowerCase());if(axis)return axis}throw Error(`Cannot determine type of '${id}' axis. Please provide 'axis' or 'position' option.`)}function getAxisFromDataset(id,axis,dataset){if(dataset[axis+"AxisID"]===id)return{axis}}function initOptions(config){let options=config.options||(config.options={});options.plugins=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.v)(options.plugins,{}),options.scales=function(config,options){let chartDefaults=_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.a3[config.type]||{scales:{}},configScales=options.scales||{},chartIndexAxis=getIndexAxis(config.type,options),scales=Object.create(null);return Object.keys(configScales).forEach(id=>{let scaleConf=configScales[id];if(!(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.i)(scaleConf))return console.error(`Invalid scale configuration for scale: ${id}`);if(scaleConf._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${id}`);let axis=determineAxis(id,scaleConf,function(id,config){if(config.data&&config.data.datasets){let boundDs=config.data.datasets.filter(d=>d.xAxisID===id||d.yAxisID===id);if(boundDs.length)return getAxisFromDataset(id,"x",boundDs[0])||getAxisFromDataset(id,"y",boundDs[0])}return{}}(id,config),_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.d.scales[scaleConf.type]),defaultScaleOptions=chartDefaults.scales||{};scales[id]=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.ab)(Object.create(null),[{axis},scaleConf,defaultScaleOptions[axis],defaultScaleOptions[axis===chartIndexAxis?"_index_":"_value_"]])}),config.data.datasets.forEach(dataset=>{let type=dataset.type||config.type,indexAxis=dataset.indexAxis||getIndexAxis(type,options),datasetDefaults=_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.a3[type]||{},defaultScaleOptions=datasetDefaults.scales||{};Object.keys(defaultScaleOptions).forEach(defaultID=>{let axis;
6let axis1=(axis=defaultID,"_index_"===defaultID?axis=indexAxis:"_value_"===defaultID&&(axis="x"===indexAxis?"y":"x"),axis),id=dataset[axis1+"AxisID"]||axis1;scales[id]=scales[id]||Object.create(null),(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.ab)(scales[id],[{axis:axis1},configScales[id],defaultScaleOptions[defaultID]])})}),Object.keys(scales).forEach(key=>{let scale=scales[key];(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.ab)(scale,[_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.d.scales[scale.type],_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.d.scale])}),scales}(config,options)}function initData(data){return(data=data||{}).datasets=data.datasets||[],data.labels=data.labels||[],data}let keyCache=new Map,keysCached=new Set;function cachedKeys(cacheKey,generate){let keys=keyCache.get(cacheKey);return keys||(keys=generate(),keyCache.set(cacheKey,keys),keysCached.add(keys)),keys}let addIfFound=(set,obj,key)=>{let opts=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.f)(obj,key);void 0!==opts&&set.add(opts)};class Config{constructor(config){var config1;this._config=((config1=(config1=config)||{}).data=initData(config1.data),initOptions(config1),config1),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(type){this._config.type=type}get data(){return this._config.data}set data(data){this._config.data=initData(data)}get options(){return this._config.options}set options(options){this._config.options=options}get plugins(){return this._config.plugins}update(){let config=this._config;this.clearCache(),initOptions(config)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(datasetType){return cachedKeys(datasetType,()=>[[`datasets.${datasetType}`,""]])}datasetAnimationScopeKeys(datasetType,transition){return cachedKeys(`${datasetType}.transition.${transition}`,()=>[[`datasets.${datasetType}.transitions.${transition}`,`transitions.${transition}`],[`datasets.${datasetType}`,""]])}datasetElementScopeKeys(datasetType,elementType){return cachedKeys(`${datasetType}-${elementType}`,()=>[[`datasets.${datasetType}.elements.${elementType}`,`datasets.${datasetType}`,`elements.${elementType}`,""]])}
6pluginScopeKeys(plugin){let id=plugin.id,type=this.type;return cachedKeys(`${type}-plugin-${id}`,()=>[[`plugins.${id}`,...plugin.additionalOptionScopes||[]]])}_cachedScopes(mainScope,resetCache){let _scopeCache=this._scopeCache,cache=_scopeCache.get(mainScope);return(!cache||resetCache)&&(cache=new Map,_scopeCache.set(mainScope,cache)),cache}getOptionScopes(mainScope,keyLists,resetCache){let{options,type}=this,cache=this._cachedScopes(mainScope,resetCache),cached=cache.get(keyLists);if(cached)return cached;let scopes=new Set;keyLists.forEach(keys=>{mainScope&&(scopes.add(mainScope),keys.forEach(key=>addIfFound(scopes,mainScope,key))),keys.forEach(key=>addIfFound(scopes,options,key)),keys.forEach(key=>addIfFound(scopes,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.a3[type]||{},key)),keys.forEach(key=>addIfFound(scopes,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.d,key)),keys.forEach(key=>addIfFound(scopes,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.a6,key))});let array=Array.from(scopes);return 0===array.length&&array.push(Object.create(null)),keysCached.has(keyLists)&&cache.set(keyLists,array),array}chartOptionScopes(){let{options,type}=this;return[options,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.a3[type]||{},_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.d.datasets[type]||{},{type},_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.d,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.a6]}resolveNamedOptions(scopes,names,context,prefixes=[""]){let result={$shared:!0},{resolver,subPrefixes}=getResolver(this._resolverCache,scopes,prefixes),options=resolver;if(function(proxy,names){let{isScriptable,isIndexable}=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.aa)(proxy);for(let prop of names){let scriptable=isScriptable(prop),indexable=isIndexable(prop),value=(indexable||scriptable)&&proxy[prop];if(scriptable&&((0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.a7)(value)||hasFunction(value))||indexable&&(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.b)(value))return!0}return!1}(resolver,names)){result.$shared=!1,context=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.a7)(context)?context():context;let subResolver=this.createResolver(scopes,context,subPrefixes);options=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.a8)(resolver,context,subResolver)}for(let prop of names)result[prop]=options[prop];return result}createResolver(scopes,context,prefixes=[""],descriptorDefaults){let{resolver}=getResolver(this._resolverCache,scopes,prefixes);return(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.i)(context)?(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.a8)(resolver,context,void 0,descriptorDefaults):resolver}}function getResolver(resolverCache,scopes,prefixes){let cache=resolverCache.get(scopes);cache||(cache=new Map,resolverCache.set(scopes,cache));let cacheKey=prefixes.join(),cached=cache.get(cacheKey);if(!cached){let resolver=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.a9)(scopes,prefixes);cached={resolver,subPrefixes:prefixes.filter(p=>!p.toLowerCase().includes("hover"))},cache.set(cacheKey,cached)}return cached}let hasFunction=value=>(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.i)(value)&&Object.getOwnPropertyNames(value).reduce((acc,key)=>acc||(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.a7)(value[key]),!1),KNOWN_POSITIONS=["top","bottom","left","right","chartArea"];function positionIsHorizontal(position,axis){return"top"===position||"bottom"===position||-1===KNOWN_POSITIONS.indexOf(position)&&"x"===axis}function compare2Level(l1,l2){return function(a,b){return a[l1]===b[l1]?a[l2]-b[l2]:a[l1]-b[l1]}}function onAnimationsComplete(context){let chart=context.chart,animationOptions=chart.options.animation;chart.notifyPlugins("afterRender"),(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.Q)(animationOptions&&animationOptions.onComplete,[context],chart)}function onAnimationProgress(context){let chart=context.chart,animationOptions=chart.options.animation;(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.Q)(animationOptions&&animationOptions.onProgress,[context],chart)}function getCanvas(item){return(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.M)()&&"string"==typeof item?item=document.getElementById(item):item&&item.length&&(item=item[0]),item&&item.canvas&&(item=item.canvas),item}let instances={},getChart=key=>{let canvas=getCanvas(key);return Object.values(instances).filter(c=>c.canvas===canvas).pop()};class Chart{static defaults=_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.d;static instances=instances;static overrides=_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.a3;static registry=registry;static version="4.3.0";static getChart=getChart;static register(...items){registry.add(...items),invalidatePlugins()}static unregister(...items){registry.remove(...items),invalidatePlugins()}constructor(item,userConfig){let config=this.config=new Config(userConfig),initialCanvas=getCanvas(item),existingChart=getChart(initialCanvas);if(existingChart)throw Error("Canvas is already in use. Chart with ID '"+existingChart.id+"' must be destroyed before the canvas with ID '"+existingChart.canvas.id+"' can be reused.");let options=config.createResolver(config.chartOptionScopes(),this.getContext());this.platform=new(config.platform||(!(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.M)()||"undefined"!=typeof OffscreenCanvas&&initialCanvas instanceof OffscreenCanvas?BasicPlatform:DomPlatform)),this.platform.updateConfig(config);let context=this.platform.acquireContext(initialCanvas,options.aspectRatio),canvas=context&&context.canvas,height=canvas&&canvas.height,width=canvas&&canvas.width;if(this.id=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.ac)(),this.ctx=context,this.canvas=canvas,this.width=width,this.height=height,this._options=options,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 PluginService,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.ad)(mode=>this.update(mode),options.resizeDelay||0),this._dataChanges=[],instances[this.id]=this,!context||!canvas){console.error("Failed to create chart: can't acquire context from the given item");return}animator.listen(this,"complete",onAnimationsComplete),animator.listen(this,"progress",onAnimationProgress),this._initialize(),this.attached&&this.update()}get aspectRatio(){let{options:{aspectRatio,maintainAspectRatio},width,height,_aspectRatio}=this;return(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.k)(aspectRatio)?maintainAspectRatio&&_aspectRatio?_aspectRatio:height?width/height:null:aspectRatio}get data(){return this.config.data}set data(data){this.config.data=data}get options(){return this._options}set options(options){this.config.options=options}get registry(){return registry}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.ae)(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.af)(this.canvas,this.ctx),this}stop(){return animator.stop(this),this}resize(width,height){animator.running(this)?this._resizeBeforeDraw={width,height}:this._resize(width,height)}_resize(width,height){let options=this.options,canvas=this.canvas,aspectRatio=options.maintainAspectRatio&&this.aspectRatio,newSize=this.platform.getMaximumSize(canvas,width,height,aspectRatio),newRatio=options.devicePixelRatio||this.platform.getDevicePixelRatio(),mode=this.width?"resize":"attach";this.width=newSize.width,this.height=newSize.height,this._aspectRatio=this.aspectRatio,(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.ae)(this,newRatio,!0)&&(this.notifyPlugins("resize",{size:newSize}),(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.Q)(options.onResize,[this,newSize],this),this.attached&&this._doResize(mode)&&this.render())}ensureScalesHaveIDs(){let options=this.options,scalesOptions=options.scales||{};(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.F)(scalesOptions,(axisOptions,axisI
6D)=>{axisOptions.id=axisID})}buildOrUpdateScales(){let options=this.options,scaleOpts=options.scales,scales=this.scales,updated=Object.keys(scales).reduce((obj,id)=>(obj[id]=!1,obj),{}),items=[];scaleOpts&&(items=items.concat(Object.keys(scaleOpts).map(id=>{let scaleOptions=scaleOpts[id],axis=determineAxis(id,scaleOptions),isRadial="r"===axis,isHorizontal="x"===axis;return{options:scaleOptions,dposition:isRadial?"chartArea":isHorizontal?"bottom":"left",dtype:isRadial?"radialLinear":isHorizontal?"category":"linear"}}))),(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.F)(items,item=>{let scaleOptions=item.options,id=scaleOptions.id,axis=determineAxis(id,scaleOptions),scaleType=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.v)(scaleOptions.type,item.dtype);(void 0===scaleOptions.position||positionIsHorizontal(scaleOptions.position,axis)!==positionIsHorizontal(item.dposition))&&(scaleOptions.position=item.dposition),updated[id]=!0;let scale=null;if(id in scales&&scales[id].type===scaleType)scale=scales[id];else{let scaleClass=registry.getScale(scaleType);scales[(scale=new scaleClass({id,type:scaleType,ctx:this.ctx,chart:this})).id]=scale}scale.init(scaleOptions,options)}),(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.F)(updated,(hasUpdated,id)=>{hasUpdated||delete scales[id]}),(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.F)(scales,scale=>{layouts.configure(this,scale,scale.options),layouts.addBox(this,scale)})}_updateMetasets(){let metasets=this._metasets,numData=this.data.datasets.length,numMeta=metasets.length;if(metasets.sort((a,b)=>a.index-b.index),numMeta>
6numData){for(let i=numData;i<numMeta;++i)this._destroyDatasetMeta(i);metasets.splice(numData,numMeta-numData)}this._sortedMetasets=metasets.slice(0).sort(compare2Level("order","index"))}_removeUnreferencedMetasets(){let{_metasets:metasets,data:{datasets}}=this;metasets.length>datasets.length&&delete this._stacks,metasets.forEach((meta,index)=>{0===datasets.filter(x=>x===meta._dataset).length&&this._destroyDatasetMeta(index)})}buildOrUpdateControllers(){let i,ilen;let newControllers=[],datasets=this.data.datasets;for(this._removeUnreferencedMetasets(),i=0,ilen=datasets.length;i<ilen;i++){let dataset=datasets[i],meta=this.getDatasetMeta(i),type=dataset.type||this.config.type;if(meta.type&&meta.type!==type&&(this._destroyDatasetMeta(i),meta=this.getDatasetMeta(i)),meta.type=type,meta.indexAxis=dataset.indexAxis||getIndexAxis(type,this.options),meta.order=dataset.order||0,meta.index=i,meta.label=""+dataset.label,meta.visible=this.isDatasetVisible(i),meta.controller)meta.controller.updateIndex(i),meta.controller.linkScales();else{let ControllerClass=registry.getController(type),{datasetElementType,dataElementType}=_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.d.datasets[type];Object.assign(ControllerClass,{dataElementType:registry.getElement(dataElementType),datasetElementType:datasetElementType&&registry.getElement(datasetElementType)}),meta.controller=new ControllerClass(this,i),newControllers.push(meta.controller)}}return this._updateMetasets(),newControllers}_resetElements(){(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.F)(this.data.datasets,(dataset,datasetIndex)=>{this.getDatasetMeta(datasetIndex).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(mode){let config=this.config;config.update();let options=this._options=config.createResolver(config.chartOptionScopes(),this.getContext()),animsDisabled=this._animationsDisabled=!options.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode,cancelable:!0}))return;let newControllers=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let minPadding=0;for(let i=0,ilen=this.data.datasets.length;i<ilen;i++){let{controller}=this.getDatasetMeta(i),reset=!animsDisabled&&-1===newControllers.indexOf(controller);controller.buildOrUpdateElements(reset),minPadding=Math.max(+controller.getMaxOverflow(),minPadding)}minPadding=this._minPadding=options.layout.autoPadding?minPadding:0,this._updateLayout(minPadding),animsDisabled||(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.F)(newControllers,controller=>{controller.reset()}),this._updateDatasets(mode),this.notifyPlugins("afterUpdate",{mode}),this._layers.sort(compare2Level("z","_idx"));let{_active,_lastEvent}=this;_lastEvent?this._eventHandler(_lastEvent,!0):_active.length&&this._updateHoverStyles(_active,_active,!0),this.render()}_updateScales(){(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.F)(this.scales,scale=>{layouts.removeBox(this,scale)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let options=this.options,existingEvents=new Set(Object.keys(this._listeners)),newEvents=new Set(options.events);(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.ag)(existingEvents,newEvents)&&!!this._responsiveListeners===options.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices}=this,changes=this._getUniformDataChanges()||[];for(let{method,start,count}of changes){let move="_removeElements"===method?-count:count;!function(obj,start,move){let keys=Object.keys(obj);for(let key of keys){let intKey=+key;if(intKey>=start){let value=obj[key];delete obj[key],(move>0||intKey>start)&&(obj[intKey+move]=value)}}}(_hiddenIndices,start,move)}}_getUniformDataChanges(){let _dataChanges=this._dataChanges;if(!_dataChanges||!_dataChanges.length)return;this._dataChanges=[];let datasetCount=this.data.datasets.length,makeSet=idx=>new Set(_dataChanges.filter(c=>c[0]===idx).map((c,i)=>i+","+c.splice(1).join(","))),changeSet=makeSet(0);for(let i=1;i<datasetCount;i++)if(!(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.ag)(changeSet,makeSet(i)))return;return Array.from(changeSet).map(c=>c.split(",")).map(a=>({method:a[1],start:+a[2],count:+a[3]}))}_updateLayout(minPadding){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;layouts.update(this,this.width,this.height,minPadding);let area=this.chartArea,noArea=area.width<=0||area.height<=0;this._layers=[],(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.F)(this.boxes,box=>
6{noArea&&"chartArea"===box.position||(box.configure&&box.configure(),this._layers.push(...box._layers()))},this),this._layers.forEach((item,index)=>{item._idx=index}),this.notifyPlugins("afterLayout")}_updateDatasets(mode){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode,cancelable:!0})){for(let i=0,ilen=this.data.datasets.length;i<ilen;++i)this.getDatasetMeta(i).controller.configure();for(let i1=0,ilen1=this.data.datasets.length;i1<ilen1;++i1)this._updateDataset(i1,(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.a7)(mode)?mode({datasetIndex:i1}):mode);this.notifyPlugins("afterDatasetsUpdate",{mode})}}_updateDataset(index,mode){let meta=this.getDatasetMeta(index),args={meta,index,mode,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",args)&&(meta.controller._update(mode),args.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",args))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(animator.has(this)?this.attached&&!animator.running(this)&&animator.start(this):(this.draw(),onAnimationsComplete({chart:this})))}draw(){let i;if(this._resizeBeforeDraw){let{width,height}=this._resizeBeforeDraw;this._resize(width,height),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||!1===this.notifyPlugins("beforeDraw",{cancelable:!0}))return;let layers=this._layers;for(i=0;i<layers.length&&layers[i].z<=0;++i)layers[i].draw(this.chartArea);for(this._drawDatasets();i<layers.length;++i)layers[i].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(filterVisible){let i,ilen;let metasets=this._sortedMetasets,result=[];for(i=0,ilen=metasets.length;i<ilen;++i){let meta=metasets[i];(!filterVisible||meta.visible)&&result.push(meta)}return result}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1===this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;let metasets=this.getSortedVisibleDatasetMetas();for(let i=metasets.length-1;i>=0;--i)this._drawDataset(metasets[i]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(meta){let ctx=this.ctx,clip=meta._clip,useClip=!clip.disabled,area=function(meta){let{xScale,yScale}=meta;if(xScale&&yScale)return{left:xScale.left,right:xScale.right,top:yScale.top,bottom:yScale.bottom}}(meta)||this.chartArea,args={meta,index:meta.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",args)&&(useClip&&(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.Y)(ctx,{left:!1===clip.left?0:area.left-clip.left,right:!1===clip.right?this.width:area.right+clip.right,top:!1===clip.top?0:area.top-clip.top,bottom:!1===clip.bottom?this.height:area.bottom+clip.bottom}),meta.controller.draw(),useClip&&(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.$)(ctx),args.cancelable=!1,this.notifyPlugins("afterDatasetDraw",args))}isPointInArea(point){return(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.C)(point,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,mode,options,useFinalPosition){let method=Interaction.modes[mode];return"function"==typeof method?method(this,e,options,useFinalPosition):[]}getDatasetMeta(datasetIndex){let dataset=this.data.datasets[datasetIndex],metasets=this._metasets,meta=metasets.filter(x=>x&&x._dataset===dataset).pop();return meta||(meta={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:dataset&&dataset.order||0,index:datasetIndex,_dataset:dataset,_parsed:[],_sorted:!1},metasets.push(meta)),meta}getContext(){return this.$context||(this.$context=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.j)(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(datasetIndex){let dataset=this.data.datasets[datasetIndex];if(!dataset)return!1;let meta=this.getDatasetMeta(datasetIndex);return"boolean"==typeof meta.hidden?!meta.hidden:!dataset.hidden}setDatasetVisibility(datasetIndex,visible){let meta=this.getDatasetMeta(datasetIndex);meta.hidden=!visible}toggleDataVisibility(index){this._hiddenIndices[index]=!this._hiddenIndices[index]}getDataVisibility(index){return!this._hiddenIndices[index]}_updateVisibility(datasetIndex,dataIndex,visible){let mode=visible?"show":"hide",meta=this.getDatasetMeta(datasetIndex),anims=meta.controller._resolveAnimations(void 0,mode);(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.h)(dataIndex)?(meta.data[dataIndex].hidden=!visible,this.update()):(this.setDatasetVisibility(datasetIndex,visible),anims.update(meta,{visible}),this.update(ctx=>ctx.datasetIndex===datasetIndex?mode:void 0))}hide(datasetIndex,dataIndex){this._updateVisibility(datasetIndex,dataIndex,!1)}show(datasetIndex,dataIndex){this._updateVisibility(datasetIndex,dataIndex,!0)}_destroyDatasetMeta(datasetIndex){let meta=this._metasets[datasetIndex];meta&&meta.controller&&meta.controller._destroy(),delete this._metasets[datasetIndex]}_stop(){let i,ilen;for(this.stop(),animator.remove(this),i=0,ilen=this.data.datasets.length;i<ilen;++i)this._destroyDatasetMeta(i)}destroy(){this.notifyPlugins("beforeDestroy");let{canvas,ctx}=this;this._stop(),this.config.clearCache(),canvas&&(this.unbindEvents(),(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.af)(canvas,ctx),this.platform.releaseContext(ctx),this.canvas=null,this.ctx=null),delete instances[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...args){return this.canvas.toDataURL(...args)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){let listeners=this._listeners,platform=this.platform,_add=(type,listener)=>{platform.addEventListener(this,type,listener),listeners[type]=listener},listener=(e,x,y)=>{e.offsetX=x,e.offsetY=y,this._eventHandler(e)};(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.F)(this.options.events,type=>_add(type,listener))}bindResponsiveEvents(){let detached;this._responsiveListeners||(this._responsiveListeners={});let listeners=this._responsiveListeners,platform=this.platform,_add=(type,listener)=>{platform.addEventListener(this,type,listener),listeners[type]=listener},_remove=(type,listener)=>{listeners[type]&&(platform.removeEventListener(this,type,listener),delete listeners[type])},listener=(width,height)=>{this.canvas&&this.resize(width,height)},attached=()=>{_remove("attach",attached),this.attached=!0,this.resize(),_add("resize",listener),_add("detach",detached)};detached=()=>{this.attached=!1,_remove("resize",listener),this._stop(),this._resize(0,0),_add("attach",attached)},platform.isAttached(this.canvas)?attached():detached()}unbindEvents(){(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.F)(this._listeners,(listener,type)=>{this.platform.removeEventListener(this,type,listener)}),this._listeners={},(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.F)(this._responsiveListeners,(listener,type)=>{this.platform.removeEventListener(this,type,listener)}),this._responsiveListeners=void 0}updateHoverStyle(items,mode,enabled){let item,i,ilen;let prefix=enabled?"set":"remove";for("dataset"===mode&&this.getDatasetMeta(items[0].datasetIndex).controller["_"+prefix+"DatasetHoverStyle"](),i=0,ilen=items.length;i<ilen;++i){item=items[i];let controller=item&&this.getDatasetMeta(item.datasetIndex).controller;controller&&controller[prefix+"HoverStyle"](item.element,item.datasetIndex,item.index)}}getActiveElements(){return this._active||[]}setActiveElements(activeElements){let lastActive=this._active||[],active=activeElements.map(({datasetIndex,index})=>{let meta=this.getDatasetMeta(datasetIndex);if(!meta)throw Error("No dataset found at index "+datasetIndex);return{datasetIndex,element:meta.data[index],index}}),changed=!(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.ah)(active,lastActive);changed&&(this._active=active,this._lastEvent=null,this._updateHoverStyles(active,lastActive))}notifyPlugins(hook,args,filter){return this._plugins.notify(this,hook,args,filter)}isPluginEnabled(pluginId){return 1===this._plugins._cache.filter(p=>p.plugin.id===pluginId).length}_updateHoverStyles(active,lastActive,replay){let hoverOptions=this.options.hover,diff=(a,b)=>a.filter(x=>!b.some(y=>x.datasetIndex===y.datasetIndex&&x.index===y.index)),deactivated=diff(lastActive,active),activated=replay?active:diff(active,lastActive);deactivated.length&&this.updateHoverStyle(deactivated,hoverOptions.mode,!1),activated.length&&hoverOptions.mode&&this.updateHoverStyle(activated,hoverOptions.mode,!0)}_eventHandler(e,replay){let args={event:e,replay,cancelable:!0,inChartArea:this.isPointInArea(e)},eventFilter=plugin=>(plugin.options.events||this.options.events).includes(e.native.type);if(!1===this.notifyPlugins("beforeEvent",args,eventFilter))return;let changed=this._handleEvent(e,replay,args.inChartArea);return args.cancelable=!1,this.notifyPlugins("afterEvent",args,eventFilter),(changed||args.changed)&&this.render(),this}_handleEvent(e,replay,inChartArea){var lastEvent;let{_active:lastActive=[],options}=this,active=this._getActiveElements(e,lastActive,inChartArea,replay),isClick=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.ai)(e),lastEvent1=(lastEvent=this._lastEvent,inChartArea&&"mouseout"!==e.type?isClick?lastEvent:e:null);inChartArea&&(this._lastEvent=null,(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.Q)(options.onHover,[e,active,this],this),isClick&&(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.Q)(options.onClick,[e,active,this],this));let changed=!(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.ah)(active,lastActive);return(changed||replay)&&(this._active=active,this._updateHoverStyles(active,lastActive,replay)),this._lastEvent=lastEvent1,changed}_getActiveElements(e,lastActive,inChartArea,useFinalPosition){if("mouseout"===e.type)return[];if(!inChartArea)return lastActive;let hoverOptions=this.options.hover;return this.getElementsAtEventForMode(e,hoverOptions.mode,hoverOptions,useFinalPosition)}}
6function invalidatePlugins(){return(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.F)(Chart.instances,chart=>chart._plugins.invalidate())}function setStyle(ctx,options,style=options){ctx.lineCap=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.v)(style.borderCapStyle,options.borderCapStyle),ctx.setLineDash((0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.v)(style.borderDash,options.borderDash)),ctx.lineDashOffset=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.v)(style.borderDashOffset,options.borderDashOffset),ctx.lineJoin=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.v)(style.borderJoinStyle,options.borderJoinStyle),ctx.lineWidth=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.v)(style.borderWidth,options.borderWidth),ctx.strokeStyle=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.v)(style.borderColor,options.borderColor)}function lineTo(ctx,previous,target){ctx.lineTo(target.x,target.y)}function pathVars(points,segment,params={}){let count=points.length,{start:paramsStart=0,end:paramsEnd=count-1}=params,{start:segmentStart,end:segmentEnd}=segment,start=Math.max(paramsStart,segmentStart),end=Math.min(paramsEnd,segmentEnd);return{count,start,loop:segment.loop,ilen:end<start&&!(paramsStart<segmentStart&&paramsEnd<segmentStart||paramsStart>segmentEnd&&paramsEnd>segmentEnd)?count+end-start:end-start}}function pathSegment(ctx,line,segment,params){let i,point,prev;let{points,options}=line,{count,start,loop,ilen}=pathVars(points,segment,params),lineMethod=options.stepped?_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.ar:options.tension||"monotone"===options.cubicInterpolationMode?_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.as:lineTo,{move=!0,reverse}=params||{};for(i=0;i<=ilen;++i)(point=points[(start+(reverse?ilen-i:i))%count]).skip||(move?(ctx.moveTo(point.x,point.y),move=!1):lineMethod(ctx,prev,point,reverse,options.stepped),prev=point);return loop&&lineMethod(ctx,prev,point=points[(start+(reverse?ilen:0))%count],reverse,options.stepped),!!loop}function fastPathSegment(ctx,line,segment,params){let i,point,prevX,minY,maxY,lastY;let points=line.points,{count,start,ilen}=pathVars(points,segment,params),{move=!0,reverse}=params||{},avgX=0,countX=0,pointIndex=index=>(start+(reverse?ilen-index:index))%count,drawX=()=>{minY!==maxY&&(ctx.lineTo(avgX,maxY),ctx.lineTo(avgX,minY),ctx.lineTo(avgX,lastY))};for(move&&(point=points[pointIndex(0)],ctx.moveTo(point.x,point.y)),i=0;i<=ilen;++i){if((point=points[pointIndex(i)]).skip)continue;let x=point.x,y=point.y,truncX=0|x;truncX===prevX?(y<minY?minY=y:y>maxY&&(maxY=y),avgX=(countX*avgX+x)/++countX):(drawX(),ctx.lineTo(x,y),prevX=truncX,countX=0,minY=maxY=y),lastY=y}drawX()}function _getSegmentMethod(line){let opts=line.options,borderDash=opts.borderDash&&opts.borderDash.length,useFastPath=!line._decimated&&!line._loop&&!opts.tension&&"monotone"!==opts.cubicInterpolationMode&&!opts.stepped&&!borderDash;return useFastPath?fastPathSegment:pathSegment}let usePath2D="function"==typeof Path2D;class LineElement extends Element{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:name=>"borderDash"!==name&&"fill"!==name};constructor(cfg){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,cfg&&Object.assign(this,cfg)}updateControlPoints(chartArea,indexAxis){let options=this.options;if((options.tension||"monotone"===options.cubicInterpolationMode)&&!options.stepped&&!this._pointsUpdated){let loop=options.spanGaps?this._loop:this._fullLoop;(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.al)(this._points,options,chartArea,loop,indexAxis),this._pointsUpdated=!0}}set points(points){this._points=points,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.am)(this,this.options.segment))}first(){let segments=this.segments,points=this.points;return segments.length&&points[segments[0].start]}last(){let segments=this.segments,points=this.points,count=segments.length;return count&&points[segments[count-1].end]}interpolate(point,property){let i,ilen;let options=this.options,value=point[property],points=this.points,segments=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.an)(this,{property,start:value,end:value});if(!segments.length)return;let result=[],_interpolate=options.stepped?_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.ao:options.tension||"monotone"===options.cubicInterpolationMode?_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.ap:_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.aq;for(i=0,ilen=segments.length;i<ilen;++i){let{start,end}=segments[i],p1=points[start],p2=points[end];if(p1===p2){result.push(p1);continue}let t=Math.abs((value-p1[property])/(p2[property]-p1[property])),interpolated=_interpolate(p1,p2,t,options.stepped);interpolated[property]=point[property],result.push(interpolated)}return 1===result.length?result[0]:result}pathSegment(ctx,segment,params){let segmentMethod=_getSegmentMethod(this);return segmentMethod(ctx,this,segment,params)}path(ctx,start,count){let segments=this.segments,segmentMethod=_getSegmentMethod(this),loop=this._loop;
6for(let segment of(start=start||0,count=count||this.points.length-start,segments))loop&=segmentMethod(ctx,this,segment,{start,end:start+count-1});return!!loop}draw(ctx,chartArea,start,count){let options=this.options||{},points=this.points||[];points.length&&options.borderWidth&&(ctx.save(),function(ctx,line,start,count){if(usePath2D&&!line.options.segment){var line1;let path;(path=(line1=line)._path)||(path=line1._path=new Path2D,line1.path(path,start,count)&&path.closePath()),setStyle(ctx,line1.options),ctx.stroke(path)}else!function(ctx,line,start,count){let{segments,options}=line,segmentMethod=_getSegmentMethod(line);for(let segment of segments)setStyle(ctx,options,segment.style),ctx.beginPath(),segmentMethod(ctx,line,segment,{start,end:start+count-1})&&ctx.closePath(),ctx.stroke()}(ctx,line,start,count)}(ctx,this,start,count),ctx.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function inRange$1(el,pos,axis,useFinalPosition){let options=el.options,{[axis]:value}=el.getProps([axis],useFinalPosition);return Math.abs(pos-value)<options.radius+options.hitRadius}class PointElement extends Element{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(cfg){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,cfg&&Object.assign(this,cfg)}inRange(mouseX,mouseY,useFinalPosition){let options=this.options,{x,y}=this.getProps(["x","y"],useFinalPosition);return Math.pow(mouseX-x,2)+Math.pow(mouseY-y,2)<Math.pow(options.hitRadius+options.radius,2)}inXRange(mouseX,useFinalPosition){return inRange$1(this,mouseX,"x",useFinalPosition)}inYRange(mouseY,useFinalPosition){return inRange$1(this,mouseY,"y",useFinalPosition)}getCenterPoint(useFinalPosition){let{x,y}=this.getProps(["x","y"],useFinalPosition);return{x,y}}size(options){let radius=(options=options||this.options||{}).radius||0;radius=Math.max(radius,radius&&options.hoverRadius||0);let borderWidth=radius&&options.borderWidth||0;return(radius+borderWidth)*2}draw(ctx,area){let options=this.options;!this.skip&&!(options.radius<.1)&&(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.C)(this,area,this.size(options)/2)&&(ctx.strokeStyle=options.borderColor,ctx.lineWidth=options.borderWidth,ctx.fillStyle=options.backgroundColor,(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.at)(ctx,options,this.x,this.y))}getRange(){let options=this.options||{};return options.radius+options.hitRadius}}function getBarBounds(bar,useFinalPosition){let left,right,top,bottom,half;let{x,y,base,width,height}=bar.getProps(["x","y","base","width","height"],useFinalPosition);return bar.horizontal?(half=height/2,left=Math.min(x,base),right=Math.max(x,base),top=y-half,bottom=y+half):(left=x-(half=width/2),right=x+half,top=Math.min(y,base),bottom=Math.max(y,base)),{left,top,right,bottom}}function skipOrLimit(skip,value,min,max){return skip?0:(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.S)(value,min,max)}function inRange(bar,x,y,useFinalPosition){let skipX=null===x,skipY=null===y,bounds=bar&&!(skipX&&skipY)&&getBarBounds(bar,useFinalPosition);return bounds&&(skipX||(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.aj)(x,bounds.left,bounds.right))&&(skipY||(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.aj)(y,bounds.top,bounds.bottom))}function addNormalRectPath(ctx,rect){ctx.rect(rect.x,rect.y,rect.w,rect.h)}function inflateRect(rect,amount,refRect={}){let x=rect.x!==refRect.x?-amount:0,y=rect.y!==refRect.y?-amount:0,w=(rect.x+rect.w!==refRect.x+refRect.w?amount:0)-x,h=(rect.y+rect.h!==refRect.y+refRect.h?amount:0)-y;return{x:rect.x+x,y:rect.y+y,w:rect.w+w,h:rect.h+h,radius:rect.radius}}class BarElement extends Element{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(cfg){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmou
6nt=void 0,cfg&&Object.assign(this,cfg)}draw(ctx){var radius;let{inflateAmount,options:{borderColor,backgroundColor}}=this,{inner,outer}=function(bar){let bounds=getBarBounds(bar),width=bounds.right-bounds.left,height=bounds.bottom-bounds.top,border=function(bar,maxW,maxH){let value=bar.options.borderWidth,skip=bar.borderSkipped,o=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.av)(value);return{t:skipOrLimit(skip.top,o.top,0,maxH),r:skipOrLimit(skip.right,o.right,0,maxW),b:skipOrLimit(skip.bottom,o.bottom,0,maxH),l:skipOrLimit(skip.left,o.left,0,maxW)}}(bar,width/2,height/2),radius=function(bar,maxW,maxH){let{enableBorderRadius}=bar.getProps(["enableBorderRadius"]),value=bar.options.borderRadius,o=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.aw)(value),maxR=Math.min(maxW,maxH),skip=bar.borderSkipped,enableBorder=enableBorderRadius||(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.i)(value);return{topLeft:skipOrLimit(!enableBorder||skip.top||skip.left,o.topLeft,0,maxR),topRight:skipOr
6Limit(!enableBorder||skip.top||skip.right,o.topRight,0,maxR),bottomLeft:skipOrLimit(!enableBorder||skip.bottom||skip.left,o.bottomLeft,0,maxR),bottomRight:skipOrLimit(!enableBorder||skip.bottom||skip.right,o.bottomRight,0,maxR)}}(bar,width/2,height/2);return{outer:{x:bounds.left,y:bounds.top,w:width,h:height,radius},inner:{x:bounds.left+border.l,y:bounds.top+border.t,w:width-border.l-border.r,h:height-border.t-border.b,radius:{topLeft:Math.max(0,radius.topLeft-Math.max(border.t,border.l)),topRight:Math.max(0,radius.topRight-Math.max(border.t,border.r)),bottomLeft:Math.max(0,radius.bottomLeft-Math.max(border.b,border.l)),bottomRight:Math.max(0,radius.bottomRight-Math.max(border.b,border.r))}}}}(this),addRectPath=(radius=outer.radius).topLeft||radius.topRight||radius.bottomLeft||radius.bottomRight?_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.au:addNormalRectPath;ctx.save(),(outer.w!==inner.w||outer.h!==inner.h)&&(ctx.beginPath(),addRectPath(ctx,inflateRect(outer,inflateAmount,inner)),ctx.clip(),addRectPath(ctx,inflateRect(inner,-inflateAmount,outer)),ctx.fillStyle=borderColor,ctx.fill("evenodd")),ctx.beginPath(),addRectPath(ctx,inflateRect(inner,inflateAmount)),ctx.fillStyle=backgroundColor,ctx.fill(),ctx.restore()}inRange(mouseX,mouseY,useFinalPosition){return inRange(this,mouseX,mouseY,useFinalPosition)}inXRange(mouseX,useFinalPosition){return inRange(this,mouseX,null,useFinalPosition)}inYRange(mouseY,useFinalPosition){return inRange(this,null,mouseY,useFinalPosition)}getCenterPoint(useFinalPosition){let{x,y,base,horizontal}=this.getProps(["x","y","base","horizontal"],useFinalPosition);return{x:horizontal?(x+base)/2:x,y:horizontal?y:(y+base)/2}}getRange(axis){return"x"===axis?this.width/2:this.height/2}}function _getBounds(property,first,last,loop){if(loop)return;let start=first[property],end=last[property];return"angle"===property&&(start=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.ay)(start),end=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.ay)(end)),{property,start,end}}function _findSegmentEnd(start,end,points){for(;end>start;end--){let point=points[end];if(!isNaN(point.x)&&!isNaN(point.y))break}return end}function _getEdge(a,b,prop,fn){return a&&b?fn(a[prop],b[prop]):a?a[prop]:b?b[prop]:0}["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"].map(color=>color.replace("rgb(","rgba(").replace(")",", 0.5)"));function interpolatedLineTo(ctx,target,point,property){let interpolatedPoint=target.interpolate(point,property);interpolatedPoint&&ctx.lineTo(interpolatedPoint.x,interpolatedPoint.y)}let getBoxSize=(labelOpts,fontSize)=>{let{boxHeight=fontSize,boxWidth=fontSize}=labelOpts;return labelOpts.usePointStyle&&(boxHeight=Math.min(boxHeight,fontSize),boxWidth=labelOpts.pointStyleWidth||Math.min(boxWidth,fontSize)),{boxWidth,boxHeight,itemHeight:Math.max(fontSize,boxHeight)}},itemsEqual=(a,b)=>null!==a&&null!==b&&a.datasetIndex===b.datasetIndex&&a.index===b.index;class Legend extends Element{constructor(config){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=config.chart,this.options=config.options,this.ctx=config.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(maxWidth,maxHeight,margins){this.maxWidth=maxWidth,this.maxHeight=maxHeight,this._margins=margins,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){let labelOpts=this.options.labels||{},legendItems=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.Q)(labelOpts.generateLabels,[this.chart],this)||[];labelOpts.filter&&(legendItems=legendItems.filter(item=>labelOpts.filter(item,this.chart.data))),labelOpts.sort&&(legendItems=legendItems.sort((a,b)=>labelOpts.sort(a,b,this.chart.data))),this.options.reverse&&legendItems.reverse(),this.legendItems=legendItems}fit(){let width,height;let{options,ctx}=this;if(!options.display){this.width=this.height=0;return}let labelOpts=options.labels,labelFont=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.a0)(labelOpts.font),fontSize=labelFont.size,titleHeight=this._computeTitleHeight(),{boxWidth,itemHeight}=getBoxSize(labelOpts,fontSize);ctx.font=labelFont.string,this.isHorizontal()?(width=this.maxWidth,height=this._fitRows(titleHeight,fontSize,boxWidth,itemHeight)+10):(height=this.maxHeight,width=this._fitCols(titleHeight,labelFont,boxWidth,itemHeight)+10),this.width=Math.min(width,options.maxWidth||this.maxWidth),this.height=Math.min(height,options.maxHeight||this.maxHeight)}_fitRows(titleHeight,fontSize,boxWidth,itemHeight){let{ctx,maxWidth,options:{labels:{padding}}}=this,hitboxes=this.legendHitBoxes=[],lineWidths=this.lineWidths=[0],lineHeight=itemHeight+padding,totalHeight=titleHeight;ctx.textAlign="left",ctx.textBaseline="middle";let row=-1,top=-lineHeight;
6return this.legendItems.forEach((legendItem,i)=>{let itemWidth=boxWidth+fontSize/2+ctx.measureText(legendItem.text).width;(0===i||lineWidths[lineWidths.length-1]+itemWidth+2*padding>maxWidth)&&(totalHeight+=lineHeight,lineWidths[lineWidths.length-(i>0?0:1)]=0,top+=lineHeight,row++),hitboxes[i]={left:0,top,row,width:itemWidth,height:itemHeight},lineWidths[lineWidths.length-1]+=itemWidth+padding}),totalHeight}_fitCols(titleHeight,labelFont,boxWidth,_itemHeight){let{ctx,maxHeight,options:{labels:{padding}}}=this,hitboxes=this.legendHitBoxes=[],columnSizes=this.columnSizes=[],heightLimit=maxHeight-titleHeight,totalWidth=padding,currentColWidth=0,currentColHeight=0,left=0,col=0;return this.legendItems.forEach((legendItem,i)=>{let{itemWidth,itemHeight}=function(boxWidth,labelFont,ctx,legendItem,_itemHeight){var fontLineHeight;let legendItemText,itemHeight;let itemWidth=((legendItemText=legendItem.text)&&"string"!=typeof legendItemText&&(legendItemText=legendItemText.reduce((a,b)=>a.length>b.length?a:b)),boxWidth+labelFont.size/2+ctx.measureText(legendItemText).width),itemHeight1=(fontLineHeight=labelFont.lineHeight,itemHeight=_itemHeight,"string"!=typeof legendItem.text&&(itemHeight=calculateLegendItemHeight(legendItem,fontLineHeight)),itemHeight);return{itemWidth,itemHeight:itemHeight1}}(boxWidth,labelFont,ctx,legendItem,_itemHeight);i>0&&currentColHeight+itemHeight+2*padding>heightLimit&&(totalWidth+=currentColWidth+padding,columnSizes.push({width:currentColWidth,height:currentColHeight}),left+=currentColWidth+padding,col++,currentColWidth=currentColHeight=0),hitboxes[i]={left,top:currentColHeight,col,width:itemWidth,height:itemHeight},currentColWidth=Math.max(currentColWidth,itemWidth),currentColHeight+=itemHeight+padding}),totalWidth+=currentColWidth,columnSizes.push({width:currentColWidth,height:currentColHeight}),totalWidth}adjustHitBoxes(){if(!this.options.display)return;let titleHeight=this._computeTitleHeight(),{legendHitBoxes:hitboxes,options:{align,labels:{padding},rtl}}=this,rtlHelper=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.az)(rtl,this.left,this.width);if(this.isHorizontal()){let row=0,left=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.a2)(align,this.left+padding,this.right-this.lineWidths[row]);for(let hitbox of hitboxes)row!==hitbox.row&&(row=hitbox.row,left=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.a2)(align,this.left+padding,this.right-this.lineWidths[row])),hitbox.top+=this.top+titleHeight+padding,hitbox.left=rtlHelper.leftForLtr(rtlHelper.x(left),hitbox.width),left+=hitbox.width+padding}else{let col=0,top=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.a2)(align,this.top+titleHeight+padding,this.bottom-this.columnSizes[col].height);for(let hitbox1 of hitboxes)hitbox1.col!==col&&(col=hitbox1.col,top=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.a2)(align,this.top+titleHeight+padding,this.bottom-this.columnSizes[col].height)),hitbox1.top=top,hitbox1.left+=this.left+padding,hitbox1.left=rtlHelper.leftForLtr(rtlHelper.x(hitbox1.left),hitbox1.width),top+=hitbox1.height+padding}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){let ctx=this.ctx;(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.Y)(ctx,this),this._draw(),(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.$)(ctx)}}_draw(){let cursor;let{options:opts,columnSizes,lineWidths,ctx}=this,{align,labels:labelOpts}=opts,defaultColor=_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.d.color,rtlHelper=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.az)(opts.rtl,this.left,this.width),labelFont=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.a0)(labelOpts.font),{padding}=labelOpts,fontSize=labelFont.size,halfFontSize=fontSize/2;this.drawTitle(),ctx.textAlign=rtlHelper.textAlign("left"),ctx.textBaseline="middle",ctx.lineWidth=.5,ctx.font=labelFont.string;let{boxWidth,boxHeight,itemHeight}=getBoxSize(labelOpts,fontSize),drawLegendBox=function(x,y,legendItem){if(isNaN(boxWidth)||boxWidth<=0||isNaN(boxHeight)||boxHeight<0)return;ctx.save();let lineWidth=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.v)(legendItem.lineWidth,1);if(ctx.fillStyle=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.v)(legendItem.fillStyle,defaultColor),ctx.lineCap=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.v)(legendItem.lineCap,"butt"),ctx.lineDashOffset=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.v)(legendItem.lineDashOffset,0),ctx.lineJoin=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.v)(legendItem.lineJoin,"miter"),ctx.lineWidth=lineWidth,ctx.strokeStyle=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.v)(legendItem.strokeStyle,defaultColor),ctx.setLineDash((0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.v)(legendItem.lineDash,[])),labelOpts.usePointStyle){let drawOptions={radius:boxHeight*Math.SQRT2/2,pointStyle:legendItem.pointStyle,rotation:legendItem.rotation,borderWidth:lineWidth},centerX=rtlHelper.xPlus(x,boxWidth/2);(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.aD)(ctx,drawOptions,centerX,y+halfFontSize,labelOpts.pointStyleWidth&&boxWidth)}else{let yBoxTop=y+Math.max((fontSize-boxHeight)/2,0),xBoxLeft=rtlHelper.leftForLtr(x,boxWidth),borderRadius=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.aw)(legendItem.borderRadius);ctx.beginPath(),Object.values(borderRadius).some(v=>0!==v)?(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.au)(ctx,{x:xBoxLeft,y:yBoxTop,w:boxWidth,h:boxHeight,radius:borderRadius}):ctx.rect(xBoxLeft,yBoxTop,boxWidth,boxHeight),ctx.fill(),0!==lineWidth&&ctx.stroke()}
6ctx.restore()},fillText=function(x,y,legendItem){(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.Z)(ctx,legendItem.text,x,y+itemHeight/2,labelFont,{strikethrough:legendItem.hidden,textAlign:rtlHelper.textAlign(legendItem.textAlign)})},isHorizontal=this.isHorizontal(),titleHeight=this._computeTitleHeight();cursor=isHorizontal?{x:(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.a2)(align,this.left+padding,this.right-lineWidths[0]),y:this.top+padding+titleHeight,line:0}:{x:this.left+padding,y:(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.a2)(align,this.top+titleHeight+padding,this.bottom-columnSizes[0].height),line:0},(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.aA)(this.ctx,opts.textDirection);let lineHeight=itemHeight+padding;this.legendItems.forEach((legendItem,i)=>{ctx.strokeStyle=legendItem.fontColor,ctx.fillStyle=legendItem.fontColor;let textWidth=ctx.measureText(legendItem.text).width,textAlign=rtlHelper.textAlign(legendItem.textAlign||(legendItem.textAlign=labelOpts.textAlign)),width=boxWidth+halfFontSize+textWidth,x=cursor.x,y=cursor.y;rtlHelper.setWidth(this.width),isHorizontal?i>0&&x+width+padding>this.right&&(y=cursor.y+=lineHeight,cursor.line++,x=cursor.x=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.a2)(align,this.left+padding,this.right-lineWidths[cursor.line])):i>0&&y+lineHeight>this.bottom&&(x=cursor.x=x+columnSizes[cursor.line].width+padding,cursor.line++,y=cursor.y=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.a2)(align,this.top+titleHeight+padding,this.bottom-columnSizes[cursor.line].height));let realX=rtlHelper.x(x);if(drawLegendBox(realX,y,legendItem),x=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.aB)(textAlign,x+boxWidth+halfFontSize,isHorizontal?x+width:this.right,opts.rtl),fillText(rtlHelper.x(x),y,legendItem),isHorizontal)cursor.x+=width+padding;else if("string"!=typeof legendItem.text){let fontLineHeight=labelFont.lineHeight;cursor.y+=calculateLegendItemHeight(legendItem,fontLineHeight)}else cursor.y+=lineHeight}),(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.aC)(this.ctx,opts.textDirection)}drawTitle(){let y;let opts=this.options,titleOpts=opts.title,titleFont=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.a0)(titleOpts.font),titlePadding=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.E)(titleOpts.padding);if(!titleOpts.display)return;let rtlHelper=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.az)(opts.rtl,this.left,this.width),ctx=this.ctx,position=titleOpts.position,halfFontSize=titleFont.size/2,topPaddingPlusHalfFontSize=titlePadding.top+halfFontSize,left=this.left,maxWidth=this.width;if(this.isHorizontal())maxWidth=Math.max(...this.lineWidths),y=this.top+topPaddingPlusHalfFontSize,left=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.a2)(opts.align,left,this.right-maxWidth);else{let maxHeight=this.columnSizes.reduce((acc,size)=>Math.max(acc,size.height),0);y=topPaddingPlusHalfFontSize+(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.a2)(opts.align,this.top,this.bottom-maxHeight-opts.labels.padding-this._computeTitleHeight())}let x=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.a2)(position,left,left+maxWidth);ctx.textAlign=rtlHelper.textAlign((0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.a1)(position)),ctx.textBaseline="middle",ctx.strokeStyle=titleOpts.color,ctx.fillStyle=titleOpts.color,ctx.font=titleFont.string,(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.Z)(ctx,titleOpts.text,x,y,titleFont)}_computeTitleHeight(){let titleOpts=this.options.title,titleFont=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.a0)(titleOpts.font),titlePadding=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.E)(titleOpts.padding);return titleOpts.display?titleFont.lineHeight+titlePadding.height:0}_getLegendItemAt(x,y){let i,hitBox,lh;if((0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.aj)(x,this.left,this.right)&&(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.aj)(y,this.top,this.bottom)){for(i=0,lh=this.legendHitBoxes;i<lh.length;++i)if(hitBox=lh[i],(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.aj)(x,hitBox.left,hitBox.left+hitBox.width)&&(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.aj)(y,hitBox.top,hitBox.top+hitBox.height))return this.legendItems[i]}return null}handleEvent(e){var type;let opts=this.options;if(("mousemove"!==(type=e.type)&&"mouseout"!==type||!opts.onHover&&!opts.onLeave)&&(!opts.onClick||"click"!==type&&"mouseup"!==type))return;let hoveredItem=this._getLegendItemAt(e.x,e.y);if("mousemove"===e.type||"mouseout"===e.type){let previous=this._hoveredItem,sameItem=itemsEqual(previous,hoveredItem);previous&&!sameItem&&(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.Q)(opts.onLeave,[e,previous,this],this),this._hoveredItem=hoveredItem,hoveredItem&&!sameItem&&(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.Q)(opts.onHover,[e,hoveredItem,this],this)}else hoveredItem&&(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.Q)(opts.onClick,[e,hoveredItem,this],this)}}function calculateLegendItemHeight(legendItem,fontLineHeight){let labelHeight=legendItem.text?legendItem.text.length+.5:0;return fontLineHeight*labelHeight}var plugin_legend={id:"legend",_element:Legend,start(chart,_args,options){let legend=chart.legend=new Legend({ctx:chart.ctx,options,chart});layouts.configure(chart,legend,options),layouts.addBox(chart,legend)},stop(chart){layouts.removeBox(chart,chart.legend),delete chart.legend},beforeUpdate(chart,_args,options){let legend=chart.legend;layouts.configure(chart,legend,options),legend.options=options},afterUpdate(chart){let legend=chart.legend;legend.buildLabels(),legend.adjustHitBoxes()},afterEvent(chart,args){args.replay||chart.legend.handleEvent(args.event)}
6,defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,legendItem,legend){let index=legendItem.datasetIndex,ci=legend.chart;ci.isDatasetVisible(index)?(ci.hide(index),legendItem.hidden=!0):(ci.show(index),legendItem.hidden=!1)},onHover:null,onLeave:null,labels:{color:ctx=>ctx.chart.options.color,boxWidth:40,padding:10,generateLabels(chart){let datasets=chart.data.datasets,{labels:{usePointStyle,pointStyle,textAlign,color,useBorderRadius,borderRadius}}=chart.legend.options;return chart._getSortedDatasetMetas().map(meta=>{let style=meta.controller.getStyle(usePointStyle?0:void 0),borderWidth=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.E)(style.borderWidth);return{text:datasets[meta.index].label,fillStyle:style.backgroundColor,fontColor:color,hidden:!meta.visible,lineCap:style.borderCapStyle,lineDash:style.borderDash,lineDashOffset:style.borderDashOffset,lineJoin:style.borderJoinStyle,lineWidth:(borderWidth.width+borderWidth.height)/4,strokeStyle:style.borderColor,pointStyle:pointStyle||style.pointStyle,rotation:style.rotation,textAlign:textAlign||style.textAlign,borderRadius:useBorderRadius&&(borderRadius||style.borderRadius),datasetIndex:meta.index}},this)}},title:{color:ctx=>ctx.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:name=>!name.startsWith("on"),labels:{_scriptable:name=>!["generateLabels","filter","sort"].includes(name)}}};class Title extends Element{constructor(config){super(),this.chart=config.chart,this.options=config.options,this.ctx=config.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(maxWidth,maxHeight){let opts=this.options;if(this.left=0,this.top=0,!opts.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=maxWidth,this.height=this.bottom=maxHeight;let lineCount=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.b)(opts.text)?opts.text.length:1;this._padding=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.E)(opts.padding);let textSize=lineCount*(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.a0)(opts.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=textSize:this.width=textSize}isHorizontal(){let pos=this.options.position;return"top"===pos||"bottom"===pos}_drawArgs(offset){let maxWidth,titleX,titleY;let{top,left,bottom,right,options}=this,align=options.align,rotation=0;return this.isHorizontal()?(titleX=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.a2)(align,left,right),titleY=top+offset,maxWidth=right-left):("left"===options.position?(titleX=left+offset,titleY=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.a2)(align,bottom,top),rotation=-.5*_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.P):(titleX=right-offset,titleY=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.a2)(align,top,bottom),rotation=.5*_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.P),maxWidth=bottom-top),{titleX,titleY,maxWidth,rotation}}draw(){let ctx=this.ctx,opts=this.options;if(!opts.display)return;let fontOpts=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.a0)(opts.font),lineHeight=fontOpts.lineHeight,offset=lineHeight/2+this._padding.top,{titleX,titleY,maxWidth,rotation}=this._drawArgs(offset);(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.Z)(ctx,opts.text,0,0,fontOpts,{color:opts.color,maxWidth,rotation,textAlign:(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.a1)(opts.align),textBaseline:"middle",translation:[titleX,titleY]})}}var plugin_title={id:"title",_element:Title,start(chart,_args,options){!function(chart,titleOpts){let title=new Title({ctx:chart.ctx,options:titleOpts,chart});layouts.configure(chart,title,titleOpts),layouts.addBox(chart,title),chart.titleBlock=title}(chart,options)},stop(chart){let titleBlock=chart.titleBlock;layouts.removeBox(chart,titleBlock),delete chart.titleBlock},beforeUpdate(chart,_args,options){let title=chart.titleBlock;layouts.configure(chart,title,options),title.options=options},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};new WeakMap;let positioners={average(items){let i,len;if(!items.length)return!1;let x=0,y=0,count=0;for(i=0,len=items.length;i<len;++i){let el=items[i].element;if(el&&el.hasValue()){let pos=el.tooltipPosition();x+=pos.x,y+=pos.y,++count}}return{x:x/count,y:y/count}},nearest(items,eventPosition){let i,len,nearestElement;if(!items.length)return!1;let x=eventPosition.x,y=eventPosition.y,minDistance=Number.POSITIVE_INFINITY;for(i=0,len=items.length;i<len;++i){let el=items[i].element;if(el&&el.hasValue()){let center=el.getCenterPoint(),d=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.aE)(eventPosition,center);d<minDistance&&(minDistance=d,nearestElement=el)}
6}if(nearestElement){let tp=nearestElement.tooltipPosition();x=tp.x,y=tp.y}return{x,y}}};function pushOrConcat(base,toPush){return toPush&&((0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.b)(toPush)?Array.prototype.push.apply(base,toPush):base.push(toPush)),base}function splitNewlines(str){return("string"==typeof str||str instanceof String)&&str.indexOf("\n")>-1?str.split("\n"):str}function getTooltipSize(tooltip,options){let ctx=tooltip.chart.ctx,{body,footer,title}=tooltip,{boxWidth,boxHeight}=options,bodyFont=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.a0)(options.bodyFont),titleFont=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.a0)(options.titleFont),footerFont=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.a0)(options.footerFont),titleLineCount=title.length,footerLineCount=footer.length,bodyLineItemCount=body.length,padding=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.E)(options.padding),height=padding.height,width=0,combinedBodyLength=body.reduce((count,bodyItem)=>count+bodyItem.before.length+bodyItem.lines.length+bodyItem.after.length,0);if(combinedBodyLength+=tooltip.beforeBody.length+tooltip.afterBody.length,titleLineCount&&(height+=titleLineCount*titleFont.lineHeight+(titleLineCount-1)*options.titleSpacing+options.titleMarginBottom),combinedBodyLength){let bodyLineHeight=options.displayColors?Math.max(boxHeight,bodyFont.lineHeight):bodyFont.lineHeight;height+=bodyLineItemCount*bodyLineHeight+(combinedBodyLength-bodyLineItemCount)*bodyFont.lineHeight+(combinedBodyLength-1)*options.bodySpacing}footerLineCount&&(height+=options.footerMarginTop+footerLineCount*footerFont.lineHeight+(footerLineCount-1)*options.footerSpacing);let widthPadding=0,maxLineWidth=function(line){width=Math.max(width,ctx.measureText(line).width+widthPadding)};return ctx.save(),ctx.font=titleFont.string,(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.F)(tooltip.title,maxLineWidth),ctx.font=bodyFont.string,(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.F)(tooltip.beforeBody.concat(tooltip.afterBody),maxLineWidth),widthPadding=options.displayColors?boxWidth+2+options.boxPadding:0,(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.F)(body,bodyItem=>{(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.F)(bodyItem.before,maxLineWidth),(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.F)(bodyItem.lines,maxLineWidth),(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.F)(bodyItem.after,maxLineWidth)}),widthPadding=0,ctx.font=footerFont.string,(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.F)(tooltip.footer,maxLineWidth),ctx.restore(),width+=padding.width,{width,height}}function determineAlignment(chart,options,size){let yAlign=size.yAlign||options.yAlign||function(chart,size){let{y,height}=size;return y<height/2?"top":y>chart.height-height/2?"bottom":"center"}(chart,size);return{xAlign:size.xAlign||options.xAlign||function(chart,options,size,yAlign){let{x,width}=size,{width:chartWidth,chartArea:{left,right}}=chart,xAlign="center";return"center"===yAlign?xAlign=x<=(left+right)/2?"left":"right":x<=width/2?xAlign="left":x>=chartWidth-width/2&&(xAlign="right"),function(xAlign,chart,options,size){let{x,width}=size,caret=options.caretSize+options.caretPadding;if("left"===xAlign&&x+width+caret>chart.width||"right"===xAlign&&x-width-caret<0)return!0}(xAlign,chart,options,size)&&(xAlign="center"),xAlign}(chart,options,size,yAlign),yAlign}}function getBackgroundPoint(options,size,alignment,chart){let{caretSize,caretPadding,cornerRadius}=options,{xAlign,yAlign}=alignment,paddingAndSize=caretSize+caretPadding,{topLeft,topRight,bottomLeft,bottomRight}=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.aw)(cornerRadius),x=function(size,xAlign){let{x,width}=size;return"right"===xAlign?x-=width:"center"===xAlign&&(x-=width/2),x}(size,xAlign),y=function(size,yAlign,paddingAndSize){let{y,height}=size;return"top"===yAlign?y+=paddingAndSize:"bottom"===yAlign?y-=height+paddingAndSize:y-=height/2,y}(size,yAlign,paddingAndSize);
6return"center"===yAlign?"left"===xAlign?x+=paddingAndSize:"right"===xAlign&&(x-=paddingAndSize):"left"===xAlign?x-=Math.max(topLeft,bottomLeft)+caretSize:"right"===xAlign&&(x+=Math.max(topRight,bottomRight)+caretSize),{x:(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.S)(x,0,chart.width-size.width),y:(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.S)(y,0,chart.height-size.height)}}function getAlignedX(tooltip,align,options){let padding=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.E)(options.padding);return"center"===align?tooltip.x+tooltip.width/2:"right"===align?tooltip.x+tooltip.width-padding.right:tooltip.x+padding.left}function overrideCallbacks(callbacks,context){let override=context&&context.dataset&&context.dataset.tooltip&&context.dataset.tooltip.callbacks;return override?callbacks.override(override):callbacks}let defaultCallbacks={beforeTitle:_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.aF,title(tooltipItems){if(tooltipItems.length>0){let item=tooltipItems[0],labels=item.chart.data.labels,labelCount=labels?labels.length:0;if(this&&this.options&&"dataset"===this.options.mode)return item.dataset.label||"";if(item.label)return item.label;if(labelCount>0&&item.dataIndex<labelCount)return labels[item.dataIndex]}return""},afterTitle:_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.aF,beforeBody:_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.aF,beforeLabel:_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.aF,label(tooltipItem){if(this&&this.options&&"dataset"===this.options.mode)return tooltipItem.label+": "+tooltipItem.formattedValue||tooltipItem.formattedValue;let label=tooltipItem.dataset.label||"";label&&(label+=": ");let value=tooltipItem.formattedValue;return(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.k)(value)||(label+=value),label},labelColor(tooltipItem){let meta=tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex),options=meta.controller.getStyle(tooltipItem.dataIndex);return{borderColor:options.borderColor,backgroundColor:options.backgroundColor,borderWidth:options.borderWidth,borderDash:options.borderDash,borderDashOffset:options.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(tooltipItem){let meta=tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex),options=meta.controller.getStyle(tooltipItem.dataIndex);return{pointStyle:options.pointStyle,rotation:options.rotation}},afterLabel:_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.aF,afterBody:_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.aF,beforeFooter:_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.aF,footer:_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.aF,afterFooter:_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.aF};function invokeCallbackWithFallback(callbacks,name,ctx,arg){let result=callbacks[name].call(ctx,arg);return void 0===result?defaultCallbacks[name].call(ctx,arg):result}class Tooltip extends Element{static positioners=positioners;constructor(config){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=config.chart,this.options=config.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(options){this.options=options,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){let cached=this._cachedAnimations;if(cached)return cached;let chart=this.chart,options=this.options.setContext(this.getContext()),opts=options.enabled&&chart.options.animation&&options.animations,animations=new Animations(this.chart,opts);return opts._cacheable&&(this._cachedAnimations=Object.freeze(animations)),animations}getContext(){var parent,tooltipItems;return this.$context||(this.$context=(parent=this.chart.getContext(),tooltipItems=this._tooltipItems,(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.j)(parent,{tooltip:this,tooltipItems,type:"tooltip"})))}getTitle(context,options){let{callbacks}=options,beforeTitle=invokeCallbackWithFallback(callbacks,"beforeTitle",this,context),title=invokeCallbackWithFallback(callbacks,"title",this,context),afterTitle=invokeCallbackWithFallback(callbacks,"afterTitle",this,context),lines=[];return lines=pushOrConcat(lines,splitNewlines(beforeTitle)),lines=pushOrConcat(lines,splitNewlines(title)),lines=pushOrConcat(lines,splitNewlines(afterTitle))}getBeforeBody(tooltipItems,options){return pushOrConcat([],splitNewlines(invokeCallbackWithFallback(options.callbacks,"beforeBody",this,tooltipItems)))}getBody(tooltipItems,options){let{callbacks}=options,bodyItems=[];return(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.F)(tooltipItems,context=>{let bodyItem={before:[],lines:[],after:[]},scoped=overrideCallbacks(callbacks,context);pushOrConcat(bodyItem.before,splitNewlines(invokeCallbackWithFallback(scoped,"beforeLabel",this,context))),pushOrConcat(bodyItem.lines,invokeCallbackWithFallback(scoped,"label",this,context)),pushOrConcat(bodyItem.after,splitNewlines(invokeCallbackWithFallback(scoped,"afterLabel",this,context))),bodyItems.push(bodyItem)}),bodyItems}getAfterBody(tooltipItems,options){return pushOrConcat([],splitNewlines(invokeCallbackWithFallback(options.callbacks,"afterBody",this,tooltipItems)))}getFooter(tooltipItems,options){let{callbacks}=options,beforeFooter=invokeCallbackWithFallback(callbacks,"beforeFooter",this,tooltipItems),footer=invokeCallbackWithFallback(callbacks,"footer",this,tooltipItems),afterFooter=invokeCallbackWithFallback(callbacks,"afterFooter",this,tooltipItems),lines=[];return lines=pushOrConcat(lines,splitNewlines(beforeFooter)),lines=pushOrConcat(lines,splitNewlines(footer)),lines=pushOrConcat(lines,splitNewlines(afterFooter))}_createItems(options){let i,len;let active=this._active,data=this.chart.data,labelColors=[],labelPointStyles=[],labelTextColors=[],tooltipItems=[];for(i=0,len=active.length;i<len;
6++i)tooltipItems.push(function(chart,item){let{element,datasetIndex,index}=item,controller=chart.getDatasetMeta(datasetIndex).controller,{label,value}=controller.getLabelAndValue(index);return{chart,label,parsed:controller.getParsed(index),raw:chart.data.datasets[datasetIndex].data[index],formattedValue:value,dataset:controller.getDataset(),dataIndex:index,datasetIndex,element}}(this.chart,active[i]));return options.filter&&(tooltipItems=tooltipItems.filter((element,index,array)=>options.filter(element,index,array,data))),options.itemSort&&(tooltipItems=tooltipItems.sort((a,b)=>options.itemSort(a,b,data))),(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.F)(tooltipItems,context=>{let scoped=overrideCallbacks(options.callbacks,context);labelColors.push(invokeCallbackWithFallback(scoped,"labelColor",this,context)),labelPointStyles.push(invokeCallbackWithFallback(scoped,"labelPointStyle",this,context)),labelTextColors.push(invokeCallbackWithFallback(scoped,"labelTextColor",this,context))}),this.labelColors=labelColors,this.labelPointStyles=labelPointStyles,this.labelTextColors=labelTextColors,this.dataPoints=tooltipItems,tooltipItems}update(changed,replay){let properties;let options=this.options.setContext(this.getContext()),active=this._active,tooltipItems=[];if(active.length){let position=positioners[options.position].call(this,active,this._eventPosition);tooltipItems=this._createItems(options),this.title=this.getTitle(tooltipItems,options),this.beforeBody=this.getBeforeBody(tooltipItems,options),this.body=this.getBody(tooltipItems,options),this.afterBody=this.getAfterBody(tooltipItems,options),this.footer=this.getFooter(tooltipItems,options);let size=this._size=getTooltipSize(this,options),positionAndSize=Object.assign({},position,size),alignment=determineAlignment(this.chart,options,positionAndSize),backgroundPoint=getBackgroundPoint(options,positionAndSize,alignment,this.chart);this.xAlign=alignment.xAlign,this.yAlign=alignment.yAlign,properties={opacity:1,x:backgroundPoint.x,y:backgroundPoint.y,width:size.width,height:size.height,caretX:position.x,caretY:position.y}}else 0!==this.opacity&&(properties={opacity:0});this._tooltipItems=tooltipItems,this.$context=void 0,properties&&this._resolveAnimations().update(this,properties),changed&&options.external&&options.external.call(this,{chart:this.chart,tooltip:this,replay})}drawCaret(tooltipPoint,ctx,size,options){let caretPosition=this.getCaretPosition(tooltipPoint,size,options);ctx.lineTo(caretPosition.x1,caretPosition.y1),ctx.lineTo(caretPosition.x2,caretPosition.y2),ctx.lineTo(caretPosition.x3,caretPosition.y3)}getCaretPosition(tooltipPoint,size,options){let x1,x2,x3,y1,y2,y3;let{xAlign,yAlign}=this,{caretSize,cornerRadius}=options,{topLeft,topRight,bottomLeft,bottomRight}=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.aw)(cornerRadius),{x:ptX,y:ptY}=tooltipPoint,{width,height}=size;return"center"===yAlign?(y2=ptY+height/2,"left"===xAlign?(x2=(x1=ptX)-caretSize,y1=y2+caretSize,y3=y2-caretSize):(x2=(x1=ptX+width)+caretSize,y1=y2-caretSize,y3=y2+caretSize),x3=x1):(x2="left"===xAlign?ptX+Math.max(topLeft,bottomLeft)+caretSize:"right"===xAlign?ptX+width-Math.max(topRight,bottomRight)-caretSize:this.caretX,"top"===yAlign?(y2=(y1=ptY)-caretSize,x1=x2-caretSize,x3=x2+caretSize):(y2=(y1=ptY+height)+caretSize,x1=x2+caretSize,x3=x2-caretSize),y3=y1),{x1,x2,x3,y1,y2,y3}}drawTitle(pt,ctx,options){let titleFont,titleSpacing,i;let title=this.title,length=title.length;if(length){let rtlHelper=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.az)(options.rtl,this.x,this.width);for(i=0,pt.x=getAlignedX(this,options.titleAlign,options),ctx.textAlign=rtlHelper.textAlign(options.titleAlign),ctx.textBaseline="middle",titleFont=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.a0)(options.titleFont),titleSpacing=options.titleSpacing,ctx.fillStyle=options.titleColor,ctx.font=titleFont.string;i<length;++i)ctx.fillText(title[i],rtlHelper.x(pt.x),pt.y+titleFont.lineHeight/2),pt.y+=titleFont.lineHeight+titleSpacing,i+1===length&&(pt.y+=options.titleMarginBottom-titleSpacing)}}_drawColorBox(ctx,pt,i,rtlHelper,options){let labelColor=this.labelColors[i],labelPointStyle=this.labelPointStyles[i],{boxHeight,boxWidth}
6=options,bodyFont=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.a0)(options.bodyFont),colorX=getAlignedX(this,"left",options),rtlColorX=rtlHelper.x(colorX),yOffSet=boxHeight<bodyFont.lineHeight?(bodyFont.lineHeight-boxHeight)/2:0,colorY=pt.y+yOffSet;if(options.usePointStyle){let drawOptions={radius:Math.min(boxWidth,boxHeight)/2,pointStyle:labelPointStyle.pointStyle,rotation:labelPointStyle.rotation,borderWidth:1},centerX=rtlHelper.leftForLtr(rtlColorX,boxWidth)+boxWidth/2,centerY=colorY+boxHeight/2;ctx.strokeStyle=options.multiKeyBackground,ctx.fillStyle=options.multiKeyBackground,(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.at)(ctx,drawOptions,centerX,centerY),ctx.strokeStyle=labelColor.borderColor,ctx.fillStyle=labelColor.backgroundColor,(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.at)(ctx,drawOptions,centerX,centerY)}else{ctx.lineWidth=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.i)(labelColor.borderWidth)?Math.max(...Object.values(labelColor.borderWidth)):labelColor.borderWidth||1,ctx.strokeStyle=labelColor.borderColor,ctx.setLineDash(labelColor.borderDash||[]),ctx.lineDashOffset=labelColor.borderDashOffset||0;let outerX=rtlHelper.leftForLtr(rtlColorX,boxWidth),innerX=rtlHelper.leftForLtr(rtlHelper.xPlus(rtlColorX,1),boxWidth-2),borderRadius=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.aw)(labelColor.borderRadius);Object.values(borderRadius).some(v=>0!==v)?(ctx.beginPath(),ctx.fillStyle=options.multiKeyBackground,(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.au)(ctx,{x:outerX,y:colorY,w:boxWidth,h:boxHeight,radius:borderRadius}),ctx.fill(),ctx.stroke(),ctx.fillStyle=labelColor.backgroundColor,ctx.beginPath(),(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.au)(ctx,{x:innerX,y:colorY+1,w:boxWidth-2,h:boxHeight-2,radius:borderRadius}),ctx.fill()):(ctx.fillStyle=options.multiKeyBackground,ctx.fillRect(outerX,colorY,boxWidth,boxHeight),ctx.strokeRect(outerX,colorY,boxWidth,boxHeight),ctx.fillStyle=labelColor.backgroundColor,ctx.fillRect(innerX,colorY+1,boxWidth-2,boxHeight-2))}ctx.fillStyle=this.labelTextColors[i]}drawBody(pt,ctx,options){let bodyItem,textColor,lines,i,j,ilen,jlen;let{body}=this,{bodySpacing,bodyAlign,displayColors,boxHeight,boxWidth,boxPadding}
6=options,bodyFont=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.a0)(options.bodyFont),bodyLineHeight=bodyFont.lineHeight,xLinePadding=0,rtlHelper=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.az)(options.rtl,this.x,this.width),fillLineOfText=function(line){ctx.fillText(line,rtlHelper.x(pt.x+xLinePadding),pt.y+bodyLineHeight/2),pt.y+=bodyLineHeight+bodySpacing},bodyAlignForCalculation=rtlHelper.textAlign(bodyAlign);for(ctx.textAlign=bodyAlign,ctx.textBaseline="middle",ctx.font=bodyFont.string,pt.x=getAlignedX(this,bodyAlignForCalculation,options),ctx.fillStyle=options.bodyColor,(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.F)(this.beforeBody,fillLineOfText),xLinePadding=displayColors&&"right"!==bodyAlignForCalculation?"center"===bodyAlign?boxWidth/2+boxPadding:boxWidth+2+boxPadding:0,i=0,ilen=body.length;i<ilen;++i){for(bodyItem=body[i],textColor=this.labelTextColors[i],ctx.fillStyle=textColor,(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.F)(bodyItem.before,fillLineOfText),lines=bodyItem.lines,displayColors&&lines.length&&(this._drawColorBox(ctx,pt,i,rtlHelper,options),bodyLineHeight=Math.max(bodyFont.lineHeight,boxHeight)),j=0,jlen=lines.length;j<jlen;++j)fillLineOfText(lines[j]),bodyLineHeight=bodyFont.lineHeight;(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.F)(bodyItem.after,fillLineOfText)}xLinePadding=0,bodyLineHeight=bodyFont.lineHeight,(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.F)(this.afterBody,fillLineOfText),pt.y-=bodySpacing}drawFooter(pt,ctx,options){let footerFont,i;let footer=this.footer,length=footer.length;if(length){let rtlHelper=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.az)(options.rtl,this.x,this.width);for(pt.x=getAlignedX(this,options.footerAlign,options),pt.y+=options.footerMarginTop,ctx.textAlign=rtlHelper.textAlign(options.footerAlign),ctx.textBaseline="middle",footerFont=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.a0)(options.footerFont),ctx.fillStyle=options.footerColor,ctx.font=footerFont.string,i=0;i<length;++i)ctx.fillText(footer[i],rtlHelper.x(pt.x),pt.y+footerFont.lineHeight/2),pt.y+=footerFont.lineHeight+options.footerSpacing}}drawBackground(pt,ctx,tooltipSize,options){let{xAlign,yAlign}=this,{x,y}=pt,{width,height}=tooltipSize,{topLeft,topRight,bottomLeft,bottomRight}=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.aw)(options.cornerRadius);ctx.fillStyle=options.backgroundColor,ctx.strokeStyle=options.borderColor,ctx.lineWidth=options.borderWidth,ctx.beginPath(),ctx.moveTo(x+topLeft,y),"top"===yAlign&&this.drawCaret(pt,ctx,tooltipSize,options),ctx.lineTo(x+width-topRight,y),ctx.quadraticCurveTo(x+width,y,x+width,y+topRight),"center"===yAlign&&"right"===xAlign&&this.drawCaret(pt,ctx,tooltipSize,options),ctx.lineTo(x+width,y+height-bottomRight),ctx.quadraticCurveTo(x+width,y+height,x+width-bottomRight,y+height),"bottom"===yAlign&&this.drawCaret(pt,ctx,tooltipSize,options),ctx.lineTo(x+bottomLeft,y+height),ctx.quadraticCurveTo(x,y+height,x,y+height-bottomLeft),"center"===yAlign&&"left"===xAlign&&this.drawCaret(pt,ctx,tooltipSize,options),ctx.lineTo(x,y+topLeft),ctx.quadraticCurveTo(x,y,x+topLeft,y),ctx.closePath(),ctx.fill(),options.borderWidth>0&&ctx.stroke()}_updateAnimationTarget(options){let chart=this.chart,anims=this.$animations,animX=anims&&anims.x,animY=anims&&anims.y;if(animX||animY){let position=positioners[options.position].call(this,this._active,this._eventPosition);if(!position)return;let size=this._size=getTooltipSize(this,options),positionAndSize=Object.assign({},position,this._size),alignment=determineAlignment(chart,options,positionAndSize),point=getBackgroundPoint(options,positionAndSize,alignment,chart);(animX._to!==point.x||animY._to!==point.y)&&(this.xAlign=alignment.xAlign,this.yAlign=alignment.yAlign,this.width=size.width,this.height=size.height,this.caretX=position.x,this.caretY=position.y,this._resolveAnimations().update(this,point))}}_willRender(){return!!this.opacity}draw(ctx){let options=this.options.setContext(this.getContext()),opacity=this.opacity;if(!opacity)return;this._updateAnimationTarget(options);let tooltipSize={width:this.width,height:this.height},pt={x:this.x,y:this.y};opacity=.001>Math.abs(opacity)?0:opacity;let padding=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.E)(options.padding),hasTooltipContent=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;
6options.enabled&&hasTooltipContent&&(ctx.save(),ctx.globalAlpha=opacity,this.drawBackground(pt,ctx,tooltipSize,options),(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.aA)(ctx,options.textDirection),pt.y+=padding.top,this.drawTitle(pt,ctx,options),this.drawBody(pt,ctx,options),this.drawFooter(pt,ctx,options),(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.aC)(ctx,options.textDirection),ctx.restore())}getActiveElements(){return this._active||[]}setActiveElements(activeElements,eventPosition){let lastActive=this._active,active=activeElements.map(({datasetIndex,index})=>{let meta=this.chart.getDatasetMeta(datasetIndex);if(!meta)throw Error("Cannot find a dataset at index "+datasetIndex);return{datasetIndex,element:meta.data[index],index}}),changed=!(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.ah)(lastActive,active),positionChanged=this._positionChanged(active,eventPosition);(changed||positionChanged)&&(this._active=active,this._eventPosition=eventPosition,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,replay,inChartArea=!0){if(replay&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let options=this.options,lastActive=this._active||[],active=this._getActiveElements(e,lastActive,replay,inChartArea),positionChanged=this._positionChanged(active,e),changed=replay||!(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.ah)(active,lastActive)||positionChanged;return changed&&(this._active=active,(options.enabled||options.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,replay))),changed}_getActiveElements(e,lastActive,replay,inChartArea){let options=this.options;if("mouseout"===e.type)return[];if(!inChartArea)return lastActive;let active=this.chart.getElementsAtEventForMode(e,options.mode,options,replay);return options.reverse&&active.reverse(),active}_positionChanged(active,e){let{caretX,caretY,options}=this,position=positioners[options.position].call(this,active,e);return!1!==position&&(caretX!==position.x||caretY!==position.y)}}var plugin_tooltip={id:"tooltip",_element:Tooltip,positioners,afterInit(chart,_args,options){options&&(chart.tooltip=new Tooltip({chart,options}))},beforeUpdate(chart,_args,options){chart.tooltip&&chart.tooltip.initialize(options)},reset(chart,_args,options){chart.tooltip&&chart.tooltip.initialize(options)},afterDraw(chart){let tooltip=chart.tooltip;if(tooltip&&tooltip._willRender()){let args={tooltip};if(!1===chart.notifyPlugins("beforeTooltipDraw",{...args,cancelable:!0}))return;tooltip.draw(chart.ctx),chart.notifyPlugins("afterTooltipDraw",args)}},afterEvent(chart,args){if(chart.tooltip){let useFinalPosition=args.replay;chart.tooltip.handleEvent(args.event,useFinalPosition,args.inChartArea)&&(args.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:(ctx,opts)=>opts.bodyFont.size,boxWidth:(ctx,opts)=>opts.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:defaultCallbacks},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:name=>"filter"!==name&&"itemSort"!==name&&"external"!==name,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};let addIfString=(labels,raw,index,addedLabels)=>("string"==typeof raw?(index=labels.push(raw)-1,addedLabels.unshift({index,label:raw})):isNaN(raw)&&(index=null),index),validIndex=(index,max)=>null===index?null:(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.S)(Math.round(index),0,max);function _getLabelForValue(value){let labels=this.getLabels();return value>=0&&value<labels.length?labels[value]:value}class CategoryScale extends Scale{static id="category";static defaults={ticks:{callback:_getLabelForValue}};constructor(cfg){super(cfg),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(scaleOptions){let added=this._addedLabels;if(added.length){let labels=this.getLabels();for(let{index,label}of added)labels[index]===label&&labels.splice(index,1);this._addedLabels=[]}super.init(scaleOptions)}parse(raw,index){if((0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.k)(raw))return null;let labels=this.getLabels();return validIndex(index=isFinite(index)&&labels[index]===raw?index:function(labels,raw,index,addedLabels){let first=labels.indexOf(raw);if(-1===first)return addIfString(labels,raw,index,addedLabels);let last=labels.lastIndexOf(raw);return first!==last?index:first}(labels,raw,(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.v)(index,raw),this._addedLabels),labels.length-1)}determineDataLimits(){let{minDefined,maxDefined}=this.getUserBounds(),{min,max}=this.getMinMax(!0);"ticks"!==this.options.bounds||(minDefined||(min=0),maxDefined||(max=this.getLabels().length-1)),this.min=min,this.max=max}buildTicks(){let min=this.min,max=this.max,offset=this.options.offset,ticks=[],labels=this.getLabels();labels=0===min&&max===labels.length-1?labels:labels.slice(min,max+1),this._valueRange=Math.max(labels.length-(offset?0:1),1),this._startValue=this.min-(offset?.5:0);for(let value=min;value<=max;value++)ticks.push({value});return ticks}getLabelForValue(value){return _getLabelForValue.call(this,value)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(value){return"number"!=typeof value&&(value=this.parse(value)),null===value?NaN:this.getPixelForDecimal((value-this._startValue)/this._valueRange)}getPixelForTick(index){let ticks=this.ticks;return index<0||index>ticks.length-1?null:this.getPixelForValue(ticks[index].value)}getValueForPixel(pixel){return Math.round(this._startValue+this.getDecimalForPixel(pixel)*this._valueRange)}getBasePixel(){return this.bottom}}function relativeLabelSize(value,minSpacing,{horizontal,minRotation}){let rad=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.t)(minRotation),length=.75*minSpacing*(""+value).length;return Math.min(minSpacing/((horizontal?Math.sin(rad):Math.cos(rad))||.001),length)}class LinearScaleBase extends Scale{constructor(cfg){super(cfg),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(raw,index){return(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.k)(raw)||("number"==typeof raw||raw instanceof Number)&&!isFinite(+raw)?null:+raw}handleTickRangeOptions(){let{beginAtZero}=this.options,{minDefined,maxDefined}=this.getUserBounds(),{min,max}=this,setMin=v=>min=minDefined?min:v,setMax=v=>max=maxDefined?max:v;if(beginAtZero){let minSign=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.s)(min),maxSign=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.s)(max);minSign<0&&maxSign<0?setMax(0):minSign>0&&maxSign>0&&setMin(0)}if(min===max){let offset=0===max?1:Math.abs(.05*max);setMax(max+offset),beginAtZero||setMin(min-offset)}this.min=min,this.max=max}getTickLimit(){let maxTicks;let tickOpts=this.options.ticks,{maxTicksLimit,stepSize}=tickOpts;return stepSize?(maxTicks=Math.ceil(this.max/stepSize)-Math.floor(this.min/stepSize)+1)>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${stepSize} would result generating up to ${maxTicks} ticks. Limiting to 1000.`),maxTicks=1e3):(maxTicks=this.computeTickLimit(),maxTicksLimit=maxTicksLimit||11),maxTicksLimit&&(maxTicks=Math.min(maxTicksLimit,maxTicks)),maxTicks}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){let opts=this.options,tickOpts=opts.ticks,maxTicks=this.getTickLimit();maxTicks=Math.max(2,maxTicks);let numericGeneratorOptions={maxTicks,bounds:opts.bounds,min:opts.min,max:opts.max,precision:tickOpts.precision,step:tickOpts.stepSize,count:tickOpts.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:tickOpts.minRotation||0,includeBounds:!1!==tickOpts.includeBounds},dataRange=this._range||this,ticks=function(generationOptions,dataRange){let factor,niceMin,niceMax,numSpaces;let ticks=[],{bounds,step,min,max,precision,count,maxTicks,maxDigits,includeBounds}=generationOptions,unit=step||1,maxSpaces=maxTicks-1,{min:rmin,max:rmax}=dataRange,minDefined=!(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.k)(min),maxDefined=!(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.k)(max),countDefined=!(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.k)(count),minSpacing=(rmax-rmin)/(maxDigits+1),spacing=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.aH)((rmax-rmin)/maxSpaces
6/unit)*unit;if(spacing<1e-14&&!minDefined&&!maxDefined)return[{value:rmin},{value:rmax}];(numSpaces=Math.ceil(rmax/spacing)-Math.floor(rmin/spacing))>maxSpaces&&(spacing=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.aH)(numSpaces*spacing/maxSpaces/unit)*unit),(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.k)(precision)||(spacing=Math.ceil(spacing*(factor=Math.pow(10,precision)))/factor),"ticks"===bounds?(niceMin=Math.floor(rmin/spacing)*spacing,niceMax=Math.ceil(rmax/spacing)*spacing):(niceMin=rmin,niceMax=rmax),minDefined&&maxDefined&&step&&(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.aI)((max-min)/step,spacing/1e3)?(numSpaces=Math.round(Math.min((max-min)/spacing,maxTicks)),spacing=(max-min)/numSpaces,niceMin=min,niceMax=max):countDefined?(niceMin=minDefined?min:niceMin,spacing=((niceMax=maxDefined?max:niceMax)-niceMin)/(numSpaces=count-1)):(numSpaces=(niceMax-niceMin)/spacing,numSpaces=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.aJ)(numSpaces,Math.round(numSpaces),spacing/1e3)?Math.round(numSpaces):Math.ceil(numSpaces));let decimalPlaces=Math.max((0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.aK)(spacing),(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.aK)(niceMin));factor=Math.pow(10,(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.k)(precision)?decimalPlaces:precision),niceMin=Math.round(niceMin*factor)/factor,niceMax=Math.round(niceMax*factor)/factor;let j=0;for(minDefined&&(includeBounds&&niceMin!==min?(ticks.push({value:min}),niceMin<min&&j++,(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.aJ)(Math.round((niceMin+j*spacing)*factor)/factor,min,relativeLabelSize(min,minSpacing,generationOptions))&&j++):niceMin<min&&j++);j<numSpaces;++j){let tickValue=Math.round((niceMin+j*spacing)*factor)/factor;if(maxDefined&&tickValue>max)break;ticks.push({value:tickValue})}return maxDefined&&includeBounds&&niceMax!==max?ticks.length&&(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.aJ)(ticks[ticks.length-1].value,max,relativeLabelSize(max,minSpacing,generationOptions))?ticks[ticks.length-1].value=max:ticks.push({value:max}):maxDefined&&niceMax!==max||ticks.push({value:niceMax}),ticks}(numericGeneratorOptions,dataRange);return"ticks"===opts.bounds&&(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.aG)(ticks,this,"value"),opts.reverse?(ticks.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),ticks}configure(){let ticks=this.ticks,start=this.min,end=this.max;if(super.configure(),this.options.offset&&ticks.length){let offset=(end-start)/Math.max(ticks.length-1,1)/2;start-=offset,end+=offset}this._startValue=start,this._endValue=end,this._valueRange=end-start}getLabelForValue(value){return(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.o)(value,this.chart.options.locale,this.options.ticks.format)}}class LinearScale extends LinearScaleBase{static id="linear";static defaults={ticks:{callback:_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.aL.formatters.numeric}};determineDataLimits(){let{min,max}=this.getMinMax(!0);this.min=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.g)(min)?min:0,this.max=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.g)(max)?max:1,this.handleTickRangeOptions()}computeTickLimit(){let horizontal=this.isHorizontal(),length=horizontal?this.width:this.height,minRotation=(0,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.t)(this.options.ticks.minRotation),tickFont=this._resolveTickFontOptions(0);return Math.ceil(length/Math.min(40,tickFont.lineHeight/((horizontal?Math.sin(minRotation):Math.cos(minRotation))||.001)))}getPixelForValue(value){return null===value?NaN:this.getPixelForDecimal((value-this._startValue)/this._valueRange)}getValueForPixel(pixel){return this._startValue+this.getDecimalForPixel(pixel)*this._valueRange}}_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.aL.formatters.logarithmic,_chunks_helpers_segment_js__WEBPACK_IMPORTED_MODULE_0__.aL.formatters.numeric;let INTERVALS={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}},UNITS=Object.keys(INTERVALS)}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.