/*
 Highcharts JS v5.0.0 (2016-09-29)

 (c) 2009-2016 Torstein Honsi

 License: www.highcharts.com/license
*/
(function(p){"object"===typeof module&&module.exports?module.exports=p:p(Highcharts)})(function(p){(function(h){var q=h.defined,k=h.isNumber,p=h.inArray,v=h.isArray,w=h.merge,C=h.Chart,x=h.extend,D=h.each,r,E;E=["path","rect","circle"];r={top:0,left:0,center:.5,middle:.5,bottom:1,right:1};var F=function(){this.init.apply(this,arguments)};F.prototype={init:function(a,d){var c=d.shape&&d.shape.type;this.chart=a;var b,f;f={xAxis:0,yAxis:0,title:{style:{},text:"",x:0,y:0},shape:{params:{stroke:"#000000",
fill:"transparent",strokeWidth:2}}};b={circle:{params:{x:0,y:0}}};b[c]&&(f.shape=w(f.shape,b[c]));this.options=w({},f,d)},render:function(a){var d=this.chart,c=this.chart.renderer,b=this.group,f=this.title,e=this.shape,l=this.options,h=l.title,k=l.shape;b||(b=this.group=c.g());!e&&k&&-1!==p(k.type,E)&&(e=this.shape=c[l.shape.type](k.params),e.add(b));!f&&h&&(f=this.title=c.label(h),f.add(b));b.add(d.annotations.group);this.linkObjects();!1!==a&&this.redraw()},redraw:function(){var a=this.options,
d=this.chart,c=this.group,b=this.title,f=this.shape,e=this.linkedObject,l=d.xAxis[a.xAxis],d=d.yAxis[a.yAxis],y=a.width,z=a.height,A=r[a.anchorY],B=r[a.anchorX],t,m,g,u;e&&(t=e instanceof h.Point?"point":e instanceof h.Series?"series":null,"point"===t?(a.xValue=e.x,a.yValue=e.y,m=e.series):"series"===t&&(m=e),c.visibility!==m.group.visibility&&c.attr({visibility:m.group.visibility}));e=q(a.xValue)?l.toPixels(a.xValue+l.minPointOffset)-l.minPixelPadding:a.x;m=q(a.yValue)?d.toPixels(a.yValue):a.y;if(k(e)&&
k(m)){b&&(b.attr(a.title),b.css(a.title.style));if(f){b=x({},a.shape.params);if("values"===a.units){for(g in b)-1<p(g,["width","x"])?b[g]=l.translate(b[g]):-1<p(g,["height","y"])&&(b[g]=d.translate(b[g]));b.width&&(b.width-=l.toPixels(0)-l.left);b.x&&(b.x+=l.minPixelPadding);if("path"===a.shape.type){g=b.d;t=e;for(var v=m,w=g.length,n=0;n<w;)k(g[n])&&k(g[n+1])?(g[n]=l.toPixels(g[n])-t,g[n+1]=d.toPixels(g[n+1])-v,n+=2):n+=1}}"circle"===a.shape.type&&(b.x+=b.r,b.y+=b.r);f.attr(b)}c.bBox=null;k(y)||
(u=c.getBBox(),y=u.width);k(z)||(u||(u=c.getBBox()),z=u.height);k(B)||(B=r.center);k(A)||(A=r.center);e-=y*B;m-=z*A;q(c.translateX)&&q(c.translateY)?c.animate({translateX:e,translateY:m}):c.translate(e,m)}},destroy:function(){var a=this,d=this.chart.annotations.allItems,c=d.indexOf(a);-1<c&&d.splice(c,1);D(["title","shape","group"],function(b){a[b]&&(a[b].destroy(),a[b]=null)});a.group=a.title=a.shape=a.chart=a.options=null},update:function(a,d){x(this.options,a);this.linkObjects();this.render(d)},
linkObjects:function(){var a=this.chart,d=this.linkedObject,c=d&&(d.id||d.options.id),b=this.options.linkedTo;q(b)?q(d)&&b===c||(this.linkedObject=a.get(b)):this.linkedObject=null}};x(C.prototype,{annotations:{add:function(a,d){var c=this.allItems,b=this.chart,f,e;v(a)||(a=[a]);for(e=a.length;e--;)f=new F(b,a[e]),c.push(f),f.render(d)},redraw:function(){D(this.allItems,function(a){a.redraw()})}}});C.prototype.callbacks.push(function(a){var d=a.options.annotations,c;c=a.renderer.g("annotations");c.attr({zIndex:7});
c.add();a.annotations.allItems=[];a.annotations.chart=a;a.annotations.group=c;v(d)&&0<d.length&&a.annotations.add(a.options.annotations);h.addEvent(a,"redraw",function(){a.annotations.redraw()})})})(p)});
