!/**
 * Highcharts Gantt JS v12.5.0 (2026-01-12)
 * @module highcharts/modules/pathfinder
 * @requires highcharts
 *
 * Pathfinder
 *
 * (c) 2016-2026 Highsoft AS
 * Author: Øystein Moseng
 *
 * A commercial license may be required depending on use.
 * See www.highcharts.com/license
 */function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n(require("highcharts"),require("highcharts").Point):"function"==typeof define&&define.amd?define("highcharts/modules/pathfinder",[["highcharts/highcharts"],["highcharts/highcharts","Point"]],n):"object"==typeof exports?exports["highcharts/modules/pathfinder"]=n(require("highcharts"),require("highcharts").Point):t.Highcharts=n(t.Highcharts,t.Highcharts.Point)}(this,function(t,n){return function(){"use strict";var r,i={260:function(t){t.exports=n},944:function(n){n.exports=t}},e={};function a(t){var n=e[t];if(void 0!==n)return n.exports;var r=e[t]={exports:{}};return i[t](r,r.exports,a),r.exports}a.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return a.d(n,{a:n}),n},a.d=function(t,n){for(var r in n)a.o(n,r)&&!a.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},a.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)};var o={};a.d(o,{default:function(){return F}});var s=a(944),h=a.n(s),c=h().defined,x=h().error,M=h().merge,p=h().objectEach,d=h().deg2rad,y=Math.max,f=Math.min,l=function(){function t(t,n,r){this.init(t,n,r)}return t.prototype.init=function(t,n,r){this.fromPoint=t,this.toPoint=n,this.options=r,this.chart=t.series.chart,this.pathfinder=this.chart.pathfinder},t.prototype.renderPath=function(t,n){var r=this.chart,i=r.styledMode,e=this.pathfinder,a={},o=this.graphics&&this.graphics.path;e.group||(e.group=r.renderer.g().addClass("highcharts-pathfinder-group").attr({zIndex:-1}).add(r.seriesGroup)),e.group.translate(r.plotLeft,r.plotTop),!(o&&o.renderer)&&(o=r.renderer.path().add(e.group),i||o.attr({opacity:0})),o.attr(n),a.d=t,i||(a.opacity=1),o.animate(a),this.graphics=this.graphics||{},this.graphics.path=o},t.prototype.addMarker=function(t,n,r){var i,e,a,o,s,h,c,x=this.fromPoint.series.chart,M=x.pathfinder,p=x.renderer,y="start"===t?this.fromPoint:this.toPoint,f=y.getPathfinderAnchorPoint(n);n.enabled&&((c="start"===t?r[1]:r[r.length-2])&&"M"===c[0]||"L"===c[0])&&(h={x:c[1],y:c[2]},e=y.getRadiansToVector(h,f),i=y.getMarkerVector(e,n.radius,f),n.width&&n.height?(o=n.width,s=n.height):o=s=2*n.radius,this.graphics=this.graphics||{},a={x:i.x-o/2,y:i.y-s/2,width:o,height:s,rotation:-e/d,rotationOriginX:i.x,rotationOriginY:i.y},this.graphics[t]?this.graphics[t].animate(a):(this.graphics[t]=p.symbol(n.symbol).addClass("highcharts-point-connecting-path-"+t+"-marker highcharts-color-"+this.fromPoint.colorIndex).attr(a).add(M.group),p.styledMode||this.graphics[t].attr({fill:n.color||this.fromPoint.color,stroke:n.lineColor,"stroke-width":n.lineWidth,opacity:0}).animate({opacity:1},y.series.options.animation)))},t.prototype.getPath=function(t){var n=this.pathfinder,r=this.chart,i=n.algorithms[t.type],e=n.chartObstacles;return"function"!=typeof i?(x('"'+t.type+'" is not a Pathfinder algorithm.'),{path:[],obstacles:[]}):(i.requiresObstacles&&!e&&(e=n.chartObstacles=n.getChartObstacles(t),r.options.connectors.algorithmMargin=t.algorithmMargin,n.chartObstacleMetrics=n.getObstacleMetrics(e)),i(this.fromPoint.getPathfinderAnchorPoint(t.startMarker),this.toPoint.getPathfinderAnchorPoint(t.endMarker),M({chartObstacles:e,lineObstacles:n.lineObstacles||[],obstacleMetrics:n.chartObstacleMetrics,hardBounds:{xMin:0,xMax:r.plotWidth,yMin:0,yMax:r.plotHeight},obstacleOptions:{margin:t.algorithmMargin},startDirectionX:n.getAlgorithmStartDirection(t.startMarker)},t)))},t.prototype.render=function(){var t=this.fromPoint,n=t.series,r=n.chart,i=r.pathfinder,e={},a=M(r.options.connectors,n.options.connectors,t.options.connectors,this.options);!r.styledMode&&(e.stroke=a.lineColor||t.color,e["stroke-width"]=a.lineWidth,a.dashStyle&&(e.dashstyle=a.dashStyle)),e.class="highcharts-point-connecting-path highcharts-color-"+t.colorIndex,c((a=M(e,a)).marker.radius)||(a.marker.radius=f(y(Math.ceil((a.algorithmMargin||8)/2)-1,1),5));var o=this.getPath(a),s=o.path;o.obstacles&&(i.lineObstacles=i.lineObstacles||[],i.lineObstacles=i.lineObstacles.concat(o.obstacles)),this.renderPath(s,e),this.addMarker("start",M(a.marker,a.startMarker),s),this.addMarker("end",M(a.marker,a.endMarker),s)},t.prototype.destroy=function(){this.graphics&&(p(this.graphics,function(t){t.destroy()}),delete this.graphics)},t}();function u(t,n){for(var r=[],i=0;i<t.length;i++){var e=t[i][1],a=t[i][2];if("number"==typeof e&&"number"==typeof a)if(0===i)r.push(["M",e,a]);else if(i===t.length-1)r.push(["L",e,a]);else if(n){var o=t[i-1],s=t[i+1];if(o&&s){var h=o[1],c=o[2],x=s[1],M=s[2];if("number"==typeof h&&"number"==typeof x&&"number"==typeof c&&"number"==typeof M&&h!==x&&c!==M){var p=h<x?1:-1,d=c<M?1:-1;r.push(["L",e-p*Math.min(Math.abs(e-h),n),a-d*Math.min(Math.abs(a-c),n)],["C",e,a,e,a,e+p*Math.min(Math.abs(e-x),n),a+d*Math.min(Math.abs(a-M),n)])}}}else r.push(["L",e,a])}return r}var g=h().pick,v=Math.min,m=Math.max,b=Math.abs;function P(t,n,r){for(var i,e,a=n-1e-7,o=r||0,s=t.length-1;o<=s;)if((e=a-t[i=s+o>>1].xMin)>0)o=i+1;else{if(!(e<0))return i;s=i-1}return o>0?o-1:0}function O(t,n){for(var r,i=P(t,n.x+1)+1;i--;)if(t[i].xMax>=n.x&&(r=t[i],n.x<=r.xMax&&n.x>=r.xMin&&n.y<=r.yMax&&n.y>=r.yMin))return i;return -1}function k(t){var n=[];if(t.length){n.push(["M",t[0].start.x,t[0].start.y]);for(var r=0;r<t.length;++r)n.push(["L",t[r].end.x,t[r].end.y])}return n}function w(t,n){t.yMin=m(t.yMin,n.yMin),t.yMax=v(t.yMax,n.yMax),t.xMin=m(t.xMin,n.xMin),t.xMax=v(t.xMax,n.xMax)}var A=function(t,n,r){var i,e,a,o,s,h=[],c=r.chartObstacles,x=O(c,t),M=O(c,n),p=g(r.startDirectionX,b(n.x-t.x)>b(n.y-t.y))?"x":"y";function d(t,n,r,i,e){var a={x:t.x,y:t.y};return a[n]=r[i||n]+(e||0),a}function y(t,n,r){var i=b(n[r]-t[r+"Min"])>b(n[r]-t[r+"Max"]);return d(n,r,t,r+(i?"Max":"Min"),i?1:-1)}M>-1?(i={start:a=y(c[M],n,p),end:n},s=a):s=n,x>-1&&(a=y(e=c[x],t,p),h.push({start:t,end:a}),a[p]>=t[p]==a[p]>=s[p]&&(o=t[p="y"===p?"x":"y"]<n[p],h.push({start:a,end:d(a,p,e,p+(o?"Max":"Min"),o?1:-1)}),p="y"===p?"x":"y"));var f=h.length?h[h.length-1].end:t;a=d(f,p,s),h.push({start:f,end:a});var l=d(a,p="y"===p?"x":"y",s);return h.push({start:a,end:l}),h.push(i),{path:u(k(h),r.radius),obstacles:h}};function I(t,n,r){var i,e,a,o,s,h,c,x=g(r.startDirectionX,b(n.x-t.x)>b(n.y-t.y)),M=x?"x":"y",p=[],d=r.obstacleMetrics,y=v(t.x,n.x)-d.maxWidth-10,f=m(t.x,n.x)+d.maxWidth+10,l=v(t.y,n.y)-d.maxHeight-10,u=m(t.y,n.y)+d.maxHeight+10,A=!1,I=r.chartObstacles,E=P(I,f),L=P(I,y);function R(t,n,r){var i,e,a,o,s=t.x<n.x?1:-1;t.x<n.x?(i=t,e=n):(i=n,e=t),t.y<n.y?(o=t,a=n):(o=n,a=t);for(var h=s<0?v(P(I,e.x),I.length-1):0;I[h]&&(s>0&&I[h].xMin<=e.x||s<0&&I[h].xMax>=i.x);){if(I[h].xMin<=e.x&&I[h].xMax>=i.x&&I[h].yMin<=a.y&&I[h].yMax>=o.y){if(r)return{y:t.y,x:t.x<n.x?I[h].xMin-1:I[h].xMax+1,obstacle:I[h]};return{x:t.x,y:t.y<n.y?I[h].yMin-1:I[h].yMax+1,obstacle:I[h]}}h+=s}return n}function B(t,n,r,i,e){var a=e.soft,o=e.hard,s=i?"x":"y",h={x:n.x,y:n.y},c={x:n.x,y:n.y},x=t[s+"Max"]>=a[s+"Max"],M=t[s+"Min"]<=a[s+"Min"],p=t[s+"Max"]>=o[s+"Max"],d=t[s+"Min"]<=o[s+"Min"],y=b(t[s+"Min"]-n[s]),f=b(t[s+"Max"]-n[s]),l=10>b(y-f)?n[s]<r[s]:f<y;c[s]=t[s+"Min"],h[s]=t[s+"Max"];var u=R(n,c,i)[s]!==c[s],g=R(n,h,i)[s]!==h[s];return l=u?!g||l:!g&&l,l=M?!x||l:!x&&l,l=d?!p||l:!p&&l}for((E=O(I=I.slice(L,E+1),n))>-1&&(i=I[E],e=n,a=v(i.xMax-e.x,e.x-i.xMin)<v(i.yMax-e.y,e.y-i.yMin),o=B(i,e,t,a,{soft:r.hardBounds,hard:r.hardBounds}),c=a?{y:e.y,x:i[o?"xMax":"xMin"]+(o?1:-1)}:{x:e.x,y:i[o?"yMax":"yMin"]+(o?1:-1)},p.push({end:n,start:c}),n=c);(E=O(I,n))>-1;)h=n[M]-t[M]<0,(c={x:n.x,y:n.y})[M]=I[E][h?M+"Max":M+"Min"]+(h?1:-1),p.push({end:n,start:c}),n=c;return{path:k(s=(s=function t(n,i,e){if(n.x===i.x&&n.y===i.y)return[];var a,o,s,h,c,x,M,p=e?"x":"y",d=r.obstacleOptions.margin,g={soft:{xMin:y,xMax:f,yMin:l,yMax:u},hard:r.hardBounds};return(c=O(I,n))>-1?(h=B(c=I[c],n,i,e,g),w(c,r.hardBounds),M=e?{y:n.y,x:c[h?"xMax":"xMin"]+(h?1:-1)}:{x:n.x,y:c[h?"yMax":"yMin"]+(h?1:-1)},(x=O(I,M))>-1&&(w(x=I[x],r.hardBounds),M[p]=h?m(c[p+"Max"]-d+1,(x[p+"Min"]+c[p+"Max"])/2):v(c[p+"Min"]+d-1,(x[p+"Max"]+c[p+"Min"])/2),n.x===M.x&&n.y===M.y?(A&&(M[p]=h?m(c[p+"Max"],x[p+"Max"])+1:v(c[p+"Min"],x[p+"Min"])-1),A=!A):A=!1),o=[{start:n,end:M}]):(a=R(n,{x:e?i.x:n.x,y:e?n.y:i.y},e),o=[{start:n,end:{x:a.x,y:a.y}}],a[e?"x":"y"]!==i[e?"x":"y"]&&(h=B(a.obstacle,a,i,!e,g),w(a.obstacle,r.hardBounds),s={x:e?a.x:a.obstacle[h?"xMax":"xMin"]+(h?1:-1),y:e?a.obstacle[h?"yMax":"yMin"]+(h?1:-1):a.y},e=!e,o=o.concat(t({x:a.x,y:a.y},s,e)))),o=o.concat(t(o[o.length-1].end,i,!e))}(t,n,x)).concat(p.reverse())),obstacles:s}}A.requiresObstacles=!0,I.requiresObstacles=!0;var E={connectors:{type:"straight",radius:0,lineWidth:1,marker:{enabled:!1,align:"center",verticalAlign:"middle",inside:!1,lineWidth:1},startMarker:{symbol:"diamond"},endMarker:{symbol:"arrow-filled"}}},L=h().setOptions,R=h().defined,B=h().error,C=h().merge;function W(t){var n=t.shapeArgs;if(n)return{xMin:n.x||0,xMax:(n.x||0)+(n.width||0),yMin:n.y||0,yMax:(n.y||0)+(n.height||0)};var r=t.graphic&&t.graphic.getBBox();return r?{xMin:t.plotX-r.width/2,xMax:t.plotX+r.width/2,yMin:t.plotY-r.height/2,yMax:t.plotY+r.height/2}:null}!function(t){function n(t){var n,r,i=W(this);switch(t.align){case"right":n="xMax";break;case"left":n="xMin"}switch(t.verticalAlign){case"top":r="yMin";break;case"bottom":r="yMax"}return{x:n?i[n]:(i.xMin+i.xMax)/2,y:r?i[r]:(i.yMin+i.yMax)/2}}function r(t,n){var r;return!R(n)&&(r=W(this))&&(n={x:(r.xMin+r.xMax)/2,y:(r.yMin+r.yMax)/2}),Math.atan2(n.y-t.y,t.x-n.x)}function i(t,n,r){for(var i=2*Math.PI,e=W(this),a=e.xMax-e.xMin,o=e.yMax-e.yMin,s=Math.atan2(o,a),h=a/2,c=o/2,x=e.xMin+h,M=e.yMin+c,p={x:x,y:M},d=t,y=1,f=!1,l=1,u=1;d<-Math.PI;)d+=i;for(;d>Math.PI;)d-=i;return y=Math.tan(d),d>-s&&d<=s?(u=-1,f=!0):d>s&&d<=Math.PI-s?u=-1:d>Math.PI-s||d<=-(Math.PI-s)?(l=-1,f=!0):l=-1,f?(p.x+=l*h,p.y+=u*h*y):(p.x+=o/(2*y)*l,p.y+=u*c),r.x!==x&&(p.x=r.x),r.y!==M&&(p.y=r.y),{x:p.x+n*Math.cos(d),y:p.y-n*Math.sin(d)}}t.compose=function(t,e,a){var o=a.prototype;o.getPathfinderAnchorPoint||(t.prototype.callbacks.push(function(t){!1!==t.options.connectors.enabled&&((t.options.pathfinder||t.series.reduce(function(t,n){return n.options&&C(!0,n.options.connectors=n.options.connectors||{},n.options.pathfinder),t||n.options&&n.options.pathfinder},!1))&&(C(!0,t.options.connectors=t.options.connectors||{},t.options.pathfinder),B('WARNING: Pathfinder options have been renamed. Use "chart.connectors" or "series.connectors" instead.')),this.pathfinder=new e(this),this.pathfinder.update(!0))}),o.getMarkerVector=i,o.getPathfinderAnchorPoint=n,o.getRadiansToVector=r,L(E))}}(r||(r={}));var X=r,q=a(260),H=a.n(q),j=h().addEvent,D=h().defined,S=h().pick,V=h().splat,Y=Math.max,G=Math.min,T=function(){function t(t){this.init(t)}return t.compose=function(n,r){X.compose(n,t,r)},t.prototype.init=function(t){this.chart=t,this.connections=[],j(t,"redraw",function(){this.pathfinder.update()})},t.prototype.update=function(t){var n=this.chart,r=this,i=r.connections;r.connections=[],n.series.forEach(function(t){t.visible&&!t.options.isInternal&&t.points.forEach(function(t){var i,e,a=t.options;a&&a.dependency&&(a.connect=a.dependency);var o=(null==(i=t.options)?void 0:i.connect)?V(t.options.connect):[];t.visible&&!1!==t.isInside&&o.forEach(function(i){var a="string"==typeof i?i:i.to;a&&(e=n.get(a)),e instanceof H()&&e.series.visible&&e.visible&&!1!==e.isInside&&r.connections.push(new l(t,e,"string"==typeof i?{}:i))})})});for(var e=0,a=void 0,o=void 0,s=i.length,h=r.connections.length;e<s;++e){o=!1;var c=i[e];for(a=0;a<h;++a){var x=r.connections[a];if((c.options&&c.options.type)===(x.options&&x.options.type)&&c.fromPoint===x.fromPoint&&c.toPoint===x.toPoint){x.graphics=c.graphics,o=!0;break}}o||c.destroy()}delete this.chartObstacles,delete this.lineObstacles,r.renderConnections(t)},t.prototype.renderConnections=function(t){t?this.chart.series.forEach(function(t){var n=function(){var n=t.chart.pathfinder;(n&&n.connections||[]).forEach(function(n){n.fromPoint&&n.fromPoint.series===t&&n.render()}),t.pathfinderRemoveRenderEvent&&(t.pathfinderRemoveRenderEvent(),delete t.pathfinderRemoveRenderEvent)};!1===t.options.animation?n():t.pathfinderRemoveRenderEvent=j(t,"afterAnimate",n)}):this.connections.forEach(function(t){t.render()})},t.prototype.getChartObstacles=function(t){for(var n,r=this.chart.series,i=S(t.algorithmMargin,0),e=[],a=0,o=r.length;a<o;++a)if(r[a].visible&&!r[a].options.isInternal)for(var s=0,h=r[a].points.length,c=void 0,x=void 0;s<h;++s)(x=r[a].points[s]).visible&&(c=function(t){var n=t.shapeArgs;if(n)return{xMin:n.x||0,xMax:(n.x||0)+(n.width||0),yMin:n.y||0,yMax:(n.y||0)+(n.height||0)};var r=t.graphic&&t.graphic.getBBox();return r?{xMin:t.plotX-r.width/2,xMax:t.plotX+r.width/2,yMin:t.plotY-r.height/2,yMax:t.plotY+r.height/2}:null}(x))&&e.push({xMin:c.xMin-i,xMax:c.xMax+i,yMin:c.yMin-i,yMax:c.yMax+i});return e=e.sort(function(t,n){return t.xMin-n.xMin}),D(t.algorithmMargin)||(n=t.algorithmMargin=function(t){for(var n,r=t.length,i=[],e=0;e<r;++e)for(var a=e+1;a<r;++a)(n=function t(n,r,i){var e=S(i,10),a=n.yMax+e>r.yMin-e&&n.yMin-e<r.yMax+e,o=n.xMax+e>r.xMin-e&&n.xMin-e<r.xMax+e,s=a?n.xMin>r.xMax?n.xMin-r.xMax:r.xMin-n.xMax:1/0,h=o?n.yMin>r.yMax?n.yMin-r.yMax:r.yMin-n.yMax:1/0;return o&&a?e?t(n,r,Math.floor(e/2)):1/0:G(s,h)}(t[e],t[a]))<80&&i.push(n);return i.push(80),Y(Math.floor(i.sort(function(t,n){return t-n})[Math.floor(i.length/10)]/2-1),1)}(e),e.forEach(function(t){t.xMin-=n,t.xMax+=n,t.yMin-=n,t.yMax+=n})),e},t.prototype.getObstacleMetrics=function(t){for(var n,r,i=0,e=0,a=t.length;a--;)n=t[a].xMax-t[a].xMin,r=t[a].yMax-t[a].yMin,i<n&&(i=n),e<r&&(e=r);return{maxHeight:e,maxWidth:i}},t.prototype.getAlgorithmStartDirection=function(t){var n="left"!==t.align&&"right"!==t.align,r="top"!==t.verticalAlign&&"bottom"!==t.verticalAlign;return n?!!r&&void 0:!!r||void 0},t}();function N(t,n,r,i){return[["M",t,n+i/2],["L",t+r,n],["L",t,n+i/2],["L",t+r,n+i]]}function _(t,n,r,i){return N(t,n,r/2,i)}function z(t,n,r,i){return[["M",t+r,n],["L",t,n+i/2],["L",t+r,n+i],["Z"]]}function U(t,n,r,i){return z(t,n,r/2,i)}T.prototype.algorithms={fastAvoid:I,straight:function(t,n){return{path:[["M",t.x,t.y],["L",n.x,n.y]],obstacles:[{start:t,end:n}]}},simpleConnect:A};var Z=h();Z.Pathfinder=Z.Pathfinder||T,({compose:function(t){var n=t.prototype.symbols;n.arrow=N,n["arrow-filled"]=z,n["arrow-filled-half"]=U,n["arrow-half"]=_,n["triangle-left"]=z,n["triangle-left-half"]=U}}).compose(Z.SVGRenderer),Z.Pathfinder.compose(Z.Chart,Z.Point);var F=h();return o.default}()});