/*! @license https://github.com/danvk/dygraphs/blob/v2.1.2/LICENSE.txt (MIT) */ !function(t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Dygraph=t()}(function(){return function i(a,r,o){function s(e,t){if(!r[e]){if(!a[e]){var n="function"==typeof require&&require;if(!t&&n)return n(e,!0);if(l)return l(e,!0);throw(t=new Error("Cannot find module '"+e+"'")).code="MODULE_NOT_FOUND",t}n=r[e]={exports:{}},a[e][0].call(n.exports,function(t){return s(a[e][1][t]||t)},n,n.exports,i,a,r,o)}return r[e].exports}for(var l="function"==typeof require&&require,t=0;th[o][2]&&(o=n));var s=h[r],l=h[o];h.splice(t,h.length-t),r2*e.width_||D.default.FORCE_FAST_PROXY)&&(p=E._fastCanvasProxy(p)),[]);m.hasNext;)if(O=m.next(),T.isOK(O.y)||_){if(l){if(!A&&L==O.xval)continue;var P,A=!1,L=O.xval,C=void 0===(P=u[O.canvasx])?x:a?P[0]:P,M=[O.canvasy,C];_?-1===w[0]?u[O.canvasx]=[O.canvasy,x]:u[O.canvasx]=[O.canvasy,w[0]]:u[O.canvasx]=O.canvasy}else M=isNaN(O.canvasy)&&_?[r.y+r.h,x]:[O.canvasy,x];isNaN(b)?(p.moveTo(O.canvasx,M[1]),p.lineTo(O.canvasx,M[0])):(_&&p.lineTo(O.canvasx,w[0]),p.lineTo(O.canvasx,M[0]),l&&(S.push([b,w[1]]),a&&P?S.push([O.canvasx,P[1]]):S.push([O.canvasx,M[1]]))),w=M,b=O.canvasx}else d(p,b,w[1],S),S=[],b=NaN,null===O.y_stacked||isNaN(O.y_stacked)||(u[O.canvasx]=r.h*O.y_stacked+r.y);a=_,M&&O&&(d(p,O.canvasx,M[1],S),S=[]),p.fill()}}}},n.default=E,e.exports=n.default},{"./dygraph":17,"./dygraph-utils":16}],9:[function(t,e,n){"use strict";function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i=h(t("./dygraph-tickers")),a=s(t("./dygraph-interaction-model")),r=s(t("./dygraph-canvas")),t=h(t("./dygraph-utils"));function s(t){return t&&t.__esModule?t:{default:t}}function l(t){var e,n;return"function"!=typeof WeakMap?null:(e=new WeakMap,n=new WeakMap,(l=function(t){return t?n:e})(t))}function h(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!==o(t)&&"function"!=typeof t)return{default:t};e=l(e);if(e&&e.has(t))return e.get(t);var n,i,a={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&((i=r?Object.getOwnPropertyDescriptor(t,n):null)&&(i.get||i.set)?Object.defineProperty(a,n,i):a[n]=t[n]);return a.default=t,e&&e.set(t,a),a}a={highlightCircleSize:3,highlightSeriesOpts:null,highlightSeriesBackgroundAlpha:.5,highlightSeriesBackgroundColor:"rgb(255, 255, 255)",labelsSeparateLines:!1,labelsShowZeroValues:!0,labelsKMB:!1,labelsKMG2:!1,showLabelsOnHighlight:!0,digitsAfterDecimal:2,maxNumberWidth:6,sigFigs:null,strokeWidth:1,strokeBorderWidth:0,strokeBorderColor:"white",axisTickSize:3,axisLabelFontSize:14,rightGap:5,showRoller:!1,xValueParser:void 0,delimiter:",",sigma:2,errorBars:!1,fractions:!1,wilsonInterval:!0,customBars:!1,fillGraph:!1,fillAlpha:.15,connectSeparatedPoints:!1,stackedGraph:!1,stackedGraphNaNFill:"all",hideOverlayOnMouseOut:!0,legend:"onmouseover",stepPlot:!1,xRangePad:0,yRangePad:null,drawAxesAtZero:!1,titleHeight:28,xLabelHeight:18,yLabelWidth:18,axisLineColor:"black",axisLineWidth:.3,gridLineWidth:.3,axisLabelWidth:50,gridLineColor:"rgb(128,128,128)",interactionModel:a.default.defaultModel,animatedZooms:!1,animateBackgroundFade:!0,showRangeSelector:!1,rangeSelectorHeight:40,rangeSelectorPlotStrokeColor:"#808FAB",rangeSelectorPlotFillGradientColor:"white",rangeSelectorPlotFillColor:"#A7B1C4",rangeSelectorBackgroundStrokeColor:"gray",rangeSelectorBackgroundLineWidth:1,rangeSelectorPlotLineWidth:1.5,rangeSelectorForegroundStrokeColor:"black",rangeSelectorForegroundLineWidth:1,rangeSelectorAlpha:.6,showInRangeSelector:null,plotter:[r.default._fillPlotter,r.default._errorPlotter,r.default._linePlotter],plugins:[],axes:{x:{pixelsPerLabel:70,axisLabelWidth:60,axisLabelFormatter:t.dateAxisLabelFormatter,valueFormatter:t.dateValueFormatter,drawGrid:!0,drawAxis:!0,independentTicks:!0,ticker:i.dateTicker},y:{axisLabelWidth:50,pixelsPerLabel:30,valueFormatter:t.numberValueFormatter,axisLabelFormatter:t.numberAxisLabelFormatter,drawGrid:!0,drawAxis:!0,independentTicks:!0,ticker:i.numericTicks},y2:{axisLabelWidth:50,pixelsPerLabel:30,valueFormatter:t.numberValueFormatter,axisLabelFormatter:t.numberAxisLabelFormatter,drawAxis:!0,drawGrid:!1,independentTicks:!1,ticker:i.numericTicks}}};n.default=a,e.exports=n.default},{"./dygraph-canvas":8,"./dygraph-interaction-model":11,"./dygraph-tickers":15,"./dygraph-utils":16}],10:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i=(t=t("./dygraph"))&&t.__esModule?t:{default:t};function a(t){this.container=t}a.prototype.draw=function(t,e){this.container.innerHTML="",void 0!==this.date_graph&&this.date_graph.destroy(),this.date_graph=new i.default(this.container,t,e)},a.prototype.setSelection=function(t){var e=!1;t.length&&(e=t[0].row),this.date_graph.setSelection(e)},a.prototype.getSelection=function(){var t=[],e=this.date_graph.getSelection();if(!(e<0))for(var n=this.date_graph.layout_.points,i=0;in.boundedDates[1]&&(i=(t-=i-n.boundedDates[1])+n.dateRange),e.getOptionForAxis("logscale","x")?e.dateWindow_=[Math.pow(g.LOG_SCALE,t),Math.pow(g.LOG_SCALE,i)]:e.dateWindow_=[t,i],n.is2DPan)for(var a=n.dragEndY-n.dragStartY,r=0;r=o?d={tickValue:p,pixel_coord:g}:f.label="",s.push(f)}s.reverse()}}if(0===s.length){for(var _,y,v,x,u=i("labelsKMG2")?(_=[1,2,4,8,16,32,64,128,256],16):(_=[1,2,5,10,20,50,100],10),m=Math.ceil(n/o),m=Math.abs(e-t)/m,m=Math.floor(Math.log(m)/Math.log(u)),b=Math.pow(u,m),w=0;w<_.length&&(y=b*_[w],v=Math.floor(t/y)*y,x=Math.ceil(e/y)*y,!(oe?s:t(e,n,i,s+1,r)}return-1},e.cancelEvent=function(t){(t=t||window.event).stopPropagation&&t.stopPropagation();t.preventDefault&&t.preventDefault();return t.cancelBubble=!0,t.cancel=!0,t.returnValue=!1},e.clone=function t(e){var n=[];for(var i=0;i=h.Granularity.DECADAL?""+i:e>=h.Granularity.MONTHLY?k[a]+" "+i:0===3600*o+60*s+l+.001*n||e>=h.Granularity.DAILY?c(r)+" "+k[a]:eh.Granularity.MINUTELY?f(o,s,l,0):f(o,s,l,n)},e.dateParser=function(t){var e,n;if((-1==t.search("-")||-1!=t.search("T")||-1!=t.search("Z"))&&(n=v(t))&&!isNaN(n))return n;if(-1!=t.search("-")){for(e=t.replace("-","/","g");-1!=e.search("-");)e=e.replace("-","/");n=v(e)}else n=v(t);n&&!isNaN(n)||console.error("Couldn't parse "+t+" as a date");return n},e.dateStrToMillis=v,e.dateString_=_,e.dateValueFormatter=function(t,e){return _(t,e("labelsUTC"))},e.detectLineDelimiter=function(t){for(var e=0;e=Math.pow(10,a)?t.toExponential(i):y(t/s,i)+h[l]}else if(r<1){for(l=0;l=Math.pow(10,a)||rt.length)&&(e=t.length);for(var n=0,i=new Array(e);n=this.axes_.length?null:[(t=this.axes_[t]).computedValueRange[0],t.computedValueRange[1]]},T.prototype.yAxisRanges=function(){for(var t=[],e=0;e=this.rawData_.length||e<0||e>=this.rawData_[t].length?null:this.rawData_[t][e]},T.prototype.createInterface_=function(){var t=this.maindiv_,i=(this.graphDiv=document.createElement("div"),this.graphDiv.style.textAlign="left",this.graphDiv.style.position="relative",t.appendChild(this.graphDiv),this.canvas_=C.createCanvas(),this.canvas_.style.position="absolute",this.canvas_.style.top=0,this.canvas_.style.left=0,this.hidden_=this.createPlotKitCanvas_(this.canvas_),this.canvas_ctx_=C.getContext(this.canvas_),this.hidden_ctx_=C.getContext(this.hidden_),this.resizeElements_(),this.graphDiv.appendChild(this.hidden_),this.graphDiv.appendChild(this.canvas_),this.mouseEventElement_=this.createMouseEventElement_(),this.layout_=new a.default(this),this);this.mouseMoveHandler_=function(t){i.mouseMove_(t)},this.mouseOutHandler_=function(t){var e=t.target||t.fromElement,n=t.relatedTarget||t.toElement;C.isNodeContainedBy(e,i.graphDiv)&&!C.isNodeContainedBy(n,i.graphDiv)&&i.mouseOut_(t)},this.addAndTrackEvent(window,"mouseout",this.mouseOutHandler_),this.addAndTrackEvent(this.mouseEventElement_,"mousemove",this.mouseMoveHandler_),this.resizeHandler_||(this.resizeHandler_=function(t){i.resize()},this.addAndTrackEvent(window,"resize",this.resizeHandler_))},T.prototype.resizeElements_=function(){this.graphDiv.style.width=this.width_+"px",this.graphDiv.style.height=this.height_+"px";var t=this.getNumericOption("pixelRatio"),e=t||C.getContextPixelRatio(this.canvas_ctx_),e=(this.canvas_.width=this.width_*e,this.canvas_.height=this.height_*e,this.canvas_.style.width=this.width_+"px",this.canvas_.style.height=this.height_+"px",1!==e&&this.canvas_ctx_.scale(e,e),t||C.getContextPixelRatio(this.hidden_ctx_));this.hidden_.width=this.width_*e,this.hidden_.height=this.height_*e,this.hidden_.style.width=this.width_+"px",this.hidden_.style.height=this.height_+"px",1!==e&&this.hidden_ctx_.scale(e,e)},T.prototype.destroy=function(){this.canvas_ctx_.restore(),this.hidden_ctx_.restore();for(var t=this.plugins_.length-1;0<=t;t--){var e=this.plugins_.pop();e.plugin.destroy&&e.plugin.destroy()}function n(t){for(;t.hasChildNodes();)n(t.firstChild),t.removeChild(t.firstChild)}function i(t){for(var e in t)"object"===L(t[e])&&(t[e]=null)}this.removeTrackedEvents_(),C.removeEvent(window,"mouseout",this.mouseOutHandler_),C.removeEvent(this.mouseEventElement_,"mousemove",this.mouseMoveHandler_),C.removeEvent(window,"resize",this.resizeHandler_),this.resizeHandler_=null,n(this.maindiv_);i(this.layout_),i(this.plotter_),i(this)},T.prototype.createPlotKitCanvas_=function(t){var e=C.createCanvas();return e.style.position="absolute",e.style.top=t.style.top,e.style.left=t.style.left,e.width=this.width_,e.height=this.height_,e.style.width=this.width_+"px",e.style.height=this.height_+"px",e},T.prototype.createMouseEventElement_=function(){return this.canvas_},T.prototype.setColors_=function(){for(var t,e,n,i=this.getLabels(),a=i.length-1,r=(this.colors_=[],this.colorsMap_={},this.getNumericOption("colorSaturation")||1),o=this.getNumericOption("colorValue")||.5,s=Math.ceil(a/2),l=this.getOption("colors"),h=this.visibility(),u=0;u=d.length||(o=d[u],C.isValidPoint(o)&&(s=o.canvasy,t>o.canvasx&&1+un[1]&&(n[1]=c),c=h&&null===d&&(d=p),l[p][0]<=u&&(c=p);for(var g=d=null===d?0:d,f=!0;f&&0=n.length?console.warn("Invalid series number in setVisibility: "+a):n[a]=t[a]);else for(a=0;a=n.length?console.warn("Invalid series number in setVisibility: "+a):n[a]=t[a]:t[a]<0||t[a]>=n.length?console.warn("Invalid series number in setVisibility: "+t[a]):n[t[a]]=e;this.predraw_()},T.prototype.size=function(){return{width:this.width_,height:this.height_}},T.prototype.setAnnotations=function(t,e){this.annotations_=t,this.layout_?(this.layout_.setAnnotations(this.annotations_),e||this.predraw_()):console.warn("Tried to setAnnotations before dygraph was ready. Try setting them in a ready() block. See dygraphs.com/tests/annotation.html")},T.prototype.annotations=function(){return this.annotations_},T.prototype.getLabels=function(){var t=this.attr_("labels");return t?t.slice():null},T.prototype.indexFromSetName=function(t){return this.setIndexByName_[t]},T.prototype.getRowForX=function(t){for(var e=0,n=this.numRows()-1;e<=n;){var i=n+e>>1,a=this.getValue(i,0);if(aa.x+a.w||_.canvasya.y+a.h||(h=6,(l=_.annotation).hasOwnProperty("tickHeight")&&(h=l.tickHeight),(u=document.createElement("div")).style.fontSize=r.getOption("axisLabelFontSize")+"px",g="dygraph-annotation",l.hasOwnProperty("icon")||(g+=" dygraphDefaultAnnotation dygraph-default-annotation"),l.hasOwnProperty("cssClass")&&(g+=" "+l.cssClass),u.className=g,g=l.hasOwnProperty("width")?l.width:16,d=l.hasOwnProperty("height")?l.height:16,l.hasOwnProperty("icon")?((c=document.createElement("img")).src=l.icon,c.width=g,c.height=d,u.appendChild(c)):_.annotation.hasOwnProperty("shortText")&&u.appendChild(document.createTextNode(_.annotation.shortText)),c=_.canvasx-g/2,u.style.left=c+"px",p=0,p=l.attachAtBottom?(f=a.y+a.h-d-h,o[c]?f-=o[c]:o[c]=0,o[c]+=h+d,f):_.canvasy-d-h,u.style.top=p+"px",u.style.width=g+"px",u.style.height=d+"px",u.title=_.annotation.text,u.style.color=r.colorsMap_[_.name],u.style.borderColor=r.colorsMap_[_.name],l.div=u,r.addAndTrackEvent(u,"click",i("clickHandler","annotationClickHandler",_)),r.addAndTrackEvent(u,"mouseover",i("mouseOverHandler","annotationMouseOverHandler",_)),r.addAndTrackEvent(u,"mouseout",i("mouseOutHandler","annotationMouseOutHandler",_)),r.addAndTrackEvent(u,"dblclick",i("dblClickHandler","annotationDblClickHandler",_)),n.appendChild(u),this.annotations_.push(u),(g=t.drawingContext).save(),g.strokeStyle=l.hasOwnProperty("tickColor")?l.tickColor:r.colorsMap_[_.name],g.lineWidth=l.hasOwnProperty("tickWidth")?l.tickWidth:r.getOption("strokeWidth"),g.beginPath(),l.attachAtBottom?(g.moveTo(_.canvasx,f=p+d),g.lineTo(_.canvasx,f+h)):(g.moveTo(_.canvasx,_.canvasy),g.lineTo(_.canvasx,_.canvasy-2-h)),g.closePath(),g.stroke(),g.restore())}},i.prototype.destroy=function(){this.detachLabels()},n.default=i,e.exports=n.default},{}],20:[function(t,e,n){"use strict";function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var O=function(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!==o(t)&&"function"!=typeof t)return{default:t};e=s(e);if(e&&e.has(t))return e.get(t);var n,i={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(n in t){var r;"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&((r=a?Object.getOwnPropertyDescriptor(t,n):null)&&(r.get||r.set)?Object.defineProperty(i,n,r):i[n]=t[n])}i.default=t,e&&e.set(t,i);return i}(t("../dygraph-utils"));function s(t){var e,n;return"function"!=typeof WeakMap?null:(e=new WeakMap,n=new WeakMap,(s=function(t){return t?n:e})(t))}function A(t,e){if(t!==e)throw new TypeError("Cannot instantiate an arrow function")}function i(){this.xlabels_=[],this.ylabels_=[]}i.prototype.toString=function(){return"Axes Plugin"},i.prototype.activate=function(t){return{layout:this.layout,clearChart:this.clearChart,willDrawChart:this.willDrawChart}},i.prototype.layout=function(t){var e,n,i=t.dygraph;i.getOptionForAxis("drawAxis","y")&&(n=i.getOptionForAxis("axisLabelWidth","y")+2*i.getOptionForAxis("axisTickSize","y"),t.reserveSpaceLeft(n)),i.getOptionForAxis("drawAxis","x")&&(e=i.getOption("xAxisHeight")?i.getOption("xAxisHeight"):i.getOptionForAxis("axisLabelFontSize","x")+2*i.getOptionForAxis("axisTickSize","x"),t.reserveSpaceBottom(e)),2==i.numAxes()?i.getOptionForAxis("drawAxis","y2")&&(n=i.getOptionForAxis("axisLabelWidth","y2")+2*i.getOptionForAxis("axisTickSize","y2"),t.reserveSpaceRight(n)):2n&&(t=n-_("axisLabelWidth"),o.style.textAlign="right"),t<0&&(t=0,o.style.textAlign="left"),o.style.left=t+"px",o.style.width=_("axisLabelWidth")+"px",a.appendChild(o),this.xlabels_.push(o))}.bind(this))),e.strokeStyle=m.getOptionForAxis("axisLineColor","x"),e.lineWidth=m.getOptionForAxis("axisLineWidth","x"),e.beginPath(),v=m.getOption("drawAxesAtZero")?(y=m.toPercentYCoord(0,0),w(d.y+(y=1u.w&&(i=i-100-r-(e-u.x)),t.dygraph.graphDiv.appendChild(this.legend_div_),this.legend_div_.style.left=e+i+"px",this.legend_div_.style.top=a+"px"),(r=m.generateLegendHTML(t.dygraph,s,l,this.one_em_width_,h))instanceof Node&&r.nodeType===Node.DOCUMENT_FRAGMENT_NODE?(this.legend_div_.innerHTML="",this.legend_div_.appendChild(r)):this.legend_div_.innerHTML=r,this.legend_div_.style.display="")},m.prototype.deselect=function(t){"always"!==t.dygraph.getOption("legend")&&(this.legend_div_.style.display="none"),n=this.legend_div_,(i=document.createElement("span")).setAttribute("style","margin: 0; padding: 0 0 0 1em; border: 0;"),n.appendChild(i),e=i.offsetWidth,n.removeChild(i);var e,n=e,i=(this.one_em_width_=n,m.generateLegendHTML(t.dygraph,void 0,void 0,n,null));i instanceof Node&&i.nodeType===Node.DOCUMENT_FRAGMENT_NODE?(this.legend_div_.innerHTML="",this.legend_div_.appendChild(i)):this.legend_div_.innerHTML=i},m.prototype.didDrawChart=function(t){this.deselect(t)},m.prototype.predraw=function(t){var e;this.is_generated_div_&&(t.dygraph.graphDiv.appendChild(this.legend_div_),t=t.dygraph.getArea(),e=this.legend_div_.offsetWidth,this.legend_div_.style.left=t.x+t.w-e-1+"px",this.legend_div_.style.top=t.y+"px")},m.prototype.destroy=function(){this.legend_div_=null},m.generateLegendHTML=function(t,e,n,i,a){var r={dygraph:t,x:e,i:a,series:[]},o={},s=t.getLabels();if(s)for(var l=1;l');var i,a,r,o,s,l=0,h=0,u=[];for(i=0;i<=t.length;i++)l+=t[i%t.length];if(1<(s=Math.floor(n/(l-t[0])))){for(i=0;i');return d}(t.getOption("strokePattern",s[l]),h.color,i),label:s[l],labelHTML:s[l].replace(/&/g,"&").replace(/"/g,""").replace(//g,">"),isVisible:h.visible,color:h.color};r.series.push(u),o[s[l]]=u}if(void 0!==e){for(var d=t.optionsViewForAxis_("x"),c=d("valueFormatter"),p=(r.xHTML=c.call(t,e,d,s[0],t,a,0),[]),g=t.numAxes(),l=0;l":" "),i+="").concat(r.dashHTML," ").concat(r.labelHTML,""))}else{i=t.xHTML+":";for(var r,o,a=0;a"),o=r.isHighlighted?' class="highlight"':"",i+=" ").concat(r.labelHTML,": ").concat(r.yHTML,""))}return i},n.default=m,e.exports=n.default},{"../dygraph-utils":16}],24:[function(t,e,n){"use strict";function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var O=function(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!==o(t)&&"function"!=typeof t)return{default:t};e=s(e);if(e&&e.has(t))return e.get(t);var n,i={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(n in t){var r;"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&((r=a?Object.getOwnPropertyDescriptor(t,n):null)&&(r.get||r.set)?Object.defineProperty(i,n,r):i[n]=t[n])}i.default=t,e&&e.set(t,i);return i}(t("../dygraph-utils")),A=i(t("../dygraph-interaction-model")),S=i(t("../iframe-tarp"));function i(t){return t&&t.__esModule?t:{default:t}}function s(t){var e,n;return"function"!=typeof WeakMap?null:(e=new WeakMap,n=new WeakMap,(s=function(t){return t?n:e})(t))}function a(){this.hasTouchInterface_="undefined"!=typeof TouchEvent,this.isMobileDevice_=/mobile|android/gi.test(navigator.appVersion),this.interfaceCreated_=!1}a.prototype.toString=function(){return"RangeSelector Plugin"},a.prototype.activate=function(t){return this.dygraph_=t,this.getOption_("showRangeSelector")&&this.createInterface_(),{layout:this.reserveSpace_,predraw:this.renderStaticLayer_,didDrawChart:this.renderInteractiveLayer_}},a.prototype.destroy=function(){this.bgcanvas_=null,this.fgcanvas_=null,this.leftZoomHandle_=null,this.rightZoomHandle_=null},a.prototype.getOption_=function(t,e){return this.dygraph_.getOption(t,e)},a.prototype.setDefaultOption_=function(t,e){this.dygraph_.attrs_[t]=e},a.prototype.createInterface_=function(){this.createCanvases_(),this.createZoomHandles_(),this.initInteraction_(),this.getOption_("animatedZooms")&&(console.warn("Animated zooms and range selector are not compatible; disabling animatedZooms."),this.dygraph_.updateOptions({animatedZooms:!1},!0)),this.interfaceCreated_=!0,this.addToGraph_()},a.prototype.addToGraph_=function(){var t=this.graphDiv_=this.dygraph_.graphDiv;t.appendChild(this.bgcanvas_),t.appendChild(this.fgcanvas_),t.appendChild(this.leftZoomHandle_),t.appendChild(this.rightZoomHandle_)},a.prototype.removeFromGraph_=function(){var t=this.graphDiv_;t.removeChild(this.bgcanvas_),t.removeChild(this.fgcanvas_),t.removeChild(this.leftZoomHandle_),t.removeChild(this.rightZoomHandle_),this.graphDiv_=null},a.prototype.reserveSpace_=function(t){this.getOption_("showRangeSelector")&&t.reserveSpaceBottom(this.getOption_("rangeSelectorHeight")+4)},a.prototype.renderStaticLayer_=function(){this.updateVisibility_()&&(this.resize_(),this.drawStaticLayer_())},a.prototype.renderInteractiveLayer_=function(){this.updateVisibility_()&&!this.isChangingRange_&&(this.placeZoomHandles_(),this.drawInteractiveLayer_())},a.prototype.updateVisibility_=function(){var t,e=this.getOption_("showRangeSelector");return e?this.interfaceCreated_?this.graphDiv_&&this.graphDiv_.parentNode||this.addToGraph_():this.createInterface_():this.graphDiv_&&(this.removeFromGraph_(),t=this.dygraph_,setTimeout(function(){t.width_=0,t.resize()},1)),e},a.prototype.resize_=function(){function t(t,e,n,i){i=i||O.getContextPixelRatio(e);t.style.top=n.y+"px",t.style.left=n.x+"px",t.width=n.w*i,t.height=n.h*i,t.style.width=n.w+"px",t.style.height=n.h+"px",1!=i&&e.scale(i,i)}var e=this.dygraph_.layout_.getPlotArea(),n=0,n=(this.dygraph_.getOptionForAxis("drawAxis","x")&&(n=this.getOption_("xAxisHeight")||this.getOption_("axisLabelFontSize")+2*this.getOption_("axisTickSize")),this.canvasRect_={x:e.x,y:e.y+e.h+n+4,w:e.w,h:this.getOption_("rangeSelectorHeight")},this.dygraph_.getNumericOption("pixelRatio"));t(this.bgcanvas_,this.bgcanvas_ctx_,this.canvasRect_,n),t(this.fgcanvas_,this.fgcanvas_ctx_,this.canvasRect_,n)},a.prototype.createCanvases_=function(){this.bgcanvas_=O.createCanvas(),this.bgcanvas_.className="dygraph-rangesel-bgcanvas",this.bgcanvas_.style.position="absolute",this.bgcanvas_.style.zIndex=9,this.bgcanvas_ctx_=O.getContext(this.bgcanvas_),this.fgcanvas_=O.createCanvas(),this.fgcanvas_.className="dygraph-rangesel-fgcanvas",this.fgcanvas_.style.position="absolute",this.fgcanvas_.style.zIndex=9,this.fgcanvas_.style.cursor="default",this.fgcanvas_ctx_=O.getContext(this.fgcanvas_)},a.prototype.createZoomHandles_=function(){var t=new Image;t.className="dygraph-rangesel-zoomhandle",t.style.position="absolute",t.style.zIndex=10,t.style.visibility="hidden",t.style.cursor="col-resize",t.width=9,t.height=16,t.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAQCAYAAADESFVDAAAAAXNSR0IArs4c6QAAAAZiS0dEANAAzwDP4Z7KegAAAAlwSFlzAAAOxAAADsQBlSsOGwAAAAd0SU1FB9sHGw0cMqdt1UwAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAaElEQVQoz+3SsRFAQBCF4Z9WJM8KCDVwownl6YXsTmCUsyKGkZzcl7zkz3YLkypgAnreFmDEpHkIwVOMfpdi9CEEN2nGpFdwD03yEqDtOgCaun7sqSTDH32I1pQA2Pb9sZecAxc5r3IAb21d6878xsAAAAAASUVORK5CYII=",this.isMobileDevice_&&(t.width*=2,t.height*=2),this.leftZoomHandle_=t,this.rightZoomHandle_=t.cloneNode(!1)},a.prototype.initInteraction_=function(){var a=this,e=document,r=0,i=null,o=!1,s=!1,l=!this.isMobileDevice_,n=new S.default,h=function(t){var e=a.dygraph_.xAxisExtremes(),n=(e[1]-e[0])/a.canvasRect_.w;return[e[0]+(t.leftHandlePos-a.canvasRect_.x)*n,e[0]+(t.rightHandlePos-a.canvasRect_.x)*n]},u=function(t){return O.cancelEvent(t),o=!0,r=t.clientX,i=t.target||t.srcElement,"mousedown"!==t.type&&"dragstart"!==t.type||(O.addEvent(e,"mousemove",d),O.addEvent(e,"mouseup",c)),a.fgcanvas_.style.cursor="col-resize",n.cover(),!0},d=function(t){if(!o)return!1;O.cancelEvent(t);var e,n=t.clientX-r;return Math.abs(n)<4||(r=t.clientX,t=a.getZoomHandleStatus_(),e=i==a.leftZoomHandle_?(e=t.leftHandlePos+n,e=Math.min(e,t.rightHandlePos-i.width-3),Math.max(e,a.canvasRect_.x)):(e=t.rightHandlePos+n,e=Math.min(e,a.canvasRect_.x+a.canvasRect_.w),Math.max(e,t.leftHandlePos+i.width+3)),n=i.width/2,i.style.left=e-n+"px",a.drawInteractiveLayer_(),l&&p()),!0},c=function(t){return!!o&&(o=!1,n.uncover(),O.removeEvent(e,"mousemove",d),O.removeEvent(e,"mouseup",c),a.fgcanvas_.style.cursor="default",l||p(),!0)},p=function(){try{var t,e=a.getZoomHandleStatus_();a.isChangingRange_=!0,e.isZoomed?(t=h(e),a.dygraph_.doZoomXDates_(t[0],t[1])):a.dygraph_.resetZoom()}finally{a.isChangingRange_=!1}},g=function(t){var e=a.leftZoomHandle_.getBoundingClientRect(),n=e.left+e.width/2,e=(e=a.rightZoomHandle_.getBoundingClientRect()).left+e.width/2;return t.clientX>n&&t.clientX=a.canvasRect_.x+a.canvasRect_.w?e=(t=a.canvasRect_.x+a.canvasRect_.w)-n:(e+=i,t+=i),n=a.leftZoomHandle_.width/2,a.leftZoomHandle_.style.left=e-n+"px",a.rightZoomHandle_.style.left=t-n+"px",a.drawInteractiveLayer_(),l&&v()),!0},y=function(t){return!!s&&(s=!1,O.removeEvent(e,"mousemove",_),O.removeEvent(e,"mouseup",y),l||v(),!0)},v=function(){try{a.isChangingRange_=!0,a.dygraph_.dateWindow_=h(a.getZoomHandleStatus_()),a.dygraph_.drawGraph_(!1)}finally{a.isChangingRange_=!1}},t=function(t){o||s||(t=g(t)?"move":"default")!=a.fgcanvas_.style.cursor&&(a.fgcanvas_.style.cursor=t)},x=function(t){"touchstart"==t.type&&1==t.targetTouches.length?u(t.targetTouches[0])&&O.cancelEvent(t):"touchmove"==t.type&&1==t.targetTouches.length?d(t.targetTouches[0])&&O.cancelEvent(t):c(t)},m=function(t){"touchstart"==t.type&&1==t.targetTouches.length?f(t.targetTouches[0])&&O.cancelEvent(t):"touchmove"==t.type&&1==t.targetTouches.length?_(t.targetTouches[0])&&O.cancelEvent(t):y(t)},b=function(t,e){for(var n=["touchstart","touchend","touchmove","touchcancel"],i=0;ithis.canvasRect_.x||t+1