PluginProbe
ThinkRank AI SEO – AI SEO Plugin for WordPress: Schema, XML Sitemaps, Meta Tags, Search Console & Local SEO / 2.9.0
ThinkRank AI SEO – AI SEO Plugin for WordPress: Schema, XML Sitemaps, Meta Tags, Search Console & Local SEO v2.9.0
2.9.0 2.8.0 2.7.0 2.6.0 2.5.0 2.4.0 2.3.0 2.2.0 2.1.1 2.1.0 2.0.2 2.0.1 2.0.0 1.32.0 1.31.0 1.30.0 1.29.0 1.28.0 1.27.0 1.26.0 1.25.0 trunk 1.0.0 1.0.1 1.0.2 All 50 releases
← All changes | assets/charts.js +1 -1 1.0.2 → 2.9.0 View file →
@@ -1 +1 @@
1 -(()=>{"use strict";function t(t){return t+.5|0}const e=(t,e,i)=>Math.max(Math.min(t,i),e);function i(i){return e(t(2.55*i),0,255)}function s(i){return e(t(255*i),0,255)}function n(i){return e(t(i/2.55)/100,0,1)}function o(i){return e(t(100*i),0,100)}const r={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},a=[..."0123456789ABCDEF"],h=t=>a[15&t],l=t=>a[(240&t)>>4]+a[15&t],c=t=>(240&t)>>4==(15&t);const d=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function u(t,e,i){const s=e*Math.min(i,1-i),n=(e,n=(e+t/30)%12)=>i-s*Math.max(Math.min(n-3,9-n,1),-1);return[n(0),n(8),n(4)]}function f(t,e,i){const s=(s,n=(s+t/60)%6)=>i-i*e*Math.max(Math.min(n,4-n,1),0);return[s(5),s(3),s(1)]}function g(t,e,i){const s=u(t,1,.5);let n;for(e+i>1&&(n=1/(e+i),e*=n,i*=n),n=0;n<3;n++)s[n]*=1-e-i,s[n]+=e;return s}function p(t){const e=t.r/255,i=t.g/255,s=t.b/255,n=Math.max(e,i,s),o=Math.min(e,i,s),r=(n+o)/2;let a,h,l;return n!==o&&(l=n-o,h=r>.5?l/(2-n-o):l/(n+o),a=function(t,e,i,s,n){return t===n?(e-i)/s+(e<i?6:0):e===n?(i-t)/s+2:(t-e)/s+4}(e,i,s,l,n),a=60*a+.5),[0|a,h||0,r]}function x(t,e,i,n){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,i,n)).map(s)}function m(t,e,i){return x(u,t,e,i)}function b(t){return(t%360+360)%360}const _={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"},y={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"};let v;const w=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/,M=t=>t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,k=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function S(t,e,i){if(t){let s=p(t);s[e]=Math.max(0,Math.min(s[e]+s[e]*i,0===e?360:1)),s=m(s),t.r=s[0],t.g=s[1],t.b=s[2]}}function P(t,e){return t?Object.assign(e||{},t):t}function D(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=s(t[3]))):(e=P(t,{r:0,g:0,b:0,a:1})).a=s(e.a),e}function O(t){return"r"===t.charAt(0)?function(t){const s=w.exec(t);let n,o,r,a=255;if(s){if(s[7]!==n){const t=+s[7];a=s[8]?i(t):e(255*t,0,255)}return n=+s[1],o=+s[3],r=+s[5],n=255&(s[2]?i(n):e(n,0,255)),o=255&(s[4]?i(o):e(o,0,255)),r=255&(s[6]?i(r):e(r,0,255)),{r:n,g:o,b:r,a}}}(t):function(t){const e=d.exec(t);let n,o=255;if(!e)return;e[5]!==n&&(o=e[6]?i(+e[5]):s(+e[5]));const r=b(+e[2]),a=+e[3]/100,h=+e[4]/100;return n="hwb"===e[1]?function(t,e,i){return x(g,t,e,i)}(r,a,h):"hsv"===e[1]?function(t,e,i){return x(f,t,e,i)}(r,a,h):m(r,a,h),{r:n[0],g:n[1],b:n[2],a:o}}(t)}class T{constructor(t){if(t instanceof T)return t;const e=typeof t;let i;var s,n,o;"object"===e?i=D(t):"string"===e&&(o=(s=t).length,"#"===s[0]&&(4===o||5===o?n={r:255&17*r[s[1]],g:255&17*r[s[2]],b:255&17*r[s[3]],a:5===o?17*r[s[4]]:255}:7!==o&&9!==o||(n={r:r[s[1]]<<4|r[s[2]],g:r[s[3]]<<4|r[s[4]],b:r[s[5]]<<4|r[s[6]],a:9===o?r[s[7]]<<4|r[s[8]]:255})),i=n||function(t){v||(v=function(){const t={},e=Object.keys(y),i=Object.keys(_);let s,n,o,r,a;for(s=0;s<e.length;s++){for(r=a=e[s],n=0;n<i.length;n++)o=i[n],a=a.replace(o,_[o]);o=parseInt(y[r],16),t[a]=[o>>16&255,o>>8&255,255&o]}return t}(),v.transparent=[0,0,0,0]);const e=v[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}(t)||O(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=P(this._rgb);return t&&(t.a=n(t.a)),t}set rgb(t){this._rgb=D(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${n(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):void 0;var t}hexString(){return this._valid?(t=this._rgb,e=(t=>c(t.r)&&c(t.g)&&c(t.b)&&c(t.a))(t)?h:l,t?"#"+e(t.r)+e(t.g)+e(t.b)+((t,e)=>t<255?e(t):"")(t.a,e):void 0):void 0;var t,e}hslString(){return this._valid?function(t){if(!t)return;const e=p(t),i=e[0],s=o(e[1]),r=o(e[2]);return t.a<255?`hsla(${i}, ${s}%, ${r}%, ${n(t.a)})`:`hsl(${i}, ${s}%, ${r}%)`}(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,s=t.rgb;let n;const o=e===n?.5:e,r=2*o-1,a=i.a-s.a,h=((r*a===-1?r:(r+a)/(1+r*a))+1)/2;n=1-h,i.r=255&h*i.r+n*s.r+.5,i.g=255&h*i.g+n*s.g+.5,i.b=255&h*i.b+n*s.b+.5,i.a=o*i.a+(1-o)*s.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=function(t,e,i){const o=k(n(t.r)),r=k(n(t.g)),a=k(n(t.b));return{r:s(M(o+i*(k(n(e.r))-o))),g:s(M(r+i*(k(n(e.g))-r))),b:s(M(a+i*(k(n(e.b))-a))),a:t.a+i*(e.a-t.a)}}(this._rgb,t._rgb,e)),this}clone(){return new T(this.rgb)}alpha(t){return this._rgb.a=s(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const e=this._rgb,i=t(.3*e.r+.59*e.g+.11*e.b);return e.r=e.g=e.b=i,this}opaquer(t){return this._rgb.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 S(this._rgb,2,t),this}darken(t){return S(this._rgb,2,-t),this}saturate(t){return S(this._rgb,1,t),this}desaturate(t){return S(this._rgb,1,-t),this}rotate(t){return function(t,e){var i=p(t);i[0]=b(i[0]+e),i=m(i),t.r=i[0],t.g=i[1],t.b=i[2]}(this._rgb,t),this}}function C(){}const A=(()=>{let t=0;return()=>t++})();function I(t){return null==t}function L(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 E(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}function R(t){return("number"==typeof t||t instanceof Number)&&isFinite(+t)}function z(t,e){return R(t)?t:e}function F(t,e){return void 0===t?e:t}function B(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function H(t,e,i,s){let n,o,r;if(L(t))if(o=t.length,s)for(n=o-1;n>=0;n--)e.call(i,t[n],n);else for(n=0;n<o;n++)e.call(i,t[n],n);else if(E(t))for(r=Object.keys(t),o=r.length,n=0;n<o;n++)e.call(i,t[r[n]],r[n])}function j(t,e){let i,s,n,o;if(!t||!e||t.length!==e.length)return!1;for(i=0,s=t.length;i<s;++i)if(n=t[i],o=e[i],n.datasetIndex!==o.datasetIndex||n.index!==o.index)return!1;return!0}function V(t){if(L(t))return t.map(V);if(E(t)){const e=Object.create(null),i=Object.keys(t),s=i.length;let n=0;for(;n<s;++n)e[i[n]]=V(t[i[n]]);return e}return t}function W(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}function $(t,e,i,s){if(!W(t))return;const n=e[t],o=i[t];E(n)&&E(o)?N(n,o,s):e[t]=V(o)}function N(t,e,i){const s=L(e)?e:[e],n=s.length;if(!E(t))return t;const o=(i=i||{}).merger||$;let r;for(let e=0;e<n;++e){if(r=s[e],!E(r))continue;const n=Object.keys(r);for(let e=0,s=n.length;e<s;++e)o(n[e],t,r,i)}return t}function Y(t,e){return N(t,e,{merger:U})}function U(t,e,i){if(!W(t))return;const s=e[t],n=i[t];E(s)&&E(n)?Y(s,n):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=V(n))}const X={"":t=>t,x:t=>t.x,y:t=>t.y};function q(t,e){const i=X[e]||(X[e]=function(t){const e=function(t){const e=t.split("."),i=[];let s="";for(const t of e)s+=t,s.endsWith("\\")?s=s.slice(0,-1)+".":(i.push(s),s="");return i}(t);return t=>{for(const i of e){if(""===i)break;t=t&&t[i]}return t}}(e));return i(t)}function K(t){return t.charAt(0).toUpperCase()+t.slice(1)}const Z=t=>void 0!==t,G=t=>"function"==typeof t,Q=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0},J=Math.PI,tt=2*J,et=tt+J,it=Number.POSITIVE_INFINITY,st=J/180,nt=J/2,ot=J/4,rt=2*J/3,at=Math.log10,ht=Math.sign;function lt(t,e,i){return Math.abs(t-e)<i}function ct(t){const e=Math.round(t);t=lt(t,e,t/1e3)?e:t;const i=Math.pow(10,Math.floor(at(t))),s=t/i;return(s<=1?1:s<=2?2:s<=5?5:10)*i}function dt(t){return!function(t){return"symbol"==typeof t||"object"==typeof t&&null!==t&&!(Symbol.toPrimitive in t||"toString"in t||"valueOf"in t)}(t)&&!isNaN(parseFloat(t))&&isFinite(t)}function ut(t){return t*(J/180)}function ft(t){if(!R(t))return;let e=1,i=0;for(;Math.round(t*e)/e!==t;)e*=10,i++;return i}function gt(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function pt(t,e){return(t-e+et)%tt-J}function xt(t){return(t%tt+tt)%tt}function mt(t,e,i,s){const n=xt(t),o=xt(e),r=xt(i),a=xt(o-n),h=xt(r-n),l=xt(n-o),c=xt(n-r);return n===o||n===r||s&&o===r||a>h&&l<c}function bt(t,e,i){return Math.max(e,Math.min(i,t))}function _t(t,e,i,s=1e-6){return t>=Math.min(e,i)-s&&t<=Math.max(e,i)+s}function yt(t,e,i){i=i||(i=>t[i]<e);let s,n=t.length-1,o=0;for(;n-o>1;)s=o+n>>1,i(s)?o=s:n=s;return{lo:o,hi:n}}const vt=(t,e,i,s)=>yt(t,i,s?s=>{const n=t[s][e];return n<i||n===i&&t[s+1][e]===i}:s=>t[s][e]<i),wt=(t,e,i)=>yt(t,i,s=>t[s][e]>=i),Mt=["push","pop","shift","splice","unshift"];function kt(t,e){const i=t._chartjs;if(!i)return;const s=i.listeners,n=s.indexOf(e);-1!==n&&s.splice(n,1),s.length>0||(Mt.forEach(e=>{delete t[e]}),delete t._chartjs)}const St="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function Pt(t,e){let i=[],s=!1;return function(...n){i=n,s||(s=!0,St.call(window,()=>{s=!1,t.apply(e,i)}))}}const Dt=t=>"start"===t?"left":"end"===t?"right":"center",Ot=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2,Tt=t=>0===t||1===t,Ct=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*tt/i),At=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*tt/i)+1,It={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*nt),easeOutSine:t=>Math.sin(t*nt),easeInOutSine:t=>-.5*(Math.cos(J*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=>Tt(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=>Tt(t)?t:Ct(t,.075,.3),easeOutElastic:t=>Tt(t)?t:At(t,.075,.3),easeInOutElastic(t){const e=.1125;return Tt(t)?t:t<.5?.5*Ct(2*t,e,.45):.5+.5*At(2*t-1,e,.45)},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-It.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*It.easeInBounce(2*t):.5*It.easeOutBounce(2*t-1)+.5};function Lt(t){if(t&&"object"==typeof t){const e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function Et(t){return Lt(t)?t:new T(t)}function Rt(t){return Lt(t)?t:new T(t).saturate(.5).darken(.1).hexString()}const zt=["x","y","borderWidth","radius","tension"],Ft=["color","borderColor","backgroundColor"],Bt=new Map;function Ht(t,e,i){return function(t,e){e=e||{};const i=t+JSON.stringify(e);let s=Bt.get(i);return s||(s=new Intl.NumberFormat(t,e),Bt.set(i,s)),s}(e,i).format(t)}const jt={values:t=>L(t)?t:""+t,numeric(t,e,i){if(0===t)return"0";const s=this.chart.options.locale;let n,o=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)&&(n="scientific"),o=function(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}(t,i)}const r=at(Math.abs(o)),a=isNaN(r)?1:Math.max(Math.min(-1*Math.floor(r),20),0),h={notation:n,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(h,this.options.ticks.format),Ht(t,s,h)},logarithmic(t,e,i){if(0===t)return"0";const s=i[e].significand||t/Math.pow(10,Math.floor(at(t)));return[1,2,3,5,10,15].includes(s)||e>.8*i.length?jt.numeric.call(this,t,e,i):""}};var Vt={formatters:jt};const Wt=Object.create(null),$t=Object.create(null);function Nt(t,e){if(!e)return t;const i=e.split(".");for(let e=0,s=i.length;e<s;++e){const s=i[e];t=t[s]||(t[s]=Object.create(null))}return t}function Yt(t,e,i){return"string"==typeof e?N(Nt(t,e),i):N(Nt(t,""),e)}class Ut{constructor(t,e){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)=>Rt(e.backgroundColor),this.hoverBorderColor=(t,e)=>Rt(e.borderColor),this.hoverColor=(t,e)=>Rt(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),this.apply(e)}set(t,e){return Yt(this,t,e)}get(t){return Nt(this,t)}describe(t,e){return Yt($t,t,e)}override(t,e){return Yt(Wt,t,e)}route(t,e,i,s){const n=Nt(this,t),o=Nt(this,i),r="_"+e;Object.defineProperties(n,{[r]:{value:n[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[r],e=o[s];return E(t)?Object.assign({},e,t):F(t,e)},set(t){this[r]=t}}})}apply(t){t.forEach(t=>t(this))}}var Xt=new Ut({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[function(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),t.set("animations",{colors:{type:"color",properties:Ft},numbers:{type:"number",properties:zt}}),t.describe("animations",{_fallback:"animation"}),t.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}}}})},function(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})},function(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width: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:Vt.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t&&"dash"!==t}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t})}]);function qt(t,e,i,s,n){let o=e[n];return o||(o=e[n]=t.measureText(n).width,i.push(n)),o>s&&(s=o),s}function Kt(t,e,i){const s=t.currentDevicePixelRatio,n=0!==i?Math.max(i/2,.5):0;return Math.round((e-n)*s)/s+n}function Zt(t,e){(e||t)&&((e=e||t.getContext("2d")).save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore())}function Gt(t,e,i,s){!function(t,e,i,s,n){let o,r,a,h,l,c,d,u;const f=e.pointStyle,g=e.rotation,p=e.radius;let x=(g||0)*st;if(f&&"object"==typeof f&&(o=f.toString(),"[object HTMLImageElement]"===o||"[object HTMLCanvasElement]"===o))return t.save(),t.translate(i,s),t.rotate(x),t.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),void t.restore();if(!(isNaN(p)||p<=0)){switch(t.beginPath(),f){default:n?t.ellipse(i,s,n/2,p,0,0,tt):t.arc(i,s,p,0,tt),t.closePath();break;case"triangle":c=n?n/2:p,t.moveTo(i+Math.sin(x)*c,s-Math.cos(x)*p),x+=rt,t.lineTo(i+Math.sin(x)*c,s-Math.cos(x)*p),x+=rt,t.lineTo(i+Math.sin(x)*c,s-Math.cos(x)*p),t.closePath();break;case"rectRounded":l=.516*p,h=p-l,r=Math.cos(x+ot)*h,d=Math.cos(x+ot)*(n?n/2-l:h),a=Math.sin(x+ot)*h,u=Math.sin(x+ot)*(n?n/2-l:h),t.arc(i-d,s-a,l,x-J,x-nt),t.arc(i+u,s-r,l,x-nt,x),t.arc(i+d,s+a,l,x,x+nt),t.arc(i-u,s+r,l,x+nt,x+J),t.closePath();break;case"rect":if(!g){h=Math.SQRT1_2*p,c=n?n/2:h,t.rect(i-c,s-h,2*c,2*h);break}x+=ot;case"rectRot":d=Math.cos(x)*(n?n/2:p),r=Math.cos(x)*p,a=Math.sin(x)*p,u=Math.sin(x)*(n?n/2:p),t.moveTo(i-d,s-a),t.lineTo(i+u,s-r),t.lineTo(i+d,s+a),t.lineTo(i-u,s+r),t.closePath();break;case"crossRot":x+=ot;case"cross":d=Math.cos(x)*(n?n/2:p),r=Math.cos(x)*p,a=Math.sin(x)*p,u=Math.sin(x)*(n?n/2:p),t.moveTo(i-d,s-a),t.lineTo(i+d,s+a),t.moveTo(i+u,s-r),t.lineTo(i-u,s+r);break;case"star":d=Math.cos(x)*(n?n/2:p),r=Math.cos(x)*p,a=Math.sin(x)*p,u=Math.sin(x)*(n?n/2:p),t.moveTo(i-d,s-a),t.lineTo(i+d,s+a),t.moveTo(i+u,s-r),t.lineTo(i-u,s+r),x+=ot,d=Math.cos(x)*(n?n/2:p),r=Math.cos(x)*p,a=Math.sin(x)*p,u=Math.sin(x)*(n?n/2:p),t.moveTo(i-d,s-a),t.lineTo(i+d,s+a),t.moveTo(i+u,s-r),t.lineTo(i-u,s+r);break;case"line":r=n?n/2:Math.cos(x)*p,a=Math.sin(x)*p,t.moveTo(i-r,s-a),t.lineTo(i+r,s+a);break;case"dash":t.moveTo(i,s),t.lineTo(i+Math.cos(x)*(n?n/2:p),s+Math.sin(x)*p);break;case!1:t.closePath()}t.fill(),e.borderWidth>0&&t.stroke()}}(t,e,i,s,null)}function Qt(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 Jt(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 ee(t,e,i,s,n){if(!e)return t.lineTo(i.x,i.y);if("middle"===n){const s=(e.x+i.x)/2;t.lineTo(s,e.y),t.lineTo(s,i.y)}else"after"===n!=!!s?t.lineTo(e.x,i.y):t.lineTo(i.x,e.y);t.lineTo(i.x,i.y)}function ie(t,e,i,s){if(!e)return t.lineTo(i.x,i.y);t.bezierCurveTo(s?e.cp1x:e.cp2x,s?e.cp1y:e.cp2y,s?i.cp2x:i.cp1x,s?i.cp2y:i.cp1y,i.x,i.y)}function se(t,e,i,s,n){if(n.strikethrough||n.underline){const o=t.measureText(s),r=e-o.actualBoundingBoxLeft,a=e+o.actualBoundingBoxRight,h=i-o.actualBoundingBoxAscent,l=i+o.actualBoundingBoxDescent,c=n.strikethrough?(h+l)/2:l;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=n.decorationWidth||2,t.moveTo(r,c),t.lineTo(a,c),t.stroke()}}function ne(t,e){const i=t.fillStyle;t.fillStyle=e.color,t.fillRect(e.left,e.top,e.width,e.height),t.fillStyle=i}function oe(t,e,i,s,n,o={}){const r=L(e)?e:[e],a=o.strokeWidth>0&&""!==o.strokeColor;let h,l;for(t.save(),t.font=n.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),I(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,o),h=0;h<r.length;++h)l=r[h],o.backdrop&&ne(t,o.backdrop),a&&(o.strokeColor&&(t.strokeStyle=o.strokeColor),I(o.strokeWidth)||(t.lineWidth=o.strokeWidth),t.strokeText(l,i,s,o.maxWidth)),t.fillText(l,i,s,o.maxWidth),se(t,i,s,l,o),s+=Number(n.lineHeight);t.restore()}function re(t,e){const{x:i,y:s,w:n,h:o,radius:r}=e;t.arc(i+r.topLeft,s+r.topLeft,r.topLeft,1.5*J,J,!0),t.lineTo(i,s+o-r.bottomLeft),t.arc(i+r.bottomLeft,s+o-r.bottomLeft,r.bottomLeft,J,nt,!0),t.lineTo(i+n-r.bottomRight,s+o),t.arc(i+n-r.bottomRight,s+o-r.bottomRight,r.bottomRight,nt,0,!0),t.lineTo(i+n,s+r.topRight),t.arc(i+n-r.topRight,s+r.topRight,r.topRight,0,-nt,!0),t.lineTo(i+r.topLeft,s)}const ae=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,he=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function le(t,e){const i=(""+t).match(ae);if(!i||"normal"===i[1])return 1.2*e;switch(t=+i[2],i[3]){case"px":return t;case"%":t/=100}return e*t}const ce=t=>+t||0;function de(t,e){const i={},s=E(e),n=s?Object.keys(e):e,o=E(t)?s?i=>F(t[i],t[e[i]]):e=>t[e]:()=>t;for(const t of n)i[t]=ce(o(t));return i}function ue(t){return de(t,["topLeft","topRight","bottomLeft","bottomRight"])}function fe(t){const e=function(t){return de(t,{top:"y",right:"x",bottom:"y",left:"x"})}(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function ge(t,e){t=t||{},e=e||Xt.font;let i=F(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));let s=F(t.style,e.style);s&&!(""+s).match(he)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);const n={family:F(t.family,e.family),lineHeight:le(F(t.lineHeight,e.lineHeight),i),size:i,style:s,weight:F(t.weight,e.weight),string:""};return n.string=function(t){return!t||I(t.size)||I(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(n),n}function pe(t,e,i,s){let n,o,r,a=!0;for(n=0,o=t.length;n<o;++n)if(r=t[n],void 0!==r&&(void 0!==e&&"function"==typeof r&&(r=r(e),a=!1),void 0!==i&&L(r)&&(r=r[i%r.length],a=!1),void 0!==r))return s&&!a&&(s.cacheable=!1),r}function xe(t,e){return Object.assign(Object.create(t),e)}function me(t,e=[""],i,s,n=()=>t[0]){const o=i||t;void 0===s&&(s=Oe("_fallback",t));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:o,_fallback:s,_getTarget:n,override:i=>me([i,...t],e,o,s)};return new Proxy(r,{deleteProperty:(e,i)=>(delete e[i],delete e._keys,delete t[0][i],!0),get:(i,s)=>we(i,s,()=>function(t,e,i,s){let n;for(const o of e)if(n=Oe(ye(o,t),i),void 0!==n)return ve(t,n)?Pe(i,s,t,n):n}(s,e,t,i)),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>Te(t).includes(e),ownKeys:t=>Te(t),set(t,e,i){const s=t._storage||(t._storage=n());return t[e]=s[e]=i,delete t._keys,!0}})}function be(t,e,i,s){const n={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:_e(t,s),setContext:e=>be(t,e,i,s),override:n=>be(t.override(n),e,i,s)};return new Proxy(n,{deleteProperty:(e,i)=>(delete e[i],delete t[i],!0),get:(t,e,i)=>we(t,e,()=>function(t,e,i){const{_proxy:s,_context:n,_subProxy:o,_descriptors:r}=t;let a=s[e];return G(a)&&r.isScriptable(e)&&(a=function(t,e,i,s){const{_proxy:n,_context:o,_subProxy:r,_stack:a}=i;if(a.has(t))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+t);a.add(t);let h=e(o,r||s);return a.delete(t),ve(t,h)&&(h=Pe(n._scopes,n,t,h)),h}(e,a,t,i)),L(a)&&a.length&&(a=function(t,e,i,s){const{_proxy:n,_context:o,_subProxy:r,_descriptors:a}=i;if(void 0!==o.index&&s(t))return e[o.index%e.length];if(E(e[0])){const i=e,s=n._scopes.filter(t=>t!==i);e=[];for(const h of i){const i=Pe(s,n,t,h);e.push(be(i,o,r&&r[t],a))}}return e}(e,a,t,r.isIndexable)),ve(e,a)&&(a=be(a,n,o&&o[e],r)),a}(t,e,i)),getOwnPropertyDescriptor:(e,i)=>e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,i)=>Reflect.has(t,i),ownKeys:()=>Reflect.ownKeys(t),set:(e,i,s)=>(t[i]=s,delete e[i],!0)})}function _e(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:s=e.indexable,_allKeys:n=e.allKeys}=t;return{allKeys:n,scriptable:i,indexable:s,isScriptable:G(i)?i:()=>i,isIndexable:G(s)?s:()=>s}}const ye=(t,e)=>t?t+K(e):e,ve=(t,e)=>E(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function we(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e)||"constructor"===e)return t[e];const s=i();return t[e]=s,s}function Me(t,e,i){return G(t)?t(e,i):t}const ke=(t,e)=>!0===t?e:"string"==typeof t?q(e,t):void 0;function Se(t,e,i,s,n){for(const o of e){const e=ke(i,o);if(e){t.add(e);const o=Me(e._fallback,i,n);if(void 0!==o&&o!==i&&o!==s)return o}else if(!1===e&&void 0!==s&&i!==s)return null}return!1}function Pe(t,e,i,s){const n=e._rootScopes,o=Me(e._fallback,i,s),r=[...t,...n],a=new Set;a.add(s);let h=De(a,r,i,o||i,s);return null!==h&&(void 0===o||o===i||(h=De(a,r,o,h,s),null!==h))&&me(Array.from(a),[""],n,o,()=>function(t,e,i){const s=t._getTarget();e in s||(s[e]={});const n=s[e];return L(n)&&E(i)?i:n||{}}(e,i,s))}function De(t,e,i,s,n){for(;i;)i=Se(t,e,i,s,n);return i}function Oe(t,e){for(const i of e){if(!i)continue;const e=i[t];if(void 0!==e)return e}}function Te(t){let e=t._keys;return e||(e=t._keys=function(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)}(t._scopes)),e}const Ce=Number.EPSILON||1e-14,Ae=(t,e)=>e<t.length&&!t[e].skip&&t[e],Ie=t=>"x"===t?"y":"x";function Le(t,e,i,s){const n=t.skip?e:t,o=e,r=i.skip?e:i,a=gt(o,n),h=gt(r,o);let l=a/(a+h),c=h/(a+h);l=isNaN(l)?0:l,c=isNaN(c)?0:c;const d=s*l,u=s*c;return{previous:{x:o.x-d*(r.x-n.x),y:o.y-d*(r.y-n.y)},next:{x:o.x+u*(r.x-n.x),y:o.y+u*(r.y-n.y)}}}function Ee(t,e,i){return Math.max(Math.min(t,i),e)}function Re(t,e,i,s,n){let o,r,a,h;if(e.spanGaps&&(t=t.filter(t=>!t.skip)),"monotone"===e.cubicInterpolationMode)!function(t,e="x"){const i=Ie(e),s=t.length,n=Array(s).fill(0),o=Array(s);let r,a,h,l=Ae(t,0);for(r=0;r<s;++r)if(a=h,h=l,l=Ae(t,r+1),h){if(l){const t=l[e]-h[e];n[r]=0!==t?(l[i]-h[i])/t:0}o[r]=a?l?ht(n[r-1])!==ht(n[r])?0:(n[r-1]+n[r])/2:n[r-1]:n[r]}!function(t,e,i){const s=t.length;let n,o,r,a,h,l=Ae(t,0);for(let c=0;c<s-1;++c)h=l,l=Ae(t,c+1),h&&l&&(lt(e[c],0,Ce)?i[c]=i[c+1]=0:(n=i[c]/e[c],o=i[c+1]/e[c],a=Math.pow(n,2)+Math.pow(o,2),a<=9||(r=3/Math.sqrt(a),i[c]=n*r*e[c],i[c+1]=o*r*e[c])))}(t,n,o),function(t,e,i="x"){const s=Ie(i),n=t.length;let o,r,a,h=Ae(t,0);for(let l=0;l<n;++l){if(r=a,a=h,h=Ae(t,l+1),!a)continue;const n=a[i],c=a[s];r&&(o=(n-r[i])/3,a[`cp1${i}`]=n-o,a[`cp1${s}`]=c-o*e[l]),h&&(o=(h[i]-n)/3,a[`cp2${i}`]=n+o,a[`cp2${s}`]=c+o*e[l])}}(t,o,e)}(t,n);else{let i=s?t[t.length-1]:t[0];for(o=0,r=t.length;o<r;++o)a=t[o],h=Le(i,a,t[Math.min(o+1,r-(s?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&&function(t,e){let i,s,n,o,r,a=Qt(t[0],e);for(i=0,s=t.length;i<s;++i)r=o,o=a,a=i<s-1&&Qt(t[i+1],e),o&&(n=t[i],r&&(n.cp1x=Ee(n.cp1x,e.left,e.right),n.cp1y=Ee(n.cp1y,e.top,e.bottom)),a&&(n.cp2x=Ee(n.cp2x,e.left,e.right),n.cp2y=Ee(n.cp2y,e.top,e.bottom)))}(t,i)}function ze(){return"undefined"!=typeof window&&"undefined"!=typeof document}function Fe(t){let e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e}function Be(t,e,i){let s;return"string"==typeof t?(s=parseInt(t,10),-1!==t.indexOf("%")&&(s=s/100*e.parentNode[i])):s=t,s}const He=t=>t.ownerDocument.defaultView.getComputedStyle(t,null),je=["top","right","bottom","left"];function Ve(t,e,i){const s={};i=i?"-"+i:"";for(let n=0;n<4;n++){const o=je[n];s[o]=parseFloat(t[e+"-"+o+i])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}function We(t,e){if("native"in t)return t;const{canvas:i,currentDevicePixelRatio:s}=e,n=He(i),o="border-box"===n.boxSizing,r=Ve(n,"padding"),a=Ve(n,"border","width"),{x:h,y:l,box:c}=function(t,e){const i=t.touches,s=i&&i.length?i[0]:t,{offsetX:n,offsetY:o}=s;let r,a,h=!1;if(((t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot))(n,o,t.target))r=n,a=o;else{const t=e.getBoundingClientRect();r=s.clientX-t.left,a=s.clientY-t.top,h=!0}return{x:r,y:a,box:h}}(t,i),d=r.left+(c&&a.left),u=r.top+(c&&a.top);let{width:f,height:g}=e;return o&&(f-=r.width+a.width,g-=r.height+a.height),{x:Math.round((h-d)/f*i.width/s),y:Math.round((l-u)/g*i.height/s)}}const $e=t=>Math.round(10*t)/10;function Ne(t,e,i){const s=e||1,n=Math.floor(t.height*s),o=Math.floor(t.width*s);t.height=Math.floor(t.height),t.width=Math.floor(t.width);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!==s||r.height!==n||r.width!==o)&&(t.currentDevicePixelRatio=s,r.height=n,r.width=o,t.ctx.setTransform(s,0,0,s,0,0),!0)}const Ye=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};ze()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch(t){}return t}();function Ue(t,e){const i=function(t,e){return He(t).getPropertyValue(e)}(t,e),s=i&&i.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function Xe(t,e,i,s){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function qe(t,e,i,s){return{x:t.x+i*(e.x-t.x),y:"middle"===s?i<.5?t.y:e.y:"after"===s?i<1?t.y:e.y:i>0?e.y:t.y}}function Ke(t,e,i,s){const n={x:t.cp2x,y:t.cp2y},o={x:e.cp1x,y:e.cp1y},r=Xe(t,n,i),a=Xe(n,o,i),h=Xe(o,e,i),l=Xe(r,a,i),c=Xe(a,h,i);return Xe(l,c,i)}function Ze(t,e,i){return t?function(t,e){return{x:i=>t+t+e-i,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}}(e,i):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function Ge(t){return"angle"===t?{between:mt,compare:pt,normalize:xt}:{between:_t,compare:(t,e)=>t-e,normalize:t=>t}}function Qe({start:t,end:e,count:i,loop:s,style:n}){return{start:t%i,end:e%i,loop:s&&(e-t+1)%i==0,style:n}}function Je(t,e,i){if(!i)return[t];const{property:s,start:n,end:o}=i,r=e.length,{compare:a,between:h,normalize:l}=Ge(s),{start:c,end:d,loop:u,style:f}=function(t,e,i){const{property:s,start:n,end:o}=i,{between:r,normalize:a}=Ge(s),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&&r(a(e[d%h][s]),n,o);++l)d--,u--;d%=h,u%=h}return u<d&&(u+=h),{start:d,end:u,loop:f,style:t.style}}(t,e,i),g=[];let p,x,m,b=!1,_=null;const y=()=>b||h(n,m,p)&&0!==a(n,m),v=()=>!b||0===a(o,p)||h(o,m,p);for(let t=c,i=c;t<=d;++t)x=e[t%r],x.skip||(p=l(x[s]),p!==m&&(b=h(p,n,o),null===_&&y()&&(_=0===a(p,n)?t:i),null!==_&&v()&&(g.push(Qe({start:_,end:t,loop:u,count:r,style:f})),_=null),i=t,m=p));return null!==_&&g.push(Qe({start:_,end:d,loop:u,count:r,style:f})),g}function ti(t,e){const i=[],s=t.segments;for(let n=0;n<s.length;n++){const o=Je(s[n],t.points,e);o.length&&i.push(...o)}return i}function ei(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function ii(t,e){if(!e)return!1;const i=[],s=function(t,e){return Lt(e)?(i.includes(e)||i.push(e),i.indexOf(e)):e};return JSON.stringify(t,s)!==JSON.stringify(e,s)}function si(t,e,i){return t.options.clip?t[i]:e[i]}function ni(t,e){const i=e._clip;if(i.disabled)return!1;const s=function(t,e){const{xScale:i,yScale:s}=t;return i&&s?{left:si(i,e,"left"),right:si(i,e,"right"),top:si(s,e,"top"),bottom:si(s,e,"bottom")}:e}(e,t.chartArea);return{left:!1===i.left?0:s.left-(!0===i.left?0:i.left),right:!1===i.right?t.width:s.right+(!0===i.right?0:i.right),top:!1===i.top?0:s.top-(!0===i.top?0:i.top),bottom:!1===i.bottom?t.height:s.bottom+(!0===i.bottom?0:i.bottom)}}class oi{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,s){const n=e.listeners[s],o=e.duration;n.forEach(s=>s({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(i-e.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=St.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const n=i.items;let o,r=n.length-1,a=!1;for(;r>=0;--r)o=n[r],o._active?(o._total>i.duration&&(i.duration=o._total),o.tick(t),a=!0):(n[r]=n[n.length-1],n.pop());a&&(s.draw(),this._notify(s,i,t,"progress")),n.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=n.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 s=i.length-1;for(;s>=0;--s)i[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var ri=new oi;const ai="transparent",hi={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){const s=Et(t||ai),n=s.valid&&Et(e||ai);return n&&n.valid?n.mix(s,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class li{constructor(t,e,i,s){const n=e[i];s=pe([t.to,s,n,t.from]);const o=pe([t.from,n,s]);this._active=!0,this._fn=t.fn||hi[t.type||typeof o],this._easing=It[t.easing]||It.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=o,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],n=i-this._start,o=this._duration-n;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=n,this._loop=!!t.loop,this._to=pe([t.to,e,s,t.from]),this._from=pe([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,s=this._prop,n=this._from,o=this._loop,r=this._to;let a;if(this._active=n!==r&&(o||e<i),!this._active)return this._target[s]=r,void this._notify(!0);e<0?this._target[s]=n:(a=e/i%2,a=o&&a>1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[s]=this._fn(n,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 t=0;t<i.length;t++)i[t][e]()}}class ci{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!E(t))return;const e=Object.keys(Xt.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const n=t[s];if(!E(n))return;const o={};for(const t of e)o[t]=n[t];(L(n.properties)&&n.properties||[s]).forEach(t=>{t!==s&&i.has(t)||i.set(t,o)})})}_animateOptions(t,e){const i=e.options,s=function(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}(t,i);if(!s)return[];const n=this._createAnimations(s,i);return i.$shared&&function(t,e){const i=[],s=Object.keys(e);for(let e=0;e<s.length;e++){const n=t[s[e]];n&&n.active()&&i.push(n.wait())}return Promise.all(i)}(t.options.$animations,i).then(()=>{t.options=i},()=>{}),n}_createAnimations(t,e){const i=this._properties,s=[],n=t.$animations||(t.$animations={}),o=Object.keys(e),r=Date.now();let a;for(a=o.length-1;a>=0;--a){const h=o[a];if("$"===h.charAt(0))continue;if("options"===h){s.push(...this._animateOptions(t,e));continue}const l=e[h];let c=n[h];const d=i.get(h);if(c){if(d&&c.active()){c.update(d,l,r);continue}c.cancel()}d&&d.duration?(n[h]=c=new li(d,t,h,l),s.push(c)):t[h]=l}return s}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?(ri.add(this._chart,i),!0):void 0}}function di(t,e){const i=t&&t.options||{},s=i.reverse,n=void 0===i.min?e:0,o=void 0===i.max?e:0;return{start:s?o:n,end:s?n:o}}function ui(t,e){const i=[],s=t._getSortedDatasetMetas(e);let n,o;for(n=0,o=s.length;n<o;++n)i.push(s[n].index);return i}function fi(t,e,i,s={}){const n=t.keys,o="single"===s.mode;let r,a,h,l;if(null===e)return;let c=!1;for(r=0,a=n.length;r<a;++r){if(h=+n[r],h===i){if(c=!0,s.all)continue;break}l=t.values[h],R(l)&&(o||0===e||ht(e)===ht(l))&&(e+=l)}return c||s.all?e:0}function gi(t,e){const i=t&&t.options.stacked;return i||void 0===i&&void 0!==e.stack}function pi(t,e,i){const s=t[e]||(t[e]={});return s[i]||(s[i]={})}function xi(t,e,i,s){for(const n of e.getMatchingVisibleMetas(s).reverse()){const e=t[n.index];if(i&&e>0||!i&&e<0)return n.index}return null}function mi(t,e){const{chart:i,_cachedMeta:s}=t,n=i._stacks||(i._stacks={}),{iScale:o,vScale:r,index:a}=s,h=o.axis,l=r.axis,c=function(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}(o,r,s),d=e.length;let u;for(let t=0;t<d;++t){const i=e[t],{[h]:o,[l]:d}=i;u=(i._stacks||(i._stacks={}))[l]=pi(n,c,o),u[a]=d,u._top=xi(u,r,!0,s.type),u._bottom=xi(u,r,!1,s.type),(u._visualValues||(u._visualValues={}))[a]=d}}function bi(t,e){const i=t.scales;return Object.keys(i).filter(t=>i[t].axis===e).shift()}function _i(t,e){const i=t.controller.index,s=t.vScale&&t.vScale.axis;if(s){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[s]||void 0===e[s][i])return;delete e[s][i],void 0!==e[s]._visualValues&&void 0!==e[s]._visualValues[i]&&delete e[s]._visualValues[i]}}}const yi=t=>"reset"===t||"none"===t,vi=(t,e)=>e?t:Object.assign({},t);class wi{static defaults={};static datasetElementType=null;static dataElementType=null;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.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=gi(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&_i(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(t,e,i,s)=>"x"===t?e:"r"===t?s:i,n=e.xAxisID=F(i.xAxisID,bi(t,"x")),o=e.yAxisID=F(i.yAxisID,bi(t,"y")),r=e.rAxisID=F(i.rAxisID,bi(t,"r")),a=e.indexAxis,h=e.iAxisID=s(a,n,o,r),l=e.vAxisID=s(a,o,n,r);e.xScale=this.getScaleForId(n),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(r),e.iScale=this.getScaleForId(h),e.vScale=this.getScaleForId(l)}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&&kt(this._data,this),t._stacked&&_i(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(E(e)){const t=this._cachedMeta;this._data=function(t,e){const{iScale:i,vScale:s}=e,n="x"===i.axis?"x":"y",o="x"===s.axis?"x":"y",r=Object.keys(t),a=new Array(r.length);let h,l,c;for(h=0,l=r.length;h<l;++h)c=r[h],a[h]={[n]:c,[o]:t[c]};return a}(e,t)}else if(i!==e){if(i){kt(i,this);const t=this._cachedMeta;_i(t),t._parsed=[]}e&&Object.isExtensible(e)&&((s=e)._chartjs?s._chartjs.listeners.push(this):(Object.defineProperty(s,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[this]}}),Mt.forEach(t=>{const e="_onData"+K(t),i=s[t];Object.defineProperty(s,t,{configurable:!0,enumerable:!1,value(...t){const n=i.apply(this,t);return s._chartjs.listeners.forEach(i=>{"function"==typeof i[e]&&i[e](...t)}),n}})}))),this._syncList=[],this._data=e}var s}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const n=e._stacked;e._stacked=gi(e.vScale,e),e.stack!==i.stack&&(s=!0,_i(e),e.stack=i.stack),this._resyncElements(t),(s||n!==e._stacked)&&(mi(this,e._parsed),e._stacked=gi(e.vScale,e))}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:n,_stacked:o}=i,r=n.axis;let a,h,l,c=0===t&&e===s.length||i._sorted,d=t>0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=s,i._sorted=!0,l=s;else{l=L(s[t])?this.parseArrayData(i,s,t,e):E(s[t])?this.parseObjectData(i,s,t,e):this.parsePrimitiveData(i,s,t,e);const n=()=>null===h[r]||d&&h[r]<d[r];for(a=0;a<e;++a)i._parsed[a+t]=h=l[a],c&&(n()&&(c=!1),d=h);i._sorted=c}o&&mi(this,l)}parsePrimitiveData(t,e,i,s){const{iScale:n,vScale:o}=t,r=n.axis,a=o.axis,h=n.getLabels(),l=n===o,c=new Array(s);let d,u,f;for(d=0,u=s;d<u;++d)f=d+i,c[d]={[r]:l||n.parse(h[f],f),[a]:o.parse(e[f],f)};return c}parseArrayData(t,e,i,s){const{xScale:n,yScale:o}=t,r=new Array(s);let a,h,l,c;for(a=0,h=s;a<h;++a)l=a+i,c=e[l],r[a]={x:n.parse(c[0],l),y:o.parse(c[1],l)};return r}parseObjectData(t,e,i,s){const{xScale:n,yScale:o}=t,{xAxisKey:r="x",yAxisKey:a="y"}=this._parsing,h=new Array(s);let l,c,d,u;for(l=0,c=s;l<c;++l)d=l+i,u=e[d],h[l]={x:n.parse(q(u,r),d),y:o.parse(q(u,a),d)};return h}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const s=this.chart,n=this._cachedMeta,o=e[t.axis];return fi({keys:ui(s,!0),values:e._stacks[t.axis]._visualValues},o,n.index,{mode:i})}updateRangeFromParsed(t,e,i,s){const n=i[e.axis];let o=null===n?NaN:n;const r=s&&i._stacks[e.axis];s&&r&&(s.values=r,o=fi(s,n,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,n=i._sorted&&t===i.iScale,o=s.length,r=this._getOtherScale(t),a=((t,e,i)=>t&&!e.hidden&&e._stacked&&{keys:ui(i,!0),values:null})(e,i,this.chart),h={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:l,max:c}=function(t){const{min:e,max:i,minDefined:s,maxDefined:n}=t.getUserBounds();return{min:s?e:Number.NEGATIVE_INFINITY,max:n?i:Number.POSITIVE_INFINITY}}(r);let d,u;function f(){u=s[d];const e=u[r.axis];return!R(u[t.axis])||l>e||c<e}for(d=0;d<o&&(f()||(this.updateRangeFromParsed(h,t,u,a),!n));++d);if(n)for(d=o-1;d>=0;--d)if(!f()){this.updateRangeFromParsed(h,t,u,a);break}return h}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let s,n,o;for(s=0,n=e.length;s<n;++s)o=e[s][t.axis],R(o)&&i.push(o);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,s=e.vScale,n=this.getParsed(t);return{label:i?""+i.getLabelForValue(n[i.axis]):"",value:s?""+s.getLabelForValue(n[s.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=function(t){let e,i,s,n;return E(t)?(e=t.top,i=t.right,s=t.bottom,n=t.left):e=i=s=n=t,{top:e,right:i,bottom:s,left:n,disabled:!1===t}}(F(this.options.clip,function(t,e,i){if(!1===i)return!1;const s=di(t,i),n=di(e,i);return{top:n.end,right:s.end,bottom:n.start,left:s.start}}(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,s=i.data||[],n=e.chartArea,o=[],r=this._drawStart||0,a=this._drawCount||s.length-r,h=this.options.drawActiveElementsOnTop;let l;for(i.dataset&&i.dataset.draw(t,n,r,a),l=r;l<r+a;++l){const e=s[l];e.hidden||(e.active&&h?o.push(e):e.draw(t,n))}for(l=0;l<o.length;++l)o[l].draw(t,n)}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 s=this.getDataset();let n;if(t>=0&&t<this._cachedMeta.data.length){const e=this._cachedMeta.data[t];n=e.$context||(e.$context=function(t,e,i){return xe(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:i,index:e,mode:"default",type:"data"})}(this.getContext(),t,e)),n.parsed=this.getParsed(t),n.raw=s.data[t],n.index=n.dataIndex=t}else n=this.$context||(this.$context=function(t,e){return xe(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}(this.chart.getContext(),this.index)),n.dataset=s,n.index=n.datasetIndex=this.index;return n.active=!!e,n.mode=i,n}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,n=this._cachedDataOpts,o=t+"-"+e,r=n[o],a=this.enableOptionSharing&&Z(i);if(r)return vi(r,a);const h=this.chart.config,l=h.datasetElementScopeKeys(this._type,t),c=s?[`${t}Hover`,"hover",t,""]:[t,""],d=h.getOptionScopes(this.getDataset(),l),u=Object.keys(Xt.elements[t]),f=h.resolveNamedOptions(d,u,()=>this.getContext(i,s,e),c);return f.$shared&&(f.$shared=a,n[o]=Object.freeze(vi(f,a))),f}_resolveAnimations(t,e,i){const s=this.chart,n=this._cachedDataOpts,o=`animation-${e}`,r=n[o];if(r)return r;let a;if(!1!==s.options.animation){const s=this.chart.config,n=s.datasetAnimationScopeKeys(this._type,e),o=s.getOptionScopes(this.getDataset(),n);a=s.createResolver(o,this.getContext(t,i,e))}const h=new ci(s,a&&a.animations);return a&&a._cacheable&&(n[o]=Object.freeze(h)),h}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||yi(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),s=this._sharedOptions,n=this.getSharedOptions(i),o=this.includeOptions(e,n)||n!==s;return this.updateSharedOptions(n,e,i),{sharedOptions:n,includeOptions:o}}updateElement(t,e,i,s){yi(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!yi(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;const n=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(n)||n})}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[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];const s=i.length,n=e.length,o=Math.min(n,s);o&&this.parse(0,o),n>s?this._insertElements(s,n-s,t):n<s&&this._removeElements(n,s-n)}_insertElements(t,e,i=!0){const s=this._cachedMeta,n=s.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(n),r=t;r<o;++r)n[r]=new this.dataElementType;this._parsing&&a(s._parsed),this.parse(t,e),i&&this.updateElements(n,t,e,"reset")}updateElements(t,e,i,s){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(t,e);i._stacked&&_i(i,s)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,s]=t;this[e](i,s)}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 Mi(t,e,i,s){const{controller:n,data:o,_sorted:r}=t,a=n._cachedMeta.iScale,h=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null;if(a&&e===a.axis&&"r"!==e&&r&&o.length){const r=a._reversePixels?wt:vt;if(!s){const s=r(o,e,i);if(h){const{vScale:e}=n._cachedMeta,{_parsed:i}=t,o=i.slice(0,s.lo+1).reverse().findIndex(t=>!I(t[e.axis]));s.lo-=Math.max(0,o);const r=i.slice(s.hi).findIndex(t=>!I(t[e.axis]));s.hi+=Math.max(0,r)}return s}if(n._sharedOptions){const t=o[0],s="function"==typeof t.getRange&&t.getRange(e);if(s){const t=r(o,e,i-s),n=r(o,e,i+s);return{lo:t.lo,hi:n.hi}}}}return{lo:0,hi:o.length-1}}function ki(t,e,i,s,n){const o=t.getSortedVisibleDatasetMetas(),r=i[e];for(let t=0,i=o.length;t<i;++t){const{index:i,data:a}=o[t],{lo:h,hi:l}=Mi(o[t],e,r,n);for(let t=h;t<=l;++t){const e=a[t];e.skip||s(e,i,t)}}}function Si(t,e,i,s,n){const o=[];return n||t.isPointInArea(e)?(ki(t,i,e,function(i,r,a){(n||Qt(i,t.chartArea,0))&&i.inRange(e.x,e.y,s)&&o.push({element:i,datasetIndex:r,index:a})},!0),o):o}function Pi(t,e,i,s,n,o){return o||t.isPointInArea(e)?"r"!==i||s?function(t,e,i,s,n,o){let r=[];const a=function(t){const e=-1!==t.indexOf("x"),i=-1!==t.indexOf("y");return function(t,s){const n=e?Math.abs(t.x-s.x):0,o=i?Math.abs(t.y-s.y):0;return Math.sqrt(Math.pow(n,2)+Math.pow(o,2))}}(i);let h=Number.POSITIVE_INFINITY;return ki(t,i,e,function(i,l,c){const d=i.inRange(e.x,e.y,n);if(s&&!d)return;const u=i.getCenterPoint(n);if(!o&&!t.isPointInArea(u)&&!d)return;const f=a(e,u);f<h?(r=[{element:i,datasetIndex:l,index:c}],h=f):f===h&&r.push({element:i,datasetIndex:l,index:c})}),r}(t,e,i,s,n,o):function(t,e,i,s){let n=[];return ki(t,i,e,function(t,i,o){const{startAngle:r,endAngle:a}=t.getProps(["startAngle","endAngle"],s),{angle:h}=function(t,e){const i=e.x-t.x,s=e.y-t.y,n=Math.sqrt(i*i+s*s);let o=Math.atan2(s,i);return o<-.5*J&&(o+=tt),{angle:o,distance:n}}(t,{x:e.x,y:e.y});mt(h,r,a)&&n.push({element:t,datasetIndex:i,index:o})}),n}(t,e,i,n):[]}function Di(t,e,i,s,n){const o=[],r="x"===i?"inXRange":"inYRange";let a=!1;return ki(t,i,e,(t,s,h)=>{t[r]&&t[r](e[i],n)&&(o.push({element:t,datasetIndex:s,index:h}),a=a||t.inRange(e.x,e.y,n))}),s&&!a?[]:o}var Oi={evaluateInteractionItems:ki,modes:{index(t,e,i,s){const n=We(e,t),o=i.axis||"x",r=i.includeInvisible||!1,a=i.intersect?Si(t,n,o,s,r):Pi(t,n,o,!1,s,r),h=[];return a.length?(t.getSortedVisibleDatasetMetas().forEach(t=>{const e=a[0].index,i=t.data[e];i&&!i.skip&&h.push({element:i,datasetIndex:t.index,index:e})}),h):[]},dataset(t,e,i,s){const n=We(e,t),o=i.axis||"xy",r=i.includeInvisible||!1;let a=i.intersect?Si(t,n,o,s,r):Pi(t,n,o,!1,s,r);if(a.length>0){const e=a[0].datasetIndex,i=t.getDatasetMeta(e).data;a=[];for(let t=0;t<i.length;++t)a.push({element:i[t],datasetIndex:e,index:t})}return a},point:(t,e,i,s)=>Si(t,We(e,t),i.axis||"xy",s,i.includeInvisible||!1),nearest(t,e,i,s){const n=We(e,t),o=i.axis||"xy",r=i.includeInvisible||!1;return Pi(t,n,o,i.intersect,s,r)},x:(t,e,i,s)=>Di(t,We(e,t),"x",i.intersect,s),y:(t,e,i,s)=>Di(t,We(e,t),"y",i.intersect,s)}};const Ti=["left","top","right","bottom"];function Ci(t,e){return t.filter(t=>t.pos===e)}function Ai(t,e){return t.filter(t=>-1===Ti.indexOf(t.pos)&&t.box.axis===e)}function Ii(t,e){return t.sort((t,i)=>{const s=e?i:t,n=e?t:i;return s.weight===n.weight?s.index-n.index:s.weight-n.weight})}function Li(t,e,i,s){return Math.max(t[i],e[i])+Math.max(t[s],e[s])}function Ei(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 Ri(t,e,i,s){const{pos:n,box:o}=i,r=t.maxPadding;if(!E(n)){i.size&&(t[n]-=i.size);const e=s[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?o.height:o.width),i.size=e.size/e.count,t[n]+=i.size}o.getPadding&&Ei(r,o.getPadding());const a=Math.max(0,e.outerWidth-Li(r,t,"left","right")),h=Math.max(0,e.outerHeight-Li(r,t,"top","bottom")),l=a!==t.w,c=h!==t.h;return t.w=a,t.h=h,i.horizontal?{same:l,other:c}:{same:c,other:l}}function zi(t,e){const i=e.maxPadding;return function(t){const s={left:0,top:0,right:0,bottom:0};return t.forEach(t=>{s[t]=Math.max(e[t],i[t])}),s}(t?["left","right"]:["top","bottom"])}function Fi(t,e,i,s){const n=[];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,zi(a.horizontal,e));const{same:r,other:d}=Ri(e,i,a,s);l|=r&&n.length,c=c||d,h.fullSize||n.push(a)}return l&&Fi(n,e,i,s)||c}function Bi(t,e,i,s,n){t.top=i,t.left=e,t.right=e+s,t.bottom=i+n,t.width=s,t.height=n}function Hi(t,e,i,s){const n=i.padding;let{x:o,y:r}=e;for(const a of t){const t=a.box,h=s[a.stack]||{count:1,placed:0,weight:1},l=a.stackWeight/h.weight||1;if(a.horizontal){const s=e.w*l,o=h.size||t.height;Z(h.start)&&(r=h.start),t.fullSize?Bi(t,n.left,r,i.outerWidth-n.right-n.left,o):Bi(t,e.left+h.placed,r,s,o),h.start=r,h.placed+=s,r=t.bottom}else{const s=e.h*l,r=h.size||t.width;Z(h.start)&&(o=h.start),t.fullSize?Bi(t,o,n.top,r,i.outerHeight-n.bottom-n.top):Bi(t,o,e.top+h.placed,r,s),h.start=o,h.placed+=s,o=t.right}}e.x=o,e.y=r}var ji={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 n=fe(t.options.layout.padding),o=Math.max(e-n.width,0),r=Math.max(i-n.height,0),a=function(t){const e=function(t){const e=[];let i,s,n,o,r,a;for(i=0,s=(t||[]).length;i<s;++i)n=t[i],({position:o,options:{stack:r,stackWeight:a=1}}=n),e.push({index:i,box:n,pos:o,horizontal:n.isHorizontal(),weight:n.weight,stack:r&&o+r,stackWeight:a});return e}(t),i=Ii(e.filter(t=>t.box.fullSize),!0),s=Ii(Ci(e,"left"),!0),n=Ii(Ci(e,"right")),o=Ii(Ci(e,"top"),!0),r=Ii(Ci(e,"bottom")),a=Ai(e,"x"),h=Ai(e,"y");return{fullSize:i,leftAndTop:s.concat(o),rightAndBottom:n.concat(h).concat(r).concat(a),chartArea:Ci(e,"chartArea"),vertical:s.concat(n).concat(h),horizontal:o.concat(r).concat(a)}}(t.boxes),h=a.vertical,l=a.horizontal;H(t.boxes,t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()});const c=h.reduce((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1,0)||1,d=Object.freeze({outerWidth:e,outerHeight:i,padding:n,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/c,hBoxMaxHeight:r/2}),u=Object.assign({},n);Ei(u,fe(s));const f=Object.assign({maxPadding:u,w:o,h:r,x:n.left,y:n.top},n),g=function(t,e){const i=function(t){const e={};for(const i of t){const{stack:t,pos:s,stackWeight:n}=i;if(!t||!Ti.includes(s))continue;const o=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=n}return e}(t),{vBoxMaxWidth:s,hBoxMaxHeight:n}=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*s:r&&e.availableWidth,a.height=n):(a.width=s,a.height=l?l*n:r&&e.availableHeight)}return i}(h.concat(l),d);Fi(a.fullSize,f,d,g),Fi(h,f,d,g),Fi(l,f,d,g)&&Fi(h,f,d,g),function(t){const e=t.maxPadding;function i(i){const s=Math.max(e[i]-t[i],0);return t[i]+=s,s}t.y+=i("top"),t.x+=i("left"),i("right"),i("bottom")}(f),Hi(a.leftAndTop,f,d,g),f.x+=f.w,f.y+=f.h,Hi(a.rightAndBottom,f,d,g),t.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},H(a.chartArea,e=>{const i=e.box;Object.assign(i,t.chartArea),i.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class Vi{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,s){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):i)}}isAttached(t){return!0}updateConfig(t){}}class Wi extends Vi{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const $i="$chartjs",Ni={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Yi=t=>null===t||""===t,Ui=!!Ye&&{passive:!0};function Xi(t,e,i){t&&t.canvas&&t.canvas.removeEventListener(e,i,Ui)}function qi(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function Ki(t,e,i){const s=t.canvas,n=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||qi(i.addedNodes,s),e=e&&!qi(i.removedNodes,s);e&&i()});return n.observe(document,{childList:!0,subtree:!0}),n}function Zi(t,e,i){const s=t.canvas,n=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||qi(i.removedNodes,s),e=e&&!qi(i.addedNodes,s);e&&i()});return n.observe(document,{childList:!0,subtree:!0}),n}const Gi=new Map;let Qi=0;function Ji(){const t=window.devicePixelRatio;t!==Qi&&(Qi=t,Gi.forEach((e,i)=>{i.currentDevicePixelRatio!==t&&e()}))}function ts(t,e,i){const s=t.canvas,n=s&&Fe(s);if(!n)return;const o=Pt((t,e)=>{const s=n.clientWidth;i(t,e),s<n.clientWidth&&i()},window),r=new ResizeObserver(t=>{const e=t[0],i=e.contentRect.width,s=e.contentRect.height;0===i&&0===s||o(i,s)});return r.observe(n),function(t,e){Gi.size||window.addEventListener("resize",Ji),Gi.set(t,e)}(t,o),r}function es(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){Gi.delete(t),Gi.size||window.removeEventListener("resize",Ji)}(t)}function is(t,e,i){const s=t.canvas,n=Pt(e=>{null!==t.ctx&&i(function(t,e){const i=Ni[t.type]||t.type,{x:s,y:n}=We(t,e);return{type:i,chart:e,native:t,x:void 0!==s?s:null,y:void 0!==n?n:null}}(e,t))},t);return function(t,e,i){t&&t.addEventListener(e,i,Ui)}(s,e,n),n}class ss extends Vi{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(function(t,e){const i=t.style,s=t.getAttribute("height"),n=t.getAttribute("width");if(t[$i]={initial:{height:s,width:n,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",Yi(n)){const e=Ue(t,"width");void 0!==e&&(t.width=e)}if(Yi(s))if(""===t.style.height)t.height=t.width/(e||2);else{const e=Ue(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[$i])return!1;const i=e[$i].initial;["height","width"].forEach(t=>{const s=i[t];I(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[$i],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),n={attach:Ki,detach:Zi,resize:ts}[e]||is;s[e]=n(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];s&&(({attach:es,detach:es,resize:es}[e]||Xi)(t,e,s),i[e]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return function(t,e,i,s){const n=He(t),o=Ve(n,"margin"),r=Be(n.maxWidth,t,"clientWidth")||it,a=Be(n.maxHeight,t,"clientHeight")||it,h=function(t,e,i){let s,n;if(void 0===e||void 0===i){const o=t&&Fe(t);if(o){const t=o.getBoundingClientRect(),r=He(o),a=Ve(r,"border","width"),h=Ve(r,"padding");e=t.width-h.width-a.width,i=t.height-h.height-a.height,s=Be(r.maxWidth,o,"clientWidth"),n=Be(r.maxHeight,o,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:s||it,maxHeight:n||it}}(t,e,i);let{width:l,height:c}=h;if("content-box"===n.boxSizing){const t=Ve(n,"border","width"),e=Ve(n,"padding");l-=e.width+t.width,c-=e.height+t.height}return l=Math.max(0,l-o.width),c=Math.max(0,s?l/s:c-o.height),l=$e(Math.min(l,r,h.maxWidth)),c=$e(Math.min(c,a,h.maxHeight)),l&&!c&&(c=$e(l/2)),(void 0!==e||void 0!==i)&&s&&h.height&&c>h.height&&(c=h.height,l=$e(Math.floor(c*s))),{width:l,height:c}}(t,e,i,s)}isAttached(t){const e=t&&Fe(t);return!(!e||!e.isConnected)}}class ns{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return dt(this.x)&&dt(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const s={};return t.forEach(t=>{s[t]=i[t]&&i[t].active()?i[t]._to:this[t]}),s}}function os(t,e,i,s,n){const o=F(s,0),r=Math.min(F(n,t.length),t.length);let a,h,l,c=0;for(i=Math.ceil(i),n&&(a=n-s,i=a/Math.floor(a/i)),l=o;l<0;)c++,l=Math.round(o+c*i);for(h=Math.max(o,0);h<r;h++)h===l&&(e.push(t[h]),c++,l=Math.round(o+c*i))}const rs=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i,as=(t,e)=>Math.min(e||t,t);function hs(t,e){const i=[],s=t.length/e,n=t.length;let o=0;for(;o<n;o+=s)i.push(t[Math.floor(o)]);return i}function ls(t,e,i){const s=t.ticks.length,n=Math.min(e,s-1),o=t._startPixel,r=t._endPixel,a=1e-6;let h,l=t.getPixelForTick(n);if(!(i&&(h=1===s?Math.max(l-o,r-l):0===e?(t.getPixelForTick(1)-l)/2:(l-t.getPixelForTick(n-1))/2,l+=n<e?h:-h,l<o-a||l>r+a)))return l}function cs(t){return t.drawTicks?t.tickLength:0}function ds(t,e){if(!t.display)return 0;const i=ge(t.font,e),s=fe(t.padding);return(L(t.text)?t.text.length:1)*i.lineHeight+s.height}function us(t,e,i){let s=Dt(t);return(i&&"right"!==e||!i&&"right"===e)&&(s=(t=>"left"===t?"right":"right"===t?"left":t)(s)),s}class fs extends ns{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=z(t,Number.POSITIVE_INFINITY),e=z(e,Number.NEGATIVE_INFINITY),i=z(i,Number.POSITIVE_INFINITY),s=z(s,Number.NEGATIVE_INFINITY),{min:z(t,i),max:z(e,s),minDefined:R(t),maxDefined:R(e)}}getMinMax(t){let e,{min:i,max:s,minDefined:n,maxDefined:o}=this.getUserBounds();if(n&&o)return{min:i,max:s};const r=this.getMatchingVisibleMetas();for(let a=0,h=r.length;a<h;++a)e=r[a].controller.getMinMax(this,t),n||(i=Math.min(i,e.min)),o||(s=Math.max(s,e.max));return i=o&&i>s?s:i,s=n&&i>s?i:s,{min:z(i,z(s,i)),max:z(s,z(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||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){B(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:s,grace:n,ticks:o}=this.options,r=o.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=function(t,e,i){const{min:s,max:n}=t,o=(h=(n-s)/2,"string"==typeof(a=e)&&a.endsWith("%")?parseFloat(a)/100*h:+a),r=(t,e)=>i&&0===t?0:t+e;var a,h;return{min:r(s,-Math.abs(o)),max:r(n,o)}}(this,n,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=r<this.ticks.length;this._convertTicksToLabels(a?hs(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||"auto"===o.source)&&(this.ticks=function(t,e){const i=t.options.ticks,s=function(t){const e=t.options.offset,i=t._tickSize(),s=t._length/i+(e?0:1),n=t._maxLength/i;return Math.floor(Math.min(s,n))}(t),n=Math.min(i.maxTicksLimit||s,s),o=i.major.enabled?function(t){const e=[];let i,s;for(i=0,s=t.length;i<s;i++)t[i].major&&e.push(i);return e}(e):[],r=o.length,a=o[0],h=o[r-1],l=[];if(r>n)return function(t,e,i,s){let n,o=0,r=i[0];for(s=Math.ceil(s),n=0;n<t.length;n++)n===r&&(e.push(t[n]),o++,r=i[o*s])}(e,l,o,r/n),l;const c=function(t,e,i){const s=function(t){const e=t.length;let i,s;if(e<2)return!1;for(s=t[0],i=1;i<e;++i)if(t[i]-t[i-1]!==s)return!1;return s}(t),n=e.length/i;if(!s)return Math.max(n,1);const o=function(t){const e=[],i=Math.sqrt(t);let s;for(s=1;s<i;s++)t%s===0&&(e.push(s),e.push(t/s));return i===(0|i)&&e.push(i),e.sort((t,e)=>t-e).pop(),e}(s);for(let t=0,e=o.length-1;t<e;t++){const e=o[t];if(e>n)return e}return Math.max(n,1)}(o,e,n);if(r>0){let t,i;const s=r>1?Math.round((h-a)/(r-1)):null;for(os(e,l,c,I(s)?0:a-s,a),t=0,i=r-1;t<i;t++)os(e,l,c,o[t],o[t+1]);return os(e,l,c,h,I(s)?e.length:h+s),l}return os(e,l,c),l}(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),a&&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(){B(this.options.afterUpdate,[this])}beforeSetDimensions(){B(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(){B(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),B(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){B(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,s,n;for(i=0,s=t.length;i<s;i++)n=t[i],n.label=B(e.callback,[n.value,i,t],this)}afterTickToLabelConversion(){B(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){B(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=as(this.ticks.length,t.ticks.maxTicksLimit),s=e.minRotation||0,n=e.maxRotation;let o,r,a,h=s;if(!this._isVisible()||!e.display||s>=n||i<=1||!this.isHorizontal())return void(this.labelRotation=s);const l=this._getLabelSizes(),c=l.widest.width,d=l.highest.height,u=bt(this.chart.width-c,0,this.maxWidth);o=t.offset?this.maxWidth/i:u/(i-1),c+6>o&&(o=u/(i-(t.offset?.5:1)),r=this.maxHeight-cs(t.grid)-e.padding-ds(t.title,this.chart.options.font),a=Math.sqrt(c*c+d*d),h=Math.min(Math.asin(bt((l.highest.height+6)/o,-1,1)),Math.asin(bt(r/a,-1,1))-Math.asin(bt(d/a,-1,1)))*(180/J),h=Math.max(s,Math.min(n,h))),this.labelRotation=h}afterCalculateLabelRotation(){B(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){B(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:n}}=this,o=this._isVisible(),r=this.isHorizontal();if(o){const o=ds(s,e.options.font);if(r?(t.width=this.maxWidth,t.height=cs(n)+o):(t.height=this.maxHeight,t.width=cs(n)+o),i.display&&this.ticks.length){const{first:e,last:s,widest:n,highest:o}=this._getLabelSizes(),a=2*i.padding,h=ut(this.labelRotation),l=Math.cos(h),c=Math.sin(h);if(r){const e=i.mirror?0:c*n.width+l*o.height;t.height=Math.min(this.maxHeight,t.height+e+a)}else{const e=i.mirror?0:l*n.width+c*o.height;t.width=Math.min(this.maxWidth,t.width+e+a)}this._calculatePadding(e,s,c,l)}}this._handleMargins(),r?(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,s){const{ticks:{align:n,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=s*t.width,d=i*e.height):(c=i*t.height,d=s*e.width):"start"===n?d=e.width:"end"===n?c=t.width:"inner"!==n&&(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,s=t.height/2;"start"===n?(i=0,s=t.height):"end"===n&&(i=e.height,s=0),this.paddingTop=i+o,this.paddingBottom=s+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(){B(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++)I(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=hs(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:s,_longestTextCache:n}=this,o=[],r=[],a=Math.floor(e/as(e,i));let h,l,c,d,u,f,g,p,x,m,b,_=0,y=0;for(h=0;h<e;h+=a){if(d=t[h].label,u=this._resolveTickFontOptions(h),s.font=f=u.string,g=n[f]=n[f]||{data:{},gc:[]},p=u.lineHeight,x=m=0,I(d)||L(d)){if(L(d))for(l=0,c=d.length;l<c;++l)b=d[l],I(b)||L(b)||(x=qt(s,g.data,g.gc,x,b),m+=p)}else x=qt(s,g.data,g.gc,x,d),m=p;o.push(x),r.push(m),_=Math.max(x,_),y=Math.max(m,y)}!function(t,e){H(t,t=>{const i=t.gc,s=i.length/2;let n;if(s>e){for(n=0;n<s;++n)delete t.data[i[n]];i.splice(0,s)}})}(n,e);const v=o.indexOf(_),w=r.indexOf(y),M=t=>({width:o[t]||0,height:r[t]||0});return{first:M(0),last:M(e-1),widest:M(v),highest:M(w),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 bt(this._alignToPixels?Kt(this.chart,e,0):e,-32768,32767)}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=function(t,e,i){return xe(t,{tick:i,index:e,type:"tick"})}(this.getContext(),t,i))}return this.$context||(this.$context=xe(this.chart.getContext(),{scale:this,type:"scale"}))}_tickSize(){const t=this.options.ticks,e=ut(this.labelRotation),i=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),n=this._getLabelSizes(),o=t.autoSkipPadding||0,r=n?n.widest.width+o:0,a=n?n.highest.height+o:0;return this.isHorizontal()?a*i>r*s?r/i:a/s:a*s<r*i?a/i:r/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:n,position:o,border:r}=s,a=n.offset,h=this.isHorizontal(),l=this.ticks.length+(a?1:0),c=cs(n),d=[],u=r.setContext(this.getContext()),f=u.display?u.width:0,g=f/2,p=function(t){return Kt(i,t,f)};let x,m,b,_,y,v,w,M,k,S,P,D;if("top"===o)x=p(this.bottom),v=this.bottom-c,M=x-g,S=p(t.top)+g,D=t.bottom;else if("bottom"===o)x=p(this.top),S=t.top,D=p(t.bottom)-g,v=x+g,M=this.top+c;else if("left"===o)x=p(this.right),y=this.right-c,w=x-g,k=p(t.left)+g,P=t.right;else if("right"===o)x=p(this.left),k=t.left,P=p(t.right)-g,y=x+g,w=this.left+c;else if("x"===e){if("center"===o)x=p((t.top+t.bottom)/2+.5);else if(E(o)){const t=Object.keys(o)[0],e=o[t];x=p(this.chart.scales[t].getPixelForValue(e))}S=t.top,D=t.bottom,v=x+g,M=v+c}else if("y"===e){if("center"===o)x=p((t.left+t.right)/2);else if(E(o)){const t=Object.keys(o)[0],e=o[t];x=p(this.chart.scales[t].getPixelForValue(e))}y=x-g,w=y-c,k=t.left,P=t.right}const O=F(s.ticks.maxTicksLimit,l),T=Math.max(1,Math.ceil(l/O));for(m=0;m<l;m+=T){const t=this.getContext(m),e=n.setContext(t),s=r.setContext(t),o=e.lineWidth,l=e.color,c=s.dash||[],u=s.dashOffset,f=e.tickWidth,g=e.tickColor,p=e.tickBorderDash||[],x=e.tickBorderDashOffset;b=ls(this,m,a),void 0!==b&&(_=Kt(i,b,o),h?y=w=k=P=_:v=M=S=D=_,d.push({tx1:y,ty1:v,tx2:w,ty2:M,x1:k,y1:S,x2:P,y2:D,width:o,color:l,borderDash:c,borderDashOffset:u,tickWidth:f,tickColor:g,tickBorderDash:p,tickBorderDashOffset:x}))}return this._ticksLength=l,this._borderValue=x,d}_computeLabelItems(t){const e=this.axis,i=this.options,{position:s,ticks:n}=i,o=this.isHorizontal(),r=this.ticks,{align:a,crossAlign:h,padding:l,mirror:c}=n,d=cs(i.grid),u=d+l,f=c?-l:u,g=-ut(this.labelRotation),p=[];let x,m,b,_,y,v,w,M,k,S,P,D,O="middle";if("top"===s)v=this.bottom-f,w=this._getXAxisLabelAlignment();else if("bottom"===s)v=this.top+f,w=this._getXAxisLabelAlignment();else if("left"===s){const t=this._getYAxisLabelAlignment(d);w=t.textAlign,y=t.x}else if("right"===s){const t=this._getYAxisLabelAlignment(d);w=t.textAlign,y=t.x}else if("x"===e){if("center"===s)v=(t.top+t.bottom)/2+u;else if(E(s)){const t=Object.keys(s)[0],e=s[t];v=this.chart.scales[t].getPixelForValue(e)+u}w=this._getXAxisLabelAlignment()}else if("y"===e){if("center"===s)y=(t.left+t.right)/2-u;else if(E(s)){const t=Object.keys(s)[0],e=s[t];y=this.chart.scales[t].getPixelForValue(e)}w=this._getYAxisLabelAlignment(d).textAlign}"y"===e&&("start"===a?O="top":"end"===a&&(O="bottom"));const T=this._getLabelSizes();for(x=0,m=r.length;x<m;++x){b=r[x],_=b.label;const t=n.setContext(this.getContext(x));M=this.getPixelForTick(x)+n.labelOffset,k=this._resolveTickFontOptions(x),S=k.lineHeight,P=L(_)?_.length:1;const e=P/2,i=t.color,a=t.textStrokeColor,l=t.textStrokeWidth;let d,u=w;if(o?(y=M,"inner"===w&&(u=x===m-1?this.options.reverse?"left":"right":0===x?this.options.reverse?"right":"left":"center"),D="top"===s?"near"===h||0!==g?-P*S+S/2:"center"===h?-T.highest.height/2-e*S+S:-T.highest.height+S/2:"near"===h||0!==g?S/2:"center"===h?T.highest.height/2-e*S:T.highest.height-P*S,c&&(D*=-1),0===g||t.showLabelBackdrop||(y+=S/2*Math.sin(g))):(v=M,D=(1-P)*S/2),t.showLabelBackdrop){const e=fe(t.backdropPadding),i=T.heights[x],s=T.widths[x];let n=D-e.top,o=0-e.left;switch(O){case"middle":n-=i/2;break;case"bottom":n-=i}switch(w){case"center":o-=s/2;break;case"right":o-=s;break;case"inner":x===m-1?o-=s:x>0&&(o-=s/2)}d={left:o,top:n,width:s+e.width,height:i+e.height,color:t.backdropColor}}p.push({label:_,font:k,textOffset:D,options:{rotation:g,color:i,strokeColor:a,strokeWidth:l,textAlign:u,textBaseline:O,translation:[y,v],backdrop:d}})}return p}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-ut(this.labelRotation))return"top"===t?"left":"right";let i="center";return"start"===e.align?i="left":"end"===e.align?i="right":"inner"===e.align&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:s,padding:n}}=this.options,o=t+n,r=this._getLabelSizes().widest.width;let a,h;return"left"===e?s?(h=this.right+n,"near"===i?a="left":"center"===i?(a="center",h+=r/2):(a="right",h+=r)):(h=this.right-o,"near"===i?a="right":"center"===i?(a="center",h-=r/2):(a="left",h=this.left)):"right"===e?s?(h=this.left+n,"near"===i?a="right":"center"===i?(a="center",h-=r/2):(a="left",h-=r)):(h=this.left+o,"near"===i?a="left":"center"===i?(a="center",h+=r/2):(a="right",h=this.right)):a="right",{textAlign:a,x:h}}_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:s,width:n,height:o}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,s,n,o),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const i=this.ticks.findIndex(e=>e.value===t);return i>=0?e.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let n,o;const r=(t,e,s)=>{s.width&&s.color&&(i.save(),i.lineWidth=s.width,i.strokeStyle=s.color,i.setLineDash(s.borderDash||[]),i.lineDashOffset=s.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(e.display)for(n=0,o=s.length;n<o;++n){const t=s[n];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:{border:i,grid:s}}=this,n=i.setContext(this.getContext()),o=i.display?n.width:0;if(!o)return;const r=s.setContext(this.getContext(0)).lineWidth,a=this._borderValue;let h,l,c,d;this.isHorizontal()?(h=Kt(t,this.left,o)-o/2,l=Kt(t,this.right,r)+r/2,c=d=a):(c=Kt(t,this.top,o)-o/2,d=Kt(t,this.bottom,r)+r/2,h=l=a),e.save(),e.lineWidth=n.width,e.strokeStyle=n.color,e.beginPath(),e.moveTo(h,c),e.lineTo(l,d),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const e=this.ctx,i=this._computeLabelArea();i&&Jt(e,i);const s=this.getLabelItems(t);for(const t of s){const i=t.options,s=t.font;oe(e,t.label,0,t.textOffset,s,i)}i&&te(e)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:s}}=this;if(!i.display)return;const n=ge(i.font),o=fe(i.padding),r=i.align;let a=n.lineHeight/2;"bottom"===e||"center"===e||E(e)?(a+=o.bottom,L(i.text)&&(a+=n.lineHeight*(i.text.length-1))):a+=o.top;const{titleX:h,titleY:l,maxWidth:c,rotation:d}=function(t,e,i,s){const{top:n,left:o,bottom:r,right:a,chart:h}=t,{chartArea:l,scales:c}=h;let d,u,f,g=0;const p=r-n,x=a-o;if(t.isHorizontal()){if(u=Ot(s,o,a),E(i)){const t=Object.keys(i)[0],s=i[t];f=c[t].getPixelForValue(s)+p-e}else f="center"===i?(l.bottom+l.top)/2+p-e:rs(t,i,e);d=a-o}else{if(E(i)){const t=Object.keys(i)[0],s=i[t];u=c[t].getPixelForValue(s)-x+e}else u="center"===i?(l.left+l.right)/2-x+e:rs(t,i,e);f=Ot(s,r,n),g="left"===i?-nt:nt}return{titleX:u,titleY:f,maxWidth:d,rotation:g}}(this,a,e,r);oe(t,i.text,0,0,n,{color:i.color,maxWidth:c,rotation:d,textAlign:us(r,e,s),textBaseline:"middle",translation:[h,l]})}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=F(t.grid&&t.grid.z,-1),s=F(t.border&&t.border.z,0);return this._isVisible()&&this.draw===fs.prototype.draw?[{z:i,draw:t=>{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:s,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",s=[];let n,o;for(n=0,o=e.length;n<o;++n){const o=e[n];o[i]!==this.id||t&&o.type!==t||s.push(o)}return s}_resolveTickFontOptions(t){return ge(this.options.ticks.setContext(this.getContext(t)).font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class gs{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;(function(t){return"id"in t&&"defaults"in t})(e)&&(i=this.register(e));const s=this.items,n=t.id,o=this.scope+"."+n;if(!n)throw new Error("class does not have id: "+t);return n in s||(s[n]=t,function(t,e,i){const s=N(Object.create(null),[i?Xt.get(i):{},Xt.get(e),t.defaults]);Xt.set(e,s),t.defaultRoutes&&function(t,e){Object.keys(e).forEach(i=>{const s=i.split("."),n=s.pop(),o=[t].concat(s).join("."),r=e[i].split("."),a=r.pop(),h=r.join(".");Xt.route(o,n,h,a)})}(e,t.defaultRoutes),t.descriptors&&Xt.describe(e,t.descriptors)}(t,o,i),this.override&&Xt.override(t.id,t.overrides)),o}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 Xt[s]&&(delete Xt[s][i],this.override&&delete Wt[i])}}class ps{constructor(){this.controllers=new gs(wi,"datasets",!0),this.elements=new gs(ns,"elements"),this.plugins=new gs(Object,"plugins"),this.scales=new gs(fs,"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):H(e,e=>{const s=i||this._getRegistryForType(e);this._exec(t,s,e)})})}_exec(t,e,i){const s=K(t);B(i["before"+s],[],i),e[t](i),B(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 s=e.get(t);if(void 0===s)throw new Error('"'+t+'" is not a registered '+i+".");return s}}var xs=new ps;class ms{constructor(){this._init=[]}notify(t,e,i,s){"beforeInit"===e&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const n=s?this._descriptors(t).filter(s):this._descriptors(t),o=this._notify(n,t,e,i);return"afterDestroy"===e&&(this._notify(n,t,"stop"),this._notify(this._init,t,"uninstall")),o}_notify(t,e,i,s){s=s||{};for(const n of t){const t=n.plugin;if(!1===B(t[i],[e,s,n.options],t)&&s.cancelable)return!1}return!0}invalidate(){I(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=F(i.options&&i.options.plugins,{}),n=function(t){const e={},i=[],s=Object.keys(xs.plugins.items);for(let t=0;t<s.length;t++)i.push(xs.getPlugin(s[t]));const n=t.plugins||[];for(let t=0;t<n.length;t++){const s=n[t];-1===i.indexOf(s)&&(i.push(s),e[s.id]=!0)}return{plugins:i,localIds:e}}(i);return!1!==s||e?function(t,{plugins:e,localIds:i},s,n){const o=[],r=t.getContext();for(const a of e){const e=a.id,h=bs(s[e],n);null!==h&&o.push({plugin:a,options:_s(t.config,{plugin:a,local:i[e]},h,r)})}return o}(t,n,s,e):[]}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,s=(t,e)=>t.filter(t=>!e.some(e=>t.plugin.id===e.plugin.id));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}}function bs(t,e){return e||!1!==t?!0===t?{}:t:null}function _s(t,{plugin:e,local:i},s,n){const o=t.pluginScopeKeys(e),r=t.getOptionScopes(s,o);return i&&e.defaults&&r.push(e.defaults),t.createResolver(r,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function ys(t,e){const i=Xt.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function vs(t){if("x"===t||"y"===t||"r"===t)return t}function ws(t){return"top"===t||"bottom"===t?"x":"left"===t||"right"===t?"y":void 0}function Ms(t,...e){if(vs(t))return t;for(const i of e){const e=i.axis||ws(i.position)||t.length>1&&vs(t[0].toLowerCase());if(e)return e}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function ks(t,e,i){if(i[e+"AxisID"]===t)return{axis:e}}function Ss(t){const e=t.options||(t.options={});e.plugins=F(e.plugins,{}),e.scales=function(t,e){const i=Wt[t.type]||{scales:{}},s=e.scales||{},n=ys(t.type,e),o=Object.create(null);return Object.keys(s).forEach(e=>{const r=s[e];if(!E(r))return console.error(`Invalid scale configuration for scale: ${e}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${e}`);const a=Ms(e,r,function(t,e){if(e.data&&e.data.datasets){const i=e.data.datasets.filter(e=>e.xAxisID===t||e.yAxisID===t);if(i.length)return ks(t,"x",i[0])||ks(t,"y",i[0])}return{}}(e,t),Xt.scales[r.type]),h=function(t,e){return t===e?"_index_":"_value_"}(a,n),l=i.scales||{};o[e]=Y(Object.create(null),[{axis:a},r,l[a],l[h]])}),t.data.datasets.forEach(i=>{const n=i.type||t.type,r=i.indexAxis||ys(n,e),a=(Wt[n]||{}).scales||{};Object.keys(a).forEach(t=>{const e=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,r),n=i[e+"AxisID"]||e;o[n]=o[n]||Object.create(null),Y(o[n],[{axis:e},s[n],a[t]])})}),Object.keys(o).forEach(t=>{const e=o[t];Y(e,[Xt.scales[e.type],Xt.scale])}),o}(t,e)}function Ps(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const Ds=new Map,Os=new Set;function Ts(t,e){let i=Ds.get(t);return i||(i=e(),Ds.set(t,i),Os.add(i)),i}const Cs=(t,e,i)=>{const s=q(e,i);void 0!==s&&t.add(s)};class As{constructor(t){this._config=function(t){return(t=t||{}).data=Ps(t.data),Ss(t),t}(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=Ps(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(),Ss(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Ts(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Ts(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Ts(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id;return Ts(`${this.type}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let s=i.get(t);return s&&!e||(s=new Map,i.set(t,s)),s}getOptionScopes(t,e,i){const{options:s,type:n}=this,o=this._cachedScopes(t,i),r=o.get(e);if(r)return r;const a=new Set;e.forEach(e=>{t&&(a.add(t),e.forEach(e=>Cs(a,t,e))),e.forEach(t=>Cs(a,s,t)),e.forEach(t=>Cs(a,Wt[n]||{},t)),e.forEach(t=>Cs(a,Xt,t)),e.forEach(t=>Cs(a,$t,t))});const h=Array.from(a);return 0===h.length&&h.push(Object.create(null)),Os.has(e)&&o.set(e,h),h}chartOptionScopes(){const{options:t,type:e}=this;return[t,Wt[e]||{},Xt.datasets[e]||{},{type:e},Xt,$t]}resolveNamedOptions(t,e,i,s=[""]){const n={$shared:!0},{resolver:o,subPrefixes:r}=Is(this._resolverCache,t,s);let a=o;(function(t,e){const{isScriptable:i,isIndexable:s}=_e(t);for(const n of e){const e=i(n),o=s(n),r=(o||e)&&t[n];if(e&&(G(r)||Ls(r))||o&&L(r))return!0}return!1})(o,e)&&(n.$shared=!1,a=be(o,i=G(i)?i():i,this.createResolver(t,i,r)));for(const t of e)n[t]=a[t];return n}createResolver(t,e,i=[""],s){const{resolver:n}=Is(this._resolverCache,t,i);return E(e)?be(n,e,void 0,s):n}}function Is(t,e,i){let s=t.get(e);s||(s=new Map,t.set(e,s));const n=i.join();let o=s.get(n);return o||(o={resolver:me(e,i),subPrefixes:i.filter(t=>!t.toLowerCase().includes("hover"))},s.set(n,o)),o}const Ls=t=>E(t)&&Object.getOwnPropertyNames(t).some(e=>G(t[e])),Es=["top","bottom","left","right","chartArea"];function Rs(t,e){return"top"===t||"bottom"===t||-1===Es.indexOf(t)&&"x"===e}function zs(t,e){return function(i,s){return i[t]===s[t]?i[e]-s[e]:i[t]-s[t]}}function Fs(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),B(i&&i.onComplete,[t],e)}function Bs(t){const e=t.chart,i=e.options.animation;B(i&&i.onProgress,[t],e)}function Hs(t){return ze()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const js={},Vs=t=>{const e=Hs(t);return Object.values(js).filter(t=>t.canvas===e).pop()};function Ws(t,e,i){const s=Object.keys(t);for(const n of s){const s=+n;if(s>=e){const o=t[n];delete t[n],(i>0||s>e)&&(t[s+i]=o)}}}class $s{static defaults=Xt;static instances=js;static overrides=Wt;static registry=xs;static version="4.5.0";static getChart=Vs;static register(...t){xs.add(...t),Ns()}static unregister(...t){xs.remove(...t),Ns()}constructor(t,e){const i=this.config=new As(e),s=Hs(t),n=Vs(s);if(n)throw new Error("Canvas is already in use. Chart with ID '"+n.id+"' must be destroyed before the canvas with ID '"+n.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||function(t){return!ze()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?Wi:ss}(s)),this.platform.updateConfig(i);const r=this.platform.acquireContext(s,o.aspectRatio),a=r&&r.canvas,h=a&&a.height,l=a&&a.width;this.id=A(),this.ctx=r,this.canvas=a,this.width=l,this.height=h,this._options=o,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 ms,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(t,e){let i;return function(...s){return e?(clearTimeout(i),i=setTimeout(t,e,s)):t.apply(this,s),e}}(t=>this.update(t),o.resizeDelay||0),this._dataChanges=[],js[this.id]=this,r&&a?(ri.listen(this,"complete",Fs),ri.listen(this,"progress",Bs),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:n}=this;return I(t)?e&&n?n: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}get registry(){return xs}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Ne(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Zt(this.canvas,this.ctx),this}stop(){return ri.stop(this),this}resize(t,e){ri.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,s=this.canvas,n=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,t,e,n),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,Ne(this,r,!0)&&(this.notifyPlugins("resize",{size:o}),B(i.onResize,[this,o],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){H(this.options.scales||{},(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 n=[];e&&(n=n.concat(Object.keys(e).map(t=>{const i=e[t],s=Ms(t,i),n="r"===s,o="x"===s;return{options:i,dposition:n?"chartArea":o?"bottom":"left",dtype:n?"radialLinear":o?"category":"linear"}}))),H(n,e=>{const n=e.options,o=n.id,r=Ms(o,n),a=F(n.type,e.dtype);void 0!==n.position&&Rs(n.position,r)===Rs(e.dposition)||(n.position=e.dposition),s[o]=!0;let h=null;o in i&&i[o].type===a?h=i[o]:(h=new(xs.getScale(a))({id:o,type:a,ctx:this.ctx,chart:this}),i[h.id]=h),h.init(n,t)}),H(s,(t,e)=>{t||delete i[e]}),H(i,t=>{ji.configure(this,t,t.options),ji.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(zs("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 n=this.getDatasetMeta(i);const o=s.type||this.config.type;if(n.type&&n.type!==o&&(this._destroyDatasetMeta(i),n=this.getDatasetMeta(i)),n.type=o,n.indexAxis=s.indexAxis||ys(o,this.options),n.order=s.order||0,n.index=i,n.label=""+s.label,n.visible=this.isDatasetVisible(i),n.controller)n.controller.updateIndex(i),n.controller.linkScales();else{const e=xs.getController(o),{datasetElementType:s,dataElementType:r}=Xt.datasets[o];Object.assign(e,{dataElementType:xs.getElement(r),datasetElementType:s&&xs.getElement(s)}),n.controller=new e(this,i),t.push(n.controller)}}return this._updateMetasets(),t}_resetElements(){H(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 n=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let t=0,e=this.data.datasets.length;t<e;t++){const{controller:e}=this.getDatasetMeta(t),i=!s&&-1===n.indexOf(e);e.buildOrUpdateElements(i),o=Math.max(+e.getMaxOverflow(),o)}o=this._minPadding=i.layout.autoPadding?o:0,this._updateLayout(o),s||H(n,t=>{t.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(zs("z","_idx"));const{_active:r,_lastEvent:a}=this;a?this._eventHandler(a,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){H(this.scales,t=>{ji.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);Q(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:n}of e)Ws(t,s,"_removeElements"===i?-n:n)}_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 t=1;t<e;t++)if(!Q(s,i(t)))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;ji.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],H(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,G(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),s={meta:i,index:t,mode:e,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",s)&&(i.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(ri.has(this)?this.attached&&!ri.running(this)&&ri.start(this):(this.draw(),Fs({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:t,height:e}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(t,e)}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 s,n;for(s=0,n=e.length;s<n;++s){const n=e[s];t&&!n.visible||i.push(n)}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={meta:t,index:t.index,cancelable:!0},s=ni(this,t);!1!==this.notifyPlugins("beforeDatasetDraw",i)&&(s&&Jt(e,s),t.controller.draw(),s&&te(e),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return Qt(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){const n=Oi.modes[e];return"function"==typeof n?n(this,t,i,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let s=i.filter(t=>t&&t._dataset===e).pop();return s||(s={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(s)),s}getContext(){return this.$context||(this.$context=xe(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){this.getDatasetMeta(t).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",n=this.getDatasetMeta(t),o=n.controller._resolveAnimations(void 0,s);Z(e)?(n.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(n,{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(),ri.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(),Zt(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete js[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,s)=>{e.addEventListener(this,i,s),t[i]=s},s=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};H(this.options.events,t=>i(t,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,s)=>{e.addEventListener(this,i,s),t[i]=s},s=(i,s)=>{t[i]&&(e.removeEventListener(this,i,s),delete t[i])},n=(t,e)=>{this.canvas&&this.resize(t,e)};let o;const r=()=>{s("attach",r),this.attached=!0,this.resize(),i("resize",n),i("detach",o)};o=()=>{this.attached=!1,s("resize",n),this._stop(),this._resize(0,0),i("attach",r)},e.isAttached(this.canvas)?r():o()}unbindEvents(){H(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},H(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const s=i?"set":"remove";let n,o,r,a;for("dataset"===e&&(n=this.getDatasetMeta(t[0].datasetIndex),n.controller["_"+s+"DatasetHoverStyle"]()),r=0,a=t.length;r<a;++r){o=t[r];const e=o&&this.getDatasetMeta(o.datasetIndex).controller;e&&e[s+"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}});!j(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return 1===this._plugins._cache.filter(e=>e.plugin.id===t).length}_updateHoverStyles(t,e,i){const s=this.options.hover,n=(t,e)=>t.filter(t=>!e.some(e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)),o=n(e,t),r=i?t:n(t,e);o.length&&this.updateHoverStyle(o,s.mode,!1),r.length&&s.mode&&this.updateHoverStyle(r,s.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,s))return;const n=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(n||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:s=[],options:n}=this,o=e,r=this._getActiveElements(t,s,i,o),a=function(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}(t),h=function(t,e,i,s){return i&&"mouseout"!==t.type?s?e:t:null}(t,this._lastEvent,i,a);i&&(this._lastEvent=null,B(n.onHover,[t,r,this],this),a&&B(n.onClick,[t,r,this],this));const l=!j(r,s);return(l||e)&&(this._active=r,this._updateHoverStyles(r,s,e)),this._lastEvent=h,l}_getActiveElements(t,e,i,s){if("mouseout"===t.type)return[];if(!i)return e;const n=this.options.hover;return this.getElementsAtEventForMode(t,n.mode,n,s)}}function Ns(){return H($s.instances,t=>t._plugins.invalidate())}function Ys(t,e,i=e){t.lineCap=F(i.borderCapStyle,e.borderCapStyle),t.setLineDash(F(i.borderDash,e.borderDash)),t.lineDashOffset=F(i.borderDashOffset,e.borderDashOffset),t.lineJoin=F(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=F(i.borderWidth,e.borderWidth),t.strokeStyle=F(i.borderColor,e.borderColor)}function Us(t,e,i){t.lineTo(i.x,i.y)}function Xs(t,e,i={}){const s=t.length,{start:n=0,end:o=s-1}=i,{start:r,end:a}=e,h=Math.max(n,r),l=Math.min(o,a),c=n<r&&o<r||n>a&&o>a;return{count:s,start:h,loop:e.loop,ilen:l<h&&!c?s+l-h:l-h}}function qs(t,e,i,s){const{points:n,options:o}=e,{count:r,start:a,loop:h,ilen:l}=Xs(n,i,s),c=function(t){return t.stepped?ee:t.tension||"monotone"===t.cubicInterpolationMode?ie:Us}(o);let d,u,f,{move:g=!0,reverse:p}=s||{};for(d=0;d<=l;++d)u=n[(a+(p?l-d:d))%r],u.skip||(g?(t.moveTo(u.x,u.y),g=!1):c(t,f,u,p,o.stepped),f=u);return h&&(u=n[(a+(p?l:0))%r],c(t,f,u,p,o.stepped)),!!h}function Ks(t,e,i,s){const n=e.points,{count:o,start:r,ilen:a}=Xs(n,i,s),{move:h=!0,reverse:l}=s||{};let c,d,u,f,g,p,x=0,m=0;const b=t=>(r+(l?a-t:t))%o,_=()=>{f!==g&&(t.lineTo(x,g),t.lineTo(x,f),t.lineTo(x,p))};for(h&&(d=n[b(0)],t.moveTo(d.x,d.y)),c=0;c<=a;++c){if(d=n[b(c)],d.skip)continue;const e=d.x,i=d.y,s=0|e;s===u?(i<f?f=i:i>g&&(g=i),x=(m*x+e)/++m):(_(),t.lineTo(e,i),u=s,m=0,f=g=i),p=i}_()}function Zs(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i?qs:Ks}const Gs="function"==typeof Path2D;class Qs extends ns{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};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;Re(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=function(t,e){const i=t.points,s=t.options.spanGaps,n=i.length;if(!n)return[];const o=!!t._loop,{start:r,end:a}=function(t,e,i,s){let n=0,o=e-1;if(i&&!s)for(;n<e&&!t[n].skip;)n++;for(;n<e&&t[n].skip;)n++;for(n%=e,i&&(o+=n);o>n&&t[o%e].skip;)o--;return o%=e,{start:n,end:o}}(i,n,o,s);return function(t,e,i,s){return s&&s.setContext&&i?function(t,e,i,s){const n=t._chart.getContext(),o=ei(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,s,n){const o=a?-1:1;if(t!==e){for(t+=h;i[t%h].skip;)t-=o;for(;i[e%h].skip;)e+=o;t%h!==e%h&&(l.push({start:t%h,end:e%h,loop:s,style:n}),c=n,d=e%h)}}for(const t of e){d=a?d:t.start;let e,o=i[d%h];for(u=d+1;u<=t.end;u++){const a=i[u%h];e=ei(s.setContext(xe(n,{type:"segment",p0:o,p1:a,p0DataIndex:(u-1)%h,p1DataIndex:u%h,datasetIndex:r}))),ii(e,c)&&f(d,u-1,t.loop,c),o=a,c=e}d<u-1&&f(d,u-1,t.loop,c)}return l}(t,e,i,s):e}(t,!0===s?[{start:r,end:a,loop:o}]:function(t,e,i,s){const n=t.length,o=[];let r,a=e,h=t[e];for(r=e+1;r<=i;++r){const i=t[r%n];i.skip||i.stop?h.skip||(s=!1,o.push({start:e%n,end:(r-1)%n,loop:s}),e=a=i.stop?r:null):(a=r,h.skip&&(e=r)),h=i}return null!==a&&o.push({start:e%n,end:a%n,loop:s}),o}(i,r,a<r?a+n:a,!!t._fullLoop&&0===r&&a===n-1),i,e)}(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],n=this.points,o=ti(this,{property:e,start:s,end:s});if(!o.length)return;const r=[],a=function(t){return t.stepped?qe:t.tension||"monotone"===t.cubicInterpolationMode?Ke:Xe}(i);let h,l;for(h=0,l=o.length;h<l;++h){const{start:l,end:c}=o[h],d=n[l],u=n[c];if(d===u){r.push(d);continue}const f=a(d,u,Math.abs((s-d[e])/(u[e]-d[e])),i.stepped);f[e]=t[e],r.push(f)}return 1===r.length?r[0]:r}pathSegment(t,e,i){return Zs(this)(t,this,e,i)}path(t,e,i){const s=this.segments,n=Zs(this);let o=this._loop;e=e||0,i=i||this.points.length-e;for(const r of s)o&=n(t,this,r,{start:e,end:e+i-1});return!!o}draw(t,e,i,s){const n=this.options||{};(this.points||[]).length&&n.borderWidth&&(t.save(),function(t,e,i,s){Gs&&!e.options.segment?function(t,e,i,s){let n=e._path;n||(n=e._path=new Path2D,e.path(n,i,s)&&n.closePath()),Ys(t,e.options),t.stroke(n)}(t,e,i,s):function(t,e,i,s){const{segments:n,options:o}=e,r=Zs(e);for(const a of n)Ys(t,o,a.style),t.beginPath(),r(t,e,a,{start:i,end:i+s-1})&&t.closePath(),t.stroke()}(t,e,i,s)}(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function Js(t,e,i,s){const n=t.options,{[i]:o}=t.getProps([i],s);return Math.abs(e-o)<n.radius+n.hitRadius}function tn(t,e,i,s){if(s)return;let n=e[t],o=i[t];return"angle"===t&&(n=xt(n),o=xt(o)),{property:t,start:n,end:o}}function en(t,e,i){for(;e>t;e--){const t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function sn(t,e,i,s){return t&&e?s(t[i],e[i]):t?t[i]:e?e[i]:0}function nn(t,e){let i=[],s=!1;return L(t)?(s=!0,i=t):i=function(t,e){const{x:i=null,y:s=null}=t||{},n=e.points,o=[];return e.segments.forEach(({start:t,end:e})=>{e=en(t,e,n);const r=n[t],a=n[e];null!==s?(o.push({x:r.x,y:s}),o.push({x:a.x,y:s})):null!==i&&(o.push({x:i,y:r.y}),o.push({x:i,y:a.y}))}),o}(t,e),i.length?new Qs({points:i,options:{tension:0},_loop:s,_fullLoop:s}):null}function on(t){return t&&!1!==t.fill}function rn(t,e,i){let s=t[e].fill;const n=[e];let o;if(!i)return s;for(;!1!==s&&-1===n.indexOf(s);){if(!R(s))return s;if(o=t[s],!o)return!1;if(o.visible)return s;n.push(s),s=o.fill}return!1}function an(t,e,i){const s=function(t){const e=t.options,i=e.fill;let s=F(i&&i.target,i);return void 0===s&&(s=!!e.backgroundColor),!1!==s&&null!==s&&(!0===s?"origin":s)}(t);if(E(s))return!isNaN(s.value)&&s;let n=parseFloat(s);return R(n)&&Math.floor(n)===n?function(t,e,i,s){return"-"!==t&&"+"!==t||(i=e+i),!(i===e||i<0||i>=s)&&i}(s[0],e,n,i):["origin","start","end","stack","shape"].indexOf(s)>=0&&s}function hn(t,e,i){const s=[];for(let n=0;n<i.length;n++){const o=i[n],{first:r,last:a,point:h}=ln(o,e,"x");if(!(!h||r&&a))if(r)s.unshift(h);else if(t.push(h),!a)break}t.push(...s)}function ln(t,e,i){const s=t.interpolate(e,i);if(!s)return{};const n=s[i],o=t.segments,r=t.points;let a=!1,h=!1;for(let t=0;t<o.length;t++){const e=o[t],s=r[e.start][i],l=r[e.end][i];if(_t(n,s,l)){a=n===s,h=n===l;break}}return{first:a,last:h,point:s}}class cn{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:s,y:n,radius:o}=this;return e=e||{start:0,end:tt},t.arc(s,n,o,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:s}=this,n=t.angle;return{x:e+Math.cos(n)*s,y:i+Math.sin(n)*s,angle:n}}}function dn(t,e,i){const s=function(t){const{chart:e,fill:i,line:s}=t;if(R(i))return function(t,e){const i=t.getDatasetMeta(e);return i&&t.isDatasetVisible(e)?i.dataset:null}(e,i);if("stack"===i)return function(t){const{scale:e,index:i,line:s}=t,n=[],o=s.segments,r=s.points,a=function(t,e){const i=[],s=t.getMatchingVisibleMetas("line");for(let t=0;t<s.length;t++){const n=s[t];if(n.index===e)break;n.hidden||i.unshift(n.dataset)}return i}(e,i);a.push(nn({x:null,y:e.bottom},s));for(let t=0;t<o.length;t++){const e=o[t];for(let t=e.start;t<=e.end;t++)hn(n,r[t],a)}return new Qs({points:n,options:{}})}(t);if("shape"===i)return!0;const n=function(t){return(t.scale||{}).getPointPositionForValue?function(t){const{scale:e,fill:i}=t,s=e.options,n=e.getLabels().length,o=s.reverse?e.max:e.min,r=function(t,e,i){let s;return s="start"===t?i:"end"===t?e.options.reverse?e.min:e.max:E(t)?t.value:e.getBaseValue(),s}(i,e,o),a=[];if(s.grid.circular){const t=e.getPointPositionForValue(0,o);return new cn({x:t.x,y:t.y,radius:e.getDistanceFromCenterForValue(r)})}for(let t=0;t<n;++t)a.push(e.getPointPositionForValue(t,r));return a}(t):function(t){const{scale:e={},fill:i}=t,s=function(t,e){let i=null;return"start"===t?i=e.bottom:"end"===t?i=e.top:E(t)?i=e.getPixelForValue(t.value):e.getBasePixel&&(i=e.getBasePixel()),i}(i,e);if(R(s)){const t=e.isHorizontal();return{x:t?s:null,y:t?null:s}}return null}(t)}(t);return n instanceof cn?n:nn(n,s)}(e),{chart:n,index:o,line:r,scale:a,axis:h}=e,l=r.options,c=l.fill,d=l.backgroundColor,{above:u=d,below:f=d}=c||{},g=n.getDatasetMeta(o),p=ni(n,g);s&&r.points.length&&(Jt(t,i),function(t,e){const{line:i,target:s,above:n,below:o,area:r,scale:a,clip:h}=e,l=i._loop?"angle":e.axis;t.save();let c=o;o!==n&&("x"===l?(un(t,s,r.top),gn(t,{line:i,target:s,color:n,scale:a,property:l,clip:h}),t.restore(),t.save(),un(t,s,r.bottom)):"y"===l&&(fn(t,s,r.left),gn(t,{line:i,target:s,color:o,scale:a,property:l,clip:h}),t.restore(),t.save(),fn(t,s,r.right),c=n)),gn(t,{line:i,target:s,color:c,scale:a,property:l,clip:h}),t.restore()}(t,{line:r,target:s,above:u,below:f,area:i,scale:a,axis:h,clip:p}),te(t))}function un(t,e,i){const{segments:s,points:n}=e;let o=!0,r=!1;t.beginPath();for(const a of s){const{start:s,end:h}=a,l=n[s],c=n[en(s,h,n)];o?(t.moveTo(l.x,l.y),o=!1):(t.lineTo(l.x,i),t.lineTo(l.x,l.y)),r=!!e.pathSegment(t,a,{move:r}),r?t.closePath():t.lineTo(c.x,i)}t.lineTo(e.first().x,i),t.closePath(),t.clip()}function fn(t,e,i){const{segments:s,points:n}=e;let o=!0,r=!1;t.beginPath();for(const a of s){const{start:s,end:h}=a,l=n[s],c=n[en(s,h,n)];o?(t.moveTo(l.x,l.y),o=!1):(t.lineTo(i,l.y),t.lineTo(l.x,l.y)),r=!!e.pathSegment(t,a,{move:r}),r?t.closePath():t.lineTo(i,c.y)}t.lineTo(i,e.first().y),t.closePath(),t.clip()}function gn(t,e){const{line:i,target:s,property:n,color:o,scale:r,clip:a}=e,h=function(t,e,i){const s=t.segments,n=t.points,o=e.points,r=[];for(const t of s){let{start:s,end:a}=t;a=en(s,a,n);const h=tn(i,n[s],n[a],t.loop);if(!e.segments){r.push({source:t,target:h,start:n[s],end:n[a]});continue}const l=ti(e,h);for(const e of l){const s=tn(i,o[e.start],o[e.end],e.loop),a=Je(t,n,s);for(const t of a)r.push({source:t,target:e,start:{[i]:sn(h,s,"start",Math.max)},end:{[i]:sn(h,s,"end",Math.min)}})}}return r}(i,s,n);for(const{source:e,target:l,start:c,end:d}of h){const{style:{backgroundColor:h=o}={}}=e,u=!0!==s;t.save(),t.fillStyle=h,pn(t,r,a,u&&tn(n,c,d)),t.beginPath();const f=!!i.pathSegment(t,e);let g;if(u){f?t.closePath():xn(t,s,d,n);const e=!!s.pathSegment(t,l,{move:f,reverse:!0});g=f&&e,g||xn(t,s,c,n)}t.closePath(),t.fill(g?"evenodd":"nonzero"),t.restore()}}function pn(t,e,i,s){const n=e.chart.chartArea,{property:o,start:r,end:a}=s||{};if("x"===o||"y"===o){let e,s,h,l;"x"===o?(e=r,s=n.top,h=a,l=n.bottom):(e=n.left,s=r,h=n.right,l=a),t.beginPath(),i&&(e=Math.max(e,i.left),h=Math.min(h,i.right),s=Math.max(s,i.top),l=Math.min(l,i.bottom)),t.rect(e,s,h-e,l-s),t.clip()}}function xn(t,e,i,s){const n=e.interpolate(i,s);n&&t.lineTo(n.x,n.y)}var mn={id:"filler",afterDatasetsUpdate(t,e,i){const s=(t.data.datasets||[]).length,n=[];let o,r,a,h;for(r=0;r<s;++r)o=t.getDatasetMeta(r),a=o.dataset,h=null,a&&a.options&&a instanceof Qs&&(h={visible:t.isDatasetVisible(r),index:r,fill:an(a,r,s),chart:t,axis:o.controller.options.indexAxis,scale:o.vScale,line:a}),o.$filler=h,n.push(h);for(r=0;r<s;++r)h=n[r],h&&!1!==h.fill&&(h.fill=rn(n,r,i.propagate))},beforeDraw(t,e,i){const s="beforeDraw"===i.drawTime,n=t.getSortedVisibleDatasetMetas(),o=t.chartArea;for(let e=n.length-1;e>=0;--e){const i=n[e].$filler;i&&(i.line.updateControlPoints(o,i.axis),s&&i.fill&&dn(t.ctx,i,o))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;const s=t.getSortedVisibleDatasetMetas();for(let e=s.length-1;e>=0;--e){const i=s[e].$filler;on(i)&&dn(t.ctx,i,t.chartArea)}},beforeDatasetDraw(t,e,i){const s=e.meta.$filler;on(s)&&"beforeDatasetDraw"===i.drawTime&&dn(t.ctx,s,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};class bn extends ns{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=L(i.text)?i.text.length:1;this._padding=fe(i.padding);const n=s*ge(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=n:this.width=n}isHorizontal(){const t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){const{top:e,left:i,bottom:s,right:n,options:o}=this,r=o.align;let a,h,l,c=0;return this.isHorizontal()?(h=Ot(r,i,n),l=e+t,a=n-i):("left"===o.position?(h=i+t,l=Ot(r,s,e),c=-.5*J):(h=n-t,l=Ot(r,e,s),c=.5*J),a=s-e),{titleX:h,titleY:l,maxWidth:a,rotation:c}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=ge(e.font),s=i.lineHeight/2+this._padding.top,{titleX:n,titleY:o,maxWidth:r,rotation:a}=this._drawArgs(s);oe(t,e.text,0,0,i,{color:e.color,maxWidth:r,rotation:a,textAlign:Dt(e.align),textBaseline:"middle",translation:[n,o]})}}var yn={id:"title",_element:bn,start(t,e,i){!function(t,e){const i=new bn({ctx:t.ctx,options:e,chart:t});ji.configure(t,i,e),ji.addBox(t,i),t.titleBlock=i}(t,i)},stop(t){const e=t.titleBlock;ji.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){const s=t.titleBlock;ji.configure(t,s,i),s.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 vn={average(t){if(!t.length)return!1;let e,i,s=new Set,n=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();s.add(t.x),n+=t.y,++o}}return 0!==o&&0!==s.size&&{x:[...s].reduce((t,e)=>t+e)/s.size,y:n/o}},nearest(t,e){if(!t.length)return!1;let i,s,n,o=e.x,r=e.y,a=Number.POSITIVE_INFINITY;for(i=0,s=t.length;i<s;++i){const s=t[i].element;if(s&&s.hasValue()){const t=gt(e,s.getCenterPoint());t<a&&(a=t,n=s)}}if(n){const t=n.tooltipPosition();o=t.x,r=t.y}return{x:o,y:r}}};function wn(t,e){return e&&(L(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function Mn(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function kn(t,e){const{element:i,datasetIndex:s,index:n}=e,o=t.getDatasetMeta(s).controller,{label:r,value:a}=o.getLabelAndValue(n);return{chart:t,label:r,parsed:o.getParsed(n),raw:t.data.datasets[s].data[n],formattedValue:a,dataset:o.getDataset(),dataIndex:n,datasetIndex:s,element:i}}function Sn(t,e){const i=t.chart.ctx,{body:s,footer:n,title:o}=t,{boxWidth:r,boxHeight:a}=e,h=ge(e.bodyFont),l=ge(e.titleFont),c=ge(e.footerFont),d=o.length,u=n.length,f=s.length,g=fe(e.padding);let p=g.height,x=0,m=s.reduce((t,e)=>t+e.before.length+e.lines.length+e.after.length,0);m+=t.beforeBody.length+t.afterBody.length,d&&(p+=d*l.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),m&&(p+=f*(e.displayColors?Math.max(a,h.lineHeight):h.lineHeight)+(m-f)*h.lineHeight+(m-1)*e.bodySpacing),u&&(p+=e.footerMarginTop+u*c.lineHeight+(u-1)*e.footerSpacing);let b=0;const _=function(t){x=Math.max(x,i.measureText(t).width+b)};return i.save(),i.font=l.string,H(t.title,_),i.font=h.string,H(t.beforeBody.concat(t.afterBody),_),b=e.displayColors?r+2+e.boxPadding:0,H(s,t=>{H(t.before,_),H(t.lines,_),H(t.after,_)}),b=0,i.font=c.string,H(t.footer,_),i.restore(),x+=g.width,{width:x,height:p}}function Pn(t,e,i,s){const{x:n,width:o}=i,{width:r,chartArea:{left:a,right:h}}=t;let l="center";return"center"===s?l=n<=(a+h)/2?"left":"right":n<=o/2?l="left":n>=r-o/2&&(l="right"),function(t,e,i,s){const{x:n,width:o}=s,r=i.caretSize+i.caretPadding;return"left"===t&&n+o+r>e.width||"right"===t&&n-o-r<0||void 0}(l,t,e,i)&&(l="center"),l}function Dn(t,e,i){const s=i.yAlign||e.yAlign||function(t,e){const{y:i,height:s}=e;return i<s/2?"top":i>t.height-s/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||Pn(t,e,i,s),yAlign:s}}function On(t,e,i,s){const{caretSize:n,caretPadding:o,cornerRadius:r}=t,{xAlign:a,yAlign:h}=i,l=n+o,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:f}=ue(r);let g=function(t,e){let{x:i,width:s}=t;return"right"===e?i-=s:"center"===e&&(i-=s/2),i}(e,a);const p=function(t,e,i){let{y:s,height:n}=t;return"top"===e?s+=i:s-="bottom"===e?n+i:n/2,s}(e,h,l);return"center"===h?"left"===a?g+=l:"right"===a&&(g-=l):"left"===a?g-=Math.max(c,u)+n:"right"===a&&(g+=Math.max(d,f)+n),{x:bt(g,0,s.width-e.width),y:bt(p,0,s.height-e.height)}}function Tn(t,e,i){const s=fe(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-s.right:t.x+s.left}function Cn(t){return wn([],Mn(t))}function An(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}const In={beforeTitle:C,title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,s=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(s>0&&e.dataIndex<s)return i[e.dataIndex]}return""},afterTitle:C,beforeBody:C,beforeLabel:C,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 I(i)||(e+=i),e},labelColor(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:C,afterBody:C,beforeFooter:C,footer:C,afterFooter:C};function Ln(t,e,i,s){const n=t[e].call(i,s);return void 0===n?In[e].call(i,s):n}class En extends ns{static positioners=vn;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,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()),s=i.enabled&&e.options.animation&&i.animations,n=new ci(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(n)),n}getContext(){return this.$context||(this.$context=xe(this.chart.getContext(),{tooltip:this,tooltipItems:this._tooltipItems,type:"tooltip"}))}getTitle(t,e){const{callbacks:i}=e,s=Ln(i,"beforeTitle",this,t),n=Ln(i,"title",this,t),o=Ln(i,"afterTitle",this,t);let r=[];return r=wn(r,Mn(s)),r=wn(r,Mn(n)),r=wn(r,Mn(o)),r}getBeforeBody(t,e){return Cn(Ln(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,s=[];return H(t,t=>{const e={before:[],lines:[],after:[]},n=An(i,t);wn(e.before,Mn(Ln(n,"beforeLabel",this,t))),wn(e.lines,Ln(n,"label",this,t)),wn(e.after,Mn(Ln(n,"afterLabel",this,t))),s.push(e)}),s}getAfterBody(t,e){return Cn(Ln(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,s=Ln(i,"beforeFooter",this,t),n=Ln(i,"footer",this,t),o=Ln(i,"afterFooter",this,t);let r=[];return r=wn(r,Mn(s)),r=wn(r,Mn(n)),r=wn(r,Mn(o)),r}_createItems(t){const e=this._active,i=this.chart.data,s=[],n=[],o=[];let r,a,h=[];for(r=0,a=e.length;r<a;++r)h.push(kn(this.chart,e[r]));return t.filter&&(h=h.filter((e,s,n)=>t.filter(e,s,n,i))),t.itemSort&&(h=h.sort((e,s)=>t.itemSort(e,s,i))),H(h,e=>{const i=An(t.callbacks,e);s.push(Ln(i,"labelColor",this,e)),n.push(Ln(i,"labelPointStyle",this,e)),o.push(Ln(i,"labelTextColor",this,e))}),this.labelColors=s,this.labelPointStyles=n,this.labelTextColors=o,this.dataPoints=h,h}update(t,e){const i=this.options.setContext(this.getContext()),s=this._active;let n,o=[];if(s.length){const t=vn[i.position].call(this,s,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=Sn(this,i),r=Object.assign({},t,e),a=Dn(this.chart,i,r),h=On(i,r,a,this.chart);this.xAlign=a.xAlign,this.yAlign=a.yAlign,n={opacity:1,x:h.x,y:h.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(n={opacity:0});this._tooltipItems=o,this.$context=void 0,n&&this._resolveAnimations().update(this,n),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){const n=this.getCaretPosition(t,i,s);e.lineTo(n.x1,n.y1),e.lineTo(n.x2,n.y2),e.lineTo(n.x3,n.y3)}getCaretPosition(t,e,i){const{xAlign:s,yAlign:n}=this,{caretSize:o,cornerRadius:r}=i,{topLeft:a,topRight:h,bottomLeft:l,bottomRight:c}=ue(r),{x:d,y:u}=t,{width:f,height:g}=e;let p,x,m,b,_,y;return"center"===n?(_=u+g/2,"left"===s?(p=d,x=p-o,b=_+o,y=_-o):(p=d+f,x=p+o,b=_-o,y=_+o),m=p):(x="left"===s?d+Math.max(a,l)+o:"right"===s?d+f-Math.max(h,c)-o:this.caretX,"top"===n?(b=u,_=b-o,p=x-o,m=x+o):(b=u+g,_=b+o,p=x+o,m=x-o),y=b),{x1:p,x2:x,x3:m,y1:b,y2:_,y3:y}}drawTitle(t,e,i){const s=this.title,n=s.length;let o,r,a;if(n){const h=Ze(i.rtl,this.x,this.width);for(t.x=Tn(this,i.titleAlign,i),e.textAlign=h.textAlign(i.titleAlign),e.textBaseline="middle",o=ge(i.titleFont),r=i.titleSpacing,e.fillStyle=i.titleColor,e.font=o.string,a=0;a<n;++a)e.fillText(s[a],h.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+r,a+1===n&&(t.y+=i.titleMarginBottom-r)}}_drawColorBox(t,e,i,s,n){const o=this.labelColors[i],r=this.labelPointStyles[i],{boxHeight:a,boxWidth:h}=n,l=ge(n.bodyFont),c=Tn(this,"left",n),d=s.x(c),u=a<l.lineHeight?(l.lineHeight-a)/2:0,f=e.y+u;if(n.usePointStyle){const e={radius:Math.min(h,a)/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:1},i=s.leftForLtr(d,h)+h/2,l=f+a/2;t.strokeStyle=n.multiKeyBackground,t.fillStyle=n.multiKeyBackground,Gt(t,e,i,l),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,Gt(t,e,i,l)}else{t.lineWidth=E(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,t.strokeStyle=o.borderColor,t.setLineDash(o.borderDash||[]),t.lineDashOffset=o.borderDashOffset||0;const e=s.leftForLtr(d,h),i=s.leftForLtr(s.xPlus(d,1),h-2),r=ue(o.borderRadius);Object.values(r).some(t=>0!==t)?(t.beginPath(),t.fillStyle=n.multiKeyBackground,re(t,{x:e,y:f,w:h,h:a,radius:r}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),re(t,{x:i,y:f+1,w:h-2,h:a-2,radius:r}),t.fill()):(t.fillStyle=n.multiKeyBackground,t.fillRect(e,f,h,a),t.strokeRect(e,f,h,a),t.fillStyle=o.backgroundColor,t.fillRect(i,f+1,h-2,a-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:s}=this,{bodySpacing:n,bodyAlign:o,displayColors:r,boxHeight:a,boxWidth:h,boxPadding:l}=i,c=ge(i.bodyFont);let d=c.lineHeight,u=0;const f=Ze(i.rtl,this.x,this.width),g=function(i){e.fillText(i,f.x(t.x+u),t.y+d/2),t.y+=d+n},p=f.textAlign(o);let x,m,b,_,y,v,w;for(e.textAlign=o,e.textBaseline="middle",e.font=c.string,t.x=Tn(this,p,i),e.fillStyle=i.bodyColor,H(this.beforeBody,g),u=r&&"right"!==p?"center"===o?h/2+l:h+2+l:0,_=0,v=s.length;_<v;++_){for(x=s[_],m=this.labelTextColors[_],e.fillStyle=m,H(x.before,g),b=x.lines,r&&b.length&&(this._drawColorBox(e,t,_,f,i),d=Math.max(c.lineHeight,a)),y=0,w=b.length;y<w;++y)g(b[y]),d=c.lineHeight;H(x.after,g)}u=0,d=c.lineHeight,H(this.afterBody,g),t.y-=n}drawFooter(t,e,i){const s=this.footer,n=s.length;let o,r;if(n){const a=Ze(i.rtl,this.x,this.width);for(t.x=Tn(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=a.textAlign(i.footerAlign),e.textBaseline="middle",o=ge(i.footerFont),e.fillStyle=i.footerColor,e.font=o.string,r=0;r<n;++r)e.fillText(s[r],a.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+i.footerSpacing}}drawBackground(t,e,i,s){const{xAlign:n,yAlign:o}=this,{x:r,y:a}=t,{width:h,height:l}=i,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:f}=ue(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(r+c,a),"top"===o&&this.drawCaret(t,e,i,s),e.lineTo(r+h-d,a),e.quadraticCurveTo(r+h,a,r+h,a+d),"center"===o&&"right"===n&&this.drawCaret(t,e,i,s),e.lineTo(r+h,a+l-f),e.quadraticCurveTo(r+h,a+l,r+h-f,a+l),"bottom"===o&&this.drawCaret(t,e,i,s),e.lineTo(r+u,a+l),e.quadraticCurveTo(r,a+l,r,a+l-u),"center"===o&&"left"===n&&this.drawCaret(t,e,i,s),e.lineTo(r,a+c),e.quadraticCurveTo(r,a,r+c,a),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,s=i&&i.x,n=i&&i.y;if(s||n){const i=vn[t.position].call(this,this._active,this._eventPosition);if(!i)return;const o=this._size=Sn(this,t),r=Object.assign({},i,this._size),a=Dn(e,t,r),h=On(t,r,a,e);s._to===h.x&&n._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},n={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=fe(e.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&r&&(t.save(),t.globalAlpha=i,this.drawBackground(n,t,s,e),function(t,e){let i,s;"ltr"!==e&&"rtl"!==e||(i=t.canvas.style,s=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=s)}(t,e.textDirection),n.y+=o.top,this.drawTitle(n,t,e),this.drawBody(n,t,e),this.drawFooter(n,t,e),function(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}(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}}),n=!j(i,s),o=this._positionChanged(s,e);(n||o)&&(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,n=this._active||[],o=this._getActiveElements(t,n,e,i),r=this._positionChanged(o,t),a=e||!j(o,n)||r;return a&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),a}_getActiveElements(t,e,i,s){const n=this.options;if("mouseout"===t.type)return[];if(!s)return e.filter(t=>this.chart.data.datasets[t.datasetIndex]&&void 0!==this.chart.getDatasetMeta(t.datasetIndex).controller.getParsed(t.index));const o=this.chart.getElementsAtEventForMode(t,n.mode,n,i);return n.reverse&&o.reverse(),o}_positionChanged(t,e){const{caretX:i,caretY:s,options:n}=this,o=vn[n.position].call(this,t,e);return!1!==o&&(i!==o.x||s!==o.y)}}var Rn={id:"tooltip",_element:En,positioners:vn,afterInit(t,e,i){i&&(t.tooltip=new En({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,cancelable:!0}))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:In},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"]};function zn(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}function Fn(t,e,{horizontal:i,minRotation:s}){const n=ut(s),o=(i?Math.sin(n):Math.cos(n))||.001,r=.75*e*(""+t).length;return Math.min(e/o,r)}class Bn extends fs{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 I(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:n}=this;const o=t=>s=e?s:t,r=t=>n=i?n:t;if(t){const t=ht(s),e=ht(n);t<0&&e<0?r(0):t>0&&e>0&&o(0)}if(s===n){let e=0===n?1:Math.abs(.05*n);r(n+e),t||o(s-e)}this.min=s,this.max=n}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:s}=t;return s?(e=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} 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=function(t,e){const i=[],{bounds:s,step:n,min:o,max:r,precision:a,count:h,maxTicks:l,maxDigits:c,includeBounds:d}=t,u=n||1,f=l-1,{min:g,max:p}=e,x=!I(o),m=!I(r),b=!I(h),_=(p-g)/(c+1);let y,v,w,M,k=ct((p-g)/f/u)*u;if(k<1e-14&&!x&&!m)return[{value:g},{value:p}];M=Math.ceil(p/k)-Math.floor(g/k),M>f&&(k=ct(M*k/f/u)*u),I(a)||(y=Math.pow(10,a),k=Math.ceil(k*y)/y),"ticks"===s?(v=Math.floor(g/k)*k,w=Math.ceil(p/k)*k):(v=g,w=p),x&&m&&n&&function(t,e){const i=Math.round(t);return i-e<=t&&i+e>=t}((r-o)/n,k/1e3)?(M=Math.round(Math.min((r-o)/k,l)),k=(r-o)/M,v=o,w=r):b?(v=x?o:v,w=m?r:w,M=h-1,k=(w-v)/M):(M=(w-v)/k,M=lt(M,Math.round(M),k/1e3)?Math.round(M):Math.ceil(M));const S=Math.max(ft(k),ft(v));y=Math.pow(10,I(a)?S:a),v=Math.round(v*y)/y,w=Math.round(w*y)/y;let P=0;for(x&&(d&&v!==o?(i.push({value:o}),v<o&&P++,lt(Math.round((v+P*k)*y)/y,o,Fn(o,_,t))&&P++):v<o&&P++);P<M;++P){const t=Math.round((v+P*k)*y)/y;if(m&&t>r)break;i.push({value:t})}return m&&d&&w!==r?i.length&&lt(i[i.length-1].value,r,Fn(r,_,t))?i[i.length-1].value=r:i.push({value:r}):m&&w!==r||i.push({value:w}),i}({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},this._range||this);return"ticks"===t.bounds&&function(t,e,i){let s,n,o;for(s=0,n=t.length;s<n;s++)o=t[s][i],isNaN(o)||(e.min=Math.min(e.min,o),e.max=Math.max(e.max,o))}(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-e)/Math.max(t.length-1,1)/2;e-=s,i+=s}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return Ht(t,this.chart.options.locale,this.options.ticks.format)}}class Hn extends Bn{static id="linear";static defaults={ticks:{callback:Vt.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=R(t)?t:0,this.max=R(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=ut(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,n=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,n.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}}Vt.formatters.logarithmic,Vt.formatters.numeric,$s.register(class extends fs{static id="category";static defaults={ticks:{callback:zn}};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:s}of e)t[i]===s&&t.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(I(t))return null;const i=this.getLabels();return((t,e)=>null===t?null:bt(Math.round(t),0,e))(e=isFinite(e)&&i[e]===t?e:function(t,e,i,s){const n=t.indexOf(e);return-1===n?((t,e,i,s)=>("string"==typeof e?(i=t.push(e)-1,s.unshift({index:i,label:e})):isNaN(e)&&(i=null),i))(t,e,i,s):n!==t.lastIndexOf(e)?i:n}(i,t,F(e,t),this._addedLabels),i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,s=[];let n=this.getLabels();n=0===t&&e===n.length-1?n:n.slice(t,e+1),this._valueRange=Math.max(n.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let i=t;i<=e;i++)s.push({value:i});return s}getLabelForValue(t){return zn.call(this,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}},Hn,class extends ns{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(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 s=this.options,{x:n,y:o}=this.getProps(["x","y"],i);return Math.pow(t-n,2)+Math.pow(e-o,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,e){return Js(this,t,"x",e)}inYRange(t,e){return Js(this,t,"y",e)}getCenterPoint(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}size(t){let e=(t=t||this.options||{}).radius||0;return e=Math.max(e,e&&t.hoverRadius||0),2*(e+(e&&t.borderWidth||0))}draw(t,e){const i=this.options;this.skip||i.radius<.1||!Qt(this,e,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,Gt(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}},Qs,yn,Rn,mn),window.ThinkRankChartJS=$s})();
1 +(()=>{"use strict";var t={44594:(t,e,i)=>{function s(t){return t+.5|0}i.d(e,{Q1:()=>I});const n=(t,e,i)=>Math.max(Math.min(t,i),e);function o(t){return n(s(2.55*t),0,255)}function a(t){return n(s(255*t),0,255)}function r(t){return n(s(t/2.55)/100,0,1)}function h(t){return n(s(100*t),0,100)}const l={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},c=[..."0123456789ABCDEF"],d=t=>c[15&t],u=t=>c[(240&t)>>4]+c[15&t],f=t=>(240&t)>>4==(15&t);const g=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function p(t,e,i){const s=e*Math.min(i,1-i),n=(e,n=(e+t/30)%12)=>i-s*Math.max(Math.min(n-3,9-n,1),-1);return[n(0),n(8),n(4)]}function x(t,e,i){const s=(s,n=(s+t/60)%6)=>i-i*e*Math.max(Math.min(n,4-n,1),0);return[s(5),s(3),s(1)]}function m(t,e,i){const s=p(t,1,.5);let n;for(e+i>1&&(n=1/(e+i),e*=n,i*=n),n=0;n<3;n++)s[n]*=1-e-i,s[n]+=e;return s}function b(t){const e=t.r/255,i=t.g/255,s=t.b/255,n=Math.max(e,i,s),o=Math.min(e,i,s),a=(n+o)/2;let r,h,l;return n!==o&&(l=n-o,h=a>.5?l/(2-n-o):l/(n+o),r=function(t,e,i,s,n){return t===n?(e-i)/s+(e<i?6:0):e===n?(i-t)/s+2:(t-e)/s+4}(e,i,s,l,n),r=60*r+.5),[0|r,h||0,a]}function _(t,e,i,s){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,i,s)).map(a)}function y(t,e,i){return _(p,t,e,i)}function v(t){return(t%360+360)%360}const w={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"},k={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"};let M;const S=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/,P=t=>t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,D=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function O(t,e,i){if(t){let s=b(t);s[e]=Math.max(0,Math.min(s[e]+s[e]*i,0===e?360:1)),s=y(s),t.r=s[0],t.g=s[1],t.b=s[2]}}function C(t,e){return t?Object.assign(e||{},t):t}function T(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=a(t[3]))):(e=C(t,{r:0,g:0,b:0,a:1})).a=a(e.a),e}function A(t){return"r"===t.charAt(0)?function(t){const e=S.exec(t);let i,s,a,r=255;if(e){if(e[7]!==i){const t=+e[7];r=e[8]?o(t):n(255*t,0,255)}return i=+e[1],s=+e[3],a=+e[5],i=255&(e[2]?o(i):n(i,0,255)),s=255&(e[4]?o(s):n(s,0,255)),a=255&(e[6]?o(a):n(a,0,255)),{r:i,g:s,b:a,a:r}}}(t):function(t){const e=g.exec(t);let i,s=255;if(!e)return;e[5]!==i&&(s=e[6]?o(+e[5]):a(+e[5]));const n=v(+e[2]),r=+e[3]/100,h=+e[4]/100;return i="hwb"===e[1]?function(t,e,i){return _(m,t,e,i)}(n,r,h):"hsv"===e[1]?function(t,e,i){return _(x,t,e,i)}(n,r,h):y(n,r,h),{r:i[0],g:i[1],b:i[2],a:s}}(t)}class I{constructor(t){if(t instanceof I)return t;const e=typeof t;let i;var s,n,o;"object"===e?i=T(t):"string"===e&&(o=(s=t).length,"#"===s[0]&&(4===o||5===o?n={r:255&17*l[s[1]],g:255&17*l[s[2]],b:255&17*l[s[3]],a:5===o?17*l[s[4]]:255}:7!==o&&9!==o||(n={r:l[s[1]]<<4|l[s[2]],g:l[s[3]]<<4|l[s[4]],b:l[s[5]]<<4|l[s[6]],a:9===o?l[s[7]]<<4|l[s[8]]:255})),i=n||function(t){M||(M=function(){const t={},e=Object.keys(k),i=Object.keys(w);let s,n,o,a,r;for(s=0;s<e.length;s++){for(a=r=e[s],n=0;n<i.length;n++)o=i[n],r=r.replace(o,w[o]);o=parseInt(k[a],16),t[r]=[o>>16&255,o>>8&255,255&o]}return t}(),M.transparent=[0,0,0,0]);const e=M[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}(t)||A(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=C(this._rgb);return t&&(t.a=r(t.a)),t}set rgb(t){this._rgb=T(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${r(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):void 0;var t}hexString(){return this._valid?(t=this._rgb,e=(t=>f(t.r)&&f(t.g)&&f(t.b)&&f(t.a))(t)?d:u,t?"#"+e(t.r)+e(t.g)+e(t.b)+((t,e)=>t<255?e(t):"")(t.a,e):void 0):void 0;var t,e}hslString(){return this._valid?function(t){if(!t)return;const e=b(t),i=e[0],s=h(e[1]),n=h(e[2]);return t.a<255?`hsla(${i}, ${s}%, ${n}%, ${r(t.a)})`:`hsl(${i}, ${s}%, ${n}%)`}(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,s=t.rgb;let n;const o=e===n?.5:e,a=2*o-1,r=i.a-s.a,h=((a*r===-1?a:(a+r)/(1+a*r))+1)/2;n=1-h,i.r=255&h*i.r+n*s.r+.5,i.g=255&h*i.g+n*s.g+.5,i.b=255&h*i.b+n*s.b+.5,i.a=o*i.a+(1-o)*s.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=function(t,e,i){const s=D(r(t.r)),n=D(r(t.g)),o=D(r(t.b));return{r:a(P(s+i*(D(r(e.r))-s))),g:a(P(n+i*(D(r(e.g))-n))),b:a(P(o+i*(D(r(e.b))-o))),a:t.a+i*(e.a-t.a)}}(this._rgb,t._rgb,e)),this}clone(){return new I(this.rgb)}alpha(t){return this._rgb.a=a(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=s(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.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 O(this._rgb,2,t),this}darken(t){return O(this._rgb,2,-t),this}saturate(t){return O(this._rgb,1,t),this}desaturate(t){return O(this._rgb,1,-t),this}rotate(t){return function(t,e){var i=b(t);i[0]=v(i[0]+e),i=y(i),t.r=i[0],t.g=i[1],t.b=i[2]}(this._rgb,t),this}}},44656:(t,e,i)=>{i.d(e,{FN:()=>Jt,No:()=>Gt,PP:()=>Fe,dN:()=>xe,hE:()=>be,kc:()=>Be,m_:()=>Ee,t1:()=>Wt});var s=i(99284);i(44594);class n{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,s){const n=e.listeners[s],o=e.duration;n.forEach(s=>s({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(i-e.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=s.r.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const n=i.items;let o,a=n.length-1,r=!1;for(;a>=0;--a)o=n[a],o._active?(o._total>i.duration&&(i.duration=o._total),o.tick(t),r=!0):(n[a]=n[n.length-1],n.pop());r&&(s.draw(),this._notify(s,i,t,"progress")),n.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=n.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 s=i.length-1;for(;s>=0;--s)i[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var o=new n;const a="transparent",r={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){const n=(0,s.c)(t||a),o=n.valid&&(0,s.c)(e||a);return o&&o.valid?o.mix(n,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class h{constructor(t,e,i,n){const o=e[i];n=(0,s.a)([t.to,n,o,t.from]);const a=(0,s.a)([t.from,o,n]);this._active=!0,this._fn=t.fn||r[t.type||typeof a],this._easing=s.e[t.easing]||s.e.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=a,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const n=this._target[this._prop],o=i-this._start,a=this._duration-o;this._start=i,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=(0,s.a)([t.to,e,n,t.from]),this._from=(0,s.a)([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,s=this._prop,n=this._from,o=this._loop,a=this._to;let r;if(this._active=n!==a&&(o||e<i),!this._active)return this._target[s]=a,void this._notify(!0);e<0?this._target[s]=n:(r=e/i%2,r=o&&r>1?2-r:r,r=this._easing(Math.min(1,Math.max(0,r))),this._target[s]=this._fn(n,a,r))}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 t=0;t<i.length;t++)i[t][e]()}}class l{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!(0,s.i)(t))return;const e=Object.keys(s.d.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(n=>{const o=t[n];if(!(0,s.i)(o))return;const a={};for(const t of e)a[t]=o[t];((0,s.b)(o.properties)&&o.properties||[n]).forEach(t=>{t!==n&&i.has(t)||i.set(t,a)})})}_animateOptions(t,e){const i=e.options,s=function(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}(t,i);if(!s)return[];const n=this._createAnimations(s,i);return i.$shared&&function(t,e){const i=[],s=Object.keys(e);for(let e=0;e<s.length;e++){const n=t[s[e]];n&&n.active()&&i.push(n.wait())}return Promise.all(i)}(t.options.$animations,i).then(()=>{t.options=i},()=>{}),n}_createAnimations(t,e){const i=this._properties,s=[],n=t.$animations||(t.$animations={}),o=Object.keys(e),a=Date.now();let r;for(r=o.length-1;r>=0;--r){const l=o[r];if("$"===l.charAt(0))continue;if("options"===l){s.push(...this._animateOptions(t,e));continue}const c=e[l];let d=n[l];const u=i.get(l);if(d){if(u&&d.active()){d.update(u,c,a);continue}d.cancel()}u&&u.duration?(n[l]=d=new h(u,t,l,c),s.push(d)):t[l]=c}return s}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 c(t,e){const i=t&&t.options||{},s=i.reverse,n=void 0===i.min?e:0,o=void 0===i.max?e:0;return{start:s?o:n,end:s?n:o}}function d(t,e){const i=[],s=t._getSortedDatasetMetas(e);let n,o;for(n=0,o=s.length;n<o;++n)i.push(s[n].index);return i}function u(t,e,i,n={}){const o=t.keys,a="single"===n.mode;let r,h,l,c;if(null===e)return;let d=!1;for(r=0,h=o.length;r<h;++r){if(l=+o[r],l===i){if(d=!0,n.all)continue;break}c=t.values[l],(0,s.g)(c)&&(a||0===e||(0,s.s)(e)===(0,s.s)(c))&&(e+=c)}return d||n.all?e:0}function f(t,e){const i=t&&t.options.stacked;return i||void 0===i&&void 0!==e.stack}function g(t,e,i){const s=t[e]||(t[e]={});return s[i]||(s[i]={})}function p(t,e,i,s){for(const n of e.getMatchingVisibleMetas(s).reverse()){const e=t[n.index];if(i&&e>0||!i&&e<0)return n.index}return null}function x(t,e){const{chart:i,_cachedMeta:s}=t,n=i._stacks||(i._stacks={}),{iScale:o,vScale:a,index:r}=s,h=o.axis,l=a.axis,c=function(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}(o,a,s),d=e.length;let u;for(let t=0;t<d;++t){const i=e[t],{[h]:o,[l]:d}=i;u=(i._stacks||(i._stacks={}))[l]=g(n,c,o),u[r]=d,u._top=p(u,a,!0,s.type),u._bottom=p(u,a,!1,s.type),(u._visualValues||(u._visualValues={}))[r]=d}}function m(t,e){const i=t.scales;return Object.keys(i).filter(t=>i[t].axis===e).shift()}function b(t,e){const i=t.controller.index,s=t.vScale&&t.vScale.axis;if(s){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[s]||void 0===e[s][i])return;delete e[s][i],void 0!==e[s]._visualValues&&void 0!==e[s]._visualValues[i]&&delete e[s]._visualValues[i]}}}const _=t=>"reset"===t||"none"===t,y=(t,e)=>e?t:Object.assign({},t);class v{static defaults={};static datasetElementType=null;static dataElementType=null;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.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=f(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&b(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),n=(t,e,i,s)=>"x"===t?e:"r"===t?s:i,o=e.xAxisID=(0,s.v)(i.xAxisID,m(t,"x")),a=e.yAxisID=(0,s.v)(i.yAxisID,m(t,"y")),r=e.rAxisID=(0,s.v)(i.rAxisID,m(t,"r")),h=e.indexAxis,l=e.iAxisID=n(h,o,a,r),c=e.vAxisID=n(h,a,o,r);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(r),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&&(0,s.u)(this._data,this),t._stacked&&b(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if((0,s.i)(e)){const t=this._cachedMeta;this._data=function(t,e){const{iScale:i,vScale:s}=e,n="x"===i.axis?"x":"y",o="x"===s.axis?"x":"y",a=Object.keys(t),r=new Array(a.length);let h,l,c;for(h=0,l=a.length;h<l;++h)c=a[h],r[h]={[n]:c,[o]:t[c]};return r}(e,t)}else if(i!==e){if(i){(0,s.u)(i,this);const t=this._cachedMeta;b(t),t._parsed=[]}e&&Object.isExtensible(e)&&(0,s.l)(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 s=!1;this._dataCheck();const n=e._stacked;e._stacked=f(e.vScale,e),e.stack!==i.stack&&(s=!0,b(e),e.stack=i.stack),this._resyncElements(t),(s||n!==e._stacked)&&(x(this,e._parsed),e._stacked=f(e.vScale,e))}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:n}=this,{iScale:o,_stacked:a}=i,r=o.axis;let h,l,c,d=0===t&&e===n.length||i._sorted,u=t>0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=n,i._sorted=!0,c=n;else{c=(0,s.b)(n[t])?this.parseArrayData(i,n,t,e):(0,s.i)(n[t])?this.parseObjectData(i,n,t,e):this.parsePrimitiveData(i,n,t,e);const o=()=>null===l[r]||u&&l[r]<u[r];for(h=0;h<e;++h)i._parsed[h+t]=l=c[h],d&&(o()&&(d=!1),u=l);i._sorted=d}a&&x(this,c)}parsePrimitiveData(t,e,i,s){const{iScale:n,vScale:o}=t,a=n.axis,r=o.axis,h=n.getLabels(),l=n===o,c=new Array(s);let d,u,f;for(d=0,u=s;d<u;++d)f=d+i,c[d]={[a]:l||n.parse(h[f],f),[r]:o.parse(e[f],f)};return c}parseArrayData(t,e,i,s){const{xScale:n,yScale:o}=t,a=new Array(s);let r,h,l,c;for(r=0,h=s;r<h;++r)l=r+i,c=e[l],a[r]={x:n.parse(c[0],l),y:o.parse(c[1],l)};return a}parseObjectData(t,e,i,n){const{xScale:o,yScale:a}=t,{xAxisKey:r="x",yAxisKey:h="y"}=this._parsing,l=new Array(n);let c,d,u,f;for(c=0,d=n;c<d;++c)u=c+i,f=e[u],l[c]={x:o.parse((0,s.f)(f,r),u),y:a.parse((0,s.f)(f,h),u)};return l}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const s=this.chart,n=this._cachedMeta,o=e[t.axis];return u({keys:d(s,!0),values:e._stacks[t.axis]._visualValues},o,n.index,{mode:i})}updateRangeFromParsed(t,e,i,s){const n=i[e.axis];let o=null===n?NaN:n;const a=s&&i._stacks[e.axis];s&&a&&(s.values=a,o=u(s,n,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,e){const i=this._cachedMeta,n=i._parsed,o=i._sorted&&t===i.iScale,a=n.length,r=this._getOtherScale(t),h=((t,e,i)=>t&&!e.hidden&&e._stacked&&{keys:d(i,!0),values:null})(e,i,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:u}=function(t){const{min:e,max:i,minDefined:s,maxDefined:n}=t.getUserBounds();return{min:s?e:Number.NEGATIVE_INFINITY,max:n?i:Number.POSITIVE_INFINITY}}(r);let f,g;function p(){g=n[f];const e=g[r.axis];return!(0,s.g)(g[t.axis])||c>e||u<e}for(f=0;f<a&&(p()||(this.updateRangeFromParsed(l,t,g,h),!o));++f);if(o)for(f=a-1;f>=0;--f)if(!p()){this.updateRangeFromParsed(l,t,g,h);break}return l}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let n,o,a;for(n=0,o=e.length;n<o;++n)a=e[n][t.axis],(0,s.g)(a)&&i.push(a);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,s=e.vScale,n=this.getParsed(t);return{label:i?""+i.getLabelForValue(n[i.axis]):"",value:s?""+s.getLabelForValue(n[s.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=function(t){let e,i,n,o;return(0,s.i)(t)?(e=t.top,i=t.right,n=t.bottom,o=t.left):e=i=n=o=t,{top:e,right:i,bottom:n,left:o,disabled:!1===t}}((0,s.v)(this.options.clip,function(t,e,i){if(!1===i)return!1;const s=c(t,i),n=c(e,i);return{top:n.end,right:s.end,bottom:n.start,left:s.start}}(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,s=i.data||[],n=e.chartArea,o=[],a=this._drawStart||0,r=this._drawCount||s.length-a,h=this.options.drawActiveElementsOnTop;let l;for(i.dataset&&i.dataset.draw(t,n,a,r),l=a;l<a+r;++l){const e=s[l];e.hidden||(e.active&&h?o.push(e):e.draw(t,n))}for(l=0;l<o.length;++l)o[l].draw(t,n)}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 o;if(t>=0&&t<this._cachedMeta.data.length){const e=this._cachedMeta.data[t];o=e.$context||(e.$context=function(t,e,i){return(0,s.j)(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:i,index:e,mode:"default",type:"data"})}(this.getContext(),t,e)),o.parsed=this.getParsed(t),o.raw=n.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=function(t,e){return(0,s.j)(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}(this.chart.getContext(),this.index)),o.dataset=n,o.index=o.datasetIndex=this.index;return o.active=!!e,o.mode=i,o}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 n="active"===e,o=this._cachedDataOpts,a=t+"-"+e,r=o[a],h=this.enableOptionSharing&&(0,s.h)(i);if(r)return y(r,h);const l=this.chart.config,c=l.datasetElementScopeKeys(this._type,t),d=n?[`${t}Hover`,"hover",t,""]:[t,""],u=l.getOptionScopes(this.getDataset(),c),f=Object.keys(s.d.elements[t]),g=l.resolveNamedOptions(u,f,()=>this.getContext(i,n,e),d);return g.$shared&&(g.$shared=h,o[a]=Object.freeze(y(g,h))),g}_resolveAnimations(t,e,i){const s=this.chart,n=this._cachedDataOpts,o=`animation-${e}`,a=n[o];if(a)return a;let r;if(!1!==s.options.animation){const s=this.chart.config,n=s.datasetAnimationScopeKeys(this._type,e),o=s.getOptionScopes(this.getDataset(),n);r=s.createResolver(o,this.getContext(t,i,e))}const h=new l(s,r&&r.animations);return r&&r._cacheable&&(n[o]=Object.freeze(h)),h}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||_(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),s=this._sharedOptions,n=this.getSharedOptions(i),o=this.includeOptions(e,n)||n!==s;return this.updateSharedOptions(n,e,i),{sharedOptions:n,includeOptions:o}}updateElement(t,e,i,s){_(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!_(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;const n=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(n)||n})}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[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];const s=i.length,n=e.length,o=Math.min(n,s);o&&this.parse(0,o),n>s?this._insertElements(s,n-s,t):n<s&&this._removeElements(n,s-n)}_insertElements(t,e,i=!0){const s=this._cachedMeta,n=s.data,o=t+e;let a;const r=t=>{for(t.length+=e,a=t.length-1;a>=o;a--)t[a]=t[a-e]};for(r(n),a=t;a<o;++a)n[a]=new this.dataElementType;this._parsing&&r(s._parsed),this.parse(t,e),i&&this.updateElements(n,t,e,"reset")}updateElements(t,e,i,s){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(t,e);i._stacked&&b(i,s)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,s]=t;this[e](i,s)}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 w(t,e,i,n){const{controller:o,data:a,_sorted:r}=t,h=o._cachedMeta.iScale,l=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null;if(h&&e===h.axis&&"r"!==e&&r&&a.length){const r=h._reversePixels?s.A:s.B;if(!n){const n=r(a,e,i);if(l){const{vScale:e}=o._cachedMeta,{_parsed:i}=t,a=i.slice(0,n.lo+1).reverse().findIndex(t=>!(0,s.k)(t[e.axis]));n.lo-=Math.max(0,a);const r=i.slice(n.hi).findIndex(t=>!(0,s.k)(t[e.axis]));n.hi+=Math.max(0,r)}return n}if(o._sharedOptions){const t=a[0],s="function"==typeof t.getRange&&t.getRange(e);if(s){const t=r(a,e,i-s),n=r(a,e,i+s);return{lo:t.lo,hi:n.hi}}}}return{lo:0,hi:a.length-1}}function k(t,e,i,s,n){const o=t.getSortedVisibleDatasetMetas(),a=i[e];for(let t=0,i=o.length;t<i;++t){const{index:i,data:r}=o[t],{lo:h,hi:l}=w(o[t],e,a,n);for(let t=h;t<=l;++t){const e=r[t];e.skip||s(e,i,t)}}}function M(t,e,i,n,o){const a=[];return o||t.isPointInArea(e)?(k(t,i,e,function(i,r,h){(o||(0,s.C)(i,t.chartArea,0))&&i.inRange(e.x,e.y,n)&&a.push({element:i,datasetIndex:r,index:h})},!0),a):a}function S(t,e,i,n,o,a){return a||t.isPointInArea(e)?"r"!==i||n?function(t,e,i,s,n,o){let a=[];const r=function(t){const e=-1!==t.indexOf("x"),i=-1!==t.indexOf("y");return function(t,s){const n=e?Math.abs(t.x-s.x):0,o=i?Math.abs(t.y-s.y):0;return Math.sqrt(Math.pow(n,2)+Math.pow(o,2))}}(i);let h=Number.POSITIVE_INFINITY;return k(t,i,e,function(i,l,c){const d=i.inRange(e.x,e.y,n);if(s&&!d)return;const u=i.getCenterPoint(n);if(!o&&!t.isPointInArea(u)&&!d)return;const f=r(e,u);f<h?(a=[{element:i,datasetIndex:l,index:c}],h=f):f===h&&a.push({element:i,datasetIndex:l,index:c})}),a}(t,e,i,n,o,a):function(t,e,i,n){let o=[];return k(t,i,e,function(t,i,a){const{startAngle:r,endAngle:h}=t.getProps(["startAngle","endAngle"],n),{angle:l}=(0,s.D)(t,{x:e.x,y:e.y});(0,s.p)(l,r,h)&&o.push({element:t,datasetIndex:i,index:a})}),o}(t,e,i,o):[]}function P(t,e,i,s,n){const o=[],a="x"===i?"inXRange":"inYRange";let r=!1;return k(t,i,e,(t,s,h)=>{t[a]&&t[a](e[i],n)&&(o.push({element:t,datasetIndex:s,index:h}),r=r||t.inRange(e.x,e.y,n))}),s&&!r?[]:o}var D={evaluateInteractionItems:k,modes:{index(t,e,i,n){const o=(0,s.z)(e,t),a=i.axis||"x",r=i.includeInvisible||!1,h=i.intersect?M(t,o,a,n,r):S(t,o,a,!1,n,r),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,n){const o=(0,s.z)(e,t),a=i.axis||"xy",r=i.includeInvisible||!1;let h=i.intersect?M(t,o,a,n,r):S(t,o,a,!1,n,r);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,n)=>M(t,(0,s.z)(e,t),i.axis||"xy",n,i.includeInvisible||!1),nearest(t,e,i,n){const o=(0,s.z)(e,t),a=i.axis||"xy",r=i.includeInvisible||!1;return S(t,o,a,i.intersect,n,r)},x:(t,e,i,n)=>P(t,(0,s.z)(e,t),"x",i.intersect,n),y:(t,e,i,n)=>P(t,(0,s.z)(e,t),"y",i.intersect,n)}};const O=["left","top","right","bottom"];function C(t,e){return t.filter(t=>t.pos===e)}function T(t,e){return t.filter(t=>-1===O.indexOf(t.pos)&&t.box.axis===e)}function A(t,e){return t.sort((t,i)=>{const s=e?i:t,n=e?t:i;return s.weight===n.weight?s.index-n.index:s.weight-n.weight})}function I(t,e,i,s){return Math.max(t[i],e[i])+Math.max(t[s],e[s])}function E(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 L(t,e,i,n){const{pos:o,box:a}=i,r=t.maxPadding;if(!(0,s.i)(o)){i.size&&(t[o]-=i.size);const e=n[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?a.height:a.width),i.size=e.size/e.count,t[o]+=i.size}a.getPadding&&E(r,a.getPadding());const h=Math.max(0,e.outerWidth-I(r,t,"left","right")),l=Math.max(0,e.outerHeight-I(r,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 F(t,e){const i=e.maxPadding;return function(t){const s={left:0,top:0,right:0,bottom:0};return t.forEach(t=>{s[t]=Math.max(e[t],i[t])}),s}(t?["left","right"]:["top","bottom"])}function R(t,e,i,s){const n=[];let o,a,r,h,l,c;for(o=0,a=t.length,l=0;o<a;++o){r=t[o],h=r.box,h.update(r.width||e.w,r.height||e.h,F(r.horizontal,e));const{same:a,other:d}=L(e,i,r,s);l|=a&&n.length,c=c||d,h.fullSize||n.push(r)}return l&&R(n,e,i,s)||c}function z(t,e,i,s,n){t.top=i,t.left=e,t.right=e+s,t.bottom=i+n,t.width=s,t.height=n}function B(t,e,i,n){const o=i.padding;let{x:a,y:r}=e;for(const h of t){const t=h.box,l=n[h.stack]||{count:1,placed:0,weight:1},c=h.stackWeight/l.weight||1;if(h.horizontal){const n=e.w*c,a=l.size||t.height;(0,s.h)(l.start)&&(r=l.start),t.fullSize?z(t,o.left,r,i.outerWidth-o.right-o.left,a):z(t,e.left+l.placed,r,n,a),l.start=r,l.placed+=n,r=t.bottom}else{const n=e.h*c,r=l.size||t.width;(0,s.h)(l.start)&&(a=l.start),t.fullSize?z(t,a,o.top,r,i.outerHeight-o.bottom-o.top):z(t,a,e.top+l.placed,r,n),l.start=a,l.placed+=n,a=t.right}}e.x=a,e.y=r}var j={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,n){if(!t)return;const o=(0,s.E)(t.options.layout.padding),a=Math.max(e-o.width,0),r=Math.max(i-o.height,0),h=function(t){const e=function(t){const e=[];let i,s,n,o,a,r;for(i=0,s=(t||[]).length;i<s;++i)n=t[i],({position:o,options:{stack:a,stackWeight:r=1}}=n),e.push({index:i,box:n,pos:o,horizontal:n.isHorizontal(),weight:n.weight,stack:a&&o+a,stackWeight:r});return e}(t),i=A(e.filter(t=>t.box.fullSize),!0),s=A(C(e,"left"),!0),n=A(C(e,"right")),o=A(C(e,"top"),!0),a=A(C(e,"bottom")),r=T(e,"x"),h=T(e,"y");return{fullSize:i,leftAndTop:s.concat(o),rightAndBottom:n.concat(h).concat(a).concat(r),chartArea:C(e,"chartArea"),vertical:s.concat(n).concat(h),horizontal:o.concat(a).concat(r)}}(t.boxes),l=h.vertical,c=h.horizontal;(0,s.F)(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:a,availableHeight:r,vBoxMaxWidth:a/2/d,hBoxMaxHeight:r/2}),f=Object.assign({},o);E(f,(0,s.E)(n));const g=Object.assign({maxPadding:f,w:a,h:r,x:o.left,y:o.top},o),p=function(t,e){const i=function(t){const e={};for(const i of t){const{stack:t,pos:s,stackWeight:n}=i;if(!t||!O.includes(s))continue;const o=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=n}return e}(t),{vBoxMaxWidth:s,hBoxMaxHeight:n}=e;let o,a,r;for(o=0,a=t.length;o<a;++o){r=t[o];const{fullSize:a}=r.box,h=i[r.stack],l=h&&r.stackWeight/h.weight;r.horizontal?(r.width=l?l*s:a&&e.availableWidth,r.height=n):(r.width=s,r.height=l?l*n:a&&e.availableHeight)}return i}(l.concat(c),u);R(h.fullSize,g,u,p),R(l,g,u,p),R(c,g,u,p)&&R(l,g,u,p),function(t){const e=t.maxPadding;function i(i){const s=Math.max(e[i]-t[i],0);return t[i]+=s,s}t.y+=i("top"),t.x+=i("left"),i("right"),i("bottom")}(g),B(h.leftAndTop,g,u,p),g.x+=g.w,g.y+=g.h,B(h.rightAndBottom,g,u,p),t.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},(0,s.F)(h.chartArea,e=>{const i=e.box;Object.assign(i,t.chartArea),i.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})})}};class H{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,s){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):i)}}isAttached(t){return!0}updateConfig(t){}}class V extends H{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const W="$chartjs",N={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},$=t=>null===t||""===t,Y=!!s.K&&{passive:!0};function U(t,e,i){t&&t.canvas&&t.canvas.removeEventListener(e,i,Y)}function X(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function Q(t,e,i){const s=t.canvas,n=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||X(i.addedNodes,s),e=e&&!X(i.removedNodes,s);e&&i()});return n.observe(document,{childList:!0,subtree:!0}),n}function q(t,e,i){const s=t.canvas,n=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||X(i.removedNodes,s),e=e&&!X(i.addedNodes,s);e&&i()});return n.observe(document,{childList:!0,subtree:!0}),n}const K=new Map;let G=0;function Z(){const t=window.devicePixelRatio;t!==G&&(G=t,K.forEach((e,i)=>{i.currentDevicePixelRatio!==t&&e()}))}function J(t,e,i){const n=t.canvas,o=n&&(0,s.I)(n);if(!o)return;const a=(0,s.L)((t,e)=>{const s=o.clientWidth;i(t,e),s<o.clientWidth&&i()},window),r=new ResizeObserver(t=>{const e=t[0],i=e.contentRect.width,s=e.contentRect.height;0===i&&0===s||a(i,s)});return r.observe(o),function(t,e){K.size||window.addEventListener("resize",Z),K.set(t,e)}(t,a),r}function tt(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){K.delete(t),K.size||window.removeEventListener("resize",Z)}(t)}function et(t,e,i){const n=t.canvas,o=(0,s.L)(e=>{null!==t.ctx&&i(function(t,e){const i=N[t.type]||t.type,{x:n,y:o}=(0,s.z)(t,e);return{type:i,chart:e,native:t,x:void 0!==n?n:null,y:void 0!==o?o:null}}(e,t))},t);return function(t,e,i){t&&t.addEventListener(e,i,Y)}(n,e,o),o}class it extends H{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(function(t,e){const i=t.style,n=t.getAttribute("height"),o=t.getAttribute("width");if(t[W]={initial:{height:n,width:o,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",$(o)){const e=(0,s.J)(t,"width");void 0!==e&&(t.width=e)}if($(n))if(""===t.style.height)t.height=t.width/(e||2);else{const e=(0,s.J)(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[W])return!1;const i=e[W].initial;["height","width"].forEach(t=>{const n=i[t];(0,s.k)(n)?e.removeAttribute(t):e.setAttribute(t,n)});const n=i.style||{};return Object.keys(n).forEach(t=>{e.style[t]=n[t]}),e.width=e.width,delete e[W],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),n={attach:Q,detach:q,resize:J}[e]||et;s[e]=n(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];s&&(({attach:tt,detach:tt,resize:tt}[e]||U)(t,e,s),i[e]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,n){return(0,s.G)(t,e,i,n)}isAttached(t){const e=t&&(0,s.I)(t);return!(!e||!e.isConnected)}}class st{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return(0,s.x)(this.x)&&(0,s.x)(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const s={};return t.forEach(t=>{s[t]=i[t]&&i[t].active()?i[t]._to:this[t]}),s}}function nt(t,e,i,n,o){const a=(0,s.v)(n,0),r=Math.min((0,s.v)(o,t.length),t.length);let h,l,c,d=0;for(i=Math.ceil(i),o&&(h=o-n,i=h/Math.floor(h/i)),c=a;c<0;)d++,c=Math.round(a+d*i);for(l=Math.max(a,0);l<r;l++)l===c&&(e.push(t[l]),d++,c=Math.round(a+d*i))}const ot=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i,at=(t,e)=>Math.min(e||t,t);function rt(t,e){const i=[],s=t.length/e,n=t.length;let o=0;for(;o<n;o+=s)i.push(t[Math.floor(o)]);return i}function ht(t,e,i){const s=t.ticks.length,n=Math.min(e,s-1),o=t._startPixel,a=t._endPixel,r=1e-6;let h,l=t.getPixelForTick(n);if(!(i&&(h=1===s?Math.max(l-o,a-l):0===e?(t.getPixelForTick(1)-l)/2:(l-t.getPixelForTick(n-1))/2,l+=n<e?h:-h,l<o-r||l>a+r)))return l}function lt(t){return t.drawTicks?t.tickLength:0}function ct(t,e){if(!t.display)return 0;const i=(0,s.a0)(t.font,e),n=(0,s.E)(t.padding);return((0,s.b)(t.text)?t.text.length:1)*i.lineHeight+n.height}function dt(t,e,i){let n=(0,s.a1)(t);return(i&&"right"!==e||!i&&"right"===e)&&(n=(t=>"left"===t?"right":"right"===t?"left":t)(n)),n}class ut 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:n}=this;return t=(0,s.O)(t,Number.POSITIVE_INFINITY),e=(0,s.O)(e,Number.NEGATIVE_INFINITY),i=(0,s.O)(i,Number.POSITIVE_INFINITY),n=(0,s.O)(n,Number.NEGATIVE_INFINITY),{min:(0,s.O)(t,i),max:(0,s.O)(e,n),minDefined:(0,s.g)(t),maxDefined:(0,s.g)(e)}}getMinMax(t){let e,{min:i,max:n,minDefined:o,maxDefined:a}=this.getUserBounds();if(o&&a)return{min:i,max:n};const r=this.getMatchingVisibleMetas();for(let s=0,h=r.length;s<h;++s)e=r[s].controller.getMinMax(this,t),o||(i=Math.min(i,e.min)),a||(n=Math.max(n,e.max));return i=a&&i>n?n:i,n=o&&i>n?i:n,{min:(0,s.O)(i,(0,s.O)(n,i)),max:(0,s.O)(n,(0,s.O)(i,n))}}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||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){(0,s.Q)(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:n,grace:o,ticks:a}=this.options,r=a.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=(0,s.R)(this,o,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const h=r<this.ticks.length;this._convertTicksToLabels(h?rt(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||"auto"===a.source)&&(this.ticks=function(t,e){const i=t.options.ticks,n=function(t){const e=t.options.offset,i=t._tickSize(),s=t._length/i+(e?0:1),n=t._maxLength/i;return Math.floor(Math.min(s,n))}(t),o=Math.min(i.maxTicksLimit||n,n),a=i.major.enabled?function(t){const e=[];let i,s;for(i=0,s=t.length;i<s;i++)t[i].major&&e.push(i);return e}(e):[],r=a.length,h=a[0],l=a[r-1],c=[];if(r>o)return function(t,e,i,s){let n,o=0,a=i[0];for(s=Math.ceil(s),n=0;n<t.length;n++)n===a&&(e.push(t[n]),o++,a=i[o*s])}(e,c,a,r/o),c;const d=function(t,e,i){const n=function(t){const e=t.length;let i,s;if(e<2)return!1;for(s=t[0],i=1;i<e;++i)if(t[i]-t[i-1]!==s)return!1;return s}(t),o=e.length/i;if(!n)return Math.max(o,1);const a=(0,s.N)(n);for(let t=0,e=a.length-1;t<e;t++){const e=a[t];if(e>o)return e}return Math.max(o,1)}(a,e,o);if(r>0){let t,i;const n=r>1?Math.round((l-h)/(r-1)):null;for(nt(e,c,d,(0,s.k)(n)?0:h-n,h),t=0,i=r-1;t<i;t++)nt(e,c,d,a[t],a[t+1]);return nt(e,c,d,l,(0,s.k)(n)?e.length:l+n),c}return nt(e,c,d),c}(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(){(0,s.Q)(this.options.afterUpdate,[this])}beforeSetDimensions(){(0,s.Q)(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){(0,s.Q)(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),(0,s.Q)(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){(0,s.Q)(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,n,o;for(i=0,n=t.length;i<n;i++)o=t[i],o.label=(0,s.Q)(e.callback,[o.value,i,t],this)}afterTickToLabelConversion(){(0,s.Q)(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){(0,s.Q)(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=at(this.ticks.length,t.ticks.maxTicksLimit),n=e.minRotation||0,o=e.maxRotation;let a,r,h,l=n;if(!this._isVisible()||!e.display||n>=o||i<=1||!this.isHorizontal())return void(this.labelRotation=n);const c=this._getLabelSizes(),d=c.widest.width,u=c.highest.height,f=(0,s.S)(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/i:f/(i-1),d+6>a&&(a=f/(i-(t.offset?.5:1)),r=this.maxHeight-lt(t.grid)-e.padding-ct(t.title,this.chart.options.font),h=Math.sqrt(d*d+u*u),l=(0,s.U)(Math.min(Math.asin((0,s.S)((c.highest.height+6)/a,-1,1)),Math.asin((0,s.S)(r/h,-1,1))-Math.asin((0,s.S)(u/h,-1,1)))),l=Math.max(n,Math.min(o,l))),this.labelRotation=l}afterCalculateLabelRotation(){(0,s.Q)(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){(0,s.Q)(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:n,grid:o}}=this,a=this._isVisible(),r=this.isHorizontal();if(a){const a=ct(n,e.options.font);if(r?(t.width=this.maxWidth,t.height=lt(o)+a):(t.height=this.maxHeight,t.width=lt(o)+a),i.display&&this.ticks.length){const{first:e,last:n,widest:o,highest:a}=this._getLabelSizes(),h=2*i.padding,l=(0,s.t)(this.labelRotation),c=Math.cos(l),d=Math.sin(l);if(r){const e=i.mirror?0:d*o.width+c*a.height;t.height=Math.min(this.maxHeight,t.height+e+h)}else{const e=i.mirror?0:c*o.width+d*a.height;t.width=Math.min(this.maxWidth,t.width+e+h)}this._calculatePadding(e,n,d,c)}}this._handleMargins(),r?(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,s){const{ticks:{align:n,padding:o},position:a}=this.options,r=0!==this.labelRotation,h="top"!==a&&"x"===this.axis;if(this.isHorizontal()){const a=this.getPixelForTick(0)-this.left,l=this.right-this.getPixelForTick(this.ticks.length-1);let c=0,d=0;r?h?(c=s*t.width,d=i*e.height):(c=i*t.height,d=s*e.width):"start"===n?d=e.width:"end"===n?c=t.width:"inner"!==n&&(c=t.width/2,d=e.width/2),this.paddingLeft=Math.max((c-a+o)*this.width/(this.width-a),0),this.paddingRight=Math.max((d-l+o)*this.width/(this.width-l),0)}else{let i=e.height/2,s=t.height/2;"start"===n?(i=0,s=t.height):"end"===n&&(i=e.height,s=0),this.paddingTop=i+o,this.paddingBottom=s+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(){(0,s.Q)(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++)(0,s.k)(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=rt(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:n,_longestTextCache:o}=this,a=[],r=[],h=Math.floor(e/at(e,i));let l,c,d,u,f,g,p,x,m,b,_,y=0,v=0;for(l=0;l<e;l+=h){if(u=t[l].label,f=this._resolveTickFontOptions(l),n.font=g=f.string,p=o[g]=o[g]||{data:{},gc:[]},x=f.lineHeight,m=b=0,(0,s.k)(u)||(0,s.b)(u)){if((0,s.b)(u))for(c=0,d=u.length;c<d;++c)_=u[c],(0,s.k)(_)||(0,s.b)(_)||(m=(0,s.V)(n,p.data,p.gc,m,_),b+=x)}else m=(0,s.V)(n,p.data,p.gc,m,u),b=x;a.push(m),r.push(b),y=Math.max(m,y),v=Math.max(b,v)}!function(t,e){(0,s.F)(t,t=>{const i=t.gc,s=i.length/2;let n;if(s>e){for(n=0;n<s;++n)delete t.data[i[n]];i.splice(0,s)}})}(o,e);const w=a.indexOf(y),k=r.indexOf(v),M=t=>({width:a[t]||0,height:r[t]||0});return{first:M(0),last:M(e-1),widest:M(w),highest:M(k),widths:a,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(0,s.W)(this._alignToPixels?(0,s.X)(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=function(t,e,i){return(0,s.j)(t,{tick:i,index:e,type:"tick"})}(this.getContext(),t,i))}return this.$context||(this.$context=(i=this.chart.getContext(),(0,s.j)(i,{scale:this,type:"scale"})));var i}_tickSize(){const t=this.options.ticks,e=(0,s.t)(this.labelRotation),i=Math.abs(Math.cos(e)),n=Math.abs(Math.sin(e)),o=this._getLabelSizes(),a=t.autoSkipPadding||0,r=o?o.widest.width+a:0,h=o?o.highest.height+a:0;return this.isHorizontal()?h*i>r*n?r/i:h/n:h*n<r*i?h/i:r/n}_isVisible(){const t=this.options.display;return"auto"!==t?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,n=this.options,{grid:o,position:a,border:r}=n,h=o.offset,l=this.isHorizontal(),c=this.ticks.length+(h?1:0),d=lt(o),u=[],f=r.setContext(this.getContext()),g=f.display?f.width:0,p=g/2,x=function(t){return(0,s.X)(i,t,g)};let m,b,_,y,v,w,k,M,S,P,D,O;if("top"===a)m=x(this.bottom),w=this.bottom-d,M=m-p,P=x(t.top)+p,O=t.bottom;else if("bottom"===a)m=x(this.top),P=t.top,O=x(t.bottom)-p,w=m+p,M=this.top+d;else if("left"===a)m=x(this.right),v=this.right-d,k=m-p,S=x(t.left)+p,D=t.right;else if("right"===a)m=x(this.left),S=t.left,D=x(t.right)-p,v=m+p,k=this.left+d;else if("x"===e){if("center"===a)m=x((t.top+t.bottom)/2+.5);else if((0,s.i)(a)){const t=Object.keys(a)[0],e=a[t];m=x(this.chart.scales[t].getPixelForValue(e))}P=t.top,O=t.bottom,w=m+p,M=w+d}else if("y"===e){if("center"===a)m=x((t.left+t.right)/2);else if((0,s.i)(a)){const t=Object.keys(a)[0],e=a[t];m=x(this.chart.scales[t].getPixelForValue(e))}v=m-p,k=v-d,S=t.left,D=t.right}const C=(0,s.v)(n.ticks.maxTicksLimit,c),T=Math.max(1,Math.ceil(c/C));for(b=0;b<c;b+=T){const t=this.getContext(b),e=o.setContext(t),n=r.setContext(t),a=e.lineWidth,c=e.color,d=n.dash||[],f=n.dashOffset,g=e.tickWidth,p=e.tickColor,x=e.tickBorderDash||[],m=e.tickBorderDashOffset;_=ht(this,b,h),void 0!==_&&(y=(0,s.X)(i,_,a),l?v=k=S=D=y:w=M=P=O=y,u.push({tx1:v,ty1:w,tx2:k,ty2:M,x1:S,y1:P,x2:D,y2:O,width:a,color:c,borderDash:d,borderDashOffset:f,tickWidth:g,tickColor:p,tickBorderDash:x,tickBorderDashOffset:m}))}return this._ticksLength=c,this._borderValue=m,u}_computeLabelItems(t){const e=this.axis,i=this.options,{position:n,ticks:o}=i,a=this.isHorizontal(),r=this.ticks,{align:h,crossAlign:l,padding:c,mirror:d}=o,u=lt(i.grid),f=u+c,g=d?-c:f,p=-(0,s.t)(this.labelRotation),x=[];let m,b,_,y,v,w,k,M,S,P,D,O,C="middle";if("top"===n)w=this.bottom-g,k=this._getXAxisLabelAlignment();else if("bottom"===n)w=this.top+g,k=this._getXAxisLabelAlignment();else if("left"===n){const t=this._getYAxisLabelAlignment(u);k=t.textAlign,v=t.x}else if("right"===n){const t=this._getYAxisLabelAlignment(u);k=t.textAlign,v=t.x}else if("x"===e){if("center"===n)w=(t.top+t.bottom)/2+f;else if((0,s.i)(n)){const t=Object.keys(n)[0],e=n[t];w=this.chart.scales[t].getPixelForValue(e)+f}k=this._getXAxisLabelAlignment()}else if("y"===e){if("center"===n)v=(t.left+t.right)/2-f;else if((0,s.i)(n)){const t=Object.keys(n)[0],e=n[t];v=this.chart.scales[t].getPixelForValue(e)}k=this._getYAxisLabelAlignment(u).textAlign}"y"===e&&("start"===h?C="top":"end"===h&&(C="bottom"));const T=this._getLabelSizes();for(m=0,b=r.length;m<b;++m){_=r[m],y=_.label;const t=o.setContext(this.getContext(m));M=this.getPixelForTick(m)+o.labelOffset,S=this._resolveTickFontOptions(m),P=S.lineHeight,D=(0,s.b)(y)?y.length:1;const e=D/2,i=t.color,h=t.textStrokeColor,c=t.textStrokeWidth;let u,f=k;if(a?(v=M,"inner"===k&&(f=m===b-1?this.options.reverse?"left":"right":0===m?this.options.reverse?"right":"left":"center"),O="top"===n?"near"===l||0!==p?-D*P+P/2:"center"===l?-T.highest.height/2-e*P+P:-T.highest.height+P/2:"near"===l||0!==p?P/2:"center"===l?T.highest.height/2-e*P:T.highest.height-D*P,d&&(O*=-1),0===p||t.showLabelBackdrop||(v+=P/2*Math.sin(p))):(w=M,O=(1-D)*P/2),t.showLabelBackdrop){const e=(0,s.E)(t.backdropPadding),i=T.heights[m],n=T.widths[m];let o=O-e.top,a=0-e.left;switch(C){case"middle":o-=i/2;break;case"bottom":o-=i}switch(k){case"center":a-=n/2;break;case"right":a-=n;break;case"inner":m===b-1?a-=n:m>0&&(a-=n/2)}u={left:a,top:o,width:n+e.width,height:i+e.height,color:t.backdropColor}}x.push({label:y,font:S,textOffset:O,options:{rotation:p,color:i,strokeColor:h,strokeWidth:c,textAlign:f,textBaseline:C,translation:[v,w],backdrop:u}})}return x}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-(0,s.t)(this.labelRotation))return"top"===t?"left":"right";let i="center";return"start"===e.align?i="left":"end"===e.align?i="right":"inner"===e.align&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:s,padding:n}}=this.options,o=t+n,a=this._getLabelSizes().widest.width;let r,h;return"left"===e?s?(h=this.right+n,"near"===i?r="left":"center"===i?(r="center",h+=a/2):(r="right",h+=a)):(h=this.right-o,"near"===i?r="right":"center"===i?(r="center",h-=a/2):(r="left",h=this.left)):"right"===e?s?(h=this.left+n,"near"===i?r="right":"center"===i?(r="center",h-=a/2):(r="left",h-=a)):(h=this.left+o,"near"===i?r="left":"center"===i?(r="center",h+=a/2):(r="right",h=this.right)):r="right",{textAlign:r,x:h}}_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:s,width:n,height:o}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,s,n,o),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const i=this.ticks.findIndex(e=>e.value===t);return i>=0?e.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let n,o;const a=(t,e,s)=>{s.width&&s.color&&(i.save(),i.lineWidth=s.width,i.strokeStyle=s.color,i.setLineDash(s.borderDash||[]),i.lineDashOffset=s.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(e.display)for(n=0,o=s.length;n<o;++n){const t=s[n];e.drawOnChartArea&&a({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},t),e.drawTicks&&a({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:{border:i,grid:n}}=this,o=i.setContext(this.getContext()),a=i.display?o.width:0;if(!a)return;const r=n.setContext(this.getContext(0)).lineWidth,h=this._borderValue;let l,c,d,u;this.isHorizontal()?(l=(0,s.X)(t,this.left,a)-a/2,c=(0,s.X)(t,this.right,r)+r/2,d=u=h):(d=(0,s.X)(t,this.top,a)-a/2,u=(0,s.X)(t,this.bottom,r)+r/2,l=c=h),e.save(),e.lineWidth=o.width,e.strokeStyle=o.color,e.beginPath(),e.moveTo(l,d),e.lineTo(c,u),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const e=this.ctx,i=this._computeLabelArea();i&&(0,s.Y)(e,i);const n=this.getLabelItems(t);for(const t of n){const i=t.options,n=t.font,o=t.label,a=t.textOffset;(0,s.Z)(e,o,0,a,n,i)}i&&(0,s.$)(e)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:n}}=this;if(!i.display)return;const o=(0,s.a0)(i.font),a=(0,s.E)(i.padding),r=i.align;let h=o.lineHeight/2;"bottom"===e||"center"===e||(0,s.i)(e)?(h+=a.bottom,(0,s.b)(i.text)&&(h+=o.lineHeight*(i.text.length-1))):h+=a.top;const{titleX:l,titleY:c,maxWidth:d,rotation:u}=function(t,e,i,n){const{top:o,left:a,bottom:r,right:h,chart:l}=t,{chartArea:c,scales:d}=l;let u,f,g,p=0;const x=r-o,m=h-a;if(t.isHorizontal()){if(f=(0,s.a2)(n,a,h),(0,s.i)(i)){const t=Object.keys(i)[0],s=i[t];g=d[t].getPixelForValue(s)+x-e}else g="center"===i?(c.bottom+c.top)/2+x-e:ot(t,i,e);u=h-a}else{if((0,s.i)(i)){const t=Object.keys(i)[0],s=i[t];f=d[t].getPixelForValue(s)-m+e}else f="center"===i?(c.left+c.right)/2-m+e:ot(t,i,e);g=(0,s.a2)(n,r,o),p="left"===i?-s.H:s.H}return{titleX:f,titleY:g,maxWidth:u,rotation:p}}(this,h,e,r);(0,s.Z)(t,i.text,0,0,o,{color:i.color,maxWidth:d,rotation:u,textAlign:dt(r,e,n),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=(0,s.v)(t.grid&&t.grid.z,-1),n=(0,s.v)(t.border&&t.border.z,0);return this._isVisible()&&this.draw===ut.prototype.draw?[{z:i,draw:t=>{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:n,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",s=[];let n,o;for(n=0,o=e.length;n<o;++n){const o=e[n];o[i]!==this.id||t&&o.type!==t||s.push(o)}return s}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return(0,s.a0)(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class ft{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;(function(t){return"id"in t&&"defaults"in t})(e)&&(i=this.register(e));const n=this.items,o=t.id,a=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in n||(n[o]=t,function(t,e,i){const n=(0,s.a4)(Object.create(null),[i?s.d.get(i):{},s.d.get(e),t.defaults]);s.d.set(e,n),t.defaultRoutes&&function(t,e){Object.keys(e).forEach(i=>{const n=i.split("."),o=n.pop(),a=[t].concat(n).join("."),r=e[i].split("."),h=r.pop(),l=r.join(".");s.d.route(a,o,l,h)})}(e,t.defaultRoutes),t.descriptors&&s.d.describe(e,t.descriptors)}(t,a,i),this.override&&s.d.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,n=this.scope;i in e&&delete e[i],n&&i in s.d[n]&&(delete s.d[n][i],this.override&&delete s.a3[i])}}class gt{constructor(){this.controllers=new ft(v,"datasets",!0),this.elements=new ft(st,"elements"),this.plugins=new ft(Object,"plugins"),this.scales=new ft(ut,"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 n=i||this._getRegistryForType(e);i||n.isForType(e)||n===this.plugins&&e.id?this._exec(t,n,e):(0,s.F)(e,e=>{const s=i||this._getRegistryForType(e);this._exec(t,s,e)})})}_exec(t,e,i){const n=(0,s.a5)(t);(0,s.Q)(i["before"+n],[],i),e[t](i),(0,s.Q)(i["after"+n],[],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 s=e.get(t);if(void 0===s)throw new Error('"'+t+'" is not a registered '+i+".");return s}}var pt=new gt;class xt{constructor(){this._init=[]}notify(t,e,i,s){"beforeInit"===e&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const n=s?this._descriptors(t).filter(s):this._descriptors(t),o=this._notify(n,t,e,i);return"afterDestroy"===e&&(this._notify(n,t,"stop"),this._notify(this._init,t,"uninstall")),o}_notify(t,e,i,n){n=n||{};for(const o of t){const t=o.plugin,a=t[i],r=[e,n,o.options];if(!1===(0,s.Q)(a,r,t)&&n.cancelable)return!1}return!0}invalidate(){(0,s.k)(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,n=(0,s.v)(i.options&&i.options.plugins,{}),o=function(t){const e={},i=[],s=Object.keys(pt.plugins.items);for(let t=0;t<s.length;t++)i.push(pt.getPlugin(s[t]));const n=t.plugins||[];for(let t=0;t<n.length;t++){const s=n[t];-1===i.indexOf(s)&&(i.push(s),e[s.id]=!0)}return{plugins:i,localIds:e}}(i);return!1!==n||e?function(t,{plugins:e,localIds:i},s,n){const o=[],a=t.getContext();for(const r of e){const e=r.id,h=mt(s[e],n);null!==h&&o.push({plugin:r,options:bt(t.config,{plugin:r,local:i[e]},h,a)})}return o}(t,o,n,e):[]}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,s=(t,e)=>t.filter(t=>!e.some(e=>t.plugin.id===e.plugin.id));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}}function mt(t,e){return e||!1!==t?!0===t?{}:t:null}function bt(t,{plugin:e,local:i},s,n){const o=t.pluginScopeKeys(e),a=t.getOptionScopes(s,o);return i&&e.defaults&&a.push(e.defaults),t.createResolver(a,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function _t(t,e){const i=s.d.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function yt(t){if("x"===t||"y"===t||"r"===t)return t}function vt(t){return"top"===t||"bottom"===t?"x":"left"===t||"right"===t?"y":void 0}function wt(t,...e){if(yt(t))return t;for(const i of e){const e=i.axis||vt(i.position)||t.length>1&&yt(t[0].toLowerCase());if(e)return e}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function kt(t,e,i){if(i[e+"AxisID"]===t)return{axis:e}}function Mt(t){const e=t.options||(t.options={});e.plugins=(0,s.v)(e.plugins,{}),e.scales=function(t,e){const i=s.a3[t.type]||{scales:{}},n=e.scales||{},o=_t(t.type,e),a=Object.create(null);return Object.keys(n).forEach(e=>{const r=n[e];if(!(0,s.i)(r))return console.error(`Invalid scale configuration for scale: ${e}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${e}`);const h=wt(e,r,function(t,e){if(e.data&&e.data.datasets){const i=e.data.datasets.filter(e=>e.xAxisID===t||e.yAxisID===t);if(i.length)return kt(t,"x",i[0])||kt(t,"y",i[0])}return{}}(e,t),s.d.scales[r.type]),l=function(t,e){return t===e?"_index_":"_value_"}(h,o),c=i.scales||{};a[e]=(0,s.ab)(Object.create(null),[{axis:h},r,c[h],c[l]])}),t.data.datasets.forEach(i=>{const o=i.type||t.type,r=i.indexAxis||_t(o,e),h=(s.a3[o]||{}).scales||{};Object.keys(h).forEach(t=>{const e=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,r),o=i[e+"AxisID"]||e;a[o]=a[o]||Object.create(null),(0,s.ab)(a[o],[{axis:e},n[o],h[t]])})}),Object.keys(a).forEach(t=>{const e=a[t];(0,s.ab)(e,[s.d.scales[e.type],s.d.scale])}),a}(t,e)}function St(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const Pt=new Map,Dt=new Set;function Ot(t,e){let i=Pt.get(t);return i||(i=e(),Pt.set(t,i),Dt.add(i)),i}const Ct=(t,e,i)=>{const n=(0,s.f)(e,i);void 0!==n&&t.add(n)};class Tt{constructor(t){this._config=function(t){return(t=t||{}).data=St(t.data),Mt(t),t}(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=St(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(),Mt(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Ot(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Ot(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Ot(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id;return Ot(`${this.type}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let s=i.get(t);return s&&!e||(s=new Map,i.set(t,s)),s}getOptionScopes(t,e,i){const{options:n,type:o}=this,a=this._cachedScopes(t,i),r=a.get(e);if(r)return r;const h=new Set;e.forEach(e=>{t&&(h.add(t),e.forEach(e=>Ct(h,t,e))),e.forEach(t=>Ct(h,n,t)),e.forEach(t=>Ct(h,s.a3[o]||{},t)),e.forEach(t=>Ct(h,s.d,t)),e.forEach(t=>Ct(h,s.a6,t))});const l=Array.from(h);return 0===l.length&&l.push(Object.create(null)),Dt.has(e)&&a.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,s.a3[e]||{},s.d.datasets[e]||{},{type:e},s.d,s.a6]}resolveNamedOptions(t,e,i,n=[""]){const o={$shared:!0},{resolver:a,subPrefixes:r}=At(this._resolverCache,t,n);let h=a;if(function(t,e){const{isScriptable:i,isIndexable:n}=(0,s.aa)(t);for(const o of e){const e=i(o),a=n(o),r=(a||e)&&t[o];if(e&&((0,s.a7)(r)||It(r))||a&&(0,s.b)(r))return!0}return!1}(a,e)){o.$shared=!1,i=(0,s.a7)(i)?i():i;const e=this.createResolver(t,i,r);h=(0,s.a8)(a,i,e)}for(const t of e)o[t]=h[t];return o}createResolver(t,e,i=[""],n){const{resolver:o}=At(this._resolverCache,t,i);return(0,s.i)(e)?(0,s.a8)(o,e,void 0,n):o}}function At(t,e,i){let n=t.get(e);n||(n=new Map,t.set(e,n));const o=i.join();let a=n.get(o);return a||(a={resolver:(0,s.a9)(e,i),subPrefixes:i.filter(t=>!t.toLowerCase().includes("hover"))},n.set(o,a)),a}const It=t=>(0,s.i)(t)&&Object.getOwnPropertyNames(t).some(e=>(0,s.a7)(t[e])),Et=["top","bottom","left","right","chartArea"];function Lt(t,e){return"top"===t||"bottom"===t||-1===Et.indexOf(t)&&"x"===e}function Ft(t,e){return function(i,s){return i[t]===s[t]?i[e]-s[e]:i[t]-s[t]}}function Rt(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),(0,s.Q)(i&&i.onComplete,[t],e)}function zt(t){const e=t.chart,i=e.options.animation;(0,s.Q)(i&&i.onProgress,[t],e)}function Bt(t){return(0,s.M)()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const jt={},Ht=t=>{const e=Bt(t);return Object.values(jt).filter(t=>t.canvas===e).pop()};function Vt(t,e,i){const s=Object.keys(t);for(const n of s){const s=+n;if(s>=e){const o=t[n];delete t[n],(i>0||s>e)&&(t[s+i]=o)}}}class Wt{static defaults=s.d;static instances=jt;static overrides=s.a3;static registry=pt;static version="4.5.0";static getChart=Ht;static register(...t){pt.add(...t),Nt()}static unregister(...t){pt.remove(...t),Nt()}constructor(t,e){const i=this.config=new Tt(e),n=Bt(t),a=Ht(n);if(a)throw new Error("Canvas is already in use. Chart with ID '"+a.id+"' must be destroyed before the canvas with ID '"+a.canvas.id+"' can be reused.");const r=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||function(t){return!(0,s.M)()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?V:it}(n)),this.platform.updateConfig(i);const h=this.platform.acquireContext(n,r.aspectRatio),l=h&&h.canvas,c=l&&l.height,d=l&&l.width;this.id=(0,s.ac)(),this.ctx=h,this.canvas=l,this.width=d,this.height=c,this._options=r,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 xt,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=(0,s.ad)(t=>this.update(t),r.resizeDelay||0),this._dataChanges=[],jt[this.id]=this,h&&l?(o.listen(this,"complete",Rt),o.listen(this,"progress",zt),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:n,_aspectRatio:o}=this;return(0,s.k)(t)?e&&o?o:n?i/n: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}get registry(){return pt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():(0,s.ae)(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return(0,s.af)(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,n=this.canvas,o=i.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(n,t,e,o),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),h=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,(0,s.ae)(this,r,!0)&&(this.notifyPlugins("resize",{size:a}),(0,s.Q)(i.onResize,[this,a],this),this.attached&&this._doResize(h)&&this.render())}ensureScalesHaveIDs(){const t=this.options.scales||{};(0,s.F)(t,(t,e)=>{t.id=e})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,n=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],s=wt(t,i),n="r"===s,o="x"===s;return{options:i,dposition:n?"chartArea":o?"bottom":"left",dtype:n?"radialLinear":o?"category":"linear"}}))),(0,s.F)(o,e=>{const o=e.options,a=o.id,r=wt(a,o),h=(0,s.v)(o.type,e.dtype);void 0!==o.position&&Lt(o.position,r)===Lt(e.dposition)||(o.position=e.dposition),n[a]=!0;let l=null;a in i&&i[a].type===h?l=i[a]:(l=new(pt.getScale(h))({id:a,type:h,ctx:this.ctx,chart:this}),i[l.id]=l),l.init(o,t)}),(0,s.F)(n,(t,e)=>{t||delete i[e]}),(0,s.F)(i,t=>{j.configure(this,t,t.options),j.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(Ft("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,n;for(this._removeUnreferencedMetasets(),i=0,n=e.length;i<n;i++){const n=e[i];let o=this.getDatasetMeta(i);const a=n.type||this.config.type;if(o.type&&o.type!==a&&(this._destroyDatasetMeta(i),o=this.getDatasetMeta(i)),o.type=a,o.indexAxis=n.indexAxis||_t(a,this.options),o.order=n.order||0,o.index=i,o.label=""+n.label,o.visible=this.isDatasetVisible(i),o.controller)o.controller.updateIndex(i),o.controller.linkScales();else{const e=pt.getController(a),{datasetElementType:n,dataElementType:r}=s.d.datasets[a];Object.assign(e,{dataElementType:pt.getElement(r),datasetElementType:n&&pt.getElement(n)}),o.controller=new e(this,i),t.push(o.controller)}}return this._updateMetasets(),t}_resetElements(){(0,s.F)(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()),n=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 a=0;for(let t=0,e=this.data.datasets.length;t<e;t++){const{controller:e}=this.getDatasetMeta(t),i=!n&&-1===o.indexOf(e);e.buildOrUpdateElements(i),a=Math.max(+e.getMaxOverflow(),a)}a=this._minPadding=i.layout.autoPadding?a:0,this._updateLayout(a),n||(0,s.F)(o,t=>{t.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Ft("z","_idx"));const{_active:r,_lastEvent:h}=this;h?this._eventHandler(h,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){(0,s.F)(this.scales,t=>{j.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(0,s.ag)(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:n}of e)Vt(t,s,"_removeElements"===i?-n:n)}_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(","))),n=i(0);for(let t=1;t<e;t++)if(!(0,s.ag)(n,i(t)))return;return Array.from(n).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;j.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],(0,s.F)(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,(0,s.a7)(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),s={meta:i,index:t,mode:e,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",s)&&(i.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(o.has(this)?this.attached&&!o.running(this)&&o.start(this):(this.draw(),Rt({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:t,height:e}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(t,e)}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 s,n;for(s=0,n=e.length;s<n;++s){const n=e[s];t&&!n.visible||i.push(n)}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={meta:t,index:t.index,cancelable:!0},n=(0,s.ah)(this,t);!1!==this.notifyPlugins("beforeDatasetDraw",i)&&(n&&(0,s.Y)(e,n),t.controller.draw(),n&&(0,s.$)(e),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return(0,s.C)(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){const n=D.modes[e];return"function"==typeof n?n(this,t,i,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let s=i.filter(t=>t&&t._dataset===e).pop();return s||(s={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(s)),s}getContext(){return this.$context||(this.$context=(0,s.j)(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){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const n=i?"show":"hide",o=this.getDatasetMeta(t),a=o.controller._resolveAnimations(void 0,n);(0,s.h)(e)?(o.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),a.update(o,{visible:i}),this.update(e=>e.datasetIndex===t?n: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(),(0,s.af)(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete jt[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,s)=>{e.addEventListener(this,i,s),t[i]=s},n=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};(0,s.F)(this.options.events,t=>i(t,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,s)=>{e.addEventListener(this,i,s),t[i]=s},s=(i,s)=>{t[i]&&(e.removeEventListener(this,i,s),delete t[i])},n=(t,e)=>{this.canvas&&this.resize(t,e)};let o;const a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",n),i("detach",o)};o=()=>{this.attached=!1,s("resize",n),this._stop(),this._resize(0,0),i("attach",a)},e.isAttached(this.canvas)?a():o()}unbindEvents(){(0,s.F)(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},(0,s.F)(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const s=i?"set":"remove";let n,o,a,r;for("dataset"===e&&(n=this.getDatasetMeta(t[0].datasetIndex),n.controller["_"+s+"DatasetHoverStyle"]()),a=0,r=t.length;a<r;++a){o=t[a];const e=o&&this.getDatasetMeta(o.datasetIndex).controller;e&&e[s+"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}});!(0,s.ai)(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return 1===this._plugins._cache.filter(e=>e.plugin.id===t).length}_updateHoverStyles(t,e,i){const s=this.options.hover,n=(t,e)=>t.filter(t=>!e.some(e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)),o=n(e,t),a=i?t:n(t,e);o.length&&this.updateHoverStyle(o,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,s))return;const n=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(n||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:n=[],options:o}=this,a=e,r=this._getActiveElements(t,n,i,a),h=(0,s.aj)(t),l=function(t,e,i,s){return i&&"mouseout"!==t.type?s?e:t:null}(t,this._lastEvent,i,h);i&&(this._lastEvent=null,(0,s.Q)(o.onHover,[t,r,this],this),h&&(0,s.Q)(o.onClick,[t,r,this],this));const c=!(0,s.ai)(r,n);return(c||e)&&(this._active=r,this._updateHoverStyles(r,n,e)),this._lastEvent=l,c}_getActiveElements(t,e,i,s){if("mouseout"===t.type)return[];if(!i)return e;const n=this.options.hover;return this.getElementsAtEventForMode(t,n.mode,n,s)}}function Nt(){return(0,s.F)(Wt.instances,t=>t._plugins.invalidate())}function $t(t,e,i=e){t.lineCap=(0,s.v)(i.borderCapStyle,e.borderCapStyle),t.setLineDash((0,s.v)(i.borderDash,e.borderDash)),t.lineDashOffset=(0,s.v)(i.borderDashOffset,e.borderDashOffset),t.lineJoin=(0,s.v)(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=(0,s.v)(i.borderWidth,e.borderWidth),t.strokeStyle=(0,s.v)(i.borderColor,e.borderColor)}function Yt(t,e,i){t.lineTo(i.x,i.y)}function Ut(t,e,i={}){const s=t.length,{start:n=0,end:o=s-1}=i,{start:a,end:r}=e,h=Math.max(n,a),l=Math.min(o,r),c=n<a&&o<a||n>r&&o>r;return{count:s,start:h,loop:e.loop,ilen:l<h&&!c?s+l-h:l-h}}function Xt(t,e,i,n){const{points:o,options:a}=e,{count:r,start:h,loop:l,ilen:c}=Ut(o,i,n),d=function(t){return t.stepped?s.at:t.tension||"monotone"===t.cubicInterpolationMode?s.au:Yt}(a);let u,f,g,{move:p=!0,reverse:x}=n||{};for(u=0;u<=c;++u)f=o[(h+(x?c-u:u))%r],f.skip||(p?(t.moveTo(f.x,f.y),p=!1):d(t,g,f,x,a.stepped),g=f);return l&&(f=o[(h+(x?c:0))%r],d(t,g,f,x,a.stepped)),!!l}function Qt(t,e,i,s){const n=e.points,{count:o,start:a,ilen:r}=Ut(n,i,s),{move:h=!0,reverse:l}=s||{};let c,d,u,f,g,p,x=0,m=0;const b=t=>(a+(l?r-t:t))%o,_=()=>{f!==g&&(t.lineTo(x,g),t.lineTo(x,f),t.lineTo(x,p))};for(h&&(d=n[b(0)],t.moveTo(d.x,d.y)),c=0;c<=r;++c){if(d=n[b(c)],d.skip)continue;const e=d.x,i=d.y,s=0|e;s===u?(i<f?f=i:i>g&&(g=i),x=(m*x+e)/++m):(_(),t.lineTo(e,i),u=s,m=0,f=g=i),p=i}_()}function qt(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i?Xt:Qt}const Kt="function"==typeof Path2D;class Gt extends st{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};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 n=i.spanGaps?this._loop:this._fullLoop;(0,s.an)(this._points,i,t,n,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=(0,s.ao)(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,n=t[e],o=this.points,a=(0,s.ap)(this,{property:e,start:n,end:n});if(!a.length)return;const r=[],h=function(t){return t.stepped?s.aq:t.tension||"monotone"===t.cubicInterpolationMode?s.ar:s.as}(i);let l,c;for(l=0,c=a.length;l<c;++l){const{start:s,end:c}=a[l],d=o[s],u=o[c];if(d===u){r.push(d);continue}const f=h(d,u,Math.abs((n-d[e])/(u[e]-d[e])),i.stepped);f[e]=t[e],r.push(f)}return 1===r.length?r[0]:r}pathSegment(t,e,i){return qt(this)(t,this,e,i)}path(t,e,i){const s=this.segments,n=qt(this);let o=this._loop;e=e||0,i=i||this.points.length-e;for(const a of s)o&=n(t,this,a,{start:e,end:e+i-1});return!!o}draw(t,e,i,s){const n=this.options||{};(this.points||[]).length&&n.borderWidth&&(t.save(),function(t,e,i,s){Kt&&!e.options.segment?function(t,e,i,s){let n=e._path;n||(n=e._path=new Path2D,e.path(n,i,s)&&n.closePath()),$t(t,e.options),t.stroke(n)}(t,e,i,s):function(t,e,i,s){const{segments:n,options:o}=e,a=qt(e);for(const r of n)$t(t,o,r.style),t.beginPath(),a(t,e,r,{start:i,end:i+s-1})&&t.closePath(),t.stroke()}(t,e,i,s)}(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function Zt(t,e,i,s){const n=t.options,{[i]:o}=t.getProps([i],s);return Math.abs(e-o)<n.radius+n.hitRadius}class Jt extends st{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(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 s=this.options,{x:n,y:o}=this.getProps(["x","y"],i);return Math.pow(t-n,2)+Math.pow(e-o,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,e){return Zt(this,t,"x",e)}inYRange(t,e){return Zt(this,t,"y",e)}getCenterPoint(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}size(t){let e=(t=t||this.options||{}).radius||0;return e=Math.max(e,e&&t.hoverRadius||0),2*(e+(e&&t.borderWidth||0))}draw(t,e){const i=this.options;this.skip||i.radius<.1||!(0,s.C)(this,e,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,(0,s.av)(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function te(t,e,i,n){if(n)return;let o=e[t],a=i[t];return"angle"===t&&(o=(0,s.al)(o),a=(0,s.al)(a)),{property:t,start:o,end:a}}function ee(t,e,i){for(;e>t;e--){const t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function ie(t,e,i,s){return t&&e?s(t[i],e[i]):t?t[i]:e?e[i]:0}function se(t,e){let i=[],n=!1;return(0,s.b)(t)?(n=!0,i=t):i=function(t,e){const{x:i=null,y:s=null}=t||{},n=e.points,o=[];return e.segments.forEach(({start:t,end:e})=>{e=ee(t,e,n);const a=n[t],r=n[e];null!==s?(o.push({x:a.x,y:s}),o.push({x:r.x,y:s})):null!==i&&(o.push({x:i,y:a.y}),o.push({x:i,y:r.y}))}),o}(t,e),i.length?new Gt({points:i,options:{tension:0},_loop:n,_fullLoop:n}):null}function ne(t){return t&&!1!==t.fill}function oe(t,e,i){let n=t[e].fill;const o=[e];let a;if(!i)return n;for(;!1!==n&&-1===o.indexOf(n);){if(!(0,s.g)(n))return n;if(a=t[n],!a)return!1;if(a.visible)return n;o.push(n),n=a.fill}return!1}function ae(t,e,i){const n=function(t){const e=t.options,i=e.fill;let n=(0,s.v)(i&&i.target,i);return void 0===n&&(n=!!e.backgroundColor),!1!==n&&null!==n&&(!0===n?"origin":n)}(t);if((0,s.i)(n))return!isNaN(n.value)&&n;let o=parseFloat(n);return(0,s.g)(o)&&Math.floor(o)===o?function(t,e,i,s){return"-"!==t&&"+"!==t||(i=e+i),!(i===e||i<0||i>=s)&&i}(n[0],e,o,i):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function re(t,e,i){const s=[];for(let n=0;n<i.length;n++){const o=i[n],{first:a,last:r,point:h}=he(o,e,"x");if(!(!h||a&&r))if(a)s.unshift(h);else if(t.push(h),!r)break}t.push(...s)}function he(t,e,i){const n=t.interpolate(e,i);if(!n)return{};const o=n[i],a=t.segments,r=t.points;let h=!1,l=!1;for(let t=0;t<a.length;t++){const e=a[t],n=r[e.start][i],c=r[e.end][i];if((0,s.ak)(o,n,c)){h=o===n,l=o===c;break}}return{first:h,last:l,point:n}}class le{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:n,y:o,radius:a}=this;return e=e||{start:0,end:s.T},t.arc(n,o,a,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:s}=this,n=t.angle;return{x:e+Math.cos(n)*s,y:i+Math.sin(n)*s,angle:n}}}function ce(t,e,i){const n=function(t){const{chart:e,fill:i,line:n}=t;if((0,s.g)(i))return function(t,e){const i=t.getDatasetMeta(e);return i&&t.isDatasetVisible(e)?i.dataset:null}(e,i);if("stack"===i)return function(t){const{scale:e,index:i,line:s}=t,n=[],o=s.segments,a=s.points,r=function(t,e){const i=[],s=t.getMatchingVisibleMetas("line");for(let t=0;t<s.length;t++){const n=s[t];if(n.index===e)break;n.hidden||i.unshift(n.dataset)}return i}(e,i);r.push(se({x:null,y:e.bottom},s));for(let t=0;t<o.length;t++){const e=o[t];for(let t=e.start;t<=e.end;t++)re(n,a[t],r)}return new Gt({points:n,options:{}})}(t);if("shape"===i)return!0;const o=function(t){return(t.scale||{}).getPointPositionForValue?function(t){const{scale:e,fill:i}=t,n=e.options,o=e.getLabels().length,a=n.reverse?e.max:e.min,r=function(t,e,i){let n;return n="start"===t?i:"end"===t?e.options.reverse?e.min:e.max:(0,s.i)(t)?t.value:e.getBaseValue(),n}(i,e,a),h=[];if(n.grid.circular){const t=e.getPointPositionForValue(0,a);return new le({x:t.x,y:t.y,radius:e.getDistanceFromCenterForValue(r)})}for(let t=0;t<o;++t)h.push(e.getPointPositionForValue(t,r));return h}(t):function(t){const{scale:e={},fill:i}=t,n=function(t,e){let i=null;return"start"===t?i=e.bottom:"end"===t?i=e.top:(0,s.i)(t)?i=e.getPixelForValue(t.value):e.getBasePixel&&(i=e.getBasePixel()),i}(i,e);if((0,s.g)(n)){const t=e.isHorizontal();return{x:t?n:null,y:t?null:n}}return null}(t)}(t);return o instanceof le?o:se(o,n)}(e),{chart:o,index:a,line:r,scale:h,axis:l}=e,c=r.options,d=c.fill,u=c.backgroundColor,{above:f=u,below:g=u}=d||{},p=o.getDatasetMeta(a),x=(0,s.ah)(o,p);n&&r.points.length&&((0,s.Y)(t,i),function(t,e){const{line:i,target:s,above:n,below:o,area:a,scale:r,clip:h}=e,l=i._loop?"angle":e.axis;t.save();let c=o;o!==n&&("x"===l?(de(t,s,a.top),fe(t,{line:i,target:s,color:n,scale:r,property:l,clip:h}),t.restore(),t.save(),de(t,s,a.bottom)):"y"===l&&(ue(t,s,a.left),fe(t,{line:i,target:s,color:o,scale:r,property:l,clip:h}),t.restore(),t.save(),ue(t,s,a.right),c=n)),fe(t,{line:i,target:s,color:c,scale:r,property:l,clip:h}),t.restore()}(t,{line:r,target:n,above:f,below:g,area:i,scale:h,axis:l,clip:x}),(0,s.$)(t))}function de(t,e,i){const{segments:s,points:n}=e;let o=!0,a=!1;t.beginPath();for(const r of s){const{start:s,end:h}=r,l=n[s],c=n[ee(s,h,n)];o?(t.moveTo(l.x,l.y),o=!1):(t.lineTo(l.x,i),t.lineTo(l.x,l.y)),a=!!e.pathSegment(t,r,{move:a}),a?t.closePath():t.lineTo(c.x,i)}t.lineTo(e.first().x,i),t.closePath(),t.clip()}function ue(t,e,i){const{segments:s,points:n}=e;let o=!0,a=!1;t.beginPath();for(const r of s){const{start:s,end:h}=r,l=n[s],c=n[ee(s,h,n)];o?(t.moveTo(l.x,l.y),o=!1):(t.lineTo(i,l.y),t.lineTo(l.x,l.y)),a=!!e.pathSegment(t,r,{move:a}),a?t.closePath():t.lineTo(i,c.y)}t.lineTo(i,e.first().y),t.closePath(),t.clip()}function fe(t,e){const{line:i,target:n,property:o,color:a,scale:r,clip:h}=e,l=function(t,e,i){const n=t.segments,o=t.points,a=e.points,r=[];for(const t of n){let{start:n,end:h}=t;h=ee(n,h,o);const l=te(i,o[n],o[h],t.loop);if(!e.segments){r.push({source:t,target:l,start:o[n],end:o[h]});continue}const c=(0,s.ap)(e,l);for(const e of c){const n=te(i,a[e.start],a[e.end],e.loop),h=(0,s.az)(t,o,n);for(const t of h)r.push({source:t,target:e,start:{[i]:ie(l,n,"start",Math.max)},end:{[i]:ie(l,n,"end",Math.min)}})}}return r}(i,n,o);for(const{source:e,target:s,start:c,end:d}of l){const{style:{backgroundColor:l=a}={}}=e,u=!0!==n;t.save(),t.fillStyle=l,ge(t,r,h,u&&te(o,c,d)),t.beginPath();const f=!!i.pathSegment(t,e);let g;if(u){f?t.closePath():pe(t,n,d,o);const e=!!n.pathSegment(t,s,{move:f,reverse:!0});g=f&&e,g||pe(t,n,c,o)}t.closePath(),t.fill(g?"evenodd":"nonzero"),t.restore()}}function ge(t,e,i,s){const n=e.chart.chartArea,{property:o,start:a,end:r}=s||{};if("x"===o||"y"===o){let e,s,h,l;"x"===o?(e=a,s=n.top,h=r,l=n.bottom):(e=n.left,s=a,h=n.right,l=r),t.beginPath(),i&&(e=Math.max(e,i.left),h=Math.min(h,i.right),s=Math.max(s,i.top),l=Math.min(l,i.bottom)),t.rect(e,s,h-e,l-s),t.clip()}}function pe(t,e,i,s){const n=e.interpolate(i,s);n&&t.lineTo(n.x,n.y)}var xe={id:"filler",afterDatasetsUpdate(t,e,i){const s=(t.data.datasets||[]).length,n=[];let o,a,r,h;for(a=0;a<s;++a)o=t.getDatasetMeta(a),r=o.dataset,h=null,r&&r.options&&r instanceof Gt&&(h={visible:t.isDatasetVisible(a),index:a,fill:ae(r,a,s),chart:t,axis:o.controller.options.indexAxis,scale:o.vScale,line:r}),o.$filler=h,n.push(h);for(a=0;a<s;++a)h=n[a],h&&!1!==h.fill&&(h.fill=oe(n,a,i.propagate))},beforeDraw(t,e,i){const s="beforeDraw"===i.drawTime,n=t.getSortedVisibleDatasetMetas(),o=t.chartArea;for(let e=n.length-1;e>=0;--e){const i=n[e].$filler;i&&(i.line.updateControlPoints(o,i.axis),s&&i.fill&&ce(t.ctx,i,o))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;const s=t.getSortedVisibleDatasetMetas();for(let e=s.length-1;e>=0;--e){const i=s[e].$filler;ne(i)&&ce(t.ctx,i,t.chartArea)}},beforeDatasetDraw(t,e,i){const s=e.meta.$filler;ne(s)&&"beforeDatasetDraw"===i.drawTime&&ce(t.ctx,s,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};class me 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 n=(0,s.b)(i.text)?i.text.length:1;this._padding=(0,s.E)(i.padding);const o=n*(0,s.a0)(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:n,right:o,options:a}=this,r=a.align;let h,l,c,d=0;return this.isHorizontal()?(l=(0,s.a2)(r,i,o),c=e+t,h=o-i):("left"===a.position?(l=i+t,c=(0,s.a2)(r,n,e),d=-.5*s.P):(l=o-t,c=(0,s.a2)(r,e,n),d=.5*s.P),h=n-e),{titleX:l,titleY:c,maxWidth:h,rotation:d}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=(0,s.a0)(e.font),n=i.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:r,rotation:h}=this._drawArgs(n);(0,s.Z)(t,e.text,0,0,i,{color:e.color,maxWidth:r,rotation:h,textAlign:(0,s.a1)(e.align),textBaseline:"middle",translation:[o,a]})}}var be={id:"title",_element:me,start(t,e,i){!function(t,e){const i=new me({ctx:t.ctx,options:e,chart:t});j.configure(t,i,e),j.addBox(t,i),t.titleBlock=i}(t,i)},stop(t){const e=t.titleBlock;j.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){const s=t.titleBlock;j.configure(t,s,i),s.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 _e={average(t){if(!t.length)return!1;let e,i,s=new Set,n=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();s.add(t.x),n+=t.y,++o}}return 0!==o&&0!==s.size&&{x:[...s].reduce((t,e)=>t+e)/s.size,y:n/o}},nearest(t,e){if(!t.length)return!1;let i,n,o,a=e.x,r=e.y,h=Number.POSITIVE_INFINITY;for(i=0,n=t.length;i<n;++i){const n=t[i].element;if(n&&n.hasValue()){const t=n.getCenterPoint(),i=(0,s.aF)(e,t);i<h&&(h=i,o=n)}}if(o){const t=o.tooltipPosition();a=t.x,r=t.y}return{x:a,y:r}}};function ye(t,e){return e&&((0,s.b)(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function ve(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function we(t,e){const{element:i,datasetIndex:s,index:n}=e,o=t.getDatasetMeta(s).controller,{label:a,value:r}=o.getLabelAndValue(n);return{chart:t,label:a,parsed:o.getParsed(n),raw:t.data.datasets[s].data[n],formattedValue:r,dataset:o.getDataset(),dataIndex:n,datasetIndex:s,element:i}}function ke(t,e){const i=t.chart.ctx,{body:n,footer:o,title:a}=t,{boxWidth:r,boxHeight:h}=e,l=(0,s.a0)(e.bodyFont),c=(0,s.a0)(e.titleFont),d=(0,s.a0)(e.footerFont),u=a.length,f=o.length,g=n.length,p=(0,s.E)(e.padding);let x=p.height,m=0,b=n.reduce((t,e)=>t+e.before.length+e.lines.length+e.after.length,0);b+=t.beforeBody.length+t.afterBody.length,u&&(x+=u*c.lineHeight+(u-1)*e.titleSpacing+e.titleMarginBottom),b&&(x+=g*(e.displayColors?Math.max(h,l.lineHeight):l.lineHeight)+(b-g)*l.lineHeight+(b-1)*e.bodySpacing),f&&(x+=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,(0,s.F)(t.title,y),i.font=l.string,(0,s.F)(t.beforeBody.concat(t.afterBody),y),_=e.displayColors?r+2+e.boxPadding:0,(0,s.F)(n,t=>{(0,s.F)(t.before,y),(0,s.F)(t.lines,y),(0,s.F)(t.after,y)}),_=0,i.font=d.string,(0,s.F)(t.footer,y),i.restore(),m+=p.width,{width:m,height:x}}function Me(t,e,i,s){const{x:n,width:o}=i,{width:a,chartArea:{left:r,right:h}}=t;let l="center";return"center"===s?l=n<=(r+h)/2?"left":"right":n<=o/2?l="left":n>=a-o/2&&(l="right"),function(t,e,i,s){const{x:n,width:o}=s,a=i.caretSize+i.caretPadding;return"left"===t&&n+o+a>e.width||"right"===t&&n-o-a<0||void 0}(l,t,e,i)&&(l="center"),l}function Se(t,e,i){const s=i.yAlign||e.yAlign||function(t,e){const{y:i,height:s}=e;return i<s/2?"top":i>t.height-s/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||Me(t,e,i,s),yAlign:s}}function Pe(t,e,i,n){const{caretSize:o,caretPadding:a,cornerRadius:r}=t,{xAlign:h,yAlign:l}=i,c=o+a,{topLeft:d,topRight:u,bottomLeft:f,bottomRight:g}=(0,s.ay)(r);let p=function(t,e){let{x:i,width:s}=t;return"right"===e?i-=s:"center"===e&&(i-=s/2),i}(e,h);const x=function(t,e,i){let{y:s,height:n}=t;return"top"===e?s+=i:s-="bottom"===e?n+i:n/2,s}(e,l,c);return"center"===l?"left"===h?p+=c:"right"===h&&(p-=c):"left"===h?p-=Math.max(d,f)+o:"right"===h&&(p+=Math.max(u,g)+o),{x:(0,s.S)(p,0,n.width-e.width),y:(0,s.S)(x,0,n.height-e.height)}}function De(t,e,i){const n=(0,s.E)(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-n.right:t.x+n.left}function Oe(t){return ye([],ve(t))}function Ce(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}const Te={beforeTitle:s.aG,title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,s=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(s>0&&e.dataIndex<s)return i[e.dataIndex]}return""},afterTitle:s.aG,beforeBody:s.aG,beforeLabel:s.aG,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(0,s.k)(i)||(e+=i),e},labelColor(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:s.aG,afterBody:s.aG,beforeFooter:s.aG,footer:s.aG,afterFooter:s.aG};function Ae(t,e,i,s){const n=t[e].call(i,s);return void 0===n?Te[e].call(i,s):n}class Ie extends st{static positioners=_e;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,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()),s=i.enabled&&e.options.animation&&i.animations,n=new l(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(n)),n}getContext(){return this.$context||(this.$context=(t=this.chart.getContext(),e=this._tooltipItems,(0,s.j)(t,{tooltip:this,tooltipItems:e,type:"tooltip"})));var t,e}getTitle(t,e){const{callbacks:i}=e,s=Ae(i,"beforeTitle",this,t),n=Ae(i,"title",this,t),o=Ae(i,"afterTitle",this,t);let a=[];return a=ye(a,ve(s)),a=ye(a,ve(n)),a=ye(a,ve(o)),a}getBeforeBody(t,e){return Oe(Ae(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,n=[];return(0,s.F)(t,t=>{const e={before:[],lines:[],after:[]},s=Ce(i,t);ye(e.before,ve(Ae(s,"beforeLabel",this,t))),ye(e.lines,Ae(s,"label",this,t)),ye(e.after,ve(Ae(s,"afterLabel",this,t))),n.push(e)}),n}getAfterBody(t,e){return Oe(Ae(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,s=Ae(i,"beforeFooter",this,t),n=Ae(i,"footer",this,t),o=Ae(i,"afterFooter",this,t);let a=[];return a=ye(a,ve(s)),a=ye(a,ve(n)),a=ye(a,ve(o)),a}_createItems(t){const e=this._active,i=this.chart.data,n=[],o=[],a=[];let r,h,l=[];for(r=0,h=e.length;r<h;++r)l.push(we(this.chart,e[r]));return t.filter&&(l=l.filter((e,s,n)=>t.filter(e,s,n,i))),t.itemSort&&(l=l.sort((e,s)=>t.itemSort(e,s,i))),(0,s.F)(l,e=>{const i=Ce(t.callbacks,e);n.push(Ae(i,"labelColor",this,e)),o.push(Ae(i,"labelPointStyle",this,e)),a.push(Ae(i,"labelTextColor",this,e))}),this.labelColors=n,this.labelPointStyles=o,this.labelTextColors=a,this.dataPoints=l,l}update(t,e){const i=this.options.setContext(this.getContext()),s=this._active;let n,o=[];if(s.length){const t=_e[i.position].call(this,s,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=ke(this,i),a=Object.assign({},t,e),r=Se(this.chart,i,a),h=Pe(i,a,r,this.chart);this.xAlign=r.xAlign,this.yAlign=r.yAlign,n={opacity:1,x:h.x,y:h.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(n={opacity:0});this._tooltipItems=o,this.$context=void 0,n&&this._resolveAnimations().update(this,n),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){const n=this.getCaretPosition(t,i,s);e.lineTo(n.x1,n.y1),e.lineTo(n.x2,n.y2),e.lineTo(n.x3,n.y3)}getCaretPosition(t,e,i){const{xAlign:n,yAlign:o}=this,{caretSize:a,cornerRadius:r}=i,{topLeft:h,topRight:l,bottomLeft:c,bottomRight:d}=(0,s.ay)(r),{x:u,y:f}=t,{width:g,height:p}=e;let x,m,b,_,y,v;return"center"===o?(y=f+p/2,"left"===n?(x=u,m=x-a,_=y+a,v=y-a):(x=u+g,m=x+a,_=y-a,v=y+a),b=x):(m="left"===n?u+Math.max(h,c)+a:"right"===n?u+g-Math.max(l,d)-a:this.caretX,"top"===o?(_=f,y=_-a,x=m-a,b=m+a):(_=f+p,y=_+a,x=m+a,b=m-a),v=_),{x1:x,x2:m,x3:b,y1:_,y2:y,y3:v}}drawTitle(t,e,i){const n=this.title,o=n.length;let a,r,h;if(o){const l=(0,s.aA)(i.rtl,this.x,this.width);for(t.x=De(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",a=(0,s.a0)(i.titleFont),r=i.titleSpacing,e.fillStyle=i.titleColor,e.font=a.string,h=0;h<o;++h)e.fillText(n[h],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+r,h+1===o&&(t.y+=i.titleMarginBottom-r)}}_drawColorBox(t,e,i,n,o){const a=this.labelColors[i],r=this.labelPointStyles[i],{boxHeight:h,boxWidth:l}=o,c=(0,s.a0)(o.bodyFont),d=De(this,"left",o),u=n.x(d),f=h<c.lineHeight?(c.lineHeight-h)/2:0,g=e.y+f;if(o.usePointStyle){const e={radius:Math.min(l,h)/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:1},i=n.leftForLtr(u,l)+l/2,c=g+h/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,(0,s.av)(t,e,i,c),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,(0,s.av)(t,e,i,c)}else{t.lineWidth=(0,s.i)(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;const e=n.leftForLtr(u,l),i=n.leftForLtr(n.xPlus(u,1),l-2),r=(0,s.ay)(a.borderRadius);Object.values(r).some(t=>0!==t)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,(0,s.aw)(t,{x:e,y:g,w:l,h,radius:r}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),(0,s.aw)(t,{x:i,y:g+1,w:l-2,h:h-2,radius:r}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(e,g,l,h),t.strokeRect(e,g,l,h),t.fillStyle=a.backgroundColor,t.fillRect(i,g+1,l-2,h-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:n}=this,{bodySpacing:o,bodyAlign:a,displayColors:r,boxHeight:h,boxWidth:l,boxPadding:c}=i,d=(0,s.a0)(i.bodyFont);let u=d.lineHeight,f=0;const g=(0,s.aA)(i.rtl,this.x,this.width),p=function(i){e.fillText(i,g.x(t.x+f),t.y+u/2),t.y+=u+o},x=g.textAlign(a);let m,b,_,y,v,w,k;for(e.textAlign=a,e.textBaseline="middle",e.font=d.string,t.x=De(this,x,i),e.fillStyle=i.bodyColor,(0,s.F)(this.beforeBody,p),f=r&&"right"!==x?"center"===a?l/2+c:l+2+c:0,y=0,w=n.length;y<w;++y){for(m=n[y],b=this.labelTextColors[y],e.fillStyle=b,(0,s.F)(m.before,p),_=m.lines,r&&_.length&&(this._drawColorBox(e,t,y,g,i),u=Math.max(d.lineHeight,h)),v=0,k=_.length;v<k;++v)p(_[v]),u=d.lineHeight;(0,s.F)(m.after,p)}f=0,u=d.lineHeight,(0,s.F)(this.afterBody,p),t.y-=o}drawFooter(t,e,i){const n=this.footer,o=n.length;let a,r;if(o){const h=(0,s.aA)(i.rtl,this.x,this.width);for(t.x=De(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=h.textAlign(i.footerAlign),e.textBaseline="middle",a=(0,s.a0)(i.footerFont),e.fillStyle=i.footerColor,e.font=a.string,r=0;r<o;++r)e.fillText(n[r],h.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+i.footerSpacing}}drawBackground(t,e,i,n){const{xAlign:o,yAlign:a}=this,{x:r,y:h}=t,{width:l,height:c}=i,{topLeft:d,topRight:u,bottomLeft:f,bottomRight:g}=(0,s.ay)(n.cornerRadius);e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.beginPath(),e.moveTo(r+d,h),"top"===a&&this.drawCaret(t,e,i,n),e.lineTo(r+l-u,h),e.quadraticCurveTo(r+l,h,r+l,h+u),"center"===a&&"right"===o&&this.drawCaret(t,e,i,n),e.lineTo(r+l,h+c-g),e.quadraticCurveTo(r+l,h+c,r+l-g,h+c),"bottom"===a&&this.drawCaret(t,e,i,n),e.lineTo(r+f,h+c),e.quadraticCurveTo(r,h+c,r,h+c-f),"center"===a&&"left"===o&&this.drawCaret(t,e,i,n),e.lineTo(r,h+d),e.quadraticCurveTo(r,h,r+d,h),e.closePath(),e.fill(),n.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,s=i&&i.x,n=i&&i.y;if(s||n){const i=_e[t.position].call(this,this._active,this._eventPosition);if(!i)return;const o=this._size=ke(this,t),a=Object.assign({},i,this._size),r=Se(e,t,a),h=Pe(t,a,r,e);s._to===h.x&&n._to===h.y||(this.xAlign=r.xAlign,this.yAlign=r.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 n={width:this.width,height:this.height},o={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const a=(0,s.E)(e.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&r&&(t.save(),t.globalAlpha=i,this.drawBackground(o,t,n,e),(0,s.aB)(t,e.textDirection),o.y+=a.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),(0,s.aD)(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,n=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=!(0,s.ai)(i,n),a=this._positionChanged(n,e);(o||a)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,o=this._active||[],a=this._getActiveElements(t,o,e,i),r=this._positionChanged(a,t),h=e||!(0,s.ai)(a,o)||r;return h&&(this._active=a,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),h}_getActiveElements(t,e,i,s){const n=this.options;if("mouseout"===t.type)return[];if(!s)return e.filter(t=>this.chart.data.datasets[t.datasetIndex]&&void 0!==this.chart.getDatasetMeta(t.datasetIndex).controller.getParsed(t.index));const o=this.chart.getElementsAtEventForMode(t,n.mode,n,i);return n.reverse&&o.reverse(),o}_positionChanged(t,e){const{caretX:i,caretY:s,options:n}=this,o=_e[n.position].call(this,t,e);return!1!==o&&(i!==o.x||s!==o.y)}}var Ee={id:"tooltip",_element:Ie,positioners:_e,afterInit(t,e,i){i&&(t.tooltip=new Ie({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,cancelable:!0}))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:Te},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"]};function Le(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}class Fe extends ut{static id="category";static defaults={ticks:{callback:Le}};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:s}of e)t[i]===s&&t.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){if((0,s.k)(t))return null;const i=this.getLabels();return((t,e)=>null===t?null:(0,s.S)(Math.round(t),0,e))(e=isFinite(e)&&i[e]===t?e:function(t,e,i,s){const n=t.indexOf(e);return-1===n?((t,e,i,s)=>("string"==typeof e?(i=t.push(e)-1,s.unshift({index:i,label:e})):isNaN(e)&&(i=null),i))(t,e,i,s):n!==t.lastIndexOf(e)?i:n}(i,t,(0,s.v)(e,t),this._addedLabels),i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,s=[];let n=this.getLabels();n=0===t&&e===n.length-1?n:n.slice(t,e+1),this._valueRange=Math.max(n.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let i=t;i<=e;i++)s.push({value:i});return s}getLabelForValue(t){return Le.call(this,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 Re(t,e,{horizontal:i,minRotation:n}){const o=(0,s.t)(n),a=(i?Math.sin(o):Math.cos(o))||.001,r=.75*e*(""+t).length;return Math.min(e/a,r)}class ze extends ut{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(0,s.k)(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:n,max:o}=this;const a=t=>n=e?n:t,r=t=>o=i?o:t;if(t){const t=(0,s.s)(n),e=(0,s.s)(o);t<0&&e<0?r(0):t>0&&e>0&&a(0)}if(n===o){let e=0===o?1:Math.abs(.05*o);r(o+e),t||a(n-e)}this.min=n,this.max=o}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:s}=t;return s?(e=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} 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 n=function(t,e){const i=[],{bounds:n,step:o,min:a,max:r,precision:h,count:l,maxTicks:c,maxDigits:d,includeBounds:u}=t,f=o||1,g=c-1,{min:p,max:x}=e,m=!(0,s.k)(a),b=!(0,s.k)(r),_=!(0,s.k)(l),y=(x-p)/(d+1);let v,w,k,M,S=(0,s.aI)((x-p)/g/f)*f;if(S<1e-14&&!m&&!b)return[{value:p},{value:x}];M=Math.ceil(x/S)-Math.floor(p/S),M>g&&(S=(0,s.aI)(M*S/g/f)*f),(0,s.k)(h)||(v=Math.pow(10,h),S=Math.ceil(S*v)/v),"ticks"===n?(w=Math.floor(p/S)*S,k=Math.ceil(x/S)*S):(w=p,k=x),m&&b&&o&&(0,s.aJ)((r-a)/o,S/1e3)?(M=Math.round(Math.min((r-a)/S,c)),S=(r-a)/M,w=a,k=r):_?(w=m?a:w,k=b?r:k,M=l-1,S=(k-w)/M):(M=(k-w)/S,M=(0,s.aK)(M,Math.round(M),S/1e3)?Math.round(M):Math.ceil(M));const P=Math.max((0,s.aL)(S),(0,s.aL)(w));v=Math.pow(10,(0,s.k)(h)?P:h),w=Math.round(w*v)/v,k=Math.round(k*v)/v;let D=0;for(m&&(u&&w!==a?(i.push({value:a}),w<a&&D++,(0,s.aK)(Math.round((w+D*S)*v)/v,a,Re(a,y,t))&&D++):w<a&&D++);D<M;++D){const t=Math.round((w+D*S)*v)/v;if(b&&t>r)break;i.push({value:t})}return b&&u&&k!==r?i.length&&(0,s.aK)(i[i.length-1].value,r,Re(r,y,t))?i[i.length-1].value=r:i.push({value:r}):b&&k!==r||i.push({value:k}),i}({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},this._range||this);return"ticks"===t.bounds&&(0,s.aH)(n,this,"value"),t.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-e)/Math.max(t.length-1,1)/2;e-=s,i+=s}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return(0,s.o)(t,this.chart.options.locale,this.options.ticks.format)}}class Be extends ze{static id="linear";static defaults={ticks:{callback:s.aM.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=(0,s.g)(t)?t:0,this.max=(0,s.g)(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=(0,s.t)(this.options.ticks.minRotation),n=(t?Math.sin(i):Math.cos(i))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/n))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}s.aM.formatters.logarithmic,s.aM.formatters.numeric},99284:(t,e,i)=>{i.d(e,{$:()=>Ut,A:()=>ot,B:()=>nt,C:()=>$t,D:()=>q,E:()=>ae,F:()=>p,G:()=>He,H:()=>F,I:()=>Ie,J:()=>Ne,K:()=>We,L:()=>ut,M:()=>Ae,N:()=>W,O:()=>c,P:()=>T,Q:()=>g,R:()=>le,S:()=>tt,T:()=>A,U:()=>X,V:()=>Bt,W:()=>et,X:()=>Ht,Y:()=>Yt,Z:()=>Gt,_:()=>ct,a:()=>he,a0:()=>re,a1:()=>gt,a2:()=>pt,a3:()=>It,a4:()=>y,a5:()=>S,a6:()=>Et,a7:()=>D,a8:()=>ue,a9:()=>de,aA:()=>qe,aB:()=>Ke,aC:()=>xt,aD:()=>Ge,aE:()=>Nt,aF:()=>K,aG:()=>n,aH:()=>Y,aI:()=>V,aJ:()=>$,aK:()=>H,aL:()=>Q,aM:()=>At,aN:()=>B,aO:()=>jt,aP:()=>at,aQ:()=>st,aa:()=>fe,ab:()=>v,ac:()=>o,ad:()=>ft,ae:()=>Ve,af:()=>Vt,ag:()=>O,ah:()=>ri,ai:()=>x,aj:()=>C,ak:()=>it,al:()=>Z,am:()=>se,an:()=>Te,ao:()=>ii,ap:()=>ei,aq:()=>Ye,ar:()=>Ue,as:()=>$e,at:()=>Xt,au:()=>Qt,av:()=>Wt,aw:()=>Zt,ax:()=>ne,ay:()=>oe,az:()=>ti,b:()=>r,c:()=>Mt,d:()=>zt,e:()=>wt,f:()=>M,g:()=>l,h:()=>P,i:()=>h,j:()=>ce,k:()=>a,l:()=>ht,m:()=>u,n:()=>f,o:()=>Ct,p:()=>J,q:()=>mt,r:()=>dt,s:()=>j,t:()=>U,u:()=>lt,v:()=>d,w:()=>bt,x:()=>N,y:()=>Me,z:()=>Be});var s=i(44594);function n(){}const o=(()=>{let t=0;return()=>t++})();function a(t){return null==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 h(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}function l(t){return("number"==typeof t||t instanceof Number)&&isFinite(+t)}function c(t,e){return l(t)?t:e}function d(t,e){return void 0===t?e:t}const u=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100:+t/e,f=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function g(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function p(t,e,i,s){let n,o,a;if(r(t))if(o=t.length,s)for(n=o-1;n>=0;n--)e.call(i,t[n],n);else for(n=0;n<o;n++)e.call(i,t[n],n);else if(h(t))for(a=Object.keys(t),o=a.length,n=0;n<o;n++)e.call(i,t[a[n]],a[n])}function x(t,e){let i,s,n,o;if(!t||!e||t.length!==e.length)return!1;for(i=0,s=t.length;i<s;++i)if(n=t[i],o=e[i],n.datasetIndex!==o.datasetIndex||n.index!==o.index)return!1;return!0}function m(t){if(r(t))return t.map(m);if(h(t)){const e=Object.create(null),i=Object.keys(t),s=i.length;let n=0;for(;n<s;++n)e[i[n]]=m(t[i[n]]);return e}return t}function b(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}function _(t,e,i,s){if(!b(t))return;const n=e[t],o=i[t];h(n)&&h(o)?y(n,o,s):e[t]=m(o)}function y(t,e,i){const s=r(e)?e:[e],n=s.length;if(!h(t))return t;const o=(i=i||{}).merger||_;let a;for(let e=0;e<n;++e){if(a=s[e],!h(a))continue;const n=Object.keys(a);for(let e=0,s=n.length;e<s;++e)o(n[e],t,a,i)}return t}function v(t,e){return y(t,e,{merger:w})}function w(t,e,i){if(!b(t))return;const s=e[t],n=i[t];h(s)&&h(n)?v(s,n):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=m(n))}const k={"":t=>t,x:t=>t.x,y:t=>t.y};function M(t,e){const i=k[e]||(k[e]=function(t){const e=function(t){const e=t.split("."),i=[];let s="";for(const t of e)s+=t,s.endsWith("\\")?s=s.slice(0,-1)+".":(i.push(s),s="");return i}(t);return t=>{for(const i of e){if(""===i)break;t=t&&t[i]}return t}}(e));return i(t)}function S(t){return t.charAt(0).toUpperCase()+t.slice(1)}const P=t=>void 0!==t,D=t=>"function"==typeof t,O=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0};function C(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}const T=Math.PI,A=2*T,I=A+T,E=Number.POSITIVE_INFINITY,L=T/180,F=T/2,R=T/4,z=2*T/3,B=Math.log10,j=Math.sign;function H(t,e,i){return Math.abs(t-e)<i}function V(t){const e=Math.round(t);t=H(t,e,t/1e3)?e:t;const i=Math.pow(10,Math.floor(B(t))),s=t/i;return(s<=1?1:s<=2?2:s<=5?5:10)*i}function W(t){const e=[],i=Math.sqrt(t);let s;for(s=1;s<i;s++)t%s===0&&(e.push(s),e.push(t/s));return i===(0|i)&&e.push(i),e.sort((t,e)=>t-e).pop(),e}function N(t){return!function(t){return"symbol"==typeof t||"object"==typeof t&&null!==t&&!(Symbol.toPrimitive in t||"toString"in t||"valueOf"in t)}(t)&&!isNaN(parseFloat(t))&&isFinite(t)}function $(t,e){const i=Math.round(t);return i-e<=t&&i+e>=t}function Y(t,e,i){let s,n,o;for(s=0,n=t.length;s<n;s++)o=t[s][i],isNaN(o)||(e.min=Math.min(e.min,o),e.max=Math.max(e.max,o))}function U(t){return t*(T/180)}function X(t){return t*(180/T)}function Q(t){if(!l(t))return;let e=1,i=0;for(;Math.round(t*e)/e!==t;)e*=10,i++;return i}function q(t,e){const i=e.x-t.x,s=e.y-t.y,n=Math.sqrt(i*i+s*s);let o=Math.atan2(s,i);return o<-.5*T&&(o+=A),{angle:o,distance:n}}function K(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function G(t,e){return(t-e+I)%A-T}function Z(t){return(t%A+A)%A}function J(t,e,i,s){const n=Z(t),o=Z(e),a=Z(i),r=Z(o-n),h=Z(a-n),l=Z(n-o),c=Z(n-a);return n===o||n===a||s&&o===a||r>h&&l<c}function tt(t,e,i){return Math.max(e,Math.min(i,t))}function et(t){return tt(t,-32768,32767)}function it(t,e,i,s=1e-6){return t>=Math.min(e,i)-s&&t<=Math.max(e,i)+s}function st(t,e,i){i=i||(i=>t[i]<e);let s,n=t.length-1,o=0;for(;n-o>1;)s=o+n>>1,i(s)?o=s:n=s;return{lo:o,hi:n}}const nt=(t,e,i,s)=>st(t,i,s?s=>{const n=t[s][e];return n<i||n===i&&t[s+1][e]===i}:s=>t[s][e]<i),ot=(t,e,i)=>st(t,i,s=>t[s][e]>=i);function at(t,e,i){let s=0,n=t.length;for(;s<n&&t[s]<e;)s++;for(;n>s&&t[n-1]>i;)n--;return s>0||n<t.length?t.slice(s,n):t}const rt=["push","pop","shift","splice","unshift"];function ht(t,e){t._chartjs?t._chartjs.listeners.push(e):(Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),rt.forEach(e=>{const i="_onData"+S(e),s=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value(...e){const n=s.apply(this,e);return t._chartjs.listeners.forEach(t=>{"function"==typeof t[i]&&t[i](...e)}),n}})}))}function lt(t,e){const i=t._chartjs;if(!i)return;const s=i.listeners,n=s.indexOf(e);-1!==n&&s.splice(n,1),s.length>0||(rt.forEach(e=>{delete t[e]}),delete t._chartjs)}function ct(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const dt="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function ut(t,e){let i=[],s=!1;return function(...n){i=n,s||(s=!0,dt.call(window,()=>{s=!1,t.apply(e,i)}))}}function ft(t,e){let i;return function(...s){return e?(clearTimeout(i),i=setTimeout(t,e,s)):t.apply(this,s),e}}const gt=t=>"start"===t?"left":"end"===t?"right":"center",pt=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2,xt=(t,e,i,s)=>t===(s?"left":"right")?i:"center"===t?(e+i)/2:e;function mt(t,e,i){const s=e.length;let n=0,o=s;if(t._sorted){const{iScale:r,vScale:h,_parsed:l}=t,c=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null,d=r.axis,{min:u,max:f,minDefined:g,maxDefined:p}=r.getUserBounds();if(g){if(n=Math.min(nt(l,d,u).lo,i?s:nt(e,d,r.getPixelForValue(u)).lo),c){const t=l.slice(0,n+1).reverse().findIndex(t=>!a(t[h.axis]));n-=Math.max(0,t)}n=tt(n,0,s-1)}if(p){let t=Math.max(nt(l,r.axis,f,!0).hi+1,i?0:nt(e,d,r.getPixelForValue(f),!0).hi+1);if(c){const e=l.slice(t-1).findIndex(t=>!a(t[h.axis]));t+=Math.max(0,e)}o=tt(t,n,s)-n}else o=s-n}return{start:n,count:o}}function bt(t){const{xScale:e,yScale:i,_scaleRanges:s}=t,n={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!s)return t._scaleRanges=n,!0;const o=s.xmin!==e.min||s.xmax!==e.max||s.ymin!==i.min||s.ymax!==i.max;return Object.assign(s,n),o}const _t=t=>0===t||1===t,yt=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*A/i),vt=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*A/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*F),easeOutSine:t=>Math.sin(t*F),easeInOutSine:t=>-.5*(Math.cos(T*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=>_t(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=>_t(t)?t:yt(t,.075,.3),easeOutElastic:t=>_t(t)?t:vt(t,.075,.3),easeInOutElastic(t){const e=.1125;return _t(t)?t:t<.5?.5*yt(2*t,e,.45):.5+.5*vt(2*t-1,e,.45)},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};function kt(t){if(t&&"object"==typeof t){const e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function Mt(t){return kt(t)?t:new s.Q1(t)}function St(t){return kt(t)?t:new s.Q1(t).saturate(.5).darken(.1).hexString()}const Pt=["x","y","borderWidth","radius","tension"],Dt=["color","borderColor","backgroundColor"],Ot=new Map;function Ct(t,e,i){return function(t,e){e=e||{};const i=t+JSON.stringify(e);let s=Ot.get(i);return s||(s=new Intl.NumberFormat(t,e),Ot.set(i,s)),s}(e,i).format(t)}const Tt={values:t=>r(t)?t:""+t,numeric(t,e,i){if(0===t)return"0";const s=this.chart.options.locale;let n,o=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)&&(n="scientific"),o=function(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}(t,i)}const a=B(Math.abs(o)),r=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),h={notation:n,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(h,this.options.ticks.format),Ct(t,s,h)},logarithmic(t,e,i){if(0===t)return"0";const s=i[e].significand||t/Math.pow(10,Math.floor(B(t)));return[1,2,3,5,10,15].includes(s)||e>.8*i.length?Tt.numeric.call(this,t,e,i):""}};var At={formatters:Tt};const It=Object.create(null),Et=Object.create(null);function Lt(t,e){if(!e)return t;const i=e.split(".");for(let e=0,s=i.length;e<s;++e){const s=i[e];t=t[s]||(t[s]=Object.create(null))}return t}function Ft(t,e,i){return"string"==typeof e?y(Lt(t,e),i):y(Lt(t,""),e)}class Rt{constructor(t,e){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)=>St(e.backgroundColor),this.hoverBorderColor=(t,e)=>St(e.borderColor),this.hoverColor=(t,e)=>St(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),this.apply(e)}set(t,e){return Ft(this,t,e)}get(t){return Lt(this,t)}describe(t,e){return Ft(Et,t,e)}override(t,e){return Ft(It,t,e)}route(t,e,i,s){const n=Lt(this,t),o=Lt(this,i),a="_"+e;Object.defineProperties(n,{[a]:{value:n[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[a],e=o[s];return h(t)?Object.assign({},e,t):d(t,e)},set(t){this[a]=t}}})}apply(t){t.forEach(t=>t(this))}}var zt=new Rt({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[function(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),t.set("animations",{colors:{type:"color",properties:Dt},numbers:{type:"number",properties:Pt}}),t.describe("animations",{_fallback:"animation"}),t.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}}}})},function(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})},function(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width: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}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t&&"dash"!==t}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t})}]);function Bt(t,e,i,s,n){let o=e[n];return o||(o=e[n]=t.measureText(n).width,i.push(n)),o>s&&(s=o),s}function jt(t,e,i,s){let n=(s=s||{}).data=s.data||{},o=s.garbageCollect=s.garbageCollect||[];s.font!==e&&(n=s.data={},o=s.garbageCollect=[],s.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],null==u||r(u)){if(r(u))for(c=0,d=u.length;c<d;c++)f=u[c],null==f||r(f)||(a=Bt(t,n,o,a,f))}else a=Bt(t,n,o,a,u);t.restore();const g=o.length/2;if(g>i.length){for(l=0;l<g;l++)delete n[o[l]];o.splice(0,g)}return a}function Ht(t,e,i){const s=t.currentDevicePixelRatio,n=0!==i?Math.max(i/2,.5):0;return Math.round((e-n)*s)/s+n}function Vt(t,e){(e||t)&&((e=e||t.getContext("2d")).save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore())}function Wt(t,e,i,s){Nt(t,e,i,s,null)}function Nt(t,e,i,s,n){let o,a,r,h,l,c,d,u;const f=e.pointStyle,g=e.rotation,p=e.radius;let x=(g||0)*L;if(f&&"object"==typeof f&&(o=f.toString(),"[object HTMLImageElement]"===o||"[object HTMLCanvasElement]"===o))return t.save(),t.translate(i,s),t.rotate(x),t.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),void t.restore();if(!(isNaN(p)||p<=0)){switch(t.beginPath(),f){default:n?t.ellipse(i,s,n/2,p,0,0,A):t.arc(i,s,p,0,A),t.closePath();break;case"triangle":c=n?n/2:p,t.moveTo(i+Math.sin(x)*c,s-Math.cos(x)*p),x+=z,t.lineTo(i+Math.sin(x)*c,s-Math.cos(x)*p),x+=z,t.lineTo(i+Math.sin(x)*c,s-Math.cos(x)*p),t.closePath();break;case"rectRounded":l=.516*p,h=p-l,a=Math.cos(x+R)*h,d=Math.cos(x+R)*(n?n/2-l:h),r=Math.sin(x+R)*h,u=Math.sin(x+R)*(n?n/2-l:h),t.arc(i-d,s-r,l,x-T,x-F),t.arc(i+u,s-a,l,x-F,x),t.arc(i+d,s+r,l,x,x+F),t.arc(i-u,s+a,l,x+F,x+T),t.closePath();break;case"rect":if(!g){h=Math.SQRT1_2*p,c=n?n/2:h,t.rect(i-c,s-h,2*c,2*h);break}x+=R;case"rectRot":d=Math.cos(x)*(n?n/2:p),a=Math.cos(x)*p,r=Math.sin(x)*p,u=Math.sin(x)*(n?n/2:p),t.moveTo(i-d,s-r),t.lineTo(i+u,s-a),t.lineTo(i+d,s+r),t.lineTo(i-u,s+a),t.closePath();break;case"crossRot":x+=R;case"cross":d=Math.cos(x)*(n?n/2:p),a=Math.cos(x)*p,r=Math.sin(x)*p,u=Math.sin(x)*(n?n/2:p),t.moveTo(i-d,s-r),t.lineTo(i+d,s+r),t.moveTo(i+u,s-a),t.lineTo(i-u,s+a);break;case"star":d=Math.cos(x)*(n?n/2:p),a=Math.cos(x)*p,r=Math.sin(x)*p,u=Math.sin(x)*(n?n/2:p),t.moveTo(i-d,s-r),t.lineTo(i+d,s+r),t.moveTo(i+u,s-a),t.lineTo(i-u,s+a),x+=R,d=Math.cos(x)*(n?n/2:p),a=Math.cos(x)*p,r=Math.sin(x)*p,u=Math.sin(x)*(n?n/2:p),t.moveTo(i-d,s-r),t.lineTo(i+d,s+r),t.moveTo(i+u,s-a),t.lineTo(i-u,s+a);break;case"line":a=n?n/2:Math.cos(x)*p,r=Math.sin(x)*p,t.moveTo(i-a,s-r),t.lineTo(i+a,s+r);break;case"dash":t.moveTo(i,s),t.lineTo(i+Math.cos(x)*(n?n/2:p),s+Math.sin(x)*p);break;case!1:t.closePath()}t.fill(),e.borderWidth>0&&t.stroke()}}function $t(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 Yt(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function Ut(t){t.restore()}function Xt(t,e,i,s,n){if(!e)return t.lineTo(i.x,i.y);if("middle"===n){const s=(e.x+i.x)/2;t.lineTo(s,e.y),t.lineTo(s,i.y)}else"after"===n!=!!s?t.lineTo(e.x,i.y):t.lineTo(i.x,e.y);t.lineTo(i.x,i.y)}function Qt(t,e,i,s){if(!e)return t.lineTo(i.x,i.y);t.bezierCurveTo(s?e.cp1x:e.cp2x,s?e.cp1y:e.cp2y,s?i.cp2x:i.cp1x,s?i.cp2y:i.cp1y,i.x,i.y)}function qt(t,e,i,s,n){if(n.strikethrough||n.underline){const o=t.measureText(s),a=e-o.actualBoundingBoxLeft,r=e+o.actualBoundingBoxRight,h=i-o.actualBoundingBoxAscent,l=i+o.actualBoundingBoxDescent,c=n.strikethrough?(h+l)/2:l;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=n.decorationWidth||2,t.moveTo(a,c),t.lineTo(r,c),t.stroke()}}function Kt(t,e){const i=t.fillStyle;t.fillStyle=e.color,t.fillRect(e.left,e.top,e.width,e.height),t.fillStyle=i}function Gt(t,e,i,s,n,o={}){const h=r(e)?e:[e],l=o.strokeWidth>0&&""!==o.strokeColor;let c,d;for(t.save(),t.font=n.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),a(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,o),c=0;c<h.length;++c)d=h[c],o.backdrop&&Kt(t,o.backdrop),l&&(o.strokeColor&&(t.strokeStyle=o.strokeColor),a(o.strokeWidth)||(t.lineWidth=o.strokeWidth),t.strokeText(d,i,s,o.maxWidth)),t.fillText(d,i,s,o.maxWidth),qt(t,i,s,d,o),s+=Number(n.lineHeight);t.restore()}function Zt(t,e){const{x:i,y:s,w:n,h:o,radius:a}=e;t.arc(i+a.topLeft,s+a.topLeft,a.topLeft,1.5*T,T,!0),t.lineTo(i,s+o-a.bottomLeft),t.arc(i+a.bottomLeft,s+o-a.bottomLeft,a.bottomLeft,T,F,!0),t.lineTo(i+n-a.bottomRight,s+o),t.arc(i+n-a.bottomRight,s+o-a.bottomRight,a.bottomRight,F,0,!0),t.lineTo(i+n,s+a.topRight),t.arc(i+n-a.topRight,s+a.topRight,a.topRight,0,-F,!0),t.lineTo(i+a.topLeft,s)}const Jt=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,te=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function ee(t,e){const i=(""+t).match(Jt);if(!i||"normal"===i[1])return 1.2*e;switch(t=+i[2],i[3]){case"px":return t;case"%":t/=100}return e*t}const ie=t=>+t||0;function se(t,e){const i={},s=h(e),n=s?Object.keys(e):e,o=h(t)?s?i=>d(t[i],t[e[i]]):e=>t[e]:()=>t;for(const t of n)i[t]=ie(o(t));return i}function ne(t){return se(t,{top:"y",right:"x",bottom:"y",left:"x"})}function oe(t){return se(t,["topLeft","topRight","bottomLeft","bottomRight"])}function ae(t){const e=ne(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function re(t,e){t=t||{},e=e||zt.font;let i=d(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));let s=d(t.style,e.style);s&&!(""+s).match(te)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);const n={family:d(t.family,e.family),lineHeight:ee(d(t.lineHeight,e.lineHeight),i),size:i,style:s,weight:d(t.weight,e.weight),string:""};return n.string=function(t){return!t||a(t.size)||a(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(n),n}function he(t,e,i,s){let n,o,a,h=!0;for(n=0,o=t.length;n<o;++n)if(a=t[n],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 s&&!h&&(s.cacheable=!1),a}function le(t,e,i){const{min:s,max:n}=t,o=f(e,(n-s)/2),a=(t,e)=>i&&0===t?0:t+e;return{min:a(s,-Math.abs(o)),max:a(n,o)}}function ce(t,e){return Object.assign(Object.create(t),e)}function de(t,e=[""],i,s,n=()=>t[0]){const o=i||t;void 0===s&&(s=we("_fallback",t));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:o,_fallback:s,_getTarget:n,override:i=>de([i,...t],e,o,s)};return new Proxy(a,{deleteProperty:(e,i)=>(delete e[i],delete e._keys,delete t[0][i],!0),get:(i,s)=>xe(i,s,()=>function(t,e,i,s){let n;for(const o of e)if(n=we(ge(o,t),i),void 0!==n)return pe(t,n)?ye(i,s,t,n):n}(s,e,t,i)),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>ke(t).includes(e),ownKeys:t=>ke(t),set(t,e,i){const s=t._storage||(t._storage=n());return t[e]=s[e]=i,delete t._keys,!0}})}function ue(t,e,i,s){const n={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:fe(t,s),setContext:e=>ue(t,e,i,s),override:n=>ue(t.override(n),e,i,s)};return new Proxy(n,{deleteProperty:(e,i)=>(delete e[i],delete t[i],!0),get:(t,e,i)=>xe(t,e,()=>function(t,e,i){const{_proxy:s,_context:n,_subProxy:o,_descriptors:a}=t;let l=s[e];return D(l)&&a.isScriptable(e)&&(l=function(t,e,i,s){const{_proxy:n,_context:o,_subProxy:a,_stack:r}=i;if(r.has(t))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+t);r.add(t);let h=e(o,a||s);return r.delete(t),pe(t,h)&&(h=ye(n._scopes,n,t,h)),h}(e,l,t,i)),r(l)&&l.length&&(l=function(t,e,i,s){const{_proxy:n,_context:o,_subProxy:a,_descriptors:r}=i;if(void 0!==o.index&&s(t))return e[o.index%e.length];if(h(e[0])){const i=e,s=n._scopes.filter(t=>t!==i);e=[];for(const h of i){const i=ye(s,n,t,h);e.push(ue(i,o,a&&a[t],r))}}return e}(e,l,t,a.isIndexable)),pe(e,l)&&(l=ue(l,n,o&&o[e],a)),l}(t,e,i)),getOwnPropertyDescriptor:(e,i)=>e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,i)=>Reflect.has(t,i),ownKeys:()=>Reflect.ownKeys(t),set:(e,i,s)=>(t[i]=s,delete e[i],!0)})}function fe(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:s=e.indexable,_allKeys:n=e.allKeys}=t;return{allKeys:n,scriptable:i,indexable:s,isScriptable:D(i)?i:()=>i,isIndexable:D(s)?s:()=>s}}const ge=(t,e)=>t?t+S(e):e,pe=(t,e)=>h(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function xe(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e)||"constructor"===e)return t[e];const s=i();return t[e]=s,s}function me(t,e,i){return D(t)?t(e,i):t}const be=(t,e)=>!0===t?e:"string"==typeof t?M(e,t):void 0;function _e(t,e,i,s,n){for(const o of e){const e=be(i,o);if(e){t.add(e);const o=me(e._fallback,i,n);if(void 0!==o&&o!==i&&o!==s)return o}else if(!1===e&&void 0!==s&&i!==s)return null}return!1}function ye(t,e,i,s){const n=e._rootScopes,o=me(e._fallback,i,s),a=[...t,...n],l=new Set;l.add(s);let c=ve(l,a,i,o||i,s);return null!==c&&(void 0===o||o===i||(c=ve(l,a,o,c,s),null!==c))&&de(Array.from(l),[""],n,o,()=>function(t,e,i){const s=t._getTarget();e in s||(s[e]={});const n=s[e];return r(n)&&h(i)?i:n||{}}(e,i,s))}function ve(t,e,i,s,n){for(;i;)i=_e(t,e,i,s,n);return i}function we(t,e){for(const i of e){if(!i)continue;const e=i[t];if(void 0!==e)return e}}function ke(t){let e=t._keys;return e||(e=t._keys=function(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)}(t._scopes)),e}function Me(t,e,i,s){const{iScale:n}=t,{key:o="r"}=this._parsing,a=new Array(s);let r,h,l,c;for(r=0,h=s;r<h;++r)l=r+i,c=e[l],a[r]={r:n.parse(M(c,o),l)};return a}const Se=Number.EPSILON||1e-14,Pe=(t,e)=>e<t.length&&!t[e].skip&&t[e],De=t=>"x"===t?"y":"x";function Oe(t,e,i,s){const n=t.skip?e:t,o=e,a=i.skip?e:i,r=K(o,n),h=K(a,o);let l=r/(r+h),c=h/(r+h);l=isNaN(l)?0:l,c=isNaN(c)?0:c;const d=s*l,u=s*c;return{previous:{x:o.x-d*(a.x-n.x),y:o.y-d*(a.y-n.y)},next:{x:o.x+u*(a.x-n.x),y:o.y+u*(a.y-n.y)}}}function Ce(t,e,i){return Math.max(Math.min(t,i),e)}function Te(t,e,i,s,n){let o,a,r,h;if(e.spanGaps&&(t=t.filter(t=>!t.skip)),"monotone"===e.cubicInterpolationMode)!function(t,e="x"){const i=De(e),s=t.length,n=Array(s).fill(0),o=Array(s);let a,r,h,l=Pe(t,0);for(a=0;a<s;++a)if(r=h,h=l,l=Pe(t,a+1),h){if(l){const t=l[e]-h[e];n[a]=0!==t?(l[i]-h[i])/t:0}o[a]=r?l?j(n[a-1])!==j(n[a])?0:(n[a-1]+n[a])/2:n[a-1]:n[a]}!function(t,e,i){const s=t.length;let n,o,a,r,h,l=Pe(t,0);for(let c=0;c<s-1;++c)h=l,l=Pe(t,c+1),h&&l&&(H(e[c],0,Se)?i[c]=i[c+1]=0:(n=i[c]/e[c],o=i[c+1]/e[c],r=Math.pow(n,2)+Math.pow(o,2),r<=9||(a=3/Math.sqrt(r),i[c]=n*a*e[c],i[c+1]=o*a*e[c])))}(t,n,o),function(t,e,i="x"){const s=De(i),n=t.length;let o,a,r,h=Pe(t,0);for(let l=0;l<n;++l){if(a=r,r=h,h=Pe(t,l+1),!r)continue;const n=r[i],c=r[s];a&&(o=(n-a[i])/3,r[`cp1${i}`]=n-o,r[`cp1${s}`]=c-o*e[l]),h&&(o=(h[i]-n)/3,r[`cp2${i}`]=n+o,r[`cp2${s}`]=c+o*e[l])}}(t,o,e)}(t,n);else{let i=s?t[t.length-1]:t[0];for(o=0,a=t.length;o<a;++o)r=t[o],h=Oe(i,r,t[Math.min(o+1,a-(s?0:1))%a],e.tension),r.cp1x=h.previous.x,r.cp1y=h.previous.y,r.cp2x=h.next.x,r.cp2y=h.next.y,i=r}e.capBezierPoints&&function(t,e){let i,s,n,o,a,r=$t(t[0],e);for(i=0,s=t.length;i<s;++i)a=o,o=r,r=i<s-1&&$t(t[i+1],e),o&&(n=t[i],a&&(n.cp1x=Ce(n.cp1x,e.left,e.right),n.cp1y=Ce(n.cp1y,e.top,e.bottom)),r&&(n.cp2x=Ce(n.cp2x,e.left,e.right),n.cp2y=Ce(n.cp2y,e.top,e.bottom)))}(t,i)}function Ae(){return"undefined"!=typeof window&&"undefined"!=typeof document}function Ie(t){let e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e}function Ee(t,e,i){let s;return"string"==typeof t?(s=parseInt(t,10),-1!==t.indexOf("%")&&(s=s/100*e.parentNode[i])):s=t,s}const Le=t=>t.ownerDocument.defaultView.getComputedStyle(t,null),Fe=["top","right","bottom","left"];function Re(t,e,i){const s={};i=i?"-"+i:"";for(let n=0;n<4;n++){const o=Fe[n];s[o]=parseFloat(t[e+"-"+o+i])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}const ze=(t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot);function Be(t,e){if("native"in t)return t;const{canvas:i,currentDevicePixelRatio:s}=e,n=Le(i),o="border-box"===n.boxSizing,a=Re(n,"padding"),r=Re(n,"border","width"),{x:h,y:l,box:c}=function(t,e){const i=t.touches,s=i&&i.length?i[0]:t,{offsetX:n,offsetY:o}=s;let a,r,h=!1;if(ze(n,o,t.target))a=n,r=o;else{const t=e.getBoundingClientRect();a=s.clientX-t.left,r=s.clientY-t.top,h=!0}return{x:a,y:r,box:h}}(t,i),d=a.left+(c&&r.left),u=a.top+(c&&r.top);let{width:f,height:g}=e;return o&&(f-=a.width+r.width,g-=a.height+r.height),{x:Math.round((h-d)/f*i.width/s),y:Math.round((l-u)/g*i.height/s)}}const je=t=>Math.round(10*t)/10;function He(t,e,i,s){const n=Le(t),o=Re(n,"margin"),a=Ee(n.maxWidth,t,"clientWidth")||E,r=Ee(n.maxHeight,t,"clientHeight")||E,h=function(t,e,i){let s,n;if(void 0===e||void 0===i){const o=t&&Ie(t);if(o){const t=o.getBoundingClientRect(),a=Le(o),r=Re(a,"border","width"),h=Re(a,"padding");e=t.width-h.width-r.width,i=t.height-h.height-r.height,s=Ee(a.maxWidth,o,"clientWidth"),n=Ee(a.maxHeight,o,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:s||E,maxHeight:n||E}}(t,e,i);let{width:l,height:c}=h;if("content-box"===n.boxSizing){const t=Re(n,"border","width"),e=Re(n,"padding");l-=e.width+t.width,c-=e.height+t.height}return l=Math.max(0,l-o.width),c=Math.max(0,s?l/s:c-o.height),l=je(Math.min(l,a,h.maxWidth)),c=je(Math.min(c,r,h.maxHeight)),l&&!c&&(c=je(l/2)),(void 0!==e||void 0!==i)&&s&&h.height&&c>h.height&&(c=h.height,l=je(Math.floor(c*s))),{width:l,height:c}}function Ve(t,e,i){const s=e||1,n=Math.floor(t.height*s),o=Math.floor(t.width*s);t.height=Math.floor(t.height),t.width=Math.floor(t.width);const a=t.canvas;return a.style&&(i||!a.style.height&&!a.style.width)&&(a.style.height=`${t.height}px`,a.style.width=`${t.width}px`),(t.currentDevicePixelRatio!==s||a.height!==n||a.width!==o)&&(t.currentDevicePixelRatio=s,a.height=n,a.width=o,t.ctx.setTransform(s,0,0,s,0,0),!0)}const We=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};Ae()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch(t){}return t}();function Ne(t,e){const i=function(t,e){return Le(t).getPropertyValue(e)}(t,e),s=i&&i.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function $e(t,e,i,s){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function Ye(t,e,i,s){return{x:t.x+i*(e.x-t.x),y:"middle"===s?i<.5?t.y:e.y:"after"===s?i<1?t.y:e.y:i>0?e.y:t.y}}function Ue(t,e,i,s){const n={x:t.cp2x,y:t.cp2y},o={x:e.cp1x,y:e.cp1y},a=$e(t,n,i),r=$e(n,o,i),h=$e(o,e,i),l=$e(a,r,i),c=$e(r,h,i);return $e(l,c,i)}const Xe=function(t,e){return{x:i=>t+t+e-i,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}},Qe=function(){return{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}};function qe(t,e,i){return t?Xe(e,i):Qe()}function Ke(t,e){let i,s;"ltr"!==e&&"rtl"!==e||(i=t.canvas.style,s=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=s)}function Ge(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function Ze(t){return"angle"===t?{between:J,compare:G,normalize:Z}:{between:it,compare:(t,e)=>t-e,normalize:t=>t}}function Je({start:t,end:e,count:i,loop:s,style:n}){return{start:t%i,end:e%i,loop:s&&(e-t+1)%i==0,style:n}}function ti(t,e,i){if(!i)return[t];const{property:s,start:n,end:o}=i,a=e.length,{compare:r,between:h,normalize:l}=Ze(s),{start:c,end:d,loop:u,style:f}=function(t,e,i){const{property:s,start:n,end:o}=i,{between:a,normalize:r}=Ze(s),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&&a(r(e[d%h][s]),n,o);++l)d--,u--;d%=h,u%=h}return u<d&&(u+=h),{start:d,end:u,loop:f,style:t.style}}(t,e,i),g=[];let p,x,m,b=!1,_=null;const y=()=>b||h(n,m,p)&&0!==r(n,m),v=()=>!b||0===r(o,p)||h(o,m,p);for(let t=c,i=c;t<=d;++t)x=e[t%a],x.skip||(p=l(x[s]),p!==m&&(b=h(p,n,o),null===_&&y()&&(_=0===r(p,n)?t:i),null!==_&&v()&&(g.push(Je({start:_,end:t,loop:u,count:a,style:f})),_=null),i=t,m=p));return null!==_&&g.push(Je({start:_,end:d,loop:u,count:a,style:f})),g}function ei(t,e){const i=[],s=t.segments;for(let n=0;n<s.length;n++){const o=ti(s[n],t.points,e);o.length&&i.push(...o)}return i}function ii(t,e){const i=t.points,s=t.options.spanGaps,n=i.length;if(!n)return[];const o=!!t._loop,{start:a,end:r}=function(t,e,i,s){let n=0,o=e-1;if(i&&!s)for(;n<e&&!t[n].skip;)n++;for(;n<e&&t[n].skip;)n++;for(n%=e,i&&(o+=n);o>n&&t[o%e].skip;)o--;return o%=e,{start:n,end:o}}(i,n,o,s);return si(t,!0===s?[{start:a,end:r,loop:o}]:function(t,e,i,s){const n=t.length,o=[];let a,r=e,h=t[e];for(a=e+1;a<=i;++a){const i=t[a%n];i.skip||i.stop?h.skip||(s=!1,o.push({start:e%n,end:(a-1)%n,loop:s}),e=r=i.stop?a:null):(r=a,h.skip&&(e=a)),h=i}return null!==r&&o.push({start:e%n,end:r%n,loop:s}),o}(i,a,r<a?r+n:r,!!t._fullLoop&&0===a&&r===n-1),i,e)}function si(t,e,i,s){return s&&s.setContext&&i?function(t,e,i,s){const n=t._chart.getContext(),o=ni(t.options),{_datasetIndex:a,options:{spanGaps:r}}=t,h=i.length,l=[];let c=o,d=e[0].start,u=d;function f(t,e,s,n){const o=r?-1:1;if(t!==e){for(t+=h;i[t%h].skip;)t-=o;for(;i[e%h].skip;)e+=o;t%h!==e%h&&(l.push({start:t%h,end:e%h,loop:s,style:n}),c=n,d=e%h)}}for(const t of e){d=r?d:t.start;let e,o=i[d%h];for(u=d+1;u<=t.end;u++){const r=i[u%h];e=ni(s.setContext(ce(n,{type:"segment",p0:o,p1:r,p0DataIndex:(u-1)%h,p1DataIndex:u%h,datasetIndex:a}))),oi(e,c)&&f(d,u-1,t.loop,c),o=r,c=e}d<u-1&&f(d,u-1,t.loop,c)}return l}(t,e,i,s):e}function ni(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function oi(t,e){if(!e)return!1;const i=[],s=function(t,e){return kt(e)?(i.includes(e)||i.push(e),i.indexOf(e)):e};return JSON.stringify(t,s)!==JSON.stringify(e,s)}function ai(t,e,i){return t.options.clip?t[i]:e[i]}function ri(t,e){const i=e._clip;if(i.disabled)return!1;const s=function(t,e){const{xScale:i,yScale:s}=t;return i&&s?{left:ai(i,e,"left"),right:ai(i,e,"right"),top:ai(s,e,"top"),bottom:ai(s,e,"bottom")}:e}(e,t.chartArea);return{left:!1===i.left?0:s.left-(!0===i.left?0:i.left),right:!1===i.right?t.width:s.right+(!0===i.right?0:i.right),top:!1===i.top?0:s.top-(!0===i.top?0:i.top),bottom:!1===i.bottom?t.height:s.bottom+(!0===i.bottom?0:i.bottom)}}}},e={};function i(s){var n=e[s];if(void 0!==n)return n.exports;var o=e[s]={exports:{}};return t[s](o,o.exports,i),o.exports}i.d=(t,e)=>{for(var s in e)i.o(e,s)&&!i.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var s=i(44656);s.t1.register(s.PP,s.kc,s.FN,s.No,s.hE,s.m_,s.dN),window.ThinkRankChartJS=s.t1})();