/**
 * Highcharts JS v11.3.0 (2024-01-10)
 *
 * Variable Pie module for Highcharts
 *
 * (c) 2010-2024 Grzegorz Blachliński
 *
 * 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/variable-pie",["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,a){t.hasOwnProperty(e)||(t[e]=a.apply(null,i),"function"==typeof CustomEvent&&window.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:e,module:t[e]}})))}i(e,"Series/VariablePie/VariablePieSeriesDefaults.js",[],function(){return{minPointSize:"10%",maxPointSize:"100%",zMin:void 0,zMax:void 0,sizeBy:"area",tooltip:{pointFormat:'<span style="color:{point.color}">●</span> {series.name}<br/>Value: {point.y}<br/>Size: {point.z}<br/>'}}}),i(e,"Series/VariablePie/VariablePieSeries.js",[e["Core/Series/SeriesRegistry.js"],e["Core/Utilities.js"],e["Series/VariablePie/VariablePieSeriesDefaults.js"]],function(t,e,i){let{pie:a}=t.seriesTypes,{arrayMax:s,arrayMin:n,clamp:r,extend:o,fireEvent:l,merge:h,pick:d}=e;class u extends a{calculateExtremes(){let t,e;let i=this.chart,a=i.plotWidth,o=i.plotHeight,l=this.options,h=2*(l.slicedOffset||0),u=this.zData,c=Math.min(a,o)-h,p={},f=this.center||this.getCenter();for(let t of["minPointSize","maxPointSize"]){let e=l[t],i=/%$/.test(e);e=parseInt(e,10),p[t]=i?c*e/100:2*e}this.minPxSize=f[3]+p.minPointSize,this.maxPxSize=r(f[2],f[3]+p.minPointSize,p.maxPointSize),u.length&&(t=d(l.zMin,n(u.filter(this.zValEval))),e=d(l.zMax,s(u.filter(this.zValEval))),this.getRadii(t,e,this.minPxSize,this.maxPxSize))}getRadii(t,e,i,a){let s,n,r;let o=this.zData,l=[],h=this.options,d="radius"!==h.sizeBy,u=e-t;for(let h=0;h<o.length;h++)(n=this.zValEval(o[h])?o[h]:t)<=t?r=i/2:n>=e?r=a/2:(s=u>0?(n-t)/u:.5,d&&(s=Math.sqrt(s)),r=Math.ceil(i+s*(a-i))/2),l.push(r);this.radii=l}redraw(){this.center=null,super.redraw()}getDataLabelPosition(t,e){let{center:i,options:a}=this,s=t.angle||0,n=this.radii[t.index],r=i[0]+Math.cos(s)*n,o=i[1]+Math.sin(s)*n,l=(a.slicedOffset||0)+(a.borderWidth||0),h=Math.min(l,e/5);return{distance:e,natural:{x:r+Math.cos(s)*e,y:o+Math.sin(s)*e},computed:{},alignment:t.half?"right":"left",connectorPosition:{breakAt:{x:r+Math.cos(s)*h,y:o+Math.sin(s)*h},touchingSliceAt:{x:r,y:o}}}}translate(t){this.generatePoints();let e=this.options,i=e.slicedOffset,a=e.startAngle||0,s=Math.PI/180*(a-90),n=Math.PI/180*(d(e.endAngle,a+360)-90),r=n-s,o=this.points,h=e.ignoreHiddenPoint,u=0,c,p,f,M,m,P,g;this.startAngleRad=s,this.endAngleRad=n,this.calculateExtremes(),t||(this.center=t=this.getCenter());for(let e=0;e<o.length;e++)P=o[e],g=this.radii[e],c=s+u*r,(!h||P.visible)&&(u+=P.percentage/100),p=s+u*r,P.shapeType="arc",P.shapeArgs={x:t[0],y:t[1],r:g,innerR:t[3]/2,start:Math.round(1e3*c)/1e3,end:Math.round(1e3*p)/1e3},(f=(p+c)/2)>1.5*Math.PI?f-=2*Math.PI:f<-Math.PI/2&&(f+=2*Math.PI),P.slicedTranslation={translateX:Math.round(Math.cos(f)*i),translateY:Math.round(Math.sin(f)*i)},M=Math.cos(f)*t[2]/2,m=Math.sin(f)*t[2]/2,P.tooltipPos=[t[0]+.7*M,t[1]+.7*m],P.half=f<-Math.PI/2||f>Math.PI/2?1:0,P.angle=f;l(this,"afterTranslate")}zValEval(t){return!("number"!=typeof t||isNaN(t))||null}}return u.defaultOptions=h(a.defaultOptions,i),o(u.prototype,{pointArrayMap:["y","z"],parallelArrays:["x","y","z"]}),t.registerSeriesType("variablepie",u),u}),i(e,"masters/modules/variable-pie.src.js",[],function(){})});