/*
 Highcharts JS v6.0.7 (2018-02-16)
 Highstock as a plugin for Highcharts

 (c) 2017 Torstein Honsi

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