text: ﻿/*! @license Copyright 2014 Dan Vanderkam (danvdk@gmail.com) MIT-licensed (http://opensource.org/licenses/MIT) */
  !function(n){"use strict";for(var t,i,r={},u=function(){},f="memory".split(","),e="assert,clear,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn".split(",");t=f.pop();)n[t]=n[t]||r;for(;i=e.pop();)n[i]=n[i]||u}(this.console=this.console||{}),function(){"use strict";CanvasRenderingContext2D.prototype.installPattern=function(n){if("undefined"!=typeof this.isPatternInstalled)throw"Must un-install old line pattern before installing a new one.";this.isPatternInstalled=!0;var i=[0,0],t=[],f=this.beginPath,e=this.lineTo,r=this.moveTo,u=this.stroke;this.uninstallPattern=function(){this.beginPath=f;this.lineTo=e;this.moveTo=r;this.stroke=u;this.uninstallPattern=void 0;this.isPatternInstalled=void 0};this.beginPath=function(){t=[];f.call(this)};this.moveTo=function(n,i){t.push([[n,i]]);r.call(this,n,i)};this.lineTo=function(n,i){var r=t[t.length-1];r.push([n,i])};this.stroke=function(){var h,y,p,o,f,k;if(0===t.length)return void u.call(this);for(h=0;h<t.length;h++)for(var s=t[h],a=s[0][0],v=s[0][1],c=1;c<s.length;c++){y=s[c][0];p=s[c][1];this.save();var w=y-a,b=p-v,l=Math.sqrt(w*w+b*b),d=Math.atan2(b,w);for(this.translate(a,v),r.call(this,0,0),this.rotate(d),o=i[0],f=0;l>f;)k=n[o],f+=i[1]?i[1]:k,f>l?(i=[o,f-l],f=l):i=[(o+1)%n.length,0],o%2==0?e.call(this,f,0):r.call(this,f,0),o=(o+1)%n.length;this.restore();a=y;v=p}u.call(this);t=[]}};CanvasRenderingContext2D.prototype.uninstallPattern=function(){throw"Must install a line pattern before uninstalling it.";}}();var DygraphOptions=function(){return function(){"use strict";var n=function(n){this.dygraph_=n;this.yAxes_=[];this.xAxis_={};this.series_={};this.global_=this.dygraph_.attrs_;this.user_=this.dygraph_.user_attrs_||{};this.labels_=[];this.highlightSeries_=this.get("highlightSeriesOpts")||{};this.reparseSeries()};return n.AXIS_STRING_MAPPINGS_={y:0,Y:0,y1:0,Y1:0,y2:1,Y2:1},n.axisToIndex_=function(t){if("string"==typeof t){if(n.AXIS_STRING_MAPPINGS_.hasOwnProperty(t))return n.AXIS_STRING_MAPPINGS_[t];throw"Unknown axis : "+t;}if("number"==typeof t){if(0===t||1===t)return t;throw"Dygraphs only supports two y-axes, indexed from 0-1.";}if(t)throw"Unknown axis : "+t;return 0},n.prototype.reparseSeries=function(){var o=this.get("labels"),s,h,r,t,e;if(o){if(this.labels_=o.slice(1),this.yAxes_=[{series:[],options:{}}],this.xAxis_={options:{}},this.series_={},s=!this.user_.series,s){for(h=0,t=0;t<this.labels_.length;t++){var i=this.labels_[t],f=this.user_[i]||{},r=0,u=f.axis;"object"==typeof u&&(r=++h,this.yAxes_[r]={series:[i],options:u});u||this.yAxes_[0].series.push(i);this.series_[i]={idx:t,yAxis:r,options:f}}for(t=0;t<this.labels_.length;t++){var i=this.labels_[t],f=this.series_[i].options,u=f.axis;if("string"==typeof u){if(!this.series_.hasOwnProperty(u))return void console.error("Series "+i+" wants to share a y-axis with series "+u+", which does not define its own axis.");r=this.series_[u].yAxis;this.series_[i].yAxis=r;this.yAxes_[r].series.push(i)}}}else for(t=0;t<this.labels_.length;t++){var i=this.labels_[t],f=this.user_.series[i]||{},r=n.axisToIndex_(f.axis);this.series_[i]={idx:t,yAxis:r,options:f};this.yAxes_[r]?this.yAxes_[r].series.push(i):this.yAxes_[r]={series:[i],options:{}}}e=this.user_.axes||{};Dygraph.update(this.yAxes_[0].options,e.y||{});this.yAxes_.length>1&&Dygraph.update(this.yAxes_[1].options,e.y2||{});Dygraph.update(this.xAxis_.options,e.x||{})}},n.prototype.get=function(n){var t=this.getGlobalUser_(n);return null!==t?t:this.getGlobalDefault_(n)},n.prototype.getGlobalUser_=function(n){return this.user_.hasOwnProperty(n)?this.user_[n]:null},n.prototype.getGlobalDefault_=function(n){return this.global_.hasOwnProperty(n)?this.global_[n]:Dygraph.DEFAULT_ATTRS.hasOwnProperty(n)?Dygraph.DEFAULT_ATTRS[n]:null},n.prototype.getForAxis=function(n,t){var i,r,u,f,e,o;if("number"==typeof t)i=t,r=0===i?"y":"y2";else{if("y1"==t&&(t="y"),"y"==t)i=0;else if("y2"==t)i=1;else{if("x"!=t)throw"Unknown axis "+t;i=-1}r=t}return(u=-1==i?this.xAxis_:this.yAxes_[i],u&&(f=u.options,f.hasOwnProperty(n)))?f[n]:("x"!==t||"logscale"!==n)&&(e=this.getGlobalUser_(n),null!==e)?e:(o=Dygraph.DEFAULT_ATTRS.axes[r],o.hasOwnProperty(n)?o[n]:this.getGlobalDefault_(n))},n.prototype.getForSeries=function(n,t){if(t===this.dygraph_.getHighlightSeries()&&this.highlightSeries_.hasOwnProperty(n))return this.highlightSeries_[n];if(!this.series_.hasOwnProperty(t))throw"Unknown series: "+t;var i=this.series_[t],r=i.options;return r.hasOwnProperty(n)?r[n]:this.getForAxis(n,i.yAxis)},n.prototype.numAxes=function(){return this.yAxes_.length},n.prototype.axisForSeries=function(n){return this.series_[n].yAxis},n.prototype.axisOptions=function(n){return this.yAxes_[n].options},n.prototype.seriesForAxis=function(n){return this.yAxes_[n].series},n.prototype.seriesNames=function(){return this.labels_},n}()}(),DygraphLayout=function(){"use strict";var n=function(n){this.dygraph_=n;this.points=[];this.setNames=[];this.annotations=[];this.yAxes_=null;this.xTicks_=null;this.yTicks_=null};return n.prototype.addDataset=function(n,t){this.points.push(t);this.setNames.push(n)},n.prototype.getPlotArea=function(){return this.area_},n.prototype.computePlotArea=function(){var n={x:0,y:0},t;n.w=this.dygraph_.width_-n.x-this.dygraph_.getOption("rightGap");n.h=this.dygraph_.height_;t={chart_div:this.dygraph_.graphDiv,reserveSpaceLeft:function(t){var i={x:n.x,y:n.y,w:t,h:n.h};return n.x+=t,n.w-=t,i},reserveSpaceRight:function(t){var i={x:n.x+n.w-t,y:n.y,w:t,h:n.h};return n.w-=t,i},reserveSpaceTop:function(t){var i={x:n.x,y:n.y,w:n.w,h:t};return n.y+=t,n.h-=t,i},reserveSpaceBottom:function(t){var i={x:n.x,y:n.y+n.h-t,w:n.w,h:t};return n.h-=t,i},chartRect:function(){return{x:n.x,y:n.y,w:n.w,h:n.h}}};this.dygraph_.cascadeEvents_("layout",t);this.area_=n},n.prototype.setAnnotations=function(n){var r,t,i;for(this.annotations=[],r=this.dygraph_.getOption("xValueParser")||function(n){return n},t=0;t<n.length;t++){if(i={},!n[t].xval&&void 0===n[t].x)return void console.error("Annotations must have an 'x' property");if(n[t].icon&&(!n[t].hasOwnProperty("width")||!n[t].hasOwnProperty("height")))return void console.error("Must set width and height when setting annotation.icon property");Dygraph.update(i,n[t]);i.xval||(i.xval=r(i.x));this.annotations.push(i)}},n.prototype.setXTicks=function(n){this.xTicks_=n},n.prototype.setYAxes=function(n){this.yAxes_=n},n.prototype.evaluate=function(){this._xAxis={};this._evaluateLimits();this._evaluateLineCharts();this._evaluateLineTicks();this._evaluateAnnotations()},n.prototype._evaluateLimits=function(){var i=this.dygraph_.xAxisRange(),r,t,n;for(this._xAxis.minval=i[0],this._xAxis.maxval=i[1],r=i[1]-i[0],this._xAxis.scale=0!==r?1/r:1,this.dygraph_.getOptionForAxis("logscale","x")&&(this._xAxis.xlogrange=Dygraph.log10(this._xAxis.maxval)-Dygraph.log10(this._xAxis.minval),this._xAxis.xlogscale=0!==this._xAxis.xlogrange?1/this._xAxis.xlogrange:1),t=0;t<this.yAxes_.length;t++)n=this.yAxes_[t],n.minyval=n.computedValueRange[0],n.maxyval=n.computedValueRange[1],n.yrange=n.maxyval-n.minyval,n.yscale=0!==n.yrange?1/n.yrange:1,this.dygraph_.getOption("logscale")&&(n.ylogrange=Dygraph.log10(n.maxyval)-Dygraph.log10(n.minyval),n.ylogscale=0!==n.ylogrange?1/n.ylogrange:1,(!isFinite(n.ylogrange)||isNaN(n.ylogrange))&&console.error("axis "+t+" of graph at "+n.g+" can't be displayed in log scale for range ["+n.minyval+" - "+n.maxyval+"]"))},n.calcXNormal_=function(n,t,i){return i?(Dygraph.log10(n)-Dygraph.log10(t.minval))*t.xlogscale:(n-t.minval)*t.scale},n.calcYNormal_=function(n,t,i){if(i){var r=1-(Dygraph.log10(t)-Dygraph.log10(n.minyval))*n.ylogscale;return isFinite(r)?r:NaN}return 1-(t-n.minyval)*n.yscale},n.prototype._evaluateLineCharts=function(){for(var t,i,h=this.dygraph_.getOption("stackedGraph"),c=this.dygraph_.getOptionForAxis("logscale","x"),r=0;r<this.points.length;r++){for(var u=this.points[r],f=this.setNames[r],l=this.dygraph_.getOption("connectSeparatedPoints",f),e=this.dygraph_.axisPropertiesForSeries(f),o=this.dygraph_.attributes_.getForSeries("logscale",f),s=0;s<u.length;s++)t=u[s],t.x=n.calcXNormal_(t.xval,this._xAxis,c),i=t.yval,h&&(t.y_stacked=n.calcYNormal_(e,t.yval_stacked,o),null===i||isNaN(i)||(i=t.yval_stacked)),null===i&&(i=NaN,l||(t.yval=NaN)),t.y=n.calcYNormal_(e,i,o);this.dygraph_.dataHandler_.onLineEvaluated(u,e,o)}},n.prototype._evaluateLineTicks=function(){var n,i,r,t,f,u;for(this.xticks=[],n=0;n<this.xTicks_.length;n++)i=this.xTicks_[n],r=i.label,t=this.dygraph_.toPercentXCoord(i.v),t>=0&&1>t&&this.xticks.push([t,r]);for(this.yticks=[],n=0;n<this.yAxes_.length;n++)for(f=this.yAxes_[n],u=0;u<f.ticks.length;u++)i=f.ticks[u],r=i.label,t=this.dygraph_.toPercentYCoord(i.v,n),t>0&&1>=t&&this.yticks.push([n,t,r])},n.prototype._evaluateAnnotations=function(){for(var u={},i,r,f,t,e,n=0;n<this.annotations.length;n++)i=this.annotations[n],u[i.xval+","+i.series]=i;if(this.annotated_points=[],this.annotations&&this.annotations.length)for(r=0;r<this.points.length;r++)for(f=this.points[r],n=0;n<f.length;n++)t=f[n],e=t.xval+","+t.name,e in u&&(t.annotation=u[e],this.annotated_points.push(t))},n.prototype.removeAllDatasets=function(){delete this.points;delete this.setNames;delete this.setPointsLengths;delete this.setPointsOffsets;this.points=[];this.setNames=[];this.setPointsLengths=[];this.setPointsOffsets=[]},n}(),DygraphCanvasRenderer=function(){"use strict";var n=function(n,t,i,r){if(this.dygraph_=n,this.layout=r,this.element=t,this.elementContext=i,this.height=n.height_,this.width=n.width_,!this.isIE&&!Dygraph.isCanvasSupported(this.element))throw"Canvas is not supported.";if(this.area=r.getPlotArea(),this.dygraph_.isUsingExcanvas_)this._createIEClipArea();else if(!Dygraph.isAndroid()){var u=this.dygraph_.canvas_ctx_;u.beginPath();u.rect(this.area.x,this.area.y,this.area.w,this.area.h);u.clip();u=this.dygraph_.hidden_ctx_;u.beginPath();u.rect(this.area.x,this.area.y,this.area.w,this.area.h);u.clip()}};return n.prototype.clear=function(){var n;if(this.isIE)try{this.clearDelay&&(this.clearDelay.cancel(),this.clearDelay=null);n=this.elementContext}catch(t){return}n=this.elementContext;n.clearRect(0,0,this.width,this.height)},n.prototype.render=function(){this._updatePoints();this._renderLineChart()},n.prototype._createIEClipArea=function(){function r(n){if(0!==n.w&&0!==n.h){var i=document.createElement("div");i.className=o;i.style.backgroundColor=e;i.style.position="absolute";i.style.left=n.x+"px";i.style.top=n.y+"px";i.style.width=n.w+"px";i.style.height=n.h+"px";t.appendChild(i)}}for(var e,i,f,n,o="dygraph-clip-div",t=this.dygraph_.graphDiv,u=t.childNodes.length-1;u>=0;u--)t.childNodes[u].className==o&&t.removeChild(t.childNodes[u]);for(e=document.bgColor,i=this.dygraph_.graphDiv;i!=document;){if(f=i.currentStyle.backgroundColor,f&&"transparent"!=f){e=f;break}i=i.parentNode}n=this.area;r({x:0,y:0,w:n.x,h:this.height});r({x:n.x,y:0,w:this.width-n.x,h:n.y});r({x:n.x+n.w,y:0,w:this.width-n.x-n.w,h:this.height});r({x:n.x,y:n.y+n.h,w:this.width-n.x,h:this.height-n.h-n.y})},n._getIteratorPredicate=function(t){return t?n._predicateThatSkipsEmptyPoints:null},n._predicateThatSkipsEmptyPoints=function(n,t){return null!==n[t].yval},n._drawStyledLine=function(t,i,r,u,f,e,o){var h=t.dygraph,v=h.getBooleanOption("stepPlot",t.setName),a;Dygraph.isArrayLike(u)||(u=null);var y=h.getBooleanOption("drawGapEdgePoints",t.setName),c=t.points,p=t.setName,w=Dygraph.createIterator(c,0,c.length,n._getIteratorPredicate(h.getBooleanOption("connectSeparatedPoints",p))),l=u&&u.length>=2,s=t.drawingContext;s.save();l&&s.installPattern(u);a=n._drawSeries(t,w,r,o,f,y,v,i);n._drawPointsOnLine(t,a,e,i,o);l&&s.uninstallPattern();s.restore()},n._drawSeries=function(n,t,i,r,u,f,e,o){var v,s,c=null,a=null,y=null,k=[],d=!0,h=n.drawingContext,b;h.beginPath();h.strokeStyle=o;h.lineWidth=i;for(var p=t.array_,w=t.end_,g=t.predicate_,l=t.start_;w>l;l++){if(s=p[l],g){for(;w>l&&!g(p,l);)l++;if(l==w)break;s=p[l]}null===s.canvasy||s.canvasy!=s.canvasy?(e&&null!==c&&(h.moveTo(c,a),h.lineTo(s.canvasx,a)),c=a=null):((v=!1,f||!c)&&(t.nextIdx_=l,t.next(),y=t.hasNext?t.peek.canvasy:null,b=null===y||y!=y,v=!c&&b,f&&(!d&&!c||t.hasNext&&b)&&(v=!0)),null!==c?i&&(e&&(h.moveTo(c,a),h.lineTo(s.canvasx,a)),h.lineTo(s.canvasx,s.canvasy)):h.moveTo(s.canvasx,s.canvasy),(u||v)&&k.push([s.canvasx,s.canvasy,s.idx]),c=s.canvasx,a=s.canvasy);d=!1}return h.stroke(),k},n._drawPointsOnLine=function(n,t,i,r,u){for(var o,f=n.drawingContext,e=0;e<t.length;e++)o=t[e],f.save(),i.call(n.dygraph,n.dygraph,n.setName,f,o[0],o[1],r,u,o[2]),f.restore()},n.prototype._updatePoints=function(){for(var r,u,n,t=this.layout.points,i=t.length;i--;)for(r=t[i],u=r.length;u--;)n=r[u],n.canvasx=this.area.w*n.x+this.area.x,n.canvasy=this.area.h*n.y+this.area.y},n.prototype._renderLineChart=function(n,t){var r,i,f=t||this.elementContext,o=this.layout.points,h=this.layout.setNames,c,u,s,l,p,a,v,y;for(this.colors=this.dygraph_.colorsMap_,c=this.dygraph_.getOption("plotter"),u=c,Dygraph.isArrayLike(u)||(u=[u]),s={},r=0;r<h.length;r++)i=h[r],l=this.dygraph_.getOption("plotter",i),l!=c&&(s[i]=l);for(r=0;r<u.length;r++)for(var w=u[r],b=r==u.length-1,e=0;e<o.length;e++)if(i=h[e],!n||i==n){if(p=o[e],a=w,i in s){if(!b)continue;a=s[i]}v=this.colors[i];y=this.dygraph_.getOption("strokeWidth",i);f.save();f.strokeStyle=v;f.lineWidth=y;a({points:p,setName:i,drawingContext:f,color:v,strokeWidth:y,dygraph:this.dygraph_,axis:this.dygraph_.axisPropertiesForSeries(i),plotArea:this.area,seriesIndex:e,seriesCount:o.length,singleSeriesName:n,allSeriesPoints:o});f.restore()}},n._Plotters={linePlotter:function(t){n._linePlotter(t)},fillPlotter:function(t){n._fillPlotter(t)},errorPlotter:function(t){n._errorPlotter(t)}},n._linePlotter=function(t){var i=t.dygraph,r=t.setName,u=t.strokeWidth,f=i.getNumericOption("strokeBorderWidth",r),e=i.getOption("drawPointCallback",r)||Dygraph.Circles.DEFAULT,o=i.getOption("strokePattern",r),s=i.getBooleanOption("drawPoints",r),h=i.getNumericOption("pointSize",r);f&&u&&n._drawStyledLine(t,i.getOption("strokeBorderColor",r),u+2*f,o,s,e,h);n._drawStyledLine(t,t.color,u,o,s,e,h)},n._errorPlotter=function(t){var f=t.dygraph,s=t.setName,w=f.getBooleanOption("errorBars")||f.getBooleanOption("customBars"),v,a,r;if(w){v=f.getBooleanOption("fillGraph",s);v&&console.warn("Can't use fillGraph option with error bars");var i,u=t.drawingContext,b=t.color,k=f.getNumericOption("fillAlpha",s),h=f.getBooleanOption("stepPlot",s),y=t.points,p=Dygraph.createIterator(y,0,y.length,n._getIteratorPredicate(f.getBooleanOption("connectSeparatedPoints",s))),e=NaN,c=NaN,o=[-1,-1],l=Dygraph.toRGB_(b),d="rgba("+l.r+","+l.g+","+l.b+","+k+")";for(u.fillStyle=d,u.beginPath(),a=function(n){return null===n||void 0===n||isNaN(n)};p.hasNext;)r=p.next(),!h&&a(r.y)||h&&!isNaN(c)&&a(c)?e=NaN:(i=[r.y_bottom,r.y_top],h&&(c=r.y),isNaN(i[0])&&(i[0]=r.y),isNaN(i[1])&&(i[1]=r.y),i[0]=t.plotArea.h*i[0]+t.plotArea.y,i[1]=t.plotArea.h*i[1]+t.plotArea.y,isNaN(e)||(h?(u.moveTo(e,o[0]),u.lineTo(r.canvasx,o[0]),u.lineTo(r.canvasx,o[1])):(u.moveTo(e,o[0]),u.lineTo(r.canvasx,i[0]),u.lineTo(r.canvasx,i[1])),u.lineTo(e,o[1]),u.closePath()),o=i,e=r.canvasx);u.fill()}},n._fastCanvasProxy=function(n){var t=[],r=null,e=null,f=1,i=2,o=0,h=function(n){var c,r,s,u,l,h,a;if(!(t.length<=1)){for(r=t.length-1;r>0;r--)u=t[r],u[0]==i&&(c=t[r-1],c[1]==u[1]&&c[2]==u[2]&&t.splice(r,1));for(r=0;r<t.length-1;)u=t[r],u[0]==i&&t[r+1][0]==i?t.splice(r,1):r++;if(t.length>2&&!n){s=0;t[0][0]==i&&s++;for(var e=null,o=null,r=s;r<t.length;r++)u=t[r],u[0]==f&&(null===e&&null===o?(e=r,o=r):(l=u[2],l<t[e][2]?e=r:l>t[o][2]&&(o=r)));h=t[e];a=t[o];t.splice(s,t.length-s);o>e?(t.push(h),t.push(a)):e>o?(t.push(a),t.push(h)):t.push(h)}}},u=function(r){var s,c,u;for(h(r),s=0,c=t.length;c>s;s++)u=t[s],u[0]==f?n.lineTo(u[1],u[2]):u[0]==i&&n.moveTo(u[1],u[2]);t.length&&(e=t[t.length-1][1]);o+=t.length;t=[]},s=function(n,i,f){var o=Math.round(i);if(null===r||o!=r){var s=r-e>1,h=o-r>1,c=s||h;u(c);r=o}t.push([n,i,f])};return{moveTo:function(n,t){s(i,n,t)},lineTo:function(n,t){s(f,n,t)},stroke:function(){u(!0);n.stroke()},fill:function(){u(!0);n.fill()},beginPath:function(){u(!0);n.beginPath()},closePath:function(){u(!0);n.closePath()},_count:function(){return o}}},n._fillPlotter=function(t){var it,r,v,ot,tt,i,o,st;if(!t.singleSeriesName&&0===t.seriesIndex){for(var u=t.dygraph,l=u.getLabels().slice(1),w=l.length;w>=0;w--)u.visibility()[w]||l.splice(w,1);if(it=function(){for(var n=0;n<l.length;n++)if(u.getBooleanOption("fillGraph",l[n]))return!0;return!1}(),it)for(var s,b,h=t.plotArea,rt=t.allSeriesPoints,ht=rt.length,ct=u.getNumericOption("fillAlpha"),k=u.getBooleanOption("stackedGraph"),lt=u.getColors(),d={},ut=function(n,t,i,r){var u,f;if(n.lineTo(t,i),k)for(u=r.length-1;u>=0;u--)f=r[u],n.lineTo(f[0],f[1])},a=ht-1;a>=0;a--)if(r=t.drawingContext,v=l[a],u.getBooleanOption("fillGraph",v)){var y=u.getBooleanOption("stepPlot",v),at=lt[a],ft=u.axisPropertiesForSeries(v),f=1+ft.minyval*ft.yscale;0>f?f=0:f>1&&(f=1);f=h.h*f+h.y;var e,g=rt[a],et=Dygraph.createIterator(g,0,g.length,n._getIteratorPredicate(u.getBooleanOption("connectSeparatedPoints",v))),p=NaN,c=[-1,-1],nt=Dygraph.toRGB_(at),vt="rgba("+nt.r+","+nt.g+","+nt.b+","+ct+")";for(r.fillStyle=vt,r.beginPath(),tt=!0,(g.length>2*u.width_||Dygraph.FORCE_FAST_PROXY)&&(r=n._fastCanvasProxy(r)),o=[];et.hasNext;)if(i=et.next(),Dygraph.isOK(i.y)||y){if(k){if(!tt&&ot==i.xval)continue;tt=!1;ot=i.xval;s=d[i.canvasx];st=void 0===s?f:b?s[0]:s;e=[i.canvasy,st];d[i.canvasx]=y?-1===c[0]?[i.canvasy,f]:[i.canvasy,c[0]]:i.canvasy}else e=isNaN(i.canvasy)&&y?[h.y+h.h,f]:[i.canvasy,f];isNaN(p)?(r.moveTo(i.canvasx,e[1]),r.lineTo(i.canvasx,e[0])):(y?(r.lineTo(i.canvasx,c[0]),r.lineTo(i.canvasx,e[0])):r.lineTo(i.canvasx,e[0]),k&&(o.push([p,c[1]]),o.push(b&&s?[i.canvasx,s[1]]:[i.canvasx,e[1]])));c=e;p=i.canvasx}else ut(r,p,c[1],o),o=[],p=NaN,null===i.y_stacked||isNaN(i.y_stacked)||(d[i.canvasx]=h.h*i.y_stacked+h.y);b=y;e&&i&&(ut(r,i.canvasx,e[1],o),o=[]);r.fill()}}},n}(),Dygraph=function(){"use strict";var n=function(n,t,i,r){this.is_initial_draw_=!0;this.readyFns_=[];void 0!==r?(console.warn("Using deprecated four-argument dygraph constructor"),this.__old_init__(n,t,i,r)):this.__init__(n,t,i)};return n.NAME="Dygraph",n.VERSION="1.1.1",n.__repr__=function(){return"["+n.NAME+" "+n.VERSION+"]"},n.toString=function(){return n.__repr__()},n.DEFAULT_ROLL_PERIOD=1,n.DEFAULT_WIDTH=480,n.DEFAULT_HEIGHT=320,n.ANIMATION_STEPS=12,n.ANIMATION_DURATION=200,n.KMB_LABELS=["K","M","B","T","Q"],n.KMG2_BIG_LABELS=["k","M","G","T","P","E","Z","Y"],n.KMG2_SMALL_LABELS=["m","u","n","p","f","a","z","y"],n.numberValueFormatter=function(t,i){var v=i("sigFigs"),o,u,c,r;if(null!==v)return n.floatFormat(t,v);var f,e=i("digitsAfterDecimal"),y=i("maxNumberWidth"),s=i("labelsKMB"),h=i("labelsKMG2");if(f=0!==t&&(Math.abs(t)>=Math.pow(10,y)||Math.abs(t)<Math.pow(10,-e))?t.toExponential(e):""+n.round_(t,e),s||h){u=[];c=[];s&&(o=1e3,u=n.KMB_LABELS);h&&(s&&console.warn("Setting both labelsKMB and labelsKMG2. Pick one!"),o=1024,u=n.KMG2_BIG_LABELS,c=n.KMG2_SMALL_LABELS);for(var p=Math.abs(t),l=n.pow(o,u.length),a=u.length-1;a>=0;a--,l/=o)if(p>=l){f=n.round_(t/l,e)+u[a];break}h&&(r=String(t.toExponential()).split("e-"),2===r.length&&r[1]>=3&&r[1]<=24&&(f=r[1]%3>0?n.round_(r[0]/n.pow(10,r[1]%3),e):Number(r[0]).toFixed(2),f+=c[Math.floor(r[1]/3)-1]))}return f},n.numberAxisLabelFormatter=function(t,i,r){return n.numberValueFormatter.call(this,t,r)},n.SHORT_MONTH_NAMES_=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],n.dateAxisLabelFormatter=function(t,i,r){var l=r("labelsUTC"),u=l?n.DateAccessorsUTC:n.DateAccessorsLocal,f=u.getFullYear(t),e=u.getMonth(t),a=u.getDate(t),o=u.getHours(t),s=u.getMinutes(t),h=u.getSeconds(t),v=u.getSeconds(t),c;return i>=n.DECADAL?""+f:i>=n.MONTHLY?n.SHORT_MONTH_NAMES_[e]+"&#160;"+f:(c=3600*o+60*s+h+.001*v,0===c||i>=n.DAILY?n.zeropad(a)+"&#160;"+n.SHORT_MONTH_NAMES_[e]:n.hmsString_(o,s,h))},n.dateAxisFormatter=n.dateAxisLabelFormatter,n.dateValueFormatter=function(t,i){return n.dateString_(t,i("labelsUTC"))},n.Plotters=DygraphCanvasRenderer._Plotters,n.DEFAULT_ATTRS={highlightCircleSize:3,highlightSeriesOpts:null,highlightSeriesBackgroundAlpha:.5,labelsDivWidth:250,labelsDivStyles:{},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:n.dateParser,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,avoidMinZero:!1,xRangePad:0,yRangePad:null,drawAxesAtZero:!1,titleHeight:28,xLabelHeight:18,yLabelWidth:18,drawXAxis:!0,drawYAxis:!0,axisLineColor:"black",axisLineWidth:.3,gridLineWidth:.3,axisLabelColor:"black",axisLabelWidth:50,drawYGrid:!0,drawXGrid:!0,gridLineColor:"rgb(128,128,128)",interactionModel:null,animatedZooms:!1,showRangeSelector:!1,rangeSelectorHeight:40,rangeSelectorPlotStrokeColor:"#808FAB",rangeSelectorPlotFillColor:"#A7B1C4",showInRangeSelector:null,plotter:[n.Plotters.fillPlotter,n.Plotters.errorPlotter,n.Plotters.linePlotter],plugins:[],axes:{x:{pixelsPerLabel:70,axisLabelWidth:60,axisLabelFormatter:n.dateAxisLabelFormatter,valueFormatter:n.dateValueFormatter,drawGrid:!0,drawAxis:!0,independentTicks:!0,ticker:null},y:{axisLabelWidth:50,pixelsPerLabel:30,valueFormatter:n.numberValueFormatter,axisLabelFormatter:n.numberAxisLabelFormatter,drawGrid:!0,drawAxis:!0,independentTicks:!0,ticker:null},y2:{axisLabelWidth:50,pixelsPerLabel:30,valueFormatter:n.numberValueFormatter,axisLabelFormatter:n.numberAxisLabelFormatter,drawAxis:!0,drawGrid:!1,independentTicks:!1,ticker:null}}},n.HORIZONTAL=1,n.VERTICAL=2,n.PLUGINS=[],n.addedAnnotationCSS=!1,n.prototype.__old_init__=function(t,i,r,u){if(null!==r){for(var e=["Date"],f=0;f<r.length;f++)e.push(r[f]);n.update(u,{labels:e})}this.__init__(t,i,u)},n.prototype.__init__=function(t,i,r){var v,h,c,o,l,s,f,e,u,y,a;if(/MSIE/.test(navigator.userAgent)&&!window.opera&&"undefined"!=typeof G_vmlCanvasManager&&"complete"!=document.readyState)return v=this,void setTimeout(function(){v.__init__(t,i,r)},100);if((null===r||void 0===r)&&(r={}),r=n.mapLegacyOptions_(r),"string"==typeof t&&(t=document.getElementById(t)),!t)return void console.error("Constructing dygraph with a non-existent div!");for(this.isUsingExcanvas_="undefined"!=typeof G_vmlCanvasManager,this.maindiv_=t,this.file_=i,this.rollPeriod_=r.rollPeriod||n.DEFAULT_ROLL_PERIOD,this.previousVerticalX_=-1,this.fractions_=r.fractions||!1,this.dateWindow_=r.dateWindow||null,this.annotations_=[],this.zoomed_x_=!1,this.zoomed_y_=!1,t.innerHTML="",""===t.style.width&&r.width&&(t.style.width=r.width+"px"),""===t.style.height&&r.height&&(t.style.height=r.height+"px"),""===t.style.height&&0===t.clientHeight&&(t.style.height=n.DEFAULT_HEIGHT+"px",""===t.style.width&&(t.style.width=n.DEFAULT_WIDTH+"px")),this.width_=t.clientWidth||r.width||0,this.height_=t.clientHeight||r.height||0,r.stackedGraph&&(r.fillGraph=!0),this.user_attrs_={},n.update(this.user_attrs_,r),this.attrs_={},n.updateDeep(this.attrs_,n.DEFAULT_ATTRS),this.boundaryIds_=[],this.setIndexByName_={},this.datasetIndex_=[],this.registeredEvents_=[],this.eventListeners_={},this.attributes_=new DygraphOptions(this),this.createInterface_(),this.plugins_=[],h=n.PLUGINS.concat(this.getOption("plugins")),f=0;f<h.length;f++){o=h[f];c="undefined"!=typeof o.activate?o:new o;l={plugin:c,events:{},options:{},pluginOptions:{}};s=c.activate(this);for(u in s)s.hasOwnProperty(u)&&(l.events[u]=s[u]);this.plugins_.push(l)}for(f=0;f<this.plugins_.length;f++){e=this.plugins_[f];for(u in e.events)e.events.hasOwnProperty(u)&&(y=e.events[u],a=[e.plugin,y],u in this.eventListeners_?this.eventListeners_[u].push(a):this.eventListeners_[u]=[a])}this.createDragInterface_();this.start_()},n.prototype.cascadeEvents_=function(t,i){var r,u,f,e,o;if(!(t in this.eventListeners_))return!1;if(r={dygraph:this,cancelable:!1,defaultPrevented:!1,preventDefault:function(){if(!r.cancelable)throw"Cannot call preventDefault on non-cancelable event.";r.defaultPrevented=!0},propagationStopped:!1,stopPropagation:function(){r.propagationStopped=!0}},n.update(r,i),u=this.eventListeners_[t],u)for(f=u.length-1;f>=0;f--)if(e=u[f][0],o=u[f][1],o.call(e,r),r.propagationStopped)break;return r.defaultPrevented},n.prototype.getPluginInstance_=function(n){for(var i,t=0;t<this.plugins_.length;t++)if(i=this.plugins_[t],i.plugin instanceof n)return i.plugin;return null},n.prototype.isZoomed=function(n){if(null===n||void 0===n)return this.zoomed_x_||this.zoomed_y_;if("x"===n)return this.zoomed_x_;if("y"===n)return this.zoomed_y_;throw"axis parameter is ["+n+"] must be null, 'x' or 'y'.";},n.prototype.toString=function(){var n=this.maindiv_,t=n&&n.id?n.id:n;return"[Dygraph "+t+"]"},n.prototype.attr_=function(n,t){return t?this.attributes_.getForSeries(n,t):this.attributes_.get(n)},n.prototype.getOption=function(n,t){return this.attr_(n,t)},n.prototype.getNumericOption=function(n,t){return this.getOption(n,t)},n.prototype.getStringOption=function(n,t){return this.getOption(n,t)},n.prototype.getBooleanOption=function(n,t){return this.getOption(n,t)},n.prototype.getFunctionOption=function(n,t){return this.getOption(n,t)},n.prototype.getOptionForAxis=function(n,t){return this.attributes_.getForAxis(n,t)},n.prototype.optionsViewForAxis_=function(n){var t=this;return function(i){var r=t.user_attrs_.axes;return r&&r[n]&&r[n].hasOwnProperty(i)?r[n][i]:"x"===n&&"logscale"===i?!1:"undefined"!=typeof t.user_attrs_[i]?t.user_attrs_[i]:(r=t.attrs_.axes,r&&r[n]&&r[n].hasOwnProperty(i)?r[n][i]:"y"==n&&t.axes_[0].hasOwnProperty(i)?t.axes_[0][i]:"y2"==n&&t.axes_[1].hasOwnProperty(i)?t.axes_[1][i]:t.attr_(i))}},n.prototype.rollPeriod=function(){return this.rollPeriod_},n.prototype.xAxisRange=function(){return this.dateWindow_?this.dateWindow_:this.xAxisExtremes()},n.prototype.xAxisExtremes=function(){var n=this.getNumericOption("xRangePad")/this.plotter_.area.w,t,i,r;return 0===this.numRows()?[0-n,1+n]:(t=this.rawData_[0][0],i=this.rawData_[this.rawData_.length-1][0],n&&(r=i-t,t-=r*n,i+=r*n),[t,i])},n.prototype.yAxisRange=function(n){if("undefined"==typeof n&&(n=0),0>n||n>=this.axes_.length)return null;var t=this.axes_[n];return[t.computedValueRange[0],t.computedValueRange[1]]},n.prototype.yAxisRanges=function(){for(var t=[],n=0;n<this.axes_.length;n++)t.push(this.yAxisRange(n));return t},n.prototype.toDomCoords=function(n,t,i){return[this.toDomXCoord(n),this.toDomYCoord(t,i)]},n.prototype.toDomXCoord=function(n){if(null===n)return null;var i=this.plotter_.area,t=this.xAxisRange();return i.x+(n-t[0])/(t[1]-t[0])*i.w},n.prototype.toDomYCoord=function(n,t){var r=this.toPercentYCoord(n,t),i;return null===r?null:(i=this.plotter_.area,i.y+r*i.h)},n.prototype.toDataCoords=function(n,t,i){return[this.toDataXCoord(n),this.toDataYCoord(t,i)]},n.prototype.toDataXCoord=function(t){var r,i;if(null===t)return null;if(r=this.plotter_.area,i=this.xAxisRange(),this.attributes_.getForAxis("logscale","x")){var f=(t-r.x)/r.w,u=n.log10(i[0]),e=n.log10(i[1]),o=u+f*(e-u);return Math.pow(n.LOG_SCALE,o)}return i[0]+(t-r.x)/r.w*(i[1]-i[0])},n.prototype.toDataYCoord=function(t,i){var r,u;if(null===t)return null;if(r=this.plotter_.area,u=this.yAxisRange(i),"undefined"==typeof i&&(i=0),this.attributes_.getForAxis("logscale",i)){var e=(t-r.y)/r.h,o=n.log10(u[0]),f=n.log10(u[1]),s=f-e*(f-o);return Math.pow(n.LOG_SCALE,s)}return u[0]+(r.y+r.h-t)/r.h*(u[1]-u[0])},n.prototype.toPercentYCoord=function(t,i){var u,r,e,o,f;return null===t?null:("undefined"==typeof i&&(i=0),r=this.yAxisRange(i),e=this.attributes_.getForAxis("logscale",i),e?(o=n.log10(r[0]),f=n.log10(r[1]),u=(f-n.log10(t))/(f-o)):u=(r[1]-t)/(r[1]-r[0]),u)},n.prototype.toPercentXCoord=function(t){var r,i,f,u,e;return null===t?null:(i=this.xAxisRange(),f=this.attributes_.getForAxis("logscale","x"),f===!0?(u=n.log10(i[0]),e=n.log10(i[1]),r=(n.log10(t)-u)/(e-u)):r=(t-i[0])/(i[1]-i[0]),r)},n.prototype.numColumns=function(){return this.rawData_?this.rawData_[0]?this.rawData_[0].length:this.attr_("labels").length:0},n.prototype.numRows=function(){return this.rawData_?this.rawData_.length:0},n.prototype.getValue=function(n,t){return 0>n||n>this.rawData_.length?null:0>t||t>this.rawData_[n].length?null:this.rawData_[n][t]},n.prototype.createInterface_=function(){var i=this.maindiv_,t;this.graphDiv=document.createElement("div");this.graphDiv.style.textAlign="left";this.graphDiv.style.position="relative";i.appendChild(this.graphDiv);this.canvas_=n.createCanvas();this.canvas_.style.position="absolute";this.hidden_=this.createPlotKitCanvas_(this.canvas_);this.canvas_ctx_=n.getContext(this.canvas_);this.hidden_ctx_=n.getContext(this.hidden_);this.resizeElements_();this.graphDiv.appendChild(this.hidden_);this.graphDiv.appendChild(this.canvas_);this.mouseEventElement_=this.createMouseEventElement_();this.layout_=new DygraphLayout(this);t=this;this.mouseMoveHandler_=function(n){t.mouseMove_(n)};this.mouseOutHandler_=function(i){var r=i.target||i.fromElement,u=i.relatedTarget||i.toElement;n.isNodeContainedBy(r,t.graphDiv)&&!n.isNodeContainedBy(u,t.graphDiv)&&t.mouseOut_(i)};this.addAndTrackEvent(window,"mouseout",this.mouseOutHandler_);this.addAndTrackEvent(this.mouseEventElement_,"mousemove",this.mouseMoveHandler_);this.resizeHandler_||(this.resizeHandler_=function(){t.resize()},this.addAndTrackEvent(window,"resize",this.resizeHandler_))},n.prototype.resizeElements_=function(){var t,i;this.graphDiv.style.width=this.width_+"px";this.graphDiv.style.height=this.height_+"px";t=n.getContextPixelRatio(this.canvas_ctx_);this.canvas_.width=this.width_*t;this.canvas_.height=this.height_*t;this.canvas_.style.width=this.width_+"px";this.canvas_.style.height=this.height_+"px";1!==t&&this.canvas_ctx_.scale(t,t);i=n.getContextPixelRatio(this.hidden_ctx_);this.hidden_.width=this.width_*i;this.hidden_.height=this.height_*i;this.hidden_.style.width=this.width_+"px";this.hidden_.style.height=this.height_+"px";1!==i&&this.hidden_ctx_.scale(i,i)},n.prototype.destroy=function(){var i,r,u,t;for(this.canvas_ctx_.restore(),this.hidden_ctx_.restore(),i=this.plugins_.length-1;i>=0;i--)r=this.plugins_.pop(),r.plugin.destroy&&r.plugin.destroy();u=function(n){for(;n.hasChildNodes();)u(n.firstChild),n.removeChild(n.firstChild)};this.removeTrackedEvents_();n.removeEvent(window,"mouseout",this.mouseOutHandler_);n.removeEvent(this.mouseEventElement_,"mousemove",this.mouseMoveHandler_);n.removeEvent(window,"resize",this.resizeHandler_);this.resizeHandler_=null;u(this.maindiv_);t=function(n){for(var t in n)"object"==typeof n[t]&&(n[t]=null)};t(this.layout_);t(this.plotter_);t(this)},n.prototype.createPlotKitCanvas_=function(t){var i=n.createCanvas();return i.style.position="absolute",i.style.top=t.style.top,i.style.left=t.style.left,i.width=this.width_,i.height=this.height_,i.style.width=this.width_+"px",i.style.height=this.height_+"px",i},n.prototype.createMouseEventElement_=function(){if(this.isUsingExcanvas_){var n=document.createElement("div");return n.style.position="absolute",n.style.backgroundColor="white",n.style.filter="alpha(opacity=0)",n.style.width=this.width_+"px",n.style.height=this.height_+"px",this.graphDiv.appendChild(n),n}return this.canvas_},n.prototype.setColors_=function(){var e=this.getLabels(),r=e.length-1,f,i,o,s;this.colors_=[];this.colorsMap_={};for(var h=this.getNumericOption("colorSaturation")||1,c=this.getNumericOption("colorValue")||.5,l=Math.ceil(r/2),u=this.getOption("colors"),a=this.visibility(),t=0;r>t;t++)a[t]&&(f=e[t+1],i=this.attributes_.getForSeries("color",f),i||(u?i=u[t%u.length]:(o=t%2?l+(t+1)/2:Math.ceil((t+1)/2),s=1*o/(1+r),i=n.hsvToRGB(s,h,c))),this.colors_.push(i),this.colorsMap_[f]=i)},n.prototype.getColors=function(){return this.colors_},n.prototype.getPropertiesForSeries=function(n){for(var t=-1,r=this.getLabels(),i=1;i<r.length;i++)if(r[i]==n){t=i;break}return-1==t?null:{name:n,column:t,visible:this.visibility()[t-1],color:this.colorsMap_[n],axis:1+this.attributes_.axisForSeries(n)}},n.prototype.createRollInterface_=function(){var n,r;this.roller_||(this.roller_=document.createElement("input"),this.roller_.type="text",this.roller_.style.display="none",this.graphDiv.appendChild(this.roller_));var u=this.getBooleanOption("showRoller")?"block":"none",t=this.plotter_.area,i={position:"absolute",zIndex:10,top:t.y+t.h-25+"px",left:t.x+1+"px",display:u};this.roller_.size="2";this.roller_.value=this.rollPeriod_;for(n in i)i.hasOwnProperty(n)&&(this.roller_.style[n]=i[n]);r=this;this.roller_.onchange=function(){r.adjustRoll(r.roller_.value)}},n.prototype.createDragInterface_=function(){var u={isZooming:!1,isPanning:!1,is2DPan:!1,dragStartX:null,dragStartY:null,dragEndX:null,dragEndY:null,dragDirection:null,prevEndX:null,prevEndY:null,prevDragDirection:null,cancelNextDblclick:!1,initialLeftmostDate:null,xUnitsPerPixel:null,dateRange:null,px:0,py:0,boundedDates:null,boundedValues:null,tarp:new n.IFrameTarp,initializeMouseDown:function(t,i,r){t.preventDefault?t.preventDefault():(t.returnValue=!1,t.cancelBubble=!0);var u=n.findPos(i.canvas_);r.px=u.x;r.py=u.y;r.dragStartX=n.dragGetX_(t,r);r.dragStartY=n.dragGetY_(t,r);r.cancelNextDblclick=!1;r.tarp.cover()},destroy:function(){var n=this,t;if((n.isZooming||n.isPanning)&&(n.isZooming=!1,n.dragStartX=null,n.dragStartY=null),n.isPanning)for(n.isPanning=!1,n.draggingDate=null,n.dateRange=null,t=0;t<i.axes_.length;t++)delete i.axes_[t].draggingValue,delete i.axes_[t].dragValueRange;n.tarp.uncover()}},t=this.getOption("interactionModel"),i=this,e=function(n){return function(t){n(t,i,u)}},r,f;for(r in t)t.hasOwnProperty(r)&&this.addAndTrackEvent(this.mouseEventElement_,r,e(t[r]));t.willDestroyContextMyself||(f=function(){u.destroy()},this.addAndTrackEvent(document,"mouseup",f))},n.prototype.drawZoomRect_=function(t,i,r,u,f,e,o,s){var h=this.canvas_ctx_;e==n.HORIZONTAL?h.clearRect(Math.min(i,o),this.layout_.getPlotArea().y,Math.abs(i-o),this.layout_.getPlotArea().h):e==n.VERTICAL&&h.clearRect(this.layout_.getPlotArea().x,Math.min(u,s),this.layout_.getPlotArea().w,Math.abs(u-s));t==n.HORIZONTAL?r&&i&&(h.fillStyle="rgba(128,128,128,0.33)",h.fillRect(Math.min(i,r),this.layout_.getPlotArea().y,Math.abs(r-i),this.layout_.getPlotArea().h)):t==n.VERTICAL&&f&&u&&(h.fillStyle="rgba(128,128,128,0.33)",h.fillRect(this.layout_.getPlotArea().x,Math.min(u,f),this.layout_.getPlotArea().w,Math.abs(f-u)));this.isUsingExcanvas_&&(this.currentZoomRectArgs_=[t,i,r,u,f,0,0,0])},n.prototype.clearZoomRect_=function(){this.currentZoomRectArgs_=null;this.canvas_ctx_.clearRect(0,0,this.width_,this.height_)},n.prototype.doZoomX_=function(n,t){this.currentZoomRectArgs_=null;var i=this.toDataXCoord(n),r=this.toDataXCoord(t);this.doZoomXDates_(i,r)},n.prototype.doZoomXDates_=function(n,t){var r=this.xAxisRange(),u=[n,t],i;this.zoomed_x_=!0;i=this;this.doAnimatedZoom(r,u,null,null,function(){i.getFunctionOption("zoomCallback")&&i.getFunctionOption("zoomCallback").call(i,n,t,i.yAxisRanges())})},n.prototype.doZoomY_=function(n,t){var f,e,i;this.currentZoomRectArgs_=null;for(var o=this.yAxisRanges(),u=[],r=0;r<this.axes_.length;r++)f=this.toDataYCoord(n,r),e=this.toDataYCoord(t,r),u.push([e,f]);this.zoomed_y_=!0;i=this;this.doAnimatedZoom(null,null,o,u,function(){if(i.getFunctionOption("zoomCallback")){var n=i.xAxisRange();i.getFunctionOption("zoomCallback").call(i,n[0],n[1],i.yAxisRanges())}})},n.zoomAnimationFunction=function(n,t){var i=1.5;return(1-Math.pow(i,-n))/(1-Math.pow(i,-t))},n.prototype.resetZoom=function(){var f=!1,o=!1,s=!1,n,r,u,a,v,i,t;for(null!==this.dateWindow_&&(f=!0,o=!0),n=0;n<this.axes_.length;n++)"undefined"!=typeof this.axes_[n].valueWindow&&null!==this.axes_[n].valueWindow&&(f=!0,s=!0);if(this.clearSelection(),f){if(this.zoomed_x_=!1,this.zoomed_y_=!1,r=this.rawData_[0][0],u=this.rawData_[this.rawData_.length-1][0],!this.getBooleanOption("animatedZooms")){for(this.dateWindow_=null,n=0;n<this.axes_.length;n++)null!==this.axes_[n].valueWindow&&delete this.axes_[n].valueWindow;return this.drawGraph_(),void(this.getFunctionOption("zoomCallback")&&this.getFunctionOption("zoomCallback").call(this,r,u,this.yAxisRanges()))}var h=null,c=null,l=null,e=null;if(o&&(h=this.xAxisRange(),c=[r,u]),s)for(l=this.yAxisRanges(),a=this.gatherDatasets_(this.rolledSeries_,null),v=a.extremes,this.computeYAxisRanges_(v),e=[],n=0;n<this.axes_.length;n++)i=this.axes_[n],e.push(null!==i.valueRange&&void 0!==i.valueRange?i.valueRange:i.extremeRange);t=this;this.doAnimatedZoom(h,c,l,e,function(){t.dateWindow_=null;for(var n=0;n<t.axes_.length;n++)null!==t.axes_[n].valueWindow&&delete t.axes_[n].valueWindow;t.getFunctionOption("zoomCallback")&&t.getFunctionOption("zoomCallback").call(t,r,u,t.yAxisRanges())})}},n.prototype.doAnimatedZoom=function(t,i,r,u,f){var e,o,h=this.getBooleanOption("animatedZooms")?n.ANIMATION_STEPS:1,l=[],a=[],v,s,c;if(null!==t&&null!==i)for(e=1;h>=e;e++)o=n.zoomAnimationFunction(e,h),l[e-1]=[t[0]*(1-o)+o*i[0],t[1]*(1-o)+o*i[1]];if(null!==r&&null!==u)for(e=1;h>=e;e++){for(o=n.zoomAnimationFunction(e,h),v=[],s=0;s<this.axes_.length;s++)v.push([r[s][0]*(1-o)+o*u[s][0],r[s][1]*(1-o)+o*u[s][1]]);a[e-1]=v}c=this;n.repeatAndCleanup(function(n){var t,i;if(a.length)for(t=0;t<c.axes_.length;t++)i=a[n][t],c.axes_[t].valueWindow=[i[0],i[1]];l.length&&(c.dateWindow_=l[n]);c.drawGraph_()},h,n.ANIMATION_DURATION/h,f)},n.prototype.getArea=function(){return this.plotter_.area},n.prototype.eventToDomCoords=function(t){if(t.offsetX&&t.offsetY)return[t.offsetX,t.offsetY];var i=n.findPos(this.mouseEventElement_),r=n.pageX(t)-i.x,u=n.pageY(t)-i.y;return[r,u]},n.prototype.findClosestRow=function(t){for(var i,f,e=1/0,o=-1,s=this.layout_.points,r=0;r<s.length;r++)for(var h=s[r],c=h.length,u=0;c>u;u++)i=h[u],n.isValidPoint(i,!0)&&(f=Math.abs(i.canvasx-t),e>f&&(e=f,o=i.idx));return o},n.prototype.findClosestPoint=function(t,i){for(var e,o,s,r,l,a,v,c,f,y,h=1/0,u=this.layout_.points.length-1;u>=0;--u)for(c=this.layout_.points[u],f=0;f<c.length;++f)r=c[f],n.isValidPoint(r)&&(o=r.canvasx-t,s=r.canvasy-i,e=o*o+s*s,h>e&&(h=e,l=r,a=u,v=r.idx));return y=this.layout_.setNames[a],{row:v,seriesName:y,point:l}},n.prototype.findStackedPoint=function(t,i){for(var v,y,r,s,h,l,e,c,p,a=this.findClosestRow(t),u=0;u<this.layout_.points.length;++u){var w=this.getLeftBoundary_(u),f=a-w,o=this.layout_.points[u];f>=o.length||(r=o[f],n.isValidPoint(r)&&(s=r.canvasy,t>r.canvasx&&f+1<o.length?(h=o[f+1],n.isValidPoint(h)&&(e=h.canvasx-r.canvasx,e>0&&(c=(t-r.canvasx)/e,s+=c*(h.canvasy-r.canvasy)))):t<r.canvasx&&f>0&&(l=o[f-1],n.isValidPoint(l)&&(e=r.canvasx-l.canvasx,e>0&&(c=(r.canvasx-t)/e,s+=c*(l.canvasy-r.canvasy)))),(0===u||i>s)&&(v=r,y=u)))}return p=this.layout_.setNames[y],{row:a,seriesName:p,point:v}},n.prototype.mouseMove_=function(n){var f=this.layout_.points,r,s,u;if(void 0!==f&&null!==f){var e=this.eventToDomCoords(n),t=e[0],o=e[1],h=this.getOption("highlightSeriesOpts"),i=!1;h&&!this.isSeriesLocked()?(r=this.getBooleanOption("stackedGraph")?this.findStackedPoint(t,o):this.findClosestPoint(t,o),i=this.setSelection(r.row,r.seriesName)):(s=this.findClosestRow(t),i=this.setSelection(s));u=this.getFunctionOption("highlightCallback");u&&i&&u.call(this,n,this.lastx_,this.selPoints_,this.lastRow_,this.highlightSet_)}},n.prototype.getLeftBoundary_=function(n){if(this.boundaryIds_[n])return this.boundaryIds_[n][0];for(var t=0;t<this.boundaryIds_.length;t++)if(void 0!==this.boundaryIds_[t])return this.boundaryIds_[t][0];return 0},n.prototype.animateSelection_=function(t){var f=10,r,u,e,i;if(void 0===this.fadeLevel&&(this.fadeLevel=0),void 0===this.animateId&&(this.animateId=0),r=this.fadeLevel,u=0>t?r:f-r,0>=u)return void(this.fadeLevel&&this.updateSelection_(1));e=++this.animateId;i=this;n.repeatAndCleanup(function(){i.animateId==e&&(i.fadeLevel+=t,0===i.fadeLevel?i.clearSelection():i.updateSelection_(i.fadeLevel/f))},u,30,function(){})},n.prototype.updateSelection_=function(t){var u,i,e,a,f,o,s,v,h,r;if(this.cascadeEvents_("select",{selectedRow:this.lastRow_,selectedX:this.lastx_,selectedPoints:this.selPoints_}),i=this.canvas_ctx_,this.getOption("highlightSeriesOpts")){if(i.clearRect(0,0,this.width_,this.height_),e=1-this.getNumericOption("highlightSeriesBackgroundAlpha"),e){if(a=!0,a){if(void 0===t)return void this.animateSelection_(1);e*=t}i.fillStyle="rgba(255,255,255,"+e+")";i.fillRect(0,0,this.width_,this.height_)}this.plotter_._renderLineChart(this.highlightSet_,i)}else if(this.previousVerticalX_>=0){for(f=0,o=this.attr_("labels"),u=1;u<o.length;u++)s=this.getNumericOption("highlightCircleSize",o[u]),s>f&&(f=s);v=this.previousVerticalX_;i.clearRect(v-f-1,0,2*f+2,this.height_)}if(this.isUsingExcanvas_&&this.currentZoomRectArgs_&&n.prototype.drawZoomRect_.apply(this,this.currentZoomRectArgs_),this.selPoints_.length>0){for(h=this.selPoints_[0].canvasx,i.save(),u=0;u<this.selPoints_.length;u++)if(r=this.selPoints_[u],n.isOK(r.canvasy)){var y=this.getNumericOption("highlightCircleSize",r.name),c=this.getFunctionOption("drawHighlightPointCallback",r.name),l=this.plotter_.colors[r.name];c||(c=n.Circles.DEFAULT);i.lineWidth=this.getNumericOption("strokeWidth",r.name);i.strokeStyle=l;i.fillStyle=l;c.call(this,this,r.name,i,h,r.canvasy,l,y,r.idx)}i.restore();this.previousVerticalX_=h}},n.prototype.setSelection=function(n,t,i){var u,e,f,o,s,r;if(this.selPoints_=[],u=!1,n!==!1&&n>=0){for(n!=this.lastRow_&&(u=!0),this.lastRow_=n,e=0;e<this.layout_.points.length;++e)if(f=this.layout_.points[e],o=n-this.getLeftBoundary_(e),o<f.length&&f[o].idx==n)r=f[o],null!==r.yval&&this.selPoints_.push(r);else for(s=0;s<f.length;++s)if(r=f[s],r.idx==n){null!==r.yval&&this.selPoints_.push(r);break}}else this.lastRow_>=0&&(u=!0),this.lastRow_=-1;return this.lastx_=this.selPoints_.length?this.selPoints_[0].xval:-1,void 0!==t&&(this.highlightSet_!==t&&(u=!0),this.highlightSet_=t),void 0!==i&&(this.lockedSet_=i),u&&this.updateSelection_(void 0),u},n.prototype.mouseOut_=function(n){this.getFunctionOption("unhighlightCallback")&&this.getFunctionOption("unhighlightCallback").call(this,n);this.getBooleanOption("hideOverlayOnMouseOut")&&!this.lockedSet_&&this.clearSelection()},n.prototype.clearSelection=function(){return this.cascadeEvents_("deselect",{}),this.lockedSet_=!1,this.fadeLevel?void this.animateSelection_(-1):(this.canvas_ctx_.clearRect(0,0,this.width_,this.height_),this.fadeLevel=0,this.selPoints_=[],this.lastx_=-1,this.lastRow_=-1,void(this.highlightSet_=null))},n.prototype.getSelection=function(){var t,i,n;if(!this.selPoints_||this.selPoints_.length<1)return-1;for(t=0;t<this.layout_.points.length;t++)for(i=this.layout_.points[t],n=0;n<i.length;n++)if(i[n].x==this.selPoints_[0].x)return i[n].idx;return-1},n.prototype.getHighlightSeries=function(){return this.highlightSet_},n.prototype.isSeriesLocked=function(){return this.lockedSet_},n.prototype.loadedEvent_=function(n){this.rawData_=this.parseCSV_(n);this.cascadeDataDidUpdateEvent_();this.predraw_()},n.prototype.addXTicks_=function(){var n,t,i;n=this.dateWindow_?[this.dateWindow_[0],this.dateWindow_[1]]:this.xAxisExtremes();t=this.optionsViewForAxis_("x");i=t("ticker")(n[0],n[1],this.plotter_.area.w,t,this);this.layout_.setXTicks(i)},n.prototype.getHandlerClass_=function(){return this.attr_("dataHandler")?this.attr_("dataHandler"):this.fractions_?this.getBooleanOption("errorBars")?n.DataHandlers.FractionsBarsHandler:n.DataHandlers.DefaultFractionHandler:this.getBooleanOption("customBars")?n.DataHandlers.CustomBarsHandler:this.getBooleanOption("errorBars")?n.DataHandlers.ErrorBarsHandler:n.DataHandlers.DefaultHandler},n.prototype.predraw_=function(){var r=new Date,n,t,i;for(this.dataHandler_=new(this.getHandlerClass_()),this.layout_.computePlotArea(),this.computeYAxes_(),this.is_initial_draw_||(this.canvas_ctx_.restore(),this.hidden_ctx_.restore()),this.canvas_ctx_.save(),this.hidden_ctx_.save(),this.plotter_=new DygraphCanvasRenderer(this,this.hidden_,this.hidden_ctx_,this.layout_),this.createRollInterface_(),this.cascadeEvents_("predraw"),this.rolledSeries_=[null],n=1;n<this.numColumns();n++)t=this.dataHandler_.extractSeries(this.rawData_,n,this.attributes_),this.rollPeriod_>1&&(t=this.dataHandler_.rollingAverage(t,this.rollPeriod_,this.attributes_)),this.rolledSeries_.push(t);this.drawGraph_();i=new Date;this.drawingTimeMs_=i-r},n.PointType=void 0,n.stackPoints_=function(n,t,i,r){for(var h,f,s,e,l=null,u=null,o=null,a=-1,v=function(t){if(!(a>=t))for(var i=t;i<n.length;++i)if(o=null,!isNaN(n[i].yval)&&null!==n[i].yval){a=i;o=n[i];break}},c=0;c<n.length;++c)h=n[c],f=h.xval,void 0===t[f]&&(t[f]=0),s=h.yval,isNaN(s)||null===s?"none"==r?s=0:(v(c),s=u&&o&&"none"!=r?u.yval+(o.yval-u.yval)*((f-u.xval)/(o.xval-u.xval)):u&&"all"==r?u.yval:o&&"all"==r?o.yval:0):u=h,e=t[f],l!=f&&(e+=s,t[f]=e),l=f,h.yval_stacked=e,e>i[1]&&(i[1]=e),e<i[0]&&(i[0]=e)},n.prototype.gatherDatasets_=function(t,i){for(var o,f,e,l,r,a=[],p=[],y=[],w={},nt=t.length-1,b,k,s,h,c,u=nt;u>=1;u--)if(this.visibility()[u-1]){if(i){for(r=t[u],b=i[0],k=i[1],f=null,e=null,o=0;o<r.length;o++)r[o][0]>=b&&null===f&&(f=o),r[o][0]<=k&&(e=o);for(null===f&&(f=0),s=f,h=!0;h&&s>0;)s--,h=null===r[s][1];for(null===e&&(e=r.length-1),c=e,h=!0;h&&c<r.length-1;)c++,h=null===r[c][1];s!==f&&(f=s);c!==e&&(e=c);a[u-1]=[f,e];r=r.slice(f,e+1)}else r=t[u],a[u-1]=[0,r.length-1];var v=this.attr_("labels")[u],d=this.dataHandler_.getExtremeYValues(r,i,this.getBooleanOption("stepPlot",v)),g=this.dataHandler_.seriesToPoints(r,v,a[u-1][0]);this.getBooleanOption("stackedGraph")&&(l=this.attributes_.axisForSeries(v),void 0===y[l]&&(y[l]=[]),n.stackPoints_(g,y[l],d,this.getBooleanOption("stackedGraphNaNFill")));w[v]=d;p[u]=g}return{points:p,extremes:w,boundaryIds:a}},n.prototype.drawGraph_=function(){var o=new Date,s=this.is_initial_draw_,t,u,n,f,e;this.is_initial_draw_=!1;this.layout_.removeAllDatasets();this.setColors_();this.attrs_.pointSize=.5*this.getNumericOption("highlightCircleSize");var i=this.gatherDatasets_(this.rolledSeries_,this.dateWindow_),r=i.points,h=i.extremes;for(this.boundaryIds_=i.boundaryIds,this.setIndexByName_={},t=this.attr_("labels"),t.length>0&&(this.setIndexByName_[t[0]]=0),u=0,n=1;n<r.length;n++)this.setIndexByName_[t[n]]=n,this.visibility()[n-1]&&(this.layout_.addDataset(t[n],r[n]),this.datasetIndex_[n]=u++);this.computeYAxisRanges_(h);this.layout_.setYAxes(this.axes_);this.addXTicks_();f=this.zoomed_x_;(this.zoomed_x_=f,this.layout_.evaluate(),this.renderGraph_(s),this.getStringOption("timingName"))&&(e=new Date,console.log(this.getStringOption("timingName")+" - drawGraph: "+(e-o)+"ms"))},n.prototype.renderGraph_=function(n){var t,i;if(this.cascadeEvents_("clearChart"),this.plotter_.clear(),this.getFunctionOption("underlayCallback")&&this.getFunctionOption("underlayCallback").call(this,this.hidden_ctx_,this.layout_.getPlotArea(),this,this),t={canvas:this.hidden_,drawingContext:this.hidden_ctx_},this.cascadeEvents_("willDrawChart",t),this.plotter_.render(),this.cascadeEvents_("didDrawChart",t),this.lastRow_=-1,this.canvas_.getContext("2d").clearRect(0,0,this.width_,this.height_),null!==this.getFunctionOption("drawCallback")&&this.getFunctionOption("drawCallback").call(this,this,n),n)for(this.readyFired_=!0;this.readyFns_.length>0;)i=this.readyFns_.pop(),i(this)},n.prototype.computeYAxes_=function(){var u,t,i,f,r,o,e;if(void 0!==this.axes_&&this.user_attrs_.hasOwnProperty("valueRange")===!1)for(u=[],i=0;i<this.axes_.length;i++)u.push(this.axes_[i].valueWindow);for(this.axes_=[],t=0;t<this.attributes_.numAxes();t++)f={g:this},n.update(f,this.attributes_.axisOptions(t)),this.axes_[t]=f;if(r=this.attr_("valueRange"),r&&(this.axes_[0].valueRange=r),void 0!==u)for(o=Math.min(u.length,this.axes_.length),i=0;o>i;i++)this.axes_[i].valueWindow=u[i];for(t=0;t<this.axes_.length;t++)0===t?(f=this.optionsViewForAxis_("y"+(t?"2":"")),r=f("valueRange"),r&&(this.axes_[t].valueRange=r)):(e=this.user_attrs_.axes,e&&e.y2&&(r=e.y2.valueRange,r&&(this.axes_[t].valueRange=r)))},n.prototype.numAxes=function(){return this.attributes_.numAxes()},n.prototype.axisPropertiesForSeries=function(n){return this.axes_[this.attributes_.axisForSeries(n)]},n.prototype.computeYAxisRanges_=function(n){for(var h,c,y,p,l,w,d,t,et,ot,a,u,s,e,o,nt=function(n){return isNaN(parseFloat(n))},tt=this.attributes_.numAxes(),r=0;tt>r;r++){var t=this.axes_[r],it=this.attributes_.getForAxis("logscale",r),st=this.attributes_.getForAxis("includeZero",r),rt=this.attributes_.getForAxis("independentTicks",r);if(s=this.attributes_.seriesForAxis(r),a=!0,e=.1,null!==this.getNumericOption("yRangePad")&&(a=!1,e=this.getNumericOption("yRangePad")/this.plotter_.area.h),0===s.length)t.extremeRange=[0,1];else{for(var b,k,f=1/0,i=-(1/0),v=0;v<s.length;v++)n.hasOwnProperty(s[v])&&(b=n[s[v]][0],null!==b&&(f=Math.min(b,f)),k=n[s[v]][1],null!==k&&(i=Math.max(k,i)));st&&!it&&(f>0&&(f=0),0>i&&(i=0));f==1/0&&(f=0);i==-(1/0)&&(i=1);u=i-f;0===u&&(0!==i?u=Math.abs(i):(i=1,u=1));it?a?(h=i+e*u,c=f):(l=Math.exp(Math.log(u)*e),h=i*l,c=f/l):(h=i+e*u,c=f-e*u,a&&!this.getBooleanOption("avoidMinZero")&&(0>c&&f>=0&&(c=0),h>0&&0>=i&&(h=0)));t.extremeRange=[c,h]}t.valueWindow?t.computedValueRange=[t.valueWindow[0],t.valueWindow[1]]:t.valueRange?(y=nt(t.valueRange[0])?t.extremeRange[0]:t.valueRange[0],p=nt(t.valueRange[1])?t.extremeRange[1]:t.valueRange[1],a||(t.logscale?(l=Math.exp(Math.log(u)*e),y*=l,p/=l):(u=p-y,y-=u*e,p+=u*e)),t.computedValueRange=[y,p]):t.computedValueRange=t.extremeRange;rt&&(t.independentTicks=rt,w=this.optionsViewForAxis_("y"+(r?"2":"")),d=w("ticker"),t.ticks=d(t.computedValueRange[0],t.computedValueRange[1],this.plotter_.area.h,w,this),o||(o=t))}if(void 0===o)throw'Configuration Error: At least one axis has to have the "independentTicks" option activated.';for(r=0;tt>r;r++)if(t=this.axes_[r],!t.independentTicks){for(var w=this.optionsViewForAxis_("y"+(r?"2":"")),d=w("ticker"),ut=o.ticks,ht=o.computedValueRange[1]-o.computedValueRange[0],ct=t.computedValueRange[1]-t.computedValueRange[0],ft=[],g=0;g<ut.length;g++)et=(ut[g].v-o.computedValueRange[0])/ht,ot=t.computedValueRange[0]+et*ct,ft.push(ot);t.ticks=d(t.computedValueRange[0],t.computedValueRange[1],this.plotter_.area.h,w,this,ft)}},n.prototype.detectTypeFromString_=function(n){var t=!1,i=n.indexOf("-");i>0&&"e"!=n[i-1]&&"E"!=n[i-1]||n.indexOf("/")>=0||isNaN(parseFloat(n))?t=!0:8==n.length&&n>"19700101"&&"20371231">n&&(t=!0);this.setXAxisOptions_(t)},n.prototype.setXAxisOptions_=function(t){t?(this.attrs_.xValueParser=n.dateParser,this.attrs_.axes.x.valueFormatter=n.dateValueFormatter,this.attrs_.axes.x.ticker=n.dateTicker,this.attrs_.axes.x.axisLabelFormatter=n.dateAxisLabelFormatter):(this.attrs_.xValueParser=function(n){return parseFloat(n)},this.attrs_.axes.x.valueFormatter=function(n){return n},this.attrs_.axes.x.ticker=n.numericTicks,this.attrs_.axes.x.axisLabelFormatter=this.attrs_.axes.x.valueFormatter)},n.prototype.parseCSV_=function(t){var o,i,s=[],k=n.detectLineDelimiter(t),h=t.split(k||"\n"),c=this.getStringOption("delimiter"),v,u,f,e,l,a;-1==h[0].indexOf(c)&&h[0].indexOf("\t")>=0&&(c="\t");v=0;"labels"in this.user_attrs_||(v=1,this.attrs_.labels=h[0].split(c),this.attributes_.reparseSeries());for(var y,d=0,p=!1,w=this.attr_("labels").length,b=!1,r=v;r<h.length;r++)if(u=h[r],(d=r,0!==u.length&&"#"!=u[0])&&(f=u.split(c),!(f.length<2))){if(e=[],p||(this.detectTypeFromString_(f[0]),y=this.getFunctionOption("xValueParser"),p=!0),e[0]=y(f[0],this),this.fractions_)for(i=1;i<f.length;i++)o=f[i].split("/"),2!=o.length?(console.error('Expected fractional "num/den" values in CSV data but found a value \''+f[i]+"' on line "+(1+r)+" ('"+u+"') which is not of this form."),e[i]=[0,0]):e[i]=[n.parseFloat_(o[0],r,u),n.parseFloat_(o[1],r,u)];else if(this.getBooleanOption("errorBars"))for(f.length%2!=1&&console.error("Expected alternating (value, stdev.) pairs in CSV data but line "+(1+r)+" has an odd number of values ("+(f.length-1)+"): '"+u+"'"),i=1;i<f.length;i+=2)e[(i+1)/2]=[n.parseFloat_(f[i],r,u),n.parseFloat_(f[i+1],r,u)];else if(this.getBooleanOption("customBars"))for(i=1;i<f.length;i++)l=f[i],/^ *$/.test(l)?e[i]=[null,null,null]:(o=l.split(";"),3==o.length?e[i]=[n.parseFloat_(o[0],r,u),n.parseFloat_(o[1],r,u),n.parseFloat_(o[2],r,u)]:console.warn('When using customBars, values must be either blank or "low;center;high" tuples (got "'+l+'" on line '+(1+r)));else for(i=1;i<f.length;i++)e[i]=n.parseFloat_(f[i],r,u);if(s.length>0&&e[0]<s[s.length-1][0]&&(b=!0),e.length!=w&&console.error("Number of columns in line "+r+" ("+e.length+") does not agree with number of labels ("+w+") "+u),0===r&&this.attr_("labels")){for(a=!0,i=0;a&&i<e.length;i++)e[i]&&(a=!1);if(a){console.warn("The dygraphs 'labels' option is set, but the first row of CSV data ('"+u+"') appears to also contain labels. Will drop the CSV labels and use the option labels.");continue}}s.push(e)}return b&&(console.warn("CSV is out of order; order it correctly to speed loading."),s.sort(function(n,t){return n[0]-t[0]})),s},n.prototype.parseArray_=function(t){var i,u,r;if(0===t.length)return console.error("Can't plot empty data set"),null;if(0===t[0].length)return console.error("Data set cannot contain an empty row"),null;if(null===this.attr_("labels")){for(console.warn("Using default labels. Set labels explicitly via 'labels' in the options parameter"),this.attrs_.labels=["X"],i=1;i<t[0].length;i++)this.attrs_.labels.push("Y"+i);this.attributes_.reparseSeries()}else if(u=this.attr_("labels"),u.length!=t[0].length)return console.error("Mismatch between number of labels ("+u+") and number of columns in array ("+t[0].length+")"),null;if(n.isDateLike(t[0][0])){for(this.attrs_.axes.x.valueFormatter=n.dateValueFormatter,this.attrs_.axes.x.ticker=n.dateTicker,this.attrs_.axes.x.axisLabelFormatter=n.dateAxisLabelFormatter,r=n.clone(t),i=0;i<t.length;i++){if(0===r[i].length)return console.error("Row "+(1+i)+" of data is empty"),null;if(null===r[i][0]||"function"!=typeof r[i][0].getTime||isNaN(r[i][0].getTime()))return console.error("x value in row "+(1+i)+" is not a Date"),null;r[i][0]=r[i][0].getTime()}return r}return this.attrs_.axes.x.valueFormatter=function(n){return n},this.attrs_.axes.x.ticker=n.numericTicks,this.attrs_.axes.x.axisLabelFormatter=n.numberAxisLabelFormatter,t},n.prototype.parseDataTable_=function(t){var d=function(n){var t=String.fromCharCode(65+n%26);for(n=Math.floor(n/26);n>0;)t=String.fromCharCode(65+(n-1)%26)+t.toLowerCase(),n=Math.floor((n-1)/26);return t},p=t.getNumberOfColumns(),g=t.getNumberOfRows(),h=t.getColumnType(0),w,a,v,u,s,f,l;if("date"==h||"datetime"==h)this.attrs_.xValueParser=n.dateParser,this.attrs_.axes.x.valueFormatter=n.dateValueFormatter,this.attrs_.axes.x.ticker=n.dateTicker,this.attrs_.axes.x.axisLabelFormatter=n.dateAxisLabelFormatter;else{if("number"!=h)return console.error("only 'date', 'datetime' and 'number' types are supported for column 1 of DataTable input (Got '"+h+"')"),null;this.attrs_.xValueParser=function(n){return parseFloat(n)};this.attrs_.axes.x.valueFormatter=function(n){return n};this.attrs_.axes.x.ticker=n.numericTicks;this.attrs_.axes.x.axisLabelFormatter=this.attrs_.axes.x.valueFormatter}for(var r,e=[],o={},b=!1,i=1;p>i;i++)w=t.getColumnType(i),"number"==w?e.push(i):"string"==w&&this.getBooleanOption("displayAnnotations")?(a=e[e.length-1],o.hasOwnProperty(a)?o[a].push(i):o[a]=[i],b=!0):console.error("Only 'number' is supported as a dependent type with Gviz. 'string' is only supported if displayAnnotations is true");for(v=[t.getColumnLabel(0)],i=0;i<e.length;i++)v.push(t.getColumnLabel(e[i])),this.getBooleanOption("errorBars")&&(i+=1);this.attrs_.labels=v;p=v.length;var c=[],k=!1,y=[];for(i=0;g>i;i++)if(u=[],"undefined"!=typeof t.getValue(i,0)&&null!==t.getValue(i,0)){if(u.push("date"==h||"datetime"==h?t.getValue(i,0).getTime():t.getValue(i,0)),this.getBooleanOption("errorBars"))for(r=0;p-1>r;r++)u.push([t.getValue(i,1+2*r),t.getValue(i,2+2*r)]);else{for(r=0;r<e.length;r++)if(s=e[r],u.push(t.getValue(i,s)),b&&o.hasOwnProperty(s)&&null!==t.getValue(i,o[s][0])){for(f={},f.series=t.getColumnLabel(s),f.xval=u[0],f.shortText=d(y.length),f.text="",l=0;l<o[s].length;l++)l&&(f.text+="\n"),f.text+=t.getValue(i,o[s][l]);y.push(f)}for(r=0;r<u.length;r++)isFinite(u[r])||(u[r]=null)}c.length>0&&u[0]<c[c.length-1][0]&&(k=!0);c.push(u)}else console.warn("Ignoring row "+i+" of DataTable because of undefined or null first column.");k&&(console.warn("DataTable is out of order; order it correctly to speed loading."),c.sort(function(n,t){return n[0]-t[0]}));this.rawData_=c;y.length>0&&this.setAnnotations(y,!0);this.attributes_.reparseSeries()},n.prototype.cascadeDataDidUpdateEvent_=function(){this.cascadeEvents_("dataDidUpdate",{})},n.prototype.start_=function(){var t=this.file_,r,i,u;("function"==typeof t&&(t=t()),n.isArrayLike(t))?(this.rawData_=this.parseArray_(t),this.cascadeDataDidUpdateEvent_(),this.predraw_()):"object"==typeof t&&"function"==typeof t.getColumnRange?(this.parseDataTable_(t),this.cascadeDataDidUpdateEvent_(),this.predraw_()):"string"==typeof t?(r=n.detectLineDelimiter(t),r?this.loadedEvent_(t):(i=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP"),u=this,i.onreadystatechange=function(){4==i.readyState&&(200===i.status||0===i.status)&&u.loadedEvent_(i.responseText)},i.open("GET",t,!0),i.send(null))):console.error("Unknown data format: "+typeof t)},n.prototype.updateOptions=function(t,i){var u,r,f;"undefined"==typeof i&&(i=!1);u=t.file;r=n.mapLegacyOptions_(t);"rollPeriod"in r&&(this.rollPeriod_=r.rollPeriod);"dateWindow"in r&&(this.dateWindow_=r.dateWindow,"isZoomedIgnoreProgrammaticZoom"in r||(this.zoomed_x_=null!==r.dateWindow));"valueRange"in r&&!("isZoomedIgnoreProgrammaticZoom"in r)&&(this.zoomed_y_=null!==r.valueRange);f=n.isPixelChangingOptionList(this.attr_("labels"),r);n.updateDeep(this.user_attrs_,r);this.attributes_.reparseSeries();u?(this.cascadeEvents_("dataWillUpdate",{}),this.file_=u,i||this.start_()):i||(f?this.predraw_():this.renderGraph_(!1))},n.mapLegacyOptions_=function(n){var i={},r,u,t;for(r in n)n.hasOwnProperty(r)&&"file"!=r&&n.hasOwnProperty(r)&&(i[r]=n[r]);return u=function(n,t,r){i.axes||(i.axes={});i.axes[n]||(i.axes[n]={});i.axes[n][t]=r},t=function(t,r,f){"undefined"!=typeof n[t]&&(console.warn("Option "+t+" is deprecated. Use the "+f+" option for the "+r+" axis instead. (e.g. { axes : { "+r+" : { "+f+" : ... } } } (see http://dygraphs.com/per-axis.html for more information."),u(r,f,n[t]),delete i[t])},t("xValueFormatter","x","valueFormatter"),t("pixelsPerXLabel","x","pixelsPerLabel"),t("xAxisLabelFormatter","x","axisLabelFormatter"),t("xTicker","x","ticker"),t("yValueFormatter","y","valueFormatter"),t("pixelsPerYLabel","y","pixelsPerLabel"),t("yAxisLabelFormatter","y","axisLabelFormatter"),t("yTicker","y","ticker"),t("drawXGrid","x","drawGrid"),t("drawXAxis","x","drawAxis"),t("drawYGrid","y","drawGrid"),t("drawYAxis","y","drawAxis"),t("xAxisLabelWidth","x","axisLabelWidth"),t("yAxisLabelWidth","y","axisLabelWidth"),i},n.prototype.resize=function(n,t){if(!this.resize_lock){this.resize_lock=!0;null===n!=(null===t)&&(console.warn("Dygraph.resize() should be called with zero parameters or two non-NULL parameters. Pretending it was zero."),n=t=null);var i=this.width_,r=this.height_;n?(this.maindiv_.style.width=n+"px",this.maindiv_.style.height=t+"px",this.width_=n,this.height_=t):(this.width_=this.maindiv_.clientWidth,this.height_=this.maindiv_.clientHeight);(i!=this.width_||r!=this.height_)&&(this.resizeElements_(),this.predraw_());this.resize_lock=!1}},n.prototype.adjustRoll=function(n){this.rollPeriod_=n;this.predraw_()},n.prototype.visibility=function(){for(this.getOption("visibility")||(this.attrs_.visibility=[]);this.getOption("visibility").length<this.numColumns()-1;)this.attrs_.visibility.push(!0);return this.getOption("visibility")},n.prototype.setVisibility=function(n,t){var i=this.visibility();0>n||n>=i.length?console.warn("invalid series number in setVisibility: "+n):(i[n]=t,this.predraw_())},n.prototype.size=function(){return{width:this.width_,height:this.height_}},n.prototype.setAnnotations=function(t,i){return n.addAnnotationRule(),this.annotations_=t,this.layout_?(this.layout_.setAnnotations(this.annotations_),void(i||this.predraw_())):void console.warn("Tried to setAnnotations before dygraph was ready. Try setting them in a ready() block. See dygraphs.com/tests/annotation.html")},n.prototype.annotations=function(){return this.annotations_},n.prototype.getLabels=function(){var n=this.attr_("labels");return n?n.slice():null},n.prototype.indexFromSetName=function(n){return this.setIndexByName_[n]},n.prototype.ready=function(n){this.is_initial_draw_?this.readyFns_.push(n):n.call(this,this)},n.addAnnotationRule=function(){var r,u,i,t,f;if(!n.addedAnnotationCSS){for(r="border: 1px solid black; background-color: white; text-align: center;",u=document.createElement("style"),u.type="text/css",document.getElementsByTagName("head")[0].appendChild(u),i=0;i<document.styleSheets.length;i++)if(!document.styleSheets[i].disabled){t=document.styleSheets[i];try{return t.insertRule?(f=t.cssRules?t.cssRules.length:0,t.insertRule(".dygraphDefaultAnnotation { "+r+" }",f)):t.addRule&&t.addRule(".dygraphDefaultAnnotation",r),void(n.addedAnnotationCSS=!0)}catch(e){}}console.warn("Unable to add default annotation CSS rule; display may be off.")}},"object"==typeof exports&&"undefined"!=typeof module&&(module.exports=n),n}();!function(){"use strict";function t(n){var t=i.exec(n);if(!t)return null;var r=parseInt(t[1],10),u=parseInt(t[2],10),f=parseInt(t[3],10);return t[4]?{r:r,g:u,b:f,a:parseFloat(t[4])}:{r:r,g:u,b:f}}var n,i;Dygraph.LOG_SCALE=10;Dygraph.LN_TEN=Math.log(Dygraph.LOG_SCALE);Dygraph.log10=function(n){return Math.log(n)/Dygraph.LN_TEN};Dygraph.DOTTED_LINE=[2,2];Dygraph.DASHED_LINE=[7,3];Dygraph.DOT_DASH_LINE=[7,2,2,2];Dygraph.getContext=function(n){return n.getContext("2d")};Dygraph.addEvent=function(n,t,i){n.addEventListener?n.addEventListener(t,i,!1):(n[t+i]=function(){i(window.event)},n.attachEvent("on"+t,n[t+i]))};Dygraph.prototype.addAndTrackEvent=function(n,t,i){Dygraph.addEvent(n,t,i);this.registeredEvents_.push({elem:n,type:t,fn:i})};Dygraph.removeEvent=function(n,t,i){if(n.removeEventListener)n.removeEventListener(t,i,!1);else{try{n.detachEvent("on"+t,n[t+i])}catch(r){}n[t+i]=null}};Dygraph.prototype.removeTrackedEvents_=function(){var n,t;if(this.registeredEvents_)for(n=0;n<this.registeredEvents_.length;n++)t=this.registeredEvents_[n],Dygraph.removeEvent(t.elem,t.type,t.fn);this.registeredEvents_=[]};Dygraph.cancelEvent=function(n){return n=n?n:window.event,n.stopPropagation&&n.stopPropagation(),n.preventDefault&&n.preventDefault(),n.cancelBubble=!0,n.cancel=!0,n.returnValue=!1,!1};Dygraph.hsvToRGB=function(n,t,i){var r,u,f;if(0===t)r=i,u=i,f=i;else{var h=Math.floor(6*n),c=6*n-h,e=i*(1-t),o=i*(1-t*c),s=i*(1-t*(1-c));switch(h){case 1:r=o;u=i;f=e;break;case 2:r=e;u=i;f=s;break;case 3:r=e;u=o;f=i;break;case 4:r=s;u=e;f=i;break;case 5:r=i;u=e;f=o;break;case 6:case 0:r=i;u=s;f=e}}return r=Math.floor(255*r+.5),u=Math.floor(255*u+.5),f=Math.floor(255*f+.5),"rgb("+r+","+u+","+f+")"};Dygraph.findPos=function(n){var i=0,r=0,t,u,f,e;if(n.offsetParent)for(t=n;;){if(u="0",f="0",window.getComputedStyle&&(e=window.getComputedStyle(t,null),u=e.borderLeft||"0",f=e.borderTop||"0"),i+=parseInt(u,10),r+=parseInt(f,10),i+=t.offsetLeft,r+=t.offsetTop,!t.offsetParent)break;t=t.offsetParent}else n.x&&(i+=n.x),n.y&&(r+=n.y);for(;n&&n!=document.body;)i-=n.scrollLeft,r-=n.scrollTop,n=n.parentNode;return{x:i,y:r}};Dygraph.pageX=function(n){if(n.pageX)return!n.pageX||n.pageX<0?0:n.pageX;var t=document.documentElement,i=document.body;return n.clientX+(t.scrollLeft||i.scrollLeft)-(t.clientLeft||0)};Dygraph.pageY=function(n){if(n.pageY)return!n.pageY||n.pageY<0?0:n.pageY;var t=document.documentElement,i=document.body;return n.clientY+(t.scrollTop||i.scrollTop)-(t.clientTop||0)};Dygraph.dragGetX_=function(n,t){return Dygraph.pageX(n)-t.px};Dygraph.dragGetY_=function(n,t){return Dygraph.pageY(n)-t.py};Dygraph.isOK=function(n){return!!n&&!isNaN(n)};Dygraph.isValidPoint=function(n,t){return n?null===n.yval?!1:null===n.x||void 0===n.x?!1:null===n.y||void 0===n.y?!1:isNaN(n.x)||!t&&isNaN(n.y)?!1:!0:!1};Dygraph.floatFormat=function(n,t){var i=Math.min(Math.max(1,t||2),21);return Math.abs(n)<.001&&0!==n?n.toExponential(i-1):n.toPrecision(i)};Dygraph.zeropad=function(n){return 10>n?"0"+n:""+n};Dygraph.DateAccessorsLocal={getFullYear:function(n){return n.getFullYear()},getMonth:function(n){return n.getMonth()},getDate:function(n){return n.getDate()},getHours:function(n){return n.getHours()},getMinutes:function(n){return n.getMinutes()},getSeconds:function(n){return n.getSeconds()},getMilliseconds:function(n){return n.getMilliseconds()},getDay:function(n){return n.getDay()},makeDate:function(n,t,i,r,u,f,e){return new Date(n,t,i,r,u,f,e)}};Dygraph.DateAccessorsUTC={getFullYear:function(n){return n.getUTCFullYear()},getMonth:function(n){return n.getUTCMonth()},getDate:function(n){return n.getUTCDate()},getHours:function(n){return n.getUTCHours()},getMinutes:function(n){return n.getUTCMinutes()},getSeconds:function(n){return n.getUTCSeconds()},getMilliseconds:function(n){return n.getUTCMilliseconds()},getDay:function(n){return n.getUTCDay()},makeDate:function(n,t,i,r,u,f,e){return new Date(Date.UTC(n,t,i,r,u,f,e))}};Dygraph.hmsString_=function(n,t,i){var r=Dygraph.zeropad,u=r(n)+":"+r(t);return i&&(u+=":"+r(i)),u};Dygraph.dateString_=function(n,t){var u=Dygraph.zeropad,i=t?Dygraph.DateAccessorsUTC:Dygraph.DateAccessorsLocal,r=new Date(n),h=i.getFullYear(r),c=i.getMonth(r),l=i.getDate(r),f=i.getHours(r),e=i.getMinutes(r),o=i.getSeconds(r),a=""+h,v=u(c+1),y=u(l),p=3600*f+60*e+o,s=a+"/"+v+"/"+y;return p&&(s+=" "+Dygraph.hmsString_(f,e,o)),s};Dygraph.round_=function(n,t){var i=Math.pow(10,t);return Math.round(n*i)/i};Dygraph.binarySearch=function(n,t,i,r,u){if((null===r||void 0===r||null===u||void 0===u)&&(r=0,u=t.length-1),r>u)return-1;(null===i||void 0===i)&&(i=0);var e,s=function(n){return n>=0&&n<t.length},f=parseInt((r+u)/2,10),o=t[f];return o==n?f:o>n?i>0&&(e=f-1,s(e)&&t[e]<n)?f:Dygraph.binarySearch(n,t,i,r,f-1):n>o?0>i&&(e=f+1,s(e)&&t[e]>n)?f:Dygraph.binarySearch(n,t,i,f+1,u):-1};Dygraph.dateParser=function(n){var i,t;if((-1==n.search("-")||-1!=n.search("T")||-1!=n.search("Z"))&&(t=Dygraph.dateStrToMillis(n),t&&!isNaN(t)))return t;if(-1!=n.search("-")){for(i=n.replace("-","/","g");-1!=i.search("-");)i=i.replace("-","/");t=Dygraph.dateStrToMillis(i)}else 8==n.length?(i=n.substr(0,4)+"/"+n.substr(4,2)+"/"+n.substr(6,2),t=Dygraph.dateStrToMillis(i)):t=Dygraph.dateStrToMillis(n);return(!t||isNaN(t))&&console.error("Couldn't parse "+n+" as a date"),t};Dygraph.dateStrToMillis=function(n){return new Date(n).getTime()};Dygraph.update=function(n,t){if("undefined"!=typeof t&&null!==t)for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);return n};Dygraph.updateDeep=function(n,t){function r(n){return"object"==typeof Node?n instanceof Node:"object"==typeof n&&"number"==typeof n.nodeType&&"string"==typeof n.nodeName}if("undefined"!=typeof t&&null!==t)for(var i in t)t.hasOwnProperty(i)&&(null===t[i]?n[i]=null:Dygraph.isArrayLike(t[i])?n[i]=t[i].slice():r(t[i])?n[i]=t[i]:"object"==typeof t[i]?(("object"!=typeof n[i]||null===n[i])&&(n[i]={}),Dygraph.updateDeep(n[i],t[i])):n[i]=t[i]);return n};Dygraph.isArrayLike=function(n){var t=typeof n;return"object"!=t&&("function"!=t||"function"!=typeof n.item)||null===n||"number"!=typeof n.length||3===n.nodeType?!1:!0};Dygraph.isDateLike=function(n){return"object"!=typeof n||null===n||"function"!=typeof n.getTime?!1:!0};Dygraph.clone=function(n){for(var i=[],t=0;t<n.length;t++)i.push(Dygraph.isArrayLike(n[t])?Dygraph.clone(n[t]):n[t]);return i};Dygraph.createCanvas=function(){var n=document.createElement("canvas"),t=/MSIE/.test(navigator.userAgent)&&!window.opera;return t&&"undefined"!=typeof G_vmlCanvasManager&&(n=G_vmlCanvasManager.initElement(n)),n};Dygraph.getContextPixelRatio=function(n){try{var t=window.devicePixelRatio,i=n.webkitBackingStorePixelRatio||n.mozBackingStorePixelRatio||n.msBackingStorePixelRatio||n.oBackingStorePixelRatio||n.backingStorePixelRatio||1;return void 0!==t?t/i:1}catch(r){return 1}};Dygraph.isAndroid=function(){return/Android/.test(navigator.userAgent)};Dygraph.Iterator=function(n,t,i,r){t=t||0;i=i||n.length;this.hasNext=!0;this.peek=null;this.start_=t;this.array_=n;this.predicate_=r;this.end_=Math.min(n.length,t+i);this.nextIdx_=t-1;this.next()};Dygraph.Iterator.prototype.next=function(){if(!this.hasNext)return null;for(var i=this.peek,n=this.nextIdx_+1,t=!1;n<this.end_;){if(!this.predicate_||this.predicate_(this.array_,n)){this.peek=this.array_[n];t=!0;break}n++}return this.nextIdx_=n,t||(this.hasNext=!1,this.peek=null),i};Dygraph.createIterator=function(n,t,i,r){return new Dygraph.Iterator(n,t,i,r)};Dygraph.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(n){window.setTimeout(n,1e3/60)}}();Dygraph.repeatAndCleanup=function(n,t,i,r){var e,u=0,o=(new Date).getTime(),f;if(n(u),1==t)return void r();f=t-1;!function s(){u>=t||Dygraph.requestAnimFrame.call(window,function(){var c=(new Date).getTime(),l=c-o,t,h;e=u;u=Math.floor(l/i);t=u-e;h=u+t>f;h||u>=f?(n(f),r()):(0!==t&&n(u),s())})}()};n={annotationClickHandler:!0,annotationDblClickHandler:!0,annotationMouseOutHandler:!0,annotationMouseOverHandler:!0,axisLabelColor:!0,axisLineColor:!0,axisLineWidth:!0,clickCallback:!0,drawCallback:!0,drawHighlightPointCallback:!0,drawPoints:!0,drawPointCallback:!0,drawXGrid:!0,drawYGrid:!0,fillAlpha:!0,gridLineColor:!0,gridLineWidth:!0,hideOverlayOnMouseOut:!0,highlightCallback:!0,highlightCircleSize:!0,interactionModel:!0,isZoomedIgnoreProgrammaticZoom:!0,labelsDiv:!0,labelsDivStyles:!0,labelsDivWidth:!0,labelsKMB:!0,labelsKMG2:!0,labelsSeparateLines:!0,labelsShowZeroValues:!0,legend:!0,panEdgeFraction:!0,pixelsPerYLabel:!0,pointClickCallback:!0,pointSize:!0,rangeSelectorPlotFillColor:!0,rangeSelectorPlotStrokeColor:!0,showLabelsOnHighlight:!0,showRoller:!0,strokeWidth:!0,underlayCallback:!0,unhighlightCallback:!0,zoomCallback:!0};Dygraph.isPixelChangingOptionList=function(t,i){var s={},u,e,r,f,o;if(t)for(u=1;u<t.length;u++)s[t[u]]=!0;e=function(t){for(var i in t)if(t.hasOwnProperty(i)&&!n[i])return!0;return!1};for(r in i)if(i.hasOwnProperty(r))if("highlightSeriesOpts"==r||s[r]&&!i.series){if(e(i[r]))return!0}else if("series"==r||"axes"==r){f=i[r];for(o in f)if(f.hasOwnProperty(o)&&e(f[o]))return!0}else if(!n[r])return!0;return!1};Dygraph.Circles={DEFAULT:function(n,t,i,r,u,f,e){i.beginPath();i.fillStyle=f;i.arc(r,u,e,0,2*Math.PI,!1);i.fill()}};Dygraph.IFrameTarp=function(){this.tarps=[]};Dygraph.IFrameTarp.prototype.cover=function(){for(var i=document.getElementsByTagName("iframe"),t=0;t<i.length;t++){var r=i[t],u=Dygraph.findPos(r),f=u.x,e=u.y,o=r.offsetWidth,s=r.offsetHeight,n=document.createElement("div");n.style.position="absolute";n.style.left=f+"px";n.style.top=e+"px";n.style.width=o+"px";n.style.height=s+"px";n.style.zIndex=999;document.body.appendChild(n);this.tarps.push(n)}};Dygraph.IFrameTarp.prototype.uncover=function(){for(var n=0;n<this.tarps.length;n++)this.tarps[n].parentNode.removeChild(this.tarps[n]);this.tarps=[]};Dygraph.detectLineDelimiter=function(n){for(var i,t=0;t<n.length;t++){if(i=n.charAt(t),"\r"===i)return t+1<n.length&&"\n"===n.charAt(t+1)?"\r\n":i;if("\n"===i)return t+1<n.length&&"\r"===n.charAt(t+1)?"\n\r":i}return null};Dygraph.isNodeContainedBy=function(n,t){if(null===t||null===n)return!1;for(var i=n;i&&i!==t;)i=i.parentNode;return i===t};Dygraph.pow=function(n,t){return 0>t?1/Math.pow(n,-t):Math.pow(n,t)};i=/^rgba?\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})(?:,\s*([01](?:\.\d+)?))?\)$/;Dygraph.toRGB_=function(n){var r=t(n),i,u;return r?r:(i=document.createElement("div"),i.style.backgroundColor=n,i.style.visibility="hidden",document.body.appendChild(i),u=window.getComputedStyle?window.getComputedStyle(i,null).backgroundColor:i.currentStyle.backgroundColor,document.body.removeChild(i),t(u))};Dygraph.isCanvasSupported=function(n){var i,t,r;try{i=n||document.createElement("canvas");i.getContext("2d")}catch(u){return t=navigator.appVersion.match(/MSIE (\d\.\d)/),r=-1!=navigator.userAgent.toLowerCase().indexOf("opera"),!t||t[1]<6||r?!1:!0}return!0};Dygraph.parseFloat_=function(n,t,i){var u=parseFloat(n),r;return isNaN(u)?/^ *$/.test(n)?null:/^ *nan *$/i.test(n)?NaN:(r="Unable to parse '"+n+"' as a number",void 0!==i&&void 0!==t&&(r+=" on line "+(1+(t||0))+" ('"+i+"') of CSV."),console.error(r),null):u}}(),function(){"use strict";Dygraph.GVizChart=function(n){this.container=n};Dygraph.GVizChart.prototype.draw=function(n,t){this.container.innerHTML="";"undefined"!=typeof this.date_graph&&this.date_graph.destroy();this.date_graph=new Dygraph(this.container,n,t)};Dygraph.GVizChart.prototype.setSelection=function(n){var t=!1;n.length&&(t=n[0].row);this.date_graph.setSelection(t)};Dygraph.GVizChart.prototype.getSelection=function(){var t=[],i=this.date_graph.getSelection(),r,n;if(0>i)return t;for(r=this.date_graph.layout_.points,n=0;n<r.length;++n)t.push({row:i,column:n+1});return t}}(),function(){"use strict";var i=100,n,t;Dygraph.Interaction={};Dygraph.Interaction.maybeTreatMouseOpAsClick=function(n,t,i){i.dragEndX=Dygraph.dragGetX_(n,i);i.dragEndY=Dygraph.dragGetY_(n,i);var r=Math.abs(i.dragEndX-i.dragStartX),u=Math.abs(i.dragEndY-i.dragStartY);2>r&&2>u&&void 0!==t.lastx_&&-1!=t.lastx_&&Dygraph.Interaction.treatMouseOpAsClick(t,n,i);i.regionWidth=r;i.regionHeight=u};Dygraph.Interaction.startPan=function(n,t,i){var r,o,u,s,h;if(i.isPanning=!0,u=t.xAxisRange(),t.getOptionForAxis("logscale","x")?(i.initialLeftmostDate=Dygraph.log10(u[0]),i.dateRange=Dygraph.log10(u[1])-Dygraph.log10(u[0])):(i.initialLeftmostDate=u[0],i.dateRange=u[1]-u[0]),i.xUnitsPerPixel=i.dateRange/(t.plotter_.area.w-1),t.getNumericOption("panEdgeFraction")){var c=t.width_*t.getNumericOption("panEdgeFraction"),l=t.xAxisExtremes(),v=t.toDomXCoord(l[0])-c,y=t.toDomXCoord(l[1])+c,p=t.toDataXCoord(v),w=t.toDataXCoord(y);for(i.boundedDates=[p,w],s=[],h=t.height_*t.getNumericOption("panEdgeFraction"),r=0;r<t.axes_.length;r++){o=t.axes_[r];var a=o.extremeRange,b=t.toDomYCoord(a[0],r)+h,k=t.toDomYCoord(a[1],r)-h,d=t.toDataYCoord(b,r),g=t.toDataYCoord(k,r);s[r]=[d,g]}i.boundedValues=s}for(i.is2DPan=!1,i.axes=[],r=0;r<t.axes_.length;r++){o=t.axes_[r];var f={},e=t.yAxisRange(r),nt=t.attributes_.getForAxis("logscale",r);nt?(f.initialTopValue=Dygraph.log10(e[1]),f.dragValueRange=Dygraph.log10(e[1])-Dygraph.log10(e[0])):(f.initialTopValue=e[1],f.dragValueRange=e[1]-e[0]);f.unitsPerPixel=f.dragValueRange/(t.plotter_.area.h-1);i.axes.push(f);(o.valueWindow||o.valueRange)&&(i.is2DPan=!0)}};Dygraph.Interaction.movePan=function(n,t,i){var r,e,c,u,o;if(i.dragEndX=Dygraph.dragGetX_(n,i),i.dragEndY=Dygraph.dragGetY_(n,i),r=i.initialLeftmostDate-(i.dragEndX-i.dragStartX)*i.xUnitsPerPixel,i.boundedDates&&(r=Math.max(r,i.boundedDates[0])),e=r+i.dateRange,i.boundedDates&&e>i.boundedDates[1]&&(r-=e-i.boundedDates[1],e=r+i.dateRange),t.dateWindow_=t.getOptionForAxis("logscale","x")?[Math.pow(Dygraph.LOG_SCALE,r),Math.pow(Dygraph.LOG_SCALE,e)]:[r,e],i.is2DPan)for(c=i.dragEndY-i.dragStartY,u=0;u<t.axes_.length;u++){var l=t.axes_[u],h=i.axes[u],a=c*h.unitsPerPixel,s=i.boundedValues?i.boundedValues[u]:null,f=h.initialTopValue+a;s&&(f=Math.min(f,s[1]));o=f-h.dragValueRange;s&&o<s[0]&&(f-=o-s[0],o=f-h.dragValueRange);l.valueWindow=t.attributes_.getForAxis("logscale",u)?[Math.pow(Dygraph.LOG_SCALE,o),Math.pow(Dygraph.LOG_SCALE,f)]:[o,f]}t.drawGraph_(!1)};Dygraph.Interaction.endPan=Dygraph.Interaction.maybeTreatMouseOpAsClick;Dygraph.Interaction.startZoom=function(n,t,i){i.isZooming=!0;i.zoomMoved=!1};Dygraph.Interaction.moveZoom=function(n,t,i){i.zoomMoved=!0;i.dragEndX=Dygraph.dragGetX_(n,i);i.dragEndY=Dygraph.dragGetY_(n,i);var r=Math.abs(i.dragStartX-i.dragEndX),u=Math.abs(i.dragStartY-i.dragEndY);i.dragDirection=u/2>r?Dygraph.VERTICAL:Dygraph.HORIZONTAL;t.drawZoomRect_(i.dragDirection,i.dragStartX,i.dragEndX,i.dragStartY,i.dragEndY,i.prevDragDirection,i.prevEndX,i.prevEndY);i.prevEndX=i.dragEndX;i.prevEndY=i.dragEndY;i.prevDragDirection=i.dragDirection};Dygraph.Interaction.treatMouseOpAsClick=function(n,t,i){for(var h,f,c,v,e,l=n.getFunctionOption("clickCallback"),a=n.getFunctionOption("pointClickCallback"),r=null,o=-1,s=Number.MAX_VALUE,u=0;u<n.selPoints_.length;u++)h=n.selPoints_[u],f=Math.pow(h.canvasx-i.dragEndX,2)+Math.pow(h.canvasy-i.dragEndY,2),!isNaN(f)&&(-1==o||s>f)&&(s=f,o=u);if(c=n.getNumericOption("highlightCircleSize")+2,c*c>=s&&(r=n.selPoints_[o]),r){if(e={cancelable:!0,point:r,canvasx:i.dragEndX,canvasy:i.dragEndY},v=n.cascadeEvents_("pointClick",e),v)return;a&&a.call(n,t,r)}e={cancelable:!0,xval:n.lastx_,pts:n.selPoints_,canvasx:i.dragEndX,canvasy:i.dragEndY};n.cascadeEvents_("click",e)||l&&l.call(n,t,n.lastx_,n.selPoints_)};Dygraph.Interaction.endZoom=function(n,t,i){var r,u,f,e,o;t.clearZoomRect_();i.isZooming=!1;Dygraph.Interaction.maybeTreatMouseOpAsClick(n,t,i);r=t.getArea();i.regionWidth>=10&&i.dragDirection==Dygraph.HORIZONTAL?(u=Math.min(i.dragStartX,i.dragEndX),f=Math.max(i.dragStartX,i.dragEndX),u=Math.max(u,r.x),f=Math.min(f,r.x+r.w),f>u&&t.doZoomX_(u,f),i.cancelNextDblclick=!0):i.regionHeight>=10&&i.dragDirection==Dygraph.VERTICAL&&(e=Math.min(i.dragStartY,i.dragEndY),o=Math.max(i.dragStartY,i.dragEndY),e=Math.max(e,r.y),o=Math.min(o,r.y+r.h),o>e&&t.doZoomY_(e,o),i.cancelNextDblclick=!0);i.dragStartX=null;i.dragStartY=null};Dygraph.Interaction.startTouch=function(n,t,i){var r,e,f,u;for(n.preventDefault(),n.touches.length>1&&(i.startTimeForDoubleTapMs=null),r=[],e=0;e<n.touches.length;e++)f=n.touches[e],r.push({pageX:f.pageX,pageY:f.pageY,dataX:t.toDataXCoord(f.pageX),dataY:t.toDataYCoord(f.pageY)});(i.initialTouches=r,1==r.length)?(i.initialPinchCenter=r[0],i.touchDirections={x:!0,y:!0}):r.length>=2&&(i.initialPinchCenter={pageX:.5*(r[0].pageX+r[1].pageX),pageY:.5*(r[0].pageY+r[1].pageY),dataX:.5*(r[0].dataX+r[1].dataX),dataY:.5*(r[0].dataY+r[1].dataY)},u=180/Math.PI*Math.atan2(i.initialPinchCenter.pageY-r[0].pageY,r[0].pageX-i.initialPinchCenter.pageX),u=Math.abs(u),u>90&&(u=90-u),i.touchDirections={x:67.5>u,y:u>22.5});i.initialRange={x:t.xAxisRange(),y:t.yAxisRange()}};Dygraph.Interaction.moveTouch=function(n,t,i){var f,r,l,h,a,u,o,s,y,p,c,w,b,v;for(i.startTimeForDoubleTapMs=null,r=[],f=0;f<n.touches.length;f++)l=n.touches[f],r.push({pageX:l.pageX,pageY:l.pageY});a=i.initialTouches;u=i.initialPinchCenter;h=1==r.length?r[0]:{pageX:.5*(r[0].pageX+r[1].pageX),pageY:.5*(r[0].pageY+r[1].pageY)};var e={pageX:h.pageX-u.pageX,pageY:h.pageY-u.pageY},k=i.initialRange.x[1]-i.initialRange.x[0],d=i.initialRange.y[0]-i.initialRange.y[1];if(e.dataX=e.pageX/t.plotter_.area.w*k,e.dataY=e.pageY/t.plotter_.area.h*d,1==r.length?(o=1,s=1):r.length>=2&&(y=a[1].pageX-u.pageX,o=(r[1].pageX-h.pageX)/y,p=a[1].pageY-u.pageY,s=(r[1].pageY-h.pageY)/p),o=Math.min(8,Math.max(.125,o)),s=Math.min(8,Math.max(.125,s)),c=!1,i.touchDirections.x&&(t.dateWindow_=[u.dataX-e.dataX+(i.initialRange.x[0]-u.dataX)/o,u.dataX-e.dataX+(i.initialRange.x[1]-u.dataX)/o],c=!0),i.touchDirections.y)for(f=0;1>f;f++)w=t.axes_[f],b=t.attributes_.getForAxis("logscale",f),b||(w.valueWindow=[u.dataY-e.dataY+(i.initialRange.y[0]-u.dataY)/s,u.dataY-e.dataY+(i.initialRange.y[1]-u.dataY)/s],c=!0);(t.drawGraph_(!1),c&&r.length>1&&t.getFunctionOption("zoomCallback"))&&(v=t.xAxisRange(),t.getFunctionOption("zoomCallback").call(t,v[0],v[1],t.yAxisRanges()))};Dygraph.Interaction.endTouch=function(n,t,i){if(0!==n.touches.length)Dygraph.Interaction.startTouch(n,t,i);else if(1==n.changedTouches.length){var u=(new Date).getTime(),r=n.changedTouches[0];i.startTimeForDoubleTapMs&&u-i.startTimeForDoubleTapMs<500&&i.doubleTapX&&Math.abs(i.doubleTapX-r.screenX)<50&&i.doubleTapY&&Math.abs(i.doubleTapY-r.screenY)<50?t.resetZoom():(i.startTimeForDoubleTapMs=u,i.doubleTapX=r.screenX,i.doubleTapY=r.screenY)}};n=function(n,t,i){return t>n?t-n:n>i?n-i:0};t=function(t,i){var r=Dygraph.findPos(i.canvas_),u={left:r.x,right:r.x+i.canvas_.offsetWidth,top:r.y,bottom:r.y+i.canvas_.offsetHeight},f={x:Dygraph.pageX(t),y:Dygraph.pageY(t)},e=n(f.x,u.left,u.right),o=n(f.y,u.top,u.bottom);return Math.max(e,o)};Dygraph.Interaction.defaultModel={mousedown:function(n,r,u){if(!n.button||2!=n.button){u.initializeMouseDown(n,r,u);n.altKey||n.shiftKey?Dygraph.startPan(n,r,u):Dygraph.startZoom(n,r,u);var f=function(n){if(u.isZooming){var f=t(n,r);i>f?Dygraph.moveZoom(n,r,u):null!==u.dragEndX&&(u.dragEndX=null,u.dragEndY=null,r.clearZoomRect_())}else u.isPanning&&Dygraph.movePan(n,r,u)},e=function(n){u.isZooming?null!==u.dragEndX?Dygraph.endZoom(n,r,u):Dygraph.Interaction.maybeTreatMouseOpAsClick(n,r,u):u.isPanning&&Dygraph.endPan(n,r,u);Dygraph.removeEvent(document,"mousemove",f);Dygraph.removeEvent(document,"mouseup",e);u.destroy()};r.addAndTrackEvent(document,"mousemove",f);r.addAndTrackEvent(document,"mouseup",e)}},willDestroyContextMyself:!0,touchstart:function(n,t,i){Dygraph.Interaction.startTouch(n,t,i)},touchmove:function(n,t,i){Dygraph.Interaction.moveTouch(n,t,i)},touchend:function(n,t,i){Dygraph.Interaction.endTouch(n,t,i)},dblclick:function(n,t,i){if(i.cancelNextDblclick)return void(i.cancelNextDblclick=!1);var r={canvasx:i.dragEndX,canvasy:i.dragEndY};t.cascadeEvents_("dblclick",r)||n.altKey||n.shiftKey||t.resetZoom()}};Dygraph.DEFAULT_ATTRS.interactionModel=Dygraph.Interaction.defaultModel;Dygraph.defaultInteractionModel=Dygraph.Interaction.defaultModel;Dygraph.endZoom=Dygraph.Interaction.endZoom;Dygraph.moveZoom=Dygraph.Interaction.moveZoom;Dygraph.startZoom=Dygraph.Interaction.startZoom;Dygraph.endPan=Dygraph.Interaction.endPan;Dygraph.movePan=Dygraph.Interaction.movePan;Dygraph.startPan=Dygraph.Interaction.startPan;Dygraph.Interaction.nonInteractiveModel_={mousedown:function(n,t,i){i.initializeMouseDown(n,t,i)},mouseup:Dygraph.Interaction.maybeTreatMouseOpAsClick};Dygraph.Interaction.dragIsPanInteractionModel={mousedown:function(n,t,i){i.initializeMouseDown(n,t,i);Dygraph.startPan(n,t,i)},mousemove:function(n,t,i){i.isPanning&&Dygraph.movePan(n,t,i)},mouseup:function(n,t,i){i.isPanning&&Dygraph.endPan(n,t,i)}}}(),function(){"use strict";Dygraph.TickList=void 0;Dygraph.Ticker=void 0;Dygraph.numericLinearTicks=function(n,t,i,r,u,f){var e=function(n){return"logscale"===n?!1:r(n)};return Dygraph.numericTicks(n,t,i,e,u,f)};Dygraph.numericTicks=function(n,t,i,r,u,f){var e,v,tt,h,y=r("pixelsPerLabel"),o=[],c,l,a,p,b,k,rt,ft;if(f)for(e=0;e<f.length;e++)o.push({v:f[e]});else{if(r("logscale")&&(h=Math.floor(i/y),c=Dygraph.binarySearch(n,Dygraph.PREFERRED_LOG_TICK_VALUES,1),l=Dygraph.binarySearch(t,Dygraph.PREFERRED_LOG_TICK_VALUES,-1),-1==c&&(c=0),-1==l&&(l=Dygraph.PREFERRED_LOG_TICK_VALUES.length-1),a=null,l-c>=h/4)){for(p=l;p>=c;p--){var w=Dygraph.PREFERRED_LOG_TICK_VALUES[p],g=Math.log(w/n)/Math.log(t/n)*i,it={v:w};null===a?a={tickValue:w,pixel_coord:g}:Math.abs(g-a.pixel_coord)>=y?a={tickValue:w,pixel_coord:g}:it.label="";o.push(it)}o.reverse()}if(0===o.length){rt=r("labelsKMG2");rt?(b=[1,2,4,8,16,32,64,128,256],k=16):(b=[1,2,5,10,20,50,100],k=10);var s,d,nt,ut,et=Math.ceil(i/y),ot=Math.abs(t-n)/et,st=Math.floor(Math.log(ot)/Math.log(k)),ht=Math.pow(k,st);for(v=0;v<b.length&&(s=ht*b[v],d=Math.floor(n/s)*s,nt=Math.ceil(t/s)*s,h=Math.abs(nt-d)/s,ut=i/h,!(ut>y));v++);for(d>nt&&(s*=-1),e=0;h>=e;e++)tt=d+e*s,o.push({v:tt})}}for(ft=r("axisLabelFormatter"),e=0;e<o.length;e++)void 0===o[e].label&&(o[e].label=ft.call(u,o[e].v,0,r,u));return o};Dygraph.dateTicker=function(n,t,i,r,u){var f=Dygraph.pickDateTickGranularity(n,t,i,r);return f>=0?Dygraph.getDateAxis(n,t,f,r,u):[]};Dygraph.SECONDLY=0;Dygraph.TWO_SECONDLY=1;Dygraph.FIVE_SECONDLY=2;Dygraph.TEN_SECONDLY=3;Dygraph.THIRTY_SECONDLY=4;Dygraph.MINUTELY=5;Dygraph.TWO_MINUTELY=6;Dygraph.FIVE_MINUTELY=7;Dygraph.TEN_MINUTELY=8;Dygraph.THIRTY_MINUTELY=9;Dygraph.HOURLY=10;Dygraph.TWO_HOURLY=11;Dygraph.SIX_HOURLY=12;Dygraph.DAILY=13;Dygraph.TWO_DAILY=14;Dygraph.WEEKLY=15;Dygraph.MONTHLY=16;Dygraph.QUARTERLY=17;Dygraph.BIANNUAL=18;Dygraph.ANNUAL=19;Dygraph.DECADAL=20;Dygraph.CENTENNIAL=21;Dygraph.NUM_GRANULARITIES=22;Dygraph.DATEFIELD_Y=0;Dygraph.DATEFIELD_M=1;Dygraph.DATEFIELD_D=2;Dygraph.DATEFIELD_HH=3;Dygraph.DATEFIELD_MM=4;Dygraph.DATEFIELD_SS=5;Dygraph.DATEFIELD_MS=6;Dygraph.NUM_DATEFIELDS=7;Dygraph.TICK_PLACEMENT=[];Dygraph.TICK_PLACEMENT[Dygraph.SECONDLY]={datefield:Dygraph.DATEFIELD_SS,step:1,spacing:1e3};Dygraph.TICK_PLACEMENT[Dygraph.TWO_SECONDLY]={datefield:Dygraph.DATEFIELD_SS,step:2,spacing:2e3};Dygraph.TICK_PLACEMENT[Dygraph.FIVE_SECONDLY]={datefield:Dygraph.DATEFIELD_SS,step:5,spacing:5e3};Dygraph.TICK_PLACEMENT[Dygraph.TEN_SECONDLY]={datefield:Dygraph.DATEFIELD_SS,step:10,spacing:1e4};Dygraph.TICK_PLACEMENT[Dygraph.THIRTY_SECONDLY]={datefield:Dygraph.DATEFIELD_SS,step:30,spacing:3e4};Dygraph.TICK_PLACEMENT[Dygraph.MINUTELY]={datefield:Dygraph.DATEFIELD_MM,step:1,spacing:6e4};Dygraph.TICK_PLACEMENT[Dygraph.TWO_MINUTELY]={datefield:Dygraph.DATEFIELD_MM,step:2,spacing:12e4};Dygraph.TICK_PLACEMENT[Dygraph.FIVE_MINUTELY]={datefield:Dygraph.DATEFIELD_MM,step:5,spacing:3e5};Dygraph.TICK_PLACEMENT[Dygraph.TEN_MINUTELY]={datefield:Dygraph.DATEFIELD_MM,step:10,spacing:6e5};Dygraph.TICK_PLACEMENT[Dygraph.THIRTY_MINUTELY]={datefield:Dygraph.DATEFIELD_MM,step:30,spacing:18e5};Dygraph.TICK_PLACEMENT[Dygraph.HOURLY]={datefield:Dygraph.DATEFIELD_HH,step:1,spacing:36e5};Dygraph.TICK_PLACEMENT[Dygraph.TWO_HOURLY]={datefield:Dygraph.DATEFIELD_HH,step:2,spacing:72e5};Dygraph.TICK_PLACEMENT[Dygraph.SIX_HOURLY]={datefield:Dygraph.DATEFIELD_HH,step:6,spacing:216e5};Dygraph.TICK_PLACEMENT[Dygraph.DAILY]={datefield:Dygraph.DATEFIELD_D,step:1,spacing:864e5};Dygraph.TICK_PLACEMENT[Dygraph.TWO_DAILY]={datefield:Dygraph.DATEFIELD_D,step:2,spacing:1728e5};Dygraph.TICK_PLACEMENT[Dygraph.WEEKLY]={datefield:Dygraph.DATEFIELD_D,step:7,spacing:6048e5};Dygraph.TICK_PLACEMENT[Dygraph.MONTHLY]={datefield:Dygraph.DATEFIELD_M,step:1,spacing:2629817280};Dygraph.TICK_PLACEMENT[Dygraph.QUARTERLY]={datefield:Dygraph.DATEFIELD_M,step:3,spacing:216e5*365.2524};Dygraph.TICK_PLACEMENT[Dygraph.BIANNUAL]={datefield:Dygraph.DATEFIELD_M,step:6,spacing:432e5*365.2524};Dygraph.TICK_PLACEMENT[Dygraph.ANNUAL]={datefield:Dygraph.DATEFIELD_Y,step:1,spacing:864e5*365.2524};Dygraph.TICK_PLACEMENT[Dygraph.DECADAL]={datefield:Dygraph.DATEFIELD_Y,step:10,spacing:315578073600};Dygraph.TICK_PLACEMENT[Dygraph.CENTENNIAL]={datefield:Dygraph.DATEFIELD_Y,step:100,spacing:3155780736e3};Dygraph.PREFERRED_LOG_TICK_VALUES=function(){for(var r,t,u,i=[],n=-39;39>=n;n++)for(r=Math.pow(10,n),t=1;9>=t;t++)u=r*t,i.push(u);return i}();Dygraph.pickDateTickGranularity=function(n,t,i,r){for(var e,f=r("pixelsPerLabel"),u=0;u<Dygraph.NUM_GRANULARITIES;u++)if(e=Dygraph.numDateTicks(n,t,u),i/e>=f)return u;return-1};Dygraph.numDateTicks=function(n,t,i){var r=Dygraph.TICK_PLACEMENT[i].spacing;return Math.round(1*(t-n)/r)};Dygraph.getDateAxis=function(n,t,i,r,u){var p=r("axisLabelFormatter"),b=r("labelsUTC"),e=b?Dygraph.DateAccessorsUTC:Dygraph.DateAccessorsLocal,c=Dygraph.TICK_PLACEMENT[i].datefield,a=Dygraph.TICK_PLACEMENT[i].step,w=Dygraph.TICK_PLACEMENT[i].spacing,h=new Date(n),f=[],v,l;for(f[Dygraph.DATEFIELD_Y]=e.getFullYear(h),f[Dygraph.DATEFIELD_M]=e.getMonth(h),f[Dygraph.DATEFIELD_D]=e.getDate(h),f[Dygraph.DATEFIELD_HH]=e.getHours(h),f[Dygraph.DATEFIELD_MM]=e.getMinutes(h),f[Dygraph.DATEFIELD_SS]=e.getSeconds(h),f[Dygraph.DATEFIELD_MS]=e.getMilliseconds(h),v=f[c]%a,i==Dygraph.WEEKLY&&(v=e.getDay(h)),f[c]-=v,l=c+1;l<Dygraph.NUM_DATEFIELDS;l++)f[l]=l===Dygraph.DATEFIELD_D?1:0;var y=[],s=e.makeDate.apply(null,f),o=s.getTime();if(i<=Dygraph.HOURLY)for(n>o&&(o+=w,s=new Date(o));t>=o;)y.push({v:o,label:p.call(u,s,i,r,u)}),o+=w,s=new Date(o);else for(n>o&&(f[c]+=a,s=e.makeDate.apply(null,f),o=s.getTime());t>=o;)(i>=Dygraph.DAILY||e.getHours(s)%a==0)&&y.push({v:o,label:p.call(u,s,i,r,u)}),f[c]+=a,s=e.makeDate.apply(null,f),o=s.getTime();return y};Dygraph&&Dygraph.DEFAULT_ATTRS&&Dygraph.DEFAULT_ATTRS.axes&&Dygraph.DEFAULT_ATTRS.axes.x&&Dygraph.DEFAULT_ATTRS.axes.y&&Dygraph.DEFAULT_ATTRS.axes.y2&&(Dygraph.DEFAULT_ATTRS.axes.x.ticker=Dygraph.dateTicker,Dygraph.DEFAULT_ATTRS.axes.y.ticker=Dygraph.numericTicks,Dygraph.DEFAULT_ATTRS.axes.y2.ticker=Dygraph.numericTicks)}();Dygraph.Plugins={};Dygraph.Plugins.Annotations=function(){"use strict";var n=function(){this.annotations_=[]};return n.prototype.toString=function(){return"Annotations Plugin"},n.prototype.activate=function(){return{clearChart:this.clearChart,didDrawChart:this.didDrawChart}},n.prototype.detachLabels=function(){for(var t,n=0;n<this.annotations_.length;n++)t=this.annotations_[n],t.parentNode&&t.parentNode.removeChild(t),this.annotations_[n]=null;this.annotations_=[]},n.prototype.clearChart=function(){this.detachLabels()},n.prototype.didDrawChart=function(n){var u=n.dygraph,v=u.layout_.annotated_points,t,r,o,i,w,b,s,l,h,a,f,c;if(v&&0!==v.length)for(var g=n.canvas.parentNode,k={position:"absolute",fontSize:u.getOption("axisLabelFontSize")+"px",zIndex:10,overflow:"hidden"},y=function(n,t,i){return function(r){var f=i.annotation;f.hasOwnProperty(n)?f[n](f,i,u,r):u.getOption(t)&&u.getOption(t)(f,i,u,r)}},e=n.dygraph.plotter_.area,p={},d=0;d<v.length;d++)if(t=v[d],!(t.canvasx<e.x||t.canvasx>e.x+e.w||t.canvasy<e.y||t.canvasy>e.y+e.h)){r=t.annotation;o=6;r.hasOwnProperty("tickHeight")&&(o=r.tickHeight);i=document.createElement("div");for(w in k)k.hasOwnProperty(w)&&(i.style[w]=k[w]);r.hasOwnProperty("icon")||(i.className="dygraphDefaultAnnotation");r.hasOwnProperty("cssClass")&&(i.className+=" "+r.cssClass);b=r.hasOwnProperty("width")?r.width:16;s=r.hasOwnProperty("height")?r.height:16;r.hasOwnProperty("icon")?(l=document.createElement("img"),l.src=r.icon,l.width=b,l.height=s,i.appendChild(l)):t.annotation.hasOwnProperty("shortText")&&i.appendChild(document.createTextNode(t.annotation.shortText));h=t.canvasx-b/2;i.style.left=h+"px";a=0;r.attachAtBottom?(c=e.y+e.h-s-o,p[h]?c-=p[h]:p[h]=0,p[h]+=o+s,a=c):a=t.canvasy-s-o;i.style.top=a+"px";i.style.width=b+"px";i.style.height=s+"px";i.title=t.annotation.text;i.style.color=u.colorsMap_[t.name];i.style.borderColor=u.colorsMap_[t.name];r.div=i;u.addAndTrackEvent(i,"click",y("clickHandler","annotationClickHandler",t,this));u.addAndTrackEvent(i,"mouseover",y("mouseOverHandler","annotationMouseOverHandler",t,this));u.addAndTrackEvent(i,"mouseout",y("mouseOutHandler","annotationMouseOutHandler",t,this));u.addAndTrackEvent(i,"dblclick",y("dblClickHandler","annotationDblClickHandler",t,this));g.appendChild(i);this.annotations_.push(i);f=n.drawingContext;(f.save(),f.strokeStyle=u.colorsMap_[t.name],f.beginPath(),r.attachAtBottom)?(c=a+s,f.moveTo(t.canvasx,c),f.lineTo(t.canvasx,c+o)):(f.moveTo(t.canvasx,t.canvasy),f.lineTo(t.canvasx,t.canvasy-2-o));f.closePath();f.stroke();f.restore()}},n.prototype.destroy=function(){this.detachLabels()},n}();Dygraph.Plugins.Axes=function(){"use strict";var n=function(){this.xlabels_=[];this.ylabels_=[]};return n.prototype.toString=function(){return"Axes Plugin"},n.prototype.activate=function(){return{layout:this.layout,clearChart:this.clearChart,willDrawChart:this.willDrawChart}},n.prototype.layout=function(n){var t=n.dygraph,r,i;t.getOptionForAxis("drawAxis","y")&&(i=t.getOptionForAxis("axisLabelWidth","y")+2*t.getOptionForAxis("axisTickSize","y"),n.reserveSpaceLeft(i));t.getOptionForAxis("drawAxis","x")&&(r=t.getOption("xAxisHeight")?t.getOption("xAxisHeight"):t.getOptionForAxis("axisLabelFontSize","x")+2*t.getOptionForAxis("axisTickSize","x"),n.reserveSpaceBottom(r));2==t.numAxes()?t.getOptionForAxis("drawAxis","y2")&&(i=t.getOptionForAxis("axisLabelWidth","y2")+2*t.getOptionForAxis("axisTickSize","y2"),n.reserveSpaceRight(i)):t.numAxes()>2&&t.error("Only two y-axes are supported at this time. (Trying to use "+t.numAxes()+")")},n.prototype.detachLabels=function(){function n(n){for(var i,t=0;t<n.length;t++)i=n[t],i.parentNode&&i.parentNode.removeChild(i)}n(this.xlabels_);n(this.ylabels_);this.xlabels_=[];this.ylabels_=[]},n.prototype.clearChart=function(){this.detachLabels()},n.prototype.willDrawChart=function(n){function y(n){return Math.round(n)+.5}function s(n){return Math.round(n)-.5}var i=n.dygraph,et,nt,l,v,b,f,a,k,e;if(i.getOptionForAxis("drawAxis","x")||i.getOptionForAxis("drawAxis","y")||i.getOptionForAxis("drawAxis","y2")){var u,p,w,o,h,r=n.drawingContext,it=n.canvas.parentNode,rt=i.width_,ut=i.height_,d=function(n){return{position:"absolute",fontSize:i.getOptionForAxis("axisLabelFontSize",n)+"px",zIndex:10,color:i.getOptionForAxis("axisLabelColor",n),width:i.getOptionForAxis("axisLabelWidth",n)+"px",lineHeight:"normal",overflow:"hidden"}},st={x:d("x"),y:d("y"),y2:d("y2")},ft=function(n,t,i){var f=document.createElement("div"),e=st["y2"==i?"y2":t],r,u;for(r in e)e.hasOwnProperty(r)&&(f.style[r]=e[r]);return u=document.createElement("div"),u.className="dygraph-axis-label dygraph-axis-label-"+t+(i?" dygraph-axis-label-"+i:""),u.innerHTML=n,f.appendChild(u),f};r.save();var c=i.layout_,t=n.dygraph.plotter_.area,g=function(n){return function(t){return i.getOptionForAxis(t,n)}};if(i.getOptionForAxis("drawAxis","y")){if(c.yticks&&c.yticks.length>0){for(et=i.numAxes(),nt=[g("y"),g("y2")],h=0;h<c.yticks.length;h++){if(o=c.yticks[h],"function"==typeof o)return;p=t.x;var ht=1,ot="y1",f=nt[0];1==o[0]&&(p=t.x+t.w,ht=-1,ot="y2",f=nt[1]);l=f("axisLabelFontSize");w=t.y+o[1]*t.h;u=ft(o[2],"y",2==et?ot:null);v=w-l/2;0>v&&(v=0);v+l+3>ut?u.style.bottom="0":u.style.top=v+"px";0===o[0]?(u.style.left=t.x-f("axisLabelWidth")-f("axisTickSize")+"px",u.style.textAlign="right"):1==o[0]&&(u.style.left=t.x+t.w+f("axisTickSize")+"px",u.style.textAlign="left");u.style.width=f("axisLabelWidth")+"px";it.appendChild(u);this.ylabels_.push(u)}var tt=this.ylabels_[0],l=i.getOptionForAxis("axisLabelFontSize","y"),ct=parseInt(tt.style.top,10)+l;ct>ut-l&&(tt.style.top=parseInt(tt.style.top,10)-l/2+"px")}i.getOption("drawAxesAtZero")?(e=i.toPercentXCoord(0),(e>1||0>e||isNaN(e))&&(e=0),b=y(t.x+e*t.w)):b=y(t.x);r.strokeStyle=i.getOptionForAxis("axisLineColor","y");r.lineWidth=i.getOptionForAxis("axisLineWidth","y");r.beginPath();r.moveTo(b,s(t.y));r.lineTo(b,s(t.y+t.h));r.closePath();r.stroke();2==i.numAxes()&&(r.strokeStyle=i.getOptionForAxis("axisLineColor","y2"),r.lineWidth=i.getOptionForAxis("axisLineWidth","y2"),r.beginPath(),r.moveTo(s(t.x+t.w),s(t.y)),r.lineTo(s(t.x+t.w),s(t.y+t.h)),r.closePath(),r.stroke())}if(i.getOptionForAxis("drawAxis","x")){if(c.xticks)for(f=g("x"),h=0;h<c.xticks.length;h++)o=c.xticks[h],p=t.x+o[0]*t.w,w=t.y+t.h,u=ft(o[1],"x"),u.style.textAlign="center",u.style.top=w+f("axisTickSize")+"px",a=p-f("axisLabelWidth")/2,a+f("axisLabelWidth")>rt&&(a=rt-f("axisLabelWidth"),u.style.textAlign="right"),0>a&&(a=0,u.style.textAlign="left"),u.style.left=a+"px",u.style.width=f("axisLabelWidth")+"px",it.appendChild(u),this.xlabels_.push(u);r.strokeStyle=i.getOptionForAxis("axisLineColor","x");r.lineWidth=i.getOptionForAxis("axisLineWidth","x");r.beginPath();i.getOption("drawAxesAtZero")?(e=i.toPercentYCoord(0,0),(e>1||0>e)&&(e=1),k=s(t.y+e*t.h)):k=s(t.y+t.h);r.moveTo(y(t.x),k);r.lineTo(y(t.x+t.w),k);r.closePath();r.stroke()}r.restore()}},n}();Dygraph.Plugins.ChartLabels=function(){"use strict";var n=function(){this.title_div_=null;this.xlabel_div_=null;this.ylabel_div_=null;this.y2label_div_=null},t,i;return n.prototype.toString=function(){return"ChartLabels Plugin"},n.prototype.activate=function(){return{layout:this.layout,didDrawChart:this.didDrawChart}},t=function(n){var t=document.createElement("div");return t.style.position="absolute",t.style.left=n.x+"px",t.style.top=n.y+"px",t.style.width=n.w+"px",t.style.height=n.h+"px",t},n.prototype.detachLabels_=function(){for(var n,i=[this.title_div_,this.xlabel_div_,this.ylabel_div_,this.y2label_div_],t=0;t<i.length;t++)n=i[t],n&&n.parentNode&&n.parentNode.removeChild(n);this.title_div_=null;this.xlabel_div_=null;this.ylabel_div_=null;this.y2label_div_=null},i=function(n,t,i,r,u){var e=document.createElement("div"),f,o,s;return e.style.position="absolute",e.style.left=1==i?"0px":t.x+"px",e.style.top=t.y+"px",e.style.width=t.w+"px",e.style.height=t.h+"px",e.style.fontSize=n.getOption("yLabelWidth")-2+"px",f=document.createElement("div"),f.style.position="absolute",f.style.width=t.h+"px",f.style.height=t.w+"px",f.style.top=t.h/2-t.w/2+"px",f.style.left=t.w/2-t.h/2+"px",f.style.textAlign="center",o="rotate("+(1==i?"-":"")+"90deg)",f.style.transform=o,f.style.WebkitTransform=o,f.style.MozTransform=o,f.style.OTransform=o,f.style.msTransform=o,"undefined"!=typeof document.documentMode&&document.documentMode<9&&(f.style.filter="progid:DXImageTransform.Microsoft.BasicImage(rotation="+(1==i?"3":"1")+")",f.style.left="0px",f.style.top="0px"),s=document.createElement("div"),s.className=r,s.innerHTML=u,f.appendChild(s),e.appendChild(f),e},n.prototype.layout=function(n){var r,f,e,o,u,s,h;this.detachLabels_();r=n.dygraph;f=n.chart_div;r.getOption("title")&&(e=n.reserveSpaceTop(r.getOption("titleHeight")),this.title_div_=t(e),this.title_div_.style.textAlign="center",this.title_div_.style.fontSize=r.getOption("titleHeight")-8+"px",this.title_div_.style.fontWeight="bold",this.title_div_.style.zIndex=10,u=document.createElement("div"),u.className="dygraph-label dygraph-title",u.innerHTML=r.getOption("title"),this.title_div_.appendChild(u),f.appendChild(this.title_div_));r.getOption("xlabel")&&(o=n.reserveSpaceBottom(r.getOption("xLabelHeight")),this.xlabel_div_=t(o),this.xlabel_div_.style.textAlign="center",this.xlabel_div_.style.fontSize=r.getOption("xLabelHeight")-2+"px",u=document.createElement("div"),u.className="dygraph-label dygraph-xlabel",u.innerHTML=r.getOption("xlabel"),this.xlabel_div_.appendChild(u),f.appendChild(this.xlabel_div_));r.getOption("ylabel")&&(s=n.reserveSpaceLeft(0),this.ylabel_div_=i(r,s,1,"dygraph-label dygraph-ylabel",r.getOption("ylabel")),f.appendChild(this.ylabel_div_));r.getOption("y2label")&&2==r.numAxes()&&(h=n.reserveSpaceRight(0),this.y2label_div_=i(r,h,2,"dygraph-label dygraph-y2label",r.getOption("y2label")),f.appendChild(this.y2label_div_))},n.prototype.didDrawChart=function(n){var t=n.dygraph;this.title_div_&&(this.title_div_.children[0].innerHTML=t.getOption("title"));this.xlabel_div_&&(this.xlabel_div_.children[0].innerHTML=t.getOption("xlabel"));this.ylabel_div_&&(this.ylabel_div_.children[0].children[0].innerHTML=t.getOption("ylabel"));this.y2label_div_&&(this.y2label_div_.children[0].children[0].innerHTML=t.getOption("y2label"))},n.prototype.clearChart=function(){},n.prototype.destroy=function(){this.detachLabels_()},n}();Dygraph.Plugins.Grid=function(){"use strict";var n=function(){};return n.prototype.toString=function(){return"Gridline Plugin"},n.prototype.activate=function(){return{willDrawChart:this.willDrawChart}},n.prototype.willDrawChart=function(n){function v(n){return Math.round(n)+.5}function y(n){return Math.round(n)-.5}var s,c,t,e,r=n.dygraph,i=n.drawingContext,p=r.layout_,u=n.dygraph.plotter_.area,o,f,h;if(r.getOptionForAxis("drawGrid","y")){for(var l=["y","y2"],w=[],b=[],a=[],h=[],f=[],t=0;t<l.length;t++)a[t]=r.getOptionForAxis("drawGrid",l[t]),a[t]&&(w[t]=r.getOptionForAxis("gridLineColor",l[t]),b[t]=r.getOptionForAxis("gridLineWidth",l[t]),f[t]=r.getOptionForAxis("gridLinePattern",l[t]),h[t]=f[t]&&f[t].length>=2);for(e=p.yticks,i.save(),t=0;t<e.length;t++)o=e[t][0],a[o]&&(h[o]&&i.installPattern(f[o]),i.strokeStyle=w[o],i.lineWidth=b[o],s=v(u.x),c=y(u.y+e[t][1]*u.h),i.beginPath(),i.moveTo(s,c),i.lineTo(s+u.w,c),i.closePath(),i.stroke(),h[o]&&i.uninstallPattern());i.restore()}if(r.getOptionForAxis("drawGrid","x")){for(e=p.xticks,i.save(),f=r.getOptionForAxis("gridLinePattern","x"),h=f&&f.length>=2,h&&i.installPattern(f),i.strokeStyle=r.getOptionForAxis("gridLineColor","x"),i.lineWidth=r.getOptionForAxis("gridLineWidth","x"),t=0;t<e.length;t++)s=v(u.x+e[t][0]*u.w),c=y(u.y+u.h),i.beginPath(),i.moveTo(s,c),i.lineTo(s,u.y),i.closePath(),i.stroke();h&&i.uninstallPattern();i.restore()}},n.prototype.destroy=function(){},n}();Dygraph.Plugins.Legend=function(){"use strict";var n=function(){this.legend_div_=null;this.is_generated_div_=!1},i,r,t;return n.prototype.toString=function(){return"Legend Plugin"},n.prototype.activate=function(n){var t,f=n.getOption("labelsDivWidth"),i=n.getOption("labelsDiv"),r,u;if(i&&null!==i)t="string"==typeof i||i instanceof String?document.getElementById(i):i;else{r={position:"absolute",fontSize:"14px",zIndex:10,width:f+"px",top:"0px",left:n.size().width-f-2+"px",background:"white",lineHeight:"normal",textAlign:"left",overflow:"hidden"};Dygraph.update(r,n.getOption("labelsDivStyles"));t=document.createElement("div");t.className="dygraph-legend";for(u in r)if(r.hasOwnProperty(u))try{t.style[u]=r[u]}catch(e){console.warn("You are using unsupported css properties for your browser in labelsDivStyles")}n.graphDiv.appendChild(t);this.is_generated_div_=!0}return this.legend_div_=t,this.one_em_width_=10,{select:this.select,deselect:this.deselect,predraw:this.predraw,didDrawChart:this.didDrawChart}},r=function(n){var t=document.createElement("span"),i;return t.setAttribute("style","margin: 0; padding: 0 0 0 1em; border: 0;"),n.appendChild(t),i=t.offsetWidth,n.removeChild(t),i},t=function(n){return n.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},n.prototype.select=function(t){var h=t.selectedX,r=t.selectedPoints,c=t.selectedRow,f=t.dygraph.getOption("legend"),s;if("never"===f)return void(this.legend_div_.style.display="none");if("follow"===f){var u=t.dygraph.plotter_.area,e=t.dygraph.getOption("labelsDivWidth"),o=t.dygraph.getOptionForAxis("axisLabelWidth","y"),i=r[0].x*u.w+20,l=r[0].y*u.h-20;i+e+1>window.scrollX+window.innerWidth&&(i=i-40-e-(o-u.x));t.dygraph.graphDiv.appendChild(this.legend_div_);this.legend_div_.style.left=o+i+"px";this.legend_div_.style.top=l+"px"}s=n.generateLegendHTML(t.dygraph,h,r,this.one_em_width_,c);this.legend_div_.innerHTML=s;this.legend_div_.style.display=""},n.prototype.deselect=function(t){var f=t.dygraph.getOption("legend"),i,u;"always"!==f&&(this.legend_div_.style.display="none");i=r(this.legend_div_);this.one_em_width_=i;u=n.generateLegendHTML(t.dygraph,void 0,void 0,i,null);this.legend_div_.innerHTML=u},n.prototype.didDrawChart=function(n){this.deselect(n)},n.prototype.predraw=function(n){if(this.is_generated_div_){n.dygraph.graphDiv.appendChild(this.legend_div_);var t=n.dygraph.plotter_.area,i=n.dygraph.getOption("labelsDivWidth");this.legend_div_.style.left=t.x+t.w-i-1+"px";this.legend_div_.style.top=t.y+"px";this.legend_div_.style.width=i+"px"}},n.prototype.destroy=function(){this.legend_div_=null},n.generateLegendHTML=function(n,r,u,f,e){var s,a,o,p,w,c,l,v,b,y,k,d,g,h;if(n.getOption("showLabelsOnHighlight")!==!0)return"";if(c=n.getLabels(),"undefined"==typeof r){if("always"!=n.getOption("legend"))return"";for(a=n.getOption("labelsSeparateLines"),s="",o=1;o<c.length;o++)l=n.getPropertiesForSeries(c[o]),l.visible&&(""!==s&&(s+=a?"<br/>":" "),w=n.getOption("strokePattern",c[o]),p=i(w,l.color,f),s+="<span style='font-weight: bold; color: "+l.color+";'>"+p+" "+t(c[o])+"<\/span>");return s}for(v=n.optionsViewForAxis_("x"),b=v("valueFormatter"),s=b.call(n,r,v,c[0],n,e,0),""!==s&&(s+=":"),y=[],k=n.numAxes(),o=0;k>o;o++)y[o]=n.optionsViewForAxis_("y"+(o?1+o:""));for(d=n.getOption("labelsShowZeroValues"),a=n.getOption("labelsSeparateLines"),g=n.getHighlightSeries(),o=0;o<u.length;o++)if(h=u[o],(0!==h.yval||d)&&Dygraph.isOK(h.canvasy)){a&&(s+="<br/>");var l=n.getPropertiesForSeries(h.name),nt=y[l.axis-1],tt=nt("valueFormatter"),it=tt.call(n,h.yval,nt,h.name,n,e,c.indexOf(h.name)),rt=h.name==g?" class='highlight'":"";s+="<span"+rt+"> <b><span style='color: "+l.color+";'>"+t(h.name)+"<\/span><\/b>:&#160;"+it+"<\/span>"}return s},i=function(n,t,i){var a=/MSIE/.test(navigator.userAgent)&&!window.opera,h;if(a)return"&mdash;";if(!n||n.length<=1)return'<div style="display: inline-block; position: relative; bottom: .5ex; padding-left: 1em; height: 1px; border-bottom: 2px solid '+t+';"><\/div>';for(var e,c,l,f,o=0,s=0,u=[],r=0;r<=n.length;r++)o+=n[r%n.length];if(f=Math.floor(i/(o-n[0])),f>1){for(r=0;r<n.length;r++)u[r]=n[r]/i;s=u.length}else{for(f=1,r=0;r<n.length;r++)u[r]=n[r]/o;s=u.length+1}for(h="",e=0;f>e;e++)for(r=0;s>r;r+=2)c=u[r%u.length],l=r<n.length?u[(r+1)%u.length]:0,h+='<div style="display: inline-block; position: relative; bottom: .5ex; margin-right: '+l+"em; padding-left: "+c+"em; height: 1px; border-bottom: 2px solid "+t+';"><\/div>';return h},n}();Dygraph.Plugins.RangeSelector=function(){"use strict";var n=function(){this.isIE_=/MSIE/.test(navigator.userAgent)&&!window.opera;this.hasTouchInterface_="undefined"!=typeof TouchEvent;this.isMobileDevice_=/mobile|android/gi.test(navigator.appVersion);this.interfaceCreated_=!1};return n.prototype.toString=function(){return"RangeSelector Plugin"},n.prototype.activate=function(n){return this.dygraph_=n,this.isUsingExcanvas_=n.isUsingExcanvas_,this.getOption_("showRangeSelector")&&this.createInterface_(),{layout:this.reserveSpace_,predraw:this.renderStaticLayer_,didDrawChart:this.renderInteractiveLayer_}},n.prototype.destroy=function(){this.bgcanvas_=null;this.fgcanvas_=null;this.leftZoomHandle_=null;this.rightZoomHandle_=null;this.iePanOverlay_=null},n.prototype.getOption_=function(n,t){return this.dygraph_.getOption(n,t)},n.prototype.setDefaultOption_=function(n,t){this.dygraph_.attrs_[n]=t},n.prototype.createInterface_=function(){this.createCanvases_();this.isUsingExcanvas_&&this.createIEPanOverlay_();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_()},n.prototype.addToGraph_=function(){var n=this.graphDiv_=this.dygraph_.graphDiv;n.appendChild(this.bgcanvas_);n.appendChild(this.fgcanvas_);n.appendChild(this.leftZoomHandle_);n.appendChild(this.rightZoomHandle_)},n.prototype.removeFromGraph_=function(){var n=this.graphDiv_;n.removeChild(this.bgcanvas_);n.removeChild(this.fgcanvas_);n.removeChild(this.leftZoomHandle_);n.removeChild(this.rightZoomHandle_);this.graphDiv_=null},n.prototype.reserveSpace_=function(n){this.getOption_("showRangeSelector")&&n.reserveSpaceBottom(this.getOption_("rangeSelectorHeight")+4)},n.prototype.renderStaticLayer_=function(){this.updateVisibility_()&&(this.resize_(),this.drawStaticLayer_())},n.prototype.renderInteractiveLayer_=function(){this.updateVisibility_()&&!this.isChangingRange_&&(this.placeZoomHandles_(),this.drawInteractiveLayer_())},n.prototype.updateVisibility_=function(){var t=this.getOption_("showRangeSelector"),n;return t?this.interfaceCreated_?this.graphDiv_&&this.graphDiv_.parentNode||this.addToGraph_():this.createInterface_():this.graphDiv_&&(this.removeFromGraph_(),n=this.dygraph_,setTimeout(function(){n.width_=0;n.resize()},1)),t},n.prototype.resize_=function(){function t(n,t,i){var r=Dygraph.getContextPixelRatio(t);n.style.top=i.y+"px";n.style.left=i.x+"px";n.width=i.w*r;n.height=i.h*r;n.style.width=i.w+"px";n.style.height=i.h+"px";1!=r&&t.scale(r,r)}var n=this.dygraph_.layout_.getPlotArea(),i=0;this.dygraph_.getOptionForAxis("drawAxis","x")&&(i=this.getOption_("xAxisHeight")||this.getOption_("axisLabelFontSize")+2*this.getOption_("axisTickSize"));this.canvasRect_={x:n.x,y:n.y+n.h+i+4,w:n.w,h:this.getOption_("rangeSelectorHeight")};t(this.bgcanvas_,this.bgcanvas_ctx_,this.canvasRect_);t(this.fgcanvas_,this.fgcanvas_ctx_,this.canvasRect_)},n.prototype.createCanvases_=function(){this.bgcanvas_=Dygraph.createCanvas();this.bgcanvas_.className="dygraph-rangesel-bgcanvas";this.bgcanvas_.style.position="absolute";this.bgcanvas_.style.zIndex=9;this.bgcanvas_ctx_=Dygraph.getContext(this.bgcanvas_);this.fgcanvas_=Dygraph.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_=Dygraph.getContext(this.fgcanvas_)},n.prototype.createIEPanOverlay_=function(){this.iePanOverlay_=document.createElement("div");this.iePanOverlay_.style.position="absolute";this.iePanOverlay_.style.backgroundColor="white";this.iePanOverlay_.style.filter="alpha(opacity=0)";this.iePanOverlay_.style.display="none";this.iePanOverlay_.style.cursor="move";this.fgcanvas_.appendChild(this.iePanOverlay_)},n.prototype.createZoomHandles_=function(){var n=new Image;n.className="dygraph-rangesel-zoomhandle";n.style.position="absolute";n.style.zIndex=10;n.style.visibility="hidden";n.style.cursor="col-resize";/MSIE 7/.test(navigator.userAgent)?(n.width=7,n.height=14,n.style.backgroundColor="white",n.style.border="1px solid #333333"):(n.width=9,n.height=16,n.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAQCAYAAADESFVDAAAAAXNSR0IArs4c6QAAAAZiS0dEANAAzwDP4Z7KegAAAAlwSFlzAAAOxAAADsQBlSsOGwAAAAd0SU1FB9sHGw0cMqdt1UwAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAaElEQVQoz+3SsRFAQBCF4Z9WJM8KCDVwownl6YXsTmCUsyKGkZzcl7zkz3YLkypgAnreFmDEpHkIwVOMfpdi9CEEN2nGpFdwD03yEqDtOgCaun7sqSTDH32I1pQA2Pb9sZecAxc5r3IAb21d6878xsAAAAAASUVORK5CYII=");this.isMobileDevice_&&(n.width*=2,n.height*=2);this.leftZoomHandle_=n;this.rightZoomHandle_=n.cloneNode(!1)},n.prototype.initInteraction_=function(){var y,e,o,s,p,w,h,c,l,b,g,k,nt,a,n=this,t=document,i=0,r=null,f=!1,u=!1,v=!this.isMobileDevice_&&!this.isUsingExcanvas_,tt=new Dygraph.IFrameTarp,d;y=function(t){var i=n.dygraph_.xAxisExtremes(),r=(i[1]-i[0])/n.canvasRect_.w,u=i[0]+(t.leftHandlePos-n.canvasRect_.x)*r,f=i[0]+(t.rightHandlePos-n.canvasRect_.x)*r;return[u,f]};e=function(u){return Dygraph.cancelEvent(u),f=!0,i=u.clientX,r=u.target?u.target:u.srcElement,("mousedown"===u.type||"dragstart"===u.type)&&(Dygraph.addEvent(t,"mousemove",o),Dygraph.addEvent(t,"mouseup",s)),n.fgcanvas_.style.cursor="col-resize",tt.cover(),!0};o=function(t){var o,u,e,s;return f?(Dygraph.cancelEvent(t),o=t.clientX-i,Math.abs(o)<4)?!0:(i=t.clientX,e=n.getZoomHandleStatus_(),r==n.leftZoomHandle_?(u=e.leftHandlePos+o,u=Math.min(u,e.rightHandlePos-r.width-3),u=Math.max(u,n.canvasRect_.x)):(u=e.rightHandlePos+o,u=Math.min(u,n.canvasRect_.x+n.canvasRect_.w),u=Math.max(u,e.leftHandlePos+r.width+3)),s=r.width/2,r.style.left=u-s+"px",n.drawInteractiveLayer_(),v&&p(),!0):!1};s=function(){return f?(f=!1,tt.uncover(),Dygraph.removeEvent(t,"mousemove",o),Dygraph.removeEvent(t,"mouseup",s),n.fgcanvas_.style.cursor="default",v||p(),!0):!1};p=function(){var t,i;try{t=n.getZoomHandleStatus_();(n.isChangingRange_=!0,t.isZoomed)?(i=y(t),n.dygraph_.doZoomXDates_(i[0],i[1])):n.dygraph_.resetZoom()}finally{n.isChangingRange_=!1}};w=function(t){var i,r,u;return n.isUsingExcanvas_?t.srcElement==n.iePanOverlay_:(i=n.leftZoomHandle_.getBoundingClientRect(),r=i.left+i.width/2,i=n.rightZoomHandle_.getBoundingClientRect(),u=i.left+i.width/2,t.clientX>r&&t.clientX<u)};h=function(r){return!u&&w(r)&&n.getZoomHandleStatus_().isZoomed?(Dygraph.cancelEvent(r),u=!0,i=r.clientX,"mousedown"===r.type&&(Dygraph.addEvent(t,"mousemove",c),Dygraph.addEvent(t,"mouseup",l)),!0):!1};c=function(t){var e,o;if(!u)return!1;if(Dygraph.cancelEvent(t),e=t.clientX-i,Math.abs(e)<4)return!0;i=t.clientX;var s=n.getZoomHandleStatus_(),r=s.leftHandlePos,f=s.rightHandlePos,h=f-r;return r+e<=n.canvasRect_.x?(r=n.canvasRect_.x,f=r+h):f+e>=n.canvasRect_.x+n.canvasRect_.w?(f=n.canvasRect_.x+n.canvasRect_.w,r=f-h):(r+=e,f+=e),o=n.leftZoomHandle_.width/2,n.leftZoomHandle_.style.left=r-o+"px",n.rightZoomHandle_.style.left=f-o+"px",n.drawInteractiveLayer_(),v&&b(),!0};l=function(){return u?(u=!1,Dygraph.removeEvent(t,"mousemove",c),Dygraph.removeEvent(t,"mouseup",l),v||b(),!0):!1};b=function(){try{n.isChangingRange_=!0;n.dygraph_.dateWindow_=y(n.getZoomHandleStatus_());n.dygraph_.drawGraph_(!1)}finally{n.isChangingRange_=!1}};g=function(t){if(!f&&!u){var i=w(t)?"move":"default";i!=n.fgcanvas_.style.cursor&&(n.fgcanvas_.style.cursor=i)}};k=function(n){"touchstart"==n.type&&1==n.targetTouches.length?e(n.targetTouches[0])&&Dygraph.cancelEvent(n):"touchmove"==n.type&&1==n.targetTouches.length?o(n.targetTouches[0])&&Dygraph.cancelEvent(n):s(n)};nt=function(n){"touchstart"==n.type&&1==n.targetTouches.length?h(n.targetTouches[0])&&Dygraph.cancelEvent(n):"touchmove"==n.type&&1==n.targetTouches.length?c(n.targetTouches[0])&&Dygraph.cancelEvent(n):l(n)};a=function(t,i){for(var u=["touchstart","touchend","touchmove","touchcancel"],r=0;r<u.length;r++)n.dygraph_.addAndTrackEvent(t,u[r],i)};this.setDefaultOption_("interactionModel",Dygraph.Interaction.dragIsPanInteractionModel);this.setDefaultOption_("panEdgeFraction",.0001);d=window.opera?"mousedown":"dragstart";this.dygraph_.addAndTrackEvent(this.leftZoomHandle_,d,e);this.dygraph_.addAndTrackEvent(this.rightZoomHandle_,d,e);this.isUsingExcanvas_?this.dygraph_.addAndTrackEvent(this.iePanOverlay_,"mousedown",h):(this.dygraph_.addAndTrackEvent(this.fgcanvas_,"mousedown",h),this.dygraph_.addAndTrackEvent(this.fgcanvas_,"mousemove",g));this.hasTouchInterface_&&(a(this.leftZoomHandle_,k),a(this.rightZoomHandle_,k),a(this.fgcanvas_,nt))},n.prototype.drawStaticLayer_=function(){var t=this.bgcanvas_ctx_,n;t.clearRect(0,0,this.canvasRect_.w,this.canvasRect_.h);try{this.drawMiniPlot_()}catch(i){console.warn(i)}n=.5;this.bgcanvas_ctx_.lineWidth=1;t.strokeStyle="gray";t.beginPath();t.moveTo(n,n);t.lineTo(n,this.canvasRect_.h-n);t.lineTo(this.canvasRect_.w-n,this.canvasRect_.h-n);t.lineTo(this.canvasRect_.w-n,n);t.stroke()},n.prototype.drawMiniPlot_=function(){var c=this.getOption_("rangeSelectorPlotFillColor"),l=this.getOption_("rangeSelectorPlotStrokeColor"),o,h;if(c||l){var a=this.getOption_("stepPlot"),u=this.computeCombinedSeriesAndLimits_(),p=u.yMax-u.yMin,n=this.bgcanvas_ctx_,f=.5,v=this.dygraph_.xAxisExtremes(),w=Math.max(v[1]-v[0],1e-30),b=(this.canvasRect_.w-f)/w,k=(this.canvasRect_.h-f)/p,d=this.canvasRect_.w-f,i=this.canvasRect_.h-f,r=null,e=null;for(n.beginPath(),n.moveTo(f,i),o=0;o<u.data.length;o++){var s=u.data[o],t=null!==s[0]?(s[0]-v[0])*b:NaN,y=null!==s[1]?i-(s[1]-u.yMin)*k:NaN;(a||null===r||Math.round(t)!=Math.round(r))&&(isFinite(t)&&isFinite(y)?(null===r?n.lineTo(t,i):a&&n.lineTo(t,e),n.lineTo(t,y),r=t,e=y):(null!==r&&(a?(n.lineTo(t,e),n.lineTo(t,i)):n.lineTo(r,i)),r=e=null))}(n.lineTo(d,i),n.closePath(),c)&&(h=this.bgcanvas_ctx_.createLinearGradient(0,0,0,i),h.addColorStop(0,"white"),h.addColorStop(1,c),this.bgcanvas_ctx_.fillStyle=h,n.fill());l&&(this.bgcanvas_ctx_.strokeStyle=l,this.bgcanvas_ctx_.lineWidth=1.5,n.stroke())}},n.prototype.computeCombinedSeriesAndLimits_=function(){for(var i=this.dygraph_,p=this.getOption_("logscale"),w=i.numColumns(),tt=i.getLabels(),o=new Array(w),b=!1,l,s,r,h,u,t,f,c,v,y,n=1;w>n;n++)l=this.getOption_("showInRangeSelector",tt[n]),o[n]=l,null!==l&&(b=!0);if(!b)for(n=0;n<o.length;n++)o[n]=!0;var e=[],k=i.dataHandler_,d=i.attributes_;for(n=1;n<i.numColumns();n++)o[n]&&(s=k.extractSeries(i.rawData_,n,d),i.rollPeriod()>1&&(s=k.rollingAverage(s,i.rollPeriod(),d)),e.push(s));for(r=[],n=0;n<e[0].length;n++){for(var g=0,nt=0,a=0;a<e.length;a++)h=e[a][n][1],null===h||isNaN(h)||(nt++,g+=h);r.push([e[0][n][0],g/nt])}for(u=Number.MAX_VALUE,t=-Number.MAX_VALUE,n=0;n<r.length;n++)f=r[n][1],null!==f&&isFinite(f)&&(!p||f>0)&&(u=Math.min(u,f),t=Math.max(t,f));if(c=.25,p)for(t=Dygraph.log10(t),t+=t*c,u=Dygraph.log10(u),n=0;n<r.length;n++)r[n][1]=Dygraph.log10(r[n][1]);else y=t-u,v=y<=Number.MIN_VALUE?t*c:y*c,t+=v,u-=v;return{data:r,yMin:u,yMax:t}},n.prototype.placeZoomHandles_=function(){var n=this.dygraph_.xAxisExtremes(),t=this.dygraph_.xAxisRange(),i=n[1]-n[0],u=Math.max(0,(t[0]-n[0])/i),f=Math.max(0,(n[1]-t[1])/i),e=this.canvasRect_.x+this.canvasRect_.w*u,o=this.canvasRect_.x+this.canvasRect_.w*(1-f),s=Math.max(this.canvasRect_.y,this.canvasRect_.y+(this.canvasRect_.h-this.leftZoomHandle_.height)/2),r=this.leftZoomHandle_.width/2;this.leftZoomHandle_.style.left=e-r+"px";this.leftZoomHandle_.style.top=s+"px";this.rightZoomHandle_.style.left=o-r+"px";this.rightZoomHandle_.style.top=this.leftZoomHandle_.style.top;this.leftZoomHandle_.style.visibility="visible";this.rightZoomHandle_.style.visibility="visible"},n.prototype.drawInteractiveLayer_=function(){var n=this.fgcanvas_ctx_,i,r;n.clearRect(0,0,this.canvasRect_.w,this.canvasRect_.h);var t=1,f=this.canvasRect_.w-t,u=this.canvasRect_.h-t,e=this.getZoomHandleStatus_();(n.strokeStyle="black",e.isZoomed)?(i=Math.max(t,e.leftHandlePos-this.canvasRect_.x),r=Math.min(f,e.rightHandlePos-this.canvasRect_.x),n.fillStyle="rgba(240, 240, 240, 0.6)",n.fillRect(0,0,i,this.canvasRect_.h),n.fillRect(r,0,this.canvasRect_.w-r,this.canvasRect_.h),n.beginPath(),n.moveTo(t,t),n.lineTo(i,t),n.lineTo(i,u),n.lineTo(r,u),n.lineTo(r,t),n.lineTo(f,t),n.stroke(),this.isUsingExcanvas_&&(this.iePanOverlay_.style.width=r-i+"px",this.iePanOverlay_.style.left=i+"px",this.iePanOverlay_.style.height=u+"px",this.iePanOverlay_.style.display="inline")):(n.beginPath(),n.moveTo(t,t),n.lineTo(t,u),n.lineTo(f,u),n.lineTo(f,t),n.stroke(),this.iePanOverlay_&&(this.iePanOverlay_.style.display="none"))},n.prototype.getZoomHandleStatus_=function(){var n=this.leftZoomHandle_.width/2,t=parseFloat(this.leftZoomHandle_.style.left)+n,i=parseFloat(this.rightZoomHandle_.style.left)+n;return{leftHandlePos:t,rightHandlePos:i,isZoomed:t-1>this.canvasRect_.x||i+1<this.canvasRect_.x+this.canvasRect_.w}},n}();Dygraph.PLUGINS.push(Dygraph.Plugins.Legend,Dygraph.Plugins.Axes,Dygraph.Plugins.RangeSelector,Dygraph.Plugins.ChartLabels,Dygraph.Plugins.Annotations,Dygraph.Plugins.Grid);Dygraph.DataHandler=function(){};Dygraph.DataHandlers={},function(){"use strict";var n=Dygraph.DataHandler;n.X=0;n.Y=1;n.EXTRAS=2;n.prototype.extractSeries=function(){};n.prototype.seriesToPoints=function(t,i,r){for(var f=[],u=0;u<t.length;++u){var e=t[u],o=e[1],s=null===o?null:n.parseFloat(o),h={x:NaN,y:NaN,xval:n.parseFloat(e[0]),yval:s,name:i,idx:u+r};f.push(h)}return this.onPointsCreated_(t,f),f};n.prototype.onPointsCreated_=function(){};n.prototype.rollingAverage=function(){};n.prototype.getExtremeYValues=function(){};n.prototype.onLineEvaluated=function(){};n.prototype.computeYInterpolation_=function(n,t,i){var r=t[1]-n[1],u=t[0]-n[0],f=r/u,e=(i-n[0])*f;return n[1]+e};n.prototype.getIndexesInWindow_=function(n,t){var r=0,u=n.length-1;if(t){for(var i=0,f=t[0],e=t[1];i<n.length-1&&n[i][0]<f;)r++,i++;for(i=n.length-1;i>0&&n[i][0]>e;)u--,i--}return u>=r?[r,u]:[0,n.length-1]};n.parseFloat=function(n){return null===n?NaN:n}}(),function(){"use strict";Dygraph.DataHandlers.DefaultHandler=function(){};var n=Dygraph.DataHandlers.DefaultHandler;n.prototype=new Dygraph.DataHandler;n.prototype.extractSeries=function(n,t,i){for(var e,u,f=[],o=i.get("logscale"),r=0;r<n.length;r++)e=n[r][0],u=n[r][t],o&&0>=u&&(u=null),f.push([e,u]);return f};n.prototype.rollingAverage=function(n,t){t=Math.min(t,n.length);var i,r,f,e,u,o=[];if(1==t)return n;for(i=0;i<n.length;i++){for(e=0,u=0,r=Math.max(0,i-t+1);i+1>r;r++)f=n[r][1],null===f||isNaN(f)||(u++,e+=n[r][1]);o[i]=u?[n[i][0],e/u]:[n[i][0],null]}return o};n.prototype.getExtremeYValues=function(n){for(var t,i=null,r=null,f=n.length-1,u=0;f>=u;u++)t=n[u][1],null===t||isNaN(t)||((null===r||t>r)&&(r=t),(null===i||i>t)&&(i=t));return[i,r]}}(),function(){"use strict";Dygraph.DataHandlers.DefaultFractionHandler=function(){};var n=Dygraph.DataHandlers.DefaultFractionHandler;n.prototype=new Dygraph.DataHandlers.DefaultHandler;n.prototype.extractSeries=function(n,t,i){for(var e,h,r,u,f,c,o=[],l=i.get("logscale"),s=0;s<n.length;s++)e=n[s][0],r=n[s][t],l&&null!==r&&(r[0]<=0||r[1]<=0)&&(r=null),null!==r?(u=r[0],f=r[1],null===u||isNaN(u)?o.push([e,u,[u,f]]):(c=f?u/f:0,h=100*c,o.push([e,h,[u,f]]))):o.push([e,null,[null,null]]);return o};n.prototype.rollingAverage=function(n,t){var e,o;t=Math.min(t,n.length);for(var f=[],u=0,r=0,i=0;i<n.length;i++)u+=n[i][2][0],r+=n[i][2][1],i-t>=0&&(u-=n[i-t][2][0],r-=n[i-t][2][1]),e=n[i][0],o=r?u/r:0,f[i]=[e,100*o];return f}}(),function(){"use strict";Dygraph.DataHandlers.BarsHandler=function(){Dygraph.DataHandler.call(this)};Dygraph.DataHandlers.BarsHandler.prototype=new Dygraph.DataHandler;var n=Dygraph.DataHandlers.BarsHandler;n.prototype.extractSeries=function(){};n.prototype.rollingAverage=function(){};n.prototype.onPointsCreated_=function(n,t){for(var u,r,i=0;i<n.length;++i)u=n[i],r=t[i],r.y_top=NaN,r.y_bottom=NaN,r.yval_minus=Dygraph.DataHandler.parseFloat(u[2][0]),r.yval_plus=Dygraph.DataHandler.parseFloat(u[2][1])};n.prototype.getExtremeYValues=function(n){for(var r,u,t,f=null,e=null,o=n.length-1,i=0;o>=i;i++)(t=n[i][1],null===t||isNaN(t))||(r=n[i][2][0],u=n[i][2][1],r>t&&(r=t),t>u&&(u=t),(null===e||u>e)&&(e=u),(null===f||f>r)&&(f=r));return[f,e]};n.prototype.onLineEvaluated=function(n,t,i){for(var r,u=0;u<n.length;u++)r=n[u],r.y_top=DygraphLayout.calcYNormal_(t,r.yval_minus,i),r.y_bottom=DygraphLayout.calcYNormal_(t,r.yval_plus,i)}}(),function(){"use strict";Dygraph.DataHandlers.CustomBarsHandler=function(){};var n=Dygraph.DataHandlers.CustomBarsHandler;n.prototype=new Dygraph.DataHandlers.BarsHandler;n.prototype.extractSeries=function(n,t,i){for(var f,u,r,o=[],s=i.get("logscale"),e=0;e<n.length;e++)f=n[e][0],r=n[e][t],s&&null!==r&&(r[0]<=0||r[1]<=0||r[2]<=0)&&(r=null),null!==r?(u=r[1],o.push(null===u||isNaN(u)?[f,u,[u,u]]:[f,u,[r[0],r[2]]])):o.push([f,null,[null,null]]);return o};n.prototype.rollingAverage=function(n,t){var f,e,o,s,r,i,c,h,u;for(t=Math.min(t,n.length),h=[],e=0,s=0,o=0,r=0,i=0;i<n.length;i++)(f=n[i][1],c=n[i][2],h[i]=n[i],null===f||isNaN(f)||(e+=c[0],s+=f,o+=c[1],r+=1),i-t>=0)&&(u=n[i-t],null===u[1]||isNaN(u[1])||(e-=u[2][0],s-=u[1],o-=u[2][1],r-=1)),h[i]=r?[n[i][0],1*s/r,[1*e/r,1*o/r]]:[n[i][0],null,[null,null]];return h}}(),function(){"use strict";Dygraph.DataHandlers.ErrorBarsHandler=function(){};var n=Dygraph.DataHandlers.ErrorBarsHandler;n.prototype=new Dygraph.DataHandlers.BarsHandler;n.prototype.extractSeries=function(n,t,i){for(var f,r,s,u,e=[],h=i.get("sigma"),c=i.get("logscale"),o=0;o<n.length;o++)f=n[o][0],u=n[o][t],c&&null!==u&&(u[0]<=0||u[0]-h*u[1]<=0)&&(u=null),null!==u?(r=u[0],null===r||isNaN(r)?e.push([f,r,[r,r,r]]):(s=h*u[1],e.push([f,r,[r-s,r+s,u[1]]]))):e.push([f,null,[null,null,null]]);return e};n.prototype.rollingAverage=function(n,t,i){t=Math.min(t,n.length);for(var u,e,o,h,f,c,l,s,a=[],v=i.get("sigma"),r=0;r<n.length;r++){for(h=0,l=0,f=0,u=Math.max(0,r-t+1);r+1>u;u++)e=n[u][1],null===e||isNaN(e)||(f++,h+=e,l+=Math.pow(n[u][2][2],2));f?(c=Math.sqrt(l)/f,s=h/f,a[r]=[n[r][0],s,[s-v*c,s+v*c]]):(o=1==t?n[r][1]:null,a[r]=[n[r][0],o,[o,o]])}return a}}(),function(){"use strict";Dygraph.DataHandlers.FractionsBarsHandler=function(){};var n=Dygraph.DataHandlers.FractionsBarsHandler;n.prototype=new Dygraph.DataHandlers.BarsHandler;n.prototype.extractSeries=function(n,t,i){for(var e,o,u,r,f,s,a,l,h=[],v=100,y=i.get("sigma"),p=i.get("logscale"),c=0;c<n.length;c++)e=n[c][0],u=n[c][t],p&&null!==u&&(u[0]<=0||u[1]<=0)&&(u=null),null!==u?(r=u[0],f=u[1],null===r||isNaN(r)?h.push([e,r,[r,r,r,f]]):(s=f?r/f:0,a=f?y*Math.sqrt(s*(1-s)/f):1,l=v*a,o=v*s,h.push([e,o,[o-l,o+l,r,f]]))):h.push([e,null,[null,null,null,null]]);return h};n.prototype.rollingAverage=function(n,t,i){var c,e;t=Math.min(t,n.length);for(var y,p,l,h=[],f=i.get("sigma"),k=i.get("wilsonInterval"),a=0,u=0,o=100,r=0;r<n.length;r++)if(a+=n[r][2][2],u+=n[r][2][3],r-t>=0&&(a-=n[r-t][2][2],u-=n[r-t][2][3]),c=n[r][0],e=u?a/u:0,k)if(u){var s=0>e?0:e,v=u,w=f*Math.sqrt(s*(1-s)/v+f*f/(4*v*v)),b=1+f*f/u;y=(s+f*f/(2*u)-w)/b;p=(s+f*f/(2*u)+w)/b;h[r]=[c,s*o,[y*o,p*o]]}else h[r]=[c,0,[0,0]];else l=u?f*Math.sqrt(e*(1-e)/u):1,h[r]=[c,o*e,[o*(e-l),o*(e+l)]];return h}}();
  //# sourceMappingURL=dygraph-combined.min.js.map
  