/* Highcharts JS v9.1.1 (2021-06-03) Annotations module (c) 2009-2021 Torstein Honsi License: www.highcharts.com/license */ 'use strict';(function(d){"object"===typeof module&&module.exports?(d["default"]=d,module.exports=d):"function"===typeof define&&define.amd?define("highcharts/modules/annotations-advanced",["highcharts"],function(u){d(u);d.Highcharts=u;return d}):d("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(d){function u(f,d,l,m){f.hasOwnProperty(d)||(f[d]=m.apply(null,l))}d=d?d._modules:{};u(d,"Extensions/Annotations/Mixins/EventEmitterMixin.js",[d["Core/Globals.js"],d["Core/Utilities.js"]],function(f, d){var k=d.addEvent,m=d.fireEvent,n=d.objectEach,q=d.pick,e=d.removeEvent;return{addEvents:function(){var b=this,a=function(c){k(c,f.isTouchDevice?"touchstart":"mousedown",function(c){b.onMouseDown(c)},{passive:!1})};a(this.graphic.element);(b.labels||[]).forEach(function(c){c.options.useHTML&&c.graphic.text&&a(c.graphic.text.element)});n(b.options.events,function(c,a){var g=function(g){"click"===a&&b.cancelClick||c.call(b,b.chart.pointer.normalize(g),b.target)};if(-1===(b.nonDOMEvents||[]).indexOf(a))b.graphic.on(a, g);else k(b,a,g,{passive:!1})});if(b.options.draggable&&(k(b,"drag",b.onDrag),!b.graphic.renderer.styledMode)){var c={cursor:{x:"ew-resize",y:"ns-resize",xy:"move"}[b.options.draggable]};b.graphic.css(c);(b.labels||[]).forEach(function(a){a.options.useHTML&&a.graphic.text&&a.graphic.text.css(c)})}b.isUpdating||m(b,"add")},removeDocEvents:function(){this.removeDrag&&(this.removeDrag=this.removeDrag());this.removeMouseUp&&(this.removeMouseUp=this.removeMouseUp())},onMouseDown:function(b){var a=this, c=a.chart.pointer;b.preventDefault&&b.preventDefault();if(2!==b.button){b=c.normalize(b);var h=b.chartX;var g=b.chartY;a.cancelClick=!1;a.chart.hasDraggedAnnotation=!0;a.removeDrag=k(f.doc,f.isTouchDevice?"touchmove":"mousemove",function(b){a.hasDragged=!0;b=c.normalize(b);b.prevChartX=h;b.prevChartY=g;m(a,"drag",b);h=b.chartX;g=b.chartY},f.isTouchDevice?{passive:!1}:void 0);a.removeMouseUp=k(f.doc,f.isTouchDevice?"touchend":"mouseup",function(c){a.cancelClick=a.hasDragged;a.hasDragged=!1;a.chart.hasDraggedAnnotation= !1;m(q(a.target,a),"afterUpdate");a.onMouseUp(c)},f.isTouchDevice?{passive:!1}:void 0)}},onMouseUp:function(b){var a=this.chart;b=this.target||this;var c=a.options.annotations;a=a.annotations.indexOf(b);this.removeDocEvents();c[a]=b.options},onDrag:function(b){if(this.chart.isInsidePlot(b.chartX-this.chart.plotLeft,b.chartY-this.chart.plotTop,{visiblePlotOnly:!0})){var a=this.mouseMoveToTranslation(b);"x"===this.options.draggable&&(a.y=0);"y"===this.options.draggable&&(a.x=0);this.points.length?this.translate(a.x, a.y):(this.shapes.forEach(function(c){c.translate(a.x,a.y)}),this.labels.forEach(function(c){c.translate(a.x,a.y)}));this.redraw(!1)}},mouseMoveToRadians:function(b,a,c){var h=b.prevChartY-c,g=b.prevChartX-a;c=b.chartY-c;b=b.chartX-a;this.chart.inverted&&(a=g,g=h,h=a,a=b,b=c,c=a);return Math.atan2(c,b)-Math.atan2(h,g)},mouseMoveToTranslation:function(b){var a=b.chartX-b.prevChartX;b=b.chartY-b.prevChartY;if(this.chart.inverted){var c=b;b=a;a=c}return{x:a,y:b}},mouseMoveToScale:function(b,a,c){a=(b.chartX- a||1)/(b.prevChartX-a||1);b=(b.chartY-c||1)/(b.prevChartY-c||1);this.chart.inverted&&(c=b,b=a,a=c);return{x:a,y:b}},destroy:function(){this.removeDocEvents();e(this);this.hcEvents=null}}});u(d,"Extensions/Annotations/ControlPoint.js",[d["Core/Utilities.js"],d["Extensions/Annotations/Mixins/EventEmitterMixin.js"]],function(f,d){var k=f.merge,m=f.pick;return function(){function f(f,e,b,a){this.addEvents=d.addEvents;this.graphic=void 0;this.mouseMoveToRadians=d.mouseMoveToRadians;this.mouseMoveToScale= d.mouseMoveToScale;this.mouseMoveToTranslation=d.mouseMoveToTranslation;this.onDrag=d.onDrag;this.onMouseDown=d.onMouseDown;this.onMouseUp=d.onMouseUp;this.removeDocEvents=d.removeDocEvents;this.nonDOMEvents=["drag"];this.chart=f;this.target=e;this.options=b;this.index=m(b.index,a)}f.prototype.setVisibility=function(f){this.graphic.attr("visibility",f?"visible":"hidden");this.options.visible=f};f.prototype.render=function(){var f=this.chart,e=this.options;this.graphic=f.renderer.symbol(e.symbol,0, 0,e.width,e.height).add(f.controlPointsGroup).css(e.style);this.setVisibility(e.visible);this.addEvents()};f.prototype.redraw=function(f){this.graphic[f?"animate":"attr"](this.options.positioner.call(this,this.target))};f.prototype.destroy=function(){d.destroy.call(this);this.graphic&&(this.graphic=this.graphic.destroy());this.options=this.target=this.chart=null};f.prototype.update=function(f){var e=this.chart,b=this.target,a=this.index;f=k(!0,this.options,f);this.destroy();this.constructor(e,b,f, a);this.render(e.controlPointsGroup);this.redraw()};return f}()});u(d,"Extensions/Annotations/MockPoint.js",[d["Core/Series/Series.js"],d["Core/Utilities.js"],d["Core/Axis/Axis.js"]],function(f,d,l){var k=d.defined,n=d.fireEvent;return function(){function d(e,b,a){this.y=this.x=this.ttBelow=this.plotY=this.plotX=this.negative=this.isInside=void 0;this.mock=!0;this.series={visible:!0,chart:e,getPlotBox:f.prototype.getPlotBox};this.target=b||null;this.options=a;this.applyOptions(this.getOptions())} d.fromPoint=function(e){return new d(e.series.chart,null,{x:e.x,y:e.y,xAxis:e.series.xAxis,yAxis:e.series.yAxis})};d.pointToPixels=function(e,b){var a=e.series,c=a.chart,h=e.plotX,g=e.plotY;c.inverted&&(e.mock?(h=e.plotY,g=e.plotX):(h=c.plotWidth-e.plotY,g=c.plotHeight-e.plotX));a&&!b&&(e=a.getPlotBox(),h+=e.translateX,g+=e.translateY);return{x:h,y:g}};d.pointToOptions=function(e){return{x:e.x,y:e.y,xAxis:e.series.xAxis,yAxis:e.series.yAxis}};d.prototype.hasDynamicOptions=function(){return"function"=== typeof this.options};d.prototype.getOptions=function(){return this.hasDynamicOptions()?this.options(this.target):this.options};d.prototype.applyOptions=function(e){this.command=e.command;this.setAxis(e,"x");this.setAxis(e,"y");this.refresh()};d.prototype.setAxis=function(e,b){b+="Axis";e=e[b];var a=this.series.chart;this.series[b]=e instanceof l?e:k(e)?a[b][e]||a.get(e):null};d.prototype.toAnchor=function(){var e=[this.plotX,this.plotY,0,0];this.series.chart.inverted&&(e[0]=this.plotY,e[1]=this.plotX); return e};d.prototype.getLabelConfig=function(){return{x:this.x,y:this.y,point:this}};d.prototype.isInsidePlot=function(){var e=this.plotX,b=this.plotY,a=this.series.xAxis,c=this.series.yAxis,h={x:e,y:b,isInsidePlot:!0};a&&(h.isInsidePlot=k(e)&&0<=e&&e<=a.len);c&&(h.isInsidePlot=h.isInsidePlot&&k(b)&&0<=b&&b<=c.len);n(this.series.chart,"afterIsInsidePlot",h);return h.isInsidePlot};d.prototype.refresh=function(){var e=this.series,b=e.xAxis;e=e.yAxis;var a=this.getOptions();b?(this.x=a.x,this.plotX= b.toPixels(a.x,!0)):(this.x=null,this.plotX=a.x);e?(this.y=a.y,this.plotY=e.toPixels(a.y,!0)):(this.y=null,this.plotY=a.y);this.isInside=this.isInsidePlot()};d.prototype.translate=function(e,b,a,c){this.hasDynamicOptions()||(this.plotX+=a,this.plotY+=c,this.refreshOptions())};d.prototype.scale=function(e,b,a,c){if(!this.hasDynamicOptions()){var h=this.plotY*c;this.plotX=(1-a)*e+this.plotX*a;this.plotY=(1-c)*b+h;this.refreshOptions()}};d.prototype.rotate=function(e,b,a){if(!this.hasDynamicOptions()){var c= Math.cos(a);a=Math.sin(a);var h=this.plotX,g=this.plotY;h-=e;g-=b;this.plotX=h*c-g*a+e;this.plotY=h*a+g*c+b;this.refreshOptions()}};d.prototype.refreshOptions=function(){var e=this.series,b=e.xAxis;e=e.yAxis;this.x=this.options.x=b?this.options.x=b.toValue(this.plotX,!0):this.plotX;this.y=this.options.y=e?e.toValue(this.plotY,!0):this.plotY};return d}()});u(d,"Extensions/Annotations/Mixins/ControllableMixin.js",[d["Extensions/Annotations/ControlPoint.js"],d["Extensions/Annotations/MockPoint.js"], d["Core/Tooltip.js"],d["Core/Utilities.js"]],function(f,d,l,m){var k=m.isObject,q=m.isString,e=m.merge,b=m.splat;return{init:function(a,c,b){this.annotation=a;this.chart=a.chart;this.options=c;this.points=[];this.controlPoints=[];this.index=b;this.linkPoints();this.addControlPoints()},attr:function(){this.graphic.attr.apply(this.graphic,arguments)},getPointsOptions:function(){var a=this.options;return a.points||a.point&&b(a.point)},attrsFromOptions:function(a){var c=this.constructor.attrsMap,b={}, g,r=this.chart.styledMode;for(g in a){var e=c[g];!e||r&&-1!==["fill","stroke","stroke-width"].indexOf(e)||(b[e]=a[g])}return b},anchor:function(a){var c=a.series.getPlotBox(),b=a.series.chart,g=a.mock?a.toAnchor():l.prototype.getAnchor.call({chart:a.series.chart},a);g={x:g[0]+(this.options.x||0),y:g[1]+(this.options.y||0),height:g[2]||0,width:g[3]||0};return{relativePosition:g,absolutePosition:e(g,{x:g.x+(a.mock?c.translateX:b.plotLeft),y:g.y+(a.mock?c.translateY:b.plotTop)})}},point:function(a,c){if(a&& a.series)return a;c&&null!==c.series||(k(a)?c=new d(this.chart,this,a):q(a)?c=this.chart.get(a)||null:"function"===typeof a&&(c=a.call(c,this),c=c.series?c:new d(this.chart,this,a)));return c},linkPoints:function(){var a=this.getPointsOptions(),c=this.points,b=a&&a.length||0,g;for(g=0;gf&&("right"===g?c.align="left":c.x=(c.x||0)-f);f=b+e.width-d;f>a.plotWidth&&("left"===g?c.align="right":c.x=(c.x||0)+a.plotWidth-f);f=h+d;0>f&&("bottom"===r?c.verticalAlign="top":c.y=(c.y||0)-f);f=h+e.height-d;f>a.plotHeight&&("top"===r?c.verticalAlign="bottom":c.y=(c.y||0)+a.plotHeight-f);return c};a.prototype.translatePoint= function(a,c){d.translatePoint.call(this,a,c,0)};a.prototype.translate=function(a,c){var b=this.annotation.chart,g=this.annotation.userOptions,h=b.annotations.indexOf(this.annotation);h=b.options.annotations[h];b.inverted&&(b=a,a=c,c=b);this.options.x+=a;this.options.y+=c;h[this.collection][this.index].x=this.options.x;h[this.collection][this.index].y=this.options.y;g[this.collection][this.index].x=this.options.x;g[this.collection][this.index].y=this.options.y};a.prototype.render=function(c){var b= this.options,g=this.attrsFromOptions(b),h=b.style;this.graphic=this.annotation.chart.renderer.label("",0,-9999,b.shape,null,null,b.useHTML,null,"annotation-label").attr(g).add(c);this.annotation.chart.styledMode||("contrast"===h.color&&(h.color=this.annotation.chart.renderer.getContrast(-1w&&(w=-e-w);wb+e?r.push(["L",c+h,b+e]):fc+d&&r.push(["L",c+d,b+e/2])}return r||[]};return q});u(d,"Extensions/Annotations/Controllables/ControllableImage.js",[d["Extensions/Annotations/Controllables/ControllableLabel.js"],d["Extensions/Annotations/Mixins/ControllableMixin.js"]], function(d,k){return function(){function f(d,f,l){this.addControlPoints=k.addControlPoints;this.anchor=k.anchor;this.attr=k.attr;this.attrsFromOptions=k.attrsFromOptions;this.destroy=k.destroy;this.getPointsOptions=k.getPointsOptions;this.init=k.init;this.linkPoints=k.linkPoints;this.point=k.point;this.rotate=k.rotate;this.scale=k.scale;this.setControlPointsVisibility=k.setControlPointsVisibility;this.shouldBeDrawn=k.shouldBeDrawn;this.transform=k.transform;this.transformPoint=k.transformPoint;this.translatePoint= k.translatePoint;this.translateShape=k.translateShape;this.update=k.update;this.type="image";this.translate=k.translateShape;this.init(d,f,l);this.collection="shapes"}f.prototype.render=function(d){var f=this.attrsFromOptions(this.options),l=this.options;this.graphic=this.annotation.chart.renderer.image(l.src,0,-9E9,l.width,l.height).attr(f).add(d);this.graphic.width=l.width;this.graphic.height=l.height;k.render.call(this)};f.prototype.redraw=function(f){var l=this.anchor(this.points[0]);if(l=d.prototype.position.call(this, l))this.graphic[f?"animate":"attr"]({x:l.x,y:l.y});else this.graphic.attr({x:0,y:-9E9});this.graphic.placed=!!l;k.redraw.call(this,f)};f.attrsMap={width:"width",height:"height",zIndex:"zIndex"};return f}()});u(d,"Extensions/Annotations/Annotations.js",[d["Core/Animation/AnimationUtilities.js"],d["Core/Chart/Chart.js"],d["Extensions/Annotations/Mixins/ControllableMixin.js"],d["Extensions/Annotations/Controllables/ControllableRect.js"],d["Extensions/Annotations/Controllables/ControllableCircle.js"], d["Extensions/Annotations/Controllables/ControllablePath.js"],d["Extensions/Annotations/Controllables/ControllableImage.js"],d["Extensions/Annotations/Controllables/ControllableLabel.js"],d["Extensions/Annotations/ControlPoint.js"],d["Extensions/Annotations/Mixins/EventEmitterMixin.js"],d["Core/Globals.js"],d["Extensions/Annotations/MockPoint.js"],d["Core/Pointer.js"],d["Core/Utilities.js"],d["Core/Color/Palette.js"]],function(d,k,l,m,n,q,e,b,a,c,h,g,r,w,A){var f=d.getDeferredAnimation;d=k.prototype; var v=w.addEvent,z=w.defined,C=w.destroyObjectProperties,p=w.erase,x=w.extend,D=w.find,E=w.fireEvent,t=w.merge,y=w.pick,G=w.splat;w=w.wrap;var F=function(){function h(c,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=c;this.points=[];this.controlPoints=[];this.coll="annotations";this.labels=[];this.shapes=[];this.options=t(this.defaultOptions,a);this.userOptions=a; a=this.getLabelsAndShapesOptions(this.options,a);this.options.labels=a.labels;this.options.shapes=a.shapes;this.init(c,this.options)}h.prototype.init=function(){var c=this.chart,a=this.options.animation;this.linkPoints();this.addControlPoints();this.addShapes();this.addLabels();this.setLabelCollector();this.animationConfig=f(c,a)};h.prototype.getLabelsAndShapesOptions=function(c,a){var b={};["labels","shapes"].forEach(function(g){c[g]&&(b[g]=G(a[g]).map(function(a,b){return t(c[g][b],a)}))});return b}; h.prototype.addShapes=function(){(this.options.shapes||[]).forEach(function(a,c){a=this.initShape(a,c);t(!0,this.options.shapes[c],a.options)},this)};h.prototype.addLabels=function(){(this.options.labels||[]).forEach(function(a,c){a=this.initLabel(a,c);t(!0,this.options.labels[c],a.options)},this)};h.prototype.addClipPaths=function(){this.setClipAxes();this.clipXAxis&&this.clipYAxis&&(this.clipRect=this.chart.renderer.clipRect(this.getClipBox()))};h.prototype.setClipAxes=function(){var a=this.chart.xAxis, c=this.chart.yAxis,b=(this.options.labels||[]).concat(this.options.shapes||[]).reduce(function(b,g){return[a[g&&g.point&&g.point.xAxis]||b[0],c[g&&g.point&&g.point.yAxis]||b[1]]},[]);this.clipXAxis=b[0];this.clipYAxis=b[1]};h.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}};h.prototype.setLabelCollector=function(){var a=this;a.labelCollector=function(){return a.labels.reduce(function(a, c){c.options.allowOverlap||a.push(c.graphic);return a},[])};a.chart.labelCollectors.push(a.labelCollector)};h.prototype.setOptions=function(a){this.options=t(this.defaultOptions,a)};h.prototype.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);l.redraw.call(this,a)};h.prototype.redrawItems=function(a,c){for(var b=a.length;b--;)this.redrawItem(a[b],c)};h.prototype.renderItems= function(a){for(var c=a.length;c--;)this.renderItem(a[c])};h.prototype.render=function(){var a=this.chart.renderer;this.graphic=a.g("annotation").attr({opacity:0,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.addClipPaths();this.clipRect&&this.graphic.clip(this.clipRect);this.renderItems(this.shapes); this.renderItems(this.labels);this.addEvents();l.render.call(this)};h.prototype.setVisibility=function(a){var c=this.options;a=y(a,!c.visible);this.graphic.attr("visibility",a?"visible":"hidden");a||this.setControlPointsVisibility(!1);c.visible=a};h.prototype.setControlPointsVisibility=function(a){var c=function(c){c.setControlPointsVisibility(a)};l.setControlPointsVisibility.call(this,a);this.shapes.forEach(c);this.labels.forEach(c)};h.prototype.destroy=function(){var a=this.chart,b=function(a){a.destroy()}; this.labels.forEach(b);this.shapes.forEach(b);this.clipYAxis=this.clipXAxis=null;p(a.labelCollectors,this.labelCollector);c.destroy.call(this);l.destroy.call(this);C(this,a)};h.prototype.remove=function(){return this.chart.removeAnnotation(this)};h.prototype.update=function(a,c){var b=this.chart,g=this.getLabelsAndShapesOptions(this.userOptions,a),h=b.annotations.indexOf(this);a=t(!0,this.userOptions,a);a.labels=g.labels;a.shapes=g.shapes;this.destroy();this.constructor(b,a);b.options.annotations[h]= a;this.isUpdating=!0;y(c,!0)&&b.redraw();E(this,"afterUpdate");this.isUpdating=!1};h.prototype.initShape=function(a,c){a=t(this.options.shapeOptions,{controlPointOptions:this.options.controlPointOptions},a);c=new h.shapesMap[a.type](this,a,c);c.itemType="shape";this.shapes.push(c);return c};h.prototype.initLabel=function(a,c){a=t(this.options.labelOptions,{controlPointOptions:this.options.controlPointOptions},a);c=new b(this,a,c);c.itemType="label";this.labels.push(c);return c};h.prototype.redrawItem= function(a,c){a.linkPoints();a.shouldBeDrawn()?(a.graphic||this.renderItem(a),a.redraw(y(c,!0)&&a.graphic.placed),a.points.length&&this.adjustVisibility(a)):this.destroyItem(a)};h.prototype.adjustVisibility=function(a){var c=!1,b=a.graphic;a.points.forEach(function(a){!1!==a.series.visible&&!1!==a.visible&&(c=!0)});c?"hidden"===b.visibility&&b.show():b.hide()};h.prototype.destroyItem=function(a){p(this[a.itemType+"s"],a);a.destroy()};h.prototype.renderItem=function(a){a.render("label"===a.itemType? this.labelsGroup:this.shapesGroup)};h.ControlPoint=a;h.MockPoint=g;h.shapesMap={rect:m,circle:n,path:q,image:e};h.types={};return h}();t(!0,F.prototype,l,c,t(F.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:A.neutralColor100,borderRadius:3,borderWidth:1,className:"highcharts-no-tooltip",crop:!1,formatter:function(){return z(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:A.neutralColor100,"stroke-width":2,fill:A.backgroundColor},visible:!1,events:{}},events:{},zIndex:6}}));h.extendAnnotation=function(a, c,b,g){c=c||F;x(a.prototype,t(c.prototype,b));a.prototype.defaultOptions=t(a.prototype.defaultOptions,g||{})};x(d,{initAnnotation:function(a){a=new (F.types[a.type]||F)(this,a);this.annotations.push(a);return a},addAnnotation:function(a,c){a=this.initAnnotation(a);this.options.annotations.push(a.options);y(c,!0)&&(a.redraw(),a.graphic.attr({opacity:1}));return a},removeAnnotation:function(a){var c=this.annotations,b="annotations"===a.coll?a:D(c,function(c){return c.options.id===a});b&&(E(b,"remove"), p(this.options.annotations,b.options),p(c,b),b.destroy())},drawAnnotations:function(){this.plotBoxClip.attr(this.plotBox);this.annotations.forEach(function(a){a.redraw();a.graphic.animate({opacity:1},a.animationConfig)})}});d.collectionsWithUpdate.push("annotations");d.collectionsWithInit.annotations=[d.addAnnotation];v(k,"afterInit",function(){this.annotations=[];this.options.annotations||(this.options.annotations=[])});d.callbacks.push(function(a){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(c,b){if(!a.annotations.some(function(a){return a.options===c})){var g=a.initAnnotation(c);a.options.annotations[b]=g.options}});a.drawAnnotations();v(a,"redraw",a.drawAnnotations);v(a,"destroy",function(){a.plotBoxClip.destroy();a.controlPointsGroup.destroy()});v(a,"exportData",function(c){var b=(this.options.exporting&&this.options.exporting.csv||{}).columnHeaderFormatter, g=!c.dataRows[1].xValues,h=a.options.lang&&a.options.lang.exportData&&a.options.lang.exportData.annotationHeader,d=function(a){if(b){var c=b(a);if(!1!==c)return c}c=h+" "+a;return g?{columnTitle:c,topLevelColumnTitle:c}:c},e=c.dataRows[0].length,f=a.options.exporting&&a.options.exporting.csv&&a.options.exporting.csv.annotations&&a.options.exporting.csv.annotations.itemDelimiter,r=a.options.exporting&&a.options.exporting.csv&&a.options.exporting.csv.annotations&&a.options.exporting.csv.annotations.join; a.annotations.forEach(function(a){a.options.labelOptions.includeInDataExport&&a.labels.forEach(function(a){if(a.options.text){var b=a.options.text;a.points.forEach(function(a){var g=a.x,h=a.series.xAxis?a.series.xAxis.options.index:-1,d=!1;if(-1===h){a=c.dataRows[0].length;for(var t=Array(a),y=0;ye?a[a.length-1]+=f+b:a.push(b),d= !0)});if(!d){a=c.dataRows[0].length;t=Array(a);for(y=0;yk?v:m;var q=0>B?g:e;v={x:0===k?f.x:m,y:0=== B?f.y:q};0!==k&&0!==B&&(k=b.findEdgeCoordinate(f,c,"y",m),f=b.findEdgeCoordinate(f,c,"x",q),k>=g&&k<=e?(v.x=m,v.y=k):(v.x=f,v.y=q));v.x-=d.plotLeft;v.y-=d.plotTop;a.series.chart.inverted&&(a=v.x,v.x=v.y,v.y=a);return v};b.prototype.addShapes=function(){var a=this.options.typeOptions,c=[this.points[0],b.endEdgePoint];a.type.match(/line/gi)&&(c[0]=b.startEdgePoint);c=this.initShape(q(a.line,{type:"path",points:c}),!1);a.line=c.options};b.endEdgePoint=b.edgePoint(0,1);b.startEdgePoint=b.edgePoint(1, 0);return b}(k);m.prototype.defaultOptions=q(k.prototype.defaultOptions,{});d.types.infinityLine=m;"";return m});u(d,"Extensions/Annotations/Types/Fibonacci.js",[d["Extensions/Annotations/Annotations.js"],d["Extensions/Annotations/MockPoint.js"],d["Extensions/Annotations/Types/Tunnel.js"],d["Core/Utilities.js"],d["Core/Color/Palette.js"]],function(d,k,l,m,n){var f=this&&this.__extends||function(){var a=function(c,b){a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,c){a.__proto__= c}||function(a,c){for(var b in c)c.hasOwnProperty(b)&&(a[b]=c[b])};return a(c,b)};return function(c,b){function d(){this.constructor=c}a(c,b);c.prototype=null===b?Object.create(b):(d.prototype=b.prototype,new d)}}(),e=m.merge,b=function(a,c){return function(){var b=this.annotation;if(!b.startRetracements||!b.endRetracements)return[];var d=this.anchor(b.startRetracements[a]).absolutePosition,e=this.anchor(b.endRetracements[a]).absolutePosition;d=[["M",Math.round(d.x),Math.round(d.y)],["L",Math.round(e.x), Math.round(e.y)]];c&&(e=this.anchor(b.endRetracements[a-1]).absolutePosition,b=this.anchor(b.startRetracements[a-1]).absolutePosition,d.push(["L",Math.round(e.x),Math.round(e.y)],["L",Math.round(b.x),Math.round(b.y)]));return d}};m=function(a){function c(c,b){return a.call(this,c,b)||this}f(c,a);c.prototype.linkPoints=function(){a.prototype.linkPoints.call(this);this.linkRetracementsPoints()};c.prototype.linkRetracementsPoints=function(){var a=this.points,b=a[0].y-a[3].y,d=a[1].y-a[2].y,e=a[0].x, f=a[1].x;c.levels.forEach(function(c,g){var h=a[0].y-b*c;c=a[1].y-d*c;this.startRetracements=this.startRetracements||[];this.endRetracements=this.endRetracements||[];this.linkRetracementPoint(g,e,h,this.startRetracements);this.linkRetracementPoint(g,f,c,this.endRetracements)},this)};c.prototype.linkRetracementPoint=function(a,c,b,d){var g=d[a],e=this.options.typeOptions;g?(g.options.x=c,g.options.y=b,g.refresh()):d[a]=new k(this.chart,this,{x:c,y:b,xAxis:e.xAxis,yAxis:e.yAxis})};c.prototype.addShapes= function(){c.levels.forEach(function(a,c){var d=this.options.typeOptions;a=d.backgroundColors;var g=d.lineColor;d=d.lineColors;this.initShape({type:"path",d:b(c),stroke:d[c]||g},!1);0d.label.offset&&(l*=-1);return{x:c.x,xAxis:c.series.xAxis,y:m+l+(b?e-a.plotLeft:f-a.plotTop)}};b.prototype.getPointsOptions=function(){return[this.options.typeOptions.point]};b.prototype.addShapes=function(){var a=this.options.typeOptions,c=this.initShape(n(a.connector, {type:"path",points:[b.connectorFirstPoint,b.connectorSecondPoint]}),!1);a.connector=c.options};b.prototype.addLabels=function(){var a=this.options.typeOptions,c=a.label,b=0,d=c.offset,e=0>c.offset?"bottom":"top",f="center";this.chart.inverted&&(b=c.offset,d=0,e="middle",f=0>c.offset?"right":"left");c=this.initLabel(n(c,{verticalAlign:e,align:f,x:b,y:d}));a.label=c.options};return b}(d);l.prototype.defaultOptions=n(d.prototype.defaultOptions,{typeOptions:{yOffset:10,label:{offset:-40,point:function(d){return d.annotation.points[0]}, allowOverlap:!0,backgroundColor:"none",borderWidth:0,crop:!0,overflow:"none",shape:"rect",text:"{y:.2f}"},connector:{strokeWidth:1,markerEnd:"arrow"}}});return d.types.verticalLine=l});u(d,"Extensions/Annotations/Types/Measure.js",[d["Extensions/Annotations/Annotations.js"],d["Extensions/Annotations/ControlPoint.js"],d["Core/Utilities.js"]],function(d,k,l){var f=this&&this.__extends||function(){var a=function(c,b){a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,c){a.__proto__= c}||function(a,c){for(var b in c)c.hasOwnProperty(b)&&(a[b]=c[b])};return a(c,b)};return function(c,b){function d(){this.constructor=c}a(c,b);c.prototype=null===b?Object.create(b):(d.prototype=b.prototype,new d)}}(),n=l.extend,q=l.isNumber,e=l.merge,b=l.pick,a=function(a){function c(c,b){return a.call(this,c,b)||this}f(c,a);c.prototype.init=function(a,b,e){d.prototype.init.call(this,a,b,e);this.resizeY=this.resizeX=this.offsetY=this.offsetX=0;c.calculations.init.call(this);this.addValues();this.addShapes()}; c.prototype.setClipAxes=function(){this.clipXAxis=this.chart.xAxis[this.options.typeOptions.xAxis];this.clipYAxis=this.chart.yAxis[this.options.typeOptions.yAxis]};c.prototype.pointsOptions=function(){return this.options.points};c.prototype.shapePointsOptions=function(){var a=this.options.typeOptions,c=a.xAxis;a=a.yAxis;return[{x:this.xAxisMin,y:this.yAxisMin,xAxis:c,yAxis:a},{x:this.xAxisMax,y:this.yAxisMin,xAxis:c,yAxis:a},{x:this.xAxisMax,y:this.yAxisMax,xAxis:c,yAxis:a},{x:this.xAxisMin,y:this.yAxisMax, xAxis:c,yAxis:a}]};c.prototype.addControlPoints=function(){var a=this.options.typeOptions.selectType;var c=new k(this.chart,this,this.options.controlPointOptions,0);this.controlPoints.push(c);"xy"!==a&&(c=new k(this.chart,this,this.options.controlPointOptions,1),this.controlPoints.push(c))};c.prototype.addValues=function(a){var d=this.options.typeOptions,g=d.label.formatter;c.calculations.recalculate.call(this,a);d.label.enabled&&(0Max: "+this.max+"
Average: "+this.average+"
Bins: "+this.bins},getExtremes:function(a,c,b,d){return{xAxisMin:Math.min(c, a),xAxisMax:Math.max(c,a),yAxisMin:Math.min(d,b),yAxisMax:Math.max(d,b)}},min:function(){var a=Infinity,b=this.chart.series,d=c.calculations.getExtremes(this.xAxisMin,this.xAxisMax,this.yAxisMin,this.yAxisMax),e=!1;b.forEach(function(c){c.visible&&"highcharts-navigator-series"!==c.options.id&&c.points.forEach(function(c){!c.isNull&&c.yd.xAxisMin&&c.x<=d.xAxisMax&&c.y>d.yAxisMin&&c.y<=d.yAxisMax&&(a=c.y,e=!0)})});e||(a="");return a},max:function(){var a=-Infinity,b=this.chart.series,d=c.calculations.getExtremes(this.xAxisMin, this.xAxisMax,this.yAxisMin,this.yAxisMax),e=!1;b.forEach(function(c){c.visible&&"highcharts-navigator-series"!==c.options.id&&c.points.forEach(function(c){!c.isNull&&c.y>a&&c.x>d.xAxisMin&&c.x<=d.xAxisMax&&c.y>d.yAxisMin&&c.y<=d.yAxisMax&&(a=c.y,e=!0)})});e||(a="");return a},average:function(){var a="";""!==this.max&&""!==this.min&&(a=(this.max+this.min)/2);return a},bins:function(){var a=0,b=this.chart.series,d=c.calculations.getExtremes(this.xAxisMin,this.xAxisMax,this.yAxisMin,this.yAxisMax), e=!1;b.forEach(function(c){c.visible&&"highcharts-navigator-series"!==c.options.id&&c.points.forEach(function(c){!c.isNull&&c.x>d.xAxisMin&&c.x<=d.xAxisMax&&c.y>d.yAxisMin&&c.y<=d.yAxisMax&&(a++,e=!0)})});e||(a="");return a}};return c}(d);a.prototype.defaultOptions=e(d.prototype.defaultOptions,{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(c){var b=this.index,d=c.chart,e=c.options,f=e.typeOptions,k=f.selectType;e=e.controlPointOptions;var l=d.inverted,m=d.xAxis[f.xAxis];d=d.yAxis[f.yAxis];f=c.xAxisMax;var q=c.yAxisMax,n=a.calculations.getExtremes(c.xAxisMin,c.xAxisMax,c.yAxisMin,c.yAxisMax);"x"===k&&(q=(n.yAxisMax-n.yAxisMin)/2,0===b&&(f=c.xAxisMin));"y"===k&&(f=n.xAxisMin+ (n.xAxisMax-n.xAxisMin)/2,0===b&&(q=c.yAxisMin));l?(c=d.toPixels(q),b=m.toPixels(f)):(c=m.toPixels(f),b=d.toPixels(q));return{x:c-e.width/2,y:b-e.height/2}},events:{drag:function(a,b){var c=this.mouseMoveToTranslation(a);a=b.options.typeOptions.selectType;var d="y"===a?0:c.x;c="x"===a?0:c.y;b.resize(d,c,this.index,a);b.resizeX+=d;b.resizeY+=c;b.redraw(!1,!0)}}}});return d.types.measure=a});u(d,"Mixins/Navigation.js",[],function(){return{initUpdate:function(d){d.navigation||(d.navigation={updates:[], update:function(d,f){this.updates.forEach(function(k){k.update.call(k.context,d,f)})}})},addUpdate:function(d,k){k.navigation||this.initUpdate(k);k.navigation.updates.push({update:d,context:k})}}});u(d,"Extensions/Annotations/NavigationBindings.js",[d["Extensions/Annotations/Annotations.js"],d["Core/Chart/Chart.js"],d["Mixins/Navigation.js"],d["Core/FormatUtilities.js"],d["Core/Globals.js"],d["Core/DefaultOptions.js"],d["Core/Utilities.js"]],function(d,k,l,m,n,q,e){function b(a){var c=a.prototype.defaultOptions.events&& a.prototype.defaultOptions.events.click;v(!0,a.prototype.defaultOptions.events,{click:function(a){var b=this,d=b.chart.navigationBindings,e=d.activeAnnotation;c&&c.call(b,a);e!==b?(d.deselectAnnotation(),d.activeAnnotation=b,b.setControlPointsVisibility(!0),g(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))}})):g(d,"closePopup");a.activeAnnotation=!0}})}var a=m.format;m=q.setOptions;var c=e.addEvent,f=e.attr,g=e.fireEvent,r=e.isArray,w=e.isFunction,u=e.isNumber,B=e.isObject,v=e.merge,z=e.objectEach,C=e.pick,p=n.doc,x=n.win,D=function(){function b(a,c){this.selectedButton=this.boundClassNames=void 0;this.chart=a;this.options=c;this.eventsToUnbind= [];this.container=p.getElementsByClassName(this.options.bindingsClassName||"")}b.prototype.initEvents=function(){var a=this,b=a.chart,d=a.container,e=a.options;a.boundClassNames={};z(e.bindings||{},function(c){a.boundClassNames[c.className]=c});[].forEach.call(d,function(b){a.eventsToUnbind.push(c(b,"click",function(c){var d=a.getButtonEvents(b,c);d&&-1===d.button.className.indexOf("highcharts-disabled-btn")&&a.bindingsButtonClick(d.button,d.events,c)}))});z(e.events||{},function(b,d){w(b)&&a.eventsToUnbind.push(c(a, d,b,{passive:!1}))});a.eventsToUnbind.push(c(b.container,"click",function(c){!b.cancelClick&&b.isInsidePlot(c.chartX-b.plotLeft,c.chartY-b.plotTop,{visiblePlotOnly:!0})&&a.bindingsChartClick(this,c)}));a.eventsToUnbind.push(c(b.container,n.isTouchDevice?"touchmove":"mousemove",function(c){a.bindingsContainerMouseMove(this,c)},n.isTouchDevice?{passive:!1}:void 0))};b.prototype.initUpdate=function(){var a=this;l.addUpdate(function(c){a.update(c)},this.chart)};b.prototype.bindingsButtonClick=function(a, c,b){var d=this.chart;this.selectedButtonElement&&(g(this,"deselectButton",{button:this.selectedButtonElement}),this.nextEvent&&(this.currentUserDetails&&"annotations"===this.currentUserDetails.coll&&d.removeAnnotation(this.currentUserDetails),this.mouseMoveEvent=this.nextEvent=!1));this.selectedButton=c;this.selectedButtonElement=a;g(this,"selectButton",{button:a});c.init&&c.init.call(this,a,b);(c.start||c.steps)&&d.renderer.boxWrapper.addClass("highcharts-draw-mode")};b.prototype.bindingsChartClick= function(a,c){a=this.chart;var b=this.selectedButton;a=a.renderer.boxWrapper;var d;if(d=this.activeAnnotation&&!c.activeAnnotation&&c.target.parentNode){a:{d=c.target;var e=x.Element.prototype,f=e.matches||e.msMatchesSelector||e.webkitMatchesSelector,h=null;if(e.closest)h=e.closest.call(d,".highcharts-popup");else{do{if(f.call(d,".highcharts-popup"))break a;d=d.parentElement||d.parentNode}while(null!==d&&1===d.nodeType)}d=h}d=!d}d&&g(this,"closePopup");b&&b.start&&(this.nextEvent?(this.nextEvent(c, this.currentUserDetails),this.steps&&(this.stepIndex++,b.steps[this.stepIndex]?this.mouseMoveEvent=this.nextEvent=b.steps[this.stepIndex]:(g(this,"deselectButton",{button:this.selectedButtonElement}),a.removeClass("highcharts-draw-mode"),b.end&&b.end.call(this,c,this.currentUserDetails),this.mouseMoveEvent=this.nextEvent=!1,this.selectedButton=null))):(this.currentUserDetails=b.start.call(this,c))&&b.steps?(this.stepIndex=0,this.steps=!0,this.mouseMoveEvent=this.nextEvent=b.steps[this.stepIndex]): (g(this,"deselectButton",{button:this.selectedButtonElement}),a.removeClass("highcharts-draw-mode"),this.steps=!1,this.selectedButton=null,b.end&&b.end.call(this,c,this.currentUserDetails)))};b.prototype.bindingsContainerMouseMove=function(a,c){this.mouseMoveEvent&&this.mouseMoveEvent(c,this.currentUserDetails)};b.prototype.fieldsToOptions=function(a,c){z(a,function(a,b){var d=parseFloat(a),e=b.split("."),f=c,g=e.length-1;!u(d)||a.match(/px/g)||b.match(/format/g)||(a=d);""!==a&&"undefined"!==a&&e.forEach(function(c, b){var d=C(e[b+1],"");g===b?f[c]=a:(f[c]||(f[c]=d.match(/\d/g)?[]:{}),f=f[c])})});return c};b.prototype.deselectAnnotation=function(){this.activeAnnotation&&(this.activeAnnotation.setControlPointsVisibility(!1),this.activeAnnotation=!1)};b.prototype.annotationToFields=function(c){function d(b,e,f,p){if(f&&b&&-1===t.indexOf(e)&&(0<=(f.indexOf&&f.indexOf(e))||f[e]||!0===f))if(r(b))p[e]=[],b.forEach(function(a,c){B(a)?(p[e][c]={},z(a,function(a,b){d(a,b,g[e],p[e][c])})):d(a,0,g[e],p[e])});else if(B(b)){var k= {};r(p)?(p.push(k),k[e]={},k=k[e]):p[e]=k;z(b,function(a,c){d(a,c,0===e?f:g[e],k)})}else"format"===e?p[e]=[a(b,c.labels[0].points[0]).toString(),"text"]:r(p)?p.push([b,h(b)]):p[e]=[b,h(b)]}var e=c.options,f=b.annotationsEditable,g=f.nestedOptions,h=this.utils.getFieldType,p=C(e.type,e.shapes&&e.shapes[0]&&e.shapes[0].type,e.labels&&e.labels[0]&&e.labels[0].itemType,"label"),t=b.annotationsNonEditable[e.langKey]||[],k={langKey:e.langKey,type:p};z(e,function(a,c){"typeOptions"===c?(k[c]={},z(e[c],function(a, b){d(a,b,g,k[c],!0)})):d(a,c,f[p],k)});return k};b.prototype.getClickedClassNames=function(a,c){var b=c.target;c=[];for(var d;b&&((d=f(b,"class"))&&(c=c.concat(d.split(" ").map(function(a){return[a,b]}))),b=b.parentNode,b!==a););return c};b.prototype.getButtonEvents=function(a,c){var b=this,d;this.getClickedClassNames(a,c).forEach(function(a){b.boundClassNames[a[0]]&&!d&&(d={events:b.boundClassNames[a[0]],button:a[1]})});return d};b.prototype.update=function(a){this.options=v(!0,this.options,a);this.removeEvents(); this.initEvents()};b.prototype.removeEvents=function(){this.eventsToUnbind.forEach(function(a){a()})};b.prototype.destroy=function(){this.removeEvents()};b.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"]};b.annotationsNonEditable={rectangle:["crosshairX", "crosshairY","label"]};return b}();D.prototype.utils={getFieldType:function(a){return{string:"text",number:"number","boolean":"checkbox"}[typeof a]},updateRectSize:function(a,c){var b=c.chart,d=c.options.typeOptions,e=b.pointer.getCoordinates(a);a=b.navigationBindings.utils.getAssignedAxis(e.xAxis);e=b.navigationBindings.utils.getAssignedAxis(e.yAxis);a&&e&&(a=a.value-d.point.x,d=d.point.y-e.value,c.update({typeOptions:{background:{width:b.inverted?d:a,height:b.inverted?a:d}}}))},getAssignedAxis:function(a){return a.filter(function(a){var c= a.axis.min,b=a.axis.max,d=C(a.axis.minPointOffset,0);return u(c)&&u(b)&&a.value>=c-d&&a.value<=b+d&&!a.axis.options.isInternal})[0]}};k.prototype.initNavigationBindings=function(){var a=this.options;a&&a.navigation&&a.navigation.bindings&&(this.navigationBindings=new D(this,a.navigation),this.navigationBindings.initEvents(),this.navigationBindings.initUpdate())};c(k,"load",function(){this.initNavigationBindings()});c(k,"destroy",function(){this.navigationBindings&&this.navigationBindings.destroy()}); c(D,"deselectButton",function(){this.selectedButtonElement=null});c(d,"remove",function(){this.chart.navigationBindings&&this.chart.navigationBindings.deselectAnnotation()});n.Annotation&&(b(d),z(d.types,function(a){b(a)}));m({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){var c=this.chart.pointer.getCoordinates(a);a=this.utils.getAssignedAxis(c.xAxis); c=this.utils.getAssignedAxis(c.yAxis);var b=this.chart.options.navigation;if(a&&c)return this.chart.addAnnotation(v({langKey:"circle",type:"basicAnnotation",shapes:[{type:"circle",point:{x:a.value,y:c.value,xAxis:a.axis.options.index,yAxis:c.axis.options.index},r:5}]},b.annotationsOptions,b.bindings.circleAnnotation.annotationsOptions))},steps:[function(a,c){var b=c.options.shapes[0].point,d=this.chart.inverted;if(u(b.xAxis)&&u(b.yAxis)){var e=this.chart.xAxis[b.xAxis].toPixels(b.x);b=this.chart.yAxis[b.yAxis].toPixels(b.y); e=Math.max(Math.sqrt(Math.pow(d?b-a.chartX:e-a.chartX,2)+Math.pow(d?e-a.chartY:b-a.chartY,2)),5)}c.update({shapes:[{r:e}]})}]},rectangleAnnotation:{className:"highcharts-rectangle-annotation",start:function(a){a=this.chart.pointer.getCoordinates(a);var c=this.utils.getAssignedAxis(a.xAxis),b=this.utils.getAssignedAxis(a.yAxis);if(c&&b){a=c.value;var d=b.value;c=c.axis.options.index;b=b.axis.options.index;var e=this.chart.options.navigation;return this.chart.addAnnotation(v({langKey:"rectangle",type:"basicAnnotation", shapes:[{type:"path",points:[{xAxis:c,yAxis:b,x:a,y:d},{xAxis:c,yAxis:b,x:a,y:d},{xAxis:c,yAxis:b,x:a,y:d},{xAxis:c,yAxis:b,x:a,y:d}]}]},e.annotationsOptions,e.bindings.rectangleAnnotation.annotationsOptions))}},steps:[function(a,c){var b=c.options.shapes[0].points,d=this.chart.pointer.getCoordinates(a);a=this.utils.getAssignedAxis(d.xAxis);d=this.utils.getAssignedAxis(d.yAxis);a&&d&&(a=a.value,d=d.value,b[1].x=a,b[2].x=a,b[2].y=d,b[3].y=d,c.update({shapes:[{points:b}]}))}]},labelAnnotation:{className:"highcharts-label-annotation", start:function(a){var c=this.chart.pointer.getCoordinates(a);a=this.utils.getAssignedAxis(c.xAxis);c=this.utils.getAssignedAxis(c.yAxis);var b=this.chart.options.navigation;if(a&&c)return this.chart.addAnnotation(v({langKey:"label",type:"basicAnnotation",labelOptions:{format:"{y:.2f}"},labels:[{point:{xAxis:a.axis.options.index,yAxis:c.axis.options.index,x:a.value,y:c.value},overflow:"none",crop:!0}]},b.annotationsOptions,b.bindings.labelAnnotation.annotationsOptions))}}},events:{},annotationsOptions:{animation:{defer:0}}}}); c(k,"render",function(){var a=this,c=a.navigationBindings;if(a&&c){var b=!1;a.series.forEach(function(a){!a.options.isInternal&&a.visible&&(b=!0)});z(c.boundClassNames,function(c,d){a.navigationBindings&&a.navigationBindings.container&&a.navigationBindings.container[0]&&(d=a.navigationBindings.container[0].querySelectorAll("."+d))&&("normal"===c.noDataState?d.forEach(function(a){-1!==a.className.indexOf("highcharts-disabled-btn")&&a.classList.remove("highcharts-disabled-btn")}):b?d.forEach(function(a){-1!== a.className.indexOf("highcharts-disabled-btn")&&a.classList.remove("highcharts-disabled-btn")}):d.forEach(function(a){-1===a.className.indexOf("highcharts-disabled-btn")&&(a.className+=" highcharts-disabled-btn")}))})}});c(D,"closePopup",function(){this.deselectAnnotation()});return D});u(d,"Extensions/Annotations/Popup.js",[d["Core/Globals.js"],d["Extensions/Annotations/NavigationBindings.js"],d["Core/DefaultOptions.js"],d["Core/Pointer.js"],d["Core/Utilities.js"]],function(d,k,l,m,n){var f=d.doc, e=d.isFirefox,b=l.getOptions,a=n.addEvent,c=n.createElement,h=n.defined,g=n.fireEvent,r=n.isArray,u=n.isObject,A=n.isString,B=n.objectEach,v=n.pick,z=n.stableSort;l=n.wrap;var C=/\d/g;l(m.prototype,"onContainerMouseDown",function(a,c){var b=c.target&&c.target.className;A(b)&&0<=b.indexOf("highcharts-popup-field")||a.apply(this,Array.prototype.slice.call(arguments,1))});d.Popup=function(a,c,b){this.init(a,c,b)};d.Popup.prototype={init:function(a,b,d){this.chart=d;this.container=c("div",{className:"highcharts-popup highcharts-no-tooltip"}, null,a);this.lang=this.getLangpack();this.iconsURL=b;this.addCloseBtn()},addCloseBtn:function(){var b=this,d=this.iconsURL;var e=c("div",{className:"highcharts-popup-close"},null,this.container);e.style["background-image"]="url("+(d.match(/png|svg|jpeg|jpg|gif/ig)?d:d+"close.svg")+")";["click","touchstart"].forEach(function(c){a(e,c,function(){b.chart?g(b.chart.navigationBindings,"closePopup"):b.closePopup()})})},addColsContainer:function(a){var b=c("div",{className:"highcharts-popup-lhs-col"},null, a);a=c("div",{className:"highcharts-popup-rhs-col"},null,a);c("div",{className:"highcharts-popup-rhs-col-wrapper"},null,a);return{lhsCol:b,rhsCol:a}},addInput:function(a,b,d,e){var g=a.split(".");g=g[g.length-1];var h=this.lang;b="highcharts-"+b+"-"+g;b.match(C)||c("label",{htmlFor:b},void 0,d).appendChild(f.createTextNode(h[g]||g));c("input",{name:b,value:e[0],type:e[1],className:"highcharts-popup-field"},void 0,d).setAttribute("highcharts-data-name",a)},addButton:function(b,d,e,g,h){var k=this, p=this.closePopup,l=this.getFields;var x=c("button",void 0,void 0,b);x.appendChild(f.createTextNode(d));["click","touchstart"].forEach(function(c){a(x,c,function(){p.call(k);return g(l(h,e))})});return x},getFields:function(a,c){var b=a.querySelectorAll("input"),d=a.querySelectorAll("#highcharts-select-series > option:checked")[0];a=a.querySelectorAll("#highcharts-select-volume > option:checked")[0];var e,f;var g={actionType:c,linkedTo:d&&d.getAttribute("value"),fields:{}};[].forEach.call(b,function(a){f= a.getAttribute("highcharts-data-name");(e=a.getAttribute("highcharts-data-series-id"))?g.seriesId=a.value:f?g.fields[f]=a.value:g.type=a.value});a&&(g.fields["params.volumeSeriesID"]=a.getAttribute("value"));return g},showPopup:function(){var a=this.container,c=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(c);a.style.display="block"}, closePopup:function(){v(this.popup&&this.popup.container,this.container).style.display="none"},showForm:function(a,c,b,d){c&&(this.popup=c.navigationBindings.popup,this.showPopup(),"indicators"===a&&this.indicators.addForm.call(this,c,b,d),"annotation-toolbar"===a&&this.annotations.addToolbar.call(this,c,b,d),"annotation-edit"===a&&this.annotations.addForm.call(this,c,b,d),"flag"===a&&this.annotations.addForm.call(this,c,b,d,!0))},getLangpack:function(){return b().lang.navigation.popup},annotations:{addToolbar:function(a, b,d){var e=this,g=this.lang,h=this.popup.container,k=this.showForm;-1===h.className.indexOf("highcharts-annotation-toolbar")&&(h.className+=" highcharts-annotation-toolbar");a&&(h.style.top=a.plotTop+10+"px");c("span",void 0,void 0,h).appendChild(f.createTextNode(v(g[b.langKey]||b.langKey,b.shapes&&b.shapes[0].type)));var l=this.addButton(h,g.removeButton||"remove","remove",d,h);l.className+=" highcharts-annotation-remove-button";l.style["background-image"]="url("+this.iconsURL+"destroy.svg)";l=this.addButton(h, g.editButton||"edit","edit",function(){k.call(e,"annotation-edit",a,b,d)},h);l.className+=" highcharts-annotation-edit-button";l.style["background-image"]="url("+this.iconsURL+"edit.svg)"},addForm:function(a,b,d,e){var g=this.popup.container,h=this.lang;if(a){var k=c("h2",{className:"highcharts-popup-main-title"},void 0,g);k.appendChild(f.createTextNode(h[b.langKey]||b.langKey||""));k=c("div",{className:"highcharts-popup-lhs-col highcharts-popup-lhs-full"},null,g);var l=c("div",{className:"highcharts-popup-bottom-row"}, null,g);this.annotations.addFormFields.call(this,k,a,"",b,[],!0);this.addButton(l,e?h.addButton||"add":h.saveButton||"save",e?"add":"save",d,g)}},addFormFields:function(a,b,d,g,h,k){var l=this,p=this.annotations.addFormFields,x=this.addInput,m=this.lang,n,t;b&&(B(g,function(c,e){n=""!==d?d+"."+e:e;u(c)&&(!r(c)||r(c)&&u(c[0])?(t=m[e]||e,t.match(C)||h.push([!0,t,a]),p.call(l,a,b,n,c,h,!1)):h.push([l,n,"annotation",a,c]))}),k&&(z(h,function(a){return a[1].match(/format/g)?-1:1}),e&&h.reverse(),h.forEach(function(a){!0=== a[0]?c("span",{className:"highcharts-annotation-title"},void 0,a[2]).appendChild(f.createTextNode(a[1])):x.apply(a[0],a.splice(1))})))}},indicators:{addForm:function(a,c,b){var d=this.indicators,e=this.lang;if(a){this.tabs.init.call(this,a);c=this.popup.container.querySelectorAll(".highcharts-tab-item-content");this.addColsContainer(c[0]);d.addIndicatorList.call(this,a,c[0],"add");var f=c[0].querySelectorAll(".highcharts-popup-rhs-col")[0];this.addButton(f,e.addButton||"add","add",b,f);this.addColsContainer(c[1]); d.addIndicatorList.call(this,a,c[1],"edit");f=c[1].querySelectorAll(".highcharts-popup-rhs-col")[0];this.addButton(f,e.saveButton||"save","edit",b,f);this.addButton(f,e.removeButton||"remove","remove",b,f)}},addIndicatorList:function(b,d,e){var g=this,h=d.querySelectorAll(".highcharts-popup-lhs-col")[0];d=d.querySelectorAll(".highcharts-popup-rhs-col")[0];var k="edit"===e,l=k?b.series:b.options.plotOptions,p=this.indicators.addFormFields,x;if(b){var m=c("ul",{className:"highcharts-indicator-list"}, null,h);var n=d.querySelectorAll(".highcharts-popup-rhs-col-wrapper")[0];B(l,function(d,e){var h=d.options;if(d.params||h&&h.params){var t=g.indicators.getNameType(d,e),q=t.type;x=c("li",{className:"highcharts-indicator-list"},void 0,m);x.appendChild(f.createTextNode(t.name));["click","touchstart"].forEach(function(e){a(x,e,function(){p.call(g,b,k?d:l[q],t.type,n);k&&d.options&&c("input",{type:"hidden",name:"highcharts-id-"+q,value:d.options.id},null,n).setAttribute("highcharts-data-series-id",d.options.id)})})}}); 0