import{A as Da}from"./vendor.38e754a4.js";function Ta(Re,Gt){return Gt.forEach(function(B){B&&typeof B!="string"&&!Array.isArray(B)&&Object.keys(B).forEach(function(j){if(j!=="default"&&!(j in Re)){var z=Object.getOwnPropertyDescriptor(B,j);Object.defineProperty(Re,j,z.get?z:{enumerable:!0,get:function(){return B[j]}})}})}),Object.freeze(Re)}var Yt={exports:{}};/*! * Chart.js v2.9.4 * https://www.chartjs.org * (c) 2020 Chart.js Contributors * Released under the MIT License */(function(Re,Gt){(function(B,j){Re.exports=j(function(){try{return require("moment")}catch{}}())})(Da,function(B){B=B&&B.hasOwnProperty("default")?B.default:B;var j={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},z=function(e,t){return e(t={exports:{}},t.exports),t.exports}(function(e){var t={};for(var n in j)j.hasOwnProperty(n)&&(t[j[n]]=n);var i=e.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var a in i)if(i.hasOwnProperty(a)){if(!("channels"in i[a]))throw new Error("missing channels property: "+a);if(!("labels"in i[a]))throw new Error("missing channel labels property: "+a);if(i[a].labels.length!==i[a].channels)throw new Error("channel and label counts mismatch: "+a);var r=i[a].channels,o=i[a].labels;delete i[a].channels,delete i[a].labels,Object.defineProperty(i[a],"channels",{value:r}),Object.defineProperty(i[a],"labels",{value:o})}i.rgb.hsl=function(s){var l,u,d=s[0]/255,h=s[1]/255,f=s[2]/255,g=Math.min(d,h,f),p=Math.max(d,h,f),m=p-g;return p===g?l=0:d===p?l=(h-f)/m:h===p?l=2+(f-d)/m:f===p&&(l=4+(d-h)/m),(l=Math.min(60*l,360))<0&&(l+=360),u=(g+p)/2,[l,100*(p===g?0:u<=.5?m/(p+g):m/(2-p-g)),100*u]},i.rgb.hsv=function(s){var l,u,d,h,f,g=s[0]/255,p=s[1]/255,m=s[2]/255,v=Math.max(g,p,m),x=v-Math.min(g,p,m),b=function(y){return(v-y)/6/x+.5};return x===0?h=f=0:(f=x/v,l=b(g),u=b(p),d=b(m),g===v?h=d-u:p===v?h=1/3+l-d:m===v&&(h=2/3+u-l),h<0?h+=1:h>1&&(h-=1)),[360*h,100*f,100*v]},i.rgb.hwb=function(s){var l=s[0],u=s[1],d=s[2];return[i.rgb.hsl(s)[0],100*(1/255*Math.min(l,Math.min(u,d))),100*(d=1-1/255*Math.max(l,Math.max(u,d)))]},i.rgb.cmyk=function(s){var l,u=s[0]/255,d=s[1]/255,h=s[2]/255;return[100*((1-u-(l=Math.min(1-u,1-d,1-h)))/(1-l)||0),100*((1-d-l)/(1-l)||0),100*((1-h-l)/(1-l)||0),100*l]},i.rgb.keyword=function(s){var l=t[s];if(l)return l;var u,d,h,f=1/0;for(var g in j)if(j.hasOwnProperty(g)){var p=j[g],m=(d=s,h=p,Math.pow(d[0]-h[0],2)+Math.pow(d[1]-h[1],2)+Math.pow(d[2]-h[2],2));m.04045?Math.pow((l+.055)/1.055,2.4):l/12.92)+.3576*(u=u>.04045?Math.pow((u+.055)/1.055,2.4):u/12.92)+.1805*(d=d>.04045?Math.pow((d+.055)/1.055,2.4):d/12.92)),100*(.2126*l+.7152*u+.0722*d),100*(.0193*l+.1192*u+.9505*d)]},i.rgb.lab=function(s){var l=i.rgb.xyz(s),u=l[0],d=l[1],h=l[2];return d/=100,h/=108.883,u=(u/=95.047)>.008856?Math.pow(u,1/3):7.787*u+16/116,[116*(d=d>.008856?Math.pow(d,1/3):7.787*d+16/116)-16,500*(u-d),200*(d-(h=h>.008856?Math.pow(h,1/3):7.787*h+16/116))]},i.hsl.rgb=function(s){var l,u,d,h,f,g=s[0]/360,p=s[1]/100,m=s[2]/100;if(p===0)return[f=255*m,f,f];l=2*m-(u=m<.5?m*(1+p):m+p-m*p),h=[0,0,0];for(var v=0;v<3;v++)(d=g+1/3*-(v-1))<0&&d++,d>1&&d--,f=6*d<1?l+6*(u-l)*d:2*d<1?u:3*d<2?l+(u-l)*(2/3-d)*6:l,h[v]=255*f;return h},i.hsl.hsv=function(s){var l=s[0],u=s[1]/100,d=s[2]/100,h=u,f=Math.max(d,.01);return u*=(d*=2)<=1?d:2-d,h*=f<=1?f:2-f,[l,100*(d===0?2*h/(f+h):2*u/(d+u)),100*((d+u)/2)]},i.hsv.rgb=function(s){var l=s[0]/60,u=s[1]/100,d=s[2]/100,h=Math.floor(l)%6,f=l-Math.floor(l),g=255*d*(1-u),p=255*d*(1-u*f),m=255*d*(1-u*(1-f));switch(d*=255,h){case 0:return[d,m,g];case 1:return[p,d,g];case 2:return[g,d,m];case 3:return[g,p,d];case 4:return[m,g,d];case 5:return[d,g,p]}},i.hsv.hsl=function(s){var l,u,d,h=s[0],f=s[1]/100,g=s[2]/100,p=Math.max(g,.01);return d=(2-f)*g,u=f*p,[h,100*(u=(u/=(l=(2-f)*p)<=1?l:2-l)||0),100*(d/=2)]},i.hwb.rgb=function(s){var l,u,d,h,f,g,p,m=s[0]/360,v=s[1]/100,x=s[2]/100,b=v+x;switch(b>1&&(v/=b,x/=b),d=6*m-(l=Math.floor(6*m)),(1&l)!=0&&(d=1-d),h=v+d*((u=1-x)-v),l){default:case 6:case 0:f=u,g=h,p=v;break;case 1:f=h,g=u,p=v;break;case 2:f=v,g=u,p=h;break;case 3:f=v,g=h,p=u;break;case 4:f=h,g=v,p=u;break;case 5:f=u,g=v,p=h}return[255*f,255*g,255*p]},i.cmyk.rgb=function(s){var l=s[0]/100,u=s[1]/100,d=s[2]/100,h=s[3]/100;return[255*(1-Math.min(1,l*(1-h)+h)),255*(1-Math.min(1,u*(1-h)+h)),255*(1-Math.min(1,d*(1-h)+h))]},i.xyz.rgb=function(s){var l,u,d,h=s[0]/100,f=s[1]/100,g=s[2]/100;return u=-.9689*h+1.8758*f+.0415*g,d=.0557*h+-.204*f+1.057*g,l=(l=3.2406*h+-1.5372*f+-.4986*g)>.0031308?1.055*Math.pow(l,1/2.4)-.055:12.92*l,u=u>.0031308?1.055*Math.pow(u,1/2.4)-.055:12.92*u,d=d>.0031308?1.055*Math.pow(d,1/2.4)-.055:12.92*d,[255*(l=Math.min(Math.max(0,l),1)),255*(u=Math.min(Math.max(0,u),1)),255*(d=Math.min(Math.max(0,d),1))]},i.xyz.lab=function(s){var l=s[0],u=s[1],d=s[2];return u/=100,d/=108.883,l=(l/=95.047)>.008856?Math.pow(l,1/3):7.787*l+16/116,[116*(u=u>.008856?Math.pow(u,1/3):7.787*u+16/116)-16,500*(l-u),200*(u-(d=d>.008856?Math.pow(d,1/3):7.787*d+16/116))]},i.lab.xyz=function(s){var l,u,d,h=s[0];l=s[1]/500+(u=(h+16)/116),d=u-s[2]/200;var f=Math.pow(u,3),g=Math.pow(l,3),p=Math.pow(d,3);return u=f>.008856?f:(u-16/116)/7.787,l=g>.008856?g:(l-16/116)/7.787,d=p>.008856?p:(d-16/116)/7.787,[l*=95.047,u*=100,d*=108.883]},i.lab.lch=function(s){var l,u=s[0],d=s[1],h=s[2];return(l=360*Math.atan2(h,d)/2/Math.PI)<0&&(l+=360),[u,Math.sqrt(d*d+h*h),l]},i.lch.lab=function(s){var l,u=s[0],d=s[1];return l=s[2]/360*2*Math.PI,[u,d*Math.cos(l),d*Math.sin(l)]},i.rgb.ansi16=function(s){var l=s[0],u=s[1],d=s[2],h=1 in arguments?arguments[1]:i.rgb.hsv(s)[2];if((h=Math.round(h/50))===0)return 30;var f=30+(Math.round(d/255)<<2|Math.round(u/255)<<1|Math.round(l/255));return h===2&&(f+=60),f},i.hsv.ansi16=function(s){return i.rgb.ansi16(i.hsv.rgb(s),s[2])},i.rgb.ansi256=function(s){var l=s[0],u=s[1],d=s[2];return l===u&&u===d?l<8?16:l>248?231:Math.round((l-8)/247*24)+232:16+36*Math.round(l/255*5)+6*Math.round(u/255*5)+Math.round(d/255*5)},i.ansi16.rgb=function(s){var l=s%10;if(l===0||l===7)return s>50&&(l+=3.5),[l=l/10.5*255,l,l];var u=.5*(1+~~(s>50));return[(1&l)*u*255,(l>>1&1)*u*255,(l>>2&1)*u*255]},i.ansi256.rgb=function(s){if(s>=232){var l=10*(s-232)+8;return[l,l,l]}var u;return s-=16,[Math.floor(s/36)/5*255,Math.floor((u=s%36)/6)/5*255,u%6/5*255]},i.rgb.hex=function(s){var l=(((255&Math.round(s[0]))<<16)+((255&Math.round(s[1]))<<8)+(255&Math.round(s[2]))).toString(16).toUpperCase();return"000000".substring(l.length)+l},i.hex.rgb=function(s){var l=s.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!l)return[0,0,0];var u=l[0];l[0].length===3&&(u=u.split("").map(function(h){return h+h}).join(""));var d=parseInt(u,16);return[d>>16&255,d>>8&255,255&d]},i.rgb.hcg=function(s){var l,u=s[0]/255,d=s[1]/255,h=s[2]/255,f=Math.max(Math.max(u,d),h),g=Math.min(Math.min(u,d),h),p=f-g;return l=p<=0?0:f===u?(d-h)/p%6:f===d?2+(h-u)/p:4+(u-d)/p+4,l/=6,[360*(l%=1),100*p,100*(p<1?g/(1-p):0)]},i.hsl.hcg=function(s){var l=s[1]/100,u=s[2]/100,d=1,h=0;return(d=u<.5?2*l*u:2*l*(1-u))<1&&(h=(u-.5*d)/(1-d)),[s[0],100*d,100*h]},i.hsv.hcg=function(s){var l=s[1]/100,u=s[2]/100,d=l*u,h=0;return d<1&&(h=(u-d)/(1-d)),[s[0],100*d,100*h]},i.hcg.rgb=function(s){var l=s[0]/360,u=s[1]/100,d=s[2]/100;if(u===0)return[255*d,255*d,255*d];var h,f=[0,0,0],g=l%1*6,p=g%1,m=1-p;switch(Math.floor(g)){case 0:f[0]=1,f[1]=p,f[2]=0;break;case 1:f[0]=m,f[1]=1,f[2]=0;break;case 2:f[0]=0,f[1]=1,f[2]=p;break;case 3:f[0]=0,f[1]=m,f[2]=1;break;case 4:f[0]=p,f[1]=0,f[2]=1;break;default:f[0]=1,f[1]=0,f[2]=m}return h=(1-u)*d,[255*(u*f[0]+h),255*(u*f[1]+h),255*(u*f[2]+h)]},i.hcg.hsv=function(s){var l=s[1]/100,u=l+s[2]/100*(1-l),d=0;return u>0&&(d=l/u),[s[0],100*d,100*u]},i.hcg.hsl=function(s){var l=s[1]/100,u=s[2]/100*(1-l)+.5*l,d=0;return u>0&&u<.5?d=l/(2*u):u>=.5&&u<1&&(d=l/(2*(1-u))),[s[0],100*d,100*u]},i.hcg.hwb=function(s){var l=s[1]/100,u=l+s[2]/100*(1-l);return[s[0],100*(u-l),100*(1-u)]},i.hwb.hcg=function(s){var l=s[1]/100,u=1-s[2]/100,d=u-l,h=0;return d<1&&(h=(u-d)/(1-d)),[s[0],100*d,100*h]},i.apple.rgb=function(s){return[s[0]/65535*255,s[1]/65535*255,s[2]/65535*255]},i.rgb.apple=function(s){return[s[0]/255*65535,s[1]/255*65535,s[2]/255*65535]},i.gray.rgb=function(s){return[s[0]/100*255,s[0]/100*255,s[0]/100*255]},i.gray.hsl=i.gray.hsv=function(s){return[0,0,s[0]]},i.gray.hwb=function(s){return[0,100,s[0]]},i.gray.cmyk=function(s){return[0,0,0,s[0]]},i.gray.lab=function(s){return[s[0],0,0]},i.gray.hex=function(s){var l=255&Math.round(s[0]/100*255),u=((l<<16)+(l<<8)+l).toString(16).toUpperCase();return"000000".substring(u.length)+u},i.rgb.gray=function(s){return[(s[0]+s[1]+s[2])/3/255*100]}});z.rgb,z.hsl,z.hsv,z.hwb,z.cmyk,z.xyz,z.lab,z.lch,z.hex,z.keyword,z.ansi16,z.ansi256,z.hcg,z.apple,z.gray;function ii(e){var t=function(){for(var u={},d=Object.keys(z),h=d.length,f=0;f1&&(o=Array.prototype.slice.call(arguments));var s=a(o);if(typeof s=="object")for(var l=s.length,u=0;u1&&(o=Array.prototype.slice.call(arguments)),a(o))};return"conversion"in a&&(r.conversion=a.conversion),r}(i)})});var oi=Ae,dt={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},ie={getRgba:ht,getHsla:ct,getRgb:function(e){var t=ht(e);return t&&t.slice(0,3)},getHsl:function(e){var t=ct(e);return t&&t.slice(0,3)},getHwb:Xt,getAlpha:function(e){var t=ht(e);if(t||(t=ct(e))||(t=Xt(e)))return t[3]},hexString:function(e,t){return t=t!==void 0&&e.length===3?t:e[3],"#"+Xe(e[0])+Xe(e[1])+Xe(e[2])+(t>=0&&t<1?Xe(Math.round(255*t)):"")},rgbString:function(e,t){return t<1||e[3]&&e[3]<1?Kt(e,t):"rgb("+e[0]+", "+e[1]+", "+e[2]+")"},rgbaString:Kt,percentString:function(e,t){if(t<1||e[3]&&e[3]<1)return $t(e,t);var n=Math.round(e[0]/255*100),i=Math.round(e[1]/255*100),a=Math.round(e[2]/255*100);return"rgb("+n+"%, "+i+"%, "+a+"%)"},percentaString:$t,hslString:function(e,t){return t<1||e[3]&&e[3]<1?Zt(e,t):"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)"},hslaString:Zt,hwbString:function(e,t){return t===void 0&&(t=e[3]!==void 0?e[3]:1),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+(t!==void 0&&t!==1?", "+t:"")+")"},keyword:function(e){return Jt[e.slice(0,3)]}};function ht(e){if(e){var t=[0,0,0],n=1,i=e.match(/^#([a-fA-F0-9]{3,4})$/i),a="";if(i){a=(i=i[1])[3];for(var r=0;rn?(t+.05)/(n+.05):(n+.05)/(t+.05)},level:function(e){var t=this.contrast(e);return t>=7.1?"AAA":t>=4.5?"AA":""},dark:function(){var e=this.values.rgb;return(299*e[0]+587*e[1]+114*e[2])/1e3<128},light:function(){return!this.dark()},negate:function(){for(var e=[],t=0;t<3;t++)e[t]=255-this.values.rgb[t];return this.setValues("rgb",e),this},lighten:function(e){var t=this.values.hsl;return t[2]+=t[2]*e,this.setValues("hsl",t),this},darken:function(e){var t=this.values.hsl;return t[2]-=t[2]*e,this.setValues("hsl",t),this},saturate:function(e){var t=this.values.hsl;return t[1]+=t[1]*e,this.setValues("hsl",t),this},desaturate:function(e){var t=this.values.hsl;return t[1]-=t[1]*e,this.setValues("hsl",t),this},whiten:function(e){var t=this.values.hwb;return t[1]+=t[1]*e,this.setValues("hwb",t),this},blacken:function(e){var t=this.values.hwb;return t[2]+=t[2]*e,this.setValues("hwb",t),this},greyscale:function(){var e=this.values.rgb,t=.3*e[0]+.59*e[1]+.11*e[2];return this.setValues("rgb",[t,t,t]),this},clearer:function(e){var t=this.values.alpha;return this.setValues("alpha",t-t*e),this},opaquer:function(e){var t=this.values.alpha;return this.setValues("alpha",t+t*e),this},rotate:function(e){var t=this.values.hsl,n=(t[0]+e)%360;return t[0]=n<0?360+n:n,this.setValues("hsl",t),this},mix:function(e,t){var n=e,i=t===void 0?.5:t,a=2*i-1,r=this.alpha()-n.alpha(),o=((a*r==-1?a:(a+r)/(1+a*r))+1)/2,s=1-o;return this.rgb(o*this.red()+s*n.red(),o*this.green()+s*n.green(),o*this.blue()+s*n.blue()).alpha(this.alpha()*i+n.alpha()*(1-i))},toJSON:function(){return this.rgb()},clone:function(){var e,t,n=new Z,i=this.values,a=n.values;for(var r in i)i.hasOwnProperty(r)&&(e=i[r],(t={}.toString.call(e))==="[object Array]"?a[r]=e.slice(0):t==="[object Number]"?a[r]=e:console.error("unexpected color value:",e));return n}},Z.prototype.spaces={rgb:["red","green","blue"],hsl:["hue","saturation","lightness"],hsv:["hue","saturation","value"],hwb:["hue","whiteness","blackness"],cmyk:["cyan","magenta","yellow","black"]},Z.prototype.maxes={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]},Z.prototype.getValues=function(e){for(var t=this.values,n={},i=0;i=0;a--)t.call(n,e[a],a);else for(a=0;a=1?e:-(Math.sqrt(1-e*e)-1)},easeOutCirc:function(e){return Math.sqrt(1-(e-=1)*e)},easeInOutCirc:function(e){return(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},easeInElastic:function(e){var t=1.70158,n=0,i=1;return e===0?0:e===1?1:(n||(n=.3),t=n/(2*Math.PI)*Math.asin(1/i),-i*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n))},easeOutElastic:function(e){var t=1.70158,n=0,i=1;return e===0?0:e===1?1:(n||(n=.3),t=n/(2*Math.PI)*Math.asin(1/i),i*Math.pow(2,-10*e)*Math.sin((e-t)*(2*Math.PI)/n)+1)},easeInOutElastic:function(e){var t=1.70158,n=0,i=1;return e===0?0:(e/=.5)==2?1:(n||(n=.45),t=n/(2*Math.PI)*Math.asin(1/i),e<1?i*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n)*-.5:i*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n)*.5+1)},easeInBack:function(e){var t=1.70158;return e*e*((t+1)*e-t)},easeOutBack:function(e){var t=1.70158;return(e-=1)*e*((t+1)*e+t)+1},easeInOutBack:function(e){var t=1.70158;return(e/=.5)<1?e*e*((1+(t*=1.525))*e-t)*.5:.5*((e-=2)*e*((1+(t*=1.525))*e+t)+2)},easeInBounce:function(e){return 1-ze.easeOutBounce(1-e)},easeOutBounce:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:function(e){return e<.5?.5*ze.easeInBounce(2*e):.5*ze.easeOutBounce(2*e-1)+.5}},si={effects:ze};J.easingEffects=ze;var U=Math.PI,li=U/180,ui=2*U,Q=U/2,Ne=U/4,nn=2*U/3,$e={clear:function(e){e.ctx.clearRect(0,0,e.width,e.height)},roundedRect:function(e,t,n,i,a,r){if(r){var o=Math.min(r,a/2,i/2),s=t+o,l=n+o,u=t+i-o,d=n+a-o;e.moveTo(t,l),st.left-1e-6&&e.xt.top-1e-6&&e.y0&&this.requestAnimationFrame()},advance:function(){for(var e,t,n,i,a=this.animations,r=0;r=n?(c.callback(e.onAnimationComplete,[e],t),t.animating=!1,a.splice(r,1)):++r}},De=c.options.resolve,on=["push","pop","shift","splice","unshift"];function sn(e,t){var n=e._chartjs;if(n){var i=n.listeners,a=i.indexOf(t);a!==-1&&i.splice(a,1),i.length>0||(on.forEach(function(r){delete e[r]}),delete e._chartjs)}}var vt=function(e,t){this.initialize(e,t)};c.extend(vt.prototype,{datasetElementType:null,dataElementType:null,_datasetElementOptions:["backgroundColor","borderCapStyle","borderColor","borderDash","borderDashOffset","borderJoinStyle","borderWidth"],_dataElementOptions:["backgroundColor","borderColor","borderWidth","pointStyle"],initialize:function(e,t){var n=this;n.chart=e,n.index=t,n.linkScales(),n.addElements(),n._type=n.getMeta().type},updateIndex:function(e){this.index=e},linkScales:function(){var e=this.getMeta(),t=this.chart,n=t.scales,i=this.getDataset(),a=t.options.scales;e.xAxisID!==null&&e.xAxisID in n&&!i.xAxisID||(e.xAxisID=i.xAxisID||a.xAxes[0].id),e.yAxisID!==null&&e.yAxisID in n&&!i.yAxisID||(e.yAxisID=i.yAxisID||a.yAxes[0].id)},getDataset:function(){return this.chart.data.datasets[this.index]},getMeta:function(){return this.chart.getDatasetMeta(this.index)},getScaleForId:function(e){return this.chart.scales[e]},_getValueScaleId:function(){return this.getMeta().yAxisID},_getIndexScaleId:function(){return this.getMeta().xAxisID},_getValueScale:function(){return this.getScaleForId(this._getValueScaleId())},_getIndexScale:function(){return this.getScaleForId(this._getIndexScaleId())},reset:function(){this._update(!0)},destroy:function(){this._data&&sn(this._data,this)},createMetaDataset:function(){var e=this.datasetElementType;return e&&new e({_chart:this.chart,_datasetIndex:this.index})},createMetaData:function(e){var t=this.dataElementType;return t&&new t({_chart:this.chart,_datasetIndex:this.index,_index:e})},addElements:function(){var e,t,n=this.getMeta(),i=this.getDataset().data||[],a=n.data;for(e=0,t=i.length;en&&this.insertElements(n,i-n)},insertElements:function(e,t){for(var n=0;na?(r=a/t.innerRadius,e.arc(o,s,t.innerRadius-a,i+r,n-r,!0)):e.arc(o,s,a,i+Math.PI/2,n-Math.PI/2),e.closePath(),e.clip()}function bi(e,t,n){var i=t.borderAlign==="inner";i?(e.lineWidth=2*t.borderWidth,e.lineJoin="round"):(e.lineWidth=t.borderWidth,e.lineJoin="bevel"),n.fullCircles&&function(a,r,o,s){var l,u=o.endAngle;for(s&&(o.endAngle=o.startAngle+oe,ln(a,o),o.endAngle=u,o.endAngle===o.startAngle&&o.fullCircles&&(o.endAngle+=oe,o.fullCircles--)),a.beginPath(),a.arc(o.x,o.y,o.innerRadius,o.startAngle+oe,o.startAngle,!0),l=0;ls;)a-=oe;for(;a=o&&a<=s,u=r>=n.innerRadius&&r<=n.outerRadius;return l&&u}return!1},getCenterPoint:function(){var e=this._view,t=(e.startAngle+e.endAngle)/2,n=(e.innerRadius+e.outerRadius)/2;return{x:e.x+Math.cos(t)*n,y:e.y+Math.sin(t)*n}},getArea:function(){var e=this._view;return Math.PI*((e.endAngle-e.startAngle)/(2*Math.PI))*(Math.pow(e.outerRadius,2)-Math.pow(e.innerRadius,2))},tooltipPosition:function(){var e=this._view,t=e.startAngle+(e.endAngle-e.startAngle)/2,n=(e.outerRadius-e.innerRadius)/2+e.innerRadius;return{x:e.x+Math.cos(t)*n,y:e.y+Math.sin(t)*n}},draw:function(){var e,t=this._chart.ctx,n=this._view,i=n.borderAlign==="inner"?.33:0,a={x:n.x,y:n.y,innerRadius:n.innerRadius,outerRadius:Math.max(n.outerRadius-i,0),pixelMargin:i,startAngle:n.startAngle,endAngle:n.endAngle,fullCircles:Math.floor(n.circumference/oe)};if(t.save(),t.fillStyle=n.backgroundColor,t.strokeStyle=n.borderColor,a.fullCircles){for(a.endAngle=a.startAngle+oe,t.beginPath(),t.arc(a.x,a.y,a.outerRadius,a.startAngle,a.endAngle),t.arc(a.x,a.y,a.innerRadius,a.endAngle,a.startAngle,!0),t.closePath(),e=0;eu.x&&(d=pn(d,"left","right")):u.basen?n:i,r:l.right||a<0?0:a>t?t:a,b:l.bottom||r<0?0:r>n?n:r,l:l.left||o<0?0:o>t?t:o}}function Be(e,t,n){var i=t===null,a=n===null,r=!(!e||i&&a)&&gn(e);return r&&(i||t>=r.left&&t<=r.right)&&(a||n>=r.top&&n<=r.bottom)}S._set("global",{elements:{rectangle:{backgroundColor:fn,borderColor:fn,borderSkipped:"bottom",borderWidth:0}}});var Mi=re.extend({_type:"rectangle",draw:function(){var e=this._chart.ctx,t=this._view,n=function(r){var o=gn(r),s=o.right-o.left,l=o.bottom-o.top,u=wi(r,s/2,l/2);return{outer:{x:o.left,y:o.top,w:s,h:l},inner:{x:o.left+u.l,y:o.top+u.t,w:s-u.l-u.r,h:l-u.t-u.b}}}(t),i=n.outer,a=n.inner;e.fillStyle=t.backgroundColor,e.fillRect(i.x,i.y,i.w,i.h),i.w===a.w&&i.h===a.h||(e.save(),e.beginPath(),e.rect(i.x,i.y,i.w,i.h),e.clip(),e.fillStyle=t.borderColor,e.rect(a.x,a.y,a.w,a.h),e.fill("evenodd"),e.restore())},height:function(){var e=this._view;return e.base-e.y},inRange:function(e,t){return Be(this._view,e,t)},inLabelRange:function(e,t){var n=this._view;return Je(n)?Be(n,e,null):Be(n,null,t)},inXRange:function(e){return Be(this._view,e,null)},inYRange:function(e){return Be(this._view,null,e)},getCenterPoint:function(){var e,t,n=this._view;return Je(n)?(e=n.x,t=(n.y+n.base)/2):(e=(n.x+n.base)/2,t=n.y),{x:e,y:t}},getArea:function(){var e=this._view;return Je(e)?e.width*Math.abs(e.y-e.base):e.height*Math.abs(e.x-e.base)},tooltipPosition:function(){var e=this._view;return{x:e.x,y:e.y}}}),Y={},Si=xi,Ci=yi,Pi=ki,Ai=Mi;Y.Arc=Si,Y.Line=Ci,Y.Point=Pi,Y.Rectangle=Ai;var Ee=c._deprecated,Te=c.valueOrDefault;function Di(e,t,n){var i,a,r=n.barThickness,o=t.stackCount,s=t.pixels[e],l=c.isNullOrUndef(r)?function(u,d){var h,f,g,p,m=u._length;for(g=1,p=d.length;g0?Math.min(m,Math.abs(f-h)):m,h=f;return m}(t.scale,t.pixels):-1;return c.isNullOrUndef(r)?(i=l*n.categoryPercentage,a=n.barPercentage):(i=r*o,a=1),{chunk:i/o,ratio:a,start:s-i/2}}S._set("bar",{hover:{mode:"label"},scales:{xAxes:[{type:"category",offset:!0,gridLines:{offsetGridLines:!0}}],yAxes:[{type:"linear"}]}}),S._set("global",{datasets:{bar:{categoryPercentage:.8,barPercentage:.9}}});var mn=ee.extend({dataElementType:Y.Rectangle,_dataElementOptions:["backgroundColor","borderColor","borderSkipped","borderWidth","barPercentage","barThickness","categoryPercentage","maxBarThickness","minBarLength"],initialize:function(){var e,t,n=this;ee.prototype.initialize.apply(n,arguments),(e=n.getMeta()).stack=n.getDataset().stack,e.bar=!0,t=n._getIndexScale().options,Ee("bar chart",t.barPercentage,"scales.[x/y]Axes.barPercentage","dataset.barPercentage"),Ee("bar chart",t.barThickness,"scales.[x/y]Axes.barThickness","dataset.barThickness"),Ee("bar chart",t.categoryPercentage,"scales.[x/y]Axes.categoryPercentage","dataset.categoryPercentage"),Ee("bar chart",n._getValueScale().options.minBarLength,"scales.[x/y]Axes.minBarLength","dataset.minBarLength"),Ee("bar chart",t.maxBarThickness,"scales.[x/y]Axes.maxBarThickness","dataset.maxBarThickness")},update:function(e){var t,n,i=this.getMeta().data;for(this._ruler=this.getRuler(),t=0,n=i.length;t=0&&m.min>=0?m.min:m.max,_=m.start===void 0?m.end:m.max>=0&&m.min>=0?m.max-m.min:m.min-m.max,k=p.length;if(x||x===void 0&&b!==void 0)for(i=0;i=0&&u.max>=0?u.max:u.min,(m.min<0&&r<0||m.max>=0&&r>0)&&(y+=r));return o=h.getPixelForValue(y),l=(s=h.getPixelForValue(y+_))-o,v!==void 0&&Math.abs(l)=0&&!f||_<0&&f?o-v:o+v),{size:l,base:o,head:s,center:s+l/2}},calculateBarIndexPixels:function(e,t,n,i){var a=i.barThickness==="flex"?function(l,u,d){var h,f=u.pixels,g=f[l],p=l>0?f[l-1]:null,m=l=xe?-le:b<-xe?le:0)+v,_=Math.cos(b),k=Math.sin(b),M=Math.cos(y),C=Math.sin(y),P=b<=0&&y>=0||y>=le,w=b<=ye&&y>=ye||y>=le+ye,O=b<=-ye&&y>=-ye||y>=xe+ye,D=b===-xe||y>=xe?-1:Math.min(_,_*m,M,M*m),T=O?-1:Math.min(k,k*m,C,C*m),N=P?1:Math.max(_,_*m,M,M*m),I=w?1:Math.max(k,k*m,C,C*m);u=(N-D)/2,d=(I-T)/2,h=-(N+D)/2,f=-(I+T)/2}for(i=0,a=p.length;i0&&!isNaN(e)?le*(Math.abs(e)/t):0},getMaxBorderWidth:function(e){var t,n,i,a,r,o,s,l,u=0,d=this.chart;if(!e){for(t=0,n=d.data.datasets.length;t(u=s>u?s:u)?l:u);return u},setHoverStyle:function(e){var t=e._model,n=e._options,i=c.getHoverColor;e.$previousStyle={backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderWidth:t.borderWidth},t.backgroundColor=Qe(n.hoverBackgroundColor,i(n.backgroundColor)),t.borderColor=Qe(n.hoverBorderColor,i(n.borderColor)),t.borderWidth=Qe(n.hoverBorderWidth,n.borderWidth)},_getRingWeightOffset:function(e){for(var t=0,n=0;n0&&xt(l[e-1]._model,s)&&(n.controlPointPreviousX=u(n.controlPointPreviousX,s.left,s.right),n.controlPointPreviousY=u(n.controlPointPreviousY,s.top,s.bottom)),e0&&(r=e.getDatasetMeta(r[0]._datasetIndex).data),r},"x-axis":function(e,t){return wt(e,t,{intersect:!1})},point:function(e,t){return yt(e,ke(t,e))},nearest:function(e,t,n){var i=ke(t,e);n.axis=n.axis||"xy";var a=kt(n.axis);return _t(e,i,n.intersect,a)},x:function(e,t,n){var i=ke(t,e),a=[],r=!1;return We(e,function(o){o.inXRange(i.x)&&a.push(o),o.inRange(i.x,i.y)&&(r=!0)}),n.intersect&&!r&&(a=[]),a},y:function(e,t,n){var i=ke(t,e),a=[],r=!1;return We(e,function(o){o.inYRange(i.y)&&a.push(o),o.inRange(i.x,i.y)&&(r=!0)}),n.intersect&&!r&&(a=[]),a}}},Mt=c.extend;function Ve(e,t){return c.where(e,function(n){return n.pos===t})}function et(e,t){return e.sort(function(n,i){var a=t?i:n,r=t?n:i;return a.weight===r.weight?a.index-r.index:a.weight-r.weight})}function _n(e,t,n,i){return Math.max(e[n],t[n])+Math.max(e[i],t[i])}function Wi(e,t,n){var i,a,r=n.box,o=e.maxPadding;if(n.size&&(e[n.pos]-=n.size),n.size=n.horizontal?r.height:r.width,e[n.pos]+=n.size,r.getPadding){var s=r.getPadding();o.top=Math.max(o.top,s.top),o.left=Math.max(o.left,s.left),o.bottom=Math.max(o.bottom,s.bottom),o.right=Math.max(o.right,s.right)}if(i=t.outerWidth-_n(o,e,"left","right"),a=t.outerHeight-_n(o,e,"top","bottom"),i!==e.w||a!==e.h){e.w=i,e.h=a;var l=n.horizontal?[i,e.w]:[a,e.h];return!(l[0]===l[1]||isNaN(l[0])&&isNaN(l[1]))}}function Vi(e,t){var n=t.maxPadding;function i(a){var r={left:0,top:0,right:0,bottom:0};return a.forEach(function(o){r[o]=Math.max(t[o],n[o])}),r}return i(e?["left","right"]:["top","bottom"])}function tt(e,t,n){var i,a,r,o,s,l,u=[];for(i=0,a=e.length;idiv{position:absolute;width:1000000px;height:1000000px;left:0;top:0}.chartjs-size-monitor-shrink>div{position:absolute;width:200%;height:200%;left:0;top:0}"}))&&St.default||St,q="$chartjs",Ct="chartjs-size-monitor",wn="chartjs-render-monitor",ji="chartjs-render-animation",Mn=["animationstart","webkitAnimationStart"],qi={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"};function Sn(e,t){var n=c.getStyle(e,t),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?Number(i[1]):void 0}var Cn=!!function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("e",null,t)}catch{}return e}()&&{passive:!0};function He(e,t,n){e.addEventListener(t,n,Cn)}function Pt(e,t,n){e.removeEventListener(t,n,Cn)}function At(e,t,n,i,a){return{type:e,chart:t,native:a||null,x:n!==void 0?n:null,y:i!==void 0?i:null}}function je(e){var t=document.createElement("div");return t.className=e||"",t}function Ui(e,t,n){var i,a,r,o,s=e[q]||(e[q]={}),l=s.resizer=function(u){var d=je(Ct),h=je(Ct+"-expand"),f=je(Ct+"-shrink");h.appendChild(je()),f.appendChild(je()),d.appendChild(h),d.appendChild(f),d._reset=function(){h.scrollLeft=1e6,h.scrollTop=1e6,f.scrollLeft=1e6,f.scrollTop=1e6};var g=function(){d._reset(),u()};return He(h,"scroll",g.bind(h,"expand")),He(f,"scroll",g.bind(f,"shrink")),d}((i=function(){if(s.resizer){var u=n.options.maintainAspectRatio&&e.parentNode,d=u?u.clientWidth:0;t(At("resize",n)),u&&u.clientWidth0){var r=e[0];r.label?n=r.label:r.xLabel?n=r.xLabel:a>0&&r.index-1?e.split(` `):e}function Dn(e){var t=S.global;return{xPadding:e.xPadding,yPadding:e.yPadding,xAlign:e.xAlign,yAlign:e.yAlign,rtl:e.rtl,textDirection:e.textDirection,bodyFontColor:e.bodyFontColor,_bodyFontFamily:de(e.bodyFontFamily,t.defaultFontFamily),_bodyFontStyle:de(e.bodyFontStyle,t.defaultFontStyle),_bodyAlign:e.bodyAlign,bodyFontSize:de(e.bodyFontSize,t.defaultFontSize),bodySpacing:e.bodySpacing,titleFontColor:e.titleFontColor,_titleFontFamily:de(e.titleFontFamily,t.defaultFontFamily),_titleFontStyle:de(e.titleFontStyle,t.defaultFontStyle),titleFontSize:de(e.titleFontSize,t.defaultFontSize),_titleAlign:e.titleAlign,titleSpacing:e.titleSpacing,titleMarginBottom:e.titleMarginBottom,footerFontColor:e.footerFontColor,_footerFontFamily:de(e.footerFontFamily,t.defaultFontFamily),_footerFontStyle:de(e.footerFontStyle,t.defaultFontStyle),footerFontSize:de(e.footerFontSize,t.defaultFontSize),_footerAlign:e.footerAlign,footerSpacing:e.footerSpacing,footerMarginTop:e.footerMarginTop,caretSize:e.caretSize,cornerRadius:e.cornerRadius,backgroundColor:e.backgroundColor,opacity:0,legendColorBackground:e.multiKeyBackground,displayColors:e.displayColors,borderColor:e.borderColor,borderWidth:e.borderWidth}}function nt(e,t){return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-e.xPadding:e.x+e.xPadding}function Tn(e){return se([],he(e))}var Xi=re.extend({initialize:function(){this._model=Dn(this._options),this._lastActive=[]},getTitle:function(){var e=this,t=e._options,n=t.callbacks,i=n.beforeTitle.apply(e,arguments),a=n.title.apply(e,arguments),r=n.afterTitle.apply(e,arguments),o=[];return o=se(o,he(i)),o=se(o,he(a)),o=se(o,he(r))},getBeforeBody:function(){return Tn(this._options.callbacks.beforeBody.apply(this,arguments))},getBody:function(e,t){var n=this,i=n._options.callbacks,a=[];return c.each(e,function(r){var o={before:[],lines:[],after:[]};se(o.before,he(i.beforeLabel.call(n,r,t))),se(o.lines,i.label.call(n,r,t)),se(o.after,he(i.afterLabel.call(n,r,t))),a.push(o)}),a},getAfterBody:function(){return Tn(this._options.callbacks.afterBody.apply(this,arguments))},getFooter:function(){var e=this,t=e._options.callbacks,n=t.beforeFooter.apply(e,arguments),i=t.footer.apply(e,arguments),a=t.afterFooter.apply(e,arguments),r=[];return r=se(r,he(n)),r=se(r,he(i)),r=se(r,he(a))},update:function(e){var t,n,i,a,r,o,s,l,u,d,h=this,f=h._options,g=h._model,p=h._model=Dn(f),m=h._active,v=h._data,x={xAlign:g.xAlign,yAlign:g.yAlign},b={x:g.x,y:g.y},y={width:g.width,height:g.height},_={x:g.caretX,y:g.caretY};if(m.length){p.opacity=1;var k=[],M=[];_=An[f.position].call(h,m,h._eventPosition);var C=[];for(t=0,n=m.length;tD.width&&(T=D.width-w.width),T<0&&(T=0)),V==="top"?N+=$:N-=V==="bottom"?w.height+$:w.height/2,V==="center"?W==="left"?T+=$:W==="right"&&(T-=$):W==="left"?T-=fe:W==="right"&&(T+=fe),{x:T,y:N}}(p,y,x=function(P,w){var O,D,T,N,I,L=P._model,E=P._chart,W=P._chart.chartArea,V="center",$="center";L.yE.height-w.height&&($="bottom");var fe=(W.left+W.right)/2,be=(W.top+W.bottom)/2;$==="center"?(O=function(H){return H<=fe},D=function(H){return H>fe}):(O=function(H){return H<=w.width/2},D=function(H){return H>=E.width-w.width/2}),T=function(H){return H+w.width+L.caretSize+L.caretPadding>E.width},N=function(H){return H-w.width-L.caretSize-L.caretPadding<0},I=function(H){return H<=be?"top":"bottom"},O(L.x)?(V="left",T(L.x)&&(V="center",$=I(L.y))):D(L.x)&&(V="right",N(L.x)&&(V="center",$=I(L.y)));var ne=P._options;return{xAlign:ne.xAlign?ne.xAlign:V,yAlign:ne.yAlign?ne.yAlign:$}}(this,y),h._chart)}else p.opacity=0;return p.xAlign=x.xAlign,p.yAlign=x.yAlign,p.x=b.x,p.y=b.y,p.width=y.width,p.height=y.height,p.caretX=_.x,p.caretY=_.y,h._model=p,e&&f.custom&&f.custom.call(h,p),h},drawCaret:function(e,t){var n=this._chart.ctx,i=this._view,a=this.getCaretPosition(e,t,i);n.lineTo(a.x1,a.y1),n.lineTo(a.x2,a.y2),n.lineTo(a.x3,a.y3)},getCaretPosition:function(e,t,n){var i,a,r,o,s,l,u=n.caretSize,d=n.cornerRadius,h=n.xAlign,f=n.yAlign,g=e.x,p=e.y,m=t.width,v=t.height;if(f==="center")s=p+v/2,h==="left"?(a=(i=g)-u,r=i,o=s+u,l=s-u):(a=(i=g+m)+u,r=i,o=s-u,l=s+u);else if(h==="left"?(i=(a=g+d+u)-u,r=a+u):h==="right"?(i=(a=g+m-d-u)-u,r=a+u):(i=(a=n.caretX)-u,r=a+u),f==="top")s=(o=p)-u,l=o;else{s=(o=p+v)+u,l=o;var x=r;r=i,i=x}return{x1:i,x2:a,x3:r,y1:o,y2:s,y3:l}},drawTitle:function(e,t,n){var i,a,r,o=t.title,s=o.length;if(s){var l=Dt(t.rtl,t.x,t.width);for(e.x=nt(t,t._titleAlign),n.textAlign=l.textAlign(t._titleAlign),n.textBaseline="middle",i=t.titleFontSize,a=t.titleSpacing,n.fillStyle=t.titleFontColor,n.font=c.fontString(i,t._titleFontStyle,t._titleFontFamily),r=0;r0&&n.stroke()},draw:function(){var e=this._chart.ctx,t=this._view;if(t.opacity!==0){var n={width:t.width,height:t.height},i={x:t.x,y:t.y},a=Math.abs(t.opacity<.001)?0:t.opacity,r=t.title.length||t.beforeBody.length||t.body.length||t.afterBody.length||t.footer.length;this._options.enabled&&r&&(e.save(),e.globalAlpha=a,this.drawBackground(i,t,e,n),i.y+=t.yPadding,c.rtl.overrideTextDirection(e,t.textDirection),this.drawTitle(i,t,e),this.drawBody(i,t,e),this.drawFooter(i,t,e),c.rtl.restoreTextDirection(e,t.textDirection),e.restore())}},handleEvent:function(e){var t,n=this,i=n._options;return n._lastActive=n._lastActive||[],e.type==="mouseout"?n._active=[]:(n._active=n._chart.getElementsAtEventForMode(e,i.mode,i),i.reverse&&n._active.reverse()),(t=!c.arrayEquals(n._active,n._lastActive))&&(n._lastActive=n._active,(i.enabled||i.custom)&&(n._eventPosition={x:e.x,y:e.y},n.update(!0),n.pivot())),t}}),Ki=An,Tt=Xi;Tt.positioners=Ki;var It=c.valueOrDefault;function In(){return c.merge(Object.create(null),[].slice.call(arguments),{merger:function(e,t,n,i){if(e==="xAxes"||e==="yAxes"){var a,r,o,s=n[e].length;for(t[e]||(t[e]=[]),a=0;a=t[e].length&&t[e].push({}),!t[e][a].type||o.type&&o.type!==t[e][a].type?c.merge(t[e][a],[qe.getScaleDefaults(r),o]):c.merge(t[e][a],o)}else c._merger(e,t,n,i)}})}function Ft(){return c.merge(Object.create(null),[].slice.call(arguments),{merger:function(e,t,n,i){var a=t[e]||Object.create(null),r=n[e];e==="scales"?t[e]=In(a,r):e==="scale"?t[e]=c.merge(a,[qe.getScaleDefaults(r.type),r]):c._merger(e,t,n,i)}})}function $i(e){var t=e.options;c.each(e.scales,function(n){te.removeBox(e,n)}),t=Ft(S.global,S[e.config.type],t),e.options=e.config.options=t,e.ensureScalesHaveIDs(),e.buildOrUpdateScales(),e.tooltip._options=t.tooltips,e.tooltip.initialize()}function Fn(e,t,n){var i,a=function(r){return r.id===i};do i=t+n++;while(c.findIndex(e,a)>=0);return i}function On(e){return e==="top"||e==="bottom"}function Ln(e,t){return function(n,i){return n[e]===i[e]?n[t]-i[t]:n[e]-i[e]}}S._set("global",{elements:{},events:["mousemove","mouseout","click","touchstart","touchmove"],hover:{onHover:null,mode:"nearest",intersect:!0,animationDuration:400},onClick:null,maintainAspectRatio:!0,responsive:!0,responsiveAnimationDuration:0});var ge=function(e,t){return this.construct(e,t),this};c.extend(ge.prototype,{construct:function(e,t){var n=this;t=function(s){var l=(s=s||Object.create(null)).data=s.data||{};return l.datasets=l.datasets||[],l.labels=l.labels||[],s.options=Ft(S.global,S[s.type],s.options||{}),s}(t);var i=Fe.acquireContext(e,t),a=i&&i.canvas,r=a&&a.height,o=a&&a.width;n.id=c.uid(),n.ctx=i,n.canvas=a,n.config=t,n.width=o,n.height=r,n.aspectRatio=r?o/r:null,n.options=t.options,n._bufferedRender=!1,n._layers=[],n.chart=n,n.controller=n,ge.instances[n.id]=n,Object.defineProperty(n,"data",{get:function(){return n.config.data},set:function(s){n.config.data=s}}),i&&a?(n.initialize(),n.update()):console.error("Failed to create chart: can't acquire context from the given item")},initialize:function(){var e=this;return R.notify(e,"beforeInit"),c.retinaScale(e,e.options.devicePixelRatio),e.bindEvents(),e.options.responsive&&e.resize(!0),e.initToolTip(),R.notify(e,"afterInit"),e},clear:function(){return c.canvas.clear(this),this},stop:function(){return mt.cancelAnimation(this),this},resize:function(e){var t=this,n=t.options,i=t.canvas,a=n.maintainAspectRatio&&t.aspectRatio||null,r=Math.max(0,Math.floor(c.getMaximumWidth(i))),o=Math.max(0,Math.floor(a?r/a:c.getMaximumHeight(i)));if((t.width!==r||t.height!==o)&&(i.width=t.width=r,i.height=t.height=o,i.style.width=r+"px",i.style.height=o+"px",c.retinaScale(t,n.devicePixelRatio),!e)){var s={width:r,height:o};R.notify(t,"resize",[s]),n.onResize&&n.onResize(t,s),t.stop(),t.update({duration:n.responsiveAnimationDuration})}},ensureScalesHaveIDs:function(){var e=this.options,t=e.scales||{},n=e.scale;c.each(t.xAxes,function(i,a){i.id||(i.id=Fn(t.xAxes,"x-axis-",a))}),c.each(t.yAxes,function(i,a){i.id||(i.id=Fn(t.yAxes,"y-axis-",a))}),n&&(n.id=n.id||"scale")},buildOrUpdateScales:function(){var e=this,t=e.options,n=e.scales||{},i=[],a=Object.keys(n).reduce(function(r,o){return r[o]=!1,r},{});t.scales&&(i=i.concat((t.scales.xAxes||[]).map(function(r){return{options:r,dtype:"category",dposition:"bottom"}}),(t.scales.yAxes||[]).map(function(r){return{options:r,dtype:"linear",dposition:"left"}}))),t.scale&&i.push({options:t.scale,dtype:"radialLinear",isDefault:!0,dposition:"chartArea"}),c.each(i,function(r){var o=r.options,s=o.id,l=It(o.type,r.dtype);On(o.position)!==On(r.dposition)&&(o.position=r.dposition),a[s]=!0;var u=null;if(s in n&&n[s].type===l)(u=n[s]).options=o,u.ctx=e.ctx,u.chart=e;else{var d=qe.getScaleConstructor(l);if(!d)return;u=new d({id:s,type:l,options:o,ctx:e.ctx,chart:e}),n[u.id]=u}u.mergeTicksOptions(),r.isDefault&&(e.scale=u)}),c.each(a,function(r,o){r||delete n[o]}),e.scales=n,qe.addScalesToLayout(this)},buildOrUpdateControllers:function(){var e,t,n=this,i=[],a=n.data.datasets;for(e=0,t=a.length;e=0;--n)this.drawDataset(t[n],e);R.notify(this,"afterDatasetsDraw",[e])}},drawDataset:function(e,t){var n={meta:e,index:e.index,easingValue:t};R.notify(this,"beforeDatasetDraw",[n])!==!1&&(e.controller.draw(t),R.notify(this,"afterDatasetDraw",[n]))},_drawTooltip:function(e){var t=this.tooltip,n={tooltip:t,easingValue:e};R.notify(this,"beforeTooltipDraw",[n])!==!1&&(t.draw(),R.notify(this,"afterTooltipDraw",[n]))},getElementAtEvent:function(e){return Ie.modes.single(this,e)},getElementsAtEvent:function(e){return Ie.modes.label(this,e,{intersect:!0})},getElementsAtXAxis:function(e){return Ie.modes["x-axis"](this,e,{intersect:!0})},getElementsAtEventForMode:function(e,t,n){var i=Ie.modes[t];return typeof i=="function"?i(this,e,n):[]},getDatasetAtEvent:function(e){return Ie.modes.dataset(this,e,{intersect:!0})},getDatasetMeta:function(e){var t=this.data.datasets[e];t._meta||(t._meta={});var n=t._meta[this.id];return n||(n=t._meta[this.id]={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t.order||0,index:e}),n},getVisibleDatasetCount:function(){for(var e=0,t=0,n=this.data.datasets.length;t3?n[2]-n[1]:n[1]-n[0];Math.abs(i)>1&&e!==Math.floor(e)&&(i=e-Math.floor(e));var a=c.log10(Math.abs(i)),r="";if(e!==0)if(Math.max(Math.abs(n[0]),Math.abs(n[n.length-1]))<1e-4){var o=c.log10(Math.abs(e)),s=Math.floor(o)-Math.floor(a);s=Math.max(Math.min(s,20),0),r=e.toExponential(s)}else{var l=-1*Math.floor(a);l=Math.max(Math.min(l,20),0),r=e.toFixed(l)}else r="0";return r},logarithmic:function(e,t,n){var i=e/Math.pow(10,Math.floor(c.log10(e)));return e===0?"0":i===1||i===2||i===5||t===0||t===n.length-1?e.toExponential():""}}},Me=c.isArray,Ye=c.isNullOrUndef,Se=c.valueOrDefault,Oe=c.valueAtIndexOrDefault;function Zi(e,t,n){var i,a=e.getTicks().length,r=Math.min(t,a-1),o=e.getPixelForTick(r),s=e._startPixel,l=e._endPixel;if(!(n&&(i=a===1?Math.max(o-s,l-o):t===0?(e.getPixelForTick(1)-o)/2:(o-e.getPixelForTick(r-1))/2,(o+=rl+1e-6)))return o}function Ji(e,t,n,i){var a,r,o,s,l,u,d,h,f,g,p,m,v,x=n.length,b=[],y=[],_=[],k=0,M=0;for(a=0;aw){for(D=0;D=f||d<=1||!s.isHorizontal()?s.labelRotation=h:(t=(e=s._getLabelSizes()).widest.width,n=e.highest.height-e.highest.offset,i=Math.min(s.maxWidth,s.chart.width-t),t+6>(a=l.offset?s.maxWidth/d:i/(d-1))&&(a=i/(d-(l.offset?.5:1)),r=s.maxHeight-Ge(l.gridLines)-u.padding-Lt(l.scaleLabel),o=Math.sqrt(t*t+n*n),g=c.toDegrees(Math.min(Math.asin(Math.min((e.highest.height+6)/a,1)),Math.asin(Math.min(r/o,1))-Math.asin(n/o))),g=Math.max(h,Math.min(f,g))),s.labelRotation=g)},afterCalculateTickRotation:function(){c.callback(this.options.afterCalculateTickRotation,[this])},beforeFit:function(){c.callback(this.options.beforeFit,[this])},fit:function(){var e=this,t=e.minSize={width:0,height:0},n=e.chart,i=e.options,a=i.ticks,r=i.scaleLabel,o=i.gridLines,s=e._isVisible(),l=i.position==="bottom",u=e.isHorizontal();if(u?t.width=e.maxWidth:s&&(t.width=Ge(o)+Lt(r)),u?s&&(t.height=Ge(o)+Lt(r)):t.height=e.maxHeight,a.display&&s){var d=Rt(a),h=e._getLabelSizes(),f=h.first,g=h.last,p=h.widest,m=h.highest,v=.4*d.minor.lineHeight,x=a.padding;if(u){var b=e.labelRotation!==0,y=c.toRadians(e.labelRotation),_=Math.cos(y),k=Math.sin(y),M=k*p.width+_*(m.height-(b?m.offset:0))+(b?0:v);t.height=Math.min(e.maxHeight,t.height+M+x);var C,P,w=e.getPixelForTick(0)-e.left,O=e.right-e.getPixelForTick(e.getTicks().length-1);b?(C=l?_*f.width+k*f.offset:k*(f.height-f.offset),P=l?k*(g.height-g.offset):_*g.width+k*g.offset):(C=f.width/2,P=g.width/2),e.paddingLeft=Math.max((C-w)*e.width/(e.width-w),0)+3,e.paddingRight=Math.max((P-O)*e.width/(e.width-O),0)+3}else{var D=a.mirror?0:p.width+x+v;t.width=Math.min(e.maxWidth,t.width+D),e.paddingTop=f.height/2,e.paddingBottom=g.height/2}}e.handleMargins(),u?(e.width=e._length=n.width-e.margins.left-e.margins.right,e.height=t.height):(e.width=t.width,e.height=e._length=n.height-e.margins.top-e.margins.bottom)},handleMargins:function(){var e=this;e.margins&&(e.margins.left=Math.max(e.paddingLeft,e.margins.left),e.margins.top=Math.max(e.paddingTop,e.margins.top),e.margins.right=Math.max(e.paddingRight,e.margins.right),e.margins.bottom=Math.max(e.paddingBottom,e.margins.bottom))},afterFit:function(){c.callback(this.options.afterFit,[this])},isHorizontal:function(){var e=this.options.position;return e==="top"||e==="bottom"},isFullWidth:function(){return this.options.fullWidth},getRightValue:function(e){if(Ye(e))return NaN;if((typeof e=="number"||e instanceof Number)&&!isFinite(e))return NaN;if(e){if(this.isHorizontal()){if(e.x!==void 0)return this.getRightValue(e.x)}else if(e.y!==void 0)return this.getRightValue(e.y)}return e},_convertTicksToLabels:function(e){var t,n,i,a=this;for(a.ticks=e.map(function(r){return r.value}),a.beforeTickToLabelConversion(),t=a.convertTicksToLabels(e)||a.ticks,a.afterTickToLabelConversion(),n=0,i=e.length;nn-1?null:this.getPixelForDecimal(e*i+(t?i/2:0))},getPixelForDecimal:function(e){return this._reversePixels&&(e=1-e),this._startPixel+e*this._length},getDecimalForPixel:function(e){var t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t},getBasePixel:function(){return this.getPixelForValue(this.getBaseValue())},getBaseValue:function(){var e=this.min,t=this.max;return this.beginAtZero?0:e<0&&t<0?t:e>0&&t>0?e:0},_autoSkip:function(e){var t,n,i,a,r=this.options.ticks,o=this._length,s=r.maxTicksLimit||o/this._tickSize()+1,l=r.major.enabled?function(f){var g,p,m=[];for(g=0,p=f.length;gs)return function(f,g,p){var m,v,x=0,b=g[0];for(p=Math.ceil(p),m=0;mk)return x;return Math.max(k,1)}(l,e,0,s),u>0){for(t=0,n=u-1;t1?(h-d)/(u-1):null,at(e,i,c.isNullOrUndef(a)?0:d-a,d),at(e,i,h,c.isNullOrUndef(a)?e.length:h+a),zt(e)}return at(e,i),zt(e)},_tickSize:function(){var e=this.options.ticks,t=c.toRadians(this.labelRotation),n=Math.abs(Math.cos(t)),i=Math.abs(Math.sin(t)),a=this._getLabelSizes(),r=e.autoSkipPadding||0,o=a?a.widest.width+r:0,s=a?a.highest.height+r:0;return this.isHorizontal()?s*n>o*i?o/n:s/i:s*i=0&&(o=e),r!==void 0&&(e=n.indexOf(r))>=0&&(s=e),t.minIndex=o,t.maxIndex=s,t.min=n[o],t.max=n[s]},buildTicks:function(){var e=this._getLabels(),t=this.minIndex,n=this.maxIndex;this.ticks=t===0&&n===e.length-1?e:e.slice(t,n+1)},getLabelForIndex:function(e,t){var n=this.chart;return n.getDatasetMeta(t).controller._getValueScaleId()===this.id?this.getRightValue(n.data.datasets[t].data[e]):this._getLabels()[e]},_configure:function(){var e=this,t=e.options.offset,n=e.ticks;G.prototype._configure.call(e),e.isHorizontal()||(e._reversePixels=!e._reversePixels),n&&(e._startValue=e.minIndex-(t?.5:0),e._valueRange=Math.max(n.length-(t?0:1),1))},getPixelForValue:function(e,t,n){var i,a,r,o=this;return Bt(t)||Bt(n)||(e=o.chart.data.datasets[n].data[t]),Bt(e)||(i=o.isHorizontal()?e.x:e.y),(i!==void 0||e!==void 0&&isNaN(t))&&(a=o._getLabels(),e=c.valueOrDefault(i,e),t=(r=a.indexOf(e))!==-1?r:t,isNaN(t)&&(t=e)),o.getPixelForDecimal((t-o._startValue)/o._valueRange)},getPixelForTick:function(e){var t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e],e+this.minIndex)},getValueForPixel:function(e){var t=Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange);return Math.min(Math.max(t,0),this.ticks.length-1)},getBasePixel:function(){return this.bottom}}),Qi={position:"bottom"};zn._defaults=Qi;var ea=c.noop,Ce=c.isNullOrUndef,rt=G.extend({getRightValue:function(e){return typeof e=="string"?+e:G.prototype.getRightValue.call(this,e)},handleTickRangeOptions:function(){var e=this,t=e.options.ticks;if(t.beginAtZero){var n=c.sign(e.min),i=c.sign(e.max);n<0&&i<0?e.max=0:n>0&&i>0&&(e.min=0)}var a=t.min!==void 0||t.suggestedMin!==void 0,r=t.max!==void 0||t.suggestedMax!==void 0;t.min!==void 0?e.min=t.min:t.suggestedMin!==void 0&&(e.min===null?e.min=t.suggestedMin:e.min=Math.min(e.min,t.suggestedMin)),t.max!==void 0?e.max=t.max:t.suggestedMax!==void 0&&(e.max===null?e.max=t.suggestedMax:e.max=Math.max(e.max,t.suggestedMax)),a!==r&&e.min>=e.max&&(a?e.max=e.min+1:e.min=e.max-1),e.min===e.max&&(e.max++,t.beginAtZero||e.min--)},getTickLimit:function(){var e,t=this.options.ticks,n=t.stepSize,i=t.maxTicksLimit;return n?e=Math.ceil(this.max/n)-Math.floor(this.min/n)+1:(e=this._computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e},_computeTickLimit:function(){return Number.POSITIVE_INFINITY},handleDirectionalChanges:ea,buildTicks:function(){var e=this,t=e.options.ticks,n=e.getTickLimit(),i={maxTicks:n=Math.max(2,n),min:t.min,max:t.max,precision:t.precision,stepSize:c.valueOrDefault(t.fixedStepSize,t.stepSize)},a=e.ticks=function(r,o){var s,l,u,d,h=[],f=r.stepSize,g=f||1,p=r.maxTicks-1,m=r.min,v=r.max,x=r.precision,b=o.min,y=o.max,_=c.niceNum((y-b)/p/g)*g;if(_<1e-14&&Ce(m)&&Ce(v))return[b,y];(d=Math.ceil(y/_)-Math.floor(b/_))>p&&(_=c.niceNum(d*_/p/g)*g),f||Ce(x)?s=Math.pow(10,c._decimalPlaces(_)):(s=Math.pow(10,x),_=Math.ceil(_*s)/s),l=Math.floor(b/_)*_,u=Math.ceil(y/_)*_,f&&(!Ce(m)&&c.almostWhole(m/_,_/1e3)&&(l=m),!Ce(v)&&c.almostWhole(v/_,_/1e3)&&(u=v)),d=(u-l)/_,d=c.almostEquals(d,Math.round(d),_/1e3)?Math.round(d):Math.ceil(d),l=Math.round(l*s)/s,u=Math.round(u*s)/s,h.push(Ce(m)?l:m);for(var k=1;kt.length-1?null:this.getPixelForValue(t[e])}}),aa=ta;Nn._defaults=aa;var Et=c.valueOrDefault,X=c.math.log10,ra={position:"left",ticks:{callback:Ue.formatters.logarithmic}};function ot(e,t){return c.isFinite(e)&&e>=0?e:t}var Bn=G.extend({determineDataLimits:function(){var e,t,n,i,a,r,o=this,s=o.options,l=o.chart,u=l.data.datasets,d=o.isHorizontal();function h(v){return d?v.xAxisID===o.id:v.yAxisID===o.id}o.min=Number.POSITIVE_INFINITY,o.max=Number.NEGATIVE_INFINITY,o.minNotZero=Number.POSITIVE_INFINITY;var f=s.stacked;if(f===void 0){for(e=0;e0){var x=c.min(v),b=c.max(v);o.min=Math.min(o.min,x),o.max=Math.max(o.max,b)}})}else for(e=0;e0?e.minNotZero=e.min:e.max<1?e.minNotZero=Math.pow(10,Math.floor(X(e.max))):e.minNotZero=1)},buildTicks:function(){var e=this,t=e.options.ticks,n=!e.isHorizontal(),i={min:ot(t.min),max:ot(t.max)},a=e.ticks=function(r,o){var s,l,u=[],d=Et(r.min,Math.pow(10,Math.floor(X(o.min)))),h=Math.floor(X(o.max)),f=Math.ceil(o.max/Math.pow(10,h));d===0?(s=Math.floor(X(o.minNotZero)),l=Math.floor(o.minNotZero/Math.pow(10,s)),u.push(d),d=l*Math.pow(10,s)):(s=Math.floor(X(d)),l=Math.floor(d/Math.pow(10,s)));var g=s<0?Math.pow(10,Math.abs(s)):1;do u.push(d),++l==10&&(l=1,g=++s>=0?1:g),d=Math.round(l*Math.pow(10,s)*g)/g;while(st.length-1?null:this.getPixelForValue(t[e])},_getFirstTickValue:function(e){var t=Math.floor(X(e));return Math.floor(e/Math.pow(10,t))*Math.pow(10,t)},_configure:function(){var e=this,t=e.min,n=0;G.prototype._configure.call(e),t===0&&(t=e._getFirstTickValue(e.minNotZero),n=Et(e.options.ticks.fontSize,S.global.defaultFontSize)/e._length),e._startValue=X(t),e._valueOffset=n,e._valueRange=(X(e.max)-X(t))/(1-n)},getPixelForValue:function(e){var t=this,n=0;return(e=+t.getRightValue(e))>t.min&&e>0&&(n=(X(e)-t._startValue)/t._valueRange+t._valueOffset),t.getPixelForDecimal(n)},getValueForPixel:function(e){var t=this,n=t.getDecimalForPixel(e);return n===0&&t.min===0?0:Math.pow(10,t._startValue+(n-t._valueOffset)*t._valueRange)}}),oa=ra;Bn._defaults=oa;var st=c.valueOrDefault,Wt=c.valueAtIndexOrDefault,En=c.options.resolve,sa={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,color:"rgba(0,0,0,0.1)",lineWidth:1,borderDash:[],borderDashOffset:0},gridLines:{circular:!1},ticks:{showLabelBackdrop:!0,backdropColor:"rgba(255,255,255,0.75)",backdropPaddingY:2,backdropPaddingX:2,callback:Ue.formatters.linear},pointLabels:{display:!0,fontSize:10,callback:function(e){return e}}};function Vt(e){var t=e.ticks;return t.display&&e.display?st(t.fontSize,S.global.defaultFontSize)+2*t.backdropPaddingY:0}function Wn(e,t,n,i,a){return e===i||e===a?{start:t-n/2,end:t+n/2}:ea?{start:t-n,end:t}:{start:t,end:t+n}}function la(e){return e===0||e===180?"center":e<180?"left":"right"}function ua(e,t,n,i){var a,r,o=n.y+i/2;if(c.isArray(t))for(a=0,r=t.length;a270||e<90)&&(n.y-=t.h)}function lt(e){return c.isNumber(e)?e:0}var Vn=rt.extend({setDimensions:function(){var e=this;e.width=e.maxWidth,e.height=e.maxHeight,e.paddingTop=Vt(e.options)/2,e.xCenter=Math.floor(e.width/2),e.yCenter=Math.floor((e.height-e.paddingTop)/2),e.drawingArea=Math.min(e.height-e.paddingTop,e.width)/2},determineDataLimits:function(){var e=this,t=e.chart,n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;c.each(t.data.datasets,function(a,r){if(t.isDatasetVisible(r)){var o=t.getDatasetMeta(r);c.each(a.data,function(s,l){var u=+e.getRightValue(s);isNaN(u)||o.data[l].hidden||(n=Math.min(u,n),i=Math.max(u,i))})}}),e.min=n===Number.POSITIVE_INFINITY?0:n,e.max=i===Number.NEGATIVE_INFINITY?0:i,e.handleTickRangeOptions()},_computeTickLimit:function(){return Math.ceil(this.drawingArea/Vt(this.options))},convertTicksToLabels:function(){var e=this;rt.prototype.convertTicksToLabels.call(e),e.pointLabels=e.chart.data.labels.map(function(){var t=c.callback(e.options.pointLabels.callback,arguments,e);return t||t===0?t:""})},getLabelForIndex:function(e,t){return+this.getRightValue(this.chart.data.datasets[t].data[e])},fit:function(){var e=this.options;e.display&&e.pointLabels.display?function(t){var n,i,a,r=c.options._parseFont(t.options.pointLabels),o={l:0,r:t.width,t:0,b:t.height-t.paddingTop},s={};t.ctx.font=r.string,t._pointLabelSizes=[];var l,u,d,h=t.chart.data.labels.length;for(n=0;no.r&&(o.r=p.end,s.r=f),m.starto.b&&(o.b=m.end,s.b=f)}t.setReductions(t.drawingArea,o,s)}(this):this.setCenterPoint(0,0,0,0)},setReductions:function(e,t,n){var i=this,a=t.l/Math.sin(n.l),r=Math.max(t.r-i.width,0)/Math.sin(n.r),o=-t.t/Math.cos(n.t),s=-Math.max(t.b-(i.height-i.paddingTop),0)/Math.cos(n.b);a=lt(a),r=lt(r),o=lt(o),s=lt(s),i.drawingArea=Math.min(Math.floor(e-(a+r)/2),Math.floor(e-(o+s)/2)),i.setCenterPoint(a,r,o,s)},setCenterPoint:function(e,t,n,i){var a=this,r=a.width-t-a.drawingArea,o=e+a.drawingArea,s=n+a.drawingArea,l=a.height-a.paddingTop-i-a.drawingArea;a.xCenter=Math.floor((o+r)/2+a.left),a.yCenter=Math.floor((s+l)/2+a.top+a.paddingTop)},getIndexAngle:function(e){var t=this.chart,n=(e*(360/t.data.labels.length)+((t.options||{}).startAngle||0))%360;return(n<0?n+360:n)*Math.PI*2/360},getDistanceFromCenterForValue:function(e){var t=this;if(c.isNullOrUndef(e))return NaN;var n=t.drawingArea/(t.max-t.min);return t.options.ticks.reverse?(t.max-e)*n:(e-t.min)*n},getPointPosition:function(e,t){var n=this.getIndexAngle(e)-Math.PI/2;return{x:Math.cos(n)*t+this.xCenter,y:Math.sin(n)*t+this.yCenter}},getPointPositionForValue:function(e,t){return this.getPointPosition(e,this.getDistanceFromCenterForValue(t))},getBasePosition:function(e){var t=this.min,n=this.max;return this.getPointPositionForValue(e||0,this.beginAtZero?0:t<0&&n<0?n:t>0&&n>0?t:0)},_drawGrid:function(){var e,t,n,i=this,a=i.ctx,r=i.options,o=r.gridLines,s=r.angleLines,l=st(s.lineWidth,o.lineWidth),u=st(s.color,o.color);if(r.pointLabels.display&&function(d){var h=d.ctx,f=d.options,g=f.pointLabels,p=Vt(f),m=d.getDistanceFromCenterForValue(f.ticks.reverse?d.min:d.max),v=c.options._parseFont(g);h.save(),h.font=v.string,h.textBaseline="middle";for(var x=d.chart.data.labels.length-1;x>=0;x--){var b=x===0?p/2:0,y=d.getPointPosition(x,m+b+5),_=Wt(g.fontColor,x,S.global.defaultFontColor);h.fillStyle=_;var k=d.getIndexAngle(x),M=c.toDegrees(k);h.textAlign=la(M),da(M,d._pointLabelSizes[x],y),ua(h,d.pointLabels[x],y,v.lineHeight)}h.restore()}(i),o.display&&c.each(i.ticks,function(d,h){h!==0&&(t=i.getDistanceFromCenterForValue(i.ticksAsNumbers[h]),function(f,g,p,m){var v,x=f.ctx,b=g.circular,y=f.chart.data.labels.length,_=Wt(g.color,m-1),k=Wt(g.lineWidth,m-1);if((b||y)&&_&&k){if(x.save(),x.strokeStyle=_,x.lineWidth=k,x.setLineDash&&(x.setLineDash(g.borderDash||[]),x.lineDashOffset=g.borderDashOffset||0),x.beginPath(),b)x.arc(f.xCenter,f.yCenter,p,0,2*Math.PI);else{v=f.getPointPosition(0,p),x.moveTo(v.x,v.y);for(var M=1;M=0;e--)t=i.getDistanceFromCenterForValue(r.ticks.reverse?i.min:i.max),n=i.getPointPosition(e,t),a.beginPath(),a.moveTo(i.xCenter,i.yCenter),a.lineTo(n.x,n.y),a.stroke();a.restore()}},_drawLabels:function(){var e=this,t=e.ctx,n=e.options.ticks;if(n.display){var i,a,r=e.getIndexAngle(0),o=c.options._parseFont(n),s=st(n.fontColor,S.global.defaultFontColor);t.save(),t.font=o.string,t.translate(e.xCenter,e.yCenter),t.rotate(r),t.textAlign="center",t.textBaseline="middle",c.each(e.ticks,function(l,u){(u!==0||n.reverse)&&(i=e.getDistanceFromCenterForValue(e.ticksAsNumbers[u]),n.showLabelBackdrop&&(a=t.measureText(l).width,t.fillStyle=n.backdropColor,t.fillRect(-a/2-n.backdropPaddingX,-i-o.size/2-n.backdropPaddingY,a+2*n.backdropPaddingX,o.size+2*n.backdropPaddingY)),t.fillStyle=s,t.fillText(l,0,-i))}),t.restore()}},_drawTitle:c.noop}),ha=sa;Vn._defaults=ha;var Ht=c._deprecated,Hn=c.options.resolve,ca=c.valueOrDefault,jn=Number.MIN_SAFE_INTEGER||-9007199254740991,jt=Number.MAX_SAFE_INTEGER||9007199254740991,ut={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},K=Object.keys(ut);function qn(e,t){return e-t}function Un(e){return c.valueOrDefault(e.time.min,e.ticks.min)}function Yn(e){return c.valueOrDefault(e.time.max,e.ticks.max)}function Le(e,t,n,i){var a=function(d,h,f){for(var g,p,m,v=0,x=d.length-1;v>=0&&v<=x;){if(p=d[(g=v+x>>1)-1]||null,m=d[g],!p)return{lo:null,hi:m};if(m[h]f))return{lo:p,hi:m};x=g-1}}return{lo:m,hi:null}}(e,t,n),r=a.lo?a.hi?a.lo:e[e.length-2]:e[0],o=a.lo?a.hi?a.hi:e[e.length-1]:e[1],s=o[t]-r[t],l=s?(n-r[t])/s:0,u=(o[i]-r[i])*l;return r[i]+u}function qt(e,t){var n=e._adapter,i=e.options.time,a=i.parser,r=a||i.format,o=t;return typeof a=="function"&&(o=a(o)),c.isFinite(o)||(o=typeof r=="string"?n.parse(o,r):n.parse(o)),o!==null?+o:(a||typeof r!="function"||(o=r(t),c.isFinite(o)||(o=n.parse(o))),o)}function Pe(e,t){if(c.isNullOrUndef(t))return null;var n=e.options.time,i=qt(e,e.getRightValue(t));return i===null||n.round&&(i=+e._adapter.startOf(i,n.round)),i}function Gn(e,t,n,i){var a,r,o,s=K.length;for(a=K.indexOf(e);a=0&&(u[g].major=!0);return u}(e,r,o,n):r}var Kn=G.extend({initialize:function(){this.mergeTicksOptions(),G.prototype.initialize.call(this)},update:function(){var e=this,t=e.options,n=t.time||(t.time={}),i=e._adapter=new Ot._date(t.adapters.date);return Ht("time scale",n.format,"time.format","time.parser"),Ht("time scale",n.min,"time.min","ticks.min"),Ht("time scale",n.max,"time.max","ticks.max"),c.mergeIf(n.displayFormats,i.formats()),G.prototype.update.apply(e,arguments)},getRightValue:function(e){return e&&e.t!==void 0&&(e=e.t),G.prototype.getRightValue.call(this,e)},determineDataLimits:function(){var e,t,n,i,a,r,o,s=this,l=s.chart,u=s._adapter,d=s.options,h=d.time.unit||"day",f=jt,g=jn,p=[],m=[],v=[],x=s._getLabels();for(e=0,n=x.length;e1?function(b){var y,_,k,M={},C=[];for(y=0,_=b.length;y<_;++y)M[k=b[y]]||(M[k]=!0,C.push(k));return C}(p).sort(qn):p.sort(qn),f=Math.min(f,p[0]),g=Math.max(g,p[p.length-1])),f=Pe(s,Un(d))||f,g=Pe(s,Yn(d))||g,f=f===jt?+u.startOf(Date.now(),h):f,g=g===jn?+u.endOf(Date.now(),h)+1:g,s.min=Math.min(f,g),s.max=Math.max(f+1,g),s._table=[],s._timestamps={data:p,datasets:m,labels:v}},buildTicks:function(){var e,t,n,i=this,a=i.min,r=i.max,o=i.options,s=o.ticks,l=o.time,u=i._timestamps,d=[],h=i.getLabelCapacity(a),f=s.source,g=o.distribution;for(u=f==="data"||f==="auto"&&g==="series"?u.data:f==="labels"?u.labels:function(p,m,v,x){var b,y=p._adapter,_=p.options,k=_.time,M=k.unit||Gn(k.minUnit,m,v,x),C=Hn([k.stepSize,k.unitStepSize,1]),P=M==="week"&&k.isoWeekday,w=m,O=[];if(P&&(w=+y.startOf(w,"isoWeek",P)),w=+y.startOf(w,P?"day":M),y.diff(v,m,M)>1e5*C)throw m+" and "+v+" are too far apart with stepSize of "+C+" "+M;for(b=w;b=a&&n<=r&&d.push(n);return i.min=a,i.max=r,i._unit=l.unit||(s.autoSkip?Gn(l.minUnit,i.min,i.max,h):function(p,m,v,x,b){var y,_;for(y=K.length-1;y>=K.indexOf(v);y--)if(_=K[y],ut[_].common&&p._adapter.diff(b,x,_)>=m-1)return _;return K[v?K.indexOf(v):0]}(i,d.length,l.minUnit,i.min,i.max)),i._majorUnit=s.major.enabled&&i._unit!=="year"?function(p){for(var m=K.indexOf(p)+1,v=K.length;mm&&k=0&&e0?s:1}}),fa={position:"bottom",distribution:"linear",bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,displayFormat:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{autoSkip:!1,source:"auto",major:{enabled:!1}}};Kn._defaults=fa;var ga={category:zn,linear:Nn,logarithmic:Bn,radialLinear:Vn,time:Kn},pa={datetime:"MMM D, YYYY, h:mm:ss a",millisecond:"h:mm:ss.SSS a",second:"h:mm:ss a",minute:"h:mm a",hour:"hA",day:"MMM D",week:"ll",month:"MMM YYYY",quarter:"[Q]Q - YYYY",year:"YYYY"};Ot._date.override(typeof B=="function"?{_id:"moment",formats:function(){return pa},parse:function(e,t){return typeof e=="string"&&typeof t=="string"?e=B(e,t):e instanceof B||(e=B(e)),e.isValid()?e.valueOf():null},format:function(e,t){return B(e).format(t)},add:function(e,t,n){return B(e).add(t,n).valueOf()},diff:function(e,t,n){return B(e).diff(B(t),n)},startOf:function(e,t,n){return e=B(e),t==="isoWeek"?e.isoWeekday(n).valueOf():e.startOf(t).valueOf()},endOf:function(e,t){return B(e).endOf(t).valueOf()},_create:function(e){return B(e)}}:{}),S._set("global",{plugins:{filler:{propagate:!0}}});var ma={dataset:function(e){var t=e.fill,n=e.chart,i=n.getDatasetMeta(t),a=i&&n.isDatasetVisible(t)&&i.dataset._children||[],r=a.length||0;return r?function(o,s){return s=n)&&i;switch(r){case"bottom":return"start";case"top":return"end";case"zero":return"origin";case"origin":case"start":case"end":return r;default:return!1}}function ba(e){return(e.el._scale||{}).getPointPositionForValue?function(t){var n,i,a,r,o,s=t.el._scale,l=s.options,u=s.chart.data.labels.length,d=t.fill,h=[];if(!u)return null;for(n=l.ticks.reverse?s.max:s.min,i=l.ticks.reverse?s.min:s.max,a=s.getPointPositionForValue(0,n),r=0;r0;--r)c.canvas.lineTo(e,n[r],n[r-1],!0);else for(o=n[0].cx,s=n[0].cy,l=Math.sqrt(Math.pow(n[0].x-o,2)+Math.pow(n[0].y-s,2)),r=a-1;r>0;--r)e.arc(o,s,l,n[r].angle,n[r-1].angle,!0)}}function _a(e,t,n,i,a,r){var o,s,l,u,d,h,f,g,p=t.length,m=i.spanGaps,v=[],x=[],b=0,y=0;for(e.beginPath(),o=0,s=p;o=0;--n)(t=l[n].$filler)&&t.visible&&(a=(i=t.el)._view,r=i._children||[],o=t.mapper,s=a.backgroundColor||S.global.defaultColor,o&&s&&r.length&&(c.canvas.clipArea(u,e.chartArea),_a(u,r,o,a,s,i._loop),c.canvas.unclipArea(u)))}},wa=c.rtl.getRtlAdapter,pe=c.noop,me=c.valueOrDefault;function Ut(e,t){return e.usePointStyle&&e.boxWidth>t?t:e.boxWidth}S._set("global",{legend:{display:!0,position:"top",align:"center",fullWidth:!0,reverse:!1,weight:1e3,onClick:function(e,t){var n=t.datasetIndex,i=this.chart,a=i.getDatasetMeta(n);a.hidden=a.hidden===null?!i.data.datasets[n].hidden:null,i.update()},onHover:null,onLeave:null,labels:{boxWidth:40,padding:10,generateLabels:function(e){var t=e.data.datasets,n=e.options.legend||{},i=n.labels&&n.labels.usePointStyle;return e._getSortedDatasetMetas().map(function(a){var r=a.controller.getStyle(i?0:void 0);return{text:t[a.index].label,fillStyle:r.backgroundColor,hidden:!e.isDatasetVisible(a.index),lineCap:r.borderCapStyle,lineDash:r.borderDash,lineDashOffset:r.borderDashOffset,lineJoin:r.borderJoinStyle,lineWidth:r.borderWidth,strokeStyle:r.borderColor,pointStyle:r.pointStyle,rotation:r.rotation,datasetIndex:a.index}},this)}}},legendCallback:function(e){var t,n,i,a=document.createElement("ul"),r=e.data.datasets;for(a.setAttribute("class",e.id+"-legend"),t=0,n=r.length;tl.width)&&(h+=o+n.padding,d[d.length-(y>0?0:1)]=0),s[y]={left:0,top:0,width:_,height:o},d[d.length-1]+=_+n.padding}),l.height+=h}else{var f=n.padding,g=e.columnWidths=[],p=e.columnHeights=[],m=n.padding,v=0,x=0;c.each(e.legendItems,function(b,y){var _=Ut(n,o)+o/2+a.measureText(b.text).width;y>0&&x+o+2*f>l.height&&(m+=v+n.padding,g.push(v),p.push(x),v=0,x=0),v=Math.max(v,_),x+=o+f,s[y]={left:0,top:0,width:_,height:o}}),m+=v,g.push(v),p.push(x),l.width+=m}e.width=l.width,e.height=l.height}else e.width=l.width=e.height=l.height=0},afterFit:pe,isHorizontal:function(){return this.options.position==="top"||this.options.position==="bottom"},draw:function(){var e=this,t=e.options,n=t.labels,i=S.global,a=i.defaultColor,r=i.elements.line,o=e.height,s=e.columnHeights,l=e.width,u=e.lineWidths;if(t.display){var d,h=wa(t.rtl,e.left,e.minSize.width),f=e.ctx,g=me(n.fontColor,i.defaultFontColor),p=c.options._parseFont(n),m=p.size;f.textAlign=h.textAlign("left"),f.textBaseline="middle",f.lineWidth=.5,f.strokeStyle=g,f.fillStyle=g,f.font=p.string;var v=Ut(n,m),x=e.legendHitBoxes,b=function(k,M){switch(t.align){case"start":return n.padding;case"end":return k-M;default:return(k-M+n.padding)/2}},y=e.isHorizontal();d=y?{x:e.left+b(l,u[0]),y:e.top+n.padding,line:0}:{x:e.left+n.padding,y:e.top+b(o,s[0]),line:0},c.rtl.overrideTextDirection(e.ctx,t.textDirection);var _=m+n.padding;c.each(e.legendItems,function(k,M){var C=f.measureText(k.text).width,P=v+m/2+C,w=d.x,O=d.y;h.setWidth(e.minSize.width),y?M>0&&w+P+n.padding>e.left+e.minSize.width&&(O=d.y+=_,d.line++,w=d.x=e.left+b(l,u[d.line])):M>0&&O+_>e.top+e.minSize.height&&(w=d.x=w+e.columnWidths[d.line]+n.padding,d.line++,O=d.y=e.top+b(o,s[d.line]));var D=h.x(w);(function(T,N,I){if(!(isNaN(v)||v<=0)){f.save();var L=me(I.lineWidth,r.borderWidth);if(f.fillStyle=me(I.fillStyle,a),f.lineCap=me(I.lineCap,r.borderCapStyle),f.lineDashOffset=me(I.lineDashOffset,r.borderDashOffset),f.lineJoin=me(I.lineJoin,r.borderJoinStyle),f.lineWidth=L,f.strokeStyle=me(I.strokeStyle,a),f.setLineDash&&f.setLineDash(me(I.lineDash,r.borderDash)),n&&n.usePointStyle){var E=v*Math.SQRT2/2,W=h.xPlus(T,v/2),V=N+m/2;c.canvas.drawPoint(f,I.pointStyle,E,W,V,I.rotation)}else f.fillRect(h.leftForLtr(T,v),N,v,m),L!==0&&f.strokeRect(h.leftForLtr(T,v),N,v,m);f.restore()}})(D,O,k),x[M].left=h.leftForLtr(D,x[M].width),x[M].top=O,function(T,N,I,L){var E=m/2,W=h.xPlus(T,v+E),V=N+E;f.fillText(I.text,W,V),I.hidden&&(f.beginPath(),f.lineWidth=2,f.moveTo(W,V),f.lineTo(h.xPlus(W,L),V),f.stroke())}(D,O,k,C),y?d.x+=P+n.padding:d.y+=_}),c.rtl.restoreTextDirection(e.ctx,t.textDirection)}},_getLegendItemAt:function(e,t){var n,i,a,r=this;if(e>=r.left&&e<=r.right&&t>=r.top&&t<=r.bottom){for(a=r.legendHitBoxes,n=0;n=(i=a[n]).left&&e<=i.left+i.width&&t>=i.top&&t<=i.top+i.height)return r.legendItems[n]}return null},handleEvent:function(e){var t,n=this,i=n.options,a=e.type==="mouseup"?"click":e.type;if(a==="mousemove"){if(!i.onHover&&!i.onLeave)return}else if(a!=="click"||!i.onClick)return;t=n._getLegendItemAt(e.x,e.y),a==="click"?t&&i.onClick&&i.onClick.call(n,e.native,t):(i.onLeave&&t!==n._hoveredItem&&(n._hoveredItem&&i.onLeave.call(n,e.native,n._hoveredItem),n._hoveredItem=t),i.onHover&&t&&i.onHover.call(n,e.native,t))}});function Qn(e,t){var n=new Jn({ctx:e.ctx,options:t,chart:e});te.configure(e,n,t),te.addBox(e,n),e.legend=n}var Ma={id:"legend",_element:Jn,beforeInit:function(e){var t=e.options.legend;t&&Qn(e,t)},beforeUpdate:function(e){var t=e.options.legend,n=e.legend;t?(c.mergeIf(t,S.global.legend),n?(te.configure(e,n,t),n.options=t):Qn(e,t)):n&&(te.removeBox(e,n),delete e.legend)},afterEvent:function(e,t){var n=e.legend;n&&n.handleEvent(t)}},ce=c.noop;S._set("global",{title:{display:!1,fontStyle:"bold",fullWidth:!0,padding:10,position:"top",text:"",weight:2e3}});var ei=re.extend({initialize:function(e){c.extend(this,e),this.legendHitBoxes=[]},beforeUpdate:ce,update:function(e,t,n){var i=this;return i.beforeUpdate(),i.maxWidth=e,i.maxHeight=t,i.margins=n,i.beforeSetDimensions(),i.setDimensions(),i.afterSetDimensions(),i.beforeBuildLabels(),i.buildLabels(),i.afterBuildLabels(),i.beforeFit(),i.fit(),i.afterFit(),i.afterUpdate(),i.minSize},afterUpdate:ce,beforeSetDimensions:ce,setDimensions:function(){var e=this;e.isHorizontal()?(e.width=e.maxWidth,e.left=0,e.right=e.width):(e.height=e.maxHeight,e.top=0,e.bottom=e.height),e.paddingLeft=0,e.paddingTop=0,e.paddingRight=0,e.paddingBottom=0,e.minSize={width:0,height:0}},afterSetDimensions:ce,beforeBuildLabels:ce,buildLabels:ce,afterBuildLabels:ce,beforeFit:ce,fit:function(){var e,t=this,n=t.options,i=t.minSize={},a=t.isHorizontal();n.display?(e=(c.isArray(n.text)?n.text.length:1)*c.options._parseFont(n).lineHeight+2*n.padding,t.width=i.width=a?t.maxWidth:e,t.height=i.height=a?e:t.maxHeight):t.width=i.width=t.height=i.height=0},afterFit:ce,isHorizontal:function(){var e=this.options.position;return e==="top"||e==="bottom"},draw:function(){var e=this,t=e.ctx,n=e.options;if(n.display){var i,a,r,o=c.options._parseFont(n),s=o.lineHeight,l=s/2+n.padding,u=0,d=e.top,h=e.left,f=e.bottom,g=e.right;t.fillStyle=c.valueOrDefault(n.fontColor,S.global.defaultFontColor),t.font=o.string,e.isHorizontal()?(a=h+(g-h)/2,r=d+l,i=g-h):(a=n.position==="left"?h+l:g-l,r=d+(f-d)/2,i=f-d,u=Math.PI*(n.position==="left"?-.5:.5)),t.save(),t.translate(a,r),t.rotate(u),t.textAlign="center",t.textBaseline="middle";var p=n.text;if(c.isArray(p))for(var m=0,v=0;v=0;o--){var s=i[o];if(a(s))return s}},c.isNumber=function(i){return!isNaN(parseFloat(i))&&isFinite(i)},c.almostEquals=function(i,a,r){return Math.abs(i-a)=i},c.max=function(i){return i.reduce(function(a,r){return isNaN(r)?a:Math.max(a,r)},Number.NEGATIVE_INFINITY)},c.min=function(i){return i.reduce(function(a,r){return isNaN(r)?a:Math.min(a,r)},Number.POSITIVE_INFINITY)},c.sign=Math.sign?function(i){return Math.sign(i)}:function(i){return(i=+i)==0||isNaN(i)?i:i>0?1:-1},c.toRadians=function(i){return i*(Math.PI/180)},c.toDegrees=function(i){return i*(180/Math.PI)},c._decimalPlaces=function(i){if(c.isFinite(i)){for(var a=1,r=0;Math.round(i*a)/a!==i;)a*=10,r++;return r}},c.getAngleFromPoint=function(i,a){var r=a.x-i.x,o=a.y-i.y,s=Math.sqrt(r*r+o*o),l=Math.atan2(o,r);return l<-.5*Math.PI&&(l+=2*Math.PI),{angle:l,distance:s}},c.distanceBetweenPoints=function(i,a){return Math.sqrt(Math.pow(a.x-i.x,2)+Math.pow(a.y-i.y,2))},c.aliasPixel=function(i){return i%2==0?0:.5},c._alignPixel=function(i,a,r){var o=i.currentDevicePixelRatio,s=r/2;return Math.round((a-s)*o)/o+s},c.splineCurve=function(i,a,r,o){var s=i.skip?a:i,l=a,u=r.skip?a:r,d=Math.sqrt(Math.pow(l.x-s.x,2)+Math.pow(l.y-s.y,2)),h=Math.sqrt(Math.pow(u.x-l.x,2)+Math.pow(u.y-l.y,2)),f=d/(d+h),g=h/(d+h),p=o*(f=isNaN(f)?0:f),m=o*(g=isNaN(g)?0:g);return{previous:{x:l.x-p*(u.x-s.x),y:l.y-p*(u.y-s.y)},next:{x:l.x+m*(u.x-s.x),y:l.y+m*(u.y-s.y)}}},c.EPSILON=Number.EPSILON||1e-14,c.splineCurveMonotone=function(i){var a,r,o,s,l,u,d,h,f,g=(i||[]).map(function(v){return{model:v._model,deltaK:0,mK:0}}),p=g.length;for(a=0;a0?g[a-1]:null,(s=a0?g[a-1]:null,s=a=i.length-1?i[0]:i[a+1]:a>=i.length-1?i[i.length-1]:i[a+1]},c.previousItem=function(i,a,r){return r?a<=0?i[i.length-1]:i[a-1]:a<=0?i[0]:i[a-1]},c.niceNum=function(i,a){var r=Math.floor(c.log10(i)),o=i/Math.pow(10,r);return(a?o<1.5?1:o<3?2:o<7?5:10:o<=1?1:o<=2?2:o<=5?5:10)*Math.pow(10,r)},c.requestAnimFrame=typeof window=="undefined"?function(i){i()}:window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(i){return window.setTimeout(i,1e3/60)},c.getRelativePosition=function(i,a){var r,o,s=i.originalEvent||i,l=i.target||i.srcElement,u=l.getBoundingClientRect(),d=s.touches;d&&d.length>0?(r=d[0].clientX,o=d[0].clientY):(r=s.clientX,o=s.clientY);var h=parseFloat(c.getStyle(l,"padding-left")),f=parseFloat(c.getStyle(l,"padding-top")),g=parseFloat(c.getStyle(l,"padding-right")),p=parseFloat(c.getStyle(l,"padding-bottom")),m=u.right-u.left-h-g,v=u.bottom-u.top-f-p;return{x:r=Math.round((r-u.left-h)/m*l.width/a.currentDevicePixelRatio),y:o=Math.round((o-u.top-f)/v*l.height/a.currentDevicePixelRatio)}},c.getConstraintWidth=function(i){return n(i,"max-width","clientWidth")},c.getConstraintHeight=function(i){return n(i,"max-height","clientHeight")},c._calculatePadding=function(i,a,r){return(a=c.getStyle(i,a)).indexOf("%")>-1?r*parseInt(a,10)/100:parseInt(a,10)},c._getParentNode=function(i){var a=i.parentNode;return a&&a.toString()==="[object ShadowRoot]"&&(a=a.host),a},c.getMaximumWidth=function(i){var a=c._getParentNode(i);if(!a)return i.clientWidth;var r=a.clientWidth,o=r-c._calculatePadding(a,"padding-left",r)-c._calculatePadding(a,"padding-right",r),s=c.getConstraintWidth(i);return isNaN(s)?o:Math.min(o,s)},c.getMaximumHeight=function(i){var a=c._getParentNode(i);if(!a)return i.clientHeight;var r=a.clientHeight,o=r-c._calculatePadding(a,"padding-top",r)-c._calculatePadding(a,"padding-bottom",r),s=c.getConstraintHeight(i);return isNaN(s)?o:Math.min(o,s)},c.getStyle=function(i,a){return i.currentStyle?i.currentStyle[a]:document.defaultView.getComputedStyle(i,null).getPropertyValue(a)},c.retinaScale=function(i,a){var r=i.currentDevicePixelRatio=a||typeof window!="undefined"&&window.devicePixelRatio||1;if(r!==1){var o=i.canvas,s=i.height,l=i.width;o.height=s*r,o.width=l*r,i.ctx.scale(r,r),o.style.height||o.style.width||(o.style.height=s+"px",o.style.width=l+"px")}},c.fontString=function(i,a,r){return a+" "+i+"px "+r},c.longestText=function(i,a,r,o){var s=(o=o||{}).data=o.data||{},l=o.garbageCollect=o.garbageCollect||[];o.font!==a&&(s=o.data={},l=o.garbageCollect=[],o.font=a),i.font=a;var u,d,h,f,g,p=0,m=r.length;for(u=0;ur.length){for(u=0;uo&&(o=l),o},c.numberOfLabelLines=function(i){var a=1;return c.each(i,function(r){c.isArray(r)&&r.length>a&&(a=r.length)}),a},c.color=Ke?function(i){return i instanceof CanvasGradient&&(i=S.global.defaultColor),Ke(i)}:function(i){return console.error("Color.js not found!"),i},c.getHoverColor=function(i){return i instanceof CanvasPattern||i instanceof CanvasGradient?i:c.color(i).saturate(.5).darken(.1).rgbString()}}(),A._adapters=Ot,A.Animation=pt,A.animationService=mt,A.controllers=yn,A.DatasetController=ee,A.defaults=S,A.Element=re,A.elements=Y,A.Interaction=Ie,A.layouts=te,A.platform=Fe,A.plugins=R,A.Scale=G,A.scaleService=qe,A.Ticks=Ue,A.Tooltip=Tt,A.helpers.each(ga,function(e,t){A.scaleService.registerScaleType(t,e,e._defaults)}),ve)ve.hasOwnProperty(ni)&&A.plugins.register(ve[ni]);A.platform.initialize();var Aa=A;return typeof window!="undefined"&&(window.Chart=A),A.Chart=A,A.Legend=ve.legend._element,A.Title=ve.title._element,A.pluginService=A.plugins,A.PluginBase=A.Element.extend({}),A.canvasHelpers=A.helpers.canvas,A.layoutService=A.layouts,A.LinearScaleBase=rt,A.helpers.each(["Bar","Bubble","Doughnut","Line","PolarArea","Radar","Scatter"],function(e){A[e]=function(t,n){return new A(t,A.helpers.merge(n||{},{type:e.charAt(0).toLowerCase()+e.slice(1)}))}}),Aa})})(Yt);var Ia=Yt.exports,Oa=Object.freeze(Ta({__proto__:null,[Symbol.toStringTag]:"Module",default:Ia},[Yt.exports]));export{Oa as C};