!/** * Highcharts JS v11.4.1 (2024-04-04) * * (c) 2009-2024 * * 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/flowmap",["highcharts"],function(o){return t(o),t.Highcharts=o,t}):t("undefined"!=typeof Highcharts?Highcharts:void 0)}(function(t){"use strict";var o=t?t._modules:{};function e(t,o,e,i){t.hasOwnProperty(o)||(t[o]=i.apply(null,e),"function"==typeof CustomEvent&&window.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:o,module:t[o]}})))}e(o,"Series/FlowMap/FlowMapPoint.js",[o["Core/Series/SeriesRegistry.js"],o["Core/Utilities.js"]],function(t,o){let{seriesTypes:{mapline:{prototype:{pointClass:e}}}}=t,{pick:i,isString:s,isNumber:r}=o;return class extends e{isValid(){let t=!!(this.options.to&&this.options.from);return[this.options.to,this.options.from].forEach(function(o){t=!!(t&&o&&(s(o)||r(i(o[0],o.lat))&&r(i(o[1],o.lon))))}),t}}}),e(o,"Series/FlowMap/FlowMapSeries.js",[o["Series/FlowMap/FlowMapPoint.js"],o["Core/Series/SeriesRegistry.js"],o["Core/Utilities.js"]],function(t,o,e){let{series:{prototype:{pointClass:i}},seriesTypes:{column:s,map:r,mapline:n}}=o,{addEvent:a,arrayMax:l,arrayMin:h,defined:p,extend:f,isArray:d,merge:m,pick:u,relativeLength:c}=e;class g extends n{static getLength(t,o){return Math.sqrt(t*t+o*o)}static normalize(t,o){let e=this.getLength(t,o);return[t/e,o/e]}static markerEndPath(t,o,e,i){let s=c(i.width||0,this.getLength(o[0]-t[0],o[1]-t[1])),r=i.markerType||"arrow",[n,a]=this.normalize(o[0]-t[0],o[1]-t[1]),l=[];if("arrow"===r){let[i,r]=t;i-=n*s,r-=a*s,l.push(["L",i,r]),l.push(["L",e[0],e[1]]),[i,r]=o,i+=n*s,r+=a*s,l.push(["L",i,r])}if("mushroom"===r){let[i,r]=t,[h,p]=o,[f,d]=e,m=(h-i)/2+i,u=(p-r)/2+r;i-=n*s,r-=a*s,l.push(["L",i,r]),h+=n*s,p+=a*s,l.push(["Q",(f-m)*2+m,(d-u)*2+u,h,p])}return l}animate(t){let o=this.points;t||o.forEach(t=>{if(t.shapeArgs&&d(t.shapeArgs.d)&&t.shapeArgs.d.length){let o=t.shapeArgs.d,e=o[0][1],i=o[0][2];if(e&&i){let s=[];for(let t=0;t{let r,n;let l=this.chart,h=l.mapView,p=s.options,f=()=>{s.series.isDirty=!0},m=t=>{let o=l.get(t);if(o instanceof i&&o.plotX&&o.plotY)return a(o,"update",f),{x:o.plotX,y:o.plotY}},c=t=>d(t)?{lon:t[0],lat:t[1]}:t;"string"==typeof p.from?r=m(p.from):"object"==typeof p.from&&h&&(r=h.lonLatToPixels(c(p.from))),"string"==typeof p.to?n=m(p.to):"object"==typeof p.to&&h&&(n=h.lonLatToPixels(c(p.to))),s.fromPos=r,s.toPos=n,r&&n&&(o+=(r.x+n.x)/2,e+=(r.y+n.y)/2),u(s.options.weight,this.options.weight)&&t.push(u(s.options.weight,this.options.weight))}),this.smallestWeight=h(t),this.greatestWeight=l(t),this.centerOfPoints={x:o/this.points.length,y:e/this.points.length},this.points.forEach(t=>{if(!this.getLinkWidth(t)){t.shapeArgs={d:[]};return}t.fromPos&&(t.plotX=t.fromPos.x,t.plotY=t.fromPos.y),t.shapeType="path",t.shapeArgs=this.getPointShapeArgs(t),t.color=u(t.options.color,t.series.color)})}getPointShapeArgs(t){let{fromPos:o,toPos:e}=t;if(!o||!e)return{};let i=this.getLinkWidth(t)/2,s=t.options,r=m(this.options.markerEnd,s.markerEnd),n=u(s.growTowards,this.options.growTowards),a=o.x||0,l=o.y||0,h=e.x||0,f=e.y||0,d=u(s.curveFactor,this.options.curveFactor),y=r&&r.enabled&&r.height||0;if(p(d)||(d=this.autoCurve(a,l,h,f,this.centerOfPoints.x,this.centerOfPoints.y)),y){y=c(y,4*i);let t=h-a,o=f-l,e=a+(t*=.5),s=l+(o*=.5),r=t,n=e+(t=o)*d,p=s+(o=-r)*d,[m,u]=g.normalize(n-h,p-f);m*=y,u*=y,h+=m,f+=u}let w=h-a,x=f-l,P=a+(w*=.5),M=l+(x*=.5),C=w;w=x,x=-C;let[L,b]=g.normalize(w,x),W=1+.25*Math.sqrt(d*d);L*=i*W,b*=i*W;let j=P+w*d,E=M+x*d,[k,A]=g.normalize(j-a,E-l);C=k,k=A,A=-C,k*=i,A*=i;let[S,v]=g.normalize(j-h,E-f);C=S,S=-v,v=C,S*=i,v*=i,n&&(k/=i,A/=i,L/=4,b/=4);let F={d:[["M",a-k,l-A],["Q",j-L,E-b,h-S,f-v],["L",h+S,f+v],["Q",j+L,E+b,a+k,l+A],["Z"]]};if(r&&r.enabled&&F.d){let t=g.markerEndPath([h-S,f-v],[h+S,f+v],[e.x,e.y],r);F.d.splice(2,0,...t)}let T=t.options.from,O=t.options.to,z=T.lat,D=T.lon,H=O.lat,R=O.lon;return z&&D&&(t.options.from=`${+z}, ${+D}`),H&&R&&(t.options.to=`${+H}, ${+R}`),F}}return g.defaultOptions=m(n.defaultOptions,{animation:!0,dataLabels:{enabled:!1},fillOpacity:.5,markerEnd:{enabled:!0,height:"40%",width:"40%",markerType:"arrow"},width:1,maxWidth:25,minWidth:5,lineWidth:void 0,tooltip:{headerFormat:'{series.name}
',pointFormat:"{point.options.from} → {point.options.to}: {point.options.weight}"}}),f(g.prototype,{pointClass:t,pointArrayMap:["from","to","weight"],drawPoints:s.prototype.drawPoints,useMapGeometry:!0}),o.registerSeriesType("flowmap",g),g}),e(o,"masters/modules/flowmap.src.js",[o["Core/Globals.js"]],function(t){return t})});