/* Highcharts JS v7.0.3 (2019-02-06) Annotations module (c) 2009-2019 Torstein Honsi License: www.highcharts.com/license */ (function(m){"object"===typeof module&&module.exports?(m["default"]=m,module.exports=m):"function"===typeof define&&define.amd?define(function(){return m}):m("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(m){var y=function(a){return{addEvents:function(){var e=this;a.addEvent(e.graphic.element,"mousedown",function(d){e.onMouseDown(d)});a.objectEach(e.options.events,function(d,b){var c=function(c){"click"===b&&e.cancelClick||d.call(e,e.chart.pointer.normalize(c),e.target)};if("drag"!== b)e.graphic.on(b,c);else a.addEvent(e,"drag",c)});e.options.draggable&&(a.addEvent(e,"drag",e.onDrag),e.graphic.renderer.styledMode||e.graphic.css({cursor:{x:"ew-resize",y:"ns-resize",xy:"move"}[e.options.draggable]}))},removeDocEvents:function(){this.removeDrag&&(this.removeDrag=this.removeDrag());this.removeMouseUp&&(this.removeMouseUp=this.removeMouseUp())},onMouseDown:function(e){var d=this,b=d.chart.pointer,c,f;2!==e.button&&(e.stopPropagation(),e=b.normalize(e),c=e.chartX,f=e.chartY,d.cancelClick= !1,d.removeDrag=a.addEvent(a.doc,"mousemove",function(l){d.hasDragged=!0;l=b.normalize(l);l.prevChartX=c;l.prevChartY=f;a.fireEvent(d,"drag",l);c=l.chartX;f=l.chartY}),d.removeMouseUp=a.addEvent(a.doc,"mouseup",function(c){d.cancelClick=d.hasDragged;d.hasDragged=!1;d.onMouseUp(c)}))},onMouseUp:function(){var a=this.chart,d=this.target||this,b=a.options.annotations,a=a.annotations.indexOf(d);this.removeDocEvents();b[a]=d.options},onDrag:function(a){if(this.chart.isInsidePlot(a.chartX-this.chart.plotLeft, a.chartY-this.chart.plotTop)){var d=this.mouseMoveToTranslation(a);"x"===this.options.draggable&&(d.y=0);"y"===this.options.draggable&&(d.x=0);this.points.length?this.translate(d.x,d.y):(this.shapes.forEach(function(b){b.translate(d.x,d.y)}),this.labels.forEach(function(b){b.translate(d.x,d.y)}));this.redraw(!1)}},mouseMoveToRadians:function(a,d,b){var c=a.prevChartY-b,f=a.prevChartX-d;b=a.chartY-b;a=a.chartX-d;this.chart.inverted&&(d=f,f=c,c=d,d=a,a=b,b=d);return Math.atan2(b,a)-Math.atan2(c,f)}, mouseMoveToTranslation:function(a){var d=a.chartX-a.prevChartX;a=a.chartY-a.prevChartY;var b;this.chart.inverted&&(b=a,a=d,d=b);return{x:d,y:a}},mouseMoveToScale:function(a,d,b){d=(a.chartX-d||1)/(a.prevChartX-d||1);a=(a.chartY-b||1)/(a.prevChartY-b||1);this.chart.inverted&&(b=a,a=d,d=b);return{x:d,y:a}},destroy:function(){this.removeDocEvents();a.removeEvent(this);this.hcEvents=null}}}(m),A=function(a,e){function d(b,c,f,d){this.chart=b;this.target=c;this.options=f;this.index=a.pick(f.index,d)}a.extend(d.prototype, e);d.prototype.setVisibility=function(b){this.graphic.attr("visibility",b?"visible":"hidden");this.options.visible=b};d.prototype.render=function(){var b=this.chart,c=this.options;this.graphic=b.renderer.symbol(c.symbol,0,0,c.width,c.height).add(b.controlPointsGroup).css(c.style);this.setVisibility(c.visible);this.addEvents()};d.prototype.redraw=function(b){this.graphic[b?"animate":"attr"](this.options.positioner.call(this,this.target))};d.prototype.destroy=function(){e.destroy.call(this);this.graphic&& (this.graphic=this.graphic.destroy());this.options=this.target=this.chart=null};d.prototype.update=function(b){var c=this.chart,f=this.target,d=this.index;b=a.merge(!0,this.options,b);this.destroy();this.constructor(c,f,b,d);this.render(c.controlPointsGroup);this.redraw()};return d}(m,y),z=function(a){function e(d,b,c){this.series={visible:!0,chart:d,getPlotBox:a.Series.prototype.getPlotBox};this.target=b||null;this.options=c;this.applyOptions(this.getOptions())}e.fromPoint=function(a){return new e(a.series.chart, null,{x:a.x,y:a.y,xAxis:a.series.xAxis,yAxis:a.series.yAxis})};e.pointToPixels=function(a,b){var c=a.series,f=c.chart,d=a.plotX,h=a.plotY;f.inverted&&(a.mock?(d=a.plotY,h=a.plotX):(d=f.plotWidth-a.plotY,h=f.plotHeight-a.plotX));c&&!b&&(a=c.getPlotBox(),d+=a.translateX,h+=a.translateY);return{x:d,y:h}};e.pointToOptions=function(a){return{x:a.x,y:a.y,xAxis:a.series.xAxis,yAxis:a.series.yAxis}};a.extend(e.prototype,{mock:!0,hasDynamicOptions:function(){return"function"===typeof this.options},getOptions:function(){return this.hasDynamicOptions()? this.options(this.target):this.options},applyOptions:function(a){this.command=a.command;this.setAxis(a,"x");this.setAxis(a,"y");this.refresh()},setAxis:function(d,b){b+="Axis";d=d[b];var c=this.series.chart;this.series[b]=d instanceof a.Axis?d:a.defined(d)?c[b][d]||c.get(d):null},toAnchor:function(){var a=[this.plotX,this.plotY,0,0];this.series.chart.inverted&&(a[0]=this.plotY,a[1]=this.plotX);return a},getLabelConfig:function(){return{x:this.x,y:this.y,point:this}},isInsidePane:function(){var d= this.plotX,b=this.plotY,c=this.series.xAxis,f=this.series.yAxis,l=!0;c&&(l=a.defined(d)&&0<=d&&d<=c.len);f&&(l=l&&a.defined(b)&&0<=b&&b<=f.len);return l},refresh:function(){var a=this.series,b=a.xAxis,a=a.yAxis,c=this.getOptions();b?(this.x=c.x,this.plotX=b.toPixels(c.x,!0)):(this.x=null,this.plotX=c.x);a?(this.y=c.y,this.plotY=a.toPixels(c.y,!0)):(this.y=null,this.plotY=c.y);this.isInside=this.isInsidePane()},translate:function(a,b,c,f){this.hasDynamicOptions()||(this.plotX+=c,this.plotY+=f,this.refreshOptions())}, scale:function(a,b,c,f){if(!this.hasDynamicOptions()){var d=this.plotY*f;this.plotX=(1-c)*a+this.plotX*c;this.plotY=(1-f)*b+d;this.refreshOptions()}},rotate:function(a,b,c){if(!this.hasDynamicOptions()){var f=Math.cos(c);c=Math.sin(c);var d=this.plotX,h=this.plotY,d=d-a,h=h-b;this.plotX=d*f-h*c+a;this.plotY=d*c+h*f+b;this.refreshOptions()}},refreshOptions:function(){var a=this.series,b=a.xAxis,a=a.yAxis;this.x=this.options.x=b?this.options.x=b.toValue(this.plotX,!0):this.plotX;this.y=this.options.y= a?a.toValue(this.plotY,!0):this.plotY}});return e}(m),t=function(a,e,d){return{init:function(a,c,f){this.annotation=a;this.chart=a.chart;this.options=c;this.points=[];this.controlPoints=[];this.index=f;this.linkPoints();this.addControlPoints()},attr:function(){this.graphic.attr.apply(this.graphic,arguments)},getPointsOptions:function(){var b=this.options;return b.points||b.point&&a.splat(b.point)},attrsFromOptions:function(a){var c=this.constructor.attrsMap,f={},b,d,e=this.chart.styledMode;for(b in a)d= c[b],!d||e&&-1!==["fill","stroke","stroke-width"].indexOf(d)||(f[d]=a[b]);return f},anchor:function(b){var c=b.series.getPlotBox();b=b.mock?b.toAnchor():a.Tooltip.prototype.getAnchor.call({chart:b.series.chart},b);b={x:b[0]+(this.options.x||0),y:b[1]+(this.options.y||0),height:b[2]||0,width:b[3]||0};return{relativePosition:b,absolutePosition:a.merge(b,{x:b.x+c.translateX,y:b.y+c.translateY})}},point:function(b,c){if(b&&b.series)return b;c&&null!==c.series||(a.isObject(b)?c=new d(this.chart,this,b): a.isString(b)?c=this.chart.get(b)||null:"function"===typeof b&&(c=b.call(c,this),c=c.series?c:new d(this.chart,this,b)));return c},linkPoints:function(){var a=this.getPointsOptions(),c=this.points,f=a&&a.length||0,d,h;for(d=0;de&&("right"===c?b.align="left":b.x=-e);e=d+k.width-g;e>a.plotWidth&&("left"===c?b.align="right":b.x=a.plotWidth-e);e=p+g;0>e&&("bottom"===f?b.verticalAlign="top":b.y=-e);e=p+k.height-g;e>a.plotHeight&&("top"===f?b.verticalAlign="bottom":b.y=a.plotHeight-e);return b};b.attrsMap={backgroundColor:"fill",borderColor:"stroke",borderWidth:"stroke-width",zIndex:"zIndex", borderRadius:"r",padding:"padding"};a.merge(!0,b.prototype,e,{translatePoint:function(a,b){e.translatePoint.call(this,a,b,0)},translate:function(a,b){var c=this.annotation.userOptions[this.collection][this.index];this.options.x+=a;this.options.y+=b;c.x=this.options.x;c.y=this.options.y},render:function(a){var c=this.options,d=this.attrsFromOptions(c),h=c.style;this.graphic=this.annotation.chart.renderer.label("",0,-9E9,c.shape,null,null,c.useHTML,null,"annotation-label").attr(d).add(a);this.annotation.chart.styledMode|| ("contrast"===h.color&&(h.color=this.annotation.chart.renderer.getContrast(-1k&&(k=-h-k),kd+h?g.push("L",b+f,d+h):nb+e&&g.push("L",b+e,d+h/2));return g||[]};return b}(m,t,z),F=function(a,e,d){function b(a,b,d){this.init(a,b,d);this.collection= "shapes"}b.attrsMap={width:"width",height:"height",zIndex:"zIndex"};a.merge(!0,b.prototype,e,{type:"image",render:function(a){var b=this.attrsFromOptions(this.options),c=this.options;this.graphic=this.annotation.chart.renderer.image(c.src,0,-9E9,c.width,c.height).attr(b).add(a);this.graphic.width=c.width;this.graphic.height=c.height;e.render.call(this)},redraw:function(a){var b=this.anchor(this.points[0]);if(b=d.prototype.position.call(this,b))this.graphic[a?"animate":"attr"]({x:b.x,y:b.y});else this.graphic.attr({x:0, y:-9E9});this.graphic.placed=!!b;e.redraw.call(this,a)},translate:function(a,b){var c=this.annotation.userOptions[this.collection][this.index];this.translatePoint(a,b,0);c.point=this.options.point}});return b}(m,t,C);(function(a,e,d,b,c,f,l,h,n,m){var g=a.merge,k=a.addEvent,p=a.defined,q=a.erase,x=a.find,u=a.isString,v=a.pick,G=a.reduce,H=a.splat,I=a.destroyObjectProperties,r=a.Annotation=function(a,b){var c;this.chart=a;this.points=[];this.controlPoints=[];this.coll="annotations";this.labels=[]; this.shapes=[];this.options=b;this.userOptions=g(!0,{},b);c=this.getLabelsAndShapesOptions(this.userOptions,b);this.userOptions.labels=c.labels;this.userOptions.shapes=c.shapes;this.init(a,b)};g(!0,r.prototype,e,h,{defaultOptions:{visible:!0,draggable:"xy",labelOptions:{align:"center",allowOverlap:!1,backgroundColor:"rgba(0, 0, 0, 0.75)",borderColor:"black",borderRadius:3,borderWidth:1,className:"",crop:!1,formatter:function(){return p(this.y)?this.y:"Annotation label"},overflow:"justify",padding:5, shadow:!1,shape:"callout",style:{fontSize:"11px",fontWeight:"normal",color:"contrast"},useHTML:!1,verticalAlign:"bottom",x:0,y:-16},shapeOptions:{stroke:"rgba(0, 0, 0, 0.75)",strokeWidth:1,fill:"rgba(0, 0, 0, 0.75)",r:0,snap:2},controlPointOptions:{symbol:"circle",width:10,height:10,style:{stroke:"black","stroke-width":2,fill:"white"},visible:!1,events:{}},events:{},zIndex:6},init:function(){this.linkPoints();this.addControlPoints();this.addShapes();this.addLabels();this.addClipPaths();this.setLabelCollector()}, getLabelsAndShapesOptions:function(a,b){var c={};["labels","shapes"].forEach(function(d){a[d]&&(c[d]=H(b[d]).map(function(b,c){return g(a[d][c],b)}))});return c},addShapes:function(){(this.options.shapes||[]).forEach(function(a,b){a=this.initShape(a,b);this.options.shapes[b]=a.options},this)},addLabels:function(){(this.options.labels||[]).forEach(function(a,b){a=this.initLabel(a,b);this.options.labels[b]=a.options},this)},addClipPaths:function(){this.setClipAxes();this.clipXAxis&&this.clipYAxis&& (this.clipRect=this.chart.renderer.clipRect(this.getClipBox()))},setClipAxes:function(){var a=this.chart.xAxis,b=this.chart.yAxis,c=G((this.options.labels||[]).concat(this.options.shapes||[]),function(c,d){return[a[d&&d.point&&d.point.xAxis]||c[0],b[d&&d.point&&d.point.yAxis]||c[1]]},[]);this.clipXAxis=c[0];this.clipYAxis=c[1]},getClipBox:function(){return{x:this.clipXAxis.left,y:this.clipYAxis.top,width:this.clipXAxis.width,height:this.clipYAxis.height}},setLabelCollector:function(){var a=this;a.labelCollector= function(){return a.labels.reduce(function(a,b){b.options.allowOverlap||a.push(b.graphic);return a},[])};a.chart.labelCollectors.push(a.labelCollector)},setOptions:function(a){this.options=g(this.defaultOptions,a)},redraw:function(a){this.linkPoints();this.graphic||this.render();this.clipRect&&this.clipRect.animate(this.getClipBox());this.redrawItems(this.shapes,a);this.redrawItems(this.labels,a);e.redraw.call(this,a)},redrawItems:function(a,b){for(var c=a.length;c--;)this.redrawItem(a[c],b)},render:function(){var a= this.chart.renderer;this.graphic=a.g("annotation").attr({zIndex:this.options.zIndex,visibility:this.options.visible?"visible":"hidden"}).add();this.shapesGroup=a.g("annotation-shapes").add(this.graphic).clip(this.chart.plotBoxClip);this.labelsGroup=a.g("annotation-labels").attr({translateX:0,translateY:0}).add(this.graphic);this.clipRect&&this.graphic.clip(this.clipRect);this.addEvents();e.render.call(this)},setVisibility:function(a){var b=this.options;a=v(a,!b.visible);this.graphic.attr("visibility", a?"visible":"hidden");a||this.setControlPointsVisibility(!1);b.visible=a},setControlPointsVisibility:function(a){var b=function(b){b.setControlPointsVisibility(a)};e.setControlPointsVisibility.call(this,a);this.shapes.forEach(b);this.labels.forEach(b)},destroy:function(){var a=this.chart,b=function(a){a.destroy()};this.labels.forEach(b);this.shapes.forEach(b);this.clipYAxis=this.clipXAxis=null;q(a.labelCollectors,this.labelCollector);h.destroy.call(this);e.destroy.call(this);I(this,a)},remove:function(){return this.destroy()}, update:function(b){var c=this.chart,d=this.getLabelsAndShapesOptions(this.userOptions,b),g=c.annotations.indexOf(this);b=a.merge(!0,this.userOptions,b);b.labels=d.labels;b.shapes=d.shapes;this.destroy();this.constructor(c,b);c.options.annotations[g]=b;this.redraw()},initShape:function(a,b){a=g(this.options.shapeOptions,{controlPointOptions:this.options.controlPointOptions},a);b=new r.shapesMap[a.type](this,a,b);b.itemType="shape";this.shapes.push(b);return b},initLabel:function(a,b){a=g(this.options.labelOptions, {controlPointOptions:this.options.controlPointOptions},a);b=new l(this,a,b);b.itemType="label";this.labels.push(b);return b},redrawItem:function(b,c){b.linkPoints();b.shouldBeDrawn()?(b.graphic||this.renderItem(b),b.redraw(a.pick(c,!0)&&b.graphic.placed),b.points.length&&this.adjustVisibility(b)):this.destroyItem(b)},adjustVisibility:function(a){var b=!1,c=a.graphic;a.points.forEach(function(a){!1!==a.series.visible&&!1!==a.visible&&(b=!0)});b?"hidden"===c.visibility&&c.show():c.hide()},destroyItem:function(a){q(this[a.itemType+ "s"],a);a.destroy()},renderItem:function(a){a.render("label"===a.itemType?this.labelsGroup:this.shapesGroup)}});r.shapesMap={rect:d,circle:b,path:c,image:f};r.types={};r.MockPoint=n;r.ControlPoint=m;a.extendAnnotation=function(a,b,c,d){b=b||r;g(!0,a.prototype,b.prototype,c);a.prototype.defaultOptions=g(a.prototype.defaultOptions,d||{})};a.Chart.prototype.collectionsWithUpdate.push("annotations");a.extend(a.Chart.prototype,{initAnnotation:function(b){var c=r.types[b.type]||r;b=a.merge(c.prototype.defaultOptions, b);c=new c(this,b);this.annotations.push(c);return c},addAnnotation:function(a,b){a=this.initAnnotation(a);this.options.annotations.push(a.options);v(b,!0)&&a.redraw();return a},removeAnnotation:function(a){var b=this.annotations,c=u(a)?x(b,function(b){return b.options.id===a}):a;c&&(q(this.options.annotations,c.options),q(b,c),c.destroy())},drawAnnotations:function(){this.plotBoxClip.attr(this.plotBox);this.annotations.forEach(function(a){a.redraw()})}});a.Chart.prototype.callbacks.push(function(a){a.annotations= [];a.options.annotations||(a.options.annotations=[]);a.plotBoxClip=this.renderer.clipRect(this.plotBox);a.controlPointsGroup=a.renderer.g("control-points").attr({zIndex:99}).clip(a.plotBoxClip).add();a.options.annotations.forEach(function(b,c){b=a.initAnnotation(b);a.options.annotations[c]=b.options});a.drawAnnotations();k(a,"redraw",a.drawAnnotations);k(a,"destroy",function(){a.plotBoxClip.destroy();a.controlPointsGroup.destroy()})})})(m,t,D,E,w,F,C,y,z,A);y=function(){return{initUpdate:function(a){a.navigation|| (a.navigation={updates:[],update:function(a,d){this.updates.forEach(function(b){b.update.call(b.context,a,d)})}})},addUpdate:function(a,e){e.navigation||this.initUpdate(e);e.navigation.updates.push({update:a,context:e})}}}();(function(a,e){function d(b){var c=b.prototype.defaultOptions.events&&b.prototype.defaultOptions.events.click;a.merge(!0,b.prototype.defaultOptions.events,{click:function(a){var b=this,d=b.chart.navigationBindings,g=d.activeAnnotation;c&&c.click.call(b,a);g!==b?(d.deselectAnnotation(), d.activeAnnotation=b,b.setControlPointsVisibility(!0),m(d,"showPopup",{annotation:b,formType:"annotation-toolbar",options:d.annotationToFields(b),onSubmit:function(a){var c={};"remove"===a.actionType?(d.activeAnnotation=!1,d.chart.removeAnnotation(b)):(d.fieldsToOptions(a.fields,c),d.deselectAnnotation(),a=c.typeOptions,"measure"===b.options.type&&(a.crosshairY.enabled=0!==a.crosshairY.strokeWidth,a.crosshairX.enabled=0!==a.crosshairX.strokeWidth),b.update(c))}})):(d.deselectAnnotation(),m(d,"closePopup")); a.activeAnnotation=!0}})}var b=a.doc,c=a.addEvent,f=a.pick,l=a.merge,h=a.extend,n=a.isNumber,m=a.fireEvent,g=a.isArray,k=a.isObject,p=a.objectEach;a.NavigationBindings=function(a,c){this.chart=a;this.options=c;this.eventsToUnbind=[];this.container=b.getElementsByClassName(this.options.bindingsClassName)};a.NavigationBindings.annotationsEditable={nestedOptions:{labelOptions:["style","format","backgroundColor"],labels:["style"],label:["style"],style:["fontSize","color"],background:["fill","strokeWidth", "stroke"],innerBackground:["fill","strokeWidth","stroke"],outerBackground:["fill","strokeWidth","stroke"],shapeOptions:["fill","strokeWidth","stroke"],shapes:["fill","strokeWidth","stroke"],line:["strokeWidth","stroke"],backgroundColors:[!0],connector:["fill","strokeWidth","stroke"],crosshairX:["strokeWidth","stroke"],crosshairY:["strokeWidth","stroke"]},circle:["shapes"],verticalLine:[],label:["labelOptions"],measure:["background","crosshairY","crosshairX"],fibonacci:[],tunnel:["background","line", "height"],pitchfork:["innerBackground","outerBackground"],rect:["shapes"],crookedLine:[]};a.NavigationBindings.annotationsNonEditable={rectangle:["crosshairX","crosshairY","label"]};h(a.NavigationBindings.prototype,{initEvents:function(){var a=this,b=a.chart,d=a.container,g=a.options;a.boundClassNames={};p(g.bindings,function(b){a.boundClassNames[b.className]=b});[].forEach.call(d,function(b){a.eventsToUnbind.push(c(b,"click",function(b){var c=a.getButtonEvents(d,b);c&&a.bindingsButtonClick(c.button, c.events,b)}))});p(g.events||{},function(b,d){a.eventsToUnbind.push(c(a,d,b))});a.eventsToUnbind.push(c(b.container,"click",function(c){!b.cancelClick&&b.isInsidePlot(c.chartX-b.plotLeft,c.chartY-b.plotTop)&&a.bindingsChartClick(this,c)}));a.eventsToUnbind.push(c(b.container,"mousemove",function(b){a.bindingsContainerMouseMove(this,b)}))},initUpdate:function(){var a=this;e.addUpdate(function(b){a.update(b)},this.chart)},bindingsButtonClick:function(a,b,c){var d=this.chart;this.selectedButtonElement&& (m(this,"deselectButton",{button:this.selectedButtonElement}),this.nextEvent&&(this.currentUserDetails&&"annotations"===this.currentUserDetails.coll&&d.removeAnnotation(this.currentUserDetails),this.mouseMoveEvent=this.nextEvent=!1));this.selectedButton=b;this.selectedButtonElement=a;m(this,"selectButton",{button:a});b.init&&b.init.call(this,a,c);(b.start||b.steps)&&d.renderer.boxWrapper.addClass("highcharts-draw-mode")},bindingsChartClick:function(a,b){a=this.selectedButton;var c=this.chart.renderer.boxWrapper; this.activeAnnotation&&!b.activeAnnotation&&b.target.parentNode&&!b.target.closest(".highcharts-popup")&&(m(this,"closePopup"),this.deselectAnnotation());a&&a.start&&(this.nextEvent?(this.nextEvent(b,this.currentUserDetails),this.steps&&(this.stepIndex++,a.steps[this.stepIndex]?this.mouseMoveEvent=this.nextEvent=a.steps[this.stepIndex]:(m(this,"deselectButton",{button:this.selectedButtonElement}),c.removeClass("highcharts-draw-mode"),a.end&&a.end.call(this,b,this.currentUserDetails),this.mouseMoveEvent= this.nextEvent=!1,this.selectedButton=null))):(this.currentUserDetails=a.start.call(this,b),a.steps?(this.stepIndex=0,this.steps=!0,this.mouseMoveEvent=this.nextEvent=a.steps[this.stepIndex]):(m(this,"deselectButton",{button:this.selectedButtonElement}),c.removeClass("highcharts-draw-mode"),this.steps=!1,this.selectedButton=null,a.end&&a.end.call(this,b,this.currentUserDetails))))},bindingsContainerMouseMove:function(a,b){this.mouseMoveEvent&&this.mouseMoveEvent(b,this.currentUserDetails)},fieldsToOptions:function(a, b){p(a,function(a,c){var d=parseFloat(a),g=c.split("."),k=b,e=g.length-1;!n(d)||a.match(/px/g)||c.match(/format/g)||(a=d);""!==a&&"undefined"!==a&&g.forEach(function(b,c){var d=f(g[c+1],"");e===c?k[b]=a:(k[b]||(k[b]=d.match(/\d/g)?[]:{}),k=k[b])})});return b},deselectAnnotation:function(){this.activeAnnotation&&(this.activeAnnotation.setControlPointsVisibility(!1),this.activeAnnotation=!1)},annotationToFields:function(b){function c(d,e,u,f){var v;u&&-1===n.indexOf(e)&&(0<=(u.indexOf&&u.indexOf(e))|| u[e]||!0===u)&&(g(d)?(f[e]=[],d.forEach(function(a,b){k(a)?(f[e][b]={},p(a,function(a,d){c(a,d,q[e],f[e][b])})):c(a,0,q[e],f[e])})):k(d)?(v={},g(f)?(f.push(v),v[e]={},v=v[e]):f[e]=v,p(d,function(a,b){c(a,b,0===e?u:q[e],v)})):"format"===e?f[e]=[a.format(d,b.labels[0].points[0]).toString(),"text"]:g(f)?f.push([d,h(d)]):f[e]=[d,h(d)])}var d=b.options,e=a.NavigationBindings.annotationsEditable,q=e.nestedOptions,h=this.utils.getFieldType,l=f(d.type,d.shapes&&d.shapes[0]&&d.shapes[0].type,d.labels&&d.labels[0]&& d.labels[0].itemType,"label"),n=a.NavigationBindings.annotationsNonEditable[d.langKey]||[],m={langKey:d.langKey,type:l};p(d,function(a,b){"typeOptions"===b?(m[b]={},p(d[b],function(a,d){c(a,d,q,m[b],!0)})):c(a,b,e[l],m)});return m},getClickedClassNames:function(b,c){var d=c.target;c=[];for(var g;d&&((g=a.attr(d,"class"))&&(c=c.concat(g.split(" ").map(function(a){return[a,d]}))),d=d.parentNode,d!==b););return c},getButtonEvents:function(a,b){var c=this,d;this.getClickedClassNames(a,b).forEach(function(a){c.boundClassNames[a[0]]&& !d&&(d={events:c.boundClassNames[a[0]],button:a[1]})});return d},update:function(a){this.options=l(!0,this.options,a);this.removeEvents();this.initEvents()},removeEvents:function(){this.eventsToUnbind.forEach(function(a){a()})},destroy:function(){this.removeEvents()},utils:{updateRectSize:function(a,b){var c=b.options.typeOptions,d=this.chart.xAxis[0].toValue(a.chartX);a=this.chart.yAxis[0].toValue(a.chartY);b.update({typeOptions:{background:{width:d-c.point.x,height:c.point.y-a}}})},getFieldType:function(a){return{string:"text", number:"number","boolean":"checkbox"}[typeof a]}}});a.Chart.prototype.initNavigationBindings=function(){var b=this.options;b&&b.navigation&&b.navigation.bindings&&(this.navigationBindings=new a.NavigationBindings(this,b.navigation),this.navigationBindings.initEvents(),this.navigationBindings.initUpdate())};c(a.Chart,"load",function(){this.initNavigationBindings()});c(a.Chart,"destroy",function(){this.navigationBindings&&this.navigationBindings.destroy()});c(a.NavigationBindings,"deselectButton",function(){this.selectedButtonElement= null});a.Annotation&&(d(a.Annotation),a.objectEach(a.Annotation.types,function(a){d(a)}));a.setOptions({lang:{navigation:{popup:{simpleShapes:"Simple shapes",lines:"Lines",circle:"Circle",rectangle:"Rectangle",label:"Label",shapeOptions:"Shape options",typeOptions:"Details",fill:"Fill",format:"Text",strokeWidth:"Line width",stroke:"Line color",title:"Title",name:"Name",labelOptions:"Label options",labels:"Labels",backgroundColor:"Background color",backgroundColors:"Background colors",borderColor:"Border color", borderRadius:"Border radius",borderWidth:"Border width",style:"Style",padding:"Padding",fontSize:"Font size",color:"Color",height:"Height",shapes:"Shape options"}}},navigation:{bindingsClassName:"highcharts-bindings-wrapper",bindings:{circleAnnotation:{className:"highcharts-circle-annotation",start:function(b){var c=this.chart.xAxis[0].toValue(b.chartX);b=this.chart.yAxis[0].toValue(b.chartY);return this.chart.addAnnotation({langKey:"circle",shapes:[{type:"circle",point:{xAxis:0,yAxis:0,x:c,y:b}, r:5,controlPoints:[{positioner:function(b){var c=a.Annotation.MockPoint.pointToPixels(b.points[0]);b=b.options.r;return{x:c.x+b*Math.cos(Math.PI/4)-this.graphic.width/2,y:c.y+b*Math.sin(Math.PI/4)-this.graphic.height/2}},events:{drag:function(a,b){var c=b.annotation;a=this.mouseMoveToTranslation(a);b.setRadius(Math.max(b.options.r+a.y/Math.sin(Math.PI/4),5));c.options.shapes[0]=c.userOptions.shapes[0]=b.options;b.redraw(!1)}}}]}]})},steps:[function(a,b){var c=b.options.shapes[0].point,d=this.chart.xAxis[0].toPixels(c.x), c=this.chart.yAxis[0].toPixels(c.y);b.update({shapes:[{r:Math.max(Math.sqrt(Math.pow(d-a.chartX,2)+Math.pow(c-a.chartY,2)),5)}]})}]},rectangleAnnotation:{className:"highcharts-rectangle-annotation",start:function(b){var c=this.chart.xAxis[0].toValue(b.chartX);b=this.chart.yAxis[0].toValue(b.chartY);return this.chart.addAnnotation({langKey:"rectangle",shapes:[{type:"rect",point:{x:c,y:b,xAxis:0,yAxis:0},width:5,height:5,controlPoints:[{positioner:function(b){var c=a.Annotation.MockPoint.pointToPixels(b.points[0]); return{x:c.x+b.options.width-4,y:c.y+b.options.height-4}},events:{drag:function(a,b){var c=b.annotation;a=this.mouseMoveToTranslation(a);b.options.width=Math.max(b.options.width+a.x,5);b.options.height=Math.max(b.options.height+a.y,5);c.options.shapes[0]=b.options;c.userOptions.shapes[0]=b.options;b.redraw(!1)}}}]}]})},steps:[function(a,b){var c=this.chart.yAxis[0],d=b.options.shapes[0].point,g=this.chart.xAxis[0].toPixels(d.x),c=c.toPixels(d.y);b.update({shapes:[{width:Math.max(a.chartX-g,5),height:Math.max(a.chartY- c,5),point:{x:d.x,y:d.y}}]})}]},labelAnnotation:{className:"highcharts-label-annotation",start:function(b){var c=this.chart.xAxis[0].toValue(b.chartX);b=this.chart.yAxis[0].toValue(b.chartY);this.chart.addAnnotation({langKey:"label",labelOptions:{format:"{y:.2f}"},labels:[{point:{x:c,y:b,xAxis:0,yAxis:0},controlPoints:[{symbol:"triangle-down",positioner:function(b){if(!b.graphic.placed)return{x:0,y:-9E7};b=a.Annotation.MockPoint.pointToPixels(b.points[0]);return{x:b.x-this.graphic.width/2,y:b.y-this.graphic.height/ 2}},events:{drag:function(a,b){a=this.mouseMoveToTranslation(a);b.translatePoint(a.x,a.y);b.annotation.labels[0].options=b.options;b.redraw(!1)}}},{symbol:"square",positioner:function(a){return a.graphic.placed?{x:a.graphic.alignAttr.x-this.graphic.width/2,y:a.graphic.alignAttr.y-this.graphic.height/2}:{x:0,y:-9E7}},events:{drag:function(a,b){a=this.mouseMoveToTranslation(a);b.translate(a.x,a.y);b.annotation.labels[0].options=b.options;b.redraw(!1)}}}],overflow:"none",crop:!0}]})}}},events:{}}})})(m, y);(function(a){var e=a.addEvent,d=a.createElement,b=a.objectEach,c=a.pick,f=a.wrap,l=a.isString,h=a.isObject,m=a.isArray,t=/\d/g;f(a.Pointer.prototype,"onContainerMouseDown",function(a,b){var c=b.target&&b.target.className;l(c)&&0<=c.indexOf("highcharts-popup-field")||a.apply(this,Array.prototype.slice.call(arguments,1))});a.Popup=function(a){this.init(a)};a.Popup.prototype={init:function(a){this.container=d("div",{className:"highcharts-popup"},null,a);this.lang=this.getLangpack();this.addCloseBtn()}, addCloseBtn:function(){var a=this,b;b=d("div",{className:"highcharts-popup-close"},null,this.container);["click","touchstart"].forEach(function(c){e(b,c,function(){a.closePopup()})})},addColsContainer:function(a){var b;b=d("div",{className:"highcharts-popup-lhs-col"},null,a);a=d("div",{className:"highcharts-popup-rhs-col"},null,a);d("div",{className:"highcharts-popup-rhs-col-wrapper"},null,a);return{lhsCol:b,rhsCol:a}},addInput:function(a,b,c,e){var g=a.split("."),g=g[g.length-1],k=this.lang;b="highcharts-"+ b+"-"+g;b.match(t)||d("label",{innerHTML:k[g]||g,htmlFor:b},null,c);d("input",{name:b,value:e[0],type:e[1],className:"highcharts-popup-field"},null,c).setAttribute("highcharts-data-name",a)},addButton:function(a,b,c,f,h){var g=this,k=this.closePopup,p=this.getFields,q;q=d("button",{innerHTML:b},null,a);["click","touchstart"].forEach(function(a){e(q,a,function(){k.call(g);return f(p(h,c))})});return q},getFields:function(a,b){var c=a.querySelectorAll("input"),d=a.querySelectorAll("#highcharts-select-series \x3e option:checked")[0]; a=a.querySelectorAll("#highcharts-select-volume \x3e option:checked")[0];var e,g,k;k={actionType:b,linkedTo:d&&d.getAttribute("value"),fields:{}};c.forEach(function(a){g=a.getAttribute("highcharts-data-name");(e=a.getAttribute("highcharts-data-series-id"))?k.seriesId=a.value:g?k.fields[g]=a.value:k.type=a.value});a&&(k.fields["params.volumeSeriesID"]=a.getAttribute("value"));return k},showPopup:function(){var a=this.container,b=a.querySelectorAll(".highcharts-popup-close")[0];a.innerHTML="";0<=a.className.indexOf("highcharts-annotation-toolbar")&& (a.classList.remove("highcharts-annotation-toolbar"),a.removeAttribute("style"));a.appendChild(b);a.style.display="block"},closePopup:function(){this.popup.container.style.display="none"},showForm:function(a,b,c,d){this.popup=b.navigationBindings.popup;this.showPopup();"indicators"===a&&this.indicators.addForm.call(this,b,c,d);"annotation-toolbar"===a&&this.annotations.addToolbar.call(this,b,c,d);"annotation-edit"===a&&this.annotations.addForm.call(this,b,c,d);"flag"===a&&this.annotations.addForm.call(this, b,c,d,!0)},getLangpack:function(){return a.getOptions().lang.navigation.popup},annotations:{addToolbar:function(a,b,e){var g=this,k=this.lang,f=this.popup.container,p=this.showForm,h;-1===f.className.indexOf("highcharts-annotation-toolbar")&&(f.className+=" highcharts-annotation-toolbar");f.style.top=a.plotTop+10+"px";d("span",{innerHTML:c(k[b.langKey]||b.langKey,b.shapes&&b.shapes[0].type)},null,f);h=this.addButton(f,k.removeButton||"remove","remove",e,f);h.className+=" highcharts-annotation-remove-button"; h=this.addButton(f,k.editButton||"edit","edit",function(){p.call(g,"annotation-edit",a,b,e)},f);h.className+=" highcharts-annotation-edit-button"},addForm:function(a,b,c,e){var g=this.popup.container,k=this.lang,f,h;d("h2",{innerHTML:k[b.langKey]||b.langKey,className:"highcharts-popup-main-title"},null,g);h=d("div",{className:"highcharts-popup-lhs-col highcharts-popup-lhs-full"},null,g);f=d("div",{className:"highcharts-popup-bottom-row"},null,g);this.annotations.addFormFields.call(this,h,a,"",b,[], !0);this.addButton(f,e?k.addButton||"add":k.saveButton||"save",e?"add":"save",c,g)},addFormFields:function(a,c,e,f,l,u){var g=this,k=this.annotations.addFormFields,p=this.addInput,q=this.lang,n,x;b(f,function(b,d){n=""!==e?e+"."+d:d;h(b)&&(!m(b)||m(b)&&h(b[0])?(x=q[d]||d,x.match(t)||l.push([!0,x,a]),k.call(g,a,c,n,b,l,!1)):l.push([g,n,"annotation",a,b]))});u&&(l=l.sort(function(a){return a[1].match(/format/g)?-1:1}),l.forEach(function(a){!0===a[0]?d("span",{className:"highcharts-annotation-title", innerHTML:a[1]},null,a[2]):p.apply(a[0],a.splice(1))}))}},indicators:{addForm:function(a,b,c){var d=this.indicators,e=this.lang,g;this.tabs.init.call(this,a);b=this.popup.container.querySelectorAll(".highcharts-tab-item-content");this.addColsContainer(b[0]);d.addIndicatorList.call(this,a,b[0],"add");g=b[0].querySelectorAll(".highcharts-popup-rhs-col")[0];this.addButton(g,e.addButton||"add","add",c,g);this.addColsContainer(b[1]);d.addIndicatorList.call(this,a,b[1],"edit");g=b[1].querySelectorAll(".highcharts-popup-rhs-col")[0]; this.addButton(g,e.saveButton||"save","edit",c,g);this.addButton(g,e.removeButton||"remove","remove",c,g)},addIndicatorList:function(c,k,f){var g=this,h=k.querySelectorAll(".highcharts-popup-lhs-col")[0];k=k.querySelectorAll(".highcharts-popup-rhs-col")[0];var p=a.getOptions(),l="edit"===f,m=l?c.series:p.plotOptions,n=this.indicators.addFormFields,t,r,w;r=d("ul",{className:"highcharts-indicator-list"},null,h);t=k.querySelectorAll(".highcharts-popup-rhs-col-wrapper")[0];b(m,function(a,b){var k=a.options; if(a.params||k&&k.params){var f=g.indicators.getNameType(a,b),h=f.type;w=d("li",{className:"highcharts-indicator-list",innerHTML:f.name},null,r);["click","touchstart"].forEach(function(b){e(w,b,function(){n.call(g,c,l?a:m[h],f.type,t);l&&a.options&&d("input",{type:"hidden",name:"highcharts-id-"+h,value:a.options.id},null,t).setAttribute("highcharts-data-series-id",a.options.id)})})}});0