!function(t){"use strict";var e=t.getOptions().plotOptions,i=t.seriesTypes,n=t.merge,a=function(){},o=t.each;e.funnel=n(e.pie,{center:["50%","50%"],width:"90%",neckWidth:"30%",height:"100%",neckHeight:"25%",dataLabels:{connectorWidth:1,connectorColor:"#606060"},size:!0,states:{select:{color:"#C0C0C0",borderColor:"#000000",shadow:!1}}}),i.funnel=t.extendClass(i.pie,{type:"funnel",animate:a,translate:function(){var t,e,i,n,s,r,h,l,c,p,d,u=function(t,e){return/%$/.test(t)?e*parseInt(t,10)/100:parseInt(t,10)},f=0,g=this.chart,b=g.plotWidth,w=g.plotHeight,y=0,C=this.options,L=C.center,k=u(L[0],b),W=u(L[0],w),v=u(C.width,b),A=u(C.height,w),H=u(C.neckWidth,b),P=u(C.neckHeight,w),X=A-P,m=this.data,T="left"===C.dataLabels.position?1:0;this.getWidthAt=e=function(t){return t>A-P||A===P?H:H+(A-P-t)/(A-P)*(v-H)},this.getX=function(t,i){return k+(i?-1:1)*(e(t)/2+C.dataLabels.distance)},this.center=[k,W,A],this.centerX=k,o(m,function(t){f+=t.y}),o(m,function(o){d=null,n=f?o.y/f:0,c=(r=W-A/2+y*A)+n*A,t=e(r),h=(s=k-t/2)+t,t=e(c),p=(l=k-t/2)+t,r>X?(s=l=k-H/2,h=p=k+H/2):c>X&&(d=c,t=e(X),p=(l=k-t/2)+t,c=X),i=["M",s,r,"L",h,r,p,c],d&&i.push(p,d,l,d),i.push(l,c,"Z"),o.shapeType="path",o.shapeArgs={d:i},o.percentage=100*n,o.plotX=k,o.plotY=(r+(d||c))/2,o.tooltipPos=[k,o.plotY],o.slice=a,o.half=T,y+=n}),this.setTooltipPoints()},drawPoints:function(){var t=this,e=t.options,i=t.chart.renderer;o(t.data,function(n){var a=n.graphic,o=n.shapeArgs;a?a.animate(o):n.graphic=i.path(o).attr({fill:n.color,stroke:e.borderColor,"stroke-width":e.borderWidth}).add(t.group)})},sortByAngle:a,drawDataLabels:function(){var t,e,n,a,o,s=this.data,r=this.options.dataLabels.distance,h=s.length;for(this.center[2]-=2*r;h--;)e=(t=(n=s[h]).half)?1:-1,o=n.plotY,a=this.getX(o,t),n.labelPos=[0,o,a+(r-5)*e,o,a+r*e,o,t?"right":"left",0];i.pie.prototype.drawDataLabels.call(this)}})}(Highcharts);