/** * Highcharts JS v11.2.0 (2023-10-30) * * Highcharts funnel module * * (c) 2010-2021 Torstein Honsi * * License: www.highcharts.com/license */!function(t){"object"==typeof module&&module.exports?(t.default=t,module.exports=t):"function"==typeof define&&define.amd?define("highcharts/modules/funnel",["highcharts"],function(e){return t(e),t.Highcharts=e,t}):t("undefined"!=typeof Highcharts?Highcharts:void 0)}(function(t){"use strict";var e=t?t._modules:{};function i(t,e,i,s){t.hasOwnProperty(e)||(t[e]=s.apply(null,i),"function"==typeof CustomEvent&&window.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:e,module:t[e]}})))}i(e,"Series/Funnel/FunnelSeriesDefaults.js",[],function(){return{animation:!1,borderRadius:0,center:["50%","50%"],width:"90%",neckWidth:"30%",height:"100%",neckHeight:"25%",reversed:!1,size:!0,dataLabels:{connectorWidth:1,verticalAlign:"middle"},states:{select:{color:"#cccccc",borderColor:"#000000"}}}}),i(e,"Series/Funnel/FunnelSeries.js",[e["Series/Funnel/FunnelSeriesDefaults.js"],e["Core/Globals.js"],e["Extensions/BorderRadius.js"],e["Core/Series/SeriesRegistry.js"],e["Core/Utilities.js"]],function(t,e,i,s,n){let{noop:a}=e,{column:d,pie:o}=s.seriesTypes,{addEvent:l,extend:r,fireEvent:h,isArray:u,merge:p,pick:c,pushUnique:g,relativeLength:y,splat:f}=n,x=s.series.prototype.alignDataLabel;function b(t,e){return/%$/.test(t)?e*parseInt(t,10)/100:parseInt(t,10)}class m extends o{constructor(){super(...arguments),this.data=void 0,this.options=void 0,this.points=void 0}alignDataLabel(t,e,i,s,n){let a=t.series,d=a.options.reversed,o=t.dlBox||t.shapeArgs,l=i.align,r=i.verticalAlign,h=((a.options||{}).dataLabels||{}).inside,u=a.center[1],p=d?2*u-t.plotY:t.plotY,g=a.getWidthAt(p-o.height/2+e.height),y="middle"===r?(o.topWidth-o.bottomWidth)/4:(g-o.bottomWidth)/2,f=o.y,b=o.x,m=c(e.height,e.getBBox().height);"middle"===r?f=o.y-o.height/2+m/2:"top"===r&&(f=o.y-o.height+m+(i.padding||0)),("top"===r&&!d||"bottom"===r&&d||"middle"===r)&&("right"===l?b=o.x-i.padding+y:"left"===l&&(b=o.x+i.padding-y)),s={x:b,y:d?f-o.height:f,width:o.bottomWidth,height:o.height},i.verticalAlign="bottom",(!h||t.visible)&&x.call(a,t,e,i,s,n),h&&(!t.visible&&t.dataLabel&&(t.dataLabel.placed=!1),t.contrastColor&&e.css({color:t.contrastColor}))}drawDataLabels(){(f(this.options.dataLabels)[0].inside?d:o).prototype.drawDataLabels.call(this)}getDataLabelPosition(t,e){let i=t.plotY||0,s=t.half?1:-1,n=this.getX(i,!!t.half,t);return{distance:e,natural:{x:0,y:i},computed:{},alignment:t.half?"right":"left",connectorPosition:{breakAt:{x:n+(e-5)*s,y:i},touchingSliceAt:{x:n+e*s,y:i}}}}translate(){let t=this,e=t.chart,s=t.options,n=s.reversed,d=s.ignoreHiddenPoint,o=i.optionsToObject(s.borderRadius),l=e.plotWidth,r=e.plotHeight,u=s.center,p=b(u[0],l),g=b(u[1],r),f=b(s.width,l),x=b(s.height,r),m=b(s.neckWidth,l),L=b(s.neckHeight,r),v=g-x/2+x-L,S=t.data,C=y(o.radius,f),M=o.scope,j="left"===s.dataLabels.position?1:0,P=t=>{let e=Math.tan(t/2),i=Math.cos(F),s=Math.sin(F),a=C,d=a/e,o=Math.tan((Math.PI-t)/3.2104);return d>H&&(a=(d=H)*e),{dx:[d*i,(d-(o*=a))*i,d-o,d],dy:[d*s,(d-o)*s,d-o,d].map(t=>n?-t:t)}},W=0,A=0,D,k,w,F,H,I,O,Y,B,T,R,E;for(let e of(t.getWidthAt=function(t){let e=g-x/2;return t>v||x===L?m:m+(f-m)*(1-(t-e)/(x-L))},t.getX=function(e,i,s){return p+(i?-1:1)*(t.getWidthAt(n?2*g-e:e)/2+(s.dataLabel?.dataLabelPosition?.distance??y(this.options.dataLabels?.distance||0,f)))},t.center=[p,g,x],t.centerX=p,S))e.y&&e.isValid()&&(!d||!1!==e.visible)&&(W+=e.y);for(let e of S){if(E=null,w=W?e.y/W:0,T=(O=g-x/2+A*x)+w*x,Y=(I=p-(D=t.getWidthAt(O))/2)+D,R=(B=p-(D=t.getWidthAt(T))/2)+D,O>v?(I=B=p-m/2,Y=R=p+m/2):T>v&&(E=T,R=(B=p-(D=t.getWidthAt(v))/2)+D,T=v),n&&(O=2*g-O,T=2*g-T,null!==E&&(E=2*g-E)),C&&("point"===M||0===e.index||e.index===S.length-1||null!==E)){let t=Math.abs(T-O),i=Y-R,s=R-B,n=Math.sqrt(i*i+t*t);F=Math.atan(t/i),H=n/2,null!==E&&(H=Math.min(H,Math.abs(E-T)/2)),s>=1&&(H=Math.min(H,s/2));let a=P(F);if(k="stack"===M&&0!==e.index?[["M",I,O],["L",Y,O]]:[["M",I+a.dx[0],O+a.dy[0]],["C",I+a.dx[1],O+a.dy[1],I+a.dx[2],O,I+a.dx[3],O],["L",Y-a.dx[3],O],["C",Y-a.dx[2],O,Y-a.dx[1],O+a.dy[1],Y-a.dx[0],O+a.dy[0]]],null!==E){let t=P(Math.PI/2);a=P(Math.PI/2+F),k.push(["L",R+a.dx[0],T-a.dy[0]],["C",R+a.dx[1],T-a.dy[1],R,T+a.dy[2],R,T+a.dy[3]]),"stack"===M&&e.index!==S.length-1?k.push(["L",R,E],["L",B,E]):k.push(["L",R,E-t.dy[3]],["C",R,E-t.dy[2],R-t.dx[2],E,R-t.dx[3],E],["L",B+t.dx[3],E],["C",B+t.dx[2],E,B,E-t.dy[2],B,E-t.dy[3]]),k.push(["L",B,T+a.dy[3]],["C",B,T+a.dy[2],B-a.dx[1],T-a.dy[1],B-a.dx[0],T-a.dy[0]])}else s>=1?(a=P(Math.PI-F),"stack"===M&&0===e.index?k.push(["L",R,T],["L",B,T]):k.push(["L",R+a.dx[0],T-a.dy[0]],["C",R+a.dx[1],T-a.dy[1],R-a.dx[2],T,R-a.dx[3],T],["L",B+a.dx[3],T],["C",B+a.dx[2],T,B-a.dx[1],T-a.dy[1],B-a.dx[0],T-a.dy[0]])):(a=P(Math.PI-2*F),k.push(["L",B+a.dx[0],T-a.dy[0]],["C",B+a.dx[1],T-a.dy[1],B-a.dx[1],T-a.dy[1],B-a.dx[0],T-a.dy[0]]))}else k=[["M",I,O],["L",Y,O],["L",R,T]],null!==E&&k.push(["L",R,E],["L",B,E]),k.push(["L",B,T]);k.push(["Z"]),e.shapeType="path",e.shapeArgs={d:k},e.percentage=100*w,e.plotX=p,e.plotY=(O+(E||T))/2,e.tooltipPos=[p,e.plotY],e.dlBox={x:B,y:O,topWidth:Y-I,bottomWidth:R-B,height:Math.abs(c(E,T)-O),width:NaN},e.slice=a,e.half=j,e.isValid()&&(!d||!1!==e.visible)&&(A+=w)}h(t,"afterTranslate")}sortByAngle(t){t.sort((t,e)=>t.plotY-e.plotY)}}return m.defaultOptions=p(o.defaultOptions,t),r(m.prototype,{animate:a}),function(t){let e=[];function i(){for(let t of this.series){let e=t.options&&t.options.dataLabels;u(e)&&(e=e[0]),t.is("pie")&&t.placeDataLabels&&e&&!e.inside&&t.placeDataLabels()}}t.compose=function(t){g(e,t)&&l(t,"afterHideAllOverlappingLabels",i)}}(m||(m={})),s.registerSeriesType("funnel",m),m}),i(e,"Series/Pyramid/PyramidSeriesDefaults.js",[],function(){return{neckWidth:"0%",neckHeight:"0%",reversed:!0}}),i(e,"Series/Pyramid/PyramidSeries.js",[e["Series/Funnel/FunnelSeries.js"],e["Series/Pyramid/PyramidSeriesDefaults.js"],e["Core/Series/SeriesRegistry.js"],e["Core/Utilities.js"]],function(t,e,i,s){let{merge:n}=s;class a extends t{constructor(){super(...arguments),this.data=void 0,this.options=void 0,this.points=void 0}}return a.defaultOptions=n(t.defaultOptions,e),i.registerSeriesType("pyramid",a),a}),i(e,"masters/modules/funnel.src.js",[e["Core/Globals.js"],e["Series/Funnel/FunnelSeries.js"]],function(t,e){e.compose(t.Chart)})});//# sourceMappingURL=funnel.js.map