@hpcc-js/map 3.5.9 → 3.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("@hpcc-js/common"),require("@hpcc-js/api"),require("@hpcc-js/layout"),require("@hpcc-js/util"),require("@hpcc-js/graph"),require("@hpcc-js/other")):typeof define==`function`&&define.amd?define([`exports`,`@hpcc-js/common`,`@hpcc-js/api`,`@hpcc-js/layout`,`@hpcc-js/util`,`@hpcc-js/graph`,`@hpcc-js/other`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e[`@hpcc-js/map`]={},e[`@hpcc-js/common`],e[`@hpcc-js/api`],e[`@hpcc-js/layout`],e[`@hpcc-js/util`],e[`@hpcc-js/graph`],e[`@hpcc-js/other`]))})(this,function(e,t,n,s,c,l,d){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var f=Object.create,p=Object.defineProperty,__name=(e,t)=>p(e,`name`,{value:t,configurable:!0}),m=Object.getOwnPropertyDescriptor,h=Object.getOwnPropertyNames,g=Object.getPrototypeOf,_=Object.prototype.hasOwnProperty,__commonJSMin=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),__exportAll=(e,t)=>{let n={};for(var s in e)p(n,s,{get:e[s],enumerable:!0});return t||p(n,Symbol.toStringTag,{value:`Module`}),n},__copyProps=(e,t,n,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=h(t),l=0,d=c.length,f;l<d;l++)f=c[l],!_.call(e,f)&&f!==n&&p(e,f,{get:(e=>t[e]).bind(null,f),enumerable:!(s=m(t,f))||s.enumerable});return e},__toESM=(e,t,n)=>(n=e==null?{}:f(g(e)),__copyProps(t||!e||!e.__esModule?p(n,`default`,{value:e,enumerable:!0}):n,e)),v=`@hpcc-js/map`,y=`3.5.9`,b=`3.25.1`;function add_default(e){var t=+this._x.call(null,e),n=+this._y.call(null,e);return add$1(this.cover(t,n),t,n,e)}__name(add_default,`default`);function add$1(e,t,n,s){if(isNaN(t)||isNaN(n))return e;var c,l=e._root,d={data:s},f=e._x0,p=e._y0,m=e._x1,h=e._y1,g,_,v,y,b,x,S,C;if(!l)return e._root=d,e;for(;l.length;)if((b=t>=(g=(f+m)/2))?f=g:m=g,(x=n>=(_=(p+h)/2))?p=_:h=_,c=l,!(l=l[S=x<<1|b]))return c[S]=d,e;if(v=+e._x.call(null,l.data),y=+e._y.call(null,l.data),t===v&&n===y)return d.next=l,c?c[S]=d:e._root=d,e;do c=c?c[S]=[,,,,]:e._root=[,,,,],(b=t>=(g=(f+m)/2))?f=g:m=g,(x=n>=(_=(p+h)/2))?p=_:h=_;while((S=x<<1|b)==(C=(y>=_)<<1|v>=g));return c[C]=l,c[S]=d,e}__name(add$1,`add`);function addAll(e){var t,n,s=e.length,c,l,d=Array(s),f=Array(s),p=1/0,m=1/0,h=-1/0,g=-1/0;for(n=0;n<s;++n)isNaN(c=+this._x.call(null,t=e[n]))||isNaN(l=+this._y.call(null,t))||(d[n]=c,f[n]=l,c<p&&(p=c),c>h&&(h=c),l<m&&(m=l),l>g&&(g=l));if(p>h||m>g)return this;for(this.cover(p,m).cover(h,g),n=0;n<s;++n)add$1(this,d[n],f[n],e[n]);return this}function cover_default(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var n=this._x0,s=this._y0,c=this._x1,l=this._y1;if(isNaN(n))c=(n=Math.floor(e))+1,l=(s=Math.floor(t))+1;else{for(var d=c-n,f=this._root,p,m;n>e||e>=c||s>t||t>=l;)switch(m=(t<s)<<1|e<n,p=[,,,,],p[m]=f,f=p,d*=2,m){case 0:c=n+d,l=s+d;break;case 1:n=c-d,l=s+d;break;case 2:c=n+d,s=l-d;break;case 3:n=c-d,s=l-d;break}this._root&&this._root.length&&(this._root=f)}return this._x0=n,this._y0=s,this._x1=c,this._y1=l,this}__name(cover_default,`default`);function data_default(){var e=[];return this.visit(function(t){if(!t.length)do e.push(t.data);while(t=t.next)}),e}__name(data_default,`default`);function extent_default$1(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}__name(extent_default$1,`default`);function quad_default(e,t,n,s,c){this.node=e,this.x0=t,this.y0=n,this.x1=s,this.y1=c}__name(quad_default,`default`);function find_default(e,t,n){var s,c=this._x0,l=this._y0,d,f,p,m,h=this._x1,g=this._y1,_=[],v=this._root,y,b;for(v&&_.push(new quad_default(v,c,l,h,g)),n==null?n=1/0:(c=e-n,l=t-n,h=e+n,g=t+n,n*=n);y=_.pop();)if(!(!(v=y.node)||(d=y.x0)>h||(f=y.y0)>g||(p=y.x1)<c||(m=y.y1)<l))if(v.length){var x=(d+p)/2,S=(f+m)/2;_.push(new quad_default(v[3],x,S,p,m),new quad_default(v[2],d,S,x,m),new quad_default(v[1],x,f,p,S),new quad_default(v[0],d,f,x,S)),(b=(t>=S)<<1|e>=x)&&(y=_[_.length-1],_[_.length-1]=_[_.length-1-b],_[_.length-1-b]=y)}else{var C=e-+this._x.call(null,v.data),T=t-+this._y.call(null,v.data),E=C*C+T*T;if(E<n){var D=Math.sqrt(n=E);c=e-D,l=t-D,h=e+D,g=t+D,s=v.data}}return s}__name(find_default,`default`);function remove_default(e){if(isNaN(h=+this._x.call(null,e))||isNaN(g=+this._y.call(null,e)))return this;var t,n=this._root,s,c,l,d=this._x0,f=this._y0,p=this._x1,m=this._y1,h,g,_,v,y,b,x,S;if(!n)return this;if(n.length)for(;;){if((y=h>=(_=(d+p)/2))?d=_:p=_,(b=g>=(v=(f+m)/2))?f=v:m=v,t=n,!(n=n[x=b<<1|y]))return this;if(!n.length)break;(t[x+1&3]||t[x+2&3]||t[x+3&3])&&(s=t,S=x)}for(;n.data!==e;)if(c=n,!(n=n.next))return this;return(l=n.next)&&delete n.next,c?(l?c.next=l:delete c.next,this):t?(l?t[x]=l:delete t[x],(n=t[0]||t[1]||t[2]||t[3])&&n===(t[3]||t[2]||t[1]||t[0])&&!n.length&&(s?s[S]=n:this._root=n),this):(this._root=l,this)}__name(remove_default,`default`);function removeAll(e){for(var t=0,n=e.length;t<n;++t)this.remove(e[t]);return this}function root_default(){return this._root}__name(root_default,`default`);function size_default(){var e=0;return this.visit(function(t){if(!t.length)do++e;while(t=t.next)}),e}__name(size_default,`default`);function visit_default(e){var t=[],n,s=this._root,c,l,d,f,p;for(s&&t.push(new quad_default(s,this._x0,this._y0,this._x1,this._y1));n=t.pop();)if(!e(s=n.node,l=n.x0,d=n.y0,f=n.x1,p=n.y1)&&s.length){var m=(l+f)/2,h=(d+p)/2;(c=s[3])&&t.push(new quad_default(c,m,h,f,p)),(c=s[2])&&t.push(new quad_default(c,l,h,m,p)),(c=s[1])&&t.push(new quad_default(c,m,d,f,h)),(c=s[0])&&t.push(new quad_default(c,l,d,m,h))}return this}__name(visit_default,`default`);function visitAfter_default(e){var t=[],n=[],s;for(this._root&&t.push(new quad_default(this._root,this._x0,this._y0,this._x1,this._y1));s=t.pop();){var c=s.node;if(c.length){var l,d=s.x0,f=s.y0,p=s.x1,m=s.y1,h=(d+p)/2,g=(f+m)/2;(l=c[0])&&t.push(new quad_default(l,d,f,h,g)),(l=c[1])&&t.push(new quad_default(l,h,f,p,g)),(l=c[2])&&t.push(new quad_default(l,d,g,h,m)),(l=c[3])&&t.push(new quad_default(l,h,g,p,m))}n.push(s)}for(;s=n.pop();)e(s.node,s.x0,s.y0,s.x1,s.y1);return this}__name(visitAfter_default,`default`);function defaultX(e){return e[0]}function x_default(e){return arguments.length?(this._x=e,this):this._x}__name(x_default,`default`);function defaultY(e){return e[1]}function y_default(e){return arguments.length?(this._y=e,this):this._y}__name(y_default,`default`);function quadtree(e,t,n){var s=new Quadtree$1(t??defaultX,n??defaultY,NaN,NaN,NaN,NaN);return e==null?s:s.addAll(e)}function Quadtree$1(e,t,n,s,c,l){this._x=e,this._y=t,this._x0=n,this._y0=s,this._x1=c,this._y1=l,this._root=void 0}__name(Quadtree$1,`Quadtree`);function leaf_copy(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}var x=quadtree.prototype=Quadtree$1.prototype;x.copy=function(){var e=new Quadtree$1(this._x,this._y,this._x0,this._y0,this._x1,this._y1),t=this._root,n,s;if(!t)return e;if(!t.length)return e._root=leaf_copy(t),e;for(n=[{source:t,target:e._root=[,,,,]}];t=n.pop();)for(var c=0;c<4;++c)(s=t.source[c])&&(s.length?n.push({source:s,target:t.target[c]=[,,,,]}):t.target[c]=leaf_copy(s));return e},x.add=add_default,x.addAll=addAll,x.cover=cover_default,x.data=data_default,x.extent=extent_default$1,x.find=find_default,x.remove=remove_default,x.removeAll=removeAll,x.root=root_default,x.size=size_default,x.visit=visit_default,x.visitAfter=visitAfter_default,x.x=x_default,x.y=y_default;var Quadtree=class{_pin_h=0;_pin_w=0;_tree;constructor(e,t,n,s){this._pin_h=n,this._pin_w=s,this._tree=quadtree().extent(e).addAll(t)}searchRect(e,t,n,s){let c=[];return this._tree.visit((l,d,f,p,m)=>{let h;do l.length||l.data&&!l.data.already_flagged&&overlaps({left:e,right:n,top:t,bottom:s},l.data)&&(l.data.already_flagged=!0,c.push(l.data)),h=l=l.next;while(h);return d>=n||f>=s||p<e||m<t}),c;function overlaps(e,t){return(t[0]<e.right||t[0]>e.left)&&(t[1]<e.bottom||t[1]>e.top)}}getTreeRects(){let e=[];return this._tree.visit((t,n,s,c,l)=>{e.push([n,s,c-n,l-s])}),e}},CanvasPins=class extends t.CanvasWidget{_quadtree_rect_arr;_drawData;_overlap_count=0;_sub_overlap_count=0;constructor(){super()}enter(e,t){super.enter.apply(this,arguments),this.resize(this._size)}update(e,t){super.update.apply(this,arguments),this._ctx=this.element().node().getContext(`2d`);let n=(this.topLeftX_exists()&&this.topLeftY_exists()&&this.bottomRightX_exists()&&this.bottomRightY_exists()?this.skewedData():this.data()).map(e=>[...e]).map(e=>(e.is_cluster=!1,e.already_flagged=!1,e.weight=e[2],e.fillStyle=`#FFFFFF`,e.strokeStyle=`#000000`,e.overlap_arr=[],e));this._ctx.clearRect(0,0,this.width(),this.height()),this._drawData=this.enableClustering()?this.applyClustering(n):n,this.draw(this._drawData)}applyClustering(e){let t=this;this._overlap_count=0;let n=this.pinHeight(),s=this.pinWidth(),c=s/2,l=n/2,d=new Quadtree([[0,0],[this.size().width,this.size().height]],e,n,s);switch(this._quadtree_rect_arr=d.getTreeRects(),this.clusterMode()){case`default`:let t=e.map(e=>{if(!e.already_flagged){let t=this.searchRectMult(),n=e[0]-c*t,s=e[1]-l*t-8,f=e[0]+c*t,p=e[1]+l*t-8;e.overlap_arr=d.searchRect(n,s,f,p).filter(t=>t!==e),e.overlap_arr.length===0&&(e.already_flagged=!1)}return e});return t.forEach(e=>{e.already_flagged&&e.overlap_arr.length&&t.push(cluster_arr([e,...e.overlap_arr]))}),t;case`grid`:let n=[...e],s=this.gridCellSize(),f=this.gridCellSize(),p=Math.ceil(this.size().width/s),m=Math.ceil(this.size().height/f);for(let e=0;e<m;e++)for(let t=0;t<p;t++){let c=s*t,l=f*e,p=s*(t+1),m=f*(e+1),h=d.searchRect(c,l,p,m);if(h.length>1){let e=c+s/2,t=l+f/2;n.push(cluster_arr(h,e,t))}}return n}return e;function cluster_arr(e,n,s){let c=e.reduce((e,t)=>(t.already_flagged=!0,e+t[2]),0);return{0:n===void 0?t.useAveragePos()?e.reduce((e,t)=>e+t[0]*t[2],0)/c:e[0][0]:n,1:s===void 0?t.useAveragePos()?e.reduce((e,t)=>e+t[1]*t[2],0)/c:e[0][1]:s,weight:e.reduce((e,t)=>e+t[2],0),is_cluster:!0,already_flagged:!1,fillStyle:`#FFFFFF`,strokeStyle:`#000000`,overlap_arr:[]}}}drawQuadtree(){this._quadtree_rect_arr&&(this._ctx.strokeStyle=`#000000`,this._quadtree_rect_arr.forEach(e=>{this._ctx.strokeRect(e[0],e[1],e[2],e[3])}))}draw(e){let t=this,n=this._ctx;this.showQuadtree()&&this.drawQuadtree();let s=this.arrowHeight(),c=this.arrowWidth(),l=this.pinHeight(),d=this.pinWidth(),f=this.radiusWeightMult(),p=0;this.useWeightedRadius()&&e.filter(e=>e.is_cluster).forEach(e=>{p<e.weight&&(p=e.weight)}),e.filter(e=>!e.already_flagged).sort((e,t)=>e[1]>t[1]?1:-1).forEach(e=>{if(e.is_cluster||this.allCircles()){let t=d/2;this.useWeightedRadius()&&(t+=d*(f*e.weight/p)),drawCirclePin({icon:e.weight,left:Math.floor(e[0]-t)+.5,top:Math.floor(e[1]-t-s)+.5,radius:t,arrow_height:s,arrow_width:c})}else drawSquarePin({fillStyle:e.fillStyle,strokeStyle:e.strokeStyle,icon:e.weight,left:Math.floor(e[0]-d/2)+.5,top:Math.floor(e[1]-l-s)+.5,width:d,height:l,arrow_height:s,arrow_width:c})});function drawCirclePin(e){e.width=e.radius*2,e.height=e.width,n.fillStyle=`#FFFFFF`,n.strokeStyle=`#000000`,n.beginPath(),n.arc(e.left+e.width/2,e.top+e.height/2,e.radius,0,2*Math.PI),n.closePath(),n.fill(),n.stroke(),drawPinText(e)}function drawSquarePin(e){n.fillStyle=e.fillStyle,n.strokeStyle=`#000000`,n.fillRect(e.left,e.top,e.width,e.height),n.strokeRect(e.left,e.top,e.width,e.height),drawArrow(e),drawPinText(e)}function drawArrow(e,t){let s=e.left+e.width/2-e.arrow_width/2,c=e.left+e.width/2,l=e.left+e.width/2+e.arrow_width/2,d=e.top+e.height,f=d+e.arrow_height,p=d;t?(n.fillStyle=`#FFFFFF`,n.strokeStyle=`#FFFFFF`,d-=2,f-=2,p-=2):(n.fillStyle=`#FFFFFF`,n.strokeStyle=`#000000`),n.beginPath(),n.moveTo(s,d),n.lineTo(c,f),n.lineTo(l,p),n.lineTo(s,d),n.closePath(),n.stroke(),n.fill(),t||drawArrow(e,!0)}function drawPinText(e){n.font=`${t.pinFontSize()}px '${t.pinFontFamily()}'`;let s=e.left+e.width/2,c=e.top+e.height/2;n.textAlign=`center`,n.textBaseline=`middle`,n.fillStyle=`#000000`;let l=0,d=n.measureText(e.icon).width;for(;d>e.width||!t.shrinkFontToPin();)l++,n.font=`${t.pinFontSize()-l}px '${t.pinFontFamily()}'`,d=n.measureText(e.icon).width;n.fillText(e.icon,s,c)}}skewedData(){let e=this,t=[],n=this.data(),s=this.size(),c=this.bottomRightX()-this.topLeftX(),l=this.bottomRightY()-this.topLeftY(),d=c/s.width,f=l/s.height;return n.forEach(function(n){let s=Math.abs(n[0]-e.topLeftX()),c=Math.abs(n[1]-e.topLeftY()),l=s/d,p=c/f;t.push([l,p,n[2]])}),t}};CanvasPins.prototype._class+=` map_CanvasPins`,CanvasPins.prototype.publish(`clusterMode`,`default`,`set`,`clusterMode`,[`defualt`,`grid`],{tags:[`Basic`],optional:!0}),CanvasPins.prototype.publish(`gridCellSize`,80,`number`,`gridCellSize`,null,{tags:[`Basic`],optional:!0}),CanvasPins.prototype.publish(`allCircles`,!1,`boolean`,`allCircles`,null,{tags:[`Basic`],optional:!0}),CanvasPins.prototype.publish(`showQuadtree`,!1,`boolean`,`showQuadtree`,null,{tags:[`Basic`],optional:!0}),CanvasPins.prototype.publish(`useAveragePos`,!1,`boolean`,`useAveragePos`,null,{tags:[`Basic`],optional:!0}),CanvasPins.prototype.publish(`shrinkFontToPin`,!0,`boolean`,`shrinkFontToPin`,null,{tags:[`Basic`],optional:!0}),CanvasPins.prototype.publish(`enableClustering`,!0,`boolean`,`enableClustering`,null,{tags:[`Basic`],optional:!0}),CanvasPins.prototype.publish(`useWeightedRadius`,!1,`boolean`,`useWeightedRadius`,null,{tags:[`Basic`],optional:!0}),CanvasPins.prototype.publish(`radiusWeightMult`,.5,`number`,`radiusWeightMult`,null,{tags:[`Basic`],optional:!0}),CanvasPins.prototype.publish(`searchRectMult`,3,`number`,`searchRectMult`,null,{tags:[`Basic`],optional:!0}),CanvasPins.prototype.publish(`bottomRightX`,null,`number`,`Bottom right x-value`,null,{tags:[`Basic`],optional:!0}),CanvasPins.prototype.publish(`bottomRightY`,null,`number`,`Bottom right y-value`,null,{tags:[`Basic`],optional:!0}),CanvasPins.prototype.publish(`topLeftX`,null,`number`,`Top left x-value`,null,{tags:[`Basic`],optional:!0}),CanvasPins.prototype.publish(`topLeftY`,null,`number`,`Top left y-value`,null,{tags:[`Basic`],optional:!0}),CanvasPins.prototype.publish(`pinHeight`,20,`number`,`pinHeight`,null,{tags:[`Basic`],optional:!0}),CanvasPins.prototype.publish(`pinWidth`,20,`number`,`pinWidth`,null,{tags:[`Basic`],optional:!0}),CanvasPins.prototype.publish(`pinFontFamily`,`Arial`,`string`,`pinFontFamily`,null,{tags:[`Basic`],optional:!0}),CanvasPins.prototype.publish(`pinFontSize`,14,`number`,`pinFontSize`,null,{tags:[`Basic`],optional:!0}),CanvasPins.prototype.publish(`arrowHeight`,8,`number`,`arrowHeight`,null,{tags:[`Basic`],optional:!0}),CanvasPins.prototype.publish(`arrowWidth`,8,`number`,`arrowWidth`,null,{tags:[`Basic`],optional:!0});function adder_default(){return new Adder}__name(adder_default,`default`);function Adder(){this.reset()}Adder.prototype={constructor:Adder,reset:function(){this.s=this.t=0},add:function(e){add(S,e,this.t),add(this,S.s,this.s),this.s?this.t+=S.t:this.s=S.t},valueOf:function(){return this.s}};var S=new Adder;function add(e,t,n){var s=e.s=t+n,c=s-t;e.t=t-(s-c)+(n-c)}var C=1e-6,T=Math.PI,E=T/2,D=T/4,O=T*2,k=180/T,A=T/180,j=Math.abs,M=Math.atan,N=Math.atan2,P=Math.cos,I=Math.ceil,ee=Math.exp,te=Math.log,ne=Math.pow,R=Math.sin,z=Math.sign||function(e){return e>0?1:e<0?-1:0},B=Math.sqrt,re=Math.tan;function acos(e){return e>1?0:e<-1?T:Math.acos(e)}function asin(e){return e>1?E:e<-1?-E:Math.asin(e)}function haversin(e){return(e=R(e/2))*e}function noop$1(){}__name(noop$1,`noop`);function streamGeometry(e,t){e&&ae.hasOwnProperty(e.type)&&ae[e.type](e,t)}var ie={Feature:function(e,t){streamGeometry(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,s=-1,c=n.length;++s<c;)streamGeometry(n[s].geometry,t)}},ae={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,s=-1,c=n.length;++s<c;)e=n[s],t.point(e[0],e[1],e[2])},LineString:function(e,t){streamLine(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,s=-1,c=n.length;++s<c;)streamLine(n[s],t,0)},Polygon:function(e,t){streamPolygon(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,s=-1,c=n.length;++s<c;)streamPolygon(n[s],t)},GeometryCollection:function(e,t){for(var n=e.geometries,s=-1,c=n.length;++s<c;)streamGeometry(n[s],t)}};function streamLine(e,t,n){var s=-1,c=e.length-n,l;for(t.lineStart();++s<c;)l=e[s],t.point(l[0],l[1],l[2]);t.lineEnd()}function streamPolygon(e,t){var n=-1,s=e.length;for(t.polygonStart();++n<s;)streamLine(e[n],t,1);t.polygonEnd()}function stream_default(e,t){e&&ie.hasOwnProperty(e.type)?ie[e.type](e,t):streamGeometry(e,t)}__name(stream_default,`default`);var oe=adder_default(),se=adder_default(),ce,le,ue,de,fe,pe={point:noop$1,lineStart:noop$1,lineEnd:noop$1,polygonStart:function(){oe.reset(),pe.lineStart=areaRingStart$1,pe.lineEnd=areaRingEnd$1},polygonEnd:function(){var e=+oe;se.add(e<0?O+e:e),this.lineStart=this.lineEnd=this.point=noop$1},sphere:function(){se.add(O)}};function areaRingStart$1(){pe.point=areaPointFirst$1}__name(areaRingStart$1,`areaRingStart`);function areaRingEnd$1(){areaPoint$1(ce,le)}__name(areaRingEnd$1,`areaRingEnd`);function areaPointFirst$1(e,t){pe.point=areaPoint$1,ce=e,le=t,e*=A,t*=A,ue=e,de=P(t=t/2+D),fe=R(t)}__name(area_default,`default`),__name(areaPointFirst$1,`areaPointFirst`);function areaPoint$1(e,t){e*=A,t*=A,t=t/2+D;var n=e-ue,s=n>=0?1:-1,c=s*n,l=P(t),d=R(t),f=fe*d,p=de*l+f*P(c),m=f*s*R(c);oe.add(N(m,p)),ue=e,de=l,fe=d}__name(areaPoint$1,`areaPoint`);function area_default(e){return se.reset(),stream_default(e,pe),se*2}function spherical(e){return[N(e[1],e[0]),asin(e[2])]}function cartesian(e){var t=e[0],n=e[1],s=P(n);return[s*P(t),s*R(t),R(n)]}function cartesianDot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function cartesianCross(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function cartesianAddInPlace(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function cartesianScale(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function cartesianNormalizeInPlace(e){var t=B(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var V,me,H,he,ge,_e,ve,ye,be=adder_default(),xe,U,Se={point:boundsPoint$2,lineStart:boundsLineStart,lineEnd:boundsLineEnd,polygonStart:function(){Se.point=boundsRingPoint,Se.lineStart=boundsRingStart,Se.lineEnd=boundsRingEnd,be.reset(),pe.polygonStart()},polygonEnd:function(){pe.polygonEnd(),Se.point=boundsPoint$2,Se.lineStart=boundsLineStart,Se.lineEnd=boundsLineEnd,oe<0?(V=-(H=180),me=-(he=90)):be>1e-6?he=90:be<-1e-6&&(me=-90),U[0]=V,U[1]=H},sphere:function(){V=-(H=180),me=-(he=90)}};function boundsPoint$2(e,t){xe.push(U=[V=e,H=e]),t<me&&(me=t),t>he&&(he=t)}__name(boundsPoint$2,`boundsPoint`);function linePoint(e,t){var n=cartesian([e*A,t*A]);if(ye){var s=cartesianCross(ye,n),c=cartesianCross([s[1],-s[0],0],s);cartesianNormalizeInPlace(c),c=spherical(c);var l=e-ge,d=l>0?1:-1,f=c[0]*k*d,p,m=j(l)>180;m^(d*ge<f&&f<d*e)?(p=c[1]*k,p>he&&(he=p)):(f=(f+360)%360-180,m^(d*ge<f&&f<d*e)?(p=-c[1]*k,p<me&&(me=p)):(t<me&&(me=t),t>he&&(he=t))),m?e<ge?angle(V,e)>angle(V,H)&&(H=e):angle(e,H)>angle(V,H)&&(V=e):H>=V?(e<V&&(V=e),e>H&&(H=e)):e>ge?angle(V,e)>angle(V,H)&&(H=e):angle(e,H)>angle(V,H)&&(V=e)}else xe.push(U=[V=e,H=e]);t<me&&(me=t),t>he&&(he=t),ye=n,ge=e}function boundsLineStart(){Se.point=linePoint}function boundsLineEnd(){U[0]=V,U[1]=H,Se.point=boundsPoint$2,ye=null}function boundsRingPoint(e,t){if(ye){var n=e-ge;be.add(j(n)>180?n+(n>0?360:-360):n)}else _e=e,ve=t;pe.point(e,t),linePoint(e,t)}function boundsRingStart(){pe.lineStart()}function boundsRingEnd(){boundsRingPoint(_e,ve),pe.lineEnd(),j(be)>1e-6&&(V=-(H=180)),U[0]=V,U[1]=H,ye=null}function angle(e,t){return(t-=e)<0?t+360:t}function rangeCompare(e,t){return e[0]-t[0]}function rangeContains(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}__name(bounds_default,`default`);function bounds_default(e){var t,n,s,c,l,d,f;if(he=H=-(V=me=1/0),xe=[],stream_default(e,Se),n=xe.length){for(xe.sort(rangeCompare),t=1,s=xe[0],l=[s];t<n;++t)c=xe[t],rangeContains(s,c[0])||rangeContains(s,c[1])?(angle(s[0],c[1])>angle(s[0],s[1])&&(s[1]=c[1]),angle(c[0],s[1])>angle(s[0],s[1])&&(s[0]=c[0])):l.push(s=c);for(d=-1/0,n=l.length-1,t=0,s=l[n];t<=n;s=c,++t)c=l[t],(f=angle(s[1],c[0]))>d&&(d=f,V=c[0],H=s[1])}return xe=U=null,V===1/0||me===1/0?[[NaN,NaN],[NaN,NaN]]:[[V,me],[H,he]]}var Ce,we,Te,Ee,De,Oe,ke,Ae,je,Me,Ne,Pe,Fe,W,G,K,q={sphere:noop$1,point:centroidPoint$1,lineStart:centroidLineStart$1,lineEnd:centroidLineEnd$1,polygonStart:function(){q.lineStart=centroidRingStart$1,q.lineEnd=centroidRingEnd$1},polygonEnd:function(){q.lineStart=centroidLineStart$1,q.lineEnd=centroidLineEnd$1}};function centroidPoint$1(e,t){e*=A,t*=A;var n=P(t);centroidPointCartesian(n*P(e),n*R(e),R(t))}__name(centroidPoint$1,`centroidPoint`);function centroidPointCartesian(e,t,n){++Ce,Te+=(e-Te)/Ce,Ee+=(t-Ee)/Ce,De+=(n-De)/Ce}function centroidLineStart$1(){q.point=centroidLinePointFirst}__name(centroidLineStart$1,`centroidLineStart`);function centroidLinePointFirst(e,t){e*=A,t*=A;var n=P(t);W=n*P(e),G=n*R(e),K=R(t),q.point=centroidLinePoint,centroidPointCartesian(W,G,K)}function centroidLinePoint(e,t){e*=A,t*=A;var n=P(t),s=n*P(e),c=n*R(e),l=R(t),d=N(B((d=G*l-K*c)*d+(d=K*s-W*l)*d+(d=W*c-G*s)*d),W*s+G*c+K*l);we+=d,Oe+=d*(W+(W=s)),ke+=d*(G+(G=c)),Ae+=d*(K+(K=l)),centroidPointCartesian(W,G,K)}function centroidLineEnd$1(){q.point=centroidPoint$1}__name(centroidLineEnd$1,`centroidLineEnd`);function centroidRingStart$1(){q.point=centroidRingPointFirst}__name(centroidRingStart$1,`centroidRingStart`),__name(centroid_default,`default`);function centroidRingEnd$1(){centroidRingPoint(Pe,Fe),q.point=centroidPoint$1}__name(centroidRingEnd$1,`centroidRingEnd`);function centroidRingPointFirst(e,t){Pe=e,Fe=t,e*=A,t*=A,q.point=centroidRingPoint;var n=P(t);W=n*P(e),G=n*R(e),K=R(t),centroidPointCartesian(W,G,K)}function centroidRingPoint(e,t){e*=A,t*=A;var n=P(t),s=n*P(e),c=n*R(e),l=R(t),d=G*l-K*c,f=K*s-W*l,p=W*c-G*s,m=B(d*d+f*f+p*p),h=asin(m),g=m&&-h/m;je+=g*d,Me+=g*f,Ne+=g*p,we+=h,Oe+=h*(W+(W=s)),ke+=h*(G+(G=c)),Ae+=h*(K+(K=l)),centroidPointCartesian(W,G,K)}function centroid_default(e){Ce=we=Te=Ee=De=Oe=ke=Ae=je=Me=Ne=0,stream_default(e,q);var t=je,n=Me,s=Ne,c=t*t+n*n+s*s;return c<1e-12&&(t=Oe,n=ke,s=Ae,we<1e-6&&(t=Te,n=Ee,s=De),c=t*t+n*n+s*s,c<1e-12)?[NaN,NaN]:[N(n,t)*k,asin(s/B(c))*k]}function constant_default(e){return function(){return e}}__name(constant_default,`default`);function compose_default(e,t){function compose(n,s){return n=e(n,s),t(n[0],n[1])}return e.invert&&t.invert&&(compose.invert=function(n,s){return n=t.invert(n,s),n&&e.invert(n[0],n[1])}),compose}__name(compose_default,`default`);function rotationIdentity(e,t){return[j(e)>T?e+Math.round(-e/O)*O:e,t]}rotationIdentity.invert=rotationIdentity;function rotateRadians(e,t,n){return(e%=O)?t||n?compose_default(rotationLambda(e),rotationPhiGamma(t,n)):rotationLambda(e):t||n?rotationPhiGamma(t,n):rotationIdentity}function forwardRotationLambda(e){return function(t,n){return t+=e,[t>T?t-O:t<-T?t+O:t,n]}}function rotationLambda(e){var t=forwardRotationLambda(e);return t.invert=forwardRotationLambda(-e),t}function rotationPhiGamma(e,t){var n=P(e),s=R(e),c=P(t),l=R(t);function rotation(e,t){var d=P(t),f=P(e)*d,p=R(e)*d,m=R(t),h=m*n+f*s;return[N(p*c-h*l,f*n-m*s),asin(h*c+p*l)]}return rotation.invert=function(e,t){var d=P(t),f=P(e)*d,p=R(e)*d,m=R(t),h=m*c-p*l;return[N(p*c+m*l,f*n+h*s),asin(h*n-f*s)]},rotation}function rotation_default(e){e=rotateRadians(e[0]*A,e[1]*A,e.length>2?e[2]*A:0);function forward(t){return t=e(t[0]*A,t[1]*A),t[0]*=k,t[1]*=k,t}return forward.invert=function(t){return t=e.invert(t[0]*A,t[1]*A),t[0]*=k,t[1]*=k,t},forward}__name(rotation_default,`default`);function circleStream(e,t,n,s,c,l){if(n){var d=P(t),f=R(t),p=s*n;c==null?(c=t+s*O,l=t-p/2):(c=circleRadius(d,c),l=circleRadius(d,l),(s>0?c<l:c>l)&&(c+=s*O));for(var m,h=c;s>0?h>l:h<l;h-=p)m=spherical([d,-f*P(h),-f*R(h)]),e.point(m[0],m[1])}}function circleRadius(e,t){t=cartesian(t),t[0]-=e,cartesianNormalizeInPlace(t);var n=acos(-t[1]);return((-t[2]<0?-n:n)+O-C)%O}function circle_default$1(){var e=constant_default([0,0]),t=constant_default(90),n=constant_default(6),s,c,l={point};function point(e,t){s.push(e=c(e,t)),e[0]*=k,e[1]*=k}function circle(){var d=e.apply(this,arguments),f=t.apply(this,arguments)*A,p=n.apply(this,arguments)*A;return s=[],c=rotateRadians(-d[0]*A,-d[1]*A,0).invert,circleStream(l,f,p,1),d={type:`Polygon`,coordinates:[s]},s=c=null,d}return circle.center=function(t){return arguments.length?(e=typeof t==`function`?t:constant_default([+t[0],+t[1]]),circle):e},circle.radius=function(e){return arguments.length?(t=typeof e==`function`?e:constant_default(+e),circle):t},circle.precision=function(e){return arguments.length?(n=typeof e==`function`?e:constant_default(+e),circle):n},circle}__name(circle_default$1,`default`);function buffer_default(){var e=[],t;return{point:function(e,n,s){t.push([e,n,s])},lineStart:function(){e.push(t=[])},lineEnd:noop$1,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}__name(buffer_default,`default`);function pointEqual_default(e,t){return j(e[0]-t[0])<1e-6&&j(e[1]-t[1])<1e-6}__name(pointEqual_default,`default`);function Intersection(e,t,n,s){this.x=e,this.z=t,this.o=n,this.e=s,this.v=!1,this.n=this.p=null}function rejoin_default(e,t,n,s,c){var l=[],d=[],f,p;if(e.forEach(function(e){if(!((t=e.length-1)<=0)){var t,n=e[0],s=e[t],p;if(pointEqual_default(n,s)){if(!n[2]&&!s[2]){for(c.lineStart(),f=0;f<t;++f)c.point((n=e[f])[0],n[1]);c.lineEnd();return}s[0]+=2*C}l.push(p=new Intersection(n,e,null,!0)),d.push(p.o=new Intersection(n,null,p,!1)),l.push(p=new Intersection(s,e,null,!1)),d.push(p.o=new Intersection(s,null,p,!0))}}),l.length){for(d.sort(t),link(l),link(d),f=0,p=d.length;f<p;++f)d[f].e=n=!n;for(var m=l[0],h,g;;){for(var _=m,v=!0;_.v;)if((_=_.n)===m)return;h=_.z,c.lineStart();do{if(_.v=_.o.v=!0,_.e){if(v)for(f=0,p=h.length;f<p;++f)c.point((g=h[f])[0],g[1]);else s(_.x,_.n.x,1,c);_=_.n}else{if(v)for(h=_.p.z,f=h.length-1;f>=0;--f)c.point((g=h[f])[0],g[1]);else s(_.x,_.p.x,-1,c);_=_.p}_=_.o,h=_.z,v=!v}while(!_.v);c.lineEnd()}}}__name(rejoin_default,`default`);function link(e){if(t=e.length){for(var t,n=0,s=e[0],c;++n<t;)s.n=c=e[n],c.p=s,s=c;s.n=c=e[0],c.p=s}}var Ie=adder_default();function longitude(e){return j(e[0])<=T?e[0]:z(e[0])*((j(e[0])+T)%O-T)}function polygonContains_default(e,t){var n=longitude(t),s=t[1],c=R(s),l=[R(n),-P(n),0],d=0,f=0;Ie.reset(),c===1?s=E+C:c===-1&&(s=-E-C);for(var p=0,m=e.length;p<m;++p)if(g=(h=e[p]).length)for(var h,g,_=h[g-1],v=longitude(_),y=_[1]/2+D,b=R(y),x=P(y),S=0;S<g;++S,v=A,b=M,x=I,_=k){var k=h[S],A=longitude(k),j=k[1]/2+D,M=R(j),I=P(j),ee=A-v,te=ee>=0?1:-1,ne=te*ee,z=ne>T,B=b*M;if(Ie.add(N(B*te*R(ne),x*I+B*P(ne))),d+=z?ee+te*O:ee,z^v>=n^A>=n){var re=cartesianCross(cartesian(_),cartesian(k));cartesianNormalizeInPlace(re);var ie=cartesianCross(l,re);cartesianNormalizeInPlace(ie);var ae=(z^ee>=0?-1:1)*asin(ie[2]);(s>ae||s===ae&&(re[0]||re[1]))&&(f+=z^ee>=0?1:-1)}}return(d<-1e-6||d<1e-6&&Ie<-1e-6)^f&1}__name(polygonContains_default,`default`);function clip_default(e,n,s,c){return function(l){var d=n(l),f=buffer_default(),p=n(f),m=!1,h,g,_,v={point,lineStart,lineEnd,polygonStart:function(){v.point=pointRing,v.lineStart=ringStart,v.lineEnd=ringEnd,g=[],h=[]},polygonEnd:function(){v.point=point,v.lineStart=lineStart,v.lineEnd=lineEnd,g=(0,t.merge)(g);var e=polygonContains_default(h,c);g.length?(m||=(l.polygonStart(),!0),rejoin_default(g,compareIntersection,e,s,l)):e&&(m||=(l.polygonStart(),!0),l.lineStart(),s(null,null,1,l),l.lineEnd()),m&&=(l.polygonEnd(),!1),g=h=null},sphere:function(){l.polygonStart(),l.lineStart(),s(null,null,1,l),l.lineEnd(),l.polygonEnd()}};function point(t,n){e(t,n)&&l.point(t,n)}function pointLine(e,t){d.point(e,t)}function lineStart(){v.point=pointLine,d.lineStart()}function lineEnd(){v.point=point,d.lineEnd()}function pointRing(e,t){_.push([e,t]),p.point(e,t)}function ringStart(){p.lineStart(),_=[]}function ringEnd(){pointRing(_[0][0],_[0][1]),p.lineEnd();var e=p.clean(),t=f.result(),n,s=t.length,c,d,v;if(_.pop(),h.push(_),_=null,s){if(e&1){if(d=t[0],(c=d.length-1)>0){for(m||=(l.polygonStart(),!0),l.lineStart(),n=0;n<c;++n)l.point((v=d[n])[0],v[1]);l.lineEnd()}return}s>1&&e&2&&t.push(t.pop().concat(t.shift())),g.push(t.filter(validSegment))}}return v}}__name(clip_default,`default`);function validSegment(e){return e.length>1}function compareIntersection(e,t){return((e=e.x)[0]<0?e[1]-E-C:E-e[1])-((t=t.x)[0]<0?t[1]-E-C:E-t[1])}var Le=clip_default(function(){return!0},clipAntimeridianLine,clipAntimeridianInterpolate,[-T,-E]);function clipAntimeridianLine(e){var t=NaN,n=NaN,s=NaN,c;return{lineStart:function(){e.lineStart(),c=1},point:function(l,d){var f=l>0?T:-T,p=j(l-t);j(p-T)<1e-6?(e.point(t,n=(n+d)/2>0?E:-E),e.point(s,n),e.lineEnd(),e.lineStart(),e.point(f,n),e.point(l,n),c=0):s!==f&&p>=T&&(j(t-s)<1e-6&&(t-=s*C),j(l-f)<1e-6&&(l-=f*C),n=clipAntimeridianIntersect(t,n,l,d),e.point(s,n),e.lineEnd(),e.lineStart(),e.point(f,n),c=0),e.point(t=l,n=d),s=f},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-c}}}function clipAntimeridianIntersect(e,t,n,s){var c,l,d=R(e-n);return j(d)>1e-6?M((R(t)*(l=P(s))*R(n)-R(s)*(c=P(t))*R(e))/(c*l*d)):(t+s)/2}function clipAntimeridianInterpolate(e,t,n,s){var c;if(e==null)c=n*E,s.point(-T,c),s.point(0,c),s.point(T,c),s.point(T,0),s.point(T,-c),s.point(0,-c),s.point(-T,-c),s.point(-T,0),s.point(-T,c);else if(j(e[0]-t[0])>1e-6){var l=e[0]<t[0]?T:-T;c=n*l/2,s.point(-l,c),s.point(0,c),s.point(l,c)}else s.point(t[0],t[1])}function circle_default(e){var t=P(e),n=6*A,s=t>0,c=j(t)>C;function interpolate(t,s,c,l){circleStream(l,e,n,c,t,s)}function visible(e,n){return P(e)*P(n)>t}function clipLine(e){var t,n,l,d,f;return{lineStart:function(){d=l=!1,f=1},point:function(p,m){var h=[p,m],g,_=visible(p,m),v=s?_?0:code(p,m):_?code(p+(p<0?T:-T),m):0;if(!t&&(d=l=_)&&e.lineStart(),_!==l&&(g=intersect(t,h),(!g||pointEqual_default(t,g)||pointEqual_default(h,g))&&(h[2]=1)),_!==l)f=0,_?(e.lineStart(),g=intersect(h,t),e.point(g[0],g[1])):(g=intersect(t,h),e.point(g[0],g[1],2),e.lineEnd()),t=g;else if(c&&t&&s^_){var y;!(v&n)&&(y=intersect(h,t,!0))&&(f=0,s?(e.lineStart(),e.point(y[0][0],y[0][1]),e.point(y[1][0],y[1][1]),e.lineEnd()):(e.point(y[1][0],y[1][1]),e.lineEnd(),e.lineStart(),e.point(y[0][0],y[0][1],3)))}_&&(!t||!pointEqual_default(t,h))&&e.point(h[0],h[1]),t=h,l=_,n=v},lineEnd:function(){l&&e.lineEnd(),t=null},clean:function(){return f|(d&&l)<<1}}}function intersect(e,n,s){var c=cartesian(e),l=cartesian(n),d=[1,0,0],f=cartesianCross(c,l),p=cartesianDot(f,f),m=f[0],h=p-m*m;if(!h)return!s&&e;var g=t*p/h,_=-t*m/h,v=cartesianCross(d,f),y=cartesianScale(d,g);cartesianAddInPlace(y,cartesianScale(f,_));var b=v,x=cartesianDot(y,b),S=cartesianDot(b,b),E=x*x-S*(cartesianDot(y,y)-1);if(!(E<0)){var D=B(E),O=cartesianScale(b,(-x-D)/S);if(cartesianAddInPlace(O,y),O=spherical(O),!s)return O;var k=e[0],A=n[0],M=e[1],N=n[1],P;A<k&&(P=k,k=A,A=P);var I=A-k,ee=j(I-T)<C,te=ee||I<1e-6;if(!ee&&N<M&&(P=M,M=N,N=P),te?ee?M+N>0^O[1]<(j(O[0]-k)<1e-6?M:N):M<=O[1]&&O[1]<=N:I>T^(k<=O[0]&&O[0]<=A)){var ne=cartesianScale(b,(-x+D)/S);return cartesianAddInPlace(ne,y),[O,spherical(ne)]}}}function code(t,n){var c=s?e:T-e,l=0;return t<-c?l|=1:t>c&&(l|=2),n<-c?l|=4:n>c&&(l|=8),l}return clip_default(visible,clipLine,interpolate,s?[0,-e]:[-T,e-T])}__name(circle_default,`default`);function line_default(e,t,n,s,c,l){var d=e[0],f=e[1],p=t[0],m=t[1],h=0,g=1,_=p-d,v=m-f,y=n-d;if(!(!_&&y>0)){if(y/=_,_<0){if(y<h)return;y<g&&(g=y)}else if(_>0){if(y>g)return;y>h&&(h=y)}if(y=c-d,!(!_&&y<0)){if(y/=_,_<0){if(y>g)return;y>h&&(h=y)}else if(_>0){if(y<h)return;y<g&&(g=y)}if(y=s-f,!(!v&&y>0)){if(y/=v,v<0){if(y<h)return;y<g&&(g=y)}else if(v>0){if(y>g)return;y>h&&(h=y)}if(y=l-f,!(!v&&y<0)){if(y/=v,v<0){if(y>g)return;y>h&&(h=y)}else if(v>0){if(y<h)return;y<g&&(g=y)}return h>0&&(e[0]=d+h*_,e[1]=f+h*v),g<1&&(t[0]=d+g*_,t[1]=f+g*v),!0}}}}}__name(line_default,`default`);var Re=1e9,ze=-Re;function clipRectangle(e,n,s,c){function visible(t,l){return e<=t&&t<=s&&n<=l&&l<=c}function interpolate(t,l,d,f){var p=0,m=0;if(t==null||(p=corner(t,d))!==(m=corner(l,d))||comparePoint(t,l)<0^d>0)do f.point(p===0||p===3?e:s,p>1?c:n);while((p=(p+d+4)%4)!==m);else f.point(l[0],l[1])}function corner(t,c){return j(t[0]-e)<1e-6?c>0?0:3:j(t[0]-s)<1e-6?c>0?2:1:j(t[1]-n)<1e-6?+(c>0):c>0?3:2}function compareIntersection(e,t){return comparePoint(e.x,t.x)}function comparePoint(e,t){var n=corner(e,1),s=corner(t,1);return n===s?n===0?t[1]-e[1]:n===1?e[0]-t[0]:n===2?e[1]-t[1]:t[0]-e[0]:n-s}return function(l){var d=l,f=buffer_default(),p,m,h,g,_,v,y,b,x,S,C,T={point,lineStart,lineEnd,polygonStart,polygonEnd};function point(e,t){visible(e,t)&&d.point(e,t)}function polygonInside(){for(var t=0,n=0,s=m.length;n<s;++n)for(var l=m[n],d=1,f=l.length,p=l[0],h,g,_=p[0],v=p[1];d<f;++d)h=_,g=v,p=l[d],_=p[0],v=p[1],g<=c?v>c&&(_-h)*(c-g)>(v-g)*(e-h)&&++t:v<=c&&(_-h)*(c-g)<(v-g)*(e-h)&&--t;return t}function polygonStart(){d=f,p=[],m=[],C=!0}function polygonEnd(){var e=polygonInside(),n=C&&e,s=(p=(0,t.merge)(p)).length;(n||s)&&(l.polygonStart(),n&&(l.lineStart(),interpolate(null,null,1,l),l.lineEnd()),s&&rejoin_default(p,compareIntersection,e,interpolate,l),l.polygonEnd()),d=l,p=m=h=null}function lineStart(){T.point=linePoint,m&&m.push(h=[]),S=!0,x=!1,y=b=NaN}function lineEnd(){p&&(linePoint(g,_),v&&x&&f.rejoin(),p.push(f.result())),T.point=point,x&&d.lineEnd()}function linePoint(t,l){var f=visible(t,l);if(m&&h.push([t,l]),S)g=t,_=l,v=f,S=!1,f&&(d.lineStart(),d.point(t,l));else if(f&&x)d.point(t,l);else{var p=[y=Math.max(ze,Math.min(Re,y)),b=Math.max(ze,Math.min(Re,b))],T=[t=Math.max(ze,Math.min(Re,t)),l=Math.max(ze,Math.min(Re,l))];line_default(p,T,e,n,s,c)?(x||(d.lineStart(),d.point(p[0],p[1])),d.point(T[0],T[1]),f||d.lineEnd(),C=!1):f&&(d.lineStart(),d.point(t,l),C=!1)}y=t,b=l,x=f}return T}}function extent_default(){var e=0,t=0,n=960,s=500,c,l,d;return d={stream:function(d){return c&&l===d?c:c=clipRectangle(e,t,n,s)(l=d)},extent:function(f){return arguments.length?(e=+f[0][0],t=+f[0][1],n=+f[1][0],s=+f[1][1],c=l=null,d):[[e,t],[n,s]]}}}__name(extent_default,`default`);var J=adder_default(),Be,Ve,He,Ue={sphere:noop$1,point:noop$1,lineStart:lengthLineStart,lineEnd:noop$1,polygonStart:noop$1,polygonEnd:noop$1};function lengthLineStart(){Ue.point=lengthPointFirst$1,Ue.lineEnd=lengthLineEnd}function lengthLineEnd(){Ue.point=Ue.lineEnd=noop$1}function lengthPointFirst$1(e,t){e*=A,t*=A,Be=e,Ve=R(t),He=P(t),Ue.point=lengthPoint$1}__name(lengthPointFirst$1,`lengthPointFirst`);function lengthPoint$1(e,t){e*=A,t*=A;var n=R(t),s=P(t),c=j(e-Be),l=P(c),d=s*R(c),f=He*n-Ve*s*l,p=Ve*n+He*s*l;J.add(N(B(d*d+f*f),p)),Be=e,Ve=n,He=s}__name(length_default,`default`),__name(lengthPoint$1,`lengthPoint`);function length_default(e){return J.reset(),stream_default(e,Ue),+J}var We=[null,null],Ge={type:`LineString`,coordinates:We};function distance_default(e,t){return We[0]=e,We[1]=t,length_default(Ge)}__name(distance_default,`default`);var Ke={Feature:function(e,t){return containsGeometry(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,s=-1,c=n.length;++s<c;)if(containsGeometry(n[s].geometry,t))return!0;return!1}},qe={Sphere:function(){return!0},Point:function(e,t){return containsPoint(e.coordinates,t)},MultiPoint:function(e,t){for(var n=e.coordinates,s=-1,c=n.length;++s<c;)if(containsPoint(n[s],t))return!0;return!1},LineString:function(e,t){return containsLine(e.coordinates,t)},MultiLineString:function(e,t){for(var n=e.coordinates,s=-1,c=n.length;++s<c;)if(containsLine(n[s],t))return!0;return!1},Polygon:function(e,t){return containsPolygon(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,s=-1,c=n.length;++s<c;)if(containsPolygon(n[s],t))return!0;return!1},GeometryCollection:function(e,t){for(var n=e.geometries,s=-1,c=n.length;++s<c;)if(containsGeometry(n[s],t))return!0;return!1}};function containsGeometry(e,t){return e&&qe.hasOwnProperty(e.type)?qe[e.type](e,t):!1}function containsPoint(e,t){return distance_default(e,t)===0}function containsLine(e,t){for(var n,s,c,l=0,d=e.length;l<d;l++){if(s=distance_default(e[l],t),s===0||l>0&&(c=distance_default(e[l],e[l-1]),c>0&&n<=c&&s<=c&&(n+s-c)*(1-((n-s)/c)**2)<1e-12*c))return!0;n=s}return!1}function containsPolygon(e,t){return!!polygonContains_default(e.map(ringRadians),pointRadians(t))}function ringRadians(e){return e=e.map(pointRadians),e.pop(),e}function pointRadians(e){return[e[0]*A,e[1]*A]}function contains_default(e,t){return(e&&Ke.hasOwnProperty(e.type)?Ke[e.type]:containsGeometry)(e,t)}__name(contains_default,`default`);function graticuleX(e,n,s){var c=(0,t.range)(e,n-C,s).concat(n);return function(e){return c.map(function(t){return[e,t]})}}function graticuleY(e,n,s){var c=(0,t.range)(e,n-C,s).concat(n);return function(e){return c.map(function(t){return[t,e]})}}function graticule(){var e,n,s,c,l,d,f,p,m=10,h=m,g=90,_=360,v,y,b,x,S=2.5;function graticule(){return{type:`MultiLineString`,coordinates:lines()}}function lines(){return(0,t.range)(I(c/g)*g,s,g).map(b).concat((0,t.range)(I(p/_)*_,f,_).map(x)).concat((0,t.range)(I(n/m)*m,e,m).filter(function(e){return j(e%g)>C}).map(v)).concat((0,t.range)(I(d/h)*h,l,h).filter(function(e){return j(e%_)>C}).map(y))}return graticule.lines=function(){return lines().map(function(e){return{type:`LineString`,coordinates:e}})},graticule.outline=function(){return{type:`Polygon`,coordinates:[b(c).concat(x(f).slice(1),b(s).reverse().slice(1),x(p).reverse().slice(1))]}},graticule.extent=function(e){return arguments.length?graticule.extentMajor(e).extentMinor(e):graticule.extentMinor()},graticule.extentMajor=function(e){return arguments.length?(c=+e[0][0],s=+e[1][0],p=+e[0][1],f=+e[1][1],c>s&&(e=c,c=s,s=e),p>f&&(e=p,p=f,f=e),graticule.precision(S)):[[c,p],[s,f]]},graticule.extentMinor=function(t){return arguments.length?(n=+t[0][0],e=+t[1][0],d=+t[0][1],l=+t[1][1],n>e&&(t=n,n=e,e=t),d>l&&(t=d,d=l,l=t),graticule.precision(S)):[[n,d],[e,l]]},graticule.step=function(e){return arguments.length?graticule.stepMajor(e).stepMinor(e):graticule.stepMinor()},graticule.stepMajor=function(e){return arguments.length?(g=+e[0],_=+e[1],graticule):[g,_]},graticule.stepMinor=function(e){return arguments.length?(m=+e[0],h=+e[1],graticule):[m,h]},graticule.precision=function(t){return arguments.length?(S=+t,v=graticuleX(d,l,90),y=graticuleY(n,e,S),b=graticuleX(p,f,90),x=graticuleY(c,s,S),graticule):S},graticule.extentMajor([[-180,-90+C],[180,90-C]]).extentMinor([[-180,-80-C],[180,80+C]])}function graticule10(){return graticule()()}function interpolate_default(e,t){var n=e[0]*A,s=e[1]*A,c=t[0]*A,l=t[1]*A,d=P(s),f=R(s),p=P(l),m=R(l),h=d*P(n),g=d*R(n),_=p*P(c),v=p*R(c),y=2*asin(B(haversin(l-s)+d*p*haversin(c-n))),b=R(y),x=y?function(e){var t=R(e*=y)/b,n=R(y-e)/b,s=n*h+t*_,c=n*g+t*v,l=n*f+t*m;return[N(c,s)*k,N(l,B(s*s+c*c))*k]}:function(){return[n*k,s*k]};return x.distance=y,x}__name(interpolate_default,`default`);function identity_default$2(e){return e}__name(identity_default$2,`default`);var Je=adder_default(),Ye=adder_default(),Xe,Ze,Qe,$e,et={point:noop$1,lineStart:noop$1,lineEnd:noop$1,polygonStart:function(){et.lineStart=areaRingStart,et.lineEnd=areaRingEnd},polygonEnd:function(){et.lineStart=et.lineEnd=et.point=noop$1,Je.add(j(Ye)),Ye.reset()},result:function(){var e=Je/2;return Je.reset(),e}};function areaRingStart(){et.point=areaPointFirst}function areaPointFirst(e,t){et.point=areaPoint,Xe=Qe=e,Ze=$e=t}function areaPoint(e,t){Ye.add($e*e-Qe*t),Qe=e,$e=t}function areaRingEnd(){areaPoint(Xe,Ze)}var tt=1/0,nt=tt,rt=-tt,it=rt,at={point:boundsPoint$1,lineStart:noop$1,lineEnd:noop$1,polygonStart:noop$1,polygonEnd:noop$1,result:function(){var e=[[tt,nt],[rt,it]];return rt=it=-(nt=tt=1/0),e}};function boundsPoint$1(e,t){e<tt&&(tt=e),e>rt&&(rt=e),t<nt&&(nt=t),t>it&&(it=t)}__name(boundsPoint$1,`boundsPoint`);var ot=0,st=0,ct=0,lt=0,ut=0,dt=0,ft=0,pt=0,mt=0,ht,gt,_t,vt,yt={point:centroidPoint,lineStart:centroidLineStart,lineEnd:centroidLineEnd,polygonStart:function(){yt.lineStart=centroidRingStart,yt.lineEnd=centroidRingEnd},polygonEnd:function(){yt.point=centroidPoint,yt.lineStart=centroidLineStart,yt.lineEnd=centroidLineEnd},result:function(){var e=mt?[ft/mt,pt/mt]:dt?[lt/dt,ut/dt]:ct?[ot/ct,st/ct]:[NaN,NaN];return ot=st=ct=lt=ut=dt=ft=pt=mt=0,e}};function centroidPoint(e,t){ot+=e,st+=t,++ct}function centroidLineStart(){yt.point=centroidPointFirstLine}function centroidPointFirstLine(e,t){yt.point=centroidPointLine,centroidPoint(_t=e,vt=t)}function centroidPointLine(e,t){var n=e-_t,s=t-vt,c=B(n*n+s*s);lt+=c*(_t+e)/2,ut+=c*(vt+t)/2,dt+=c,centroidPoint(_t=e,vt=t)}function centroidLineEnd(){yt.point=centroidPoint}function centroidRingStart(){yt.point=centroidPointFirstRing}function centroidRingEnd(){centroidPointRing(ht,gt)}function centroidPointFirstRing(e,t){yt.point=centroidPointRing,centroidPoint(ht=_t=e,gt=vt=t)}function centroidPointRing(e,t){var n=e-_t,s=t-vt,c=B(n*n+s*s);lt+=c*(_t+e)/2,ut+=c*(vt+t)/2,dt+=c,c=vt*e-_t*t,ft+=c*(_t+e),pt+=c*(vt+t),mt+=c*3,centroidPoint(_t=e,vt=t)}function PathContext(e){this._context=e}PathContext.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:this._context.moveTo(e,t),this._point=1;break;case 1:this._context.lineTo(e,t);break;default:this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,O);break}},result:noop$1};var bt=adder_default(),xt,St,Ct,wt,Tt,Et={point:noop$1,lineStart:function(){Et.point=lengthPointFirst},lineEnd:function(){xt&&lengthPoint(St,Ct),Et.point=noop$1},polygonStart:function(){xt=!0},polygonEnd:function(){xt=null},result:function(){var e=+bt;return bt.reset(),e}};function lengthPointFirst(e,t){Et.point=lengthPoint,St=wt=e,Ct=Tt=t}function lengthPoint(e,t){wt-=e,Tt-=t,bt.add(B(wt*wt+Tt*Tt)),wt=e,Tt=t}function PathString(){this._string=[]}PathString.prototype={_radius:4.5,_circle:circle(4.5),pointRadius:function(e){return(e=+e)!==this._radius&&(this._radius=e,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._string.push(`Z`),this._point=NaN},point:function(e,t){switch(this._point){case 0:this._string.push(`M`,e,`,`,t),this._point=1;break;case 1:this._string.push(`L`,e,`,`,t);break;default:this._circle??=circle(this._radius),this._string.push(`M`,e,`,`,t,this._circle);break}},result:function(){if(this._string.length){var e=this._string.join(``);return this._string=[],e}else return null}};function circle(e){return`m0,`+e+`a`+e+`,`+e+` 0 1,1 0,`+-2*e+`a`+e+`,`+e+` 0 1,1 0,`+2*e+`z`}function path_default(e,t){var n=4.5,s,c;function path(e){return e&&(typeof n==`function`&&c.pointRadius(+n.apply(this,arguments)),stream_default(e,s(c))),c.result()}return path.area=function(e){return stream_default(e,s(et)),et.result()},path.measure=function(e){return stream_default(e,s(Et)),Et.result()},path.bounds=function(e){return stream_default(e,s(at)),at.result()},path.centroid=function(e){return stream_default(e,s(yt)),yt.result()},path.projection=function(t){return arguments.length?(s=t==null?(e=null,identity_default$2):(e=t).stream,path):e},path.context=function(e){return arguments.length?(c=e==null?(t=null,new PathString):new PathContext(t=e),typeof n!=`function`&&c.pointRadius(n),path):t},path.pointRadius=function(e){return arguments.length?(n=typeof e==`function`?e:(c.pointRadius(+e),+e),path):n},path.projection(e).context(t)}__name(path_default,`default`);function transform_default$1(e){return{stream:transformer(e)}}__name(transform_default$1,`default`);function transformer(e){return function(t){var n=new TransformStream;for(var s in e)n[s]=e[s];return n.stream=t,n}}function TransformStream(){}TransformStream.prototype={constructor:TransformStream,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function fit(e,t,n){var s=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),s!=null&&e.clipExtent(null),stream_default(n,e.stream(at)),t(at.result()),s!=null&&e.clipExtent(s),e}function fitExtent$1(e,t,n){return fit(e,function(n){var s=t[1][0]-t[0][0],c=t[1][1]-t[0][1],l=Math.min(s/(n[1][0]-n[0][0]),c/(n[1][1]-n[0][1])),d=+t[0][0]+(s-l*(n[1][0]+n[0][0]))/2,f=+t[0][1]+(c-l*(n[1][1]+n[0][1]))/2;e.scale(150*l).translate([d,f])},n)}__name(fitExtent$1,`fitExtent`);function fitSize$1(e,t,n){return fitExtent$1(e,[[0,0],t],n)}__name(fitSize$1,`fitSize`);function fitWidth(e,t,n){return fit(e,function(n){var s=+t,c=s/(n[1][0]-n[0][0]),l=(s-c*(n[1][0]+n[0][0]))/2,d=-c*n[0][1];e.scale(150*c).translate([l,d])},n)}function fitHeight(e,t,n){return fit(e,function(n){var s=+t,c=s/(n[1][1]-n[0][1]),l=-c*n[0][0],d=(s-c*(n[1][1]+n[0][1]))/2;e.scale(150*c).translate([l,d])},n)}var Dt=16,Ot=P(30*A);function resample_default(e,t){return+t?resample(e,t):resampleNone(e)}__name(resample_default,`default`);function resampleNone(e){return transformer({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function resample(e,t){function resampleLineTo(n,s,c,l,d,f,p,m,h,g,_,v,y,b){var x=p-n,S=m-s,C=x*x+S*S;if(C>4*t&&y--){var T=l+g,E=d+_,D=f+v,O=B(T*T+E*E+D*D),k=asin(D/=O),A=j(j(D)-1)<1e-6||j(c-h)<1e-6?(c+h)/2:N(E,T),M=e(A,k),P=M[0],I=M[1],ee=P-n,te=I-s,ne=S*ee-x*te;(ne*ne/C>t||j((x*ee+S*te)/C-.5)>.3||l*g+d*_+f*v<Ot)&&(resampleLineTo(n,s,c,l,d,f,P,I,A,T/=O,E/=O,D,y,b),b.point(P,I),resampleLineTo(P,I,A,T,E,D,p,m,h,g,_,v,y,b))}}return function(t){var n,s,c,l,d,f,p,m,h,g,_,v,y={point,lineStart,lineEnd,polygonStart:function(){t.polygonStart(),y.lineStart=ringStart},polygonEnd:function(){t.polygonEnd(),y.lineStart=lineStart}};function point(n,s){n=e(n,s),t.point(n[0],n[1])}function lineStart(){m=NaN,y.point=linePoint,t.lineStart()}function linePoint(n,s){var c=cartesian([n,s]),l=e(n,s);resampleLineTo(m,h,p,g,_,v,m=l[0],h=l[1],p=n,g=c[0],_=c[1],v=c[2],Dt,t),t.point(m,h)}function lineEnd(){y.point=point,t.lineEnd()}function ringStart(){lineStart(),y.point=ringPoint,y.lineEnd=ringEnd}function ringPoint(e,t){linePoint(n=e,t),s=m,c=h,l=g,d=_,f=v,y.point=linePoint}function ringEnd(){resampleLineTo(m,h,p,g,_,v,s,c,n,l,d,f,Dt,t),y.lineEnd=lineEnd,lineEnd()}return y}}var kt=transformer({point:function(e,t){this.stream.point(e*A,t*A)}});function transformRotate(e){return transformer({point:function(t,n){var s=e(t,n);return this.stream.point(s[0],s[1])}})}function scaleTranslate(e,t,n,s,c){function transform(l,d){return l*=s,d*=c,[t+e*l,n-e*d]}return transform.invert=function(l,d){return[(l-t)/e*s,(n-d)/e*c]},transform}function scaleTranslateRotate(e,t,n,s,c,l){var d=P(l),f=R(l),p=d*e,m=f*e,h=d/e,g=f/e,_=(f*n-d*t)/e,v=(f*t+d*n)/e;function transform(e,l){return e*=s,l*=c,[p*e-m*l+t,n-m*e-p*l]}return transform.invert=function(e,t){return[s*(h*e-g*t+_),c*(v-g*e-h*t)]},transform}function projection(e){return projectionMutator(function(){return e})()}function projectionMutator(e){var t,n=150,s=480,c=250,l=0,d=0,f=0,p=0,m=0,h,g=0,_=1,v=1,y=null,b=Le,x=null,S,C,T,E=identity_default$2,D=.5,O,j,M,N,P;function projection(e){return M(e[0]*A,e[1]*A)}function invert(e){return e=M.invert(e[0],e[1]),e&&[e[0]*k,e[1]*k]}projection.stream=function(e){return N&&P===e?N:N=kt(transformRotate(h)(b(O(E(P=e)))))},projection.preclip=function(e){return arguments.length?(b=e,y=void 0,reset()):b},projection.postclip=function(e){return arguments.length?(E=e,x=S=C=T=null,reset()):E},projection.clipAngle=function(e){return arguments.length?(b=+e?circle_default(y=e*A):(y=null,Le),reset()):y*k},projection.clipExtent=function(e){return arguments.length?(E=e==null?(x=S=C=T=null,identity_default$2):clipRectangle(x=+e[0][0],S=+e[0][1],C=+e[1][0],T=+e[1][1]),reset()):x==null?null:[[x,S],[C,T]]},projection.scale=function(e){return arguments.length?(n=+e,recenter()):n},projection.translate=function(e){return arguments.length?(s=+e[0],c=+e[1],recenter()):[s,c]},projection.center=function(e){return arguments.length?(l=e[0]%360*A,d=e[1]%360*A,recenter()):[l*k,d*k]},projection.rotate=function(e){return arguments.length?(f=e[0]%360*A,p=e[1]%360*A,m=e.length>2?e[2]%360*A:0,recenter()):[f*k,p*k,m*k]},projection.angle=function(e){return arguments.length?(g=e%360*A,recenter()):g*k},projection.reflectX=function(e){return arguments.length?(_=e?-1:1,recenter()):_<0},projection.reflectY=function(e){return arguments.length?(v=e?-1:1,recenter()):v<0},projection.precision=function(e){return arguments.length?(O=resample_default(j,D=e*e),reset()):B(D)},projection.fitExtent=function(e,t){return fitExtent$1(projection,e,t)},projection.fitSize=function(e,t){return fitSize$1(projection,e,t)},projection.fitWidth=function(e,t){return fitWidth(projection,e,t)},projection.fitHeight=function(e,t){return fitHeight(projection,e,t)};function recenter(){var e=scaleTranslateRotate(n,0,0,_,v,g).apply(null,t(l,d)),y=(g?scaleTranslateRotate:scaleTranslate)(n,s-e[0],c-e[1],_,v,g);return h=rotateRadians(f,p,m),j=compose_default(t,y),M=compose_default(h,j),O=resample_default(j,D),reset()}function reset(){return N=P=null,projection}return function(){return t=e.apply(this,arguments),projection.invert=t.invert&&invert,recenter()}}function conicProjection(e){var t=0,n=T/3,s=projectionMutator(e),c=s(t,n);return c.parallels=function(e){return arguments.length?s(t=e[0]*A,n=e[1]*A):[t*k,n*k]},c}function cylindricalEqualAreaRaw(e){var t=P(e);function forward(e,n){return[e*t,R(n)/t]}return forward.invert=function(e,n){return[e/t,asin(n*t)]},forward}function conicEqualAreaRaw(e,t){var n=R(e),s=(n+R(t))/2;if(j(s)<1e-6)return cylindricalEqualAreaRaw(e);var c=1+n*(2*s-n),l=B(c)/s;function project(e,t){var n=B(c-2*s*R(t))/s;return[n*R(e*=s),l-n*P(e)]}return project.invert=function(e,t){var n=l-t,d=N(e,j(n))*z(n);return n*s<0&&(d-=T*z(e)*z(n)),[d/s,asin((c-(e*e+n*n)*s*s)/(2*s))]},project}function conicEqualArea_default(){return conicProjection(conicEqualAreaRaw).scale(155.424).center([0,33.6442])}__name(conicEqualArea_default,`default`);function albers_default(){return conicEqualArea_default().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}__name(albers_default,`default`);function multiplex$1(e){var t=e.length;return{point:function(n,s){for(var c=-1;++c<t;)e[c].point(n,s)},sphere:function(){for(var n=-1;++n<t;)e[n].sphere()},lineStart:function(){for(var n=-1;++n<t;)e[n].lineStart()},lineEnd:function(){for(var n=-1;++n<t;)e[n].lineEnd()},polygonStart:function(){for(var n=-1;++n<t;)e[n].polygonStart()},polygonEnd:function(){for(var n=-1;++n<t;)e[n].polygonEnd()}}}__name(multiplex$1,`multiplex`),__name(albersUsa_default,`default`);function albersUsa_default(){var e,t,n=albers_default(),s,c=conicEqualArea_default().rotate([154,0]).center([-2,58.5]).parallels([55,65]),l,d=conicEqualArea_default().rotate([157,0]).center([-3,19.9]).parallels([8,18]),f,p,m={point:function(e,t){p=[e,t]}};function albersUsa(e){var t=e[0],n=e[1];return p=null,(s.point(t,n),p)||(l.point(t,n),p)||(f.point(t,n),p)}albersUsa.invert=function(e){var t=n.scale(),s=n.translate(),l=(e[0]-s[0])/t,f=(e[1]-s[1])/t;return(f>=.12&&f<.234&&l>=-.425&&l<-.214?c:f>=.166&&f<.234&&l>=-.214&&l<-.115?d:n).invert(e)},albersUsa.stream=function(s){return e&&t===s?e:e=multiplex$1([n.stream(t=s),c.stream(s),d.stream(s)])},albersUsa.precision=function(e){return arguments.length?(n.precision(e),c.precision(e),d.precision(e),reset()):n.precision()},albersUsa.scale=function(e){return arguments.length?(n.scale(e),c.scale(e*.35),d.scale(e),albersUsa.translate(n.translate())):n.scale()},albersUsa.translate=function(e){if(!arguments.length)return n.translate();var t=n.scale(),p=+e[0],h=+e[1];return s=n.translate(e).clipExtent([[p-.455*t,h-.238*t],[p+.455*t,h+.238*t]]).stream(m),l=c.translate([p-.307*t,h+.201*t]).clipExtent([[p-.425*t+C,h+.12*t+C],[p-.214*t-C,h+.234*t-C]]).stream(m),f=d.translate([p-.205*t,h+.212*t]).clipExtent([[p-.214*t+C,h+.166*t+C],[p-.115*t-C,h+.234*t-C]]).stream(m),reset()},albersUsa.fitExtent=function(e,t){return fitExtent$1(albersUsa,e,t)},albersUsa.fitSize=function(e,t){return fitSize$1(albersUsa,e,t)},albersUsa.fitWidth=function(e,t){return fitWidth(albersUsa,e,t)},albersUsa.fitHeight=function(e,t){return fitHeight(albersUsa,e,t)};function reset(){return e=t=null,albersUsa}return albersUsa.scale(1070)}function azimuthalRaw(e){return function(t,n){var s=P(t),c=P(n),l=e(s*c);return[l*c*R(t),l*R(n)]}}function azimuthalInvert(e){return function(t,n){var s=B(t*t+n*n),c=e(s),l=R(c),d=P(c);return[N(t*l,s*d),asin(s&&n*l/s)]}}var At=azimuthalRaw(function(e){return B(2/(1+e))});At.invert=azimuthalInvert(function(e){return 2*asin(e/2)});function azimuthalEqualArea_default(){return projection(At).scale(124.75).clipAngle(179.999)}__name(azimuthalEqualArea_default,`default`);var jt=azimuthalRaw(function(e){return(e=acos(e))&&e/R(e)});jt.invert=azimuthalInvert(function(e){return e});function azimuthalEquidistant_default(){return projection(jt).scale(79.4188).clipAngle(179.999)}__name(azimuthalEquidistant_default,`default`);function mercatorRaw(e,t){return[e,te(re((E+t)/2))]}mercatorRaw.invert=function(e,t){return[e,2*M(ee(t))-E]};function mercator_default(){return mercatorProjection(mercatorRaw).scale(961/O)}__name(mercator_default,`default`);function mercatorProjection(e){var t=projection(e),n=t.center,s=t.scale,c=t.translate,l=t.clipExtent,d=null,f,p,m;t.scale=function(e){return arguments.length?(s(e),reclip()):s()},t.translate=function(e){return arguments.length?(c(e),reclip()):c()},t.center=function(e){return arguments.length?(n(e),reclip()):n()},t.clipExtent=function(e){return arguments.length?(e==null?d=f=p=m=null:(d=+e[0][0],f=+e[0][1],p=+e[1][0],m=+e[1][1]),reclip()):d==null?null:[[d,f],[p,m]]};function reclip(){var n=T*s(),c=t(rotation_default(t.rotate()).invert([0,0]));return l(d==null?[[c[0]-n,c[1]-n],[c[0]+n,c[1]+n]]:e===mercatorRaw?[[Math.max(c[0]-n,d),f],[Math.min(c[0]+n,p),m]]:[[d,Math.max(c[1]-n,f)],[p,Math.min(c[1]+n,m)]])}return reclip()}function tany(e){return re((E+e)/2)}function conicConformalRaw(e,t){var n=P(e),s=e===t?R(e):te(n/P(t))/te(tany(t)/tany(e)),c=n*ne(tany(e),s)/s;if(!s)return mercatorRaw;function project(e,t){c>0?t<-E+1e-6&&(t=-E+C):t>E-1e-6&&(t=E-C);var n=c/ne(tany(t),s);return[n*R(s*e),c-n*P(s*e)]}return project.invert=function(e,t){var n=c-t,l=z(s)*B(e*e+n*n),d=N(e,j(n))*z(n);return n*s<0&&(d-=T*z(e)*z(n)),[d/s,2*M(ne(c/l,1/s))-E]},project}function conicConformal_default(){return conicProjection(conicConformalRaw).scale(109.5).parallels([30,30])}__name(conicConformal_default,`default`);function equirectangularRaw(e,t){return[e,t]}equirectangularRaw.invert=equirectangularRaw;function equirectangular_default(){return projection(equirectangularRaw).scale(152.63)}__name(equirectangular_default,`default`);function conicEquidistantRaw(e,t){var n=P(e),s=e===t?R(e):(n-P(t))/(t-e),c=n/s+e;if(j(s)<1e-6)return equirectangularRaw;function project(e,t){var n=c-t,l=s*e;return[n*R(l),c-n*P(l)]}return project.invert=function(e,t){var n=c-t,l=N(e,j(n))*z(n);return n*s<0&&(l-=T*z(e)*z(n)),[l/s,c-z(s)*B(e*e+n*n)]},project}function conicEquidistant_default(){return conicProjection(conicEquidistantRaw).scale(131.154).center([0,13.9389])}__name(conicEquidistant_default,`default`);var Mt=1.340264,Nt=-.081106,Pt=893e-6,Ft=.003796,It=B(3)/2,Lt=12;function equalEarthRaw(e,t){var n=asin(It*R(t)),s=n*n,c=s*s*s;return[e*P(n)/(It*(Mt+3*Nt*s+c*(7*Pt+9*Ft*s))),n*(Mt+Nt*s+c*(Pt+Ft*s))]}equalEarthRaw.invert=function(e,t){for(var n=t,s=n*n,c=s*s*s,l=0,d,f,p;l<Lt&&(f=n*(Mt+Nt*s+c*(Pt+Ft*s))-t,p=Mt+3*Nt*s+c*(7*Pt+9*Ft*s),n-=d=f/p,s=n*n,c=s*s*s,!(j(d)<1e-12));++l);return[It*e*(Mt+3*Nt*s+c*(7*Pt+9*Ft*s))/P(n),asin(R(n)/It)]};function equalEarth_default(){return projection(equalEarthRaw).scale(177.158)}__name(equalEarth_default,`default`);function gnomonicRaw(e,t){var n=P(t),s=P(e)*n;return[n*R(e)/s,R(t)/s]}gnomonicRaw.invert=azimuthalInvert(M);function gnomonic_default(){return projection(gnomonicRaw).scale(144.049).clipAngle(60)}__name(gnomonic_default,`default`);function identity_default$1(){var e=1,t=0,n=0,s=1,c=1,l=0,d,f,p=null,m,h,g,_=1,v=1,y=transformer({point:function(e,t){var n=projection([e,t]);this.stream.point(n[0],n[1])}}),b=identity_default$2,x,S;function reset(){return _=e*s,v=e*c,x=S=null,projection}function projection(e){var s=e[0]*_,c=e[1]*v;if(l){var p=c*d-s*f;s=s*d+c*f,c=p}return[s+t,c+n]}return projection.invert=function(e){var s=e[0]-t,c=e[1]-n;if(l){var p=c*d+s*f;s=s*d-c*f,c=p}return[s/_,c/v]},projection.stream=function(e){return x&&S===e?x:x=y(b(S=e))},projection.postclip=function(e){return arguments.length?(b=e,p=m=h=g=null,reset()):b},projection.clipExtent=function(e){return arguments.length?(b=e==null?(p=m=h=g=null,identity_default$2):clipRectangle(p=+e[0][0],m=+e[0][1],h=+e[1][0],g=+e[1][1]),reset()):p==null?null:[[p,m],[h,g]]},projection.scale=function(t){return arguments.length?(e=+t,reset()):e},projection.translate=function(e){return arguments.length?(t=+e[0],n=+e[1],reset()):[t,n]},projection.angle=function(e){return arguments.length?(l=e%360*A,f=R(l),d=P(l),reset()):l*k},projection.reflectX=function(e){return arguments.length?(s=e?-1:1,reset()):s<0},projection.reflectY=function(e){return arguments.length?(c=e?-1:1,reset()):c<0},projection.fitExtent=function(e,t){return fitExtent$1(projection,e,t)},projection.fitSize=function(e,t){return fitSize$1(projection,e,t)},projection.fitWidth=function(e,t){return fitWidth(projection,e,t)},projection.fitHeight=function(e,t){return fitHeight(projection,e,t)},projection}__name(identity_default$1,`default`);function naturalEarth1Raw(e,t){var n=t*t,s=n*n;return[e*(.8707-.131979*n+s*(-.013791+s*(.003971*n-.001529*s))),t*(1.007226+n*(.015085+s*(-.044475+.028874*n-.005916*s)))]}naturalEarth1Raw.invert=function(e,t){var n=t,s=25,c;do{var l=n*n,d=l*l;n-=c=(n*(1.007226+l*(.015085+d*(-.044475+.028874*l-.005916*d)))-t)/(1.007226+l*(.015085*3+d*(-.044475*7+.028874*9*l-.005916*11*d)))}while(j(c)>1e-6&&--s>0);return[e/(.8707+(l=n*n)*(-.131979+l*(-.013791+l*l*l*(.003971-.001529*l)))),n]};function naturalEarth1_default(){return projection(naturalEarth1Raw).scale(175.295)}__name(naturalEarth1_default,`default`);function orthographicRaw(e,t){return[P(t)*R(e),R(t)]}orthographicRaw.invert=azimuthalInvert(asin);function orthographic_default(){return projection(orthographicRaw).scale(249.5).clipAngle(90+C)}__name(orthographic_default,`default`);function stereographicRaw(e,t){var n=P(t),s=1+P(e)*n;return[n*R(e)/s,R(t)/s]}stereographicRaw.invert=azimuthalInvert(function(e){return 2*M(e)});function stereographic_default(){return projection(stereographicRaw).scale(250).clipAngle(142)}__name(stereographic_default,`default`);function transverseMercatorRaw(e,t){return[te(re((E+t)/2)),-e]}transverseMercatorRaw.invert=function(e,t){return[-t,2*M(ee(e))-E]};function transverseMercator_default(){var e=mercatorProjection(transverseMercatorRaw),t=e.center,n=e.rotate;return e.center=function(e){return arguments.length?t([-e[1],e[0]]):(e=t(),[e[1],-e[0]])},e.rotate=function(e){return arguments.length?n([e[0],e[1],e.length>2?e[2]+90:90]):(e=n(),[e[0],e[1],e[2]-90])},n([0,0,90]).scale(159.155)}__name(transverseMercator_default,`default`);var Rt=__exportAll({geoAlbers:()=>albers_default,geoAlbersUsa:()=>albersUsa_default,geoArea:()=>area_default,geoAzimuthalEqualArea:()=>azimuthalEqualArea_default,geoAzimuthalEqualAreaRaw:()=>At,geoAzimuthalEquidistant:()=>azimuthalEquidistant_default,geoAzimuthalEquidistantRaw:()=>jt,geoBounds:()=>bounds_default,geoCentroid:()=>centroid_default,geoCircle:()=>circle_default$1,geoClipAntimeridian:()=>Le,geoClipCircle:()=>circle_default,geoClipExtent:()=>extent_default,geoClipRectangle:()=>clipRectangle,geoConicConformal:()=>conicConformal_default,geoConicConformalRaw:()=>conicConformalRaw,geoConicEqualArea:()=>conicEqualArea_default,geoConicEqualAreaRaw:()=>conicEqualAreaRaw,geoConicEquidistant:()=>conicEquidistant_default,geoConicEquidistantRaw:()=>conicEquidistantRaw,geoContains:()=>contains_default,geoDistance:()=>distance_default,geoEqualEarth:()=>equalEarth_default,geoEqualEarthRaw:()=>equalEarthRaw,geoEquirectangular:()=>equirectangular_default,geoEquirectangularRaw:()=>equirectangularRaw,geoGnomonic:()=>gnomonic_default,geoGnomonicRaw:()=>gnomonicRaw,geoGraticule:()=>graticule,geoGraticule10:()=>graticule10,geoIdentity:()=>identity_default$1,geoInterpolate:()=>interpolate_default,geoLength:()=>length_default,geoMercator:()=>mercator_default,geoMercatorRaw:()=>mercatorRaw,geoNaturalEarth1:()=>naturalEarth1_default,geoNaturalEarth1Raw:()=>naturalEarth1Raw,geoOrthographic:()=>orthographic_default,geoOrthographicRaw:()=>orthographicRaw,geoPath:()=>path_default,geoProjection:()=>projection,geoProjectionMutator:()=>projectionMutator,geoRotation:()=>rotation_default,geoStereographic:()=>stereographic_default,geoStereographicRaw:()=>stereographicRaw,geoStream:()=>stream_default,geoTransform:()=>transform_default$1,geoTransverseMercator:()=>transverseMercator_default,geoTransverseMercatorRaw:()=>transverseMercatorRaw});function noop(){}var zt=1/0,Bt=zt,Vt=-zt,Ht=Vt;function boundsPoint(e,t){e<zt&&(zt=e),e>Vt&&(Vt=e),t<Bt&&(Bt=t),t>Ht&&(Ht=t)}var Ut={point:boundsPoint,lineStart:noop,lineEnd:noop,polygonStart:noop,polygonEnd:noop,result(){let e=[[zt,Bt],[Vt,Ht]];return Vt=Ht=-(Bt=zt=1/0),e}};function fitExtent(e,t,n){let s=t[1][0]-t[0][0],c=t[1][1]-t[0][1],l=e.clipExtent&&e.clipExtent();e.scale(150).translate([0,0]),l!=null&&e.clipExtent(null),stream_default(n,e.stream(Ut));let d=Ut.result(),f=Math.min(s/(d[1][0]-d[0][0]),c/(d[1][1]-d[0][1])),p=+t[0][0]+(s-f*(d[1][0]+d[0][0]))/2,m=+t[0][1]+(c-f*(d[1][1]+d[0][1]))/2;return l!=null&&e.clipExtent(l),e.scale(f*150).translate([p,m])}function fitSize(e,t,n){return fitExtent(e,[[0,0],t],n)}var Wt=class Geohash{static base32=`0123456789bcdefghjkmnpqrstuvwxyz`;encode(e,t,n){if(n===void 0){for(let n=1;n<=12;n++){let s=this.encode(e,t,n),c=this.decode(s);if(c.lat===e&&c.lon===t)return s}n=12}if(e=Number(e),t=Number(t),n=Number(n),isNaN(e)||isNaN(t)||isNaN(n))throw Error(`Invalid geohash`);let s=0,c=0,l=!0,d=``,f=-90,p=90,m=-180,h=180;for(;d.length<n;){if(l){let e=(m+h)/2;t>e?(s=s*2+1,m=e):(s*=2,h=e)}else{let t=(f+p)/2;e>t?(s=s*2+1,f=t):(s*=2,p=t)}l=!l,++c===5&&(d+=Geohash.base32.charAt(s),c=0,s=0)}return d}decode(e){let t=this.bounds(e),n=t.sw.lat,s=t.sw.lon,c=t.ne.lat,l=t.ne.lon,d=(n+c)/2,f=(s+l)/2;return d=Number(d.toFixed(Math.floor(2-Math.log(c-n)/Math.LN10))),f=Number(f.toFixed(Math.floor(2-Math.log(l-s)/Math.LN10))),{lat:d,lon:f}}bounds(e){if(e.length===0)throw Error(`Invalid geohash`);e=e.toLowerCase();let t=!0,n=-90,s=90,c=-180,l=180;for(let d=0;d<e.length;d++){let f=e.charAt(d),p=Geohash.base32.indexOf(f);if(p===-1)throw Error(`Invalid geohash`);for(let e=4;e>=0;e--){let d=p>>e&1;if(t){let e=(c+l)/2;d===1?c=e:l=e}else{let e=(n+s)/2;d===1?n=e:s=e}t=!t}}return{sw:{lat:n,lon:c},ne:{lat:s,lon:l}}}adjacent(e,t){if(e=e.toLowerCase(),t=t.toLowerCase(),e.length===0)throw Error(`Invalid geohash`);if(`nsew`.indexOf(t)===-1)throw Error(`Invalid direction`);let n={n:[`p0r21436x8zb9dcf5h7kjnmqesgutwvy`,`bc01fg45238967deuvhjyznpkmstqrwx`],s:[`14365h7k9dcfesgujnmqp0r2twvyx8zb`,`238967debc01fg45kmstqrwxuvhjyznp`],e:[`bc01fg45238967deuvhjyznpkmstqrwx`,`p0r21436x8zb9dcf5h7kjnmqesgutwvy`],w:[`238967debc01fg45kmstqrwxuvhjyznp`,`14365h7k9dcfesgujnmqp0r2twvyx8zb`]},s={n:[`prxz`,`bcfguvyz`],s:[`028b`,`0145hjnp`],e:[`bcfguvyz`,`prxz`],w:[`0145hjnp`,`028b`]},c=e.slice(-1),l=e.slice(0,-1),d=e.length%2;return s[t][d].indexOf(c)!==-1&&l!==``&&(l=this.adjacent(l,t)),l+Geohash.base32.charAt(n[t][d].indexOf(c))}neighbours(e){return{n:this.adjacent(e,`n`),ne:this.adjacent(this.adjacent(e,`n`),`e`),e:this.adjacent(e,`e`),se:this.adjacent(this.adjacent(e,`s`),`e`),s:this.adjacent(e,`s`),sw:this.adjacent(this.adjacent(e,`s`),`w`),w:this.adjacent(e,`w`),nw:this.adjacent(this.adjacent(e,`n`),`w`)}}contained(e,t,n,s,c){(isNaN(t)||t>=90)&&(t=89),(isNaN(n)||n>180)&&(n=180),(isNaN(s)||s<=-90)&&(s=-89),(isNaN(e)||e<-180)&&(e=-180),c||=1;let l=this.encode(t,e,c),d=this.encode(t,n,c),f=this.encode(s,n,c),p=l,m=0,h=-1,g=[l,f],_=this.adjacent(l,`e`);for(;_!==f;)g.push(_),++m,_===d||h===m?(h=m+1,m=0,_=this.adjacent(p,`s`),p=_):_=this.adjacent(_,`e`);return g}calculateWidthDegrees(e){let t;return t=e%2==0?-1:-.5,180/2**(2.5*e+t)}width(e){let t=e%2;return 180/(2^(5*e+t)/2-1)}};function multiplex(e){let t=e.length;return{point(n,s){let c=-1;for(;++c<t;)e[c].point(n,s)},sphere(){let n=-1;for(;++n<t;)e[n].sphere()},lineStart(){let n=-1;for(;++n<t;)e[n].lineStart()},lineEnd(){let n=-1;for(;++n<t;)e[n].lineEnd()},polygonStart(){let n=-1;for(;++n<t;)e[n].polygonStart()},polygonEnd(){let n=-1;for(;++n<t;)e[n].polygonEnd()}}}function albersUsaPr(){let e,t,n=1e-6,s=albers_default(),c,l=conicEqualArea_default().rotate([154,0]).center([-2,58.5]).parallels([55,65]),d,f=conicEqualArea_default().rotate([157,0]).center([-3,19.9]).parallels([8,18]),p,m=conicEqualArea_default().rotate([66,0]).center([0,18]).parallels([8,18]),h,g,_={point:(e,t)=>{g=[e,t]}},albersUsa=function(e){let t=e[0],n=e[1];return g=null,(c.point(t,n),g)||(d.point(t,n),g)||(p.point(t,n),g)||h.point(t,n),g};albersUsa.invert=function(e){let t=s.scale(),n=s.translate(),c=(e[0]-n[0])/t,d=(e[1]-n[1])/t;return(d>=.12&&d<.234&&c>=-.425&&c<-.214?l:d>=.166&&d<.234&&c>=-.214&&c<-.115?f:d>=.204&&d<.234&&c>=.32&&c<.38?m:s).invert(e)},albersUsa.stream=function(n){return e&&t===n?e:e=multiplex([s.stream(t=n),l.stream(n),f.stream(n),m.stream(n)])},albersUsa.precision=function(e){return arguments.length?(s.precision(e),l.precision(e),f.precision(e),m.precision(e),reset()):s.precision()},albersUsa.scale=function(e){return arguments.length?(s.scale(e),l.scale(e*.35),f.scale(e),m.scale(e),albersUsa.translate(s.translate())):s.scale()},albersUsa.translate=function(e){if(!arguments.length)return s.translate();let t=s.scale(),g=+e[0],v=+e[1];return c=s.translate(e).clipExtent([[g-.455*t,v-.238*t],[g+.455*t,v+.238*t]]).stream(_),d=l.translate([g-.307*t,v+.201*t]).clipExtent([[g-.425*t+n,v+.12*t+n],[g-.214*t-n,v+.234*t-n]]).stream(_),p=f.translate([g-.205*t,v+.212*t]).clipExtent([[g-.214*t+n,v+.166*t+n],[g-.115*t-n,v+.234*t-n]]).stream(_),h=m.translate([g+.35*t,v+.224*t]).clipExtent([[g+.32*t,v+.204*t],[g+.38*t,v+.234*t]]).stream(_),reset()},albersUsa.fitExtent=function(e,t){return fitExtent(albersUsa,e,t)},albersUsa.fitSize=function(e,t){return fitSize(albersUsa,e,t)};function reset(){return e=t=null,albersUsa}return albersUsa.scale(1070)}var Gt=function(e){return e[e.AzimuthalEqualArea=0]=`AzimuthalEqualArea`,e[e.AzimuthalEquidistant=1]=`AzimuthalEquidistant`,e[e.Gnomonic=2]=`Gnomonic`,e[e.Orthographic=3]=`Orthographic`,e[e.Stereographic=4]=`Stereographic`,e[e.AlbersUsa=5]=`AlbersUsa`,e[e.AlbersUsaPr=6]=`AlbersUsaPr`,e[e.Albers=7]=`Albers`,e[e.ConicConformal=8]=`ConicConformal`,e[e.ConicEqualArea=9]=`ConicEqualArea`,e[e.ConicEquidistant=10]=`ConicEquidistant`,e[e.Equirectangular=11]=`Equirectangular`,e[e.Mercator=12]=`Mercator`,e[e.TransverseMercator=13]=`TransverseMercator`,e}(Gt||{}),Kt=[],qt={};for(let e in Gt)typeof e==`string`&&(Kt.push(e),e===`AlbersUsaPr`?qt[e]=albersUsaPr:qt[e]=Rt[`geo${e}`]);function resolve(e){let t=qt[e];return t?t():(console.warn(`Unknown projection: `+e),mercator_default())}var Jt=4096/2/Math.PI,Layered=class extends t.SVGZoomWidget{_autoScaleOnNextRender;_layersTarget;_prevAutoScaleMode;_d3GeoProjection;constructor(){super(),this._drawStartPos=`origin`,this.projection(`Mercator`)}data(e){let t=super.data.apply(this,arguments);return arguments.length&&(this._autoScaleOnNextRender=!0),t}enter(e,t){super.enter(e,t),this._layersTarget=this._renderElement.append(`g`).attr(`class`,`layersTarget`)}update(e,n){super.update(e,n);let s=this._layersTarget.selectAll(`.layerContainer`).data(this.layers().filter(function(e){return e.visible()}),function(e){return e.id()}),c=this;s.enter().append(`g`).attr(`id`,function(e){return e.id()}).attr(`class`,`layerContainer`).each(function(e){e._svgElement=(0,t.select)(this),e._domElement=c._parentOverlay.append(`div`),e.layerEnter(c,e._svgElement,e._domElement)}).merge(s).each(function(e){e.layerUpdate(c)}),s.exit().each(function(e){e.layerExit(c),e._domElement.remove()}).remove(),s.order(),this.onZoomed()}exit(e,t){super.exit(e,t)}onZoomed(){super.onZoomed();let e=this._layersTarget.selectAll(`.layerContainer`),t=this;e.each(function(e){e.layerZoomed(t)})}preRender(e){return Promise.all(this.layers().filter(function(e){return e.visible()}).map(function(e){return e.layerPreRender()}))}render(e){let n=this;return this.preRender().then(function(){t.SVGZoomWidget.prototype.render.call(n,function(t){n._layersTarget&&(n._renderCount&&n._autoScaleOnNextRender||n._prevAutoScaleMode!==n.autoScaleMode())?(n._prevAutoScaleMode=n.autoScaleMode(),n._autoScaleOnNextRender=!1,n.autoScale(),e&&e(t)):e&&e(t)})}),this}project(e,t){return e>=90?e=89:e<=-90&&(e=-89),this._d3GeoProjection([t,e])}invert(e,t){return this._d3GeoProjection.invert([e,t])}getBounds(){let e=this._layersTarget.node().getBBox();return{x:e.x,y:e.y,width:e.width,height:e.height}}autoScale(){switch(this.autoScaleMode()){case`none`:return;case`all`:this.zoomToBBox(this.getBounds());break}}};Layered.prototype._class+=` map_Layered`,Layered.prototype.publish(`projection`,null,`set`,`Map projection type`,Kt),Layered.prototype.publish(`centerLat`,0,`number`,`Center Latitude`,null,{tags:[`Basic`]}),Layered.prototype.publish(`centerLong`,0,`number`,`Center Longitude`,null,{tags:[`Basic`]}),Layered.prototype.publish(`zoom`,1,`number`,`Zoom Level`,null,{tags:[`Basic`]}),Layered.prototype.publish(`autoScaleMode`,`all`,`set`,`Auto Scale`,[`none`,`all`],{tags:[`Basic`]}),Layered.prototype.publish(`layers`,[],`widgetArray`,`Layers`,null,{render:!1});var Yt=Layered.prototype.projection;Layered.prototype.projection=function(e){let t=Yt.apply(this,arguments);if(arguments.length){switch(this._d3GeoProjection=resolve(e).scale(Jt).translate([0,0]),e){case`orthographic`:this._d3GeoProjection.clipAngle(90).rotate([0,0])}this._d3GeoPath=path_default().projection(this._d3GeoProjection),this._autoScaleOnNextRender=!0}return t};var Layer=class extends Layered{_svgElement;_domElement;_topoJsonPromise;constructor(){super(),n.ITooltip.call(this)}svgGlowID(){return``}layerEnter(e,t,n){this._parentOverlay=e._parentOverlay}enter(e,t){super.enter(e,t),this._svgElement=this._layersTarget.append(`g`),this._domElement=this._parentOverlay.append(`div`),this.layerEnter(this,this._svgElement,this._domElement)}layerUpdate(e,t){}update(e,t){super.update(e,t),this.layerUpdate(this)}onZoomed(){super.onZoomed(),this.layerUpdate(this)}layerExit(e){}exit(e,t){this.layerExit(this),this._svgElement.remove(),this._domElement.remove(),super.exit(e,t)}layerPreRender(){return Promise.resolve()}render(e){let t=this,n=arguments;return this.layerPreRender().then(function(){Layered.prototype.render.apply(t,n)}),this}layerZoomed(e){}};Layer.prototype._class+=` map_Layer`,Layer.prototype.implements(n.ITooltip.prototype);var CanvasPinLayer=class extends Layer{_pinsTransform;pins;_prevProjection;constructor(){super(),this.pins=new CanvasPins}layerEnter(e,t,n){Layer.prototype.layerEnter.apply(this,arguments),this._parentOverlay.style(`pointer-events`,`none`),this._pinsTransform=n.style(`pointer-events`,`none`).append(`div`).attr(`class`,this.classID()).style(`width`,e.width()+`px`).style(`height`,e.height()+`px`),this.pins.target(this._pinsTransform.node())}layerUpdate(e){Layer.prototype.layerUpdate.apply(this,arguments),this._pinsTransform.style(`opacity`,this.opacity()).style(`width`,e.width()+`px`).style(`height`,e.height()+`px`),this.pins.resize(e.size()),this.layerZoomed(e)}layerExit(e){delete this._prevProjection,this.pins.target(null),delete this.pins}layerZoomed(e){Layer.prototype.layerZoomed.apply(this,arguments);let t=this._db.fieldByLabel(this.latColumn()),n=this._db.fieldByLabel(this.longColumn()),s=this._db.fieldByLabel(this.weightColumn());this.pins.columns(this.columns()).data(this.visible()?this.data().map(function(c){let l=t?c[t.idx]:c[0],d=n?c[n.idx]:c[1],f=s?c[s.idx]:1,p=e.zoomTranslate(),m=e.project(l,d),h=e.zoomScale();return m[0]*=h,m[1]*=h,[p[0]+m[0],p[1]+m[1],f]}):[]).render()}};CanvasPinLayer.prototype._class+=` map_CanvasPinLayer`,CanvasPinLayer.prototype.publishProxy(`clusterMode`,`pins`,`clusterMode`),CanvasPinLayer.prototype.publishProxy(`allCircles`,`pins`,`allCircles`),CanvasPinLayer.prototype.publishProxy(`showQuadtree`,`pins`,`showQuadtree`),CanvasPinLayer.prototype.publishProxy(`useAveragePos`,`pins`,`useAveragePos`),CanvasPinLayer.prototype.publishProxy(`shrinkFontToPin`,`pins`,`shrinkFontToPin`),CanvasPinLayer.prototype.publishProxy(`enableClustering`,`pins`,`enableClustering`),CanvasPinLayer.prototype.publishProxy(`useWeightedRadius`,`pins`,`useWeightedRadius`),CanvasPinLayer.prototype.publishProxy(`radiusWeightMult`,`pins`,`radiusWeightMult`),CanvasPinLayer.prototype.publishProxy(`searchRectMult`,`pins`,`searchRectMult`),CanvasPinLayer.prototype.publishProxy(`pinHeight`,`pins`,`pinHeight`),CanvasPinLayer.prototype.publishProxy(`pinWidth`,`pins`,`pinWidth`),CanvasPinLayer.prototype.publishProxy(`pinFontFamily`,`pins`,`pinFontFamily`),CanvasPinLayer.prototype.publishProxy(`pinFontSize`,`pins`,`pinFontSize`),CanvasPinLayer.prototype.publishProxy(`arrowHeight`,`pins`,`arrowHeight`),CanvasPinLayer.prototype.publishProxy(`arrowWidth`,`pins`,`arrowWidth`),CanvasPinLayer.prototype.publish(`latColumn`,null,`set`,`latColumn`,function(){return this.columns()},{optional:!0}),CanvasPinLayer.prototype.publish(`longColumn`,null,`set`,`longColumn`,function(){return this.columns()},{optional:!0}),CanvasPinLayer.prototype.publish(`weightColumn`,null,`set`,`weightColumn`,function(){return this.columns()},{optional:!0}),CanvasPinLayer.prototype.publish(`opacity`,1,`number`,`Opacity`,null,{tags:[`Advanced`]});function identity_default(e){return e}__name(identity_default,`default`);function transform_default(e){if(e==null)return identity_default;var t,n,s=e.scale[0],c=e.scale[1],l=e.translate[0],d=e.translate[1];return function(e,f){f||(t=n=0);var p=2,m=e.length,h=Array(m);for(h[0]=(t+=e[0])*s+l,h[1]=(n+=e[1])*c+d;p<m;)h[p]=e[p],++p;return h}}__name(transform_default,`default`);function reverse_default(e,t){for(var n,s=e.length,c=s-t;c<--s;)n=e[c],e[c++]=e[s],e[s]=n}__name(reverse_default,`default`);function feature_default(e,t){return typeof t==`string`&&(t=e.objects[t]),t.type===`GeometryCollection`?{type:`FeatureCollection`,features:t.geometries.map(function(t){return feature(e,t)})}:feature(e,t)}__name(feature_default,`default`);function feature(e,t){var n=t.id,s=t.bbox,c=t.properties==null?{}:t.properties,l=object(e,t);return n==null&&s==null?{type:`Feature`,properties:c,geometry:l}:s==null?{type:`Feature`,id:n,properties:c,geometry:l}:{type:`Feature`,id:n,bbox:s,properties:c,geometry:l}}function object(e,t){var n=transform_default(e.transform),s=e.arcs;function arc(e,t){t.length&&t.pop();for(var c=s[e<0?~e:e],l=0,d=c.length;l<d;++l)t.push(n(c[l],l));e<0&&reverse_default(t,d)}function point(e){return n(e)}function line(e){for(var t=[],n=0,s=e.length;n<s;++n)arc(e[n],t);return t.length<2&&t.push(t[0]),t}function ring(e){for(var t=line(e);t.length<4;)t.push(t[0]);return t}function polygon(e){return e.map(ring)}function geometry(e){var t=e.type,n;switch(t){case`GeometryCollection`:return{type:t,geometries:e.geometries.map(geometry)};case`Point`:n=point(e.coordinates);break;case`MultiPoint`:n=e.coordinates.map(point);break;case`LineString`:n=line(e.arcs);break;case`MultiLineString`:n=e.arcs.map(line);break;case`Polygon`:n=polygon(e.arcs);break;case`MultiPolygon`:n=e.arcs.map(polygon);break;default:return null}return{type:t,coordinates:n}}return geometry(t)}function stitch_default(e,t){var n={},s={},c={},l=[],d=-1;t.forEach(function(n,s){var c=e.arcs[n<0?~n:n],l;c.length<3&&!c[1][0]&&!c[1][1]&&(l=t[++d],t[d]=n,t[s]=l)}),t.forEach(function(e){var t=ends(e),n=t[0],l=t[1],d,f;if(d=c[n])if(delete c[d.end],d.push(e),d.end=l,f=s[l]){delete s[f.start];var p=f===d?d:d.concat(f);s[p.start=d.start]=c[p.end=f.end]=p}else s[d.start]=c[d.end]=d;else if(d=s[l])if(delete s[d.start],d.unshift(e),d.start=n,f=c[n]){delete c[f.end];var m=f===d?d:f.concat(d);s[m.start=f.start]=c[m.end=d.end]=m}else s[d.start]=c[d.end]=d;else d=[e],s[d.start=n]=c[d.end=l]=d});function ends(t){var n=e.arcs[t<0?~t:t],s=n[0],c;return e.transform?(c=[0,0],n.forEach(function(e){c[0]+=e[0],c[1]+=e[1]})):c=n[n.length-1],t<0?[c,s]:[s,c]}function flush(e,t){for(var s in e){var c=e[s];delete t[c.start],delete c.start,delete c.end,c.forEach(function(e){n[e<0?~e:e]=1}),l.push(c)}}return flush(c,s),flush(s,c),t.forEach(function(e){n[e<0?~e:e]||l.push([e])}),l}__name(stitch_default,`default`);function mesh_default(e){return object(e,meshArcs.apply(this,arguments))}__name(mesh_default,`default`);function meshArcs(e,t,n){var s,c,l;if(arguments.length>1)s=extractArcs(e,t,n);else for(c=0,s=Array(l=e.arcs.length);c<l;++c)s[c]=c;return{type:`MultiLineString`,arcs:stitch_default(e,s)}}function extractArcs(e,t,n){var s=[],c=[],l;function extract0(e){var t=e<0?~e:e;(c[t]||(c[t]=[])).push({i:e,g:l})}function extract1(e){e.forEach(extract0)}function extract2(e){e.forEach(extract1)}function extract3(e){e.forEach(extract2)}function geometry(e){switch(l=e,e.type){case`GeometryCollection`:e.geometries.forEach(geometry);break;case`LineString`:extract1(e.arcs);break;case`MultiLineString`:case`Polygon`:extract2(e.arcs);break;case`MultiPolygon`:extract3(e.arcs);break}}return geometry(t),c.forEach(n==null?function(e){s.push(e[0].i)}:function(e){n(e[0].g,e[e.length-1].g)&&s.push(e[0].i)}),s}var Xt=window.__hpcc_topoJsonFolder||`./node_modules/@hpcc-js/map/TopoJSON`;function topoJsonFolder(e){if(!arguments.length)return Xt;let t=Xt;return Xt=e,t}var Choropleth=class extends Layer{_dataMap={};_path=(0,t.select)(null);_dataMinWeight;_dataMaxWeight;_choroplethData;_choroplethTransform;_choropleth;_choroTopology;_choroTopologyObjects;_prevProjection;_prevInternalOnly;constructor(){super(),t.Utility.SimpleSelectionMixin.call(this)}data(e){let t=Layer.prototype.data.apply(this,arguments);if(arguments.length){this._dataMap={},this._dataMinWeight=null,this._dataMaxWeight=null;let e=this;this.data().forEach(function(t){e._dataMap[t[0]]=t,(!e._dataMinWeight||t[1]<e._dataMinWeight)&&(e._dataMinWeight=t[1]),(!e._dataMaxWeight||t[1]>e._dataMaxWeight)&&(e._dataMaxWeight=t[1])})}return t}getDataBounds(){let e=this._choroplethData.node().getBBox();return{x:e.x,y:e.y,width:e.width,height:e.height}}autoScale(){switch(this.autoScaleMode()){case`none`:return;case`mesh`:this.zoomToBBox(this.getBounds());break;case`data`:this.zoomToBBox(this.getDataBounds());break}}layerEnter(e,t,n){Layer.prototype.layerEnter.apply(this,arguments),this._choroplethTransform=t,this._choroplethData=this._choroplethTransform.append(`g`).attr(`class`,`data`),this._choropleth=this._choroplethTransform.append(`path`).attr(`class`,`mesh`)}layerUpdate(e,t){if(Layer.prototype.layerUpdate.apply(this,arguments),this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+`_`+this.id())),this._choroplethTransform.style(`stroke`,this.meshColor()).style(`opacity`,this.opacity()),!this.visible()||!this.meshVisible()){this._choropleth.attr(`d`,``),delete this._prevProjection;return}(t||this._prevProjection!==e.projection()||this._prevInternalOnly!==this.internalOnly())&&(this._choropleth.attr(`d`,e._d3GeoPath(mesh_default(this._choroTopology,this._choroTopologyObjects,this.internalOnly()?function(e,t){return e!==t}:function(e,t){return!0}))),this._prevProjection=e.projection(),this._prevInternalOnly=this.internalOnly()),this._choropleth.style(`stroke-width`,this.meshStrokeWidth()).style(`stroke`,this.meshColor())}layerExit(e){delete this._prevProjection,delete this._prevInternalOnly}layerZoomed(e){super.layerZoomed.apply(this,arguments),this._choroplethData.style(`stroke-width`,this.meshVisible()?`0px`:`${.5/e.zoomScale()}px`)}click(e,t,n){}dblclick(e,t,n){}};Choropleth.prototype._class+=` map_Choropleth`,Choropleth.prototype.mixin(t.Utility.SimpleSelectionMixin),Choropleth.prototype._palette=t.Palette.rainbow(`default`),Choropleth.prototype.publish(`paletteID`,`YlOrRd`,`set`,`Color palette for this widget`,Choropleth.prototype._palette.switch(),{tags:[`Basic`,`Shared`]}),Choropleth.prototype.publish(`useClonedPalette`,!1,`boolean`,`Enable or disable using a cloned palette`,null,{tags:[`Intermediate`,`Shared`]}),Choropleth.prototype.publish(`opacity`,1,`number`,`Opacity`,null,{tags:[`Advanced`]}),Choropleth.prototype.publish(`meshVisible`,!0,`boolean`,`Mesh Visibility`),Choropleth.prototype.publish(`meshColor`,null,`html-color`,`Stroke Color`,null,{optional:!0}),Choropleth.prototype.publish(`meshStrokeWidth`,.25,`number`,`Stroke Width`),Choropleth.prototype.publish(`internalOnly`,!1,`boolean`,`Internal mesh only`),Choropleth.prototype.publish(`autoScaleMode`,`mesh`,`set`,`Auto Scale`,[`none`,`mesh`,`data`],{tags:[`Basic`],override:!0});function request_default(e,n){var s,c=(0,t.dispatch)(`beforesend`,`progress`,`load`,`error`),l,d=(0,t.map)(),f=new XMLHttpRequest,p=null,m=null,h,g,_=0;typeof XDomainRequest<`u`&&!(`withCredentials`in f)&&/^(http(s)?:)?\/\//.test(e)&&(f=new XDomainRequest),`onload`in f?f.onload=f.onerror=f.ontimeout=respond:f.onreadystatechange=function(e){f.readyState>3&&respond(e)};function respond(e){var t=f.status,n;if(!t&&hasResponse(f)||t>=200&&t<300||t===304){if(h)try{n=h.call(s,f)}catch(e){c.call(`error`,s,e);return}else n=f;c.call(`load`,s,n)}else c.call(`error`,s,e)}if(f.onprogress=function(e){c.call(`progress`,s,e)},s={header:function(e,t){return e=(e+``).toLowerCase(),arguments.length<2?d.get(e):(t==null?d.remove(e):d.set(e,t+``),s)},mimeType:function(e){return arguments.length?(l=e==null?null:e+``,s):l},responseType:function(e){return arguments.length?(g=e,s):g},timeout:function(e){return arguments.length?(_=+e,s):_},user:function(e){return arguments.length<1?p:(p=e==null?null:e+``,s)},password:function(e){return arguments.length<1?m:(m=e==null?null:e+``,s)},response:function(e){return h=e,s},get:function(e,t){return s.send(`GET`,e,t)},post:function(e,t){return s.send(`POST`,e,t)},send:function(t,n,h){return f.open(t,e,!0,p,m),l!=null&&!d.has(`accept`)&&d.set(`accept`,l+`,*/*`),f.setRequestHeader&&d.each(function(e,t){f.setRequestHeader(t,e)}),l!=null&&f.overrideMimeType&&f.overrideMimeType(l),g!=null&&(f.responseType=g),_>0&&(f.timeout=_),h==null&&typeof n==`function`&&(h=n,n=null),h!=null&&h.length===1&&(h=fixCallback(h)),h!=null&&s.on(`error`,h).on(`load`,function(e){h(null,e)}),c.call(`beforesend`,s,f),f.send(n??null),s},abort:function(){return f.abort(),s},on:function(){var e=c.on.apply(c,arguments);return e===c?s:e}},n!=null){if(typeof n!=`function`)throw Error(`invalid callback: `+n);return s.get(n)}return s}__name(request_default,`default`);function fixCallback(e){return function(t,n){e(t==null?n:null)}}function hasResponse(e){var t=e.responseType;return t&&t!==`text`?e.response:e.responseText}function type_default(e,t){return function(n,s){var c=request_default(n).mimeType(e).response(t);if(s!=null){if(typeof s!=`function`)throw Error(`invalid callback: `+s);return c.get(s)}return c}}__name(type_default,`default`);var Zt=type_default(`application/json`,function(e){return JSON.parse(e.responseText)});function dsv_default(e,t){return function(n,s,c){arguments.length<3&&(c=s,s=null);var l=request_default(n).mimeType(e);return l.row=function(e){return arguments.length?l.response(responseOf(t,s=e)):s},l.row(s),c?l.get(c):l}}__name(dsv_default,`default`);function responseOf(e,t){return function(n){return e(n.responseText,t)}}t.csvParse,t.tsvParse;var Qt=null,$t=null,en=null,ChoroplethCountries=class extends Choropleth{_choroTopologyObjectsCountries;_choroTopologyObjectsLand;choroPaths;constructor(){super()}layerEnter(e,n,s){Choropleth.prototype.layerEnter.apply(this,arguments),this._choroTopology=Qt.topology,this._choroTopologyObjectsCountries=Qt.topology.objects.countries,this._choroTopologyObjectsLand=Qt.topology.objects.land,this._choroTopologyObjects=this._choroTopologyObjectsCountries,this._selection.widgetElement(this._choroplethData),this.choroPaths=(0,t.select)(null);let c=this;this.tooltipHTML(function(e){return c.tooltipFormat({label:e[0],value:e[1]})})}layerUpdate(e){Choropleth.prototype.layerUpdate.apply(this,arguments),this._choroplethData.style(`stroke`,this.meshVisible()?null:`black`),this.choroPaths=this._choroplethData.selectAll(`.shape`).data(this.visible()?this.data():[],function(e){return e[0]});let t=this;this.choroPaths.enter().append(`path`).attr(`class`,`shape`).attr(`vector-effect`,`non-scaling-stroke`).call(this._selection.enter.bind(this._selection)).on(`click`,function(e){t._dataMap[e[0]]&&t.click(t.rowToObj(t._dataMap[e[0]]),`weight`,t._selection.selected(this))}).on(`dblclick`,function(e){t._dataMap[e[0]]&&t.dblclick(t.rowToObj(t._dataMap[e[0]]),`weight`,t._selection.selected(this))}).on(`mouseout.tooltip`,this.tooltip.hide).on(`mousemove.tooltip`,this.tooltip.show).merge(this.choroPaths).attr(`d`,function(t){let n=e._d3GeoPath(en[t[0]]);return n||console.warn(`Unknown Country: `+t),n}).style(`fill`,function(e){return t._palette(e[1],t._dataMinWeight,t._dataMaxWeight)}),this.choroPaths.exit().remove()}layerPreRender(){return this._topoJsonPromise||=new Promise((e,t)=>{Qt&&e(),Zt(`${topoJsonFolder()}/countries.json`,function(t){Qt=t,$t=feature_default(Qt.topology,Qt.topology.objects.countries).features,en={};for(let e in $t)$t[e].id&&Qt.countryNames[$t[e].id]&&(en[Qt.countryNames[$t[e].id].name]=$t[e]);e()})}),this._topoJsonPromise}};ChoroplethCountries.prototype._class+=` map_ChoroplethCountries`;var ChoroplethContinents=class extends ChoroplethCountries{constructor(){super()}layerEnter(e,t,n){ChoroplethCountries.prototype.layerEnter.apply(this,arguments),this._choroTopologyObjects=this._choroTopologyObjectsLand}};ChoroplethContinents.prototype._class+=` map_ChoroplethContinents`;var tn=null,nn=null,rn=null,ChoroplethCounties=class extends Choropleth{static __inputs=[{id:`fips`,type:`string`},{id:`value`,type:`number`}];choroPaths;constructor(){super(),this.projection(`AlbersUsaPr`)}layerEnter(e,n,s){Choropleth.prototype.layerEnter.apply(this,arguments),this._choroTopology=tn.topology,this._choroTopologyObjects=tn.topology.objects.counties,this._selection.widgetElement(this._choroplethData),this.choroPaths=(0,t.select)(null);let c=this;this.tooltipHTML(function(e){let t=e[0];return c.tooltipFormat({label:tn.countyNames[t],value:c._dataMap[t]?c._dataMap[t][1]:`N/A`})})}layerUpdate(e){Choropleth.prototype.layerUpdate.apply(this,arguments),this._choroplethData.style(`stroke`,this.meshVisible()?null:`black`),this.choroPaths=this._choroplethData.selectAll(`.shape`).data(this.visible()?this.data():[],function(e){return e[0]});let t=this;this.choroPaths.enter().append(`path`).attr(`class`,`shape`).attr(`vector-effect`,`non-scaling-stroke`).call(this._selection.enter.bind(this._selection)).on(`click`,function(e){t.click(t.rowToObj(e),`weight`,t._selection.selected(this))}).on(`dblclick`,function(e){t.dblclick(t.rowToObj(e),`weight`,t._selection.selected(this))}).on(`mouseout.tooltip`,this.tooltip.hide).on(`mousemove.tooltip`,this.tooltip.show).merge(this.choroPaths).attr(`d`,function(t){let n=e._d3GeoPath(rn[t.county]);return n||console.warn(`Unknown US County: `+t.county,t),n}).style(`fill`,function(e){return t._palette(e[1],t._dataMinWeight,t._dataMaxWeight)}),this.choroPaths.exit().remove()}layerPreRender(){return this._topoJsonPromise||=new Promise((e,t)=>{tn&&e(),Zt(`${topoJsonFolder()}/us-counties.json`,function(t){tn=t,nn=feature_default(tn.topology,tn.topology.objects.counties).features,rn={};for(let e in nn)nn[e].id&&(rn[nn[e].id]=nn[e]);e()})}),this._topoJsonPromise}};ChoroplethCounties.prototype._class+=` map_ChoroplethCounties`,ChoroplethCounties.prototype.publish(`onClickFormatFIPS`,!1,`boolean`,`format FIPS code as a String on Click`);var an=null,sn=null,cn=null,ChoroplethStates=class extends Choropleth{static __inputs=[{id:`state`,type:`string`},{id:`value`,type:`number`}];choroPaths;constructor(){super(),this.projection(`AlbersUsaPr`)}layerEnter(e,n,s){Choropleth.prototype.layerEnter.apply(this,arguments),this._choroTopology=an.topology,this._choroTopologyObjects=an.topology.objects.states,this._selection.widgetElement(this._choroplethData),this.choroPaths=(0,t.select)(null);let c=this;this.tooltipHTML(function(e){let t=cn[e[0]].id;return c.tooltipFormat({label:an.stateNames[t].name,value:e[1]})})}layerUpdate(e){Choropleth.prototype.layerUpdate.apply(this,arguments),this._choroplethData.style(`stroke`,this.meshVisible()?null:`black`),this.choroPaths=this._choroplethData.selectAll(`.shape`).data(this.visible()?this.data():[],function(e){return e[0]});let t=this;this.choroPaths.enter().append(`path`).attr(`class`,`shape`).attr(`vector-effect`,`non-scaling-stroke`).call(this._selection.enter.bind(this._selection)).on(`click`,function(e){t.click(t.rowToObj(e),`weight`,t._selection.selected(this))}).on(`dblclick`,function(e){t.dblclick(t.rowToObj(e),`weight`,t._selection.selected(this))}).on(`mouseout.tooltip`,this.tooltip.hide).on(`mousemove.tooltip`,this.tooltip.show).merge(this.choroPaths).attr(`d`,function(t){let n=e._d3GeoPath(cn[t[0]]);return n||console.warn(`Unknown US State: `+t[0]),n}).style(`fill`,function(e){return t._palette(e[1],t._dataMinWeight,t._dataMaxWeight)}),this.choroPaths.exit().remove()}layerPreRender(){return this._topoJsonPromise||=new Promise((e,t)=>{an&&e(),Zt(`${topoJsonFolder()}/us-states.json`,function(t){an=t,sn=feature_default(an.topology,an.topology.objects.states).features,cn={};for(let e in sn)sn[e].id&&(cn[an.stateNames[sn[e].id].code]=sn[e]);e()})}),this._topoJsonPromise}};ChoroplethStates.prototype._class+=` map_ChoroplethStates`;var ChoroplethStatesHeat=class extends Layered{constructor(){super()}};ChoroplethStatesHeat.prototype._class+=` map_ChoroplethStatesHeat`;var GeoHash=class extends Layer{_dataMinWeight;_dataMaxWeight;geohash;_geoHashTransform;geoHashPaths;constructor(){super()}data(e){let t=Layer.prototype.data.apply(this,arguments);return arguments.length&&(this._dataMinWeight=null,this._dataMaxWeight=null,this.data().forEach(function(e){(!this._dataMinWeight||e[1]<this._dataMinWeight)&&(this._dataMinWeight=e[1]),(!this._dataMaxWeight||e[1]>this._dataMaxWeight)&&(this._dataMaxWeight=e[1])},this)),t}layerEnter(e,n,s){Layer.prototype.layerEnter.apply(this,arguments),this.geohash=new Wt,this._geoHashTransform=n.append(`g`).attr(`class`,`map_GeoHash`),this._selection=new t.Utility.SimpleSelection(this,this._geoHashTransform),this.geoHashPaths=(0,t.select)(null)}layerUpdate(e){Layer.prototype.layerUpdate.apply(this,arguments),this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+`_`+this.id())),this._geoHashTransform.style(`opacity`,this.opacity()),this.geoHashPaths=this._geoHashTransform.selectAll(`.data`).data(this.visible()?this.data():[],function(e){return e[0]});let t=this;this.geoHashPaths.enter().append(`path`).attr(`class`,`data`).call(this._selection.enter.bind(this._selection)).on(`click`,function(e){t.click(t.rowToObj(e),`weight`,t._selection.selected(this))}).on(`dblclick`,function(e){t.dblclick(t.rowToObj(e),`weight`,t._selection.selected(this))}).merge(this.geoHashPaths).attr(`d`,function(n){let s=t.geohash.bounds(n[0]),c={type:`LineString`,coordinates:[[s.sw.lon,s.ne.lat],[s.ne.lon,s.ne.lat],[s.ne.lon,s.sw.lat],[s.sw.lon,s.sw.lat]]};return e._d3GeoPath(c)}).style(`fill`,function(e){return t._palette(e[1],t._dataMinWeight,t._dataMaxWeight)}),this.geoHashPaths.exit().remove()}click(e,t,n){}dblclick(e,t,n){}};GeoHash.prototype._class+=` map_GeoHash`,GeoHash.prototype._palette=t.Palette.rainbow(`default`),GeoHash.prototype.publish(`paletteID`,`YlOrRd`,`set`,`Color palette for this widget`,GeoHash.prototype._palette.switch(),{tags:[`Basic`,`Shared`]}),GeoHash.prototype.publish(`useClonedPalette`,!1,`boolean`,`Enable or disable using a cloned palette`,null,{tags:[`Intermediate`,`Shared`]}),GeoHash.prototype.publish(`opacity`,1,`number`,`Opacity`,null,{tags:[`Advanced`]}),GeoHash.prototype.publish(`meshVisible`,!0,`boolean`,`Mesh Visibility`),GeoHash.prototype.publish(`meshColor`,null,`html-color`,`Stroke Color`,null,{optional:!0}),GeoHash.prototype.publish(`meshStrokeWidth`,.25,`number`,`Stroke Width`);var ln=class Loader{constructor(e=null,t={}){if(this.apiKey=e,this.options=t,typeof window>`u`)throw Error(`google-maps is supported only in browser environment`)}load(){return this.api===void 0?this.loader===void 0?(window[Loader.CALLBACK_NAME]=()=>{if(this.api=window.google,this.resolve===void 0)throw Error(`Should not happen`);this.resolve(this.api)},window.gm_authFailure=()=>{if(this.reject===void 0)throw Error(`Should not happen`);this.reject(Error(`google-maps: authentication error`))},this.loader=new Promise((e,t)=>{this.resolve=e,this.reject=t;let n=document.createElement(`script`);n.src=this.createUrl(),n.async=!0,n.onerror=e=>t(e),document.head.appendChild(n)})):this.loader:Promise.resolve(this.api)}createUrl(){let e=[`callback=${Loader.CALLBACK_NAME}`];this.apiKey&&e.push(`key=${this.apiKey}`);for(let t in this.options)if(this.options.hasOwnProperty(t)){let n=this.options[t];t===`version`&&(t=`v`),t===`libraries`&&(n=n.join(`,`)),e.push(`${t}=${n}`)}return`https://maps.googleapis.com/maps/api/js?${e.join(`&`)}`}};ln.CALLBACK_NAME=`_dk_google_maps_loader_cb`;var Y=null,un=15e3;function requireGoogleMapTimeout(e){un=e}var dn;function requireGoogleMap(e){return dn||=(0,c.promiseTimeout)(un,new Promise(function(t,n){if(Y)t();else if(e)Y=e,t();else{window.__hpcc_gmap_apikey||console.warn(`__hpcc_gmap_apikey does not contain a valid API key, reverting to developers key (expect limited performance)`);try{new ln(window.__hpcc_gmap_apikey||`AIzaSyDwGn2i1i_pMZvnqYJN1BksD_tjYaCOWKg`,{libraries:[`geometry`,`drawing`]}).load().then(function(e){Y=e,t()}).catch(function(e){console.warn(`Failed to initialize Google Map API: ${e.message}`),t()})}catch(e){console.warn(`Failed to initialize Google Map API: ${e.message}`),t()}}})).catch(e=>{console.warn(`Timed out initializing Google Map API after ${un}ms.`)}),dn}function createOverlay(e,t,n){function Overlay(e,t,n){Y.maps.OverlayView.call(this),this._div=null,this._worldSurface=t,this._viewportSurface=n,this._map=e,this.setMap(e);let s=this;Y.maps.event.addListener(e,`bounds_changed`,function(){s.draw()}),Y.maps.event.addListener(e,`projection_changed`,function(){s.draw()}),this._prevWorldMin={x:0,y:0},this._prevWorldMax={x:0,y:0},this._prevMin={x:0,y:0},this._prevMax={x:0,y:0}}return Overlay.prototype=Y.maps.OverlayView.prototype,Overlay.prototype.onAdd=function(){this.div=document.createElement(`div`),this._viewportSurface.target(null).target(this.div).units(`pixels`),this.getPanes().overlayMouseTarget.appendChild(this.div)},Overlay.prototype.draw=function(){let e=this.getProjection();if(!e)return;let t=this._map.getBounds(),n=e.fromLatLngToDivPixel(t.getCenter()),s=e.fromLatLngToDivPixel(t.getSouthWest()),c=e.fromLatLngToDivPixel(t.getNorthEast()),l={x:s.x,y:c.y},d={x:c.x,y:s.y},f=e.getWorldWidth();for(;d.x<l.x+100;)d.x+=f;for(;l.x>n.x;)l.x-=f,d.x-=f;(l.x!==this._prevMin.x||l.y!==this._prevMin.y||d.x!==this._prevMax.x||d.y!==this._prevMax.y)&&(this._viewportSurface.resize({width:0,height:0}).widgetX(l.x).widgetY(l.y).widgetWidth(d.x-l.x).widgetHeight(d.y-l.y),this._viewportSurface._renderCount?(this._viewportSurface.render(),this._prevMin=l,this._prevMax=d):this._viewportSurface.lazyRender());let p=e.fromLatLngToDivPixel(new Y.maps.LatLng(85,-179.9)),m=e.fromLatLngToDivPixel(new Y.maps.LatLng(-85,179.9));for(;m.x<p.x+100;)m.x+=f;for(;p.x>n.x;)p.x-=f,m.x-=f;(p.x!==this._prevWorldMin.x||p.y!==this._prevWorldMin.y||m.x!==this._prevWorldMax.x||m.y!==this._prevWorldMax.y)&&(this._worldSurface.widgetX(p.x).widgetY(p.y).widgetWidth(m.x-p.x).widgetHeight(m.y-p.y).render(),this._prevWorldMin=m,this._prevWorldMax=m)},Overlay.prototype.onRemove=function(){this._viewportSurface.target(null),this._div.parentNode.removeChild(this._div),this._div=null},new Overlay(e,t,n)}var UserShapeSelectionBag=class{_userShapes;mapContext;constructor(e){this._userShapes=[],this.mapContext=e}add(e){this._userShapes.indexOf(e)>=0||this._userShapes.push(e)}remove(e){let t=this._userShapes.indexOf(e);t>=0&&this._userShapes.splice(t,1),e.setMap(null)}save(){return this._userShapes.map(e=>this._saveShape(e))}load(e){this._deserializeShapes(e)}_saveShape(e){let t={},n={circle:e=>{t.type=`circle`,t.pos={lat:e.center.lat(),lng:e.center.lng()},t.radius=e.radius},rectangle:e=>{t.type=`rectangle`,t.bounds={ne:e.bounds.getNorthEast(),sw:e.bounds.getSouthWest()}},polygon:e=>{t.type=e.__hpcc_type;let n=e.getPath();t.vertices=[];for(let e=0;e<n.length;e++)t.vertices.push(n.getAt(e))},polyline:e=>{n.polygon(e)}};return n[e.__hpcc_type](e),t.strokeWeight=e.strokeWeight,t.fillColor=e.fillColor,t.fillOpacity=e.fillOpacity,t.editable=e.editable,t.clickable=e.clickable||!0,t}_deserializeShapes(e){let t=JSON.parse(e),n={strokeWeight:0,fillOpacity:.45,fillColor:`#1f77b4`,editable:!0,clickable:!0},s={circle:(e,t)=>new Y.maps.Circle({strokeWeight:e.strokeWeight||n.strokeWeight,fillColor:e.fillColor||n.fillColor,fillOpacity:e.fillOpacity||n.fillOpacity,editable:e.editable||n.editable,clickable:e.clickable||n.clickable,map:t,center:e.pos,radius:e.radius}),rectangle:(e,t)=>new Y.maps.Rectangle({strokeWeight:e.strokeWeight||n.strokeWeight,fillColor:e.fillColor||n.fillColor,fillOpacity:e.fillOpacity||n.fillOpacity,editable:e.editable||n.editable,clickable:e.clickable||n.clickable,map:t,bounds:{north:e.bounds.ne.lat,west:e.bounds.sw.lng,south:e.bounds.sw.lat,east:e.bounds.ne.lng}}),polygon:(e,t)=>new Y.maps.Polygon({strokeWeight:e.strokeWeight||n.strokeWeight,fillColor:e.fillColor||n.fillColor,fillOpacity:e.fillOpacity||n.fillOpacity,editable:e.editable||n.editable,clickable:e.clickable||n.clickable,map:t,paths:e.vertices}),polyline:(e,t)=>new Y.maps.Polyline({strokeWeight:e.strokeWeight||n.strokeWeight,fillColor:e.fillColor||n.fillColor,fillOpacity:e.fillOpacity||n.fillOpacity,editable:e.editable||n.editable,clickable:e.clickable||n.clickable,map:t,path:e.vertices})};for(let e=0;e<t.length;e++){let n=s[t[e].type](t[e],this.mapContext._googleMap);this.mapContext.onDrawingComplete({type:t[e].type,overlay:n})}}},X=class GMap extends t.HTMLWidget{_overlay;_userShapes;_worldSurface;_viewportSurface;_googleMapNode;_googleMap;_googleGeocoder;_prevCenterLat;_prevCenterLong;_googleStreetViewService;_googleMapPanorama;_prevZoom;_prevStreetView;_circleMap;_pinMap;_drawingManager;_prevCenterAddress;_userShapeSelection;constructor(){super(),this._tag=`div`;let e=this;function calcProjection(t,n,s){let c=e._overlay.getProjection(),l=c.fromLatLngToDivPixel(new Y.maps.LatLng(n,s)),d=c.getWorldWidth(),f=parseFloat(t.widgetX()),p=parseFloat(t.widgetY()),m=parseFloat(t.widgetWidth());for(l.x-=f,l.y-=p;l.x<0;)l.x+=d;for(;l.x>m;)l.x-=d;return l}this._userShapes=new UserShapeSelectionBag(this),this._worldSurface=new s.AbsoluteSurface,this._worldSurface.project=function(e,t){return calcProjection(this,e,t)},this._viewportSurface=new s.AbsoluteSurface,this._viewportSurface.project=function(e,t){return calcProjection(this,e,t)}}data(e){return t.HTMLWidget.prototype.data.apply(this,arguments)}getMapType(){switch(this.type()){case`terrain`:return Y.maps.MapTypeId.TERRAIN;case`road`:return Y.maps.MapTypeId.ROADMAP;case`satellite`:return Y.maps.MapTypeId.SATELLITE;case`hybrid`:return Y.maps.MapTypeId.HYBRID;default:return Y.maps.MapTypeId.ROADMAP}}getMapOptions(){return{panControl:this.panControl(),zoomControl:this.zoomControl(),fullscreenControl:this.fullscreenControl(),mapTypeControl:this.mapTypeControl(),scaleControl:this.scaleControl(),streetViewControl:this.streetViewControl(),overviewMapControl:this.overviewMapControl(),overviewMapControlOptions:{opened:!0},styles:this.googleMapStyles()}}size(e){let n=t.HTMLWidget.prototype.size.apply(this,arguments);return arguments.length&&this._googleMapNode&&(this._googleMapNode.style(`width`,e.width+`px`).style(`height`,e.height+`px`),Y.maps.event.trigger(this._googleMap,`resize`)),n}enter(e,n){super.enter(e,n);let s=this;this._googleGeocoder=new Y.maps.Geocoder,this._googleMapNode=n.append(`div`).style(`width`,this.width()+`px`).style(`height`,this.height()+`px`),this._googleMap=new Y.maps.Map(this._googleMapNode.node(),{zoom:this.zoom(),center:new Y.maps.LatLng(this.centerLat(),this.centerLong()),mapTypeId:this.getMapType(),disableDefaultUI:!0}),this._overlay=createOverlay(this._googleMap,this._worldSurface,this._viewportSurface),this._googleMap.addListener(`center_changed`,function(){s.centerLat(s._googleMap.center.lat()),s._prevCenterLat=s.centerLat(),s.centerLong(s._googleMap.center.lng()),s._prevCenterLong=s.centerLong(),s._googleMapPanorama.setPosition({lat:s.centerLat(),lng:s.centerLong()}),s.zoom(s._googleMap.getZoom()),s._prevZoom=s.zoom(),s._overlay.draw()}),this._googleMap.addListener(`zoom_changed`,function(){s.zoom(s._googleMap.zoom),s._prevZoom=s.zoom()}),this._googleStreetViewService=new Y.maps.StreetViewService,this._googleMapPanorama=this._googleMap.getStreetView(),this._googleMapPanorama.addListener(`visible_changed`,function(){s.streetView(s._googleMapPanorama.getVisible()),s._prevStreetView=s.streetView()}),this._circleMap=(0,t.map)([]),this._pinMap=(0,t.map)([]),this._prevCenterLat=this.centerLat(),this._prevCenterLong=this.centerLong(),this._prevZoom=this.zoom();let c={strokeWeight:0,fillOpacity:.45,fillColor:`#1f77b4`,editable:!0,clickable:!0};this._drawingManager=new Y.maps.drawing.DrawingManager({drawingMode:Y.maps.drawing.OverlayType.MARKER,drawingControl:!0,drawingControlOptions:{position:Y.maps.ControlPosition.TOP_CENTER,drawingModes:[`polygon`,`rectangle`,`circle`]},rectangleOptions:c,circleOptions:c,polygonOptions:c}),this.drawingState()&&this._userShapes.load(this.drawingState())}update(e,t){let n=this;this._googleMapNode.style(`width`,this.width()+`px`).style(`height`,this.height()+`px`),this._googleMap.setMapTypeId(this.getMapType()),this._googleMap.setOptions(this.getMapOptions()),this.centerAddress_exists()&&this._prevCenterAddress!==this.centerAddress()&&(this._prevCenterAddress=this.centerAddress(),this._googleGeocoder.geocode({address:this.centerAddress()},function(e,t){if(t===Y.maps.GeocoderStatus.OK){let t=e[0].geometry.bounds||e[0].geometry.viewport;n._googleMap.fitBounds(t),n.streetView()&&n.useComputedHeading()&&n.streetViewAt({lat:e[0].geometry.location.lat(),lng:e[0].geometry.location.lng()},50)}else n.statusError({data:e,status:t})})),(this._prevCenterLat!==this.centerLat()||this._prevCenterLong!==this.centerLong())&&(this._googleMap.setCenter(new Y.maps.LatLng(this.centerLat(),this.centerLong())),this._prevCenterLat=this.centerLat(),this._prevCenterLong=this.centerLong()),this._prevZoom!==this.zoom()&&(this._googleMap.setZoom(this.zoom()),this._prevZoom=this.zoom()),this.updateCircles(),this.updatePins(),this._prevStreetView!==this.streetView()&&(this.streetView()?(this._googleMapPanorama.setPosition({lat:this.centerLat(),lng:this.centerLong()}),this._googleMapPanorama.setPov({heading:0,pitch:0}),this._googleMapPanorama.setVisible(!0)):this._googleMapPanorama.setVisible(!1),this._prevStreetView=this.streetView()),this.drawingTools()?(this._drawingManager.setMap(this._googleMap),Y.maps.event.addListener(this._drawingManager,`overlaycomplete`,function(){GMap.prototype.onDrawingComplete.apply(n,arguments)})):(this._drawingManager.setMap(null),Y.maps.event.clearInstanceListeners(this._drawingManager))}render(e){let t=this,n=arguments;return requireGoogleMap().then(()=>{super.render.apply(t,n)}),this}streetViewAt(e,t=1e3){let n=this,s=this.outdoorStreetViewOnly()?Y.maps.StreetViewSource.OUTDOOR:Y.maps.StreetViewSource.DEFAULT;this._googleStreetViewService.getPanorama({location:e,radius:t,source:s},function(t,s){if(s===`OK`){let s=new Y.maps.Marker({position:e,map:n._googleMap}),c=Y.maps.geometry.spherical.computeHeading(t.location.latLng,new Y.maps.LatLng(e.lat,e.lng));n._googleMapPanorama.setPano(t.location.pano),n._googleMapPanorama.setPov({heading:c,pitch:0}),n.showStreetViewMarker()||s.setVisible(!1),n._googleMapPanorama.setVisible(!0);let l=Y.maps.event.addListener(n._googleMap.getStreetView(),`visible_changed`,function(){this.getVisible()||(s.setMap(null),Y.maps.event.removeListener(l))})}else n.statusError({data:t,status:s})})}updateCircles(){function rowID(e){return e[0]+`_`+e[1]}let e=[],n=[],s=(0,t.map)(this._circleMap.keys(),function(e){return e});this.data().forEach(function(t){s.remove(rowID(t)),t[3]&&!this._circleMap.has(rowID(t))?e.push(t):t[3]&&this._circleMap.has(rowID(t))?n.push(t):!t[3]&&this._circleMap.has(rowID(t))&&s.set(rowID(t),!0)},this),e.forEach(function(e){let t=this.createCircle(e[0],e[1],e[3]);this._circleMap.set(rowID(e),t)},this),n.forEach(function(e){},this);let c=this;s.each(function(e){c._circleMap.get(e).setMap(null),c._circleMap.remove(e)})}updatePins(){function rowID(e){return e[0]+`_`+e[1]}let e=[],n=[],s=(0,t.map)(this._pinMap.keys(),function(e){return e});this.data().forEach(function(t){s.remove(rowID(t)),t[2]&&!this._pinMap.has(rowID(t))?e.push(t):t[2]&&this._pinMap.has(rowID(t))?n.push(t):!t[2]&&this._pinMap.has(rowID(t))&&s.set(rowID(t),!0)},this),e.forEach(function(e){let t=this.createMarker(e[0],e[1],e[2]);this._pinMap.set(rowID(e),t)},this),n.forEach(function(e){this._pinMap.get(rowID(e)).setIcon(this.createIcon(e[2]))},this);let c=this;s.each(function(e){c._pinMap.get(e).setMap(null),c._pinMap.remove(e)})}createIcon(e){return{path:`M 0,0 C -2,-20 -10,-22 -10,-30 A 10,10 0 1,1 10,-30 C 10,-22 2,-20 0,0 z M -2,-30`,fillColor:e.fillColor,fillOpacity:e.fillOpacity||.8,scale:.5,strokeColor:e.strokeColor||`black`,strokeWeight:.25}}createMarker(e,t,n){return new Y.maps.Marker({position:new Y.maps.LatLng(e,t),animation:Y.maps.Animation.DROP,title:n.title||``,icon:this.createIcon(n),map:this._googleMap})}createCircle(e,t,n){return n.radius=n.radius||1,new Y.maps.Circle({center:new Y.maps.LatLng(e,t),radius:16093*n.radius/10,fillColor:n.fillColor||`red`,strokeColor:n.strokeColor||n.fillColor||`black`,strokeWeight:.5,map:this._googleMap})}zoomTo(e,t){if(!this._renderCount)return this;t||=this.singleZoomToMaxZoom();let n=0,s=new Y.maps.LatLngBounds;switch(e.forEach(function(e){let t=new Y.maps.LatLng(e[0],e[1]);s.extend(t),++n}),n){case 0:break;case 1:this._googleMap.setCenter(s.getCenter()),this._googleMap.setZoom(t);break;default:this._googleMap.fitBounds(s)}return this}zoomToFit(){return this.zoomTo(this.data())}drawingOptions(e){return arguments.length?(this._drawingManager.setOptions(e),this):this._drawingManager}userShapeSelection(e){return arguments.length?(this._userShapeSelection&&this._userShapeSelection.setEditable(!1),this._userShapeSelection=e,this._userShapeSelection&&this._userShapeSelection.setEditable(!0),this):this._userShapeSelection}deleteUserShape(e){this._userShapeSelection===e&&this.userShapeSelection(null),this._userShapes.remove(e)}onDrawingComplete(e){if(e.type!==Y.maps.drawing.OverlayType.MARKER){this._drawingManager.setDrawingMode(null);let t=e.overlay;t.__hpcc_type=e.type,this._userShapes.add(t);let n=this,s=!1;window.addEventListener(`keydown`,function(e){(e.keyIdentifier===`Control`||e.ctrlKey===!0)&&(s=!0)}),window.addEventListener(`keyup`,function(e){e.ctrlKey===!1&&(s=!1)}),Y.maps.event.addListener(t,`click`,function(e){return n.userShapeSelection(t),e&&s===!0&&(n.deleteUserShape(t),n.drawingState(JSON.stringify(n._userShapes.save()))),!1}),this.userShapeSelection(t),this.drawingState(JSON.stringify(this._userShapes.save()))}}statusError(e){console.warn(`Data not found for this location.`)}};X.prototype._class+=` map_GMap`,X.prototype.publish(`outdoorStreetViewOnly`,!1,`boolean`,`If true, streetView will only display outdoor locations`),X.prototype.publish(`showStreetViewMarker`,!1,`boolean`,`If true, streetView marker will be hidden`),X.prototype.publish(`useComputedHeading`,!1,`boolean`,`If true, centerAddress streetView compute the ideal panorama heading`),X.prototype.publish(`type`,`road`,`set`,`Map Type`,[`terrain`,`road`,`satellite`,`hybrid`],{tags:[`Basic`]}),X.prototype.publish(`centerLat`,42.877742,`number`,`Center Latitude`,null,{tags:[`Basic`]}),X.prototype.publish(`centerLong`,-97.380979,`number`,`Center Longitude`,null,{tags:[`Basic`]}),X.prototype.publish(`centerAddress`,null,`string`,`Address to center map on`,null,{tags:[`Basic`],optional:!0}),X.prototype.publish(`zoom`,4,`number`,`Zoom Level`,null,{tags:[`Basic`]}),X.prototype.publish(`singleZoomToMaxZoom`,14,`number`,`Max zoomTo level with single item`),X.prototype.publish(`panControl`,!0,`boolean`,`Pan Controls`,null,{tags:[`Basic`]}),X.prototype.publish(`zoomControl`,!0,`boolean`,`Zoom Controls`,null,{tags:[`Basic`]}),X.prototype.publish(`scaleControl`,!0,`boolean`,`Scale Controls`,null,{tags:[`Basic`]}),X.prototype.publish(`mapTypeControl`,!1,`boolean`,`Map Type Controls`,null,{tags:[`Basic`]}),X.prototype.publish(`fullscreenControl`,!1,`boolean`,`Fullscreen Controls`,null,{tags:[`Basic`]}),X.prototype.publish(`streetViewControl`,!1,`boolean`,`StreetView Controls`,null,{tags:[`Basic`]}),X.prototype.publish(`overviewMapControl`,!1,`boolean`,`OverviewMap Controls`,null,{tags:[`Basic`]}),X.prototype.publish(`streetView`,!1,`boolean`,`Streetview`,null,{tags:[`Basic`]}),X.prototype.publish(`drawingTools`,!1,`boolean`,`Drawing Tools`,null,{tags:[`Basic`]}),X.prototype.publish(`drawingState`,``,`string`,`Map Drawings`,null,{disable:e=>e.drawingTools()===!1}),X.prototype.publish(`googleMapStyles`,{},`object`,`Styling for map colors etc`,null,{tags:[`Basic`]});var fn=1/16,OverlayLayered=class extends Layered{gmap;surface;constructor(e,t){super(),this.gmap=e,this.surface=t,this.autoScaleMode(`none`),this.zoomable(!1).zoomDuration(10)}getProjection(){return this.gmap._overlay.getProjection()}render(e){return super.render(t=>{let n=this.getProjection();if(n){let e=new window.google.maps.LatLng(0,0),t=n.fromLatLngToDivPixel(e),s=this.surface.widgetX(),c=this.surface.widgetY(),l=[t.x-s,t.y-c],d=this.gmap._googleMap.getZoom();this.zoomTo(l,fn*(1<<d),0)}e&&e(t)}),this}},GMapLayered=class extends X{layered;constructor(){super(),this.layered=new OverlayLayered(this,this._viewportSurface),this._viewportSurface.widget(this.layered)}invert(e,t){return this.layered.invert(e,t)}rproject(e,t){let n=this.layered.getProjection().fromDivPixelToLatLng(new Y.maps.Point(e,t));return{lat:n.lat(),lng:n.lng()}}updateCircles(){}updatePins(){}layers(e){return arguments.length?(this.layered.layers(e),this):this.layered.layers()}render(e){return super.render(t=>{this.layered.preRender().then(()=>{this.layered.render(t=>{e&&e(t)})})})}};GMapLayered.prototype._class+=` map_GMapLayered`;var GMapCounties=class extends GMapLayered{_counties;_view;_palette;_dataMinWeight;_dataMaxWeight;constructor(){super();let e=this;this._counties=new ChoroplethCounties().paletteID(`Blues`).meshVisible(!1).opacity(.8).columns([`fips`,`weight`]).on(`click`,function(t,n,s){e.click(t,n,s)}).on(`dblclick`,function(t,n,s){e.dblclick(t,n,s)})}enter(e,t){super.enter(e,t),this.layers([this._counties])}update(e,t){this._counties.data(this.data()),super.update(e,t),this._palette=this._counties._palette,this._dataMinWeight=this._counties._dataMinWeight,this._dataMaxWeight=this._counties._dataMaxWeight}_prevBounds;render(e){return super.render(t=>{if(this._renderCount>1&&this.autoScale()){let e=this._counties.getDataBounds();if(e.x&&e.y&&(!this._prevBounds||this._prevBounds.x!==e.x||this._prevBounds.y!==e.y||this._prevBounds.width!==e.width||this._prevBounds.height!==e.height)){this._prevBounds=e;let t=this.invert(e.x,e.y),n=this.invert(e.x+e.width,e.y+e.height);t&&n&&this.zoomTo([[t[1],t[0]],[n[1],n[0]]])}}e&&e(t)})}exit(e,t){super.exit(e,t)}click(e,t,n){}dblclick(e,t,n){}};GMapCounties.prototype._class+=` map_GMapCounties`,GMapCounties.prototype.publish(`autoScale`,!1,`boolean`,`Auto scale to data`);var GMapGraph=class extends X{constructor(){super()}enter(){super.enter.apply(this,arguments);let e=new l.Graph().layout(`None`).zoomable(!1),n=e.render,s=this;e.render=function(e){let c=[],d=[],f=null;return s.data().forEach(function(e){let n=s._viewportSurface.project(e[0],e[1]),p=new t.Shape().shape(`circle`).radius(3).data(e).pos(n);c.push(p),f&&d.push(new l.Edge().sourceVertex(f).targetVertex(p).sourceMarker(`none`).targetMarker(`arrow`)),f=p}),this.data({vertices:c,edges:d}),n.apply(this,arguments)},this._viewportSurface.widget(e)}};GMapGraph.prototype._class+=` map_GMapGraph`;var GMapHeat=class extends X{constructor(){super()}enter(){super.enter.apply(this,arguments);let e=new d.HeatMap,t=e.render,n=this;e.render=function(e){return this.data(n.data().map(function(e){let t=n._viewportSurface.project(e[0],e[1]);return[t.x,t.y,e[4]]})),t.apply(this,arguments),this},this._viewportSurface.widget(e)}};GMapHeat.prototype._class+=` map_GMapHeat`;var Pins=class extends Layer{_geohash;_pinsTransform;pinsPaths;constructor(){super(),t.Utility.SimpleSelectionMixin.call(this),this._geohash=new Wt}pinsData(){let e=this._db.fieldByLabel(this.geohashColumn()),t=this._db.fieldByLabel(this.tooltipColumn()),n=this._db.fieldByLabel(this.latColumn()),s=this._db.fieldByLabel(this.longColumn()),c=this;return this.data().filter(function(e){let t=n?e[n.idx]:e[0],l=s?e[s.idx]:e[1];return!(c.omitNullLatLong()&&t===0&&l===0)}).map(function(c,l){let d={idx:l,lat:n?c[n.idx]:c[0],long:s?c[s.idx]:c[1],ext:c[2]instanceof Object?c[2]:{},origRow:c};if(e)try{let t=this._geohash.bounds(c[e.idx]);d.lat=(t.ne.lat+t.sw.lat)/2,d.long=(t.ne.lon+t.sw.lon)/2}catch{}return t&&(d.ext.tooltip=c[t.idx]),d},this)}layerEnter(e,n,s){Layer.prototype.layerEnter.apply(this,arguments),this._pinsTransform=n,this._selection.widgetElement(this._pinsTransform),this.pinsPaths=(0,t.select)(null),this.tooltipHTML(function(e){return e.ext.tooltip===void 0?``:e.ext.tooltip})}layerUpdate(e){Layer.prototype.layerUpdate.apply(this,arguments),this._pinsTransform.style(`opacity`,this.opacity()),this.pinsPaths=this._pinsTransform.selectAll(`.pin`).data(this.visible()?this.pinsData():[],e=>e.idx);let n=this,s=this.pinsPaths.enter().append(`g`).attr(`class`,`pin`).call(this._selection.enter.bind(this._selection)).on(`click`,function(e){n.click(n.rowToObj(e.origRow),`geohash`,n._selection.selected(this))}).on(`dblclick`,function(e){n.dblclick(n.rowToObj(e.origRow),`geohash`,n._selection.selected(this))}).on(`mouseover`,function(e){t.Platform.isIE||this.parentNode.appendChild(this)}).on(`mouseout.tooltip`,function(e){e.ext&&e.ext.tooltip&&n.tooltip.hide.apply(this,arguments)}).on(`mousemove.tooltip`,function(e){e.ext&&e.ext.tooltip&&n.tooltip.show.apply(this,arguments)}).each(function(e){let n=(0,t.select)(this);n.append(`path`).attr(`class`,`data`),n.append(`text`).attr(`text-anchor`,`middle`)}).merge(this.pinsPaths);s.selectAll(`text`).style(`stroke`,this.fontColor()).style(`fill`,this.fontColor()).style(`font-size`,this.fontSize()).style(`font-family`,this.fontFamily()).style(`dominant-baseline`,this.textBaseline()).attr(`dx`,0).attr(`dy`,this.pinTextDY()).text(function(e){return e.ext&&e.ext.text?e.ext.text:``});let c=this.svgPinPath();s.selectAll(`path.data`).attr(`d`,c).attr(`stroke-width`,this.strokeWidth()+`px`).style(`display`,function(t){return e.project(t.lat,t.long)?null:`none`}).style(`stroke`,function(e){return e.ext&&e.ext.strokeColor?e.ext.strokeColor:n.strokeColor()}).style(`fill`,function(e){return e.ext&&e.ext.fillColor?e.ext.fillColor:n.fillColor()}),this.pinsPaths.exit().remove()}layerZoomed(e){Layer.prototype.layerZoomed.apply(this,arguments),this.pinsPaths.attr(`transform`,function(t){let n=e.project(t.lat,t.long);return n||=[0,0],`translate(`+n[0]+`, `+n[1]+`)scale(`+1/e.zoomScale()+`)`})}pinTextDY(){switch(this.pinType()){case`pin`:case`rectangle-pin`:return-this.arrowHeight();case`circle`:case`rectangle`:return 0}}svgPinPath(){switch(this.pinType()){case`pin`:return this.circlePinPath();case`circle`:return this.circlePath();case`rectangle`:return this.rectanglePath();case`rectangle-pin`:return this.rectanglePinPath()}}rectanglePinPath(){let e=this.pinWidth(),t=this.pinHeight(),n=this.cornerRadius(),s=this.arrowHeight(),c=this.arrowWidth(),l=0-e/2,d=0-t+n,f=(e-n*2-c)/2;return`M`+l+`,`+d+`a`+-n+`,`+-n+` 0 0 1 `+n+`,`+-n+`h`+(e+-n*2)+`a`+n+`,`+n+` 0 0 1 `+n+`,`+n+`v`+(t+-n*2)+`a`+n+`,`+n+` 0 0 1 `+-n+`,`+n+`h`+-f+`l`+-c/2+`,`+s+`l`+-c/2+`,`+-s+`h`+-f+`a`+-n+`,`+-n+` 0 0 1 `+-n+`,`+-n+`z`}rectanglePath(){let e=this.pinWidth(),t=this.pinHeight(),n=this.cornerRadius(),s=-e/2,c=-t/2;return c+=n,`M`+s+`,`+c+`a`+-n+`,`+-n+` 0 0 1 `+n+`,`+-n+`h`+(e+-n*2)+`a`+n+`,`+n+` 0 0 1 `+n+`,`+n+`v`+(t+-n*2)+`a`+n+`,`+n+` 0 0 1 `+-n+`,`+n+`h`+(-e+n*2)+`a`+-n+`,`+-n+` 0 0 1 `+-n+`,`+-n+`z`}circlePinPath(){let e=this.arrowHeight(),t=this.arrowWidth(),n=0-t/2,s=0-e,c=t/2,l=e,d=-c,f=-l,p=t+c,m=f,h=t;return`M`+n+`,`+s+`c`+d+` `+f+`, `+p+` `+m+`, `+h+` 0l`+-t/2+`,`+e+`l`+-t/2+`,`+-e+`z`}circlePath(){let e=+this.pinRadius();return`M 0, 0 m ${-e}, 0 a ${e},${e} 0 1,0 ${e*2},0 a ${e},${e} 0 1,0 ${-e*2},0`}click(e,t,n){}dblclick(e,t,n){}};Pins.prototype._class+=` map_Pins`,Pins.prototype.mixin(t.Utility.SimpleSelectionMixin),Pins.prototype.publish(`geohashColumn`,null,`set`,`Geohash column`,function(){return this.columns()},{optional:!0}),Pins.prototype.publish(`tooltipColumn`,null,`set`,`Tooltip column`,function(){return this.columns()},{optional:!0}),Pins.prototype.publish(`latColumn`,null,`set`,`Latitude column`,function(){return this.columns()},{optional:!0}),Pins.prototype.publish(`longColumn`,null,`set`,`Longitude column`,function(){return this.columns()},{optional:!0}),Pins.prototype.publish(`opacity`,1,`number`,`Opacity`,null,{tags:[`Advanced`]}),Pins.prototype.publish(`fillColor`,`#00FFDD`,`html-color`,`Pin Color`,null,{optional:!0}),Pins.prototype.publish(`omitNullLatLong`,!1,`boolean`,`Remove lat=0,lng=0 from pinsData`,null,{tags:[`Basic`]}),Pins.prototype.publish(`strokeWidth`,.5,`number`,`Pin Border Thickness (pixels)`,null,{tags:[`Basic`]}),Pins.prototype.publish(`strokeColor`,``,`html-color`,`Pin Border Color`,null,{optional:!0}),Pins.prototype.publish(`fontSize`,18,`number`,`Font Size`,null,{tags:[`Basic`,`Shared`]}),Pins.prototype.publish(`fontFamily`,`Verdana`,`string`,`Font Name`,null,{tags:[`Basic`,`Shared`,`Shared`]}),Pins.prototype.publish(`fontColor`,`#000000`,`html-color`,`Font Color`,null,{tags:[`Basic`,`Shared`]}),Pins.prototype.publish(`pinType`,`pin`,`set`,`Pin Type`,[`pin`,`circle`,`rectangle`,`rectangle-pin`],{tags:[`Basic`]}),Pins.prototype.publish(`arrowWidth`,8,`number`,`Pin arrow width (pixels)`,null,{tags:[`Basic`],disable:e=>[`pin`,`rectangle-pin`].indexOf(e.pinType())===-1}),Pins.prototype.publish(`arrowHeight`,12,`number`,`Pin arrow height (pixels)`,null,{tags:[`Basic`],disable:e=>[`pin`,`rectangle-pin`].indexOf(e.pinType())===-1}),Pins.prototype.publish(`pinWidth`,20,`number`,`Width of pin (pixels)`,null,{tags:[`Basic`],disable:e=>[`rectangle`,`rectangle-pin`].indexOf(e.pinType())===-1}),Pins.prototype.publish(`pinHeight`,20,`number`,`Height of pin (pixels) (not including arrow)`,null,{tags:[`Basic`],disable:e=>[`rectangle`,`rectangle-pin`].indexOf(e.pinType())===-1}),Pins.prototype.publish(`cornerRadius`,10,`number`,`Radius of rectangular pin corners (pixels)`,null,{tags:[`Basic`],disable:e=>[`rectangle`,`rectangle-pin`].indexOf(e.pinType())===-1}),Pins.prototype.publish(`pinRadius`,12,`number`,`Radius of circle (pixels)`,null,{tags:[`Basic`],disable:e=>e.pinType()!==`circle`}),Pins.prototype.publish(`textBaseline`,`central`,`set`,`Pin text vertical alignment`,[`auto`,`use-script`,`no-change`,`reset-size`,`ideographic`,`alphabetic`,`hanging`,`mathematical`,`central`,`middle`,`text-after-edge`,`text-before-edge`,`inherit`],{tags:[`Basic`]});var GMapPin=class extends GMapLayered{_pins;_view;constructor(){super();let e=this;this._pins=new Pins().columns([`lat`,`long`,`ext`]).on(`click`,function(t,n,s){e.click(e.rowToObj(t.ext.origRow),``,s),e.clickStreetView(e.rowToObj(t.ext.origRow),``,s)}).on(`dblclick`,function(t,n,s){e.dblclick(e.rowToObj(t.ext.origRow),``,s)})}pinsData(){if(this.data().length===0)return[];let e=this.columns();return this._view=this._db.rollupView([this.latitudeColumn(),this.longitudeColumn()]),this._view.entries().map(function(t){let n=t.values[0].value[0];return[t.key,t.values[0].key,{fillColor:n[e.indexOf(this.colorColumn())],tooltip:n[e.indexOf(this.tooltipColumn())],origRow:n}]},this)}enter(e,t){super.enter(e,t),this.layers([this._pins])}_prevChecksum;update(e,t){super.update(e,t),this._pins.data(this.pinsData()),this.autoScale()&&this._prevChecksum!==this._db.checksum()&&(this._prevChecksum=this._db.checksum(),this.zoomTo(this._pins.pinsData().map(function(e){return[e.lat,e.long]})))}exit(e,t){super.exit(e,t)}click(e,t,n){}clickStreetView(e,t,n){this.streetViewOnClick()&&this.streetViewAt({lat:+e[this.latitudeColumn()],lng:+e[this.longitudeColumn()]})}dblclick(e,t,n){}};GMapPin.prototype._class+=` map_GMapPin`,GMapPin.prototype.publish(`autoScale`,!1,`boolean`,`Auto scale to data`),GMapPin.prototype.publishProxy(`pinColor`,`_pins`,`fillColor`),GMapPin.prototype.publishProxy(`pinType`,`_pins`,`pinType`),GMapPin.prototype.publishProxy(`pinWidth`,`_pins`,`pinWidth`),GMapPin.prototype.publishProxy(`pinHeight`,`_pins`,`pinHeight`),GMapPin.prototype.publishProxy(`cornerRadius`,`_pins`,`cornerRadius`),GMapPin.prototype.publishProxy(`pinRadius`,`_pins`,`pinRadius`),GMapPin.prototype.publishProxy(`arrowWidth`,`_pins`,`arrowWidth`),GMapPin.prototype.publishProxy(`arrowHeight`,`_pins`,`arrowHeight`),GMapPin.prototype.publishProxy(`textBaseline`,`_pins`,`textBaseline`),GMapPin.prototype.publishProxy(`strokeWidth`,`_pins`,`strokeWidth`),GMapPin.prototype.publishProxy(`omitNullLatLong`,`_pins`,`omitNullLatLong`),GMapPin.prototype.publish(`latitudeColumn`,null,`set`,`Latitude`,function(){return this.columns()},{optional:!0}),GMapPin.prototype.publish(`longitudeColumn`,null,`set`,`Longitude`,function(){return this.columns()},{optional:!0}),GMapPin.prototype.publish(`colorColumn`,null,`set`,`Color`,function(){return this.columns()},{optional:!0}),GMapPin.prototype.publish(`tooltipColumn`,null,`set`,`Tooltip`,function(){return this.columns()},{optional:!0}),GMapPin.prototype.publish(`streetViewOnClick`,!1,`boolean`,`Switch to street view when pin clicked`);var Lines=class extends Layer{dataEdges;_edgesTransform;constructor(){super()}data(e){let t=Layer.prototype.data.apply(this,arguments);return arguments.length&&(this.dataEdges=[],e.forEach(function(e){this.dataEdges.push({type:`LineString`,coordinates:[[e[1],e[0]],[e[3],e[2]]]})},this)),t}layerEnter(e,t,n){Layer.prototype.layerEnter.apply(this,arguments),t.append(`defs`).append(`marker`).attr(`class`,`marker`).attr(`id`,this._id+`_arrowHead`).attr(`viewBox`,`0 0 10 10`).attr(`refX`,10).attr(`refY`,5).attr(`markerWidth`,16).attr(`markerHeight`,16).attr(`markerUnits`,`strokeWidth`).attr(`orient`,`auto`).append(`polyline`).attr(`points`,`0,0 10,5 0,10 1,5`),this._edgesTransform=t.append(`g`)}_edgesPaths;layerUpdate(e){Layer.prototype.layerUpdate.apply(this,arguments),this._edgesTransform.style(`opacity`,this.opacity());let t=this._edgesTransform.selectAll(`.dataEdge`).data(this.visible()?this.dataEdges:[]);this._edgesPaths=t.enter().append(`path`).attr(`class`,`dataEdge`).attr(`marker-end`,`url(#`+this._id+`_arrowHead)`).merge(t).attr(`d`,e._d3GeoPath),t.exit().remove()}layerZoomed(e){Layer.prototype.layerZoomed.apply(this,arguments),this._edgesPaths.attr(`stroke-width`,`${.5/e.zoomScale()}px`)}};Lines.prototype._class+=` map_Lines`,Lines.prototype.publish(`opacity`,1,`number`,`Opacity`,null,{tags:[`Advanced`]});var GMapPinLine=class extends GMapLayered{_lines;_pins;_fromView;_toView;_linesView;constructor(){super();let e=this;this._lines=new Lines,this._pins=new Pins().columns([`lat`,`long`,`ext`]).on(`click`,function(t,n,s){e.click(e.rowToObj(t.ext.origRow),``,s)}).on(`dblclick`,function(t,n,s){e.click(e.rowToObj(t.ext.origRow),``,s)})}pinsData(){if(this.data().length===0)return[];let e=this.columns();this._fromView=this._db.rollupView([this.fromLatitudeColumn(),this.fromLongitudeColumn()]),this._toView=this._db.rollupView([this.toLatitudeColumn(),this.toLongitudeColumn()]);let t=this._fromView.entries().map(function(t){let n=t.values[0].value[0];return[t.key,t.values[0].key,{fillColor:n[e.indexOf(this.fromColorColumn())]||this.fromPinColor(),tooltip:n[e.indexOf(this.fromTooltipColumn())],origRow:n}]},this),n=this._toView.entries().map(function(t){let n=t.values[0].value[0];return[t.key,t.values[0].key,{fillColor:n[e.indexOf(this.toColorColumn())]||this.toPinColor(),tooltip:n[e.indexOf(this.toTooltipColumn())],origRow:n}]},this);return t.concat(n)}linesData(){return this.data().length===0?[]:(this._linesView=this._db.rollupView([this.fromLatitudeColumn(),this.fromLongitudeColumn(),this.toLatitudeColumn(),this.toLongitudeColumn()]),this._linesView.data())}enter(e,t){super.enter(e,t),this.layers([this._lines,this._pins])}_prevChecksum;update(e,t){super.update(e,t),this._pins.data(this.pinsData()),this._lines.data(this.linesData()),this.autoScale()&&this._prevChecksum!==this._db.checksum()&&(this._prevChecksum=this._db.checksum(),this.zoomTo(this._pins.pinsData().map(function(e){return[e.lat,e.long]})))}exit(e,t){super.exit(e,t)}click(e,t,n){}dblclick(e,t,n){}};GMapPinLine.prototype._class+=` map_GMapPinLine`,GMapPinLine.prototype.publish(`autoScale`,!1,`boolean`,`Auto scale to data`),GMapPinLine.prototype.publish(`fromPinColor`,`green`,`html-color`,`From Pin Color`),GMapPinLine.prototype.publish(`fromLatitudeColumn`,null,`set`,`From Latitude`,function(){return this.columns()},{optional:!0}),GMapPinLine.prototype.publish(`fromLongitudeColumn`,null,`set`,`From Longitude`,function(){return this.columns()},{optional:!0}),GMapPinLine.prototype.publish(`fromColorColumn`,null,`set`,`From Color`,function(){return this.columns()},{optional:!0}),GMapPinLine.prototype.publish(`fromTooltipColumn`,null,`set`,`From Tooltip`,function(){return this.columns()},{optional:!0}),GMapPinLine.prototype.publish(`toPinColor`,`red`,`html-color`,`To Pin Color`),GMapPinLine.prototype.publish(`toLatitudeColumn`,null,`set`,`To Latitude`,function(){return this.columns()},{optional:!0}),GMapPinLine.prototype.publish(`toLongitudeColumn`,null,`set`,`To Longitude`,function(){return this.columns()},{optional:!0}),GMapPinLine.prototype.publish(`toColorColumn`,null,`set`,`To Color`,function(){return this.columns()},{optional:!0}),GMapPinLine.prototype.publish(`toTooltipColumn`,null,`set`,`To Tooltip`,function(){return this.columns()},{optional:!0});var Graph=class extends Pins{dataEdges=[];_edgesTransform;constructor(){super()}importJSON(e){let t=Pins.prototype.importJSON.apply(this,arguments);if(arguments.length){this.dataEdges=[];let t=null;e.forEach(function(e){t&&this.dataEdges.push({type:`LineString`,coordinates:[[t.long,t.lat],[e.long,e.lat]]}),t=e.eol?null:e},this)}return t}data(e){let t=Pins.prototype.data.apply(this,arguments);if(arguments.length){this.dataEdges=[];let t=null;e.forEach(function(e){t&&this.dataEdges.push({type:`LineString`,coordinates:[[t[1],t[0]],[e[1],e[0]]]}),t=e},this)}return t}layerEnter(e,t,n){Pins.prototype.layerEnter.apply(this,arguments),t.append(`defs`).append(`marker`).attr(`class`,`marker`).attr(`id`,this._id+`_arrowHead`).attr(`viewBox`,`0 0 10 10`).attr(`refX`,10).attr(`refY`,5).attr(`markerWidth`,16).attr(`markerHeight`,16).attr(`markerUnits`,`strokeWidth`).attr(`orient`,`auto`).append(`polyline`).attr(`points`,`0,0 10,5 0,10 1,5`),this._edgesTransform=t.append(`g`)}_edgesPaths;layerUpdate(e){Pins.prototype.layerUpdate.apply(this,arguments),this._edgesTransform.style(`opacity`,this.opacity());let t=this._edgesTransform.selectAll(`.dataEdge`).data(this.visible()?this.dataEdges:[]);this._edgesPaths=t.enter().append(`path`).attr(`class`,`dataEdge`).attr(`marker-end`,`url(#`+this._id+`_arrowHead)`).merge(t).attr(`d`,e._d3GeoPath),t.exit().remove()}layerZoomed(e){Pins.prototype.layerZoomed.apply(this,arguments),this._edgesPaths.attr(`stroke-width`,`${.5/e.zoomScale()}px`)}};Graph.prototype._class+=` map_Graph`;var Graticule=class extends Layer{_dataMap={};_path=(0,t.select)(null);_graticule;_graticulePath;_graticuleOutlinePath;_prevProjection;constructor(){super()}layerEnter(e,t,n){Layer.prototype.layerEnter.apply(this,arguments),this._graticule=graticule(),this._graticulePath=t.append(`path`).datum(this._graticule).attr(`class`,`graticule`).attr(`vector-effect`,`non-scaling-stroke`),this._graticuleOutlinePath=t.append(`path`).datum(this._graticule.outline).attr(`class`,`graticuleOutline`).attr(`vector-effect`,`non-scaling-stroke`)}layerUpdate(e){if(!this.visible()){this._graticulePath.attr(`d`,``),this._graticuleOutlinePath.attr(`d`,``),delete this._prevProjection;return}this._prevProjection!==e.projection()&&(this._graticulePath.attr(`d`,e._d3GeoPath),this._graticuleOutlinePath.attr(`d`,e._d3GeoPath),this._prevProjection=e.projection()),this._graticulePath.style(`stroke`,this.meshColor()),this._graticuleOutlinePath.style(`stroke`,this.meshColor())}layerExit(e){delete this._prevProjection}};Graticule.prototype._class+=` map_Graticule`,Graticule.prototype.publish(`opacity`,1,`number`,`Opacity`,null,{tags:[`Advanced`]}),Graticule.prototype.publish(`meshColor`,null,`html-color`,`Stroke Color`,null,{optional:!0}),Graticule.prototype.publish(`meshStrokeWidth`,.25,`number`,`Stroke Width`);var Heat=class extends Layer{_heatTransform;heat;_prevProjection;constructor(){super()}layerEnter(e,t,n){Layer.prototype.layerEnter.apply(this,arguments),this._parentOverlay.style(`pointer-events`,`none`),this._heatTransform=n.style(`pointer-events`,`none`).append(`div`).attr(`class`,this.classID()).style(`width`,e.width()+`px`).style(`height`,e.height()+`px`),this.heat=new d.HeatMap().target(this._heatTransform.node())}layerUpdate(e){Layer.prototype.layerUpdate.apply(this,arguments),this._heatTransform.style(`opacity`,this.opacity()).style(`width`,e.width()+`px`).style(`height`,e.height()+`px`),this.heat.resize(e.size()),this.layerZoomed(e)}layerExit(e){delete this._prevProjection,this.heat.target(null),delete this.heat}layerZoomed(e){Layer.prototype.layerZoomed.apply(this,arguments);let t=this._db.fieldByLabel(this.latColumn()),n=this._db.fieldByLabel(this.longColumn());this.heat.columns(this.columns()).data(this.visible()?this.data().map(function(s){let c=t?s[t.idx]:s[0],l=n?s[n.idx]:s[1],d=e.zoomTranslate(),f=e.project(c,l),p=e.zoomScale();return f[0]*=p,f[1]*=p,[d[0]+f[0],d[1]+f[1],s[4]||.5]}):[]).render()}};Heat.prototype._class+=` map_Heat`,Heat.prototype.publish(`latColumn`,null,`set`,`Latitude column`,function(){return this.columns()},{optional:!0}),Heat.prototype.publish(`longColumn`,null,`set`,`Longitude column`,function(){return this.columns()},{optional:!0}),Heat.prototype.publish(`opacity`,1,`number`,`Opacity`,null,{tags:[`Advanced`]});function IChoropleth(){}IChoropleth.prototype._palette=t.Palette.rainbow(`default`),IChoropleth.prototype.click=function(e,t,n){};function defaultScale(e){return e.k}function defaultTranslate(e){return[e.x,e.y]}function constant(e){return function(){return e}}function tile_default(){let e=0,t=0,n=960,s=500,c=!0,l=!0,d=256,f=defaultScale,p=defaultTranslate,m=0;function tile(){let h=+f.apply(this,arguments),g=p.apply(this,arguments),_=Math.log2(h/d),v=Math.round(Math.max(_+m,0)),y=2**(_-v)*d,b=g[0]-h/2,x=g[1]-h/2,S=Math.max(c?0:-1/0,Math.floor((e-b)/y)),C=Math.min(c?1<<v:1/0,Math.ceil((n-b)/y)),T=Math.max(l?0:-1/0,Math.floor((t-x)/y)),E=Math.min(l?1<<v:1/0,Math.ceil((s-x)/y)),D=[];for(let e=T;e<E;++e)for(let t=S;t<C;++t)D.push([t,e,v]);return D.translate=[b/y,x/y],D.scale=y,D}return tile.size=function(c){return arguments.length?(e=t=0,n=+c[0],s=+c[1],tile):[n-e,s-t]},tile.extent=function(c){return arguments.length?(e=+c[0][0],t=+c[0][1],n=+c[1][0],s=+c[1][1],tile):[[e,t],[n,s]]},tile.scale=function(e){return arguments.length?(f=typeof e==`function`?e:constant(+e),tile):f},tile.translate=function(e){return arguments.length?(p=typeof e==`function`?e:constant([+e[0],+e[1]]),tile):p},tile.zoomDelta=function(e){return arguments.length?(m=+e,tile):m},tile.tileSize=function(e){return arguments.length?(d=+e,tile):d},tile.clamp=function(e){return arguments.length?(c=l=!!e,tile):c&&l},tile.clampX=function(e){return arguments.length?(c=!!e,tile):c},tile.clampY=function(e){return arguments.length?(l=!!e,tile):l},tile}__name(tile_default,`default`);var pn=4096,mn=class OpenStreet extends Layer{static _copyrightText=`© OpenStreetMap contributors`;_tile;_openStreet;_copyright;_copyrightBBox;_prevTileProvider;_zoomLayerID=0;_prevZoomLevel;constructor(){super(),this.autoScaleMode(`none`)}layerEnter(e,t,n){Layer.prototype.layerEnter.apply(this,arguments),e.zoomExtent([.1,pn*4]),this._openStreet=t.append(`g`),this._copyright=t.append(`text`).attr(`x`,-100).attr(`y`,-100).style(`opacity`,.5).text(OpenStreet._copyrightText),this._copyrightBBox=this._copyright.node().getBBox()}layerUpdate(e){this._tile=tile_default().size([e.width(),e.height()]).wrap(!1),this.visible()?this._copyright.attr(`x`,e.width()-this._copyrightBBox.width-this._copyrightBBox.height/2).attr(`y`,e.height()-this._copyrightBBox.height/2).text(OpenStreet._copyrightText):this._copyright.text(``),this.layerZoomed(e)}layerZoomed(e){let n=e.zoomScale(),s=e.zoomTranslate(),c=this._tile.scale(n*pn).translate(s)(),l=c.scale/n,d=[c.translate[0]/c.scale,c.translate[1]/c.scale],f=Math.round(l*1e3);this._prevZoomLevel!==f&&(this._prevZoomLevel=f,this._zoomLayerID++);let p=this._openStreet.selectAll(`.scaleG`).data([this._zoomLayerID],e=>e),m=p.enter().append(`g`).attr(`class`,`scaleG`).attr(`transform`,stringify(l,d)).merge(p);p.exit().style(`opacity`,1).transition().duration(1e3).style(`opacity`,0).on(`end`,function(e){(0,t.select)(this).selectAll(`.image`).attr(`xlink:href`,null)}).remove(),m.selectAll(`.image`).data(c,function(e){return``+e.x+`,`+e.y}).enter().append(`image`).attr(`class`,`image`).style(`opacity`,0).attr(`x`,function(e){return e.tx}).attr(`y`,function(e){return e.ty}).attr(`width`,256).attr(`height`,256).attr(`xlink:href`,function(e){return`http://`+`abc`[e.y%3]+`.tile.openstreetmap.org/`+e.z+`/`+e.x+`/`+e.y+`.png`}).transition().duration(500).style(`opacity`,1)}};mn.prototype._class+=` map_OpenStreet`,mn.prototype.publish(`tileProvider`,`OpenStreetMap`,`set`,`Tile Provider`,[`OpenStreetMap`,`OpenStreetMap Hot`,`MapQuest`,`MapQuest Sat`,`Stamen Watercolor`,`OpenCycleMap`],{tags:[`Basic`,`Shared`]});function stringify(e,t){return`translate(-2048,-2048) scale(`+e/256+`)`}var TopoJSONChoropleth=class extends Choropleth{_prevRegion;choroPaths;_choroTopologyIndex;_choroTopologyFeatures;constructor(){super(),this.projection(`Mercator`)}layerEnter(e,n,s){Choropleth.prototype.layerEnter.apply(this,arguments),this._selection.widgetElement(this._choroplethData),this.choroPaths=(0,t.select)(null);let c=this;this.tooltipHTML(function(e){let t=c.columns(),n=t&&t.length?t[0]:`Location`,s=e&&e.length?e[e.length-1]:[``];return c.tooltipFormat({label:s[0],series:n,value:e[1]})})}layerUpdate(e){Choropleth.prototype.layerUpdate.apply(this,arguments);let t=[],n=this;this.data().forEach(function(e){if(isNaN(e[0]))for(let s in n._choroTopologyIndex)for(let c in n._choroTopologyIndex[s])c===e[0]&&n._choroTopologyIndex[s][c].forEach(function(n){t.push([n].concat(e.filter(function(e,t){return t>0}),[e]))});else t.push(e.concat([e]))}),this.choroPaths=this._choroplethData.selectAll(`.data`).data(this.visible()?t:[],function(e){return e[0]}),this.choroPaths.enter().append(`path`).attr(`class`,`data`).call(this._selection.enter.bind(this._selection)).on(`click`,function(e){n._dataMap[e[0]]&&n.click(n.rowToObj(n._dataMap[e[0]]),`weight`,n._selection.selected(n))}).on(`dblclick`,function(e){n._dataMap[e[0]]&&n.dblclick(n.rowToObj(n._dataMap[e[0]]),`weight`,n._selection.selected(n))}).on(`mouseout.tooltip`,this.tooltip.hide).on(`mousemove.tooltip`,this.tooltip.show),this.choroPaths.attr(`d`,function(t){let s=e._d3GeoPath(n._choroTopologyFeatures[t[0]]);return s||console.warn(`Unknown Country: `+t),s}).style(`fill`,function(e){return n._palette(e[1],n._dataMinWeight,n._dataMaxWeight)}),this.choroPaths.exit().remove()}layerPreRender(){if(this._prevRegion!==this.region()&&(this._prevRegion=this.region(),delete this._topoJsonPromise),!this._topoJsonPromise){let e=this;this._topoJsonPromise=new Promise(function(t,n){Zt(`${topoJsonFolder()}/${e.region()}.json`,function(n){e._choroTopology=n,e._choroTopologyObjects=n.objects.PolbndA,e._choroTopologyFeatures=feature_default(e._choroTopology,e._choroTopologyObjects).features,Zt(`${topoJsonFolder()}/${e.region()}_idx.json`,indexLoad).on(`error`,function(e){indexLoad({})});function indexLoad(n){e._choroTopologyIndex=n,t()}})})}return this._topoJsonPromise}};TopoJSONChoropleth.prototype._class+=` map_TopoJSONChoropleth`,TopoJSONChoropleth.prototype.publish(`region`,`GB`,`set`,`Region Data`,`AT.BE.BG.BR.CHLI.CY.CZ.DE.DK.EE.ES.FI.FR.GB.GE.GR.HR.HU.IE.IS.IT.KS.LT.LU.LV.MD.MK.MT.ND.NL.NO.PL.PT.RO.RS.SE.SI.SK.UA`.split(`.`));var Z=__toESM(__commonJSMin(((e,t)=>{(function(n,s){typeof e==`object`&&t!==void 0?s(e):typeof define==`function`&&define.amd?define([`exports`],s):(n=typeof globalThis<`u`?globalThis:n||self,s(n.leaflet={}))})(e,(function(e){"use strict";var t=`1.9.4`;function extend(e){var t,n,s,c;for(n=1,s=arguments.length;n<s;n++)for(t in c=arguments[n],c)e[t]=c[t];return e}var n=Object.create||(function(){function F(){}return function(e){return F.prototype=e,new F}})();function bind(e,t){var n=Array.prototype.slice;if(e.bind)return e.bind.apply(e,n.call(arguments,1));var s=n.call(arguments,2);return function(){return e.apply(t,s.length?s.concat(n.call(arguments)):arguments)}}var s=0;function stamp(e){return`_leaflet_id`in e||(e._leaflet_id=++s),e._leaflet_id}function throttle(e,t,n){var s,c,wrapperFn,later=function(){s=!1,c&&=(wrapperFn.apply(n,c),!1)};return wrapperFn=function(){s?c=arguments:(e.apply(n,arguments),setTimeout(later,t),s=!0)},wrapperFn}function wrapNum(e,t,n){var s=t[1],c=t[0],l=s-c;return e===s&&n?e:((e-c)%l+l)%l+c}function falseFn(){return!1}function formatNum(e,t){if(t===!1)return e;var n=10**(t===void 0?6:t);return Math.round(e*n)/n}function trim(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,``)}function splitWords(e){return trim(e).split(/\s+/)}function setOptions(e,t){for(var s in Object.prototype.hasOwnProperty.call(e,`options`)||(e.options=e.options?n(e.options):{}),t)e.options[s]=t[s];return e.options}function getParamString(e,t,n){var s=[];for(var c in e)s.push(encodeURIComponent(n?c.toUpperCase():c)+`=`+encodeURIComponent(e[c]));return(!t||t.indexOf(`?`)===-1?`?`:`&`)+s.join(`&`)}var c=/\{ *([\w_ -]+) *\}/g;function template(e,t){return e.replace(c,function(e,n){var s=t[n];if(s===void 0)throw Error(`No value provided for variable `+e);return typeof s==`function`&&(s=s(t)),s})}var l=Array.isArray||function(e){return Object.prototype.toString.call(e)===`[object Array]`};function indexOf(e,t){for(var n=0;n<e.length;n++)if(e[n]===t)return n;return-1}var d=`data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=`;function getPrefixed(e){return window[`webkit`+e]||window[`moz`+e]||window[`ms`+e]}var f=0;function timeoutDefer(e){var t=+new Date,n=Math.max(0,16-(t-f));return f=t+n,window.setTimeout(e,n)}var p=window.requestAnimationFrame||getPrefixed(`RequestAnimationFrame`)||timeoutDefer,m=window.cancelAnimationFrame||getPrefixed(`CancelAnimationFrame`)||getPrefixed(`CancelRequestAnimationFrame`)||function(e){window.clearTimeout(e)};function requestAnimFrame(e,t,n){if(n&&p===timeoutDefer)e.call(t);else return p.call(window,bind(e,t))}function cancelAnimFrame(e){e&&m.call(window,e)}var h={__proto__:null,extend,create:n,bind,get lastId(){return s},stamp,throttle,wrapNum,falseFn,formatNum,trim,splitWords,setOptions,getParamString,template,isArray:l,indexOf,emptyImageUrl:d,requestFn:p,cancelFn:m,requestAnimFrame,cancelAnimFrame};function Class(){}Class.extend=function(e){var NewClass=function(){setOptions(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},t=NewClass.__super__=this.prototype,s=n(t);for(var c in s.constructor=NewClass,NewClass.prototype=s,this)Object.prototype.hasOwnProperty.call(this,c)&&c!==`prototype`&&c!==`__super__`&&(NewClass[c]=this[c]);return e.statics&&extend(NewClass,e.statics),e.includes&&(checkDeprecatedMixinEvents(e.includes),extend.apply(null,[s].concat(e.includes))),extend(s,e),delete s.statics,delete s.includes,s.options&&(s.options=t.options?n(t.options):{},extend(s.options,e.options)),s._initHooks=[],s.callInitHooks=function(){if(!this._initHooksCalled){t.callInitHooks&&t.callInitHooks.call(this),this._initHooksCalled=!0;for(var e=0,n=s._initHooks.length;e<n;e++)s._initHooks[e].call(this)}},NewClass},Class.include=function(e){var t=this.prototype.options;return extend(this.prototype,e),e.options&&(this.prototype.options=t,this.mergeOptions(e.options)),this},Class.mergeOptions=function(e){return extend(this.prototype.options,e),this},Class.addInitHook=function(e){var t=Array.prototype.slice.call(arguments,1),n=typeof e==`function`?e:function(){this[e].apply(this,t)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(n),this};function checkDeprecatedMixinEvents(e){if(!(typeof L>`u`||!L||!L.Mixin)){e=l(e)?e:[e];for(var t=0;t<e.length;t++)e[t]===L.Mixin.Events&&console.warn(`Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.`,Error().stack)}}var g={on:function(e,t,n){if(typeof e==`object`)for(var s in e)this._on(s,e[s],t);else{e=splitWords(e);for(var c=0,l=e.length;c<l;c++)this._on(e[c],t,n)}return this},off:function(e,t,n){if(!arguments.length)delete this._events;else if(typeof e==`object`)for(var s in e)this._off(s,e[s],t);else{e=splitWords(e);for(var c=arguments.length===1,l=0,d=e.length;l<d;l++)c?this._off(e[l]):this._off(e[l],t,n)}return this},_on:function(e,t,n,s){if(typeof t!=`function`){console.warn(`wrong listener type: `+typeof t);return}if(this._listens(e,t,n)===!1){n===this&&(n=void 0);var c={fn:t,ctx:n};s&&(c.once=!0),this._events=this._events||{},this._events[e]=this._events[e]||[],this._events[e].push(c)}},_off:function(e,t,n){var s,c,l;if(this._events&&(s=this._events[e],s)){if(arguments.length===1){if(this._firingCount)for(c=0,l=s.length;c<l;c++)s[c].fn=falseFn;delete this._events[e];return}if(typeof t!=`function`){console.warn(`wrong listener type: `+typeof t);return}var d=this._listens(e,t,n);if(d!==!1){var f=s[d];this._firingCount&&(f.fn=falseFn,this._events[e]=s=s.slice()),s.splice(d,1)}}},fire:function(e,t,n){if(!this.listens(e,n))return this;var s=extend({},t,{type:e,target:this,sourceTarget:t&&t.sourceTarget||this});if(this._events){var c=this._events[e];if(c){this._firingCount=this._firingCount+1||1;for(var l=0,d=c.length;l<d;l++){var f=c[l],p=f.fn;f.once&&this.off(e,p,f.ctx),p.call(f.ctx||this,s)}this._firingCount--}}return n&&this._propagateEvent(s),this},listens:function(e,t,n,s){typeof e!=`string`&&console.warn(`"string" type argument expected`);var c=t;typeof t!=`function`&&(s=!!t,c=void 0,n=void 0);var l=this._events&&this._events[e];if(l&&l.length&&this._listens(e,c,n)!==!1)return!0;if(s){for(var d in this._eventParents)if(this._eventParents[d].listens(e,t,n,s))return!0}return!1},_listens:function(e,t,n){if(!this._events)return!1;var s=this._events[e]||[];if(!t)return!!s.length;n===this&&(n=void 0);for(var c=0,l=s.length;c<l;c++)if(s[c].fn===t&&s[c].ctx===n)return c;return!1},once:function(e,t,n){if(typeof e==`object`)for(var s in e)this._on(s,e[s],t,!0);else{e=splitWords(e);for(var c=0,l=e.length;c<l;c++)this._on(e[c],t,n,!0)}return this},addEventParent:function(e){return this._eventParents=this._eventParents||{},this._eventParents[stamp(e)]=e,this},removeEventParent:function(e){return this._eventParents&&delete this._eventParents[stamp(e)],this},_propagateEvent:function(e){for(var t in this._eventParents)this._eventParents[t].fire(e.type,extend({layer:e.target,propagatedFrom:e.target},e),!0)}};g.addEventListener=g.on,g.removeEventListener=g.clearAllEventListeners=g.off,g.addOneTimeEventListener=g.once,g.fireEvent=g.fire,g.hasEventListeners=g.listens;var _=Class.extend(g);function Point(e,t,n){this.x=n?Math.round(e):e,this.y=n?Math.round(t):t}var v=Math.trunc||function(e){return e>0?Math.floor(e):Math.ceil(e)};Point.prototype={clone:function(){return new Point(this.x,this.y)},add:function(e){return this.clone()._add(toPoint(e))},_add:function(e){return this.x+=e.x,this.y+=e.y,this},subtract:function(e){return this.clone()._subtract(toPoint(e))},_subtract:function(e){return this.x-=e.x,this.y-=e.y,this},divideBy:function(e){return this.clone()._divideBy(e)},_divideBy:function(e){return this.x/=e,this.y/=e,this},multiplyBy:function(e){return this.clone()._multiplyBy(e)},_multiplyBy:function(e){return this.x*=e,this.y*=e,this},scaleBy:function(e){return new Point(this.x*e.x,this.y*e.y)},unscaleBy:function(e){return new Point(this.x/e.x,this.y/e.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=v(this.x),this.y=v(this.y),this},distanceTo:function(e){e=toPoint(e);var t=e.x-this.x,n=e.y-this.y;return Math.sqrt(t*t+n*n)},equals:function(e){return e=toPoint(e),e.x===this.x&&e.y===this.y},contains:function(e){return e=toPoint(e),Math.abs(e.x)<=Math.abs(this.x)&&Math.abs(e.y)<=Math.abs(this.y)},toString:function(){return`Point(`+formatNum(this.x)+`, `+formatNum(this.y)+`)`}};function toPoint(e,t,n){return e instanceof Point?e:l(e)?new Point(e[0],e[1]):e==null?e:typeof e==`object`&&`x`in e&&`y`in e?new Point(e.x,e.y):new Point(e,t,n)}function Bounds(e,t){if(e)for(var n=t?[e,t]:e,s=0,c=n.length;s<c;s++)this.extend(n[s])}Bounds.prototype={extend:function(e){var t,n;if(!e)return this;if(e instanceof Point||typeof e[0]==`number`||`x`in e)t=n=toPoint(e);else if(e=toBounds(e),t=e.min,n=e.max,!t||!n)return this;return!this.min&&!this.max?(this.min=t.clone(),this.max=n.clone()):(this.min.x=Math.min(t.x,this.min.x),this.max.x=Math.max(n.x,this.max.x),this.min.y=Math.min(t.y,this.min.y),this.max.y=Math.max(n.y,this.max.y)),this},getCenter:function(e){return toPoint((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,e)},getBottomLeft:function(){return toPoint(this.min.x,this.max.y)},getTopRight:function(){return toPoint(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(e){var t,n;return e=typeof e[0]==`number`||e instanceof Point?toPoint(e):toBounds(e),e instanceof Bounds?(t=e.min,n=e.max):t=n=e,t.x>=this.min.x&&n.x<=this.max.x&&t.y>=this.min.y&&n.y<=this.max.y},intersects:function(e){e=toBounds(e);var t=this.min,n=this.max,s=e.min,c=e.max,l=c.x>=t.x&&s.x<=n.x,d=c.y>=t.y&&s.y<=n.y;return l&&d},overlaps:function(e){e=toBounds(e);var t=this.min,n=this.max,s=e.min,c=e.max,l=c.x>t.x&&s.x<n.x,d=c.y>t.y&&s.y<n.y;return l&&d},isValid:function(){return!!(this.min&&this.max)},pad:function(e){var t=this.min,n=this.max,s=Math.abs(t.x-n.x)*e,c=Math.abs(t.y-n.y)*e;return toBounds(toPoint(t.x-s,t.y-c),toPoint(n.x+s,n.y+c))},equals:function(e){return e?(e=toBounds(e),this.min.equals(e.getTopLeft())&&this.max.equals(e.getBottomRight())):!1}};function toBounds(e,t){return!e||e instanceof Bounds?e:new Bounds(e,t)}function LatLngBounds(e,t){if(e)for(var n=t?[e,t]:e,s=0,c=n.length;s<c;s++)this.extend(n[s])}LatLngBounds.prototype={extend:function(e){var t=this._southWest,n=this._northEast,s,c;if(e instanceof LatLng)s=e,c=e;else if(e instanceof LatLngBounds){if(s=e._southWest,c=e._northEast,!s||!c)return this}else return e?this.extend(toLatLng(e)||toLatLngBounds(e)):this;return!t&&!n?(this._southWest=new LatLng(s.lat,s.lng),this._northEast=new LatLng(c.lat,c.lng)):(t.lat=Math.min(s.lat,t.lat),t.lng=Math.min(s.lng,t.lng),n.lat=Math.max(c.lat,n.lat),n.lng=Math.max(c.lng,n.lng)),this},pad:function(e){var t=this._southWest,n=this._northEast,s=Math.abs(t.lat-n.lat)*e,c=Math.abs(t.lng-n.lng)*e;return new LatLngBounds(new LatLng(t.lat-s,t.lng-c),new LatLng(n.lat+s,n.lng+c))},getCenter:function(){return new LatLng((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new LatLng(this.getNorth(),this.getWest())},getSouthEast:function(){return new LatLng(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(e){e=typeof e[0]==`number`||e instanceof LatLng||`lat`in e?toLatLng(e):toLatLngBounds(e);var t=this._southWest,n=this._northEast,s,c;return e instanceof LatLngBounds?(s=e.getSouthWest(),c=e.getNorthEast()):s=c=e,s.lat>=t.lat&&c.lat<=n.lat&&s.lng>=t.lng&&c.lng<=n.lng},intersects:function(e){e=toLatLngBounds(e);var t=this._southWest,n=this._northEast,s=e.getSouthWest(),c=e.getNorthEast(),l=c.lat>=t.lat&&s.lat<=n.lat,d=c.lng>=t.lng&&s.lng<=n.lng;return l&&d},overlaps:function(e){e=toLatLngBounds(e);var t=this._southWest,n=this._northEast,s=e.getSouthWest(),c=e.getNorthEast(),l=c.lat>t.lat&&s.lat<n.lat,d=c.lng>t.lng&&s.lng<n.lng;return l&&d},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(`,`)},equals:function(e,t){return e?(e=toLatLngBounds(e),this._southWest.equals(e.getSouthWest(),t)&&this._northEast.equals(e.getNorthEast(),t)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function toLatLngBounds(e,t){return e instanceof LatLngBounds?e:new LatLngBounds(e,t)}function LatLng(e,t,n){if(isNaN(e)||isNaN(t))throw Error(`Invalid LatLng object: (`+e+`, `+t+`)`);this.lat=+e,this.lng=+t,n!==void 0&&(this.alt=+n)}LatLng.prototype={equals:function(e,t){return e?(e=toLatLng(e),Math.max(Math.abs(this.lat-e.lat),Math.abs(this.lng-e.lng))<=(t===void 0?1e-9:t)):!1},toString:function(e){return`LatLng(`+formatNum(this.lat,e)+`, `+formatNum(this.lng,e)+`)`},distanceTo:function(e){return b.distance(this,toLatLng(e))},wrap:function(){return b.wrapLatLng(this)},toBounds:function(e){var t=180*e/40075017,n=t/Math.cos(Math.PI/180*this.lat);return toLatLngBounds([this.lat-t,this.lng-n],[this.lat+t,this.lng+n])},clone:function(){return new LatLng(this.lat,this.lng,this.alt)}};function toLatLng(e,t,n){return e instanceof LatLng?e:l(e)&&typeof e[0]!=`object`?e.length===3?new LatLng(e[0],e[1],e[2]):e.length===2?new LatLng(e[0],e[1]):null:e==null?e:typeof e==`object`&&`lat`in e?new LatLng(e.lat,`lng`in e?e.lng:e.lon,e.alt):t===void 0?null:new LatLng(e,t,n)}var y={latLngToPoint:function(e,t){var n=this.projection.project(e),s=this.scale(t);return this.transformation._transform(n,s)},pointToLatLng:function(e,t){var n=this.scale(t),s=this.transformation.untransform(e,n);return this.projection.unproject(s)},project:function(e){return this.projection.project(e)},unproject:function(e){return this.projection.unproject(e)},scale:function(e){return 256*2**e},zoom:function(e){return Math.log(e/256)/Math.LN2},getProjectedBounds:function(e){if(this.infinite)return null;var t=this.projection.bounds,n=this.scale(e);return new Bounds(this.transformation.transform(t.min,n),this.transformation.transform(t.max,n))},infinite:!1,wrapLatLng:function(e){var t=this.wrapLng?wrapNum(e.lng,this.wrapLng,!0):e.lng,n=this.wrapLat?wrapNum(e.lat,this.wrapLat,!0):e.lat,s=e.alt;return new LatLng(n,t,s)},wrapLatLngBounds:function(e){var t=e.getCenter(),n=this.wrapLatLng(t),s=t.lat-n.lat,c=t.lng-n.lng;if(s===0&&c===0)return e;var l=e.getSouthWest(),d=e.getNorthEast();return new LatLngBounds(new LatLng(l.lat-s,l.lng-c),new LatLng(d.lat-s,d.lng-c))}},b=extend({},y,{wrapLng:[-180,180],R:6371e3,distance:function(e,t){var n=Math.PI/180,s=e.lat*n,c=t.lat*n,l=Math.sin((t.lat-e.lat)*n/2),d=Math.sin((t.lng-e.lng)*n/2),f=l*l+Math.cos(s)*Math.cos(c)*d*d,p=2*Math.atan2(Math.sqrt(f),Math.sqrt(1-f));return this.R*p}}),x=6378137,S={R:x,MAX_LATITUDE:85.0511287798,project:function(e){var t=Math.PI/180,n=this.MAX_LATITUDE,s=Math.max(Math.min(n,e.lat),-n),c=Math.sin(s*t);return new Point(this.R*e.lng*t,this.R*Math.log((1+c)/(1-c))/2)},unproject:function(e){var t=180/Math.PI;return new LatLng((2*Math.atan(Math.exp(e.y/this.R))-Math.PI/2)*t,e.x*t/this.R)},bounds:(function(){var e=x*Math.PI;return new Bounds([-e,-e],[e,e])})()};function Transformation(e,t,n,s){if(l(e)){this._a=e[0],this._b=e[1],this._c=e[2],this._d=e[3];return}this._a=e,this._b=t,this._c=n,this._d=s}Transformation.prototype={transform:function(e,t){return this._transform(e.clone(),t)},_transform:function(e,t){return t||=1,e.x=t*(this._a*e.x+this._b),e.y=t*(this._c*e.y+this._d),e},untransform:function(e,t){return t||=1,new Point((e.x/t-this._b)/this._a,(e.y/t-this._d)/this._c)}};function toTransformation(e,t,n,s){return new Transformation(e,t,n,s)}var C=extend({},b,{code:`EPSG:3857`,projection:S,transformation:function(){var e=.5/(Math.PI*S.R);return toTransformation(e,.5,-e,.5)}()}),T=extend({},C,{code:`EPSG:900913`});function svgCreate(e){return document.createElementNS(`http://www.w3.org/2000/svg`,e)}function pointsToPath(e,t){var n=``,s,c,l,d,f,p;for(s=0,l=e.length;s<l;s++){for(f=e[s],c=0,d=f.length;c<d;c++)p=f[c],n+=(c?`L`:`M`)+p.x+` `+p.y;n+=t?U.svg?`z`:`x`:``}return n||`M0 0`}var E=document.documentElement.style,D=`ActiveXObject`in window,O=D&&!document.addEventListener,k=`msLaunchUri`in navigator&&!(`documentMode`in document),A=userAgentContains(`webkit`),j=userAgentContains(`android`),M=userAgentContains(`android 2`)||userAgentContains(`android 3`),N=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),P=j&&userAgentContains(`Google`)&&N<537&&!(`AudioNode`in window),I=!!window.opera,ee=!k&&userAgentContains(`chrome`),te=userAgentContains(`gecko`)&&!A&&!I&&!D,ne=!ee&&userAgentContains(`safari`),R=userAgentContains(`phantom`),z=`OTransition`in E,B=navigator.platform.indexOf(`Win`)===0,re=D&&`transition`in E,ie=`WebKitCSSMatrix`in window&&`m11`in new window.WebKitCSSMatrix&&!M,ae=`MozPerspective`in E,oe=!window.L_DISABLE_3D&&(re||ie||ae)&&!z&&!R,se=typeof orientation<`u`||userAgentContains(`mobile`),ce=se&&A,le=se&&ie,ue=!window.PointerEvent&&window.MSPointerEvent,de=!!(window.PointerEvent||ue),fe=`ontouchstart`in window||!!window.TouchEvent,pe=!window.L_NO_TOUCH&&(fe||de),V=se&&I,me=se&&te,H=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,he=function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener(`testPassiveEventSupport`,falseFn,t),window.removeEventListener(`testPassiveEventSupport`,falseFn,t)}catch{}return e}(),ge=function(){return!!document.createElement(`canvas`).getContext}(),_e=!!(document.createElementNS&&svgCreate(`svg`).createSVGRect),ve=!!_e&&(function(){var e=document.createElement(`div`);return e.innerHTML=`<svg/>`,(e.firstChild&&e.firstChild.namespaceURI)===`http://www.w3.org/2000/svg`})(),ye=!_e&&function(){try{var e=document.createElement(`div`);e.innerHTML=`<v:shape adj="1"/>`;var t=e.firstChild;return t.style.behavior=`url(#default#VML)`,t&&typeof t.adj==`object`}catch{return!1}}(),be=navigator.platform.indexOf(`Mac`)===0,xe=navigator.platform.indexOf(`Linux`)===0;function userAgentContains(e){return navigator.userAgent.toLowerCase().indexOf(e)>=0}var U={ie:D,ielt9:O,edge:k,webkit:A,android:j,android23:M,androidStock:P,opera:I,chrome:ee,gecko:te,safari:ne,phantom:R,opera12:z,win:B,ie3d:re,webkit3d:ie,gecko3d:ae,any3d:oe,mobile:se,mobileWebkit:ce,mobileWebkit3d:le,msPointer:ue,pointer:de,touch:pe,touchNative:fe,mobileOpera:V,mobileGecko:me,retina:H,passiveEvents:he,canvas:ge,svg:_e,vml:ye,inlineSvg:ve,mac:be,linux:xe},Se=U.msPointer?`MSPointerDown`:`pointerdown`,Ce=U.msPointer?`MSPointerMove`:`pointermove`,we=U.msPointer?`MSPointerUp`:`pointerup`,Te=U.msPointer?`MSPointerCancel`:`pointercancel`,Ee={touchstart:Se,touchmove:Ce,touchend:we,touchcancel:Te},De={touchstart:_onPointerStart,touchmove:_handlePointer,touchend:_handlePointer,touchcancel:_handlePointer},Oe={},ke=!1;function addPointerListener(e,t,n){return t===`touchstart`&&_addPointerDocListener(),De[t]?(n=De[t].bind(this,n),e.addEventListener(Ee[t],n,!1),n):(console.warn(`wrong event specified:`,t),falseFn)}function removePointerListener(e,t,n){if(!Ee[t]){console.warn(`wrong event specified:`,t);return}e.removeEventListener(Ee[t],n,!1)}function _globalPointerDown(e){Oe[e.pointerId]=e}function _globalPointerMove(e){Oe[e.pointerId]&&(Oe[e.pointerId]=e)}function _globalPointerUp(e){delete Oe[e.pointerId]}function _addPointerDocListener(){ke||=(document.addEventListener(Se,_globalPointerDown,!0),document.addEventListener(Ce,_globalPointerMove,!0),document.addEventListener(we,_globalPointerUp,!0),document.addEventListener(Te,_globalPointerUp,!0),!0)}function _handlePointer(e,t){if(t.pointerType!==(t.MSPOINTER_TYPE_MOUSE||`mouse`)){for(var n in t.touches=[],Oe)t.touches.push(Oe[n]);t.changedTouches=[t],e(t)}}function _onPointerStart(e,t){t.MSPOINTER_TYPE_TOUCH&&t.pointerType===t.MSPOINTER_TYPE_TOUCH&&preventDefault(t),_handlePointer(e,t)}function makeDblclick(e){var t={},n,s;for(s in e)n=e[s],t[s]=n&&n.bind?n.bind(e):n;return e=t,t.type=`dblclick`,t.detail=2,t.isTrusted=!1,t._simulated=!0,t}var Ae=200;function addDoubleTapListener(e,t){e.addEventListener(`dblclick`,t);var n=0,s;function simDblclick(e){if(e.detail!==1){s=e.detail;return}if(!(e.pointerType===`mouse`||e.sourceCapabilities&&!e.sourceCapabilities.firesTouchEvents)){var c=getPropagationPath(e);if(!(c.some(function(e){return e instanceof HTMLLabelElement&&e.attributes.for})&&!c.some(function(e){return e instanceof HTMLInputElement||e instanceof HTMLSelectElement}))){var l=Date.now();l-n<=Ae?(s++,s===2&&t(makeDblclick(e))):s=1,n=l}}}return e.addEventListener(`click`,simDblclick),{dblclick:t,simDblclick}}function removeDoubleTapListener(e,t){e.removeEventListener(`dblclick`,t.dblclick),e.removeEventListener(`click`,t.simDblclick)}var je=testProp([`transform`,`webkitTransform`,`OTransform`,`MozTransform`,`msTransform`]),Me=testProp([`webkitTransition`,`transition`,`OTransition`,`MozTransition`,`msTransition`]),Ne=Me===`webkitTransition`||Me===`OTransition`?Me+`End`:`transitionend`;function get(e){return typeof e==`string`?document.getElementById(e):e}function getStyle(e,t){var n=e.style[t]||e.currentStyle&&e.currentStyle[t];if((!n||n===`auto`)&&document.defaultView){var s=document.defaultView.getComputedStyle(e,null);n=s?s[t]:null}return n===`auto`?null:n}function create$1(e,t,n){var s=document.createElement(e);return s.className=t||``,n&&n.appendChild(s),s}function remove(e){var t=e.parentNode;t&&t.removeChild(e)}function empty(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function toFront(e){var t=e.parentNode;t&&t.lastChild!==e&&t.appendChild(e)}function toBack(e){var t=e.parentNode;t&&t.firstChild!==e&&t.insertBefore(e,t.firstChild)}function hasClass(e,t){if(e.classList!==void 0)return e.classList.contains(t);var n=getClass(e);return n.length>0&&RegExp(`(^|\\s)`+t+`(\\s|$)`).test(n)}function addClass(e,t){if(e.classList!==void 0)for(var n=splitWords(t),s=0,c=n.length;s<c;s++)e.classList.add(n[s]);else if(!hasClass(e,t)){var l=getClass(e);setClass(e,(l?l+` `:``)+t)}}function removeClass(e,t){e.classList===void 0?setClass(e,trim((` `+getClass(e)+` `).replace(` `+t+` `,` `))):e.classList.remove(t)}function setClass(e,t){e.className.baseVal===void 0?e.className=t:e.className.baseVal=t}function getClass(e){return e.correspondingElement&&(e=e.correspondingElement),e.className.baseVal===void 0?e.className:e.className.baseVal}function setOpacity(e,t){`opacity`in e.style?e.style.opacity=t:`filter`in e.style&&_setOpacityIE(e,t)}function _setOpacityIE(e,t){var n=!1,s=`DXImageTransform.Microsoft.Alpha`;try{n=e.filters.item(s)}catch{if(t===1)return}t=Math.round(t*100),n?(n.Enabled=t!==100,n.Opacity=t):e.style.filter+=` progid:`+s+`(opacity=`+t+`)`}function testProp(e){for(var t=document.documentElement.style,n=0;n<e.length;n++)if(e[n]in t)return e[n];return!1}function setTransform(e,t,n){var s=t||new Point(0,0);e.style[je]=(U.ie3d?`translate(`+s.x+`px,`+s.y+`px)`:`translate3d(`+s.x+`px,`+s.y+`px,0)`)+(n?` scale(`+n+`)`:``)}function setPosition(e,t){e._leaflet_pos=t,U.any3d?setTransform(e,t):(e.style.left=t.x+`px`,e.style.top=t.y+`px`)}function getPosition(e){return e._leaflet_pos||new Point(0,0)}var disableTextSelection,enableTextSelection,Pe;if(`onselectstart`in document)disableTextSelection=function(){on(window,`selectstart`,preventDefault)},enableTextSelection=function(){off(window,`selectstart`,preventDefault)};else{var Fe=testProp([`userSelect`,`WebkitUserSelect`,`OUserSelect`,`MozUserSelect`,`msUserSelect`]);disableTextSelection=function(){if(Fe){var e=document.documentElement.style;Pe=e[Fe],e[Fe]=`none`}},enableTextSelection=function(){Fe&&(document.documentElement.style[Fe]=Pe,Pe=void 0)}}function disableImageDrag(){on(window,`dragstart`,preventDefault)}function enableImageDrag(){off(window,`dragstart`,preventDefault)}var W,G;function preventOutline(e){for(;e.tabIndex===-1;)e=e.parentNode;e.style&&(restoreOutline(),W=e,G=e.style.outlineStyle,e.style.outlineStyle=`none`,on(window,`keydown`,restoreOutline))}function restoreOutline(){W&&(W.style.outlineStyle=G,W=void 0,G=void 0,off(window,`keydown`,restoreOutline))}function getSizedParentNode(e){do e=e.parentNode;while((!e.offsetWidth||!e.offsetHeight)&&e!==document.body);return e}function getScale(e){var t=e.getBoundingClientRect();return{x:t.width/e.offsetWidth||1,y:t.height/e.offsetHeight||1,boundingClientRect:t}}var K={__proto__:null,TRANSFORM:je,TRANSITION:Me,TRANSITION_END:Ne,get,getStyle,create:create$1,remove,empty,toFront,toBack,hasClass,addClass,removeClass,setClass,getClass,setOpacity,testProp,setTransform,setPosition,getPosition,get disableTextSelection(){return disableTextSelection},get enableTextSelection(){return enableTextSelection},disableImageDrag,enableImageDrag,preventOutline,restoreOutline,getSizedParentNode,getScale};function on(e,t,n,s){if(t&&typeof t==`object`)for(var c in t)addOne(e,c,t[c],n);else{t=splitWords(t);for(var l=0,d=t.length;l<d;l++)addOne(e,t[l],n,s)}return this}var q=`_leaflet_events`;function off(e,t,n,s){if(arguments.length===1)batchRemove(e),delete e[q];else if(t&&typeof t==`object`)for(var c in t)removeOne(e,c,t[c],n);else if(t=splitWords(t),arguments.length===2)batchRemove(e,function(e){return indexOf(t,e)!==-1});else for(var l=0,d=t.length;l<d;l++)removeOne(e,t[l],n,s);return this}function batchRemove(e,t){for(var n in e[q]){var s=n.split(/\d/)[0];(!t||t(s))&&removeOne(e,s,null,null,n)}}var Ie={mouseenter:`mouseover`,mouseleave:`mouseout`,wheel:!(`onwheel`in window)&&`mousewheel`};function addOne(e,t,n,s){var c=t+stamp(n)+(s?`_`+stamp(s):``);if(e[q]&&e[q][c])return this;var handler=function(t){return n.call(s||e,t||window.event)},l=handler;!U.touchNative&&U.pointer&&t.indexOf(`touch`)===0?handler=addPointerListener(e,t,handler):U.touch&&t===`dblclick`?handler=addDoubleTapListener(e,handler):`addEventListener`in e?t===`touchstart`||t===`touchmove`||t===`wheel`||t===`mousewheel`?e.addEventListener(Ie[t]||t,handler,U.passiveEvents?{passive:!1}:!1):t===`mouseenter`||t===`mouseleave`?(handler=function(t){t||=window.event,isExternalTarget(e,t)&&l(t)},e.addEventListener(Ie[t],handler,!1)):e.addEventListener(t,l,!1):e.attachEvent(`on`+t,handler),e[q]=e[q]||{},e[q][c]=handler}function removeOne(e,t,n,s,c){c||=t+stamp(n)+(s?`_`+stamp(s):``);var l=e[q]&&e[q][c];if(!l)return this;!U.touchNative&&U.pointer&&t.indexOf(`touch`)===0?removePointerListener(e,t,l):U.touch&&t===`dblclick`?removeDoubleTapListener(e,l):`removeEventListener`in e?e.removeEventListener(Ie[t]||t,l,!1):e.detachEvent(`on`+t,l),e[q][c]=null}function stopPropagation(e){return e.stopPropagation?e.stopPropagation():e.originalEvent?e.originalEvent._stopped=!0:e.cancelBubble=!0,this}function disableScrollPropagation(e){return addOne(e,`wheel`,stopPropagation),this}function disableClickPropagation(e){return on(e,`mousedown touchstart dblclick contextmenu`,stopPropagation),e._leaflet_disable_click=!0,this}function preventDefault(e){return e.preventDefault?e.preventDefault():e.returnValue=!1,this}function stop(e){return preventDefault(e),stopPropagation(e),this}function getPropagationPath(e){if(e.composedPath)return e.composedPath();for(var t=[],n=e.target;n;)t.push(n),n=n.parentNode;return t}function getMousePosition(e,t){if(!t)return new Point(e.clientX,e.clientY);var n=getScale(t),s=n.boundingClientRect;return new Point((e.clientX-s.left)/n.x-t.clientLeft,(e.clientY-s.top)/n.y-t.clientTop)}var Le=U.linux&&U.chrome?window.devicePixelRatio:U.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function getWheelDelta(e){return U.edge?e.wheelDeltaY/2:e.deltaY&&e.deltaMode===0?-e.deltaY/Le:e.deltaY&&e.deltaMode===1?-e.deltaY*20:e.deltaY&&e.deltaMode===2?-e.deltaY*60:e.deltaX||e.deltaZ?0:e.wheelDelta?(e.wheelDeltaY||e.wheelDelta)/2:e.detail&&Math.abs(e.detail)<32765?-e.detail*20:e.detail?e.detail/-32765*60:0}function isExternalTarget(e,t){var n=t.relatedTarget;if(!n)return!0;try{for(;n&&n!==e;)n=n.parentNode}catch{return!1}return n!==e}var Re={__proto__:null,on,off,stopPropagation,disableScrollPropagation,disableClickPropagation,preventDefault,stop,getPropagationPath,getMousePosition,getWheelDelta,isExternalTarget,addListener:on,removeListener:off},ze=_.extend({run:function(e,t,n,s){this.stop(),this._el=e,this._inProgress=!0,this._duration=n||.25,this._easeOutPower=1/Math.max(s||.5,.2),this._startPos=getPosition(e),this._offset=t.subtract(this._startPos),this._startTime=+new Date,this.fire(`start`),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=requestAnimFrame(this._animate,this),this._step()},_step:function(e){var t=+new Date-this._startTime,n=this._duration*1e3;t<n?this._runFrame(this._easeOut(t/n),e):(this._runFrame(1),this._complete())},_runFrame:function(e,t){var n=this._startPos.add(this._offset.multiplyBy(e));t&&n._round(),setPosition(this._el,n),this.fire(`step`)},_complete:function(){cancelAnimFrame(this._animId),this._inProgress=!1,this.fire(`end`)},_easeOut:function(e){return 1-(1-e)**this._easeOutPower}}),J=_.extend({options:{crs:C,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(e,t){t=setOptions(this,t),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(e),this._initLayout(),this._onResize=bind(this._onResize,this),this._initEvents(),t.maxBounds&&this.setMaxBounds(t.maxBounds),t.zoom!==void 0&&(this._zoom=this._limitZoom(t.zoom)),t.center&&t.zoom!==void 0&&this.setView(toLatLng(t.center),t.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=Me&&U.any3d&&!U.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),on(this._proxy,Ne,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(e,t,n){return t=t===void 0?this._zoom:this._limitZoom(t),e=this._limitCenter(toLatLng(e),t,this.options.maxBounds),n||={},this._stop(),this._loaded&&!n.reset&&n!==!0&&(n.animate!==void 0&&(n.zoom=extend({animate:n.animate},n.zoom),n.pan=extend({animate:n.animate,duration:n.duration},n.pan)),this._zoom===t?this._tryAnimatedPan(e,n.pan):this._tryAnimatedZoom&&this._tryAnimatedZoom(e,t,n.zoom))?(clearTimeout(this._sizeTimer),this):(this._resetView(e,t,n.pan&&n.pan.noMoveStart),this)},setZoom:function(e,t){return this._loaded?this.setView(this.getCenter(),e,{zoom:t}):(this._zoom=e,this)},zoomIn:function(e,t){return e||=U.any3d?this.options.zoomDelta:1,this.setZoom(this._zoom+e,t)},zoomOut:function(e,t){return e||=U.any3d?this.options.zoomDelta:1,this.setZoom(this._zoom-e,t)},setZoomAround:function(e,t,n){var s=this.getZoomScale(t),c=this.getSize().divideBy(2),l=(e instanceof Point?e:this.latLngToContainerPoint(e)).subtract(c).multiplyBy(1-1/s),d=this.containerPointToLatLng(c.add(l));return this.setView(d,t,{zoom:n})},_getBoundsCenterZoom:function(e,t){t||={},e=e.getBounds?e.getBounds():toLatLngBounds(e);var n=toPoint(t.paddingTopLeft||t.padding||[0,0]),s=toPoint(t.paddingBottomRight||t.padding||[0,0]),c=this.getBoundsZoom(e,!1,n.add(s));if(c=typeof t.maxZoom==`number`?Math.min(t.maxZoom,c):c,c===1/0)return{center:e.getCenter(),zoom:c};var l=s.subtract(n).divideBy(2),d=this.project(e.getSouthWest(),c),f=this.project(e.getNorthEast(),c);return{center:this.unproject(d.add(f).divideBy(2).add(l),c),zoom:c}},fitBounds:function(e,t){if(e=toLatLngBounds(e),!e.isValid())throw Error(`Bounds are not valid.`);var n=this._getBoundsCenterZoom(e,t);return this.setView(n.center,n.zoom,t)},fitWorld:function(e){return this.fitBounds([[-90,-180],[90,180]],e)},panTo:function(e,t){return this.setView(e,this._zoom,{pan:t})},panBy:function(e,t){if(e=toPoint(e).round(),t||={},!e.x&&!e.y)return this.fire(`moveend`);if(t.animate!==!0&&!this.getSize().contains(e))return this._resetView(this.unproject(this.project(this.getCenter()).add(e)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new ze,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),t.noMoveStart||this.fire(`movestart`),t.animate!==!1){addClass(this._mapPane,`leaflet-pan-anim`);var n=this._getMapPanePos().subtract(e).round();this._panAnim.run(this._mapPane,n,t.duration||.25,t.easeLinearity)}else this._rawPanBy(e),this.fire(`move`).fire(`moveend`);return this},flyTo:function(e,t,n){if(n||={},n.animate===!1||!U.any3d)return this.setView(e,t,n);this._stop();var s=this.project(this.getCenter()),c=this.project(e),l=this.getSize(),d=this._zoom;e=toLatLng(e),t=t===void 0?d:t;var f=Math.max(l.x,l.y),p=f*this.getZoomScale(d,t),m=c.distanceTo(s)||1,h=1.42,g=h*h;function r(e){var t=e?-1:1,n=e?p:f,s=(p*p-f*f+t*g*g*m*m)/(2*n*g*m),c=Math.sqrt(s*s+1)-s;return c<1e-9?-18:Math.log(c)}function sinh(e){return(Math.exp(e)-Math.exp(-e))/2}function cosh(e){return(Math.exp(e)+Math.exp(-e))/2}function tanh(e){return sinh(e)/cosh(e)}var _=r(0);function w(e){return f*(cosh(_)/cosh(_+h*e))}function u(e){return f*(cosh(_)*tanh(_+h*e)-sinh(_))/g}function easeOut(e){return 1-(1-e)**1.5}var v=Date.now(),y=(r(1)-_)/h,b=n.duration?1e3*n.duration:1e3*y*.8;function frame(){var n=(Date.now()-v)/b,l=easeOut(n)*y;n<=1?(this._flyToFrame=requestAnimFrame(frame,this),this._move(this.unproject(s.add(c.subtract(s).multiplyBy(u(l)/m)),d),this.getScaleZoom(f/w(l),d),{flyTo:!0})):this._move(e,t)._moveEnd(!0)}return this._moveStart(!0,n.noMoveStart),frame.call(this),this},flyToBounds:function(e,t){var n=this._getBoundsCenterZoom(e,t);return this.flyTo(n.center,n.zoom,t)},setMaxBounds:function(e){return e=toLatLngBounds(e),this.listens(`moveend`,this._panInsideMaxBounds)&&this.off(`moveend`,this._panInsideMaxBounds),e.isValid()?(this.options.maxBounds=e,this._loaded&&this._panInsideMaxBounds(),this.on(`moveend`,this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(e){var t=this.options.minZoom;return this.options.minZoom=e,this._loaded&&t!==e&&(this.fire(`zoomlevelschange`),this.getZoom()<this.options.minZoom)?this.setZoom(e):this},setMaxZoom:function(e){var t=this.options.maxZoom;return this.options.maxZoom=e,this._loaded&&t!==e&&(this.fire(`zoomlevelschange`),this.getZoom()>this.options.maxZoom)?this.setZoom(e):this},panInsideBounds:function(e,t){this._enforcingBounds=!0;var n=this.getCenter(),s=this._limitCenter(n,this._zoom,toLatLngBounds(e));return n.equals(s)||this.panTo(s,t),this._enforcingBounds=!1,this},panInside:function(e,t){t||={};var n=toPoint(t.paddingTopLeft||t.padding||[0,0]),s=toPoint(t.paddingBottomRight||t.padding||[0,0]),c=this.project(this.getCenter()),l=this.project(e),d=this.getPixelBounds(),f=toBounds([d.min.add(n),d.max.subtract(s)]),p=f.getSize();if(!f.contains(l)){this._enforcingBounds=!0;var m=l.subtract(f.getCenter()),h=f.extend(l).getSize().subtract(p);c.x+=m.x<0?-h.x:h.x,c.y+=m.y<0?-h.y:h.y,this.panTo(this.unproject(c),t),this._enforcingBounds=!1}return this},invalidateSize:function(e){if(!this._loaded)return this;e=extend({animate:!1,pan:!0},e===!0?{animate:!0}:e);var t=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var n=this.getSize(),s=t.divideBy(2).round(),c=n.divideBy(2).round(),l=s.subtract(c);return!l.x&&!l.y?this:(e.animate&&e.pan?this.panBy(l):(e.pan&&this._rawPanBy(l),this.fire(`move`),e.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(bind(this.fire,this,`moveend`),200)):this.fire(`moveend`)),this.fire(`resize`,{oldSize:t,newSize:n}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire(`viewreset`),this._stop()},locate:function(e){if(e=this._locateOptions=extend({timeout:1e4,watch:!1},e),!(`geolocation`in navigator))return this._handleGeolocationError({code:0,message:`Geolocation not supported.`}),this;var t=bind(this._handleGeolocationResponse,this),n=bind(this._handleGeolocationError,this);return e.watch?this._locationWatchId=navigator.geolocation.watchPosition(t,n,e):navigator.geolocation.getCurrentPosition(t,n,e),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(e){if(this._container._leaflet_id){var t=e.code,n=e.message||(t===1?`permission denied`:t===2?`position unavailable`:`timeout`);this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire(`locationerror`,{code:t,message:`Geolocation error: `+n+`.`})}},_handleGeolocationResponse:function(e){if(this._container._leaflet_id){var t=e.coords.latitude,n=e.coords.longitude,s=new LatLng(t,n),c=s.toBounds(e.coords.accuracy*2),l=this._locateOptions;if(l.setView){var d=this.getBoundsZoom(c);this.setView(s,l.maxZoom?Math.min(d,l.maxZoom):d)}var f={latlng:s,bounds:c,timestamp:e.timestamp};for(var p in e.coords)typeof e.coords[p]==`number`&&(f[p]=e.coords[p]);this.fire(`locationfound`,f)}},addHandler:function(e,t){if(!t)return this;var n=this[e]=new t(this);return this._handlers.push(n),this.options[e]&&n.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off(`moveend`,this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw Error(`Map container is being reused by another instance`);try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}for(var e in this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),remove(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&=(cancelAnimFrame(this._resizeRequest),null),this._clearHandlers(),this._loaded&&this.fire(`unload`),this._layers)this._layers[e].remove();for(e in this._panes)remove(this._panes[e]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(e,t){var n=create$1(`div`,`leaflet-pane`+(e?` leaflet-`+e.replace(`Pane`,``)+`-pane`:``),t||this._mapPane);return e&&(this._panes[e]=n),n},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var e=this.getPixelBounds();return new LatLngBounds(this.unproject(e.getBottomLeft()),this.unproject(e.getTopRight()))},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(e,t,n){e=toLatLngBounds(e),n=toPoint(n||[0,0]);var s=this.getZoom()||0,c=this.getMinZoom(),l=this.getMaxZoom(),d=e.getNorthWest(),f=e.getSouthEast(),p=this.getSize().subtract(n),m=toBounds(this.project(f,s),this.project(d,s)).getSize(),h=U.any3d?this.options.zoomSnap:1,g=p.x/m.x,_=p.y/m.y,v=t?Math.max(g,_):Math.min(g,_);return s=this.getScaleZoom(v,s),h&&(s=Math.round(s/(h/100))*(h/100),s=t?Math.ceil(s/h)*h:Math.floor(s/h)*h),Math.max(c,Math.min(l,s))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new Point(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(e,t){var n=this._getTopLeftPoint(e,t);return new Bounds(n,n.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(e){return this.options.crs.getProjectedBounds(e===void 0?this.getZoom():e)},getPane:function(e){return typeof e==`string`?this._panes[e]:e},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(e,t){var n=this.options.crs;return t=t===void 0?this._zoom:t,n.scale(e)/n.scale(t)},getScaleZoom:function(e,t){var n=this.options.crs;t=t===void 0?this._zoom:t;var s=n.zoom(e*n.scale(t));return isNaN(s)?1/0:s},project:function(e,t){return t=t===void 0?this._zoom:t,this.options.crs.latLngToPoint(toLatLng(e),t)},unproject:function(e,t){return t=t===void 0?this._zoom:t,this.options.crs.pointToLatLng(toPoint(e),t)},layerPointToLatLng:function(e){var t=toPoint(e).add(this.getPixelOrigin());return this.unproject(t)},latLngToLayerPoint:function(e){return this.project(toLatLng(e))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(e){return this.options.crs.wrapLatLng(toLatLng(e))},wrapLatLngBounds:function(e){return this.options.crs.wrapLatLngBounds(toLatLngBounds(e))},distance:function(e,t){return this.options.crs.distance(toLatLng(e),toLatLng(t))},containerPointToLayerPoint:function(e){return toPoint(e).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(e){return toPoint(e).add(this._getMapPanePos())},containerPointToLatLng:function(e){var t=this.containerPointToLayerPoint(toPoint(e));return this.layerPointToLatLng(t)},latLngToContainerPoint:function(e){return this.layerPointToContainerPoint(this.latLngToLayerPoint(toLatLng(e)))},mouseEventToContainerPoint:function(e){return getMousePosition(e,this._container)},mouseEventToLayerPoint:function(e){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(e))},mouseEventToLatLng:function(e){return this.layerPointToLatLng(this.mouseEventToLayerPoint(e))},_initContainer:function(e){var t=this._container=get(e);if(!t)throw Error(`Map container not found.`);if(t._leaflet_id)throw Error(`Map container is already initialized.`);on(t,`scroll`,this._onScroll,this),this._containerId=stamp(t)},_initLayout:function(){var e=this._container;this._fadeAnimated=this.options.fadeAnimation&&U.any3d,addClass(e,`leaflet-container`+(U.touch?` leaflet-touch`:``)+(U.retina?` leaflet-retina`:``)+(U.ielt9?` leaflet-oldie`:``)+(U.safari?` leaflet-safari`:``)+(this._fadeAnimated?` leaflet-fade-anim`:``));var t=getStyle(e,`position`);t!==`absolute`&&t!==`relative`&&t!==`fixed`&&t!==`sticky`&&(e.style.position=`relative`),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var e=this._panes={};this._paneRenderers={},this._mapPane=this.createPane(`mapPane`,this._container),setPosition(this._mapPane,new Point(0,0)),this.createPane(`tilePane`),this.createPane(`overlayPane`),this.createPane(`shadowPane`),this.createPane(`markerPane`),this.createPane(`tooltipPane`),this.createPane(`popupPane`),this.options.markerZoomAnimation||(addClass(e.markerPane,`leaflet-zoom-hide`),addClass(e.shadowPane,`leaflet-zoom-hide`))},_resetView:function(e,t,n){setPosition(this._mapPane,new Point(0,0));var s=!this._loaded;this._loaded=!0,t=this._limitZoom(t),this.fire(`viewprereset`);var c=this._zoom!==t;this._moveStart(c,n)._move(e,t)._moveEnd(c),this.fire(`viewreset`),s&&this.fire(`load`)},_moveStart:function(e,t){return e&&this.fire(`zoomstart`),t||this.fire(`movestart`),this},_move:function(e,t,n,s){t===void 0&&(t=this._zoom);var c=this._zoom!==t;return this._zoom=t,this._lastCenter=e,this._pixelOrigin=this._getNewPixelOrigin(e),s?n&&n.pinch&&this.fire(`zoom`,n):((c||n&&n.pinch)&&this.fire(`zoom`,n),this.fire(`move`,n)),this},_moveEnd:function(e){return e&&this.fire(`zoomend`),this.fire(`moveend`)},_stop:function(){return cancelAnimFrame(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(e){setPosition(this._mapPane,this._getMapPanePos().subtract(e))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw Error(`Set map center and zoom first.`)},_initEvents:function(e){this._targets={},this._targets[stamp(this._container)]=this;var t=e?off:on;t(this._container,`click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup`,this._handleDOMEvent,this),this.options.trackResize&&t(window,`resize`,this._onResize,this),U.any3d&&this.options.transform3DLimit&&(e?this.off:this.on).call(this,`moveend`,this._onMoveEnd)},_onResize:function(){cancelAnimFrame(this._resizeRequest),this._resizeRequest=requestAnimFrame(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var e=this._getMapPanePos();Math.max(Math.abs(e.x),Math.abs(e.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(e,t){for(var n=[],s,c=t===`mouseout`||t===`mouseover`,l=e.target||e.srcElement,d=!1;l;){if(s=this._targets[stamp(l)],s&&(t===`click`||t===`preclick`)&&this._draggableMoved(s)){d=!0;break}if(s&&s.listens(t,!0)&&(c&&!isExternalTarget(l,e)||(n.push(s),c))||l===this._container)break;l=l.parentNode}return!n.length&&!d&&!c&&this.listens(t,!0)&&(n=[this]),n},_isClickDisabled:function(e){for(;e&&e!==this._container;){if(e._leaflet_disable_click)return!0;e=e.parentNode}},_handleDOMEvent:function(e){var t=e.target||e.srcElement;if(!(!this._loaded||t._leaflet_disable_events||e.type===`click`&&this._isClickDisabled(t))){var n=e.type;n===`mousedown`&&preventOutline(t),this._fireDOMEvent(e,n)}},_mouseEvents:[`click`,`dblclick`,`mouseover`,`mouseout`,`contextmenu`],_fireDOMEvent:function(e,t,n){if(e.type===`click`){var s=extend({},e);s.type=`preclick`,this._fireDOMEvent(s,s.type,n)}var c=this._findEventTargets(e,t);if(n){for(var l=[],d=0;d<n.length;d++)n[d].listens(t,!0)&&l.push(n[d]);c=l.concat(c)}if(c.length){t===`contextmenu`&&preventDefault(e);var f=c[0],p={originalEvent:e};if(e.type!==`keypress`&&e.type!==`keydown`&&e.type!==`keyup`){var m=f.getLatLng&&(!f._radius||f._radius<=10);p.containerPoint=m?this.latLngToContainerPoint(f.getLatLng()):this.mouseEventToContainerPoint(e),p.layerPoint=this.containerPointToLayerPoint(p.containerPoint),p.latlng=m?f.getLatLng():this.layerPointToLatLng(p.layerPoint)}for(d=0;d<c.length;d++)if(c[d].fire(t,p,!0),p.originalEvent._stopped||c[d].options.bubblingMouseEvents===!1&&indexOf(this._mouseEvents,t)!==-1)return}},_draggableMoved:function(e){return e=e.dragging&&e.dragging.enabled()?e:this,e.dragging&&e.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var e=0,t=this._handlers.length;e<t;e++)this._handlers[e].disable()},whenReady:function(e,t){return this._loaded?e.call(t||this,{target:this}):this.on(`load`,e,t),this},_getMapPanePos:function(){return getPosition(this._mapPane)||new Point(0,0)},_moved:function(){var e=this._getMapPanePos();return e&&!e.equals([0,0])},_getTopLeftPoint:function(e,t){return(e&&t!==void 0?this._getNewPixelOrigin(e,t):this.getPixelOrigin()).subtract(this._getMapPanePos())},_getNewPixelOrigin:function(e,t){var n=this.getSize()._divideBy(2);return this.project(e,t)._subtract(n)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(e,t,n){var s=this._getNewPixelOrigin(n,t);return this.project(e,t)._subtract(s)},_latLngBoundsToNewLayerBounds:function(e,t,n){var s=this._getNewPixelOrigin(n,t);return toBounds([this.project(e.getSouthWest(),t)._subtract(s),this.project(e.getNorthWest(),t)._subtract(s),this.project(e.getSouthEast(),t)._subtract(s),this.project(e.getNorthEast(),t)._subtract(s)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(e){return this.latLngToLayerPoint(e).subtract(this._getCenterLayerPoint())},_limitCenter:function(e,t,n){if(!n)return e;var s=this.project(e,t),c=this.getSize().divideBy(2),l=new Bounds(s.subtract(c),s.add(c)),d=this._getBoundsOffset(l,n,t);return Math.abs(d.x)<=1&&Math.abs(d.y)<=1?e:this.unproject(s.add(d),t)},_limitOffset:function(e,t){if(!t)return e;var n=this.getPixelBounds(),s=new Bounds(n.min.add(e),n.max.add(e));return e.add(this._getBoundsOffset(s,t))},_getBoundsOffset:function(e,t,n){var s=toBounds(this.project(t.getNorthEast(),n),this.project(t.getSouthWest(),n)),c=s.min.subtract(e.min),l=s.max.subtract(e.max);return new Point(this._rebound(c.x,-l.x),this._rebound(c.y,-l.y))},_rebound:function(e,t){return e+t>0?Math.round(e-t)/2:Math.max(0,Math.ceil(e))-Math.max(0,Math.floor(t))},_limitZoom:function(e){var t=this.getMinZoom(),n=this.getMaxZoom(),s=U.any3d?this.options.zoomSnap:1;return s&&(e=Math.round(e/s)*s),Math.max(t,Math.min(n,e))},_onPanTransitionStep:function(){this.fire(`move`)},_onPanTransitionEnd:function(){removeClass(this._mapPane,`leaflet-pan-anim`),this.fire(`moveend`)},_tryAnimatedPan:function(e,t){var n=this._getCenterOffset(e)._trunc();return(t&&t.animate)!==!0&&!this.getSize().contains(n)?!1:(this.panBy(n,t),!0)},_createAnimProxy:function(){var e=this._proxy=create$1(`div`,`leaflet-proxy leaflet-zoom-animated`);this._panes.mapPane.appendChild(e),this.on(`zoomanim`,function(e){var t=je,n=this._proxy.style[t];setTransform(this._proxy,this.project(e.center,e.zoom),this.getZoomScale(e.zoom,1)),n===this._proxy.style[t]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on(`load moveend`,this._animMoveEnd,this),this._on(`unload`,this._destroyAnimProxy,this)},_destroyAnimProxy:function(){remove(this._proxy),this.off(`load moveend`,this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var e=this.getCenter(),t=this.getZoom();setTransform(this._proxy,this.project(e,t),this.getZoomScale(t,1))},_catchTransitionEnd:function(e){this._animatingZoom&&e.propertyName.indexOf(`transform`)>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName(`leaflet-zoom-animated`).length},_tryAnimatedZoom:function(e,t,n){if(this._animatingZoom)return!0;if(n||={},!this._zoomAnimated||n.animate===!1||this._nothingToAnimate()||Math.abs(t-this._zoom)>this.options.zoomAnimationThreshold)return!1;var s=this.getZoomScale(t),c=this._getCenterOffset(e)._divideBy(1-1/s);return n.animate!==!0&&!this.getSize().contains(c)?!1:(requestAnimFrame(function(){this._moveStart(!0,n.noMoveStart||!1)._animateZoom(e,t,!0)},this),!0)},_animateZoom:function(e,t,n,s){this._mapPane&&(n&&(this._animatingZoom=!0,this._animateToCenter=e,this._animateToZoom=t,addClass(this._mapPane,`leaflet-zoom-anim`)),this.fire(`zoomanim`,{center:e,zoom:t,noUpdate:s}),this._tempFireZoomEvent||=this._zoom!==this._animateToZoom,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(bind(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&removeClass(this._mapPane,`leaflet-zoom-anim`),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire(`zoom`),delete this._tempFireZoomEvent,this.fire(`move`),this._moveEnd(!0))}});function createMap(e,t){return new J(e,t)}var Be=Class.extend({options:{position:`topright`},initialize:function(e){setOptions(this,e)},getPosition:function(){return this.options.position},setPosition:function(e){var t=this._map;return t&&t.removeControl(this),this.options.position=e,t&&t.addControl(this),this},getContainer:function(){return this._container},addTo:function(e){this.remove(),this._map=e;var t=this._container=this.onAdd(e),n=this.getPosition(),s=e._controlCorners[n];return addClass(t,`leaflet-control`),n.indexOf(`bottom`)===-1?s.appendChild(t):s.insertBefore(t,s.firstChild),this._map.on(`unload`,this.remove,this),this},remove:function(){return this._map?(remove(this._container),this.onRemove&&this.onRemove(this._map),this._map.off(`unload`,this.remove,this),this._map=null,this):this},_refocusOnMap:function(e){this._map&&e&&e.screenX>0&&e.screenY>0&&this._map.getContainer().focus()}}),control=function(e){return new Be(e)};J.include({addControl:function(e){return e.addTo(this),this},removeControl:function(e){return e.remove(),this},_initControlPos:function(){var e=this._controlCorners={},t=`leaflet-`,n=this._controlContainer=create$1(`div`,t+`control-container`,this._container);function createCorner(s,c){var l=t+s+` `+t+c;e[s+c]=create$1(`div`,l,n)}createCorner(`top`,`left`),createCorner(`top`,`right`),createCorner(`bottom`,`left`),createCorner(`bottom`,`right`)},_clearControlPos:function(){for(var e in this._controlCorners)remove(this._controlCorners[e]);remove(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Ve=Be.extend({options:{collapsed:!0,position:`topright`,autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(e,t,n,s){return n<s?-1:+(s<n)}},initialize:function(e,t,n){for(var s in setOptions(this,n),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1,e)this._addLayer(e[s],s);for(s in t)this._addLayer(t[s],s,!0)},onAdd:function(e){this._initLayout(),this._update(),this._map=e,e.on(`zoomend`,this._checkDisabledLayers,this);for(var t=0;t<this._layers.length;t++)this._layers[t].layer.on(`add remove`,this._onLayerChange,this);return this._container},addTo:function(e){return Be.prototype.addTo.call(this,e),this._expandIfNotCollapsed()},onRemove:function(){this._map.off(`zoomend`,this._checkDisabledLayers,this);for(var e=0;e<this._layers.length;e++)this._layers[e].layer.off(`add remove`,this._onLayerChange,this)},addBaseLayer:function(e,t){return this._addLayer(e,t),this._map?this._update():this},addOverlay:function(e,t){return this._addLayer(e,t,!0),this._map?this._update():this},removeLayer:function(e){e.off(`add remove`,this._onLayerChange,this);var t=this._getLayer(stamp(e));return t&&this._layers.splice(this._layers.indexOf(t),1),this._map?this._update():this},expand:function(){addClass(this._container,`leaflet-control-layers-expanded`),this._section.style.height=null;var e=this._map.getSize().y-(this._container.offsetTop+50);return e<this._section.clientHeight?(addClass(this._section,`leaflet-control-layers-scrollbar`),this._section.style.height=e+`px`):removeClass(this._section,`leaflet-control-layers-scrollbar`),this._checkDisabledLayers(),this},collapse:function(){return removeClass(this._container,`leaflet-control-layers-expanded`),this},_initLayout:function(){var e=`leaflet-control-layers`,t=this._container=create$1(`div`,e),n=this.options.collapsed;t.setAttribute(`aria-haspopup`,!0),disableClickPropagation(t),disableScrollPropagation(t);var s=this._section=create$1(`section`,e+`-list`);n&&(this._map.on(`click`,this.collapse,this),on(t,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var c=this._layersLink=create$1(`a`,e+`-toggle`,t);c.href=`#`,c.title=`Layers`,c.setAttribute(`role`,`button`),on(c,{keydown:function(e){e.keyCode===13&&this._expandSafely()},click:function(e){preventDefault(e),this._expandSafely()}},this),n||this.expand(),this._baseLayersList=create$1(`div`,e+`-base`,s),this._separator=create$1(`div`,e+`-separator`,s),this._overlaysList=create$1(`div`,e+`-overlays`,s),t.appendChild(s)},_getLayer:function(e){for(var t=0;t<this._layers.length;t++)if(this._layers[t]&&stamp(this._layers[t].layer)===e)return this._layers[t]},_addLayer:function(e,t,n){this._map&&e.on(`add remove`,this._onLayerChange,this),this._layers.push({layer:e,name:t,overlay:n}),this.options.sortLayers&&this._layers.sort(bind(function(e,t){return this.options.sortFunction(e.layer,t.layer,e.name,t.name)},this)),this.options.autoZIndex&&e.setZIndex&&(this._lastZIndex++,e.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;empty(this._baseLayersList),empty(this._overlaysList),this._layerControlInputs=[];var e,t,n,s,c=0;for(n=0;n<this._layers.length;n++)s=this._layers[n],this._addItem(s),t||=s.overlay,e||=!s.overlay,c+=+!s.overlay;return this.options.hideSingleBase&&(e&&=c>1,this._baseLayersList.style.display=e?``:`none`),this._separator.style.display=t&&e?``:`none`,this},_onLayerChange:function(e){this._handlingClick||this._update();var t=this._getLayer(stamp(e.target)),n=t.overlay?e.type===`add`?`overlayadd`:`overlayremove`:e.type===`add`?`baselayerchange`:null;n&&this._map.fire(n,t)},_createRadioElement:function(e,t){var n=`<input type="radio" class="leaflet-control-layers-selector" name="`+e+`"`+(t?` checked="checked"`:``)+`/>`,s=document.createElement(`div`);return s.innerHTML=n,s.firstChild},_addItem:function(e){var t=document.createElement(`label`),n=this._map.hasLayer(e.layer),s;e.overlay?(s=document.createElement(`input`),s.type=`checkbox`,s.className=`leaflet-control-layers-selector`,s.defaultChecked=n):s=this._createRadioElement(`leaflet-base-layers_`+stamp(this),n),this._layerControlInputs.push(s),s.layerId=stamp(e.layer),on(s,`click`,this._onInputClick,this);var c=document.createElement(`span`);c.innerHTML=` `+e.name;var l=document.createElement(`span`);return t.appendChild(l),l.appendChild(s),l.appendChild(c),(e.overlay?this._overlaysList:this._baseLayersList).appendChild(t),this._checkDisabledLayers(),t},_onInputClick:function(){if(!this._preventClick){var e=this._layerControlInputs,t,n,s=[],c=[];this._handlingClick=!0;for(var l=e.length-1;l>=0;l--)t=e[l],n=this._getLayer(t.layerId).layer,t.checked?s.push(n):t.checked||c.push(n);for(l=0;l<c.length;l++)this._map.hasLayer(c[l])&&this._map.removeLayer(c[l]);for(l=0;l<s.length;l++)this._map.hasLayer(s[l])||this._map.addLayer(s[l]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var e=this._layerControlInputs,t,n,s=this._map.getZoom(),c=e.length-1;c>=0;c--)t=e[c],n=this._getLayer(t.layerId).layer,t.disabled=n.options.minZoom!==void 0&&s<n.options.minZoom||n.options.maxZoom!==void 0&&s>n.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var e=this._section;this._preventClick=!0,on(e,`click`,preventDefault),this.expand();var t=this;setTimeout(function(){off(e,`click`,preventDefault),t._preventClick=!1})}}),layers=function(e,t,n){return new Ve(e,t,n)},He=Be.extend({options:{position:`topleft`,zoomInText:`<span aria-hidden="true">+</span>`,zoomInTitle:`Zoom in`,zoomOutText:`<span aria-hidden="true">&#x2212;</span>`,zoomOutTitle:`Zoom out`},onAdd:function(e){var t=`leaflet-control-zoom`,n=create$1(`div`,t+` leaflet-bar`),s=this.options;return this._zoomInButton=this._createButton(s.zoomInText,s.zoomInTitle,t+`-in`,n,this._zoomIn),this._zoomOutButton=this._createButton(s.zoomOutText,s.zoomOutTitle,t+`-out`,n,this._zoomOut),this._updateDisabled(),e.on(`zoomend zoomlevelschange`,this._updateDisabled,this),n},onRemove:function(e){e.off(`zoomend zoomlevelschange`,this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(e){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(e.shiftKey?3:1))},_zoomOut:function(e){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(e.shiftKey?3:1))},_createButton:function(e,t,n,s,c){var l=create$1(`a`,n,s);return l.innerHTML=e,l.href=`#`,l.title=t,l.setAttribute(`role`,`button`),l.setAttribute(`aria-label`,t),disableClickPropagation(l),on(l,`click`,stop),on(l,`click`,c,this),on(l,`click`,this._refocusOnMap,this),l},_updateDisabled:function(){var e=this._map,t=`leaflet-disabled`;removeClass(this._zoomInButton,t),removeClass(this._zoomOutButton,t),this._zoomInButton.setAttribute(`aria-disabled`,`false`),this._zoomOutButton.setAttribute(`aria-disabled`,`false`),(this._disabled||e._zoom===e.getMinZoom())&&(addClass(this._zoomOutButton,t),this._zoomOutButton.setAttribute(`aria-disabled`,`true`)),(this._disabled||e._zoom===e.getMaxZoom())&&(addClass(this._zoomInButton,t),this._zoomInButton.setAttribute(`aria-disabled`,`true`))}});J.mergeOptions({zoomControl:!0}),J.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new He,this.addControl(this.zoomControl))});var zoom=function(e){return new He(e)},Ue=Be.extend({options:{position:`bottomleft`,maxWidth:100,metric:!0,imperial:!0},onAdd:function(e){var t=`leaflet-control-scale`,n=create$1(`div`,t),s=this.options;return this._addScales(s,t+`-line`,n),e.on(s.updateWhenIdle?`moveend`:`move`,this._update,this),e.whenReady(this._update,this),n},onRemove:function(e){e.off(this.options.updateWhenIdle?`moveend`:`move`,this._update,this)},_addScales:function(e,t,n){e.metric&&(this._mScale=create$1(`div`,t,n)),e.imperial&&(this._iScale=create$1(`div`,t,n))},_update:function(){var e=this._map,t=e.getSize().y/2,n=e.distance(e.containerPointToLatLng([0,t]),e.containerPointToLatLng([this.options.maxWidth,t]));this._updateScales(n)},_updateScales:function(e){this.options.metric&&e&&this._updateMetric(e),this.options.imperial&&e&&this._updateImperial(e)},_updateMetric:function(e){var t=this._getRoundNum(e),n=t<1e3?t+` m`:t/1e3+` km`;this._updateScale(this._mScale,n,t/e)},_updateImperial:function(e){var t=e*3.2808399,n,s,c;t>5280?(n=t/5280,s=this._getRoundNum(n),this._updateScale(this._iScale,s+` mi`,s/n)):(c=this._getRoundNum(t),this._updateScale(this._iScale,c+` ft`,c/t))},_updateScale:function(e,t,n){e.style.width=Math.round(this.options.maxWidth*n)+`px`,e.innerHTML=t},_getRoundNum:function(e){var t=10**((Math.floor(e)+``).length-1),n=e/t;return n=n>=10?10:n>=5?5:n>=3?3:n>=2?2:1,t*n}}),scale=function(e){return new Ue(e)},We=Be.extend({options:{position:`bottomright`,prefix:`<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">`+(U.inlineSvg?`<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg> `:``)+`Leaflet</a>`},initialize:function(e){setOptions(this,e),this._attributions={}},onAdd:function(e){for(var t in e.attributionControl=this,this._container=create$1(`div`,`leaflet-control-attribution`),disableClickPropagation(this._container),e._layers)e._layers[t].getAttribution&&this.addAttribution(e._layers[t].getAttribution());return this._update(),e.on(`layeradd`,this._addAttribution,this),this._container},onRemove:function(e){e.off(`layeradd`,this._addAttribution,this)},_addAttribution:function(e){e.layer.getAttribution&&(this.addAttribution(e.layer.getAttribution()),e.layer.once(`remove`,function(){this.removeAttribution(e.layer.getAttribution())},this))},setPrefix:function(e){return this.options.prefix=e,this._update(),this},addAttribution:function(e){return e?(this._attributions[e]||(this._attributions[e]=0),this._attributions[e]++,this._update(),this):this},removeAttribution:function(e){return e&&this._attributions[e]&&(this._attributions[e]--,this._update()),this},_update:function(){if(this._map){var e=[];for(var t in this._attributions)this._attributions[t]&&e.push(t);var n=[];this.options.prefix&&n.push(this.options.prefix),e.length&&n.push(e.join(`, `)),this._container.innerHTML=n.join(` <span aria-hidden="true">|</span> `)}}});J.mergeOptions({attributionControl:!0}),J.addInitHook(function(){this.options.attributionControl&&new We().addTo(this)});var attribution=function(e){return new We(e)};Be.Layers=Ve,Be.Zoom=He,Be.Scale=Ue,Be.Attribution=We,control.layers=layers,control.zoom=zoom,control.scale=scale,control.attribution=attribution;var Ge=Class.extend({initialize:function(e){this._map=e},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});Ge.addTo=function(e,t){return e.addHandler(t,this),this};var Ke={Events:g},qe=U.touch?`touchstart mousedown`:`mousedown`,Je=_.extend({options:{clickTolerance:3},initialize:function(e,t,n,s){setOptions(this,s),this._element=e,this._dragStartTarget=t||e,this._preventOutline=n},enable:function(){this._enabled||=(on(this._dragStartTarget,qe,this._onDown,this),!0)},disable:function(){this._enabled&&(Je._dragging===this&&this.finishDrag(!0),off(this._dragStartTarget,qe,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(e){if(this._enabled&&(this._moved=!1,!hasClass(this._element,`leaflet-zoom-anim`))){if(e.touches&&e.touches.length!==1){Je._dragging===this&&this.finishDrag();return}if(!(Je._dragging||e.shiftKey||e.which!==1&&e.button!==1&&!e.touches)&&(Je._dragging=this,this._preventOutline&&preventOutline(this._element),disableImageDrag(),disableTextSelection(),!this._moving)){this.fire(`down`);var t=e.touches?e.touches[0]:e,n=getSizedParentNode(this._element);this._startPoint=new Point(t.clientX,t.clientY),this._startPos=getPosition(this._element),this._parentScale=getScale(n);var s=e.type===`mousedown`;on(document,s?`mousemove`:`touchmove`,this._onMove,this),on(document,s?`mouseup`:`touchend touchcancel`,this._onUp,this)}}},_onMove:function(e){if(this._enabled){if(e.touches&&e.touches.length>1){this._moved=!0;return}var t=e.touches&&e.touches.length===1?e.touches[0]:e,n=new Point(t.clientX,t.clientY)._subtract(this._startPoint);!n.x&&!n.y||Math.abs(n.x)+Math.abs(n.y)<this.options.clickTolerance||(n.x/=this._parentScale.x,n.y/=this._parentScale.y,preventDefault(e),this._moved||(this.fire(`dragstart`),this._moved=!0,addClass(document.body,`leaflet-dragging`),this._lastTarget=e.target||e.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),addClass(this._lastTarget,`leaflet-drag-target`)),this._newPos=this._startPos.add(n),this._moving=!0,this._lastEvent=e,this._updatePosition())}},_updatePosition:function(){var e={originalEvent:this._lastEvent};this.fire(`predrag`,e),setPosition(this._element,this._newPos),this.fire(`drag`,e)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(e){removeClass(document.body,`leaflet-dragging`),this._lastTarget&&=(removeClass(this._lastTarget,`leaflet-drag-target`),null),off(document,`mousemove touchmove`,this._onMove,this),off(document,`mouseup touchend touchcancel`,this._onUp,this),enableImageDrag(),enableTextSelection();var t=this._moved&&this._moving;this._moving=!1,Je._dragging=!1,t&&this.fire(`dragend`,{noInertia:e,distance:this._newPos.distanceTo(this._startPos)})}});function clipPolygon(e,t,n){var s,c=[1,4,2,8],l,d,f,p,m,h,g,_;for(l=0,h=e.length;l<h;l++)e[l]._code=_getBitCode(e[l],t);for(f=0;f<4;f++){for(g=c[f],s=[],l=0,h=e.length,d=h-1;l<h;d=l++)p=e[l],m=e[d],p._code&g?m._code&g||(_=_getEdgeIntersection(m,p,g,t,n),_._code=_getBitCode(_,t),s.push(_)):(m._code&g&&(_=_getEdgeIntersection(m,p,g,t,n),_._code=_getBitCode(_,t),s.push(_)),s.push(p));e=s}return e}function polygonCenter(e,t){var n,s,c,l,d,f,p,m,h;if(!e||e.length===0)throw Error(`latlngs not passed`);isFlat(e)||(console.warn(`latlngs are not flat! Only the first ring will be used`),e=e[0]);var g=toLatLng([0,0]),_=toLatLngBounds(e);_.getNorthWest().distanceTo(_.getSouthWest())*_.getNorthEast().distanceTo(_.getNorthWest())<1700&&(g=centroid(e));var v=e.length,y=[];for(n=0;n<v;n++){var b=toLatLng(e[n]);y.push(t.project(toLatLng([b.lat-g.lat,b.lng-g.lng])))}for(f=p=m=0,n=0,s=v-1;n<v;s=n++)c=y[n],l=y[s],d=c.y*l.x-l.y*c.x,p+=(c.x+l.x)*d,m+=(c.y+l.y)*d,f+=d*3;h=f===0?y[0]:[p/f,m/f];var x=t.unproject(toPoint(h));return toLatLng([x.lat+g.lat,x.lng+g.lng])}function centroid(e){for(var t=0,n=0,s=0,c=0;c<e.length;c++){var l=toLatLng(e[c]);t+=l.lat,n+=l.lng,s++}return toLatLng([t/s,n/s])}var Ye={__proto__:null,clipPolygon,polygonCenter,centroid};function simplify(e,t){if(!t||!e.length)return e.slice();var n=t*t;return e=_reducePoints(e,n),e=_simplifyDP(e,n),e}function pointToSegmentDistance(e,t,n){return Math.sqrt(_sqClosestPointOnSegment(e,t,n,!0))}function closestPointOnSegment(e,t,n){return _sqClosestPointOnSegment(e,t,n)}function _simplifyDP(e,t){var n=e.length,s=new(typeof Uint8Array<`u`?Uint8Array:Array)(n);s[0]=s[n-1]=1,_simplifyDPStep(e,s,t,0,n-1);var c,l=[];for(c=0;c<n;c++)s[c]&&l.push(e[c]);return l}function _simplifyDPStep(e,t,n,s,c){var l=0,d,f,p;for(f=s+1;f<=c-1;f++)p=_sqClosestPointOnSegment(e[f],e[s],e[c],!0),p>l&&(d=f,l=p);l>n&&(t[d]=1,_simplifyDPStep(e,t,n,s,d),_simplifyDPStep(e,t,n,d,c))}function _reducePoints(e,t){for(var n=[e[0]],s=1,c=0,l=e.length;s<l;s++)_sqDist(e[s],e[c])>t&&(n.push(e[s]),c=s);return c<l-1&&n.push(e[l-1]),n}var Xe;function clipSegment(e,t,n,s,c){var l=s?Xe:_getBitCode(e,n),d=_getBitCode(t,n),f,p,m;for(Xe=d;;){if(!(l|d))return[e,t];if(l&d)return!1;f=l||d,p=_getEdgeIntersection(e,t,f,n,c),m=_getBitCode(p,n),f===l?(e=p,l=m):(t=p,d=m)}}function _getEdgeIntersection(e,t,n,s,c){var l=t.x-e.x,d=t.y-e.y,f=s.min,p=s.max,m,h;return n&8?(m=e.x+l*(p.y-e.y)/d,h=p.y):n&4?(m=e.x+l*(f.y-e.y)/d,h=f.y):n&2?(m=p.x,h=e.y+d*(p.x-e.x)/l):n&1&&(m=f.x,h=e.y+d*(f.x-e.x)/l),new Point(m,h,c)}function _getBitCode(e,t){var n=0;return e.x<t.min.x?n|=1:e.x>t.max.x&&(n|=2),e.y<t.min.y?n|=4:e.y>t.max.y&&(n|=8),n}function _sqDist(e,t){var n=t.x-e.x,s=t.y-e.y;return n*n+s*s}function _sqClosestPointOnSegment(e,t,n,s){var c=t.x,l=t.y,d=n.x-c,f=n.y-l,p=d*d+f*f,m;return p>0&&(m=((e.x-c)*d+(e.y-l)*f)/p,m>1?(c=n.x,l=n.y):m>0&&(c+=d*m,l+=f*m)),d=e.x-c,f=e.y-l,s?d*d+f*f:new Point(c,l)}function isFlat(e){return!l(e[0])||typeof e[0][0]!=`object`&&e[0][0]!==void 0}function _flat(e){return console.warn(`Deprecated use of _flat, please use L.LineUtil.isFlat instead.`),isFlat(e)}function polylineCenter(e,t){var n,s,c,l,d,f,p,m;if(!e||e.length===0)throw Error(`latlngs not passed`);isFlat(e)||(console.warn(`latlngs are not flat! Only the first ring will be used`),e=e[0]);var h=toLatLng([0,0]),g=toLatLngBounds(e);g.getNorthWest().distanceTo(g.getSouthWest())*g.getNorthEast().distanceTo(g.getNorthWest())<1700&&(h=centroid(e));var _=e.length,v=[];for(n=0;n<_;n++){var y=toLatLng(e[n]);v.push(t.project(toLatLng([y.lat-h.lat,y.lng-h.lng])))}for(n=0,s=0;n<_-1;n++)s+=v[n].distanceTo(v[n+1])/2;if(s===0)m=v[0];else for(n=0,l=0;n<_-1;n++)if(d=v[n],f=v[n+1],c=d.distanceTo(f),l+=c,l>s){p=(l-s)/c,m=[f.x-p*(f.x-d.x),f.y-p*(f.y-d.y)];break}var b=t.unproject(toPoint(m));return toLatLng([b.lat+h.lat,b.lng+h.lng])}var Ze={__proto__:null,simplify,pointToSegmentDistance,closestPointOnSegment,clipSegment,_getEdgeIntersection,_getBitCode,_sqClosestPointOnSegment,isFlat,_flat,polylineCenter},Qe={project:function(e){return new Point(e.lng,e.lat)},unproject:function(e){return new LatLng(e.y,e.x)},bounds:new Bounds([-180,-90],[180,90])},$e={R:6378137,R_MINOR:6356752.314245179,bounds:new Bounds([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(e){var t=Math.PI/180,n=this.R,s=e.lat*t,c=this.R_MINOR/n,l=Math.sqrt(1-c*c),d=l*Math.sin(s),f=Math.tan(Math.PI/4-s/2)/((1-d)/(1+d))**(l/2);return s=-n*Math.log(Math.max(f,1e-10)),new Point(e.lng*t*n,s)},unproject:function(e){for(var t=180/Math.PI,n=this.R,s=this.R_MINOR/n,c=Math.sqrt(1-s*s),l=Math.exp(-e.y/n),d=Math.PI/2-2*Math.atan(l),f=0,p=.1,m;f<15&&Math.abs(p)>1e-7;f++)m=c*Math.sin(d),m=((1-m)/(1+m))**(c/2),p=Math.PI/2-2*Math.atan(l*m)-d,d+=p;return new LatLng(d*t,e.x*t/n)}},et={__proto__:null,LonLat:Qe,Mercator:$e,SphericalMercator:S},tt=extend({},b,{code:`EPSG:3395`,projection:$e,transformation:function(){var e=.5/(Math.PI*$e.R);return toTransformation(e,.5,-e,.5)}()}),nt=extend({},b,{code:`EPSG:4326`,projection:Qe,transformation:toTransformation(1/180,1,-1/180,.5)}),rt=extend({},y,{projection:Qe,transformation:toTransformation(1,0,-1,0),scale:function(e){return 2**e},zoom:function(e){return Math.log(e)/Math.LN2},distance:function(e,t){var n=t.lng-e.lng,s=t.lat-e.lat;return Math.sqrt(n*n+s*s)},infinite:!0});y.Earth=b,y.EPSG3395=tt,y.EPSG3857=C,y.EPSG900913=T,y.EPSG4326=nt,y.Simple=rt;var it=_.extend({options:{pane:`overlayPane`,attribution:null,bubblingMouseEvents:!0},addTo:function(e){return e.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(e){return e&&e.removeLayer(this),this},getPane:function(e){return this._map.getPane(e?this.options[e]||e:this.options.pane)},addInteractiveTarget:function(e){return this._map._targets[stamp(e)]=this,this},removeInteractiveTarget:function(e){return delete this._map._targets[stamp(e)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(e){var t=e.target;if(t.hasLayer(this)){if(this._map=t,this._zoomAnimated=t._zoomAnimated,this.getEvents){var n=this.getEvents();t.on(n,this),this.once(`remove`,function(){t.off(n,this)},this)}this.onAdd(t),this.fire(`add`),t.fire(`layeradd`,{layer:this})}}});J.include({addLayer:function(e){if(!e._layerAdd)throw Error(`The provided object is not a Layer.`);var t=stamp(e);return this._layers[t]?this:(this._layers[t]=e,e._mapToAdd=this,e.beforeAdd&&e.beforeAdd(this),this.whenReady(e._layerAdd,e),this)},removeLayer:function(e){var t=stamp(e);return this._layers[t]?(this._loaded&&e.onRemove(this),delete this._layers[t],this._loaded&&(this.fire(`layerremove`,{layer:e}),e.fire(`remove`)),e._map=e._mapToAdd=null,this):this},hasLayer:function(e){return stamp(e)in this._layers},eachLayer:function(e,t){for(var n in this._layers)e.call(t,this._layers[n]);return this},_addLayers:function(e){e=e?l(e)?e:[e]:[];for(var t=0,n=e.length;t<n;t++)this.addLayer(e[t])},_addZoomLimit:function(e){(!isNaN(e.options.maxZoom)||!isNaN(e.options.minZoom))&&(this._zoomBoundLayers[stamp(e)]=e,this._updateZoomLevels())},_removeZoomLimit:function(e){var t=stamp(e);this._zoomBoundLayers[t]&&(delete this._zoomBoundLayers[t],this._updateZoomLevels())},_updateZoomLevels:function(){var e=1/0,t=-1/0,n=this._getZoomSpan();for(var s in this._zoomBoundLayers){var c=this._zoomBoundLayers[s].options;e=c.minZoom===void 0?e:Math.min(e,c.minZoom),t=c.maxZoom===void 0?t:Math.max(t,c.maxZoom)}this._layersMaxZoom=t===-1/0?void 0:t,this._layersMinZoom=e===1/0?void 0:e,n!==this._getZoomSpan()&&this.fire(`zoomlevelschange`),this.options.maxZoom===void 0&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var at=it.extend({initialize:function(e,t){setOptions(this,t),this._layers={};var n,s;if(e)for(n=0,s=e.length;n<s;n++)this.addLayer(e[n])},addLayer:function(e){var t=this.getLayerId(e);return this._layers[t]=e,this._map&&this._map.addLayer(e),this},removeLayer:function(e){var t=e in this._layers?e:this.getLayerId(e);return this._map&&this._layers[t]&&this._map.removeLayer(this._layers[t]),delete this._layers[t],this},hasLayer:function(e){return(typeof e==`number`?e:this.getLayerId(e))in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(e){var t=Array.prototype.slice.call(arguments,1),n,s;for(n in this._layers)s=this._layers[n],s[e]&&s[e].apply(s,t);return this},onAdd:function(e){this.eachLayer(e.addLayer,e)},onRemove:function(e){this.eachLayer(e.removeLayer,e)},eachLayer:function(e,t){for(var n in this._layers)e.call(t,this._layers[n]);return this},getLayer:function(e){return this._layers[e]},getLayers:function(){var e=[];return this.eachLayer(e.push,e),e},setZIndex:function(e){return this.invoke(`setZIndex`,e)},getLayerId:function(e){return stamp(e)}}),layerGroup=function(e,t){return new at(e,t)},ot=at.extend({addLayer:function(e){return this.hasLayer(e)?this:(e.addEventParent(this),at.prototype.addLayer.call(this,e),this.fire(`layeradd`,{layer:e}))},removeLayer:function(e){return this.hasLayer(e)?(e in this._layers&&(e=this._layers[e]),e.removeEventParent(this),at.prototype.removeLayer.call(this,e),this.fire(`layerremove`,{layer:e})):this},setStyle:function(e){return this.invoke(`setStyle`,e)},bringToFront:function(){return this.invoke(`bringToFront`)},bringToBack:function(){return this.invoke(`bringToBack`)},getBounds:function(){var e=new LatLngBounds;for(var t in this._layers){var n=this._layers[t];e.extend(n.getBounds?n.getBounds():n.getLatLng())}return e}}),featureGroup=function(e,t){return new ot(e,t)},st=Class.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(e){setOptions(this,e)},createIcon:function(e){return this._createIcon(`icon`,e)},createShadow:function(e){return this._createIcon(`shadow`,e)},_createIcon:function(e,t){var n=this._getIconUrl(e);if(!n){if(e===`icon`)throw Error(`iconUrl not set in Icon options (see the docs).`);return null}var s=this._createImg(n,t&&t.tagName===`IMG`?t:null);return this._setIconStyles(s,e),(this.options.crossOrigin||this.options.crossOrigin===``)&&(s.crossOrigin=this.options.crossOrigin===!0?``:this.options.crossOrigin),s},_setIconStyles:function(e,t){var n=this.options,s=n[t+`Size`];typeof s==`number`&&(s=[s,s]);var c=toPoint(s),l=toPoint(t===`shadow`&&n.shadowAnchor||n.iconAnchor||c&&c.divideBy(2,!0));e.className=`leaflet-marker-`+t+` `+(n.className||``),l&&(e.style.marginLeft=-l.x+`px`,e.style.marginTop=-l.y+`px`),c&&(e.style.width=c.x+`px`,e.style.height=c.y+`px`)},_createImg:function(e,t){return t||=document.createElement(`img`),t.src=e,t},_getIconUrl:function(e){return U.retina&&this.options[e+`RetinaUrl`]||this.options[e+`Url`]}});function icon(e){return new st(e)}var ct=st.extend({options:{iconUrl:`marker-icon.png`,iconRetinaUrl:`marker-icon-2x.png`,shadowUrl:`marker-shadow.png`,iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(e){return typeof ct.imagePath!=`string`&&(ct.imagePath=this._detectIconPath()),(this.options.imagePath||ct.imagePath)+st.prototype._getIconUrl.call(this,e)},_stripUrl:function(e){var strip=function(e,t,n){var s=t.exec(e);return s&&s[n]};return e=strip(e,/^url\((['"])?(.+)\1\)$/,2),e&&strip(e,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var e=create$1(`div`,`leaflet-default-icon-path`,document.body),t=getStyle(e,`background-image`)||getStyle(e,`backgroundImage`);if(document.body.removeChild(e),t=this._stripUrl(t),t)return t;var n=document.querySelector(`link[href$="leaflet.css"]`);return n?n.href.substring(0,n.href.length-11-1):``}}),lt=Ge.extend({initialize:function(e){this._marker=e},addHooks:function(){var e=this._marker._icon;this._draggable||=new Je(e,e,!0),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),addClass(e,`leaflet-marker-draggable`)},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&removeClass(this._marker._icon,`leaflet-marker-draggable`)},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(e){var t=this._marker,n=t._map,s=this._marker.options.autoPanSpeed,c=this._marker.options.autoPanPadding,l=getPosition(t._icon),d=n.getPixelBounds(),f=n.getPixelOrigin(),p=toBounds(d.min._subtract(f).add(c),d.max._subtract(f).subtract(c));if(!p.contains(l)){var m=toPoint((Math.max(p.max.x,l.x)-p.max.x)/(d.max.x-p.max.x)-(Math.min(p.min.x,l.x)-p.min.x)/(d.min.x-p.min.x),(Math.max(p.max.y,l.y)-p.max.y)/(d.max.y-p.max.y)-(Math.min(p.min.y,l.y)-p.min.y)/(d.min.y-p.min.y)).multiplyBy(s);n.panBy(m,{animate:!1}),this._draggable._newPos._add(m),this._draggable._startPos._add(m),setPosition(t._icon,this._draggable._newPos),this._onDrag(e),this._panRequest=requestAnimFrame(this._adjustPan.bind(this,e))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire(`movestart`).fire(`dragstart`)},_onPreDrag:function(e){this._marker.options.autoPan&&(cancelAnimFrame(this._panRequest),this._panRequest=requestAnimFrame(this._adjustPan.bind(this,e)))},_onDrag:function(e){var t=this._marker,n=t._shadow,s=getPosition(t._icon),c=t._map.layerPointToLatLng(s);n&&setPosition(n,s),t._latlng=c,e.latlng=c,e.oldLatLng=this._oldLatLng,t.fire(`move`,e).fire(`drag`,e)},_onDragEnd:function(e){cancelAnimFrame(this._panRequest),delete this._oldLatLng,this._marker.fire(`moveend`).fire(`dragend`,e)}}),ut=it.extend({options:{icon:new ct,interactive:!0,keyboard:!0,title:``,alt:`Marker`,zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:`markerPane`,shadowPane:`shadowPane`,bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(e,t){setOptions(this,t),this._latlng=toLatLng(e)},onAdd:function(e){this._zoomAnimated=this._zoomAnimated&&e.options.markerZoomAnimation,this._zoomAnimated&&e.on(`zoomanim`,this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(e){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&e.off(`zoomanim`,this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(e){var t=this._latlng;return this._latlng=toLatLng(e),this.update(),this.fire(`move`,{oldLatLng:t,latlng:this._latlng})},setZIndexOffset:function(e){return this.options.zIndexOffset=e,this.update()},getIcon:function(){return this.options.icon},setIcon:function(e){return this.options.icon=e,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var e=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(e)}return this},_initIcon:function(){var e=this.options,t=`leaflet-zoom-`+(this._zoomAnimated?`animated`:`hide`),n=e.icon.createIcon(this._icon),s=!1;n!==this._icon&&(this._icon&&this._removeIcon(),s=!0,e.title&&(n.title=e.title),n.tagName===`IMG`&&(n.alt=e.alt||``)),addClass(n,t),e.keyboard&&(n.tabIndex=`0`,n.setAttribute(`role`,`button`)),this._icon=n,e.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&on(n,`focus`,this._panOnFocus,this);var c=e.icon.createShadow(this._shadow),l=!1;c!==this._shadow&&(this._removeShadow(),l=!0),c&&(addClass(c,t),c.alt=``),this._shadow=c,e.opacity<1&&this._updateOpacity(),s&&this.getPane().appendChild(this._icon),this._initInteraction(),c&&l&&this.getPane(e.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&off(this._icon,`focus`,this._panOnFocus,this),remove(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&remove(this._shadow),this._shadow=null},_setPos:function(e){this._icon&&setPosition(this._icon,e),this._shadow&&setPosition(this._shadow,e),this._zIndex=e.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(e){this._icon&&(this._icon.style.zIndex=this._zIndex+e)},_animateZoom:function(e){var t=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center).round();this._setPos(t)},_initInteraction:function(){if(this.options.interactive&&(addClass(this._icon,`leaflet-interactive`),this.addInteractiveTarget(this._icon),lt)){var e=this.options.draggable;this.dragging&&(e=this.dragging.enabled(),this.dragging.disable()),this.dragging=new lt(this),e&&this.dragging.enable()}},setOpacity:function(e){return this.options.opacity=e,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var e=this.options.opacity;this._icon&&setOpacity(this._icon,e),this._shadow&&setOpacity(this._shadow,e)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var e=this._map;if(e){var t=this.options.icon.options,n=t.iconSize?toPoint(t.iconSize):toPoint(0,0),s=t.iconAnchor?toPoint(t.iconAnchor):toPoint(0,0);e.panInside(this._latlng,{paddingTopLeft:s,paddingBottomRight:n.subtract(s)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function marker(e,t){return new ut(e,t)}var dt=it.extend({options:{stroke:!0,color:`#3388ff`,weight:3,opacity:1,lineCap:`round`,lineJoin:`round`,dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:`evenodd`,interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(e){this._renderer=e.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(e){return setOptions(this,e),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&e&&Object.prototype.hasOwnProperty.call(e,`weight`)&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),ft=dt.extend({options:{fill:!0,radius:10},initialize:function(e,t){setOptions(this,t),this._latlng=toLatLng(e),this._radius=this.options.radius},setLatLng:function(e){var t=this._latlng;return this._latlng=toLatLng(e),this.redraw(),this.fire(`move`,{oldLatLng:t,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(e){return this.options.radius=this._radius=e,this.redraw()},getRadius:function(){return this._radius},setStyle:function(e){var t=e&&e.radius||this._radius;return dt.prototype.setStyle.call(this,e),this.setRadius(t),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var e=this._radius,t=this._radiusY||e,n=this._clickTolerance(),s=[e+n,t+n];this._pxBounds=new Bounds(this._point.subtract(s),this._point.add(s))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(e){return e.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function circleMarker(e,t){return new ft(e,t)}var pt=ft.extend({initialize:function(e,t,n){if(typeof t==`number`&&(t=extend({},n,{radius:t})),setOptions(this,t),this._latlng=toLatLng(e),isNaN(this.options.radius))throw Error(`Circle radius cannot be NaN`);this._mRadius=this.options.radius},setRadius:function(e){return this._mRadius=e,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var e=[this._radius,this._radiusY||this._radius];return new LatLngBounds(this._map.layerPointToLatLng(this._point.subtract(e)),this._map.layerPointToLatLng(this._point.add(e)))},setStyle:dt.prototype.setStyle,_project:function(){var e=this._latlng.lng,t=this._latlng.lat,n=this._map,s=n.options.crs;if(s.distance===b.distance){var c=Math.PI/180,l=this._mRadius/b.R/c,d=n.project([t+l,e]),f=n.project([t-l,e]),p=d.add(f).divideBy(2),m=n.unproject(p).lat,h=Math.acos((Math.cos(l*c)-Math.sin(t*c)*Math.sin(m*c))/(Math.cos(t*c)*Math.cos(m*c)))/c;(isNaN(h)||h===0)&&(h=l/Math.cos(Math.PI/180*t)),this._point=p.subtract(n.getPixelOrigin()),this._radius=isNaN(h)?0:p.x-n.project([m,e-h]).x,this._radiusY=p.y-d.y}else{var g=s.unproject(s.project(this._latlng).subtract([this._mRadius,0]));this._point=n.latLngToLayerPoint(this._latlng),this._radius=this._point.x-n.latLngToLayerPoint(g).x}this._updateBounds()}});function circle(e,t,n){return new pt(e,t,n)}var mt=dt.extend({options:{smoothFactor:1,noClip:!1},initialize:function(e,t){setOptions(this,t),this._setLatLngs(e)},getLatLngs:function(){return this._latlngs},setLatLngs:function(e){return this._setLatLngs(e),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(e){for(var t=1/0,n=null,s=_sqClosestPointOnSegment,c,l,d=0,f=this._parts.length;d<f;d++)for(var p=this._parts[d],m=1,h=p.length;m<h;m++){c=p[m-1],l=p[m];var g=s(e,c,l,!0);g<t&&(t=g,n=s(e,c,l))}return n&&(n.distance=Math.sqrt(t)),n},getCenter:function(){if(!this._map)throw Error(`Must add layer to map before using getCenter()`);return polylineCenter(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(e,t){return t||=this._defaultShape(),e=toLatLng(e),t.push(e),this._bounds.extend(e),this.redraw()},_setLatLngs:function(e){this._bounds=new LatLngBounds,this._latlngs=this._convertLatLngs(e)},_defaultShape:function(){return isFlat(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(e){for(var t=[],n=isFlat(e),s=0,c=e.length;s<c;s++)n?(t[s]=toLatLng(e[s]),this._bounds.extend(t[s])):t[s]=this._convertLatLngs(e[s]);return t},_project:function(){var e=new Bounds;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,e),this._bounds.isValid()&&e.isValid()&&(this._rawPxBounds=e,this._updateBounds())},_updateBounds:function(){var e=this._clickTolerance(),t=new Point(e,e);this._rawPxBounds&&(this._pxBounds=new Bounds([this._rawPxBounds.min.subtract(t),this._rawPxBounds.max.add(t)]))},_projectLatlngs:function(e,t,n){var s=e[0]instanceof LatLng,c=e.length,l,d;if(s){for(d=[],l=0;l<c;l++)d[l]=this._map.latLngToLayerPoint(e[l]),n.extend(d[l]);t.push(d)}else for(l=0;l<c;l++)this._projectLatlngs(e[l],t,n)},_clipPoints:function(){var e=this._renderer._bounds;if(this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(e))){if(this.options.noClip){this._parts=this._rings;return}var t=this._parts,n,s,c,l,d,f,p;for(n=0,c=0,l=this._rings.length;n<l;n++)for(p=this._rings[n],s=0,d=p.length;s<d-1;s++)f=clipSegment(p[s],p[s+1],e,s,!0),f&&(t[c]=t[c]||[],t[c].push(f[0]),(f[1]!==p[s+1]||s===d-2)&&(t[c].push(f[1]),c++))}},_simplifyPoints:function(){for(var e=this._parts,t=this.options.smoothFactor,n=0,s=e.length;n<s;n++)e[n]=simplify(e[n],t)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(e,t){var n,s,c,l,d,f,p=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(e))return!1;for(n=0,l=this._parts.length;n<l;n++)for(f=this._parts[n],s=0,d=f.length,c=d-1;s<d;c=s++)if(!(!t&&s===0)&&pointToSegmentDistance(e,f[c],f[s])<=p)return!0;return!1}});function polyline(e,t){return new mt(e,t)}mt._flat=_flat;var ht=mt.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw Error(`Must add layer to map before using getCenter()`);return polygonCenter(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(e){var t=mt.prototype._convertLatLngs.call(this,e),n=t.length;return n>=2&&t[0]instanceof LatLng&&t[0].equals(t[n-1])&&t.pop(),t},_setLatLngs:function(e){mt.prototype._setLatLngs.call(this,e),isFlat(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return isFlat(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var e=this._renderer._bounds,t=this.options.weight,n=new Point(t,t);if(e=new Bounds(e.min.subtract(n),e.max.add(n)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(e))){if(this.options.noClip){this._parts=this._rings;return}for(var s=0,c=this._rings.length,l;s<c;s++)l=clipPolygon(this._rings[s],e,!0),l.length&&this._parts.push(l)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(e){var t=!1,n,s,c,l,d,f,p,m;if(!this._pxBounds||!this._pxBounds.contains(e))return!1;for(l=0,p=this._parts.length;l<p;l++)for(n=this._parts[l],d=0,m=n.length,f=m-1;d<m;f=d++)s=n[d],c=n[f],s.y>e.y!=c.y>e.y&&e.x<(c.x-s.x)*(e.y-s.y)/(c.y-s.y)+s.x&&(t=!t);return t||mt.prototype._containsPoint.call(this,e,!0)}});function polygon(e,t){return new ht(e,t)}var gt=ot.extend({initialize:function(e,t){setOptions(this,t),this._layers={},e&&this.addData(e)},addData:function(e){var t=l(e)?e:e.features,n,s,c;if(t){for(n=0,s=t.length;n<s;n++)c=t[n],(c.geometries||c.geometry||c.features||c.coordinates)&&this.addData(c);return this}var d=this.options;if(d.filter&&!d.filter(e))return this;var f=geometryToLayer(e,d);return f?(f.feature=asFeature(e),f.defaultOptions=f.options,this.resetStyle(f),d.onEachFeature&&d.onEachFeature(e,f),this.addLayer(f)):this},resetStyle:function(e){return e===void 0?this.eachLayer(this.resetStyle,this):(e.options=extend({},e.defaultOptions),this._setLayerStyle(e,this.options.style),this)},setStyle:function(e){return this.eachLayer(function(t){this._setLayerStyle(t,e)},this)},_setLayerStyle:function(e,t){e.setStyle&&(typeof t==`function`&&(t=t(e.feature)),e.setStyle(t))}});function geometryToLayer(e,t){var n=e.type===`Feature`?e.geometry:e,s=n?n.coordinates:null,c=[],l=t&&t.pointToLayer,d=t&&t.coordsToLatLng||coordsToLatLng,f,p,m,h;if(!s&&!n)return null;switch(n.type){case`Point`:return f=d(s),_pointToLayer(l,e,f,t);case`MultiPoint`:for(m=0,h=s.length;m<h;m++)f=d(s[m]),c.push(_pointToLayer(l,e,f,t));return new ot(c);case`LineString`:case`MultiLineString`:return p=coordsToLatLngs(s,n.type===`LineString`?0:1,d),new mt(p,t);case`Polygon`:case`MultiPolygon`:return p=coordsToLatLngs(s,n.type===`Polygon`?1:2,d),new ht(p,t);case`GeometryCollection`:for(m=0,h=n.geometries.length;m<h;m++){var g=geometryToLayer({geometry:n.geometries[m],type:`Feature`,properties:e.properties},t);g&&c.push(g)}return new ot(c);case`FeatureCollection`:for(m=0,h=n.features.length;m<h;m++){var _=geometryToLayer(n.features[m],t);_&&c.push(_)}return new ot(c);default:throw Error(`Invalid GeoJSON object.`)}}function _pointToLayer(e,t,n,s){return e?e(t,n):new ut(n,s&&s.markersInheritOptions&&s)}function coordsToLatLng(e){return new LatLng(e[1],e[0],e[2])}function coordsToLatLngs(e,t,n){for(var s=[],c=0,l=e.length,d;c<l;c++)d=t?coordsToLatLngs(e[c],t-1,n):(n||coordsToLatLng)(e[c]),s.push(d);return s}function latLngToCoords(e,t){return e=toLatLng(e),e.alt===void 0?[formatNum(e.lng,t),formatNum(e.lat,t)]:[formatNum(e.lng,t),formatNum(e.lat,t),formatNum(e.alt,t)]}function latLngsToCoords(e,t,n,s){for(var c=[],l=0,d=e.length;l<d;l++)c.push(t?latLngsToCoords(e[l],isFlat(e[l])?0:t-1,n,s):latLngToCoords(e[l],s));return!t&&n&&c.length>0&&c.push(c[0].slice()),c}function getFeature(e,t){return e.feature?extend({},e.feature,{geometry:t}):asFeature(t)}function asFeature(e){return e.type===`Feature`||e.type===`FeatureCollection`?e:{type:`Feature`,properties:{},geometry:e}}var _t={toGeoJSON:function(e){return getFeature(this,{type:`Point`,coordinates:latLngToCoords(this.getLatLng(),e)})}};ut.include(_t),pt.include(_t),ft.include(_t),mt.include({toGeoJSON:function(e){var t=!isFlat(this._latlngs),n=latLngsToCoords(this._latlngs,+!!t,!1,e);return getFeature(this,{type:(t?`Multi`:``)+`LineString`,coordinates:n})}}),ht.include({toGeoJSON:function(e){var t=!isFlat(this._latlngs),n=t&&!isFlat(this._latlngs[0]),s=latLngsToCoords(this._latlngs,n?2:+!!t,!0,e);return t||(s=[s]),getFeature(this,{type:(n?`Multi`:``)+`Polygon`,coordinates:s})}}),at.include({toMultiPoint:function(e){var t=[];return this.eachLayer(function(n){t.push(n.toGeoJSON(e).geometry.coordinates)}),getFeature(this,{type:`MultiPoint`,coordinates:t})},toGeoJSON:function(e){var t=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(t===`MultiPoint`)return this.toMultiPoint(e);var n=t===`GeometryCollection`,s=[];return this.eachLayer(function(t){if(t.toGeoJSON){var c=t.toGeoJSON(e);if(n)s.push(c.geometry);else{var l=asFeature(c);l.type===`FeatureCollection`?s.push.apply(s,l.features):s.push(l)}}}),n?getFeature(this,{geometries:s,type:`GeometryCollection`}):{type:`FeatureCollection`,features:s}}});function geoJSON(e,t){return new gt(e,t)}var vt=geoJSON,yt=it.extend({options:{opacity:1,alt:``,interactive:!1,crossOrigin:!1,errorOverlayUrl:``,zIndex:1,className:``},initialize:function(e,t,n){this._url=e,this._bounds=toLatLngBounds(t),setOptions(this,n)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(addClass(this._image,`leaflet-interactive`),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){remove(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(e){return this.options.opacity=e,this._image&&this._updateOpacity(),this},setStyle:function(e){return e.opacity&&this.setOpacity(e.opacity),this},bringToFront:function(){return this._map&&toFront(this._image),this},bringToBack:function(){return this._map&&toBack(this._image),this},setUrl:function(e){return this._url=e,this._image&&(this._image.src=e),this},setBounds:function(e){return this._bounds=toLatLngBounds(e),this._map&&this._reset(),this},getEvents:function(){var e={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(e.zoomanim=this._animateZoom),e},setZIndex:function(e){return this.options.zIndex=e,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var e=this._url.tagName===`IMG`,t=this._image=e?this._url:create$1(`img`);if(addClass(t,`leaflet-image-layer`),this._zoomAnimated&&addClass(t,`leaflet-zoom-animated`),this.options.className&&addClass(t,this.options.className),t.onselectstart=falseFn,t.onmousemove=falseFn,t.onload=bind(this.fire,this,`load`),t.onerror=bind(this._overlayOnError,this,`error`),(this.options.crossOrigin||this.options.crossOrigin===``)&&(t.crossOrigin=this.options.crossOrigin===!0?``:this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),e){this._url=t.src;return}t.src=this._url,t.alt=this.options.alt},_animateZoom:function(e){var t=this._map.getZoomScale(e.zoom),n=this._map._latLngBoundsToNewLayerBounds(this._bounds,e.zoom,e.center).min;setTransform(this._image,n,t)},_reset:function(){var e=this._image,t=new Bounds(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),n=t.getSize();setPosition(e,t.min),e.style.width=n.x+`px`,e.style.height=n.y+`px`},_updateOpacity:function(){setOpacity(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire(`error`);var e=this.options.errorOverlayUrl;e&&this._url!==e&&(this._url=e,this._image.src=e)},getCenter:function(){return this._bounds.getCenter()}}),imageOverlay=function(e,t,n){return new yt(e,t,n)},bt=yt.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var e=this._url.tagName===`VIDEO`,t=this._image=e?this._url:create$1(`video`);if(addClass(t,`leaflet-image-layer`),this._zoomAnimated&&addClass(t,`leaflet-zoom-animated`),this.options.className&&addClass(t,this.options.className),t.onselectstart=falseFn,t.onmousemove=falseFn,t.onloadeddata=bind(this.fire,this,`load`),e){for(var n=t.getElementsByTagName(`source`),s=[],c=0;c<n.length;c++)s.push(n[c].src);this._url=n.length>0?s:[t.src];return}l(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(t.style,`objectFit`)&&(t.style.objectFit=`fill`),t.autoplay=!!this.options.autoplay,t.loop=!!this.options.loop,t.muted=!!this.options.muted,t.playsInline=!!this.options.playsInline;for(var d=0;d<this._url.length;d++){var f=create$1(`source`);f.src=this._url[d],t.appendChild(f)}}});function videoOverlay(e,t,n){return new bt(e,t,n)}var xt=yt.extend({_initImage:function(){var e=this._image=this._url;addClass(e,`leaflet-image-layer`),this._zoomAnimated&&addClass(e,`leaflet-zoom-animated`),this.options.className&&addClass(e,this.options.className),e.onselectstart=falseFn,e.onmousemove=falseFn}});function svgOverlay(e,t,n){return new xt(e,t,n)}var St=it.extend({options:{interactive:!1,offset:[0,0],className:``,pane:void 0,content:``},initialize:function(e,t){e&&(e instanceof LatLng||l(e))?(this._latlng=toLatLng(e),setOptions(this,t)):(setOptions(this,e),this._source=t),this.options.content&&(this._content=this.options.content)},openOn:function(e){return e=arguments.length?e:this._source._map,e.hasLayer(this)||e.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(e){return this._map?this.close():(arguments.length?this._source=e:e=this._source,this._prepareOpen(),this.openOn(e._map)),this},onAdd:function(e){this._zoomAnimated=e._zoomAnimated,this._container||this._initLayout(),e._fadeAnimated&&setOpacity(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),e._fadeAnimated&&setOpacity(this._container,1),this.bringToFront(),this.options.interactive&&(addClass(this._container,`leaflet-interactive`),this.addInteractiveTarget(this._container))},onRemove:function(e){e._fadeAnimated?(setOpacity(this._container,0),this._removeTimeout=setTimeout(bind(remove,void 0,this._container),200)):remove(this._container),this.options.interactive&&(removeClass(this._container,`leaflet-interactive`),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(e){return this._latlng=toLatLng(e),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(e){return this._content=e,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility=`hidden`,this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility=``,this._adjustPan())},getEvents:function(){var e={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(e.zoomanim=this._animateZoom),e},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&toFront(this._container),this},bringToBack:function(){return this._map&&toBack(this._container),this},_prepareOpen:function(e){var t=this._source;if(!t._map)return!1;if(t instanceof ot){t=null;var n=this._source._layers;for(var s in n)if(n[s]._map){t=n[s];break}if(!t)return!1;this._source=t}if(!e)if(t.getCenter)e=t.getCenter();else if(t.getLatLng)e=t.getLatLng();else if(t.getBounds)e=t.getBounds().getCenter();else throw Error(`Unable to get source layer LatLng.`);return this.setLatLng(e),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var e=this._contentNode,t=typeof this._content==`function`?this._content(this._source||this):this._content;if(typeof t==`string`)e.innerHTML=t;else{for(;e.hasChildNodes();)e.removeChild(e.firstChild);e.appendChild(t)}this.fire(`contentupdate`)}},_updatePosition:function(){if(this._map){var e=this._map.latLngToLayerPoint(this._latlng),t=toPoint(this.options.offset),n=this._getAnchor();this._zoomAnimated?setPosition(this._container,e.add(n)):t=t.add(e).add(n);var s=this._containerBottom=-t.y,c=this._containerLeft=-Math.round(this._containerWidth/2)+t.x;this._container.style.bottom=s+`px`,this._container.style.left=c+`px`}},_getAnchor:function(){return[0,0]}});J.include({_initOverlay:function(e,t,n,s){var c=t;return c instanceof e||(c=new e(s).setContent(t)),n&&c.setLatLng(n),c}}),it.include({_initOverlay:function(e,t,n,s){var c=n;return c instanceof e?(setOptions(c,s),c._source=this):(c=t&&!s?t:new e(s,this),c.setContent(n)),c}});var Ct=St.extend({options:{pane:`popupPane`,offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:``},openOn:function(e){return e=arguments.length?e:this._source._map,!e.hasLayer(this)&&e._popup&&e._popup.options.autoClose&&e.removeLayer(e._popup),e._popup=this,St.prototype.openOn.call(this,e)},onAdd:function(e){St.prototype.onAdd.call(this,e),e.fire(`popupopen`,{popup:this}),this._source&&(this._source.fire(`popupopen`,{popup:this},!0),this._source instanceof dt||this._source.on(`preclick`,stopPropagation))},onRemove:function(e){St.prototype.onRemove.call(this,e),e.fire(`popupclose`,{popup:this}),this._source&&(this._source.fire(`popupclose`,{popup:this},!0),this._source instanceof dt||this._source.off(`preclick`,stopPropagation))},getEvents:function(){var e=St.prototype.getEvents.call(this);return(this.options.closeOnClick===void 0?this._map.options.closePopupOnClick:this.options.closeOnClick)&&(e.preclick=this.close),this.options.keepInView&&(e.moveend=this._adjustPan),e},_initLayout:function(){var e=`leaflet-popup`,t=this._container=create$1(`div`,e+` `+(this.options.className||``)+` leaflet-zoom-animated`),n=this._wrapper=create$1(`div`,e+`-content-wrapper`,t);if(this._contentNode=create$1(`div`,e+`-content`,n),disableClickPropagation(t),disableScrollPropagation(this._contentNode),on(t,`contextmenu`,stopPropagation),this._tipContainer=create$1(`div`,e+`-tip-container`,t),this._tip=create$1(`div`,e+`-tip`,this._tipContainer),this.options.closeButton){var s=this._closeButton=create$1(`a`,e+`-close-button`,t);s.setAttribute(`role`,`button`),s.setAttribute(`aria-label`,`Close popup`),s.href=`#close`,s.innerHTML=`<span aria-hidden="true">&#215;</span>`,on(s,`click`,function(e){preventDefault(e),this.close()},this)}},_updateLayout:function(){var e=this._contentNode,t=e.style;t.width=``,t.whiteSpace=`nowrap`;var n=e.offsetWidth;n=Math.min(n,this.options.maxWidth),n=Math.max(n,this.options.minWidth),t.width=n+1+`px`,t.whiteSpace=``,t.height=``;var s=e.offsetHeight,c=this.options.maxHeight,l=`leaflet-popup-scrolled`;c&&s>c?(t.height=c+`px`,addClass(e,l)):removeClass(e,l),this._containerWidth=this._container.offsetWidth},_animateZoom:function(e){var t=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center),n=this._getAnchor();setPosition(this._container,t.add(n))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var e=this._map,t=parseInt(getStyle(this._container,`marginBottom`),10)||0,n=this._container.offsetHeight+t,s=this._containerWidth,c=new Point(this._containerLeft,-n-this._containerBottom);c._add(getPosition(this._container));var l=e.layerPointToContainerPoint(c),d=toPoint(this.options.autoPanPadding),f=toPoint(this.options.autoPanPaddingTopLeft||d),p=toPoint(this.options.autoPanPaddingBottomRight||d),m=e.getSize(),h=0,g=0;l.x+s+p.x>m.x&&(h=l.x+s-m.x+p.x),l.x-h-f.x<0&&(h=l.x-f.x),l.y+n+p.y>m.y&&(g=l.y+n-m.y+p.y),l.y-g-f.y<0&&(g=l.y-f.y),(h||g)&&(this.options.keepInView&&(this._autopanning=!0),e.fire(`autopanstart`).panBy([h,g]))}},_getAnchor:function(){return toPoint(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),popup=function(e,t){return new Ct(e,t)};J.mergeOptions({closePopupOnClick:!0}),J.include({openPopup:function(e,t,n){return this._initOverlay(Ct,e,t,n).openOn(this),this},closePopup:function(e){return e=arguments.length?e:this._popup,e&&e.close(),this}}),it.include({bindPopup:function(e,t){return this._popup=this._initOverlay(Ct,this._popup,e,t),this._popupHandlersAdded||=(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),!0),this},unbindPopup:function(){return this._popup&&=(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,null),this},openPopup:function(e){return this._popup&&(this instanceof ot||(this._popup._source=this),this._popup._prepareOpen(e||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(e){return this._popup&&this._popup.setContent(e),this},getPopup:function(){return this._popup},_openPopup:function(e){if(!(!this._popup||!this._map)){stop(e);var t=e.layer||e.target;if(this._popup._source===t&&!(t instanceof dt)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(e.latlng);return}this._popup._source=t,this.openPopup(e.latlng)}},_movePopup:function(e){this._popup.setLatLng(e.latlng)},_onKeyPress:function(e){e.originalEvent.keyCode===13&&this._openPopup(e)}});var wt=St.extend({options:{pane:`tooltipPane`,offset:[0,0],direction:`auto`,permanent:!1,sticky:!1,opacity:.9},onAdd:function(e){St.prototype.onAdd.call(this,e),this.setOpacity(this.options.opacity),e.fire(`tooltipopen`,{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire(`tooltipopen`,{tooltip:this},!0))},onRemove:function(e){St.prototype.onRemove.call(this,e),e.fire(`tooltipclose`,{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire(`tooltipclose`,{tooltip:this},!0))},getEvents:function(){var e=St.prototype.getEvents.call(this);return this.options.permanent||(e.preclick=this.close),e},_initLayout:function(){var e=`leaflet-tooltip `+(this.options.className||``)+` leaflet-zoom-`+(this._zoomAnimated?`animated`:`hide`);this._contentNode=this._container=create$1(`div`,e),this._container.setAttribute(`role`,`tooltip`),this._container.setAttribute(`id`,`leaflet-tooltip-`+stamp(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(e){var t,n,s=this._map,c=this._container,l=s.latLngToContainerPoint(s.getCenter()),d=s.layerPointToContainerPoint(e),f=this.options.direction,p=c.offsetWidth,m=c.offsetHeight,h=toPoint(this.options.offset),g=this._getAnchor();f===`top`?(t=p/2,n=m):f===`bottom`?(t=p/2,n=0):f===`center`?(t=p/2,n=m/2):f===`right`?(t=0,n=m/2):f===`left`?(t=p,n=m/2):d.x<l.x?(f=`right`,t=0,n=m/2):(f=`left`,t=p+(h.x+g.x)*2,n=m/2),e=e.subtract(toPoint(t,n,!0)).add(h).add(g),removeClass(c,`leaflet-tooltip-right`),removeClass(c,`leaflet-tooltip-left`),removeClass(c,`leaflet-tooltip-top`),removeClass(c,`leaflet-tooltip-bottom`),addClass(c,`leaflet-tooltip-`+f),setPosition(c,e)},_updatePosition:function(){var e=this._map.latLngToLayerPoint(this._latlng);this._setPosition(e)},setOpacity:function(e){this.options.opacity=e,this._container&&setOpacity(this._container,e)},_animateZoom:function(e){var t=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center);this._setPosition(t)},_getAnchor:function(){return toPoint(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),tooltip=function(e,t){return new wt(e,t)};J.include({openTooltip:function(e,t,n){return this._initOverlay(wt,e,t,n).openOn(this),this},closeTooltip:function(e){return e.close(),this}}),it.include({bindTooltip:function(e,t){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(wt,this._tooltip,e,t),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&=(this._initTooltipInteractions(!0),this.closeTooltip(),null),this},_initTooltipInteractions:function(e){if(!(!e&&this._tooltipHandlersAdded)){var t=e?`off`:`on`,n={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?n.add=this._openTooltip:(n.mouseover=this._openTooltip,n.mouseout=this.closeTooltip,n.click=this._openTooltip,this._map?this._addFocusListeners():n.add=this._addFocusListeners),this._tooltip.options.sticky&&(n.mousemove=this._moveTooltip),this[t](n),this._tooltipHandlersAdded=!e}},openTooltip:function(e){return this._tooltip&&(this instanceof ot||(this._tooltip._source=this),this._tooltip._prepareOpen(e)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(e){return this._tooltip&&this._tooltip.setContent(e),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(e){var t=typeof e.getElement==`function`&&e.getElement();t&&(on(t,`focus`,function(){this._tooltip._source=e,this.openTooltip()},this),on(t,`blur`,this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(e){var t=typeof e.getElement==`function`&&e.getElement();t&&t.setAttribute(`aria-describedby`,this._tooltip._container.id)},_openTooltip:function(e){if(!(!this._tooltip||!this._map)){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var t=this;this._map.once(`moveend`,function(){t._openOnceFlag=!1,t._openTooltip(e)});return}this._tooltip._source=e.layer||e.target,this.openTooltip(this._tooltip.options.sticky?e.latlng:void 0)}},_moveTooltip:function(e){var t=e.latlng,n,s;this._tooltip.options.sticky&&e.originalEvent&&(n=this._map.mouseEventToContainerPoint(e.originalEvent),s=this._map.containerPointToLayerPoint(n),t=this._map.layerPointToLatLng(s)),this._tooltip.setLatLng(t)}});var Tt=st.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:`leaflet-div-icon`},createIcon:function(e){var t=e&&e.tagName===`DIV`?e:document.createElement(`div`),n=this.options;if(n.html instanceof Element?(empty(t),t.appendChild(n.html)):t.innerHTML=n.html===!1?``:n.html,n.bgPos){var s=toPoint(n.bgPos);t.style.backgroundPosition=-s.x+`px `+-s.y+`px`}return this._setIconStyles(t,`icon`),t},createShadow:function(){return null}});function divIcon(e){return new Tt(e)}st.Default=ct;var Et=it.extend({options:{tileSize:256,opacity:1,updateWhenIdle:U.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:`tilePane`,className:``,keepBuffer:2},initialize:function(e){setOptions(this,e)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(e){e._addZoomLimit(this)},onRemove:function(e){this._removeAllTiles(),remove(this._container),e._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(toFront(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(toBack(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(e){return this.options.opacity=e,this._updateOpacity(),this},setZIndex:function(e){return this.options.zIndex=e,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var e=this._clampZoom(this._map.getZoom());e!==this._tileZoom&&(this._tileZoom=e,this._updateLevels()),this._update()}return this},getEvents:function(){var e={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||=throttle(this._onMoveEnd,this.options.updateInterval,this),e.move=this._onMove),this._zoomAnimated&&(e.zoomanim=this._animateZoom),e},createTile:function(){return document.createElement(`div`)},getTileSize:function(){var e=this.options.tileSize;return e instanceof Point?e:new Point(e,e)},_updateZIndex:function(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(e){for(var t=this.getPane().children,n=-e(-1/0,1/0),s=0,c=t.length,l;s<c;s++)l=t[s].style.zIndex,t[s]!==this._container&&l&&(n=e(n,+l));isFinite(n)&&(this.options.zIndex=n+e(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!U.ielt9){setOpacity(this._container,this.options.opacity);var e=+new Date,t=!1,n=!1;for(var s in this._tiles){var c=this._tiles[s];if(!(!c.current||!c.loaded)){var l=Math.min(1,(e-c.loaded)/200);setOpacity(c.el,l),l<1?t=!0:(c.active?n=!0:this._onOpaqueTile(c),c.active=!0)}}n&&!this._noPrune&&this._pruneTiles(),t&&(cancelAnimFrame(this._fadeFrame),this._fadeFrame=requestAnimFrame(this._updateOpacity,this))}},_onOpaqueTile:falseFn,_initContainer:function(){this._container||(this._container=create$1(`div`,`leaflet-layer `+(this.options.className||``)),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var e=this._tileZoom,t=this.options.maxZoom;if(e!==void 0){for(var n in this._levels)n=Number(n),this._levels[n].el.children.length||n===e?(this._levels[n].el.style.zIndex=t-Math.abs(e-n),this._onUpdateLevel(n)):(remove(this._levels[n].el),this._removeTilesAtZoom(n),this._onRemoveLevel(n),delete this._levels[n]);var s=this._levels[e],c=this._map;return s||(s=this._levels[e]={},s.el=create$1(`div`,`leaflet-tile-container leaflet-zoom-animated`,this._container),s.el.style.zIndex=t,s.origin=c.project(c.unproject(c.getPixelOrigin()),e).round(),s.zoom=e,this._setZoomTransform(s,c.getCenter(),c.getZoom()),s.el.offsetWidth,this._onCreateLevel(s)),this._level=s,s}},_onUpdateLevel:falseFn,_onRemoveLevel:falseFn,_onCreateLevel:falseFn,_pruneTiles:function(){if(this._map){var e,t,n=this._map.getZoom();if(n>this.options.maxZoom||n<this.options.minZoom){this._removeAllTiles();return}for(e in this._tiles)t=this._tiles[e],t.retain=t.current;for(e in this._tiles)if(t=this._tiles[e],t.current&&!t.active){var s=t.coords;this._retainParent(s.x,s.y,s.z,s.z-5)||this._retainChildren(s.x,s.y,s.z,s.z+2)}for(e in this._tiles)this._tiles[e].retain||this._removeTile(e)}},_removeTilesAtZoom:function(e){for(var t in this._tiles)this._tiles[t].coords.z===e&&this._removeTile(t)},_removeAllTiles:function(){for(var e in this._tiles)this._removeTile(e)},_invalidateAll:function(){for(var e in this._levels)remove(this._levels[e].el),this._onRemoveLevel(Number(e)),delete this._levels[e];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(e,t,n,s){var c=Math.floor(e/2),l=Math.floor(t/2),d=n-1,f=new Point(+c,+l);f.z=+d;var p=this._tileCoordsToKey(f),m=this._tiles[p];return m&&m.active?(m.retain=!0,!0):(m&&m.loaded&&(m.retain=!0),d>s?this._retainParent(c,l,d,s):!1)},_retainChildren:function(e,t,n,s){for(var c=2*e;c<2*e+2;c++)for(var l=2*t;l<2*t+2;l++){var d=new Point(c,l);d.z=n+1;var f=this._tileCoordsToKey(d),p=this._tiles[f];if(p&&p.active){p.retain=!0;continue}else p&&p.loaded&&(p.retain=!0);n+1<s&&this._retainChildren(c,l,n+1,s)}},_resetView:function(e){var t=e&&(e.pinch||e.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),t,t)},_animateZoom:function(e){this._setView(e.center,e.zoom,!0,e.noUpdate)},_clampZoom:function(e){var t=this.options;return t.minNativeZoom!==void 0&&e<t.minNativeZoom?t.minNativeZoom:t.maxNativeZoom!==void 0&&t.maxNativeZoom<e?t.maxNativeZoom:e},_setView:function(e,t,n,s){var c=Math.round(t);c=this.options.maxZoom!==void 0&&c>this.options.maxZoom||this.options.minZoom!==void 0&&c<this.options.minZoom?void 0:this._clampZoom(c);var l=this.options.updateWhenZooming&&c!==this._tileZoom;(!s||l)&&(this._tileZoom=c,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),c!==void 0&&this._update(e),n||this._pruneTiles(),this._noPrune=!!n),this._setZoomTransforms(e,t)},_setZoomTransforms:function(e,t){for(var n in this._levels)this._setZoomTransform(this._levels[n],e,t)},_setZoomTransform:function(e,t,n){var s=this._map.getZoomScale(n,e.zoom),c=e.origin.multiplyBy(s).subtract(this._map._getNewPixelOrigin(t,n)).round();U.any3d?setTransform(e.el,c,s):setPosition(e.el,c)},_resetGrid:function(){var e=this._map,t=e.options.crs,n=this._tileSize=this.getTileSize(),s=this._tileZoom,c=this._map.getPixelWorldBounds(this._tileZoom);c&&(this._globalTileRange=this._pxBoundsToTileRange(c)),this._wrapX=t.wrapLng&&!this.options.noWrap&&[Math.floor(e.project([0,t.wrapLng[0]],s).x/n.x),Math.ceil(e.project([0,t.wrapLng[1]],s).x/n.y)],this._wrapY=t.wrapLat&&!this.options.noWrap&&[Math.floor(e.project([t.wrapLat[0],0],s).y/n.x),Math.ceil(e.project([t.wrapLat[1],0],s).y/n.y)]},_onMoveEnd:function(){!this._map||this._map._animatingZoom||this._update()},_getTiledPixelBounds:function(e){var t=this._map,n=t._animatingZoom?Math.max(t._animateToZoom,t.getZoom()):t.getZoom(),s=t.getZoomScale(n,this._tileZoom),c=t.project(e,this._tileZoom).floor(),l=t.getSize().divideBy(s*2);return new Bounds(c.subtract(l),c.add(l))},_update:function(e){var t=this._map;if(t){var n=this._clampZoom(t.getZoom());if(e===void 0&&(e=t.getCenter()),this._tileZoom!==void 0){var s=this._getTiledPixelBounds(e),c=this._pxBoundsToTileRange(s),l=c.getCenter(),d=[],f=this.options.keepBuffer,p=new Bounds(c.getBottomLeft().subtract([f,-f]),c.getTopRight().add([f,-f]));if(!(isFinite(c.min.x)&&isFinite(c.min.y)&&isFinite(c.max.x)&&isFinite(c.max.y)))throw Error(`Attempted to load an infinite number of tiles`);for(var m in this._tiles){var h=this._tiles[m].coords;(h.z!==this._tileZoom||!p.contains(new Point(h.x,h.y)))&&(this._tiles[m].current=!1)}if(Math.abs(n-this._tileZoom)>1){this._setView(e,n);return}for(var g=c.min.y;g<=c.max.y;g++)for(var _=c.min.x;_<=c.max.x;_++){var v=new Point(_,g);if(v.z=this._tileZoom,this._isValidTile(v)){var y=this._tiles[this._tileCoordsToKey(v)];y?y.current=!0:d.push(v)}}if(d.sort(function(e,t){return e.distanceTo(l)-t.distanceTo(l)}),d.length!==0){this._loading||(this._loading=!0,this.fire(`loading`));var b=document.createDocumentFragment();for(_=0;_<d.length;_++)this._addTile(d[_],b);this._level.el.appendChild(b)}}}},_isValidTile:function(e){var t=this._map.options.crs;if(!t.infinite){var n=this._globalTileRange;if(!t.wrapLng&&(e.x<n.min.x||e.x>n.max.x)||!t.wrapLat&&(e.y<n.min.y||e.y>n.max.y))return!1}if(!this.options.bounds)return!0;var s=this._tileCoordsToBounds(e);return toLatLngBounds(this.options.bounds).overlaps(s)},_keyToBounds:function(e){return this._tileCoordsToBounds(this._keyToTileCoords(e))},_tileCoordsToNwSe:function(e){var t=this._map,n=this.getTileSize(),s=e.scaleBy(n),c=s.add(n);return[t.unproject(s,e.z),t.unproject(c,e.z)]},_tileCoordsToBounds:function(e){var t=this._tileCoordsToNwSe(e),n=new LatLngBounds(t[0],t[1]);return this.options.noWrap||(n=this._map.wrapLatLngBounds(n)),n},_tileCoordsToKey:function(e){return e.x+`:`+e.y+`:`+e.z},_keyToTileCoords:function(e){var t=e.split(`:`),n=new Point(+t[0],+t[1]);return n.z=+t[2],n},_removeTile:function(e){var t=this._tiles[e];t&&(remove(t.el),delete this._tiles[e],this.fire(`tileunload`,{tile:t.el,coords:this._keyToTileCoords(e)}))},_initTile:function(e){addClass(e,`leaflet-tile`);var t=this.getTileSize();e.style.width=t.x+`px`,e.style.height=t.y+`px`,e.onselectstart=falseFn,e.onmousemove=falseFn,U.ielt9&&this.options.opacity<1&&setOpacity(e,this.options.opacity)},_addTile:function(e,t){var n=this._getTilePos(e),s=this._tileCoordsToKey(e),c=this.createTile(this._wrapCoords(e),bind(this._tileReady,this,e));this._initTile(c),this.createTile.length<2&&requestAnimFrame(bind(this._tileReady,this,e,null,c)),setPosition(c,n),this._tiles[s]={el:c,coords:e,current:!0},t.appendChild(c),this.fire(`tileloadstart`,{tile:c,coords:e})},_tileReady:function(e,t,n){t&&this.fire(`tileerror`,{error:t,tile:n,coords:e});var s=this._tileCoordsToKey(e);n=this._tiles[s],n&&(n.loaded=+new Date,this._map._fadeAnimated?(setOpacity(n.el,0),cancelAnimFrame(this._fadeFrame),this._fadeFrame=requestAnimFrame(this._updateOpacity,this)):(n.active=!0,this._pruneTiles()),t||(addClass(n.el,`leaflet-tile-loaded`),this.fire(`tileload`,{tile:n.el,coords:e})),this._noTilesToLoad()&&(this._loading=!1,this.fire(`load`),U.ielt9||!this._map._fadeAnimated?requestAnimFrame(this._pruneTiles,this):setTimeout(bind(this._pruneTiles,this),250)))},_getTilePos:function(e){return e.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(e){var t=new Point(this._wrapX?wrapNum(e.x,this._wrapX):e.x,this._wrapY?wrapNum(e.y,this._wrapY):e.y);return t.z=e.z,t},_pxBoundsToTileRange:function(e){var t=this.getTileSize();return new Bounds(e.min.unscaleBy(t).floor(),e.max.unscaleBy(t).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var e in this._tiles)if(!this._tiles[e].loaded)return!1;return!0}});function gridLayer(e){return new Et(e)}var Dt=Et.extend({options:{minZoom:0,maxZoom:18,subdomains:`abc`,errorTileUrl:``,zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(e,t){this._url=e,t=setOptions(this,t),t.detectRetina&&U.retina&&t.maxZoom>0?(t.tileSize=Math.floor(t.tileSize/2),t.zoomReverse?(t.zoomOffset--,t.minZoom=Math.min(t.maxZoom,t.minZoom+1)):(t.zoomOffset++,t.maxZoom=Math.max(t.minZoom,t.maxZoom-1)),t.minZoom=Math.max(0,t.minZoom)):t.zoomReverse?t.minZoom=Math.min(t.maxZoom,t.minZoom):t.maxZoom=Math.max(t.minZoom,t.maxZoom),typeof t.subdomains==`string`&&(t.subdomains=t.subdomains.split(``)),this.on(`tileunload`,this._onTileRemove)},setUrl:function(e,t){return this._url===e&&t===void 0&&(t=!0),this._url=e,t||this.redraw(),this},createTile:function(e,t){var n=document.createElement(`img`);return on(n,`load`,bind(this._tileOnLoad,this,t,n)),on(n,`error`,bind(this._tileOnError,this,t,n)),(this.options.crossOrigin||this.options.crossOrigin===``)&&(n.crossOrigin=this.options.crossOrigin===!0?``:this.options.crossOrigin),typeof this.options.referrerPolicy==`string`&&(n.referrerPolicy=this.options.referrerPolicy),n.alt=``,n.src=this.getTileUrl(e),n},getTileUrl:function(e){var t={r:U.retina?`@2x`:``,s:this._getSubdomain(e),x:e.x,y:e.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var n=this._globalTileRange.max.y-e.y;this.options.tms&&(t.y=n),t[`-y`]=n}return template(this._url,extend(t,this.options))},_tileOnLoad:function(e,t){U.ielt9?setTimeout(bind(e,this,null,t),0):e(null,t)},_tileOnError:function(e,t,n){var s=this.options.errorTileUrl;s&&t.getAttribute(`src`)!==s&&(t.src=s),e(n,t)},_onTileRemove:function(e){e.tile.onload=null},_getZoomForUrl:function(){var e=this._tileZoom,t=this.options.maxZoom,n=this.options.zoomReverse,s=this.options.zoomOffset;return n&&(e=t-e),e+s},_getSubdomain:function(e){var t=Math.abs(e.x+e.y)%this.options.subdomains.length;return this.options.subdomains[t]},_abortLoading:function(){var e,t;for(e in this._tiles)if(this._tiles[e].coords.z!==this._tileZoom&&(t=this._tiles[e].el,t.onload=falseFn,t.onerror=falseFn,!t.complete)){t.src=d;var n=this._tiles[e].coords;remove(t),delete this._tiles[e],this.fire(`tileabort`,{tile:t,coords:n})}},_removeTile:function(e){var t=this._tiles[e];if(t)return t.el.setAttribute(`src`,d),Et.prototype._removeTile.call(this,e)},_tileReady:function(e,t,n){if(!(!this._map||n&&n.getAttribute(`src`)===d))return Et.prototype._tileReady.call(this,e,t,n)}});function tileLayer(e,t){return new Dt(e,t)}var Ot=Dt.extend({defaultWmsParams:{service:`WMS`,request:`GetMap`,layers:``,styles:``,format:`image/jpeg`,transparent:!1,version:`1.1.1`},options:{crs:null,uppercase:!1},initialize:function(e,t){this._url=e;var n=extend({},this.defaultWmsParams);for(var s in t)s in this.options||(n[s]=t[s]);t=setOptions(this,t);var c=t.detectRetina&&U.retina?2:1,l=this.getTileSize();n.width=l.x*c,n.height=l.y*c,this.wmsParams=n},onAdd:function(e){this._crs=this.options.crs||e.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var t=this._wmsVersion>=1.3?`crs`:`srs`;this.wmsParams[t]=this._crs.code,Dt.prototype.onAdd.call(this,e)},getTileUrl:function(e){var t=this._tileCoordsToNwSe(e),n=this._crs,s=toBounds(n.project(t[0]),n.project(t[1])),c=s.min,l=s.max,d=(this._wmsVersion>=1.3&&this._crs===nt?[c.y,c.x,l.y,l.x]:[c.x,c.y,l.x,l.y]).join(`,`),f=Dt.prototype.getTileUrl.call(this,e);return f+getParamString(this.wmsParams,f,this.options.uppercase)+(this.options.uppercase?`&BBOX=`:`&bbox=`)+d},setParams:function(e,t){return extend(this.wmsParams,e),t||this.redraw(),this}});function tileLayerWMS(e,t){return new Ot(e,t)}Dt.WMS=Ot,tileLayer.wms=tileLayerWMS;var kt=it.extend({options:{padding:.1},initialize:function(e){setOptions(this,e),stamp(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),addClass(this._container,`leaflet-zoom-animated`)),this.getPane().appendChild(this._container),this._update(),this.on(`update`,this._updatePaths,this)},onRemove:function(){this.off(`update`,this._updatePaths,this),this._destroyContainer()},getEvents:function(){var e={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(e.zoomanim=this._onAnimZoom),e},_onAnimZoom:function(e){this._updateTransform(e.center,e.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(e,t){var n=this._map.getZoomScale(t,this._zoom),s=this._map.getSize().multiplyBy(.5+this.options.padding),c=this._map.project(this._center,t),l=s.multiplyBy(-n).add(c).subtract(this._map._getNewPixelOrigin(e,t));U.any3d?setTransform(this._container,l,n):setPosition(this._container,l)},_reset:function(){for(var e in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[e]._reset()},_onZoomEnd:function(){for(var e in this._layers)this._layers[e]._project()},_updatePaths:function(){for(var e in this._layers)this._layers[e]._update()},_update:function(){var e=this.options.padding,t=this._map.getSize(),n=this._map.containerPointToLayerPoint(t.multiplyBy(-e)).round();this._bounds=new Bounds(n,n.add(t.multiplyBy(1+e*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),At=kt.extend({options:{tolerance:0},getEvents:function(){var e=kt.prototype.getEvents.call(this);return e.viewprereset=this._onViewPreReset,e},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){kt.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var e=this._container=document.createElement(`canvas`);on(e,`mousemove`,this._onMouseMove,this),on(e,`click dblclick mousedown mouseup contextmenu`,this._onClick,this),on(e,`mouseout`,this._handleMouseOut,this),e._leaflet_disable_events=!0,this._ctx=e.getContext(`2d`)},_destroyContainer:function(){cancelAnimFrame(this._redrawRequest),delete this._ctx,remove(this._container),off(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var e;for(var t in this._redrawBounds=null,this._layers)e=this._layers[t],e._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){kt.prototype._update.call(this);var e=this._bounds,t=this._container,n=e.getSize(),s=U.retina?2:1;setPosition(t,e.min),t.width=s*n.x,t.height=s*n.y,t.style.width=n.x+`px`,t.style.height=n.y+`px`,U.retina&&this._ctx.scale(2,2),this._ctx.translate(-e.min.x,-e.min.y),this.fire(`update`)}},_reset:function(){kt.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(e){this._updateDashArray(e),this._layers[stamp(e)]=e;var t=e._order={layer:e,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=t),this._drawLast=t,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(e){this._requestRedraw(e)},_removePath:function(e){var t=e._order,n=t.next,s=t.prev;n?n.prev=s:this._drawLast=s,s?s.next=n:this._drawFirst=n,delete e._order,delete this._layers[stamp(e)],this._requestRedraw(e)},_updatePath:function(e){this._extendRedrawBounds(e),e._project(),e._update(),this._requestRedraw(e)},_updateStyle:function(e){this._updateDashArray(e),this._requestRedraw(e)},_updateDashArray:function(e){if(typeof e.options.dashArray==`string`){var t=e.options.dashArray.split(/[, ]+/),n=[],s,c;for(c=0;c<t.length;c++){if(s=Number(t[c]),isNaN(s))return;n.push(s)}e.options._dashArray=n}else e.options._dashArray=e.options.dashArray},_requestRedraw:function(e){this._map&&(this._extendRedrawBounds(e),this._redrawRequest=this._redrawRequest||requestAnimFrame(this._redraw,this))},_extendRedrawBounds:function(e){if(e._pxBounds){var t=(e.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new Bounds,this._redrawBounds.extend(e._pxBounds.min.subtract([t,t])),this._redrawBounds.extend(e._pxBounds.max.add([t,t]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var e=this._redrawBounds;if(e){var t=e.getSize();this._ctx.clearRect(e.min.x,e.min.y,t.x,t.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var e,t=this._redrawBounds;if(this._ctx.save(),t){var n=t.getSize();this._ctx.beginPath(),this._ctx.rect(t.min.x,t.min.y,n.x,n.y),this._ctx.clip()}this._drawing=!0;for(var s=this._drawFirst;s;s=s.next)e=s.layer,(!t||e._pxBounds&&e._pxBounds.intersects(t))&&e._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(e,t){if(this._drawing){var n,s,c,l,d=e._parts,f=d.length,p=this._ctx;if(f){for(p.beginPath(),n=0;n<f;n++){for(s=0,c=d[n].length;s<c;s++)l=d[n][s],p[s?`lineTo`:`moveTo`](l.x,l.y);t&&p.closePath()}this._fillStroke(p,e)}}},_updateCircle:function(e){if(!(!this._drawing||e._empty())){var t=e._point,n=this._ctx,s=Math.max(Math.round(e._radius),1),c=(Math.max(Math.round(e._radiusY),1)||s)/s;c!==1&&(n.save(),n.scale(1,c)),n.beginPath(),n.arc(t.x,t.y/c,s,0,Math.PI*2,!1),c!==1&&n.restore(),this._fillStroke(n,e)}},_fillStroke:function(e,t){var n=t.options;n.fill&&(e.globalAlpha=n.fillOpacity,e.fillStyle=n.fillColor||n.color,e.fill(n.fillRule||`evenodd`)),n.stroke&&n.weight!==0&&(e.setLineDash&&e.setLineDash(t.options&&t.options._dashArray||[]),e.globalAlpha=n.opacity,e.lineWidth=n.weight,e.strokeStyle=n.color,e.lineCap=n.lineCap,e.lineJoin=n.lineJoin,e.stroke())},_onClick:function(e){for(var t=this._map.mouseEventToLayerPoint(e),n,s,c=this._drawFirst;c;c=c.next)n=c.layer,n.options.interactive&&n._containsPoint(t)&&(!(e.type===`click`||e.type===`preclick`)||!this._map._draggableMoved(n))&&(s=n);this._fireEvent(s?[s]:!1,e)},_onMouseMove:function(e){if(!(!this._map||this._map.dragging.moving()||this._map._animatingZoom)){var t=this._map.mouseEventToLayerPoint(e);this._handleMouseHover(e,t)}},_handleMouseOut:function(e){var t=this._hoveredLayer;t&&(removeClass(this._container,`leaflet-interactive`),this._fireEvent([t],e,`mouseout`),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(e,t){if(!this._mouseHoverThrottled){for(var n,s,c=this._drawFirst;c;c=c.next)n=c.layer,n.options.interactive&&n._containsPoint(t)&&(s=n);s!==this._hoveredLayer&&(this._handleMouseOut(e),s&&(addClass(this._container,`leaflet-interactive`),this._fireEvent([s],e,`mouseover`),this._hoveredLayer=s)),this._fireEvent(this._hoveredLayer?[this._hoveredLayer]:!1,e),this._mouseHoverThrottled=!0,setTimeout(bind(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(e,t,n){this._map._fireDOMEvent(t,n||t.type,e)},_bringToFront:function(e){var t=e._order;if(t){var n=t.next,s=t.prev;if(n)n.prev=s;else return;s?s.next=n:n&&(this._drawFirst=n),t.prev=this._drawLast,this._drawLast.next=t,t.next=null,this._drawLast=t,this._requestRedraw(e)}},_bringToBack:function(e){var t=e._order;if(t){var n=t.next,s=t.prev;if(s)s.next=n;else return;n?n.prev=s:s&&(this._drawLast=s),t.prev=null,t.next=this._drawFirst,this._drawFirst.prev=t,this._drawFirst=t,this._requestRedraw(e)}}});function canvas(e){return U.canvas?new At(e):null}var jt=(function(){try{return document.namespaces.add(`lvml`,`urn:schemas-microsoft-com:vml`),function(e){return document.createElement(`<lvml:`+e+` class="lvml">`)}}catch{}return function(e){return document.createElement(`<`+e+` xmlns="urn:schemas-microsoft.com:vml" class="lvml">`)}})(),Mt={_initContainer:function(){this._container=create$1(`div`,`leaflet-vml-container`)},_update:function(){this._map._animatingZoom||(kt.prototype._update.call(this),this.fire(`update`))},_initPath:function(e){var t=e._container=jt(`shape`);addClass(t,`leaflet-vml-shape `+(this.options.className||``)),t.coordsize=`1 1`,e._path=jt(`path`),t.appendChild(e._path),this._updateStyle(e),this._layers[stamp(e)]=e},_addPath:function(e){var t=e._container;this._container.appendChild(t),e.options.interactive&&e.addInteractiveTarget(t)},_removePath:function(e){var t=e._container;remove(t),e.removeInteractiveTarget(t),delete this._layers[stamp(e)]},_updateStyle:function(e){var t=e._stroke,n=e._fill,s=e.options,c=e._container;c.stroked=!!s.stroke,c.filled=!!s.fill,s.stroke?(t||=e._stroke=jt(`stroke`),c.appendChild(t),t.weight=s.weight+`px`,t.color=s.color,t.opacity=s.opacity,s.dashArray?t.dashStyle=l(s.dashArray)?s.dashArray.join(` `):s.dashArray.replace(/( *, *)/g,` `):t.dashStyle=``,t.endcap=s.lineCap.replace(`butt`,`flat`),t.joinstyle=s.lineJoin):t&&(c.removeChild(t),e._stroke=null),s.fill?(n||=e._fill=jt(`fill`),c.appendChild(n),n.color=s.fillColor||s.color,n.opacity=s.fillOpacity):n&&(c.removeChild(n),e._fill=null)},_updateCircle:function(e){var t=e._point.round(),n=Math.round(e._radius),s=Math.round(e._radiusY||n);this._setPath(e,e._empty()?`M0 0`:`AL `+t.x+`,`+t.y+` `+n+`,`+s+` 0,23592600`)},_setPath:function(e,t){e._path.v=t},_bringToFront:function(e){toFront(e._container)},_bringToBack:function(e){toBack(e._container)}},Nt=U.vml?jt:svgCreate,Pt=kt.extend({_initContainer:function(){this._container=Nt(`svg`),this._container.setAttribute(`pointer-events`,`none`),this._rootGroup=Nt(`g`),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){remove(this._container),off(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){kt.prototype._update.call(this);var e=this._bounds,t=e.getSize(),n=this._container;(!this._svgSize||!this._svgSize.equals(t))&&(this._svgSize=t,n.setAttribute(`width`,t.x),n.setAttribute(`height`,t.y)),setPosition(n,e.min),n.setAttribute(`viewBox`,[e.min.x,e.min.y,t.x,t.y].join(` `)),this.fire(`update`)}},_initPath:function(e){var t=e._path=Nt(`path`);e.options.className&&addClass(t,e.options.className),e.options.interactive&&addClass(t,`leaflet-interactive`),this._updateStyle(e),this._layers[stamp(e)]=e},_addPath:function(e){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(e._path),e.addInteractiveTarget(e._path)},_removePath:function(e){remove(e._path),e.removeInteractiveTarget(e._path),delete this._layers[stamp(e)]},_updatePath:function(e){e._project(),e._update()},_updateStyle:function(e){var t=e._path,n=e.options;t&&(n.stroke?(t.setAttribute(`stroke`,n.color),t.setAttribute(`stroke-opacity`,n.opacity),t.setAttribute(`stroke-width`,n.weight),t.setAttribute(`stroke-linecap`,n.lineCap),t.setAttribute(`stroke-linejoin`,n.lineJoin),n.dashArray?t.setAttribute(`stroke-dasharray`,n.dashArray):t.removeAttribute(`stroke-dasharray`),n.dashOffset?t.setAttribute(`stroke-dashoffset`,n.dashOffset):t.removeAttribute(`stroke-dashoffset`)):t.setAttribute(`stroke`,`none`),n.fill?(t.setAttribute(`fill`,n.fillColor||n.color),t.setAttribute(`fill-opacity`,n.fillOpacity),t.setAttribute(`fill-rule`,n.fillRule||`evenodd`)):t.setAttribute(`fill`,`none`))},_updatePoly:function(e,t){this._setPath(e,pointsToPath(e._parts,t))},_updateCircle:function(e){var t=e._point,n=Math.max(Math.round(e._radius),1),s=Math.max(Math.round(e._radiusY),1)||n,c=`a`+n+`,`+s+` 0 1,0 `,l=e._empty()?`M0 0`:`M`+(t.x-n)+`,`+t.y+c+n*2+`,0 `+c+-n*2+`,0 `;this._setPath(e,l)},_setPath:function(e,t){e._path.setAttribute(`d`,t)},_bringToFront:function(e){toFront(e._path)},_bringToBack:function(e){toBack(e._path)}});U.vml&&Pt.include(Mt);function svg(e){return U.svg||U.vml?new Pt(e):null}J.include({getRenderer:function(e){var t=e.options.renderer||this._getPaneRenderer(e.options.pane)||this.options.renderer||this._renderer;return t||=this._renderer=this._createRenderer(),this.hasLayer(t)||this.addLayer(t),t},_getPaneRenderer:function(e){if(e===`overlayPane`||e===void 0)return!1;var t=this._paneRenderers[e];return t===void 0&&(t=this._createRenderer({pane:e}),this._paneRenderers[e]=t),t},_createRenderer:function(e){return this.options.preferCanvas&&canvas(e)||svg(e)}});var Ft=ht.extend({initialize:function(e,t){ht.prototype.initialize.call(this,this._boundsToLatLngs(e),t)},setBounds:function(e){return this.setLatLngs(this._boundsToLatLngs(e))},_boundsToLatLngs:function(e){return e=toLatLngBounds(e),[e.getSouthWest(),e.getNorthWest(),e.getNorthEast(),e.getSouthEast()]}});function rectangle(e,t){return new Ft(e,t)}Pt.create=Nt,Pt.pointsToPath=pointsToPath,gt.geometryToLayer=geometryToLayer,gt.coordsToLatLng=coordsToLatLng,gt.coordsToLatLngs=coordsToLatLngs,gt.latLngToCoords=latLngToCoords,gt.latLngsToCoords=latLngsToCoords,gt.getFeature=getFeature,gt.asFeature=asFeature,J.mergeOptions({boxZoom:!0});var It=Ge.extend({initialize:function(e){this._map=e,this._container=e._container,this._pane=e._panes.overlayPane,this._resetStateTimeout=0,e.on(`unload`,this._destroy,this)},addHooks:function(){on(this._container,`mousedown`,this._onMouseDown,this)},removeHooks:function(){off(this._container,`mousedown`,this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){remove(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(e){if(!e.shiftKey||e.which!==1&&e.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),disableTextSelection(),disableImageDrag(),this._startPoint=this._map.mouseEventToContainerPoint(e),on(document,{contextmenu:stop,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(e){this._moved||(this._moved=!0,this._box=create$1(`div`,`leaflet-zoom-box`,this._container),addClass(this._container,`leaflet-crosshair`),this._map.fire(`boxzoomstart`)),this._point=this._map.mouseEventToContainerPoint(e);var t=new Bounds(this._point,this._startPoint),n=t.getSize();setPosition(this._box,t.min),this._box.style.width=n.x+`px`,this._box.style.height=n.y+`px`},_finish:function(){this._moved&&(remove(this._box),removeClass(this._container,`leaflet-crosshair`)),enableTextSelection(),enableImageDrag(),off(document,{contextmenu:stop,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(e){if(!(e.which!==1&&e.button!==1)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(bind(this._resetState,this),0);var t=new LatLngBounds(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(t).fire(`boxzoomend`,{boxZoomBounds:t})}},_onKeyDown:function(e){e.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});J.addInitHook(`addHandler`,`boxZoom`,It),J.mergeOptions({doubleClickZoom:!0});var Lt=Ge.extend({addHooks:function(){this._map.on(`dblclick`,this._onDoubleClick,this)},removeHooks:function(){this._map.off(`dblclick`,this._onDoubleClick,this)},_onDoubleClick:function(e){var t=this._map,n=t.getZoom(),s=t.options.zoomDelta,c=e.originalEvent.shiftKey?n-s:n+s;t.options.doubleClickZoom===`center`?t.setZoom(c):t.setZoomAround(e.containerPoint,c)}});J.addInitHook(`addHandler`,`doubleClickZoom`,Lt),J.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var Rt=Ge.extend({addHooks:function(){if(!this._draggable){var e=this._map;this._draggable=new Je(e._mapPane,e._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on(`predrag`,this._onPreDragLimit,this),e.options.worldCopyJump&&(this._draggable.on(`predrag`,this._onPreDragWrap,this),e.on(`zoomend`,this._onZoomEnd,this),e.whenReady(this._onZoomEnd,this))}addClass(this._map._container,`leaflet-grab leaflet-touch-drag`),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){removeClass(this._map._container,`leaflet-grab`),removeClass(this._map._container,`leaflet-touch-drag`),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var e=this._map;if(e._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var t=toLatLngBounds(this._map.options.maxBounds);this._offsetLimit=toBounds(this._map.latLngToContainerPoint(t.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(t.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;e.fire(`movestart`).fire(`dragstart`),e.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(e){if(this._map.options.inertia){var t=this._lastTime=+new Date,n=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(n),this._times.push(t),this._prunePositions(t)}this._map.fire(`move`,e).fire(`drag`,e)},_prunePositions:function(e){for(;this._positions.length>1&&e-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var e=this._map.getSize().divideBy(2),t=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=t.subtract(e).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(e,t){return e-(e-t)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var e=this._draggable._newPos.subtract(this._draggable._startPos),t=this._offsetLimit;e.x<t.min.x&&(e.x=this._viscousLimit(e.x,t.min.x)),e.y<t.min.y&&(e.y=this._viscousLimit(e.y,t.min.y)),e.x>t.max.x&&(e.x=this._viscousLimit(e.x,t.max.x)),e.y>t.max.y&&(e.y=this._viscousLimit(e.y,t.max.y)),this._draggable._newPos=this._draggable._startPos.add(e)}},_onPreDragWrap:function(){var e=this._worldWidth,t=Math.round(e/2),n=this._initialWorldOffset,s=this._draggable._newPos.x,c=(s-t+n)%e+t-n,l=(s+t+n)%e-t-n,d=Math.abs(c+n)<Math.abs(l+n)?c:l;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=d},_onDragEnd:function(e){var t=this._map,n=t.options,s=!n.inertia||e.noInertia||this._times.length<2;if(t.fire(`dragend`,e),s)t.fire(`moveend`);else{this._prunePositions(+new Date);var c=this._lastPos.subtract(this._positions[0]),l=(this._lastTime-this._times[0])/1e3,d=n.easeLinearity,f=c.multiplyBy(d/l),p=f.distanceTo([0,0]),m=Math.min(n.inertiaMaxSpeed,p),h=f.multiplyBy(m/p),g=m/(n.inertiaDeceleration*d),_=h.multiplyBy(-g/2).round();!_.x&&!_.y?t.fire(`moveend`):(_=t._limitOffset(_,t.options.maxBounds),requestAnimFrame(function(){t.panBy(_,{duration:g,easeLinearity:d,noMoveStart:!0,animate:!0})}))}}});J.addInitHook(`addHandler`,`dragging`,Rt),J.mergeOptions({keyboard:!0,keyboardPanDelta:80});var zt=Ge.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(e){this._map=e,this._setPanDelta(e.options.keyboardPanDelta),this._setZoomDelta(e.options.zoomDelta)},addHooks:function(){var e=this._map._container;e.tabIndex<=0&&(e.tabIndex=`0`),on(e,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),off(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var e=document.body,t=document.documentElement,n=e.scrollTop||t.scrollTop,s=e.scrollLeft||t.scrollLeft;this._map._container.focus(),window.scrollTo(s,n)}},_onFocus:function(){this._focused=!0,this._map.fire(`focus`)},_onBlur:function(){this._focused=!1,this._map.fire(`blur`)},_setPanDelta:function(e){var t=this._panKeys={},n=this.keyCodes,s,c;for(s=0,c=n.left.length;s<c;s++)t[n.left[s]]=[-1*e,0];for(s=0,c=n.right.length;s<c;s++)t[n.right[s]]=[e,0];for(s=0,c=n.down.length;s<c;s++)t[n.down[s]]=[0,e];for(s=0,c=n.up.length;s<c;s++)t[n.up[s]]=[0,-1*e]},_setZoomDelta:function(e){var t=this._zoomKeys={},n=this.keyCodes,s,c;for(s=0,c=n.zoomIn.length;s<c;s++)t[n.zoomIn[s]]=e;for(s=0,c=n.zoomOut.length;s<c;s++)t[n.zoomOut[s]]=-e},_addHooks:function(){on(document,`keydown`,this._onKeyDown,this)},_removeHooks:function(){off(document,`keydown`,this._onKeyDown,this)},_onKeyDown:function(e){if(!(e.altKey||e.ctrlKey||e.metaKey)){var t=e.keyCode,n=this._map,s;if(t in this._panKeys){if(!n._panAnim||!n._panAnim._inProgress)if(s=this._panKeys[t],e.shiftKey&&(s=toPoint(s).multiplyBy(3)),n.options.maxBounds&&(s=n._limitOffset(toPoint(s),n.options.maxBounds)),n.options.worldCopyJump){var c=n.wrapLatLng(n.unproject(n.project(n.getCenter()).add(s)));n.panTo(c)}else n.panBy(s)}else if(t in this._zoomKeys)n.setZoom(n.getZoom()+(e.shiftKey?3:1)*this._zoomKeys[t]);else if(t===27&&n._popup&&n._popup.options.closeOnEscapeKey)n.closePopup();else return;stop(e)}}});J.addInitHook(`addHandler`,`keyboard`,zt),J.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var Bt=Ge.extend({addHooks:function(){on(this._map._container,`wheel`,this._onWheelScroll,this),this._delta=0},removeHooks:function(){off(this._map._container,`wheel`,this._onWheelScroll,this)},_onWheelScroll:function(e){var t=getWheelDelta(e),n=this._map.options.wheelDebounceTime;this._delta+=t,this._lastMousePos=this._map.mouseEventToContainerPoint(e),this._startTime||=+new Date;var s=Math.max(n-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(bind(this._performZoom,this),s),stop(e)},_performZoom:function(){var e=this._map,t=e.getZoom(),n=this._map.options.zoomSnap||0;e._stop();var s=this._delta/(this._map.options.wheelPxPerZoomLevel*4),c=4*Math.log(2/(1+Math.exp(-Math.abs(s))))/Math.LN2,l=n?Math.ceil(c/n)*n:c,d=e._limitZoom(t+(this._delta>0?l:-l))-t;this._delta=0,this._startTime=null,d&&(e.options.scrollWheelZoom===`center`?e.setZoom(t+d):e.setZoomAround(this._lastMousePos,t+d))}});J.addInitHook(`addHandler`,`scrollWheelZoom`,Bt);var Vt=600;J.mergeOptions({tapHold:U.touchNative&&U.safari&&U.mobile,tapTolerance:15});var Ht=Ge.extend({addHooks:function(){on(this._map._container,`touchstart`,this._onDown,this)},removeHooks:function(){off(this._map._container,`touchstart`,this._onDown,this)},_onDown:function(e){if(clearTimeout(this._holdTimeout),e.touches.length===1){var t=e.touches[0];this._startPos=this._newPos=new Point(t.clientX,t.clientY),this._holdTimeout=setTimeout(bind(function(){this._cancel(),this._isTapValid()&&(on(document,`touchend`,preventDefault),on(document,`touchend touchcancel`,this._cancelClickPrevent),this._simulateEvent(`contextmenu`,t))},this),Vt),on(document,`touchend touchcancel contextmenu`,this._cancel,this),on(document,`touchmove`,this._onMove,this)}},_cancelClickPrevent:function cancelClickPrevent(){off(document,`touchend`,preventDefault),off(document,`touchend touchcancel`,cancelClickPrevent)},_cancel:function(){clearTimeout(this._holdTimeout),off(document,`touchend touchcancel contextmenu`,this._cancel,this),off(document,`touchmove`,this._onMove,this)},_onMove:function(e){var t=e.touches[0];this._newPos=new Point(t.clientX,t.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(e,t){var n=new MouseEvent(e,{bubbles:!0,cancelable:!0,view:window,screenX:t.screenX,screenY:t.screenY,clientX:t.clientX,clientY:t.clientY});n._simulated=!0,t.target.dispatchEvent(n)}});J.addInitHook(`addHandler`,`tapHold`,Ht),J.mergeOptions({touchZoom:U.touch,bounceAtZoomLimits:!0});var Ut=Ge.extend({addHooks:function(){addClass(this._map._container,`leaflet-touch-zoom`),on(this._map._container,`touchstart`,this._onTouchStart,this)},removeHooks:function(){removeClass(this._map._container,`leaflet-touch-zoom`),off(this._map._container,`touchstart`,this._onTouchStart,this)},_onTouchStart:function(e){var t=this._map;if(!(!e.touches||e.touches.length!==2||t._animatingZoom||this._zooming)){var n=t.mouseEventToContainerPoint(e.touches[0]),s=t.mouseEventToContainerPoint(e.touches[1]);this._centerPoint=t.getSize()._divideBy(2),this._startLatLng=t.containerPointToLatLng(this._centerPoint),t.options.touchZoom!==`center`&&(this._pinchStartLatLng=t.containerPointToLatLng(n.add(s)._divideBy(2))),this._startDist=n.distanceTo(s),this._startZoom=t.getZoom(),this._moved=!1,this._zooming=!0,t._stop(),on(document,`touchmove`,this._onTouchMove,this),on(document,`touchend touchcancel`,this._onTouchEnd,this),preventDefault(e)}},_onTouchMove:function(e){if(!(!e.touches||e.touches.length!==2||!this._zooming)){var t=this._map,n=t.mouseEventToContainerPoint(e.touches[0]),s=t.mouseEventToContainerPoint(e.touches[1]),c=n.distanceTo(s)/this._startDist;if(this._zoom=t.getScaleZoom(c,this._startZoom),!t.options.bounceAtZoomLimits&&(this._zoom<t.getMinZoom()&&c<1||this._zoom>t.getMaxZoom()&&c>1)&&(this._zoom=t._limitZoom(this._zoom)),t.options.touchZoom===`center`){if(this._center=this._startLatLng,c===1)return}else{var l=n._add(s)._divideBy(2)._subtract(this._centerPoint);if(c===1&&l.x===0&&l.y===0)return;this._center=t.unproject(t.project(this._pinchStartLatLng,this._zoom).subtract(l),this._zoom)}this._moved||=(t._moveStart(!0,!1),!0),cancelAnimFrame(this._animRequest);var d=bind(t._move,t,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=requestAnimFrame(d,this,!0),preventDefault(e)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,cancelAnimFrame(this._animRequest),off(document,`touchmove`,this._onTouchMove,this),off(document,`touchend touchcancel`,this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});J.addInitHook(`addHandler`,`touchZoom`,Ut),J.BoxZoom=It,J.DoubleClickZoom=Lt,J.Drag=Rt,J.Keyboard=zt,J.ScrollWheelZoom=Bt,J.TapHold=Ht,J.TouchZoom=Ut,e.Bounds=Bounds,e.Browser=U,e.CRS=y,e.Canvas=At,e.Circle=pt,e.CircleMarker=ft,e.Class=Class,e.Control=Be,e.DivIcon=Tt,e.DivOverlay=St,e.DomEvent=Re,e.DomUtil=K,e.Draggable=Je,e.Evented=_,e.FeatureGroup=ot,e.GeoJSON=gt,e.GridLayer=Et,e.Handler=Ge,e.Icon=st,e.ImageOverlay=yt,e.LatLng=LatLng,e.LatLngBounds=LatLngBounds,e.Layer=it,e.LayerGroup=at,e.LineUtil=Ze,e.Map=J,e.Marker=ut,e.Mixin=Ke,e.Path=dt,e.Point=Point,e.PolyUtil=Ye,e.Polygon=ht,e.Polyline=mt,e.Popup=Ct,e.PosAnimation=ze,e.Projection=et,e.Rectangle=Ft,e.Renderer=kt,e.SVG=Pt,e.SVGOverlay=xt,e.TileLayer=Dt,e.Tooltip=wt,e.Transformation=Transformation,e.Util=h,e.VideoOverlay=bt,e.bind=bind,e.bounds=toBounds,e.canvas=canvas,e.circle=circle,e.circleMarker=circleMarker,e.control=control,e.divIcon=divIcon,e.extend=extend,e.featureGroup=featureGroup,e.geoJSON=geoJSON,e.geoJson=vt,e.gridLayer=gridLayer,e.icon=icon,e.imageOverlay=imageOverlay,e.latLng=toLatLng,e.latLngBounds=toLatLngBounds,e.layerGroup=layerGroup,e.map=createMap,e.marker=marker,e.point=toPoint,e.polygon=polygon,e.polyline=polyline,e.popup=popup,e.rectangle=rectangle,e.setOptions=setOptions,e.stamp=stamp,e.svg=svg,e.svgOverlay=svgOverlay,e.tileLayer=tileLayer,e.tooltip=tooltip,e.transformation=toTransformation,e.version=t,e.videoOverlay=videoOverlay;var Wt=window.L;e.noConflict=function(){return window.L=Wt,this},window.L=e}))}))(),1);(function(e,t,n){function o(e,t){for(;(e=e.parentElement)&&!e.classList.contains(t););return e}L.drawVersion=`1.0.4`,L.Draw={},L.drawLocal={draw:{toolbar:{actions:{title:`Cancel drawing`,text:`Cancel`},finish:{title:`Finish drawing`,text:`Finish`},undo:{title:`Delete last point drawn`,text:`Delete last point`},buttons:{polyline:`Draw a polyline`,polygon:`Draw a polygon`,rectangle:`Draw a rectangle`,circle:`Draw a circle`,marker:`Draw a marker`,circlemarker:`Draw a circlemarker`}},handlers:{circle:{tooltip:{start:`Click and drag to draw circle.`},radius:`Radius`},circlemarker:{tooltip:{start:`Click map to place circle marker.`}},marker:{tooltip:{start:`Click map to place marker.`}},polygon:{tooltip:{start:`Click to start drawing shape.`,cont:`Click to continue drawing shape.`,end:`Click first point to close this shape.`}},polyline:{error:`<strong>Error:</strong> shape edges cannot cross!`,tooltip:{start:`Click to start drawing line.`,cont:`Click to continue drawing line.`,end:`Click last point to finish line.`}},rectangle:{tooltip:{start:`Click and drag to draw rectangle.`}},simpleshape:{tooltip:{end:`Release mouse to finish drawing.`}}}},edit:{toolbar:{actions:{save:{title:`Save changes`,text:`Save`},cancel:{title:`Cancel editing, discards all changes`,text:`Cancel`},clearAll:{title:`Clear all layers`,text:`Clear All`}},buttons:{edit:`Edit layers`,editDisabled:`No layers to edit`,remove:`Delete layers`,removeDisabled:`No layers to delete`}},handlers:{edit:{tooltip:{text:`Drag handles or markers to edit features.`,subtext:`Click cancel to undo changes.`}},remove:{tooltip:{text:`Click on a feature to remove.`}}}}},L.Draw.Event={},L.Draw.Event.CREATED=`draw:created`,L.Draw.Event.EDITED=`draw:edited`,L.Draw.Event.DELETED=`draw:deleted`,L.Draw.Event.DRAWSTART=`draw:drawstart`,L.Draw.Event.DRAWSTOP=`draw:drawstop`,L.Draw.Event.DRAWVERTEX=`draw:drawvertex`,L.Draw.Event.EDITSTART=`draw:editstart`,L.Draw.Event.EDITMOVE=`draw:editmove`,L.Draw.Event.EDITRESIZE=`draw:editresize`,L.Draw.Event.EDITVERTEX=`draw:editvertex`,L.Draw.Event.EDITSTOP=`draw:editstop`,L.Draw.Event.DELETESTART=`draw:deletestart`,L.Draw.Event.DELETESTOP=`draw:deletestop`,L.Draw.Event.TOOLBAROPENED=`draw:toolbaropened`,L.Draw.Event.TOOLBARCLOSED=`draw:toolbarclosed`,L.Draw.Event.MARKERCONTEXT=`draw:markercontext`,L.Draw=L.Draw||{},L.Draw.Feature=L.Handler.extend({initialize:function(e,t){this._map=e,this._container=e._container,this._overlayPane=e._panes.overlayPane,this._popupPane=e._panes.popupPane,t&&t.shapeOptions&&(t.shapeOptions=L.Util.extend({},this.options.shapeOptions,t.shapeOptions)),L.setOptions(this,t);var n=L.version.split(`.`);parseInt(n[0],10)===1&&parseInt(n[1],10)>=2?L.Draw.Feature.include(L.Evented.prototype):L.Draw.Feature.include(L.Mixin.Events)},enable:function(){this._enabled||(L.Handler.prototype.enable.call(this),this.fire(`enabled`,{handler:this.type}),this._map.fire(L.Draw.Event.DRAWSTART,{layerType:this.type}))},disable:function(){this._enabled&&(L.Handler.prototype.disable.call(this),this._map.fire(L.Draw.Event.DRAWSTOP,{layerType:this.type}),this.fire(`disabled`,{handler:this.type}))},addHooks:function(){var e=this._map;e&&(L.DomUtil.disableTextSelection(),e.getContainer().focus(),this._tooltip=new L.Draw.Tooltip(this._map),L.DomEvent.on(this._container,`keyup`,this._cancelDrawing,this))},removeHooks:function(){this._map&&(L.DomUtil.enableTextSelection(),this._tooltip.dispose(),this._tooltip=null,L.DomEvent.off(this._container,`keyup`,this._cancelDrawing,this))},setOptions:function(e){L.setOptions(this,e)},_fireCreatedEvent:function(e){this._map.fire(L.Draw.Event.CREATED,{layer:e,layerType:this.type})},_cancelDrawing:function(e){e.keyCode===27&&(this._map.fire(`draw:canceled`,{layerType:this.type}),this.disable())}}),L.Draw.Polyline=L.Draw.Feature.extend({statics:{TYPE:`polyline`},Poly:L.Polyline,options:{allowIntersection:!0,repeatMode:!1,drawError:{color:`#b00b00`,timeout:2500},icon:new L.DivIcon({iconSize:new L.Point(8,8),className:`leaflet-div-icon leaflet-editing-icon`}),touchIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:`leaflet-div-icon leaflet-editing-icon leaflet-touch-icon`}),guidelineDistance:20,maxGuideLineLength:4e3,shapeOptions:{stroke:!0,color:`#3388ff`,weight:4,opacity:.5,fill:!1,clickable:!0},metric:!0,feet:!0,nautic:!1,showLength:!0,zIndexOffset:2e3,factor:1,maxPoints:0},initialize:function(e,t){L.Browser.touch&&(this.options.icon=this.options.touchIcon),this.options.drawError.message=L.drawLocal.draw.handlers.polyline.error,t&&t.drawError&&(t.drawError=L.Util.extend({},this.options.drawError,t.drawError)),this.type=L.Draw.Polyline.TYPE,L.Draw.Feature.prototype.initialize.call(this,e,t)},addHooks:function(){L.Draw.Feature.prototype.addHooks.call(this),this._map&&(this._markers=[],this._markerGroup=new L.LayerGroup,this._map.addLayer(this._markerGroup),this._poly=new L.Polyline([],this.options.shapeOptions),this._tooltip.updateContent(this._getTooltipText()),this._mouseMarker||=L.marker(this._map.getCenter(),{icon:L.divIcon({className:`leaflet-mouse-marker`,iconAnchor:[20,20],iconSize:[40,40]}),opacity:0,zIndexOffset:this.options.zIndexOffset}),this._mouseMarker.on(`mouseout`,this._onMouseOut,this).on(`mousemove`,this._onMouseMove,this).on(`mousedown`,this._onMouseDown,this).on(`mouseup`,this._onMouseUp,this).addTo(this._map),this._map.on(`mouseup`,this._onMouseUp,this).on(`mousemove`,this._onMouseMove,this).on(`zoomlevelschange`,this._onZoomEnd,this).on(`touchstart`,this._onTouch,this).on(`zoomend`,this._onZoomEnd,this))},removeHooks:function(){L.Draw.Feature.prototype.removeHooks.call(this),this._clearHideErrorTimeout(),this._cleanUpShape(),this._map.removeLayer(this._markerGroup),delete this._markerGroup,delete this._markers,this._map.removeLayer(this._poly),delete this._poly,this._mouseMarker.off(`mousedown`,this._onMouseDown,this).off(`mouseout`,this._onMouseOut,this).off(`mouseup`,this._onMouseUp,this).off(`mousemove`,this._onMouseMove,this),this._map.removeLayer(this._mouseMarker),delete this._mouseMarker,this._clearGuides(),this._map.off(`mouseup`,this._onMouseUp,this).off(`mousemove`,this._onMouseMove,this).off(`zoomlevelschange`,this._onZoomEnd,this).off(`zoomend`,this._onZoomEnd,this).off(`touchstart`,this._onTouch,this).off(`click`,this._onTouch,this)},deleteLastVertex:function(){if(!(this._markers.length<=1)){var e=this._markers.pop(),t=this._poly,n=t.getLatLngs(),s=n.splice(-1,1)[0];this._poly.setLatLngs(n),this._markerGroup.removeLayer(e),t.getLatLngs().length<2&&this._map.removeLayer(t),this._vertexChanged(s,!1)}},addVertex:function(e){if(this._markers.length>=2&&!this.options.allowIntersection&&this._poly.newLatLngIntersects(e))return void this._showErrorTooltip();this._errorShown&&this._hideErrorTooltip(),this._markers.push(this._createMarker(e)),this._poly.addLatLng(e),this._poly.getLatLngs().length===2&&this._map.addLayer(this._poly),this._vertexChanged(e,!0)},completeShape:function(){this._markers.length<=1||!this._shapeIsValid()||(this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable())},_finishShape:function(){var e=this._poly._defaultShape?this._poly._defaultShape():this._poly.getLatLngs(),t=this._poly.newLatLngIntersects(e[e.length-1]);if(!this.options.allowIntersection&&t||!this._shapeIsValid())return void this._showErrorTooltip();this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable()},_shapeIsValid:function(){return!0},_onZoomEnd:function(){this._markers!==null&&this._updateGuide()},_onMouseMove:function(e){var t=this._map.mouseEventToLayerPoint(e.originalEvent),n=this._map.layerPointToLatLng(t);this._currentLatLng=n,this._updateTooltip(n),this._updateGuide(t),this._mouseMarker.setLatLng(n),L.DomEvent.preventDefault(e.originalEvent)},_vertexChanged:function(e,t){this._map.fire(L.Draw.Event.DRAWVERTEX,{layers:this._markerGroup}),this._updateFinishHandler(),this._updateRunningMeasure(e,t),this._clearGuides(),this._updateTooltip()},_onMouseDown:function(e){if(!this._clickHandled&&!this._touchHandled&&!this._disableMarkers){this._onMouseMove(e),this._clickHandled=!0,this._disableNewMarkers();var t=e.originalEvent,n=t.clientX,s=t.clientY;this._startPoint.call(this,n,s)}},_startPoint:function(e,t){this._mouseDownOrigin=L.point(e,t)},_onMouseUp:function(e){var t=e.originalEvent,n=t.clientX,s=t.clientY;this._endPoint.call(this,n,s,e),this._clickHandled=null},_endPoint:function(t,n,s){if(this._mouseDownOrigin){var c=L.point(t,n).distanceTo(this._mouseDownOrigin),l=this._calculateFinishDistance(s.latlng);this.options.maxPoints>1&&this.options.maxPoints==this._markers.length+1?(this.addVertex(s.latlng),this._finishShape()):l<10&&L.Browser.touch?this._finishShape():Math.abs(c)<9*(e.devicePixelRatio||1)&&this.addVertex(s.latlng),this._enableNewMarkers()}this._mouseDownOrigin=null},_onTouch:function(e){var t,n,s=e.originalEvent;!s.touches||!s.touches[0]||this._clickHandled||this._touchHandled||this._disableMarkers||(t=s.touches[0].clientX,n=s.touches[0].clientY,this._disableNewMarkers(),this._touchHandled=!0,this._startPoint.call(this,t,n),this._endPoint.call(this,t,n,e),this._touchHandled=null),this._clickHandled=null},_onMouseOut:function(){this._tooltip&&this._tooltip._onMouseOut.call(this._tooltip)},_calculateFinishDistance:function(e){var t;if(this._markers.length>0){var n;if(this.type===L.Draw.Polyline.TYPE)n=this._markers[this._markers.length-1];else{if(this.type!==L.Draw.Polygon.TYPE)return 1/0;n=this._markers[0]}var s=this._map.latLngToContainerPoint(n.getLatLng()),c=new L.Marker(e,{icon:this.options.icon,zIndexOffset:2*this.options.zIndexOffset}),l=this._map.latLngToContainerPoint(c.getLatLng());t=s.distanceTo(l)}else t=1/0;return t},_updateFinishHandler:function(){var e=this._markers.length;e>1&&this._markers[e-1].on(`click`,this._finishShape,this),e>2&&this._markers[e-2].off(`click`,this._finishShape,this)},_createMarker:function(e){var t=new L.Marker(e,{icon:this.options.icon,zIndexOffset:2*this.options.zIndexOffset});return this._markerGroup.addLayer(t),t},_updateGuide:function(e){var t=this._markers?this._markers.length:0;t>0&&(e||=this._map.latLngToLayerPoint(this._currentLatLng),this._clearGuides(),this._drawGuide(this._map.latLngToLayerPoint(this._markers[t-1].getLatLng()),e))},_updateTooltip:function(e){var t=this._getTooltipText();e&&this._tooltip.updatePosition(e),this._errorShown||this._tooltip.updateContent(t)},_drawGuide:function(e,t){var n,s,c,l=Math.floor(Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)),d=this.options.guidelineDistance,f=this.options.maxGuideLineLength,p=l>f?l-f:d;for(this._guidesContainer||=L.DomUtil.create(`div`,`leaflet-draw-guides`,this._overlayPane);p<l;p+=this.options.guidelineDistance)n=p/l,s={x:Math.floor(e.x*(1-n)+n*t.x),y:Math.floor(e.y*(1-n)+n*t.y)},c=L.DomUtil.create(`div`,`leaflet-draw-guide-dash`,this._guidesContainer),c.style.backgroundColor=this._errorShown?this.options.drawError.color:this.options.shapeOptions.color,L.DomUtil.setPosition(c,s)},_updateGuideColor:function(e){if(this._guidesContainer)for(var t=0,n=this._guidesContainer.childNodes.length;t<n;t++)this._guidesContainer.childNodes[t].style.backgroundColor=e},_clearGuides:function(){if(this._guidesContainer)for(;this._guidesContainer.firstChild;)this._guidesContainer.removeChild(this._guidesContainer.firstChild)},_getTooltipText:function(){var e,t,n=this.options.showLength;return this._markers.length===0?e={text:L.drawLocal.draw.handlers.polyline.tooltip.start}:(t=n?this._getMeasurementString():``,e=this._markers.length===1?{text:L.drawLocal.draw.handlers.polyline.tooltip.cont,subtext:t}:{text:L.drawLocal.draw.handlers.polyline.tooltip.end,subtext:t}),e},_updateRunningMeasure:function(e,t){var n,s,c=this._markers.length;this._markers.length===1?this._measurementRunningTotal=0:(n=c-(t?2:1),s=L.GeometryUtil.isVersion07x()?e.distanceTo(this._markers[n].getLatLng())*(this.options.factor||1):this._map.distance(e,this._markers[n].getLatLng())*(this.options.factor||1),this._measurementRunningTotal+=s*(t?1:-1))},_getMeasurementString:function(){var e,t=this._currentLatLng,n=this._markers[this._markers.length-1].getLatLng();return e=L.GeometryUtil.isVersion07x()?n&&t&&t.distanceTo?this._measurementRunningTotal+t.distanceTo(n)*(this.options.factor||1):this._measurementRunningTotal||0:n&&t?this._measurementRunningTotal+this._map.distance(t,n)*(this.options.factor||1):this._measurementRunningTotal||0,L.GeometryUtil.readableDistance(e,this.options.metric,this.options.feet,this.options.nautic,this.options.precision)},_showErrorTooltip:function(){this._errorShown=!0,this._tooltip.showAsError().updateContent({text:this.options.drawError.message}),this._updateGuideColor(this.options.drawError.color),this._poly.setStyle({color:this.options.drawError.color}),this._clearHideErrorTimeout(),this._hideErrorTimeout=setTimeout(L.Util.bind(this._hideErrorTooltip,this),this.options.drawError.timeout)},_hideErrorTooltip:function(){this._errorShown=!1,this._clearHideErrorTimeout(),this._tooltip.removeError().updateContent(this._getTooltipText()),this._updateGuideColor(this.options.shapeOptions.color),this._poly.setStyle({color:this.options.shapeOptions.color})},_clearHideErrorTimeout:function(){this._hideErrorTimeout&&=(clearTimeout(this._hideErrorTimeout),null)},_disableNewMarkers:function(){this._disableMarkers=!0},_enableNewMarkers:function(){setTimeout(function(){this._disableMarkers=!1}.bind(this),50)},_cleanUpShape:function(){this._markers.length>1&&this._markers[this._markers.length-1].off(`click`,this._finishShape,this)},_fireCreatedEvent:function(){var e=new this.Poly(this._poly.getLatLngs(),this.options.shapeOptions);L.Draw.Feature.prototype._fireCreatedEvent.call(this,e)}}),L.Draw.Polygon=L.Draw.Polyline.extend({statics:{TYPE:`polygon`},Poly:L.Polygon,options:{showArea:!1,showLength:!1,shapeOptions:{stroke:!0,color:`#3388ff`,weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0},metric:!0,feet:!0,nautic:!1,precision:{}},initialize:function(e,t){L.Draw.Polyline.prototype.initialize.call(this,e,t),this.type=L.Draw.Polygon.TYPE},_updateFinishHandler:function(){var e=this._markers.length;e===1&&this._markers[0].on(`click`,this._finishShape,this),e>2&&(this._markers[e-1].on(`dblclick`,this._finishShape,this),e>3&&this._markers[e-2].off(`dblclick`,this._finishShape,this))},_getTooltipText:function(){var e,t;return this._markers.length===0?e=L.drawLocal.draw.handlers.polygon.tooltip.start:this._markers.length<3?(e=L.drawLocal.draw.handlers.polygon.tooltip.cont,t=this._getMeasurementString()):(e=L.drawLocal.draw.handlers.polygon.tooltip.end,t=this._getMeasurementString()),{text:e,subtext:t}},_getMeasurementString:function(){var e=this._area,t=``;return e||this.options.showLength?(this.options.showLength&&(t=L.Draw.Polyline.prototype._getMeasurementString.call(this)),e&&(t+=`<br>`+L.GeometryUtil.readableArea(e,this.options.metric,this.options.precision)),t):null},_shapeIsValid:function(){return this._markers.length>=3},_vertexChanged:function(e,t){var n;!this.options.allowIntersection&&this.options.showArea&&(n=this._poly.getLatLngs(),this._area=L.GeometryUtil.geodesicArea(n)),L.Draw.Polyline.prototype._vertexChanged.call(this,e,t)},_cleanUpShape:function(){var e=this._markers.length;e>0&&(this._markers[0].off(`click`,this._finishShape,this),e>2&&this._markers[e-1].off(`dblclick`,this._finishShape,this))}}),L.SimpleShape={},L.Draw.SimpleShape=L.Draw.Feature.extend({options:{repeatMode:!1},initialize:function(e,t){this._endLabelText=L.drawLocal.draw.handlers.simpleshape.tooltip.end,L.Draw.Feature.prototype.initialize.call(this,e,t)},addHooks:function(){L.Draw.Feature.prototype.addHooks.call(this),this._map&&(this._mapDraggable=this._map.dragging.enabled(),this._mapDraggable&&this._map.dragging.disable(),this._container.style.cursor=`crosshair`,this._tooltip.updateContent({text:this._initialLabelText}),this._map.on(`mousedown`,this._onMouseDown,this).on(`mousemove`,this._onMouseMove,this).on(`touchstart`,this._onMouseDown,this).on(`touchmove`,this._onMouseMove,this),t.addEventListener(`touchstart`,L.DomEvent.preventDefault,{passive:!1}))},removeHooks:function(){L.Draw.Feature.prototype.removeHooks.call(this),this._map&&(this._mapDraggable&&this._map.dragging.enable(),this._container.style.cursor=``,this._map.off(`mousedown`,this._onMouseDown,this).off(`mousemove`,this._onMouseMove,this).off(`touchstart`,this._onMouseDown,this).off(`touchmove`,this._onMouseMove,this),L.DomEvent.off(t,`mouseup`,this._onMouseUp,this),L.DomEvent.off(t,`touchend`,this._onMouseUp,this),t.removeEventListener(`touchstart`,L.DomEvent.preventDefault),this._shape&&(this._map.removeLayer(this._shape),delete this._shape)),this._isDrawing=!1},_getTooltipText:function(){return{text:this._endLabelText}},_onMouseDown:function(e){this._isDrawing=!0,this._startLatLng=e.latlng,L.DomEvent.on(t,`mouseup`,this._onMouseUp,this).on(t,`touchend`,this._onMouseUp,this).preventDefault(e.originalEvent)},_onMouseMove:function(e){var t=e.latlng;this._tooltip.updatePosition(t),this._isDrawing&&(this._tooltip.updateContent(this._getTooltipText()),this._drawShape(t))},_onMouseUp:function(){this._shape&&this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable()}}),L.Draw.Rectangle=L.Draw.SimpleShape.extend({statics:{TYPE:`rectangle`},options:{shapeOptions:{stroke:!0,color:`#3388ff`,weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0},showArea:!0,metric:!0},initialize:function(e,t){this.type=L.Draw.Rectangle.TYPE,this._initialLabelText=L.drawLocal.draw.handlers.rectangle.tooltip.start,L.Draw.SimpleShape.prototype.initialize.call(this,e,t)},disable:function(){this._enabled&&(this._isCurrentlyTwoClickDrawing=!1,L.Draw.SimpleShape.prototype.disable.call(this))},_onMouseUp:function(e){if(!this._shape&&!this._isCurrentlyTwoClickDrawing)return void(this._isCurrentlyTwoClickDrawing=!0);this._isCurrentlyTwoClickDrawing&&!o(e.target,`leaflet-pane`)||L.Draw.SimpleShape.prototype._onMouseUp.call(this)},_drawShape:function(e){this._shape?this._shape.setBounds(new L.LatLngBounds(this._startLatLng,e)):(this._shape=new L.Rectangle(new L.LatLngBounds(this._startLatLng,e),this.options.shapeOptions),this._map.addLayer(this._shape))},_fireCreatedEvent:function(){var e=new L.Rectangle(this._shape.getBounds(),this.options.shapeOptions);L.Draw.SimpleShape.prototype._fireCreatedEvent.call(this,e)},_getTooltipText:function(){var e,t,n,s=L.Draw.SimpleShape.prototype._getTooltipText.call(this),c=this._shape,l=this.options.showArea;return c&&(e=this._shape._defaultShape?this._shape._defaultShape():this._shape.getLatLngs(),t=L.GeometryUtil.geodesicArea(e),n=l?L.GeometryUtil.readableArea(t,this.options.metric):``),{text:s.text,subtext:n}}}),L.Draw.Marker=L.Draw.Feature.extend({statics:{TYPE:`marker`},options:{icon:new L.Icon.Default,repeatMode:!1,zIndexOffset:2e3},initialize:function(e,t){this.type=L.Draw.Marker.TYPE,this._initialLabelText=L.drawLocal.draw.handlers.marker.tooltip.start,L.Draw.Feature.prototype.initialize.call(this,e,t)},addHooks:function(){L.Draw.Feature.prototype.addHooks.call(this),this._map&&(this._tooltip.updateContent({text:this._initialLabelText}),this._mouseMarker||=L.marker(this._map.getCenter(),{icon:L.divIcon({className:`leaflet-mouse-marker`,iconAnchor:[20,20],iconSize:[40,40]}),opacity:0,zIndexOffset:this.options.zIndexOffset}),this._mouseMarker.on(`click`,this._onClick,this).addTo(this._map),this._map.on(`mousemove`,this._onMouseMove,this),this._map.on(`click`,this._onTouch,this))},removeHooks:function(){L.Draw.Feature.prototype.removeHooks.call(this),this._map&&(this._map.off(`click`,this._onClick,this).off(`click`,this._onTouch,this),this._marker&&(this._marker.off(`click`,this._onClick,this),this._map.removeLayer(this._marker),delete this._marker),this._mouseMarker.off(`click`,this._onClick,this),this._map.removeLayer(this._mouseMarker),delete this._mouseMarker,this._map.off(`mousemove`,this._onMouseMove,this))},_onMouseMove:function(e){var t=e.latlng;this._tooltip.updatePosition(t),this._mouseMarker.setLatLng(t),this._marker?(t=this._mouseMarker.getLatLng(),this._marker.setLatLng(t)):(this._marker=this._createMarker(t),this._marker.on(`click`,this._onClick,this),this._map.on(`click`,this._onClick,this).addLayer(this._marker))},_createMarker:function(e){return new L.Marker(e,{icon:this.options.icon,zIndexOffset:this.options.zIndexOffset})},_onClick:function(){this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable()},_onTouch:function(e){this._onMouseMove(e),this._onClick()},_fireCreatedEvent:function(){var e=new L.Marker.Touch(this._marker.getLatLng(),{icon:this.options.icon});L.Draw.Feature.prototype._fireCreatedEvent.call(this,e)}}),L.Draw.CircleMarker=L.Draw.Marker.extend({statics:{TYPE:`circlemarker`},options:{stroke:!0,color:`#3388ff`,weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0,zIndexOffset:2e3},initialize:function(e,t){this.type=L.Draw.CircleMarker.TYPE,this._initialLabelText=L.drawLocal.draw.handlers.circlemarker.tooltip.start,L.Draw.Feature.prototype.initialize.call(this,e,t)},_fireCreatedEvent:function(){var e=new L.CircleMarker(this._marker.getLatLng(),this.options);L.Draw.Feature.prototype._fireCreatedEvent.call(this,e)},_createMarker:function(e){return new L.CircleMarker(e,this.options)}}),L.Draw.Circle=L.Draw.SimpleShape.extend({statics:{TYPE:`circle`},options:{shapeOptions:{stroke:!0,color:`#3388ff`,weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0},showRadius:!0,metric:!0,feet:!0,nautic:!1},initialize:function(e,t){this.type=L.Draw.Circle.TYPE,this._initialLabelText=L.drawLocal.draw.handlers.circle.tooltip.start,L.Draw.SimpleShape.prototype.initialize.call(this,e,t)},_drawShape:function(e){if(L.GeometryUtil.isVersion07x())var t=this._startLatLng.distanceTo(e);else var t=this._map.distance(this._startLatLng,e);this._shape?this._shape.setRadius(t):(this._shape=new L.Circle(this._startLatLng,t,this.options.shapeOptions),this._map.addLayer(this._shape))},_fireCreatedEvent:function(){var e=new L.Circle(this._startLatLng,this._shape.getRadius(),this.options.shapeOptions);L.Draw.SimpleShape.prototype._fireCreatedEvent.call(this,e)},_onMouseMove:function(e){var t,n=e.latlng,s=this.options.showRadius,c=this.options.metric;if(this._tooltip.updatePosition(n),this._isDrawing){this._drawShape(n),t=this._shape.getRadius().toFixed(1);var l=``;s&&(l=L.drawLocal.draw.handlers.circle.radius+`: `+L.GeometryUtil.readableDistance(t,c,this.options.feet,this.options.nautic)),this._tooltip.updateContent({text:this._endLabelText,subtext:l})}}}),L.Edit=L.Edit||{},L.Edit.Marker=L.Handler.extend({initialize:function(e,t){this._marker=e,L.setOptions(this,t)},addHooks:function(){var e=this._marker;e.dragging.enable(),e.on(`dragend`,this._onDragEnd,e),this._toggleMarkerHighlight()},removeHooks:function(){var e=this._marker;e.dragging.disable(),e.off(`dragend`,this._onDragEnd,e),this._toggleMarkerHighlight()},_onDragEnd:function(e){var t=e.target;t.edited=!0,this._map.fire(L.Draw.Event.EDITMOVE,{layer:t})},_toggleMarkerHighlight:function(){var e=this._marker._icon;e&&(e.style.display=`none`,L.DomUtil.hasClass(e,`leaflet-edit-marker-selected`)?(L.DomUtil.removeClass(e,`leaflet-edit-marker-selected`),this._offsetMarker(e,-4)):(L.DomUtil.addClass(e,`leaflet-edit-marker-selected`),this._offsetMarker(e,4)),e.style.display=``)},_offsetMarker:function(e,t){var n=parseInt(e.style.marginTop,10)-t,s=parseInt(e.style.marginLeft,10)-t;e.style.marginTop=n+`px`,e.style.marginLeft=s+`px`}}),L.Marker.addInitHook(function(){L.Edit.Marker&&(this.editing=new L.Edit.Marker(this),this.options.editable&&this.editing.enable())}),L.Edit=L.Edit||{},L.Edit.Poly=L.Handler.extend({initialize:function(e){this.latlngs=[e._latlngs],e._holes&&(this.latlngs=this.latlngs.concat(e._holes)),this._poly=e,this._poly.on(`revert-edited`,this._updateLatLngs,this)},_defaultShape:function(){return L.Polyline._flat?L.Polyline._flat(this._poly._latlngs)?this._poly._latlngs:this._poly._latlngs[0]:this._poly._latlngs},_eachVertexHandler:function(e){for(var t=0;t<this._verticesHandlers.length;t++)e(this._verticesHandlers[t])},addHooks:function(){this._initHandlers(),this._eachVertexHandler(function(e){e.addHooks()})},removeHooks:function(){this._eachVertexHandler(function(e){e.removeHooks()})},updateMarkers:function(){this._eachVertexHandler(function(e){e.updateMarkers()})},_initHandlers:function(){this._verticesHandlers=[];for(var e=0;e<this.latlngs.length;e++)this._verticesHandlers.push(new L.Edit.PolyVerticesEdit(this._poly,this.latlngs[e],this._poly.options.poly))},_updateLatLngs:function(e){this.latlngs=[e.layer._latlngs],e.layer._holes&&(this.latlngs=this.latlngs.concat(e.layer._holes))}}),L.Edit.PolyVerticesEdit=L.Handler.extend({options:{icon:new L.DivIcon({iconSize:new L.Point(8,8),className:`leaflet-div-icon leaflet-editing-icon`}),touchIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:`leaflet-div-icon leaflet-editing-icon leaflet-touch-icon`}),drawError:{color:`#b00b00`,timeout:1e3}},initialize:function(e,t,n){L.Browser.touch&&(this.options.icon=this.options.touchIcon),this._poly=e,n&&n.drawError&&(n.drawError=L.Util.extend({},this.options.drawError,n.drawError)),this._latlngs=t,L.setOptions(this,n)},_defaultShape:function(){return L.Polyline._flat?L.Polyline._flat(this._latlngs)?this._latlngs:this._latlngs[0]:this._latlngs},addHooks:function(){var e=this._poly,t=e._path;e instanceof L.Polygon||(e.options.fill=!1,e.options.editing&&(e.options.editing.fill=!1)),t&&e.options.editing&&e.options.editing.className&&(e.options.original.className&&e.options.original.className.split(` `).forEach(function(e){L.DomUtil.removeClass(t,e)}),e.options.editing.className.split(` `).forEach(function(e){L.DomUtil.addClass(t,e)})),e.setStyle(e.options.editing),this._poly._map&&(this._map=this._poly._map,this._markerGroup||this._initMarkers(),this._poly._map.addLayer(this._markerGroup))},removeHooks:function(){var e=this._poly,t=e._path;t&&e.options.editing&&e.options.editing.className&&(e.options.editing.className.split(` `).forEach(function(e){L.DomUtil.removeClass(t,e)}),e.options.original.className&&e.options.original.className.split(` `).forEach(function(e){L.DomUtil.addClass(t,e)})),e.setStyle(e.options.original),e._map&&(e._map.removeLayer(this._markerGroup),delete this._markerGroup,delete this._markers)},updateMarkers:function(){this._markerGroup.clearLayers(),this._initMarkers()},_initMarkers:function(){this._markerGroup||=new L.LayerGroup,this._markers=[];var e,t,n,s,c=this._defaultShape();for(e=0,n=c.length;e<n;e++)s=this._createMarker(c[e],e),s.on(`click`,this._onMarkerClick,this),s.on(`contextmenu`,this._onContextMenu,this),this._markers.push(s);var l,d;for(e=0,t=n-1;e<n;t=e++)(e!==0||L.Polygon&&this._poly instanceof L.Polygon)&&(l=this._markers[t],d=this._markers[e],this._createMiddleMarker(l,d),this._updatePrevNext(l,d))},_createMarker:function(e,t){var n=new L.Marker.Touch(e,{draggable:!0,icon:this.options.icon});return n._origLatLng=e,n._index=t,n.on(`dragstart`,this._onMarkerDragStart,this).on(`drag`,this._onMarkerDrag,this).on(`dragend`,this._fireEdit,this).on(`touchmove`,this._onTouchMove,this).on(`touchend`,this._fireEdit,this).on(`MSPointerMove`,this._onTouchMove,this).on(`MSPointerUp`,this._fireEdit,this),this._markerGroup.addLayer(n),n},_onMarkerDragStart:function(){this._poly.fire(`editstart`)},_spliceLatLngs:function(){var e=this._defaultShape(),t=[].splice.apply(e,arguments);return this._poly._convertLatLngs(e,!0),this._poly.redraw(),t},_removeMarker:function(e){var t=e._index;this._markerGroup.removeLayer(e),this._markers.splice(t,1),this._spliceLatLngs(t,1),this._updateIndexes(t,-1),e.off(`dragstart`,this._onMarkerDragStart,this).off(`drag`,this._onMarkerDrag,this).off(`dragend`,this._fireEdit,this).off(`touchmove`,this._onMarkerDrag,this).off(`touchend`,this._fireEdit,this).off(`click`,this._onMarkerClick,this).off(`MSPointerMove`,this._onTouchMove,this).off(`MSPointerUp`,this._fireEdit,this)},_fireEdit:function(){this._poly.edited=!0,this._poly.fire(`edit`),this._poly._map.fire(L.Draw.Event.EDITVERTEX,{layers:this._markerGroup,poly:this._poly})},_onMarkerDrag:function(e){var t=e.target,n=this._poly,s=L.LatLngUtil.cloneLatLng(t._origLatLng);if(L.extend(t._origLatLng,t._latlng),n.options.poly){var c=n._map._editTooltip;if(!n.options.poly.allowIntersection&&n.intersects()){L.extend(t._origLatLng,s),t.setLatLng(s);var l=n.options.color;n.setStyle({color:this.options.drawError.color}),c&&c.updateContent({text:L.drawLocal.draw.handlers.polyline.error}),setTimeout(function(){n.setStyle({color:l}),c&&c.updateContent({text:L.drawLocal.edit.handlers.edit.tooltip.text,subtext:L.drawLocal.edit.handlers.edit.tooltip.subtext})},1e3)}}t._middleLeft&&t._middleLeft.setLatLng(this._getMiddleLatLng(t._prev,t)),t._middleRight&&t._middleRight.setLatLng(this._getMiddleLatLng(t,t._next)),this._poly._bounds._southWest=L.latLng(1/0,1/0),this._poly._bounds._northEast=L.latLng(-1/0,-1/0);var d=this._poly.getLatLngs();this._poly._convertLatLngs(d,!0),this._poly.redraw(),this._poly.fire(`editdrag`)},_onMarkerClick:function(e){var t=L.Polygon&&this._poly instanceof L.Polygon?4:3,n=e.target;this._defaultShape().length<t||(this._removeMarker(n),this._updatePrevNext(n._prev,n._next),n._middleLeft&&this._markerGroup.removeLayer(n._middleLeft),n._middleRight&&this._markerGroup.removeLayer(n._middleRight),n._prev&&n._next?this._createMiddleMarker(n._prev,n._next):n._prev?n._next||(n._prev._middleRight=null):n._next._middleLeft=null,this._fireEdit())},_onContextMenu:function(e){var t=e.target;this._poly,this._poly._map.fire(L.Draw.Event.MARKERCONTEXT,{marker:t,layers:this._markerGroup,poly:this._poly}),L.DomEvent.stopPropagation},_onTouchMove:function(e){var t=this._map.mouseEventToLayerPoint(e.originalEvent.touches[0]),n=this._map.layerPointToLatLng(t),s=e.target;L.extend(s._origLatLng,n),s._middleLeft&&s._middleLeft.setLatLng(this._getMiddleLatLng(s._prev,s)),s._middleRight&&s._middleRight.setLatLng(this._getMiddleLatLng(s,s._next)),this._poly.redraw(),this.updateMarkers()},_updateIndexes:function(e,t){this._markerGroup.eachLayer(function(n){n._index>e&&(n._index+=t)})},_createMiddleMarker:function(e,t){var i,o,a,n=this._getMiddleLatLng(e,t),s=this._createMarker(n);s.setOpacity(.6),e._middleRight=t._middleLeft=s,o=function(){s.off(`touchmove`,o,this);var c=t._index;s._index=c,s.off(`click`,i,this).on(`click`,this._onMarkerClick,this),n.lat=s.getLatLng().lat,n.lng=s.getLatLng().lng,this._spliceLatLngs(c,0,n),this._markers.splice(c,0,s),s.setOpacity(1),this._updateIndexes(c,1),t._index++,this._updatePrevNext(e,s),this._updatePrevNext(s,t),this._poly.fire(`editstart`)},a=function(){s.off(`dragstart`,o,this),s.off(`dragend`,a,this),s.off(`touchmove`,o,this),this._createMiddleMarker(e,s),this._createMiddleMarker(s,t)},i=function(){o.call(this),a.call(this),this._fireEdit()},s.on(`click`,i,this).on(`dragstart`,o,this).on(`dragend`,a,this).on(`touchmove`,o,this),this._markerGroup.addLayer(s)},_updatePrevNext:function(e,t){e&&(e._next=t),t&&(t._prev=e)},_getMiddleLatLng:function(e,t){var n=this._poly._map,s=n.project(e.getLatLng()),c=n.project(t.getLatLng());return n.unproject(s._add(c)._divideBy(2))}}),L.Polyline.addInitHook(function(){this.editing||(L.Edit.Poly&&(this.editing=new L.Edit.Poly(this),this.options.editable&&this.editing.enable()),this.on(`add`,function(){this.editing&&this.editing.enabled()&&this.editing.addHooks()}),this.on(`remove`,function(){this.editing&&this.editing.enabled()&&this.editing.removeHooks()}))}),L.Edit=L.Edit||{},L.Edit.SimpleShape=L.Handler.extend({options:{moveIcon:new L.DivIcon({iconSize:new L.Point(8,8),className:`leaflet-div-icon leaflet-editing-icon leaflet-edit-move`}),resizeIcon:new L.DivIcon({iconSize:new L.Point(8,8),className:`leaflet-div-icon leaflet-editing-icon leaflet-edit-resize`}),touchMoveIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:`leaflet-div-icon leaflet-editing-icon leaflet-edit-move leaflet-touch-icon`}),touchResizeIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:`leaflet-div-icon leaflet-editing-icon leaflet-edit-resize leaflet-touch-icon`})},initialize:function(e,t){L.Browser.touch&&(this.options.moveIcon=this.options.touchMoveIcon,this.options.resizeIcon=this.options.touchResizeIcon),this._shape=e,L.Util.setOptions(this,t)},addHooks:function(){var e=this._shape;this._shape._map&&(this._map=this._shape._map,e.setStyle(e.options.editing),e._map&&(this._map=e._map,this._markerGroup||this._initMarkers(),this._map.addLayer(this._markerGroup)))},removeHooks:function(){var e=this._shape;if(e.setStyle(e.options.original),e._map){this._unbindMarker(this._moveMarker);for(var t=0,n=this._resizeMarkers.length;t<n;t++)this._unbindMarker(this._resizeMarkers[t]);this._resizeMarkers=null,this._map.removeLayer(this._markerGroup),delete this._markerGroup}this._map=null},updateMarkers:function(){this._markerGroup.clearLayers(),this._initMarkers()},_initMarkers:function(){this._markerGroup||=new L.LayerGroup,this._createMoveMarker(),this._createResizeMarker()},_createMoveMarker:function(){},_createResizeMarker:function(){},_createMarker:function(e,t){var n=new L.Marker.Touch(e,{draggable:!0,icon:t,zIndexOffset:10});return this._bindMarker(n),this._markerGroup.addLayer(n),n},_bindMarker:function(e){e.on(`dragstart`,this._onMarkerDragStart,this).on(`drag`,this._onMarkerDrag,this).on(`dragend`,this._onMarkerDragEnd,this).on(`touchstart`,this._onTouchStart,this).on(`touchmove`,this._onTouchMove,this).on(`MSPointerMove`,this._onTouchMove,this).on(`touchend`,this._onTouchEnd,this).on(`MSPointerUp`,this._onTouchEnd,this)},_unbindMarker:function(e){e.off(`dragstart`,this._onMarkerDragStart,this).off(`drag`,this._onMarkerDrag,this).off(`dragend`,this._onMarkerDragEnd,this).off(`touchstart`,this._onTouchStart,this).off(`touchmove`,this._onTouchMove,this).off(`MSPointerMove`,this._onTouchMove,this).off(`touchend`,this._onTouchEnd,this).off(`MSPointerUp`,this._onTouchEnd,this)},_onMarkerDragStart:function(e){e.target.setOpacity(0),this._shape.fire(`editstart`)},_fireEdit:function(){this._shape.edited=!0,this._shape.fire(`edit`)},_onMarkerDrag:function(e){var t=e.target,n=t.getLatLng();t===this._moveMarker?this._move(n):this._resize(n),this._shape.redraw(),this._shape.fire(`editdrag`)},_onMarkerDragEnd:function(e){e.target.setOpacity(1),this._fireEdit()},_onTouchStart:function(e){if(L.Edit.SimpleShape.prototype._onMarkerDragStart.call(this,e),typeof this._getCorners==`function`){var t=this._getCorners(),n=e.target,s=n._cornerIndex;n.setOpacity(0),this._oppositeCorner=t[(s+2)%4],this._toggleCornerMarkers(0,s)}this._shape.fire(`editstart`)},_onTouchMove:function(e){var t=this._map.mouseEventToLayerPoint(e.originalEvent.touches[0]),n=this._map.layerPointToLatLng(t);return e.target===this._moveMarker?this._move(n):this._resize(n),this._shape.redraw(),!1},_onTouchEnd:function(e){e.target.setOpacity(1),this.updateMarkers(),this._fireEdit()},_move:function(){},_resize:function(){}}),L.Edit=L.Edit||{},L.Edit.Rectangle=L.Edit.SimpleShape.extend({_createMoveMarker:function(){var e=this._shape.getBounds().getCenter();this._moveMarker=this._createMarker(e,this.options.moveIcon)},_createResizeMarker:function(){var e=this._getCorners();this._resizeMarkers=[];for(var t=0,n=e.length;t<n;t++)this._resizeMarkers.push(this._createMarker(e[t],this.options.resizeIcon)),this._resizeMarkers[t]._cornerIndex=t},_onMarkerDragStart:function(e){L.Edit.SimpleShape.prototype._onMarkerDragStart.call(this,e);var t=this._getCorners(),n=e.target._cornerIndex;this._oppositeCorner=t[(n+2)%4],this._toggleCornerMarkers(0,n)},_onMarkerDragEnd:function(e){var t,n,s=e.target;s===this._moveMarker&&(t=this._shape.getBounds(),n=t.getCenter(),s.setLatLng(n)),this._toggleCornerMarkers(1),this._repositionCornerMarkers(),L.Edit.SimpleShape.prototype._onMarkerDragEnd.call(this,e)},_move:function(e){for(var t,n=this._shape._defaultShape?this._shape._defaultShape():this._shape.getLatLngs(),s=this._shape.getBounds().getCenter(),c=[],l=0,d=n.length;l<d;l++)t=[n[l].lat-s.lat,n[l].lng-s.lng],c.push([e.lat+t[0],e.lng+t[1]]);this._shape.setLatLngs(c),this._repositionCornerMarkers(),this._map.fire(L.Draw.Event.EDITMOVE,{layer:this._shape})},_resize:function(e){var t;this._shape.setBounds(L.latLngBounds(e,this._oppositeCorner)),t=this._shape.getBounds(),this._moveMarker.setLatLng(t.getCenter()),this._map.fire(L.Draw.Event.EDITRESIZE,{layer:this._shape})},_getCorners:function(){var e=this._shape.getBounds();return[e.getNorthWest(),e.getNorthEast(),e.getSouthEast(),e.getSouthWest()]},_toggleCornerMarkers:function(e){for(var t=0,n=this._resizeMarkers.length;t<n;t++)this._resizeMarkers[t].setOpacity(e)},_repositionCornerMarkers:function(){for(var e=this._getCorners(),t=0,n=this._resizeMarkers.length;t<n;t++)this._resizeMarkers[t].setLatLng(e[t])}}),L.Rectangle.addInitHook(function(){L.Edit.Rectangle&&(this.editing=new L.Edit.Rectangle(this),this.options.editable&&this.editing.enable())}),L.Edit=L.Edit||{},L.Edit.CircleMarker=L.Edit.SimpleShape.extend({_createMoveMarker:function(){var e=this._shape.getLatLng();this._moveMarker=this._createMarker(e,this.options.moveIcon)},_createResizeMarker:function(){this._resizeMarkers=[]},_move:function(e){if(this._resizeMarkers.length){var t=this._getResizeMarkerPoint(e);this._resizeMarkers[0].setLatLng(t)}this._shape.setLatLng(e),this._map.fire(L.Draw.Event.EDITMOVE,{layer:this._shape})}}),L.CircleMarker.addInitHook(function(){L.Edit.CircleMarker&&(this.editing=new L.Edit.CircleMarker(this),this.options.editable&&this.editing.enable()),this.on(`add`,function(){this.editing&&this.editing.enabled()&&this.editing.addHooks()}),this.on(`remove`,function(){this.editing&&this.editing.enabled()&&this.editing.removeHooks()})}),L.Edit=L.Edit||{},L.Edit.Circle=L.Edit.CircleMarker.extend({_createResizeMarker:function(){var e=this._shape.getLatLng(),t=this._getResizeMarkerPoint(e);this._resizeMarkers=[],this._resizeMarkers.push(this._createMarker(t,this.options.resizeIcon))},_getResizeMarkerPoint:function(e){var t=this._shape._radius*Math.cos(Math.PI/4),n=this._map.project(e);return this._map.unproject([n.x+t,n.y-t])},_resize:function(e){var t=this._moveMarker.getLatLng();radius=L.GeometryUtil.isVersion07x()?t.distanceTo(e):this._map.distance(t,e),this._shape.setRadius(radius),this._map.editTooltip&&this._map._editTooltip.updateContent({text:L.drawLocal.edit.handlers.edit.tooltip.subtext+`<br />`+L.drawLocal.edit.handlers.edit.tooltip.text,subtext:L.drawLocal.draw.handlers.circle.radius+`: `+L.GeometryUtil.readableDistance(radius,!0,this.options.feet,this.options.nautic)}),this._shape.setRadius(radius),this._map.fire(L.Draw.Event.EDITRESIZE,{layer:this._shape})}}),L.Circle.addInitHook(function(){L.Edit.Circle&&(this.editing=new L.Edit.Circle(this),this.options.editable&&this.editing.enable())}),L.Map.mergeOptions({touchExtend:!0}),L.Map.TouchExtend=L.Handler.extend({initialize:function(e){this._map=e,this._container=e._container,this._pane=e._panes.overlayPane},addHooks:function(){L.DomEvent.on(this._container,`touchstart`,this._onTouchStart,this),L.DomEvent.on(this._container,`touchend`,this._onTouchEnd,this),L.DomEvent.on(this._container,`touchmove`,this._onTouchMove,this),this._detectIE()?(L.DomEvent.on(this._container,`MSPointerDown`,this._onTouchStart,this),L.DomEvent.on(this._container,`MSPointerUp`,this._onTouchEnd,this),L.DomEvent.on(this._container,`MSPointerMove`,this._onTouchMove,this),L.DomEvent.on(this._container,`MSPointerCancel`,this._onTouchCancel,this)):(L.DomEvent.on(this._container,`touchcancel`,this._onTouchCancel,this),L.DomEvent.on(this._container,`touchleave`,this._onTouchLeave,this))},removeHooks:function(){L.DomEvent.off(this._container,`touchstart`,this._onTouchStart,this),L.DomEvent.off(this._container,`touchend`,this._onTouchEnd,this),L.DomEvent.off(this._container,`touchmove`,this._onTouchMove,this),this._detectIE()?(L.DomEvent.off(this._container,`MSPointerDown`,this._onTouchStart,this),L.DomEvent.off(this._container,`MSPointerUp`,this._onTouchEnd,this),L.DomEvent.off(this._container,`MSPointerMove`,this._onTouchMove,this),L.DomEvent.off(this._container,`MSPointerCancel`,this._onTouchCancel,this)):(L.DomEvent.off(this._container,`touchcancel`,this._onTouchCancel,this),L.DomEvent.off(this._container,`touchleave`,this._onTouchLeave,this))},_touchEvent:function(e,t){var n={};if(e.touches!==void 0){if(!e.touches.length)return;n=e.touches[0]}else if(e.pointerType!==`touch`||(n=e,!this._filterClick(e)))return;var s=this._map.mouseEventToContainerPoint(n),c=this._map.mouseEventToLayerPoint(n),l=this._map.layerPointToLatLng(c);this._map.fire(t,{latlng:l,layerPoint:c,containerPoint:s,pageX:n.pageX,pageY:n.pageY,originalEvent:e})},_filterClick:function(e){var t=e.timeStamp||e.originalEvent.timeStamp,n=L.DomEvent._lastClick&&t-L.DomEvent._lastClick;return n&&n>100&&n<500||e.target._simulatedClick&&!e._simulated?(L.DomEvent.stop(e),!1):(L.DomEvent._lastClick=t,!0)},_onTouchStart:function(e){this._map._loaded&&this._touchEvent(e,`touchstart`)},_onTouchEnd:function(e){this._map._loaded&&this._touchEvent(e,`touchend`)},_onTouchCancel:function(e){if(this._map._loaded){var t=`touchcancel`;this._detectIE()&&(t=`pointercancel`),this._touchEvent(e,t)}},_onTouchLeave:function(e){this._map._loaded&&this._touchEvent(e,`touchleave`)},_onTouchMove:function(e){this._map._loaded&&this._touchEvent(e,`touchmove`)},_detectIE:function(){var t=e.navigator.userAgent,n=t.indexOf(`MSIE `);if(n>0)return parseInt(t.substring(n+5,t.indexOf(`.`,n)),10);if(t.indexOf(`Trident/`)>0){var s=t.indexOf(`rv:`);return parseInt(t.substring(s+3,t.indexOf(`.`,s)),10)}var c=t.indexOf(`Edge/`);return c>0&&parseInt(t.substring(c+5,t.indexOf(`.`,c)),10)}}),L.Map.addInitHook(`addHandler`,`touchExtend`,L.Map.TouchExtend),L.Marker.Touch=L.Marker.extend({_initInteraction:function(){return this.addInteractiveTarget?L.Marker.prototype._initInteraction.apply(this):this._initInteractionLegacy()},_initInteractionLegacy:function(){if(this.options.clickable){var e=this._icon,t=[`dblclick`,`mousedown`,`mouseover`,`mouseout`,`contextmenu`,`touchstart`,`touchend`,`touchmove`];this._detectIE?t.concat([`MSPointerDown`,`MSPointerUp`,`MSPointerMove`,`MSPointerCancel`]):t.concat([`touchcancel`]),L.DomUtil.addClass(e,`leaflet-clickable`),L.DomEvent.on(e,`click`,this._onMouseClick,this),L.DomEvent.on(e,`keypress`,this._onKeyPress,this);for(var n=0;n<t.length;n++)L.DomEvent.on(e,t[n],this._fireMouseEvent,this);L.Handler.MarkerDrag&&(this.dragging=new L.Handler.MarkerDrag(this),this.options.draggable&&this.dragging.enable())}},_detectIE:function(){var t=e.navigator.userAgent,n=t.indexOf(`MSIE `);if(n>0)return parseInt(t.substring(n+5,t.indexOf(`.`,n)),10);if(t.indexOf(`Trident/`)>0){var s=t.indexOf(`rv:`);return parseInt(t.substring(s+3,t.indexOf(`.`,s)),10)}var c=t.indexOf(`Edge/`);return c>0&&parseInt(t.substring(c+5,t.indexOf(`.`,c)),10)}}),L.LatLngUtil={cloneLatLngs:function(e){for(var t=[],n=0,s=e.length;n<s;n++)Array.isArray(e[n])?t.push(L.LatLngUtil.cloneLatLngs(e[n])):t.push(this.cloneLatLng(e[n]));return t},cloneLatLng:function(e){return L.latLng(e.lat,e.lng)}},function(){var e={km:2,ha:2,m:0,mi:2,ac:2,yd:0,ft:0,nm:2};L.GeometryUtil=L.extend(L.GeometryUtil||{},{geodesicArea:function(e){var t,n,s=e.length,c=0,l=Math.PI/180;if(s>2){for(var d=0;d<s;d++)t=e[d],n=e[(d+1)%s],c+=(n.lng-t.lng)*l*(2+Math.sin(t.lat*l)+Math.sin(n.lat*l));c=6378137*c*6378137/2}return Math.abs(c)},formattedNumber:function(e,t){var n=parseFloat(e).toFixed(t),s=L.drawLocal.format&&L.drawLocal.format.numeric,c=s&&s.delimiters,l=c&&c.thousands,d=c&&c.decimal;if(l||d){var f=n.split(`.`);n=l?f[0].replace(/(\d)(?=(\d{3})+(?!\d))/g,`$1`+l):f[0],d||=`.`,f.length>1&&(n=n+d+f[1])}return n},readableArea:function(t,n,s){var c,l,s=L.Util.extend({},e,s);return n?(l=[`ha`,`m`],type=typeof n,type===`string`?l=[n]:type!==`boolean`&&(l=n),c=t>=1e6&&l.indexOf(`km`)!==-1?L.GeometryUtil.formattedNumber(1e-6*t,s.km)+` km²`:t>=1e4&&l.indexOf(`ha`)!==-1?L.GeometryUtil.formattedNumber(1e-4*t,s.ha)+` ha`:L.GeometryUtil.formattedNumber(t,s.m)+` m²`):(t/=.836127,c=t>=3097600?L.GeometryUtil.formattedNumber(t/3097600,s.mi)+` mi²`:t>=4840?L.GeometryUtil.formattedNumber(t/4840,s.ac)+` acres`:L.GeometryUtil.formattedNumber(t,s.yd)+` yd²`),c},readableDistance:function(t,n,s,c,l){var d,l=L.Util.extend({},e,l);switch(n?typeof n==`string`?n:`metric`:s?`feet`:c?`nauticalMile`:`yards`){case`metric`:d=t>1e3?L.GeometryUtil.formattedNumber(t/1e3,l.km)+` km`:L.GeometryUtil.formattedNumber(t,l.m)+` m`;break;case`feet`:t*=3.28083,d=L.GeometryUtil.formattedNumber(t,l.ft)+` ft`;break;case`nauticalMile`:t*=.53996,d=L.GeometryUtil.formattedNumber(t/1e3,l.nm)+` nm`;break;default:t*=1.09361,d=t>1760?L.GeometryUtil.formattedNumber(t/1760,l.mi)+` miles`:L.GeometryUtil.formattedNumber(t,l.yd)+` yd`}return d},isVersion07x:function(){var e=L.version.split(`.`);return parseInt(e[0],10)===0&&parseInt(e[1],10)===7}})}(),L.Util.extend(L.LineUtil,{segmentsIntersect:function(e,t,n,s){return this._checkCounterclockwise(e,n,s)!==this._checkCounterclockwise(t,n,s)&&this._checkCounterclockwise(e,t,n)!==this._checkCounterclockwise(e,t,s)},_checkCounterclockwise:function(e,t,n){return(n.y-e.y)*(t.x-e.x)>(t.y-e.y)*(n.x-e.x)}}),L.Polyline.include({intersects:function(){var e,t,n,s=this._getProjectedPoints(),c=s?s.length:0;if(this._tooFewPointsForIntersection())return!1;for(e=c-1;e>=3;e--)if(t=s[e-1],n=s[e],this._lineSegmentsIntersectsRange(t,n,e-2))return!0;return!1},newLatLngIntersects:function(e,t){return!!this._map&&this.newPointIntersects(this._map.latLngToLayerPoint(e),t)},newPointIntersects:function(e,t){var n=this._getProjectedPoints(),s=n?n.length:0,c=n?n[s-1]:null,l=s-2;return!this._tooFewPointsForIntersection(1)&&this._lineSegmentsIntersectsRange(c,e,l,+!!t)},_tooFewPointsForIntersection:function(e){var t=this._getProjectedPoints(),n=t?t.length:0;return n+=e||0,!t||n<=3},_lineSegmentsIntersectsRange:function(e,t,n,s){var c,l,d=this._getProjectedPoints();s||=0;for(var f=n;f>s;f--)if(c=d[f-1],l=d[f],L.LineUtil.segmentsIntersect(e,t,c,l))return!0;return!1},_getProjectedPoints:function(){if(!this._defaultShape)return this._originalPoints;for(var e=[],t=this._defaultShape(),n=0;n<t.length;n++)e.push(this._map.latLngToLayerPoint(t[n]));return e}}),L.Polygon.include({intersects:function(){var e,t,n,s,c=this._getProjectedPoints();return!this._tooFewPointsForIntersection()&&(!!L.Polyline.prototype.intersects.call(this)||(e=c.length,t=c[0],n=c[e-1],s=e-2,this._lineSegmentsIntersectsRange(n,t,s,1)))}}),L.Control.Draw=L.Control.extend({options:{position:`topleft`,draw:{},edit:!1},initialize:function(e){if(L.version<`0.7`)throw Error(`Leaflet.draw 0.2.3+ requires Leaflet 0.7.0+. Download latest from https://github.com/Leaflet/Leaflet/`);L.Control.prototype.initialize.call(this,e);var t;this._toolbars={},L.DrawToolbar&&this.options.draw&&(t=new L.DrawToolbar(this.options.draw),this._toolbars[L.DrawToolbar.TYPE]=t,this._toolbars[L.DrawToolbar.TYPE].on(`enable`,this._toolbarEnabled,this)),L.EditToolbar&&this.options.edit&&(t=new L.EditToolbar(this.options.edit),this._toolbars[L.EditToolbar.TYPE]=t,this._toolbars[L.EditToolbar.TYPE].on(`enable`,this._toolbarEnabled,this)),L.toolbar=this},onAdd:function(e){var t,n=L.DomUtil.create(`div`,`leaflet-draw`),s=!1;for(var c in this._toolbars)this._toolbars.hasOwnProperty(c)&&(t=this._toolbars[c].addToolbar(e))&&(s||=(L.DomUtil.hasClass(t,`leaflet-draw-toolbar-top`)||L.DomUtil.addClass(t.childNodes[0],`leaflet-draw-toolbar-top`),!0),n.appendChild(t));return n},onRemove:function(){for(var e in this._toolbars)this._toolbars.hasOwnProperty(e)&&this._toolbars[e].removeToolbar()},setDrawingOptions:function(e){for(var t in this._toolbars)this._toolbars[t]instanceof L.DrawToolbar&&this._toolbars[t].setOptions(e)},_toolbarEnabled:function(e){var t=e.target;for(var n in this._toolbars)this._toolbars[n]!==t&&this._toolbars[n].disable()}}),L.Map.mergeOptions({drawControlTooltips:!0,drawControl:!1}),L.Map.addInitHook(function(){this.options.drawControl&&(this.drawControl=new L.Control.Draw,this.addControl(this.drawControl))}),L.Toolbar=L.Class.extend({initialize:function(e){L.setOptions(this,e),this._modes={},this._actionButtons=[],this._activeMode=null;var t=L.version.split(`.`);parseInt(t[0],10)===1&&parseInt(t[1],10)>=2?L.Toolbar.include(L.Evented.prototype):L.Toolbar.include(L.Mixin.Events)},enabled:function(){return this._activeMode!==null},disable:function(){this.enabled()&&this._activeMode.handler.disable()},addToolbar:function(e){var t,n=L.DomUtil.create(`div`,`leaflet-draw-section`),s=0,c=this._toolbarClass||``,l=this.getModeHandlers(e);for(this._toolbarContainer=L.DomUtil.create(`div`,`leaflet-draw-toolbar leaflet-bar`),this._map=e,t=0;t<l.length;t++)l[t].enabled&&this._initModeHandler(l[t].handler,this._toolbarContainer,s++,c,l[t].title);if(s)return this._lastButtonIndex=--s,this._actionsContainer=L.DomUtil.create(`ul`,`leaflet-draw-actions`),n.appendChild(this._toolbarContainer),n.appendChild(this._actionsContainer),n},removeToolbar:function(){for(var e in this._modes)this._modes.hasOwnProperty(e)&&(this._disposeButton(this._modes[e].button,this._modes[e].handler.enable,this._modes[e].handler),this._modes[e].handler.disable(),this._modes[e].handler.off(`enabled`,this._handlerActivated,this).off(`disabled`,this._handlerDeactivated,this));this._modes={};for(var t=0,n=this._actionButtons.length;t<n;t++)this._disposeButton(this._actionButtons[t].button,this._actionButtons[t].callback,this);this._actionButtons=[],this._actionsContainer=null},_initModeHandler:function(e,t,n,s,c){var l=e.type;this._modes[l]={},this._modes[l].handler=e,this._modes[l].button=this._createButton({type:l,title:c,className:s+`-`+l,container:t,callback:this._modes[l].handler.enable,context:this._modes[l].handler}),this._modes[l].buttonIndex=n,this._modes[l].handler.on(`enabled`,this._handlerActivated,this).on(`disabled`,this._handlerDeactivated,this)},_detectIOS:function(){return/iPad|iPhone|iPod/.test(navigator.userAgent)&&!e.MSStream},_createButton:function(e){var t=L.DomUtil.create(`a`,e.className||``,e.container),n=L.DomUtil.create(`span`,`sr-only`,e.container);t.href=`#`,t.appendChild(n),e.title&&(t.title=e.title,n.innerHTML=e.title),e.text&&(t.innerHTML=e.text,n.innerHTML=e.text);var s=this._detectIOS()?`touchstart`:`click`;return L.DomEvent.on(t,`click`,L.DomEvent.stopPropagation).on(t,`mousedown`,L.DomEvent.stopPropagation).on(t,`dblclick`,L.DomEvent.stopPropagation).on(t,`touchstart`,L.DomEvent.stopPropagation).on(t,`click`,L.DomEvent.preventDefault).on(t,s,e.callback,e.context),t},_disposeButton:function(e,t){var n=this._detectIOS()?`touchstart`:`click`;L.DomEvent.off(e,`click`,L.DomEvent.stopPropagation).off(e,`mousedown`,L.DomEvent.stopPropagation).off(e,`dblclick`,L.DomEvent.stopPropagation).off(e,`touchstart`,L.DomEvent.stopPropagation).off(e,`click`,L.DomEvent.preventDefault).off(e,n,t)},_handlerActivated:function(e){this.disable(),this._activeMode=this._modes[e.handler],L.DomUtil.addClass(this._activeMode.button,`leaflet-draw-toolbar-button-enabled`),this._showActionsToolbar(),this.fire(`enable`)},_handlerDeactivated:function(){this._hideActionsToolbar(),L.DomUtil.removeClass(this._activeMode.button,`leaflet-draw-toolbar-button-enabled`),this._activeMode=null,this.fire(`disable`)},_createActions:function(e){var t,n,s,c,l=this._actionsContainer,d=this.getActions(e),f=d.length;for(n=0,s=this._actionButtons.length;n<s;n++)this._disposeButton(this._actionButtons[n].button,this._actionButtons[n].callback);for(this._actionButtons=[];l.firstChild;)l.removeChild(l.firstChild);for(var p=0;p<f;p++)`enabled`in d[p]&&!d[p].enabled||(t=L.DomUtil.create(`li`,``,l),c=this._createButton({title:d[p].title,text:d[p].text,container:t,callback:d[p].callback,context:d[p].context}),this._actionButtons.push({button:c,callback:d[p].callback}))},_showActionsToolbar:function(){var e=this._activeMode.buttonIndex,t=this._lastButtonIndex,n=this._activeMode.button.offsetTop-1;this._createActions(this._activeMode.handler),this._actionsContainer.style.top=n+`px`,e===0&&(L.DomUtil.addClass(this._toolbarContainer,`leaflet-draw-toolbar-notop`),L.DomUtil.addClass(this._actionsContainer,`leaflet-draw-actions-top`)),e===t&&(L.DomUtil.addClass(this._toolbarContainer,`leaflet-draw-toolbar-nobottom`),L.DomUtil.addClass(this._actionsContainer,`leaflet-draw-actions-bottom`)),this._actionsContainer.style.display=`block`,this._map.fire(L.Draw.Event.TOOLBAROPENED)},_hideActionsToolbar:function(){this._actionsContainer.style.display=`none`,L.DomUtil.removeClass(this._toolbarContainer,`leaflet-draw-toolbar-notop`),L.DomUtil.removeClass(this._toolbarContainer,`leaflet-draw-toolbar-nobottom`),L.DomUtil.removeClass(this._actionsContainer,`leaflet-draw-actions-top`),L.DomUtil.removeClass(this._actionsContainer,`leaflet-draw-actions-bottom`),this._map.fire(L.Draw.Event.TOOLBARCLOSED)}}),L.Draw=L.Draw||{},L.Draw.Tooltip=L.Class.extend({initialize:function(e){this._map=e,this._popupPane=e._panes.popupPane,this._visible=!1,this._container=e.options.drawControlTooltips?L.DomUtil.create(`div`,`leaflet-draw-tooltip`,this._popupPane):null,this._singleLineLabel=!1,this._map.on(`mouseout`,this._onMouseOut,this)},dispose:function(){this._map.off(`mouseout`,this._onMouseOut,this),this._container&&=(this._popupPane.removeChild(this._container),null)},updateContent:function(e){return this._container?(e.subtext=e.subtext||``,e.subtext.length!==0||this._singleLineLabel?e.subtext.length>0&&this._singleLineLabel&&(L.DomUtil.removeClass(this._container,`leaflet-draw-tooltip-single`),this._singleLineLabel=!1):(L.DomUtil.addClass(this._container,`leaflet-draw-tooltip-single`),this._singleLineLabel=!0),this._container.innerHTML=(e.subtext.length>0?`<span class="leaflet-draw-tooltip-subtext">`+e.subtext+`</span><br />`:``)+`<span>`+e.text+`</span>`,e.text||e.subtext?(this._visible=!0,this._container.style.visibility=`inherit`):(this._visible=!1,this._container.style.visibility=`hidden`),this):this},updatePosition:function(e){var t=this._map.latLngToLayerPoint(e),n=this._container;return this._container&&(this._visible&&(n.style.visibility=`inherit`),L.DomUtil.setPosition(n,t)),this},showAsError:function(){return this._container&&L.DomUtil.addClass(this._container,`leaflet-error-draw-tooltip`),this},removeError:function(){return this._container&&L.DomUtil.removeClass(this._container,`leaflet-error-draw-tooltip`),this},_onMouseOut:function(){this._container&&(this._container.style.visibility=`hidden`)}}),L.DrawToolbar=L.Toolbar.extend({statics:{TYPE:`draw`},options:{polyline:{},polygon:{},rectangle:{},circle:{},marker:{},circlemarker:{}},initialize:function(e){for(var t in this.options)this.options.hasOwnProperty(t)&&e[t]&&(e[t]=L.extend({},this.options[t],e[t]));this._toolbarClass=`leaflet-draw-draw`,L.Toolbar.prototype.initialize.call(this,e)},getModeHandlers:function(e){return[{enabled:this.options.polyline,handler:new L.Draw.Polyline(e,this.options.polyline),title:L.drawLocal.draw.toolbar.buttons.polyline},{enabled:this.options.polygon,handler:new L.Draw.Polygon(e,this.options.polygon),title:L.drawLocal.draw.toolbar.buttons.polygon},{enabled:this.options.rectangle,handler:new L.Draw.Rectangle(e,this.options.rectangle),title:L.drawLocal.draw.toolbar.buttons.rectangle},{enabled:this.options.circle,handler:new L.Draw.Circle(e,this.options.circle),title:L.drawLocal.draw.toolbar.buttons.circle},{enabled:this.options.marker,handler:new L.Draw.Marker(e,this.options.marker),title:L.drawLocal.draw.toolbar.buttons.marker},{enabled:this.options.circlemarker,handler:new L.Draw.CircleMarker(e,this.options.circlemarker),title:L.drawLocal.draw.toolbar.buttons.circlemarker}]},getActions:function(e){return[{enabled:e.completeShape,title:L.drawLocal.draw.toolbar.finish.title,text:L.drawLocal.draw.toolbar.finish.text,callback:e.completeShape,context:e},{enabled:e.deleteLastVertex,title:L.drawLocal.draw.toolbar.undo.title,text:L.drawLocal.draw.toolbar.undo.text,callback:e.deleteLastVertex,context:e},{title:L.drawLocal.draw.toolbar.actions.title,text:L.drawLocal.draw.toolbar.actions.text,callback:this.disable,context:this}]},setOptions:function(e){for(var t in L.setOptions(this,e),this._modes)this._modes.hasOwnProperty(t)&&e.hasOwnProperty(t)&&this._modes[t].handler.setOptions(e[t])}}),L.EditToolbar=L.Toolbar.extend({statics:{TYPE:`edit`},options:{edit:{selectedPathOptions:{dashArray:`10, 10`,fill:!0,fillColor:`#fe57a1`,fillOpacity:.1,maintainColor:!1}},remove:{},poly:null,featureGroup:null},initialize:function(e){e.edit&&(e.edit.selectedPathOptions===void 0&&(e.edit.selectedPathOptions=this.options.edit.selectedPathOptions),e.edit.selectedPathOptions=L.extend({},this.options.edit.selectedPathOptions,e.edit.selectedPathOptions)),e.remove&&=L.extend({},this.options.remove,e.remove),e.poly&&=L.extend({},this.options.poly,e.poly),this._toolbarClass=`leaflet-draw-edit`,L.Toolbar.prototype.initialize.call(this,e),this._selectedFeatureCount=0},getModeHandlers:function(e){var t=this.options.featureGroup;return[{enabled:this.options.edit,handler:new L.EditToolbar.Edit(e,{featureGroup:t,selectedPathOptions:this.options.edit.selectedPathOptions,poly:this.options.poly}),title:L.drawLocal.edit.toolbar.buttons.edit},{enabled:this.options.remove,handler:new L.EditToolbar.Delete(e,{featureGroup:t}),title:L.drawLocal.edit.toolbar.buttons.remove}]},getActions:function(e){var t=[{title:L.drawLocal.edit.toolbar.actions.save.title,text:L.drawLocal.edit.toolbar.actions.save.text,callback:this._save,context:this},{title:L.drawLocal.edit.toolbar.actions.cancel.title,text:L.drawLocal.edit.toolbar.actions.cancel.text,callback:this.disable,context:this}];return e.removeAllLayers&&t.push({title:L.drawLocal.edit.toolbar.actions.clearAll.title,text:L.drawLocal.edit.toolbar.actions.clearAll.text,callback:this._clearAllLayers,context:this}),t},addToolbar:function(e){var t=L.Toolbar.prototype.addToolbar.call(this,e);return this._checkDisabled(),this.options.featureGroup.on(`layeradd layerremove`,this._checkDisabled,this),t},removeToolbar:function(){this.options.featureGroup.off(`layeradd layerremove`,this._checkDisabled,this),L.Toolbar.prototype.removeToolbar.call(this)},disable:function(){this.enabled()&&(this._activeMode.handler.revertLayers(),L.Toolbar.prototype.disable.call(this))},_save:function(){this._activeMode.handler.save(),this._activeMode&&this._activeMode.handler.disable()},_clearAllLayers:function(){this._activeMode.handler.removeAllLayers(),this._activeMode&&this._activeMode.handler.disable()},_checkDisabled:function(){var e,t=this.options.featureGroup.getLayers().length!==0;this.options.edit&&(e=this._modes[L.EditToolbar.Edit.TYPE].button,t?L.DomUtil.removeClass(e,`leaflet-disabled`):L.DomUtil.addClass(e,`leaflet-disabled`),e.setAttribute(`title`,t?L.drawLocal.edit.toolbar.buttons.edit:L.drawLocal.edit.toolbar.buttons.editDisabled)),this.options.remove&&(e=this._modes[L.EditToolbar.Delete.TYPE].button,t?L.DomUtil.removeClass(e,`leaflet-disabled`):L.DomUtil.addClass(e,`leaflet-disabled`),e.setAttribute(`title`,t?L.drawLocal.edit.toolbar.buttons.remove:L.drawLocal.edit.toolbar.buttons.removeDisabled))}}),L.EditToolbar.Edit=L.Handler.extend({statics:{TYPE:`edit`},initialize:function(e,t){if(L.Handler.prototype.initialize.call(this,e),L.setOptions(this,t),this._featureGroup=t.featureGroup,!(this._featureGroup instanceof L.FeatureGroup))throw Error(`options.featureGroup must be a L.FeatureGroup`);this._uneditedLayerProps={},this.type=L.EditToolbar.Edit.TYPE;var n=L.version.split(`.`);parseInt(n[0],10)===1&&parseInt(n[1],10)>=2?L.EditToolbar.Edit.include(L.Evented.prototype):L.EditToolbar.Edit.include(L.Mixin.Events)},enable:function(){!this._enabled&&this._hasAvailableLayers()&&(this.fire(`enabled`,{handler:this.type}),this._map.fire(L.Draw.Event.EDITSTART,{handler:this.type}),L.Handler.prototype.enable.call(this),this._featureGroup.on(`layeradd`,this._enableLayerEdit,this).on(`layerremove`,this._disableLayerEdit,this))},disable:function(){this._enabled&&(this._featureGroup.off(`layeradd`,this._enableLayerEdit,this).off(`layerremove`,this._disableLayerEdit,this),L.Handler.prototype.disable.call(this),this._map.fire(L.Draw.Event.EDITSTOP,{handler:this.type}),this.fire(`disabled`,{handler:this.type}))},addHooks:function(){var e=this._map;e&&(e.getContainer().focus(),this._featureGroup.eachLayer(this._enableLayerEdit,this),this._tooltip=new L.Draw.Tooltip(this._map),this._tooltip.updateContent({text:L.drawLocal.edit.handlers.edit.tooltip.text,subtext:L.drawLocal.edit.handlers.edit.tooltip.subtext}),e._editTooltip=this._tooltip,this._updateTooltip(),this._map.on(`mousemove`,this._onMouseMove,this).on(`touchmove`,this._onMouseMove,this).on(`MSPointerMove`,this._onMouseMove,this).on(L.Draw.Event.EDITVERTEX,this._updateTooltip,this))},removeHooks:function(){this._map&&(this._featureGroup.eachLayer(this._disableLayerEdit,this),this._uneditedLayerProps={},this._tooltip.dispose(),this._tooltip=null,this._map.off(`mousemove`,this._onMouseMove,this).off(`touchmove`,this._onMouseMove,this).off(`MSPointerMove`,this._onMouseMove,this).off(L.Draw.Event.EDITVERTEX,this._updateTooltip,this))},revertLayers:function(){this._featureGroup.eachLayer(function(e){this._revertLayer(e)},this)},save:function(){var e=new L.LayerGroup;this._featureGroup.eachLayer(function(t){t.edited&&=(e.addLayer(t),!1)}),this._map.fire(L.Draw.Event.EDITED,{layers:e})},_backupLayer:function(e){var t=L.Util.stamp(e);this._uneditedLayerProps[t]||(e instanceof L.Polyline||e instanceof L.Polygon||e instanceof L.Rectangle?this._uneditedLayerProps[t]={latlngs:L.LatLngUtil.cloneLatLngs(e.getLatLngs())}:e instanceof L.Circle?this._uneditedLayerProps[t]={latlng:L.LatLngUtil.cloneLatLng(e.getLatLng()),radius:e.getRadius()}:(e instanceof L.Marker||e instanceof L.CircleMarker)&&(this._uneditedLayerProps[t]={latlng:L.LatLngUtil.cloneLatLng(e.getLatLng())}))},_getTooltipText:function(){return{text:L.drawLocal.edit.handlers.edit.tooltip.text,subtext:L.drawLocal.edit.handlers.edit.tooltip.subtext}},_updateTooltip:function(){this._tooltip.updateContent(this._getTooltipText())},_revertLayer:function(e){var t=L.Util.stamp(e);e.edited=!1,this._uneditedLayerProps.hasOwnProperty(t)&&(e instanceof L.Polyline||e instanceof L.Polygon||e instanceof L.Rectangle?e.setLatLngs(this._uneditedLayerProps[t].latlngs):e instanceof L.Circle?(e.setLatLng(this._uneditedLayerProps[t].latlng),e.setRadius(this._uneditedLayerProps[t].radius)):(e instanceof L.Marker||e instanceof L.CircleMarker)&&e.setLatLng(this._uneditedLayerProps[t].latlng),e.fire(`revert-edited`,{layer:e}))},_enableLayerEdit:function(e){var t,n,s=e.layer||e.target||e;this._backupLayer(s),this.options.poly&&(n=L.Util.extend({},this.options.poly),s.options.poly=n),this.options.selectedPathOptions&&(t=L.Util.extend({},this.options.selectedPathOptions),t.maintainColor&&(t.color=s.options.color,t.fillColor=s.options.fillColor),s.options.original=L.extend({},s.options),s.options.editing=t),s instanceof L.Marker?(s.editing&&s.editing.enable(),s.dragging.enable(),s.on(`dragend`,this._onMarkerDragEnd).on(`touchmove`,this._onTouchMove,this).on(`MSPointerMove`,this._onTouchMove,this).on(`touchend`,this._onMarkerDragEnd,this).on(`MSPointerUp`,this._onMarkerDragEnd,this)):s.editing.enable()},_disableLayerEdit:function(e){var t=e.layer||e.target||e;t.edited=!1,t.editing&&t.editing.disable(),delete t.options.editing,delete t.options.original,this._selectedPathOptions&&(t instanceof L.Marker?this._toggleMarkerHighlight(t):(t.setStyle(t.options.previousOptions),delete t.options.previousOptions)),t instanceof L.Marker?(t.dragging.disable(),t.off(`dragend`,this._onMarkerDragEnd,this).off(`touchmove`,this._onTouchMove,this).off(`MSPointerMove`,this._onTouchMove,this).off(`touchend`,this._onMarkerDragEnd,this).off(`MSPointerUp`,this._onMarkerDragEnd,this)):t.editing.disable()},_onMouseMove:function(e){this._tooltip.updatePosition(e.latlng)},_onMarkerDragEnd:function(e){var t=e.target;t.edited=!0,this._map.fire(L.Draw.Event.EDITMOVE,{layer:t})},_onTouchMove:function(e){var t=e.originalEvent.changedTouches[0],n=this._map.mouseEventToLayerPoint(t),s=this._map.layerPointToLatLng(n);e.target.setLatLng(s)},_hasAvailableLayers:function(){return this._featureGroup.getLayers().length!==0}}),L.EditToolbar.Delete=L.Handler.extend({statics:{TYPE:`remove`},initialize:function(e,t){if(L.Handler.prototype.initialize.call(this,e),L.Util.setOptions(this,t),this._deletableLayers=this.options.featureGroup,!(this._deletableLayers instanceof L.FeatureGroup))throw Error(`options.featureGroup must be a L.FeatureGroup`);this.type=L.EditToolbar.Delete.TYPE;var n=L.version.split(`.`);parseInt(n[0],10)===1&&parseInt(n[1],10)>=2?L.EditToolbar.Delete.include(L.Evented.prototype):L.EditToolbar.Delete.include(L.Mixin.Events)},enable:function(){!this._enabled&&this._hasAvailableLayers()&&(this.fire(`enabled`,{handler:this.type}),this._map.fire(L.Draw.Event.DELETESTART,{handler:this.type}),L.Handler.prototype.enable.call(this),this._deletableLayers.on(`layeradd`,this._enableLayerDelete,this).on(`layerremove`,this._disableLayerDelete,this))},disable:function(){this._enabled&&(this._deletableLayers.off(`layeradd`,this._enableLayerDelete,this).off(`layerremove`,this._disableLayerDelete,this),L.Handler.prototype.disable.call(this),this._map.fire(L.Draw.Event.DELETESTOP,{handler:this.type}),this.fire(`disabled`,{handler:this.type}))},addHooks:function(){var e=this._map;e&&(e.getContainer().focus(),this._deletableLayers.eachLayer(this._enableLayerDelete,this),this._deletedLayers=new L.LayerGroup,this._tooltip=new L.Draw.Tooltip(this._map),this._tooltip.updateContent({text:L.drawLocal.edit.handlers.remove.tooltip.text}),this._map.on(`mousemove`,this._onMouseMove,this))},removeHooks:function(){this._map&&(this._deletableLayers.eachLayer(this._disableLayerDelete,this),this._deletedLayers=null,this._tooltip.dispose(),this._tooltip=null,this._map.off(`mousemove`,this._onMouseMove,this))},revertLayers:function(){this._deletedLayers.eachLayer(function(e){this._deletableLayers.addLayer(e),e.fire(`revert-deleted`,{layer:e})},this)},save:function(){this._map.fire(L.Draw.Event.DELETED,{layers:this._deletedLayers})},removeAllLayers:function(){this._deletableLayers.eachLayer(function(e){this._removeLayer({layer:e})},this),this.save()},_enableLayerDelete:function(e){(e.layer||e.target||e).on(`click`,this._removeLayer,this)},_disableLayerDelete:function(e){var t=e.layer||e.target||e;t.off(`click`,this._removeLayer,this),this._deletedLayers.removeLayer(t)},_removeLayer:function(e){var t=e.layer||e.target||e;this._deletableLayers.removeLayer(t),this._deletedLayers.addLayer(t),t.fire(`deleted`)},_onMouseMove:function(e){this._tooltip.updatePosition(e.latlng)},_hasAvailableLayers:function(){return this._deletableLayers.getLayers().length!==0}})})(window,document),__commonJSMin(((e,t)=>{(function(n,s){typeof e==`object`&&t!==void 0?s(e):typeof define==`function`&&define.amd?define([`exports`],s):(n||=self,s((n.Leaflet=n.Leaflet||{},n.Leaflet.markercluster={})))})(e,function(e){"use strict";var t=L.MarkerClusterGroup=L.FeatureGroup.extend({options:{maxClusterRadius:80,iconCreateFunction:null,clusterPane:L.Marker.prototype.options.pane,spiderfyOnEveryZoom:!1,spiderfyOnMaxZoom:!0,showCoverageOnHover:!0,zoomToBoundsOnClick:!0,singleMarkerMode:!1,disableClusteringAtZoom:null,removeOutsideVisibleBounds:!0,animate:!0,animateAddingMarkers:!1,spiderfyShapePositions:null,spiderfyDistanceMultiplier:1,spiderLegPolylineOptions:{weight:1.5,color:`#222`,opacity:.5},chunkedLoading:!1,chunkInterval:200,chunkDelay:50,chunkProgress:null,polygonOptions:{}},initialize:function(e){L.Util.setOptions(this,e),this.options.iconCreateFunction||(this.options.iconCreateFunction=this._defaultIconCreateFunction),this._featureGroup=L.featureGroup(),this._featureGroup.addEventParent(this),this._nonPointGroup=L.featureGroup(),this._nonPointGroup.addEventParent(this),this._inZoomAnimation=0,this._needsClustering=[],this._needsRemoving=[],this._currentShownBounds=null,this._queue=[],this._childMarkerEventHandlers={dragstart:this._childMarkerDragStart,move:this._childMarkerMoved,dragend:this._childMarkerDragEnd};var t=L.DomUtil.TRANSITION&&this.options.animate;L.extend(this,t?this._withAnimation:this._noAnimation),this._markerCluster=t?L.MarkerCluster:L.MarkerClusterNonAnimated},addLayer:function(e){if(e instanceof L.LayerGroup)return this.addLayers([e]);if(!e.getLatLng)return this._nonPointGroup.addLayer(e),this.fire(`layeradd`,{layer:e}),this;if(!this._map)return this._needsClustering.push(e),this.fire(`layeradd`,{layer:e}),this;if(this.hasLayer(e))return this;this._unspiderfy&&this._unspiderfy(),this._addLayer(e,this._maxZoom),this.fire(`layeradd`,{layer:e}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons();var t=e,n=this._zoom;if(e.__parent)for(;t.__parent._zoom>=n;)t=t.__parent;return this._currentShownBounds.contains(t.getLatLng())&&(this.options.animateAddingMarkers?this._animationAddLayer(e,t):this._animationAddLayerNonAnimated(e,t)),this},removeLayer:function(e){return e instanceof L.LayerGroup?this.removeLayers([e]):e.getLatLng?this._map?e.__parent?(this._unspiderfy&&(this._unspiderfy(),this._unspiderfyLayer(e)),this._removeLayer(e,!0),this.fire(`layerremove`,{layer:e}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),e.off(this._childMarkerEventHandlers,this),this._featureGroup.hasLayer(e)&&(this._featureGroup.removeLayer(e),e.clusterShow&&e.clusterShow()),this):this:(!this._arraySplice(this._needsClustering,e)&&this.hasLayer(e)&&this._needsRemoving.push({layer:e,latlng:e._latlng}),this.fire(`layerremove`,{layer:e}),this):(this._nonPointGroup.removeLayer(e),this.fire(`layerremove`,{layer:e}),this)},addLayers:function(e,t){if(!L.Util.isArray(e))return this.addLayer(e);var n=this._featureGroup,s=this._nonPointGroup,c=this.options.chunkedLoading,l=this.options.chunkInterval,d=this.options.chunkProgress,f=e.length,p=0,m=!0,h;if(this._map){var g=new Date().getTime(),_=L.bind(function(){var v=new Date().getTime();for(this._map&&this._unspiderfy&&this._unspiderfy();p<f&&!(c&&p%200==0&&new Date().getTime()-v>l);p++){if(h=e[p],h instanceof L.LayerGroup){m&&=(e=e.slice(),!1),this._extractNonGroupLayers(h,e),f=e.length;continue}if(!h.getLatLng){s.addLayer(h),t||this.fire(`layeradd`,{layer:h});continue}if(!this.hasLayer(h)&&(this._addLayer(h,this._maxZoom),t||this.fire(`layeradd`,{layer:h}),h.__parent&&h.__parent.getChildCount()===2)){var y=h.__parent.getAllChildMarkers(),b=y[0]===h?y[1]:y[0];n.removeLayer(b)}}d&&d(p,f,new Date().getTime()-g),p===f?(this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds)):setTimeout(_,this.options.chunkDelay)},this);_()}else for(var v=this._needsClustering;p<f;p++){if(h=e[p],h instanceof L.LayerGroup){m&&=(e=e.slice(),!1),this._extractNonGroupLayers(h,e),f=e.length;continue}if(!h.getLatLng){s.addLayer(h);continue}this.hasLayer(h)||v.push(h)}return this},removeLayers:function(e){var t,n,s=e.length,c=this._featureGroup,l=this._nonPointGroup,d=!0;if(!this._map){for(t=0;t<s;t++){if(n=e[t],n instanceof L.LayerGroup){d&&=(e=e.slice(),!1),this._extractNonGroupLayers(n,e),s=e.length;continue}this._arraySplice(this._needsClustering,n),l.removeLayer(n),this.hasLayer(n)&&this._needsRemoving.push({layer:n,latlng:n._latlng}),this.fire(`layerremove`,{layer:n})}return this}if(this._unspiderfy){this._unspiderfy();var f=e.slice(),p=s;for(t=0;t<p;t++){if(n=f[t],n instanceof L.LayerGroup){this._extractNonGroupLayers(n,f),p=f.length;continue}this._unspiderfyLayer(n)}}for(t=0;t<s;t++){if(n=e[t],n instanceof L.LayerGroup){d&&=(e=e.slice(),!1),this._extractNonGroupLayers(n,e),s=e.length;continue}if(!n.__parent){l.removeLayer(n),this.fire(`layerremove`,{layer:n});continue}this._removeLayer(n,!0,!0),this.fire(`layerremove`,{layer:n}),c.hasLayer(n)&&(c.removeLayer(n),n.clusterShow&&n.clusterShow())}return this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds),this},clearLayers:function(){return this._map||(this._needsClustering=[],this._needsRemoving=[],delete this._gridClusters,delete this._gridUnclustered),this._noanimationUnspiderfy&&this._noanimationUnspiderfy(),this._featureGroup.clearLayers(),this._nonPointGroup.clearLayers(),this.eachLayer(function(e){e.off(this._childMarkerEventHandlers,this),delete e.__parent},this),this._map&&this._generateInitialClusters(),this},getBounds:function(){var e=new L.LatLngBounds;this._topClusterLevel&&e.extend(this._topClusterLevel._bounds);for(var t=this._needsClustering.length-1;t>=0;t--)e.extend(this._needsClustering[t].getLatLng());return e.extend(this._nonPointGroup.getBounds()),e},eachLayer:function(e,t){var n=this._needsClustering.slice(),s=this._needsRemoving,c,l,d;for(this._topClusterLevel&&this._topClusterLevel.getAllChildMarkers(n),l=n.length-1;l>=0;l--){for(c=!0,d=s.length-1;d>=0;d--)if(s[d].layer===n[l]){c=!1;break}c&&e.call(t,n[l])}this._nonPointGroup.eachLayer(e,t)},getLayers:function(){var e=[];return this.eachLayer(function(t){e.push(t)}),e},getLayer:function(e){var t=null;return e=parseInt(e,10),this.eachLayer(function(n){L.stamp(n)===e&&(t=n)}),t},hasLayer:function(e){if(!e)return!1;var t,n=this._needsClustering;for(t=n.length-1;t>=0;t--)if(n[t]===e)return!0;for(n=this._needsRemoving,t=n.length-1;t>=0;t--)if(n[t].layer===e)return!1;return!!(e.__parent&&e.__parent._group===this)||this._nonPointGroup.hasLayer(e)},zoomToShowLayer:function(e,callback){var t=this._map;typeof callback!=`function`&&(callback=function(){});var showMarker=function(){(t.hasLayer(e)||t.hasLayer(e.__parent))&&!this._inZoomAnimation&&(this._map.off(`moveend`,showMarker,this),this.off(`animationend`,showMarker,this),t.hasLayer(e)?callback():e.__parent._icon&&(this.once(`spiderfied`,callback,this),e.__parent.spiderfy()))};e._icon&&this._map.getBounds().contains(e.getLatLng())?callback():e.__parent._zoom<Math.round(this._map._zoom)?(this._map.on(`moveend`,showMarker,this),this._map.panTo(e.getLatLng())):(this._map.on(`moveend`,showMarker,this),this.on(`animationend`,showMarker,this),e.__parent.zoomToBounds())},onAdd:function(e){this._map=e;var t,n,s;if(!isFinite(this._map.getMaxZoom()))throw`Map has no maxZoom specified`;for(this._featureGroup.addTo(e),this._nonPointGroup.addTo(e),this._gridClusters||this._generateInitialClusters(),this._maxLat=e.options.crs.projection.MAX_LATITUDE,t=0,n=this._needsRemoving.length;t<n;t++)s=this._needsRemoving[t],s.newlatlng=s.layer._latlng,s.layer._latlng=s.latlng;for(t=0,n=this._needsRemoving.length;t<n;t++)s=this._needsRemoving[t],this._removeLayer(s.layer,!0),s.layer._latlng=s.newlatlng;this._needsRemoving=[],this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds(),this._map.on(`zoomend`,this._zoomEnd,this),this._map.on(`moveend`,this._moveEnd,this),this._spiderfierOnAdd&&this._spiderfierOnAdd(),this._bindEvents(),n=this._needsClustering,this._needsClustering=[],this.addLayers(n,!0)},onRemove:function(e){e.off(`zoomend`,this._zoomEnd,this),e.off(`moveend`,this._moveEnd,this),this._unbindEvents(),this._map._mapPane.className=this._map._mapPane.className.replace(` leaflet-cluster-anim`,``),this._spiderfierOnRemove&&this._spiderfierOnRemove(),delete this._maxLat,this._hideCoverage(),this._featureGroup.remove(),this._nonPointGroup.remove(),this._featureGroup.clearLayers(),this._map=null},getVisibleParent:function(e){for(var t=e;t&&!t._icon;)t=t.__parent;return t||null},_arraySplice:function(e,t){for(var n=e.length-1;n>=0;n--)if(e[n]===t)return e.splice(n,1),!0},_removeFromGridUnclustered:function(e,t){for(var n=this._map,s=this._gridUnclustered,c=Math.floor(this._map.getMinZoom());t>=c&&s[t].removeObject(e,n.project(e.getLatLng(),t));t--);},_childMarkerDragStart:function(e){e.target.__dragStart=e.target._latlng},_childMarkerMoved:function(e){if(!this._ignoreMove&&!e.target.__dragStart){var t=e.target._popup&&e.target._popup.isOpen();this._moveChild(e.target,e.oldLatLng,e.latlng),t&&e.target.openPopup()}},_moveChild:function(e,t,n){e._latlng=t,this.removeLayer(e),e._latlng=n,this.addLayer(e)},_childMarkerDragEnd:function(e){var t=e.target.__dragStart;delete e.target.__dragStart,t&&this._moveChild(e.target,t,e.target._latlng)},_removeLayer:function(e,t,n){var s=this._gridClusters,c=this._gridUnclustered,l=this._featureGroup,d=this._map,f=Math.floor(this._map.getMinZoom());t&&this._removeFromGridUnclustered(e,this._maxZoom);var p=e.__parent,m=p._markers,h;for(this._arraySplice(m,e);p&&(p._childCount--,p._boundsNeedUpdate=!0,!(p._zoom<f));)t&&p._childCount<=1?(h=p._markers[0]===e?p._markers[1]:p._markers[0],s[p._zoom].removeObject(p,d.project(p._cLatLng,p._zoom)),c[p._zoom].addObject(h,d.project(h.getLatLng(),p._zoom)),this._arraySplice(p.__parent._childClusters,p),p.__parent._markers.push(h),h.__parent=p.__parent,p._icon&&(l.removeLayer(p),n||l.addLayer(h))):p._iconNeedsUpdate=!0,p=p.__parent;delete e.__parent},_isOrIsParent:function(e,t){for(;t;){if(e===t)return!0;t=t.parentNode}return!1},fire:function(e,t,n){if(t&&t.layer instanceof L.MarkerCluster){if(t.originalEvent&&this._isOrIsParent(t.layer._icon,t.originalEvent.relatedTarget))return;e=`cluster`+e}L.FeatureGroup.prototype.fire.call(this,e,t,n)},listens:function(e,t){return L.FeatureGroup.prototype.listens.call(this,e,t)||L.FeatureGroup.prototype.listens.call(this,`cluster`+e,t)},_defaultIconCreateFunction:function(e){var t=e.getChildCount(),n=` marker-cluster-`;return t<10?n+=`small`:t<100?n+=`medium`:n+=`large`,new L.DivIcon({html:`<div><span>`+t+`</span></div>`,className:`marker-cluster`+n,iconSize:new L.Point(40,40)})},_bindEvents:function(){var e=this._map,t=this.options.spiderfyOnMaxZoom,n=this.options.showCoverageOnHover,s=this.options.zoomToBoundsOnClick,c=this.options.spiderfyOnEveryZoom;(t||s||c)&&this.on(`clusterclick clusterkeypress`,this._zoomOrSpiderfy,this),n&&(this.on(`clustermouseover`,this._showCoverage,this),this.on(`clustermouseout`,this._hideCoverage,this),e.on(`zoomend`,this._hideCoverage,this))},_zoomOrSpiderfy:function(e){var t=e.layer,n=t;if(!(e.type===`clusterkeypress`&&e.originalEvent&&e.originalEvent.keyCode!==13)){for(;n._childClusters.length===1;)n=n._childClusters[0];n._zoom===this._maxZoom&&n._childCount===t._childCount&&this.options.spiderfyOnMaxZoom?t.spiderfy():this.options.zoomToBoundsOnClick&&t.zoomToBounds(),this.options.spiderfyOnEveryZoom&&t.spiderfy(),e.originalEvent&&e.originalEvent.keyCode===13&&this._map._container.focus()}},_showCoverage:function(e){var t=this._map;this._inZoomAnimation||(this._shownPolygon&&t.removeLayer(this._shownPolygon),e.layer.getChildCount()>2&&e.layer!==this._spiderfied&&(this._shownPolygon=new L.Polygon(e.layer.getConvexHull(),this.options.polygonOptions),t.addLayer(this._shownPolygon)))},_hideCoverage:function(){this._shownPolygon&&=(this._map.removeLayer(this._shownPolygon),null)},_unbindEvents:function(){var e=this.options.spiderfyOnMaxZoom,t=this.options.showCoverageOnHover,n=this.options.zoomToBoundsOnClick,s=this.options.spiderfyOnEveryZoom,c=this._map;(e||n||s)&&this.off(`clusterclick clusterkeypress`,this._zoomOrSpiderfy,this),t&&(this.off(`clustermouseover`,this._showCoverage,this),this.off(`clustermouseout`,this._hideCoverage,this),c.off(`zoomend`,this._hideCoverage,this))},_zoomEnd:function(){this._map&&(this._mergeSplitClusters(),this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds())},_moveEnd:function(){if(!this._inZoomAnimation){var e=this._getExpandedVisibleBounds();this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),this._zoom,e),this._topClusterLevel._recursivelyAddChildrenToMap(null,Math.round(this._map._zoom),e),this._currentShownBounds=e}},_generateInitialClusters:function(){var e=Math.ceil(this._map.getMaxZoom()),t=Math.floor(this._map.getMinZoom()),n=this.options.maxClusterRadius,radiusFn=n;typeof n!=`function`&&(radiusFn=function(){return n}),this.options.disableClusteringAtZoom!==null&&(e=this.options.disableClusteringAtZoom-1),this._maxZoom=e,this._gridClusters={},this._gridUnclustered={};for(var s=e;s>=t;s--)this._gridClusters[s]=new L.DistanceGrid(radiusFn(s)),this._gridUnclustered[s]=new L.DistanceGrid(radiusFn(s));this._topClusterLevel=new this._markerCluster(this,t-1)},_addLayer:function(e,t){var n=this._gridClusters,s=this._gridUnclustered,c=Math.floor(this._map.getMinZoom()),l,d;for(this.options.singleMarkerMode&&this._overrideMarkerIcon(e),e.on(this._childMarkerEventHandlers,this);t>=c;t--){l=this._map.project(e.getLatLng(),t);var f=n[t].getNearObject(l);if(f){f._addChild(e),e.__parent=f;return}if(f=s[t].getNearObject(l),f){var p=f.__parent;p&&this._removeLayer(f,!1);var m=new this._markerCluster(this,t,f,e);n[t].addObject(m,this._map.project(m._cLatLng,t)),f.__parent=m,e.__parent=m;var h=m;for(d=t-1;d>p._zoom;d--)h=new this._markerCluster(this,d,h),n[d].addObject(h,this._map.project(f.getLatLng(),d));p._addChild(h),this._removeFromGridUnclustered(f,t);return}s[t].addObject(e,l)}this._topClusterLevel._addChild(e),e.__parent=this._topClusterLevel},_refreshClustersIcons:function(){this._featureGroup.eachLayer(function(e){e instanceof L.MarkerCluster&&e._iconNeedsUpdate&&e._updateIcon()})},_enqueue:function(e){this._queue.push(e),this._queueTimeout||=setTimeout(L.bind(this._processQueue,this),300)},_processQueue:function(){for(var e=0;e<this._queue.length;e++)this._queue[e].call(this);this._queue.length=0,clearTimeout(this._queueTimeout),this._queueTimeout=null},_mergeSplitClusters:function(){var e=Math.round(this._map._zoom);this._processQueue(),this._zoom<e&&this._currentShownBounds.intersects(this._getExpandedVisibleBounds())?(this._animationStart(),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),this._zoom,this._getExpandedVisibleBounds()),this._animationZoomIn(this._zoom,e)):this._zoom>e?(this._animationStart(),this._animationZoomOut(this._zoom,e)):this._moveEnd()},_getExpandedVisibleBounds:function(){return this.options.removeOutsideVisibleBounds?L.Browser.mobile?this._checkBoundsMaxLat(this._map.getBounds()):this._checkBoundsMaxLat(this._map.getBounds().pad(1)):this._mapBoundsInfinite},_checkBoundsMaxLat:function(e){var t=this._maxLat;return t!==void 0&&(e.getNorth()>=t&&(e._northEast.lat=1/0),e.getSouth()<=-t&&(e._southWest.lat=-1/0)),e},_animationAddLayerNonAnimated:function(e,t){if(t===e)this._featureGroup.addLayer(e);else if(t._childCount===2){t._addToMap();var n=t.getAllChildMarkers();this._featureGroup.removeLayer(n[0]),this._featureGroup.removeLayer(n[1])}else t._updateIcon()},_extractNonGroupLayers:function(e,t){var n=e.getLayers(),s=0,c;for(t||=[];s<n.length;s++){if(c=n[s],c instanceof L.LayerGroup){this._extractNonGroupLayers(c,t);continue}t.push(c)}return t},_overrideMarkerIcon:function(e){return e.options.icon=this.options.iconCreateFunction({getChildCount:function(){return 1},getAllChildMarkers:function(){return[e]}})}});L.MarkerClusterGroup.include({_mapBoundsInfinite:new L.LatLngBounds(new L.LatLng(-1/0,-1/0),new L.LatLng(1/0,1/0))}),L.MarkerClusterGroup.include({_noAnimation:{_animationStart:function(){},_animationZoomIn:function(e,t){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),e),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this.fire(`animationend`)},_animationZoomOut:function(e,t){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),e),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this.fire(`animationend`)},_animationAddLayer:function(e,t){this._animationAddLayerNonAnimated(e,t)}},_withAnimation:{_animationStart:function(){this._map._mapPane.className+=` leaflet-cluster-anim`,this._inZoomAnimation++},_animationZoomIn:function(e,t){var n=this._getExpandedVisibleBounds(),s=this._featureGroup,c=Math.floor(this._map.getMinZoom()),l;this._ignoreMove=!0,this._topClusterLevel._recursively(n,e,c,function(c){var d=c._latlng,f=c._markers,p;for(n.contains(d)||(d=null),c._isSingleParent()&&e+1===t?(s.removeLayer(c),c._recursivelyAddChildrenToMap(null,t,n)):(c.clusterHide(),c._recursivelyAddChildrenToMap(d,t,n)),l=f.length-1;l>=0;l--)p=f[l],n.contains(p._latlng)||s.removeLayer(p)}),this._forceLayout(),this._topClusterLevel._recursivelyBecomeVisible(n,t),s.eachLayer(function(e){!(e instanceof L.MarkerCluster)&&e._icon&&e.clusterShow()}),this._topClusterLevel._recursively(n,e,t,function(e){e._recursivelyRestoreChildPositions(t)}),this._ignoreMove=!1,this._enqueue(function(){this._topClusterLevel._recursively(n,e,c,function(e){s.removeLayer(e),e.clusterShow()}),this._animationEnd()})},_animationZoomOut:function(e,t){this._animationZoomOutSingle(this._topClusterLevel,e-1,t),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),e,this._getExpandedVisibleBounds())},_animationAddLayer:function(e,t){var n=this,s=this._featureGroup;s.addLayer(e),t!==e&&(t._childCount>2?(t._updateIcon(),this._forceLayout(),this._animationStart(),e._setPos(this._map.latLngToLayerPoint(t.getLatLng())),e.clusterHide(),this._enqueue(function(){s.removeLayer(e),e.clusterShow(),n._animationEnd()})):(this._forceLayout(),n._animationStart(),n._animationZoomOutSingle(t,this._map.getMaxZoom(),this._zoom)))}},_animationZoomOutSingle:function(e,t,n){var s=this._getExpandedVisibleBounds(),c=Math.floor(this._map.getMinZoom());e._recursivelyAnimateChildrenInAndAddSelfToMap(s,c,t+1,n);var l=this;this._forceLayout(),e._recursivelyBecomeVisible(s,n),this._enqueue(function(){if(e._childCount===1){var d=e._markers[0];this._ignoreMove=!0,d.setLatLng(d.getLatLng()),this._ignoreMove=!1,d.clusterShow&&d.clusterShow()}else e._recursively(s,n,c,function(e){e._recursivelyRemoveChildrenFromMap(s,c,t+1)});l._animationEnd()})},_animationEnd:function(){this._map&&(this._map._mapPane.className=this._map._mapPane.className.replace(` leaflet-cluster-anim`,``)),this._inZoomAnimation--,this.fire(`animationend`)},_forceLayout:function(){L.Util.falseFn(document.body.offsetWidth)}}),L.markerClusterGroup=function(e){return new L.MarkerClusterGroup(e)};var n=L.MarkerCluster=L.Marker.extend({options:L.Icon.prototype.options,initialize:function(e,t,n,s){L.Marker.prototype.initialize.call(this,n?n._cLatLng||n.getLatLng():new L.LatLng(0,0),{icon:this,pane:e.options.clusterPane}),this._group=e,this._zoom=t,this._markers=[],this._childClusters=[],this._childCount=0,this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._bounds=new L.LatLngBounds,n&&this._addChild(n),s&&this._addChild(s)},getAllChildMarkers:function(e,t){e||=[];for(var n=this._childClusters.length-1;n>=0;n--)this._childClusters[n].getAllChildMarkers(e,t);for(var s=this._markers.length-1;s>=0;s--)t&&this._markers[s].__dragStart||e.push(this._markers[s]);return e},getChildCount:function(){return this._childCount},zoomToBounds:function(e){for(var t=this._childClusters.slice(),n=this._group._map,s=n.getBoundsZoom(this._bounds),c=this._zoom+1,l=n.getZoom(),d;t.length>0&&s>c;){c++;var f=[];for(d=0;d<t.length;d++)f=f.concat(t[d]._childClusters);t=f}s>c?this._group._map.setView(this._latlng,c):s<=l?this._group._map.setView(this._latlng,l+1):this._group._map.fitBounds(this._bounds,e)},getBounds:function(){var e=new L.LatLngBounds;return e.extend(this._bounds),e},_updateIcon:function(){this._iconNeedsUpdate=!0,this._icon&&this.setIcon(this)},createIcon:function(){return this._iconNeedsUpdate&&=(this._iconObj=this._group.options.iconCreateFunction(this),!1),this._iconObj.createIcon()},createShadow:function(){return this._iconObj.createShadow()},_addChild:function(e,t){this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._setClusterCenter(e),e instanceof L.MarkerCluster?(t||(this._childClusters.push(e),e.__parent=this),this._childCount+=e._childCount):(t||this._markers.push(e),this._childCount++),this.__parent&&this.__parent._addChild(e,!0)},_setClusterCenter:function(e){this._cLatLng||=e._cLatLng||e._latlng},_resetBounds:function(){var e=this._bounds;e._southWest&&(e._southWest.lat=1/0,e._southWest.lng=1/0),e._northEast&&(e._northEast.lat=-1/0,e._northEast.lng=-1/0)},_recalculateBounds:function(){var e=this._markers,t=this._childClusters,n=0,s=0,c=this._childCount,l,d,f,p;if(c!==0){for(this._resetBounds(),l=0;l<e.length;l++)f=e[l]._latlng,this._bounds.extend(f),n+=f.lat,s+=f.lng;for(l=0;l<t.length;l++)d=t[l],d._boundsNeedUpdate&&d._recalculateBounds(),this._bounds.extend(d._bounds),f=d._wLatLng,p=d._childCount,n+=f.lat*p,s+=f.lng*p;this._latlng=this._wLatLng=new L.LatLng(n/c,s/c),this._boundsNeedUpdate=!1}},_addToMap:function(e){e&&(this._backupLatlng=this._latlng,this.setLatLng(e)),this._group._featureGroup.addLayer(this)},_recursivelyAnimateChildrenIn:function(e,t,n){this._recursively(e,this._group._map.getMinZoom(),n-1,function(e){var n=e._markers,s,c;for(s=n.length-1;s>=0;s--)c=n[s],c._icon&&(c._setPos(t),c.clusterHide())},function(e){var n=e._childClusters,s,c;for(s=n.length-1;s>=0;s--)c=n[s],c._icon&&(c._setPos(t),c.clusterHide())})},_recursivelyAnimateChildrenInAndAddSelfToMap:function(e,t,n,s){this._recursively(e,s,t,function(c){c._recursivelyAnimateChildrenIn(e,c._group._map.latLngToLayerPoint(c.getLatLng()).round(),n),c._isSingleParent()&&n-1===s?(c.clusterShow(),c._recursivelyRemoveChildrenFromMap(e,t,n)):c.clusterHide(),c._addToMap()})},_recursivelyBecomeVisible:function(e,t){this._recursively(e,this._group._map.getMinZoom(),t,null,function(e){e.clusterShow()})},_recursivelyAddChildrenToMap:function(e,t,n){this._recursively(n,this._group._map.getMinZoom()-1,t,function(s){if(t!==s._zoom)for(var c=s._markers.length-1;c>=0;c--){var l=s._markers[c];n.contains(l._latlng)&&(e&&(l._backupLatlng=l.getLatLng(),l.setLatLng(e),l.clusterHide&&l.clusterHide()),s._group._featureGroup.addLayer(l))}},function(t){t._addToMap(e)})},_recursivelyRestoreChildPositions:function(e){for(var t=this._markers.length-1;t>=0;t--){var n=this._markers[t];n._backupLatlng&&(n.setLatLng(n._backupLatlng),delete n._backupLatlng)}if(e-1===this._zoom)for(var s=this._childClusters.length-1;s>=0;s--)this._childClusters[s]._restorePosition();else for(var c=this._childClusters.length-1;c>=0;c--)this._childClusters[c]._recursivelyRestoreChildPositions(e)},_restorePosition:function(){this._backupLatlng&&(this.setLatLng(this._backupLatlng),delete this._backupLatlng)},_recursivelyRemoveChildrenFromMap:function(e,t,n,s){var c,l;this._recursively(e,t-1,n-1,function(e){for(l=e._markers.length-1;l>=0;l--)c=e._markers[l],(!s||!s.contains(c._latlng))&&(e._group._featureGroup.removeLayer(c),c.clusterShow&&c.clusterShow())},function(e){for(l=e._childClusters.length-1;l>=0;l--)c=e._childClusters[l],(!s||!s.contains(c._latlng))&&(e._group._featureGroup.removeLayer(c),c.clusterShow&&c.clusterShow())})},_recursively:function(e,t,n,s,c){var l=this._childClusters,d=this._zoom,f,p;if(t<=d&&(s&&s(this),c&&d===n&&c(this)),d<t||d<n)for(f=l.length-1;f>=0;f--)p=l[f],p._boundsNeedUpdate&&p._recalculateBounds(),e.intersects(p._bounds)&&p._recursively(e,t,n,s,c)},_isSingleParent:function(){return this._childClusters.length>0&&this._childClusters[0]._childCount===this._childCount}});L.Marker.include({clusterHide:function(){var e=this.options.opacity;return this.setOpacity(0),this.options.opacity=e,this},clusterShow:function(){return this.setOpacity(this.options.opacity)}}),L.DistanceGrid=function(e){this._cellSize=e,this._sqCellSize=e*e,this._grid={},this._objectPoint={}},L.DistanceGrid.prototype={addObject:function(e,t){var n=this._getCoord(t.x),s=this._getCoord(t.y),c=this._grid,l=c[s]=c[s]||{},d=l[n]=l[n]||[],f=L.Util.stamp(e);this._objectPoint[f]=t,d.push(e)},updateObject:function(e,t){this.removeObject(e),this.addObject(e,t)},removeObject:function(e,t){var n=this._getCoord(t.x),s=this._getCoord(t.y),c=this._grid,l=c[s]=c[s]||{},d=l[n]=l[n]||[],f,p;for(delete this._objectPoint[L.Util.stamp(e)],f=0,p=d.length;f<p;f++)if(d[f]===e)return d.splice(f,1),p===1&&delete l[n],!0},eachObject:function(e,t){var n,s,c,l,d,f,p,m=this._grid;for(n in m)for(s in d=m[n],d)for(f=d[s],c=0,l=f.length;c<l;c++)p=e.call(t,f[c]),p&&(c--,l--)},getNearObject:function(e){var t=this._getCoord(e.x),n=this._getCoord(e.y),s,c,l,d,f,p,m,h,g=this._objectPoint,_=this._sqCellSize,v=null;for(s=n-1;s<=n+1;s++)if(d=this._grid[s],d){for(c=t-1;c<=t+1;c++)if(f=d[c],f)for(l=0,p=f.length;l<p;l++)m=f[l],h=this._sqDist(g[L.Util.stamp(m)],e),(h<_||h<=_&&v===null)&&(_=h,v=m)}return v},_getCoord:function(e){var t=Math.floor(e/this._cellSize);return isFinite(t)?t:e},_sqDist:function(e,t){var n=t.x-e.x,s=t.y-e.y;return n*n+s*s}},(function(){L.QuickHull={getDistant:function(e,t){var n=t[1].lat-t[0].lat;return(t[0].lng-t[1].lng)*(e.lat-t[0].lat)+n*(e.lng-t[0].lng)},findMostDistantPointFromBaseLine:function(e,t){var n=0,s=null,c=[],l,d,f;for(l=t.length-1;l>=0;l--){if(d=t[l],f=this.getDistant(d,e),f>0)c.push(d);else continue;f>n&&(n=f,s=d)}return{maxPoint:s,newPoints:c}},buildConvexHull:function(e,t){var n=[],s=this.findMostDistantPointFromBaseLine(e,t);return s.maxPoint?(n=n.concat(this.buildConvexHull([e[0],s.maxPoint],s.newPoints)),n=n.concat(this.buildConvexHull([s.maxPoint,e[1]],s.newPoints)),n):[e[0]]},getConvexHull:function(e){var t=!1,n=!1,s=!1,c=!1,l=null,d=null,f=null,p=null,m=null,h=null,g;for(g=e.length-1;g>=0;g--){var _=e[g];(t===!1||_.lat>t)&&(l=_,t=_.lat),(n===!1||_.lat<n)&&(d=_,n=_.lat),(s===!1||_.lng>s)&&(f=_,s=_.lng),(c===!1||_.lng<c)&&(p=_,c=_.lng)}return n===t?(h=p,m=f):(h=d,m=l),[].concat(this.buildConvexHull([h,m],e),this.buildConvexHull([m,h],e))}}})(),L.MarkerCluster.include({getConvexHull:function(){var e=this.getAllChildMarkers(),t=[],n,s;for(s=e.length-1;s>=0;s--)n=e[s].getLatLng(),t.push(n);return L.QuickHull.getConvexHull(t)}}),L.MarkerCluster.include({_2PI:Math.PI*2,_circleFootSeparation:25,_circleStartAngle:0,_spiralFootSeparation:28,_spiralLengthStart:11,_spiralLengthFactor:5,_circleSpiralSwitchover:9,spiderfy:function(){if(!(this._group._spiderfied===this||this._group._inZoomAnimation)){var e=this.getAllChildMarkers(null,!0),t=this._group._map.latLngToLayerPoint(this._latlng),n;this._group._unspiderfy(),this._group._spiderfied=this,this._group.options.spiderfyShapePositions?n=this._group.options.spiderfyShapePositions(e.length,t):e.length>=this._circleSpiralSwitchover?n=this._generatePointsSpiral(e.length,t):(t.y+=10,n=this._generatePointsCircle(e.length,t)),this._animationSpiderfy(e,n)}},unspiderfy:function(e){this._group._inZoomAnimation||(this._animationUnspiderfy(e),this._group._spiderfied=null)},_generatePointsCircle:function(e,t){var n=this._group.options.spiderfyDistanceMultiplier*this._circleFootSeparation*(2+e)/this._2PI,s=this._2PI/e,c=[],l,d;for(n=Math.max(n,35),c.length=e,l=0;l<e;l++)d=this._circleStartAngle+l*s,c[l]=new L.Point(t.x+n*Math.cos(d),t.y+n*Math.sin(d))._round();return c},_generatePointsSpiral:function(e,t){var n=this._group.options.spiderfyDistanceMultiplier,s=n*this._spiralLengthStart,c=n*this._spiralFootSeparation,l=n*this._spiralLengthFactor*this._2PI,d=0,f=[],p;for(f.length=e,p=e;p>=0;p--)p<e&&(f[p]=new L.Point(t.x+s*Math.cos(d),t.y+s*Math.sin(d))._round()),d+=c/s+p*5e-4,s+=l/d;return f},_noanimationUnspiderfy:function(){var e=this._group,t=e._map,n=e._featureGroup,s=this.getAllChildMarkers(null,!0),c,l;for(e._ignoreMove=!0,this.setOpacity(1),l=s.length-1;l>=0;l--)c=s[l],n.removeLayer(c),c._preSpiderfyLatlng&&(c.setLatLng(c._preSpiderfyLatlng),delete c._preSpiderfyLatlng),c.setZIndexOffset&&c.setZIndexOffset(0),c._spiderLeg&&(t.removeLayer(c._spiderLeg),delete c._spiderLeg);e.fire(`unspiderfied`,{cluster:this,markers:s}),e._ignoreMove=!1,e._spiderfied=null}}),L.MarkerClusterNonAnimated=L.MarkerCluster.extend({_animationSpiderfy:function(e,t){var n=this._group,s=n._map,c=n._featureGroup,l=this._group.options.spiderLegPolylineOptions,d,f,p,m;for(n._ignoreMove=!0,d=0;d<e.length;d++)m=s.layerPointToLatLng(t[d]),f=e[d],p=new L.Polyline([this._latlng,m],l),s.addLayer(p),f._spiderLeg=p,f._preSpiderfyLatlng=f._latlng,f.setLatLng(m),f.setZIndexOffset&&f.setZIndexOffset(1e6),c.addLayer(f);this.setOpacity(.3),n._ignoreMove=!1,n.fire(`spiderfied`,{cluster:this,markers:e})},_animationUnspiderfy:function(){this._noanimationUnspiderfy()}}),L.MarkerCluster.include({_animationSpiderfy:function(e,t){var n=this,s=this._group,c=s._map,l=s._featureGroup,d=this._latlng,f=c.latLngToLayerPoint(d),p=L.Path.SVG,m=L.extend({},this._group.options.spiderLegPolylineOptions),h=m.opacity,g,_,v,y,b,x;for(h===void 0&&(h=L.MarkerClusterGroup.prototype.options.spiderLegPolylineOptions.opacity),p?(m.opacity=0,m.className=(m.className||``)+` leaflet-cluster-spider-leg`):m.opacity=h,s._ignoreMove=!0,g=0;g<e.length;g++)_=e[g],x=c.layerPointToLatLng(t[g]),v=new L.Polyline([d,x],m),c.addLayer(v),_._spiderLeg=v,p&&(y=v._path,b=y.getTotalLength()+.1,y.style.strokeDasharray=b,y.style.strokeDashoffset=b),_.setZIndexOffset&&_.setZIndexOffset(1e6),_.clusterHide&&_.clusterHide(),l.addLayer(_),_._setPos&&_._setPos(f);for(s._forceLayout(),s._animationStart(),g=e.length-1;g>=0;g--)x=c.layerPointToLatLng(t[g]),_=e[g],_._preSpiderfyLatlng=_._latlng,_.setLatLng(x),_.clusterShow&&_.clusterShow(),p&&(v=_._spiderLeg,y=v._path,y.style.strokeDashoffset=0,v.setStyle({opacity:h}));this.setOpacity(.3),s._ignoreMove=!1,setTimeout(function(){s._animationEnd(),s.fire(`spiderfied`,{cluster:n,markers:e})},200)},_animationUnspiderfy:function(e){var t=this,n=this._group,s=n._map,c=n._featureGroup,l=e?s._latLngToNewLayerPoint(this._latlng,e.zoom,e.center):s.latLngToLayerPoint(this._latlng),d=this.getAllChildMarkers(null,!0),f=L.Path.SVG,p,m,h,g,_,v;for(n._ignoreMove=!0,n._animationStart(),this.setOpacity(1),m=d.length-1;m>=0;m--)p=d[m],p._preSpiderfyLatlng&&(p.closePopup(),p.setLatLng(p._preSpiderfyLatlng),delete p._preSpiderfyLatlng,v=!0,p._setPos&&(p._setPos(l),v=!1),p.clusterHide&&(p.clusterHide(),v=!1),v&&c.removeLayer(p),f&&(h=p._spiderLeg,g=h._path,_=g.getTotalLength()+.1,g.style.strokeDashoffset=_,h.setStyle({opacity:0})));n._ignoreMove=!1,setTimeout(function(){var e=0;for(m=d.length-1;m>=0;m--)p=d[m],p._spiderLeg&&e++;for(m=d.length-1;m>=0;m--)p=d[m],p._spiderLeg&&(p.clusterShow&&p.clusterShow(),p.setZIndexOffset&&p.setZIndexOffset(0),e>1&&c.removeLayer(p),s.removeLayer(p._spiderLeg),delete p._spiderLeg);n._animationEnd(),n.fire(`unspiderfied`,{cluster:t,markers:d})},200)}}),L.MarkerClusterGroup.include({_spiderfied:null,unspiderfy:function(){this._unspiderfy.apply(this,arguments)},_spiderfierOnAdd:function(){this._map.on(`click`,this._unspiderfyWrapper,this),this._map.options.zoomAnimation&&this._map.on(`zoomstart`,this._unspiderfyZoomStart,this),this._map.on(`zoomend`,this._noanimationUnspiderfy,this),L.Browser.touch||this._map.getRenderer(this)},_spiderfierOnRemove:function(){this._map.off(`click`,this._unspiderfyWrapper,this),this._map.off(`zoomstart`,this._unspiderfyZoomStart,this),this._map.off(`zoomanim`,this._unspiderfyZoomAnim,this),this._map.off(`zoomend`,this._noanimationUnspiderfy,this),this._noanimationUnspiderfy()},_unspiderfyZoomStart:function(){this._map&&this._map.on(`zoomanim`,this._unspiderfyZoomAnim,this)},_unspiderfyZoomAnim:function(e){L.DomUtil.hasClass(this._map._mapPane,`leaflet-touching`)||(this._map.off(`zoomanim`,this._unspiderfyZoomAnim,this),this._unspiderfy(e))},_unspiderfyWrapper:function(){this._unspiderfy()},_unspiderfy:function(e){this._spiderfied&&this._spiderfied.unspiderfy(e)},_noanimationUnspiderfy:function(){this._spiderfied&&this._spiderfied._noanimationUnspiderfy()},_unspiderfyLayer:function(e){e._spiderLeg&&(this._featureGroup.removeLayer(e),e.clusterShow&&e.clusterShow(),e.setZIndexOffset&&e.setZIndexOffset(0),this._map.removeLayer(e._spiderLeg),delete e._spiderLeg)}}),L.MarkerClusterGroup.include({refreshClusters:function(e){return e?e instanceof L.MarkerClusterGroup?e=e._topClusterLevel.getAllChildMarkers():e instanceof L.LayerGroup?e=e._layers:e instanceof L.MarkerCluster?e=e.getAllChildMarkers():e instanceof L.Marker&&(e=[e]):e=this._topClusterLevel.getAllChildMarkers(),this._flagParentsIconsNeedUpdate(e),this._refreshClustersIcons(),this.options.singleMarkerMode&&this._refreshSingleMarkerModeMarkers(e),this},_flagParentsIconsNeedUpdate:function(e){var t,n;for(t in e)for(n=e[t].__parent;n;)n._iconNeedsUpdate=!0,n=n.__parent},_refreshSingleMarkerModeMarkers:function(e){var t,n;for(t in e)n=e[t],this.hasLayer(n)&&n.setIcon(this._overrideMarkerIcon(n))}}),L.Marker.include({refreshIconOptions:function(e,t){var n=this.options.icon;return L.setOptions(n,e),this.setIcon(n),t&&this.__parent&&this.__parent._group.refreshClusters(this),this}}),e.MarkerClusterGroup=t,e.MarkerCluster=n,Object.defineProperty(e,"__esModule",{value:!0})})}))();var Q=Symbol(`newer`),$=Symbol(`older`),Entry=class{key;value;constructor(e,t){this.key=e,this.value=t,this[Q]=void 0,this[$]=void 0}},LRUMap=class{size;limit;oldest;newest;_keymap;constructor(e,t){typeof e!=`number`&&(t=e,e=0),this.size=0,this.limit=e,this.oldest=this.newest=void 0,this._keymap=new Map,t&&(this.assign(t),e<1&&(this.limit=this.size))}_markEntryAsUsed(e){e!==this.newest&&(e[Q]&&(e===this.oldest&&(this.oldest=e[Q]),e[Q][$]=e[$]),e[$]&&(e[$][Q]=e[Q]),e[Q]=void 0,e[$]=this.newest,this.newest&&(this.newest[Q]=e),this.newest=e)}assign(e){let t,n=this.limit||Number.MAX_VALUE;this._keymap.clear();let s=e[Symbol.iterator]();for(let e=s.next();!e.done;e=s.next()){let s=new Entry(e.value[0],e.value[1]);if(this._keymap.set(s.key,s),t?(t[Q]=s,s[$]=t):this.oldest=s,t=s,n--==0)throw Error(`overflow`)}this.newest=t,this.size=this._keymap.size}get(e){let t=this._keymap.get(e);if(t)return this._markEntryAsUsed(t),t.value}set(e,t){let n=this._keymap.get(e);return n?(n.value=t,this._markEntryAsUsed(n),this):(this._keymap.set(e,n=new Entry(e,t)),this.newest?(this.newest[Q]=n,n[$]=this.newest):this.oldest=n,this.newest=n,++this.size,this.size>this.limit&&this.shift(),this)}shift(){let e=this.oldest;if(e)return this.oldest[Q]?(this.oldest=this.oldest[Q],this.oldest[$]=void 0):(this.oldest=void 0,this.newest=void 0),e[Q]=e[$]=void 0,this._keymap.delete(e.key),--this.size,[e.key,e.value]}find(e){let t=this._keymap.get(e);return t?t.value:void 0}has(e){return this._keymap.has(e)}delete(e){let t=this._keymap.get(e);if(t)return this._keymap.delete(t.key),t[Q]&&t[$]?(t[$][Q]=t[Q],t[Q][$]=t[$]):t[Q]?(t[Q][$]=void 0,this.oldest=t[Q]):t[$]?(t[$][Q]=void 0,this.newest=t[$]):this.oldest=this.newest=void 0,this.size--,t.value}clear(){this.oldest=this.newest=void 0,this.size=0,this._keymap.clear()}keys(){return new KeyIterator(this.oldest)}values(){return new ValueIterator(this.oldest)}entries(){return this}[Symbol.iterator](){return new EntryIterator(this.oldest)}forEach(e,t){typeof t!=`object`&&(t=this);let n=this.oldest;for(;n;)e.call(t,n.value,n.key,this),n=n[Q]}toJSON(){let e=Array(this.size),t=0,n=this.oldest;for(;n;)e[t++]={key:n.key,value:n.value},n=n[Q];return e}toString(){let e=``,t=this.oldest;for(;t;)e+=String(t.key)+`:`+t.value,t=t[Q],t&&(e+=` < `);return e}};function EntryIterator(e){this.entry=e}EntryIterator.prototype[Symbol.iterator]=function(){return this},EntryIterator.prototype.next=function(){let e=this.entry;return e?(this.entry=e[Q],{done:!1,value:[e.key,e.value]}):{done:!0,value:void 0}};function KeyIterator(e){this.entry=e}KeyIterator.prototype[Symbol.iterator]=function(){return this},KeyIterator.prototype.next=function(){let e=this.entry;return e?(this.entry=e[Q],{done:!1,value:e.key}):{done:!0,value:void 0}};function ValueIterator(e){this.entry=e}ValueIterator.prototype[Symbol.iterator]=function(){return this},ValueIterator.prototype.next=function(){let e=this.entry;return e?(this.entry=e[Q],{done:!1,value:e.value}):{done:!0,value:void 0}};function waitForAPI(e,t){let n=0,s=null;s=setInterval(function(){if(n>=20)throw clearInterval(s),Error(`window.google not found after 10 seconds`);window.google&&window.google.maps&&window.google.maps.Map&&(clearInterval(s),e.call(t)),++n},500)}L.GridLayer.GoogleMutant=L.GridLayer.extend({options:{maxZoom:21,type:`roadmap`,maxNativeZoom:21},initialize:function(e){L.GridLayer.prototype.initialize.call(this,e),this._tileCallbacks={},this._lru=new LRUMap(100),this._imagesPerTile=this.options.type===`hybrid`?2:1,this._boundOnMutatedImage=this._onMutatedImage.bind(this)},onAdd:function(e){L.GridLayer.prototype.onAdd.call(this,e),this._initMutantContainer(),this._logoContainer&&e._controlCorners.bottomleft.appendChild(this._logoContainer),this._attributionContainer&&e._controlCorners.bottomright.appendChild(this._attributionContainer),waitForAPI(()=>{this._map&&(this._initMutant(),google.maps.event.addListenerOnce(this._mutant,`idle`,()=>{this._map&&(this._checkZoomLevels(),this._mutantIsReady=!0)}))})},onRemove:function(e){L.GridLayer.prototype.onRemove.call(this,e),this._observer.disconnect(),e._container.removeChild(this._mutantContainer),this._logoContainer&&L.DomUtil.remove(this._logoContainer),this._attributionContainer&&L.DomUtil.remove(this._attributionContainer),this._mutant&&google.maps.event.clearListeners(this._mutant,`idle`)},addGoogleLayer:function(e,t){return this._subLayers||={},this.whenReady(()=>{var n=google.maps[e],s=new n(t);s.setMap(this._mutant),this._subLayers[e]=s}),this},removeGoogleLayer:function(e){return this.whenReady(()=>{var t=this._subLayers&&this._subLayers[e];t&&(t.setMap(null),delete this._subLayers[e])}),this},_initMutantContainer:function(){this._mutantContainer||(this._mutantContainer=L.DomUtil.create(`div`,`leaflet-google-mutant leaflet-top leaflet-left`),this._mutantContainer.id=`_MutantContainer_`+L.Util.stamp(this._mutantContainer),this._mutantContainer.style.pointerEvents=`none`,this._mutantContainer.style.visibility=`hidden`,L.DomEvent.off(this._mutantContainer)),this._map.getContainer().appendChild(this._mutantContainer),this.setOpacity(this.options.opacity);let e=this._mutantContainer.style;this._map.options.zoomSnap<1?(e.width=`180%`,e.height=`180%`):(e.width=`100%`,e.height=`100%`),e.zIndex=-1,this._attachObserver(this._mutantContainer)},_initMutant:function(){if(!this._mutant){var e={center:{lat:0,lng:0},zoom:0,tilt:0,mapTypeId:this.options.type,disableDefaultUI:!0,keyboardShortcuts:!1,draggable:!1,disableDoubleClickZoom:!0,scrollwheel:!1,styles:this.options.styles||[],backgroundColor:`transparent`};this.options.mapId!=null&&(e.mapId=this.options.mapId);var t=new google.maps.Map(this._mutantContainer,e);this._mutant=t,this._update(),this.fire(`spawned`,{mapObject:t}),this._waitControls(),this.once(`controls_ready`,this._setupAttribution)}},_attachObserver:function _attachObserver(e){this._observer||=new MutationObserver(this._onMutations.bind(this)),this._observer.observe(e,{childList:!0,subtree:!0}),Array.prototype.forEach.call(e.querySelectorAll(`img`),this._boundOnMutatedImage)},_waitControls:function(){let e=setInterval(()=>{let t=this._mutant.__gm.layoutManager;if(!t)return;clearInterval(e);let n;Object.keys(t).forEach(function(e){let s=t[e];s.get&&s.get(1)instanceof Node&&(n=s)}),this.fire(`controls_ready`,{positions:n})},50)},_setupAttribution:function(e){if(!this._map)return;let t=google.maps.ControlPosition,n=this._attributionContainer=e.positions.get(t.BOTTOM_RIGHT);L.DomUtil.addClass(n,`leaflet-control leaflet-control-attribution`),L.DomEvent.disableClickPropagation(n),n.style.height=`14px`,this._map._controlCorners.bottomright.appendChild(n),this._logoContainer=e.positions.get(t.BOTTOM_LEFT),this._logoContainer.style.pointerEvents=`auto`,this._map._controlCorners.bottomleft.appendChild(this._logoContainer)},_onMutations:function _onMutations(e){for(var t=0;t<e.length;++t)for(var n=e[t],s=0;s<n.addedNodes.length;++s){var c=n.addedNodes[s];c instanceof HTMLImageElement?this._onMutatedImage(c):c instanceof HTMLElement&&Array.prototype.forEach.call(c.querySelectorAll(`img`),this._boundOnMutatedImage)}},_roadRegexp:/!1i(\d+)!2i(\d+)!3i(\d+|VinaFnapurmBegrtn)!/,_satRegexp:/x=(\d+)&y=(\d+)&z=(\d+|VinaFnapurmBegrtn)/,_onMutatedImage:function _onMutatedImage(e){let t,n=e.src.match(this._roadRegexp),s=0;if(n?(t={z:n[1],x:n[2],y:n[3]},this._imagesPerTile>1&&(e.style.zIndex=1,s=1)):(n=e.src.match(this._satRegexp),n&&(t={x:n[1],y:n[2],z:n[3]}),s=0),t){var c=this._tileCoordsToKey(t);e.style.position=`absolute`;var l=c+`/`+s;this._lru.set(l,e),l in this._tileCallbacks&&this._tileCallbacks[l]&&(this._tileCallbacks[l].forEach(t=>t(e)),delete this._tileCallbacks[l])}},createTile:function(e,t){let n=this._tileCoordsToKey(e),s=L.DomUtil.create(`div`);s.style.textAlign=`left`,s.dataset.pending=this._imagesPerTile,t=t.bind(this,null,s);for(var c=0;c<this._imagesPerTile;++c){let e=n+`/`+c,l=this._lru.get(e);l?(s.appendChild(this._clone(l)),--s.dataset.pending):(this._tileCallbacks[e]=this._tileCallbacks[e]||[],this._tileCallbacks[e].push(function(e){return function(n){e.appendChild(this._clone(n)),--e.dataset.pending,parseInt(e.dataset.pending)||t()}.bind(this)}.bind(this)(s)))}return parseInt(s.dataset.pending)||L.Util.requestAnimFrame(t),s},_clone:function(e){let t=e.cloneNode(!0);return t.style.visibility=`visible`,t},_checkZoomLevels:function(){let e=this._map.getZoom(),t=this._mutant.getZoom();!e||!t||(t!==e||t>this.options.maxNativeZoom)&&this._setMaxNativeZoom(t)},_setMaxNativeZoom:function(e){e!==this.options.maxNativeZoom&&(this.options.maxNativeZoom=e,this._resetView())},_update:function(e){if(this._mutant){e||=this._map.getCenter();let t=new google.maps.LatLng(e.lat,e.lng),n=Math.round(this._map.getZoom()),s=this._mutant.getZoom();this._mutant.setCenter(t),n!==s&&(this._mutant.setZoom(n),this._mutantIsReady&&this._checkZoomLevels())}L.GridLayer.prototype._update.call(this,e)},whenReady:function(e,t){return this._mutant?e.call(t||this,{target:this}):this.on(`spawned`,e,t),this}}),L.gridLayer.googleMutant=function(e){return new L.GridLayer.GoogleMutant(e)};var hn=L.GridLayer.GoogleMutant,gn={iconColor:`#1EB300`,iconAnchor:{marker:[14,34],circle:[11,10],"circle-dot":[5,5],"rectangle-dot":[5,6],doughnut:[8,8]},popupAnchor:{marker:[0,-25],circle:[-3,-76],"circle-dot":[0,-2],"rectangle-dot":[0,-2],doughnut:[0,-2]},innerIconAnchor:{marker:[-2,5],circle:[0,2]},iconSize:{marker:[28,28],circle:[22,22],"circle-dot":[2,2],"rectangle-dot":[2,2],doughnut:[15,15]}},_n=Z.Icon.extend({options:{icon:`leaf`,iconSize:gn.iconSize.circle,iconAnchor:gn.iconAnchor.marker,iconShape:`marker`,iconStyle:``,innerIconAnchor:[0,3],innerIconStyle:``,isAlphaNumericIcon:!1,text:1,borderColor:gn.iconColor,borderWidth:2,borderStyle:`solid`,backgroundColor:`white`,textColor:gn.iconColor,customClasses:``,spin:!1,prefix:`fa`,html:``},initialize(e){this.applyDefaults(e),this.options=!e||!e.html?Z.Util.setOptions(this,e):e},applyDefaults(e){e&&(!e.iconSize&&e.iconShape&&(e.iconSize=gn.iconSize[e.iconShape]),!e.iconAnchor&&e.iconShape&&(e.iconAnchor=gn.iconAnchor[e.iconShape]),!e.popupAnchor&&e.iconShape&&(e.popupAnchor=gn.popupAnchor[e.iconShape]),e.innerIconAnchor||(e.iconShape===`circle`||e.iconShape===`marker`)&&(e.iconShape===`circle`&&e.isAlphaNumericIcon?e.innerIconAnchor=[0,-1]:e.iconShape===`marker`&&!e.isAlphaNumericIcon&&(e.innerIconAnchor=gn.innerIconAnchor[e.iconShape])))},createIcon(){let e=document.createElement(`div`),t=this.options;if(e.innerHTML=t.html?t.html:this.createIconInnerHtml(),this._setIconStyles(e),this.options.iconShape===`marker`){let n=document.createElement(`div`);return n.className=`beautify-marker`+(t.props.owner._currSelRow===t.props.row?` selected`:``),n.appendChild(e),n}return e},createIconInnerHtml(){let e=this.options;if(e.iconShape===`circle-dot`||e.iconShape===`rectangle-dot`||e.iconShape===`doughnut`)return``;let t=this.getInnerIconStyle(e);if(e.isAlphaNumericIcon)return`<div style="`+t+`">`+e.text+`</div>`;let n=``;return e.spin&&(n=` fa-spin`),`<i class="`+e.prefix+` `+e.icon+n+`" style="`+t+`"></i>`},getInnerIconStyle(e){let t=(0,Z.point)(e.innerIconAnchor);return`color:`+e.textColor+`;margin-top:`+t.y+`px; margin-left:`+t.x+`px;`+e.innerIconStyle},_setIconStyles(e){let t=this.options,n=(0,Z.point)(t.iconSize),s=(0,Z.point)(t.iconAnchor);if(e.className=`beautify-marker `,t.iconShape&&(e.className+=t.iconShape),t.customClasses&&(e.className+=` `+t.customClasses),e.style.backgroundColor=t.backgroundColor,e.style.color=t.textColor,e.style.borderColor=t.borderColor,e.style.borderWidth=t.borderWidth+`px`,e.style.borderStyle=t.borderStyle,n&&(e.style.width=n.x+`px`,e.style.height=n.y+`px`),s&&(e.style.marginLeft=-s.x+`px`,e.style.marginTop=-s.y+`px`),t.iconStyle){let n=e.getAttribute(`style`);n+=t.iconStyle,e.setAttribute(`style`,n)}}});function BeautifyIcon(e){return new _n(e)}var LeafletLayer=class extends Z.Layer{_rootGroup},D3SvgOverlay=class extends LeafletLayer{_svg;map;selection;projection;_pixelOrigin;_zoomDiff;_zoom;_scale;_shift;_wgsOrigin;_wgsInitialShift;constructor(e={}){super(),this._options(e)}svg(){return this._rootGroup}_drawCallback;drawCallback(e){return arguments.length?(this._drawCallback=e,this):this._drawCallback}getBounds(){if(!this.selection||!this.projection)return new Z.LatLngBounds([-90,-180],[90,180]);let e=this.selection.node().getBBox(),t;try{t=this.projection.layerPointToLatLng(new Z.Point(e.x,e.y+e.height))}catch{t=[-90,-180]}let n;try{n=this.projection.layerPointToLatLng(new Z.Point(e.x+e.width,e.y))}catch{n=[90,180]}return new Z.LatLngBounds(t,n)}_undef(e){return e===void 0}_options(e){return this._undef(e)?this.options:(e.zoomHide=this._undef(e.zoomHide)?!1:e.zoomHide,e.zoomDraw=this._undef(e.zoomDraw)?!0:e.zoomDraw,this.options=e)}draw(){!this.map||!this._drawCallback||(this.projection.metresPerPixel=40075016.686*Math.abs(Math.cos(this.map.getCenter().lat*Math.PI/180))/2**(this.map.getZoom()+8)*this.projection.scale,this._drawCallback(this.selection,this.projection,this.map.getZoom()))}_zoomChange(e){let t=this._undef(e.zoom)?this.map._zoom:e.zoom;this._zoomDiff=t-this._zoom,this._scale=2**this._zoomDiff,this.projection.scale=this._scale,this._shift=this.map.latLngToLayerPoint(this._wgsOrigin)._subtract(this._wgsInitialShift.multiplyBy(this._scale));let n=[`translate(`,this._shift.x,`,`,this._shift.y,`) `],s=[`scale(`,this._scale,`,`,this._scale,`) `];this._rootGroup.attr(`transform`,n.concat(s).join(``)),this.options.zoomDraw&&this.draw()}onAdd(e){this.map=e;let n=this;return this._svg=Z.svg(),e.addLayer(this._svg),this._rootGroup=(0,t.select)(this._svg._rootGroup).classed(`d3-overlay`,!0),this._rootGroup.classed(`leaflet-zoom-hide`,this.options.zoomDraw),this.selection=this._rootGroup,this._pixelOrigin=e.getPixelOrigin(),this._wgsOrigin=Z.latLng([0,0]),this._wgsInitialShift=this.map.latLngToLayerPoint(this._wgsOrigin),this._zoom=this.map.getZoom(),this._shift=Z.point(0,0),this._scale=1,this.projection={latLngToLayerPoint(e,t){return t=n._undef(t)?n._zoom:t,n.map.project(Z.latLng(e),t)._subtract(n._pixelOrigin)},layerPointToLatLng(e,t){t=n._undef(t)?n._zoom:t;let s=Z.point(e).add(n._pixelOrigin);return n.map.unproject(s,t)},unitsPerMeter:256*2**n._zoom/40075017,metresPerPixel:40075016.686*Math.abs(Math.cos(e.getCenter().lat*Math.PI/180))/2**(e.getZoom()+8),map:n.map,layer:n,scale:1},this.projection._projectPoint=function(e,t){let s=n.projection.latLngToLayerPoint(new Z.LatLng(t,e));this.stream.point(s.x,s.y)},this.projection.pathFromGeojson=path_default().projection(transform_default$1({point:this.projection._projectPoint})),this.projection.latLngToLayerFloatPoint=this.projection.latLngToLayerPoint,this.projection.getZoom=this.map.getZoom.bind(this.map),this.projection.getBounds=this.map.getBounds.bind(this.map),this.selection=this._rootGroup,this.draw(),this}getEvents(){return{zoomend:this._zoomChange,viewreset:this._zoomChange}}onRemove(e){return this._svg.remove(),this}addTo(e){return e.addLayer(this),this}},vn=__toESM(__commonJSMin(((e,t)=>{t!==void 0&&(t.exports=simpleheat);function simpleheat(e){if(!(this instanceof simpleheat))return new simpleheat(e);this._canvas=e=typeof e==`string`?document.getElementById(e):e,this._ctx=e.getContext(`2d`),this._width=e.width,this._height=e.height,this._max=1,this._data=[]}simpleheat.prototype={defaultRadius:25,defaultGradient:{.4:`blue`,.6:`cyan`,.7:`lime`,.8:`yellow`,1:`red`},data:function(e){return this._data=e,this},max:function(e){return this._max=e,this},add:function(e){return this._data.push(e),this},clear:function(){return this._data=[],this},radius:function(e,t){t=t===void 0?15:t;var n=this._circle=this._createCanvas(),s=n.getContext(`2d`),c=this._r=e+t;return n.width=n.height=c*2,s.shadowOffsetX=s.shadowOffsetY=c*2,s.shadowBlur=t,s.shadowColor=`black`,s.beginPath(),s.arc(-c,-c,e,0,Math.PI*2,!0),s.closePath(),s.fill(),this},resize:function(){this._width=this._canvas.width,this._height=this._canvas.height},gradient:function(e){var t=this._createCanvas(),n=t.getContext(`2d`),s=n.createLinearGradient(0,0,0,256);for(var c in t.width=1,t.height=256,e)s.addColorStop(+c,e[c]);return n.fillStyle=s,n.fillRect(0,0,1,256),this._grad=n.getImageData(0,0,1,256).data,this},draw:function(e){this._circle||this.radius(this.defaultRadius),this._grad||this.gradient(this.defaultGradient);var t=this._ctx;t.clearRect(0,0,this._width,this._height);for(var n=0,s=this._data.length,c;n<s;n++)c=this._data[n],t.globalAlpha=Math.max(c[2]/this._max,e===void 0?.05:e),t.drawImage(this._circle,c[0]-this._r,c[1]-this._r);var l=t.getImageData(0,0,this._width,this._height);return this._colorize(l.data,this._grad),t.putImageData(l,0,0),this},_colorize:function(e,t){for(var n=0,s=e.length,c;n<s;n+=4)c=e[n+3]*4,c&&(e[n]=t[c],e[n+1]=t[c+1],e[n+2]=t[c+2])},_createCanvas:function(){return typeof document<`u`?document.createElement(`canvas`):new this._canvas.constructor}}}))(),1),yn=window.simpleheat||vn&&vn.default||vn,LeafletLayer2=class extends Z.Layer{},HeatLayer$1=class extends LeafletLayer2{static{__name(this,`HeatLayer`)}_latlngs;_heat;_frame;_canvas;constructor(e,t={}){super(t),this._latlngs=e}initialize(e){this.setOptions(e)}setLatLngs(e){return this._latlngs=e,this.redraw()}addLatLng(e){return this._latlngs.push(e),this.redraw()}setOptions(e){return this.options=e,this._heat&&this._updateOptions(),this.redraw()}redraw(){return this._heat&&!this._frame&&!this._map._animating&&(this._frame=Z.Util.requestAnimFrame(this._redraw,this)),this}onAdd(e){return this._map=e,this._canvas||this._initCanvas(),e._panes.overlayPane.appendChild(this._canvas),e.on(`moveend`,this._reset,this),e.options.zoomAnimation&&Z.Browser.any3d&&e.on(`zoomanim`,this._animateZoom,this),this._reset(),this}onRemove(e){return e.getPanes().overlayPane.removeChild(this._canvas),e.off(`moveend`,this._reset,this),e.options.zoomAnimation&&e.off(`zoomanim`,this._animateZoom,this),this}addTo(e){return e.addLayer(this),this}_initCanvas(){let e=this._canvas=Z.DomUtil.create(`canvas`,`leaflet-heatmap-layer leaflet-layer`),t=Z.DomUtil.testProp([`transformOrigin`,`WebkitTransformOrigin`,`msTransformOrigin`]);e.style[t]=`50% 50%`;let n=this._map.getSize();e.width=n.x,e.height=n.y;let s=this._map.options.zoomAnimation&&Z.Browser.any3d;Z.DomUtil.addClass(e,`leaflet-zoom-`+(s?`animated`:`hide`)),this._heat=yn(e),this._updateOptions()}_updateOptions(){this._heat.radius(this.options.radius||this._heat.defaultRadius,this.options.blur),this.options.gradient&&this._heat.gradient(this.options.gradient),this.options.max&&this._heat.max(this.options.max)}_reset(){let e=this._map.containerPointToLayerPoint([0,0]);Z.DomUtil.setPosition(this._canvas,e);let t=this._map.getSize();this._heat._width!==t.x&&(this._canvas.width=this._heat._width=t.x),this._heat._height!==t.y&&(this._canvas.height=this._heat._height=t.y),this._redraw()}_redraw(){let e=[],t=this._heat._r,n=this._map.getSize(),s=new Z.Bounds(Z.point([-t,-t]),n.add([t,t])),c=this.options.max===void 0?1:this.options.max,l=this.options.maxZoom===void 0?this._map.getMaxZoom():this.options.maxZoom,d=1/2**Math.max(0,Math.min(l-this._map.getZoom(),12)),f=t/2,p=[],m=this._map._getMapPanePos(),h=m.x%f,g=m.y%f,_,v,y,b,x,S,C,T,E;for(_=0,v=this._latlngs.length;_<v;_++)y=this._map.latLngToContainerPoint(this._latlngs[_]),s.contains(y)&&(x=Math.floor((y.x-h)/f)+2,S=Math.floor((y.y-g)/f)+2,E=(this._latlngs[_].alt===void 0?this._latlngs[_][2]===void 0?1:+this._latlngs[_][2]:this._latlngs[_].alt)*d,p[S]=p[S]||[],b=p[S][x],b?(b[0]=(b[0]*b[2]+y.x*E)/(b[2]+E),b[1]=(b[1]*b[2]+y.y*E)/(b[2]+E),b[2]+=E):p[S][x]=[y.x,y.y,E]);for(_=0,v=p.length;_<v;_++)if(p[_])for(C=0,T=p[_].length;C<T;C++)b=p[_][C],b&&e.push([Math.round(b[0]),Math.round(b[1]),Math.min(b[2],c)]);this._heat.data(e).draw(this.options.minOpacity),this._frame=null}_animateZoom(e){let t=this._map.getZoomScale(e.zoom),n=this._map._getCenterOffset(e.center)._multiplyBy(-t).subtract(this._map._getMapPanePos());Z.DomUtil.setTransform?Z.DomUtil.setTransform(this._canvas,n,t):this._canvas.style[Z.DomUtil.TRANSFORM]=Z.DomUtil.getTranslateString(n)+` scale(`+t+`)`}},bn=Z.default.MarkerClusterGroup,TileLayer=class extends t.Widget{_layer=new Z.FeatureGroup;_crs=Z.CRS.EPSG3857;constructor(e=!1){super(),this._layer.__hpcc_layer=this}crs(){return this._crs}attribution(){return``}clear(){this._layer.clearLayers()}add(e){this._layer.addLayer(e)}_initPromise;init(){return this._initPromise||=Promise.resolve(),this._initPromise}hasBounds(){return!1}getBounds(){return this._layer.getBounds()}layerEnter(e){e.addLayer(this._layer)}layerUpdate(e){}layerExit(e){this._layer.clearLayers(),e.removeLayer(this._layer)}zoomEnd(e){}moveEnd(e){}viewReset(e){}},xn=resolve(`Albers`).scale(.5),Sn=resolve(`AlbersUsaPr`).scale(.5),Cn=Z.Util.extend({},Z.CRS,{projection:{project(e){let t=Sn([e.lng,e.lat]);return t||=xn([e.lng,e.lat]),new Z.Point(t[0],t[1])},unproject(e){if(!isNaN(e.x)&&!isNaN(e.y)){let t=xn.invert([e.x,e.y]);return new Z.LatLng(t[1],t[0])}else return new Z.LatLng(0,0)}},transformation:new Z.Transformation(1,0,1,0),infinite:!0}),AlbersLayer=class extends TileLayer{_crs=Cn;constructor(){super()}hasBounds(){return!0}getBounds(){return new Z.LatLngBounds([20,-123],[49,-64])}};AlbersLayer.prototype._class+=` map_AlbersLayer`;var BlankLayer=class extends TileLayer{constructor(){super()}};BlankLayer.prototype._class+=` map_BlankLayer`;var GMapLayer=class extends TileLayer{constructor(){super()}init(){return this._initPromise||=requireGoogleMap(),this._initPromise}attribution(){return window.__hpcc_gmap_apikey?``:`DEVELOPER USE ONLY (@hpcc-js)`}getMaxZoom(){return 23}layerEnter(e){super.layerEnter(e),this.add(new hn({type:`roadmap`,styles:this.googleMapStyles()}))}};GMapLayer.prototype._class+=` map_GMapLayer`,GMapLayer.prototype.publish(`googleMapStyles`,{},`object`,`Styling for map colors etc`,null,{tags:[`Basic`]});var MapBoxLayer=class extends TileLayer{constructor(){super()}attribution(){return window.__hpcc_mapbox_apikey?``:`DEVELOPER USE ONLY (@hpcc-js)`}getMaxZoom(){return 18}layerEnter(e){super.layerEnter(e),window.__hpcc_mapbox_apikey||console.warn(`__hpcc_mapbox_apikey does not contain a valid API key, reverting to developers key (expect limited performance)`);let t=window.__hpcc_mapbox_apikey||`pk.eyJ1IjoibGVzY2htb28iLCJhIjoiY2psY2FqY3l3MDhqNDN3cDl1MzFmZnkwcCJ9.HRoFwmz1j80gyz18ruggqw`;this.add(new Z.TileLayer(`https://api.mapbox.com/styles/v1/mapbox/{id}/tiles/{z}/{x}/{y}?access_token=${t}`,{attribution:`Map data &copy; <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="https://www.mapbox.com/">Mapbox</a>`,maxZoom:18,id:`streets-v11`,accessToken:t}))}};MapBoxLayer.prototype._class+=` map_MapBoxLayer`;var OpenStreetLayer=class extends TileLayer{constructor(){super()}attribution(){return``}getMaxZoom(){return 18}layerEnter(e){super.layerEnter(e),this.add(new Z.TileLayer(`https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png`,{attribution:`Map data &copy; <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>`,maxZoom:18,id:`open.streets`}))}};OpenStreetLayer.prototype._class+=` map_MapBoxLayer`;var Leaflet=class extends t.HTMLWidget{_leafletElement;_leafletMap;_iconBar=new t.IconBar().buttons([new t.Button().faChar(`fa-plus`).tooltip(`Zoom in`).on(`click`,()=>{this.zoomPlus()}),new t.Button().faChar(`fa-minus`).tooltip(`Zoom out`).on(`click`,()=>{this.zoomMinus()}),new t.Spacer,new t.Button().faChar(`fa-arrows-alt`).tooltip(`Zoom to fit`).on(`click`,()=>{this.zoomToFit()})]);_blankLayer=new BlankLayer;_albersLayer=new AlbersLayer;_mapBoxLayer=new MapBoxLayer;_openStreetLayer=new OpenStreetLayer;_gmapLayer=new GMapLayer;constructor(){super(),this.baseLayer()}zoom(){return this._leafletMap.getZoom()}zoomPlus(){this._leafletMap.zoomIn()}zoomMinus(){this._leafletMap.zoomOut()}zoomToDefault(){this._leafletMap.flyTo({lat:this.defaultLat(),lng:this.defaultLong()},this.defaultZoom(),{animate:!1})}zoomToFit(){let e;this.mapType()===`AlbersPR`?e=this._albersLayer.getBounds():this.layers().filter(e=>e.hasBounds()).forEach(t=>{e?e.extend(t.getBounds()):e=t.getBounds()}),e&&e.isValid()?this._leafletMap.fitBounds(e,{maxZoom:14}):this.zoomToDefault()}syncLayers(e,t,n){let s=[...e],c=[],l=[];this._leafletMap.eachLayer(e=>{let t=s.indexOf(e.__hpcc_layer);t>=0?(c.push(e.__hpcc_layer),s.splice(t,1)):e.__hpcc_layer&&l.push(e.__hpcc_layer)}),s.forEach(e=>{e.layerEnter(this._leafletMap),e.layerUpdate(this._leafletMap)}),c.forEach(e=>{e.layerUpdate(this._leafletMap)}),l.forEach(e=>{e.layerExit(this._leafletMap)})}_owner;isLayer(){return this._owner!==void 0&&this._owner!==this}baseLayer(){switch(this.mapType()){case`AlbersPR`:this.map(this._albersLayer);break;case`MapBox`:this.map(this._mapBoxLayer);break;case`OpenStreet`:this.map(this._openStreetLayer);break;case`Google`:this.map(this._gmapLayer);break;default:this.map(this._blankLayer);break}return this.map()}enter(e,t){super.enter(e,t),t.style(`position`,`relative`),this._leafletElement=t.append(`div`).style(`position`,`absolute`).style(`width`,`${this.width()}px`).style(`height`,`${this.height()}px`),this._iconBar.target(e)}_prevCRS;update(e,t){super.update(e,t),this._leafletElement.style(`width`,`${this.width()}px`).style(`height`,`${this.height()}px`);let n=this.baseLayer();this._prevCRS!==n.crs()&&(this._prevCRS=n.crs(),this._leafletMap&&(this.syncLayers([],e,t),this._leafletMap.remove(),this._leafletElement.html(``)),this._leafletMap=new Z.Map(this._leafletElement.node(),{trackResize:!1,zoomControl:!1,zoomSnap:this.mapType()===`AlbersPR`?.1:1,crs:n.crs(),maxZoom:n.getMaxZoom?n.getMaxZoom():18}),this._leafletMap.setView([this.defaultLat(),this.defaultLong()],this.defaultZoom()),this._leafletMap.attributionControl.setPrefix(n.attribution()),this._leafletMap.on(`zoomend`,e=>this.layers().forEach(t=>t.zoomEnd(e))),this._leafletMap.on(`moveend`,e=>this.layers().forEach(t=>t.moveEnd(e))),this._leafletMap.on(`viewreset`,e=>this.layers().forEach(t=>t.viewReset(e))),this._renderCount=0),this.syncLayers([n,...this.layers()],e,t),this._leafletMap.invalidateSize(),this.autoZoomToFit()&&this._leafletMap.whenReady(function(){this.zoomToFit()},this),this._iconBar.visible(this.showToolbar()).render(e=>{let t=e.getBBox();e.element().style(`z-index`,5e3).style(`left`,`${this.width()-t.width-4}px`)})}exit(e,t){this._iconBar.target(null),super.exit(e,t)}render(e){let t=[this.baseLayer().init(),...this.layers().map(e=>e.init())];return Promise.all(t).then(()=>{super.render(e)}),this}};Leaflet.prototype._class+=` map_Leaflet`,Leaflet.prototype.publish(`showToolbar`,!0,`boolean`,`Show toolbar`,void 0,{hidden:e=>e.isLayer()}),Leaflet.prototype.publish(`mapType`,`Google`,`set`,`Base Layer Type`,[`None`,`AlbersPR`,`MapBox`,`OpenStreet`,`Google`],{hidden:e=>e.isLayer()}),Leaflet.prototype.publish(`map`,null,`widget`,`Base Layer`,void 0,{internal:!0}),Leaflet.prototype.publish(`layers`,[],`propertyArray`,`Layers`,void 0,{hidden:e=>e.isLayer()}),Leaflet.prototype.publish(`defaultLat`,42.877742,`number`,`Center Latitude`,void 0,{hidden:e=>e.isLayer()}),Leaflet.prototype.publish(`defaultLong`,-97.380979,`number`,`Center Longitude`,void 0,{hidden:e=>e.isLayer()}),Leaflet.prototype.publish(`defaultZoom`,4,`number`,`Zoom Level`,void 0,{hidden:e=>e.isLayer()}),Leaflet.prototype.publish(`autoZoomToFit`,!0,`boolean`,`Auto zoom to fit Data`,void 0,{hidden:e=>e.isLayer()});var FeatureLayer=class extends Leaflet{_layer;_selection;constructor(e=!1){super(),this._layer=e?new bn:new Z.FeatureGroup,this._layer.__hpcc_layer=this,t.Utility.SimpleSelectionMixin.call(this),this.layers([this])}owner(e){this._owner=e}valid(){return!0}clear(){this._layer.clearLayers()}add(e){this._layer.addLayer(e)}maxZoom(){return this._owner._leafletMap.getMaxZoom()||24}zoom(){return this._owner._leafletMap.getZoom()}visibleBounds(){return this._owner._leafletMap.getBounds()}_initPromise;init(){return this._initPromise||=Promise.resolve(),this._initPromise}hasBounds(){return!1}getBounds(){return this._layer.getBounds()}style(e,n){return n===void 0?(0,t.select)(this._layer.getPane()).style(e):((0,t.select)(this._layer.getPane()).style(e,n),this)}propValue(e,t,n){return(e<0?n:t[e])||n}layerEnter(e){e.addLayer(this._layer);let n=(0,t.select)(e.getContainer()).select(`.leaflet-pane.leaflet-marker-pane`);this._selection.widgetElement(n)}layerUpdate(e){}layerExit(e){this._layer.clearLayers(),e.removeLayer(this._layer)}zoomEnd(e){}moveEnd(e){}viewReset(e){}};FeatureLayer.prototype._class+=` map_FeatureLayer`,FeatureLayer.prototype.mixin(t.Utility.SimpleSelectionMixin),FeatureLayer.prototype.publishReset([`layers`]);var ClusterLayer=class extends FeatureLayer{constructor(e=!0){super(e)}};ClusterLayer.prototype._class+=` map_ClusterLayer`;var D3SurfaceLayer=class extends FeatureLayer{_lfd3=new D3SvgOverlay().drawCallback((e,t)=>this.layerUpdate(void 0,t));hasBounds(){return!0}getBounds(){return this._lfd3.getBounds()}layerEnter(e){super.layerEnter(e),this.add(this._lfd3)}layerUpdate(e,t){super.layerUpdate(e)}clickHandler(e,t){}},Circles=class extends ClusterLayer{hasBounds(){return!0}layerUpdate(e){super.layerUpdate(e);let t=this.columns(),n=t.indexOf(this.latitudeColumn()),s=t.indexOf(this.longitudeColumn()),c=t.indexOf(this.strokeColorColumn()),l=t.indexOf(this.fillColorColumn());this.clear(),this.data().filter(e=>!this.omitNullLatLong()||!!e[n]&&!!e[s]).forEach(e=>{this.add(new Z.Circle([e[n],e[s]],{color:this.propValue(c,e,this.strokeColor()),fill:!0,fillColor:this.propValue(l,e,this.fillColor()),fillOpacity:this.fillOpacity(),radius:this.radius(),origRow:e}).on(`click`,t=>this.clickHandler(t,e)))})}clickHandler(e,t){}};Circles.prototype._class+=` map_Circles`,Circles.prototype.publish(`latitudeColumn`,null,`set`,`Latitude column`,function(){return this.columns()},{optional:!0}),Circles.prototype.publish(`longitudeColumn`,null,`set`,`Longitude column`,function(){return this.columns()},{optional:!0}),Circles.prototype.publish(`radius`,50,`number`,`Radius (meters)`),Circles.prototype.publish(`strokeColor`,`#376cea`,`html-color`,`Stroke Color`,null,{optional:!0}),Circles.prototype.publish(`strokeColorColumn`,null,`set`,`Stroke color column`,function(){return this.columns()},{optional:!0}),Circles.prototype.publish(`fillColor`,`#376cea`,`html-color`,`Fill Color`,null,{optional:!0}),Circles.prototype.publish(`fillColorColumn`,null,`set`,`Fill color column`,function(){return this.columns()},{optional:!0}),Circles.prototype.publish(`fillOpacity`,.5,`number`,`Opacity`,null,{tags:[`Advanced`]}),Circles.prototype.publish(`omitNullLatLong`,!0,`boolean`,`Remove lat=0,lng=0 from pinsData`,null,{tags:[`Basic`]});var D3Circles=class extends D3SurfaceLayer{layerUpdate(e,t){super.layerUpdate(e,t);let n=this._lfd3._rootGroup;t||=this._lfd3.projection;let s=this.columns(),c=s.indexOf(this.latitudeColumn()),l=s.indexOf(this.longitudeColumn()),d=s.indexOf(this.strokeColorColumn()),f=s.indexOf(this.fillColorColumn());function toLatLng(e){return{lat:+e[c],lng:+e[l]}}let p=n.selectAll(`circle`).data(this.data().filter(e=>!this.omitNullLatLong()||!!e[c]&&!!e[l]));p.enter().append(`circle`).merge(p).attr(`cx`,e=>t.latLngToLayerPoint(toLatLng(e)).x).attr(`cy`,e=>t.latLngToLayerPoint(toLatLng(e)).y).attr(`r`,Math.max(3/t.scale,this.radius()/t.metresPerPixel)).style(`fill-opacity`,this.fillOpacity()).style(`stroke`,e=>this.propValue(d,e,this.strokeColor())).attr(`stroke-width`,Math.max(1/t.scale,1/t.metresPerPixel)).style(`fill`,e=>this.propValue(f,e,this.fillColor())),p.exit().remove()}clickHandler(e,t){}};D3Circles.prototype._class+=` map_D3Circles`,D3Circles.prototype.publish(`latitudeColumn`,null,`set`,`Latitude column`,function(){return this.columns()},{optional:!0}),D3Circles.prototype.publish(`longitudeColumn`,null,`set`,`Longitude column`,function(){return this.columns()},{optional:!0}),D3Circles.prototype.publish(`radius`,50,`number`,`Radius (meters)`),D3Circles.prototype.publish(`strokeColor`,`#376cea`,`html-color`,`Stroke Color`,null,{optional:!0}),D3Circles.prototype.publish(`strokeColorColumn`,null,`set`,`Stroke color column`,function(){return this.columns()},{optional:!0}),D3Circles.prototype.publish(`fillColor`,`#376cea`,`html-color`,`Fill Color`,null,{optional:!0}),D3Circles.prototype.publish(`fillColorColumn`,null,`set`,`Fill color column`,function(){return this.columns()},{optional:!0}),D3Circles.prototype.publish(`fillOpacity`,.5,`number`,`Opacity`,null,{tags:[`Advanced`]}),D3Circles.prototype.publish(`omitNullLatLong`,!0,`boolean`,`Remove lat=0,lng=0 from pinsData`,null,{tags:[`Basic`]});var ClusterCircles=class extends FeatureLayer{_palette;createIcon(e,n,s){let c=(0,t.hsl)(n);return c.opacity=.5,new Z.DivIcon({className:`cluster-circle`,iconSize:new Z.Point(40,40),html:`<div style='opacity:${this.opacity()};background-color:${c.toString()}'><div style='background-color:${n}'><span style='color:${t.Palette.textColor(n)}'>${s(e)}</span></div></div>`})}layerUpdate(e){super.layerUpdate(e),this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+`_`+this.id()));let n=this.cellFunc(this.latitudeColumn(),0),s=this.cellFunc(this.longitudeColumn(),0),latLongFunc=e=>[+n(e),+s(e)],c=this.cellFunc(this.weightColumn(),0),l=this.data(),d=(0,t.extent)(l,c),f=this.weightFormat()?(0,t.format)(this.weightFormat()):e=>e;this.clear(),l.forEach(e=>{let t=new Z.Marker(latLongFunc(e),{icon:this.createIcon(c(e),this._palette(c(e),d[0],d[1]),f),origRow:e}).on(`click`,t=>this.clickHandler(t,e));t.bindTooltip(`Weight: `+c(e)),this.add(t)})}clickHandler(e,t){}};ClusterCircles.prototype._class+=` map_ClusterCircles`,ClusterCircles.prototype._palette=t.Palette.rainbow(`default`),ClusterCircles.prototype.publish(`paletteID`,`YlOrRd`,`set`,`Color palette for this widget`,ClusterCircles.prototype._palette.switch()),ClusterCircles.prototype.publish(`useClonedPalette`,!1,`boolean`,`Enable or disable using a cloned palette`),ClusterCircles.prototype.publish(`latitudeColumn`,null,`set`,`Latitude column`,function(){return this.columns()},{optional:!0}),ClusterCircles.prototype.publish(`longitudeColumn`,null,`set`,`Longitude column`,function(){return this.columns()},{optional:!0}),ClusterCircles.prototype.publish(`weightColumn`,null,`set`,`Weight column`,function(){return this.columns()},{optional:!0}),ClusterCircles.prototype.publish(`weightFormat`,`,`,`string`,`Number format for weight`),ClusterCircles.prototype.publish(`opacity`,.66,`number`,`Opacity`,null,{tags:[`Advanced`]});function fixDateLine(e,t){let n=t.getLatLngs();n.forEach(function(e){e.forEach(function(e){if(Array.isArray(e)){let t=0,n=0,s=0,c=0;e.forEach(function(e){e.lat>-62&&(e.lng>165?++c:e.lng<-165&&++s,e.lng>0?++n:e.lng<0&&++t)}),s>0&&c>0&&e.forEach(function(e){e.lng>165&&t>n?e.lng-=360:e.lng<-165&&n>t&&(e.lng+=360)})}})}),t.setLatLngs(n)}var TopoJSON=class extends Z.GeoJSON{constructor(e,t){super(e,{...t,onEachFeature:(e,n)=>{t.onEachFeature&&t.onEachFeature(e,n),fixDateLine(e,n)}})}addData(e){let t,n;if(e.type===`Topology`){for(n in e.objects)e.objects.hasOwnProperty(n)&&(t=feature_default(e,e.objects[n]),super.addData.call(this,t));return this}return super.addData.call(this,e),this}},World=class extends FeatureLayer{_features;_palette;_dataMap={};_dataMinWeight=null;_dataMaxWeight=null;constructor(){super(),t.Utility.SimpleSelectionMixin.call(this)}hasBounds(){return!0}getBounds(){let e=super.getBounds();return e.isValid()?new Z.LatLngBounds([e.getNorth(),e.getWest()],[e.getSouth(),e.getEast()]):new Z.LatLngBounds([90,-180],[-90,180])}updateDataMap(e){this._dataMap={},this._dataMinWeight=null,this._dataMaxWeight=null;let t=this;e.forEach(function(e){t._dataMap[e[0]]=e,(!t._dataMinWeight||e[1]<t._dataMinWeight)&&(t._dataMinWeight=e[1]),(!t._dataMaxWeight||e[1]>t._dataMaxWeight)&&(t._dataMaxWeight=e[1])})}data(e){let t=super.data.apply(this,arguments);return arguments.length&&this.updateDataMap(e),t}styleFeature(e){let t=this._dataMap[e.properties.hpccID],n=t?this._palette(t[1],this._dataMinWeight,this._dataMaxWeight):`transparent`;return{color:this.meshVisible()?this.meshColor():void 0,opacity:1,weight:this.meshStrokeWidth(),fillColor:n,fillOpacity:this.opacity()}}svgGlowID(){return this.id()+`_svgGlow`}_topoJson;_svgElement;layerEnter(e){super.layerEnter(e),this._svgElement||(this._svgElement=(0,t.select)(e.getContainer()).select(`.leaflet-pane.leaflet-overlay-pane > svg`),new t.SVGGlowFilter(this._svgElement.append(`defs`),this.svgGlowID()),this._selection.widgetElement(this._svgElement))}_prevFeatures;layerUpdate(e){this._prevFeatures!==this._features&&(this.clear(),this._topoJson=new TopoJSON(this._features,{onEachFeature:(e,t)=>{t.on(`click`,e=>this.clickHandler(e,t,t.feature.properties.hpccID))}}).bindTooltip(e=>this.tooltipHandler(e,e.feature.properties.hpccID),{direction:`top`,sticky:!0}),this.add(this._topoJson)),super.layerUpdate(e),this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+`_`+this.id())),this._topoJson.setStyle(e=>this.styleFeature(e))}clickHandler(e,t,n){let s=this._selection.click(e.originalEvent.target);return this.click(this.rowToObj(this._dataMap[n]),this.columns()[0],s),s}tooltipText(e,t){return t}tooltipHandler(e,t){let n=this._dataMap[t],s=n&&n[1]||``;return this.tooltipText(this.rowToObj(n),`<b>${t}</b>: ${s}`)}click(e,t,n){}};World.prototype._class+=` map_World`,World.prototype._palette=t.Palette.rainbow(`default`),World.prototype.mixin(t.Utility.SimpleSelectionMixin),World.prototype.publish(`paletteID`,`YlOrRd`,`set`,`Color palette for this widget`,World.prototype._palette.switch(),{tags:[`Basic`,`Shared`]}),World.prototype.publish(`useClonedPalette`,!1,`boolean`,`Enable or disable using a cloned palette`,null,{tags:[`Intermediate`,`Shared`]}),World.prototype.publish(`opacity`,.5,`number`,`Opacity`,null,{tags:[`Advanced`]}),World.prototype.publish(`meshVisible`,!0,`boolean`,`Mesh Visibility`),World.prototype.publish(`meshColor`,`black`,`html-color`,`Stroke Color`),World.prototype.publish(`meshStrokeWidth`,.25,`number`,`Stroke Width`),World.prototype.publish(`internalOnly`,!1,`boolean`,`Internal mesh only`);var wn=null,Countries=class extends World{constructor(){super()}init(){return this._initPromise||=new Promise((e,t)=>{wn&&e(wn),Zt(`${topoJsonFolder()}/countries.json`,function(t){wn=t,e(wn)})}).then(e=>{this._features=feature_default(e.topology,e.topology.objects.countries).features;for(let t in this._features)if(this._features[t].id){let n=this._features[t].id,s=e.countryNames[n]?.name;this._features[t].properties.hpccID=s}}),this._initPromise}tooltipHandler(e,t){let n=this._dataMap[t],s=n&&n[1]||``;return this.tooltipText(this.rowToObj(n),`<b>${t}</b>: ${s}`)}};function del(e,t){let n=e.indexOf(t);n>=0&&e.splice(n,1)}var DrawLayer=class extends FeatureLayer{_polylines=[];_polygons=[];_rectangles=[];_circles=[];_drawControl;hasBounds(){return!0}drawOptions(){let e={marker:!1,circlemarker:!1};return this.enableCircle()||(e.circle=!1),this.enablePolyline()||(e.polyline=!1),this.enableRectangle()||(e.rectangle=!1),this.enablePolygon()||(e.polygon=!1),e}save(){return{polylines:this._polylines.map(e=>e.getLatLngs()),polygons:this._polygons.map(e=>e.getLatLngs()),rectangles:this._rectangles.map(e=>e.getBounds()),circles:this._circles.map(e=>({center:e.getLatLng(),radius:e.getRadius()}))}}restore(e){this.clear(),this._polylines=(e.polylines||[]).map(e=>new Z.Polyline(e)),this._polygons=(e.polygons||[]).map(e=>new Z.Polygon(e)),this._rectangles=(e.rectangles||[]).map(e=>new Z.Rectangle(e)),this._circles=(e.circles||[]).map(e=>new Z.Circle(e.center,{radius:e.radius})),this._polylines.forEach(e=>this.add(e)),this._polygons.forEach(e=>this.add(e)),this._rectangles.forEach(e=>this.add(e)),this._circles.forEach(e=>this.add(e))}_drawOptionsHash;layerEnter(e){super.layerEnter(e),e.on(Z.Draw.Event.CREATED,e=>{let t=e.layerType,n=e.layer;switch(t){case`polyline`:this._polylines.push(n);break;case`polygon`:this._polygons.push(n);break;case`rectangle`:this._rectangles.push(n);break;case`circle`:this._circles.push(n);break;default:alert(t)}this.add(n),this.changed(`ADD`,n)}),e.on(Z.Draw.Event.EDITED,e=>{e.layers.eachLayer(e=>{this.changed(`UPDATE`,e)})}),e.on(Z.Draw.Event.DELETED,e=>{e.layers.eachLayer(e=>{del(this._polylines,e),del(this._polygons,e),del(this._rectangles,e),del(this._circles,e),this.changed(`DELETE`,e)})})}layerUpdate(e){super.layerUpdate(e),this.style(`opacity`,this.opacity());let t=this.drawOptions(),n=(0,c.hashSum)(t);this._drawOptionsHash!==n&&(this._drawOptionsHash=n,this._drawControl&&e.removeControl(this._drawControl),this._drawControl=new Z.Control.Draw({position:`topleft`,draw:t,edit:{featureGroup:this._layer}}),e.addControl(this._drawControl))}layerExit(e){super.layerExit(e)}changed(e,t){}};DrawLayer.prototype._class+=` map_DrawLayer`,DrawLayer.prototype.publish(`opacity`,1,`number`,`Layer Opacity`),DrawLayer.prototype.publish(`enablePolyline`,!0,`boolean`,`Enable Polyline Creation`),DrawLayer.prototype.publish(`enablePolygon`,!0,`boolean`,`Enable Polygon Creation`),DrawLayer.prototype.publish(`enableRectangle`,!0,`boolean`,`Enable Rectangle Creation`),DrawLayer.prototype.publish(`enableCircle`,!0,`boolean`,`Enable Circle Creation`);var HeatLayer=class extends FeatureLayer{hasBounds(){return!0}layerUpdate(e){super.layerUpdate(e),this.style(`opacity`,this.opacity());let t=this.columns(),n=this.latitudeColumn_exists()?t.indexOf(this.latitudeColumn()):0,s=this.longitudeColumn_exists()?t.indexOf(this.longitudeColumn()):1,c=t.indexOf(this.weightColumn());this.clear();let l,d=new HeatLayer$1(this.data().filter(e=>!this.omitNullLatLong()||!!e[n]&&!!e[s]).map(e=>(l?l.extend([e[n],e[s]]):l=new Z.LatLngBounds([e[n],e[s]]),[e[n],e[s],this.weightColumn_exists()?e[c]:.5])),{minOpacity:this.minOpacity(),max:this.max(),radius:this.radius(),blur:this.blur(),gradient:this.gradient()});d.getBounds=()=>l,this.add(d)}};HeatLayer.prototype._class+=` map_Heat`,HeatLayer.prototype.publish(`latitudeColumn`,null,`set`,`Latitude column`,function(){return this.columns()},{optional:!0}),HeatLayer.prototype.publish(`longitudeColumn`,null,`set`,`Longitude column`,function(){return this.columns()},{optional:!0}),HeatLayer.prototype.publish(`weightColumn`,null,`set`,`Optional normalized intensity (0 -> 1) `,function(){return this.columns()},{optional:!0}),HeatLayer.prototype.publish(`omitNullLatLong`,!0,`boolean`,`Remove lat=0,lng=0 from IconsData`,null,{tags:[`Basic`]}),HeatLayer.prototype.publish(`opacity`,.5,`number`,`Layer Opacity`),HeatLayer.prototype.publish(`minOpacity`,.5,`number`,`The minimum opacity the heat will start at`,null,{tags:[`Basic`]}),HeatLayer.prototype.publish(`max`,1,`number`,`maximum point intensity, 1.0 by default`,null,{tags:[`Basic`]}),HeatLayer.prototype.publish(`radius`,25,`number`,`radius of each point of the heatmap, 25 by default`,null,{tags:[`Basic`]}),HeatLayer.prototype.publish(`blur`,15,`number`,`amount of blur, 15 by default`,null,{tags:[`Basic`]}),HeatLayer.prototype.publish(`gradient`,null,`object`,`color gradient config`,null,{tags:[`Basic`],optional:!0});var Markers=class extends ClusterLayer{constructor(e=!1){super(e)}hasBounds(){return!0}tooltipText(e,t){return``+t}popupText(e,t){return``+t}_hashSum;layerUpdate(e,t){if(super.layerUpdate(e),!t)return;let n=this.columns(),s=n.indexOf(this.latitudeColumn()),c=n.indexOf(this.longitudeColumn()),l=n.indexOf(this.tooltipColumn()),d=n.indexOf(this.popupColumn()),f=this._db.checksum(),p=this.hashSum([],{dbChecksum:f});this._hashSum!==p&&(this._hashSum=p,this.clear(),this.data().filter(e=>!this.omitNullLatLong()||!!e[s]&&!!e[c]).forEach(e=>{let n=new Z.Marker([e[s],e[c]],t(e)).on(`click`,t=>this.clickHandler(t,n,e)),f=this.tooltipText(this.rowToObj(e),this.propValue(l,e,``));f&&n.bindTooltip(f,{direction:this.tooltipDirection(),offset:(0,Z.point)(this.tooltipOffsetX(),this.tooltipOffsetY())});let p=this.popupText(this.rowToObj(e),this.propValue(d,e,``));p&&n.bindPopup(p,{offset:(0,Z.point)(this.popupOffsetX(),this.popupOffsetY())}),this.add(n)}))}_currSelRow;clickHandler(e,t,n){let s=this._selection.click(t._icon);this._currSelRow=s?n:void 0,this.click(this.rowToObj(n),``,s)}click(e,t,n){}};Markers.prototype._class+=` map_Markers`,Markers.prototype.publish(`latitudeColumn`,null,`set`,`Latitude column`,function(){return this.columns()},{optional:!0}),Markers.prototype.publish(`longitudeColumn`,null,`set`,`Longitude column`,function(){return this.columns()},{optional:!0}),Markers.prototype.publish(`omitNullLatLong`,!0,`boolean`,`Remove lat=0,lng=0 from IconsData`,null,{tags:[`Basic`]}),Markers.prototype.publish(`tooltipColumn`,null,`set`,`Tooltip column`,function(){return this.columns()},{optional:!0}),Markers.prototype.publish(`tooltipDirection`,`auto`,`set`,`Tooltip direction`,[`auto`,`left`,`top`,`right`,`bottom`,`center`]),Markers.prototype.publish(`tooltipOffsetX`,0,`number`,`Tooltip offset X`),Markers.prototype.publish(`tooltipOffsetY`,0,`number`,`Tooltip offset Y`),Markers.prototype.publish(`popupColumn`,null,`set`,`Popup column`,function(){return this.columns()},{optional:!0}),Markers.prototype.publish(`popupOffsetX`,0,`number`,`Tooltip offset X`),Markers.prototype.publish(`popupOffsetY`,0,`number`,`Tooltip offset Y`);var Icons=class extends Markers{constructor(e=!1){super(e)}layerUpdate(e){let t=this.columns().indexOf(this.iconUrlColumn());super.layerUpdate(e,e=>({icon:new Z.Icon({iconUrl:this.propValue(t,e,this.iconUrl()),iconSize:[this.iconWidth(),this.iconHeight()],iconAnchor:[this.iconAnchorX(),this.iconAnchorY()],props:{owner:this,row:e}}),draggable:!1}))}};Icons.prototype._class+=` map_Icons`,Icons.prototype.publish(`iconUrl`,``,`string`,`Icon URL`,null),Icons.prototype.publish(`iconUrlColumn`,null,`set`,`Icon URL column`,function(){return this.columns()},{optional:!0}),Icons.prototype.publish(`iconWidth`,32,`number`,`Icon width`),Icons.prototype.publish(`iconHeight`,32,`number`,`Icon height`),Icons.prototype.publish(`iconAnchorX`,16,`number`,`Icon Anchor X`),Icons.prototype.publish(`iconAnchorY`,32,`number`,`Icon Anchor Y`);var ClusterIcons=class extends Icons{constructor(){super(!0)}};ClusterIcons.prototype._class+=` map_ClusterIcons`;function lngLat2LatLng(e){return[e[1],e[0]]}var calcSpread=(e,t)=>(t[0]<-90?e[0]++:t[0]>90&&e[1]++,e),shiftLeft=e=>e>90?e-360:e,shiftRight=e=>e<-90?e+360:e,shiftPoint=e=>{let t=e?shiftLeft:shiftRight;return e=>[t(e[0]),e[1]]},Polygons=class extends FeatureLayer{_palette;fixDateLine(e){let[t,n]=e.reduce(calcSpread,[0,0]);return t&&n?e.map(shiftPoint(t>n)):e}hasBounds(){return!0}updateHexagons(){this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+`_`+this.id()));let e=this.cellFunc(this.polygonColumn(),[]),n=this.cellFunc(this.weightColumn(),0),s=this.data(),c=(0,t.extent)(s,n);this.clear(),s.forEach(t=>{this.add(new Z.Polygon(this.fixDateLine(e(t)).map(lngLat2LatLng),{color:this._palette(c[1],c[0],c[1]),fillColor:this._palette(n(t),c[0],c[1]),fillOpacity:this.opacity(),weight:1,origRow:t}).on(`click`,e=>this.clickHandler(e,t)))})}layerUpdate(e){super.layerUpdate(e),this.updateHexagons()}zoomEnd(e){super.zoomEnd(e)}moveEnd(e){super.moveEnd(e),this.updateHexagons()}clickHandler(e,t){}};Polygons.prototype._class+=` map_Polygons`,Polygons.prototype._palette=t.Palette.rainbow(`default`),Polygons.prototype.publish(`paletteID`,`YlOrRd`,`set`,`Color palette for this widget`,Polygons.prototype._palette.switch(),{tags:[`Basic`,`Shared`]}),Polygons.prototype.publish(`useClonedPalette`,!1,`boolean`,`Enable or disable using a cloned palette`,null,{tags:[`Intermediate`,`Shared`]}),Polygons.prototype.publish(`polygonColumn`,null,`set`,`Polygon column`,function(){return this.columns()},{optional:!0}),Polygons.prototype.publish(`weightColumn`,null,`set`,`Weight column`,function(){return this.columns()},{optional:!0}),Polygons.prototype.publish(`opacity`,.5,`number`,`Opacity`,null,{tags:[`Advanced`]});var Tn=4096/2/Math.PI,Path=class extends D3SurfaceLayer{lineData(){let e=this.columns(),t=e.indexOf(this.latitudeColumn()),n=e.indexOf(this.longitudeColumn()),s=[],c;return this.data().forEach(e=>{let l=[e[n],e[t]];c&&s.push({type:`LineString`,coordinates:[l,c]}),c=l}),s}isNull(e){return!e[0]&&!e[1]}isNull2(e){return this.omitNullLatLong()?this.isNull(e[0])||this.isNull(e[1]):!1}layerUpdate(e,t){super.layerUpdate(e,t);let n=this._lfd3._rootGroup;t||=this._lfd3.projection,this._lfd3.svg().selectAll(`defs`).data([void 0]).enter().append(`defs`).append(`marker`).attr(`class`,`marker`).attr(`id`,this._id+`_arrowHead`).attr(`viewBox`,`0 0 10 10`).attr(`refX`,10).attr(`refY`,5).attr(`markerWidth`,12).attr(`markerHeight`,12).attr(`markerUnits`,`strokeWidth`).attr(`orient`,`auto`).append(`polyline`).attr(`points`,`0,0 10,5 0,10 1,5`),this._lfd3.svg().select(`defs > marker`).style(`fill`,this.strokeColor()).style(`stroke`,null);let s=t.latLngToLayerPoint({lat:0,lng:0}),c=resolve(`Mercator`).scale(Tn).translate([s.x,s.y]),l=path_default().projection(c),d=n.selectAll(`.dataEdge`).data(this.lineData().filter(e=>!this.isNull2(e.coordinates)));d.enter().append(`path`).attr(`class`,`dataEdge`).attr(`marker-end`,`url(#`+this._id+`_arrowHead)`).merge(d).attr(`d`,l).style(`stroke`,this.strokeColor()).style(`fill`,`none`).attr(`stroke-width`,1/t.scale),d.exit().remove()}clickHandler(e,t){}};Path.prototype._class+=` map_Path`,Path.prototype.publish(`latitudeColumn`,null,`set`,`Latitude column`,function(){return this.columns()},{optional:!0}),Path.prototype.publish(`longitudeColumn`,null,`set`,`Longitude column`,function(){return this.columns()},{optional:!0}),Path.prototype.publish(`strokeColor`,` #666666`,`html-color`,`Stroke Color`,null,{optional:!0}),Path.prototype.publish(`omitNullLatLong`,!0,`boolean`,`Remove lat=0,lng=0 from pinsData`,null,{tags:[`Basic`]});var Lines$1=class extends Path{static{__name(this,`Lines`)}lineData(){let e=this.columns(),t=e.indexOf(this.latitudeColumn()),n=e.indexOf(this.longitudeColumn()),s=e.indexOf(this.latitude2Column()),c=e.indexOf(this.longitude2Column()),l=[];return this.data().forEach(e=>{let d=[e[n],e[t]],f=[e[c],e[s]];l.push({type:`LineString`,coordinates:[d,f]})}),l}};Lines$1.prototype._class+=` map_Lines`,Lines$1.prototype.publish(`latitude2Column`,null,`set`,`Latitude column`,function(){return this.columns()},{optional:!0}),Lines$1.prototype.publish(`longitude2Column`,null,`set`,`Longitude column`,function(){return this.columns()},{optional:!0});var Pins$1=class extends Markers{static{__name(this,`Pins`)}constructor(e=!1){super(e)}layerUpdate(e){let t=this.columns(),n=t.indexOf(this.faCharColumn()),s=t.indexOf(this.faCharColorColumn()),c=t.indexOf(this.strokeColorColumn()),l=t.indexOf(this.fillColorColumn());super.layerUpdate(e,e=>({icon:BeautifyIcon({iconShape:`marker`,icon:this.propValue(n,e,this.faChar()),textColor:this.propValue(s,e,this.faCharColor()),borderColor:this.propValue(c,e,this.strokeColor()),backgroundColor:this.propValue(l,e,this.fillColor()),props:{owner:this,row:e}}),draggable:!1}))}};Pins$1.prototype._class+=` map_Pins`,Pins$1.prototype.publish(`faChar`,`fa-circle`,`string`,`Default font awesome character`),Pins$1.prototype.publish(`faCharColumn`,null,`set`,`Font awesome column`,function(){return this.columns()},{optional:!0}),Pins$1.prototype.publish(`faCharColor`,`#ffffff`,`html-color`,`Default font awesome Color`),Pins$1.prototype.publish(`faCharColorColumn`,null,`set`,`Font awesome color column`,function(){return this.columns()},{optional:!0}),Pins$1.prototype.publish(`strokeColor`,`transparent`,`html-color`,`Default stroke Color`,null,{optional:!0}),Pins$1.prototype.publish(`strokeColorColumn`,null,`set`,`Stroke color column`,function(){return this.columns()},{optional:!0}),Pins$1.prototype.publish(`fillColor`,`#376cea`,`html-color`,`Default fill Color`,null,{optional:!0}),Pins$1.prototype.publish(`fillColorColumn`,null,`set`,`Fill color column`,function(){return this.columns()},{optional:!0});var ClusterPins=class extends Pins$1{constructor(){super(!0)}};ClusterPins.prototype._class+=` map_ClusterPins`;var En={GB:[`administrative_area_level_3`,`administrative_area_level_2`,`administrative_area_level_1`],IE:[`administrative_area_level_2`,`administrative_area_level_1`],ND:[`administrative_area_level_2`,`administrative_area_level_1`]},Dn={};function cachedRegion(e){return Dn[e]||(Dn[e]={topology:void 0,nameIdx:{},codeIdx:{}}),Dn[e]}var Region=class extends World{constructor(){super()}fetchTopo(e){return cachedRegion(e).topology?Promise.resolve(cachedRegion(e).topology):new Promise((t,n)=>{Zt(`${topoJsonFolder()}/${e}.json`,function(n){cachedRegion(e).topology=n,t(n)})})}fetchTopoIdx(e){for(let t in cachedRegion(e).nameIdx)return Promise.resolve(cachedRegion(e).nameIdx);return new Promise((t,n)=>{Zt(`${topoJsonFolder()}/${e}_idx.json`,function(n){let{nameIdx:s,codeIdx:c}=cachedRegion(e);En[e]?.forEach(e=>{for(let t in n[e]){let l=n[e][t];Array.isArray(l)&&(s[t]||(s[t]={code:void 0,codes:[]}),s[t].codes=s[t].codes.concat(l),l.length===1&&(s[t].code=s[t].codes[0]),l.forEach(e=>{c[e]||(c[e]={name:void 0,score:9999,names:[]}),l.length<=c[e].score&&(c[e].name=t,c[e].score=l.length),c[e].names.push(t)}))}}),t(s)})})}updateDataMap(e){let t=[],n=cachedRegion(this.region()).nameIdx;return e.forEach(e=>{let s=n[e[0]]?.codes;s?s?.forEach(n=>{t.push([n,e[1],e])}):t.push([e[0],e[1],e])}),super.updateDataMap(t)}_prevRegion;init(){let e=this.region();return(!this._initPromise||this._prevRegion!==e)&&(this._prevRegion=e,this._initPromise=Promise.all([this.fetchTopo(e),this.fetchTopoIdx(e)]).then(([e,t])=>{this._features=feature_default(e,e.objects.PolbndA).features;for(let e in this._features){let t=this._features[e].id||e;this._features[e].properties.hpccID=t}this.updateDataMap(this.data())})),this._initPromise}tooltipHandler(e,t){let n=this._dataMap[t],s=cachedRegion(this.region()).codeIdx,c=n&&n[1]||``,l=s[t]?.names.map(e=>s[t]?.name===e?`<u>${e}</u>`:e).join(`, `);return this.tooltipText(this.rowToObj(n),`<b>${n&&n[2][0]||l||t}</b>: ${c}`)}};Region.prototype._class+=` map_Region`,Region.prototype.publish(`region`,`GB`,`set`,`Region Data`,`AT.BE.BG.BR.CHLI.CY.CZ.DE.DK.EE.ES.FI.FR.GB.GE.GR.HR.HU.IE.IS.IT.KS.LT.LU.LV.MD.MK.MT.ND.NL.NO.PL.PT.RO.RS.SE.SI.SK.UA`.split(`.`));var Text=class extends Markers{constructor(e=!1){super(e)}layerUpdate(e){let n=this.columns(),s=n.indexOf(this.textColumn()),c=n.indexOf(this.textColorColumn()),l=n.indexOf(this.strokeColorColumn()),d=n.indexOf(this.fillColorColumn());super.layerUpdate(e,e=>{let n=this.propValue(s,e,this.text()),f=this.textSize(n,this.fontFamily(),this.fontSize());return this.textFormat_exists()&&(n=(0,t.format)(this.textFormat())(n)),{icon:BeautifyIcon({iconShape:`rectangle`,iconAnchor:[f.width/2+this.textOffsetX(),f.height/2+this.textOffsetY()],html:`<span style="
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("@hpcc-js/common"),require("@hpcc-js/api"),require("@hpcc-js/layout"),require("@hpcc-js/util"),require("@hpcc-js/graph"),require("@hpcc-js/other")):typeof define==`function`&&define.amd?define([`exports`,`@hpcc-js/common`,`@hpcc-js/api`,`@hpcc-js/layout`,`@hpcc-js/util`,`@hpcc-js/graph`,`@hpcc-js/other`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e[`@hpcc-js/map`]={},e[`@hpcc-js/common`],e[`@hpcc-js/api`],e[`@hpcc-js/layout`],e[`@hpcc-js/util`],e[`@hpcc-js/graph`],e[`@hpcc-js/other`]))})(this,function(e,t,n,s,c,l,d){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var f=Object.create,p=Object.defineProperty,__name=(e,t)=>p(e,`name`,{value:t,configurable:!0}),m=Object.getOwnPropertyDescriptor,h=Object.getOwnPropertyNames,g=Object.getPrototypeOf,_=Object.prototype.hasOwnProperty,__commonJSMin=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),__exportAll=(e,t)=>{let n={};for(var s in e)p(n,s,{get:e[s],enumerable:!0});return t||p(n,Symbol.toStringTag,{value:`Module`}),n},__copyProps=(e,t,n,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=h(t),l=0,d=c.length,f;l<d;l++)f=c[l],!_.call(e,f)&&f!==n&&p(e,f,{get:(e=>t[e]).bind(null,f),enumerable:!(s=m(t,f))||s.enumerable});return e},__toESM=(e,t,n)=>(n=e==null?{}:f(g(e)),__copyProps(t||!e||!e.__esModule?p(n,`default`,{value:e,enumerable:!0}):n,e)),v=`@hpcc-js/map`,y=`3.6.0`,b=`3.26.0`;function add_default(e){var t=+this._x.call(null,e),n=+this._y.call(null,e);return add$1(this.cover(t,n),t,n,e)}__name(add_default,`default`);function add$1(e,t,n,s){if(isNaN(t)||isNaN(n))return e;var c,l=e._root,d={data:s},f=e._x0,p=e._y0,m=e._x1,h=e._y1,g,_,v,y,b,x,S,C;if(!l)return e._root=d,e;for(;l.length;)if((b=t>=(g=(f+m)/2))?f=g:m=g,(x=n>=(_=(p+h)/2))?p=_:h=_,c=l,!(l=l[S=x<<1|b]))return c[S]=d,e;if(v=+e._x.call(null,l.data),y=+e._y.call(null,l.data),t===v&&n===y)return d.next=l,c?c[S]=d:e._root=d,e;do c=c?c[S]=[,,,,]:e._root=[,,,,],(b=t>=(g=(f+m)/2))?f=g:m=g,(x=n>=(_=(p+h)/2))?p=_:h=_;while((S=x<<1|b)==(C=(y>=_)<<1|v>=g));return c[C]=l,c[S]=d,e}__name(add$1,`add`);function addAll(e){var t,n,s=e.length,c,l,d=Array(s),f=Array(s),p=1/0,m=1/0,h=-1/0,g=-1/0;for(n=0;n<s;++n)isNaN(c=+this._x.call(null,t=e[n]))||isNaN(l=+this._y.call(null,t))||(d[n]=c,f[n]=l,c<p&&(p=c),c>h&&(h=c),l<m&&(m=l),l>g&&(g=l));if(p>h||m>g)return this;for(this.cover(p,m).cover(h,g),n=0;n<s;++n)add$1(this,d[n],f[n],e[n]);return this}function cover_default(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var n=this._x0,s=this._y0,c=this._x1,l=this._y1;if(isNaN(n))c=(n=Math.floor(e))+1,l=(s=Math.floor(t))+1;else{for(var d=c-n,f=this._root,p,m;n>e||e>=c||s>t||t>=l;)switch(m=(t<s)<<1|e<n,p=[,,,,],p[m]=f,f=p,d*=2,m){case 0:c=n+d,l=s+d;break;case 1:n=c-d,l=s+d;break;case 2:c=n+d,s=l-d;break;case 3:n=c-d,s=l-d;break}this._root&&this._root.length&&(this._root=f)}return this._x0=n,this._y0=s,this._x1=c,this._y1=l,this}__name(cover_default,`default`);function data_default(){var e=[];return this.visit(function(t){if(!t.length)do e.push(t.data);while(t=t.next)}),e}__name(data_default,`default`);function extent_default$1(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}__name(extent_default$1,`default`);function quad_default(e,t,n,s,c){this.node=e,this.x0=t,this.y0=n,this.x1=s,this.y1=c}__name(quad_default,`default`);function find_default(e,t,n){var s,c=this._x0,l=this._y0,d,f,p,m,h=this._x1,g=this._y1,_=[],v=this._root,y,b;for(v&&_.push(new quad_default(v,c,l,h,g)),n==null?n=1/0:(c=e-n,l=t-n,h=e+n,g=t+n,n*=n);y=_.pop();)if(!(!(v=y.node)||(d=y.x0)>h||(f=y.y0)>g||(p=y.x1)<c||(m=y.y1)<l))if(v.length){var x=(d+p)/2,S=(f+m)/2;_.push(new quad_default(v[3],x,S,p,m),new quad_default(v[2],d,S,x,m),new quad_default(v[1],x,f,p,S),new quad_default(v[0],d,f,x,S)),(b=(t>=S)<<1|e>=x)&&(y=_[_.length-1],_[_.length-1]=_[_.length-1-b],_[_.length-1-b]=y)}else{var C=e-+this._x.call(null,v.data),T=t-+this._y.call(null,v.data),E=C*C+T*T;if(E<n){var D=Math.sqrt(n=E);c=e-D,l=t-D,h=e+D,g=t+D,s=v.data}}return s}__name(find_default,`default`);function remove_default(e){if(isNaN(h=+this._x.call(null,e))||isNaN(g=+this._y.call(null,e)))return this;var t,n=this._root,s,c,l,d=this._x0,f=this._y0,p=this._x1,m=this._y1,h,g,_,v,y,b,x,S;if(!n)return this;if(n.length)for(;;){if((y=h>=(_=(d+p)/2))?d=_:p=_,(b=g>=(v=(f+m)/2))?f=v:m=v,t=n,!(n=n[x=b<<1|y]))return this;if(!n.length)break;(t[x+1&3]||t[x+2&3]||t[x+3&3])&&(s=t,S=x)}for(;n.data!==e;)if(c=n,!(n=n.next))return this;return(l=n.next)&&delete n.next,c?(l?c.next=l:delete c.next,this):t?(l?t[x]=l:delete t[x],(n=t[0]||t[1]||t[2]||t[3])&&n===(t[3]||t[2]||t[1]||t[0])&&!n.length&&(s?s[S]=n:this._root=n),this):(this._root=l,this)}__name(remove_default,`default`);function removeAll(e){for(var t=0,n=e.length;t<n;++t)this.remove(e[t]);return this}function root_default(){return this._root}__name(root_default,`default`);function size_default(){var e=0;return this.visit(function(t){if(!t.length)do++e;while(t=t.next)}),e}__name(size_default,`default`);function visit_default(e){var t=[],n,s=this._root,c,l,d,f,p;for(s&&t.push(new quad_default(s,this._x0,this._y0,this._x1,this._y1));n=t.pop();)if(!e(s=n.node,l=n.x0,d=n.y0,f=n.x1,p=n.y1)&&s.length){var m=(l+f)/2,h=(d+p)/2;(c=s[3])&&t.push(new quad_default(c,m,h,f,p)),(c=s[2])&&t.push(new quad_default(c,l,h,m,p)),(c=s[1])&&t.push(new quad_default(c,m,d,f,h)),(c=s[0])&&t.push(new quad_default(c,l,d,m,h))}return this}__name(visit_default,`default`);function visitAfter_default(e){var t=[],n=[],s;for(this._root&&t.push(new quad_default(this._root,this._x0,this._y0,this._x1,this._y1));s=t.pop();){var c=s.node;if(c.length){var l,d=s.x0,f=s.y0,p=s.x1,m=s.y1,h=(d+p)/2,g=(f+m)/2;(l=c[0])&&t.push(new quad_default(l,d,f,h,g)),(l=c[1])&&t.push(new quad_default(l,h,f,p,g)),(l=c[2])&&t.push(new quad_default(l,d,g,h,m)),(l=c[3])&&t.push(new quad_default(l,h,g,p,m))}n.push(s)}for(;s=n.pop();)e(s.node,s.x0,s.y0,s.x1,s.y1);return this}__name(visitAfter_default,`default`);function defaultX(e){return e[0]}function x_default(e){return arguments.length?(this._x=e,this):this._x}__name(x_default,`default`);function defaultY(e){return e[1]}function y_default(e){return arguments.length?(this._y=e,this):this._y}__name(y_default,`default`);function quadtree(e,t,n){var s=new Quadtree$1(t??defaultX,n??defaultY,NaN,NaN,NaN,NaN);return e==null?s:s.addAll(e)}function Quadtree$1(e,t,n,s,c,l){this._x=e,this._y=t,this._x0=n,this._y0=s,this._x1=c,this._y1=l,this._root=void 0}__name(Quadtree$1,`Quadtree`);function leaf_copy(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}var x=quadtree.prototype=Quadtree$1.prototype;x.copy=function(){var e=new Quadtree$1(this._x,this._y,this._x0,this._y0,this._x1,this._y1),t=this._root,n,s;if(!t)return e;if(!t.length)return e._root=leaf_copy(t),e;for(n=[{source:t,target:e._root=[,,,,]}];t=n.pop();)for(var c=0;c<4;++c)(s=t.source[c])&&(s.length?n.push({source:s,target:t.target[c]=[,,,,]}):t.target[c]=leaf_copy(s));return e},x.add=add_default,x.addAll=addAll,x.cover=cover_default,x.data=data_default,x.extent=extent_default$1,x.find=find_default,x.remove=remove_default,x.removeAll=removeAll,x.root=root_default,x.size=size_default,x.visit=visit_default,x.visitAfter=visitAfter_default,x.x=x_default,x.y=y_default;var Quadtree=class{_pin_h=0;_pin_w=0;_tree;constructor(e,t,n,s){this._pin_h=n,this._pin_w=s,this._tree=quadtree().extent(e).addAll(t)}searchRect(e,t,n,s){let c=[];return this._tree.visit((l,d,f,p,m)=>{let h;do l.length||l.data&&!l.data.already_flagged&&overlaps({left:e,right:n,top:t,bottom:s},l.data)&&(l.data.already_flagged=!0,c.push(l.data)),h=l=l.next;while(h);return d>=n||f>=s||p<e||m<t}),c;function overlaps(e,t){return(t[0]<e.right||t[0]>e.left)&&(t[1]<e.bottom||t[1]>e.top)}}getTreeRects(){let e=[];return this._tree.visit((t,n,s,c,l)=>{e.push([n,s,c-n,l-s])}),e}},CanvasPins=class extends t.CanvasWidget{_quadtree_rect_arr;_drawData;_overlap_count=0;_sub_overlap_count=0;constructor(){super()}enter(e,t){super.enter.apply(this,arguments),this.resize(this._size)}update(e,t){super.update.apply(this,arguments),this._ctx=this.element().node().getContext(`2d`);let n=(this.topLeftX_exists()&&this.topLeftY_exists()&&this.bottomRightX_exists()&&this.bottomRightY_exists()?this.skewedData():this.data()).map(e=>[...e]).map(e=>(e.is_cluster=!1,e.already_flagged=!1,e.weight=e[2],e.fillStyle=`#FFFFFF`,e.strokeStyle=`#000000`,e.overlap_arr=[],e));this._ctx.clearRect(0,0,this.width(),this.height()),this._drawData=this.enableClustering()?this.applyClustering(n):n,this.draw(this._drawData)}applyClustering(e){let t=this;this._overlap_count=0;let n=this.pinHeight(),s=this.pinWidth(),c=s/2,l=n/2,d=new Quadtree([[0,0],[this.size().width,this.size().height]],e,n,s);switch(this._quadtree_rect_arr=d.getTreeRects(),this.clusterMode()){case`default`:let t=e.map(e=>{if(!e.already_flagged){let t=this.searchRectMult(),n=e[0]-c*t,s=e[1]-l*t-8,f=e[0]+c*t,p=e[1]+l*t-8;e.overlap_arr=d.searchRect(n,s,f,p).filter(t=>t!==e),e.overlap_arr.length===0&&(e.already_flagged=!1)}return e});return t.forEach(e=>{e.already_flagged&&e.overlap_arr.length&&t.push(cluster_arr([e,...e.overlap_arr]))}),t;case`grid`:let n=[...e],s=this.gridCellSize(),f=this.gridCellSize(),p=Math.ceil(this.size().width/s),m=Math.ceil(this.size().height/f);for(let e=0;e<m;e++)for(let t=0;t<p;t++){let c=s*t,l=f*e,p=s*(t+1),m=f*(e+1),h=d.searchRect(c,l,p,m);if(h.length>1){let e=c+s/2,t=l+f/2;n.push(cluster_arr(h,e,t))}}return n}return e;function cluster_arr(e,n,s){let c=e.reduce((e,t)=>(t.already_flagged=!0,e+t[2]),0);return{0:n===void 0?t.useAveragePos()?e.reduce((e,t)=>e+t[0]*t[2],0)/c:e[0][0]:n,1:s===void 0?t.useAveragePos()?e.reduce((e,t)=>e+t[1]*t[2],0)/c:e[0][1]:s,weight:e.reduce((e,t)=>e+t[2],0),is_cluster:!0,already_flagged:!1,fillStyle:`#FFFFFF`,strokeStyle:`#000000`,overlap_arr:[]}}}drawQuadtree(){this._quadtree_rect_arr&&(this._ctx.strokeStyle=`#000000`,this._quadtree_rect_arr.forEach(e=>{this._ctx.strokeRect(e[0],e[1],e[2],e[3])}))}draw(e){let t=this,n=this._ctx;this.showQuadtree()&&this.drawQuadtree();let s=this.arrowHeight(),c=this.arrowWidth(),l=this.pinHeight(),d=this.pinWidth(),f=this.radiusWeightMult(),p=0;this.useWeightedRadius()&&e.filter(e=>e.is_cluster).forEach(e=>{p<e.weight&&(p=e.weight)}),e.filter(e=>!e.already_flagged).sort((e,t)=>e[1]>t[1]?1:-1).forEach(e=>{if(e.is_cluster||this.allCircles()){let t=d/2;this.useWeightedRadius()&&(t+=d*(f*e.weight/p)),drawCirclePin({icon:e.weight,left:Math.floor(e[0]-t)+.5,top:Math.floor(e[1]-t-s)+.5,radius:t,arrow_height:s,arrow_width:c})}else drawSquarePin({fillStyle:e.fillStyle,strokeStyle:e.strokeStyle,icon:e.weight,left:Math.floor(e[0]-d/2)+.5,top:Math.floor(e[1]-l-s)+.5,width:d,height:l,arrow_height:s,arrow_width:c})});function drawCirclePin(e){e.width=e.radius*2,e.height=e.width,n.fillStyle=`#FFFFFF`,n.strokeStyle=`#000000`,n.beginPath(),n.arc(e.left+e.width/2,e.top+e.height/2,e.radius,0,2*Math.PI),n.closePath(),n.fill(),n.stroke(),drawPinText(e)}function drawSquarePin(e){n.fillStyle=e.fillStyle,n.strokeStyle=`#000000`,n.fillRect(e.left,e.top,e.width,e.height),n.strokeRect(e.left,e.top,e.width,e.height),drawArrow(e),drawPinText(e)}function drawArrow(e,t){let s=e.left+e.width/2-e.arrow_width/2,c=e.left+e.width/2,l=e.left+e.width/2+e.arrow_width/2,d=e.top+e.height,f=d+e.arrow_height,p=d;t?(n.fillStyle=`#FFFFFF`,n.strokeStyle=`#FFFFFF`,d-=2,f-=2,p-=2):(n.fillStyle=`#FFFFFF`,n.strokeStyle=`#000000`),n.beginPath(),n.moveTo(s,d),n.lineTo(c,f),n.lineTo(l,p),n.lineTo(s,d),n.closePath(),n.stroke(),n.fill(),t||drawArrow(e,!0)}function drawPinText(e){n.font=`${t.pinFontSize()}px '${t.pinFontFamily()}'`;let s=e.left+e.width/2,c=e.top+e.height/2;n.textAlign=`center`,n.textBaseline=`middle`,n.fillStyle=`#000000`;let l=0,d=n.measureText(e.icon).width;for(;d>e.width||!t.shrinkFontToPin();)l++,n.font=`${t.pinFontSize()-l}px '${t.pinFontFamily()}'`,d=n.measureText(e.icon).width;n.fillText(e.icon,s,c)}}skewedData(){let e=this,t=[],n=this.data(),s=this.size(),c=this.bottomRightX()-this.topLeftX(),l=this.bottomRightY()-this.topLeftY(),d=c/s.width,f=l/s.height;return n.forEach(function(n){let s=Math.abs(n[0]-e.topLeftX()),c=Math.abs(n[1]-e.topLeftY()),l=s/d,p=c/f;t.push([l,p,n[2]])}),t}};CanvasPins.prototype._class+=` map_CanvasPins`,CanvasPins.prototype.publish(`clusterMode`,`default`,`set`,`clusterMode`,[`defualt`,`grid`],{tags:[`Basic`],optional:!0}),CanvasPins.prototype.publish(`gridCellSize`,80,`number`,`gridCellSize`,null,{tags:[`Basic`],optional:!0}),CanvasPins.prototype.publish(`allCircles`,!1,`boolean`,`allCircles`,null,{tags:[`Basic`],optional:!0}),CanvasPins.prototype.publish(`showQuadtree`,!1,`boolean`,`showQuadtree`,null,{tags:[`Basic`],optional:!0}),CanvasPins.prototype.publish(`useAveragePos`,!1,`boolean`,`useAveragePos`,null,{tags:[`Basic`],optional:!0}),CanvasPins.prototype.publish(`shrinkFontToPin`,!0,`boolean`,`shrinkFontToPin`,null,{tags:[`Basic`],optional:!0}),CanvasPins.prototype.publish(`enableClustering`,!0,`boolean`,`enableClustering`,null,{tags:[`Basic`],optional:!0}),CanvasPins.prototype.publish(`useWeightedRadius`,!1,`boolean`,`useWeightedRadius`,null,{tags:[`Basic`],optional:!0}),CanvasPins.prototype.publish(`radiusWeightMult`,.5,`number`,`radiusWeightMult`,null,{tags:[`Basic`],optional:!0}),CanvasPins.prototype.publish(`searchRectMult`,3,`number`,`searchRectMult`,null,{tags:[`Basic`],optional:!0}),CanvasPins.prototype.publish(`bottomRightX`,null,`number`,`Bottom right x-value`,null,{tags:[`Basic`],optional:!0}),CanvasPins.prototype.publish(`bottomRightY`,null,`number`,`Bottom right y-value`,null,{tags:[`Basic`],optional:!0}),CanvasPins.prototype.publish(`topLeftX`,null,`number`,`Top left x-value`,null,{tags:[`Basic`],optional:!0}),CanvasPins.prototype.publish(`topLeftY`,null,`number`,`Top left y-value`,null,{tags:[`Basic`],optional:!0}),CanvasPins.prototype.publish(`pinHeight`,20,`number`,`pinHeight`,null,{tags:[`Basic`],optional:!0}),CanvasPins.prototype.publish(`pinWidth`,20,`number`,`pinWidth`,null,{tags:[`Basic`],optional:!0}),CanvasPins.prototype.publish(`pinFontFamily`,`Arial`,`string`,`pinFontFamily`,null,{tags:[`Basic`],optional:!0}),CanvasPins.prototype.publish(`pinFontSize`,14,`number`,`pinFontSize`,null,{tags:[`Basic`],optional:!0}),CanvasPins.prototype.publish(`arrowHeight`,8,`number`,`arrowHeight`,null,{tags:[`Basic`],optional:!0}),CanvasPins.prototype.publish(`arrowWidth`,8,`number`,`arrowWidth`,null,{tags:[`Basic`],optional:!0});function adder_default(){return new Adder}__name(adder_default,`default`);function Adder(){this.reset()}Adder.prototype={constructor:Adder,reset:function(){this.s=this.t=0},add:function(e){add(S,e,this.t),add(this,S.s,this.s),this.s?this.t+=S.t:this.s=S.t},valueOf:function(){return this.s}};var S=new Adder;function add(e,t,n){var s=e.s=t+n,c=s-t;e.t=t-(s-c)+(n-c)}var C=1e-6,T=Math.PI,E=T/2,D=T/4,O=T*2,k=180/T,A=T/180,j=Math.abs,M=Math.atan,N=Math.atan2,P=Math.cos,I=Math.ceil,ee=Math.exp,te=Math.log,ne=Math.pow,R=Math.sin,z=Math.sign||function(e){return e>0?1:e<0?-1:0},B=Math.sqrt,re=Math.tan;function acos(e){return e>1?0:e<-1?T:Math.acos(e)}function asin(e){return e>1?E:e<-1?-E:Math.asin(e)}function haversin(e){return(e=R(e/2))*e}function noop$1(){}__name(noop$1,`noop`);function streamGeometry(e,t){e&&ae.hasOwnProperty(e.type)&&ae[e.type](e,t)}var ie={Feature:function(e,t){streamGeometry(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,s=-1,c=n.length;++s<c;)streamGeometry(n[s].geometry,t)}},ae={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,s=-1,c=n.length;++s<c;)e=n[s],t.point(e[0],e[1],e[2])},LineString:function(e,t){streamLine(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,s=-1,c=n.length;++s<c;)streamLine(n[s],t,0)},Polygon:function(e,t){streamPolygon(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,s=-1,c=n.length;++s<c;)streamPolygon(n[s],t)},GeometryCollection:function(e,t){for(var n=e.geometries,s=-1,c=n.length;++s<c;)streamGeometry(n[s],t)}};function streamLine(e,t,n){var s=-1,c=e.length-n,l;for(t.lineStart();++s<c;)l=e[s],t.point(l[0],l[1],l[2]);t.lineEnd()}function streamPolygon(e,t){var n=-1,s=e.length;for(t.polygonStart();++n<s;)streamLine(e[n],t,1);t.polygonEnd()}function stream_default(e,t){e&&ie.hasOwnProperty(e.type)?ie[e.type](e,t):streamGeometry(e,t)}__name(stream_default,`default`);var oe=adder_default(),se=adder_default(),ce,le,ue,de,fe,pe={point:noop$1,lineStart:noop$1,lineEnd:noop$1,polygonStart:function(){oe.reset(),pe.lineStart=areaRingStart$1,pe.lineEnd=areaRingEnd$1},polygonEnd:function(){var e=+oe;se.add(e<0?O+e:e),this.lineStart=this.lineEnd=this.point=noop$1},sphere:function(){se.add(O)}};function areaRingStart$1(){pe.point=areaPointFirst$1}__name(areaRingStart$1,`areaRingStart`);function areaRingEnd$1(){areaPoint$1(ce,le)}__name(areaRingEnd$1,`areaRingEnd`);function areaPointFirst$1(e,t){pe.point=areaPoint$1,ce=e,le=t,e*=A,t*=A,ue=e,de=P(t=t/2+D),fe=R(t)}__name(area_default,`default`),__name(areaPointFirst$1,`areaPointFirst`);function areaPoint$1(e,t){e*=A,t*=A,t=t/2+D;var n=e-ue,s=n>=0?1:-1,c=s*n,l=P(t),d=R(t),f=fe*d,p=de*l+f*P(c),m=f*s*R(c);oe.add(N(m,p)),ue=e,de=l,fe=d}__name(areaPoint$1,`areaPoint`);function area_default(e){return se.reset(),stream_default(e,pe),se*2}function spherical(e){return[N(e[1],e[0]),asin(e[2])]}function cartesian(e){var t=e[0],n=e[1],s=P(n);return[s*P(t),s*R(t),R(n)]}function cartesianDot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function cartesianCross(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function cartesianAddInPlace(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function cartesianScale(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function cartesianNormalizeInPlace(e){var t=B(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var V,me,H,he,ge,_e,ve,ye,be=adder_default(),xe,U,Se={point:boundsPoint$2,lineStart:boundsLineStart,lineEnd:boundsLineEnd,polygonStart:function(){Se.point=boundsRingPoint,Se.lineStart=boundsRingStart,Se.lineEnd=boundsRingEnd,be.reset(),pe.polygonStart()},polygonEnd:function(){pe.polygonEnd(),Se.point=boundsPoint$2,Se.lineStart=boundsLineStart,Se.lineEnd=boundsLineEnd,oe<0?(V=-(H=180),me=-(he=90)):be>1e-6?he=90:be<-1e-6&&(me=-90),U[0]=V,U[1]=H},sphere:function(){V=-(H=180),me=-(he=90)}};function boundsPoint$2(e,t){xe.push(U=[V=e,H=e]),t<me&&(me=t),t>he&&(he=t)}__name(boundsPoint$2,`boundsPoint`);function linePoint(e,t){var n=cartesian([e*A,t*A]);if(ye){var s=cartesianCross(ye,n),c=cartesianCross([s[1],-s[0],0],s);cartesianNormalizeInPlace(c),c=spherical(c);var l=e-ge,d=l>0?1:-1,f=c[0]*k*d,p,m=j(l)>180;m^(d*ge<f&&f<d*e)?(p=c[1]*k,p>he&&(he=p)):(f=(f+360)%360-180,m^(d*ge<f&&f<d*e)?(p=-c[1]*k,p<me&&(me=p)):(t<me&&(me=t),t>he&&(he=t))),m?e<ge?angle(V,e)>angle(V,H)&&(H=e):angle(e,H)>angle(V,H)&&(V=e):H>=V?(e<V&&(V=e),e>H&&(H=e)):e>ge?angle(V,e)>angle(V,H)&&(H=e):angle(e,H)>angle(V,H)&&(V=e)}else xe.push(U=[V=e,H=e]);t<me&&(me=t),t>he&&(he=t),ye=n,ge=e}function boundsLineStart(){Se.point=linePoint}function boundsLineEnd(){U[0]=V,U[1]=H,Se.point=boundsPoint$2,ye=null}function boundsRingPoint(e,t){if(ye){var n=e-ge;be.add(j(n)>180?n+(n>0?360:-360):n)}else _e=e,ve=t;pe.point(e,t),linePoint(e,t)}function boundsRingStart(){pe.lineStart()}function boundsRingEnd(){boundsRingPoint(_e,ve),pe.lineEnd(),j(be)>1e-6&&(V=-(H=180)),U[0]=V,U[1]=H,ye=null}function angle(e,t){return(t-=e)<0?t+360:t}function rangeCompare(e,t){return e[0]-t[0]}function rangeContains(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}__name(bounds_default,`default`);function bounds_default(e){var t,n,s,c,l,d,f;if(he=H=-(V=me=1/0),xe=[],stream_default(e,Se),n=xe.length){for(xe.sort(rangeCompare),t=1,s=xe[0],l=[s];t<n;++t)c=xe[t],rangeContains(s,c[0])||rangeContains(s,c[1])?(angle(s[0],c[1])>angle(s[0],s[1])&&(s[1]=c[1]),angle(c[0],s[1])>angle(s[0],s[1])&&(s[0]=c[0])):l.push(s=c);for(d=-1/0,n=l.length-1,t=0,s=l[n];t<=n;s=c,++t)c=l[t],(f=angle(s[1],c[0]))>d&&(d=f,V=c[0],H=s[1])}return xe=U=null,V===1/0||me===1/0?[[NaN,NaN],[NaN,NaN]]:[[V,me],[H,he]]}var Ce,we,Te,Ee,De,Oe,ke,Ae,je,Me,Ne,Pe,Fe,W,G,K,q={sphere:noop$1,point:centroidPoint$1,lineStart:centroidLineStart$1,lineEnd:centroidLineEnd$1,polygonStart:function(){q.lineStart=centroidRingStart$1,q.lineEnd=centroidRingEnd$1},polygonEnd:function(){q.lineStart=centroidLineStart$1,q.lineEnd=centroidLineEnd$1}};function centroidPoint$1(e,t){e*=A,t*=A;var n=P(t);centroidPointCartesian(n*P(e),n*R(e),R(t))}__name(centroidPoint$1,`centroidPoint`);function centroidPointCartesian(e,t,n){++Ce,Te+=(e-Te)/Ce,Ee+=(t-Ee)/Ce,De+=(n-De)/Ce}function centroidLineStart$1(){q.point=centroidLinePointFirst}__name(centroidLineStart$1,`centroidLineStart`);function centroidLinePointFirst(e,t){e*=A,t*=A;var n=P(t);W=n*P(e),G=n*R(e),K=R(t),q.point=centroidLinePoint,centroidPointCartesian(W,G,K)}function centroidLinePoint(e,t){e*=A,t*=A;var n=P(t),s=n*P(e),c=n*R(e),l=R(t),d=N(B((d=G*l-K*c)*d+(d=K*s-W*l)*d+(d=W*c-G*s)*d),W*s+G*c+K*l);we+=d,Oe+=d*(W+(W=s)),ke+=d*(G+(G=c)),Ae+=d*(K+(K=l)),centroidPointCartesian(W,G,K)}function centroidLineEnd$1(){q.point=centroidPoint$1}__name(centroidLineEnd$1,`centroidLineEnd`);function centroidRingStart$1(){q.point=centroidRingPointFirst}__name(centroidRingStart$1,`centroidRingStart`),__name(centroid_default,`default`);function centroidRingEnd$1(){centroidRingPoint(Pe,Fe),q.point=centroidPoint$1}__name(centroidRingEnd$1,`centroidRingEnd`);function centroidRingPointFirst(e,t){Pe=e,Fe=t,e*=A,t*=A,q.point=centroidRingPoint;var n=P(t);W=n*P(e),G=n*R(e),K=R(t),centroidPointCartesian(W,G,K)}function centroidRingPoint(e,t){e*=A,t*=A;var n=P(t),s=n*P(e),c=n*R(e),l=R(t),d=G*l-K*c,f=K*s-W*l,p=W*c-G*s,m=B(d*d+f*f+p*p),h=asin(m),g=m&&-h/m;je+=g*d,Me+=g*f,Ne+=g*p,we+=h,Oe+=h*(W+(W=s)),ke+=h*(G+(G=c)),Ae+=h*(K+(K=l)),centroidPointCartesian(W,G,K)}function centroid_default(e){Ce=we=Te=Ee=De=Oe=ke=Ae=je=Me=Ne=0,stream_default(e,q);var t=je,n=Me,s=Ne,c=t*t+n*n+s*s;return c<1e-12&&(t=Oe,n=ke,s=Ae,we<1e-6&&(t=Te,n=Ee,s=De),c=t*t+n*n+s*s,c<1e-12)?[NaN,NaN]:[N(n,t)*k,asin(s/B(c))*k]}function constant_default(e){return function(){return e}}__name(constant_default,`default`);function compose_default(e,t){function compose(n,s){return n=e(n,s),t(n[0],n[1])}return e.invert&&t.invert&&(compose.invert=function(n,s){return n=t.invert(n,s),n&&e.invert(n[0],n[1])}),compose}__name(compose_default,`default`);function rotationIdentity(e,t){return[j(e)>T?e+Math.round(-e/O)*O:e,t]}rotationIdentity.invert=rotationIdentity;function rotateRadians(e,t,n){return(e%=O)?t||n?compose_default(rotationLambda(e),rotationPhiGamma(t,n)):rotationLambda(e):t||n?rotationPhiGamma(t,n):rotationIdentity}function forwardRotationLambda(e){return function(t,n){return t+=e,[t>T?t-O:t<-T?t+O:t,n]}}function rotationLambda(e){var t=forwardRotationLambda(e);return t.invert=forwardRotationLambda(-e),t}function rotationPhiGamma(e,t){var n=P(e),s=R(e),c=P(t),l=R(t);function rotation(e,t){var d=P(t),f=P(e)*d,p=R(e)*d,m=R(t),h=m*n+f*s;return[N(p*c-h*l,f*n-m*s),asin(h*c+p*l)]}return rotation.invert=function(e,t){var d=P(t),f=P(e)*d,p=R(e)*d,m=R(t),h=m*c-p*l;return[N(p*c+m*l,f*n+h*s),asin(h*n-f*s)]},rotation}function rotation_default(e){e=rotateRadians(e[0]*A,e[1]*A,e.length>2?e[2]*A:0);function forward(t){return t=e(t[0]*A,t[1]*A),t[0]*=k,t[1]*=k,t}return forward.invert=function(t){return t=e.invert(t[0]*A,t[1]*A),t[0]*=k,t[1]*=k,t},forward}__name(rotation_default,`default`);function circleStream(e,t,n,s,c,l){if(n){var d=P(t),f=R(t),p=s*n;c==null?(c=t+s*O,l=t-p/2):(c=circleRadius(d,c),l=circleRadius(d,l),(s>0?c<l:c>l)&&(c+=s*O));for(var m,h=c;s>0?h>l:h<l;h-=p)m=spherical([d,-f*P(h),-f*R(h)]),e.point(m[0],m[1])}}function circleRadius(e,t){t=cartesian(t),t[0]-=e,cartesianNormalizeInPlace(t);var n=acos(-t[1]);return((-t[2]<0?-n:n)+O-C)%O}function circle_default$1(){var e=constant_default([0,0]),t=constant_default(90),n=constant_default(6),s,c,l={point};function point(e,t){s.push(e=c(e,t)),e[0]*=k,e[1]*=k}function circle(){var d=e.apply(this,arguments),f=t.apply(this,arguments)*A,p=n.apply(this,arguments)*A;return s=[],c=rotateRadians(-d[0]*A,-d[1]*A,0).invert,circleStream(l,f,p,1),d={type:`Polygon`,coordinates:[s]},s=c=null,d}return circle.center=function(t){return arguments.length?(e=typeof t==`function`?t:constant_default([+t[0],+t[1]]),circle):e},circle.radius=function(e){return arguments.length?(t=typeof e==`function`?e:constant_default(+e),circle):t},circle.precision=function(e){return arguments.length?(n=typeof e==`function`?e:constant_default(+e),circle):n},circle}__name(circle_default$1,`default`);function buffer_default(){var e=[],t;return{point:function(e,n,s){t.push([e,n,s])},lineStart:function(){e.push(t=[])},lineEnd:noop$1,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}__name(buffer_default,`default`);function pointEqual_default(e,t){return j(e[0]-t[0])<1e-6&&j(e[1]-t[1])<1e-6}__name(pointEqual_default,`default`);function Intersection(e,t,n,s){this.x=e,this.z=t,this.o=n,this.e=s,this.v=!1,this.n=this.p=null}function rejoin_default(e,t,n,s,c){var l=[],d=[],f,p;if(e.forEach(function(e){if(!((t=e.length-1)<=0)){var t,n=e[0],s=e[t],p;if(pointEqual_default(n,s)){if(!n[2]&&!s[2]){for(c.lineStart(),f=0;f<t;++f)c.point((n=e[f])[0],n[1]);c.lineEnd();return}s[0]+=2*C}l.push(p=new Intersection(n,e,null,!0)),d.push(p.o=new Intersection(n,null,p,!1)),l.push(p=new Intersection(s,e,null,!1)),d.push(p.o=new Intersection(s,null,p,!0))}}),l.length){for(d.sort(t),link(l),link(d),f=0,p=d.length;f<p;++f)d[f].e=n=!n;for(var m=l[0],h,g;;){for(var _=m,v=!0;_.v;)if((_=_.n)===m)return;h=_.z,c.lineStart();do{if(_.v=_.o.v=!0,_.e){if(v)for(f=0,p=h.length;f<p;++f)c.point((g=h[f])[0],g[1]);else s(_.x,_.n.x,1,c);_=_.n}else{if(v)for(h=_.p.z,f=h.length-1;f>=0;--f)c.point((g=h[f])[0],g[1]);else s(_.x,_.p.x,-1,c);_=_.p}_=_.o,h=_.z,v=!v}while(!_.v);c.lineEnd()}}}__name(rejoin_default,`default`);function link(e){if(t=e.length){for(var t,n=0,s=e[0],c;++n<t;)s.n=c=e[n],c.p=s,s=c;s.n=c=e[0],c.p=s}}var Ie=adder_default();function longitude(e){return j(e[0])<=T?e[0]:z(e[0])*((j(e[0])+T)%O-T)}function polygonContains_default(e,t){var n=longitude(t),s=t[1],c=R(s),l=[R(n),-P(n),0],d=0,f=0;Ie.reset(),c===1?s=E+C:c===-1&&(s=-E-C);for(var p=0,m=e.length;p<m;++p)if(g=(h=e[p]).length)for(var h,g,_=h[g-1],v=longitude(_),y=_[1]/2+D,b=R(y),x=P(y),S=0;S<g;++S,v=A,b=M,x=I,_=k){var k=h[S],A=longitude(k),j=k[1]/2+D,M=R(j),I=P(j),ee=A-v,te=ee>=0?1:-1,ne=te*ee,z=ne>T,B=b*M;if(Ie.add(N(B*te*R(ne),x*I+B*P(ne))),d+=z?ee+te*O:ee,z^v>=n^A>=n){var re=cartesianCross(cartesian(_),cartesian(k));cartesianNormalizeInPlace(re);var ie=cartesianCross(l,re);cartesianNormalizeInPlace(ie);var ae=(z^ee>=0?-1:1)*asin(ie[2]);(s>ae||s===ae&&(re[0]||re[1]))&&(f+=z^ee>=0?1:-1)}}return(d<-1e-6||d<1e-6&&Ie<-1e-6)^f&1}__name(polygonContains_default,`default`);function clip_default(e,n,s,c){return function(l){var d=n(l),f=buffer_default(),p=n(f),m=!1,h,g,_,v={point,lineStart,lineEnd,polygonStart:function(){v.point=pointRing,v.lineStart=ringStart,v.lineEnd=ringEnd,g=[],h=[]},polygonEnd:function(){v.point=point,v.lineStart=lineStart,v.lineEnd=lineEnd,g=(0,t.merge)(g);var e=polygonContains_default(h,c);g.length?(m||=(l.polygonStart(),!0),rejoin_default(g,compareIntersection,e,s,l)):e&&(m||=(l.polygonStart(),!0),l.lineStart(),s(null,null,1,l),l.lineEnd()),m&&=(l.polygonEnd(),!1),g=h=null},sphere:function(){l.polygonStart(),l.lineStart(),s(null,null,1,l),l.lineEnd(),l.polygonEnd()}};function point(t,n){e(t,n)&&l.point(t,n)}function pointLine(e,t){d.point(e,t)}function lineStart(){v.point=pointLine,d.lineStart()}function lineEnd(){v.point=point,d.lineEnd()}function pointRing(e,t){_.push([e,t]),p.point(e,t)}function ringStart(){p.lineStart(),_=[]}function ringEnd(){pointRing(_[0][0],_[0][1]),p.lineEnd();var e=p.clean(),t=f.result(),n,s=t.length,c,d,v;if(_.pop(),h.push(_),_=null,s){if(e&1){if(d=t[0],(c=d.length-1)>0){for(m||=(l.polygonStart(),!0),l.lineStart(),n=0;n<c;++n)l.point((v=d[n])[0],v[1]);l.lineEnd()}return}s>1&&e&2&&t.push(t.pop().concat(t.shift())),g.push(t.filter(validSegment))}}return v}}__name(clip_default,`default`);function validSegment(e){return e.length>1}function compareIntersection(e,t){return((e=e.x)[0]<0?e[1]-E-C:E-e[1])-((t=t.x)[0]<0?t[1]-E-C:E-t[1])}var Le=clip_default(function(){return!0},clipAntimeridianLine,clipAntimeridianInterpolate,[-T,-E]);function clipAntimeridianLine(e){var t=NaN,n=NaN,s=NaN,c;return{lineStart:function(){e.lineStart(),c=1},point:function(l,d){var f=l>0?T:-T,p=j(l-t);j(p-T)<1e-6?(e.point(t,n=(n+d)/2>0?E:-E),e.point(s,n),e.lineEnd(),e.lineStart(),e.point(f,n),e.point(l,n),c=0):s!==f&&p>=T&&(j(t-s)<1e-6&&(t-=s*C),j(l-f)<1e-6&&(l-=f*C),n=clipAntimeridianIntersect(t,n,l,d),e.point(s,n),e.lineEnd(),e.lineStart(),e.point(f,n),c=0),e.point(t=l,n=d),s=f},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-c}}}function clipAntimeridianIntersect(e,t,n,s){var c,l,d=R(e-n);return j(d)>1e-6?M((R(t)*(l=P(s))*R(n)-R(s)*(c=P(t))*R(e))/(c*l*d)):(t+s)/2}function clipAntimeridianInterpolate(e,t,n,s){var c;if(e==null)c=n*E,s.point(-T,c),s.point(0,c),s.point(T,c),s.point(T,0),s.point(T,-c),s.point(0,-c),s.point(-T,-c),s.point(-T,0),s.point(-T,c);else if(j(e[0]-t[0])>1e-6){var l=e[0]<t[0]?T:-T;c=n*l/2,s.point(-l,c),s.point(0,c),s.point(l,c)}else s.point(t[0],t[1])}function circle_default(e){var t=P(e),n=6*A,s=t>0,c=j(t)>C;function interpolate(t,s,c,l){circleStream(l,e,n,c,t,s)}function visible(e,n){return P(e)*P(n)>t}function clipLine(e){var t,n,l,d,f;return{lineStart:function(){d=l=!1,f=1},point:function(p,m){var h=[p,m],g,_=visible(p,m),v=s?_?0:code(p,m):_?code(p+(p<0?T:-T),m):0;if(!t&&(d=l=_)&&e.lineStart(),_!==l&&(g=intersect(t,h),(!g||pointEqual_default(t,g)||pointEqual_default(h,g))&&(h[2]=1)),_!==l)f=0,_?(e.lineStart(),g=intersect(h,t),e.point(g[0],g[1])):(g=intersect(t,h),e.point(g[0],g[1],2),e.lineEnd()),t=g;else if(c&&t&&s^_){var y;!(v&n)&&(y=intersect(h,t,!0))&&(f=0,s?(e.lineStart(),e.point(y[0][0],y[0][1]),e.point(y[1][0],y[1][1]),e.lineEnd()):(e.point(y[1][0],y[1][1]),e.lineEnd(),e.lineStart(),e.point(y[0][0],y[0][1],3)))}_&&(!t||!pointEqual_default(t,h))&&e.point(h[0],h[1]),t=h,l=_,n=v},lineEnd:function(){l&&e.lineEnd(),t=null},clean:function(){return f|(d&&l)<<1}}}function intersect(e,n,s){var c=cartesian(e),l=cartesian(n),d=[1,0,0],f=cartesianCross(c,l),p=cartesianDot(f,f),m=f[0],h=p-m*m;if(!h)return!s&&e;var g=t*p/h,_=-t*m/h,v=cartesianCross(d,f),y=cartesianScale(d,g);cartesianAddInPlace(y,cartesianScale(f,_));var b=v,x=cartesianDot(y,b),S=cartesianDot(b,b),E=x*x-S*(cartesianDot(y,y)-1);if(!(E<0)){var D=B(E),O=cartesianScale(b,(-x-D)/S);if(cartesianAddInPlace(O,y),O=spherical(O),!s)return O;var k=e[0],A=n[0],M=e[1],N=n[1],P;A<k&&(P=k,k=A,A=P);var I=A-k,ee=j(I-T)<C,te=ee||I<1e-6;if(!ee&&N<M&&(P=M,M=N,N=P),te?ee?M+N>0^O[1]<(j(O[0]-k)<1e-6?M:N):M<=O[1]&&O[1]<=N:I>T^(k<=O[0]&&O[0]<=A)){var ne=cartesianScale(b,(-x+D)/S);return cartesianAddInPlace(ne,y),[O,spherical(ne)]}}}function code(t,n){var c=s?e:T-e,l=0;return t<-c?l|=1:t>c&&(l|=2),n<-c?l|=4:n>c&&(l|=8),l}return clip_default(visible,clipLine,interpolate,s?[0,-e]:[-T,e-T])}__name(circle_default,`default`);function line_default(e,t,n,s,c,l){var d=e[0],f=e[1],p=t[0],m=t[1],h=0,g=1,_=p-d,v=m-f,y=n-d;if(!(!_&&y>0)){if(y/=_,_<0){if(y<h)return;y<g&&(g=y)}else if(_>0){if(y>g)return;y>h&&(h=y)}if(y=c-d,!(!_&&y<0)){if(y/=_,_<0){if(y>g)return;y>h&&(h=y)}else if(_>0){if(y<h)return;y<g&&(g=y)}if(y=s-f,!(!v&&y>0)){if(y/=v,v<0){if(y<h)return;y<g&&(g=y)}else if(v>0){if(y>g)return;y>h&&(h=y)}if(y=l-f,!(!v&&y<0)){if(y/=v,v<0){if(y>g)return;y>h&&(h=y)}else if(v>0){if(y<h)return;y<g&&(g=y)}return h>0&&(e[0]=d+h*_,e[1]=f+h*v),g<1&&(t[0]=d+g*_,t[1]=f+g*v),!0}}}}}__name(line_default,`default`);var Re=1e9,ze=-Re;function clipRectangle(e,n,s,c){function visible(t,l){return e<=t&&t<=s&&n<=l&&l<=c}function interpolate(t,l,d,f){var p=0,m=0;if(t==null||(p=corner(t,d))!==(m=corner(l,d))||comparePoint(t,l)<0^d>0)do f.point(p===0||p===3?e:s,p>1?c:n);while((p=(p+d+4)%4)!==m);else f.point(l[0],l[1])}function corner(t,c){return j(t[0]-e)<1e-6?c>0?0:3:j(t[0]-s)<1e-6?c>0?2:1:j(t[1]-n)<1e-6?+(c>0):c>0?3:2}function compareIntersection(e,t){return comparePoint(e.x,t.x)}function comparePoint(e,t){var n=corner(e,1),s=corner(t,1);return n===s?n===0?t[1]-e[1]:n===1?e[0]-t[0]:n===2?e[1]-t[1]:t[0]-e[0]:n-s}return function(l){var d=l,f=buffer_default(),p,m,h,g,_,v,y,b,x,S,C,T={point,lineStart,lineEnd,polygonStart,polygonEnd};function point(e,t){visible(e,t)&&d.point(e,t)}function polygonInside(){for(var t=0,n=0,s=m.length;n<s;++n)for(var l=m[n],d=1,f=l.length,p=l[0],h,g,_=p[0],v=p[1];d<f;++d)h=_,g=v,p=l[d],_=p[0],v=p[1],g<=c?v>c&&(_-h)*(c-g)>(v-g)*(e-h)&&++t:v<=c&&(_-h)*(c-g)<(v-g)*(e-h)&&--t;return t}function polygonStart(){d=f,p=[],m=[],C=!0}function polygonEnd(){var e=polygonInside(),n=C&&e,s=(p=(0,t.merge)(p)).length;(n||s)&&(l.polygonStart(),n&&(l.lineStart(),interpolate(null,null,1,l),l.lineEnd()),s&&rejoin_default(p,compareIntersection,e,interpolate,l),l.polygonEnd()),d=l,p=m=h=null}function lineStart(){T.point=linePoint,m&&m.push(h=[]),S=!0,x=!1,y=b=NaN}function lineEnd(){p&&(linePoint(g,_),v&&x&&f.rejoin(),p.push(f.result())),T.point=point,x&&d.lineEnd()}function linePoint(t,l){var f=visible(t,l);if(m&&h.push([t,l]),S)g=t,_=l,v=f,S=!1,f&&(d.lineStart(),d.point(t,l));else if(f&&x)d.point(t,l);else{var p=[y=Math.max(ze,Math.min(Re,y)),b=Math.max(ze,Math.min(Re,b))],T=[t=Math.max(ze,Math.min(Re,t)),l=Math.max(ze,Math.min(Re,l))];line_default(p,T,e,n,s,c)?(x||(d.lineStart(),d.point(p[0],p[1])),d.point(T[0],T[1]),f||d.lineEnd(),C=!1):f&&(d.lineStart(),d.point(t,l),C=!1)}y=t,b=l,x=f}return T}}function extent_default(){var e=0,t=0,n=960,s=500,c,l,d;return d={stream:function(d){return c&&l===d?c:c=clipRectangle(e,t,n,s)(l=d)},extent:function(f){return arguments.length?(e=+f[0][0],t=+f[0][1],n=+f[1][0],s=+f[1][1],c=l=null,d):[[e,t],[n,s]]}}}__name(extent_default,`default`);var J=adder_default(),Be,Ve,He,Ue={sphere:noop$1,point:noop$1,lineStart:lengthLineStart,lineEnd:noop$1,polygonStart:noop$1,polygonEnd:noop$1};function lengthLineStart(){Ue.point=lengthPointFirst$1,Ue.lineEnd=lengthLineEnd}function lengthLineEnd(){Ue.point=Ue.lineEnd=noop$1}function lengthPointFirst$1(e,t){e*=A,t*=A,Be=e,Ve=R(t),He=P(t),Ue.point=lengthPoint$1}__name(lengthPointFirst$1,`lengthPointFirst`);function lengthPoint$1(e,t){e*=A,t*=A;var n=R(t),s=P(t),c=j(e-Be),l=P(c),d=s*R(c),f=He*n-Ve*s*l,p=Ve*n+He*s*l;J.add(N(B(d*d+f*f),p)),Be=e,Ve=n,He=s}__name(length_default,`default`),__name(lengthPoint$1,`lengthPoint`);function length_default(e){return J.reset(),stream_default(e,Ue),+J}var We=[null,null],Ge={type:`LineString`,coordinates:We};function distance_default(e,t){return We[0]=e,We[1]=t,length_default(Ge)}__name(distance_default,`default`);var Ke={Feature:function(e,t){return containsGeometry(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,s=-1,c=n.length;++s<c;)if(containsGeometry(n[s].geometry,t))return!0;return!1}},qe={Sphere:function(){return!0},Point:function(e,t){return containsPoint(e.coordinates,t)},MultiPoint:function(e,t){for(var n=e.coordinates,s=-1,c=n.length;++s<c;)if(containsPoint(n[s],t))return!0;return!1},LineString:function(e,t){return containsLine(e.coordinates,t)},MultiLineString:function(e,t){for(var n=e.coordinates,s=-1,c=n.length;++s<c;)if(containsLine(n[s],t))return!0;return!1},Polygon:function(e,t){return containsPolygon(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,s=-1,c=n.length;++s<c;)if(containsPolygon(n[s],t))return!0;return!1},GeometryCollection:function(e,t){for(var n=e.geometries,s=-1,c=n.length;++s<c;)if(containsGeometry(n[s],t))return!0;return!1}};function containsGeometry(e,t){return e&&qe.hasOwnProperty(e.type)?qe[e.type](e,t):!1}function containsPoint(e,t){return distance_default(e,t)===0}function containsLine(e,t){for(var n,s,c,l=0,d=e.length;l<d;l++){if(s=distance_default(e[l],t),s===0||l>0&&(c=distance_default(e[l],e[l-1]),c>0&&n<=c&&s<=c&&(n+s-c)*(1-((n-s)/c)**2)<1e-12*c))return!0;n=s}return!1}function containsPolygon(e,t){return!!polygonContains_default(e.map(ringRadians),pointRadians(t))}function ringRadians(e){return e=e.map(pointRadians),e.pop(),e}function pointRadians(e){return[e[0]*A,e[1]*A]}function contains_default(e,t){return(e&&Ke.hasOwnProperty(e.type)?Ke[e.type]:containsGeometry)(e,t)}__name(contains_default,`default`);function graticuleX(e,n,s){var c=(0,t.range)(e,n-C,s).concat(n);return function(e){return c.map(function(t){return[e,t]})}}function graticuleY(e,n,s){var c=(0,t.range)(e,n-C,s).concat(n);return function(e){return c.map(function(t){return[t,e]})}}function graticule(){var e,n,s,c,l,d,f,p,m=10,h=m,g=90,_=360,v,y,b,x,S=2.5;function graticule(){return{type:`MultiLineString`,coordinates:lines()}}function lines(){return(0,t.range)(I(c/g)*g,s,g).map(b).concat((0,t.range)(I(p/_)*_,f,_).map(x)).concat((0,t.range)(I(n/m)*m,e,m).filter(function(e){return j(e%g)>C}).map(v)).concat((0,t.range)(I(d/h)*h,l,h).filter(function(e){return j(e%_)>C}).map(y))}return graticule.lines=function(){return lines().map(function(e){return{type:`LineString`,coordinates:e}})},graticule.outline=function(){return{type:`Polygon`,coordinates:[b(c).concat(x(f).slice(1),b(s).reverse().slice(1),x(p).reverse().slice(1))]}},graticule.extent=function(e){return arguments.length?graticule.extentMajor(e).extentMinor(e):graticule.extentMinor()},graticule.extentMajor=function(e){return arguments.length?(c=+e[0][0],s=+e[1][0],p=+e[0][1],f=+e[1][1],c>s&&(e=c,c=s,s=e),p>f&&(e=p,p=f,f=e),graticule.precision(S)):[[c,p],[s,f]]},graticule.extentMinor=function(t){return arguments.length?(n=+t[0][0],e=+t[1][0],d=+t[0][1],l=+t[1][1],n>e&&(t=n,n=e,e=t),d>l&&(t=d,d=l,l=t),graticule.precision(S)):[[n,d],[e,l]]},graticule.step=function(e){return arguments.length?graticule.stepMajor(e).stepMinor(e):graticule.stepMinor()},graticule.stepMajor=function(e){return arguments.length?(g=+e[0],_=+e[1],graticule):[g,_]},graticule.stepMinor=function(e){return arguments.length?(m=+e[0],h=+e[1],graticule):[m,h]},graticule.precision=function(t){return arguments.length?(S=+t,v=graticuleX(d,l,90),y=graticuleY(n,e,S),b=graticuleX(p,f,90),x=graticuleY(c,s,S),graticule):S},graticule.extentMajor([[-180,-90+C],[180,90-C]]).extentMinor([[-180,-80-C],[180,80+C]])}function graticule10(){return graticule()()}function interpolate_default(e,t){var n=e[0]*A,s=e[1]*A,c=t[0]*A,l=t[1]*A,d=P(s),f=R(s),p=P(l),m=R(l),h=d*P(n),g=d*R(n),_=p*P(c),v=p*R(c),y=2*asin(B(haversin(l-s)+d*p*haversin(c-n))),b=R(y),x=y?function(e){var t=R(e*=y)/b,n=R(y-e)/b,s=n*h+t*_,c=n*g+t*v,l=n*f+t*m;return[N(c,s)*k,N(l,B(s*s+c*c))*k]}:function(){return[n*k,s*k]};return x.distance=y,x}__name(interpolate_default,`default`);function identity_default$2(e){return e}__name(identity_default$2,`default`);var Je=adder_default(),Ye=adder_default(),Xe,Ze,Qe,$e,et={point:noop$1,lineStart:noop$1,lineEnd:noop$1,polygonStart:function(){et.lineStart=areaRingStart,et.lineEnd=areaRingEnd},polygonEnd:function(){et.lineStart=et.lineEnd=et.point=noop$1,Je.add(j(Ye)),Ye.reset()},result:function(){var e=Je/2;return Je.reset(),e}};function areaRingStart(){et.point=areaPointFirst}function areaPointFirst(e,t){et.point=areaPoint,Xe=Qe=e,Ze=$e=t}function areaPoint(e,t){Ye.add($e*e-Qe*t),Qe=e,$e=t}function areaRingEnd(){areaPoint(Xe,Ze)}var tt=1/0,nt=tt,rt=-tt,it=rt,at={point:boundsPoint$1,lineStart:noop$1,lineEnd:noop$1,polygonStart:noop$1,polygonEnd:noop$1,result:function(){var e=[[tt,nt],[rt,it]];return rt=it=-(nt=tt=1/0),e}};function boundsPoint$1(e,t){e<tt&&(tt=e),e>rt&&(rt=e),t<nt&&(nt=t),t>it&&(it=t)}__name(boundsPoint$1,`boundsPoint`);var ot=0,st=0,ct=0,lt=0,ut=0,dt=0,ft=0,pt=0,mt=0,ht,gt,_t,vt,yt={point:centroidPoint,lineStart:centroidLineStart,lineEnd:centroidLineEnd,polygonStart:function(){yt.lineStart=centroidRingStart,yt.lineEnd=centroidRingEnd},polygonEnd:function(){yt.point=centroidPoint,yt.lineStart=centroidLineStart,yt.lineEnd=centroidLineEnd},result:function(){var e=mt?[ft/mt,pt/mt]:dt?[lt/dt,ut/dt]:ct?[ot/ct,st/ct]:[NaN,NaN];return ot=st=ct=lt=ut=dt=ft=pt=mt=0,e}};function centroidPoint(e,t){ot+=e,st+=t,++ct}function centroidLineStart(){yt.point=centroidPointFirstLine}function centroidPointFirstLine(e,t){yt.point=centroidPointLine,centroidPoint(_t=e,vt=t)}function centroidPointLine(e,t){var n=e-_t,s=t-vt,c=B(n*n+s*s);lt+=c*(_t+e)/2,ut+=c*(vt+t)/2,dt+=c,centroidPoint(_t=e,vt=t)}function centroidLineEnd(){yt.point=centroidPoint}function centroidRingStart(){yt.point=centroidPointFirstRing}function centroidRingEnd(){centroidPointRing(ht,gt)}function centroidPointFirstRing(e,t){yt.point=centroidPointRing,centroidPoint(ht=_t=e,gt=vt=t)}function centroidPointRing(e,t){var n=e-_t,s=t-vt,c=B(n*n+s*s);lt+=c*(_t+e)/2,ut+=c*(vt+t)/2,dt+=c,c=vt*e-_t*t,ft+=c*(_t+e),pt+=c*(vt+t),mt+=c*3,centroidPoint(_t=e,vt=t)}function PathContext(e){this._context=e}PathContext.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:this._context.moveTo(e,t),this._point=1;break;case 1:this._context.lineTo(e,t);break;default:this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,O);break}},result:noop$1};var bt=adder_default(),xt,St,Ct,wt,Tt,Et={point:noop$1,lineStart:function(){Et.point=lengthPointFirst},lineEnd:function(){xt&&lengthPoint(St,Ct),Et.point=noop$1},polygonStart:function(){xt=!0},polygonEnd:function(){xt=null},result:function(){var e=+bt;return bt.reset(),e}};function lengthPointFirst(e,t){Et.point=lengthPoint,St=wt=e,Ct=Tt=t}function lengthPoint(e,t){wt-=e,Tt-=t,bt.add(B(wt*wt+Tt*Tt)),wt=e,Tt=t}function PathString(){this._string=[]}PathString.prototype={_radius:4.5,_circle:circle(4.5),pointRadius:function(e){return(e=+e)!==this._radius&&(this._radius=e,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._string.push(`Z`),this._point=NaN},point:function(e,t){switch(this._point){case 0:this._string.push(`M`,e,`,`,t),this._point=1;break;case 1:this._string.push(`L`,e,`,`,t);break;default:this._circle??=circle(this._radius),this._string.push(`M`,e,`,`,t,this._circle);break}},result:function(){if(this._string.length){var e=this._string.join(``);return this._string=[],e}else return null}};function circle(e){return`m0,`+e+`a`+e+`,`+e+` 0 1,1 0,`+-2*e+`a`+e+`,`+e+` 0 1,1 0,`+2*e+`z`}function path_default(e,t){var n=4.5,s,c;function path(e){return e&&(typeof n==`function`&&c.pointRadius(+n.apply(this,arguments)),stream_default(e,s(c))),c.result()}return path.area=function(e){return stream_default(e,s(et)),et.result()},path.measure=function(e){return stream_default(e,s(Et)),Et.result()},path.bounds=function(e){return stream_default(e,s(at)),at.result()},path.centroid=function(e){return stream_default(e,s(yt)),yt.result()},path.projection=function(t){return arguments.length?(s=t==null?(e=null,identity_default$2):(e=t).stream,path):e},path.context=function(e){return arguments.length?(c=e==null?(t=null,new PathString):new PathContext(t=e),typeof n!=`function`&&c.pointRadius(n),path):t},path.pointRadius=function(e){return arguments.length?(n=typeof e==`function`?e:(c.pointRadius(+e),+e),path):n},path.projection(e).context(t)}__name(path_default,`default`);function transform_default$1(e){return{stream:transformer(e)}}__name(transform_default$1,`default`);function transformer(e){return function(t){var n=new TransformStream;for(var s in e)n[s]=e[s];return n.stream=t,n}}function TransformStream(){}TransformStream.prototype={constructor:TransformStream,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function fit(e,t,n){var s=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),s!=null&&e.clipExtent(null),stream_default(n,e.stream(at)),t(at.result()),s!=null&&e.clipExtent(s),e}function fitExtent$1(e,t,n){return fit(e,function(n){var s=t[1][0]-t[0][0],c=t[1][1]-t[0][1],l=Math.min(s/(n[1][0]-n[0][0]),c/(n[1][1]-n[0][1])),d=+t[0][0]+(s-l*(n[1][0]+n[0][0]))/2,f=+t[0][1]+(c-l*(n[1][1]+n[0][1]))/2;e.scale(150*l).translate([d,f])},n)}__name(fitExtent$1,`fitExtent`);function fitSize$1(e,t,n){return fitExtent$1(e,[[0,0],t],n)}__name(fitSize$1,`fitSize`);function fitWidth(e,t,n){return fit(e,function(n){var s=+t,c=s/(n[1][0]-n[0][0]),l=(s-c*(n[1][0]+n[0][0]))/2,d=-c*n[0][1];e.scale(150*c).translate([l,d])},n)}function fitHeight(e,t,n){return fit(e,function(n){var s=+t,c=s/(n[1][1]-n[0][1]),l=-c*n[0][0],d=(s-c*(n[1][1]+n[0][1]))/2;e.scale(150*c).translate([l,d])},n)}var Dt=16,Ot=P(30*A);function resample_default(e,t){return+t?resample(e,t):resampleNone(e)}__name(resample_default,`default`);function resampleNone(e){return transformer({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function resample(e,t){function resampleLineTo(n,s,c,l,d,f,p,m,h,g,_,v,y,b){var x=p-n,S=m-s,C=x*x+S*S;if(C>4*t&&y--){var T=l+g,E=d+_,D=f+v,O=B(T*T+E*E+D*D),k=asin(D/=O),A=j(j(D)-1)<1e-6||j(c-h)<1e-6?(c+h)/2:N(E,T),M=e(A,k),P=M[0],I=M[1],ee=P-n,te=I-s,ne=S*ee-x*te;(ne*ne/C>t||j((x*ee+S*te)/C-.5)>.3||l*g+d*_+f*v<Ot)&&(resampleLineTo(n,s,c,l,d,f,P,I,A,T/=O,E/=O,D,y,b),b.point(P,I),resampleLineTo(P,I,A,T,E,D,p,m,h,g,_,v,y,b))}}return function(t){var n,s,c,l,d,f,p,m,h,g,_,v,y={point,lineStart,lineEnd,polygonStart:function(){t.polygonStart(),y.lineStart=ringStart},polygonEnd:function(){t.polygonEnd(),y.lineStart=lineStart}};function point(n,s){n=e(n,s),t.point(n[0],n[1])}function lineStart(){m=NaN,y.point=linePoint,t.lineStart()}function linePoint(n,s){var c=cartesian([n,s]),l=e(n,s);resampleLineTo(m,h,p,g,_,v,m=l[0],h=l[1],p=n,g=c[0],_=c[1],v=c[2],Dt,t),t.point(m,h)}function lineEnd(){y.point=point,t.lineEnd()}function ringStart(){lineStart(),y.point=ringPoint,y.lineEnd=ringEnd}function ringPoint(e,t){linePoint(n=e,t),s=m,c=h,l=g,d=_,f=v,y.point=linePoint}function ringEnd(){resampleLineTo(m,h,p,g,_,v,s,c,n,l,d,f,Dt,t),y.lineEnd=lineEnd,lineEnd()}return y}}var kt=transformer({point:function(e,t){this.stream.point(e*A,t*A)}});function transformRotate(e){return transformer({point:function(t,n){var s=e(t,n);return this.stream.point(s[0],s[1])}})}function scaleTranslate(e,t,n,s,c){function transform(l,d){return l*=s,d*=c,[t+e*l,n-e*d]}return transform.invert=function(l,d){return[(l-t)/e*s,(n-d)/e*c]},transform}function scaleTranslateRotate(e,t,n,s,c,l){var d=P(l),f=R(l),p=d*e,m=f*e,h=d/e,g=f/e,_=(f*n-d*t)/e,v=(f*t+d*n)/e;function transform(e,l){return e*=s,l*=c,[p*e-m*l+t,n-m*e-p*l]}return transform.invert=function(e,t){return[s*(h*e-g*t+_),c*(v-g*e-h*t)]},transform}function projection(e){return projectionMutator(function(){return e})()}function projectionMutator(e){var t,n=150,s=480,c=250,l=0,d=0,f=0,p=0,m=0,h,g=0,_=1,v=1,y=null,b=Le,x=null,S,C,T,E=identity_default$2,D=.5,O,j,M,N,P;function projection(e){return M(e[0]*A,e[1]*A)}function invert(e){return e=M.invert(e[0],e[1]),e&&[e[0]*k,e[1]*k]}projection.stream=function(e){return N&&P===e?N:N=kt(transformRotate(h)(b(O(E(P=e)))))},projection.preclip=function(e){return arguments.length?(b=e,y=void 0,reset()):b},projection.postclip=function(e){return arguments.length?(E=e,x=S=C=T=null,reset()):E},projection.clipAngle=function(e){return arguments.length?(b=+e?circle_default(y=e*A):(y=null,Le),reset()):y*k},projection.clipExtent=function(e){return arguments.length?(E=e==null?(x=S=C=T=null,identity_default$2):clipRectangle(x=+e[0][0],S=+e[0][1],C=+e[1][0],T=+e[1][1]),reset()):x==null?null:[[x,S],[C,T]]},projection.scale=function(e){return arguments.length?(n=+e,recenter()):n},projection.translate=function(e){return arguments.length?(s=+e[0],c=+e[1],recenter()):[s,c]},projection.center=function(e){return arguments.length?(l=e[0]%360*A,d=e[1]%360*A,recenter()):[l*k,d*k]},projection.rotate=function(e){return arguments.length?(f=e[0]%360*A,p=e[1]%360*A,m=e.length>2?e[2]%360*A:0,recenter()):[f*k,p*k,m*k]},projection.angle=function(e){return arguments.length?(g=e%360*A,recenter()):g*k},projection.reflectX=function(e){return arguments.length?(_=e?-1:1,recenter()):_<0},projection.reflectY=function(e){return arguments.length?(v=e?-1:1,recenter()):v<0},projection.precision=function(e){return arguments.length?(O=resample_default(j,D=e*e),reset()):B(D)},projection.fitExtent=function(e,t){return fitExtent$1(projection,e,t)},projection.fitSize=function(e,t){return fitSize$1(projection,e,t)},projection.fitWidth=function(e,t){return fitWidth(projection,e,t)},projection.fitHeight=function(e,t){return fitHeight(projection,e,t)};function recenter(){var e=scaleTranslateRotate(n,0,0,_,v,g).apply(null,t(l,d)),y=(g?scaleTranslateRotate:scaleTranslate)(n,s-e[0],c-e[1],_,v,g);return h=rotateRadians(f,p,m),j=compose_default(t,y),M=compose_default(h,j),O=resample_default(j,D),reset()}function reset(){return N=P=null,projection}return function(){return t=e.apply(this,arguments),projection.invert=t.invert&&invert,recenter()}}function conicProjection(e){var t=0,n=T/3,s=projectionMutator(e),c=s(t,n);return c.parallels=function(e){return arguments.length?s(t=e[0]*A,n=e[1]*A):[t*k,n*k]},c}function cylindricalEqualAreaRaw(e){var t=P(e);function forward(e,n){return[e*t,R(n)/t]}return forward.invert=function(e,n){return[e/t,asin(n*t)]},forward}function conicEqualAreaRaw(e,t){var n=R(e),s=(n+R(t))/2;if(j(s)<1e-6)return cylindricalEqualAreaRaw(e);var c=1+n*(2*s-n),l=B(c)/s;function project(e,t){var n=B(c-2*s*R(t))/s;return[n*R(e*=s),l-n*P(e)]}return project.invert=function(e,t){var n=l-t,d=N(e,j(n))*z(n);return n*s<0&&(d-=T*z(e)*z(n)),[d/s,asin((c-(e*e+n*n)*s*s)/(2*s))]},project}function conicEqualArea_default(){return conicProjection(conicEqualAreaRaw).scale(155.424).center([0,33.6442])}__name(conicEqualArea_default,`default`);function albers_default(){return conicEqualArea_default().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}__name(albers_default,`default`);function multiplex$1(e){var t=e.length;return{point:function(n,s){for(var c=-1;++c<t;)e[c].point(n,s)},sphere:function(){for(var n=-1;++n<t;)e[n].sphere()},lineStart:function(){for(var n=-1;++n<t;)e[n].lineStart()},lineEnd:function(){for(var n=-1;++n<t;)e[n].lineEnd()},polygonStart:function(){for(var n=-1;++n<t;)e[n].polygonStart()},polygonEnd:function(){for(var n=-1;++n<t;)e[n].polygonEnd()}}}__name(multiplex$1,`multiplex`),__name(albersUsa_default,`default`);function albersUsa_default(){var e,t,n=albers_default(),s,c=conicEqualArea_default().rotate([154,0]).center([-2,58.5]).parallels([55,65]),l,d=conicEqualArea_default().rotate([157,0]).center([-3,19.9]).parallels([8,18]),f,p,m={point:function(e,t){p=[e,t]}};function albersUsa(e){var t=e[0],n=e[1];return p=null,(s.point(t,n),p)||(l.point(t,n),p)||(f.point(t,n),p)}albersUsa.invert=function(e){var t=n.scale(),s=n.translate(),l=(e[0]-s[0])/t,f=(e[1]-s[1])/t;return(f>=.12&&f<.234&&l>=-.425&&l<-.214?c:f>=.166&&f<.234&&l>=-.214&&l<-.115?d:n).invert(e)},albersUsa.stream=function(s){return e&&t===s?e:e=multiplex$1([n.stream(t=s),c.stream(s),d.stream(s)])},albersUsa.precision=function(e){return arguments.length?(n.precision(e),c.precision(e),d.precision(e),reset()):n.precision()},albersUsa.scale=function(e){return arguments.length?(n.scale(e),c.scale(e*.35),d.scale(e),albersUsa.translate(n.translate())):n.scale()},albersUsa.translate=function(e){if(!arguments.length)return n.translate();var t=n.scale(),p=+e[0],h=+e[1];return s=n.translate(e).clipExtent([[p-.455*t,h-.238*t],[p+.455*t,h+.238*t]]).stream(m),l=c.translate([p-.307*t,h+.201*t]).clipExtent([[p-.425*t+C,h+.12*t+C],[p-.214*t-C,h+.234*t-C]]).stream(m),f=d.translate([p-.205*t,h+.212*t]).clipExtent([[p-.214*t+C,h+.166*t+C],[p-.115*t-C,h+.234*t-C]]).stream(m),reset()},albersUsa.fitExtent=function(e,t){return fitExtent$1(albersUsa,e,t)},albersUsa.fitSize=function(e,t){return fitSize$1(albersUsa,e,t)},albersUsa.fitWidth=function(e,t){return fitWidth(albersUsa,e,t)},albersUsa.fitHeight=function(e,t){return fitHeight(albersUsa,e,t)};function reset(){return e=t=null,albersUsa}return albersUsa.scale(1070)}function azimuthalRaw(e){return function(t,n){var s=P(t),c=P(n),l=e(s*c);return[l*c*R(t),l*R(n)]}}function azimuthalInvert(e){return function(t,n){var s=B(t*t+n*n),c=e(s),l=R(c),d=P(c);return[N(t*l,s*d),asin(s&&n*l/s)]}}var At=azimuthalRaw(function(e){return B(2/(1+e))});At.invert=azimuthalInvert(function(e){return 2*asin(e/2)});function azimuthalEqualArea_default(){return projection(At).scale(124.75).clipAngle(179.999)}__name(azimuthalEqualArea_default,`default`);var jt=azimuthalRaw(function(e){return(e=acos(e))&&e/R(e)});jt.invert=azimuthalInvert(function(e){return e});function azimuthalEquidistant_default(){return projection(jt).scale(79.4188).clipAngle(179.999)}__name(azimuthalEquidistant_default,`default`);function mercatorRaw(e,t){return[e,te(re((E+t)/2))]}mercatorRaw.invert=function(e,t){return[e,2*M(ee(t))-E]};function mercator_default(){return mercatorProjection(mercatorRaw).scale(961/O)}__name(mercator_default,`default`);function mercatorProjection(e){var t=projection(e),n=t.center,s=t.scale,c=t.translate,l=t.clipExtent,d=null,f,p,m;t.scale=function(e){return arguments.length?(s(e),reclip()):s()},t.translate=function(e){return arguments.length?(c(e),reclip()):c()},t.center=function(e){return arguments.length?(n(e),reclip()):n()},t.clipExtent=function(e){return arguments.length?(e==null?d=f=p=m=null:(d=+e[0][0],f=+e[0][1],p=+e[1][0],m=+e[1][1]),reclip()):d==null?null:[[d,f],[p,m]]};function reclip(){var n=T*s(),c=t(rotation_default(t.rotate()).invert([0,0]));return l(d==null?[[c[0]-n,c[1]-n],[c[0]+n,c[1]+n]]:e===mercatorRaw?[[Math.max(c[0]-n,d),f],[Math.min(c[0]+n,p),m]]:[[d,Math.max(c[1]-n,f)],[p,Math.min(c[1]+n,m)]])}return reclip()}function tany(e){return re((E+e)/2)}function conicConformalRaw(e,t){var n=P(e),s=e===t?R(e):te(n/P(t))/te(tany(t)/tany(e)),c=n*ne(tany(e),s)/s;if(!s)return mercatorRaw;function project(e,t){c>0?t<-E+1e-6&&(t=-E+C):t>E-1e-6&&(t=E-C);var n=c/ne(tany(t),s);return[n*R(s*e),c-n*P(s*e)]}return project.invert=function(e,t){var n=c-t,l=z(s)*B(e*e+n*n),d=N(e,j(n))*z(n);return n*s<0&&(d-=T*z(e)*z(n)),[d/s,2*M(ne(c/l,1/s))-E]},project}function conicConformal_default(){return conicProjection(conicConformalRaw).scale(109.5).parallels([30,30])}__name(conicConformal_default,`default`);function equirectangularRaw(e,t){return[e,t]}equirectangularRaw.invert=equirectangularRaw;function equirectangular_default(){return projection(equirectangularRaw).scale(152.63)}__name(equirectangular_default,`default`);function conicEquidistantRaw(e,t){var n=P(e),s=e===t?R(e):(n-P(t))/(t-e),c=n/s+e;if(j(s)<1e-6)return equirectangularRaw;function project(e,t){var n=c-t,l=s*e;return[n*R(l),c-n*P(l)]}return project.invert=function(e,t){var n=c-t,l=N(e,j(n))*z(n);return n*s<0&&(l-=T*z(e)*z(n)),[l/s,c-z(s)*B(e*e+n*n)]},project}function conicEquidistant_default(){return conicProjection(conicEquidistantRaw).scale(131.154).center([0,13.9389])}__name(conicEquidistant_default,`default`);var Mt=1.340264,Nt=-.081106,Pt=893e-6,Ft=.003796,It=B(3)/2,Lt=12;function equalEarthRaw(e,t){var n=asin(It*R(t)),s=n*n,c=s*s*s;return[e*P(n)/(It*(Mt+3*Nt*s+c*(7*Pt+9*Ft*s))),n*(Mt+Nt*s+c*(Pt+Ft*s))]}equalEarthRaw.invert=function(e,t){for(var n=t,s=n*n,c=s*s*s,l=0,d,f,p;l<Lt&&(f=n*(Mt+Nt*s+c*(Pt+Ft*s))-t,p=Mt+3*Nt*s+c*(7*Pt+9*Ft*s),n-=d=f/p,s=n*n,c=s*s*s,!(j(d)<1e-12));++l);return[It*e*(Mt+3*Nt*s+c*(7*Pt+9*Ft*s))/P(n),asin(R(n)/It)]};function equalEarth_default(){return projection(equalEarthRaw).scale(177.158)}__name(equalEarth_default,`default`);function gnomonicRaw(e,t){var n=P(t),s=P(e)*n;return[n*R(e)/s,R(t)/s]}gnomonicRaw.invert=azimuthalInvert(M);function gnomonic_default(){return projection(gnomonicRaw).scale(144.049).clipAngle(60)}__name(gnomonic_default,`default`);function identity_default$1(){var e=1,t=0,n=0,s=1,c=1,l=0,d,f,p=null,m,h,g,_=1,v=1,y=transformer({point:function(e,t){var n=projection([e,t]);this.stream.point(n[0],n[1])}}),b=identity_default$2,x,S;function reset(){return _=e*s,v=e*c,x=S=null,projection}function projection(e){var s=e[0]*_,c=e[1]*v;if(l){var p=c*d-s*f;s=s*d+c*f,c=p}return[s+t,c+n]}return projection.invert=function(e){var s=e[0]-t,c=e[1]-n;if(l){var p=c*d+s*f;s=s*d-c*f,c=p}return[s/_,c/v]},projection.stream=function(e){return x&&S===e?x:x=y(b(S=e))},projection.postclip=function(e){return arguments.length?(b=e,p=m=h=g=null,reset()):b},projection.clipExtent=function(e){return arguments.length?(b=e==null?(p=m=h=g=null,identity_default$2):clipRectangle(p=+e[0][0],m=+e[0][1],h=+e[1][0],g=+e[1][1]),reset()):p==null?null:[[p,m],[h,g]]},projection.scale=function(t){return arguments.length?(e=+t,reset()):e},projection.translate=function(e){return arguments.length?(t=+e[0],n=+e[1],reset()):[t,n]},projection.angle=function(e){return arguments.length?(l=e%360*A,f=R(l),d=P(l),reset()):l*k},projection.reflectX=function(e){return arguments.length?(s=e?-1:1,reset()):s<0},projection.reflectY=function(e){return arguments.length?(c=e?-1:1,reset()):c<0},projection.fitExtent=function(e,t){return fitExtent$1(projection,e,t)},projection.fitSize=function(e,t){return fitSize$1(projection,e,t)},projection.fitWidth=function(e,t){return fitWidth(projection,e,t)},projection.fitHeight=function(e,t){return fitHeight(projection,e,t)},projection}__name(identity_default$1,`default`);function naturalEarth1Raw(e,t){var n=t*t,s=n*n;return[e*(.8707-.131979*n+s*(-.013791+s*(.003971*n-.001529*s))),t*(1.007226+n*(.015085+s*(-.044475+.028874*n-.005916*s)))]}naturalEarth1Raw.invert=function(e,t){var n=t,s=25,c;do{var l=n*n,d=l*l;n-=c=(n*(1.007226+l*(.015085+d*(-.044475+.028874*l-.005916*d)))-t)/(1.007226+l*(.015085*3+d*(-.044475*7+.028874*9*l-.005916*11*d)))}while(j(c)>1e-6&&--s>0);return[e/(.8707+(l=n*n)*(-.131979+l*(-.013791+l*l*l*(.003971-.001529*l)))),n]};function naturalEarth1_default(){return projection(naturalEarth1Raw).scale(175.295)}__name(naturalEarth1_default,`default`);function orthographicRaw(e,t){return[P(t)*R(e),R(t)]}orthographicRaw.invert=azimuthalInvert(asin);function orthographic_default(){return projection(orthographicRaw).scale(249.5).clipAngle(90+C)}__name(orthographic_default,`default`);function stereographicRaw(e,t){var n=P(t),s=1+P(e)*n;return[n*R(e)/s,R(t)/s]}stereographicRaw.invert=azimuthalInvert(function(e){return 2*M(e)});function stereographic_default(){return projection(stereographicRaw).scale(250).clipAngle(142)}__name(stereographic_default,`default`);function transverseMercatorRaw(e,t){return[te(re((E+t)/2)),-e]}transverseMercatorRaw.invert=function(e,t){return[-t,2*M(ee(e))-E]};function transverseMercator_default(){var e=mercatorProjection(transverseMercatorRaw),t=e.center,n=e.rotate;return e.center=function(e){return arguments.length?t([-e[1],e[0]]):(e=t(),[e[1],-e[0]])},e.rotate=function(e){return arguments.length?n([e[0],e[1],e.length>2?e[2]+90:90]):(e=n(),[e[0],e[1],e[2]-90])},n([0,0,90]).scale(159.155)}__name(transverseMercator_default,`default`);var Rt=__exportAll({geoAlbers:()=>albers_default,geoAlbersUsa:()=>albersUsa_default,geoArea:()=>area_default,geoAzimuthalEqualArea:()=>azimuthalEqualArea_default,geoAzimuthalEqualAreaRaw:()=>At,geoAzimuthalEquidistant:()=>azimuthalEquidistant_default,geoAzimuthalEquidistantRaw:()=>jt,geoBounds:()=>bounds_default,geoCentroid:()=>centroid_default,geoCircle:()=>circle_default$1,geoClipAntimeridian:()=>Le,geoClipCircle:()=>circle_default,geoClipExtent:()=>extent_default,geoClipRectangle:()=>clipRectangle,geoConicConformal:()=>conicConformal_default,geoConicConformalRaw:()=>conicConformalRaw,geoConicEqualArea:()=>conicEqualArea_default,geoConicEqualAreaRaw:()=>conicEqualAreaRaw,geoConicEquidistant:()=>conicEquidistant_default,geoConicEquidistantRaw:()=>conicEquidistantRaw,geoContains:()=>contains_default,geoDistance:()=>distance_default,geoEqualEarth:()=>equalEarth_default,geoEqualEarthRaw:()=>equalEarthRaw,geoEquirectangular:()=>equirectangular_default,geoEquirectangularRaw:()=>equirectangularRaw,geoGnomonic:()=>gnomonic_default,geoGnomonicRaw:()=>gnomonicRaw,geoGraticule:()=>graticule,geoGraticule10:()=>graticule10,geoIdentity:()=>identity_default$1,geoInterpolate:()=>interpolate_default,geoLength:()=>length_default,geoMercator:()=>mercator_default,geoMercatorRaw:()=>mercatorRaw,geoNaturalEarth1:()=>naturalEarth1_default,geoNaturalEarth1Raw:()=>naturalEarth1Raw,geoOrthographic:()=>orthographic_default,geoOrthographicRaw:()=>orthographicRaw,geoPath:()=>path_default,geoProjection:()=>projection,geoProjectionMutator:()=>projectionMutator,geoRotation:()=>rotation_default,geoStereographic:()=>stereographic_default,geoStereographicRaw:()=>stereographicRaw,geoStream:()=>stream_default,geoTransform:()=>transform_default$1,geoTransverseMercator:()=>transverseMercator_default,geoTransverseMercatorRaw:()=>transverseMercatorRaw});function noop(){}var zt=1/0,Bt=zt,Vt=-zt,Ht=Vt;function boundsPoint(e,t){e<zt&&(zt=e),e>Vt&&(Vt=e),t<Bt&&(Bt=t),t>Ht&&(Ht=t)}var Ut={point:boundsPoint,lineStart:noop,lineEnd:noop,polygonStart:noop,polygonEnd:noop,result(){let e=[[zt,Bt],[Vt,Ht]];return Vt=Ht=-(Bt=zt=1/0),e}};function fitExtent(e,t,n){let s=t[1][0]-t[0][0],c=t[1][1]-t[0][1],l=e.clipExtent&&e.clipExtent();e.scale(150).translate([0,0]),l!=null&&e.clipExtent(null),stream_default(n,e.stream(Ut));let d=Ut.result(),f=Math.min(s/(d[1][0]-d[0][0]),c/(d[1][1]-d[0][1])),p=+t[0][0]+(s-f*(d[1][0]+d[0][0]))/2,m=+t[0][1]+(c-f*(d[1][1]+d[0][1]))/2;return l!=null&&e.clipExtent(l),e.scale(f*150).translate([p,m])}function fitSize(e,t,n){return fitExtent(e,[[0,0],t],n)}var Wt=class Geohash{static base32=`0123456789bcdefghjkmnpqrstuvwxyz`;encode(e,t,n){if(n===void 0){for(let n=1;n<=12;n++){let s=this.encode(e,t,n),c=this.decode(s);if(c.lat===e&&c.lon===t)return s}n=12}if(e=Number(e),t=Number(t),n=Number(n),isNaN(e)||isNaN(t)||isNaN(n))throw Error(`Invalid geohash`);let s=0,c=0,l=!0,d=``,f=-90,p=90,m=-180,h=180;for(;d.length<n;){if(l){let e=(m+h)/2;t>e?(s=s*2+1,m=e):(s*=2,h=e)}else{let t=(f+p)/2;e>t?(s=s*2+1,f=t):(s*=2,p=t)}l=!l,++c===5&&(d+=Geohash.base32.charAt(s),c=0,s=0)}return d}decode(e){let t=this.bounds(e),n=t.sw.lat,s=t.sw.lon,c=t.ne.lat,l=t.ne.lon,d=(n+c)/2,f=(s+l)/2;return d=Number(d.toFixed(Math.floor(2-Math.log(c-n)/Math.LN10))),f=Number(f.toFixed(Math.floor(2-Math.log(l-s)/Math.LN10))),{lat:d,lon:f}}bounds(e){if(e.length===0)throw Error(`Invalid geohash`);e=e.toLowerCase();let t=!0,n=-90,s=90,c=-180,l=180;for(let d=0;d<e.length;d++){let f=e.charAt(d),p=Geohash.base32.indexOf(f);if(p===-1)throw Error(`Invalid geohash`);for(let e=4;e>=0;e--){let d=p>>e&1;if(t){let e=(c+l)/2;d===1?c=e:l=e}else{let e=(n+s)/2;d===1?n=e:s=e}t=!t}}return{sw:{lat:n,lon:c},ne:{lat:s,lon:l}}}adjacent(e,t){if(e=e.toLowerCase(),t=t.toLowerCase(),e.length===0)throw Error(`Invalid geohash`);if(`nsew`.indexOf(t)===-1)throw Error(`Invalid direction`);let n={n:[`p0r21436x8zb9dcf5h7kjnmqesgutwvy`,`bc01fg45238967deuvhjyznpkmstqrwx`],s:[`14365h7k9dcfesgujnmqp0r2twvyx8zb`,`238967debc01fg45kmstqrwxuvhjyznp`],e:[`bc01fg45238967deuvhjyznpkmstqrwx`,`p0r21436x8zb9dcf5h7kjnmqesgutwvy`],w:[`238967debc01fg45kmstqrwxuvhjyznp`,`14365h7k9dcfesgujnmqp0r2twvyx8zb`]},s={n:[`prxz`,`bcfguvyz`],s:[`028b`,`0145hjnp`],e:[`bcfguvyz`,`prxz`],w:[`0145hjnp`,`028b`]},c=e.slice(-1),l=e.slice(0,-1),d=e.length%2;return s[t][d].indexOf(c)!==-1&&l!==``&&(l=this.adjacent(l,t)),l+Geohash.base32.charAt(n[t][d].indexOf(c))}neighbours(e){return{n:this.adjacent(e,`n`),ne:this.adjacent(this.adjacent(e,`n`),`e`),e:this.adjacent(e,`e`),se:this.adjacent(this.adjacent(e,`s`),`e`),s:this.adjacent(e,`s`),sw:this.adjacent(this.adjacent(e,`s`),`w`),w:this.adjacent(e,`w`),nw:this.adjacent(this.adjacent(e,`n`),`w`)}}contained(e,t,n,s,c){(isNaN(t)||t>=90)&&(t=89),(isNaN(n)||n>180)&&(n=180),(isNaN(s)||s<=-90)&&(s=-89),(isNaN(e)||e<-180)&&(e=-180),c||=1;let l=this.encode(t,e,c),d=this.encode(t,n,c),f=this.encode(s,n,c),p=l,m=0,h=-1,g=[l,f],_=this.adjacent(l,`e`);for(;_!==f;)g.push(_),++m,_===d||h===m?(h=m+1,m=0,_=this.adjacent(p,`s`),p=_):_=this.adjacent(_,`e`);return g}calculateWidthDegrees(e){let t;return t=e%2==0?-1:-.5,180/2**(2.5*e+t)}width(e){let t=e%2;return 180/(2^(5*e+t)/2-1)}};function multiplex(e){let t=e.length;return{point(n,s){let c=-1;for(;++c<t;)e[c].point(n,s)},sphere(){let n=-1;for(;++n<t;)e[n].sphere()},lineStart(){let n=-1;for(;++n<t;)e[n].lineStart()},lineEnd(){let n=-1;for(;++n<t;)e[n].lineEnd()},polygonStart(){let n=-1;for(;++n<t;)e[n].polygonStart()},polygonEnd(){let n=-1;for(;++n<t;)e[n].polygonEnd()}}}function albersUsaPr(){let e,t,n=1e-6,s=albers_default(),c,l=conicEqualArea_default().rotate([154,0]).center([-2,58.5]).parallels([55,65]),d,f=conicEqualArea_default().rotate([157,0]).center([-3,19.9]).parallels([8,18]),p,m=conicEqualArea_default().rotate([66,0]).center([0,18]).parallels([8,18]),h,g,_={point:(e,t)=>{g=[e,t]}},albersUsa=function(e){let t=e[0],n=e[1];return g=null,(c.point(t,n),g)||(d.point(t,n),g)||(p.point(t,n),g)||h.point(t,n),g};albersUsa.invert=function(e){let t=s.scale(),n=s.translate(),c=(e[0]-n[0])/t,d=(e[1]-n[1])/t;return(d>=.12&&d<.234&&c>=-.425&&c<-.214?l:d>=.166&&d<.234&&c>=-.214&&c<-.115?f:d>=.204&&d<.234&&c>=.32&&c<.38?m:s).invert(e)},albersUsa.stream=function(n){return e&&t===n?e:e=multiplex([s.stream(t=n),l.stream(n),f.stream(n),m.stream(n)])},albersUsa.precision=function(e){return arguments.length?(s.precision(e),l.precision(e),f.precision(e),m.precision(e),reset()):s.precision()},albersUsa.scale=function(e){return arguments.length?(s.scale(e),l.scale(e*.35),f.scale(e),m.scale(e),albersUsa.translate(s.translate())):s.scale()},albersUsa.translate=function(e){if(!arguments.length)return s.translate();let t=s.scale(),g=+e[0],v=+e[1];return c=s.translate(e).clipExtent([[g-.455*t,v-.238*t],[g+.455*t,v+.238*t]]).stream(_),d=l.translate([g-.307*t,v+.201*t]).clipExtent([[g-.425*t+n,v+.12*t+n],[g-.214*t-n,v+.234*t-n]]).stream(_),p=f.translate([g-.205*t,v+.212*t]).clipExtent([[g-.214*t+n,v+.166*t+n],[g-.115*t-n,v+.234*t-n]]).stream(_),h=m.translate([g+.35*t,v+.224*t]).clipExtent([[g+.32*t,v+.204*t],[g+.38*t,v+.234*t]]).stream(_),reset()},albersUsa.fitExtent=function(e,t){return fitExtent(albersUsa,e,t)},albersUsa.fitSize=function(e,t){return fitSize(albersUsa,e,t)};function reset(){return e=t=null,albersUsa}return albersUsa.scale(1070)}var Gt=function(e){return e[e.AzimuthalEqualArea=0]=`AzimuthalEqualArea`,e[e.AzimuthalEquidistant=1]=`AzimuthalEquidistant`,e[e.Gnomonic=2]=`Gnomonic`,e[e.Orthographic=3]=`Orthographic`,e[e.Stereographic=4]=`Stereographic`,e[e.AlbersUsa=5]=`AlbersUsa`,e[e.AlbersUsaPr=6]=`AlbersUsaPr`,e[e.Albers=7]=`Albers`,e[e.ConicConformal=8]=`ConicConformal`,e[e.ConicEqualArea=9]=`ConicEqualArea`,e[e.ConicEquidistant=10]=`ConicEquidistant`,e[e.Equirectangular=11]=`Equirectangular`,e[e.Mercator=12]=`Mercator`,e[e.TransverseMercator=13]=`TransverseMercator`,e}(Gt||{}),Kt=[],qt={};for(let e in Gt)typeof e==`string`&&(Kt.push(e),e===`AlbersUsaPr`?qt[e]=albersUsaPr:qt[e]=Rt[`geo${e}`]);function resolve(e){let t=qt[e];return t?t():(console.warn(`Unknown projection: `+e),mercator_default())}var Jt=4096/2/Math.PI,Layered=class extends t.SVGZoomWidget{_autoScaleOnNextRender;_layersTarget;_prevAutoScaleMode;_d3GeoProjection;constructor(){super(),this._drawStartPos=`origin`,this.projection(`Mercator`)}data(e){let t=super.data.apply(this,arguments);return arguments.length&&(this._autoScaleOnNextRender=!0),t}enter(e,t){super.enter(e,t),this._layersTarget=this._renderElement.append(`g`).attr(`class`,`layersTarget`)}update(e,n){super.update(e,n);let s=this._layersTarget.selectAll(`.layerContainer`).data(this.layers().filter(function(e){return e.visible()}),function(e){return e.id()}),c=this;s.enter().append(`g`).attr(`id`,function(e){return e.id()}).attr(`class`,`layerContainer`).each(function(e){e._svgElement=(0,t.select)(this),e._domElement=c._parentOverlay.append(`div`),e.layerEnter(c,e._svgElement,e._domElement)}).merge(s).each(function(e){e.layerUpdate(c)}),s.exit().each(function(e){e.layerExit(c),e._domElement.remove()}).remove(),s.order(),this.onZoomed()}exit(e,t){super.exit(e,t)}onZoomed(){super.onZoomed();let e=this._layersTarget.selectAll(`.layerContainer`),t=this;e.each(function(e){e.layerZoomed(t)})}preRender(e){return Promise.all(this.layers().filter(function(e){return e.visible()}).map(function(e){return e.layerPreRender()}))}render(e){let n=this;return this.preRender().then(function(){t.SVGZoomWidget.prototype.render.call(n,function(t){n._layersTarget&&(n._renderCount&&n._autoScaleOnNextRender||n._prevAutoScaleMode!==n.autoScaleMode())?(n._prevAutoScaleMode=n.autoScaleMode(),n._autoScaleOnNextRender=!1,n.autoScale(),e&&e(t)):e&&e(t)})}),this}project(e,t){return e>=90?e=89:e<=-90&&(e=-89),this._d3GeoProjection([t,e])}invert(e,t){return this._d3GeoProjection.invert([e,t])}getBounds(){let e=this._layersTarget.node().getBBox();return{x:e.x,y:e.y,width:e.width,height:e.height}}autoScale(){switch(this.autoScaleMode()){case`none`:return;case`all`:this.zoomToBBox(this.getBounds());break}}};Layered.prototype._class+=` map_Layered`,Layered.prototype.publish(`projection`,null,`set`,`Map projection type`,Kt),Layered.prototype.publish(`centerLat`,0,`number`,`Center Latitude`,null,{tags:[`Basic`]}),Layered.prototype.publish(`centerLong`,0,`number`,`Center Longitude`,null,{tags:[`Basic`]}),Layered.prototype.publish(`zoom`,1,`number`,`Zoom Level`,null,{tags:[`Basic`]}),Layered.prototype.publish(`autoScaleMode`,`all`,`set`,`Auto Scale`,[`none`,`all`],{tags:[`Basic`]}),Layered.prototype.publish(`layers`,[],`widgetArray`,`Layers`,null,{render:!1});var Yt=Layered.prototype.projection;Layered.prototype.projection=function(e){let t=Yt.apply(this,arguments);if(arguments.length){switch(this._d3GeoProjection=resolve(e).scale(Jt).translate([0,0]),e){case`orthographic`:this._d3GeoProjection.clipAngle(90).rotate([0,0])}this._d3GeoPath=path_default().projection(this._d3GeoProjection),this._autoScaleOnNextRender=!0}return t};var Layer=class extends Layered{_svgElement;_domElement;_topoJsonPromise;constructor(){super(),n.ITooltip.call(this)}svgGlowID(){return``}layerEnter(e,t,n){this._parentOverlay=e._parentOverlay}enter(e,t){super.enter(e,t),this._svgElement=this._layersTarget.append(`g`),this._domElement=this._parentOverlay.append(`div`),this.layerEnter(this,this._svgElement,this._domElement)}layerUpdate(e,t){}update(e,t){super.update(e,t),this.layerUpdate(this)}onZoomed(){super.onZoomed(),this.layerUpdate(this)}layerExit(e){}exit(e,t){this.layerExit(this),this._svgElement.remove(),this._domElement.remove(),super.exit(e,t)}layerPreRender(){return Promise.resolve()}render(e){let t=this,n=arguments;return this.layerPreRender().then(function(){Layered.prototype.render.apply(t,n)}),this}layerZoomed(e){}};Layer.prototype._class+=` map_Layer`,Layer.prototype.implements(n.ITooltip.prototype);var CanvasPinLayer=class extends Layer{_pinsTransform;pins;_prevProjection;constructor(){super(),this.pins=new CanvasPins}layerEnter(e,t,n){Layer.prototype.layerEnter.apply(this,arguments),this._parentOverlay.style(`pointer-events`,`none`),this._pinsTransform=n.style(`pointer-events`,`none`).append(`div`).attr(`class`,this.classID()).style(`width`,e.width()+`px`).style(`height`,e.height()+`px`),this.pins.target(this._pinsTransform.node())}layerUpdate(e){Layer.prototype.layerUpdate.apply(this,arguments),this._pinsTransform.style(`opacity`,this.opacity()).style(`width`,e.width()+`px`).style(`height`,e.height()+`px`),this.pins.resize(e.size()),this.layerZoomed(e)}layerExit(e){delete this._prevProjection,this.pins.target(null),delete this.pins}layerZoomed(e){Layer.prototype.layerZoomed.apply(this,arguments);let t=this._db.fieldByLabel(this.latColumn()),n=this._db.fieldByLabel(this.longColumn()),s=this._db.fieldByLabel(this.weightColumn());this.pins.columns(this.columns()).data(this.visible()?this.data().map(function(c){let l=t?c[t.idx]:c[0],d=n?c[n.idx]:c[1],f=s?c[s.idx]:1,p=e.zoomTranslate(),m=e.project(l,d),h=e.zoomScale();return m[0]*=h,m[1]*=h,[p[0]+m[0],p[1]+m[1],f]}):[]).render()}};CanvasPinLayer.prototype._class+=` map_CanvasPinLayer`,CanvasPinLayer.prototype.publishProxy(`clusterMode`,`pins`,`clusterMode`),CanvasPinLayer.prototype.publishProxy(`allCircles`,`pins`,`allCircles`),CanvasPinLayer.prototype.publishProxy(`showQuadtree`,`pins`,`showQuadtree`),CanvasPinLayer.prototype.publishProxy(`useAveragePos`,`pins`,`useAveragePos`),CanvasPinLayer.prototype.publishProxy(`shrinkFontToPin`,`pins`,`shrinkFontToPin`),CanvasPinLayer.prototype.publishProxy(`enableClustering`,`pins`,`enableClustering`),CanvasPinLayer.prototype.publishProxy(`useWeightedRadius`,`pins`,`useWeightedRadius`),CanvasPinLayer.prototype.publishProxy(`radiusWeightMult`,`pins`,`radiusWeightMult`),CanvasPinLayer.prototype.publishProxy(`searchRectMult`,`pins`,`searchRectMult`),CanvasPinLayer.prototype.publishProxy(`pinHeight`,`pins`,`pinHeight`),CanvasPinLayer.prototype.publishProxy(`pinWidth`,`pins`,`pinWidth`),CanvasPinLayer.prototype.publishProxy(`pinFontFamily`,`pins`,`pinFontFamily`),CanvasPinLayer.prototype.publishProxy(`pinFontSize`,`pins`,`pinFontSize`),CanvasPinLayer.prototype.publishProxy(`arrowHeight`,`pins`,`arrowHeight`),CanvasPinLayer.prototype.publishProxy(`arrowWidth`,`pins`,`arrowWidth`),CanvasPinLayer.prototype.publish(`latColumn`,null,`set`,`latColumn`,function(){return this.columns()},{optional:!0}),CanvasPinLayer.prototype.publish(`longColumn`,null,`set`,`longColumn`,function(){return this.columns()},{optional:!0}),CanvasPinLayer.prototype.publish(`weightColumn`,null,`set`,`weightColumn`,function(){return this.columns()},{optional:!0}),CanvasPinLayer.prototype.publish(`opacity`,1,`number`,`Opacity`,null,{tags:[`Advanced`]});function identity_default(e){return e}__name(identity_default,`default`);function transform_default(e){if(e==null)return identity_default;var t,n,s=e.scale[0],c=e.scale[1],l=e.translate[0],d=e.translate[1];return function(e,f){f||(t=n=0);var p=2,m=e.length,h=Array(m);for(h[0]=(t+=e[0])*s+l,h[1]=(n+=e[1])*c+d;p<m;)h[p]=e[p],++p;return h}}__name(transform_default,`default`);function reverse_default(e,t){for(var n,s=e.length,c=s-t;c<--s;)n=e[c],e[c++]=e[s],e[s]=n}__name(reverse_default,`default`);function feature_default(e,t){return typeof t==`string`&&(t=e.objects[t]),t.type===`GeometryCollection`?{type:`FeatureCollection`,features:t.geometries.map(function(t){return feature(e,t)})}:feature(e,t)}__name(feature_default,`default`);function feature(e,t){var n=t.id,s=t.bbox,c=t.properties==null?{}:t.properties,l=object(e,t);return n==null&&s==null?{type:`Feature`,properties:c,geometry:l}:s==null?{type:`Feature`,id:n,properties:c,geometry:l}:{type:`Feature`,id:n,bbox:s,properties:c,geometry:l}}function object(e,t){var n=transform_default(e.transform),s=e.arcs;function arc(e,t){t.length&&t.pop();for(var c=s[e<0?~e:e],l=0,d=c.length;l<d;++l)t.push(n(c[l],l));e<0&&reverse_default(t,d)}function point(e){return n(e)}function line(e){for(var t=[],n=0,s=e.length;n<s;++n)arc(e[n],t);return t.length<2&&t.push(t[0]),t}function ring(e){for(var t=line(e);t.length<4;)t.push(t[0]);return t}function polygon(e){return e.map(ring)}function geometry(e){var t=e.type,n;switch(t){case`GeometryCollection`:return{type:t,geometries:e.geometries.map(geometry)};case`Point`:n=point(e.coordinates);break;case`MultiPoint`:n=e.coordinates.map(point);break;case`LineString`:n=line(e.arcs);break;case`MultiLineString`:n=e.arcs.map(line);break;case`Polygon`:n=polygon(e.arcs);break;case`MultiPolygon`:n=e.arcs.map(polygon);break;default:return null}return{type:t,coordinates:n}}return geometry(t)}function stitch_default(e,t){var n={},s={},c={},l=[],d=-1;t.forEach(function(n,s){var c=e.arcs[n<0?~n:n],l;c.length<3&&!c[1][0]&&!c[1][1]&&(l=t[++d],t[d]=n,t[s]=l)}),t.forEach(function(e){var t=ends(e),n=t[0],l=t[1],d,f;if(d=c[n])if(delete c[d.end],d.push(e),d.end=l,f=s[l]){delete s[f.start];var p=f===d?d:d.concat(f);s[p.start=d.start]=c[p.end=f.end]=p}else s[d.start]=c[d.end]=d;else if(d=s[l])if(delete s[d.start],d.unshift(e),d.start=n,f=c[n]){delete c[f.end];var m=f===d?d:f.concat(d);s[m.start=f.start]=c[m.end=d.end]=m}else s[d.start]=c[d.end]=d;else d=[e],s[d.start=n]=c[d.end=l]=d});function ends(t){var n=e.arcs[t<0?~t:t],s=n[0],c;return e.transform?(c=[0,0],n.forEach(function(e){c[0]+=e[0],c[1]+=e[1]})):c=n[n.length-1],t<0?[c,s]:[s,c]}function flush(e,t){for(var s in e){var c=e[s];delete t[c.start],delete c.start,delete c.end,c.forEach(function(e){n[e<0?~e:e]=1}),l.push(c)}}return flush(c,s),flush(s,c),t.forEach(function(e){n[e<0?~e:e]||l.push([e])}),l}__name(stitch_default,`default`);function mesh_default(e){return object(e,meshArcs.apply(this,arguments))}__name(mesh_default,`default`);function meshArcs(e,t,n){var s,c,l;if(arguments.length>1)s=extractArcs(e,t,n);else for(c=0,s=Array(l=e.arcs.length);c<l;++c)s[c]=c;return{type:`MultiLineString`,arcs:stitch_default(e,s)}}function extractArcs(e,t,n){var s=[],c=[],l;function extract0(e){var t=e<0?~e:e;(c[t]||(c[t]=[])).push({i:e,g:l})}function extract1(e){e.forEach(extract0)}function extract2(e){e.forEach(extract1)}function extract3(e){e.forEach(extract2)}function geometry(e){switch(l=e,e.type){case`GeometryCollection`:e.geometries.forEach(geometry);break;case`LineString`:extract1(e.arcs);break;case`MultiLineString`:case`Polygon`:extract2(e.arcs);break;case`MultiPolygon`:extract3(e.arcs);break}}return geometry(t),c.forEach(n==null?function(e){s.push(e[0].i)}:function(e){n(e[0].g,e[e.length-1].g)&&s.push(e[0].i)}),s}var Xt=window.__hpcc_topoJsonFolder||`./node_modules/@hpcc-js/map/TopoJSON`;function topoJsonFolder(e){if(!arguments.length)return Xt;let t=Xt;return Xt=e,t}var Choropleth=class extends Layer{_dataMap={};_path=(0,t.select)(null);_dataMinWeight;_dataMaxWeight;_choroplethData;_choroplethTransform;_choropleth;_choroTopology;_choroTopologyObjects;_prevProjection;_prevInternalOnly;constructor(){super(),t.Utility.SimpleSelectionMixin.call(this)}data(e){let t=Layer.prototype.data.apply(this,arguments);if(arguments.length){this._dataMap={},this._dataMinWeight=null,this._dataMaxWeight=null;let e=this;this.data().forEach(function(t){e._dataMap[t[0]]=t,(!e._dataMinWeight||t[1]<e._dataMinWeight)&&(e._dataMinWeight=t[1]),(!e._dataMaxWeight||t[1]>e._dataMaxWeight)&&(e._dataMaxWeight=t[1])})}return t}getDataBounds(){let e=this._choroplethData.node().getBBox();return{x:e.x,y:e.y,width:e.width,height:e.height}}autoScale(){switch(this.autoScaleMode()){case`none`:return;case`mesh`:this.zoomToBBox(this.getBounds());break;case`data`:this.zoomToBBox(this.getDataBounds());break}}layerEnter(e,t,n){Layer.prototype.layerEnter.apply(this,arguments),this._choroplethTransform=t,this._choroplethData=this._choroplethTransform.append(`g`).attr(`class`,`data`),this._choropleth=this._choroplethTransform.append(`path`).attr(`class`,`mesh`)}layerUpdate(e,t){if(Layer.prototype.layerUpdate.apply(this,arguments),this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+`_`+this.id())),this._choroplethTransform.style(`stroke`,this.meshColor()).style(`opacity`,this.opacity()),!this.visible()||!this.meshVisible()){this._choropleth.attr(`d`,``),delete this._prevProjection;return}(t||this._prevProjection!==e.projection()||this._prevInternalOnly!==this.internalOnly())&&(this._choropleth.attr(`d`,e._d3GeoPath(mesh_default(this._choroTopology,this._choroTopologyObjects,this.internalOnly()?function(e,t){return e!==t}:function(e,t){return!0}))),this._prevProjection=e.projection(),this._prevInternalOnly=this.internalOnly()),this._choropleth.style(`stroke-width`,this.meshStrokeWidth()).style(`stroke`,this.meshColor())}layerExit(e){delete this._prevProjection,delete this._prevInternalOnly}layerZoomed(e){super.layerZoomed.apply(this,arguments),this._choroplethData.style(`stroke-width`,this.meshVisible()?`0px`:`${.5/e.zoomScale()}px`)}click(e,t,n){}dblclick(e,t,n){}};Choropleth.prototype._class+=` map_Choropleth`,Choropleth.prototype.mixin(t.Utility.SimpleSelectionMixin),Choropleth.prototype._palette=t.Palette.rainbow(`default`),Choropleth.prototype.publish(`paletteID`,`YlOrRd`,`set`,`Color palette for this widget`,Choropleth.prototype._palette.switch(),{tags:[`Basic`,`Shared`]}),Choropleth.prototype.publish(`useClonedPalette`,!1,`boolean`,`Enable or disable using a cloned palette`,null,{tags:[`Intermediate`,`Shared`]}),Choropleth.prototype.publish(`opacity`,1,`number`,`Opacity`,null,{tags:[`Advanced`]}),Choropleth.prototype.publish(`meshVisible`,!0,`boolean`,`Mesh Visibility`),Choropleth.prototype.publish(`meshColor`,null,`html-color`,`Stroke Color`,null,{optional:!0}),Choropleth.prototype.publish(`meshStrokeWidth`,.25,`number`,`Stroke Width`),Choropleth.prototype.publish(`internalOnly`,!1,`boolean`,`Internal mesh only`),Choropleth.prototype.publish(`autoScaleMode`,`mesh`,`set`,`Auto Scale`,[`none`,`mesh`,`data`],{tags:[`Basic`],override:!0});function request_default(e,n){var s,c=(0,t.dispatch)(`beforesend`,`progress`,`load`,`error`),l,d=(0,t.map)(),f=new XMLHttpRequest,p=null,m=null,h,g,_=0;typeof XDomainRequest<`u`&&!(`withCredentials`in f)&&/^(http(s)?:)?\/\//.test(e)&&(f=new XDomainRequest),`onload`in f?f.onload=f.onerror=f.ontimeout=respond:f.onreadystatechange=function(e){f.readyState>3&&respond(e)};function respond(e){var t=f.status,n;if(!t&&hasResponse(f)||t>=200&&t<300||t===304){if(h)try{n=h.call(s,f)}catch(e){c.call(`error`,s,e);return}else n=f;c.call(`load`,s,n)}else c.call(`error`,s,e)}if(f.onprogress=function(e){c.call(`progress`,s,e)},s={header:function(e,t){return e=(e+``).toLowerCase(),arguments.length<2?d.get(e):(t==null?d.remove(e):d.set(e,t+``),s)},mimeType:function(e){return arguments.length?(l=e==null?null:e+``,s):l},responseType:function(e){return arguments.length?(g=e,s):g},timeout:function(e){return arguments.length?(_=+e,s):_},user:function(e){return arguments.length<1?p:(p=e==null?null:e+``,s)},password:function(e){return arguments.length<1?m:(m=e==null?null:e+``,s)},response:function(e){return h=e,s},get:function(e,t){return s.send(`GET`,e,t)},post:function(e,t){return s.send(`POST`,e,t)},send:function(t,n,h){return f.open(t,e,!0,p,m),l!=null&&!d.has(`accept`)&&d.set(`accept`,l+`,*/*`),f.setRequestHeader&&d.each(function(e,t){f.setRequestHeader(t,e)}),l!=null&&f.overrideMimeType&&f.overrideMimeType(l),g!=null&&(f.responseType=g),_>0&&(f.timeout=_),h==null&&typeof n==`function`&&(h=n,n=null),h!=null&&h.length===1&&(h=fixCallback(h)),h!=null&&s.on(`error`,h).on(`load`,function(e){h(null,e)}),c.call(`beforesend`,s,f),f.send(n??null),s},abort:function(){return f.abort(),s},on:function(){var e=c.on.apply(c,arguments);return e===c?s:e}},n!=null){if(typeof n!=`function`)throw Error(`invalid callback: `+n);return s.get(n)}return s}__name(request_default,`default`);function fixCallback(e){return function(t,n){e(t==null?n:null)}}function hasResponse(e){var t=e.responseType;return t&&t!==`text`?e.response:e.responseText}function type_default(e,t){return function(n,s){var c=request_default(n).mimeType(e).response(t);if(s!=null){if(typeof s!=`function`)throw Error(`invalid callback: `+s);return c.get(s)}return c}}__name(type_default,`default`);var Zt=type_default(`application/json`,function(e){return JSON.parse(e.responseText)});function dsv_default(e,t){return function(n,s,c){arguments.length<3&&(c=s,s=null);var l=request_default(n).mimeType(e);return l.row=function(e){return arguments.length?l.response(responseOf(t,s=e)):s},l.row(s),c?l.get(c):l}}__name(dsv_default,`default`);function responseOf(e,t){return function(n){return e(n.responseText,t)}}t.csvParse,t.tsvParse;var Qt=null,$t=null,en=null,ChoroplethCountries=class extends Choropleth{_choroTopologyObjectsCountries;_choroTopologyObjectsLand;choroPaths;constructor(){super()}layerEnter(e,n,s){Choropleth.prototype.layerEnter.apply(this,arguments),this._choroTopology=Qt.topology,this._choroTopologyObjectsCountries=Qt.topology.objects.countries,this._choroTopologyObjectsLand=Qt.topology.objects.land,this._choroTopologyObjects=this._choroTopologyObjectsCountries,this._selection.widgetElement(this._choroplethData),this.choroPaths=(0,t.select)(null);let c=this;this.tooltipHTML(function(e){return c.tooltipFormat({label:e[0],value:e[1]})})}layerUpdate(e){Choropleth.prototype.layerUpdate.apply(this,arguments),this._choroplethData.style(`stroke`,this.meshVisible()?null:`black`),this.choroPaths=this._choroplethData.selectAll(`.shape`).data(this.visible()?this.data():[],function(e){return e[0]});let t=this;this.choroPaths.enter().append(`path`).attr(`class`,`shape`).attr(`vector-effect`,`non-scaling-stroke`).call(this._selection.enter.bind(this._selection)).on(`click`,function(e){t._dataMap[e[0]]&&t.click(t.rowToObj(t._dataMap[e[0]]),`weight`,t._selection.selected(this))}).on(`dblclick`,function(e){t._dataMap[e[0]]&&t.dblclick(t.rowToObj(t._dataMap[e[0]]),`weight`,t._selection.selected(this))}).on(`mouseout.tooltip`,this.tooltip.hide).on(`mousemove.tooltip`,this.tooltip.show).merge(this.choroPaths).attr(`d`,function(t){let n=e._d3GeoPath(en[t[0]]);return n||console.warn(`Unknown Country: `+t),n}).style(`fill`,function(e){return t._palette(e[1],t._dataMinWeight,t._dataMaxWeight)}),this.choroPaths.exit().remove()}layerPreRender(){return this._topoJsonPromise||=new Promise((e,t)=>{Qt&&e(),Zt(`${topoJsonFolder()}/countries.json`,function(t){Qt=t,$t=feature_default(Qt.topology,Qt.topology.objects.countries).features,en={};for(let e in $t)$t[e].id&&Qt.countryNames[$t[e].id]&&(en[Qt.countryNames[$t[e].id].name]=$t[e]);e()})}),this._topoJsonPromise}};ChoroplethCountries.prototype._class+=` map_ChoroplethCountries`;var ChoroplethContinents=class extends ChoroplethCountries{constructor(){super()}layerEnter(e,t,n){ChoroplethCountries.prototype.layerEnter.apply(this,arguments),this._choroTopologyObjects=this._choroTopologyObjectsLand}};ChoroplethContinents.prototype._class+=` map_ChoroplethContinents`;var tn=null,nn=null,rn=null,ChoroplethCounties=class extends Choropleth{static __inputs=[{id:`fips`,type:`string`},{id:`value`,type:`number`}];choroPaths;constructor(){super(),this.projection(`AlbersUsaPr`)}layerEnter(e,n,s){Choropleth.prototype.layerEnter.apply(this,arguments),this._choroTopology=tn.topology,this._choroTopologyObjects=tn.topology.objects.counties,this._selection.widgetElement(this._choroplethData),this.choroPaths=(0,t.select)(null);let c=this;this.tooltipHTML(function(e){let t=e[0];return c.tooltipFormat({label:tn.countyNames[t],value:c._dataMap[t]?c._dataMap[t][1]:`N/A`})})}layerUpdate(e){Choropleth.prototype.layerUpdate.apply(this,arguments),this._choroplethData.style(`stroke`,this.meshVisible()?null:`black`),this.choroPaths=this._choroplethData.selectAll(`.shape`).data(this.visible()?this.data():[],function(e){return e[0]});let t=this;this.choroPaths.enter().append(`path`).attr(`class`,`shape`).attr(`vector-effect`,`non-scaling-stroke`).call(this._selection.enter.bind(this._selection)).on(`click`,function(e){t.click(t.rowToObj(e),`weight`,t._selection.selected(this))}).on(`dblclick`,function(e){t.dblclick(t.rowToObj(e),`weight`,t._selection.selected(this))}).on(`mouseout.tooltip`,this.tooltip.hide).on(`mousemove.tooltip`,this.tooltip.show).merge(this.choroPaths).attr(`d`,function(t){let n=e._d3GeoPath(rn[t.county]);return n||console.warn(`Unknown US County: `+t.county,t),n}).style(`fill`,function(e){return t._palette(e[1],t._dataMinWeight,t._dataMaxWeight)}),this.choroPaths.exit().remove()}layerPreRender(){return this._topoJsonPromise||=new Promise((e,t)=>{tn&&e(),Zt(`${topoJsonFolder()}/us-counties.json`,function(t){tn=t,nn=feature_default(tn.topology,tn.topology.objects.counties).features,rn={};for(let e in nn)nn[e].id&&(rn[nn[e].id]=nn[e]);e()})}),this._topoJsonPromise}};ChoroplethCounties.prototype._class+=` map_ChoroplethCounties`,ChoroplethCounties.prototype.publish(`onClickFormatFIPS`,!1,`boolean`,`format FIPS code as a String on Click`);var an=null,sn=null,cn=null,ChoroplethStates=class extends Choropleth{static __inputs=[{id:`state`,type:`string`},{id:`value`,type:`number`}];choroPaths;constructor(){super(),this.projection(`AlbersUsaPr`)}layerEnter(e,n,s){Choropleth.prototype.layerEnter.apply(this,arguments),this._choroTopology=an.topology,this._choroTopologyObjects=an.topology.objects.states,this._selection.widgetElement(this._choroplethData),this.choroPaths=(0,t.select)(null);let c=this;this.tooltipHTML(function(e){let t=cn[e[0]].id;return c.tooltipFormat({label:an.stateNames[t].name,value:e[1]})})}layerUpdate(e){Choropleth.prototype.layerUpdate.apply(this,arguments),this._choroplethData.style(`stroke`,this.meshVisible()?null:`black`),this.choroPaths=this._choroplethData.selectAll(`.shape`).data(this.visible()?this.data():[],function(e){return e[0]});let t=this;this.choroPaths.enter().append(`path`).attr(`class`,`shape`).attr(`vector-effect`,`non-scaling-stroke`).call(this._selection.enter.bind(this._selection)).on(`click`,function(e){t.click(t.rowToObj(e),`weight`,t._selection.selected(this))}).on(`dblclick`,function(e){t.dblclick(t.rowToObj(e),`weight`,t._selection.selected(this))}).on(`mouseout.tooltip`,this.tooltip.hide).on(`mousemove.tooltip`,this.tooltip.show).merge(this.choroPaths).attr(`d`,function(t){let n=e._d3GeoPath(cn[t[0]]);return n||console.warn(`Unknown US State: `+t[0]),n}).style(`fill`,function(e){return t._palette(e[1],t._dataMinWeight,t._dataMaxWeight)}),this.choroPaths.exit().remove()}layerPreRender(){return this._topoJsonPromise||=new Promise((e,t)=>{an&&e(),Zt(`${topoJsonFolder()}/us-states.json`,function(t){an=t,sn=feature_default(an.topology,an.topology.objects.states).features,cn={};for(let e in sn)sn[e].id&&(cn[an.stateNames[sn[e].id].code]=sn[e]);e()})}),this._topoJsonPromise}};ChoroplethStates.prototype._class+=` map_ChoroplethStates`;var ChoroplethStatesHeat=class extends Layered{constructor(){super()}};ChoroplethStatesHeat.prototype._class+=` map_ChoroplethStatesHeat`;var GeoHash=class extends Layer{_dataMinWeight;_dataMaxWeight;geohash;_geoHashTransform;geoHashPaths;constructor(){super()}data(e){let t=Layer.prototype.data.apply(this,arguments);return arguments.length&&(this._dataMinWeight=null,this._dataMaxWeight=null,this.data().forEach(function(e){(!this._dataMinWeight||e[1]<this._dataMinWeight)&&(this._dataMinWeight=e[1]),(!this._dataMaxWeight||e[1]>this._dataMaxWeight)&&(this._dataMaxWeight=e[1])},this)),t}layerEnter(e,n,s){Layer.prototype.layerEnter.apply(this,arguments),this.geohash=new Wt,this._geoHashTransform=n.append(`g`).attr(`class`,`map_GeoHash`),this._selection=new t.Utility.SimpleSelection(this,this._geoHashTransform),this.geoHashPaths=(0,t.select)(null)}layerUpdate(e){Layer.prototype.layerUpdate.apply(this,arguments),this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+`_`+this.id())),this._geoHashTransform.style(`opacity`,this.opacity()),this.geoHashPaths=this._geoHashTransform.selectAll(`.data`).data(this.visible()?this.data():[],function(e){return e[0]});let t=this;this.geoHashPaths.enter().append(`path`).attr(`class`,`data`).call(this._selection.enter.bind(this._selection)).on(`click`,function(e){t.click(t.rowToObj(e),`weight`,t._selection.selected(this))}).on(`dblclick`,function(e){t.dblclick(t.rowToObj(e),`weight`,t._selection.selected(this))}).merge(this.geoHashPaths).attr(`d`,function(n){let s=t.geohash.bounds(n[0]),c={type:`LineString`,coordinates:[[s.sw.lon,s.ne.lat],[s.ne.lon,s.ne.lat],[s.ne.lon,s.sw.lat],[s.sw.lon,s.sw.lat]]};return e._d3GeoPath(c)}).style(`fill`,function(e){return t._palette(e[1],t._dataMinWeight,t._dataMaxWeight)}),this.geoHashPaths.exit().remove()}click(e,t,n){}dblclick(e,t,n){}};GeoHash.prototype._class+=` map_GeoHash`,GeoHash.prototype._palette=t.Palette.rainbow(`default`),GeoHash.prototype.publish(`paletteID`,`YlOrRd`,`set`,`Color palette for this widget`,GeoHash.prototype._palette.switch(),{tags:[`Basic`,`Shared`]}),GeoHash.prototype.publish(`useClonedPalette`,!1,`boolean`,`Enable or disable using a cloned palette`,null,{tags:[`Intermediate`,`Shared`]}),GeoHash.prototype.publish(`opacity`,1,`number`,`Opacity`,null,{tags:[`Advanced`]}),GeoHash.prototype.publish(`meshVisible`,!0,`boolean`,`Mesh Visibility`),GeoHash.prototype.publish(`meshColor`,null,`html-color`,`Stroke Color`,null,{optional:!0}),GeoHash.prototype.publish(`meshStrokeWidth`,.25,`number`,`Stroke Width`);var ln=class Loader{constructor(e=null,t={}){if(this.apiKey=e,this.options=t,typeof window>`u`)throw Error(`google-maps is supported only in browser environment`)}load(){return this.api===void 0?this.loader===void 0?(window[Loader.CALLBACK_NAME]=()=>{if(this.api=window.google,this.resolve===void 0)throw Error(`Should not happen`);this.resolve(this.api)},window.gm_authFailure=()=>{if(this.reject===void 0)throw Error(`Should not happen`);this.reject(Error(`google-maps: authentication error`))},this.loader=new Promise((e,t)=>{this.resolve=e,this.reject=t;let n=document.createElement(`script`);n.src=this.createUrl(),n.async=!0,n.onerror=e=>t(e),document.head.appendChild(n)})):this.loader:Promise.resolve(this.api)}createUrl(){let e=[`callback=${Loader.CALLBACK_NAME}`];this.apiKey&&e.push(`key=${this.apiKey}`);for(let t in this.options)if(this.options.hasOwnProperty(t)){let n=this.options[t];t===`version`&&(t=`v`),t===`libraries`&&(n=n.join(`,`)),e.push(`${t}=${n}`)}return`https://maps.googleapis.com/maps/api/js?${e.join(`&`)}`}};ln.CALLBACK_NAME=`_dk_google_maps_loader_cb`;var Y=null,un=15e3;function requireGoogleMapTimeout(e){un=e}var dn;function requireGoogleMap(e){return dn||=(0,c.promiseTimeout)(un,new Promise(function(t,n){if(Y)t();else if(e)Y=e,t();else{window.__hpcc_gmap_apikey||console.warn(`__hpcc_gmap_apikey does not contain a valid API key, reverting to developers key (expect limited performance)`);try{new ln(window.__hpcc_gmap_apikey||`AIzaSyDwGn2i1i_pMZvnqYJN1BksD_tjYaCOWKg`,{libraries:[`geometry`,`drawing`]}).load().then(function(e){Y=e,t()}).catch(function(e){console.warn(`Failed to initialize Google Map API: ${e.message}`),t()})}catch(e){console.warn(`Failed to initialize Google Map API: ${e.message}`),t()}}})).catch(e=>{console.warn(`Timed out initializing Google Map API after ${un}ms.`)}),dn}function createOverlay(e,t,n){function Overlay(e,t,n){Y.maps.OverlayView.call(this),this._div=null,this._worldSurface=t,this._viewportSurface=n,this._map=e,this.setMap(e);let s=this;Y.maps.event.addListener(e,`bounds_changed`,function(){s.draw()}),Y.maps.event.addListener(e,`projection_changed`,function(){s.draw()}),this._prevWorldMin={x:0,y:0},this._prevWorldMax={x:0,y:0},this._prevMin={x:0,y:0},this._prevMax={x:0,y:0}}return Overlay.prototype=Y.maps.OverlayView.prototype,Overlay.prototype.onAdd=function(){this.div=document.createElement(`div`),this._viewportSurface.target(null).target(this.div).units(`pixels`),this.getPanes().overlayMouseTarget.appendChild(this.div)},Overlay.prototype.draw=function(){let e=this.getProjection();if(!e)return;let t=this._map.getBounds(),n=e.fromLatLngToDivPixel(t.getCenter()),s=e.fromLatLngToDivPixel(t.getSouthWest()),c=e.fromLatLngToDivPixel(t.getNorthEast()),l={x:s.x,y:c.y},d={x:c.x,y:s.y},f=e.getWorldWidth();for(;d.x<l.x+100;)d.x+=f;for(;l.x>n.x;)l.x-=f,d.x-=f;(l.x!==this._prevMin.x||l.y!==this._prevMin.y||d.x!==this._prevMax.x||d.y!==this._prevMax.y)&&(this._viewportSurface.resize({width:0,height:0}).widgetX(l.x).widgetY(l.y).widgetWidth(d.x-l.x).widgetHeight(d.y-l.y),this._viewportSurface._renderCount?(this._viewportSurface.render(),this._prevMin=l,this._prevMax=d):this._viewportSurface.lazyRender());let p=e.fromLatLngToDivPixel(new Y.maps.LatLng(85,-179.9)),m=e.fromLatLngToDivPixel(new Y.maps.LatLng(-85,179.9));for(;m.x<p.x+100;)m.x+=f;for(;p.x>n.x;)p.x-=f,m.x-=f;(p.x!==this._prevWorldMin.x||p.y!==this._prevWorldMin.y||m.x!==this._prevWorldMax.x||m.y!==this._prevWorldMax.y)&&(this._worldSurface.widgetX(p.x).widgetY(p.y).widgetWidth(m.x-p.x).widgetHeight(m.y-p.y).render(),this._prevWorldMin=m,this._prevWorldMax=m)},Overlay.prototype.onRemove=function(){this._viewportSurface.target(null),this._div.parentNode.removeChild(this._div),this._div=null},new Overlay(e,t,n)}var UserShapeSelectionBag=class{_userShapes;mapContext;constructor(e){this._userShapes=[],this.mapContext=e}add(e){this._userShapes.indexOf(e)>=0||this._userShapes.push(e)}remove(e){let t=this._userShapes.indexOf(e);t>=0&&this._userShapes.splice(t,1),e.setMap(null)}save(){return this._userShapes.map(e=>this._saveShape(e))}load(e){this._deserializeShapes(e)}_saveShape(e){let t={},n={circle:e=>{t.type=`circle`,t.pos={lat:e.center.lat(),lng:e.center.lng()},t.radius=e.radius},rectangle:e=>{t.type=`rectangle`,t.bounds={ne:e.bounds.getNorthEast(),sw:e.bounds.getSouthWest()}},polygon:e=>{t.type=e.__hpcc_type;let n=e.getPath();t.vertices=[];for(let e=0;e<n.length;e++)t.vertices.push(n.getAt(e))},polyline:e=>{n.polygon(e)}};return n[e.__hpcc_type](e),t.strokeWeight=e.strokeWeight,t.fillColor=e.fillColor,t.fillOpacity=e.fillOpacity,t.editable=e.editable,t.clickable=e.clickable||!0,t}_deserializeShapes(e){let t=JSON.parse(e),n={strokeWeight:0,fillOpacity:.45,fillColor:`#1f77b4`,editable:!0,clickable:!0},s={circle:(e,t)=>new Y.maps.Circle({strokeWeight:e.strokeWeight||n.strokeWeight,fillColor:e.fillColor||n.fillColor,fillOpacity:e.fillOpacity||n.fillOpacity,editable:e.editable||n.editable,clickable:e.clickable||n.clickable,map:t,center:e.pos,radius:e.radius}),rectangle:(e,t)=>new Y.maps.Rectangle({strokeWeight:e.strokeWeight||n.strokeWeight,fillColor:e.fillColor||n.fillColor,fillOpacity:e.fillOpacity||n.fillOpacity,editable:e.editable||n.editable,clickable:e.clickable||n.clickable,map:t,bounds:{north:e.bounds.ne.lat,west:e.bounds.sw.lng,south:e.bounds.sw.lat,east:e.bounds.ne.lng}}),polygon:(e,t)=>new Y.maps.Polygon({strokeWeight:e.strokeWeight||n.strokeWeight,fillColor:e.fillColor||n.fillColor,fillOpacity:e.fillOpacity||n.fillOpacity,editable:e.editable||n.editable,clickable:e.clickable||n.clickable,map:t,paths:e.vertices}),polyline:(e,t)=>new Y.maps.Polyline({strokeWeight:e.strokeWeight||n.strokeWeight,fillColor:e.fillColor||n.fillColor,fillOpacity:e.fillOpacity||n.fillOpacity,editable:e.editable||n.editable,clickable:e.clickable||n.clickable,map:t,path:e.vertices})};for(let e=0;e<t.length;e++){let n=s[t[e].type](t[e],this.mapContext._googleMap);this.mapContext.onDrawingComplete({type:t[e].type,overlay:n})}}},X=class GMap extends t.HTMLWidget{_overlay;_userShapes;_worldSurface;_viewportSurface;_googleMapNode;_googleMap;_googleGeocoder;_prevCenterLat;_prevCenterLong;_googleStreetViewService;_googleMapPanorama;_prevZoom;_prevStreetView;_circleMap;_pinMap;_drawingManager;_prevCenterAddress;_userShapeSelection;constructor(){super(),this._tag=`div`;let e=this;function calcProjection(t,n,s){let c=e._overlay.getProjection(),l=c.fromLatLngToDivPixel(new Y.maps.LatLng(n,s)),d=c.getWorldWidth(),f=parseFloat(t.widgetX()),p=parseFloat(t.widgetY()),m=parseFloat(t.widgetWidth());for(l.x-=f,l.y-=p;l.x<0;)l.x+=d;for(;l.x>m;)l.x-=d;return l}this._userShapes=new UserShapeSelectionBag(this),this._worldSurface=new s.AbsoluteSurface,this._worldSurface.project=function(e,t){return calcProjection(this,e,t)},this._viewportSurface=new s.AbsoluteSurface,this._viewportSurface.project=function(e,t){return calcProjection(this,e,t)}}data(e){return t.HTMLWidget.prototype.data.apply(this,arguments)}getMapType(){switch(this.type()){case`terrain`:return Y.maps.MapTypeId.TERRAIN;case`road`:return Y.maps.MapTypeId.ROADMAP;case`satellite`:return Y.maps.MapTypeId.SATELLITE;case`hybrid`:return Y.maps.MapTypeId.HYBRID;default:return Y.maps.MapTypeId.ROADMAP}}getMapOptions(){return{panControl:this.panControl(),zoomControl:this.zoomControl(),fullscreenControl:this.fullscreenControl(),mapTypeControl:this.mapTypeControl(),scaleControl:this.scaleControl(),streetViewControl:this.streetViewControl(),overviewMapControl:this.overviewMapControl(),overviewMapControlOptions:{opened:!0},styles:this.googleMapStyles()}}size(e){let n=t.HTMLWidget.prototype.size.apply(this,arguments);return arguments.length&&this._googleMapNode&&(this._googleMapNode.style(`width`,e.width+`px`).style(`height`,e.height+`px`),Y.maps.event.trigger(this._googleMap,`resize`)),n}enter(e,n){super.enter(e,n);let s=this;this._googleGeocoder=new Y.maps.Geocoder,this._googleMapNode=n.append(`div`).style(`width`,this.width()+`px`).style(`height`,this.height()+`px`),this._googleMap=new Y.maps.Map(this._googleMapNode.node(),{zoom:this.zoom(),center:new Y.maps.LatLng(this.centerLat(),this.centerLong()),mapTypeId:this.getMapType(),disableDefaultUI:!0}),this._overlay=createOverlay(this._googleMap,this._worldSurface,this._viewportSurface),this._googleMap.addListener(`center_changed`,function(){s.centerLat(s._googleMap.center.lat()),s._prevCenterLat=s.centerLat(),s.centerLong(s._googleMap.center.lng()),s._prevCenterLong=s.centerLong(),s._googleMapPanorama.setPosition({lat:s.centerLat(),lng:s.centerLong()}),s.zoom(s._googleMap.getZoom()),s._prevZoom=s.zoom(),s._overlay.draw()}),this._googleMap.addListener(`zoom_changed`,function(){s.zoom(s._googleMap.zoom),s._prevZoom=s.zoom()}),this._googleStreetViewService=new Y.maps.StreetViewService,this._googleMapPanorama=this._googleMap.getStreetView(),this._googleMapPanorama.addListener(`visible_changed`,function(){s.streetView(s._googleMapPanorama.getVisible()),s._prevStreetView=s.streetView()}),this._circleMap=(0,t.map)([]),this._pinMap=(0,t.map)([]),this._prevCenterLat=this.centerLat(),this._prevCenterLong=this.centerLong(),this._prevZoom=this.zoom();let c={strokeWeight:0,fillOpacity:.45,fillColor:`#1f77b4`,editable:!0,clickable:!0};this._drawingManager=new Y.maps.drawing.DrawingManager({drawingMode:Y.maps.drawing.OverlayType.MARKER,drawingControl:!0,drawingControlOptions:{position:Y.maps.ControlPosition.TOP_CENTER,drawingModes:[`polygon`,`rectangle`,`circle`]},rectangleOptions:c,circleOptions:c,polygonOptions:c}),this.drawingState()&&this._userShapes.load(this.drawingState())}update(e,t){let n=this;this._googleMapNode.style(`width`,this.width()+`px`).style(`height`,this.height()+`px`),this._googleMap.setMapTypeId(this.getMapType()),this._googleMap.setOptions(this.getMapOptions()),this.centerAddress_exists()&&this._prevCenterAddress!==this.centerAddress()&&(this._prevCenterAddress=this.centerAddress(),this._googleGeocoder.geocode({address:this.centerAddress()},function(e,t){if(t===Y.maps.GeocoderStatus.OK){let t=e[0].geometry.bounds||e[0].geometry.viewport;n._googleMap.fitBounds(t),n.streetView()&&n.useComputedHeading()&&n.streetViewAt({lat:e[0].geometry.location.lat(),lng:e[0].geometry.location.lng()},50)}else n.statusError({data:e,status:t})})),(this._prevCenterLat!==this.centerLat()||this._prevCenterLong!==this.centerLong())&&(this._googleMap.setCenter(new Y.maps.LatLng(this.centerLat(),this.centerLong())),this._prevCenterLat=this.centerLat(),this._prevCenterLong=this.centerLong()),this._prevZoom!==this.zoom()&&(this._googleMap.setZoom(this.zoom()),this._prevZoom=this.zoom()),this.updateCircles(),this.updatePins(),this._prevStreetView!==this.streetView()&&(this.streetView()?(this._googleMapPanorama.setPosition({lat:this.centerLat(),lng:this.centerLong()}),this._googleMapPanorama.setPov({heading:0,pitch:0}),this._googleMapPanorama.setVisible(!0)):this._googleMapPanorama.setVisible(!1),this._prevStreetView=this.streetView()),this.drawingTools()?(this._drawingManager.setMap(this._googleMap),Y.maps.event.addListener(this._drawingManager,`overlaycomplete`,function(){GMap.prototype.onDrawingComplete.apply(n,arguments)})):(this._drawingManager.setMap(null),Y.maps.event.clearInstanceListeners(this._drawingManager))}render(e){let t=this,n=arguments;return requireGoogleMap().then(()=>{super.render.apply(t,n)}),this}streetViewAt(e,t=1e3){let n=this,s=this.outdoorStreetViewOnly()?Y.maps.StreetViewSource.OUTDOOR:Y.maps.StreetViewSource.DEFAULT;this._googleStreetViewService.getPanorama({location:e,radius:t,source:s},function(t,s){if(s===`OK`){let s=new Y.maps.Marker({position:e,map:n._googleMap}),c=Y.maps.geometry.spherical.computeHeading(t.location.latLng,new Y.maps.LatLng(e.lat,e.lng));n._googleMapPanorama.setPano(t.location.pano),n._googleMapPanorama.setPov({heading:c,pitch:0}),n.showStreetViewMarker()||s.setVisible(!1),n._googleMapPanorama.setVisible(!0);let l=Y.maps.event.addListener(n._googleMap.getStreetView(),`visible_changed`,function(){this.getVisible()||(s.setMap(null),Y.maps.event.removeListener(l))})}else n.statusError({data:t,status:s})})}updateCircles(){function rowID(e){return e[0]+`_`+e[1]}let e=[],n=[],s=(0,t.map)(this._circleMap.keys(),function(e){return e});this.data().forEach(function(t){s.remove(rowID(t)),t[3]&&!this._circleMap.has(rowID(t))?e.push(t):t[3]&&this._circleMap.has(rowID(t))?n.push(t):!t[3]&&this._circleMap.has(rowID(t))&&s.set(rowID(t),!0)},this),e.forEach(function(e){let t=this.createCircle(e[0],e[1],e[3]);this._circleMap.set(rowID(e),t)},this),n.forEach(function(e){},this);let c=this;s.each(function(e){c._circleMap.get(e).setMap(null),c._circleMap.remove(e)})}updatePins(){function rowID(e){return e[0]+`_`+e[1]}let e=[],n=[],s=(0,t.map)(this._pinMap.keys(),function(e){return e});this.data().forEach(function(t){s.remove(rowID(t)),t[2]&&!this._pinMap.has(rowID(t))?e.push(t):t[2]&&this._pinMap.has(rowID(t))?n.push(t):!t[2]&&this._pinMap.has(rowID(t))&&s.set(rowID(t),!0)},this),e.forEach(function(e){let t=this.createMarker(e[0],e[1],e[2]);this._pinMap.set(rowID(e),t)},this),n.forEach(function(e){this._pinMap.get(rowID(e)).setIcon(this.createIcon(e[2]))},this);let c=this;s.each(function(e){c._pinMap.get(e).setMap(null),c._pinMap.remove(e)})}createIcon(e){return{path:`M 0,0 C -2,-20 -10,-22 -10,-30 A 10,10 0 1,1 10,-30 C 10,-22 2,-20 0,0 z M -2,-30`,fillColor:e.fillColor,fillOpacity:e.fillOpacity||.8,scale:.5,strokeColor:e.strokeColor||`black`,strokeWeight:.25}}createMarker(e,t,n){return new Y.maps.Marker({position:new Y.maps.LatLng(e,t),animation:Y.maps.Animation.DROP,title:n.title||``,icon:this.createIcon(n),map:this._googleMap})}createCircle(e,t,n){return n.radius=n.radius||1,new Y.maps.Circle({center:new Y.maps.LatLng(e,t),radius:16093*n.radius/10,fillColor:n.fillColor||`red`,strokeColor:n.strokeColor||n.fillColor||`black`,strokeWeight:.5,map:this._googleMap})}zoomTo(e,t){if(!this._renderCount)return this;t||=this.singleZoomToMaxZoom();let n=0,s=new Y.maps.LatLngBounds;switch(e.forEach(function(e){let t=new Y.maps.LatLng(e[0],e[1]);s.extend(t),++n}),n){case 0:break;case 1:this._googleMap.setCenter(s.getCenter()),this._googleMap.setZoom(t);break;default:this._googleMap.fitBounds(s)}return this}zoomToFit(){return this.zoomTo(this.data())}drawingOptions(e){return arguments.length?(this._drawingManager.setOptions(e),this):this._drawingManager}userShapeSelection(e){return arguments.length?(this._userShapeSelection&&this._userShapeSelection.setEditable(!1),this._userShapeSelection=e,this._userShapeSelection&&this._userShapeSelection.setEditable(!0),this):this._userShapeSelection}deleteUserShape(e){this._userShapeSelection===e&&this.userShapeSelection(null),this._userShapes.remove(e)}onDrawingComplete(e){if(e.type!==Y.maps.drawing.OverlayType.MARKER){this._drawingManager.setDrawingMode(null);let t=e.overlay;t.__hpcc_type=e.type,this._userShapes.add(t);let n=this,s=!1;window.addEventListener(`keydown`,function(e){(e.keyIdentifier===`Control`||e.ctrlKey===!0)&&(s=!0)}),window.addEventListener(`keyup`,function(e){e.ctrlKey===!1&&(s=!1)}),Y.maps.event.addListener(t,`click`,function(e){return n.userShapeSelection(t),e&&s===!0&&(n.deleteUserShape(t),n.drawingState(JSON.stringify(n._userShapes.save()))),!1}),this.userShapeSelection(t),this.drawingState(JSON.stringify(this._userShapes.save()))}}statusError(e){console.warn(`Data not found for this location.`)}};X.prototype._class+=` map_GMap`,X.prototype.publish(`outdoorStreetViewOnly`,!1,`boolean`,`If true, streetView will only display outdoor locations`),X.prototype.publish(`showStreetViewMarker`,!1,`boolean`,`If true, streetView marker will be hidden`),X.prototype.publish(`useComputedHeading`,!1,`boolean`,`If true, centerAddress streetView compute the ideal panorama heading`),X.prototype.publish(`type`,`road`,`set`,`Map Type`,[`terrain`,`road`,`satellite`,`hybrid`],{tags:[`Basic`]}),X.prototype.publish(`centerLat`,42.877742,`number`,`Center Latitude`,null,{tags:[`Basic`]}),X.prototype.publish(`centerLong`,-97.380979,`number`,`Center Longitude`,null,{tags:[`Basic`]}),X.prototype.publish(`centerAddress`,null,`string`,`Address to center map on`,null,{tags:[`Basic`],optional:!0}),X.prototype.publish(`zoom`,4,`number`,`Zoom Level`,null,{tags:[`Basic`]}),X.prototype.publish(`singleZoomToMaxZoom`,14,`number`,`Max zoomTo level with single item`),X.prototype.publish(`panControl`,!0,`boolean`,`Pan Controls`,null,{tags:[`Basic`]}),X.prototype.publish(`zoomControl`,!0,`boolean`,`Zoom Controls`,null,{tags:[`Basic`]}),X.prototype.publish(`scaleControl`,!0,`boolean`,`Scale Controls`,null,{tags:[`Basic`]}),X.prototype.publish(`mapTypeControl`,!1,`boolean`,`Map Type Controls`,null,{tags:[`Basic`]}),X.prototype.publish(`fullscreenControl`,!1,`boolean`,`Fullscreen Controls`,null,{tags:[`Basic`]}),X.prototype.publish(`streetViewControl`,!1,`boolean`,`StreetView Controls`,null,{tags:[`Basic`]}),X.prototype.publish(`overviewMapControl`,!1,`boolean`,`OverviewMap Controls`,null,{tags:[`Basic`]}),X.prototype.publish(`streetView`,!1,`boolean`,`Streetview`,null,{tags:[`Basic`]}),X.prototype.publish(`drawingTools`,!1,`boolean`,`Drawing Tools`,null,{tags:[`Basic`]}),X.prototype.publish(`drawingState`,``,`string`,`Map Drawings`,null,{disable:e=>e.drawingTools()===!1}),X.prototype.publish(`googleMapStyles`,{},`object`,`Styling for map colors etc`,null,{tags:[`Basic`]});var fn=1/16,OverlayLayered=class extends Layered{gmap;surface;constructor(e,t){super(),this.gmap=e,this.surface=t,this.autoScaleMode(`none`),this.zoomable(!1).zoomDuration(10)}getProjection(){return this.gmap._overlay.getProjection()}render(e){return super.render(t=>{let n=this.getProjection();if(n){let e=new window.google.maps.LatLng(0,0),t=n.fromLatLngToDivPixel(e),s=this.surface.widgetX(),c=this.surface.widgetY(),l=[t.x-s,t.y-c],d=this.gmap._googleMap.getZoom();this.zoomTo(l,fn*(1<<d),0)}e&&e(t)}),this}},GMapLayered=class extends X{layered;constructor(){super(),this.layered=new OverlayLayered(this,this._viewportSurface),this._viewportSurface.widget(this.layered)}invert(e,t){return this.layered.invert(e,t)}rproject(e,t){let n=this.layered.getProjection().fromDivPixelToLatLng(new Y.maps.Point(e,t));return{lat:n.lat(),lng:n.lng()}}updateCircles(){}updatePins(){}layers(e){return arguments.length?(this.layered.layers(e),this):this.layered.layers()}render(e){return super.render(t=>{this.layered.preRender().then(()=>{this.layered.render(t=>{e&&e(t)})})})}};GMapLayered.prototype._class+=` map_GMapLayered`;var GMapCounties=class extends GMapLayered{_counties;_view;_palette;_dataMinWeight;_dataMaxWeight;constructor(){super();let e=this;this._counties=new ChoroplethCounties().paletteID(`Blues`).meshVisible(!1).opacity(.8).columns([`fips`,`weight`]).on(`click`,function(t,n,s){e.click(t,n,s)}).on(`dblclick`,function(t,n,s){e.dblclick(t,n,s)})}enter(e,t){super.enter(e,t),this.layers([this._counties])}update(e,t){this._counties.data(this.data()),super.update(e,t),this._palette=this._counties._palette,this._dataMinWeight=this._counties._dataMinWeight,this._dataMaxWeight=this._counties._dataMaxWeight}_prevBounds;render(e){return super.render(t=>{if(this._renderCount>1&&this.autoScale()){let e=this._counties.getDataBounds();if(e.x&&e.y&&(!this._prevBounds||this._prevBounds.x!==e.x||this._prevBounds.y!==e.y||this._prevBounds.width!==e.width||this._prevBounds.height!==e.height)){this._prevBounds=e;let t=this.invert(e.x,e.y),n=this.invert(e.x+e.width,e.y+e.height);t&&n&&this.zoomTo([[t[1],t[0]],[n[1],n[0]]])}}e&&e(t)})}exit(e,t){super.exit(e,t)}click(e,t,n){}dblclick(e,t,n){}};GMapCounties.prototype._class+=` map_GMapCounties`,GMapCounties.prototype.publish(`autoScale`,!1,`boolean`,`Auto scale to data`);var GMapGraph=class extends X{constructor(){super()}enter(){super.enter.apply(this,arguments);let e=new l.Graph().layout(`None`).zoomable(!1),n=e.render,s=this;e.render=function(e){let c=[],d=[],f=null;return s.data().forEach(function(e){let n=s._viewportSurface.project(e[0],e[1]),p=new t.Shape().shape(`circle`).radius(3).data(e).pos(n);c.push(p),f&&d.push(new l.Edge().sourceVertex(f).targetVertex(p).sourceMarker(`none`).targetMarker(`arrow`)),f=p}),this.data({vertices:c,edges:d}),n.apply(this,arguments)},this._viewportSurface.widget(e)}};GMapGraph.prototype._class+=` map_GMapGraph`;var GMapHeat=class extends X{constructor(){super()}enter(){super.enter.apply(this,arguments);let e=new d.HeatMap,t=e.render,n=this;e.render=function(e){return this.data(n.data().map(function(e){let t=n._viewportSurface.project(e[0],e[1]);return[t.x,t.y,e[4]]})),t.apply(this,arguments),this},this._viewportSurface.widget(e)}};GMapHeat.prototype._class+=` map_GMapHeat`;var Pins=class extends Layer{_geohash;_pinsTransform;pinsPaths;constructor(){super(),t.Utility.SimpleSelectionMixin.call(this),this._geohash=new Wt}pinsData(){let e=this._db.fieldByLabel(this.geohashColumn()),t=this._db.fieldByLabel(this.tooltipColumn()),n=this._db.fieldByLabel(this.latColumn()),s=this._db.fieldByLabel(this.longColumn()),c=this;return this.data().filter(function(e){let t=n?e[n.idx]:e[0],l=s?e[s.idx]:e[1];return!(c.omitNullLatLong()&&t===0&&l===0)}).map(function(c,l){let d={idx:l,lat:n?c[n.idx]:c[0],long:s?c[s.idx]:c[1],ext:c[2]instanceof Object?c[2]:{},origRow:c};if(e)try{let t=this._geohash.bounds(c[e.idx]);d.lat=(t.ne.lat+t.sw.lat)/2,d.long=(t.ne.lon+t.sw.lon)/2}catch{}return t&&(d.ext.tooltip=c[t.idx]),d},this)}layerEnter(e,n,s){Layer.prototype.layerEnter.apply(this,arguments),this._pinsTransform=n,this._selection.widgetElement(this._pinsTransform),this.pinsPaths=(0,t.select)(null),this.tooltipHTML(function(e){return e.ext.tooltip===void 0?``:e.ext.tooltip})}layerUpdate(e){Layer.prototype.layerUpdate.apply(this,arguments),this._pinsTransform.style(`opacity`,this.opacity()),this.pinsPaths=this._pinsTransform.selectAll(`.pin`).data(this.visible()?this.pinsData():[],e=>e.idx);let n=this,s=this.pinsPaths.enter().append(`g`).attr(`class`,`pin`).call(this._selection.enter.bind(this._selection)).on(`click`,function(e){n.click(n.rowToObj(e.origRow),`geohash`,n._selection.selected(this))}).on(`dblclick`,function(e){n.dblclick(n.rowToObj(e.origRow),`geohash`,n._selection.selected(this))}).on(`mouseover`,function(e){t.Platform.isIE||this.parentNode.appendChild(this)}).on(`mouseout.tooltip`,function(e){e.ext&&e.ext.tooltip&&n.tooltip.hide.apply(this,arguments)}).on(`mousemove.tooltip`,function(e){e.ext&&e.ext.tooltip&&n.tooltip.show.apply(this,arguments)}).each(function(e){let n=(0,t.select)(this);n.append(`path`).attr(`class`,`data`),n.append(`text`).attr(`text-anchor`,`middle`)}).merge(this.pinsPaths);s.selectAll(`text`).style(`stroke`,this.fontColor()).style(`fill`,this.fontColor()).style(`font-size`,this.fontSize()).style(`font-family`,this.fontFamily()).style(`dominant-baseline`,this.textBaseline()).attr(`dx`,0).attr(`dy`,this.pinTextDY()).text(function(e){return e.ext&&e.ext.text?e.ext.text:``});let c=this.svgPinPath();s.selectAll(`path.data`).attr(`d`,c).attr(`stroke-width`,this.strokeWidth()+`px`).style(`display`,function(t){return e.project(t.lat,t.long)?null:`none`}).style(`stroke`,function(e){return e.ext&&e.ext.strokeColor?e.ext.strokeColor:n.strokeColor()}).style(`fill`,function(e){return e.ext&&e.ext.fillColor?e.ext.fillColor:n.fillColor()}),this.pinsPaths.exit().remove()}layerZoomed(e){Layer.prototype.layerZoomed.apply(this,arguments),this.pinsPaths.attr(`transform`,function(t){let n=e.project(t.lat,t.long);return n||=[0,0],`translate(`+n[0]+`, `+n[1]+`)scale(`+1/e.zoomScale()+`)`})}pinTextDY(){switch(this.pinType()){case`pin`:case`rectangle-pin`:return-this.arrowHeight();case`circle`:case`rectangle`:return 0}}svgPinPath(){switch(this.pinType()){case`pin`:return this.circlePinPath();case`circle`:return this.circlePath();case`rectangle`:return this.rectanglePath();case`rectangle-pin`:return this.rectanglePinPath()}}rectanglePinPath(){let e=this.pinWidth(),t=this.pinHeight(),n=this.cornerRadius(),s=this.arrowHeight(),c=this.arrowWidth(),l=0-e/2,d=0-t+n,f=(e-n*2-c)/2;return`M`+l+`,`+d+`a`+-n+`,`+-n+` 0 0 1 `+n+`,`+-n+`h`+(e+-n*2)+`a`+n+`,`+n+` 0 0 1 `+n+`,`+n+`v`+(t+-n*2)+`a`+n+`,`+n+` 0 0 1 `+-n+`,`+n+`h`+-f+`l`+-c/2+`,`+s+`l`+-c/2+`,`+-s+`h`+-f+`a`+-n+`,`+-n+` 0 0 1 `+-n+`,`+-n+`z`}rectanglePath(){let e=this.pinWidth(),t=this.pinHeight(),n=this.cornerRadius(),s=-e/2,c=-t/2;return c+=n,`M`+s+`,`+c+`a`+-n+`,`+-n+` 0 0 1 `+n+`,`+-n+`h`+(e+-n*2)+`a`+n+`,`+n+` 0 0 1 `+n+`,`+n+`v`+(t+-n*2)+`a`+n+`,`+n+` 0 0 1 `+-n+`,`+n+`h`+(-e+n*2)+`a`+-n+`,`+-n+` 0 0 1 `+-n+`,`+-n+`z`}circlePinPath(){let e=this.arrowHeight(),t=this.arrowWidth(),n=0-t/2,s=0-e,c=t/2,l=e,d=-c,f=-l,p=t+c,m=f,h=t;return`M`+n+`,`+s+`c`+d+` `+f+`, `+p+` `+m+`, `+h+` 0l`+-t/2+`,`+e+`l`+-t/2+`,`+-e+`z`}circlePath(){let e=+this.pinRadius();return`M 0, 0 m ${-e}, 0 a ${e},${e} 0 1,0 ${e*2},0 a ${e},${e} 0 1,0 ${-e*2},0`}click(e,t,n){}dblclick(e,t,n){}};Pins.prototype._class+=` map_Pins`,Pins.prototype.mixin(t.Utility.SimpleSelectionMixin),Pins.prototype.publish(`geohashColumn`,null,`set`,`Geohash column`,function(){return this.columns()},{optional:!0}),Pins.prototype.publish(`tooltipColumn`,null,`set`,`Tooltip column`,function(){return this.columns()},{optional:!0}),Pins.prototype.publish(`latColumn`,null,`set`,`Latitude column`,function(){return this.columns()},{optional:!0}),Pins.prototype.publish(`longColumn`,null,`set`,`Longitude column`,function(){return this.columns()},{optional:!0}),Pins.prototype.publish(`opacity`,1,`number`,`Opacity`,null,{tags:[`Advanced`]}),Pins.prototype.publish(`fillColor`,`#00FFDD`,`html-color`,`Pin Color`,null,{optional:!0}),Pins.prototype.publish(`omitNullLatLong`,!1,`boolean`,`Remove lat=0,lng=0 from pinsData`,null,{tags:[`Basic`]}),Pins.prototype.publish(`strokeWidth`,.5,`number`,`Pin Border Thickness (pixels)`,null,{tags:[`Basic`]}),Pins.prototype.publish(`strokeColor`,``,`html-color`,`Pin Border Color`,null,{optional:!0}),Pins.prototype.publish(`fontSize`,18,`number`,`Font Size`,null,{tags:[`Basic`,`Shared`]}),Pins.prototype.publish(`fontFamily`,`Verdana`,`string`,`Font Name`,null,{tags:[`Basic`,`Shared`,`Shared`]}),Pins.prototype.publish(`fontColor`,`#000000`,`html-color`,`Font Color`,null,{tags:[`Basic`,`Shared`]}),Pins.prototype.publish(`pinType`,`pin`,`set`,`Pin Type`,[`pin`,`circle`,`rectangle`,`rectangle-pin`],{tags:[`Basic`]}),Pins.prototype.publish(`arrowWidth`,8,`number`,`Pin arrow width (pixels)`,null,{tags:[`Basic`],disable:e=>[`pin`,`rectangle-pin`].indexOf(e.pinType())===-1}),Pins.prototype.publish(`arrowHeight`,12,`number`,`Pin arrow height (pixels)`,null,{tags:[`Basic`],disable:e=>[`pin`,`rectangle-pin`].indexOf(e.pinType())===-1}),Pins.prototype.publish(`pinWidth`,20,`number`,`Width of pin (pixels)`,null,{tags:[`Basic`],disable:e=>[`rectangle`,`rectangle-pin`].indexOf(e.pinType())===-1}),Pins.prototype.publish(`pinHeight`,20,`number`,`Height of pin (pixels) (not including arrow)`,null,{tags:[`Basic`],disable:e=>[`rectangle`,`rectangle-pin`].indexOf(e.pinType())===-1}),Pins.prototype.publish(`cornerRadius`,10,`number`,`Radius of rectangular pin corners (pixels)`,null,{tags:[`Basic`],disable:e=>[`rectangle`,`rectangle-pin`].indexOf(e.pinType())===-1}),Pins.prototype.publish(`pinRadius`,12,`number`,`Radius of circle (pixels)`,null,{tags:[`Basic`],disable:e=>e.pinType()!==`circle`}),Pins.prototype.publish(`textBaseline`,`central`,`set`,`Pin text vertical alignment`,[`auto`,`use-script`,`no-change`,`reset-size`,`ideographic`,`alphabetic`,`hanging`,`mathematical`,`central`,`middle`,`text-after-edge`,`text-before-edge`,`inherit`],{tags:[`Basic`]});var GMapPin=class extends GMapLayered{_pins;_view;constructor(){super();let e=this;this._pins=new Pins().columns([`lat`,`long`,`ext`]).on(`click`,function(t,n,s){e.click(e.rowToObj(t.ext.origRow),``,s),e.clickStreetView(e.rowToObj(t.ext.origRow),``,s)}).on(`dblclick`,function(t,n,s){e.dblclick(e.rowToObj(t.ext.origRow),``,s)})}pinsData(){if(this.data().length===0)return[];let e=this.columns();return this._view=this._db.rollupView([this.latitudeColumn(),this.longitudeColumn()]),this._view.entries().map(function(t){let n=t.values[0].value[0];return[t.key,t.values[0].key,{fillColor:n[e.indexOf(this.colorColumn())],tooltip:n[e.indexOf(this.tooltipColumn())],origRow:n}]},this)}enter(e,t){super.enter(e,t),this.layers([this._pins])}_prevChecksum;update(e,t){super.update(e,t),this._pins.data(this.pinsData()),this.autoScale()&&this._prevChecksum!==this._db.checksum()&&(this._prevChecksum=this._db.checksum(),this.zoomTo(this._pins.pinsData().map(function(e){return[e.lat,e.long]})))}exit(e,t){super.exit(e,t)}click(e,t,n){}clickStreetView(e,t,n){this.streetViewOnClick()&&this.streetViewAt({lat:+e[this.latitudeColumn()],lng:+e[this.longitudeColumn()]})}dblclick(e,t,n){}};GMapPin.prototype._class+=` map_GMapPin`,GMapPin.prototype.publish(`autoScale`,!1,`boolean`,`Auto scale to data`),GMapPin.prototype.publishProxy(`pinColor`,`_pins`,`fillColor`),GMapPin.prototype.publishProxy(`pinType`,`_pins`,`pinType`),GMapPin.prototype.publishProxy(`pinWidth`,`_pins`,`pinWidth`),GMapPin.prototype.publishProxy(`pinHeight`,`_pins`,`pinHeight`),GMapPin.prototype.publishProxy(`cornerRadius`,`_pins`,`cornerRadius`),GMapPin.prototype.publishProxy(`pinRadius`,`_pins`,`pinRadius`),GMapPin.prototype.publishProxy(`arrowWidth`,`_pins`,`arrowWidth`),GMapPin.prototype.publishProxy(`arrowHeight`,`_pins`,`arrowHeight`),GMapPin.prototype.publishProxy(`textBaseline`,`_pins`,`textBaseline`),GMapPin.prototype.publishProxy(`strokeWidth`,`_pins`,`strokeWidth`),GMapPin.prototype.publishProxy(`omitNullLatLong`,`_pins`,`omitNullLatLong`),GMapPin.prototype.publish(`latitudeColumn`,null,`set`,`Latitude`,function(){return this.columns()},{optional:!0}),GMapPin.prototype.publish(`longitudeColumn`,null,`set`,`Longitude`,function(){return this.columns()},{optional:!0}),GMapPin.prototype.publish(`colorColumn`,null,`set`,`Color`,function(){return this.columns()},{optional:!0}),GMapPin.prototype.publish(`tooltipColumn`,null,`set`,`Tooltip`,function(){return this.columns()},{optional:!0}),GMapPin.prototype.publish(`streetViewOnClick`,!1,`boolean`,`Switch to street view when pin clicked`);var Lines=class extends Layer{dataEdges;_edgesTransform;constructor(){super()}data(e){let t=Layer.prototype.data.apply(this,arguments);return arguments.length&&(this.dataEdges=[],e.forEach(function(e){this.dataEdges.push({type:`LineString`,coordinates:[[e[1],e[0]],[e[3],e[2]]]})},this)),t}layerEnter(e,t,n){Layer.prototype.layerEnter.apply(this,arguments),t.append(`defs`).append(`marker`).attr(`class`,`marker`).attr(`id`,this._id+`_arrowHead`).attr(`viewBox`,`0 0 10 10`).attr(`refX`,10).attr(`refY`,5).attr(`markerWidth`,16).attr(`markerHeight`,16).attr(`markerUnits`,`strokeWidth`).attr(`orient`,`auto`).append(`polyline`).attr(`points`,`0,0 10,5 0,10 1,5`),this._edgesTransform=t.append(`g`)}_edgesPaths;layerUpdate(e){Layer.prototype.layerUpdate.apply(this,arguments),this._edgesTransform.style(`opacity`,this.opacity());let t=this._edgesTransform.selectAll(`.dataEdge`).data(this.visible()?this.dataEdges:[]);this._edgesPaths=t.enter().append(`path`).attr(`class`,`dataEdge`).attr(`marker-end`,`url(#`+this._id+`_arrowHead)`).merge(t).attr(`d`,e._d3GeoPath),t.exit().remove()}layerZoomed(e){Layer.prototype.layerZoomed.apply(this,arguments),this._edgesPaths.attr(`stroke-width`,`${.5/e.zoomScale()}px`)}};Lines.prototype._class+=` map_Lines`,Lines.prototype.publish(`opacity`,1,`number`,`Opacity`,null,{tags:[`Advanced`]});var GMapPinLine=class extends GMapLayered{_lines;_pins;_fromView;_toView;_linesView;constructor(){super();let e=this;this._lines=new Lines,this._pins=new Pins().columns([`lat`,`long`,`ext`]).on(`click`,function(t,n,s){e.click(e.rowToObj(t.ext.origRow),``,s)}).on(`dblclick`,function(t,n,s){e.click(e.rowToObj(t.ext.origRow),``,s)})}pinsData(){if(this.data().length===0)return[];let e=this.columns();this._fromView=this._db.rollupView([this.fromLatitudeColumn(),this.fromLongitudeColumn()]),this._toView=this._db.rollupView([this.toLatitudeColumn(),this.toLongitudeColumn()]);let t=this._fromView.entries().map(function(t){let n=t.values[0].value[0];return[t.key,t.values[0].key,{fillColor:n[e.indexOf(this.fromColorColumn())]||this.fromPinColor(),tooltip:n[e.indexOf(this.fromTooltipColumn())],origRow:n}]},this),n=this._toView.entries().map(function(t){let n=t.values[0].value[0];return[t.key,t.values[0].key,{fillColor:n[e.indexOf(this.toColorColumn())]||this.toPinColor(),tooltip:n[e.indexOf(this.toTooltipColumn())],origRow:n}]},this);return t.concat(n)}linesData(){return this.data().length===0?[]:(this._linesView=this._db.rollupView([this.fromLatitudeColumn(),this.fromLongitudeColumn(),this.toLatitudeColumn(),this.toLongitudeColumn()]),this._linesView.data())}enter(e,t){super.enter(e,t),this.layers([this._lines,this._pins])}_prevChecksum;update(e,t){super.update(e,t),this._pins.data(this.pinsData()),this._lines.data(this.linesData()),this.autoScale()&&this._prevChecksum!==this._db.checksum()&&(this._prevChecksum=this._db.checksum(),this.zoomTo(this._pins.pinsData().map(function(e){return[e.lat,e.long]})))}exit(e,t){super.exit(e,t)}click(e,t,n){}dblclick(e,t,n){}};GMapPinLine.prototype._class+=` map_GMapPinLine`,GMapPinLine.prototype.publish(`autoScale`,!1,`boolean`,`Auto scale to data`),GMapPinLine.prototype.publish(`fromPinColor`,`green`,`html-color`,`From Pin Color`),GMapPinLine.prototype.publish(`fromLatitudeColumn`,null,`set`,`From Latitude`,function(){return this.columns()},{optional:!0}),GMapPinLine.prototype.publish(`fromLongitudeColumn`,null,`set`,`From Longitude`,function(){return this.columns()},{optional:!0}),GMapPinLine.prototype.publish(`fromColorColumn`,null,`set`,`From Color`,function(){return this.columns()},{optional:!0}),GMapPinLine.prototype.publish(`fromTooltipColumn`,null,`set`,`From Tooltip`,function(){return this.columns()},{optional:!0}),GMapPinLine.prototype.publish(`toPinColor`,`red`,`html-color`,`To Pin Color`),GMapPinLine.prototype.publish(`toLatitudeColumn`,null,`set`,`To Latitude`,function(){return this.columns()},{optional:!0}),GMapPinLine.prototype.publish(`toLongitudeColumn`,null,`set`,`To Longitude`,function(){return this.columns()},{optional:!0}),GMapPinLine.prototype.publish(`toColorColumn`,null,`set`,`To Color`,function(){return this.columns()},{optional:!0}),GMapPinLine.prototype.publish(`toTooltipColumn`,null,`set`,`To Tooltip`,function(){return this.columns()},{optional:!0});var Graph=class extends Pins{dataEdges=[];_edgesTransform;constructor(){super()}importJSON(e){let t=Pins.prototype.importJSON.apply(this,arguments);if(arguments.length){this.dataEdges=[];let t=null;e.forEach(function(e){t&&this.dataEdges.push({type:`LineString`,coordinates:[[t.long,t.lat],[e.long,e.lat]]}),t=e.eol?null:e},this)}return t}data(e){let t=Pins.prototype.data.apply(this,arguments);if(arguments.length){this.dataEdges=[];let t=null;e.forEach(function(e){t&&this.dataEdges.push({type:`LineString`,coordinates:[[t[1],t[0]],[e[1],e[0]]]}),t=e},this)}return t}layerEnter(e,t,n){Pins.prototype.layerEnter.apply(this,arguments),t.append(`defs`).append(`marker`).attr(`class`,`marker`).attr(`id`,this._id+`_arrowHead`).attr(`viewBox`,`0 0 10 10`).attr(`refX`,10).attr(`refY`,5).attr(`markerWidth`,16).attr(`markerHeight`,16).attr(`markerUnits`,`strokeWidth`).attr(`orient`,`auto`).append(`polyline`).attr(`points`,`0,0 10,5 0,10 1,5`),this._edgesTransform=t.append(`g`)}_edgesPaths;layerUpdate(e){Pins.prototype.layerUpdate.apply(this,arguments),this._edgesTransform.style(`opacity`,this.opacity());let t=this._edgesTransform.selectAll(`.dataEdge`).data(this.visible()?this.dataEdges:[]);this._edgesPaths=t.enter().append(`path`).attr(`class`,`dataEdge`).attr(`marker-end`,`url(#`+this._id+`_arrowHead)`).merge(t).attr(`d`,e._d3GeoPath),t.exit().remove()}layerZoomed(e){Pins.prototype.layerZoomed.apply(this,arguments),this._edgesPaths.attr(`stroke-width`,`${.5/e.zoomScale()}px`)}};Graph.prototype._class+=` map_Graph`;var Graticule=class extends Layer{_dataMap={};_path=(0,t.select)(null);_graticule;_graticulePath;_graticuleOutlinePath;_prevProjection;constructor(){super()}layerEnter(e,t,n){Layer.prototype.layerEnter.apply(this,arguments),this._graticule=graticule(),this._graticulePath=t.append(`path`).datum(this._graticule).attr(`class`,`graticule`).attr(`vector-effect`,`non-scaling-stroke`),this._graticuleOutlinePath=t.append(`path`).datum(this._graticule.outline).attr(`class`,`graticuleOutline`).attr(`vector-effect`,`non-scaling-stroke`)}layerUpdate(e){if(!this.visible()){this._graticulePath.attr(`d`,``),this._graticuleOutlinePath.attr(`d`,``),delete this._prevProjection;return}this._prevProjection!==e.projection()&&(this._graticulePath.attr(`d`,e._d3GeoPath),this._graticuleOutlinePath.attr(`d`,e._d3GeoPath),this._prevProjection=e.projection()),this._graticulePath.style(`stroke`,this.meshColor()),this._graticuleOutlinePath.style(`stroke`,this.meshColor())}layerExit(e){delete this._prevProjection}};Graticule.prototype._class+=` map_Graticule`,Graticule.prototype.publish(`opacity`,1,`number`,`Opacity`,null,{tags:[`Advanced`]}),Graticule.prototype.publish(`meshColor`,null,`html-color`,`Stroke Color`,null,{optional:!0}),Graticule.prototype.publish(`meshStrokeWidth`,.25,`number`,`Stroke Width`);var Heat=class extends Layer{_heatTransform;heat;_prevProjection;constructor(){super()}layerEnter(e,t,n){Layer.prototype.layerEnter.apply(this,arguments),this._parentOverlay.style(`pointer-events`,`none`),this._heatTransform=n.style(`pointer-events`,`none`).append(`div`).attr(`class`,this.classID()).style(`width`,e.width()+`px`).style(`height`,e.height()+`px`),this.heat=new d.HeatMap().target(this._heatTransform.node())}layerUpdate(e){Layer.prototype.layerUpdate.apply(this,arguments),this._heatTransform.style(`opacity`,this.opacity()).style(`width`,e.width()+`px`).style(`height`,e.height()+`px`),this.heat.resize(e.size()),this.layerZoomed(e)}layerExit(e){delete this._prevProjection,this.heat.target(null),delete this.heat}layerZoomed(e){Layer.prototype.layerZoomed.apply(this,arguments);let t=this._db.fieldByLabel(this.latColumn()),n=this._db.fieldByLabel(this.longColumn());this.heat.columns(this.columns()).data(this.visible()?this.data().map(function(s){let c=t?s[t.idx]:s[0],l=n?s[n.idx]:s[1],d=e.zoomTranslate(),f=e.project(c,l),p=e.zoomScale();return f[0]*=p,f[1]*=p,[d[0]+f[0],d[1]+f[1],s[4]||.5]}):[]).render()}};Heat.prototype._class+=` map_Heat`,Heat.prototype.publish(`latColumn`,null,`set`,`Latitude column`,function(){return this.columns()},{optional:!0}),Heat.prototype.publish(`longColumn`,null,`set`,`Longitude column`,function(){return this.columns()},{optional:!0}),Heat.prototype.publish(`opacity`,1,`number`,`Opacity`,null,{tags:[`Advanced`]});function IChoropleth(){}IChoropleth.prototype._palette=t.Palette.rainbow(`default`),IChoropleth.prototype.click=function(e,t,n){};function defaultScale(e){return e.k}function defaultTranslate(e){return[e.x,e.y]}function constant(e){return function(){return e}}function tile_default(){let e=0,t=0,n=960,s=500,c=!0,l=!0,d=256,f=defaultScale,p=defaultTranslate,m=0;function tile(){let h=+f.apply(this,arguments),g=p.apply(this,arguments),_=Math.log2(h/d),v=Math.round(Math.max(_+m,0)),y=2**(_-v)*d,b=g[0]-h/2,x=g[1]-h/2,S=Math.max(c?0:-1/0,Math.floor((e-b)/y)),C=Math.min(c?1<<v:1/0,Math.ceil((n-b)/y)),T=Math.max(l?0:-1/0,Math.floor((t-x)/y)),E=Math.min(l?1<<v:1/0,Math.ceil((s-x)/y)),D=[];for(let e=T;e<E;++e)for(let t=S;t<C;++t)D.push([t,e,v]);return D.translate=[b/y,x/y],D.scale=y,D}return tile.size=function(c){return arguments.length?(e=t=0,n=+c[0],s=+c[1],tile):[n-e,s-t]},tile.extent=function(c){return arguments.length?(e=+c[0][0],t=+c[0][1],n=+c[1][0],s=+c[1][1],tile):[[e,t],[n,s]]},tile.scale=function(e){return arguments.length?(f=typeof e==`function`?e:constant(+e),tile):f},tile.translate=function(e){return arguments.length?(p=typeof e==`function`?e:constant([+e[0],+e[1]]),tile):p},tile.zoomDelta=function(e){return arguments.length?(m=+e,tile):m},tile.tileSize=function(e){return arguments.length?(d=+e,tile):d},tile.clamp=function(e){return arguments.length?(c=l=!!e,tile):c&&l},tile.clampX=function(e){return arguments.length?(c=!!e,tile):c},tile.clampY=function(e){return arguments.length?(l=!!e,tile):l},tile}__name(tile_default,`default`);var pn=4096,mn=class OpenStreet extends Layer{static _copyrightText=`© OpenStreetMap contributors`;_tile;_openStreet;_copyright;_copyrightBBox;_prevTileProvider;_zoomLayerID=0;_prevZoomLevel;constructor(){super(),this.autoScaleMode(`none`)}layerEnter(e,t,n){Layer.prototype.layerEnter.apply(this,arguments),e.zoomExtent([.1,pn*4]),this._openStreet=t.append(`g`),this._copyright=t.append(`text`).attr(`x`,-100).attr(`y`,-100).style(`opacity`,.5).text(OpenStreet._copyrightText),this._copyrightBBox=this._copyright.node().getBBox()}layerUpdate(e){this._tile=tile_default().size([e.width(),e.height()]).wrap(!1),this.visible()?this._copyright.attr(`x`,e.width()-this._copyrightBBox.width-this._copyrightBBox.height/2).attr(`y`,e.height()-this._copyrightBBox.height/2).text(OpenStreet._copyrightText):this._copyright.text(``),this.layerZoomed(e)}layerZoomed(e){let n=e.zoomScale(),s=e.zoomTranslate(),c=this._tile.scale(n*pn).translate(s)(),l=c.scale/n,d=[c.translate[0]/c.scale,c.translate[1]/c.scale],f=Math.round(l*1e3);this._prevZoomLevel!==f&&(this._prevZoomLevel=f,this._zoomLayerID++);let p=this._openStreet.selectAll(`.scaleG`).data([this._zoomLayerID],e=>e),m=p.enter().append(`g`).attr(`class`,`scaleG`).attr(`transform`,stringify(l,d)).merge(p);p.exit().style(`opacity`,1).transition().duration(1e3).style(`opacity`,0).on(`end`,function(e){(0,t.select)(this).selectAll(`.image`).attr(`xlink:href`,null)}).remove(),m.selectAll(`.image`).data(c,function(e){return``+e.x+`,`+e.y}).enter().append(`image`).attr(`class`,`image`).style(`opacity`,0).attr(`x`,function(e){return e.tx}).attr(`y`,function(e){return e.ty}).attr(`width`,256).attr(`height`,256).attr(`xlink:href`,function(e){return`http://`+`abc`[e.y%3]+`.tile.openstreetmap.org/`+e.z+`/`+e.x+`/`+e.y+`.png`}).transition().duration(500).style(`opacity`,1)}};mn.prototype._class+=` map_OpenStreet`,mn.prototype.publish(`tileProvider`,`OpenStreetMap`,`set`,`Tile Provider`,[`OpenStreetMap`,`OpenStreetMap Hot`,`MapQuest`,`MapQuest Sat`,`Stamen Watercolor`,`OpenCycleMap`],{tags:[`Basic`,`Shared`]});function stringify(e,t){return`translate(-2048,-2048) scale(`+e/256+`)`}var TopoJSONChoropleth=class extends Choropleth{_prevRegion;choroPaths;_choroTopologyIndex;_choroTopologyFeatures;constructor(){super(),this.projection(`Mercator`)}layerEnter(e,n,s){Choropleth.prototype.layerEnter.apply(this,arguments),this._selection.widgetElement(this._choroplethData),this.choroPaths=(0,t.select)(null);let c=this;this.tooltipHTML(function(e){let t=c.columns(),n=t&&t.length?t[0]:`Location`,s=e&&e.length?e[e.length-1]:[``];return c.tooltipFormat({label:s[0],series:n,value:e[1]})})}layerUpdate(e){Choropleth.prototype.layerUpdate.apply(this,arguments);let t=[],n=this;this.data().forEach(function(e){if(isNaN(e[0]))for(let s in n._choroTopologyIndex)for(let c in n._choroTopologyIndex[s])c===e[0]&&n._choroTopologyIndex[s][c].forEach(function(n){t.push([n].concat(e.filter(function(e,t){return t>0}),[e]))});else t.push(e.concat([e]))}),this.choroPaths=this._choroplethData.selectAll(`.data`).data(this.visible()?t:[],function(e){return e[0]}),this.choroPaths.enter().append(`path`).attr(`class`,`data`).call(this._selection.enter.bind(this._selection)).on(`click`,function(e){n._dataMap[e[0]]&&n.click(n.rowToObj(n._dataMap[e[0]]),`weight`,n._selection.selected(n))}).on(`dblclick`,function(e){n._dataMap[e[0]]&&n.dblclick(n.rowToObj(n._dataMap[e[0]]),`weight`,n._selection.selected(n))}).on(`mouseout.tooltip`,this.tooltip.hide).on(`mousemove.tooltip`,this.tooltip.show),this.choroPaths.attr(`d`,function(t){let s=e._d3GeoPath(n._choroTopologyFeatures[t[0]]);return s||console.warn(`Unknown Country: `+t),s}).style(`fill`,function(e){return n._palette(e[1],n._dataMinWeight,n._dataMaxWeight)}),this.choroPaths.exit().remove()}layerPreRender(){if(this._prevRegion!==this.region()&&(this._prevRegion=this.region(),delete this._topoJsonPromise),!this._topoJsonPromise){let e=this;this._topoJsonPromise=new Promise(function(t,n){Zt(`${topoJsonFolder()}/${e.region()}.json`,function(n){e._choroTopology=n,e._choroTopologyObjects=n.objects.PolbndA,e._choroTopologyFeatures=feature_default(e._choroTopology,e._choroTopologyObjects).features,Zt(`${topoJsonFolder()}/${e.region()}_idx.json`,indexLoad).on(`error`,function(e){indexLoad({})});function indexLoad(n){e._choroTopologyIndex=n,t()}})})}return this._topoJsonPromise}};TopoJSONChoropleth.prototype._class+=` map_TopoJSONChoropleth`,TopoJSONChoropleth.prototype.publish(`region`,`GB`,`set`,`Region Data`,`AT.BE.BG.BR.CHLI.CY.CZ.DE.DK.EE.ES.FI.FR.GB.GE.GR.HR.HU.IE.IS.IT.KS.LT.LU.LV.MD.MK.MT.ND.NL.NO.PL.PT.RO.RS.SE.SI.SK.UA`.split(`.`));var Z=__toESM(__commonJSMin(((e,t)=>{(function(n,s){typeof e==`object`&&t!==void 0?s(e):typeof define==`function`&&define.amd?define([`exports`],s):(n=typeof globalThis<`u`?globalThis:n||self,s(n.leaflet={}))})(e,(function(e){"use strict";var t=`1.9.4`;function extend(e){var t,n,s,c;for(n=1,s=arguments.length;n<s;n++)for(t in c=arguments[n],c)e[t]=c[t];return e}var n=Object.create||(function(){function F(){}return function(e){return F.prototype=e,new F}})();function bind(e,t){var n=Array.prototype.slice;if(e.bind)return e.bind.apply(e,n.call(arguments,1));var s=n.call(arguments,2);return function(){return e.apply(t,s.length?s.concat(n.call(arguments)):arguments)}}var s=0;function stamp(e){return`_leaflet_id`in e||(e._leaflet_id=++s),e._leaflet_id}function throttle(e,t,n){var s,c,wrapperFn,later=function(){s=!1,c&&=(wrapperFn.apply(n,c),!1)};return wrapperFn=function(){s?c=arguments:(e.apply(n,arguments),setTimeout(later,t),s=!0)},wrapperFn}function wrapNum(e,t,n){var s=t[1],c=t[0],l=s-c;return e===s&&n?e:((e-c)%l+l)%l+c}function falseFn(){return!1}function formatNum(e,t){if(t===!1)return e;var n=10**(t===void 0?6:t);return Math.round(e*n)/n}function trim(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,``)}function splitWords(e){return trim(e).split(/\s+/)}function setOptions(e,t){for(var s in Object.prototype.hasOwnProperty.call(e,`options`)||(e.options=e.options?n(e.options):{}),t)e.options[s]=t[s];return e.options}function getParamString(e,t,n){var s=[];for(var c in e)s.push(encodeURIComponent(n?c.toUpperCase():c)+`=`+encodeURIComponent(e[c]));return(!t||t.indexOf(`?`)===-1?`?`:`&`)+s.join(`&`)}var c=/\{ *([\w_ -]+) *\}/g;function template(e,t){return e.replace(c,function(e,n){var s=t[n];if(s===void 0)throw Error(`No value provided for variable `+e);return typeof s==`function`&&(s=s(t)),s})}var l=Array.isArray||function(e){return Object.prototype.toString.call(e)===`[object Array]`};function indexOf(e,t){for(var n=0;n<e.length;n++)if(e[n]===t)return n;return-1}var d=`data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=`;function getPrefixed(e){return window[`webkit`+e]||window[`moz`+e]||window[`ms`+e]}var f=0;function timeoutDefer(e){var t=+new Date,n=Math.max(0,16-(t-f));return f=t+n,window.setTimeout(e,n)}var p=window.requestAnimationFrame||getPrefixed(`RequestAnimationFrame`)||timeoutDefer,m=window.cancelAnimationFrame||getPrefixed(`CancelAnimationFrame`)||getPrefixed(`CancelRequestAnimationFrame`)||function(e){window.clearTimeout(e)};function requestAnimFrame(e,t,n){if(n&&p===timeoutDefer)e.call(t);else return p.call(window,bind(e,t))}function cancelAnimFrame(e){e&&m.call(window,e)}var h={__proto__:null,extend,create:n,bind,get lastId(){return s},stamp,throttle,wrapNum,falseFn,formatNum,trim,splitWords,setOptions,getParamString,template,isArray:l,indexOf,emptyImageUrl:d,requestFn:p,cancelFn:m,requestAnimFrame,cancelAnimFrame};function Class(){}Class.extend=function(e){var NewClass=function(){setOptions(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},t=NewClass.__super__=this.prototype,s=n(t);for(var c in s.constructor=NewClass,NewClass.prototype=s,this)Object.prototype.hasOwnProperty.call(this,c)&&c!==`prototype`&&c!==`__super__`&&(NewClass[c]=this[c]);return e.statics&&extend(NewClass,e.statics),e.includes&&(checkDeprecatedMixinEvents(e.includes),extend.apply(null,[s].concat(e.includes))),extend(s,e),delete s.statics,delete s.includes,s.options&&(s.options=t.options?n(t.options):{},extend(s.options,e.options)),s._initHooks=[],s.callInitHooks=function(){if(!this._initHooksCalled){t.callInitHooks&&t.callInitHooks.call(this),this._initHooksCalled=!0;for(var e=0,n=s._initHooks.length;e<n;e++)s._initHooks[e].call(this)}},NewClass},Class.include=function(e){var t=this.prototype.options;return extend(this.prototype,e),e.options&&(this.prototype.options=t,this.mergeOptions(e.options)),this},Class.mergeOptions=function(e){return extend(this.prototype.options,e),this},Class.addInitHook=function(e){var t=Array.prototype.slice.call(arguments,1),n=typeof e==`function`?e:function(){this[e].apply(this,t)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(n),this};function checkDeprecatedMixinEvents(e){if(!(typeof L>`u`||!L||!L.Mixin)){e=l(e)?e:[e];for(var t=0;t<e.length;t++)e[t]===L.Mixin.Events&&console.warn(`Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.`,Error().stack)}}var g={on:function(e,t,n){if(typeof e==`object`)for(var s in e)this._on(s,e[s],t);else{e=splitWords(e);for(var c=0,l=e.length;c<l;c++)this._on(e[c],t,n)}return this},off:function(e,t,n){if(!arguments.length)delete this._events;else if(typeof e==`object`)for(var s in e)this._off(s,e[s],t);else{e=splitWords(e);for(var c=arguments.length===1,l=0,d=e.length;l<d;l++)c?this._off(e[l]):this._off(e[l],t,n)}return this},_on:function(e,t,n,s){if(typeof t!=`function`){console.warn(`wrong listener type: `+typeof t);return}if(this._listens(e,t,n)===!1){n===this&&(n=void 0);var c={fn:t,ctx:n};s&&(c.once=!0),this._events=this._events||{},this._events[e]=this._events[e]||[],this._events[e].push(c)}},_off:function(e,t,n){var s,c,l;if(this._events&&(s=this._events[e],s)){if(arguments.length===1){if(this._firingCount)for(c=0,l=s.length;c<l;c++)s[c].fn=falseFn;delete this._events[e];return}if(typeof t!=`function`){console.warn(`wrong listener type: `+typeof t);return}var d=this._listens(e,t,n);if(d!==!1){var f=s[d];this._firingCount&&(f.fn=falseFn,this._events[e]=s=s.slice()),s.splice(d,1)}}},fire:function(e,t,n){if(!this.listens(e,n))return this;var s=extend({},t,{type:e,target:this,sourceTarget:t&&t.sourceTarget||this});if(this._events){var c=this._events[e];if(c){this._firingCount=this._firingCount+1||1;for(var l=0,d=c.length;l<d;l++){var f=c[l],p=f.fn;f.once&&this.off(e,p,f.ctx),p.call(f.ctx||this,s)}this._firingCount--}}return n&&this._propagateEvent(s),this},listens:function(e,t,n,s){typeof e!=`string`&&console.warn(`"string" type argument expected`);var c=t;typeof t!=`function`&&(s=!!t,c=void 0,n=void 0);var l=this._events&&this._events[e];if(l&&l.length&&this._listens(e,c,n)!==!1)return!0;if(s){for(var d in this._eventParents)if(this._eventParents[d].listens(e,t,n,s))return!0}return!1},_listens:function(e,t,n){if(!this._events)return!1;var s=this._events[e]||[];if(!t)return!!s.length;n===this&&(n=void 0);for(var c=0,l=s.length;c<l;c++)if(s[c].fn===t&&s[c].ctx===n)return c;return!1},once:function(e,t,n){if(typeof e==`object`)for(var s in e)this._on(s,e[s],t,!0);else{e=splitWords(e);for(var c=0,l=e.length;c<l;c++)this._on(e[c],t,n,!0)}return this},addEventParent:function(e){return this._eventParents=this._eventParents||{},this._eventParents[stamp(e)]=e,this},removeEventParent:function(e){return this._eventParents&&delete this._eventParents[stamp(e)],this},_propagateEvent:function(e){for(var t in this._eventParents)this._eventParents[t].fire(e.type,extend({layer:e.target,propagatedFrom:e.target},e),!0)}};g.addEventListener=g.on,g.removeEventListener=g.clearAllEventListeners=g.off,g.addOneTimeEventListener=g.once,g.fireEvent=g.fire,g.hasEventListeners=g.listens;var _=Class.extend(g);function Point(e,t,n){this.x=n?Math.round(e):e,this.y=n?Math.round(t):t}var v=Math.trunc||function(e){return e>0?Math.floor(e):Math.ceil(e)};Point.prototype={clone:function(){return new Point(this.x,this.y)},add:function(e){return this.clone()._add(toPoint(e))},_add:function(e){return this.x+=e.x,this.y+=e.y,this},subtract:function(e){return this.clone()._subtract(toPoint(e))},_subtract:function(e){return this.x-=e.x,this.y-=e.y,this},divideBy:function(e){return this.clone()._divideBy(e)},_divideBy:function(e){return this.x/=e,this.y/=e,this},multiplyBy:function(e){return this.clone()._multiplyBy(e)},_multiplyBy:function(e){return this.x*=e,this.y*=e,this},scaleBy:function(e){return new Point(this.x*e.x,this.y*e.y)},unscaleBy:function(e){return new Point(this.x/e.x,this.y/e.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=v(this.x),this.y=v(this.y),this},distanceTo:function(e){e=toPoint(e);var t=e.x-this.x,n=e.y-this.y;return Math.sqrt(t*t+n*n)},equals:function(e){return e=toPoint(e),e.x===this.x&&e.y===this.y},contains:function(e){return e=toPoint(e),Math.abs(e.x)<=Math.abs(this.x)&&Math.abs(e.y)<=Math.abs(this.y)},toString:function(){return`Point(`+formatNum(this.x)+`, `+formatNum(this.y)+`)`}};function toPoint(e,t,n){return e instanceof Point?e:l(e)?new Point(e[0],e[1]):e==null?e:typeof e==`object`&&`x`in e&&`y`in e?new Point(e.x,e.y):new Point(e,t,n)}function Bounds(e,t){if(e)for(var n=t?[e,t]:e,s=0,c=n.length;s<c;s++)this.extend(n[s])}Bounds.prototype={extend:function(e){var t,n;if(!e)return this;if(e instanceof Point||typeof e[0]==`number`||`x`in e)t=n=toPoint(e);else if(e=toBounds(e),t=e.min,n=e.max,!t||!n)return this;return!this.min&&!this.max?(this.min=t.clone(),this.max=n.clone()):(this.min.x=Math.min(t.x,this.min.x),this.max.x=Math.max(n.x,this.max.x),this.min.y=Math.min(t.y,this.min.y),this.max.y=Math.max(n.y,this.max.y)),this},getCenter:function(e){return toPoint((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,e)},getBottomLeft:function(){return toPoint(this.min.x,this.max.y)},getTopRight:function(){return toPoint(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(e){var t,n;return e=typeof e[0]==`number`||e instanceof Point?toPoint(e):toBounds(e),e instanceof Bounds?(t=e.min,n=e.max):t=n=e,t.x>=this.min.x&&n.x<=this.max.x&&t.y>=this.min.y&&n.y<=this.max.y},intersects:function(e){e=toBounds(e);var t=this.min,n=this.max,s=e.min,c=e.max,l=c.x>=t.x&&s.x<=n.x,d=c.y>=t.y&&s.y<=n.y;return l&&d},overlaps:function(e){e=toBounds(e);var t=this.min,n=this.max,s=e.min,c=e.max,l=c.x>t.x&&s.x<n.x,d=c.y>t.y&&s.y<n.y;return l&&d},isValid:function(){return!!(this.min&&this.max)},pad:function(e){var t=this.min,n=this.max,s=Math.abs(t.x-n.x)*e,c=Math.abs(t.y-n.y)*e;return toBounds(toPoint(t.x-s,t.y-c),toPoint(n.x+s,n.y+c))},equals:function(e){return e?(e=toBounds(e),this.min.equals(e.getTopLeft())&&this.max.equals(e.getBottomRight())):!1}};function toBounds(e,t){return!e||e instanceof Bounds?e:new Bounds(e,t)}function LatLngBounds(e,t){if(e)for(var n=t?[e,t]:e,s=0,c=n.length;s<c;s++)this.extend(n[s])}LatLngBounds.prototype={extend:function(e){var t=this._southWest,n=this._northEast,s,c;if(e instanceof LatLng)s=e,c=e;else if(e instanceof LatLngBounds){if(s=e._southWest,c=e._northEast,!s||!c)return this}else return e?this.extend(toLatLng(e)||toLatLngBounds(e)):this;return!t&&!n?(this._southWest=new LatLng(s.lat,s.lng),this._northEast=new LatLng(c.lat,c.lng)):(t.lat=Math.min(s.lat,t.lat),t.lng=Math.min(s.lng,t.lng),n.lat=Math.max(c.lat,n.lat),n.lng=Math.max(c.lng,n.lng)),this},pad:function(e){var t=this._southWest,n=this._northEast,s=Math.abs(t.lat-n.lat)*e,c=Math.abs(t.lng-n.lng)*e;return new LatLngBounds(new LatLng(t.lat-s,t.lng-c),new LatLng(n.lat+s,n.lng+c))},getCenter:function(){return new LatLng((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new LatLng(this.getNorth(),this.getWest())},getSouthEast:function(){return new LatLng(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(e){e=typeof e[0]==`number`||e instanceof LatLng||`lat`in e?toLatLng(e):toLatLngBounds(e);var t=this._southWest,n=this._northEast,s,c;return e instanceof LatLngBounds?(s=e.getSouthWest(),c=e.getNorthEast()):s=c=e,s.lat>=t.lat&&c.lat<=n.lat&&s.lng>=t.lng&&c.lng<=n.lng},intersects:function(e){e=toLatLngBounds(e);var t=this._southWest,n=this._northEast,s=e.getSouthWest(),c=e.getNorthEast(),l=c.lat>=t.lat&&s.lat<=n.lat,d=c.lng>=t.lng&&s.lng<=n.lng;return l&&d},overlaps:function(e){e=toLatLngBounds(e);var t=this._southWest,n=this._northEast,s=e.getSouthWest(),c=e.getNorthEast(),l=c.lat>t.lat&&s.lat<n.lat,d=c.lng>t.lng&&s.lng<n.lng;return l&&d},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(`,`)},equals:function(e,t){return e?(e=toLatLngBounds(e),this._southWest.equals(e.getSouthWest(),t)&&this._northEast.equals(e.getNorthEast(),t)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function toLatLngBounds(e,t){return e instanceof LatLngBounds?e:new LatLngBounds(e,t)}function LatLng(e,t,n){if(isNaN(e)||isNaN(t))throw Error(`Invalid LatLng object: (`+e+`, `+t+`)`);this.lat=+e,this.lng=+t,n!==void 0&&(this.alt=+n)}LatLng.prototype={equals:function(e,t){return e?(e=toLatLng(e),Math.max(Math.abs(this.lat-e.lat),Math.abs(this.lng-e.lng))<=(t===void 0?1e-9:t)):!1},toString:function(e){return`LatLng(`+formatNum(this.lat,e)+`, `+formatNum(this.lng,e)+`)`},distanceTo:function(e){return b.distance(this,toLatLng(e))},wrap:function(){return b.wrapLatLng(this)},toBounds:function(e){var t=180*e/40075017,n=t/Math.cos(Math.PI/180*this.lat);return toLatLngBounds([this.lat-t,this.lng-n],[this.lat+t,this.lng+n])},clone:function(){return new LatLng(this.lat,this.lng,this.alt)}};function toLatLng(e,t,n){return e instanceof LatLng?e:l(e)&&typeof e[0]!=`object`?e.length===3?new LatLng(e[0],e[1],e[2]):e.length===2?new LatLng(e[0],e[1]):null:e==null?e:typeof e==`object`&&`lat`in e?new LatLng(e.lat,`lng`in e?e.lng:e.lon,e.alt):t===void 0?null:new LatLng(e,t,n)}var y={latLngToPoint:function(e,t){var n=this.projection.project(e),s=this.scale(t);return this.transformation._transform(n,s)},pointToLatLng:function(e,t){var n=this.scale(t),s=this.transformation.untransform(e,n);return this.projection.unproject(s)},project:function(e){return this.projection.project(e)},unproject:function(e){return this.projection.unproject(e)},scale:function(e){return 256*2**e},zoom:function(e){return Math.log(e/256)/Math.LN2},getProjectedBounds:function(e){if(this.infinite)return null;var t=this.projection.bounds,n=this.scale(e);return new Bounds(this.transformation.transform(t.min,n),this.transformation.transform(t.max,n))},infinite:!1,wrapLatLng:function(e){var t=this.wrapLng?wrapNum(e.lng,this.wrapLng,!0):e.lng,n=this.wrapLat?wrapNum(e.lat,this.wrapLat,!0):e.lat,s=e.alt;return new LatLng(n,t,s)},wrapLatLngBounds:function(e){var t=e.getCenter(),n=this.wrapLatLng(t),s=t.lat-n.lat,c=t.lng-n.lng;if(s===0&&c===0)return e;var l=e.getSouthWest(),d=e.getNorthEast();return new LatLngBounds(new LatLng(l.lat-s,l.lng-c),new LatLng(d.lat-s,d.lng-c))}},b=extend({},y,{wrapLng:[-180,180],R:6371e3,distance:function(e,t){var n=Math.PI/180,s=e.lat*n,c=t.lat*n,l=Math.sin((t.lat-e.lat)*n/2),d=Math.sin((t.lng-e.lng)*n/2),f=l*l+Math.cos(s)*Math.cos(c)*d*d,p=2*Math.atan2(Math.sqrt(f),Math.sqrt(1-f));return this.R*p}}),x=6378137,S={R:x,MAX_LATITUDE:85.0511287798,project:function(e){var t=Math.PI/180,n=this.MAX_LATITUDE,s=Math.max(Math.min(n,e.lat),-n),c=Math.sin(s*t);return new Point(this.R*e.lng*t,this.R*Math.log((1+c)/(1-c))/2)},unproject:function(e){var t=180/Math.PI;return new LatLng((2*Math.atan(Math.exp(e.y/this.R))-Math.PI/2)*t,e.x*t/this.R)},bounds:(function(){var e=x*Math.PI;return new Bounds([-e,-e],[e,e])})()};function Transformation(e,t,n,s){if(l(e)){this._a=e[0],this._b=e[1],this._c=e[2],this._d=e[3];return}this._a=e,this._b=t,this._c=n,this._d=s}Transformation.prototype={transform:function(e,t){return this._transform(e.clone(),t)},_transform:function(e,t){return t||=1,e.x=t*(this._a*e.x+this._b),e.y=t*(this._c*e.y+this._d),e},untransform:function(e,t){return t||=1,new Point((e.x/t-this._b)/this._a,(e.y/t-this._d)/this._c)}};function toTransformation(e,t,n,s){return new Transformation(e,t,n,s)}var C=extend({},b,{code:`EPSG:3857`,projection:S,transformation:function(){var e=.5/(Math.PI*S.R);return toTransformation(e,.5,-e,.5)}()}),T=extend({},C,{code:`EPSG:900913`});function svgCreate(e){return document.createElementNS(`http://www.w3.org/2000/svg`,e)}function pointsToPath(e,t){var n=``,s,c,l,d,f,p;for(s=0,l=e.length;s<l;s++){for(f=e[s],c=0,d=f.length;c<d;c++)p=f[c],n+=(c?`L`:`M`)+p.x+` `+p.y;n+=t?U.svg?`z`:`x`:``}return n||`M0 0`}var E=document.documentElement.style,D=`ActiveXObject`in window,O=D&&!document.addEventListener,k=`msLaunchUri`in navigator&&!(`documentMode`in document),A=userAgentContains(`webkit`),j=userAgentContains(`android`),M=userAgentContains(`android 2`)||userAgentContains(`android 3`),N=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),P=j&&userAgentContains(`Google`)&&N<537&&!(`AudioNode`in window),I=!!window.opera,ee=!k&&userAgentContains(`chrome`),te=userAgentContains(`gecko`)&&!A&&!I&&!D,ne=!ee&&userAgentContains(`safari`),R=userAgentContains(`phantom`),z=`OTransition`in E,B=navigator.platform.indexOf(`Win`)===0,re=D&&`transition`in E,ie=`WebKitCSSMatrix`in window&&`m11`in new window.WebKitCSSMatrix&&!M,ae=`MozPerspective`in E,oe=!window.L_DISABLE_3D&&(re||ie||ae)&&!z&&!R,se=typeof orientation<`u`||userAgentContains(`mobile`),ce=se&&A,le=se&&ie,ue=!window.PointerEvent&&window.MSPointerEvent,de=!!(window.PointerEvent||ue),fe=`ontouchstart`in window||!!window.TouchEvent,pe=!window.L_NO_TOUCH&&(fe||de),V=se&&I,me=se&&te,H=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,he=function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener(`testPassiveEventSupport`,falseFn,t),window.removeEventListener(`testPassiveEventSupport`,falseFn,t)}catch{}return e}(),ge=function(){return!!document.createElement(`canvas`).getContext}(),_e=!!(document.createElementNS&&svgCreate(`svg`).createSVGRect),ve=!!_e&&(function(){var e=document.createElement(`div`);return e.innerHTML=`<svg/>`,(e.firstChild&&e.firstChild.namespaceURI)===`http://www.w3.org/2000/svg`})(),ye=!_e&&function(){try{var e=document.createElement(`div`);e.innerHTML=`<v:shape adj="1"/>`;var t=e.firstChild;return t.style.behavior=`url(#default#VML)`,t&&typeof t.adj==`object`}catch{return!1}}(),be=navigator.platform.indexOf(`Mac`)===0,xe=navigator.platform.indexOf(`Linux`)===0;function userAgentContains(e){return navigator.userAgent.toLowerCase().indexOf(e)>=0}var U={ie:D,ielt9:O,edge:k,webkit:A,android:j,android23:M,androidStock:P,opera:I,chrome:ee,gecko:te,safari:ne,phantom:R,opera12:z,win:B,ie3d:re,webkit3d:ie,gecko3d:ae,any3d:oe,mobile:se,mobileWebkit:ce,mobileWebkit3d:le,msPointer:ue,pointer:de,touch:pe,touchNative:fe,mobileOpera:V,mobileGecko:me,retina:H,passiveEvents:he,canvas:ge,svg:_e,vml:ye,inlineSvg:ve,mac:be,linux:xe},Se=U.msPointer?`MSPointerDown`:`pointerdown`,Ce=U.msPointer?`MSPointerMove`:`pointermove`,we=U.msPointer?`MSPointerUp`:`pointerup`,Te=U.msPointer?`MSPointerCancel`:`pointercancel`,Ee={touchstart:Se,touchmove:Ce,touchend:we,touchcancel:Te},De={touchstart:_onPointerStart,touchmove:_handlePointer,touchend:_handlePointer,touchcancel:_handlePointer},Oe={},ke=!1;function addPointerListener(e,t,n){return t===`touchstart`&&_addPointerDocListener(),De[t]?(n=De[t].bind(this,n),e.addEventListener(Ee[t],n,!1),n):(console.warn(`wrong event specified:`,t),falseFn)}function removePointerListener(e,t,n){if(!Ee[t]){console.warn(`wrong event specified:`,t);return}e.removeEventListener(Ee[t],n,!1)}function _globalPointerDown(e){Oe[e.pointerId]=e}function _globalPointerMove(e){Oe[e.pointerId]&&(Oe[e.pointerId]=e)}function _globalPointerUp(e){delete Oe[e.pointerId]}function _addPointerDocListener(){ke||=(document.addEventListener(Se,_globalPointerDown,!0),document.addEventListener(Ce,_globalPointerMove,!0),document.addEventListener(we,_globalPointerUp,!0),document.addEventListener(Te,_globalPointerUp,!0),!0)}function _handlePointer(e,t){if(t.pointerType!==(t.MSPOINTER_TYPE_MOUSE||`mouse`)){for(var n in t.touches=[],Oe)t.touches.push(Oe[n]);t.changedTouches=[t],e(t)}}function _onPointerStart(e,t){t.MSPOINTER_TYPE_TOUCH&&t.pointerType===t.MSPOINTER_TYPE_TOUCH&&preventDefault(t),_handlePointer(e,t)}function makeDblclick(e){var t={},n,s;for(s in e)n=e[s],t[s]=n&&n.bind?n.bind(e):n;return e=t,t.type=`dblclick`,t.detail=2,t.isTrusted=!1,t._simulated=!0,t}var Ae=200;function addDoubleTapListener(e,t){e.addEventListener(`dblclick`,t);var n=0,s;function simDblclick(e){if(e.detail!==1){s=e.detail;return}if(!(e.pointerType===`mouse`||e.sourceCapabilities&&!e.sourceCapabilities.firesTouchEvents)){var c=getPropagationPath(e);if(!(c.some(function(e){return e instanceof HTMLLabelElement&&e.attributes.for})&&!c.some(function(e){return e instanceof HTMLInputElement||e instanceof HTMLSelectElement}))){var l=Date.now();l-n<=Ae?(s++,s===2&&t(makeDblclick(e))):s=1,n=l}}}return e.addEventListener(`click`,simDblclick),{dblclick:t,simDblclick}}function removeDoubleTapListener(e,t){e.removeEventListener(`dblclick`,t.dblclick),e.removeEventListener(`click`,t.simDblclick)}var je=testProp([`transform`,`webkitTransform`,`OTransform`,`MozTransform`,`msTransform`]),Me=testProp([`webkitTransition`,`transition`,`OTransition`,`MozTransition`,`msTransition`]),Ne=Me===`webkitTransition`||Me===`OTransition`?Me+`End`:`transitionend`;function get(e){return typeof e==`string`?document.getElementById(e):e}function getStyle(e,t){var n=e.style[t]||e.currentStyle&&e.currentStyle[t];if((!n||n===`auto`)&&document.defaultView){var s=document.defaultView.getComputedStyle(e,null);n=s?s[t]:null}return n===`auto`?null:n}function create$1(e,t,n){var s=document.createElement(e);return s.className=t||``,n&&n.appendChild(s),s}function remove(e){var t=e.parentNode;t&&t.removeChild(e)}function empty(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function toFront(e){var t=e.parentNode;t&&t.lastChild!==e&&t.appendChild(e)}function toBack(e){var t=e.parentNode;t&&t.firstChild!==e&&t.insertBefore(e,t.firstChild)}function hasClass(e,t){if(e.classList!==void 0)return e.classList.contains(t);var n=getClass(e);return n.length>0&&RegExp(`(^|\\s)`+t+`(\\s|$)`).test(n)}function addClass(e,t){if(e.classList!==void 0)for(var n=splitWords(t),s=0,c=n.length;s<c;s++)e.classList.add(n[s]);else if(!hasClass(e,t)){var l=getClass(e);setClass(e,(l?l+` `:``)+t)}}function removeClass(e,t){e.classList===void 0?setClass(e,trim((` `+getClass(e)+` `).replace(` `+t+` `,` `))):e.classList.remove(t)}function setClass(e,t){e.className.baseVal===void 0?e.className=t:e.className.baseVal=t}function getClass(e){return e.correspondingElement&&(e=e.correspondingElement),e.className.baseVal===void 0?e.className:e.className.baseVal}function setOpacity(e,t){`opacity`in e.style?e.style.opacity=t:`filter`in e.style&&_setOpacityIE(e,t)}function _setOpacityIE(e,t){var n=!1,s=`DXImageTransform.Microsoft.Alpha`;try{n=e.filters.item(s)}catch{if(t===1)return}t=Math.round(t*100),n?(n.Enabled=t!==100,n.Opacity=t):e.style.filter+=` progid:`+s+`(opacity=`+t+`)`}function testProp(e){for(var t=document.documentElement.style,n=0;n<e.length;n++)if(e[n]in t)return e[n];return!1}function setTransform(e,t,n){var s=t||new Point(0,0);e.style[je]=(U.ie3d?`translate(`+s.x+`px,`+s.y+`px)`:`translate3d(`+s.x+`px,`+s.y+`px,0)`)+(n?` scale(`+n+`)`:``)}function setPosition(e,t){e._leaflet_pos=t,U.any3d?setTransform(e,t):(e.style.left=t.x+`px`,e.style.top=t.y+`px`)}function getPosition(e){return e._leaflet_pos||new Point(0,0)}var disableTextSelection,enableTextSelection,Pe;if(`onselectstart`in document)disableTextSelection=function(){on(window,`selectstart`,preventDefault)},enableTextSelection=function(){off(window,`selectstart`,preventDefault)};else{var Fe=testProp([`userSelect`,`WebkitUserSelect`,`OUserSelect`,`MozUserSelect`,`msUserSelect`]);disableTextSelection=function(){if(Fe){var e=document.documentElement.style;Pe=e[Fe],e[Fe]=`none`}},enableTextSelection=function(){Fe&&(document.documentElement.style[Fe]=Pe,Pe=void 0)}}function disableImageDrag(){on(window,`dragstart`,preventDefault)}function enableImageDrag(){off(window,`dragstart`,preventDefault)}var W,G;function preventOutline(e){for(;e.tabIndex===-1;)e=e.parentNode;e.style&&(restoreOutline(),W=e,G=e.style.outlineStyle,e.style.outlineStyle=`none`,on(window,`keydown`,restoreOutline))}function restoreOutline(){W&&(W.style.outlineStyle=G,W=void 0,G=void 0,off(window,`keydown`,restoreOutline))}function getSizedParentNode(e){do e=e.parentNode;while((!e.offsetWidth||!e.offsetHeight)&&e!==document.body);return e}function getScale(e){var t=e.getBoundingClientRect();return{x:t.width/e.offsetWidth||1,y:t.height/e.offsetHeight||1,boundingClientRect:t}}var K={__proto__:null,TRANSFORM:je,TRANSITION:Me,TRANSITION_END:Ne,get,getStyle,create:create$1,remove,empty,toFront,toBack,hasClass,addClass,removeClass,setClass,getClass,setOpacity,testProp,setTransform,setPosition,getPosition,get disableTextSelection(){return disableTextSelection},get enableTextSelection(){return enableTextSelection},disableImageDrag,enableImageDrag,preventOutline,restoreOutline,getSizedParentNode,getScale};function on(e,t,n,s){if(t&&typeof t==`object`)for(var c in t)addOne(e,c,t[c],n);else{t=splitWords(t);for(var l=0,d=t.length;l<d;l++)addOne(e,t[l],n,s)}return this}var q=`_leaflet_events`;function off(e,t,n,s){if(arguments.length===1)batchRemove(e),delete e[q];else if(t&&typeof t==`object`)for(var c in t)removeOne(e,c,t[c],n);else if(t=splitWords(t),arguments.length===2)batchRemove(e,function(e){return indexOf(t,e)!==-1});else for(var l=0,d=t.length;l<d;l++)removeOne(e,t[l],n,s);return this}function batchRemove(e,t){for(var n in e[q]){var s=n.split(/\d/)[0];(!t||t(s))&&removeOne(e,s,null,null,n)}}var Ie={mouseenter:`mouseover`,mouseleave:`mouseout`,wheel:!(`onwheel`in window)&&`mousewheel`};function addOne(e,t,n,s){var c=t+stamp(n)+(s?`_`+stamp(s):``);if(e[q]&&e[q][c])return this;var handler=function(t){return n.call(s||e,t||window.event)},l=handler;!U.touchNative&&U.pointer&&t.indexOf(`touch`)===0?handler=addPointerListener(e,t,handler):U.touch&&t===`dblclick`?handler=addDoubleTapListener(e,handler):`addEventListener`in e?t===`touchstart`||t===`touchmove`||t===`wheel`||t===`mousewheel`?e.addEventListener(Ie[t]||t,handler,U.passiveEvents?{passive:!1}:!1):t===`mouseenter`||t===`mouseleave`?(handler=function(t){t||=window.event,isExternalTarget(e,t)&&l(t)},e.addEventListener(Ie[t],handler,!1)):e.addEventListener(t,l,!1):e.attachEvent(`on`+t,handler),e[q]=e[q]||{},e[q][c]=handler}function removeOne(e,t,n,s,c){c||=t+stamp(n)+(s?`_`+stamp(s):``);var l=e[q]&&e[q][c];if(!l)return this;!U.touchNative&&U.pointer&&t.indexOf(`touch`)===0?removePointerListener(e,t,l):U.touch&&t===`dblclick`?removeDoubleTapListener(e,l):`removeEventListener`in e?e.removeEventListener(Ie[t]||t,l,!1):e.detachEvent(`on`+t,l),e[q][c]=null}function stopPropagation(e){return e.stopPropagation?e.stopPropagation():e.originalEvent?e.originalEvent._stopped=!0:e.cancelBubble=!0,this}function disableScrollPropagation(e){return addOne(e,`wheel`,stopPropagation),this}function disableClickPropagation(e){return on(e,`mousedown touchstart dblclick contextmenu`,stopPropagation),e._leaflet_disable_click=!0,this}function preventDefault(e){return e.preventDefault?e.preventDefault():e.returnValue=!1,this}function stop(e){return preventDefault(e),stopPropagation(e),this}function getPropagationPath(e){if(e.composedPath)return e.composedPath();for(var t=[],n=e.target;n;)t.push(n),n=n.parentNode;return t}function getMousePosition(e,t){if(!t)return new Point(e.clientX,e.clientY);var n=getScale(t),s=n.boundingClientRect;return new Point((e.clientX-s.left)/n.x-t.clientLeft,(e.clientY-s.top)/n.y-t.clientTop)}var Le=U.linux&&U.chrome?window.devicePixelRatio:U.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function getWheelDelta(e){return U.edge?e.wheelDeltaY/2:e.deltaY&&e.deltaMode===0?-e.deltaY/Le:e.deltaY&&e.deltaMode===1?-e.deltaY*20:e.deltaY&&e.deltaMode===2?-e.deltaY*60:e.deltaX||e.deltaZ?0:e.wheelDelta?(e.wheelDeltaY||e.wheelDelta)/2:e.detail&&Math.abs(e.detail)<32765?-e.detail*20:e.detail?e.detail/-32765*60:0}function isExternalTarget(e,t){var n=t.relatedTarget;if(!n)return!0;try{for(;n&&n!==e;)n=n.parentNode}catch{return!1}return n!==e}var Re={__proto__:null,on,off,stopPropagation,disableScrollPropagation,disableClickPropagation,preventDefault,stop,getPropagationPath,getMousePosition,getWheelDelta,isExternalTarget,addListener:on,removeListener:off},ze=_.extend({run:function(e,t,n,s){this.stop(),this._el=e,this._inProgress=!0,this._duration=n||.25,this._easeOutPower=1/Math.max(s||.5,.2),this._startPos=getPosition(e),this._offset=t.subtract(this._startPos),this._startTime=+new Date,this.fire(`start`),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=requestAnimFrame(this._animate,this),this._step()},_step:function(e){var t=+new Date-this._startTime,n=this._duration*1e3;t<n?this._runFrame(this._easeOut(t/n),e):(this._runFrame(1),this._complete())},_runFrame:function(e,t){var n=this._startPos.add(this._offset.multiplyBy(e));t&&n._round(),setPosition(this._el,n),this.fire(`step`)},_complete:function(){cancelAnimFrame(this._animId),this._inProgress=!1,this.fire(`end`)},_easeOut:function(e){return 1-(1-e)**this._easeOutPower}}),J=_.extend({options:{crs:C,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(e,t){t=setOptions(this,t),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(e),this._initLayout(),this._onResize=bind(this._onResize,this),this._initEvents(),t.maxBounds&&this.setMaxBounds(t.maxBounds),t.zoom!==void 0&&(this._zoom=this._limitZoom(t.zoom)),t.center&&t.zoom!==void 0&&this.setView(toLatLng(t.center),t.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=Me&&U.any3d&&!U.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),on(this._proxy,Ne,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(e,t,n){return t=t===void 0?this._zoom:this._limitZoom(t),e=this._limitCenter(toLatLng(e),t,this.options.maxBounds),n||={},this._stop(),this._loaded&&!n.reset&&n!==!0&&(n.animate!==void 0&&(n.zoom=extend({animate:n.animate},n.zoom),n.pan=extend({animate:n.animate,duration:n.duration},n.pan)),this._zoom===t?this._tryAnimatedPan(e,n.pan):this._tryAnimatedZoom&&this._tryAnimatedZoom(e,t,n.zoom))?(clearTimeout(this._sizeTimer),this):(this._resetView(e,t,n.pan&&n.pan.noMoveStart),this)},setZoom:function(e,t){return this._loaded?this.setView(this.getCenter(),e,{zoom:t}):(this._zoom=e,this)},zoomIn:function(e,t){return e||=U.any3d?this.options.zoomDelta:1,this.setZoom(this._zoom+e,t)},zoomOut:function(e,t){return e||=U.any3d?this.options.zoomDelta:1,this.setZoom(this._zoom-e,t)},setZoomAround:function(e,t,n){var s=this.getZoomScale(t),c=this.getSize().divideBy(2),l=(e instanceof Point?e:this.latLngToContainerPoint(e)).subtract(c).multiplyBy(1-1/s),d=this.containerPointToLatLng(c.add(l));return this.setView(d,t,{zoom:n})},_getBoundsCenterZoom:function(e,t){t||={},e=e.getBounds?e.getBounds():toLatLngBounds(e);var n=toPoint(t.paddingTopLeft||t.padding||[0,0]),s=toPoint(t.paddingBottomRight||t.padding||[0,0]),c=this.getBoundsZoom(e,!1,n.add(s));if(c=typeof t.maxZoom==`number`?Math.min(t.maxZoom,c):c,c===1/0)return{center:e.getCenter(),zoom:c};var l=s.subtract(n).divideBy(2),d=this.project(e.getSouthWest(),c),f=this.project(e.getNorthEast(),c);return{center:this.unproject(d.add(f).divideBy(2).add(l),c),zoom:c}},fitBounds:function(e,t){if(e=toLatLngBounds(e),!e.isValid())throw Error(`Bounds are not valid.`);var n=this._getBoundsCenterZoom(e,t);return this.setView(n.center,n.zoom,t)},fitWorld:function(e){return this.fitBounds([[-90,-180],[90,180]],e)},panTo:function(e,t){return this.setView(e,this._zoom,{pan:t})},panBy:function(e,t){if(e=toPoint(e).round(),t||={},!e.x&&!e.y)return this.fire(`moveend`);if(t.animate!==!0&&!this.getSize().contains(e))return this._resetView(this.unproject(this.project(this.getCenter()).add(e)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new ze,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),t.noMoveStart||this.fire(`movestart`),t.animate!==!1){addClass(this._mapPane,`leaflet-pan-anim`);var n=this._getMapPanePos().subtract(e).round();this._panAnim.run(this._mapPane,n,t.duration||.25,t.easeLinearity)}else this._rawPanBy(e),this.fire(`move`).fire(`moveend`);return this},flyTo:function(e,t,n){if(n||={},n.animate===!1||!U.any3d)return this.setView(e,t,n);this._stop();var s=this.project(this.getCenter()),c=this.project(e),l=this.getSize(),d=this._zoom;e=toLatLng(e),t=t===void 0?d:t;var f=Math.max(l.x,l.y),p=f*this.getZoomScale(d,t),m=c.distanceTo(s)||1,h=1.42,g=h*h;function r(e){var t=e?-1:1,n=e?p:f,s=(p*p-f*f+t*g*g*m*m)/(2*n*g*m),c=Math.sqrt(s*s+1)-s;return c<1e-9?-18:Math.log(c)}function sinh(e){return(Math.exp(e)-Math.exp(-e))/2}function cosh(e){return(Math.exp(e)+Math.exp(-e))/2}function tanh(e){return sinh(e)/cosh(e)}var _=r(0);function w(e){return f*(cosh(_)/cosh(_+h*e))}function u(e){return f*(cosh(_)*tanh(_+h*e)-sinh(_))/g}function easeOut(e){return 1-(1-e)**1.5}var v=Date.now(),y=(r(1)-_)/h,b=n.duration?1e3*n.duration:1e3*y*.8;function frame(){var n=(Date.now()-v)/b,l=easeOut(n)*y;n<=1?(this._flyToFrame=requestAnimFrame(frame,this),this._move(this.unproject(s.add(c.subtract(s).multiplyBy(u(l)/m)),d),this.getScaleZoom(f/w(l),d),{flyTo:!0})):this._move(e,t)._moveEnd(!0)}return this._moveStart(!0,n.noMoveStart),frame.call(this),this},flyToBounds:function(e,t){var n=this._getBoundsCenterZoom(e,t);return this.flyTo(n.center,n.zoom,t)},setMaxBounds:function(e){return e=toLatLngBounds(e),this.listens(`moveend`,this._panInsideMaxBounds)&&this.off(`moveend`,this._panInsideMaxBounds),e.isValid()?(this.options.maxBounds=e,this._loaded&&this._panInsideMaxBounds(),this.on(`moveend`,this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(e){var t=this.options.minZoom;return this.options.minZoom=e,this._loaded&&t!==e&&(this.fire(`zoomlevelschange`),this.getZoom()<this.options.minZoom)?this.setZoom(e):this},setMaxZoom:function(e){var t=this.options.maxZoom;return this.options.maxZoom=e,this._loaded&&t!==e&&(this.fire(`zoomlevelschange`),this.getZoom()>this.options.maxZoom)?this.setZoom(e):this},panInsideBounds:function(e,t){this._enforcingBounds=!0;var n=this.getCenter(),s=this._limitCenter(n,this._zoom,toLatLngBounds(e));return n.equals(s)||this.panTo(s,t),this._enforcingBounds=!1,this},panInside:function(e,t){t||={};var n=toPoint(t.paddingTopLeft||t.padding||[0,0]),s=toPoint(t.paddingBottomRight||t.padding||[0,0]),c=this.project(this.getCenter()),l=this.project(e),d=this.getPixelBounds(),f=toBounds([d.min.add(n),d.max.subtract(s)]),p=f.getSize();if(!f.contains(l)){this._enforcingBounds=!0;var m=l.subtract(f.getCenter()),h=f.extend(l).getSize().subtract(p);c.x+=m.x<0?-h.x:h.x,c.y+=m.y<0?-h.y:h.y,this.panTo(this.unproject(c),t),this._enforcingBounds=!1}return this},invalidateSize:function(e){if(!this._loaded)return this;e=extend({animate:!1,pan:!0},e===!0?{animate:!0}:e);var t=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var n=this.getSize(),s=t.divideBy(2).round(),c=n.divideBy(2).round(),l=s.subtract(c);return!l.x&&!l.y?this:(e.animate&&e.pan?this.panBy(l):(e.pan&&this._rawPanBy(l),this.fire(`move`),e.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(bind(this.fire,this,`moveend`),200)):this.fire(`moveend`)),this.fire(`resize`,{oldSize:t,newSize:n}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire(`viewreset`),this._stop()},locate:function(e){if(e=this._locateOptions=extend({timeout:1e4,watch:!1},e),!(`geolocation`in navigator))return this._handleGeolocationError({code:0,message:`Geolocation not supported.`}),this;var t=bind(this._handleGeolocationResponse,this),n=bind(this._handleGeolocationError,this);return e.watch?this._locationWatchId=navigator.geolocation.watchPosition(t,n,e):navigator.geolocation.getCurrentPosition(t,n,e),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(e){if(this._container._leaflet_id){var t=e.code,n=e.message||(t===1?`permission denied`:t===2?`position unavailable`:`timeout`);this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire(`locationerror`,{code:t,message:`Geolocation error: `+n+`.`})}},_handleGeolocationResponse:function(e){if(this._container._leaflet_id){var t=e.coords.latitude,n=e.coords.longitude,s=new LatLng(t,n),c=s.toBounds(e.coords.accuracy*2),l=this._locateOptions;if(l.setView){var d=this.getBoundsZoom(c);this.setView(s,l.maxZoom?Math.min(d,l.maxZoom):d)}var f={latlng:s,bounds:c,timestamp:e.timestamp};for(var p in e.coords)typeof e.coords[p]==`number`&&(f[p]=e.coords[p]);this.fire(`locationfound`,f)}},addHandler:function(e,t){if(!t)return this;var n=this[e]=new t(this);return this._handlers.push(n),this.options[e]&&n.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off(`moveend`,this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw Error(`Map container is being reused by another instance`);try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}for(var e in this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),remove(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&=(cancelAnimFrame(this._resizeRequest),null),this._clearHandlers(),this._loaded&&this.fire(`unload`),this._layers)this._layers[e].remove();for(e in this._panes)remove(this._panes[e]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(e,t){var n=create$1(`div`,`leaflet-pane`+(e?` leaflet-`+e.replace(`Pane`,``)+`-pane`:``),t||this._mapPane);return e&&(this._panes[e]=n),n},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var e=this.getPixelBounds();return new LatLngBounds(this.unproject(e.getBottomLeft()),this.unproject(e.getTopRight()))},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(e,t,n){e=toLatLngBounds(e),n=toPoint(n||[0,0]);var s=this.getZoom()||0,c=this.getMinZoom(),l=this.getMaxZoom(),d=e.getNorthWest(),f=e.getSouthEast(),p=this.getSize().subtract(n),m=toBounds(this.project(f,s),this.project(d,s)).getSize(),h=U.any3d?this.options.zoomSnap:1,g=p.x/m.x,_=p.y/m.y,v=t?Math.max(g,_):Math.min(g,_);return s=this.getScaleZoom(v,s),h&&(s=Math.round(s/(h/100))*(h/100),s=t?Math.ceil(s/h)*h:Math.floor(s/h)*h),Math.max(c,Math.min(l,s))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new Point(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(e,t){var n=this._getTopLeftPoint(e,t);return new Bounds(n,n.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(e){return this.options.crs.getProjectedBounds(e===void 0?this.getZoom():e)},getPane:function(e){return typeof e==`string`?this._panes[e]:e},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(e,t){var n=this.options.crs;return t=t===void 0?this._zoom:t,n.scale(e)/n.scale(t)},getScaleZoom:function(e,t){var n=this.options.crs;t=t===void 0?this._zoom:t;var s=n.zoom(e*n.scale(t));return isNaN(s)?1/0:s},project:function(e,t){return t=t===void 0?this._zoom:t,this.options.crs.latLngToPoint(toLatLng(e),t)},unproject:function(e,t){return t=t===void 0?this._zoom:t,this.options.crs.pointToLatLng(toPoint(e),t)},layerPointToLatLng:function(e){var t=toPoint(e).add(this.getPixelOrigin());return this.unproject(t)},latLngToLayerPoint:function(e){return this.project(toLatLng(e))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(e){return this.options.crs.wrapLatLng(toLatLng(e))},wrapLatLngBounds:function(e){return this.options.crs.wrapLatLngBounds(toLatLngBounds(e))},distance:function(e,t){return this.options.crs.distance(toLatLng(e),toLatLng(t))},containerPointToLayerPoint:function(e){return toPoint(e).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(e){return toPoint(e).add(this._getMapPanePos())},containerPointToLatLng:function(e){var t=this.containerPointToLayerPoint(toPoint(e));return this.layerPointToLatLng(t)},latLngToContainerPoint:function(e){return this.layerPointToContainerPoint(this.latLngToLayerPoint(toLatLng(e)))},mouseEventToContainerPoint:function(e){return getMousePosition(e,this._container)},mouseEventToLayerPoint:function(e){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(e))},mouseEventToLatLng:function(e){return this.layerPointToLatLng(this.mouseEventToLayerPoint(e))},_initContainer:function(e){var t=this._container=get(e);if(!t)throw Error(`Map container not found.`);if(t._leaflet_id)throw Error(`Map container is already initialized.`);on(t,`scroll`,this._onScroll,this),this._containerId=stamp(t)},_initLayout:function(){var e=this._container;this._fadeAnimated=this.options.fadeAnimation&&U.any3d,addClass(e,`leaflet-container`+(U.touch?` leaflet-touch`:``)+(U.retina?` leaflet-retina`:``)+(U.ielt9?` leaflet-oldie`:``)+(U.safari?` leaflet-safari`:``)+(this._fadeAnimated?` leaflet-fade-anim`:``));var t=getStyle(e,`position`);t!==`absolute`&&t!==`relative`&&t!==`fixed`&&t!==`sticky`&&(e.style.position=`relative`),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var e=this._panes={};this._paneRenderers={},this._mapPane=this.createPane(`mapPane`,this._container),setPosition(this._mapPane,new Point(0,0)),this.createPane(`tilePane`),this.createPane(`overlayPane`),this.createPane(`shadowPane`),this.createPane(`markerPane`),this.createPane(`tooltipPane`),this.createPane(`popupPane`),this.options.markerZoomAnimation||(addClass(e.markerPane,`leaflet-zoom-hide`),addClass(e.shadowPane,`leaflet-zoom-hide`))},_resetView:function(e,t,n){setPosition(this._mapPane,new Point(0,0));var s=!this._loaded;this._loaded=!0,t=this._limitZoom(t),this.fire(`viewprereset`);var c=this._zoom!==t;this._moveStart(c,n)._move(e,t)._moveEnd(c),this.fire(`viewreset`),s&&this.fire(`load`)},_moveStart:function(e,t){return e&&this.fire(`zoomstart`),t||this.fire(`movestart`),this},_move:function(e,t,n,s){t===void 0&&(t=this._zoom);var c=this._zoom!==t;return this._zoom=t,this._lastCenter=e,this._pixelOrigin=this._getNewPixelOrigin(e),s?n&&n.pinch&&this.fire(`zoom`,n):((c||n&&n.pinch)&&this.fire(`zoom`,n),this.fire(`move`,n)),this},_moveEnd:function(e){return e&&this.fire(`zoomend`),this.fire(`moveend`)},_stop:function(){return cancelAnimFrame(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(e){setPosition(this._mapPane,this._getMapPanePos().subtract(e))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw Error(`Set map center and zoom first.`)},_initEvents:function(e){this._targets={},this._targets[stamp(this._container)]=this;var t=e?off:on;t(this._container,`click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup`,this._handleDOMEvent,this),this.options.trackResize&&t(window,`resize`,this._onResize,this),U.any3d&&this.options.transform3DLimit&&(e?this.off:this.on).call(this,`moveend`,this._onMoveEnd)},_onResize:function(){cancelAnimFrame(this._resizeRequest),this._resizeRequest=requestAnimFrame(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var e=this._getMapPanePos();Math.max(Math.abs(e.x),Math.abs(e.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(e,t){for(var n=[],s,c=t===`mouseout`||t===`mouseover`,l=e.target||e.srcElement,d=!1;l;){if(s=this._targets[stamp(l)],s&&(t===`click`||t===`preclick`)&&this._draggableMoved(s)){d=!0;break}if(s&&s.listens(t,!0)&&(c&&!isExternalTarget(l,e)||(n.push(s),c))||l===this._container)break;l=l.parentNode}return!n.length&&!d&&!c&&this.listens(t,!0)&&(n=[this]),n},_isClickDisabled:function(e){for(;e&&e!==this._container;){if(e._leaflet_disable_click)return!0;e=e.parentNode}},_handleDOMEvent:function(e){var t=e.target||e.srcElement;if(!(!this._loaded||t._leaflet_disable_events||e.type===`click`&&this._isClickDisabled(t))){var n=e.type;n===`mousedown`&&preventOutline(t),this._fireDOMEvent(e,n)}},_mouseEvents:[`click`,`dblclick`,`mouseover`,`mouseout`,`contextmenu`],_fireDOMEvent:function(e,t,n){if(e.type===`click`){var s=extend({},e);s.type=`preclick`,this._fireDOMEvent(s,s.type,n)}var c=this._findEventTargets(e,t);if(n){for(var l=[],d=0;d<n.length;d++)n[d].listens(t,!0)&&l.push(n[d]);c=l.concat(c)}if(c.length){t===`contextmenu`&&preventDefault(e);var f=c[0],p={originalEvent:e};if(e.type!==`keypress`&&e.type!==`keydown`&&e.type!==`keyup`){var m=f.getLatLng&&(!f._radius||f._radius<=10);p.containerPoint=m?this.latLngToContainerPoint(f.getLatLng()):this.mouseEventToContainerPoint(e),p.layerPoint=this.containerPointToLayerPoint(p.containerPoint),p.latlng=m?f.getLatLng():this.layerPointToLatLng(p.layerPoint)}for(d=0;d<c.length;d++)if(c[d].fire(t,p,!0),p.originalEvent._stopped||c[d].options.bubblingMouseEvents===!1&&indexOf(this._mouseEvents,t)!==-1)return}},_draggableMoved:function(e){return e=e.dragging&&e.dragging.enabled()?e:this,e.dragging&&e.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var e=0,t=this._handlers.length;e<t;e++)this._handlers[e].disable()},whenReady:function(e,t){return this._loaded?e.call(t||this,{target:this}):this.on(`load`,e,t),this},_getMapPanePos:function(){return getPosition(this._mapPane)||new Point(0,0)},_moved:function(){var e=this._getMapPanePos();return e&&!e.equals([0,0])},_getTopLeftPoint:function(e,t){return(e&&t!==void 0?this._getNewPixelOrigin(e,t):this.getPixelOrigin()).subtract(this._getMapPanePos())},_getNewPixelOrigin:function(e,t){var n=this.getSize()._divideBy(2);return this.project(e,t)._subtract(n)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(e,t,n){var s=this._getNewPixelOrigin(n,t);return this.project(e,t)._subtract(s)},_latLngBoundsToNewLayerBounds:function(e,t,n){var s=this._getNewPixelOrigin(n,t);return toBounds([this.project(e.getSouthWest(),t)._subtract(s),this.project(e.getNorthWest(),t)._subtract(s),this.project(e.getSouthEast(),t)._subtract(s),this.project(e.getNorthEast(),t)._subtract(s)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(e){return this.latLngToLayerPoint(e).subtract(this._getCenterLayerPoint())},_limitCenter:function(e,t,n){if(!n)return e;var s=this.project(e,t),c=this.getSize().divideBy(2),l=new Bounds(s.subtract(c),s.add(c)),d=this._getBoundsOffset(l,n,t);return Math.abs(d.x)<=1&&Math.abs(d.y)<=1?e:this.unproject(s.add(d),t)},_limitOffset:function(e,t){if(!t)return e;var n=this.getPixelBounds(),s=new Bounds(n.min.add(e),n.max.add(e));return e.add(this._getBoundsOffset(s,t))},_getBoundsOffset:function(e,t,n){var s=toBounds(this.project(t.getNorthEast(),n),this.project(t.getSouthWest(),n)),c=s.min.subtract(e.min),l=s.max.subtract(e.max);return new Point(this._rebound(c.x,-l.x),this._rebound(c.y,-l.y))},_rebound:function(e,t){return e+t>0?Math.round(e-t)/2:Math.max(0,Math.ceil(e))-Math.max(0,Math.floor(t))},_limitZoom:function(e){var t=this.getMinZoom(),n=this.getMaxZoom(),s=U.any3d?this.options.zoomSnap:1;return s&&(e=Math.round(e/s)*s),Math.max(t,Math.min(n,e))},_onPanTransitionStep:function(){this.fire(`move`)},_onPanTransitionEnd:function(){removeClass(this._mapPane,`leaflet-pan-anim`),this.fire(`moveend`)},_tryAnimatedPan:function(e,t){var n=this._getCenterOffset(e)._trunc();return(t&&t.animate)!==!0&&!this.getSize().contains(n)?!1:(this.panBy(n,t),!0)},_createAnimProxy:function(){var e=this._proxy=create$1(`div`,`leaflet-proxy leaflet-zoom-animated`);this._panes.mapPane.appendChild(e),this.on(`zoomanim`,function(e){var t=je,n=this._proxy.style[t];setTransform(this._proxy,this.project(e.center,e.zoom),this.getZoomScale(e.zoom,1)),n===this._proxy.style[t]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on(`load moveend`,this._animMoveEnd,this),this._on(`unload`,this._destroyAnimProxy,this)},_destroyAnimProxy:function(){remove(this._proxy),this.off(`load moveend`,this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var e=this.getCenter(),t=this.getZoom();setTransform(this._proxy,this.project(e,t),this.getZoomScale(t,1))},_catchTransitionEnd:function(e){this._animatingZoom&&e.propertyName.indexOf(`transform`)>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName(`leaflet-zoom-animated`).length},_tryAnimatedZoom:function(e,t,n){if(this._animatingZoom)return!0;if(n||={},!this._zoomAnimated||n.animate===!1||this._nothingToAnimate()||Math.abs(t-this._zoom)>this.options.zoomAnimationThreshold)return!1;var s=this.getZoomScale(t),c=this._getCenterOffset(e)._divideBy(1-1/s);return n.animate!==!0&&!this.getSize().contains(c)?!1:(requestAnimFrame(function(){this._moveStart(!0,n.noMoveStart||!1)._animateZoom(e,t,!0)},this),!0)},_animateZoom:function(e,t,n,s){this._mapPane&&(n&&(this._animatingZoom=!0,this._animateToCenter=e,this._animateToZoom=t,addClass(this._mapPane,`leaflet-zoom-anim`)),this.fire(`zoomanim`,{center:e,zoom:t,noUpdate:s}),this._tempFireZoomEvent||=this._zoom!==this._animateToZoom,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(bind(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&removeClass(this._mapPane,`leaflet-zoom-anim`),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire(`zoom`),delete this._tempFireZoomEvent,this.fire(`move`),this._moveEnd(!0))}});function createMap(e,t){return new J(e,t)}var Be=Class.extend({options:{position:`topright`},initialize:function(e){setOptions(this,e)},getPosition:function(){return this.options.position},setPosition:function(e){var t=this._map;return t&&t.removeControl(this),this.options.position=e,t&&t.addControl(this),this},getContainer:function(){return this._container},addTo:function(e){this.remove(),this._map=e;var t=this._container=this.onAdd(e),n=this.getPosition(),s=e._controlCorners[n];return addClass(t,`leaflet-control`),n.indexOf(`bottom`)===-1?s.appendChild(t):s.insertBefore(t,s.firstChild),this._map.on(`unload`,this.remove,this),this},remove:function(){return this._map?(remove(this._container),this.onRemove&&this.onRemove(this._map),this._map.off(`unload`,this.remove,this),this._map=null,this):this},_refocusOnMap:function(e){this._map&&e&&e.screenX>0&&e.screenY>0&&this._map.getContainer().focus()}}),control=function(e){return new Be(e)};J.include({addControl:function(e){return e.addTo(this),this},removeControl:function(e){return e.remove(),this},_initControlPos:function(){var e=this._controlCorners={},t=`leaflet-`,n=this._controlContainer=create$1(`div`,t+`control-container`,this._container);function createCorner(s,c){var l=t+s+` `+t+c;e[s+c]=create$1(`div`,l,n)}createCorner(`top`,`left`),createCorner(`top`,`right`),createCorner(`bottom`,`left`),createCorner(`bottom`,`right`)},_clearControlPos:function(){for(var e in this._controlCorners)remove(this._controlCorners[e]);remove(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Ve=Be.extend({options:{collapsed:!0,position:`topright`,autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(e,t,n,s){return n<s?-1:+(s<n)}},initialize:function(e,t,n){for(var s in setOptions(this,n),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1,e)this._addLayer(e[s],s);for(s in t)this._addLayer(t[s],s,!0)},onAdd:function(e){this._initLayout(),this._update(),this._map=e,e.on(`zoomend`,this._checkDisabledLayers,this);for(var t=0;t<this._layers.length;t++)this._layers[t].layer.on(`add remove`,this._onLayerChange,this);return this._container},addTo:function(e){return Be.prototype.addTo.call(this,e),this._expandIfNotCollapsed()},onRemove:function(){this._map.off(`zoomend`,this._checkDisabledLayers,this);for(var e=0;e<this._layers.length;e++)this._layers[e].layer.off(`add remove`,this._onLayerChange,this)},addBaseLayer:function(e,t){return this._addLayer(e,t),this._map?this._update():this},addOverlay:function(e,t){return this._addLayer(e,t,!0),this._map?this._update():this},removeLayer:function(e){e.off(`add remove`,this._onLayerChange,this);var t=this._getLayer(stamp(e));return t&&this._layers.splice(this._layers.indexOf(t),1),this._map?this._update():this},expand:function(){addClass(this._container,`leaflet-control-layers-expanded`),this._section.style.height=null;var e=this._map.getSize().y-(this._container.offsetTop+50);return e<this._section.clientHeight?(addClass(this._section,`leaflet-control-layers-scrollbar`),this._section.style.height=e+`px`):removeClass(this._section,`leaflet-control-layers-scrollbar`),this._checkDisabledLayers(),this},collapse:function(){return removeClass(this._container,`leaflet-control-layers-expanded`),this},_initLayout:function(){var e=`leaflet-control-layers`,t=this._container=create$1(`div`,e),n=this.options.collapsed;t.setAttribute(`aria-haspopup`,!0),disableClickPropagation(t),disableScrollPropagation(t);var s=this._section=create$1(`section`,e+`-list`);n&&(this._map.on(`click`,this.collapse,this),on(t,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var c=this._layersLink=create$1(`a`,e+`-toggle`,t);c.href=`#`,c.title=`Layers`,c.setAttribute(`role`,`button`),on(c,{keydown:function(e){e.keyCode===13&&this._expandSafely()},click:function(e){preventDefault(e),this._expandSafely()}},this),n||this.expand(),this._baseLayersList=create$1(`div`,e+`-base`,s),this._separator=create$1(`div`,e+`-separator`,s),this._overlaysList=create$1(`div`,e+`-overlays`,s),t.appendChild(s)},_getLayer:function(e){for(var t=0;t<this._layers.length;t++)if(this._layers[t]&&stamp(this._layers[t].layer)===e)return this._layers[t]},_addLayer:function(e,t,n){this._map&&e.on(`add remove`,this._onLayerChange,this),this._layers.push({layer:e,name:t,overlay:n}),this.options.sortLayers&&this._layers.sort(bind(function(e,t){return this.options.sortFunction(e.layer,t.layer,e.name,t.name)},this)),this.options.autoZIndex&&e.setZIndex&&(this._lastZIndex++,e.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;empty(this._baseLayersList),empty(this._overlaysList),this._layerControlInputs=[];var e,t,n,s,c=0;for(n=0;n<this._layers.length;n++)s=this._layers[n],this._addItem(s),t||=s.overlay,e||=!s.overlay,c+=+!s.overlay;return this.options.hideSingleBase&&(e&&=c>1,this._baseLayersList.style.display=e?``:`none`),this._separator.style.display=t&&e?``:`none`,this},_onLayerChange:function(e){this._handlingClick||this._update();var t=this._getLayer(stamp(e.target)),n=t.overlay?e.type===`add`?`overlayadd`:`overlayremove`:e.type===`add`?`baselayerchange`:null;n&&this._map.fire(n,t)},_createRadioElement:function(e,t){var n=`<input type="radio" class="leaflet-control-layers-selector" name="`+e+`"`+(t?` checked="checked"`:``)+`/>`,s=document.createElement(`div`);return s.innerHTML=n,s.firstChild},_addItem:function(e){var t=document.createElement(`label`),n=this._map.hasLayer(e.layer),s;e.overlay?(s=document.createElement(`input`),s.type=`checkbox`,s.className=`leaflet-control-layers-selector`,s.defaultChecked=n):s=this._createRadioElement(`leaflet-base-layers_`+stamp(this),n),this._layerControlInputs.push(s),s.layerId=stamp(e.layer),on(s,`click`,this._onInputClick,this);var c=document.createElement(`span`);c.innerHTML=` `+e.name;var l=document.createElement(`span`);return t.appendChild(l),l.appendChild(s),l.appendChild(c),(e.overlay?this._overlaysList:this._baseLayersList).appendChild(t),this._checkDisabledLayers(),t},_onInputClick:function(){if(!this._preventClick){var e=this._layerControlInputs,t,n,s=[],c=[];this._handlingClick=!0;for(var l=e.length-1;l>=0;l--)t=e[l],n=this._getLayer(t.layerId).layer,t.checked?s.push(n):t.checked||c.push(n);for(l=0;l<c.length;l++)this._map.hasLayer(c[l])&&this._map.removeLayer(c[l]);for(l=0;l<s.length;l++)this._map.hasLayer(s[l])||this._map.addLayer(s[l]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var e=this._layerControlInputs,t,n,s=this._map.getZoom(),c=e.length-1;c>=0;c--)t=e[c],n=this._getLayer(t.layerId).layer,t.disabled=n.options.minZoom!==void 0&&s<n.options.minZoom||n.options.maxZoom!==void 0&&s>n.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var e=this._section;this._preventClick=!0,on(e,`click`,preventDefault),this.expand();var t=this;setTimeout(function(){off(e,`click`,preventDefault),t._preventClick=!1})}}),layers=function(e,t,n){return new Ve(e,t,n)},He=Be.extend({options:{position:`topleft`,zoomInText:`<span aria-hidden="true">+</span>`,zoomInTitle:`Zoom in`,zoomOutText:`<span aria-hidden="true">&#x2212;</span>`,zoomOutTitle:`Zoom out`},onAdd:function(e){var t=`leaflet-control-zoom`,n=create$1(`div`,t+` leaflet-bar`),s=this.options;return this._zoomInButton=this._createButton(s.zoomInText,s.zoomInTitle,t+`-in`,n,this._zoomIn),this._zoomOutButton=this._createButton(s.zoomOutText,s.zoomOutTitle,t+`-out`,n,this._zoomOut),this._updateDisabled(),e.on(`zoomend zoomlevelschange`,this._updateDisabled,this),n},onRemove:function(e){e.off(`zoomend zoomlevelschange`,this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(e){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(e.shiftKey?3:1))},_zoomOut:function(e){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(e.shiftKey?3:1))},_createButton:function(e,t,n,s,c){var l=create$1(`a`,n,s);return l.innerHTML=e,l.href=`#`,l.title=t,l.setAttribute(`role`,`button`),l.setAttribute(`aria-label`,t),disableClickPropagation(l),on(l,`click`,stop),on(l,`click`,c,this),on(l,`click`,this._refocusOnMap,this),l},_updateDisabled:function(){var e=this._map,t=`leaflet-disabled`;removeClass(this._zoomInButton,t),removeClass(this._zoomOutButton,t),this._zoomInButton.setAttribute(`aria-disabled`,`false`),this._zoomOutButton.setAttribute(`aria-disabled`,`false`),(this._disabled||e._zoom===e.getMinZoom())&&(addClass(this._zoomOutButton,t),this._zoomOutButton.setAttribute(`aria-disabled`,`true`)),(this._disabled||e._zoom===e.getMaxZoom())&&(addClass(this._zoomInButton,t),this._zoomInButton.setAttribute(`aria-disabled`,`true`))}});J.mergeOptions({zoomControl:!0}),J.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new He,this.addControl(this.zoomControl))});var zoom=function(e){return new He(e)},Ue=Be.extend({options:{position:`bottomleft`,maxWidth:100,metric:!0,imperial:!0},onAdd:function(e){var t=`leaflet-control-scale`,n=create$1(`div`,t),s=this.options;return this._addScales(s,t+`-line`,n),e.on(s.updateWhenIdle?`moveend`:`move`,this._update,this),e.whenReady(this._update,this),n},onRemove:function(e){e.off(this.options.updateWhenIdle?`moveend`:`move`,this._update,this)},_addScales:function(e,t,n){e.metric&&(this._mScale=create$1(`div`,t,n)),e.imperial&&(this._iScale=create$1(`div`,t,n))},_update:function(){var e=this._map,t=e.getSize().y/2,n=e.distance(e.containerPointToLatLng([0,t]),e.containerPointToLatLng([this.options.maxWidth,t]));this._updateScales(n)},_updateScales:function(e){this.options.metric&&e&&this._updateMetric(e),this.options.imperial&&e&&this._updateImperial(e)},_updateMetric:function(e){var t=this._getRoundNum(e),n=t<1e3?t+` m`:t/1e3+` km`;this._updateScale(this._mScale,n,t/e)},_updateImperial:function(e){var t=e*3.2808399,n,s,c;t>5280?(n=t/5280,s=this._getRoundNum(n),this._updateScale(this._iScale,s+` mi`,s/n)):(c=this._getRoundNum(t),this._updateScale(this._iScale,c+` ft`,c/t))},_updateScale:function(e,t,n){e.style.width=Math.round(this.options.maxWidth*n)+`px`,e.innerHTML=t},_getRoundNum:function(e){var t=10**((Math.floor(e)+``).length-1),n=e/t;return n=n>=10?10:n>=5?5:n>=3?3:n>=2?2:1,t*n}}),scale=function(e){return new Ue(e)},We=Be.extend({options:{position:`bottomright`,prefix:`<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">`+(U.inlineSvg?`<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg> `:``)+`Leaflet</a>`},initialize:function(e){setOptions(this,e),this._attributions={}},onAdd:function(e){for(var t in e.attributionControl=this,this._container=create$1(`div`,`leaflet-control-attribution`),disableClickPropagation(this._container),e._layers)e._layers[t].getAttribution&&this.addAttribution(e._layers[t].getAttribution());return this._update(),e.on(`layeradd`,this._addAttribution,this),this._container},onRemove:function(e){e.off(`layeradd`,this._addAttribution,this)},_addAttribution:function(e){e.layer.getAttribution&&(this.addAttribution(e.layer.getAttribution()),e.layer.once(`remove`,function(){this.removeAttribution(e.layer.getAttribution())},this))},setPrefix:function(e){return this.options.prefix=e,this._update(),this},addAttribution:function(e){return e?(this._attributions[e]||(this._attributions[e]=0),this._attributions[e]++,this._update(),this):this},removeAttribution:function(e){return e&&this._attributions[e]&&(this._attributions[e]--,this._update()),this},_update:function(){if(this._map){var e=[];for(var t in this._attributions)this._attributions[t]&&e.push(t);var n=[];this.options.prefix&&n.push(this.options.prefix),e.length&&n.push(e.join(`, `)),this._container.innerHTML=n.join(` <span aria-hidden="true">|</span> `)}}});J.mergeOptions({attributionControl:!0}),J.addInitHook(function(){this.options.attributionControl&&new We().addTo(this)});var attribution=function(e){return new We(e)};Be.Layers=Ve,Be.Zoom=He,Be.Scale=Ue,Be.Attribution=We,control.layers=layers,control.zoom=zoom,control.scale=scale,control.attribution=attribution;var Ge=Class.extend({initialize:function(e){this._map=e},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});Ge.addTo=function(e,t){return e.addHandler(t,this),this};var Ke={Events:g},qe=U.touch?`touchstart mousedown`:`mousedown`,Je=_.extend({options:{clickTolerance:3},initialize:function(e,t,n,s){setOptions(this,s),this._element=e,this._dragStartTarget=t||e,this._preventOutline=n},enable:function(){this._enabled||=(on(this._dragStartTarget,qe,this._onDown,this),!0)},disable:function(){this._enabled&&(Je._dragging===this&&this.finishDrag(!0),off(this._dragStartTarget,qe,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(e){if(this._enabled&&(this._moved=!1,!hasClass(this._element,`leaflet-zoom-anim`))){if(e.touches&&e.touches.length!==1){Je._dragging===this&&this.finishDrag();return}if(!(Je._dragging||e.shiftKey||e.which!==1&&e.button!==1&&!e.touches)&&(Je._dragging=this,this._preventOutline&&preventOutline(this._element),disableImageDrag(),disableTextSelection(),!this._moving)){this.fire(`down`);var t=e.touches?e.touches[0]:e,n=getSizedParentNode(this._element);this._startPoint=new Point(t.clientX,t.clientY),this._startPos=getPosition(this._element),this._parentScale=getScale(n);var s=e.type===`mousedown`;on(document,s?`mousemove`:`touchmove`,this._onMove,this),on(document,s?`mouseup`:`touchend touchcancel`,this._onUp,this)}}},_onMove:function(e){if(this._enabled){if(e.touches&&e.touches.length>1){this._moved=!0;return}var t=e.touches&&e.touches.length===1?e.touches[0]:e,n=new Point(t.clientX,t.clientY)._subtract(this._startPoint);!n.x&&!n.y||Math.abs(n.x)+Math.abs(n.y)<this.options.clickTolerance||(n.x/=this._parentScale.x,n.y/=this._parentScale.y,preventDefault(e),this._moved||(this.fire(`dragstart`),this._moved=!0,addClass(document.body,`leaflet-dragging`),this._lastTarget=e.target||e.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),addClass(this._lastTarget,`leaflet-drag-target`)),this._newPos=this._startPos.add(n),this._moving=!0,this._lastEvent=e,this._updatePosition())}},_updatePosition:function(){var e={originalEvent:this._lastEvent};this.fire(`predrag`,e),setPosition(this._element,this._newPos),this.fire(`drag`,e)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(e){removeClass(document.body,`leaflet-dragging`),this._lastTarget&&=(removeClass(this._lastTarget,`leaflet-drag-target`),null),off(document,`mousemove touchmove`,this._onMove,this),off(document,`mouseup touchend touchcancel`,this._onUp,this),enableImageDrag(),enableTextSelection();var t=this._moved&&this._moving;this._moving=!1,Je._dragging=!1,t&&this.fire(`dragend`,{noInertia:e,distance:this._newPos.distanceTo(this._startPos)})}});function clipPolygon(e,t,n){var s,c=[1,4,2,8],l,d,f,p,m,h,g,_;for(l=0,h=e.length;l<h;l++)e[l]._code=_getBitCode(e[l],t);for(f=0;f<4;f++){for(g=c[f],s=[],l=0,h=e.length,d=h-1;l<h;d=l++)p=e[l],m=e[d],p._code&g?m._code&g||(_=_getEdgeIntersection(m,p,g,t,n),_._code=_getBitCode(_,t),s.push(_)):(m._code&g&&(_=_getEdgeIntersection(m,p,g,t,n),_._code=_getBitCode(_,t),s.push(_)),s.push(p));e=s}return e}function polygonCenter(e,t){var n,s,c,l,d,f,p,m,h;if(!e||e.length===0)throw Error(`latlngs not passed`);isFlat(e)||(console.warn(`latlngs are not flat! Only the first ring will be used`),e=e[0]);var g=toLatLng([0,0]),_=toLatLngBounds(e);_.getNorthWest().distanceTo(_.getSouthWest())*_.getNorthEast().distanceTo(_.getNorthWest())<1700&&(g=centroid(e));var v=e.length,y=[];for(n=0;n<v;n++){var b=toLatLng(e[n]);y.push(t.project(toLatLng([b.lat-g.lat,b.lng-g.lng])))}for(f=p=m=0,n=0,s=v-1;n<v;s=n++)c=y[n],l=y[s],d=c.y*l.x-l.y*c.x,p+=(c.x+l.x)*d,m+=(c.y+l.y)*d,f+=d*3;h=f===0?y[0]:[p/f,m/f];var x=t.unproject(toPoint(h));return toLatLng([x.lat+g.lat,x.lng+g.lng])}function centroid(e){for(var t=0,n=0,s=0,c=0;c<e.length;c++){var l=toLatLng(e[c]);t+=l.lat,n+=l.lng,s++}return toLatLng([t/s,n/s])}var Ye={__proto__:null,clipPolygon,polygonCenter,centroid};function simplify(e,t){if(!t||!e.length)return e.slice();var n=t*t;return e=_reducePoints(e,n),e=_simplifyDP(e,n),e}function pointToSegmentDistance(e,t,n){return Math.sqrt(_sqClosestPointOnSegment(e,t,n,!0))}function closestPointOnSegment(e,t,n){return _sqClosestPointOnSegment(e,t,n)}function _simplifyDP(e,t){var n=e.length,s=new(typeof Uint8Array<`u`?Uint8Array:Array)(n);s[0]=s[n-1]=1,_simplifyDPStep(e,s,t,0,n-1);var c,l=[];for(c=0;c<n;c++)s[c]&&l.push(e[c]);return l}function _simplifyDPStep(e,t,n,s,c){var l=0,d,f,p;for(f=s+1;f<=c-1;f++)p=_sqClosestPointOnSegment(e[f],e[s],e[c],!0),p>l&&(d=f,l=p);l>n&&(t[d]=1,_simplifyDPStep(e,t,n,s,d),_simplifyDPStep(e,t,n,d,c))}function _reducePoints(e,t){for(var n=[e[0]],s=1,c=0,l=e.length;s<l;s++)_sqDist(e[s],e[c])>t&&(n.push(e[s]),c=s);return c<l-1&&n.push(e[l-1]),n}var Xe;function clipSegment(e,t,n,s,c){var l=s?Xe:_getBitCode(e,n),d=_getBitCode(t,n),f,p,m;for(Xe=d;;){if(!(l|d))return[e,t];if(l&d)return!1;f=l||d,p=_getEdgeIntersection(e,t,f,n,c),m=_getBitCode(p,n),f===l?(e=p,l=m):(t=p,d=m)}}function _getEdgeIntersection(e,t,n,s,c){var l=t.x-e.x,d=t.y-e.y,f=s.min,p=s.max,m,h;return n&8?(m=e.x+l*(p.y-e.y)/d,h=p.y):n&4?(m=e.x+l*(f.y-e.y)/d,h=f.y):n&2?(m=p.x,h=e.y+d*(p.x-e.x)/l):n&1&&(m=f.x,h=e.y+d*(f.x-e.x)/l),new Point(m,h,c)}function _getBitCode(e,t){var n=0;return e.x<t.min.x?n|=1:e.x>t.max.x&&(n|=2),e.y<t.min.y?n|=4:e.y>t.max.y&&(n|=8),n}function _sqDist(e,t){var n=t.x-e.x,s=t.y-e.y;return n*n+s*s}function _sqClosestPointOnSegment(e,t,n,s){var c=t.x,l=t.y,d=n.x-c,f=n.y-l,p=d*d+f*f,m;return p>0&&(m=((e.x-c)*d+(e.y-l)*f)/p,m>1?(c=n.x,l=n.y):m>0&&(c+=d*m,l+=f*m)),d=e.x-c,f=e.y-l,s?d*d+f*f:new Point(c,l)}function isFlat(e){return!l(e[0])||typeof e[0][0]!=`object`&&e[0][0]!==void 0}function _flat(e){return console.warn(`Deprecated use of _flat, please use L.LineUtil.isFlat instead.`),isFlat(e)}function polylineCenter(e,t){var n,s,c,l,d,f,p,m;if(!e||e.length===0)throw Error(`latlngs not passed`);isFlat(e)||(console.warn(`latlngs are not flat! Only the first ring will be used`),e=e[0]);var h=toLatLng([0,0]),g=toLatLngBounds(e);g.getNorthWest().distanceTo(g.getSouthWest())*g.getNorthEast().distanceTo(g.getNorthWest())<1700&&(h=centroid(e));var _=e.length,v=[];for(n=0;n<_;n++){var y=toLatLng(e[n]);v.push(t.project(toLatLng([y.lat-h.lat,y.lng-h.lng])))}for(n=0,s=0;n<_-1;n++)s+=v[n].distanceTo(v[n+1])/2;if(s===0)m=v[0];else for(n=0,l=0;n<_-1;n++)if(d=v[n],f=v[n+1],c=d.distanceTo(f),l+=c,l>s){p=(l-s)/c,m=[f.x-p*(f.x-d.x),f.y-p*(f.y-d.y)];break}var b=t.unproject(toPoint(m));return toLatLng([b.lat+h.lat,b.lng+h.lng])}var Ze={__proto__:null,simplify,pointToSegmentDistance,closestPointOnSegment,clipSegment,_getEdgeIntersection,_getBitCode,_sqClosestPointOnSegment,isFlat,_flat,polylineCenter},Qe={project:function(e){return new Point(e.lng,e.lat)},unproject:function(e){return new LatLng(e.y,e.x)},bounds:new Bounds([-180,-90],[180,90])},$e={R:6378137,R_MINOR:6356752.314245179,bounds:new Bounds([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(e){var t=Math.PI/180,n=this.R,s=e.lat*t,c=this.R_MINOR/n,l=Math.sqrt(1-c*c),d=l*Math.sin(s),f=Math.tan(Math.PI/4-s/2)/((1-d)/(1+d))**(l/2);return s=-n*Math.log(Math.max(f,1e-10)),new Point(e.lng*t*n,s)},unproject:function(e){for(var t=180/Math.PI,n=this.R,s=this.R_MINOR/n,c=Math.sqrt(1-s*s),l=Math.exp(-e.y/n),d=Math.PI/2-2*Math.atan(l),f=0,p=.1,m;f<15&&Math.abs(p)>1e-7;f++)m=c*Math.sin(d),m=((1-m)/(1+m))**(c/2),p=Math.PI/2-2*Math.atan(l*m)-d,d+=p;return new LatLng(d*t,e.x*t/n)}},et={__proto__:null,LonLat:Qe,Mercator:$e,SphericalMercator:S},tt=extend({},b,{code:`EPSG:3395`,projection:$e,transformation:function(){var e=.5/(Math.PI*$e.R);return toTransformation(e,.5,-e,.5)}()}),nt=extend({},b,{code:`EPSG:4326`,projection:Qe,transformation:toTransformation(1/180,1,-1/180,.5)}),rt=extend({},y,{projection:Qe,transformation:toTransformation(1,0,-1,0),scale:function(e){return 2**e},zoom:function(e){return Math.log(e)/Math.LN2},distance:function(e,t){var n=t.lng-e.lng,s=t.lat-e.lat;return Math.sqrt(n*n+s*s)},infinite:!0});y.Earth=b,y.EPSG3395=tt,y.EPSG3857=C,y.EPSG900913=T,y.EPSG4326=nt,y.Simple=rt;var it=_.extend({options:{pane:`overlayPane`,attribution:null,bubblingMouseEvents:!0},addTo:function(e){return e.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(e){return e&&e.removeLayer(this),this},getPane:function(e){return this._map.getPane(e?this.options[e]||e:this.options.pane)},addInteractiveTarget:function(e){return this._map._targets[stamp(e)]=this,this},removeInteractiveTarget:function(e){return delete this._map._targets[stamp(e)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(e){var t=e.target;if(t.hasLayer(this)){if(this._map=t,this._zoomAnimated=t._zoomAnimated,this.getEvents){var n=this.getEvents();t.on(n,this),this.once(`remove`,function(){t.off(n,this)},this)}this.onAdd(t),this.fire(`add`),t.fire(`layeradd`,{layer:this})}}});J.include({addLayer:function(e){if(!e._layerAdd)throw Error(`The provided object is not a Layer.`);var t=stamp(e);return this._layers[t]?this:(this._layers[t]=e,e._mapToAdd=this,e.beforeAdd&&e.beforeAdd(this),this.whenReady(e._layerAdd,e),this)},removeLayer:function(e){var t=stamp(e);return this._layers[t]?(this._loaded&&e.onRemove(this),delete this._layers[t],this._loaded&&(this.fire(`layerremove`,{layer:e}),e.fire(`remove`)),e._map=e._mapToAdd=null,this):this},hasLayer:function(e){return stamp(e)in this._layers},eachLayer:function(e,t){for(var n in this._layers)e.call(t,this._layers[n]);return this},_addLayers:function(e){e=e?l(e)?e:[e]:[];for(var t=0,n=e.length;t<n;t++)this.addLayer(e[t])},_addZoomLimit:function(e){(!isNaN(e.options.maxZoom)||!isNaN(e.options.minZoom))&&(this._zoomBoundLayers[stamp(e)]=e,this._updateZoomLevels())},_removeZoomLimit:function(e){var t=stamp(e);this._zoomBoundLayers[t]&&(delete this._zoomBoundLayers[t],this._updateZoomLevels())},_updateZoomLevels:function(){var e=1/0,t=-1/0,n=this._getZoomSpan();for(var s in this._zoomBoundLayers){var c=this._zoomBoundLayers[s].options;e=c.minZoom===void 0?e:Math.min(e,c.minZoom),t=c.maxZoom===void 0?t:Math.max(t,c.maxZoom)}this._layersMaxZoom=t===-1/0?void 0:t,this._layersMinZoom=e===1/0?void 0:e,n!==this._getZoomSpan()&&this.fire(`zoomlevelschange`),this.options.maxZoom===void 0&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var at=it.extend({initialize:function(e,t){setOptions(this,t),this._layers={};var n,s;if(e)for(n=0,s=e.length;n<s;n++)this.addLayer(e[n])},addLayer:function(e){var t=this.getLayerId(e);return this._layers[t]=e,this._map&&this._map.addLayer(e),this},removeLayer:function(e){var t=e in this._layers?e:this.getLayerId(e);return this._map&&this._layers[t]&&this._map.removeLayer(this._layers[t]),delete this._layers[t],this},hasLayer:function(e){return(typeof e==`number`?e:this.getLayerId(e))in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(e){var t=Array.prototype.slice.call(arguments,1),n,s;for(n in this._layers)s=this._layers[n],s[e]&&s[e].apply(s,t);return this},onAdd:function(e){this.eachLayer(e.addLayer,e)},onRemove:function(e){this.eachLayer(e.removeLayer,e)},eachLayer:function(e,t){for(var n in this._layers)e.call(t,this._layers[n]);return this},getLayer:function(e){return this._layers[e]},getLayers:function(){var e=[];return this.eachLayer(e.push,e),e},setZIndex:function(e){return this.invoke(`setZIndex`,e)},getLayerId:function(e){return stamp(e)}}),layerGroup=function(e,t){return new at(e,t)},ot=at.extend({addLayer:function(e){return this.hasLayer(e)?this:(e.addEventParent(this),at.prototype.addLayer.call(this,e),this.fire(`layeradd`,{layer:e}))},removeLayer:function(e){return this.hasLayer(e)?(e in this._layers&&(e=this._layers[e]),e.removeEventParent(this),at.prototype.removeLayer.call(this,e),this.fire(`layerremove`,{layer:e})):this},setStyle:function(e){return this.invoke(`setStyle`,e)},bringToFront:function(){return this.invoke(`bringToFront`)},bringToBack:function(){return this.invoke(`bringToBack`)},getBounds:function(){var e=new LatLngBounds;for(var t in this._layers){var n=this._layers[t];e.extend(n.getBounds?n.getBounds():n.getLatLng())}return e}}),featureGroup=function(e,t){return new ot(e,t)},st=Class.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(e){setOptions(this,e)},createIcon:function(e){return this._createIcon(`icon`,e)},createShadow:function(e){return this._createIcon(`shadow`,e)},_createIcon:function(e,t){var n=this._getIconUrl(e);if(!n){if(e===`icon`)throw Error(`iconUrl not set in Icon options (see the docs).`);return null}var s=this._createImg(n,t&&t.tagName===`IMG`?t:null);return this._setIconStyles(s,e),(this.options.crossOrigin||this.options.crossOrigin===``)&&(s.crossOrigin=this.options.crossOrigin===!0?``:this.options.crossOrigin),s},_setIconStyles:function(e,t){var n=this.options,s=n[t+`Size`];typeof s==`number`&&(s=[s,s]);var c=toPoint(s),l=toPoint(t===`shadow`&&n.shadowAnchor||n.iconAnchor||c&&c.divideBy(2,!0));e.className=`leaflet-marker-`+t+` `+(n.className||``),l&&(e.style.marginLeft=-l.x+`px`,e.style.marginTop=-l.y+`px`),c&&(e.style.width=c.x+`px`,e.style.height=c.y+`px`)},_createImg:function(e,t){return t||=document.createElement(`img`),t.src=e,t},_getIconUrl:function(e){return U.retina&&this.options[e+`RetinaUrl`]||this.options[e+`Url`]}});function icon(e){return new st(e)}var ct=st.extend({options:{iconUrl:`marker-icon.png`,iconRetinaUrl:`marker-icon-2x.png`,shadowUrl:`marker-shadow.png`,iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(e){return typeof ct.imagePath!=`string`&&(ct.imagePath=this._detectIconPath()),(this.options.imagePath||ct.imagePath)+st.prototype._getIconUrl.call(this,e)},_stripUrl:function(e){var strip=function(e,t,n){var s=t.exec(e);return s&&s[n]};return e=strip(e,/^url\((['"])?(.+)\1\)$/,2),e&&strip(e,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var e=create$1(`div`,`leaflet-default-icon-path`,document.body),t=getStyle(e,`background-image`)||getStyle(e,`backgroundImage`);if(document.body.removeChild(e),t=this._stripUrl(t),t)return t;var n=document.querySelector(`link[href$="leaflet.css"]`);return n?n.href.substring(0,n.href.length-11-1):``}}),lt=Ge.extend({initialize:function(e){this._marker=e},addHooks:function(){var e=this._marker._icon;this._draggable||=new Je(e,e,!0),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),addClass(e,`leaflet-marker-draggable`)},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&removeClass(this._marker._icon,`leaflet-marker-draggable`)},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(e){var t=this._marker,n=t._map,s=this._marker.options.autoPanSpeed,c=this._marker.options.autoPanPadding,l=getPosition(t._icon),d=n.getPixelBounds(),f=n.getPixelOrigin(),p=toBounds(d.min._subtract(f).add(c),d.max._subtract(f).subtract(c));if(!p.contains(l)){var m=toPoint((Math.max(p.max.x,l.x)-p.max.x)/(d.max.x-p.max.x)-(Math.min(p.min.x,l.x)-p.min.x)/(d.min.x-p.min.x),(Math.max(p.max.y,l.y)-p.max.y)/(d.max.y-p.max.y)-(Math.min(p.min.y,l.y)-p.min.y)/(d.min.y-p.min.y)).multiplyBy(s);n.panBy(m,{animate:!1}),this._draggable._newPos._add(m),this._draggable._startPos._add(m),setPosition(t._icon,this._draggable._newPos),this._onDrag(e),this._panRequest=requestAnimFrame(this._adjustPan.bind(this,e))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire(`movestart`).fire(`dragstart`)},_onPreDrag:function(e){this._marker.options.autoPan&&(cancelAnimFrame(this._panRequest),this._panRequest=requestAnimFrame(this._adjustPan.bind(this,e)))},_onDrag:function(e){var t=this._marker,n=t._shadow,s=getPosition(t._icon),c=t._map.layerPointToLatLng(s);n&&setPosition(n,s),t._latlng=c,e.latlng=c,e.oldLatLng=this._oldLatLng,t.fire(`move`,e).fire(`drag`,e)},_onDragEnd:function(e){cancelAnimFrame(this._panRequest),delete this._oldLatLng,this._marker.fire(`moveend`).fire(`dragend`,e)}}),ut=it.extend({options:{icon:new ct,interactive:!0,keyboard:!0,title:``,alt:`Marker`,zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:`markerPane`,shadowPane:`shadowPane`,bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(e,t){setOptions(this,t),this._latlng=toLatLng(e)},onAdd:function(e){this._zoomAnimated=this._zoomAnimated&&e.options.markerZoomAnimation,this._zoomAnimated&&e.on(`zoomanim`,this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(e){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&e.off(`zoomanim`,this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(e){var t=this._latlng;return this._latlng=toLatLng(e),this.update(),this.fire(`move`,{oldLatLng:t,latlng:this._latlng})},setZIndexOffset:function(e){return this.options.zIndexOffset=e,this.update()},getIcon:function(){return this.options.icon},setIcon:function(e){return this.options.icon=e,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var e=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(e)}return this},_initIcon:function(){var e=this.options,t=`leaflet-zoom-`+(this._zoomAnimated?`animated`:`hide`),n=e.icon.createIcon(this._icon),s=!1;n!==this._icon&&(this._icon&&this._removeIcon(),s=!0,e.title&&(n.title=e.title),n.tagName===`IMG`&&(n.alt=e.alt||``)),addClass(n,t),e.keyboard&&(n.tabIndex=`0`,n.setAttribute(`role`,`button`)),this._icon=n,e.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&on(n,`focus`,this._panOnFocus,this);var c=e.icon.createShadow(this._shadow),l=!1;c!==this._shadow&&(this._removeShadow(),l=!0),c&&(addClass(c,t),c.alt=``),this._shadow=c,e.opacity<1&&this._updateOpacity(),s&&this.getPane().appendChild(this._icon),this._initInteraction(),c&&l&&this.getPane(e.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&off(this._icon,`focus`,this._panOnFocus,this),remove(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&remove(this._shadow),this._shadow=null},_setPos:function(e){this._icon&&setPosition(this._icon,e),this._shadow&&setPosition(this._shadow,e),this._zIndex=e.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(e){this._icon&&(this._icon.style.zIndex=this._zIndex+e)},_animateZoom:function(e){var t=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center).round();this._setPos(t)},_initInteraction:function(){if(this.options.interactive&&(addClass(this._icon,`leaflet-interactive`),this.addInteractiveTarget(this._icon),lt)){var e=this.options.draggable;this.dragging&&(e=this.dragging.enabled(),this.dragging.disable()),this.dragging=new lt(this),e&&this.dragging.enable()}},setOpacity:function(e){return this.options.opacity=e,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var e=this.options.opacity;this._icon&&setOpacity(this._icon,e),this._shadow&&setOpacity(this._shadow,e)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var e=this._map;if(e){var t=this.options.icon.options,n=t.iconSize?toPoint(t.iconSize):toPoint(0,0),s=t.iconAnchor?toPoint(t.iconAnchor):toPoint(0,0);e.panInside(this._latlng,{paddingTopLeft:s,paddingBottomRight:n.subtract(s)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function marker(e,t){return new ut(e,t)}var dt=it.extend({options:{stroke:!0,color:`#3388ff`,weight:3,opacity:1,lineCap:`round`,lineJoin:`round`,dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:`evenodd`,interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(e){this._renderer=e.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(e){return setOptions(this,e),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&e&&Object.prototype.hasOwnProperty.call(e,`weight`)&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),ft=dt.extend({options:{fill:!0,radius:10},initialize:function(e,t){setOptions(this,t),this._latlng=toLatLng(e),this._radius=this.options.radius},setLatLng:function(e){var t=this._latlng;return this._latlng=toLatLng(e),this.redraw(),this.fire(`move`,{oldLatLng:t,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(e){return this.options.radius=this._radius=e,this.redraw()},getRadius:function(){return this._radius},setStyle:function(e){var t=e&&e.radius||this._radius;return dt.prototype.setStyle.call(this,e),this.setRadius(t),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var e=this._radius,t=this._radiusY||e,n=this._clickTolerance(),s=[e+n,t+n];this._pxBounds=new Bounds(this._point.subtract(s),this._point.add(s))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(e){return e.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function circleMarker(e,t){return new ft(e,t)}var pt=ft.extend({initialize:function(e,t,n){if(typeof t==`number`&&(t=extend({},n,{radius:t})),setOptions(this,t),this._latlng=toLatLng(e),isNaN(this.options.radius))throw Error(`Circle radius cannot be NaN`);this._mRadius=this.options.radius},setRadius:function(e){return this._mRadius=e,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var e=[this._radius,this._radiusY||this._radius];return new LatLngBounds(this._map.layerPointToLatLng(this._point.subtract(e)),this._map.layerPointToLatLng(this._point.add(e)))},setStyle:dt.prototype.setStyle,_project:function(){var e=this._latlng.lng,t=this._latlng.lat,n=this._map,s=n.options.crs;if(s.distance===b.distance){var c=Math.PI/180,l=this._mRadius/b.R/c,d=n.project([t+l,e]),f=n.project([t-l,e]),p=d.add(f).divideBy(2),m=n.unproject(p).lat,h=Math.acos((Math.cos(l*c)-Math.sin(t*c)*Math.sin(m*c))/(Math.cos(t*c)*Math.cos(m*c)))/c;(isNaN(h)||h===0)&&(h=l/Math.cos(Math.PI/180*t)),this._point=p.subtract(n.getPixelOrigin()),this._radius=isNaN(h)?0:p.x-n.project([m,e-h]).x,this._radiusY=p.y-d.y}else{var g=s.unproject(s.project(this._latlng).subtract([this._mRadius,0]));this._point=n.latLngToLayerPoint(this._latlng),this._radius=this._point.x-n.latLngToLayerPoint(g).x}this._updateBounds()}});function circle(e,t,n){return new pt(e,t,n)}var mt=dt.extend({options:{smoothFactor:1,noClip:!1},initialize:function(e,t){setOptions(this,t),this._setLatLngs(e)},getLatLngs:function(){return this._latlngs},setLatLngs:function(e){return this._setLatLngs(e),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(e){for(var t=1/0,n=null,s=_sqClosestPointOnSegment,c,l,d=0,f=this._parts.length;d<f;d++)for(var p=this._parts[d],m=1,h=p.length;m<h;m++){c=p[m-1],l=p[m];var g=s(e,c,l,!0);g<t&&(t=g,n=s(e,c,l))}return n&&(n.distance=Math.sqrt(t)),n},getCenter:function(){if(!this._map)throw Error(`Must add layer to map before using getCenter()`);return polylineCenter(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(e,t){return t||=this._defaultShape(),e=toLatLng(e),t.push(e),this._bounds.extend(e),this.redraw()},_setLatLngs:function(e){this._bounds=new LatLngBounds,this._latlngs=this._convertLatLngs(e)},_defaultShape:function(){return isFlat(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(e){for(var t=[],n=isFlat(e),s=0,c=e.length;s<c;s++)n?(t[s]=toLatLng(e[s]),this._bounds.extend(t[s])):t[s]=this._convertLatLngs(e[s]);return t},_project:function(){var e=new Bounds;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,e),this._bounds.isValid()&&e.isValid()&&(this._rawPxBounds=e,this._updateBounds())},_updateBounds:function(){var e=this._clickTolerance(),t=new Point(e,e);this._rawPxBounds&&(this._pxBounds=new Bounds([this._rawPxBounds.min.subtract(t),this._rawPxBounds.max.add(t)]))},_projectLatlngs:function(e,t,n){var s=e[0]instanceof LatLng,c=e.length,l,d;if(s){for(d=[],l=0;l<c;l++)d[l]=this._map.latLngToLayerPoint(e[l]),n.extend(d[l]);t.push(d)}else for(l=0;l<c;l++)this._projectLatlngs(e[l],t,n)},_clipPoints:function(){var e=this._renderer._bounds;if(this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(e))){if(this.options.noClip){this._parts=this._rings;return}var t=this._parts,n,s,c,l,d,f,p;for(n=0,c=0,l=this._rings.length;n<l;n++)for(p=this._rings[n],s=0,d=p.length;s<d-1;s++)f=clipSegment(p[s],p[s+1],e,s,!0),f&&(t[c]=t[c]||[],t[c].push(f[0]),(f[1]!==p[s+1]||s===d-2)&&(t[c].push(f[1]),c++))}},_simplifyPoints:function(){for(var e=this._parts,t=this.options.smoothFactor,n=0,s=e.length;n<s;n++)e[n]=simplify(e[n],t)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(e,t){var n,s,c,l,d,f,p=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(e))return!1;for(n=0,l=this._parts.length;n<l;n++)for(f=this._parts[n],s=0,d=f.length,c=d-1;s<d;c=s++)if(!(!t&&s===0)&&pointToSegmentDistance(e,f[c],f[s])<=p)return!0;return!1}});function polyline(e,t){return new mt(e,t)}mt._flat=_flat;var ht=mt.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw Error(`Must add layer to map before using getCenter()`);return polygonCenter(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(e){var t=mt.prototype._convertLatLngs.call(this,e),n=t.length;return n>=2&&t[0]instanceof LatLng&&t[0].equals(t[n-1])&&t.pop(),t},_setLatLngs:function(e){mt.prototype._setLatLngs.call(this,e),isFlat(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return isFlat(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var e=this._renderer._bounds,t=this.options.weight,n=new Point(t,t);if(e=new Bounds(e.min.subtract(n),e.max.add(n)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(e))){if(this.options.noClip){this._parts=this._rings;return}for(var s=0,c=this._rings.length,l;s<c;s++)l=clipPolygon(this._rings[s],e,!0),l.length&&this._parts.push(l)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(e){var t=!1,n,s,c,l,d,f,p,m;if(!this._pxBounds||!this._pxBounds.contains(e))return!1;for(l=0,p=this._parts.length;l<p;l++)for(n=this._parts[l],d=0,m=n.length,f=m-1;d<m;f=d++)s=n[d],c=n[f],s.y>e.y!=c.y>e.y&&e.x<(c.x-s.x)*(e.y-s.y)/(c.y-s.y)+s.x&&(t=!t);return t||mt.prototype._containsPoint.call(this,e,!0)}});function polygon(e,t){return new ht(e,t)}var gt=ot.extend({initialize:function(e,t){setOptions(this,t),this._layers={},e&&this.addData(e)},addData:function(e){var t=l(e)?e:e.features,n,s,c;if(t){for(n=0,s=t.length;n<s;n++)c=t[n],(c.geometries||c.geometry||c.features||c.coordinates)&&this.addData(c);return this}var d=this.options;if(d.filter&&!d.filter(e))return this;var f=geometryToLayer(e,d);return f?(f.feature=asFeature(e),f.defaultOptions=f.options,this.resetStyle(f),d.onEachFeature&&d.onEachFeature(e,f),this.addLayer(f)):this},resetStyle:function(e){return e===void 0?this.eachLayer(this.resetStyle,this):(e.options=extend({},e.defaultOptions),this._setLayerStyle(e,this.options.style),this)},setStyle:function(e){return this.eachLayer(function(t){this._setLayerStyle(t,e)},this)},_setLayerStyle:function(e,t){e.setStyle&&(typeof t==`function`&&(t=t(e.feature)),e.setStyle(t))}});function geometryToLayer(e,t){var n=e.type===`Feature`?e.geometry:e,s=n?n.coordinates:null,c=[],l=t&&t.pointToLayer,d=t&&t.coordsToLatLng||coordsToLatLng,f,p,m,h;if(!s&&!n)return null;switch(n.type){case`Point`:return f=d(s),_pointToLayer(l,e,f,t);case`MultiPoint`:for(m=0,h=s.length;m<h;m++)f=d(s[m]),c.push(_pointToLayer(l,e,f,t));return new ot(c);case`LineString`:case`MultiLineString`:return p=coordsToLatLngs(s,n.type===`LineString`?0:1,d),new mt(p,t);case`Polygon`:case`MultiPolygon`:return p=coordsToLatLngs(s,n.type===`Polygon`?1:2,d),new ht(p,t);case`GeometryCollection`:for(m=0,h=n.geometries.length;m<h;m++){var g=geometryToLayer({geometry:n.geometries[m],type:`Feature`,properties:e.properties},t);g&&c.push(g)}return new ot(c);case`FeatureCollection`:for(m=0,h=n.features.length;m<h;m++){var _=geometryToLayer(n.features[m],t);_&&c.push(_)}return new ot(c);default:throw Error(`Invalid GeoJSON object.`)}}function _pointToLayer(e,t,n,s){return e?e(t,n):new ut(n,s&&s.markersInheritOptions&&s)}function coordsToLatLng(e){return new LatLng(e[1],e[0],e[2])}function coordsToLatLngs(e,t,n){for(var s=[],c=0,l=e.length,d;c<l;c++)d=t?coordsToLatLngs(e[c],t-1,n):(n||coordsToLatLng)(e[c]),s.push(d);return s}function latLngToCoords(e,t){return e=toLatLng(e),e.alt===void 0?[formatNum(e.lng,t),formatNum(e.lat,t)]:[formatNum(e.lng,t),formatNum(e.lat,t),formatNum(e.alt,t)]}function latLngsToCoords(e,t,n,s){for(var c=[],l=0,d=e.length;l<d;l++)c.push(t?latLngsToCoords(e[l],isFlat(e[l])?0:t-1,n,s):latLngToCoords(e[l],s));return!t&&n&&c.length>0&&c.push(c[0].slice()),c}function getFeature(e,t){return e.feature?extend({},e.feature,{geometry:t}):asFeature(t)}function asFeature(e){return e.type===`Feature`||e.type===`FeatureCollection`?e:{type:`Feature`,properties:{},geometry:e}}var _t={toGeoJSON:function(e){return getFeature(this,{type:`Point`,coordinates:latLngToCoords(this.getLatLng(),e)})}};ut.include(_t),pt.include(_t),ft.include(_t),mt.include({toGeoJSON:function(e){var t=!isFlat(this._latlngs),n=latLngsToCoords(this._latlngs,+!!t,!1,e);return getFeature(this,{type:(t?`Multi`:``)+`LineString`,coordinates:n})}}),ht.include({toGeoJSON:function(e){var t=!isFlat(this._latlngs),n=t&&!isFlat(this._latlngs[0]),s=latLngsToCoords(this._latlngs,n?2:+!!t,!0,e);return t||(s=[s]),getFeature(this,{type:(n?`Multi`:``)+`Polygon`,coordinates:s})}}),at.include({toMultiPoint:function(e){var t=[];return this.eachLayer(function(n){t.push(n.toGeoJSON(e).geometry.coordinates)}),getFeature(this,{type:`MultiPoint`,coordinates:t})},toGeoJSON:function(e){var t=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(t===`MultiPoint`)return this.toMultiPoint(e);var n=t===`GeometryCollection`,s=[];return this.eachLayer(function(t){if(t.toGeoJSON){var c=t.toGeoJSON(e);if(n)s.push(c.geometry);else{var l=asFeature(c);l.type===`FeatureCollection`?s.push.apply(s,l.features):s.push(l)}}}),n?getFeature(this,{geometries:s,type:`GeometryCollection`}):{type:`FeatureCollection`,features:s}}});function geoJSON(e,t){return new gt(e,t)}var vt=geoJSON,yt=it.extend({options:{opacity:1,alt:``,interactive:!1,crossOrigin:!1,errorOverlayUrl:``,zIndex:1,className:``},initialize:function(e,t,n){this._url=e,this._bounds=toLatLngBounds(t),setOptions(this,n)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(addClass(this._image,`leaflet-interactive`),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){remove(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(e){return this.options.opacity=e,this._image&&this._updateOpacity(),this},setStyle:function(e){return e.opacity&&this.setOpacity(e.opacity),this},bringToFront:function(){return this._map&&toFront(this._image),this},bringToBack:function(){return this._map&&toBack(this._image),this},setUrl:function(e){return this._url=e,this._image&&(this._image.src=e),this},setBounds:function(e){return this._bounds=toLatLngBounds(e),this._map&&this._reset(),this},getEvents:function(){var e={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(e.zoomanim=this._animateZoom),e},setZIndex:function(e){return this.options.zIndex=e,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var e=this._url.tagName===`IMG`,t=this._image=e?this._url:create$1(`img`);if(addClass(t,`leaflet-image-layer`),this._zoomAnimated&&addClass(t,`leaflet-zoom-animated`),this.options.className&&addClass(t,this.options.className),t.onselectstart=falseFn,t.onmousemove=falseFn,t.onload=bind(this.fire,this,`load`),t.onerror=bind(this._overlayOnError,this,`error`),(this.options.crossOrigin||this.options.crossOrigin===``)&&(t.crossOrigin=this.options.crossOrigin===!0?``:this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),e){this._url=t.src;return}t.src=this._url,t.alt=this.options.alt},_animateZoom:function(e){var t=this._map.getZoomScale(e.zoom),n=this._map._latLngBoundsToNewLayerBounds(this._bounds,e.zoom,e.center).min;setTransform(this._image,n,t)},_reset:function(){var e=this._image,t=new Bounds(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),n=t.getSize();setPosition(e,t.min),e.style.width=n.x+`px`,e.style.height=n.y+`px`},_updateOpacity:function(){setOpacity(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire(`error`);var e=this.options.errorOverlayUrl;e&&this._url!==e&&(this._url=e,this._image.src=e)},getCenter:function(){return this._bounds.getCenter()}}),imageOverlay=function(e,t,n){return new yt(e,t,n)},bt=yt.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var e=this._url.tagName===`VIDEO`,t=this._image=e?this._url:create$1(`video`);if(addClass(t,`leaflet-image-layer`),this._zoomAnimated&&addClass(t,`leaflet-zoom-animated`),this.options.className&&addClass(t,this.options.className),t.onselectstart=falseFn,t.onmousemove=falseFn,t.onloadeddata=bind(this.fire,this,`load`),e){for(var n=t.getElementsByTagName(`source`),s=[],c=0;c<n.length;c++)s.push(n[c].src);this._url=n.length>0?s:[t.src];return}l(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(t.style,`objectFit`)&&(t.style.objectFit=`fill`),t.autoplay=!!this.options.autoplay,t.loop=!!this.options.loop,t.muted=!!this.options.muted,t.playsInline=!!this.options.playsInline;for(var d=0;d<this._url.length;d++){var f=create$1(`source`);f.src=this._url[d],t.appendChild(f)}}});function videoOverlay(e,t,n){return new bt(e,t,n)}var xt=yt.extend({_initImage:function(){var e=this._image=this._url;addClass(e,`leaflet-image-layer`),this._zoomAnimated&&addClass(e,`leaflet-zoom-animated`),this.options.className&&addClass(e,this.options.className),e.onselectstart=falseFn,e.onmousemove=falseFn}});function svgOverlay(e,t,n){return new xt(e,t,n)}var St=it.extend({options:{interactive:!1,offset:[0,0],className:``,pane:void 0,content:``},initialize:function(e,t){e&&(e instanceof LatLng||l(e))?(this._latlng=toLatLng(e),setOptions(this,t)):(setOptions(this,e),this._source=t),this.options.content&&(this._content=this.options.content)},openOn:function(e){return e=arguments.length?e:this._source._map,e.hasLayer(this)||e.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(e){return this._map?this.close():(arguments.length?this._source=e:e=this._source,this._prepareOpen(),this.openOn(e._map)),this},onAdd:function(e){this._zoomAnimated=e._zoomAnimated,this._container||this._initLayout(),e._fadeAnimated&&setOpacity(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),e._fadeAnimated&&setOpacity(this._container,1),this.bringToFront(),this.options.interactive&&(addClass(this._container,`leaflet-interactive`),this.addInteractiveTarget(this._container))},onRemove:function(e){e._fadeAnimated?(setOpacity(this._container,0),this._removeTimeout=setTimeout(bind(remove,void 0,this._container),200)):remove(this._container),this.options.interactive&&(removeClass(this._container,`leaflet-interactive`),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(e){return this._latlng=toLatLng(e),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(e){return this._content=e,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility=`hidden`,this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility=``,this._adjustPan())},getEvents:function(){var e={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(e.zoomanim=this._animateZoom),e},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&toFront(this._container),this},bringToBack:function(){return this._map&&toBack(this._container),this},_prepareOpen:function(e){var t=this._source;if(!t._map)return!1;if(t instanceof ot){t=null;var n=this._source._layers;for(var s in n)if(n[s]._map){t=n[s];break}if(!t)return!1;this._source=t}if(!e)if(t.getCenter)e=t.getCenter();else if(t.getLatLng)e=t.getLatLng();else if(t.getBounds)e=t.getBounds().getCenter();else throw Error(`Unable to get source layer LatLng.`);return this.setLatLng(e),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var e=this._contentNode,t=typeof this._content==`function`?this._content(this._source||this):this._content;if(typeof t==`string`)e.innerHTML=t;else{for(;e.hasChildNodes();)e.removeChild(e.firstChild);e.appendChild(t)}this.fire(`contentupdate`)}},_updatePosition:function(){if(this._map){var e=this._map.latLngToLayerPoint(this._latlng),t=toPoint(this.options.offset),n=this._getAnchor();this._zoomAnimated?setPosition(this._container,e.add(n)):t=t.add(e).add(n);var s=this._containerBottom=-t.y,c=this._containerLeft=-Math.round(this._containerWidth/2)+t.x;this._container.style.bottom=s+`px`,this._container.style.left=c+`px`}},_getAnchor:function(){return[0,0]}});J.include({_initOverlay:function(e,t,n,s){var c=t;return c instanceof e||(c=new e(s).setContent(t)),n&&c.setLatLng(n),c}}),it.include({_initOverlay:function(e,t,n,s){var c=n;return c instanceof e?(setOptions(c,s),c._source=this):(c=t&&!s?t:new e(s,this),c.setContent(n)),c}});var Ct=St.extend({options:{pane:`popupPane`,offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:``},openOn:function(e){return e=arguments.length?e:this._source._map,!e.hasLayer(this)&&e._popup&&e._popup.options.autoClose&&e.removeLayer(e._popup),e._popup=this,St.prototype.openOn.call(this,e)},onAdd:function(e){St.prototype.onAdd.call(this,e),e.fire(`popupopen`,{popup:this}),this._source&&(this._source.fire(`popupopen`,{popup:this},!0),this._source instanceof dt||this._source.on(`preclick`,stopPropagation))},onRemove:function(e){St.prototype.onRemove.call(this,e),e.fire(`popupclose`,{popup:this}),this._source&&(this._source.fire(`popupclose`,{popup:this},!0),this._source instanceof dt||this._source.off(`preclick`,stopPropagation))},getEvents:function(){var e=St.prototype.getEvents.call(this);return(this.options.closeOnClick===void 0?this._map.options.closePopupOnClick:this.options.closeOnClick)&&(e.preclick=this.close),this.options.keepInView&&(e.moveend=this._adjustPan),e},_initLayout:function(){var e=`leaflet-popup`,t=this._container=create$1(`div`,e+` `+(this.options.className||``)+` leaflet-zoom-animated`),n=this._wrapper=create$1(`div`,e+`-content-wrapper`,t);if(this._contentNode=create$1(`div`,e+`-content`,n),disableClickPropagation(t),disableScrollPropagation(this._contentNode),on(t,`contextmenu`,stopPropagation),this._tipContainer=create$1(`div`,e+`-tip-container`,t),this._tip=create$1(`div`,e+`-tip`,this._tipContainer),this.options.closeButton){var s=this._closeButton=create$1(`a`,e+`-close-button`,t);s.setAttribute(`role`,`button`),s.setAttribute(`aria-label`,`Close popup`),s.href=`#close`,s.innerHTML=`<span aria-hidden="true">&#215;</span>`,on(s,`click`,function(e){preventDefault(e),this.close()},this)}},_updateLayout:function(){var e=this._contentNode,t=e.style;t.width=``,t.whiteSpace=`nowrap`;var n=e.offsetWidth;n=Math.min(n,this.options.maxWidth),n=Math.max(n,this.options.minWidth),t.width=n+1+`px`,t.whiteSpace=``,t.height=``;var s=e.offsetHeight,c=this.options.maxHeight,l=`leaflet-popup-scrolled`;c&&s>c?(t.height=c+`px`,addClass(e,l)):removeClass(e,l),this._containerWidth=this._container.offsetWidth},_animateZoom:function(e){var t=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center),n=this._getAnchor();setPosition(this._container,t.add(n))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var e=this._map,t=parseInt(getStyle(this._container,`marginBottom`),10)||0,n=this._container.offsetHeight+t,s=this._containerWidth,c=new Point(this._containerLeft,-n-this._containerBottom);c._add(getPosition(this._container));var l=e.layerPointToContainerPoint(c),d=toPoint(this.options.autoPanPadding),f=toPoint(this.options.autoPanPaddingTopLeft||d),p=toPoint(this.options.autoPanPaddingBottomRight||d),m=e.getSize(),h=0,g=0;l.x+s+p.x>m.x&&(h=l.x+s-m.x+p.x),l.x-h-f.x<0&&(h=l.x-f.x),l.y+n+p.y>m.y&&(g=l.y+n-m.y+p.y),l.y-g-f.y<0&&(g=l.y-f.y),(h||g)&&(this.options.keepInView&&(this._autopanning=!0),e.fire(`autopanstart`).panBy([h,g]))}},_getAnchor:function(){return toPoint(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),popup=function(e,t){return new Ct(e,t)};J.mergeOptions({closePopupOnClick:!0}),J.include({openPopup:function(e,t,n){return this._initOverlay(Ct,e,t,n).openOn(this),this},closePopup:function(e){return e=arguments.length?e:this._popup,e&&e.close(),this}}),it.include({bindPopup:function(e,t){return this._popup=this._initOverlay(Ct,this._popup,e,t),this._popupHandlersAdded||=(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),!0),this},unbindPopup:function(){return this._popup&&=(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,null),this},openPopup:function(e){return this._popup&&(this instanceof ot||(this._popup._source=this),this._popup._prepareOpen(e||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(e){return this._popup&&this._popup.setContent(e),this},getPopup:function(){return this._popup},_openPopup:function(e){if(!(!this._popup||!this._map)){stop(e);var t=e.layer||e.target;if(this._popup._source===t&&!(t instanceof dt)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(e.latlng);return}this._popup._source=t,this.openPopup(e.latlng)}},_movePopup:function(e){this._popup.setLatLng(e.latlng)},_onKeyPress:function(e){e.originalEvent.keyCode===13&&this._openPopup(e)}});var wt=St.extend({options:{pane:`tooltipPane`,offset:[0,0],direction:`auto`,permanent:!1,sticky:!1,opacity:.9},onAdd:function(e){St.prototype.onAdd.call(this,e),this.setOpacity(this.options.opacity),e.fire(`tooltipopen`,{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire(`tooltipopen`,{tooltip:this},!0))},onRemove:function(e){St.prototype.onRemove.call(this,e),e.fire(`tooltipclose`,{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire(`tooltipclose`,{tooltip:this},!0))},getEvents:function(){var e=St.prototype.getEvents.call(this);return this.options.permanent||(e.preclick=this.close),e},_initLayout:function(){var e=`leaflet-tooltip `+(this.options.className||``)+` leaflet-zoom-`+(this._zoomAnimated?`animated`:`hide`);this._contentNode=this._container=create$1(`div`,e),this._container.setAttribute(`role`,`tooltip`),this._container.setAttribute(`id`,`leaflet-tooltip-`+stamp(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(e){var t,n,s=this._map,c=this._container,l=s.latLngToContainerPoint(s.getCenter()),d=s.layerPointToContainerPoint(e),f=this.options.direction,p=c.offsetWidth,m=c.offsetHeight,h=toPoint(this.options.offset),g=this._getAnchor();f===`top`?(t=p/2,n=m):f===`bottom`?(t=p/2,n=0):f===`center`?(t=p/2,n=m/2):f===`right`?(t=0,n=m/2):f===`left`?(t=p,n=m/2):d.x<l.x?(f=`right`,t=0,n=m/2):(f=`left`,t=p+(h.x+g.x)*2,n=m/2),e=e.subtract(toPoint(t,n,!0)).add(h).add(g),removeClass(c,`leaflet-tooltip-right`),removeClass(c,`leaflet-tooltip-left`),removeClass(c,`leaflet-tooltip-top`),removeClass(c,`leaflet-tooltip-bottom`),addClass(c,`leaflet-tooltip-`+f),setPosition(c,e)},_updatePosition:function(){var e=this._map.latLngToLayerPoint(this._latlng);this._setPosition(e)},setOpacity:function(e){this.options.opacity=e,this._container&&setOpacity(this._container,e)},_animateZoom:function(e){var t=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center);this._setPosition(t)},_getAnchor:function(){return toPoint(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),tooltip=function(e,t){return new wt(e,t)};J.include({openTooltip:function(e,t,n){return this._initOverlay(wt,e,t,n).openOn(this),this},closeTooltip:function(e){return e.close(),this}}),it.include({bindTooltip:function(e,t){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(wt,this._tooltip,e,t),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&=(this._initTooltipInteractions(!0),this.closeTooltip(),null),this},_initTooltipInteractions:function(e){if(!(!e&&this._tooltipHandlersAdded)){var t=e?`off`:`on`,n={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?n.add=this._openTooltip:(n.mouseover=this._openTooltip,n.mouseout=this.closeTooltip,n.click=this._openTooltip,this._map?this._addFocusListeners():n.add=this._addFocusListeners),this._tooltip.options.sticky&&(n.mousemove=this._moveTooltip),this[t](n),this._tooltipHandlersAdded=!e}},openTooltip:function(e){return this._tooltip&&(this instanceof ot||(this._tooltip._source=this),this._tooltip._prepareOpen(e)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(e){return this._tooltip&&this._tooltip.setContent(e),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(e){var t=typeof e.getElement==`function`&&e.getElement();t&&(on(t,`focus`,function(){this._tooltip._source=e,this.openTooltip()},this),on(t,`blur`,this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(e){var t=typeof e.getElement==`function`&&e.getElement();t&&t.setAttribute(`aria-describedby`,this._tooltip._container.id)},_openTooltip:function(e){if(!(!this._tooltip||!this._map)){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var t=this;this._map.once(`moveend`,function(){t._openOnceFlag=!1,t._openTooltip(e)});return}this._tooltip._source=e.layer||e.target,this.openTooltip(this._tooltip.options.sticky?e.latlng:void 0)}},_moveTooltip:function(e){var t=e.latlng,n,s;this._tooltip.options.sticky&&e.originalEvent&&(n=this._map.mouseEventToContainerPoint(e.originalEvent),s=this._map.containerPointToLayerPoint(n),t=this._map.layerPointToLatLng(s)),this._tooltip.setLatLng(t)}});var Tt=st.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:`leaflet-div-icon`},createIcon:function(e){var t=e&&e.tagName===`DIV`?e:document.createElement(`div`),n=this.options;if(n.html instanceof Element?(empty(t),t.appendChild(n.html)):t.innerHTML=n.html===!1?``:n.html,n.bgPos){var s=toPoint(n.bgPos);t.style.backgroundPosition=-s.x+`px `+-s.y+`px`}return this._setIconStyles(t,`icon`),t},createShadow:function(){return null}});function divIcon(e){return new Tt(e)}st.Default=ct;var Et=it.extend({options:{tileSize:256,opacity:1,updateWhenIdle:U.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:`tilePane`,className:``,keepBuffer:2},initialize:function(e){setOptions(this,e)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(e){e._addZoomLimit(this)},onRemove:function(e){this._removeAllTiles(),remove(this._container),e._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(toFront(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(toBack(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(e){return this.options.opacity=e,this._updateOpacity(),this},setZIndex:function(e){return this.options.zIndex=e,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var e=this._clampZoom(this._map.getZoom());e!==this._tileZoom&&(this._tileZoom=e,this._updateLevels()),this._update()}return this},getEvents:function(){var e={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||=throttle(this._onMoveEnd,this.options.updateInterval,this),e.move=this._onMove),this._zoomAnimated&&(e.zoomanim=this._animateZoom),e},createTile:function(){return document.createElement(`div`)},getTileSize:function(){var e=this.options.tileSize;return e instanceof Point?e:new Point(e,e)},_updateZIndex:function(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(e){for(var t=this.getPane().children,n=-e(-1/0,1/0),s=0,c=t.length,l;s<c;s++)l=t[s].style.zIndex,t[s]!==this._container&&l&&(n=e(n,+l));isFinite(n)&&(this.options.zIndex=n+e(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!U.ielt9){setOpacity(this._container,this.options.opacity);var e=+new Date,t=!1,n=!1;for(var s in this._tiles){var c=this._tiles[s];if(!(!c.current||!c.loaded)){var l=Math.min(1,(e-c.loaded)/200);setOpacity(c.el,l),l<1?t=!0:(c.active?n=!0:this._onOpaqueTile(c),c.active=!0)}}n&&!this._noPrune&&this._pruneTiles(),t&&(cancelAnimFrame(this._fadeFrame),this._fadeFrame=requestAnimFrame(this._updateOpacity,this))}},_onOpaqueTile:falseFn,_initContainer:function(){this._container||(this._container=create$1(`div`,`leaflet-layer `+(this.options.className||``)),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var e=this._tileZoom,t=this.options.maxZoom;if(e!==void 0){for(var n in this._levels)n=Number(n),this._levels[n].el.children.length||n===e?(this._levels[n].el.style.zIndex=t-Math.abs(e-n),this._onUpdateLevel(n)):(remove(this._levels[n].el),this._removeTilesAtZoom(n),this._onRemoveLevel(n),delete this._levels[n]);var s=this._levels[e],c=this._map;return s||(s=this._levels[e]={},s.el=create$1(`div`,`leaflet-tile-container leaflet-zoom-animated`,this._container),s.el.style.zIndex=t,s.origin=c.project(c.unproject(c.getPixelOrigin()),e).round(),s.zoom=e,this._setZoomTransform(s,c.getCenter(),c.getZoom()),s.el.offsetWidth,this._onCreateLevel(s)),this._level=s,s}},_onUpdateLevel:falseFn,_onRemoveLevel:falseFn,_onCreateLevel:falseFn,_pruneTiles:function(){if(this._map){var e,t,n=this._map.getZoom();if(n>this.options.maxZoom||n<this.options.minZoom){this._removeAllTiles();return}for(e in this._tiles)t=this._tiles[e],t.retain=t.current;for(e in this._tiles)if(t=this._tiles[e],t.current&&!t.active){var s=t.coords;this._retainParent(s.x,s.y,s.z,s.z-5)||this._retainChildren(s.x,s.y,s.z,s.z+2)}for(e in this._tiles)this._tiles[e].retain||this._removeTile(e)}},_removeTilesAtZoom:function(e){for(var t in this._tiles)this._tiles[t].coords.z===e&&this._removeTile(t)},_removeAllTiles:function(){for(var e in this._tiles)this._removeTile(e)},_invalidateAll:function(){for(var e in this._levels)remove(this._levels[e].el),this._onRemoveLevel(Number(e)),delete this._levels[e];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(e,t,n,s){var c=Math.floor(e/2),l=Math.floor(t/2),d=n-1,f=new Point(+c,+l);f.z=+d;var p=this._tileCoordsToKey(f),m=this._tiles[p];return m&&m.active?(m.retain=!0,!0):(m&&m.loaded&&(m.retain=!0),d>s?this._retainParent(c,l,d,s):!1)},_retainChildren:function(e,t,n,s){for(var c=2*e;c<2*e+2;c++)for(var l=2*t;l<2*t+2;l++){var d=new Point(c,l);d.z=n+1;var f=this._tileCoordsToKey(d),p=this._tiles[f];if(p&&p.active){p.retain=!0;continue}else p&&p.loaded&&(p.retain=!0);n+1<s&&this._retainChildren(c,l,n+1,s)}},_resetView:function(e){var t=e&&(e.pinch||e.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),t,t)},_animateZoom:function(e){this._setView(e.center,e.zoom,!0,e.noUpdate)},_clampZoom:function(e){var t=this.options;return t.minNativeZoom!==void 0&&e<t.minNativeZoom?t.minNativeZoom:t.maxNativeZoom!==void 0&&t.maxNativeZoom<e?t.maxNativeZoom:e},_setView:function(e,t,n,s){var c=Math.round(t);c=this.options.maxZoom!==void 0&&c>this.options.maxZoom||this.options.minZoom!==void 0&&c<this.options.minZoom?void 0:this._clampZoom(c);var l=this.options.updateWhenZooming&&c!==this._tileZoom;(!s||l)&&(this._tileZoom=c,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),c!==void 0&&this._update(e),n||this._pruneTiles(),this._noPrune=!!n),this._setZoomTransforms(e,t)},_setZoomTransforms:function(e,t){for(var n in this._levels)this._setZoomTransform(this._levels[n],e,t)},_setZoomTransform:function(e,t,n){var s=this._map.getZoomScale(n,e.zoom),c=e.origin.multiplyBy(s).subtract(this._map._getNewPixelOrigin(t,n)).round();U.any3d?setTransform(e.el,c,s):setPosition(e.el,c)},_resetGrid:function(){var e=this._map,t=e.options.crs,n=this._tileSize=this.getTileSize(),s=this._tileZoom,c=this._map.getPixelWorldBounds(this._tileZoom);c&&(this._globalTileRange=this._pxBoundsToTileRange(c)),this._wrapX=t.wrapLng&&!this.options.noWrap&&[Math.floor(e.project([0,t.wrapLng[0]],s).x/n.x),Math.ceil(e.project([0,t.wrapLng[1]],s).x/n.y)],this._wrapY=t.wrapLat&&!this.options.noWrap&&[Math.floor(e.project([t.wrapLat[0],0],s).y/n.x),Math.ceil(e.project([t.wrapLat[1],0],s).y/n.y)]},_onMoveEnd:function(){!this._map||this._map._animatingZoom||this._update()},_getTiledPixelBounds:function(e){var t=this._map,n=t._animatingZoom?Math.max(t._animateToZoom,t.getZoom()):t.getZoom(),s=t.getZoomScale(n,this._tileZoom),c=t.project(e,this._tileZoom).floor(),l=t.getSize().divideBy(s*2);return new Bounds(c.subtract(l),c.add(l))},_update:function(e){var t=this._map;if(t){var n=this._clampZoom(t.getZoom());if(e===void 0&&(e=t.getCenter()),this._tileZoom!==void 0){var s=this._getTiledPixelBounds(e),c=this._pxBoundsToTileRange(s),l=c.getCenter(),d=[],f=this.options.keepBuffer,p=new Bounds(c.getBottomLeft().subtract([f,-f]),c.getTopRight().add([f,-f]));if(!(isFinite(c.min.x)&&isFinite(c.min.y)&&isFinite(c.max.x)&&isFinite(c.max.y)))throw Error(`Attempted to load an infinite number of tiles`);for(var m in this._tiles){var h=this._tiles[m].coords;(h.z!==this._tileZoom||!p.contains(new Point(h.x,h.y)))&&(this._tiles[m].current=!1)}if(Math.abs(n-this._tileZoom)>1){this._setView(e,n);return}for(var g=c.min.y;g<=c.max.y;g++)for(var _=c.min.x;_<=c.max.x;_++){var v=new Point(_,g);if(v.z=this._tileZoom,this._isValidTile(v)){var y=this._tiles[this._tileCoordsToKey(v)];y?y.current=!0:d.push(v)}}if(d.sort(function(e,t){return e.distanceTo(l)-t.distanceTo(l)}),d.length!==0){this._loading||(this._loading=!0,this.fire(`loading`));var b=document.createDocumentFragment();for(_=0;_<d.length;_++)this._addTile(d[_],b);this._level.el.appendChild(b)}}}},_isValidTile:function(e){var t=this._map.options.crs;if(!t.infinite){var n=this._globalTileRange;if(!t.wrapLng&&(e.x<n.min.x||e.x>n.max.x)||!t.wrapLat&&(e.y<n.min.y||e.y>n.max.y))return!1}if(!this.options.bounds)return!0;var s=this._tileCoordsToBounds(e);return toLatLngBounds(this.options.bounds).overlaps(s)},_keyToBounds:function(e){return this._tileCoordsToBounds(this._keyToTileCoords(e))},_tileCoordsToNwSe:function(e){var t=this._map,n=this.getTileSize(),s=e.scaleBy(n),c=s.add(n);return[t.unproject(s,e.z),t.unproject(c,e.z)]},_tileCoordsToBounds:function(e){var t=this._tileCoordsToNwSe(e),n=new LatLngBounds(t[0],t[1]);return this.options.noWrap||(n=this._map.wrapLatLngBounds(n)),n},_tileCoordsToKey:function(e){return e.x+`:`+e.y+`:`+e.z},_keyToTileCoords:function(e){var t=e.split(`:`),n=new Point(+t[0],+t[1]);return n.z=+t[2],n},_removeTile:function(e){var t=this._tiles[e];t&&(remove(t.el),delete this._tiles[e],this.fire(`tileunload`,{tile:t.el,coords:this._keyToTileCoords(e)}))},_initTile:function(e){addClass(e,`leaflet-tile`);var t=this.getTileSize();e.style.width=t.x+`px`,e.style.height=t.y+`px`,e.onselectstart=falseFn,e.onmousemove=falseFn,U.ielt9&&this.options.opacity<1&&setOpacity(e,this.options.opacity)},_addTile:function(e,t){var n=this._getTilePos(e),s=this._tileCoordsToKey(e),c=this.createTile(this._wrapCoords(e),bind(this._tileReady,this,e));this._initTile(c),this.createTile.length<2&&requestAnimFrame(bind(this._tileReady,this,e,null,c)),setPosition(c,n),this._tiles[s]={el:c,coords:e,current:!0},t.appendChild(c),this.fire(`tileloadstart`,{tile:c,coords:e})},_tileReady:function(e,t,n){t&&this.fire(`tileerror`,{error:t,tile:n,coords:e});var s=this._tileCoordsToKey(e);n=this._tiles[s],n&&(n.loaded=+new Date,this._map._fadeAnimated?(setOpacity(n.el,0),cancelAnimFrame(this._fadeFrame),this._fadeFrame=requestAnimFrame(this._updateOpacity,this)):(n.active=!0,this._pruneTiles()),t||(addClass(n.el,`leaflet-tile-loaded`),this.fire(`tileload`,{tile:n.el,coords:e})),this._noTilesToLoad()&&(this._loading=!1,this.fire(`load`),U.ielt9||!this._map._fadeAnimated?requestAnimFrame(this._pruneTiles,this):setTimeout(bind(this._pruneTiles,this),250)))},_getTilePos:function(e){return e.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(e){var t=new Point(this._wrapX?wrapNum(e.x,this._wrapX):e.x,this._wrapY?wrapNum(e.y,this._wrapY):e.y);return t.z=e.z,t},_pxBoundsToTileRange:function(e){var t=this.getTileSize();return new Bounds(e.min.unscaleBy(t).floor(),e.max.unscaleBy(t).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var e in this._tiles)if(!this._tiles[e].loaded)return!1;return!0}});function gridLayer(e){return new Et(e)}var Dt=Et.extend({options:{minZoom:0,maxZoom:18,subdomains:`abc`,errorTileUrl:``,zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(e,t){this._url=e,t=setOptions(this,t),t.detectRetina&&U.retina&&t.maxZoom>0?(t.tileSize=Math.floor(t.tileSize/2),t.zoomReverse?(t.zoomOffset--,t.minZoom=Math.min(t.maxZoom,t.minZoom+1)):(t.zoomOffset++,t.maxZoom=Math.max(t.minZoom,t.maxZoom-1)),t.minZoom=Math.max(0,t.minZoom)):t.zoomReverse?t.minZoom=Math.min(t.maxZoom,t.minZoom):t.maxZoom=Math.max(t.minZoom,t.maxZoom),typeof t.subdomains==`string`&&(t.subdomains=t.subdomains.split(``)),this.on(`tileunload`,this._onTileRemove)},setUrl:function(e,t){return this._url===e&&t===void 0&&(t=!0),this._url=e,t||this.redraw(),this},createTile:function(e,t){var n=document.createElement(`img`);return on(n,`load`,bind(this._tileOnLoad,this,t,n)),on(n,`error`,bind(this._tileOnError,this,t,n)),(this.options.crossOrigin||this.options.crossOrigin===``)&&(n.crossOrigin=this.options.crossOrigin===!0?``:this.options.crossOrigin),typeof this.options.referrerPolicy==`string`&&(n.referrerPolicy=this.options.referrerPolicy),n.alt=``,n.src=this.getTileUrl(e),n},getTileUrl:function(e){var t={r:U.retina?`@2x`:``,s:this._getSubdomain(e),x:e.x,y:e.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var n=this._globalTileRange.max.y-e.y;this.options.tms&&(t.y=n),t[`-y`]=n}return template(this._url,extend(t,this.options))},_tileOnLoad:function(e,t){U.ielt9?setTimeout(bind(e,this,null,t),0):e(null,t)},_tileOnError:function(e,t,n){var s=this.options.errorTileUrl;s&&t.getAttribute(`src`)!==s&&(t.src=s),e(n,t)},_onTileRemove:function(e){e.tile.onload=null},_getZoomForUrl:function(){var e=this._tileZoom,t=this.options.maxZoom,n=this.options.zoomReverse,s=this.options.zoomOffset;return n&&(e=t-e),e+s},_getSubdomain:function(e){var t=Math.abs(e.x+e.y)%this.options.subdomains.length;return this.options.subdomains[t]},_abortLoading:function(){var e,t;for(e in this._tiles)if(this._tiles[e].coords.z!==this._tileZoom&&(t=this._tiles[e].el,t.onload=falseFn,t.onerror=falseFn,!t.complete)){t.src=d;var n=this._tiles[e].coords;remove(t),delete this._tiles[e],this.fire(`tileabort`,{tile:t,coords:n})}},_removeTile:function(e){var t=this._tiles[e];if(t)return t.el.setAttribute(`src`,d),Et.prototype._removeTile.call(this,e)},_tileReady:function(e,t,n){if(!(!this._map||n&&n.getAttribute(`src`)===d))return Et.prototype._tileReady.call(this,e,t,n)}});function tileLayer(e,t){return new Dt(e,t)}var Ot=Dt.extend({defaultWmsParams:{service:`WMS`,request:`GetMap`,layers:``,styles:``,format:`image/jpeg`,transparent:!1,version:`1.1.1`},options:{crs:null,uppercase:!1},initialize:function(e,t){this._url=e;var n=extend({},this.defaultWmsParams);for(var s in t)s in this.options||(n[s]=t[s]);t=setOptions(this,t);var c=t.detectRetina&&U.retina?2:1,l=this.getTileSize();n.width=l.x*c,n.height=l.y*c,this.wmsParams=n},onAdd:function(e){this._crs=this.options.crs||e.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var t=this._wmsVersion>=1.3?`crs`:`srs`;this.wmsParams[t]=this._crs.code,Dt.prototype.onAdd.call(this,e)},getTileUrl:function(e){var t=this._tileCoordsToNwSe(e),n=this._crs,s=toBounds(n.project(t[0]),n.project(t[1])),c=s.min,l=s.max,d=(this._wmsVersion>=1.3&&this._crs===nt?[c.y,c.x,l.y,l.x]:[c.x,c.y,l.x,l.y]).join(`,`),f=Dt.prototype.getTileUrl.call(this,e);return f+getParamString(this.wmsParams,f,this.options.uppercase)+(this.options.uppercase?`&BBOX=`:`&bbox=`)+d},setParams:function(e,t){return extend(this.wmsParams,e),t||this.redraw(),this}});function tileLayerWMS(e,t){return new Ot(e,t)}Dt.WMS=Ot,tileLayer.wms=tileLayerWMS;var kt=it.extend({options:{padding:.1},initialize:function(e){setOptions(this,e),stamp(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),addClass(this._container,`leaflet-zoom-animated`)),this.getPane().appendChild(this._container),this._update(),this.on(`update`,this._updatePaths,this)},onRemove:function(){this.off(`update`,this._updatePaths,this),this._destroyContainer()},getEvents:function(){var e={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(e.zoomanim=this._onAnimZoom),e},_onAnimZoom:function(e){this._updateTransform(e.center,e.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(e,t){var n=this._map.getZoomScale(t,this._zoom),s=this._map.getSize().multiplyBy(.5+this.options.padding),c=this._map.project(this._center,t),l=s.multiplyBy(-n).add(c).subtract(this._map._getNewPixelOrigin(e,t));U.any3d?setTransform(this._container,l,n):setPosition(this._container,l)},_reset:function(){for(var e in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[e]._reset()},_onZoomEnd:function(){for(var e in this._layers)this._layers[e]._project()},_updatePaths:function(){for(var e in this._layers)this._layers[e]._update()},_update:function(){var e=this.options.padding,t=this._map.getSize(),n=this._map.containerPointToLayerPoint(t.multiplyBy(-e)).round();this._bounds=new Bounds(n,n.add(t.multiplyBy(1+e*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),At=kt.extend({options:{tolerance:0},getEvents:function(){var e=kt.prototype.getEvents.call(this);return e.viewprereset=this._onViewPreReset,e},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){kt.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var e=this._container=document.createElement(`canvas`);on(e,`mousemove`,this._onMouseMove,this),on(e,`click dblclick mousedown mouseup contextmenu`,this._onClick,this),on(e,`mouseout`,this._handleMouseOut,this),e._leaflet_disable_events=!0,this._ctx=e.getContext(`2d`)},_destroyContainer:function(){cancelAnimFrame(this._redrawRequest),delete this._ctx,remove(this._container),off(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var e;for(var t in this._redrawBounds=null,this._layers)e=this._layers[t],e._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){kt.prototype._update.call(this);var e=this._bounds,t=this._container,n=e.getSize(),s=U.retina?2:1;setPosition(t,e.min),t.width=s*n.x,t.height=s*n.y,t.style.width=n.x+`px`,t.style.height=n.y+`px`,U.retina&&this._ctx.scale(2,2),this._ctx.translate(-e.min.x,-e.min.y),this.fire(`update`)}},_reset:function(){kt.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(e){this._updateDashArray(e),this._layers[stamp(e)]=e;var t=e._order={layer:e,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=t),this._drawLast=t,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(e){this._requestRedraw(e)},_removePath:function(e){var t=e._order,n=t.next,s=t.prev;n?n.prev=s:this._drawLast=s,s?s.next=n:this._drawFirst=n,delete e._order,delete this._layers[stamp(e)],this._requestRedraw(e)},_updatePath:function(e){this._extendRedrawBounds(e),e._project(),e._update(),this._requestRedraw(e)},_updateStyle:function(e){this._updateDashArray(e),this._requestRedraw(e)},_updateDashArray:function(e){if(typeof e.options.dashArray==`string`){var t=e.options.dashArray.split(/[, ]+/),n=[],s,c;for(c=0;c<t.length;c++){if(s=Number(t[c]),isNaN(s))return;n.push(s)}e.options._dashArray=n}else e.options._dashArray=e.options.dashArray},_requestRedraw:function(e){this._map&&(this._extendRedrawBounds(e),this._redrawRequest=this._redrawRequest||requestAnimFrame(this._redraw,this))},_extendRedrawBounds:function(e){if(e._pxBounds){var t=(e.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new Bounds,this._redrawBounds.extend(e._pxBounds.min.subtract([t,t])),this._redrawBounds.extend(e._pxBounds.max.add([t,t]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var e=this._redrawBounds;if(e){var t=e.getSize();this._ctx.clearRect(e.min.x,e.min.y,t.x,t.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var e,t=this._redrawBounds;if(this._ctx.save(),t){var n=t.getSize();this._ctx.beginPath(),this._ctx.rect(t.min.x,t.min.y,n.x,n.y),this._ctx.clip()}this._drawing=!0;for(var s=this._drawFirst;s;s=s.next)e=s.layer,(!t||e._pxBounds&&e._pxBounds.intersects(t))&&e._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(e,t){if(this._drawing){var n,s,c,l,d=e._parts,f=d.length,p=this._ctx;if(f){for(p.beginPath(),n=0;n<f;n++){for(s=0,c=d[n].length;s<c;s++)l=d[n][s],p[s?`lineTo`:`moveTo`](l.x,l.y);t&&p.closePath()}this._fillStroke(p,e)}}},_updateCircle:function(e){if(!(!this._drawing||e._empty())){var t=e._point,n=this._ctx,s=Math.max(Math.round(e._radius),1),c=(Math.max(Math.round(e._radiusY),1)||s)/s;c!==1&&(n.save(),n.scale(1,c)),n.beginPath(),n.arc(t.x,t.y/c,s,0,Math.PI*2,!1),c!==1&&n.restore(),this._fillStroke(n,e)}},_fillStroke:function(e,t){var n=t.options;n.fill&&(e.globalAlpha=n.fillOpacity,e.fillStyle=n.fillColor||n.color,e.fill(n.fillRule||`evenodd`)),n.stroke&&n.weight!==0&&(e.setLineDash&&e.setLineDash(t.options&&t.options._dashArray||[]),e.globalAlpha=n.opacity,e.lineWidth=n.weight,e.strokeStyle=n.color,e.lineCap=n.lineCap,e.lineJoin=n.lineJoin,e.stroke())},_onClick:function(e){for(var t=this._map.mouseEventToLayerPoint(e),n,s,c=this._drawFirst;c;c=c.next)n=c.layer,n.options.interactive&&n._containsPoint(t)&&(!(e.type===`click`||e.type===`preclick`)||!this._map._draggableMoved(n))&&(s=n);this._fireEvent(s?[s]:!1,e)},_onMouseMove:function(e){if(!(!this._map||this._map.dragging.moving()||this._map._animatingZoom)){var t=this._map.mouseEventToLayerPoint(e);this._handleMouseHover(e,t)}},_handleMouseOut:function(e){var t=this._hoveredLayer;t&&(removeClass(this._container,`leaflet-interactive`),this._fireEvent([t],e,`mouseout`),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(e,t){if(!this._mouseHoverThrottled){for(var n,s,c=this._drawFirst;c;c=c.next)n=c.layer,n.options.interactive&&n._containsPoint(t)&&(s=n);s!==this._hoveredLayer&&(this._handleMouseOut(e),s&&(addClass(this._container,`leaflet-interactive`),this._fireEvent([s],e,`mouseover`),this._hoveredLayer=s)),this._fireEvent(this._hoveredLayer?[this._hoveredLayer]:!1,e),this._mouseHoverThrottled=!0,setTimeout(bind(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(e,t,n){this._map._fireDOMEvent(t,n||t.type,e)},_bringToFront:function(e){var t=e._order;if(t){var n=t.next,s=t.prev;if(n)n.prev=s;else return;s?s.next=n:n&&(this._drawFirst=n),t.prev=this._drawLast,this._drawLast.next=t,t.next=null,this._drawLast=t,this._requestRedraw(e)}},_bringToBack:function(e){var t=e._order;if(t){var n=t.next,s=t.prev;if(s)s.next=n;else return;n?n.prev=s:s&&(this._drawLast=s),t.prev=null,t.next=this._drawFirst,this._drawFirst.prev=t,this._drawFirst=t,this._requestRedraw(e)}}});function canvas(e){return U.canvas?new At(e):null}var jt=(function(){try{return document.namespaces.add(`lvml`,`urn:schemas-microsoft-com:vml`),function(e){return document.createElement(`<lvml:`+e+` class="lvml">`)}}catch{}return function(e){return document.createElement(`<`+e+` xmlns="urn:schemas-microsoft.com:vml" class="lvml">`)}})(),Mt={_initContainer:function(){this._container=create$1(`div`,`leaflet-vml-container`)},_update:function(){this._map._animatingZoom||(kt.prototype._update.call(this),this.fire(`update`))},_initPath:function(e){var t=e._container=jt(`shape`);addClass(t,`leaflet-vml-shape `+(this.options.className||``)),t.coordsize=`1 1`,e._path=jt(`path`),t.appendChild(e._path),this._updateStyle(e),this._layers[stamp(e)]=e},_addPath:function(e){var t=e._container;this._container.appendChild(t),e.options.interactive&&e.addInteractiveTarget(t)},_removePath:function(e){var t=e._container;remove(t),e.removeInteractiveTarget(t),delete this._layers[stamp(e)]},_updateStyle:function(e){var t=e._stroke,n=e._fill,s=e.options,c=e._container;c.stroked=!!s.stroke,c.filled=!!s.fill,s.stroke?(t||=e._stroke=jt(`stroke`),c.appendChild(t),t.weight=s.weight+`px`,t.color=s.color,t.opacity=s.opacity,s.dashArray?t.dashStyle=l(s.dashArray)?s.dashArray.join(` `):s.dashArray.replace(/( *, *)/g,` `):t.dashStyle=``,t.endcap=s.lineCap.replace(`butt`,`flat`),t.joinstyle=s.lineJoin):t&&(c.removeChild(t),e._stroke=null),s.fill?(n||=e._fill=jt(`fill`),c.appendChild(n),n.color=s.fillColor||s.color,n.opacity=s.fillOpacity):n&&(c.removeChild(n),e._fill=null)},_updateCircle:function(e){var t=e._point.round(),n=Math.round(e._radius),s=Math.round(e._radiusY||n);this._setPath(e,e._empty()?`M0 0`:`AL `+t.x+`,`+t.y+` `+n+`,`+s+` 0,23592600`)},_setPath:function(e,t){e._path.v=t},_bringToFront:function(e){toFront(e._container)},_bringToBack:function(e){toBack(e._container)}},Nt=U.vml?jt:svgCreate,Pt=kt.extend({_initContainer:function(){this._container=Nt(`svg`),this._container.setAttribute(`pointer-events`,`none`),this._rootGroup=Nt(`g`),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){remove(this._container),off(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){kt.prototype._update.call(this);var e=this._bounds,t=e.getSize(),n=this._container;(!this._svgSize||!this._svgSize.equals(t))&&(this._svgSize=t,n.setAttribute(`width`,t.x),n.setAttribute(`height`,t.y)),setPosition(n,e.min),n.setAttribute(`viewBox`,[e.min.x,e.min.y,t.x,t.y].join(` `)),this.fire(`update`)}},_initPath:function(e){var t=e._path=Nt(`path`);e.options.className&&addClass(t,e.options.className),e.options.interactive&&addClass(t,`leaflet-interactive`),this._updateStyle(e),this._layers[stamp(e)]=e},_addPath:function(e){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(e._path),e.addInteractiveTarget(e._path)},_removePath:function(e){remove(e._path),e.removeInteractiveTarget(e._path),delete this._layers[stamp(e)]},_updatePath:function(e){e._project(),e._update()},_updateStyle:function(e){var t=e._path,n=e.options;t&&(n.stroke?(t.setAttribute(`stroke`,n.color),t.setAttribute(`stroke-opacity`,n.opacity),t.setAttribute(`stroke-width`,n.weight),t.setAttribute(`stroke-linecap`,n.lineCap),t.setAttribute(`stroke-linejoin`,n.lineJoin),n.dashArray?t.setAttribute(`stroke-dasharray`,n.dashArray):t.removeAttribute(`stroke-dasharray`),n.dashOffset?t.setAttribute(`stroke-dashoffset`,n.dashOffset):t.removeAttribute(`stroke-dashoffset`)):t.setAttribute(`stroke`,`none`),n.fill?(t.setAttribute(`fill`,n.fillColor||n.color),t.setAttribute(`fill-opacity`,n.fillOpacity),t.setAttribute(`fill-rule`,n.fillRule||`evenodd`)):t.setAttribute(`fill`,`none`))},_updatePoly:function(e,t){this._setPath(e,pointsToPath(e._parts,t))},_updateCircle:function(e){var t=e._point,n=Math.max(Math.round(e._radius),1),s=Math.max(Math.round(e._radiusY),1)||n,c=`a`+n+`,`+s+` 0 1,0 `,l=e._empty()?`M0 0`:`M`+(t.x-n)+`,`+t.y+c+n*2+`,0 `+c+-n*2+`,0 `;this._setPath(e,l)},_setPath:function(e,t){e._path.setAttribute(`d`,t)},_bringToFront:function(e){toFront(e._path)},_bringToBack:function(e){toBack(e._path)}});U.vml&&Pt.include(Mt);function svg(e){return U.svg||U.vml?new Pt(e):null}J.include({getRenderer:function(e){var t=e.options.renderer||this._getPaneRenderer(e.options.pane)||this.options.renderer||this._renderer;return t||=this._renderer=this._createRenderer(),this.hasLayer(t)||this.addLayer(t),t},_getPaneRenderer:function(e){if(e===`overlayPane`||e===void 0)return!1;var t=this._paneRenderers[e];return t===void 0&&(t=this._createRenderer({pane:e}),this._paneRenderers[e]=t),t},_createRenderer:function(e){return this.options.preferCanvas&&canvas(e)||svg(e)}});var Ft=ht.extend({initialize:function(e,t){ht.prototype.initialize.call(this,this._boundsToLatLngs(e),t)},setBounds:function(e){return this.setLatLngs(this._boundsToLatLngs(e))},_boundsToLatLngs:function(e){return e=toLatLngBounds(e),[e.getSouthWest(),e.getNorthWest(),e.getNorthEast(),e.getSouthEast()]}});function rectangle(e,t){return new Ft(e,t)}Pt.create=Nt,Pt.pointsToPath=pointsToPath,gt.geometryToLayer=geometryToLayer,gt.coordsToLatLng=coordsToLatLng,gt.coordsToLatLngs=coordsToLatLngs,gt.latLngToCoords=latLngToCoords,gt.latLngsToCoords=latLngsToCoords,gt.getFeature=getFeature,gt.asFeature=asFeature,J.mergeOptions({boxZoom:!0});var It=Ge.extend({initialize:function(e){this._map=e,this._container=e._container,this._pane=e._panes.overlayPane,this._resetStateTimeout=0,e.on(`unload`,this._destroy,this)},addHooks:function(){on(this._container,`mousedown`,this._onMouseDown,this)},removeHooks:function(){off(this._container,`mousedown`,this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){remove(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(e){if(!e.shiftKey||e.which!==1&&e.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),disableTextSelection(),disableImageDrag(),this._startPoint=this._map.mouseEventToContainerPoint(e),on(document,{contextmenu:stop,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(e){this._moved||(this._moved=!0,this._box=create$1(`div`,`leaflet-zoom-box`,this._container),addClass(this._container,`leaflet-crosshair`),this._map.fire(`boxzoomstart`)),this._point=this._map.mouseEventToContainerPoint(e);var t=new Bounds(this._point,this._startPoint),n=t.getSize();setPosition(this._box,t.min),this._box.style.width=n.x+`px`,this._box.style.height=n.y+`px`},_finish:function(){this._moved&&(remove(this._box),removeClass(this._container,`leaflet-crosshair`)),enableTextSelection(),enableImageDrag(),off(document,{contextmenu:stop,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(e){if(!(e.which!==1&&e.button!==1)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(bind(this._resetState,this),0);var t=new LatLngBounds(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(t).fire(`boxzoomend`,{boxZoomBounds:t})}},_onKeyDown:function(e){e.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});J.addInitHook(`addHandler`,`boxZoom`,It),J.mergeOptions({doubleClickZoom:!0});var Lt=Ge.extend({addHooks:function(){this._map.on(`dblclick`,this._onDoubleClick,this)},removeHooks:function(){this._map.off(`dblclick`,this._onDoubleClick,this)},_onDoubleClick:function(e){var t=this._map,n=t.getZoom(),s=t.options.zoomDelta,c=e.originalEvent.shiftKey?n-s:n+s;t.options.doubleClickZoom===`center`?t.setZoom(c):t.setZoomAround(e.containerPoint,c)}});J.addInitHook(`addHandler`,`doubleClickZoom`,Lt),J.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var Rt=Ge.extend({addHooks:function(){if(!this._draggable){var e=this._map;this._draggable=new Je(e._mapPane,e._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on(`predrag`,this._onPreDragLimit,this),e.options.worldCopyJump&&(this._draggable.on(`predrag`,this._onPreDragWrap,this),e.on(`zoomend`,this._onZoomEnd,this),e.whenReady(this._onZoomEnd,this))}addClass(this._map._container,`leaflet-grab leaflet-touch-drag`),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){removeClass(this._map._container,`leaflet-grab`),removeClass(this._map._container,`leaflet-touch-drag`),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var e=this._map;if(e._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var t=toLatLngBounds(this._map.options.maxBounds);this._offsetLimit=toBounds(this._map.latLngToContainerPoint(t.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(t.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;e.fire(`movestart`).fire(`dragstart`),e.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(e){if(this._map.options.inertia){var t=this._lastTime=+new Date,n=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(n),this._times.push(t),this._prunePositions(t)}this._map.fire(`move`,e).fire(`drag`,e)},_prunePositions:function(e){for(;this._positions.length>1&&e-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var e=this._map.getSize().divideBy(2),t=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=t.subtract(e).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(e,t){return e-(e-t)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var e=this._draggable._newPos.subtract(this._draggable._startPos),t=this._offsetLimit;e.x<t.min.x&&(e.x=this._viscousLimit(e.x,t.min.x)),e.y<t.min.y&&(e.y=this._viscousLimit(e.y,t.min.y)),e.x>t.max.x&&(e.x=this._viscousLimit(e.x,t.max.x)),e.y>t.max.y&&(e.y=this._viscousLimit(e.y,t.max.y)),this._draggable._newPos=this._draggable._startPos.add(e)}},_onPreDragWrap:function(){var e=this._worldWidth,t=Math.round(e/2),n=this._initialWorldOffset,s=this._draggable._newPos.x,c=(s-t+n)%e+t-n,l=(s+t+n)%e-t-n,d=Math.abs(c+n)<Math.abs(l+n)?c:l;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=d},_onDragEnd:function(e){var t=this._map,n=t.options,s=!n.inertia||e.noInertia||this._times.length<2;if(t.fire(`dragend`,e),s)t.fire(`moveend`);else{this._prunePositions(+new Date);var c=this._lastPos.subtract(this._positions[0]),l=(this._lastTime-this._times[0])/1e3,d=n.easeLinearity,f=c.multiplyBy(d/l),p=f.distanceTo([0,0]),m=Math.min(n.inertiaMaxSpeed,p),h=f.multiplyBy(m/p),g=m/(n.inertiaDeceleration*d),_=h.multiplyBy(-g/2).round();!_.x&&!_.y?t.fire(`moveend`):(_=t._limitOffset(_,t.options.maxBounds),requestAnimFrame(function(){t.panBy(_,{duration:g,easeLinearity:d,noMoveStart:!0,animate:!0})}))}}});J.addInitHook(`addHandler`,`dragging`,Rt),J.mergeOptions({keyboard:!0,keyboardPanDelta:80});var zt=Ge.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(e){this._map=e,this._setPanDelta(e.options.keyboardPanDelta),this._setZoomDelta(e.options.zoomDelta)},addHooks:function(){var e=this._map._container;e.tabIndex<=0&&(e.tabIndex=`0`),on(e,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),off(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var e=document.body,t=document.documentElement,n=e.scrollTop||t.scrollTop,s=e.scrollLeft||t.scrollLeft;this._map._container.focus(),window.scrollTo(s,n)}},_onFocus:function(){this._focused=!0,this._map.fire(`focus`)},_onBlur:function(){this._focused=!1,this._map.fire(`blur`)},_setPanDelta:function(e){var t=this._panKeys={},n=this.keyCodes,s,c;for(s=0,c=n.left.length;s<c;s++)t[n.left[s]]=[-1*e,0];for(s=0,c=n.right.length;s<c;s++)t[n.right[s]]=[e,0];for(s=0,c=n.down.length;s<c;s++)t[n.down[s]]=[0,e];for(s=0,c=n.up.length;s<c;s++)t[n.up[s]]=[0,-1*e]},_setZoomDelta:function(e){var t=this._zoomKeys={},n=this.keyCodes,s,c;for(s=0,c=n.zoomIn.length;s<c;s++)t[n.zoomIn[s]]=e;for(s=0,c=n.zoomOut.length;s<c;s++)t[n.zoomOut[s]]=-e},_addHooks:function(){on(document,`keydown`,this._onKeyDown,this)},_removeHooks:function(){off(document,`keydown`,this._onKeyDown,this)},_onKeyDown:function(e){if(!(e.altKey||e.ctrlKey||e.metaKey)){var t=e.keyCode,n=this._map,s;if(t in this._panKeys){if(!n._panAnim||!n._panAnim._inProgress)if(s=this._panKeys[t],e.shiftKey&&(s=toPoint(s).multiplyBy(3)),n.options.maxBounds&&(s=n._limitOffset(toPoint(s),n.options.maxBounds)),n.options.worldCopyJump){var c=n.wrapLatLng(n.unproject(n.project(n.getCenter()).add(s)));n.panTo(c)}else n.panBy(s)}else if(t in this._zoomKeys)n.setZoom(n.getZoom()+(e.shiftKey?3:1)*this._zoomKeys[t]);else if(t===27&&n._popup&&n._popup.options.closeOnEscapeKey)n.closePopup();else return;stop(e)}}});J.addInitHook(`addHandler`,`keyboard`,zt),J.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var Bt=Ge.extend({addHooks:function(){on(this._map._container,`wheel`,this._onWheelScroll,this),this._delta=0},removeHooks:function(){off(this._map._container,`wheel`,this._onWheelScroll,this)},_onWheelScroll:function(e){var t=getWheelDelta(e),n=this._map.options.wheelDebounceTime;this._delta+=t,this._lastMousePos=this._map.mouseEventToContainerPoint(e),this._startTime||=+new Date;var s=Math.max(n-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(bind(this._performZoom,this),s),stop(e)},_performZoom:function(){var e=this._map,t=e.getZoom(),n=this._map.options.zoomSnap||0;e._stop();var s=this._delta/(this._map.options.wheelPxPerZoomLevel*4),c=4*Math.log(2/(1+Math.exp(-Math.abs(s))))/Math.LN2,l=n?Math.ceil(c/n)*n:c,d=e._limitZoom(t+(this._delta>0?l:-l))-t;this._delta=0,this._startTime=null,d&&(e.options.scrollWheelZoom===`center`?e.setZoom(t+d):e.setZoomAround(this._lastMousePos,t+d))}});J.addInitHook(`addHandler`,`scrollWheelZoom`,Bt);var Vt=600;J.mergeOptions({tapHold:U.touchNative&&U.safari&&U.mobile,tapTolerance:15});var Ht=Ge.extend({addHooks:function(){on(this._map._container,`touchstart`,this._onDown,this)},removeHooks:function(){off(this._map._container,`touchstart`,this._onDown,this)},_onDown:function(e){if(clearTimeout(this._holdTimeout),e.touches.length===1){var t=e.touches[0];this._startPos=this._newPos=new Point(t.clientX,t.clientY),this._holdTimeout=setTimeout(bind(function(){this._cancel(),this._isTapValid()&&(on(document,`touchend`,preventDefault),on(document,`touchend touchcancel`,this._cancelClickPrevent),this._simulateEvent(`contextmenu`,t))},this),Vt),on(document,`touchend touchcancel contextmenu`,this._cancel,this),on(document,`touchmove`,this._onMove,this)}},_cancelClickPrevent:function cancelClickPrevent(){off(document,`touchend`,preventDefault),off(document,`touchend touchcancel`,cancelClickPrevent)},_cancel:function(){clearTimeout(this._holdTimeout),off(document,`touchend touchcancel contextmenu`,this._cancel,this),off(document,`touchmove`,this._onMove,this)},_onMove:function(e){var t=e.touches[0];this._newPos=new Point(t.clientX,t.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(e,t){var n=new MouseEvent(e,{bubbles:!0,cancelable:!0,view:window,screenX:t.screenX,screenY:t.screenY,clientX:t.clientX,clientY:t.clientY});n._simulated=!0,t.target.dispatchEvent(n)}});J.addInitHook(`addHandler`,`tapHold`,Ht),J.mergeOptions({touchZoom:U.touch,bounceAtZoomLimits:!0});var Ut=Ge.extend({addHooks:function(){addClass(this._map._container,`leaflet-touch-zoom`),on(this._map._container,`touchstart`,this._onTouchStart,this)},removeHooks:function(){removeClass(this._map._container,`leaflet-touch-zoom`),off(this._map._container,`touchstart`,this._onTouchStart,this)},_onTouchStart:function(e){var t=this._map;if(!(!e.touches||e.touches.length!==2||t._animatingZoom||this._zooming)){var n=t.mouseEventToContainerPoint(e.touches[0]),s=t.mouseEventToContainerPoint(e.touches[1]);this._centerPoint=t.getSize()._divideBy(2),this._startLatLng=t.containerPointToLatLng(this._centerPoint),t.options.touchZoom!==`center`&&(this._pinchStartLatLng=t.containerPointToLatLng(n.add(s)._divideBy(2))),this._startDist=n.distanceTo(s),this._startZoom=t.getZoom(),this._moved=!1,this._zooming=!0,t._stop(),on(document,`touchmove`,this._onTouchMove,this),on(document,`touchend touchcancel`,this._onTouchEnd,this),preventDefault(e)}},_onTouchMove:function(e){if(!(!e.touches||e.touches.length!==2||!this._zooming)){var t=this._map,n=t.mouseEventToContainerPoint(e.touches[0]),s=t.mouseEventToContainerPoint(e.touches[1]),c=n.distanceTo(s)/this._startDist;if(this._zoom=t.getScaleZoom(c,this._startZoom),!t.options.bounceAtZoomLimits&&(this._zoom<t.getMinZoom()&&c<1||this._zoom>t.getMaxZoom()&&c>1)&&(this._zoom=t._limitZoom(this._zoom)),t.options.touchZoom===`center`){if(this._center=this._startLatLng,c===1)return}else{var l=n._add(s)._divideBy(2)._subtract(this._centerPoint);if(c===1&&l.x===0&&l.y===0)return;this._center=t.unproject(t.project(this._pinchStartLatLng,this._zoom).subtract(l),this._zoom)}this._moved||=(t._moveStart(!0,!1),!0),cancelAnimFrame(this._animRequest);var d=bind(t._move,t,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=requestAnimFrame(d,this,!0),preventDefault(e)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,cancelAnimFrame(this._animRequest),off(document,`touchmove`,this._onTouchMove,this),off(document,`touchend touchcancel`,this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});J.addInitHook(`addHandler`,`touchZoom`,Ut),J.BoxZoom=It,J.DoubleClickZoom=Lt,J.Drag=Rt,J.Keyboard=zt,J.ScrollWheelZoom=Bt,J.TapHold=Ht,J.TouchZoom=Ut,e.Bounds=Bounds,e.Browser=U,e.CRS=y,e.Canvas=At,e.Circle=pt,e.CircleMarker=ft,e.Class=Class,e.Control=Be,e.DivIcon=Tt,e.DivOverlay=St,e.DomEvent=Re,e.DomUtil=K,e.Draggable=Je,e.Evented=_,e.FeatureGroup=ot,e.GeoJSON=gt,e.GridLayer=Et,e.Handler=Ge,e.Icon=st,e.ImageOverlay=yt,e.LatLng=LatLng,e.LatLngBounds=LatLngBounds,e.Layer=it,e.LayerGroup=at,e.LineUtil=Ze,e.Map=J,e.Marker=ut,e.Mixin=Ke,e.Path=dt,e.Point=Point,e.PolyUtil=Ye,e.Polygon=ht,e.Polyline=mt,e.Popup=Ct,e.PosAnimation=ze,e.Projection=et,e.Rectangle=Ft,e.Renderer=kt,e.SVG=Pt,e.SVGOverlay=xt,e.TileLayer=Dt,e.Tooltip=wt,e.Transformation=Transformation,e.Util=h,e.VideoOverlay=bt,e.bind=bind,e.bounds=toBounds,e.canvas=canvas,e.circle=circle,e.circleMarker=circleMarker,e.control=control,e.divIcon=divIcon,e.extend=extend,e.featureGroup=featureGroup,e.geoJSON=geoJSON,e.geoJson=vt,e.gridLayer=gridLayer,e.icon=icon,e.imageOverlay=imageOverlay,e.latLng=toLatLng,e.latLngBounds=toLatLngBounds,e.layerGroup=layerGroup,e.map=createMap,e.marker=marker,e.point=toPoint,e.polygon=polygon,e.polyline=polyline,e.popup=popup,e.rectangle=rectangle,e.setOptions=setOptions,e.stamp=stamp,e.svg=svg,e.svgOverlay=svgOverlay,e.tileLayer=tileLayer,e.tooltip=tooltip,e.transformation=toTransformation,e.version=t,e.videoOverlay=videoOverlay;var Wt=window.L;e.noConflict=function(){return window.L=Wt,this},window.L=e}))}))(),1);(function(e,t,n){function o(e,t){for(;(e=e.parentElement)&&!e.classList.contains(t););return e}L.drawVersion=`1.0.4`,L.Draw={},L.drawLocal={draw:{toolbar:{actions:{title:`Cancel drawing`,text:`Cancel`},finish:{title:`Finish drawing`,text:`Finish`},undo:{title:`Delete last point drawn`,text:`Delete last point`},buttons:{polyline:`Draw a polyline`,polygon:`Draw a polygon`,rectangle:`Draw a rectangle`,circle:`Draw a circle`,marker:`Draw a marker`,circlemarker:`Draw a circlemarker`}},handlers:{circle:{tooltip:{start:`Click and drag to draw circle.`},radius:`Radius`},circlemarker:{tooltip:{start:`Click map to place circle marker.`}},marker:{tooltip:{start:`Click map to place marker.`}},polygon:{tooltip:{start:`Click to start drawing shape.`,cont:`Click to continue drawing shape.`,end:`Click first point to close this shape.`}},polyline:{error:`<strong>Error:</strong> shape edges cannot cross!`,tooltip:{start:`Click to start drawing line.`,cont:`Click to continue drawing line.`,end:`Click last point to finish line.`}},rectangle:{tooltip:{start:`Click and drag to draw rectangle.`}},simpleshape:{tooltip:{end:`Release mouse to finish drawing.`}}}},edit:{toolbar:{actions:{save:{title:`Save changes`,text:`Save`},cancel:{title:`Cancel editing, discards all changes`,text:`Cancel`},clearAll:{title:`Clear all layers`,text:`Clear All`}},buttons:{edit:`Edit layers`,editDisabled:`No layers to edit`,remove:`Delete layers`,removeDisabled:`No layers to delete`}},handlers:{edit:{tooltip:{text:`Drag handles or markers to edit features.`,subtext:`Click cancel to undo changes.`}},remove:{tooltip:{text:`Click on a feature to remove.`}}}}},L.Draw.Event={},L.Draw.Event.CREATED=`draw:created`,L.Draw.Event.EDITED=`draw:edited`,L.Draw.Event.DELETED=`draw:deleted`,L.Draw.Event.DRAWSTART=`draw:drawstart`,L.Draw.Event.DRAWSTOP=`draw:drawstop`,L.Draw.Event.DRAWVERTEX=`draw:drawvertex`,L.Draw.Event.EDITSTART=`draw:editstart`,L.Draw.Event.EDITMOVE=`draw:editmove`,L.Draw.Event.EDITRESIZE=`draw:editresize`,L.Draw.Event.EDITVERTEX=`draw:editvertex`,L.Draw.Event.EDITSTOP=`draw:editstop`,L.Draw.Event.DELETESTART=`draw:deletestart`,L.Draw.Event.DELETESTOP=`draw:deletestop`,L.Draw.Event.TOOLBAROPENED=`draw:toolbaropened`,L.Draw.Event.TOOLBARCLOSED=`draw:toolbarclosed`,L.Draw.Event.MARKERCONTEXT=`draw:markercontext`,L.Draw=L.Draw||{},L.Draw.Feature=L.Handler.extend({initialize:function(e,t){this._map=e,this._container=e._container,this._overlayPane=e._panes.overlayPane,this._popupPane=e._panes.popupPane,t&&t.shapeOptions&&(t.shapeOptions=L.Util.extend({},this.options.shapeOptions,t.shapeOptions)),L.setOptions(this,t);var n=L.version.split(`.`);parseInt(n[0],10)===1&&parseInt(n[1],10)>=2?L.Draw.Feature.include(L.Evented.prototype):L.Draw.Feature.include(L.Mixin.Events)},enable:function(){this._enabled||(L.Handler.prototype.enable.call(this),this.fire(`enabled`,{handler:this.type}),this._map.fire(L.Draw.Event.DRAWSTART,{layerType:this.type}))},disable:function(){this._enabled&&(L.Handler.prototype.disable.call(this),this._map.fire(L.Draw.Event.DRAWSTOP,{layerType:this.type}),this.fire(`disabled`,{handler:this.type}))},addHooks:function(){var e=this._map;e&&(L.DomUtil.disableTextSelection(),e.getContainer().focus(),this._tooltip=new L.Draw.Tooltip(this._map),L.DomEvent.on(this._container,`keyup`,this._cancelDrawing,this))},removeHooks:function(){this._map&&(L.DomUtil.enableTextSelection(),this._tooltip.dispose(),this._tooltip=null,L.DomEvent.off(this._container,`keyup`,this._cancelDrawing,this))},setOptions:function(e){L.setOptions(this,e)},_fireCreatedEvent:function(e){this._map.fire(L.Draw.Event.CREATED,{layer:e,layerType:this.type})},_cancelDrawing:function(e){e.keyCode===27&&(this._map.fire(`draw:canceled`,{layerType:this.type}),this.disable())}}),L.Draw.Polyline=L.Draw.Feature.extend({statics:{TYPE:`polyline`},Poly:L.Polyline,options:{allowIntersection:!0,repeatMode:!1,drawError:{color:`#b00b00`,timeout:2500},icon:new L.DivIcon({iconSize:new L.Point(8,8),className:`leaflet-div-icon leaflet-editing-icon`}),touchIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:`leaflet-div-icon leaflet-editing-icon leaflet-touch-icon`}),guidelineDistance:20,maxGuideLineLength:4e3,shapeOptions:{stroke:!0,color:`#3388ff`,weight:4,opacity:.5,fill:!1,clickable:!0},metric:!0,feet:!0,nautic:!1,showLength:!0,zIndexOffset:2e3,factor:1,maxPoints:0},initialize:function(e,t){L.Browser.touch&&(this.options.icon=this.options.touchIcon),this.options.drawError.message=L.drawLocal.draw.handlers.polyline.error,t&&t.drawError&&(t.drawError=L.Util.extend({},this.options.drawError,t.drawError)),this.type=L.Draw.Polyline.TYPE,L.Draw.Feature.prototype.initialize.call(this,e,t)},addHooks:function(){L.Draw.Feature.prototype.addHooks.call(this),this._map&&(this._markers=[],this._markerGroup=new L.LayerGroup,this._map.addLayer(this._markerGroup),this._poly=new L.Polyline([],this.options.shapeOptions),this._tooltip.updateContent(this._getTooltipText()),this._mouseMarker||=L.marker(this._map.getCenter(),{icon:L.divIcon({className:`leaflet-mouse-marker`,iconAnchor:[20,20],iconSize:[40,40]}),opacity:0,zIndexOffset:this.options.zIndexOffset}),this._mouseMarker.on(`mouseout`,this._onMouseOut,this).on(`mousemove`,this._onMouseMove,this).on(`mousedown`,this._onMouseDown,this).on(`mouseup`,this._onMouseUp,this).addTo(this._map),this._map.on(`mouseup`,this._onMouseUp,this).on(`mousemove`,this._onMouseMove,this).on(`zoomlevelschange`,this._onZoomEnd,this).on(`touchstart`,this._onTouch,this).on(`zoomend`,this._onZoomEnd,this))},removeHooks:function(){L.Draw.Feature.prototype.removeHooks.call(this),this._clearHideErrorTimeout(),this._cleanUpShape(),this._map.removeLayer(this._markerGroup),delete this._markerGroup,delete this._markers,this._map.removeLayer(this._poly),delete this._poly,this._mouseMarker.off(`mousedown`,this._onMouseDown,this).off(`mouseout`,this._onMouseOut,this).off(`mouseup`,this._onMouseUp,this).off(`mousemove`,this._onMouseMove,this),this._map.removeLayer(this._mouseMarker),delete this._mouseMarker,this._clearGuides(),this._map.off(`mouseup`,this._onMouseUp,this).off(`mousemove`,this._onMouseMove,this).off(`zoomlevelschange`,this._onZoomEnd,this).off(`zoomend`,this._onZoomEnd,this).off(`touchstart`,this._onTouch,this).off(`click`,this._onTouch,this)},deleteLastVertex:function(){if(!(this._markers.length<=1)){var e=this._markers.pop(),t=this._poly,n=t.getLatLngs(),s=n.splice(-1,1)[0];this._poly.setLatLngs(n),this._markerGroup.removeLayer(e),t.getLatLngs().length<2&&this._map.removeLayer(t),this._vertexChanged(s,!1)}},addVertex:function(e){if(this._markers.length>=2&&!this.options.allowIntersection&&this._poly.newLatLngIntersects(e))return void this._showErrorTooltip();this._errorShown&&this._hideErrorTooltip(),this._markers.push(this._createMarker(e)),this._poly.addLatLng(e),this._poly.getLatLngs().length===2&&this._map.addLayer(this._poly),this._vertexChanged(e,!0)},completeShape:function(){this._markers.length<=1||!this._shapeIsValid()||(this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable())},_finishShape:function(){var e=this._poly._defaultShape?this._poly._defaultShape():this._poly.getLatLngs(),t=this._poly.newLatLngIntersects(e[e.length-1]);if(!this.options.allowIntersection&&t||!this._shapeIsValid())return void this._showErrorTooltip();this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable()},_shapeIsValid:function(){return!0},_onZoomEnd:function(){this._markers!==null&&this._updateGuide()},_onMouseMove:function(e){var t=this._map.mouseEventToLayerPoint(e.originalEvent),n=this._map.layerPointToLatLng(t);this._currentLatLng=n,this._updateTooltip(n),this._updateGuide(t),this._mouseMarker.setLatLng(n),L.DomEvent.preventDefault(e.originalEvent)},_vertexChanged:function(e,t){this._map.fire(L.Draw.Event.DRAWVERTEX,{layers:this._markerGroup}),this._updateFinishHandler(),this._updateRunningMeasure(e,t),this._clearGuides(),this._updateTooltip()},_onMouseDown:function(e){if(!this._clickHandled&&!this._touchHandled&&!this._disableMarkers){this._onMouseMove(e),this._clickHandled=!0,this._disableNewMarkers();var t=e.originalEvent,n=t.clientX,s=t.clientY;this._startPoint.call(this,n,s)}},_startPoint:function(e,t){this._mouseDownOrigin=L.point(e,t)},_onMouseUp:function(e){var t=e.originalEvent,n=t.clientX,s=t.clientY;this._endPoint.call(this,n,s,e),this._clickHandled=null},_endPoint:function(t,n,s){if(this._mouseDownOrigin){var c=L.point(t,n).distanceTo(this._mouseDownOrigin),l=this._calculateFinishDistance(s.latlng);this.options.maxPoints>1&&this.options.maxPoints==this._markers.length+1?(this.addVertex(s.latlng),this._finishShape()):l<10&&L.Browser.touch?this._finishShape():Math.abs(c)<9*(e.devicePixelRatio||1)&&this.addVertex(s.latlng),this._enableNewMarkers()}this._mouseDownOrigin=null},_onTouch:function(e){var t,n,s=e.originalEvent;!s.touches||!s.touches[0]||this._clickHandled||this._touchHandled||this._disableMarkers||(t=s.touches[0].clientX,n=s.touches[0].clientY,this._disableNewMarkers(),this._touchHandled=!0,this._startPoint.call(this,t,n),this._endPoint.call(this,t,n,e),this._touchHandled=null),this._clickHandled=null},_onMouseOut:function(){this._tooltip&&this._tooltip._onMouseOut.call(this._tooltip)},_calculateFinishDistance:function(e){var t;if(this._markers.length>0){var n;if(this.type===L.Draw.Polyline.TYPE)n=this._markers[this._markers.length-1];else{if(this.type!==L.Draw.Polygon.TYPE)return 1/0;n=this._markers[0]}var s=this._map.latLngToContainerPoint(n.getLatLng()),c=new L.Marker(e,{icon:this.options.icon,zIndexOffset:2*this.options.zIndexOffset}),l=this._map.latLngToContainerPoint(c.getLatLng());t=s.distanceTo(l)}else t=1/0;return t},_updateFinishHandler:function(){var e=this._markers.length;e>1&&this._markers[e-1].on(`click`,this._finishShape,this),e>2&&this._markers[e-2].off(`click`,this._finishShape,this)},_createMarker:function(e){var t=new L.Marker(e,{icon:this.options.icon,zIndexOffset:2*this.options.zIndexOffset});return this._markerGroup.addLayer(t),t},_updateGuide:function(e){var t=this._markers?this._markers.length:0;t>0&&(e||=this._map.latLngToLayerPoint(this._currentLatLng),this._clearGuides(),this._drawGuide(this._map.latLngToLayerPoint(this._markers[t-1].getLatLng()),e))},_updateTooltip:function(e){var t=this._getTooltipText();e&&this._tooltip.updatePosition(e),this._errorShown||this._tooltip.updateContent(t)},_drawGuide:function(e,t){var n,s,c,l=Math.floor(Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)),d=this.options.guidelineDistance,f=this.options.maxGuideLineLength,p=l>f?l-f:d;for(this._guidesContainer||=L.DomUtil.create(`div`,`leaflet-draw-guides`,this._overlayPane);p<l;p+=this.options.guidelineDistance)n=p/l,s={x:Math.floor(e.x*(1-n)+n*t.x),y:Math.floor(e.y*(1-n)+n*t.y)},c=L.DomUtil.create(`div`,`leaflet-draw-guide-dash`,this._guidesContainer),c.style.backgroundColor=this._errorShown?this.options.drawError.color:this.options.shapeOptions.color,L.DomUtil.setPosition(c,s)},_updateGuideColor:function(e){if(this._guidesContainer)for(var t=0,n=this._guidesContainer.childNodes.length;t<n;t++)this._guidesContainer.childNodes[t].style.backgroundColor=e},_clearGuides:function(){if(this._guidesContainer)for(;this._guidesContainer.firstChild;)this._guidesContainer.removeChild(this._guidesContainer.firstChild)},_getTooltipText:function(){var e,t,n=this.options.showLength;return this._markers.length===0?e={text:L.drawLocal.draw.handlers.polyline.tooltip.start}:(t=n?this._getMeasurementString():``,e=this._markers.length===1?{text:L.drawLocal.draw.handlers.polyline.tooltip.cont,subtext:t}:{text:L.drawLocal.draw.handlers.polyline.tooltip.end,subtext:t}),e},_updateRunningMeasure:function(e,t){var n,s,c=this._markers.length;this._markers.length===1?this._measurementRunningTotal=0:(n=c-(t?2:1),s=L.GeometryUtil.isVersion07x()?e.distanceTo(this._markers[n].getLatLng())*(this.options.factor||1):this._map.distance(e,this._markers[n].getLatLng())*(this.options.factor||1),this._measurementRunningTotal+=s*(t?1:-1))},_getMeasurementString:function(){var e,t=this._currentLatLng,n=this._markers[this._markers.length-1].getLatLng();return e=L.GeometryUtil.isVersion07x()?n&&t&&t.distanceTo?this._measurementRunningTotal+t.distanceTo(n)*(this.options.factor||1):this._measurementRunningTotal||0:n&&t?this._measurementRunningTotal+this._map.distance(t,n)*(this.options.factor||1):this._measurementRunningTotal||0,L.GeometryUtil.readableDistance(e,this.options.metric,this.options.feet,this.options.nautic,this.options.precision)},_showErrorTooltip:function(){this._errorShown=!0,this._tooltip.showAsError().updateContent({text:this.options.drawError.message}),this._updateGuideColor(this.options.drawError.color),this._poly.setStyle({color:this.options.drawError.color}),this._clearHideErrorTimeout(),this._hideErrorTimeout=setTimeout(L.Util.bind(this._hideErrorTooltip,this),this.options.drawError.timeout)},_hideErrorTooltip:function(){this._errorShown=!1,this._clearHideErrorTimeout(),this._tooltip.removeError().updateContent(this._getTooltipText()),this._updateGuideColor(this.options.shapeOptions.color),this._poly.setStyle({color:this.options.shapeOptions.color})},_clearHideErrorTimeout:function(){this._hideErrorTimeout&&=(clearTimeout(this._hideErrorTimeout),null)},_disableNewMarkers:function(){this._disableMarkers=!0},_enableNewMarkers:function(){setTimeout(function(){this._disableMarkers=!1}.bind(this),50)},_cleanUpShape:function(){this._markers.length>1&&this._markers[this._markers.length-1].off(`click`,this._finishShape,this)},_fireCreatedEvent:function(){var e=new this.Poly(this._poly.getLatLngs(),this.options.shapeOptions);L.Draw.Feature.prototype._fireCreatedEvent.call(this,e)}}),L.Draw.Polygon=L.Draw.Polyline.extend({statics:{TYPE:`polygon`},Poly:L.Polygon,options:{showArea:!1,showLength:!1,shapeOptions:{stroke:!0,color:`#3388ff`,weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0},metric:!0,feet:!0,nautic:!1,precision:{}},initialize:function(e,t){L.Draw.Polyline.prototype.initialize.call(this,e,t),this.type=L.Draw.Polygon.TYPE},_updateFinishHandler:function(){var e=this._markers.length;e===1&&this._markers[0].on(`click`,this._finishShape,this),e>2&&(this._markers[e-1].on(`dblclick`,this._finishShape,this),e>3&&this._markers[e-2].off(`dblclick`,this._finishShape,this))},_getTooltipText:function(){var e,t;return this._markers.length===0?e=L.drawLocal.draw.handlers.polygon.tooltip.start:this._markers.length<3?(e=L.drawLocal.draw.handlers.polygon.tooltip.cont,t=this._getMeasurementString()):(e=L.drawLocal.draw.handlers.polygon.tooltip.end,t=this._getMeasurementString()),{text:e,subtext:t}},_getMeasurementString:function(){var e=this._area,t=``;return e||this.options.showLength?(this.options.showLength&&(t=L.Draw.Polyline.prototype._getMeasurementString.call(this)),e&&(t+=`<br>`+L.GeometryUtil.readableArea(e,this.options.metric,this.options.precision)),t):null},_shapeIsValid:function(){return this._markers.length>=3},_vertexChanged:function(e,t){var n;!this.options.allowIntersection&&this.options.showArea&&(n=this._poly.getLatLngs(),this._area=L.GeometryUtil.geodesicArea(n)),L.Draw.Polyline.prototype._vertexChanged.call(this,e,t)},_cleanUpShape:function(){var e=this._markers.length;e>0&&(this._markers[0].off(`click`,this._finishShape,this),e>2&&this._markers[e-1].off(`dblclick`,this._finishShape,this))}}),L.SimpleShape={},L.Draw.SimpleShape=L.Draw.Feature.extend({options:{repeatMode:!1},initialize:function(e,t){this._endLabelText=L.drawLocal.draw.handlers.simpleshape.tooltip.end,L.Draw.Feature.prototype.initialize.call(this,e,t)},addHooks:function(){L.Draw.Feature.prototype.addHooks.call(this),this._map&&(this._mapDraggable=this._map.dragging.enabled(),this._mapDraggable&&this._map.dragging.disable(),this._container.style.cursor=`crosshair`,this._tooltip.updateContent({text:this._initialLabelText}),this._map.on(`mousedown`,this._onMouseDown,this).on(`mousemove`,this._onMouseMove,this).on(`touchstart`,this._onMouseDown,this).on(`touchmove`,this._onMouseMove,this),t.addEventListener(`touchstart`,L.DomEvent.preventDefault,{passive:!1}))},removeHooks:function(){L.Draw.Feature.prototype.removeHooks.call(this),this._map&&(this._mapDraggable&&this._map.dragging.enable(),this._container.style.cursor=``,this._map.off(`mousedown`,this._onMouseDown,this).off(`mousemove`,this._onMouseMove,this).off(`touchstart`,this._onMouseDown,this).off(`touchmove`,this._onMouseMove,this),L.DomEvent.off(t,`mouseup`,this._onMouseUp,this),L.DomEvent.off(t,`touchend`,this._onMouseUp,this),t.removeEventListener(`touchstart`,L.DomEvent.preventDefault),this._shape&&(this._map.removeLayer(this._shape),delete this._shape)),this._isDrawing=!1},_getTooltipText:function(){return{text:this._endLabelText}},_onMouseDown:function(e){this._isDrawing=!0,this._startLatLng=e.latlng,L.DomEvent.on(t,`mouseup`,this._onMouseUp,this).on(t,`touchend`,this._onMouseUp,this).preventDefault(e.originalEvent)},_onMouseMove:function(e){var t=e.latlng;this._tooltip.updatePosition(t),this._isDrawing&&(this._tooltip.updateContent(this._getTooltipText()),this._drawShape(t))},_onMouseUp:function(){this._shape&&this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable()}}),L.Draw.Rectangle=L.Draw.SimpleShape.extend({statics:{TYPE:`rectangle`},options:{shapeOptions:{stroke:!0,color:`#3388ff`,weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0},showArea:!0,metric:!0},initialize:function(e,t){this.type=L.Draw.Rectangle.TYPE,this._initialLabelText=L.drawLocal.draw.handlers.rectangle.tooltip.start,L.Draw.SimpleShape.prototype.initialize.call(this,e,t)},disable:function(){this._enabled&&(this._isCurrentlyTwoClickDrawing=!1,L.Draw.SimpleShape.prototype.disable.call(this))},_onMouseUp:function(e){if(!this._shape&&!this._isCurrentlyTwoClickDrawing)return void(this._isCurrentlyTwoClickDrawing=!0);this._isCurrentlyTwoClickDrawing&&!o(e.target,`leaflet-pane`)||L.Draw.SimpleShape.prototype._onMouseUp.call(this)},_drawShape:function(e){this._shape?this._shape.setBounds(new L.LatLngBounds(this._startLatLng,e)):(this._shape=new L.Rectangle(new L.LatLngBounds(this._startLatLng,e),this.options.shapeOptions),this._map.addLayer(this._shape))},_fireCreatedEvent:function(){var e=new L.Rectangle(this._shape.getBounds(),this.options.shapeOptions);L.Draw.SimpleShape.prototype._fireCreatedEvent.call(this,e)},_getTooltipText:function(){var e,t,n,s=L.Draw.SimpleShape.prototype._getTooltipText.call(this),c=this._shape,l=this.options.showArea;return c&&(e=this._shape._defaultShape?this._shape._defaultShape():this._shape.getLatLngs(),t=L.GeometryUtil.geodesicArea(e),n=l?L.GeometryUtil.readableArea(t,this.options.metric):``),{text:s.text,subtext:n}}}),L.Draw.Marker=L.Draw.Feature.extend({statics:{TYPE:`marker`},options:{icon:new L.Icon.Default,repeatMode:!1,zIndexOffset:2e3},initialize:function(e,t){this.type=L.Draw.Marker.TYPE,this._initialLabelText=L.drawLocal.draw.handlers.marker.tooltip.start,L.Draw.Feature.prototype.initialize.call(this,e,t)},addHooks:function(){L.Draw.Feature.prototype.addHooks.call(this),this._map&&(this._tooltip.updateContent({text:this._initialLabelText}),this._mouseMarker||=L.marker(this._map.getCenter(),{icon:L.divIcon({className:`leaflet-mouse-marker`,iconAnchor:[20,20],iconSize:[40,40]}),opacity:0,zIndexOffset:this.options.zIndexOffset}),this._mouseMarker.on(`click`,this._onClick,this).addTo(this._map),this._map.on(`mousemove`,this._onMouseMove,this),this._map.on(`click`,this._onTouch,this))},removeHooks:function(){L.Draw.Feature.prototype.removeHooks.call(this),this._map&&(this._map.off(`click`,this._onClick,this).off(`click`,this._onTouch,this),this._marker&&(this._marker.off(`click`,this._onClick,this),this._map.removeLayer(this._marker),delete this._marker),this._mouseMarker.off(`click`,this._onClick,this),this._map.removeLayer(this._mouseMarker),delete this._mouseMarker,this._map.off(`mousemove`,this._onMouseMove,this))},_onMouseMove:function(e){var t=e.latlng;this._tooltip.updatePosition(t),this._mouseMarker.setLatLng(t),this._marker?(t=this._mouseMarker.getLatLng(),this._marker.setLatLng(t)):(this._marker=this._createMarker(t),this._marker.on(`click`,this._onClick,this),this._map.on(`click`,this._onClick,this).addLayer(this._marker))},_createMarker:function(e){return new L.Marker(e,{icon:this.options.icon,zIndexOffset:this.options.zIndexOffset})},_onClick:function(){this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable()},_onTouch:function(e){this._onMouseMove(e),this._onClick()},_fireCreatedEvent:function(){var e=new L.Marker.Touch(this._marker.getLatLng(),{icon:this.options.icon});L.Draw.Feature.prototype._fireCreatedEvent.call(this,e)}}),L.Draw.CircleMarker=L.Draw.Marker.extend({statics:{TYPE:`circlemarker`},options:{stroke:!0,color:`#3388ff`,weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0,zIndexOffset:2e3},initialize:function(e,t){this.type=L.Draw.CircleMarker.TYPE,this._initialLabelText=L.drawLocal.draw.handlers.circlemarker.tooltip.start,L.Draw.Feature.prototype.initialize.call(this,e,t)},_fireCreatedEvent:function(){var e=new L.CircleMarker(this._marker.getLatLng(),this.options);L.Draw.Feature.prototype._fireCreatedEvent.call(this,e)},_createMarker:function(e){return new L.CircleMarker(e,this.options)}}),L.Draw.Circle=L.Draw.SimpleShape.extend({statics:{TYPE:`circle`},options:{shapeOptions:{stroke:!0,color:`#3388ff`,weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0},showRadius:!0,metric:!0,feet:!0,nautic:!1},initialize:function(e,t){this.type=L.Draw.Circle.TYPE,this._initialLabelText=L.drawLocal.draw.handlers.circle.tooltip.start,L.Draw.SimpleShape.prototype.initialize.call(this,e,t)},_drawShape:function(e){if(L.GeometryUtil.isVersion07x())var t=this._startLatLng.distanceTo(e);else var t=this._map.distance(this._startLatLng,e);this._shape?this._shape.setRadius(t):(this._shape=new L.Circle(this._startLatLng,t,this.options.shapeOptions),this._map.addLayer(this._shape))},_fireCreatedEvent:function(){var e=new L.Circle(this._startLatLng,this._shape.getRadius(),this.options.shapeOptions);L.Draw.SimpleShape.prototype._fireCreatedEvent.call(this,e)},_onMouseMove:function(e){var t,n=e.latlng,s=this.options.showRadius,c=this.options.metric;if(this._tooltip.updatePosition(n),this._isDrawing){this._drawShape(n),t=this._shape.getRadius().toFixed(1);var l=``;s&&(l=L.drawLocal.draw.handlers.circle.radius+`: `+L.GeometryUtil.readableDistance(t,c,this.options.feet,this.options.nautic)),this._tooltip.updateContent({text:this._endLabelText,subtext:l})}}}),L.Edit=L.Edit||{},L.Edit.Marker=L.Handler.extend({initialize:function(e,t){this._marker=e,L.setOptions(this,t)},addHooks:function(){var e=this._marker;e.dragging.enable(),e.on(`dragend`,this._onDragEnd,e),this._toggleMarkerHighlight()},removeHooks:function(){var e=this._marker;e.dragging.disable(),e.off(`dragend`,this._onDragEnd,e),this._toggleMarkerHighlight()},_onDragEnd:function(e){var t=e.target;t.edited=!0,this._map.fire(L.Draw.Event.EDITMOVE,{layer:t})},_toggleMarkerHighlight:function(){var e=this._marker._icon;e&&(e.style.display=`none`,L.DomUtil.hasClass(e,`leaflet-edit-marker-selected`)?(L.DomUtil.removeClass(e,`leaflet-edit-marker-selected`),this._offsetMarker(e,-4)):(L.DomUtil.addClass(e,`leaflet-edit-marker-selected`),this._offsetMarker(e,4)),e.style.display=``)},_offsetMarker:function(e,t){var n=parseInt(e.style.marginTop,10)-t,s=parseInt(e.style.marginLeft,10)-t;e.style.marginTop=n+`px`,e.style.marginLeft=s+`px`}}),L.Marker.addInitHook(function(){L.Edit.Marker&&(this.editing=new L.Edit.Marker(this),this.options.editable&&this.editing.enable())}),L.Edit=L.Edit||{},L.Edit.Poly=L.Handler.extend({initialize:function(e){this.latlngs=[e._latlngs],e._holes&&(this.latlngs=this.latlngs.concat(e._holes)),this._poly=e,this._poly.on(`revert-edited`,this._updateLatLngs,this)},_defaultShape:function(){return L.Polyline._flat?L.Polyline._flat(this._poly._latlngs)?this._poly._latlngs:this._poly._latlngs[0]:this._poly._latlngs},_eachVertexHandler:function(e){for(var t=0;t<this._verticesHandlers.length;t++)e(this._verticesHandlers[t])},addHooks:function(){this._initHandlers(),this._eachVertexHandler(function(e){e.addHooks()})},removeHooks:function(){this._eachVertexHandler(function(e){e.removeHooks()})},updateMarkers:function(){this._eachVertexHandler(function(e){e.updateMarkers()})},_initHandlers:function(){this._verticesHandlers=[];for(var e=0;e<this.latlngs.length;e++)this._verticesHandlers.push(new L.Edit.PolyVerticesEdit(this._poly,this.latlngs[e],this._poly.options.poly))},_updateLatLngs:function(e){this.latlngs=[e.layer._latlngs],e.layer._holes&&(this.latlngs=this.latlngs.concat(e.layer._holes))}}),L.Edit.PolyVerticesEdit=L.Handler.extend({options:{icon:new L.DivIcon({iconSize:new L.Point(8,8),className:`leaflet-div-icon leaflet-editing-icon`}),touchIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:`leaflet-div-icon leaflet-editing-icon leaflet-touch-icon`}),drawError:{color:`#b00b00`,timeout:1e3}},initialize:function(e,t,n){L.Browser.touch&&(this.options.icon=this.options.touchIcon),this._poly=e,n&&n.drawError&&(n.drawError=L.Util.extend({},this.options.drawError,n.drawError)),this._latlngs=t,L.setOptions(this,n)},_defaultShape:function(){return L.Polyline._flat?L.Polyline._flat(this._latlngs)?this._latlngs:this._latlngs[0]:this._latlngs},addHooks:function(){var e=this._poly,t=e._path;e instanceof L.Polygon||(e.options.fill=!1,e.options.editing&&(e.options.editing.fill=!1)),t&&e.options.editing&&e.options.editing.className&&(e.options.original.className&&e.options.original.className.split(` `).forEach(function(e){L.DomUtil.removeClass(t,e)}),e.options.editing.className.split(` `).forEach(function(e){L.DomUtil.addClass(t,e)})),e.setStyle(e.options.editing),this._poly._map&&(this._map=this._poly._map,this._markerGroup||this._initMarkers(),this._poly._map.addLayer(this._markerGroup))},removeHooks:function(){var e=this._poly,t=e._path;t&&e.options.editing&&e.options.editing.className&&(e.options.editing.className.split(` `).forEach(function(e){L.DomUtil.removeClass(t,e)}),e.options.original.className&&e.options.original.className.split(` `).forEach(function(e){L.DomUtil.addClass(t,e)})),e.setStyle(e.options.original),e._map&&(e._map.removeLayer(this._markerGroup),delete this._markerGroup,delete this._markers)},updateMarkers:function(){this._markerGroup.clearLayers(),this._initMarkers()},_initMarkers:function(){this._markerGroup||=new L.LayerGroup,this._markers=[];var e,t,n,s,c=this._defaultShape();for(e=0,n=c.length;e<n;e++)s=this._createMarker(c[e],e),s.on(`click`,this._onMarkerClick,this),s.on(`contextmenu`,this._onContextMenu,this),this._markers.push(s);var l,d;for(e=0,t=n-1;e<n;t=e++)(e!==0||L.Polygon&&this._poly instanceof L.Polygon)&&(l=this._markers[t],d=this._markers[e],this._createMiddleMarker(l,d),this._updatePrevNext(l,d))},_createMarker:function(e,t){var n=new L.Marker.Touch(e,{draggable:!0,icon:this.options.icon});return n._origLatLng=e,n._index=t,n.on(`dragstart`,this._onMarkerDragStart,this).on(`drag`,this._onMarkerDrag,this).on(`dragend`,this._fireEdit,this).on(`touchmove`,this._onTouchMove,this).on(`touchend`,this._fireEdit,this).on(`MSPointerMove`,this._onTouchMove,this).on(`MSPointerUp`,this._fireEdit,this),this._markerGroup.addLayer(n),n},_onMarkerDragStart:function(){this._poly.fire(`editstart`)},_spliceLatLngs:function(){var e=this._defaultShape(),t=[].splice.apply(e,arguments);return this._poly._convertLatLngs(e,!0),this._poly.redraw(),t},_removeMarker:function(e){var t=e._index;this._markerGroup.removeLayer(e),this._markers.splice(t,1),this._spliceLatLngs(t,1),this._updateIndexes(t,-1),e.off(`dragstart`,this._onMarkerDragStart,this).off(`drag`,this._onMarkerDrag,this).off(`dragend`,this._fireEdit,this).off(`touchmove`,this._onMarkerDrag,this).off(`touchend`,this._fireEdit,this).off(`click`,this._onMarkerClick,this).off(`MSPointerMove`,this._onTouchMove,this).off(`MSPointerUp`,this._fireEdit,this)},_fireEdit:function(){this._poly.edited=!0,this._poly.fire(`edit`),this._poly._map.fire(L.Draw.Event.EDITVERTEX,{layers:this._markerGroup,poly:this._poly})},_onMarkerDrag:function(e){var t=e.target,n=this._poly,s=L.LatLngUtil.cloneLatLng(t._origLatLng);if(L.extend(t._origLatLng,t._latlng),n.options.poly){var c=n._map._editTooltip;if(!n.options.poly.allowIntersection&&n.intersects()){L.extend(t._origLatLng,s),t.setLatLng(s);var l=n.options.color;n.setStyle({color:this.options.drawError.color}),c&&c.updateContent({text:L.drawLocal.draw.handlers.polyline.error}),setTimeout(function(){n.setStyle({color:l}),c&&c.updateContent({text:L.drawLocal.edit.handlers.edit.tooltip.text,subtext:L.drawLocal.edit.handlers.edit.tooltip.subtext})},1e3)}}t._middleLeft&&t._middleLeft.setLatLng(this._getMiddleLatLng(t._prev,t)),t._middleRight&&t._middleRight.setLatLng(this._getMiddleLatLng(t,t._next)),this._poly._bounds._southWest=L.latLng(1/0,1/0),this._poly._bounds._northEast=L.latLng(-1/0,-1/0);var d=this._poly.getLatLngs();this._poly._convertLatLngs(d,!0),this._poly.redraw(),this._poly.fire(`editdrag`)},_onMarkerClick:function(e){var t=L.Polygon&&this._poly instanceof L.Polygon?4:3,n=e.target;this._defaultShape().length<t||(this._removeMarker(n),this._updatePrevNext(n._prev,n._next),n._middleLeft&&this._markerGroup.removeLayer(n._middleLeft),n._middleRight&&this._markerGroup.removeLayer(n._middleRight),n._prev&&n._next?this._createMiddleMarker(n._prev,n._next):n._prev?n._next||(n._prev._middleRight=null):n._next._middleLeft=null,this._fireEdit())},_onContextMenu:function(e){var t=e.target;this._poly,this._poly._map.fire(L.Draw.Event.MARKERCONTEXT,{marker:t,layers:this._markerGroup,poly:this._poly}),L.DomEvent.stopPropagation},_onTouchMove:function(e){var t=this._map.mouseEventToLayerPoint(e.originalEvent.touches[0]),n=this._map.layerPointToLatLng(t),s=e.target;L.extend(s._origLatLng,n),s._middleLeft&&s._middleLeft.setLatLng(this._getMiddleLatLng(s._prev,s)),s._middleRight&&s._middleRight.setLatLng(this._getMiddleLatLng(s,s._next)),this._poly.redraw(),this.updateMarkers()},_updateIndexes:function(e,t){this._markerGroup.eachLayer(function(n){n._index>e&&(n._index+=t)})},_createMiddleMarker:function(e,t){var i,o,a,n=this._getMiddleLatLng(e,t),s=this._createMarker(n);s.setOpacity(.6),e._middleRight=t._middleLeft=s,o=function(){s.off(`touchmove`,o,this);var c=t._index;s._index=c,s.off(`click`,i,this).on(`click`,this._onMarkerClick,this),n.lat=s.getLatLng().lat,n.lng=s.getLatLng().lng,this._spliceLatLngs(c,0,n),this._markers.splice(c,0,s),s.setOpacity(1),this._updateIndexes(c,1),t._index++,this._updatePrevNext(e,s),this._updatePrevNext(s,t),this._poly.fire(`editstart`)},a=function(){s.off(`dragstart`,o,this),s.off(`dragend`,a,this),s.off(`touchmove`,o,this),this._createMiddleMarker(e,s),this._createMiddleMarker(s,t)},i=function(){o.call(this),a.call(this),this._fireEdit()},s.on(`click`,i,this).on(`dragstart`,o,this).on(`dragend`,a,this).on(`touchmove`,o,this),this._markerGroup.addLayer(s)},_updatePrevNext:function(e,t){e&&(e._next=t),t&&(t._prev=e)},_getMiddleLatLng:function(e,t){var n=this._poly._map,s=n.project(e.getLatLng()),c=n.project(t.getLatLng());return n.unproject(s._add(c)._divideBy(2))}}),L.Polyline.addInitHook(function(){this.editing||(L.Edit.Poly&&(this.editing=new L.Edit.Poly(this),this.options.editable&&this.editing.enable()),this.on(`add`,function(){this.editing&&this.editing.enabled()&&this.editing.addHooks()}),this.on(`remove`,function(){this.editing&&this.editing.enabled()&&this.editing.removeHooks()}))}),L.Edit=L.Edit||{},L.Edit.SimpleShape=L.Handler.extend({options:{moveIcon:new L.DivIcon({iconSize:new L.Point(8,8),className:`leaflet-div-icon leaflet-editing-icon leaflet-edit-move`}),resizeIcon:new L.DivIcon({iconSize:new L.Point(8,8),className:`leaflet-div-icon leaflet-editing-icon leaflet-edit-resize`}),touchMoveIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:`leaflet-div-icon leaflet-editing-icon leaflet-edit-move leaflet-touch-icon`}),touchResizeIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:`leaflet-div-icon leaflet-editing-icon leaflet-edit-resize leaflet-touch-icon`})},initialize:function(e,t){L.Browser.touch&&(this.options.moveIcon=this.options.touchMoveIcon,this.options.resizeIcon=this.options.touchResizeIcon),this._shape=e,L.Util.setOptions(this,t)},addHooks:function(){var e=this._shape;this._shape._map&&(this._map=this._shape._map,e.setStyle(e.options.editing),e._map&&(this._map=e._map,this._markerGroup||this._initMarkers(),this._map.addLayer(this._markerGroup)))},removeHooks:function(){var e=this._shape;if(e.setStyle(e.options.original),e._map){this._unbindMarker(this._moveMarker);for(var t=0,n=this._resizeMarkers.length;t<n;t++)this._unbindMarker(this._resizeMarkers[t]);this._resizeMarkers=null,this._map.removeLayer(this._markerGroup),delete this._markerGroup}this._map=null},updateMarkers:function(){this._markerGroup.clearLayers(),this._initMarkers()},_initMarkers:function(){this._markerGroup||=new L.LayerGroup,this._createMoveMarker(),this._createResizeMarker()},_createMoveMarker:function(){},_createResizeMarker:function(){},_createMarker:function(e,t){var n=new L.Marker.Touch(e,{draggable:!0,icon:t,zIndexOffset:10});return this._bindMarker(n),this._markerGroup.addLayer(n),n},_bindMarker:function(e){e.on(`dragstart`,this._onMarkerDragStart,this).on(`drag`,this._onMarkerDrag,this).on(`dragend`,this._onMarkerDragEnd,this).on(`touchstart`,this._onTouchStart,this).on(`touchmove`,this._onTouchMove,this).on(`MSPointerMove`,this._onTouchMove,this).on(`touchend`,this._onTouchEnd,this).on(`MSPointerUp`,this._onTouchEnd,this)},_unbindMarker:function(e){e.off(`dragstart`,this._onMarkerDragStart,this).off(`drag`,this._onMarkerDrag,this).off(`dragend`,this._onMarkerDragEnd,this).off(`touchstart`,this._onTouchStart,this).off(`touchmove`,this._onTouchMove,this).off(`MSPointerMove`,this._onTouchMove,this).off(`touchend`,this._onTouchEnd,this).off(`MSPointerUp`,this._onTouchEnd,this)},_onMarkerDragStart:function(e){e.target.setOpacity(0),this._shape.fire(`editstart`)},_fireEdit:function(){this._shape.edited=!0,this._shape.fire(`edit`)},_onMarkerDrag:function(e){var t=e.target,n=t.getLatLng();t===this._moveMarker?this._move(n):this._resize(n),this._shape.redraw(),this._shape.fire(`editdrag`)},_onMarkerDragEnd:function(e){e.target.setOpacity(1),this._fireEdit()},_onTouchStart:function(e){if(L.Edit.SimpleShape.prototype._onMarkerDragStart.call(this,e),typeof this._getCorners==`function`){var t=this._getCorners(),n=e.target,s=n._cornerIndex;n.setOpacity(0),this._oppositeCorner=t[(s+2)%4],this._toggleCornerMarkers(0,s)}this._shape.fire(`editstart`)},_onTouchMove:function(e){var t=this._map.mouseEventToLayerPoint(e.originalEvent.touches[0]),n=this._map.layerPointToLatLng(t);return e.target===this._moveMarker?this._move(n):this._resize(n),this._shape.redraw(),!1},_onTouchEnd:function(e){e.target.setOpacity(1),this.updateMarkers(),this._fireEdit()},_move:function(){},_resize:function(){}}),L.Edit=L.Edit||{},L.Edit.Rectangle=L.Edit.SimpleShape.extend({_createMoveMarker:function(){var e=this._shape.getBounds().getCenter();this._moveMarker=this._createMarker(e,this.options.moveIcon)},_createResizeMarker:function(){var e=this._getCorners();this._resizeMarkers=[];for(var t=0,n=e.length;t<n;t++)this._resizeMarkers.push(this._createMarker(e[t],this.options.resizeIcon)),this._resizeMarkers[t]._cornerIndex=t},_onMarkerDragStart:function(e){L.Edit.SimpleShape.prototype._onMarkerDragStart.call(this,e);var t=this._getCorners(),n=e.target._cornerIndex;this._oppositeCorner=t[(n+2)%4],this._toggleCornerMarkers(0,n)},_onMarkerDragEnd:function(e){var t,n,s=e.target;s===this._moveMarker&&(t=this._shape.getBounds(),n=t.getCenter(),s.setLatLng(n)),this._toggleCornerMarkers(1),this._repositionCornerMarkers(),L.Edit.SimpleShape.prototype._onMarkerDragEnd.call(this,e)},_move:function(e){for(var t,n=this._shape._defaultShape?this._shape._defaultShape():this._shape.getLatLngs(),s=this._shape.getBounds().getCenter(),c=[],l=0,d=n.length;l<d;l++)t=[n[l].lat-s.lat,n[l].lng-s.lng],c.push([e.lat+t[0],e.lng+t[1]]);this._shape.setLatLngs(c),this._repositionCornerMarkers(),this._map.fire(L.Draw.Event.EDITMOVE,{layer:this._shape})},_resize:function(e){var t;this._shape.setBounds(L.latLngBounds(e,this._oppositeCorner)),t=this._shape.getBounds(),this._moveMarker.setLatLng(t.getCenter()),this._map.fire(L.Draw.Event.EDITRESIZE,{layer:this._shape})},_getCorners:function(){var e=this._shape.getBounds();return[e.getNorthWest(),e.getNorthEast(),e.getSouthEast(),e.getSouthWest()]},_toggleCornerMarkers:function(e){for(var t=0,n=this._resizeMarkers.length;t<n;t++)this._resizeMarkers[t].setOpacity(e)},_repositionCornerMarkers:function(){for(var e=this._getCorners(),t=0,n=this._resizeMarkers.length;t<n;t++)this._resizeMarkers[t].setLatLng(e[t])}}),L.Rectangle.addInitHook(function(){L.Edit.Rectangle&&(this.editing=new L.Edit.Rectangle(this),this.options.editable&&this.editing.enable())}),L.Edit=L.Edit||{},L.Edit.CircleMarker=L.Edit.SimpleShape.extend({_createMoveMarker:function(){var e=this._shape.getLatLng();this._moveMarker=this._createMarker(e,this.options.moveIcon)},_createResizeMarker:function(){this._resizeMarkers=[]},_move:function(e){if(this._resizeMarkers.length){var t=this._getResizeMarkerPoint(e);this._resizeMarkers[0].setLatLng(t)}this._shape.setLatLng(e),this._map.fire(L.Draw.Event.EDITMOVE,{layer:this._shape})}}),L.CircleMarker.addInitHook(function(){L.Edit.CircleMarker&&(this.editing=new L.Edit.CircleMarker(this),this.options.editable&&this.editing.enable()),this.on(`add`,function(){this.editing&&this.editing.enabled()&&this.editing.addHooks()}),this.on(`remove`,function(){this.editing&&this.editing.enabled()&&this.editing.removeHooks()})}),L.Edit=L.Edit||{},L.Edit.Circle=L.Edit.CircleMarker.extend({_createResizeMarker:function(){var e=this._shape.getLatLng(),t=this._getResizeMarkerPoint(e);this._resizeMarkers=[],this._resizeMarkers.push(this._createMarker(t,this.options.resizeIcon))},_getResizeMarkerPoint:function(e){var t=this._shape._radius*Math.cos(Math.PI/4),n=this._map.project(e);return this._map.unproject([n.x+t,n.y-t])},_resize:function(e){var t=this._moveMarker.getLatLng();radius=L.GeometryUtil.isVersion07x()?t.distanceTo(e):this._map.distance(t,e),this._shape.setRadius(radius),this._map.editTooltip&&this._map._editTooltip.updateContent({text:L.drawLocal.edit.handlers.edit.tooltip.subtext+`<br />`+L.drawLocal.edit.handlers.edit.tooltip.text,subtext:L.drawLocal.draw.handlers.circle.radius+`: `+L.GeometryUtil.readableDistance(radius,!0,this.options.feet,this.options.nautic)}),this._shape.setRadius(radius),this._map.fire(L.Draw.Event.EDITRESIZE,{layer:this._shape})}}),L.Circle.addInitHook(function(){L.Edit.Circle&&(this.editing=new L.Edit.Circle(this),this.options.editable&&this.editing.enable())}),L.Map.mergeOptions({touchExtend:!0}),L.Map.TouchExtend=L.Handler.extend({initialize:function(e){this._map=e,this._container=e._container,this._pane=e._panes.overlayPane},addHooks:function(){L.DomEvent.on(this._container,`touchstart`,this._onTouchStart,this),L.DomEvent.on(this._container,`touchend`,this._onTouchEnd,this),L.DomEvent.on(this._container,`touchmove`,this._onTouchMove,this),this._detectIE()?(L.DomEvent.on(this._container,`MSPointerDown`,this._onTouchStart,this),L.DomEvent.on(this._container,`MSPointerUp`,this._onTouchEnd,this),L.DomEvent.on(this._container,`MSPointerMove`,this._onTouchMove,this),L.DomEvent.on(this._container,`MSPointerCancel`,this._onTouchCancel,this)):(L.DomEvent.on(this._container,`touchcancel`,this._onTouchCancel,this),L.DomEvent.on(this._container,`touchleave`,this._onTouchLeave,this))},removeHooks:function(){L.DomEvent.off(this._container,`touchstart`,this._onTouchStart,this),L.DomEvent.off(this._container,`touchend`,this._onTouchEnd,this),L.DomEvent.off(this._container,`touchmove`,this._onTouchMove,this),this._detectIE()?(L.DomEvent.off(this._container,`MSPointerDown`,this._onTouchStart,this),L.DomEvent.off(this._container,`MSPointerUp`,this._onTouchEnd,this),L.DomEvent.off(this._container,`MSPointerMove`,this._onTouchMove,this),L.DomEvent.off(this._container,`MSPointerCancel`,this._onTouchCancel,this)):(L.DomEvent.off(this._container,`touchcancel`,this._onTouchCancel,this),L.DomEvent.off(this._container,`touchleave`,this._onTouchLeave,this))},_touchEvent:function(e,t){var n={};if(e.touches!==void 0){if(!e.touches.length)return;n=e.touches[0]}else if(e.pointerType!==`touch`||(n=e,!this._filterClick(e)))return;var s=this._map.mouseEventToContainerPoint(n),c=this._map.mouseEventToLayerPoint(n),l=this._map.layerPointToLatLng(c);this._map.fire(t,{latlng:l,layerPoint:c,containerPoint:s,pageX:n.pageX,pageY:n.pageY,originalEvent:e})},_filterClick:function(e){var t=e.timeStamp||e.originalEvent.timeStamp,n=L.DomEvent._lastClick&&t-L.DomEvent._lastClick;return n&&n>100&&n<500||e.target._simulatedClick&&!e._simulated?(L.DomEvent.stop(e),!1):(L.DomEvent._lastClick=t,!0)},_onTouchStart:function(e){this._map._loaded&&this._touchEvent(e,`touchstart`)},_onTouchEnd:function(e){this._map._loaded&&this._touchEvent(e,`touchend`)},_onTouchCancel:function(e){if(this._map._loaded){var t=`touchcancel`;this._detectIE()&&(t=`pointercancel`),this._touchEvent(e,t)}},_onTouchLeave:function(e){this._map._loaded&&this._touchEvent(e,`touchleave`)},_onTouchMove:function(e){this._map._loaded&&this._touchEvent(e,`touchmove`)},_detectIE:function(){var t=e.navigator.userAgent,n=t.indexOf(`MSIE `);if(n>0)return parseInt(t.substring(n+5,t.indexOf(`.`,n)),10);if(t.indexOf(`Trident/`)>0){var s=t.indexOf(`rv:`);return parseInt(t.substring(s+3,t.indexOf(`.`,s)),10)}var c=t.indexOf(`Edge/`);return c>0&&parseInt(t.substring(c+5,t.indexOf(`.`,c)),10)}}),L.Map.addInitHook(`addHandler`,`touchExtend`,L.Map.TouchExtend),L.Marker.Touch=L.Marker.extend({_initInteraction:function(){return this.addInteractiveTarget?L.Marker.prototype._initInteraction.apply(this):this._initInteractionLegacy()},_initInteractionLegacy:function(){if(this.options.clickable){var e=this._icon,t=[`dblclick`,`mousedown`,`mouseover`,`mouseout`,`contextmenu`,`touchstart`,`touchend`,`touchmove`];this._detectIE?t.concat([`MSPointerDown`,`MSPointerUp`,`MSPointerMove`,`MSPointerCancel`]):t.concat([`touchcancel`]),L.DomUtil.addClass(e,`leaflet-clickable`),L.DomEvent.on(e,`click`,this._onMouseClick,this),L.DomEvent.on(e,`keypress`,this._onKeyPress,this);for(var n=0;n<t.length;n++)L.DomEvent.on(e,t[n],this._fireMouseEvent,this);L.Handler.MarkerDrag&&(this.dragging=new L.Handler.MarkerDrag(this),this.options.draggable&&this.dragging.enable())}},_detectIE:function(){var t=e.navigator.userAgent,n=t.indexOf(`MSIE `);if(n>0)return parseInt(t.substring(n+5,t.indexOf(`.`,n)),10);if(t.indexOf(`Trident/`)>0){var s=t.indexOf(`rv:`);return parseInt(t.substring(s+3,t.indexOf(`.`,s)),10)}var c=t.indexOf(`Edge/`);return c>0&&parseInt(t.substring(c+5,t.indexOf(`.`,c)),10)}}),L.LatLngUtil={cloneLatLngs:function(e){for(var t=[],n=0,s=e.length;n<s;n++)Array.isArray(e[n])?t.push(L.LatLngUtil.cloneLatLngs(e[n])):t.push(this.cloneLatLng(e[n]));return t},cloneLatLng:function(e){return L.latLng(e.lat,e.lng)}},function(){var e={km:2,ha:2,m:0,mi:2,ac:2,yd:0,ft:0,nm:2};L.GeometryUtil=L.extend(L.GeometryUtil||{},{geodesicArea:function(e){var t,n,s=e.length,c=0,l=Math.PI/180;if(s>2){for(var d=0;d<s;d++)t=e[d],n=e[(d+1)%s],c+=(n.lng-t.lng)*l*(2+Math.sin(t.lat*l)+Math.sin(n.lat*l));c=6378137*c*6378137/2}return Math.abs(c)},formattedNumber:function(e,t){var n=parseFloat(e).toFixed(t),s=L.drawLocal.format&&L.drawLocal.format.numeric,c=s&&s.delimiters,l=c&&c.thousands,d=c&&c.decimal;if(l||d){var f=n.split(`.`);n=l?f[0].replace(/(\d)(?=(\d{3})+(?!\d))/g,`$1`+l):f[0],d||=`.`,f.length>1&&(n=n+d+f[1])}return n},readableArea:function(t,n,s){var c,l,s=L.Util.extend({},e,s);return n?(l=[`ha`,`m`],type=typeof n,type===`string`?l=[n]:type!==`boolean`&&(l=n),c=t>=1e6&&l.indexOf(`km`)!==-1?L.GeometryUtil.formattedNumber(1e-6*t,s.km)+` km²`:t>=1e4&&l.indexOf(`ha`)!==-1?L.GeometryUtil.formattedNumber(1e-4*t,s.ha)+` ha`:L.GeometryUtil.formattedNumber(t,s.m)+` m²`):(t/=.836127,c=t>=3097600?L.GeometryUtil.formattedNumber(t/3097600,s.mi)+` mi²`:t>=4840?L.GeometryUtil.formattedNumber(t/4840,s.ac)+` acres`:L.GeometryUtil.formattedNumber(t,s.yd)+` yd²`),c},readableDistance:function(t,n,s,c,l){var d,l=L.Util.extend({},e,l);switch(n?typeof n==`string`?n:`metric`:s?`feet`:c?`nauticalMile`:`yards`){case`metric`:d=t>1e3?L.GeometryUtil.formattedNumber(t/1e3,l.km)+` km`:L.GeometryUtil.formattedNumber(t,l.m)+` m`;break;case`feet`:t*=3.28083,d=L.GeometryUtil.formattedNumber(t,l.ft)+` ft`;break;case`nauticalMile`:t*=.53996,d=L.GeometryUtil.formattedNumber(t/1e3,l.nm)+` nm`;break;default:t*=1.09361,d=t>1760?L.GeometryUtil.formattedNumber(t/1760,l.mi)+` miles`:L.GeometryUtil.formattedNumber(t,l.yd)+` yd`}return d},isVersion07x:function(){var e=L.version.split(`.`);return parseInt(e[0],10)===0&&parseInt(e[1],10)===7}})}(),L.Util.extend(L.LineUtil,{segmentsIntersect:function(e,t,n,s){return this._checkCounterclockwise(e,n,s)!==this._checkCounterclockwise(t,n,s)&&this._checkCounterclockwise(e,t,n)!==this._checkCounterclockwise(e,t,s)},_checkCounterclockwise:function(e,t,n){return(n.y-e.y)*(t.x-e.x)>(t.y-e.y)*(n.x-e.x)}}),L.Polyline.include({intersects:function(){var e,t,n,s=this._getProjectedPoints(),c=s?s.length:0;if(this._tooFewPointsForIntersection())return!1;for(e=c-1;e>=3;e--)if(t=s[e-1],n=s[e],this._lineSegmentsIntersectsRange(t,n,e-2))return!0;return!1},newLatLngIntersects:function(e,t){return!!this._map&&this.newPointIntersects(this._map.latLngToLayerPoint(e),t)},newPointIntersects:function(e,t){var n=this._getProjectedPoints(),s=n?n.length:0,c=n?n[s-1]:null,l=s-2;return!this._tooFewPointsForIntersection(1)&&this._lineSegmentsIntersectsRange(c,e,l,+!!t)},_tooFewPointsForIntersection:function(e){var t=this._getProjectedPoints(),n=t?t.length:0;return n+=e||0,!t||n<=3},_lineSegmentsIntersectsRange:function(e,t,n,s){var c,l,d=this._getProjectedPoints();s||=0;for(var f=n;f>s;f--)if(c=d[f-1],l=d[f],L.LineUtil.segmentsIntersect(e,t,c,l))return!0;return!1},_getProjectedPoints:function(){if(!this._defaultShape)return this._originalPoints;for(var e=[],t=this._defaultShape(),n=0;n<t.length;n++)e.push(this._map.latLngToLayerPoint(t[n]));return e}}),L.Polygon.include({intersects:function(){var e,t,n,s,c=this._getProjectedPoints();return!this._tooFewPointsForIntersection()&&(!!L.Polyline.prototype.intersects.call(this)||(e=c.length,t=c[0],n=c[e-1],s=e-2,this._lineSegmentsIntersectsRange(n,t,s,1)))}}),L.Control.Draw=L.Control.extend({options:{position:`topleft`,draw:{},edit:!1},initialize:function(e){if(L.version<`0.7`)throw Error(`Leaflet.draw 0.2.3+ requires Leaflet 0.7.0+. Download latest from https://github.com/Leaflet/Leaflet/`);L.Control.prototype.initialize.call(this,e);var t;this._toolbars={},L.DrawToolbar&&this.options.draw&&(t=new L.DrawToolbar(this.options.draw),this._toolbars[L.DrawToolbar.TYPE]=t,this._toolbars[L.DrawToolbar.TYPE].on(`enable`,this._toolbarEnabled,this)),L.EditToolbar&&this.options.edit&&(t=new L.EditToolbar(this.options.edit),this._toolbars[L.EditToolbar.TYPE]=t,this._toolbars[L.EditToolbar.TYPE].on(`enable`,this._toolbarEnabled,this)),L.toolbar=this},onAdd:function(e){var t,n=L.DomUtil.create(`div`,`leaflet-draw`),s=!1;for(var c in this._toolbars)this._toolbars.hasOwnProperty(c)&&(t=this._toolbars[c].addToolbar(e))&&(s||=(L.DomUtil.hasClass(t,`leaflet-draw-toolbar-top`)||L.DomUtil.addClass(t.childNodes[0],`leaflet-draw-toolbar-top`),!0),n.appendChild(t));return n},onRemove:function(){for(var e in this._toolbars)this._toolbars.hasOwnProperty(e)&&this._toolbars[e].removeToolbar()},setDrawingOptions:function(e){for(var t in this._toolbars)this._toolbars[t]instanceof L.DrawToolbar&&this._toolbars[t].setOptions(e)},_toolbarEnabled:function(e){var t=e.target;for(var n in this._toolbars)this._toolbars[n]!==t&&this._toolbars[n].disable()}}),L.Map.mergeOptions({drawControlTooltips:!0,drawControl:!1}),L.Map.addInitHook(function(){this.options.drawControl&&(this.drawControl=new L.Control.Draw,this.addControl(this.drawControl))}),L.Toolbar=L.Class.extend({initialize:function(e){L.setOptions(this,e),this._modes={},this._actionButtons=[],this._activeMode=null;var t=L.version.split(`.`);parseInt(t[0],10)===1&&parseInt(t[1],10)>=2?L.Toolbar.include(L.Evented.prototype):L.Toolbar.include(L.Mixin.Events)},enabled:function(){return this._activeMode!==null},disable:function(){this.enabled()&&this._activeMode.handler.disable()},addToolbar:function(e){var t,n=L.DomUtil.create(`div`,`leaflet-draw-section`),s=0,c=this._toolbarClass||``,l=this.getModeHandlers(e);for(this._toolbarContainer=L.DomUtil.create(`div`,`leaflet-draw-toolbar leaflet-bar`),this._map=e,t=0;t<l.length;t++)l[t].enabled&&this._initModeHandler(l[t].handler,this._toolbarContainer,s++,c,l[t].title);if(s)return this._lastButtonIndex=--s,this._actionsContainer=L.DomUtil.create(`ul`,`leaflet-draw-actions`),n.appendChild(this._toolbarContainer),n.appendChild(this._actionsContainer),n},removeToolbar:function(){for(var e in this._modes)this._modes.hasOwnProperty(e)&&(this._disposeButton(this._modes[e].button,this._modes[e].handler.enable,this._modes[e].handler),this._modes[e].handler.disable(),this._modes[e].handler.off(`enabled`,this._handlerActivated,this).off(`disabled`,this._handlerDeactivated,this));this._modes={};for(var t=0,n=this._actionButtons.length;t<n;t++)this._disposeButton(this._actionButtons[t].button,this._actionButtons[t].callback,this);this._actionButtons=[],this._actionsContainer=null},_initModeHandler:function(e,t,n,s,c){var l=e.type;this._modes[l]={},this._modes[l].handler=e,this._modes[l].button=this._createButton({type:l,title:c,className:s+`-`+l,container:t,callback:this._modes[l].handler.enable,context:this._modes[l].handler}),this._modes[l].buttonIndex=n,this._modes[l].handler.on(`enabled`,this._handlerActivated,this).on(`disabled`,this._handlerDeactivated,this)},_detectIOS:function(){return/iPad|iPhone|iPod/.test(navigator.userAgent)&&!e.MSStream},_createButton:function(e){var t=L.DomUtil.create(`a`,e.className||``,e.container),n=L.DomUtil.create(`span`,`sr-only`,e.container);t.href=`#`,t.appendChild(n),e.title&&(t.title=e.title,n.innerHTML=e.title),e.text&&(t.innerHTML=e.text,n.innerHTML=e.text);var s=this._detectIOS()?`touchstart`:`click`;return L.DomEvent.on(t,`click`,L.DomEvent.stopPropagation).on(t,`mousedown`,L.DomEvent.stopPropagation).on(t,`dblclick`,L.DomEvent.stopPropagation).on(t,`touchstart`,L.DomEvent.stopPropagation).on(t,`click`,L.DomEvent.preventDefault).on(t,s,e.callback,e.context),t},_disposeButton:function(e,t){var n=this._detectIOS()?`touchstart`:`click`;L.DomEvent.off(e,`click`,L.DomEvent.stopPropagation).off(e,`mousedown`,L.DomEvent.stopPropagation).off(e,`dblclick`,L.DomEvent.stopPropagation).off(e,`touchstart`,L.DomEvent.stopPropagation).off(e,`click`,L.DomEvent.preventDefault).off(e,n,t)},_handlerActivated:function(e){this.disable(),this._activeMode=this._modes[e.handler],L.DomUtil.addClass(this._activeMode.button,`leaflet-draw-toolbar-button-enabled`),this._showActionsToolbar(),this.fire(`enable`)},_handlerDeactivated:function(){this._hideActionsToolbar(),L.DomUtil.removeClass(this._activeMode.button,`leaflet-draw-toolbar-button-enabled`),this._activeMode=null,this.fire(`disable`)},_createActions:function(e){var t,n,s,c,l=this._actionsContainer,d=this.getActions(e),f=d.length;for(n=0,s=this._actionButtons.length;n<s;n++)this._disposeButton(this._actionButtons[n].button,this._actionButtons[n].callback);for(this._actionButtons=[];l.firstChild;)l.removeChild(l.firstChild);for(var p=0;p<f;p++)`enabled`in d[p]&&!d[p].enabled||(t=L.DomUtil.create(`li`,``,l),c=this._createButton({title:d[p].title,text:d[p].text,container:t,callback:d[p].callback,context:d[p].context}),this._actionButtons.push({button:c,callback:d[p].callback}))},_showActionsToolbar:function(){var e=this._activeMode.buttonIndex,t=this._lastButtonIndex,n=this._activeMode.button.offsetTop-1;this._createActions(this._activeMode.handler),this._actionsContainer.style.top=n+`px`,e===0&&(L.DomUtil.addClass(this._toolbarContainer,`leaflet-draw-toolbar-notop`),L.DomUtil.addClass(this._actionsContainer,`leaflet-draw-actions-top`)),e===t&&(L.DomUtil.addClass(this._toolbarContainer,`leaflet-draw-toolbar-nobottom`),L.DomUtil.addClass(this._actionsContainer,`leaflet-draw-actions-bottom`)),this._actionsContainer.style.display=`block`,this._map.fire(L.Draw.Event.TOOLBAROPENED)},_hideActionsToolbar:function(){this._actionsContainer.style.display=`none`,L.DomUtil.removeClass(this._toolbarContainer,`leaflet-draw-toolbar-notop`),L.DomUtil.removeClass(this._toolbarContainer,`leaflet-draw-toolbar-nobottom`),L.DomUtil.removeClass(this._actionsContainer,`leaflet-draw-actions-top`),L.DomUtil.removeClass(this._actionsContainer,`leaflet-draw-actions-bottom`),this._map.fire(L.Draw.Event.TOOLBARCLOSED)}}),L.Draw=L.Draw||{},L.Draw.Tooltip=L.Class.extend({initialize:function(e){this._map=e,this._popupPane=e._panes.popupPane,this._visible=!1,this._container=e.options.drawControlTooltips?L.DomUtil.create(`div`,`leaflet-draw-tooltip`,this._popupPane):null,this._singleLineLabel=!1,this._map.on(`mouseout`,this._onMouseOut,this)},dispose:function(){this._map.off(`mouseout`,this._onMouseOut,this),this._container&&=(this._popupPane.removeChild(this._container),null)},updateContent:function(e){return this._container?(e.subtext=e.subtext||``,e.subtext.length!==0||this._singleLineLabel?e.subtext.length>0&&this._singleLineLabel&&(L.DomUtil.removeClass(this._container,`leaflet-draw-tooltip-single`),this._singleLineLabel=!1):(L.DomUtil.addClass(this._container,`leaflet-draw-tooltip-single`),this._singleLineLabel=!0),this._container.innerHTML=(e.subtext.length>0?`<span class="leaflet-draw-tooltip-subtext">`+e.subtext+`</span><br />`:``)+`<span>`+e.text+`</span>`,e.text||e.subtext?(this._visible=!0,this._container.style.visibility=`inherit`):(this._visible=!1,this._container.style.visibility=`hidden`),this):this},updatePosition:function(e){var t=this._map.latLngToLayerPoint(e),n=this._container;return this._container&&(this._visible&&(n.style.visibility=`inherit`),L.DomUtil.setPosition(n,t)),this},showAsError:function(){return this._container&&L.DomUtil.addClass(this._container,`leaflet-error-draw-tooltip`),this},removeError:function(){return this._container&&L.DomUtil.removeClass(this._container,`leaflet-error-draw-tooltip`),this},_onMouseOut:function(){this._container&&(this._container.style.visibility=`hidden`)}}),L.DrawToolbar=L.Toolbar.extend({statics:{TYPE:`draw`},options:{polyline:{},polygon:{},rectangle:{},circle:{},marker:{},circlemarker:{}},initialize:function(e){for(var t in this.options)this.options.hasOwnProperty(t)&&e[t]&&(e[t]=L.extend({},this.options[t],e[t]));this._toolbarClass=`leaflet-draw-draw`,L.Toolbar.prototype.initialize.call(this,e)},getModeHandlers:function(e){return[{enabled:this.options.polyline,handler:new L.Draw.Polyline(e,this.options.polyline),title:L.drawLocal.draw.toolbar.buttons.polyline},{enabled:this.options.polygon,handler:new L.Draw.Polygon(e,this.options.polygon),title:L.drawLocal.draw.toolbar.buttons.polygon},{enabled:this.options.rectangle,handler:new L.Draw.Rectangle(e,this.options.rectangle),title:L.drawLocal.draw.toolbar.buttons.rectangle},{enabled:this.options.circle,handler:new L.Draw.Circle(e,this.options.circle),title:L.drawLocal.draw.toolbar.buttons.circle},{enabled:this.options.marker,handler:new L.Draw.Marker(e,this.options.marker),title:L.drawLocal.draw.toolbar.buttons.marker},{enabled:this.options.circlemarker,handler:new L.Draw.CircleMarker(e,this.options.circlemarker),title:L.drawLocal.draw.toolbar.buttons.circlemarker}]},getActions:function(e){return[{enabled:e.completeShape,title:L.drawLocal.draw.toolbar.finish.title,text:L.drawLocal.draw.toolbar.finish.text,callback:e.completeShape,context:e},{enabled:e.deleteLastVertex,title:L.drawLocal.draw.toolbar.undo.title,text:L.drawLocal.draw.toolbar.undo.text,callback:e.deleteLastVertex,context:e},{title:L.drawLocal.draw.toolbar.actions.title,text:L.drawLocal.draw.toolbar.actions.text,callback:this.disable,context:this}]},setOptions:function(e){for(var t in L.setOptions(this,e),this._modes)this._modes.hasOwnProperty(t)&&e.hasOwnProperty(t)&&this._modes[t].handler.setOptions(e[t])}}),L.EditToolbar=L.Toolbar.extend({statics:{TYPE:`edit`},options:{edit:{selectedPathOptions:{dashArray:`10, 10`,fill:!0,fillColor:`#fe57a1`,fillOpacity:.1,maintainColor:!1}},remove:{},poly:null,featureGroup:null},initialize:function(e){e.edit&&(e.edit.selectedPathOptions===void 0&&(e.edit.selectedPathOptions=this.options.edit.selectedPathOptions),e.edit.selectedPathOptions=L.extend({},this.options.edit.selectedPathOptions,e.edit.selectedPathOptions)),e.remove&&=L.extend({},this.options.remove,e.remove),e.poly&&=L.extend({},this.options.poly,e.poly),this._toolbarClass=`leaflet-draw-edit`,L.Toolbar.prototype.initialize.call(this,e),this._selectedFeatureCount=0},getModeHandlers:function(e){var t=this.options.featureGroup;return[{enabled:this.options.edit,handler:new L.EditToolbar.Edit(e,{featureGroup:t,selectedPathOptions:this.options.edit.selectedPathOptions,poly:this.options.poly}),title:L.drawLocal.edit.toolbar.buttons.edit},{enabled:this.options.remove,handler:new L.EditToolbar.Delete(e,{featureGroup:t}),title:L.drawLocal.edit.toolbar.buttons.remove}]},getActions:function(e){var t=[{title:L.drawLocal.edit.toolbar.actions.save.title,text:L.drawLocal.edit.toolbar.actions.save.text,callback:this._save,context:this},{title:L.drawLocal.edit.toolbar.actions.cancel.title,text:L.drawLocal.edit.toolbar.actions.cancel.text,callback:this.disable,context:this}];return e.removeAllLayers&&t.push({title:L.drawLocal.edit.toolbar.actions.clearAll.title,text:L.drawLocal.edit.toolbar.actions.clearAll.text,callback:this._clearAllLayers,context:this}),t},addToolbar:function(e){var t=L.Toolbar.prototype.addToolbar.call(this,e);return this._checkDisabled(),this.options.featureGroup.on(`layeradd layerremove`,this._checkDisabled,this),t},removeToolbar:function(){this.options.featureGroup.off(`layeradd layerremove`,this._checkDisabled,this),L.Toolbar.prototype.removeToolbar.call(this)},disable:function(){this.enabled()&&(this._activeMode.handler.revertLayers(),L.Toolbar.prototype.disable.call(this))},_save:function(){this._activeMode.handler.save(),this._activeMode&&this._activeMode.handler.disable()},_clearAllLayers:function(){this._activeMode.handler.removeAllLayers(),this._activeMode&&this._activeMode.handler.disable()},_checkDisabled:function(){var e,t=this.options.featureGroup.getLayers().length!==0;this.options.edit&&(e=this._modes[L.EditToolbar.Edit.TYPE].button,t?L.DomUtil.removeClass(e,`leaflet-disabled`):L.DomUtil.addClass(e,`leaflet-disabled`),e.setAttribute(`title`,t?L.drawLocal.edit.toolbar.buttons.edit:L.drawLocal.edit.toolbar.buttons.editDisabled)),this.options.remove&&(e=this._modes[L.EditToolbar.Delete.TYPE].button,t?L.DomUtil.removeClass(e,`leaflet-disabled`):L.DomUtil.addClass(e,`leaflet-disabled`),e.setAttribute(`title`,t?L.drawLocal.edit.toolbar.buttons.remove:L.drawLocal.edit.toolbar.buttons.removeDisabled))}}),L.EditToolbar.Edit=L.Handler.extend({statics:{TYPE:`edit`},initialize:function(e,t){if(L.Handler.prototype.initialize.call(this,e),L.setOptions(this,t),this._featureGroup=t.featureGroup,!(this._featureGroup instanceof L.FeatureGroup))throw Error(`options.featureGroup must be a L.FeatureGroup`);this._uneditedLayerProps={},this.type=L.EditToolbar.Edit.TYPE;var n=L.version.split(`.`);parseInt(n[0],10)===1&&parseInt(n[1],10)>=2?L.EditToolbar.Edit.include(L.Evented.prototype):L.EditToolbar.Edit.include(L.Mixin.Events)},enable:function(){!this._enabled&&this._hasAvailableLayers()&&(this.fire(`enabled`,{handler:this.type}),this._map.fire(L.Draw.Event.EDITSTART,{handler:this.type}),L.Handler.prototype.enable.call(this),this._featureGroup.on(`layeradd`,this._enableLayerEdit,this).on(`layerremove`,this._disableLayerEdit,this))},disable:function(){this._enabled&&(this._featureGroup.off(`layeradd`,this._enableLayerEdit,this).off(`layerremove`,this._disableLayerEdit,this),L.Handler.prototype.disable.call(this),this._map.fire(L.Draw.Event.EDITSTOP,{handler:this.type}),this.fire(`disabled`,{handler:this.type}))},addHooks:function(){var e=this._map;e&&(e.getContainer().focus(),this._featureGroup.eachLayer(this._enableLayerEdit,this),this._tooltip=new L.Draw.Tooltip(this._map),this._tooltip.updateContent({text:L.drawLocal.edit.handlers.edit.tooltip.text,subtext:L.drawLocal.edit.handlers.edit.tooltip.subtext}),e._editTooltip=this._tooltip,this._updateTooltip(),this._map.on(`mousemove`,this._onMouseMove,this).on(`touchmove`,this._onMouseMove,this).on(`MSPointerMove`,this._onMouseMove,this).on(L.Draw.Event.EDITVERTEX,this._updateTooltip,this))},removeHooks:function(){this._map&&(this._featureGroup.eachLayer(this._disableLayerEdit,this),this._uneditedLayerProps={},this._tooltip.dispose(),this._tooltip=null,this._map.off(`mousemove`,this._onMouseMove,this).off(`touchmove`,this._onMouseMove,this).off(`MSPointerMove`,this._onMouseMove,this).off(L.Draw.Event.EDITVERTEX,this._updateTooltip,this))},revertLayers:function(){this._featureGroup.eachLayer(function(e){this._revertLayer(e)},this)},save:function(){var e=new L.LayerGroup;this._featureGroup.eachLayer(function(t){t.edited&&=(e.addLayer(t),!1)}),this._map.fire(L.Draw.Event.EDITED,{layers:e})},_backupLayer:function(e){var t=L.Util.stamp(e);this._uneditedLayerProps[t]||(e instanceof L.Polyline||e instanceof L.Polygon||e instanceof L.Rectangle?this._uneditedLayerProps[t]={latlngs:L.LatLngUtil.cloneLatLngs(e.getLatLngs())}:e instanceof L.Circle?this._uneditedLayerProps[t]={latlng:L.LatLngUtil.cloneLatLng(e.getLatLng()),radius:e.getRadius()}:(e instanceof L.Marker||e instanceof L.CircleMarker)&&(this._uneditedLayerProps[t]={latlng:L.LatLngUtil.cloneLatLng(e.getLatLng())}))},_getTooltipText:function(){return{text:L.drawLocal.edit.handlers.edit.tooltip.text,subtext:L.drawLocal.edit.handlers.edit.tooltip.subtext}},_updateTooltip:function(){this._tooltip.updateContent(this._getTooltipText())},_revertLayer:function(e){var t=L.Util.stamp(e);e.edited=!1,this._uneditedLayerProps.hasOwnProperty(t)&&(e instanceof L.Polyline||e instanceof L.Polygon||e instanceof L.Rectangle?e.setLatLngs(this._uneditedLayerProps[t].latlngs):e instanceof L.Circle?(e.setLatLng(this._uneditedLayerProps[t].latlng),e.setRadius(this._uneditedLayerProps[t].radius)):(e instanceof L.Marker||e instanceof L.CircleMarker)&&e.setLatLng(this._uneditedLayerProps[t].latlng),e.fire(`revert-edited`,{layer:e}))},_enableLayerEdit:function(e){var t,n,s=e.layer||e.target||e;this._backupLayer(s),this.options.poly&&(n=L.Util.extend({},this.options.poly),s.options.poly=n),this.options.selectedPathOptions&&(t=L.Util.extend({},this.options.selectedPathOptions),t.maintainColor&&(t.color=s.options.color,t.fillColor=s.options.fillColor),s.options.original=L.extend({},s.options),s.options.editing=t),s instanceof L.Marker?(s.editing&&s.editing.enable(),s.dragging.enable(),s.on(`dragend`,this._onMarkerDragEnd).on(`touchmove`,this._onTouchMove,this).on(`MSPointerMove`,this._onTouchMove,this).on(`touchend`,this._onMarkerDragEnd,this).on(`MSPointerUp`,this._onMarkerDragEnd,this)):s.editing.enable()},_disableLayerEdit:function(e){var t=e.layer||e.target||e;t.edited=!1,t.editing&&t.editing.disable(),delete t.options.editing,delete t.options.original,this._selectedPathOptions&&(t instanceof L.Marker?this._toggleMarkerHighlight(t):(t.setStyle(t.options.previousOptions),delete t.options.previousOptions)),t instanceof L.Marker?(t.dragging.disable(),t.off(`dragend`,this._onMarkerDragEnd,this).off(`touchmove`,this._onTouchMove,this).off(`MSPointerMove`,this._onTouchMove,this).off(`touchend`,this._onMarkerDragEnd,this).off(`MSPointerUp`,this._onMarkerDragEnd,this)):t.editing.disable()},_onMouseMove:function(e){this._tooltip.updatePosition(e.latlng)},_onMarkerDragEnd:function(e){var t=e.target;t.edited=!0,this._map.fire(L.Draw.Event.EDITMOVE,{layer:t})},_onTouchMove:function(e){var t=e.originalEvent.changedTouches[0],n=this._map.mouseEventToLayerPoint(t),s=this._map.layerPointToLatLng(n);e.target.setLatLng(s)},_hasAvailableLayers:function(){return this._featureGroup.getLayers().length!==0}}),L.EditToolbar.Delete=L.Handler.extend({statics:{TYPE:`remove`},initialize:function(e,t){if(L.Handler.prototype.initialize.call(this,e),L.Util.setOptions(this,t),this._deletableLayers=this.options.featureGroup,!(this._deletableLayers instanceof L.FeatureGroup))throw Error(`options.featureGroup must be a L.FeatureGroup`);this.type=L.EditToolbar.Delete.TYPE;var n=L.version.split(`.`);parseInt(n[0],10)===1&&parseInt(n[1],10)>=2?L.EditToolbar.Delete.include(L.Evented.prototype):L.EditToolbar.Delete.include(L.Mixin.Events)},enable:function(){!this._enabled&&this._hasAvailableLayers()&&(this.fire(`enabled`,{handler:this.type}),this._map.fire(L.Draw.Event.DELETESTART,{handler:this.type}),L.Handler.prototype.enable.call(this),this._deletableLayers.on(`layeradd`,this._enableLayerDelete,this).on(`layerremove`,this._disableLayerDelete,this))},disable:function(){this._enabled&&(this._deletableLayers.off(`layeradd`,this._enableLayerDelete,this).off(`layerremove`,this._disableLayerDelete,this),L.Handler.prototype.disable.call(this),this._map.fire(L.Draw.Event.DELETESTOP,{handler:this.type}),this.fire(`disabled`,{handler:this.type}))},addHooks:function(){var e=this._map;e&&(e.getContainer().focus(),this._deletableLayers.eachLayer(this._enableLayerDelete,this),this._deletedLayers=new L.LayerGroup,this._tooltip=new L.Draw.Tooltip(this._map),this._tooltip.updateContent({text:L.drawLocal.edit.handlers.remove.tooltip.text}),this._map.on(`mousemove`,this._onMouseMove,this))},removeHooks:function(){this._map&&(this._deletableLayers.eachLayer(this._disableLayerDelete,this),this._deletedLayers=null,this._tooltip.dispose(),this._tooltip=null,this._map.off(`mousemove`,this._onMouseMove,this))},revertLayers:function(){this._deletedLayers.eachLayer(function(e){this._deletableLayers.addLayer(e),e.fire(`revert-deleted`,{layer:e})},this)},save:function(){this._map.fire(L.Draw.Event.DELETED,{layers:this._deletedLayers})},removeAllLayers:function(){this._deletableLayers.eachLayer(function(e){this._removeLayer({layer:e})},this),this.save()},_enableLayerDelete:function(e){(e.layer||e.target||e).on(`click`,this._removeLayer,this)},_disableLayerDelete:function(e){var t=e.layer||e.target||e;t.off(`click`,this._removeLayer,this),this._deletedLayers.removeLayer(t)},_removeLayer:function(e){var t=e.layer||e.target||e;this._deletableLayers.removeLayer(t),this._deletedLayers.addLayer(t),t.fire(`deleted`)},_onMouseMove:function(e){this._tooltip.updatePosition(e.latlng)},_hasAvailableLayers:function(){return this._deletableLayers.getLayers().length!==0}})})(window,document),__commonJSMin(((e,t)=>{(function(n,s){typeof e==`object`&&t!==void 0?s(e):typeof define==`function`&&define.amd?define([`exports`],s):(n||=self,s((n.Leaflet=n.Leaflet||{},n.Leaflet.markercluster={})))})(e,function(e){"use strict";var t=L.MarkerClusterGroup=L.FeatureGroup.extend({options:{maxClusterRadius:80,iconCreateFunction:null,clusterPane:L.Marker.prototype.options.pane,spiderfyOnEveryZoom:!1,spiderfyOnMaxZoom:!0,showCoverageOnHover:!0,zoomToBoundsOnClick:!0,singleMarkerMode:!1,disableClusteringAtZoom:null,removeOutsideVisibleBounds:!0,animate:!0,animateAddingMarkers:!1,spiderfyShapePositions:null,spiderfyDistanceMultiplier:1,spiderLegPolylineOptions:{weight:1.5,color:`#222`,opacity:.5},chunkedLoading:!1,chunkInterval:200,chunkDelay:50,chunkProgress:null,polygonOptions:{}},initialize:function(e){L.Util.setOptions(this,e),this.options.iconCreateFunction||(this.options.iconCreateFunction=this._defaultIconCreateFunction),this._featureGroup=L.featureGroup(),this._featureGroup.addEventParent(this),this._nonPointGroup=L.featureGroup(),this._nonPointGroup.addEventParent(this),this._inZoomAnimation=0,this._needsClustering=[],this._needsRemoving=[],this._currentShownBounds=null,this._queue=[],this._childMarkerEventHandlers={dragstart:this._childMarkerDragStart,move:this._childMarkerMoved,dragend:this._childMarkerDragEnd};var t=L.DomUtil.TRANSITION&&this.options.animate;L.extend(this,t?this._withAnimation:this._noAnimation),this._markerCluster=t?L.MarkerCluster:L.MarkerClusterNonAnimated},addLayer:function(e){if(e instanceof L.LayerGroup)return this.addLayers([e]);if(!e.getLatLng)return this._nonPointGroup.addLayer(e),this.fire(`layeradd`,{layer:e}),this;if(!this._map)return this._needsClustering.push(e),this.fire(`layeradd`,{layer:e}),this;if(this.hasLayer(e))return this;this._unspiderfy&&this._unspiderfy(),this._addLayer(e,this._maxZoom),this.fire(`layeradd`,{layer:e}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons();var t=e,n=this._zoom;if(e.__parent)for(;t.__parent._zoom>=n;)t=t.__parent;return this._currentShownBounds.contains(t.getLatLng())&&(this.options.animateAddingMarkers?this._animationAddLayer(e,t):this._animationAddLayerNonAnimated(e,t)),this},removeLayer:function(e){return e instanceof L.LayerGroup?this.removeLayers([e]):e.getLatLng?this._map?e.__parent?(this._unspiderfy&&(this._unspiderfy(),this._unspiderfyLayer(e)),this._removeLayer(e,!0),this.fire(`layerremove`,{layer:e}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),e.off(this._childMarkerEventHandlers,this),this._featureGroup.hasLayer(e)&&(this._featureGroup.removeLayer(e),e.clusterShow&&e.clusterShow()),this):this:(!this._arraySplice(this._needsClustering,e)&&this.hasLayer(e)&&this._needsRemoving.push({layer:e,latlng:e._latlng}),this.fire(`layerremove`,{layer:e}),this):(this._nonPointGroup.removeLayer(e),this.fire(`layerremove`,{layer:e}),this)},addLayers:function(e,t){if(!L.Util.isArray(e))return this.addLayer(e);var n=this._featureGroup,s=this._nonPointGroup,c=this.options.chunkedLoading,l=this.options.chunkInterval,d=this.options.chunkProgress,f=e.length,p=0,m=!0,h;if(this._map){var g=new Date().getTime(),_=L.bind(function(){var v=new Date().getTime();for(this._map&&this._unspiderfy&&this._unspiderfy();p<f&&!(c&&p%200==0&&new Date().getTime()-v>l);p++){if(h=e[p],h instanceof L.LayerGroup){m&&=(e=e.slice(),!1),this._extractNonGroupLayers(h,e),f=e.length;continue}if(!h.getLatLng){s.addLayer(h),t||this.fire(`layeradd`,{layer:h});continue}if(!this.hasLayer(h)&&(this._addLayer(h,this._maxZoom),t||this.fire(`layeradd`,{layer:h}),h.__parent&&h.__parent.getChildCount()===2)){var y=h.__parent.getAllChildMarkers(),b=y[0]===h?y[1]:y[0];n.removeLayer(b)}}d&&d(p,f,new Date().getTime()-g),p===f?(this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds)):setTimeout(_,this.options.chunkDelay)},this);_()}else for(var v=this._needsClustering;p<f;p++){if(h=e[p],h instanceof L.LayerGroup){m&&=(e=e.slice(),!1),this._extractNonGroupLayers(h,e),f=e.length;continue}if(!h.getLatLng){s.addLayer(h);continue}this.hasLayer(h)||v.push(h)}return this},removeLayers:function(e){var t,n,s=e.length,c=this._featureGroup,l=this._nonPointGroup,d=!0;if(!this._map){for(t=0;t<s;t++){if(n=e[t],n instanceof L.LayerGroup){d&&=(e=e.slice(),!1),this._extractNonGroupLayers(n,e),s=e.length;continue}this._arraySplice(this._needsClustering,n),l.removeLayer(n),this.hasLayer(n)&&this._needsRemoving.push({layer:n,latlng:n._latlng}),this.fire(`layerremove`,{layer:n})}return this}if(this._unspiderfy){this._unspiderfy();var f=e.slice(),p=s;for(t=0;t<p;t++){if(n=f[t],n instanceof L.LayerGroup){this._extractNonGroupLayers(n,f),p=f.length;continue}this._unspiderfyLayer(n)}}for(t=0;t<s;t++){if(n=e[t],n instanceof L.LayerGroup){d&&=(e=e.slice(),!1),this._extractNonGroupLayers(n,e),s=e.length;continue}if(!n.__parent){l.removeLayer(n),this.fire(`layerremove`,{layer:n});continue}this._removeLayer(n,!0,!0),this.fire(`layerremove`,{layer:n}),c.hasLayer(n)&&(c.removeLayer(n),n.clusterShow&&n.clusterShow())}return this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds),this},clearLayers:function(){return this._map||(this._needsClustering=[],this._needsRemoving=[],delete this._gridClusters,delete this._gridUnclustered),this._noanimationUnspiderfy&&this._noanimationUnspiderfy(),this._featureGroup.clearLayers(),this._nonPointGroup.clearLayers(),this.eachLayer(function(e){e.off(this._childMarkerEventHandlers,this),delete e.__parent},this),this._map&&this._generateInitialClusters(),this},getBounds:function(){var e=new L.LatLngBounds;this._topClusterLevel&&e.extend(this._topClusterLevel._bounds);for(var t=this._needsClustering.length-1;t>=0;t--)e.extend(this._needsClustering[t].getLatLng());return e.extend(this._nonPointGroup.getBounds()),e},eachLayer:function(e,t){var n=this._needsClustering.slice(),s=this._needsRemoving,c,l,d;for(this._topClusterLevel&&this._topClusterLevel.getAllChildMarkers(n),l=n.length-1;l>=0;l--){for(c=!0,d=s.length-1;d>=0;d--)if(s[d].layer===n[l]){c=!1;break}c&&e.call(t,n[l])}this._nonPointGroup.eachLayer(e,t)},getLayers:function(){var e=[];return this.eachLayer(function(t){e.push(t)}),e},getLayer:function(e){var t=null;return e=parseInt(e,10),this.eachLayer(function(n){L.stamp(n)===e&&(t=n)}),t},hasLayer:function(e){if(!e)return!1;var t,n=this._needsClustering;for(t=n.length-1;t>=0;t--)if(n[t]===e)return!0;for(n=this._needsRemoving,t=n.length-1;t>=0;t--)if(n[t].layer===e)return!1;return!!(e.__parent&&e.__parent._group===this)||this._nonPointGroup.hasLayer(e)},zoomToShowLayer:function(e,callback){var t=this._map;typeof callback!=`function`&&(callback=function(){});var showMarker=function(){(t.hasLayer(e)||t.hasLayer(e.__parent))&&!this._inZoomAnimation&&(this._map.off(`moveend`,showMarker,this),this.off(`animationend`,showMarker,this),t.hasLayer(e)?callback():e.__parent._icon&&(this.once(`spiderfied`,callback,this),e.__parent.spiderfy()))};e._icon&&this._map.getBounds().contains(e.getLatLng())?callback():e.__parent._zoom<Math.round(this._map._zoom)?(this._map.on(`moveend`,showMarker,this),this._map.panTo(e.getLatLng())):(this._map.on(`moveend`,showMarker,this),this.on(`animationend`,showMarker,this),e.__parent.zoomToBounds())},onAdd:function(e){this._map=e;var t,n,s;if(!isFinite(this._map.getMaxZoom()))throw`Map has no maxZoom specified`;for(this._featureGroup.addTo(e),this._nonPointGroup.addTo(e),this._gridClusters||this._generateInitialClusters(),this._maxLat=e.options.crs.projection.MAX_LATITUDE,t=0,n=this._needsRemoving.length;t<n;t++)s=this._needsRemoving[t],s.newlatlng=s.layer._latlng,s.layer._latlng=s.latlng;for(t=0,n=this._needsRemoving.length;t<n;t++)s=this._needsRemoving[t],this._removeLayer(s.layer,!0),s.layer._latlng=s.newlatlng;this._needsRemoving=[],this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds(),this._map.on(`zoomend`,this._zoomEnd,this),this._map.on(`moveend`,this._moveEnd,this),this._spiderfierOnAdd&&this._spiderfierOnAdd(),this._bindEvents(),n=this._needsClustering,this._needsClustering=[],this.addLayers(n,!0)},onRemove:function(e){e.off(`zoomend`,this._zoomEnd,this),e.off(`moveend`,this._moveEnd,this),this._unbindEvents(),this._map._mapPane.className=this._map._mapPane.className.replace(` leaflet-cluster-anim`,``),this._spiderfierOnRemove&&this._spiderfierOnRemove(),delete this._maxLat,this._hideCoverage(),this._featureGroup.remove(),this._nonPointGroup.remove(),this._featureGroup.clearLayers(),this._map=null},getVisibleParent:function(e){for(var t=e;t&&!t._icon;)t=t.__parent;return t||null},_arraySplice:function(e,t){for(var n=e.length-1;n>=0;n--)if(e[n]===t)return e.splice(n,1),!0},_removeFromGridUnclustered:function(e,t){for(var n=this._map,s=this._gridUnclustered,c=Math.floor(this._map.getMinZoom());t>=c&&s[t].removeObject(e,n.project(e.getLatLng(),t));t--);},_childMarkerDragStart:function(e){e.target.__dragStart=e.target._latlng},_childMarkerMoved:function(e){if(!this._ignoreMove&&!e.target.__dragStart){var t=e.target._popup&&e.target._popup.isOpen();this._moveChild(e.target,e.oldLatLng,e.latlng),t&&e.target.openPopup()}},_moveChild:function(e,t,n){e._latlng=t,this.removeLayer(e),e._latlng=n,this.addLayer(e)},_childMarkerDragEnd:function(e){var t=e.target.__dragStart;delete e.target.__dragStart,t&&this._moveChild(e.target,t,e.target._latlng)},_removeLayer:function(e,t,n){var s=this._gridClusters,c=this._gridUnclustered,l=this._featureGroup,d=this._map,f=Math.floor(this._map.getMinZoom());t&&this._removeFromGridUnclustered(e,this._maxZoom);var p=e.__parent,m=p._markers,h;for(this._arraySplice(m,e);p&&(p._childCount--,p._boundsNeedUpdate=!0,!(p._zoom<f));)t&&p._childCount<=1?(h=p._markers[0]===e?p._markers[1]:p._markers[0],s[p._zoom].removeObject(p,d.project(p._cLatLng,p._zoom)),c[p._zoom].addObject(h,d.project(h.getLatLng(),p._zoom)),this._arraySplice(p.__parent._childClusters,p),p.__parent._markers.push(h),h.__parent=p.__parent,p._icon&&(l.removeLayer(p),n||l.addLayer(h))):p._iconNeedsUpdate=!0,p=p.__parent;delete e.__parent},_isOrIsParent:function(e,t){for(;t;){if(e===t)return!0;t=t.parentNode}return!1},fire:function(e,t,n){if(t&&t.layer instanceof L.MarkerCluster){if(t.originalEvent&&this._isOrIsParent(t.layer._icon,t.originalEvent.relatedTarget))return;e=`cluster`+e}L.FeatureGroup.prototype.fire.call(this,e,t,n)},listens:function(e,t){return L.FeatureGroup.prototype.listens.call(this,e,t)||L.FeatureGroup.prototype.listens.call(this,`cluster`+e,t)},_defaultIconCreateFunction:function(e){var t=e.getChildCount(),n=` marker-cluster-`;return t<10?n+=`small`:t<100?n+=`medium`:n+=`large`,new L.DivIcon({html:`<div><span>`+t+`</span></div>`,className:`marker-cluster`+n,iconSize:new L.Point(40,40)})},_bindEvents:function(){var e=this._map,t=this.options.spiderfyOnMaxZoom,n=this.options.showCoverageOnHover,s=this.options.zoomToBoundsOnClick,c=this.options.spiderfyOnEveryZoom;(t||s||c)&&this.on(`clusterclick clusterkeypress`,this._zoomOrSpiderfy,this),n&&(this.on(`clustermouseover`,this._showCoverage,this),this.on(`clustermouseout`,this._hideCoverage,this),e.on(`zoomend`,this._hideCoverage,this))},_zoomOrSpiderfy:function(e){var t=e.layer,n=t;if(!(e.type===`clusterkeypress`&&e.originalEvent&&e.originalEvent.keyCode!==13)){for(;n._childClusters.length===1;)n=n._childClusters[0];n._zoom===this._maxZoom&&n._childCount===t._childCount&&this.options.spiderfyOnMaxZoom?t.spiderfy():this.options.zoomToBoundsOnClick&&t.zoomToBounds(),this.options.spiderfyOnEveryZoom&&t.spiderfy(),e.originalEvent&&e.originalEvent.keyCode===13&&this._map._container.focus()}},_showCoverage:function(e){var t=this._map;this._inZoomAnimation||(this._shownPolygon&&t.removeLayer(this._shownPolygon),e.layer.getChildCount()>2&&e.layer!==this._spiderfied&&(this._shownPolygon=new L.Polygon(e.layer.getConvexHull(),this.options.polygonOptions),t.addLayer(this._shownPolygon)))},_hideCoverage:function(){this._shownPolygon&&=(this._map.removeLayer(this._shownPolygon),null)},_unbindEvents:function(){var e=this.options.spiderfyOnMaxZoom,t=this.options.showCoverageOnHover,n=this.options.zoomToBoundsOnClick,s=this.options.spiderfyOnEveryZoom,c=this._map;(e||n||s)&&this.off(`clusterclick clusterkeypress`,this._zoomOrSpiderfy,this),t&&(this.off(`clustermouseover`,this._showCoverage,this),this.off(`clustermouseout`,this._hideCoverage,this),c.off(`zoomend`,this._hideCoverage,this))},_zoomEnd:function(){this._map&&(this._mergeSplitClusters(),this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds())},_moveEnd:function(){if(!this._inZoomAnimation){var e=this._getExpandedVisibleBounds();this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),this._zoom,e),this._topClusterLevel._recursivelyAddChildrenToMap(null,Math.round(this._map._zoom),e),this._currentShownBounds=e}},_generateInitialClusters:function(){var e=Math.ceil(this._map.getMaxZoom()),t=Math.floor(this._map.getMinZoom()),n=this.options.maxClusterRadius,radiusFn=n;typeof n!=`function`&&(radiusFn=function(){return n}),this.options.disableClusteringAtZoom!==null&&(e=this.options.disableClusteringAtZoom-1),this._maxZoom=e,this._gridClusters={},this._gridUnclustered={};for(var s=e;s>=t;s--)this._gridClusters[s]=new L.DistanceGrid(radiusFn(s)),this._gridUnclustered[s]=new L.DistanceGrid(radiusFn(s));this._topClusterLevel=new this._markerCluster(this,t-1)},_addLayer:function(e,t){var n=this._gridClusters,s=this._gridUnclustered,c=Math.floor(this._map.getMinZoom()),l,d;for(this.options.singleMarkerMode&&this._overrideMarkerIcon(e),e.on(this._childMarkerEventHandlers,this);t>=c;t--){l=this._map.project(e.getLatLng(),t);var f=n[t].getNearObject(l);if(f){f._addChild(e),e.__parent=f;return}if(f=s[t].getNearObject(l),f){var p=f.__parent;p&&this._removeLayer(f,!1);var m=new this._markerCluster(this,t,f,e);n[t].addObject(m,this._map.project(m._cLatLng,t)),f.__parent=m,e.__parent=m;var h=m;for(d=t-1;d>p._zoom;d--)h=new this._markerCluster(this,d,h),n[d].addObject(h,this._map.project(f.getLatLng(),d));p._addChild(h),this._removeFromGridUnclustered(f,t);return}s[t].addObject(e,l)}this._topClusterLevel._addChild(e),e.__parent=this._topClusterLevel},_refreshClustersIcons:function(){this._featureGroup.eachLayer(function(e){e instanceof L.MarkerCluster&&e._iconNeedsUpdate&&e._updateIcon()})},_enqueue:function(e){this._queue.push(e),this._queueTimeout||=setTimeout(L.bind(this._processQueue,this),300)},_processQueue:function(){for(var e=0;e<this._queue.length;e++)this._queue[e].call(this);this._queue.length=0,clearTimeout(this._queueTimeout),this._queueTimeout=null},_mergeSplitClusters:function(){var e=Math.round(this._map._zoom);this._processQueue(),this._zoom<e&&this._currentShownBounds.intersects(this._getExpandedVisibleBounds())?(this._animationStart(),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),this._zoom,this._getExpandedVisibleBounds()),this._animationZoomIn(this._zoom,e)):this._zoom>e?(this._animationStart(),this._animationZoomOut(this._zoom,e)):this._moveEnd()},_getExpandedVisibleBounds:function(){return this.options.removeOutsideVisibleBounds?L.Browser.mobile?this._checkBoundsMaxLat(this._map.getBounds()):this._checkBoundsMaxLat(this._map.getBounds().pad(1)):this._mapBoundsInfinite},_checkBoundsMaxLat:function(e){var t=this._maxLat;return t!==void 0&&(e.getNorth()>=t&&(e._northEast.lat=1/0),e.getSouth()<=-t&&(e._southWest.lat=-1/0)),e},_animationAddLayerNonAnimated:function(e,t){if(t===e)this._featureGroup.addLayer(e);else if(t._childCount===2){t._addToMap();var n=t.getAllChildMarkers();this._featureGroup.removeLayer(n[0]),this._featureGroup.removeLayer(n[1])}else t._updateIcon()},_extractNonGroupLayers:function(e,t){var n=e.getLayers(),s=0,c;for(t||=[];s<n.length;s++){if(c=n[s],c instanceof L.LayerGroup){this._extractNonGroupLayers(c,t);continue}t.push(c)}return t},_overrideMarkerIcon:function(e){return e.options.icon=this.options.iconCreateFunction({getChildCount:function(){return 1},getAllChildMarkers:function(){return[e]}})}});L.MarkerClusterGroup.include({_mapBoundsInfinite:new L.LatLngBounds(new L.LatLng(-1/0,-1/0),new L.LatLng(1/0,1/0))}),L.MarkerClusterGroup.include({_noAnimation:{_animationStart:function(){},_animationZoomIn:function(e,t){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),e),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this.fire(`animationend`)},_animationZoomOut:function(e,t){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),e),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this.fire(`animationend`)},_animationAddLayer:function(e,t){this._animationAddLayerNonAnimated(e,t)}},_withAnimation:{_animationStart:function(){this._map._mapPane.className+=` leaflet-cluster-anim`,this._inZoomAnimation++},_animationZoomIn:function(e,t){var n=this._getExpandedVisibleBounds(),s=this._featureGroup,c=Math.floor(this._map.getMinZoom()),l;this._ignoreMove=!0,this._topClusterLevel._recursively(n,e,c,function(c){var d=c._latlng,f=c._markers,p;for(n.contains(d)||(d=null),c._isSingleParent()&&e+1===t?(s.removeLayer(c),c._recursivelyAddChildrenToMap(null,t,n)):(c.clusterHide(),c._recursivelyAddChildrenToMap(d,t,n)),l=f.length-1;l>=0;l--)p=f[l],n.contains(p._latlng)||s.removeLayer(p)}),this._forceLayout(),this._topClusterLevel._recursivelyBecomeVisible(n,t),s.eachLayer(function(e){!(e instanceof L.MarkerCluster)&&e._icon&&e.clusterShow()}),this._topClusterLevel._recursively(n,e,t,function(e){e._recursivelyRestoreChildPositions(t)}),this._ignoreMove=!1,this._enqueue(function(){this._topClusterLevel._recursively(n,e,c,function(e){s.removeLayer(e),e.clusterShow()}),this._animationEnd()})},_animationZoomOut:function(e,t){this._animationZoomOutSingle(this._topClusterLevel,e-1,t),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),e,this._getExpandedVisibleBounds())},_animationAddLayer:function(e,t){var n=this,s=this._featureGroup;s.addLayer(e),t!==e&&(t._childCount>2?(t._updateIcon(),this._forceLayout(),this._animationStart(),e._setPos(this._map.latLngToLayerPoint(t.getLatLng())),e.clusterHide(),this._enqueue(function(){s.removeLayer(e),e.clusterShow(),n._animationEnd()})):(this._forceLayout(),n._animationStart(),n._animationZoomOutSingle(t,this._map.getMaxZoom(),this._zoom)))}},_animationZoomOutSingle:function(e,t,n){var s=this._getExpandedVisibleBounds(),c=Math.floor(this._map.getMinZoom());e._recursivelyAnimateChildrenInAndAddSelfToMap(s,c,t+1,n);var l=this;this._forceLayout(),e._recursivelyBecomeVisible(s,n),this._enqueue(function(){if(e._childCount===1){var d=e._markers[0];this._ignoreMove=!0,d.setLatLng(d.getLatLng()),this._ignoreMove=!1,d.clusterShow&&d.clusterShow()}else e._recursively(s,n,c,function(e){e._recursivelyRemoveChildrenFromMap(s,c,t+1)});l._animationEnd()})},_animationEnd:function(){this._map&&(this._map._mapPane.className=this._map._mapPane.className.replace(` leaflet-cluster-anim`,``)),this._inZoomAnimation--,this.fire(`animationend`)},_forceLayout:function(){L.Util.falseFn(document.body.offsetWidth)}}),L.markerClusterGroup=function(e){return new L.MarkerClusterGroup(e)};var n=L.MarkerCluster=L.Marker.extend({options:L.Icon.prototype.options,initialize:function(e,t,n,s){L.Marker.prototype.initialize.call(this,n?n._cLatLng||n.getLatLng():new L.LatLng(0,0),{icon:this,pane:e.options.clusterPane}),this._group=e,this._zoom=t,this._markers=[],this._childClusters=[],this._childCount=0,this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._bounds=new L.LatLngBounds,n&&this._addChild(n),s&&this._addChild(s)},getAllChildMarkers:function(e,t){e||=[];for(var n=this._childClusters.length-1;n>=0;n--)this._childClusters[n].getAllChildMarkers(e,t);for(var s=this._markers.length-1;s>=0;s--)t&&this._markers[s].__dragStart||e.push(this._markers[s]);return e},getChildCount:function(){return this._childCount},zoomToBounds:function(e){for(var t=this._childClusters.slice(),n=this._group._map,s=n.getBoundsZoom(this._bounds),c=this._zoom+1,l=n.getZoom(),d;t.length>0&&s>c;){c++;var f=[];for(d=0;d<t.length;d++)f=f.concat(t[d]._childClusters);t=f}s>c?this._group._map.setView(this._latlng,c):s<=l?this._group._map.setView(this._latlng,l+1):this._group._map.fitBounds(this._bounds,e)},getBounds:function(){var e=new L.LatLngBounds;return e.extend(this._bounds),e},_updateIcon:function(){this._iconNeedsUpdate=!0,this._icon&&this.setIcon(this)},createIcon:function(){return this._iconNeedsUpdate&&=(this._iconObj=this._group.options.iconCreateFunction(this),!1),this._iconObj.createIcon()},createShadow:function(){return this._iconObj.createShadow()},_addChild:function(e,t){this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._setClusterCenter(e),e instanceof L.MarkerCluster?(t||(this._childClusters.push(e),e.__parent=this),this._childCount+=e._childCount):(t||this._markers.push(e),this._childCount++),this.__parent&&this.__parent._addChild(e,!0)},_setClusterCenter:function(e){this._cLatLng||=e._cLatLng||e._latlng},_resetBounds:function(){var e=this._bounds;e._southWest&&(e._southWest.lat=1/0,e._southWest.lng=1/0),e._northEast&&(e._northEast.lat=-1/0,e._northEast.lng=-1/0)},_recalculateBounds:function(){var e=this._markers,t=this._childClusters,n=0,s=0,c=this._childCount,l,d,f,p;if(c!==0){for(this._resetBounds(),l=0;l<e.length;l++)f=e[l]._latlng,this._bounds.extend(f),n+=f.lat,s+=f.lng;for(l=0;l<t.length;l++)d=t[l],d._boundsNeedUpdate&&d._recalculateBounds(),this._bounds.extend(d._bounds),f=d._wLatLng,p=d._childCount,n+=f.lat*p,s+=f.lng*p;this._latlng=this._wLatLng=new L.LatLng(n/c,s/c),this._boundsNeedUpdate=!1}},_addToMap:function(e){e&&(this._backupLatlng=this._latlng,this.setLatLng(e)),this._group._featureGroup.addLayer(this)},_recursivelyAnimateChildrenIn:function(e,t,n){this._recursively(e,this._group._map.getMinZoom(),n-1,function(e){var n=e._markers,s,c;for(s=n.length-1;s>=0;s--)c=n[s],c._icon&&(c._setPos(t),c.clusterHide())},function(e){var n=e._childClusters,s,c;for(s=n.length-1;s>=0;s--)c=n[s],c._icon&&(c._setPos(t),c.clusterHide())})},_recursivelyAnimateChildrenInAndAddSelfToMap:function(e,t,n,s){this._recursively(e,s,t,function(c){c._recursivelyAnimateChildrenIn(e,c._group._map.latLngToLayerPoint(c.getLatLng()).round(),n),c._isSingleParent()&&n-1===s?(c.clusterShow(),c._recursivelyRemoveChildrenFromMap(e,t,n)):c.clusterHide(),c._addToMap()})},_recursivelyBecomeVisible:function(e,t){this._recursively(e,this._group._map.getMinZoom(),t,null,function(e){e.clusterShow()})},_recursivelyAddChildrenToMap:function(e,t,n){this._recursively(n,this._group._map.getMinZoom()-1,t,function(s){if(t!==s._zoom)for(var c=s._markers.length-1;c>=0;c--){var l=s._markers[c];n.contains(l._latlng)&&(e&&(l._backupLatlng=l.getLatLng(),l.setLatLng(e),l.clusterHide&&l.clusterHide()),s._group._featureGroup.addLayer(l))}},function(t){t._addToMap(e)})},_recursivelyRestoreChildPositions:function(e){for(var t=this._markers.length-1;t>=0;t--){var n=this._markers[t];n._backupLatlng&&(n.setLatLng(n._backupLatlng),delete n._backupLatlng)}if(e-1===this._zoom)for(var s=this._childClusters.length-1;s>=0;s--)this._childClusters[s]._restorePosition();else for(var c=this._childClusters.length-1;c>=0;c--)this._childClusters[c]._recursivelyRestoreChildPositions(e)},_restorePosition:function(){this._backupLatlng&&(this.setLatLng(this._backupLatlng),delete this._backupLatlng)},_recursivelyRemoveChildrenFromMap:function(e,t,n,s){var c,l;this._recursively(e,t-1,n-1,function(e){for(l=e._markers.length-1;l>=0;l--)c=e._markers[l],(!s||!s.contains(c._latlng))&&(e._group._featureGroup.removeLayer(c),c.clusterShow&&c.clusterShow())},function(e){for(l=e._childClusters.length-1;l>=0;l--)c=e._childClusters[l],(!s||!s.contains(c._latlng))&&(e._group._featureGroup.removeLayer(c),c.clusterShow&&c.clusterShow())})},_recursively:function(e,t,n,s,c){var l=this._childClusters,d=this._zoom,f,p;if(t<=d&&(s&&s(this),c&&d===n&&c(this)),d<t||d<n)for(f=l.length-1;f>=0;f--)p=l[f],p._boundsNeedUpdate&&p._recalculateBounds(),e.intersects(p._bounds)&&p._recursively(e,t,n,s,c)},_isSingleParent:function(){return this._childClusters.length>0&&this._childClusters[0]._childCount===this._childCount}});L.Marker.include({clusterHide:function(){var e=this.options.opacity;return this.setOpacity(0),this.options.opacity=e,this},clusterShow:function(){return this.setOpacity(this.options.opacity)}}),L.DistanceGrid=function(e){this._cellSize=e,this._sqCellSize=e*e,this._grid={},this._objectPoint={}},L.DistanceGrid.prototype={addObject:function(e,t){var n=this._getCoord(t.x),s=this._getCoord(t.y),c=this._grid,l=c[s]=c[s]||{},d=l[n]=l[n]||[],f=L.Util.stamp(e);this._objectPoint[f]=t,d.push(e)},updateObject:function(e,t){this.removeObject(e),this.addObject(e,t)},removeObject:function(e,t){var n=this._getCoord(t.x),s=this._getCoord(t.y),c=this._grid,l=c[s]=c[s]||{},d=l[n]=l[n]||[],f,p;for(delete this._objectPoint[L.Util.stamp(e)],f=0,p=d.length;f<p;f++)if(d[f]===e)return d.splice(f,1),p===1&&delete l[n],!0},eachObject:function(e,t){var n,s,c,l,d,f,p,m=this._grid;for(n in m)for(s in d=m[n],d)for(f=d[s],c=0,l=f.length;c<l;c++)p=e.call(t,f[c]),p&&(c--,l--)},getNearObject:function(e){var t=this._getCoord(e.x),n=this._getCoord(e.y),s,c,l,d,f,p,m,h,g=this._objectPoint,_=this._sqCellSize,v=null;for(s=n-1;s<=n+1;s++)if(d=this._grid[s],d){for(c=t-1;c<=t+1;c++)if(f=d[c],f)for(l=0,p=f.length;l<p;l++)m=f[l],h=this._sqDist(g[L.Util.stamp(m)],e),(h<_||h<=_&&v===null)&&(_=h,v=m)}return v},_getCoord:function(e){var t=Math.floor(e/this._cellSize);return isFinite(t)?t:e},_sqDist:function(e,t){var n=t.x-e.x,s=t.y-e.y;return n*n+s*s}},(function(){L.QuickHull={getDistant:function(e,t){var n=t[1].lat-t[0].lat;return(t[0].lng-t[1].lng)*(e.lat-t[0].lat)+n*(e.lng-t[0].lng)},findMostDistantPointFromBaseLine:function(e,t){var n=0,s=null,c=[],l,d,f;for(l=t.length-1;l>=0;l--){if(d=t[l],f=this.getDistant(d,e),f>0)c.push(d);else continue;f>n&&(n=f,s=d)}return{maxPoint:s,newPoints:c}},buildConvexHull:function(e,t){var n=[],s=this.findMostDistantPointFromBaseLine(e,t);return s.maxPoint?(n=n.concat(this.buildConvexHull([e[0],s.maxPoint],s.newPoints)),n=n.concat(this.buildConvexHull([s.maxPoint,e[1]],s.newPoints)),n):[e[0]]},getConvexHull:function(e){var t=!1,n=!1,s=!1,c=!1,l=null,d=null,f=null,p=null,m=null,h=null,g;for(g=e.length-1;g>=0;g--){var _=e[g];(t===!1||_.lat>t)&&(l=_,t=_.lat),(n===!1||_.lat<n)&&(d=_,n=_.lat),(s===!1||_.lng>s)&&(f=_,s=_.lng),(c===!1||_.lng<c)&&(p=_,c=_.lng)}return n===t?(h=p,m=f):(h=d,m=l),[].concat(this.buildConvexHull([h,m],e),this.buildConvexHull([m,h],e))}}})(),L.MarkerCluster.include({getConvexHull:function(){var e=this.getAllChildMarkers(),t=[],n,s;for(s=e.length-1;s>=0;s--)n=e[s].getLatLng(),t.push(n);return L.QuickHull.getConvexHull(t)}}),L.MarkerCluster.include({_2PI:Math.PI*2,_circleFootSeparation:25,_circleStartAngle:0,_spiralFootSeparation:28,_spiralLengthStart:11,_spiralLengthFactor:5,_circleSpiralSwitchover:9,spiderfy:function(){if(!(this._group._spiderfied===this||this._group._inZoomAnimation)){var e=this.getAllChildMarkers(null,!0),t=this._group._map.latLngToLayerPoint(this._latlng),n;this._group._unspiderfy(),this._group._spiderfied=this,this._group.options.spiderfyShapePositions?n=this._group.options.spiderfyShapePositions(e.length,t):e.length>=this._circleSpiralSwitchover?n=this._generatePointsSpiral(e.length,t):(t.y+=10,n=this._generatePointsCircle(e.length,t)),this._animationSpiderfy(e,n)}},unspiderfy:function(e){this._group._inZoomAnimation||(this._animationUnspiderfy(e),this._group._spiderfied=null)},_generatePointsCircle:function(e,t){var n=this._group.options.spiderfyDistanceMultiplier*this._circleFootSeparation*(2+e)/this._2PI,s=this._2PI/e,c=[],l,d;for(n=Math.max(n,35),c.length=e,l=0;l<e;l++)d=this._circleStartAngle+l*s,c[l]=new L.Point(t.x+n*Math.cos(d),t.y+n*Math.sin(d))._round();return c},_generatePointsSpiral:function(e,t){var n=this._group.options.spiderfyDistanceMultiplier,s=n*this._spiralLengthStart,c=n*this._spiralFootSeparation,l=n*this._spiralLengthFactor*this._2PI,d=0,f=[],p;for(f.length=e,p=e;p>=0;p--)p<e&&(f[p]=new L.Point(t.x+s*Math.cos(d),t.y+s*Math.sin(d))._round()),d+=c/s+p*5e-4,s+=l/d;return f},_noanimationUnspiderfy:function(){var e=this._group,t=e._map,n=e._featureGroup,s=this.getAllChildMarkers(null,!0),c,l;for(e._ignoreMove=!0,this.setOpacity(1),l=s.length-1;l>=0;l--)c=s[l],n.removeLayer(c),c._preSpiderfyLatlng&&(c.setLatLng(c._preSpiderfyLatlng),delete c._preSpiderfyLatlng),c.setZIndexOffset&&c.setZIndexOffset(0),c._spiderLeg&&(t.removeLayer(c._spiderLeg),delete c._spiderLeg);e.fire(`unspiderfied`,{cluster:this,markers:s}),e._ignoreMove=!1,e._spiderfied=null}}),L.MarkerClusterNonAnimated=L.MarkerCluster.extend({_animationSpiderfy:function(e,t){var n=this._group,s=n._map,c=n._featureGroup,l=this._group.options.spiderLegPolylineOptions,d,f,p,m;for(n._ignoreMove=!0,d=0;d<e.length;d++)m=s.layerPointToLatLng(t[d]),f=e[d],p=new L.Polyline([this._latlng,m],l),s.addLayer(p),f._spiderLeg=p,f._preSpiderfyLatlng=f._latlng,f.setLatLng(m),f.setZIndexOffset&&f.setZIndexOffset(1e6),c.addLayer(f);this.setOpacity(.3),n._ignoreMove=!1,n.fire(`spiderfied`,{cluster:this,markers:e})},_animationUnspiderfy:function(){this._noanimationUnspiderfy()}}),L.MarkerCluster.include({_animationSpiderfy:function(e,t){var n=this,s=this._group,c=s._map,l=s._featureGroup,d=this._latlng,f=c.latLngToLayerPoint(d),p=L.Path.SVG,m=L.extend({},this._group.options.spiderLegPolylineOptions),h=m.opacity,g,_,v,y,b,x;for(h===void 0&&(h=L.MarkerClusterGroup.prototype.options.spiderLegPolylineOptions.opacity),p?(m.opacity=0,m.className=(m.className||``)+` leaflet-cluster-spider-leg`):m.opacity=h,s._ignoreMove=!0,g=0;g<e.length;g++)_=e[g],x=c.layerPointToLatLng(t[g]),v=new L.Polyline([d,x],m),c.addLayer(v),_._spiderLeg=v,p&&(y=v._path,b=y.getTotalLength()+.1,y.style.strokeDasharray=b,y.style.strokeDashoffset=b),_.setZIndexOffset&&_.setZIndexOffset(1e6),_.clusterHide&&_.clusterHide(),l.addLayer(_),_._setPos&&_._setPos(f);for(s._forceLayout(),s._animationStart(),g=e.length-1;g>=0;g--)x=c.layerPointToLatLng(t[g]),_=e[g],_._preSpiderfyLatlng=_._latlng,_.setLatLng(x),_.clusterShow&&_.clusterShow(),p&&(v=_._spiderLeg,y=v._path,y.style.strokeDashoffset=0,v.setStyle({opacity:h}));this.setOpacity(.3),s._ignoreMove=!1,setTimeout(function(){s._animationEnd(),s.fire(`spiderfied`,{cluster:n,markers:e})},200)},_animationUnspiderfy:function(e){var t=this,n=this._group,s=n._map,c=n._featureGroup,l=e?s._latLngToNewLayerPoint(this._latlng,e.zoom,e.center):s.latLngToLayerPoint(this._latlng),d=this.getAllChildMarkers(null,!0),f=L.Path.SVG,p,m,h,g,_,v;for(n._ignoreMove=!0,n._animationStart(),this.setOpacity(1),m=d.length-1;m>=0;m--)p=d[m],p._preSpiderfyLatlng&&(p.closePopup(),p.setLatLng(p._preSpiderfyLatlng),delete p._preSpiderfyLatlng,v=!0,p._setPos&&(p._setPos(l),v=!1),p.clusterHide&&(p.clusterHide(),v=!1),v&&c.removeLayer(p),f&&(h=p._spiderLeg,g=h._path,_=g.getTotalLength()+.1,g.style.strokeDashoffset=_,h.setStyle({opacity:0})));n._ignoreMove=!1,setTimeout(function(){var e=0;for(m=d.length-1;m>=0;m--)p=d[m],p._spiderLeg&&e++;for(m=d.length-1;m>=0;m--)p=d[m],p._spiderLeg&&(p.clusterShow&&p.clusterShow(),p.setZIndexOffset&&p.setZIndexOffset(0),e>1&&c.removeLayer(p),s.removeLayer(p._spiderLeg),delete p._spiderLeg);n._animationEnd(),n.fire(`unspiderfied`,{cluster:t,markers:d})},200)}}),L.MarkerClusterGroup.include({_spiderfied:null,unspiderfy:function(){this._unspiderfy.apply(this,arguments)},_spiderfierOnAdd:function(){this._map.on(`click`,this._unspiderfyWrapper,this),this._map.options.zoomAnimation&&this._map.on(`zoomstart`,this._unspiderfyZoomStart,this),this._map.on(`zoomend`,this._noanimationUnspiderfy,this),L.Browser.touch||this._map.getRenderer(this)},_spiderfierOnRemove:function(){this._map.off(`click`,this._unspiderfyWrapper,this),this._map.off(`zoomstart`,this._unspiderfyZoomStart,this),this._map.off(`zoomanim`,this._unspiderfyZoomAnim,this),this._map.off(`zoomend`,this._noanimationUnspiderfy,this),this._noanimationUnspiderfy()},_unspiderfyZoomStart:function(){this._map&&this._map.on(`zoomanim`,this._unspiderfyZoomAnim,this)},_unspiderfyZoomAnim:function(e){L.DomUtil.hasClass(this._map._mapPane,`leaflet-touching`)||(this._map.off(`zoomanim`,this._unspiderfyZoomAnim,this),this._unspiderfy(e))},_unspiderfyWrapper:function(){this._unspiderfy()},_unspiderfy:function(e){this._spiderfied&&this._spiderfied.unspiderfy(e)},_noanimationUnspiderfy:function(){this._spiderfied&&this._spiderfied._noanimationUnspiderfy()},_unspiderfyLayer:function(e){e._spiderLeg&&(this._featureGroup.removeLayer(e),e.clusterShow&&e.clusterShow(),e.setZIndexOffset&&e.setZIndexOffset(0),this._map.removeLayer(e._spiderLeg),delete e._spiderLeg)}}),L.MarkerClusterGroup.include({refreshClusters:function(e){return e?e instanceof L.MarkerClusterGroup?e=e._topClusterLevel.getAllChildMarkers():e instanceof L.LayerGroup?e=e._layers:e instanceof L.MarkerCluster?e=e.getAllChildMarkers():e instanceof L.Marker&&(e=[e]):e=this._topClusterLevel.getAllChildMarkers(),this._flagParentsIconsNeedUpdate(e),this._refreshClustersIcons(),this.options.singleMarkerMode&&this._refreshSingleMarkerModeMarkers(e),this},_flagParentsIconsNeedUpdate:function(e){var t,n;for(t in e)for(n=e[t].__parent;n;)n._iconNeedsUpdate=!0,n=n.__parent},_refreshSingleMarkerModeMarkers:function(e){var t,n;for(t in e)n=e[t],this.hasLayer(n)&&n.setIcon(this._overrideMarkerIcon(n))}}),L.Marker.include({refreshIconOptions:function(e,t){var n=this.options.icon;return L.setOptions(n,e),this.setIcon(n),t&&this.__parent&&this.__parent._group.refreshClusters(this),this}}),e.MarkerClusterGroup=t,e.MarkerCluster=n,Object.defineProperty(e,"__esModule",{value:!0})})}))();var Q=Symbol(`newer`),$=Symbol(`older`),Entry=class{key;value;constructor(e,t){this.key=e,this.value=t,this[Q]=void 0,this[$]=void 0}},LRUMap=class{size;limit;oldest;newest;_keymap;constructor(e,t){typeof e!=`number`&&(t=e,e=0),this.size=0,this.limit=e,this.oldest=this.newest=void 0,this._keymap=new Map,t&&(this.assign(t),e<1&&(this.limit=this.size))}_markEntryAsUsed(e){e!==this.newest&&(e[Q]&&(e===this.oldest&&(this.oldest=e[Q]),e[Q][$]=e[$]),e[$]&&(e[$][Q]=e[Q]),e[Q]=void 0,e[$]=this.newest,this.newest&&(this.newest[Q]=e),this.newest=e)}assign(e){let t,n=this.limit||Number.MAX_VALUE;this._keymap.clear();let s=e[Symbol.iterator]();for(let e=s.next();!e.done;e=s.next()){let s=new Entry(e.value[0],e.value[1]);if(this._keymap.set(s.key,s),t?(t[Q]=s,s[$]=t):this.oldest=s,t=s,n--==0)throw Error(`overflow`)}this.newest=t,this.size=this._keymap.size}get(e){let t=this._keymap.get(e);if(t)return this._markEntryAsUsed(t),t.value}set(e,t){let n=this._keymap.get(e);return n?(n.value=t,this._markEntryAsUsed(n),this):(this._keymap.set(e,n=new Entry(e,t)),this.newest?(this.newest[Q]=n,n[$]=this.newest):this.oldest=n,this.newest=n,++this.size,this.size>this.limit&&this.shift(),this)}shift(){let e=this.oldest;if(e)return this.oldest[Q]?(this.oldest=this.oldest[Q],this.oldest[$]=void 0):(this.oldest=void 0,this.newest=void 0),e[Q]=e[$]=void 0,this._keymap.delete(e.key),--this.size,[e.key,e.value]}find(e){let t=this._keymap.get(e);return t?t.value:void 0}has(e){return this._keymap.has(e)}delete(e){let t=this._keymap.get(e);if(t)return this._keymap.delete(t.key),t[Q]&&t[$]?(t[$][Q]=t[Q],t[Q][$]=t[$]):t[Q]?(t[Q][$]=void 0,this.oldest=t[Q]):t[$]?(t[$][Q]=void 0,this.newest=t[$]):this.oldest=this.newest=void 0,this.size--,t.value}clear(){this.oldest=this.newest=void 0,this.size=0,this._keymap.clear()}keys(){return new KeyIterator(this.oldest)}values(){return new ValueIterator(this.oldest)}entries(){return this}[Symbol.iterator](){return new EntryIterator(this.oldest)}forEach(e,t){typeof t!=`object`&&(t=this);let n=this.oldest;for(;n;)e.call(t,n.value,n.key,this),n=n[Q]}toJSON(){let e=Array(this.size),t=0,n=this.oldest;for(;n;)e[t++]={key:n.key,value:n.value},n=n[Q];return e}toString(){let e=``,t=this.oldest;for(;t;)e+=String(t.key)+`:`+t.value,t=t[Q],t&&(e+=` < `);return e}};function EntryIterator(e){this.entry=e}EntryIterator.prototype[Symbol.iterator]=function(){return this},EntryIterator.prototype.next=function(){let e=this.entry;return e?(this.entry=e[Q],{done:!1,value:[e.key,e.value]}):{done:!0,value:void 0}};function KeyIterator(e){this.entry=e}KeyIterator.prototype[Symbol.iterator]=function(){return this},KeyIterator.prototype.next=function(){let e=this.entry;return e?(this.entry=e[Q],{done:!1,value:e.key}):{done:!0,value:void 0}};function ValueIterator(e){this.entry=e}ValueIterator.prototype[Symbol.iterator]=function(){return this},ValueIterator.prototype.next=function(){let e=this.entry;return e?(this.entry=e[Q],{done:!1,value:e.value}):{done:!0,value:void 0}};function waitForAPI(e,t){let n=0,s=null;s=setInterval(function(){if(n>=20)throw clearInterval(s),Error(`window.google not found after 10 seconds`);window.google&&window.google.maps&&window.google.maps.Map&&(clearInterval(s),e.call(t)),++n},500)}L.GridLayer.GoogleMutant=L.GridLayer.extend({options:{maxZoom:21,type:`roadmap`,maxNativeZoom:21},initialize:function(e){L.GridLayer.prototype.initialize.call(this,e),this._tileCallbacks={},this._lru=new LRUMap(100),this._imagesPerTile=this.options.type===`hybrid`?2:1,this._boundOnMutatedImage=this._onMutatedImage.bind(this)},onAdd:function(e){L.GridLayer.prototype.onAdd.call(this,e),this._initMutantContainer(),this._logoContainer&&e._controlCorners.bottomleft.appendChild(this._logoContainer),this._attributionContainer&&e._controlCorners.bottomright.appendChild(this._attributionContainer),waitForAPI(()=>{this._map&&(this._initMutant(),google.maps.event.addListenerOnce(this._mutant,`idle`,()=>{this._map&&(this._checkZoomLevels(),this._mutantIsReady=!0)}))})},onRemove:function(e){L.GridLayer.prototype.onRemove.call(this,e),this._observer.disconnect(),e._container.removeChild(this._mutantContainer),this._logoContainer&&L.DomUtil.remove(this._logoContainer),this._attributionContainer&&L.DomUtil.remove(this._attributionContainer),this._mutant&&google.maps.event.clearListeners(this._mutant,`idle`)},addGoogleLayer:function(e,t){return this._subLayers||={},this.whenReady(()=>{var n=google.maps[e],s=new n(t);s.setMap(this._mutant),this._subLayers[e]=s}),this},removeGoogleLayer:function(e){return this.whenReady(()=>{var t=this._subLayers&&this._subLayers[e];t&&(t.setMap(null),delete this._subLayers[e])}),this},_initMutantContainer:function(){this._mutantContainer||(this._mutantContainer=L.DomUtil.create(`div`,`leaflet-google-mutant leaflet-top leaflet-left`),this._mutantContainer.id=`_MutantContainer_`+L.Util.stamp(this._mutantContainer),this._mutantContainer.style.pointerEvents=`none`,this._mutantContainer.style.visibility=`hidden`,L.DomEvent.off(this._mutantContainer)),this._map.getContainer().appendChild(this._mutantContainer),this.setOpacity(this.options.opacity);let e=this._mutantContainer.style;this._map.options.zoomSnap<1?(e.width=`180%`,e.height=`180%`):(e.width=`100%`,e.height=`100%`),e.zIndex=-1,this._attachObserver(this._mutantContainer)},_initMutant:function(){if(!this._mutant){var e={center:{lat:0,lng:0},zoom:0,tilt:0,mapTypeId:this.options.type,disableDefaultUI:!0,keyboardShortcuts:!1,draggable:!1,disableDoubleClickZoom:!0,scrollwheel:!1,styles:this.options.styles||[],backgroundColor:`transparent`};this.options.mapId!=null&&(e.mapId=this.options.mapId);var t=new google.maps.Map(this._mutantContainer,e);this._mutant=t,this._update(),this.fire(`spawned`,{mapObject:t}),this._waitControls(),this.once(`controls_ready`,this._setupAttribution)}},_attachObserver:function _attachObserver(e){this._observer||=new MutationObserver(this._onMutations.bind(this)),this._observer.observe(e,{childList:!0,subtree:!0}),Array.prototype.forEach.call(e.querySelectorAll(`img`),this._boundOnMutatedImage)},_waitControls:function(){let e=setInterval(()=>{let t=this._mutant.__gm.layoutManager;if(!t)return;clearInterval(e);let n;Object.keys(t).forEach(function(e){let s=t[e];s.get&&s.get(1)instanceof Node&&(n=s)}),this.fire(`controls_ready`,{positions:n})},50)},_setupAttribution:function(e){if(!this._map)return;let t=google.maps.ControlPosition,n=this._attributionContainer=e.positions.get(t.BOTTOM_RIGHT);L.DomUtil.addClass(n,`leaflet-control leaflet-control-attribution`),L.DomEvent.disableClickPropagation(n),n.style.height=`14px`,this._map._controlCorners.bottomright.appendChild(n),this._logoContainer=e.positions.get(t.BOTTOM_LEFT),this._logoContainer.style.pointerEvents=`auto`,this._map._controlCorners.bottomleft.appendChild(this._logoContainer)},_onMutations:function _onMutations(e){for(var t=0;t<e.length;++t)for(var n=e[t],s=0;s<n.addedNodes.length;++s){var c=n.addedNodes[s];c instanceof HTMLImageElement?this._onMutatedImage(c):c instanceof HTMLElement&&Array.prototype.forEach.call(c.querySelectorAll(`img`),this._boundOnMutatedImage)}},_roadRegexp:/!1i(\d+)!2i(\d+)!3i(\d+|VinaFnapurmBegrtn)!/,_satRegexp:/x=(\d+)&y=(\d+)&z=(\d+|VinaFnapurmBegrtn)/,_onMutatedImage:function _onMutatedImage(e){let t,n=e.src.match(this._roadRegexp),s=0;if(n?(t={z:n[1],x:n[2],y:n[3]},this._imagesPerTile>1&&(e.style.zIndex=1,s=1)):(n=e.src.match(this._satRegexp),n&&(t={x:n[1],y:n[2],z:n[3]}),s=0),t){var c=this._tileCoordsToKey(t);e.style.position=`absolute`;var l=c+`/`+s;this._lru.set(l,e),l in this._tileCallbacks&&this._tileCallbacks[l]&&(this._tileCallbacks[l].forEach(t=>t(e)),delete this._tileCallbacks[l])}},createTile:function(e,t){let n=this._tileCoordsToKey(e),s=L.DomUtil.create(`div`);s.style.textAlign=`left`,s.dataset.pending=this._imagesPerTile,t=t.bind(this,null,s);for(var c=0;c<this._imagesPerTile;++c){let e=n+`/`+c,l=this._lru.get(e);l?(s.appendChild(this._clone(l)),--s.dataset.pending):(this._tileCallbacks[e]=this._tileCallbacks[e]||[],this._tileCallbacks[e].push(function(e){return function(n){e.appendChild(this._clone(n)),--e.dataset.pending,parseInt(e.dataset.pending)||t()}.bind(this)}.bind(this)(s)))}return parseInt(s.dataset.pending)||L.Util.requestAnimFrame(t),s},_clone:function(e){let t=e.cloneNode(!0);return t.style.visibility=`visible`,t},_checkZoomLevels:function(){let e=this._map.getZoom(),t=this._mutant.getZoom();!e||!t||(t!==e||t>this.options.maxNativeZoom)&&this._setMaxNativeZoom(t)},_setMaxNativeZoom:function(e){e!==this.options.maxNativeZoom&&(this.options.maxNativeZoom=e,this._resetView())},_update:function(e){if(this._mutant){e||=this._map.getCenter();let t=new google.maps.LatLng(e.lat,e.lng),n=Math.round(this._map.getZoom()),s=this._mutant.getZoom();this._mutant.setCenter(t),n!==s&&(this._mutant.setZoom(n),this._mutantIsReady&&this._checkZoomLevels())}L.GridLayer.prototype._update.call(this,e)},whenReady:function(e,t){return this._mutant?e.call(t||this,{target:this}):this.on(`spawned`,e,t),this}}),L.gridLayer.googleMutant=function(e){return new L.GridLayer.GoogleMutant(e)};var hn=L.GridLayer.GoogleMutant,gn={iconColor:`#1EB300`,iconAnchor:{marker:[14,34],circle:[11,10],"circle-dot":[5,5],"rectangle-dot":[5,6],doughnut:[8,8]},popupAnchor:{marker:[0,-25],circle:[-3,-76],"circle-dot":[0,-2],"rectangle-dot":[0,-2],doughnut:[0,-2]},innerIconAnchor:{marker:[-2,5],circle:[0,2]},iconSize:{marker:[28,28],circle:[22,22],"circle-dot":[2,2],"rectangle-dot":[2,2],doughnut:[15,15]}},_n=Z.Icon.extend({options:{icon:`leaf`,iconSize:gn.iconSize.circle,iconAnchor:gn.iconAnchor.marker,iconShape:`marker`,iconStyle:``,innerIconAnchor:[0,3],innerIconStyle:``,isAlphaNumericIcon:!1,text:1,borderColor:gn.iconColor,borderWidth:2,borderStyle:`solid`,backgroundColor:`white`,textColor:gn.iconColor,customClasses:``,spin:!1,prefix:`fa`,html:``},initialize(e){this.applyDefaults(e),this.options=!e||!e.html?Z.Util.setOptions(this,e):e},applyDefaults(e){e&&(!e.iconSize&&e.iconShape&&(e.iconSize=gn.iconSize[e.iconShape]),!e.iconAnchor&&e.iconShape&&(e.iconAnchor=gn.iconAnchor[e.iconShape]),!e.popupAnchor&&e.iconShape&&(e.popupAnchor=gn.popupAnchor[e.iconShape]),e.innerIconAnchor||(e.iconShape===`circle`||e.iconShape===`marker`)&&(e.iconShape===`circle`&&e.isAlphaNumericIcon?e.innerIconAnchor=[0,-1]:e.iconShape===`marker`&&!e.isAlphaNumericIcon&&(e.innerIconAnchor=gn.innerIconAnchor[e.iconShape])))},createIcon(){let e=document.createElement(`div`),t=this.options;if(e.innerHTML=t.html?t.html:this.createIconInnerHtml(),this._setIconStyles(e),this.options.iconShape===`marker`){let n=document.createElement(`div`);return n.className=`beautify-marker`+(t.props.owner._currSelRow===t.props.row?` selected`:``),n.appendChild(e),n}return e},createIconInnerHtml(){let e=this.options;if(e.iconShape===`circle-dot`||e.iconShape===`rectangle-dot`||e.iconShape===`doughnut`)return``;let t=this.getInnerIconStyle(e);if(e.isAlphaNumericIcon)return`<div style="`+t+`">`+e.text+`</div>`;let n=``;return e.spin&&(n=` fa-spin`),`<i class="`+e.prefix+` `+e.icon+n+`" style="`+t+`"></i>`},getInnerIconStyle(e){let t=(0,Z.point)(e.innerIconAnchor);return`color:`+e.textColor+`;margin-top:`+t.y+`px; margin-left:`+t.x+`px;`+e.innerIconStyle},_setIconStyles(e){let t=this.options,n=(0,Z.point)(t.iconSize),s=(0,Z.point)(t.iconAnchor);if(e.className=`beautify-marker `,t.iconShape&&(e.className+=t.iconShape),t.customClasses&&(e.className+=` `+t.customClasses),e.style.backgroundColor=t.backgroundColor,e.style.color=t.textColor,e.style.borderColor=t.borderColor,e.style.borderWidth=t.borderWidth+`px`,e.style.borderStyle=t.borderStyle,n&&(e.style.width=n.x+`px`,e.style.height=n.y+`px`),s&&(e.style.marginLeft=-s.x+`px`,e.style.marginTop=-s.y+`px`),t.iconStyle){let n=e.getAttribute(`style`);n+=t.iconStyle,e.setAttribute(`style`,n)}}});function BeautifyIcon(e){return new _n(e)}var LeafletLayer=class extends Z.Layer{_rootGroup},D3SvgOverlay=class extends LeafletLayer{_svg;map;selection;projection;_pixelOrigin;_zoomDiff;_zoom;_scale;_shift;_wgsOrigin;_wgsInitialShift;constructor(e={}){super(),this._options(e)}svg(){return this._rootGroup}_drawCallback;drawCallback(e){return arguments.length?(this._drawCallback=e,this):this._drawCallback}getBounds(){if(!this.selection||!this.projection)return new Z.LatLngBounds([-90,-180],[90,180]);let e=this.selection.node().getBBox(),t;try{t=this.projection.layerPointToLatLng(new Z.Point(e.x,e.y+e.height))}catch{t=[-90,-180]}let n;try{n=this.projection.layerPointToLatLng(new Z.Point(e.x+e.width,e.y))}catch{n=[90,180]}return new Z.LatLngBounds(t,n)}_undef(e){return e===void 0}_options(e){return this._undef(e)?this.options:(e.zoomHide=this._undef(e.zoomHide)?!1:e.zoomHide,e.zoomDraw=this._undef(e.zoomDraw)?!0:e.zoomDraw,this.options=e)}draw(){!this.map||!this._drawCallback||(this.projection.metresPerPixel=40075016.686*Math.abs(Math.cos(this.map.getCenter().lat*Math.PI/180))/2**(this.map.getZoom()+8)*this.projection.scale,this._drawCallback(this.selection,this.projection,this.map.getZoom()))}_zoomChange(e){let t=this._undef(e.zoom)?this.map._zoom:e.zoom;this._zoomDiff=t-this._zoom,this._scale=2**this._zoomDiff,this.projection.scale=this._scale,this._shift=this.map.latLngToLayerPoint(this._wgsOrigin)._subtract(this._wgsInitialShift.multiplyBy(this._scale));let n=[`translate(`,this._shift.x,`,`,this._shift.y,`) `],s=[`scale(`,this._scale,`,`,this._scale,`) `];this._rootGroup.attr(`transform`,n.concat(s).join(``)),this.options.zoomDraw&&this.draw()}onAdd(e){this.map=e;let n=this;return this._svg=Z.svg(),e.addLayer(this._svg),this._rootGroup=(0,t.select)(this._svg._rootGroup).classed(`d3-overlay`,!0),this._rootGroup.classed(`leaflet-zoom-hide`,this.options.zoomDraw),this.selection=this._rootGroup,this._pixelOrigin=e.getPixelOrigin(),this._wgsOrigin=Z.latLng([0,0]),this._wgsInitialShift=this.map.latLngToLayerPoint(this._wgsOrigin),this._zoom=this.map.getZoom(),this._shift=Z.point(0,0),this._scale=1,this.projection={latLngToLayerPoint(e,t){return t=n._undef(t)?n._zoom:t,n.map.project(Z.latLng(e),t)._subtract(n._pixelOrigin)},layerPointToLatLng(e,t){t=n._undef(t)?n._zoom:t;let s=Z.point(e).add(n._pixelOrigin);return n.map.unproject(s,t)},unitsPerMeter:256*2**n._zoom/40075017,metresPerPixel:40075016.686*Math.abs(Math.cos(e.getCenter().lat*Math.PI/180))/2**(e.getZoom()+8),map:n.map,layer:n,scale:1},this.projection._projectPoint=function(e,t){let s=n.projection.latLngToLayerPoint(new Z.LatLng(t,e));this.stream.point(s.x,s.y)},this.projection.pathFromGeojson=path_default().projection(transform_default$1({point:this.projection._projectPoint})),this.projection.latLngToLayerFloatPoint=this.projection.latLngToLayerPoint,this.projection.getZoom=this.map.getZoom.bind(this.map),this.projection.getBounds=this.map.getBounds.bind(this.map),this.selection=this._rootGroup,this.draw(),this}getEvents(){return{zoomend:this._zoomChange,viewreset:this._zoomChange}}onRemove(e){return this._svg.remove(),this}addTo(e){return e.addLayer(this),this}},vn=__toESM(__commonJSMin(((e,t)=>{t!==void 0&&(t.exports=simpleheat);function simpleheat(e){if(!(this instanceof simpleheat))return new simpleheat(e);this._canvas=e=typeof e==`string`?document.getElementById(e):e,this._ctx=e.getContext(`2d`),this._width=e.width,this._height=e.height,this._max=1,this._data=[]}simpleheat.prototype={defaultRadius:25,defaultGradient:{.4:`blue`,.6:`cyan`,.7:`lime`,.8:`yellow`,1:`red`},data:function(e){return this._data=e,this},max:function(e){return this._max=e,this},add:function(e){return this._data.push(e),this},clear:function(){return this._data=[],this},radius:function(e,t){t=t===void 0?15:t;var n=this._circle=this._createCanvas(),s=n.getContext(`2d`),c=this._r=e+t;return n.width=n.height=c*2,s.shadowOffsetX=s.shadowOffsetY=c*2,s.shadowBlur=t,s.shadowColor=`black`,s.beginPath(),s.arc(-c,-c,e,0,Math.PI*2,!0),s.closePath(),s.fill(),this},resize:function(){this._width=this._canvas.width,this._height=this._canvas.height},gradient:function(e){var t=this._createCanvas(),n=t.getContext(`2d`),s=n.createLinearGradient(0,0,0,256);for(var c in t.width=1,t.height=256,e)s.addColorStop(+c,e[c]);return n.fillStyle=s,n.fillRect(0,0,1,256),this._grad=n.getImageData(0,0,1,256).data,this},draw:function(e){this._circle||this.radius(this.defaultRadius),this._grad||this.gradient(this.defaultGradient);var t=this._ctx;t.clearRect(0,0,this._width,this._height);for(var n=0,s=this._data.length,c;n<s;n++)c=this._data[n],t.globalAlpha=Math.max(c[2]/this._max,e===void 0?.05:e),t.drawImage(this._circle,c[0]-this._r,c[1]-this._r);var l=t.getImageData(0,0,this._width,this._height);return this._colorize(l.data,this._grad),t.putImageData(l,0,0),this},_colorize:function(e,t){for(var n=0,s=e.length,c;n<s;n+=4)c=e[n+3]*4,c&&(e[n]=t[c],e[n+1]=t[c+1],e[n+2]=t[c+2])},_createCanvas:function(){return typeof document<`u`?document.createElement(`canvas`):new this._canvas.constructor}}}))(),1),yn=window.simpleheat||vn&&vn.default||vn,LeafletLayer2=class extends Z.Layer{},HeatLayer$1=class extends LeafletLayer2{static{__name(this,`HeatLayer`)}_latlngs;_heat;_frame;_canvas;constructor(e,t={}){super(t),this._latlngs=e}initialize(e){this.setOptions(e)}setLatLngs(e){return this._latlngs=e,this.redraw()}addLatLng(e){return this._latlngs.push(e),this.redraw()}setOptions(e){return this.options=e,this._heat&&this._updateOptions(),this.redraw()}redraw(){return this._heat&&!this._frame&&!this._map._animating&&(this._frame=Z.Util.requestAnimFrame(this._redraw,this)),this}onAdd(e){return this._map=e,this._canvas||this._initCanvas(),e._panes.overlayPane.appendChild(this._canvas),e.on(`moveend`,this._reset,this),e.options.zoomAnimation&&Z.Browser.any3d&&e.on(`zoomanim`,this._animateZoom,this),this._reset(),this}onRemove(e){return e.getPanes().overlayPane.removeChild(this._canvas),e.off(`moveend`,this._reset,this),e.options.zoomAnimation&&e.off(`zoomanim`,this._animateZoom,this),this}addTo(e){return e.addLayer(this),this}_initCanvas(){let e=this._canvas=Z.DomUtil.create(`canvas`,`leaflet-heatmap-layer leaflet-layer`),t=Z.DomUtil.testProp([`transformOrigin`,`WebkitTransformOrigin`,`msTransformOrigin`]);e.style[t]=`50% 50%`;let n=this._map.getSize();e.width=n.x,e.height=n.y;let s=this._map.options.zoomAnimation&&Z.Browser.any3d;Z.DomUtil.addClass(e,`leaflet-zoom-`+(s?`animated`:`hide`)),this._heat=yn(e),this._updateOptions()}_updateOptions(){this._heat.radius(this.options.radius||this._heat.defaultRadius,this.options.blur),this.options.gradient&&this._heat.gradient(this.options.gradient),this.options.max&&this._heat.max(this.options.max)}_reset(){let e=this._map.containerPointToLayerPoint([0,0]);Z.DomUtil.setPosition(this._canvas,e);let t=this._map.getSize();this._heat._width!==t.x&&(this._canvas.width=this._heat._width=t.x),this._heat._height!==t.y&&(this._canvas.height=this._heat._height=t.y),this._redraw()}_redraw(){let e=[],t=this._heat._r,n=this._map.getSize(),s=new Z.Bounds(Z.point([-t,-t]),n.add([t,t])),c=this.options.max===void 0?1:this.options.max,l=this.options.maxZoom===void 0?this._map.getMaxZoom():this.options.maxZoom,d=1/2**Math.max(0,Math.min(l-this._map.getZoom(),12)),f=t/2,p=[],m=this._map._getMapPanePos(),h=m.x%f,g=m.y%f,_,v,y,b,x,S,C,T,E;for(_=0,v=this._latlngs.length;_<v;_++)y=this._map.latLngToContainerPoint(this._latlngs[_]),s.contains(y)&&(x=Math.floor((y.x-h)/f)+2,S=Math.floor((y.y-g)/f)+2,E=(this._latlngs[_].alt===void 0?this._latlngs[_][2]===void 0?1:+this._latlngs[_][2]:this._latlngs[_].alt)*d,p[S]=p[S]||[],b=p[S][x],b?(b[0]=(b[0]*b[2]+y.x*E)/(b[2]+E),b[1]=(b[1]*b[2]+y.y*E)/(b[2]+E),b[2]+=E):p[S][x]=[y.x,y.y,E]);for(_=0,v=p.length;_<v;_++)if(p[_])for(C=0,T=p[_].length;C<T;C++)b=p[_][C],b&&e.push([Math.round(b[0]),Math.round(b[1]),Math.min(b[2],c)]);this._heat.data(e).draw(this.options.minOpacity),this._frame=null}_animateZoom(e){let t=this._map.getZoomScale(e.zoom),n=this._map._getCenterOffset(e.center)._multiplyBy(-t).subtract(this._map._getMapPanePos());Z.DomUtil.setTransform?Z.DomUtil.setTransform(this._canvas,n,t):this._canvas.style[Z.DomUtil.TRANSFORM]=Z.DomUtil.getTranslateString(n)+` scale(`+t+`)`}},bn=Z.default.MarkerClusterGroup,TileLayer=class extends t.Widget{_layer=new Z.FeatureGroup;_crs=Z.CRS.EPSG3857;constructor(e=!1){super(),this._layer.__hpcc_layer=this}crs(){return this._crs}attribution(){return``}clear(){this._layer.clearLayers()}add(e){this._layer.addLayer(e)}_initPromise;init(){return this._initPromise||=Promise.resolve(),this._initPromise}hasBounds(){return!1}getBounds(){return this._layer.getBounds()}layerEnter(e){e.addLayer(this._layer)}layerUpdate(e){}layerExit(e){this._layer.clearLayers(),e.removeLayer(this._layer)}zoomEnd(e){}moveEnd(e){}viewReset(e){}},xn=resolve(`Albers`).scale(.5),Sn=resolve(`AlbersUsaPr`).scale(.5),Cn=Z.Util.extend({},Z.CRS,{projection:{project(e){let t=Sn([e.lng,e.lat]);return t||=xn([e.lng,e.lat]),new Z.Point(t[0],t[1])},unproject(e){if(!isNaN(e.x)&&!isNaN(e.y)){let t=xn.invert([e.x,e.y]);return new Z.LatLng(t[1],t[0])}else return new Z.LatLng(0,0)}},transformation:new Z.Transformation(1,0,1,0),infinite:!0}),AlbersLayer=class extends TileLayer{_crs=Cn;constructor(){super()}hasBounds(){return!0}getBounds(){return new Z.LatLngBounds([20,-123],[49,-64])}};AlbersLayer.prototype._class+=` map_AlbersLayer`;var BlankLayer=class extends TileLayer{constructor(){super()}};BlankLayer.prototype._class+=` map_BlankLayer`;var GMapLayer=class extends TileLayer{constructor(){super()}init(){return this._initPromise||=requireGoogleMap(),this._initPromise}attribution(){return window.__hpcc_gmap_apikey?``:`DEVELOPER USE ONLY (@hpcc-js)`}getMaxZoom(){return 23}layerEnter(e){super.layerEnter(e),this.add(new hn({type:`roadmap`,styles:this.googleMapStyles()}))}};GMapLayer.prototype._class+=` map_GMapLayer`,GMapLayer.prototype.publish(`googleMapStyles`,{},`object`,`Styling for map colors etc`,null,{tags:[`Basic`]});var MapBoxLayer=class extends TileLayer{constructor(){super()}attribution(){return window.__hpcc_mapbox_apikey?``:`DEVELOPER USE ONLY (@hpcc-js)`}getMaxZoom(){return 18}layerEnter(e){super.layerEnter(e),window.__hpcc_mapbox_apikey||console.warn(`__hpcc_mapbox_apikey does not contain a valid API key, reverting to developers key (expect limited performance)`);let t=window.__hpcc_mapbox_apikey||`pk.eyJ1IjoibGVzY2htb28iLCJhIjoiY2psY2FqY3l3MDhqNDN3cDl1MzFmZnkwcCJ9.HRoFwmz1j80gyz18ruggqw`;this.add(new Z.TileLayer(`https://api.mapbox.com/styles/v1/mapbox/{id}/tiles/{z}/{x}/{y}?access_token=${t}`,{attribution:`Map data &copy; <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="https://www.mapbox.com/">Mapbox</a>`,maxZoom:18,id:`streets-v11`,accessToken:t}))}};MapBoxLayer.prototype._class+=` map_MapBoxLayer`;var OpenStreetLayer=class extends TileLayer{constructor(){super()}attribution(){return``}getMaxZoom(){return 18}layerEnter(e){super.layerEnter(e),this.add(new Z.TileLayer(`https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png`,{attribution:`Map data &copy; <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>`,maxZoom:18,id:`open.streets`}))}};OpenStreetLayer.prototype._class+=` map_MapBoxLayer`;var Leaflet=class extends t.HTMLWidget{_leafletElement;_leafletMap;_iconBar=new t.IconBar().buttons([new t.Button().faChar(`fa-plus`).tooltip(`Zoom in`).on(`click`,()=>{this.zoomPlus()}),new t.Button().faChar(`fa-minus`).tooltip(`Zoom out`).on(`click`,()=>{this.zoomMinus()}),new t.Spacer,new t.Button().faChar(`fa-arrows-alt`).tooltip(`Zoom to fit`).on(`click`,()=>{this.zoomToFit()})]);_blankLayer=new BlankLayer;_albersLayer=new AlbersLayer;_mapBoxLayer=new MapBoxLayer;_openStreetLayer=new OpenStreetLayer;_gmapLayer=new GMapLayer;constructor(){super(),this.baseLayer()}zoom(){return this._leafletMap.getZoom()}zoomPlus(){this._leafletMap.zoomIn()}zoomMinus(){this._leafletMap.zoomOut()}zoomToDefault(){this._leafletMap.flyTo({lat:this.defaultLat(),lng:this.defaultLong()},this.defaultZoom(),{animate:!1})}zoomToFit(){let e;this.mapType()===`AlbersPR`?e=this._albersLayer.getBounds():this.layers().filter(e=>e.hasBounds()).forEach(t=>{e?e.extend(t.getBounds()):e=t.getBounds()}),e&&e.isValid()?this._leafletMap.fitBounds(e,{maxZoom:14}):this.zoomToDefault()}syncLayers(e,t,n){let s=[...e],c=[],l=[];this._leafletMap.eachLayer(e=>{let t=s.indexOf(e.__hpcc_layer);t>=0?(c.push(e.__hpcc_layer),s.splice(t,1)):e.__hpcc_layer&&l.push(e.__hpcc_layer)}),s.forEach(e=>{e.layerEnter(this._leafletMap),e.layerUpdate(this._leafletMap)}),c.forEach(e=>{e.layerUpdate(this._leafletMap)}),l.forEach(e=>{e.layerExit(this._leafletMap)})}_owner;isLayer(){return this._owner!==void 0&&this._owner!==this}baseLayer(){switch(this.mapType()){case`AlbersPR`:this.map(this._albersLayer);break;case`MapBox`:this.map(this._mapBoxLayer);break;case`OpenStreet`:this.map(this._openStreetLayer);break;case`Google`:this.map(this._gmapLayer);break;default:this.map(this._blankLayer);break}return this.map()}enter(e,t){super.enter(e,t),t.style(`position`,`relative`),this._leafletElement=t.append(`div`).style(`position`,`absolute`).style(`width`,`${this.width()}px`).style(`height`,`${this.height()}px`),this._iconBar.target(e)}_prevCRS;update(e,t){super.update(e,t),this._leafletElement.style(`width`,`${this.width()}px`).style(`height`,`${this.height()}px`);let n=this.baseLayer();this._prevCRS!==n.crs()&&(this._prevCRS=n.crs(),this._leafletMap&&(this.syncLayers([],e,t),this._leafletMap.remove(),this._leafletElement.html(``)),this._leafletMap=new Z.Map(this._leafletElement.node(),{trackResize:!1,zoomControl:!1,zoomSnap:this.mapType()===`AlbersPR`?.1:1,crs:n.crs(),maxZoom:n.getMaxZoom?n.getMaxZoom():18}),this._leafletMap.setView([this.defaultLat(),this.defaultLong()],this.defaultZoom()),this._leafletMap.attributionControl.setPrefix(n.attribution()),this._leafletMap.on(`zoomend`,e=>this.layers().forEach(t=>t.zoomEnd(e))),this._leafletMap.on(`moveend`,e=>this.layers().forEach(t=>t.moveEnd(e))),this._leafletMap.on(`viewreset`,e=>this.layers().forEach(t=>t.viewReset(e))),this._renderCount=0),this.syncLayers([n,...this.layers()],e,t),this._leafletMap.invalidateSize(),this.autoZoomToFit()&&this._leafletMap.whenReady(function(){this.zoomToFit()},this),this._iconBar.visible(this.showToolbar()).render(e=>{let t=e.getBBox();e.element().style(`z-index`,5e3).style(`left`,`${this.width()-t.width-4}px`)})}exit(e,t){this._iconBar.target(null),super.exit(e,t)}render(e){let t=[this.baseLayer().init(),...this.layers().map(e=>e.init())];return Promise.all(t).then(()=>{super.render(e)}),this}};Leaflet.prototype._class+=` map_Leaflet`,Leaflet.prototype.publish(`showToolbar`,!0,`boolean`,`Show toolbar`,void 0,{hidden:e=>e.isLayer()}),Leaflet.prototype.publish(`mapType`,`Google`,`set`,`Base Layer Type`,[`None`,`AlbersPR`,`MapBox`,`OpenStreet`,`Google`],{hidden:e=>e.isLayer()}),Leaflet.prototype.publish(`map`,null,`widget`,`Base Layer`,void 0,{internal:!0}),Leaflet.prototype.publish(`layers`,[],`propertyArray`,`Layers`,void 0,{hidden:e=>e.isLayer()}),Leaflet.prototype.publish(`defaultLat`,42.877742,`number`,`Center Latitude`,void 0,{hidden:e=>e.isLayer()}),Leaflet.prototype.publish(`defaultLong`,-97.380979,`number`,`Center Longitude`,void 0,{hidden:e=>e.isLayer()}),Leaflet.prototype.publish(`defaultZoom`,4,`number`,`Zoom Level`,void 0,{hidden:e=>e.isLayer()}),Leaflet.prototype.publish(`autoZoomToFit`,!0,`boolean`,`Auto zoom to fit Data`,void 0,{hidden:e=>e.isLayer()});var FeatureLayer=class extends Leaflet{_layer;_selection;constructor(e=!1){super(),this._layer=e?new bn:new Z.FeatureGroup,this._layer.__hpcc_layer=this,t.Utility.SimpleSelectionMixin.call(this),this.layers([this])}owner(e){this._owner=e}valid(){return!0}clear(){this._layer.clearLayers()}add(e){this._layer.addLayer(e)}maxZoom(){return this._owner._leafletMap.getMaxZoom()||24}zoom(){return this._owner._leafletMap.getZoom()}visibleBounds(){return this._owner._leafletMap.getBounds()}_initPromise;init(){return this._initPromise||=Promise.resolve(),this._initPromise}hasBounds(){return!1}getBounds(){return this._layer.getBounds()}style(e,n){return n===void 0?(0,t.select)(this._layer.getPane()).style(e):((0,t.select)(this._layer.getPane()).style(e,n),this)}propValue(e,t,n){return(e<0?n:t[e])||n}layerEnter(e){e.addLayer(this._layer);let n=(0,t.select)(e.getContainer()).select(`.leaflet-pane.leaflet-marker-pane`);this._selection.widgetElement(n)}layerUpdate(e){}layerExit(e){this._layer.clearLayers(),e.removeLayer(this._layer)}zoomEnd(e){}moveEnd(e){}viewReset(e){}};FeatureLayer.prototype._class+=` map_FeatureLayer`,FeatureLayer.prototype.mixin(t.Utility.SimpleSelectionMixin),FeatureLayer.prototype.publishReset([`layers`]);var ClusterLayer=class extends FeatureLayer{constructor(e=!0){super(e)}};ClusterLayer.prototype._class+=` map_ClusterLayer`;var D3SurfaceLayer=class extends FeatureLayer{_lfd3=new D3SvgOverlay().drawCallback((e,t)=>this.layerUpdate(void 0,t));hasBounds(){return!0}getBounds(){return this._lfd3.getBounds()}layerEnter(e){super.layerEnter(e),this.add(this._lfd3)}layerUpdate(e,t){super.layerUpdate(e)}clickHandler(e,t){}},Circles=class extends ClusterLayer{hasBounds(){return!0}layerUpdate(e){super.layerUpdate(e);let t=this.columns(),n=t.indexOf(this.latitudeColumn()),s=t.indexOf(this.longitudeColumn()),c=t.indexOf(this.strokeColorColumn()),l=t.indexOf(this.fillColorColumn());this.clear(),this.data().filter(e=>!this.omitNullLatLong()||!!e[n]&&!!e[s]).forEach(e=>{this.add(new Z.Circle([e[n],e[s]],{color:this.propValue(c,e,this.strokeColor()),fill:!0,fillColor:this.propValue(l,e,this.fillColor()),fillOpacity:this.fillOpacity(),radius:this.radius(),origRow:e}).on(`click`,t=>this.clickHandler(t,e)))})}clickHandler(e,t){}};Circles.prototype._class+=` map_Circles`,Circles.prototype.publish(`latitudeColumn`,null,`set`,`Latitude column`,function(){return this.columns()},{optional:!0}),Circles.prototype.publish(`longitudeColumn`,null,`set`,`Longitude column`,function(){return this.columns()},{optional:!0}),Circles.prototype.publish(`radius`,50,`number`,`Radius (meters)`),Circles.prototype.publish(`strokeColor`,`#376cea`,`html-color`,`Stroke Color`,null,{optional:!0}),Circles.prototype.publish(`strokeColorColumn`,null,`set`,`Stroke color column`,function(){return this.columns()},{optional:!0}),Circles.prototype.publish(`fillColor`,`#376cea`,`html-color`,`Fill Color`,null,{optional:!0}),Circles.prototype.publish(`fillColorColumn`,null,`set`,`Fill color column`,function(){return this.columns()},{optional:!0}),Circles.prototype.publish(`fillOpacity`,.5,`number`,`Opacity`,null,{tags:[`Advanced`]}),Circles.prototype.publish(`omitNullLatLong`,!0,`boolean`,`Remove lat=0,lng=0 from pinsData`,null,{tags:[`Basic`]});var D3Circles=class extends D3SurfaceLayer{layerUpdate(e,t){super.layerUpdate(e,t);let n=this._lfd3._rootGroup;t||=this._lfd3.projection;let s=this.columns(),c=s.indexOf(this.latitudeColumn()),l=s.indexOf(this.longitudeColumn()),d=s.indexOf(this.strokeColorColumn()),f=s.indexOf(this.fillColorColumn());function toLatLng(e){return{lat:+e[c],lng:+e[l]}}let p=n.selectAll(`circle`).data(this.data().filter(e=>!this.omitNullLatLong()||!!e[c]&&!!e[l]));p.enter().append(`circle`).merge(p).attr(`cx`,e=>t.latLngToLayerPoint(toLatLng(e)).x).attr(`cy`,e=>t.latLngToLayerPoint(toLatLng(e)).y).attr(`r`,Math.max(3/t.scale,this.radius()/t.metresPerPixel)).style(`fill-opacity`,this.fillOpacity()).style(`stroke`,e=>this.propValue(d,e,this.strokeColor())).attr(`stroke-width`,Math.max(1/t.scale,1/t.metresPerPixel)).style(`fill`,e=>this.propValue(f,e,this.fillColor())),p.exit().remove()}clickHandler(e,t){}};D3Circles.prototype._class+=` map_D3Circles`,D3Circles.prototype.publish(`latitudeColumn`,null,`set`,`Latitude column`,function(){return this.columns()},{optional:!0}),D3Circles.prototype.publish(`longitudeColumn`,null,`set`,`Longitude column`,function(){return this.columns()},{optional:!0}),D3Circles.prototype.publish(`radius`,50,`number`,`Radius (meters)`),D3Circles.prototype.publish(`strokeColor`,`#376cea`,`html-color`,`Stroke Color`,null,{optional:!0}),D3Circles.prototype.publish(`strokeColorColumn`,null,`set`,`Stroke color column`,function(){return this.columns()},{optional:!0}),D3Circles.prototype.publish(`fillColor`,`#376cea`,`html-color`,`Fill Color`,null,{optional:!0}),D3Circles.prototype.publish(`fillColorColumn`,null,`set`,`Fill color column`,function(){return this.columns()},{optional:!0}),D3Circles.prototype.publish(`fillOpacity`,.5,`number`,`Opacity`,null,{tags:[`Advanced`]}),D3Circles.prototype.publish(`omitNullLatLong`,!0,`boolean`,`Remove lat=0,lng=0 from pinsData`,null,{tags:[`Basic`]});var ClusterCircles=class extends FeatureLayer{_palette;createIcon(e,n,s){let c=(0,t.hsl)(n);return c.opacity=.5,new Z.DivIcon({className:`cluster-circle`,iconSize:new Z.Point(40,40),html:`<div style='opacity:${this.opacity()};background-color:${c.toString()}'><div style='background-color:${n}'><span style='color:${t.Palette.textColor(n)}'>${s(e)}</span></div></div>`})}layerUpdate(e){super.layerUpdate(e),this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+`_`+this.id()));let n=this.cellFunc(this.latitudeColumn(),0),s=this.cellFunc(this.longitudeColumn(),0),latLongFunc=e=>[+n(e),+s(e)],c=this.cellFunc(this.weightColumn(),0),l=this.data(),d=(0,t.extent)(l,c),f=this.weightFormat()?(0,t.format)(this.weightFormat()):e=>e;this.clear(),l.forEach(e=>{let t=new Z.Marker(latLongFunc(e),{icon:this.createIcon(c(e),this._palette(c(e),d[0],d[1]),f),origRow:e}).on(`click`,t=>this.clickHandler(t,e));t.bindTooltip(`Weight: `+c(e)),this.add(t)})}clickHandler(e,t){}};ClusterCircles.prototype._class+=` map_ClusterCircles`,ClusterCircles.prototype._palette=t.Palette.rainbow(`default`),ClusterCircles.prototype.publish(`paletteID`,`YlOrRd`,`set`,`Color palette for this widget`,ClusterCircles.prototype._palette.switch()),ClusterCircles.prototype.publish(`useClonedPalette`,!1,`boolean`,`Enable or disable using a cloned palette`),ClusterCircles.prototype.publish(`latitudeColumn`,null,`set`,`Latitude column`,function(){return this.columns()},{optional:!0}),ClusterCircles.prototype.publish(`longitudeColumn`,null,`set`,`Longitude column`,function(){return this.columns()},{optional:!0}),ClusterCircles.prototype.publish(`weightColumn`,null,`set`,`Weight column`,function(){return this.columns()},{optional:!0}),ClusterCircles.prototype.publish(`weightFormat`,`,`,`string`,`Number format for weight`),ClusterCircles.prototype.publish(`opacity`,.66,`number`,`Opacity`,null,{tags:[`Advanced`]});function fixDateLine(e,t){let n=t.getLatLngs();n.forEach(function(e){e.forEach(function(e){if(Array.isArray(e)){let t=0,n=0,s=0,c=0;e.forEach(function(e){e.lat>-62&&(e.lng>165?++c:e.lng<-165&&++s,e.lng>0?++n:e.lng<0&&++t)}),s>0&&c>0&&e.forEach(function(e){e.lng>165&&t>n?e.lng-=360:e.lng<-165&&n>t&&(e.lng+=360)})}})}),t.setLatLngs(n)}var TopoJSON=class extends Z.GeoJSON{constructor(e,t){super(e,{...t,onEachFeature:(e,n)=>{t.onEachFeature&&t.onEachFeature(e,n),fixDateLine(e,n)}})}addData(e){let t,n;if(e.type===`Topology`){for(n in e.objects)e.objects.hasOwnProperty(n)&&(t=feature_default(e,e.objects[n]),super.addData.call(this,t));return this}return super.addData.call(this,e),this}},World=class extends FeatureLayer{_features;_palette;_dataMap={};_dataMinWeight=null;_dataMaxWeight=null;constructor(){super(),t.Utility.SimpleSelectionMixin.call(this)}hasBounds(){return!0}getBounds(){let e=super.getBounds();return e.isValid()?new Z.LatLngBounds([e.getNorth(),e.getWest()],[e.getSouth(),e.getEast()]):new Z.LatLngBounds([90,-180],[-90,180])}updateDataMap(e){this._dataMap={},this._dataMinWeight=null,this._dataMaxWeight=null;let t=this;e.forEach(function(e){t._dataMap[e[0]]=e,(!t._dataMinWeight||e[1]<t._dataMinWeight)&&(t._dataMinWeight=e[1]),(!t._dataMaxWeight||e[1]>t._dataMaxWeight)&&(t._dataMaxWeight=e[1])})}data(e){let t=super.data.apply(this,arguments);return arguments.length&&this.updateDataMap(e),t}styleFeature(e){let t=this._dataMap[e.properties.hpccID],n=t?this._palette(t[1],this._dataMinWeight,this._dataMaxWeight):`transparent`;return{color:this.meshVisible()?this.meshColor():void 0,opacity:1,weight:this.meshStrokeWidth(),fillColor:n,fillOpacity:this.opacity()}}svgGlowID(){return this.id()+`_svgGlow`}_topoJson;_svgElement;layerEnter(e){super.layerEnter(e),this._svgElement||(this._svgElement=(0,t.select)(e.getContainer()).select(`.leaflet-pane.leaflet-overlay-pane > svg`),new t.SVGGlowFilter(this._svgElement.append(`defs`),this.svgGlowID()),this._selection.widgetElement(this._svgElement))}_prevFeatures;layerUpdate(e){this._prevFeatures!==this._features&&(this.clear(),this._topoJson=new TopoJSON(this._features,{onEachFeature:(e,t)=>{t.on(`click`,e=>this.clickHandler(e,t,t.feature.properties.hpccID))}}).bindTooltip(e=>this.tooltipHandler(e,e.feature.properties.hpccID),{direction:`top`,sticky:!0}),this.add(this._topoJson)),super.layerUpdate(e),this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+`_`+this.id())),this._topoJson.setStyle(e=>this.styleFeature(e))}clickHandler(e,t,n){let s=this._selection.click(e.originalEvent.target);return this.click(this.rowToObj(this._dataMap[n]),this.columns()[0],s),s}tooltipText(e,t){return t}tooltipHandler(e,t){let n=this._dataMap[t],s=n&&n[1]||``;return this.tooltipText(this.rowToObj(n),`<b>${t}</b>: ${s}`)}click(e,t,n){}};World.prototype._class+=` map_World`,World.prototype._palette=t.Palette.rainbow(`default`),World.prototype.mixin(t.Utility.SimpleSelectionMixin),World.prototype.publish(`paletteID`,`YlOrRd`,`set`,`Color palette for this widget`,World.prototype._palette.switch(),{tags:[`Basic`,`Shared`]}),World.prototype.publish(`useClonedPalette`,!1,`boolean`,`Enable or disable using a cloned palette`,null,{tags:[`Intermediate`,`Shared`]}),World.prototype.publish(`opacity`,.5,`number`,`Opacity`,null,{tags:[`Advanced`]}),World.prototype.publish(`meshVisible`,!0,`boolean`,`Mesh Visibility`),World.prototype.publish(`meshColor`,`black`,`html-color`,`Stroke Color`),World.prototype.publish(`meshStrokeWidth`,.25,`number`,`Stroke Width`),World.prototype.publish(`internalOnly`,!1,`boolean`,`Internal mesh only`);var wn=null,Countries=class extends World{constructor(){super()}init(){return this._initPromise||=new Promise((e,t)=>{wn&&e(wn),Zt(`${topoJsonFolder()}/countries.json`,function(t){wn=t,e(wn)})}).then(e=>{this._features=feature_default(e.topology,e.topology.objects.countries).features;for(let t in this._features)if(this._features[t].id){let n=this._features[t].id,s=e.countryNames[n]?.name;this._features[t].properties.hpccID=s}}),this._initPromise}tooltipHandler(e,t){let n=this._dataMap[t],s=n&&n[1]||``;return this.tooltipText(this.rowToObj(n),`<b>${t}</b>: ${s}`)}};function del(e,t){let n=e.indexOf(t);n>=0&&e.splice(n,1)}var DrawLayer=class extends FeatureLayer{_polylines=[];_polygons=[];_rectangles=[];_circles=[];_drawControl;hasBounds(){return!0}drawOptions(){let e={marker:!1,circlemarker:!1};return this.enableCircle()||(e.circle=!1),this.enablePolyline()||(e.polyline=!1),this.enableRectangle()||(e.rectangle=!1),this.enablePolygon()||(e.polygon=!1),e}save(){return{polylines:this._polylines.map(e=>e.getLatLngs()),polygons:this._polygons.map(e=>e.getLatLngs()),rectangles:this._rectangles.map(e=>e.getBounds()),circles:this._circles.map(e=>({center:e.getLatLng(),radius:e.getRadius()}))}}restore(e){this.clear(),this._polylines=(e.polylines||[]).map(e=>new Z.Polyline(e)),this._polygons=(e.polygons||[]).map(e=>new Z.Polygon(e)),this._rectangles=(e.rectangles||[]).map(e=>new Z.Rectangle(e)),this._circles=(e.circles||[]).map(e=>new Z.Circle(e.center,{radius:e.radius})),this._polylines.forEach(e=>this.add(e)),this._polygons.forEach(e=>this.add(e)),this._rectangles.forEach(e=>this.add(e)),this._circles.forEach(e=>this.add(e))}_drawOptionsHash;layerEnter(e){super.layerEnter(e),e.on(Z.Draw.Event.CREATED,e=>{let t=e.layerType,n=e.layer;switch(t){case`polyline`:this._polylines.push(n);break;case`polygon`:this._polygons.push(n);break;case`rectangle`:this._rectangles.push(n);break;case`circle`:this._circles.push(n);break;default:alert(t)}this.add(n),this.changed(`ADD`,n)}),e.on(Z.Draw.Event.EDITED,e=>{e.layers.eachLayer(e=>{this.changed(`UPDATE`,e)})}),e.on(Z.Draw.Event.DELETED,e=>{e.layers.eachLayer(e=>{del(this._polylines,e),del(this._polygons,e),del(this._rectangles,e),del(this._circles,e),this.changed(`DELETE`,e)})})}layerUpdate(e){super.layerUpdate(e),this.style(`opacity`,this.opacity());let t=this.drawOptions(),n=(0,c.hashSum)(t);this._drawOptionsHash!==n&&(this._drawOptionsHash=n,this._drawControl&&e.removeControl(this._drawControl),this._drawControl=new Z.Control.Draw({position:`topleft`,draw:t,edit:{featureGroup:this._layer}}),e.addControl(this._drawControl))}layerExit(e){super.layerExit(e)}changed(e,t){}};DrawLayer.prototype._class+=` map_DrawLayer`,DrawLayer.prototype.publish(`opacity`,1,`number`,`Layer Opacity`),DrawLayer.prototype.publish(`enablePolyline`,!0,`boolean`,`Enable Polyline Creation`),DrawLayer.prototype.publish(`enablePolygon`,!0,`boolean`,`Enable Polygon Creation`),DrawLayer.prototype.publish(`enableRectangle`,!0,`boolean`,`Enable Rectangle Creation`),DrawLayer.prototype.publish(`enableCircle`,!0,`boolean`,`Enable Circle Creation`);var HeatLayer=class extends FeatureLayer{hasBounds(){return!0}layerUpdate(e){super.layerUpdate(e),this.style(`opacity`,this.opacity());let t=this.columns(),n=this.latitudeColumn_exists()?t.indexOf(this.latitudeColumn()):0,s=this.longitudeColumn_exists()?t.indexOf(this.longitudeColumn()):1,c=t.indexOf(this.weightColumn());this.clear();let l,d=new HeatLayer$1(this.data().filter(e=>!this.omitNullLatLong()||!!e[n]&&!!e[s]).map(e=>(l?l.extend([e[n],e[s]]):l=new Z.LatLngBounds([e[n],e[s]]),[e[n],e[s],this.weightColumn_exists()?e[c]:.5])),{minOpacity:this.minOpacity(),max:this.max(),radius:this.radius(),blur:this.blur(),gradient:this.gradient()});d.getBounds=()=>l,this.add(d)}};HeatLayer.prototype._class+=` map_Heat`,HeatLayer.prototype.publish(`latitudeColumn`,null,`set`,`Latitude column`,function(){return this.columns()},{optional:!0}),HeatLayer.prototype.publish(`longitudeColumn`,null,`set`,`Longitude column`,function(){return this.columns()},{optional:!0}),HeatLayer.prototype.publish(`weightColumn`,null,`set`,`Optional normalized intensity (0 -> 1) `,function(){return this.columns()},{optional:!0}),HeatLayer.prototype.publish(`omitNullLatLong`,!0,`boolean`,`Remove lat=0,lng=0 from IconsData`,null,{tags:[`Basic`]}),HeatLayer.prototype.publish(`opacity`,.5,`number`,`Layer Opacity`),HeatLayer.prototype.publish(`minOpacity`,.5,`number`,`The minimum opacity the heat will start at`,null,{tags:[`Basic`]}),HeatLayer.prototype.publish(`max`,1,`number`,`maximum point intensity, 1.0 by default`,null,{tags:[`Basic`]}),HeatLayer.prototype.publish(`radius`,25,`number`,`radius of each point of the heatmap, 25 by default`,null,{tags:[`Basic`]}),HeatLayer.prototype.publish(`blur`,15,`number`,`amount of blur, 15 by default`,null,{tags:[`Basic`]}),HeatLayer.prototype.publish(`gradient`,null,`object`,`color gradient config`,null,{tags:[`Basic`],optional:!0});var Markers=class extends ClusterLayer{constructor(e=!1){super(e)}hasBounds(){return!0}tooltipText(e,t){return``+t}popupText(e,t){return``+t}_hashSum;layerUpdate(e,t){if(super.layerUpdate(e),!t)return;let n=this.columns(),s=n.indexOf(this.latitudeColumn()),c=n.indexOf(this.longitudeColumn()),l=n.indexOf(this.tooltipColumn()),d=n.indexOf(this.popupColumn()),f=this._db.checksum(),p=this.hashSum([],{dbChecksum:f});this._hashSum!==p&&(this._hashSum=p,this.clear(),this.data().filter(e=>!this.omitNullLatLong()||!!e[s]&&!!e[c]).forEach(e=>{let n=new Z.Marker([e[s],e[c]],t(e)).on(`click`,t=>this.clickHandler(t,n,e)),f=this.tooltipText(this.rowToObj(e),this.propValue(l,e,``));f&&n.bindTooltip(f,{direction:this.tooltipDirection(),offset:(0,Z.point)(this.tooltipOffsetX(),this.tooltipOffsetY())});let p=this.popupText(this.rowToObj(e),this.propValue(d,e,``));p&&n.bindPopup(p,{offset:(0,Z.point)(this.popupOffsetX(),this.popupOffsetY())}),this.add(n)}))}_currSelRow;clickHandler(e,t,n){let s=this._selection.click(t._icon);this._currSelRow=s?n:void 0,this.click(this.rowToObj(n),``,s)}click(e,t,n){}};Markers.prototype._class+=` map_Markers`,Markers.prototype.publish(`latitudeColumn`,null,`set`,`Latitude column`,function(){return this.columns()},{optional:!0}),Markers.prototype.publish(`longitudeColumn`,null,`set`,`Longitude column`,function(){return this.columns()},{optional:!0}),Markers.prototype.publish(`omitNullLatLong`,!0,`boolean`,`Remove lat=0,lng=0 from IconsData`,null,{tags:[`Basic`]}),Markers.prototype.publish(`tooltipColumn`,null,`set`,`Tooltip column`,function(){return this.columns()},{optional:!0}),Markers.prototype.publish(`tooltipDirection`,`auto`,`set`,`Tooltip direction`,[`auto`,`left`,`top`,`right`,`bottom`,`center`]),Markers.prototype.publish(`tooltipOffsetX`,0,`number`,`Tooltip offset X`),Markers.prototype.publish(`tooltipOffsetY`,0,`number`,`Tooltip offset Y`),Markers.prototype.publish(`popupColumn`,null,`set`,`Popup column`,function(){return this.columns()},{optional:!0}),Markers.prototype.publish(`popupOffsetX`,0,`number`,`Tooltip offset X`),Markers.prototype.publish(`popupOffsetY`,0,`number`,`Tooltip offset Y`);var Icons=class extends Markers{constructor(e=!1){super(e)}layerUpdate(e){let t=this.columns().indexOf(this.iconUrlColumn());super.layerUpdate(e,e=>({icon:new Z.Icon({iconUrl:this.propValue(t,e,this.iconUrl()),iconSize:[this.iconWidth(),this.iconHeight()],iconAnchor:[this.iconAnchorX(),this.iconAnchorY()],props:{owner:this,row:e}}),draggable:!1}))}};Icons.prototype._class+=` map_Icons`,Icons.prototype.publish(`iconUrl`,``,`string`,`Icon URL`,null),Icons.prototype.publish(`iconUrlColumn`,null,`set`,`Icon URL column`,function(){return this.columns()},{optional:!0}),Icons.prototype.publish(`iconWidth`,32,`number`,`Icon width`),Icons.prototype.publish(`iconHeight`,32,`number`,`Icon height`),Icons.prototype.publish(`iconAnchorX`,16,`number`,`Icon Anchor X`),Icons.prototype.publish(`iconAnchorY`,32,`number`,`Icon Anchor Y`);var ClusterIcons=class extends Icons{constructor(){super(!0)}};ClusterIcons.prototype._class+=` map_ClusterIcons`;function lngLat2LatLng(e){return[e[1],e[0]]}var calcSpread=(e,t)=>(t[0]<-90?e[0]++:t[0]>90&&e[1]++,e),shiftLeft=e=>e>90?e-360:e,shiftRight=e=>e<-90?e+360:e,shiftPoint=e=>{let t=e?shiftLeft:shiftRight;return e=>[t(e[0]),e[1]]},Polygons=class extends FeatureLayer{_palette;fixDateLine(e){let[t,n]=e.reduce(calcSpread,[0,0]);return t&&n?e.map(shiftPoint(t>n)):e}hasBounds(){return!0}updateHexagons(){this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+`_`+this.id()));let e=this.cellFunc(this.polygonColumn(),[]),n=this.cellFunc(this.weightColumn(),0),s=this.data(),c=(0,t.extent)(s,n);this.clear(),s.forEach(t=>{this.add(new Z.Polygon(this.fixDateLine(e(t)).map(lngLat2LatLng),{color:this._palette(c[1],c[0],c[1]),fillColor:this._palette(n(t),c[0],c[1]),fillOpacity:this.opacity(),weight:1,origRow:t}).on(`click`,e=>this.clickHandler(e,t)))})}layerUpdate(e){super.layerUpdate(e),this.updateHexagons()}zoomEnd(e){super.zoomEnd(e)}moveEnd(e){super.moveEnd(e),this.updateHexagons()}clickHandler(e,t){}};Polygons.prototype._class+=` map_Polygons`,Polygons.prototype._palette=t.Palette.rainbow(`default`),Polygons.prototype.publish(`paletteID`,`YlOrRd`,`set`,`Color palette for this widget`,Polygons.prototype._palette.switch(),{tags:[`Basic`,`Shared`]}),Polygons.prototype.publish(`useClonedPalette`,!1,`boolean`,`Enable or disable using a cloned palette`,null,{tags:[`Intermediate`,`Shared`]}),Polygons.prototype.publish(`polygonColumn`,null,`set`,`Polygon column`,function(){return this.columns()},{optional:!0}),Polygons.prototype.publish(`weightColumn`,null,`set`,`Weight column`,function(){return this.columns()},{optional:!0}),Polygons.prototype.publish(`opacity`,.5,`number`,`Opacity`,null,{tags:[`Advanced`]});var Tn=4096/2/Math.PI,Path=class extends D3SurfaceLayer{lineData(){let e=this.columns(),t=e.indexOf(this.latitudeColumn()),n=e.indexOf(this.longitudeColumn()),s=[],c;return this.data().forEach(e=>{let l=[e[n],e[t]];c&&s.push({type:`LineString`,coordinates:[l,c]}),c=l}),s}isNull(e){return!e[0]&&!e[1]}isNull2(e){return this.omitNullLatLong()?this.isNull(e[0])||this.isNull(e[1]):!1}layerUpdate(e,t){super.layerUpdate(e,t);let n=this._lfd3._rootGroup;t||=this._lfd3.projection,this._lfd3.svg().selectAll(`defs`).data([void 0]).enter().append(`defs`).append(`marker`).attr(`class`,`marker`).attr(`id`,this._id+`_arrowHead`).attr(`viewBox`,`0 0 10 10`).attr(`refX`,10).attr(`refY`,5).attr(`markerWidth`,12).attr(`markerHeight`,12).attr(`markerUnits`,`strokeWidth`).attr(`orient`,`auto`).append(`polyline`).attr(`points`,`0,0 10,5 0,10 1,5`),this._lfd3.svg().select(`defs > marker`).style(`fill`,this.strokeColor()).style(`stroke`,null);let s=t.latLngToLayerPoint({lat:0,lng:0}),c=resolve(`Mercator`).scale(Tn).translate([s.x,s.y]),l=path_default().projection(c),d=n.selectAll(`.dataEdge`).data(this.lineData().filter(e=>!this.isNull2(e.coordinates)));d.enter().append(`path`).attr(`class`,`dataEdge`).attr(`marker-end`,`url(#`+this._id+`_arrowHead)`).merge(d).attr(`d`,l).style(`stroke`,this.strokeColor()).style(`fill`,`none`).attr(`stroke-width`,1/t.scale),d.exit().remove()}clickHandler(e,t){}};Path.prototype._class+=` map_Path`,Path.prototype.publish(`latitudeColumn`,null,`set`,`Latitude column`,function(){return this.columns()},{optional:!0}),Path.prototype.publish(`longitudeColumn`,null,`set`,`Longitude column`,function(){return this.columns()},{optional:!0}),Path.prototype.publish(`strokeColor`,` #666666`,`html-color`,`Stroke Color`,null,{optional:!0}),Path.prototype.publish(`omitNullLatLong`,!0,`boolean`,`Remove lat=0,lng=0 from pinsData`,null,{tags:[`Basic`]});var Lines$1=class extends Path{static{__name(this,`Lines`)}lineData(){let e=this.columns(),t=e.indexOf(this.latitudeColumn()),n=e.indexOf(this.longitudeColumn()),s=e.indexOf(this.latitude2Column()),c=e.indexOf(this.longitude2Column()),l=[];return this.data().forEach(e=>{let d=[e[n],e[t]],f=[e[c],e[s]];l.push({type:`LineString`,coordinates:[d,f]})}),l}};Lines$1.prototype._class+=` map_Lines`,Lines$1.prototype.publish(`latitude2Column`,null,`set`,`Latitude column`,function(){return this.columns()},{optional:!0}),Lines$1.prototype.publish(`longitude2Column`,null,`set`,`Longitude column`,function(){return this.columns()},{optional:!0});var Pins$1=class extends Markers{static{__name(this,`Pins`)}constructor(e=!1){super(e)}layerUpdate(e){let t=this.columns(),n=t.indexOf(this.faCharColumn()),s=t.indexOf(this.faCharColorColumn()),c=t.indexOf(this.strokeColorColumn()),l=t.indexOf(this.fillColorColumn());super.layerUpdate(e,e=>({icon:BeautifyIcon({iconShape:`marker`,icon:this.propValue(n,e,this.faChar()),textColor:this.propValue(s,e,this.faCharColor()),borderColor:this.propValue(c,e,this.strokeColor()),backgroundColor:this.propValue(l,e,this.fillColor()),props:{owner:this,row:e}}),draggable:!1}))}};Pins$1.prototype._class+=` map_Pins`,Pins$1.prototype.publish(`faChar`,`fa-circle`,`string`,`Default font awesome character`),Pins$1.prototype.publish(`faCharColumn`,null,`set`,`Font awesome column`,function(){return this.columns()},{optional:!0}),Pins$1.prototype.publish(`faCharColor`,`#ffffff`,`html-color`,`Default font awesome Color`),Pins$1.prototype.publish(`faCharColorColumn`,null,`set`,`Font awesome color column`,function(){return this.columns()},{optional:!0}),Pins$1.prototype.publish(`strokeColor`,`transparent`,`html-color`,`Default stroke Color`,null,{optional:!0}),Pins$1.prototype.publish(`strokeColorColumn`,null,`set`,`Stroke color column`,function(){return this.columns()},{optional:!0}),Pins$1.prototype.publish(`fillColor`,`#376cea`,`html-color`,`Default fill Color`,null,{optional:!0}),Pins$1.prototype.publish(`fillColorColumn`,null,`set`,`Fill color column`,function(){return this.columns()},{optional:!0});var ClusterPins=class extends Pins$1{constructor(){super(!0)}};ClusterPins.prototype._class+=` map_ClusterPins`;var En={GB:[`administrative_area_level_3`,`administrative_area_level_2`,`administrative_area_level_1`],IE:[`administrative_area_level_2`,`administrative_area_level_1`],ND:[`administrative_area_level_2`,`administrative_area_level_1`]},Dn={};function cachedRegion(e){return Dn[e]||(Dn[e]={topology:void 0,nameIdx:{},codeIdx:{}}),Dn[e]}var Region=class extends World{constructor(){super()}fetchTopo(e){return cachedRegion(e).topology?Promise.resolve(cachedRegion(e).topology):new Promise((t,n)=>{Zt(`${topoJsonFolder()}/${e}.json`,function(n){cachedRegion(e).topology=n,t(n)})})}fetchTopoIdx(e){for(let t in cachedRegion(e).nameIdx)return Promise.resolve(cachedRegion(e).nameIdx);return new Promise((t,n)=>{Zt(`${topoJsonFolder()}/${e}_idx.json`,function(n){let{nameIdx:s,codeIdx:c}=cachedRegion(e);En[e]?.forEach(e=>{for(let t in n[e]){let l=n[e][t];Array.isArray(l)&&(s[t]||(s[t]={code:void 0,codes:[]}),s[t].codes=s[t].codes.concat(l),l.length===1&&(s[t].code=s[t].codes[0]),l.forEach(e=>{c[e]||(c[e]={name:void 0,score:9999,names:[]}),l.length<=c[e].score&&(c[e].name=t,c[e].score=l.length),c[e].names.push(t)}))}}),t(s)})})}updateDataMap(e){let t=[],n=cachedRegion(this.region()).nameIdx;return e.forEach(e=>{let s=n[e[0]]?.codes;s?s?.forEach(n=>{t.push([n,e[1],e])}):t.push([e[0],e[1],e])}),super.updateDataMap(t)}_prevRegion;init(){let e=this.region();return(!this._initPromise||this._prevRegion!==e)&&(this._prevRegion=e,this._initPromise=Promise.all([this.fetchTopo(e),this.fetchTopoIdx(e)]).then(([e,t])=>{this._features=feature_default(e,e.objects.PolbndA).features;for(let e in this._features){let t=this._features[e].id||e;this._features[e].properties.hpccID=t}this.updateDataMap(this.data())})),this._initPromise}tooltipHandler(e,t){let n=this._dataMap[t],s=cachedRegion(this.region()).codeIdx,c=n&&n[1]||``,l=s[t]?.names.map(e=>s[t]?.name===e?`<u>${e}</u>`:e).join(`, `);return this.tooltipText(this.rowToObj(n),`<b>${n&&n[2][0]||l||t}</b>: ${c}`)}};Region.prototype._class+=` map_Region`,Region.prototype.publish(`region`,`GB`,`set`,`Region Data`,`AT.BE.BG.BR.CHLI.CY.CZ.DE.DK.EE.ES.FI.FR.GB.GE.GR.HR.HU.IE.IS.IT.KS.LT.LU.LV.MD.MK.MT.ND.NL.NO.PL.PT.RO.RS.SE.SI.SK.UA`.split(`.`));var Text=class extends Markers{constructor(e=!1){super(e)}layerUpdate(e){let n=this.columns(),s=n.indexOf(this.textColumn()),c=n.indexOf(this.textColorColumn()),l=n.indexOf(this.strokeColorColumn()),d=n.indexOf(this.fillColorColumn());super.layerUpdate(e,e=>{let n=this.propValue(s,e,this.text()),f=this.textSize(n,this.fontFamily(),this.fontSize());return this.textFormat_exists()&&(n=(0,t.format)(this.textFormat())(n)),{icon:BeautifyIcon({iconShape:`rectangle`,iconAnchor:[f.width/2+this.textOffsetX(),f.height/2+this.textOffsetY()],html:`<span style="
2
2
  ${this.fontFamily_exists()?`font-family:${this.fontFamily()};`:``}
3
3
  font-size:${this.fontSize()}px;
4
4
  pointer-events: none;