1/** 2 * Bundled by jsDelivr using Rollup v4.62.2 and esbuild v0.28.1. 3 * Original file: /npm/[email protected]/dist/jsvectormap.esm.js 4 * 5 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files 6 */ 7var q=function(r){return K(r)&&!Z(r)};function K(t){return!!t&&typeof t=="object"}function Z(t){var r=Object.prototype.toString.call(t);return r==="[object RegExp]"||r==="[object Date]"||te(t)||ee(t)}var Q=typeof Symbol=="function"&&Symbol.for,J=Q?Symbol.for("react.element"):60103;function ee(t){return t.$$typeof===J}function te(t){return t instanceof Node}function ie(t){return Array.isArray(t)?[]:{}}function E(t,r){return r.clone!==!1&&r.isMergeableObject(t)?T(ie(t),t,r):t}function se(t,r,i){return t.concat(r).map(function(e){return E(e,i)})}function re(t,r){if(!r.customMerge)return T;var i=r.customMerge(t);return typeof i=="function"?i:T}function ae(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(r){return t.propertyIsEnumerable(r)}):[]}function D(t){return Object.keys(t).concat(ae(t))}function V(t,r){try{return r in t}catch{return!1}}function ne(t,r){return V(t,r)&&!(Object.hasOwnProperty.call(t,r)&&Object.propertyIsEnumerable.call(t,r))}function oe(t,r,i){var e={};return i.isMergeableObject(t)&&D(t).forEach(function(s){e[s]=E(t[s],i)}),D(r).forEach(function(s){ne(t,s)||(V(t,s)&&i.isMergeableObject(r[s])?e[s]=re(s,i)(t[s],r[s],i):e[s]=E(r[s],i))}),e}var T=function(r,i,e){e=e||{},e.arrayMerge=e.arrayMerge||se,e.isMergeableObject=e.isMergeableObject||q,e.cloneUnlessOtherwiseSpecified=E;var s=Array.isArray(i),a=Array.isArray(r),n=s===a;return n?s?e.arrayMerge(r,i,e):oe(r,i,e):E(i,e)},H=function(r){return typeof r=="object"&&typeof r.nodeType<"u"?r:typeof r=="string"?document.querySelector(r):null},b=function(r,i,e,s){s===void 0&&(s=!1);var a=document.createElement(r);return e&&(a[s?"innerHTML":"textContent"]=e),i&&(a.className=i),a},le=function(r,i){return Element.prototype.querySelector.call(r,i)},j=function(r){r.parentNode.removeChild(r)},he=function(r){return/\.(jpg|gif|png)$/.test(r)},ce=function(r){return r.replace(/[\w]([A-Z])/g,function(i){return i[0]+"-"+i[1]}).toLowerCase()},v=function(r,i,e){return e===void 0&&(e=!1),e?T(r,i):Object.assign(r,i)},O=function(r,i){return r.toLowerCase()+":to:"+i.toLowerCase()},G=function(r,i){Object.assign(r.prototype,i)},x={},ue=1,p={on:function(r,i,e,s){s===void 0&&(s={});var a="jvm:"+i+"::"+ue++;x[a]={selector:r,handler:e},e._uid=a,r.addEventListener(i,e,s)},delegate:function(r,i,e,s){i=i.split(" "),i.forEach(function(a){p.on(r,a,function(n){var o=n.target;o.matches(e)&&s.call(o,n)})})},off:function(r,i,e){var s=i.split(":")[1];r.removeEventListener(s,e),delete x[e._uid]},flush:function(){Object.keys(x).forEach(function(r){p.off(x[r].selector,r,x[r].handler)})},getEventRegistry:function(){return x}};function fe(){var t=this,r=this,i=!1,e,s;this.params.draggable&&(p.on(this.container,"mousemove",function(a){if(!i)return!1;r.transX-=(e-a.pageX)/r.scale,r.transY-=(s-a.pageY)/r.scale,r._applyTransform(),e=a.pageX,s=a.pageY}),p.on(this.container,"mousedown",function(a){return i=!0,e=a.pageX,s=a.pageY,!1}),p.on(document.body,"mouseup",function(){i=!1})),this.params.zoomOnScroll&&p.on(this.container,"wheel",function(a){var n=((a.deltaY||-a.wheelDelta||a.detail)>>10||1)*75,o=t.container.getBoundingClientRect(),l=a.pageX-o.left-window.scrollX,u=a.pageY-o.top-window.scrollY,c=Math.pow(1+r.params.zoomOnScrollSpeed/1e3,-1.5*n);r.tooltip&&r._tooltip.hide(),r._setScale(r.scale*c,l,u),a.preventDefault()})}var _={onLoaded:"map:loaded",onViewportChange:"viewport:changed",onRegionClick:"region:clicked",onMarkerClick:"marker:clicked",onRegionSelected:"region:selected",onMarkerSelected:"marker:selected",onRegionTooltipShow:"region.tooltip:show",onMarkerTooltipShow:"marker.tooltip:show",onDestroyed:"map:destroyed"},R=function(r,i,e){var s=H(i),a=s.getAttribute("class").indexOf("jvm-region")===-1?"marker":"region",n=a==="region",o=n?s.getAttribute("data-code"):s.getAttribute("data-index"),l=n?_.onRegionSelected:_.onMarkerSelected;
7return e&&(l=n?_.onRegionTooltipShow:_.onMarkerTooltipShow),{type:a,code:o,event:l,element:n?r.regions[o].element:r._markers[o].element,tooltipText:n?r._mapData.paths[o].name||"":r._markers[o].config.name||""}};function de(){var t=this,r=this.container,i,e,s;p.on(r,"mousemove",function(a){Math.abs(i-a.pageX)+Math.abs(e-a.pageY)>2&&(s=!0)}),p.delegate(r,"mousedown",".jvm-element",function(a){i=a.pageX,e=a.pageY,s=!1}),p.delegate(r,"mouseover mouseout",".jvm-element",function(a){var n=R(t,this,!0),o=t.params.showTooltip;a.type==="mouseover"?(n.element.hover(!0),o&&(t._tooltip.text(n.tooltipText),t._emit(n.event,[a,t._tooltip,n.code]),a.defaultPrevented||t._tooltip.show())):(n.element.hover(!1),o&&t._tooltip.hide())}),p.delegate(r,"mouseup",".jvm-element",function(a){var n=R(t,this);if(!s&&(n.type==="region"&&t.params.regionsSelectable||n.type==="marker"&&t.params.markersSelectable)){var o=n.element;t.params[n.type+"sSelectableOne"]&&(n.type==="region"?t.clearSelectedRegions():t.clearSelectedMarkers()),n.element.isSelected?o.select(!1):o.select(!0),t._emit(n.event,[n.code,o.isSelected,n.type==="region"?t.getSelectedRegions():t.getSelectedMarkers()])}}),p.delegate(r,"click",".jvm-element",function(a){var n=R(t,this),o=n.type,l=n.code;t._emit(o==="region"?_.onRegionClick:_.onMarkerClick,[a,l])})}function pe(){var t=this,r=this.params.zoomInButton,i=this.params.zoomOutButton,e=function(l){return typeof l=="string"?document.querySelector(l):l},s=r?e(r):b("div","jvm-zoom-btn jvm-zoomin","+",!0),a=i?e(i):b("div","jvm-zoom-btn jvm-zoomout","−",!0);r||this.container.appendChild(s),i||this.container.appendChild(a);var n=function(l){return l===void 0&&(l=!0),function(){return t._setScale(l?t.scale*t.params.zoomStep:t.scale/t.params.zoomStep,t._width/2,t._height/2,!1,t.params.zoomAnimate)}};p.on(s,"click",n()),p.on(a,"click",n(!1))}function me(){var t=this,r,i,e,s,a,n,o,l=function(c){var h=c.touches,f,d,m,w;if(c.type=="touchstart"&&(o=0),h.length==1){if(o==1){var g;m=t.transX,w=t.transY,t.transX-=(e-h[0].pageX)/t.scale,t.transY-=(s-h[0].pageY)/t.scale,(g=t._tooltip)==null||g.hide(),t._applyTransform(),(m!=t.transX||w!=t.transY)&&c.preventDefault()}e=h[0].pageX,s=h[0].pageY}else if(h.length==2)if(o==2){var y;d=Math.sqrt(Math.pow(h[0].pageX-h[1].pageX,2)+Math.pow(h[0].pageY-h[1].pageY,2))/i,t._setScale(r*d,a,n),(y=t._tooltip)==null||y.hide(),c.preventDefault()}else{var z=t.container.getBoundingClientRect();f={top:z.top+window.scrollY,left:z.left+window.scrollX},h[0].pageX>h[1].pageX?a=h[1].pageX+(h[0].pageX-h[1].pageX)/2:a=h[0].pageX+(h[1].pageX-h[0].pageX)/2,h[0].pageY>h[1].pageY?n=h[1].pageY+(h[0].pageY-h[1].pageY)/2:n=h[0].pageY+(h[1].pageY-h[0].pageY)/2,a-=f.left,n-=f.top,r=t.scale,i=Math.sqrt(Math.pow(h[0].pageX-h[1].pageX,2)+Math.pow(h[0].pageY-h[1].pageY,2))}o=h.length};p.on(t.container,"touchstart",l),p.on(t.container,"touchmove",l)}function N(t,r){(r==null||r>t.length)&&(r=t.length);for(var i=0,e=Array(r);i<r;i++)e[i]=t[i];return e}function ve(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _e(t,r){for(var i=0;i<r.length;i++){var e=r[i];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(t,Se(e.key),e)}}function ge(t,r,i){return i&&_e(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}function ye(t,r){var i=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(i)return(i=i.call(t)).next.bind(i);if(Array.isArray(t)||(i=Me(t))||r){i&&(t=i);var e=0;return function(){return e>=t.length?{done:!0}:{done:!1,value:t[e++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 8In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function P(){return P=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var i=arguments[r];for(var e in i)({}).hasOwnProperty.call(i,e)&&(t[e]=i[e])}return t},P.apply(null,arguments)}function S(t,r){t.prototype=Object.create(r.prototype),t.prototype.constructor=t,I(t,r)}function B(t,r){if(t==null)return{};var i={};for(var e in t)if({}.hasOwnProperty.call(t,e)){if(r.indexOf(e)!==-1)continue;i[e]=t[e]}return i}
8function I(t,r){return I=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,e){return i.__proto__=e,i},I(t,r)}function be(t,r){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var e=i.call(t,r);if(typeof e!="object")return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function Se(t){var r=be(t,"string");return typeof r=="symbol"?r:r+""}function Me(t,r){if(t){if(typeof t=="string")return N(t,r);var i={}.toString.call(t).slice(8,-1);return i==="Object"&&t.constructor&&(i=t.constructor.name),i==="Map"||i==="Set"?Array.from(t):i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?N(t,r):void 0}}var C=(function(){function t(){}var r=t.prototype;return r.dispose=function(){this._tooltip?j(this._tooltip):this.shape.remove();for(var e=ye(Object.getOwnPropertyNames(this)),s;!(s=e()).done;){var a=s.value;this[a]=null}},t})(),U={getLabelText:function(r,i){if(i){if(typeof i.render=="function"){var e=[];return this.constructor.Name==="marker"&&e.push(this.getConfig()),e.push(r),i.render.apply(this,e)}return r}},getLabelOffsets:function(r,i){return typeof i.offsets=="function"?i.offsets(r):Array.isArray(i.offsets)?i.offsets[r]:[0,0]},setStyle:function(r,i){this.shape.setStyle(r,i)},remove:function(){this.shape.remove(),this.label&&this.label.remove()},hover:function(r){this._setStatus("isHovered",r)},select:function(r){this._setStatus("isSelected",r)},_setStatus:function(r,i){this.shape[r]=i,this.shape.updateStyle(),this[r]=i,this.label&&(this.label[r]=i,this.label.updateStyle())}},F=(function(t){function r(e){var s,a=e.map,n=e.code,o=e.path,l=e.style,u=e.label,c=e.labelStyle,h=e.labelsGroup;s=t.call(this)||this,s._map=a,s.shape=s._createRegion(o,n,l);var f=s.getLabelText(n,u);if(u&&f){var d=s.shape.getBBox(),m=s.getLabelOffsets(n,u);s.labelX=d.x+d.width/2+m[0],s.labelY=d.y+d.height/2+m[1],s.label=s._map.canvas.createText({text:f,textAnchor:"middle",alignmentBaseline:"central",dataCode:n,x:s.labelX,y:s.labelY},c,h),s.label.addClass("jvm-region jvm-element")}return s}S(r,t);var i=r.prototype;return i._createRegion=function(s,a,n){return s=this._map.canvas.createPath({d:s,dataCode:a},n),s.addClass("jvm-region jvm-element"),s},i.updateLabelPosition=function(){this.label&&this.label.set({x:this.labelX*this._map.scale+this._map.transX*this._map.scale,y:this.labelY*this._map.scale+this._map.transY*this._map.scale})},r})(C);G(F,U);function we(){this._regionLabelsGroup=this._regionLabelsGroup||this.canvas.createGroup("jvm-regions-labels-group");for(var t in this._mapData.paths){var r=new F({map:this,code:t,path:this._mapData.paths[t].path,style:v({},this.params.regionStyle),labelStyle:this.params.regionLabelStyle,labelsGroup:this._regionLabelsGroup,label:this.params.labels&&this.params.labels.regions});this.regions[t]={config:this._mapData.paths[t],element:r}}}var ke="jvm-line",xe=(function(t){function r(e,s){var a;return a=t.call(this)||this,a._options=e,a._style={initial:s},a._draw(),a}S(r,t);var i=r.prototype;return i.setStyle=function(s,a){this.shape.setStyle(s,a)},i.getConfig=function(){return this._options.config},i._draw=function(){var s=this._options,a=s.index,n=s.group,o=s.map,l={d:this._getDAttribute(),fill:"none",dataIndex:a};this.shape=o.canvas.createPath(l,this._style,n),this.shape.addClass(ke)},i._getDAttribute=function(){var s=this._options,a=s.x1,n=s.y1,o=s.x2,l=s.y2,u=s.curvature;return"M"+a+","+n+this._getQCommand(a,n,o,l,u)+o+","+l},i._getQCommand=function(s,a,n,o,l){if(!l)return" ";var u=(s+n)/2+l*(o-a),c=(a+o)/2-l*(n-s);return" Q"+u+","+c+" "},r})(C),Ee=["curvature"],Le=["curvature"];function Ae(t){var r=!1,i=!1,e=this.params.lineStyle,s=e.curvature,a=B(e,Ee);for(var n in t){for(var o=t[n],l=0,u=Object.values(this._markers);l<u.length;l++){var c=u[l].config;c.name===o.from&&(r=this.getMarkerPosition(c)),c.name===o.to&&(i=this.getMarkerPosition(c))}if(r!==!1&&i!==!1){var h=o.style||{},f=h.curvature,d=B(h,Le);this._lines[O(o.from,o.to)]=new xe({index:n,map:this,group:this._linesGroup,config:o,x1:r.x,y1:r.y,x2:i.x,y2:i.y,curvature:f==0?0:f||s},v(a,d,!0))}}}var Te="marker",X="jvm-",je=X+"element "+X+"marker",Oe=X+"element "+X+"label",W=(function(t){function r(e,s){var a;return a=t.call(this)||this,a._options=e,a._style=s,a._labelX=null,a._labelY=null,a._offsets=null,a._isImage=!!s.initial.image,a._draw(),a._options.label&&a._drawLabel(),a._isImage&&a.updateLabelPosition(),a}S(r,t);var i=r.prototype;return i.getConfig=function(){return this._options.config},i.updateLabelPosition=function(){var s=this._options.map;this.label&&this.label.set({x:this._labelX*s.scale+this._offsets[0]+s.transX*s.scale+5+(this._isImage?(this.shape.width||0)/2:this.shape.node.r.baseVal.value),y:this._labelY*s.scale+s.transY*this._options.map.scale+this._offsets[1]})},i._draw=function(){var s=this._options,a=s.index,n=s.map,o=s.group,l=s.cx,u=s.cy,c=this._isImage?"createImage":"createCircle";this.shape=n.canvas[c]({dataIndex:a,cx:l,cy:u},this._style,o),this.shape.addClass(je)},i._drawLabel=function(){var s=this._options,a=s.index,n=s.map,o=s.label,l=s.labelsGroup,u=s.cx,c=s.cy,h=s.config,f=s.isRecentlyCreated,d=this.getLabelText(a,o);this._labelX=u/n.scale-n.transX,this._labelY=c/n.scale-n.transY,this._offsets=f&&h.offsets?h.offsets:this.getLabelOffsets(a,o),this.label=n.canvas.createText({text:d,dataIndex:a,x:this._labelX,y:this._labelY,dy:"0.6ex"},n.params.markerLabelStyle,l),this.label.addClass(Oe),f&&this.updateLabelPosition()},ge(r,null,[{key:"Name",get:function(){return Te}}])})(C);G(W,U);function Ce(t,r){var i=this;t===void 0&&(t={}),r===void 0&&(r=!1);var e=function(){var o=t[a],l=i.getMarkerPosition(o),u=o.coords.join(":");if(!l)return 0;if(r){if(Object.keys(i._markers).filter(function(h){return i._markers[h]._uid===u}).length)return 0;a=Object.keys(i._markers).length}var c=new W({index:a,map:i,label:i.params.labels&&i.params.labels.markers,labelsGroup:i._markerLabelsGroup,cx:l.x,cy:l.y,group:i._markersGroup,config:o,isRecentlyCreated:r},v(i.params.markerStyle,P({},o.style||{}),!0));i._markers[a]&&i.removeMarkers([a]),i._markers[a]={_uid:u,config:o,element:c}},s;for(var a in t)s=e()}var Xe=(function(){function t(i){i===void 0&&(i={}),this._options=i,this._map=this._options.map,this._series=this._options.series,this._body=b("div","jvm-legend"),this._options.cssClass&&this._body.setAttribute("class",this._options.cssClass),i.vertical?this._map.legendVertical.appendChild(this._body):this._map.legendHorizontal.appendChild(this._body),this.render()}var r=t.prototype;return r.render=function(){var e=this._series.scale.getTicks();if(this._body.innderHTML="",this._options.title){var s=b("div","jvm-legend-title",this._options.title);this._body.appendChild(s)}for(var a=0;a<e.length;a++){var n=b("div","jvm-legend-tick"),o=b("div","jvm-legend-tick-sample");switch(this._series.config.attribute){case"fill":he(e[a].value)?o.style.background="url("+e[a].value+")":o.style.background=e[a].value;break;case"stroke":o.style.background=e[a].value;break;case"image":o.style.background="url("+(typeof e[a].value=="object"?e[a].value.url:e[a].value)+") no-repeat center center",o.style.backgroundSize="cover";break}n.appendChild(o);var l=e[a].label;this._options.labelRender&&(l=this._options.labelRender(l));var u=b("div","jvm-legend-tick-text",l);n.appendChild(u),this._body.appendChild(n)}},t})(),Ye=(function(){function t(i){this._scale=i}var r=t.prototype;return r.getValue=function(e){return this._scale[e]},r.getTicks=function(){var e=[];for(var s in this._scale)e.push({label:s,value:this._scale[s]});return e},t})(),Re=(function(){function t(i,e,s){i===void 0&&(i={}),this._map=s,this._elements=e,this._values=i.values||{},this.config=i,this.config.attribute=i.attribute||"fill",i.attributes&&this.setAttributes(i.attributes),typeof i.scale=="object"&&(this.scale=new Ye(i.scale)),this.config.legend&&(this.legend=new Xe(v({map:this._map,series:this},this.config.legend))),this.setValues(this._values)}var r=t.prototype;return r.setValues=function(e){var s={};for(var a in e)e[a]&&(s[a]=this.scale.getValue(e[a]));this.setAttributes(s)},r.setAttributes=function(e){for(var s in e)this._elements[s]&&this._elements[s].element.setStyle(this.config.attribute,e[s])},r.clear=function(){var e,s={};for(e in this._values)this._elements[e]&&(s[e]=this._elements[e].element.shape.style.initial[this.config.attribute]);this.setAttributes(s),this._values={}},t})();function Pe(){this.series={markers:[],regions:[]};for(var t in this.params.series)for(var r=0;r<this.params.series[t].length;r++)this.series[t][r]=new Re(this.params.series[t][r],t==="markers"?this._markers:this.regions,this)}function Ie(){var t,r,i,e;this._defaultWidth*this.scale<=this._width?(t=(this._width-this._defaultWidth*this.scale)/(2*this.scale),i=(this._width-this._defaultWidth*this.scale)/(2*this.scale)):(t=0,i=(this._width-this._defaultWidth*this.scale)/this.scale),this._defaultHeight*this.scale<=this._height?(r=(this._height-this._defaultHeight*this.scale)/(2*this.scale),e=(this._height-this._defaultHeight*this.scale)/(2*this.scale)):(r=0,e=(this._height-this._defaultHeight*this.scale)/this.scale),this.transY>r?this.transY=r:this.transY<e&&(this.transY=e),this.transX>t?this.transX=t:this.transX<i&&(this.transX=i),this.canvas.applyTransformParams(this.scale,this.transX,this.transY),this._markers&&this._repositionMarkers(),this._lines&&this._repositionLine
8s(),this._repositionLabels()}function ze(){var t=this._baseScale;this._width/this._height>this._defaultWidth/this._defaultHeight?(this._baseScale=this._height/this._defaultHeight,this._baseTransX=Math.abs(this._width-this._defaultWidth*this._baseScale)/(2*this._baseScale)):(this._baseScale=this._width/this._defaultWidth,this._baseTransY=Math.abs(this._height-this._defaultHeight*this._baseScale)/(2*this._baseScale)),this.scale*=this._baseScale/t,this.transX*=this._baseScale/t,this.transY*=this._baseScale/t}function De(t,r,i,e,s){var a=this,n,o,l=0,u=Math.abs(Math.round((t-this.scale)*60/Math.max(t,this.scale))),c,h,f,d,m,w,g,y;t>this.params.zoomMax*this._baseScale?t=this.params.zoomMax*this._baseScale:t<this.params.zoomMin*this._baseScale&&(t=this.params.zoomMin*this._baseScale),typeof r<"u"&&typeof i<"u"&&(n=t/this.scale,e?(g=r+this._defaultWidth*(this._width/(this._defaultWidth*t))/2,y=i+this._defaultHeight*(this._height/(this._defaultHeight*t))/2):(g=this.transX-(n-1)/t*r,y=this.transY-(n-1)/t*i)),s&&u>0?(c=this.scale,h=(t-c)/u,f=this.transX*this.scale,m=this.transY*this.scale,d=(g*t-f)/u,w=(y*t-m)/u,o=setInterval(function(){l+=1,a.scale=c+h*l,a.transX=(f+d*l)/a.scale,a.transY=(m+w*l)/a.scale,a._applyTransform(),l==u&&(clearInterval(o),a._emit(_.onViewportChange,[a.scale,a.transX,a.transY]))},10)):(this.transX=g,this.transY=y,this.scale=t,this._applyTransform(),this._emit(_.onViewportChange,[this.scale,this.transX,this.transY]))}function Ve(t){var r=this;t===void 0&&(t={});var i,e=[];if(t.region?e.push(t.region):t.regions&&(e=t.regions),e.length)return e.forEach(function(o){if(r.regions[o]){var l=r.regions[o].element.shape.getBBox();l&&(typeof i>"u"?i=l:i={x:Math.min(i.x,l.x),y:Math.min(i.y,l.y),width:Math.max(i.x+i.width,l.x+l.width)-Math.min(i.x,l.x),height:Math.max(i.y+i.height,l.y+l.height)-Math.min(i.y,l.y)})}}),this._setScale(Math.min(this._width/i.width,this._height/i.height),-(i.x+i.width/2),-(i.y+i.height/2),!0,t.animate);if(t.coords){var s=this.coordsToPoint(t.coords[0],t.coords[1]),a=this.transX-s.x/this.scale,n=this.transY-s.y/this.scale;return this._setScale(t.scale*this._baseScale,a,n,!0,t.animate)}}function He(){this._width=this.container.offsetWidth,this._height=this.container.offsetHeight,this._resize(),this.canvas.setSize(this._width,this._height),this._applyTransform()}var Y={mill:function(r,i,e){return{x:this.radius*(i-e)*this.radDeg,y:-this.radius*Math.log(Math.tan((45+.4*r)*this.radDeg))/.8}},merc:function(r,i,e){return{x:this.radius*(i-e)*this.radDeg,y:-this.radius*Math.log(Math.tan(Math.PI/4+r*Math.PI/360))}},aea:function(r,i,e){var s=0,a=e*this.radDeg,n=29.5*this.radDeg,o=45.5*this.radDeg,l=r*this.radDeg,u=i*this.radDeg,c=(Math.sin(n)+Math.sin(o))/2,h=Math.cos(n)*Math.cos(n)+2*c*Math.sin(n),f=c*(u-a),d=Math.sqrt(h-2*c*Math.sin(l))/c,m=Math.sqrt(h-2*c*Math.sin(s))/c;return{x:d*Math.sin(f)*this.radius,y:-(m-d*Math.cos(f))*this.radius}},lcc:function(r,i,e){var s=0,a=e*this.radDeg,n=i*this.radDeg,o=33*this.radDeg,l=45*this.radDeg,u=r*this.radDeg,c=Math.log(Math.cos(o)*(1/Math.cos(l)))/Math.log(Math.tan(Math.PI/4+l/2)*(1/Math.tan(Math.PI/4+o/2))),h=Math.cos(o)*Math.pow(Math.tan(Math.PI/4+o/2),c)/c,f=h*Math.pow(1/Math.tan(Math.PI/4+u/2),c),d=h*Math.pow(1/Math.tan(Math.PI/4+s/2),c);return{x:f*Math.sin(c*(n-a))*this.radius,y:-(d-f*Math.cos(c*(n-a)))*this.radius}}};Y.degRad=180/Math.PI,Y.radDeg=Math.PI/180,Y.radius=6381372;function Ge(t,r){var i=M.maps[this.params.map].projection,e=Y[i.type](t,r,i.centralMeridian),s=e.x,a=e.y,n=this.getInsetForPoint(s,a);if(!n)return!1;var o=n.bbox;return s=(s-o[0].x)/(o[1].x-o[0].x)*n.width*this.scale,a=(a-o[0].y)/(o[1].y-o[0].y)*n.height*this.scale,{x:s+this.transX*this.scale+n.left*this.scale,y:a+this.transY*this.scale+n.top*this.scale}}function Ne(t,r){for(var i=M.maps[this.params.map].insets,e=0;e<i.length;e++){var s=i[e].bbox,a=s[0],n=s[1];if(t>a.x&&t<n.x&&r>a.y&&r<n.y)return i[e]}}function Be(t){var r=t.coords;return M.maps[this.params.map].projection?this.coordsToPoint.apply(this,r):{x:r[0]*this.scale+this.transX*this.scale,y:r[1]*this.scale+this.transY*this.scale}}function Ue(){var t=this,r=this.params.lineStyle.curvature;
8Object.values(this._lines).forEach(function(i){var e=Object.values(t._markers).find(function(g){var y=g.config;return y.name===i.getConfig().from}),s=Object.values(t._markers).find(function(g){var y=g.config;return y.name===i.getConfig().to});if(e&&s){var a=t.getMarkerPosition(e.config),n=a.x,o=a.y,l=t.getMarkerPosition(s.config),u=l.x,c=l.y,h=i._options.curvature==0?0:i._options.curvature||r,f=(n+u)/2,d=(o+c)/2,m=f+h*(c-o),w=d-h*(u-n);i.setStyle({d:"M"+n+","+o+" Q"+m+","+w+" "+u+","+c})}})}function Fe(){for(var t in this._markers){var r=this.getMarkerPosition(this._markers[t].config);r!==!1&&this._markers[t].element.setStyle({cx:r.x,cy:r.y})}}function We(){var t=this.params.labels;if(t){if(t.regions)for(var r in this.regions)this.regions[r].element.updateLabelPosition();if(t.markers)for(var i in this._markers)this._markers[i].element.updateLabelPosition()}}var $e={_setupContainerEvents:fe,_setupElementEvents:de,_setupZoomButtons:pe,_setupContainerTouchEvents:me,_createRegions:we,_createLines:Ae,_createMarkers:Ce,_createSeries:Pe,_applyTransform:Ie,_resize:ze,_setScale:De,setFocus:Ve,updateSize:He,coordsToPoint:Ge,getInsetForPoint:Ne,getMarkerPosition:Be,_repositionLines:Ue,_repositionMarkers:Fe,_repositionLabels:We},qe={map:"world",backgroundColor:"transparent",draggable:!0,zoomButtons:!0,zoomOnScroll:!0,zoomOnScrollSpeed:3,zoomMax:12,zoomMin:1,zoomAnimate:!0,showTooltip:!0,zoomStep:1.5,bindTouchEvents:!0,lineStyle:{curvature:0,stroke:"#808080",strokeWidth:1,strokeLinecap:"round"},markersSelectable:!1,markersSelectableOne:!1,markerStyle:{initial:{r:7,fill:"#374151",fillOpacity:1,stroke:"#FFF",strokeWidth:5,strokeOpacity:.5},hover:{fill:"#3cc0ff",cursor:"pointer"},selected:{fill:"blue"},selectedHover:{}},markerLabelStyle:{initial:{fontFamily:"Verdana",fontSize:12,fontWeight:500,cursor:"default",fill:"#374151"},hover:{cursor:"pointer"},selected:{},selectedHover:{}},regionsSelectable:!1,regionsSelectableOne:!1,regionStyle:{initial:{fill:"#dee2e8",fillOpacity:1,stroke:"none",strokeWidth:0},hover:{fillOpacity:.7,cursor:"pointer"},selected:{fill:"#9ca3af"},selectedHover:{}},regionLabelStyle:{initial:{fontFamily:"Verdana",fontSize:"12",fontWeight:"bold",cursor:"default",fill:"#35373e"},hover:{cursor:"pointer"}}},L=(function(){function t(i,e){this.node=this._createElement(i),e&&this.set(e)}var r=t.prototype;return r._createElement=function(e){return document.createElementNS("http://www.w3.org/2000/svg",e)},r.addClass=function(e){this.node.setAttribute("class",e)},r.getBBox=function(){return this.node.getBBox()},r.set=function(e,s){if(typeof e=="object")for(var a in e)this.applyAttr(a,e[a]);else this.applyAttr(e,s)},r.get=function(e){return this.style.initial[e]},r.applyAttr=function(e,s){this.node.setAttribute(ce(e),s)},r.remove=function(){j(this.node)},t})(),A=(function(t){function r(e,s,a){var n;return a===void 0&&(a={}),n=t.call(this,e,s)||this,n.isHovered=!1,n.isSelected=!1,n.style=a,n.style.current={},n.updateStyle(),n}S(r,t);var i=r.prototype;return i.setStyle=function(s,a){if(typeof s=="object")v(this.style.current,s);else{var n;v(this.style.current,(n={},n[s]=a,n))}this.updateStyle()},i.updateStyle=function(){var s={};v(s,this.style.initial),v(s,this.style.current),this.isHovered&&v(s,this.style.hover),this.isSelected&&(v(s,this.style.selected),this.isHovered&&v(s,this.style.selectedHover)),this.set(s)},r})(L),Ke=(function(t){function r(e,s){return t.call(this,"text",e,s)||this}S(r,t);var i=r.prototype;return i.applyAttr=function(s,a){s==="text"?this.node.textContent=a:t.prototype.applyAttr.call(this,s,a)},r})(A),Ze=(function(t){function r(e,s){return t.call(this,"image",e,s)||this}S(r,t);var i=r.prototype;return i.applyAttr=function(s,a){var n;s==="image"?(typeof a=="object"?(n=a.url,this.offset=a.offset||[0,0]):(n=a,this.offset=[0,0]),this.node.setAttributeNS("http://www.w3.org/1999/xlink","href",n),this.width=23,this.height=23,this.applyAttr("width",this.width),this.applyAttr("height",this.height),this.applyAttr("x",this.cx-this.width/2+this.offset[0]),this.applyAttr("y",this.cy-this.height/2+this.offset[1])):s=="cx"?(this.cx=a,this.width&&this.applyAttr("x",a-this.width/2+this.offset[0])):s=="cy"?(this.cy=a,this.height&&this.applyAttr("y",a-this.height/2+this.offset[1])):t.prototype.applyAttr.apply(this,arguments)},r})(A),Qe=(function(t){function r(e){var s;return s=t.call(this,"svg")||this,s._container=e,s._defsElement=new L("defs"),s._rootElement=new L("g",{id:"jvm-regions-group"}),s.node.appendChild(s._defsElement.node),s.node.appendChild(s._rootElement.node),s._container.appendChild(s.node),s}S(r,t);var i=r.prototype;return i.setSize=function(s,a){this.node.setAttribute("width",s),this.node.setAttribute("height",a)},i.applyTransformParams=function(s,a,n){this._rootElement.node.setAttribute("transform","scale("+s+") translate("+a+", "+n+")")},i.createPath=function(s,a,n){var o=new A("path",s,a);return o.node.setAttribute("fill-rule","evenodd"),this._add(o,n)},i.createCircle=function(s,a,n){var o=new A("circle",s,a);return this._add(o,n)},i.createLine=function(s,a,n){var o=new A("line",s,a);return this._add(o,n)},i.createText=function(s,a,n){var o=new Ke(s,a);return this._add(o,n)},i.createImage=function(s,a,n){var o=new Ze(s,a);return this._add(o,n)},i.createGroup=function(s){var a=new L("g");return this.node.appendChild(a.node),s&&(a.node.id=s),a.canvas=this,a},i._add=function(s,a){return a=a||this._rootElement,a.node.appendChild(s.node),s},r})(L),Je=(function(t){function r(e){var s;s=t.call(this)||this;var a=b("div","jvm-tooltip");return s._map=e,s._tooltip=document.body.appendChild(a),s._bindEventListeners(),s||ve(s)}S(r,t);var i=r.prototype;return i._bindEventListeners=function(){var s=this;
8p.on(this._map.container,"mousemove",function(a){if(s._tooltip.classList.contains("active")){var n=le(s._map.container,"#jvm-regions-group").getBoundingClientRect(),o=5,l=s._tooltip.getBoundingClientRect(),u=l.height,c=l.width,h=a.clientY<=n.top+u+o,f=a.pageY-u-o,d=a.pageX-c-o;h&&(f+=u+o,d-=o*2),a.clientX<n.left+c+o&&(d=a.pageX+o+2,h&&(d+=o*2)),s.css({top:f+"px",left:d+"px"})}})},i.getElement=function(){return this._tooltip},i.show=function(){this._tooltip.classList.add("active")},i.hide=function(){this._tooltip.classList.remove("active")},i.text=function(s,a){a===void 0&&(a=!1);var n=a?"innerHTML":"textContent";if(!s)return this._tooltip[n];this._tooltip[n]=s},i.css=function(s){for(var a in s)this._tooltip.style[a]=s[a];return this},r})(C),et=(function(){function t(i,e){var s=i.scale,a=i.values;this._scale=s,this._values=a,this._fromColor=this.hexToRgb(s[0]),this._toColor=this.hexToRgb(s[1]),this._map=e,this.setMinMaxValues(a),this.visualize()}var r=t.prototype;return r.setMinMaxValues=function(e){this.min=Number.MAX_VALUE,this.max=0;for(var s in e)s=parseFloat(e[s]),s>this.max&&(this.max=s),s<this.min&&(this.min=s)},r.visualize=function(){var e={},s;for(var a in this._values)s=parseFloat(this._values[a]),isNaN(s)||(e[a]=this.getValue(s));this.setAttributes(e)},r.setAttributes=function(e){for(var s in e)this._map.regions[s]&&this._map.regions[s].element.setStyle("fill",e[s])},r.getValue=function(e){if(this.min===this.max)return"#"+this._toColor.join("");for(var s,a="#",n=0;n<3;n++)s=Math.round(this._fromColor[n]+(this._toColor[n]-this._fromColor[n])*((e-this.min)/(this.max-this.min))).toString(16),a+=(s.length===1?"0":"")+s;return a},r.hexToRgb=function(e){var s=0,a=0,n=0;return e.length==4?(s="0x"+e[1]+e[1],a="0x"+e[2]+e[2],n="0x"+e[3]+e[3]):e.length==7&&(s="0x"+e[1]+e[2],a="0x"+e[3]+e[4],n="0x"+e[5]+e[6]),[parseInt(s),parseInt(a),parseInt(n)]},t})(),k="jvm-",tt=k+"container",it=k+"markers-group",st=k+"markers-labels-group",rt=k+"lines-group",$=k+"series-container",at=$+" "+k+"series-h",nt=$+" "+k+"series-v",M=(function(){function t(i){var e=this;if(i===void 0&&(i={}),this.params=v(t.defaults,i,!0),!t.maps[this.params.map])throw new Error("Attempt to use map which was not loaded: "+i.map);this.regions={},this.scale=1,this.transX=0,this.transY=0,this._mapData=t.maps[this.params.map],this._markers={},this._lines={},this._defaultWidth=this._mapData.width,this._defaultHeight=this._mapData.height,this._height=0,this._width=0,this._baseScale=1,this._baseTransX=0,this._baseTransY=0,document.readyState!=="loading"?this._init():window.addEventListener("DOMContentLoaded",function(){return e._init()})}var r=t.prototype;return r._init=function(){var e=this.params;this.container=H(e.selector),this.container.classList.add(tt),this.canvas=new Qe(this.container),this.setBackgroundColor(e.backgroundColor),this._createRegions(),this.updateSize(),e.lines&&(this._linesGroup=this.canvas.createGroup(rt)),e.markers&&(this._markersGroup=this.canvas.createGroup(it),this._markerLabelsGroup=this.canvas.createGroup(st)),this._createMarkers(e.markers),this._createLines(e.lines||{}),this._repositionLabels(),this._setupContainerEvents(),this._setupElementEvents(),e.zoomButtons&&this._setupZoomButtons(),e.showTooltip&&(this._tooltip=new Je(this)),e.selectedRegions&&this._setSelected("regions",e.selectedRegions),e.selectedMarkers&&this._setSelected("_markers",e.selectedMarkers),e.focusOn&&this.setFocus(e.focusOn),e.visualizeData&&(this.dataVisualization=new et(e.visualizeData,this)),e.bindTouchEvents&&("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)&&this._setupContainerTouchEvents(),e.series&&(this.container.appendChild(this.legendHorizontal=b("div",at)),this.container.appendChild(this.legendVertical=b("div",nt)),this._createSeries()),this._emit(_.onLoaded,[this])},r.setBackgroundColor=function(e){this.container.style.backgroundColor=e},r.getSelectedRegions=function(){return this._getSelected("regions")},r.clearSelectedRegions=function(e){var s=this;e===void 0&&(e=void 0),e=this._normalizeRegions(e)||this._getSelected("regions"),e.forEach(function(a){s.regions[a].element.select(!1)})},r.setSelectedRegions=function(e){this.clearSelectedRegions(),this._setSelected("regions",this._normalizeRegions(e))},r.getSelectedMarkers=function(){return this._getSelected("_markers")},r.clearSelectedMarkers=function(){this._clearSelected("_markers")},r.setSelectedMarkers=function(e){this._setSelected("_markers",e)},r.addMarkers=function(e){e=Array.isArray(e)?e:[e],this._createMarkers(e,!0)},r.removeMarkers=function(e){var s=this;e||(e=Object.keys(this._markers)),e.forEach(function(a){s._markers[a].element.remove(),delete s._markers[a]})},r.addLine=function(e,s,a){a===void 0&&(a={}),console.warn("`addLine` method is deprecated, please use `addLines` instead."),this._createLines([{from:e,to:s,style:a}],this._markers,!0)},r.addLines=function(e){var s=this._getLinesAsUids();Array.isArray(e)||(e=[e]),this._createLines(e.filter(function(a){return!(s.indexOf(O(a.from,a.to))>-1)}),!0)},r.removeLines=function(e){var s=this;Array.isArray(e)?e=e.map(function(a){return O(a.from,a.to)}):e=this._getLinesAsUids(),e.forEach(function(a){s._lines[a].dispose(),delete s._lines[a]})},r.removeLine=function(e,s){console.warn("`removeLine` method is deprecated, please use `removeLines` instead.");var a=O(e,s);this._lines.hasOwnProperty(a)&&(this._lines[a].element.remove(),delete this._lines[a])},r.reset=function(){for(var e in this.series)for(var s=0;s<this.series[e].length;s++)this.series[e][s].clear();this.legendHorizontal&&(j(this.legendHorizontal),this.legendHorizontal=null),this.legendVertical&&(j(this.legendVertical),this.legendVertical=null),this.scale=this._baseScale,this.transX=this._baseTransX,this.transY=this._baseTransY,this._applyTransform(),this.clearSelectedMarkers(),this.clearSelectedRegions(),this.removeMarkers()},r.destroy=function(e){var s=this;e===void 0&&(e=!0),p.flush(),this._tooltip.dispose(),this._emit(_.onDestroyed),e&&Object.keys(this).forEac
8h(function(a){try{delete s[a]}catch{}})},r.extend=function(e,s){if(typeof this[e]=="function")throw new Error("The method ["+e+"] does already exist, please use another name.");t.prototype[e]=s},r._emit=function(e,s){for(var a in _)_[a]===e&&typeof this.params[a]=="function"&&this.params[a].apply(this,s)},r._getSelected=function(e){var s=[];for(var a in this[e])this[e][a].element.isSelected&&s.push(a);return s},r._setSelected=function(e,s){var a=this;s.forEach(function(n){a[e][n]&&a[e][n].element.select(!0)})},r._clearSelected=function(e){var s=this;this._getSelected(e).forEach(function(a){s[e][a].element.select(!1)})},r._getLinesAsUids=function(){return Object.keys(this._lines)},r._normalizeRegions=function(e){return typeof e=="string"?[e]:e},t})();M.maps={},M.defaults=qe,Object.assign(M.prototype,$e);var ot=(function(){function t(r){if(r===void 0&&(r={}),!r.selector)throw new Error("Selector is not given.");return new M(r)}return t.addMap=function(i,e){M.maps[i]=e},t})(),lt=window.jsVectorMap=ot;export{lt as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.