monkeytype/public/js/chart.min.js

6 lines
170 KiB
JavaScript
Raw Normal View History

2020-08-04 02:21:06 +08:00
(function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(function(){try{return require("moment")}catch(t){}}()):"function"==typeof define&&define.amd?define(["require"],function(t){return e(function(){try{return t("moment")}catch(t){}}())}):(t=t||self,t.Chart=e(t.moment))})(this,function(t){"use strict";function e(t,e){return e={exports:{}},t(e,e.exports),e.exports}function n(t){return t&&t.default||t}function i(){for(var t={},e=Object.keys(Xe),n=e.length,i=0;i<n;i++)t[e[i]]={distance:-1,parent:null};return t}function a(t){var e=i(),n=[t];for(e[t].distance=0;n.length;)for(var a=n.pop(),r=Object.keys(Xe[a]),o=r.length,l=0;l<o;l++){var s=r[l],u=e[s];-1===u.distance&&(u.distance=e[a].distance+1,u.parent=a,n.unshift(s))}return e}function r(t,e){return function(n){return e(t(n))}}function o(t,e){for(var n=[e[t].parent,t],i=Xe[e[t].parent][t],a=e[t].parent;e[a].parent;)n.unshift(e[a].parent),i=r(Xe[e[a].parent][a],i),a=e[a].parent;return i.conversion=n,i}function l(t){var e=function(e){return null==e?e:(arguments.length>1&&(e=Array.prototype.slice.call(arguments)),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}function s(t){var e=function(e){if(null==e)return e;arguments.length>1&&(e=Array.prototype.slice.call(arguments));var n=t(e);if("object"==typeof n)for(var i=n.length,a=0;a<i;a++)n[a]=Math.round(n[a]);return n};return"conversion"in t&&(e.conversion=t.conversion),e}function u(t){if(t){var e=/^#([a-fA-F0-9]{3,4})$/i,n=/^#([a-fA-F0-9]{6}([a-fA-F0-9]{2})?)$/i,i=/^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i,a=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i,r=/(\w+)/,o=[0,0,0],l=1,s=t.match(e),u="";if(s){s=s[1],u=s[3];for(var d=0;d<o.length;d++)o[d]=parseInt(s[d]+s[d],16);u&&(l=Math.round(parseInt(u+u,16)/255*100)/100)}else if(s=t.match(n)){u=s[2],s=s[1];for(d=0;d<o.length;d++)o[d]=parseInt(s.slice(2*d,2*d+2),16);u&&(l=Math.round(parseInt(u,16)/255*100)/100)}else if(s=t.match(i)){for(d=0;d<o.length;d++)o[d]=parseInt(s[d+1]);l=parseFloat(s[4])}else if(s=t.match(a)){for(d=0;d<o.length;d++)o[d]=Math.round(2.55*parseFloat(s[d+1]));l=parseFloat(s[4])}else if(s=t.match(r)){if("transparent"==s[1])return[0,0,0,0];if(o=Qe[s[1]],!o)return}for(d=0;d<o.length;d++)o[d]=M(o[d],0,255);return l=l||0==l?M(l,0,1):1,o[3]=l,o}}function d(t){if(t){var e=/^hsla?\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/,n=t.match(e);if(n){var i=parseFloat(n[4]),a=M(parseInt(n[1]),0,360),r=M(parseFloat(n[2]),0,100),o=M(parseFloat(n[3]),0,100),l=M(isNaN(i)?1:i,0,1);return[a,r,o,l]}}}function c(t){if(t){var e=/^hwb\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/,n=t.match(e);if(n){var i=parseFloat(n[4]),a=M(parseInt(n[1]),0,360),r=M(parseFloat(n[2]),0,100),o=M(parseFloat(n[3]),0,100),l=M(isNaN(i)?1:i,0,1);return[a,r,o,l]}}}function h(t){var e=u(t);return e&&e.slice(0,3)}function f(t){var e=d(t);return e&&e.slice(0,3)}function g(t){var e=u(t);return e?e[3]:(e=d(t))?e[3]:(e=c(t))?e[3]:void 0}function p(t,e){e=void 0!==e&&3===t.length?e:t[3];return"#"+S(t[0])+S(t[1])+S(t[2])+(e>=0&&e<1?S(Math.round(255*e)):"")}function m(t,e){return e<1||t[3]&&t[3]<1?v(t,e):"rgb("+t[0]+", "+t[1]+", "+t[2]+")"}function v(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"rgba("+t[0]+", "+t[1]+", "+t[2]+", "+e+")"}function b(t,e){if(e<1||t[3]&&t[3]<1)return x(t,e);var n=Math.round(t[0]/255*100),i=Math.round(t[1]/255*100),a=Math.round(t[2]/255*100);return"rgb("+n+"%, "+i+"%, "+a+"%)"}function x(t,e){var n=Math.round(t[0]/255*100),i=Math.round(t[1]/255*100),a=Math.round(t[2]/255*100);return"rgba("+n+"%, "+i+"%, "+a+"%, "+(e||t[3]||1)+")"}function y(t,e){return e<1||t[3]&&t[3]<1?_(t,e):"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)"}function _(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+e+")"}function k(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+(void 0!==e&&1!==e?"
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]},Xe=e(function(t){function e(t,e){return Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)+Math.pow(t[2]-e[2],2)}var n={};for(var i in Ge)Ge.hasOwnProperty(i)&&(n[Ge[i]]=i);var a=t.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 r in a)if(a.hasOwnProperty(r)){if(!("channels"in a[r]))throw new Error("missing channels property: "+r);if(!("labels"in a[r]))throw new Error("missing channel labels property: "+r);if(a[r].labels.length!==a[r].channels)throw new Error("channel and label counts mismatch: "+r);var o=a[r].channels,l=a[r].labels;delete a[r].channels,delete a[r].labels,Object.defineProperty(a[r],"channels",{value:o}),Object.defineProperty(a[r],"labels",{value:l})}a.rgb.hsl=function(t){var e,n,i,a=t[0]/255,r=t[1]/255,o=t[2]/255,l=Math.min(a,r,o),s=Math.max(a,r
i=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",e,"important"),t.prevTextDirection=i)},Dn=function(t){var e=t.prevTextDirection;void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))},Tn={getRtlAdapter:Pn,overrideTextDirection:An,restoreTextDirection:Dn},In=sn,Fn=dn,On=bn,Ln=kn,Rn=Mn,zn=Tn;In.easing=Fn,In.canvas=On,In.options=Ln,In.math=Rn,In.rtl=zn;var Nn=function(t){In.extend(this,t),this.initialize.apply(this,arguments)};In.extend(Nn.prototype,{_type:void 0,initialize:function(){this.hidden=!1},pivot:function(){var t=this;return t._view||(t._view=In.extend({},t._model)),t._start={},t},transition:function(t){var e=this,n=e._model,i=e._start,a=e._view;return n&&1!==t?(a||(a=e._view={}),i||(i=e._start={}),P(i,a,n,t),e):(e._view=In.extend({},n),e._start=null,e)},tooltipPosition:function(){return{x:this._model.x,y:this._model.y}},hasValue:function(){return In.isNumber(this._model.x)&&In.isNumber(this._model.y)}}),Nn.extend=In.inherits;var Bn=Nn,En=Bn.extend({chart:null,currentStep:0,numSteps:60,easing:"",render:null,onAnimationProgress:null,onAnimationComplete:null}),Wn=En;Object.defineProperty(En.prototype,"animationObject",{get:function(){return this}}),Object.defineProperty(En.prototype,"chartInstance",{get:function(){return this.chart},set:function(t){this.chart=t}}),yn._set("global",{animation:{duration:1e3,easing:"easeOutQuart",onProgress:In.noop,onComplete:In.noop}});var Vn={animations:[],request:null,addAnimation:function(t,e,n,i){var a,r,o=this.animations;for(e.chart=t,e.startTime=Date.now(),e.duration=n,i||(t.animating=!0),a=0,r=o.length;a<r;++a)if(o[a].chart===t)return void(o[a]=e);o.push(e),1===o.length&&this.requestAnimationFrame()},cancelAnimation:function(t){var e=In.findIndex(this.animations,function(e){return e.chart===t});-1!==e&&(this.animations.splice(e,1),t.animating=!1)},requestAnimationFrame:function(){var t=this;null===t.request&&(t.request=In.requestAnimFrame.call(window,function(){t.request=null,t.startDigest()}))},startDigest:function(){var t=this;t.advance(),t.animations.length>0&&t.requestAnimationFrame()},advance:function(){for(var t,e,n,i,a=this.animations,r=0;r<a.length;)t=a[r],e=t.chart,n=t.numSteps,i=Math.floor((Date.now()-t.startTime)/t.duration*n)+1,t.currentStep=Math.min(i,n),In.callback(t.render,[e,t],e),In.callback(t.onAnimationProgress,[t],e),t.currentStep>=n?(In.callback(t.onAnimationComplete,[t],e),e.animating=!1,a.splice(r,1)):++r}},Hn=In.options.resolve,jn=["push","pop","shift","splice","unshift"],qn=function(t,e){this.initialize(t,e)};In.extend(qn.prototype,{datasetElementType:null,dataElementType:null,_datasetElementOptions:["backgroundColor","borderCapStyle","borderColor","borderDash","borderDashOffset","borderJoinStyle","borderWidth"],_dataElementOptions:["backgroundColor","borderColor","borderWidth","pointStyle"],initialize:function(t,e){var n=this;n.chart=t,n.index=e,n.linkScales(),n.addElements(),n._type=n.getMeta().type},updateIndex:function(t){this.index=t},linkScales:function(){var t=this,e=t.getMeta(),n=t.chart,i=n.scales,a=t.getDataset(),r=n.options.scales;null!==e.xAxisID&&e.xAxisID in i&&!a.xAxisID||(e.xAxisID=a.xAxisID||r.xAxes[0].id),null!==e.yAxisID&&e.yAxisID in i&&!a.yAxisID||(e.yAxisID=a.yAxisID||r.yAxes[0].id)},getDataset:function(){return this.chart.data.datasets[this.index]},getMeta:function(){return this.chart.getDatasetMeta(this.index)},getScaleForId:function(t){return this.chart.scales[t]},_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&&D(this._data,this)},createMetaDataset:function(){var t=this,e=t.datasetElementType;return e&&new e({_chart:t.chart,_datasetIndex:t.index})},createMetaData:function(t){var e=this,n=e.dataElementType;return n&&new n({_chart:e.chart,_datasetIndex:e.index
t.innerRadius=t.outerRadius-e.radiusLength},updateElement:function(t,e,n){var i=this,a=i.chart,r=i.getDataset(),o=a.options,l=o.animation,s=a.scale,u=a.data.labels,d=s.xCenter,c=s.yCenter,h=o.startAngle,f=t.hidden?0:s.getDistanceFromCenterForValue(r.data[e]),g=i._starts[e],p=g+(t.hidden?0:i._angles[e]),m=l.animateScale?0:s.getDistanceFromCenterForValue(r.data[e]),v=t._options||{};In.extend(t,{_datasetIndex:i.index,_index:e,_scale:s,_model:{backgroundColor:v.backgroundColor,borderColor:v.borderColor,borderWidth:v.borderWidth,borderAlign:v.borderAlign,x:d,y:c,innerRadius:0,outerRadius:n?m:f,startAngle:n&&l.animateRotate?h:g,endAngle:n&&l.animateRotate?h:p,label:In.valueAtIndexOrDefault(u,e,u[e])}}),t.pivot()},countVisibleElements:function(){var t=this.getDataset(),e=this.getMeta(),n=0;return In.each(e.data,function(e,i){isNaN(t.data[i])||e.hidden||n++}),n},setHoverStyle:function(t){var e=t._model,n=t._options,i=In.getHoverColor,a=In.valueOrDefault;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth},e.backgroundColor=a(n.hoverBackgroundColor,i(n.backgroundColor)),e.borderColor=a(n.hoverBorderColor,i(n.borderColor)),e.borderWidth=a(n.hoverBorderWidth,n.borderWidth)},_computeAngle:function(t){var e=this,n=this.getMeta().count,i=e.getDataset(),a=e.getMeta();if(isNaN(i.data[t])||a.data[t].hidden)return 0;var r={chart:e.chart,dataIndex:t,dataset:i,datasetIndex:e.index};return wi([e.chart.options.elements.arc.angle,2*Math.PI/n],r,t)}});yn._set("pie",In.clone(yn.doughnut)),yn._set("pie",{cutoutPercentage:0});var Si=vi,Ci=In.valueOrDefault;yn._set("radar",{spanGaps:!1,scale:{type:"radialLinear"},elements:{line:{fill:"start",tension:0}}});var Pi=Un.extend({datasetElementType:ni.Line,dataElementType:ni.Point,linkScales:In.noop,_datasetElementOptions:["backgroundColor","borderWidth","borderColor","borderCapStyle","borderDash","borderDashOffset","borderJoinStyle","fill"],_dataElementOptions:{backgroundColor:"pointBackgroundColor",borderColor:"pointBorderColor",borderWidth:"pointBorderWidth",hitRadius:"pointHitRadius",hoverBackgroundColor:"pointHoverBackgroundColor",hoverBorderColor:"pointHoverBorderColor",hoverBorderWidth:"pointHoverBorderWidth",hoverRadius:"pointHoverRadius",pointStyle:"pointStyle",radius:"pointRadius",rotation:"pointRotation"},_getIndexScaleId:function(){return this.chart.scale.id},_getValueScaleId:function(){return this.chart.scale.id},update:function(t){var e,n,i=this,a=i.getMeta(),r=a.dataset,o=a.data||[],l=i.chart.scale,s=i._config;for(void 0!==s.tension&&void 0===s.lineTension&&(s.lineTension=s.tension),r._scale=l,r._datasetIndex=i.index,r._children=o,r._loop=!0,r._model=i._resolveDatasetElementOptions(r),r.pivot(),e=0,n=o.length;e<n;++e)i.updateElement(o[e],e,t);for(i.updateBezierControlPoints(),e=0,n=o.length;e<n;++e)o[e].pivot()},updateElement:function(t,e,n){var i=this,a=t.custom||{},r=i.getDataset(),o=i.chart.scale,l=o.getPointPositionForValue(e,r.data[e]),s=i._resolveDataElementOptions(t,e),u=i.getMeta().dataset._model,d=n?o.xCenter:l.x,c=n?o.yCenter:l.y;t._scale=o,t._options=s,t._datasetIndex=i.index,t._index=e,t._model={x:d,y:c,skip:a.skip||isNaN(d)||isNaN(c),radius:s.radius,pointStyle:s.pointStyle,rotation:s.rotation,backgroundColor:s.backgroundColor,borderColor:s.borderColor,borderWidth:s.borderWidth,tension:Ci(a.tension,u?u.tension:0),hitRadius:s.hitRadius}},_resolveDatasetElementOptions:function(){var t=this,e=t._config,n=t.chart.options,i=Un.prototype._resolveDatasetElementOptions.apply(t,arguments);return i.spanGaps=Ci(e.spanGaps,n.spanGaps),i.tension=Ci(e.lineTension,n.elements.line.tension),i},updateBezierControlPoints:function(){function t(t,e,n){return Math.max(Math.min(t,n),e)}var e,n,i,a,r=this,o=r.getMeta(),l=r.chart.chartArea,s=o.data||[];for(o.dataset._model.spanGaps&&(s=s.filter(function(t){return!t._model.skip})),e=0,n=s.length;e<n;++e)i=s[e]._model,a=In.splineCurve(In.previousItem(s,e,!0)._model,i,In.nextItem(s,e,!0)._model,i.tension),i.controlPointPreviousX=t(a.previous.x,l.left,l.right),i.controlPointPreviousY=t(a.previous.y,l.top,
!n||n.model.skip?i.mK=i.deltaK:!a||a.model.skip?i.mK=n.deltaK:this.sign(n.deltaK)!==this.sign(i.deltaK)?i.mK=0:i.mK=(n.deltaK+i.deltaK)/2}for(e=0;e<c-1;++e)i=d[e],a=d[e+1],i.model.skip||a.model.skip||(In.almostEquals(i.deltaK,0,this.EPSILON)?i.mK=a.mK=0:(r=i.mK/i.deltaK,o=a.mK/i.deltaK,s=Math.pow(r,2)+Math.pow(o,2),s<=9||(l=3/Math.sqrt(s),i.mK=r*l*i.deltaK,a.mK=o*l*i.deltaK)));for(e=0;e<c;++e)i=d[e],i.model.skip||(n=e>0?d[e-1]:null,a=e<c-1?d[e+1]:null,n&&!n.model.skip&&(u=(i.model.x-n.model.x)/3,i.model.controlPointPreviousX=i.model.x-u,i.model.controlPointPreviousY=i.model.y-u*i.mK),a&&!a.model.skip&&(u=(a.model.x-i.model.x)/3,i.model.controlPointNextX=i.model.x+u,i.model.controlPointNextY=i.model.y+u*i.mK))},In.nextItem=function(t,e,n){return n?e>=t.length-1?t[0]:t[e+1]:e>=t.length-1?t[t.length-1]:t[e+1]},In.previousItem=function(t,e,n){return n?e<=0?t[t.length-1]:t[e-1]:e<=0?t[0]:t[e-1]},In.niceNum=function(t,e){var n,i=Math.floor(In.log10(t)),a=t/Math.pow(10,i);return n=e?a<1.5?1:a<3?2:a<7?5:10:a<=1?1:a<=2?2:a<=5?5:10,n*Math.pow(10,i)},In.requestAnimFrame="undefined"==typeof window?function(t){t()}:window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)},In.getRelativePosition=function(t,e){var n,i,a=t.originalEvent||t,r=t.target||t.srcElement,o=r.getBoundingClientRect(),l=a.touches;l&&l.length>0?(n=l[0].clientX,i=l[0].clientY):(n=a.clientX,i=a.clientY);var s=parseFloat(In.getStyle(r,"padding-left")),u=parseFloat(In.getStyle(r,"padding-top")),d=parseFloat(In.getStyle(r,"padding-right")),c=parseFloat(In.getStyle(r,"padding-bottom")),h=o.right-o.left-s-d,f=o.bottom-o.top-u-c;return n=Math.round((n-o.left-s)/h*r.width/e.currentDevicePixelRatio),i=Math.round((i-o.top-u)/f*r.height/e.currentDevicePixelRatio),{x:n,y:i}},In.getConstraintWidth=function(t){return n(t,"max-width","clientWidth")},In.getConstraintHeight=function(t){return n(t,"max-height","clientHeight")},In._calculatePadding=function(t,e,n){return e=In.getStyle(t,e),e.indexOf("%")>-1?n*parseInt(e,10)/100:parseInt(e,10)},In._getParentNode=function(t){var e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e},In.getMaximumWidth=function(t){var e=In._getParentNode(t);if(!e)return t.clientWidth;var n=e.clientWidth,i=In._calculatePadding(e,"padding-left",n),a=In._calculatePadding(e,"padding-right",n),r=n-i-a,o=In.getConstraintWidth(t);return isNaN(o)?r:Math.min(r,o)},In.getMaximumHeight=function(t){var e=In._getParentNode(t);if(!e)return t.clientHeight;var n=e.clientHeight,i=In._calculatePadding(e,"padding-top",n),a=In._calculatePadding(e,"padding-bottom",n),r=n-i-a,o=In.getConstraintHeight(t);return isNaN(o)?r:Math.min(r,o)},In.getStyle=function(t,e){return t.currentStyle?t.currentStyle[e]:document.defaultView.getComputedStyle(t,null).getPropertyValue(e)},In.retinaScale=function(t,e){var n=t.currentDevicePixelRatio=e||"undefined"!=typeof window&&window.devicePixelRatio||1;if(1!==n){var i=t.canvas,a=t.height,r=t.width;i.height=a*n,i.width=r*n,t.ctx.scale(n,n),i.style.height||i.style.width||(i.style.height=a+"px",i.style.width=r+"px")}},In.fontString=function(t,e,n){return e+" "+t+"px "+n},In.longestText=function(t,e,n,i){i=i||{};var a=i.data=i.data||{},r=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(a=i.data={},r=i.garbageCollect=[],i.font=e),t.font=e;var o,l,s,u,d,c=0,h=n.length;for(o=0;o<h;o++)if(u=n[o],null!=u&&!0!==In.isArray(u))c=In.measureText(t,a,r,c,u);else if(In.isArray(u))for(l=0,s=u.length;l<s;l++)d=u[l],null==d||In.isArray(d)||(c=In.measureText(t,a,r,c,d));var f=r.length/2;if(f>n.length){for(o=0;o<f;o++)delete a[r[o]];r.splice(0,f)}return c},In.measureText=function(t,e,n,i,a){var r=e[a];return r||(r=e[a]=t.measureText(a).width,n.push(a)),r>i&&(i=r),i},In.numberOfLabelLines=function(t){var e=1;return In.each(t,function(t){In.isArray(t)&&t.length>e&&(e=t.length)}),e},In.color=on?function(t){return t instanceof CanvasGradient&&(t=yn.global.defaultColor),on(t)}:function(t){return
o||(g=g.concat(m),o=!0);else p[t]=[];m.length&&(h=Math.min(h,m[0]),f=Math.max(f,m[m.length-1])),g.length&&(g=n>1?ye(g).sort(xe):g.sort(xe),h=Math.min(h,g[0]),f=Math.max(f,g[g.length-1])),h=Pe(l,_e(d))||h,f=Pe(l,ke(d))||f,h=h===ja?+u.startOf(Date.now(),c):h,f=f===Ha?+u.endOf(Date.now(),c)+1:f,l.min=Math.min(h,f),l.max=Math.max(h+1,f),l._table=[],l._timestamps={data:g,datasets:p,labels:m}},buildTicks:function(){var t,e,n,i=this,a=i.min,r=i.max,o=i.options,l=o.ticks,s=o.time,u=i._timestamps,d=[],c=i.getLabelCapacity(a),h=l.source,f=o.distribution;for(u="data"===h||"auto"===h&&"series"===f?u.data:"labels"===h?u.labels:Ie(i,a,r,c),"ticks"===o.bounds&&u.length&&(a=u[0],r=u[u.length-1]),a=Pe(i,_e(o))||a,r=Pe(i,ke(o))||r,t=0,e=u.length;t<e;++t)n=u[t],n>=a&&n<=r&&d.push(n);return i.min=a,i.max=r,i._unit=s.unit||(l.autoSkip?Ae(s.minUnit,i.min,i.max,c):De(i,d.length,s.minUnit,i.min,i.max)),i._majorUnit=l.major.enabled&&"year"!==i._unit?Te(i._unit):void 0,i._table=we(i._timestamps.data,a,r,f),i._offsets=Fe(i._table,d,a,r,o),l.reverse&&d.reverse(),Le(i,d,i._majorUnit)},getLabelForIndex:function(t,e){var n=this,i=n._adapter,a=n.chart.data,r=n.options.time,o=a.labels&&t<a.labels.length?a.labels[t]:"",l=a.datasets[e].data[t];return In.isObject(l)&&(o=n.getRightValue(l)),r.tooltipFormat?i.format(Ce(n,o),r.tooltipFormat):"string"==typeof o?o:i.format(Ce(n,o),r.displayFormats.datetime)},tickFormatFunction:function(t,e,n,i){var a=this,r=a._adapter,o=a.options,l=o.time.displayFormats,s=l[a._unit],u=a._majorUnit,d=l[u],c=n[e],h=o.ticks,f=u&&d&&c&&c.major,g=r.format(t,i||(f?d:s)),p=f?h.major:h.minor,m=Wa([p.callback,p.userCallback,h.callback,h.userCallback]);return m?m(g,e,n):g},convertTicksToLabels:function(t){var e,n,i=[];for(e=0,n=t.length;e<n;++e)i.push(this.tickFormatFunction(t[e].value,e,t));return i},getPixelForOffset:function(t){var e=this,n=e._offsets,i=Se(e._table,"time",t,"pos");return e.getPixelForDecimal((n.start+i)*n.factor)},getPixelForValue:function(t,e,n){var i=this,a=null;if(void 0!==e&&void 0!==n&&(a=i._timestamps.datasets[n][e]),null===a&&(a=Pe(i,t)),null!==a)return i.getPixelForOffset(a)},getPixelForTick:function(t){var e=this.getTicks();return t>=0&&t<e.length?this.getPixelForOffset(e[t].value):null},getValueForPixel:function(t){var e=this,n=e._offsets,i=e.getDecimalForPixel(t)/n.factor-n.end,a=Se(e._table,"pos",i,"time");return e._adapter._create(a)},_getLabelSize:function(t){var e=this,n=e.options.ticks,i=e.ctx.measureText(t).width,a=In.toRadians(e.isHorizontal()?n.maxRotation:n.minRotation),r=Math.cos(a),o=Math.sin(a),l=Va(n.fontSize,yn.global.defaultFontSize);return{w:i*r+l*o,h:i*o+l*r}},getLabelWidth:function(t){return this._getLabelSize(t).w},getLabelCapacity:function(t){var e=this,n=e.options.time,i=n.displayFormats,a=i[n.unit]||i.millisecond,r=e.tickFormatFunction(t,0,Le(e,[t],e._majorUnit),a),o=e._getLabelSize(r),l=Math.floor(e.isHorizontal()?e.width/o.w:e.height/o.h);return e.options.offset&&l--,l>0?l:1}}),Xa=Ya;Ga._defaults=Xa;var Ka={category:ba,linear:Ca,logarithmic:Ia,radialLinear:Na,time:Ga},Za={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"};sa._date.override("function"==typeof t?{_id:"moment",formats:function(){return Za},parse:function(e,n){return"string"==typeof e&&"string"==typeof n?e=t(e,n):e instanceof t||(e=t(e)),e.isValid()?e.valueOf():null},format:function(e,n){return t(e).format(n)},add:function(e,n,i){return t(e).add(n,i).valueOf()},diff:function(e,n,i){return t(e).diff(t(n),i)},startOf:function(e,n,i){return e=t(e),"isoWeek"===n?e.isoWeekday(i).valueOf():e.startOf(n).valueOf()},endOf:function(e,n){return t(e).endOf(n).valueOf()},_create:function(e){return t(e)}}:{}),yn._set("global",{plugins:{filler:{propagate:!0}}});var $a={dataset:function(t){var e=t.fill,n=t.chart,i=n.getDatasetMeta(e),a=i&&n.isDatasetVisible(e),r=a&&i.dataset._children||[],o=r.length||0;return o?function(t,e){return e<o&&r[e]._view||null}:null},boundary:function(t){var e=t.boundary,n=e?e.x:nu