/*
 Highcharts JS v6.0.4 (2017-12-15)
 Highstock as a plugin for Highcharts

 (c) 2017 Torstein Honsi

 License: www.highcharts.com/license
*/
(function(J){"object"===typeof module&&module.exports?module.exports=J:J(Highcharts)})(function(J){(function(a){var D=a.addEvent,y=a.Axis,B=a.Chart,A=a.css,E=a.dateFormat,v=a.defined,G=a.each,l=a.extend,t=a.noop,p=a.pick,H=a.timeUnits,n=a.wrap;n(a.Series.prototype,"init",function(a){var b;a.apply(this,Array.prototype.slice.call(arguments,1));(b=this.xAxis)&&b.options.ordinal&&D(this,"updatedData",function(){delete b.ordinalIndex})});n(y.prototype,"getTimeTicks",function(a,b,h,u,q,f,c,r){var g=0,x,
e,k={},m,d,z,w=[],N=-Number.MAX_VALUE,F=this.options.tickPixelInterval;if(!this.options.ordinal&&!this.options.breaks||!f||3>f.length||void 0===h)return a.call(this,b,h,u,q);d=f.length;for(x=0;x<d;x++){z=x&&f[x-1]>u;f[x]<h&&(g=x);if(x===d-1||f[x+1]-f[x]>5*c||z){if(f[x]>N){for(e=a.call(this,b,f[g],f[x],q);e.length&&e[0]<=N;)e.shift();e.length&&(N=e[e.length-1]);w=w.concat(e)}g=x+1}if(z)break}a=e.info;if(r&&a.unitRange<=H.hour){x=w.length-1;for(g=1;g<x;g++)E("%d",w[g])!==E("%d",w[g-1])&&(k[w[g]]="day",
m=!0);m&&(k[w[0]]="day");a.higherRanks=k}w.info=a;if(r&&v(F)){r=a=w.length;x=[];var K;for(m=[];r--;)g=this.translate(w[r]),K&&(m[r]=K-g),x[r]=K=g;m.sort();m=m[Math.floor(m.length/2)];m<.6*F&&(m=null);r=w[a-1]>u?a-1:a;for(K=void 0;r--;)g=x[r],u=Math.abs(K-g),K&&u<.8*F&&(null===m||u<.8*m)?(k[w[r]]&&!k[w[r+1]]?(u=r+1,K=g):u=r,w.splice(u,1)):K=g}return w});l(y.prototype,{beforeSetTickPositions:function(){var a,b=[],h=!1,u,q=this.getExtremes(),f=q.min,c=q.max,r,C=this.isXAxis&&!!this.options.breaks,q=
this.options.ordinal,x=Number.MAX_VALUE,e=this.chart.options.chart.ignoreHiddenSeries;u="highcharts-navigator-xaxis"===this.options.className;!this.options.overscroll||this.max!==this.dataMax||this.chart.mouseIsDown&&!u||this.eventArgs&&(!this.eventArgs||"navigator"===this.eventArgs.trigger)||(this.max+=this.options.overscroll,!u&&v(this.userMin)&&(this.min+=this.options.overscroll));if(q||C){G(this.series,function(k,m){if(!(e&&!1===k.visible||!1===k.takeOrdinalPosition&&!C)&&(b=b.concat(k.processedXData),
a=b.length,b.sort(function(d,z){return d-z}),x=Math.min(x,p(k.closestPointRange,x)),a))for(m=a-1;m--;)b[m]===b[m+1]&&b.splice(m,1)});a=b.length;if(2<a){u=b[1]-b[0];for(r=a-1;r--&&!h;)b[r+1]-b[r]!==u&&(h=!0);!this.options.keepOrdinalPadding&&(b[0]-f>u||c-b[b.length-1]>u)&&(h=!0)}else this.options.overscroll&&(2===a?x=b[1]-b[0]:1===a?(x=this.options.overscroll,b=[b[0],b[0]+x]):x=this.overscrollPointsRange);h?(this.options.overscroll&&(this.overscrollPointsRange=x,b=b.concat(this.getOverscrollPositions())),
this.ordinalPositions=b,u=this.ordinal2lin(Math.max(f,b[0]),!0),r=Math.max(this.ordinal2lin(Math.min(c,b[b.length-1]),!0),1),this.ordinalSlope=c=(c-f)/(r-u),this.ordinalOffset=f-u*c):(this.overscrollPointsRange=p(this.closestPointRange,this.overscrollPointsRange),this.ordinalPositions=this.ordinalSlope=this.ordinalOffset=void 0)}this.isOrdinal=q&&h;this.groupIntervalFactor=null},val2lin:function(a,b){var h=this.ordinalPositions;if(h){var g=h.length,q,f;for(q=g;q--;)if(h[q]===a){f=q;break}for(q=g-
1;q--;)if(a>h[q]||0===q){a=(a-h[q])/(h[q+1]-h[q]);f=q+a;break}b=b?f:this.ordinalSlope*(f||0)+this.ordinalOffset}else b=a;return b},lin2val:function(a,b){var h=this.ordinalPositions;if(h){var g=this.ordinalSlope,q=this.ordinalOffset,f=h.length-1,c;if(b)0>a?a=h[0]:a>f?a=h[f]:(f=Math.floor(a),c=a-f);else for(;f--;)if(b=g*f+q,a>=b){g=g*(f+1)+q;c=(a-b)/(g-b);break}return void 0!==c&&void 0!==h[f]?h[f]+(c?c*(h[f+1]-h[f]):0):a}return a},getExtendedPositions:function(){var a=this,b=a.chart,h=a.series[0].currentDataGrouping,
u=a.ordinalIndex,q=h?h.count+h.unitName:"raw",f=a.options.overscroll,c=a.getExtremes(),r,C;u||(u=a.ordinalIndex={});u[q]||(r={series:[],chart:b,getExtremes:function(){return{min:c.dataMin,max:c.dataMax+f}},options:{ordinal:!0},val2lin:y.prototype.val2lin,ordinal2lin:y.prototype.ordinal2lin},G(a.series,function(f){C={xAxis:r,xData:f.xData.slice(),chart:b,destroyGroupedData:t};C.xData=C.xData.concat(a.getOverscrollPositions());C.options={dataGrouping:h?{enabled:!0,forced:!0,approximation:"open",units:[[h.unitName,
[h.count]]]}:{enabled:!1}};f.processData.apply(C);r.series.push(C)}),a.beforeSetTickPositions.apply(r),u[q]=r.ordinalPositions);return u[q]},getOverscrollPositions:function(){var g=this.options.overscroll,b=this.overscrollPointsRange,h=[],u=this.dataMax;if(a.defined(b))for(h.push(u);u<=this.dataMax+g;)u+=b,h.push(u);return h},getGroupIntervalFactor:function(a,b,h){var g;h=h.processedXData;var q=h.length,f=[];g=this.groupIntervalFactor;if(!g){for(g=0;g<q-1;g++)f[g]=h[g+1]-h[g];f.sort(function(f,a){return f-
a});f=f[Math.floor(q/2)];a=Math.max(a,h[0]);b=Math.min(b,h[q-1]);this.groupIntervalFactor=g=q*f/(b-a)}return g},postProcessTickInterval:function(a){var b=this.ordinalSlope;return b?this.options.breaks?this.closestPointRange||a:a/(b/this.closestPointRange):a}});y.prototype.ordinal2lin=y.prototype.val2lin;n(B.prototype,"pan",function(a,b){var h=this.xAxis[0],g=h.options.overscroll,q=b.chartX,f=!1;if(h.options.ordinal&&h.series.length){var c=this.mouseDownX,r=h.getExtremes(),C=r.dataMax,x=r.min,e=r.max,
k=this.hoverPoints,m=h.closestPointRange||h.overscrollPointsRange,c=(c-q)/(h.translationSlope*(h.ordinalSlope||m)),d={ordinalPositions:h.getExtendedPositions()},m=h.lin2val,z=h.val2lin,w;d.ordinalPositions?1<Math.abs(c)&&(k&&G(k,function(d){d.setState()}),0>c?(k=d,w=h.ordinalPositions?h:d):(k=h.ordinalPositions?h:d,w=d),d=w.ordinalPositions,C>d[d.length-1]&&d.push(C),this.fixedRange=e-x,c=h.toFixedRange(null,null,m.apply(k,[z.apply(k,[x,!0])+c,!0]),m.apply(w,[z.apply(w,[e,!0])+c,!0])),c.min>=Math.min(r.dataMin,
x)&&c.max<=Math.max(C,e)+g&&h.setExtremes(c.min,c.max,!0,!1,{trigger:"pan"}),this.mouseDownX=q,A(this.container,{cursor:"move"})):f=!0}else f=!0;f&&(g&&(h.max=h.dataMax+g),a.apply(this,Array.prototype.slice.call(arguments,1)))})})(J);(function(a){function D(){return Array.prototype.slice.call(arguments,1)}function y(a){a.apply(this);this.drawBreaks(this.xAxis,["x"]);this.drawBreaks(this.yAxis,B(this.pointArrayMap,["y"]))}var B=a.pick,A=a.wrap,E=a.each,v=a.extend,G=a.isArray,l=a.fireEvent,t=a.Axis,
p=a.Series;v(t.prototype,{isInBreak:function(a,n){var g=a.repeat||Infinity,b=a.from,h=a.to-a.from;n=n>=b?(n-b)%g:g-(b-n)%g;return a.inclusive?n<=h:n<h&&0!==n},isInAnyBreak:function(a,n){var g=this.options.breaks,b=g&&g.length,h,u,q;if(b){for(;b--;)this.isInBreak(g[b],a)&&(h=!0,u||(u=B(g[b].showPoints,this.isXAxis?!1:!0)));q=h&&n?h&&!u:h}return q}});A(t.prototype,"setTickPositions",function(a){a.apply(this,Array.prototype.slice.call(arguments,1));if(this.options.breaks){var n=this.tickPositions,g=
this.tickPositions.info,b=[],h;for(h=0;h<n.length;h++)this.isInAnyBreak(n[h])||b.push(n[h]);this.tickPositions=b;this.tickPositions.info=g}});A(t.prototype,"init",function(a,n,g){var b=this;g.breaks&&g.breaks.length&&(g.ordinal=!1);a.call(this,n,g);a=this.options.breaks;b.isBroken=G(a)&&!!a.length;b.isBroken&&(b.val2lin=function(a){var h=a,g,f;for(f=0;f<b.breakArray.length;f++)if(g=b.breakArray[f],g.to<=a)h-=g.len;else if(g.from>=a)break;else if(b.isInBreak(g,a)){h-=a-g.from;break}return h},b.lin2val=
function(a){var g,h;for(h=0;h<b.breakArray.length&&!(g=b.breakArray[h],g.from>=a);h++)g.to<a?a+=g.len:b.isInBreak(g,a)&&(a+=g.len);return a},b.setExtremes=function(a,b,g,f,c){for(;this.isInAnyBreak(a);)a-=this.closestPointRange;for(;this.isInAnyBreak(b);)b-=this.closestPointRange;t.prototype.setExtremes.call(this,a,b,g,f,c)},b.setAxisTranslation=function(a){t.prototype.setAxisTranslation.call(this,a);a=b.options.breaks;var g=[],h=[],f=0,c,r,C=b.userMin||b.min,x=b.userMax||b.max,e=B(b.pointRangePadding,
0),k,m;E(a,function(d){r=d.repeat||Infinity;b.isInBreak(d,C)&&(C+=d.to%r-C%r);b.isInBreak(d,x)&&(x-=x%r-d.from%r)});E(a,function(d){k=d.from;for(r=d.repeat||Infinity;k-r>C;)k-=r;for(;k<C;)k+=r;for(m=k;m<x;m+=r)g.push({value:m,move:"in"}),g.push({value:m+(d.to-d.from),move:"out",size:d.breakSize})});g.sort(function(d,z){return d.value===z.value?("in"===d.move?0:1)-("in"===z.move?0:1):d.value-z.value});c=0;k=C;E(g,function(d){c+="in"===d.move?1:-1;1===c&&"in"===d.move&&(k=d.value);0===c&&(h.push({from:k,
to:d.value,len:d.value-k-(d.size||0)}),f+=d.value-k-(d.size||0))});b.breakArray=h;b.unitLength=x-C-f+e;l(b,"afterBreaks");b.options.staticScale?b.transA=b.options.staticScale:b.unitLength&&(b.transA*=(x-b.min+e)/b.unitLength);e&&(b.minPixelPadding=b.transA*b.minPointOffset);b.min=C;b.max=x})});A(p.prototype,"generatePoints",function(a){a.apply(this,D(arguments));var n=this.xAxis,g=this.yAxis,b=this.points,h,l=b.length,q=this.options.connectNulls,f;if(n&&g&&(n.options.breaks||g.options.breaks))for(;l--;)h=
b[l],f=null===h.y&&!1===q,f||!n.isInAnyBreak(h.x,!0)&&!g.isInAnyBreak(h.y,!0)||(b.splice(l,1),this.data[l]&&this.data[l].destroyElements())});a.Series.prototype.drawBreaks=function(a,n){var g=this,b=g.points,h,t,q,f;a&&E(n,function(c){h=a.breakArray||[];t=a.isXAxis?a.min:B(g.options.threshold,a.min);E(b,function(b){f=B(b["stack"+c.toUpperCase()],b[c]);E(h,function(c){q=!1;if(t<c.from&&f>c.to||t>c.from&&f<c.from)q="pointBreak";else if(t<c.from&&f>c.from&&f<c.to||t>c.from&&f>c.to&&f<c.from)q="pointInBreak";
q&&l(a,q,{point:b,brk:c})})})})};a.Series.prototype.gappedPath=function(){var l=this.options.gapSize,n=this.points.slice(),g=n.length-1,b=this.yAxis,h;if(l&&0<g)for("value"!==this.options.gapUnit&&(l*=this.closestPointRange);g--;)n[g+1].x-n[g].x>l&&(h=(n[g].x+n[g+1].x)/2,n.splice(g+1,0,{isNull:!0,x:h}),this.options.stacking&&(h=b.stacks[this.stackKey][h]=new a.StackItem(b,b.options.stackLabels,!1,h,this.stack),h.total=0));return this.getGraphPath(n)};A(a.seriesTypes.column.prototype,"drawPoints",
y);A(a.Series.prototype,"drawPoints",y)})(J);(function(a){var D=a.arrayMax,y=a.arrayMin,B=a.Axis,A=a.defaultPlotOptions,E=a.defined,v=a.each,G=a.extend,l=a.format,t=a.isNumber,p=a.merge,H=a.pick,n=a.Point,g=a.Tooltip,b=a.wrap,h=a.Series.prototype,u=h.processData,q=h.generatePoints,f={approximation:"average",groupPixelWidth:2,dateTimeLabelFormats:{millisecond:["%A, %b %e, %H:%M:%S.%L","%A, %b %e, %H:%M:%S.%L","-%H:%M:%S.%L"],second:["%A, %b %e, %H:%M:%S","%A, %b %e, %H:%M:%S","-%H:%M:%S"],minute:["%A, %b %e, %H:%M",
"%A, %b %e, %H:%M","-%H:%M"],hour:["%A, %b %e, %H:%M","%A, %b %e, %H:%M","-%H:%M"],day:["%A, %b %e, %Y","%A, %b %e","-%A, %b %e, %Y"],week:["Week from %A, %b %e, %Y","%A, %b %e","-%A, %b %e, %Y"],month:["%B %Y","%B","-%B %Y"],year:["%Y","%Y","-%Y"]}},c={line:{},spline:{},area:{},areaspline:{},column:{approximation:"sum",groupPixelWidth:10},arearange:{approximation:"range"},areasplinerange:{approximation:"range"},columnrange:{approximation:"range",groupPixelWidth:10},candlestick:{approximation:"ohlc",
groupPixelWidth:10},ohlc:{approximation:"ohlc",groupPixelWidth:5}},r=a.defaultDataGroupingUnits=[["millisecond",[1,2,5,10,20,25,50,100,200,500]],["second",[1,2,5,10,15,30]],["minute",[1,2,5,10,15,30]],["hour",[1,2,3,4,6,8,12]],["day",[1]],["week",[1]],["month",[1,3,6]],["year",null]],C=a.approximations={sum:function(a){var e=a.length,f;if(!e&&a.hasNulls)f=null;else if(e)for(f=0;e--;)f+=a[e];return f},average:function(a){var e=a.length;a=C.sum(a);t(a)&&e&&(a/=e);return a},averages:function(){var a=
[];v(arguments,function(e){a.push(C.average(e))});return void 0===a[0]?void 0:a},open:function(a){return a.length?a[0]:a.hasNulls?null:void 0},high:function(a){return a.length?D(a):a.hasNulls?null:void 0},low:function(a){return a.length?y(a):a.hasNulls?null:void 0},close:function(a){return a.length?a[a.length-1]:a.hasNulls?null:void 0},ohlc:function(a,e,f,m){a=C.open(a);e=C.high(e);f=C.low(f);m=C.close(m);if(t(a)||t(e)||t(f)||t(m))return[a,e,f,m]},range:function(a,e){a=C.low(a);e=C.high(e);if(t(a)||
t(e))return[a,e];if(null===a&&null===e)return null}};h.groupData=function(a,e,k,m){var d=this.data,z=this.options.data,w=[],b=[],F=[],g=a.length,I,x,h=!!e,r=[];m="function"===typeof m?m:C[m]||c[this.type]&&C[c[this.type].approximation]||C[f.approximation];var S=this.pointArrayMap,l=S&&S.length,n=0;x=0;var q,p;l?v(S,function(){r.push([])}):r.push([]);q=l||1;for(p=0;p<=g&&!(a[p]>=k[0]);p++);for(p;p<=g;p++){for(;void 0!==k[n+1]&&a[p]>=k[n+1]||p===g;){I=k[n];this.dataGroupInfo={start:x,length:r[0].length};
x=m.apply(this,r);void 0!==x&&(w.push(I),b.push(x),F.push(this.dataGroupInfo));x=p;for(I=0;I<q;I++)r[I].length=0,r[I].hasNulls=!1;n+=1;if(p===g)break}if(p===g)break;if(S){I=this.cropStart+p;var u=d&&d[I]||this.pointClass.prototype.applyOptions.apply({series:this},[z[I]]),A;for(I=0;I<l;I++)A=u[S[I]],t(A)?r[I].push(A):null===A&&(r[I].hasNulls=!0)}else I=h?e[p]:null,t(I)?r[0].push(I):null===I&&(r[0].hasNulls=!0)}return[w,b,F]};h.processData=function(){var a=this.chart,e=this.options.dataGrouping,f=!1!==
this.allowDG&&e&&H(e.enabled,a.options.isStock),m=this.visible||!a.options.chart.ignoreHiddenSeries,d,z=this.currentDataGrouping,w;this.forceCrop=f;this.groupPixelWidth=null;this.hasProcessed=!0;if(!1!==u.apply(this,arguments)&&f){this.destroyGroupedData();var c=this.processedXData,F=this.processedYData,b=a.plotSizeX,a=this.xAxis,g=a.options.ordinal,R=this.groupPixelWidth=a.getGroupPixelWidth&&a.getGroupPixelWidth();if(R){this.isDirty=d=!0;this.points=null;f=a.getExtremes();w=f.min;f=f.max;g=g&&a.getGroupIntervalFactor(w,
f,this)||1;R=R*(f-w)/b*g;b=a.getTimeTicks(a.normalizeTimeTickInterval(R,e.units||r),Math.min(w,c[0]),Math.max(f,c[c.length-1]),a.options.startOfWeek,c,this.closestPointRange);c=h.groupData.apply(this,[c,F,b,e.approximation]);F=c[0];g=c[1];if(e.smoothed&&F.length){e=F.length-1;for(F[e]=Math.min(F[e],f);e--&&0<e;)F[e]+=R/2;F[0]=Math.max(F[0],w)}w=b.info;this.closestPointRange=b.info.totalRange;this.groupMap=c[2];E(F[0])&&F[0]<a.dataMin&&m&&(a.min===a.dataMin&&(a.min=F[0]),a.dataMin=F[0]);this.processedXData=
F;this.processedYData=g}else this.groupMap=null;this.hasGroupedData=d;this.currentDataGrouping=w;this.preventGraphAnimation=(z&&z.totalRange)!==(w&&w.totalRange)}};h.destroyGroupedData=function(){var a=this.groupedData;v(a||[],function(f,k){f&&(a[k]=f.destroy?f.destroy():null)});this.groupedData=null};h.generatePoints=function(){q.apply(this);this.destroyGroupedData();this.groupedData=this.hasGroupedData?this.points:null};b(n.prototype,"update",function(f){this.dataGroup?a.error(24):f.apply(this,
[].slice.call(arguments,1))});b(g.prototype,"tooltipFooterHeaderFormatter",function(f,e,k){var m=e.series,d=m.tooltipOptions,z=m.options.dataGrouping,w=d.xDateFormat,c,F=m.xAxis,b=a.dateFormat;return F&&"datetime"===F.options.type&&z&&t(e.key)?(f=m.currentDataGrouping,z=z.dateTimeLabelFormats,f?(F=z[f.unitName],1===f.count?w=F[0]:(w=F[1],c=F[2])):!w&&z&&(w=this.getXDateFormat(e,d,F)),w=b(w,e.key),c&&(w+=b(c,e.key+f.totalRange-1)),l(d[(k?"footer":"header")+"Format"],{point:G(e.point,{key:w}),series:m})):
f.call(this,e,k)});b(h,"destroy",function(a){a.call(this);this.destroyGroupedData()});b(h,"setOptions",function(a,e){a=a.call(this,e);var k=this.type,m=this.chart.options.plotOptions,d=A[k].dataGrouping;c[k]&&(d||(d=p(f,c[k])),a.dataGrouping=p(d,m.series&&m.series.dataGrouping,m[k].dataGrouping,e.dataGrouping));this.chart.options.isStock&&(this.requireSorting=!0);return a});b(B.prototype,"setScale",function(a){a.call(this);v(this.series,function(a){a.hasProcessed=!1})});B.prototype.getGroupPixelWidth=
function(){var a=this.series,f=a.length,c,m=0,d=!1,z;for(c=f;c--;)(z=a[c].options.dataGrouping)&&(m=Math.max(m,z.groupPixelWidth));for(c=f;c--;)(z=a[c].options.dataGrouping)&&a[c].hasProcessed&&(f=(a[c].processedXData||a[c].data).length,a[c].groupPixelWidth||f>this.chart.plotSizeX/m||f&&z.forced)&&(d=!0);return d?m:0};B.prototype.setDataGrouping=function(a,f){var e;f=H(f,!0);a||(a={forced:!1,units:null});if(this instanceof B)for(e=this.series.length;e--;)this.series[e].update({dataGrouping:a},!1);
else v(this.chart.options.series,function(f){f.dataGrouping=a},!1);f&&this.chart.redraw()}})(J);(function(a){var D=a.each,y=a.Point,B=a.seriesType,A=a.seriesTypes;B("ohlc","column",{lineWidth:1,tooltip:{pointFormat:'\x3cspan class\x3d"highcharts-color-{point.colorIndex}"\x3e\u25cf\x3c/span\x3e \x3cb\x3e {series.name}\x3c/b\x3e\x3cbr/\x3eOpen: {point.open}\x3cbr/\x3eHigh: {point.high}\x3cbr/\x3eLow: {point.low}\x3cbr/\x3eClose: {point.close}\x3cbr/\x3e'},threshold:null,stickyTracking:!0},{directTouch:!1,
pointArrayMap:["open","high","low","close"],toYData:function(a){return[a.open,a.high,a.low,a.close]},pointValKey:"close",translate:function(){var a=this,v=a.yAxis,y=!!a.modifyValue,l=["plotOpen","plotHigh","plotLow","plotClose","yBottom"];A.column.prototype.translate.apply(a);D(a.points,function(t){D([t.open,t.high,t.low,t.close,t.low],function(p,A){null!==p&&(y&&(p=a.modifyValue(p)),t[l[A]]=v.toPixels(p,!0))});t.tooltipPos[1]=t.plotHigh+v.pos-a.chart.plotTop})},drawPoints:function(){var a=this,A=
a.chart;D(a.points,function(v){var l,t,p,y,n=v.graphic,g,b=!n;void 0!==v.plotY&&(n||(v.graphic=n=A.renderer.path().add(a.group)),t=n.strokeWidth()%2/2,g=Math.round(v.plotX)-t,p=Math.round(v.shapeArgs.width/2),y=["M",g,Math.round(v.yBottom),"L",g,Math.round(v.plotHigh)],null!==v.open&&(l=Math.round(v.plotOpen)+t,y.push("M",g,l,"L",g-p,l)),null!==v.close&&(l=Math.round(v.plotClose)+t,y.push("M",g,l,"L",g+p,l)),n[b?"attr":"animate"]({d:y}).addClass(v.getClassName(),!0))})},animate:null},{getClassName:function(){return y.prototype.getClassName.call(this)+
(this.open<this.close?" highcharts-point-up":" highcharts-point-down")}})})(J);(function(a){var D=a.defaultPlotOptions,y=a.each,B=a.merge;a=a.seriesType;a("candlestick","ohlc",B(D.column,{states:{hover:{lineWidth:2}},tooltip:D.ohlc.tooltip,threshold:null}),{drawPoints:function(){var a=this,B=a.chart;y(a.points,function(v){var A=v.graphic,l,t,p,y,n,g,b,h=!A;void 0!==v.plotY&&(A||(v.graphic=A=B.renderer.path().add(a.group)),n=A.strokeWidth()%2/2,g=Math.round(v.plotX)-n,l=v.plotOpen,t=v.plotClose,p=
Math.min(l,t),l=Math.max(l,t),b=Math.round(v.shapeArgs.width/2),t=Math.round(p)!==Math.round(v.plotHigh),y=l!==v.yBottom,p=Math.round(p)+n,l=Math.round(l)+n,n=[],n.push("M",g-b,l,"L",g-b,p,"L",g+b,p,"L",g+b,l,"Z","M",g,p,"L",g,t?Math.round(v.plotHigh):p,"M",g,l,"L",g,y?Math.round(v.yBottom):l),A[h?"attr":"animate"]({d:n}).addClass(v.getClassName(),!0))})}})})(J);var V=function(a){var D=a.each,y=a.seriesTypes,B=a.stableSort;return{translate:function(){y.column.prototype.translate.apply(this);var a=
this.options,E=this.chart,v=this.points,G=v.length-1,l,t,p=a.onSeries;l=p&&E.get(p);var a=a.onKey||"y",p=l&&l.options.step,H=l&&l.points,n=H&&H.length,g=this.xAxis,b=this.yAxis,h=g.getExtremes(),u=0,q,f,c,r;if(l&&l.visible&&n)for(u=(l.pointXOffset||0)+(l.barW||0)/2,l=l.currentDataGrouping,f=H[n-1].x+(l?l.totalRange:0),B(v,function(a,f){return a.x-f.x}),a="plot"+a[0].toUpperCase()+a.substr(1);n--&&v[G]&&!(q=H[n],l=v[G],l.y=q.y,q.x<=l.x&&void 0!==q[a]&&(l.x<=f&&(l.plotY=q[a],q.x<l.x&&!p&&(c=H[n+1])&&
void 0!==c[a]&&(r=(l.x-q.x)/(c.x-q.x),l.plotY+=r*(c[a]-q[a]),l.y+=r*(c.y-q.y))),G--,n++,0>G)););D(v,function(a,f){var e;void 0===a.plotY&&(a.x>=h.min&&a.x<=h.max?a.plotY=E.chartHeight-g.bottom-(g.opposite?g.height:0)+g.offset-b.top:a.shapeArgs={});a.plotX+=u;(t=v[f-1])&&t.plotX===a.plotX&&(void 0===t.stackIndex&&(t.stackIndex=0),e=t.stackIndex+1);a.stackIndex=e})}}}(J);(function(a,D){function y(a){l[a+"pin"]=function(p,t,n,g,b){var h=b&&b.anchorX;b=b&&b.anchorY;"circle"===a&&g>n&&(p-=Math.round((g-
n)/2),n=g);p=l[a](p,t,n,g);h&&b&&(p.push("M","circle"===a?p[1]-p[4]:p[1]+p[4]/2,t>b?t:t+g,"L",h,b),p=p.concat(l.circle(h-1,b-1,2,2)));return p}}var B=a.addEvent,A=a.each,E=a.noop,v=a.seriesType,G=a.TrackerMixin,l=a.SVGRenderer.prototype.symbols;v("flags","column",{pointRange:0,allowOverlapX:!1,shape:"flag",stackDistance:12,textAlign:"center",tooltip:{pointFormat:"{point.text}\x3cbr/\x3e"},threshold:null,y:-30},{sorted:!1,noSharedTooltip:!0,allowDG:!1,takeOrdinalPosition:!1,trackerGroups:["markerGroup"],
forceCrop:!0,init:a.Series.prototype.init,translate:D.translate,drawPoints:function(){var l=this.points,p=this.chart,v=p.renderer,n,g,b=this.options,h=b.y,u,q,f,c,r,C,x=this.yAxis,e={},k=[];for(q=l.length;q--;)f=l[q],C=f.plotX>this.xAxis.len,n=f.plotX,c=f.stackIndex,u=f.options.shape||b.shape,g=f.plotY,void 0!==g&&(g=f.plotY+h-(void 0!==c&&c*b.stackDistance)),f.anchorX=c?void 0:f.plotX,r=c?void 0:f.plotY,c=f.graphic,void 0!==g&&0<=n&&!C?(c||(c=f.graphic=v.label("",null,null,u,null,null,b.useHTML).attr({align:"flag"===
u?"left":"center",width:b.width,height:b.height,"text-align":b.textAlign}).addClass("highcharts-point").add(this.markerGroup),f.graphic.div&&(f.graphic.div.point=f),c.isNew=!0),0<n&&(n-=c.strokeWidth()%2),u={y:g,anchorY:r},b.allowOverlapX&&(u.x=n,u.anchorX=f.anchorX),c.attr({text:f.options.title||b.title||"A"})[c.isNew?"attr":"animate"](u),b.allowOverlapX||(e[f.plotX]?e[f.plotX].size=Math.max(e[f.plotX].size,c.width):e[f.plotX]={align:0,size:c.width,target:n,anchorX:n}),f.tooltipPos=p.inverted?[x.len+
x.pos-p.plotLeft-g,this.xAxis.len-n]:[n,g+x.pos-p.plotTop]):c&&(f.graphic=c.destroy());b.allowOverlapX||(a.objectEach(e,function(a){a.plotX=a.anchorX;k.push(a)}),a.distribute(k,this.xAxis.len),A(l,function(a){var d=a.graphic&&e[a.plotX];d&&(a.graphic[a.graphic.isNew?"attr":"animate"]({x:d.pos,anchorX:a.anchorX}),a.graphic.isNew=!1)}));b.useHTML&&a.wrap(this.markerGroup,"on",function(f){return a.SVGElement.prototype.on.apply(f.apply(this,[].slice.call(arguments,1)),[].slice.call(arguments,1))})},drawTracker:function(){var a=
this.points;G.drawTrackerPoint.apply(this);A(a,function(l){var t=l.graphic;t&&B(t.element,"mouseover",function(){0<l.stackIndex&&!l.raised&&(l._y=t.y,t.attr({y:l._y-8}),l.raised=!0);A(a,function(a){a!==l&&a.raised&&a.graphic&&(a.graphic.attr({y:a._y}),a.raised=!1)})})})},animate:E,buildKDTree:E,setClip:E});l.flag=function(a,p,v,n,g){var b=g&&g.anchorX||a;g=g&&g.anchorY||p;return l.circle(b-1,g-1,2,2).concat(["M",b,g,"L",a,p+n,a,p,a+v,p,a+v,p+n,a,p+n,"Z"])};y("circle");y("square")})(J,V);(function(a){function D(a,
c,b){this.init(a,c,b)}var y=a.addEvent,B=a.Axis,A=a.correctFloat,E=a.defaultOptions,v=a.defined,G=a.destroyObjectProperties,l=a.each,t=a.fireEvent,p=a.hasTouch,H=a.isTouchDevice,n=a.merge,g=a.pick,b=a.removeEvent,h=a.wrap,u,q={height:H?20:14,barBorderRadius:0,buttonBorderRadius:0,liveRedraw:a.svg&&!H,margin:10,minWidth:6,step:.2,zIndex:3};E.scrollbar=n(!0,q,E.scrollbar);a.swapXY=u=function(a,c){var f=a.length,b;if(c)for(c=0;c<f;c+=3)b=a[c+1],a[c+1]=a[c+2],a[c+2]=b;return a};D.prototype={init:function(a,
c,b){this.scrollbarButtons=[];this.renderer=a;this.userOptions=c;this.options=n(q,c);this.chart=b;this.size=g(this.options.size,this.options.height);c.enabled&&(this.render(),this.initEvents(),this.addEvents())},render:function(){var a=this.renderer,c=this.options,b=this.size,g;this.group=g=a.g("scrollbar").attr({zIndex:c.zIndex,translateY:-99999}).add();this.track=a.rect().addClass("highcharts-scrollbar-track").attr({x:0,r:c.trackBorderRadius||0,height:b,width:b}).add(g);this.trackBorderWidth=this.track.strokeWidth();
this.track.attr({y:-this.trackBorderWidth%2/2});this.scrollbarGroup=a.g().add(g);this.scrollbar=a.rect().addClass("highcharts-scrollbar-thumb").attr({height:b,width:b,r:c.barBorderRadius||0}).add(this.scrollbarGroup);this.scrollbarRifles=a.path(u(["M",-3,b/4,"L",-3,2*b/3,"M",0,b/4,"L",0,2*b/3,"M",3,b/4,"L",3,2*b/3],c.vertical)).addClass("highcharts-scrollbar-rifles").add(this.scrollbarGroup);this.scrollbarStrokeWidth=this.scrollbar.strokeWidth();this.scrollbarGroup.translate(-this.scrollbarStrokeWidth%
2/2,-this.scrollbarStrokeWidth%2/2);this.drawScrollbarButton(0);this.drawScrollbarButton(1)},position:function(a,c,b,g){var f=this.options.vertical,e=0,k=this.rendered?"animate":"attr";this.x=a;this.y=c+this.trackBorderWidth;this.width=b;this.xOffset=this.height=g;this.yOffset=e;f?(this.width=this.yOffset=b=e=this.size,this.xOffset=c=0,this.barWidth=g-2*b,this.x=a+=this.options.margin):(this.height=this.xOffset=g=c=this.size,this.barWidth=b-2*g,this.y+=this.options.margin);this.group[k]({translateX:a,
translateY:this.y});this.track[k]({width:b,height:g});this.scrollbarButtons[1][k]({translateX:f?0:b-c,translateY:f?g-e:0})},drawScrollbarButton:function(a){var f=this.renderer,b=this.scrollbarButtons,g=this.options,h=this.size,e;e=f.g().add(this.group);b.push(e);e=f.rect().addClass("highcharts-scrollbar-button").add(e);e.attr(e.crisp({x:-.5,y:-.5,width:h+1,height:h+1,r:g.buttonBorderRadius},e.strokeWidth()));f.path(u(["M",h/2+(a?-1:1),h/2-3,"L",h/2+(a?-1:1),h/2+3,"L",h/2+(a?2:-2),h/2],g.vertical)).addClass("highcharts-scrollbar-arrow").add(b[a])},
setRange:function(a,c){var f=this.options,b=f.vertical,g=f.minWidth,e=this.barWidth,k,m,d=this.rendered&&!this.hasDragged?"animate":"attr";v(e)&&(a=Math.max(a,0),k=Math.ceil(e*a),this.calculatedWidth=m=A(e*Math.min(c,1)-k),m<g&&(k=(e-g+m)*a,m=g),g=Math.floor(k+this.xOffset+this.yOffset),e=m/2-.5,this.from=a,this.to=c,b?(this.scrollbarGroup[d]({translateY:g}),this.scrollbar[d]({height:m}),this.scrollbarRifles[d]({translateY:e}),this.scrollbarTop=g,this.scrollbarLeft=0):(this.scrollbarGroup[d]({translateX:g}),
this.scrollbar[d]({width:m}),this.scrollbarRifles[d]({translateX:e}),this.scrollbarLeft=g,this.scrollbarTop=0),12>=m?this.scrollbarRifles.hide():this.scrollbarRifles.show(!0),!1===f.showFull&&(0>=a&&1<=c?this.group.hide():this.group.show()),this.rendered=!0)},initEvents:function(){var a=this;a.mouseMoveHandler=function(c){var b=a.chart.pointer.normalize(c),f=a.options.vertical?"chartY":"chartX",g=a.initPositions;!a.grabbedCenter||c.touches&&0===c.touches[0][f]||(b=a.cursorToScrollbarPosition(b)[f],
f=a[f],f=b-f,a.hasDragged=!0,a.updatePosition(g[0]+f,g[1]+f),a.hasDragged&&t(a,"changed",{from:a.from,to:a.to,trigger:"scrollbar",DOMType:c.type,DOMEvent:c}))};a.mouseUpHandler=function(c){a.hasDragged&&t(a,"changed",{from:a.from,to:a.to,trigger:"scrollbar",DOMType:c.type,DOMEvent:c});a.grabbedCenter=a.hasDragged=a.chartX=a.chartY=null};a.mouseDownHandler=function(c){c=a.chart.pointer.normalize(c);c=a.cursorToScrollbarPosition(c);a.chartX=c.chartX;a.chartY=c.chartY;a.initPositions=[a.from,a.to];a.grabbedCenter=
!0};a.buttonToMinClick=function(c){var b=A(a.to-a.from)*a.options.step;a.updatePosition(A(a.from-b),A(a.to-b));t(a,"changed",{from:a.from,to:a.to,trigger:"scrollbar",DOMEvent:c})};a.buttonToMaxClick=function(c){var b=(a.to-a.from)*a.options.step;a.updatePosition(a.from+b,a.to+b);t(a,"changed",{from:a.from,to:a.to,trigger:"scrollbar",DOMEvent:c})};a.trackClick=function(c){var b=a.chart.pointer.normalize(c),f=a.to-a.from,g=a.y+a.scrollbarTop,e=a.x+a.scrollbarLeft;a.options.vertical&&b.chartY>g||!a.options.vertical&&
b.chartX>e?a.updatePosition(a.from+f,a.to+f):a.updatePosition(a.from-f,a.to-f);t(a,"changed",{from:a.from,to:a.to,trigger:"scrollbar",DOMEvent:c})}},cursorToScrollbarPosition:function(a){var c=this.options,c=c.minWidth>this.calculatedWidth?c.minWidth:0;return{chartX:(a.chartX-this.x-this.xOffset)/(this.barWidth-c),chartY:(a.chartY-this.y-this.yOffset)/(this.barWidth-c)}},updatePosition:function(a,c){1<c&&(a=A(1-A(c-a)),c=1);0>a&&(c=A(c-a),a=0);this.from=a;this.to=c},update:function(a){this.destroy();
this.init(this.chart.renderer,n(!0,this.options,a),this.chart)},addEvents:function(){var a=this.options.inverted?[1,0]:[0,1],c=this.scrollbarButtons,b=this.scrollbarGroup.element,g=this.mouseDownHandler,h=this.mouseMoveHandler,e=this.mouseUpHandler,a=[[c[a[0]].element,"click",this.buttonToMinClick],[c[a[1]].element,"click",this.buttonToMaxClick],[this.track.element,"click",this.trackClick],[b,"mousedown",g],[b.ownerDocument,"mousemove",h],[b.ownerDocument,"mouseup",e]];p&&a.push([b,"touchstart",g],
[b.ownerDocument,"touchmove",h],[b.ownerDocument,"touchend",e]);l(a,function(a){y.apply(null,a)});this._events=a},removeEvents:function(){l(this._events,function(a){b.apply(null,a)});this._events.length=0},destroy:function(){var a=this.chart.scroller;this.removeEvents();l(["track","scrollbarRifles","scrollbar","scrollbarGroup","group"],function(a){this[a]&&this[a].destroy&&(this[a]=this[a].destroy())},this);a&&this===a.scrollbar&&(a.scrollbar=null,G(a.scrollbarButtons))}};h(B.prototype,"init",function(a){var b=
this;a.apply(b,Array.prototype.slice.call(arguments,1));b.options.scrollbar&&b.options.scrollbar.enabled&&(b.options.scrollbar.vertical=!b.horiz,b.options.startOnTick=b.options.endOnTick=!1,b.scrollbar=new D(b.chart.renderer,b.options.scrollbar,b.chart),y(b.scrollbar,"changed",function(a){var c=Math.min(g(b.options.min,b.min),b.min,b.dataMin),f=Math.max(g(b.options.max,b.max),b.max,b.dataMax)-c,e;b.horiz&&!b.reversed||!b.horiz&&b.reversed?(e=c+f*this.to,c+=f*this.from):(e=c+f*(1-this.from),c+=f*(1-
this.to));b.setExtremes(c,e,!0,!1,a)}))});h(B.prototype,"render",function(a){var b=Math.min(g(this.options.min,this.min),this.min,g(this.dataMin,this.min)),f=Math.max(g(this.options.max,this.max),this.max,g(this.dataMax,this.max)),h=this.scrollbar,l=this.titleOffset||0;a.apply(this,Array.prototype.slice.call(arguments,1));if(h){this.horiz?(h.position(this.left,this.top+this.height+2+this.chart.scrollbarsOffsets[1]+(this.opposite?0:l+this.axisTitleMargin+this.offset),this.width,this.height),l=1):(h.position(this.left+
this.width+2+this.chart.scrollbarsOffsets[0]+(this.opposite?l+this.axisTitleMargin+this.offset:0),this.top,this.width,this.height),l=0);if(!this.opposite&&!this.horiz||this.opposite&&this.horiz)this.chart.scrollbarsOffsets[l]+=this.scrollbar.size+this.scrollbar.options.margin;isNaN(b)||isNaN(f)||!v(this.min)||!v(this.max)?h.setRange(0,0):(l=(this.min-b)/(f-b),b=(this.max-b)/(f-b),this.horiz&&!this.reversed||!this.horiz&&this.reversed?h.setRange(l,b):h.setRange(1-b,1-l))}});h(B.prototype,"getOffset",
function(a){var b=this.horiz?2:1,f=this.scrollbar;a.apply(this,Array.prototype.slice.call(arguments,1));f&&(this.chart.scrollbarsOffsets=[0,0],this.chart.axisOffset[b]+=f.size+f.options.margin)});h(B.prototype,"destroy",function(a){this.scrollbar&&(this.scrollbar=this.scrollbar.destroy());a.apply(this,Array.prototype.slice.call(arguments,1))});a.Scrollbar=D})(J);(function(a){function D(a){this.init(a)}var y=a.addEvent,B=a.Axis,A=a.Chart,E=a.defaultOptions,v=a.defined,G=a.destroyObjectProperties,l=
a.each,t=a.erase,p=a.error,H=a.extend,n=a.grep,g=a.hasTouch,b=a.isArray,h=a.isNumber,u=a.isObject,q=a.merge,f=a.pick,c=a.removeEvent,r=a.Scrollbar,C=a.Series,x=a.seriesTypes,e=a.wrap,k=[].concat(a.defaultDataGroupingUnits),m=function(a){var d=n(arguments,h);if(d.length)return Math[a].apply(0,d)};k[4]=["day",[1,2,3,4]];k[5]=["week",[1,2,3]];H(E,{navigator:{height:40,margin:25,maskInside:!0,handles:{width:7,height:15,symbols:["navigator-handle","navigator-handle"],enabled:!0},series:{type:void 0===
x.areaspline?"line":"areaspline",compare:null,dataGrouping:{approximation:"average",enabled:!0,groupPixelWidth:2,smoothed:!0,units:k},dataLabels:{enabled:!1,zIndex:2},id:"highcharts-navigator-series",className:"highcharts-navigator-series",lineColor:null,marker:{enabled:!1},pointRange:0,threshold:null},xAxis:{overscroll:0,className:"highcharts-navigator-xaxis",tickLength:0,tickPixelInterval:200,labels:{align:"left",x:3,y:-4},crosshair:!1},yAxis:{className:"highcharts-navigator-yaxis",startOnTick:!1,
endOnTick:!1,minPadding:.1,maxPadding:.1,labels:{enabled:!1},crosshair:!1,title:{text:null},tickLength:0,tickWidth:0}}});a.Renderer.prototype.symbols["navigator-handle"]=function(a,b,e,m,k){a=k.width/2;b=Math.round(a/3)+.5;k=k.height;return["M",-a-1,.5,"L",a,.5,"L",a,k+.5,"L",-a-1,k+.5,"L",-a-1,.5,"M",-b,4,"L",-b,k-3,"M",b-1,4,"L",b-1,k-3]};D.prototype={drawHandle:function(a,b,e,m){var d=this.navigatorOptions.handles.height;this.handles[b][m](e?{translateX:Math.round(this.left+this.height/2),translateY:Math.round(this.top+
parseInt(a,10)+.5-d)}:{translateX:Math.round(this.left+parseInt(a,10)),translateY:Math.round(this.top+this.height/2-d/2-1)})},drawOutline:function(a,b,e,m){var d=this.navigatorOptions.maskInside,z=this.outline.strokeWidth(),w=z/2,z=z%2/2,k=this.outlineHeight,f=this.scrollbarHeight,g=this.size,c=this.left-f,h=this.top;e?(c-=w,e=h+b+z,b=h+a+z,a=["M",c+k,h-f-z,"L",c+k,e,"L",c,e,"L",c,b,"L",c+k,b,"L",c+k,h+g+f].concat(d?["M",c+k,e-w,"L",c+k,b+w]:[])):(a+=c+f-z,b+=c+f-z,h+=w,a=["M",c,h,"L",a,h,"L",a,h+
k,"L",b,h+k,"L",b,h,"L",c+g+2*f,h].concat(d?["M",a-w,h,"L",b+w,h]:[]));this.outline[m]({d:a})},drawMasks:function(a,b,e,m){var d=this.left,z=this.top,w=this.height,k,c,f,g;e?(f=[d,d,d],g=[z,z+a,z+b],c=[w,w,w],k=[a,b-a,this.size-b]):(f=[d,d+a,d+b],g=[z,z,z],c=[a,b-a,this.size-b],k=[w,w,w]);l(this.shades,function(a,d){a[m]({x:f[d],y:g[d],width:c[d],height:k[d]})})},renderElements:function(){var a=this,b=a.navigatorOptions,e=b.maskInside,m=a.chart,k=m.renderer,c;a.navigatorGroup=c=k.g("navigator").attr({zIndex:8,
visibility:"hidden"}).add();l([!e,e,!e],function(d,b){a.shades[b]=k.rect().addClass("highcharts-navigator-mask"+(1===b?"-inside":"-outside")).add(c)});a.outline=k.path().addClass("highcharts-navigator-outline").add(c);b.handles.enabled&&l([0,1],function(d){b.handles.inverted=m.inverted;a.handles[d]=k.symbol(b.handles.symbols[d],-b.handles.width/2-1,0,b.handles.width,b.handles.height,b.handles);a.handles[d].attr({zIndex:7-d}).addClass("highcharts-navigator-handle highcharts-navigator-handle-"+["left",
"right"][d]).add(c)})},update:function(a){l(this.series||[],function(a){a.baseSeries&&delete a.baseSeries.navigatorSeries});this.destroy();q(!0,this.chart.options.navigator,this.options,a);this.init(this.chart)},render:function(d,b,e,m){var z=this.chart,k,w,c=this.scrollbarHeight,g,l=this.xAxis;k=l.fake?z.xAxis[0]:l;var N=this.navigatorEnabled,n,q=this.rendered;w=z.inverted;var t,p=z.xAxis[0].minRange,r=z.xAxis[0].options.maxRange;if(!this.hasDragged||v(e)){if(!h(d)||!h(b))if(q)e=0,m=f(l.width,k.width);
else return;this.left=f(l.left,z.plotLeft+c+(w?z.plotWidth:0));this.size=n=g=f(l.len,(w?z.plotHeight:z.plotWidth)-2*c);z=w?c:g+2*c;e=f(e,l.toPixels(d,!0));m=f(m,l.toPixels(b,!0));h(e)&&Infinity!==Math.abs(e)||(e=0,m=z);d=l.toValue(e,!0);b=l.toValue(m,!0);t=Math.abs(a.correctFloat(b-d));t<p?this.grabbedLeft?e=l.toPixels(b-p,!0):this.grabbedRight&&(m=l.toPixels(d+p,!0)):v(r)&&t>r&&(this.grabbedLeft?e=l.toPixels(b-r,!0):this.grabbedRight&&(m=l.toPixels(d+r,!0)));this.zoomedMax=Math.min(Math.max(e,m,
0),n);this.zoomedMin=Math.min(Math.max(this.fixedWidth?this.zoomedMax-this.fixedWidth:Math.min(e,m),0),n);this.range=this.zoomedMax-this.zoomedMin;n=Math.round(this.zoomedMax);e=Math.round(this.zoomedMin);N&&(this.navigatorGroup.attr({visibility:"visible"}),q=q&&!this.hasDragged?"animate":"attr",this.drawMasks(e,n,w,q),this.drawOutline(e,n,w,q),this.navigatorOptions.handles.enabled&&(this.drawHandle(e,0,w,q),this.drawHandle(n,1,w,q)));this.scrollbar&&(w?(w=this.top-c,k=this.left-c+(N||!k.opposite?
0:(k.titleOffset||0)+k.axisTitleMargin),c=g+2*c):(w=this.top+(N?this.height:-c),k=this.left-c),this.scrollbar.position(k,w,z,c),this.scrollbar.setRange(this.zoomedMin/g,this.zoomedMax/g));this.rendered=!0}},addMouseEvents:function(){var a=this,b=a.chart,e=b.container,m=[],k,c;a.mouseMoveHandler=k=function(d){a.onMouseMove(d)};a.mouseUpHandler=c=function(d){a.onMouseUp(d)};m=a.getPartsEvents("mousedown");m.push(y(e,"mousemove",k),y(e.ownerDocument,"mouseup",c));g&&(m.push(y(e,"touchmove",k),y(e.ownerDocument,
"touchend",c)),m.concat(a.getPartsEvents("touchstart")));a.eventsToUnbind=m;a.series&&a.series[0]&&m.push(y(a.series[0].xAxis,"foundExtremes",function(){b.navigator.modifyNavigatorAxisExtremes()}))},getPartsEvents:function(a){var d=this,b=[];l(["shades","handles"],function(e){l(d[e],function(m,z){b.push(y(m.element,a,function(a){d[e+"Mousedown"](a,z)}))})});return b},shadesMousedown:function(a,b){a=this.chart.pointer.normalize(a);var d=this.chart,e=this.xAxis,m=this.zoomedMin,z=this.left,k=this.size,
c=this.range,f=a.chartX,g;d.inverted&&(f=a.chartY,z=this.top);1===b?(this.grabbedCenter=f,this.fixedWidth=c,this.dragOffset=f-m):(a=f-z-c/2,0===b?a=Math.max(0,a):2===b&&a+c>=k&&(a=k-c,g=this.getUnionExtremes().dataMax),a!==m&&(this.fixedWidth=c,b=e.toFixedRange(a,a+c,null,g),v(b.min)&&d.xAxis[0].setExtremes(Math.min(b.min,b.max),Math.max(b.min,b.max),!0,null,{trigger:"navigator"})))},handlesMousedown:function(a,b){this.chart.pointer.normalize(a);a=this.chart;var d=a.xAxis[0],e=a.inverted&&!d.reversed||
!a.inverted&&d.reversed;0===b?(this.grabbedLeft=!0,this.otherHandlePos=this.zoomedMax,this.fixedExtreme=e?d.min:d.max):(this.grabbedRight=!0,this.otherHandlePos=this.zoomedMin,this.fixedExtreme=e?d.max:d.min);a.fixedRange=null},onMouseMove:function(a){var d=this,b=d.chart,e=d.left,m=d.navigatorSize,k=d.range,c=d.dragOffset,f=b.inverted;a.touches&&0===a.touches[0].pageX||(a=b.pointer.normalize(a),b=a.chartX,f&&(e=d.top,b=a.chartY),d.grabbedLeft?(d.hasDragged=!0,d.render(0,0,b-e,d.otherHandlePos)):
d.grabbedRight?(d.hasDragged=!0,d.render(0,0,d.otherHandlePos,b-e)):d.grabbedCenter&&(d.hasDragged=!0,b<c?b=c:b>m+c-k&&(b=m+c-k),d.render(0,0,b-c,b-c+k)),d.hasDragged&&d.scrollbar&&d.scrollbar.options.liveRedraw&&(a.DOMType=a.type,setTimeout(function(){d.onMouseUp(a)},0)))},onMouseUp:function(a){var d=this.chart,b=this.xAxis,e=this.scrollbar,m,k,c=a.DOMEvent||a;(!this.hasDragged||e&&e.hasDragged)&&"scrollbar"!==a.trigger||(this.zoomedMin===this.otherHandlePos?m=this.fixedExtreme:this.zoomedMax===
this.otherHandlePos&&(k=this.fixedExtreme),this.zoomedMax===this.size&&(k=this.getUnionExtremes().dataMax),b=b.toFixedRange(this.zoomedMin,this.zoomedMax,m,k),v(b.min)&&d.xAxis[0].setExtremes(Math.min(b.min,b.max),Math.max(b.min,b.max),!0,this.hasDragged?!1:null,{trigger:"navigator",triggerOp:"navigator-drag",DOMEvent:c}));"mousemove"!==a.DOMType&&(this.grabbedLeft=this.grabbedRight=this.grabbedCenter=this.fixedWidth=this.fixedExtreme=this.otherHandlePos=this.hasDragged=this.dragOffset=null)},removeEvents:function(){this.eventsToUnbind&&
(l(this.eventsToUnbind,function(a){a()}),this.eventsToUnbind=void 0);this.removeBaseSeriesEvents()},removeBaseSeriesEvents:function(){var a=this.baseSeries||[];this.navigatorEnabled&&a[0]&&(!1!==this.navigatorOptions.adaptToUpdatedData&&l(a,function(a){c(a,"updatedData",this.updatedDataHandler)},this),a[0].xAxis&&c(a[0].xAxis,"foundExtremes",this.modifyBaseAxisExtremes))},init:function(a){var b=a.options,d=b.navigator,k=d.enabled,c=b.scrollbar,g=c.enabled,b=k?d.height:0,h=g?c.height:0;this.handles=
[];this.shades=[];this.chart=a;this.setBaseSeries();this.height=b;this.scrollbarHeight=h;this.scrollbarEnabled=g;this.navigatorEnabled=k;this.navigatorOptions=d;this.scrollbarOptions=c;this.outlineHeight=b+h;this.opposite=f(d.opposite,!k&&a.inverted);var l=this,c=l.baseSeries,g=a.xAxis.length,n=a.yAxis.length,t=c&&c[0]&&c[0].xAxis||a.xAxis[0];a.extraMargin={type:l.opposite?"plotTop":"marginBottom",value:(k||!a.inverted?l.outlineHeight:0)+d.margin};a.inverted&&(a.extraMargin.type=l.opposite?"marginRight":
"plotLeft");a.isDirtyBox=!0;l.navigatorEnabled?(l.xAxis=new B(a,q({breaks:t.options.breaks,ordinal:t.options.ordinal},d.xAxis,{id:"navigator-x-axis",yAxis:"navigator-y-axis",isX:!0,type:"datetime",index:g,offset:0,keepOrdinalPadding:!0,startOnTick:!1,endOnTick:!1,minPadding:0,maxPadding:0,zoomEnabled:!1},a.inverted?{offsets:[h,0,-h,0],width:b}:{offsets:[0,-h,0,h],height:b})),l.yAxis=new B(a,q(d.yAxis,{id:"navigator-y-axis",alignTicks:!1,offset:0,index:n,zoomEnabled:!1},a.inverted?{width:b}:{height:b})),
c||d.series.data?l.updateNavigatorSeries():0===a.series.length&&e(a,"redraw",function(b,d){0<a.series.length&&!l.series&&(l.setBaseSeries(),a.redraw=b);b.call(a,d)}),l.renderElements(),l.addMouseEvents()):l.xAxis={translate:function(b,d){var e=a.xAxis[0],c=e.getExtremes(),k=e.len-2*h,f=m("min",e.options.min,c.dataMin),e=m("max",e.options.max,c.dataMax)-f;return d?b*e/k+f:k*(b-f)/e},toPixels:function(a){return this.translate(a)},toValue:function(a){return this.translate(a,!0)},toFixedRange:B.prototype.toFixedRange,
fake:!0};a.options.scrollbar.enabled&&(a.scrollbar=l.scrollbar=new r(a.renderer,q(a.options.scrollbar,{margin:l.navigatorEnabled?0:10,vertical:a.inverted}),a),y(l.scrollbar,"changed",function(b){var d=l.size,e=d*this.to,d=d*this.from;l.hasDragged=l.scrollbar.hasDragged;l.render(0,0,d,e);(a.options.scrollbar.liveRedraw||"mousemove"!==b.DOMType)&&setTimeout(function(){l.onMouseUp(b)})}));l.addBaseSeriesEvents();l.addChartEvents()},getUnionExtremes:function(a){var b=this.chart.xAxis[0],d=this.xAxis,
e=d.options,c=b.options,k;a&&null===b.dataMin||(k={dataMin:f(e&&e.min,m("min",c.min,b.dataMin,d.dataMin,d.min)),dataMax:f(e&&e.max,m("max",c.max,b.dataMax,d.dataMax,d.max))});return k},setBaseSeries:function(a,b){var d=this.chart,e=this.baseSeries=[];a=a||d.options&&d.options.navigator.baseSeries||0;l(d.series||[],function(b,d){b.options.isInternal||!b.options.showInNavigator&&(d!==a&&b.options.id!==a||!1===b.options.showInNavigator)||e.push(b)});this.xAxis&&!this.xAxis.fake&&this.updateNavigatorSeries(b)},
updateNavigatorSeries:function(d){var e=this,m=e.chart,k=e.baseSeries,f,g,h=e.navigatorOptions.series,n,t={enableMouseTracking:!1,index:null,linkedTo:null,group:"nav",padXAxis:!1,xAxis:"navigator-x-axis",yAxis:"navigator-y-axis",showInLegend:!1,stacking:!1,isInternal:!0,visible:!0},p=e.series=a.grep(e.series||[],function(b){var d=b.baseSeries;return 0>a.inArray(d,k)?(d&&(c(d,"updatedData",e.updatedDataHandler),delete d.navigatorSeries),b.destroy(),!1):!0});k&&k.length&&l(k,function(a){var c=a.navigatorSeries,
z=H({color:a.color},b(h)?E.navigator.series:h);c&&!1===e.navigatorOptions.adaptToUpdatedData||(t.name="Navigator "+k.length,f=a.options||{},n=f.navigatorOptions||{},g=q(f,t,z,n),z=n.data||z.data,e.hasNavigatorData=e.hasNavigatorData||!!z,g.data=z||f.data&&f.data.slice(0),c&&c.options?c.update(g,d):(a.navigatorSeries=m.initSeries(g),a.navigatorSeries.baseSeries=a,p.push(a.navigatorSeries)))});if(h.data&&(!k||!k.length)||b(h))e.hasNavigatorData=!1,h=a.splat(h),l(h,function(a,b){t.name="Navigator "+
(p.length+1);g=q(E.navigator.series,{color:m.series[b]&&!m.series[b].options.isInternal&&m.series[b].color||m.options.colors[b]||m.options.colors[0]},t,a);g.data=a.data;g.data&&(e.hasNavigatorData=!0,p.push(m.initSeries(g)))});this.addBaseSeriesEvents()},addBaseSeriesEvents:function(){var a=this,b=a.baseSeries||[];b[0]&&b[0].xAxis&&y(b[0].xAxis,"foundExtremes",this.modifyBaseAxisExtremes);l(b,function(b){y(b,"show",function(){this.navigatorSeries&&this.navigatorSeries.setVisible(!0,!1)});y(b,"hide",
function(){this.navigatorSeries&&this.navigatorSeries.setVisible(!1,!1)});!1!==this.navigatorOptions.adaptToUpdatedData&&b.xAxis&&y(b,"updatedData",this.updatedDataHandler);y(b,"remove",function(){this.navigatorSeries&&(t(a.series,this.navigatorSeries),this.navigatorSeries.remove(!1),delete this.navigatorSeries)})},this)},modifyNavigatorAxisExtremes:function(){var a=this.xAxis,b;a.getExtremes&&(!(b=this.getUnionExtremes(!0))||b.dataMin===a.min&&b.dataMax===a.max||(a.min=b.dataMin,a.max=b.dataMax))},
modifyBaseAxisExtremes:function(){var a=this.chart.navigator,b=this.getExtremes(),e=b.dataMin,m=b.dataMax,b=b.max-b.min,k=a.stickToMin,c=a.stickToMax,f=this.options.overscroll,g,l,n=a.series&&a.series[0],q=!!this.setExtremes;this.eventArgs&&"rangeSelectorButton"===this.eventArgs.trigger||(k&&(l=e,g=l+b),c&&(g=m+f,k||(l=Math.max(g-b,n&&n.xData?n.xData[0]:-Number.MAX_VALUE))),q&&(k||c)&&h(l)&&(this.min=this.userMin=l,this.max=this.userMax=g));a.stickToMin=a.stickToMax=null},updatedDataHandler:function(){var a=
this.chart.navigator,b=this.navigatorSeries;a.stickToMax=Math.round(a.zoomedMax)>=Math.round(a.size);a.stickToMin=h(this.xAxis.min)&&this.xAxis.min<=this.xData[0]&&(!this.chart.fixedRange||!a.stickToMax);b&&!a.hasNavigatorData&&(b.options.pointStart=this.xData[0],b.setData(this.options.data,!1,null,!1))},addChartEvents:function(){y(this.chart,"redraw",function(){var a=this.navigator,b=a&&(a.baseSeries&&a.baseSeries[0]&&a.baseSeries[0].xAxis||a.scrollbar&&this.xAxis[0]);b&&a.render(b.min,b.max)})},
destroy:function(){this.removeEvents();this.xAxis&&(t(this.chart.xAxis,this.xAxis),t(this.chart.axes,this.xAxis));this.yAxis&&(t(this.chart.yAxis,this.yAxis),t(this.chart.axes,this.yAxis));l(this.series||[],function(a){a.destroy&&a.destroy()});l("series xAxis yAxis shades outline scrollbarTrack scrollbarRifles scrollbarGroup scrollbar navigatorGroup rendered".split(" "),function(a){this[a]&&this[a].destroy&&this[a].destroy();this[a]=null},this);l([this.handles],function(a){G(a)},this)}};a.Navigator=
D;e(B.prototype,"zoom",function(a,b,e){var d=this.chart,m=d.options,k=m.chart.zoomType,c=m.navigator,m=m.rangeSelector,g;this.isXAxis&&(c&&c.enabled||m&&m.enabled)&&("x"===k?d.resetZoomButton="blocked":"y"===k?g=!1:"xy"===k&&this.options.range&&(d=this.previousZoom,v(b)?this.previousZoom=[this.min,this.max]:d&&(b=d[0],e=d[1],delete this.previousZoom)));return void 0!==g?g:a.call(this,b,e)});e(A.prototype,"init",function(a,b,e){y(this,"beforeRender",function(){var a=this.options;if(a.navigator.enabled||
a.scrollbar.enabled)this.scroller=this.navigator=new D(this)});a.call(this,b,e)});e(A.prototype,"setChartSize",function(a){var b=this.legend,d=this.navigator,e,m,k,c;a.apply(this,[].slice.call(arguments,1));d&&(m=b&&b.options,k=d.xAxis,c=d.yAxis,e=d.scrollbarHeight,this.inverted?(d.left=d.opposite?this.chartWidth-e-d.height:this.spacing[3]+e,d.top=this.plotTop+e):(d.left=this.plotLeft+e,d.top=d.navigatorOptions.top||this.chartHeight-d.height-e-this.spacing[2]-(this.rangeSelector&&this.extraBottomMargin?
this.rangeSelector.getHeight():0)-(m&&"bottom"===m.verticalAlign&&m.enabled&&!m.floating?b.legendHeight+f(m.margin,10):0)),k&&c&&(this.inverted?k.options.left=c.options.left=d.left:k.options.top=c.options.top=d.top,k.setAxisSize(),c.setAxisSize()))});e(C.prototype,"addPoint",function(a,b,e,m,k){var d=this.options.turboThreshold;d&&this.xData.length>d&&u(b,!0)&&this.chart.navigator&&p(20,!0);a.call(this,b,e,m,k)});e(A.prototype,"addSeries",function(a,b,e,m){a=a.call(this,b,!1,m);this.navigator&&this.navigator.setBaseSeries(null,
!1);f(e,!0)&&this.redraw();return a});e(C.prototype,"update",function(a,b,e){a.call(this,b,!1);this.chart.navigator&&!this.options.isInternal&&this.chart.navigator.setBaseSeries(null,!1);f(e,!0)&&this.chart.redraw()});A.prototype.callbacks.push(function(a){var b=a.navigator;b&&(a=a.xAxis[0].getExtremes(),b.render(a.min,a.max))})})(J);(function(a){function D(a){this.init(a)}var y=a.addEvent,B=a.Axis,A=a.Chart,E=a.css,v=a.createElement,G=a.dateFormat,l=a.defaultOptions,t=l.global.useUTC,p=a.defined,
H=a.destroyObjectProperties,n=a.discardElement,g=a.each,b=a.extend,h=a.fireEvent,u=a.Date,q=a.isNumber,f=a.merge,c=a.pick,r=a.pInt,C=a.splat,x=a.wrap;b(l,{rangeSelector:{verticalAlign:"top",buttonTheme:{"stroke-width":0,width:28,height:18,padding:2,zIndex:7},floating:!1,x:0,y:0,height:void 0,inputPosition:{align:"right",x:0,y:0},buttonPosition:{align:"left",x:0,y:0}}});l.lang=f(l.lang,{rangeSelectorZoom:"Zoom",rangeSelectorFrom:"From",rangeSelectorTo:"To"});D.prototype={clickButton:function(a,b){var e=
this,d=e.chart,k=e.buttonOptions[a],f=d.xAxis[0],h=d.scroller&&d.scroller.getUnionExtremes()||f||{},l=h.dataMin,n=h.dataMax,p,r=f&&Math.round(Math.min(f.max,c(n,f.max))),v=k.type,u,h=k._range,x,A,E,D=k.dataGrouping;if(null!==l&&null!==n){d.fixedRange=h;D&&(this.forcedDataGrouping=!0,B.prototype.setDataGrouping.call(f||{chart:this.chart},D,!1));if("month"===v||"year"===v)f?(v={range:k,max:r,dataMin:l,dataMax:n},p=f.minFromRange.call(v),q(v.newMax)&&(r=v.newMax)):h=k;else if(h)p=Math.max(r-h,l),r=Math.min(p+
h,n);else if("ytd"===v)if(f)void 0===n&&(l=Number.MAX_VALUE,n=Number.MIN_VALUE,g(d.series,function(a){a=a.xData;l=Math.min(a[0],l);n=Math.max(a[a.length-1],n)}),b=!1),r=e.getYTDExtremes(n,l,t),p=x=r.min,r=r.max;else{y(d,"beforeRender",function(){e.clickButton(a)});return}else"all"===v&&f&&(p=l,r=n);p+=k._offsetMin;r+=k._offsetMax;e.setSelected(a);f?f.setExtremes(p,r,c(b,1),null,{trigger:"rangeSelectorButton",rangeSelectorButton:k}):(u=C(d.options.xAxis)[0],E=u.range,u.range=h,A=u.min,u.min=x,y(d,
"load",function(){u.range=E;u.min=A}))}},setSelected:function(a){this.selected=this.options.selected=a},defaultButtons:[{type:"month",count:1,text:"1m"},{type:"month",count:3,text:"3m"},{type:"month",count:6,text:"6m"},{type:"ytd",text:"YTD"},{type:"year",count:1,text:"1y"},{type:"all",text:"All"}],init:function(a){var b=this,e=a.options.rangeSelector,d=e.buttons||[].concat(b.defaultButtons),c=e.selected,f=function(){var a=b.minInput,d=b.maxInput;a&&a.blur&&h(a,"blur");d&&d.blur&&h(d,"blur")};b.chart=
a;b.options=e;b.buttons=[];a.extraTopMargin=e.height;b.buttonOptions=d;this.unMouseDown=y(a.container,"mousedown",f);this.unResize=y(a,"resize",f);g(d,b.computeButtonRange);void 0!==c&&d[c]&&this.clickButton(c,!1);y(a,"load",function(){a.xAxis&&a.xAxis[0]&&y(a.xAxis[0],"setExtremes",function(d){this.max-this.min!==a.fixedRange&&"rangeSelectorButton"!==d.trigger&&"updatedData"!==d.trigger&&b.forcedDataGrouping&&this.setDataGrouping(!1,!1)})})},updateButtonStates:function(){var a=this.chart,b=a.xAxis[0],
m=Math.round(b.max-b.min),d=!b.hasVisibleSeries,a=a.scroller&&a.scroller.getUnionExtremes()||b,c=a.dataMin,f=a.dataMax,a=this.getYTDExtremes(f,c,t),h=a.min,l=a.max,n=this.selected,p=q(n),r=this.options.allButtonsEnabled,v=this.buttons;g(this.buttonOptions,function(a,e){var k=a._range,g=a.type,z=a.count||1,w=v[e],q=0;a=a._offsetMax-a._offsetMin;e=e===n;var t=k>f-c,F=k<b.minRange,u=!1,I=!1,k=k===m;("month"===g||"year"===g)&&m+36E5>=864E5*{month:28,year:365}[g]*z+a&&m-36E5<=864E5*{month:31,year:366}[g]*
z+a?k=!0:"ytd"===g?(k=l-h+a===m,u=!e):"all"===g&&(k=b.max-b.min>=f-c,I=!e&&p&&k);g=!r&&(t||F||I||d);z=e&&k||k&&!p&&!u;g?q=3:z&&(p=!0,q=2);w.state!==q&&w.setState(q)})},computeButtonRange:function(a){var b=a.type,e=a.count||1,d={millisecond:1,second:1E3,minute:6E4,hour:36E5,day:864E5,week:6048E5};if(d[b])a._range=d[b]*e;else if("month"===b||"year"===b)a._range=864E5*{month:30,year:365}[b]*e;a._offsetMin=c(a.offsetMin,0);a._offsetMax=c(a.offsetMax,0);a._range+=a._offsetMax-a._offsetMin},setInputValue:function(a,
b){var e=this.chart.options.rangeSelector,d=this[a+"Input"];p(b)&&(d.previousValue=d.HCTime,d.HCTime=b);d.value=G(e.inputEditDateFormat||"%Y-%m-%d",d.HCTime);this[a+"DateBox"].attr({text:G(e.inputDateFormat||"%b %e, %Y",d.HCTime)})},showInput:function(a){var b=this.inputGroup,e=this[a+"DateBox"];E(this[a+"Input"],{left:b.translateX+e.x+"px",top:b.translateY+"px",width:e.width-2+"px",height:e.height-2+"px",border:"2px solid silver"})},hideInput:function(a){E(this[a+"Input"],{border:0,width:"1px",height:"1px"});
this.setInputValue(a)},drawInput:function(a){function b(){var a=n.value,b=(f.inputDateParser||Date.parse)(a),c=d.xAxis[0],k=d.scroller&&d.scroller.xAxis?d.scroller.xAxis:c,m=k.dataMin,k=k.dataMax;b!==n.previousValue&&(n.previousValue=b,q(b)||(b=a.split("-"),b=Date.UTC(r(b[0]),r(b[1])-1,r(b[2]))),q(b)&&(t||(b+=6E4*(new Date).getTimezoneOffset()),h?b>e.maxInput.HCTime?b=void 0:b<m&&(b=m):b<e.minInput.HCTime?b=void 0:b>k&&(b=k),void 0!==b&&c.setExtremes(h?b:c.min,h?c.max:b,void 0,void 0,{trigger:"rangeSelectorInput"})))}
var e=this,d=e.chart,c=d.renderer,f=d.options.rangeSelector,g=e.div,h="min"===a,n,p,u=this.inputGroup;this[a+"Label"]=p=c.label(l.lang[h?"rangeSelectorFrom":"rangeSelectorTo"],this.inputGroup.offset).addClass("highcharts-range-label").attr({padding:2}).add(u);u.offset+=p.width+5;this[a+"DateBox"]=c=c.label("",u.offset).addClass("highcharts-range-input").attr({padding:2,width:f.inputBoxWidth||90,height:f.inputBoxHeight||17,stroke:f.inputBoxBorderColor||"#cccccc","stroke-width":1,"text-align":"center"}).on("click",
function(){e.showInput(a);e[a+"Input"].focus()}).add(u);u.offset+=c.width+(h?10:0);this[a+"Input"]=n=v("input",{name:a,className:"highcharts-range-selector",type:"text"},{top:d.plotTop+"px"},g);n.onfocus=function(){e.showInput(a)};n.onblur=function(){e.hideInput(a)};n.onchange=b;n.onkeypress=function(a){13===a.keyCode&&b()}},getPosition:function(){var a=this.chart,b=a.options.rangeSelector,a="top"===b.verticalAlign?a.plotTop-a.axisOffset[0]:0;return{buttonTop:a+b.buttonPosition.y,inputTop:a+b.inputPosition.y-
10}},getYTDExtremes:function(a,b,c){var d=new u(a),e=d[u.hcGetFullYear]();c=c?u.UTC(e,0,1):+new u(e,0,1);b=Math.max(b||0,c);d=d.getTime();return{max:Math.min(a||d,d),min:b}},render:function(a,b){var e=this,d=e.chart,k=d.renderer,f=d.container,h=d.options,n=h.exporting&&!1!==h.exporting.enabled&&h.navigation&&h.navigation.buttonOptions,q=l.lang,p=e.div,r=h.rangeSelector,h=r.floating,t=e.buttons,p=e.inputGroup,u=r.buttonTheme,x=r.buttonPosition,y=r.inputPosition,A=r.inputEnabled,C=u&&u.states,B=d.plotLeft,
E,D=e.buttonGroup,G;G=e.rendered;var P=e.options.verticalAlign,T=d.legend,H=T&&T.options,J=x.y,Q=y.y,U=G||!1,O=0,L=0,M;if(!1!==r.enabled){G||(e.group=G=k.g("range-selector-group").attr({zIndex:7}).add(),e.buttonGroup=D=k.g("range-selector-buttons").add(G),e.zoomText=k.text(q.rangeSelectorZoom,c(B+x.x,B),15).css(r.labelStyle).add(D),E=c(B+x.x,B)+e.zoomText.getBBox().width+5,g(e.buttonOptions,function(a,b){t[b]=k.button(a.text,E,0,function(){var d=a.events&&a.events.click,c;d&&(c=d.call(a));!1!==c&&
e.clickButton(b);e.isActive=!0},u,C&&C.hover,C&&C.select,C&&C.disabled).attr({"text-align":"center"}).add(D);E+=t[b].width+c(r.buttonSpacing,5)}),!1!==A&&(e.div=p=v("div",null,{position:"relative",height:0,zIndex:1}),f.parentNode.insertBefore(p,f),e.inputGroup=p=k.g("input-group").add(G),p.offset=0,e.drawInput("min"),e.drawInput("max")));B=d.plotLeft-d.spacing[3];e.updateButtonStates();n&&this.titleCollision(d)&&"top"===P&&"right"===x.align&&x.y+D.getBBox().height-12<(n.y||0)+n.height&&(O=-40);"left"===
x.align?M=x.x-d.spacing[3]:"right"===x.align&&(M=x.x+O-d.spacing[1]);D.align({y:x.y,width:D.getBBox().width,align:x.align,x:M},!0,d.spacingBox);e.group.placed=U;e.buttonGroup.placed=U;!1!==A&&(O=n&&this.titleCollision(d)&&"top"===P&&"right"===y.align&&y.y-p.getBBox().height-12<(n.y||0)+n.height+d.spacing[0]?-40:0,"left"===y.align?M=B:"right"===y.align&&(M=-Math.max(d.axisOffset[1],-O)),p.align({y:y.y,width:p.getBBox().width,align:y.align,x:y.x+M-2},!0,d.spacingBox),f=p.alignAttr.translateX+p.alignOptions.x-
O+p.getBBox().x+2,n=p.alignOptions.width,q=D.alignAttr.translateX+D.getBBox().x,M=D.getBBox().width+20,(y.align===x.align||q+M>f&&f+n>q&&J<Q+p.getBBox().height)&&p.attr({translateX:p.alignAttr.translateX+(d.axisOffset[1]>=-O?0:-O),translateY:p.alignAttr.translateY+D.getBBox().height+10}),e.setInputValue("min",a),e.setInputValue("max",b),e.inputGroup.placed=U);e.group.align({verticalAlign:P},!0,d.spacingBox);a=e.group.getBBox().height+20;b=e.group.alignAttr.translateY;"bottom"===P&&(T=H&&"bottom"===
H.verticalAlign&&H.enabled&&!H.floating?T.legendHeight+c(H.margin,10):0,a=a+T-20,L=b-a-(h?0:r.y)-10);if("top"===P)h&&(L=0),d.titleOffset&&(L=d.titleOffset+d.options.title.margin),L+=d.margin[0]-d.spacing[0]||0;else if("middle"===P)if(Q===J)L=0>Q?b+void 0:b;else if(Q||J)L=0>Q||0>J?L-Math.min(Q,J):b-a+NaN;e.group.translate(r.x,r.y+Math.floor(L));!1!==A&&(e.minInput.style.marginTop=e.group.translateY+"px",e.maxInput.style.marginTop=e.group.translateY+"px");e.rendered=!0}},getHeight:function(){var a=
this.options,b=this.group,c=a.y,d=a.buttonPosition.y,a=a.inputPosition.y,b=b?b.getBBox(!0).height+13+c:0,c=Math.min(a,d);if(0>a&&0>d||0<a&&0<d)b+=Math.abs(c);return b},titleCollision:function(a){return!(a.options.title.text||a.options.subtitle.text)},update:function(a){var b=this.chart;f(!0,b.options.rangeSelector,a);this.destroy();this.init(b);b.rangeSelector.render()},destroy:function(){var b=this,c=b.minInput,f=b.maxInput;b.unMouseDown();b.unResize();H(b.buttons);c&&(c.onfocus=c.onblur=c.onchange=
null);f&&(f.onfocus=f.onblur=f.onchange=null);a.objectEach(b,function(a,e){a&&"chart"!==e&&(a.destroy?a.destroy():a.nodeType&&n(this[e]));a!==D.prototype[e]&&(b[e]=null)},this)}};B.prototype.toFixedRange=function(a,b,f,d){var e=this.chart&&this.chart.fixedRange;a=c(f,this.translate(a,!0,!this.horiz));b=c(d,this.translate(b,!0,!this.horiz));f=e&&(b-a)/e;.7<f&&1.3>f&&(d?a=b-e:b=a+e);q(a)&&q(b)||(a=b=void 0);return{min:a,max:b}};B.prototype.minFromRange=function(){var a=this.range,b={month:"Month",year:"FullYear"}[a.type],
f,d=this.max,g,h,l=function(a,d){var c=new Date(a),e=c["get"+b]();c["set"+b](e+d);e===c["get"+b]()&&c.setDate(0);return c.getTime()-a};q(a)?(f=d-a,h=a):(f=d+l(d,-a.count),this.chart&&(this.chart.fixedRange=d-f));g=c(this.dataMin,Number.MIN_VALUE);q(f)||(f=g);f<=g&&(f=g,void 0===h&&(h=l(f,a.count)),this.newMax=Math.min(f+h,this.dataMax));q(d)||(f=void 0);return f};x(A.prototype,"init",function(a,b,c){y(this,"init",function(){this.options.rangeSelector.enabled&&(this.rangeSelector=new D(this))});a.call(this,
b,c)});x(A.prototype,"render",function(a,b,c){var d=this.axes,e=this.rangeSelector;e&&(g(d,function(a){a.updateNames();a.setScale()}),this.getAxisMargins(),e.render(),d=e.options.verticalAlign,e.options.floating||("bottom"===d?this.extraBottomMargin=!0:"middle"!==d&&(this.extraTopMargin=!0)));a.call(this,b,c)});x(A.prototype,"update",function(b,f,g,d){var e=this.rangeSelector,k;this.extraTopMargin=this.extraBottomMargin=!1;e&&(e.render(),k=f.rangeSelector&&f.rangeSelector.verticalAlign||e.options&&
e.options.verticalAlign,e.options.floating||("bottom"===k?this.extraBottomMargin=!0:"middle"!==k&&(this.extraTopMargin=!0)));b.call(this,a.merge(!0,f,{chart:{marginBottom:c(f.chart&&f.chart.marginBottom,this.margin.bottom),spacingBottom:c(f.chart&&f.chart.spacingBottom,this.spacing.bottom)}}),g,d)});x(A.prototype,"redraw",function(a,b,c){var d=this.rangeSelector;d&&!d.options.floating&&(d.render(),d=d.options.verticalAlign,"bottom"===d?this.extraBottomMargin=!0:"middle"!==d&&(this.extraTopMargin=
!0));a.call(this,b,c)});A.prototype.adjustPlotArea=function(){var a=this.rangeSelector;this.rangeSelector&&(a=a.getHeight(),this.extraTopMargin&&(this.plotTop+=a),this.extraBottomMargin&&(this.marginBottom+=a))};A.prototype.callbacks.push(function(a){function b(){c=a.xAxis[0].getExtremes();q(c.min)&&d.render(c.min,c.max)}var c,d=a.rangeSelector,e,f;d&&(f=y(a.xAxis[0],"afterSetExtremes",function(a){d.render(a.min,a.max)}),e=y(a,"redraw",b),b());y(a,"destroy",function(){d&&(e(),f())})});a.RangeSelector=
D})(J);(function(a){var D=a.arrayMax,y=a.arrayMin,B=a.Axis,A=a.Chart,E=a.defined,v=a.each,G=a.format,l=a.grep,t=a.inArray,p=a.isNumber,H=a.isString,n=a.map,g=a.merge,b=a.pick,h=a.Point,u=a.Series,q=a.splat,f=a.SVGRenderer,c=a.wrap,r=u.prototype,C=r.init,x=r.processData,e=h.prototype.tooltipFormatter;a.StockChart=a.stockChart=function(c,e,d){var f=H(c)||c.nodeName,k=arguments[f?1:0],h=k.series,m=a.getOptions(),l,p=b(k.navigator&&k.navigator.enabled,m.navigator.enabled,!0),r=p?{startOnTick:!1,endOnTick:!1}:
null,t={marker:{enabled:!1,radius:2}},u={shadow:!1,borderWidth:0};k.xAxis=n(q(k.xAxis||{}),function(a){return g({minPadding:0,maxPadding:0,overscroll:0,ordinal:!0,title:{text:null},labels:{overflow:"justify"},showLastLabel:!0},m.xAxis,a,{type:"datetime",categories:null},r)});k.yAxis=n(q(k.yAxis||{}),function(a){l=b(a.opposite,!0);return g({labels:{y:-2},opposite:l,showLastLabel:!1,title:{text:null}},m.yAxis,a)});k.series=null;k=g({chart:{panning:!0,pinchType:"x"},navigator:{enabled:p},scrollbar:{enabled:b(m.scrollbar.enabled,
!0)},rangeSelector:{enabled:b(m.rangeSelector.enabled,!0)},title:{text:null},tooltip:{split:b(m.tooltip.split,!0),crosshairs:!0},legend:{enabled:!1},plotOptions:{line:t,spline:t,area:t,areaspline:t,arearange:t,areasplinerange:t,column:u,columnrange:u,candlestick:u,ohlc:u}},k,{isStock:!0});k.series=h;return f?new A(c,k,d):new A(k,e)};c(B.prototype,"autoLabelAlign",function(a){var b=this.chart,d=this.options,b=b._labelPanes=b._labelPanes||{},c=this.options.labels;return this.chart.options.isStock&&
"yAxis"===this.coll&&(d=d.top+","+d.height,!b[d]&&c.enabled)?(15===c.x&&(c.x=0),void 0===c.align&&(c.align="right"),b[d]=this,"right"):a.apply(this,[].slice.call(arguments,1))});c(B.prototype,"destroy",function(a){var b=this.chart,d=this.options&&this.options.top+","+this.options.height;d&&b._labelPanes&&b._labelPanes[d]===this&&delete b._labelPanes[d];return a.apply(this,Array.prototype.slice.call(arguments,1))});c(B.prototype,"getPlotLinePath",function(c,e,d,f,g,h){var k=this,m=this.isLinked&&!this.series?
this.linkedParent.series:this.series,l=k.chart,q=l.renderer,r=k.left,z=k.top,u,w,x,y,A=[],C=[],B,D;if("xAxis"!==k.coll&&"yAxis"!==k.coll)return c.apply(this,[].slice.call(arguments,1));C=function(a){var b="xAxis"===a?"yAxis":"xAxis";a=k.options[b];return p(a)?[l[b][a]]:H(a)?[l.get(a)]:n(m,function(a){return a[b]})}(k.coll);v(k.isXAxis?l.yAxis:l.xAxis,function(a){if(E(a.options.id)?-1===a.options.id.indexOf("navigator"):1){var b=a.isXAxis?"yAxis":"xAxis",b=E(a.options[b])?l[b][a.options[b]]:l[b][0];
k===b&&C.push(a)}});B=C.length?[]:[k.isXAxis?l.yAxis[0]:l.xAxis[0]];v(C,function(b){-1!==t(b,B)||a.find(B,function(a){return a.pos===b.pos&&a.len&&b.len})||B.push(b)});D=b(h,k.translate(e,null,null,f));p(D)&&(k.horiz?v(B,function(a){var b;w=a.pos;y=w+a.len;u=x=Math.round(D+k.transB);if(u<r||u>r+k.width)g?u=x=Math.min(Math.max(r,u),r+k.width):b=!0;b||A.push("M",u,w,"L",x,y)}):v(B,function(a){var b;u=a.pos;x=u+a.len;w=y=Math.round(z+k.height-D);if(w<z||w>z+k.height)g?w=y=Math.min(Math.max(z,w),k.top+
k.height):b=!0;b||A.push("M",u,w,"L",x,y)}));return 0<A.length?q.crispPolyLine(A,d||1):null});f.prototype.crispPolyLine=function(a,b){var d;for(d=0;d<a.length;d+=6)a[d+1]===a[d+4]&&(a[d+1]=a[d+4]=Math.round(a[d+1])-b%2/2),a[d+2]===a[d+5]&&(a[d+2]=a[d+5]=Math.round(a[d+2])+b%2/2);return a};c(B.prototype,"hideCrosshair",function(a,b){a.call(this,b);this.crossLabel&&(this.crossLabel=this.crossLabel.hide())});c(B.prototype,"drawCrosshair",function(a,c,d){var e,f;a.call(this,c,d);if(E(this.crosshair.label)&&
this.crosshair.label.enabled&&this.cross){a=this.chart;var g=this.options.crosshair.label,k=this.horiz;e=this.opposite;f=this.left;var h=this.top,l=this.crossLabel,m,n=g.format,p="",r="inside"===this.options.tickPosition,q=!1!==this.crosshair.snap,t=0;c||(c=this.cross&&this.cross.e);m=k?"center":e?"right"===this.labelAlign?"right":"left":"left"===this.labelAlign?"left":"center";l||(l=this.crossLabel=a.renderer.label(null,null,null,g.shape||"callout").addClass("highcharts-crosshair-label"+(this.series[0]&&
" highcharts-color-"+this.series[0].colorIndex)).attr({align:g.align||m,padding:b(g.padding,8),r:b(g.borderRadius,3),zIndex:2}).add(this.labelGroup));k?(m=q?d.plotX+f:c.chartX,h+=e?0:this.height):(m=e?this.width+f:0,h=q?d.plotY+h:c.chartY);n||g.formatter||(this.isDatetimeAxis&&(p="%b %d, %Y"),n="{value"+(p?":"+p:"")+"}");c=q?d[this.isXAxis?"x":"y"]:this.toValue(k?c.chartX:c.chartY);l.attr({text:n?G(n,{value:c}):g.formatter.call(this,c),x:m,y:h,visibility:"visible"});c=l.getBBox();if(k){if(r&&!e||
!r&&e)h=l.y-c.height}else h=l.y-c.height/2;k?(e=f-c.x,f=f+this.width-c.x):(e="left"===this.labelAlign?f:0,f="right"===this.labelAlign?f+this.width:a.chartWidth);l.translateX<e&&(t=e-l.translateX);l.translateX+c.width>=f&&(t=-(l.translateX+c.width-f));l.attr({x:m+t,y:h,anchorX:k?m:this.opposite?0:a.chartWidth,anchorY:k?this.opposite?a.chartHeight:0:h+c.height/2})}});r.init=function(){C.apply(this,arguments);this.setCompare(this.options.compare)};r.setCompare=function(a){this.modifyValue="value"===
a||"percent"===a?function(b,c){var d=this.compareValue;if(void 0!==b&&void 0!==d)return b="value"===a?b-d:b/d*100-(100===this.options.compareBase?0:100),c&&(c.change=b),b}:null;this.userOptions.compare=a;this.chart.hasRendered&&(this.isDirty=!0)};r.processData=function(){var a,b=-1,c,e,f=!0===this.options.compareStart?0:1,g,h;x.apply(this,arguments);if(this.xAxis&&this.processedYData)for(c=this.processedXData,e=this.processedYData,g=e.length,this.pointArrayMap&&(b=t("close",this.pointArrayMap),-1===
b&&(b=t(this.pointValKey||"y",this.pointArrayMap))),a=0;a<g-f;a++)if(h=e[a]&&-1<b?e[a][b]:e[a],p(h)&&c[a+f]>=this.xAxis.min&&0!==h){this.compareValue=h;break}};c(r,"getExtremes",function(a){var b;a.apply(this,[].slice.call(arguments,1));this.modifyValue&&(b=[this.modifyValue(this.dataMin),this.modifyValue(this.dataMax)],this.dataMin=y(b),this.dataMax=D(b))});B.prototype.setCompare=function(a,c){this.isXAxis||(v(this.series,function(b){b.setCompare(a)}),b(c,!0)&&this.chart.redraw())};h.prototype.tooltipFormatter=
function(c){c=c.replace("{point.change}",(0<this.change?"+":"")+a.numberFormat(this.change,b(this.series.tooltipOptions.changeDecimals,2)));return e.apply(this,[c])};c(u.prototype,"render",function(a){this.chart.is3d&&this.chart.is3d()||this.chart.polar||!this.xAxis||this.xAxis.isRadial||(!this.clipBox&&this.animate?(this.clipBox=g(this.chart.clipBox),this.clipBox.width=this.xAxis.len,this.clipBox.height=this.yAxis.len):this.chart[this.sharedClipKey]?this.chart[this.sharedClipKey].attr({width:this.xAxis.len,
height:this.yAxis.len}):this.clipBox&&(this.clipBox.width=this.xAxis.len,this.clipBox.height=this.yAxis.len));a.call(this)});c(A.prototype,"getSelectedPoints",function(a){var b=a.call(this);v(this.series,function(a){a.hasGroupedData&&(b=b.concat(l(a.points||[],function(a){return a.selected})))});return b});c(A.prototype,"update",function(a,b){"scrollbar"in b&&this.navigator&&(g(!0,this.options.scrollbar,b.scrollbar),this.navigator.update({},!1),delete b.scrollbar);return a.apply(this,Array.prototype.slice.call(arguments,
1))})})(J)});
