/*
 Highcharts JS v11.1.0 (2023-06-05)

 (c) 2009-2022

 License: www.highcharts.com/license
*/
'use strict';(function(a){"object"===typeof module&&module.exports?(a["default"]=a,module.exports=a):"function"===typeof define&&define.amd?define("highcharts/modules/flowmap",["highcharts"],function(p){a(p);a.Highcharts=p;return a}):a("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(a){function p(a,e,c,k){a.hasOwnProperty(e)||(a[e]=k.apply(null,c),"function"===typeof CustomEvent&&window.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:e,module:a[e]}})))}a=a?a._modules:
{};p(a,"Series/FlowMap/FlowMapPoint.js",[a["Core/Series/SeriesRegistry.js"],a["Core/Utilities.js"]],function(a,e){({seriesTypes:{mapline:{prototype:{pointClass:a}}}}=a);const {pick:c,isString:k,isNumber:d}=e;class b extends a{constructor(){super(...arguments);this.series=this.options=void 0}isValid(){let b=!(!this.options.to||!this.options.from);[this.options.to,this.options.from].forEach(function(g){b=!!(b&&g&&(k(g)||d(c(g[0],g.lat))&&d(c(g[1],g.lon))))});return b}}return b});p(a,"Series/ColorMapComposition.js",
[a["Core/Series/SeriesRegistry.js"],a["Core/Utilities.js"]],function(a,e){const {column:{prototype:c}}=a.seriesTypes,{addEvent:k,defined:d}=e;var b;(function(b){function g(b){this.moveToTopOnHover&&this.graphic&&this.graphic.attr({zIndex:b&&"hover"===b.state?1:0})}const a=[];b.pointMembers={dataLabelOnNull:!0,moveToTopOnHover:!0,isValid:function(){return null!==this.value&&Infinity!==this.value&&-Infinity!==this.value&&(void 0===this.value||!isNaN(this.value))}};b.seriesMembers={colorKey:"value",
axisTypes:["xAxis","yAxis","colorAxis"],parallelArrays:["x","y","value"],pointArrayMap:["value"],trackerGroups:["group","markerGroup","dataLabelsGroup"],colorAttribs:function(b){const f={};!d(b.color)||b.state&&"normal"!==b.state||(f[this.colorProp||"fill"]=b.color);return f},pointAttribs:c.pointAttribs};b.compose=function(b){const f=b.prototype.pointClass;e.pushUnique(a,f)&&k(f,"afterSetState",g);return b}})(b||(b={}));return b});p(a,"Maps/MapSymbols.js",[a["Core/Renderer/SVG/SVGRenderer.js"]],function(a){const {prototype:{symbols:e}}=
a;e.bottombutton=function(a,k,d,b,m){if(m){const d=(null===m||void 0===m?void 0:m.r)||0;m.brBoxY=k-d;m.brBoxHeight=b+d}return e.roundedRect(a,k,d,b,m)};e.topbutton=function(a,k,d,b,m){m&&(m.brBoxHeight=b+((null===m||void 0===m?void 0:m.r)||0));return e.roundedRect(a,k,d,b,m)};return e});p(a,"Core/Chart/MapChart.js",[a["Core/Chart/Chart.js"],a["Core/Defaults.js"],a["Core/Renderer/SVG/SVGRenderer.js"],a["Core/Utilities.js"]],function(a,e,c,k){const {getOptions:d}=e,{merge:b,pick:m}=k;class g extends a{init(a,
g){const f=d().credits;a=b({chart:{panning:{enabled:!0,type:"xy"},type:"map"},credits:{mapText:m(f.mapText,' \u00a9 <a href="{geojson.copyrightUrl}">{geojson.copyrightShort}</a>'),mapTextFull:m(f.mapTextFull,"{geojson.copyright}")},mapView:{},tooltip:{followTouchMove:!1}},a);super.init(a,g)}}(function(b){b.maps={};b.mapChart=function(d,f,a){return new b(d,f,a)};b.splitPath=function(b){"string"===typeof b&&(b=b.replace(/([A-Za-z])/g," $1 ").replace(/^\s*/,"").replace(/\s*$/,""),b=b.split(/[ ,;]+/).map(f=>
/[A-za-z]/.test(f)?f:parseFloat(f)));return c.prototype.pathToSegments(b)}})(g||(g={}));return g});p(a,"Maps/MapUtilities.js",[],function(){return{boundsFromPath:function(a){let e=-Number.MAX_VALUE,c=Number.MAX_VALUE,k=-Number.MAX_VALUE,d=Number.MAX_VALUE,b;a.forEach(a=>{const g=a[a.length-2];a=a[a.length-1];"number"===typeof g&&"number"===typeof a&&(c=Math.min(c,g),e=Math.max(e,g),d=Math.min(d,a),k=Math.max(k,a),b=!0)});if(b)return{x1:c,y1:d,x2:e,y2:k}},pointInPolygon:function(a,e){let c,k,d,b=!1,
m=a.x,g=a.y;a=0;for(c=e.length-1;a<e.length;c=a++)k=e[a][1]>g,d=e[c][1]>g,k!==d&&m<(e[c][0]-e[a][0])*(g-e[a][1])/(e[c][1]-e[a][1])+e[a][0]&&(b=!b);return b}}});p(a,"Series/Map/MapPoint.js",[a["Series/ColorMapComposition.js"],a["Maps/MapUtilities.js"],a["Core/Series/SeriesRegistry.js"],a["Core/Utilities.js"]],function(a,e,c,k){const {boundsFromPath:d}=e;({seriesTypes:{scatter:e}}=c);const {extend:b,isNumber:m,pick:g}=k;class r extends e.prototype.pointClass{constructor(){super(...arguments);this.series=
this.path=this.options=void 0}static getProjectedPath(b,f){b.projectedPath||(f&&b.geometry?(f.hasCoordinates=!0,b.projectedPath=f.path(b.geometry)):b.projectedPath=b.path);return b.projectedPath||[]}applyOptions(a,f){const d=this.series;a=super.applyOptions.call(this,a,f);f=d.joinBy;d.mapData&&d.mapMap&&(f=super.getNestedProperty.call(a,f[1]),(f="undefined"!==typeof f&&d.mapMap[f])?b(a,f):-1!==d.pointArrayMap.indexOf("value")&&(a.value=a.value||null));return a}getProjectedBounds(b){var a=r.getProjectedPath(this,
b);a=d(a);var c=this.properties;const n=this.series.chart.mapView;if(a){const d=c&&c["hc-middle-lon"],f=c&&c["hc-middle-lat"];n&&m(d)&&m(f)?(b=b.forward([d,f]),a.midX=b[0],a.midY=b[1]):(b=c&&c["hc-middle-x"],c=c&&c["hc-middle-y"],a.midX=a.x1+(a.x2-a.x1)*g(this.middleX,m(b)?b:.5),b=g(this.middleY,m(c)?c:.5),this.geometry||(b=1-b),a.midY=a.y2-(a.y2-a.y1)*b);return a}}onMouseOver(b){k.clearTimeout(this.colorInterval);if(!this.isNull&&this.visible||this.series.options.nullInteraction)super.onMouseOver.call(this,
b);else this.series.onMouseOut(b)}setVisible(b){const a=b?"show":"hide";this.visible=this.options.visible=!!b;if(this.dataLabel)this.dataLabel[a]();this.graphic&&this.graphic.attr(this.series.pointAttribs(this))}zoomTo(b){const a=this.series.chart,d=a.mapView;var n=this.bounds;if(d&&n){const f=m(this.insetIndex)&&d.insets[this.insetIndex];if(f){var c=f.projectedUnitsToPixels({x:n.x1,y:n.y1});n=f.projectedUnitsToPixels({x:n.x2,y:n.y2});c=d.pixelsToProjectedUnits({x:c.x,y:c.y});n=d.pixelsToProjectedUnits({x:n.x,
y:n.y});n={x1:c.x,y1:c.y,x2:n.x,y2:n.y}}d.fitToBounds(n,void 0,!1);this.series.isDirty=!0;a.redraw(b)}}}b(r.prototype,{dataLabelOnNull:a.pointMembers.dataLabelOnNull,moveToTopOnHover:a.pointMembers.moveToTopOnHover,isValid:a.pointMembers.isValid});return r});p(a,"Maps/MapViewOptionsDefault.js",[],function(){return{center:[0,0],fitToGeometry:void 0,maxZoom:void 0,padding:0,projection:{name:void 0,parallels:void 0,rotation:void 0},zoom:void 0}});p(a,"Maps/MapViewInsetsOptionsDefault.js",[],function(){return{borderColor:"#cccccc",
borderWidth:1,center:[0,0],padding:"10%",relativeTo:"mapBoundingBox",units:"percent"}});p(a,"Extensions/GeoJSON.js",[a["Core/Chart/Chart.js"],a["Core/Templating.js"],a["Core/Globals.js"],a["Core/Utilities.js"]],function(a,e,c,k){function d(a,b){b||(b=Object.keys(a.objects)[0]);b=a.objects[b];if(b["hc-decoded-geojson"])return b["hc-decoded-geojson"];let d=a.arcs;if(a.transform){const {scale:b,translate:f}=a.transform;d=a.arcs.map(a=>{let d=0,l=0;return a.map(a=>{a=a.slice();a[0]=(d+=a[0])*b[0]+f[0];
a[1]=(l+=a[1])*b[1]+f[1];return a})})}const f=a=>"number"===typeof a[0]?a.reduce((a,b,f)=>{let l=0>b?d[~b]:d[b];0>b?(l=l.slice(0,0===f?l.length:l.length-1),l.reverse()):f&&(l=l.slice(1));return a.concat(l)},[]):a.map(f),n=b.geometries.map(a=>({type:"Feature",properties:a.properties,geometry:{type:a.type,coordinates:a.coordinates||f(a.arcs)}}));a={type:"FeatureCollection",copyright:a.copyright,copyrightShort:a.copyrightShort,copyrightUrl:a.copyrightUrl,features:n,"hc-recommended-mapview":b["hc-recommended-mapview"],
bbox:a.bbox,title:a.title};return b["hc-decoded-geojson"]=a}function b(a,b="map",f){const c=[];a="Topology"===a.type?d(a):a;a.features.forEach(function(a){var f=a.geometry||{},d=f.type;f=f.coordinates;a=a.properties;let n;"map"!==b&&"mapbubble"!==b||"Polygon"!==d&&"MultiPolygon"!==d?"mapline"!==b||"LineString"!==d&&"MultiLineString"!==d?"mappoint"===b&&"Point"===d&&f.length&&(n={geometry:{coordinates:f,type:d}}):f.length&&(n={geometry:{coordinates:f,type:d}}):f.length&&(n={geometry:{coordinates:f,
type:d}});if(n){d=a&&(a.name||a.NAME);f=a&&a.lon;const b=a&&a.lat;c.push(u(n,{lat:"number"===typeof b?b:void 0,lon:"number"===typeof f?f:void 0,name:"string"===typeof d?d:void 0,properties:a}))}});f&&a.copyrightShort&&(f.chart.mapCredits=m(f.chart.options.credits.mapText,{geojson:a}),f.chart.mapCreditsFull=m(f.chart.options.credits.mapTextFull,{geojson:a}));return c}const {format:m}=e,{win:g}=c,{error:r,extend:u,merge:f,wrap:D}=k;"";a.prototype.transformFromLatLon=function(a,b){var f=this.options.chart.proj4||
g.proj4;if(f){var {jsonmarginX:d=0,jsonmarginY:c=0,jsonres:l=1,scale:q=1,xoffset:n=0,xpan:t=0,yoffset:k=0,ypan:w=0}=b;a=f(b.crs,[a.lon,a.lat]);f=b.cosAngle||b.rotation&&Math.cos(b.rotation);var m=b.sinAngle||b.rotation&&Math.sin(b.rotation);b=b.rotation?[a[0]*f+a[1]*m,-a[0]*m+a[1]*f]:a;return{x:((b[0]-n)*q+t)*l+d,y:-(((k-b[1])*q+w)*l-c)}}r(21,!1,this)};a.prototype.transformToLatLon=function(a,b){const f=this.options.chart.proj4||g.proj4;if(!f)r(21,!1,this);else if(null!==a.y){var {jsonmarginX:d=0,
jsonmarginY:c=0,jsonres:l=1,scale:q=1,xoffset:n=0,xpan:t=0,yoffset:k=0,ypan:w=0}=b;a={x:((a.x-d)/l-t)/q+n,y:((a.y-c)/l+w)/q+k};var m=b.cosAngle||b.rotation&&Math.cos(b.rotation),h=b.sinAngle||b.rotation&&Math.sin(b.rotation);b=f(b.crs,"WGS84",b.rotation?{x:a.x*m+a.y*-h,y:a.x*h+a.y*m}:a);return{lat:b.y,lon:b.x}}};a.prototype.fromPointToLatLon=function(a){return this.mapView&&this.mapView.projectedUnitsToLonLat(a)};a.prototype.fromLatLonToPoint=function(a){return this.mapView&&this.mapView.lonLatToProjectedUnits(a)};
D(a.prototype,"addCredits",function(a,b){b=f(!0,this.options.credits,b);this.mapCredits&&(b.href=null);a.call(this,b);this.credits&&this.mapCreditsFull&&this.credits.attr({title:this.mapCreditsFull})});c.geojson=b;c.topo2geo=d;return{geojson:b,topo2geo:d}});p(a,"Core/Geometry/PolygonClip.js",[],function(){const a=(a,d,b)=>(d[0]-a[0])*(b[1]-a[1])>(d[1]-a[1])*(b[0]-a[0]),e=(a,d,b,c)=>{var g=[a[0]-d[0],a[1]-d[1]];const e=[b[0]-c[0],b[1]-c[1]];a=a[0]*d[1]-a[1]*d[0];b=b[0]*c[1]-b[1]*c[0];c=1/(g[0]*e[1]-
g[1]*e[0]);g=[(a*e[0]-b*g[0])*c,(a*e[1]-b*g[1])*c];g.isIntersection=!0;return g};var c;(function(c){c.clipLineString=(a,b)=>{const d=[];a=c.clipPolygon(a,b,!1);for(b=1;b<a.length;b++)a[b].isIntersection&&a[b-1].isIntersection&&(d.push(a.splice(0,b)),b=0),b===a.length-1&&d.push(a);return d};c.clipPolygon=(d,b,c=!0)=>{let g=b[b.length-1],k,m,f=d;for(let D=0;D<b.length;D++){const n=f;d=b[D];f=[];k=c?n[n.length-1]:n[0];for(let b=0;b<n.length;b++)m=n[b],a(g,d,m)?(a(g,d,k)||f.push(e(g,d,k,m)),f.push(m)):
a(g,d,k)&&f.push(e(g,d,k,m)),k=m;g=d}return f}})(c||(c={}));return c});p(a,"Maps/Projections/LambertConformalConic.js",[],function(){const a=Math.sign||(a=>0===a?0:0<a?1:-1),e=Math.PI/180,c=Math.PI/2;class k{constructor(d){var b,k=(d.parallels||[]).map(a=>a*e);const g=k[0]||0;k=null!==(b=k[1])&&void 0!==b?b:g;b=Math.cos(g);"object"===typeof d.projectedBounds&&(this.projectedBounds=d.projectedBounds);d=g===k?Math.sin(g):Math.log(b/Math.cos(k))/Math.log(Math.tan((c+k)/2)/Math.tan((c+g)/2));1e-10>Math.abs(d)&&
(d=1e-10*(a(d)||1));this.n=d;this.c=b*Math.pow(Math.tan((c+g)/2),d)/d}forward(a){var b=a[0]*e;const {c:d,n:g,projectedBounds:k}=this;a=a[1]*e;0<d?a<-c+.000001&&(a=-c+.000001):a>c-.000001&&(a=c-.000001);var u=d/Math.pow(Math.tan((c+a)/2),g);a=u*Math.sin(g*b)*63.78137;b=63.78137*(d-u*Math.cos(g*b));u=[a,b];k&&(a<k.x1||a>k.x2||b<k.y1||b>k.y2)&&(u.outside=!0);return u}inverse(d){const b=d[0]/63.78137;d=d[1]/63.78137;const {c:k,n:g}=this;d=k-d;const r=a(g)*Math.sqrt(b*b+d*d);let u=Math.atan2(b,Math.abs(d))*
a(d);0>d*g&&(u-=Math.PI*a(b)*a(d));return[u/g/e,(2*Math.atan(Math.pow(k/r,1/g))-c)/e]}}return k});p(a,"Maps/Projections/EqualEarth.js",[],function(){const a=Math.sqrt(3)/2;class e{constructor(){this.bounds={x1:-200.37508342789243,x2:200.37508342789243,y1:-97.52595454902263,y2:97.52595454902263}}forward(c){const k=Math.PI/180,d=Math.asin(a*Math.sin(c[1]*k)),b=d*d,e=b*b*b;return[c[0]*k*Math.cos(d)*74.03120656864502/(a*(1.340264+3*-.081106*b+e*(7*.000893+.034164*b))),74.03120656864502*d*(1.340264+-.081106*
b+e*(.000893+.003796*b))]}inverse(c){const k=c[0]/74.03120656864502;c=c[1]/74.03120656864502;const d=180/Math.PI;let b=c;let e;let g;for(g=0;12>g;++g){var r=b*b;e=r*r*r;var u=b*(1.340264+-.081106*r+e*(.000893+.003796*r))-c;r=1.340264+3*-.081106*r+e*(7*.000893+.034164*r);b-=u/=r;if(1e-9>Math.abs(u))break}r=b*b;return[d*a*k*(1.340264+3*-.081106*r+r*r*r*(7*.000893+.034164*r))/Math.cos(b),d*Math.asin(Math.sin(b)/a)]}}return e});p(a,"Maps/Projections/Miller.js",[],function(){const a=Math.PI/4,e=Math.PI/
180;class c{constructor(){this.bounds={x1:-200.37508342789243,x2:200.37508342789243,y1:-146.91480769173063,y2:146.91480769173063}}forward(c){return[c[0]*e*63.78137,79.7267125*Math.log(Math.tan(a+.4*c[1]*e))]}inverse(c){return[c[0]/63.78137/e,2.5*(Math.atan(Math.exp(c[1]/63.78137*.8))-a)/e]}}return c});p(a,"Maps/Projections/Orthographic.js",[],function(){const a=Math.PI/180;class e{constructor(){this.antimeridianCutting=!1;this.bounds={x1:-63.78460826781007,x2:63.78460826781007,y1:-63.78460826781007,
y2:63.78460826781007}}forward(c){const e=c[0];c=c[1]*a;c=[Math.cos(c)*Math.sin(e*a)*63.78460826781007,63.78460826781007*Math.sin(c)];if(-90>e||90<e)c.outside=!0;return c}inverse(c){const e=c[0]/63.78460826781007;c=c[1]/63.78460826781007;const d=Math.sqrt(e*e+c*c),b=Math.asin(d),m=Math.sin(b);return[Math.atan2(e*m,d*Math.cos(b))/a,Math.asin(d&&c*m/d)/a]}}return e});p(a,"Maps/Projections/WebMercator.js",[],function(){const a=Math.PI/180;class e{constructor(){this.bounds={x1:-200.37508342789243,x2:200.37508342789243,
y1:-200.3750834278071,y2:200.3750834278071};this.maxLatitude=85.0511287798}forward(c){var e=Math.sin(c[1]*a);e=[63.78137*c[0]*a,63.78137*Math.log((1+e)/(1-e))/2];85.0511287798<Math.abs(c[1])&&(e.outside=!0);return e}inverse(c){return[c[0]/(63.78137*a),(2*Math.atan(Math.exp(c[1]/63.78137))-Math.PI/2)/a]}}return e});p(a,"Maps/Projections/ProjectionRegistry.js",[a["Maps/Projections/LambertConformalConic.js"],a["Maps/Projections/EqualEarth.js"],a["Maps/Projections/Miller.js"],a["Maps/Projections/Orthographic.js"],
a["Maps/Projections/WebMercator.js"]],function(a,e,c,k,d){return{EqualEarth:e,LambertConformalConic:a,Miller:c,Orthographic:k,WebMercator:d}});p(a,"Maps/Projection.js",[a["Core/Geometry/PolygonClip.js"],a["Maps/Projections/ProjectionRegistry.js"],a["Core/Utilities.js"]],function(a,e,c){const {clipLineString:k,clipPolygon:d}=a,{clamp:b,erase:m}=c,g=2*Math.PI/360,r=a=>{-180>a&&(a+=360);180<a&&(a-=360);return a};class p{static add(a,b){p.registry[a]=b}static greatCircle(a,b,d){const {atan2:f,cos:c,sin:e,
sqrt:n}=Math,l=a[1]*g,q=a[0]*g,y=b[1]*g,t=b[0]*g;var x=y-l,w=t-q;x=e(x/2)*e(x/2)+c(l)*c(y)*e(w/2)*e(w/2);x=2*f(n(x),n(1-x));var k=Math.round(6371E3*x/5E5);w=[];d&&w.push(a);if(1<k)for(a=1/k,k=a;.999>k;k+=a){var h=e((1-k)*x)/e(x);const a=e(k*x)/e(x);var E=h*c(l)*c(q)+a*c(y)*c(t);const b=h*c(l)*e(q)+a*c(y)*e(t);h=h*e(l)+a*e(y);h=f(h,n(E*E+b*b));E=f(b,E);w.push([E/g,h/g])}d&&w.push(b);return w}static insertGreatCircles(a){let b=a.length-1;for(;b--;)if(10<Math.max(Math.abs(a[b][0]-a[b+1][0]),Math.abs(a[b][1]-
a[b+1][1]))){const f=p.greatCircle(a[b],a[b+1]);f.length&&a.splice(b+1,0,...f)}}static toString(a){const {name:b,rotation:f}=a||{};return[b,f&&f.join(",")].join(";")}constructor(a={}){this.hasGeoProjection=this.hasCoordinates=!1;this.maxLatitude=90;this.options=a;const {name:b,projectedBounds:f,rotation:d}=a;this.rotator=d?this.getRotator(d):void 0;const c=b?p.registry[b]:void 0;c&&(this.def=new c(a));const {def:e,rotator:g}=this;e&&(this.maxLatitude=e.maxLatitude||90,this.hasGeoProjection=!0);g&&
e?(this.forward=a=>e.forward(g.forward(a)),this.inverse=a=>g.inverse(e.inverse(a))):e?(this.forward=a=>e.forward(a),this.inverse=a=>e.inverse(a)):g&&(this.forward=g.forward,this.inverse=g.inverse);this.bounds="world"===f?e&&e.bounds:f}lineIntersectsBounds(a){const {x1:b,x2:d,y1:c,y2:f}=this.bounds||{},e=(a,b,d)=>{const [c,f]=a;a=b?0:1;if("number"===typeof d&&c[b]>=d!==f[b]>=d)return a=c[a]+(d-c[b])/(f[b]-c[b])*(f[a]-c[a]),b?[a,d]:[d,a]};let g,l=a[0];if(g=e(a,0,b))l=g,a[1]=g;else if(g=e(a,0,d))l=g,
a[1]=g;if(g=e(a,1,c))l=g;else if(g=e(a,1,f))l=g;return l}getRotator(a){const b=a[0]*g,d=(a[1]||0)*g;a=(a[2]||0)*g;const c=Math.cos(d),f=Math.sin(d),e=Math.cos(a),k=Math.sin(a);if(0!==b||0!==d||0!==a)return{forward:a=>{var d=a[0]*g+b,l=a[1]*g,t=Math.cos(l);a=Math.cos(d)*t;d=Math.sin(d)*t;l=Math.sin(l);t=l*c+a*f;return[Math.atan2(d*e-t*k,a*c-l*f)/g,Math.asin(t*e+d*k)/g]},inverse:a=>{var d=a[0]*g,l=a[1]*g,t=Math.cos(l);a=Math.cos(d)*t;d=Math.sin(d)*t;l=Math.sin(l);t=l*e-d*k;return[(Math.atan2(d*e+l*
k,a*c+t*f)-b)/g,Math.asin(t*c-a*f)/g]}}}forward(a){return a}inverse(a){return a}cutOnAntimeridian(a,d){const c=[],e=[a];a.forEach((e,f)=>{let g=a[f-1];if(!f){if(!d)return;g=a[a.length-1]}const l=g[0];var h=e[0];(-90>l||90<l)&&(-90>h||90<h)&&0<l!==0<h&&(h=b((180-(l+360)%360)/((h+360)%360-(l+360)%360),0,1),c.push({i:f,lat:g[1]+h*(e[1]-g[1]),direction:0>l?1:-1,previousLonLat:g,lonLat:e}))});if(c.length)if(d){if(1===c.length%2){var f=c.slice().sort((a,b)=>Math.abs(b.lat)-Math.abs(a.lat))[0];m(c,f)}for(var g=
c.length-2;0<=g;){var k=c[g].i,l=r(180+.000001*c[g].direction),q=r(180-.000001*c[g].direction);k=a.splice(k,c[g+1].i-k,...p.greatCircle([l,c[g].lat],[l,c[g+1].lat],!0));k.push(...p.greatCircle([q,c[g+1].lat],[q,c[g].lat],!0));e.push(k);g-=2}if(f)for(k=0;k<e.length;k++){const {direction:a,lat:b}=f;g=e[k];q=g.indexOf(f.lonLat);if(-1<q){k=(0>b?-1:1)*this.maxLatitude;var y=r(180+.000001*a);l=r(180-.000001*a);const c=p.greatCircle([y,b],[y,k],!0);for(y+=120*a;-180<y&&180>y;y+=120*a)c.push([y,k]);c.push(...p.greatCircle([l,
k],[l,f.lat],!0));g.splice(q,0,...c);break}}}else for(f=c.length;f--;)g=a.splice(c[f].i,a.length,[r(180+.000001*c[f].direction),c[f].lat]),g.unshift([r(180-.000001*c[f].direction),c[f].lat]),e.push(g);return e}path(a){const {bounds:b,def:c,rotator:e}=this,f=[],g="Polygon"===a.type||"MultiPolygon"===a.type,m=this.hasGeoProjection,l=!c||!1!==c.antimeridianCutting,q=l?e:void 0,y=l?c||this:this;let t;b&&(t=[[b.x1,b.y1],[b.x2,b.y1],[b.x2,b.y2],[b.x1,b.y2]]);const x=a=>{a=a.map(a=>{if(l){q&&(a=q.forward(a));
let b=a[0];.000001>Math.abs(b-180)&&(b=180>b?179.999999:180.000001);a=[b,a[1]]}return a});let c=[a];m&&(p.insertGreatCircles(a),l&&(c=this.cutOnAntimeridian(a,g)));c.forEach(a=>{if(!(2>a.length)){var h=!1,c=!1,e=a=>{h?f.push(["L",a[0],a[1]]):(f.push(["M",a[0],a[1]]),h=!0)},F=!1,z=!1,v=a.map(a=>{a=y.forward(a);a.outside?F=!0:z=!0;Infinity===a[1]?a[1]=1E10:-Infinity===a[1]&&(a[1]=-1E10);return a});if(l){g&&v.push(v[0]);if(F){if(!z)return;if(t)if(g)v=d(v,t);else if(b){k(v,t).forEach(a=>{h=!1;a.forEach(e)});
return}}v.forEach(e)}else for(let b=0;b<v.length;b++){const d=a[b],E=v[b];if(E.outside)c=!0;else{if(g&&!q){var q=d;a.push(d);v.push(E)}c&&P&&(g&&m?p.greatCircle(P,d).forEach(a=>e(y.forward(a))):h=!1);e(E);var P=d;c=!1}}}})};"LineString"===a.type?x(a.coordinates):"MultiLineString"===a.type?a.coordinates.forEach(a=>x(a)):"Polygon"===a.type?(a.coordinates.forEach(a=>x(a)),f.length&&f.push(["Z"])):"MultiPolygon"===a.type&&(a.coordinates.forEach(a=>{a.forEach(a=>x(a))}),f.length&&f.push(["Z"]));return f}}
p.registry=e;return p});p(a,"Maps/MapView.js",[a["Maps/MapViewOptionsDefault.js"],a["Maps/MapViewInsetsOptionsDefault.js"],a["Extensions/GeoJSON.js"],a["Core/Chart/MapChart.js"],a["Maps/MapUtilities.js"],a["Maps/Projection.js"],a["Core/Utilities.js"]],function(a,e,c,k,d,b,m){const {topo2geo:g}=c,{maps:r}=k,{boundsFromPath:p,pointInPolygon:f}=d,{addEvent:u,clamp:n,fireEvent:G,isArray:B,isNumber:A,isObject:C,isString:l,merge:q,pick:y,relativeLength:t}=m,x=(a,b)=>{const {width:h,height:c}=b;return Math.log(400.979322/
Math.max((a.x2-a.x1)/(h/256),(a.y2-a.y1)/(c/256)))/Math.log(2)};class w{static mergeInsets(a,b){const h=a=>{const b={};a.forEach((a,h)=>{b[a&&a.id||`i${h}`]=a});return b},c=q(h(a),h(b));return Object.keys(c).map(a=>c[a])}createInsets(){const a=this.options,b=a.insets;b&&b.forEach(b=>{b=new L(this,q(a.insetOptions,b));this.insets.push(b)})}constructor(h,c){this.allowTransformAnimation=!0;this.insets=[];this.padding=[0,0,0,0];this.eventsToUnbind=[];let d,e;if(!(this instanceof L)){var f=[h.options.chart.map,
...(h.options.series||[]).map(a=>a.mapData)].map(a=>this.getGeoMap(a));const a=[];f.forEach(b=>{if(b&&(d||(d=b["hc-recommended-mapview"]),b.bbox)){const [h,c,d,e]=b.bbox;a.push({x1:h,y1:c,x2:d,y2:e})}});const b=a.length&&w.compositeBounds(a);G(h,"beforeMapViewInit",{geoBounds:b},function(){if(b){const {x1:a,y1:h,x2:c,y2:d}=b;e=180<c-a&&90<d-h?{name:"EqualEarth"}:{name:"LambertConformalConic",parallels:[h,d],rotation:[-(a+c)/2]}}});this.geoMap=f[0]}this.userOptions=c||{};h.options.mapView&&h.options.mapView.recommendedMapView&&
(d=h.options.mapView.recommendedMapView);f=q(a,{projection:e},d,c);const z=d&&d.insets;c=c&&c.insets;z&&c&&(f.insets=w.mergeInsets(z,c));this.chart=h;this.center=f.center;this.options=f;this.projection=new b(f.projection);this.playingField=h.plotBox;this.zoom=f.zoom||0;this.minZoom=f.minZoom;this.createInsets();this.eventsToUnbind.push(u(h,"afterSetChartSize",()=>{this.playingField=this.getField();if(void 0===this.minZoom||this.minZoom===this.zoom)this.fitToBounds(void 0,void 0,!1),!this.chart.hasRendered&&
A(this.userOptions.zoom)&&(this.zoom=this.userOptions.zoom),this.userOptions.center&&q(!0,this.center,this.userOptions.center)}));this.setUpEvents()}fitToBounds(a,b,c=!0,d){const h=a||this.getProjectedBounds();if(h){var e=y(b,a?0:this.options.padding);b=this.getField(!1);e=B(e)?e:[e,e,e,e];this.padding=[t(e[0],b.height),t(e[1],b.width),t(e[2],b.height),t(e[3],b.width)];this.playingField=this.getField();b=x(h,this.playingField);a||(this.minZoom=b);a=this.projection.inverse([(h.x2+h.x1)/2,(h.y2+h.y1)/
2]);this.setView(a,b,c,d)}}getField(a=!0){a=a?this.padding:[0,0,0,0];return{x:a[3],y:a[0],width:this.chart.plotWidth-a[1]-a[3],height:this.chart.plotHeight-a[0]-a[2]}}getGeoMap(a){if(l(a))return r[a]&&"Topology"===r[a].type?g(r[a]):r[a];if(C(a,!0)){if("FeatureCollection"===a.type)return a;if("Topology"===a.type)return g(a)}}getMapBBox(){const a=this.getProjectedBounds(),b=this.getScale();if(a){const c=this.padding,h=this.projectedUnitsToPixels({x:a.x1,y:a.y2});return{width:(a.x2-a.x1)*b+c[1]+c[3],
height:(a.y2-a.y1)*b+c[0]+c[2],x:h.x-c[3],y:h.y-c[0]}}}getProjectedBounds(){const a=this.projection;var b=this.chart.series.reduce((a,b)=>{const c=b.getProjectedBounds&&b.getProjectedBounds();c&&!1!==b.options.affectsMapView&&a.push(c);return a},[]),c=this.options.fitToGeometry;return c?(this.fitToGeometryCache||("MultiPoint"===c.type?(c=c.coordinates.map(b=>a.forward(b)),b=c.map(a=>a[0]),c=c.map(a=>a[1]),this.fitToGeometryCache={x1:Math.min.apply(0,b),x2:Math.max.apply(0,b),y1:Math.min.apply(0,c),
y2:Math.max.apply(0,c)}):this.fitToGeometryCache=p(a.path(c))),this.fitToGeometryCache):this.projection.bounds||w.compositeBounds(b)}getScale(){return 256/400.979322*Math.pow(2,this.zoom)}getSVGTransform(){const {x:a,y:b,width:c,height:d}=this.playingField,e=this.projection.forward(this.center);var f=this.projection.hasCoordinates?-1:1;const g=this.getScale();f*=g;return{scaleX:g,scaleY:f,translateX:a+c/2-e[0]*g,translateY:b+d/2-e[1]*f}}lonLatToPixels(a){if(a=this.lonLatToProjectedUnits(a))return this.projectedUnitsToPixels(a)}lonLatToProjectedUnits(a){const b=
this.chart,c=b.mapTransforms;if(c){for(const h in c)if(Object.hasOwnProperty.call(c,h)&&c[h].hitZone){var d=b.transformFromLatLon(a,c[h]);if(d&&f(d,c[h].hitZone.coordinates[0]))return d}return b.transformFromLatLon(a,c["default"])}for(d of this.insets)if(d.options.geoBounds&&f({x:a.lon,y:a.lat},d.options.geoBounds.coordinates[0]))return a=d.projection.forward([a.lon,a.lat]),a=d.projectedUnitsToPixels({x:a[0],y:a[1]}),this.pixelsToProjectedUnits(a);a=this.projection.forward([a.lon,a.lat]);if(!a.outside)return{x:a[0],
y:a[1]}}projectedUnitsToLonLat(a){var b=this.chart;const c=b.mapTransforms;if(c){for(const d in c)if(Object.hasOwnProperty.call(c,d)&&c[d].hitZone&&f(a,c[d].hitZone.coordinates[0]))return b.transformToLatLon(a,c[d]);return b.transformToLatLon(a,c["default"])}b=this.projectedUnitsToPixels(a);for(var d of this.insets)if(d.hitZone&&f(b,d.hitZone.coordinates[0]))return a=d.pixelsToProjectedUnits(b),d=d.projection.inverse([a.x,a.y]),{lon:d[0],lat:d[1]};d=this.projection.inverse([a.x,a.y]);return{lon:d[0],
lat:d[1]}}redraw(a){this.chart.series.forEach(a=>{a.useMapGeometry&&(a.isDirty=!0)});this.chart.redraw(a)}setView(a,b,c=!0,d){a&&(this.center=a);"number"===typeof b&&("number"===typeof this.minZoom&&(b=Math.max(b,this.minZoom)),"number"===typeof this.options.maxZoom&&(b=Math.min(b,this.options.maxZoom)),A(b)&&(this.zoom=b));var e=this.getProjectedBounds();if(e){a=this.projection.forward(this.center);const {x:c,y:d,width:g,height:v}=this.playingField;b=this.getScale();var h=this.projectedUnitsToPixels({x:e.x1,
y:e.y1}),f=this.projectedUnitsToPixels({x:e.x2,y:e.y2});e=[(e.x1+e.x2)/2,(e.y1+e.y2)/2];if(!this.chart.series.some(a=>a.isDrilling)){const l=h.x,z=f.y;f=f.x;h=h.y;f-l<g?a[0]=e[0]:l<c&&f<c+g?a[0]+=Math.max(l-c,f-g-c)/b:f>c+g&&l>c&&(a[0]+=Math.min(f-g-c,l-c)/b);h-z<v?a[1]=e[1]:z<d&&h<d+v?a[1]-=Math.max(z-d,h-v-d)/b:h>d+v&&z>d&&(a[1]-=Math.min(h-v-d,z-d)/b);this.center=this.projection.inverse(a)}this.insets.forEach(a=>{a.options.field&&(a.hitZone=a.getHitZone(),a.playingField=a.getField())});this.render()}G(this,
"afterSetView");c&&this.redraw(d)}projectedUnitsToPixels(a){const b=this.getScale(),c=this.projection.forward(this.center),d=this.playingField;return{x:d.x+d.width/2-b*(c[0]-a.x),y:d.y+d.height/2+b*(c[1]-a.y)}}pixelsToLonLat(a){return this.projectedUnitsToLonLat(this.pixelsToProjectedUnits(a))}pixelsToProjectedUnits(a){const {x:b,y:c}=a;a=this.getScale();const d=this.projection.forward(this.center),e=this.playingField;return{x:d[0]+(b-(e.x+e.width/2))/a,y:d[1]-(c-(e.y+e.height/2))/a}}setUpEvents(){const {chart:a}=
this;let b,c,d;const e=e=>{var f=a.pointer.pinchDown,h=this.projection;let {mouseDownX:g,mouseDownY:l}=a;1===f.length&&(g=f[0].chartX,l=f[0].chartY);if("number"===typeof g&&"number"===typeof l){f=`${g},${l}`;const {chartX:z,chartY:v}=e.originalEvent;f!==c&&(c=f,b=this.projection.forward(this.center),d=(this.projection.options.rotation||[0,0]).slice());f=(f=h.def&&h.def.bounds)&&x(f,this.playingField)||-Infinity;if("Orthographic"===h.options.name&&(this.minZoom||Infinity)<1.3*f){if(f=440/(this.getScale()*
Math.min(a.plotWidth,a.plotHeight)),d){h=(g-z)*f-d[0];f=n(-d[1]-(l-v)*f,-80,80);const b=this.zoom;this.update({projection:{rotation:[-h,-f]}},!1);this.fitToBounds(void 0,void 0,!1);this.zoom=b;a.redraw(!1)}}else A(z)&&A(v)&&(h=this.getScale(),h=this.projection.inverse([b[0]+(g-z)/h,b[1]-(l-v)/h*(this.projection.hasCoordinates?1:-1)]),this.setView(h,void 0,!0,!1));e.preventDefault()}};u(a,"pan",e);u(a,"touchpan",e);u(a,"selection",b=>{if(b.resetSelection)this.zoomBy();else{const c=b.x-a.plotLeft,d=
b.y-a.plotTop,{y:e,x:f}=this.pixelsToProjectedUnits({x:c,y:d}),{y:h,x:g}=this.pixelsToProjectedUnits({x:c+b.width,y:d+b.height});this.fitToBounds({x1:f,y1:e,x2:g,y2:h},void 0,!0,b.originalEvent.touches?!1:void 0);/^touch/.test(b.originalEvent.type)||a.showResetZoom();b.preventDefault()}})}render(){this.group||(this.group=this.chart.renderer.g("map-view").attr({zIndex:4}).add())}update(a,c=!0,d){var e=a.projection;e=e&&b.toString(e)!==b.toString(this.options.projection);let f=!1;q(!0,this.userOptions,
a);q(!0,this.options,a);"insets"in a&&(this.insets.forEach(a=>a.destroy()),this.insets.length=0,f=!0);(e||"fitToGeometry"in a)&&delete this.fitToGeometryCache;if(e||f)this.chart.series.forEach(a=>{const b=a.transformGroups;a.clearBounds&&a.clearBounds();a.isDirty=!0;a.isDirtyData=!0;if(f&&b)for(;1<b.length;)(a=b.pop())&&a.destroy()}),e&&(this.projection=new b(this.options.projection)),f&&this.createInsets(),a.center||!Object.hasOwnProperty.call(a,"zoom")||A(a.zoom)||this.fitToBounds(void 0,void 0,
!1);a.center||A(a.zoom)?this.setView(this.options.center,a.zoom,!1):"fitToGeometry"in a&&this.fitToBounds(void 0,void 0,!1);c&&this.chart.redraw(d)}zoomBy(a,b,c,d){var e=this.chart;const f=this.projection.forward(this.center);let [g,h]=b?this.projection.forward(b):[];if("number"===typeof a){a=this.zoom+a;if(c){const [a,d]=c;c=this.getScale();b=d-e.plotTop-e.plotHeight/2;g=f[0]+(a-e.plotLeft-e.plotWidth/2)/c;h=f[1]+b/c}if("number"===typeof g&&"number"===typeof h){e=1-Math.pow(2,this.zoom)/Math.pow(2,
a);var l=f[1]-h;f[0]-=(f[0]-g)*e;f[1]+=l*e;l=this.projection.inverse(f)}this.setView(l,a,void 0,d)}else this.fitToBounds(void 0,void 0,void 0,d)}}w.compositeBounds=a=>{if(a.length)return a.slice(1).reduce((a,b)=>{a.x1=Math.min(a.x1,b.x1);a.y1=Math.min(a.y1,b.y1);a.x2=Math.max(a.x2,b.x2);a.y2=Math.max(a.y2,b.y2);return a},q(a[0]))};class L extends w{constructor(a,b){super(a.chart,b);this.id=b.id;this.mapView=a;this.options=q(e,b);this.allBounds=[];this.options.geoBounds&&(a=a.projection.path(this.options.geoBounds),
this.geoBoundsProjectedBox=p(a),this.geoBoundsProjectedPolygon=a.map(a=>[a[1]||0,a[2]||0]))}getField(a=!0){var b=this.hitZone;if(b){var c=a?this.padding:[0,0,0,0];b=b.coordinates[0];var d=b.map(a=>a[0]);const e=b.map(a=>a[1]);b=Math.min.apply(0,d)+c[3];d=Math.max.apply(0,d)-c[1];const f=Math.min.apply(0,e)+c[0];c=Math.max.apply(0,e)-c[2];if(A(b)&&A(f))return{x:b,y:f,width:d-b,height:c-f}}return super.getField.call(this,a)}getHitZone(){const {chart:a,mapView:b,options:c}=this;var {coordinates:d}=c.field||
{};if(d){d=d[0];if("percent"===c.units){const e="mapBoundingBox"===c.relativeTo&&b.getMapBBox()||q(a.plotBox,{x:0,y:0});d=d.map(a=>[t(`${a[0]}%`,e.width,e.x),t(`${a[1]}%`,e.height,e.y)])}return{type:"Polygon",coordinates:[d]}}}getProjectedBounds(){return w.compositeBounds(this.allBounds)}isInside(a){const {geoBoundsProjectedBox:b,geoBoundsProjectedPolygon:c}=this;return!!(b&&a.x>=b.x1&&a.x<=b.x2&&a.y>=b.y1&&a.y<=b.y2&&c&&f(a,c))}render(){const {chart:a,mapView:b,options:c}=this;var d=c.borderPath||
c.field;if(d&&b.group){let e=!0;this.border||(this.border=a.renderer.path().addClass("highcharts-mapview-inset-border").add(b.group),e=!1);a.styledMode||this.border.attr({stroke:c.borderColor,"stroke-width":c.borderWidth});const f=Math.round(this.border.strokeWidth())%2/2,g="mapBoundingBox"===c.relativeTo&&b.getMapBBox()||b.playingField;d=(d.coordinates||[]).reduce((b,d)=>d.reduce((b,d,e)=>{let [l,h]=d;"percent"===c.units&&(l=a.plotLeft+t(`${l}%`,g.width,g.x),h=a.plotTop+t(`${h}%`,g.height,g.y));
l=Math.floor(l)+f;h=Math.floor(h)+f;b.push(0===e?["M",l,h]:["L",l,h]);return b},b),[]);this.border[e?"animate":"attr"]({d})}}destroy(){this.border&&(this.border=this.border.destroy());this.eventsToUnbind.forEach(a=>a())}setUpEvents(){}}u(k,"afterInit",function(){this.mapView=new w(this,this.options.mapView)});return w});p(a,"Series/Map/MapSeries.js",[a["Core/Animation/AnimationUtilities.js"],a["Series/ColorMapComposition.js"],a["Series/CenteredUtilities.js"],a["Core/Globals.js"],a["Core/Chart/MapChart.js"],
a["Series/Map/MapPoint.js"],a["Maps/MapView.js"],a["Core/Series/Series.js"],a["Core/Series/SeriesRegistry.js"],a["Core/Renderer/SVG/SVGRenderer.js"],a["Core/Utilities.js"]],function(a,e,c,k,d,b,m,g,r,p,f){const {animObject:u,stop:n}=a;({noop:a}=k);const {splitPath:G}=d,{seriesTypes:{column:B,scatter:A}}=r,{extend:C,find:l,fireEvent:q,getNestedProperty:y,isArray:t,defined:x,isNumber:w,isObject:L,merge:h,objectEach:E,pick:O,splat:Q}=f;class F extends A{constructor(){super(...arguments);this.points=
this.options=this.joinBy=this.group=this.data=this.chart=void 0;this.processedData=[]}animate(a){const {chart:b,group:c}=this,d=u(this.options.animation);a?c.attr({translateX:b.plotLeft+b.plotWidth/2,translateY:b.plotTop+b.plotHeight/2,scaleX:.001,scaleY:.001}):c.animate({translateX:b.plotLeft,translateY:b.plotTop,scaleX:1,scaleY:1},d)}clearBounds(){this.points.forEach(a=>{delete a.bounds;delete a.insetIndex;delete a.projectedPath});delete this.bounds}doFullTranslate(){return!(!this.isDirtyData&&
!this.chart.isResizing&&this.hasRendered)}drawMapDataLabels(){g.prototype.drawDataLabels.call(this);this.dataLabelsGroup&&this.dataLabelsGroup.clip(this.chart.clipRect)}drawPoints(){const a=this,{chart:b,group:c,transformGroups:d=[]}=this,{mapView:e,renderer:f}=b;e&&(this.transformGroups=d,d[0]||(d[0]=f.g().add(c)),e.insets.forEach((a,b)=>{d[b+1]||d.push(f.g().add(c))}),this.doFullTranslate()&&(this.points.forEach(a=>{const {graphic:c,shapeArgs:e}=a;a.group=d["number"===typeof a.insetIndex?a.insetIndex+
1:0];c&&c.parentGroup!==a.group&&c.add(a.group);e&&b.hasRendered&&!b.styledMode&&(e.fill=this.pointAttribs(a,a.state).fill)}),B.prototype.drawPoints.apply(this),this.points.forEach(c=>{const d=c.graphic;if(d){const e=d.animate;let f="";c.name&&(f+="highcharts-name-"+c.name.replace(/ /g,"-").toLowerCase());c.properties&&c.properties["hc-key"]&&(f+=" highcharts-key-"+c.properties["hc-key"].toString().toLowerCase());f&&d.addClass(f);b.styledMode&&d.css(this.pointAttribs(c,c.selected&&"select"||void 0));
d.animate=function(c,f,g){const l=w(c["stroke-width"])&&!w(d["stroke-width"]),h=w(d["stroke-width"])&&!w(c["stroke-width"]);if(l||h){const e=O(a.getStrokeWidth(a.options),1)/(b.mapView&&b.mapView.getScale()||1);l&&(d["stroke-width"]=e);h&&(c["stroke-width"]=e)}return e.call(d,c,f,h?function(){d.element.removeAttribute("stroke-width");delete d["stroke-width"];g&&g.apply(this,arguments)}:g)}}})),d.forEach((c,d)=>{const g=(0===d?e:e.insets[d-1]).getSVGTransform(),l=O(this.getStrokeWidth(this.options),
1),k=g.scaleX,t=0<g.scaleY?1:-1,q=b=>{(a.points||[]).forEach(a=>{const c=a.graphic;let d;c&&c["stroke-width"]&&(d=this.getStrokeWidth(a.options))&&c.attr({"stroke-width":d/b})})};if(f.globalAnimation&&b.hasRendered&&e.allowTransformAnimation){const a=Number(c.attr("translateX")),b=Number(c.attr("translateY")),e=Number(c.attr("scaleX")),v=(d,f)=>{d=e+(k-e)*f.pos;c.attr({translateX:a+(g.translateX-a)*f.pos,translateY:b+(g.translateY-b)*f.pos,scaleX:d,scaleY:d*t,"stroke-width":l/d});q(d)};d=h(u(f.globalAnimation));
const z=d.step;d.step=function(a){z&&z.apply(this,arguments);v.apply(this,arguments)};c.attr({animator:0}).animate({animator:1},d,function(){"boolean"!==typeof f.globalAnimation&&f.globalAnimation.complete&&f.globalAnimation.complete({applyDrilldown:!0})})}else n(c),c.attr(h(g,{"stroke-width":l/k})),q(k)}),this.isDrilling||this.drawMapDataLabels())}getProjectedBounds(){if(!this.bounds&&this.chart.mapView){const {insets:a,projection:b}=this.chart.mapView,c=[];(this.points||[]).forEach(function(d){if(d.path||
d.geometry){"string"===typeof d.path?d.path=G(d.path):t(d.path)&&"M"===d.path[0]&&(d.path=p.prototype.pathToSegments(d.path));if(!d.bounds){let c=d.getProjectedBounds(b);if(c){d.labelrank=O(d.labelrank,(c.x2-c.x1)*(c.y2-c.y1));const {midX:b,midY:e}=c;if(a&&w(b)&&w(e)){const f=l(a,a=>a.isInside({x:b,y:e}));f&&(delete d.projectedPath,(c=d.getProjectedBounds(f.projection))&&f.allBounds.push(c),d.insetIndex=a.indexOf(f))}d.bounds=c}}d.bounds&&void 0===d.insetIndex&&c.push(d.bounds)}});this.bounds=m.compositeBounds(c)}return this.bounds}getStrokeWidth(a){const b=
this.pointAttrToOptions;return a[b&&b["stroke-width"]||"borderWidth"]}hasData(){return!!this.processedXData.length}pointAttribs(a,b){var c;const {mapView:d,styledMode:e}=a.series.chart,f=e?this.colorAttribs(a):B.prototype.pointAttribs.call(this,a,b);let g=this.getStrokeWidth(a.options);if(b){b=h(this.options.states[b],a.options.states&&a.options.states[b]||{});const d=this.getStrokeWidth(b);x(d)&&(g=d);f.stroke=null!==(c=b.borderColor)&&void 0!==c?c:a.color}g&&d&&(g/=d.getScale());c=this.getStrokeWidth(this.options);
f.dashstyle&&d&&w(c)&&(g=c/d.getScale());a.visible||(f.fill=this.options.nullColor);x(g)?f["stroke-width"]=g:delete f["stroke-width"];f["stroke-linecap"]=f["stroke-linejoin"]=this.options.linecap;return f}updateData(){return this.processedData?!1:super.updateData.apply(this,arguments)}setData(a,b=!0,c,d){delete this.bounds;super.setData.call(this,a,!1,void 0,d);this.processData();this.generatePoints();b&&this.chart.redraw(c)}processData(){const a=this.options,c=a.data;var d=this.chart.options.chart;
const e=this.joinBy,f=a.keys||this.pointArrayMap,g=[],l={};var q=this.chart.mapView;q=q&&(L(a.mapData,!0)?q.getGeoMap(a.mapData):q.geoMap);var x=this.chart.mapTransforms;(this.chart.mapTransforms=x=d.mapTransforms||q&&q["hc-transform"]||x)&&E(x,function(a){a.rotation&&(a.cosAngle=Math.cos(a.rotation),a.sinAngle=Math.sin(a.rotation))});let m;t(a.mapData)?m=a.mapData:q&&"FeatureCollection"===q.type&&(this.mapTitle=q.title,m=k.geojson(q,this.type,this));const n=this.processedData=[];c&&c.forEach(function(d,
g){let l=0;if(w(d))n[g]={value:d};else if(t(d)){n[g]={};!a.keys&&d.length>f.length&&"string"===typeof d[0]&&(n[g]["hc-key"]=d[0],++l);for(let a=0;a<f.length;++a,++l)f[a]&&"undefined"!==typeof d[l]&&(0<f[a].indexOf(".")?b.prototype.setNestedProperty(n[g],d[l],f[a]):n[g][f[a]]=d[l])}else n[g]=c[g];e&&"_i"===e[0]&&(n[g]._i=g)});if(m){this.mapData=m;this.mapMap={};for(x=0;x<m.length;x++)d=m[x],q=d.properties,d._i=x,e[0]&&q&&q[e[0]]&&(d[e[0]]=q[e[0]]),l[d[e[0]]]=d;this.mapMap=l;if(e[1]){const a=e[1];n.forEach(function(b){b=
y(a,b);l[b]&&g.push(l[b])})}if(a.allAreas){if(e[1]){const a=e[1];n.forEach(function(b){g.push(y(a,b))})}const a="|"+g.map(function(a){return a&&a[e[0]]}).join("|")+"|";m.forEach(function(b){e[0]&&-1!==a.indexOf("|"+b[e[0]]+"|")||n.push(h(b,{value:null}))})}}this.processedXData=Array(n.length)}setOptions(a){a=g.prototype.setOptions.call(this,a);let b=a.joinBy;null===b&&(b="_i");b=this.joinBy=Q(b);b[1]||(b[1]=b[0]);return a}translate(){const a=this.doFullTranslate(),c=this.chart.mapView,d=c&&c.projection;
!this.chart.hasRendered||!this.isDirtyData&&this.hasRendered||(this.processData(),this.generatePoints(),delete this.bounds,!c||c.userOptions.center||w(c.userOptions.zoom)||c.zoom!==c.minZoom?this.getProjectedBounds():c.fitToBounds(void 0,void 0,!1));if(c){const e=c.getSVGTransform();this.points.forEach(function(f){const g=w(f.insetIndex)&&c.insets[f.insetIndex].getSVGTransform()||e;g&&f.bounds&&w(f.bounds.midX)&&w(f.bounds.midY)&&(f.plotX=f.bounds.midX*g.scaleX+g.translateX,f.plotY=f.bounds.midY*
g.scaleY+g.translateY);a&&(f.shapeType="path",f.shapeArgs={d:b.getProjectedPath(f,d)});f.projectedPath&&!f.projectedPath.length?f.setVisible(!1):f.setVisible(!0)})}q(this,"afterTranslate")}}F.defaultOptions=h(A.defaultOptions,{affectsMapView:!0,animation:!1,dataLabels:{crop:!1,formatter:function(){const {numberFormatter:a}=this.series.chart,{value:b}=this.point;return w(b)?a(b,-1):""},inside:!0,overflow:!1,padding:0,verticalAlign:"middle"},linecap:"round",marker:null,nullColor:"#f7f7f7",stickyTracking:!1,
tooltip:{followPointer:!0,pointFormat:"{point.name}: {point.value}<br/>"},turboThreshold:0,allAreas:!0,borderColor:"#e6e6e6",borderWidth:1,joinBy:"hc-key",states:{hover:{halo:void 0,borderColor:"#666666",borderWidth:2},normal:{animation:!0},select:{color:"#cccccc"}},legendSymbol:"rectangle"});C(F.prototype,{type:"map",axisTypes:e.seriesMembers.axisTypes,colorAttribs:e.seriesMembers.colorAttribs,colorKey:e.seriesMembers.colorKey,directTouch:!0,drawDataLabels:a,drawGraph:a,forceDL:!0,getCenter:c.getCenter,
getExtremesFromAll:!0,getSymbol:a,isCartesian:!1,parallelArrays:e.seriesMembers.parallelArrays,pointArrayMap:e.seriesMembers.pointArrayMap,pointClass:b,preserveAspectRatio:!0,searchPoint:a,trackerGroups:e.seriesMembers.trackerGroups,useMapGeometry:!0});e.compose(F);r.registerSeriesType("map",F);"";return F});p(a,"Series/FlowMap/FlowMapSeries.js",[a["Series/FlowMap/FlowMapPoint.js"],a["Series/Map/MapSeries.js"],a["Core/Series/SeriesRegistry.js"],a["Core/Utilities.js"]],function(a,e,c,k){const {series:{prototype:{pointClass:d}},
seriesTypes:{column:b,mapline:m}}=c,{addEvent:g,arrayMax:p,arrayMin:u,defined:f,extend:D,isArray:n,merge:G,pick:B,relativeLength:A}=k;class C extends m{constructor(){super(...arguments);this.centerOfPoints=this.greatestWeight=this.smallestWeight=this.points=this.options=this.data=void 0}static getLength(a,b){return Math.sqrt(a*a+b*b)}static normalize(a,b){const c=this.getLength(a,b);return[a/c,b/c]}static markerEndPath(a,b,c,d){const e=A(d.width||0,this.getLength(b[0]-a[0],b[1]-a[1])),f=d.markerType||
"arrow",[g,l]=this.normalize(b[0]-a[0],b[1]-a[1]);d=[];if("arrow"===f){let [f,h]=a;f-=g*e;h-=l*e;d.push(["L",f,h]);d.push(["L",c[0],c[1]]);[f,h]=b;f+=g*e;h+=l*e;d.push(["L",f,h])}if("mushroom"===f){let [f,h]=a,[k,t]=b;const [q,m]=c;b=(k-f)/2+f;a=(t-h)/2+h;b=2*(q-b)+b;a=2*(m-a)+a;f-=g*e;h-=l*e;d.push(["L",f,h]);k+=g*e;t+=l*e;d.push(["Q",b,a,k,t])}return d}animate(a){const b=this.points;a||b.forEach(a=>{if(a.shapeArgs&&n(a.shapeArgs.d)&&a.shapeArgs.d.length){const b=a.shapeArgs.d,c=b[0][1],d=b[0][2];
if(c&&d){const f=[];for(let a=0;a<b.length;a++){f.push([...b[a]]);for(let e=1;e<b[a].length;e++)f[a][e]=e%2?c:d}a.graphic&&(a.graphic.attr({d:f}),a.graphic.animate({d:b}))}}})}getLinkWidth(a){var b=this.options.width;const c=a.options.weight||this.options.weight;a.options.weight=c;if(b&&!c)return b;a=this.smallestWeight;b=this.greatestWeight;if(!f(c)||!a||!b)return 0;const d=this.options.minWidth;return(c-a)*(this.options.maxWidth-d)/(b-a||1)+d}autoCurve(a,b,c,d,f,e){var g=c-a,l=d-b;a=(c-a)/2+a-f;
b=(d-b)/2+b-e;g=Math.atan2(g*b-l*a,g*a+l*b);g=180*g/Math.PI;0>g&&(g=360+g);g=g*Math.PI/180;return.7*-Math.sin(g)}pointAttribs(a,b){b=e.prototype.pointAttribs.call(this,a,b);b.fill=B(a.options.fillColor,a.options.color,"none"===this.options.fillColor?null:this.options.fillColor,this.color);b["fill-opacity"]=B(a.options.fillOpacity,this.options.fillOpacity);b["stroke-width"]=B(a.options.lineWidth,this.options.lineWidth,1);a.options.opacity&&(b.opacity=a.options.opacity);return b}translate(){!this.chart.hasRendered||
!this.isDirtyData&&this.hasRendered||(this.processData(),this.generatePoints());const a=[];let b=0,c=0;this.points.forEach(f=>{const e=this.chart,l=e.mapView,k=f.options,h=()=>{f.series.isDirty=!0},t=a=>{a=e.get(a);if(a instanceof d&&a.plotX&&a.plotY)return g(a,"update",h),{x:a.plotX,y:a.plotY}},m=a=>n(a)?{lon:a[0],lat:a[1]}:a;let q,p;"string"===typeof k.from?q=t(k.from):"object"===typeof k.from&&l&&(q=l.lonLatToPixels(m(k.from)));"string"===typeof k.to?p=t(k.to):"object"===typeof k.to&&l&&(p=l.lonLatToPixels(m(k.to)));
f.fromPos=q;f.toPos=p;q&&p&&(b+=(q.x+p.x)/2,c+=(q.y+p.y)/2);B(f.options.weight,this.options.weight)&&a.push(B(f.options.weight,this.options.weight))});this.smallestWeight=u(a);this.greatestWeight=p(a);this.centerOfPoints={x:b/this.points.length,y:c/this.points.length};this.points.forEach(a=>{this.getLinkWidth(a)?(a.fromPos&&(a.plotX=a.fromPos.x,a.plotY=a.fromPos.y),a.shapeType="path",a.shapeArgs=this.getPointShapeArgs(a),a.color=B(a.options.color,a.series.color)):a.shapeArgs={d:[]}})}getPointShapeArgs(a){const {fromPos:b,
toPos:c}=a;if(!b||!c)return{};var d=this.getLinkWidth(a)/2,e=a.options,g=G(this.options.markerEnd,e.markerEnd),l=B(e.growTowards,this.options.growTowards);const h=b.x||0,k=b.y||0;var m=c.x||0,n=c.y||0;e=B(e.curveFactor,this.options.curveFactor);var p=g&&g.enabled&&g.height||0;f(e)||(e=this.autoCurve(h,k,m,n,this.centerOfPoints.x,this.centerOfPoints.y));if(p){p=A(p,4*d);var r=.5*(m-h);var v=.5*(n-k);var u=h+r,D=k+v;const a=r;r=v;v=-a;let [b,c]=C.normalize(u+r*e-m,D+v*e-n);b*=p;c*=p;m+=b;n+=c}u=.5*
(m-h);p=.5*(n-k);D=h+u;r=k+p;v=u;u=p;p=-v;let [M,N]=C.normalize(u,p);v=1+.25*Math.sqrt(e*e);M*=d*v;N*=d*v;u=D+u*e;e=r+p*e;let [J,K]=C.normalize(u-h,e-k);v=J;J=K*d;K=-v*d;let [H,I]=C.normalize(u-m,e-n);v=H;H=-I*d;I=v*d;l&&(J/=d,K/=d,M/=4,N/=4);d={d:[["M",h-J,k-K],["Q",u-M,e-N,m-H,n-I],["L",m+H,n+I],["Q",u+M,e+N,h+J,k+K],["Z"]]};g&&g.enabled&&d.d&&(g=C.markerEndPath([m-H,n-I],[m+H,n+I],[c.x,c.y],g),d.d.splice(2,0,...g));n=a.options.from;m=a.options.to;g=n.lat;n=n.lon;l=m.lat;m=m.lon;g&&n&&(a.options.from=
`${+g}, ${+n}`);l&&m&&(a.options.to=`${+l}, ${+m}`);return d}}C.defaultOptions=G(m.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:'<span style="font-size: 0.8em">{series.name}</span><br/>',pointFormat:"{point.options.from} \u2192 {point.options.to}: <b>{point.options.weight}</b>"}});D(C.prototype,{pointClass:a,pointArrayMap:["from","to","weight"],
drawPoints:b.prototype.drawPoints,useMapGeometry:!0});c.registerSeriesType("flowmap",C);"";return C});p(a,"masters/modules/flowmap.src.js",[],function(){})});
//# sourceMappingURL=flowmap.js.map