/*
 Highstock JS v8.2.0 (2020-08-20)

 Advanced Highstock tools

 (c) 2010-2019 Highsoft AS
 Author: Torstein Honsi

 License: www.highcharts.com/license
*/
(function(a){"object"===typeof module&&module.exports?(a["default"]=a,module.exports=a):"function"===typeof define&&define.amd?define("highcharts/modules/stock-tools",["highcharts","highcharts/modules/stock"],function(w){a(w);a.Highcharts=w;return a}):a("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(a){function w(d,g,a,k){d.hasOwnProperty(g)||(d[g]=k.apply(null,a))}a=a?a._modules:{};w(a,"Extensions/Annotations/Mixins/EventEmitterMixin.js",[a["Core/Globals.js"],a["Core/Utilities.js"]],
function(d,g){var a=g.addEvent,k=g.fireEvent,z=g.objectEach,c=g.pick,r=g.removeEvent;return{addEvents:function(){var c=this,e=function(e){a(e,d.isTouchDevice?"touchstart":"mousedown",function(e){c.onMouseDown(e)})};e(this.graphic.element);(c.labels||[]).forEach(function(c){c.options.useHTML&&c.graphic.text&&e(c.graphic.text.element)});z(c.options.events,function(e,l){var h=function(b){"click"===l&&c.cancelClick||e.call(c,c.chart.pointer.normalize(b),c.target)};if(-1===(c.nonDOMEvents||[]).indexOf(l))c.graphic.on(l,
h);else a(c,l,h)});if(c.options.draggable&&(a(c,"drag",c.onDrag),!c.graphic.renderer.styledMode)){var l={cursor:{x:"ew-resize",y:"ns-resize",xy:"move"}[c.options.draggable]};c.graphic.css(l);(c.labels||[]).forEach(function(e){e.options.useHTML&&e.graphic.text&&e.graphic.text.css(l)})}c.isUpdating||k(c,"add")},removeDocEvents:function(){this.removeDrag&&(this.removeDrag=this.removeDrag());this.removeMouseUp&&(this.removeMouseUp=this.removeMouseUp())},onMouseDown:function(t){var e=this,l=e.chart.pointer;
t.preventDefault&&t.preventDefault();if(2!==t.button){t=l.normalize(t);var v=t.chartX;var m=t.chartY;e.cancelClick=!1;e.chart.hasDraggedAnnotation=!0;e.removeDrag=a(d.doc,d.isTouchDevice?"touchmove":"mousemove",function(c){e.hasDragged=!0;c=l.normalize(c);c.prevChartX=v;c.prevChartY=m;k(e,"drag",c);v=c.chartX;m=c.chartY});e.removeMouseUp=a(d.doc,d.isTouchDevice?"touchend":"mouseup",function(l){e.cancelClick=e.hasDragged;e.hasDragged=!1;e.chart.hasDraggedAnnotation=!1;k(c(e.target,e),"afterUpdate");
e.onMouseUp(l)})}},onMouseUp:function(c){var e=this.chart;c=this.target||this;var l=e.options.annotations;e=e.annotations.indexOf(c);this.removeDocEvents();l[e]=c.options},onDrag:function(c){if(this.chart.isInsidePlot(c.chartX-this.chart.plotLeft,c.chartY-this.chart.plotTop)){var e=this.mouseMoveToTranslation(c);"x"===this.options.draggable&&(e.y=0);"y"===this.options.draggable&&(e.x=0);this.points.length?this.translate(e.x,e.y):(this.shapes.forEach(function(c){c.translate(e.x,e.y)}),this.labels.forEach(function(c){c.translate(e.x,
e.y)}));this.redraw(!1)}},mouseMoveToRadians:function(c,e,l){var d=c.prevChartY-l,m=c.prevChartX-e;l=c.chartY-l;c=c.chartX-e;this.chart.inverted&&(e=m,m=d,d=e,e=c,c=l,l=e);return Math.atan2(l,c)-Math.atan2(d,m)},mouseMoveToTranslation:function(c){var e=c.chartX-c.prevChartX;c=c.chartY-c.prevChartY;if(this.chart.inverted){var l=c;c=e;e=l}return{x:e,y:c}},mouseMoveToScale:function(c,e,l){e=(c.chartX-e||1)/(c.prevChartX-e||1);c=(c.chartY-l||1)/(c.prevChartY-l||1);this.chart.inverted&&(l=c,c=e,e=l);return{x:e,
y:c}},destroy:function(){this.removeDocEvents();r(this);this.hcEvents=null}}});w(a,"Extensions/Annotations/ControlPoint.js",[a["Core/Utilities.js"],a["Extensions/Annotations/Mixins/EventEmitterMixin.js"]],function(d,a){var g=d.merge,k=d.pick;return function(){function d(c,d,g,e){this.addEvents=a.addEvents;this.graphic=void 0;this.mouseMoveToRadians=a.mouseMoveToRadians;this.mouseMoveToScale=a.mouseMoveToScale;this.mouseMoveToTranslation=a.mouseMoveToTranslation;this.onDrag=a.onDrag;this.onMouseDown=
a.onMouseDown;this.onMouseUp=a.onMouseUp;this.removeDocEvents=a.removeDocEvents;this.nonDOMEvents=["drag"];this.chart=c;this.target=d;this.options=g;this.index=k(g.index,e)}d.prototype.setVisibility=function(c){this.graphic.attr("visibility",c?"visible":"hidden");this.options.visible=c};d.prototype.render=function(){var c=this.chart,d=this.options;this.graphic=c.renderer.symbol(d.symbol,0,0,d.width,d.height).add(c.controlPointsGroup).css(d.style);this.setVisibility(d.visible);this.addEvents()};d.prototype.redraw=
function(c){this.graphic[c?"animate":"attr"](this.options.positioner.call(this,this.target))};d.prototype.destroy=function(){a.destroy.call(this);this.graphic&&(this.graphic=this.graphic.destroy());this.options=this.target=this.chart=null};d.prototype.update=function(c){var d=this.chart,a=this.target,e=this.index;c=g(!0,this.options,c);this.destroy();this.constructor(d,a,c,e);this.render(d.controlPointsGroup);this.redraw()};return d}()});w(a,"Extensions/Annotations/MockPoint.js",[a["Core/Globals.js"],
a["Core/Utilities.js"]],function(d,a){var g=a.defined,k=a.fireEvent;return function(){function a(c,a,g){this.y=this.x=this.plotY=this.plotX=this.isInside=void 0;this.mock=!0;this.series={visible:!0,chart:c,getPlotBox:d.Series.prototype.getPlotBox};this.target=a||null;this.options=g;this.applyOptions(this.getOptions())}a.fromPoint=function(c){return new a(c.series.chart,null,{x:c.x,y:c.y,xAxis:c.series.xAxis,yAxis:c.series.yAxis})};a.pointToPixels=function(c,d){var a=c.series,e=a.chart,l=c.plotX,v=
c.plotY;e.inverted&&(c.mock?(l=c.plotY,v=c.plotX):(l=e.plotWidth-c.plotY,v=e.plotHeight-c.plotX));a&&!d&&(c=a.getPlotBox(),l+=c.translateX,v+=c.translateY);return{x:l,y:v}};a.pointToOptions=function(c){return{x:c.x,y:c.y,xAxis:c.series.xAxis,yAxis:c.series.yAxis}};a.prototype.hasDynamicOptions=function(){return"function"===typeof this.options};a.prototype.getOptions=function(){return this.hasDynamicOptions()?this.options(this.target):this.options};a.prototype.applyOptions=function(c){this.command=
c.command;this.setAxis(c,"x");this.setAxis(c,"y");this.refresh()};a.prototype.setAxis=function(c,a){a+="Axis";c=c[a];var k=this.series.chart;this.series[a]=c instanceof d.Axis?c:g(c)?k[a][c]||k.get(c):null};a.prototype.toAnchor=function(){var c=[this.plotX,this.plotY,0,0];this.series.chart.inverted&&(c[0]=this.plotY,c[1]=this.plotX);return c};a.prototype.getLabelConfig=function(){return{x:this.x,y:this.y,point:this}};a.prototype.isInsidePlot=function(){var c=this.plotX,d=this.plotY,a=this.series.xAxis,
e=this.series.yAxis,l={x:c,y:d,isInsidePlot:!0};a&&(l.isInsidePlot=g(c)&&0<=c&&c<=a.len);e&&(l.isInsidePlot=l.isInsidePlot&&g(d)&&0<=d&&d<=e.len);k(this.series.chart,"afterIsInsidePlot",l);return l.isInsidePlot};a.prototype.refresh=function(){var c=this.series,d=c.xAxis;c=c.yAxis;var a=this.getOptions();d?(this.x=a.x,this.plotX=d.toPixels(a.x,!0)):(this.x=null,this.plotX=a.x);c?(this.y=a.y,this.plotY=c.toPixels(a.y,!0)):(this.y=null,this.plotY=a.y);this.isInside=this.isInsidePlot()};a.prototype.translate=
function(c,d,a,e){this.hasDynamicOptions()||(this.plotX+=a,this.plotY+=e,this.refreshOptions())};a.prototype.scale=function(c,d,a,e){if(!this.hasDynamicOptions()){var l=this.plotY*e;this.plotX=(1-a)*c+this.plotX*a;this.plotY=(1-e)*d+l;this.refreshOptions()}};a.prototype.rotate=function(c,d,a){if(!this.hasDynamicOptions()){var e=Math.cos(a);a=Math.sin(a);var l=this.plotX,v=this.plotY;l-=c;v-=d;this.plotX=l*e-v*a+c;this.plotY=l*a+v*e+d;this.refreshOptions()}};a.prototype.refreshOptions=function(){var c=
this.series,d=c.xAxis;c=c.yAxis;this.x=this.options.x=d?this.options.x=d.toValue(this.plotX,!0):this.plotX;this.y=this.options.y=c?c.toValue(this.plotY,!0):this.plotY};return a}()});w(a,"Extensions/Annotations/Mixins/ControllableMixin.js",[a["Extensions/Annotations/ControlPoint.js"],a["Extensions/Annotations/MockPoint.js"],a["Core/Tooltip.js"],a["Core/Utilities.js"]],function(d,a,n,k){var g=k.isObject,c=k.isString,r=k.merge,t=k.splat;return{init:function(c,d,a){this.annotation=c;this.chart=c.chart;
this.options=d;this.points=[];this.controlPoints=[];this.index=a;this.linkPoints();this.addControlPoints()},attr:function(){this.graphic.attr.apply(this.graphic,arguments)},getPointsOptions:function(){var c=this.options;return c.points||c.point&&t(c.point)},attrsFromOptions:function(c){var e=this.constructor.attrsMap,d={},a,h=this.chart.styledMode;for(a in c){var b=e[a];!b||h&&-1!==["fill","stroke","stroke-width"].indexOf(b)||(d[b]=c[a])}return d},anchor:function(c){var e=c.series.getPlotBox();c=
c.mock?c.toAnchor():n.prototype.getAnchor.call({chart:c.series.chart},c);c={x:c[0]+(this.options.x||0),y:c[1]+(this.options.y||0),height:c[2]||0,width:c[3]||0};return{relativePosition:c,absolutePosition:r(c,{x:c.x+e.translateX,y:c.y+e.translateY})}},point:function(e,d){if(e&&e.series)return e;d&&null!==d.series||(g(e)?d=new a(this.chart,this,e):c(e)?d=this.chart.get(e)||null:"function"===typeof e&&(d=e.call(d,this),d=d.series?d:new a(this.chart,this,e)));return d},linkPoints:function(){var c=this.getPointsOptions(),
d=this.points,a=c&&c.length||0,m;for(m=0;m<a;m++){var h=this.point(c[m],d[m]);if(!h){d.length=0;return}h.mock&&h.refresh();d[m]=h}return d},addControlPoints:function(){var c=this.options.controlPoints;(c||[]).forEach(function(e,a){e=r(this.options.controlPointOptions,e);e.index||(e.index=a);c[a]=e;this.controlPoints.push(new d(this.chart,this,e))},this)},shouldBeDrawn:function(){return!!this.points.length},render:function(c){this.controlPoints.forEach(function(c){c.render()})},redraw:function(c){this.controlPoints.forEach(function(d){d.redraw(c)})},
transform:function(c,d,a,m,h){if(this.chart.inverted){var b=d;d=a;a=b}this.points.forEach(function(b,e){this.transformPoint(c,d,a,m,h,e)},this)},transformPoint:function(c,d,v,m,h,b){var f=this.points[b];f.mock||(f=this.points[b]=a.fromPoint(f));f[c](d,v,m,h)},translate:function(c,d){this.transform("translate",null,null,c,d)},translatePoint:function(c,d,a){this.transformPoint("translate",null,null,c,d,a)},translateShape:function(c,d){var a=this.annotation.chart,e=this.annotation.userOptions,h=a.annotations.indexOf(this.annotation);
a=a.options.annotations[h];this.translatePoint(c,d,0);a[this.collection][this.index].point=this.options.point;e[this.collection][this.index].point=this.options.point},rotate:function(c,d,a){this.transform("rotate",c,d,a)},scale:function(c,d,a,m){this.transform("scale",c,d,a,m)},setControlPointsVisibility:function(c){this.controlPoints.forEach(function(d){d.setVisibility(c)})},destroy:function(){this.graphic&&(this.graphic=this.graphic.destroy());this.tracker&&(this.tracker=this.tracker.destroy());
this.controlPoints.forEach(function(c){c.destroy()});this.options=this.controlPoints=this.points=this.chart=null;this.annotation&&(this.annotation=null)},update:function(c){var d=this.annotation;c=r(!0,this.options,c);var a=this.graphic.parentGroup;this.destroy();this.constructor(d,c);this.render(a);this.redraw()}}});w(a,"Extensions/Annotations/Mixins/MarkerMixin.js",[a["Core/Chart/Chart.js"],a["Core/Renderer/SVG/SVGRenderer.js"],a["Core/Utilities.js"]],function(d,a,n){function k(c){return function(d){this.attr(c,
"url(#"+d+")")}}var g=n.addEvent,c=n.defined,r=n.merge,t=n.objectEach,e=n.uniqueKey,l={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.prototype.addMarker=function(c,d){var a={id:c},b={stroke:d.color||"none",fill:d.color||
"rgba(0, 0, 0, 0.75)"};a.children=d.children.map(function(c){return r(b,c)});d=this.definition(r(!0,{markerWidth:20,markerHeight:20,refX:0,refY:0,orient:"auto"},d,a));d.id=c;return d};a={markerEndSetter:k("marker-end"),markerStartSetter:k("marker-start"),setItemMarkers:function(d){var a=d.options,h=d.chart,b=h.options.defs,f=a.fill,u=c(f)&&"none"!==f?f:a.stroke;["markerStart","markerEnd"].forEach(function(c){var f=a[c],p;if(f){for(p in b){var q=b[p];if(f===q.id&&"marker"===q.tagName){var m=q;break}}m&&
(f=d[c]=h.renderer.addMarker((a.id||e())+"-"+m.id,r(m,{color:u})),d.attr(c,f.attr("id")))}})}};g(d,"afterGetContainer",function(){this.options.defs=r(l,this.options.defs||{});t(this.options.defs,function(c){"marker"===c.tagName&&!1!==c.render&&this.renderer.addMarker(c.id,c)},this)});return a});w(a,"Extensions/Annotations/Controllables/ControllablePath.js",[a["Extensions/Annotations/Mixins/ControllableMixin.js"],a["Core/Globals.js"],a["Extensions/Annotations/Mixins/MarkerMixin.js"],a["Core/Utilities.js"]],
function(d,a,n,k){var g=k.extend,c="rgba(192,192,192,"+(a.svg?.0001:.002)+")";return function(){function a(c,a,l){this.addControlPoints=d.addControlPoints;this.anchor=d.anchor;this.attr=d.attr;this.attrsFromOptions=d.attrsFromOptions;this.destroy=d.destroy;this.getPointsOptions=d.getPointsOptions;this.init=d.init;this.linkPoints=d.linkPoints;this.point=d.point;this.rotate=d.rotate;this.scale=d.scale;this.setControlPointsVisibility=d.setControlPointsVisibility;this.setMarkers=n.setItemMarkers;this.transform=
d.transform;this.transformPoint=d.transformPoint;this.translate=d.translate;this.translatePoint=d.translatePoint;this.translateShape=d.translateShape;this.update=d.update;this.type="path";this.init(c,a,l);this.collection="shapes"}a.prototype.toD=function(){var c=this.options.d;if(c)return"function"===typeof c?c.call(this):c;c=this.points;var d=c.length,a=d,g=c[0],m=a&&this.anchor(g).absolutePosition,h=0,b=[];if(m)for(b.push(["M",m.x,m.y]);++h<d&&a;)g=c[h],a=g.command||"L",m=this.anchor(g).absolutePosition,
"M"===a?b.push([a,m.x,m.y]):"L"===a?b.push([a,m.x,m.y]):"Z"===a&&b.push([a]),a=g.series.visible;return a?this.chart.renderer.crispLine(b,this.graphic.strokeWidth()):null};a.prototype.shouldBeDrawn=function(){return d.shouldBeDrawn.call(this)||!!this.options.d};a.prototype.render=function(a){var e=this.options,l=this.attrsFromOptions(e);this.graphic=this.annotation.chart.renderer.path([["M",0,0]]).attr(l).add(a);e.className&&this.graphic.addClass(e.className);this.tracker=this.annotation.chart.renderer.path([["M",
0,0]]).addClass("highcharts-tracker-line").attr({zIndex:2}).add(a);this.annotation.chart.styledMode||this.tracker.attr({"stroke-linejoin":"round",stroke:c,fill:c,"stroke-width":this.graphic.strokeWidth()+2*e.snap});d.render.call(this);g(this.graphic,{markerStartSetter:n.markerStartSetter,markerEndSetter:n.markerEndSetter});this.setMarkers(this)};a.prototype.redraw=function(c){var a=this.toD(),l=c?"animate":"attr";a?(this.graphic[l]({d:a}),this.tracker[l]({d:a})):(this.graphic.attr({d:"M 0 -9000000000"}),
this.tracker.attr({d:"M 0 -9000000000"}));this.graphic.placed=this.tracker.placed=!!a;d.redraw.call(this,c)};a.attrsMap={dashStyle:"dashstyle",strokeWidth:"stroke-width",stroke:"stroke",fill:"fill",zIndex:"zIndex"};return a}()});w(a,"Extensions/Annotations/Controllables/ControllableRect.js",[a["Extensions/Annotations/Mixins/ControllableMixin.js"],a["Extensions/Annotations/Controllables/ControllablePath.js"],a["Core/Utilities.js"]],function(d,a,n){var g=n.merge;return function(){function k(c,a,g){this.addControlPoints=
d.addControlPoints;this.anchor=d.anchor;this.attr=d.attr;this.attrsFromOptions=d.attrsFromOptions;this.destroy=d.destroy;this.getPointsOptions=d.getPointsOptions;this.init=d.init;this.linkPoints=d.linkPoints;this.point=d.point;this.rotate=d.rotate;this.scale=d.scale;this.setControlPointsVisibility=d.setControlPointsVisibility;this.shouldBeDrawn=d.shouldBeDrawn;this.transform=d.transform;this.transformPoint=d.transformPoint;this.translatePoint=d.translatePoint;this.translateShape=d.translateShape;
this.update=d.update;this.type="rect";this.translate=d.translateShape;this.init(c,a,g);this.collection="shapes"}k.prototype.render=function(c){var a=this.attrsFromOptions(this.options);this.graphic=this.annotation.chart.renderer.rect(0,-9E9,0,0).attr(a).add(c);d.render.call(this)};k.prototype.redraw=function(c){var a=this.anchor(this.points[0]).absolutePosition;if(a)this.graphic[c?"animate":"attr"]({x:a.x,y:a.y,width:this.options.width,height:this.options.height});else this.attr({x:0,y:-9E9});this.graphic.placed=
!!a;d.redraw.call(this,c)};k.attrsMap=g(a.attrsMap,{width:"width",height:"height"});return k}()});w(a,"Extensions/Annotations/Controllables/ControllableCircle.js",[a["Extensions/Annotations/Mixins/ControllableMixin.js"],a["Extensions/Annotations/Controllables/ControllablePath.js"],a["Core/Utilities.js"]],function(a,g,n){var d=n.merge;return function(){function k(c,d,g){this.addControlPoints=a.addControlPoints;this.anchor=a.anchor;this.attr=a.attr;this.attrsFromOptions=a.attrsFromOptions;this.destroy=
a.destroy;this.getPointsOptions=a.getPointsOptions;this.init=a.init;this.linkPoints=a.linkPoints;this.point=a.point;this.rotate=a.rotate;this.scale=a.scale;this.setControlPointsVisibility=a.setControlPointsVisibility;this.shouldBeDrawn=a.shouldBeDrawn;this.transform=a.transform;this.transformPoint=a.transformPoint;this.translatePoint=a.translatePoint;this.translateShape=a.translateShape;this.update=a.update;this.type="circle";this.translate=a.translateShape;this.init(c,d,g);this.collection="shapes"}
k.prototype.render=function(c){var d=this.attrsFromOptions(this.options);this.graphic=this.annotation.chart.renderer.circle(0,-9E9,0).attr(d).add(c);a.render.call(this)};k.prototype.redraw=function(c){var d=this.anchor(this.points[0]).absolutePosition;if(d)this.graphic[c?"animate":"attr"]({x:d.x,y:d.y,r:this.options.r});else this.graphic.attr({x:0,y:-9E9});this.graphic.placed=!!d;a.redraw.call(this,c)};k.prototype.setRadius=function(c){this.options.r=c};k.attrsMap=d(g.attrsMap,{r:"r"});return k}()});
w(a,"Extensions/Annotations/Controllables/ControllableLabel.js",[a["Extensions/Annotations/Mixins/ControllableMixin.js"],a["Extensions/Annotations/MockPoint.js"],a["Core/Renderer/SVG/SVGRenderer.js"],a["Core/Tooltip.js"],a["Core/Utilities.js"]],function(a,g,n,k,z){var c=z.extend,d=z.format,t=z.isNumber,e=z.pick;z=function(){function l(c,d,e){this.addControlPoints=a.addControlPoints;this.attr=a.attr;this.attrsFromOptions=a.attrsFromOptions;this.destroy=a.destroy;this.getPointsOptions=a.getPointsOptions;
this.init=a.init;this.linkPoints=a.linkPoints;this.point=a.point;this.rotate=a.rotate;this.scale=a.scale;this.setControlPointsVisibility=a.setControlPointsVisibility;this.shouldBeDrawn=a.shouldBeDrawn;this.transform=a.transform;this.transformPoint=a.transformPoint;this.translateShape=a.translateShape;this.update=a.update;this.init(c,d,e);this.collection="labels"}l.alignedPosition=function(c,a){var d=c.align,b=c.verticalAlign,f=(a.x||0)+(c.x||0),e=(a.y||0)+(c.y||0),p,m;"right"===d?p=1:"center"===d&&
(p=2);p&&(f+=(a.width-(c.width||0))/p);"bottom"===b?m=1:"middle"===b&&(m=2);m&&(e+=(a.height-(c.height||0))/m);return{x:Math.round(f),y:Math.round(e)}};l.justifiedOptions=function(c,a,d,b){var f=d.align,e=d.verticalAlign,h=a.box?0:a.padding||0,m=a.getBBox();a={align:f,verticalAlign:e,x:d.x,y:d.y,width:a.width,height:a.height};d=b.x-c.plotLeft;var l=b.y-c.plotTop;b=d+h;0>b&&("right"===f?a.align="left":a.x=-b);b=d+m.width-h;b>c.plotWidth&&("left"===f?a.align="right":a.x=c.plotWidth-b);b=l+h;0>b&&("bottom"===
e?a.verticalAlign="top":a.y=-b);b=l+m.height-h;b>c.plotHeight&&("top"===e?a.verticalAlign="bottom":a.y=c.plotHeight-b);return a};l.prototype.translatePoint=function(c,d){a.translatePoint.call(this,c,d,0)};l.prototype.translate=function(c,a){var d=this.annotation.chart,b=this.annotation.userOptions,f=d.annotations.indexOf(this.annotation);f=d.options.annotations[f];d.inverted&&(d=c,c=a,a=d);this.options.x+=c;this.options.y+=a;f[this.collection][this.index].x=this.options.x;f[this.collection][this.index].y=
this.options.y;b[this.collection][this.index].x=this.options.x;b[this.collection][this.index].y=this.options.y};l.prototype.render=function(c){var d=this.options,e=this.attrsFromOptions(d),b=d.style;this.graphic=this.annotation.chart.renderer.label("",0,-9999,d.shape,null,null,d.useHTML,null,"annotation-label").attr(e).add(c);this.annotation.chart.styledMode||("contrast"===b.color&&(b.color=this.annotation.chart.renderer.getContrast(-1<l.shapesWithoutBackground.indexOf(d.shape)?"#FFFFFF":d.backgroundColor)),
this.graphic.css(d.style).shadow(d.shadow));d.className&&this.graphic.addClass(d.className);this.graphic.labelrank=d.labelrank;a.render.call(this)};l.prototype.redraw=function(c){var e=this.options,h=this.text||e.format||e.text,b=this.graphic,f=this.points[0];b.attr({text:h?d(h,f.getLabelConfig(),this.annotation.chart):e.formatter.call(f,this)});e=this.anchor(f);(h=this.position(e))?(b.alignAttr=h,h.anchorX=e.absolutePosition.x,h.anchorY=e.absolutePosition.y,b[c?"animate":"attr"](h)):b.attr({x:0,
y:-9999});b.placed=!!h;a.redraw.call(this,c)};l.prototype.anchor=function(c){var d=a.anchor.apply(this,arguments),e=this.options.x||0,b=this.options.y||0;d.absolutePosition.x-=e;d.absolutePosition.y-=b;d.relativePosition.x-=e;d.relativePosition.y-=b;return d};l.prototype.position=function(a){var d=this.graphic,h=this.annotation.chart,b=this.points[0],f=this.options,u=a.absolutePosition,p=a.relativePosition;if(a=b.series.visible&&g.prototype.isInsidePlot.call(b)){if(f.distance)var A=k.prototype.getPosition.call({chart:h,
distance:e(f.distance,16)},d.width,d.height,{plotX:p.x,plotY:p.y,negative:b.negative,ttBelow:b.ttBelow,h:p.height||p.width});else f.positioner?A=f.positioner.call(this):(b={x:u.x,y:u.y,width:0,height:0},A=l.alignedPosition(c(f,{width:d.width,height:d.height}),b),"justify"===this.options.overflow&&(A=l.alignedPosition(l.justifiedOptions(h,d,f,A),b)));f.crop&&(f=A.x-h.plotLeft,b=A.y-h.plotTop,a=h.isInsidePlot(f,b)&&h.isInsidePlot(f+d.width,b+d.height))}return a?A:null};l.attrsMap={backgroundColor:"fill",
borderColor:"stroke",borderWidth:"stroke-width",zIndex:"zIndex",borderRadius:"r",padding:"padding"};l.shapesWithoutBackground=["connector"];return l}();n.prototype.symbols.connector=function(c,a,d,e,b){var f=b&&b.anchorX;b=b&&b.anchorY;var h=d/2;if(t(f)&&t(b)){var p=[["M",f,b]];var g=a-b;0>g&&(g=-e-g);g<d&&(h=f<c+d/2?g:d-g);b>a+e?p.push(["L",c+h,a+e]):b<a?p.push(["L",c+h,a]):f<c?p.push(["L",c,a+e/2]):f>c+d&&p.push(["L",c+d,a+e/2])}return p||[]};return z});w(a,"Extensions/Annotations/Controllables/ControllableImage.js",
[a["Extensions/Annotations/Controllables/ControllableLabel.js"],a["Extensions/Annotations/Mixins/ControllableMixin.js"]],function(a,g){return function(){function d(a,d,c){this.addControlPoints=g.addControlPoints;this.anchor=g.anchor;this.attr=g.attr;this.attrsFromOptions=g.attrsFromOptions;this.destroy=g.destroy;this.getPointsOptions=g.getPointsOptions;this.init=g.init;this.linkPoints=g.linkPoints;this.point=g.point;this.rotate=g.rotate;this.scale=g.scale;this.setControlPointsVisibility=g.setControlPointsVisibility;
this.shouldBeDrawn=g.shouldBeDrawn;this.transform=g.transform;this.transformPoint=g.transformPoint;this.translatePoint=g.translatePoint;this.translateShape=g.translateShape;this.update=g.update;this.type="image";this.translate=g.translateShape;this.init(a,d,c);this.collection="shapes"}d.prototype.render=function(a){var d=this.attrsFromOptions(this.options),c=this.options;this.graphic=this.annotation.chart.renderer.image(c.src,0,-9E9,c.width,c.height).attr(d).add(a);this.graphic.width=c.width;this.graphic.height=
c.height;g.render.call(this)};d.prototype.redraw=function(d){var k=this.anchor(this.points[0]);if(k=a.prototype.position.call(this,k))this.graphic[d?"animate":"attr"]({x:k.x,y:k.y});else this.graphic.attr({x:0,y:-9E9});this.graphic.placed=!!k;g.redraw.call(this,d)};d.attrsMap={width:"width",height:"height",zIndex:"zIndex"};return d}()});w(a,"Extensions/Annotations/Annotations.js",[a["Core/Chart/Chart.js"],a["Extensions/Annotations/Mixins/ControllableMixin.js"],a["Extensions/Annotations/Controllables/ControllableRect.js"],
a["Extensions/Annotations/Controllables/ControllableCircle.js"],a["Extensions/Annotations/Controllables/ControllablePath.js"],a["Extensions/Annotations/Controllables/ControllableImage.js"],a["Extensions/Annotations/Controllables/ControllableLabel.js"],a["Extensions/Annotations/ControlPoint.js"],a["Extensions/Annotations/Mixins/EventEmitterMixin.js"],a["Core/Globals.js"],a["Extensions/Annotations/MockPoint.js"],a["Core/Pointer.js"],a["Core/Utilities.js"]],function(a,g,n,k,z,c,r,t,e,l,v,m,h){a=a.prototype;
var b=h.addEvent,f=h.defined,d=h.destroyObjectProperties,p=h.erase,A=h.extend,y=h.find,q=h.fireEvent,D=h.getDeferredAnimation,x=h.merge,B=h.pick,E=h.splat;h=h.wrap;var C=function(){function b(b,a){this.annotation=void 0;this.coll="annotations";this.shapesGroup=this.labelsGroup=this.labelCollector=this.group=this.graphic=this.animationConfig=this.collection=void 0;this.chart=b;this.points=[];this.controlPoints=[];this.coll="annotations";this.labels=[];this.shapes=[];this.options=x(this.defaultOptions,
a);this.userOptions=a;a=this.getLabelsAndShapesOptions(this.options,a);this.options.labels=a.labels;this.options.shapes=a.shapes;this.init(b,this.options)}b.prototype.init=function(){var b=this.chart,a=this.options.animation;this.linkPoints();this.addControlPoints();this.addShapes();this.addLabels();this.setLabelCollector();this.animationConfig=D(b,a)};b.prototype.getLabelsAndShapesOptions=function(b,a){var c={};["labels","shapes"].forEach(function(f){b[f]&&(c[f]=E(a[f]).map(function(a,c){return x(b[f][c],
a)}))});return c};b.prototype.addShapes=function(){(this.options.shapes||[]).forEach(function(b,a){b=this.initShape(b,a);x(!0,this.options.shapes[a],b.options)},this)};b.prototype.addLabels=function(){(this.options.labels||[]).forEach(function(b,a){b=this.initLabel(b,a);x(!0,this.options.labels[a],b.options)},this)};b.prototype.addClipPaths=function(){this.setClipAxes();this.clipXAxis&&this.clipYAxis&&(this.clipRect=this.chart.renderer.clipRect(this.getClipBox()))};b.prototype.setClipAxes=function(){var b=
this.chart.xAxis,a=this.chart.yAxis,c=(this.options.labels||[]).concat(this.options.shapes||[]).reduce(function(c,f){return[b[f&&f.point&&f.point.xAxis]||c[0],a[f&&f.point&&f.point.yAxis]||c[1]]},[]);this.clipXAxis=c[0];this.clipYAxis=c[1]};b.prototype.getClipBox=function(){if(this.clipXAxis&&this.clipYAxis)return{x:this.clipXAxis.left,y:this.clipYAxis.top,width:this.clipXAxis.width,height:this.clipYAxis.height}};b.prototype.setLabelCollector=function(){var b=this;b.labelCollector=function(){return b.labels.reduce(function(b,
a){a.options.allowOverlap||b.push(a.graphic);return b},[])};b.chart.labelCollectors.push(b.labelCollector)};b.prototype.setOptions=function(b){this.options=x(this.defaultOptions,b)};b.prototype.redraw=function(b){this.linkPoints();this.graphic||this.render();this.clipRect&&this.clipRect.animate(this.getClipBox());this.redrawItems(this.shapes,b);this.redrawItems(this.labels,b);g.redraw.call(this,b)};b.prototype.redrawItems=function(b,a){for(var c=b.length;c--;)this.redrawItem(b[c],a)};b.prototype.renderItems=
function(b){for(var a=b.length;a--;)this.renderItem(b[a])};b.prototype.render=function(){var b=this.chart.renderer;this.graphic=b.g("annotation").attr({opacity:0,zIndex:this.options.zIndex,visibility:this.options.visible?"visible":"hidden"}).add();this.shapesGroup=b.g("annotation-shapes").add(this.graphic).clip(this.chart.plotBoxClip);this.labelsGroup=b.g("annotation-labels").attr({translateX:0,translateY:0}).add(this.graphic);this.addClipPaths();this.clipRect&&this.graphic.clip(this.clipRect);this.renderItems(this.shapes);
this.renderItems(this.labels);this.addEvents();g.render.call(this)};b.prototype.setVisibility=function(b){var a=this.options;b=B(b,!a.visible);this.graphic.attr("visibility",b?"visible":"hidden");b||this.setControlPointsVisibility(!1);a.visible=b};b.prototype.setControlPointsVisibility=function(b){var a=function(a){a.setControlPointsVisibility(b)};g.setControlPointsVisibility.call(this,b);this.shapes.forEach(a);this.labels.forEach(a)};b.prototype.destroy=function(){var b=this.chart,a=function(b){b.destroy()};
this.labels.forEach(a);this.shapes.forEach(a);this.clipYAxis=this.clipXAxis=null;p(b.labelCollectors,this.labelCollector);e.destroy.call(this);g.destroy.call(this);d(this,b)};b.prototype.remove=function(){return this.chart.removeAnnotation(this)};b.prototype.update=function(b,a){var c=this.chart,f=this.getLabelsAndShapesOptions(this.userOptions,b),d=c.annotations.indexOf(this);b=x(!0,this.userOptions,b);b.labels=f.labels;b.shapes=f.shapes;this.destroy();this.constructor(c,b);c.options.annotations[d]=
b;this.isUpdating=!0;B(a,!0)&&c.redraw();q(this,"afterUpdate");this.isUpdating=!1};b.prototype.initShape=function(a,c){a=x(this.options.shapeOptions,{controlPointOptions:this.options.controlPointOptions},a);c=new b.shapesMap[a.type](this,a,c);c.itemType="shape";this.shapes.push(c);return c};b.prototype.initLabel=function(b,a){b=x(this.options.labelOptions,{controlPointOptions:this.options.controlPointOptions},b);a=new r(this,b,a);a.itemType="label";this.labels.push(a);return a};b.prototype.redrawItem=
function(b,a){b.linkPoints();b.shouldBeDrawn()?(b.graphic||this.renderItem(b),b.redraw(B(a,!0)&&b.graphic.placed),b.points.length&&this.adjustVisibility(b)):this.destroyItem(b)};b.prototype.adjustVisibility=function(b){var a=!1,c=b.graphic;b.points.forEach(function(b){!1!==b.series.visible&&!1!==b.visible&&(a=!0)});a?"hidden"===c.visibility&&c.show():c.hide()};b.prototype.destroyItem=function(b){p(this[b.itemType+"s"],b);b.destroy()};b.prototype.renderItem=function(b){b.render("label"===b.itemType?
this.labelsGroup:this.shapesGroup)};b.ControlPoint=t;b.MockPoint=v;b.shapesMap={rect:n,circle:k,path:z,image:c};b.types={};return b}();x(!0,C.prototype,g,e,x(C.prototype,{nonDOMEvents:["add","afterUpdate","drag","remove"],defaultOptions:{visible:!0,animation:{},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 f(this.y)?this.y:"Annotation label"},includeInDataExport:!0,
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}}));l.extendAnnotation=function(b,a,c,f){a=a||C;x(!0,b.prototype,a.prototype,c);b.prototype.defaultOptions=
x(b.prototype.defaultOptions,f||{})};A(a,{initAnnotation:function(b){b=new (C.types[b.type]||C)(this,b);this.annotations.push(b);return b},addAnnotation:function(b,a){b=this.initAnnotation(b);this.options.annotations.push(b.options);B(a,!0)&&(b.redraw(),b.graphic.attr({opacity:1}));return b},removeAnnotation:function(b){var a=this.annotations,c="annotations"===b.coll?b:y(a,function(a){return a.options.id===b});c&&(q(c,"remove"),p(this.options.annotations,c.options),p(a,c),c.destroy())},drawAnnotations:function(){this.plotBoxClip.attr(this.plotBox);
this.annotations.forEach(function(b){b.redraw();b.graphic.animate({opacity:1},b.animationConfig)})}});a.collectionsWithUpdate.push("annotations");a.collectionsWithInit.annotations=[a.addAnnotation];a.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,c){b=a.initAnnotation(b);
a.options.annotations[c]=b.options});a.drawAnnotations();b(a,"redraw",a.drawAnnotations);b(a,"destroy",function(){a.plotBoxClip.destroy();a.controlPointsGroup.destroy()});b(a,"exportData",function(b){var c,f,d,e,q,p,h,x,u=a.annotations,g=(this.options.exporting&&this.options.exporting.csv||{}).columnHeaderFormatter,D=!b.dataRows[1].xValues,l=null===(f=null===(c=a.options.lang)||void 0===c?void 0:c.exportData)||void 0===f?void 0:f.annotationHeader;c=function(b){if(g){var a=g(b);if(!1!==a)return a}a=
l+" "+b;return D?{columnTitle:a,topLevelColumnTitle:a}:a};var k=b.dataRows[0].length,B=null===(q=null===(e=null===(d=a.options.exporting)||void 0===d?void 0:d.csv)||void 0===e?void 0:e.annotations)||void 0===q?void 0:q.itemDelimiter,A=null===(x=null===(h=null===(p=a.options.exporting)||void 0===p?void 0:p.csv)||void 0===h?void 0:h.annotations)||void 0===x?void 0:x.join;u.forEach(function(a){a.options.labelOptions.includeInDataExport&&a.labels.forEach(function(a){if(a.options.text){var c=a.options.text;
a.points.forEach(function(a){var f=a.x,d=a.series.xAxis?a.series.xAxis.options.index:-1,e=!1;if(-1===d){a=b.dataRows[0].length;for(var q=Array(a),p=0;p<a;++p)q[p]="";q.push(c);q.xValues=[];q.xValues[d]=f;b.dataRows.push(q);e=!0}e||b.dataRows.forEach(function(b,a){!e&&b.xValues&&void 0!==d&&f===b.xValues[d]&&(A&&b.length>k?b[b.length-1]+=B+c:b.push(c),e=!0)});if(!e){a=b.dataRows[0].length;q=Array(a);for(p=0;p<a;++p)q[p]="";q[0]=f;q.push(c);q.xValues=[];void 0!==d&&(q.xValues[d]=f);b.dataRows.push(q)}})}})});
var y=0;b.dataRows.forEach(function(b){y=Math.max(y,b.length)});d=y-b.dataRows[0].length;for(e=0;e<d;e++)q=c(e+1),D?(b.dataRows[0].push(q.topLevelColumnTitle),b.dataRows[1].push(q.columnTitle)):b.dataRows[0].push(q)})});h(m.prototype,"onContainerMouseDown",function(b){this.chart.hasDraggedAnnotation||b.apply(this,Array.prototype.slice.call(arguments,1))});return l.Annotation=C});w(a,"Mixins/Navigation.js",[],function(){return{initUpdate:function(a){a.navigation||(a.navigation={updates:[],update:function(a,
d){this.updates.forEach(function(g){g.update.call(g.context,a,d)})}})},addUpdate:function(a,g){g.navigation||this.initUpdate(g);g.navigation.updates.push({update:a,context:g})}}});w(a,"Extensions/Annotations/NavigationBindings.js",[a["Extensions/Annotations/Annotations.js"],a["Mixins/Navigation.js"],a["Core/Globals.js"],a["Core/Utilities.js"]],function(a,g,n,k){function d(a){var c=a.prototype.defaultOptions.events&&a.prototype.defaultOptions.events.click;b(!0,a.prototype.defaultOptions.events,{click:function(b){var a=
this,f=a.chart.navigationBindings,d=f.activeAnnotation;c&&c.call(a,b);d!==a?(f.deselectAnnotation(),f.activeAnnotation=a,a.setControlPointsVisibility(!0),e(f,"showPopup",{annotation:a,formType:"annotation-toolbar",options:f.annotationToFields(a),onSubmit:function(b){var c={};"remove"===b.actionType?(f.activeAnnotation=!1,f.chart.removeAnnotation(a)):(f.fieldsToOptions(b.fields,c),f.deselectAnnotation(),b=c.typeOptions,"measure"===a.options.type&&(b.crosshairY.enabled=0!==b.crosshairY.strokeWidth,
b.crosshairX.enabled=0!==b.crosshairX.strokeWidth),a.update(c))}})):(f.deselectAnnotation(),e(f,"closePopup"));b.activeAnnotation=!0}})}var c=k.addEvent,r=k.attr,t=k.format,e=k.fireEvent,l=k.isArray,v=k.isFunction,m=k.isNumber,h=k.isObject,b=k.merge,f=k.objectEach,u=k.pick;k=k.setOptions;var p=n.doc,A=n.win,y=function(){function a(b,a){this.selectedButton=this.boundClassNames=void 0;this.chart=b;this.options=a;this.eventsToUnbind=[];this.container=p.getElementsByClassName(this.options.bindingsClassName||
"")}a.prototype.initEvents=function(){var b=this,a=b.chart,d=b.container,e=b.options;b.boundClassNames={};f(e.bindings||{},function(a){b.boundClassNames[a.className]=a});[].forEach.call(d,function(a){b.eventsToUnbind.push(c(a,"click",function(c){var f=b.getButtonEvents(a,c);f&&b.bindingsButtonClick(f.button,f.events,c)}))});f(e.events||{},function(a,f){v(a)&&b.eventsToUnbind.push(c(b,f,a))});b.eventsToUnbind.push(c(a.container,"click",function(c){!a.cancelClick&&a.isInsidePlot(c.chartX-a.plotLeft,
c.chartY-a.plotTop)&&b.bindingsChartClick(this,c)}));b.eventsToUnbind.push(c(a.container,n.isTouchDevice?"touchmove":"mousemove",function(a){b.bindingsContainerMouseMove(this,a)}))};a.prototype.initUpdate=function(){var b=this;g.addUpdate(function(a){b.update(a)},this.chart)};a.prototype.bindingsButtonClick=function(b,a,c){var f=this.chart;this.selectedButtonElement&&(e(this,"deselectButton",{button:this.selectedButtonElement}),this.nextEvent&&(this.currentUserDetails&&"annotations"===this.currentUserDetails.coll&&
f.removeAnnotation(this.currentUserDetails),this.mouseMoveEvent=this.nextEvent=!1));this.selectedButton=a;this.selectedButtonElement=b;e(this,"selectButton",{button:b});a.init&&a.init.call(this,b,c);(a.start||a.steps)&&f.renderer.boxWrapper.addClass("highcharts-draw-mode")};a.prototype.bindingsChartClick=function(b,a){b=this.chart;var c=this.selectedButton;b=b.renderer.boxWrapper;var f;if(f=this.activeAnnotation&&!a.activeAnnotation&&a.target.parentNode){a:{f=a.target;var d=A.Element.prototype,p=
d.matches||d.msMatchesSelector||d.webkitMatchesSelector,q=null;if(d.closest)q=d.closest.call(f,".highcharts-popup");else{do{if(p.call(f,".highcharts-popup"))break a;f=f.parentElement||f.parentNode}while(null!==f&&1===f.nodeType)}f=q}f=!f}f&&(e(this,"closePopup"),this.deselectAnnotation());c&&c.start&&(this.nextEvent?(this.nextEvent(a,this.currentUserDetails),this.steps&&(this.stepIndex++,c.steps[this.stepIndex]?this.mouseMoveEvent=this.nextEvent=c.steps[this.stepIndex]:(e(this,"deselectButton",{button:this.selectedButtonElement}),
b.removeClass("highcharts-draw-mode"),c.end&&c.end.call(this,a,this.currentUserDetails),this.mouseMoveEvent=this.nextEvent=!1,this.selectedButton=null))):(this.currentUserDetails=c.start.call(this,a),c.steps?(this.stepIndex=0,this.steps=!0,this.mouseMoveEvent=this.nextEvent=c.steps[this.stepIndex]):(e(this,"deselectButton",{button:this.selectedButtonElement}),b.removeClass("highcharts-draw-mode"),this.steps=!1,this.selectedButton=null,c.end&&c.end.call(this,a,this.currentUserDetails))))};a.prototype.bindingsContainerMouseMove=
function(b,a){this.mouseMoveEvent&&this.mouseMoveEvent(a,this.currentUserDetails)};a.prototype.fieldsToOptions=function(b,a){f(b,function(b,c){var f=parseFloat(b),d=c.split("."),e=a,p=d.length-1;!m(f)||b.match(/px/g)||c.match(/format/g)||(b=f);""!==b&&"undefined"!==b&&d.forEach(function(a,c){var f=u(d[c+1],"");p===c?e[a]=b:(e[a]||(e[a]=f.match(/\d/g)?[]:{}),e=e[a])})});return a};a.prototype.deselectAnnotation=function(){this.activeAnnotation&&(this.activeAnnotation.setControlPointsVisibility(!1),
this.activeAnnotation=!1)};a.prototype.annotationToFields=function(b){function c(a,d,e,g){if(e&&a&&-1===k.indexOf(d)&&(0<=(e.indexOf&&e.indexOf(d))||e[d]||!0===e))if(l(a))g[d]=[],a.forEach(function(b,a){h(b)?(g[d][a]={},f(b,function(b,f){c(b,f,p[d],g[d][a])})):c(b,0,p[d],g[d])});else if(h(a)){var u={};l(g)?(g.push(u),u[d]={},u=u[d]):g[d]=u;f(a,function(b,a){c(b,a,0===d?e:p[d],u)})}else"format"===d?g[d]=[t(a,b.labels[0].points[0]).toString(),"text"]:l(g)?g.push([a,q(a)]):g[d]=[a,q(a)]}var d=b.options,
e=a.annotationsEditable,p=e.nestedOptions,q=this.utils.getFieldType,g=u(d.type,d.shapes&&d.shapes[0]&&d.shapes[0].type,d.labels&&d.labels[0]&&d.labels[0].itemType,"label"),k=a.annotationsNonEditable[d.langKey]||[],y={langKey:d.langKey,type:g};f(d,function(b,a){"typeOptions"===a?(y[a]={},f(d[a],function(b,f){c(b,f,p,y[a],!0)})):c(b,a,e[g],y)});return y};a.prototype.getClickedClassNames=function(b,a){var c=a.target;a=[];for(var f;c&&((f=r(c,"class"))&&(a=a.concat(f.split(" ").map(function(b){return[b,
c]}))),c=c.parentNode,c!==b););return a};a.prototype.getButtonEvents=function(b,a){var c=this,f;this.getClickedClassNames(b,a).forEach(function(b){c.boundClassNames[b[0]]&&!f&&(f={events:c.boundClassNames[b[0]],button:b[1]})});return f};a.prototype.update=function(a){this.options=b(!0,this.options,a);this.removeEvents();this.initEvents()};a.prototype.removeEvents=function(){this.eventsToUnbind.forEach(function(b){b()})};a.prototype.destroy=function(){this.removeEvents()};a.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:[],basicAnnotation:["shapes","labelOptions"]};a.annotationsNonEditable={rectangle:["crosshairX","crosshairY","label"]};return a}();y.prototype.utils={updateRectSize:function(b,a){var c=a.chart,f=a.options.typeOptions,d=c.pointer.getCoordinates(b);b=d.xAxis[0].value-f.point.x;f=f.point.y-d.yAxis[0].value;
a.update({typeOptions:{background:{width:c.inverted?f:b,height:c.inverted?b:f}}})},getFieldType:function(b){return{string:"text",number:"number","boolean":"checkbox"}[typeof b]}};n.Chart.prototype.initNavigationBindings=function(){var b=this.options;b&&b.navigation&&b.navigation.bindings&&(this.navigationBindings=new y(this,b.navigation),this.navigationBindings.initEvents(),this.navigationBindings.initUpdate())};c(n.Chart,"load",function(){this.initNavigationBindings()});c(n.Chart,"destroy",function(){this.navigationBindings&&
this.navigationBindings.destroy()});c(y,"deselectButton",function(){this.selectedButtonElement=null});c(a,"remove",function(){this.chart.navigationBindings&&this.chart.navigationBindings.deselectAnnotation()});n.Annotation&&(d(a),f(a.types,function(b){d(b)}));k({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-container",bindings:{circleAnnotation:{className:"highcharts-circle-annotation",start:function(a){a=this.chart.pointer.getCoordinates(a);
var c=this.chart.options.navigation;return this.chart.addAnnotation(b({langKey:"circle",type:"basicAnnotation",shapes:[{type:"circle",point:{xAxis:0,yAxis:0,x:a.xAxis[0].value,y:a.yAxis[0].value},r:5}]},c.annotationsOptions,c.bindings.circleAnnotation.annotationsOptions))},steps:[function(b,a){var c=a.options.shapes[0].point,f=this.chart.xAxis[0].toPixels(c.x);c=this.chart.yAxis[0].toPixels(c.y);var d=this.chart.inverted;a.update({shapes:[{r:Math.max(Math.sqrt(Math.pow(d?c-b.chartX:f-b.chartX,2)+
Math.pow(d?f-b.chartY:c-b.chartY,2)),5)}]})}]},rectangleAnnotation:{className:"highcharts-rectangle-annotation",start:function(a){var c=this.chart.pointer.getCoordinates(a);a=this.chart.options.navigation;var f=c.xAxis[0].value;c=c.yAxis[0].value;return this.chart.addAnnotation(b({langKey:"rectangle",type:"basicAnnotation",shapes:[{type:"path",points:[{xAxis:0,yAxis:0,x:f,y:c},{xAxis:0,yAxis:0,x:f,y:c},{xAxis:0,yAxis:0,x:f,y:c},{xAxis:0,yAxis:0,x:f,y:c}]}]},a.annotationsOptions,a.bindings.rectangleAnnotation.annotationsOptions))},
steps:[function(b,a){var c=a.options.shapes[0].points,f=this.chart.pointer.getCoordinates(b);b=f.xAxis[0].value;f=f.yAxis[0].value;c[1].x=b;c[2].x=b;c[2].y=f;c[3].y=f;a.update({shapes:[{points:c}]})}]},labelAnnotation:{className:"highcharts-label-annotation",start:function(a){a=this.chart.pointer.getCoordinates(a);var c=this.chart.options.navigation;return this.chart.addAnnotation(b({langKey:"label",type:"basicAnnotation",labelOptions:{format:"{y:.2f}"},labels:[{point:{xAxis:0,yAxis:0,x:a.xAxis[0].value,
y:a.yAxis[0].value},overflow:"none",crop:!0}]},c.annotationsOptions,c.bindings.labelAnnotation.annotationsOptions))}}},events:{},annotationsOptions:{animation:{defer:0}}}});return y});w(a,"Stock/StockToolsBindings.js",[a["Core/Globals.js"],a["Extensions/Annotations/NavigationBindings.js"],a["Core/Utilities.js"]],function(a,g,n){var d=n.correctFloat,z=n.defined,c=n.extend,r=n.fireEvent,t=n.isNumber,e=n.merge,l=n.pick,v=n.setOptions,m=n.uniqueKey,h=g.prototype.utils;h.addFlagFromForm=function(b){return function(a){var c=
this,f=c.chart,d=f.stockTools,e=h.getFieldType;a=h.attractToPoint(a,f);var g={type:"flags",onSeries:a.series.id,shape:b,data:[{x:a.x,y:a.y}],point:{events:{click:function(){var b=this,a=b.options;r(c,"showPopup",{point:b,formType:"annotation-toolbar",options:{langKey:"flags",type:"flags",title:[a.title,e(a.title)],name:[a.name,e(a.name)]},onSubmit:function(a){"remove"===a.actionType?b.remove():b.update(c.fieldsToOptions(a.fields,{}))}})}}}};d&&d.guiEnabled||f.addSeries(g);r(c,"showPopup",{formType:"flag",
options:{langKey:"flags",type:"flags",title:["A",e("A")],name:["Flag A",e("Flag A")]},onSubmit:function(b){c.fieldsToOptions(b.fields,g.data[0]);f.addSeries(g)}})}};h.manageIndicators=function(b){var a=this.chart,c={linkedTo:b.linkedTo,type:b.type},d=["ad","cmf","mfi","vbp","vwap"],e="ad atr cci cmf macd mfi roc rsi ao aroon aroonoscillator trix apo dpo ppo natr williamsr stochastic slowstochastic linearRegression linearRegressionSlope linearRegressionIntercept linearRegressionAngle".split(" ");if("edit"===
b.actionType)this.fieldsToOptions(b.fields,c),(b=a.get(b.seriesId))&&b.update(c,!1);else if("remove"===b.actionType){if(b=a.get(b.seriesId)){var g=b.yAxis;b.linkedSeries&&b.linkedSeries.forEach(function(b){b.remove(!1)});b.remove(!1);0<=e.indexOf(b.type)&&(g.remove(!1),this.resizeYAxes())}}else c.id=m(),this.fieldsToOptions(b.fields,c),0<=e.indexOf(b.type)?(g=a.addAxis({id:m(),offset:0,opposite:!0,title:{text:""},tickPixelInterval:40,showLastLabel:!1,labels:{align:"left",y:-2}},!1,!1),c.yAxis=g.options.id,
this.resizeYAxes()):c.yAxis=a.get(b.linkedTo).options.yAxis,0<=d.indexOf(b.type)&&(c.params.volumeSeriesID=a.series.filter(function(b){return"column"===b.options.type})[0].options.id),a.addSeries(c,!1);r(this,"deselectButton",{button:this.selectedButtonElement});a.redraw()};h.updateHeight=function(b,a){a.update({typeOptions:{height:this.chart.pointer.getCoordinates(b).yAxis[0].value-a.options.typeOptions.points[1].y}})};h.attractToPoint=function(b,a){b=a.pointer.getCoordinates(b);var c=b.xAxis[0].value;
b=b.yAxis[0].value;var f=Number.MAX_VALUE,d;a.series.forEach(function(b){b.points.forEach(function(b){b&&f>Math.abs(b.x-c)&&(f=Math.abs(b.x-c),d=b)})});return{x:d.x,y:d.y,below:b<d.y,series:d.series,xAxis:d.series.xAxis.index||0,yAxis:d.series.yAxis.index||0}};h.isNotNavigatorYAxis=function(b){return"highcharts-navigator-yaxis"!==b.userOptions.className};h.updateNthPoint=function(b){return function(a,c){var d=c.options.typeOptions;a=this.chart.pointer.getCoordinates(a);var f=a.xAxis[0].value,e=a.yAxis[0].value;
d.points.forEach(function(a,c){c>=b&&(a.x=f,a.y=e)});c.update({typeOptions:{points:d.points}})}};c(g.prototype,{getYAxisPositions:function(b,a,c){function f(b){return z(b)&&!t(b)&&b.match("%")}var e=0;b=b.map(function(b){var g=f(b.options.height)?parseFloat(b.options.height)/100:b.height/a;b=f(b.options.top)?parseFloat(b.options.top)/100:d(b.top-b.chart.plotTop)/a;t(g)||(g=c/100);e=d(e+g);return{height:100*g,top:100*b}});b.allAxesHeight=e;return b},getYAxisResizers:function(b){var a=[];b.forEach(function(c,
d){c=b[d+1];a[d]=c?{enabled:!0,controlledAxis:{next:[l(c.options.id,c.options.index)]}}:{enabled:!1}});return a},resizeYAxes:function(b){b=b||20;var a=this.chart,c=a.yAxis.filter(h.isNotNavigatorYAxis),e=c.length;a=this.getYAxisPositions(c,a.plotHeight,b);var g=this.getYAxisResizers(c),l=a.allAxesHeight,k=b;1<l?(6>e?(a[0].height=d(a[0].height-k),a=this.recalculateYAxisPositions(a,k)):(b=100/e,a=this.recalculateYAxisPositions(a,b/(e-1),!0,-1)),a[e-1]={top:d(100-b),height:b}):(k=100*d(1-l),5>e?(a[0].height=
d(a[0].height+k),a=this.recalculateYAxisPositions(a,k)):a=this.recalculateYAxisPositions(a,k/e,!0,1));a.forEach(function(b,a){c[a].update({height:b.height+"%",top:b.top+"%",resize:g[a]},!1)})},recalculateYAxisPositions:function(b,a,c,e){b.forEach(function(f,g){g=b[g-1];f.top=g?d(g.height+g.top):0;c&&(f.height=d(f.height+e*a))});return b}});n={segment:{className:"highcharts-segment",start:function(b){b=this.chart.pointer.getCoordinates(b);var a=this.chart.options.navigation;b=e({langKey:"segment",
type:"crookedLine",typeOptions:{points:[{x:b.xAxis[0].value,y:b.yAxis[0].value},{x:b.xAxis[0].value,y:b.yAxis[0].value}]}},a.annotationsOptions,a.bindings.segment.annotationsOptions);return this.chart.addAnnotation(b)},steps:[h.updateNthPoint(1)]},arrowSegment:{className:"highcharts-arrow-segment",start:function(b){b=this.chart.pointer.getCoordinates(b);var a=this.chart.options.navigation;b=e({langKey:"arrowSegment",type:"crookedLine",typeOptions:{line:{markerEnd:"arrow"},points:[{x:b.xAxis[0].value,
y:b.yAxis[0].value},{x:b.xAxis[0].value,y:b.yAxis[0].value}]}},a.annotationsOptions,a.bindings.arrowSegment.annotationsOptions);return this.chart.addAnnotation(b)},steps:[h.updateNthPoint(1)]},ray:{className:"highcharts-ray",start:function(b){b=this.chart.pointer.getCoordinates(b);var a=this.chart.options.navigation;b=e({langKey:"ray",type:"crookedLine",typeOptions:{type:"ray",points:[{x:b.xAxis[0].value,y:b.yAxis[0].value},{x:b.xAxis[0].value,y:b.yAxis[0].value}]}},a.annotationsOptions,a.bindings.ray.annotationsOptions);
return this.chart.addAnnotation(b)},steps:[h.updateNthPoint(1)]},arrowRay:{className:"highcharts-arrow-ray",start:function(b){b=this.chart.pointer.getCoordinates(b);var a=this.chart.options.navigation;b=e({langKey:"arrowRay",type:"infinityLine",typeOptions:{type:"ray",line:{markerEnd:"arrow"},points:[{x:b.xAxis[0].value,y:b.yAxis[0].value},{x:b.xAxis[0].value,y:b.yAxis[0].value}]}},a.annotationsOptions,a.bindings.arrowRay.annotationsOptions);return this.chart.addAnnotation(b)},steps:[h.updateNthPoint(1)]},
infinityLine:{className:"highcharts-infinity-line",start:function(b){b=this.chart.pointer.getCoordinates(b);var a=this.chart.options.navigation;b=e({langKey:"infinityLine",type:"infinityLine",typeOptions:{type:"line",points:[{x:b.xAxis[0].value,y:b.yAxis[0].value},{x:b.xAxis[0].value,y:b.yAxis[0].value}]}},a.annotationsOptions,a.bindings.infinityLine.annotationsOptions);return this.chart.addAnnotation(b)},steps:[h.updateNthPoint(1)]},arrowInfinityLine:{className:"highcharts-arrow-infinity-line",start:function(b){b=
this.chart.pointer.getCoordinates(b);var a=this.chart.options.navigation;b=e({langKey:"arrowInfinityLine",type:"infinityLine",typeOptions:{type:"line",line:{markerEnd:"arrow"},points:[{x:b.xAxis[0].value,y:b.yAxis[0].value},{x:b.xAxis[0].value,y:b.yAxis[0].value}]}},a.annotationsOptions,a.bindings.arrowInfinityLine.annotationsOptions);return this.chart.addAnnotation(b)},steps:[h.updateNthPoint(1)]},horizontalLine:{className:"highcharts-horizontal-line",start:function(b){b=this.chart.pointer.getCoordinates(b);
var a=this.chart.options.navigation;b=e({langKey:"horizontalLine",type:"infinityLine",draggable:"y",typeOptions:{type:"horizontalLine",points:[{x:b.xAxis[0].value,y:b.yAxis[0].value}]}},a.annotationsOptions,a.bindings.horizontalLine.annotationsOptions);this.chart.addAnnotation(b)}},verticalLine:{className:"highcharts-vertical-line",start:function(b){b=this.chart.pointer.getCoordinates(b);var a=this.chart.options.navigation;b=e({langKey:"verticalLine",type:"infinityLine",draggable:"x",typeOptions:{type:"verticalLine",
points:[{x:b.xAxis[0].value,y:b.yAxis[0].value}]}},a.annotationsOptions,a.bindings.verticalLine.annotationsOptions);this.chart.addAnnotation(b)}},crooked3:{className:"highcharts-crooked3",start:function(b){b=this.chart.pointer.getCoordinates(b);var a=this.chart.options.navigation;b=e({langKey:"crooked3",type:"crookedLine",typeOptions:{points:[{x:b.xAxis[0].value,y:b.yAxis[0].value},{x:b.xAxis[0].value,y:b.yAxis[0].value},{x:b.xAxis[0].value,y:b.yAxis[0].value}]}},a.annotationsOptions,a.bindings.crooked3.annotationsOptions);
return this.chart.addAnnotation(b)},steps:[h.updateNthPoint(1),h.updateNthPoint(2)]},crooked5:{className:"highcharts-crooked5",start:function(b){b=this.chart.pointer.getCoordinates(b);var a=this.chart.options.navigation;b=e({langKey:"crookedLine",type:"crookedLine",typeOptions:{points:[{x:b.xAxis[0].value,y:b.yAxis[0].value},{x:b.xAxis[0].value,y:b.yAxis[0].value},{x:b.xAxis[0].value,y:b.yAxis[0].value},{x:b.xAxis[0].value,y:b.yAxis[0].value},{x:b.xAxis[0].value,y:b.yAxis[0].value}]}},a.annotationsOptions,
a.bindings.crooked5.annotationsOptions);return this.chart.addAnnotation(b)},steps:[h.updateNthPoint(1),h.updateNthPoint(2),h.updateNthPoint(3),h.updateNthPoint(4)]},elliott3:{className:"highcharts-elliott3",start:function(b){b=this.chart.pointer.getCoordinates(b);var a=this.chart.options.navigation;b=e({langKey:"elliott3",type:"elliottWave",typeOptions:{points:[{x:b.xAxis[0].value,y:b.yAxis[0].value},{x:b.xAxis[0].value,y:b.yAxis[0].value},{x:b.xAxis[0].value,y:b.yAxis[0].value},{x:b.xAxis[0].value,
y:b.yAxis[0].value}]},labelOptions:{style:{color:"#666666"}}},a.annotationsOptions,a.bindings.elliott3.annotationsOptions);return this.chart.addAnnotation(b)},steps:[h.updateNthPoint(1),h.updateNthPoint(2),h.updateNthPoint(3)]},elliott5:{className:"highcharts-elliott5",start:function(b){b=this.chart.pointer.getCoordinates(b);var a=this.chart.options.navigation;b=e({langKey:"elliott5",type:"elliottWave",typeOptions:{points:[{x:b.xAxis[0].value,y:b.yAxis[0].value},{x:b.xAxis[0].value,y:b.yAxis[0].value},
{x:b.xAxis[0].value,y:b.yAxis[0].value},{x:b.xAxis[0].value,y:b.yAxis[0].value},{x:b.xAxis[0].value,y:b.yAxis[0].value},{x:b.xAxis[0].value,y:b.yAxis[0].value}]},labelOptions:{style:{color:"#666666"}}},a.annotationsOptions,a.bindings.elliott5.annotationsOptions);return this.chart.addAnnotation(b)},steps:[h.updateNthPoint(1),h.updateNthPoint(2),h.updateNthPoint(3),h.updateNthPoint(4),h.updateNthPoint(5)]},measureX:{className:"highcharts-measure-x",start:function(b){b=this.chart.pointer.getCoordinates(b);
var a=this.chart.options.navigation;b=e({langKey:"measure",type:"measure",typeOptions:{selectType:"x",point:{x:b.xAxis[0].value,y:b.yAxis[0].value,xAxis:0,yAxis:0},crosshairX:{strokeWidth:1,stroke:"#000000"},crosshairY:{enabled:!1,strokeWidth:0,stroke:"#000000"},background:{width:0,height:0,strokeWidth:0,stroke:"#ffffff"}},labelOptions:{style:{color:"#666666"}}},a.annotationsOptions,a.bindings.measureX.annotationsOptions);return this.chart.addAnnotation(b)},steps:[h.updateRectSize]},measureY:{className:"highcharts-measure-y",
start:function(b){b=this.chart.pointer.getCoordinates(b);var a=this.chart.options.navigation;b=e({langKey:"measure",type:"measure",typeOptions:{selectType:"y",point:{x:b.xAxis[0].value,y:b.yAxis[0].value,xAxis:0,yAxis:0},crosshairX:{enabled:!1,strokeWidth:0,stroke:"#000000"},crosshairY:{strokeWidth:1,stroke:"#000000"},background:{width:0,height:0,strokeWidth:0,stroke:"#ffffff"}},labelOptions:{style:{color:"#666666"}}},a.annotationsOptions,a.bindings.measureY.annotationsOptions);return this.chart.addAnnotation(b)},
steps:[h.updateRectSize]},measureXY:{className:"highcharts-measure-xy",start:function(b){b=this.chart.pointer.getCoordinates(b);var a=this.chart.options.navigation;b=e({langKey:"measure",type:"measure",typeOptions:{selectType:"xy",point:{x:b.xAxis[0].value,y:b.yAxis[0].value,xAxis:0,yAxis:0},background:{width:0,height:0,strokeWidth:10},crosshairX:{strokeWidth:1,stroke:"#000000"},crosshairY:{strokeWidth:1,stroke:"#000000"}},labelOptions:{style:{color:"#666666"}}},a.annotationsOptions,a.bindings.measureXY.annotationsOptions);
return this.chart.addAnnotation(b)},steps:[h.updateRectSize]},fibonacci:{className:"highcharts-fibonacci",start:function(b){b=this.chart.pointer.getCoordinates(b);var a=this.chart.options.navigation;b=e({langKey:"fibonacci",type:"fibonacci",typeOptions:{points:[{x:b.xAxis[0].value,y:b.yAxis[0].value},{x:b.xAxis[0].value,y:b.yAxis[0].value}]},labelOptions:{style:{color:"#666666"}}},a.annotationsOptions,a.bindings.fibonacci.annotationsOptions);return this.chart.addAnnotation(b)},steps:[h.updateNthPoint(1),
h.updateHeight]},parallelChannel:{className:"highcharts-parallel-channel",start:function(b){b=this.chart.pointer.getCoordinates(b);var a=this.chart.options.navigation;b=e({langKey:"parallelChannel",type:"tunnel",typeOptions:{points:[{x:b.xAxis[0].value,y:b.yAxis[0].value},{x:b.xAxis[0].value,y:b.yAxis[0].value}]}},a.annotationsOptions,a.bindings.parallelChannel.annotationsOptions);return this.chart.addAnnotation(b)},steps:[h.updateNthPoint(1),h.updateHeight]},pitchfork:{className:"highcharts-pitchfork",
start:function(b){b=this.chart.pointer.getCoordinates(b);var a=this.chart.options.navigation;b=e({langKey:"pitchfork",type:"pitchfork",typeOptions:{points:[{x:b.xAxis[0].value,y:b.yAxis[0].value,controlPoint:{style:{fill:"red"}}},{x:b.xAxis[0].value,y:b.yAxis[0].value},{x:b.xAxis[0].value,y:b.yAxis[0].value}],innerBackground:{fill:"rgba(100, 170, 255, 0.8)"}},shapeOptions:{strokeWidth:2}},a.annotationsOptions,a.bindings.pitchfork.annotationsOptions);return this.chart.addAnnotation(b)},steps:[h.updateNthPoint(1),
h.updateNthPoint(2)]},verticalCounter:{className:"highcharts-vertical-counter",start:function(b){b=h.attractToPoint(b,this.chart);var a=this.chart.options.navigation,c=z(this.verticalCounter)?this.verticalCounter:0;b=e({langKey:"verticalCounter",type:"verticalLine",typeOptions:{point:{x:b.x,y:b.y,xAxis:b.xAxis,yAxis:b.yAxis},label:{offset:b.below?40:-40,text:c.toString()}},labelOptions:{style:{color:"#666666",fontSize:"11px"}},shapeOptions:{stroke:"rgba(0, 0, 0, 0.75)",strokeWidth:1}},a.annotationsOptions,
a.bindings.verticalCounter.annotationsOptions);b=this.chart.addAnnotation(b);b.options.events.click.call(b,{})}},verticalLabel:{className:"highcharts-vertical-label",start:function(b){b=h.attractToPoint(b,this.chart);var a=this.chart.options.navigation;b=e({langKey:"verticalLabel",type:"verticalLine",typeOptions:{point:{x:b.x,y:b.y,xAxis:b.xAxis,yAxis:b.yAxis},label:{offset:b.below?40:-40}},labelOptions:{style:{color:"#666666",fontSize:"11px"}},shapeOptions:{stroke:"rgba(0, 0, 0, 0.75)",strokeWidth:1}},
a.annotationsOptions,a.bindings.verticalLabel.annotationsOptions);b=this.chart.addAnnotation(b);b.options.events.click.call(b,{})}},verticalArrow:{className:"highcharts-vertical-arrow",start:function(b){b=h.attractToPoint(b,this.chart);var a=this.chart.options.navigation;b=e({langKey:"verticalArrow",type:"verticalLine",typeOptions:{point:{x:b.x,y:b.y,xAxis:b.xAxis,yAxis:b.yAxis},label:{offset:b.below?40:-40,format:" "},connector:{fill:"none",stroke:b.below?"red":"green"}},shapeOptions:{stroke:"rgba(0, 0, 0, 0.75)",
strokeWidth:1}},a.annotationsOptions,a.bindings.verticalArrow.annotationsOptions);b=this.chart.addAnnotation(b);b.options.events.click.call(b,{})}},flagCirclepin:{className:"highcharts-flag-circlepin",start:h.addFlagFromForm("circlepin")},flagDiamondpin:{className:"highcharts-flag-diamondpin",start:h.addFlagFromForm("flag")},flagSquarepin:{className:"highcharts-flag-squarepin",start:h.addFlagFromForm("squarepin")},flagSimplepin:{className:"highcharts-flag-simplepin",start:h.addFlagFromForm("nopin")},
zoomX:{className:"highcharts-zoom-x",init:function(b){this.chart.update({chart:{zoomType:"x"}});r(this,"deselectButton",{button:b})}},zoomY:{className:"highcharts-zoom-y",init:function(b){this.chart.update({chart:{zoomType:"y"}});r(this,"deselectButton",{button:b})}},zoomXY:{className:"highcharts-zoom-xy",init:function(b){this.chart.update({chart:{zoomType:"xy"}});r(this,"deselectButton",{button:b})}},seriesTypeLine:{className:"highcharts-series-type-line",init:function(b){this.chart.series[0].update({type:"line",
useOhlcData:!0});r(this,"deselectButton",{button:b})}},seriesTypeOhlc:{className:"highcharts-series-type-ohlc",init:function(b){this.chart.series[0].update({type:"ohlc"});r(this,"deselectButton",{button:b})}},seriesTypeCandlestick:{className:"highcharts-series-type-candlestick",init:function(b){this.chart.series[0].update({type:"candlestick"});r(this,"deselectButton",{button:b})}},fullScreen:{className:"highcharts-full-screen",init:function(b){this.chart.fullscreen.toggle();r(this,"deselectButton",
{button:b})}},currentPriceIndicator:{className:"highcharts-current-price-indicator",init:function(b){var a=this.chart,c=a.series[0],d=c.options,e=d.lastVisiblePrice&&d.lastVisiblePrice.enabled;d=d.lastPrice&&d.lastPrice.enabled;a=a.stockTools;var g=a.getIconsURL();a&&a.guiEnabled&&(b.firstChild.style["background-image"]=d?'url("'+g+'current-price-show.svg")':'url("'+g+'current-price-hide.svg")');c.update({lastPrice:{enabled:!d,color:"red"},lastVisiblePrice:{enabled:!e,label:{enabled:!0}}});r(this,
"deselectButton",{button:b})}},indicators:{className:"highcharts-indicators",init:function(){var b=this;r(b,"showPopup",{formType:"indicators",options:{},onSubmit:function(a){b.utils.manageIndicators.call(b,a)}})}},toggleAnnotations:{className:"highcharts-toggle-annotations",init:function(b){var a=this.chart,c=a.stockTools,d=c.getIconsURL();this.toggledAnnotations=!this.toggledAnnotations;(a.annotations||[]).forEach(function(a){a.setVisibility(!this.toggledAnnotations)},this);c&&c.guiEnabled&&(b.firstChild.style["background-image"]=
this.toggledAnnotations?'url("'+d+'annotations-hidden.svg")':'url("'+d+'annotations-visible.svg")');r(this,"deselectButton",{button:b})}},saveChart:{className:"highcharts-save-chart",init:function(b){var c=this.chart,d=[],e=[],g=[],l=[];c.annotations.forEach(function(a,b){d[b]=a.userOptions});c.series.forEach(function(a){a.is("sma")?e.push(a.userOptions):"flags"===a.type&&g.push(a.userOptions)});c.yAxis.forEach(function(a){h.isNotNavigatorYAxis(a)&&l.push(a.options)});a.win.localStorage.setItem("highcharts-chart",
JSON.stringify({annotations:d,indicators:e,flags:g,yAxes:l}));r(this,"deselectButton",{button:b})}}};v({navigation:{bindings:n}});g.prototype.utils=e(h,g.prototype.utils)});w(a,"Stock/StockToolsGui.js",[a["Core/Chart/Chart.js"],a["Core/Globals.js"],a["Extensions/Annotations/NavigationBindings.js"],a["Core/Utilities.js"]],function(a,g,n,k){var d=k.addEvent,c=k.createElement,r=k.css,t=k.extend,e=k.fireEvent,l=k.getStyle,v=k.isArray,m=k.merge,h=k.pick;k=k.setOptions;k({lang:{stockTools:{gui:{simpleShapes:"Simple shapes",
lines:"Lines",crookedLines:"Crooked lines",measure:"Measure",advanced:"Advanced",toggleAnnotations:"Toggle annotations",verticalLabels:"Vertical labels",flags:"Flags",zoomChange:"Zoom change",typeChange:"Type change",saveChart:"Save chart",indicators:"Indicators",currentPriceIndicator:"Current Price Indicators",zoomX:"Zoom X",zoomY:"Zoom Y",zoomXY:"Zooom XY",fullScreen:"Fullscreen",typeOHLC:"OHLC",typeLine:"Line",typeCandlestick:"Candlestick",circle:"Circle",label:"Label",rectangle:"Rectangle",flagCirclepin:"Flag circle",
flagDiamondpin:"Flag diamond",flagSquarepin:"Flag square",flagSimplepin:"Flag simple",measureXY:"Measure XY",measureX:"Measure X",measureY:"Measure Y",segment:"Segment",arrowSegment:"Arrow segment",ray:"Ray",arrowRay:"Arrow ray",line:"Line",arrowLine:"Arrow line",horizontalLine:"Horizontal line",verticalLine:"Vertical line",infinityLine:"Infinity line",crooked3:"Crooked 3 line",crooked5:"Crooked 5 line",elliott3:"Elliott 3 line",elliott5:"Elliott 5 line",verticalCounter:"Vertical counter",verticalLabel:"Vertical label",
verticalArrow:"Vertical arrow",fibonacci:"Fibonacci",pitchfork:"Pitchfork",parallelChannel:"Parallel channel"}},navigation:{popup:{circle:"Circle",rectangle:"Rectangle",label:"Label",segment:"Segment",arrowSegment:"Arrow segment",ray:"Ray",arrowRay:"Arrow ray",line:"Line",arrowLine:"Arrow line",horizontalLine:"Horizontal line",verticalLine:"Vertical line",crooked3:"Crooked 3 line",crooked5:"Crooked 5 line",elliott3:"Elliott 3 line",elliott5:"Elliott 5 line",verticalCounter:"Vertical counter",verticalLabel:"Vertical label",
verticalArrow:"Vertical arrow",fibonacci:"Fibonacci",pitchfork:"Pitchfork",parallelChannel:"Parallel channel",infinityLine:"Infinity line",measure:"Measure",measureXY:"Measure XY",measureX:"Measure X",measureY:"Measure Y",flags:"Flags",addButton:"add",saveButton:"save",editButton:"edit",removeButton:"remove",series:"Series",volume:"Volume",connector:"Connector",innerBackground:"Inner background",outerBackground:"Outer background",crosshairX:"Crosshair X",crosshairY:"Crosshair Y",tunnel:"Tunnel",background:"Background"}}},
stockTools:{gui:{enabled:!0,className:"highcharts-bindings-wrapper",toolbarClassName:"stocktools-toolbar",buttons:"indicators separator simpleShapes lines crookedLines measure advanced toggleAnnotations separator verticalLabels flags separator zoomChange fullScreen typeChange separator currentPriceIndicator saveChart".split(" "),definitions:{separator:{symbol:"separator.svg"},simpleShapes:{items:["label","circle","rectangle"],circle:{symbol:"circle.svg"},rectangle:{symbol:"rectangle.svg"},label:{symbol:"label.svg"}},
flags:{items:["flagCirclepin","flagDiamondpin","flagSquarepin","flagSimplepin"],flagSimplepin:{symbol:"flag-basic.svg"},flagDiamondpin:{symbol:"flag-diamond.svg"},flagSquarepin:{symbol:"flag-trapeze.svg"},flagCirclepin:{symbol:"flag-elipse.svg"}},lines:{items:"segment arrowSegment ray arrowRay line arrowLine horizontalLine verticalLine".split(" "),segment:{symbol:"segment.svg"},arrowSegment:{symbol:"arrow-segment.svg"},ray:{symbol:"ray.svg"},arrowRay:{symbol:"arrow-ray.svg"},line:{symbol:"line.svg"},
arrowLine:{symbol:"arrow-line.svg"},verticalLine:{symbol:"vertical-line.svg"},horizontalLine:{symbol:"horizontal-line.svg"}},crookedLines:{items:["elliott3","elliott5","crooked3","crooked5"],crooked3:{symbol:"crooked-3.svg"},crooked5:{symbol:"crooked-5.svg"},elliott3:{symbol:"elliott-3.svg"},elliott5:{symbol:"elliott-5.svg"}},verticalLabels:{items:["verticalCounter","verticalLabel","verticalArrow"],verticalCounter:{symbol:"vertical-counter.svg"},verticalLabel:{symbol:"vertical-label.svg"},verticalArrow:{symbol:"vertical-arrow.svg"}},
advanced:{items:["fibonacci","pitchfork","parallelChannel"],pitchfork:{symbol:"pitchfork.svg"},fibonacci:{symbol:"fibonacci.svg"},parallelChannel:{symbol:"parallel-channel.svg"}},measure:{items:["measureXY","measureX","measureY"],measureX:{symbol:"measure-x.svg"},measureY:{symbol:"measure-y.svg"},measureXY:{symbol:"measure-xy.svg"}},toggleAnnotations:{symbol:"annotations-visible.svg"},currentPriceIndicator:{symbol:"current-price-show.svg"},indicators:{symbol:"indicators.svg"},zoomChange:{items:["zoomX",
"zoomY","zoomXY"],zoomX:{symbol:"zoom-x.svg"},zoomY:{symbol:"zoom-y.svg"},zoomXY:{symbol:"zoom-xy.svg"}},typeChange:{items:["typeOHLC","typeLine","typeCandlestick"],typeOHLC:{symbol:"series-ohlc.svg"},typeLine:{symbol:"series-line.svg"},typeCandlestick:{symbol:"series-candlestick.svg"}},fullScreen:{symbol:"fullscreen.svg"},saveChart:{symbol:"save-chart.svg"}}}}});d(g.Chart,"afterGetContainer",function(){this.setStockTools()});d(g.Chart,"getMargins",function(){var a=this.stockTools&&this.stockTools.listWrapper;
(a=a&&(a.startWidth+l(a,"padding-left")+l(a,"padding-right")||a.offsetWidth))&&a<this.plotWidth&&(this.plotLeft+=a)});d(g.Chart,"destroy",function(){this.stockTools&&this.stockTools.destroy()});d(g.Chart,"redraw",function(){this.stockTools&&this.stockTools.guiEnabled&&this.stockTools.redraw()});k=function(){function a(a,b,c){this.wrapper=this.toolbar=this.submenu=this.showhideBtn=this.listWrapper=this.arrowWrapper=this.arrowUp=this.arrowDown=void 0;this.chart=c;this.options=a;this.lang=b;this.iconsURL=
this.getIconsURL();this.guiEnabled=a.enabled;this.visible=h(a.visible,!0);this.placed=h(a.placed,!1);this.eventsToUnbind=[];this.guiEnabled&&(this.createHTML(),this.init(),this.showHideNavigatorion());e(this,"afterInit")}a.prototype.init=function(){var a=this,b=this.lang,c=this.options,e=this.toolbar,g=a.addSubmenu,h=c.definitions,l=e.childNodes,k;c.buttons.forEach(function(c){k=a.addButton(e,h,c,b);a.eventsToUnbind.push(d(k.buttonWrapper,"click",function(){a.eraseActiveButtons(l,k.buttonWrapper)}));
v(h[c].items)&&g.call(a,k,h[c])})};a.prototype.addSubmenu=function(a,b){var e=this,f=a.submenuArrow,g=a.buttonWrapper,h=l(g,"width"),k=this.wrapper,u=this.listWrapper,m=this.toolbar.childNodes,n=0,t;this.submenu=t=c("ul",{className:"highcharts-submenu-wrapper"},null,g);this.addSubmenuItems(g,b);e.eventsToUnbind.push(d(f,"click",function(a){a.stopPropagation();e.eraseActiveButtons(m,g);0<=g.className.indexOf("highcharts-current")?(u.style.width=u.startWidth+"px",g.classList.remove("highcharts-current"),
t.style.display="none"):(t.style.display="block",n=t.offsetHeight-g.offsetHeight-3,t.offsetHeight+g.offsetTop>k.offsetHeight&&g.offsetTop>n||(n=0),r(t,{top:-n+"px",left:h+3+"px"}),g.className+=" highcharts-current",u.startWidth=k.offsetWidth,u.style.width=u.startWidth+l(u,"padding-left")+t.offsetWidth+3+"px")}))};a.prototype.addSubmenuItems=function(a,b){var c=this,e=this.submenu,f=this.lang,g=this.listWrapper,h;b.items.forEach(function(l){h=c.addButton(e,b,l,f);c.eventsToUnbind.push(d(h.mainButton,
"click",function(){c.switchSymbol(this,a,!0);g.style.width=g.startWidth+"px";e.style.display="none"}))});var l=e.querySelectorAll("li > .highcharts-menu-item-btn")[0];c.switchSymbol(l,!1)};a.prototype.eraseActiveButtons=function(a,b,c){[].forEach.call(a,function(a){a!==b&&(a.classList.remove("highcharts-current"),a.classList.remove("highcharts-active"),c=a.querySelectorAll(".highcharts-submenu-wrapper"),0<c.length&&(c[0].style.display="none"))})};a.prototype.addButton=function(b,d,e,g){void 0===g&&
(g={});d=d[e];var f=d.items,l=d.className||"";e=c("li",{className:h(a.prototype.classMapping[e],"")+" "+l,title:g[e]||e},null,b);b=c("span",{className:"highcharts-menu-item-btn"},null,e);if(f&&f.length){var k=c("span",{className:"highcharts-submenu-item-arrow highcharts-arrow-right"},null,e);k.style["background-image"]="url("+this.iconsURL+"arrow-bottom.svg)"}else b.style["background-image"]="url("+this.iconsURL+d.symbol+")";return{buttonWrapper:e,mainButton:b,submenuArrow:k}};a.prototype.addNavigation=
function(){var a=this.wrapper;this.arrowWrapper=c("div",{className:"highcharts-arrow-wrapper"});this.arrowUp=c("div",{className:"highcharts-arrow-up"},null,this.arrowWrapper);this.arrowUp.style["background-image"]="url("+this.iconsURL+"arrow-right.svg)";this.arrowDown=c("div",{className:"highcharts-arrow-down"},null,this.arrowWrapper);this.arrowDown.style["background-image"]="url("+this.iconsURL+"arrow-right.svg)";a.insertBefore(this.arrowWrapper,a.childNodes[0]);this.scrollButtons()};a.prototype.scrollButtons=
function(){var a=0,b=this.wrapper,c=this.toolbar,e=.1*b.offsetHeight;this.eventsToUnbind.push(d(this.arrowUp,"click",function(){0<a&&(a-=e,c.style["margin-top"]=-a+"px")}));this.eventsToUnbind.push(d(this.arrowDown,"click",function(){b.offsetHeight+a<=c.offsetHeight+e&&(a+=e,c.style["margin-top"]=-a+"px")}))};a.prototype.createHTML=function(){var a=this.chart,b=this.options,d=a.container;a=a.options.navigation;this.wrapper=a=c("div",{className:"highcharts-stocktools-wrapper "+b.className+" "+(a&&
a.bindingsClassName)});d.parentNode.insertBefore(a,d);this.toolbar=d=c("ul",{className:"highcharts-stocktools-toolbar "+b.toolbarClassName});this.listWrapper=b=c("div",{className:"highcharts-menu-wrapper"});a.insertBefore(b,a.childNodes[0]);b.insertBefore(d,b.childNodes[0]);this.showHideToolbar();this.addNavigation()};a.prototype.showHideNavigatorion=function(){this.visible&&this.toolbar.offsetHeight>this.wrapper.offsetHeight-50?this.arrowWrapper.style.display="block":(this.toolbar.style.marginTop=
"0px",this.arrowWrapper.style.display="none")};a.prototype.showHideToolbar=function(){var a=this.chart,b=this.wrapper,e=this.listWrapper,g=this.submenu,h=this.visible,k;this.showhideBtn=k=c("div",{className:"highcharts-toggle-toolbar highcharts-arrow-left"},null,b);k.style["background-image"]="url("+this.iconsURL+"arrow-right.svg)";h?(b.style.height="100%",k.style.top=l(e,"padding-top")+"px",k.style.left=b.offsetWidth+l(e,"padding-left")+"px"):(g&&(g.style.display="none"),k.style.left="0px",this.visible=
h=!1,e.classList.add("highcharts-hide"),k.classList.toggle("highcharts-arrow-right"),b.style.height=k.offsetHeight+"px");this.eventsToUnbind.push(d(k,"click",function(){a.update({stockTools:{gui:{visible:!h,placed:!0}}})}))};a.prototype.switchSymbol=function(a,b){var c=a.parentNode,d=c.classList.value;c=c.parentNode.parentNode;c.className="";d&&c.classList.add(d.trim());c.querySelectorAll(".highcharts-menu-item-btn")[0].style["background-image"]=a.style["background-image"];b&&this.selectButton(c)};
a.prototype.selectButton=function(a){0<=a.className.indexOf("highcharts-active")?a.classList.remove("highcharts-active"):a.classList.add("highcharts-active")};a.prototype.unselectAllButtons=function(a){var b=a.parentNode.querySelectorAll(".highcharts-active");[].forEach.call(b,function(b){b!==a&&b.classList.remove("highcharts-active")})};a.prototype.update=function(a){m(!0,this.chart.options.stockTools,a);this.destroy();this.chart.setStockTools(a);this.chart.navigationBindings&&this.chart.navigationBindings.update()};
a.prototype.destroy=function(){var a=this.wrapper,b=a&&a.parentNode;this.eventsToUnbind.forEach(function(a){a()});b&&b.removeChild(a);this.chart.isDirtyBox=!0;this.chart.redraw()};a.prototype.redraw=function(){this.showHideNavigatorion()};a.prototype.getIconsURL=function(){return this.chart.options.navigation.iconsURL||this.options.iconsURL||"https://code.highcharts.com/8.2.0/gfx/stock-icons/"};return a}();k.prototype.classMapping={circle:"highcharts-circle-annotation",rectangle:"highcharts-rectangle-annotation",
label:"highcharts-label-annotation",segment:"highcharts-segment",arrowSegment:"highcharts-arrow-segment",ray:"highcharts-ray",arrowRay:"highcharts-arrow-ray",line:"highcharts-infinity-line",arrowLine:"highcharts-arrow-infinity-line",verticalLine:"highcharts-vertical-line",horizontalLine:"highcharts-horizontal-line",crooked3:"highcharts-crooked3",crooked5:"highcharts-crooked5",elliott3:"highcharts-elliott3",elliott5:"highcharts-elliott5",pitchfork:"highcharts-pitchfork",fibonacci:"highcharts-fibonacci",
parallelChannel:"highcharts-parallel-channel",measureX:"highcharts-measure-x",measureY:"highcharts-measure-y",measureXY:"highcharts-measure-xy",verticalCounter:"highcharts-vertical-counter",verticalLabel:"highcharts-vertical-label",verticalArrow:"highcharts-vertical-arrow",currentPriceIndicator:"highcharts-current-price-indicator",indicators:"highcharts-indicators",flagCirclepin:"highcharts-flag-circlepin",flagDiamondpin:"highcharts-flag-diamondpin",flagSquarepin:"highcharts-flag-squarepin",flagSimplepin:"highcharts-flag-simplepin",
zoomX:"highcharts-zoom-x",zoomY:"highcharts-zoom-y",zoomXY:"highcharts-zoom-xy",typeLine:"highcharts-series-type-line",typeOHLC:"highcharts-series-type-ohlc",typeCandlestick:"highcharts-series-type-candlestick",fullScreen:"highcharts-full-screen",toggleAnnotations:"highcharts-toggle-annotations",saveChart:"highcharts-save-chart",separator:"highcharts-separator"};t(a.prototype,{setStockTools:function(a){var b=this.options,c=b.lang;a=m(b.stockTools&&b.stockTools.gui,a&&a.gui);this.stockTools=new g.Toolbar(a,
c.stockTools&&c.stockTools.gui,this);this.stockTools.guiEnabled&&(this.isDirtyBox=!0)}});d(n,"selectButton",function(a){var b=a.button,c=this.chart.stockTools;c&&c.guiEnabled&&(c.unselectAllButtons(a.button),0<=b.parentNode.className.indexOf("highcharts-submenu-wrapper")&&(b=b.parentNode.parentNode),c.selectButton(b))});d(n,"deselectButton",function(a){a=a.button;var b=this.chart.stockTools;b&&b.guiEnabled&&(0<=a.parentNode.className.indexOf("highcharts-submenu-wrapper")&&(a=a.parentNode.parentNode),
b.selectButton(a))});g.Toolbar=k;return g.Toolbar});w(a,"masters/modules/stock-tools.src.js",[],function(){})});
//# sourceMappingURL=stock-tools.js.map