@kevinburke/flot 5.1.0 → 5.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- !function(e){"use strict";var t={getPageXY:function(e){var t=document.documentElement;return{X:e.clientX+(window.pageXOffset||t.scrollLeft)-(t.clientLeft||0),Y:e.clientY+(window.pageYOffset||t.scrollTop)-(t.clientTop||0)}},getPixelRatio:function(e){return(window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)},isSafari:function(){var e=window.top;return!!e&&(/constructor/i.test(e.HTMLElement)||"[object SafariRemoteNotification]"===(!e.safari||void 0!==e.safari&&e.safari.pushNotification).toString())},isMobileSafari:function(){return navigator.userAgent.match(/(iPod|iPhone|iPad)/)&&navigator.userAgent.match(/AppleWebKit/)},isOpera:function(){return!!window.opr&&!!window.opr.addons||!!window.opera||navigator.userAgent.indexOf(" OPR/")>=0},isFirefox:function(){return"undefined"!=typeof InstallTrigger},isIE:function(){return!!document.documentMode},isEdge:function(){return!t.isIE()&&!!window.StyleMedia},isChrome:function(){return!!window.chrome&&!!window.chrome.webstore},isBlink:function(){return(t.isChrome()||t.isOpera())&&!!window.CSS}};function n(e){if(!e||"[object Object]"!==Object.prototype.toString.call(e))return!1;var t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}function o(e){if(Array.isArray(e))return e.map(o);if(n(e)){for(var t={},i=Object.keys(e),a=0;a<i.length;a++){var r=i[a],s=e[r];void 0!==s&&(t[r]=o(s))}return t}return e}function i(e,t){var a=Array.prototype.slice.call(arguments,2);"boolean"!=typeof e&&(a.unshift(t),t=e,e=!1);for(var r=0;r<a.length;r++){var s=a[r];if(null!=s)for(var l=Object.keys(s),c=0;c<l.length;c++){var u=l[c],h=s[u];void 0!==h&&(e&&Array.isArray(h)?t[u]=o(h):e&&n(h)?("object"==typeof t[u]&&null!=t[u]||(t[u]={}),i(!0,t[u],h)):t[u]=h)}}return t}function a(e){return e.clientWidth}function r(e){return e.clientHeight}function s(e,t,n){if(void 0===n)return getComputedStyle(e)[t];e.style[t]="number"==typeof n?n+"px":n}var l=new WeakMap;function c(e,t,n){var o=l.get(e);if(o||(o={},l.set(e,o)),void 0===n)return o[t];o[t]=n}function u(e,t,n){var o=new CustomEvent(t,{detail:n||[],bubbles:!0,cancelable:!0});return e.dispatchEvent(o),o}var h=new WeakMap;function p(e,t,n){e.addEventListener(t,n);var o=h.get(e);o||(o=[],h.set(e,o)),o.push({type:t,handler:n})}function f(e,t,n){var o;if(t&&n)return e.removeEventListener(t,n),void((o=h.get(e))&&h.set(e,o.filter(function(e){return e.type!==t||e.handler!==n})));if(o=h.get(e)){for(var i=[],a=0;a<o.length;a++)t&&o[a].type!==t?i.push(o[a]):e.removeEventListener(o[a].type,o[a].handler);h.set(e,i)}}var d=function(e,n){var o=n.getElementsByClassName(e)[0];if(!o&&((o=document.createElement("canvas")).className=e,o.style.direction="ltr",o.style.position="absolute",o.style.left="0px",o.style.top="0px",n.appendChild(o),!o.getContext))throw new Error("Canvas is not available.");this.element=o;var i=this.context=o.getContext("2d");this.pixelRatio=t.getPixelRatio(i);var s=a(n),l=r(n);this.resize(s,l),this.SVGContainer=null,this.SVG={},this._textCache={}};function m(e,t){e.transform.baseVal.clear(),t&&t.forEach(function(t){e.transform.baseVal.appendItem(t)})}d.prototype.resize=function(e,t){e=e<10?10:e,t=t<10?10:t;var n=this.element,o=this.context,i=this.pixelRatio;this.width!==e&&(n.width=e*i,n.style.width=e+"px",this.width=e),this.height!==t&&(n.height=t*i,n.style.height=t+"px",this.height=t),o.restore(),o.save(),o.scale(i,i)},d.prototype.clear=function(){this.context.clearRect(0,0,this.width,this.height)},d.prototype.render=function(){var e=this._textCache;for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)){var n=this.getSVGLayer(t),o=e[t],i=n.style.display;for(var a in n.style.display="none",o)if(Object.prototype.hasOwnProperty.call(o,a)){var r=o[a];for(var s in r)if(Object.prototype.hasOwnProperty.call(r,s)){for(var l,c=r[s],u=c.positions,h=0;u[h];h++)if((l=u[h]).active)l.rendered||(n.appendChild(l.element),l.rendered=!0);else if(u.splice(h--,1),l.rendered){for(;l.element.firstChild;)l.element.removeChild(l.element.firstChild);l.element.parentNode.removeChild(l.element)}0===u.length&&(c.measured?c.measured=!1:delete r[s])}}n.style.display=i}},d.prototype.getSVGLayer=function(e){var t,n=this.SVG[e];return n||(this.SVGContainer?t=this.SVGContainer.firstChild:(this.SVGContainer=document.createElement("div"),this.SVGContainer.className="flot-svg",this.SVGContainer.style.position="absolute",this.SVGContainer.style.top="0px",this.SVGContainer.style.left="0px",this.SVGContainer.style.height="100%",this.SVGContainer.style.width="100%",this.SVGContainer.style.pointerEvents="none",this.element.parentNode.appendChild(this.SVGContainer),(t=document.createElementNS("http://www.w3.org/2000/svg","svg")).style.width="100%",t.style.height="100%",this.SVGContainer.appendChild(t)),(n=document.createElementNS("http://www.w3.org/2000/svg","g")).setAttribute("class",e),n.style.position="absolute",n.style.top="0px",n.style.left="0px",n.style.bottom="0px",n.style.right="0px",t.appendChild(n),this.SVG[e]=n),n},d.prototype.getTextInfo=function(e,t,n,o,i){var a,r,s,l;t=""+t,a="object"==typeof n?n.style+" "+n.variant+" "+n.weight+" "+n.size+"px/"+n.lineHeight+"px "+n.family:n,null==(r=this._textCache[e])&&(r=this._textCache[e]={}),null==(s=r[a])&&(s=r[a]={});var c=function(e){return e.replace(/0|1|2|3|4|5|6|7|8|9/g,"0")}(t);if(!(l=s[c])){var u=document.createElementNS("http://www.w3.org/2000/svg","text");if(-1!==t.indexOf("<br>"))g(t,u,-9999);else{var h=document.createTextNode(t);u.appendChild(h)}u.style.position="absolute",u.style.maxWidth=i,u.setAttributeNS(null,"x",-9999),u.setAttributeNS(null,"y",-9999),"object"==typeof n?(u.style.font=a,u.style.fill=n.fill):"string"==typeof n&&u.setAttribute("class",n),this.getSVGLayer(e).appendChild(u);var p=u.getBBox();for(l=s[c]={width:p.width,height:p.height,measured:!0,element:u,positions:[]};u.firstChild;)u.removeChild(u.firstChild);u.parentNode.removeChild(u)}return l.measured=!0,l},d.prototype.addText=function(e,t,n,o,i,a,r,s,l,c){var u=this.getTextInfo(e,o,i,a,r),h=u.positions;"center"===s?t-=u.width/2:"right"===s&&(t-=u.width),"middle"===l?n-=u.height/2:"bottom"===l&&(n-=u.height),n+=.75*u.height;for(var p,f=0;h[f];f++){if((p=h[f]).x===t&&p.y===n&&p.text===o)return p.active=!0,void m(p.element,c);if(!1===p.active)return p.active=!0,p.text=o,-1!==o.indexOf("<br>")?(n-=.25*u.height,g(o,p.element,t)):p.element.textContent=o,p.element.setAttributeNS(null,"x",t),p.element.setAttributeNS(null,"y",n),p.x=t,p.y=n,void m(p.element,c)}p={active:!0,rendered:!1,element:h.length?u.element.cloneNode():u.element,text:o,x:t,y:n},h.push(p),-1!==o.indexOf("<br>")?(n-=.25*u.height,g(o,p.element,t)):p.element.textContent=o,p.element.setAttributeNS(null,"x",t),p.element.setAttributeNS(null,"y",n),p.element.style.textAlign=s,m(p.element,c)};var g=function(e,t,n){var o,i,a,r=e.split("<br>");for(i=0;i<r.length;i++)t.childNodes[i]?o=t.childNodes[i]:(o=document.createElementNS("http://www.w3.org/2000/svg","tspan"),t.appendChild(o)),o.textContent=r[i],a=(0===i?0:1)+"em",o.setAttributeNS(null,"dy",a),o.setAttributeNS(null,"x",n)};d.prototype.removeText=function(e,t,n,o,i,a){var r,s;if(null==o){var l=this._textCache[e];if(null!=l)for(var c in l)if(Object.prototype.hasOwnProperty.call(l,c)){var u=l[c];for(var h in u)if(Object.prototype.hasOwnProperty.call(u,h)){var p=u[h].positions;p.forEach(function(e){e.active=!1})}}}else(p=(r=this.getTextInfo(e,o,i,a)).positions).forEach(function(e){s=n+.75*r.height,e.x===t&&e.y===s&&e.text===o&&(e.active=!1)})},d.prototype.clearCache=function(){var e=this._textCache;for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))for(var n=this.getSVGLayer(t);n.firstChild;)n.removeChild(n.firstChild);this._textCache={}};var v={make:function(e,t,n,o){var i={};return i.r=e||0,i.g=t||0,i.b=n||0,i.a=null!=o?o:1,i.add=function(e,t){for(var n=0;n<e.length;++n)i[e.charAt(n)]+=t;return i.normalize()},i.scale=function(e,t){for(var n=0;n<e.length;++n)i[e.charAt(n)]*=t;return i.normalize()},i.toString=function(){return i.a>=1?"rgb("+[i.r,i.g,i.b].join(",")+")":"rgba("+[i.r,i.g,i.b,i.a].join(",")+")"},i.normalize=function(){function e(e,t,n){return t<e?e:t>n?n:t}return i.r=e(0,parseInt(i.r),255),i.g=e(0,parseInt(i.g),255),i.b=e(0,parseInt(i.b),255),i.a=e(0,i.a,1),i},i.clone=function(){return v.make(i.r,i.b,i.g,i.a)},i.normalize()},extract:function(e,t){var n;do{var o=t.replace(/-([a-z])/g,function(e,t){return t.toUpperCase()});if(""!==(n=(e.style[o]||getComputedStyle(e)[t]||"").toLowerCase())&&"transparent"!==n)break;e=e.parentElement}while(null!=e&&"body"!==e.nodeName.toLowerCase());return"rgba(0, 0, 0, 0)"===n&&(n="transparent"),v.parse(n)},parse:function(e){var t,n=v.make;if(t=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(e))return n(parseInt(t[1],10),parseInt(t[2],10),parseInt(t[3],10));if(t=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(e))return n(parseInt(t[1],10),parseInt(t[2],10),parseInt(t[3],10),parseFloat(t[4]));if(t=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)%\s*,\s*([0-9]+(?:\.[0-9]+)?)%\s*,\s*([0-9]+(?:\.[0-9]+)?)%\s*\)/.exec(e))return n(2.55*parseFloat(t[1]),2.55*parseFloat(t[2]),2.55*parseFloat(t[3]));if(t=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)%\s*,\s*([0-9]+(?:\.[0-9]+)?)%\s*,\s*([0-9]+(?:\.[0-9]+)?)%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(e))return n(2.55*parseFloat(t[1]),2.55*parseFloat(t[2]),2.55*parseFloat(t[3]),parseFloat(t[4]));if(t=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(e))return n(parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16));if(t=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(e))return n(parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16));var o=(e||"").trim().toLowerCase();return"transparent"===o?n(255,255,255,0):n((t=x[o]||[0,0,0])[0],t[1],t[2])}},x={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],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],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]},b={saturate:function(e){return e===1/0?Number.MAX_VALUE:e===-1/0?-Number.MAX_VALUE:e},delta:function(e,t,n){return(t-e)/n===1/0?t/n-e/n:(t-e)/n},multiply:function(e,t){return b.saturate(e*t)},multiplyAdd:function(e,t,n){if(isFinite(e*t))return b.saturate(e*t+n);for(var o=n,i=0;i<t;i++)o+=e;return b.saturate(o)},floorInBase:function(e,t){return t*Math.floor(e/t)}},y={SNAPPING_CONSTANT:20,PANHINT_LENGTH_CONSTANT:10,MINOR_TICKS_COUNT_CONSTANT:4,TICK_LENGTH_CONSTANT:10,ZOOM_DISTANCE_MARGIN:25},w=new function(){function e(e,t,n,o,i,a,r,s,l,c,u){var h,p,f,d,m=e+o,g=e+i,v=n,x=t,b=!1;h=p=f=!0,c?(b=p=f=!0,h=!1,x=t+o,v=t+i,(g=e)<(m=n)&&(d=g,g=m,m=d,h=!0,p=!1)):(h=p=f=!0,b=!1,m=e+o,g=e+i,(x=t)<(v=n)&&(d=x,x=v,v=d,b=!0,f=!1)),g<r.min||m>r.max||x<s.min||v>s.max||(m<r.min&&(m=r.min,h=!1),g>r.max&&(g=r.max,p=!1),v<s.min&&(v=s.min,b=!1),x>s.max&&(x=s.max,f=!1),m=r.p2c(m),v=s.p2c(v),g=r.p2c(g),x=s.p2c(x),a&&(l.fillStyle=a(v,x),l.fillRect(m,x,g-m,v-x)),u>0&&(h||p||f||b)&&(l.beginPath(),l.moveTo(m,v),h?l.lineTo(m,x):l.moveTo(m,x),f?l.lineTo(g,x):l.moveTo(g,x),p?l.lineTo(g,v):l.moveTo(g,v),b?l.lineTo(m,v):l.moveTo(m,v),l.stroke()))}function t(e,t,n,o,i){var a=e.fill;if(!a)return null;if(e.fillColor)return i(e.fillColor,n,o,t);var r=v.parse(t);return r.a="number"==typeof a?a:.4,r.normalize(),r.toString()}this.drawSeriesLines=function(e,n,o,i,a,r,s){n.save(),n.translate(o.left,o.top),n.lineJoin="round",e.lines.dashes&&n.setLineDash&&n.setLineDash(e.lines.dashes);var l={format:e.datapoints.format,points:e.datapoints.points,pointsize:e.datapoints.pointsize};e.decimate&&(l.points=e.decimate(e,e.xaxis.min,e.xaxis.max,i,e.yaxis.min,e.yaxis.max,a));var c=e.lines.lineWidth;n.lineWidth=c,n.strokeStyle=e.color;var u=t(e.lines,e.color,0,a,s);u&&(n.fillStyle=u,function(e,t,n,o,i,a){for(var r=e.points,s=e.pointsize,l=o>n.min?Math.min(n.max,o):n.min,c=0,u=1,h=!1,p=0,f=0,d=null,m=null;!(s>0&&c>r.length+s);){var g=r[(c+=s)-s],v=r[c-s+u],x=r[c],b=r[c+u];if(-2===s&&(v=b=l),h){if(s>0&&null!=g&&null==x){f=c,s=-s,u=2;continue}if(s<0&&c===p+s){i.fill(),h=!1,u=1,c=p=f+(s=-s);continue}}if(null!=g&&null!=x){if(a&&(null!==d&&null!==m?(x=g,b=v,g=d,v=m,d=null,m=null,c-=s):v!==b&&g!==x&&(b=v,d=x,m=v)),g<=x&&g<t.min){if(x<t.min)continue;v=(t.min-g)/(x-g)*(b-v)+v,g=t.min}else if(x<=g&&x<t.min){if(g<t.min)continue;b=(t.min-g)/(x-g)*(b-v)+v,x=t.min}if(g>=x&&g>t.max){if(x>t.max)continue;v=(t.max-g)/(x-g)*(b-v)+v,g=t.max}else if(x>=g&&x>t.max){if(g>t.max)continue;b=(t.max-g)/(x-g)*(b-v)+v,x=t.max}if(h||(i.beginPath(),i.moveTo(t.p2c(g),n.p2c(l)),h=!0),v>=n.max&&b>=n.max)i.lineTo(t.p2c(g),n.p2c(n.max)),i.lineTo(t.p2c(x),n.p2c(n.max));else if(v<=n.min&&b<=n.min)i.lineTo(t.p2c(g),n.p2c(n.min)),i.lineTo(t.p2c(x),n.p2c(n.min));else{var y=g,w=x;v<=b&&v<n.min&&b>=n.min?(g=(n.min-v)/(b-v)*(x-g)+g,v=n.min):b<=v&&b<n.min&&v>=n.min&&(x=(n.min-v)/(b-v)*(x-g)+g,b=n.min),v>=b&&v>n.max&&b<=n.max?(g=(n.max-v)/(b-v)*(x-g)+g,v=n.max):b>=v&&b>n.max&&v<=n.max&&(x=(n.max-v)/(b-v)*(x-g)+g,b=n.max),g!==y&&i.lineTo(t.p2c(y),n.p2c(v)),i.lineTo(t.p2c(g),n.p2c(v)),i.lineTo(t.p2c(x),n.p2c(b)),x!==w&&(i.lineTo(t.p2c(x),n.p2c(b)),i.lineTo(t.p2c(w),n.p2c(b)))}}else d=null,m=null}}(l,e.xaxis,e.yaxis,e.lines.fillTowards||0,n,e.lines.steps)),c>0&&function(e,t,n,o,i,a,r){var s=e.points,l=e.pointsize,c=null,u=null,h=0,p=0,f=0,d=0,m=null,g=null,v=0,x=function(e){h=s[e-l],p=s[e-l+1],f=s[e],d=s[e+1]},b=function(){return null!==m&&null!==g?(f=h,d=p,h=m,p=g,m=null,g=null,!0):(p!==d&&h!==f&&(d=p,m=f,g=p),!1)},y=function(){if(p<=d&&p<i.min){if(d<i.min)return!0;h=(i.min-p)/(d-p)*(f-h)+h,p=i.min}else if(d<=p&&d<i.min){if(p<i.min)return!0;f=(i.min-p)/(d-p)*(f-h)+h,d=i.min}},w=function(){if(p>=d&&p>i.max){if(d>i.max)return!0;h=(i.max-p)/(d-p)*(f-h)+h,p=i.max}else if(d>=p&&d>i.max){if(p>i.max)return!0;f=(i.max-p)/(d-p)*(f-h)+h,d=i.max}},T=function(){if(h<=f&&h<o.min){if(f<o.min)return!0;p=(o.min-h)/(f-h)*(d-p)+p,h=o.min}else if(f<=h&&f<o.min){if(h<o.min)return!0;d=(o.min-h)/(f-h)*(d-p)+p,f=o.min}},k=function(){if(h>=f&&h>o.max){if(f>o.max)return!0;p=(o.max-h)/(f-h)*(d-p)+p,h=o.max}else if(f>=h&&f>o.max){if(h>o.max)return!0;d=(o.max-h)/(f-h)*(d-p)+p,f=o.max}},M=function(){h===c&&p===u||a.moveTo(o.p2c(h)+0,i.p2c(p)+0),c=f,u=d,a.lineTo(o.p2c(f)+0,i.p2c(d)+0)};for(a.beginPath(),v=l;v<s.length;v+=l)x(v),null!==h&&null!==f?isNaN(h)||isNaN(f)||isNaN(p)||isNaN(d)?(c=null,u=null):(r&&b()&&(v-=l),y()||w()||T()||k()||M()):(m=null,g=null);null!==m&&null!==g&&(x(v),b(),y()||w()||T()||k()||M()),a.stroke()}(l,0,0,e.xaxis,e.yaxis,n,e.lines.steps),n.restore()},this.drawSeriesPoints=function(e,n,o,i,a,r,s){function l(e,t,n,o,i,a){e.moveTo(t+o,n),e.arc(t,n,o,0,i?Math.PI:2*Math.PI,!1)}l.fill=!0,n.save(),n.translate(o.left,o.top);var c={format:e.datapoints.format,points:e.datapoints.points,pointsize:e.datapoints.pointsize};e.decimatePoints&&(c.points=e.decimatePoints(e,e.xaxis.min,e.xaxis.max,i,e.yaxis.min,e.yaxis.max,a));var u,h=e.points.lineWidth,p=e.points.radius,f=e.points.symbol;"circle"===f?u=l:"string"==typeof f&&r&&r[f]?u=r[f]:"function"==typeof r&&(u=r),0===h&&(h=1e-4),n.lineWidth=h,n.fillStyle=t(e.points,e.color,null,null,s),n.strokeStyle=e.color,function(e,t,o,i,a,r,s,l){var c=e.points,u=e.pointsize;n.beginPath();for(var h=0;h<c.length;h+=u){var p=c[h],f=c[h+1];null==p||p<r.min||p>r.max||f<s.min||f>s.max||(p=r.p2c(p),f=s.p2c(f)+0,l(n,p,f,t,a,true))}l.fill&&n.fill(),n.stroke()}(c,p,0,0,!1,e.xaxis,e.yaxis,u),n.restore()},this.drawSeriesBars=function(n,o,i,a,r,s,l){o.save(),o.translate(i.left,i.top);var c,u={format:n.datapoints.format,points:n.datapoints.points,pointsize:n.datapoints.pointsize};n.decimate&&(u.points=n.decimate(n,n.xaxis.min,n.xaxis.max,a)),o.lineWidth=n.bars.lineWidth,o.strokeStyle=n.color;var h=n.bars.barWidth[0]||n.bars.barWidth;switch(n.bars.align){case"left":c=0;break;case"right":c=-h;break;default:c=-h/2}!function(t,i,a,r,s,l){for(var c=t.points,u=t.pointsize,h=n.bars.fillTowards||0,p=h>l.min?Math.min(l.max,h):l.min,f=0;f<c.length;f+=u)if(null!=c[f]){var d=3===u?c[f+2]:p;e(c[f],c[f+1],d,i,a,r,s,l,o,n.bars.horizontal,n.bars.lineWidth)}}(u,c,c+h,n.bars.fill?function(e,o){return t(n.bars,n.color,e,o,l)}:null,n.xaxis,n.yaxis),o.restore()},this.drawBar=e};function T(e){var t,n=[],o=b.saturate(b.floorInBase(e.min,e.tickSize)),i=0,a=Number.NaN;o===-Number.MAX_VALUE&&(n.push(o),o=b.floorInBase(e.min+e.tickSize,e.tickSize));do{t=a,a=b.multiplyAdd(e.tickSize,i,o),n.push(a),++i}while(a<e.max&&a!==t);return n}function k(e,t,n){var o=t.tickDecimals;if(-1!==(""+e).indexOf("e"))return M(e,t,n);n>0&&(t.tickDecimals=n);var i=t.tickDecimals?parseFloat("1e"+t.tickDecimals):1,a=""+Math.round(e*i)/i;if(null!=t.tickDecimals){var r=a.indexOf("."),s=-1===r?0:a.length-r-1;s<t.tickDecimals&&(a=(s?a:a+".")+(""+i).substr(1,t.tickDecimals-s))}return t.tickDecimals=o,a}function M(e,t,n){var o=(""+e).indexOf("e"),i=parseInt((""+e).substr(o+1)),a=-1!==o?i:e>0?Math.floor(Math.log(e)/Math.LN10):0,r=parseFloat("1e"+a),s=e/r;if(n){var l=S(e,n);return(e/r).toFixed(l)+"e"+a}return t.tickDecimals>0?s.toFixed(S(e,t.tickDecimals))+"e"+a:s.toFixed()+"e"+a}function S(e,t){var n=Math.log(Math.abs(e))*Math.LOG10E,o=Math.abs(n+t);return o<=20?Math.floor(o):20}function P(e,t,n,o){var h=[],m={colors:["#edc240","#afd8f8","#cb4b4b","#4da74d","#9440ed"],xaxis:{show:null,position:"bottom",mode:null,font:null,color:null,tickColor:null,transform:null,inverseTransform:null,min:null,max:null,autoScaleMargin:null,autoScale:"exact",windowSize:null,growOnly:null,ticks:null,tickFormatter:null,showTickLabels:"major",labelWidth:null,labelHeight:null,reserveSpace:null,tickLength:null,showMinorTicks:null,showTicks:null,gridLines:null,alignTicksWithAxis:null,tickDecimals:null,tickSize:null,minTickSize:null,offset:{below:0,above:0},boxPosition:{centerX:0,centerY:0}},yaxis:{autoScaleMargin:.02,autoScale:"loose",growOnly:null,position:"left",showTickLabels:"major",offset:{below:0,above:0},boxPosition:{centerX:0,centerY:0}},xaxes:[],yaxes:[],series:{points:{show:!1,radius:3,lineWidth:2,fill:!0,fillColor:"#ffffff",symbol:"circle"},lines:{lineWidth:1,fill:!1,fillColor:null,steps:!1},bars:{show:!1,lineWidth:2,horizontal:!1,barWidth:.8,fill:!0,fillColor:null,align:"left",zero:!0},shadowSize:3,highlightColor:null},grid:{show:!0,aboveData:!1,color:"#545454",backgroundColor:null,borderColor:null,tickColor:null,margin:0,labelMargin:5,axisMargin:8,borderWidth:1,minBorderMargin:null,markings:null,markingsColor:"#f4f4f4",markingsLineWidth:2,clickable:!1,hoverable:!1,autoHighlight:!0,mouseActiveRadius:15},interaction:{redrawOverlayInterval:1e3/60},hooks:{}},g=null,x=null,M=null,S=null,P=null,C=[],L=[],N={left:0,right:0,top:0,bottom:0},E=0,z=0,A={processOptions:[],processRawData:[],processDatapoints:[],processOffset:[],setupGrid:[],adjustSeriesDataRange:[],setRange:[],drawBackground:[],drawSeries:[],drawAxis:[],draw:[],findNearbyItems:[],axisReserveSpace:[],bindEvents:[],drawOverlay:[],resize:[],shutdown:[]},O=this,I={},R=null;O.setData=F,O.setupGrid=_,O.draw=$,O.getPlaceholder=function(){return e},O.getCanvas=function(){return g.element},O.getSurface=function(){return g},O.getEventHolder=function(){return M},O.getPlotOffset=function(){return N},O.width=function(){return E},O.height=function(){return z},O.offset=function(){var e=M.getBoundingClientRect(),t={left:e.left+window.scrollX,top:e.top+window.scrollY};return t.left+=N.left,t.top+=N.top,t},O.getData=function(){return h},O.getAxes=function(){var e={};return C.concat(L).forEach(function(t){t&&(e[t.direction+(1!==t.n?t.n:"")+"axis"]=t)}),e},O.getXAxes=function(){return C},O.getYAxes=function(){return L},O.c2p=function(e){var t,n,o={};for(t=0;t<C.length;++t)(n=C[t])&&n.used&&(o["x"+n.n]=n.c2p(e.left));for(t=0;t<L.length;++t)(n=L[t])&&n.used&&(o["y"+n.n]=n.c2p(e.top));return void 0!==o.x1&&(o.x=o.x1),void 0!==o.y1&&(o.y=o.y1),o},O.p2c=function(e){var t,n,o,i={};for(t=0;t<C.length;++t)if((n=C[t])&&n.used&&(null==e[o="x"+n.n]&&1===n.n&&(o="x"),null!=e[o])){i.left=n.p2c(e[o]);break}for(t=0;t<L.length;++t)if((n=L[t])&&n.used&&(null==e[o="y"+n.n]&&1===n.n&&(o="y"),null!=e[o])){i.top=n.p2c(e[o]);break}return i},O.getOptions=function(){return m},O.triggerRedrawOverlay=he,O.pointOffset=function(e){return{left:parseInt(C[X(e,"x")-1].p2c(+e.x)+N.left,10),top:parseInt(L[X(e,"y")-1].p2c(+e.y)+N.top,10)}},O.shutdown=H,O.destroy=function(){var t,n;H(),t=e,(n=l.get(t))&&delete n.plot,e.innerHTML="",h=[],m=null,g=null,x=null,M=null,S=null,P=null,C=[],L=[],A=null,O=null},O.resize=function(){var t=a(e),n=r(e);g.resize(t,n),x.resize(t,n),Y(A.resize,[t,n])},O.clearTextCache=function(){g.clearCache(),x.clearCache()},O.autoScaleAxis=U,O.computeRangeForDataSeries=function(e,t,n){for(var o=e.datapoints.points,i=e.datapoints.pointsize,a=e.datapoints.format,r=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,l={xmin:r,ymin:r,xmax:s,ymax:s},c=0;c<o.length;c+=i)if(null!==o[c]&&("function"!=typeof n||n(o[c])))for(var u=0;u<i;++u){var h=o[c+u],p=a[u];null!=p&&("function"!=typeof n||n(h))&&(t||p.computeRange)&&h!==1/0&&h!==-1/0&&(!0===p.x&&(h<l.xmin&&(l.xmin=h),h>l.xmax&&(l.xmax=h)),!0===p.y&&(h<l.ymin&&(l.ymin=h),h>l.ymax&&(l.ymax=h)))}return l},O.adjustSeriesDataRange=function(e,t){if(e.bars.show){var n,o=e.bars.barWidth[1];e.datapoints&&e.datapoints.points&&!o&&function(e){var t=[],n=e.datapoints.pointsize,o=Number.MAX_VALUE;e.datapoints.points.length<=n&&(o=1);for(let o=e.bars.horizontal?1:0;o<e.datapoints.points.length;o+=n)isFinite(e.datapoints.points[o])&&null!==e.datapoints.points[o]&&t.push(e.datapoints.points[o]);(t=t.filter(function(e,t,n){return n.indexOf(e)===t})).sort(function(e,t){return e-t});for(let e=1;e<t.length;e++){var i=Math.abs(t[e]-t[e-1]);i<o&&isFinite(i)&&(o=i)}"number"==typeof e.bars.barWidth?e.bars.barWidth=e.bars.barWidth*o:e.bars.barWidth[0]=e.bars.barWidth[0]*o}(e);var i=e.bars.barWidth[0]||e.bars.barWidth;switch(e.bars.align){case"left":n=0;break;case"right":n=-i;break;default:n=-i/2}e.bars.horizontal?(t.ymin+=n,t.ymax+=n+i):(t.xmin+=n,t.xmax+=n+i)}return(e.bars.show&&e.bars.zero||e.lines.show&&e.lines.zero)&&e.datapoints.pointsize<=2&&(t.ymin=Math.min(0,t.ymin),t.ymax=Math.max(0,t.ymax)),t},O.findNearbyItem=function(e,t,n,o,i){var a=le(e,t,n,o,i);return void 0!==a[0]?a[0]:null},O.findNearbyItems=le,O.findNearbyInterpolationPoint=function(e,t,n){var o,i,a,r,s,l,c,u=Number.MAX_VALUE;for(o=0;o<h.length;++o){if(!n(o))continue;var p=h[o].datapoints.points;l=h[o].datapoints.pointsize;const v=p[p.length-l]<p[0]?function(e,t){return e>t}:function(e,t){return t>e};if(!v(e,p[0])){for(i=l;i<p.length&&!v(e,p[i]);i+=l);var f=p[i-l],d=p[i-l+1],m=p[i],g=p[i+1];void 0!==f&&void 0!==m&&void 0!==d&&void 0!==g&&(t=f===m?g:d+(g-d)*(e-f)/(m-f),(a=(r=Math.abs(h[o].xaxis.p2c(m)-e))*r+(s=Math.abs(h[o].yaxis.p2c(g)-t))*s)<u&&(u=a,c=[e,t,o,i]))}}return c?(o=c[2],i=c[3],l=h[o].datapoints.pointsize,f=(p=h[o].datapoints.points)[i-l],d=p[i-l+1],m=p[i],g=p[i+1],{datapoint:[c[0],c[1]],leftPoint:[f,d],rightPoint:[m,g],seriesIndex:o}):null},O.computeValuePrecision=Z,O.computeTickSize=J,O.addEventHandler=function(e,t,n,o){var i=n+e,a=I[i]||[];a.push({event:e,handler:t,eventHolder:n,priority:o}),a.sort((e,t)=>t.priority-e.priority),a.forEach(e=>{f(e.eventHolder,e.event,e.handler),p(e.eventHolder,e.event,e.handler)}),I[i]=a},O.hooks=A;var W=y.MINOR_TICKS_COUNT_CONSTANT,D=y.TICK_LENGTH_CONSTANT;function Y(e,t){t=[O].concat(t);for(var n=0;n<e.length;++n)e[n].apply(this,t)}function F(e){var t=h;h=function(e){for(var t=[],n=0;n<e.length;++n){var o=i(!0,{},m.series);null!=e[n].data?(o.data=e[n].data,delete e[n].data,i(!0,o,e[n]),e[n].data=o.data):o.data=e[n],t.push(o)}return t}(e),function(){var e,t=h.length,n=-1;for(e=0;e<h.length;++e){var o=h[e].color;null!=o&&(t--,"number"==typeof o&&o>n&&(n=o))}t<=n&&(t=n+1);var i,a=[],r=m.colors,s=r.length,l=0,c=Math.max(0,h.length-t);for(e=0;e<t;e++)i=v.parse(r[(c+e)%s]||"#666"),e%s===0&&e&&(l=l>=0?l<.5?-l-.2:0:-l),a[e]=i.scale("rgb",1+l);var u,p=0;for(e=0;e<h.length;++e){if(null==(u=h[e]).color?(u.color=a[p].toString(),++p):"number"==typeof u.color&&(u.color=a[u.color].toString()),null==u.lines.show){var f,d=!0;for(f in u)if(u[f]&&u[f].show){d=!1;break}d&&(u.lines.show=!0)}null==u.lines.zero&&(u.lines.zero=!!u.lines.fill),u.xaxis=G(C,X(u,"x")),u.yaxis=G(L,X(u,"y"))}}(),function(e){var t,n,o,i,a,r,s,l,c,u,p,f,d=Number.POSITIVE_INFINITY,m=Number.NEGATIVE_INFINITY;function g(e,t,n){t<e.datamin&&t!==-1/0&&(e.datamin=t),n>e.datamax&&n!==1/0&&(e.datamax=n)}function v(e,t){return e&&e[t]&&e[t].datapoints&&e[t].datapoints.points?e[t].datapoints.points:[]}for(B().forEach(function(e){!0!==e.options.growOnly?(e.datamin=d,e.datamax=m):(void 0===e.datamin&&(e.datamin=d),void 0===e.datamax&&(e.datamax=m)),e.used=!1}),t=0;t<h.length;++t)(a=h[t]).datapoints={points:[]},0===a.datapoints.points.length&&(a.datapoints.points=v(e,t)),Y(A.processRawData,[a,a.data,a.datapoints]);for(t=0;t<h.length;++t)if(p=(a=h[t]).data,(f=a.datapoints.format)||((f=[]).push({x:!0,y:!1,number:!0,required:!0,computeRange:"none"!==a.xaxis.options.autoScale,defaultValue:null}),f.push({x:!1,y:!0,number:!0,required:!0,computeRange:"none"!==a.yaxis.options.autoScale,defaultValue:null}),(a.stack||a.bars.show||a.lines.show&&a.lines.fill)&&(null!=a.datapoints.pointsize?a.datapoints.pointsize:a.data&&a.data[0]&&a.data[0].length?a.data[0].length:3)>2&&f.push({x:a.bars.horizontal,y:!a.bars.horizontal,number:!0,required:!1,computeRange:"none"!==a.yaxis.options.autoScale,defaultValue:0}),a.datapoints.format=f),a.xaxis.used=a.yaxis.used=!0,null==a.datapoints.pointsize){for(a.datapoints.pointsize=f.length,s=a.datapoints.pointsize,r=a.datapoints.points,n=o=0;n<p.length;++n,o+=s){var x=null==(u=p[n]);if(!x)for(i=0;i<s;++i)l=u[i],(c=f[i])&&(c.number&&null!=l&&(l=+l,isNaN(l)&&(l=null)),null==l&&(c.required&&(x=!0),null!=c.defaultValue&&(l=c.defaultValue))),r[o+i]=l;if(x)for(i=0;i<s;++i)null!=(l=r[o+i])&&(c=f[i]).computeRange&&(c.x&&g(a.xaxis,l,l),c.y&&g(a.yaxis,l,l)),r[o+i]=null}r.length=o}for(t=0;t<h.length;++t)a=h[t],Y(A.processDatapoints,[a,a.datapoints]);for(t=0;t<h.length;++t)if(!(f=(a=h[t]).datapoints.format).every(function(e){return!e.computeRange})){var b=O.adjustSeriesDataRange(a,O.computeRangeForDataSeries(a));Y(A.adjustSeriesDataRange,[a,b]),g(a.xaxis,b.xmin,b.xmax),g(a.yaxis,b.ymin,b.ymax)}B().forEach(function(e){e.datamin===d&&(e.datamin=null),e.datamax===m&&(e.datamax=null)})}(t)}function X(e,t){var n=e[t+"axis"];return"object"==typeof n&&(n=n.n),"number"!=typeof n&&(n=1),n}function B(){return C.concat(L).filter(function(e){return e})}function G(e,t){return e[t-1]||(e[t-1]={n:t,direction:e===C?"x":"y",options:i(!0,{},e===C?m.xaxis:m.yaxis)}),e[t-1]}function H(){R&&window.clearTimeout(R),Y(A.shutdown,[M])}function j(e){function t(e){return e}var n,o,i=e.options.transform||t,a=e.options.inverseTransform;"x"===e.direction?(n=isFinite(i(e.max)-i(e.min))?e.scale=E/Math.abs(i(e.max)-i(e.min)):e.scale=1/Math.abs(b.delta(i(e.min),i(e.max),E)),o=Math.min(i(e.max),i(e.min))):(n=-(n=isFinite(i(e.max)-i(e.min))?e.scale=z/Math.abs(i(e.max)-i(e.min)):e.scale=1/Math.abs(b.delta(i(e.min),i(e.max),z))),o=Math.max(i(e.max),i(e.min))),e.p2c=i===t?function(e){return isFinite(e-o)?(e-o)*n:(e/4-o/4)*n*4}:function(e){var t=i(e);return isFinite(t-o)?(t-o)*n:(t/4-o/4)*n*4},e.c2p=a?function(e){return a(o+e/n)}:function(e){return o+e/n}}function V(e){Y(A.axisReserveSpace,[e]);var t=e.labelWidth,n=e.labelHeight,o=e.options.position,i="x"===e.direction,a=e.options.tickLength,r=e.options.showTicks,s=e.options.showMinorTicks,l=e.options.gridLines,c=m.grid.axisMargin,u=m.grid.labelMargin,h=!0,p=!0,f=!1;(i?C:L).forEach(function(t){t&&(t.show||t.reserveSpace)&&(t===e?f=!0:t.options.position===o&&(f?p=!1:h=!1))}),p&&(c=0),null==a&&(a=D),null==r&&(r=!0),null==s&&(s=!0),null==l&&(l=!!h),isNaN(+a)||(u+=r?+a:0),i?(n+=u,"bottom"===o?(N.bottom+=n+c,e.box={top:g.height-N.bottom,height:n}):(e.box={top:N.top+c,height:n},N.top+=n+c)):(t+=u,"left"===o?(e.box={left:N.left+c,width:t},N.left+=t+c):(N.right+=t+c,e.box={left:g.width-N.right,width:t})),e.position=o,e.tickLength=a,e.showMinorTicks=s,e.showTicks=r,e.gridLines=l,e.box.padding=u,e.innermost=h}function q(e,t,n){"x"===e.direction?("bottom"===e.position&&n(t.bottom)&&(e.box.top-=Math.ceil(t.bottom)),"top"===e.position&&n(t.top)&&(e.box.top+=Math.ceil(t.top))):("left"===e.position&&n(t.left)&&(e.box.left+=Math.ceil(t.left)),"right"===e.position&&n(t.right)&&(e.box.left-=Math.ceil(t.right)))}function _(e){var t,n,o=B(),i=m.grid.show;for(n in N)N[n]=0;for(n in Y(A.processOffset,[N]),N)"object"==typeof m.grid.borderWidth?N[n]+=i?m.grid.borderWidth[n]:0:N[n]+=i?m.grid.borderWidth:0;if(o.forEach(function(t){var n=t.options;t.show=null==n.show?t.used:n.show,t.reserveSpace=null==n.reserveSpace?t.show:n.reserveSpace,function(e){var t=e.options;e.tickFormatter||("function"==typeof t.tickFormatter?e.tickFormatter=function(){var e=Array.prototype.slice.call(arguments);return""+t.tickFormatter.apply(null,e)}:e.tickFormatter=k)}(t),Y(A.setRange,[t,e]),function(e,t){var n="number"==typeof e.options.min?e.options.min:e.min,o="number"==typeof e.options.max?e.options.max:e.max,i=e.options.offset;if(t&&(U(e),n=e.autoScaledMin,o=e.autoScaledMax),(n=(null!=n?n:-1)+(i.below||0))>(o=(null!=o?o:1)+(i.above||0))){var a=n;n=o,o=a,e.options.offset={above:0,below:0}}e.min=b.saturate(n),e.max=b.saturate(o)}(t,e)}),i){E=g.width-N.left-N.right,z=g.height-N.bottom-N.top;var a=o.filter(function(e){return e.show||e.reserveSpace});for(a.forEach(function(e){!function(e){var t,n=e.options;t=K(e.direction,g,n.ticks),e.delta=b.delta(e.min,e.max,t);var o=O.computeValuePrecision(e.min,e.max,e.direction,t,n.tickDecimals);if(e.tickDecimals=Math.max(0,null!=n.tickDecimals?n.tickDecimals:o),e.tickSize=function(e,t,n,o,i){var a=J(e,t,"number"==typeof o.ticks&&o.ticks>0?o.ticks:.3*Math.sqrt("x"===n?g.width:g.height),i);return null!=o.minTickSize&&a<o.minTickSize&&(a=o.minTickSize),o.tickSize||a}(e.min,e.max,e.direction,n,n.tickDecimals),e.tickGenerator||("function"==typeof n.tickGenerator?e.tickGenerator=n.tickGenerator:e.tickGenerator=T),null!=n.alignTicksWithAxis){var i=("x"===e.direction?C:L)[n.alignTicksWithAxis-1];if(i&&i.used&&i!==e){var a=e.tickGenerator(e,O);if(a.length>0&&(null==n.min&&(e.min=Math.min(e.min,a[0])),null==n.max&&a.length>1&&(e.max=Math.max(e.max,a[a.length-1]))),e.tickGenerator=function(e){var t,n,o=[];for(n=0;n<i.ticks.length;++n)t=(i.ticks[n].v-i.min)/(i.max-i.min),t=e.min+t*(e.max-e.min),o.push(t);return o},!e.mode&&null==n.tickDecimals){var r=Math.max(0,1-Math.floor(Math.log(e.delta)/Math.LN10)),s=e.tickGenerator(e,O);s.length>1&&/\..*0$/.test((s[1]-s[0]).toFixed(r))||(e.tickDecimals=r)}}}}(e),function(e){var t,n,o=e.options.ticks,i=[];for(null==o||"number"==typeof o&&o>0?i=e.tickGenerator(e,O):o&&(i="function"==typeof o?o(e):o),e.ticks=[],t=0;t<i.length;++t){var a=null,r=i[t];"object"==typeof r?(n=+r[0],r.length>1&&(a=r[1])):n=+r,isNaN(n)||e.ticks.push(Q(n,a,e,"major"))}}(e),function(e,t,n){"loose"===e.options.autoScale&&t.length>0&&function(e){return e.some(e=>e.datapoints.points.length>0)}(n)&&(e.min=Math.min(e.min,t[0].v),e.max=Math.max(e.max,t[t.length-1].v))}(e,e.ticks,h),j(e),function(e,t){(function(e,t){if("endpoints"===e.options.showTickLabels)return!0;if("all"===e.options.showTickLabels){var n=t.filter(function(t){return t.bars.horizontal?t.yaxis===e:t.xaxis===e}),o=n.some(function(e){return!e.bars.show});return 0===n.length||o}return"major"!==e.options.showTickLabels&&"none"!==e.options.showTickLabels&&void 0})(e,t)&&(e.ticks.unshift(Q(e.min,null,e,"min")),e.ticks.push(Q(e.max,null,e,"max")))}(e,h),function(e){for(var t=e.options,n="none"!==t.showTickLabels&&e.ticks?e.ticks:[],o="major"===t.showTickLabels||"all"===t.showTickLabels,i="endpoints"===t.showTickLabels||"all"===t.showTickLabels,a=t.labelWidth||0,r=t.labelHeight||0,s=e.direction+"Axis "+e.direction+e.n+"Axis",l="flot-"+e.direction+"-axis flot-"+e.direction+e.n+"-axis "+s,c=t.font||"flot-tick-label tickLabel",u=0;u<n.length;++u){var h=n[u],p=h.label;if(h.label&&!(!1===o&&u>0&&u<n.length-1)&&(!1!==i||0!==u&&u!==n.length-1)){"object"==typeof h.label&&(p=h.label.name);var f=g.getTextInfo(l,p,c);a=Math.max(a,f.width),r=Math.max(r,f.height)}}e.labelWidth=t.labelWidth||a,e.labelHeight=t.labelHeight||r}(e)}),t=a.length-1;t>=0;--t)V(a[t]);!function(){var e,t=m.grid.minBorderMargin;if(null==t)for(t=0,e=0;e<h.length;++e)t=Math.max(t,2*(h[e].points.radius+h[e].points.lineWidth/2));var n,o={},i={left:t,right:t,top:t,bottom:t};for(n in B().forEach(function(e){e.reserveSpace&&e.ticks&&e.ticks.length&&("x"===e.direction?(i.left=Math.max(i.left,e.labelWidth/2),i.right=Math.max(i.right,e.labelWidth/2)):(i.bottom=Math.max(i.bottom,e.labelHeight/2),i.top=Math.max(i.top,e.labelHeight/2)))}),i)o[n]=i[n]-N[n];C.concat(L).forEach(function(e){q(e,o,function(e){return e>0})}),N.left=Math.ceil(Math.max(i.left,N.left)),N.right=Math.ceil(Math.max(i.right,N.right)),N.top=Math.ceil(Math.max(i.top,N.top)),N.bottom=Math.ceil(Math.max(i.bottom,N.bottom))}(),a.forEach(function(e){!function(e){"x"===e.direction?(e.box.left=N.left-e.labelWidth/2,e.box.width=g.width-N.left-N.right+e.labelWidth):(e.box.top=N.top-e.labelHeight/2,e.box.height=g.height-N.bottom-N.top+e.labelHeight)}(e)})}if(m.grid.margin){for(n in N){var r=m.grid.margin||0;N[n]+="number"==typeof r?r:r[n]||0}C.concat(L).forEach(function(e){q(e,m.grid.margin,function(e){return null!=e})})}E=g.width-N.left-N.right,z=g.height-N.bottom-N.top,o.forEach(function(e){j(e)}),i&&B().forEach(function(e){var t,n,o,i,a,r,s,l=e.box,c=e.direction+"Axis "+e.direction+e.n+"Axis",u="flot-"+e.direction+"-axis flot-"+e.direction+e.n+"-axis "+c,h=e.options.font||"flot-tick-label tickLabel",p={x:NaN,y:NaN,width:NaN,height:NaN},f=[],d=function(t,c){return!t||!t.label||t.v<e.min||t.v>e.max?p:(r=g.getTextInfo(u,t.label,h),"x"===e.direction?(i="center",n=N.left+e.p2c(t.v),"bottom"===e.position?o=l.top+l.padding-e.boxPosition.centerY:(o=l.top+l.height-l.padding+e.boxPosition.centerY,a="bottom"),s={x:n-r.width/2-3,y:o-3,width:r.width+6,height:r.height+6}):(a="middle",o=N.top+e.p2c(t.v),"left"===e.position?(n=l.left+l.width-l.padding-e.boxPosition.centerX,i="right"):n=l.left+l.padding+e.boxPosition.centerX,s={x:n-r.width/2-3,y:o-3,width:r.width+6,height:r.height+6}),function(e,t){return t.some(function(t){return n=e.x,o=e.y,i=e.x+e.width,a=e.y+e.height,r=t.x,s=t.y,l=t.x+t.width,c=t.y+t.height,(n<=r&&r<=i||r<=n&&n<=l)&&(o<=s&&s<=a||s<=o&&o<=c);var n,o,i,a,r,s,l,c})}(s,c)?p:(g.addText(u,n,o,t.label,h,null,null,i,a),s))};if(g.removeText(u),Y(A.drawAxis,[e,g]),e.show)switch(e.options.showTickLabels){case"none":break;case"endpoints":f.push(d(e.ticks[0],f)),f.push(d(e.ticks[e.ticks.length-1],f));break;case"major":for(f.push(d(e.ticks[0],f)),f.push(d(e.ticks[e.ticks.length-1],f)),t=1;t<e.ticks.length-1;++t)f.push(d(e.ticks[t],f));break;case"all":for(f.push(d(e.ticks[0],[])),f.push(d(e.ticks[e.ticks.length-1],f)),t=1;t<e.ticks.length-1;++t)f.push(d(e.ticks[t],f))}}),Y(A.setupGrid,[])}function U(e){var t,n=e.options,o=n.min,i=n.max,a=e.datamin,r=e.datamax;switch(n.autoScale){case"none":o=+(null!=n.min?n.min:a),i=+(null!=n.max?n.max:r);break;case"loose":if(null!=a&&null!=r){o=a,i=r,t=b.saturate(i-o);var s="number"==typeof n.autoScaleMargin?n.autoScaleMargin:.02;o=b.saturate(o-t*s),i=b.saturate(i+t*s),o<0&&a>=0&&(o=0)}else o=n.min,i=n.max;break;case"exact":o=null!=a?a:n.min,i=null!=r?r:n.max;break;case"sliding-window":r>i&&(i=r,o=Math.max(r-(n.windowSize||100),o))}var l=function(e,t){var n=void 0===e?null:e,o=void 0===t?null:t;if(0===o-n){var i=0===o?1:.01,a=null;null==n&&(a-=i),null!=o&&null==n||(o+=i),null!=a&&(n=a)}return{min:n,max:o}}(o,i);o=l.min,i=l.max,!0===n.growOnly&&"none"!==n.autoScale&&"sliding-window"!==n.autoScale&&(o=o<a?o:null!==a?a:o,i=i>r?i:null!==r?r:i),e.autoScaledMin=o,e.autoScaledMax=i}function Z(e,t,n,o,i){var a=K(n,g,o),r=b.delta(e,t,a),s=-Math.floor(Math.log(r)/Math.LN10);i&&s>i&&(s=i);var l=r/parseFloat("1e"+-s);return l>2.25&&l<3&&(null==i||s+1<=i)&&++s,isFinite(s)?s:0}function J(e,t,n,o){var i=b.delta(e,t,n),a=-Math.floor(Math.log(i)/Math.LN10);o&&a>o&&(a=o);var r,s=parseFloat("1e"+-a),l=i/s;return l<1.5?r=1:l<3?(r=2,l>2.25&&(null==o||a+1<=o)&&(r=2.5)):r=l<7.5?5:10,r*s}function K(e,t,n){return"number"==typeof n&&n>0?n:.3*Math.sqrt("x"===e?t.width:t.height)}function Q(e,t,n,o){if(null===t)switch(o){case"min":case"max":var i=function(e,t){var n=Math.floor(t.p2c(e)),o="x"===t.direction?n+1:n-1;return Z(t.c2p(n),t.c2p(o),t.direction,1)}(e,n);isFinite(i),t=n.tickFormatter(e,n,i,O);break;case"major":t=n.tickFormatter(e,n,void 0,O)}return{v:e,label:t}}function $(){g.clear(),Y(A.drawBackground,[S]);var e=m.grid;e.show&&e.backgroundColor&&(S.save(),S.translate(N.left,N.top),S.fillStyle=fe(m.grid.backgroundColor,z,0,"rgba(255, 255, 255, 0)"),S.fillRect(0,0,E,z),S.restore()),e.show&&!e.aboveData&&re();for(var t=0;t<h.length;++t)Y(A.drawSeries,[S,h[t],t,fe]),se(h[t]);Y(A.draw,[S]),e.show&&e.aboveData&&re(),g.render(),he()}function ee(e,t){for(var n,o,i,a,r=B(),s=0;s<r.length;++s)if((n=r[s]).direction===t&&(e[a=t+n.n+"axis"]||1!==n.n||(a=t+"axis"),e[a])){o=e[a].from,i=e[a].to;break}if(e[a]||(n="x"===t?C[0]:L[0],o=e[t+"1"],i=e[t+"2"]),null!=o&&null!=i&&o>i){var l=o;o=i,i=l}return{from:o,to:i,axis:n}}function te(e){var t=e.box,n=0,o=0;return"x"===e.direction?(n=0,o=t.top-N.top+("top"===e.position?t.height:0)):(o=0,n=t.left-N.left+("left"===e.position?t.width:0)+e.boxPosition.centerX),{x:n,y:o}}function ne(e,t){return e%2!=0?Math.floor(t)+.5:t}function oe(e){S.lineWidth=1;var t=te(e),n=t.x,o=t.y;if(e.show){var i=0,a=0;S.strokeStyle=e.options.color,S.beginPath(),"x"===e.direction?i=E+1:a=z+1,"x"===e.direction?o=ne(S.lineWidth,o):n=ne(S.lineWidth,n),S.moveTo(n,o),S.lineTo(n+i,o+a),S.stroke()}}function ie(e){var t=e.tickLength,n=e.showMinorTicks,o=W,i=te(e),a=i.x,r=i.y,s=0;for(S.strokeStyle=e.options.color,S.beginPath(),s=0;s<e.ticks.length;++s){var l,c=e.ticks[s].v,u=0,h=0,p=0,f=0;if(!isNaN(c)&&c>=e.min&&c<=e.max&&("x"===e.direction?(a=e.p2c(c),h=t,"top"===e.position&&(h=-h)):(r=e.p2c(c),u=t,"left"===e.position&&(u=-u)),"x"===e.direction?a=ne(S.lineWidth,a):r=ne(S.lineWidth,r),S.moveTo(a,r),S.lineTo(a+u,r+h)),!0===n&&s<e.ticks.length-1){var d=e.ticks[s].v,m=(e.ticks[s+1].v-d)/(o+1);for(l=1;l<=o;l++){if("x"===e.direction){if(f=t/2,a=ne(S.lineWidth,e.p2c(d+l*m)),"top"===e.position&&(f=-f),a<0||a>E)continue}else if(p=t/2,r=ne(S.lineWidth,e.p2c(d+l*m)),"left"===e.position&&(p=-p),r<0||r>z)continue;S.moveTo(a,r),S.lineTo(a+p,r+f)}}}S.stroke()}function ae(e){var t,n=function(t){var n=m.grid.borderWidth;return("object"==typeof n&&n[e.position]>0||n>0)&&(t===e.min||t===e.max)};for(S.strokeStyle=m.grid.tickColor,S.beginPath(),t=0;t<e.ticks.length;++t){var o=e.ticks[t].v,i=0,a=0,r=0,s=0;isNaN(o)||o<e.min||o>e.max||n(o)||("x"===e.direction?(r=e.p2c(o),s=z,a=-z):(r=0,s=e.p2c(o),i=E),"x"===e.direction?r=ne(S.lineWidth,r):s=ne(S.lineWidth,s),S.moveTo(r,s),S.lineTo(r+i,s+a))}S.stroke()}function re(){var e,t;S.save(),S.translate(N.left,N.top),function(){var e,t=m.grid.markings;if(t){if("function"==typeof t&&((e=O.getAxes()).xmin=e.xaxis.min,e.xmax=e.xaxis.max,e.ymin=e.yaxis.min,e.ymax=e.yaxis.max,t=t(e)),!t)return;var n;for(n=0;n<t.length;++n){var o=t[n],i=ee(o,"x"),a=ee(o,"y");if(null==i.from&&(i.from=i.axis.min),null==i.to&&(i.to=i.axis.max),null==a.from&&(a.from=a.axis.min),null==a.to&&(a.to=a.axis.max),!(i.to<i.axis.min||i.from>i.axis.max||a.to<a.axis.min||a.from>a.axis.max)){i.from=Math.max(i.from,i.axis.min),i.to=Math.min(i.to,i.axis.max),a.from=Math.max(a.from,a.axis.min),a.to=Math.min(a.to,a.axis.max);var r=i.from===i.to,s=a.from===a.to;if(!r||!s)if(i.from=Math.floor(i.axis.p2c(i.from)),i.to=Math.floor(i.axis.p2c(i.to)),a.from=Math.floor(a.axis.p2c(a.from)),a.to=Math.floor(a.axis.p2c(a.to)),r||s){var l=o.lineWidth||m.grid.markingsLineWidth,c=l%2?.5:0;S.beginPath(),S.strokeStyle=o.color||m.grid.markingsColor,S.lineWidth=l,r?(S.moveTo(i.to+c,a.from),S.lineTo(i.to+c,a.to)):(S.moveTo(i.from,a.to+c),S.lineTo(i.to,a.to+c)),S.stroke()}else S.fillStyle=o.color||m.grid.markingsColor,S.fillRect(i.from,a.to,i.to-i.from,a.from-a.to)}}}}(),e=B(),t=m.grid.borderWidth;for(var n=0;n<e.length;++n){var o=e[n];o.show&&(oe(o),!0===o.showTicks&&ie(o),!0===o.gridLines&&ae(o))}t&&function(){var e=m.grid.borderWidth,t=m.grid.borderColor;"object"==typeof e||"object"==typeof t?("object"!=typeof e&&(e={top:e,right:e,bottom:e,left:e}),"object"!=typeof t&&(t={top:t,right:t,bottom:t,left:t}),e.top>0&&(S.strokeStyle=t.top,S.lineWidth=e.top,S.beginPath(),S.moveTo(0-e.left,0-e.top/2),S.lineTo(E,0-e.top/2),S.stroke()),e.right>0&&(S.strokeStyle=t.right,S.lineWidth=e.right,S.beginPath(),S.moveTo(E+e.right/2,0-e.top),S.lineTo(E+e.right/2,z),S.stroke()),e.bottom>0&&(S.strokeStyle=t.bottom,S.lineWidth=e.bottom,S.beginPath(),S.moveTo(E+e.right,z+e.bottom/2),S.lineTo(0,z+e.bottom/2),S.stroke()),e.left>0&&(S.strokeStyle=t.left,S.lineWidth=e.left,S.beginPath(),S.moveTo(0-e.left/2,z+e.bottom),S.lineTo(0-e.left/2,0),S.stroke())):(S.lineWidth=e,S.strokeStyle=m.grid.borderColor,S.strokeRect(-e/2,-e/2,E+e,z+e))}(),S.restore()}function se(e){e.lines.show&&w.drawSeriesLines(e,S,N,E,z,O.drawSymbol,fe),e.bars.show&&w.drawSeriesBars(e,S,N,E,z,O.drawSymbol,fe),e.points.show&&w.drawSeriesPoints(e,S,N,E,z,O.drawSymbol,fe)}function le(e,t,n,o,i){for(var a=function(e,t,n,o,i){var a,r=[],s=[],l=o*o+1;for(a=h.length-1;a>=0;--a)if(n(a)){var c=h[a];if(!c.datapoints)return;var u=!1;if(c.lines.show||c.points.show){var p=ce(c,e,t,o,i);p&&(s.push({seriesIndex:a,dataIndex:p.dataIndex,distance:p.distance}),u=!0)}if(c.bars.show&&!u){var f=ue(c,e,t);f>=0&&s.push({seriesIndex:a,dataIndex:f,distance:l})}}for(a=0;a<s.length;a++){var d=s[a].seriesIndex,m=s[a].dataIndex,g=s[a].distance,v=h[d].datapoints.pointsize;r.push({datapoint:h[d].datapoints.points.slice(m*v,(m+1)*v),dataIndex:m,series:h[d],seriesIndex:d,distance:Math.sqrt(g)})}return r}(e,t,n,o,i),r=0;r<h.length;++r)n(r)&&Y(A.findNearbyItems,[e,t,h,r,o,i,a]);return a.sort((e,t)=>void 0===t.distance?-1:void 0===e.distance&&void 0!==t.distance?1:e.distance-t.distance)}function ce(e,t,n,o,i){var a=e.xaxis.c2p(t),r=e.yaxis.c2p(n),s=o/e.xaxis.scale,l=o/e.yaxis.scale,c=e.datapoints.points,u=e.datapoints.pointsize,h=Number.POSITIVE_INFINITY;e.xaxis.options.inverseTransform&&(s=Number.MAX_VALUE),e.yaxis.options.inverseTransform&&(l=Number.MAX_VALUE);for(var p=null,f=0;f<c.length;f+=u){var d=c[f],m=c[f+1];if(null!=d&&!(d-a>s||d-a<-s||m-r>l||m-r<-l)){var g=Math.abs(e.xaxis.p2c(d)-t),v=Math.abs(e.yaxis.p2c(m)-n),x=i?i(g,v):g*g+v*v;x<h&&(h=x,p={dataIndex:f/u,distance:x})}}return p}function ue(e,t,n){var o,i,a=e.bars.barWidth[0]||e.bars.barWidth,r=e.xaxis.c2p(t),s=e.yaxis.c2p(n),l=e.datapoints.points,c=e.datapoints.pointsize;switch(e.bars.align){case"left":o=0;break;case"right":o=-a;break;default:o=-a/2}i=o+a;for(var u=e.bars.fillTowards||0,h=u>e.yaxis.min?Math.min(e.yaxis.max,u):e.yaxis.min,p=-1,f=0;f<l.length;f+=c){var d=l[f],m=l[f+1];if(null!=d){var g=3===c?l[f+2]:h;(e.bars.horizontal?r<=Math.max(g,d)&&r>=Math.min(g,d)&&s>=m+o&&s<=m+i:r>=d+o&&r<=d+i&&s>=Math.min(g,m)&&s<=Math.max(g,m))&&(p=f/c)}}return p}function he(){var e=m.interaction.redrawOverlayInterval;-1!==e?R||(R=window.setTimeout(function(){pe(O)},e)):pe()}function pe(e){if(R=null,P){x.clear(),Y(A.drawOverlay,[P,x]);var t=new CustomEvent("onDrawingDone");e.getEventHolder().dispatchEvent(t),u(e.getPlaceholder(),"drawingdone")}}function fe(e,t,n,o){if("string"==typeof e)return e;for(var i=S.createLinearGradient(0,n,0,t),a=0,r=e.colors.length;a<r;++a){var s=e.colors[a];if("string"!=typeof s){var l=v.parse(o);null!=s.brightness&&(l=l.scale("rgb",s.brightness)),null!=s.opacity&&(l.a*=s.opacity),s=l.toString()}i.addColorStop(a/(r-1),s)}return i}!function(){for(var e={Canvas:d},t=0;t<o.length;++t){var n=o[t];n.init(O,e),n.options&&i(!0,m,n.options)}}(),function(){s(e,"padding",0),Array.from(e.children).filter(function(e){return!e.classList.contains("flot-overlay")&&!e.classList.contains("flot-base")}).forEach(function(e){e.remove()}),"static"===s(e,"position")&&s(e,"position","relative"),g=new d("flot-base",e),x=new d("flot-overlay",e),S=g.context,P=x.context,f(M=x.element);var t=c(e,"plot");t&&(t.shutdown(),x.clear()),c(e,"plot",O)}(),function(t){i(!0,m,t),t&&t.colors&&(m.colors=t.colors),null==m.xaxis.color&&(m.xaxis.color=v.parse(m.grid.color).scale("a",.22).toString()),null==m.yaxis.color&&(m.yaxis.color=v.parse(m.grid.color).scale("a",.22).toString()),null==m.xaxis.tickColor&&(m.xaxis.tickColor=m.grid.tickColor||m.xaxis.color),null==m.yaxis.tickColor&&(m.yaxis.tickColor=m.grid.tickColor||m.yaxis.color),null==m.grid.borderColor&&(m.grid.borderColor=m.grid.color),null==m.grid.tickColor&&(m.grid.tickColor=v.parse(m.grid.color).scale("a",.22).toString());var n,o,a,r=s(e,"font-size"),l=r?+r.replace("px",""):13,c={style:s(e,"font-style"),size:Math.round(.8*l),variant:s(e,"font-variant"),weight:s(e,"font-weight"),family:s(e,"font-family")};for(a=m.xaxes.length||1,n=0;n<a;++n)(o=m.xaxes[n])&&!o.tickColor&&(o.tickColor=o.color),o=i(!0,{},m.xaxis,o),m.xaxes[n]=o,o.font&&(o.font=i({},c,o.font),o.font.color||(o.font.color=o.color),o.font.lineHeight||(o.font.lineHeight=Math.round(1.15*o.font.size)));for(a=m.yaxes.length||1,n=0;n<a;++n)(o=m.yaxes[n])&&!o.tickColor&&(o.tickColor=o.color),o=i(!0,{},m.yaxis,o),m.yaxes[n]=o,o.font&&(o.font=i({},c,o.font),o.font.color||(o.font.color=o.color),o.font.lineHeight||(o.font.lineHeight=Math.round(1.15*o.font.size)));for(n=0;n<m.xaxes.length;++n)G(C,n+1).options=m.xaxes[n];for(n=0;n<m.yaxes.length;++n)G(L,n+1).options=m.yaxes[n];for(var u in B().forEach(function(e){e.boxPosition=e.options.boxPosition||{centerX:0,centerY:0}}),A)m.hooks[u]&&m.hooks[u].length&&(A[u]=A[u].concat(m.hooks[u]));Y(A.processOptions,[m])}(n),F(t),_(!0),$(),Y(A.bindEvents,[M])}var C=[];function L(e,t,n){return new P("string"==typeof e?document.querySelector(e):e,t,n,C)}var N=T;function E(e,t,n,o){if(t.points.errorbars){var i=[{x:!0,number:!0,required:!0},{y:!0,number:!0,required:!0}],a=t.points.errorbars;"x"!==a&&"xy"!==a||(t.points.xerr.asymmetric?(i.push({x:!0,number:!0,required:!0}),i.push({x:!0,number:!0,required:!0})):i.push({x:!0,number:!0,required:!0})),"y"!==a&&"xy"!==a||(t.points.yerr.asymmetric?(i.push({y:!0,number:!0,required:!0}),i.push({y:!0,number:!0,required:!0})):i.push({y:!0,number:!0,required:!0})),o.format=i}}function z(e,t){var n=e.datapoints.points,o=null,i=null,a=null,r=null,s=e.points.xerr,l=e.points.yerr,c=e.points.errorbars;"x"===c||"xy"===c?s.asymmetric?(o=n[t+2],i=n[t+3],"xy"===c&&(l.asymmetric?(a=n[t+4],r=n[t+5]):a=n[t+4])):(o=n[t+2],"xy"===c&&(l.asymmetric?(a=n[t+3],r=n[t+4]):a=n[t+3])):"y"===c&&(l.asymmetric?(a=n[t+2],r=n[t+3]):a=n[t+2]),null==i&&(i=o),null==r&&(r=a);var u=[o,i,a,r];return s.show||(u[0]=null,u[1]=null),l.show||(u[2]=null,u[3]=null),u}function A(e,t,n,o,i,a,r,s,l,c,u){o+=c,i+=c,a+=c,"x"===t.err?(i>n+l?O(e,[[i,o],[Math.max(n+l,u[0]),o]]):r=!1,a<n-l?O(e,[[Math.min(n-l,u[1]),o],[a,o]]):s=!1):(i<o-l?O(e,[[n,i],[n,Math.min(o-l,u[0])]]):r=!1,a>o+l?O(e,[[n,Math.max(o+l,u[1])],[n,a]]):s=!1),l=null!=t.radius?t.radius:l,r&&("-"===t.upperCap?"x"===t.err?O(e,[[i,o-l],[i,o+l]]):O(e,[[n-l,i],[n+l,i]]):"function"==typeof t.upperCap&&("x"===t.err?t.upperCap(e,i,o,l):t.upperCap(e,n,i,l))),s&&("-"===t.lowerCap?"x"===t.err?O(e,[[a,o-l],[a,o+l]]):O(e,[[n-l,a],[n+l,a]]):"function"==typeof t.lowerCap&&("x"===t.err?t.lowerCap(e,a,o,l):t.lowerCap(e,n,a,l)))}function O(e,t){e.beginPath(),e.moveTo(t[0][0],t[0][1]);for(var n=1;n<t.length;n++)e.lineTo(t[n][0],t[n][1]);e.stroke()}function I(e,t){var n=e.getPlotOffset();t.save(),t.translate(n.left,n.top),e.getData().forEach(function(e){e.points.errorbars&&(e.points.xerr.show||e.points.yerr.show)&&function(e,t,n){var o,i=n.datapoints.points,a=n.datapoints.pointsize,r=[n.xaxis,n.yaxis],s=n.points.radius,l=[n.points.xerr,n.points.yerr],c=!1;r[0].p2c(r[0].max)<r[0].p2c(r[0].min)&&(c=!0,o=l[0].lowerCap,l[0].lowerCap=l[0].upperCap,l[0].upperCap=o);var u=!1;r[1].p2c(r[1].min)<r[1].p2c(r[1].max)&&(u=!0,o=l[1].lowerCap,l[1].lowerCap=l[1].upperCap,l[1].upperCap=o);for(var h=0;h<n.datapoints.points.length;h+=a)for(var p=z(n,h),f=0;f<l.length;f++){var d=[r[f].min,r[f].max];if(p[f*l.length]){var m=i[h],g=i[h+1],v=[m,g][f]+p[f*l.length+1],x=[m,g][f]-p[f*l.length];if("x"===l[f].err&&(g>r[1].max||g<r[1].min||v<r[0].min||x>r[0].max))continue;if("y"===l[f].err&&(m>r[0].max||m<r[0].min||v<r[1].min||x>r[1].max))continue;var b=!0,y=!0;v>d[1]&&(b=!1,v=d[1]),x<d[0]&&(y=!1,x=d[0]),("x"===l[f].err&&c||"y"===l[f].err&&u)&&(o=x,x=v,v=o,o=y,y=b,b=o,o=d[0],d[0]=d[1],d[1]=o),m=r[0].p2c(m),g=r[1].p2c(g),v=r[f].p2c(v),x=r[f].p2c(x),d[0]=r[f].p2c(d[0]),d[1]=r[f].p2c(d[1]);var w=l[f].lineWidth?l[f].lineWidth:n.points.lineWidth,T=null!=n.points.shadowSize?n.points.shadowSize:n.shadowSize;if(w>0&&T>0){var k=T/2;t.lineWidth=k,t.strokeStyle="rgba(0,0,0,0.1)",A(t,l[f],m,g,v,x,b,y,s,k+k/2,d),t.strokeStyle="rgba(0,0,0,0.2)",A(t,l[f],m,g,v,x,b,y,s,k/2,d)}t.strokeStyle=l[f].color?l[f].color:n.color,t.lineWidth=w,A(t,l[f],m,g,v,x,b,y,s,0,d)}}}(0,t,e)}),t.restore()}C.push({init:function(e){e.hooks.processRawData.push(E),e.hooks.draw.push(I)},options:{series:{points:{errorbars:null,xerr:{err:"x",show:null,asymmetric:null,upperCap:null,lowerCap:null,color:null,radius:null},yerr:{err:"y",show:null,asymmetric:null,upperCap:null,lowerCap:null,color:null,radius:null}}}},name:"errorbars",version:"1.0"});var R=D(Number.MAX_VALUE,10),W=D(Number.MAX_VALUE,4);function D(e,t){for(var n,o,i=Math.floor(Math.log(e)*Math.LOG10E)-1,a=[],r=-i;r<=i;r++){o=parseFloat("1e"+r);for(var s=1;s<9;s+=t)n=o*s,a.push(n)}return a}var Y=function(e,t,n){var o=[],i=-1,a=-1,r=e.getCanvas(),s=R,l=F(t,e),c=t.max;n||(n=.3*Math.sqrt("x"===t.direction?r.width:r.height)),R.some(function(e,t){return e>=l&&(i=t,!0)}),R.some(function(e,t){return e>=c&&(a=t,!0)}),-1===a&&(a=R.length-1),a-i<=n/4&&s.length!==W.length&&(s=W,i*=2,a*=2);var u,h,p,f=null,d=1/n;if(a-i>=n/4){for(var m=a;m>=i;m--)u=s[m],h=(Math.log(u)-Math.log(l))/(Math.log(c)-Math.log(l)),p=u,null===f?f={pixelCoord:h,idealPixelCoord:h}:Math.abs(h-f.pixelCoord)>=d?f={pixelCoord:h,idealPixelCoord:f.idealPixelCoord-d}:p=null,p&&o.push(p);o.reverse()}else{var g=e.computeTickSize(l,c,n);o=N({min:l,max:c,tickSize:g})}return o},F=function(e,t){var n=e.min,o=e.max;return n<=0&&o<(n=null===e.datamin?e.min=.1:_(t,e))&&(e.max=null!==e.datamax?e.datamax:e.options.max,e.options.offset.below=0,e.options.offset.above=0),n},X=function(e,t,n){var o=e>0?Math.floor(Math.log(e)/Math.LN10):0;if(n)return o>=-4&&o<=7?k(e,t,n):M(e,t,n);if(o>=-4&&o<=7){var i=o<0?e.toFixed(-o):e.toFixed(o+2);if(-1!==i.indexOf(".")){for(var a=i.lastIndexOf("0");a===i.length-1;)a=(i=i.slice(0,-1)).lastIndexOf("0");i.indexOf(".")===i.length-1&&(i=i.slice(0,-1))}return i}return M(e,t)},B=function(e){return e<R[0]&&(e=R[0]),Math.log(e)},G=function(e){return Math.exp(e)},H=function(e){return-e},j=function(e){return-B(e)},V=function(e){return G(-e)};function q(e,t){"log"===t.options.mode&&t.datamin<=0&&(null===t.datamin?t.datamin=.1:t.datamin=_(e,t))}function _(e,t){var n=e.getData().filter(function(e){return e.xaxis===t||e.yaxis===t}).map(function(t){return e.computeRangeForDataSeries(t,null,U)}),o="x"===t.direction?Math.min(.1,n&&n[0]?n[0].xmin:.1):Math.min(.1,n&&n[0]?n[0].ymin:.1);return t.min=o,o}function U(e){return e>0}C.push({init:function(e){e.hooks.processOptions.push(function(e){var t=e.getAxes();Object.keys(t).forEach(function(n){var o=t[n],i=o.options;"log"===i.mode?(o.tickGenerator=function(t){return Y(e,t,11)},"function"!=typeof o.options.tickFormatter&&(o.options.tickFormatter=X),o.options.transform=i.inverted?j:B,o.options.inverseTransform=i.inverted?V:G,o.options.autoScaleMargin=0,e.hooks.setRange.push(q)):i.inverted&&(o.options.transform=H,o.options.inverseTransform=H)})})},options:{xaxis:{}},name:"log",version:"0.1"});var Z=Y,J=function(e,t,n,o,i){var a=o*Math.sqrt(Math.PI)/2;e.rect(t-a,n-a,a+a,a+a)},K=function(e,t,n,o,i){var a=o*Math.sqrt(Math.PI)/2;e.rect(t-a,n-a,a+a,a+a)},Q=function(e,t,n,o,i){var a=o*Math.sqrt(Math.PI/2);e.moveTo(t-a,n),e.lineTo(t,n-a),e.lineTo(t+a,n),e.lineTo(t,n+a),e.lineTo(t-a,n),e.lineTo(t,n-a)},$=function(e,t,n,o,i){var a=o*Math.sqrt(2*Math.PI/Math.sin(Math.PI/3)),r=a*Math.sin(Math.PI/3);e.moveTo(t-a/2,n+r/2),e.lineTo(t+a/2,n+r/2),i||(e.lineTo(t,n-r/2),e.lineTo(t-a/2,n+r/2),e.lineTo(t+a/2,n+r/2))},ee=function(e,t,n,o,i,a){i||(e.moveTo(t+o,n),e.arc(t,n,o,0,2*Math.PI,!1))},te={square:J,rectangle:K,diamond:Q,triangle:$,cross:function(e,t,n,o,i){var a=o*Math.sqrt(Math.PI)/2;e.moveTo(t-a,n-a),e.lineTo(t+a,n+a),e.moveTo(t-a,n+a),e.lineTo(t+a,n-a)},ellipse:ee,plus:function(e,t,n,o,i){var a=o*Math.sqrt(Math.PI/2);e.moveTo(t-a,n),e.lineTo(t+a,n),e.moveTo(t,n+a),e.lineTo(t,n-a)}};function ne(e,t,n,o){if(!0===t.flatdata){var i=t.start||0,a="number"==typeof t.step?t.step:1;o.pointsize=2;for(var r=0,s=0;r<n.length;r++,s+=2)o.points[s]=i+r*a,o.points[s+1]=n[r];void 0!==o.points?o.points.length=2*n.length:o.points=[]}}J.fill=!0,K.fill=!0,Q.fill=!0,$.fill=!0,ee.fill=!0,C.push({init:function(e){e.drawSymbol=te},name:"symbols",version:"1.0"}),C.push({init:function(e){e.hooks.processRawData.push(ne)},name:"flatdata",version:"0.0.2"});var oe=y.SNAPPING_CONSTANT,ie=y.PANHINT_LENGTH_CONSTANT;function ae(e,n){var o,i=null,a="manual"===n.pan.mode,r="smartLock"===n.pan.mode,l=r||"smart"===n.pan.mode,c="default",h=null,d=null,m={x:0,y:0},g=!1;function v(n){var o=-n.deltaY,i=Math.abs(n.deltaY)<=1?1+Math.abs(n.deltaY)/50:null;if(g&&x(n),e.getOptions().zoom.active)return n.preventDefault(),function(n,o,i){var a=t.getPageXY(n),r=e.offset();r.left=a.X-r.left,r.top=a.Y-r.top;var s=e.getPlaceholder().getBoundingClientRect(),l={left:s.left+window.scrollX,top:s.top+window.scrollY};l.left=a.X-l.left,l.top=a.Y-l.top;var c=e.getXAxes().concat(e.getYAxes()).filter(function(e){var t=e.box;if(void 0!==t)return l.left>t.left&&l.left<t.left+t.width&&l.top>t.top&&l.top<t.top+t.height});0===c.length&&(c=void 0),o?e.zoomOut({center:r,axes:c,amount:i}):e.zoom({center:r,axes:c,amount:i})}(n,o<0,i),!1}function x(n){if(g){d&&(window.clearTimeout(d),d=null),g=!1;var u=t.getPageXY(n);s(e.getPlaceholder(),"cursor",c),l?(e.smartPan({x:o.startPageX-u.X,y:o.startPageY-u.Y},o,i,!1,r),e.smartPan.end()):a&&(e.pan({left:m.x-u.X,top:m.y-u.Y,axes:i}),m.x=0,m.y=0)}}function y(t){if(e.activate(),e.getOptions().recenter.interactive){var n=e.getTouchedAxis(t.clientX,t.clientY);e.recenter({axes:n[0]?n:null}),n[0]?u(e.getPlaceholder(),"re-center",{axisTouched:n[0]}):u(e.getPlaceholder(),"re-center",t)}}function w(t){return e.activate(),g&&x(t),!1}function T(n){if(0===n.button){var u=n.currentTarget;!function(n){g=!0;var r=t.getPageXY(n),u=e.getPlaceholder().getBoundingClientRect(),h={left:u.left+window.scrollX,top:u.top+window.scrollY};h.left=r.X-h.left,h.top=r.Y-h.top,0===(i=e.getXAxes().concat(e.getYAxes()).filter(function(e){var t=e.box;if(void 0!==t)return h.left>t.left&&h.left<t.left+t.width&&h.top>t.top&&h.top<t.top+t.height})).length&&(i=void 0);var p=s(e.getPlaceholder(),"cursor");p&&(c=p),s(e.getPlaceholder(),"cursor",e.getOptions().pan.cursor),l?o=e.navigationState(r.X,r.Y):a&&(m.x=r.X,m.y=r.Y)}(n),u.setPointerCapture(n.pointerId),u.addEventListener("pointermove",h),u.addEventListener("pointerup",p),u.addEventListener("pointercancel",p)}function h(n){!function(n){if(g){var s=t.getPageXY(n),c=e.getOptions().pan.frameRate;-1!==c?!d&&c&&(d=window.setTimeout(function(){l?e.smartPan({x:o.startPageX-s.X,y:o.startPageY-s.Y},o,i,!1,r):a&&(e.pan({left:m.x-s.X,top:m.y-s.Y,axes:i}),m.x=s.X,m.y=s.Y),d=null},1/c*1e3)):l?e.smartPan({x:o.startPageX-s.X,y:o.startPageY-s.Y},o,i,!1,r):a&&(e.pan({left:m.x-s.X,top:m.y-s.Y,axes:i}),m.x=s.X,m.y=s.Y)}}(n)}function p(e){x(e),u.removeEventListener("pointermove",h),u.removeEventListener("pointerup",p),u.removeEventListener("pointercancel",p),u.releasePointerCapture(e.pointerId)}}e.navigationState=function(e,t){var n=this.getAxes(),o={};return Object.keys(n).forEach(function(e){var t=n[e];o[e]={navigationOffset:{below:t.options.offset.below||0,above:t.options.offset.above||0},axisMin:t.min,axisMax:t.max,diagMode:!1}}),o.startPageX=e||0,o.startPageY=t||0,o},e.activate=function(){var t=e.getOptions();t.pan.active&&t.zoom.active||(t.pan.active=!0,t.zoom.active=!0,u(e.getPlaceholder(),"plotactivated",[e]))},e.zoomOut=function(t){t||(t={}),t.amount||(t.amount=e.getOptions().zoom.amount),t.amount=1/t.amount,e.zoom(t)},e.zoom=function(t){t||(t={});var n=t.center,o=t.amount||e.getOptions().zoom.amount,i=e.width(),a=e.height(),r=t.axes||e.getAxes();n||(n={left:i/2,top:a/2});var s=n.left/i,l=n.top/a,c={x:{min:n.left-s*i/o,max:n.left+(1-s)*i/o},y:{min:n.top-l*a/o,max:n.top+(1-l)*a/o}};for(var h in r)if(r.hasOwnProperty(h)){var p=r[h],f=p.options,d=c[p.direction].min,m=c[p.direction].max,g=p.options.offset;if((f.axisZoom||!t.axes)&&(t.axes||f.plotZoom)){if((d=b.saturate(p.c2p(d)))>(m=b.saturate(p.c2p(m)))){var v=d;d=m,m=v}if(f.zoomRange){if(m-d<f.zoomRange[0])continue;if(m-d>f.zoomRange[1])continue}var x=b.saturate(g.below-(p.min-d)),y=b.saturate(g.above-(p.max-m));f.offset={below:x,above:y}}}e.setupGrid(!0),e.draw(),t.preventEvent||u(e.getPlaceholder(),"plotzoom",[e,t])},e.pan=function(t){var n={x:+t.left,y:+t.top};isNaN(n.x)&&(n.x=0),isNaN(n.y)&&(n.y=0);var o=t.axes||e.getAxes();Object.keys(o).forEach(function(e){var i=o[e],a=i.options,r=n[i.direction];if((a.axisPan||!t.axes)&&(a.plotPan||t.axes)){var s=i.p2c(a.panRange[0])-i.p2c(i.min),l=i.p2c(a.panRange[1])-i.p2c(i.max);if(void 0!==a.panRange[0]&&r>=l&&(r=l),void 0!==a.panRange[1]&&r<=s&&(r=s),0!==r){var c=b.saturate(i.c2p(i.p2c(i.min)+r)-i.c2p(i.p2c(i.min))),u=b.saturate(i.c2p(i.p2c(i.max)+r)-i.c2p(i.p2c(i.max)));isFinite(c)||(c=0),isFinite(u)||(u=0),a.offset={below:b.saturate(c+(a.offset.below||0)),above:b.saturate(u+(a.offset.above||0))}}}}),e.setupGrid(!0),e.draw(),t.preventEvent||u(e.getPlaceholder(),"plotpan",[e,t])},e.recenter=function(t){var n=t.axes||e.getAxes();Object.keys(n).forEach(function(e){var o=n[e];t.axes?"x"===o.direction?o.options.offset={below:0}:"y"===o.direction&&(o.options.offset={above:0}):o.options.offset={below:0,above:0}}),e.setupGrid(!0),e.draw()};var k=null,M={x:0,y:0};e.smartPan=function(t,n,o,i,a){var r,s,l,c,p,f,d=!!a||function(e){return Math.abs(e.y)<oe&&Math.abs(e.x)>=oe||Math.abs(e.x)<oe&&Math.abs(e.y)>=oe}(t),m=e.getAxes();(function(e){return Math.abs(e.x)>0&&Math.abs(e.y)>0})(t=a?function(e){switch(!k&&Math.max(Math.abs(e.x),Math.abs(e.y))>=oe&&(k=Math.abs(e.x)<Math.abs(e.y)?"y":"x"),k){case"x":return{x:e.x,y:0};case"y":return{x:0,y:e.y};default:return{x:0,y:0}}}(t):function(e){return Math.abs(e.x)<oe&&Math.abs(e.y)>=oe?{x:0,y:e.y}:Math.abs(e.y)<oe&&Math.abs(e.x)>=oe?{x:e.x,y:0}:e}(t))&&(n.diagMode=!0),d&&!0===n.diagMode&&(n.diagMode=!1,function(e,t,n){var o;Object.keys(e).forEach(function(i){o=e[i],0===n[o.direction]&&(o.options.offset.below=t[i].navigationOffset.below,o.options.offset.above=t[i].navigationOffset.above)})}(m,n,t)),h=d?{start:{x:n.startPageX-e.offset().left+e.getPlotOffset().left,y:n.startPageY-e.offset().top+e.getPlotOffset().top},end:{x:n.startPageX-t.x-e.offset().left+e.getPlotOffset().left,y:n.startPageY-t.y-e.offset().top+e.getPlotOffset().top}}:{start:{x:n.startPageX-e.offset().left+e.getPlotOffset().left,y:n.startPageY-e.offset().top+e.getPlotOffset().top},end:!1},isNaN(t.x)&&(t.x=0),isNaN(t.y)&&(t.y=0),o&&(m=o),Object.keys(m).forEach(function(e){if(s=m[e],l=s.min,c=s.max,r=s.options,f=t[s.direction],p=M[s.direction],(r.axisPan||!o)&&(o||r.plotPan)){var n=p+s.p2c(r.panRange[0])-s.p2c(l),i=p+s.p2c(r.panRange[1])-s.p2c(c);if(void 0!==r.panRange[0]&&f>=i&&(f=i),void 0!==r.panRange[1]&&f<=n&&(f=n),0!==f){var a=b.saturate(s.c2p(s.p2c(l)-(p-f))-s.c2p(s.p2c(l))),u=b.saturate(s.c2p(s.p2c(c)-(p-f))-s.c2p(s.p2c(c)));isFinite(a)||(a=0),isFinite(u)||(u=0),s.options.offset.below=b.saturate(a+(s.options.offset.below||0)),s.options.offset.above=b.saturate(u+(s.options.offset.above||0))}}}),M=t,e.setupGrid(!0),e.draw(),i||u(e.getPlaceholder(),"plotpan",[e,t,o,n])},e.smartPan.end=function(){h=null,k=null,M={x:0,y:0},e.triggerRedrawOverlay()},e.getTouchedAxis=function(t,n){var o=e.getPlaceholder().getBoundingClientRect(),i={left:o.left+window.scrollX,top:o.top+window.scrollY};return i.left=t-i.left,i.top=n-i.top,e.getXAxes().concat(e.getYAxes()).filter(function(e){var t=e.box;if(void 0!==t)return i.left>t.left&&i.left<t.left+t.width&&i.top>t.top&&i.top<t.top+t.height})},e.hooks.drawOverlay.push(function(e,t){if(h){t.strokeStyle="rgba(96, 160, 208, 0.7)",t.lineWidth=2,t.lineJoin="round";var n,o,a=Math.round(h.start.x),r=Math.round(h.start.y);if(i?"x"===i[0].direction?(o=Math.round(h.start.y),n=Math.round(h.end.x)):"y"===i[0].direction&&(n=Math.round(h.start.x),o=Math.round(h.end.y)):(n=Math.round(h.end.x),o=Math.round(h.end.y)),t.beginPath(),!1===h.end)t.moveTo(a,r-ie),t.lineTo(a,r+ie),t.moveTo(a+ie,r),t.lineTo(a-ie,r);else{var s=r===o;t.moveTo(a-(s?0:ie),r-(s?ie:0)),t.lineTo(a+(s?0:ie),r+(s?ie:0)),t.moveTo(a,r),t.lineTo(n,o),t.moveTo(n-(s?0:ie),o-(s?ie:0)),t.lineTo(n+(s?0:ie),o+(s?ie:0))}t.stroke()}}),e.hooks.bindEvents.push(function(e,t){var n=e.getOptions();n.zoom.interactive&&p(t,"wheel",v),n.pan.interactive&&p(t,"pointerdown",T),p(t,"dblclick",y),p(t,"click",w)}),e.hooks.shutdown.push(function(e,t){f(t,"wheel",v),f(t,"pointerdown",T),f(t,"dblclick",y),f(t,"click",w),d&&window.clearTimeout(d)})}function re(e,t,n,o){var i="categories"===t.xaxis.options.mode,a="categories"===t.yaxis.options.mode;if(i||a){var r=o.format;if(!r){var s=t;if((r=[]).push({x:!0,number:!0,required:!0,computeRange:!0}),r.push({y:!0,number:!0,required:!0,computeRange:!0}),s.bars.show||s.lines.show&&s.lines.fill){var l=!!(s.bars.show&&s.bars.zero||s.lines.show&&s.lines.zero);r.push({y:!0,number:!0,required:!1,defaultValue:0,computeRange:l}),s.bars.horizontal&&(delete r[r.length-1].y,r[r.length-1].x=!0)}o.format=r}for(var c=0;c<r.length;++c)r[c].x&&i&&(r[c].number=!1),r[c].y&&a&&(r[c].number=!1,r[c].computeRange=!1)}}function se(e){var t=[];for(var n in e.categories){var o=e.categories[n];o>=e.min&&o<=e.max&&t.push([o,n])}return t.sort(function(e,t){return e[0]-t[0]}),t}function le(e,t,n){if("categories"===e[t].options.mode){if(!e[t].categories){var o={},i=e[t].options.categories||{};if(Array.isArray(i))for(var a=0;a<i.length;++a)o[i[a]]=a;else for(var r in i)o[r]=i[r];e[t].categories=o}e[t].options.ticks||(e[t].options.ticks=se),function(e,t,n){for(var o=e.points,i=e.pointsize,a=e.format,r=t.charAt(0),s=function(e){var t=-1;for(var n in e)e[n]>t&&(t=e[n]);return t+1}(n),l=0;l<o.length;l+=i)if(null!=o[l])for(var c=0;c<i;++c){var u=o[l+c];null!=u&&a[c][r]&&(u in n||(n[u]=s,++s),o[l+c]=n[u])}}(n,t,e[t].categories)}}function ce(e,t,n){le(t,"xaxis",n),le(t,"yaxis",n)}C.push({init:function(e){e.hooks.processOptions.push(ae)},options:{zoom:{interactive:!1,active:!1,amount:1.5},pan:{interactive:!1,active:!1,cursor:"move",frameRate:60,mode:"smart"},recenter:{interactive:!0},xaxis:{axisZoom:!0,plotZoom:!0,axisPan:!0,plotPan:!0,panRange:[void 0,void 0],zoomRange:[void 0,void 0]},yaxis:{axisZoom:!0,plotZoom:!0,axisPan:!0,plotPan:!0,panRange:[void 0,void 0],zoomRange:[void 0,void 0]}},name:"navigate",version:"1.3"}),C.push({init:function(e){e.hooks.processRawData.push(function(e,t,n,o){if(null!=t.fillBetween){var i=o.format;i||((i=[]).push({x:!0,number:!0,computeRange:"none"!==t.xaxis.options.autoScale,required:!0}),i.push({y:!0,number:!0,computeRange:"none"!==t.yaxis.options.autoScale,required:!0}),void 0!==t.fillBetween&&""!==t.fillBetween&&function(t){for(var n=e.getData(),o=0;o<n.length;o++)if(n[o].id===t)return!0;return!1}(t.fillBetween)&&t.fillBetween!==t.id&&i.push({x:!1,y:!0,number:!0,required:!1,computeRange:"none"!==t.yaxis.options.autoScale,defaultValue:0}),o.format=i)}}),e.hooks.processDatapoints.push(function(e,t,n){if(null!=t.fillBetween){var o=function(e,t){var n;for(n=0;n<t.length;++n)if(t[n].id===e.fillBetween)return t[n];return"number"==typeof e.fillBetween?e.fillBetween<0||e.fillBetween>=t.length?null:t[e.fillBetween]:null}(t,e.getData());if(o){for(var i,a,r,s,l,c,u,h,p=n.pointsize,f=n.points,d=o.datapoints.pointsize,m=o.datapoints.points,g=[],v=t.lines.show,x=p>2&&n.format[2].y,b=v&&t.lines.steps,y=!0,w=0,T=0;!(w>=f.length);){if(u=g.length,null==f[w]){for(h=0;h<p;++h)g.push(f[w+h]);w+=p}else if(T>=m.length){if(!v)for(h=0;h<p;++h)g.push(f[w+h]);w+=p}else if(null==m[T]){for(h=0;h<p;++h)g.push(null);y=!0,T+=d}else{if(i=f[w],a=f[w+1],s=m[T],l=m[T+1],c=0,i===s){for(h=0;h<p;++h)g.push(f[w+h]);c=l,w+=p,T+=d}else if(i>s){if(v&&w>0&&null!=f[w-p]){for(r=a+(f[w-p+1]-a)*(s-i)/(f[w-p]-i),g.push(s),g.push(r),h=2;h<p;++h)g.push(f[w+h]);c=l}T+=d}else{if(y&&v){w+=p;continue}for(h=0;h<p;++h)g.push(f[w+h]);v&&T>0&&null!=m[T-d]&&(c=l+(m[T-d+1]-l)*(i-s)/(m[T-d]-s)),w+=p}y=!1,u!==g.length&&x&&(g[u+2]=c)}if(b&&u!==g.length&&u>0&&null!==g[u]&&g[u]!==g[u-p]&&g[u+1]!==g[u-p+1]){for(h=0;h<p;++h)g[u+p+h]=g[u+h];g[u+1]=g[u-p+1]}}n.points=g}}})},options:{series:{fillBetween:null}},name:"fillbetween",version:"1.0"}),C.push({init:function(e){e.hooks.processRawData.push(re),e.hooks.processDatapoints.push(ce)},options:{xaxis:{categories:null},yaxis:{categories:null}},name:"categories",version:"1.0"}),C.push({init:function(e){e.hooks.processDatapoints.push(function(e,t,n){if(null!=t.stack&&!1!==t.stack){var o=t.bars.show||t.lines.show&&t.lines.fill,i=n.pointsize>2&&(t.bars.horizontal?n.format[2].x:n.format[2].y);o&&!i&&function(e,t){for(var n=[],o=0;o<t.points.length;o+=2)n.push(t.points[o]),n.push(t.points[o+1]),n.push(0);t.format.push({x:e.bars.horizontal,y:!e.bars.horizontal,number:!0,required:!1,computeRange:"none"!==e.yaxis.options.autoScale,defaultValue:0}),t.points=n,t.pointsize=3}(t,n);var a=function(e,t){for(var n=null,o=0;o<t.length&&e!==t[o];++o)t[o].stack===e.stack&&(n=t[o]);return n}(t,e.getData());if(a){for(var r,s,l,c,u,h,p,f,d=n.pointsize,m=n.points,g=a.datapoints.pointsize,v=a.datapoints.points,x=[],b=t.lines.show,y=t.bars.horizontal,w=b&&t.lines.steps,T=!0,k=y?1:0,M=y?0:1,S=0,P=0;!(S>=m.length);){if(p=x.length,null==m[S]){for(f=0;f<d;++f)x.push(m[S+f]);S+=d}else if(P>=v.length){if(!b)for(f=0;f<d;++f)x.push(m[S+f]);S+=d}else if(null==v[P]){for(f=0;f<d;++f)x.push(null);T=!0,P+=g}else{if(r=m[S+k],s=m[S+M],c=v[P+k],u=v[P+M],h=0,r===c){for(f=0;f<d;++f)x.push(m[S+f]);x[p+M]+=u,h=u,S+=d,P+=g}else if(r>c){if(b&&S>0&&null!=m[S-d]){for(l=s+(m[S-d+M]-s)*(c-r)/(m[S-d+k]-r),x.push(c),x.push(l+u),f=2;f<d;++f)x.push(m[S+f]);h=u}P+=g}else{if(T&&b){S+=d;continue}for(f=0;f<d;++f)x.push(m[S+f]);b&&P>0&&null!=v[P-g]&&(h=u+(v[P-g+M]-u)*(r-c)/(v[P-g+k]-c)),x[p+M]+=h,S+=d}T=!1,p!==x.length&&o&&(x[p+2]+=h)}if(w&&p!==x.length&&p>0&&null!==x[p]&&x[p]!==x[p-d]&&x[p+1]!==x[p-d+1]){for(f=0;f<d;++f)x[p+d+f]=x[p+f];x[p+1]=x[p-d+1]}}n.points=x}}})},options:{series:{stack:null}},name:"stack",version:"1.2"});var ue=y.ZOOM_DISTANCE_MARGIN;function he(e,t){var n,o,i,a,r={zoomEnable:!1,prevDistance:null,prevTapTime:0,prevPanPosition:{x:0,y:0},prevTapPosition:{x:0,y:0}},s={prevTouchedAxis:"none",currentTouchedAxis:"none",touchedAxis:null,navigationConstraint:"unconstrained",initialState:null},l=t.pan.interactive&&"manual"===t.pan.touchMode,c="smartLock"===t.pan.touchMode,h=t.pan.interactive&&(c||"smart"===t.pan.touchMode);function p(t,n,o){s.touchedAxis=function(e,t,n,o){if("pinchstart"!==t.type)return"panstart"===t.type||"pinchend"===t.type?e.getTouchedAxis(t.detail.touches[0].pageX,t.detail.touches[0].pageY):o.touchedAxis;var i=e.getTouchedAxis(t.detail.touches[0].pageX,t.detail.touches[0].pageY),a=e.getTouchedAxis(t.detail.touches[1].pageX,t.detail.touches[1].pageY);return i.length===a.length&&i.toString()===a.toString()?i:void 0}(e,t,0,s),pe(s)?s.navigationConstraint="unconstrained":s.navigationConstraint="axisConstrained"}n={start:function(t){if(p(t),fe(t,"pan",r,s),h){var n=ve(t,"pan");s.initialState=e.navigationState(n.x,n.y)}},drag:function(t){if(p(t),h){var n=ve(t,"pan");e.smartPan({x:s.initialState.startPageX-n.x,y:s.initialState.startPageY-n.y},s.initialState,s.touchedAxis,!1,c)}else l&&(e.pan({left:-ge(t,"pan",r).x,top:-ge(t,"pan",r).y,axes:s.touchedAxis}),me(t,"pan",r,s))},end:function(t){p(t),h&&e.smartPan.end(),function(e,t){return t.zoomEnable&&1===e.detail.touches.length}(t,r)&&updateprevPanPosition(t,"pan",r,s)}},o={start:function(e){a&&(clearTimeout(a),a=null),p(e),function(e,t){t.prevDistance=de(e)}(e,r),fe(e,"pinch",r,s)},drag:function(t){a||(a=setTimeout(function(){p(t),e.pan({left:-ge(t,"pinch",r).x,top:-ge(t,"pinch",r).y,axes:s.touchedAxis}),me(t,"pinch",r,s);var n=de(t);(r.zoomEnable||Math.abs(n-r.prevDistance)>ue)&&(function(e,t,n,o){var i=e.offset(),a={left:0,top:0},r=de(t)/n.prevDistance,s=de(t);a.left=ve(t,"pinch").x-i.left,a.top=ve(t,"pinch").y-i.top,e.zoom({center:a,amount:r,axes:o.touchedAxis}),n.prevDistance=s}(e,t,r,s),r.zoomEnable=!0),a=null},1e3/60))},end:function(e){a&&(clearTimeout(a),a=null),p(e),r.prevDistance=null}},i={recenterPlot:function(t){t&&t.detail&&"touchstart"===t.detail.type&&function(e,t,n,o){(function(e,t,n){var o=e.getTouchedAxis(t.detail.firstTouch.x,t.detail.firstTouch.y);void 0!==o[0]&&(n.prevTouchedAxis=o[0].direction),void 0!==(o=e.getTouchedAxis(t.detail.secondTouch.x,t.detail.secondTouch.y))[0]&&(n.touchedAxis=o,n.currentTouchedAxis=o[0].direction),pe(n)&&(n.touchedAxis=null,n.prevTouchedAxis="none",n.currentTouchedAxis="none")})(e,t,o),("x"===o.currentTouchedAxis&&"x"===o.prevTouchedAxis||"y"===o.currentTouchedAxis&&"y"===o.prevTouchedAxis||"none"===o.currentTouchedAxis&&"none"===o.prevTouchedAxis)&&(e.recenter({axes:o.touchedAxis}),o.touchedAxis?u(e.getPlaceholder(),"re-center",{axisTouched:o.touchedAxis}):u(e.getPlaceholder(),"re-center",t))}(e,t,0,s)}},!0!==t.pan.enableTouch&&!0!==t.zoom.enableTouch||(e.hooks.bindEvents.push(function(e,t){var a=e.getOptions();a.zoom.interactive&&a.zoom.enableTouch&&(t.addEventListener("pinchstart",o.start,!1),t.addEventListener("pinchdrag",o.drag,!1),t.addEventListener("pinchend",o.end,!1)),a.pan.interactive&&a.pan.enableTouch&&(t.addEventListener("panstart",n.start,!1),t.addEventListener("pandrag",n.drag,!1),t.addEventListener("panend",n.end,!1)),a.recenter.interactive&&a.recenter.enableTouch&&t.addEventListener("doubletap",i.recenterPlot,!1)}),e.hooks.shutdown.push(function(e,t){t.removeEventListener("panstart",n.start),t.removeEventListener("pandrag",n.drag),t.removeEventListener("panend",n.end),t.removeEventListener("pinchstart",o.start),t.removeEventListener("pinchdrag",o.drag),t.removeEventListener("pinchend",o.end),t.removeEventListener("doubletap",i.recenterPlot)}))}function pe(e){return!e.touchedAxis||0===e.touchedAxis.length}function fe(e,t,n,o){var i,a=ve(e,t);switch(o.navigationConstraint){case"unconstrained":o.touchedAxis=null,n.prevTapPosition={x:n.prevPanPosition.x,y:n.prevPanPosition.y},n.prevPanPosition={x:a.x,y:a.y};break;case"axisConstrained":i=o.touchedAxis[0].direction,o.currentTouchedAxis=i,n.prevTapPosition[i]=n.prevPanPosition[i],n.prevPanPosition[i]=a[i]}}function de(e){var t,n,o,i,a=e.detail.touches[0],r=e.detail.touches[1];return t=a.pageX,n=a.pageY,o=r.pageX,i=r.pageY,Math.sqrt((t-o)*(t-o)+(n-i)*(n-i))}function me(e,t,n,o){var i=ve(e,t);switch(o.navigationConstraint){case"unconstrained":n.prevPanPosition.x=i.x,n.prevPanPosition.y=i.y;break;case"axisConstrained":n.prevPanPosition[o.currentTouchedAxis]=i[o.currentTouchedAxis]}}function ge(e,t,n){var o=ve(e,t);return{x:o.x-n.prevPanPosition.x,y:o.y-n.prevPanPosition.y}}function ve(e,t){return"pinch"===t?{x:(e.detail.touches[0].pageX+e.detail.touches[1].pageX)/2,y:(e.detail.touches[0].pageY+e.detail.touches[1].pageY)/2}:{x:e.detail.touches[0].pageX,y:e.detail.touches[0].pageY}}C.push({init:function(e){e.hooks.processOptions.push(he)},options:{zoom:{enableTouch:!1},pan:{enableTouch:!1,touchMode:"manual"},recenter:{enableTouch:!0}},name:"navigateTouch",version:"0.3"});var xe="hover";function be(e,t){var n,o={twoTouches:!1,currentTapStart:{x:0,y:0},currentTapEnd:{x:0,y:0},prevTap:{x:0,y:0},currentTap:{x:0,y:0},interceptedLongTap:!1,isUnsupportedGesture:!1,prevTapTime:null,tapStartTime:null,longTapTriggerId:null};function i(t){var i=e.getOptions();(i.pan.active||i.zoom.active)&&(function(e){e.touches.length>=3?o.isUnsupportedGesture=!0:o.isUnsupportedGesture=!1}(t),n.dispatchEvent(new CustomEvent("touchevent",{detail:t})),m(t)?a(t,"pinch"):(a(t,"pan"),d(t)||(function(e){var t=(new Date).getTime(),n=t-o.prevTapTime;return n>=0&&n<500&&f(o.prevTap.x,o.prevTap.y,o.currentTap.x,o.currentTap.y)<20?(e.firstTouch=o.prevTap,e.secondTouch=o.currentTap,!0):(o.prevTapTime=t,!1)}(t)&&a(t,"doubleTap"),a(t,"tap"),a(t,"longTap"))))}function a(e,t){switch(t){case"pan":r[e.type](e);break;case"pinch":s[e.type](e);break;case"doubleTap":l.onDoubleTap(e);break;case"longTap":c[e.type](e);break;case"tap":u[e.type](e)}}var r={touchstart:function(e){o.prevTap={x:o.currentTap.x,y:o.currentTap.y},h(e),function(e){o.tapStartTime=(new Date).getTime(),o.interceptedLongTap=!1,o.currentTapStart={x:e.touches[0].pageX,y:e.touches[0].pageY},o.currentTapEnd={x:e.touches[0].pageX,y:e.touches[0].pageY}}(e),n.dispatchEvent(new CustomEvent("panstart",{detail:e}))},touchmove:function(e){p(e),h(e),function(e){o.currentTapEnd={x:e.touches[0].pageX,y:e.touches[0].pageY}}(e),o.isUnsupportedGesture||n.dispatchEvent(new CustomEvent("pandrag",{detail:e}))},touchend:function(e){p(e),d(e)?(n.dispatchEvent(new CustomEvent("pinchend",{detail:e})),n.dispatchEvent(new CustomEvent("panstart",{detail:e}))):function(e){return e.touches&&0===e.touches.length}(e)&&n.dispatchEvent(new CustomEvent("panend",{detail:e}))}},s={touchstart:function(e){n.dispatchEvent(new CustomEvent("pinchstart",{detail:e}))},touchmove:function(e){p(e),o.twoTouches=m(e),o.isUnsupportedGesture||n.dispatchEvent(new CustomEvent("pinchdrag",{detail:e}))},touchend:function(e){p(e)}},l={onDoubleTap:function(e){p(e),n.dispatchEvent(new CustomEvent("doubletap",{detail:e}))}},c={touchstart:function(e){c.waitForLongTap(e)},touchmove:function(e){},touchend:function(e){o.longTapTriggerId&&(clearTimeout(o.longTapTriggerId),o.longTapTriggerId=null)},isLongTap:function(e){return(new Date).getTime()-o.tapStartTime>=1500&&!o.interceptedLongTap&&f(o.currentTapStart.x,o.currentTapStart.y,o.currentTapEnd.x,o.currentTapEnd.y)<20&&(o.interceptedLongTap=!0,!0)},waitForLongTap:function(e){o.longTapTriggerId||(o.longTapTriggerId=setTimeout(function(){c.isLongTap(e)&&n.dispatchEvent(new CustomEvent("longtap",{detail:e})),o.longTapTriggerId=null},1500))}},u={touchstart:function(e){o.tapStartTime=(new Date).getTime()},touchmove:function(e){},touchend:function(e){u.isTap(e)&&(n.dispatchEvent(new CustomEvent("tap",{detail:e})),p(e))},isTap:function(e){return(new Date).getTime()-o.tapStartTime<=125&&f(o.currentTapStart.x,o.currentTapStart.y,o.currentTapEnd.x,o.currentTapEnd.y)<20}};function h(e){o.currentTap={x:e.touches[0].pageX,y:e.touches[0].pageY}}function p(t){o.isUnsupportedGesture||(t.preventDefault(),e.getOptions().propagateSupportedGesture||t.stopPropagation())}function f(e,t,n,o){return Math.sqrt((e-n)*(e-n)+(t-o)*(t-o))}function d(e){return o.twoTouches&&1===e.touches.length}function m(t){return!!(t.touches&&t.touches.length>=2&&t.touches[0].target===e.getEventHolder()&&t.touches[1].target===e.getEventHolder())}(!0===t.pan.enableTouch||t.zoom.enableTouch)&&(e.hooks.bindEvents.push(function(e,t){n=t,t.addEventListener("touchstart",i,!1),t.addEventListener("touchmove",i,!1),t.addEventListener("touchend",i,!1)}),e.hooks.shutdown.push(function(e,t){t.removeEventListener("touchstart",i),t.removeEventListener("touchmove",i),t.removeEventListener("touchend",i),o.longTapTriggerId&&(clearTimeout(o.longTapTriggerId),o.longTapTriggerId=null)}))}C.push({init:function(e){var n,o=[];function i(t){var n=e.getOptions(),o=new CustomEvent("mouseevent");return o.pageX=t.detail.changedTouches[0].pageX,o.pageY=t.detail.changedTouches[0].pageY,o.clientX=t.detail.changedTouches[0].clientX,o.clientY=t.detail.changedTouches[0].clientY,n.grid.hoverable&&a(o,xe,30),!1}function a(t,n,o){var i=e.getData();if(void 0!==t&&i.length>0&&void 0!==i[0].xaxis.c2p&&void 0!==i[0].yaxis.c2p){var a=n+"able";h("plot"+n,t,function(e){return!1!==i[e][a]},o)}}function r(t){n=t,e.getPlaceholder().lastMouseMoveEvent=t,a(t,xe)}function s(t){n=void 0,e.getPlaceholder().lastMouseMoveEvent=void 0,h("plothover",t,function(e){return!1})}function l(e){a(e,"click")}function c(){e.unhighlight(),u(e.getPlaceholder(),"plothovercleanup")}function h(n,i,a,r){var s=e.getOptions(),l=e.offset(),c=t.getPageXY(i),h=c.X-l.left,p=c.Y-l.top,f=e.c2p({left:h,top:p}),g=void 0!==r?r:s.grid.mouseActiveRadius;f.pageX=c.X,f.pageY=c.Y;var v=e.findNearbyItems(h,p,a,g),x=v[0];for(let e=1;e<v.length;++e)(void 0===x.distance||v[e].distance<x.distance)&&(x=v[e]);if(x?(x.pageX=parseInt(x.series.xaxis.p2c(x.datapoint[0])+l.left,10),x.pageY=parseInt(x.series.yaxis.p2c(x.datapoint[1])+l.top,10)):x=null,s.grid.autoHighlight){for(let e=0;e<o.length;++e){var b=o[e];(b.auto!==n||x&&b.series===x.series&&b.point[0]===x.datapoint[0]&&b.point[1]===x.datapoint[1])&&x||m(b.series,b.point)}x&&d(x.series,x.datapoint,n)}u(e.getPlaceholder(),n,[f,x,v])}function d(t,n,i){if("number"==typeof t&&(t=e.getData()[t]),"number"==typeof n){var a=t.datapoints.pointsize;n=t.datapoints.points.slice(a*n,a*(n+1))}var r=g(t,n);-1===r?(o.push({series:t,point:n,auto:i}),e.triggerRedrawOverlay()):i||(o[r].auto=!1)}function m(t,n){if(null==t&&null==n)return o=[],void e.triggerRedrawOverlay();if("number"==typeof t&&(t=e.getData()[t]),"number"==typeof n){var i=t.datapoints.pointsize;n=t.datapoints.points.slice(i*n,i*(n+1))}var a=g(t,n);-1!==a&&(o.splice(a,1),e.triggerRedrawOverlay())}function g(e,t){for(var n=0;n<o.length;++n){var i=o[n];if(i.series===e&&i.point[0]===t[0]&&i.point[1]===t[1])return n}return-1}function x(){c(),a(n,xe)}function b(){a(n,xe)}function y(e,t,n){var i,a,r=e.getPlotOffset();for(t.save(),t.translate(r.left,r.top),i=0;i<o.length;++i)(a=o[i]).series.bars.show?k(a.series,a.point,t):T(a.series,a.point,t,e);t.restore()}function T(e,t,n,o){var i=t[0],a=t[1],r=e.xaxis,s=e.yaxis,l="string"==typeof e.highlightColor?e.highlightColor:v.parse(e.color).scale("a",.5).toString();if(!(i<r.min||i>r.max||a<s.min||a>s.max)){var c=e.points.radius+e.points.lineWidth/2;n.lineWidth=c,n.strokeStyle=l;var u=1.5*c;i=r.p2c(i),a=s.p2c(a),n.beginPath();var h=e.points.symbol;"circle"===h?n.arc(i,a,u,0,2*Math.PI,!1):"string"==typeof h&&o.drawSymbol&&o.drawSymbol[h]&&o.drawSymbol[h](n,i,a,u,!1),n.closePath(),n.stroke()}}function k(e,t,n){var o,i="string"==typeof e.highlightColor?e.highlightColor:v.parse(e.color).scale("a",.5).toString(),a=i,r=e.bars.barWidth[0]||e.bars.barWidth;switch(e.bars.align){case"left":o=0;break;case"right":o=-r;break;default:o=-r/2}n.lineWidth=e.bars.lineWidth,n.strokeStyle=i;var s=e.bars.fillTowards||0,l=s>e.yaxis.min?Math.min(e.yaxis.max,s):e.yaxis.min;w.drawBar(t[0],t[1],t[2]||l,o,o+r,function(){return a},e.xaxis,e.yaxis,n,e.bars.horizontal,e.bars.lineWidth)}e.hooks.bindEvents.push(function(e,t){var n=e.getOptions();(n.grid.hoverable||n.grid.clickable)&&(t.addEventListener("touchevent",c,!1),t.addEventListener("tap",i,!1)),n.grid.clickable&&p(t,"click",l),n.grid.hoverable&&(p(t,"mousemove",r),p(t,"mouseleave",s))}),e.hooks.shutdown.push(function(e,t){t.removeEventListener("tap",i),t.removeEventListener("touchevent",c),f(t,"mousemove",r),f(t,"mouseleave",s),f(t,"click",l),o=[]}),e.hooks.processOptions.push(function(e,t){e.highlight=d,e.unhighlight=m,(t.grid.hoverable||t.grid.clickable)&&(e.hooks.drawOverlay.push(y),e.hooks.processDatapoints.push(x),e.hooks.setupGrid.push(b)),n=e.getPlaceholder().lastMouseMoveEvent})},options:{grid:{hoverable:!1,clickable:!1}},name:"hover",version:"0.1"}),C.push({init:function(e){e.hooks.processOptions.push(be)},options:{propagateSupportedGesture:!1},name:"navigateTouch",version:"0.3"});var ye=b.floorInBase,we=function(e,t){var n=new e(t),o=n.setTime.bind(n);n.update=function(e){e=Math.round(1e3*e)/1e3,o(e),this.microseconds=1e3*(e-Math.floor(e))};var i=n.getTime.bind(n);return n.getTime=function(){return i()+this.microseconds/1e3},n.setTime=function(e){this.update(e)},n.getMicroseconds=function(){return this.microseconds},n.setMicroseconds=function(e){var t=i()+e/1e3;this.update(t)},n.setUTCMicroseconds=function(e){this.setMicroseconds(e)},n.getUTCMicroseconds=function(){return this.getMicroseconds()},n.microseconds=null,n.microEpoch=null,n.update(t),n};function Te(e,t,n,o){if("function"==typeof e.strftime)return e.strftime(t);var i,a=function(e,t){return t=""+(null==t?"0":t),1===(e=""+e).length?t+e:e},r=function(e,t,n){var o,i=1e3*e+t;if(n<6&&n>0){var a=parseFloat("1e"+(n-6));o=("00000"+(i=Math.round(Math.round(i*a)/a))).slice(-6,-(6-n))}else o=("00000"+(i=Math.round(i))).slice(-6);return o},s=[],l=!1,c=e.getHours(),u=c<12;n||(n=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]),o||(o=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]),i=c>12?c-12:0===c?12:c;for(var h=-1,p=0;p<t.length;++p){var f=t.charAt(p);if(!isNaN(Number(f))&&Number(f)>0)h=Number(f);else if(l){switch(f){case"a":f=""+o[e.getDay()];break;case"b":f=""+n[e.getMonth()];break;case"d":f=a(e.getDate());break;case"e":f=a(e.getDate()," ");break;case"h":case"H":f=a(c);break;case"I":f=a(i);break;case"l":f=a(i," ");break;case"m":f=a(e.getMonth()+1);break;case"M":f=a(e.getMinutes());break;case"q":f=""+(Math.floor(e.getMonth()/3)+1);break;case"S":f=a(e.getSeconds());break;case"s":f=""+r(e.getMilliseconds(),e.getMicroseconds(),h);break;case"y":f=a(e.getFullYear()%100);break;case"Y":f=""+e.getFullYear();break;case"p":f=u?"am":"pm";break;case"P":f=u?"AM":"PM";break;case"w":f=""+e.getDay()}s.push(f),l=!1}else"%"===f?l=!0:s.push(f)}return s.join("")}function ke(e){function t(e,t,n,o){e[t]=function(){return n[o].apply(n,arguments)}}var n={date:e};void 0!==e.strftime&&t(n,"strftime",e,"strftime"),t(n,"getTime",e,"getTime"),t(n,"setTime",e,"setTime");for(var o=["Date","Day","FullYear","Hours","Minutes","Month","Seconds","Milliseconds","Microseconds"],i=0;i<o.length;i++)t(n,"get"+o[i],e,"getUTC"+o[i]),t(n,"set"+o[i],e,"setUTC"+o[i]);return n}function Me(e,t){var n=864e13;if(t&&"seconds"===t.timeBase?e*=1e3:"microseconds"===t.timeBase&&(e/=1e3),e>n?e=n:e<-n&&(e=-n),"browser"===t.timezone)return we(Date,e);if(t.timezone&&"utc"!==t.timezone){if("undefined"!=typeof timezoneJS&&void 0!==timezoneJS.Date){var o=we(timezoneJS.Date,e);return o.setTimezone(t.timezone),o.setTime(e),o}return ke(we(Date,e))}return ke(we(Date,e))}var Se={microsecond:1e-6,millisecond:.001,second:1,minute:60,hour:3600,day:86400,month:2592e3,quarter:7776e3,year:525949.2*60},Pe={microsecond:.001,millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,month:2592e6,quarter:7776e6,year:525949.2*60*1e3},Ce={microsecond:1,millisecond:1e3,second:1e6,minute:6e7,hour:36e8,day:864e8,month:2592e9,quarter:7776e9,year:31556951999999.996},Le=[[1,"microsecond"],[2,"microsecond"],[5,"microsecond"],[10,"microsecond"],[25,"microsecond"],[50,"microsecond"],[100,"microsecond"],[250,"microsecond"],[500,"microsecond"],[1,"millisecond"],[2,"millisecond"],[5,"millisecond"],[10,"millisecond"],[25,"millisecond"],[50,"millisecond"],[100,"millisecond"],[250,"millisecond"],[500,"millisecond"],[1,"second"],[2,"second"],[5,"second"],[10,"second"],[30,"second"],[1,"minute"],[2,"minute"],[5,"minute"],[10,"minute"],[30,"minute"],[1,"hour"],[2,"hour"],[4,"hour"],[8,"hour"],[12,"hour"],[1,"day"],[2,"day"],[3,"day"],[.25,"month"],[.5,"month"],[1,"month"],[2,"month"]],Ne=Le.concat([[3,"month"],[6,"month"],[1,"year"]]),Ee=Le.concat([[1,"quarter"],[2,"quarter"],[1,"year"]]);function ze(e){var t,n=e.options,o=[],i=Me(e.min,n),a=0,r=n.tickSize&&"quarter"===n.tickSize[1]||n.minTickSize&&"quarter"===n.minTickSize[1]?Ee:Ne;t="seconds"===n.timeBase?Se:"microseconds"===n.timeBase?Ce:Pe,null!==n.minTickSize&&void 0!==n.minTickSize&&(a="number"==typeof n.tickSize?n.tickSize:n.minTickSize[0]*t[n.minTickSize[1]]);for(var s=0;s<r.length-1&&!(e.delta<(r[s][0]*t[r[s][1]]+r[s+1][0]*t[r[s+1][1]])/2&&r[s][0]*t[r[s][1]]>=a);++s);var l=r[s][0],c=r[s][1];if("year"===c){if(null!==n.minTickSize&&void 0!==n.minTickSize&&"year"===n.minTickSize[1])l=Math.floor(n.minTickSize[0]);else{var u=parseFloat("1e"+Math.floor(Math.log(e.delta/t.year)/Math.LN10)),h=e.delta/t.year/u;l=h<1.5?1:h<3?2:h<7.5?5:10,l*=u}l<1&&(l=1)}e.tickSize=n.tickSize||[l,c];var p=e.tickSize[0],f=p*t[c=e.tickSize[1]];"microsecond"===c?i.setMicroseconds(ye(i.getMicroseconds(),p)):"millisecond"===c?i.setMilliseconds(ye(i.getMilliseconds(),p)):"second"===c?i.setSeconds(ye(i.getSeconds(),p)):"minute"===c?i.setMinutes(ye(i.getMinutes(),p)):"hour"===c?i.setHours(ye(i.getHours(),p)):"month"===c?i.setMonth(ye(i.getMonth(),p)):"quarter"===c?i.setMonth(3*ye(i.getMonth()/3,p)):"year"===c&&i.setFullYear(ye(i.getFullYear(),p)),f>=t.millisecond&&i.setMicroseconds(0),f>=t.second&&i.setMilliseconds(0),f>=t.minute&&i.setSeconds(0),f>=t.hour&&i.setMinutes(0),f>=t.day&&i.setHours(0),f>=4*t.day&&i.setDate(1),f>=2*t.month&&i.setMonth(ye(i.getMonth(),3)),f>=2*t.quarter&&i.setMonth(ye(i.getMonth(),6)),f>=t.year&&i.setMonth(0);var d,m,g=0,v=Number.NaN;do{if(m=v,d=i.getTime(),v=n&&"seconds"===n.timeBase?d/1e3:n&&"microseconds"===n.timeBase?1e3*d:d,o.push(v),"month"===c||"quarter"===c)if(p<1){i.setDate(1);var x=i.getTime();i.setMonth(i.getMonth()+("quarter"===c?3:1));var b=i.getTime();i.setTime(v+g*t.hour+(b-x)*p),g=i.getHours(),i.setHours(0)}else i.setMonth(i.getMonth()+p*("quarter"===c?3:1));else"year"===c?i.setFullYear(i.getFullYear()+p):"seconds"===n.timeBase?i.setTime(1e3*(v+f)):"microseconds"===n.timeBase?i.setTime((v+f)/1e3):i.setTime(v+f)}while(v<e.max&&v!==m);return o}function Ae(e,t,n,o,i,a){this.axisName=e,this.position=t,this.padding=n,this.placeholder=o,this.axisLabel=i,this.surface=a,this.width=0,this.height=0,this.elem=null}C.push({init:function(e){e.hooks.processOptions.push(function(e){var t=e.getAxes();Object.keys(t).forEach(function(e){var n=t[e],o=n.options;if("time"===o.mode){if(n.tickGenerator=ze,"tickFormatter"in o&&"function"==typeof o.tickFormatter)return;n.tickFormatter=function(e,t){var n=Me(e,t.options);if(null!=o.timeformat)return Te(n,o.timeformat,o.monthNames,o.dayNames);var i,a=t.options.tickSize&&"quarter"===t.options.tickSize[1]||t.options.minTickSize&&"quarter"===t.options.minTickSize[1];i="seconds"===o.timeBase?Se:"microseconds"===o.timeBase?Ce:Pe;var r,s,l=t.tickSize[0]*i[t.tickSize[1]],c=t.max-t.min,u=o.twelveHourClock?" %p":"",h=o.twelveHourClock?"%I":"%H";if(r="seconds"===o.timeBase?1:"microseconds"===o.timeBase?1e6:1e3,l<i.second){var p=-Math.floor(Math.log10(l/r));String(l).indexOf("25")>-1&&p++,s="%S.%"+p+"s"}else s=l<i.minute?h+":%M:%S"+u:l<i.day?c<2*i.day?h+":%M"+u:"%b %d "+h+":%M"+u:l<i.month?"%b %d":a&&l<i.quarter||!a&&l<i.year?c<i.year?"%b":"%b %Y":a&&l<i.year?c<i.year?"Q%q":"Q%q %Y":"%Y";return Te(n,s,o.monthNames,o.dayNames)}}})})},options:{xaxis:{timezone:null,timeformat:null,twelveHourClock:!1,monthNames:null,timeBase:"seconds"},yaxis:{timeBase:"seconds"}},name:"time",version:"1.0"}),Ae.prototype.calculateSize=function(){var e=this.axisName+"Label",t=e+"Layer",n=e+" axisLabels",o=this.surface.getTextInfo(t,this.axisLabel,n);this.labelWidth=o.width,this.labelHeight=o.height,"left"===this.position||"right"===this.position?(this.width=this.labelHeight+this.padding,this.height=0):(this.width=0,this.height=this.labelHeight+this.padding)},Ae.prototype.transforms=function(e,t,n,o){var i,a,r=[];if(0===t&&0===n||((i=o.createSVGTransform()).setTranslate(t,n),r.push(i)),0!==e){a=o.createSVGTransform();var s=Math.round(this.labelWidth/2);a.setRotate(e,s,0),r.push(a)}return r},Ae.prototype.calculateOffsets=function(e){var t={x:0,y:0,degrees:0};return"bottom"===this.position?(t.x=e.left+e.width/2-this.labelWidth/2,t.y=e.top+e.height-this.labelHeight):"top"===this.position?(t.x=e.left+e.width/2-this.labelWidth/2,t.y=e.top):"left"===this.position?(t.degrees=-90,t.x=e.left-this.labelWidth/2,t.y=e.height/2+e.top):"right"===this.position&&(t.degrees=90,t.x=e.left+e.width-this.labelWidth/2,t.y=e.height/2+e.top),t.x=Math.round(t.x),t.y=Math.round(t.y),t},Ae.prototype.cleanup=function(){var e=this.axisName+"Label",t=e+"Layer",n=e+" axisLabels";this.surface.removeText(t,0,0,this.axisLabel,n)},Ae.prototype.draw=function(e){var t=this.axisName+"Label",n=t+"Layer",o=t+" axisLabels",i=this.calculateOffsets(e),a={position:"absolute",bottom:"",right:"",display:"inline-block","white-space":"nowrap"},r=this.surface.getSVGLayer(n),s=this.transforms(i.degrees,i.x,i.y,r.parentNode);this.surface.addText(n,0,0,this.axisLabel,o,void 0,void 0,void 0,void 0,s),this.surface.render(),Object.keys(a).forEach(function(e){r.style[e]=a[e]})},C.push({init:function(e){e.hooks.processOptions.push(function(e,t){if(t.axisLabels.show){var n={};e.hooks.axisReserveSpace.push(function(e,t){var o=t.options,i=t.direction+t.n;if(t.labelHeight+=t.boxPosition.centerY,t.labelWidth+=t.boxPosition.centerX,o&&o.axisLabel&&t.show){var a=void 0===o.axisLabelPadding?2:o.axisLabelPadding,r=n[i];r||(r=new Ae(i,o.position,a,e.getPlaceholder(),o.axisLabel,e.getSurface()),n[i]=r),r.calculateSize(),t.labelHeight+=r.height,t.labelWidth+=r.width}}),e.hooks.draw.push(function(e,t){var o=e.getAxes();Object.keys(o).forEach(function(e){var t=o[e],i=t.options;if(i&&i.axisLabel&&t.show){var a=t.direction+t.n;n[a].draw(t.box)}})}),e.hooks.shutdown.push(function(e,t){for(var o in n)n[o].cleanup()})}})},options:{axisLabels:{show:!0}},name:"axisLabels",version:"3.0"}),C.push({init:function(e){var t={first:{x:-1,y:-1},second:{x:-1,y:-1},show:!1,currentMode:"xy",active:!1},n=y.SNAPPING_CONSTANT,o={};function i(){if(!d())return null;if(!t.show)return null;var n={},o={x:t.first.x,y:t.first.y},i={x:t.second.x,y:t.second.y};"x"===s(e)&&(o.y=0,i.y=e.height()),"y"===s(e)&&(o.x=0,i.x=e.width());var a=e.getAxes();return Object.keys(a).forEach(function(e){var t=a[e];if(t.used){var r=t.c2p(o[t.direction]),s=t.c2p(i[t.direction]);n[e]={from:Math.min(r,s),to:Math.max(r,s)}}}),n}function a(){var t=i();u(e.getPlaceholder(),"plotselected",[t]),t.xaxis&&t.yaxis&&u(e.getPlaceholder(),"selected",[{x1:t.xaxis.from,y1:t.yaxis.from,x2:t.xaxis.to,y2:t.yaxis.to}])}function r(e,t,n){return t<e?e:t>n?n:t}function s(e){var n=e.getOptions();return"smart"===n.selection.mode?t.currentMode:n.selection.mode}function l(o,i){var a=e.getPlaceholder().getBoundingClientRect(),l=a.left+window.scrollX,c=a.top+window.scrollY,u=e.getPlotOffset();o.x=r(0,i.pageX-l-u.left,e.width()),o.y=r(0,i.pageY-c-u.top,e.height()),o!==t.first&&function(e){if(t.first){var o={x:e.x-t.first.x,y:e.y-t.first.y};Math.abs(o.x)<n?t.currentMode="y":Math.abs(o.y)<n?t.currentMode="x":t.currentMode="xy"}}(o),"y"===s(e)&&(o.x=o===t.first?0:e.width()),"x"===s(e)&&(o.y=o===t.first?0:e.height())}function c(n){null!=n.pageX&&(l(t.second,n),d()?(t.show=!0,e.triggerRedrawOverlay()):h(!0))}function h(n){t.show&&(t.show=!1,t.currentMode="",e.triggerRedrawOverlay(),n||u(e.getPlaceholder(),"plotunselected",[]))}function p(t,n){var o,i,a,r,s=e.getAxes();for(var l in s)if((o=s[l]).direction===n&&(t[r=n+o.n+"axis"]||1!==o.n||(r=n+"axis"),t[r])){i=t[r].from,a=t[r].to;break}if(t[r]||(o="x"===n?e.getXAxes()[0]:e.getYAxes()[0],i=t[n+"1"],a=t[n+"2"]),null!=i&&null!=a&&i>a){var c=i;i=a,a=c}return{from:i,to:a,axis:o}}function d(){var n=e.getOptions().selection.minSize;return Math.abs(t.second.x-t.first.x)>=n&&Math.abs(t.second.y-t.first.y)>=n}function m(n){if(0===n.button){var r=n.currentTarget;!function(n){var i=e.getOptions();0===n.button&&null!==i.selection.mode&&(t.currentMode="xy",document.body.focus(),void 0!==document.onselectstart&&null==o.onselectstart&&(o.onselectstart=document.onselectstart,document.onselectstart=function(){return!1}),void 0!==document.ondrag&&null==o.ondrag&&(o.ondrag=document.ondrag,document.ondrag=function(){return!1}),l(t.first,n),t.active=!0)}(n),r.setPointerCapture(n.pointerId),r.addEventListener("pointermove",s),r.addEventListener("pointerup",h),r.addEventListener("pointercancel",h)}function s(n){!function(n){t.active&&(c(n),u(e.getPlaceholder(),"plotselecting",[i()]))}(n)}function h(n){!function(n){void 0!==document.onselectstart&&(document.onselectstart=o.onselectstart),void 0!==document.ondrag&&(document.ondrag=o.ondrag),t.active=!1,c(n),d()?a():(u(e.getPlaceholder(),"plotunselected",[]),u(e.getPlaceholder(),"plotselecting",[null]))}(n),r.removeEventListener("pointermove",s),r.removeEventListener("pointerup",h),r.removeEventListener("pointercancel",h),r.releasePointerCapture(n.pointerId)}}e.clearSelection=h,e.setSelection=function(n,o){var i;"y"===s(e)?(t.first.x=0,t.second.x=e.width()):(i=p(n,"x"),t.first.x=i.axis.p2c(i.from),t.second.x=i.axis.p2c(i.to)),"x"===s(e)?(t.first.y=0,t.second.y=e.height()):(i=p(n,"y"),t.first.y=i.axis.p2c(i.from),t.second.y=i.axis.p2c(i.to)),t.show=!0,e.triggerRedrawOverlay(),!o&&d()&&a()},e.getSelection=i,e.hooks.bindEvents.push(function(e,t){null!=e.getOptions().selection.mode&&e.addEventHandler("pointerdown",m,t,0)}),e.hooks.drawOverlay.push(function(e,n){if(t.show&&d()){var o=e.getPlotOffset(),i=e.getOptions();n.save(),n.translate(o.left,o.top);var a=v.parse(i.selection.color),r=i.selection.visualization,l=i.selection.displaySelectionDecorations,c=1;"fill"===r&&(c=.8),n.strokeStyle=a.scale("a",c).toString(),n.lineWidth=1,n.lineJoin=i.selection.shape,n.fillStyle=a.scale("a",.4).toString();var u=Math.min(t.first.x,t.second.x)+.5,h=u,p=Math.min(t.first.y,t.second.y)+.5,f=p,m=Math.abs(t.second.x-t.first.x)-1,g=Math.abs(t.second.y-t.first.y)-1;"x"===s(e)&&(g+=p,p=0),"y"===s(e)&&(m+=u,u=0),"fill"===r?(n.fillRect(u,p,m,g),n.strokeRect(u,p,m,g)):(n.fillRect(0,0,e.width(),e.height()),n.clearRect(u,p,m,g),l&&function(e,t,n,o,i,a,r,s){var l=15,c=Math.max(0,Math.min(l,o/2-2,i/2-2));e.fillStyle="#ffffff","xy"===s&&(e.beginPath(),e.moveTo(t,n+c),e.lineTo(t-3,n+c),e.lineTo(t-3,n-3),e.lineTo(t+c,n-3),e.lineTo(t+c,n),e.lineTo(t,n),e.closePath(),e.moveTo(t,n+i-c),e.lineTo(t-3,n+i-c),e.lineTo(t-3,n+i+3),e.lineTo(t+c,n+i+3),e.lineTo(t+c,n+i),e.lineTo(t,n+i),e.closePath(),e.moveTo(t+o,n+c),e.lineTo(t+o+3,n+c),e.lineTo(t+o+3,n-3),e.lineTo(t+o-c,n-3),e.lineTo(t+o-c,n),e.lineTo(t+o,n),e.closePath(),e.moveTo(t+o,n+i-c),e.lineTo(t+o+3,n+i-c),e.lineTo(t+o+3,n+i+3),e.lineTo(t+o-c,n+i+3),e.lineTo(t+o-c,n+i),e.lineTo(t+o,n+i),e.closePath(),e.stroke(),e.fill()),t=a,n=r,"x"===s&&(e.beginPath(),e.moveTo(t,n+l),e.lineTo(t,n-l),e.lineTo(t-3,n-l),e.lineTo(t-3,n+l),e.closePath(),e.moveTo(t+o,n+l),e.lineTo(t+o,n-l),e.lineTo(t+o+3,n-l),e.lineTo(t+o+3,n+l),e.closePath(),e.stroke(),e.fill()),"y"===s&&(e.beginPath(),e.moveTo(t-l,n),e.lineTo(t+l,n),e.lineTo(t+l,n-3),e.lineTo(t-l,n-3),e.closePath(),e.moveTo(t-l,n+i),e.lineTo(t+l,n+i),e.lineTo(t+l,n+i+3),e.lineTo(t-l,n+i+3),e.closePath(),e.stroke(),e.fill())}(n,u,p,m,g,h,f,s(e))),n.restore()}}),e.hooks.shutdown.push(function(e,t){f(t,"pointerdown",m)})},options:{selection:{mode:null,visualization:"focus",displaySelectionDecorations:!0,color:"#888888",shape:"round",minSize:5}},name:"selection",version:"1.1"});var Oe=1,Ie=t.getPixelRatio;function Re(e,n){var o=e.filter(We);Oe=Ie(n.getContext("2d"));var i=o.map(function(e){var n=new Image,o=new Promise(function(e,n){return e.sourceDescription='<info className="'+n.className+'" tagName="'+n.tagName+'" id="'+n.id+'">',e.sourceComponent=n,function(o,i){var a,r,s,l,c;e.onload=function(t){e.successfullyLoaded=!0,o(e)},e.onabort=function(t){e.successfullyLoaded=!1,console.log("Can't generate temp image from "+e.sourceDescription+". It is possible that it is missing some properties or its content is not supported by this browser. Source component:",e.sourceComponent),o(e)},e.onerror=function(t){e.successfullyLoaded=!1,console.log("Can't generate temp image from "+e.sourceDescription+". It is possible that it is missing some properties or its content is not supported by this browser. Source component:",e.sourceComponent),o(e)},r=e,"CANVAS"===(a=n).tagName&&(s=a,r.src=s.toDataURL("image/png")),"svg"===a.tagName&&(l=a,c=r,t.isSafari()||t.isMobileSafari()?function(e,t){var n,o,i=Ye(De(document),e);i=Fe(i),o=function(e){var t="";const n=new Uint8Array(e);for(var o=0;o<n.length;o+=16384)t+=String.fromCharCode.apply(null,n.subarray(o,o+16384));return t}((new(TextEncoder||TextEncoderLite)).encode(i)),n="data:image/svg+xml;base64,"+btoa(o),t.src=n}(l,c):function(e,t){var n=Ye(De(document),e);n=Fe(n);var o=new Blob([n],{type:"image/svg+xml;charset=utf-8"}),i=(self.URL||self.webkitURL||self).createObjectURL(o);t.src=i}(l,c)),r.srcImgTagName=a.tagName,function(e,t){t.genLeft=e.getBoundingClientRect().left,t.genTop=e.getBoundingClientRect().top,"CANVAS"===e.tagName&&(t.genRight=t.genLeft+e.width,t.genBottom=t.genTop+e.height),"svg"===e.tagName&&(t.genRight=e.getBoundingClientRect().right,t.genBottom=e.getBoundingClientRect().bottom)}(a,r)}}(n,e));return o}),a=Promise.all(i).then(function(e){return function(t){var n=function(e,t){var n=function(e,t){var n=0;if(0===e.length)n=-1;else{var o=e[0].genLeft,i=e[0].genTop,a=e[0].genRight,r=e[0].genBottom,s=0;for(s=1;s<e.length;s++)o>e[s].genLeft&&(o=e[s].genLeft),i>e[s].genTop&&(i=e[s].genTop);for(s=1;s<e.length;s++)a<e[s].genRight&&(a=e[s].genRight),r<e[s].genBottom&&(r=e[s].genBottom);if(a-o<=0||r-i<=0)n=-2;else{for(t.width=Math.round(a-o),t.height=Math.round(r-i),s=0;s<e.length;s++)e[s].xCompOffset=e[s].genLeft-o,e[s].yCompOffset=e[s].genTop-i;!function(e,t){void 0!==t.find(function(e){return"svg"===e.srcImgTagName})&&Oe<1&&(e.width=e.width*Oe,e.height=e.height*Oe)}(t,e)}}return n}(e,t);if(0===n)for(var o=t.getContext("2d"),i=0;i<e.length;i++)!0===e[i].successfullyLoaded&&o.drawImage(e[i],e[i].xCompOffset*Oe,e[i].yCompOffset*Oe);return n}(t,e);return n}}(n),Xe);return a}function We(e){var t=!0,n=!0;return null==e?n=!1:"CANVAS"===e.tagName&&(e.getBoundingClientRect().right!==e.getBoundingClientRect().left&&e.getBoundingClientRect().bottom!==e.getBoundingClientRect().top||(t=!1)),n&&t&&"visible"===window.getComputedStyle(e).visibility}function De(e){for(var t=e.styleSheets,n=[],o=0;o<t.length;o++)try{for(var i=t[o].cssRules||[],a=0;a<i.length;a++){var r=i[a];n.push(r.cssText)}}catch(e){console.log("Failed to get some css rules")}return n}function Ye(e,t){return['<svg class="snapshot '+t.classList+'" width="'+t.width.baseVal.value*Oe+'" height="'+t.height.baseVal.value*Oe+'" viewBox="0 0 '+t.width.baseVal.value+" "+t.height.baseVal.value+'" xmlns="http://www.w3.org/2000/svg">',"<style>","/* <![CDATA[ */",e.join("\n"),"/* ]]> */","</style>",t.innerHTML,"</svg>"].join("\n")}function Fe(e){var t="";return e.match(/^<svg[^>]+xmlns="http:\/\/www\.w3\.org\/2000\/svg"/)||(t=e.replace(/^<svg/,'<svg xmlns="http://www.w3.org/2000/svg"')),e.match(/^<svg[^>]+"http:\/\/www\.w3\.org\/1999\/xlink"/)||(t=e.replace(/^<svg/,'<svg xmlns:xlink="http://www.w3.org/1999/xlink"')),'<?xml version="1.0" standalone="no"?>\r\n'+t}function Xe(){return-100}function Be(e){var t="",n=e.name,o=e.xPos,i=e.yPos,a=e.fillColor,r=e.strokeColor,s=e.strokeWidth;switch(n){case"circle":default:t='<use xlink:href="#circle" class="legendIcon" x="'+o+'" y="'+i+'" fill="'+a+'" stroke="'+r+'" stroke-width="'+s+'" width="1.5em" height="1.5em"/>';break;case"diamond":t='<use xlink:href="#diamond" class="legendIcon" x="'+o+'" y="'+i+'" fill="'+a+'" stroke="'+r+'" stroke-width="'+s+'" width="1.5em" height="1.5em"/>';break;case"cross":t='<use xlink:href="#cross" class="legendIcon" x="'+o+'" y="'+i+'" stroke="'+r+'" stroke-width="'+s+'" width="1.5em" height="1.5em"/>';break;case"rectangle":t='<use xlink:href="#rectangle" class="legendIcon" x="'+o+'" y="'+i+'" fill="'+a+'" stroke="'+r+'" stroke-width="'+s+'" width="1.5em" height="1.5em"/>';break;case"plus":t='<use xlink:href="#plus" class="legendIcon" x="'+o+'" y="'+i+'" stroke="'+r+'" stroke-width="'+s+'" width="1.5em" height="1.5em"/>';break;case"bar":t='<use xlink:href="#bars" class="legendIcon" x="'+o+'" y="'+i+'" fill="'+a+'" width="1.5em" height="1.5em"/>';break;case"area":t='<use xlink:href="#area" class="legendIcon" x="'+o+'" y="'+i+'" fill="'+a+'" width="1.5em" height="1.5em"/>';break;case"line":t='<use xlink:href="#line" class="legendIcon" x="'+o+'" y="'+i+'" stroke="'+r+'" stroke-width="'+s+'" width="1.5em" height="1.5em"/>'}return t}C.push({init:function(e){e.composeImages=Re},name:"composeImages",version:"1.0"});function Ge(e,t){for(var n in e)if(e.hasOwnProperty(n)&&e[n]!==t[n])return!0;return!1}C.push({init:function(e){e.hooks.setupGrid.push(function(e){var t=e.getOptions(),n=e.getData(),o=t.legend.labelFormatter,i=t.legend.legendEntries,a=t.legend.plotOffset,r=function(e,t,n){var o=t,i=e.reduce(function(e,t,n){var i=o?o(t.label,t):t.label;if(!t.hasOwnProperty("label")||i){var a={label:i||"Plot "+(n+1),color:t.color,options:{lines:t.lines,points:t.points,bars:t.bars}};e.push(a)}return e},[]);if(n)if("function"==typeof n)i.sort(n);else if("reverse"===n)i.reverse();else{var a="descending"!==n;i.sort(function(e,t){return e.label===t.label?0:e.label<t.label!==a?1:-1})}return i}(n,o,t.legend.sorted),s=e.getPlotOffset();(function(e,t){if(!e||!t)return!0;if(e.length!==t.length)return!0;var n,o,i;for(n=0;n<t.length;n++){if(o=t[n],i=e[n],o.label!==i.label)return!0;if(o.color!==i.color)return!0;if(Ge(o.options.lines,i.options.lines))return!0;if(Ge(o.options.points,i.options.points))return!0;if(Ge(o.options.bars,i.options.bars))return!0}return!1}(i,r)||Ge(a,s))&&function(e,t,n,o){if(null!=t.legend.container)t.legend.container.innerHTML="";else for(var i=n.querySelectorAll(".legend"),a=0;a<i.length;a++)i[a].remove();if(t.legend.show){var r,s,l,c,u=t.legend.legendEntries=o,h=t.legend.plotOffset=e.getPlotOffset(),p=[],f=0,d="",m=t.legend.position,g=t.legend.margin,v={name:"",label:"",xPos:"",yPos:""};p[f++]='<svg class="legendLayer" style="width:inherit;height:inherit;">',p[f++]='<rect class="background" width="100%" height="100%"/>',p[f++]='<defs><symbol id="line" fill="none" viewBox="-5 -5 25 25"><polyline points="0,15 5,5 10,10 15,0"/></symbol><symbol id="area" stroke-width="1" viewBox="-5 -5 25 25"><polyline points="0,15 5,5 10,10 15,0, 15,15, 0,15"/></symbol><symbol id="bars" stroke-width="1" viewBox="-5 -5 25 25"><polyline points="1.5,15.5 1.5,12.5, 4.5,12.5 4.5,15.5 6.5,15.5 6.5,3.5, 9.5,3.5 9.5,15.5 11.5,15.5 11.5,7.5 14.5,7.5 14.5,15.5 1.5,15.5"/></symbol><symbol id="circle" viewBox="-5 -5 25 25"><circle cx="0" cy="15" r="2.5"/><circle cx="5" cy="5" r="2.5"/><circle cx="10" cy="10" r="2.5"/><circle cx="15" cy="0" r="2.5"/></symbol><symbol id="rectangle" viewBox="-5 -5 25 25"><rect x="-2.1" y="12.9" width="4.2" height="4.2"/><rect x="2.9" y="2.9" width="4.2" height="4.2"/><rect x="7.9" y="7.9" width="4.2" height="4.2"/><rect x="12.9" y="-2.1" width="4.2" height="4.2"/></symbol><symbol id="diamond" viewBox="-5 -5 25 25"><path d="M-3,15 L0,12 L3,15, L0,18 Z"/><path d="M2,5 L5,2 L8,5, L5,8 Z"/><path d="M7,10 L10,7 L13,10, L10,13 Z"/><path d="M12,0 L15,-3 L18,0, L15,3 Z"/></symbol><symbol id="cross" fill="none" viewBox="-5 -5 25 25"><path d="M-2.1,12.9 L2.1,17.1, M2.1,12.9 L-2.1,17.1 Z"/><path d="M2.9,2.9 L7.1,7.1 M7.1,2.9 L2.9,7.1 Z"/><path d="M7.9,7.9 L12.1,12.1 M12.1,7.9 L7.9,12.1 Z"/><path d="M12.9,-2.1 L17.1,2.1 M17.1,-2.1 L12.9,2.1 Z"/></symbol><symbol id="plus" fill="none" viewBox="-5 -5 25 25"><path d="M0,12 L0,18, M-3,15 L3,15 Z"/><path d="M5,2 L5,8 M2,5 L8,5 Z"/><path d="M10,7 L10,13 M7,10 L13,10 Z"/><path d="M15,-3 L15,3 M12,0 L18,0 Z"/></symbol></defs>';var x=0,b=[],y=window.getComputedStyle(document.querySelector("body"));for(c=0;c<u.length;++c){let n=c%t.legend.noColumns;r=u[c],v.label=r.label;var w=e.getSurface().getTextInfo("",v.label,{style:y.fontStyle,variant:y.fontVariant,weight:y.fontWeight,size:parseInt(y.fontSize),lineHeight:parseInt(y.lineHeight),family:y.fontFamily}).width;b[n]?w>b[n]&&(b[n]=w+48):b[n]=w+48}for(c=0;c<u.length;++c){let e=c%t.legend.noColumns;r=u[c],l="",v.label=r.label,v.xPos=x+3+"px",x+=b[e],(c+1)%t.legend.noColumns===0&&(x=0),v.yPos=1.5*Math.floor(c/t.legend.noColumns)+"em",r.options.lines.show&&r.options.lines.fill&&(v.name="area",v.fillColor=r.color,l+=Be(v)),r.options.bars.show&&(v.name="bar",v.fillColor=r.color,l+=Be(v)),r.options.lines.show&&!r.options.lines.fill&&(v.name="line",v.strokeColor=r.color,v.strokeWidth=r.options.lines.lineWidth,l+=Be(v)),r.options.points.show&&(v.name=r.options.points.symbol,v.strokeColor=r.color,v.fillColor=r.options.points.fillColor,v.strokeWidth=r.options.points.lineWidth,l+=Be(v)),s='<text x="'+v.xPos+'" y="'+v.yPos+'" text-anchor="start"><tspan dx="2em" dy="1.2em">'+v.label+"</tspan></text>",p[f++]="<g>"+l+s+"</g>"}p[f++]="</svg>",null==g[0]&&(g=[g,g]),"n"===m.charAt(0)?d+="top:"+(g[1]+h.top)+"px;":"s"===m.charAt(0)&&(d+="bottom:"+(g[1]+h.bottom)+"px;"),"e"===m.charAt(1)?d+="right:"+(g[0]+h.right)+"px;":"w"===m.charAt(1)&&(d+="left:"+(g[0]+h.left)+"px;");var T=6;for(c=0;c<b.length;++c)T+=b[c];var k,M=1.6*Math.ceil(u.length/t.legend.noColumns);t.legend.container?(t.legend.container.innerHTML=p.join(""),t.legend.container.style.width=T+"px",t.legend.container.style.height=M+"em"):((k=document.createElement("div")).className="legend",k.style.cssText="position:absolute;"+d,k.innerHTML=p.join(""),k.style.width=T+"px",k.style.height=M+"em",k.style.pointerEvents="none",n.appendChild(k))}}(e,t,e.getPlaceholder(),r)})},options:{legend:{show:!1,noColumns:1,labelFormatter:null,container:null,position:"ne",margin:5,sorted:null}},name:"legend",version:"1.0"}),e.plot=function(t,n,o){return L("string"==typeof t?document.querySelector(t):t instanceof e?t[0]:t,n,o)},e.plot.plugins=C,e.plot.version="5.1.0",e.plot.saturated=b,e.plot.browser=t,e.plot.uiConstants=y,e.plot.drawSeries=w,e.plot.linearTickGenerator=N,e.plot.defaultTickFormatter=k,e.plot.expRepTickFormatter=M,e.plot.logTicksGenerator=Z,e.plot.logTickFormatter=X,e.plot.formatDate=Te,e.plot.makeUtcWrapper=ke,e.plot.dateGenerator=Me,e.plot.dateTickGenerator=ze,e.plot.composeImages=Re;var He=v.extract;e.color=Object.create(v),e.color.extract=function(t,n){return t instanceof e&&t.length&&(t=t[0]),He(t,n)},e.fn.plot=function(e,t){return this.each(function(){L(this,e,t)})},"undefined"!=typeof window&&(window.Flot||(window.Flot={}),window.Flot.Canvas=d)}(jQuery);
1
+ !function(e){"use strict";var t={getPageXY:function(e){var t=document.documentElement;return{X:e.clientX+(window.pageXOffset||t.scrollLeft)-(t.clientLeft||0),Y:e.clientY+(window.pageYOffset||t.scrollTop)-(t.clientTop||0)}},getPixelRatio:function(e){return(window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)},isSafari:function(){var e=window.top;return!!e&&(/constructor/i.test(e.HTMLElement)||"[object SafariRemoteNotification]"===(!e.safari||void 0!==e.safari&&e.safari.pushNotification).toString())},isMobileSafari:function(){return navigator.userAgent.match(/(iPod|iPhone|iPad)/)&&navigator.userAgent.match(/AppleWebKit/)},isOpera:function(){return!!window.opr&&!!window.opr.addons||!!window.opera||navigator.userAgent.indexOf(" OPR/")>=0},isFirefox:function(){return"undefined"!=typeof InstallTrigger},isIE:function(){return!!document.documentMode},isEdge:function(){return!t.isIE()&&!!window.StyleMedia},isChrome:function(){return!!window.chrome&&!!window.chrome.webstore},isBlink:function(){return(t.isChrome()||t.isOpera())&&!!window.CSS}};function n(e){if(!e||"[object Object]"!==Object.prototype.toString.call(e))return!1;var t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}function i(e){if(Array.isArray(e))return e.map(i);if(n(e)){for(var t={},o=Object.keys(e),a=0;a<o.length;a++){var r=o[a],s=e[r];void 0!==s&&(t[r]=i(s))}return t}return e}function o(e,t){var a=Array.prototype.slice.call(arguments,2);"boolean"!=typeof e&&(a.unshift(t),t=e,e=!1);for(var r=0;r<a.length;r++){var s=a[r];if(null!=s)for(var l=Object.keys(s),c=0;c<l.length;c++){var u=l[c];if("__proto__"!==u&&"constructor"!==u){var h=s[u];void 0!==h&&(e&&Array.isArray(h)?t[u]=i(h):e&&n(h)?("object"==typeof t[u]&&null!=t[u]||(t[u]={}),o(!0,t[u],h)):t[u]=h)}}}return t}function a(e){return e.clientWidth}function r(e){return e.clientHeight}function s(e,t,n){if(void 0===n)return getComputedStyle(e)[t];e.style[t]="number"==typeof n?n+"px":n}var l=new WeakMap;function c(e,t,n){var i=l.get(e);if(i||(i={},l.set(e,i)),void 0===n)return i[t];i[t]=n}var u=function(e,t,n){var i=new CustomEvent(t,{detail:n||[],bubbles:!0,cancelable:!0});return e.dispatchEvent(i),i};function h(e,t,n){return u(e,t,n)}var p=new WeakMap;function f(e,t,n){e.addEventListener(t,n);var i=p.get(e);i||(i=[],p.set(e,i)),i.push({type:t,handler:n})}function d(e,t,n){var i;if(t&&n)return e.removeEventListener(t,n),void((i=p.get(e))&&p.set(e,i.filter(function(e){return e.type!==t||e.handler!==n})));if(i=p.get(e)){for(var o=[],a=0;a<i.length;a++)t&&i[a].type!==t?o.push(i[a]):e.removeEventListener(i[a].type,i[a].handler);p.set(e,o)}}var m=function(e,n){var i=n.getElementsByClassName(e)[0];if(!i&&((i=document.createElement("canvas")).className=e,i.style.direction="ltr",i.style.position="absolute",i.style.left="0px",i.style.top="0px",n.appendChild(i),!i.getContext))throw new Error("Canvas is not available.");this.element=i;var o=this.context=i.getContext("2d");this.pixelRatio=t.getPixelRatio(o);var s=a(n),l=r(n);this.resize(s,l),this.SVGContainer=null,this.SVG={},this._textCache={}};function g(e,t){e.transform.baseVal.clear(),t&&t.forEach(function(t){e.transform.baseVal.appendItem(t)})}m.prototype.resize=function(e,t){e=e<10?10:e,t=t<10?10:t;var n=this.element,i=this.context,o=this.pixelRatio;this.width!==e&&(n.width=e*o,n.style.width=e+"px",this.width=e),this.height!==t&&(n.height=t*o,n.style.height=t+"px",this.height=t),i.restore(),i.save(),i.scale(o,o)},m.prototype.clear=function(){this.context.clearRect(0,0,this.width,this.height)},m.prototype.render=function(){var e=this._textCache;for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)){var n=this.getSVGLayer(t),i=e[t],o=n.style.display;for(var a in n.style.display="none",i)if(Object.prototype.hasOwnProperty.call(i,a)){var r=i[a];for(var s in r)if(Object.prototype.hasOwnProperty.call(r,s)){for(var l,c=r[s],u=c.positions,h=0;u[h];h++)if((l=u[h]).active)l.rendered||(n.appendChild(l.element),l.rendered=!0);else if(u.splice(h--,1),l.rendered){for(;l.element.firstChild;)l.element.removeChild(l.element.firstChild);l.element.parentNode.removeChild(l.element)}0===u.length&&(c.measured?c.measured=!1:delete r[s])}}n.style.display=o}},m.prototype.getSVGLayer=function(e){var t,n=this.SVG[e];return n||(this.SVGContainer?t=this.SVGContainer.firstChild:(this.SVGContainer=document.createElement("div"),this.SVGContainer.className="flot-svg",this.SVGContainer.style.position="absolute",this.SVGContainer.style.top="0px",this.SVGContainer.style.left="0px",this.SVGContainer.style.height="100%",this.SVGContainer.style.width="100%",this.SVGContainer.style.pointerEvents="none",this.element.parentNode.appendChild(this.SVGContainer),(t=document.createElementNS("http://www.w3.org/2000/svg","svg")).style.width="100%",t.style.height="100%",this.SVGContainer.appendChild(t)),(n=document.createElementNS("http://www.w3.org/2000/svg","g")).setAttribute("class",e),n.style.position="absolute",n.style.top="0px",n.style.left="0px",n.style.bottom="0px",n.style.right="0px",t&&t.appendChild(n),this.SVG[e]=n),n},m.prototype.getTextInfo=function(e,t,n,i,o){var a,r,s,l;t=""+t,a="object"==typeof n?n.style+" "+n.variant+" "+n.weight+" "+n.size+"px/"+n.lineHeight+"px "+n.family:n,null==(r=this._textCache[e])&&(r=this._textCache[e]={}),null==(s=r[a])&&(s=r[a]={});var c=function(e){return e.replace(/0|1|2|3|4|5|6|7|8|9/g,"0")}(t);if(!(l=s[c])){var u=document.createElementNS("http://www.w3.org/2000/svg","text");if(-1!==t.indexOf("<br>"))v(t,u,-9999);else{var h=document.createTextNode(t);u.appendChild(h)}u.style.position="absolute",u.style.maxWidth=o,u.setAttributeNS(null,"x",String(-9999)),u.setAttributeNS(null,"y",String(-9999)),"object"==typeof n?(u.style.font=a,u.style.fill=n.fill):"string"==typeof n&&u.setAttribute("class",n),this.getSVGLayer(e).appendChild(u);var p=u.getBBox();for(l=s[c]={width:p.width,height:p.height,measured:!0,element:u,positions:[]};u.firstChild;)u.removeChild(u.firstChild);u.parentNode&&u.parentNode.removeChild(u)}return l.measured=!0,l},m.prototype.addText=function(e,t,n,i,o,a,r,s,l,c){var u=this.getTextInfo(e,i,o,a,r),h=u.positions;"center"===s?t-=u.width/2:"right"===s&&(t-=u.width),"middle"===l?n-=u.height/2:"bottom"===l&&(n-=u.height),n+=.75*u.height;for(var p,f=0;h[f];f++){if((p=h[f]).x===t&&p.y===n&&p.text===i)return p.active=!0,void g(p.element,c);if(!1===p.active)return p.active=!0,p.text=i,-1!==i.indexOf("<br>")?(n-=.25*u.height,v(i,p.element,t)):p.element.textContent=i,p.element.setAttributeNS(null,"x",t),p.element.setAttributeNS(null,"y",n),p.x=t,p.y=n,void g(p.element,c)}p={active:!0,rendered:!1,element:h.length?u.element.cloneNode():u.element,text:i,x:t,y:n},h.push(p),-1!==i.indexOf("<br>")?(n-=.25*u.height,v(i,p.element,t)):p.element.textContent=i,p.element.setAttributeNS(null,"x",t),p.element.setAttributeNS(null,"y",n),p.element.style.textAlign=s,g(p.element,c)};var v=function(e,t,n){var i,o,a,r=e.split("<br>");for(o=0;o<r.length;o++)t.childNodes[o]?i=t.childNodes[o]:(i=document.createElementNS("http://www.w3.org/2000/svg","tspan"),t.appendChild(i)),i.textContent=r[o],a=(0===o?0:1)+"em",i.setAttributeNS(null,"dy",a),i.setAttributeNS(null,"x",n)};m.prototype.removeText=function(e,t,n,i,o,a){var r,s;if(null==i){var l=this._textCache[e];if(null!=l)for(var c in l)if(Object.prototype.hasOwnProperty.call(l,c)){var u=l[c];for(var h in u)if(Object.prototype.hasOwnProperty.call(u,h)){var p=u[h].positions;null!=p&&p.forEach(function(e){e.active=!1})}}}else(p=(r=this.getTextInfo(e,i,o,a)).positions).forEach(function(e){s=n+.75*r.height,e.x===t&&e.y===s&&e.text===i&&(e.active=!1)})},m.prototype.clearCache=function(){var e=this._textCache;for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))for(var n=this.getSVGLayer(t);n.firstChild;)n.removeChild(n.firstChild);this._textCache={}};var x={make:function(e,t,n,i){var o={};return o.r=e||0,o.g=t||0,o.b=n||0,o.a=null!=i?i:1,o.add=function(e,t){for(var n=0;n<e.length;++n)o[e.charAt(n)]+=t;return o.normalize()},o.scale=function(e,t){for(var n=0;n<e.length;++n)o[e.charAt(n)]*=t;return o.normalize()},o.toString=function(){return o.a>=1?"rgb("+[o.r,o.g,o.b].join(",")+")":"rgba("+[o.r,o.g,o.b,o.a].join(",")+")"},o.normalize=function(){function e(e,t,n){return t<e?e:t>n?n:t}return o.r=e(0,parseInt(o.r),255),o.g=e(0,parseInt(o.g),255),o.b=e(0,parseInt(o.b),255),o.a=e(0,o.a,1),o},o.clone=function(){return x.make(o.r,o.b,o.g,o.a)},o.normalize()},extract:function(e,t){var n;do{var i=t.replace(/-([a-z])/g,function(e,t){return t.toUpperCase()});if(""!==(n=(e.style[i]||getComputedStyle(e)[t]||"").toLowerCase())&&"transparent"!==n)break;e=e.parentElement}while(null!=e&&"body"!==e.nodeName.toLowerCase());return"rgba(0, 0, 0, 0)"===n&&(n="transparent"),x.parse(n)},parse:function(e){var t,n=x.make;if(t=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(e))return n(parseInt(t[1],10),parseInt(t[2],10),parseInt(t[3],10));if(t=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(e))return n(parseInt(t[1],10),parseInt(t[2],10),parseInt(t[3],10),parseFloat(t[4]));if(t=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)%\s*,\s*([0-9]+(?:\.[0-9]+)?)%\s*,\s*([0-9]+(?:\.[0-9]+)?)%\s*\)/.exec(e))return n(2.55*parseFloat(t[1]),2.55*parseFloat(t[2]),2.55*parseFloat(t[3]));if(t=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)%\s*,\s*([0-9]+(?:\.[0-9]+)?)%\s*,\s*([0-9]+(?:\.[0-9]+)?)%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(e))return n(2.55*parseFloat(t[1]),2.55*parseFloat(t[2]),2.55*parseFloat(t[3]),parseFloat(t[4]));if(t=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(e))return n(parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16));if(t=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(e))return n(parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16));var i=(e||"").trim().toLowerCase();return"transparent"===i?n(255,255,255,0):n((t=b[i]||[0,0,0])[0],t[1],t[2])}},b={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],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],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]},y={saturate:function(e){return e===1/0?Number.MAX_VALUE:e===-1/0?-Number.MAX_VALUE:e},delta:function(e,t,n){return(t-e)/n===1/0?t/n-e/n:(t-e)/n},multiply:function(e,t){return y.saturate(e*t)},multiplyAdd:function(e,t,n){if(isFinite(e*t))return y.saturate(e*t+n);for(var i=n,o=0;o<t;o++)i+=e;return y.saturate(i)},floorInBase:function(e,t){return t*Math.floor(e/t)}},w={SNAPPING_CONSTANT:20,PANHINT_LENGTH_CONSTANT:10,MINOR_TICKS_COUNT_CONSTANT:4,TICK_LENGTH_CONSTANT:10,ZOOM_DISTANCE_MARGIN:25},T=new function(){function e(e,t,n,i,o,a,r,s,l,c,u){var h,p,f,d,m=e+i,g=e+o,v=n,x=t,b=!1;h=p=f=!0,c?(b=p=f=!0,h=!1,x=t+i,v=t+o,(g=e)<(m=n)&&(d=g,g=m,m=d,h=!0,p=!1)):(h=p=f=!0,b=!1,m=e+i,g=e+o,(x=t)<(v=n)&&(d=x,x=v,v=d,b=!0,f=!1)),g<r.min||m>r.max||x<s.min||v>s.max||(m<r.min&&(m=r.min,h=!1),g>r.max&&(g=r.max,p=!1),v<s.min&&(v=s.min,b=!1),x>s.max&&(x=s.max,f=!1),m=r.p2c(m),v=s.p2c(v),g=r.p2c(g),x=s.p2c(x),a&&(l.fillStyle=a(v,x),l.fillRect(m,x,g-m,v-x)),u>0&&(h||p||f||b)&&(l.beginPath(),l.moveTo(m,v),h?l.lineTo(m,x):l.moveTo(m,x),f?l.lineTo(g,x):l.moveTo(g,x),p?l.lineTo(g,v):l.moveTo(g,v),b?l.lineTo(m,v):l.moveTo(m,v),l.stroke()))}function t(e,t,n,i,o){var a=e.fill;if(!a)return null;if(e.fillColor)return o(e.fillColor,n,i,t);var r=x.parse(t);return r.a="number"==typeof a?a:.4,r.normalize(),r.toString()}this.drawSeriesLines=function(e,n,i,o,a,r,s){n.save(),n.translate(i.left,i.top),n.lineJoin="round",e.lines.dashes&&n.setLineDash&&n.setLineDash(e.lines.dashes);var l={format:e.datapoints.format,points:e.datapoints.points,pointsize:e.datapoints.pointsize};e.decimate&&(l.points=e.decimate(e,e.xaxis.min,e.xaxis.max,o,e.yaxis.min,e.yaxis.max,a));var c=e.lines.lineWidth;n.lineWidth=c,n.strokeStyle=e.color;var u=t(e.lines,e.color,0,a,s);u&&(n.fillStyle=u,function(e,t,n,i,o,a){for(var r=e.points,s=e.pointsize,l=i>n.min?Math.min(n.max,i):n.min,c=0,u=1,h=!1,p=0,f=0,d=null,m=null;!(s>0&&c>r.length+s);){var g=r[(c+=s)-s],v=r[c-s+u],x=r[c],b=r[c+u];if(-2===s&&(v=b=l),h){if(s>0&&null!=g&&null==x){f=c,s=-s,u=2;continue}if(s<0&&c===p+s){o.fill(),h=!1,u=1,c=p=f+(s=-s);continue}}if(null!=g&&null!=x){if(a&&(null!==d&&null!==m?(x=g,b=v,g=d,v=m,d=null,m=null,c-=s):v!==b&&g!==x&&(b=v,d=x,m=v)),g<=x&&g<t.min){if(x<t.min)continue;v=(t.min-g)/(x-g)*(b-v)+v,g=t.min}else if(x<=g&&x<t.min){if(g<t.min)continue;b=(t.min-g)/(x-g)*(b-v)+v,x=t.min}if(g>=x&&g>t.max){if(x>t.max)continue;v=(t.max-g)/(x-g)*(b-v)+v,g=t.max}else if(x>=g&&x>t.max){if(g>t.max)continue;b=(t.max-g)/(x-g)*(b-v)+v,x=t.max}if(h||(o.beginPath(),o.moveTo(t.p2c(g),n.p2c(l)),h=!0),v>=n.max&&b>=n.max)o.lineTo(t.p2c(g),n.p2c(n.max)),o.lineTo(t.p2c(x),n.p2c(n.max));else if(v<=n.min&&b<=n.min)o.lineTo(t.p2c(g),n.p2c(n.min)),o.lineTo(t.p2c(x),n.p2c(n.min));else{var y=g,w=x;v<=b&&v<n.min&&b>=n.min?(g=(n.min-v)/(b-v)*(x-g)+g,v=n.min):b<=v&&b<n.min&&v>=n.min&&(x=(n.min-v)/(b-v)*(x-g)+g,b=n.min),v>=b&&v>n.max&&b<=n.max?(g=(n.max-v)/(b-v)*(x-g)+g,v=n.max):b>=v&&b>n.max&&v<=n.max&&(x=(n.max-v)/(b-v)*(x-g)+g,b=n.max),g!==y&&o.lineTo(t.p2c(y),n.p2c(v)),o.lineTo(t.p2c(g),n.p2c(v)),o.lineTo(t.p2c(x),n.p2c(b)),x!==w&&(o.lineTo(t.p2c(x),n.p2c(b)),o.lineTo(t.p2c(w),n.p2c(b)))}}else d=null,m=null}}(l,e.xaxis,e.yaxis,e.lines.fillTowards||0,n,e.lines.steps)),c>0&&function(e,t,n,i,o,a,r){var s=e.points,l=e.pointsize,c=null,u=null,h=0,p=0,f=0,d=0,m=null,g=null,v=0,x=function(e){h=s[e-l],p=s[e-l+1],f=s[e],d=s[e+1]},b=function(){return null!==m&&null!==g?(f=h,d=p,h=m,p=g,m=null,g=null,!0):(p!==d&&h!==f&&(d=p,m=f,g=p),!1)},y=function(){if(p<=d&&p<o.min){if(d<o.min)return!0;h=(o.min-p)/(d-p)*(f-h)+h,p=o.min}else if(d<=p&&d<o.min){if(p<o.min)return!0;f=(o.min-p)/(d-p)*(f-h)+h,d=o.min}},w=function(){if(p>=d&&p>o.max){if(d>o.max)return!0;h=(o.max-p)/(d-p)*(f-h)+h,p=o.max}else if(d>=p&&d>o.max){if(p>o.max)return!0;f=(o.max-p)/(d-p)*(f-h)+h,d=o.max}},T=function(){if(h<=f&&h<i.min){if(f<i.min)return!0;p=(i.min-h)/(f-h)*(d-p)+p,h=i.min}else if(f<=h&&f<i.min){if(h<i.min)return!0;d=(i.min-h)/(f-h)*(d-p)+p,f=i.min}},k=function(){if(h>=f&&h>i.max){if(f>i.max)return!0;p=(i.max-h)/(f-h)*(d-p)+p,h=i.max}else if(f>=h&&f>i.max){if(h>i.max)return!0;d=(i.max-h)/(f-h)*(d-p)+p,f=i.max}},M=function(){h===c&&p===u||a.moveTo(i.p2c(h)+0,o.p2c(p)+0),c=f,u=d,a.lineTo(i.p2c(f)+0,o.p2c(d)+0)};for(a.beginPath(),v=l;v<s.length;v+=l)x(v),null!==h&&null!==f?isNaN(h)||isNaN(f)||isNaN(p)||isNaN(d)?(c=null,u=null):(r&&b()&&(v-=l),y()||w()||T()||k()||M()):(m=null,g=null);null!==m&&null!==g&&(x(v),b(),y()||w()||T()||k()||M()),a.stroke()}(l,0,0,e.xaxis,e.yaxis,n,e.lines.steps),n.restore()},this.drawSeriesPoints=function(e,n,i,o,a,r,s){function l(e,t,n,i,o,a){e.moveTo(t+i,n),e.arc(t,n,i,0,o?Math.PI:2*Math.PI,!1)}l.fill=!0,n.save(),n.translate(i.left,i.top);var c={format:e.datapoints.format,points:e.datapoints.points,pointsize:e.datapoints.pointsize};e.decimatePoints&&(c.points=e.decimatePoints(e,e.xaxis.min,e.xaxis.max,o,e.yaxis.min,e.yaxis.max,a));var u,h=e.points.lineWidth,p=e.points.radius,f=e.points.symbol;"circle"===f?u=l:"string"==typeof f&&r&&r[f]?u=r[f]:"function"==typeof r&&(u=r),0===h&&(h=1e-4),n.lineWidth=h,n.fillStyle=t(e.points,e.color,null,null,s),n.strokeStyle=e.color,function(e,t,i,o,a,r,s,l){var c=e.points,u=e.pointsize;n.beginPath();for(var h=0;h<c.length;h+=u){var p=c[h],f=c[h+1];null==p||p<r.min||p>r.max||f<s.min||f>s.max||(p=r.p2c(p),f=s.p2c(f)+0,l(n,p,f,t,a,true))}l.fill&&n.fill(),n.stroke()}(c,p,0,0,!1,e.xaxis,e.yaxis,u),n.restore()},this.drawSeriesBars=function(n,i,o,a,r,s,l){i.save(),i.translate(o.left,o.top);var c,u={format:n.datapoints.format,points:n.datapoints.points,pointsize:n.datapoints.pointsize};n.decimate&&(u.points=n.decimate(n,n.xaxis.min,n.xaxis.max,a)),i.lineWidth=n.bars.lineWidth,i.strokeStyle=n.color;var h=n.bars.barWidth[0]||n.bars.barWidth;switch(n.bars.align){case"left":c=0;break;case"right":c=-h;break;default:c=-h/2}!function(t,o,a,r,s,l){for(var c=t.points,u=t.pointsize,h=n.bars.fillTowards||0,p=h>l.min?Math.min(l.max,h):l.min,f=0;f<c.length;f+=u)if(null!=c[f]){var d=3===u?c[f+2]:p;e(c[f],c[f+1],d,o,a,r,s,l,i,n.bars.horizontal,n.bars.lineWidth)}}(u,c,c+h,n.bars.fill?function(e,i){return t(n.bars,n.color,e,i,l)}:null,n.xaxis,n.yaxis),i.restore()},this.drawBar=e};function k(e){var t,n=[],i=y.saturate(y.floorInBase(e.min,e.tickSize)),o=0,a=Number.NaN;i===-Number.MAX_VALUE&&(n.push(i),i=y.floorInBase(e.min+e.tickSize,e.tickSize));do{t=a,a=y.multiplyAdd(e.tickSize,o,i),n.push(a),++o}while(a<e.max&&a!==t);return n}function M(e,t,n){var i=t.tickDecimals;if(-1!==(""+e).indexOf("e"))return S(e,t,n);n>0&&(t.tickDecimals=n);var o=t.tickDecimals?parseFloat("1e"+t.tickDecimals):1,a=""+Math.round(e*o)/o;if(null!=t.tickDecimals){var r=a.indexOf("."),s=-1===r?0:a.length-r-1;s<t.tickDecimals&&(a=(s?a:a+".")+(""+o).substr(1,t.tickDecimals-s))}return t.tickDecimals=i,a}function S(e,t,n){var i=(""+e).indexOf("e"),o=parseInt((""+e).substr(i+1)),a=-1!==i?o:e>0?Math.floor(Math.log(e)/Math.LN10):0,r=parseFloat("1e"+a),s=e/r;if(n){var l=C(e,n);return(e/r).toFixed(l)+"e"+a}return t.tickDecimals>0?s.toFixed(C(e,t.tickDecimals))+"e"+a:s.toFixed()+"e"+a}function C(e,t){var n=Math.log(Math.abs(e))*Math.LOG10E,i=Math.abs(n+t);return i<=20?Math.floor(i):20}function P(e,t,n,i){var u=[],p={colors:["#edc240","#afd8f8","#cb4b4b","#4da74d","#9440ed"],xaxis:{show:null,position:"bottom",mode:null,font:null,color:null,tickColor:null,transform:null,inverseTransform:null,min:null,max:null,autoScaleMargin:null,autoScale:"exact",windowSize:null,growOnly:null,ticks:null,tickFormatter:null,showTickLabels:"major",labelWidth:null,labelHeight:null,reserveSpace:null,tickLength:null,showMinorTicks:null,showTicks:null,gridLines:null,alignTicksWithAxis:null,tickDecimals:null,tickSize:null,minTickSize:null,offset:{below:0,above:0},boxPosition:{centerX:0,centerY:0}},yaxis:{autoScaleMargin:.02,autoScale:"loose",growOnly:null,position:"left",showTickLabels:"major",offset:{below:0,above:0},boxPosition:{centerX:0,centerY:0}},xaxes:[],yaxes:[],series:{points:{show:!1,radius:3,lineWidth:2,fill:!0,fillColor:"#ffffff",symbol:"circle"},lines:{lineWidth:1,fill:!1,fillColor:null,steps:!1},bars:{show:!1,lineWidth:2,horizontal:!1,barWidth:.8,fill:!0,fillColor:null,align:"left",zero:!0},shadowSize:3,highlightColor:null},grid:{show:!0,aboveData:!1,color:"#545454",backgroundColor:null,borderColor:null,tickColor:null,margin:0,labelMargin:5,axisMargin:8,borderWidth:1,minBorderMargin:null,markings:null,markingsColor:"#f4f4f4",markingsLineWidth:2,clickable:!1,hoverable:!1,autoHighlight:!0,mouseActiveRadius:15},interaction:{redrawOverlayInterval:1e3/60},hooks:{}},g=null,v=null,b=null,S=null,C=null,P=[],L=[],N={left:0,right:0,top:0,bottom:0},E=0,z=0,A={processOptions:[],processRawData:[],processDatapoints:[],processOffset:[],setupGrid:[],adjustSeriesDataRange:[],setRange:[],drawBackground:[],drawSeries:[],drawAxis:[],draw:[],findNearbyItems:[],axisReserveSpace:[],bindEvents:[],drawOverlay:[],resize:[],shutdown:[]},O=this,I={},R=null;O.setData=F,O.setupGrid=_,O.draw=$,O.getPlaceholder=function(){return e},O.getCanvas=function(){return g.element},O.getSurface=function(){return g},O.getEventHolder=function(){return b},O.getPlotOffset=function(){return N},O.width=function(){return E},O.height=function(){return z},O.offset=function(){var e=b.getBoundingClientRect(),t={left:e.left+window.scrollX,top:e.top+window.scrollY};return t.left+=N.left,t.top+=N.top,t},O.getData=function(){return u},O.getAxes=function(){var e={};return P.concat(L).forEach(function(t){t&&(e[t.direction+(1!==t.n?t.n:"")+"axis"]=t)}),e},O.getXAxes=function(){return P},O.getYAxes=function(){return L},O.c2p=function(e){var t,n,i={};for(t=0;t<P.length;++t)(n=P[t])&&n.used&&(i["x"+n.n]=n.c2p(e.left));for(t=0;t<L.length;++t)(n=L[t])&&n.used&&(i["y"+n.n]=n.c2p(e.top));return void 0!==i.x1&&(i.x=i.x1),void 0!==i.y1&&(i.y=i.y1),i},O.p2c=function(e){var t,n,i,o={};for(t=0;t<P.length;++t)if((n=P[t])&&n.used&&(null==e[i="x"+n.n]&&1===n.n&&(i="x"),null!=e[i])){o.left=n.p2c(e[i]);break}for(t=0;t<L.length;++t)if((n=L[t])&&n.used&&(null==e[i="y"+n.n]&&1===n.n&&(i="y"),null!=e[i])){o.top=n.p2c(e[i]);break}return o},O.getOptions=function(){return p},O.triggerRedrawOverlay=he,O.pointOffset=function(e){return{left:parseInt(P[X(e,"x")-1].p2c(+e.x)+N.left,10),top:parseInt(L[X(e,"y")-1].p2c(+e.y)+N.top,10)}},O.shutdown=H,O.destroy=function(){var t,n;H(),t=e,(n=l.get(t))&&delete n.plot,e.innerHTML="",u=[],p=null,g=null,v=null,b=null,S=null,C=null,P=[],L=[],A=null,O=null},O.resize=function(){var t=a(e),n=r(e);g.resize(t,n),v.resize(t,n),Y(A.resize,[t,n])},O.clearTextCache=function(){g.clearCache(),v.clearCache()},O.autoScaleAxis=U,O.computeRangeForDataSeries=function(e,t,n){for(var i=e.datapoints.points,o=e.datapoints.pointsize,a=e.datapoints.format,r=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,l={xmin:r,ymin:r,xmax:s,ymax:s},c=0;c<i.length;c+=o)if(null!==i[c]&&("function"!=typeof n||n(i[c])))for(var u=0;u<o;++u){var h=i[c+u],p=a[u];null!=p&&("function"!=typeof n||n(h))&&(t||p.computeRange)&&h!==1/0&&h!==-1/0&&(!0===p.x&&(h<l.xmin&&(l.xmin=h),h>l.xmax&&(l.xmax=h)),!0===p.y&&(h<l.ymin&&(l.ymin=h),h>l.ymax&&(l.ymax=h)))}return l},O.adjustSeriesDataRange=function(e,t){if(e.bars.show){var n,i=e.bars.barWidth[1];e.datapoints&&e.datapoints.points&&!i&&function(e){var t=[],n=e.datapoints.pointsize,i=Number.MAX_VALUE;e.datapoints.points.length<=n&&(i=1);for(let i=e.bars.horizontal?1:0;i<e.datapoints.points.length;i+=n)isFinite(e.datapoints.points[i])&&null!==e.datapoints.points[i]&&t.push(e.datapoints.points[i]);(t=t.filter(function(e,t,n){return n.indexOf(e)===t})).sort(function(e,t){return e-t});for(let e=1;e<t.length;e++){var o=Math.abs(t[e]-t[e-1]);o<i&&isFinite(o)&&(i=o)}"number"==typeof e.bars.barWidth?e.bars.barWidth=e.bars.barWidth*i:e.bars.barWidth[0]=e.bars.barWidth[0]*i}(e);var o=e.bars.barWidth[0]||e.bars.barWidth;switch(e.bars.align){case"left":n=0;break;case"right":n=-o;break;default:n=-o/2}e.bars.horizontal?(t.ymin+=n,t.ymax+=n+o):(t.xmin+=n,t.xmax+=n+o)}return(e.bars.show&&e.bars.zero||e.lines.show&&e.lines.zero)&&e.datapoints.pointsize<=2&&(t.ymin=Math.min(0,t.ymin),t.ymax=Math.max(0,t.ymax)),t},O.findNearbyItem=function(e,t,n,i,o){var a=le(e,t,n,i,o);return void 0!==a[0]?a[0]:null},O.findNearbyItems=le,O.findNearbyInterpolationPoint=function(e,t,n){var i,o,a,r,s,l,c,h=Number.MAX_VALUE;for(i=0;i<u.length;++i){if(!n(i))continue;var p=u[i].datapoints.points;l=u[i].datapoints.pointsize;const v=p[p.length-l]<p[0]?function(e,t){return e>t}:function(e,t){return t>e};if(!v(e,p[0])){for(o=l;o<p.length&&!v(e,p[o]);o+=l);var f=p[o-l],d=p[o-l+1],m=p[o],g=p[o+1];void 0!==f&&void 0!==m&&void 0!==d&&void 0!==g&&(t=f===m?g:d+(g-d)*(e-f)/(m-f),(a=(r=Math.abs(u[i].xaxis.p2c(m)-e))*r+(s=Math.abs(u[i].yaxis.p2c(g)-t))*s)<h&&(h=a,c=[e,t,i,o]))}}return c?(i=c[2],o=c[3],l=u[i].datapoints.pointsize,f=(p=u[i].datapoints.points)[o-l],d=p[o-l+1],m=p[o],g=p[o+1],{datapoint:[c[0],c[1]],leftPoint:[f,d],rightPoint:[m,g],seriesIndex:i}):null},O.computeValuePrecision=Z,O.computeTickSize=J,O.addEventHandler=function(e,t,n,i){var o=n+e,a=I[o]||[];a.push({event:e,handler:t,eventHolder:n,priority:i}),a.sort((e,t)=>t.priority-e.priority),a.forEach(e=>{d(e.eventHolder,e.event,e.handler),f(e.eventHolder,e.event,e.handler)}),I[o]=a},O.hooks=A;var W=w.MINOR_TICKS_COUNT_CONSTANT,D=w.TICK_LENGTH_CONSTANT;function Y(e,t){t=[O].concat(t);for(var n=0;n<e.length;++n)e[n].apply(this,t)}function F(e){var t=u;u=function(e){for(var t=[],n=0;n<e.length;++n){var i=o(!0,{},p.series);null!=e[n].data?(i.data=e[n].data,delete e[n].data,o(!0,i,e[n]),e[n].data=i.data):i.data=e[n],t.push(i)}return t}(e),function(){var e,t=u.length,n=-1;for(e=0;e<u.length;++e){var i=u[e].color;null!=i&&(t--,"number"==typeof i&&i>n&&(n=i))}t<=n&&(t=n+1);var o,a=[],r=p.colors,s=r.length,l=0,c=Math.max(0,u.length-t);for(e=0;e<t;e++)o=x.parse(r[(c+e)%s]||"#666"),e%s===0&&e&&(l=l>=0?l<.5?-l-.2:0:-l),a[e]=o.scale("rgb",1+l);var h,f=0;for(e=0;e<u.length;++e){if(null==(h=u[e]).color?(h.color=a[f].toString(),++f):"number"==typeof h.color&&(h.color=a[h.color].toString()),null==h.lines.show){var d,m=!0;for(d in h)if(h[d]&&h[d].show){m=!1;break}m&&(h.lines.show=!0)}null==h.lines.zero&&(h.lines.zero=!!h.lines.fill),h.xaxis=G(P,X(h,"x")),h.yaxis=G(L,X(h,"y"))}}(),function(e){var t,n,i,o,a,r,s,l,c,h,p,f,d=Number.POSITIVE_INFINITY,m=Number.NEGATIVE_INFINITY;function g(e,t,n){t<e.datamin&&t!==-1/0&&(e.datamin=t),n>e.datamax&&n!==1/0&&(e.datamax=n)}function v(e,t){return e&&e[t]&&e[t].datapoints&&e[t].datapoints.points?e[t].datapoints.points:[]}for(B().forEach(function(e){!0!==e.options.growOnly?(e.datamin=d,e.datamax=m):(void 0===e.datamin&&(e.datamin=d),void 0===e.datamax&&(e.datamax=m)),e.used=!1}),t=0;t<u.length;++t)(a=u[t]).datapoints={points:[]},0===a.datapoints.points.length&&(a.datapoints.points=v(e,t)),Y(A.processRawData,[a,a.data,a.datapoints]);for(t=0;t<u.length;++t)if(p=(a=u[t]).data,(f=a.datapoints.format)||((f=[]).push({x:!0,y:!1,number:!0,required:!0,computeRange:"none"!==a.xaxis.options.autoScale,defaultValue:null}),f.push({x:!1,y:!0,number:!0,required:!0,computeRange:"none"!==a.yaxis.options.autoScale,defaultValue:null}),(a.stack||a.bars.show||a.lines.show&&a.lines.fill)&&(null!=a.datapoints.pointsize?a.datapoints.pointsize:a.data&&a.data[0]&&a.data[0].length?a.data[0].length:3)>2&&f.push({x:a.bars.horizontal,y:!a.bars.horizontal,number:!0,required:!1,computeRange:"none"!==a.yaxis.options.autoScale,defaultValue:0}),a.datapoints.format=f),a.xaxis.used=a.yaxis.used=!0,null==a.datapoints.pointsize){for(a.datapoints.pointsize=f.length,s=a.datapoints.pointsize,r=a.datapoints.points,n=i=0;n<p.length;++n,i+=s){var x=null==(h=p[n]);if(!x)for(o=0;o<s;++o)l=h[o],(c=f[o])&&(c.number&&null!=l&&(l=+l,isNaN(l)&&(l=null)),null==l&&(c.required&&(x=!0),null!=c.defaultValue&&(l=c.defaultValue))),r[i+o]=l;if(x)for(o=0;o<s;++o)null!=(l=r[i+o])&&(c=f[o]).computeRange&&(c.x&&g(a.xaxis,l,l),c.y&&g(a.yaxis,l,l)),r[i+o]=null}r.length=i}for(t=0;t<u.length;++t)a=u[t],Y(A.processDatapoints,[a,a.datapoints]);for(t=0;t<u.length;++t)if(!(f=(a=u[t]).datapoints.format).every(function(e){return!e.computeRange})){var b=O.adjustSeriesDataRange(a,O.computeRangeForDataSeries(a));Y(A.adjustSeriesDataRange,[a,b]),g(a.xaxis,b.xmin,b.xmax),g(a.yaxis,b.ymin,b.ymax)}B().forEach(function(e){e.datamin===d&&(e.datamin=null),e.datamax===m&&(e.datamax=null)})}(t)}function X(e,t){var n=e[t+"axis"];return"object"==typeof n&&(n=n.n),"number"!=typeof n&&(n=1),n}function B(){return P.concat(L).filter(function(e){return e})}function G(e,t){return e[t-1]||(e[t-1]={n:t,direction:e===P?"x":"y",options:o(!0,{},e===P?p.xaxis:p.yaxis)}),e[t-1]}function H(){R&&window.clearTimeout(R),Y(A.shutdown,[b])}function j(e){function t(e){return e}var n,i,o=e.options.transform||t,a=e.options.inverseTransform;"x"===e.direction?(n=isFinite(o(e.max)-o(e.min))?e.scale=E/Math.abs(o(e.max)-o(e.min)):e.scale=1/Math.abs(y.delta(o(e.min),o(e.max),E)),i=Math.min(o(e.max),o(e.min))):(n=-(n=isFinite(o(e.max)-o(e.min))?e.scale=z/Math.abs(o(e.max)-o(e.min)):e.scale=1/Math.abs(y.delta(o(e.min),o(e.max),z))),i=Math.max(o(e.max),o(e.min))),e.p2c=o===t?function(e){return isFinite(e-i)?(e-i)*n:(e/4-i/4)*n*4}:function(e){var t=o(e);return isFinite(t-i)?(t-i)*n:(t/4-i/4)*n*4},e.c2p=a?function(e){return a(i+e/n)}:function(e){return i+e/n}}function V(e){Y(A.axisReserveSpace,[e]);var t=e.labelWidth,n=e.labelHeight,i=e.options.position,o="x"===e.direction,a=e.options.tickLength,r=e.options.showTicks,s=e.options.showMinorTicks,l=e.options.gridLines,c=p.grid.axisMargin,u=p.grid.labelMargin,h=!0,f=!0,d=!1;(o?P:L).forEach(function(t){t&&(t.show||t.reserveSpace)&&(t===e?d=!0:t.options.position===i&&(d?f=!1:h=!1))}),f&&(c=0),null==a&&(a=D),null==r&&(r=!0),null==s&&(s=!0),null==l&&(l=!!h),isNaN(+a)||(u+=r?+a:0),o?(n+=u,"bottom"===i?(N.bottom+=n+c,e.box={top:g.height-N.bottom,height:n}):(e.box={top:N.top+c,height:n},N.top+=n+c)):(t+=u,"left"===i?(e.box={left:N.left+c,width:t},N.left+=t+c):(N.right+=t+c,e.box={left:g.width-N.right,width:t})),e.position=i,e.tickLength=a,e.showMinorTicks=s,e.showTicks=r,e.gridLines=l,e.box.padding=u,e.innermost=h}function q(e,t,n){"x"===e.direction?("bottom"===e.position&&n(t.bottom)&&(e.box.top-=Math.ceil(t.bottom)),"top"===e.position&&n(t.top)&&(e.box.top+=Math.ceil(t.top))):("left"===e.position&&n(t.left)&&(e.box.left+=Math.ceil(t.left)),"right"===e.position&&n(t.right)&&(e.box.left-=Math.ceil(t.right)))}function _(e){var t,n,i=B(),o=p.grid.show;for(n in N)N[n]=0;for(n in Y(A.processOffset,[N]),N)"object"==typeof p.grid.borderWidth?N[n]+=o?p.grid.borderWidth[n]:0:N[n]+=o?p.grid.borderWidth:0;if(i.forEach(function(t){var n=t.options;t.show=null==n.show?t.used:n.show,t.reserveSpace=null==n.reserveSpace?t.show:n.reserveSpace,function(e){var t=e.options;e.tickFormatter||("function"==typeof t.tickFormatter?e.tickFormatter=function(){var e=Array.prototype.slice.call(arguments);return""+t.tickFormatter.apply(null,e)}:e.tickFormatter=M)}(t),Y(A.setRange,[t,e]),function(e,t){var n="number"==typeof e.options.min?e.options.min:e.min,i="number"==typeof e.options.max?e.options.max:e.max,o=e.options.offset;if(t&&(U(e),n=e.autoScaledMin,i=e.autoScaledMax),(n=(null!=n?n:-1)+(o.below||0))>(i=(null!=i?i:1)+(o.above||0))){var a=n;n=i,i=a,e.options.offset={above:0,below:0}}e.min=y.saturate(n),e.max=y.saturate(i)}(t,e)}),o){E=g.width-N.left-N.right,z=g.height-N.bottom-N.top;var a=i.filter(function(e){return e.show||e.reserveSpace});for(a.forEach(function(e){!function(e){var t,n=e.options;t=K(e.direction,g,n.ticks),e.delta=y.delta(e.min,e.max,t);var i=O.computeValuePrecision(e.min,e.max,e.direction,t,n.tickDecimals);if(e.tickDecimals=Math.max(0,null!=n.tickDecimals?n.tickDecimals:i),e.tickSize=function(e,t,n,i,o){var a=J(e,t,"number"==typeof i.ticks&&i.ticks>0?i.ticks:.3*Math.sqrt("x"===n?g.width:g.height),o);return null!=i.minTickSize&&a<i.minTickSize&&(a=i.minTickSize),i.tickSize||a}(e.min,e.max,e.direction,n,n.tickDecimals),e.tickGenerator||("function"==typeof n.tickGenerator?e.tickGenerator=n.tickGenerator:e.tickGenerator=k),null!=n.alignTicksWithAxis){var o=("x"===e.direction?P:L)[n.alignTicksWithAxis-1];if(o&&o.used&&o!==e){var a=e.tickGenerator(e,O);if(a.length>0&&(null==n.min&&(e.min=Math.min(e.min,a[0])),null==n.max&&a.length>1&&(e.max=Math.max(e.max,a[a.length-1]))),e.tickGenerator=function(e){var t,n,i=[];for(n=0;n<o.ticks.length;++n)t=(o.ticks[n].v-o.min)/(o.max-o.min),t=e.min+t*(e.max-e.min),i.push(t);return i},!e.mode&&null==n.tickDecimals&&e.delta>0){var r=Math.max(0,1-Math.floor(Math.log(e.delta)/Math.LN10)),s=e.tickGenerator(e,O);s.length>1&&/\..*0$/.test((s[1]-s[0]).toFixed(r))||(e.tickDecimals=r)}}}}(e),function(e){var t,n,i=e.options.ticks,o=[];for(null==i||"number"==typeof i&&i>0?o=e.tickGenerator(e,O):i&&(o="function"==typeof i?i(e):i),e.ticks=[],t=0;t<o.length;++t){var a=null,r=o[t];"object"==typeof r?(n=+r[0],r.length>1&&(a=r[1])):n=+r,isNaN(n)||e.ticks.push(Q(n,a,e,"major"))}}(e),function(e,t,n){"loose"===e.options.autoScale&&t.length>0&&function(e){return e.some(e=>e.datapoints.points.length>0)}(n)&&(e.min=Math.min(e.min,t[0].v),e.max=Math.max(e.max,t[t.length-1].v))}(e,e.ticks,u),j(e),function(e,t){(function(e,t){if("endpoints"===e.options.showTickLabels)return!0;if("all"===e.options.showTickLabels){var n=t.filter(function(t){return t.bars.horizontal?t.yaxis===e:t.xaxis===e}),i=n.some(function(e){return!e.bars.show});return 0===n.length||i}return"major"!==e.options.showTickLabels&&"none"!==e.options.showTickLabels&&void 0})(e,t)&&(e.ticks.unshift(Q(e.min,null,e,"min")),e.ticks.push(Q(e.max,null,e,"max")))}(e,u),function(e){for(var t=e.options,n="none"!==t.showTickLabels&&e.ticks?e.ticks:[],i="major"===t.showTickLabels||"all"===t.showTickLabels,o="endpoints"===t.showTickLabels||"all"===t.showTickLabels,a=t.labelWidth||0,r=t.labelHeight||0,s=e.direction+"Axis "+e.direction+e.n+"Axis",l="flot-"+e.direction+"-axis flot-"+e.direction+e.n+"-axis "+s,c=t.font||"flot-tick-label tickLabel",u=0;u<n.length;++u){var h=n[u],p=h.label;if(h.label&&!(!1===i&&u>0&&u<n.length-1)&&(!1!==o||0!==u&&u!==n.length-1)){"object"==typeof h.label&&(p=h.label.name);var f=g.getTextInfo(l,p,c);a=Math.max(a,f.width),r=Math.max(r,f.height)}}e.labelWidth=t.labelWidth||a,e.labelHeight=t.labelHeight||r}(e)}),t=a.length-1;t>=0;--t)V(a[t]);!function(){var e,t=p.grid.minBorderMargin;if(null==t)for(t=0,e=0;e<u.length;++e)t=Math.max(t,2*(u[e].points.radius+u[e].points.lineWidth/2));var n,i={},o={left:t,right:t,top:t,bottom:t};for(n in B().forEach(function(e){e.reserveSpace&&e.ticks&&e.ticks.length&&("x"===e.direction?(o.left=Math.max(o.left,e.labelWidth/2),o.right=Math.max(o.right,e.labelWidth/2)):(o.bottom=Math.max(o.bottom,e.labelHeight/2),o.top=Math.max(o.top,e.labelHeight/2)))}),o)i[n]=o[n]-N[n];P.concat(L).forEach(function(e){q(e,i,function(e){return e>0})}),N.left=Math.ceil(Math.max(o.left,N.left)),N.right=Math.ceil(Math.max(o.right,N.right)),N.top=Math.ceil(Math.max(o.top,N.top)),N.bottom=Math.ceil(Math.max(o.bottom,N.bottom))}(),a.forEach(function(e){!function(e){"x"===e.direction?(e.box.left=N.left-e.labelWidth/2,e.box.width=g.width-N.left-N.right+e.labelWidth):(e.box.top=N.top-e.labelHeight/2,e.box.height=g.height-N.bottom-N.top+e.labelHeight)}(e)})}if(p.grid.margin){for(n in N){var r=p.grid.margin||0;N[n]+="number"==typeof r?r:r[n]||0}P.concat(L).forEach(function(e){q(e,p.grid.margin,function(e){return null!=e})})}E=g.width-N.left-N.right,z=g.height-N.bottom-N.top,i.forEach(function(e){j(e)}),o&&B().forEach(function(e){var t,n,i,o,a,r,s,l=e.box,c=e.direction+"Axis "+e.direction+e.n+"Axis",u="flot-"+e.direction+"-axis flot-"+e.direction+e.n+"-axis "+c,h=e.options.font||"flot-tick-label tickLabel",p={x:NaN,y:NaN,width:NaN,height:NaN},f=[],d=function(t,c){return!t||!t.label||t.v<e.min||t.v>e.max?p:(r=g.getTextInfo(u,t.label,h),"x"===e.direction?(o="center",n=N.left+e.p2c(t.v),"bottom"===e.position?i=l.top+l.padding-e.boxPosition.centerY:(i=l.top+l.height-l.padding+e.boxPosition.centerY,a="bottom"),s={x:n-r.width/2-3,y:i-3,width:r.width+6,height:r.height+6}):(a="middle",i=N.top+e.p2c(t.v),"left"===e.position?(n=l.left+l.width-l.padding-e.boxPosition.centerX,o="right"):n=l.left+l.padding+e.boxPosition.centerX,s={x:n-r.width/2-3,y:i-3,width:r.width+6,height:r.height+6}),function(e,t){return t.some(function(t){return n=e.x,i=e.y,o=e.x+e.width,a=e.y+e.height,r=t.x,s=t.y,l=t.x+t.width,c=t.y+t.height,(n<=r&&r<=o||r<=n&&n<=l)&&(i<=s&&s<=a||s<=i&&i<=c);var n,i,o,a,r,s,l,c})}(s,c)?p:(g.addText(u,n,i,t.label,h,null,null,o,a),s))};if(g.removeText(u),Y(A.drawAxis,[e,g]),e.show)switch(e.options.showTickLabels){case"none":break;case"endpoints":f.push(d(e.ticks[0],f)),f.push(d(e.ticks[e.ticks.length-1],f));break;case"major":for(f.push(d(e.ticks[0],f)),f.push(d(e.ticks[e.ticks.length-1],f)),t=1;t<e.ticks.length-1;++t)f.push(d(e.ticks[t],f));break;case"all":for(f.push(d(e.ticks[0],[])),f.push(d(e.ticks[e.ticks.length-1],f)),t=1;t<e.ticks.length-1;++t)f.push(d(e.ticks[t],f))}}),Y(A.setupGrid,[])}function U(e){var t,n=e.options,i=n.min,o=n.max,a=e.datamin,r=e.datamax;switch(n.autoScale){case"none":i=+(null!=n.min?n.min:a),o=+(null!=n.max?n.max:r);break;case"loose":if(null!=a&&null!=r){i=a,o=r,t=y.saturate(o-i);var s="number"==typeof n.autoScaleMargin?n.autoScaleMargin:.02;i=y.saturate(i-t*s),o=y.saturate(o+t*s),i<0&&a>=0&&(i=0)}else i=n.min,o=n.max;break;case"exact":i=null!=a?a:n.min,o=null!=r?r:n.max;break;case"sliding-window":r>o&&(o=r,i=Math.max(r-(n.windowSize||100),i))}var l=function(e,t){var n=void 0===e?null:e,i=void 0===t?null:t;if(0===i-n){var o=0===i?1:.01,a=null;null==n&&(a-=o),null!=i&&null==n||(i+=o),null!=a&&(n=a)}return{min:n,max:i}}(i,o);i=l.min,o=l.max,!0===n.growOnly&&"none"!==n.autoScale&&"sliding-window"!==n.autoScale&&(i=i<a?i:null!==a?a:i,o=o>r?o:null!==r?r:o),e.autoScaledMin=i,e.autoScaledMax=o}function Z(e,t,n,i,o){var a=K(n,g,i),r=y.delta(e,t,a),s=-Math.floor(Math.log(r)/Math.LN10);o&&s>o&&(s=o);var l=r/parseFloat("1e"+-s);return l>2.25&&l<3&&(null==o||s+1<=o)&&++s,isFinite(s)?s:0}function J(e,t,n,i){var o=y.delta(e,t,n),a=-Math.floor(Math.log(o)/Math.LN10);i&&a>i&&(a=i);var r,s=parseFloat("1e"+-a),l=o/s;return l<1.5?r=1:l<3?(r=2,l>2.25&&(null==i||a+1<=i)&&(r=2.5)):r=l<7.5?5:10,r*s}function K(e,t,n){return"number"==typeof n&&n>0?n:.3*Math.sqrt("x"===e?t.width:t.height)}function Q(e,t,n,i){if(null===t)switch(i){case"min":case"max":var o=function(e,t){var n=Math.floor(t.p2c(e)),i="x"===t.direction?n+1:n-1;return Z(t.c2p(n),t.c2p(i),t.direction,1)}(e,n);isFinite(o),t=n.tickFormatter(e,n,o,O);break;case"major":t=n.tickFormatter(e,n,void 0,O)}return{v:e,label:t}}function $(){g.clear(),Y(A.drawBackground,[S]);var e=p.grid;e.show&&e.backgroundColor&&(S.save(),S.translate(N.left,N.top),S.fillStyle=fe(p.grid.backgroundColor,z,0,"rgba(255, 255, 255, 0)"),S.fillRect(0,0,E,z),S.restore()),e.show&&!e.aboveData&&re();for(var t=0;t<u.length;++t)Y(A.drawSeries,[S,u[t],t,fe]),se(u[t]);Y(A.draw,[S]),e.show&&e.aboveData&&re(),g.render(),he()}function ee(e,t){for(var n,i,o,a,r=B(),s=0;s<r.length;++s)if((n=r[s]).direction===t&&(e[a=t+n.n+"axis"]||1!==n.n||(a=t+"axis"),e[a])){i=e[a].from,o=e[a].to;break}if(e[a]||(n="x"===t?P[0]:L[0],i=e[t+"1"],o=e[t+"2"]),null!=i&&null!=o&&i>o){var l=i;i=o,o=l}return{from:i,to:o,axis:n}}function te(e){var t=e.box,n=0,i=0;return"x"===e.direction?(n=0,i=t.top-N.top+("top"===e.position?t.height:0)):(i=0,n=t.left-N.left+("left"===e.position?t.width:0)+e.boxPosition.centerX),{x:n,y:i}}function ne(e,t){return e%2!=0?Math.floor(t)+.5:t}function ie(e){S.lineWidth=1;var t=te(e),n=t.x,i=t.y;if(e.show){var o=0,a=0;S.strokeStyle=e.options.color,S.beginPath(),"x"===e.direction?o=E+1:a=z+1,"x"===e.direction?i=ne(S.lineWidth,i):n=ne(S.lineWidth,n),S.moveTo(n,i),S.lineTo(n+o,i+a),S.stroke()}}function oe(e){var t=e.tickLength,n=e.showMinorTicks,i=W,o=te(e),a=o.x,r=o.y,s=0;for(S.strokeStyle=e.options.color,S.beginPath(),s=0;s<e.ticks.length;++s){var l,c=e.ticks[s].v,u=0,h=0,p=0,f=0;if(!isNaN(c)&&c>=e.min&&c<=e.max&&("x"===e.direction?(a=e.p2c(c),h=t,"top"===e.position&&(h=-h)):(r=e.p2c(c),u=t,"left"===e.position&&(u=-u)),"x"===e.direction?a=ne(S.lineWidth,a):r=ne(S.lineWidth,r),S.moveTo(a,r),S.lineTo(a+u,r+h)),!0===n&&s<e.ticks.length-1){var d=e.ticks[s].v,m=(e.ticks[s+1].v-d)/(i+1);for(l=1;l<=i;l++){if("x"===e.direction){if(f=t/2,a=ne(S.lineWidth,e.p2c(d+l*m)),"top"===e.position&&(f=-f),a<0||a>E)continue}else if(p=t/2,r=ne(S.lineWidth,e.p2c(d+l*m)),"left"===e.position&&(p=-p),r<0||r>z)continue;S.moveTo(a,r),S.lineTo(a+p,r+f)}}}S.stroke()}function ae(e){var t,n=function(t){var n=p.grid.borderWidth;return("object"==typeof n&&n[e.position]>0||n>0)&&(t===e.min||t===e.max)};for(S.strokeStyle=p.grid.tickColor,S.beginPath(),t=0;t<e.ticks.length;++t){var i=e.ticks[t].v,o=0,a=0,r=0,s=0;isNaN(i)||i<e.min||i>e.max||n(i)||("x"===e.direction?(r=e.p2c(i),s=z,a=-z):(r=0,s=e.p2c(i),o=E),"x"===e.direction?r=ne(S.lineWidth,r):s=ne(S.lineWidth,s),S.moveTo(r,s),S.lineTo(r+o,s+a))}S.stroke()}function re(){var e,t;S.save(),S.translate(N.left,N.top),function(){var e,t=p.grid.markings;if(t){if("function"==typeof t&&((e=O.getAxes()).xmin=e.xaxis.min,e.xmax=e.xaxis.max,e.ymin=e.yaxis.min,e.ymax=e.yaxis.max,t=t(e)),!t)return;var n;for(n=0;n<t.length;++n){var i=t[n],o=ee(i,"x"),a=ee(i,"y");if(null==o.from&&(o.from=o.axis.min),null==o.to&&(o.to=o.axis.max),null==a.from&&(a.from=a.axis.min),null==a.to&&(a.to=a.axis.max),!(o.to<o.axis.min||o.from>o.axis.max||a.to<a.axis.min||a.from>a.axis.max)){o.from=Math.max(o.from,o.axis.min),o.to=Math.min(o.to,o.axis.max),a.from=Math.max(a.from,a.axis.min),a.to=Math.min(a.to,a.axis.max);var r=o.from===o.to,s=a.from===a.to;if(!r||!s)if(o.from=Math.floor(o.axis.p2c(o.from)),o.to=Math.floor(o.axis.p2c(o.to)),a.from=Math.floor(a.axis.p2c(a.from)),a.to=Math.floor(a.axis.p2c(a.to)),r||s){var l=i.lineWidth||p.grid.markingsLineWidth,c=l%2?.5:0;S.beginPath(),S.strokeStyle=i.color||p.grid.markingsColor,S.lineWidth=l,r?(S.moveTo(o.to+c,a.from),S.lineTo(o.to+c,a.to)):(S.moveTo(o.from,a.to+c),S.lineTo(o.to,a.to+c)),S.stroke()}else S.fillStyle=i.color||p.grid.markingsColor,S.fillRect(o.from,a.to,o.to-o.from,a.from-a.to)}}}}(),e=B(),t=p.grid.borderWidth;for(var n=0;n<e.length;++n){var i=e[n];i.show&&(ie(i),!0===i.showTicks&&oe(i),!0===i.gridLines&&ae(i))}t&&function(){var e=p.grid.borderWidth,t=p.grid.borderColor;"object"==typeof e||"object"==typeof t?("object"!=typeof e&&(e={top:e,right:e,bottom:e,left:e}),"object"!=typeof t&&(t={top:t,right:t,bottom:t,left:t}),e.top>0&&(S.strokeStyle=t.top,S.lineWidth=e.top,S.beginPath(),S.moveTo(0-e.left,0-e.top/2),S.lineTo(E,0-e.top/2),S.stroke()),e.right>0&&(S.strokeStyle=t.right,S.lineWidth=e.right,S.beginPath(),S.moveTo(E+e.right/2,0-e.top),S.lineTo(E+e.right/2,z),S.stroke()),e.bottom>0&&(S.strokeStyle=t.bottom,S.lineWidth=e.bottom,S.beginPath(),S.moveTo(E+e.right,z+e.bottom/2),S.lineTo(0,z+e.bottom/2),S.stroke()),e.left>0&&(S.strokeStyle=t.left,S.lineWidth=e.left,S.beginPath(),S.moveTo(0-e.left/2,z+e.bottom),S.lineTo(0-e.left/2,0),S.stroke())):(S.lineWidth=e,S.strokeStyle=p.grid.borderColor,S.strokeRect(-e/2,-e/2,E+e,z+e))}(),S.restore()}function se(e){e.lines.show&&T.drawSeriesLines(e,S,N,E,z,O.drawSymbol,fe),e.bars.show&&T.drawSeriesBars(e,S,N,E,z,O.drawSymbol,fe),e.points.show&&T.drawSeriesPoints(e,S,N,E,z,O.drawSymbol,fe)}function le(e,t,n,i,o){for(var a=function(e,t,n,i,o){var a,r=[],s=[],l=i*i+1;for(a=u.length-1;a>=0;--a)if(n(a)){var c=u[a];if(!c.datapoints)return;var h=!1;if(c.lines.show||c.points.show){var p=ce(c,e,t,i,o);p&&(s.push({seriesIndex:a,dataIndex:p.dataIndex,distance:p.distance}),h=!0)}if(c.bars.show&&!h){var f=ue(c,e,t);f>=0&&s.push({seriesIndex:a,dataIndex:f,distance:l})}}for(a=0;a<s.length;a++){var d=s[a].seriesIndex,m=s[a].dataIndex,g=s[a].distance,v=u[d].datapoints.pointsize;r.push({datapoint:u[d].datapoints.points.slice(m*v,(m+1)*v),dataIndex:m,series:u[d],seriesIndex:d,distance:Math.sqrt(g)})}return r}(e,t,n,i,o),r=0;r<u.length;++r)n(r)&&Y(A.findNearbyItems,[e,t,u,r,i,o,a]);return a.sort((e,t)=>void 0===t.distance?-1:void 0===e.distance&&void 0!==t.distance?1:e.distance-t.distance)}function ce(e,t,n,i,o){var a=e.xaxis.c2p(t),r=e.yaxis.c2p(n),s=i/e.xaxis.scale,l=i/e.yaxis.scale,c=e.datapoints.points,u=e.datapoints.pointsize,h=o?i:i*i;e.xaxis.options.inverseTransform&&(s=Number.MAX_VALUE),e.yaxis.options.inverseTransform&&(l=Number.MAX_VALUE);for(var p=null,f=0;f<c.length;f+=u){var d=c[f],m=c[f+1];if(null!=d&&!(d-a>s||d-a<-s||m-r>l||m-r<-l)){var g=Math.abs(e.xaxis.p2c(d)-t),v=Math.abs(e.yaxis.p2c(m)-n),x=o?o(g,v):g*g+v*v;x<h&&(h=x,p={dataIndex:f/u,distance:x})}}return p}function ue(e,t,n){var i,o,a=e.bars.barWidth[0]||e.bars.barWidth,r=e.xaxis.c2p(t),s=e.yaxis.c2p(n),l=e.datapoints.points,c=e.datapoints.pointsize;switch(e.bars.align){case"left":i=0;break;case"right":i=-a;break;default:i=-a/2}o=i+a;for(var u=e.bars.fillTowards||0,h=u>e.yaxis.min?Math.min(e.yaxis.max,u):e.yaxis.min,p=-1,f=0;f<l.length;f+=c){var d=l[f],m=l[f+1];if(null!=d){var g=3===c?l[f+2]:h;(e.bars.horizontal?r<=Math.max(g,d)&&r>=Math.min(g,d)&&s>=m+i&&s<=m+o:r>=d+i&&r<=d+o&&s>=Math.min(g,m)&&s<=Math.max(g,m))&&(p=f/c)}}return p}function he(){var e=p.interaction.redrawOverlayInterval;-1!==e?R||(R=window.setTimeout(function(){pe(O)},e)):pe()}function pe(e){if(R=null,C){v.clear(),Y(A.drawOverlay,[C,v]);var t=new CustomEvent("onDrawingDone");e.getEventHolder().dispatchEvent(t),h(e.getPlaceholder(),"drawingdone")}}function fe(e,t,n,i){if("string"==typeof e)return e;if(!isFinite(n)||!isFinite(t))return i;for(var o=S.createLinearGradient(0,n,0,t),a=0,r=e.colors.length;a<r;++a){var s=e.colors[a];if("string"!=typeof s){var l=x.parse(i);null!=s.brightness&&(l=l.scale("rgb",s.brightness)),null!=s.opacity&&(l.a*=s.opacity),s=l.toString()}o.addColorStop(a/(r-1),s)}return o}!function(){for(var e={Canvas:m},t=0;t<i.length;++t){var n=i[t];n.init(O,e),n.options&&o(!0,p,n.options)}}(),function(){s(e,"padding",0),Array.from(e.children).filter(function(e){return!e.classList.contains("flot-overlay")&&!e.classList.contains("flot-base")}).forEach(function(e){e.remove()}),"static"===s(e,"position")&&s(e,"position","relative"),g=new m("flot-base",e),v=new m("flot-overlay",e),S=g.context,C=v.context,d(b=v.element);var t=c(e,"plot");t&&(t.shutdown(),v.clear()),c(e,"plot",O)}(),function(t){o(!0,p,t),t&&t.colors&&(p.colors=t.colors),null==p.xaxis.color&&(p.xaxis.color=x.parse(p.grid.color).scale("a",.22).toString()),null==p.yaxis.color&&(p.yaxis.color=x.parse(p.grid.color).scale("a",.22).toString()),null==p.xaxis.tickColor&&(p.xaxis.tickColor=p.grid.tickColor||p.xaxis.color),null==p.yaxis.tickColor&&(p.yaxis.tickColor=p.grid.tickColor||p.yaxis.color),null==p.grid.borderColor&&(p.grid.borderColor=p.grid.color),null==p.grid.tickColor&&(p.grid.tickColor=x.parse(p.grid.color).scale("a",.22).toString());var n,i,a,r=s(e,"font-size"),l=r?+r.replace("px",""):13,c={style:s(e,"font-style"),size:Math.round(.8*l),variant:s(e,"font-variant"),weight:s(e,"font-weight"),family:s(e,"font-family")};for(a=p.xaxes.length||1,n=0;n<a;++n)(i=p.xaxes[n])&&!i.tickColor&&(i.tickColor=i.color),i=o(!0,{},p.xaxis,i),p.xaxes[n]=i,i.font&&(i.font=o({},c,i.font),i.font.color||(i.font.color=i.color),i.font.lineHeight||(i.font.lineHeight=Math.round(1.15*i.font.size)));for(a=p.yaxes.length||1,n=0;n<a;++n)(i=p.yaxes[n])&&!i.tickColor&&(i.tickColor=i.color),i=o(!0,{},p.yaxis,i),p.yaxes[n]=i,i.font&&(i.font=o({},c,i.font),i.font.color||(i.font.color=i.color),i.font.lineHeight||(i.font.lineHeight=Math.round(1.15*i.font.size)));for(n=0;n<p.xaxes.length;++n)G(P,n+1).options=p.xaxes[n];for(n=0;n<p.yaxes.length;++n)G(L,n+1).options=p.yaxes[n];for(var u in B().forEach(function(e){e.boxPosition=e.options.boxPosition||{centerX:0,centerY:0}}),A)p.hooks[u]&&p.hooks[u].length&&(A[u]=A[u].concat(p.hooks[u]));Y(A.processOptions,[p])}(n),F(t),_(!0),$(),Y(A.bindEvents,[b])}var L=[];function N(e,t,n){return new P("string"==typeof e?document.querySelector(e):e,t,n,L)}var E=k;function z(e,t,n,i){if(t.points.errorbars){var o=[{x:!0,number:!0,required:!0},{y:!0,number:!0,required:!0}],a=t.points.errorbars;"x"!==a&&"xy"!==a||(t.points.xerr.asymmetric?(o.push({x:!0,number:!0,required:!0}),o.push({x:!0,number:!0,required:!0})):o.push({x:!0,number:!0,required:!0})),"y"!==a&&"xy"!==a||(t.points.yerr.asymmetric?(o.push({y:!0,number:!0,required:!0}),o.push({y:!0,number:!0,required:!0})):o.push({y:!0,number:!0,required:!0})),i.format=o}}function A(e,t){var n=e.datapoints.points,i=null,o=null,a=null,r=null,s=e.points.xerr,l=e.points.yerr,c=e.points.errorbars;"x"===c||"xy"===c?s.asymmetric?(i=n[t+2],o=n[t+3],"xy"===c&&(l.asymmetric?(a=n[t+4],r=n[t+5]):a=n[t+4])):(i=n[t+2],"xy"===c&&(l.asymmetric?(a=n[t+3],r=n[t+4]):a=n[t+3])):"y"===c&&(l.asymmetric?(a=n[t+2],r=n[t+3]):a=n[t+2]),null==o&&(o=i),null==r&&(r=a);var u=[i,o,a,r];return s.show||(u[0]=null,u[1]=null),l.show||(u[2]=null,u[3]=null),u}function O(e,t,n,i,o,a,r,s,l,c,u){i+=c,o+=c,a+=c,"x"===t.err?(o>n+l?I(e,[[o,i],[Math.max(n+l,u[0]),i]]):r=!1,a<n-l?I(e,[[Math.min(n-l,u[1]),i],[a,i]]):s=!1):(o<i-l?I(e,[[n,o],[n,Math.min(i-l,u[0])]]):r=!1,a>i+l?I(e,[[n,Math.max(i+l,u[1])],[n,a]]):s=!1),l=null!=t.radius?t.radius:l,r&&("-"===t.upperCap?"x"===t.err?I(e,[[o,i-l],[o,i+l]]):I(e,[[n-l,o],[n+l,o]]):"function"==typeof t.upperCap&&("x"===t.err?t.upperCap(e,o,i,l):t.upperCap(e,n,o,l))),s&&("-"===t.lowerCap?"x"===t.err?I(e,[[a,i-l],[a,i+l]]):I(e,[[n-l,a],[n+l,a]]):"function"==typeof t.lowerCap&&("x"===t.err?t.lowerCap(e,a,i,l):t.lowerCap(e,n,a,l)))}function I(e,t){e.beginPath(),e.moveTo(t[0][0],t[0][1]);for(var n=1;n<t.length;n++)e.lineTo(t[n][0],t[n][1]);e.stroke()}function R(e,t){var n=e.getPlotOffset();t.save(),t.translate(n.left,n.top),e.getData().forEach(function(e){e.points.errorbars&&(e.points.xerr.show||e.points.yerr.show)&&function(e,t,n){var i,o=n.datapoints.points,a=n.datapoints.pointsize,r=[n.xaxis,n.yaxis],s=n.points.radius,l=[n.points.xerr,n.points.yerr],c=!1;r[0].p2c(r[0].max)<r[0].p2c(r[0].min)&&(c=!0,i=l[0].lowerCap,l[0].lowerCap=l[0].upperCap,l[0].upperCap=i);var u=!1;r[1].p2c(r[1].min)<r[1].p2c(r[1].max)&&(u=!0,i=l[1].lowerCap,l[1].lowerCap=l[1].upperCap,l[1].upperCap=i);for(var h=0;h<n.datapoints.points.length;h+=a)for(var p=A(n,h),f=0;f<l.length;f++){var d=[r[f].min,r[f].max];if(p[f*l.length]){var m=o[h],g=o[h+1],v=[m,g][f]+p[f*l.length+1],x=[m,g][f]-p[f*l.length];if("x"===l[f].err&&(g>r[1].max||g<r[1].min||v<r[0].min||x>r[0].max))continue;if("y"===l[f].err&&(m>r[0].max||m<r[0].min||v<r[1].min||x>r[1].max))continue;var b=!0,y=!0;v>d[1]&&(b=!1,v=d[1]),x<d[0]&&(y=!1,x=d[0]),("x"===l[f].err&&c||"y"===l[f].err&&u)&&(i=x,x=v,v=i,i=y,y=b,b=i,i=d[0],d[0]=d[1],d[1]=i),m=r[0].p2c(m),g=r[1].p2c(g),v=r[f].p2c(v),x=r[f].p2c(x),d[0]=r[f].p2c(d[0]),d[1]=r[f].p2c(d[1]);var w=l[f].lineWidth?l[f].lineWidth:n.points.lineWidth,T=null!=n.points.shadowSize?n.points.shadowSize:n.shadowSize;if(w>0&&T>0){var k=T/2;t.lineWidth=k,t.strokeStyle="rgba(0,0,0,0.1)",O(t,l[f],m,g,v,x,b,y,s,k+k/2,d),t.strokeStyle="rgba(0,0,0,0.2)",O(t,l[f],m,g,v,x,b,y,s,k/2,d)}t.strokeStyle=l[f].color?l[f].color:n.color,t.lineWidth=w,O(t,l[f],m,g,v,x,b,y,s,0,d)}}}(0,t,e)}),t.restore()}L.push({init:function(e){e.hooks.processRawData.push(z),e.hooks.draw.push(R)},options:{series:{points:{errorbars:null,xerr:{err:"x",show:null,asymmetric:null,upperCap:null,lowerCap:null,color:null,radius:null},yerr:{err:"y",show:null,asymmetric:null,upperCap:null,lowerCap:null,color:null,radius:null}}}},name:"errorbars",version:"1.0"});var W=Y(Number.MAX_VALUE,10),D=Y(Number.MAX_VALUE,4);function Y(e,t){for(var n,i,o=Math.floor(Math.log(e)*Math.LOG10E)-1,a=[],r=-o;r<=o;r++){i=parseFloat("1e"+r);for(var s=1;s<9;s+=t)n=i*s,a.push(n)}return a}var F=function(e,t,n){var i=[],o=-1,a=-1,r=e.getCanvas(),s=W,l=X(t,e),c=t.max;n||(n=.3*Math.sqrt("x"===t.direction?r.width:r.height)),W.some(function(e,t){return e>=l&&(o=t,!0)}),W.some(function(e,t){return e>=c&&(a=t,!0)}),-1===a&&(a=W.length-1),a-o<=n/4&&s.length!==D.length&&(s=D,o*=2,a*=2);var u,h,p,f=null,d=1/n;if(a-o>=n/4){for(var m=a;m>=o;m--)u=s[m],h=(Math.log(u)-Math.log(l))/(Math.log(c)-Math.log(l)),p=u,null===f?f={pixelCoord:h,idealPixelCoord:h}:Math.abs(h-f.pixelCoord)>=d?f={pixelCoord:h,idealPixelCoord:f.idealPixelCoord-d}:p=null,p&&i.push(p);i.reverse()}else{var g=e.computeTickSize(l,c,n);i=E({min:l,max:c,tickSize:g})}return i},X=function(e,t){var n=e.min,i=e.max;return n<=0&&i<(n=null===e.datamin?e.min=.1:U(t,e))&&(e.max=null!==e.datamax?e.datamax:e.options.max,e.options.offset.below=0,e.options.offset.above=0),n},B=function(e,t,n){var i=e>0?Math.floor(Math.log(e)/Math.LN10):0;if(n)return i>=-4&&i<=7?M(e,t,n):S(e,t,n);if(i>=-4&&i<=7){var o=i<0?e.toFixed(-i):e.toFixed(i+2);if(-1!==o.indexOf(".")){for(var a=o.lastIndexOf("0");a===o.length-1;)a=(o=o.slice(0,-1)).lastIndexOf("0");o.indexOf(".")===o.length-1&&(o=o.slice(0,-1))}return o}return S(e,t)},G=function(e){return e<W[0]&&(e=W[0]),Math.log(e)},H=function(e){return Math.exp(e)},j=function(e){return-e},V=function(e){return-G(e)},q=function(e){return H(-e)};function _(e,t){"log"===t.options.mode&&t.datamin<=0&&(null===t.datamin?t.datamin=.1:t.datamin=U(e,t))}function U(e,t){var n=e.getData().filter(function(e){return e.xaxis===t||e.yaxis===t}).map(function(t){return e.computeRangeForDataSeries(t,null,Z)}),i="x"===t.direction?Math.min(.1,n&&n[0]?n[0].xmin:.1):Math.min(.1,n&&n[0]?n[0].ymin:.1);return t.min=i,i}function Z(e){return e>0}L.push({init:function(e){e.hooks.processOptions.push(function(e){var t=e.getAxes();Object.keys(t).forEach(function(n){var i=t[n],o=i.options;"log"===o.mode?(i.tickGenerator=function(t){return F(e,t,11)},"function"!=typeof i.options.tickFormatter&&(i.options.tickFormatter=B),i.options.transform=o.inverted?V:G,i.options.inverseTransform=o.inverted?q:H,i.options.autoScaleMargin=0,e.hooks.setRange.push(_)):o.inverted&&(i.options.transform=j,i.options.inverseTransform=j)})})},options:{xaxis:{}},name:"log",version:"0.1"});var J=F,K=function(e,t,n,i,o){var a=i*Math.sqrt(Math.PI)/2;e.rect(t-a,n-a,a+a,a+a)},Q=function(e,t,n,i,o){var a=i*Math.sqrt(Math.PI)/2;e.rect(t-a,n-a,a+a,a+a)},$=function(e,t,n,i,o){var a=i*Math.sqrt(Math.PI/2);e.moveTo(t-a,n),e.lineTo(t,n-a),e.lineTo(t+a,n),e.lineTo(t,n+a),e.lineTo(t-a,n),e.lineTo(t,n-a)},ee=function(e,t,n,i,o){var a=i*Math.sqrt(2*Math.PI/Math.sin(Math.PI/3)),r=a*Math.sin(Math.PI/3);e.moveTo(t-a/2,n+r/2),e.lineTo(t+a/2,n+r/2),o||(e.lineTo(t,n-r/2),e.lineTo(t-a/2,n+r/2),e.lineTo(t+a/2,n+r/2))},te=function(e,t,n,i,o,a){o||(e.moveTo(t+i,n),e.arc(t,n,i,0,2*Math.PI,!1))},ne={square:K,rectangle:Q,diamond:$,triangle:ee,cross:function(e,t,n,i,o){var a=i*Math.sqrt(Math.PI)/2;e.moveTo(t-a,n-a),e.lineTo(t+a,n+a),e.moveTo(t-a,n+a),e.lineTo(t+a,n-a)},ellipse:te,plus:function(e,t,n,i,o){var a=i*Math.sqrt(Math.PI/2);e.moveTo(t-a,n),e.lineTo(t+a,n),e.moveTo(t,n+a),e.lineTo(t,n-a)}};function ie(e,t,n,i){if(!0===t.flatdata){var o=t.start||0,a="number"==typeof t.step?t.step:1;i.pointsize=2;for(var r=0,s=0;r<n.length;r++,s+=2)i.points[s]=o+r*a,i.points[s+1]=n[r];void 0!==i.points?i.points.length=2*n.length:i.points=[]}}K.fill=!0,Q.fill=!0,$.fill=!0,ee.fill=!0,te.fill=!0,L.push({init:function(e){e.drawSymbol=ne},name:"symbols",version:"1.0"}),L.push({init:function(e){e.hooks.processRawData.push(ie)},name:"flatdata",version:"0.0.2"});var oe=w.SNAPPING_CONSTANT,ae=w.PANHINT_LENGTH_CONSTANT;function re(e,n){var i,o=null,a="manual"===n.pan.mode,r="smartLock"===n.pan.mode,l=r||"smart"===n.pan.mode,c="default",u=null,p=null,m={x:0,y:0},g=!1;function v(n){var i=-n.deltaY,o=Math.abs(n.deltaY)<=1?1+Math.abs(n.deltaY)/50:null;if(g&&x(n),e.getOptions().zoom.active)return n.preventDefault(),function(n,i,o){var a=t.getPageXY(n),r=e.offset();r.left=a.X-r.left,r.top=a.Y-r.top;var s=e.getPlaceholder().getBoundingClientRect(),l={left:s.left+window.scrollX,top:s.top+window.scrollY};l.left=a.X-l.left,l.top=a.Y-l.top;var c=e.getXAxes().concat(e.getYAxes()).filter(function(e){var t=e.box;if(void 0!==t)return l.left>t.left&&l.left<t.left+t.width&&l.top>t.top&&l.top<t.top+t.height});0===c.length&&(c=void 0),i?e.zoomOut({center:r,axes:c,amount:o}):e.zoom({center:r,axes:c,amount:o})}(n,i<0,o),!1}function x(n){if(g){p&&(window.clearTimeout(p),p=null),g=!1;var u=t.getPageXY(n);s(e.getPlaceholder(),"cursor",c),l?(e.smartPan({x:i.startPageX-u.X,y:i.startPageY-u.Y},i,o,!1,r),e.smartPan.end()):a&&(e.pan({left:m.x-u.X,top:m.y-u.Y,axes:o}),m.x=0,m.y=0)}}function b(t){if(e.activate(),e.getOptions().recenter.interactive){var n=e.getTouchedAxis(t.clientX,t.clientY);e.recenter({axes:n[0]?n:null}),n[0]?h(e.getPlaceholder(),"re-center",{axisTouched:n[0]}):h(e.getPlaceholder(),"re-center",t)}}function w(t){return e.activate(),g&&x(t),!1}function T(n){if(0===n.button){var u=n.currentTarget;!function(n){g=!0;var r=t.getPageXY(n),u=e.getPlaceholder().getBoundingClientRect(),h={left:u.left+window.scrollX,top:u.top+window.scrollY};h.left=r.X-h.left,h.top=r.Y-h.top,0===(o=e.getXAxes().concat(e.getYAxes()).filter(function(e){var t=e.box;if(void 0!==t)return h.left>t.left&&h.left<t.left+t.width&&h.top>t.top&&h.top<t.top+t.height})).length&&(o=void 0);var p=s(e.getPlaceholder(),"cursor");p&&(c=p),s(e.getPlaceholder(),"cursor",e.getOptions().pan.cursor),l?i=e.navigationState(r.X,r.Y):a&&(m.x=r.X,m.y=r.Y)}(n),u.setPointerCapture(n.pointerId),u.addEventListener("pointermove",h),u.addEventListener("pointerup",f),u.addEventListener("pointercancel",f)}function h(n){!function(n){if(g){var s=t.getPageXY(n),c=e.getOptions().pan.frameRate;-1!==c?!p&&c&&(p=window.setTimeout(function(){l?e.smartPan({x:i.startPageX-s.X,y:i.startPageY-s.Y},i,o,!1,r):a&&(e.pan({left:m.x-s.X,top:m.y-s.Y,axes:o}),m.x=s.X,m.y=s.Y),p=null},1/c*1e3)):l?e.smartPan({x:i.startPageX-s.X,y:i.startPageY-s.Y},i,o,!1,r):a&&(e.pan({left:m.x-s.X,top:m.y-s.Y,axes:o}),m.x=s.X,m.y=s.Y)}}(n)}function f(e){x(e),u.removeEventListener("pointermove",h),u.removeEventListener("pointerup",f),u.removeEventListener("pointercancel",f),u.releasePointerCapture(e.pointerId)}}e.navigationState=function(e,t){var n=this.getAxes(),i={};return Object.keys(n).forEach(function(e){var t=n[e];i[e]={navigationOffset:{below:t.options.offset.below||0,above:t.options.offset.above||0},axisMin:t.min,axisMax:t.max,diagMode:!1}}),i.startPageX=e||0,i.startPageY=t||0,i},e.activate=function(){var t=e.getOptions();t.pan.active&&t.zoom.active||(t.pan.active=!0,t.zoom.active=!0,h(e.getPlaceholder(),"plotactivated",[e]))},e.zoomOut=function(t){t||(t={}),t.amount||(t.amount=e.getOptions().zoom.amount),t.amount=1/t.amount,e.zoom(t)},e.zoom=function(t){t||(t={});var n=t.center,i=t.amount||e.getOptions().zoom.amount,o=e.width(),a=e.height(),r=t.axes||e.getAxes();n||(n={left:o/2,top:a/2});var s=n.left/o,l=n.top/a,c={x:{min:n.left-s*o/i,max:n.left+(1-s)*o/i},y:{min:n.top-l*a/i,max:n.top+(1-l)*a/i}};for(var u in r)if(r.hasOwnProperty(u)){var p=r[u],f=p.options,d=c[p.direction].min,m=c[p.direction].max,g=p.options.offset;if((f.axisZoom||!t.axes)&&(t.axes||f.plotZoom)){if((d=y.saturate(p.c2p(d)))>(m=y.saturate(p.c2p(m)))){var v=d;d=m,m=v}if(f.zoomRange){if(m-d<f.zoomRange[0])continue;if(m-d>f.zoomRange[1])continue}var x=y.saturate(g.below-(p.min-d)),b=y.saturate(g.above-(p.max-m));f.offset={below:x,above:b}}}e.setupGrid(!0),e.draw(),t.preventEvent||h(e.getPlaceholder(),"plotzoom",[e,t])},e.pan=function(t){var n={x:+t.left,y:+t.top};isNaN(n.x)&&(n.x=0),isNaN(n.y)&&(n.y=0);var i=t.axes||e.getAxes();Object.keys(i).forEach(function(e){var o=i[e],a=o.options,r=n[o.direction];if((a.axisPan||!t.axes)&&(a.plotPan||t.axes)){var s=o.p2c(a.panRange[0])-o.p2c(o.min),l=o.p2c(a.panRange[1])-o.p2c(o.max);if("y"===o.direction){var c=s;s=l,l=c}if(void 0!==a.panRange[0]&&r>=l&&(r=l),void 0!==a.panRange[1]&&r<=s&&(r=s),0!==r){var u=y.saturate(o.c2p(o.p2c(o.min)+r)-o.c2p(o.p2c(o.min))),h=y.saturate(o.c2p(o.p2c(o.max)+r)-o.c2p(o.p2c(o.max)));isFinite(u)||(u=0),isFinite(h)||(h=0),a.offset={below:y.saturate(u+(a.offset.below||0)),above:y.saturate(h+(a.offset.above||0))}}}}),e.setupGrid(!0),e.draw(),t.preventEvent||h(e.getPlaceholder(),"plotpan",[e,t])},e.recenter=function(t){var n=t.axes||e.getAxes();Object.keys(n).forEach(function(e){var i=n[e];t.axes?"x"===i.direction?i.options.offset={below:0}:"y"===i.direction&&(i.options.offset={above:0}):i.options.offset={below:0,above:0}}),e.setupGrid(!0),e.draw()};var k=null,M={x:0,y:0};e.smartPan=function(t,n,i,o,a){var r,s,l,c,p,f,d=!!a||function(e){return Math.abs(e.y)<oe&&Math.abs(e.x)>=oe||Math.abs(e.x)<oe&&Math.abs(e.y)>=oe}(t),m=e.getAxes();(function(e){return Math.abs(e.x)>0&&Math.abs(e.y)>0})(t=a?function(e){switch(!k&&Math.max(Math.abs(e.x),Math.abs(e.y))>=oe&&(k=Math.abs(e.x)<Math.abs(e.y)?"y":"x"),k){case"x":return{x:e.x,y:0};case"y":return{x:0,y:e.y};default:return{x:0,y:0}}}(t):function(e){return Math.abs(e.x)<oe&&Math.abs(e.y)>=oe?{x:0,y:e.y}:Math.abs(e.y)<oe&&Math.abs(e.x)>=oe?{x:e.x,y:0}:e}(t))&&(n.diagMode=!0),d&&!0===n.diagMode&&(n.diagMode=!1,function(e,t,n){var i;Object.keys(e).forEach(function(o){i=e[o],0===n[i.direction]&&(i.options.offset.below=t[o].navigationOffset.below,i.options.offset.above=t[o].navigationOffset.above)})}(m,n,t)),u=d?{start:{x:n.startPageX-e.offset().left+e.getPlotOffset().left,y:n.startPageY-e.offset().top+e.getPlotOffset().top},end:{x:n.startPageX-t.x-e.offset().left+e.getPlotOffset().left,y:n.startPageY-t.y-e.offset().top+e.getPlotOffset().top}}:{start:{x:n.startPageX-e.offset().left+e.getPlotOffset().left,y:n.startPageY-e.offset().top+e.getPlotOffset().top},end:!1},isNaN(t.x)&&(t.x=0),isNaN(t.y)&&(t.y=0),i&&(m=i),Object.keys(m).forEach(function(e){if(s=m[e],l=s.min,c=s.max,r=s.options,f=t[s.direction],p=M[s.direction],(r.axisPan||!i)&&(i||r.plotPan)){var n=p+s.p2c(r.panRange[0])-s.p2c(l),o=p+s.p2c(r.panRange[1])-s.p2c(c);if("y"===s.direction){var a=n;n=o,o=a}if(void 0!==r.panRange[0]&&f>=o&&(f=o),void 0!==r.panRange[1]&&f<=n&&(f=n),0!==f){var u=y.saturate(s.c2p(s.p2c(l)-(p-f))-s.c2p(s.p2c(l))),h=y.saturate(s.c2p(s.p2c(c)-(p-f))-s.c2p(s.p2c(c)));isFinite(u)||(u=0),isFinite(h)||(h=0),s.options.offset.below=y.saturate(u+(s.options.offset.below||0)),s.options.offset.above=y.saturate(h+(s.options.offset.above||0))}}}),M=t,e.setupGrid(!0),e.draw(),o||h(e.getPlaceholder(),"plotpan",[e,t,i,n])},e.smartPan.end=function(){u=null,k=null,M={x:0,y:0},e.triggerRedrawOverlay()},e.getTouchedAxis=function(t,n){var i=e.getPlaceholder().getBoundingClientRect(),o={left:i.left+window.scrollX,top:i.top+window.scrollY};return o.left=t-o.left,o.top=n-o.top,e.getXAxes().concat(e.getYAxes()).filter(function(e){var t=e.box;if(void 0!==t)return o.left>t.left&&o.left<t.left+t.width&&o.top>t.top&&o.top<t.top+t.height})},e.hooks.drawOverlay.push(function(e,t){if(u){t.strokeStyle="rgba(96, 160, 208, 0.7)",t.lineWidth=2,t.lineJoin="round";var n=Math.round(u.start.x),i=Math.round(u.start.y),a=0,r=0;if(o?"x"===o[0].direction?(r=Math.round(u.start.y),a=Math.round(u.end.x)):"y"===o[0].direction&&(a=Math.round(u.start.x),r=Math.round(u.end.y)):(a=Math.round(u.end.x),r=Math.round(u.end.y)),t.beginPath(),!1===u.end)t.moveTo(n,i-ae),t.lineTo(n,i+ae),t.moveTo(n+ae,i),t.lineTo(n-ae,i);else{var s=i===r;t.moveTo(n-(s?0:ae),i-(s?ae:0)),t.lineTo(n+(s?0:ae),i+(s?ae:0)),t.moveTo(n,i),t.lineTo(a,r),t.moveTo(a-(s?0:ae),r-(s?ae:0)),t.lineTo(a+(s?0:ae),r+(s?ae:0))}t.stroke()}}),e.hooks.bindEvents.push(function(e,t){var n=e.getOptions();n.zoom.interactive&&f(t,"wheel",v),n.pan.interactive&&f(t,"pointerdown",T),f(t,"dblclick",b),f(t,"click",w)}),e.hooks.shutdown.push(function(e,t){d(t,"wheel",v),d(t,"pointerdown",T),d(t,"dblclick",b),d(t,"click",w),p&&window.clearTimeout(p)})}function se(e,t,n,i){var o="categories"===t.xaxis.options.mode,a="categories"===t.yaxis.options.mode;if(o||a){var r=i.format;if(!r){var s=t;if((r=[]).push({x:!0,number:!0,required:!0,computeRange:!0}),r.push({y:!0,number:!0,required:!0,computeRange:!0}),s.bars.show||s.lines.show&&s.lines.fill){var l=!!(s.bars.show&&s.bars.zero||s.lines.show&&s.lines.zero);r.push({y:!0,number:!0,required:!1,defaultValue:0,computeRange:l}),s.bars.horizontal&&(delete r[r.length-1].y,r[r.length-1].x=!0)}i.format=r}for(var c=0;c<r.length;++c)r[c].x&&o&&(r[c].number=!1),r[c].y&&a&&(r[c].number=!1,r[c].computeRange=!1)}}function le(e){var t=[];for(var n in e.categories){var i=e.categories[n];i>=e.min&&i<=e.max&&t.push([i,n])}return t.sort(function(e,t){return e[0]-t[0]}),t}function ce(e,t,n){if("categories"===e[t].options.mode){if(!e[t].categories){var i={},o=e[t].options.categories||{};if(Array.isArray(o))for(var a=0;a<o.length;++a)i[o[a]]=a;else for(var r in o)i[r]=o[r];e[t].categories=i}e[t].options.ticks||(e[t].options.ticks=le),function(e,t,n){for(var i=e.points,o=e.pointsize,a=e.format,r=t.charAt(0),s=function(e){var t=-1;for(var n in e)e[n]>t&&(t=e[n]);return t+1}(n),l=0;l<i.length;l+=o)if(null!=i[l])for(var c=0;c<o;++c){var u=i[l+c];null!=u&&a[c][r]&&(u in n||(n[u]=s,++s),i[l+c]=n[u])}}(n,t,e[t].categories)}}function ue(e,t,n){ce(t,"xaxis",n),ce(t,"yaxis",n)}L.push({init:function(e){e.hooks.processOptions.push(re)},options:{zoom:{interactive:!1,active:!1,amount:1.5},pan:{interactive:!1,active:!1,cursor:"move",frameRate:60,mode:"smart"},recenter:{interactive:!0},xaxis:{axisZoom:!0,plotZoom:!0,axisPan:!0,plotPan:!0,panRange:[void 0,void 0],zoomRange:[void 0,void 0]},yaxis:{axisZoom:!0,plotZoom:!0,axisPan:!0,plotPan:!0,panRange:[void 0,void 0],zoomRange:[void 0,void 0]}},name:"navigate",version:"1.3"}),L.push({init:function(e){e.hooks.processRawData.push(function(e,t,n,i){if(null!=t.fillBetween){var o=i.format;o||((o=[]).push({x:!0,number:!0,computeRange:"none"!==t.xaxis.options.autoScale,required:!0}),o.push({y:!0,number:!0,computeRange:"none"!==t.yaxis.options.autoScale,required:!0}),void 0!==t.fillBetween&&""!==t.fillBetween&&function(t){for(var n=e.getData(),i=0;i<n.length;i++)if(n[i].id===t)return!0;return!1}(t.fillBetween)&&t.fillBetween!==t.id&&o.push({x:!1,y:!0,number:!0,required:!1,computeRange:"none"!==t.yaxis.options.autoScale,defaultValue:0}),i.format=o)}}),e.hooks.processDatapoints.push(function(e,t,n){if(null!=t.fillBetween){var i=function(e,t){var n;for(n=0;n<t.length;++n)if(t[n].id===e.fillBetween)return t[n];return"number"==typeof e.fillBetween?e.fillBetween<0||e.fillBetween>=t.length?null:t[e.fillBetween]:null}(t,e.getData());if(i){for(var o,a,r,s,l,c,u,h,p=n.pointsize,f=n.points,d=i.datapoints.pointsize,m=i.datapoints.points,g=[],v=t.lines.show,x=p>2&&n.format[2].y,b=v&&t.lines.steps,y=!0,w=0,T=0;!(w>=f.length);){if(u=g.length,null==f[w]){for(h=0;h<p;++h)g.push(f[w+h]);w+=p}else if(T>=m.length){if(!v)for(h=0;h<p;++h)g.push(f[w+h]);w+=p}else if(null==m[T]){for(h=0;h<p;++h)g.push(null);y=!0,T+=d}else{if(o=f[w],a=f[w+1],s=m[T],l=m[T+1],c=0,o===s){for(h=0;h<p;++h)g.push(f[w+h]);c=l,w+=p,T+=d}else if(o>s){if(v&&w>0&&null!=f[w-p]){for(r=a+(f[w-p+1]-a)*(s-o)/(f[w-p]-o),g.push(s),g.push(r),h=2;h<p;++h)g.push(f[w+h]);c=l}T+=d}else{if(y&&v){w+=p;continue}for(h=0;h<p;++h)g.push(f[w+h]);v&&T>0&&null!=m[T-d]&&(c=l+(m[T-d+1]-l)*(o-s)/(m[T-d]-s)),w+=p}y=!1,u!==g.length&&x&&(g[u+2]=c)}if(b&&u!==g.length&&u>0&&null!==g[u]&&g[u]!==g[u-p]&&g[u+1]!==g[u-p+1]){for(h=0;h<p;++h)g[u+p+h]=g[u+h];g[u+1]=g[u-p+1]}}n.points=g}}})},options:{series:{fillBetween:null}},name:"fillbetween",version:"1.0"}),L.push({init:function(e){e.hooks.processRawData.push(se),e.hooks.processDatapoints.push(ue)},options:{xaxis:{categories:null},yaxis:{categories:null}},name:"categories",version:"1.0"}),L.push({init:function(e){e.hooks.processDatapoints.push(function(e,t,n){if(null!=t.stack&&!1!==t.stack){var i=t.bars.show||t.lines.show&&t.lines.fill,o=n.pointsize>2&&(t.bars.horizontal?n.format[2].x:n.format[2].y);i&&!o&&function(e,t){for(var n=[],i=0;i<t.points.length;i+=2)n.push(t.points[i]),n.push(t.points[i+1]),n.push(0);t.format.push({x:e.bars.horizontal,y:!e.bars.horizontal,number:!0,required:!1,computeRange:"none"!==e.yaxis.options.autoScale,defaultValue:0}),t.points=n,t.pointsize=3}(t,n);var a=function(e,t){for(var n=null,i=0;i<t.length&&e!==t[i];++i)t[i].stack===e.stack&&(n=t[i]);return n}(t,e.getData());if(a){for(var r,s,l,c,u,h,p,f,d=n.pointsize,m=n.points,g=a.datapoints.pointsize,v=a.datapoints.points,x=[],b=t.lines.show,y=t.bars.horizontal,w=b&&t.lines.steps,T=!0,k=y?1:0,M=y?0:1,S=0,C=0;!(S>=m.length);){if(p=x.length,null==m[S]){for(f=0;f<d;++f)x.push(m[S+f]);S+=d}else if(C>=v.length){if(!b)for(f=0;f<d;++f)x.push(m[S+f]);S+=d}else if(null==v[C]){for(f=0;f<d;++f)x.push(null);T=!0,C+=g}else{if(r=m[S+k],s=m[S+M],c=v[C+k],u=v[C+M],h=0,r===c){for(f=0;f<d;++f)x.push(m[S+f]);x[p+M]+=u,h=u,S+=d,C+=g}else if(r>c){if(b&&S>0&&null!=m[S-d]){for(l=s+(m[S-d+M]-s)*(c-r)/(m[S-d+k]-r),x.push(c),x.push(l+u),f=2;f<d;++f)x.push(m[S+f]);h=u}C+=g}else{if(T&&b){S+=d;continue}for(f=0;f<d;++f)x.push(m[S+f]);b&&C>0&&null!=v[C-g]&&(h=u+(v[C-g+M]-u)*(r-c)/(v[C-g+k]-c)),x[p+M]+=h,S+=d}T=!1,p!==x.length&&i&&(x[p+2]+=h)}if(w&&p!==x.length&&p>0&&null!==x[p]&&x[p]!==x[p-d]&&x[p+1]!==x[p-d+1]){for(f=0;f<d;++f)x[p+d+f]=x[p+f];x[p+1]=x[p-d+1]}}n.points=x}}})},options:{series:{stack:null}},name:"stack",version:"1.2"});var he=w.ZOOM_DISTANCE_MARGIN;function pe(e,t){var n,i,o,a,r={zoomEnable:!1,prevDistance:null,prevPanPosition:{x:0,y:0},prevTapPosition:{x:0,y:0}},s={prevTouchedAxis:"none",currentTouchedAxis:"none",touchedAxis:null,navigationConstraint:"unconstrained",initialState:null},l=t.pan.interactive&&"manual"===t.pan.touchMode,c="smartLock"===t.pan.touchMode,u=t.pan.interactive&&(c||"smart"===t.pan.touchMode);function p(t,n,i){s.touchedAxis=function(e,t,n,i){if("pinchstart"!==t.type)return"panstart"===t.type||"pinchend"===t.type?e.getTouchedAxis(t.detail.touches[0].pageX,t.detail.touches[0].pageY):i.touchedAxis;var o=e.getTouchedAxis(t.detail.touches[0].pageX,t.detail.touches[0].pageY),a=e.getTouchedAxis(t.detail.touches[1].pageX,t.detail.touches[1].pageY);return o.length===a.length&&o.toString()===a.toString()?o:void 0}(e,t,0,s),fe(s)?s.navigationConstraint="unconstrained":s.navigationConstraint="axisConstrained"}n={start:function(t){if(p(t),de(t,"pan",r,s),u){var n=xe(t,"pan");s.initialState=e.navigationState(n.x,n.y)}},drag:function(t){if(p(t),u&&s.initialState){var n=xe(t,"pan");e.smartPan({x:s.initialState.startPageX-n.x,y:s.initialState.startPageY-n.y},s.initialState,s.touchedAxis,!1,c)}else l&&(e.pan({left:-ve(t,"pan",r).x,top:-ve(t,"pan",r).y,axes:s.touchedAxis}),ge(t,"pan",r,s))},end:function(t){p(t),u&&e.smartPan.end(),function(e,t){return t.zoomEnable&&1===e.detail.touches.length}(t,r)&&ge(t,"pan",r,s)}},i={start:function(e){a&&(clearTimeout(a),a=null),p(e),function(e,t){t.prevDistance=me(e)}(e,r),de(e,"pinch",r,s)},drag:function(t){a||(a=setTimeout(function(){p(t),e.pan({left:-ve(t,"pinch",r).x,top:-ve(t,"pinch",r).y,axes:s.touchedAxis}),ge(t,"pinch",r,s);var n=me(t);(r.zoomEnable||null!=r.prevDistance&&Math.abs(n-r.prevDistance)>he)&&(function(e,t,n,i){var o=e.offset(),a={left:0,top:0},r=me(t)/n.prevDistance,s=me(t);a.left=xe(t,"pinch").x-o.left,a.top=xe(t,"pinch").y-o.top,e.zoom({center:a,amount:r,axes:i.touchedAxis}),n.prevDistance=s}(e,t,r,s),r.zoomEnable=!0),a=null},1e3/60))},end:function(e){a&&(clearTimeout(a),a=null),p(e),r.prevDistance=null}},o={recenterPlot:function(t){t&&t.detail&&"touchstart"===t.detail.type&&function(e,t,n,i){(function(e,t,n){var i=e.getTouchedAxis(t.detail.firstTouch.x,t.detail.firstTouch.y);void 0!==i[0]&&(n.prevTouchedAxis=i[0].direction),void 0!==(i=e.getTouchedAxis(t.detail.secondTouch.x,t.detail.secondTouch.y))[0]&&(n.touchedAxis=i,n.currentTouchedAxis=i[0].direction),fe(n)&&(n.touchedAxis=null,n.prevTouchedAxis="none",n.currentTouchedAxis="none")})(e,t,i),("x"===i.currentTouchedAxis&&"x"===i.prevTouchedAxis||"y"===i.currentTouchedAxis&&"y"===i.prevTouchedAxis||"none"===i.currentTouchedAxis&&"none"===i.prevTouchedAxis)&&(e.recenter({axes:i.touchedAxis}),i.touchedAxis?h(e.getPlaceholder(),"re-center",{axisTouched:i.touchedAxis}):h(e.getPlaceholder(),"re-center",t))}(e,t,0,s)}},!0!==t.pan.enableTouch&&!0!==t.zoom.enableTouch||(e.hooks.bindEvents.push(function(e,t){var a=e.getOptions();a.zoom.interactive&&a.zoom.enableTouch&&(t.addEventListener("pinchstart",i.start,!1),t.addEventListener("pinchdrag",i.drag,!1),t.addEventListener("pinchend",i.end,!1)),a.pan.interactive&&a.pan.enableTouch&&(t.addEventListener("panstart",n.start,!1),t.addEventListener("pandrag",n.drag,!1),t.addEventListener("panend",n.end,!1)),a.recenter.interactive&&a.recenter.enableTouch&&t.addEventListener("doubletap",o.recenterPlot,!1)}),e.hooks.shutdown.push(function(e,t){t.removeEventListener("panstart",n.start),t.removeEventListener("pandrag",n.drag),t.removeEventListener("panend",n.end),t.removeEventListener("pinchstart",i.start),t.removeEventListener("pinchdrag",i.drag),t.removeEventListener("pinchend",i.end),t.removeEventListener("doubletap",o.recenterPlot)}))}function fe(e){return!e.touchedAxis||0===e.touchedAxis.length}function de(e,t,n,i){var o,a=xe(e,t);switch(i.navigationConstraint){case"unconstrained":i.touchedAxis=null,n.prevTapPosition={x:n.prevPanPosition.x,y:n.prevPanPosition.y},n.prevPanPosition={x:a.x,y:a.y};break;case"axisConstrained":o=i.touchedAxis[0].direction,i.currentTouchedAxis=o,n.prevTapPosition[o]=n.prevPanPosition[o],n.prevPanPosition[o]=a[o]}}function me(e){var t,n,i,o,a=e.detail.touches[0],r=e.detail.touches[1];return t=a.pageX,n=a.pageY,i=r.pageX,o=r.pageY,Math.sqrt((t-i)*(t-i)+(n-o)*(n-o))}function ge(e,t,n,i){var o=xe(e,t);switch(i.navigationConstraint){case"unconstrained":n.prevPanPosition.x=o.x,n.prevPanPosition.y=o.y;break;case"axisConstrained":n.prevPanPosition[i.currentTouchedAxis]=o[i.currentTouchedAxis]}}function ve(e,t,n){var i=xe(e,t);return{x:i.x-n.prevPanPosition.x,y:i.y-n.prevPanPosition.y}}function xe(e,t){return"pinch"===t?{x:(e.detail.touches[0].pageX+e.detail.touches[1].pageX)/2,y:(e.detail.touches[0].pageY+e.detail.touches[1].pageY)/2}:{x:e.detail.touches[0].pageX,y:e.detail.touches[0].pageY}}L.push({init:function(e){e.hooks.processOptions.push(pe)},options:{zoom:{enableTouch:!1},pan:{enableTouch:!1,touchMode:"manual"},recenter:{enableTouch:!0}},name:"navigateTouch",version:"0.3"});var be="hover";function ye(e,t){var n,i={twoTouches:!1,currentTapStart:{x:0,y:0},currentTapEnd:{x:0,y:0},prevTap:{x:0,y:0},currentTap:{x:0,y:0},interceptedLongTap:!1,isUnsupportedGesture:!1,prevTapTime:null,tapStartTime:null,longTapTriggerId:null};function o(t){var o=e.getOptions();(o.pan.active||o.zoom.active)&&(function(e){e.touches.length>=3?i.isUnsupportedGesture=!0:i.isUnsupportedGesture=!1}(t),n.dispatchEvent(new CustomEvent("touchevent",{detail:t})),m(t)?a(t,"pinch"):(a(t,"pan"),d(t)||(function(e){var t=(new Date).getTime(),n=null!=i.prevTapTime?t-i.prevTapTime:1/0;return n>=0&&n<500&&f(i.prevTap.x,i.prevTap.y,i.currentTap.x,i.currentTap.y)<20?(e.firstTouch=i.prevTap,e.secondTouch=i.currentTap,!0):(i.prevTapTime=t,!1)}(t)&&a(t,"doubleTap"),a(t,"tap"),a(t,"longTap"))))}function a(e,t){switch(t){case"pan":r[e.type](e);break;case"pinch":s[e.type](e);break;case"doubleTap":l.onDoubleTap(e);break;case"longTap":c[e.type](e);break;case"tap":u[e.type](e)}}var r={touchstart:function(e){i.prevTap={x:i.currentTap.x,y:i.currentTap.y},h(e),function(e){i.tapStartTime=(new Date).getTime(),i.interceptedLongTap=!1,i.currentTapStart={x:e.touches[0].pageX,y:e.touches[0].pageY},i.currentTapEnd={x:e.touches[0].pageX,y:e.touches[0].pageY}}(e),n.dispatchEvent(new CustomEvent("panstart",{detail:e}))},touchmove:function(e){p(e),h(e),function(e){i.currentTapEnd={x:e.touches[0].pageX,y:e.touches[0].pageY}}(e),i.isUnsupportedGesture||n.dispatchEvent(new CustomEvent("pandrag",{detail:e}))},touchend:function(e){p(e),d(e)?(n.dispatchEvent(new CustomEvent("pinchend",{detail:e})),n.dispatchEvent(new CustomEvent("panstart",{detail:e}))):function(e){return e.touches&&0===e.touches.length}(e)&&n.dispatchEvent(new CustomEvent("panend",{detail:e}))}},s={touchstart:function(e){n.dispatchEvent(new CustomEvent("pinchstart",{detail:e}))},touchmove:function(e){p(e),i.twoTouches=m(e),i.isUnsupportedGesture||n.dispatchEvent(new CustomEvent("pinchdrag",{detail:e}))},touchend:function(e){p(e)}},l={onDoubleTap:function(e){p(e),n.dispatchEvent(new CustomEvent("doubletap",{detail:e}))}},c={touchstart:function(e){c.waitForLongTap(e)},touchmove:function(e){},touchend:function(e){i.longTapTriggerId&&(clearTimeout(i.longTapTriggerId),i.longTapTriggerId=null)},isLongTap:function(e){return null!=i.tapStartTime&&(new Date).getTime()-i.tapStartTime>=1500&&!i.interceptedLongTap&&f(i.currentTapStart.x,i.currentTapStart.y,i.currentTapEnd.x,i.currentTapEnd.y)<20&&(i.interceptedLongTap=!0,!0)},waitForLongTap:function(e){i.longTapTriggerId||(i.longTapTriggerId=setTimeout(function(){c.isLongTap(e)&&n.dispatchEvent(new CustomEvent("longtap",{detail:e})),i.longTapTriggerId=null},1500))}},u={touchstart:function(e){i.tapStartTime=(new Date).getTime()},touchmove:function(e){},touchend:function(e){u.isTap(e)&&(n.dispatchEvent(new CustomEvent("tap",{detail:e})),p(e))},isTap:function(e){return null!=i.tapStartTime&&(new Date).getTime()-i.tapStartTime<=125&&f(i.currentTapStart.x,i.currentTapStart.y,i.currentTapEnd.x,i.currentTapEnd.y)<20}};function h(e){i.currentTap={x:e.touches[0].pageX,y:e.touches[0].pageY}}function p(t){i.isUnsupportedGesture||(t.preventDefault(),e.getOptions().propagateSupportedGesture||t.stopPropagation())}function f(e,t,n,i){return Math.sqrt((e-n)*(e-n)+(t-i)*(t-i))}function d(e){return i.twoTouches&&1===e.touches.length}function m(t){return!!(t.touches&&t.touches.length>=2&&t.touches[0].target===e.getEventHolder()&&t.touches[1].target===e.getEventHolder())}(!0===t.pan.enableTouch||t.zoom.enableTouch)&&(e.hooks.bindEvents.push(function(e,t){n=t,t.addEventListener("touchstart",o,!1),t.addEventListener("touchmove",o,!1),t.addEventListener("touchend",o,!1)}),e.hooks.shutdown.push(function(e,t){t.removeEventListener("touchstart",o),t.removeEventListener("touchmove",o),t.removeEventListener("touchend",o),i.longTapTriggerId&&(clearTimeout(i.longTapTriggerId),i.longTapTriggerId=null)}))}L.push({init:function(e){var n,i=[];function o(t){var n=e.getOptions(),i=new CustomEvent("mouseevent");return i.pageX=t.detail.changedTouches[0].pageX,i.pageY=t.detail.changedTouches[0].pageY,i.clientX=t.detail.changedTouches[0].clientX,i.clientY=t.detail.changedTouches[0].clientY,n.grid.hoverable&&a(i,be,30),!1}function a(t,n,i){var o=e.getData();if(void 0!==t&&o.length>0&&void 0!==o[0].xaxis.c2p&&void 0!==o[0].yaxis.c2p){var a=n+"able";u("plot"+n,t,function(e){return!1!==o[e][a]},i)}}function r(t){n=t,e.getPlaceholder().lastMouseMoveEvent=t,a(t,be)}function s(t){n=void 0,e.getPlaceholder().lastMouseMoveEvent=void 0,u("plothover",t,function(e){return!1})}function l(e){a(e,"click")}function c(){e.unhighlight(),h(e.getPlaceholder(),"plothovercleanup")}function u(n,o,a,r){var s=e.getOptions(),l=e.offset(),c=t.getPageXY(o),u=c.X-l.left,f=c.Y-l.top,d=e.c2p({left:u,top:f}),g=void 0!==r?r:s.grid.mouseActiveRadius;d.pageX=c.X,d.pageY=c.Y;var v=e.findNearbyItems(u,f,a,g),x=v[0];for(let e=1;e<v.length;++e)(void 0===x.distance||v[e].distance<x.distance)&&(x=v[e]);if(x?(x.pageX=parseInt(x.series.xaxis.p2c(x.datapoint[0])+l.left,10),x.pageY=parseInt(x.series.yaxis.p2c(x.datapoint[1])+l.top,10)):x=null,s.grid.autoHighlight){for(let e=0;e<i.length;++e){var b=i[e];(b.auto!==n||x&&b.series===x.series&&b.point[0]===x.datapoint[0]&&b.point[1]===x.datapoint[1])&&x||m(b.series,b.point)}x&&p(x.series,x.datapoint,n)}h(e.getPlaceholder(),n,[d,x,v])}function p(t,n,o){if("number"==typeof t&&(t=e.getData()[t]),"number"==typeof n){var a=t.datapoints.pointsize;n=t.datapoints.points.slice(a*n,a*(n+1))}var r=g(t,n);-1===r?(i.push({series:t,point:n,auto:o}),e.triggerRedrawOverlay()):o||(i[r].auto=!1)}function m(t,n){if(null==t&&null==n)return i=[],void e.triggerRedrawOverlay();if("number"==typeof t&&(t=e.getData()[t]),"number"==typeof n){var o=t.datapoints.pointsize;n=t.datapoints.points.slice(o*n,o*(n+1))}var a=g(t,n);-1!==a&&(i.splice(a,1),e.triggerRedrawOverlay())}function g(e,t){for(var n=0;n<i.length;++n){var o=i[n];if(o.series===e&&o.point[0]===t[0]&&o.point[1]===t[1])return n}return-1}function v(){c(),a(n,be)}function b(){a(n,be)}function y(e,t,n){var o,a,r=e.getPlotOffset();for(t.save(),t.translate(r.left,r.top),o=0;o<i.length;++o)(a=i[o]).series.bars.show?k(a.series,a.point,t):w(a.series,a.point,t,e);t.restore()}function w(e,t,n,i){var o=t[0],a=t[1],r=e.xaxis,s=e.yaxis,l="string"==typeof e.highlightColor?e.highlightColor:x.parse(e.color).scale("a",.5).toString();if(!(o<r.min||o>r.max||a<s.min||a>s.max)){var c=e.points.radius+e.points.lineWidth/2;n.lineWidth=c,n.strokeStyle=l;var u=1.5*c;o=r.p2c(o),a=s.p2c(a),n.beginPath();var h=e.points.symbol;"circle"===h?n.arc(o,a,u,0,2*Math.PI,!1):"string"==typeof h&&i.drawSymbol&&i.drawSymbol[h]&&i.drawSymbol[h](n,o,a,u,!1),n.closePath(),n.stroke()}}function k(e,t,n){var i,o="string"==typeof e.highlightColor?e.highlightColor:x.parse(e.color).scale("a",.5).toString(),a=o,r=e.bars.barWidth[0]||e.bars.barWidth;switch(e.bars.align){case"left":i=0;break;case"right":i=-r;break;default:i=-r/2}n.lineWidth=e.bars.lineWidth,n.strokeStyle=o;var s=e.bars.fillTowards||0,l=s>e.yaxis.min?Math.min(e.yaxis.max,s):e.yaxis.min;T.drawBar(t[0],t[1],t[2]||l,i,i+r,function(){return a},e.xaxis,e.yaxis,n,e.bars.horizontal,e.bars.lineWidth)}e.hooks.bindEvents.push(function(e,t){var n=e.getOptions();(n.grid.hoverable||n.grid.clickable)&&(t.addEventListener("touchevent",c,!1),t.addEventListener("tap",o,!1)),n.grid.clickable&&f(t,"click",l),n.grid.hoverable&&(f(t,"mousemove",r),f(t,"mouseleave",s))}),e.hooks.shutdown.push(function(e,t){t.removeEventListener("tap",o),t.removeEventListener("touchevent",c),d(t,"mousemove",r),d(t,"mouseleave",s),d(t,"click",l),i=[]}),e.hooks.processOptions.push(function(e,t){e.highlight=p,e.unhighlight=m,(t.grid.hoverable||t.grid.clickable)&&(e.hooks.drawOverlay.push(y),e.hooks.processDatapoints.push(v),e.hooks.setupGrid.push(b)),n=e.getPlaceholder().lastMouseMoveEvent})},options:{grid:{hoverable:!1,clickable:!1}},name:"hover",version:"0.1"}),L.push({init:function(e){e.hooks.processOptions.push(ye)},options:{propagateSupportedGesture:!1},name:"navigateTouch",version:"0.3"});var we=y.floorInBase,Te=function(e,t){var n=new e(t),i=n.setTime.bind(n);n.update=function(e){e=Math.round(1e3*e)/1e3,i(e),this.microseconds=1e3*(e-Math.floor(e))};var o=n.getTime.bind(n);return n.getTime=function(){return o()+this.microseconds/1e3},n.setTime=function(e){this.update(e)},n.getMicroseconds=function(){return this.microseconds},n.setMicroseconds=function(e){var t=o()+e/1e3;this.update(t)},n.setUTCMicroseconds=function(e){this.setMicroseconds(e)},n.getUTCMicroseconds=function(){return this.getMicroseconds()},n.microseconds=null,n.microEpoch=null,n.update(t),n};function ke(e,t,n,i){if("function"==typeof e.strftime)return e.strftime(t);var o,a=function(e,t){return t=""+(null==t?"0":t),1===(e=""+e).length?t+e:e},r=function(e,t,n){var i,o=1e3*e+t;if(n<6&&n>0){var a=parseFloat("1e"+(n-6));i=("00000"+(o=Math.round(Math.round(o*a)/a))).slice(-6,-(6-n))}else i=("00000"+(o=Math.round(o))).slice(-6);return i},s=[],l=!1,c=e.getHours(),u=c<12;n||(n=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]),i||(i=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]),o=c>12?c-12:0===c?12:c;for(var h=-1,p=0;p<t.length;++p){var f=t.charAt(p);if(!isNaN(Number(f))&&Number(f)>0)h=Number(f);else if(l){switch(f){case"a":f=""+i[e.getDay()];break;case"b":f=""+n[e.getMonth()];break;case"d":f=a(e.getDate());break;case"e":f=a(e.getDate()," ");break;case"h":case"H":f=a(c);break;case"I":f=a(o);break;case"l":f=a(o," ");break;case"m":f=a(e.getMonth()+1);break;case"M":f=a(e.getMinutes());break;case"q":f=""+(Math.floor(e.getMonth()/3)+1);break;case"S":f=a(e.getSeconds());break;case"s":f=""+r(e.getMilliseconds(),e.getMicroseconds(),h);break;case"y":f=a(e.getFullYear()%100);break;case"Y":f=""+e.getFullYear();break;case"p":f=u?"am":"pm";break;case"P":f=u?"AM":"PM";break;case"w":f=""+e.getDay()}s.push(f),l=!1}else"%"===f?l=!0:s.push(f)}return s.join("")}function Me(e){function t(e,t,n,i){e[t]=function(){return n[i].apply(n,arguments)}}var n={date:e};void 0!==e.strftime&&t(n,"strftime",e,"strftime"),t(n,"getTime",e,"getTime"),t(n,"setTime",e,"setTime");for(var i=["Date","Day","FullYear","Hours","Minutes","Month","Seconds","Milliseconds","Microseconds"],o=0;o<i.length;o++)t(n,"get"+i[o],e,"getUTC"+i[o]),t(n,"set"+i[o],e,"setUTC"+i[o]);return n}function Se(e,t){var n=864e13;if(t&&"seconds"===t.timeBase?e*=1e3:"microseconds"===t.timeBase&&(e/=1e3),e>n?e=n:e<-n&&(e=-n),"browser"===t.timezone)return Te(Date,e);if(t.timezone&&"utc"!==t.timezone){if("undefined"!=typeof timezoneJS&&void 0!==timezoneJS.Date){var i=Te(timezoneJS.Date,e);return i.setTimezone(t.timezone),i.setTime(e),i}return Me(Te(Date,e))}return Me(Te(Date,e))}var Ce={microsecond:1e-6,millisecond:.001,second:1,minute:60,hour:3600,day:86400,month:2592e3,quarter:7776e3,year:525949.2*60},Pe={microsecond:.001,millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,month:2592e6,quarter:7776e6,year:525949.2*60*1e3},Le={microsecond:1,millisecond:1e3,second:1e6,minute:6e7,hour:36e8,day:864e8,month:2592e9,quarter:7776e9,year:31556951999999.996},Ne=[[1,"microsecond"],[2,"microsecond"],[5,"microsecond"],[10,"microsecond"],[25,"microsecond"],[50,"microsecond"],[100,"microsecond"],[250,"microsecond"],[500,"microsecond"],[1,"millisecond"],[2,"millisecond"],[5,"millisecond"],[10,"millisecond"],[25,"millisecond"],[50,"millisecond"],[100,"millisecond"],[250,"millisecond"],[500,"millisecond"],[1,"second"],[2,"second"],[5,"second"],[10,"second"],[30,"second"],[1,"minute"],[2,"minute"],[5,"minute"],[10,"minute"],[30,"minute"],[1,"hour"],[2,"hour"],[4,"hour"],[8,"hour"],[12,"hour"],[1,"day"],[2,"day"],[3,"day"],[.25,"month"],[.5,"month"],[1,"month"],[2,"month"]],Ee=Ne.concat([[3,"month"],[6,"month"],[1,"year"]]),ze=Ne.concat([[1,"quarter"],[2,"quarter"],[1,"year"]]);function Ae(e){var t,n=e.options,i=[],o=Se(e.min,n),a=0,r=n.tickSize&&"quarter"===n.tickSize[1]||n.minTickSize&&"quarter"===n.minTickSize[1]?ze:Ee;t="seconds"===n.timeBase?Ce:"microseconds"===n.timeBase?Le:Pe,null!==n.minTickSize&&void 0!==n.minTickSize&&(a="number"==typeof n.tickSize?n.tickSize:n.minTickSize[0]*t[n.minTickSize[1]]);for(var s=0;s<r.length-1&&!(e.delta<(Number(r[s][0])*t[r[s][1]]+Number(r[s+1][0])*t[r[s+1][1]])/2&&Number(r[s][0])*t[r[s][1]]>=a);++s);var l=r[s][0],c=r[s][1];if("year"===c){if(null!==n.minTickSize&&void 0!==n.minTickSize&&"year"===n.minTickSize[1])l=Math.floor(n.minTickSize[0]);else{var u=parseFloat("1e"+Math.floor(Math.log(e.delta/t.year)/Math.LN10)),h=e.delta/t.year/u;l=h<1.5?1:h<3?2:h<7.5?5:10,l*=u}l<1&&(l=1)}e.tickSize=n.tickSize||[l,c];var p=e.tickSize[0],f=p*t[c=e.tickSize[1]];"microsecond"===c?o.setMicroseconds(we(o.getMicroseconds(),p)):"millisecond"===c?o.setMilliseconds(we(o.getMilliseconds(),p)):"second"===c?o.setSeconds(we(o.getSeconds(),p)):"minute"===c?o.setMinutes(we(o.getMinutes(),p)):"hour"===c?o.setHours(we(o.getHours(),p)):"month"===c?o.setMonth(we(o.getMonth(),p)):"quarter"===c?o.setMonth(3*we(o.getMonth()/3,p)):"year"===c&&o.setFullYear(we(o.getFullYear(),p)),f>=t.millisecond&&o.setMicroseconds(0),f>=t.second&&o.setMilliseconds(0),f>=t.minute&&o.setSeconds(0),f>=t.hour&&o.setMinutes(0),f>=t.day&&o.setHours(0),f>=4*t.day&&o.setDate(1),f>=2*t.month&&o.setMonth(we(o.getMonth(),3)),f>=2*t.quarter&&o.setMonth(we(o.getMonth(),6)),f>=t.year&&o.setMonth(0);var d,m,g=0,v=Number.NaN;do{if(m=v,d=o.getTime(),v=n&&"seconds"===n.timeBase?d/1e3:n&&"microseconds"===n.timeBase?1e3*d:d,i.push(v),"month"===c||"quarter"===c)if(p<1){o.setDate(1);var x=o.getTime();o.setMonth(o.getMonth()+("quarter"===c?3:1));var b=o.getTime();o.setTime(v+g*t.hour+(b-x)*p),g=o.getHours(),o.setHours(0)}else o.setMonth(o.getMonth()+p*("quarter"===c?3:1));else"year"===c?o.setFullYear(o.getFullYear()+p):"seconds"===n.timeBase?o.setTime(1e3*(v+f)):"microseconds"===n.timeBase?o.setTime((v+f)/1e3):o.setTime(v+f)}while(v<e.max&&v!==m);return i}function Oe(e,t,n,i,o,a){this.axisName=e,this.position=t,this.padding=n,this.placeholder=i,this.axisLabel=o,this.surface=a,this.width=0,this.height=0,this.elem=null}L.push({init:function(e){e.hooks.processOptions.push(function(e){var t=e.getAxes();Object.keys(t).forEach(function(e){var n=t[e],i=n.options;if("time"===i.mode){if(n.tickGenerator=Ae,"tickFormatter"in i&&"function"==typeof i.tickFormatter)return;n.tickFormatter=function(e,t){var n=Se(e,t.options);if(null!=i.timeformat)return ke(n,i.timeformat,i.monthNames,i.dayNames);var o,a=t.options.tickSize&&"quarter"===t.options.tickSize[1]||t.options.minTickSize&&"quarter"===t.options.minTickSize[1];o="seconds"===i.timeBase?Ce:"microseconds"===i.timeBase?Le:Pe;var r,s,l=t.tickSize[0]*o[t.tickSize[1]],c=t.max-t.min,u=i.twelveHourClock?" %p":"",h=i.twelveHourClock?"%I":"%H";if(r="seconds"===i.timeBase?1:"microseconds"===i.timeBase?1e6:1e3,l<o.second){var p=-Math.floor(Math.log10(l/r));String(l).indexOf("25")>-1&&p++,s="%S.%"+p+"s"}else s=l<o.minute?h+":%M:%S"+u:l<o.day?c<2*o.day?h+":%M"+u:"%b %d "+h+":%M"+u:l<o.month?"%b %d":a&&l<o.quarter||!a&&l<o.year?c<o.year?"%b":"%b %Y":a&&l<o.year?c<o.year?"Q%q":"Q%q %Y":"%Y";return ke(n,s,i.monthNames,i.dayNames)}}})})},options:{xaxis:{timezone:null,timeformat:null,twelveHourClock:!1,monthNames:null,timeBase:"seconds"},yaxis:{timeBase:"seconds"}},name:"time",version:"1.0"}),Oe.prototype.calculateSize=function(){var e=this.axisName+"Label",t=e+"Layer",n=e+" axisLabels",i=this.surface.getTextInfo(t,this.axisLabel,n);this.labelWidth=i.width,this.labelHeight=i.height,"left"===this.position||"right"===this.position?(this.width=this.labelHeight+this.padding,this.height=0):(this.width=0,this.height=this.labelHeight+this.padding)},Oe.prototype.transforms=function(e,t,n,i){var o,a,r=[];if(0===t&&0===n||((o=i.createSVGTransform()).setTranslate(t,n),r.push(o)),0!==e){a=i.createSVGTransform();var s=Math.round(this.labelWidth/2);a.setRotate(e,s,0),r.push(a)}return r},Oe.prototype.calculateOffsets=function(e){var t={x:0,y:0,degrees:0};return"bottom"===this.position?(t.x=e.left+e.width/2-this.labelWidth/2,t.y=e.top+e.height-this.labelHeight):"top"===this.position?(t.x=e.left+e.width/2-this.labelWidth/2,t.y=e.top):"left"===this.position?(t.degrees=-90,t.x=e.left-this.labelWidth/2,t.y=e.height/2+e.top):"right"===this.position&&(t.degrees=90,t.x=e.left+e.width-this.labelWidth/2,t.y=e.height/2+e.top),t.x=Math.round(t.x),t.y=Math.round(t.y),t},Oe.prototype.cleanup=function(){var e=this.axisName+"Label",t=e+"Layer",n=e+" axisLabels";this.surface.removeText(t,0,0,this.axisLabel,n)},Oe.prototype.draw=function(e){var t=this.axisName+"Label",n=t+"Layer",i=t+" axisLabels",o=this.calculateOffsets(e),a={position:"absolute",bottom:"",right:"",display:"inline-block","white-space":"nowrap"},r=this.surface.getSVGLayer(n),s=this.transforms(o.degrees,o.x,o.y,r.parentNode);this.surface.addText(n,0,0,this.axisLabel,i,void 0,void 0,void 0,void 0,s),this.surface.render(),Object.keys(a).forEach(function(e){r.style[e]=a[e]})},L.push({init:function(e){e.hooks.processOptions.push(function(e,t){if(t.axisLabels.show){var n={};e.hooks.axisReserveSpace.push(function(e,t){var i=t.options,o=t.direction+t.n;if(t.labelHeight+=t.boxPosition.centerY,t.labelWidth+=t.boxPosition.centerX,i&&i.axisLabel&&t.show){var a=void 0===i.axisLabelPadding?2:i.axisLabelPadding,r=n[o];r||(r=new Oe(o,i.position,a,e.getPlaceholder(),i.axisLabel,e.getSurface()),n[o]=r),r.calculateSize(),t.labelHeight+=r.height,t.labelWidth+=r.width}}),e.hooks.draw.push(function(e,t){var i=e.getAxes();Object.keys(i).forEach(function(e){var t=i[e],o=t.options;if(o&&o.axisLabel&&t.show){var a=t.direction+t.n;n[a].draw(t.box)}})}),e.hooks.shutdown.push(function(e,t){for(var i in n)n[i].cleanup()})}})},options:{axisLabels:{show:!0}},name:"axisLabels",version:"3.0"}),L.push({init:function(e){var t={first:{x:-1,y:-1},second:{x:-1,y:-1},show:!1,currentMode:"xy",active:!1},n=w.SNAPPING_CONSTANT,i={};function o(){if(!f())return null;if(!t.show)return null;var n={},i={x:t.first.x,y:t.first.y},o={x:t.second.x,y:t.second.y};"x"===s(e)&&(i.y=0,o.y=e.height()),"y"===s(e)&&(i.x=0,o.x=e.width());var a=e.getAxes();return Object.keys(a).forEach(function(e){var t=a[e];if(t.used){var r=t.c2p(i[t.direction]),s=t.c2p(o[t.direction]);n[e]={from:Math.min(r,s),to:Math.max(r,s)}}}),n}function a(){var t=o();h(e.getPlaceholder(),"plotselected",[t]),t.xaxis&&t.yaxis&&h(e.getPlaceholder(),"selected",[{x1:t.xaxis.from,y1:t.yaxis.from,x2:t.xaxis.to,y2:t.yaxis.to}])}function r(e,t,n){return t<e?e:t>n?n:t}function s(e){var n=e.getOptions();return"smart"===n.selection.mode?t.currentMode:n.selection.mode}function l(i,o){var a=e.getPlaceholder().getBoundingClientRect(),l=a.left+window.scrollX,c=a.top+window.scrollY,u=e.getPlotOffset();i.x=r(0,o.pageX-l-u.left,e.width()),i.y=r(0,o.pageY-c-u.top,e.height()),i!==t.first&&function(e){if(t.first){var i={x:e.x-t.first.x,y:e.y-t.first.y};Math.abs(i.x)<n?t.currentMode="y":Math.abs(i.y)<n?t.currentMode="x":t.currentMode="xy"}}(i),"y"===s(e)&&(i.x=i===t.first?0:e.width()),"x"===s(e)&&(i.y=i===t.first?0:e.height())}function c(n){null!=n.pageX&&(l(t.second,n),f()?(t.show=!0,e.triggerRedrawOverlay()):u(!0))}function u(n){t.show&&(t.show=!1,t.currentMode="",e.triggerRedrawOverlay(),n||h(e.getPlaceholder(),"plotunselected",[]))}function p(t,n){var i,o,a,r,s=e.getAxes();for(var l in s)if((i=s[l]).direction===n&&(t[r=n+i.n+"axis"]||1!==i.n||(r=n+"axis"),t[r])){o=t[r].from,a=t[r].to;break}if(r&&!t[r]&&(i="x"===n?e.getXAxes()[0]:e.getYAxes()[0],o=t[n+"1"],a=t[n+"2"]),null!=o&&null!=a&&o>a){var c=o;o=a,a=c}return{from:o,to:a,axis:i}}function f(){var n=e.getOptions().selection.minSize;return Math.abs(t.second.x-t.first.x)>=n&&Math.abs(t.second.y-t.first.y)>=n}function m(n){if(0===n.button){var r=n.currentTarget;!function(n){var o=e.getOptions();0===n.button&&null!==o.selection.mode&&(t.currentMode="xy",document.body.focus(),void 0!==document.onselectstart&&null==i.onselectstart&&(i.onselectstart=document.onselectstart,document.onselectstart=function(){return!1}),void 0!==document.ondrag&&null==i.ondrag&&(i.ondrag=document.ondrag,document.ondrag=function(){return!1}),l(t.first,n),t.active=!0)}(n),r.setPointerCapture(n.pointerId),r.addEventListener("pointermove",s),r.addEventListener("pointerup",u),r.addEventListener("pointercancel",u)}function s(n){!function(n){t.active&&(c(n),h(e.getPlaceholder(),"plotselecting",[o()]))}(n)}function u(n){!function(n){void 0!==document.onselectstart&&(document.onselectstart=i.onselectstart),void 0!==document.ondrag&&(document.ondrag=i.ondrag),t.active=!1,c(n),f()?a():(h(e.getPlaceholder(),"plotunselected",[]),h(e.getPlaceholder(),"plotselecting",[null]))}(n),r.removeEventListener("pointermove",s),r.removeEventListener("pointerup",u),r.removeEventListener("pointercancel",u),r.releasePointerCapture(n.pointerId)}}e.clearSelection=u,e.setSelection=function(n,i){var o;"y"===s(e)?(t.first.x=0,t.second.x=e.width()):(o=p(n,"x"),t.first.x=o.axis.p2c(o.from),t.second.x=o.axis.p2c(o.to)),"x"===s(e)?(t.first.y=0,t.second.y=e.height()):(o=p(n,"y"),t.first.y=o.axis.p2c(o.from),t.second.y=o.axis.p2c(o.to)),t.show=!0,e.triggerRedrawOverlay(),!i&&f()&&a()},e.getSelection=o,e.hooks.bindEvents.push(function(e,t){null!=e.getOptions().selection.mode&&e.addEventHandler("pointerdown",m,t,0)}),e.hooks.drawOverlay.push(function(e,n){if(t.show&&f()){var i=e.getPlotOffset(),o=e.getOptions();n.save(),n.translate(i.left,i.top);var a=x.parse(o.selection.color),r=o.selection.visualization,l=o.selection.displaySelectionDecorations,c=1;"fill"===r&&(c=.8),n.strokeStyle=a.scale("a",c).toString(),n.lineWidth=1,n.lineJoin=o.selection.shape,n.fillStyle=a.scale("a",.4).toString();var u=Math.min(t.first.x,t.second.x)+.5,h=u,p=Math.min(t.first.y,t.second.y)+.5,d=p,m=Math.abs(t.second.x-t.first.x)-1,g=Math.abs(t.second.y-t.first.y)-1;"x"===s(e)&&(g+=p,p=0),"y"===s(e)&&(m+=u,u=0),"fill"===r?(n.fillRect(u,p,m,g),n.strokeRect(u,p,m,g)):(n.fillRect(0,0,e.width(),e.height()),n.clearRect(u,p,m,g),l&&function(e,t,n,i,o,a,r,s){var l=15,c=Math.max(0,Math.min(l,i/2-2,o/2-2));e.fillStyle="#ffffff","xy"===s&&(e.beginPath(),e.moveTo(t,n+c),e.lineTo(t-3,n+c),e.lineTo(t-3,n-3),e.lineTo(t+c,n-3),e.lineTo(t+c,n),e.lineTo(t,n),e.closePath(),e.moveTo(t,n+o-c),e.lineTo(t-3,n+o-c),e.lineTo(t-3,n+o+3),e.lineTo(t+c,n+o+3),e.lineTo(t+c,n+o),e.lineTo(t,n+o),e.closePath(),e.moveTo(t+i,n+c),e.lineTo(t+i+3,n+c),e.lineTo(t+i+3,n-3),e.lineTo(t+i-c,n-3),e.lineTo(t+i-c,n),e.lineTo(t+i,n),e.closePath(),e.moveTo(t+i,n+o-c),e.lineTo(t+i+3,n+o-c),e.lineTo(t+i+3,n+o+3),e.lineTo(t+i-c,n+o+3),e.lineTo(t+i-c,n+o),e.lineTo(t+i,n+o),e.closePath(),e.stroke(),e.fill()),t=a,n=r,"x"===s&&(e.beginPath(),e.moveTo(t,n+l),e.lineTo(t,n-l),e.lineTo(t-3,n-l),e.lineTo(t-3,n+l),e.closePath(),e.moveTo(t+i,n+l),e.lineTo(t+i,n-l),e.lineTo(t+i+3,n-l),e.lineTo(t+i+3,n+l),e.closePath(),e.stroke(),e.fill()),"y"===s&&(e.beginPath(),e.moveTo(t-l,n),e.lineTo(t+l,n),e.lineTo(t+l,n-3),e.lineTo(t-l,n-3),e.closePath(),e.moveTo(t-l,n+o),e.lineTo(t+l,n+o),e.lineTo(t+l,n+o+3),e.lineTo(t-l,n+o+3),e.closePath(),e.stroke(),e.fill())}(n,u,p,m,g,h,d,s(e))),n.restore()}}),e.hooks.shutdown.push(function(e,t){d(t,"pointerdown",m)})},options:{selection:{mode:null,visualization:"focus",displaySelectionDecorations:!0,color:"#888888",shape:"round",minSize:5}},name:"selection",version:"1.1"});var Ie=1,Re=t.getPixelRatio;function We(e,n){var i=e.filter(De);Ie=Re(n.getContext("2d"));var o=i.map(function(e){var n=new Image,i=new Promise(function(e,n){return e.sourceDescription='<info className="'+n.className+'" tagName="'+n.tagName+'" id="'+n.id+'">',e.sourceComponent=n,function(i,o){var a,r,s,l,c;e.onload=function(t){e.successfullyLoaded=!0,i(e)},e.onabort=function(t){e.successfullyLoaded=!1,console.log("Can't generate temp image from "+e.sourceDescription+". It is possible that it is missing some properties or its content is not supported by this browser. Source component:",e.sourceComponent),i(e)},e.onerror=function(t){e.successfullyLoaded=!1,console.log("Can't generate temp image from "+e.sourceDescription+". It is possible that it is missing some properties or its content is not supported by this browser. Source component:",e.sourceComponent),i(e)},r=e,"CANVAS"===(a=n).tagName&&(s=a,r.src=s.toDataURL("image/png")),"svg"===a.tagName&&(l=a,c=r,t.isSafari()||t.isMobileSafari()?function(e,t){var n,i,o=Fe(Ye(document),e);o=Xe(o),i=function(e){var t="";const n=new Uint8Array(e);for(var i=0;i<n.length;i+=16384)t+=String.fromCharCode.apply(null,n.subarray(i,i+16384));return t}((new(TextEncoder||TextEncoderLite)).encode(o)),n="data:image/svg+xml;base64,"+btoa(i),t.src=n}(l,c):function(e,t){var n=Fe(Ye(document),e);n=Xe(n);var i=new Blob([n],{type:"image/svg+xml;charset=utf-8"}),o=(self.URL||self.webkitURL||self).createObjectURL(i);t.src=o}(l,c)),r.srcImgTagName=a.tagName,function(e,t){t.genLeft=e.getBoundingClientRect().left,t.genTop=e.getBoundingClientRect().top,"CANVAS"===e.tagName&&(t.genRight=t.genLeft+e.width,t.genBottom=t.genTop+e.height),"svg"===e.tagName&&(t.genRight=e.getBoundingClientRect().right,t.genBottom=e.getBoundingClientRect().bottom)}(a,r)}}(n,e));return i}),a=Promise.all(o).then(function(e){return function(t){var n=function(e,t){var n=function(e,t){var n=0;if(0===e.length)n=-1;else{var i=e[0].genLeft,o=e[0].genTop,a=e[0].genRight,r=e[0].genBottom,s=0;for(s=1;s<e.length;s++)i>e[s].genLeft&&(i=e[s].genLeft),o>e[s].genTop&&(o=e[s].genTop);for(s=1;s<e.length;s++)a<e[s].genRight&&(a=e[s].genRight),r<e[s].genBottom&&(r=e[s].genBottom);if(a-i<=0||r-o<=0)n=-2;else{for(t.width=Math.round(a-i),t.height=Math.round(r-o),s=0;s<e.length;s++)e[s].xCompOffset=e[s].genLeft-i,e[s].yCompOffset=e[s].genTop-o;!function(e,t){void 0!==t.find(function(e){return"svg"===e.srcImgTagName})&&Ie<1&&(e.width=e.width*Ie,e.height=e.height*Ie)}(t,e)}}return n}(e,t);if(0===n)for(var i=t.getContext("2d"),o=0;o<e.length;o++)!0===e[o].successfullyLoaded&&i.drawImage(e[o],e[o].xCompOffset*Ie,e[o].yCompOffset*Ie);return n}(t,e);return n}}(n),Be);return a}function De(e){var t=!0,n=!0;return null==e?n=!1:"CANVAS"===e.tagName&&(e.getBoundingClientRect().right!==e.getBoundingClientRect().left&&e.getBoundingClientRect().bottom!==e.getBoundingClientRect().top||(t=!1)),n&&t&&"visible"===window.getComputedStyle(e).visibility}function Ye(e){for(var t=e.styleSheets,n=[],i=0;i<t.length;i++)try{for(var o=t[i].cssRules||[],a=0;a<o.length;a++){var r=o[a];n.push(r.cssText)}}catch(e){console.log("Failed to get some css rules")}return n}function Fe(e,t){return['<svg class="snapshot '+t.classList+'" width="'+t.width.baseVal.value*Ie+'" height="'+t.height.baseVal.value*Ie+'" viewBox="0 0 '+t.width.baseVal.value+" "+t.height.baseVal.value+'" xmlns="http://www.w3.org/2000/svg">',"<style>","/* <![CDATA[ */",e.join("\n"),"/* ]]> */","</style>",t.innerHTML,"</svg>"].join("\n")}function Xe(e){var t="";return e.match(/^<svg[^>]+xmlns="http:\/\/www\.w3\.org\/2000\/svg"/)||(t=e.replace(/^<svg/,'<svg xmlns="http://www.w3.org/2000/svg"')),e.match(/^<svg[^>]+"http:\/\/www\.w3\.org\/1999\/xlink"/)||(t=e.replace(/^<svg/,'<svg xmlns:xlink="http://www.w3.org/1999/xlink"')),'<?xml version="1.0" standalone="no"?>\r\n'+t}function Be(){return-100}function Ge(e){var t="",n=e.name,i=e.xPos,o=e.yPos,a=e.fillColor,r=e.strokeColor,s=e.strokeWidth;switch(n){case"circle":default:t='<use xlink:href="#circle" class="legendIcon" x="'+i+'" y="'+o+'" fill="'+a+'" stroke="'+r+'" stroke-width="'+s+'" width="1.5em" height="1.5em"/>';break;case"diamond":t='<use xlink:href="#diamond" class="legendIcon" x="'+i+'" y="'+o+'" fill="'+a+'" stroke="'+r+'" stroke-width="'+s+'" width="1.5em" height="1.5em"/>';break;case"cross":t='<use xlink:href="#cross" class="legendIcon" x="'+i+'" y="'+o+'" stroke="'+r+'" stroke-width="'+s+'" width="1.5em" height="1.5em"/>';break;case"rectangle":t='<use xlink:href="#rectangle" class="legendIcon" x="'+i+'" y="'+o+'" fill="'+a+'" stroke="'+r+'" stroke-width="'+s+'" width="1.5em" height="1.5em"/>';break;case"plus":t='<use xlink:href="#plus" class="legendIcon" x="'+i+'" y="'+o+'" stroke="'+r+'" stroke-width="'+s+'" width="1.5em" height="1.5em"/>';break;case"bar":t='<use xlink:href="#bars" class="legendIcon" x="'+i+'" y="'+o+'" fill="'+a+'" width="1.5em" height="1.5em"/>';break;case"area":t='<use xlink:href="#area" class="legendIcon" x="'+i+'" y="'+o+'" fill="'+a+'" width="1.5em" height="1.5em"/>';break;case"line":t='<use xlink:href="#line" class="legendIcon" x="'+i+'" y="'+o+'" stroke="'+r+'" stroke-width="'+s+'" width="1.5em" height="1.5em"/>';break;case"box":t='<use xlink:href="#box" class="legendIcon" x="'+i+'" y="'+o+'" fill="'+a+'" width="1.5em" height="1.5em"/>'}return t}L.push({init:function(e){e.composeImages=We},name:"composeImages",version:"1.0"});function He(e,t){for(var n in e)if(e.hasOwnProperty(n)&&e[n]!==t[n])return!0;return!1}L.push({init:function(e){e.hooks.setupGrid.push(function(e){var t=e.getOptions(),n=e.getData(),i=t.legend.labelFormatter,o=t.legend.legendEntries,a=t.legend.plotOffset,r=function(e,t,n){var i=t,o=e.reduce(function(e,t,n){var o=i?i(t.label,t):t.label;if(!t.hasOwnProperty("label")||o){var a={label:o||"Plot "+(n+1),color:t.color,options:{lines:t.lines,points:t.points,bars:t.bars}};e.push(a)}return e},[]);if(n)if("function"==typeof n)o.sort(n);else if("reverse"===n)o.reverse();else{var a="descending"!==n;o.sort(function(e,t){return e.label===t.label?0:e.label<t.label!==a?1:-1})}return o}(n,i,t.legend.sorted),s=e.getPlotOffset();(function(e,t){if(!e||!t)return!0;if(e.length!==t.length)return!0;var n,i,o;for(n=0;n<t.length;n++){if(i=t[n],o=e[n],i.label!==o.label)return!0;if(i.color!==o.color)return!0;if(He(i.options.lines,o.options.lines))return!0;if(He(i.options.points,o.options.points))return!0;if(He(i.options.bars,o.options.bars))return!0}return!1}(o,r)||He(a,s))&&function(e,t,n,i){if(null!=t.legend.container)t.legend.container.innerHTML="";else for(var o=n.querySelectorAll(".legend"),a=0;a<o.length;a++)o[a].remove();if(t.legend.show){var r,s,l,c,u=t.legend.legendEntries=i,h=t.legend.plotOffset=e.getPlotOffset(),p=[],f=0,d="",m=t.legend.position,g=t.legend.margin,v={name:"",label:"",xPos:"",yPos:""};p[f++]='<svg class="legendLayer" style="width:inherit;height:inherit;">',p[f++]='<rect class="background" width="100%" height="100%"/>',p[f++]='<defs><symbol id="line" fill="none" viewBox="-5 -5 25 25"><polyline points="0,15 5,5 10,10 15,0"/></symbol><symbol id="box" stroke-width="1" viewBox="-5 -5 25 25"><rect x="0" y="0" width="15" height="15"/></symbol><symbol id="area" stroke-width="1" viewBox="-5 -5 25 25"><polyline points="0,15 5,5 10,10 15,0, 15,15, 0,15"/></symbol><symbol id="bars" stroke-width="1" viewBox="-5 -5 25 25"><polyline points="1.5,15.5 1.5,12.5, 4.5,12.5 4.5,15.5 6.5,15.5 6.5,3.5, 9.5,3.5 9.5,15.5 11.5,15.5 11.5,7.5 14.5,7.5 14.5,15.5 1.5,15.5"/></symbol><symbol id="circle" viewBox="-5 -5 25 25"><circle cx="0" cy="15" r="2.5"/><circle cx="5" cy="5" r="2.5"/><circle cx="10" cy="10" r="2.5"/><circle cx="15" cy="0" r="2.5"/></symbol><symbol id="rectangle" viewBox="-5 -5 25 25"><rect x="-2.1" y="12.9" width="4.2" height="4.2"/><rect x="2.9" y="2.9" width="4.2" height="4.2"/><rect x="7.9" y="7.9" width="4.2" height="4.2"/><rect x="12.9" y="-2.1" width="4.2" height="4.2"/></symbol><symbol id="diamond" viewBox="-5 -5 25 25"><path d="M-3,15 L0,12 L3,15, L0,18 Z"/><path d="M2,5 L5,2 L8,5, L5,8 Z"/><path d="M7,10 L10,7 L13,10, L10,13 Z"/><path d="M12,0 L15,-3 L18,0, L15,3 Z"/></symbol><symbol id="cross" fill="none" viewBox="-5 -5 25 25"><path d="M-2.1,12.9 L2.1,17.1, M2.1,12.9 L-2.1,17.1 Z"/><path d="M2.9,2.9 L7.1,7.1 M7.1,2.9 L2.9,7.1 Z"/><path d="M7.9,7.9 L12.1,12.1 M12.1,7.9 L7.9,12.1 Z"/><path d="M12.9,-2.1 L17.1,2.1 M17.1,-2.1 L12.9,2.1 Z"/></symbol><symbol id="plus" fill="none" viewBox="-5 -5 25 25"><path d="M0,12 L0,18, M-3,15 L3,15 Z"/><path d="M5,2 L5,8 M2,5 L8,5 Z"/><path d="M10,7 L10,13 M7,10 L13,10 Z"/><path d="M15,-3 L15,3 M12,0 L18,0 Z"/></symbol></defs>';var x=0,b=[],y=window.getComputedStyle(document.body);for(c=0;c<u.length;++c){let n=c%t.legend.noColumns;r=u[c],v.label=r.label;var w=e.getSurface().getTextInfo("",v.label,{style:y.fontStyle,variant:y.fontVariant,weight:y.fontWeight,size:parseInt(y.fontSize),lineHeight:parseInt(y.lineHeight),family:y.fontFamily}).width;b[n]?w>b[n]&&(b[n]=w+48):b[n]=w+48}for(c=0;c<u.length;++c){let e=c%t.legend.noColumns;r=u[c],l="",v.label=r.label,v.xPos=x+3+"px",x+=b[e],(c+1)%t.legend.noColumns===0&&(x=0),v.yPos=1.5*Math.floor(c/t.legend.noColumns)+"em",r.options.lines.show&&r.options.lines.fill&&(v.name="area",v.fillColor=r.color,l+=Ge(v)),r.options.bars.show&&(v.name="bar",v.fillColor=r.color,l+=Ge(v)),r.options.lines.show&&!r.options.lines.fill&&(v.name="line",v.strokeColor=r.color,v.strokeWidth=r.options.lines.lineWidth,l+=Ge(v)),r.options.points.show&&(v.name=r.options.points.symbol,v.strokeColor=r.color,v.fillColor=r.options.points.fillColor,v.strokeWidth=r.options.points.lineWidth,l+=Ge(v)),""===l&&(v.name="box",v.fillColor=r.color,l+=Ge(v)),s='<text x="'+v.xPos+'" y="'+v.yPos+'" text-anchor="start"><tspan dx="2em" dy="1.2em">'+v.label+"</tspan></text>",p[f++]="<g>"+l+s+"</g>"}p[f++]="</svg>",null==g[0]&&(g=[g,g]),"n"===m.charAt(0)?d+="top:"+(g[1]+h.top)+"px;":"s"===m.charAt(0)&&(d+="bottom:"+(g[1]+h.bottom)+"px;"),"e"===m.charAt(1)?d+="right:"+(g[0]+h.right)+"px;":"w"===m.charAt(1)&&(d+="left:"+(g[0]+h.left)+"px;");var T=6;for(c=0;c<b.length;++c)T+=b[c];var k,M=1.6*Math.ceil(u.length/t.legend.noColumns);if(t.legend.container){var S=t.legend.container;S&&"function"==typeof S.get&&S[0]&&(S=S[0]),S.innerHTML=p.join(""),S.style.width=T+"px",S.style.height=M+"em"}else(k=document.createElement("div")).className="legend",k.style.cssText="position:absolute;"+d,k.innerHTML=p.join(""),k.style.width=T+"px",k.style.height=M+"em",k.style.pointerEvents="none",n.appendChild(k)}}(e,t,e.getPlaceholder(),r)})},options:{legend:{show:!1,noColumns:1,labelFormatter:null,container:null,position:"ne",margin:5,sorted:null}},name:"legend",version:"1.0"}),u=function(t,n,i){if(void 0===i||Array.isArray(i))e(t).trigger(n,i||[]);else{var o=e.Event(n,{detail:i});e(t).trigger(o)}},e.plot=function(t,n,i){return N("string"==typeof t?document.querySelector(t):t instanceof e?t[0]:t,n,i)},e.plot.plugins=L,e.plot.version="5.1.2",e.plot.saturated=y,e.plot.browser=t,e.plot.uiConstants=w,e.plot.drawSeries=T,e.plot.linearTickGenerator=E,e.plot.defaultTickFormatter=M,e.plot.expRepTickFormatter=S,e.plot.logTicksGenerator=J,e.plot.logTickFormatter=B,e.plot.formatDate=ke,e.plot.makeUtcWrapper=Me,e.plot.dateGenerator=Se,e.plot.dateTickGenerator=Ae,e.plot.composeImages=We;var je=x.extract;e.color=Object.create(x),e.color.extract=function(t,n){return t instanceof e&&t.length&&(t=t[0]),je(t,n)},e.fn.plot=function(e,t){return this.each(function(){N(this,e,t)})},"undefined"!=typeof window&&(window.Flot||(window.Flot={}),window.Flot.Canvas=m)}(jQuery);
2
2
  //# sourceMappingURL=jquery.flot.min.js.map