!/**
 * Highcharts JS v13.0.0 (2026-06-11)
 * @module highcharts/modules/dependency-wheel
 * @requires highcharts
 * @requires highcharts/modules/sankey
 *
 * Dependency wheel module
 *
 * (c) 2010-2026 Highsoft AS
 * Author: Torstein Hønsi
 *
 * A commercial license may be required depending on use,
 * see www.highcharts.com/license
 */function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(t._Highcharts,t._Highcharts.SeriesRegistry,t._Highcharts.SVGElement):"function"==typeof define&&define.amd?define("highcharts/modules/dependency-wheel",["highcharts/highcharts"],function(t){return e(t,t.SeriesRegistry,t.SVGElement)}):"object"==typeof exports?exports["highcharts/modules/dependency-wheel"]=e(t._Highcharts,t._Highcharts.SeriesRegistry,t._Highcharts.SVGElement):t.Highcharts=e(t.Highcharts,t.Highcharts.SeriesRegistry,t.Highcharts.SVGElement)}("u"<typeof window?this:window,(t,e,a)=>(()=>{"use strict";var r,i,o={28:t=>{t.exports=a},512:t=>{t.exports=e},944:e=>{e.exports=t}},n={};function s(t){var e=n[t];if(void 0!==e)return e.exports;var a=n[t]={exports:{}};return o[t](a,a.exports,s),a.exports}s.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return s.d(e,{a:e}),e},s.d=(t,e)=>{for(var a in e)s.o(e,a)&&!s.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:e[a]})},s.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var h={};s.d(h,{default:()=>S});var l=s(944),d=s.n(l),p=s(512),c=s.n(p);let{sankey:{prototype:{pointClass:g}}}=c().seriesTypes,u=class extends g{getSumTo(){let t=0;for(let e of this.linksFrom)t+=e.weightTo||e.weight||0;for(let e of this.linksTo)t+=e.weight||0;return t}getDataLabelPath(t){let e=this,a=e.series.chart.renderer,r=e.shapeArgs,i=e.angle<0||e.angle>Math.PI,o=r.start||0,n=r.end||0;return e.dataLabelPath?(e.dataLabelPath=e.dataLabelPath.destroy(),delete e.dataLabelPath):(0,l.wrap)(t,"destroy",function(t){return e.dataLabelPath&&(e.dataLabelPath=e.dataLabelPath.destroy()),t.call(this)}),e.dataLabelPath=a.arc({open:!0,longArc:Math.abs(Math.abs(o)-Math.abs(n))<Math.PI?0:1}).attr({x:r.x,y:r.y,r:(r.r||0)+(0,l.pInt)(t.options?.distance||0),start:i?o:n,end:i?n:o,clockwise:+i}).add(a.defs),e.dataLabelPath}isValid(){return!0}};var f=i||(i={});f.compose=function(t,e){return t.sankeyColumn=new m(t,e),t};class m{constructor(t,e){this.points=t,this.series=e}getTranslationFactor(t){let e=this.points,a=e.slice(),r=t.chart,i=t.options.minLinkWidth||0,o,n=0,s,h=(r.plotSizeY||0)-(t.options.borderWidth||0)-(e.length-1)*t.nodePadding;for(;e.length;){for(n=h/e.sankeyColumn.sum(),o=!1,s=e.length;s--;)e[s].getSum()*n<i&&(e.splice(s,1),h=Math.max(0,h-i),o=!0);if(!o)break}for(let t of(e.length=0,a))e.push(t);return n}top(t){let e=this.series,a=e.nodePadding,r=this.points.reduce((r,i)=>(r>0&&(r+=a),r+=Math.max(i.getSum()*t,e.options.minLinkWidth||0)),0);return(0,l.getAlignFactor)(e.options.nodeAlignment||"center")*((e.chart.plotSizeY||0)-r)}left(t){let e=this.series,a=e.chart,r=e.options.equalNodes,i=a.inverted?a.plotHeight:a.plotWidth,o=e.nodePadding,n=this.points.reduce((a,n)=>(a>0&&(a+=o),a+=r?i/n.series.nodes.length-o:Math.max(n.getSum()*t,e.options.minLinkWidth||0)),0);return((a.plotSizeX||0)-Math.round(n))/2}sum(){return this.points.reduce((t,e)=>t+e.getSum(),0)}offset(t,e){let a=this.points,r=this.series,i=r.nodePadding,o=0,n;if(r.is("organization")&&t.hangsFrom)return{absoluteTop:t.hangsFrom.nodeY};for(let s=0;s<a.length;s++){let h=a[s].getSum(),d=Math.max(h*e,r.options.minLinkWidth||0),p=t.options[r.chart.inverted?"offsetHorizontal":"offsetVertical"],c=t.options.offset||0;if(n=h?d+i:0,a[s]===t)return{relativeTop:o+((0,l.defined)(p)?(0,l.relativeLength)(p,d):(0,l.relativeLength)(c,n))};o+=n}}}f.SankeyColumnAdditions=m;let y=i;var x=s(28),b=s.n(x);let{composed:P,deg2rad:T}=d(),{animObject:k}=d(),{deg2rad:M}=d(),{pie:w,sankey:L}=c().seriesTypes;r=b(),(0,l.pushUnique)(P,"TextPath")&&((0,l.addEvent)(r,"afterGetBBox",function(t){let e=t.bBox,a=this.element?.querySelector("textPath");if(a){let t=[],{b:r,h:i}=this.renderer.fontMetrics(this.element),o=i-r,n=RegExp('(<tspan>|<tspan(?!\\sclass="highcharts-br")[^>]*>|<\\/tspan>)',"g"),s=a.innerHTML.replace(n,"").split(/<tspan class="highcharts-br"[^>]*>/),h=s.length,l=(t,e)=>{let{x:i,y:n}=e,s=(a.getRotationOfChar(t)-90)*T,h=Math.cos(s),l=Math.sin(s);return[[i-o*h,n-o*l],[i+r*h,n+r*l]]};for(let e=0,r=0;r<h;r++){let i=s[r].length;for(let o=0;o<i;o+=5)try{let i=e+o+r,[n,s]=l(i,a.getStartPositionOfChar(i));0===o?(t.push(s),t.push(n)):(0===r&&t.unshift(s),r===h-1&&t.push(n))}catch{break}e+=i-1;try{let i=e+r,o=a.getEndPositionOfChar(i),[n,s]=l(i,o);t.unshift(s),t.unshift(n)}catch{break}}t.length&&t.push(t[0].slice()),e.polygon=t}return e}),(0,l.addEvent)(r,"beforeAddingDataLabel",function(t){let e=t.labelOptions,a=t.point,r=e[a.formatPrefix+"TextPath"]||e.textPath;r&&!e.useHTML&&(this.setTextPath(a.getDataLabelPath?.(this)||a.graphic,r),a.dataLabelPath&&!r.enabled&&(a.dataLabelPath=a.dataLabelPath.destroy()))}),r.prototype.setTextPath=r.prototype.setTextPath??function(t,e){let a=this.renderer.url,r=this.text||this,i=r.textPath,{attributes:o,enabled:n}=(0,l.merge)({enabled:!0,attributes:{dy:-5,startOffset:"50%",textAnchor:"middle"}},e);if(t=t||i&&i.path,i?.undo(),t&&n){let e=(0,l.addEvent)(r,"afterModifyTree",e=>{if(t&&n){let i=t.attr("id");i||t.attr("id",i=(0,l.uniqueKey)());let n={x:0,y:0};(0,l.defined)(o.dx)&&(n.dx=o.dx,delete o.dx),(0,l.defined)(o.dy)&&(n.dy=o.dy,delete o.dy),r.attr(n),this.attr({transform:""}),this.box&&(this.box=this.box.destroy());let s=e.nodes.slice(0);e.nodes.length=0,e.nodes[0]={tagName:"textPath",attributes:(0,l.extend)(o,{"text-anchor":o.textAnchor,href:`${a}#${i}`}),children:s}}});r.textPath={path:t,undo:e}}else r.attr({dx:0,dy:0}),delete r.textPath;return this.added&&(r.textCache="",this.renderer.buildText(r)),this});class v extends L{animate(t){if(!t){let t=k(this.options.animation).duration/2/this.nodes.length,e=0;for(let a of this.nodes){let r=a.graphic;r&&(r.attr({opacity:0}),setTimeout(()=>{a.graphic&&a.graphic.animate({opacity:1},{duration:t})},t*e++))}for(let t of this.points){let e=t.graphic;!t.isNode&&e&&e.attr({opacity:0}).animate({opacity:1},this.options.animation)}}}createNode(t){let e=super.createNode(t);return e.getSum=()=>{let t=0;for(let a of e.linksFrom)t+=a.weight||0;for(let a of e.linksTo)t+=a.weightTo||a.weight||0;return t},e.offset=t=>{let a=t=>t.fromNode===e?t.toNode:t.fromNode,r=0,i=e.linksFrom.concat(e.linksTo),o;i.sort((t,e)=>a(t).index-a(e).index);for(let t=0;t<i.length;t++)if(a(i[t]).index>e.index){i=i.slice(0,t).reverse().concat(i.slice(t).reverse()),o=!0;break}o||i.reverse();for(let a=0;a<i.length;a++){if(i[a]===t)return r;let o=i[a].weight||0;r+=i[a].to===e.id&&i[a].weightTo||o}},e}createNodeColumns(){let t=[y.compose([],this)];for(let e of this.nodes)e.column=0,t[0].push(e);return t}getNodePadding(){return this.options.nodePadding/Math.PI}translate(){let t=this.options,e=2*Math.PI/(this.chart.plotHeight+this.getNodePadding()),a=this.getCenter(),r=((t.startAngle||0)-90)*M,i=t.borderRadius,o="object"==typeof i?i.radius:i;for(let i of(super.translate(),this.nodeColumns[0]))if(i.sum){let n=i.shapeArgs,s=a[0],h=a[1],d=a[2]/2,p="auto"===t.nodeWidth?20:t.nodeWidth,c=d-(0,l.relativeLength)(p||0,d),g=r+e*(n.y||0),u=r+e*((n.y||0)+(n.height||0));for(let a of(i.angle=g+(u-g)/2,i.shapeType="arc",i.shapeArgs={x:s,y:h,r:d,innerR:c,start:g,end:u,borderRadius:o},i.dlBox={x:s+Math.cos((g+u)/2)*(d+c)/2,y:h+Math.sin((g+u)/2)*(d+c)/2,width:1,height:1},i.linksFrom))if(a.linkBase){let i,o,n=a.linkBase.map((n,l)=>{let d=e*n,p=Math.cos(r+d)*(c+1),g=Math.sin(r+d)*(c+1);return i=t.curveFactor||0,(o=Math.abs(a.linkBase[3-l]*e-d))>Math.PI&&(o=2*Math.PI-o),(o*=c)<c&&(i*=o/c),{x:s+p,y:h+g,cpX:s+(1-i)*p,cpY:h+(1-i)*g}});a.shapeArgs={d:[["M",n[0].x,n[0].y],["A",c,c,0,0,1,n[1].x,n[1].y],["C",n[1].cpX,n[1].cpY,n[2].cpX,n[2].cpY,n[2].x,n[2].y],["A",c,c,0,0,1,n[3].x,n[3].y],["C",n[3].cpX,n[3].cpY,n[0].cpX,n[0].cpY,n[0].x,n[0].y]]}}}}translateLink(t){let e=Math.max((t.weightTo||t.weight||0)*this.translationFactor,this.options.minLinkWidth||0),a=this.getY(t,t.toNode,"linksTo",e);super.translateLink(t,a),t.linkBase[3]=a+e}translateNode(t,e){super.translateNode(t,e),t.sumTo=t.getSumTo()}}v.defaultOptions=(0,l.merge)(L.defaultOptions,{center:[null,null],curveFactor:.6,startAngle:0,dataLabels:{allowOverlap:!0,textPath:{enabled:!1,attributes:{dy:5}}},tooltip:{pointFormat:"{point.fromNode.name} → {point.toNode.name}: <b>{point.weight}</b><br/>{#if point.weightTo}{point.toNode.name} → {point.fromNode.name}: <b>{point.weightTo}</b><br/>{/if}"}}),(0,l.extend)(v.prototype,{orderNodes:!1,pointArrayMap:["from","to","weight","weightTo"],getCenter:w.prototype.getCenter}),v.prototype.pointClass=u,c().registerSeriesType("dependencywheel",v);let S=d();return h.default})());