/*
 Highcharts JS v7.0.1 (2018-12-19)
 Annotations module

 (c) 2009-2018 Torstein Honsi

 License: www.highcharts.com/license
*/
(function(r){"object"===typeof module&&module.exports?module.exports=r:"function"===typeof define&&define.amd?define(function(){return r}):r("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(r){var A=function(a){return{addEvents:function(){var h=this;a.addEvent(h.graphic.element,"mousedown",function(f){h.onMouseDown(f)});a.objectEach(h.options.events,function(f,d){var c=function(c){"click"===d&&h.cancelClick||f.call(h,h.chart.pointer.normalize(c),h.target)};if("drag"!==d)h.graphic.on(d,
c);else a.addEvent(h,"drag",c)});h.options.draggable&&(a.addEvent(h,"drag",h.onDrag),h.graphic.renderer.styledMode||h.graphic.css({cursor:{x:"ew-resize",y:"ns-resize",xy:"move"}[h.options.draggable]}))},removeDocEvents:function(){this.removeDrag&&(this.removeDrag=this.removeDrag());this.removeMouseUp&&(this.removeMouseUp=this.removeMouseUp())},onMouseDown:function(h){var f=this,d=f.chart.pointer,c,g;2!==h.button&&(h.stopPropagation(),h=d.normalize(h),c=h.chartX,g=h.chartY,f.cancelClick=!1,f.removeDrag=
a.addEvent(a.doc,"mousemove",function(b){f.hasDragged=!0;b=d.normalize(b);b.prevChartX=c;b.prevChartY=g;a.fireEvent(f,"drag",b);c=b.chartX;g=b.chartY}),f.removeMouseUp=a.addEvent(a.doc,"mouseup",function(b){f.cancelClick=f.hasDragged;f.hasDragged=!1;f.onMouseUp(b)}))},onMouseUp:function(){this.removeDocEvents()},onDrag:function(a){if(this.chart.isInsidePlot(a.chartX-this.chart.plotLeft,a.chartY-this.chart.plotTop)){var f=this.mouseMoveToTranslation(a);"x"===this.options.draggable&&(f.y=0);"y"===this.options.draggable&&
(f.x=0);this.points.length?this.translate(f.x,f.y):(this.shapes.forEach(function(d){d.translate(f.x,f.y)}),this.labels.forEach(function(d){d.translate(f.x,f.y)}));this.redraw(!1)}},mouseMoveToRadians:function(a,f,d){var c=a.prevChartY-d,g=a.prevChartX-f;d=a.chartY-d;a=a.chartX-f;this.chart.inverted&&(f=g,g=c,c=f,f=a,a=d,d=f);return Math.atan2(d,a)-Math.atan2(c,g)},mouseMoveToTranslation:function(a){var f=a.chartX-a.prevChartX;a=a.chartY-a.prevChartY;var d;this.chart.inverted&&(d=a,a=f,f=d);return{x:f,
y:a}},mouseMoveToScale:function(a,f,d){f=(a.chartX-f||1)/(a.prevChartX-f||1);a=(a.chartY-d||1)/(a.prevChartY-d||1);this.chart.inverted&&(d=a,a=f,f=d);return{x:f,y:a}},destroy:function(){this.removeDocEvents();a.removeEvent(this);this.hcEvents=null}}}(r),B=function(a,h){function f(d,c,g,b){this.chart=d;this.target=c;this.options=g;this.index=a.pick(g.index,b)}a.extend(f.prototype,h);f.prototype.setVisibility=function(d){this.graphic.attr("visibility",d?"visible":"hidden");this.options.visible=d};f.prototype.render=
function(){var d=this.chart,c=this.options;this.graphic=d.renderer.symbol(c.symbol,0,0,c.width,c.height).add(d.controlPointsGroup).css(c.style);this.setVisibility(c.visible);this.addEvents()};f.prototype.redraw=function(d){this.graphic[d?"animate":"attr"](this.options.positioner.call(this,this.target))};f.prototype.destroy=function(){h.destroy.call(this);this.graphic&&(this.graphic=this.graphic.destroy());this.options=this.target=this.chart=null};f.prototype.update=function(d){var c=this.chart,g=
this.target,b=this.index;d=a.merge(!0,this.options,d);this.destroy();this.constructor(c,g,d,b);this.render(c.controlPointsGroup);this.redraw()};return f}(r,A),y=function(a){function h(f,d,c){this.series={visible:!0,chart:f,getPlotBox:a.Series.prototype.getPlotBox};this.target=d||null;this.options=c;this.applyOptions(this.getOptions())}h.fromPoint=function(a){return new h(a.series.chart,null,{x:a.x,y:a.y,xAxis:a.series.xAxis,yAxis:a.series.yAxis})};h.pointToPixels=function(a,d){var c=a.series,g=c.chart,
b=a.plotX,e=a.plotY;g.inverted&&(a.mock?(b=a.plotY,e=a.plotX):(b=g.plotWidth-a.plotY,e=g.plotHeight-a.plotX));c&&!d&&(a=c.getPlotBox(),b+=a.translateX,e+=a.translateY);return{x:b,y:e}};h.pointToOptions=function(a){return{x:a.x,y:a.y,xAxis:a.series.xAxis,yAxis:a.series.yAxis}};a.extend(h.prototype,{mock:!0,hasDynamicOptions:function(){return"function"===typeof this.options},getOptions:function(){return this.hasDynamicOptions()?this.options.call(this,this.target):this.options},applyOptions:function(a){this.command=
a.command;this.setAxis(a,"x");this.setAxis(a,"y");this.refresh()},setAxis:function(f,d){d+="Axis";f=f[d];var c=this.series.chart;this.series[d]=f instanceof a.Axis?f:a.defined(f)?c[d][f]||c.get(f):null},toAnchor:function(){var a=[this.plotX,this.plotY,0,0];this.series.chart.inverted&&(a[0]=this.plotY,a[1]=this.plotX);return a},getLabelConfig:function(){return{x:this.x,y:this.y,point:this}},isInsidePane:function(){var f=this.plotX,d=this.plotY,c=this.series.xAxis,g=this.series.yAxis,b=!0;c&&(b=a.defined(f)&&
0<=f&&f<=c.len);g&&(b=b&&a.defined(d)&&0<=d&&d<=g.len);return b},refresh:function(){var a=this.series,d=a.xAxis,a=a.yAxis,c=this.getOptions();d?(this.x=c.x,this.plotX=d.toPixels(c.x,!0)):(this.x=null,this.plotX=c.x);a?(this.y=c.y,this.plotY=a.toPixels(c.y,!0)):(this.y=null,this.plotY=c.y);this.isInside=this.isInsidePane()},translate:function(a,d,c,g){this.hasDynamicOptions()||(this.plotX+=c,this.plotY+=g,this.refreshOptions())},scale:function(a,d,c,g){if(!this.hasDynamicOptions()){var b=this.plotY*
g;this.plotX=(1-c)*a+this.plotX*c;this.plotY=(1-g)*d+b;this.refreshOptions()}},rotate:function(a,d,c){if(!this.hasDynamicOptions()){var g=Math.cos(c);c=Math.sin(c);var b=this.plotX,e=this.plotY,b=b-a,e=e-d;this.plotX=b*g-e*c+a;this.plotY=b*c+e*g+d;this.refreshOptions()}},refreshOptions:function(){var a=this.series,d=a.xAxis,a=a.yAxis;this.x=this.options.x=d?this.options.x=d.toValue(this.plotX,!0):this.plotX;this.y=this.options.y=a?a.toValue(this.plotY,!0):this.plotY}});return h}(r),u=function(a,h,
f){return{init:function(a,c){this.annotation=a;this.chart=a.chart;this.options=c;this.points=[];this.controlPoints=[];this.linkPoints();this.addControlPoints()},attr:function(){this.graphic.attr.apply(this.graphic,arguments)},getPointsOptions:function(){var d=this.options;return d.points||d.point&&a.splat(d.point)},attrsFromOptions:function(a){var c=this.constructor.attrsMap,g={},b,e,d=this.chart.styledMode;for(b in a)e=c[b],!e||d&&-1!==["fill","stroke","stroke-width"].indexOf(e)||(g[e]=a[b]);return g},
anchor:function(d){var c=d.series.getPlotBox();d=d.mock?d.toAnchor():a.Tooltip.prototype.getAnchor.call({chart:d.series.chart},d);d={x:d[0]+(this.options.x||0),y:d[1]+(this.options.y||0),height:d[2]||0,width:d[3]||0};return{relativePosition:d,absolutePosition:a.merge(d,{x:d.x+c.translateX,y:d.y+c.translateY})}},point:function(d,c){if(d&&d.series)return d;c&&null!==c.series||(a.isObject(d)?c=new f(this.chart,this,d):a.isString(d)?c=this.chart.get(d)||null:"function"===typeof d&&(c=d.call(c,this),c=
c.series?c:new f(this.chart,this,d)));return c},linkPoints:function(){var a=this.getPointsOptions(),c=this.points,g=a&&a.length||0,b,e;for(b=0;b<g;b++){e=this.point(a[b],c[b]);if(!e){c.length=0;return}e.mock&&e.refresh();c[b]=e}return c},addControlPoints:function(){var d=this.options.controlPoints;(d||[]).forEach(function(c,g){c=a.merge(this.options.controlPointOptions,c);c.index||(c.index=g);d[g]=c;this.controlPoints.push(new h(this.chart,this,c))},this)},shouldBeDrawn:function(){return!!this.points.length},
render:function(){this.controlPoints.forEach(function(a){a.render()})},redraw:function(a){this.controlPoints.forEach(function(c){c.redraw(a)})},transform:function(a,c,g,b,e){if(this.chart.inverted){var d=c;c=g;g=d}this.points.forEach(function(d,k){this.transformPoint(a,c,g,b,e,k)},this)},transformPoint:function(a,c,g,b,e,q){var d=this.points[q];d.mock||(d=this.points[q]=f.fromPoint(d));d[a](c,g,b,e)},translate:function(a,c){this.transform("translate",null,null,a,c)},translatePoint:function(a,c,g){this.transformPoint("translate",
null,null,a,c,g)},rotate:function(a,c,g){this.transform("rotate",a,c,g)},scale:function(a,c,g,b){this.transform("scale",a,c,g,b)},setControlPointsVisibility:function(a){this.controlPoints.forEach(function(c){c.setVisibility(a)})},destroy:function(){this.graphic&&(this.graphic=this.graphic.destroy());this.tracker&&(this.tracker=this.tracker.destroy());this.controlPoints.forEach(function(a){a.destroy()});this.options=this.controlPoints=this.points=this.chart=null;this.annotation&&(this.annotation=null)},
update:function(d){var c=this.annotation;d=a.merge(!0,this.options,d);var g=this.graphic.parentGroup;this.destroy();this.constructor(c,d);this.render(g);this.redraw()}}}(r,B,y),x=function(a){var h={arrow:{tagName:"marker",render:!1,id:"arrow",refY:5,refX:9,markerWidth:10,markerHeight:10,children:[{tagName:"path",d:"M 0 0 L 10 5 L 0 10 Z",strokeWidth:0}]},"reverse-arrow":{tagName:"marker",render:!1,id:"reverse-arrow",refY:5,refX:1,markerWidth:10,markerHeight:10,children:[{tagName:"path",d:"M 0 5 L 10 0 L 10 10 Z",
strokeWidth:0}]}};a.SVGRenderer.prototype.addMarker=function(d,c){var g={id:d},b={stroke:c.color||"none",fill:c.color||"rgba(0, 0, 0, 0.75)"};g.children=c.children.map(function(e){return a.merge(b,e)});c=this.definition(a.merge(!0,{markerWidth:20,markerHeight:20,refX:0,refY:0,orient:"auto"},c,g));c.id=d;return c};var f=function(a){return function(c){this.attr(a,"url(#"+c+")")}},f={markerEndSetter:f("marker-end"),markerStartSetter:f("marker-start"),setItemMarkers:function(d){var c=d.options,g=d.chart,
b=g.options.defs,e=c.fill,q=a.defined(e)&&"none"!==e?e:c.stroke;["markerStart","markerEnd"].forEach(function(e){var k=c[e],l,m,n;if(k){for(n in b)if(l=b[n],k===l.id&&"marker"===l.tagName){m=l;break}m&&(k=d[e]=g.renderer.addMarker((c.id||a.uniqueKey())+"-"+m.id,a.merge(m,{color:q})),d.attr(e,k.attr("id")))}})}};a.SVGRenderer.prototype.definition=function(d){function c(b,e){var d;a.splat(b).forEach(function(b){var k=g.createElement(b.tagName),l={};a.objectEach(b,function(b,a){"tagName"!==a&&"children"!==
a&&"textContent"!==a&&(l[a]=b)});k.attr(l);k.add(e||g.defs);b.textContent&&k.element.appendChild(a.doc.createTextNode(b.textContent));c(b.children||[],k);d=k});return d}var g=this;return c(d)};a.addEvent(a.Chart,"afterGetContainer",function(){this.options.defs=a.merge(h,this.options.defs||{});a.objectEach(this.options.defs,function(a){"marker"===a.tagName&&!1!==a.render&&this.renderer.addMarker(a.id,a)},this)});return f}(r),x=function(a,h,f){function d(a,b){this.init(a,b)}var c="rgba(192,192,192,"+
(a.svg?.0001:.002)+")";d.attrsMap={dashStyle:"dashstyle",strokeWidth:"stroke-width",stroke:"stroke",fill:"fill",zIndex:"zIndex"};a.merge(!0,d.prototype,h,{type:"path",setMarkers:f.setItemMarkers,toD:function(){var a=this.options.d;if(a)return"function"===typeof a?a.call(this):a;for(var b=this.points,e=b.length,c=e,d=b[0],k=c&&this.anchor(d).absolutePosition,l=0,m=2,a=k&&["M",k.x,k.y];++l<e&&c;)d=b[l],c=d.command||"L",k=this.anchor(d).absolutePosition,"Z"===c?a[++m]=c:(c!==b[l-1].command&&(a[++m]=
c),a[++m]=k.x,a[++m]=k.y),c=d.series.visible;return c?this.chart.renderer.crispLine(a,this.graphic.strokeWidth()):null},shouldBeDrawn:function(){return h.shouldBeDrawn.call(this)||!!this.options.d},render:function(g){var b=this.options,e=this.attrsFromOptions(b);this.graphic=this.annotation.chart.renderer.path(["M",0,0]).attr(e).add(g);b.className&&this.graphic.addClass(b.className);this.tracker=this.annotation.chart.renderer.path(["M",0,0]).addClass("highcharts-tracker-line").attr({zIndex:2}).add(g);
this.annotation.chart.styledMode||this.tracker.attr({"stroke-linejoin":"round",stroke:c,fill:c,"stroke-width":this.graphic.strokeWidth()+2*b.snap});h.render.call(this);a.extend(this.graphic,{markerStartSetter:f.markerStartSetter,markerEndSetter:f.markerEndSetter});this.setMarkers(this)},redraw:function(a){var b=this.toD(),e=a?"animate":"attr";b?(this.graphic[e]({d:b}),this.tracker[e]({d:b})):(this.graphic.attr({d:"M 0 -9000000000"}),this.tracker.attr({d:"M 0 -9000000000"}));this.graphic.placed=this.tracker.placed=
!!b;h.redraw.call(this,a)}});return d}(r,u,x),E=function(a,h,f){function d(a,g){this.init(a,g)}d.attrsMap=a.merge(f.attrsMap,{width:"width",height:"height"});a.merge(!0,d.prototype,h,{type:"rect",render:function(a){var c=this.attrsFromOptions(this.options);this.graphic=this.annotation.chart.renderer.rect(0,-9E9,0,0).attr(c).add(a);h.render.call(this)},redraw:function(a){var c=this.anchor(this.points[0]).absolutePosition;if(c)this.graphic[a?"animate":"attr"]({x:c.x,y:c.y,width:this.options.width,height:this.options.height});
else this.attr({x:0,y:-9E9});this.graphic.placed=!!c;h.redraw.call(this,a)},translate:function(a,g){this.translatePoint(a,g,0)}});return d}(r,u,x),F=function(a,h,f){function d(a,g){this.init(a,g)}d.attrsMap=a.merge(f.attrsMap,{r:"r"});a.merge(!0,d.prototype,h,{type:"circle",render:function(a){var c=this.attrsFromOptions(this.options);this.graphic=this.annotation.chart.renderer.circle(0,-9E9,0).attr(c).add(a);h.render.call(this)},redraw:function(a){var c=this.anchor(this.points[0]).absolutePosition;
if(c)this.graphic[a?"animate":"attr"]({x:c.x,y:c.y,r:this.options.r});else this.graphic.attr({x:0,y:-9E9});this.graphic.placed=!!c;h.redraw.call(this,a)},translate:function(a,g){this.translatePoint(a,g,0)},setRadius:function(a){this.options.r=a}});return d}(r,u,x),C=function(a,h,f){function d(a,g){this.init(a,g)}d.shapesWithoutBackground=["connector"];d.alignedPosition=function(a,g){var b=a.align,e=a.verticalAlign,c=(g.x||0)+(a.x||0),d=(g.y||0)+(a.y||0),k,l;"right"===b?k=1:"center"===b&&(k=2);k&&
(c+=(g.width-(a.width||0))/k);"bottom"===e?l=1:"middle"===e&&(l=2);l&&(d+=(g.height-(a.height||0))/l);return{x:Math.round(c),y:Math.round(d)}};d.justifiedOptions=function(a,g,b,e){var c=b.align,d=b.verticalAlign,k=g.box?0:g.padding||0,l=g.getBBox();g={align:c,verticalAlign:d,x:b.x,y:b.y,width:g.width,height:g.height};b=e.x-a.plotLeft;var m=e.y-a.plotTop;e=b+k;0>e&&("right"===c?g.align="left":g.x=-e);e=b+l.width-k;e>a.plotWidth&&("left"===c?g.align="right":g.x=a.plotWidth-e);e=m+k;0>e&&("bottom"===
d?g.verticalAlign="top":g.y=-e);e=m+l.height-k;e>a.plotHeight&&("top"===d?g.verticalAlign="bottom":g.y=a.plotHeight-e);return g};d.attrsMap={backgroundColor:"fill",borderColor:"stroke",borderWidth:"stroke-width",zIndex:"zIndex",borderRadius:"r",padding:"padding"};a.merge(!0,d.prototype,h,{translatePoint:function(a,g){h.translatePoint.call(this,a,g,0)},translate:function(a,g){this.options.x+=a;this.options.y+=g},render:function(a){var c=this.options,b=this.attrsFromOptions(c),e=c.style;this.graphic=
this.annotation.chart.renderer.label("",0,-9E9,c.shape,null,null,c.useHTML,null,"annotation-label").attr(b).add(a);this.annotation.chart.styledMode||("contrast"===e.color&&(e.color=this.annotation.chart.renderer.getContrast(-1<d.shapesWithoutBackground.indexOf(c.shape)?"#FFFFFF":c.backgroundColor)),this.graphic.css(c.style).shadow(c.shadow));c.className&&this.graphic.addClass(c.className);this.graphic.labelrank=c.labelrank;h.render.call(this)},redraw:function(c){var d=this.options,b=this.text||d.format||
d.text,e=this.graphic,q=this.points[0];e.attr({text:b?a.format(b,q.getLabelConfig(),this.annotation.chart.time):d.formatter.call(q,this)});d=this.anchor(q);(b=this.position(d))?(e.alignAttr=b,b.anchorX=d.absolutePosition.x,b.anchorY=d.absolutePosition.y,e[c?"animate":"attr"](b)):e.attr({x:0,y:-9E9});e.placed=!!b;h.redraw.call(this,c)},anchor:function(){var a=h.anchor.apply(this,arguments),d=this.options.x||0,b=this.options.y||0;a.absolutePosition.x-=d;a.absolutePosition.y-=b;a.relativePosition.x-=
d;a.relativePosition.y-=b;return a},position:function(c){var g=this.graphic,b=this.annotation.chart,e=this.points[0],q=this.options,h=c.absolutePosition,k=c.relativePosition,l;if(c=e.series.visible&&f.prototype.isInsidePane.call(e))q.distance?l=a.Tooltip.prototype.getPosition.call({chart:b,distance:a.pick(q.distance,16)},g.width,g.height,{plotX:k.x,plotY:k.y,negative:e.negative,ttBelow:e.ttBelow,h:k.height||k.width}):q.positioner?l=q.positioner.call(this):(e={x:h.x,y:h.y,width:0,height:0},l=d.alignedPosition(a.extend(q,
{width:g.width,height:g.height}),e),"justify"===this.options.overflow&&(l=d.alignedPosition(d.justifiedOptions(b,g,q,l),e))),q.crop&&(q=l.x-b.plotLeft,e=l.y-b.plotTop,c=b.isInsidePlot(q,e)&&b.isInsidePlot(q+g.width,e+g.height));return c?l:null}});a.SVGRenderer.prototype.symbols.connector=function(c,d,b,e,q){var g=q&&q.anchorX;q=q&&q.anchorY;var k,l,m=b/2;a.isNumber(g)&&a.isNumber(q)&&(k=["M",g,q],l=d-q,0>l&&(l=-e-l),l<b&&(m=g<c+b/2?l:b-l),q>d+e?k.push("L",c+m,d+e):q<d?k.push("L",c+m,d):g<c?k.push("L",
c,d+e/2):g>c+b&&k.push("L",c+b,d+e/2));return k||[]};return d}(r,u,y),G=function(a,h,f){function d(a,d){this.init(a,d)}d.attrsMap={width:"width",height:"height",zIndex:"zIndex"};a.merge(!0,d.prototype,h,{type:"image",render:function(a){var c=this.attrsFromOptions(this.options),b=this.options;this.graphic=this.annotation.chart.renderer.image(b.src,0,-9E9,b.width,b.height).attr(c).add(a);this.graphic.width=b.width;this.graphic.height=b.height;h.render.call(this)},redraw:function(a){var c=this.anchor(this.points[0]);
if(c=f.prototype.position.call(this,c))this.graphic[a?"animate":"attr"]({x:c.x,y:c.y});else this.graphic.attr({x:0,y:-9E9});this.graphic.placed=!!c;h.redraw.call(this,a)},translate:function(a,d){this.translatePoint(a,d,0)}});return d}(r,u,C);(function(a,h,f,d,c,g,b,e,q,w){var k=a.merge,l=a.addEvent,m=a.defined,n=a.erase,p=a.find,z=a.isString,D=a.pick,H=a.reduce,r=a.splat,v=a.destroyObjectProperties,t=a.Annotation=function(a,b){var e;this.chart=a;this.points=[];this.controlPoints=[];this.coll="annotations";
this.labels=[];this.shapes=[];this.options=b;this.userOptions=k(!0,{},b);e=this.getLabelsAndShapesOptions(this.userOptions,b);this.userOptions.labels=e.labels;this.userOptions.shapes=e.shapes;this.init(a,b)};k(!0,t.prototype,h,e,{defaultOptions:{visible:!0,draggable:"xy",labelOptions:{align:"center",allowOverlap:!1,backgroundColor:"rgba(0, 0, 0, 0.75)",borderColor:"black",borderRadius:3,borderWidth:1,className:"",crop:!1,formatter:function(){return m(this.y)?this.y:"Annotation label"},overflow:"justify",
padding:5,shadow:!1,shape:"callout",style:{fontSize:"11px",fontWeight:"normal",color:"contrast"},useHTML:!1,verticalAlign:"bottom",x:0,y:-16},shapeOptions:{stroke:"rgba(0, 0, 0, 0.75)",strokeWidth:1,fill:"rgba(0, 0, 0, 0.75)",r:0,snap:2},controlPointOptions:{symbol:"circle",width:10,height:10,style:{stroke:"black","stroke-width":2,fill:"white"},visible:!1,events:{}},events:{},zIndex:6},init:function(){this.linkPoints();this.addControlPoints();this.addShapes();this.addLabels();this.addClipPaths();
this.setLabelCollector()},getLabelsAndShapesOptions:function(a,b){var e={};["labels","shapes"].forEach(function(l){a[l]&&(e[l]=r(b[l]).map(function(b,e){return k(a[l][e],b)}))});return e},addShapes:function(){(this.options.shapes||[]).forEach(function(a,b){a=this.initShape(a);this.options.shapes[b]=a.options},this)},addLabels:function(){(this.options.labels||[]).forEach(function(a,b){a=this.initLabel(a);this.options.labels[b]=a.options},this)},addClipPaths:function(){this.setClipAxes();this.clipXAxis&&
this.clipYAxis&&(this.clipRect=this.chart.renderer.clipRect(this.getClipBox()))},setClipAxes:function(){var a=this.chart.xAxis,b=this.chart.yAxis,e=H((this.options.labels||[]).concat(this.options.shapes||[]),function(e,l){return[a[l&&l.point&&l.point.xAxis]||e[0],b[l&&l.point&&l.point.yAxis]||e[1]]},[]);this.clipXAxis=e[0];this.clipYAxis=e[1]},getClipBox:function(){return{x:this.clipXAxis.left,y:this.clipYAxis.top,width:this.clipXAxis.width,height:this.clipYAxis.height}},setLabelCollector:function(){var a=
this;a.labelCollector=function(){return a.labels.reduce(function(a,b){b.options.allowOverlap||a.push(b.graphic);return a},[])};a.chart.labelCollectors.push(a.labelCollector)},setOptions:function(a){this.options=k(this.defaultOptions,a)},redraw:function(a){this.linkPoints();this.graphic||this.render();this.clipRect&&this.clipRect.animate(this.getClipBox());this.redrawItems(this.shapes,a);this.redrawItems(this.labels,a);h.redraw.call(this,a)},redrawItems:function(a,b){for(var e=a.length;e--;)this.redrawItem(a[e],
b)},render:function(){var a=this.chart.renderer;this.graphic=a.g("annotation").attr({zIndex:this.options.zIndex,visibility:this.options.visible?"visible":"hidden"}).add();this.shapesGroup=a.g("annotation-shapes").add(this.graphic).clip(this.chart.plotBoxClip);this.labelsGroup=a.g("annotation-labels").attr({translateX:0,translateY:0}).add(this.graphic);this.clipRect&&this.graphic.clip(this.clipRect);this.addEvents();h.render.call(this)},setVisibility:function(a){var b=this.options;a=D(a,!b.visible);
this.graphic.attr("visibility",a?"visible":"hidden");a||this.setControlPointsVisibility(!1);b.visible=a},setControlPointsVisibility:function(a){var b=function(b){b.setControlPointsVisibility(a)};h.setControlPointsVisibility.call(this,a);this.shapes.forEach(b);this.labels.forEach(b)},destroy:function(){var a=this.chart,b=function(a){a.destroy()};this.labels.forEach(b);this.shapes.forEach(b);this.clipYAxis=this.clipXAxis=null;n(a.labelCollectors,this.labelCollector);e.destroy.call(this);h.destroy.call(this);
v(this,a)},remove:function(){return this.destroy()},update:function(b){var e=this.chart,l=this.getLabelsAndShapesOptions(this.userOptions,b);b=a.merge(!0,this.userOptions,b);b.labels=l.labels;b.shapes=l.shapes;this.destroy();this.constructor(e,b);this.redraw()},initShape:function(a){a=k(this.options.shapeOptions,{controlPointOptions:this.options.controlPointOptions},a);a=new t.shapesMap[a.type](this,a);a.itemType="shape";this.shapes.push(a);return a},initLabel:function(a){a=k(this.options.labelOptions,
{controlPointOptions:this.options.controlPointOptions},a);a=new b(this,a);a.itemType="label";this.labels.push(a);return a},redrawItem:function(b,e){b.linkPoints();b.shouldBeDrawn()?(b.graphic||this.renderItem(b),b.redraw(a.pick(e,!0)&&b.graphic.placed),b.points.length&&this.adjustVisibility(b)):this.destroyItem(b)},adjustVisibility:function(a){var b=!1,e=a.graphic;a.points.forEach(function(a){!1!==a.series.visible&&!1!==a.visible&&(b=!0)});b?"hidden"===e.visibility&&e.show():e.hide()},destroyItem:function(a){n(this[a.itemType+
"s"],a);a.destroy()},renderItem:function(a){a.render("label"===a.itemType?this.labelsGroup:this.shapesGroup)}});t.shapesMap={rect:f,circle:d,path:c,image:g};t.types={};t.MockPoint=q;t.ControlPoint=w;a.extendAnnotation=function(a,b,e,l){b=b||t;k(!0,a.prototype,b.prototype,e);a.prototype.defaultOptions=k(a.prototype.defaultOptions,l||{})};a.Chart.prototype.collectionsWithUpdate.push("annotations");a.extend(a.Chart.prototype,{initAnnotation:function(b){var e=t.types[b.type]||t;b=a.merge(e.prototype.defaultOptions,
b);e=new e(this,b);this.annotations.push(e);return e},addAnnotation:function(a,b){a=this.initAnnotation(a);this.options.annotations.push(a.options);D(b,!0)&&a.redraw();return a},removeAnnotation:function(a){var b=this.annotations,e=z(a)?p(b,function(b){return b.options.id===a}):a;e&&(n(this.options.annotations,e.options),n(b,e),e.destroy())},drawAnnotations:function(){this.plotBoxClip.attr(this.plotBox);this.annotations.forEach(function(a){a.redraw()})}});a.Chart.prototype.callbacks.push(function(a){a.annotations=
[];a.options.annotations||(a.options.annotations=[]);a.plotBoxClip=this.renderer.clipRect(this.plotBox);a.controlPointsGroup=a.renderer.g("control-points").attr({zIndex:99}).clip(a.plotBoxClip).add();a.options.annotations.forEach(function(b,e){b=a.initAnnotation(b);a.options.annotations[e]=b.options});a.drawAnnotations();l(a,"redraw",a.drawAnnotations);l(a,"destroy",function(){a.plotBoxClip.destroy();a.controlPointsGroup.destroy()})})})(r,u,E,F,x,G,C,A,y,B);(function(a){function h(){f.apply(this,
arguments)}var f=a.Annotation,d=f.MockPoint,c=f.ControlPoint;a.extendAnnotation(h,null,{setClipAxes:function(){this.clipXAxis=this.chart.xAxis[this.options.typeOptions.xAxis];this.clipYAxis=this.chart.yAxis[this.options.typeOptions.yAxis]},getPointsOptions:function(){var a=this.options.typeOptions;return a.points.map(function(b){b.xAxis=a.xAxis;b.yAxis=a.yAxis;return b})},getControlPointsOptions:function(){return this.getPointsOptions()},addControlPoints:function(){this.getControlPointsOptions().forEach(function(d,
b){b=new c(this.chart,this,a.merge(this.options.controlPointOptions,d.controlPoint),b);this.controlPoints.push(b);d.controlPoint=b.options},this)},addShapes:function(){var c=this.options.typeOptions,b=this.initShape(a.merge(c.line,{type:"path",points:this.points.map(function(a,b){return function(a){return a.annotation.points[b]}})}),!1);c.line=b.options}},{typeOptions:{xAxis:0,yAxis:0,line:{fill:"none"}},controlPointOptions:{positioner:function(a){var b=this.graphic;a=d.pointToPixels(a.points[this.index]);
return{x:a.x-b.width/2,y:a.y-b.height/2}},events:{drag:function(a,b){b.chart.isInsidePlot(a.chartX-b.chart.plotLeft,a.chartY-b.chart.plotTop)&&(a=this.mouseMoveToTranslation(a),b.translatePoint(a.x,a.y,this.index),b.redraw(!1))}}}});return f.types.crookedLine=h})(r);(function(a){function h(){d.apply(this,arguments)}var f=a.Annotation,d=f.types.crookedLine;a.extendAnnotation(h,d,{addLabels:function(){this.getPointsOptions().forEach(function(c,d){var b=this.initLabel(a.merge(c.label,{text:this.options.typeOptions.labels[d],
point:function(a){return a.annotation.points[d]}}),!1);c.label=b.options},this)}},{typeOptions:{labels:"(0) (A) (B) (C) (D) (E)".split(" "),line:{strokeWidth:1}},labelOptions:{align:"center",allowOverlap:!0,crop:!0,overflow:"none",type:"rect",backgroundColor:"none",borderWidth:0,y:-5}});return f.types.elliottWave=h})(r);(function(a){function h(){d.apply(this,arguments)}var f=a.Annotation,d=f.types.crookedLine,c=f.ControlPoint,g=f.MockPoint;a.extendAnnotation(h,d,{getPointsOptions:function(){var a=
d.prototype.getPointsOptions.call(this);a[2]=this.heightPointOptions(a[1]);a[3]=this.heightPointOptions(a[0]);return a},getControlPointsOptions:function(){return this.getPointsOptions().slice(0,2)},heightPointOptions:function(b){b=a.merge(b);b.y+=this.options.typeOptions.height;return b},addControlPoints:function(){d.prototype.addControlPoints.call(this);var b=this.options,e=new c(this.chart,this,a.merge(b.controlPointOptions,b.typeOptions.heightControlPoint),2);this.controlPoints.push(e);b.typeOptions.heightControlPoint=
e.options},addShapes:function(){this.addLine();this.addBackground()},addLine:function(){var b=this.initShape(a.merge(this.options.typeOptions.line,{type:"path",points:[this.points[0],this.points[1],function(a){a=g.pointToOptions(a.annotation.points[2]);a.command="M";return a},this.points[3]]}),!1);this.options.typeOptions.line=b.options},addBackground:function(){var b=this.initShape(a.merge(this.options.typeOptions.background,{type:"path",points:this.points.slice()}));this.options.typeOptions.background=
b.options},translateSide:function(a,e,c){c=Number(c);var b=0===c?3:2;this.translatePoint(a,e,c);this.translatePoint(a,e,b)},translateHeight:function(a){this.translatePoint(0,a,2);this.translatePoint(0,a,3);this.options.typeOptions.height=this.points[3].y-this.points[0].y}},{typeOptions:{xAxis:0,yAxis:0,background:{fill:"rgba(130, 170, 255, 0.4)",strokeWidth:0},line:{strokeWidth:1},height:-2,heightControlPoint:{positioner:function(a){var b=g.pointToPixels(a.points[2]);a=g.pointToPixels(a.points[3]);
var c=(b.x+a.x)/2;return{x:c-this.graphic.width/2,y:(a.y-b.y)/(a.x-b.x)*(c-b.x)+b.y-this.graphic.height/2}},events:{drag:function(a,e){e.chart.isInsidePlot(a.chartX-e.chart.plotLeft,a.chartY-e.chart.plotTop)&&(e.translateHeight(this.mouseMoveToTranslation(a).y),e.redraw(!1))}}}},controlPointOptions:{events:{drag:function(a,e){e.chart.isInsidePlot(a.chartX-e.chart.plotLeft,a.chartY-e.chart.plotTop)&&(a=this.mouseMoveToTranslation(a),e.translateSide(a.x,a.y,this.index),e.redraw(!1))}}}});return f.types.tunnel=
h})(r);(function(a){function h(){c.apply(this,arguments)}var f=a.Annotation,d=f.MockPoint,c=f.types.crookedLine;h.findEdgeCoordinate=function(a,e,c,d){var b="x"===c?"y":"x";return(e[c]-a[c])*(d-a[b])/(e[b]-a[b])+a[c]};h.findEdgePoint=function(a,e){var b=a.series.xAxis,c=e.series.yAxis,k=d.pointToPixels(a),l=d.pointToPixels(e),m=l.x-k.x,n=l.y-k.y;e=b.left;var p=e+b.width,b=c.top,c=b+c.height,g=0>m?e:p,f=0>n?b:c,p={x:0===m?k.x:g,y:0===n?k.y:f};0!==m&&0!==n&&(m=h.findEdgeCoordinate(k,l,"y",g),k=h.findEdgeCoordinate(k,
l,"x",f),m>=b&&m<=c?(p.x=g,p.y=m):(p.x=k,p.y=f));p.x-=e;p.y-=b;a.series.chart.inverted&&(a=p.x,p.x=p.y,p.y=a);return p};var g=function(a,e){return function(b){b=b.annotation;var c=b.points,k=b.options.typeOptions.type;"horizontalLine"===k?c=[c[0],new d(b.chart,c[0].target,{x:c[0].x+1,y:c[0].y,xAxis:c[0].options.xAxis,yAxis:c[0].options.yAxis})]:"verticalLine"===k&&(c=[c[0],new d(b.chart,c[0].target,{x:c[0].x,y:c[0].y+1,xAxis:c[0].options.xAxis,yAxis:c[0].options.yAxis})]);return h.findEdgePoint(c[a],
c[e])}};h.endEdgePoint=g(0,1);h.startEdgePoint=g(1,0);a.extendAnnotation(h,c,{addShapes:function(){var b=this.options.typeOptions,e=[this.points[0],h.endEdgePoint];b.type.match(/Line/g)&&(e[0]=h.startEdgePoint);e=this.initShape(a.merge(b.line,{type:"path",points:e}),!1);b.line=e.options}});return f.types.infinityLine=h})(r);(function(a){function h(){this.startRetracements=[];this.endRetracements=[];c.apply(this,arguments)}var f=a.Annotation,d=f.MockPoint,c=f.types.tunnel,g=function(a,e){return function(){var b=
this.annotation,c=this.anchor(b.startRetracements[a]).absolutePosition,k=this.anchor(b.endRetracements[a]).absolutePosition,c=["M",Math.round(c.x),Math.round(c.y),"L",Math.round(k.x),Math.round(k.y)];e&&(k=this.anchor(b.endRetracements[a-1]).absolutePosition,b=this.anchor(b.startRetracements[a-1]).absolutePosition,c.push("L",Math.round(k.x),Math.round(k.y),"L",Math.round(b.x),Math.round(b.y)));return c}};h.levels=[0,.236,.382,.5,.618,.786,1];a.extendAnnotation(h,c,{linkPoints:function(){c.prototype.linkPoints.call(this);
this.linkRetracementsPoints()},linkRetracementsPoints:function(){var a=this.points,e=a[0].y-a[3].y,c=a[1].y-a[2].y,d=a[0].x,k=a[1].x;h.levels.forEach(function(b,m){var l=a[1].y-c*b;this.linkRetracementPoint(m,d,a[0].y-e*b,this.startRetracements);this.linkRetracementPoint(m,k,l,this.endRetracements)},this)},linkRetracementPoint:function(a,e,c,g){var b=g[a],l=this.options.typeOptions;b?(b.options.x=e,b.options.y=c,b.refresh()):g[a]=new d(this.chart,this,{x:e,y:c,xAxis:l.xAxis,yAxis:l.yAxis})},addShapes:function(){h.levels.forEach(function(a,
e){this.initShape({type:"path",d:g(e)},!1);0<e&&this.initShape({type:"path",fill:this.options.typeOptions.backgroundColors[e-1],strokeWidth:0,d:g(e,!0)})},this)},addLabels:function(){h.levels.forEach(function(b,e){var c=this.options.typeOptions;b=this.initLabel(a.merge(c.labels[e],{point:function(a){return d.pointToOptions(a.annotation.startRetracements[e])},text:b.toString()}));c.labels[e]=b.options},this)}},{typeOptions:{height:2,backgroundColors:"rgba(130, 170, 255, 0.4);rgba(139, 191, 216, 0.4);rgba(150, 216, 192, 0.4);rgba(156, 229, 161, 0.4);rgba(162, 241, 130, 0.4);rgba(169, 255, 101, 0.4)".split(";"),
lineColor:"grey",lineColors:[],labels:[]},labelOptions:{allowOverlap:!0,align:"right",backgroundColor:"none",borderWidth:0,crop:!1,overflow:"none",shape:"rect",style:{color:"grey"},verticalAlign:"middle",y:0}});return f.types.fibonacci=h})(r);(function(a){function h(){c.apply(this,arguments)}var f=a.Annotation,d=f.MockPoint,c=f.types.infinityLine;h.findEdgePoint=function(a,e,c){e=Math.atan2(c.plotY-e.plotY,c.plotX-e.plotX);return{x:a.plotX+1E7*Math.cos(e),y:a.plotY+1E7*Math.sin(e)}};h.middleLineEdgePoint=
function(a){var b=a.annotation;return c.findEdgePoint(b.points[0],new d(b.chart,a,b.midPointOptions()))};var g=function(a){return function(b){var e=b.annotation,c=e.points;return h.findEdgePoint(c[a],c[0],new d(e.chart,b,e.midPointOptions()))}};h.topLineEdgePoint=g(1);h.bottomLineEdgePoint=g(0);a.extendAnnotation(h,c,{midPointOptions:function(){var a=this.points;return{x:(a[1].x+a[2].x)/2,y:(a[1].y+a[2].y)/2,xAxis:a[0].series.xAxis,yAxis:a[0].series.yAxis}},addShapes:function(){this.addLines();this.addBackgrounds()},
addLines:function(){this.initShape({type:"path",points:[this.points[0],h.middleLineEdgePoint]},!1);this.initShape({type:"path",points:[this.points[1],h.topLineEdgePoint]},!1);this.initShape({type:"path",points:[this.points[2],h.bottomLineEdgePoint]},!1)},addBackgrounds:function(){var b=this.shapes,e=this.options.typeOptions,c=this.initShape(a.merge(e.innerBackground,{type:"path",points:[function(a){var b=a.annotation;a=b.points;b=b.midPointOptions();return{x:(a[1].x+b.x)/2,y:(a[1].y+b.y)/2,xAxis:b.xAxis,
yAxis:b.yAxis}},b[1].points[1],b[2].points[1],function(a){var b=a.annotation;a=b.points;b=b.midPointOptions();return{x:(b.x+a[2].x)/2,y:(b.y+a[2].y)/2,xAxis:b.xAxis,yAxis:b.yAxis}}]})),b=this.initShape(a.merge(e.outerBackground,{type:"path",points:[this.points[1],b[1].points[1],b[2].points[1],this.points[2]]}));e.innerBackground=c.options;e.outerBackground=b.options}},{typeOptions:{innerBackground:{fill:"rgba(130, 170, 255, 0.4)",strokeWidth:0},outerBackground:{fill:"rgba(156, 229, 161, 0.4)",strokeWidth:0}}});
return f.types.pitchfork=h})(r);(function(a){function h(){a.Annotation.apply(this,arguments)}var f=a.Annotation,d=f.MockPoint;h.connectorFirstPoint=function(a){a=a.annotation;var c=a.points[0],b=d.pointToPixels(c,!0),e=b.y,f=a.options.typeOptions.label.offset;a.chart.inverted&&(e=b.x);return{x:c.x,xAxis:c.series.xAxis,y:e+f}};h.connectorSecondPoint=function(a){var c=a.annotation;a=c.options.typeOptions;var b=c.points[0],e=a.yOffset,c=d.pointToPixels(b,!0)[c.chart.inverted?"x":"y"];0>a.label.offset&&
(e*=-1);return{x:b.x,xAxis:b.series.xAxis,y:c+e}};a.extendAnnotation(h,null,{getPointsOptions:function(){return[this.options.typeOptions.point]},addShapes:function(){var c=this.options.typeOptions,d=this.initShape(a.merge(c.connector,{type:"path",points:[h.connectorFirstPoint,h.connectorSecondPoint]}),!1);c.connector=d.options},addLabels:function(){var c=this.options.typeOptions,d=c.label,b=0,e=d.offset,f=0>d.offset?"bottom":"top",h="center";this.chart.inverted&&(b=d.offset,e=0,f="middle",h=0>d.offset?
"right":"left");d=this.initLabel(a.merge(d,{verticalAlign:f,align:h,x:b,y:e}));c.label=d.options}},{typeOptions:{yOffset:10,label:{offset:-40,point:function(a){return a.annotation.points[0]},allowOverlap:!0,backgroundColor:"none",borderWidth:0,crop:!0,overflow:"none",shape:"rect",text:"{y:.2f}"},connector:{strokeWidth:1,markerEnd:"arrow"}}});return f.types.verticalLine=h})(r);(function(a){function h(){f.apply(this,arguments)}var f=a.Annotation,d=f.ControlPoint,c=a.merge,g=a.isNumber;f.types.measure=
h;a.extendAnnotation(h,null,{init:function(){f.prototype.init.apply(this,arguments);this.resizeY=this.resizeX=this.offsetY=this.offsetX=0;this.calculations.init.call(this);this.addValues();this.addShapes()},setClipAxes:function(){this.clipXAxis=this.chart.xAxis[this.options.typeOptions.xAxis];this.clipYAxis=this.chart.yAxis[this.options.typeOptions.yAxis]},pointsOptions:function(){return this.options.options.points},shapePointsOptions:function(){var a=this.options.typeOptions,e=a.xAxis,a=a.yAxis;
return[{x:this.xAxisMin,y:this.yAxisMin,xAxis:e,yAxis:a},{x:this.xAxisMax,y:this.yAxisMin,xAxis:e,yAxis:a},{x:this.xAxisMax,y:this.yAxisMax,xAxis:e,yAxis:a},{x:this.xAxisMin,y:this.yAxisMax,xAxis:e,yAxis:a}]},addControlPoints:function(){var a=this.options.typeOptions.selectType,e;e=new d(this.chart,this,this.options.controlPointOptions,0);this.controlPoints.push(e);"xy"!==a&&(e=new d(this.chart,this,this.options.controlPointOptions,1),this.controlPoints.push(e))},addValues:function(b){var e=this.options.typeOptions,
c=e.label.formatter,d=this.options.typeOptions,k=this.chart,l=k.options.chart.inverted,m=k.xAxis[d.xAxis],n=k.yAxis[d.yAxis];this.calculations.recalculate.call(this,b);e.label.enabled&&(0<this.labels.length?this.labels[0].text=c&&c.call(this)||this.calculations.defaultFormatter.call(this):this.initLabel(a.extend({shape:"rect",backgroundColor:"none",color:"black",borderWidth:0,dashStyle:"dash",overflow:"none",align:"left",vertical:"top",crop:!0,point:function(a){a=a.annotation;var b=k.plotTop,c=k.plotLeft;
return{x:(l?b:10)+m.toPixels(a.xAxisMin,!l),y:(l?-c+10:b)+n.toPixels(a.yAxisMin)}},text:c&&c.call(this)||this.calculations.defaultFormatter.call(this)},e.label)))},addShapes:function(){this.addCrosshairs();this.addBackground()},addBackground:function(){void 0!==this.shapePointsOptions()[0].x&&this.initShape(a.extend({type:"path",points:this.shapePointsOptions()},this.options.typeOptions.background),!1)},addCrosshairs:function(){var b=this.chart,e=this.options.typeOptions,d=this.options.typeOptions.point,
f=b.xAxis[e.xAxis],k=b.yAxis[e.yAxis],l=b.options.chart.inverted,m=f.toPixels(this.xAxisMin),n=f.toPixels(this.xAxisMax),p=k.toPixels(this.yAxisMin),g=k.toPixels(this.yAxisMax),h={point:d,type:"path"},d=[],b=[];l&&(m=k.toPixels(this.yAxisMin),n=k.toPixels(this.yAxisMax),p=f.toPixels(this.xAxisMin),g=f.toPixels(this.xAxisMax));e.crosshairX.enabled&&(d=["M",m,p+(g-p)/2,"L",n,p+(g-p)/2]);e.crosshairY.enabled&&(b=["M",m+(n-m)/2,p,"L",m+(n-m)/2,g]);0<this.shapes.length?(this.shapes[0].options.d=d,this.shapes[1].options.d=
b):(f=c(h,e.crosshairX),e=c(h,e.crosshairY),this.initShape(a.extend({d:d},f),!1),this.initShape(a.extend({d:b},e),!1))},onDrag:function(a){var b=this.mouseMoveToTranslation(a),c=this.options.typeOptions.selectType;a="y"===c?0:b.x;b="x"===c?0:b.y;this.translate(a,b);this.offsetX+=a;this.offsetY+=b;this.redraw(!1,!1,!0)},resize:function(a,c,d,f){var b=this.shapes[2];"x"===f?0===d?(b.translatePoint(a,0,0),b.translatePoint(a,c,3)):(b.translatePoint(a,0,1),b.translatePoint(a,c,2)):"y"===f?0===d?(b.translatePoint(0,
c,0),b.translatePoint(0,c,1)):(b.translatePoint(0,c,2),b.translatePoint(0,c,3)):(b.translatePoint(a,0,1),b.translatePoint(a,c,2),b.translatePoint(0,c,3));this.calculations.updateStartPoints.call(this,!1,!0,d,a,c)},redraw:function(a,c,d){this.linkPoints();this.graphic||this.render();d&&this.calculations.updateStartPoints.call(this,!0,!1);this.addValues(c);this.addCrosshairs();this.redrawItems(this.shapes,a);this.redrawItems(this.labels,a);this.controlPoints.forEach(function(a){a.redraw()})},translate:function(a,
c){this.shapes.forEach(function(b){b.translate(a,c)})},calculations:{init:function(){var a=this.options.typeOptions,c=this.chart,d=this.calculations.getPointPos,f=c.options.chart.inverted,k=c.xAxis[a.xAxis],l=c.yAxis[a.yAxis],m=a.background,n=f?m.height:m.width,f=f?m.width:m.height,m=a.selectType,p=c.plotTop,h=c.plotLeft;this.startXMin=a.point.x;this.startYMin=a.point.y;g(n)?this.startXMax=this.startXMin+n:this.startXMax=d(k,this.startXMin,parseFloat(n));g(f)?this.startYMax=this.startYMin-f:this.startYMax=
d(l,this.startYMin,parseFloat(f));"x"===m?(this.startYMin=l.toValue(p),this.startYMax=l.toValue(p+c.plotHeight)):"y"===m&&(this.startXMin=k.toValue(h),this.startXMax=k.toValue(h+c.plotWidth))},recalculate:function(a){var b=this.calculations,c=this.options.typeOptions,d=this.chart.xAxis[c.xAxis],c=this.chart.yAxis[c.yAxis],k=this.calculations.getPointPos,l=this.offsetX,m=this.offsetY;this.xAxisMin=k(d,this.startXMin,l);this.xAxisMax=k(d,this.startXMax,l);this.yAxisMin=k(c,this.startYMin,m);this.yAxisMax=
k(c,this.startYMax,m);this.min=b.min.call(this);this.max=b.max.call(this);this.average=b.average.call(this);this.bins=b.bins.call(this);a&&this.resize.call(this,0,0)},getPointPos:function(a,c,d){return a.toValue(a.toPixels(c)+d)},updateStartPoints:function(a,c,d,f,k){var b=this.options.typeOptions,e=b.selectType,n=this.chart.xAxis[b.xAxis],b=this.chart.yAxis[b.yAxis],p=this.calculations.getPointPos,g=this.startXMin,h=this.startXMax,q=this.startYMin,w=this.startYMax,r=this.offsetX,t=this.offsetY;c&&
("x"===e?0===d?this.startXMin=p(n,g,f):this.startXMax=p(n,h,f):"y"===e?0===d?this.startYMin=p(b,q,k):this.startYMax=p(b,w,k):(this.startXMax=p(n,h,f),this.startYMax=p(b,w,k)));a&&(this.startXMin=p(n,g,r),this.startXMax=p(n,h,r),this.startYMin=p(b,q,t),this.startYMax=p(b,w,t),this.offsetY=this.offsetX=0)},defaultFormatter:function(){return"Min: "+this.min+"\x3cbr\x3eMax: "+this.max+"\x3cbr\x3eAverage: "+this.average+"\x3cbr\x3eBins: "+this.bins},getExtremes:function(a,c,d,f){return{xAxisMin:Math.min(c,
a),xAxisMax:Math.max(c,a),yAxisMin:Math.min(f,d),yAxisMax:Math.max(f,d)}},min:function(){var a=Infinity,c=this.chart.series,d=this.calculations.getExtremes(this.xAxisMin,this.xAxisMax,this.yAxisMin,this.yAxisMax),f=!1;c.forEach(function(b){b.visible&&"highcharts-navigator-series"!==b.options.id&&b.points.forEach(function(b){!b.isNull&&b.y<a&&b.x>d.xAxisMin&&b.x<=d.xAxisMax&&b.y>d.yAxisMin&&b.y<=d.yAxisMax&&(a=b.y,f=!0)})});f||(a="");return a},max:function(){var a=-Infinity,c=this.chart.series,d=this.calculations.getExtremes(this.xAxisMin,
this.xAxisMax,this.yAxisMin,this.yAxisMax),f=!1;c.forEach(function(b){b.visible&&"highcharts-navigator-series"!==b.options.id&&b.points.forEach(function(b){!b.isNull&&b.y>a&&b.x>d.xAxisMin&&b.x<=d.xAxisMax&&b.y>d.yAxisMin&&b.y<=d.yAxisMax&&(a=b.y,f=!0)})});f||(a="");return a},average:function(){var a="";""!==this.max&&""!==this.min&&(a=(this.max+this.min)/2);return a},bins:function(){var a=0,c=this.chart.series,d=this.calculations.getExtremes(this.xAxisMin,this.xAxisMax,this.yAxisMin,this.yAxisMax),
f=!1;c.forEach(function(b){b.visible&&"highcharts-navigator-series"!==b.options.id&&b.points.forEach(function(b){!b.isNull&&b.x>d.xAxisMin&&b.x<=d.xAxisMax&&b.y>d.yAxisMin&&b.y<=d.yAxisMax&&(a++,f=!0)})});f||(a="");return a}}},{typeOptions:{selectType:"xy",xAxis:0,yAxis:0,background:{fill:"rgba(130, 170, 255, 0.4)",strokeWidth:0,stroke:void 0},crosshairX:{enabled:!0,zIndex:6,dashStyle:"dash",markerEnd:"arrow"},crosshairY:{enabled:!0,zIndex:6,dashStyle:"Dash",markerEnd:"arrow"},label:{enabled:!0,style:{fontSize:"11px",
color:"#666666"},formatter:void 0}},controlPointOptions:{positioner:function(a){var b=this.index,c=a.chart,d=a.options,k=d.typeOptions,l=k.selectType,d=d.controlPointOptions,f=c.options.chart.inverted,n=c.xAxis[k.xAxis],c=c.yAxis[k.yAxis],k=a.xAxisMax,p=a.yAxisMax,g=a.calculations.getExtremes(a.xAxisMin,a.xAxisMax,a.yAxisMin,a.yAxisMax);"x"===l&&(p=(g.yAxisMax-g.yAxisMin)/2,0===b&&(k=a.xAxisMin));"y"===l&&(k=g.xAxisMin+(g.xAxisMax-g.xAxisMin)/2,0===b&&(p=a.yAxisMin));f?(a=c.toPixels(p),b=n.toPixels(k)):
(a=n.toPixels(k),b=c.toPixels(p));return{x:a-d.width/2,y:b-d.height/2}},events:{drag:function(a,c){var b=this.mouseMoveToTranslation(a);a=c.options.typeOptions.selectType;var d="y"===a?0:b.x,b="x"===a?0:b.y;c.resize(d,b,this.index,a);c.resizeX+=d;c.resizeY+=b;c.redraw(!1,!0)}}}});return f.types.measure=h})(r);(function(a){function h(b){var c=b.prototype.defaultOptions.events&&b.prototype.defaultOptions.events.click;a.merge(!0,b.prototype.defaultOptions.events,{click:function(a){var b=this,d=b.chart.navigationBindings,
l=d.activeAnnotation;c&&c.click.call(b,a);l!==b?(d.deselectAnnotation(),d.activeAnnotation=b,b.setControlPointsVisibility(!0),e(d,"showPopup",{annotation:b,formType:"annotation-toolbar",options:d.annotationToFields(b),onSubmit:function(a){var c={};"remove"===a.actionType?(d.activeAnnotation=!1,d.chart.removeAnnotation(b)):(d.fieldsToOptions(a.fields,c),d.deselectAnnotation(),a=c.typeOptions,"measure"===b.options.type&&(a.crosshairY.enabled=0!==a.crosshairY.strokeWidth,a.crosshairX.enabled=0!==a.crosshairX.strokeWidth),
b.update(c))}})):(d.deselectAnnotation(),e(d,"closePopup"));a.activeAnnotation=!0}})}var f=a.doc,d=a.addEvent,c=a.pick,g=a.extend,b=a.isNumber,e=a.fireEvent,q=a.isArray,r=a.isObject,k=a.objectEach;a.NavigationBindings=function(a,b){this.chart=a;this.options=b;this.eventsToUnbind=[];this.container=f.getElementsByClassName(this.options.bindingsClassName)};a.NavigationBindings.annotationsEditable={nestedOptions:{labelOptions:["style","format","backgroundColor"],labels:["style"],label:["style"],style:["fontSize",
"color"],background:["fill","strokeWidth","stroke"],innerBackground:["fill","strokeWidth","stroke"],outerBackground:["fill","strokeWidth","stroke"],shapeOptions:["fill","strokeWidth","stroke"],shapes:["fill","strokeWidth","stroke"],line:["strokeWidth","stroke"],backgroundColors:[!0],connector:["fill","strokeWidth","stroke"],crosshairX:["strokeWidth","stroke"],crosshairY:["strokeWidth","stroke"]},circle:["shapes"],verticalLine:[],label:["labelOptions"],measure:["background","crosshairY","crosshairX"],
fibonacci:[],tunnel:["background","line","height"],pitchfork:["innerBackground","outerBackground"],rect:["shapes"],crookedLine:[]};a.NavigationBindings.annotationsNonEditable={rectangle:["crosshairX","crosshairY","label"]};g(a.NavigationBindings.prototype,{initEvents:function(){var a=this,b=a.chart,c=a.container,e=a.options;a.boundClassNames={};k(e.bindings,function(b){a.boundClassNames[b.className]=b});[].forEach.call(c,function(b){a.eventsToUnbind.push(d(b,"click",function(b){var d=a.getButtonEvents(c,
b);d&&a.bindingsButtonClick(d.button,d.events,b)}))});k(e.events||{},function(b,c){a.eventsToUnbind.push(d(a,c,b))});a.eventsToUnbind.push(d(b.container,"click",function(c){!b.cancelClick&&b.isInsidePlot(c.chartX-b.plotLeft,c.chartY-b.plotTop)&&a.bindingsChartClick(this,c)}));a.eventsToUnbind.push(d(b.container,"mousemove",function(b){a.bindingsContainerMouseMove(this,b)}))},bindingsButtonClick:function(a,b,c){var d=this.chart;this.selectedButtonElement&&(e(this,"deselectButton",{button:this.selectedButtonElement}),
this.nextEvent&&(this.currentUserDetails&&"annotations"===this.currentUserDetails.coll&&d.removeAnnotation(this.currentUserDetails),this.mouseMoveEvent=this.nextEvent=!1));this.selectedButton=b;this.selectedButtonElement=a;e(this,"selectButton",{button:a});b.init&&b.init.call(this,a,c);(b.start||b.steps)&&d.renderer.boxWrapper.addClass("highcharts-draw-mode")},bindingsChartClick:function(a,b){a=this.selectedButton;var c=this.chart.renderer.boxWrapper;this.activeAnnotation&&!b.activeAnnotation&&b.target.parentNode&&
!b.target.closest(".highcharts-popup")&&(e(this,"closePopup"),this.deselectAnnotation());a&&a.start&&(this.nextEvent?(this.nextEvent.call(this,b,this.currentUserDetails),this.steps&&(this.stepIndex++,a.steps[this.stepIndex]?this.mouseMoveEvent=this.nextEvent=a.steps[this.stepIndex]:(e(this,"deselectButton",{button:this.selectedButtonElement}),c.removeClass("highcharts-draw-mode"),a.end&&a.end.call(this,b,this.currentUserDetails),this.mouseMoveEvent=this.nextEvent=!1,this.selectedButton=null))):(this.currentUserDetails=
a.start.call(this,b),a.steps?(this.stepIndex=0,this.steps=!0,this.mouseMoveEvent=this.nextEvent=a.steps[this.stepIndex]):(e(this,"deselectButton",{button:this.selectedButtonElement}),c.removeClass("highcharts-draw-mode"),this.steps=!1,this.selectedButton=null,a.end&&a.end.call(this,b,this.currentUserDetails))))},bindingsContainerMouseMove:function(a,b){this.mouseMoveEvent&&this.mouseMoveEvent.call(this,b,this.currentUserDetails)},fieldsToOptions:function(a,d){k(a,function(a,e){var l=parseFloat(a),
k=e.split("."),f=d,n=k.length-1;!b(l)||a.match(/px/g)||e.match(/format/g)||(a=l);""!==a&&"undefined"!==a&&k.forEach(function(b,d){var e=c(k[d+1],"");n===d?f[b]=a:(f[b]||(f[b]=e.match(/\d/g)?[]:{}),f=f[b])})});return d},deselectAnnotation:function(){this.activeAnnotation&&(this.activeAnnotation.setControlPointsVisibility(!1),this.activeAnnotation=!1)},annotationToFields:function(b){function d(c,e,l,n){var h;l&&-1===I.indexOf(e)&&(0<=(l.indexOf&&l.indexOf(e))||l[e]||!0===l)&&(q(c)?(n[e]=[],c.forEach(function(a,
b){r(a)?(n[e][b]={},k(a,function(a,c){d(a,c,f[e],n[e][b])})):d(a,0,f[e],n[e])})):r(c)?(h={},q(n)?(n.push(h),h[e]={},h=h[e]):n[e]=h,k(c,function(a,b){d(a,b,0===e?l:f[e],h)})):"format"===e?n[e]=[a.format(c,b.labels[0].points[0]).toString(),"text"]:q(n)?n.push([c,g(c)]):n[e]=[c,g(c)])}var e=b.options,l=a.NavigationBindings.annotationsEditable,f=l.nestedOptions,g=this.utils.getFieldType,h=c(e.type,e.shapes&&e.shapes[0]&&e.shapes[0].type,e.labels&&e.labels[0]&&e.labels[0].itemType,"label"),I=a.NavigationBindings.annotationsNonEditable[e.langKey]||
[],v={langKey:e.langKey,type:h};k(e,function(a,b){"typeOptions"===b?(v[b]={},k(e[b],function(a,c){d(a,c,f,v[b],!0)})):d(a,b,l[h],v)});return v},getClickedClassNames:function(b,c){var d=c.target;c=[];for(var e;d&&((e=a.attr(d,"class"))&&(c=c.concat(e.split(" ").map(function(a){return[a,d]}))),d=d.parentNode,d!==b););return c},getButtonEvents:function(a,b){var c=this,d;this.getClickedClassNames(a,b).forEach(function(a){c.boundClassNames[a[0]]&&!d&&(d={events:c.boundClassNames[a[0]],button:a[1]})});
return d},update:function(){this.removeEvents();this.initEvents()},removeEvents:function(){this.eventsToUnbind.forEach(function(a){a()})},destroy:function(){this.removeEvents()},utils:{updateRectSize:function(a,b){var c=b.options.typeOptions,d=this.chart.xAxis[0].toPixels(c.point.x),c=this.chart.yAxis[0].toPixels(c.point.y);b.update({typeOptions:{background:{width:a.chartX-d+"px",height:a.chartY-c+"px"}}})},getFieldType:function(a){return{string:"text",number:"number","boolean":"checkbox"}[typeof a]}}});
d(a.Chart,"load",function(){var b=this.options;b&&b.navigation&&b.navigation.bindings&&(this.navigationBindings=new a.NavigationBindings(this,b.navigation),this.navigationBindings.initEvents())});d(a.Chart,"destroy",function(){this.navigationBindings&&this.navigationBindings.destroy()});d(a.NavigationBindings,"deselectButton",function(){this.selectedButtonElement=null});a.Annotation&&(h(a.Annotation),a.objectEach(a.Annotation.types,function(a){h(a)}));a.setOptions({lang:{navigation:{popup:{simpleShapes:"Simple shapes",
lines:"Lines",circle:"Circle",rectangle:"Rectangle",label:"Label",shapeOptions:"Shape options",typeOptions:"Details",fill:"Fill",format:"Text",strokeWidth:"Line width",stroke:"Line color",title:"Title",name:"Name",labelOptions:"Label options",labels:"Labels",backgroundColor:"Background color",backgroundColors:"Background colors",borderColor:"Border color",borderRadius:"Border radius",borderWidth:"Border width",style:"Style",padding:"Padding",fontSize:"Font size",color:"Color",height:"Height",shapes:"Shape options"}}},
navigation:{bindingsClassName:"highcharts-bindings-wrapper",bindings:{circleAnnotation:{className:"highcharts-circle-annotation",start:function(b){var c=this.chart.xAxis[0].toValue(b.chartX);b=this.chart.yAxis[0].toValue(b.chartY);return this.chart.addAnnotation({langKey:"circle",shapes:[{type:"circle",point:{xAxis:0,yAxis:0,x:c,y:b},r:5,controlPoints:[{positioner:function(b){var c=a.Annotation.MockPoint.pointToPixels(b.points[0]);b=b.options.r;return{x:c.x+b*Math.cos(Math.PI/4)-this.graphic.width/
2,y:c.y+b*Math.sin(Math.PI/4)-this.graphic.height/2}},events:{drag:function(a,b){a=this.mouseMoveToTranslation(a);b.setRadius(Math.max(b.options.r+a.y/Math.sin(Math.PI/4),5));b.redraw(!1)}}}]}]})},steps:[function(a,b){var c=b.options.shapes[0].point,d=this.chart.xAxis[0].toPixels(c.x),c=this.chart.yAxis[0].toPixels(c.y);b.update({shapes:[{r:Math.max(Math.sqrt(Math.pow(d-a.chartX,2)+Math.pow(c-a.chartY,2)),5)}]})}]},rectangleAnnotation:{className:"highcharts-rectangle-annotation",start:function(b){var c=
this.chart.xAxis[0].toValue(b.chartX);b=this.chart.yAxis[0].toValue(b.chartY);return this.chart.addAnnotation({langKey:"rectangle",shapes:[{type:"rect",point:{x:c,y:b,xAxis:0,yAxis:0},width:5,height:5,controlPoints:[{positioner:function(b){var c=a.Annotation.MockPoint.pointToPixels(b.points[0]);return{x:c.x+b.options.width-4,y:c.y+b.options.height-4}},events:{drag:function(a,b){a=this.mouseMoveToTranslation(a);b.options.width=Math.max(b.options.width+a.x,5);b.options.height=Math.max(b.options.height+
a.y,5);b.redraw(!1)}}}]}]})},steps:[function(a,b){var c=this.chart.yAxis[0],d=b.options.shapes[0].point,e=this.chart.xAxis[0].toPixels(d.x),c=c.toPixels(d.y);b.update({shapes:[{width:Math.max(a.chartX-e,5),height:Math.max(a.chartY-c,5),point:{x:d.x,y:d.y}}]})}]},labelAnnotation:{className:"highcharts-label-annotation",start:function(b){var c=this.chart.xAxis[0].toValue(b.chartX);b=this.chart.yAxis[0].toValue(b.chartY);this.chart.addAnnotation({langKey:"label",labelOptions:{format:"{y:.2f}"},labels:[{point:{x:c,
y:b,xAxis:0,yAxis:0},controlPoints:[{symbol:"triangle-down",positioner:function(b){if(!b.graphic.placed)return{x:0,y:-9E7};b=a.Annotation.MockPoint.pointToPixels(b.points[0]);return{x:b.x-this.graphic.width/2,y:b.y-this.graphic.height/2}},events:{drag:function(a,b){a=this.mouseMoveToTranslation(a);b.translatePoint(a.x,a.y);b.redraw(!1)}}},{symbol:"square",positioner:function(a){return a.graphic.placed?{x:a.graphic.alignAttr.x-this.graphic.width/2,y:a.graphic.alignAttr.y-this.graphic.height/2}:{x:0,
y:-9E7}},events:{drag:function(a,b){a=this.mouseMoveToTranslation(a);b.translate(a.x,a.y);b.redraw(!1)}}}],overflow:"none",crop:!0}]})}}},events:{}}})})(r);(function(a){var h=a.addEvent,f=a.createElement,d=a.objectEach,c=a.pick,g=a.wrap,b=a.isString,e=a.isObject,q=a.isArray,r=/\d/g;g(a.Pointer.prototype,"onContainerMouseDown",function(a,c){var d=c.target&&c.target.className;b(d)&&0<=d.indexOf("highcharts-popup-field")||a.apply(this,Array.prototype.slice.call(arguments,1))});a.Popup=function(a){this.init(a)};
a.Popup.prototype={init:function(a){this.container=f("div",{className:"highcharts-popup"},null,a);this.lang=this.getLangpack();this.addCloseBtn.call(this)},addCloseBtn:function(){var a=this,b;b=f("div",{className:"highcharts-popup-close"},null,this.container);h(b,"click",function(){a.closePopup.call(a)})},addColsContainer:function(a){var b;b=f("div",{className:"highcharts-popup-lhs-col"},null,a);a=f("div",{className:"highcharts-popup-rhs-col"},null,a);f("div",{className:"highcharts-popup-rhs-col-wrapper"},
null,a);return{lhsCol:b,rhsCol:a}},addInput:function(a,b,c,d){var e=a.split("."),e=e[e.length-1],k=this.lang;b="highcharts-"+b+"-"+e;b.match(r)||f("label",{innerHTML:k[e]||e,htmlFor:b},null,c);f("input",{name:b,value:d[0],type:d[1],className:"highcharts-popup-field"},null,c).setAttribute("highcharts-data-name",a)},addButton:function(a,b,c,d,e){var k=this,l=this.closePopup,g=this.getFields;a=f("button",{innerHTML:b},null,a);h(a,"click",function(){l.call(k);return d(g(e,c))});return a},getFields:function(a,
b){var c=a.querySelectorAll("input"),d=a.querySelectorAll("#highcharts-select-series \x3e option:checked")[0];a=a.querySelectorAll("#highcharts-select-volume \x3e option:checked")[0];var e,f,k;k={actionType:b,linkedTo:d&&d.getAttribute("value"),fields:{}};c.forEach(function(a){f=a.getAttribute("highcharts-data-name");(e=a.getAttribute("highcharts-data-series-id"))?k.seriesId=a.value:f?k.fields[f]=a.value:k.type=a.value});a&&(k.fields["params.volumeSeriesID"]=a.getAttribute("value"));return k},showPopup:function(){var a=
this.container,b=a.querySelectorAll(".highcharts-popup-close")[0];a.innerHTML="";0<=a.className.indexOf("highcharts-annotation-toolbar")&&(a.classList.remove("highcharts-annotation-toolbar"),a.removeAttribute("style"));a.appendChild(b);a.style.display="block"},closePopup:function(){this.popup.container.style.display="none"},showForm:function(a,b,c,d){this.popup=b.navigationBindings.popup;this.showPopup();"indicators"===a&&this.indicators.addForm.call(this,b,c,d);"annotation-toolbar"===a&&this.annotations.addToolbar.call(this,
b,c,d);"annotation-edit"===a&&this.annotations.addForm.call(this,b,c,d);"flag"===a&&this.annotations.addForm.call(this,b,c,d,!0)},getLangpack:function(){return a.getOptions().lang.navigation.popup},annotations:{addToolbar:function(a,b,d){var e=this,k=this.lang,l=this.popup.container,g=this.showForm,h;-1===l.className.indexOf("highcharts-annotation-toolbar")&&(l.className+=" highcharts-annotation-toolbar");l.style.top=a.plotTop+10+"px";f("span",{innerHTML:c(k[b.langKey]||b.langKey,b.shapes&&b.shapes[0].type)},
null,l);h=this.addButton.call(this,l,k.removeButton||"remove","remove",d,l);h.className+=" highcharts-annotation-remove-button";h=this.addButton.call(this,l,k.editButton||"edit","edit",function(){g.call(e,"annotation-edit",a,b,d)},l);h.className+=" highcharts-annotation-edit-button"},addForm:function(a,b,c,d){var e=this.popup.container,k=this.lang,l,g;f("h2",{innerHTML:k[b.langKey]||b.langKey,className:"highcharts-popup-main-title"},null,e);g=f("div",{className:"highcharts-popup-lhs-col highcharts-popup-lhs-full"},
null,e);l=f("div",{className:"highcharts-popup-bottom-row"},null,e);this.annotations.addFormFields.call(this,g,a,"",b,[],!0);this.addButton.call(this,l,d?k.addButton||"add":k.saveButton||"save",d?"add":"save",c,e)},addFormFields:function(a,b,c,g,h,z){var k=this,l=this.annotations.addFormFields,m=this.addInput,n=this.lang,p,u;d(g,function(d,f){p=""!==c?c+"."+f:f;e(d)&&(!q(d)||q(d)&&e(d[0])?(u=n[f]||f,u.match(r)||h.push([!0,u,a]),l.call(k,a,b,p,d,h,!1)):h.push([k,p,"annotation",a,d]))});z&&(h=h.sort(function(a){return a[1].match(/format/g)?
-1:1}),h.forEach(function(a){!0===a[0]?f("span",{className:"highcharts-annotation-title",innerHTML:a[1]},null,a[2]):m.apply(a[0],a.splice(1))}))}},indicators:{addForm:function(a,b,c){var d=this.indicators,e=this.lang,f;this.tabs.init.call(this,a);b=this.popup.container.querySelectorAll(".highcharts-tab-item-content");this.addColsContainer(b[0]);d.addIndicatorList.call(this,a,b[0],"add");f=b[0].querySelectorAll(".highcharts-popup-rhs-col")[0];this.addButton.call(this,f,e.addButton||"add","add",c,f);
this.addColsContainer(b[1]);d.addIndicatorList.call(this,a,b[1],"edit");f=b[1].querySelectorAll(".highcharts-popup-rhs-col")[0];this.addButton.call(this,f,e.saveButton||"save","edit",c,f);this.addButton.call(this,f,e.removeButton||"remove","remove",c,f)},addIndicatorList:function(b,c,e){var k=this,g=c.querySelectorAll(".highcharts-popup-lhs-col")[0];c=c.querySelectorAll(".highcharts-popup-rhs-col")[0];var l=a.getOptions(),m="edit"===e,q=m?b.series:l.plotOptions,r=this.indicators.addFormFields,v,t,
u;t=f("ul",{className:"highcharts-indicator-list"},null,g);v=c.querySelectorAll(".highcharts-popup-rhs-col-wrapper")[0];d(q,function(a,c){var d=a.options;if(a.params||d&&d.params){var e=k.indicators.getNameType(a,c);u=f("li",{className:"highcharts-indicator-list",innerHTML:e.name},null,t);h(u,"click",function(){r.call(k,b,m?a:q[e.type],e.type,v);m&&a.options&&f("input",{type:"hidden",name:"highcharts-id-"+e.type,value:a.options.id},null,v).setAttribute("highcharts-data-series-id",a.options.id)})}});
0<t.childNodes.length&&t.childNodes[0].click()},getNameType:function(b,c){var d=b.options,e=a.seriesTypes,e=e[c]&&e[c].prototype.nameBase||c.toUpperCase();d&&d.type&&(c=b.options.type,e=b.name);return{name:e,type:c}},listAllSeries:function(a,b,c,d){a="highcharts-"+b+"-type-"+a;var e,k;f("label",{innerHTML:this.lang[b]||b,htmlFor:a},null,d);e=f("select",{name:a,className:"highcharts-popup-field"},null,d);e.setAttribute("id","highcharts-select-"+b);c.series.forEach(function(a){k=a.options;!k.params&&
k.id&&"highcharts-navigator-series"!==k.id&&f("option",{innerHTML:k.name||k.id,value:k.id},null,e)})},addFormFields:function(a,b,c,d){var e=b.params||b.options.params,k=this.indicators.getNameType;d.innerHTML="";f("h3",{className:"highcharts-indicator-title",innerHTML:k(b,c).name},null,d);f("input",{type:"hidden",name:"highcharts-type-"+c,value:c},null,d);this.indicators.listAllSeries.call(this,c,"series",a,d);e.volumeSeriesID&&this.indicators.listAllSeries.call(this,c,"volume",a,d);this.indicators.addParamInputs.call(this,
a,"params",e,c,d)},addParamInputs:function(a,b,c,f,g){var k=this,h=this.indicators.addParamInputs,l=this.addInput,m;d(c,function(c,d){m=b+"."+d;e(c)?h.call(k,a,m,c,f,g):"params.volumeSeriesID"!==m&&l.call(k,m,f,g,[c,"text"])})},getAmount:function(){var a=0;d(this.series,function(b){var c=b.options;(b.params||c&&c.params)&&a++});return a}},tabs:{init:function(a){var b=this.tabs;a=this.indicators.getAmount.call(a);var c;c=b.addMenuItem.call(this,"add");b.addMenuItem.call(this,"edit",a);b.addContentItem.call(this,
"add");b.addContentItem.call(this,"edit");b.switchTabs.call(this,a);b.selectTab.call(this,c,0)},addMenuItem:function(a,b){var c=this.popup.container,d="highcharts-tab-item",e=this.lang;0===b&&(d+=" highcharts-tab-disabled");b=f("span",{innerHTML:e[a+"Button"]||a,className:d},null,c);b.setAttribute("highcharts-data-tab-type",a);return b},addContentItem:function(){return f("div",{className:"highcharts-tab-item-content"},null,this.popup.container)},switchTabs:function(a){var b=this,c;this.popup.container.querySelectorAll(".highcharts-tab-item").forEach(function(d,
e){c=d.getAttribute("highcharts-data-tab-type");"edit"===c&&0===a||h(d,"click",function(){b.tabs.deselectAll.call(b);b.tabs.selectTab.call(b,this,e)})})},selectTab:function(a,b){var c=this.popup.container.querySelectorAll(".highcharts-tab-item-content");a.className+=" highcharts-tab-item-active";c[b].className+=" highcharts-tab-item-show"},deselectAll:function(){var a=this.popup.container,b=a.querySelectorAll(".highcharts-tab-item"),a=a.querySelectorAll(".highcharts-tab-item-content"),c;for(c=0;c<
b.length;c++)b[c].classList.remove("highcharts-tab-item-active"),a[c].classList.remove("highcharts-tab-item-show")}}};h(a.NavigationBindings,"showPopup",function(b){this.popup||(this.popup=new a.Popup(this.chart.container));this.popup.showForm(b.formType,this.chart,b.options,b.onSubmit)});h(a.NavigationBindings,"closePopup",function(){this.popup&&this.popup.closePopup()})})(r)});
//# sourceMappingURL=annotations-advanced.js.map
