22 lines
210 KiB
JavaScript
22 lines
210 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5cee169e"],{"368d":function(t,e,i){"use strict";i.d(e,"a",(function(){return m}));i("caad");var n=i("dd61"),s=i("2b0e");const o={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},r={ariaLabel:{type:String},ariaDescribedby:{type:String}},a={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...o,...r},h="2"===s["k"][0]?(t,e)=>Object.assign(t,{attrs:e}):(t,e)=>Object.assign(t,e);function l(t){return Object(s["d"])(t)?Object(s["j"])(t):t}function c(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return Object(s["d"])(e)?new Proxy(t,{}):t}function d(t,e){const i=t.options;i&&e&&Object.assign(i,e)}function u(t,e){t.labels=e}function f(t,e,i){const n=[];t.datasets=e.map(e=>{const s=t.datasets.find(t=>t[i]===e[i]);return s&&e.data&&!n.includes(s)?(n.push(s),Object.assign(s,e),s):{...e}})}function b(t,e){const i={labels:[],datasets:[]};return u(i,t.labels),f(i,t.datasets,e),i}const g=Object(s["b"])({props:a,setup(t,e){let{expose:i,slots:o}=e;const r=Object(s["h"])(null),a=Object(s["i"])(null);i({chart:a});const h=()=>{if(!r.value)return;const{type:e,data:i,options:s,plugins:o,datasetIdKey:h}=t,l=b(i,h),d=c(l,i);a.value=new n["f"](r.value,{type:e,data:d,options:{...s},plugins:o})},g=()=>{const e=Object(s["j"])(a.value);e&&(t.destroyDelay>0?setTimeout(()=>{e.destroy(),a.value=null},t.destroyDelay):(e.destroy(),a.value=null))},p=e=>{e.update(t.updateMode)};return Object(s["f"])(h),Object(s["g"])(g),Object(s["l"])([()=>t.options,()=>t.data],(e,i)=>{let[n,o]=e,[r,h]=i;const c=Object(s["j"])(a.value);if(!c)return;let b=!1;if(n){const t=l(n),e=l(r);t&&t!==e&&(d(c,t),b=!0)}if(o){const e=l(o.labels),i=l(h.labels),n=l(o.datasets),s=l(h.datasets);e!==i&&(u(c.config.data,e),b=!0),n&&n!==s&&(f(c.config.data,n,t.datasetIdKey),b=!0)}b&&Object(s["e"])(()=>{p(c)})},{deep:!0}),()=>Object(s["c"])("canvas",{role:"img",ariaLabel:t.ariaLabel,ariaDescribedby:t.ariaDescribedby,ref:r},[Object(s["c"])("p",{},[o.default?o.default():""])])}});function p(t,e){return n["f"].register(e),Object(s["b"])({props:o,setup(e,i){let{expose:n}=i;const o=Object(s["i"])(null),r=t=>{o.value=null===t||void 0===t?void 0:t.chart};return n({chart:o}),()=>Object(s["c"])(g,h({ref:r},{type:t,...e}))}})}const m=p("bar",n["b"]);n["g"],n["i"],n["k"],n["m"],n["n"],n["d"],n["o"]},d9fa:function(t,e,i){"use strict";i.d(e,"a",(function(){return X}));i("13d5"),i("ac1f");var n=i("e369"),s=i("dd61"),o=function(){if("undefined"!==typeof window){if(window.devicePixelRatio)return window.devicePixelRatio;var t=window.screen;if(t)return(t.deviceXDPI||1)/(t.logicalXDPI||1)}return 1}(),r={toTextLines:function(t){var e,i=[];t=[].concat(t);while(t.length)e=t.pop(),"string"===typeof e?i.unshift.apply(i,e.split("\n")):Array.isArray(e)?t.push.apply(t,e):Object(n["Lb"])(t)||i.unshift(""+e);return i},textSize:function(t,e,i){var n,s=[].concat(e),o=s.length,r=t.font,a=0;for(t.font=i.string,n=0;n<o;++n)a=Math.max(t.measureText(s[n]).width,a);return t.font=r,{height:o*i.lineHeight,width:a}},bound:function(t,e,i){return Math.max(t,Math.min(e,i))},arrayDiff:function(t,e){var i,n,s,o,r=t.slice(),a=[];for(i=0,s=e.length;i<s;++i)o=e[i],n=r.indexOf(o),-1===n?a.push([o,1]):r.splice(n,1);for(i=0,s=r.length;i<s;++i)a.push([r[i],-1]);return a},rasterize:function(t){return Math.round(t*o)/o}};function a(t,e){var i=e.x,n=e.y;if(null===i)return{x:0,y:-1};if(null===n)return{x:1,y:0};var s=t.x-i,o=t.y-n,r=Math.sqrt(s*s+o*o);return{x:r?s/r:0,y:r?o/r:-1}}function h(t,e,i,n,s){switch(s){case"center":i=n=0;break;case"bottom":i=0,n=1;break;case"right":i=1,n=0;break;case"left":i=-1,n=0;break;case"top":i=0,n=-1;break;case"start":i=-i,n=-n;break;case"end":break;default:s*=Math.PI/180,i=Math.cos(s),n=Math.sin(s);break}return{x:t,y:e,vx:i,vy:n}}var l=0,c=1,d=2,u=4,f=8;function b(t,e,i){var n=l;return t<i.left?n|=c:t>i.right&&(n|=d),e<i.top?n|=f:e>i.bottom&&(n|=u),n}function g(t,e){var i,n,s,o=t.x0,r=t.y0,a=t.x1,h=t.y1,l=b(o,r,e),g=b(a,h,e);while(1){if(!(l|g)||l&g)break;i=l||g,i&f?(n=o+(a-o)*(e.top-r)/(h-r),s=e.top):i&u?(n=o+(a-o)*(e.bottom-r)/(h-r),s=e.bottom):i&d?(s=r+(h-r)*(e.right-o)/(a-o),n=e.right):i&c&&(s=r+(h-r)*(e.left-o)/(a-o),n=e.left),i===l?(o=n,r=s,l=b(o,r,e)):(a=n,h=s,g=b(a,h,e))}return{x0:o,x1:a,y0:r,y1:h}}function p(t,e){var i,n,s=e.anchor,o=t;return e.clamp&&(o=g(o,e.area)),"start"===s?(i=o.x0,n=o.y0):"end"===s?(i=o.x1,n=o.y1):(i=(o.x0+o.x1)/2,n=(o.y0+o.y1)/2),h(i,n,t.vx,t.vy,e.align)}var m={arc:function(t,e){var i=(t.startAngle+t.endAngle)/2,n=Math.cos(i),s=Math.sin(i),o=t.innerRadius,r=t.outerRadius;return p({x0:t.x+n*o,y0:t.y+s*o,x1:t.x+n*r,y1:t.y+s*r,vx:n,vy:s},e)},point:function(t,e){var i=a(t,e.origin),n=i.x*t.options.radius,s=i.y*t.options.radius;return p({x0:t.x-n,y0:t.y-s,x1:t.x+n,y1:t.y+s,vx:i.x,vy:i.y},e)},bar:function(t,e){var i=a(t,e.origin),n=t.x,s=t.y,o=0,r=0;return t.horizontal?(n=Math.min(t.x,t.base),o=Math.abs(t.base-t.x)):(s=Math.min(t.y,t.base),r=Math.abs(t.base-t.y)),p({x0:n,y0:s+r,x1:n+o,y1:s,vx:i.x,vy:i.y},e)},fallback:function(t,e){var i=a(t,e.origin);return p({x0:t.x,y0:t.y,x1:t.x+(t.width||0),y1:t.y+(t.height||0),vx:i.x,vy:i.y},e)}},x=r.rasterize;function _(t){var e=t.borderWidth||0,i=t.padding,n=t.size.height,s=t.size.width,o=-s/2,r=-n/2;return{frame:{x:o-i.left-e,y:r-i.top-e,w:s+i.width+2*e,h:n+i.height+2*e},text:{x:o,y:r,w:s,h:n}}}function y(t,e){var i=e.chart.getDatasetMeta(e.datasetIndex).vScale;if(!i)return null;if(void 0!==i.xCenter&&void 0!==i.yCenter)return{x:i.xCenter,y:i.yCenter};var n=i.getBasePixel();return t.horizontal?{x:n,y:null}:{x:null,y:n}}function v(t){return t instanceof s["a"]?m.arc:t instanceof s["l"]?m.point:t instanceof s["c"]?m.bar:m.fallback}function O(t,e,i,n,s,o){var r=Math.PI/2;if(o){var a=Math.min(o,s/2,n/2),h=e+a,l=i+a,c=e+n-a,d=i+s-a;t.moveTo(e,l),h<c&&l<d?(t.arc(h,l,a,-Math.PI,-r),t.arc(c,l,a,-r,0),t.arc(c,d,a,0,r),t.arc(h,d,a,r,Math.PI)):h<c?(t.moveTo(h,i),t.arc(c,l,a,-r,r),t.arc(h,l,a,r,Math.PI+r)):l<d?(t.arc(h,l,a,-Math.PI,0),t.arc(h,d,a,0,Math.PI)):t.arc(h,l,a,-Math.PI,Math.PI),t.closePath(),t.moveTo(e,i)}else t.rect(e,i,n,s)}function w(t,e,i){var n=i.backgroundColor,s=i.borderColor,o=i.borderWidth;(n||s&&o)&&(t.beginPath(),O(t,x(e.x)+o/2,x(e.y)+o/2,x(e.w)-o,x(e.h)-o,i.borderRadius),t.closePath(),n&&(t.fillStyle=n,t.fill()),s&&o&&(t.strokeStyle=s,t.lineWidth=o,t.lineJoin="miter",t.stroke()))}function j(t,e,i){var n=i.lineHeight,s=t.w,o=t.x,r=t.y+n/2;return"center"===e?o+=s/2:"end"!==e&&"right"!==e||(o+=s),{h:n,w:s,x:o,y:r}}function M(t,e,i){var n=t.shadowBlur,s=i.stroked,o=x(i.x),r=x(i.y),a=x(i.w);s&&t.strokeText(e,o,r,a),i.filled&&(n&&s&&(t.shadowBlur=0),t.fillText(e,o,r,a),n&&s&&(t.shadowBlur=n))}function k(t,e,i,n){var s,o=n.textAlign,r=n.color,a=!!r,h=n.font,l=e.length,c=n.textStrokeColor,d=n.textStrokeWidth,u=c&&d;if(l&&(a||u))for(i=j(i,o,h),t.font=h.string,t.textAlign=o,t.textBaseline="middle",t.shadowBlur=n.textShadowBlur,t.shadowColor=n.textShadowColor,a&&(t.fillStyle=r),u&&(t.lineJoin="round",t.lineWidth=d,t.strokeStyle=c),s=0,l=e.length;s<l;++s)M(t,e[s],{stroked:u,filled:a,w:i.w,x:i.x,y:i.y+i.h*s})}var S=function(t,e,i,n){var s=this;s._config=t,s._index=n,s._model=null,s._rects=null,s._ctx=e,s._el=i};Object(n["w"])(S.prototype,{_modelize:function(t,e,i,o){var a=this,h=a._index,l=Object(n["p"])(Object(n["C"])([i.font,{}],o,h)),c=Object(n["C"])([i.color,s["t"].color],o,h);return{align:Object(n["C"])([i.align,"center"],o,h),anchor:Object(n["C"])([i.anchor,"center"],o,h),area:o.chart.chartArea,backgroundColor:Object(n["C"])([i.backgroundColor,null],o,h),borderColor:Object(n["C"])([i.borderColor,null],o,h),borderRadius:Object(n["C"])([i.borderRadius,0],o,h),borderWidth:Object(n["C"])([i.borderWidth,0],o,h),clamp:Object(n["C"])([i.clamp,!1],o,h),clip:Object(n["C"])([i.clip,!1],o,h),color:c,display:t,font:l,lines:e,offset:Object(n["C"])([i.offset,4],o,h),opacity:Object(n["C"])([i.opacity,1],o,h),origin:y(a._el,o),padding:Object(n["l"])(Object(n["C"])([i.padding,4],o,h)),positioner:v(a._el),rotation:Object(n["C"])([i.rotation,0],o,h)*(Math.PI/180),size:r.textSize(a._ctx,e,l),textAlign:Object(n["C"])([i.textAlign,"start"],o,h),textShadowBlur:Object(n["C"])([i.textShadowBlur,0],o,h),textShadowColor:Object(n["C"])([i.textShadowColor,c],o,h),textStrokeColor:Object(n["C"])([i.textStrokeColor,c],o,h),textStrokeWidth:Object(n["C"])([i.textStrokeWidth,0],o,h)}},update:function(t){var e,i,s,o=this,a=null,h=null,l=o._index,c=o._config,d=Object(n["C"])([c.display,!0],t,l);d&&(e=t.dataset.data[l],i=Object(n["Wb"])(Object(n["d"])(c.formatter,[e,t]),e),s=Object(n["Lb"])(i)?[]:r.toTextLines(i),s.length&&(a=o._modelize(d,s,c,t),h=_(a))),o._model=a,o._rects=h},geometry:function(){return this._rects?this._rects.frame:{}},rotation:function(){return this._model?this._model.rotation:0},visible:function(){return this._model&&this._model.opacity},model:function(){return this._model},draw:function(t,e){var i,n=this,s=t.ctx,o=n._model,a=n._rects;this.visible()&&(s.save(),o.clip&&(i=o.area,s.beginPath(),s.rect(i.left,i.top,i.right-i.left,i.bottom-i.top),s.clip()),s.globalAlpha=r.bound(0,o.opacity,1),s.translate(x(e.x),x(e.y)),s.rotate(o.rotation),w(s,a.frame,o),k(s,o.lines,a.text,o),s.restore())}});var P=Number.MIN_SAFE_INTEGER||-9007199254740991,C=Number.MAX_SAFE_INTEGER||9007199254740991;function D(t,e,i){var n=Math.cos(i),s=Math.sin(i),o=e.x,r=e.y;return{x:o+n*(t.x-o)-s*(t.y-r),y:r+s*(t.x-o)+n*(t.y-r)}}function A(t,e){var i,n,s,o,r,a=C,h=P,l=e.origin;for(i=0;i<t.length;++i)n=t[i],s=n.x-l.x,o=n.y-l.y,r=e.vx*s+e.vy*o,a=Math.min(a,r),h=Math.max(h,r);return{min:a,max:h}}function L(t,e){var i=e.x-t.x,n=e.y-t.y,s=Math.sqrt(i*i+n*n);return{vx:(e.x-t.x)/s,vy:(e.y-t.y)/s,origin:t,ln:s}}var E=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0}};function T(t,e,i){var n=e.positioner(t,e),s=n.vx,o=n.vy;if(!s&&!o)return{x:n.x,y:n.y};var r=i.w,a=i.h,h=e.rotation,l=Math.abs(r/2*Math.cos(h))+Math.abs(a/2*Math.sin(h)),c=Math.abs(r/2*Math.sin(h))+Math.abs(a/2*Math.cos(h)),d=1/Math.max(Math.abs(s),Math.abs(o));return l*=s*d,c*=o*d,l+=e.offset*s,c+=e.offset*o,{x:n.x+l,y:n.y+c}}function R(t,e){var i,n,s,o;for(i=t.length-1;i>=0;--i)for(s=t[i].$layout,n=i-1;n>=0&&s._visible;--n)o=t[n].$layout,o._visible&&s._box.intersects(o._box)&&e(s,o);return t}function I(t){var e,i,n,s,o,r,a;for(e=0,i=t.length;e<i;++e)n=t[e],s=n.$layout,s._visible&&(a=new Proxy(n._el,{get:(t,e)=>t.getProps([e],!0)[e]}),o=n.geometry(),r=T(a,n.model(),o),s._box.update(r,o,n.rotation()));return R(t,(function(t,e){var i=t._hidable,n=e._hidable;i&&n||n?e._visible=!1:i&&(t._visible=!1)}))}Object(n["w"])(E.prototype,{center:function(){var t=this._rect;return{x:t.x+t.w/2,y:t.y+t.h/2}},update:function(t,e,i){this._rotation=i,this._rect={x:e.x+t.x,y:e.y+t.y,w:e.w,h:e.h}},contains:function(t){var e=this,i=1,n=e._rect;return t=D(t,e.center(),-e._rotation),!(t.x<n.x-i||t.y<n.y-i||t.x>n.x+n.w+2*i||t.y>n.y+n.h+2*i)},intersects:function(t){var e,i,n,s=this._points(),o=t._points(),r=[L(s[0],s[1]),L(s[0],s[3])];for(this._rotation!==t._rotation&&r.push(L(o[0],o[1]),L(o[0],o[3])),e=0;e<r.length;++e)if(i=A(s,r[e]),n=A(o,r[e]),i.max<n.min||n.max<i.min)return!1;return!0},_points:function(){var t=this,e=t._rect,i=t._rotation,n=t.center();return[D({x:e.x,y:e.y},n,i),D({x:e.x+e.w,y:e.y},n,i),D({x:e.x+e.w,y:e.y+e.h},n,i),D({x:e.x,y:e.y+e.h},n,i)]}});var z={prepare:function(t){var e,i,n,s,o,r=[];for(e=0,n=t.length;e<n;++e)for(i=0,s=t[e].length;i<s;++i)o=t[e][i],r.push(o),o.$layout={_box:new E,_hidable:!1,_visible:!0,_set:e,_idx:o._index};return r.sort((function(t,e){var i=t.$layout,n=e.$layout;return i._idx===n._idx?n._set-i._set:n._idx-i._idx})),this.update(r),r},update:function(t){var e,i,n,s,o,r=!1;for(e=0,i=t.length;e<i;++e)n=t[e],s=n.model(),o=n.$layout,o._hidable=s&&"auto"===s.display,o._visible=n.visible(),r|=o._hidable;r&&I(t)},lookup:function(t,e){var i,n;for(i=t.length-1;i>=0;--i)if(n=t[i].$layout,n&&n._visible&&n._box.contains(e))return t[i];return null},draw:function(t,e){var i,n,s,o,r,a;for(i=0,n=e.length;i<n;++i)s=e[i],o=s.$layout,o._visible&&(r=s.geometry(),a=T(s._el,s.model(),r),o._box.update(a,r,s.rotation()),s.draw(t,a))}},F=function(t){if(Object(n["Lb"])(t))return null;var e,i,s,o=t;if(Object(n["Jb"])(t))if(Object(n["Lb"])(t.label))if(Object(n["Lb"])(t.r))for(o="",e=Object.keys(t),s=0,i=e.length;s<i;++s)o+=(0!==s?", ":"")+e[s]+": "+t[e[s]];else o=t.r;else o=t.label;return""+o},W={align:"center",anchor:"center",backgroundColor:null,borderColor:null,borderRadius:0,borderWidth:0,clamp:!1,clip:!1,color:void 0,display:!0,font:{family:void 0,lineHeight:1.2,size:void 0,style:void 0,weight:null},formatter:F,labels:void 0,listeners:{},offset:4,opacity:1,padding:{top:4,right:4,bottom:4,left:4},rotation:0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,textShadowBlur:0,textShadowColor:void 0},B="$datalabels",V="$default";function N(t,e){var i,s,o=t.datalabels,r={},a=[];return!1===o?null:(!0===o&&(o={}),e=Object(n["w"])({},[e,o]),i=e.labels||{},s=Object.keys(i),delete e.labels,s.length?s.forEach((function(t){i[t]&&a.push(Object(n["w"])({},[e,i[t],{_key:t}]))})):a.push(e),r=a.reduce((function(t,e){return Object(n["r"])(e.listeners||{},(function(i,n){t[n]=t[n]||{},t[n][e._key||V]=i})),delete e.listeners,t}),{}),{labels:a,listeners:r})}function H(t,e,i,s){if(e){var o,r=i.$context,a=i.$groups;e[a._set]&&(o=e[a._set][a._key],o&&!0===Object(n["d"])(o,[r,s])&&(t[B]._dirty=!0,i.update(r)))}}function $(t,e,i,n,s){var o,r;(i||n)&&(i?n?i!==n&&(r=o=!0):r=!0:o=!0,r&&H(t,e.leave,i,s),o&&H(t,e.enter,n,s))}function Y(t,e){var i,n,s=t[B],o=s._listeners;if(o.enter||o.leave){if("mousemove"===e.type)n=z.lookup(s._labels,e);else if("mouseout"!==e.type)return;i=s._hovered,s._hovered=n,$(t,o,i,n,e)}}function U(t,e){var i=t[B],n=i._listeners.click,s=n&&z.lookup(i._labels,e);s&&H(t,n,s,e)}var X={id:"datalabels",defaults:W,beforeInit:function(t){t[B]={_actives:[]}},beforeUpdate:function(t){var e=t[B];e._listened=!1,e._listeners={},e._datasets=[],e._labels=[]},afterDatasetUpdate:function(t,e,i){var s,o,r,a,h,l,c,d,u=e.index,f=t[B],b=f._datasets[u]=[],g=t.isDatasetVisible(u),p=t.data.datasets[u],m=N(p,i),x=e.meta.data||[],_=t.ctx;for(_.save(),s=0,r=x.length;s<r;++s)if(c=x[s],c[B]=[],g&&c&&t.getDataVisibility(s)&&!c.skip)for(o=0,a=m.labels.length;o<a;++o)h=m.labels[o],l=h._key,d=new S(h,_,c,s),d.$groups={_set:u,_key:l||V},d.$context={active:!1,chart:t,dataIndex:s,dataset:p,datasetIndex:u},d.update(d.$context),c[B].push(d),b.push(d);_.restore(),Object(n["w"])(f._listeners,m.listeners,{merger:function(t,i,n){i[t]=i[t]||{},i[t][e.index]=n[t],f._listened=!0}})},afterUpdate:function(t){t[B]._labels=z.prepare(t[B]._datasets)},afterDatasetsDraw:function(t){z.draw(t,t[B]._labels)},beforeEvent:function(t,e){if(t[B]._listened){var i=e.event;switch(i.type){case"mousemove":case"mouseout":Y(t,i);break;case"click":U(t,i);break}}},afterEvent:function(t){var e,i,n,s,o,a,h,l=t[B],c=l._actives,d=l._actives=t.getActiveElements(),u=r.arrayDiff(c,d);for(e=0,i=u.length;e<i;++e)if(o=u[e],o[1])for(h=o[0].element[B]||[],n=0,s=h.length;n<s;++n)a=h[n],a.$context.active=1===o[1],a.update(a.$context);(l._dirty||u.length)&&(z.update(l._labels),t.render()),delete l._dirty}}},dd61:function(t,e,i){"use strict";i.d(e,"a",(function(){return Oi})),i.d(e,"b",(function(){return K})),i.d(e,"c",(function(){return Xi})),i.d(e,"d",(function(){return G})),i.d(e,"e",(function(){return jn})),i.d(e,"f",(function(){return di})),i.d(e,"g",(function(){return Q})),i.d(e,"h",(function(){return Zi})),i.d(e,"i",(function(){return tt})),i.d(e,"j",(function(){return Pn})),i.d(e,"k",(function(){return it})),i.d(e,"l",(function(){return zi})),i.d(e,"m",(function(){return et})),i.d(e,"n",(function(){return nt})),i.d(e,"o",(function(){return Et})),i.d(e,"p",(function(){return is})),i.d(e,"q",(function(){return en})),i.d(e,"r",(function(){return yn})),i.d(e,"s",(function(){return It}));i("caad"),i("13d5"),i("ac1f");var n=i("e369");i.d(e,"t",(function(){return n["Eb"]}));
|
|
/*!
|
|
* Chart.js v3.9.1
|
|
* https://www.chartjs.org
|
|
* (c) 2022 Chart.js Contributors
|
|
* Released under the MIT License
|
|
*/
|
|
class s{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,n){const s=e.listeners[n],o=e.duration;s.forEach(n=>n({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(i-e.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=n["Sb"].call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,n)=>{if(!i.running||!i.items.length)return;const s=i.items;let o,r=s.length-1,a=!1;for(;r>=0;--r)o=s[r],o._active?(o._total>i.duration&&(i.duration=o._total),o.tick(t),a=!0):(s[r]=s[s.length-1],s.pop());a&&(n.draw(),this._notify(n,i,t,"progress")),s.length||(i.running=!1,this._notify(n,i,t,"complete"),i.initial=!1),e+=s.length}),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((t,e)=>Math.max(t,e._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let n=i.length-1;for(;n>=0;--n)i[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var o=new s;const r="transparent",a={boolean(t,e,i){return i>.5?e:t},color(t,e,i){const s=Object(n["Db"])(t||r),o=s.valid&&Object(n["Db"])(e||r);return o&&o.valid?o.mix(s,i).hexString():e},number(t,e,i){return t+(e-t)*i}};class h{constructor(t,e,i,s){const o=e[i];s=Object(n["C"])([t.to,s,o,t.from]);const r=Object(n["C"])([t.from,o,s]);this._active=!0,this._fn=t.fn||a[t.type||typeof r],this._easing=n["Fb"][t.easing]||n["Fb"].linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=r,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const s=this._target[this._prop],o=i-this._start,r=this._duration-o;this._start=i,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Object(n["C"])([t.to,e,s,t.from]),this._from=Object(n["C"])([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,n=this._prop,s=this._from,o=this._loop,r=this._to;let a;if(this._active=s!==r&&(o||e<i),!this._active)return this._target[n]=r,void this._notify(!0);e<0?this._target[n]=s:(a=e/i%2,a=o&&a>1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[n]=this._fn(s,r,a))}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let n=0;n<i.length;n++)i[n][e]()}}const l=["x","y","borderWidth","radius","tension"],c=["color","borderColor","backgroundColor"];n["Eb"].set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});const d=Object.keys(n["Eb"].animation);n["Eb"].describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),n["Eb"].set("animations",{colors:{type:"color",properties:c},numbers:{type:"number",properties:l}}),n["Eb"].describe("animations",{_fallback:"animation"}),n["Eb"].set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}});class u{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!Object(n["Jb"])(t))return;const e=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const s=t[i];if(!Object(n["Jb"])(s))return;const o={};for(const t of d)o[t]=s[t];(Object(n["Cb"])(s.properties)&&s.properties||[i]).forEach(t=>{t!==i&&e.has(t)||e.set(t,o)})})}_animateOptions(t,e){const i=e.options,n=b(t,i);if(!n)return[];const s=this._createAnimations(n,i);return i.$shared&&f(t.options.$animations,i).then(()=>{t.options=i},()=>{}),s}_createAnimations(t,e){const i=this._properties,n=[],s=t.$animations||(t.$animations={}),o=Object.keys(e),r=Date.now();let a;for(a=o.length-1;a>=0;--a){const l=o[a];if("$"===l.charAt(0))continue;if("options"===l){n.push(...this._animateOptions(t,e));continue}const c=e[l];let d=s[l];const u=i.get(l);if(d){if(u&&d.active()){d.update(u,c,r);continue}d.cancel()}u&&u.duration?(s[l]=d=new h(u,t,l,c),n.push(d)):t[l]=c}return n}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?(o.add(this._chart,i),!0):void 0}}function f(t,e){const i=[],n=Object.keys(e);for(let s=0;s<n.length;s++){const e=t[n[s]];e&&e.active()&&i.push(e.wait())}return Promise.all(i)}function b(t,e){if(!e)return;let i=t.options;if(i)return i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}})),i;t.options=e}function g(t,e){const i=t&&t.options||{},n=i.reverse,s=void 0===i.min?e:0,o=void 0===i.max?e:0;return{start:n?o:s,end:n?s:o}}function p(t,e,i){if(!1===i)return!1;const n=g(t,i),s=g(e,i);return{top:s.end,right:n.end,bottom:s.start,left:n.start}}function m(t){let e,i,s,o;return Object(n["Jb"])(t)?(e=t.top,i=t.right,s=t.bottom,o=t.left):e=i=s=o=t,{top:e,right:i,bottom:s,left:o,disabled:!1===t}}function x(t,e){const i=[],n=t._getSortedDatasetMetas(e);let s,o;for(s=0,o=n.length;s<o;++s)i.push(n[s].index);return i}function _(t,e,i,s={}){const o=t.keys,r="single"===s.mode;let a,h,l,c;if(null!==e){for(a=0,h=o.length;a<h;++a){if(l=+o[a],l===i){if(s.all)continue;break}c=t.values[l],Object(n["Hb"])(c)&&(r||0===e||Object(n["Tb"])(e)===Object(n["Tb"])(c))&&(e+=c)}return e}}function y(t){const e=Object.keys(t),i=new Array(e.length);let n,s,o;for(n=0,s=e.length;n<s;++n)o=e[n],i[n]={x:o,y:t[o]};return i}function v(t,e){const i=t&&t.options.stacked;return i||void 0===i&&void 0!==e.stack}function O(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}function w(t){const{min:e,max:i,minDefined:n,maxDefined:s}=t.getUserBounds();return{min:n?e:Number.NEGATIVE_INFINITY,max:s?i:Number.POSITIVE_INFINITY}}function j(t,e,i){const n=t[e]||(t[e]={});return n[i]||(n[i]={})}function M(t,e,i,n){for(const s of e.getMatchingVisibleMetas(n).reverse()){const e=t[s.index];if(i&&e>0||!i&&e<0)return s.index}return null}function k(t,e){const{chart:i,_cachedMeta:n}=t,s=i._stacks||(i._stacks={}),{iScale:o,vScale:r,index:a}=n,h=o.axis,l=r.axis,c=O(o,r,n),d=e.length;let u;for(let f=0;f<d;++f){const t=e[f],{[h]:i,[l]:o}=t,d=t._stacks||(t._stacks={});u=d[l]=j(s,c,i),u[a]=o,u._top=M(u,r,!0,n.type),u._bottom=M(u,r,!1,n.type)}}function S(t,e){const i=t.scales;return Object.keys(i).filter(t=>i[t].axis===e).shift()}function P(t,e){return Object(n["Ib"])(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function C(t,e,i){return Object(n["Ib"])(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:i,index:e,mode:"default",type:"data"})}function D(t,e){const i=t.controller.index,n=t.vScale&&t.vScale.axis;if(n){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[n]||void 0===e[n][i])return;delete e[n][i]}}}const A=t=>"reset"===t||"none"===t,L=(t,e)=>e?t:Object.assign({},t),E=(t,e,i)=>t&&!e.hidden&&e._stacked&&{keys:x(i,!0),values:null};class T{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=v(t.vScale,t),this.addElements()}updateIndex(t){this.index!==t&&D(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(t,e,i,n)=>"x"===t?e:"r"===t?n:i,o=e.xAxisID=Object(n["Wb"])(i.xAxisID,S(t,"x")),r=e.yAxisID=Object(n["Wb"])(i.yAxisID,S(t,"y")),a=e.rAxisID=Object(n["Wb"])(i.rAxisID,S(t,"r")),h=e.indexAxis,l=e.iAxisID=s(h,o,r,a),c=e.vAxisID=s(h,r,o,a);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(r),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Object(n["Vb"])(this._data,this),t._stacked&&D(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(Object(n["Jb"])(e))this._data=y(e);else if(i!==e){if(i){Object(n["Vb"])(i,this);const t=this._cachedMeta;D(t),t._parsed=[]}e&&Object.isExtensible(e)&&Object(n["Mb"])(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let n=!1;this._dataCheck();const s=e._stacked;e._stacked=v(e.vScale,e),e.stack!==i.stack&&(n=!0,D(e),e.stack=i.stack),this._resyncElements(t),(n||s!==e._stacked)&&k(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:s}=this,{iScale:o,_stacked:r}=i,a=o.axis;let h,l,c,d=0===t&&e===s.length||i._sorted,u=t>0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=s,i._sorted=!0,c=s;else{c=Object(n["Cb"])(s[t])?this.parseArrayData(i,s,t,e):Object(n["Jb"])(s[t])?this.parseObjectData(i,s,t,e):this.parsePrimitiveData(i,s,t,e);const o=()=>null===l[a]||u&&l[a]<u[a];for(h=0;h<e;++h)i._parsed[h+t]=l=c[h],d&&(o()&&(d=!1),u=l);i._sorted=d}r&&k(this,c)}parsePrimitiveData(t,e,i,n){const{iScale:s,vScale:o}=t,r=s.axis,a=o.axis,h=s.getLabels(),l=s===o,c=new Array(n);let d,u,f;for(d=0,u=n;d<u;++d)f=d+i,c[d]={[r]:l||s.parse(h[f],f),[a]:o.parse(e[f],f)};return c}parseArrayData(t,e,i,n){const{xScale:s,yScale:o}=t,r=new Array(n);let a,h,l,c;for(a=0,h=n;a<h;++a)l=a+i,c=e[l],r[a]={x:s.parse(c[0],l),y:o.parse(c[1],l)};return r}parseObjectData(t,e,i,s){const{xScale:o,yScale:r}=t,{xAxisKey:a="x",yAxisKey:h="y"}=this._parsing,l=new Array(s);let c,d,u,f;for(c=0,d=s;c<d;++c)u=c+i,f=e[u],l[c]={x:o.parse(Object(n["Gb"])(f,a),u),y:r.parse(Object(n["Gb"])(f,h),u)};return l}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const n=this.chart,s=this._cachedMeta,o=e[t.axis],r={keys:x(n,!0),values:e._stacks[t.axis]};return _(r,o,s.index,{mode:i})}updateRangeFromParsed(t,e,i,n){const s=i[e.axis];let o=null===s?NaN:s;const r=n&&i._stacks[e.axis];n&&r&&(n.values=r,o=_(n,s,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,e){const i=this._cachedMeta,s=i._parsed,o=i._sorted&&t===i.iScale,r=s.length,a=this._getOtherScale(t),h=E(e,i,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:d}=w(a);let u,f;function b(){f=s[u];const e=f[a.axis];return!Object(n["Hb"])(f[t.axis])||c>e||d<e}for(u=0;u<r;++u)if(!b()&&(this.updateRangeFromParsed(l,t,f,h),o))break;if(o)for(u=r-1;u>=0;--u)if(!b()){this.updateRangeFromParsed(l,t,f,h);break}return l}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let s,o,r;for(s=0,o=e.length;s<o;++s)r=e[s][t.axis],Object(n["Hb"])(r)&&i.push(r);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,n=e.vScale,s=this.getParsed(t);return{label:i?""+i.getLabelForValue(s[i.axis]):"",value:n?""+n.getLabelForValue(s[n.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=m(Object(n["Wb"])(this.options.clip,p(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,n=i.data||[],s=e.chartArea,o=[],r=this._drawStart||0,a=this._drawCount||n.length-r,h=this.options.drawActiveElementsOnTop;let l;for(i.dataset&&i.dataset.draw(t,s,r,a),l=r;l<r+a;++l){const e=n[l];e.hidden||(e.active&&h?o.push(e):e.draw(t,s))}for(l=0;l<o.length;++l)o[l].draw(t,s)}getStyle(t,e){const i=e?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const n=this.getDataset();let s;if(t>=0&&t<this._cachedMeta.data.length){const e=this._cachedMeta.data[t];s=e.$context||(e.$context=C(this.getContext(),t,e)),s.parsed=this.getParsed(t),s.raw=n.data[t],s.index=s.dataIndex=t}else s=this.$context||(this.$context=P(this.chart.getContext(),this.index)),s.dataset=n,s.index=s.datasetIndex=this.index;return s.active=!!e,s.mode=i,s}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const s="active"===e,o=this._cachedDataOpts,r=t+"-"+e,a=o[r],h=this.enableOptionSharing&&Object(n["Kb"])(i);if(a)return L(a,h);const l=this.chart.config,c=l.datasetElementScopeKeys(this._type,t),d=s?[t+"Hover","hover",t,""]:[t,""],u=l.getOptionScopes(this.getDataset(),c),f=Object.keys(n["Eb"].elements[t]),b=()=>this.getContext(i,s),g=l.resolveNamedOptions(u,f,b,d);return g.$shared&&(g.$shared=h,o[r]=Object.freeze(L(g,h))),g}_resolveAnimations(t,e,i){const n=this.chart,s=this._cachedDataOpts,o="animation-"+e,r=s[o];if(r)return r;let a;if(!1!==n.options.animation){const n=this.chart.config,s=n.datasetAnimationScopeKeys(this._type,e),o=n.getOptionScopes(this.getDataset(),s);a=n.createResolver(o,this.getContext(t,i,e))}const h=new u(n,a&&a.animations);return a&&a._cacheable&&(s[o]=Object.freeze(h)),h}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||A(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),n=this._sharedOptions,s=this.getSharedOptions(i),o=this.includeOptions(e,s)||s!==n;return this.updateSharedOptions(s,e,i),{sharedOptions:s,includeOptions:o}}updateElement(t,e,i,n){A(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}updateSharedOptions(t,e,i){t&&!A(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,n){t.active=n;const s=this.getStyle(e,n);this._resolveAnimations(e,i,n).update(t,{options:!n&&this.getSharedOptions(s)||s})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[r,a,h]of this._syncList)this[r](a,h);this._syncList=[];const n=i.length,s=e.length,o=Math.min(s,n);o&&this.parse(0,o),s>n?this._insertElements(n,s-n,t):s<n&&this._removeElements(s,n-s)}_insertElements(t,e,i=!0){const n=this._cachedMeta,s=n.data,o=t+e;let r;const a=t=>{for(t.length+=e,r=t.length-1;r>=o;r--)t[r]=t[r-e]};for(a(s),r=t;r<o;++r)s[r]=new this.dataElementType;this._parsing&&a(n._parsed),this.parse(t,e),i&&this.updateElements(s,t,e,"reset")}updateElements(t,e,i,n){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const n=i._parsed.splice(t,e);i._stacked&&D(i,n)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,n]=t;this[e](i,n)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function R(t,e){if(!t._cache.$bar){const i=t.getMatchingVisibleMetas(e);let s=[];for(let e=0,n=i.length;e<n;e++)s=s.concat(i[e].controller.getAllParsedValues(t));t._cache.$bar=Object(n["B"])(s.sort((t,e)=>t-e))}return t._cache.$bar}function I(t){const e=t.iScale,i=R(e,t.type);let s,o,r,a,h=e._length;const l=()=>{32767!==r&&-32768!==r&&(Object(n["Kb"])(a)&&(h=Math.min(h,Math.abs(r-a)||h)),a=r)};for(s=0,o=i.length;s<o;++s)r=e.getPixelForValue(i[s]),l();for(a=void 0,s=0,o=e.ticks.length;s<o;++s)r=e.getPixelForTick(s),l();return h}function z(t,e,i,s){const o=i.barThickness;let r,a;return Object(n["Lb"])(o)?(r=e.min*i.categoryPercentage,a=i.barPercentage):(r=o*s,a=1),{chunk:r/s,ratio:a,start:e.pixels[t]-r/2}}function F(t,e,i,n){const s=e.pixels,o=s[t];let r=t>0?s[t-1]:null,a=t<s.length-1?s[t+1]:null;const h=i.categoryPercentage;null===r&&(r=o-(null===a?e.end-e.start:a-o)),null===a&&(a=o+o-r);const l=o-(o-Math.min(r,a))/2*h,c=Math.abs(a-r)/2*h;return{chunk:c/n,ratio:i.barPercentage,start:l}}function W(t,e,i,n){const s=i.parse(t[0],n),o=i.parse(t[1],n),r=Math.min(s,o),a=Math.max(s,o);let h=r,l=a;Math.abs(r)>Math.abs(a)&&(h=a,l=r),e[i.axis]=l,e._custom={barStart:h,barEnd:l,start:s,end:o,min:r,max:a}}function B(t,e,i,s){return Object(n["Cb"])(t)?W(t,e,i,s):e[i.axis]=i.parse(t,s),e}function V(t,e,i,n){const s=t.iScale,o=t.vScale,r=s.getLabels(),a=s===o,h=[];let l,c,d,u;for(l=i,c=i+n;l<c;++l)u=e[l],d={},d[s.axis]=a||s.parse(r[l],l),h.push(B(u,d,o,l));return h}function N(t){return t&&void 0!==t.barStart&&void 0!==t.barEnd}function H(t,e,i){return 0!==t?Object(n["Tb"])(t):(e.isHorizontal()?1:-1)*(e.min>=i?1:-1)}function $(t){let e,i,n,s,o;return t.horizontal?(e=t.base>t.x,i="left",n="right"):(e=t.base<t.y,i="bottom",n="top"),e?(s="end",o="start"):(s="start",o="end"),{start:i,end:n,reverse:e,top:s,bottom:o}}function Y(t,e,i,n){let s=e.borderSkipped;const o={};if(!s)return void(t.borderSkipped=o);if(!0===s)return void(t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0});const{start:r,end:a,reverse:h,top:l,bottom:c}=$(t);"middle"===s&&i&&(t.enableBorderRadius=!0,(i._top||0)===n?s=l:(i._bottom||0)===n?s=c:(o[U(c,r,a,h)]=!0,s=l)),o[U(s,r,a,h)]=!0,t.borderSkipped=o}function U(t,e,i,n){return n?(t=X(t,e,i),t=q(t,i,e)):t=q(t,e,i),t}function X(t,e,i){return t===e?i:t===i?e:t}function q(t,e,i){return"start"===t?e:"end"===t?i:t}function J(t,{inflateAmount:e},i){t.inflateAmount="auto"===e?1===i?.33:0:e}T.defaults={},T.prototype.datasetElementType=null,T.prototype.dataElementType=null;class K extends T{parsePrimitiveData(t,e,i,n){return V(t,e,i,n)}parseArrayData(t,e,i,n){return V(t,e,i,n)}parseObjectData(t,e,i,s){const{iScale:o,vScale:r}=t,{xAxisKey:a="x",yAxisKey:h="y"}=this._parsing,l="x"===o.axis?a:h,c="x"===r.axis?a:h,d=[];let u,f,b,g;for(u=i,f=i+s;u<f;++u)g=e[u],b={},b[o.axis]=o.parse(Object(n["Gb"])(g,l),u),d.push(B(Object(n["Gb"])(g,c),b,r,u));return d}updateRangeFromParsed(t,e,i,n){super.updateRangeFromParsed(t,e,i,n);const s=i._custom;s&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,s.min),t.max=Math.max(t.max,s.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:n}=e,s=this.getParsed(t),o=s._custom,r=N(o)?"["+o.start+", "+o.end+"]":""+n.getLabelForValue(s[n.axis]);return{label:""+i.getLabelForValue(s[i.axis]),value:r}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,s){const o="reset"===s,{index:r,_cachedMeta:{vScale:a}}=this,h=a.getBasePixel(),l=a.isHorizontal(),c=this._getRuler(),{sharedOptions:d,includeOptions:u}=this._getSharedOptions(e,s);for(let f=e;f<e+i;f++){const e=this.getParsed(f),i=o||Object(n["Lb"])(e[a.axis])?{base:h,head:h}:this._calculateBarValuePixels(f),b=this._calculateBarIndexPixels(f,c),g=(e._stacks||{})[a.axis],p={horizontal:l,base:i.base,enableBorderRadius:!g||N(e._custom)||r===g._top||r===g._bottom,x:l?i.head:b.center,y:l?b.center:i.head,height:l?b.size:Math.abs(i.size),width:l?Math.abs(i.size):b.size};u&&(p.options=d||this.resolveDataElementOptions(f,t[f].active?"active":s));const m=p.options||t[f].options;Y(p,m,g,r),J(p,m,c.ratio),this.updateElement(t[f],f,p,s)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,s=i.getMatchingVisibleMetas(this._type).filter(t=>t.controller.options.grouped),o=i.options.stacked,r=[],a=t=>{const i=t.controller.getParsed(e),s=i&&i[t.vScale.axis];if(Object(n["Lb"])(s)||isNaN(s))return!0};for(const n of s)if((void 0===e||!a(n))&&((!1===o||-1===r.indexOf(n.stack)||void 0===o&&void 0===n.stack)&&r.push(n.stack),n.index===t))break;return r.length||r.push(void 0),r}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const n=this._getStacks(t,i),s=void 0!==e?n.indexOf(e):-1;return-1===s?n.length-1:s}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,n=[];let s,o;for(s=0,o=e.data.length;s<o;++s)n.push(i.getPixelForValue(this.getParsed(s)[i.axis],s));const r=t.barThickness,a=r||I(e);return{min:a,pixels:n,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:r?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i},options:{base:s,minBarLength:o}}=this,r=s||0,a=this.getParsed(t),h=a._custom,l=N(h);let c,d,u=a[e.axis],f=0,b=i?this.applyStack(e,a,i):u;b!==u&&(f=b-u,b=u),l&&(u=h.barStart,b=h.barEnd-h.barStart,0!==u&&Object(n["Tb"])(u)!==Object(n["Tb"])(h.barEnd)&&(f=0),f+=u);const g=Object(n["Lb"])(s)||l?f:s;let p=e.getPixelForValue(g);if(c=this.chart.getDataVisibility(t)?e.getPixelForValue(f+b):p,d=c-p,Math.abs(d)<o){d=H(d,e,r)*o,u===r&&(p-=d/2);const t=e.getPixelForDecimal(0),i=e.getPixelForDecimal(1),n=Math.min(t,i),s=Math.max(t,i);p=Math.max(Math.min(p,s),n),c=p+d}if(p===e.getPixelForValue(r)){const t=Object(n["Tb"])(d)*e.getLineWidthForValue(r)/2;p+=t,d-=t}return{size:d,base:p,head:c,center:c+d/2}}_calculateBarIndexPixels(t,e){const i=e.scale,s=this.options,o=s.skipNull,r=Object(n["Wb"])(s.maxBarThickness,1/0);let a,h;if(e.grouped){const i=o?this._getStackCount(t):e.stackCount,n="flex"===s.barThickness?F(t,e,s,i):z(t,e,s,i),l=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0);a=n.start+n.chunk*l+n.chunk/2,h=Math.min(r,n.chunk*n.ratio)}else a=i.getPixelForValue(this.getParsed(t)[i.axis],t),h=Math.min(r,e.min*e.ratio);return{base:a-h/2,head:a+h/2,center:a,size:h}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,n=i.length;let s=0;for(;s<n;++s)null!==this.getParsed(s)[e.axis]&&i[s].draw(this._ctx)}}K.id="bar",K.defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}},K.overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};class G extends T{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,n){const s=super.parsePrimitiveData(t,e,i,n);for(let o=0;o<s.length;o++)s[o]._custom=this.resolveDataElementOptions(o+i).radius;return s}parseArrayData(t,e,i,s){const o=super.parseArrayData(t,e,i,s);for(let r=0;r<o.length;r++){const t=e[i+r];o[r]._custom=Object(n["Wb"])(t[2],this.resolveDataElementOptions(r+i).radius)}return o}parseObjectData(t,e,i,s){const o=super.parseObjectData(t,e,i,s);for(let r=0;r<o.length;r++){const t=e[i+r];o[r]._custom=Object(n["Wb"])(t&&t.r&&+t.r,this.resolveDataElementOptions(r+i).radius)}return o}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,{xScale:i,yScale:n}=e,s=this.getParsed(t),o=i.getLabelForValue(s.x),r=n.getLabelForValue(s.y),a=s._custom;return{label:e.label,value:"("+o+", "+r+(a?", "+a:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,n){const s="reset"===n,{iScale:o,vScale:r}=this._cachedMeta,{sharedOptions:a,includeOptions:h}=this._getSharedOptions(e,n),l=o.axis,c=r.axis;for(let d=e;d<e+i;d++){const e=t[d],i=!s&&this.getParsed(d),u={},f=u[l]=s?o.getPixelForDecimal(.5):o.getPixelForValue(i[l]),b=u[c]=s?r.getBasePixel():r.getPixelForValue(i[c]);u.skip=isNaN(f)||isNaN(b),h&&(u.options=a||this.resolveDataElementOptions(d,e.active?"active":n),s&&(u.options.radius=0)),this.updateElement(e,d,u,n)}}resolveDataElementOptions(t,e){const i=this.getParsed(t);let s=super.resolveDataElementOptions(t,e);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const o=s.radius;return"active"!==e&&(s.radius=0),s.radius+=Object(n["Wb"])(i&&i._custom,o),s}}function Z(t,e,i){let s=1,o=1,r=0,a=0;if(e<n["u"]){const h=t,l=h+e,c=Math.cos(h),d=Math.sin(h),u=Math.cos(l),f=Math.sin(l),b=(t,e,s)=>Object(n["Qb"])(t,h,l,!0)?1:Math.max(e,e*i,s,s*i),g=(t,e,s)=>Object(n["Qb"])(t,h,l,!0)?-1:Math.min(e,e*i,s,s*i),p=b(0,c,u),m=b(n["i"],d,f),x=g(n["q"],c,u),_=g(n["q"]+n["i"],d,f);s=(p-x)/2,o=(m-_)/2,r=-(p+x)/2,a=-(m+_)/2}return{ratioX:s,ratioY:o,offsetX:r,offsetY:a}}G.id="bubble",G.defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}},G.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title(){return""}}}}};class Q extends T{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,s=this._cachedMeta;if(!1===this._parsing)s._parsed=i;else{let o,r,a=t=>+i[t];if(Object(n["Jb"])(i[t])){const{key:t="value"}=this._parsing;a=e=>+Object(n["Gb"])(i[e],t)}for(o=t,r=t+e;o<r;++o)s._parsed[o]=a(o)}}_getRotation(){return Object(n["Ub"])(this.options.rotation-90)}_getCircumference(){return Object(n["Ub"])(this.options.circumference)}_getRotationExtents(){let t=n["u"],e=-n["u"];for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)){const n=this.chart.getDatasetMeta(i).controller,s=n._getRotation(),o=n._getCircumference();t=Math.min(t,s),e=Math.max(e,s+o)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,s=this._cachedMeta,o=s.data,r=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,a=Math.max((Math.min(i.width,i.height)-r)/2,0),h=Math.min(Object(n["Nb"])(this.options.cutout,a),1),l=this._getRingWeight(this.index),{circumference:c,rotation:d}=this._getRotationExtents(),{ratioX:u,ratioY:f,offsetX:b,offsetY:g}=Z(d,c,h),p=(i.width-r)/u,m=(i.height-r)/f,x=Math.max(Math.min(p,m)/2,0),_=Object(n["Ob"])(this.options.radius,x),y=Math.max(_*h,0),v=(_-y)/this._getVisibleDatasetWeightTotal();this.offsetX=b*_,this.offsetY=g*_,s.total=this.calculateTotal(),this.outerRadius=_-v*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-v*l,0),this.updateElements(o,0,o.length,t)}_circumference(t,e){const i=this.options,s=this._cachedMeta,o=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===s._parsed[t]||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*o/n["u"])}updateElements(t,e,i,n){const s="reset"===n,o=this.chart,r=o.chartArea,a=o.options,h=a.animation,l=(r.left+r.right)/2,c=(r.top+r.bottom)/2,d=s&&h.animateScale,u=d?0:this.innerRadius,f=d?0:this.outerRadius,{sharedOptions:b,includeOptions:g}=this._getSharedOptions(e,n);let p,m=this._getRotation();for(p=0;p<e;++p)m+=this._circumference(p,s);for(p=e;p<e+i;++p){const e=this._circumference(p,s),i=t[p],o={x:l+this.offsetX,y:c+this.offsetY,startAngle:m,endAngle:m+e,circumference:e,outerRadius:f,innerRadius:u};g&&(o.options=b||this.resolveDataElementOptions(p,i.active?"active":n)),m+=e,this.updateElement(i,p,o,n)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let i,n=0;for(i=0;i<e.length;i++){const s=t._parsed[i];null===s||isNaN(s)||!this.chart.getDataVisibility(i)||e[i].hidden||(n+=Math.abs(s))}return n}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?n["u"]*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=Object(n["Pb"])(e._parsed[t],i.options.locale);return{label:s[t]||"",value:o}}getMaxBorderWidth(t){let e=0;const i=this.chart;let n,s,o,r,a;if(!t)for(n=0,s=i.data.datasets.length;n<s;++n)if(i.isDatasetVisible(n)){o=i.getDatasetMeta(n),t=o.data,r=o.controller;break}if(!t)return 0;for(n=0,s=t.length;n<s;++n)a=r.resolveDataElementOptions(n),"inner"!==a.borderAlign&&(e=Math.max(e,a.borderWidth||0,a.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,n=t.length;i<n;++i){const t=this.resolveDataElementOptions(i);e=Math.max(e,t.offset||0,t.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(t){return Math.max(Object(n["Wb"])(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}Q.id="doughnut",Q.defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"},Q.descriptors={_scriptable:t=>"spacing"!==t,_indexable:t=>"spacing"!==t},Q.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i}}=t.legend.options;return e.labels.map((e,n)=>{const s=t.getDatasetMeta(0),o=s.controller.getStyle(n);return{text:e,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title(){return""},label(t){let e=t.label;const i=": "+t.formattedValue;return Object(n["Cb"])(e)?(e=e.slice(),e[0]+=i):e+=i,e}}}}};class tt extends T{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:s=[],_dataset:o}=e,r=this.chart._animationsDisabled;let{start:a,count:h}=Object(n["Rb"])(e,s,r);this._drawStart=a,this._drawCount=h,Object(n["Xb"])(e)&&(a=0,h=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!o._decimated,i.points=s;const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(i,void 0,{animated:!r,options:l},t),this.updateElements(s,a,h,t)}updateElements(t,e,i,s){const o="reset"===s,{iScale:r,vScale:a,_stacked:h,_dataset:l}=this._cachedMeta,{sharedOptions:c,includeOptions:d}=this._getSharedOptions(e,s),u=r.axis,f=a.axis,{spanGaps:b,segment:g}=this.options,p=Object(n["Yb"])(b)?b:Number.POSITIVE_INFINITY,m=this.chart._animationsDisabled||o||"none"===s;let x=e>0&&this.getParsed(e-1);for(let _=e;_<e+i;++_){const e=t[_],i=this.getParsed(_),b=m?e:{},y=Object(n["Lb"])(i[f]),v=b[u]=r.getPixelForValue(i[u],_),O=b[f]=o||y?a.getBasePixel():a.getPixelForValue(h?this.applyStack(a,i,h):i[f],_);b.skip=isNaN(v)||isNaN(O)||y,b.stop=_>0&&Math.abs(i[u]-x[u])>p,g&&(b.parsed=i,b.raw=l.data[_]),d&&(b.options=c||this.resolveDataElementOptions(_,e.active?"active":s)),m||this.updateElement(e,_,b,s),x=i}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return i;const s=n[0].size(this.resolveDataElementOptions(0)),o=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,s,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}tt.id="line",tt.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},tt.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class et extends T{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=Object(n["Pb"])(e._parsed[t].r,i.options.locale);return{label:s[t]||"",value:o}}parseObjectData(t,e,i,s){return n["Zb"].bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((t,i)=>{const n=this.getParsed(i).r;!isNaN(n)&&this.chart.getDataVisibility(i)&&(n<e.min&&(e.min=n),n>e.max&&(e.max=n))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,n=Math.min(e.right-e.left,e.bottom-e.top),s=Math.max(n/2,0),o=Math.max(i.cutoutPercentage?s/100*i.cutoutPercentage:1,0),r=(s-o)/t.getVisibleDatasetCount();this.outerRadius=s-r*this.index,this.innerRadius=this.outerRadius-r}updateElements(t,e,i,s){const o="reset"===s,r=this.chart,a=r.options,h=a.animation,l=this._cachedMeta.rScale,c=l.xCenter,d=l.yCenter,u=l.getIndexAngle(0)-.5*n["q"];let f,b=u;const g=360/this.countVisibleElements();for(f=0;f<e;++f)b+=this._computeAngle(f,s,g);for(f=e;f<e+i;f++){const e=t[f];let i=b,n=b+this._computeAngle(f,s,g),a=r.getDataVisibility(f)?l.getDistanceFromCenterForValue(this.getParsed(f).r):0;b=n,o&&(h.animateScale&&(a=0),h.animateRotate&&(i=n=u));const p={x:c,y:d,innerRadius:0,outerRadius:a,startAngle:i,endAngle:n,options:this.resolveDataElementOptions(f,e.active?"active":s)};this.updateElement(e,f,p,s)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((t,i)=>{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?Object(n["Ub"])(this.resolveDataElementOptions(t,e).angle||i):0}}et.id="polarArea",et.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},et.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i}}=t.legend.options;return e.labels.map((e,n)=>{const s=t.getDatasetMeta(0),o=s.controller.getStyle(n);return{text:e,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title(){return""},label(t){return t.chart.data.labels[t.dataIndex]+": "+t.formattedValue}}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class it extends Q{}it.id="pie",it.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class nt extends T{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,s){return n["Zb"].bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta,i=e.dataset,n=e.data||[],s=e.iScale.getLabels();if(i.points=n,"resize"!==t){const e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);const o={_loop:!0,_fullLoop:s.length===n.length,options:e};this.updateElement(i,void 0,o,t)}this.updateElements(n,0,n.length,t)}updateElements(t,e,i,n){const s=this._cachedMeta.rScale,o="reset"===n;for(let r=e;r<e+i;r++){const e=t[r],i=this.resolveDataElementOptions(r,e.active?"active":n),a=s.getPointPositionForValue(r,this.getParsed(r).r),h=o?s.xCenter:a.x,l=o?s.yCenter:a.y,c={x:h,y:l,angle:a.angle,skip:isNaN(h)||isNaN(l),options:i};this.updateElement(e,r,c,n)}}}nt.id="radar",nt.defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}},nt.overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};class st{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return Object(n["Yb"])(this.x)&&Object(n["Yb"])(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const n={};return t.forEach(t=>{n[t]=i[t]&&i[t].active()?i[t]._to:this[t]}),n}}st.defaults={},st.defaultRoutes=void 0;const ot={values(t){return Object(n["Cb"])(t)?t:""+t},numeric(t,e,i){if(0===t)return"0";const s=this.chart.options.locale;let o,r=t;if(i.length>1){const e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(o="scientific"),r=rt(t,i)}const a=Object(n["ac"])(Math.abs(r)),h=Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:o,minimumFractionDigits:h,maximumFractionDigits:h};return Object.assign(l,this.options.ticks.format),Object(n["Pb"])(t,s,l)},logarithmic(t,e,i){if(0===t)return"0";const s=t/Math.pow(10,Math.floor(Object(n["ac"])(t)));return 1===s||2===s||5===s?ot.numeric.call(this,t,e,i):""}};function rt(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t)),i}var at={formatters:ot};function ht(t,e){const i=t.options.ticks,s=i.maxTicksLimit||lt(t),o=i.major.enabled?dt(e):[],r=o.length,a=o[0],h=o[r-1],l=[];if(r>s)return ut(e,l,o,r/s),l;const c=ct(o,e,s);if(r>0){let t,i;const s=r>1?Math.round((h-a)/(r-1)):null;for(ft(e,l,c,Object(n["Lb"])(s)?0:a-s,a),t=0,i=r-1;t<i;t++)ft(e,l,c,o[t],o[t+1]);return ft(e,l,c,h,Object(n["Lb"])(s)?e.length:h+s),l}return ft(e,l,c),l}function lt(t){const e=t.options.offset,i=t._tickSize(),n=t._length/i+(e?0:1),s=t._maxLength/i;return Math.floor(Math.min(n,s))}function ct(t,e,i){const s=bt(t),o=e.length/i;if(!s)return Math.max(o,1);const r=Object(n["b"])(s);for(let n=0,a=r.length-1;n<a;n++){const t=r[n];if(t>o)return t}return Math.max(o,1)}function dt(t){const e=[];let i,n;for(i=0,n=t.length;i<n;i++)t[i].major&&e.push(i);return e}function ut(t,e,i,n){let s,o=0,r=i[0];for(n=Math.ceil(n),s=0;s<t.length;s++)s===r&&(e.push(t[s]),o++,r=i[o*n])}function ft(t,e,i,s,o){const r=Object(n["Wb"])(s,0),a=Math.min(Object(n["Wb"])(o,t.length),t.length);let h,l,c,d=0;i=Math.ceil(i),o&&(h=o-s,i=h/Math.floor(h/i)),c=r;while(c<0)d++,c=Math.round(r+d*i);for(l=Math.max(r,0);l<a;l++)l===c&&(e.push(t[l]),d++,c=Math.round(r+d*i))}function bt(t){const e=t.length;let i,n;if(e<2)return!1;for(n=t[0],i=1;i<e;++i)if(t[i]-t[i-1]!==n)return!1;return n}n["Eb"].set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:at.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n["Eb"].route("scale.ticks","color","","color"),n["Eb"].route("scale.grid","color","","borderColor"),n["Eb"].route("scale.grid","borderColor","","borderColor"),n["Eb"].route("scale.title","color","","color"),n["Eb"].describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t}),n["Eb"].describe("scales",{_fallback:"scale"}),n["Eb"].describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t});const gt=t=>"left"===t?"right":"right"===t?"left":t,pt=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i;function mt(t,e){const i=[],n=t.length/e,s=t.length;let o=0;for(;o<s;o+=n)i.push(t[Math.floor(o)]);return i}function xt(t,e,i){const n=t.ticks.length,s=Math.min(e,n-1),o=t._startPixel,r=t._endPixel,a=1e-6;let h,l=t.getPixelForTick(s);if(!(i&&(h=1===n?Math.max(l-o,r-l):0===e?(t.getPixelForTick(1)-l)/2:(l-t.getPixelForTick(s-1))/2,l+=s<e?h:-h,l<o-a||l>r+a)))return l}function _t(t,e){Object(n["r"])(t,t=>{const i=t.gc,n=i.length/2;let s;if(n>e){for(s=0;s<n;++s)delete t.data[i[s]];i.splice(0,n)}})}function yt(t){return t.drawTicks?t.tickLength:0}function vt(t,e){if(!t.display)return 0;const i=Object(n["p"])(t.font,e),s=Object(n["l"])(t.padding),o=Object(n["Cb"])(t.text)?t.text.length:1;return o*i.lineHeight+s.height}function Ot(t,e){return Object(n["Ib"])(t,{scale:e,type:"scale"})}function wt(t,e,i){return Object(n["Ib"])(t,{tick:i,index:e,type:"tick"})}function jt(t,e,i){let s=Object(n["s"])(t);return(i&&"right"!==e||!i&&"right"===e)&&(s=gt(s)),s}function Mt(t,e,i,s){const{top:o,left:r,bottom:a,right:h,chart:l}=t,{chartArea:c,scales:d}=l;let u,f,b,g=0;const p=a-o,m=h-r;if(t.isHorizontal()){if(f=Object(n["t"])(s,r,h),Object(n["Jb"])(i)){const t=Object.keys(i)[0],n=i[t];b=d[t].getPixelForValue(n)+p-e}else b="center"===i?(c.bottom+c.top)/2+p-e:pt(t,i,e);u=h-r}else{if(Object(n["Jb"])(i)){const t=Object.keys(i)[0],n=i[t];f=d[t].getPixelForValue(n)-m+e}else f="center"===i?(c.left+c.right)/2-m+e:pt(t,i,e);b=Object(n["t"])(s,a,o),g="left"===i?-n["i"]:n["i"]}return{titleX:f,titleY:b,maxWidth:u,rotation:g}}class kt extends st{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:s}=this;return t=Object(n["c"])(t,Number.POSITIVE_INFINITY),e=Object(n["c"])(e,Number.NEGATIVE_INFINITY),i=Object(n["c"])(i,Number.POSITIVE_INFINITY),s=Object(n["c"])(s,Number.NEGATIVE_INFINITY),{min:Object(n["c"])(t,i),max:Object(n["c"])(e,s),minDefined:Object(n["Hb"])(t),maxDefined:Object(n["Hb"])(e)}}getMinMax(t){let e,{min:i,max:s,minDefined:o,maxDefined:r}=this.getUserBounds();if(o&&r)return{min:i,max:s};const a=this.getMatchingVisibleMetas();for(let n=0,h=a.length;n<h;++n)e=a[n].controller.getMinMax(this,t),o||(i=Math.min(i,e.min)),r||(s=Math.max(s,e.max));return i=r&&i>s?s:i,s=o&&i>s?i:s,{min:Object(n["c"])(i,Object(n["c"])(s,i)),max:Object(n["c"])(s,Object(n["c"])(i,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Object(n["d"])(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:s,grace:o,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Object(n["e"])(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const h=a<this.ticks.length;this._convertTicksToLabels(h?mt(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||"auto"===r.source)&&(this.ticks=ht(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),h&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t,e,i=this.options.reverse;this.isHorizontal()?(t=this.left,e=this.right):(t=this.top,e=this.bottom,i=!i),this._startPixel=t,this._endPixel=e,this._reversePixels=i,this._length=e-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Object(n["d"])(this.options.afterUpdate,[this])}beforeSetDimensions(){Object(n["d"])(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(){Object(n["d"])(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Object(n["d"])(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Object(n["d"])(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,s,o;for(i=0,s=t.length;i<s;i++)o=t[i],o.label=Object(n["d"])(e.callback,[o.value,i,t],this)}afterTickToLabelConversion(){Object(n["d"])(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Object(n["d"])(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=this.ticks.length,s=e.minRotation||0,o=e.maxRotation;let r,a,h,l=s;if(!this._isVisible()||!e.display||s>=o||i<=1||!this.isHorizontal())return void(this.labelRotation=s);const c=this._getLabelSizes(),d=c.widest.width,u=c.highest.height,f=Object(n["f"])(this.chart.width-d,0,this.maxWidth);r=t.offset?this.maxWidth/i:f/(i-1),d+6>r&&(r=f/(i-(t.offset?.5:1)),a=this.maxHeight-yt(t.grid)-e.padding-vt(t.title,this.chart.options.font),h=Math.sqrt(d*d+u*u),l=Object(n["g"])(Math.min(Math.asin(Object(n["f"])((c.highest.height+6)/r,-1,1)),Math.asin(Object(n["f"])(a/h,-1,1))-Math.asin(Object(n["f"])(u/h,-1,1)))),l=Math.max(s,Math.min(o,l))),this.labelRotation=l}afterCalculateLabelRotation(){Object(n["d"])(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Object(n["d"])(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){const r=vt(s,e.options.font);if(a?(t.width=this.maxWidth,t.height=yt(o)+r):(t.height=this.maxHeight,t.width=yt(o)+r),i.display&&this.ticks.length){const{first:e,last:s,widest:o,highest:r}=this._getLabelSizes(),h=2*i.padding,l=Object(n["Ub"])(this.labelRotation),c=Math.cos(l),d=Math.sin(l);if(a){const e=i.mirror?0:d*o.width+c*r.height;t.height=Math.min(this.maxHeight,t.height+e+h)}else{const e=i.mirror?0:c*o.width+d*r.height;t.width=Math.min(this.maxWidth,t.width+e+h)}this._calculatePadding(e,s,d,c)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,n){const{ticks:{align:s,padding:o},position:r}=this.options,a=0!==this.labelRotation,h="top"!==r&&"x"===this.axis;if(this.isHorizontal()){const r=this.getPixelForTick(0)-this.left,l=this.right-this.getPixelForTick(this.ticks.length-1);let c=0,d=0;a?h?(c=n*t.width,d=i*e.height):(c=i*t.height,d=n*e.width):"start"===s?d=e.width:"end"===s?c=t.width:"inner"!==s&&(c=t.width/2,d=e.width/2),this.paddingLeft=Math.max((c-r+o)*this.width/(this.width-r),0),this.paddingRight=Math.max((d-l+o)*this.width/(this.width-l),0)}else{let i=e.height/2,n=t.height/2;"start"===s?(i=0,n=t.height):"end"===s&&(i=e.height,n=0),this.paddingTop=i+o,this.paddingBottom=n+o}}_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(){Object(n["d"])(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e<i;e++)Object(n["Lb"])(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=mt(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length)}return t}_computeLabelSizes(t,e){const{ctx:i,_longestTextCache:s}=this,o=[],r=[];let a,h,l,c,d,u,f,b,g,p,m,x=0,_=0;for(a=0;a<e;++a){if(c=t[a].label,d=this._resolveTickFontOptions(a),i.font=u=d.string,f=s[u]=s[u]||{data:{},gc:[]},b=d.lineHeight,g=p=0,Object(n["Lb"])(c)||Object(n["Cb"])(c)){if(Object(n["Cb"])(c))for(h=0,l=c.length;h<l;++h)m=c[h],Object(n["Lb"])(m)||Object(n["Cb"])(m)||(g=Object(n["h"])(i,f.data,f.gc,g,m),p+=b)}else g=Object(n["h"])(i,f.data,f.gc,g,c),p=b;o.push(g),r.push(p),x=Math.max(g,x),_=Math.max(p,_)}_t(s,e);const y=o.indexOf(x),v=r.indexOf(_),O=t=>({width:o[t]||0,height:r[t]||0});return{first:O(0),last:O(e-1),widest:O(y),highest:O(v),widths:o,heights:r}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return Object(n["j"])(this._alignToPixels?Object(n["k"])(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const i=e[t];return i.$context||(i.$context=wt(this.getContext(),t,i))}return this.$context||(this.$context=Ot(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=Object(n["Ub"])(this.labelRotation),i=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),o=this._getLabelSizes(),r=t.autoSkipPadding||0,a=o?o.widest.width+r:0,h=o?o.highest.height+r:0;return this.isHorizontal()?h*i>a*s?a/i:h/s:h*s<a*i?h/i:a/s}_isVisible(){const t=this.options.display;return"auto"!==t?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,s=this.options,{grid:o,position:r}=s,a=o.offset,h=this.isHorizontal(),l=this.ticks,c=l.length+(a?1:0),d=yt(o),u=[],f=o.setContext(this.getContext()),b=f.drawBorder?f.borderWidth:0,g=b/2,p=function(t){return Object(n["k"])(i,t,b)};let m,x,_,y,v,O,w,j,M,k,S,P;if("top"===r)m=p(this.bottom),O=this.bottom-d,j=m-g,k=p(t.top)+g,P=t.bottom;else if("bottom"===r)m=p(this.top),k=t.top,P=p(t.bottom)-g,O=m+g,j=this.top+d;else if("left"===r)m=p(this.right),v=this.right-d,w=m-g,M=p(t.left)+g,S=t.right;else if("right"===r)m=p(this.left),M=t.left,S=p(t.right)-g,v=m+g,w=this.left+d;else if("x"===e){if("center"===r)m=p((t.top+t.bottom)/2+.5);else if(Object(n["Jb"])(r)){const t=Object.keys(r)[0],e=r[t];m=p(this.chart.scales[t].getPixelForValue(e))}k=t.top,P=t.bottom,O=m+g,j=O+d}else if("y"===e){if("center"===r)m=p((t.left+t.right)/2);else if(Object(n["Jb"])(r)){const t=Object.keys(r)[0],e=r[t];m=p(this.chart.scales[t].getPixelForValue(e))}v=m-g,w=v-d,M=t.left,S=t.right}const C=Object(n["Wb"])(s.ticks.maxTicksLimit,c),D=Math.max(1,Math.ceil(c/C));for(x=0;x<c;x+=D){const t=o.setContext(this.getContext(x)),e=t.lineWidth,s=t.color,r=t.borderDash||[],l=t.borderDashOffset,c=t.tickWidth,d=t.tickColor,f=t.tickBorderDash||[],b=t.tickBorderDashOffset;_=xt(this,x,a),void 0!==_&&(y=Object(n["k"])(i,_,e),h?v=w=M=S=y:O=j=k=P=y,u.push({tx1:v,ty1:O,tx2:w,ty2:j,x1:M,y1:k,x2:S,y2:P,width:e,color:s,borderDash:r,borderDashOffset:l,tickWidth:c,tickColor:d,tickBorderDash:f,tickBorderDashOffset:b}))}return this._ticksLength=c,this._borderValue=m,u}_computeLabelItems(t){const e=this.axis,i=this.options,{position:s,ticks:o}=i,r=this.isHorizontal(),a=this.ticks,{align:h,crossAlign:l,padding:c,mirror:d}=o,u=yt(i.grid),f=u+c,b=d?-c:f,g=-Object(n["Ub"])(this.labelRotation),p=[];let m,x,_,y,v,O,w,j,M,k,S,P,C="middle";if("top"===s)O=this.bottom-b,w=this._getXAxisLabelAlignment();else if("bottom"===s)O=this.top+b,w=this._getXAxisLabelAlignment();else if("left"===s){const t=this._getYAxisLabelAlignment(u);w=t.textAlign,v=t.x}else if("right"===s){const t=this._getYAxisLabelAlignment(u);w=t.textAlign,v=t.x}else if("x"===e){if("center"===s)O=(t.top+t.bottom)/2+f;else if(Object(n["Jb"])(s)){const t=Object.keys(s)[0],e=s[t];O=this.chart.scales[t].getPixelForValue(e)+f}w=this._getXAxisLabelAlignment()}else if("y"===e){if("center"===s)v=(t.left+t.right)/2-f;else if(Object(n["Jb"])(s)){const t=Object.keys(s)[0],e=s[t];v=this.chart.scales[t].getPixelForValue(e)}w=this._getYAxisLabelAlignment(u).textAlign}"y"===e&&("start"===h?C="top":"end"===h&&(C="bottom"));const D=this._getLabelSizes();for(m=0,x=a.length;m<x;++m){_=a[m],y=_.label;const t=o.setContext(this.getContext(m));j=this.getPixelForTick(m)+o.labelOffset,M=this._resolveTickFontOptions(m),k=M.lineHeight,S=Object(n["Cb"])(y)?y.length:1;const e=S/2,i=t.color,h=t.textStrokeColor,c=t.textStrokeWidth;let u,f=w;if(r?(v=j,"inner"===w&&(f=m===x-1?this.options.reverse?"left":"right":0===m?this.options.reverse?"right":"left":"center"),P="top"===s?"near"===l||0!==g?-S*k+k/2:"center"===l?-D.highest.height/2-e*k+k:-D.highest.height+k/2:"near"===l||0!==g?k/2:"center"===l?D.highest.height/2-e*k:D.highest.height-S*k,d&&(P*=-1)):(O=j,P=(1-S)*k/2),t.showLabelBackdrop){const e=Object(n["l"])(t.backdropPadding),i=D.heights[m],s=D.widths[m];let o=O+P-e.top,r=v-e.left;switch(C){case"middle":o-=i/2;break;case"bottom":o-=i;break}switch(w){case"center":r-=s/2;break;case"right":r-=s;break}u={left:r,top:o,width:s+e.width,height:i+e.height,color:t.backdropColor}}p.push({rotation:g,label:y,font:M,color:i,strokeColor:h,strokeWidth:c,textOffset:P,textAlign:f,textBaseline:C,translation:[v,O],backdrop:u})}return p}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options,i=-Object(n["Ub"])(this.labelRotation);if(i)return"top"===t?"left":"right";let s="center";return"start"===e.align?s="left":"end"===e.align?s="right":"inner"===e.align&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:n,padding:s}}=this.options,o=this._getLabelSizes(),r=t+s,a=o.widest.width;let h,l;return"left"===e?n?(l=this.right+s,"near"===i?h="left":"center"===i?(h="center",l+=a/2):(h="right",l+=a)):(l=this.right-r,"near"===i?h="right":"center"===i?(h="center",l-=a/2):(h="left",l=this.left)):"right"===e?n?(l=this.left+s,"near"===i?h="right":"center"===i?(h="center",l-=a/2):(h="left",l-=a)):(l=this.left+r,"near"===i?h="left":"center"===i?(h="center",l+=a/2):(h="right",l=this.right)):h="right",{textAlign:h,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;return"left"===e||"right"===e?{top:0,left:this.left,bottom:t.height,right:this.right}:"top"===e||"bottom"===e?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:n,width:s,height:o}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,n,s,o),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const i=this.ticks,n=i.findIndex(e=>e.value===t);if(n>=0){const t=e.setContext(this.getContext(n));return t.lineWidth}return 0}drawGrid(t){const e=this.options.grid,i=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let s,o;const r=(t,e,n)=>{n.width&&n.color&&(i.save(),i.lineWidth=n.width,i.strokeStyle=n.color,i.setLineDash(n.borderDash||[]),i.lineDashOffset=n.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(e.display)for(s=0,o=n.length;s<o;++s){const t=n[s];e.drawOnChartArea&&r({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},t),e.drawTicks&&r({x:t.tx1,y:t.ty1},{x:t.tx2,y:t.ty2},{color:t.tickColor,width:t.tickWidth,borderDash:t.tickBorderDash,borderDashOffset:t.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{grid:i}}=this,s=i.setContext(this.getContext()),o=i.drawBorder?s.borderWidth:0;if(!o)return;const r=i.setContext(this.getContext(0)).lineWidth,a=this._borderValue;let h,l,c,d;this.isHorizontal()?(h=Object(n["k"])(t,this.left,o)-o/2,l=Object(n["k"])(t,this.right,r)+r/2,c=d=a):(c=Object(n["k"])(t,this.top,o)-o/2,d=Object(n["k"])(t,this.bottom,r)+r/2,h=l=a),e.save(),e.lineWidth=s.borderWidth,e.strokeStyle=s.borderColor,e.beginPath(),e.moveTo(h,c),e.lineTo(l,d),e.stroke(),e.restore()}drawLabels(t){const e=this.options.ticks;if(!e.display)return;const i=this.ctx,s=this._computeLabelArea();s&&Object(n["m"])(i,s);const o=this._labelItems||(this._labelItems=this._computeLabelItems(t));let r,a;for(r=0,a=o.length;r<a;++r){const t=o[r],e=t.font,s=t.label;t.backdrop&&(i.fillStyle=t.backdrop.color,i.fillRect(t.backdrop.left,t.backdrop.top,t.backdrop.width,t.backdrop.height));let a=t.textOffset;Object(n["n"])(i,s,0,a,e,t)}s&&Object(n["o"])(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:s}}=this;if(!i.display)return;const o=Object(n["p"])(i.font),r=Object(n["l"])(i.padding),a=i.align;let h=o.lineHeight/2;"bottom"===e||"center"===e||Object(n["Jb"])(e)?(h+=r.bottom,Object(n["Cb"])(i.text)&&(h+=o.lineHeight*(i.text.length-1))):h+=r.top;const{titleX:l,titleY:c,maxWidth:d,rotation:u}=Mt(this,h,e,a);Object(n["n"])(t,i.text,0,0,o,{color:i.color,maxWidth:d,rotation:u,textAlign:jt(a,e,s),textBaseline:"middle",translation:[l,c]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,i=Object(n["Wb"])(t.grid&&t.grid.z,-1);return this._isVisible()&&this.draw===kt.prototype.draw?[{z:i,draw:t=>{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:i+1,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",n=[];let s,o;for(s=0,o=e.length;s<o;++s){const o=e[s];o[i]!==this.id||t&&o.type!==t||n.push(o)}return n}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return Object(n["p"])(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class St{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let i;Dt(e)&&(i=this.register(e));const s=this.items,o=t.id,r=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in s||(s[o]=t,Pt(t,r,i),this.override&&n["Eb"].override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,s=this.scope;i in e&&delete e[i],s&&i in n["Eb"][s]&&(delete n["Eb"][s][i],this.override&&delete n["v"][i])}}function Pt(t,e,i){const s=Object(n["w"])(Object.create(null),[i?n["Eb"].get(i):{},n["Eb"].get(e),t.defaults]);n["Eb"].set(e,s),t.defaultRoutes&&Ct(e,t.defaultRoutes),t.descriptors&&n["Eb"].describe(e,t.descriptors)}function Ct(t,e){Object.keys(e).forEach(i=>{const s=i.split("."),o=s.pop(),r=[t].concat(s).join("."),a=e[i].split("."),h=a.pop(),l=a.join(".");n["Eb"].route(r,o,l,h)})}function Dt(t){return"id"in t&&"defaults"in t}class At{constructor(){this.controllers=new St(T,"datasets",!0),this.elements=new St(st,"elements"),this.plugins=new St(Object,"plugins"),this.scales=new St(kt,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(e=>{const s=i||this._getRegistryForType(e);i||s.isForType(e)||s===this.plugins&&e.id?this._exec(t,s,e):Object(n["r"])(e,e=>{const n=i||this._getRegistryForType(e);this._exec(t,n,e)})})}_exec(t,e,i){const s=Object(n["x"])(t);Object(n["d"])(i["before"+s],[],i),e[t](i),Object(n["d"])(i["after"+s],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const n=e.get(t);if(void 0===n)throw new Error('"'+t+'" is not a registered '+i+".");return n}}var Lt=new At;class Et extends T{update(t){const e=this._cachedMeta,{data:i=[]}=e,s=this.chart._animationsDisabled;let{start:o,count:r}=Object(n["Rb"])(e,i,s);if(this._drawStart=o,this._drawCount=r,Object(n["Xb"])(e)&&(o=0,r=i.length),this.options.showLine){const{dataset:n,_dataset:o}=e;n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!o._decimated,n.points=i;const r=this.resolveDatasetElementOptions(t);r.segment=this.options.segment,this.updateElement(n,void 0,{animated:!s,options:r},t)}this.updateElements(i,o,r,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=Lt.getElement("line")),super.addElements()}updateElements(t,e,i,s){const o="reset"===s,{iScale:r,vScale:a,_stacked:h,_dataset:l}=this._cachedMeta,c=this.resolveDataElementOptions(e,s),d=this.getSharedOptions(c),u=this.includeOptions(s,d),f=r.axis,b=a.axis,{spanGaps:g,segment:p}=this.options,m=Object(n["Yb"])(g)?g:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||o||"none"===s;let _=e>0&&this.getParsed(e-1);for(let y=e;y<e+i;++y){const e=t[y],i=this.getParsed(y),c=x?e:{},g=Object(n["Lb"])(i[b]),v=c[f]=r.getPixelForValue(i[f],y),O=c[b]=o||g?a.getBasePixel():a.getPixelForValue(h?this.applyStack(a,i,h):i[b],y);c.skip=isNaN(v)||isNaN(O)||g,c.stop=y>0&&Math.abs(i[f]-_[f])>m,p&&(c.parsed=i,c.raw=l.data[y]),u&&(c.options=d||this.resolveDataElementOptions(y,e.active?"active":s)),x||this.updateElement(e,y,c,s),_=i}this.updateSharedOptions(d,s,c)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let t=0;for(let i=e.length-1;i>=0;--i)t=Math.max(t,e[i].size(this.resolveDataElementOptions(i))/2);return t>0&&t}const i=t.dataset,n=i.options&&i.options.borderWidth||0;if(!e.length)return n;const s=e[0].size(this.resolveDataElementOptions(0)),o=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(n,s,o)/2}}Et.id="scatter",Et.defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1},Et.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title(){return""},label(t){return"("+t.label+", "+t.formattedValue+")"}}}},scales:{x:{type:"linear"},y:{type:"linear"}}};function Tt(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Rt{constructor(t){this.options=t||{}}init(t){}formats(){return Tt()}parse(t,e){return Tt()}format(t,e){return Tt()}add(t,e,i){return Tt()}diff(t,e,i){return Tt()}startOf(t,e,i){return Tt()}endOf(t,e){return Tt()}}Rt.override=function(t){Object.assign(Rt.prototype,t)};var It={_date:Rt};function zt(t,e,i,s){const{controller:o,data:r,_sorted:a}=t,h=o._cachedMeta.iScale;if(h&&e===h.axis&&"r"!==e&&a&&r.length){const t=h._reversePixels?n["z"]:n["A"];if(!s)return t(r,e,i);if(o._sharedOptions){const n=r[0],s="function"===typeof n.getRange&&n.getRange(e);if(s){const n=t(r,e,i-s),o=t(r,e,i+s);return{lo:n.lo,hi:o.hi}}}}return{lo:0,hi:r.length-1}}function Ft(t,e,i,n,s){const o=t.getSortedVisibleDatasetMetas(),r=i[e];for(let a=0,h=o.length;a<h;++a){const{index:t,data:i}=o[a],{lo:h,hi:l}=zt(o[a],e,r,s);for(let e=h;e<=l;++e){const s=i[e];s.skip||n(s,t,e)}}}function Wt(t){const e=-1!==t.indexOf("x"),i=-1!==t.indexOf("y");return function(t,n){const s=e?Math.abs(t.x-n.x):0,o=i?Math.abs(t.y-n.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(o,2))}}function Bt(t,e,i,s,o){const r=[];if(!o&&!t.isPointInArea(e))return r;const a=function(i,a,h){(o||Object(n["a"])(i,t.chartArea,0))&&i.inRange(e.x,e.y,s)&&r.push({element:i,datasetIndex:a,index:h})};return Ft(t,i,e,a,!0),r}function Vt(t,e,i,s){let o=[];function r(t,i,r){const{startAngle:a,endAngle:h}=t.getProps(["startAngle","endAngle"],s),{angle:l}=Object(n["D"])(t,{x:e.x,y:e.y});Object(n["Qb"])(l,a,h)&&o.push({element:t,datasetIndex:i,index:r})}return Ft(t,i,e,r),o}function Nt(t,e,i,n,s,o){let r=[];const a=Wt(i);let h=Number.POSITIVE_INFINITY;function l(i,l,c){const d=i.inRange(e.x,e.y,s);if(n&&!d)return;const u=i.getCenterPoint(s),f=!!o||t.isPointInArea(u);if(!f&&!d)return;const b=a(e,u);b<h?(r=[{element:i,datasetIndex:l,index:c}],h=b):b===h&&r.push({element:i,datasetIndex:l,index:c})}return Ft(t,i,e,l),r}function Ht(t,e,i,n,s,o){return o||t.isPointInArea(e)?"r"!==i||n?Nt(t,e,i,n,s,o):Vt(t,e,i,s):[]}function $t(t,e,i,n,s){const o=[],r="x"===i?"inXRange":"inYRange";let a=!1;return Ft(t,i,e,(t,n,h)=>{t[r](e[i],s)&&(o.push({element:t,datasetIndex:n,index:h}),a=a||t.inRange(e.x,e.y,s))}),n&&!a?[]:o}var Yt={evaluateInteractionItems:Ft,modes:{index(t,e,i,s){const o=Object(n["y"])(e,t),r=i.axis||"x",a=i.includeInvisible||!1,h=i.intersect?Bt(t,o,r,s,a):Ht(t,o,r,!1,s,a),l=[];return h.length?(t.getSortedVisibleDatasetMetas().forEach(t=>{const e=h[0].index,i=t.data[e];i&&!i.skip&&l.push({element:i,datasetIndex:t.index,index:e})}),l):[]},dataset(t,e,i,s){const o=Object(n["y"])(e,t),r=i.axis||"xy",a=i.includeInvisible||!1;let h=i.intersect?Bt(t,o,r,s,a):Ht(t,o,r,!1,s,a);if(h.length>0){const e=h[0].datasetIndex,i=t.getDatasetMeta(e).data;h=[];for(let t=0;t<i.length;++t)h.push({element:i[t],datasetIndex:e,index:t})}return h},point(t,e,i,s){const o=Object(n["y"])(e,t),r=i.axis||"xy",a=i.includeInvisible||!1;return Bt(t,o,r,s,a)},nearest(t,e,i,s){const o=Object(n["y"])(e,t),r=i.axis||"xy",a=i.includeInvisible||!1;return Ht(t,o,r,i.intersect,s,a)},x(t,e,i,s){const o=Object(n["y"])(e,t);return $t(t,o,"x",i.intersect,s)},y(t,e,i,s){const o=Object(n["y"])(e,t);return $t(t,o,"y",i.intersect,s)}}};const Ut=["left","top","right","bottom"];function Xt(t,e){return t.filter(t=>t.pos===e)}function qt(t,e){return t.filter(t=>-1===Ut.indexOf(t.pos)&&t.box.axis===e)}function Jt(t,e){return t.sort((t,i)=>{const n=e?i:t,s=e?t:i;return n.weight===s.weight?n.index-s.index:n.weight-s.weight})}function Kt(t){const e=[];let i,n,s,o,r,a;for(i=0,n=(t||[]).length;i<n;++i)s=t[i],({position:o,options:{stack:r,stackWeight:a=1}}=s),e.push({index:i,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:r&&o+r,stackWeight:a});return e}function Gt(t){const e={};for(const i of t){const{stack:t,pos:n,stackWeight:s}=i;if(!t||!Ut.includes(n))continue;const o=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=s}return e}function Zt(t,e){const i=Gt(t),{vBoxMaxWidth:n,hBoxMaxHeight:s}=e;let o,r,a;for(o=0,r=t.length;o<r;++o){a=t[o];const{fullSize:r}=a.box,h=i[a.stack],l=h&&a.stackWeight/h.weight;a.horizontal?(a.width=l?l*n:r&&e.availableWidth,a.height=s):(a.width=n,a.height=l?l*s:r&&e.availableHeight)}return i}function Qt(t){const e=Kt(t),i=Jt(e.filter(t=>t.box.fullSize),!0),n=Jt(Xt(e,"left"),!0),s=Jt(Xt(e,"right")),o=Jt(Xt(e,"top"),!0),r=Jt(Xt(e,"bottom")),a=qt(e,"x"),h=qt(e,"y");return{fullSize:i,leftAndTop:n.concat(o),rightAndBottom:s.concat(h).concat(r).concat(a),chartArea:Xt(e,"chartArea"),vertical:n.concat(s).concat(h),horizontal:o.concat(r).concat(a)}}function te(t,e,i,n){return Math.max(t[i],e[i])+Math.max(t[n],e[n])}function ee(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function ie(t,e,i,s){const{pos:o,box:r}=i,a=t.maxPadding;if(!Object(n["Jb"])(o)){i.size&&(t[o]-=i.size);const e=s[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?r.height:r.width),i.size=e.size/e.count,t[o]+=i.size}r.getPadding&&ee(a,r.getPadding());const h=Math.max(0,e.outerWidth-te(a,t,"left","right")),l=Math.max(0,e.outerHeight-te(a,t,"top","bottom")),c=h!==t.w,d=l!==t.h;return t.w=h,t.h=l,i.horizontal?{same:c,other:d}:{same:d,other:c}}function ne(t){const e=t.maxPadding;function i(i){const n=Math.max(e[i]-t[i],0);return t[i]+=n,n}t.y+=i("top"),t.x+=i("left"),i("right"),i("bottom")}function se(t,e){const i=e.maxPadding;function n(t){const n={left:0,top:0,right:0,bottom:0};return t.forEach(t=>{n[t]=Math.max(e[t],i[t])}),n}return n(t?["left","right"]:["top","bottom"])}function oe(t,e,i,n){const s=[];let o,r,a,h,l,c;for(o=0,r=t.length,l=0;o<r;++o){a=t[o],h=a.box,h.update(a.width||e.w,a.height||e.h,se(a.horizontal,e));const{same:r,other:d}=ie(e,i,a,n);l|=r&&s.length,c=c||d,h.fullSize||s.push(a)}return l&&oe(s,e,i,n)||c}function re(t,e,i,n,s){t.top=i,t.left=e,t.right=e+n,t.bottom=i+s,t.width=n,t.height=s}function ae(t,e,i,s){const o=i.padding;let{x:r,y:a}=e;for(const h of t){const t=h.box,l=s[h.stack]||{count:1,placed:0,weight:1},c=h.stackWeight/l.weight||1;if(h.horizontal){const s=e.w*c,r=l.size||t.height;Object(n["Kb"])(l.start)&&(a=l.start),t.fullSize?re(t,o.left,a,i.outerWidth-o.right-o.left,r):re(t,e.left+l.placed,a,s,r),l.start=a,l.placed+=s,a=t.bottom}else{const s=e.h*c,a=l.size||t.width;Object(n["Kb"])(l.start)&&(r=l.start),t.fullSize?re(t,r,o.top,a,i.outerHeight-o.bottom-o.top):re(t,r,e.top+l.placed,a,s),l.start=r,l.placed+=s,r=t.right}}e.x=r,e.y=a}n["Eb"].set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}});var he={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},t.boxes.push(e)},removeBox(t,e){const i=t.boxes?t.boxes.indexOf(e):-1;-1!==i&&t.boxes.splice(i,1)},configure(t,e,i){e.fullSize=i.fullSize,e.position=i.position,e.weight=i.weight},update(t,e,i,s){if(!t)return;const o=Object(n["l"])(t.options.layout.padding),r=Math.max(e-o.width,0),a=Math.max(i-o.height,0),h=Qt(t.boxes),l=h.vertical,c=h.horizontal;Object(n["r"])(t.boxes,t=>{"function"===typeof t.beforeLayout&&t.beforeLayout()});const d=l.reduce((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1,0)||1,u=Object.freeze({outerWidth:e,outerHeight:i,padding:o,availableWidth:r,availableHeight:a,vBoxMaxWidth:r/2/d,hBoxMaxHeight:a/2}),f=Object.assign({},o);ee(f,Object(n["l"])(s));const b=Object.assign({maxPadding:f,w:r,h:a,x:o.left,y:o.top},o),g=Zt(l.concat(c),u);oe(h.fullSize,b,u,g),oe(l,b,u,g),oe(c,b,u,g)&&oe(l,b,u,g),ne(b),ae(h.leftAndTop,b,u,g),b.x+=b.w,b.y+=b.h,ae(h.rightAndBottom,b,u,g),t.chartArea={left:b.left,top:b.top,right:b.left+b.w,bottom:b.top+b.h,height:b.h,width:b.w},Object(n["r"])(h.chartArea,e=>{const i=e.box;Object.assign(i,t.chartArea),i.update(b.w,b.h,{left:0,top:0,right:0,bottom:0})})}};class le{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,n){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):i)}}isAttached(t){return!0}updateConfig(t){}}class ce extends le{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const de="$chartjs",ue={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},fe=t=>null===t||""===t;function be(t,e){const i=t.style,s=t.getAttribute("height"),o=t.getAttribute("width");if(t[de]={initial:{height:s,width:o,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",fe(o)){const e=Object(n["G"])(t,"width");void 0!==e&&(t.width=e)}if(fe(s))if(""===t.style.height)t.height=t.width/(e||2);else{const e=Object(n["G"])(t,"height");void 0!==e&&(t.height=e)}return t}const ge=!!n["I"]&&{passive:!0};function pe(t,e,i){t.addEventListener(e,i,ge)}function me(t,e,i){t.canvas.removeEventListener(e,i,ge)}function xe(t,e){const i=ue[t.type]||t.type,{x:s,y:o}=Object(n["y"])(t,e);return{type:i,chart:e,native:t,x:void 0!==s?s:null,y:void 0!==o?o:null}}function _e(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function ye(t,e,i){const n=t.canvas,s=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||_e(i.addedNodes,n),e=e&&!_e(i.removedNodes,n);e&&i()});return s.observe(document,{childList:!0,subtree:!0}),s}function ve(t,e,i){const n=t.canvas,s=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||_e(i.removedNodes,n),e=e&&!_e(i.addedNodes,n);e&&i()});return s.observe(document,{childList:!0,subtree:!0}),s}const Oe=new Map;let we=0;function je(){const t=window.devicePixelRatio;t!==we&&(we=t,Oe.forEach((e,i)=>{i.currentDevicePixelRatio!==t&&e()}))}function Me(t,e){Oe.size||window.addEventListener("resize",je),Oe.set(t,e)}function ke(t){Oe.delete(t),Oe.size||window.removeEventListener("resize",je)}function Se(t,e,i){const s=t.canvas,o=s&&Object(n["F"])(s);if(!o)return;const r=Object(n["H"])((t,e)=>{const n=o.clientWidth;i(t,e),n<o.clientWidth&&i()},window),a=new ResizeObserver(t=>{const e=t[0],i=e.contentRect.width,n=e.contentRect.height;0===i&&0===n||r(i,n)});return a.observe(o),Me(t,r),a}function Pe(t,e,i){i&&i.disconnect(),"resize"===e&&ke(t)}function Ce(t,e,i){const s=t.canvas,o=Object(n["H"])(e=>{null!==t.ctx&&i(xe(e,t))},t,t=>{const e=t[0];return[e,e.offsetX,e.offsetY]});return pe(s,e,o),o}class De extends le{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(be(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[de])return!1;const i=e[de].initial;["height","width"].forEach(t=>{const s=i[t];Object(n["Lb"])(s)?e.removeAttribute(t):e.setAttribute(t,s)});const s=i.style||{};return Object.keys(s).forEach(t=>{e.style[t]=s[t]}),e.width=e.width,delete e[de],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),s={attach:ye,detach:ve,resize:Se},o=s[e]||Ce;n[e]=o(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),n=i[e];if(!n)return;const s={attach:Pe,detach:Pe,resize:Pe},o=s[e]||me;o(t,e,n),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return Object(n["E"])(t,e,i,s)}isAttached(t){const e=Object(n["F"])(t);return!(!e||!e.isConnected)}}function Ae(t){return!Object(n["J"])()||"undefined"!==typeof OffscreenCanvas&&t instanceof OffscreenCanvas?ce:De}class Le{constructor(){this._init=[]}notify(t,e,i,n){"beforeInit"===e&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const s=n?this._descriptors(t).filter(n):this._descriptors(t),o=this._notify(s,t,e,i);return"afterDestroy"===e&&(this._notify(s,t,"stop"),this._notify(this._init,t,"uninstall")),o}_notify(t,e,i,s){s=s||{};for(const o of t){const t=o.plugin,r=t[i],a=[e,s,o.options];if(!1===Object(n["d"])(r,a,t)&&s.cancelable)return!1}return!0}invalidate(){Object(n["Lb"])(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,s=Object(n["Wb"])(i.options&&i.options.plugins,{}),o=Ee(i);return!1!==s||e?Re(t,o,s,e):[]}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,n=(t,e)=>t.filter(t=>!e.some(e=>t.plugin.id===e.plugin.id));this._notify(n(e,i),t,"stop"),this._notify(n(i,e),t,"start")}}function Ee(t){const e={},i=[],n=Object.keys(Lt.plugins.items);for(let o=0;o<n.length;o++)i.push(Lt.getPlugin(n[o]));const s=t.plugins||[];for(let o=0;o<s.length;o++){const t=s[o];-1===i.indexOf(t)&&(i.push(t),e[t.id]=!0)}return{plugins:i,localIds:e}}function Te(t,e){return e||!1!==t?!0===t?{}:t:null}function Re(t,{plugins:e,localIds:i},n,s){const o=[],r=t.getContext();for(const a of e){const e=a.id,h=Te(n[e],s);null!==h&&o.push({plugin:a,options:Ie(t.config,{plugin:a,local:i[e]},h,r)})}return o}function Ie(t,{plugin:e,local:i},n,s){const o=t.pluginScopeKeys(e),r=t.getOptionScopes(n,o);return i&&e.defaults&&r.push(e.defaults),t.createResolver(r,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function ze(t,e){const i=n["Eb"].datasets[t]||{},s=(e.datasets||{})[t]||{};return s.indexAxis||e.indexAxis||i.indexAxis||"x"}function Fe(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}function We(t,e){return t===e?"_index_":"_value_"}function Be(t){return"top"===t||"bottom"===t?"x":"left"===t||"right"===t?"y":void 0}function Ve(t,e){return"x"===t||"y"===t?t:e.axis||Be(e.position)||t.charAt(0).toLowerCase()}function Ne(t,e){const i=n["v"][t.type]||{scales:{}},s=e.scales||{},o=ze(t.type,e),r=Object.create(null),a=Object.create(null);return Object.keys(s).forEach(t=>{const e=s[t];if(!Object(n["Jb"])(e))return console.error("Invalid scale configuration for scale: "+t);if(e._proxy)return console.warn("Ignoring resolver passed as options for scale: "+t);const h=Ve(t,e),l=We(h,o),c=i.scales||{};r[h]=r[h]||t,a[t]=Object(n["eb"])(Object.create(null),[{axis:h},e,c[h],c[l]])}),t.data.datasets.forEach(i=>{const o=i.type||t.type,h=i.indexAxis||ze(o,e),l=n["v"][o]||{},c=l.scales||{};Object.keys(c).forEach(t=>{const e=Fe(t,h),o=i[e+"AxisID"]||r[e]||e;a[o]=a[o]||Object.create(null),Object(n["eb"])(a[o],[{axis:e},s[o],c[t]])})}),Object.keys(a).forEach(t=>{const e=a[t];Object(n["eb"])(e,[n["Eb"].scales[e.type],n["Eb"].scale])}),a}function He(t){const e=t.options||(t.options={});e.plugins=Object(n["Wb"])(e.plugins,{}),e.scales=Ne(t,e)}function $e(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function Ye(t){return t=t||{},t.data=$e(t.data),He(t),t}const Ue=new Map,Xe=new Set;function qe(t,e){let i=Ue.get(t);return i||(i=e(),Ue.set(t,i),Xe.add(i)),i}const Je=(t,e,i)=>{const s=Object(n["Gb"])(e,i);void 0!==s&&t.add(s)};class Ke{constructor(t){this._config=Ye(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=$e(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),He(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return qe(t,()=>[["datasets."+t,""]])}datasetAnimationScopeKeys(t,e){return qe(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,"transitions."+e],["datasets."+t,""]])}datasetElementScopeKeys(t,e){return qe(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,"datasets."+t,"elements."+e,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return qe(`${i}-plugin-${e}`,()=>[["plugins."+e,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let n=i.get(t);return n&&!e||(n=new Map,i.set(t,n)),n}getOptionScopes(t,e,i){const{options:s,type:o}=this,r=this._cachedScopes(t,i),a=r.get(e);if(a)return a;const h=new Set;e.forEach(e=>{t&&(h.add(t),e.forEach(e=>Je(h,t,e))),e.forEach(t=>Je(h,s,t)),e.forEach(t=>Je(h,n["v"][o]||{},t)),e.forEach(t=>Je(h,n["Eb"],t)),e.forEach(t=>Je(h,n["K"],t))});const l=Array.from(h);return 0===l.length&&l.push(Object.create(null)),Xe.has(e)&&r.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,n["v"][e]||{},n["Eb"].datasets[e]||{},{type:e},n["Eb"],n["K"]]}resolveNamedOptions(t,e,i,s=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=Ge(this._resolverCache,t,s);let h=r;if(Qe(r,e)){o.$shared=!1,i=Object(n["L"])(i)?i():i;const e=this.createResolver(t,i,a);h=Object(n["M"])(r,i,e)}for(const n of e)o[n]=h[n];return o}createResolver(t,e,i=[""],s){const{resolver:o}=Ge(this._resolverCache,t,i);return Object(n["Jb"])(e)?Object(n["M"])(o,e,void 0,s):o}}function Ge(t,e,i){let s=t.get(e);s||(s=new Map,t.set(e,s));const o=i.join();let r=s.get(o);if(!r){const t=Object(n["cb"])(e,i);r={resolver:t,subPrefixes:i.filter(t=>!t.toLowerCase().includes("hover"))},s.set(o,r)}return r}const Ze=t=>Object(n["Jb"])(t)&&Object.getOwnPropertyNames(t).reduce((e,i)=>e||Object(n["L"])(t[i]),!1);function Qe(t,e){const{isScriptable:i,isIndexable:s}=Object(n["db"])(t);for(const o of e){const e=i(o),r=s(o),a=(r||e)&&t[o];if(e&&(Object(n["L"])(a)||Ze(a))||r&&Object(n["Cb"])(a))return!0}return!1}var ti="3.9.1";const ei=["top","bottom","left","right","chartArea"];function ii(t,e){return"top"===t||"bottom"===t||-1===ei.indexOf(t)&&"x"===e}function ni(t,e){return function(i,n){return i[t]===n[t]?i[e]-n[e]:i[t]-n[t]}}function si(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),Object(n["d"])(i&&i.onComplete,[t],e)}function oi(t){const e=t.chart,i=e.options.animation;Object(n["d"])(i&&i.onProgress,[t],e)}function ri(t){return Object(n["J"])()&&"string"===typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const ai={},hi=t=>{const e=ri(t);return Object.values(ai).filter(t=>t.canvas===e).pop()};function li(t,e,i){const n=Object.keys(t);for(const s of n){const n=+s;if(n>=e){const o=t[s];delete t[s],(i>0||n>e)&&(t[n+i]=o)}}}function ci(t,e,i,n){return i&&"mouseout"!==t.type?n?e:t:null}class di{constructor(t,e){const i=this.config=new Ke(e),s=ri(t),r=hi(s);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");const a=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||Ae(s)),this.platform.updateConfig(i);const h=this.platform.acquireContext(s,a.aspectRatio),l=h&&h.canvas,c=l&&l.height,d=l&&l.width;this.id=Object(n["fb"])(),this.ctx=h,this.canvas=l,this.width=d,this.height=c,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Le,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Object(n["gb"])(t=>this.update(t),a.resizeDelay||0),this._dataChanges=[],ai[this.id]=this,h&&l?(o.listen(this,"complete",si),o.listen(this,"progress",oi),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:s,_aspectRatio:o}=this;return Object(n["Lb"])(t)?e&&o?o:s?i/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Object(n["hb"])(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Object(n["ib"])(this.canvas,this.ctx),this}stop(){return o.stop(this),this}resize(t,e){o.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,s=this.canvas,o=i.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(s,t,e,o),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),h=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,Object(n["hb"])(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),Object(n["d"])(i.onResize,[this,r],this),this.attached&&this._doResize(h)&&this.render())}ensureScalesHaveIDs(){const t=this.options,e=t.scales||{};Object(n["r"])(e,(t,e)=>{t.id=e})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce((t,e)=>(t[e]=!1,t),{});let o=[];e&&(o=o.concat(Object.keys(e).map(t=>{const i=e[t],n=Ve(t,i),s="r"===n,o="x"===n;return{options:i,dposition:s?"chartArea":o?"bottom":"left",dtype:s?"radialLinear":o?"category":"linear"}}))),Object(n["r"])(o,e=>{const o=e.options,r=o.id,a=Ve(r,o),h=Object(n["Wb"])(o.type,e.dtype);void 0!==o.position&&ii(o.position,a)===ii(e.dposition)||(o.position=e.dposition),s[r]=!0;let l=null;if(r in i&&i[r].type===h)l=i[r];else{const t=Lt.getScale(h);l=new t({id:r,type:h,ctx:this.ctx,chart:this}),i[l.id]=l}l.init(o,t)}),Object(n["r"])(s,(t,e)=>{t||delete i[e]}),Object(n["r"])(i,t=>{he.configure(this,t,t.options),he.addBox(this,t)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((t,e)=>t.index-e.index),i>e){for(let t=e;t<i;++t)this._destroyDatasetMeta(t);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(ni("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((t,i)=>{0===e.filter(e=>e===t._dataset).length&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=e.length;i<s;i++){const s=e[i];let o=this.getDatasetMeta(i);const r=s.type||this.config.type;if(o.type&&o.type!==r&&(this._destroyDatasetMeta(i),o=this.getDatasetMeta(i)),o.type=r,o.indexAxis=s.indexAxis||ze(r,this.options),o.order=s.order||0,o.index=i,o.label=""+s.label,o.visible=this.isDatasetVisible(i),o.controller)o.controller.updateIndex(i),o.controller.linkScales();else{const e=Lt.getController(r),{datasetElementType:s,dataElementType:a}=n["Eb"].datasets[r];Object.assign(e.prototype,{dataElementType:Lt.getElement(a),datasetElementType:s&&Lt.getElement(s)}),o.controller=new e(this,i),t.push(o.controller)}}return this._updateMetasets(),t}_resetElements(){Object(n["r"])(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let n=0,l=this.data.datasets.length;n<l;n++){const{controller:t}=this.getDatasetMeta(n),e=!s&&-1===o.indexOf(t);t.buildOrUpdateElements(e),r=Math.max(+t.getMaxOverflow(),r)}r=this._minPadding=i.layout.autoPadding?r:0,this._updateLayout(r),s||Object(n["r"])(o,t=>{t.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(ni("z","_idx"));const{_active:a,_lastEvent:h}=this;h?this._eventHandler(h,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Object(n["r"])(this.scales,t=>{he.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);Object(n["jb"])(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:n,count:s}of e){const e="_removeElements"===i?-s:s;li(t,n,e)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=e=>new Set(t.filter(t=>t[0]===e).map((t,e)=>e+","+t.splice(1).join(","))),s=i(0);for(let o=1;o<e;o++)if(!Object(n["jb"])(s,i(o)))return;return Array.from(s).map(t=>t.split(",")).map(t=>({method:t[1],start:+t[2],count:+t[3]}))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;he.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],Object(n["r"])(this.boxes,t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))},this),this._layers.forEach((t,e)=>{t._idx=e}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t<e;++t)this.getDatasetMeta(t).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,Object(n["L"])(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),n={meta:i,index:t,mode:e,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",n)&&(i.controller._update(e),n.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",n))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(o.has(this)?this.attached&&!o.running(this)&&o.start(this):(this.draw(),si({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:t,height:e}=this._resizeBeforeDraw;this._resize(t,e),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0)return;if(!1===this.notifyPlugins("beforeDraw",{cancelable:!0}))return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let n,s;for(n=0,s=e.length;n<s;++n){const s=e[n];t&&!s.visible||i.push(s)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1===this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,s=!i.disabled,o=this.chartArea,r={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",r)&&(s&&Object(n["m"])(e,{left:!1===i.left?0:o.left-i.left,right:!1===i.right?this.width:o.right+i.right,top:!1===i.top?0:o.top-i.top,bottom:!1===i.bottom?this.height:o.bottom+i.bottom}),t.controller.draw(),s&&Object(n["o"])(e),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return Object(n["a"])(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,n){const s=Yt.modes[e];return"function"===typeof s?s(this,t,i,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let n=i.filter(t=>t&&t._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(n)),n}getContext(){return this.$context||(this.$context=Object(n["Ib"])(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return"boolean"===typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){const i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const s=i?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,s);Object(n["Kb"])(e)?(o.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),r.update(o,{visible:i}),this.update(e=>e.datasetIndex===t?s:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),o.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Object(n["ib"])(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),this.notifyPlugins("destroy"),delete ai[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(i,n)=>{e.addEventListener(this,i,n),t[i]=n},s=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};Object(n["r"])(this.options.events,t=>i(t,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,n)=>{e.addEventListener(this,i,n),t[i]=n},n=(i,n)=>{t[i]&&(e.removeEventListener(this,i,n),delete t[i])},s=(t,e)=>{this.canvas&&this.resize(t,e)};let o;const r=()=>{n("attach",r),this.attached=!0,this.resize(),i("resize",s),i("detach",o)};o=()=>{this.attached=!1,n("resize",s),this._stop(),this._resize(0,0),i("attach",r)},e.isAttached(this.canvas)?r():o()}unbindEvents(){Object(n["r"])(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},Object(n["r"])(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const n=i?"set":"remove";let s,o,r,a;for("dataset"===e&&(s=this.getDatasetMeta(t[0].datasetIndex),s.controller["_"+n+"DatasetHoverStyle"]()),r=0,a=t.length;r<a;++r){o=t[r];const e=o&&this.getDatasetMeta(o.datasetIndex).controller;e&&e[n+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map(({datasetIndex:t,index:e})=>{const i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}),s=!Object(n["kb"])(i,e);s&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}_updateHoverStyles(t,e,i){const n=this.options.hover,s=(t,e)=>t.filter(t=>!e.some(e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)),o=s(e,t),r=i?t:s(t,e);o.length&&this.updateHoverStyle(o,n.mode,!1),r.length&&n.mode&&this.updateHoverStyle(r,n.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,n))return;const s=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,n),(s||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:s=[],options:o}=this,r=e,a=this._getActiveElements(t,s,i,r),h=Object(n["lb"])(t),l=ci(t,this._lastEvent,i,h);i&&(this._lastEvent=null,Object(n["d"])(o.onHover,[t,a,this],this),h&&Object(n["d"])(o.onClick,[t,a,this],this));const c=!Object(n["kb"])(a,s);return(c||e)&&(this._active=a,this._updateHoverStyles(a,s,e)),this._lastEvent=l,c}_getActiveElements(t,e,i,n){if("mouseout"===t.type)return[];if(!i)return e;const s=this.options.hover;return this.getElementsAtEventForMode(t,s.mode,s,n)}}const ui=()=>Object(n["r"])(di.instances,t=>t._plugins.invalidate()),fi=!0;function bi(t,e,i){const{startAngle:s,pixelMargin:o,x:r,y:a,outerRadius:h,innerRadius:l}=e;let c=o/h;t.beginPath(),t.arc(r,a,h,s-c,i+c),l>o?(c=o/l,t.arc(r,a,l,i+c,s-c,!0)):t.arc(r,a,o,i+n["i"],s-n["i"]),t.closePath(),t.clip()}function gi(t){return Object(n["nb"])(t,["outerStart","outerEnd","innerStart","innerEnd"])}function pi(t,e,i,s){const o=gi(t.options.borderRadius),r=(i-e)/2,a=Math.min(r,s*e/2),h=t=>{const e=(i-Math.min(r,t))*s/2;return Object(n["f"])(t,0,Math.min(r,e))};return{outerStart:h(o.outerStart),outerEnd:h(o.outerEnd),innerStart:Object(n["f"])(o.innerStart,0,a),innerEnd:Object(n["f"])(o.innerEnd,0,a)}}function mi(t,e,i,n){return{x:i+t*Math.cos(e),y:n+t*Math.sin(e)}}function xi(t,e,i,s,o,r){const{x:a,y:h,startAngle:l,pixelMargin:c,innerRadius:d}=e,u=Math.max(e.outerRadius+s+i-c,0),f=d>0?d+s+i+c:0;let b=0;const g=o-l;if(s){const t=d>0?d-s:0,e=u>0?u-s:0,i=(t+e)/2,n=0!==i?g*i/(i+s):g;b=(g-n)/2}const p=Math.max(.001,g*u-i/n["q"])/u,m=(g-p)/2,x=l+m+b,_=o-m-b,{outerStart:y,outerEnd:v,innerStart:O,innerEnd:w}=pi(e,f,u,_-x),j=u-y,M=u-v,k=x+y/j,S=_-v/M,P=f+O,C=f+w,D=x+O/P,A=_-w/C;if(t.beginPath(),r){if(t.arc(a,h,u,k,S),v>0){const e=mi(M,S,a,h);t.arc(e.x,e.y,v,S,_+n["i"])}const e=mi(C,_,a,h);if(t.lineTo(e.x,e.y),w>0){const e=mi(C,A,a,h);t.arc(e.x,e.y,w,_+n["i"],A+Math.PI)}if(t.arc(a,h,f,_-w/f,x+O/f,!0),O>0){const e=mi(P,D,a,h);t.arc(e.x,e.y,O,D+Math.PI,x-n["i"])}const i=mi(j,x,a,h);if(t.lineTo(i.x,i.y),y>0){const e=mi(j,k,a,h);t.arc(e.x,e.y,y,x-n["i"],k)}}else{t.moveTo(a,h);const e=Math.cos(k)*u+a,i=Math.sin(k)*u+h;t.lineTo(e,i);const n=Math.cos(S)*u+a,s=Math.sin(S)*u+h;t.lineTo(n,s)}t.closePath()}function _i(t,e,i,s,o){const{fullCircles:r,startAngle:a,circumference:h}=e;let l=e.endAngle;if(r){xi(t,e,i,s,a+n["u"],o);for(let e=0;e<r;++e)t.fill();isNaN(h)||(l=a+h%n["u"],h%n["u"]===0&&(l+=n["u"]))}return xi(t,e,i,s,l,o),t.fill(),l}function yi(t,e,i){const{x:s,y:o,startAngle:r,pixelMargin:a,fullCircles:h}=e,l=Math.max(e.outerRadius-a,0),c=e.innerRadius+a;let d;for(i&&bi(t,e,r+n["u"]),t.beginPath(),t.arc(s,o,c,r+n["u"],r,!0),d=0;d<h;++d)t.stroke();for(t.beginPath(),t.arc(s,o,l,r,r+n["u"]),d=0;d<h;++d)t.stroke()}function vi(t,e,i,n,s,o){const{options:r}=e,{borderWidth:a,borderJoinStyle:h}=r,l="inner"===r.borderAlign;a&&(l?(t.lineWidth=2*a,t.lineJoin=h||"round"):(t.lineWidth=a,t.lineJoin=h||"bevel"),e.fullCircles&&yi(t,e,l),l&&bi(t,e,s),xi(t,e,i,n,s,o),t.stroke())}Object.defineProperties(di,{defaults:{enumerable:fi,value:n["Eb"]},instances:{enumerable:fi,value:ai},overrides:{enumerable:fi,value:n["v"]},registry:{enumerable:fi,value:Lt},version:{enumerable:fi,value:ti},getChart:{enumerable:fi,value:hi},register:{enumerable:fi,value:(...t)=>{Lt.add(...t),ui()}},unregister:{enumerable:fi,value:(...t)=>{Lt.remove(...t),ui()}}});class Oi extends st{constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){const s=this.getProps(["x","y"],i),{angle:o,distance:r}=Object(n["D"])(s,{x:t,y:e}),{startAngle:a,endAngle:h,innerRadius:l,outerRadius:c,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),u=this.options.spacing/2,f=Object(n["Wb"])(d,h-a),b=f>=n["u"]||Object(n["Qb"])(o,a,h),g=Object(n["mb"])(r,l+u,c+u);return b&&g}getCenterPoint(t){const{x:e,y:i,startAngle:n,endAngle:s,innerRadius:o,outerRadius:r}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:a,spacing:h}=this.options,l=(n+s)/2,c=(o+r+h+a)/2;return{x:e+Math.cos(l)*c,y:i+Math.sin(l)*c}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,s=(e.offset||0)/2,o=(e.spacing||0)/2,r=e.circular;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>n["u"]?Math.floor(i/n["u"]):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();let a=0;if(s){a=s/2;const e=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(e)*a,Math.sin(e)*a),this.circumference>=n["q"]&&(a=s)}t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor;const h=_i(t,this,a,o,r);vi(t,this,a,o,h,r),t.restore()}}function wi(t,e,i=e){t.lineCap=Object(n["Wb"])(i.borderCapStyle,e.borderCapStyle),t.setLineDash(Object(n["Wb"])(i.borderDash,e.borderDash)),t.lineDashOffset=Object(n["Wb"])(i.borderDashOffset,e.borderDashOffset),t.lineJoin=Object(n["Wb"])(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=Object(n["Wb"])(i.borderWidth,e.borderWidth),t.strokeStyle=Object(n["Wb"])(i.borderColor,e.borderColor)}function ji(t,e,i){t.lineTo(i.x,i.y)}function Mi(t){return t.stepped?n["ub"]:t.tension||"monotone"===t.cubicInterpolationMode?n["vb"]:ji}function ki(t,e,i={}){const n=t.length,{start:s=0,end:o=n-1}=i,{start:r,end:a}=e,h=Math.max(s,r),l=Math.min(o,a),c=s<r&&o<r||s>a&&o>a;return{count:n,start:h,loop:e.loop,ilen:l<h&&!c?n+l-h:l-h}}function Si(t,e,i,n){const{points:s,options:o}=e,{count:r,start:a,loop:h,ilen:l}=ki(s,i,n),c=Mi(o);let d,u,f,{move:b=!0,reverse:g}=n||{};for(d=0;d<=l;++d)u=s[(a+(g?l-d:d))%r],u.skip||(b?(t.moveTo(u.x,u.y),b=!1):c(t,f,u,g,o.stepped),f=u);return h&&(u=s[(a+(g?l:0))%r],c(t,f,u,g,o.stepped)),!!h}function Pi(t,e,i,n){const s=e.points,{count:o,start:r,ilen:a}=ki(s,i,n),{move:h=!0,reverse:l}=n||{};let c,d,u,f,b,g,p=0,m=0;const x=t=>(r+(l?a-t:t))%o,_=()=>{f!==b&&(t.lineTo(p,b),t.lineTo(p,f),t.lineTo(p,g))};for(h&&(d=s[x(0)],t.moveTo(d.x,d.y)),c=0;c<=a;++c){if(d=s[x(c)],d.skip)continue;const e=d.x,i=d.y,n=0|e;n===u?(i<f?f=i:i>b&&(b=i),p=(m*p+e)/++m):(_(),t.lineTo(e,i),u=n,m=0,f=b=i),g=i}_()}function Ci(t){const e=t.options,i=e.borderDash&&e.borderDash.length,n=!t._decimated&&!t._loop&&!e.tension&&"monotone"!==e.cubicInterpolationMode&&!e.stepped&&!i;return n?Pi:Si}function Di(t){return t.stepped?n["rb"]:t.tension||"monotone"===t.cubicInterpolationMode?n["sb"]:n["tb"]}function Ai(t,e,i,n){let s=e._path;s||(s=e._path=new Path2D,e.path(s,i,n)&&s.closePath()),wi(t,e.options),t.stroke(s)}function Li(t,e,i,n){const{segments:s,options:o}=e,r=Ci(e);for(const a of s)wi(t,o,a.style),t.beginPath(),r(t,e,a,{start:i,end:i+n-1})&&t.closePath(),t.stroke()}Oi.id="arc",Oi.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0},Oi.defaultRoutes={backgroundColor:"backgroundColor"};const Ei="function"===typeof Path2D;function Ti(t,e,i,n){Ei&&!e.options.segment?Ai(t,e,i,n):Li(t,e,i,n)}class Ri extends st{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;Object(n["ob"])(this._points,i,t,s,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Object(n["pb"])(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,s=t[e],o=this.points,r=Object(n["qb"])(this,{property:e,start:s,end:s});if(!r.length)return;const a=[],h=Di(i);let l,c;for(l=0,c=r.length;l<c;++l){const{start:n,end:c}=r[l],d=o[n],u=o[c];if(d===u){a.push(d);continue}const f=Math.abs((s-d[e])/(u[e]-d[e])),b=h(d,u,f,i.stepped);b[e]=t[e],a.push(b)}return 1===a.length?a[0]:a}pathSegment(t,e,i){const n=Ci(this);return n(t,this,e,i)}path(t,e,i){const n=this.segments,s=Ci(this);let o=this._loop;e=e||0,i=i||this.points.length-e;for(const r of n)o&=s(t,this,r,{start:e,end:e+i-1});return!!o}draw(t,e,i,n){const s=this.options||{},o=this.points||[];o.length&&s.borderWidth&&(t.save(),Ti(t,this,i,n),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function Ii(t,e,i,n){const s=t.options,{[i]:o}=t.getProps([i],n);return Math.abs(e-o)<s.radius+s.hitRadius}Ri.id="line",Ri.defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0},Ri.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"},Ri.descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};class zi extends st{constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){const n=this.options,{x:s,y:o}=this.getProps(["x","y"],i);return Math.pow(t-s,2)+Math.pow(e-o,2)<Math.pow(n.hitRadius+n.radius,2)}inXRange(t,e){return Ii(this,t,"x",e)}inYRange(t,e){return Ii(this,t,"y",e)}getCenterPoint(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}size(t){t=t||this.options||{};let e=t.radius||0;e=Math.max(e,e&&t.hoverRadius||0);const i=e&&t.borderWidth||0;return 2*(e+i)}draw(t,e){const i=this.options;this.skip||i.radius<.1||!Object(n["a"])(this,e,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,Object(n["wb"])(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function Fi(t,e){const{x:i,y:n,base:s,width:o,height:r}=t.getProps(["x","y","base","width","height"],e);let a,h,l,c,d;return t.horizontal?(d=r/2,a=Math.min(i,s),h=Math.max(i,s),l=n-d,c=n+d):(d=o/2,a=i-d,h=i+d,l=Math.min(n,s),c=Math.max(n,s)),{left:a,top:l,right:h,bottom:c}}function Wi(t,e,i,s){return t?0:Object(n["f"])(e,i,s)}function Bi(t,e,i){const s=t.options.borderWidth,o=t.borderSkipped,r=Object(n["yb"])(s);return{t:Wi(o.top,r.top,0,i),r:Wi(o.right,r.right,0,e),b:Wi(o.bottom,r.bottom,0,i),l:Wi(o.left,r.left,0,e)}}function Vi(t,e,i){const{enableBorderRadius:s}=t.getProps(["enableBorderRadius"]),o=t.options.borderRadius,r=Object(n["zb"])(o),a=Math.min(e,i),h=t.borderSkipped,l=s||Object(n["Jb"])(o);return{topLeft:Wi(!l||h.top||h.left,r.topLeft,0,a),topRight:Wi(!l||h.top||h.right,r.topRight,0,a),bottomLeft:Wi(!l||h.bottom||h.left,r.bottomLeft,0,a),bottomRight:Wi(!l||h.bottom||h.right,r.bottomRight,0,a)}}function Ni(t){const e=Fi(t),i=e.right-e.left,n=e.bottom-e.top,s=Bi(t,i/2,n/2),o=Vi(t,i/2,n/2);return{outer:{x:e.left,y:e.top,w:i,h:n,radius:o},inner:{x:e.left+s.l,y:e.top+s.t,w:i-s.l-s.r,h:n-s.t-s.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,o.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(s.b,s.r))}}}}function Hi(t,e,i,s){const o=null===e,r=null===i,a=o&&r,h=t&&!a&&Fi(t,s);return h&&(o||Object(n["mb"])(e,h.left,h.right))&&(r||Object(n["mb"])(i,h.top,h.bottom))}function $i(t){return t.topLeft||t.topRight||t.bottomLeft||t.bottomRight}function Yi(t,e){t.rect(e.x,e.y,e.w,e.h)}function Ui(t,e,i={}){const n=t.x!==i.x?-e:0,s=t.y!==i.y?-e:0,o=(t.x+t.w!==i.x+i.w?e:0)-n,r=(t.y+t.h!==i.y+i.h?e:0)-s;return{x:t.x+n,y:t.y+s,w:t.w+o,h:t.h+r,radius:t.radius}}zi.id="point",zi.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0},zi.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};class Xi extends st{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:i,backgroundColor:s}}=this,{inner:o,outer:r}=Ni(this),a=$i(r.radius)?n["xb"]:Yi;t.save(),r.w===o.w&&r.h===o.h||(t.beginPath(),a(t,Ui(r,e,o)),t.clip(),a(t,Ui(o,-e,r)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),a(t,Ui(o,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,i){return Hi(this,t,e,i)}inXRange(t,e){return Hi(this,t,null,e)}inYRange(t,e){return Hi(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:n,horizontal:s}=this.getProps(["x","y","base","horizontal"],t);return{x:s?(e+n)/2:e,y:s?i:(i+n)/2}}getRange(t){return"x"===t?this.width/2:this.height/2}}Xi.id="bar",Xi.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0},Xi.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};const qi=(t,e)=>{let{boxHeight:i=e,boxWidth:n=e}=t;return t.usePointStyle&&(i=Math.min(i,e),n=t.pointStyleWidth||Math.min(n,e)),{boxWidth:n,boxHeight:i,itemHeight:Math.max(e,i)}},Ji=(t,e)=>null!==t&&null!==e&&t.datasetIndex===e.datasetIndex&&t.index===e.index;class Ki extends st{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=Object(n["d"])(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(e=>t.filter(e,this.chart.data))),t.sort&&(e=e.sort((e,i)=>t.sort(e,i,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display)return void(this.width=this.height=0);const i=t.labels,s=Object(n["p"])(i.font),o=s.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:h}=qi(i,o);let l,c;e.font=s.string,this.isHorizontal()?(l=this.maxWidth,c=this._fitRows(r,o,a,h)+10):(c=this.maxHeight,l=this._fitCols(r,o,a,h)+10),this.width=Math.min(l,t.maxWidth||this.maxWidth),this.height=Math.min(c,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,n){const{ctx:s,maxWidth:o,options:{labels:{padding:r}}}=this,a=this.legendHitBoxes=[],h=this.lineWidths=[0],l=n+r;let c=t;s.textAlign="left",s.textBaseline="middle";let d=-1,u=-l;return this.legendItems.forEach((t,f)=>{const b=i+e/2+s.measureText(t.text).width;(0===f||h[h.length-1]+b+2*r>o)&&(c+=l,h[h.length-(f>0?0:1)]=0,u+=l,d++),a[f]={left:0,top:u,row:d,width:b,height:n},h[h.length-1]+=b+r}),c}_fitCols(t,e,i,n){const{ctx:s,maxHeight:o,options:{labels:{padding:r}}}=this,a=this.legendHitBoxes=[],h=this.columnSizes=[],l=o-t;let c=r,d=0,u=0,f=0,b=0;return this.legendItems.forEach((t,o)=>{const g=i+e/2+s.measureText(t.text).width;o>0&&u+n+2*r>l&&(c+=d+r,h.push({width:d,height:u}),f+=d+r,b++,d=u=0),a[o]={left:f,top:u,col:b,width:g,height:n},d=Math.max(d,g),u+=n+r}),c+=d,h.push({width:d,height:u}),c}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:s},rtl:o}}=this,r=Object(n["N"])(o,this.left,this.width);if(this.isHorizontal()){let o=0,a=Object(n["t"])(i,this.left+s,this.right-this.lineWidths[o]);for(const h of e)o!==h.row&&(o=h.row,a=Object(n["t"])(i,this.left+s,this.right-this.lineWidths[o])),h.top+=this.top+t+s,h.left=r.leftForLtr(r.x(a),h.width),a+=h.width+s}else{let o=0,a=Object(n["t"])(i,this.top+t+s,this.bottom-this.columnSizes[o].height);for(const h of e)h.col!==o&&(o=h.col,a=Object(n["t"])(i,this.top+t+s,this.bottom-this.columnSizes[o].height)),h.top=a,h.left+=this.left+s,h.left=r.leftForLtr(r.x(h.left),h.width),a+=h.height+s}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const t=this.ctx;Object(n["m"])(t,this),this._draw(),Object(n["o"])(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:s}=this,{align:o,labels:r}=t,a=n["Eb"].color,h=Object(n["N"])(t.rtl,this.left,this.width),l=Object(n["p"])(r.font),{color:c,padding:d}=r,u=l.size,f=u/2;let b;this.drawTitle(),s.textAlign=h.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=l.string;const{boxWidth:g,boxHeight:p,itemHeight:m}=qi(r,u),x=function(t,e,i){if(isNaN(g)||g<=0||isNaN(p)||p<0)return;s.save();const o=Object(n["Wb"])(i.lineWidth,1);if(s.fillStyle=Object(n["Wb"])(i.fillStyle,a),s.lineCap=Object(n["Wb"])(i.lineCap,"butt"),s.lineDashOffset=Object(n["Wb"])(i.lineDashOffset,0),s.lineJoin=Object(n["Wb"])(i.lineJoin,"miter"),s.lineWidth=o,s.strokeStyle=Object(n["Wb"])(i.strokeStyle,a),s.setLineDash(Object(n["Wb"])(i.lineDash,[])),r.usePointStyle){const a={radius:p*Math.SQRT2/2,pointStyle:i.pointStyle,rotation:i.rotation,borderWidth:o},l=h.xPlus(t,g/2),c=e+f;Object(n["R"])(s,a,l,c,r.pointStyleWidth&&g)}else{const r=e+Math.max((u-p)/2,0),a=h.leftForLtr(t,g),l=Object(n["zb"])(i.borderRadius);s.beginPath(),Object.values(l).some(t=>0!==t)?Object(n["xb"])(s,{x:a,y:r,w:g,h:p,radius:l}):s.rect(a,r,g,p),s.fill(),0!==o&&s.stroke()}s.restore()},_=function(t,e,i){Object(n["n"])(s,i.text,t,e+m/2,l,{strikethrough:i.hidden,textAlign:h.textAlign(i.textAlign)})},y=this.isHorizontal(),v=this._computeTitleHeight();b=y?{x:Object(n["t"])(o,this.left+d,this.right-i[0]),y:this.top+d+v,line:0}:{x:this.left+d,y:Object(n["t"])(o,this.top+v+d,this.bottom-e[0].height),line:0},Object(n["O"])(this.ctx,t.textDirection);const O=m+d;this.legendItems.forEach((a,l)=>{s.strokeStyle=a.fontColor||c,s.fillStyle=a.fontColor||c;const u=s.measureText(a.text).width,p=h.textAlign(a.textAlign||(a.textAlign=r.textAlign)),m=g+f+u;let w=b.x,j=b.y;h.setWidth(this.width),y?l>0&&w+m+d>this.right&&(j=b.y+=O,b.line++,w=b.x=Object(n["t"])(o,this.left+d,this.right-i[b.line])):l>0&&j+O>this.bottom&&(w=b.x=w+e[b.line].width+d,b.line++,j=b.y=Object(n["t"])(o,this.top+v+d,this.bottom-e[b.line].height));const M=h.x(w);x(M,j,a),w=Object(n["P"])(p,w+g+f,y?w+m:this.right,t.rtl),_(h.x(w),j,a),y?b.x+=m+d:b.y+=O}),Object(n["Q"])(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=Object(n["p"])(e.font),s=Object(n["l"])(e.padding);if(!e.display)return;const o=Object(n["N"])(t.rtl,this.left,this.width),r=this.ctx,a=e.position,h=i.size/2,l=s.top+h;let c,d=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),c=this.top+l,d=Object(n["t"])(t.align,d,this.right-u);else{const e=this.columnSizes.reduce((t,e)=>Math.max(t,e.height),0);c=l+Object(n["t"])(t.align,this.top,this.bottom-e-t.labels.padding-this._computeTitleHeight())}const f=Object(n["t"])(a,d,d+u);r.textAlign=o.textAlign(Object(n["s"])(a)),r.textBaseline="middle",r.strokeStyle=e.color,r.fillStyle=e.color,r.font=i.string,Object(n["n"])(r,e.text,f,c,i)}_computeTitleHeight(){const t=this.options.title,e=Object(n["p"])(t.font),i=Object(n["l"])(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,o;if(Object(n["mb"])(t,this.left,this.right)&&Object(n["mb"])(e,this.top,this.bottom))for(o=this.legendHitBoxes,i=0;i<o.length;++i)if(s=o[i],Object(n["mb"])(t,s.left,s.left+s.width)&&Object(n["mb"])(e,s.top,s.top+s.height))return this.legendItems[i];return null}handleEvent(t){const e=this.options;if(!Gi(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if("mousemove"===t.type||"mouseout"===t.type){const s=this._hoveredItem,o=Ji(s,i);s&&!o&&Object(n["d"])(e.onLeave,[t,s,this],this),this._hoveredItem=i,i&&!o&&Object(n["d"])(e.onHover,[t,i,this],this)}else i&&Object(n["d"])(e.onClick,[t,i,this],this)}}function Gi(t,e){return!("mousemove"!==t&&"mouseout"!==t||!e.onHover&&!e.onLeave)||!(!e.onClick||"click"!==t&&"mouseup"!==t)}var Zi={id:"legend",_element:Ki,start(t,e,i){const n=t.legend=new Ki({ctx:t.ctx,options:i,chart:t});he.configure(t,n,i),he.addBox(t,n)},stop(t){he.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,i){const n=t.legend;he.configure(t,n,i),n.options=i},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,i){const n=e.datasetIndex,s=i.chart;s.isDatasetVisible(n)?(s.hide(n),e.hidden=!0):(s.show(n),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:i,pointStyle:s,textAlign:o,color:r}}=t.legend.options;return t._getSortedDatasetMetas().map(t=>{const a=t.controller.getStyle(i?0:void 0),h=Object(n["l"])(a.borderWidth);return{text:e[t.index].label,fillStyle:a.backgroundColor,fontColor:r,hidden:!t.visible,lineCap:a.borderCapStyle,lineDash:a.borderDash,lineDashOffset:a.borderDashOffset,lineJoin:a.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:a.borderColor,pointStyle:s||a.pointStyle,rotation:a.rotation,textAlign:o||a.textAlign,borderRadius:0,datasetIndex:t.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class Qi extends st{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=t,this.height=this.bottom=e;const s=Object(n["Cb"])(i.text)?i.text.length:1;this._padding=Object(n["l"])(i.padding);const o=s*Object(n["p"])(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){const{top:e,left:i,bottom:s,right:o,options:r}=this,a=r.align;let h,l,c,d=0;return this.isHorizontal()?(l=Object(n["t"])(a,i,o),c=e+t,h=o-i):("left"===r.position?(l=i+t,c=Object(n["t"])(a,s,e),d=-.5*n["q"]):(l=o-t,c=Object(n["t"])(a,e,s),d=.5*n["q"]),h=s-e),{titleX:l,titleY:c,maxWidth:h,rotation:d}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=Object(n["p"])(e.font),s=i.lineHeight,o=s/2+this._padding.top,{titleX:r,titleY:a,maxWidth:h,rotation:l}=this._drawArgs(o);Object(n["n"])(t,e.text,0,0,i,{color:e.color,maxWidth:h,rotation:l,textAlign:Object(n["s"])(e.align),textBaseline:"middle",translation:[r,a]})}}function tn(t,e){const i=new Qi({ctx:t.ctx,options:e,chart:t});he.configure(t,i,e),he.addBox(t,i),t.titleBlock=i}var en={id:"title",_element:Qi,start(t,e,i){tn(t,i)},stop(t){const e=t.titleBlock;he.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){const n=t.titleBlock;he.configure(t,n,i),n.options=i},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};new WeakMap;const nn={average(t){if(!t.length)return!1;let e,i,n=0,s=0,o=0;for(e=0,i=t.length;e<i;++e){const i=t[e].element;if(i&&i.hasValue()){const t=i.tooltipPosition();n+=t.x,s+=t.y,++o}}return{x:n/o,y:s/o}},nearest(t,e){if(!t.length)return!1;let i,s,o,r=e.x,a=e.y,h=Number.POSITIVE_INFINITY;for(i=0,s=t.length;i<s;++i){const s=t[i].element;if(s&&s.hasValue()){const t=s.getCenterPoint(),i=Object(n["T"])(e,t);i<h&&(h=i,o=s)}}if(o){const t=o.tooltipPosition();r=t.x,a=t.y}return{x:r,y:a}}};function sn(t,e){return e&&(Object(n["Cb"])(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function on(t){return("string"===typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function rn(t,e){const{element:i,datasetIndex:n,index:s}=e,o=t.getDatasetMeta(n).controller,{label:r,value:a}=o.getLabelAndValue(s);return{chart:t,label:r,parsed:o.getParsed(s),raw:t.data.datasets[n].data[s],formattedValue:a,dataset:o.getDataset(),dataIndex:s,datasetIndex:n,element:i}}function an(t,e){const i=t.chart.ctx,{body:s,footer:o,title:r}=t,{boxWidth:a,boxHeight:h}=e,l=Object(n["p"])(e.bodyFont),c=Object(n["p"])(e.titleFont),d=Object(n["p"])(e.footerFont),u=r.length,f=o.length,b=s.length,g=Object(n["l"])(e.padding);let p=g.height,m=0,x=s.reduce((t,e)=>t+e.before.length+e.lines.length+e.after.length,0);if(x+=t.beforeBody.length+t.afterBody.length,u&&(p+=u*c.lineHeight+(u-1)*e.titleSpacing+e.titleMarginBottom),x){const t=e.displayColors?Math.max(h,l.lineHeight):l.lineHeight;p+=b*t+(x-b)*l.lineHeight+(x-1)*e.bodySpacing}f&&(p+=e.footerMarginTop+f*d.lineHeight+(f-1)*e.footerSpacing);let _=0;const y=function(t){m=Math.max(m,i.measureText(t).width+_)};return i.save(),i.font=c.string,Object(n["r"])(t.title,y),i.font=l.string,Object(n["r"])(t.beforeBody.concat(t.afterBody),y),_=e.displayColors?a+2+e.boxPadding:0,Object(n["r"])(s,t=>{Object(n["r"])(t.before,y),Object(n["r"])(t.lines,y),Object(n["r"])(t.after,y)}),_=0,i.font=d.string,Object(n["r"])(t.footer,y),i.restore(),m+=g.width,{width:m,height:p}}function hn(t,e){const{y:i,height:n}=e;return i<n/2?"top":i>t.height-n/2?"bottom":"center"}function ln(t,e,i,n){const{x:s,width:o}=n,r=i.caretSize+i.caretPadding;return"left"===t&&s+o+r>e.width||("right"===t&&s-o-r<0||void 0)}function cn(t,e,i,n){const{x:s,width:o}=i,{width:r,chartArea:{left:a,right:h}}=t;let l="center";return"center"===n?l=s<=(a+h)/2?"left":"right":s<=o/2?l="left":s>=r-o/2&&(l="right"),ln(l,t,e,i)&&(l="center"),l}function dn(t,e,i){const n=i.yAlign||e.yAlign||hn(t,i);return{xAlign:i.xAlign||e.xAlign||cn(t,e,i,n),yAlign:n}}function un(t,e){let{x:i,width:n}=t;return"right"===e?i-=n:"center"===e&&(i-=n/2),i}function fn(t,e,i){let{y:n,height:s}=t;return"top"===e?n+=i:n-="bottom"===e?s+i:s/2,n}function bn(t,e,i,s){const{caretSize:o,caretPadding:r,cornerRadius:a}=t,{xAlign:h,yAlign:l}=i,c=o+r,{topLeft:d,topRight:u,bottomLeft:f,bottomRight:b}=Object(n["zb"])(a);let g=un(e,h);const p=fn(e,l,c);return"center"===l?"left"===h?g+=c:"right"===h&&(g-=c):"left"===h?g-=Math.max(d,f)+o:"right"===h&&(g+=Math.max(u,b)+o),{x:Object(n["f"])(g,0,s.width-e.width),y:Object(n["f"])(p,0,s.height-e.height)}}function gn(t,e,i){const s=Object(n["l"])(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-s.right:t.x+s.left}function pn(t){return sn([],on(t))}function mn(t,e,i){return Object(n["Ib"])(t,{tooltip:e,tooltipItems:i,type:"tooltip"})}function xn(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}class _n extends st{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart||t._chart,this._chart=this.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),n=i.enabled&&e.options.animation&&i.animations,s=new u(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=mn(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,n=i.beforeTitle.apply(this,[t]),s=i.title.apply(this,[t]),o=i.afterTitle.apply(this,[t]);let r=[];return r=sn(r,on(n)),r=sn(r,on(s)),r=sn(r,on(o)),r}getBeforeBody(t,e){return pn(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){const{callbacks:i}=e,s=[];return Object(n["r"])(t,t=>{const e={before:[],lines:[],after:[]},n=xn(i,t);sn(e.before,on(n.beforeLabel.call(this,t))),sn(e.lines,n.label.call(this,t)),sn(e.after,on(n.afterLabel.call(this,t))),s.push(e)}),s}getAfterBody(t,e){return pn(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){const{callbacks:i}=e,n=i.beforeFooter.apply(this,[t]),s=i.footer.apply(this,[t]),o=i.afterFooter.apply(this,[t]);let r=[];return r=sn(r,on(n)),r=sn(r,on(s)),r=sn(r,on(o)),r}_createItems(t){const e=this._active,i=this.chart.data,s=[],o=[],r=[];let a,h,l=[];for(a=0,h=e.length;a<h;++a)l.push(rn(this.chart,e[a]));return t.filter&&(l=l.filter((e,n,s)=>t.filter(e,n,s,i))),t.itemSort&&(l=l.sort((e,n)=>t.itemSort(e,n,i))),Object(n["r"])(l,e=>{const i=xn(t.callbacks,e);s.push(i.labelColor.call(this,e)),o.push(i.labelPointStyle.call(this,e)),r.push(i.labelTextColor.call(this,e))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=l,l}update(t,e){const i=this.options.setContext(this.getContext()),n=this._active;let s,o=[];if(n.length){const t=nn[i.position].call(this,n,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const e=this._size=an(this,i),r=Object.assign({},t,e),a=dn(this.chart,i,r),h=bn(i,r,a,this.chart);this.xAlign=a.xAlign,this.yAlign=a.yAlign,s={opacity:1,x:h.x,y:h.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(s={opacity:0});this._tooltipItems=o,this.$context=void 0,s&&this._resolveAnimations().update(this,s),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,n){const s=this.getCaretPosition(t,i,n);e.lineTo(s.x1,s.y1),e.lineTo(s.x2,s.y2),e.lineTo(s.x3,s.y3)}getCaretPosition(t,e,i){const{xAlign:s,yAlign:o}=this,{caretSize:r,cornerRadius:a}=i,{topLeft:h,topRight:l,bottomLeft:c,bottomRight:d}=Object(n["zb"])(a),{x:u,y:f}=t,{width:b,height:g}=e;let p,m,x,_,y,v;return"center"===o?(y=f+g/2,"left"===s?(p=u,m=p-r,_=y+r,v=y-r):(p=u+b,m=p+r,_=y-r,v=y+r),x=p):(m="left"===s?u+Math.max(h,c)+r:"right"===s?u+b-Math.max(l,d)-r:this.caretX,"top"===o?(_=f,y=_-r,p=m-r,x=m+r):(_=f+g,y=_+r,p=m+r,x=m-r),v=_),{x1:p,x2:m,x3:x,y1:_,y2:y,y3:v}}drawTitle(t,e,i){const s=this.title,o=s.length;let r,a,h;if(o){const l=Object(n["N"])(i.rtl,this.x,this.width);for(t.x=gn(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",r=Object(n["p"])(i.titleFont),a=i.titleSpacing,e.fillStyle=i.titleColor,e.font=r.string,h=0;h<o;++h)e.fillText(s[h],l.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+a,h+1===o&&(t.y+=i.titleMarginBottom-a)}}_drawColorBox(t,e,i,s,o){const r=this.labelColors[i],a=this.labelPointStyles[i],{boxHeight:h,boxWidth:l,boxPadding:c}=o,d=Object(n["p"])(o.bodyFont),u=gn(this,"left",o),f=s.x(u),b=h<d.lineHeight?(d.lineHeight-h)/2:0,g=e.y+b;if(o.usePointStyle){const e={radius:Math.min(l,h)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},i=s.leftForLtr(f,l)+l/2,c=g+h/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,Object(n["wb"])(t,e,i,c),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,Object(n["wb"])(t,e,i,c)}else{t.lineWidth=Object(n["Jb"])(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;const e=s.leftForLtr(f,l-c),i=s.leftForLtr(s.xPlus(f,1),l-c-2),a=Object(n["zb"])(r.borderRadius);Object.values(a).some(t=>0!==t)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,Object(n["xb"])(t,{x:e,y:g,w:l,h:h,radius:a}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),Object(n["xb"])(t,{x:i,y:g+1,w:l-2,h:h-2,radius:a}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(e,g,l,h),t.strokeRect(e,g,l,h),t.fillStyle=r.backgroundColor,t.fillRect(i,g+1,l-2,h-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:s}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:h,boxWidth:l,boxPadding:c}=i,d=Object(n["p"])(i.bodyFont);let u=d.lineHeight,f=0;const b=Object(n["N"])(i.rtl,this.x,this.width),g=function(i){e.fillText(i,b.x(t.x+f),t.y+u/2),t.y+=u+o},p=b.textAlign(r);let m,x,_,y,v,O,w;for(e.textAlign=r,e.textBaseline="middle",e.font=d.string,t.x=gn(this,p,i),e.fillStyle=i.bodyColor,Object(n["r"])(this.beforeBody,g),f=a&&"right"!==p?"center"===r?l/2+c:l+2+c:0,y=0,O=s.length;y<O;++y){for(m=s[y],x=this.labelTextColors[y],e.fillStyle=x,Object(n["r"])(m.before,g),_=m.lines,a&&_.length&&(this._drawColorBox(e,t,y,b,i),u=Math.max(d.lineHeight,h)),v=0,w=_.length;v<w;++v)g(_[v]),u=d.lineHeight;Object(n["r"])(m.after,g)}f=0,u=d.lineHeight,Object(n["r"])(this.afterBody,g),t.y-=o}drawFooter(t,e,i){const s=this.footer,o=s.length;let r,a;if(o){const h=Object(n["N"])(i.rtl,this.x,this.width);for(t.x=gn(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=h.textAlign(i.footerAlign),e.textBaseline="middle",r=Object(n["p"])(i.footerFont),e.fillStyle=i.footerColor,e.font=r.string,a=0;a<o;++a)e.fillText(s[a],h.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+i.footerSpacing}}drawBackground(t,e,i,s){const{xAlign:o,yAlign:r}=this,{x:a,y:h}=t,{width:l,height:c}=i,{topLeft:d,topRight:u,bottomLeft:f,bottomRight:b}=Object(n["zb"])(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(a+d,h),"top"===r&&this.drawCaret(t,e,i,s),e.lineTo(a+l-u,h),e.quadraticCurveTo(a+l,h,a+l,h+u),"center"===r&&"right"===o&&this.drawCaret(t,e,i,s),e.lineTo(a+l,h+c-b),e.quadraticCurveTo(a+l,h+c,a+l-b,h+c),"bottom"===r&&this.drawCaret(t,e,i,s),e.lineTo(a+f,h+c),e.quadraticCurveTo(a,h+c,a,h+c-f),"center"===r&&"left"===o&&this.drawCaret(t,e,i,s),e.lineTo(a,h+d),e.quadraticCurveTo(a,h,a+d,h),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,n=i&&i.x,s=i&&i.y;if(n||s){const i=nn[t.position].call(this,this._active,this._eventPosition);if(!i)return;const o=this._size=an(this,t),r=Object.assign({},i,this._size),a=dn(e,t,r),h=bn(t,r,a,e);n._to===h.x&&s._to===h.y||(this.xAlign=a.xAlign,this.yAlign=a.yAlign,this.width=o.width,this.height=o.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},o={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const r=Object(n["l"])(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(o,t,s,e),Object(n["O"])(t,e.textDirection),o.y+=r.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),Object(n["Q"])(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,s=t.map(({datasetIndex:t,index:e})=>{const i=this.chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}),o=!Object(n["kb"])(i,s),r=this._positionChanged(s,e);(o||r)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,o=this._active||[],r=this._getActiveElements(t,o,e,i),a=this._positionChanged(r,t),h=e||!Object(n["kb"])(r,o)||a;return h&&(this._active=r,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),h}_getActiveElements(t,e,i,n){const s=this.options;if("mouseout"===t.type)return[];if(!n)return e;const o=this.chart.getElementsAtEventForMode(t,s.mode,s,i);return s.reverse&&o.reverse(),o}_positionChanged(t,e){const{caretX:i,caretY:n,options:s}=this,o=nn[s.position].call(this,t,e);return!1!==o&&(i!==o.x||n!==o.y)}}_n.positioners=nn;var yn={id:"tooltip",_element:_n,positioners:nn,afterInit(t,e,i){i&&(t.tooltip=new _n({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const i={tooltip:e};if(!1===t.notifyPlugins("beforeTooltipDraw",i))return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i)}},afterEvent(t,e){if(t.tooltip){const i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:n["S"],title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,n=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(n>0&&e.dataIndex<n)return i[e.dataIndex]}return""},afterTitle:n["S"],beforeBody:n["S"],beforeLabel:n["S"],label(t){if(this&&this.options&&"dataset"===this.options.mode)return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const i=t.formattedValue;return Object(n["Lb"])(i)||(e+=i),e},labelColor(t){const e=t.chart.getDatasetMeta(t.datasetIndex),i=e.controller.getStyle(t.dataIndex);return{borderColor:i.borderColor,backgroundColor:i.backgroundColor,borderWidth:i.borderWidth,borderDash:i.borderDash,borderDashOffset:i.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const e=t.chart.getDatasetMeta(t.datasetIndex),i=e.controller.getStyle(t.dataIndex);return{pointStyle:i.pointStyle,rotation:i.rotation}},afterLabel:n["S"],afterBody:n["S"],beforeFooter:n["S"],footer:n["S"],afterFooter:n["S"]}},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const vn=(t,e,i,n)=>("string"===typeof e?(i=t.push(e)-1,n.unshift({index:i,label:e})):isNaN(e)&&(i=null),i);function On(t,e,i,n){const s=t.indexOf(e);if(-1===s)return vn(t,e,i,n);const o=t.lastIndexOf(e);return s!==o?i:s}const wn=(t,e)=>null===t?null:Object(n["f"])(Math.round(t),0,e);class jn extends kt{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const t=this.getLabels();for(const{index:i,label:n}of e)t[i]===n&&t.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(Object(n["Lb"])(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:On(i,t,Object(n["Wb"])(e,t),this._addedLabels),wn(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:n}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(n=this.getLabels().length-1)),this.min=i,this.max=n}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,n=[];let s=this.getLabels();s=0===t&&e===s.length-1?s:s.slice(t,e+1),this._valueRange=Math.max(s.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let o=t;o<=e;o++)n.push({value:o});return n}getLabelForValue(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return"number"!==typeof t&&(t=this.parse(t)),null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function Mn(t,e){const i=[],s=1e-14,{bounds:o,step:r,min:a,max:h,precision:l,count:c,maxTicks:d,maxDigits:u,includeBounds:f}=t,b=r||1,g=d-1,{min:p,max:m}=e,x=!Object(n["Lb"])(a),_=!Object(n["Lb"])(h),y=!Object(n["Lb"])(c),v=(m-p)/(u+1);let O,w,j,M,k=Object(n["V"])((m-p)/g/b)*b;if(k<s&&!x&&!_)return[{value:p},{value:m}];M=Math.ceil(m/k)-Math.floor(p/k),M>g&&(k=Object(n["V"])(M*k/g/b)*b),Object(n["Lb"])(l)||(O=Math.pow(10,l),k=Math.ceil(k*O)/O),"ticks"===o?(w=Math.floor(p/k)*k,j=Math.ceil(m/k)*k):(w=p,j=m),x&&_&&r&&Object(n["W"])((h-a)/r,k/1e3)?(M=Math.round(Math.min((h-a)/k,d)),k=(h-a)/M,w=a,j=h):y?(w=x?a:w,j=_?h:j,M=c-1,k=(j-w)/M):(M=(j-w)/k,M=Object(n["X"])(M,Math.round(M),k/1e3)?Math.round(M):Math.ceil(M));const S=Math.max(Object(n["Y"])(k),Object(n["Y"])(w));O=Math.pow(10,Object(n["Lb"])(l)?S:l),w=Math.round(w*O)/O,j=Math.round(j*O)/O;let P=0;for(x&&(f&&w!==a?(i.push({value:a}),w<a&&P++,Object(n["X"])(Math.round((w+P*k)*O)/O,a,kn(a,v,t))&&P++):w<a&&P++);P<M;++P)i.push({value:Math.round((w+P*k)*O)/O});return _&&f&&j!==h?i.length&&Object(n["X"])(i[i.length-1].value,h,kn(h,v,t))?i[i.length-1].value=h:i.push({value:h}):_&&j!==h||i.push({value:j}),i}function kn(t,e,{horizontal:i,minRotation:s}){const o=Object(n["Ub"])(s),r=(i?Math.sin(o):Math.cos(o))||.001,a=.75*e*(""+t).length;return Math.min(e/r,a)}jn.id="category",jn.defaults={ticks:{callback:jn.prototype.getLabelForValue}};class Sn extends kt{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return Object(n["Lb"])(t)||("number"===typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:s,max:o}=this;const r=t=>s=e?s:t,a=t=>o=i?o:t;if(t){const t=Object(n["Tb"])(s),e=Object(n["Tb"])(o);t<0&&e<0?a(0):t>0&&e>0&&r(0)}if(s===o){let e=1;(o>=Number.MAX_SAFE_INTEGER||s<=Number.MIN_SAFE_INTEGER)&&(e=Math.abs(.05*o)),a(o+e),t||r(s-e)}this.min=s,this.max=o}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:n}=t;return n?(e=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},o=this._range||this,r=Mn(s,o);return"ticks"===t.bounds&&Object(n["U"])(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const n=(i-e)/Math.max(t.length-1,1)/2;e-=n,i+=n}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return Object(n["Pb"])(t,this.chart.options.locale,this.options.ticks.format)}}class Pn extends Sn{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Object(n["Hb"])(t)?t:0,this.max=Object(n["Hb"])(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=Object(n["Ub"])(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/s))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}function Cn(t){const e=t/Math.pow(10,Math.floor(Object(n["ac"])(t)));return 1===e}function Dn(t,e){const i=Math.floor(Object(n["ac"])(e.max)),s=Math.ceil(e.max/Math.pow(10,i)),o=[];let r=Object(n["c"])(t.min,Math.pow(10,Math.floor(Object(n["ac"])(e.min)))),a=Math.floor(Object(n["ac"])(r)),h=Math.floor(r/Math.pow(10,a)),l=a<0?Math.pow(10,Math.abs(a)):1;do{o.push({value:r,major:Cn(r)}),++h,10===h&&(h=1,++a,l=a>=0?1:l),r=Math.round(h*Math.pow(10,a)*l)/l}while(a<i||a===i&&h<s);const c=Object(n["c"])(t.max,r);return o.push({value:c,major:Cn(r)}),o}Pn.id="linear",Pn.defaults={ticks:{callback:at.formatters.numeric}};class An extends kt{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=Sn.prototype.parse.apply(this,[t,e]);if(0!==i)return Object(n["Hb"])(i)&&i>0?i:null;this._zero=!0}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Object(n["Hb"])(t)?Math.max(0,t):null,this.max=Object(n["Hb"])(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,s=this.max;const o=e=>i=t?i:e,r=t=>s=e?s:t,a=(t,e)=>Math.pow(10,Math.floor(Object(n["ac"])(t))+e);i===s&&(i<=0?(o(1),r(10)):(o(a(i,-1)),r(a(s,1)))),i<=0&&o(a(s,-1)),s<=0&&r(a(i,1)),this._zero&&this.min!==this._suggestedMin&&i===a(this.min,0)&&o(a(i,-1)),this.min=i,this.max=s}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=Dn(e,this);return"ticks"===t.bounds&&Object(n["U"])(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return void 0===t?"0":Object(n["Pb"])(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Object(n["ac"])(t),this._valueRange=Object(n["ac"])(this.max)-Object(n["ac"])(t)}getPixelForValue(t){return void 0!==t&&0!==t||(t=this.min),null===t||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Object(n["ac"])(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function Ln(t){const e=t.ticks;if(e.display&&t.display){const t=Object(n["l"])(e.backdropPadding);return Object(n["Wb"])(e.font&&e.font.size,n["Eb"].font.size)+t.height}return 0}function En(t,e,i){return i=Object(n["Cb"])(i)?i:[i],{w:Object(n["Z"])(t,e.string,i),h:i.length*e.lineHeight}}function Tn(t,e,i,n,s){return t===n||t===s?{start:e-i/2,end:e+i/2}:t<n||t>s?{start:e-i,end:e}:{start:e,end:e+i}}function Rn(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},i=Object.assign({},e),s=[],o=[],r=t._pointLabels.length,a=t.options.pointLabels,h=a.centerPointLabels?n["q"]/r:0;for(let l=0;l<r;l++){const r=a.setContext(t.getPointLabelContext(l));o[l]=r.padding;const c=t.getPointPosition(l,t.drawingArea+o[l],h),d=Object(n["p"])(r.font),u=En(t.ctx,d,t._pointLabels[l]);s[l]=u;const f=Object(n["Bb"])(t.getIndexAngle(l)+h),b=Math.round(Object(n["g"])(f)),g=Tn(b,c.x,u.w,0,180),p=Tn(b,c.y,u.h,90,270);In(i,e,f,g,p)}t.setCenterPoint(e.l-i.l,i.r-e.r,e.t-i.t,i.b-e.b),t._pointLabelItems=zn(t,s,o)}function In(t,e,i,n,s){const o=Math.abs(Math.sin(i)),r=Math.abs(Math.cos(i));let a=0,h=0;n.start<e.l?(a=(e.l-n.start)/o,t.l=Math.min(t.l,e.l-a)):n.end>e.r&&(a=(n.end-e.r)/o,t.r=Math.max(t.r,e.r+a)),s.start<e.t?(h=(e.t-s.start)/r,t.t=Math.min(t.t,e.t-h)):s.end>e.b&&(h=(s.end-e.b)/r,t.b=Math.max(t.b,e.b+h))}function zn(t,e,i){const s=[],o=t._pointLabels.length,r=t.options,a=Ln(r)/2,h=t.drawingArea,l=r.pointLabels.centerPointLabels?n["q"]/o:0;for(let c=0;c<o;c++){const o=t.getPointPosition(c,h+a+i[c],l),r=Math.round(Object(n["g"])(Object(n["Bb"])(o.angle+n["i"]))),d=e[c],u=Bn(o.y,d.h,r),f=Fn(r),b=Wn(o.x,d.w,f);s.push({x:o.x,y:u,textAlign:f,left:b,top:u,right:b+d.w,bottom:u+d.h})}return s}function Fn(t){return 0===t||180===t?"center":t<180?"left":"right"}function Wn(t,e,i){return"right"===i?t-=e:"center"===i&&(t-=e/2),t}function Bn(t,e,i){return 90===i||270===i?t-=e/2:(i>270||i<90)&&(t-=e),t}function Vn(t,e){const{ctx:i,options:{pointLabels:s}}=t;for(let o=e-1;o>=0;o--){const e=s.setContext(t.getPointLabelContext(o)),r=Object(n["p"])(e.font),{x:a,y:h,textAlign:l,left:c,top:d,right:u,bottom:f}=t._pointLabelItems[o],{backdropColor:b}=e;if(!Object(n["Lb"])(b)){const t=Object(n["zb"])(e.borderRadius),s=Object(n["l"])(e.backdropPadding);i.fillStyle=b;const o=c-s.left,r=d-s.top,a=u-c+s.width,h=f-d+s.height;Object.values(t).some(t=>0!==t)?(i.beginPath(),Object(n["xb"])(i,{x:o,y:r,w:a,h:h,radius:t}),i.fill()):i.fillRect(o,r,a,h)}Object(n["n"])(i,t._pointLabels[o],a,h+r.lineHeight/2,r,{color:e.color,textAlign:l,textBaseline:"middle"})}}function Nn(t,e,i,s){const{ctx:o}=t;if(i)o.arc(t.xCenter,t.yCenter,e,0,n["u"]);else{let i=t.getPointPosition(0,e);o.moveTo(i.x,i.y);for(let n=1;n<s;n++)i=t.getPointPosition(n,e),o.lineTo(i.x,i.y)}}function Hn(t,e,i,n){const s=t.ctx,o=e.circular,{color:r,lineWidth:a}=e;!o&&!n||!r||!a||i<0||(s.save(),s.strokeStyle=r,s.lineWidth=a,s.setLineDash(e.borderDash),s.lineDashOffset=e.borderDashOffset,s.beginPath(),Nn(t,i,o,n),s.closePath(),s.stroke(),s.restore())}function $n(t,e,i){return Object(n["Ib"])(t,{label:i,index:e,type:"pointLabel"})}An.id="logarithmic",An.defaults={ticks:{callback:at.formatters.logarithmic,major:{enabled:!0}}};class Yn extends Sn{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=Object(n["l"])(Ln(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=Object(n["Hb"])(t)&&!isNaN(t)?t:0,this.max=Object(n["Hb"])(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Ln(this.options))}generateTickLabels(t){Sn.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((t,e)=>{const i=Object(n["d"])(this.options.pointLabels.callback,[t,e],this);return i||0===i?i:""}).filter((t,e)=>this.chart.getDataVisibility(e))}fit(){const t=this.options;t.display&&t.pointLabels.display?Rn(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,n){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-n)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,n))}getIndexAngle(t){const e=n["u"]/(this._pointLabels.length||1),i=this.options.startAngle||0;return Object(n["Bb"])(t*e+Object(n["Ub"])(i))}getDistanceFromCenterForValue(t){if(Object(n["Lb"])(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(Object(n["Lb"])(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const i=e[t];return $n(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const s=this.getIndexAngle(t)-n["i"]+i;return{x:Math.cos(s)*e+this.xCenter,y:Math.sin(s)*e+this.yCenter,angle:s}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:i,right:n,bottom:s}=this._pointLabelItems[t];return{left:e,top:i,right:n,bottom:s}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),Nn(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:n}=e,s=this._pointLabels.length;let o,r,a;if(e.pointLabels.display&&Vn(this,s),n.display&&this.ticks.forEach((t,e)=>{if(0!==e){r=this.getDistanceFromCenterForValue(t.value);const i=n.setContext(this.getContext(e-1));Hn(this,i,r,s)}}),i.display){for(t.save(),o=s-1;o>=0;o--){const n=i.setContext(this.getPointLabelContext(o)),{color:s,lineWidth:h}=n;h&&s&&(t.lineWidth=h,t.strokeStyle=s,t.setLineDash(n.borderDash),t.lineDashOffset=n.borderDashOffset,r=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),a=this.getPointPosition(o,r),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(a.x,a.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let o,r;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((s,a)=>{if(0===a&&!e.reverse)return;const h=i.setContext(this.getContext(a)),l=Object(n["p"])(h.font);if(o=this.getDistanceFromCenterForValue(this.ticks[a].value),h.showLabelBackdrop){t.font=l.string,r=t.measureText(s.label).width,t.fillStyle=h.backdropColor;const e=Object(n["l"])(h.backdropPadding);t.fillRect(-r/2-e.left,-o-l.size/2-e.top,r+e.width,l.size+e.height)}Object(n["n"])(t,s.label,0,-o,l,{color:h.color})}),t.restore()}drawTitle(){}}Yn.id="radialLinear",Yn.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:at.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}},Yn.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},Yn.descriptors={angleLines:{_fallback:"grid"}};const Un={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}},Xn=Object.keys(Un);function qn(t,e){return t-e}function Jn(t,e){if(Object(n["Lb"])(e))return null;const i=t._adapter,{parser:s,round:o,isoWeekday:r}=t._parseOpts;let a=e;return"function"===typeof s&&(a=s(a)),Object(n["Hb"])(a)||(a="string"===typeof s?i.parse(a,s):i.parse(a)),null===a?null:(o&&(a="week"!==o||!Object(n["Yb"])(r)&&!0!==r?i.startOf(a,o):i.startOf(a,"isoWeek",r)),+a)}function Kn(t,e,i,n){const s=Xn.length;for(let o=Xn.indexOf(t);o<s-1;++o){const t=Un[Xn[o]],s=t.steps?t.steps:Number.MAX_SAFE_INTEGER;if(t.common&&Math.ceil((i-e)/(s*t.size))<=n)return Xn[o]}return Xn[s-1]}function Gn(t,e,i,n,s){for(let o=Xn.length-1;o>=Xn.indexOf(i);o--){const i=Xn[o];if(Un[i].common&&t._adapter.diff(s,n,i)>=e-1)return i}return Xn[i?Xn.indexOf(i):0]}function Zn(t){for(let e=Xn.indexOf(t)+1,i=Xn.length;e<i;++e)if(Un[Xn[e]].common)return Xn[e]}function Qn(t,e,i){if(i){if(i.length){const{lo:s,hi:o}=Object(n["bb"])(i,e),r=i[s]>=e?i[s]:i[o];t[r]=!0}}else t[e]=!0}function ts(t,e,i,n){const s=t._adapter,o=+s.startOf(e[0].value,n),r=e[e.length-1].value;let a,h;for(a=o;a<=r;a=+s.add(a,1,n))h=i[a],h>=0&&(e[h].major=!0);return e}function es(t,e,i){const n=[],s={},o=e.length;let r,a;for(r=0;r<o;++r)a=e[r],s[a]=r,n.push({value:a,major:!1});return 0!==o&&i?ts(t,n,s,i):n}class is extends kt{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e){const i=t.time||(t.time={}),s=this._adapter=new It._date(t.adapters.date);s.init(e),Object(n["eb"])(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:Jn(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:s,max:o,minDefined:r,maxDefined:a}=this.getUserBounds();function h(t){r||isNaN(t.min)||(s=Math.min(s,t.min)),a||isNaN(t.max)||(o=Math.max(o,t.max))}r&&a||(h(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||h(this.getMinMax(!1))),s=Object(n["Hb"])(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),o=Object(n["Hb"])(o)&&!isNaN(o)?o:+e.endOf(Date.now(),i)+1,this.min=Math.min(s,o-1),this.max=Math.max(s+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,s="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const o=this.min,r=this.max,a=Object(n["ab"])(s,o,r);return this._unit=e.unit||(i.autoSkip?Kn(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):Gn(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?Zn(this._unit):void 0,this.initOffsets(s),t.reverse&&a.reverse(),es(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t){let e,i,s=0,o=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),s=1===t.length?1-e:(this.getDecimalForValue(t[1])-e)/2,i=this.getDecimalForValue(t[t.length-1]),o=1===t.length?i:(i-this.getDecimalForValue(t[t.length-2]))/2);const r=t.length<3?.5:.25;s=Object(n["f"])(s,0,r),o=Object(n["f"])(o,0,r),this._offsets={start:s,end:o,factor:1/(s+1+o)}}_generate(){const t=this._adapter,e=this.min,i=this.max,s=this.options,o=s.time,r=o.unit||Kn(o.minUnit,e,i,this._getLabelCapacity(e)),a=Object(n["Wb"])(o.stepSize,1),h="week"===r&&o.isoWeekday,l=Object(n["Yb"])(h)||!0===h,c={};let d,u,f=e;if(l&&(f=+t.startOf(f,"isoWeek",h)),f=+t.startOf(f,l?"day":r),t.diff(i,e,r)>1e5*a)throw new Error(e+" and "+i+" are too far apart with stepSize of "+a+" "+r);const b="data"===s.ticks.source&&this.getDataTimestamps();for(d=f,u=0;d<i;d=+t.add(d,a,r),u++)Qn(c,d,b);return d!==i&&"ticks"!==s.bounds&&1!==u||Qn(c,d,b),Object.keys(c).sort((t,e)=>t-e).map(t=>+t)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}_tickFormatFunction(t,e,i,s){const o=this.options,r=o.time.displayFormats,a=this._unit,h=this._majorUnit,l=a&&r[a],c=h&&r[h],d=i[e],u=h&&c&&d&&d.major,f=this._adapter.format(t,s||(u?c:l)),b=o.ticks.callback;return b?Object(n["d"])(b,[f,e,i],this):f}generateTickLabels(t){let e,i,n;for(e=0,i=t.length;e<i;++e)n=t[e],n.label=this._tickFormatFunction(n.value,e,t)}getDecimalForValue(t){return null===t?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,s=Object(n["Ub"])(this.isHorizontal()?e.maxRotation:e.minRotation),o=Math.cos(s),r=Math.sin(s),a=this._resolveTickFontOptions(0).size;return{w:i*o+a*r,h:i*r+a*o}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,n=i[e.unit]||i.millisecond,s=this._tickFormatFunction(t,0,es(this,[t],this._majorUnit),n),o=this._getLabelSize(s),r=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return r>0?r:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(t=0,e=n.length;t<e;++t)i=i.concat(n[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(i)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const n=this.getLabels();for(e=0,i=n.length;e<i;++e)t.push(Jn(this,n[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Object(n["B"])(t.sort(qn))}}function ns(t,e,i){let s,o,r,a,h=0,l=t.length-1;i?(e>=t[h].pos&&e<=t[l].pos&&({lo:h,hi:l}=Object(n["A"])(t,"pos",e)),({pos:s,time:r}=t[h]),({pos:o,time:a}=t[l])):(e>=t[h].time&&e<=t[l].time&&({lo:h,hi:l}=Object(n["A"])(t,"time",e)),({time:s,pos:r}=t[h]),({time:o,pos:a}=t[l]));const c=o-s;return c?r+(a-r)*(e-s)/c:r}is.id="time",is.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};class ss extends is{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=ns(e,this.min),this._tableRange=ns(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,n=[],s=[];let o,r,a,h,l;for(o=0,r=t.length;o<r;++o)h=t[o],h>=e&&h<=i&&n.push(h);if(n.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(o=0,r=n.length;o<r;++o)l=n[o+1],a=n[o-1],h=n[o],Math.round((l+a)/2)!==h&&s.push({time:h,pos:o/(r-1)});return s}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return t=e.length&&i.length?this.normalize(e.concat(i)):e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(ns(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return ns(this._table,i*this._tableRange+this._minPos,!0)}}ss.id="timeseries",ss.defaults=is.defaults},e369:function(t,e,i){"use strict";i.d(e,"a",(function(){return Le})),i.d(e,"b",(function(){return N})),i.d(e,"c",(function(){return l})),i.d(e,"d",(function(){return f})),i.d(e,"e",(function(){return Ge})),i.d(e,"f",(function(){return et})),i.d(e,"g",(function(){return q})),i.d(e,"h",(function(){return ke})),i.d(e,"i",(function(){return I})),i.d(e,"j",(function(){return it})),i.d(e,"k",(function(){return Pe})),i.d(e,"l",(function(){return qe})),i.d(e,"m",(function(){return Ee})),i.d(e,"n",(function(){return ze})),i.d(e,"o",(function(){return Te})),i.d(e,"p",(function(){return Je})),i.d(e,"q",(function(){return A})),i.d(e,"r",(function(){return b})),i.d(e,"s",(function(){return gt})),i.d(e,"t",(function(){return pt})),i.d(e,"u",(function(){return L})),i.d(e,"v",(function(){return _e})),i.d(e,"w",(function(){return _})),i.d(e,"x",(function(){return k})),i.d(e,"y",(function(){return Fi})),i.d(e,"z",(function(){return rt})),i.d(e,"A",(function(){return ot})),i.d(e,"B",(function(){return dt})),i.d(e,"C",(function(){return Ke})),i.d(e,"D",(function(){return K})),i.d(e,"E",(function(){return Vi})),i.d(e,"F",(function(){return Di})),i.d(e,"G",(function(){return $i})),i.d(e,"H",(function(){return ft})),i.d(e,"I",(function(){return Hi})),i.d(e,"J",(function(){return Ci})),i.d(e,"K",(function(){return ye})),i.d(e,"L",(function(){return P})),i.d(e,"M",(function(){return ti})),i.d(e,"N",(function(){return Qi})),i.d(e,"O",(function(){return tn})),i.d(e,"P",(function(){return mt})),i.d(e,"Q",(function(){return en})),i.d(e,"R",(function(){return Ae})),i.d(e,"S",(function(){return n})),i.d(e,"T",(function(){return G})),i.d(e,"U",(function(){return U})),i.d(e,"V",(function(){return V})),i.d(e,"W",(function(){return Y})),i.d(e,"X",(function(){return $})),i.d(e,"Y",(function(){return J})),i.d(e,"Z",(function(){return Se})),i.d(e,"ab",(function(){return at})),i.d(e,"bb",(function(){return st})),i.d(e,"cb",(function(){return Qe})),i.d(e,"db",(function(){return ei})),i.d(e,"eb",(function(){return y})),i.d(e,"fb",(function(){return s})),i.d(e,"gb",(function(){return bt})),i.d(e,"hb",(function(){return Ni})),i.d(e,"ib",(function(){return Ce})),i.d(e,"jb",(function(){return C})),i.d(e,"kb",(function(){return g})),i.d(e,"lb",(function(){return D})),i.d(e,"mb",(function(){return nt})),i.d(e,"nb",(function(){return Ye})),i.d(e,"ob",(function(){return Pi})),i.d(e,"pb",(function(){return cn})),i.d(e,"qb",(function(){return an})),i.d(e,"rb",(function(){return Ui})),i.d(e,"sb",(function(){return Xi})),i.d(e,"tb",(function(){return Yi})),i.d(e,"ub",(function(){return Re})),i.d(e,"vb",(function(){return Ie})),i.d(e,"wb",(function(){return De})),i.d(e,"xb",(function(){return Be})),i.d(e,"yb",(function(){return Ue})),i.d(e,"zb",(function(){return Xe})),i.d(e,"Ab",(function(){return rn})),i.d(e,"Bb",(function(){return Q})),i.d(e,"Cb",(function(){return r})),i.d(e,"Db",(function(){return me})),i.d(e,"Eb",(function(){return je})),i.d(e,"Fb",(function(){return wt})),i.d(e,"Gb",(function(){return w})),i.d(e,"Hb",(function(){return h})),i.d(e,"Ib",(function(){return Ze})),i.d(e,"Jb",(function(){return a})),i.d(e,"Kb",(function(){return S})),i.d(e,"Lb",(function(){return o})),i.d(e,"Mb",(function(){return lt})),i.d(e,"Nb",(function(){return d})),i.d(e,"Ob",(function(){return u})),i.d(e,"Pb",(function(){return Ki})),i.d(e,"Qb",(function(){return tt})),i.d(e,"Rb",(function(){return xt})),i.d(e,"Sb",(function(){return ut})),i.d(e,"Tb",(function(){return B})),i.d(e,"Ub",(function(){return X})),i.d(e,"Vb",(function(){return ct})),i.d(e,"Wb",(function(){return c})),i.d(e,"Xb",(function(){return _t})),i.d(e,"Yb",(function(){return H})),i.d(e,"Zb",(function(){return xi})),i.d(e,"ac",(function(){return W}));i("caad"),i("4d63"),i("ac1f"),i("5319");
|
|
/*!
|
|
* Chart.js v3.9.1
|
|
* https://www.chartjs.org
|
|
* (c) 2022 Chart.js Contributors
|
|
* Released under the MIT License
|
|
*/
|
|
function n(){}const s=function(){let t=0;return function(){return t++}}();function o(t){return null===t||"undefined"===typeof t}function r(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.slice(0,7)&&"Array]"===e.slice(-6)}function a(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}const h=t=>("number"===typeof t||t instanceof Number)&&isFinite(+t);function l(t,e){return h(t)?t:e}function c(t,e){return"undefined"===typeof t?e:t}const d=(t,e)=>"string"===typeof t&&t.endsWith("%")?parseFloat(t)/100:t/e,u=(t,e)=>"string"===typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function f(t,e,i){if(t&&"function"===typeof t.call)return t.apply(i,e)}function b(t,e,i,n){let s,o,h;if(r(t))if(o=t.length,n)for(s=o-1;s>=0;s--)e.call(i,t[s],s);else for(s=0;s<o;s++)e.call(i,t[s],s);else if(a(t))for(h=Object.keys(t),o=h.length,s=0;s<o;s++)e.call(i,t[h[s]],h[s])}function g(t,e){let i,n,s,o;if(!t||!e||t.length!==e.length)return!1;for(i=0,n=t.length;i<n;++i)if(s=t[i],o=e[i],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return!1;return!0}function p(t){if(r(t))return t.map(p);if(a(t)){const e=Object.create(null),i=Object.keys(t),n=i.length;let s=0;for(;s<n;++s)e[i[s]]=p(t[i[s]]);return e}return t}function m(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}function x(t,e,i,n){if(!m(t))return;const s=e[t],o=i[t];a(s)&&a(o)?_(s,o,n):e[t]=p(o)}function _(t,e,i){const n=r(e)?e:[e],s=n.length;if(!a(t))return t;i=i||{};const o=i.merger||x;for(let r=0;r<s;++r){if(e=n[r],!a(e))continue;const s=Object.keys(e);for(let n=0,r=s.length;n<r;++n)o(s[n],t,e,i)}return t}function y(t,e){return _(t,e,{merger:v})}function v(t,e,i){if(!m(t))return;const n=e[t],s=i[t];a(n)&&a(s)?y(n,s):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=p(s))}const O={"":t=>t,x:t=>t.x,y:t=>t.y};function w(t,e){const i=O[e]||(O[e]=j(e));return i(t)}function j(t){const e=M(t);return t=>{for(const i of e){if(""===i)break;t=t&&t[i]}return t}}function M(t){const e=t.split("."),i=[];let n="";for(const s of e)n+=s,n.endsWith("\\")?n=n.slice(0,-1)+".":(i.push(n),n="");return i}function k(t){return t.charAt(0).toUpperCase()+t.slice(1)}const S=t=>"undefined"!==typeof t,P=t=>"function"===typeof t,C=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0};function D(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}const A=Math.PI,L=2*A,E=L+A,T=Number.POSITIVE_INFINITY,R=A/180,I=A/2,z=A/4,F=2*A/3,W=Math.log10,B=Math.sign;function V(t){const e=Math.round(t);t=$(t,e,t/1e3)?e:t;const i=Math.pow(10,Math.floor(W(t))),n=t/i,s=n<=1?1:n<=2?2:n<=5?5:10;return s*i}function N(t){const e=[],i=Math.sqrt(t);let n;for(n=1;n<i;n++)t%n===0&&(e.push(n),e.push(t/n));return i===(0|i)&&e.push(i),e.sort((t,e)=>t-e).pop(),e}function H(t){return!isNaN(parseFloat(t))&&isFinite(t)}function $(t,e,i){return Math.abs(t-e)<i}function Y(t,e){const i=Math.round(t);return i-e<=t&&i+e>=t}function U(t,e,i){let n,s,o;for(n=0,s=t.length;n<s;n++)o=t[n][i],isNaN(o)||(e.min=Math.min(e.min,o),e.max=Math.max(e.max,o))}function X(t){return t*(A/180)}function q(t){return t*(180/A)}function J(t){if(!h(t))return;let e=1,i=0;while(Math.round(t*e)/e!==t)e*=10,i++;return i}function K(t,e){const i=e.x-t.x,n=e.y-t.y,s=Math.sqrt(i*i+n*n);let o=Math.atan2(n,i);return o<-.5*A&&(o+=L),{angle:o,distance:s}}function G(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Z(t,e){return(t-e+E)%L-A}function Q(t){return(t%L+L)%L}function tt(t,e,i,n){const s=Q(t),o=Q(e),r=Q(i),a=Q(o-s),h=Q(r-s),l=Q(s-o),c=Q(s-r);return s===o||s===r||n&&o===r||a>h&&l<c}function et(t,e,i){return Math.max(e,Math.min(i,t))}function it(t){return et(t,-32768,32767)}function nt(t,e,i,n=1e-6){return t>=Math.min(e,i)-n&&t<=Math.max(e,i)+n}function st(t,e,i){i=i||(i=>t[i]<e);let n,s=t.length-1,o=0;while(s-o>1)n=o+s>>1,i(n)?o=n:s=n;return{lo:o,hi:s}}const ot=(t,e,i,n)=>st(t,i,n?n=>t[n][e]<=i:n=>t[n][e]<i),rt=(t,e,i)=>st(t,i,n=>t[n][e]>=i);function at(t,e,i){let n=0,s=t.length;while(n<s&&t[n]<e)n++;while(s>n&&t[s-1]>i)s--;return n>0||s<t.length?t.slice(n,s):t}const ht=["push","pop","shift","splice","unshift"];function lt(t,e){t._chartjs?t._chartjs.listeners.push(e):(Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),ht.forEach(e=>{const i="_onData"+k(e),n=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value(...e){const s=n.apply(this,e);return t._chartjs.listeners.forEach(t=>{"function"===typeof t[i]&&t[i](...e)}),s}})}))}function ct(t,e){const i=t._chartjs;if(!i)return;const n=i.listeners,s=n.indexOf(e);-1!==s&&n.splice(s,1),n.length>0||(ht.forEach(e=>{delete t[e]}),delete t._chartjs)}function dt(t){const e=new Set;let i,n;for(i=0,n=t.length;i<n;++i)e.add(t[i]);return e.size===n?t:Array.from(e)}const ut=function(){return"undefined"===typeof window?function(t){return t()}:window.requestAnimationFrame}();function ft(t,e,i){const n=i||(t=>Array.prototype.slice.call(t));let s=!1,o=[];return function(...i){o=n(i),s||(s=!0,ut.call(window,()=>{s=!1,t.apply(e,o)}))}}function bt(t,e){let i;return function(...n){return e?(clearTimeout(i),i=setTimeout(t,e,n)):t.apply(this,n),e}}const gt=t=>"start"===t?"left":"end"===t?"right":"center",pt=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2,mt=(t,e,i,n)=>{const s=n?"left":"right";return t===s?i:"center"===t?(e+i)/2:e};function xt(t,e,i){const n=e.length;let s=0,o=n;if(t._sorted){const{iScale:r,_parsed:a}=t,h=r.axis,{min:l,max:c,minDefined:d,maxDefined:u}=r.getUserBounds();d&&(s=et(Math.min(ot(a,r.axis,l).lo,i?n:ot(e,h,r.getPixelForValue(l)).lo),0,n-1)),o=u?et(Math.max(ot(a,r.axis,c,!0).hi+1,i?0:ot(e,h,r.getPixelForValue(c),!0).hi+1),s,n)-s:n-s}return{start:s,count:o}}function _t(t){const{xScale:e,yScale:i,_scaleRanges:n}=t,s={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!n)return t._scaleRanges=s,!0;const o=n.xmin!==e.min||n.xmax!==e.max||n.ymin!==i.min||n.ymax!==i.max;return Object.assign(n,s),o}const yt=t=>0===t||1===t,vt=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*L/i),Ot=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*L/i)+1,wt={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*I),easeOutSine:t=>Math.sin(t*I),easeInOutSine:t=>-.5*(Math.cos(A*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>yt(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>yt(t)?t:vt(t,.075,.3),easeOutElastic:t=>yt(t)?t:Ot(t,.075,.3),easeInOutElastic(t){const e=.1125,i=.45;return yt(t)?t:t<.5?.5*vt(2*t,e,i):.5+.5*Ot(2*t-1,e,i)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-wt.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:t=>t<.5?.5*wt.easeInBounce(2*t):.5*wt.easeOutBounce(2*t-1)+.5};
|
|
/*!
|
|
* @kurkle/color v0.2.1
|
|
* https://github.com/kurkle/color#readme
|
|
* (c) 2022 Jukka Kurkela
|
|
* Released under the MIT License
|
|
*/
|
|
function jt(t){return t+.5|0}const Mt=(t,e,i)=>Math.max(Math.min(t,i),e);function kt(t){return Mt(jt(2.55*t),0,255)}function St(t){return Mt(jt(255*t),0,255)}function Pt(t){return Mt(jt(t/2.55)/100,0,1)}function Ct(t){return Mt(jt(100*t),0,100)}const Dt={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},At=[..."0123456789ABCDEF"],Lt=t=>At[15&t],Et=t=>At[(240&t)>>4]+At[15&t],Tt=t=>(240&t)>>4===(15&t),Rt=t=>Tt(t.r)&&Tt(t.g)&&Tt(t.b)&&Tt(t.a);function It(t){var e,i=t.length;return"#"===t[0]&&(4===i||5===i?e={r:255&17*Dt[t[1]],g:255&17*Dt[t[2]],b:255&17*Dt[t[3]],a:5===i?17*Dt[t[4]]:255}:7!==i&&9!==i||(e={r:Dt[t[1]]<<4|Dt[t[2]],g:Dt[t[3]]<<4|Dt[t[4]],b:Dt[t[5]]<<4|Dt[t[6]],a:9===i?Dt[t[7]]<<4|Dt[t[8]]:255})),e}const zt=(t,e)=>t<255?e(t):"";function Ft(t){var e=Rt(t)?Lt:Et;return t?"#"+e(t.r)+e(t.g)+e(t.b)+zt(t.a,e):void 0}const Wt=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Bt(t,e,i){const n=e*Math.min(i,1-i),s=(e,s=(e+t/30)%12)=>i-n*Math.max(Math.min(s-3,9-s,1),-1);return[s(0),s(8),s(4)]}function Vt(t,e,i){const n=(n,s=(n+t/60)%6)=>i-i*e*Math.max(Math.min(s,4-s,1),0);return[n(5),n(3),n(1)]}function Nt(t,e,i){const n=Bt(t,1,.5);let s;for(e+i>1&&(s=1/(e+i),e*=s,i*=s),s=0;s<3;s++)n[s]*=1-e-i,n[s]+=e;return n}function Ht(t,e,i,n,s){return t===s?(e-i)/n+(e<i?6:0):e===s?(i-t)/n+2:(t-e)/n+4}function $t(t){const e=255,i=t.r/e,n=t.g/e,s=t.b/e,o=Math.max(i,n,s),r=Math.min(i,n,s),a=(o+r)/2;let h,l,c;return o!==r&&(c=o-r,l=a>.5?c/(2-o-r):c/(o+r),h=Ht(i,n,s,c,o),h=60*h+.5),[0|h,l||0,a]}function Yt(t,e,i,n){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,i,n)).map(St)}function Ut(t,e,i){return Yt(Bt,t,e,i)}function Xt(t,e,i){return Yt(Nt,t,e,i)}function qt(t,e,i){return Yt(Vt,t,e,i)}function Jt(t){return(t%360+360)%360}function Kt(t){const e=Wt.exec(t);let i,n=255;if(!e)return;e[5]!==i&&(n=e[6]?kt(+e[5]):St(+e[5]));const s=Jt(+e[2]),o=+e[3]/100,r=+e[4]/100;return i="hwb"===e[1]?Xt(s,o,r):"hsv"===e[1]?qt(s,o,r):Ut(s,o,r),{r:i[0],g:i[1],b:i[2],a:n}}function Gt(t,e){var i=$t(t);i[0]=Jt(i[0]+e),i=Ut(i),t.r=i[0],t.g=i[1],t.b=i[2]}function Zt(t){if(!t)return;const e=$t(t),i=e[0],n=Ct(e[1]),s=Ct(e[2]);return t.a<255?`hsla(${i}, ${n}%, ${s}%, ${Pt(t.a)})`:`hsl(${i}, ${n}%, ${s}%)`}const Qt={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},te={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function ee(){const t={},e=Object.keys(te),i=Object.keys(Qt);let n,s,o,r,a;for(n=0;n<e.length;n++){for(r=a=e[n],s=0;s<i.length;s++)o=i[s],a=a.replace(o,Qt[o]);o=parseInt(te[r],16),t[a]=[o>>16&255,o>>8&255,255&o]}return t}let ie;function ne(t){ie||(ie=ee(),ie.transparent=[0,0,0,0]);const e=ie[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}const se=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function oe(t){const e=se.exec(t);let i,n,s,o=255;if(e){if(e[7]!==i){const t=+e[7];o=e[8]?kt(t):Mt(255*t,0,255)}return i=+e[1],n=+e[3],s=+e[5],i=255&(e[2]?kt(i):Mt(i,0,255)),n=255&(e[4]?kt(n):Mt(n,0,255)),s=255&(e[6]?kt(s):Mt(s,0,255)),{r:i,g:n,b:s,a:o}}}function re(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${Pt(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}const ae=t=>t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,he=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function le(t,e,i){const n=he(Pt(t.r)),s=he(Pt(t.g)),o=he(Pt(t.b));return{r:St(ae(n+i*(he(Pt(e.r))-n))),g:St(ae(s+i*(he(Pt(e.g))-s))),b:St(ae(o+i*(he(Pt(e.b))-o))),a:t.a+i*(e.a-t.a)}}function ce(t,e,i){if(t){let n=$t(t);n[e]=Math.max(0,Math.min(n[e]+n[e]*i,0===e?360:1)),n=Ut(n),t.r=n[0],t.g=n[1],t.b=n[2]}}function de(t,e){return t?Object.assign(e||{},t):t}function ue(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=St(t[3]))):(e=de(t,{r:0,g:0,b:0,a:1}),e.a=St(e.a)),e}function fe(t){return"r"===t.charAt(0)?oe(t):Kt(t)}class be{constructor(t){if(t instanceof be)return t;const e=typeof t;let i;"object"===e?i=ue(t):"string"===e&&(i=It(t)||ne(t)||fe(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=de(this._rgb);return t&&(t.a=Pt(t.a)),t}set rgb(t){this._rgb=ue(t)}rgbString(){return this._valid?re(this._rgb):void 0}hexString(){return this._valid?Ft(this._rgb):void 0}hslString(){return this._valid?Zt(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,n=t.rgb;let s;const o=e===s?.5:e,r=2*o-1,a=i.a-n.a,h=((r*a===-1?r:(r+a)/(1+r*a))+1)/2;s=1-h,i.r=255&h*i.r+s*n.r+.5,i.g=255&h*i.g+s*n.g+.5,i.b=255&h*i.b+s*n.b+.5,i.a=o*i.a+(1-o)*n.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=le(this._rgb,t._rgb,e)),this}clone(){return new be(this.rgb)}alpha(t){return this._rgb.a=St(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=jt(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return ce(this._rgb,2,t),this}darken(t){return ce(this._rgb,2,-t),this}saturate(t){return ce(this._rgb,1,t),this}desaturate(t){return ce(this._rgb,1,-t),this}rotate(t){return Gt(this._rgb,t),this}}function ge(t){return new be(t)}function pe(t){if(t&&"object"===typeof t){const e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function me(t){return pe(t)?t:ge(t)}function xe(t){return pe(t)?t:ge(t).saturate(.5).darken(.1).hexString()}const _e=Object.create(null),ye=Object.create(null);function ve(t,e){if(!e)return t;const i=e.split(".");for(let n=0,s=i.length;n<s;++n){const e=i[n];t=t[e]||(t[e]=Object.create(null))}return t}function Oe(t,e,i){return"string"===typeof e?_(ve(t,e),i):_(ve(t,""),e)}class we{constructor(t){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=t=>t.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>xe(e.backgroundColor),this.hoverBorderColor=(t,e)=>xe(e.borderColor),this.hoverColor=(t,e)=>xe(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t)}set(t,e){return Oe(this,t,e)}get(t){return ve(this,t)}describe(t,e){return Oe(ye,t,e)}override(t,e){return Oe(_e,t,e)}route(t,e,i,n){const s=ve(this,t),o=ve(this,i),r="_"+e;Object.defineProperties(s,{[r]:{value:s[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[r],e=o[n];return a(t)?Object.assign({},e,t):c(t,e)},set(t){this[r]=t}}})}}var je=new we({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function Me(t){return!t||o(t.size)||o(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function ke(t,e,i,n,s){let o=e[s];return o||(o=e[s]=t.measureText(s).width,i.push(s)),o>n&&(n=o),n}function Se(t,e,i,n){n=n||{};let s=n.data=n.data||{},o=n.garbageCollect=n.garbageCollect||[];n.font!==e&&(s=n.data={},o=n.garbageCollect=[],n.font=e),t.save(),t.font=e;let a=0;const h=i.length;let l,c,d,u,f;for(l=0;l<h;l++)if(u=i[l],void 0!==u&&null!==u&&!0!==r(u))a=ke(t,s,o,a,u);else if(r(u))for(c=0,d=u.length;c<d;c++)f=u[c],void 0===f||null===f||r(f)||(a=ke(t,s,o,a,f));t.restore();const b=o.length/2;if(b>i.length){for(l=0;l<b;l++)delete s[o[l]];o.splice(0,b)}return a}function Pe(t,e,i){const n=t.currentDevicePixelRatio,s=0!==i?Math.max(i/2,.5):0;return Math.round((e-s)*n)/n+s}function Ce(t,e){e=e||t.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore()}function De(t,e,i,n){Ae(t,e,i,n,null)}function Ae(t,e,i,n,s){let o,r,a,h,l,c;const d=e.pointStyle,u=e.rotation,f=e.radius;let b=(u||0)*R;if(d&&"object"===typeof d&&(o=d.toString(),"[object HTMLImageElement]"===o||"[object HTMLCanvasElement]"===o))return t.save(),t.translate(i,n),t.rotate(b),t.drawImage(d,-d.width/2,-d.height/2,d.width,d.height),void t.restore();if(!(isNaN(f)||f<=0)){switch(t.beginPath(),d){default:s?t.ellipse(i,n,s/2,f,0,0,L):t.arc(i,n,f,0,L),t.closePath();break;case"triangle":t.moveTo(i+Math.sin(b)*f,n-Math.cos(b)*f),b+=F,t.lineTo(i+Math.sin(b)*f,n-Math.cos(b)*f),b+=F,t.lineTo(i+Math.sin(b)*f,n-Math.cos(b)*f),t.closePath();break;case"rectRounded":l=.516*f,h=f-l,r=Math.cos(b+z)*h,a=Math.sin(b+z)*h,t.arc(i-r,n-a,l,b-A,b-I),t.arc(i+a,n-r,l,b-I,b),t.arc(i+r,n+a,l,b,b+I),t.arc(i-a,n+r,l,b+I,b+A),t.closePath();break;case"rect":if(!u){h=Math.SQRT1_2*f,c=s?s/2:h,t.rect(i-c,n-h,2*c,2*h);break}b+=z;case"rectRot":r=Math.cos(b)*f,a=Math.sin(b)*f,t.moveTo(i-r,n-a),t.lineTo(i+a,n-r),t.lineTo(i+r,n+a),t.lineTo(i-a,n+r),t.closePath();break;case"crossRot":b+=z;case"cross":r=Math.cos(b)*f,a=Math.sin(b)*f,t.moveTo(i-r,n-a),t.lineTo(i+r,n+a),t.moveTo(i+a,n-r),t.lineTo(i-a,n+r);break;case"star":r=Math.cos(b)*f,a=Math.sin(b)*f,t.moveTo(i-r,n-a),t.lineTo(i+r,n+a),t.moveTo(i+a,n-r),t.lineTo(i-a,n+r),b+=z,r=Math.cos(b)*f,a=Math.sin(b)*f,t.moveTo(i-r,n-a),t.lineTo(i+r,n+a),t.moveTo(i+a,n-r),t.lineTo(i-a,n+r);break;case"line":r=s?s/2:Math.cos(b)*f,a=Math.sin(b)*f,t.moveTo(i-r,n-a),t.lineTo(i+r,n+a);break;case"dash":t.moveTo(i,n),t.lineTo(i+Math.cos(b)*f,n+Math.sin(b)*f);break}t.fill(),e.borderWidth>0&&t.stroke()}}function Le(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.x<e.right+i&&t.y>e.top-i&&t.y<e.bottom+i}function Ee(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function Te(t){t.restore()}function Re(t,e,i,n,s){if(!e)return t.lineTo(i.x,i.y);if("middle"===s){const n=(e.x+i.x)/2;t.lineTo(n,e.y),t.lineTo(n,i.y)}else"after"===s!==!!n?t.lineTo(e.x,i.y):t.lineTo(i.x,e.y);t.lineTo(i.x,i.y)}function Ie(t,e,i,n){if(!e)return t.lineTo(i.x,i.y);t.bezierCurveTo(n?e.cp1x:e.cp2x,n?e.cp1y:e.cp2y,n?i.cp2x:i.cp1x,n?i.cp2y:i.cp1y,i.x,i.y)}function ze(t,e,i,n,s,a={}){const h=r(e)?e:[e],l=a.strokeWidth>0&&""!==a.strokeColor;let c,d;for(t.save(),t.font=s.string,Fe(t,a),c=0;c<h.length;++c)d=h[c],l&&(a.strokeColor&&(t.strokeStyle=a.strokeColor),o(a.strokeWidth)||(t.lineWidth=a.strokeWidth),t.strokeText(d,i,n,a.maxWidth)),t.fillText(d,i,n,a.maxWidth),We(t,i,n,d,a),n+=s.lineHeight;t.restore()}function Fe(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),o(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}function We(t,e,i,n,s){if(s.strikethrough||s.underline){const o=t.measureText(n),r=e-o.actualBoundingBoxLeft,a=e+o.actualBoundingBoxRight,h=i-o.actualBoundingBoxAscent,l=i+o.actualBoundingBoxDescent,c=s.strikethrough?(h+l)/2:l;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=s.decorationWidth||2,t.moveTo(r,c),t.lineTo(a,c),t.stroke()}}function Be(t,e){const{x:i,y:n,w:s,h:o,radius:r}=e;t.arc(i+r.topLeft,n+r.topLeft,r.topLeft,-I,A,!0),t.lineTo(i,n+o-r.bottomLeft),t.arc(i+r.bottomLeft,n+o-r.bottomLeft,r.bottomLeft,A,I,!0),t.lineTo(i+s-r.bottomRight,n+o),t.arc(i+s-r.bottomRight,n+o-r.bottomRight,r.bottomRight,I,0,!0),t.lineTo(i+s,n+r.topRight),t.arc(i+s-r.topRight,n+r.topRight,r.topRight,0,-I,!0),t.lineTo(i+r.topLeft,n)}const Ve=new RegExp(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/),Ne=new RegExp(/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/);function He(t,e){const i=(""+t).match(Ve);if(!i||"normal"===i[1])return 1.2*e;switch(t=+i[2],i[3]){case"px":return t;case"%":t/=100;break}return e*t}const $e=t=>+t||0;function Ye(t,e){const i={},n=a(e),s=n?Object.keys(e):e,o=a(t)?n?i=>c(t[i],t[e[i]]):e=>t[e]:()=>t;for(const r of s)i[r]=$e(o(r));return i}function Ue(t){return Ye(t,{top:"y",right:"x",bottom:"y",left:"x"})}function Xe(t){return Ye(t,["topLeft","topRight","bottomLeft","bottomRight"])}function qe(t){const e=Ue(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Je(t,e){t=t||{},e=e||je.font;let i=c(t.size,e.size);"string"===typeof i&&(i=parseInt(i,10));let n=c(t.style,e.style);n&&!(""+n).match(Ne)&&(console.warn('Invalid font style specified: "'+n+'"'),n="");const s={family:c(t.family,e.family),lineHeight:He(c(t.lineHeight,e.lineHeight),i),size:i,style:n,weight:c(t.weight,e.weight),string:""};return s.string=Me(s),s}function Ke(t,e,i,n){let s,o,a,h=!0;for(s=0,o=t.length;s<o;++s)if(a=t[s],void 0!==a&&(void 0!==e&&"function"===typeof a&&(a=a(e),h=!1),void 0!==i&&r(a)&&(a=a[i%a.length],h=!1),void 0!==a))return n&&!h&&(n.cacheable=!1),a}function Ge(t,e,i){const{min:n,max:s}=t,o=u(e,(s-n)/2),r=(t,e)=>i&&0===t?0:t+e;return{min:r(n,-Math.abs(o)),max:r(s,o)}}function Ze(t,e){return Object.assign(Object.create(t),e)}function Qe(t,e=[""],i=t,n,s=(()=>t[0])){S(n)||(n=gi("_fallback",t));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:i,_fallback:n,_getTarget:s,override:s=>Qe([s,...t],e,i,n)};return new Proxy(o,{deleteProperty(e,i){return delete e[i],delete e._keys,delete t[0][i],!0},get(i,n){return si(i,n,()=>bi(n,e,t,i))},getOwnPropertyDescriptor(t,e){return Reflect.getOwnPropertyDescriptor(t._scopes[0],e)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(t,e){return pi(t).includes(e)},ownKeys(t){return pi(t)},set(t,e,i){const n=t._storage||(t._storage=s());return t[e]=n[e]=i,delete t._keys,!0}})}function ti(t,e,i,n){const s={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:ei(t,n),setContext:e=>ti(t,e,i,n),override:s=>ti(t.override(s),e,i,n)};return new Proxy(s,{deleteProperty(e,i){return delete e[i],delete t[i],!0},get(t,e,i){return si(t,e,()=>oi(t,e,i))},getOwnPropertyDescriptor(e,i){return e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i)},getPrototypeOf(){return Reflect.getPrototypeOf(t)},has(e,i){return Reflect.has(t,i)},ownKeys(){return Reflect.ownKeys(t)},set(e,i,n){return t[i]=n,delete e[i],!0}})}function ei(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:n=e.indexable,_allKeys:s=e.allKeys}=t;return{allKeys:s,scriptable:i,indexable:n,isScriptable:P(i)?i:()=>i,isIndexable:P(n)?n:()=>n}}const ii=(t,e)=>t?t+k(e):e,ni=(t,e)=>a(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function si(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];const n=i();return t[e]=n,n}function oi(t,e,i){const{_proxy:n,_context:s,_subProxy:o,_descriptors:a}=t;let h=n[e];return P(h)&&a.isScriptable(e)&&(h=ri(e,h,t,i)),r(h)&&h.length&&(h=ai(e,h,t,a.isIndexable)),ni(e,h)&&(h=ti(h,s,o&&o[e],a)),h}function ri(t,e,i,n){const{_proxy:s,_context:o,_subProxy:r,_stack:a}=i;if(a.has(t))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+t);return a.add(t),e=e(o,r||n),a.delete(t),ni(t,e)&&(e=di(s._scopes,s,t,e)),e}function ai(t,e,i,n){const{_proxy:s,_context:o,_subProxy:r,_descriptors:h}=i;if(S(o.index)&&n(t))e=e[o.index%e.length];else if(a(e[0])){const i=e,n=s._scopes.filter(t=>t!==i);e=[];for(const a of i){const i=di(n,s,t,a);e.push(ti(i,o,r&&r[t],h))}}return e}function hi(t,e,i){return P(t)?t(e,i):t}const li=(t,e)=>!0===t?e:"string"===typeof t?w(e,t):void 0;function ci(t,e,i,n,s){for(const o of e){const e=li(i,o);if(e){t.add(e);const o=hi(e._fallback,i,s);if(S(o)&&o!==i&&o!==n)return o}else if(!1===e&&S(n)&&i!==n)return null}return!1}function di(t,e,i,n){const s=e._rootScopes,o=hi(e._fallback,i,n),r=[...t,...s],a=new Set;a.add(n);let h=ui(a,r,i,o||i,n);return null!==h&&((!S(o)||o===i||(h=ui(a,r,o,h,n),null!==h))&&Qe(Array.from(a),[""],s,o,()=>fi(e,i,n)))}function ui(t,e,i,n,s){while(i)i=ci(t,e,i,n,s);return i}function fi(t,e,i){const n=t._getTarget();e in n||(n[e]={});const s=n[e];return r(s)&&a(i)?i:s}function bi(t,e,i,n){let s;for(const o of e)if(s=gi(ii(o,t),i),S(s))return ni(t,s)?di(i,n,t,s):s}function gi(t,e){for(const i of e){if(!i)continue;const e=i[t];if(S(e))return e}}function pi(t){let e=t._keys;return e||(e=t._keys=mi(t._scopes)),e}function mi(t){const e=new Set;for(const i of t)for(const t of Object.keys(i).filter(t=>!t.startsWith("_")))e.add(t);return Array.from(e)}function xi(t,e,i,n){const{iScale:s}=t,{key:o="r"}=this._parsing,r=new Array(n);let a,h,l,c;for(a=0,h=n;a<h;++a)l=a+i,c=e[l],r[a]={r:s.parse(w(c,o),l)};return r}const _i=Number.EPSILON||1e-14,yi=(t,e)=>e<t.length&&!t[e].skip&&t[e],vi=t=>"x"===t?"y":"x";function Oi(t,e,i,n){const s=t.skip?e:t,o=e,r=i.skip?e:i,a=G(o,s),h=G(r,o);let l=a/(a+h),c=h/(a+h);l=isNaN(l)?0:l,c=isNaN(c)?0:c;const d=n*l,u=n*c;return{previous:{x:o.x-d*(r.x-s.x),y:o.y-d*(r.y-s.y)},next:{x:o.x+u*(r.x-s.x),y:o.y+u*(r.y-s.y)}}}function wi(t,e,i){const n=t.length;let s,o,r,a,h,l=yi(t,0);for(let c=0;c<n-1;++c)h=l,l=yi(t,c+1),h&&l&&($(e[c],0,_i)?i[c]=i[c+1]=0:(s=i[c]/e[c],o=i[c+1]/e[c],a=Math.pow(s,2)+Math.pow(o,2),a<=9||(r=3/Math.sqrt(a),i[c]=s*r*e[c],i[c+1]=o*r*e[c])))}function ji(t,e,i="x"){const n=vi(i),s=t.length;let o,r,a,h=yi(t,0);for(let l=0;l<s;++l){if(r=a,a=h,h=yi(t,l+1),!a)continue;const s=a[i],c=a[n];r&&(o=(s-r[i])/3,a["cp1"+i]=s-o,a["cp1"+n]=c-o*e[l]),h&&(o=(h[i]-s)/3,a["cp2"+i]=s+o,a["cp2"+n]=c+o*e[l])}}function Mi(t,e="x"){const i=vi(e),n=t.length,s=Array(n).fill(0),o=Array(n);let r,a,h,l=yi(t,0);for(r=0;r<n;++r)if(a=h,h=l,l=yi(t,r+1),h){if(l){const t=l[e]-h[e];s[r]=0!==t?(l[i]-h[i])/t:0}o[r]=a?l?B(s[r-1])!==B(s[r])?0:(s[r-1]+s[r])/2:s[r-1]:s[r]}wi(t,s,o),ji(t,o,e)}function ki(t,e,i){return Math.max(Math.min(t,i),e)}function Si(t,e){let i,n,s,o,r,a=Le(t[0],e);for(i=0,n=t.length;i<n;++i)r=o,o=a,a=i<n-1&&Le(t[i+1],e),o&&(s=t[i],r&&(s.cp1x=ki(s.cp1x,e.left,e.right),s.cp1y=ki(s.cp1y,e.top,e.bottom)),a&&(s.cp2x=ki(s.cp2x,e.left,e.right),s.cp2y=ki(s.cp2y,e.top,e.bottom)))}function Pi(t,e,i,n,s){let o,r,a,h;if(e.spanGaps&&(t=t.filter(t=>!t.skip)),"monotone"===e.cubicInterpolationMode)Mi(t,s);else{let i=n?t[t.length-1]:t[0];for(o=0,r=t.length;o<r;++o)a=t[o],h=Oi(i,a,t[Math.min(o+1,r-(n?0:1))%r],e.tension),a.cp1x=h.previous.x,a.cp1y=h.previous.y,a.cp2x=h.next.x,a.cp2y=h.next.y,i=a}e.capBezierPoints&&Si(t,i)}function Ci(){return"undefined"!==typeof window&&"undefined"!==typeof document}function Di(t){let e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e}function Ai(t,e,i){let n;return"string"===typeof t?(n=parseInt(t,10),-1!==t.indexOf("%")&&(n=n/100*e.parentNode[i])):n=t,n}const Li=t=>window.getComputedStyle(t,null);function Ei(t,e){return Li(t).getPropertyValue(e)}const Ti=["top","right","bottom","left"];function Ri(t,e,i){const n={};i=i?"-"+i:"";for(let s=0;s<4;s++){const o=Ti[s];n[o]=parseFloat(t[e+"-"+o+i])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}const Ii=(t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot);function zi(t,e){const i=t.touches,n=i&&i.length?i[0]:t,{offsetX:s,offsetY:o}=n;let r,a,h=!1;if(Ii(s,o,t.target))r=s,a=o;else{const t=e.getBoundingClientRect();r=n.clientX-t.left,a=n.clientY-t.top,h=!0}return{x:r,y:a,box:h}}function Fi(t,e){if("native"in t)return t;const{canvas:i,currentDevicePixelRatio:n}=e,s=Li(i),o="border-box"===s.boxSizing,r=Ri(s,"padding"),a=Ri(s,"border","width"),{x:h,y:l,box:c}=zi(t,i),d=r.left+(c&&a.left),u=r.top+(c&&a.top);let{width:f,height:b}=e;return o&&(f-=r.width+a.width,b-=r.height+a.height),{x:Math.round((h-d)/f*i.width/n),y:Math.round((l-u)/b*i.height/n)}}function Wi(t,e,i){let n,s;if(void 0===e||void 0===i){const o=Di(t);if(o){const t=o.getBoundingClientRect(),r=Li(o),a=Ri(r,"border","width"),h=Ri(r,"padding");e=t.width-h.width-a.width,i=t.height-h.height-a.height,n=Ai(r.maxWidth,o,"clientWidth"),s=Ai(r.maxHeight,o,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:n||T,maxHeight:s||T}}const Bi=t=>Math.round(10*t)/10;function Vi(t,e,i,n){const s=Li(t),o=Ri(s,"margin"),r=Ai(s.maxWidth,t,"clientWidth")||T,a=Ai(s.maxHeight,t,"clientHeight")||T,h=Wi(t,e,i);let{width:l,height:c}=h;if("content-box"===s.boxSizing){const t=Ri(s,"border","width"),e=Ri(s,"padding");l-=e.width+t.width,c-=e.height+t.height}return l=Math.max(0,l-o.width),c=Math.max(0,n?Math.floor(l/n):c-o.height),l=Bi(Math.min(l,r,h.maxWidth)),c=Bi(Math.min(c,a,h.maxHeight)),l&&!c&&(c=Bi(l/2)),{width:l,height:c}}function Ni(t,e,i){const n=e||1,s=Math.floor(t.height*n),o=Math.floor(t.width*n);t.height=s/n,t.width=o/n;const r=t.canvas;return r.style&&(i||!r.style.height&&!r.style.width)&&(r.style.height=t.height+"px",r.style.width=t.width+"px"),(t.currentDevicePixelRatio!==n||r.height!==s||r.width!==o)&&(t.currentDevicePixelRatio=n,r.height=s,r.width=o,t.ctx.setTransform(n,0,0,n,0,0),!0)}const Hi=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(e){}return t}();function $i(t,e){const i=Ei(t,e),n=i&&i.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function Yi(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function Ui(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:"middle"===n?i<.5?t.y:e.y:"after"===n?i<1?t.y:e.y:i>0?e.y:t.y}}function Xi(t,e,i,n){const s={x:t.cp2x,y:t.cp2y},o={x:e.cp1x,y:e.cp1y},r=Yi(t,s,i),a=Yi(s,o,i),h=Yi(o,e,i),l=Yi(r,a,i),c=Yi(a,h,i);return Yi(l,c,i)}const qi=new Map;function Ji(t,e){e=e||{};const i=t+JSON.stringify(e);let n=qi.get(i);return n||(n=new Intl.NumberFormat(t,e),qi.set(i,n)),n}function Ki(t,e,i){return Ji(e,i).format(t)}const Gi=function(t,e){return{x(i){return t+t+e-i},setWidth(t){e=t},textAlign(t){return"center"===t?t:"right"===t?"left":"right"},xPlus(t,e){return t-e},leftForLtr(t,e){return t-e}}},Zi=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,e){return t+e},leftForLtr(t,e){return t}}};function Qi(t,e,i){return t?Gi(e,i):Zi()}function tn(t,e){let i,n;"ltr"!==e&&"rtl"!==e||(i=t.canvas.style,n=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=n)}function en(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function nn(t){return"angle"===t?{between:tt,compare:Z,normalize:Q}:{between:nt,compare:(t,e)=>t-e,normalize:t=>t}}function sn({start:t,end:e,count:i,loop:n,style:s}){return{start:t%i,end:e%i,loop:n&&(e-t+1)%i===0,style:s}}function on(t,e,i){const{property:n,start:s,end:o}=i,{between:r,normalize:a}=nn(n),h=e.length;let l,c,{start:d,end:u,loop:f}=t;if(f){for(d+=h,u+=h,l=0,c=h;l<c;++l){if(!r(a(e[d%h][n]),s,o))break;d--,u--}d%=h,u%=h}return u<d&&(u+=h),{start:d,end:u,loop:f,style:t.style}}function rn(t,e,i){if(!i)return[t];const{property:n,start:s,end:o}=i,r=e.length,{compare:a,between:h,normalize:l}=nn(n),{start:c,end:d,loop:u,style:f}=on(t,e,i),b=[];let g,p,m,x=!1,_=null;const y=()=>h(s,m,g)&&0!==a(s,m),v=()=>0===a(o,g)||h(o,m,g),O=()=>x||y(),w=()=>!x||v();for(let j=c,M=c;j<=d;++j)p=e[j%r],p.skip||(g=l(p[n]),g!==m&&(x=h(g,s,o),null===_&&O()&&(_=0===a(g,s)?j:M),null!==_&&w()&&(b.push(sn({start:_,end:j,loop:u,count:r,style:f})),_=null),M=j,m=g));return null!==_&&b.push(sn({start:_,end:d,loop:u,count:r,style:f})),b}function an(t,e){const i=[],n=t.segments;for(let s=0;s<n.length;s++){const o=rn(n[s],t.points,e);o.length&&i.push(...o)}return i}function hn(t,e,i,n){let s=0,o=e-1;if(i&&!n)while(s<e&&!t[s].skip)s++;while(s<e&&t[s].skip)s++;s%=e,i&&(o+=s);while(o>s&&t[o%e].skip)o--;return o%=e,{start:s,end:o}}function ln(t,e,i,n){const s=t.length,o=[];let r,a=e,h=t[e];for(r=e+1;r<=i;++r){const i=t[r%s];i.skip||i.stop?h.skip||(n=!1,o.push({start:e%s,end:(r-1)%s,loop:n}),e=a=i.stop?r:null):(a=r,h.skip&&(e=r)),h=i}return null!==a&&o.push({start:e%s,end:a%s,loop:n}),o}function cn(t,e){const i=t.points,n=t.options.spanGaps,s=i.length;if(!s)return[];const o=!!t._loop,{start:r,end:a}=hn(i,s,o,n);if(!0===n)return dn(t,[{start:r,end:a,loop:o}],i,e);const h=a<r?a+s:a,l=!!t._fullLoop&&0===r&&a===s-1;return dn(t,ln(i,r,h,l),i,e)}function dn(t,e,i,n){return n&&n.setContext&&i?un(t,e,i,n):e}function un(t,e,i,n){const s=t._chart.getContext(),o=fn(t.options),{_datasetIndex:r,options:{spanGaps:a}}=t,h=i.length,l=[];let c=o,d=e[0].start,u=d;function f(t,e,n,s){const o=a?-1:1;if(t!==e){t+=h;while(i[t%h].skip)t-=o;while(i[e%h].skip)e+=o;t%h!==e%h&&(l.push({start:t%h,end:e%h,loop:n,style:s}),c=s,d=e%h)}}for(const b of e){d=a?d:b.start;let t,e=i[d%h];for(u=d+1;u<=b.end;u++){const o=i[u%h];t=fn(n.setContext(Ze(s,{type:"segment",p0:e,p1:o,p0DataIndex:(u-1)%h,p1DataIndex:u%h,datasetIndex:r}))),bn(t,c)&&f(d,u-1,b.loop,c),e=o,c=t}d<u-1&&f(d,u-1,b.loop,c)}return l}function fn(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function bn(t,e){return e&&JSON.stringify(t)!==JSON.stringify(e)}}}]); |