From 7f73db046f3e64587ad951bf158d20dffa1a31c6 Mon Sep 17 00:00:00 2001 From: lyret Date: Sun, 30 Jun 2024 12:26:29 +0000 Subject: [PATCH] deploy: 40b495ee9f256b012770b3ef6967c582c80def4b --- bundle.js | 28 ++++++++++++++-------------- index.css | 17 +++++++++++++++++ 2 files changed, 31 insertions(+), 14 deletions(-) diff --git a/bundle.js b/bundle.js index 78137de..a0fd07e 100644 --- a/bundle.js +++ b/bundle.js @@ -1,23 +1,23 @@ -(()=>{var r_=Object.create;var Lf=Object.defineProperty;var i_=Object.getOwnPropertyDescriptor;var o_=Object.getOwnPropertyNames;var s_=Object.getPrototypeOf,a_=Object.prototype.hasOwnProperty;var se=(r,n)=>()=>(n||r((n={exports:{}}).exports,n),n.exports);var u_=(r,n,s,a)=>{if(n&&typeof n=="object"||typeof n=="function")for(let l of o_(n))!a_.call(r,l)&&l!==s&&Lf(r,l,{get:()=>n[l],enumerable:!(a=i_(n,l))||a.enumerable});return r};var On=(r,n,s)=>(s=r!=null?r_(s_(r)):{},u_(n||!r||!r.__esModule?Lf(s,"default",{value:r,enumerable:!0}):s,r));var Oo=se((Gu,bf)=>{(function(r,n){typeof Gu=="object"&&typeof bf<"u"?n(Gu):typeof define=="function"&&define.amd?define(["exports"],n):(r=typeof globalThis<"u"?globalThis:r||self,n(r.leaflet={}))})(Gu,function(r){"use strict";var n="1.9.3";function s(i){var f,y,M,O;for(y=1,M=arguments.length;y"u"||!L||!L.Mixin)){i=B(i)?i:[i];for(var f=0;f0?Math.floor(i):Math.ceil(i)};Mt.prototype={clone:function(){return new Mt(this.x,this.y)},add:function(i){return this.clone()._add(ft(i))},_add:function(i){return this.x+=i.x,this.y+=i.y,this},subtract:function(i){return this.clone()._subtract(ft(i))},_subtract:function(i){return this.x-=i.x,this.y-=i.y,this},divideBy:function(i){return this.clone()._divideBy(i)},_divideBy:function(i){return this.x/=i,this.y/=i,this},multiplyBy:function(i){return this.clone()._multiplyBy(i)},_multiplyBy:function(i){return this.x*=i,this.y*=i,this},scaleBy:function(i){return new Mt(this.x*i.x,this.y*i.y)},unscaleBy:function(i){return new Mt(this.x/i.x,this.y/i.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=Xt(this.x),this.y=Xt(this.y),this},distanceTo:function(i){i=ft(i);var f=i.x-this.x,y=i.y-this.y;return Math.sqrt(f*f+y*y)},equals:function(i){return i=ft(i),i.x===this.x&&i.y===this.y},contains:function(i){return i=ft(i),Math.abs(i.x)<=Math.abs(this.x)&&Math.abs(i.y)<=Math.abs(this.y)},toString:function(){return"Point("+P(this.x)+", "+P(this.y)+")"}};function ft(i,f,y){return i instanceof Mt?i:B(i)?new Mt(i[0],i[1]):i==null?i:typeof i=="object"&&"x"in i&&"y"in i?new Mt(i.x,i.y):new Mt(i,f,y)}function Ct(i,f){if(i)for(var y=f?[i,f]:i,M=0,O=y.length;M=this.min.x&&y.x<=this.max.x&&f.y>=this.min.y&&y.y<=this.max.y},intersects:function(i){i=st(i);var f=this.min,y=this.max,M=i.min,O=i.max,W=O.x>=f.x&&M.x<=y.x,at=O.y>=f.y&&M.y<=y.y;return W&&at},overlaps:function(i){i=st(i);var f=this.min,y=this.max,M=i.min,O=i.max,W=O.x>f.x&&M.xf.y&&M.y=f.lat&&O.lat<=y.lat&&M.lng>=f.lng&&O.lng<=y.lng},intersects:function(i){i=Ot(i);var f=this._southWest,y=this._northEast,M=i.getSouthWest(),O=i.getNorthEast(),W=O.lat>=f.lat&&M.lat<=y.lat,at=O.lng>=f.lng&&M.lng<=y.lng;return W&&at},overlaps:function(i){i=Ot(i);var f=this._southWest,y=this._northEast,M=i.getSouthWest(),O=i.getNorthEast(),W=O.lat>f.lat&&M.latf.lng&&M.lng1,Vr=function(){var i=!1;try{var f=Object.defineProperty({},"passive",{get:function(){i=!0}});window.addEventListener("testPassiveEventSupport",x,f),window.removeEventListener("testPassiveEventSupport",x,f)}catch{}return i}(),zn=function(){return!!document.createElement("canvas").getContext}(),cn=!!(document.createElementNS&&Hn("svg").createSVGRect),or=!!cn&&function(){var i=document.createElement("div");return i.innerHTML="",(i.firstChild&&i.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),sr=!cn&&function(){try{var i=document.createElement("div");i.innerHTML='';var f=i.firstChild;return f.style.behavior="url(#default#VML)",f&&typeof f.adj=="object"}catch{return!1}}(),wo=navigator.platform.indexOf("Mac")===0,Wn=navigator.platform.indexOf("Linux")===0;function nr(i){return navigator.userAgent.toLowerCase().indexOf(i)>=0}var Ut={ie:Ht,ielt9:ht,edge:Y,webkit:C,android:b,android23:k,androidStock:Z,opera:J,chrome:tt,gecko:pt,safari:Lt,phantom:vt,opera12:Ft,win:Wt,ie3d:Jt,webkit3d:$t,gecko3d:jt,any3d:ge,mobile:pe,mobileWebkit:Te,mobileWebkit3d:Ce,msPointer:he,pointer:An,touch:St,touchNative:we,mobileOpera:Dn,mobileGecko:Xn,retina:re,passiveEvents:Vr,canvas:zn,svg:cn,vml:sr,inlineSvg:or,mac:wo,linux:Wn},Ei=Ut.msPointer?"MSPointerDown":"pointerdown",oi=Ut.msPointer?"MSPointerMove":"pointermove",xe=Ut.msPointer?"MSPointerUp":"pointerup",Kn=Ut.msPointer?"MSPointerCancel":"pointercancel",$n={touchstart:Ei,touchmove:oi,touchend:xe,touchcancel:Kn},jr={touchstart:pr,touchmove:Di,touchend:Di,touchcancel:Di},wn={},ar=!1;function Or(i,f,y){return f==="touchstart"&&kn(),jr[f]?(y=jr[f].bind(this,y),i.addEventListener($n[f],y,!1),y):(console.warn("wrong event specified:",f),x)}function ho(i,f,y){if(!$n[f]){console.warn("wrong event specified:",f);return}i.removeEventListener($n[f],y,!1)}function rr(i){wn[i.pointerId]=i}function Lo(i){wn[i.pointerId]&&(wn[i.pointerId]=i)}function Ln(i){delete wn[i.pointerId]}function kn(){ar||(document.addEventListener(Ei,rr,!0),document.addEventListener(oi,Lo,!0),document.addEventListener(xe,Ln,!0),document.addEventListener(Kn,Ln,!0),ar=!0)}function Di(i,f){if(f.pointerType!==(f.MSPOINTER_TYPE_MOUSE||"mouse")){f.touches=[];for(var y in wn)f.touches.push(wn[y]);f.changedTouches=[f],i(f)}}function pr(i,f){f.MSPOINTER_TYPE_TOUCH&&f.pointerType===f.MSPOINTER_TYPE_TOUCH&&it(f),Di(i,f)}function Mi(i){var f={},y,M;for(M in i)y=i[M],f[M]=y&&y.bind?y.bind(i):y;return i=f,f.type="dblclick",f.detail=2,f.isTrusted=!1,f._simulated=!0,f}var bn=200;function mi(i,f){i.addEventListener("dblclick",f);var y=0,M;function O(W){if(W.detail!==1){M=W.detail;return}if(!(W.pointerType==="mouse"||W.sourceCapabilities&&!W.sourceCapabilities.firesTouchEvents)){var at=ot(W);if(!(at.some(function(xt){return xt instanceof HTMLLabelElement&&xt.attributes.for})&&!at.some(function(xt){return xt instanceof HTMLInputElement||xt instanceof HTMLSelectElement}))){var mt=Date.now();mt-y<=bn?(M++,M===2&&f(Mi(W))):M=1,y=mt}}}return i.addEventListener("click",O),{dblclick:f,simDblclick:O}}function Nr(i,f){i.removeEventListener("dblclick",f.dblclick),i.removeEventListener("click",f.simDblclick)}var dr=Jo(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),ur=Jo(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),co=ur==="webkitTransition"||ur==="OTransition"?ur+"End":"transitionend";function Bi(i){return typeof i=="string"?document.getElementById(i):i}function Fi(i,f){var y=i.style[f]||i.currentStyle&&i.currentStyle[f];if((!y||y==="auto")&&document.defaultView){var M=document.defaultView.getComputedStyle(i,null);y=M?M[f]:null}return y==="auto"?null:y}function Le(i,f,y){var M=document.createElement(i);return M.className=f||"",y&&y.appendChild(M),M}function le(i){var f=i.parentNode;f&&f.removeChild(i)}function Rr(i){for(;i.firstChild;)i.removeChild(i.firstChild)}function Un(i){var f=i.parentNode;f&&f.lastChild!==i&&f.appendChild(i)}function Pi(i){var f=i.parentNode;f&&f.firstChild!==i&&f.insertBefore(i,f.firstChild)}function fo(i,f){if(i.classList!==void 0)return i.classList.contains(f);var y=bo(i);return y.length>0&&new RegExp("(^|\\s)"+f+"(\\s|$)").test(y)}function Zt(i,f){if(i.classList!==void 0)for(var y=N(f),M=0,O=y.length;M0?2*window.devicePixelRatio:1;function yt(i){return Ut.edge?i.wheelDeltaY/2:i.deltaY&&i.deltaMode===0?-i.deltaY/Pt:i.deltaY&&i.deltaMode===1?-i.deltaY*20:i.deltaY&&i.deltaMode===2?-i.deltaY*60:i.deltaX||i.deltaZ?0:i.wheelDelta?(i.wheelDeltaY||i.wheelDelta)/2:i.detail&&Math.abs(i.detail)<32765?-i.detail*20:i.detail?i.detail/-32765*60:0}function At(i,f){var y=f.relatedTarget;if(!y)return!0;try{for(;y&&y!==i;)y=y.parentNode}catch{return!1}return y!==i}var Gt={__proto__:null,on:ie,off:Pe,stopPropagation:I,disableScrollPropagation:V,disableClickPropagation:nt,preventDefault:it,stop:rt,getPropagationPath:ot,getMousePosition:dt,getWheelDelta:yt,isExternalTarget:At,addListener:ie,removeListener:Pe},te=bt.extend({run:function(i,f,y,M){this.stop(),this._el=i,this._inProgress=!0,this._duration=y||.25,this._easeOutPower=1/Math.max(M||.5,.2),this._startPos=gr(i),this._offset=f.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=lt(this._animate,this),this._step()},_step:function(i){var f=+new Date-this._startTime,y=this._duration*1e3;fthis.options.maxZoom)?this.setZoom(i):this},panInsideBounds:function(i,f){this._enforcingBounds=!0;var y=this.getCenter(),M=this._limitCenter(y,this._zoom,Ot(i));return y.equals(M)||this.panTo(M,f),this._enforcingBounds=!1,this},panInside:function(i,f){f=f||{};var y=ft(f.paddingTopLeft||f.padding||[0,0]),M=ft(f.paddingBottomRight||f.padding||[0,0]),O=this.project(this.getCenter()),W=this.project(i),at=this.getPixelBounds(),mt=st([at.min.add(y),at.max.subtract(M)]),xt=mt.getSize();if(!mt.contains(W)){this._enforcingBounds=!0;var Nt=W.subtract(mt.getCenter()),ee=mt.extend(W).getSize().subtract(xt);O.x+=Nt.x<0?-ee.x:ee.x,O.y+=Nt.y<0?-ee.y:ee.y,this.panTo(this.unproject(O),f),this._enforcingBounds=!1}return this},invalidateSize:function(i){if(!this._loaded)return this;i=s({animate:!1,pan:!0},i===!0?{animate:!0}:i);var f=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var y=this.getSize(),M=f.divideBy(2).round(),O=y.divideBy(2).round(),W=M.subtract(O);return!W.x&&!W.y?this:(i.animate&&i.pan?this.panBy(W):(i.pan&&this._rawPanBy(W),this.fire("move"),i.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(l(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:f,newSize:y}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(i){if(i=this._locateOptions=s({timeout:1e4,watch:!1},i),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var f=l(this._handleGeolocationResponse,this),y=l(this._handleGeolocationError,this);return i.watch?this._locationWatchId=navigator.geolocation.watchPosition(f,y,i):navigator.geolocation.getCurrentPosition(f,y,i),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(i){if(this._container._leaflet_id){var f=i.code,y=i.message||(f===1?"permission denied":f===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:f,message:"Geolocation error: "+y+"."})}},_handleGeolocationResponse:function(i){if(this._container._leaflet_id){var f=i.coords.latitude,y=i.coords.longitude,M=new Qt(f,y),O=M.toBounds(i.coords.accuracy*2),W=this._locateOptions;if(W.setView){var at=this.getBoundsZoom(O);this.setView(M,W.maxZoom?Math.min(at,W.maxZoom):at)}var mt={latlng:M,bounds:O,timestamp:i.timestamp};for(var xt in i.coords)typeof i.coords[xt]=="number"&&(mt[xt]=i.coords[xt]);this.fire("locationfound",mt)}},addHandler:function(i,f){if(!f)return this;var y=this[i]=new f(this);return this._handlers.push(y),this.options[i]&&y.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new 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}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),le(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(gt(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var i;for(i in this._layers)this._layers[i].remove();for(i in this._panes)le(this._panes[i]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(i,f){var y="leaflet-pane"+(i?" leaflet-"+i.replace("Pane","")+"-pane":""),M=Le("div",y,f||this._mapPane);return i&&(this._panes[i]=M),M},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var i=this.getPixelBounds(),f=this.unproject(i.getBottomLeft()),y=this.unproject(i.getTopRight());return new Rt(f,y)},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(i,f,y){i=Ot(i),y=ft(y||[0,0]);var M=this.getZoom()||0,O=this.getMinZoom(),W=this.getMaxZoom(),at=i.getNorthWest(),mt=i.getSouthEast(),xt=this.getSize().subtract(y),Nt=st(this.project(mt,M),this.project(at,M)).getSize(),ee=Ut.any3d?this.options.zoomSnap:1,ae=xt.x/Nt.x,Se=xt.y/Nt.y,ci=f?Math.max(ae,Se):Math.min(ae,Se);return M=this.getScaleZoom(ci,M),ee&&(M=Math.round(M/(ee/100))*(ee/100),M=f?Math.ceil(M/ee)*ee:Math.floor(M/ee)*ee),Math.max(O,Math.min(W,M))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new Mt(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(i,f){var y=this._getTopLeftPoint(i,f);return new Ct(y,y.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(i){return this.options.crs.getProjectedBounds(i===void 0?this.getZoom():i)},getPane:function(i){return typeof i=="string"?this._panes[i]:i},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(i,f){var y=this.options.crs;return f=f===void 0?this._zoom:f,y.scale(i)/y.scale(f)},getScaleZoom:function(i,f){var y=this.options.crs;f=f===void 0?this._zoom:f;var M=y.zoom(i*y.scale(f));return isNaN(M)?1/0:M},project:function(i,f){return f=f===void 0?this._zoom:f,this.options.crs.latLngToPoint(Tt(i),f)},unproject:function(i,f){return f=f===void 0?this._zoom:f,this.options.crs.pointToLatLng(ft(i),f)},layerPointToLatLng:function(i){var f=ft(i).add(this.getPixelOrigin());return this.unproject(f)},latLngToLayerPoint:function(i){var f=this.project(Tt(i))._round();return f._subtract(this.getPixelOrigin())},wrapLatLng:function(i){return this.options.crs.wrapLatLng(Tt(i))},wrapLatLngBounds:function(i){return this.options.crs.wrapLatLngBounds(Ot(i))},distance:function(i,f){return this.options.crs.distance(Tt(i),Tt(f))},containerPointToLayerPoint:function(i){return ft(i).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(i){return ft(i).add(this._getMapPanePos())},containerPointToLatLng:function(i){var f=this.containerPointToLayerPoint(ft(i));return this.layerPointToLatLng(f)},latLngToContainerPoint:function(i){return this.layerPointToContainerPoint(this.latLngToLayerPoint(Tt(i)))},mouseEventToContainerPoint:function(i){return dt(i,this._container)},mouseEventToLayerPoint:function(i){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(i))},mouseEventToLatLng:function(i){return this.layerPointToLatLng(this.mouseEventToLayerPoint(i))},_initContainer:function(i){var f=this._container=Bi(i);if(f){if(f._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");ie(f,"scroll",this._onScroll,this),this._containerId=g(f)},_initLayout:function(){var i=this._container;this._fadeAnimated=this.options.fadeAnimation&&Ut.any3d,Zt(i,"leaflet-container"+(Ut.touch?" leaflet-touch":"")+(Ut.retina?" leaflet-retina":"")+(Ut.ielt9?" leaflet-oldie":"")+(Ut.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var f=Fi(i,"position");f!=="absolute"&&f!=="relative"&&f!=="fixed"&&f!=="sticky"&&(i.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var i=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),De(this._mapPane,new Mt(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(Zt(i.markerPane,"leaflet-zoom-hide"),Zt(i.shadowPane,"leaflet-zoom-hide"))},_resetView:function(i,f,y){De(this._mapPane,new Mt(0,0));var M=!this._loaded;this._loaded=!0,f=this._limitZoom(f),this.fire("viewprereset");var O=this._zoom!==f;this._moveStart(O,y)._move(i,f)._moveEnd(O),this.fire("viewreset"),M&&this.fire("load")},_moveStart:function(i,f){return i&&this.fire("zoomstart"),f||this.fire("movestart"),this},_move:function(i,f,y,M){f===void 0&&(f=this._zoom);var O=this._zoom!==f;return this._zoom=f,this._lastCenter=i,this._pixelOrigin=this._getNewPixelOrigin(i),M?y&&y.pinch&&this.fire("zoom",y):((O||y&&y.pinch)&&this.fire("zoom",y),this.fire("move",y)),this},_moveEnd:function(i){return i&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return gt(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(i){De(this._mapPane,this._getMapPanePos().subtract(i))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(i){this._targets={},this._targets[g(this._container)]=this;var f=i?Pe:ie;f(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&f(window,"resize",this._onResize,this),Ut.any3d&&this.options.transform3DLimit&&(i?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){gt(this._resizeRequest),this._resizeRequest=lt(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var i=this._getMapPanePos();Math.max(Math.abs(i.x),Math.abs(i.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(i,f){for(var y=[],M,O=f==="mouseout"||f==="mouseover",W=i.target||i.srcElement,at=!1;W;){if(M=this._targets[g(W)],M&&(f==="click"||f==="preclick")&&this._draggableMoved(M)){at=!0;break}if(M&&M.listens(f,!0)&&(O&&!At(W,i)||(y.push(M),O))||W===this._container)break;W=W.parentNode}return!y.length&&!at&&!O&&this.listens(f,!0)&&(y=[this]),y},_isClickDisabled:function(i){for(;i&&i!==this._container;){if(i._leaflet_disable_click)return!0;i=i.parentNode}},_handleDOMEvent:function(i){var f=i.target||i.srcElement;if(!(!this._loaded||f._leaflet_disable_events||i.type==="click"&&this._isClickDisabled(f))){var y=i.type;y==="mousedown"&&Ae(f),this._fireDOMEvent(i,y)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(i,f,y){if(i.type==="click"){var M=s({},i);M.type="preclick",this._fireDOMEvent(M,M.type,y)}var O=this._findEventTargets(i,f);if(y){for(var W=[],at=0;at0?Math.round(i-f)/2:Math.max(0,Math.ceil(i))-Math.max(0,Math.floor(f))},_limitZoom:function(i){var f=this.getMinZoom(),y=this.getMaxZoom(),M=Ut.any3d?this.options.zoomSnap:1;return M&&(i=Math.round(i/M)*M),Math.max(f,Math.min(y,i))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){En(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(i,f){var y=this._getCenterOffset(i)._trunc();return(f&&f.animate)!==!0&&!this.getSize().contains(y)?!1:(this.panBy(y,f),!0)},_createAnimProxy:function(){var i=this._proxy=Le("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(i),this.on("zoomanim",function(f){var y=dr,M=this._proxy.style[y];si(this._proxy,this.project(f.center,f.zoom),this.getZoomScale(f.zoom,1)),M===this._proxy.style[y]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){le(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var i=this.getCenter(),f=this.getZoom();si(this._proxy,this.project(i,f),this.getZoomScale(f,1))},_catchTransitionEnd:function(i){this._animatingZoom&&i.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(i,f,y){if(this._animatingZoom)return!0;if(y=y||{},!this._zoomAnimated||y.animate===!1||this._nothingToAnimate()||Math.abs(f-this._zoom)>this.options.zoomAnimationThreshold)return!1;var M=this.getZoomScale(f),O=this._getCenterOffset(i)._divideBy(1-1/M);return y.animate!==!0&&!this.getSize().contains(O)?!1:(lt(function(){this._moveStart(!0,!1)._animateZoom(i,f,!0)},this),!0)},_animateZoom:function(i,f,y,M){this._mapPane&&(y&&(this._animatingZoom=!0,this._animateToCenter=i,this._animateToZoom=f,Zt(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:i,zoom:f,noUpdate:M}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(l(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&En(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 Rn(i,f){return new Dt(i,f)}var Tn=Q.extend({options:{position:"topright"},initialize:function(i){q(this,i)},getPosition:function(){return this.options.position},setPosition:function(i){var f=this._map;return f&&f.removeControl(this),this.options.position=i,f&&f.addControl(this),this},getContainer:function(){return this._container},addTo:function(i){this.remove(),this._map=i;var f=this._container=this.onAdd(i),y=this.getPosition(),M=i._controlCorners[y];return Zt(f,"leaflet-control"),y.indexOf("bottom")!==-1?M.insertBefore(f,M.firstChild):M.appendChild(f),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(le(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(i){this._map&&i&&i.screenX>0&&i.screenY>0&&this._map.getContainer().focus()}}),Ie=function(i){return new Tn(i)};Dt.include({addControl:function(i){return i.addTo(this),this},removeControl:function(i){return i.remove(),this},_initControlPos:function(){var i=this._controlCorners={},f="leaflet-",y=this._controlContainer=Le("div",f+"control-container",this._container);function M(O,W){var at=f+O+" "+f+W;i[O+W]=Le("div",at,y)}M("top","left"),M("top","right"),M("bottom","left"),M("bottom","right")},_clearControlPos:function(){for(var i in this._controlCorners)le(this._controlCorners[i]);le(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Ar=Tn.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(i,f,y,M){return y1,this._baseLayersList.style.display=i?"":"none"),this._separator.style.display=f&&i?"":"none",this},_onLayerChange:function(i){this._handlingClick||this._update();var f=this._getLayer(g(i.target)),y=f.overlay?i.type==="add"?"overlayadd":"overlayremove":i.type==="add"?"baselayerchange":null;y&&this._map.fire(y,f)},_createRadioElement:function(i,f){var y='",M=document.createElement("div");return M.innerHTML=y,M.firstChild},_addItem:function(i){var f=document.createElement("label"),y=this._map.hasLayer(i.layer),M;i.overlay?(M=document.createElement("input"),M.type="checkbox",M.className="leaflet-control-layers-selector",M.defaultChecked=y):M=this._createRadioElement("leaflet-base-layers_"+g(this),y),this._layerControlInputs.push(M),M.layerId=g(i.layer),ie(M,"click",this._onInputClick,this);var O=document.createElement("span");O.innerHTML=" "+i.name;var W=document.createElement("span");f.appendChild(W),W.appendChild(M),W.appendChild(O);var at=i.overlay?this._overlaysList:this._baseLayersList;return at.appendChild(f),this._checkDisabledLayers(),f},_onInputClick:function(){var i=this._layerControlInputs,f,y,M=[],O=[];this._handlingClick=!0;for(var W=i.length-1;W>=0;W--)f=i[W],y=this._getLayer(f.layerId).layer,f.checked?M.push(y):f.checked||O.push(y);for(W=0;W=0;O--)f=i[O],y=this._getLayer(f.layerId).layer,f.disabled=y.options.minZoom!==void 0&&My.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var i=this._section;ie(i,"click",it),this.expand(),setTimeout(function(){Pe(i,"click",it)})}}),Si=function(i,f,y){return new Ar(i,f,y)},jn=Tn.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(i){var f="leaflet-control-zoom",y=Le("div",f+" leaflet-bar"),M=this.options;return this._zoomInButton=this._createButton(M.zoomInText,M.zoomInTitle,f+"-in",y,this._zoomIn),this._zoomOutButton=this._createButton(M.zoomOutText,M.zoomOutTitle,f+"-out",y,this._zoomOut),this._updateDisabled(),i.on("zoomend zoomlevelschange",this._updateDisabled,this),y},onRemove:function(i){i.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(i){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(i.shiftKey?3:1))},_createButton:function(i,f,y,M,O){var W=Le("a",y,M);return W.innerHTML=i,W.href="#",W.title=f,W.setAttribute("role","button"),W.setAttribute("aria-label",f),nt(W),ie(W,"click",rt),ie(W,"click",O,this),ie(W,"click",this._refocusOnMap,this),W},_updateDisabled:function(){var i=this._map,f="leaflet-disabled";En(this._zoomInButton,f),En(this._zoomOutButton,f),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||i._zoom===i.getMinZoom())&&(Zt(this._zoomOutButton,f),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||i._zoom===i.getMaxZoom())&&(Zt(this._zoomInButton,f),this._zoomInButton.setAttribute("aria-disabled","true"))}});Dt.mergeOptions({zoomControl:!0}),Dt.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new jn,this.addControl(this.zoomControl))});var no=function(i){return new jn(i)},lr=Tn.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(i){var f="leaflet-control-scale",y=Le("div",f),M=this.options;return this._addScales(M,f+"-line",y),i.on(M.updateWhenIdle?"moveend":"move",this._update,this),i.whenReady(this._update,this),y},onRemove:function(i){i.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(i,f,y){i.metric&&(this._mScale=Le("div",f,y)),i.imperial&&(this._iScale=Le("div",f,y))},_update:function(){var i=this._map,f=i.getSize().y/2,y=i.distance(i.containerPointToLatLng([0,f]),i.containerPointToLatLng([this.options.maxWidth,f]));this._updateScales(y)},_updateScales:function(i){this.options.metric&&i&&this._updateMetric(i),this.options.imperial&&i&&this._updateImperial(i)},_updateMetric:function(i){var f=this._getRoundNum(i),y=f<1e3?f+" m":f/1e3+" km";this._updateScale(this._mScale,y,f/i)},_updateImperial:function(i){var f=i*3.2808399,y,M,O;f>5280?(y=f/5280,M=this._getRoundNum(y),this._updateScale(this._iScale,M+" mi",M/y)):(O=this._getRoundNum(f),this._updateScale(this._iScale,O+" ft",O/f))},_updateScale:function(i,f,y){i.style.width=Math.round(this.options.maxWidth*y)+"px",i.innerHTML=f},_getRoundNum:function(i){var f=Math.pow(10,(Math.floor(i)+"").length-1),y=i/f;return y=y>=10?10:y>=5?5:y>=3?3:y>=2?2:1,f*y}}),ki=function(i){return new lr(i)},Gi='',Eo=Tn.extend({options:{position:"bottomright",prefix:''+(Ut.inlineSvg?Gi+" ":"")+"Leaflet"},initialize:function(i){q(this,i),this._attributions={}},onAdd:function(i){i.attributionControl=this,this._container=Le("div","leaflet-control-attribution"),nt(this._container);for(var f in i._layers)i._layers[f].getAttribution&&this.addAttribution(i._layers[f].getAttribution());return this._update(),i.on("layeradd",this._addAttribution,this),this._container},onRemove:function(i){i.off("layeradd",this._addAttribution,this)},_addAttribution:function(i){i.layer.getAttribution&&(this.addAttribution(i.layer.getAttribution()),i.layer.once("remove",function(){this.removeAttribution(i.layer.getAttribution())},this))},setPrefix:function(i){return this.options.prefix=i,this._update(),this},addAttribution:function(i){return i?(this._attributions[i]||(this._attributions[i]=0),this._attributions[i]++,this._update(),this):this},removeAttribution:function(i){return i?(this._attributions[i]&&(this._attributions[i]--,this._update()),this):this},_update:function(){if(this._map){var i=[];for(var f in this._attributions)this._attributions[f]&&i.push(f);var y=[];this.options.prefix&&y.push(this.options.prefix),i.length&&y.push(i.join(", ")),this._container.innerHTML=y.join(' ')}}});Dt.mergeOptions({attributionControl:!0}),Dt.addInitHook(function(){this.options.attributionControl&&new Eo().addTo(this)});var Zn=function(i){return new Eo(i)};Tn.Layers=Ar,Tn.Zoom=jn,Tn.Scale=lr,Tn.Attribution=Eo,Ie.layers=Si,Ie.zoom=no,Ie.scale=ki,Ie.attribution=Zn;var Yt=Q.extend({initialize:function(i){this._map=i},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}});Yt.addTo=function(i,f){return i.addHandler(f,this),this};var aa={Events:ct},Qo=Ut.touch?"touchstart mousedown":"mousedown",hr=bt.extend({options:{clickTolerance:3},initialize:function(i,f,y,M){q(this,M),this._element=i,this._dragStartTarget=f||i,this._preventOutline=y},enable:function(){this._enabled||(ie(this._dragStartTarget,Qo,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(hr._dragging===this&&this.finishDrag(!0),Pe(this._dragStartTarget,Qo,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(i){if(this._enabled&&(this._moved=!1,!fo(this._element,"leaflet-zoom-anim"))){if(i.touches&&i.touches.length!==1){hr._dragging===this&&this.finishDrag();return}if(!(hr._dragging||i.shiftKey||i.which!==1&&i.button!==1&&!i.touches)&&(hr._dragging=this,this._preventOutline&&Ae(this._element),fn(),ai(),!this._moving)){this.fire("down");var f=i.touches?i.touches[0]:i,y=Nn(this._element);this._startPoint=new Mt(f.clientX,f.clientY),this._startPos=gr(this._element),this._parentScale=ui(y);var M=i.type==="mousedown";ie(document,M?"mousemove":"touchmove",this._onMove,this),ie(document,M?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(i){if(this._enabled){if(i.touches&&i.touches.length>1){this._moved=!0;return}var f=i.touches&&i.touches.length===1?i.touches[0]:i,y=new Mt(f.clientX,f.clientY)._subtract(this._startPoint);!y.x&&!y.y||Math.abs(y.x)+Math.abs(y.y)W&&(at=mt,W=xt);W>y&&(f[at]=1,ua(i,f,y,M,at),ua(i,f,y,at,O))}function Be(i,f){for(var y=[i[0]],M=1,O=0,W=i.length;Mf&&(y.push(i[M]),O=M);return Of.max.x&&(y|=2),i.yf.max.y&&(y|=8),y}function Bu(i,f){var y=f.x-i.x,M=f.y-i.y;return y*y+M*M}function _e(i,f,y,M){var O=f.x,W=f.y,at=y.x-O,mt=y.y-W,xt=at*at+mt*mt,Nt;return xt>0&&(Nt=((i.x-O)*at+(i.y-W)*mt)/xt,Nt>1?(O=y.x,W=y.y):Nt>0&&(O+=at*Nt,W+=mt*Nt)),at=i.x-O,mt=i.y-W,M?at*at+mt*mt:new Mt(O,W)}function Jr(i){return!B(i[0])||typeof i[0][0]!="object"&&typeof i[0][0]<"u"}function Bn(i){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Jr(i)}function Is(i,f){var y,M,O,W,at,mt,xt,Nt;if(!i||i.length===0)throw new Error("latlngs not passed");Jr(i)||(console.warn("latlngs are not flat! Only the first ring will be used"),i=i[0]);var ee=[];for(var ae in i)ee.push(f.project(Tt(i[ae])));var Se=ee.length;for(y=0,M=0;yM){xt=(W-M)/O,Nt=[mt.x-xt*(mt.x-at.x),mt.y-xt*(mt.y-at.y)];break}return f.unproject(ft(Nt))}var li={__proto__:null,simplify:Wi,pointToSegmentDistance:Ao,closestPointOnSegment:Xs,clipSegment:Yn,_getEdgeIntersection:ts,_getBitCode:Lr,_sqClosestPointOnSegment:_e,isFlat:Jr,_flat:Bn,polylineCenter:Is};function es(i,f,y){var M,O=[1,4,2,8],W,at,mt,xt,Nt,ee,ae,Se;for(W=0,ee=i.length;W1e-7;mt++)Nt=O*Math.sin(at),Nt=Math.pow((1-Nt)/(1+Nt),O/2),xt=Math.PI/2-2*Math.atan(W*Nt)-at,at+=xt;return new Qt(at*f,i.x*f/y)}},Os={__proto__:null,LonLat:Oe,Mercator:_i,SphericalMercator:fe},go=s({},Re,{code:"EPSG:3395",projection:_i,transformation:function(){var i=.5/(Math.PI*_i.R);return Bt(i,.5,-i,.5)}()}),yi=s({},Re,{code:"EPSG:4326",projection:Oe,transformation:Bt(1/180,1,-1/180,.5)}),Hr=s({},ce,{projection:Oe,transformation:Bt(1,0,-1,0),scale:function(i){return Math.pow(2,i)},zoom:function(i){return Math.log(i)/Math.LN2},distance:function(i,f){var y=f.lng-i.lng,M=f.lat-i.lat;return Math.sqrt(y*y+M*M)},infinite:!0});ce.Earth=Re,ce.EPSG3395=go,ce.EPSG3857=hn,ce.EPSG900913=Sn,ce.EPSG4326=yi,ce.Simple=Hr;var mo=bt.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(i){return i.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(i){return i&&i.removeLayer(this),this},getPane:function(i){return this._map.getPane(i?this.options[i]||i:this.options.pane)},addInteractiveTarget:function(i){return this._map._targets[g(i)]=this,this},removeInteractiveTarget:function(i){return delete this._map._targets[g(i)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(i){var f=i.target;if(f.hasLayer(this)){if(this._map=f,this._zoomAnimated=f._zoomAnimated,this.getEvents){var y=this.getEvents();f.on(y,this),this.once("remove",function(){f.off(y,this)},this)}this.onAdd(f),this.fire("add"),f.fire("layeradd",{layer:this})}}});Dt.include({addLayer:function(i){if(!i._layerAdd)throw new Error("The provided object is not a Layer.");var f=g(i);return this._layers[f]?this:(this._layers[f]=i,i._mapToAdd=this,i.beforeAdd&&i.beforeAdd(this),this.whenReady(i._layerAdd,i),this)},removeLayer:function(i){var f=g(i);return this._layers[f]?(this._loaded&&i.onRemove(this),delete this._layers[f],this._loaded&&(this.fire("layerremove",{layer:i}),i.fire("remove")),i._map=i._mapToAdd=null,this):this},hasLayer:function(i){return g(i)in this._layers},eachLayer:function(i,f){for(var y in this._layers)i.call(f,this._layers[y]);return this},_addLayers:function(i){i=i?B(i)?i:[i]:[];for(var f=0,y=i.length;fthis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()=2&&f[0]instanceof Qt&&f[0].equals(f[y-1])&&f.pop(),f},_setLatLngs:function(i){Mo.prototype._setLatLngs.call(this,i),Jr(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Jr(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var i=this._renderer._bounds,f=this.options.weight,y=new Mt(f,f);if(i=new Ct(i.min.subtract(y),i.max.add(y)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(i))){if(this.options.noClip){this._parts=this._rings;return}for(var M=0,O=this._rings.length,W;Mi.y!=O.y>i.y&&i.x<(O.x-M.x)*(i.y-M.y)/(O.y-M.y)+M.x&&(f=!f);return f||Mo.prototype._containsPoint.call(this,i,!0)}});function Zs(i,f){return new ys(i,f)}var qi=br.extend({initialize:function(i,f){q(this,f),this._layers={},i&&this.addData(i)},addData:function(i){var f=B(i)?i:i.features,y,M,O;if(f){for(y=0,M=f.length;y0?M:[f.src];return}B(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(f.style,"objectFit")&&(f.style.objectFit="fill"),f.autoplay=!!this.options.autoplay,f.loop=!!this.options.loop,f.muted=!!this.options.muted,f.playsInline=!!this.options.playsInline;for(var W=0;WO?(f.height=O+"px",Zt(i,W)):En(i,W),this._containerWidth=this._container.offsetWidth},_animateZoom:function(i){var f=this._map._latLngToNewLayerPoint(this._latlng,i.zoom,i.center),y=this._getAnchor();De(this._container,f.add(y))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var i=this._map,f=parseInt(Fi(this._container,"marginBottom"),10)||0,y=this._container.offsetHeight+f,M=this._containerWidth,O=new Mt(this._containerLeft,-y-this._containerBottom);O._add(gr(this._container));var W=i.layerPointToContainerPoint(O),at=ft(this.options.autoPanPadding),mt=ft(this.options.autoPanPaddingTopLeft||at),xt=ft(this.options.autoPanPaddingBottomRight||at),Nt=i.getSize(),ee=0,ae=0;W.x+M+xt.x>Nt.x&&(ee=W.x+M-Nt.x+xt.x),W.x-ee-mt.x<0&&(ee=W.x-mt.x),W.y+y+xt.y>Nt.y&&(ae=W.y+y-Nt.y+xt.y),W.y-ae-mt.y<0&&(ae=W.y-mt.y),(ee||ae)&&(this.options.keepInView&&(this._autopanning=!0),i.fire("autopanstart").panBy([ee,ae]))}},_getAnchor:function(){return ft(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Fr=function(i,f){return new So(i,f)};Dt.mergeOptions({closePopupOnClick:!0}),Dt.include({openPopup:function(i,f,y){return this._initOverlay(So,i,f,y).openOn(this),this},closePopup:function(i){return i=arguments.length?i:this._popup,i&&i.close(),this}}),mo.include({bindPopup:function(i,f){return this._popup=this._initOverlay(So,this._popup,i,f),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(i){return this._popup&&(this instanceof br||(this._popup._source=this),this._popup._prepareOpen(i||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(i){return this._popup&&this._popup.setContent(i),this},getPopup:function(){return this._popup},_openPopup:function(i){if(!(!this._popup||!this._map)){rt(i);var f=i.layer||i.target;if(this._popup._source===f&&!(f instanceof Fo)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(i.latlng);return}this._popup._source=f,this.openPopup(i.latlng)}},_movePopup:function(i){this._popup.setLatLng(i.latlng)},_onKeyPress:function(i){i.originalEvent.keyCode===13&&this._openPopup(i)}});var _r=Qr.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(i){Qr.prototype.onAdd.call(this,i),this.setOpacity(this.options.opacity),i.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(i){Qr.prototype.onRemove.call(this,i),i.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var i=Qr.prototype.getEvents.call(this);return this.options.permanent||(i.preclick=this.close),i},_initLayout:function(){var i="leaflet-tooltip",f=i+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=Le("div",f),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+g(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(i){var f,y,M=this._map,O=this._container,W=M.latLngToContainerPoint(M.getCenter()),at=M.layerPointToContainerPoint(i),mt=this.options.direction,xt=O.offsetWidth,Nt=O.offsetHeight,ee=ft(this.options.offset),ae=this._getAnchor();mt==="top"?(f=xt/2,y=Nt):mt==="bottom"?(f=xt/2,y=0):mt==="center"?(f=xt/2,y=Nt/2):mt==="right"?(f=0,y=Nt/2):mt==="left"?(f=xt,y=Nt/2):at.xthis.options.maxZoom||yM?this._retainParent(O,W,at,M):!1)},_retainChildren:function(i,f,y,M){for(var O=2*i;O<2*i+2;O++)for(var W=2*f;W<2*f+2;W++){var at=new Mt(O,W);at.z=y+1;var mt=this._tileCoordsToKey(at),xt=this._tiles[mt];if(xt&&xt.active){xt.retain=!0;continue}else xt&&xt.loaded&&(xt.retain=!0);y+1this.options.maxZoom||this.options.minZoom!==void 0&&O1){this._setView(i,y);return}for(var ae=O.min.y;ae<=O.max.y;ae++)for(var Se=O.min.x;Se<=O.max.x;Se++){var ci=new Mt(Se,ae);if(ci.z=this._tileZoom,!!this._isValidTile(ci)){var Uo=this._tiles[this._tileCoordsToKey(ci)];Uo?Uo.current=!0:at.push(ci)}}if(at.sort(function(Ni,Ls){return Ni.distanceTo(W)-Ls.distanceTo(W)}),at.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var jo=document.createDocumentFragment();for(Se=0;Sey.max.x)||!f.wrapLat&&(i.yy.max.y))return!1}if(!this.options.bounds)return!0;var M=this._tileCoordsToBounds(i);return Ot(this.options.bounds).overlaps(M)},_keyToBounds:function(i){return this._tileCoordsToBounds(this._keyToTileCoords(i))},_tileCoordsToNwSe:function(i){var f=this._map,y=this.getTileSize(),M=i.scaleBy(y),O=M.add(y),W=f.unproject(M,i.z),at=f.unproject(O,i.z);return[W,at]},_tileCoordsToBounds:function(i){var f=this._tileCoordsToNwSe(i),y=new Rt(f[0],f[1]);return this.options.noWrap||(y=this._map.wrapLatLngBounds(y)),y},_tileCoordsToKey:function(i){return i.x+":"+i.y+":"+i.z},_keyToTileCoords:function(i){var f=i.split(":"),y=new Mt(+f[0],+f[1]);return y.z=+f[2],y},_removeTile:function(i){var f=this._tiles[i];f&&(le(f.el),delete this._tiles[i],this.fire("tileunload",{tile:f.el,coords:this._keyToTileCoords(i)}))},_initTile:function(i){Zt(i,"leaflet-tile");var f=this.getTileSize();i.style.width=f.x+"px",i.style.height=f.y+"px",i.onselectstart=x,i.onmousemove=x,Ut.ielt9&&this.options.opacity<1&&Kt(i,this.options.opacity)},_addTile:function(i,f){var y=this._getTilePos(i),M=this._tileCoordsToKey(i),O=this.createTile(this._wrapCoords(i),l(this._tileReady,this,i));this._initTile(O),this.createTile.length<2&<(l(this._tileReady,this,i,null,O)),De(O,y),this._tiles[M]={el:O,coords:i,current:!0},f.appendChild(O),this.fire("tileloadstart",{tile:O,coords:i})},_tileReady:function(i,f,y){f&&this.fire("tileerror",{error:f,tile:y,coords:i});var M=this._tileCoordsToKey(i);y=this._tiles[M],y&&(y.loaded=+new Date,this._map._fadeAnimated?(Kt(y.el,0),gt(this._fadeFrame),this._fadeFrame=lt(this._updateOpacity,this)):(y.active=!0,this._pruneTiles()),f||(Zt(y.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:y.el,coords:i})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),Ut.ielt9||!this._map._fadeAnimated?lt(this._pruneTiles,this):setTimeout(l(this._pruneTiles,this),250)))},_getTilePos:function(i){return i.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(i){var f=new Mt(this._wrapX?v(i.x,this._wrapX):i.x,this._wrapY?v(i.y,this._wrapY):i.y);return f.z=i.z,f},_pxBoundsToTileRange:function(i){var f=this.getTileSize();return new Ct(i.min.unscaleBy(f).floor(),i.max.unscaleBy(f).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var i in this._tiles)if(!this._tiles[i].loaded)return!1;return!0}});function qo(i){return new yo(i)}var Mr=yo.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(i,f){this._url=i,f=q(this,f),f.detectRetina&&Ut.retina&&f.maxZoom>0?(f.tileSize=Math.floor(f.tileSize/2),f.zoomReverse?(f.zoomOffset--,f.minZoom=Math.min(f.maxZoom,f.minZoom+1)):(f.zoomOffset++,f.maxZoom=Math.max(f.minZoom,f.maxZoom-1)),f.minZoom=Math.max(0,f.minZoom)):f.zoomReverse?f.minZoom=Math.min(f.maxZoom,f.minZoom):f.maxZoom=Math.max(f.minZoom,f.maxZoom),typeof f.subdomains=="string"&&(f.subdomains=f.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(i,f){return this._url===i&&f===void 0&&(f=!0),this._url=i,f||this.redraw(),this},createTile:function(i,f){var y=document.createElement("img");return ie(y,"load",l(this._tileOnLoad,this,f,y)),ie(y,"error",l(this._tileOnError,this,f,y)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(y.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(y.referrerPolicy=this.options.referrerPolicy),y.alt="",y.src=this.getTileUrl(i),y},getTileUrl:function(i){var f={r:Ut.retina?"@2x":"",s:this._getSubdomain(i),x:i.x,y:i.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var y=this._globalTileRange.max.y-i.y;this.options.tms&&(f.y=y),f["-y"]=y}return R(this._url,s(f,this.options))},_tileOnLoad:function(i,f){Ut.ielt9?setTimeout(l(i,this,null,f),0):i(null,f)},_tileOnError:function(i,f,y){var M=this.options.errorTileUrl;M&&f.getAttribute("src")!==M&&(f.src=M),i(y,f)},_onTileRemove:function(i){i.tile.onload=null},_getZoomForUrl:function(){var i=this._tileZoom,f=this.options.maxZoom,y=this.options.zoomReverse,M=this.options.zoomOffset;return y&&(i=f-i),i+M},_getSubdomain:function(i){var f=Math.abs(i.x+i.y)%this.options.subdomains.length;return this.options.subdomains[f]},_abortLoading:function(){var i,f;for(i in this._tiles)if(this._tiles[i].coords.z!==this._tileZoom&&(f=this._tiles[i].el,f.onload=x,f.onerror=x,!f.complete)){f.src=A;var y=this._tiles[i].coords;le(f),delete this._tiles[i],this.fire("tileabort",{tile:f,coords:y})}},_removeTile:function(i){var f=this._tiles[i];if(f)return f.el.setAttribute("src",A),yo.prototype._removeTile.call(this,i)},_tileReady:function(i,f,y){if(!(!this._map||y&&y.getAttribute("src")===A))return yo.prototype._tileReady.call(this,i,f,y)}});function ha(i,f){return new Mr(i,f)}var Pr=Mr.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(i,f){this._url=i;var y=s({},this.defaultWmsParams);for(var M in f)M in this.options||(y[M]=f[M]);f=q(this,f);var O=f.detectRetina&&Ut.retina?2:1,W=this.getTileSize();y.width=W.x*O,y.height=W.y*O,this.wmsParams=y},onAdd:function(i){this._crs=this.options.crs||i.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var f=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[f]=this._crs.code,Mr.prototype.onAdd.call(this,i)},getTileUrl:function(i){var f=this._tileCoordsToNwSe(i),y=this._crs,M=st(y.project(f[0]),y.project(f[1])),O=M.min,W=M.max,at=(this._wmsVersion>=1.3&&this._crs===yi?[O.y,O.x,W.y,W.x]:[O.x,O.y,W.x,W.y]).join(","),mt=Mr.prototype.getTileUrl.call(this,i);return mt+z(this.wmsParams,mt,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+at},setParams:function(i,f){return s(this.wmsParams,i),f||this.redraw(),this}});function Wa(i,f){return new Pr(i,f)}Mr.WMS=Pr,ha.wms=Wa;var zr=mo.extend({options:{padding:.1},initialize:function(i){q(this,i),g(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),this._zoomAnimated&&Zt(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 i={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(i.zoomanim=this._onAnimZoom),i},_onAnimZoom:function(i){this._updateTransform(i.center,i.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(i,f){var y=this._map.getZoomScale(f,this._zoom),M=this._map.getSize().multiplyBy(.5+this.options.padding),O=this._map.project(this._center,f),W=M.multiplyBy(-y).add(O).subtract(this._map._getNewPixelOrigin(i,f));Ut.any3d?si(this._container,W,y):De(this._container,W)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var i in this._layers)this._layers[i]._reset()},_onZoomEnd:function(){for(var i in this._layers)this._layers[i]._project()},_updatePaths:function(){for(var i in this._layers)this._layers[i]._update()},_update:function(){var i=this.options.padding,f=this._map.getSize(),y=this._map.containerPointToLayerPoint(f.multiplyBy(-i)).round();this._bounds=new Ct(y,y.add(f.multiplyBy(1+i*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),yr=zr.extend({options:{tolerance:0},getEvents:function(){var i=zr.prototype.getEvents.call(this);return i.viewprereset=this._onViewPreReset,i},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){zr.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var i=this._container=document.createElement("canvas");ie(i,"mousemove",this._onMouseMove,this),ie(i,"click dblclick mousedown mouseup contextmenu",this._onClick,this),ie(i,"mouseout",this._handleMouseOut,this),i._leaflet_disable_events=!0,this._ctx=i.getContext("2d")},_destroyContainer:function(){gt(this._redrawRequest),delete this._ctx,le(this._container),Pe(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var i;this._redrawBounds=null;for(var f in this._layers)i=this._layers[f],i._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){zr.prototype._update.call(this);var i=this._bounds,f=this._container,y=i.getSize(),M=Ut.retina?2:1;De(f,i.min),f.width=M*y.x,f.height=M*y.y,f.style.width=y.x+"px",f.style.height=y.y+"px",Ut.retina&&this._ctx.scale(2,2),this._ctx.translate(-i.min.x,-i.min.y),this.fire("update")}},_reset:function(){zr.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(i){this._updateDashArray(i),this._layers[g(i)]=i;var f=i._order={layer:i,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=f),this._drawLast=f,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(i){this._requestRedraw(i)},_removePath:function(i){var f=i._order,y=f.next,M=f.prev;y?y.prev=M:this._drawLast=M,M?M.next=y:this._drawFirst=y,delete i._order,delete this._layers[g(i)],this._requestRedraw(i)},_updatePath:function(i){this._extendRedrawBounds(i),i._project(),i._update(),this._requestRedraw(i)},_updateStyle:function(i){this._updateDashArray(i),this._requestRedraw(i)},_updateDashArray:function(i){if(typeof i.options.dashArray=="string"){var f=i.options.dashArray.split(/[, ]+/),y=[],M,O;for(O=0;O')}}catch{}return function(i){return document.createElement("<"+i+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),xs={_initContainer:function(){this._container=Le("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(zr.prototype._update.call(this),this.fire("update"))},_initPath:function(i){var f=i._container=ao("shape");Zt(f,"leaflet-vml-shape "+(this.options.className||"")),f.coordsize="1 1",i._path=ao("path"),f.appendChild(i._path),this._updateStyle(i),this._layers[g(i)]=i},_addPath:function(i){var f=i._container;this._container.appendChild(f),i.options.interactive&&i.addInteractiveTarget(f)},_removePath:function(i){var f=i._container;le(f),i.removeInteractiveTarget(f),delete this._layers[g(i)]},_updateStyle:function(i){var f=i._stroke,y=i._fill,M=i.options,O=i._container;O.stroked=!!M.stroke,O.filled=!!M.fill,M.stroke?(f||(f=i._stroke=ao("stroke")),O.appendChild(f),f.weight=M.weight+"px",f.color=M.color,f.opacity=M.opacity,M.dashArray?f.dashStyle=B(M.dashArray)?M.dashArray.join(" "):M.dashArray.replace(/( *, *)/g," "):f.dashStyle="",f.endcap=M.lineCap.replace("butt","flat"),f.joinstyle=M.lineJoin):f&&(O.removeChild(f),i._stroke=null),M.fill?(y||(y=i._fill=ao("fill")),O.appendChild(y),y.color=M.fillColor||M.color,y.opacity=M.fillOpacity):y&&(O.removeChild(y),i._fill=null)},_updateCircle:function(i){var f=i._point.round(),y=Math.round(i._radius),M=Math.round(i._radiusY||y);this._setPath(i,i._empty()?"M0 0":"AL "+f.x+","+f.y+" "+y+","+M+" 0,"+65535*360)},_setPath:function(i,f){i._path.v=f},_bringToFront:function(i){Un(i._container)},_bringToBack:function(i){Pi(i._container)}},Oi=Ut.vml?ao:Hn,vo=zr.extend({_initContainer:function(){this._container=Oi("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Oi("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){le(this._container),Pe(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){zr.prototype._update.call(this);var i=this._bounds,f=i.getSize(),y=this._container;(!this._svgSize||!this._svgSize.equals(f))&&(this._svgSize=f,y.setAttribute("width",f.x),y.setAttribute("height",f.y)),De(y,i.min),y.setAttribute("viewBox",[i.min.x,i.min.y,f.x,f.y].join(" ")),this.fire("update")}},_initPath:function(i){var f=i._path=Oi("path");i.options.className&&Zt(f,i.options.className),i.options.interactive&&Zt(f,"leaflet-interactive"),this._updateStyle(i),this._layers[g(i)]=i},_addPath:function(i){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(i._path),i.addInteractiveTarget(i._path)},_removePath:function(i){le(i._path),i.removeInteractiveTarget(i._path),delete this._layers[g(i)]},_updatePath:function(i){i._project(),i._update()},_updateStyle:function(i){var f=i._path,y=i.options;f&&(y.stroke?(f.setAttribute("stroke",y.color),f.setAttribute("stroke-opacity",y.opacity),f.setAttribute("stroke-width",y.weight),f.setAttribute("stroke-linecap",y.lineCap),f.setAttribute("stroke-linejoin",y.lineJoin),y.dashArray?f.setAttribute("stroke-dasharray",y.dashArray):f.removeAttribute("stroke-dasharray"),y.dashOffset?f.setAttribute("stroke-dashoffset",y.dashOffset):f.removeAttribute("stroke-dashoffset")):f.setAttribute("stroke","none"),y.fill?(f.setAttribute("fill",y.fillColor||y.color),f.setAttribute("fill-opacity",y.fillOpacity),f.setAttribute("fill-rule",y.fillRule||"evenodd")):f.setAttribute("fill","none"))},_updatePoly:function(i,f){this._setPath(i,Me(i._parts,f))},_updateCircle:function(i){var f=i._point,y=Math.max(Math.round(i._radius),1),M=Math.max(Math.round(i._radiusY),1)||y,O="a"+y+","+M+" 0 1,0 ",W=i._empty()?"M0 0":"M"+(f.x-y)+","+f.y+O+y*2+",0 "+O+-y*2+",0 ";this._setPath(i,W)},_setPath:function(i,f){i._path.setAttribute("d",f)},_bringToFront:function(i){Un(i._path)},_bringToBack:function(i){Pi(i._path)}});Ut.vml&&vo.include(xs);function ti(i){return Ut.svg||Ut.vml?new vo(i):null}Dt.include({getRenderer:function(i){var f=i.options.renderer||this._getPaneRenderer(i.options.pane)||this.options.renderer||this._renderer;return f||(f=this._renderer=this._createRenderer()),this.hasLayer(f)||this.addLayer(f),f},_getPaneRenderer:function(i){if(i==="overlayPane"||i===void 0)return!1;var f=this._paneRenderers[i];return f===void 0&&(f=this._createRenderer({pane:i}),this._paneRenderers[i]=f),f},_createRenderer:function(i){return this.options.preferCanvas&&Hi(i)||ti(i)}});var uo=ys.extend({initialize:function(i,f){ys.prototype.initialize.call(this,this._boundsToLatLngs(i),f)},setBounds:function(i){return this.setLatLngs(this._boundsToLatLngs(i))},_boundsToLatLngs:function(i){return i=Ot(i),[i.getSouthWest(),i.getNorthWest(),i.getNorthEast(),i.getSouthEast()]}});function er(i,f){return new uo(i,f)}vo.create=Oi,vo.pointsToPath=Me,qi.geometryToLayer=Ys,qi.coordsToLatLng=zo,qi.coordsToLatLngs=Ui,qi.latLngToCoords=mr,qi.latLngsToCoords=Go,qi.getFeature=cr,qi.asFeature=ji,Dt.mergeOptions({boxZoom:!0});var Ka=Yt.extend({initialize:function(i){this._map=i,this._container=i._container,this._pane=i._panes.overlayPane,this._resetStateTimeout=0,i.on("unload",this._destroy,this)},addHooks:function(){ie(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Pe(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){le(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(i){if(!i.shiftKey||i.which!==1&&i.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),ai(),fn(),this._startPoint=this._map.mouseEventToContainerPoint(i),ie(document,{contextmenu:rt,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(i){this._moved||(this._moved=!0,this._box=Le("div","leaflet-zoom-box",this._container),Zt(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(i);var f=new Ct(this._point,this._startPoint),y=f.getSize();De(this._box,f.min),this._box.style.width=y.x+"px",this._box.style.height=y.y+"px"},_finish:function(){this._moved&&(le(this._box),En(this._container,"leaflet-crosshair")),Vi(),Qn(),Pe(document,{contextmenu:rt,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(i){if(!(i.which!==1&&i.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(l(this._resetState,this),0);var f=new Rt(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(f).fire("boxzoomend",{boxZoomBounds:f})}},_onKeyDown:function(i){i.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});Dt.addInitHook("addHandler","boxZoom",Ka),Dt.mergeOptions({doubleClickZoom:!0});var Ja=Yt.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(i){var f=this._map,y=f.getZoom(),M=f.options.zoomDelta,O=i.originalEvent.shiftKey?y-M:y+M;f.options.doubleClickZoom==="center"?f.setZoom(O):f.setZoomAround(i.containerPoint,O)}});Dt.addInitHook("addHandler","doubleClickZoom",Ja),Dt.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var Zr=Yt.extend({addHooks:function(){if(!this._draggable){var i=this._map;this._draggable=new hr(i._mapPane,i._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),i.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),i.on("zoomend",this._onZoomEnd,this),i.whenReady(this._onZoomEnd,this))}Zt(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){En(this._map._container,"leaflet-grab"),En(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 i=this._map;if(i._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var f=Ot(this._map.options.maxBounds);this._offsetLimit=st(this._map.latLngToContainerPoint(f.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(f.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;i.fire("movestart").fire("dragstart"),i.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(i){if(this._map.options.inertia){var f=this._lastTime=+new Date,y=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(y),this._times.push(f),this._prunePositions(f)}this._map.fire("move",i).fire("drag",i)},_prunePositions:function(i){for(;this._positions.length>1&&i-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var i=this._map.getSize().divideBy(2),f=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=f.subtract(i).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(i,f){return i-(i-f)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var i=this._draggable._newPos.subtract(this._draggable._startPos),f=this._offsetLimit;i.xf.max.x&&(i.x=this._viscousLimit(i.x,f.max.x)),i.y>f.max.y&&(i.y=this._viscousLimit(i.y,f.max.y)),this._draggable._newPos=this._draggable._startPos.add(i)}},_onPreDragWrap:function(){var i=this._worldWidth,f=Math.round(i/2),y=this._initialWorldOffset,M=this._draggable._newPos.x,O=(M-f+y)%i+f-y,W=(M+f+y)%i-f-y,at=Math.abs(O+y)0?W:-W))-f;this._delta=0,this._startTime=null,at&&(i.options.scrollWheelZoom==="center"?i.setZoom(f+at):i.setZoomAround(this._lastMousePos,f+at))}});Dt.addInitHook("addHandler","scrollWheelZoom",ca);var ws=600;Dt.mergeOptions({tapHold:Ut.touchNative&&Ut.safari&&Ut.mobile,tapTolerance:15});var To=Yt.extend({addHooks:function(){ie(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Pe(this._map._container,"touchstart",this._onDown,this)},_onDown:function(i){if(clearTimeout(this._holdTimeout),i.touches.length===1){var f=i.touches[0];this._startPos=this._newPos=new Mt(f.clientX,f.clientY),this._holdTimeout=setTimeout(l(function(){this._cancel(),this._isTapValid()&&(ie(document,"touchend",it),ie(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",f))},this),ws),ie(document,"touchend touchcancel contextmenu",this._cancel,this),ie(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function i(){Pe(document,"touchend",it),Pe(document,"touchend touchcancel",i)},_cancel:function(){clearTimeout(this._holdTimeout),Pe(document,"touchend touchcancel contextmenu",this._cancel,this),Pe(document,"touchmove",this._onMove,this)},_onMove:function(i){var f=i.touches[0];this._newPos=new Mt(f.clientX,f.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(i,f){var y=new MouseEvent(i,{bubbles:!0,cancelable:!0,view:window,screenX:f.screenX,screenY:f.screenY,clientX:f.clientX,clientY:f.clientY});y._simulated=!0,f.target.dispatchEvent(y)}});Dt.addInitHook("addHandler","tapHold",To),Dt.mergeOptions({touchZoom:Ut.touch,bounceAtZoomLimits:!0});var vr=Yt.extend({addHooks:function(){Zt(this._map._container,"leaflet-touch-zoom"),ie(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){En(this._map._container,"leaflet-touch-zoom"),Pe(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(i){var f=this._map;if(!(!i.touches||i.touches.length!==2||f._animatingZoom||this._zooming)){var y=f.mouseEventToContainerPoint(i.touches[0]),M=f.mouseEventToContainerPoint(i.touches[1]);this._centerPoint=f.getSize()._divideBy(2),this._startLatLng=f.containerPointToLatLng(this._centerPoint),f.options.touchZoom!=="center"&&(this._pinchStartLatLng=f.containerPointToLatLng(y.add(M)._divideBy(2))),this._startDist=y.distanceTo(M),this._startZoom=f.getZoom(),this._moved=!1,this._zooming=!0,f._stop(),ie(document,"touchmove",this._onTouchMove,this),ie(document,"touchend touchcancel",this._onTouchEnd,this),it(i)}},_onTouchMove:function(i){if(!(!i.touches||i.touches.length!==2||!this._zooming)){var f=this._map,y=f.mouseEventToContainerPoint(i.touches[0]),M=f.mouseEventToContainerPoint(i.touches[1]),O=y.distanceTo(M)/this._startDist;if(this._zoom=f.getScaleZoom(O,this._startZoom),!f.options.bounceAtZoomLimits&&(this._zoomf.getMaxZoom()&&O>1)&&(this._zoom=f._limitZoom(this._zoom)),f.options.touchZoom==="center"){if(this._center=this._startLatLng,O===1)return}else{var W=y._add(M)._divideBy(2)._subtract(this._centerPoint);if(O===1&&W.x===0&&W.y===0)return;this._center=f.unproject(f.project(this._pinchStartLatLng,this._zoom).subtract(W),this._zoom)}this._moved||(f._moveStart(!0,!1),this._moved=!0),gt(this._animRequest);var at=l(f._move,f,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=lt(at,this,!0),it(i)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,gt(this._animRequest),Pe(document,"touchmove",this._onTouchMove,this),Pe(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))}});Dt.addInitHook("addHandler","touchZoom",vr),Dt.BoxZoom=Ka,Dt.DoubleClickZoom=Ja,Dt.Drag=Zr,Dt.Keyboard=ko,Dt.ScrollWheelZoom=ca,Dt.TapHold=To,Dt.TouchZoom=vr,r.Bounds=Ct,r.Browser=Ut,r.CRS=ce,r.Canvas=yr,r.Circle=_o,r.CircleMarker=_s,r.Class=Q,r.Control=Tn,r.DivIcon=Ii,r.DivOverlay=Qr,r.DomEvent=Gt,r.DomUtil=$o,r.Draggable=hr,r.Evented=bt,r.FeatureGroup=br,r.GeoJSON=qi,r.GridLayer=yo,r.Handler=Yt,r.Icon=Dr,r.ImageOverlay=oo,r.LatLng=Qt,r.LatLngBounds=Rt,r.Layer=mo,r.LayerGroup=ms,r.LineUtil=li,r.Map=Dt,r.Marker=Ki,r.Mixin=aa,r.Path=Fo,r.Point=Mt,r.PolyUtil=ns,r.Polygon=ys,r.Polyline=Mo,r.Popup=So,r.PosAnimation=te,r.Projection=Os,r.Rectangle=uo,r.Renderer=zr,r.SVG=vo,r.SVGOverlay=Xr,r.TileLayer=Mr,r.Tooltip=_r,r.Transformation=ke,r.Util=Et,r.VideoOverlay=Er,r.bind=l,r.bounds=st,r.canvas=Hi,r.circle=io,r.circleMarker=$r,r.control=Ie,r.divIcon=Va,r.extend=s,r.featureGroup=rs,r.geoJSON=la,r.geoJson=vs,r.gridLayer=qo,r.icon=ro,r.imageOverlay=Co,r.latLng=Tt,r.latLngBounds=Ot,r.layerGroup=Do,r.map=Rn,r.marker=Br,r.point=ft,r.polygon=Zs,r.polyline=hi,r.popup=Fr,r.rectangle=er,r.setOptions=q,r.stamp=g,r.svg=ti,r.svgOverlay=Fu,r.tileLayer=ha,r.tooltip=so,r.transformation=Bt,r.version=n,r.videoOverlay=Ji;var ei=window.L;r.noConflict=function(){return window.L=ei,this},window.L=r})});var Mf=se((Ef,ih)=>{(function(r,n){typeof define=="function"&&define.amd?define(["leaflet"],r):typeof Ef=="object"&&(typeof n<"u"&&n.L?ih.exports=r(L):ih.exports=r(Oo())),typeof n<"u"&&n.L&&(n.L.Control.Locate=r(L))})(function(r){let n=(m,v,x)=>{x=x.split(" "),x.forEach(function(P){r.DomUtil[m].call(this,v,P)})},s=(m,v)=>n("addClass",m,v),a=(m,v)=>n("removeClass",m,v),l=r.Marker.extend({initialize(m,v){r.Util.setOptions(this,v),this._latlng=m,this.createIcon()},createIcon(){let m=this.options,v="";m.color!==void 0&&(v+=`stroke:${m.color};`),m.weight!==void 0&&(v+=`stroke-width:${m.weight};`),m.fillColor!==void 0&&(v+=`fill:${m.fillColor};`),m.fillOpacity!==void 0&&(v+=`fill-opacity:${m.fillOpacity};`),m.opacity!==void 0&&(v+=`opacity:${m.opacity};`);let x=this._getIconSVG(m,v);this._locationIcon=r.divIcon({className:x.className,html:x.svg,iconSize:[x.w,x.h]}),this.setIcon(this._locationIcon)},_getIconSVG(m,v){let x=m.radius,P=m.weight,T=x+P,N=T*2;return{className:"leaflet-control-locate-location",svg:`',w:N,h:N}},setStyle(m){r.Util.setOptions(this,m),this.createIcon()}}),c=l.extend({initialize(m,v,x){r.Util.setOptions(this,x),this._latlng=m,this._heading=v,this.createIcon()},setHeading(m){this._heading=m},_getIconSVG(m,v){let x=m.radius,P=m.width+m.weight,T=(x+m.depth+m.weight)*2,N=`M0,0 l${m.width/2},${m.depth} l-${P},0 z`,q=`transform: rotate(${this._heading}deg)`;return{className:"leaflet-control-locate-heading",svg:`',w:P,h:T}}}),g=r.Control.extend({options:{position:"topleft",layer:void 0,setView:"untilPanOrZoom",keepCurrentZoomLevel:!1,initialZoomLevel:!1,getLocationBounds(m){return m.bounds},flyTo:!1,clickBehavior:{inView:"stop",outOfView:"setView",inViewNotFollowing:"inView"},returnToPrevBounds:!1,cacheLocation:!0,drawCircle:!0,drawMarker:!0,showCompass:!0,markerClass:l,compassClass:c,circleStyle:{className:"leaflet-control-locate-circle",color:"#136AEC",fillColor:"#136AEC",fillOpacity:.15,weight:0},markerStyle:{className:"leaflet-control-locate-marker",color:"#fff",fillColor:"#2A93EE",fillOpacity:1,weight:3,opacity:1,radius:9},compassStyle:{fillColor:"#2A93EE",fillOpacity:1,weight:0,color:"#fff",opacity:1,radius:9,width:9,depth:6},followCircleStyle:{},followMarkerStyle:{},followCompassStyle:{},icon:"leaflet-control-locate-location-arrow",iconLoading:"leaflet-control-locate-spinner",iconElementTag:"span",textElementTag:"small",circlePadding:[0,0],metric:!0,createButtonCallback(m,v){let x=r.DomUtil.create("a","leaflet-bar-part leaflet-bar-part-single",m);x.title=v.strings.title,x.href="#",x.setAttribute("role","button");let P=r.DomUtil.create(v.iconElementTag,v.icon,x);if(v.strings.text!==void 0){let T=r.DomUtil.create(v.textElementTag,"leaflet-locate-text",x);T.textContent=v.strings.text,x.classList.add("leaflet-locate-text-active"),x.parentNode.style.display="flex",v.icon.length>0&&P.classList.add("leaflet-locate-icon")}return{link:x,icon:P}},onLocationError(m,v){alert(m.message)},onLocationOutsideMapBounds(m){m.stop(),alert(m.options.strings.outsideMapBoundsMsg)},showPopup:!0,strings:{title:"Show me where I am",metersUnit:"meters",feetUnit:"feet",popup:"You are within {distance} {unit} from this point",outsideMapBoundsMsg:"You seem located outside the boundaries of the map"},locateOptions:{maxZoom:1/0,watch:!0,setView:!1}},initialize(m){for(let v in m)typeof this.options[v]=="object"?r.extend(this.options[v],m[v]):this.options[v]=m[v];this.options.followMarkerStyle=r.extend({},this.options.markerStyle,this.options.followMarkerStyle),this.options.followCircleStyle=r.extend({},this.options.circleStyle,this.options.followCircleStyle),this.options.followCompassStyle=r.extend({},this.options.compassStyle,this.options.followCompassStyle)},onAdd(m){let v=r.DomUtil.create("div","leaflet-control-locate leaflet-bar leaflet-control");this._container=v,this._map=m,this._layer=this.options.layer||new r.LayerGroup,this._layer.addTo(m),this._event=void 0,this._compassHeading=null,this._prevBounds=null;let x=this.options.createButtonCallback(v,this.options);return this._link=x.link,this._icon=x.icon,r.DomEvent.on(this._link,"click",function(P){r.DomEvent.stopPropagation(P),r.DomEvent.preventDefault(P),this._onClick()},this).on(this._link,"dblclick",r.DomEvent.stopPropagation),this._resetVariables(),this._map.on("unload",this._unload,this),v},_onClick(){this._justClicked=!0;let m=this._isFollowing();if(this._userPanned=!1,this._userZoomed=!1,this._active&&!this._event)this.stop();else if(this._active){let v=this.options.clickBehavior,x=v.outOfView;switch(this._map.getBounds().contains(this._event.latlng)&&(x=m?v.inView:v.inViewNotFollowing),v[x]&&(x=v[x]),x){case"setView":this.setView();break;case"stop":this.stop(),this.options.returnToPrevBounds&&(this.options.flyTo?this._map.flyToBounds:this._map.fitBounds).bind(this._map)(this._prevBounds);break}}else this.options.returnToPrevBounds&&(this._prevBounds=this._map.getBounds()),this.start();this._updateContainerStyle()},start(){this._activate(),this._event&&(this._drawMarker(this._map),this.options.setView&&this.setView()),this._updateContainerStyle()},stop(){this._deactivate(),this._cleanClasses(),this._resetVariables(),this._removeMarker()},stopFollowing(){this._userPanned=!0,this._updateContainerStyle(),this._drawMarker()},_activate(){if(!this._active&&(this._map.locate(this.options.locateOptions),this._map.fire("locateactivate",this),this._active=!0,this._map.on("locationfound",this._onLocationFound,this),this._map.on("locationerror",this._onLocationError,this),this._map.on("dragstart",this._onDrag,this),this._map.on("zoomstart",this._onZoom,this),this._map.on("zoomend",this._onZoomEnd,this),this.options.showCompass)){let m="ondeviceorientationabsolute"in window;if(m||"ondeviceorientation"in window){let v=this,x=function(){r.DomEvent.on(window,m?"deviceorientationabsolute":"deviceorientation",v._onDeviceOrientation,v)};DeviceOrientationEvent&&typeof DeviceOrientationEvent.requestPermission=="function"?DeviceOrientationEvent.requestPermission().then(function(P){P==="granted"&&x()}):x()}}},_deactivate(){this._map.stopLocate(),this._map.fire("locatedeactivate",this),this._active=!1,this.options.cacheLocation||(this._event=void 0),this._map.off("locationfound",this._onLocationFound,this),this._map.off("locationerror",this._onLocationError,this),this._map.off("dragstart",this._onDrag,this),this._map.off("zoomstart",this._onZoom,this),this._map.off("zoomend",this._onZoomEnd,this),this.options.showCompass&&(this._compassHeading=null,"ondeviceorientationabsolute"in window?r.DomEvent.off(window,"deviceorientationabsolute",this._onDeviceOrientation,this):"ondeviceorientation"in window&&r.DomEvent.off(window,"deviceorientation",this._onDeviceOrientation,this))},setView(){if(this._drawMarker(),this._isOutsideMapBounds())this._event=void 0,this.options.onLocationOutsideMapBounds(this);else if(this._justClicked&&this.options.initialZoomLevel!==!1){var m=this.options.flyTo?this._map.flyTo:this._map.setView;m.bind(this._map)([this._event.latitude,this._event.longitude],this.options.initialZoomLevel)}else if(this.options.keepCurrentZoomLevel){var m=this.options.flyTo?this._map.flyTo:this._map.panTo;m.bind(this._map)([this._event.latitude,this._event.longitude])}else{var m=this.options.flyTo?this._map.flyToBounds:this._map.fitBounds;this._ignoreEvent=!0,m.bind(this._map)(this.options.getLocationBounds(this._event),{padding:this.options.circlePadding,maxZoom:this.options.initialZoomLevel||this.options.locateOptions.maxZoom}),r.Util.requestAnimFrame(function(){this._ignoreEvent=!1},this)}},_drawCompass(){if(!this._event)return;let m=this._event.latlng;if(this.options.showCompass&&m&&this._compassHeading!==null){let v=this._isFollowing()?this.options.followCompassStyle:this.options.compassStyle;this._compass?(this._compass.setLatLng(m),this._compass.setHeading(this._compassHeading),this._compass.setStyle&&this._compass.setStyle(v)):this._compass=new this.options.compassClass(m,this._compassHeading,v).addTo(this._layer)}this._compass&&(!this.options.showCompass||this._compassHeading===null)&&(this._compass.removeFrom(this._layer),this._compass=null)},_drawMarker(){this._event.accuracy===void 0&&(this._event.accuracy=0);let m=this._event.accuracy,v=this._event.latlng;if(this.options.drawCircle){let q=this._isFollowing()?this.options.followCircleStyle:this.options.circleStyle;this._circle?this._circle.setLatLng(v).setRadius(m).setStyle(q):this._circle=r.circle(v,m,q).addTo(this._layer)}let x,P;if(this.options.metric?(x=m.toFixed(0),P=this.options.strings.metersUnit):(x=(m*3.2808399).toFixed(0),P=this.options.strings.feetUnit),this.options.drawMarker){let q=this._isFollowing()?this.options.followMarkerStyle:this.options.markerStyle;this._marker?(this._marker.setLatLng(v),this._marker.setStyle&&this._marker.setStyle(q)):this._marker=new this.options.markerClass(v,q).addTo(this._layer)}this._drawCompass();let T=this.options.strings.popup;function N(){return typeof T=="string"?r.Util.template(T,{distance:x,unit:P}):typeof T=="function"?T({distance:x,unit:P}):T}this.options.showPopup&&T&&this._marker&&this._marker.bindPopup(N())._popup.setLatLng(v),this.options.showPopup&&T&&this._compass&&this._compass.bindPopup(N())._popup.setLatLng(v)},_removeMarker(){this._layer.clearLayers(),this._marker=void 0,this._circle=void 0},_unload(){this.stop(),this._map.off("unload",this._unload,this)},_setCompassHeading(m){!isNaN(parseFloat(m))&&isFinite(m)?(m=Math.round(m),this._compassHeading=m,r.Util.requestAnimFrame(this._drawCompass,this)):this._compassHeading=null},_onCompassNeedsCalibration(){this._setCompassHeading()},_onDeviceOrientation(m){this._active&&(m.webkitCompassHeading?this._setCompassHeading(m.webkitCompassHeading):m.absolute&&m.alpha&&this._setCompassHeading(360-m.alpha))},_onLocationError(m){m.code==3&&this.options.locateOptions.watch||(this.stop(),this.options.onLocationError(m,this))},_onLocationFound(m){if(!(this._event&&this._event.latlng.lat===m.latlng.lat&&this._event.latlng.lng===m.latlng.lng&&this._event.accuracy===m.accuracy)&&this._active){switch(this._event=m,this._drawMarker(),this._updateContainerStyle(),this.options.setView){case"once":this._justClicked&&this.setView();break;case"untilPan":this._userPanned||this.setView();break;case"untilPanOrZoom":!this._userPanned&&!this._userZoomed&&this.setView();break;case"always":this.setView();break;case!1:break}this._justClicked=!1}},_onDrag(){this._event&&!this._ignoreEvent&&(this._userPanned=!0,this._updateContainerStyle(),this._drawMarker())},_onZoom(){this._event&&!this._ignoreEvent&&(this._userZoomed=!0,this._updateContainerStyle(),this._drawMarker())},_onZoomEnd(){this._event&&this._drawCompass(),this._event&&!this._ignoreEvent&&this._marker&&!this._map.getBounds().pad(-.3).contains(this._marker.getLatLng())&&(this._userPanned=!0,this._updateContainerStyle(),this._drawMarker())},_isFollowing(){if(!this._active)return!1;if(this.options.setView==="always")return!0;if(this.options.setView==="untilPan")return!this._userPanned;if(this.options.setView==="untilPanOrZoom")return!this._userPanned&&!this._userZoomed},_isOutsideMapBounds(){return this._event===void 0?!1:this._map.options.maxBounds&&!this._map.options.maxBounds.contains(this._event.latlng)},_updateContainerStyle(){this._container&&(this._active&&!this._event?this._setClasses("requesting"):this._isFollowing()?this._setClasses("following"):this._active?this._setClasses("active"):this._cleanClasses())},_setClasses(m){m=="requesting"?(a(this._container,"active following"),s(this._container,"requesting"),a(this._icon,this.options.icon),s(this._icon,this.options.iconLoading)):m=="active"?(a(this._container,"requesting following"),s(this._container,"active"),a(this._icon,this.options.iconLoading),s(this._icon,this.options.icon)):m=="following"&&(a(this._container,"requesting"),s(this._container,"active following"),a(this._icon,this.options.iconLoading),s(this._icon,this.options.icon))},_cleanClasses(){r.DomUtil.removeClass(this._container,"requesting"),r.DomUtil.removeClass(this._container,"active"),r.DomUtil.removeClass(this._container,"following"),a(this._icon,this.options.iconLoading),s(this._icon,this.options.icon)},_resetVariables(){this._active=!1,this._justClicked=!1,this._userPanned=!1,this._userZoomed=!1}});return r.control.locate=m=>new r.Control.Locate(m),g},window)});var Pf=se((tw,oh)=>{(function(r){if(typeof define=="function"&&define.amd)define(["leaflet"],r);else if(typeof oh<"u")oh.exports=r(Oo());else{if(typeof window.L>"u")throw new Error("Leaflet must be loaded first");r(window.L)}})(function(r){var n="polyline-measure-control",s="polyline-measure-unicode-icon";return r.Control.PolylineMeasure=r.Control.extend({options:{position:"topleft",unit:"metres",clearMeasurementsOnStop:!0,showBearings:!1,bearingTextIn:"In",bearingTextOut:"Out",tooltipTextFinish:"Click to finish line
",tooltipTextDelete:"Press SHIFT-key and click to delete point",tooltipTextMove:"Click and drag to move point
",tooltipTextResume:"
Press CTRL-key and click to resume line",tooltipTextAdd:"Press CTRL-key and click to add point",measureControlTitleOn:"Turn on PolylineMeasure",measureControlTitleOff:"Turn off PolylineMeasure",measureControlLabel:"↦",measureControlClasses:[],showClearControl:!1,clearControlTitle:"Clear Measurements",clearControlLabel:"×",clearControlClasses:[],showUnitControl:!1,distanceShowSameUnit:!1,unitControlTitle:{text:"Change Units",metres:"metres",landmiles:"land miles",nauticalmiles:"nautical miles"},unitControlLabel:{metres:"m",kilometres:"km",feet:"ft",landmiles:"mi",nauticalmiles:"nm"},tempLine:{color:"#00f",weight:2},fixedLine:{color:"#006",weight:2},startCircle:{color:"#000",weight:1,fillColor:"#0f0",fillOpacity:1,radius:3},intermedCircle:{color:"#000",weight:1,fillColor:"#ff0",fillOpacity:1,radius:3},currentCircle:{color:"#000",weight:1,fillColor:"#f0f",fillOpacity:1,radius:6},endCircle:{color:"#000",weight:1,fillColor:"#f00",fillOpacity:1,radius:3}},_arcpoints:100,_circleNr:-1,_lineNr:-1,_createControl:function(a,l,c,g,m,v){var x=document.createElement("a");return x.innerHTML=a,x.setAttribute("title",l),c.forEach(function(P){x.classList.add(P)}),r.DomEvent.on(x,"click",m,v),g.appendChild(x),x},onAdd:function(a){var l=this;a.on("movestart ",function(){l._mapdragging=!0}),this._container=document.createElement("div"),this._container.classList.add("leaflet-bar"),r.DomEvent.disableClickPropagation(this._container);var c=this.options.measureControlTitleOn,g=this.options.measureControlLabel,m=this.options.measureControlClasses;if(g.indexOf("&")!=-1&&m.push(s),this._arrPolylines=[],this._measureControl=this._createControl(g,c,m,this._container,this._toggleMeasure,this),this._defaultControlBgColor=this._measureControl.style.backgroundColor,this._measureControl.setAttribute("id",n),this.options.showClearControl){var c=this.options.clearControlTitle,g=this.options.clearControlLabel,m=this.options.clearControlClasses;g.indexOf("&")!=-1&&m.push(s),this._clearMeasureControl=this._createControl(g,c,m,this._container,this._clearAllMeasurements,this),this._clearMeasureControl.classList.add("polyline-measure-clearControl")}if(this.options.showUnitControl){if(this.options.unit=="metres")var g=this.options.unitControlLabel.metres,c=this.options.unitControlTitle.text+" ["+this.options.unitControlTitle.metres+"]";else if(this.options.unit=="landmiles")var g=this.options.unitControlLabel.landmiles,c=this.options.unitControlTitle.text+" ["+this.options.unitControlTitle.landmiles+"]";else var g=this.options.unitControlLabel.nauticalmiles,c=this.options.unitControlTitle.text+" ["+this.options.unitControlTitle.nauticalmiles+"]";var m=[];this._unitControl=this._createControl(g,c,m,this._container,this._changeUnit,this),this._unitControl.setAttribute("id","unitControlId")}return this._container},onRemove:function(){this._measuring&&this._toggleMeasure()},_saveNonpolylineEvents:function(){this._nonpolylineTargets=this._map._targets,typeof this._polylineTargets<"u"?this._map._targets=this._polylineTargets:this._map._targets={}},_savePolylineEvents:function(){this._polylineTargets=this._map._targets,this._map._targets=this._nonpolylineTargets},_toggleMeasure:function(){this._measuring=!this._measuring,this._measuring?(this._mapdragging=!1,this._saveNonpolylineEvents(),this._measureControl.classList.add("polyline-measure-controlOnBgColor"),this._measureControl.style.backgroundColor=this.options.backgroundColor,this._measureControl.title=this.options.measureControlTitleOff,this._oldCursor=this._map._container.style.cursor,this._map._container.style.cursor="crosshair",this._doubleClickZoom=this._map.doubleClickZoom.enabled(),this._map.doubleClickZoom.disable(),this._layerPaint||(this._layerPaint=r.layerGroup().addTo(this._map)),this._map.on("mousemove",this._mouseMove,this),this._map.on("click",this._mouseClick,this),r.DomEvent.on(document,"keydown",this._onKeyDown,this),this._resetPathVariables()):(this._savePolylineEvents(),this._measureControl.classList.remove("polyline-measure-controlOnBgColor"),this._measureControl.style.backgroundColor=this._defaultControlBgColor,this._measureControl.title=this.options.measureControlTitleOn,this._map._container.style.cursor=this._oldCursor,this._map.off("mousemove",this._mouseMove,this),this._map.off("click",this._mouseClick,this),this._map.off("mousemove",this._resumeFirstpointMousemove,this),this._map.off("click",this._resumeFirstpointClick,this),this._map.off("mousemove",this._dragCircleMousemove,this),this._map.off("mouseup",this._dragCircleMouseup,this),r.DomEvent.off(document,"keydown",this._onKeyDown,this),this._doubleClickZoom&&this._map.doubleClickZoom.enable(),this.options.clearMeasurementsOnStop&&this._layerPaint&&this._clearAllMeasurements(),this._cntCircle!==0&&this._finishPolylinePath()),this._map.fire("polylinemeasure:toggle",{sttus:this._measuring})},_clearAllMeasurements:function(){this._cntCircle!==void 0&&this._cntCircle!==0&&this._finishPolylinePath(),this._layerPaint&&this._layerPaint.clearLayers(),this._arrPolylines=[],this._map.fire("polylinemeasure:clear")},_changeUnit:function(){this.options.unit=="metres"?(this.options.unit="landmiles",document.getElementById("unitControlId").innerHTML=this.options.unitControlLabel.landmiles,this._unitControl.title=this.options.unitControlTitle.text+" ["+this.options.unitControlTitle.landmiles+"]"):this.options.unit=="landmiles"?(this.options.unit="nauticalmiles",document.getElementById("unitControlId").innerHTML=this.options.unitControlLabel.nauticalmiles,this._unitControl.title=this.options.unitControlTitle.text+" ["+this.options.unitControlTitle.nauticalmiles+"]"):(this.options.unit="metres",document.getElementById("unitControlId").innerHTML=this.options.unitControlLabel.metres,this._unitControl.title=this.options.unitControlTitle.text+" ["+this.options.unitControlTitle.metres+"]"),this._currentLine&&this._computeDistance(this._currentLine),this._arrPolylines.map(this._computeDistance.bind(this))},_computeDistance:function(a){var l=0;a.circleCoords.map(function(c,g){if(g>=1){var m=a.circleCoords[g-1].distanceTo(a.circleCoords[g]);l+=m,this._updateTooltip(a.tooltips[g],a.tooltips[g-1],l,m,a.circleCoords[g-1],a.circleCoords[g])}}.bind(this))},_onKeyDown:function(a){if(a.keyCode===27){if(this._resumeFirstpointFlag===!0){this._resumeFirstpointFlag=!1;var l=this._lineNr;this._map.off("mousemove",this._resumeFirstpointMousemove,this),this._map.off("click",this._resumeFirstpointClick,this),this._layerPaint.removeLayer(this._rubberlinePath2),this._layerPaint.removeLayer(this._tooltipNew),this._arrPolylines[l].circleMarkers[0].setStyle(this.options.startCircle);var c="",g=0;this.options.showBearings===!0&&(c=this.options.bearingTextIn+":---\xB0
"+this.options.bearingTextOut+":---\xB0"),c=c+'
+0
',c=c+'
0
',this._arrPolylines[l].tooltips[0]._icon.innerHTML=c,this._arrPolylines[l].tooltips.map(function(m,v){if(v>=1){var x=this._arrPolylines[l].circleCoords[v-1].distanceTo(this._arrPolylines[l].circleCoords[v]),P=this._arrPolylines[l].circleCoords[v-1],T=this._arrPolylines[l].circleCoords[v];g+=x;var N=this._arrPolylines[l].tooltips[v-1];this._updateTooltip(m,N,g,x,P,T)}}.bind(this)),this._map.on("mousemove",this._mouseMove,this);return}this._currentLine?this._finishPolylinePath(a):this._toggleMeasure()}},_getDistance:function(a){var l=a,c;return this.options.unit==="nauticalmiles"?(c=this.options.unitControlLabel.nauticalmiles,l>=185200?l=(l/1852).toFixed(0):l>=18520?l=(l/1852).toFixed(1):l>=1852?l=(l/1852).toFixed(2):this.options.distanceShowSameUnit?l=(l/1852).toFixed(3):(l=(l/.3048).toFixed(0),c=this.options.unitControlLabel.feet)):this.options.unit==="landmiles"?(c=this.options.unitControlLabel.landmiles,l>=160934.4?l=(l/1609.344).toFixed(0):l>=16093.44?l=(l/1609.344).toFixed(1):l>=1609.344?l=(l/1609.344).toFixed(2):this.options.distanceShowSameUnit?l=(l/1609.344).toFixed(3):(l=(l/.3048).toFixed(0),c=this.options.unitControlLabel.feet)):(c=this.options.unitControlLabel.kilometres,l>=1e5?l=(l/1e3).toFixed(0):l>=1e4?l=(l/1e3).toFixed(1):l>=1e3?l=(l/1e3).toFixed(2):this.options.distanceShowSameUnit?l=(l/1e3).toFixed(3):(l=l.toFixed(0),c=this.options.unitControlLabel.metres)),{value:l,unit:c}},_polylineArc:function(a,l){function c(q){var z=Math.sin((1-q)*T)/Math.sin(T),j=Math.sin(q*T)/Math.sin(T),R=z*Math.cos(m)*Math.cos(v)+j*Math.cos(x)*Math.cos(P),B=z*Math.cos(m)*Math.sin(v)+j*Math.cos(x)*Math.sin(P),D=z*Math.sin(m)+j*Math.sin(x),A=180/Math.PI*Math.atan2(D,Math.sqrt(Math.pow(R,2)+Math.pow(B,2))),G=180/Math.PI*Math.atan2(B,R),H=G-v*180/Math.PI;function K(et){return Math[et>0?"floor":"ceil"](et)}return H<0?G=G-K((H-180)/360)*360:G=G-K((H+180)/360)*360,[A,G]}function g(q){for(var z=[],j=1/(q-1),R=0;R0&&(this.options.showBearings===!0&&(z=this.options.bearingTextIn+": "+P+"\xB0
"+this.options.bearingTextOut+":---\xB0"),z+='
+'+q.value+" "+q.unit+"
"),z+='
'+N.value+" "+N.unit+"
",a._icon.innerHTML=z,this.options.showBearings===!0&&l){var j=l._icon.innerHTML,R=new RegExp(this.options.bearingTextOut+".*\xB0"),B=j.replace(R,this.options.bearingTextOut+": "+T+"\xB0");l._icon.innerHTML=B}},_drawArrow:function(a){var l=Math.round(a.length/2),c=a[l-1],g=a[l],m=g[1]-c[1],v=g[0]-c[0],x=[c[0]+v/2,c[1]+m/2],P=-Math.atan2(v,m)*57.29578,T=r.divIcon({className:"",iconSize:[16,16],iconAnchor:[8,8],html:"
"}),N=r.marker(x,{icon:T,zIndexOffset:-50}).addTo(this._layerPaint);return this._currentLine||N.bindTooltip(this.options.tooltipTextAdd,{direction:"top",opacity:.7,className:"polyline-measure-popupTooltip"}),N.on("click",this._clickedArrow,this),N},_mouseMove:function(a){var l=a.latlng;if(this._map.on("click",this._mouseClick,this),!(!l||!this._currentLine)){var c=this._currentLine.circleCoords.last();this._rubberlinePath.setLatLngs(this._polylineArc(c,l));var g=this._currentLine.tooltips.last(),m=this._currentLine.tooltips.slice(-2,-1)[0];g.setLatLng(l);var v=l.distanceTo(c);this._updateTooltip(g,m,this._currentLine.distance+v,v,c,l)}},_startLine:function(a){var l=r.divIcon({className:"polyline-measure-tooltip",iconAnchor:[-4,-4]}),c=function(){return this.slice(-1)[0]};this._rubberlinePath=r.polyline([],{color:this.options.tempLine.color,weight:this.options.tempLine.weight,interactive:!1,dashArray:"8,8"}).addTo(this._layerPaint).bringToBack();var g=this;this._currentLine={id:0,circleCoords:[],circleMarkers:[],arrowMarkers:[],tooltips:[],distance:0,polylinePath:r.polyline([],{color:this.options.fixedLine.color,weight:this.options.fixedLine.weight,interactive:!1}).addTo(this._layerPaint).bringToBack(),handleMarkers:function(x){var P=this.circleMarkers.last();P&&(P.bindTooltip(g.options.tooltipTextDelete,{direction:"top",opacity:.7,className:"polyline-measure-popupTooltip"}),P.off("click",g._finishPolylinePath,g),this.circleMarkers.length===1?P.setStyle(g.options.startCircle):P.setStyle(g.options.intermedCircle));var T=new r.CircleMarker(x,g.options.currentCircle).addTo(g._layerPaint);T.bindTooltip(g.options.tooltipTextFinish+g.options.tooltipTextDelete,{direction:"top",opacity:.7,className:"polyline-measure-popupTooltip"}),T.cntLine=g._currentLine.id,T.cntCircle=g._cntCircle,g._cntCircle++,T.on("mousedown",g._dragCircle,g),T.on("click",g._finishPolylinePath,g),this.circleMarkers.push(T)},getNewToolTip:function(x){return r.marker(x,{icon:l,interactive:!1})},addPoint:function(x){var P=this.circleCoords.last();if(!(P&&P.equals(x))){if(this.circleCoords.push(x),this.circleCoords.length>1){var T=g._polylineArc(P,x);this.circleCoords.length>2&&T.shift(),this.polylinePath.setLatLngs(this.polylinePath.getLatLngs().concat(T));var N=g._drawArrow(T);N.cntLine=g._currentLine.id,N.cntArrow=g._cntCircle-1,g._currentLine.arrowMarkers.push(N);var q=P.distanceTo(x);this.distance+=q;var z=g._currentLine.tooltips.last(),j=g._currentLine.tooltips.slice(-1,-2)[0];g._updateTooltip(z,j,this.distance,q,P,x)}z&&z.setLatLng(x);var R=this.getNewToolTip(x);R.addTo(g._layerPaint),this.tooltips.push(R),this.handleMarkers(x)}},finalize:function(){if(g._layerPaint.removeLayer(this.tooltips.last()),this.tooltips.pop(),g._layerPaint.removeLayer(g._rubberlinePath),this.circleCoords.length>1){this.tooltips.last()._icon.classList.add("polyline-measure-tooltip-end");var x=this.circleMarkers.last();x.setStyle(g.options.endCircle),x.unbindTooltip(),g._currentLine.circleMarkers.map(function(P){P.bindTooltip(g.options.tooltipTextMove+g.options.tooltipTextDelete,{direction:"top",opacity:.7,className:"polyline-measure-popupTooltip"})}),g._currentLine.circleMarkers[0].bindTooltip(g.options.tooltipTextMove+g.options.tooltipTextDelete+g.options.tooltipTextResume,{direction:"top",opacity:.7,className:"polyline-measure-popupTooltip"}),x.bindTooltip(g.options.tooltipTextMove+g.options.tooltipTextDelete+g.options.tooltipTextResume,{direction:"top",opacity:.7,className:"polyline-measure-popupTooltip"}),g._currentLine.arrowMarkers.map(function(P){P.bindTooltip(g.options.tooltipTextAdd,{direction:"top",opacity:.7,className:"polyline-measure-popupTooltip"})}),x.off("click",g._finishPolylinePath,g),x.on("click",g._resumePolylinePath,g),g._arrPolylines.push(this)}else g._layerPaint.removeLayer(this.circleMarkers.last()),g._layerPaint.removeLayer(this.tooltips.last());g._resetPathVariables()}};var m=r.marker(a,{icon:l,interactive:!1});m.addTo(this._layerPaint);var v="";this.options.showBearings===!0&&(v=this.options.bearingTextIn+":---\xB0
"+this.options.bearingTextOut+":---\xB0"),v=v+'
+0
',v=v+'
0
',m._icon.innerHTML=v,this._currentLine.tooltips.push(m),this._currentLine.circleCoords.last=c,this._currentLine.tooltips.last=c,this._currentLine.circleMarkers.last=c,this._currentLine.id=this._arrPolylines.length},_mouseClick:function(a){!a.latlng||this._finishCircleScreencoords&&this._finishCircleScreencoords.equals(a.containerPoint)||(!this._currentLine&&!this._mapdragging&&(this._startLine(a.latlng),this._map.fire("polylinemeasure:start",this._currentLine)),this._mapdragging?this._mapdragging=!1:(this._currentLine.addPoint(a.latlng),this._map.fire("polylinemeasure:add",a),this._map.fire("polylinemeasure:change",this._currentLine)))},_finishPolylinePath:function(a){this._map.fire("polylinemeasure:finish",this._currentLine),this._currentLine.finalize(),a&&(this._finishCircleScreencoords=a.containerPoint)},_resumePolylinePath:function(a){if(a.originalEvent.ctrlKey===!0){this._currentLine=this._arrPolylines[a.target.cntLine],this._rubberlinePath=r.polyline([],{color:this.options.tempLine.color,weight:this.options.tempLine.weight,interactive:!1,dashArray:"8,8"}).addTo(this._layerPaint).bringToBack(),this._currentLine.tooltips.last()._icon.classList.remove("polyline-measure-tooltip-end");var l=this._currentLine.getNewToolTip(a.latlng);l.addTo(this._layerPaint),this._currentLine.tooltips.push(l),this._currentLine.circleMarkers.last().unbindTooltip(),this._currentLine.circleMarkers.last().bindTooltip(this.options.tooltipTextMove+this.options.tooltipTextDelete,{direction:"top",opacity:.7,className:"polyline-measure-popupTooltip"}),this._currentLine.circleMarkers.last().setStyle(this.options.currentCircle),this._cntCircle=this._currentLine.circleCoords.length,this._map.fire("polylinemeasure:resume",this._currentLine)}},_resetPathVariables:function(){this._cntCircle=0,this._currentLine=null},_clickedArrow:function(a){if(a.originalEvent.ctrlKey){var l=a.target.cntLine,c=a.target.cntArrow;this._arrPolylines[l].arrowMarkers[c].removeFrom(this._layerPaint);var g=new r.CircleMarker(a.latlng,this.options.intermedCircle).addTo(this._layerPaint);g.cntLine=l,g.on("mousedown",this._dragCircle,this),g.bindTooltip(this.options.tooltipTextMove+this.options.tooltipTextDelete,{direction:"top",opacity:.7,className:"polyline-measure-popupTooltip"}),this._arrPolylines[l].circleMarkers.splice(c+1,0,g),this._arrPolylines[l].circleMarkers.map(function(T,N){T.cntCircle=N}),this._arrPolylines[l].circleCoords.splice(c+1,0,a.latlng),lineCoords=this._arrPolylines[l].polylinePath.getLatLngs();var m=this._polylineArc(this._arrPolylines[l].circleCoords[c],a.latlng);m.pop();var v=this._polylineArc(a.latlng,this._arrPolylines[l].circleCoords[c+2]);Array.prototype.splice.apply(lineCoords,[c*(this._arcpoints-1),this._arcpoints].concat(m,v)),this._arrPolylines[l].polylinePath.setLatLngs(lineCoords);var x=this._drawArrow(m);this._arrPolylines[l].arrowMarkers[c]=x,x=this._drawArrow(v),this._arrPolylines[l].arrowMarkers.splice(c+1,0,x),this._arrPolylines[l].arrowMarkers.map(function(T,N){T.cntLine=l,T.cntArrow=N}),this._tooltipNew=r.marker(a.latlng,{icon:r.divIcon({className:"polyline-measure-tooltip",iconAnchor:[-4,-4]}),interactive:!1}),this._tooltipNew.addTo(this._layerPaint),this._arrPolylines[l].tooltips.splice(c+1,0,this._tooltipNew);var P=0;this._arrPolylines[l].tooltips.map(function(T,N){if(N>=1){var q=this._arrPolylines[l].circleCoords[N-1].distanceTo(this._arrPolylines[l].circleCoords[N]),z=this._arrPolylines[l].circleCoords[N-1],j=this._arrPolylines[l].circleCoords[N];P+=q;var R=this._arrPolylines[l].tooltips[N-1];this._updateTooltip(T,R,P,q,z,j)}}.bind(this)),this._map.fire("polylinemeasure:insert",a),this._map.fire("polylinemeasure:change",this._arrPolylines[this._lineNr])}},_dragCircleMouseup:function(){this._circleNr===0||this._circleNr===this._arrPolylines[this._lineNr].circleCoords.length-1?this._e1.target.bindTooltip(this.options.tooltipTextMove+this.options.tooltipTextDelete+this.options.tooltipTextResume,{direction:"top",opacity:.7,className:"polyline-measure-popupTooltip"}):this._e1.target.bindTooltip(this.options.tooltipTextMove+this.options.tooltipTextDelete,{direction:"top",opacity:.7,className:"polyline-measure-popupTooltip"}),this._resetPathVariables(),this._map.off("mousemove",this._dragCircleMousemove,this),this._map.dragging.enable(),this._map.on("mousemove",this._mouseMove,this),this._map.off("mouseup",this._dragCircleMouseup,this),this._map.fire("polylinemeasure:move",this._e1),this._map.fire("polylinemeasure:change",this._arrPolylines[this._lineNr])},_dragCircleMousemove:function(a){var l=a.latlng.lat,c=a.latlng.lng,g=l-this._mouseStartingLat,m=c-this._mouseStartingLng,v=r.latLng(this._circleStartingLat+g,this._circleStartingLng+m),x=this._arcpoints,P=this._e1.target.cntLine;this._lineNr=P;var T=this._e1.target.cntCircle;this._circleNr=T,this._e1.target.setLatLng(v),this._e1.target.unbindTooltip(),this._arrPolylines[P].circleCoords[T]=v;var N=this._arrPolylines[P].polylinePath.getLatLngs();if(T>=1){var q=this._polylineArc(this._arrPolylines[P].circleCoords[T-1],v);Array.prototype.splice.apply(N,[(T-1)*(x-1),x].concat(q));var z=this._drawArrow(q);z.cntLine=P,z.cntArrow=T-1,this._arrPolylines[P].arrowMarkers[T-1].removeFrom(this._layerPaint),this._arrPolylines[P].arrowMarkers[T-1]=z}if(T=0&&this._arrPolylines[P].tooltips[T].setLatLng(v);var R=0;this._arrPolylines[P].tooltips.map(function(B,D){if(D>=1){var A=this._arrPolylines[P].circleCoords[D-1].distanceTo(this._arrPolylines[P].circleCoords[D]),G=this._arrPolylines[P].circleCoords[D-1],H=this._arrPolylines[P].circleCoords[D];R+=A,this._arrPolylines[P].distance=R;var K=this._arrPolylines[P].tooltips[D-1];this._updateTooltip(B,K,R,A,G,H)}}.bind(this)),this._map.on("mouseup",this._dragCircleMouseup,this)},_resumeFirstpointMousemove:function(a){var l=this._lineNr;this._map.on("click",this._resumeFirstpointClick,this);var c=a.latlng;this._rubberlinePath2.setLatLngs(this._polylineArc(c,currentCircleCoords)),this._tooltipNew.setLatLng(c);var g=0,m=c.distanceTo(this._arrPolylines[l].circleCoords[0]),v=c,x=this._arrPolylines[l].circleCoords[0];g+=m;var P=this._tooltipNew,T=this._arrPolylines[l].tooltips[0];this._updateTooltip(T,P,g,m,v,x),this._arrPolylines[l].tooltips.map(function(N,q){if(q>=1){var z=this._arrPolylines[l].circleCoords[q-1].distanceTo(this._arrPolylines[l].circleCoords[q]),j=this._arrPolylines[l].circleCoords[q-1],R=this._arrPolylines[l].circleCoords[q];g+=z;var B=this._arrPolylines[l].tooltips[q-1];this._updateTooltip(N,B,g,z,j,R)}}.bind(this))},_resumeFirstpointClick:function(a){var l=this._lineNr;this._resumeFirstpointFlag=!1,this._map.off("mousemove",this._resumeFirstpointMousemove,this),this._map.off("click",this._resumeFirstpointClick,this),this._layerPaint.removeLayer(this._rubberlinePath2),this._arrPolylines[l].circleMarkers[0].setStyle(this.options.intermedCircle),this._arrPolylines[l].circleMarkers[0].unbindTooltip(),this._arrPolylines[l].circleMarkers[0].bindTooltip(this.options.tooltipTextMove+this.options.tooltipTextDelete,{direction:"top",opacity:.7,className:"polyline-measure-popupTooltip"});var c=new r.CircleMarker(a.latlng,this.options.startCircle).addTo(this._layerPaint);c.cntLine=l,c.cntCircle=0,c.on("mousedown",this._dragCircle,this),c.bindTooltip(this.options.tooltipTextMove+this.options.tooltipTextDelete+this.options.tooltipTextResume,{direction:"top",opacity:.7,className:"polyline-measure-popupTooltip"}),this._arrPolylines[l].circleMarkers.unshift(c),this._arrPolylines[l].circleMarkers.map(function(v,x){v.cntCircle=x}),this._arrPolylines[l].circleCoords.unshift(a.latlng);var g=this._polylineArc(a.latlng,currentCircleCoords),m=this._drawArrow(g);this._arrPolylines[l].arrowMarkers.unshift(m),this._arrPolylines[l].arrowMarkers.map(function(v,x){v.cntLine=l,v.cntArrow=x}),g.pop(),this._arrPolylines[l].polylinePath.setLatLngs(g.concat(this._arrPolylines[l].polylinePath.getLatLngs())),this._arrPolylines[l].tooltips.unshift(this._tooltipNew),this._map.on("mousemove",this._mouseMove,this)},_dragCircle:function(a){var l=this._arcpoints;if(a.originalEvent.ctrlKey){if(this._map.off("click",this._mouseClick,this),a.target.cntCircle===0){this._resumeFirstpointFlag=!0,this._lineNr=a.target.cntLine;var c=this._lineNr;this._circleNr=a.target.cntCircle,currentCircleCoords=a.latlng,this._arrPolylines[c].circleMarkers[0].setStyle(this.options.currentCircle),this._rubberlinePath2=r.polyline([],{color:this.options.tempLine.color,weight:this.options.tempLine.weight,interactive:!1,dashArray:"8,8"}).addTo(this._layerPaint).bringToBack(),this._tooltipNew=r.marker(currentCircleCoords,{icon:r.divIcon({className:"polyline-measure-tooltip",iconAnchor:[-4,-4]}),interactive:!1}),this._tooltipNew.addTo(this._layerPaint);var g="";this.options.showBearings===!0&&(g=g+this.options.bearingTextIn+":---\xB0
"+this.options.bearingTextOut+":---\xB0"),g=g+'
+0
',g=g+'
0
',this._tooltipNew._icon.innerHTML=g,this._map.off("mousemove",this._mouseMove,this),this._map.on("mousemove",this._resumeFirstpointMousemove,this)}return}if(a.originalEvent.shiftKey){this._lineNr=a.target.cntLine;var c=this._lineNr;this._circleNr=a.target.cntCircle;var m=this._circleNr;if(this._arrPolylines[c]){if(this._arrPolylines[c].circleMarkers.length===2){this._layerPaint.removeLayer(this._arrPolylines[c].circleMarkers[1]),this._layerPaint.removeLayer(this._arrPolylines[c].tooltips[1]),this._layerPaint.removeLayer(this._arrPolylines[c].circleMarkers[0]),this._layerPaint.removeLayer(this._arrPolylines[c].tooltips[0]),this._layerPaint.removeLayer(this._arrPolylines[c].arrowMarkers[0]),this._layerPaint.removeLayer(this._arrPolylines[c].polylinePath),this._map.fire("polylinemeasure:remove",a),this._map.fire("polylinemeasure:change",this._arrPolylines[this._lineNr]);return}this._arrPolylines[c].circleCoords.splice(m,1),this._arrPolylines[c].circleMarkers[m].removeFrom(this._layerPaint),this._arrPolylines[c].circleMarkers.splice(m,1),this._arrPolylines[c].circleMarkers.map(function(q,z){q.cntCircle=z});var v=this._arrPolylines[c].polylinePath.getLatLngs();if(this._arrPolylines[c].tooltips[m].removeFrom(this._layerPaint),this._arrPolylines[c].tooltips.splice(m,1),!this._arrPolylines[c].circleMarkers.length){this._arrPolylines.splice(c,1),this._arrPolylines.forEach(function(q,z){q.circleMarkers.map(function(j){j.cntLine=z}),q.arrowMarkers.map(function(j){j.cntLine=z})});return}if(m===0){this._arrPolylines[c].circleMarkers[0].setStyle(this.options.startCircle),v.splice(0,l-1),this._arrPolylines[c].circleMarkers[0].bindTooltip(this.options.tooltipTextMove+this.options.tooltipTextDelete+this.options.tooltipTextResume,{direction:"top",opacity:.7,className:"polyline-measure-popupTooltip"}),this._arrPolylines[c].arrowMarkers[m].removeFrom(this._layerPaint),this._arrPolylines[c].arrowMarkers.splice(0,1);var g="";this.options.showBearings===!0&&(g=this.options.bearingTextIn+":---\xB0
"+this.options.bearingTextOut+":---\xB0"),g=g+'
+0
',g=g+'
0
',this._arrPolylines[c].tooltips[0]._icon.innerHTML=g}else if(m===this._arrPolylines[c].circleCoords.length)this._arrPolylines[c].circleMarkers[m-1].on("click",this._resumePolylinePath,this),this._arrPolylines[c].circleMarkers[m-1].bindTooltip(this.options.tooltipTextMove+this.options.tooltipTextDelete+this.options.tooltipTextResume,{direction:"top",opacity:.7,className:"polyline-measure-popupTooltip"}),this._arrPolylines[c].circleMarkers.slice(-1)[0].setStyle(this.options.endCircle),this._arrPolylines[c].tooltips.slice(-1)[0]._icon.classList.add("polyline-measure-tooltip-end"),v.splice(-(l-1),l-1),this._arrPolylines[c].arrowMarkers[m-1].removeFrom(this._layerPaint),this._arrPolylines[c].arrowMarkers.splice(-1,1);else{newLineSegment=this._polylineArc(this._arrPolylines[c].circleCoords[m-1],this._arrPolylines[c].circleCoords[m]),Array.prototype.splice.apply(v,[(m-1)*(l-1),2*l-1].concat(newLineSegment)),this._arrPolylines[c].arrowMarkers[m-1].removeFrom(this._layerPaint),this._arrPolylines[c].arrowMarkers[m].removeFrom(this._layerPaint);var x=this._drawArrow(newLineSegment);this._arrPolylines[c].arrowMarkers.splice(m-1,2,x)}this._arrPolylines[c].polylinePath.setLatLngs(v),this._arrPolylines[c].arrowMarkers.map(function(q,z){q.cntLine=c,q.cntArrow=z});var P=0;this._arrPolylines[c].tooltips.map(function(q,z){if(z>=1){var j=this._arrPolylines[c].circleCoords[z-1].distanceTo(this._arrPolylines[c].circleCoords[z]),R=this._arrPolylines[c].circleCoords[z-1],B=this._arrPolylines[c].circleCoords[z];P+=j,this._arrPolylines[c].distance=P;var D=this._arrPolylines[c].tooltips[z-1];this._updateTooltip(q,D,P,j,R,B)}}.bind(this))}else{if(this._cntCircle--,this._currentLine.circleMarkers.length===1){this._currentLine.finalize();return}if(this._currentLine.circleCoords.splice(m,1),this._currentLine.circleMarkers[m].removeFrom(this._layerPaint),this._currentLine.circleMarkers.splice(m,1),this._currentLine.circleMarkers.map(function(q,z){q.cntCircle=z}),v=this._currentLine.polylinePath.getLatLngs(),this._currentLine.tooltips[m].removeFrom(this._layerPaint),this._currentLine.tooltips.splice(m,1),m===0){this._currentLine.circleMarkers.length===1?this._currentLine.circleMarkers[0].setStyle(this.options.currentCircle):this._currentLine.circleMarkers[0].setStyle(this.options.startCircle),v.splice(0,l-1),this._currentLine.circleMarkers[0].bindTooltip(this.options.tooltipTextMove+this.options.tooltipTextDelete+this.options.tooltipTextResume,{direction:"top",opacity:.7,className:"polyline-measure-popupTooltip"}),this._currentLine.arrowMarkers[m].removeFrom(this._layerPaint),this._currentLine.arrowMarkers.splice(0,1);var g="";this.options.showBearings===!0&&(g=this.options.bearingTextIn+":---\xB0
"+this.options.bearingTextOut+":---\xB0"),g=g+'
+0
',g=g+'
0
',this._currentLine.tooltips[0]._icon.innerHTML=g}else m===this._currentLine.circleCoords.length?(this._currentLine.circleMarkers[m-1].on("click",this._resumePolylinePath,this),this._currentLine.circleMarkers[m-1].bindTooltip(this.options.tooltipTextMove+this.options.tooltipTextDelete+this.options.tooltipTextResume,{direction:"top",opacity:.7,className:"polyline-measure-popupTooltip"}),this._currentLine.circleMarkers.slice(-1)[0].setStyle(this.options.currentCircle),this._currentLine.tooltips.slice(-1)[0]._icon.classList.add("polyline-measure-tooltip-end"),v.splice(-(l-1),l-1),this._currentLine.arrowMarkers[m-1].removeFrom(this._layerPaint),this._currentLine.arrowMarkers.splice(-1,1)):(newLineSegment=this._polylineArc(this._currentLine.circleCoords[m-1],this._currentLine.circleCoords[m]),Array.prototype.splice.apply(v,[(m-1)*(l-1),2*l-1].concat(newLineSegment)),this._currentLine.arrowMarkers[m-1].removeFrom(this._layerPaint),this._currentLine.arrowMarkers[m].removeFrom(this._layerPaint),x=this._drawArrow(newLineSegment),this._currentLine.arrowMarkers.splice(m-1,2,x));this._currentLine.polylinePath.setLatLngs(v),this._currentLine.arrowMarkers.map(function(q,z){q.cntLine=c,q.cntArrow=z});var T=0;this._currentLine.tooltips.map(function(q,z,j){if(z>=1){var R,B,D=this._currentLine.tooltips[z-1],A=this._currentLine.circleCoords[z-1];z===j.length-1?(R=this._currentLine.circleCoords[z-1].distanceTo(a.latlng),B=a.latlng,this._updateTooltip(q,D,T+R,R,A,B)):(R=this._currentLine.circleCoords[z-1].distanceTo(this._currentLine.circleCoords[z]),B=this._currentLine.circleCoords[z],T+=R,this._updateTooltip(q,D,T,R,A,B))}}.bind(this)),this._currentLine.distance=T}this._map.fire("polylinemeasure:remove",a),this._map.fire("polylinemeasure:change",this._arrPolylines[this._lineNr]);return}this._e1=a,this._measuring&&this._cntCircle===0&&(this._map.dragging.disable(),this._map.off("mousemove",this._mouseMove,this),this._map.off("click",this._mouseClick,this),this._mouseStartingLat=a.latlng.lat,this._mouseStartingLng=a.latlng.lng,this._circleStartingLat=a.target._latlng.lat,this._circleStartingLng=a.target._latlng.lng,this._map.on("mousemove",this._dragCircleMousemove,this))},seed:function(a){a.forEach(l=>{this._toggleMeasure(),this._startLine(l[0]),l.forEach((c,g)=>{let m=r.latLng(c);this._mouseMove({latLng:m}),this._currentLine.addPoint(m),g===l.length-1&&(this._finishPolylinePath(),this._toggleMeasure())})})}}),r.Map.mergeOptions({PolylineMeasureControl:!1}),r.Map.addInitHook(function(){this.options.polylineMeasureControl&&(this.PMControl=new r.Control.PolylineMeasure,this.addControl(this.PMControl))}),r.control.polylineMeasure=function(a){return new r.Control.PolylineMeasure(a)},r.Control.PolylineMeasure})});var Hu=se((Ew,Gf)=>{"use strict";var zf=Object.getOwnPropertySymbols,m_=Object.prototype.hasOwnProperty,__=Object.prototype.propertyIsEnumerable;function y_(r){if(r==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}function v_(){try{if(!Object.assign)return!1;var r=new String("abc");if(r[5]="de",Object.getOwnPropertyNames(r)[0]==="5")return!1;for(var n={},s=0;s<10;s++)n["_"+String.fromCharCode(s)]=s;var a=Object.getOwnPropertyNames(n).map(function(c){return n[c]});if(a.join("")!=="0123456789")return!1;var l={};return"abcdefghijklmnopqrst".split("").forEach(function(c){l[c]=c}),Object.keys(Object.assign({},l)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}Gf.exports=v_()?Object.assign:function(r,n){for(var s,a=y_(r),l,c=1;c{(function(r,n){typeof gh=="object"&&typeof mh<"u"?mh.exports=n():typeof define=="function"&&define.amd?define(n):(r=r||self).RBush=n()})(gh,function(){"use strict";function r(R,B,D,A,G){(function H(K,et,X,lt,gt){for(;lt>X;){if(lt-X>600){var Et=lt-X+1,Q=et-X+1,kt=Math.log(Et),ct=.5*Math.exp(2*kt/3),bt=.5*Math.sqrt(kt*ct*(Et-ct)/Et)*(Q-Et/2<0?-1:1),Mt=Math.max(X,Math.floor(et-Q*ct/Et+bt)),Xt=Math.min(lt,Math.floor(et+(Et-Q)*ct/Et+bt));H(K,et,Mt,Xt,gt)}var ft=K[et],Ct=X,st=lt;for(n(K,X,et),gt(K[lt],ft)>0&&n(K,X,lt);Ct0;)st--}gt(K[X],ft)===0?n(K,X,st):n(K,++st,lt),st<=et&&(X=st+1),et<=st&&(lt=st-1)}})(R,B,D||0,A||R.length-1,G||s)}function n(R,B,D){var A=R[B];R[B]=R[D],R[D]=A}function s(R,B){return RB?1:0}var a=function(R){R===void 0&&(R=9),this._maxEntries=Math.max(4,R),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function l(R,B,D){if(!D)return B.indexOf(R);for(var A=0;A=R.minX&&B.maxY>=R.minY}function z(R){return{children:R,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function j(R,B,D,A,G){for(var H=[B,D];H.length;)if(!((D=H.pop())-(B=H.pop())<=A)){var K=B+Math.ceil((D-B)/A/2)*A;r(R,K,B,D,G),H.push(B,K,K,D)}}return a.prototype.all=function(){return this._all(this.data,[])},a.prototype.search=function(R){var B=this.data,D=[];if(!q(R,B))return D;for(var A=this.toBBox,G=[];B;){for(var H=0;H=0&&G[B].children.length>this._maxEntries;)this._split(G,B),B--;this._adjustParentBBoxes(A,G,B)},a.prototype._split=function(R,B){var D=R[B],A=D.children.length,G=this._minEntries;this._chooseSplitAxis(D,G,A);var H=this._chooseSplitIndex(D,G,A),K=z(D.children.splice(H,D.children.length-H));K.height=D.height,K.leaf=D.leaf,c(D,this.toBBox),c(K,this.toBBox),B?R[B-1].children.push(K):this._splitRoot(D,K)},a.prototype._splitRoot=function(R,B){this.data=z([R,B]),this.data.height=R.height+1,this.data.leaf=!1,c(this.data,this.toBBox)},a.prototype._chooseSplitIndex=function(R,B,D){for(var A,G,H,K,et,X,lt,gt=1/0,Et=1/0,Q=B;Q<=D-B;Q++){var kt=g(R,0,Q,this.toBBox),ct=g(R,Q,D,this.toBBox),bt=(G=kt,H=ct,K=void 0,et=void 0,X=void 0,lt=void 0,K=Math.max(G.minX,H.minX),et=Math.max(G.minY,H.minY),X=Math.min(G.maxX,H.maxX),lt=Math.min(G.maxY,H.maxY),Math.max(0,X-K)*Math.max(0,lt-et)),Mt=P(kt)+P(ct);bt=B;gt--){var Et=R.children[gt];m(K,R.leaf?G(Et):Et),et+=T(K)}return et},a.prototype._adjustParentBBoxes=function(R,B,D){for(var A=D;A>=0;A--)m(B[A],R)},a.prototype._condense=function(R){for(var B=R.length-1,D=void 0;B>=0;B--)R[B].children.length===0?B>0?(D=R[B-1].children).splice(D.indexOf(R[B]),1):this.clear():c(R[B],this.toBBox)},a})});var qf=se((yh,vh)=>{(function(r,n){typeof yh=="object"&&typeof vh<"u"?vh.exports=n():typeof define=="function"&&define.amd?define(n):(r=r||self,r.TinyQueue=n())})(yh,function(){"use strict";var r=function(a,l){if(a===void 0&&(a=[]),l===void 0&&(l=n),this.data=a,this.length=this.data.length,this.compare=l,this.length>0)for(var c=(this.length>>1)-1;c>=0;c--)this._down(c)};r.prototype.push=function(a){this.data.push(a),this.length++,this._up(this.length-1)},r.prototype.pop=function(){if(this.length!==0){var a=this.data[0],l=this.data.pop();return this.length--,this.length>0&&(this.data[0]=l,this._down(0)),a}},r.prototype.peek=function(){return this.data[0]},r.prototype._up=function(a){for(var l=this,c=l.data,g=l.compare,m=c[a];a>0;){var v=a-1>>1,x=c[v];if(g(m,x)>=0)break;c[a]=x,a=v}c[a]=m},r.prototype._down=function(a){for(var l=this,c=l.data,g=l.compare,m=this.length>>1,v=c[a];a=0)break;c[a]=P,a=x}c[a]=v};function n(s,a){return sa?1:0}return r})});var jf=se((Tw,Uf)=>{Uf.exports=function(n,s,a,l){var c=n[0],g=n[1],m=!1;a===void 0&&(a=0),l===void 0&&(l=s.length);for(var v=(l-a)/2,x=0,P=v-1;xg!=z>g&&c<(q-T)*(g-N)/(z-N)+T;j&&(m=!m)}return m}});var Xf=se((Iw,Hf)=>{Hf.exports=function(n,s,a,l){var c=n[0],g=n[1],m=!1;a===void 0&&(a=0),l===void 0&&(l=s.length);for(var v=l-a,x=0,P=v-1;xg!=z>g&&c<(q-T)*(g-N)/(z-N)+T;j&&(m=!m)}return m}});var Vf=se((Ow,Yu)=>{var Zf=jf(),Yf=Xf();Yu.exports=function(n,s,a,l){return s.length>0&&Array.isArray(s[0])?Yf(n,s,a,l):Zf(n,s,a,l)};Yu.exports.nested=Yf;Yu.exports.flat=Zf});var Kf=se((Vu,Wf)=>{(function(r,n){typeof Vu=="object"&&typeof Wf<"u"?n(Vu):typeof define=="function"&&define.amd?define(["exports"],n):n((r=r||self).predicates={})})(Vu,function(r){"use strict";let s=33306690738754706e-32;function a(q,z,j,R,B){let D,A,G,H,K=z[0],et=R[0],X=0,lt=0;et>K==et>-K?(D=K,K=z[++X]):(D=et,et=R[++lt]);let gt=0;if(XK==et>-K?(G=D-((A=K+D)-K),K=z[++X]):(G=D-((A=et+D)-et),et=R[++lt]),D=A,G!==0&&(B[gt++]=G);XK==et>-K?(G=D-((A=D+K)-(H=A-D))+(K-H),K=z[++X]):(G=D-((A=D+et)-(H=A-D))+(et-H),et=R[++lt]),D=A,G!==0&&(B[gt++]=G);for(;X0!=G>0)return H;let K=Math.abs(A+G);return Math.abs(H)>=c*K?H:-function(et,X,lt,gt,Et,Q,kt){let ct,bt,Mt,Xt,ft,Ct,st,Rt,Ot,Qt,Tt,ce,Re,Cn,fe,ke,Bt,hn,Sn=et-Et,Hn=lt-Et,Me=X-Q,ue=gt-Q;ft=(fe=(Rt=Sn-(st=(Ct=134217729*Sn)-(Ct-Sn)))*(Qt=ue-(Ot=(Ct=134217729*ue)-(Ct-ue)))-((Cn=Sn*ue)-st*Ot-Rt*Ot-st*Qt))-(Tt=fe-(Bt=(Rt=Me-(st=(Ct=134217729*Me)-(Ct-Me)))*(Qt=Hn-(Ot=(Ct=134217729*Hn)-(Ct-Hn)))-((ke=Me*Hn)-st*Ot-Rt*Ot-st*Qt))),v[0]=fe-(Tt+ft)+(ft-Bt),ft=(Re=Cn-((ce=Cn+Tt)-(ft=ce-Cn))+(Tt-ft))-(Tt=Re-ke),v[1]=Re-(Tt+ft)+(ft-ke),ft=(hn=ce+Tt)-ce,v[2]=ce-(hn-ft)+(Tt-ft),v[3]=hn;let Ht=function(k,F){let Z=F[0];for(let J=1;J=ht||-Ht>=ht||(ct=et-(Sn+(ft=et-Sn))+(ft-Et),Mt=lt-(Hn+(ft=lt-Hn))+(ft-Et),bt=X-(Me+(ft=X-Me))+(ft-Q),Xt=gt-(ue+(ft=gt-ue))+(ft-Q),ct===0&&bt===0&&Mt===0&&Xt===0)||(ht=m*kt+s*Math.abs(Ht),(Ht+=Sn*Xt+ue*ct-(Me*Mt+Hn*bt))>=ht||-Ht>=ht))return Ht;ft=(fe=(Rt=ct-(st=(Ct=134217729*ct)-(Ct-ct)))*(Qt=ue-(Ot=(Ct=134217729*ue)-(Ct-ue)))-((Cn=ct*ue)-st*Ot-Rt*Ot-st*Qt))-(Tt=fe-(Bt=(Rt=bt-(st=(Ct=134217729*bt)-(Ct-bt)))*(Qt=Hn-(Ot=(Ct=134217729*Hn)-(Ct-Hn)))-((ke=bt*Hn)-st*Ot-Rt*Ot-st*Qt))),N[0]=fe-(Tt+ft)+(ft-Bt),ft=(Re=Cn-((ce=Cn+Tt)-(ft=ce-Cn))+(Tt-ft))-(Tt=Re-ke),N[1]=Re-(Tt+ft)+(ft-ke),ft=(hn=ce+Tt)-ce,N[2]=ce-(hn-ft)+(Tt-ft),N[3]=hn;let Y=a(4,v,4,N,x);ft=(fe=(Rt=Sn-(st=(Ct=134217729*Sn)-(Ct-Sn)))*(Qt=Xt-(Ot=(Ct=134217729*Xt)-(Ct-Xt)))-((Cn=Sn*Xt)-st*Ot-Rt*Ot-st*Qt))-(Tt=fe-(Bt=(Rt=Me-(st=(Ct=134217729*Me)-(Ct-Me)))*(Qt=Mt-(Ot=(Ct=134217729*Mt)-(Ct-Mt)))-((ke=Me*Mt)-st*Ot-Rt*Ot-st*Qt))),N[0]=fe-(Tt+ft)+(ft-Bt),ft=(Re=Cn-((ce=Cn+Tt)-(ft=ce-Cn))+(Tt-ft))-(Tt=Re-ke),N[1]=Re-(Tt+ft)+(ft-ke),ft=(hn=ce+Tt)-ce,N[2]=ce-(hn-ft)+(Tt-ft),N[3]=hn;let C=a(Y,x,4,N,P);ft=(fe=(Rt=ct-(st=(Ct=134217729*ct)-(Ct-ct)))*(Qt=Xt-(Ot=(Ct=134217729*Xt)-(Ct-Xt)))-((Cn=ct*Xt)-st*Ot-Rt*Ot-st*Qt))-(Tt=fe-(Bt=(Rt=bt-(st=(Ct=134217729*bt)-(Ct-bt)))*(Qt=Mt-(Ot=(Ct=134217729*Mt)-(Ct-Mt)))-((ke=bt*Mt)-st*Ot-Rt*Ot-st*Qt))),N[0]=fe-(Tt+ft)+(ft-Bt),ft=(Re=Cn-((ce=Cn+Tt)-(ft=ce-Cn))+(Tt-ft))-(Tt=Re-ke),N[1]=Re-(Tt+ft)+(ft-ke),ft=(hn=ce+Tt)-ce,N[2]=ce-(hn-ft)+(Tt-ft),N[3]=hn;let b=a(C,P,4,N,T);return T[b-1]}(q,z,j,R,B,D,K)},r.orient2dfast=function(q,z,j,R,B,D){return(z-D)*(j-B)-(q-B)*(R-D)},Object.defineProperty(r,"__esModule",{value:!0})})});var np=se((Nw,bh)=>{"use strict";var Jf=_h(),Ku=qf(),w_=Vf(),L_=Kf().orient2d;Ku.default&&(Ku=Ku.default);bh.exports=ep;bh.exports.default=ep;function ep(r,n,s){n=Math.max(0,n===void 0?2:n),s=s||0;var a=C_(r),l=new Jf(16);l.toBBox=function(D){return{minX:D[0],minY:D[1],maxX:D[0],maxY:D[1]}},l.compareMinX=function(D,A){return D[0]-A[0]},l.compareMinY=function(D,A){return D[1]-A[1]},l.load(r);for(var c=[],g=0,m;gc||m.push({node:P,dist:T})}for(;m.length&&!m.peek().node.children;){var N=m.pop(),q=N.node,z=Lh(q,n,s),j=Lh(q,a,l);if(N.dist=n.minX&&r[0]<=n.maxX&&r[1]>=n.minY&&r[1]<=n.maxY}function Qf(r,n,s){for(var a=Math.min(r[0],n[0]),l=Math.min(r[1],n[1]),c=Math.max(r[0],n[0]),g=Math.max(r[1],n[1]),m=s.search({minX:a,minY:l,maxX:c,maxY:g}),v=0;v0!=_a(r,n,a)>0&&_a(s,a,r)>0!=_a(s,a,n)>0}function xh(r){var n=r.p,s=r.next.p;return r.minX=Math.min(n[0],s[0]),r.minY=Math.min(n[1],s[1]),r.maxX=Math.max(n[0],s[0]),r.maxY=Math.max(n[1],s[1]),r}function C_(r){for(var n=r[0],s=r[0],a=r[0],l=r[0],c=0;ca[0]&&(a=g),g[1]l[1]&&(l=g)}var m=[n,s,a,l],v=m.slice();for(c=0;c1?(a=s[0],l=s[1]):m>0&&(a+=c*m,l+=g*m)}return c=r[0]-a,g=r[1]-l,c*c+g*g}function Wu(r,n,s,a,l,c,g,m){var v=s-r,x=a-n,P=g-l,T=m-c,N=r-l,q=n-c,z=v*v+x*x,j=v*P+x*T,R=P*P+T*T,B=v*N+x*q,D=P*N+T*q,A=z*R-j*j,G,H,K,et,X=A,lt=A;A===0?(H=0,X=1,et=D,lt=R):(H=j*D-R*B,et=z*D-j*B,H<0?(H=0,et=D,lt=R):H>X&&(H=X,et=D+j,lt=R)),et<0?(et=0,-B<0?H=0:-B>z?H=X:(H=-B,X=z)):et>lt&&(et=lt,-B+j<0?H=0:-B+j>z?H=X:(H=-B+j,X=z)),G=H===0?0:H/X,K=et===0?0:et/lt;var gt=(1-G)*r+G*s,Et=(1-G)*n+G*a,Q=(1-K)*l+K*g,kt=(1-K)*c+K*m,ct=Q-gt,bt=kt-Et;return ct*ct+bt*bt}function S_(r,n){return r[0]===n[0]?r[1]-n[1]:r[0]-n[0]}function k_(r){r.sort(S_);for(var n=[],s=0;s=2&&_a(n[n.length-2],n[n.length-1],r[s])<=0;)n.pop();n.push(r[s])}for(var a=[],l=r.length-1;l>=0;l--){for(;a.length>=2&&_a(a[a.length-2],a[a.length-1],r[l])<=0;)a.pop();a.push(r[l])}return a.pop(),n.pop(),n.concat(a)}});var ap=se((Mh,Ph)=>{(function(r,n){typeof Mh=="object"&&typeof Ph<"u"?Ph.exports=n():typeof define=="function"&&define.amd?define(n):r.quickselect=n()})(Mh,function(){"use strict";function r(l,c,g,m,v){n(l,c,g||0,m||l.length-1,v||a)}function n(l,c,g,m,v){for(;m>g;){if(m-g>600){var x=m-g+1,P=c-g+1,T=Math.log(x),N=.5*Math.exp(2*T/3),q=.5*Math.sqrt(T*N*(x-N)/x)*(P-x/2<0?-1:1),z=Math.max(g,Math.floor(c-P*N/x+q)),j=Math.min(m,Math.floor(c+(x-P)*N/x+q));n(l,c,z,j,v)}var R=l[c],B=g,D=m;for(s(l,g,c),v(l[m],R)>0&&s(l,g,m);B0;)D--}v(l[g],R)===0?s(l,g,D):(D++,s(l,D,m)),D<=c&&(g=D+1),c<=D&&(m=D-1)}}function s(l,c,g){var m=l[c];l[c]=l[g],l[g]=m}function a(l,c){return lc?1:0}return r})});var cp=se((oE,kh)=>{"use strict";kh.exports=nu;kh.exports.default=nu;var j_=ap();function nu(r,n){if(!(this instanceof nu))return new nu(r,n);this._maxEntries=Math.max(4,r||9),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),n&&this._initFormat(n),this.clear()}nu.prototype={all:function(){return this._all(this.data,[])},search:function(r){var n=this.data,s=[],a=this.toBBox;if(!$u(r,n))return s;for(var l=[],c,g,m,v;n;){for(c=0,g=n.children.length;c=0&&c[n].children.length>this._maxEntries;)this._split(c,n),n--;this._adjustParentBBoxes(l,c,n)},_split:function(r,n){var s=r[n],a=s.children.length,l=this._minEntries;this._chooseSplitAxis(s,l,a);var c=this._chooseSplitIndex(s,l,a),g=va(s.children.splice(c,s.children.length-c));g.height=s.height,g.leaf=s.leaf,ya(s,this.toBBox),ya(g,this.toBBox),n?r[n-1].children.push(g):this._splitRoot(s,g)},_splitRoot:function(r,n){this.data=va([r,n]),this.data.height=r.height+1,this.data.leaf=!1,ya(this.data,this.toBBox)},_chooseSplitIndex:function(r,n,s){var a,l,c,g,m,v,x,P;for(v=x=1/0,a=n;a<=s-n;a++)l=tu(r,0,a,this.toBBox),c=tu(r,a,s,this.toBBox),g=Z_(l,c),m=Ch(l)+Ch(c),g=n;v--)x=r.children[v],eu(g,r.leaf?l(x):x),m+=Ju(g);return m},_adjustParentBBoxes:function(r,n,s){for(var a=s;a>=0;a--)eu(n[a],r)},_condense:function(r){for(var n=r.length-1,s;n>=0;n--)r[n].children.length===0?n>0?(s=r[n-1].children,s.splice(s.indexOf(r[n]),1)):this.clear():ya(r[n],this.toBBox)},_initFormat:function(r){var n=["return a"," - b",";"];this.compareMinX=new Function("a","b",n.join(r[0])),this.compareMinY=new Function("a","b",n.join(r[1])),this.toBBox=new Function("a","return {minX: a"+r[0]+", minY: a"+r[1]+", maxX: a"+r[2]+", maxY: a"+r[3]+"};")}};function H_(r,n,s){if(!s)return n.indexOf(r);for(var a=0;a=r.minX&&n.maxY>=r.minY}function va(r){return{children:r,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function hp(r,n,s,a,l){for(var c=[n,s],g;c.length;)s=c.pop(),n=c.pop(),!(s-n<=a)&&(g=n+Math.ceil((s-n)/a/2)*a,j_(r,g,n,s,l),c.push(n,g,g,s))}});var mp=se((yM,Rh)=>{"use strict";Rh.exports=nl;Rh.exports.default=nl;function nl(r,n,s){s=s||2;var a=n&&n.length,l=a?n[0]*s:r.length,c=pp(r,0,l,s,!0),g=[];if(!c||c.next===c.prev)return g;var m,v,x,P,T,N,q;if(a&&(c=iy(r,n,c,s)),r.length>80*s){m=x=r[0],v=P=r[1];for(var z=s;zx&&(x=T),N>P&&(P=N);q=Math.max(x-m,P-v),q=q!==0?32767/q:0}return ou(c,g,s,m,v,q,0),g}function pp(r,n,s,a,l){var c,g;if(l===Nh(r,n,s,a)>0)for(c=n;c=n;c-=a)g=fp(c,r[c],r[c+1],g);return g&&rl(g,g.next)&&(au(g),g=g.next),g}function Ks(r,n){if(!r)return r;n||(n=r);var s=r,a;do if(a=!1,!s.steiner&&(rl(s,s.next)||kr(s.prev,s,s.next)===0)){if(au(s),s=n=s.prev,s===s.next)break;a=!0}else s=s.next;while(a||s!==n);return n}function ou(r,n,s,a,l,c,g){if(r){!g&&c&&ly(r,a,l,c);for(var m=r,v,x;r.prev!==r.next;){if(v=r.prev,x=r.next,c?ey(r,a,l,c):ty(r)){n.push(v.i/s|0),n.push(r.i/s|0),n.push(x.i/s|0),au(r),r=x.next,m=x.next;continue}if(r=x,r===m){g?g===1?(r=ny(Ks(r),n,s),ou(r,n,s,a,l,c,2)):g===2&&ry(r,n,s,a,l,c):ou(Ks(r),n,s,a,l,c,1);break}}}}function ty(r){var n=r.prev,s=r,a=r.next;if(kr(n,s,a)>=0)return!1;for(var l=n.x,c=s.x,g=a.x,m=n.y,v=s.y,x=a.y,P=lc?l>g?l:g:c>g?c:g,q=m>v?m>x?m:x:v>x?v:x,z=a.next;z!==n;){if(z.x>=P&&z.x<=N&&z.y>=T&&z.y<=q&&wa(l,m,c,v,g,x,z.x,z.y)&&kr(z.prev,z,z.next)>=0)return!1;z=z.next}return!0}function ey(r,n,s,a){var l=r.prev,c=r,g=r.next;if(kr(l,c,g)>=0)return!1;for(var m=l.x,v=c.x,x=g.x,P=l.y,T=c.y,N=g.y,q=mv?m>x?m:x:v>x?v:x,R=P>T?P>N?P:N:T>N?T:N,B=Ih(q,z,n,s,a),D=Ih(j,R,n,s,a),A=r.prevZ,G=r.nextZ;A&&A.z>=B&&G&&G.z<=D;){if(A.x>=q&&A.x<=j&&A.y>=z&&A.y<=R&&A!==l&&A!==g&&wa(m,P,v,T,x,N,A.x,A.y)&&kr(A.prev,A,A.next)>=0||(A=A.prevZ,G.x>=q&&G.x<=j&&G.y>=z&&G.y<=R&&G!==l&&G!==g&&wa(m,P,v,T,x,N,G.x,G.y)&&kr(G.prev,G,G.next)>=0))return!1;G=G.nextZ}for(;A&&A.z>=B;){if(A.x>=q&&A.x<=j&&A.y>=z&&A.y<=R&&A!==l&&A!==g&&wa(m,P,v,T,x,N,A.x,A.y)&&kr(A.prev,A,A.next)>=0)return!1;A=A.prevZ}for(;G&&G.z<=D;){if(G.x>=q&&G.x<=j&&G.y>=z&&G.y<=R&&G!==l&&G!==g&&wa(m,P,v,T,x,N,G.x,G.y)&&kr(G.prev,G,G.next)>=0)return!1;G=G.nextZ}return!0}function ny(r,n,s){var a=r;do{var l=a.prev,c=a.next.next;!rl(l,c)&&dp(l,a,a.next,c)&&su(l,c)&&su(c,l)&&(n.push(l.i/s|0),n.push(a.i/s|0),n.push(c.i/s|0),au(a),au(a.next),a=r=c),a=a.next}while(a!==r);return Ks(a)}function ry(r,n,s,a,l,c){var g=r;do{for(var m=g.next.next;m!==g.prev;){if(g.i!==m.i&&fy(g,m)){var v=gp(g,m);g=Ks(g,g.next),v=Ks(v,v.next),ou(g,n,s,a,l,c,0),ou(v,n,s,a,l,c,0);return}m=m.next}g=g.next}while(g!==r)}function iy(r,n,s,a){var l=[],c,g,m,v,x;for(c=0,g=n.length;c=s.next.y&&s.next.y!==s.y){var m=s.x+(l-s.y)*(s.next.x-s.x)/(s.next.y-s.y);if(m<=a&&m>c&&(c=m,g=s.x=s.x&&s.x>=x&&a!==s.x&&wa(lg.x||s.x===g.x&&uy(g,s)))&&(g=s,T=N)),s=s.next;while(s!==v);return g}function uy(r,n){return kr(r.prev,r,n.prev)<0&&kr(n.next,r,r.next)<0}function ly(r,n,s,a){var l=r;do l.z===0&&(l.z=Ih(l.x,l.y,n,s,a)),l.prevZ=l.prev,l.nextZ=l.next,l=l.next;while(l!==r);l.prevZ.nextZ=null,l.prevZ=null,hy(l)}function hy(r){var n,s,a,l,c,g,m,v,x=1;do{for(s=r,r=null,c=null,g=0;s;){for(g++,a=s,m=0,n=0;n0||v>0&&a;)m!==0&&(v===0||!a||s.z<=a.z)?(l=s,s=s.nextZ,m--):(l=a,a=a.nextZ,v--),c?c.nextZ=l:r=l,l.prevZ=c,c=l;s=a}c.nextZ=null,x*=2}while(g>1);return r}function Ih(r,n,s,a,l){return r=(r-s)*l|0,n=(n-a)*l|0,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,r|n<<1}function cy(r){var n=r,s=r;do(n.x=(r-g)*(c-m)&&(r-g)*(a-m)>=(s-g)*(n-m)&&(s-g)*(c-m)>=(l-g)*(a-m)}function fy(r,n){return r.next.i!==n.i&&r.prev.i!==n.i&&!py(r,n)&&(su(r,n)&&su(n,r)&&dy(r,n)&&(kr(r.prev,r,n.prev)||kr(r,n.prev,n))||rl(r,n)&&kr(r.prev,r,r.next)>0&&kr(n.prev,n,n.next)>0)}function kr(r,n,s){return(n.y-r.y)*(s.x-n.x)-(n.x-r.x)*(s.y-n.y)}function rl(r,n){return r.x===n.x&&r.y===n.y}function dp(r,n,s,a){var l=el(kr(r,n,s)),c=el(kr(r,n,a)),g=el(kr(s,a,r)),m=el(kr(s,a,n));return!!(l!==c&&g!==m||l===0&&tl(r,s,n)||c===0&&tl(r,a,n)||g===0&&tl(s,r,a)||m===0&&tl(s,n,a))}function tl(r,n,s){return n.x<=Math.max(r.x,s.x)&&n.x>=Math.min(r.x,s.x)&&n.y<=Math.max(r.y,s.y)&&n.y>=Math.min(r.y,s.y)}function el(r){return r>0?1:r<0?-1:0}function py(r,n){var s=r;do{if(s.i!==r.i&&s.next.i!==r.i&&s.i!==n.i&&s.next.i!==n.i&&dp(s,s.next,r,n))return!0;s=s.next}while(s!==r);return!1}function su(r,n){return kr(r.prev,r,r.next)<0?kr(r,n,r.next)>=0&&kr(r,r.prev,n)>=0:kr(r,n,r.prev)<0||kr(r,r.next,n)<0}function dy(r,n){var s=r,a=!1,l=(r.x+n.x)/2,c=(r.y+n.y)/2;do s.y>c!=s.next.y>c&&s.next.y!==s.y&&l<(s.next.x-s.x)*(c-s.y)/(s.next.y-s.y)+s.x&&(a=!a),s=s.next;while(s!==r);return a}function gp(r,n){var s=new Oh(r.i,r.x,r.y),a=new Oh(n.i,n.x,n.y),l=r.next,c=n.prev;return r.next=n,n.prev=r,s.next=l,l.prev=s,a.next=s,s.prev=a,c.next=a,a.prev=c,a}function fp(r,n,s,a){var l=new Oh(r,n,s);return a?(l.next=a.next,l.prev=a,a.next.prev=l,a.next=l):(l.prev=l,l.next=l),l}function au(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function Oh(r,n,s){this.i=r,this.x=n,this.y=s,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}nl.deviation=function(r,n,s,a){var l=n&&n.length,c=l?n[0]*s:r.length,g=Math.abs(Nh(r,0,c,s));if(l)for(var m=0,v=n.length;m0&&(a+=r[l-1].length,s.holes.push(a))}return s}});var zh=se(me=>{"use strict";Object.defineProperty(me,"__esModule",{value:!0});me.earthRadius=63710088e-1;me.factors={centimeters:me.earthRadius*100,centimetres:me.earthRadius*100,degrees:me.earthRadius/111325,feet:me.earthRadius*3.28084,inches:me.earthRadius*39.37,kilometers:me.earthRadius/1e3,kilometres:me.earthRadius/1e3,meters:me.earthRadius,metres:me.earthRadius,miles:me.earthRadius/1609.344,millimeters:me.earthRadius*1e3,millimetres:me.earthRadius*1e3,nauticalmiles:me.earthRadius/1852,radians:1,yards:me.earthRadius*1.0936};me.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/me.earthRadius,yards:1.0936133};me.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function Fs(r,n,s){s===void 0&&(s={});var a={type:"Feature"};return(s.id===0||s.id)&&(a.id=s.id),s.bbox&&(a.bbox=s.bbox),a.properties=n||{},a.geometry=r,a}me.feature=Fs;function xy(r,n,s){switch(s===void 0&&(s={}),r){case"Point":return Ah(n).geometry;case"LineString":return Bh(n).geometry;case"Polygon":return Dh(n).geometry;case"MultiPoint":return yp(n).geometry;case"MultiLineString":return _p(n).geometry;case"MultiPolygon":return vp(n).geometry;default:throw new Error(r+" is invalid")}}me.geometry=xy;function Ah(r,n,s){if(s===void 0&&(s={}),!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!il(r[0])||!il(r[1]))throw new Error("coordinates must contain numbers");var a={type:"Point",coordinates:r};return Fs(a,n,s)}me.point=Ah;function wy(r,n,s){return s===void 0&&(s={}),ol(r.map(function(a){return Ah(a,n)}),s)}me.points=wy;function Dh(r,n,s){s===void 0&&(s={});for(var a=0,l=r;a=0))throw new Error("precision must be a positive number");var s=Math.pow(10,n||0);return Math.round(r*s)/s}me.round=My;function xp(r,n){n===void 0&&(n="kilometers");var s=me.factors[n];if(!s)throw new Error(n+" units is invalid");return r*s}me.radiansToLength=xp;function Fh(r,n){n===void 0&&(n="kilometers");var s=me.factors[n];if(!s)throw new Error(n+" units is invalid");return r/s}me.lengthToRadians=Fh;function Py(r,n){return wp(Fh(r,n))}me.lengthToDegrees=Py;function Cy(r){var n=r%360;return n<0&&(n+=360),n}me.bearingToAzimuth=Cy;function wp(r){var n=r%(2*Math.PI);return n*180/Math.PI}me.radiansToDegrees=wp;function Sy(r){var n=r%360;return n*Math.PI/180}me.degreesToRadians=Sy;function ky(r,n,s){if(n===void 0&&(n="kilometers"),s===void 0&&(s="kilometers"),!(r>=0))throw new Error("length must be a positive number");return xp(Fh(r,n),s)}me.convertLength=ky;function Ty(r,n,s){if(n===void 0&&(n="meters"),s===void 0&&(s="kilometers"),!(r>=0))throw new Error("area must be a positive number");var a=me.areaFactors[n];if(!a)throw new Error("invalid original units");var l=me.areaFactors[s];if(!l)throw new Error("invalid final units");return r/a*l}me.convertArea=Ty;function il(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}me.isNumber=il;function Iy(r){return!!r&&r.constructor===Object}me.isObject=Iy;function Oy(r){if(!r)throw new Error("bbox is required");if(!Array.isArray(r))throw new Error("bbox must be an Array");if(r.length!==4&&r.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");r.forEach(function(n){if(!il(n))throw new Error("bbox must only contain numbers")})}me.validateBBox=Oy;function Ny(r){if(!r)throw new Error("id is required");if(["string","number"].indexOf(typeof r)===-1)throw new Error("id must be a number or a string")}me.validateId=Ny});var qh=se(pi=>{"use strict";Object.defineProperty(pi,"__esModule",{value:!0});var Yi=zh();function uu(r,n,s){if(r!==null)for(var a,l,c,g,m,v,x,P=0,T=0,N,q=r.type,z=q==="FeatureCollection",j=q==="Feature",R=z?r.features.length:1,B=0;Bv||z>x||j>P){m=T,v=a,x=z,P=j,c=0;return}var R=Yi.lineString([m,T],s.properties);if(n(R,a,l,j,c)===!1)return!1;c++,m=T})===!1)return!1}}})}function Gy(r,n,s){var a=s,l=!1;return Ep(r,function(c,g,m,v,x){l===!1&&s===void 0?a=c:a=n(a,c,g,m,v,x),l=!0}),a}function Mp(r,n){if(!r)throw new Error("geojson is required");sl(r,function(s,a,l){if(s.geometry!==null){var c=s.geometry.type,g=s.geometry.coordinates;switch(c){case"LineString":if(n(s,a,l,0,0)===!1)return!1;break;case"Polygon":for(var m=0;m{"use strict";Object.defineProperty(jh,"__esModule",{value:!0});var Hy=qh();function Uh(r){var n=[1/0,1/0,-1/0,-1/0];return Hy.coordEach(r,function(s){n[0]>s[0]&&(n[0]=s[0]),n[1]>s[1]&&(n[1]=s[1]),n[2]{var ls=_h(),Sp=zh(),kp=qh(),La=Pp().default,Xy=kp.featureEach,OM=kp.coordEach,NM=Sp.polygon,Cp=Sp.featureCollection;function Tp(r){var n=new ls(r);return n.insert=function(s){if(s.type!=="Feature")throw new Error("invalid feature");return s.bbox=s.bbox?s.bbox:La(s),ls.prototype.insert.call(this,s)},n.load=function(s){var a=[];return Array.isArray(s)?s.forEach(function(l){if(l.type!=="Feature")throw new Error("invalid features");l.bbox=l.bbox?l.bbox:La(l),a.push(l)}):Xy(s,function(l){if(l.type!=="Feature")throw new Error("invalid features");l.bbox=l.bbox?l.bbox:La(l),a.push(l)}),ls.prototype.load.call(this,a)},n.remove=function(s,a){if(s.type!=="Feature")throw new Error("invalid feature");return s.bbox=s.bbox?s.bbox:La(s),ls.prototype.remove.call(this,s,a)},n.clear=function(){return ls.prototype.clear.call(this)},n.search=function(s){var a=ls.prototype.search.call(this,this.toBBox(s));return Cp(a)},n.collides=function(s){return ls.prototype.collides.call(this,this.toBBox(s))},n.all=function(){var s=ls.prototype.all.call(this);return Cp(s)},n.toJSON=function(){return ls.prototype.toJSON.call(this)},n.fromJSON=function(s){return ls.prototype.fromJSON.call(this,s)},n.toBBox=function(s){var a;if(s.bbox)a=s.bbox;else if(Array.isArray(s)&&s.length===4)a=s;else if(Array.isArray(s)&&s.length===6)a=[s[0],s[1],s[3],s[4]];else if(s.type==="Feature")a=La(s);else if(s.type==="FeatureCollection")a=La(s);else throw new Error("invalid geojson");return{minX:a[0],minY:a[1],maxX:a[2],maxY:a[3]}},n}Hh.exports=Tp;Hh.exports.default=Tp});var Bp=se((Wh,Kh)=>{(function(r,n){typeof Wh=="object"&&typeof Kh<"u"?Kh.exports=n():typeof define=="function"&&define.amd?define(n):r.quickselect=n()})(Wh,function(){"use strict";function r(l,c,g,m,v){n(l,c,g||0,m||l.length-1,v||a)}function n(l,c,g,m,v){for(;m>g;){if(m-g>600){var x=m-g+1,P=c-g+1,T=Math.log(x),N=.5*Math.exp(2*T/3),q=.5*Math.sqrt(T*N*(x-N)/x)*(P-x/2<0?-1:1),z=Math.max(g,Math.floor(c-P*N/x+q)),j=Math.min(m,Math.floor(c+(x-P)*N/x+q));n(l,c,z,j,v)}var R=l[c],B=g,D=m;for(s(l,g,c),v(l[m],R)>0&&s(l,g,m);B0;)D--}v(l[g],R)===0?s(l,g,D):(D++,s(l,D,m)),D<=c&&(g=D+1),c<=D&&(m=D-1)}}function s(l,c,g){var m=l[c];l[c]=l[g],l[g]=m}function a(l,c){return lc?1:0}return r})});var qp=se((oC,Qh)=>{"use strict";Qh.exports=cu;Qh.exports.default=cu;var ev=Bp();function cu(r,n){if(!(this instanceof cu))return new cu(r,n);this._maxEntries=Math.max(4,r||9),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),n&&this._initFormat(n),this.clear()}cu.prototype={all:function(){return this._all(this.data,[])},search:function(r){var n=this.data,s=[],a=this.toBBox;if(!hl(r,n))return s;for(var l=[],c,g,m,v;n;){for(c=0,g=n.children.length;c=0&&c[n].children.length>this._maxEntries;)this._split(c,n),n--;this._adjustParentBBoxes(l,c,n)},_split:function(r,n){var s=r[n],a=s.children.length,l=this._minEntries;this._chooseSplitAxis(s,l,a);var c=this._chooseSplitIndex(s,l,a),g=Ea(s.children.splice(c,s.children.length-c));g.height=s.height,g.leaf=s.leaf,ba(s,this.toBBox),ba(g,this.toBBox),n?r[n-1].children.push(g):this._splitRoot(s,g)},_splitRoot:function(r,n){this.data=Ea([r,n]),this.data.height=r.height+1,this.data.leaf=!1,ba(this.data,this.toBBox)},_chooseSplitIndex:function(r,n,s){var a,l,c,g,m,v,x,P;for(v=x=1/0,a=n;a<=s-n;a++)l=lu(r,0,a,this.toBBox),c=lu(r,a,s,this.toBBox),g=iv(l,c),m=Jh(l)+Jh(c),g=n;v--)x=r.children[v],hu(g,r.leaf?l(x):x),m+=ll(g);return m},_adjustParentBBoxes:function(r,n,s){for(var a=s;a>=0;a--)hu(n[a],r)},_condense:function(r){for(var n=r.length-1,s;n>=0;n--)r[n].children.length===0?n>0?(s=r[n-1].children,s.splice(s.indexOf(r[n]),1)):this.clear():ba(r[n],this.toBBox)},_initFormat:function(r){var n=["return a"," - b",";"];this.compareMinX=new Function("a","b",n.join(r[0])),this.compareMinY=new Function("a","b",n.join(r[1])),this.toBBox=new Function("a","return {minX: a"+r[0]+", minY: a"+r[1]+", maxX: a"+r[2]+", maxY: a"+r[3]+"};")}};function nv(r,n,s){if(!s)return n.indexOf(r);for(var a=0;a=r.minX&&n.maxY>=r.minY}function Ea(r){return{children:r,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Gp(r,n,s,a,l){for(var c=[n,s],g;c.length;)s=c.pop(),n=c.pop(),!(s-n<=a)&&(g=n+Math.ceil((s-n)/a/2)*a,ev(r,g,n,s,l),c.push(n,g,g,s))}});var ec=se((jC,Vp)=>{"use strict";var Yp=Object.prototype.toString;Vp.exports=function(n){var s=Yp.call(n),a=s==="[object Arguments]";return a||(a=s!=="[object Array]"&&n!==null&&typeof n=="object"&&typeof n.length=="number"&&n.length>=0&&Yp.call(n.callee)==="[object Function]"),a}});var rd=se((HC,nd)=>{"use strict";var ed;Object.keys||(pu=Object.prototype.hasOwnProperty,nc=Object.prototype.toString,Wp=ec(),rc=Object.prototype.propertyIsEnumerable,Kp=!rc.call({toString:null},"toString"),Jp=rc.call(function(){},"prototype"),du=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],cl=function(r){var n=r.constructor;return n&&n.prototype===r},$p={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},Qp=function(){if(typeof window>"u")return!1;for(var r in window)try{if(!$p["$"+r]&&pu.call(window,r)&&window[r]!==null&&typeof window[r]=="object")try{cl(window[r])}catch{return!0}}catch{return!0}return!1}(),td=function(r){if(typeof window>"u"||!Qp)return cl(r);try{return cl(r)}catch{return!1}},ed=function(n){var s=n!==null&&typeof n=="object",a=nc.call(n)==="[object Function]",l=Wp(n),c=s&&nc.call(n)==="[object String]",g=[];if(!s&&!a&&!l)throw new TypeError("Object.keys called on a non-object");var m=Jp&&a;if(c&&n.length>0&&!pu.call(n,0))for(var v=0;v0)for(var x=0;x{"use strict";var lv=Array.prototype.slice,hv=ec(),id=Object.keys,fl=id?function(n){return id(n)}:rd(),od=Object.keys;fl.shim=function(){if(Object.keys){var n=function(){var s=Object.keys(arguments);return s&&s.length===arguments.length}(1,2);n||(Object.keys=function(a){return hv(a)?od(lv.call(a)):od(a)})}else Object.keys=fl;return Object.keys||fl};sd.exports=fl});var oc=se((ZC,ad)=>{"use strict";ad.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var n={},s=Symbol("test"),a=Object(s);if(typeof s=="string"||Object.prototype.toString.call(s)!=="[object Symbol]"||Object.prototype.toString.call(a)!=="[object Symbol]")return!1;var l=42;n[s]=l;for(s in n)return!1;if(typeof Object.keys=="function"&&Object.keys(n).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(n).length!==0)return!1;var c=Object.getOwnPropertySymbols(n);if(c.length!==1||c[0]!==s||!Object.prototype.propertyIsEnumerable.call(n,s))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var g=Object.getOwnPropertyDescriptor(n,s);if(g.value!==l||g.enumerable!==!0)return!1}return!0}});var pl=se((YC,ud)=>{"use strict";var cv=oc();ud.exports=function(){return cv()&&!!Symbol.toStringTag}});var cd=se((VC,hd)=>{"use strict";var ld=typeof Symbol<"u"&&Symbol,fv=oc();hd.exports=function(){return typeof ld!="function"||typeof Symbol!="function"||typeof ld("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:fv()}});var pd=se((WC,fd)=>{"use strict";var pv="Function.prototype.bind called on incompatible ",sc=Array.prototype.slice,dv=Object.prototype.toString,gv="[object Function]";fd.exports=function(n){var s=this;if(typeof s!="function"||dv.call(s)!==gv)throw new TypeError(pv+s);for(var a=sc.call(arguments,1),l,c=function(){if(this instanceof l){var P=s.apply(this,a.concat(sc.call(arguments)));return Object(P)===P?P:this}else return s.apply(n,a.concat(sc.call(arguments)))},g=Math.max(0,s.length-a.length),m=[],v=0;v{"use strict";var mv=pd();dd.exports=Function.prototype.bind||mv});var md=se((JC,gd)=>{"use strict";var _v=dl();gd.exports=_v.call(Function.call,Object.prototype.hasOwnProperty)});var _l=se(($C,wd)=>{"use strict";var Pn,Sa=SyntaxError,xd=Function,Ca=TypeError,ac=function(r){try{return xd('"use strict"; return ('+r+").constructor;")()}catch{}},Js=Object.getOwnPropertyDescriptor;if(Js)try{Js({},"")}catch{Js=null}var uc=function(){throw new Ca},yv=Js?function(){try{return arguments.callee,uc}catch{try{return Js(arguments,"callee").get}catch{return uc}}}():uc,Ma=cd()(),cs=Object.getPrototypeOf||function(r){return r.__proto__},Pa={},vv=typeof Uint8Array>"u"?Pn:cs(Uint8Array),$s={"%AggregateError%":typeof AggregateError>"u"?Pn:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Pn:ArrayBuffer,"%ArrayIteratorPrototype%":Ma?cs([][Symbol.iterator]()):Pn,"%AsyncFromSyncIteratorPrototype%":Pn,"%AsyncFunction%":Pa,"%AsyncGenerator%":Pa,"%AsyncGeneratorFunction%":Pa,"%AsyncIteratorPrototype%":Pa,"%Atomics%":typeof Atomics>"u"?Pn:Atomics,"%BigInt%":typeof BigInt>"u"?Pn:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Pn:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Pn:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Pn:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?Pn:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Pn:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Pn:FinalizationRegistry,"%Function%":xd,"%GeneratorFunction%":Pa,"%Int8Array%":typeof Int8Array>"u"?Pn:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Pn:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Pn:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ma?cs(cs([][Symbol.iterator]())):Pn,"%JSON%":typeof JSON=="object"?JSON:Pn,"%Map%":typeof Map>"u"?Pn:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ma?Pn:cs(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Pn:Promise,"%Proxy%":typeof Proxy>"u"?Pn:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?Pn:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Pn:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ma?Pn:cs(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Pn:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ma?cs(""[Symbol.iterator]()):Pn,"%Symbol%":Ma?Symbol:Pn,"%SyntaxError%":Sa,"%ThrowTypeError%":yv,"%TypedArray%":vv,"%TypeError%":Ca,"%Uint8Array%":typeof Uint8Array>"u"?Pn:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Pn:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Pn:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Pn:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?Pn:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Pn:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Pn:WeakSet};try{null.error}catch(r){_d=cs(cs(r)),$s["%Error.prototype%"]=_d}var _d,xv=function r(n){var s;if(n==="%AsyncFunction%")s=ac("async function () {}");else if(n==="%GeneratorFunction%")s=ac("function* () {}");else if(n==="%AsyncGeneratorFunction%")s=ac("async function* () {}");else if(n==="%AsyncGenerator%"){var a=r("%AsyncGeneratorFunction%");a&&(s=a.prototype)}else if(n==="%AsyncIteratorPrototype%"){var l=r("%AsyncGenerator%");l&&(s=cs(l.prototype))}return $s[n]=s,s},yd={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},gu=dl(),gl=md(),wv=gu.call(Function.call,Array.prototype.concat),Lv=gu.call(Function.apply,Array.prototype.splice),vd=gu.call(Function.call,String.prototype.replace),ml=gu.call(Function.call,String.prototype.slice),bv=gu.call(Function.call,RegExp.prototype.exec),Ev=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Mv=/\\(\\)?/g,Pv=function(n){var s=ml(n,0,1),a=ml(n,-1);if(s==="%"&&a!=="%")throw new Sa("invalid intrinsic syntax, expected closing `%`");if(a==="%"&&s!=="%")throw new Sa("invalid intrinsic syntax, expected opening `%`");var l=[];return vd(n,Ev,function(c,g,m,v){l[l.length]=m?vd(v,Mv,"$1"):g||c}),l},Cv=function(n,s){var a=n,l;if(gl(yd,a)&&(l=yd[a],a="%"+l[0]+"%"),gl($s,a)){var c=$s[a];if(c===Pa&&(c=xv(a)),typeof c>"u"&&!s)throw new Ca("intrinsic "+n+" exists, but is not available. Please file an issue!");return{alias:l,name:a,value:c}}throw new Sa("intrinsic "+n+" does not exist!")};wd.exports=function(n,s){if(typeof n!="string"||n.length===0)throw new Ca("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof s!="boolean")throw new Ca('"allowMissing" argument must be a boolean');if(bv(/^%?[^%]*%?$/,n)===null)throw new Sa("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var a=Pv(n),l=a.length>0?a[0]:"",c=Cv("%"+l+"%",s),g=c.name,m=c.value,v=!1,x=c.alias;x&&(l=x[0],Lv(a,wv([0,1],x)));for(var P=1,T=!0;P=a.length){var j=Js(m,N);T=!!j,T&&"get"in j&&!("originalValue"in j.get)?m=j.get:m=m[N]}else T=gl(m,N),m=m[N];T&&!v&&($s[g]=m)}}return m}});var vl=se((QC,yl)=>{"use strict";var lc=dl(),ka=_l(),Ed=ka("%Function.prototype.apply%"),Md=ka("%Function.prototype.call%"),Pd=ka("%Reflect.apply%",!0)||lc.call(Md,Ed),Ld=ka("%Object.getOwnPropertyDescriptor%",!0),Qs=ka("%Object.defineProperty%",!0),Sv=ka("%Math.max%");if(Qs)try{Qs({},"a",{value:1})}catch{Qs=null}yl.exports=function(n){var s=Pd(lc,Md,arguments);if(Ld&&Qs){var a=Ld(s,"length");a.configurable&&Qs(s,"length",{value:1+Sv(0,n.length-(arguments.length-1))})}return s};var bd=function(){return Pd(lc,Ed,arguments)};Qs?Qs(yl.exports,"apply",{value:bd}):yl.exports.apply=bd});var hc=se((tS,kd)=>{"use strict";var Cd=_l(),Sd=vl(),kv=Sd(Cd("String.prototype.indexOf"));kd.exports=function(n,s){var a=Cd(n,!!s);return typeof a=="function"&&kv(n,".prototype.")>-1?Sd(a):a}});var Od=se((eS,Id)=>{"use strict";var Tv=pl()(),Iv=hc(),cc=Iv("Object.prototype.toString"),xl=function(n){return Tv&&n&&typeof n=="object"&&Symbol.toStringTag in n?!1:cc(n)==="[object Arguments]"},Td=function(n){return xl(n)?!0:n!==null&&typeof n=="object"&&typeof n.length=="number"&&n.length>=0&&cc(n)!=="[object Array]"&&cc(n.callee)==="[object Function]"},Ov=function(){return xl(arguments)}();xl.isLegacyArguments=Td;Id.exports=Ov?xl:Td});var Rd=se((nS,Nd)=>{"use strict";var Nv=_l(),fc=Nv("%Object.defineProperty%",!0),pc=function(){if(fc)try{return fc({},"a",{value:1}),!0}catch{return!1}return!1};pc.hasArrayLengthDefineBug=function(){if(!pc())return null;try{return fc([],"length",{value:1}).length!==1}catch{return!0}};Nd.exports=pc});var Ta=se((rS,Fd)=>{"use strict";var Rv=ic(),Av=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",Dv=Object.prototype.toString,Bv=Array.prototype.concat,Ad=Object.defineProperty,Fv=function(r){return typeof r=="function"&&Dv.call(r)==="[object Function]"},zv=Rd()(),Dd=Ad&&zv,Gv=function(r,n,s,a){if(n in r){if(a===!0){if(r[n]===s)return}else if(!Fv(a)||!a())return}Dd?Ad(r,n,{configurable:!0,enumerable:!1,value:s,writable:!0}):r[n]=s},Bd=function(r,n){var s=arguments.length>2?arguments[2]:{},a=Rv(n);Av&&(a=Bv.call(a,Object.getOwnPropertySymbols(n)));for(var l=0;l{"use strict";var zd=function(r){return r!==r};Gd.exports=function(n,s){return n===0&&s===0?1/n===1/s:!!(n===s||zd(n)&&zd(s))}});var gc=se((oS,qd)=>{"use strict";var qv=dc();qd.exports=function(){return typeof Object.is=="function"?Object.is:qv}});var jd=se((sS,Ud)=>{"use strict";var Uv=gc(),jv=Ta();Ud.exports=function(){var n=Uv();return jv(Object,{is:n},{is:function(){return Object.is!==n}}),n}});var Yd=se((aS,Zd)=>{"use strict";var Hv=Ta(),Xv=vl(),Zv=dc(),Hd=gc(),Yv=jd(),Xd=Xv(Hd(),Object);Hv(Xd,{getPolyfill:Hd,implementation:Zv,shim:Yv});Zd.exports=Xd});var $d=se((uS,Jd)=>{"use strict";var mc=hc(),Vd=pl()(),Wd,Kd,_c,yc;Vd&&(Wd=mc("Object.prototype.hasOwnProperty"),Kd=mc("RegExp.prototype.exec"),_c={},wl=function(){throw _c},yc={toString:wl,valueOf:wl},typeof Symbol.toPrimitive=="symbol"&&(yc[Symbol.toPrimitive]=wl));var wl,Vv=mc("Object.prototype.toString"),Wv=Object.getOwnPropertyDescriptor,Kv="[object RegExp]";Jd.exports=Vd?function(n){if(!n||typeof n!="object")return!1;var s=Wv(n,"lastIndex"),a=s&&Wd(s,"value");if(!a)return!1;try{Kd(n,yc)}catch(l){return l===_c}}:function(n){return!n||typeof n!="object"&&typeof n!="function"?!1:Vv(n)===Kv}});var tg=se((lS,Qd)=>{"use strict";var _u=function(){return typeof function(){}.name=="string"},mu=Object.getOwnPropertyDescriptor;if(mu)try{mu([],"length")}catch{mu=null}_u.functionsHaveConfigurableNames=function(){if(!_u()||!mu)return!1;var n=mu(function(){},"name");return!!n&&!!n.configurable};var Jv=Function.prototype.bind;_u.boundFunctionsHaveNames=function(){return _u()&&typeof Jv=="function"&&function(){}.bind().name!==""};Qd.exports=_u});var xc=se((hS,vc)=>{"use strict";var $v=tg().functionsHaveConfigurableNames(),Qv=Object,t0=TypeError;vc.exports=function(){if(this!=null&&this!==Qv(this))throw new t0("RegExp.prototype.flags getter called on non-object");var n="";return this.hasIndices&&(n+="d"),this.global&&(n+="g"),this.ignoreCase&&(n+="i"),this.multiline&&(n+="m"),this.dotAll&&(n+="s"),this.unicode&&(n+="u"),this.sticky&&(n+="y"),n};$v&&Object.defineProperty&&Object.defineProperty(vc.exports,"name",{value:"get flags"})});var wc=se((cS,eg)=>{"use strict";var e0=xc(),n0=Ta().supportsDescriptors,r0=Object.getOwnPropertyDescriptor;eg.exports=function(){if(n0&&/a/mig.flags==="gim"){var n=r0(RegExp.prototype,"flags");if(n&&typeof n.get=="function"&&typeof RegExp.prototype.dotAll=="boolean"&&typeof RegExp.prototype.hasIndices=="boolean"){var s="",a={};if(Object.defineProperty(a,"hasIndices",{get:function(){s+="d"}}),Object.defineProperty(a,"sticky",{get:function(){s+="y"}}),s==="dy")return n.get}}return e0}});var ig=se((fS,rg)=>{"use strict";var i0=Ta().supportsDescriptors,o0=wc(),s0=Object.getOwnPropertyDescriptor,a0=Object.defineProperty,u0=TypeError,ng=Object.getPrototypeOf,l0=/a/;rg.exports=function(){if(!i0||!ng)throw new u0("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var n=o0(),s=ng(l0),a=s0(s,"flags");return(!a||a.get!==n)&&a0(s,"flags",{configurable:!0,enumerable:!1,get:n}),n}});var ug=se((pS,ag)=>{"use strict";var h0=Ta(),c0=vl(),f0=xc(),og=wc(),p0=ig(),sg=c0(og());h0(sg,{getPolyfill:og,implementation:f0,shim:p0});ag.exports=sg});var hg=se((dS,lg)=>{"use strict";var d0=Date.prototype.getDay,g0=function(n){try{return d0.call(n),!0}catch{return!1}},m0=Object.prototype.toString,_0="[object Date]",y0=pl()();lg.exports=function(n){return typeof n!="object"||n===null?!1:y0?g0(n):m0.call(n)===_0}});var Lc=se((gS,wg)=>{var cg=ic(),fg=Od(),pg=Yd(),dg=$d(),gg=ug(),mg=hg(),_g=Date.prototype.getTime;function xg(r,n,s){var a=s||{};return(a.strict?pg(r,n):r===n)?!0:!r||!n||typeof r!="object"&&typeof n!="object"?a.strict?pg(r,n):r==n:v0(r,n,a)}function yg(r){return r==null}function vg(r){return!(!r||typeof r!="object"||typeof r.length!="number"||typeof r.copy!="function"||typeof r.slice!="function"||r.length>0&&typeof r[0]!="number")}function v0(r,n,s){var a,l;if(typeof r!=typeof n||yg(r)||yg(n)||r.prototype!==n.prototype||fg(r)!==fg(n))return!1;var c=dg(r),g=dg(n);if(c!==g)return!1;if(c||g)return r.source===n.source&&gg(r)===gg(n);if(mg(r)&&mg(n))return _g.call(r)===_g.call(n);var m=vg(r),v=vg(n);if(m!==v)return!1;if(m||v){if(r.length!==n.length)return!1;for(a=0;a=0;a--)if(x[a]!=P[a])return!1;for(a=x.length-1;a>=0;a--)if(l=x[a],!xg(r[l],n[l],s))return!1;return!0}wg.exports=xg});var Bc=se((wT,Tg)=>{var m1=Lc(),fs=function(r){this.precision=r&&r.precision?r.precision:17,this.direction=r&&r.direction?r.direction:!1,this.pseudoNode=r&&r.pseudoNode?r.pseudoNode:!1,this.objectComparator=r&&r.objectComparator?r.objectComparator:_1};fs.prototype.compare=function(r,n){if(r.type!==n.type||!kg(r,n))return!1;switch(r.type){case"Point":return this.compareCoord(r.coordinates,n.coordinates);case"LineString":return this.compareLine(r.coordinates,n.coordinates,0,!1);case"Polygon":return this.comparePolygon(r,n);case"Feature":return this.compareFeature(r,n);default:if(r.type.indexOf("Multi")===0){var s=this,a=Sg(r),l=Sg(n);return a.every(function(c){return this.some(function(g){return s.compare(c,g)})},l)}}return!1};function Sg(r){return r.coordinates.map(function(n){return{type:r.type.replace("Multi",""),coordinates:n}})}function kg(r,n){return r.hasOwnProperty("coordinates")?r.coordinates.length===n.coordinates.length:r.length===n.length}fs.prototype.compareCoord=function(r,n){if(r.length!==n.length)return!1;for(var s=0;s=0&&(s=[].concat(r.slice(a,r.length),r.slice(1,a+1))),s};fs.prototype.comparePath=function(r,n){var s=this;return r.every(function(a,l){return s.compareCoord(a,this[l])},n)};fs.prototype.comparePolygon=function(r,n){if(this.compareLine(r.coordinates[0],n.coordinates[0],1,!0)){var s=r.coordinates.slice(1,r.coordinates.length),a=n.coordinates.slice(1,n.coordinates.length),l=this;return s.every(function(c){return this.some(function(g){return l.compareLine(c,g,1,!0)})},a)}else return!1};fs.prototype.compareFeature=function(r,n){return r.id!==n.id||!this.objectComparator(r.properties,n.properties)||!this.compareBBox(r,n)?!1:this.compare(r.geometry,n.geometry)};fs.prototype.compareBBox=function(r,n){return!!(!r.bbox&&!n.bbox||r.bbox&&n.bbox&&this.compareCoord(r.bbox,n.bbox))};fs.prototype.removePseudo=function(r){return r};function _1(r,n){return m1(r,n,{strict:!0})}Tg.exports=fs});var Og=se((NT,El)=>{function qs(r,n,s,a){this.dataset=[],this.epsilon=1,this.minPts=2,this.distance=this._euclideanDistance,this.clusters=[],this.noise=[],this._visited=[],this._assigned=[],this._datasetLength=0,this._init(r,n,s,a)}qs.prototype.run=function(r,n,s,a){this._init(r,n,s,a);for(var l=0;l=this.minPts&&(n=this._mergeArrays(n,l))}this._assigned[a]!==1&&this._addToCluster(a,r)}};qs.prototype._addToCluster=function(r,n){this.clusters[n].push(r),this._assigned[r]=1};qs.prototype._regionQuery=function(r){for(var n=[],s=0;s{function Us(r,n,s){this.k=3,this.dataset=[],this.assignments=[],this.centroids=[],this.init(r,n,s)}Us.prototype.init=function(r,n,s){this.assignments=[],this.centroids=[],typeof r<"u"&&(this.dataset=r),typeof n<"u"&&(this.k=n),typeof s<"u"&&(this.distance=s)};Us.prototype.run=function(r,n){this.init(r,n);for(var s=this.dataset.length,a=0;a0){for(var v=0;v=0);return n};Us.prototype.assign=function(){for(var r=!1,n=this.dataset.length,s,a=0;a"u"&&(r[n]=[]),r[n].push(s);return r};Us.prototype.argmin=function(r,n,s){for(var a=Number.MAX_VALUE,l=0,c=n.length,g,m=0;m{function ps(r,n,s){this._queue=[],this._priorities=[],this._sorting="desc",this._init(r,n,s)}ps.prototype.insert=function(r,n){for(var s=this._queue.length,a=s;a--;){var l=this._priorities[a];this._sorting==="desc"?n>l&&(s=a):n{typeof Na<"u"&&Na.exports&&(Rg=Fc());var Rg;function Ss(r,n,s,a){this.epsilon=1,this.minPts=1,this.distance=this._euclideanDistance,this._reachability=[],this._processed=[],this._coreDistance=0,this._orderedList=[],this._init(r,n,s,a)}Ss.prototype.run=function(r,n,s,a){this._init(r,n,s,a);for(var l=0,c=this.dataset.length;l=this.minPts)return s}};Ss.prototype._regionQuery=function(r,n){n=n||this.epsilon;for(var s=[],a=0,l=this.dataset.length;a{typeof Cl<"u"&&Cl.exports&&(Cl.exports={DBSCAN:Og(),KMEANS:Ng(),OPTICS:Ag(),PriorityQueue:Fc()})});var zc=se((jT,Fg)=>{"use strict";Fg.exports={eudist:function(n,s,a){for(var l=n.length,c=0,g=0;g{"use strict";var zg=zc(),w1=zg.eudist,L1=zg.dist;Gg.exports={kmrand:function(n,s){for(var a={},l=[],c=s<<2,g=n.length,m=n[0].length>0;l.length0;){var v=n[Math.floor(Math.random()*g)],x=m?v.join("_"):""+v;a[x]||(a[x]=!0,l.push(v))}if(l.length0,m={},v=n[Math.floor(Math.random()*c)],x=g?v.join("_"):""+v;for(l.push(v),m[x]=!0;l.length{"use strict";var Gc=zc(),Hg=qg(),b1=Gc.eudist,XT=Gc.mandist,ZT=Gc.dist,E1=Hg.kmrand,M1=Hg.kmpp,Ug=1e4;function jg(r,n,s){s=s||[];for(var a=0;a0,q=[];if(s)s=="kmrand"?l=E1(r,n):s=="kmpp"?l=M1(r,n):l=s;else for(var z={};l.length{(function(r,n){typeof Zc=="object"&&typeof Yc<"u"?Yc.exports=n():typeof define=="function"&&define.amd?define(n):(r=typeof globalThis<"u"?globalThis:r||self,r.polygonClipping=n())})(Zc,function(){"use strict";function r(ht,Y){if(!(ht instanceof Y))throw new TypeError("Cannot call a class as a function")}function n(ht,Y){for(var C=0;CY?1:ht0){if(Y.right===null)break;if(C(ht,Y.right.key)>0){var J=Y.right;if(Y.right=J.left,J.left=Y,Y=J,Y.right===null)break}k.right=Y,k=Y,Y=Y.right}else break}return k.right=Y.left,F.left=Y.right,Y.left=b.right,Y.right=b.left,Y}function g(ht,Y,C,b){var k=new a(ht,Y);if(C===null)return k.left=k.right=null,k;C=c(ht,C,b);var F=b(ht,C.key);return F<0?(k.left=C.left,k.right=C,C.left=null):F>=0&&(k.right=C.right,k.left=C,C.right=null),k}function m(ht,Y,C){var b=null,k=null;if(Y){Y=c(ht,Y,C);var F=C(Y.key,ht);F===0?(b=Y.left,k=Y.right):F<0?(k=Y.right,Y.right=null,b=Y):(b=Y.left,Y.left=null,k=Y)}return{left:b,right:k}}function v(ht,Y,C){return Y===null?ht:(ht===null||(Y=c(ht.key,Y,C),Y.left=ht),Y)}function x(ht,Y,C,b,k){if(ht){b(""+Y+(C?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ")+k(ht)+` -`);var F=Y+(C?" ":"\u2502 ");ht.left&&x(ht.left,F,!1,b,k),ht.right&&x(ht.right,F,!0,b,k)}}var P=function(){function ht(Y){Y===void 0&&(Y=l),this._root=null,this._size=0,this._comparator=Y}return ht.prototype.insert=function(Y,C){return this._size++,this._root=g(Y,C,this._root,this._comparator)},ht.prototype.add=function(Y,C){var b=new a(Y,C);this._root===null&&(b.left=b.right=null,this._size++,this._root=b);var k=this._comparator,F=c(Y,this._root,k),Z=k(Y,F.key);return Z===0?this._root=F:(Z<0?(b.left=F.left,b.right=F,F.left=null):Z>0&&(b.right=F.right,b.left=F,F.right=null),this._size++,this._root=b),this._root},ht.prototype.remove=function(Y){this._root=this._remove(Y,this._root,this._comparator)},ht.prototype._remove=function(Y,C,b){var k;if(C===null)return null;C=c(Y,C,b);var F=b(Y,C.key);return F===0?(C.left===null?k=C.right:(k=c(Y,C.left,b),k.right=C.right),this._size--,k):C},ht.prototype.pop=function(){var Y=this._root;if(Y){for(;Y.left;)Y=Y.left;return this._root=c(Y.key,this._root,this._comparator),this._root=this._remove(Y.key,this._root,this._comparator),{key:Y.key,data:Y.data}}return null},ht.prototype.findStatic=function(Y){for(var C=this._root,b=this._comparator;C;){var k=b(Y,C.key);if(k===0)return C;k<0?C=C.left:C=C.right}return null},ht.prototype.find=function(Y){return this._root&&(this._root=c(Y,this._root,this._comparator),this._comparator(Y,this._root.key)!==0)?null:this._root},ht.prototype.contains=function(Y){for(var C=this._root,b=this._comparator;C;){var k=b(Y,C.key);if(k===0)return!0;k<0?C=C.left:C=C.right}return!1},ht.prototype.forEach=function(Y,C){for(var b=this._root,k=[],F=!1;!F;)b!==null?(k.push(b),b=b.left):k.length!==0?(b=k.pop(),Y.call(C,b),b=b.right):F=!0;return this},ht.prototype.range=function(Y,C,b,k){for(var F=[],Z=this._comparator,J=this._root,tt;F.length!==0||J;)if(J)F.push(J),J=J.left;else{if(J=F.pop(),tt=Z(J.key,C),tt>0)break;if(Z(J.key,Y)>=0&&b.call(k,J))return this;J=J.right}return this},ht.prototype.keys=function(){var Y=[];return this.forEach(function(C){var b=C.key;return Y.push(b)}),Y},ht.prototype.values=function(){var Y=[];return this.forEach(function(C){var b=C.data;return Y.push(b)}),Y},ht.prototype.min=function(){return this._root?this.minNode(this._root).key:null},ht.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},ht.prototype.minNode=function(Y){if(Y===void 0&&(Y=this._root),Y)for(;Y.left;)Y=Y.left;return Y},ht.prototype.maxNode=function(Y){if(Y===void 0&&(Y=this._root),Y)for(;Y.right;)Y=Y.right;return Y},ht.prototype.at=function(Y){for(var C=this._root,b=!1,k=0,F=[];!b;)if(C)F.push(C),C=C.left;else if(F.length>0){if(C=F.pop(),k===Y)return C;k++,C=C.right}else b=!0;return null},ht.prototype.next=function(Y){var C=this._root,b=null;if(Y.right){for(b=Y.right;b.left;)b=b.left;return b}for(var k=this._comparator;C;){var F=k(Y.key,C.key);if(F===0)break;F<0?(b=C,C=C.left):C=C.right}return b},ht.prototype.prev=function(Y){var C=this._root,b=null;if(Y.left!==null){for(b=Y.left;b.right;)b=b.right;return b}for(var k=this._comparator;C;){var F=k(Y.key,C.key);if(F===0)break;F<0?C=C.left:(b=C,C=C.right)}return b},ht.prototype.clear=function(){return this._root=null,this._size=0,this},ht.prototype.toList=function(){return q(this._root)},ht.prototype.load=function(Y,C,b){C===void 0&&(C=[]),b===void 0&&(b=!1);var k=Y.length,F=this._comparator;if(b&&R(Y,C,0,k-1,F),this._root===null)this._root=T(Y,C,0,k),this._size=k;else{var Z=j(this.toList(),N(Y,C),F);k=this._size+k,this._root=z({head:Z},0,k)}return this},ht.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(ht.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(ht.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),ht.prototype.toString=function(Y){Y===void 0&&(Y=function(k){return String(k.key)});var C=[];return x(this._root,"",!0,function(b){return C.push(b)},Y),C.join("")},ht.prototype.update=function(Y,C,b){var k=this._comparator,F=m(Y,this._root,k),Z=F.left,J=F.right;k(Y,C)<0?J=g(C,b,J,k):Z=g(C,b,Z,k),this._root=v(Z,J,k)},ht.prototype.split=function(Y){return m(Y,this._root,this._comparator)},ht}();function T(ht,Y,C,b){var k=b-C;if(k>0){var F=C+Math.floor(k/2),Z=ht[F],J=Y[F],tt=new a(Z,J);return tt.left=T(ht,Y,C,F),tt.right=T(ht,Y,F+1,b),tt}return null}function N(ht,Y){for(var C=new a(null,null),b=C,k=0;k0?(Y=F=F.next=C.pop(),Y=Y.right):b=!0;return F.next=null,k.next}function z(ht,Y,C){var b=C-Y;if(b>0){var k=Y+Math.floor(b/2),F=z(ht,Y,k),Z=ht.head;return Z.left=F,ht.head=ht.head.next,Z.right=z(ht,k+1,C),Z}return null}function j(ht,Y,C){for(var b=new a(null,null),k=b,F=ht,Z=Y;F!==null&&Z!==null;)C(F.key,Z.key)<0?(k.next=F,F=F.next):(k.next=Z,Z=Z.next),k=k.next;return F!==null?k.next=F:Z!==null&&(k.next=Z),b.next}function R(ht,Y,C,b,k){if(!(C>=b)){for(var F=ht[C+b>>1],Z=C-1,J=b+1;;){do Z++;while(k(ht[Z],F)<0);do J--;while(k(ht[J],F)>0);if(Z>=J)break;var tt=ht[Z];ht[Z]=ht[J],ht[J]=tt,tt=Y[Z],Y[Z]=Y[J],Y[J]=tt}R(ht,Y,C,J,k),R(ht,Y,J+1,b,k)}}var B=function(Y,C){return Y.ll.x<=C.x&&C.x<=Y.ur.x&&Y.ll.y<=C.y&&C.y<=Y.ur.y},D=function(Y,C){if(C.ur.xb.x?1:C.yb.y?1:0}}]);function ht(Y,C){r(this,ht),Y.events===void 0?Y.events=[this]:Y.events.push(this),this.point=Y,this.isLeft=C}return s(ht,[{key:"link",value:function(C){if(C.point===this.point)throw new Error("Tried to link already linked events");for(var b=C.point.events,k=0,F=b.length;k=0&&Ft>=0?LtWt?-1:0:pt<0&&Ft<0?LtWt?1:0:Ftpt?1:0}}}]),ht}(),Ct=0,st=function(){s(ht,null,[{key:"compare",value:function(C,b){var k=C.leftSE.point.x,F=b.leftSE.point.x,Z=C.rightSE.point.x,J=b.rightSE.point.x;if(Jtt&&pt>Lt)return-1;var Ft=C.comparePoint(b.leftSE.point);if(Ft<0)return 1;if(Ft>0)return-1;var Wt=b.comparePoint(C.rightSE.point);return Wt!==0?Wt:-1}if(k>F){if(ttpt&&tt>vt)return 1;var Jt=b.comparePoint(C.leftSE.point);if(Jt!==0)return Jt;var $t=C.comparePoint(b.rightSE.point);return $t<0?1:$t>0?-1:1}if(ttpt)return 1;if(ZJ){var ge=C.comparePoint(b.rightSE.point);if(ge<0)return 1;if(ge>0)return-1}if(Z!==J){var pe=Lt-tt,Te=Z-k,Ce=vt-pt,he=J-F;if(pe>Te&&Cehe)return-1}return Z>J?1:Zvt?1:C.idb.id?1:0}}]);function ht(Y,C,b,k){r(this,ht),this.id=++Ct,this.leftSE=Y,Y.segment=this,Y.otherSE=C,this.rightSE=C,C.segment=this,C.otherSE=Y,this.rings=b,this.windings=k}return s(ht,[{key:"replaceRightSE",value:function(C){this.rightSE=C,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var C=this.leftSE.point.y,b=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:Cb?C:b}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(C){return C.x===this.leftSE.point.x&&C.y===this.leftSE.point.y||C.x===this.rightSE.point.x&&C.y===this.rightSE.point.y}},{key:"comparePoint",value:function(C){if(this.isAnEndpoint(C))return 0;var b=this.leftSE.point,k=this.rightSE.point,F=this.vector();if(b.x===k.x)return C.x===b.x?0:C.x0&&tt.swapEvents(),ft.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),k&&(F.checkForConsuming(),Z.checkForConsuming()),b}},{key:"swapEvents",value:function(){var C=this.rightSE;this.rightSE=this.leftSE,this.leftSE=C,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var b=0,k=this.windings.length;b0){var Z=b;b=k,k=Z}if(b.prev===k){var J=b;b=k,k=J}for(var tt=0,pt=k.rings.length;tt0)F=b,Z=C,J=-1;else throw new Error("Tried to create degenerate segment at [".concat(C.x,", ").concat(C.y,"]"));var pt=new ft(F,!0),Lt=new ft(Z,!1);return new ht(pt,Lt,[k],[J])}}]),ht}(),Rt=function(){function ht(Y,C,b){if(r(this,ht),!Array.isArray(Y)||Y.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=C,this.isExterior=b,this.segments=[],typeof Y[0][0]!="number"||typeof Y[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var k=X.round(Y[0][0],Y[0][1]);this.bbox={ll:{x:k.x,y:k.y},ur:{x:k.x,y:k.y}};for(var F=k,Z=1,J=Y.length;Zthis.bbox.ur.x&&(this.bbox.ur.x=tt.x),tt.y>this.bbox.ur.y&&(this.bbox.ur.y=tt.y),F=tt)}(k.x!==F.x||k.y!==F.y)&&this.segments.push(st.fromRing(F,k,this))}return s(ht,[{key:"getSweepEvents",value:function(){for(var C=[],b=0,k=this.segments.length;bthis.bbox.ur.x&&(this.bbox.ur.x=F.bbox.ur.x),F.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=F.bbox.ur.y),this.interiorRings.push(F)}this.multiPoly=C}return s(ht,[{key:"getSweepEvents",value:function(){for(var C=this.exteriorRing.getSweepEvents(),b=0,k=this.interiorRings.length;bthis.bbox.ur.x&&(this.bbox.ur.x=F.bbox.ur.x),F.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=F.bbox.ur.y),this.polys.push(F)}this.isSubject=C}return s(ht,[{key:"getSweepEvents",value:function(){for(var C=[],b=0,k=this.polys.length;b0&&(C=F)}for(var Z=C.segment.prevInResult(),J=Z?Z.prevInResult():null;;){if(!Z)return null;if(!J)return Z.ringOut;if(J.ringOut!==Z.ringOut)return J.ringOut.enclosingRing()!==Z.ringOut?Z.ringOut:Z.ringOut.enclosingRing();Z=J.prevInResult(),J=Z?Z.prevInResult():null}}}]),ht}(),ce=function(){function ht(Y){r(this,ht),this.exteriorRing=Y,Y.poly=this,this.interiorRings=[]}return s(ht,[{key:"addInterior",value:function(C){this.interiorRings.push(C),C.poly=this}},{key:"getGeom",value:function(){var C=[this.exteriorRing.getGeom()];if(C[0]===null)return null;for(var b=0,k=this.interiorRings.length;b1&&arguments[1]!==void 0?arguments[1]:st.compare;r(this,ht),this.queue=Y,this.tree=new P(C),this.segments=[]}return s(ht,[{key:"process",value:function(C){var b=C.segment,k=[];if(C.consumedBy)return C.isLeft?this.queue.remove(C.otherSE):this.tree.remove(b),k;var F=C.isLeft?this.tree.insert(b):this.tree.find(b);if(!F)throw new Error("Unable to find segment #".concat(b.id," ")+"[".concat(b.leftSE.point.x,", ").concat(b.leftSE.point.y,"] -> ")+"[".concat(b.rightSE.point.x,", ").concat(b.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var Z=F,J=F,tt=void 0,pt=void 0;tt===void 0;)Z=this.tree.prev(Z),Z===null?tt=null:Z.key.consumedBy===void 0&&(tt=Z.key);for(;pt===void 0;)J=this.tree.next(J),J===null?pt=null:J.key.consumedBy===void 0&&(pt=J.key);if(C.isLeft){var Lt=null;if(tt){var vt=tt.getIntersection(b);if(vt!==null&&(b.isAnEndpoint(vt)||(Lt=vt),!tt.isAnEndpoint(vt)))for(var Ft=this._splitSafely(tt,vt),Wt=0,Jt=Ft.length;Wt0?(this.tree.remove(b),k.push(C)):(this.segments.push(b),b.prev=tt)}else{if(tt&&pt){var Dn=tt.getIntersection(pt);if(Dn!==null){if(!tt.isAnEndpoint(Dn))for(var Xn=this._splitSafely(tt,Dn),re=0,Vr=Xn.length;refe)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var he=new Cn($t),An=$t.size,we=$t.pop();we;){var St=we.key;if($t.size===An){var Dn=St.segment;throw new Error("Unable to pop() ".concat(St.isLeft?"left":"right"," SweepEvent ")+"[".concat(St.point.x,", ").concat(St.point.y,"] from segment #").concat(Dn.id," ")+"[".concat(Dn.leftSE.point.x,", ").concat(Dn.leftSE.point.y,"] -> ")+"[".concat(Dn.rightSE.point.x,", ").concat(Dn.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if($t.size>fe)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(he.segments.length>ke)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var Xn=he.process(St),re=0,Vr=Xn.length;re1?C-1:0),k=1;k1?C-1:0),k=1;k1?C-1:0),k=1;k1?C-1:0),k=1;k{(function(r,n){typeof Il=="object"&&typeof hm<"u"?n(Il):typeof define=="function"&&define.amd?define(["exports"],n):n(r.jsts={})})(Il,function(r){"use strict";function n(){}function s(t){this.message=t||""}function a(t){this.message=t||""}function l(t){this.message=t||""}function c(){}function g(t){return t===null?nr:t.color}function m(t){return t===null?null:t.parent}function v(t,e){t!==null&&(t.color=e)}function x(t){return t===null?null:t.left}function P(t){return t===null?null:t.right}function T(){this.root_=null,this.size_=0}function N(){}function q(){this.array_=[],arguments[0]instanceof he&&this.addAll(arguments[0])}function z(){}function j(t){this.message=t||""}function R(){this.array_=[]}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(t){if(this===void 0||this===null)throw new TypeError(this+" is not an object");var e=Object(this),o=Math.max(Math.min(e.length,9007199254740991),0)||0,u=1 in arguments&&parseInt(Number(arguments[1]),10)||0;u=u<0?Math.max(o+u,0):Math.min(u,o);var d=2 in arguments&&arguments[2]!==void 0?parseInt(Number(arguments[2]),10)||0:o;for(d=d<0?Math.max(o+arguments[2],0):Math.min(d,o);ue.x?1:this.ye.y?1:0},X.prototype.clone=function(){},X.prototype.copy=function(){return new X(this)},X.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},X.prototype.distance3D=function(t){var e=this.x-t.x,o=this.y-t.y,u=this.z-t.z;return Math.sqrt(e*e+o*o+u*u)},X.prototype.distance=function(t){var e=this.x-t.x,o=this.y-t.y;return Math.sqrt(e*e+o*o)},X.prototype.hashCode=function(){var t=17;return t=37*t+X.hashCode(this.x),t=37*t+X.hashCode(this.y)},X.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z},X.prototype.interfaces_=function(){return[H,K,n]},X.prototype.getClass=function(){return X},X.hashCode=function(){if(arguments.length===1){var t=arguments[0],e=A.doubleToLongBits(t);return Math.trunc((e^e)>>>32)}},lt.DimensionalComparator.get=function(){return gt},lt.serialVersionUID.get=function(){return 6683108902428367e3},lt.NULL_ORDINATE.get=function(){return A.NaN},lt.X.get=function(){return 0},lt.Y.get=function(){return 1},lt.Z.get=function(){return 2},Object.defineProperties(X,lt);var gt=function(t){if(this._dimensionsToTest=2,arguments.length!==0){if(arguments.length===1){var e=arguments[0];if(e!==2&&e!==3)throw new D("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}}};gt.prototype.compare=function(t,e){var o=t,u=e,d=gt.compare(o.x,u.x);if(d!==0)return d;var w=gt.compare(o.y,u.y);return w!==0?w:this._dimensionsToTest<=2?0:gt.compare(o.z,u.z)},gt.prototype.interfaces_=function(){return[et]},gt.prototype.getClass=function(){return gt},gt.compare=function(t,e){return te?1:A.isNaN(t)?A.isNaN(e)?0:-1:A.isNaN(e)?1:0};var Et=function(){};Et.prototype.create=function(){},Et.prototype.interfaces_=function(){return[]},Et.prototype.getClass=function(){return Et};var Q=function(){},kt={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};Q.prototype.interfaces_=function(){return[]},Q.prototype.getClass=function(){return Q},Q.toLocationSymbol=function(t){switch(t){case Q.EXTERIOR:return"e";case Q.BOUNDARY:return"b";case Q.INTERIOR:return"i";case Q.NONE:return"-"}throw new D("Unknown location value: "+t)},kt.INTERIOR.get=function(){return 0},kt.BOUNDARY.get=function(){return 1},kt.EXTERIOR.get=function(){return 2},kt.NONE.get=function(){return-1},Object.defineProperties(Q,kt);var ct=function(t,e){return t.interfaces_&&t.interfaces_().indexOf(e)>-1},bt=function(){},Mt={LOG_10:{configurable:!0}};bt.prototype.interfaces_=function(){return[]},bt.prototype.getClass=function(){return bt},bt.log10=function(t){var e=Math.log(t);return A.isInfinite(e)||A.isNaN(e)?e:e/bt.LOG_10},bt.min=function(t,e,o,u){var d=t;return eo?o:t}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var u=arguments[0],d=arguments[1],w=arguments[2];return uw?w:u}},bt.wrap=function(t,e){return t<0?e- -t%e:t%e},bt.max=function(){if(arguments.length===3){var t=arguments[0],e=arguments[1],o=arguments[2],u=t;return e>u&&(u=e),o>u&&(u=o),u}if(arguments.length===4){var d=arguments[0],w=arguments[1],S=arguments[2],U=arguments[3],$=d;return w>$&&($=w),S>$&&($=S),U>$&&($=U),$}},bt.average=function(t,e){return(t+e)/2},Mt.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(bt,Mt);var Xt=function(t){this.str=t};Xt.prototype.append=function(t){this.str+=t},Xt.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},Xt.prototype.toString=function(t){return this.str};var ft=function(t){this.value=t};ft.prototype.intValue=function(){return this.value},ft.prototype.compareTo=function(t){return this.valuet?1:0},ft.isNaN=function(t){return Number.isNaN(t)};var Ct=function(){};Ct.isWhitespace=function(t){return t<=32&&t>=0||t===127},Ct.toUpperCase=function(t){return t.toUpperCase()};var st=function t(){if(this._hi=0,this._lo=0,arguments.length===0)this.init(0);else if(arguments.length===1){if(typeof arguments[0]=="number"){var e=arguments[0];this.init(e)}else if(arguments[0]instanceof t){var o=arguments[0];this.init(o)}else if(typeof arguments[0]=="string"){var u=arguments[0];t.call(this,t.parse(u))}}else if(arguments.length===2){var d=arguments[0],w=arguments[1];this.init(d,w)}},Rt={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};st.prototype.le=function(t){return(this._hi9?(_t=!0,wt="9"):wt="0"+ut,S.append(wt),o=o.subtract(st.valueOf(ut)).multiply(st.TEN),_t&&o.selfAdd(st.TEN);var zt=!0,qt=st.magnitude(o._hi);if(qt<0&&Math.abs(qt)>=U-$&&(zt=!1),!zt)break}return e[0]=u,S.toString()},st.prototype.sqr=function(){return this.multiply(this)},st.prototype.doubleValue=function(){return this._hi+this._lo},st.prototype.subtract=function(){if(arguments[0]instanceof st){var t=arguments[0];return this.add(t.negate())}if(typeof arguments[0]=="number"){var e=arguments[0];return this.add(-e)}},st.prototype.equals=function(){if(arguments.length===1){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}},st.prototype.isZero=function(){return this._hi===0&&this._lo===0},st.prototype.selfSubtract=function(){if(arguments[0]instanceof st){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t._hi,-t._lo)}if(typeof arguments[0]=="number"){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e,0)}},st.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},st.prototype.min=function(t){return this.le(t)?this:t},st.prototype.selfDivide=function(){if(arguments.length===1){if(arguments[0]instanceof st){var t=arguments[0];return this.selfDivide(t._hi,t._lo)}if(typeof arguments[0]=="number"){var e=arguments[0];return this.selfDivide(e,0)}}else if(arguments.length===2){var o=arguments[0],u=arguments[1],d=null,w=null,S=null,U=null,$=null,ut=null,_t=null,wt=null;return $=this._hi/o,ut=st.SPLIT*$,d=ut-$,wt=st.SPLIT*o,d=ut-d,w=$-d,S=wt-o,_t=$*o,S=wt-S,U=o-S,wt=d*S-_t+d*U+w*S+w*U,ut=(this._hi-_t-wt+this._lo-$*u)/o,wt=$+ut,this._hi=wt,this._lo=$-wt+ut,this}},st.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},st.prototype.divide=function(){if(arguments[0]instanceof st){var t=arguments[0],e=null,o=null,u=null,d=null,w=null,S=null,U=null,$=null;return o=(w=this._hi/t._hi)-(e=(S=st.SPLIT*w)-(e=S-w)),$=e*(u=($=st.SPLIT*t._hi)-(u=$-t._hi))-(U=w*t._hi)+e*(d=t._hi-u)+o*u+o*d,S=(this._hi-U-$+this._lo-w*t._lo)/t._hi,new st($=w+S,w-$+S)}if(typeof arguments[0]=="number"){var ut=arguments[0];return A.isNaN(ut)?st.createNaN():st.copy(this).selfDivide(ut,0)}},st.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo},st.prototype.pow=function(t){if(t===0)return st.valueOf(1);var e=new st(this),o=st.valueOf(1),u=Math.abs(t);if(u>1)for(;u>0;)u%2==1&&o.selfMultiply(e),(u/=2)>0&&(e=e.sqr());else o=e;return t<0?o.reciprocal():o},st.prototype.ceil=function(){if(this.isNaN())return st.NaN;var t=Math.ceil(this._hi),e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new st(t,e)},st.prototype.compareTo=function(t){var e=t;return this._hie._hi?1:this._loe._lo?1:0},st.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},st.prototype.setValue=function(){if(arguments[0]instanceof st){var t=arguments[0];return this.init(t),this}if(typeof arguments[0]=="number"){var e=arguments[0];return this.init(e),this}},st.prototype.max=function(t){return this.ge(t)?this:t},st.prototype.sqrt=function(){if(this.isZero())return st.valueOf(0);if(this.isNegative())return st.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,o=st.valueOf(e),u=this.subtract(o.sqr())._hi*(.5*t);return o.add(u)},st.prototype.selfAdd=function(){if(arguments.length===1){if(arguments[0]instanceof st){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}if(typeof arguments[0]=="number"){var e=arguments[0],o=null,u=null,d=null,w=null,S=null,U=null;return d=this._hi+e,S=d-this._hi,w=d-S,w=e-S+(this._hi-w),U=w+this._lo,o=d+U,u=U+(d-o),this._hi=o+u,this._lo=u+(o-this._hi),this}}else if(arguments.length===2){var $=arguments[0],ut=arguments[1],_t=null,wt=null,zt=null,qt=null,ne=null,oe=null,In=null;qt=this._hi+$,wt=this._lo+ut,ne=qt-(oe=qt-this._hi),zt=wt-(In=wt-this._lo);var xr=(_t=qt+(oe=(ne=$-oe+(this._hi-ne))+wt))+(oe=(zt=ut-In+(this._lo-zt))+(oe+(qt-_t))),vi=oe+(_t-xr);return this._hi=xr,this._lo=vi,this}},st.prototype.selfMultiply=function(){if(arguments.length===1){if(arguments[0]instanceof st){var t=arguments[0];return this.selfMultiply(t._hi,t._lo)}if(typeof arguments[0]=="number"){var e=arguments[0];return this.selfMultiply(e,0)}}else if(arguments.length===2){var o=arguments[0],u=arguments[1],d=null,w=null,S=null,U=null,$=null,ut=null;d=($=st.SPLIT*this._hi)-this._hi,ut=st.SPLIT*o,d=$-d,w=this._hi-d,S=ut-o;var _t=($=this._hi*o)+(ut=d*(S=ut-S)-$+d*(U=o-S)+w*S+w*U+(this._hi*u+this._lo*o)),wt=ut+(d=$-_t);return this._hi=_t,this._lo=wt,this}},st.prototype.selfSqr=function(){return this.selfMultiply(this)},st.prototype.floor=function(){if(this.isNaN())return st.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new st(t,e)},st.prototype.negate=function(){return this.isNaN()?this:new st(-this._hi,-this._lo)},st.prototype.clone=function(){},st.prototype.multiply=function(){if(arguments[0]instanceof st){var t=arguments[0];return t.isNaN()?st.createNaN():st.copy(this).selfMultiply(t)}if(typeof arguments[0]=="number"){var e=arguments[0];return A.isNaN(e)?st.createNaN():st.copy(this).selfMultiply(e,0)}},st.prototype.isNaN=function(){return A.isNaN(this._hi)},st.prototype.intValue=function(){return Math.trunc(this._hi)},st.prototype.toString=function(){var t=st.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()},st.prototype.toStandardNotation=function(){var t=this.getSpecialNumberString();if(t!==null)return t;var e=new Array(1).fill(null),o=this.extractSignificantDigits(!0,e),u=e[0]+1,d=o;if(o.charAt(0)===".")d="0"+o;else if(u<0)d="0."+st.stringOfChar("0",-u)+o;else if(o.indexOf(".")===-1){var w=u-o.length;d=o+st.stringOfChar("0",w)+".0"}return this.isNegative()?"-"+d:d},st.prototype.reciprocal=function(){var t=null,e=null,o=null,u=null,d=null,w=null,S=null,U=null;e=(d=1/this._hi)-(t=(w=st.SPLIT*d)-(t=w-d)),o=(U=st.SPLIT*this._hi)-this._hi;var $=d+(w=(1-(S=d*this._hi)-(U=t*(o=U-o)-S+t*(u=this._hi-o)+e*o+e*u)-d*this._lo)/this._hi);return new st($,d-$+w)},st.prototype.toSciNotation=function(){if(this.isZero())return st.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(t!==null)return t;var e=new Array(1).fill(null),o=this.extractSignificantDigits(!1,e),u=st.SCI_NOT_EXPONENT_CHAR+e[0];if(o.charAt(0)==="0")throw new Error("Found leading zero: "+o);var d="";o.length>1&&(d=o.substring(1));var w=o.charAt(0)+"."+d;return this.isNegative()?"-"+w+u:w+u},st.prototype.abs=function(){return this.isNaN()?st.NaN:this.isNegative()?this.negate():new st(this)},st.prototype.isPositive=function(){return(this._hi>0||this._hi===0)&&this._lo>0},st.prototype.lt=function(t){return(this._hit._hi||this._hi===t._hi)&&this._lo>t._lo},st.prototype.isNegative=function(){return(this._hi<0||this._hi===0)&&this._lo<0},st.prototype.trunc=function(){return this.isNaN()?st.NaN:this.isPositive()?this.floor():this.ceil()},st.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},st.prototype.interfaces_=function(){return[n,H,K]},st.prototype.getClass=function(){return st},st.sqr=function(t){return st.valueOf(t).selfMultiply(t)},st.valueOf=function(){if(typeof arguments[0]=="string"){var t=arguments[0];return st.parse(t)}if(typeof arguments[0]=="number"){var e=arguments[0];return new st(e)}},st.sqrt=function(t){return st.valueOf(t).sqrt()},st.parse=function(t){for(var e=0,o=t.length;Ct.isWhitespace(t.charAt(e));)e++;var u=!1;if(e=o);){var ut=t.charAt(e);if(e++,Ct.isDigit(ut)){var _t=ut-"0";w.selfMultiply(st.TEN),w.selfAdd(_t),S++}else{if(ut!=="."){if(ut==="e"||ut==="E"){var wt=t.substring(e);try{$=ft.parseInt(wt)}catch(In){throw In instanceof Error?new Error("Invalid exponent "+wt+" in string "+t):In}break}throw new Error("Unexpected character '"+ut+"' at position "+e+" in string "+t)}U=S}}var zt=w,qt=S-U-$;if(qt===0)zt=w;else if(qt>0){var ne=st.TEN.pow(qt);zt=w.divide(ne)}else if(qt<0){var oe=st.TEN.pow(-qt);zt=w.multiply(oe)}return u?zt.negate():zt},st.createNaN=function(){return new st(A.NaN,A.NaN)},st.copy=function(t){return new st(t)},st.magnitude=function(t){var e=Math.abs(t),o=Math.log(e)/Math.log(10),u=Math.trunc(Math.floor(o));return 10*Math.pow(10,u)<=e&&(u+=1),u},st.stringOfChar=function(t,e){for(var o=new Xt,u=0;u0){if(w<=0)return Ot.signum(S);u=d+w}else{if(!(d<0)||w>=0)return Ot.signum(S);u=-d-w}var U=Ot.DP_SAFE_EPSILON*u;return S>=U||-S>=U?Ot.signum(S):2},Ot.signum=function(t){return t>0?1:t<0?-1:0},Qt.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(Ot,Qt);var Tt=function(){},ce={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};ce.X.get=function(){return 0},ce.Y.get=function(){return 1},ce.Z.get=function(){return 2},ce.M.get=function(){return 3},Tt.prototype.setOrdinate=function(t,e,o){},Tt.prototype.size=function(){},Tt.prototype.getOrdinate=function(t,e){},Tt.prototype.getCoordinate=function(){},Tt.prototype.getCoordinateCopy=function(t){},Tt.prototype.getDimension=function(){},Tt.prototype.getX=function(t){},Tt.prototype.clone=function(){},Tt.prototype.expandEnvelope=function(t){},Tt.prototype.copy=function(){},Tt.prototype.getY=function(t){},Tt.prototype.toCoordinateArray=function(){},Tt.prototype.interfaces_=function(){return[K]},Tt.prototype.getClass=function(){return Tt},Object.defineProperties(Tt,ce);var Re=function(){},Cn=function(t){function e(){t.call(this,"Projective point not representable on the Cartesian plane.")}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Re),fe=function(){};fe.arraycopy=function(t,e,o,u,d){for(var w=0,S=e;St._minx?this._minx:t._minx,o=this._miny>t._miny?this._miny:t._miny,u=this._maxx=this._minx&&e.getMaxX()<=this._maxx&&e.getMinY()>=this._miny&&e.getMaxY()<=this._maxy}}else if(arguments.length===2){var o=arguments[0],u=arguments[1];return!this.isNull()&&o>=this._minx&&o<=this._maxx&&u>=this._miny&&u<=this._maxy}},Bt.prototype.intersects=function(){if(arguments.length===1){if(arguments[0]instanceof Bt){var t=arguments[0];return!this.isNull()&&!t.isNull()&&!(t._minx>this._maxx||t._maxxthis._maxy||t._maxythis._maxx||othis._maxy||uthis._maxx&&(this._maxx=e._maxx),e._minythis._maxy&&(this._maxy=e._maxy))}}else if(arguments.length===2){var o=arguments[0],u=arguments[1];this.isNull()?(this._minx=o,this._maxx=o,this._miny=u,this._maxy=u):(othis._maxx&&(this._maxx=o),uthis._maxy&&(this._maxy=u))}},Bt.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return te._minx?1:this._minye._miny?1:this._maxxe._maxx?1:this._maxye._maxy?1:0},Bt.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},Bt.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},Bt.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},Bt.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},Bt.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},Bt.prototype.expandBy=function(){if(arguments.length===1){var t=arguments[0];this.expandBy(t,t)}else if(arguments.length===2){var e=arguments[0],o=arguments[1];if(this.isNull())return null;this._minx-=e,this._maxx+=e,this._miny-=o,this._maxy+=o,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},Bt.prototype.contains=function(){if(arguments.length===1){if(arguments[0]instanceof Bt){var t=arguments[0];return this.covers(t)}if(arguments[0]instanceof X){var e=arguments[0];return this.covers(e)}}else if(arguments.length===2){var o=arguments[0],u=arguments[1];return this.covers(o,u)}},Bt.prototype.centre=function(){return this.isNull()?null:new X((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},Bt.prototype.init=function(){if(arguments.length===0)this.setToNull();else if(arguments.length===1){if(arguments[0]instanceof X){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof Bt){var e=arguments[0];this._minx=e._minx,this._maxx=e._maxx,this._miny=e._miny,this._maxy=e._maxy}}else if(arguments.length===2){var o=arguments[0],u=arguments[1];this.init(o.x,u.x,o.y,u.y)}else if(arguments.length===4){var d=arguments[0],w=arguments[1],S=arguments[2],U=arguments[3];dt._maxx&&(e=this._minx-t._maxx);var o=0;return this._maxyt._maxy&&(o=this._miny-t._maxy),e===0?o:o===0?e:Math.sqrt(e*e+o*o)},Bt.prototype.hashCode=function(){var t=17;return t=37*t+X.hashCode(this._minx),t=37*t+X.hashCode(this._maxx),t=37*t+X.hashCode(this._miny),t=37*t+X.hashCode(this._maxy)},Bt.prototype.interfaces_=function(){return[H,n]},Bt.prototype.getClass=function(){return Bt},Bt.intersects=function(){if(arguments.length===3){var t=arguments[0],e=arguments[1],o=arguments[2];return o.x>=(t.xe.x?t.x:e.x)&&o.y>=(t.ye.y?t.y:e.y)}if(arguments.length===4){var u=arguments[0],d=arguments[1],w=arguments[2],S=arguments[3],U=Math.min(w.x,S.x),$=Math.max(w.x,S.x),ut=Math.min(u.x,d.x),_t=Math.max(u.x,d.x);return!(ut>$)&&!(_t$)&&!(_tthis.getEdgeDistance(t,1)?(this._intLineIndex[t][0]=0,this._intLineIndex[t][1]=1):(this._intLineIndex[t][0]=1,this._intLineIndex[t][1]=0)}},b.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},b.prototype.setPrecisionModel=function(t){this._precisionModel=t},b.prototype.isInteriorIntersection=function(){if(arguments.length===0)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(arguments.length===1){for(var t=arguments[0],e=0;ed?u:d;else{var S=Math.abs(t.x-e.x),U=Math.abs(t.y-e.y);(w=u>d?S:U)!==0||t.equals(e)||(w=Math.max(S,U))}return C.isTrue(!(w===0&&!t.equals(e)),"Bad distance calculation"),w},b.nonRobustComputeEdgeDistance=function(t,e,o){var u=t.x-e.x,d=t.y-e.y,w=Math.sqrt(u*u+d*d);return C.isTrue(!(w===0&&!t.equals(e)),"Invalid distance calculation"),w},k.DONT_INTERSECT.get=function(){return 0},k.DO_INTERSECT.get=function(){return 1},k.COLLINEAR.get=function(){return 2},k.NO_INTERSECTION.get=function(){return 0},k.POINT_INTERSECTION.get=function(){return 1},k.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(b,k);var F=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isInSegmentEnvelopes=function(o){var u=new Bt(this._inputLines[0][0],this._inputLines[0][1]),d=new Bt(this._inputLines[1][0],this._inputLines[1][1]);return u.contains(o)&&d.contains(o)},e.prototype.computeIntersection=function(){if(arguments.length!==3)return t.prototype.computeIntersection.apply(this,arguments);var o=arguments[0],u=arguments[1],d=arguments[2];if(this._isProper=!1,Bt.intersects(u,d,o)&&tt.orientationIndex(u,d,o)===0&&tt.orientationIndex(d,u,o)===0)return this._isProper=!0,(o.equals(u)||o.equals(d))&&(this._isProper=!1),this._result=t.POINT_INTERSECTION,null;this._result=t.NO_INTERSECTION},e.prototype.normalizeToMinimum=function(o,u,d,w,S){S.x=this.smallestInAbsValue(o.x,u.x,d.x,w.x),S.y=this.smallestInAbsValue(o.y,u.y,d.y,w.y),o.x-=S.x,o.y-=S.y,u.x-=S.x,u.y-=S.y,d.x-=S.x,d.y-=S.y,w.x-=S.x,w.y-=S.y},e.prototype.safeHCoordinateIntersection=function(o,u,d,w){var S=null;try{S=ke.intersection(o,u,d,w)}catch(U){if(!(U instanceof Cn))throw U;S=e.nearestEndpoint(o,u,d,w)}return S},e.prototype.intersection=function(o,u,d,w){var S=this.intersectionWithNormalization(o,u,d,w);return this.isInSegmentEnvelopes(S)||(S=new X(e.nearestEndpoint(o,u,d,w))),this._precisionModel!==null&&this._precisionModel.makePrecise(S),S},e.prototype.smallestInAbsValue=function(o,u,d,w){var S=o,U=Math.abs(S);return Math.abs(u)1e-4&&fe.out.println("Distance = "+S.distance(U))},e.prototype.intersectionWithNormalization=function(o,u,d,w){var S=new X(o),U=new X(u),$=new X(d),ut=new X(w),_t=new X;this.normalizeToEnvCentre(S,U,$,ut,_t);var wt=this.safeHCoordinateIntersection(S,U,$,ut);return wt.x+=_t.x,wt.y+=_t.y,wt},e.prototype.computeCollinearIntersection=function(o,u,d,w){var S=Bt.intersects(o,u,d),U=Bt.intersects(o,u,w),$=Bt.intersects(d,w,o),ut=Bt.intersects(d,w,u);return S&&U?(this._intPt[0]=d,this._intPt[1]=w,t.COLLINEAR_INTERSECTION):$&&ut?(this._intPt[0]=o,this._intPt[1]=u,t.COLLINEAR_INTERSECTION):S&&$?(this._intPt[0]=d,this._intPt[1]=o,!d.equals(o)||U||ut?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):S&&ut?(this._intPt[0]=d,this._intPt[1]=u,!d.equals(u)||U||$?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):U&&$?(this._intPt[0]=w,this._intPt[1]=o,!w.equals(o)||S||ut?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):U&&ut?(this._intPt[0]=w,this._intPt[1]=u,!w.equals(u)||S||$?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):t.NO_INTERSECTION},e.prototype.normalizeToEnvCentre=function(o,u,d,w,S){var U=o.xu.x?o.x:u.x,_t=o.y>u.y?o.y:u.y,wt=d.xw.x?d.x:w.x,ne=d.y>w.y?d.y:w.y,oe=((U>wt?U:wt)+(utzt?$:zt)+(_t0&&U>0||S<0&&U<0)return t.NO_INTERSECTION;var $=tt.orientationIndex(d,w,o),ut=tt.orientationIndex(d,w,u);return $>0&&ut>0||$<0&&ut<0?t.NO_INTERSECTION:S===0&&U===0&&$===0&&ut===0?this.computeCollinearIntersection(o,u,d,w):(S===0||U===0||$===0||ut===0?(this._isProper=!1,o.equals2D(d)||o.equals2D(w)?this._intPt[0]=o:u.equals2D(d)||u.equals2D(w)?this._intPt[0]=u:S===0?this._intPt[0]=new X(d):U===0?this._intPt[0]=new X(w):$===0?this._intPt[0]=new X(o):ut===0&&(this._intPt[0]=new X(u))):(this._isProper=!0,this._intPt[0]=this.intersection(o,u,d,w)),t.POINT_INTERSECTION)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.nearestEndpoint=function(o,u,d,w){var S=o,U=tt.distancePointLine(o,d,w),$=tt.distancePointLine(u,d,w);return $0?o>0?-d:d:o>0?d:-d;if(e===0||o===0)return u>0?t>0?d:-d:t>0?-d:d;if(e>0?u>0?e<=u||(d=-d,w=t,t=o,o=w,w=e,e=u,u=w):e<=-u?(d=-d,o=-o,u=-u):(w=t,t=-o,o=w,w=e,e=-u,u=w):u>0?-e<=u?(d=-d,t=-t,e=-e):(w=-t,t=o,o=w,w=-e,e=u,u=w):e>=u?(t=-t,e=-e,o=-o,u=-u):(d=-d,w=-t,t=-o,o=w,w=-e,e=-u,u=w),t>0){if(!(o>0)||!(t<=o))return d}else{if(o>0||!(t>=o))return-d;d=-d,t=-t,o=-o}for(;;){if(S=Math.floor(o/t),o-=S*t,(u-=S*e)<0)return-d;if(u>e)return d;if(t>o+o){if(eu+u)return-d;o=t-o,u=e-u,d=-d}if(u===0)return o===0?0:-d;if(o===0||(S=Math.floor(t/o),t-=S*o,(e-=S*u)<0))return d;if(e>u)return-d;if(o>t+t){if(ue+e)return d;t=o-t,e=u-e,d=-d}if(e===0)return t===0?0:d;if(t===0)return-d}};var J=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t};J.prototype.countSegment=function(t,e){if(t.xu&&(o=e.x,u=t.x),this._p.x>=o&&this._p.x<=u&&(this._isPointOnSegment=!0),null}if(t.y>this._p.y&&e.y<=this._p.y||e.y>this._p.y&&t.y<=this._p.y){var d=t.x-this._p.x,w=t.y-this._p.y,S=e.x-this._p.x,U=e.y-this._p.y,$=Z.signOfDet2x2(d,w,S,U);if($===0)return this._isPointOnSegment=!0,null;U0&&this._crossingCount++}},J.prototype.isPointInPolygon=function(){return this.getLocation()!==Q.EXTERIOR},J.prototype.getLocation=function(){return this._isPointOnSegment?Q.BOUNDARY:this._crossingCount%2==1?Q.INTERIOR:Q.EXTERIOR},J.prototype.isOnSegment=function(){return this._isPointOnSegment},J.prototype.interfaces_=function(){return[]},J.prototype.getClass=function(){return J},J.locatePointInRing=function(){if(arguments[0]instanceof X&&ct(arguments[1],Tt)){for(var t=arguments[0],e=arguments[1],o=new J(t),u=new X,d=new X,w=1;w1||U<0||U>1)&&(d=!0)}}else d=!0;return d?bt.min(tt.distancePointLine(t,o,u),tt.distancePointLine(e,o,u),tt.distancePointLine(o,t,e),tt.distancePointLine(u,t,e)):0},tt.isPointInRing=function(t,e){return tt.locatePointInRing(t,e)!==Q.EXTERIOR},tt.computeLength=function(t){var e=t.size();if(e<=1)return 0;var o=0,u=new X;t.getCoordinate(0,u);for(var d=u.x,w=u.y,S=1;So.y&&(o=w,u=d)}var S=u;do(S-=1)<0&&(S=e);while(t[S].equals2D(o)&&S!==u);var U=u;do U=(U+1)%e;while(t[U].equals2D(o)&&U!==u);var $=t[S],ut=t[U];if($.equals2D(o)||ut.equals2D(o)||$.equals2D(ut))return!1;var _t=tt.computeOrientation($,o,ut),wt=!1;return wt=_t===0?$.x>ut.x:_t>0,wt},tt.locatePointInRing=function(t,e){return J.locatePointInRing(t,e)},tt.distancePointLinePerpendicular=function(t,e,o){var u=(o.x-e.x)*(o.x-e.x)+(o.y-e.y)*(o.y-e.y),d=((e.y-t.y)*(o.x-e.x)-(e.x-t.x)*(o.y-e.y))/u;return Math.abs(d)*Math.sqrt(u)},tt.computeOrientation=function(t,e,o){return tt.orientationIndex(t,e,o)},tt.distancePointLine=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];if(e.length===0)throw new D("Line array must contain at least one vertex");for(var o=t.distance(e[0]),u=0;u=1)return w.distance(U);var _t=((S.y-w.y)*(U.x-S.x)-(S.x-w.x)*(U.y-S.y))/$;return Math.abs(_t)*Math.sqrt($)}},tt.isOnLine=function(t,e){for(var o=new F,u=1;u0},pe.prototype.interfaces_=function(){return[$t]},pe.prototype.getClass=function(){return pe};var Te=function(){};Te.prototype.isInBoundary=function(t){return t>1},Te.prototype.interfaces_=function(){return[$t]},Te.prototype.getClass=function(){return Te};var Ce=function(){};Ce.prototype.isInBoundary=function(t){return t===1},Ce.prototype.interfaces_=function(){return[$t]},Ce.prototype.getClass=function(){return Ce};var he=function(){};he.prototype.add=function(){},he.prototype.addAll=function(){},he.prototype.isEmpty=function(){},he.prototype.iterator=function(){},he.prototype.size=function(){},he.prototype.toArray=function(){},he.prototype.remove=function(){},(s.prototype=new Error).name="IndexOutOfBoundsException";var An=function(){};An.prototype.hasNext=function(){},An.prototype.next=function(){},An.prototype.remove=function(){};var we=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(){},e.prototype.set=function(){},e.prototype.isEmpty=function(){},e}(he);(a.prototype=new Error).name="NoSuchElementException";var St=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof he&&this.addAll(arguments[0])}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.ensureCapacity=function(){},e.prototype.interfaces_=function(){return[t,he]},e.prototype.add=function(o){return arguments.length===1?this.array_.push(o):this.array_.splice(arguments[0],arguments[1]),!0},e.prototype.clear=function(){this.array_=[]},e.prototype.addAll=function(o){for(var u=o.iterator();u.hasNext();)this.add(u.next());return!0},e.prototype.set=function(o,u){var d=this.array_[o];return this.array_[o]=u,d},e.prototype.iterator=function(){return new Dn(this)},e.prototype.get=function(o){if(o<0||o>=this.size())throw new s;return this.array_[o]},e.prototype.isEmpty=function(){return this.array_.length===0},e.prototype.size=function(){return this.array_.length},e.prototype.toArray=function(){for(var o=[],u=0,d=this.array_.length;u=1&&this.get(this.size()-1).equals2D(S))return null;t.prototype.add.call(this,S)}else if(arguments[0]instanceof Object&&typeof arguments[1]=="boolean"){var U=arguments[0],$=arguments[1];return this.add(U,$),!0}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var ut=arguments[0],_t=arguments[1];if(arguments[2])for(var wt=0;wt=0;zt--)this.add(ut[zt],_t);return!0}if(typeof arguments[2]=="boolean"&&Number.isInteger(arguments[0])&&arguments[1]instanceof X){var qt=arguments[0],ne=arguments[1];if(!arguments[2]){var oe=this.size();if(oe>0&&(qt>0&&this.get(qt-1).equals2D(ne)||qtXo&&(Es=-1);for(var rh=vi;rh!==Xo;rh+=Es)this.add(In[rh],xr);return!0}},e.prototype.closeRing=function(){this.size()>0&&this.add(new X(this.get(0)),!1)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},Object.defineProperties(e,o),e}(St),re=function(){},Vr={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};Vr.ForwardComparator.get=function(){return zn},Vr.BidirectionalComparator.get=function(){return cn},Vr.coordArrayType.get=function(){return new Array(0).fill(null)},re.prototype.interfaces_=function(){return[]},re.prototype.getClass=function(){return re},re.isRing=function(t){return!(t.length<4)&&!!t[0].equals2D(t[t.length-1])},re.ptNotInList=function(t,e){for(var o=0;o=t?e:[]},re.indexOf=function(t,e){for(var o=0;o0)&&(e=t[o]);return e},re.extract=function(t,e,o){e=bt.clamp(e,0,t.length);var u=(o=bt.clamp(o,-1,t.length))-e+1;o<0&&(u=0),e>=t.length&&(u=0),ou.length)return 1;if(o.length===0)return 0;var d=re.compare(o,u);return re.isEqualReversed(o,u)?0:d},cn.prototype.OLDcompare=function(t,e){var o=t,u=e;if(o.lengthu.length)return 1;if(o.length===0)return 0;for(var d=re.increasingDirection(o),w=re.increasingDirection(u),S=d>0?0:o.length-1,U=w>0?0:o.length-1,$=0;$0))return e.value;e=e.right}}return null},T.prototype.put=function(t,e){if(this.root_===null)return this.root_={key:t,value:e,left:null,right:null,parent:null,color:nr,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var o,u,d=this.root_;do if(o=d,(u=t.compareTo(d.key))<0)d=d.left;else{if(!(u>0)){var w=d.value;return d.value=e,w}d=d.right}while(d!==null);var S={key:t,left:null,right:null,value:e,parent:o,color:nr,getValue:function(){return this.value},getKey:function(){return this.key}};return u<0?o.left=S:o.right=S,this.fixAfterInsertion(S),this.size_++,null},T.prototype.fixAfterInsertion=function(t){for(t.color=1;t!=null&&t!==this.root_&&t.parent.color===1;)if(m(t)===x(m(m(t)))){var e=P(m(m(t)));g(e)===1?(v(m(t),nr),v(e,nr),v(m(m(t)),1),t=m(m(t))):(t===P(m(t))&&(t=m(t),this.rotateLeft(t)),v(m(t),nr),v(m(m(t)),1),this.rotateRight(m(m(t))))}else{var o=x(m(m(t)));g(o)===1?(v(m(t),nr),v(o,nr),v(m(m(t)),1),t=m(m(t))):(t===x(m(t))&&(t=m(t),this.rotateRight(t)),v(m(t),nr),v(m(m(t)),1),this.rotateLeft(m(m(t))))}this.root_.color=nr},T.prototype.values=function(){var t=new St,e=this.getFirstEntry();if(e!==null)for(t.add(e.value);(e=T.successor(e))!==null;)t.add(e.value);return t},T.prototype.entrySet=function(){var t=new wo,e=this.getFirstEntry();if(e!==null)for(t.add(e);(e=T.successor(e))!==null;)t.add(e);return t},T.prototype.rotateLeft=function(t){if(t!=null){var e=t.right;t.right=e.left,e.left!=null&&(e.left.parent=t),e.parent=t.parent,t.parent===null?this.root_=e:t.parent.left===t?t.parent.left=e:t.parent.right=e,e.left=t,t.parent=e}},T.prototype.rotateRight=function(t){if(t!=null){var e=t.left;t.left=e.right,e.right!=null&&(e.right.parent=t),e.parent=t.parent,t.parent===null?this.root_=e:t.parent.right===t?t.parent.right=e:t.parent.left=e,e.right=t,t.parent=e}},T.prototype.getFirstEntry=function(){var t=this.root_;if(t!=null)for(;t.left!=null;)t=t.left;return t},T.successor=function(t){if(t===null)return null;if(t.right!==null){for(var e=t.right;e.left!==null;)e=e.left;return e}for(var o=t.parent,u=t;o!==null&&u===o.right;)u=o,o=o.parent;return o},T.prototype.size=function(){return this.size_};var Ut=function(){};Ut.prototype.interfaces_=function(){return[]},Ut.prototype.getClass=function(){return Ut},N.prototype=new c,(q.prototype=new N).contains=function(t){for(var e=0,o=this.array_.length;e=0;){var S=d.substring(0,w);u.add(S),w=(d=d.substring(w+o)).indexOf(e)}d.length>0&&u.add(d);for(var U=new Array(u.size()).fill(null),$=0;$0)for(var w=d;w0&&u.append(" ");for(var w=0;w0&&u.append(","),u.append(rr.toString(t.getOrdinate(d,w)))}return u.append(")"),u.toString()}},Ln.ensureValidRing=function(t,e){var o=e.size();return o===0?e:o<=3?Ln.createClosedRing(t,e,4):e.getOrdinate(0,Tt.X)===e.getOrdinate(o-1,Tt.X)&&e.getOrdinate(0,Tt.Y)===e.getOrdinate(o-1,Tt.Y)?e:Ln.createClosedRing(t,e,o+1)},Ln.createClosedRing=function(t,e,o){var u=t.create(o,e.getDimension()),d=e.size();Ln.copy(e,0,u,0,d);for(var w=d;w0&&Ln.reverse(this._points),null}},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?xe.FALSE:0},e.prototype.isClosed=function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},e.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},e.prototype.getDimension=function(){return 1},e.prototype.getLength=function(){return tt.computeLength(this._points)},e.prototype.getNumPoints=function(){return this._points.size()},e.prototype.reverse=function(){var u=this._points.copy();return Ln.reverse(u),this.getFactory().createLineString(u)},e.prototype.compareToSameClass=function(){if(arguments.length===1){for(var u=arguments[0],d=0,w=0;d= 2)");this._points=u},e.prototype.isCoordinate=function(u){for(var d=0;d=1&&this.getCoordinateSequence().size()= 4)")},e.prototype.getGeometryType=function(){return"LinearRing"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},o.MINIMUM_VALID_SIZE.get=function(){return 4},o.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(e,o),e}(kn),dr=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var o={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return vt.SORTINDEX_MULTIPOLYGON},e.prototype.equalsExact=function(){if(arguments.length===2){var u=arguments[0],d=arguments[1];return!!this.isEquivalentClass(u)&&t.prototype.equalsExact.call(this,u,d)}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.reverse=function(){for(var u=this._geometries.length,d=new Array(u).fill(null),w=0;w0?e.createPoint(o[0]):e.createPoint():t},Fi.prototype.interfaces_=function(){return[ur.GeometryEditorOperation]},Fi.prototype.getClass=function(){return Fi};var Le=function(){};Le.prototype.edit=function(t,e){return t instanceof Nr?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof kn?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof pr?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},Le.prototype.interfaces_=function(){return[ur.GeometryEditorOperation]},Le.prototype.getClass=function(){return Le};var le=function(){if(this._dimension=3,this._coordinates=null,arguments.length===1){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var t=arguments[0];this._coordinates=new Array(t).fill(null);for(var e=0;e0){var t=new Xt(17*this._coordinates.length);t.append("("),t.append(this._coordinates[0]);for(var e=1;e3&&(u=3),u<2?new le(o):new le(o,u)}},Un.prototype.interfaces_=function(){return[Et,n]},Un.prototype.getClass=function(){return Un},Un.instance=function(){return Un.instanceObject},Pi.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},Pi.instanceObject.get=function(){return new Un},Object.defineProperties(Un,Pi);var fo=function(t){function e(){t.call(this),this.map_=new Map}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(o){return this.map_.get(o)||null},e.prototype.put=function(o,u){return this.map_.set(o,u),u},e.prototype.values=function(){for(var o=new St,u=this.map_.values(),d=u.next();!d.done;)o.add(d.value),d=u.next();return o},e.prototype.entrySet=function(){var o=new wo;return this.map_.entries().forEach(function(u){return o.add(u)}),o},e.prototype.size=function(){return this.map_.size()},e}(or),Zt=function t(){if(this._modelType=null,this._scale=null,arguments.length===0)this._modelType=t.FLOATING;else if(arguments.length===1){if(arguments[0]instanceof Wr){var e=arguments[0];this._modelType=e,e===t.FIXED&&this.setScale(1)}else if(typeof arguments[0]=="number"){var o=arguments[0];this._modelType=t.FIXED,this.setScale(o)}else if(arguments[0]instanceof t){var u=arguments[0];this._modelType=u._modelType,this._scale=u._scale}}},En={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};Zt.prototype.equals=function(t){if(!(t instanceof Zt))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale},Zt.prototype.compareTo=function(t){var e=t,o=this.getMaximumSignificantDigits(),u=e.getMaximumSignificantDigits();return new ft(o).compareTo(new ft(u))},Zt.prototype.getScale=function(){return this._scale},Zt.prototype.isFloating=function(){return this._modelType===Zt.FLOATING||this._modelType===Zt.FLOATING_SINGLE},Zt.prototype.getType=function(){return this._modelType},Zt.prototype.toString=function(){var t="UNKNOWN";return this._modelType===Zt.FLOATING?t="Floating":this._modelType===Zt.FLOATING_SINGLE?t="Floating-Single":this._modelType===Zt.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},Zt.prototype.makePrecise=function(){if(typeof arguments[0]=="number"){var t=arguments[0];return A.isNaN(t)||this._modelType===Zt.FLOATING_SINGLE?t:this._modelType===Zt.FIXED?Math.round(t*this._scale)/this._scale:t}if(arguments[0]instanceof X){var e=arguments[0];if(this._modelType===Zt.FLOATING)return null;e.x=this.makePrecise(e.x),e.y=this.makePrecise(e.y)}},Zt.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===Zt.FLOATING?t=16:this._modelType===Zt.FLOATING_SINGLE?t=6:this._modelType===Zt.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t},Zt.prototype.setScale=function(t){this._scale=Math.abs(t)},Zt.prototype.interfaces_=function(){return[n,H]},Zt.prototype.getClass=function(){return Zt},Zt.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},En.serialVersionUID.get=function(){return 7777263578777804e3},En.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(Zt,En);var Wr=function t(e){this._name=e||null,t.nameToTypeMap.put(e,this)},bo={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};Wr.prototype.readResolve=function(){return Wr.nameToTypeMap.get(this._name)},Wr.prototype.toString=function(){return this._name},Wr.prototype.interfaces_=function(){return[n]},Wr.prototype.getClass=function(){return Wr},bo.serialVersionUID.get=function(){return-552860263173159e4},bo.nameToTypeMap.get=function(){return new fo},Object.defineProperties(Wr,bo),Zt.Type=Wr,Zt.FIXED=new Wr("FIXED"),Zt.FLOATING=new Wr("FLOATING"),Zt.FLOATING_SINGLE=new Wr("FLOATING SINGLE");var Kt=function t(){this._precisionModel=new Zt,this._SRID=0,this._coordinateSequenceFactory=t.getDefaultCoordinateSequenceFactory(),arguments.length===0||(arguments.length===1?ct(arguments[0],Et)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof Zt&&(this._precisionModel=arguments[0]):arguments.length===2?(this._precisionModel=arguments[0],this._SRID=arguments[1]):arguments.length===3&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},eo={serialVersionUID:{configurable:!0}};Kt.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new X(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new X(t.getMinX(),t.getMinY()),new X(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new X(t.getMinX(),t.getMinY()),new X(t.getMinX(),t.getMaxY()),new X(t.getMaxX(),t.getMaxY()),new X(t.getMaxX(),t.getMinY()),new X(t.getMinX(),t.getMinY())]),null)},Kt.prototype.createLineString=function(t){return t?t instanceof Array?new kn(this.getCoordinateSequenceFactory().create(t),this):ct(t,Tt)?new kn(t,this):void 0:new kn(this.getCoordinateSequenceFactory().create([]),this)},Kt.prototype.createMultiLineString=function(){if(arguments.length===0)return new ar(null,this);if(arguments.length===1){var t=arguments[0];return new ar(t,this)}},Kt.prototype.buildGeometry=function(t){for(var e=null,o=!1,u=!1,d=t.iterator();d.hasNext();){var w=d.next(),S=w.getClass();e===null&&(e=S),S!==e&&(o=!0),w.isGeometryCollectionOrDerived()&&(u=!0)}if(e===null)return this.createGeometryCollection();if(o||u)return this.createGeometryCollection(Kt.toGeometryArray(t));var U=t.iterator().next();if(t.size()>1){if(U instanceof bn)return this.createMultiPolygon(Kt.toPolygonArray(t));if(U instanceof kn)return this.createMultiLineString(Kt.toLineStringArray(t));if(U instanceof pr)return this.createMultiPoint(Kt.toPointArray(t));C.shouldNeverReachHere("Unhandled class: "+U.getClass().getName())}return U},Kt.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(t!==null?this.getCoordinateSequenceFactory().create(t):null)},Kt.prototype.createPoint=function(){if(arguments.length===0)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof X){var t=arguments[0];return this.createPoint(t!==null?this.getCoordinateSequenceFactory().create([t]):null)}if(ct(arguments[0],Tt)){var e=arguments[0];return new pr(e,this)}}},Kt.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},Kt.prototype.createPolygon=function(){if(arguments.length===0)return new bn(null,null,this);if(arguments.length===1){if(ct(arguments[0],Tt)){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}if(arguments[0]instanceof Array){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}if(arguments[0]instanceof Nr){var o=arguments[0];return this.createPolygon(o,null)}}else if(arguments.length===2){var u=arguments[0],d=arguments[1];return new bn(u,d,this)}},Kt.prototype.getSRID=function(){return this._SRID},Kt.prototype.createGeometryCollection=function(){if(arguments.length===0)return new wn(null,this);if(arguments.length===1){var t=arguments[0];return new wn(t,this)}},Kt.prototype.createGeometry=function(t){return new ur(this).edit(t,{edit:function(){if(arguments.length===2){var e=arguments[0];return this._coordinateSequenceFactory.create(e)}}})},Kt.prototype.getPrecisionModel=function(){return this._precisionModel},Kt.prototype.createLinearRing=function(){if(arguments.length===0)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];return this.createLinearRing(t!==null?this.getCoordinateSequenceFactory().create(t):null)}if(ct(arguments[0],Tt)){var e=arguments[0];return new Nr(e,this)}}},Kt.prototype.createMultiPolygon=function(){if(arguments.length===0)return new dr(null,this);if(arguments.length===1){var t=arguments[0];return new dr(t,this)}},Kt.prototype.createMultiPoint=function(){if(arguments.length===0)return new mi(null,this);if(arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];return new mi(t,this)}if(arguments[0]instanceof Array){var e=arguments[0];return this.createMultiPoint(e!==null?this.getCoordinateSequenceFactory().create(e):null)}if(ct(arguments[0],Tt)){var o=arguments[0];if(o===null)return this.createMultiPoint(new Array(0).fill(null));for(var u=new Array(o.size()).fill(null),d=0;d=this.size())throw new Error;return this.array_[t]},R.prototype.push=function(t){return this.array_.push(t),t},R.prototype.pop=function(t){if(this.array_.length===0)throw new j;return this.array_.pop()},R.prototype.peek=function(){if(this.array_.length===0)throw new j;return this.array_[this.array_.length-1]},R.prototype.empty=function(){return this.array_.length===0},R.prototype.isEmpty=function(){return this.empty()},R.prototype.search=function(t){return this.array_.indexOf(t)},R.prototype.size=function(){return this.array_.length},R.prototype.toArray=function(){for(var t=[],e=0,o=this.array_.length;e0&&this._minIndexthis._minCoord.y&&o.y>this._minCoord.y&&u===tt.CLOCKWISE)&&(d=!0),d&&(this._minIndex=this._minIndex-1)},fn.prototype.getRightmostSideOfSegment=function(t,e){var o=t.getEdge().getCoordinates();if(e<0||e+1>=o.length||o[e].y===o[e+1].y)return-1;var u=It.LEFT;return o[e].ythis._minCoord.x)&&(this._minDe=t,this._minIndex=o,this._minCoord=e[o])},fn.prototype.findRightmostEdgeAtNode=function(){var t=this._minDe.getNode().getEdges();this._minDe=t.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},fn.prototype.findEdge=function(t){for(var e=t.iterator();e.hasNext();){var o=e.next();o.isForward()&&this.checkForRightmostCoordinate(o)}C.isTrue(this._minIndex!==0||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),this._minIndex===0?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe,this.getRightmostSide(this._minDe,this._minIndex)===It.LEFT&&(this._orientedDe=this._minDe.getSym())},fn.prototype.interfaces_=function(){return[]},fn.prototype.getClass=function(){return fn};var Qn=function(t){function e(o,u){t.call(this,e.msgWithCoord(o,u)),this.pt=u?new X(u):null,this.name="TopologyException"}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCoordinate=function(){return this.pt},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.msgWithCoord=function(o,u){return u?o:o+" [ "+u+" ]"},e}(ht),Ci=function(){this.array_=[]};Ci.prototype.addLast=function(t){this.array_.push(t)},Ci.prototype.removeFirst=function(){return this.array_.shift()},Ci.prototype.isEmpty=function(){return this.array_.length===0};var tr=function(){this._finder=null,this._dirEdgeList=new St,this._nodes=new St,this._rightMostCoord=null,this._env=null,this._finder=new fn};tr.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();)t.next().setVisited(!1)},tr.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},tr.prototype.computeNodeDepth=function(t){for(var e=null,o=t.getEdges().iterator();o.hasNext();){var u=o.next();if(u.isVisited()||u.getSym().isVisited()){e=u;break}}if(e===null)throw new Qn("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(e);for(var d=t.getEdges().iterator();d.hasNext();){var w=d.next();w.setVisited(!0),this.copySymDepths(w)}},tr.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(It.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},tr.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},tr.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(It.RIGHT)>=1&&e.getDepth(It.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},tr.prototype.computeDepths=function(t){var e=new wo,o=new Ci,u=t.getNode();for(o.addLast(u),e.add(u),t.setVisited(!0);!o.isEmpty();){var d=o.removeFirst();e.add(d),this.computeNodeDepth(d);for(var w=d.getEdges().iterator();w.hasNext();){var S=w.next().getSym();if(!S.isVisited()){var U=S.getNode();e.contains(U)||(o.addLast(U),e.add(U))}}}},tr.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.xe._rightMostCoord.x?1:0},tr.prototype.getEnvelope=function(){if(this._env===null){for(var t=new Bt,e=this._dirEdgeList.iterator();e.hasNext();)for(var o=e.next().getEdge().getCoordinates(),u=0;uthis.location.length){var e=new Array(3).fill(null);e[It.ON]=this.location[It.ON],e[It.LEFT]=Q.NONE,e[It.RIGHT]=Q.NONE,this.location=e}for(var o=0;o1&&t.append(Q.toLocationSymbol(this.location[It.LEFT])),t.append(Q.toLocationSymbol(this.location[It.ON])),this.location.length>1&&t.append(Q.toLocationSymbol(this.location[It.RIGHT])),t.toString()},Ae.prototype.setLocations=function(t,e,o){this.location[It.ON]=t,this.location[It.LEFT]=e,this.location[It.RIGHT]=o},Ae.prototype.get=function(t){return t1},Ae.prototype.isAnyNull=function(){for(var t=0;tthis._maxNodeDegree&&(this._maxNodeDegree=e),t=this.getNext(t)}while(t!==this._startDe);this._maxNodeDegree*=2},Nn.prototype.addPoints=function(t,e,o){var u=t.getCoordinates();if(e){var d=1;o&&(d=0);for(var w=d;w=0;U--)this._pts.add(u[U])}},Nn.prototype.isHole=function(){return this._isHole},Nn.prototype.setInResult=function(){var t=this._startDe;do t.getEdge().setInResult(!0),t=t.getNext();while(t!==this._startDe)},Nn.prototype.containsPoint=function(t){var e=this.getLinearRing();if(!e.getEnvelopeInternal().contains(t)||!tt.isPointInRing(t,e.getCoordinates()))return!1;for(var o=this._holes.iterator();o.hasNext();)if(o.next().containsPoint(t))return!1;return!0},Nn.prototype.addHole=function(t){this._holes.add(t)},Nn.prototype.isShell=function(){return this._shell===null},Nn.prototype.getLabel=function(){return this._label},Nn.prototype.getEdges=function(){return this._edges},Nn.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},Nn.prototype.getShell=function(){return this._shell},Nn.prototype.mergeLabel=function(){if(arguments.length===1){var t=arguments[0];this.mergeLabel(t,0),this.mergeLabel(t,1)}else if(arguments.length===2){var e=arguments[0],o=arguments[1],u=e.getLocation(o,It.RIGHT);if(u===Q.NONE)return null;if(this._label.getLocation(o)===Q.NONE)return this._label.setLocation(o,u),null}},Nn.prototype.setShell=function(t){this._shell=t,t!==null&&t.addHole(this)},Nn.prototype.toPolygon=function(t){for(var e=new Array(this._holes.size()).fill(null),o=0;o=2,"found partial label"),this.computeIM(t)},ie.prototype.isInResult=function(){return this._isInResult},ie.prototype.isVisited=function(){return this._isVisited},ie.prototype.interfaces_=function(){return[]},ie.prototype.getClass=function(){return ie};var Kr=function(t){function e(){t.call(this),this._coord=null,this._edges=null;var o=arguments[0],u=arguments[1];this._coord=o,this._edges=u,this._label=new be(0,Q.NONE)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isIncidentEdgeInResult=function(){for(var o=this.getEdges().getEdges().iterator();o.hasNext();)if(o.next().getEdge().isInResult())return!0;return!1},e.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},e.prototype.getCoordinate=function(){return this._coord},e.prototype.print=function(o){o.println("node "+this._coord+" lbl: "+this._label)},e.prototype.computeIM=function(o){},e.prototype.computeMergedLocation=function(o,u){var d=Q.NONE;if(d=this._label.getLocation(u),!o.isNull(u)){var w=o.getLocation(u);d!==Q.BOUNDARY&&(d=w)}return d},e.prototype.setLabel=function(){if(arguments.length!==2)return t.prototype.setLabel.apply(this,arguments);var o=arguments[0],u=arguments[1];this._label===null?this._label=new be(o,u):this._label.setLocation(o,u)},e.prototype.getEdges=function(){return this._edges},e.prototype.mergeLabel=function(){if(arguments[0]instanceof e){var o=arguments[0];this.mergeLabel(o._label)}else if(arguments[0]instanceof be)for(var u=arguments[0],d=0;d<2;d++){var w=this.computeMergedLocation(u,d);this._label.getLocation(d)===Q.NONE&&this._label.setLocation(d,w)}},e.prototype.add=function(o){this._edges.insert(o),o.setNode(this)},e.prototype.setLabelBoundary=function(o){if(this._label===null)return null;var u=Q.NONE;this._label!==null&&(u=this._label.getLocation(o));var d=null;switch(u){case Q.BOUNDARY:d=Q.INTERIOR;break;case Q.INTERIOR:default:d=Q.BOUNDARY}this._label.setLocation(o,d)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ie),Pe=function(){this.nodeMap=new T,this.nodeFact=null;var t=arguments[0];this.nodeFact=t};Pe.prototype.find=function(t){return this.nodeMap.get(t)},Pe.prototype.addNode=function(){if(arguments[0]instanceof X){var t=arguments[0],e=this.nodeMap.get(t);return e===null&&(e=this.nodeFact.createNode(t),this.nodeMap.put(t,e)),e}if(arguments[0]instanceof Kr){var o=arguments[0],u=this.nodeMap.get(o.getCoordinate());return u===null?(this.nodeMap.put(o.getCoordinate(),o),o):(u.mergeLabel(o),u)}},Pe.prototype.print=function(t){for(var e=this.iterator();e.hasNext();)e.next().print(t)},Pe.prototype.iterator=function(){return this.nodeMap.values().iterator()},Pe.prototype.values=function(){return this.nodeMap.values()},Pe.prototype.getBoundaryNodes=function(t){for(var e=new St,o=this.iterator();o.hasNext();){var u=o.next();u.getLabel().getLocation(t)===Q.BOUNDARY&&e.add(u)}return e},Pe.prototype.add=function(t){var e=t.getCoordinate();this.addNode(e).add(t)},Pe.prototype.interfaces_=function(){return[]},Pe.prototype.getClass=function(){return Pe};var h=function(){},p={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};h.prototype.interfaces_=function(){return[]},h.prototype.getClass=function(){return h},h.isNorthern=function(t){return t===h.NE||t===h.NW},h.isOpposite=function(t,e){return t===e?!1:(t-e+4)%4===2},h.commonHalfPlane=function(t,e){if(t===e)return t;if((t-e+4)%4===2)return-1;var o=te?t:e)===3?3:o},h.isInHalfPlane=function(t,e){return e===h.SE?t===h.SE||t===h.SW:t===e||t===e+1},h.quadrant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1];if(t===0&&e===0)throw new D("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?h.NE:h.SE:e>=0?h.NW:h.SW}if(arguments[0]instanceof X&&arguments[1]instanceof X){var o=arguments[0],u=arguments[1];if(u.x===o.x&&u.y===o.y)throw new D("Cannot compute the quadrant for two identical points "+o);return u.x>=o.x?u.y>=o.y?h.NE:h.SE:u.y>=o.y?h.NW:h.SW}},p.NE.get=function(){return 0},p.NW.get=function(){return 1},p.SW.get=function(){return 2},p.SE.get=function(){return 3},Object.defineProperties(h,p);var _=function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,arguments.length===1){var t=arguments[0];this._edge=t}else if(arguments.length===3){var e=arguments[0],o=arguments[1],u=arguments[2];this._edge=e,this.init(o,u),this._label=null}else if(arguments.length===4){var d=arguments[0],w=arguments[1],S=arguments[2],U=arguments[3];this._edge=d,this.init(w,S),this._label=U}};_.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant2){w.linkDirectedEdgesForMinimalEdgeRings();var S=w.buildMinimalRings(),U=this.findShell(S);U!==null?(this.placePolygonHoles(U,S),e.add(U)):o.addAll(S)}else u.add(w)}return u},nt.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();)if(e.next().containsPoint(t))return!0;return!1},nt.prototype.buildMaximalEdgeRings=function(t){for(var e=new St,o=t.iterator();o.hasNext();){var u=o.next();if(u.isInResult()&&u.getLabel().isArea()&&u.getEdgeRing()===null){var d=new $o(u,this._geometryFactory);e.add(d),d.setInResult()}}return e},nt.prototype.placePolygonHoles=function(t,e){for(var o=e.iterator();o.hasNext();){var u=o.next();u.isHole()&&u.setShell(t)}},nt.prototype.getPolygons=function(){return this.computePolygons(this._shellList)},nt.prototype.findEdgeRingContaining=function(t,e){for(var o=t.getLinearRing(),u=o.getEnvelopeInternal(),d=o.getCoordinateN(0),w=null,S=null,U=e.iterator();U.hasNext();){var $=U.next(),ut=$.getLinearRing(),_t=ut.getEnvelopeInternal();w!==null&&(S=w.getLinearRing().getEnvelopeInternal());var wt=!1;_t.contains(u)&&tt.isPointInRing(d,ut.getCoordinates())&&(wt=!0),wt&&(w===null||S.contains(_t))&&(w=$)}return w},nt.prototype.findShell=function(t){for(var e=0,o=null,u=t.iterator();u.hasNext();){var d=u.next();d.isHole()||(o=d,e++)}return C.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),o},nt.prototype.add=function(){if(arguments.length===1){var t=arguments[0];this.add(t.getEdgeEnds(),t.getNodes())}else if(arguments.length===2){var e=arguments[0],o=arguments[1];V.linkResultDirectedEdges(o);var u=this.buildMaximalEdgeRings(e),d=new St,w=this.buildMinimalEdgeRings(u,this._shellList,d);this.sortShellsAndHoles(w,this._shellList,d),this.placeFreeHoles(this._shellList,d)}},nt.prototype.interfaces_=function(){return[]},nt.prototype.getClass=function(){return nt};var it=function(){};it.prototype.getBounds=function(){},it.prototype.interfaces_=function(){return[]},it.prototype.getClass=function(){return it};var rt=function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e};rt.prototype.getItem=function(){return this._item},rt.prototype.getBounds=function(){return this._bounds},rt.prototype.interfaces_=function(){return[it,n]},rt.prototype.getClass=function(){return rt};var ot=function(){this._size=null,this._items=null,this._size=0,this._items=new St,this._items.add(null)};ot.prototype.poll=function(){if(this.isEmpty())return null;var t=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),t},ot.prototype.size=function(){return this._size},ot.prototype.reorder=function(t){for(var e=null,o=this._items.get(t);2*t<=this._size&&((e=2*t)!==this._size&&this._items.get(e+1).compareTo(this._items.get(e))<0&&e++,this._items.get(e).compareTo(o)<0);t=e)this._items.set(t,this._items.get(e));this._items.set(t,o)},ot.prototype.clear=function(){this._size=0,this._items.clear()},ot.prototype.isEmpty=function(){return this._size===0},ot.prototype.add=function(t){this._items.add(null),this._size+=1;var e=this._size;for(this._items.set(0,t);t.compareTo(this._items.get(Math.trunc(e/2)))<0;e/=2)this._items.set(e,this._items.get(Math.trunc(e/2)));this._items.set(e,t)},ot.prototype.interfaces_=function(){return[]},ot.prototype.getClass=function(){return ot};var dt=function(){};dt.prototype.visitItem=function(t){},dt.prototype.interfaces_=function(){return[]},dt.prototype.getClass=function(){return dt};var Pt=function(){};Pt.prototype.insert=function(t,e){},Pt.prototype.remove=function(t,e){},Pt.prototype.query=function(){},Pt.prototype.interfaces_=function(){return[]},Pt.prototype.getClass=function(){return Pt};var yt=function(){if(this._childBoundables=new St,this._bounds=null,this._level=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this._level=t}}},At={serialVersionUID:{configurable:!0}};yt.prototype.getLevel=function(){return this._level},yt.prototype.size=function(){return this._childBoundables.size()},yt.prototype.getChildBoundables=function(){return this._childBoundables},yt.prototype.addChildBoundable=function(t){C.isTrue(this._bounds===null),this._childBoundables.add(t)},yt.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},yt.prototype.getBounds=function(){return this._bounds===null&&(this._bounds=this.computeBounds()),this._bounds},yt.prototype.interfaces_=function(){return[it,n]},yt.prototype.getClass=function(){return yt},At.serialVersionUID.get=function(){return 6493722185909574e3},Object.defineProperties(yt,At);var Gt=function(){};Gt.reverseOrder=function(){return{compare:function(t,e){return e.compareTo(t)}}},Gt.min=function(t){return Gt.sort(t),t.get(0)},Gt.sort=function(t,e){var o=t.toArray();e?oi.sort(o,e):oi.sort(o);for(var u=t.iterator(),d=0,w=o.length;dte.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,t,e),null):(this.expand(this._boundable2,this._boundable1,t,e),null);if(o)return this.expand(this._boundable1,this._boundable2,t,e),null;if(u)return this.expand(this._boundable2,this._boundable1,t,e),null;throw new D("neither boundable is composite")},te.prototype.isLeaves=function(){return!(te.isComposite(this._boundable1)||te.isComposite(this._boundable2))},te.prototype.compareTo=function(t){var e=t;return this._distancee._distance?1:0},te.prototype.expand=function(t,e,o,u){for(var d=t.getChildBoundables().iterator();d.hasNext();){var w=d.next(),S=new te(w,e,this._itemDistance);S.getDistance()1,"Node capacity must be greater than 1"),this._nodeCapacity=o}},Rn={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};Dt.prototype.getNodeCapacity=function(){return this._nodeCapacity},Dt.prototype.lastNode=function(t){return t.get(t.size()-1)},Dt.prototype.size=function(){if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.size(this._root));if(arguments.length===1){for(var t=0,e=arguments[0].getChildBoundables().iterator();e.hasNext();){var o=e.next();o instanceof yt?t+=this.size(o):o instanceof rt&&(t+=1)}return t}},Dt.prototype.removeItem=function(t,e){for(var o=null,u=t.getChildBoundables().iterator();u.hasNext();){var d=u.next();d instanceof rt&&d.getItem()===e&&(o=d)}return o!==null&&(t.getChildBoundables().remove(o),!0)},Dt.prototype.itemsTree=function(){if(arguments.length===0){this.build();var t=this.itemsTree(this._root);return t===null?new St:t}if(arguments.length===1){for(var e=arguments[0],o=new St,u=e.getChildBoundables().iterator();u.hasNext();){var d=u.next();if(d instanceof yt){var w=this.itemsTree(d);w!==null&&o.add(w)}else d instanceof rt?o.add(d.getItem()):C.shouldNeverReachHere()}return o.size()<=0?null:o}},Dt.prototype.insert=function(t,e){C.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new rt(t,e))},Dt.prototype.boundablesAtLevel=function(){if(arguments.length===1){var t=arguments[0],e=new St;return this.boundablesAtLevel(t,this._root,e),e}if(arguments.length===3){var o=arguments[0],u=arguments[1],d=arguments[2];if(C.isTrue(o>-2),u.getLevel()===o)return d.add(u),null;for(var w=u.getChildBoundables().iterator();w.hasNext();){var S=w.next();S instanceof yt?this.boundablesAtLevel(o,S,d):(C.isTrue(S instanceof rt),o===-1&&d.add(S))}return null}},Dt.prototype.query=function(){if(arguments.length===1){var t=arguments[0];this.build();var e=new St;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.query(t,this._root,e),e}if(arguments.length===2){var o=arguments[0],u=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),o)&&this.query(o,this._root,u)}else if(arguments.length===3){if(ct(arguments[2],dt)&&arguments[0]instanceof Object&&arguments[1]instanceof yt)for(var d=arguments[0],w=arguments[1],S=arguments[2],U=w.getChildBoundables(),$=0;$t&&(t=u)}}return t+1}},Dt.prototype.createParentBoundables=function(t,e){C.isTrue(!t.isEmpty());var o=new St;o.add(this.createNode(e));var u=new St(t);Gt.sort(u,this.getComparator());for(var d=u.iterator();d.hasNext();){var w=d.next();this.lastNode(o).getChildBoundables().size()===this.getNodeCapacity()&&o.add(this.createNode(e)),this.lastNode(o).addChildBoundable(w)}return o},Dt.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},Dt.prototype.interfaces_=function(){return[n]},Dt.prototype.getClass=function(){return Dt},Dt.compareDoubles=function(t,e){return t>e?1:t0);for(var w=new St,S=0;S0;){var qt=zt.poll(),ne=qt.getDistance();if(ne>=_t)break;qt.isLeaves()?(_t=ne,wt=qt):qt.expandToQueue(zt,_t)}return[wt.getBoundable(0).getItem(),wt.getBoundable(1).getItem()]}}else if(arguments.length===3){var oe=arguments[0],In=arguments[1],xr=arguments[2],vi=new rt(oe,In),Xo=new te(this.getRoot(),vi,xr);return this.nearestNeighbour(Xo)[0]}},e.prototype.interfaces_=function(){return[Pt,n]},e.prototype.getClass=function(){return e},e.centreX=function(u){return e.avg(u.getMinX(),u.getMaxX())},e.avg=function(u,d){return(u+d)/2},e.centreY=function(u){return e.avg(u.getMinY(),u.getMaxY())},o.STRtreeNode.get=function(){return Si},o.serialVersionUID.get=function(){return 0x39920f7d5f261e0},o.xComparator.get=function(){return{interfaces_:function(){return[et]},compare:function(u,d){return t.compareDoubles(e.centreX(u.getBounds()),e.centreX(d.getBounds()))}}},o.yComparator.get=function(){return{interfaces_:function(){return[et]},compare:function(u,d){return t.compareDoubles(e.centreY(u.getBounds()),e.centreY(d.getBounds()))}}},o.intersectsOp.get=function(){return{interfaces_:function(){return[t.IntersectsOp]},intersects:function(u,d){return u.intersects(d)}}},o.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(e,o),e}(Dt),Si=function(t){function e(){var o=arguments[0];t.call(this,o)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.computeBounds=function(){for(var o=null,u=this.getChildBoundables().iterator();u.hasNext();){var d=u.next();o===null?o=new Bt(d.getBounds()):o.expandToInclude(d.getBounds())}return o},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(yt),jn=function(){};jn.prototype.interfaces_=function(){return[]},jn.prototype.getClass=function(){return jn},jn.relativeSign=function(t,e){return te?1:0},jn.compare=function(t,e,o){if(e.equals2D(o))return 0;var u=jn.relativeSign(e.x,o.x),d=jn.relativeSign(e.y,o.y);switch(t){case 0:return jn.compareValue(u,d);case 1:return jn.compareValue(d,u);case 2:return jn.compareValue(d,-u);case 3:return jn.compareValue(-u,d);case 4:return jn.compareValue(-u,-d);case 5:return jn.compareValue(-d,-u);case 6:return jn.compareValue(-d,u);case 7:return jn.compareValue(u,-d)}return C.shouldNeverReachHere("invalid octant value"),0},jn.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0};var no=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var t=arguments[0],e=arguments[1],o=arguments[2],u=arguments[3];this._segString=t,this.coord=new X(e),this.segmentIndex=o,this._segmentOctant=u,this._isInterior=!e.equals2D(t.getCoordinate(o))};no.prototype.getCoordinate=function(){return this.coord},no.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},no.prototype.compareTo=function(t){var e=t;return this.segmentIndexe.segmentIndex?1:this.coord.equals2D(e.coord)?0:jn.compare(this._segmentOctant,this.coord,e.coord)},no.prototype.isEndPoint=function(t){return this.segmentIndex===0&&!this._isInterior||this.segmentIndex===t},no.prototype.isInterior=function(){return this._isInterior},no.prototype.interfaces_=function(){return[H]},no.prototype.getClass=function(){return no};var lr=function(){this._nodeMap=new T,this._edge=null;var t=arguments[0];this._edge=t};lr.prototype.getSplitCoordinates=function(){var t=new Xn;this.addEndpoints();for(var e=this.iterator(),o=e.next();e.hasNext();){var u=e.next();this.addEdgeCoordinates(o,u,t),o=u}return t.toCoordinateArray()},lr.prototype.addCollapsedNodes=function(){var t=new St;this.findCollapsesFromInsertedNodes(t),this.findCollapsesFromExistingVertices(t);for(var e=t.iterator();e.hasNext();){var o=e.next().intValue();this.add(this._edge.getCoordinate(o),o)}},lr.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},lr.prototype.findCollapsesFromExistingVertices=function(t){for(var e=0;e=0?e>=0?o>=u?0:1:o>=u?7:6:e>=0?o>=u?3:2:o>=u?4:5}if(arguments[0]instanceof X&&arguments[1]instanceof X){var d=arguments[0],w=arguments[1],S=w.x-d.x,U=w.y-d.y;if(S===0&&U===0)throw new D("Cannot compute the octant for two identical points "+d);return ki.octant(S,U)}};var Gi=function(){};Gi.prototype.getCoordinates=function(){},Gi.prototype.size=function(){},Gi.prototype.getCoordinate=function(t){},Gi.prototype.isClosed=function(){},Gi.prototype.setData=function(t){},Gi.prototype.getData=function(){},Gi.prototype.interfaces_=function(){return[]},Gi.prototype.getClass=function(){return Gi};var Eo=function(){};Eo.prototype.addIntersection=function(t,e){},Eo.prototype.interfaces_=function(){return[Gi]},Eo.prototype.getClass=function(){return Eo};var Zn=function(){this._nodeList=new lr(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};Zn.prototype.getCoordinates=function(){return this._pts},Zn.prototype.size=function(){return this._pts.length},Zn.prototype.getCoordinate=function(t){return this._pts[t]},Zn.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Zn.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))},Zn.prototype.setData=function(t){this._data=t},Zn.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:ki.octant(t,e)},Zn.prototype.getData=function(){return this._data},Zn.prototype.addIntersection=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(arguments.length===4){var o=arguments[0],u=arguments[1],d=arguments[3],w=new X(o.getIntersection(d));this.addIntersection(w,u)}},Zn.prototype.toString=function(){return Ht.toLineString(new le(this._pts))},Zn.prototype.getNodeList=function(){return this._nodeList},Zn.prototype.addIntersectionNode=function(t,e){var o=e,u=o+1;if(u=0&&o>=0||e<=0&&o<=0?Math.max(e,o):0}if(arguments[0]instanceof X){var u=arguments[0];return tt.orientationIndex(this.p0,this.p1,u)}},Yt.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])},Yt.prototype.isVertical=function(){return this.p0.x===this.p1.x},Yt.prototype.equals=function(t){if(!(t instanceof Yt))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)},Yt.prototype.intersection=function(t){var e=new F;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},Yt.prototype.project=function(){if(arguments[0]instanceof X){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new X(t);var e=this.projectionFactor(t),o=new X;return o.x=this.p0.x+e*(this.p1.x-this.p0.x),o.y=this.p0.y+e*(this.p1.y-this.p0.y),o}if(arguments[0]instanceof Yt){var u=arguments[0],d=this.projectionFactor(u.p0),w=this.projectionFactor(u.p1);if(d>=1&&w>=1||d<=0&&w<=0)return null;var S=this.project(u.p0);d<0&&(S=this.p0),d>1&&(S=this.p1);var U=this.project(u.p1);return w<0&&(U=this.p0),w>1&&(U=this.p1),new Yt(S,U)}},Yt.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},Yt.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},Yt.prototype.getCoordinate=function(t){return t===0?this.p0:this.p1},Yt.prototype.distancePerpendicular=function(t){return tt.distancePointLinePerpendicular(t,this.p0,this.p1)},Yt.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},Yt.prototype.midPoint=function(){return Yt.midPoint(this.p0,this.p1)},Yt.prototype.projectionFactor=function(t){if(t.equals(this.p0))return 0;if(t.equals(this.p1))return 1;var e=this.p1.x-this.p0.x,o=this.p1.y-this.p0.y,u=e*e+o*o;return u<=0?A.NaN:((t.x-this.p0.x)*e+(t.y-this.p0.y)*o)/u},Yt.prototype.closestPoints=function(t){var e=this.intersection(t);if(e!==null)return[e,e];var o=new Array(2).fill(null),u=A.MAX_VALUE,d=null,w=this.closestPoint(t.p0);u=w.distance(t.p0),o[0]=w,o[1]=t.p0;var S=this.closestPoint(t.p1);(d=S.distance(t.p1))0&&e<1?this.project(t):this.p0.distance(t)1||A.isNaN(e))&&(e=1),e},Yt.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},Yt.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},Yt.prototype.distance=function(){if(arguments[0]instanceof Yt){var t=arguments[0];return tt.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}if(arguments[0]instanceof X){var e=arguments[0];return tt.distancePointLine(e,this.p0,this.p1)}},Yt.prototype.pointAlong=function(t){var e=new X;return e.x=this.p0.x+t*(this.p1.x-this.p0.x),e.y=this.p0.y+t*(this.p1.y-this.p0.y),e},Yt.prototype.hashCode=function(){var t=A.doubleToLongBits(this.p0.x);t^=31*A.doubleToLongBits(this.p0.y);var e=Math.trunc(t)^Math.trunc(t>>32),o=A.doubleToLongBits(this.p1.x);return o^=31*A.doubleToLongBits(this.p1.y),e^(Math.trunc(o)^Math.trunc(o>>32))},Yt.prototype.interfaces_=function(){return[H,n]},Yt.prototype.getClass=function(){return Yt},Yt.midPoint=function(t,e){return new X((t.x+e.x)/2,(t.y+e.y)/2)},aa.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(Yt,aa);var Qo=function(){this.tempEnv1=new Bt,this.tempEnv2=new Bt,this._overlapSeg1=new Yt,this._overlapSeg2=new Yt};Qo.prototype.overlap=function(){if(arguments.length!==2){if(arguments.length===4){var t=arguments[0],e=arguments[1],o=arguments[2],u=arguments[3];t.getLineSegment(e,this._overlapSeg1),o.getLineSegment(u,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}}},Qo.prototype.interfaces_=function(){return[]},Qo.prototype.getClass=function(){return Qo};var hr=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var t=arguments[0],e=arguments[1],o=arguments[2],u=arguments[3];this._pts=t,this._start=e,this._end=o,this._context=u};hr.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]},hr.prototype.computeSelect=function(t,e,o,u){var d=this._pts[e],w=this._pts[o];if(u.tempEnv1.init(d,w),o-e==1)return u.select(this,e),null;if(!t.intersects(u.tempEnv1))return null;var S=Math.trunc((e+o)/2);e=t.length-1)return t.length-1;for(var u=h.quadrant(t[o],t[o+1]),d=e+1;dw.getId()&&(w.computeOverlaps(U,u),this._nOverlaps++),this._segInt.isDone())return null}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},o.SegmentOverlapAction.get=function(){return ua},Object.defineProperties(e,o),e}(Xs),ua=function(t){function e(){t.call(this),this._si=null;var o=arguments[0];this._si=o}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.overlap=function(){if(arguments.length!==4)return t.prototype.overlap.apply(this,arguments);var o=arguments[0],u=arguments[1],d=arguments[2],w=arguments[3],S=o.getContext(),U=d.getContext();this._si.processIntersections(S,u,U,w)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Qo),Be=function t(){if(this._quadrantSegments=t.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=t.CAP_ROUND,this._joinStyle=t.JOIN_ROUND,this._mitreLimit=t.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=t.DEFAULT_SIMPLIFY_FACTOR,arguments.length!==0){if(arguments.length===1){var e=arguments[0];this.setQuadrantSegments(e)}else if(arguments.length===2){var o=arguments[0],u=arguments[1];this.setQuadrantSegments(o),this.setEndCapStyle(u)}else if(arguments.length===4){var d=arguments[0],w=arguments[1],S=arguments[2],U=arguments[3];this.setQuadrantSegments(d),this.setEndCapStyle(w),this.setJoinStyle(S),this.setMitreLimit(U)}}},po={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}};Be.prototype.getEndCapStyle=function(){return this._endCapStyle},Be.prototype.isSingleSided=function(){return this._isSingleSided},Be.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,this._quadrantSegments===0&&(this._joinStyle=Be.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=Be.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==Be.JOIN_ROUND&&(this._quadrantSegments=Be.DEFAULT_QUADRANT_SEGMENTS)},Be.prototype.getJoinStyle=function(){return this._joinStyle},Be.prototype.setJoinStyle=function(t){this._joinStyle=t},Be.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t},Be.prototype.getSimplifyFactor=function(){return this._simplifyFactor},Be.prototype.getQuadrantSegments=function(){return this._quadrantSegments},Be.prototype.setEndCapStyle=function(t){this._endCapStyle=t},Be.prototype.getMitreLimit=function(){return this._mitreLimit},Be.prototype.setMitreLimit=function(t){this._mitreLimit=t},Be.prototype.setSingleSided=function(t){this._isSingleSided=t},Be.prototype.interfaces_=function(){return[]},Be.prototype.getClass=function(){return Be},Be.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},po.CAP_ROUND.get=function(){return 1},po.CAP_FLAT.get=function(){return 2},po.CAP_SQUARE.get=function(){return 3},po.JOIN_ROUND.get=function(){return 1},po.JOIN_MITRE.get=function(){return 2},po.JOIN_BEVEL.get=function(){return 3},po.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},po.DEFAULT_MITRE_LIMIT.get=function(){return 5},po.DEFAULT_SIMPLIFY_FACTOR.get=function(){return .01},Object.defineProperties(Be,po);var Yn=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=tt.COUNTERCLOCKWISE,this._inputLine=t||null},ts={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};Yn.prototype.isDeletable=function(t,e,o,u){var d=this._inputLine[t],w=this._inputLine[e],S=this._inputLine[o];return!!this.isConcave(d,w,S)&&!!this.isShallow(d,w,S,u)&&this.isShallowSampled(d,w,t,o,u)},Yn.prototype.deleteShallowConcavities=function(){for(var t=1,e=this.findNextNonDeletedIndex(t),o=this.findNextNonDeletedIndex(e),u=!1;o=0;u--)this.addPt(t[u])},Lr.prototype.isRedundant=function(t){if(this._ptList.size()<1)return!1;var e=this._ptList.get(this._ptList.size()-1);return t.distance(e)Math.PI;)t-=_e.PI_TIMES_2;for(;t<=-Math.PI;)t+=_e.PI_TIMES_2;return t},_e.angle=function(){if(arguments.length===1){var t=arguments[0];return Math.atan2(t.y,t.x)}if(arguments.length===2){var e=arguments[0],o=arguments[1],u=o.x-e.x,d=o.y-e.y;return Math.atan2(d,u)}},_e.isAcute=function(t,e,o){var u=t.x-e.x,d=t.y-e.y;return u*(o.x-e.x)+d*(o.y-e.y)>0},_e.isObtuse=function(t,e,o){var u=t.x-e.x,d=t.y-e.y;return u*(o.x-e.x)+d*(o.y-e.y)<0},_e.interiorAngle=function(t,e,o){var u=_e.angle(e,t),d=_e.angle(e,o);return Math.abs(d-u)},_e.normalizePositive=function(t){if(t<0){for(;t<0;)t+=_e.PI_TIMES_2;t>=_e.PI_TIMES_2&&(t=0)}else{for(;t>=_e.PI_TIMES_2;)t-=_e.PI_TIMES_2;t<0&&(t=0)}return t},_e.angleBetween=function(t,e,o){var u=_e.angle(e,t),d=_e.angle(e,o);return _e.diff(u,d)},_e.diff=function(t,e){var o=null;return(o=tMath.PI&&(o=2*Math.PI-o),o},_e.toRadians=function(t){return t*Math.PI/180},_e.getTurn=function(t,e){var o=Math.sin(e-t);return o>0?_e.COUNTERCLOCKWISE:o<0?_e.CLOCKWISE:_e.NONE},_e.angleBetweenOriented=function(t,e,o){var u=_e.angle(e,t),d=_e.angle(e,o)-u;return d<=-Math.PI?d+_e.PI_TIMES_2:d>Math.PI?d-_e.PI_TIMES_2:d},Jr.PI_TIMES_2.get=function(){return 2*Math.PI},Jr.PI_OVER_2.get=function(){return Math.PI/2},Jr.PI_OVER_4.get=function(){return Math.PI/4},Jr.COUNTERCLOCKWISE.get=function(){return tt.COUNTERCLOCKWISE},Jr.CLOCKWISE.get=function(){return tt.CLOCKWISE},Jr.NONE.get=function(){return tt.COLLINEAR},Object.defineProperties(_e,Jr);var Bn=function t(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new Yt,this._seg1=new Yt,this._offset0=new Yt,this._offset1=new Yt,this._side=0,this._hasNarrowConcaveAngle=!1;var e=arguments[0],o=arguments[1],u=arguments[2];this._precisionModel=e,this._bufParams=o,this._li=new F,this._filletAngleQuantum=Math.PI/2/o.getQuadrantSegments(),o.getQuadrantSegments()>=8&&o.getJoinStyle()===Be.JOIN_ROUND&&(this._closingSegLengthFactor=t.MAX_CLOSING_SEG_LEN_FACTOR),this.init(u)},Is={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}};Bn.prototype.addNextSegment=function(t,e){if(this._s0=this._s1,this._s1=this._s2,this._s2=t,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var o=tt.computeOrientation(this._s0,this._s1,this._s2),u=o===tt.CLOCKWISE&&this._side===It.LEFT||o===tt.COUNTERCLOCKWISE&&this._side===It.RIGHT;o===0?this.addCollinear(e):u?this.addOutsideTurn(o,e):this.addInsideTurn(o,e)},Bn.prototype.addLineEndCap=function(t,e){var o=new Yt(t,e),u=new Yt;this.computeOffsetSegment(o,It.LEFT,this._distance,u);var d=new Yt;this.computeOffsetSegment(o,It.RIGHT,this._distance,d);var w=e.x-t.x,S=e.y-t.y,U=Math.atan2(S,w);switch(this._bufParams.getEndCapStyle()){case Be.CAP_ROUND:this._segList.addPt(u.p1),this.addFilletArc(e,U+Math.PI/2,U-Math.PI/2,tt.CLOCKWISE,this._distance),this._segList.addPt(d.p1);break;case Be.CAP_FLAT:this._segList.addPt(u.p1),this._segList.addPt(d.p1);break;case Be.CAP_SQUARE:var $=new X;$.x=Math.abs(this._distance)*Math.cos(U),$.y=Math.abs(this._distance)*Math.sin(U);var ut=new X(u.p1.x+$.x,u.p1.y+$.y),_t=new X(d.p1.x+$.x,d.p1.y+$.y);this._segList.addPt(ut),this._segList.addPt(_t)}},Bn.prototype.getCoordinates=function(){return this._segList.getCoordinates()},Bn.prototype.addMitreJoin=function(t,e,o,u){var d=!0,w=null;try{w=ke.intersection(e.p0,e.p1,o.p0,o.p1),(u<=0?1:w.distance(t)/Math.abs(u))>this._bufParams.getMitreLimit()&&(d=!1)}catch(S){if(!(S instanceof Cn))throw S;w=new X(0,0),d=!1}d?this._segList.addPt(w):this.addLimitedMitreJoin(e,o,u,this._bufParams.getMitreLimit())},Bn.prototype.addFilletCorner=function(t,e,o,u,d){var w=e.x-t.x,S=e.y-t.y,U=Math.atan2(S,w),$=o.x-t.x,ut=o.y-t.y,_t=Math.atan2(ut,$);u===tt.CLOCKWISE?U<=_t&&(U+=2*Math.PI):U>=_t&&(U-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,U,_t,u,d),this._segList.addPt(o)},Bn.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)0){var o=new X((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(o);var u=new X((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(u)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},Bn.prototype.createCircle=function(t){var e=new X(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},Bn.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)},Bn.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new Lr,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*Bn.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},Bn.prototype.addCollinear=function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===Be.JOIN_BEVEL||this._bufParams.getJoinStyle()===Be.JOIN_MITRE?(t&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,tt.CLOCKWISE,this._distance))},Bn.prototype.closeRing=function(){this._segList.closeRing()},Bn.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},Bn.prototype.interfaces_=function(){return[]},Bn.prototype.getClass=function(){return Bn},Is.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return .001},Is.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return .001},Is.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},Is.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(Bn,Is);var li=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e};li.prototype.getOffsetCurve=function(t,e){if(this._distance=e,e===0)return null;var o=e<0,u=Math.abs(e),d=this.getSegGen(u);t.length<=1?this.computePointCurve(t[0],d):this.computeOffsetCurve(t,o,d);var w=d.getCoordinates();return o&&re.reverse(w),w},li.prototype.computeSingleSidedBufferCurve=function(t,e,o){var u=this.simplifyTolerance(this._distance);if(e){o.addSegments(t,!0);var d=Yn.simplify(t,-u),w=d.length-1;o.initSideSegments(d[w],d[w-1],It.LEFT),o.addFirstSegment();for(var S=w-2;S>=0;S--)o.addNextSegment(d[S],!0)}else{o.addSegments(t,!1);var U=Yn.simplify(t,u),$=U.length-1;o.initSideSegments(U[0],U[1],It.LEFT),o.addFirstSegment();for(var ut=2;ut<=$;ut++)o.addNextSegment(U[ut],!0)}o.addLastSegment(),o.closeRing()},li.prototype.computeRingBufferCurve=function(t,e,o){var u=this.simplifyTolerance(this._distance);e===It.RIGHT&&(u=-u);var d=Yn.simplify(t,u),w=d.length-1;o.initSideSegments(d[w-1],d[0],e);for(var S=1;S<=w;S++){var U=S!==1;o.addNextSegment(d[S],U)}o.closeRing()},li.prototype.computeLineBufferCurve=function(t,e){var o=this.simplifyTolerance(this._distance),u=Yn.simplify(t,o),d=u.length-1;e.initSideSegments(u[0],u[1],It.LEFT);for(var w=2;w<=d;w++)e.addNextSegment(u[w],!0);e.addLastSegment(),e.addLineEndCap(u[d-1],u[d]);var S=Yn.simplify(t,-o),U=S.length-1;e.initSideSegments(S[U],S[U-1],It.LEFT);for(var $=U-2;$>=0;$--)e.addNextSegment(S[$],!0);e.addLastSegment(),e.addLineEndCap(S[1],S[0]),e.closeRing()},li.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case Be.CAP_ROUND:e.createCircle(t);break;case Be.CAP_SQUARE:e.createSquare(t)}},li.prototype.getLineCurve=function(t,e){if(this._distance=e,e<0&&!this._bufParams.isSingleSided()||e===0)return null;var o=Math.abs(e),u=this.getSegGen(o);if(t.length<=1)this.computePointCurve(t[0],u);else if(this._bufParams.isSingleSided()){var d=e<0;this.computeSingleSidedBufferCurve(t,d,u)}else this.computeLineBufferCurve(t,u);return u.getCoordinates()},li.prototype.getBufferParameters=function(){return this._bufParams},li.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()},li.prototype.getRingCurve=function(t,e,o){if(this._distance=o,t.length<=2)return this.getLineCurve(t,o);if(o===0)return li.copyCoordinates(t);var u=this.getSegGen(o);return this.computeRingBufferCurve(t,e,u),u.getCoordinates()},li.prototype.computeOffsetCurve=function(t,e,o){var u=this.simplifyTolerance(this._distance);if(e){var d=Yn.simplify(t,-u),w=d.length-1;o.initSideSegments(d[w],d[w-1],It.LEFT),o.addFirstSegment();for(var S=w-2;S>=0;S--)o.addNextSegment(d[S],!0)}else{var U=Yn.simplify(t,u),$=U.length-1;o.initSideSegments(U[0],U[1],It.LEFT),o.addFirstSegment();for(var ut=2;ut<=$;ut++)o.addNextSegment(U[ut],!0)}o.addLastSegment()},li.prototype.getSegGen=function(t){return new Bn(this._precisionModel,this._bufParams,t)},li.prototype.interfaces_=function(){return[]},li.prototype.getClass=function(){return li},li.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),o=0;od.getMaxY()||this.findStabbedSegments(t,u.getDirectedEdges(),e)}return e}if(arguments.length===3){if(ct(arguments[2],we)&&arguments[0]instanceof X&&arguments[1]instanceof E){for(var w=arguments[0],S=arguments[1],U=arguments[2],$=S.getEdge().getCoordinates(),ut=0;ut<$.length-1;ut++)if(this._seg.p0=$[ut],this._seg.p1=$[ut+1],this._seg.p0.y>this._seg.p1.y&&this._seg.reverse(),!(Math.max(this._seg.p0.x,this._seg.p1.x)this._seg.p1.y||tt.computeOrientation(this._seg.p0,this._seg.p1,w)===tt.RIGHT)){var _t=S.getDepth(It.LEFT);this._seg.p0.equals($[ut])||(_t=S.getDepth(It.RIGHT));var wt=new ns(this._seg,_t);U.add(wt)}}else if(ct(arguments[2],we)&&arguments[0]instanceof X&&ct(arguments[1],we))for(var zt=arguments[0],qt=arguments[1],ne=arguments[2],oe=qt.iterator();oe.hasNext();){var In=oe.next();In.isForward()&&this.findStabbedSegments(zt,In,ne)}}},es.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);return e.size()===0?0:Gt.min(e)._leftDepth},es.prototype.interfaces_=function(){return[]},es.prototype.getClass=function(){return es},Za.DepthSegment.get=function(){return ns},Object.defineProperties(es,Za);var ns=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new Yt(t),this._leftDepth=e};ns.prototype.compareTo=function(t){var e=t;if(this._upwardSeg.minX()>=e._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=e._upwardSeg.minX())return-1;var o=this._upwardSeg.orientationIndex(e._upwardSeg);return o!==0||(o=-1*e._upwardSeg.orientationIndex(this._upwardSeg))!=0?o:this._upwardSeg.compareTo(e._upwardSeg)},ns.prototype.compareX=function(t,e){var o=t.p0.compareTo(e.p0);return o!==0?o:t.p1.compareTo(e.p1)},ns.prototype.toString=function(){return this._upwardSeg.toString()},ns.prototype.interfaces_=function(){return[H]},ns.prototype.getClass=function(){return ns};var Oe=function(t,e,o){this.p0=t||null,this.p1=e||null,this.p2=o||null};Oe.prototype.area=function(){return Oe.area(this.p0,this.p1,this.p2)},Oe.prototype.signedArea=function(){return Oe.signedArea(this.p0,this.p1,this.p2)},Oe.prototype.interpolateZ=function(t){if(t===null)throw new D("Supplied point is null.");return Oe.interpolateZ(t,this.p0,this.p1,this.p2)},Oe.prototype.longestSideLength=function(){return Oe.longestSideLength(this.p0,this.p1,this.p2)},Oe.prototype.isAcute=function(){return Oe.isAcute(this.p0,this.p1,this.p2)},Oe.prototype.circumcentre=function(){return Oe.circumcentre(this.p0,this.p1,this.p2)},Oe.prototype.area3D=function(){return Oe.area3D(this.p0,this.p1,this.p2)},Oe.prototype.centroid=function(){return Oe.centroid(this.p0,this.p1,this.p2)},Oe.prototype.inCentre=function(){return Oe.inCentre(this.p0,this.p1,this.p2)},Oe.prototype.interfaces_=function(){return[]},Oe.prototype.getClass=function(){return Oe},Oe.area=function(t,e,o){return Math.abs(((o.x-t.x)*(e.y-t.y)-(e.x-t.x)*(o.y-t.y))/2)},Oe.signedArea=function(t,e,o){return((o.x-t.x)*(e.y-t.y)-(e.x-t.x)*(o.y-t.y))/2},Oe.det=function(t,e,o,u){return t*u-e*o},Oe.interpolateZ=function(t,e,o,u){var d=e.x,w=e.y,S=o.x-d,U=u.x-d,$=o.y-w,ut=u.y-w,_t=S*ut-U*$,wt=t.x-d,zt=t.y-w,qt=(ut*wt-U*zt)/_t,ne=(-$*wt+S*zt)/_t;return e.z+qt*(o.z-e.z)+ne*(u.z-e.z)},Oe.longestSideLength=function(t,e,o){var u=t.distance(e),d=e.distance(o),w=o.distance(t),S=u;return d>S&&(S=d),w>S&&(S=w),S},Oe.isAcute=function(t,e,o){return!!_e.isAcute(t,e,o)&&!!_e.isAcute(e,o,t)&&!!_e.isAcute(o,t,e)},Oe.circumcentre=function(t,e,o){var u=o.x,d=o.y,w=t.x-u,S=t.y-d,U=e.x-u,$=e.y-d,ut=2*Oe.det(w,S,U,$),_t=Oe.det(S,w*w+S*S,$,U*U+$*$),wt=Oe.det(w,w*w+S*S,U,U*U+$*$);return new X(u-_t/ut,d+wt/ut)},Oe.perpendicularBisector=function(t,e){var o=e.x-t.x,u=e.y-t.y,d=new ke(t.x+o/2,t.y+u/2,1),w=new ke(t.x-u+o/2,t.y+o+u/2,1);return new ke(d,w)},Oe.angleBisector=function(t,e,o){var u=e.distance(t),d=u/(u+e.distance(o)),w=o.x-t.x,S=o.y-t.y;return new X(t.x+d*w,t.y+d*S)},Oe.area3D=function(t,e,o){var u=e.x-t.x,d=e.y-t.y,w=e.z-t.z,S=o.x-t.x,U=o.y-t.y,$=o.z-t.z,ut=d*$-w*U,_t=w*S-u*$,wt=u*U-d*S,zt=ut*ut+_t*_t+wt*wt,qt=Math.sqrt(zt)/2;return qt},Oe.centroid=function(t,e,o){var u=(t.x+e.x+o.x)/3,d=(t.y+e.y+o.y)/3;return new X(u,d)},Oe.inCentre=function(t,e,o){var u=e.distance(o),d=t.distance(o),w=t.distance(e),S=u+d+w,U=(u*t.x+d*e.x+w*o.x)/S,$=(u*t.y+d*e.y+w*o.y)/S;return new X(U,$)};var _i=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new St;var t=arguments[0],e=arguments[1],o=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=o};_i.prototype.addPoint=function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),o=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(o,Q.EXTERIOR,Q.INTERIOR)},_i.prototype.addPolygon=function(t){var e=this._distance,o=It.LEFT;this._distance<0&&(e=-this._distance,o=It.RIGHT);var u=t.getExteriorRing(),d=re.removeRepeatedPoints(u.getCoordinates());if(this._distance<0&&this.isErodedCompletely(u,this._distance)||this._distance<=0&&d.length<3)return null;this.addPolygonRing(d,e,o,Q.EXTERIOR,Q.INTERIOR);for(var w=0;w0&&this.isErodedCompletely(S,-this._distance)||this.addPolygonRing(U,e,It.opposite(o),Q.INTERIOR,Q.EXTERIOR)}},_i.prototype.isTriangleErodedCompletely=function(t,e){var o=new Oe(t[0],t[1],t[2]),u=o.inCentre();return tt.distancePointLine(u,o.p0,o.p1)=Nr.MINIMUM_VALID_SIZE&&tt.isCCW(t)&&(w=d,S=u,o=It.opposite(o));var U=this._curveBuilder.getRingCurve(t,o,e);this.addCurve(U,w,S)},_i.prototype.add=function(t){if(t.isEmpty())return null;t instanceof bn?this.addPolygon(t):t instanceof kn?this.addLineString(t):t instanceof pr?this.addPoint(t):t instanceof mi?this.addCollection(t):t instanceof ar?this.addCollection(t):t instanceof dr?this.addCollection(t):t instanceof wn&&this.addCollection(t)},_i.prototype.isErodedCompletely=function(t,e){var o=t.getCoordinates();if(o.length<4)return e<0;if(o.length===4)return this.isTriangleErodedCompletely(o,e);var u=t.getEnvelopeInternal(),d=Math.min(u.getHeight(),u.getWidth());return e<0&&2*Math.abs(e)>d},_i.prototype.addCollection=function(t){for(var e=0;e=this._max)throw new a;var t=this._parent.getGeometryN(this._index++);return t instanceof wn?(this._subcollectionIterator=new go(t),this._subcollectionIterator.next()):t},go.prototype.remove=function(){throw new Error(this.getClass().getName())},go.prototype.hasNext=function(){if(this._atStart)return!0;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)},go.prototype.interfaces_=function(){return[An]},go.prototype.getClass=function(){return go},go.isAtomic=function(t){return!(t instanceof wn)};var yi=function(){this._geom=null;var t=arguments[0];this._geom=t};yi.prototype.locate=function(t){return yi.locate(t,this._geom)},yi.prototype.interfaces_=function(){return[Os]},yi.prototype.getClass=function(){return yi},yi.isPointInRing=function(t,e){return!!e.getEnvelopeInternal().intersects(t)&&tt.isPointInRing(t,e.getCoordinates())},yi.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var o=e.getExteriorRing();if(!yi.isPointInRing(t,o))return!1;for(var u=0;u{var i_=Object.create;var bf=Object.defineProperty;var o_=Object.getOwnPropertyDescriptor;var s_=Object.getOwnPropertyNames;var a_=Object.getPrototypeOf,u_=Object.prototype.hasOwnProperty;var se=(r,n)=>()=>(n||r((n={exports:{}}).exports,n),n.exports);var l_=(r,n,s,a)=>{if(n&&typeof n=="object"||typeof n=="function")for(let l of s_(n))!u_.call(r,l)&&l!==s&&bf(r,l,{get:()=>n[l],enumerable:!(a=o_(n,l))||a.enumerable});return r};var On=(r,n,s)=>(s=r!=null?i_(a_(r)):{},l_(n||!r||!r.__esModule?bf(s,"default",{value:r,enumerable:!0}):s,r));var wo=se((qu,Ef)=>{(function(r,n){typeof qu=="object"&&typeof Ef<"u"?n(qu):typeof define=="function"&&define.amd?define(["exports"],n):(r=typeof globalThis<"u"?globalThis:r||self,n(r.leaflet={}))})(qu,function(r){"use strict";var n="1.9.3";function s(i){var f,y,M,O;for(y=1,M=arguments.length;y"u"||!L||!L.Mixin)){i=B(i)?i:[i];for(var f=0;f0?Math.floor(i):Math.ceil(i)};Mt.prototype={clone:function(){return new Mt(this.x,this.y)},add:function(i){return this.clone()._add(ft(i))},_add:function(i){return this.x+=i.x,this.y+=i.y,this},subtract:function(i){return this.clone()._subtract(ft(i))},_subtract:function(i){return this.x-=i.x,this.y-=i.y,this},divideBy:function(i){return this.clone()._divideBy(i)},_divideBy:function(i){return this.x/=i,this.y/=i,this},multiplyBy:function(i){return this.clone()._multiplyBy(i)},_multiplyBy:function(i){return this.x*=i,this.y*=i,this},scaleBy:function(i){return new Mt(this.x*i.x,this.y*i.y)},unscaleBy:function(i){return new Mt(this.x/i.x,this.y/i.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=Xt(this.x),this.y=Xt(this.y),this},distanceTo:function(i){i=ft(i);var f=i.x-this.x,y=i.y-this.y;return Math.sqrt(f*f+y*y)},equals:function(i){return i=ft(i),i.x===this.x&&i.y===this.y},contains:function(i){return i=ft(i),Math.abs(i.x)<=Math.abs(this.x)&&Math.abs(i.y)<=Math.abs(this.y)},toString:function(){return"Point("+P(this.x)+", "+P(this.y)+")"}};function ft(i,f,y){return i instanceof Mt?i:B(i)?new Mt(i[0],i[1]):i==null?i:typeof i=="object"&&"x"in i&&"y"in i?new Mt(i.x,i.y):new Mt(i,f,y)}function Ct(i,f){if(i)for(var y=f?[i,f]:i,M=0,O=y.length;M=this.min.x&&y.x<=this.max.x&&f.y>=this.min.y&&y.y<=this.max.y},intersects:function(i){i=st(i);var f=this.min,y=this.max,M=i.min,O=i.max,W=O.x>=f.x&&M.x<=y.x,at=O.y>=f.y&&M.y<=y.y;return W&&at},overlaps:function(i){i=st(i);var f=this.min,y=this.max,M=i.min,O=i.max,W=O.x>f.x&&M.xf.y&&M.y=f.lat&&O.lat<=y.lat&&M.lng>=f.lng&&O.lng<=y.lng},intersects:function(i){i=Ot(i);var f=this._southWest,y=this._northEast,M=i.getSouthWest(),O=i.getNorthEast(),W=O.lat>=f.lat&&M.lat<=y.lat,at=O.lng>=f.lng&&M.lng<=y.lng;return W&&at},overlaps:function(i){i=Ot(i);var f=this._southWest,y=this._northEast,M=i.getSouthWest(),O=i.getNorthEast(),W=O.lat>f.lat&&M.latf.lng&&M.lng1,Vr=function(){var i=!1;try{var f=Object.defineProperty({},"passive",{get:function(){i=!0}});window.addEventListener("testPassiveEventSupport",x,f),window.removeEventListener("testPassiveEventSupport",x,f)}catch{}return i}(),zn=function(){return!!document.createElement("canvas").getContext}(),cn=!!(document.createElementNS&&Hn("svg").createSVGRect),or=!!cn&&function(){var i=document.createElement("div");return i.innerHTML="",(i.firstChild&&i.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),sr=!cn&&function(){try{var i=document.createElement("div");i.innerHTML='';var f=i.firstChild;return f.style.behavior="url(#default#VML)",f&&typeof f.adj=="object"}catch{return!1}}(),bo=navigator.platform.indexOf("Mac")===0,Wn=navigator.platform.indexOf("Linux")===0;function nr(i){return navigator.userAgent.toLowerCase().indexOf(i)>=0}var Ut={ie:Ht,ielt9:ht,edge:Y,webkit:C,android:b,android23:k,androidStock:Z,opera:J,chrome:tt,gecko:pt,safari:Lt,phantom:vt,opera12:Ft,win:Wt,ie3d:Jt,webkit3d:$t,gecko3d:jt,any3d:ge,mobile:pe,mobileWebkit:Te,mobileWebkit3d:Ce,msPointer:he,pointer:An,touch:St,touchNative:we,mobileOpera:Dn,mobileGecko:Xn,retina:re,passiveEvents:Vr,canvas:zn,svg:cn,vml:sr,inlineSvg:or,mac:bo,linux:Wn},Ei=Ut.msPointer?"MSPointerDown":"pointerdown",oi=Ut.msPointer?"MSPointerMove":"pointermove",xe=Ut.msPointer?"MSPointerUp":"pointerup",Kn=Ut.msPointer?"MSPointerCancel":"pointercancel",$n={touchstart:Ei,touchmove:oi,touchend:xe,touchcancel:Kn},Hr={touchstart:pr,touchmove:Di,touchend:Di,touchcancel:Di},wn={},ar=!1;function Or(i,f,y){return f==="touchstart"&&kn(),Hr[f]?(y=Hr[f].bind(this,y),i.addEventListener($n[f],y,!1),y):(console.warn("wrong event specified:",f),x)}function co(i,f,y){if(!$n[f]){console.warn("wrong event specified:",f);return}i.removeEventListener($n[f],y,!1)}function rr(i){wn[i.pointerId]=i}function Eo(i){wn[i.pointerId]&&(wn[i.pointerId]=i)}function Ln(i){delete wn[i.pointerId]}function kn(){ar||(document.addEventListener(Ei,rr,!0),document.addEventListener(oi,Eo,!0),document.addEventListener(xe,Ln,!0),document.addEventListener(Kn,Ln,!0),ar=!0)}function Di(i,f){if(f.pointerType!==(f.MSPOINTER_TYPE_MOUSE||"mouse")){f.touches=[];for(var y in wn)f.touches.push(wn[y]);f.changedTouches=[f],i(f)}}function pr(i,f){f.MSPOINTER_TYPE_TOUCH&&f.pointerType===f.MSPOINTER_TYPE_TOUCH&&it(f),Di(i,f)}function Mi(i){var f={},y,M;for(M in i)y=i[M],f[M]=y&&y.bind?y.bind(i):y;return i=f,f.type="dblclick",f.detail=2,f.isTrusted=!1,f._simulated=!0,f}var bn=200;function mi(i,f){i.addEventListener("dblclick",f);var y=0,M;function O(W){if(W.detail!==1){M=W.detail;return}if(!(W.pointerType==="mouse"||W.sourceCapabilities&&!W.sourceCapabilities.firesTouchEvents)){var at=ot(W);if(!(at.some(function(xt){return xt instanceof HTMLLabelElement&&xt.attributes.for})&&!at.some(function(xt){return xt instanceof HTMLInputElement||xt instanceof HTMLSelectElement}))){var mt=Date.now();mt-y<=bn?(M++,M===2&&f(Mi(W))):M=1,y=mt}}}return i.addEventListener("click",O),{dblclick:f,simDblclick:O}}function Nr(i,f){i.removeEventListener("dblclick",f.dblclick),i.removeEventListener("click",f.simDblclick)}var dr=$o(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),ur=$o(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),fo=ur==="webkitTransition"||ur==="OTransition"?ur+"End":"transitionend";function Bi(i){return typeof i=="string"?document.getElementById(i):i}function Fi(i,f){var y=i.style[f]||i.currentStyle&&i.currentStyle[f];if((!y||y==="auto")&&document.defaultView){var M=document.defaultView.getComputedStyle(i,null);y=M?M[f]:null}return y==="auto"?null:y}function Le(i,f,y){var M=document.createElement(i);return M.className=f||"",y&&y.appendChild(M),M}function le(i){var f=i.parentNode;f&&f.removeChild(i)}function Rr(i){for(;i.firstChild;)i.removeChild(i.firstChild)}function Un(i){var f=i.parentNode;f&&f.lastChild!==i&&f.appendChild(i)}function Pi(i){var f=i.parentNode;f&&f.firstChild!==i&&f.insertBefore(i,f.firstChild)}function po(i,f){if(i.classList!==void 0)return i.classList.contains(f);var y=Mo(i);return y.length>0&&new RegExp("(^|\\s)"+f+"(\\s|$)").test(y)}function Zt(i,f){if(i.classList!==void 0)for(var y=N(f),M=0,O=y.length;M0?2*window.devicePixelRatio:1;function yt(i){return Ut.edge?i.wheelDeltaY/2:i.deltaY&&i.deltaMode===0?-i.deltaY/Pt:i.deltaY&&i.deltaMode===1?-i.deltaY*20:i.deltaY&&i.deltaMode===2?-i.deltaY*60:i.deltaX||i.deltaZ?0:i.wheelDelta?(i.wheelDeltaY||i.wheelDelta)/2:i.detail&&Math.abs(i.detail)<32765?-i.detail*20:i.detail?i.detail/-32765*60:0}function At(i,f){var y=f.relatedTarget;if(!y)return!0;try{for(;y&&y!==i;)y=y.parentNode}catch{return!1}return y!==i}var Gt={__proto__:null,on:ie,off:Pe,stopPropagation:I,disableScrollPropagation:V,disableClickPropagation:nt,preventDefault:it,stop:rt,getPropagationPath:ot,getMousePosition:dt,getWheelDelta:yt,isExternalTarget:At,addListener:ie,removeListener:Pe},te=bt.extend({run:function(i,f,y,M){this.stop(),this._el=i,this._inProgress=!0,this._duration=y||.25,this._easeOutPower=1/Math.max(M||.5,.2),this._startPos=gr(i),this._offset=f.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=lt(this._animate,this),this._step()},_step:function(i){var f=+new Date-this._startTime,y=this._duration*1e3;fthis.options.maxZoom)?this.setZoom(i):this},panInsideBounds:function(i,f){this._enforcingBounds=!0;var y=this.getCenter(),M=this._limitCenter(y,this._zoom,Ot(i));return y.equals(M)||this.panTo(M,f),this._enforcingBounds=!1,this},panInside:function(i,f){f=f||{};var y=ft(f.paddingTopLeft||f.padding||[0,0]),M=ft(f.paddingBottomRight||f.padding||[0,0]),O=this.project(this.getCenter()),W=this.project(i),at=this.getPixelBounds(),mt=st([at.min.add(y),at.max.subtract(M)]),xt=mt.getSize();if(!mt.contains(W)){this._enforcingBounds=!0;var Nt=W.subtract(mt.getCenter()),ee=mt.extend(W).getSize().subtract(xt);O.x+=Nt.x<0?-ee.x:ee.x,O.y+=Nt.y<0?-ee.y:ee.y,this.panTo(this.unproject(O),f),this._enforcingBounds=!1}return this},invalidateSize:function(i){if(!this._loaded)return this;i=s({animate:!1,pan:!0},i===!0?{animate:!0}:i);var f=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var y=this.getSize(),M=f.divideBy(2).round(),O=y.divideBy(2).round(),W=M.subtract(O);return!W.x&&!W.y?this:(i.animate&&i.pan?this.panBy(W):(i.pan&&this._rawPanBy(W),this.fire("move"),i.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(l(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:f,newSize:y}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(i){if(i=this._locateOptions=s({timeout:1e4,watch:!1},i),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var f=l(this._handleGeolocationResponse,this),y=l(this._handleGeolocationError,this);return i.watch?this._locationWatchId=navigator.geolocation.watchPosition(f,y,i):navigator.geolocation.getCurrentPosition(f,y,i),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(i){if(this._container._leaflet_id){var f=i.code,y=i.message||(f===1?"permission denied":f===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:f,message:"Geolocation error: "+y+"."})}},_handleGeolocationResponse:function(i){if(this._container._leaflet_id){var f=i.coords.latitude,y=i.coords.longitude,M=new Qt(f,y),O=M.toBounds(i.coords.accuracy*2),W=this._locateOptions;if(W.setView){var at=this.getBoundsZoom(O);this.setView(M,W.maxZoom?Math.min(at,W.maxZoom):at)}var mt={latlng:M,bounds:O,timestamp:i.timestamp};for(var xt in i.coords)typeof i.coords[xt]=="number"&&(mt[xt]=i.coords[xt]);this.fire("locationfound",mt)}},addHandler:function(i,f){if(!f)return this;var y=this[i]=new f(this);return this._handlers.push(y),this.options[i]&&y.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new 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}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),le(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(gt(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var i;for(i in this._layers)this._layers[i].remove();for(i in this._panes)le(this._panes[i]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(i,f){var y="leaflet-pane"+(i?" leaflet-"+i.replace("Pane","")+"-pane":""),M=Le("div",y,f||this._mapPane);return i&&(this._panes[i]=M),M},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var i=this.getPixelBounds(),f=this.unproject(i.getBottomLeft()),y=this.unproject(i.getTopRight());return new Rt(f,y)},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(i,f,y){i=Ot(i),y=ft(y||[0,0]);var M=this.getZoom()||0,O=this.getMinZoom(),W=this.getMaxZoom(),at=i.getNorthWest(),mt=i.getSouthEast(),xt=this.getSize().subtract(y),Nt=st(this.project(mt,M),this.project(at,M)).getSize(),ee=Ut.any3d?this.options.zoomSnap:1,ae=xt.x/Nt.x,Se=xt.y/Nt.y,ci=f?Math.max(ae,Se):Math.min(ae,Se);return M=this.getScaleZoom(ci,M),ee&&(M=Math.round(M/(ee/100))*(ee/100),M=f?Math.ceil(M/ee)*ee:Math.floor(M/ee)*ee),Math.max(O,Math.min(W,M))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new Mt(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(i,f){var y=this._getTopLeftPoint(i,f);return new Ct(y,y.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(i){return this.options.crs.getProjectedBounds(i===void 0?this.getZoom():i)},getPane:function(i){return typeof i=="string"?this._panes[i]:i},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(i,f){var y=this.options.crs;return f=f===void 0?this._zoom:f,y.scale(i)/y.scale(f)},getScaleZoom:function(i,f){var y=this.options.crs;f=f===void 0?this._zoom:f;var M=y.zoom(i*y.scale(f));return isNaN(M)?1/0:M},project:function(i,f){return f=f===void 0?this._zoom:f,this.options.crs.latLngToPoint(Tt(i),f)},unproject:function(i,f){return f=f===void 0?this._zoom:f,this.options.crs.pointToLatLng(ft(i),f)},layerPointToLatLng:function(i){var f=ft(i).add(this.getPixelOrigin());return this.unproject(f)},latLngToLayerPoint:function(i){var f=this.project(Tt(i))._round();return f._subtract(this.getPixelOrigin())},wrapLatLng:function(i){return this.options.crs.wrapLatLng(Tt(i))},wrapLatLngBounds:function(i){return this.options.crs.wrapLatLngBounds(Ot(i))},distance:function(i,f){return this.options.crs.distance(Tt(i),Tt(f))},containerPointToLayerPoint:function(i){return ft(i).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(i){return ft(i).add(this._getMapPanePos())},containerPointToLatLng:function(i){var f=this.containerPointToLayerPoint(ft(i));return this.layerPointToLatLng(f)},latLngToContainerPoint:function(i){return this.layerPointToContainerPoint(this.latLngToLayerPoint(Tt(i)))},mouseEventToContainerPoint:function(i){return dt(i,this._container)},mouseEventToLayerPoint:function(i){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(i))},mouseEventToLatLng:function(i){return this.layerPointToLatLng(this.mouseEventToLayerPoint(i))},_initContainer:function(i){var f=this._container=Bi(i);if(f){if(f._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");ie(f,"scroll",this._onScroll,this),this._containerId=g(f)},_initLayout:function(){var i=this._container;this._fadeAnimated=this.options.fadeAnimation&&Ut.any3d,Zt(i,"leaflet-container"+(Ut.touch?" leaflet-touch":"")+(Ut.retina?" leaflet-retina":"")+(Ut.ielt9?" leaflet-oldie":"")+(Ut.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var f=Fi(i,"position");f!=="absolute"&&f!=="relative"&&f!=="fixed"&&f!=="sticky"&&(i.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var i=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),De(this._mapPane,new Mt(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(Zt(i.markerPane,"leaflet-zoom-hide"),Zt(i.shadowPane,"leaflet-zoom-hide"))},_resetView:function(i,f,y){De(this._mapPane,new Mt(0,0));var M=!this._loaded;this._loaded=!0,f=this._limitZoom(f),this.fire("viewprereset");var O=this._zoom!==f;this._moveStart(O,y)._move(i,f)._moveEnd(O),this.fire("viewreset"),M&&this.fire("load")},_moveStart:function(i,f){return i&&this.fire("zoomstart"),f||this.fire("movestart"),this},_move:function(i,f,y,M){f===void 0&&(f=this._zoom);var O=this._zoom!==f;return this._zoom=f,this._lastCenter=i,this._pixelOrigin=this._getNewPixelOrigin(i),M?y&&y.pinch&&this.fire("zoom",y):((O||y&&y.pinch)&&this.fire("zoom",y),this.fire("move",y)),this},_moveEnd:function(i){return i&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return gt(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(i){De(this._mapPane,this._getMapPanePos().subtract(i))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(i){this._targets={},this._targets[g(this._container)]=this;var f=i?Pe:ie;f(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&f(window,"resize",this._onResize,this),Ut.any3d&&this.options.transform3DLimit&&(i?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){gt(this._resizeRequest),this._resizeRequest=lt(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var i=this._getMapPanePos();Math.max(Math.abs(i.x),Math.abs(i.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(i,f){for(var y=[],M,O=f==="mouseout"||f==="mouseover",W=i.target||i.srcElement,at=!1;W;){if(M=this._targets[g(W)],M&&(f==="click"||f==="preclick")&&this._draggableMoved(M)){at=!0;break}if(M&&M.listens(f,!0)&&(O&&!At(W,i)||(y.push(M),O))||W===this._container)break;W=W.parentNode}return!y.length&&!at&&!O&&this.listens(f,!0)&&(y=[this]),y},_isClickDisabled:function(i){for(;i&&i!==this._container;){if(i._leaflet_disable_click)return!0;i=i.parentNode}},_handleDOMEvent:function(i){var f=i.target||i.srcElement;if(!(!this._loaded||f._leaflet_disable_events||i.type==="click"&&this._isClickDisabled(f))){var y=i.type;y==="mousedown"&&Ae(f),this._fireDOMEvent(i,y)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(i,f,y){if(i.type==="click"){var M=s({},i);M.type="preclick",this._fireDOMEvent(M,M.type,y)}var O=this._findEventTargets(i,f);if(y){for(var W=[],at=0;at0?Math.round(i-f)/2:Math.max(0,Math.ceil(i))-Math.max(0,Math.floor(f))},_limitZoom:function(i){var f=this.getMinZoom(),y=this.getMaxZoom(),M=Ut.any3d?this.options.zoomSnap:1;return M&&(i=Math.round(i/M)*M),Math.max(f,Math.min(y,i))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){En(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(i,f){var y=this._getCenterOffset(i)._trunc();return(f&&f.animate)!==!0&&!this.getSize().contains(y)?!1:(this.panBy(y,f),!0)},_createAnimProxy:function(){var i=this._proxy=Le("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(i),this.on("zoomanim",function(f){var y=dr,M=this._proxy.style[y];si(this._proxy,this.project(f.center,f.zoom),this.getZoomScale(f.zoom,1)),M===this._proxy.style[y]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){le(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var i=this.getCenter(),f=this.getZoom();si(this._proxy,this.project(i,f),this.getZoomScale(f,1))},_catchTransitionEnd:function(i){this._animatingZoom&&i.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(i,f,y){if(this._animatingZoom)return!0;if(y=y||{},!this._zoomAnimated||y.animate===!1||this._nothingToAnimate()||Math.abs(f-this._zoom)>this.options.zoomAnimationThreshold)return!1;var M=this.getZoomScale(f),O=this._getCenterOffset(i)._divideBy(1-1/M);return y.animate!==!0&&!this.getSize().contains(O)?!1:(lt(function(){this._moveStart(!0,!1)._animateZoom(i,f,!0)},this),!0)},_animateZoom:function(i,f,y,M){this._mapPane&&(y&&(this._animatingZoom=!0,this._animateToCenter=i,this._animateToZoom=f,Zt(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:i,zoom:f,noUpdate:M}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(l(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&En(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 Rn(i,f){return new Dt(i,f)}var Tn=Q.extend({options:{position:"topright"},initialize:function(i){q(this,i)},getPosition:function(){return this.options.position},setPosition:function(i){var f=this._map;return f&&f.removeControl(this),this.options.position=i,f&&f.addControl(this),this},getContainer:function(){return this._container},addTo:function(i){this.remove(),this._map=i;var f=this._container=this.onAdd(i),y=this.getPosition(),M=i._controlCorners[y];return Zt(f,"leaflet-control"),y.indexOf("bottom")!==-1?M.insertBefore(f,M.firstChild):M.appendChild(f),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(le(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(i){this._map&&i&&i.screenX>0&&i.screenY>0&&this._map.getContainer().focus()}}),Ie=function(i){return new Tn(i)};Dt.include({addControl:function(i){return i.addTo(this),this},removeControl:function(i){return i.remove(),this},_initControlPos:function(){var i=this._controlCorners={},f="leaflet-",y=this._controlContainer=Le("div",f+"control-container",this._container);function M(O,W){var at=f+O+" "+f+W;i[O+W]=Le("div",at,y)}M("top","left"),M("top","right"),M("bottom","left"),M("bottom","right")},_clearControlPos:function(){for(var i in this._controlCorners)le(this._controlCorners[i]);le(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Ar=Tn.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(i,f,y,M){return y1,this._baseLayersList.style.display=i?"":"none"),this._separator.style.display=f&&i?"":"none",this},_onLayerChange:function(i){this._handlingClick||this._update();var f=this._getLayer(g(i.target)),y=f.overlay?i.type==="add"?"overlayadd":"overlayremove":i.type==="add"?"baselayerchange":null;y&&this._map.fire(y,f)},_createRadioElement:function(i,f){var y='",M=document.createElement("div");return M.innerHTML=y,M.firstChild},_addItem:function(i){var f=document.createElement("label"),y=this._map.hasLayer(i.layer),M;i.overlay?(M=document.createElement("input"),M.type="checkbox",M.className="leaflet-control-layers-selector",M.defaultChecked=y):M=this._createRadioElement("leaflet-base-layers_"+g(this),y),this._layerControlInputs.push(M),M.layerId=g(i.layer),ie(M,"click",this._onInputClick,this);var O=document.createElement("span");O.innerHTML=" "+i.name;var W=document.createElement("span");f.appendChild(W),W.appendChild(M),W.appendChild(O);var at=i.overlay?this._overlaysList:this._baseLayersList;return at.appendChild(f),this._checkDisabledLayers(),f},_onInputClick:function(){var i=this._layerControlInputs,f,y,M=[],O=[];this._handlingClick=!0;for(var W=i.length-1;W>=0;W--)f=i[W],y=this._getLayer(f.layerId).layer,f.checked?M.push(y):f.checked||O.push(y);for(W=0;W=0;O--)f=i[O],y=this._getLayer(f.layerId).layer,f.disabled=y.options.minZoom!==void 0&&My.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var i=this._section;ie(i,"click",it),this.expand(),setTimeout(function(){Pe(i,"click",it)})}}),Si=function(i,f,y){return new Ar(i,f,y)},jn=Tn.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(i){var f="leaflet-control-zoom",y=Le("div",f+" leaflet-bar"),M=this.options;return this._zoomInButton=this._createButton(M.zoomInText,M.zoomInTitle,f+"-in",y,this._zoomIn),this._zoomOutButton=this._createButton(M.zoomOutText,M.zoomOutTitle,f+"-out",y,this._zoomOut),this._updateDisabled(),i.on("zoomend zoomlevelschange",this._updateDisabled,this),y},onRemove:function(i){i.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(i){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(i.shiftKey?3:1))},_createButton:function(i,f,y,M,O){var W=Le("a",y,M);return W.innerHTML=i,W.href="#",W.title=f,W.setAttribute("role","button"),W.setAttribute("aria-label",f),nt(W),ie(W,"click",rt),ie(W,"click",O,this),ie(W,"click",this._refocusOnMap,this),W},_updateDisabled:function(){var i=this._map,f="leaflet-disabled";En(this._zoomInButton,f),En(this._zoomOutButton,f),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||i._zoom===i.getMinZoom())&&(Zt(this._zoomOutButton,f),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||i._zoom===i.getMaxZoom())&&(Zt(this._zoomInButton,f),this._zoomInButton.setAttribute("aria-disabled","true"))}});Dt.mergeOptions({zoomControl:!0}),Dt.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new jn,this.addControl(this.zoomControl))});var no=function(i){return new jn(i)},lr=Tn.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(i){var f="leaflet-control-scale",y=Le("div",f),M=this.options;return this._addScales(M,f+"-line",y),i.on(M.updateWhenIdle?"moveend":"move",this._update,this),i.whenReady(this._update,this),y},onRemove:function(i){i.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(i,f,y){i.metric&&(this._mScale=Le("div",f,y)),i.imperial&&(this._iScale=Le("div",f,y))},_update:function(){var i=this._map,f=i.getSize().y/2,y=i.distance(i.containerPointToLatLng([0,f]),i.containerPointToLatLng([this.options.maxWidth,f]));this._updateScales(y)},_updateScales:function(i){this.options.metric&&i&&this._updateMetric(i),this.options.imperial&&i&&this._updateImperial(i)},_updateMetric:function(i){var f=this._getRoundNum(i),y=f<1e3?f+" m":f/1e3+" km";this._updateScale(this._mScale,y,f/i)},_updateImperial:function(i){var f=i*3.2808399,y,M,O;f>5280?(y=f/5280,M=this._getRoundNum(y),this._updateScale(this._iScale,M+" mi",M/y)):(O=this._getRoundNum(f),this._updateScale(this._iScale,O+" ft",O/f))},_updateScale:function(i,f,y){i.style.width=Math.round(this.options.maxWidth*y)+"px",i.innerHTML=f},_getRoundNum:function(i){var f=Math.pow(10,(Math.floor(i)+"").length-1),y=i/f;return y=y>=10?10:y>=5?5:y>=3?3:y>=2?2:1,f*y}}),ki=function(i){return new lr(i)},Gi='',Po=Tn.extend({options:{position:"bottomright",prefix:''+(Ut.inlineSvg?Gi+" ":"")+"Leaflet"},initialize:function(i){q(this,i),this._attributions={}},onAdd:function(i){i.attributionControl=this,this._container=Le("div","leaflet-control-attribution"),nt(this._container);for(var f in i._layers)i._layers[f].getAttribution&&this.addAttribution(i._layers[f].getAttribution());return this._update(),i.on("layeradd",this._addAttribution,this),this._container},onRemove:function(i){i.off("layeradd",this._addAttribution,this)},_addAttribution:function(i){i.layer.getAttribution&&(this.addAttribution(i.layer.getAttribution()),i.layer.once("remove",function(){this.removeAttribution(i.layer.getAttribution())},this))},setPrefix:function(i){return this.options.prefix=i,this._update(),this},addAttribution:function(i){return i?(this._attributions[i]||(this._attributions[i]=0),this._attributions[i]++,this._update(),this):this},removeAttribution:function(i){return i?(this._attributions[i]&&(this._attributions[i]--,this._update()),this):this},_update:function(){if(this._map){var i=[];for(var f in this._attributions)this._attributions[f]&&i.push(f);var y=[];this.options.prefix&&y.push(this.options.prefix),i.length&&y.push(i.join(", ")),this._container.innerHTML=y.join(' ')}}});Dt.mergeOptions({attributionControl:!0}),Dt.addInitHook(function(){this.options.attributionControl&&new Po().addTo(this)});var Zn=function(i){return new Po(i)};Tn.Layers=Ar,Tn.Zoom=jn,Tn.Scale=lr,Tn.Attribution=Po,Ie.layers=Si,Ie.zoom=no,Ie.scale=ki,Ie.attribution=Zn;var Yt=Q.extend({initialize:function(i){this._map=i},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}});Yt.addTo=function(i,f){return i.addHandler(f,this),this};var ua={Events:ct},ts=Ut.touch?"touchstart mousedown":"mousedown",hr=bt.extend({options:{clickTolerance:3},initialize:function(i,f,y,M){q(this,M),this._element=i,this._dragStartTarget=f||i,this._preventOutline=y},enable:function(){this._enabled||(ie(this._dragStartTarget,ts,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(hr._dragging===this&&this.finishDrag(!0),Pe(this._dragStartTarget,ts,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(i){if(this._enabled&&(this._moved=!1,!po(this._element,"leaflet-zoom-anim"))){if(i.touches&&i.touches.length!==1){hr._dragging===this&&this.finishDrag();return}if(!(hr._dragging||i.shiftKey||i.which!==1&&i.button!==1&&!i.touches)&&(hr._dragging=this,this._preventOutline&&Ae(this._element),fn(),ai(),!this._moving)){this.fire("down");var f=i.touches?i.touches[0]:i,y=Nn(this._element);this._startPoint=new Mt(f.clientX,f.clientY),this._startPos=gr(this._element),this._parentScale=ui(y);var M=i.type==="mousedown";ie(document,M?"mousemove":"touchmove",this._onMove,this),ie(document,M?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(i){if(this._enabled){if(i.touches&&i.touches.length>1){this._moved=!0;return}var f=i.touches&&i.touches.length===1?i.touches[0]:i,y=new Mt(f.clientX,f.clientY)._subtract(this._startPoint);!y.x&&!y.y||Math.abs(y.x)+Math.abs(y.y)W&&(at=mt,W=xt);W>y&&(f[at]=1,la(i,f,y,M,at),la(i,f,y,at,O))}function Be(i,f){for(var y=[i[0]],M=1,O=0,W=i.length;Mf&&(y.push(i[M]),O=M);return Of.max.x&&(y|=2),i.yf.max.y&&(y|=8),y}function Fu(i,f){var y=f.x-i.x,M=f.y-i.y;return y*y+M*M}function _e(i,f,y,M){var O=f.x,W=f.y,at=y.x-O,mt=y.y-W,xt=at*at+mt*mt,Nt;return xt>0&&(Nt=((i.x-O)*at+(i.y-W)*mt)/xt,Nt>1?(O=y.x,W=y.y):Nt>0&&(O+=at*Nt,W+=mt*Nt)),at=i.x-O,mt=i.y-W,M?at*at+mt*mt:new Mt(O,W)}function Jr(i){return!B(i[0])||typeof i[0][0]!="object"&&typeof i[0][0]<"u"}function Bn(i){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Jr(i)}function Os(i,f){var y,M,O,W,at,mt,xt,Nt;if(!i||i.length===0)throw new Error("latlngs not passed");Jr(i)||(console.warn("latlngs are not flat! Only the first ring will be used"),i=i[0]);var ee=[];for(var ae in i)ee.push(f.project(Tt(i[ae])));var Se=ee.length;for(y=0,M=0;yM){xt=(W-M)/O,Nt=[mt.x-xt*(mt.x-at.x),mt.y-xt*(mt.y-at.y)];break}return f.unproject(ft(Nt))}var li={__proto__:null,simplify:Wi,pointToSegmentDistance:Do,closestPointOnSegment:Zs,clipSegment:Yn,_getEdgeIntersection:es,_getBitCode:Lr,_sqClosestPointOnSegment:_e,isFlat:Jr,_flat:Bn,polylineCenter:Os};function ns(i,f,y){var M,O=[1,4,2,8],W,at,mt,xt,Nt,ee,ae,Se;for(W=0,ee=i.length;W1e-7;mt++)Nt=O*Math.sin(at),Nt=Math.pow((1-Nt)/(1+Nt),O/2),xt=Math.PI/2-2*Math.atan(W*Nt)-at,at+=xt;return new Qt(at*f,i.x*f/y)}},Ns={__proto__:null,LonLat:Oe,Mercator:_i,SphericalMercator:fe},mo=s({},Re,{code:"EPSG:3395",projection:_i,transformation:function(){var i=.5/(Math.PI*_i.R);return Bt(i,.5,-i,.5)}()}),yi=s({},Re,{code:"EPSG:4326",projection:Oe,transformation:Bt(1/180,1,-1/180,.5)}),Xr=s({},ce,{projection:Oe,transformation:Bt(1,0,-1,0),scale:function(i){return Math.pow(2,i)},zoom:function(i){return Math.log(i)/Math.LN2},distance:function(i,f){var y=f.lng-i.lng,M=f.lat-i.lat;return Math.sqrt(y*y+M*M)},infinite:!0});ce.Earth=Re,ce.EPSG3395=mo,ce.EPSG3857=hn,ce.EPSG900913=Sn,ce.EPSG4326=yi,ce.Simple=Xr;var _o=bt.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(i){return i.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(i){return i&&i.removeLayer(this),this},getPane:function(i){return this._map.getPane(i?this.options[i]||i:this.options.pane)},addInteractiveTarget:function(i){return this._map._targets[g(i)]=this,this},removeInteractiveTarget:function(i){return delete this._map._targets[g(i)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(i){var f=i.target;if(f.hasLayer(this)){if(this._map=f,this._zoomAnimated=f._zoomAnimated,this.getEvents){var y=this.getEvents();f.on(y,this),this.once("remove",function(){f.off(y,this)},this)}this.onAdd(f),this.fire("add"),f.fire("layeradd",{layer:this})}}});Dt.include({addLayer:function(i){if(!i._layerAdd)throw new Error("The provided object is not a Layer.");var f=g(i);return this._layers[f]?this:(this._layers[f]=i,i._mapToAdd=this,i.beforeAdd&&i.beforeAdd(this),this.whenReady(i._layerAdd,i),this)},removeLayer:function(i){var f=g(i);return this._layers[f]?(this._loaded&&i.onRemove(this),delete this._layers[f],this._loaded&&(this.fire("layerremove",{layer:i}),i.fire("remove")),i._map=i._mapToAdd=null,this):this},hasLayer:function(i){return g(i)in this._layers},eachLayer:function(i,f){for(var y in this._layers)i.call(f,this._layers[y]);return this},_addLayers:function(i){i=i?B(i)?i:[i]:[];for(var f=0,y=i.length;fthis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()=2&&f[0]instanceof Qt&&f[0].equals(f[y-1])&&f.pop(),f},_setLatLngs:function(i){Co.prototype._setLatLngs.call(this,i),Jr(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Jr(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var i=this._renderer._bounds,f=this.options.weight,y=new Mt(f,f);if(i=new Ct(i.min.subtract(y),i.max.add(y)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(i))){if(this.options.noClip){this._parts=this._rings;return}for(var M=0,O=this._rings.length,W;Mi.y!=O.y>i.y&&i.x<(O.x-M.x)*(i.y-M.y)/(O.y-M.y)+M.x&&(f=!f);return f||Co.prototype._containsPoint.call(this,i,!0)}});function Ys(i,f){return new vs(i,f)}var qi=br.extend({initialize:function(i,f){q(this,f),this._layers={},i&&this.addData(i)},addData:function(i){var f=B(i)?i:i.features,y,M,O;if(f){for(y=0,M=f.length;y0?M:[f.src];return}B(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(f.style,"objectFit")&&(f.style.objectFit="fill"),f.autoplay=!!this.options.autoplay,f.loop=!!this.options.loop,f.muted=!!this.options.muted,f.playsInline=!!this.options.playsInline;for(var W=0;WO?(f.height=O+"px",Zt(i,W)):En(i,W),this._containerWidth=this._container.offsetWidth},_animateZoom:function(i){var f=this._map._latLngToNewLayerPoint(this._latlng,i.zoom,i.center),y=this._getAnchor();De(this._container,f.add(y))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var i=this._map,f=parseInt(Fi(this._container,"marginBottom"),10)||0,y=this._container.offsetHeight+f,M=this._containerWidth,O=new Mt(this._containerLeft,-y-this._containerBottom);O._add(gr(this._container));var W=i.layerPointToContainerPoint(O),at=ft(this.options.autoPanPadding),mt=ft(this.options.autoPanPaddingTopLeft||at),xt=ft(this.options.autoPanPaddingBottomRight||at),Nt=i.getSize(),ee=0,ae=0;W.x+M+xt.x>Nt.x&&(ee=W.x+M-Nt.x+xt.x),W.x-ee-mt.x<0&&(ee=W.x-mt.x),W.y+y+xt.y>Nt.y&&(ae=W.y+y-Nt.y+xt.y),W.y-ae-mt.y<0&&(ae=W.y-mt.y),(ee||ae)&&(this.options.keepInView&&(this._autopanning=!0),i.fire("autopanstart").panBy([ee,ae]))}},_getAnchor:function(){return ft(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Fr=function(i,f){return new To(i,f)};Dt.mergeOptions({closePopupOnClick:!0}),Dt.include({openPopup:function(i,f,y){return this._initOverlay(To,i,f,y).openOn(this),this},closePopup:function(i){return i=arguments.length?i:this._popup,i&&i.close(),this}}),_o.include({bindPopup:function(i,f){return this._popup=this._initOverlay(To,this._popup,i,f),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(i){return this._popup&&(this instanceof br||(this._popup._source=this),this._popup._prepareOpen(i||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(i){return this._popup&&this._popup.setContent(i),this},getPopup:function(){return this._popup},_openPopup:function(i){if(!(!this._popup||!this._map)){rt(i);var f=i.layer||i.target;if(this._popup._source===f&&!(f instanceof zo)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(i.latlng);return}this._popup._source=f,this.openPopup(i.latlng)}},_movePopup:function(i){this._popup.setLatLng(i.latlng)},_onKeyPress:function(i){i.originalEvent.keyCode===13&&this._openPopup(i)}});var _r=Qr.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(i){Qr.prototype.onAdd.call(this,i),this.setOpacity(this.options.opacity),i.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(i){Qr.prototype.onRemove.call(this,i),i.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var i=Qr.prototype.getEvents.call(this);return this.options.permanent||(i.preclick=this.close),i},_initLayout:function(){var i="leaflet-tooltip",f=i+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=Le("div",f),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+g(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(i){var f,y,M=this._map,O=this._container,W=M.latLngToContainerPoint(M.getCenter()),at=M.layerPointToContainerPoint(i),mt=this.options.direction,xt=O.offsetWidth,Nt=O.offsetHeight,ee=ft(this.options.offset),ae=this._getAnchor();mt==="top"?(f=xt/2,y=Nt):mt==="bottom"?(f=xt/2,y=0):mt==="center"?(f=xt/2,y=Nt/2):mt==="right"?(f=0,y=Nt/2):mt==="left"?(f=xt,y=Nt/2):at.xthis.options.maxZoom||yM?this._retainParent(O,W,at,M):!1)},_retainChildren:function(i,f,y,M){for(var O=2*i;O<2*i+2;O++)for(var W=2*f;W<2*f+2;W++){var at=new Mt(O,W);at.z=y+1;var mt=this._tileCoordsToKey(at),xt=this._tiles[mt];if(xt&&xt.active){xt.retain=!0;continue}else xt&&xt.loaded&&(xt.retain=!0);y+1this.options.maxZoom||this.options.minZoom!==void 0&&O1){this._setView(i,y);return}for(var ae=O.min.y;ae<=O.max.y;ae++)for(var Se=O.min.x;Se<=O.max.x;Se++){var ci=new Mt(Se,ae);if(ci.z=this._tileZoom,!!this._isValidTile(ci)){var jo=this._tiles[this._tileCoordsToKey(ci)];jo?jo.current=!0:at.push(ci)}}if(at.sort(function(Ni,bs){return Ni.distanceTo(W)-bs.distanceTo(W)}),at.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var Ho=document.createDocumentFragment();for(Se=0;Sey.max.x)||!f.wrapLat&&(i.yy.max.y))return!1}if(!this.options.bounds)return!0;var M=this._tileCoordsToBounds(i);return Ot(this.options.bounds).overlaps(M)},_keyToBounds:function(i){return this._tileCoordsToBounds(this._keyToTileCoords(i))},_tileCoordsToNwSe:function(i){var f=this._map,y=this.getTileSize(),M=i.scaleBy(y),O=M.add(y),W=f.unproject(M,i.z),at=f.unproject(O,i.z);return[W,at]},_tileCoordsToBounds:function(i){var f=this._tileCoordsToNwSe(i),y=new Rt(f[0],f[1]);return this.options.noWrap||(y=this._map.wrapLatLngBounds(y)),y},_tileCoordsToKey:function(i){return i.x+":"+i.y+":"+i.z},_keyToTileCoords:function(i){var f=i.split(":"),y=new Mt(+f[0],+f[1]);return y.z=+f[2],y},_removeTile:function(i){var f=this._tiles[i];f&&(le(f.el),delete this._tiles[i],this.fire("tileunload",{tile:f.el,coords:this._keyToTileCoords(i)}))},_initTile:function(i){Zt(i,"leaflet-tile");var f=this.getTileSize();i.style.width=f.x+"px",i.style.height=f.y+"px",i.onselectstart=x,i.onmousemove=x,Ut.ielt9&&this.options.opacity<1&&Kt(i,this.options.opacity)},_addTile:function(i,f){var y=this._getTilePos(i),M=this._tileCoordsToKey(i),O=this.createTile(this._wrapCoords(i),l(this._tileReady,this,i));this._initTile(O),this.createTile.length<2&<(l(this._tileReady,this,i,null,O)),De(O,y),this._tiles[M]={el:O,coords:i,current:!0},f.appendChild(O),this.fire("tileloadstart",{tile:O,coords:i})},_tileReady:function(i,f,y){f&&this.fire("tileerror",{error:f,tile:y,coords:i});var M=this._tileCoordsToKey(i);y=this._tiles[M],y&&(y.loaded=+new Date,this._map._fadeAnimated?(Kt(y.el,0),gt(this._fadeFrame),this._fadeFrame=lt(this._updateOpacity,this)):(y.active=!0,this._pruneTiles()),f||(Zt(y.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:y.el,coords:i})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),Ut.ielt9||!this._map._fadeAnimated?lt(this._pruneTiles,this):setTimeout(l(this._pruneTiles,this),250)))},_getTilePos:function(i){return i.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(i){var f=new Mt(this._wrapX?v(i.x,this._wrapX):i.x,this._wrapY?v(i.y,this._wrapY):i.y);return f.z=i.z,f},_pxBoundsToTileRange:function(i){var f=this.getTileSize();return new Ct(i.min.unscaleBy(f).floor(),i.max.unscaleBy(f).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var i in this._tiles)if(!this._tiles[i].loaded)return!1;return!0}});function Uo(i){return new vo(i)}var Mr=vo.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(i,f){this._url=i,f=q(this,f),f.detectRetina&&Ut.retina&&f.maxZoom>0?(f.tileSize=Math.floor(f.tileSize/2),f.zoomReverse?(f.zoomOffset--,f.minZoom=Math.min(f.maxZoom,f.minZoom+1)):(f.zoomOffset++,f.maxZoom=Math.max(f.minZoom,f.maxZoom-1)),f.minZoom=Math.max(0,f.minZoom)):f.zoomReverse?f.minZoom=Math.min(f.maxZoom,f.minZoom):f.maxZoom=Math.max(f.minZoom,f.maxZoom),typeof f.subdomains=="string"&&(f.subdomains=f.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(i,f){return this._url===i&&f===void 0&&(f=!0),this._url=i,f||this.redraw(),this},createTile:function(i,f){var y=document.createElement("img");return ie(y,"load",l(this._tileOnLoad,this,f,y)),ie(y,"error",l(this._tileOnError,this,f,y)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(y.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(y.referrerPolicy=this.options.referrerPolicy),y.alt="",y.src=this.getTileUrl(i),y},getTileUrl:function(i){var f={r:Ut.retina?"@2x":"",s:this._getSubdomain(i),x:i.x,y:i.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var y=this._globalTileRange.max.y-i.y;this.options.tms&&(f.y=y),f["-y"]=y}return R(this._url,s(f,this.options))},_tileOnLoad:function(i,f){Ut.ielt9?setTimeout(l(i,this,null,f),0):i(null,f)},_tileOnError:function(i,f,y){var M=this.options.errorTileUrl;M&&f.getAttribute("src")!==M&&(f.src=M),i(y,f)},_onTileRemove:function(i){i.tile.onload=null},_getZoomForUrl:function(){var i=this._tileZoom,f=this.options.maxZoom,y=this.options.zoomReverse,M=this.options.zoomOffset;return y&&(i=f-i),i+M},_getSubdomain:function(i){var f=Math.abs(i.x+i.y)%this.options.subdomains.length;return this.options.subdomains[f]},_abortLoading:function(){var i,f;for(i in this._tiles)if(this._tiles[i].coords.z!==this._tileZoom&&(f=this._tiles[i].el,f.onload=x,f.onerror=x,!f.complete)){f.src=A;var y=this._tiles[i].coords;le(f),delete this._tiles[i],this.fire("tileabort",{tile:f,coords:y})}},_removeTile:function(i){var f=this._tiles[i];if(f)return f.el.setAttribute("src",A),vo.prototype._removeTile.call(this,i)},_tileReady:function(i,f,y){if(!(!this._map||y&&y.getAttribute("src")===A))return vo.prototype._tileReady.call(this,i,f,y)}});function ca(i,f){return new Mr(i,f)}var Pr=Mr.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(i,f){this._url=i;var y=s({},this.defaultWmsParams);for(var M in f)M in this.options||(y[M]=f[M]);f=q(this,f);var O=f.detectRetina&&Ut.retina?2:1,W=this.getTileSize();y.width=W.x*O,y.height=W.y*O,this.wmsParams=y},onAdd:function(i){this._crs=this.options.crs||i.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var f=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[f]=this._crs.code,Mr.prototype.onAdd.call(this,i)},getTileUrl:function(i){var f=this._tileCoordsToNwSe(i),y=this._crs,M=st(y.project(f[0]),y.project(f[1])),O=M.min,W=M.max,at=(this._wmsVersion>=1.3&&this._crs===yi?[O.y,O.x,W.y,W.x]:[O.x,O.y,W.x,W.y]).join(","),mt=Mr.prototype.getTileUrl.call(this,i);return mt+z(this.wmsParams,mt,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+at},setParams:function(i,f){return s(this.wmsParams,i),f||this.redraw(),this}});function Ka(i,f){return new Pr(i,f)}Mr.WMS=Pr,ca.wms=Ka;var zr=_o.extend({options:{padding:.1},initialize:function(i){q(this,i),g(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),this._zoomAnimated&&Zt(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 i={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(i.zoomanim=this._onAnimZoom),i},_onAnimZoom:function(i){this._updateTransform(i.center,i.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(i,f){var y=this._map.getZoomScale(f,this._zoom),M=this._map.getSize().multiplyBy(.5+this.options.padding),O=this._map.project(this._center,f),W=M.multiplyBy(-y).add(O).subtract(this._map._getNewPixelOrigin(i,f));Ut.any3d?si(this._container,W,y):De(this._container,W)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var i in this._layers)this._layers[i]._reset()},_onZoomEnd:function(){for(var i in this._layers)this._layers[i]._project()},_updatePaths:function(){for(var i in this._layers)this._layers[i]._update()},_update:function(){var i=this.options.padding,f=this._map.getSize(),y=this._map.containerPointToLayerPoint(f.multiplyBy(-i)).round();this._bounds=new Ct(y,y.add(f.multiplyBy(1+i*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),yr=zr.extend({options:{tolerance:0},getEvents:function(){var i=zr.prototype.getEvents.call(this);return i.viewprereset=this._onViewPreReset,i},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){zr.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var i=this._container=document.createElement("canvas");ie(i,"mousemove",this._onMouseMove,this),ie(i,"click dblclick mousedown mouseup contextmenu",this._onClick,this),ie(i,"mouseout",this._handleMouseOut,this),i._leaflet_disable_events=!0,this._ctx=i.getContext("2d")},_destroyContainer:function(){gt(this._redrawRequest),delete this._ctx,le(this._container),Pe(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var i;this._redrawBounds=null;for(var f in this._layers)i=this._layers[f],i._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){zr.prototype._update.call(this);var i=this._bounds,f=this._container,y=i.getSize(),M=Ut.retina?2:1;De(f,i.min),f.width=M*y.x,f.height=M*y.y,f.style.width=y.x+"px",f.style.height=y.y+"px",Ut.retina&&this._ctx.scale(2,2),this._ctx.translate(-i.min.x,-i.min.y),this.fire("update")}},_reset:function(){zr.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(i){this._updateDashArray(i),this._layers[g(i)]=i;var f=i._order={layer:i,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=f),this._drawLast=f,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(i){this._requestRedraw(i)},_removePath:function(i){var f=i._order,y=f.next,M=f.prev;y?y.prev=M:this._drawLast=M,M?M.next=y:this._drawFirst=y,delete i._order,delete this._layers[g(i)],this._requestRedraw(i)},_updatePath:function(i){this._extendRedrawBounds(i),i._project(),i._update(),this._requestRedraw(i)},_updateStyle:function(i){this._updateDashArray(i),this._requestRedraw(i)},_updateDashArray:function(i){if(typeof i.options.dashArray=="string"){var f=i.options.dashArray.split(/[, ]+/),y=[],M,O;for(O=0;O')}}catch{}return function(i){return document.createElement("<"+i+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),ws={_initContainer:function(){this._container=Le("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(zr.prototype._update.call(this),this.fire("update"))},_initPath:function(i){var f=i._container=ao("shape");Zt(f,"leaflet-vml-shape "+(this.options.className||"")),f.coordsize="1 1",i._path=ao("path"),f.appendChild(i._path),this._updateStyle(i),this._layers[g(i)]=i},_addPath:function(i){var f=i._container;this._container.appendChild(f),i.options.interactive&&i.addInteractiveTarget(f)},_removePath:function(i){var f=i._container;le(f),i.removeInteractiveTarget(f),delete this._layers[g(i)]},_updateStyle:function(i){var f=i._stroke,y=i._fill,M=i.options,O=i._container;O.stroked=!!M.stroke,O.filled=!!M.fill,M.stroke?(f||(f=i._stroke=ao("stroke")),O.appendChild(f),f.weight=M.weight+"px",f.color=M.color,f.opacity=M.opacity,M.dashArray?f.dashStyle=B(M.dashArray)?M.dashArray.join(" "):M.dashArray.replace(/( *, *)/g," "):f.dashStyle="",f.endcap=M.lineCap.replace("butt","flat"),f.joinstyle=M.lineJoin):f&&(O.removeChild(f),i._stroke=null),M.fill?(y||(y=i._fill=ao("fill")),O.appendChild(y),y.color=M.fillColor||M.color,y.opacity=M.fillOpacity):y&&(O.removeChild(y),i._fill=null)},_updateCircle:function(i){var f=i._point.round(),y=Math.round(i._radius),M=Math.round(i._radiusY||y);this._setPath(i,i._empty()?"M0 0":"AL "+f.x+","+f.y+" "+y+","+M+" 0,"+65535*360)},_setPath:function(i,f){i._path.v=f},_bringToFront:function(i){Un(i._container)},_bringToBack:function(i){Pi(i._container)}},Oi=Ut.vml?ao:Hn,xo=zr.extend({_initContainer:function(){this._container=Oi("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Oi("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){le(this._container),Pe(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){zr.prototype._update.call(this);var i=this._bounds,f=i.getSize(),y=this._container;(!this._svgSize||!this._svgSize.equals(f))&&(this._svgSize=f,y.setAttribute("width",f.x),y.setAttribute("height",f.y)),De(y,i.min),y.setAttribute("viewBox",[i.min.x,i.min.y,f.x,f.y].join(" ")),this.fire("update")}},_initPath:function(i){var f=i._path=Oi("path");i.options.className&&Zt(f,i.options.className),i.options.interactive&&Zt(f,"leaflet-interactive"),this._updateStyle(i),this._layers[g(i)]=i},_addPath:function(i){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(i._path),i.addInteractiveTarget(i._path)},_removePath:function(i){le(i._path),i.removeInteractiveTarget(i._path),delete this._layers[g(i)]},_updatePath:function(i){i._project(),i._update()},_updateStyle:function(i){var f=i._path,y=i.options;f&&(y.stroke?(f.setAttribute("stroke",y.color),f.setAttribute("stroke-opacity",y.opacity),f.setAttribute("stroke-width",y.weight),f.setAttribute("stroke-linecap",y.lineCap),f.setAttribute("stroke-linejoin",y.lineJoin),y.dashArray?f.setAttribute("stroke-dasharray",y.dashArray):f.removeAttribute("stroke-dasharray"),y.dashOffset?f.setAttribute("stroke-dashoffset",y.dashOffset):f.removeAttribute("stroke-dashoffset")):f.setAttribute("stroke","none"),y.fill?(f.setAttribute("fill",y.fillColor||y.color),f.setAttribute("fill-opacity",y.fillOpacity),f.setAttribute("fill-rule",y.fillRule||"evenodd")):f.setAttribute("fill","none"))},_updatePoly:function(i,f){this._setPath(i,Me(i._parts,f))},_updateCircle:function(i){var f=i._point,y=Math.max(Math.round(i._radius),1),M=Math.max(Math.round(i._radiusY),1)||y,O="a"+y+","+M+" 0 1,0 ",W=i._empty()?"M0 0":"M"+(f.x-y)+","+f.y+O+y*2+",0 "+O+-y*2+",0 ";this._setPath(i,W)},_setPath:function(i,f){i._path.setAttribute("d",f)},_bringToFront:function(i){Un(i._path)},_bringToBack:function(i){Pi(i._path)}});Ut.vml&&xo.include(ws);function ti(i){return Ut.svg||Ut.vml?new xo(i):null}Dt.include({getRenderer:function(i){var f=i.options.renderer||this._getPaneRenderer(i.options.pane)||this.options.renderer||this._renderer;return f||(f=this._renderer=this._createRenderer()),this.hasLayer(f)||this.addLayer(f),f},_getPaneRenderer:function(i){if(i==="overlayPane"||i===void 0)return!1;var f=this._paneRenderers[i];return f===void 0&&(f=this._createRenderer({pane:i}),this._paneRenderers[i]=f),f},_createRenderer:function(i){return this.options.preferCanvas&&Hi(i)||ti(i)}});var uo=vs.extend({initialize:function(i,f){vs.prototype.initialize.call(this,this._boundsToLatLngs(i),f)},setBounds:function(i){return this.setLatLngs(this._boundsToLatLngs(i))},_boundsToLatLngs:function(i){return i=Ot(i),[i.getSouthWest(),i.getNorthWest(),i.getNorthEast(),i.getSouthEast()]}});function er(i,f){return new uo(i,f)}xo.create=Oi,xo.pointsToPath=Me,qi.geometryToLayer=Vs,qi.coordsToLatLng=Go,qi.coordsToLatLngs=Ui,qi.latLngToCoords=mr,qi.latLngsToCoords=qo,qi.getFeature=cr,qi.asFeature=ji,Dt.mergeOptions({boxZoom:!0});var Ja=Yt.extend({initialize:function(i){this._map=i,this._container=i._container,this._pane=i._panes.overlayPane,this._resetStateTimeout=0,i.on("unload",this._destroy,this)},addHooks:function(){ie(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Pe(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){le(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(i){if(!i.shiftKey||i.which!==1&&i.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),ai(),fn(),this._startPoint=this._map.mouseEventToContainerPoint(i),ie(document,{contextmenu:rt,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(i){this._moved||(this._moved=!0,this._box=Le("div","leaflet-zoom-box",this._container),Zt(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(i);var f=new Ct(this._point,this._startPoint),y=f.getSize();De(this._box,f.min),this._box.style.width=y.x+"px",this._box.style.height=y.y+"px"},_finish:function(){this._moved&&(le(this._box),En(this._container,"leaflet-crosshair")),Vi(),Qn(),Pe(document,{contextmenu:rt,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(i){if(!(i.which!==1&&i.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(l(this._resetState,this),0);var f=new Rt(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(f).fire("boxzoomend",{boxZoomBounds:f})}},_onKeyDown:function(i){i.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});Dt.addInitHook("addHandler","boxZoom",Ja),Dt.mergeOptions({doubleClickZoom:!0});var $a=Yt.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(i){var f=this._map,y=f.getZoom(),M=f.options.zoomDelta,O=i.originalEvent.shiftKey?y-M:y+M;f.options.doubleClickZoom==="center"?f.setZoom(O):f.setZoomAround(i.containerPoint,O)}});Dt.addInitHook("addHandler","doubleClickZoom",$a),Dt.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var Yr=Yt.extend({addHooks:function(){if(!this._draggable){var i=this._map;this._draggable=new hr(i._mapPane,i._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),i.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),i.on("zoomend",this._onZoomEnd,this),i.whenReady(this._onZoomEnd,this))}Zt(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){En(this._map._container,"leaflet-grab"),En(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 i=this._map;if(i._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var f=Ot(this._map.options.maxBounds);this._offsetLimit=st(this._map.latLngToContainerPoint(f.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(f.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;i.fire("movestart").fire("dragstart"),i.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(i){if(this._map.options.inertia){var f=this._lastTime=+new Date,y=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(y),this._times.push(f),this._prunePositions(f)}this._map.fire("move",i).fire("drag",i)},_prunePositions:function(i){for(;this._positions.length>1&&i-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var i=this._map.getSize().divideBy(2),f=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=f.subtract(i).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(i,f){return i-(i-f)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var i=this._draggable._newPos.subtract(this._draggable._startPos),f=this._offsetLimit;i.xf.max.x&&(i.x=this._viscousLimit(i.x,f.max.x)),i.y>f.max.y&&(i.y=this._viscousLimit(i.y,f.max.y)),this._draggable._newPos=this._draggable._startPos.add(i)}},_onPreDragWrap:function(){var i=this._worldWidth,f=Math.round(i/2),y=this._initialWorldOffset,M=this._draggable._newPos.x,O=(M-f+y)%i+f-y,W=(M+f+y)%i-f-y,at=Math.abs(O+y)0?W:-W))-f;this._delta=0,this._startTime=null,at&&(i.options.scrollWheelZoom==="center"?i.setZoom(f+at):i.setZoomAround(this._lastMousePos,f+at))}});Dt.addInitHook("addHandler","scrollWheelZoom",fa);var Ls=600;Dt.mergeOptions({tapHold:Ut.touchNative&&Ut.safari&&Ut.mobile,tapTolerance:15});var Oo=Yt.extend({addHooks:function(){ie(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Pe(this._map._container,"touchstart",this._onDown,this)},_onDown:function(i){if(clearTimeout(this._holdTimeout),i.touches.length===1){var f=i.touches[0];this._startPos=this._newPos=new Mt(f.clientX,f.clientY),this._holdTimeout=setTimeout(l(function(){this._cancel(),this._isTapValid()&&(ie(document,"touchend",it),ie(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",f))},this),Ls),ie(document,"touchend touchcancel contextmenu",this._cancel,this),ie(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function i(){Pe(document,"touchend",it),Pe(document,"touchend touchcancel",i)},_cancel:function(){clearTimeout(this._holdTimeout),Pe(document,"touchend touchcancel contextmenu",this._cancel,this),Pe(document,"touchmove",this._onMove,this)},_onMove:function(i){var f=i.touches[0];this._newPos=new Mt(f.clientX,f.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(i,f){var y=new MouseEvent(i,{bubbles:!0,cancelable:!0,view:window,screenX:f.screenX,screenY:f.screenY,clientX:f.clientX,clientY:f.clientY});y._simulated=!0,f.target.dispatchEvent(y)}});Dt.addInitHook("addHandler","tapHold",Oo),Dt.mergeOptions({touchZoom:Ut.touch,bounceAtZoomLimits:!0});var vr=Yt.extend({addHooks:function(){Zt(this._map._container,"leaflet-touch-zoom"),ie(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){En(this._map._container,"leaflet-touch-zoom"),Pe(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(i){var f=this._map;if(!(!i.touches||i.touches.length!==2||f._animatingZoom||this._zooming)){var y=f.mouseEventToContainerPoint(i.touches[0]),M=f.mouseEventToContainerPoint(i.touches[1]);this._centerPoint=f.getSize()._divideBy(2),this._startLatLng=f.containerPointToLatLng(this._centerPoint),f.options.touchZoom!=="center"&&(this._pinchStartLatLng=f.containerPointToLatLng(y.add(M)._divideBy(2))),this._startDist=y.distanceTo(M),this._startZoom=f.getZoom(),this._moved=!1,this._zooming=!0,f._stop(),ie(document,"touchmove",this._onTouchMove,this),ie(document,"touchend touchcancel",this._onTouchEnd,this),it(i)}},_onTouchMove:function(i){if(!(!i.touches||i.touches.length!==2||!this._zooming)){var f=this._map,y=f.mouseEventToContainerPoint(i.touches[0]),M=f.mouseEventToContainerPoint(i.touches[1]),O=y.distanceTo(M)/this._startDist;if(this._zoom=f.getScaleZoom(O,this._startZoom),!f.options.bounceAtZoomLimits&&(this._zoomf.getMaxZoom()&&O>1)&&(this._zoom=f._limitZoom(this._zoom)),f.options.touchZoom==="center"){if(this._center=this._startLatLng,O===1)return}else{var W=y._add(M)._divideBy(2)._subtract(this._centerPoint);if(O===1&&W.x===0&&W.y===0)return;this._center=f.unproject(f.project(this._pinchStartLatLng,this._zoom).subtract(W),this._zoom)}this._moved||(f._moveStart(!0,!1),this._moved=!0),gt(this._animRequest);var at=l(f._move,f,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=lt(at,this,!0),it(i)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,gt(this._animRequest),Pe(document,"touchmove",this._onTouchMove,this),Pe(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))}});Dt.addInitHook("addHandler","touchZoom",vr),Dt.BoxZoom=Ja,Dt.DoubleClickZoom=$a,Dt.Drag=Yr,Dt.Keyboard=Io,Dt.ScrollWheelZoom=fa,Dt.TapHold=Oo,Dt.TouchZoom=vr,r.Bounds=Ct,r.Browser=Ut,r.CRS=ce,r.Canvas=yr,r.Circle=yo,r.CircleMarker=ys,r.Class=Q,r.Control=Tn,r.DivIcon=Ii,r.DivOverlay=Qr,r.DomEvent=Gt,r.DomUtil=Qo,r.Draggable=hr,r.Evented=bt,r.FeatureGroup=br,r.GeoJSON=qi,r.GridLayer=vo,r.Handler=Yt,r.Icon=Dr,r.ImageOverlay=oo,r.LatLng=Qt,r.LatLngBounds=Rt,r.Layer=_o,r.LayerGroup=_s,r.LineUtil=li,r.Map=Dt,r.Marker=Ki,r.Mixin=ua,r.Path=zo,r.Point=Mt,r.PolyUtil=rs,r.Polygon=vs,r.Polyline=Co,r.Popup=To,r.PosAnimation=te,r.Projection=Ns,r.Rectangle=uo,r.Renderer=zr,r.SVG=xo,r.SVGOverlay=Zr,r.TileLayer=Mr,r.Tooltip=_r,r.Transformation=ke,r.Util=Et,r.VideoOverlay=Er,r.bind=l,r.bounds=st,r.canvas=Hi,r.circle=io,r.circleMarker=$r,r.control=Ie,r.divIcon=Wa,r.extend=s,r.featureGroup=is,r.geoJSON=ha,r.geoJson=xs,r.gridLayer=Uo,r.icon=ro,r.imageOverlay=ko,r.latLng=Tt,r.latLngBounds=Ot,r.layerGroup=Bo,r.map=Rn,r.marker=Br,r.point=ft,r.polygon=Ys,r.polyline=hi,r.popup=Fr,r.rectangle=er,r.setOptions=q,r.stamp=g,r.svg=ti,r.svgOverlay=zu,r.tileLayer=ca,r.tooltip=so,r.transformation=Bt,r.version=n,r.videoOverlay=Ji;var ei=window.L;r.noConflict=function(){return window.L=ei,this},window.L=r})});var Pf=se((Mf,oh)=>{(function(r,n){typeof define=="function"&&define.amd?define(["leaflet"],r):typeof Mf=="object"&&(typeof n<"u"&&n.L?oh.exports=r(L):oh.exports=r(wo())),typeof n<"u"&&n.L&&(n.L.Control.Locate=r(L))})(function(r){let n=(m,v,x)=>{x=x.split(" "),x.forEach(function(P){r.DomUtil[m].call(this,v,P)})},s=(m,v)=>n("addClass",m,v),a=(m,v)=>n("removeClass",m,v),l=r.Marker.extend({initialize(m,v){r.Util.setOptions(this,v),this._latlng=m,this.createIcon()},createIcon(){let m=this.options,v="";m.color!==void 0&&(v+=`stroke:${m.color};`),m.weight!==void 0&&(v+=`stroke-width:${m.weight};`),m.fillColor!==void 0&&(v+=`fill:${m.fillColor};`),m.fillOpacity!==void 0&&(v+=`fill-opacity:${m.fillOpacity};`),m.opacity!==void 0&&(v+=`opacity:${m.opacity};`);let x=this._getIconSVG(m,v);this._locationIcon=r.divIcon({className:x.className,html:x.svg,iconSize:[x.w,x.h]}),this.setIcon(this._locationIcon)},_getIconSVG(m,v){let x=m.radius,P=m.weight,T=x+P,N=T*2;return{className:"leaflet-control-locate-location",svg:`',w:N,h:N}},setStyle(m){r.Util.setOptions(this,m),this.createIcon()}}),c=l.extend({initialize(m,v,x){r.Util.setOptions(this,x),this._latlng=m,this._heading=v,this.createIcon()},setHeading(m){this._heading=m},_getIconSVG(m,v){let x=m.radius,P=m.width+m.weight,T=(x+m.depth+m.weight)*2,N=`M0,0 l${m.width/2},${m.depth} l-${P},0 z`,q=`transform: rotate(${this._heading}deg)`;return{className:"leaflet-control-locate-heading",svg:`',w:P,h:T}}}),g=r.Control.extend({options:{position:"topleft",layer:void 0,setView:"untilPanOrZoom",keepCurrentZoomLevel:!1,initialZoomLevel:!1,getLocationBounds(m){return m.bounds},flyTo:!1,clickBehavior:{inView:"stop",outOfView:"setView",inViewNotFollowing:"inView"},returnToPrevBounds:!1,cacheLocation:!0,drawCircle:!0,drawMarker:!0,showCompass:!0,markerClass:l,compassClass:c,circleStyle:{className:"leaflet-control-locate-circle",color:"#136AEC",fillColor:"#136AEC",fillOpacity:.15,weight:0},markerStyle:{className:"leaflet-control-locate-marker",color:"#fff",fillColor:"#2A93EE",fillOpacity:1,weight:3,opacity:1,radius:9},compassStyle:{fillColor:"#2A93EE",fillOpacity:1,weight:0,color:"#fff",opacity:1,radius:9,width:9,depth:6},followCircleStyle:{},followMarkerStyle:{},followCompassStyle:{},icon:"leaflet-control-locate-location-arrow",iconLoading:"leaflet-control-locate-spinner",iconElementTag:"span",textElementTag:"small",circlePadding:[0,0],metric:!0,createButtonCallback(m,v){let x=r.DomUtil.create("a","leaflet-bar-part leaflet-bar-part-single",m);x.title=v.strings.title,x.href="#",x.setAttribute("role","button");let P=r.DomUtil.create(v.iconElementTag,v.icon,x);if(v.strings.text!==void 0){let T=r.DomUtil.create(v.textElementTag,"leaflet-locate-text",x);T.textContent=v.strings.text,x.classList.add("leaflet-locate-text-active"),x.parentNode.style.display="flex",v.icon.length>0&&P.classList.add("leaflet-locate-icon")}return{link:x,icon:P}},onLocationError(m,v){alert(m.message)},onLocationOutsideMapBounds(m){m.stop(),alert(m.options.strings.outsideMapBoundsMsg)},showPopup:!0,strings:{title:"Show me where I am",metersUnit:"meters",feetUnit:"feet",popup:"You are within {distance} {unit} from this point",outsideMapBoundsMsg:"You seem located outside the boundaries of the map"},locateOptions:{maxZoom:1/0,watch:!0,setView:!1}},initialize(m){for(let v in m)typeof this.options[v]=="object"?r.extend(this.options[v],m[v]):this.options[v]=m[v];this.options.followMarkerStyle=r.extend({},this.options.markerStyle,this.options.followMarkerStyle),this.options.followCircleStyle=r.extend({},this.options.circleStyle,this.options.followCircleStyle),this.options.followCompassStyle=r.extend({},this.options.compassStyle,this.options.followCompassStyle)},onAdd(m){let v=r.DomUtil.create("div","leaflet-control-locate leaflet-bar leaflet-control");this._container=v,this._map=m,this._layer=this.options.layer||new r.LayerGroup,this._layer.addTo(m),this._event=void 0,this._compassHeading=null,this._prevBounds=null;let x=this.options.createButtonCallback(v,this.options);return this._link=x.link,this._icon=x.icon,r.DomEvent.on(this._link,"click",function(P){r.DomEvent.stopPropagation(P),r.DomEvent.preventDefault(P),this._onClick()},this).on(this._link,"dblclick",r.DomEvent.stopPropagation),this._resetVariables(),this._map.on("unload",this._unload,this),v},_onClick(){this._justClicked=!0;let m=this._isFollowing();if(this._userPanned=!1,this._userZoomed=!1,this._active&&!this._event)this.stop();else if(this._active){let v=this.options.clickBehavior,x=v.outOfView;switch(this._map.getBounds().contains(this._event.latlng)&&(x=m?v.inView:v.inViewNotFollowing),v[x]&&(x=v[x]),x){case"setView":this.setView();break;case"stop":this.stop(),this.options.returnToPrevBounds&&(this.options.flyTo?this._map.flyToBounds:this._map.fitBounds).bind(this._map)(this._prevBounds);break}}else this.options.returnToPrevBounds&&(this._prevBounds=this._map.getBounds()),this.start();this._updateContainerStyle()},start(){this._activate(),this._event&&(this._drawMarker(this._map),this.options.setView&&this.setView()),this._updateContainerStyle()},stop(){this._deactivate(),this._cleanClasses(),this._resetVariables(),this._removeMarker()},stopFollowing(){this._userPanned=!0,this._updateContainerStyle(),this._drawMarker()},_activate(){if(!this._active&&(this._map.locate(this.options.locateOptions),this._map.fire("locateactivate",this),this._active=!0,this._map.on("locationfound",this._onLocationFound,this),this._map.on("locationerror",this._onLocationError,this),this._map.on("dragstart",this._onDrag,this),this._map.on("zoomstart",this._onZoom,this),this._map.on("zoomend",this._onZoomEnd,this),this.options.showCompass)){let m="ondeviceorientationabsolute"in window;if(m||"ondeviceorientation"in window){let v=this,x=function(){r.DomEvent.on(window,m?"deviceorientationabsolute":"deviceorientation",v._onDeviceOrientation,v)};DeviceOrientationEvent&&typeof DeviceOrientationEvent.requestPermission=="function"?DeviceOrientationEvent.requestPermission().then(function(P){P==="granted"&&x()}):x()}}},_deactivate(){this._map.stopLocate(),this._map.fire("locatedeactivate",this),this._active=!1,this.options.cacheLocation||(this._event=void 0),this._map.off("locationfound",this._onLocationFound,this),this._map.off("locationerror",this._onLocationError,this),this._map.off("dragstart",this._onDrag,this),this._map.off("zoomstart",this._onZoom,this),this._map.off("zoomend",this._onZoomEnd,this),this.options.showCompass&&(this._compassHeading=null,"ondeviceorientationabsolute"in window?r.DomEvent.off(window,"deviceorientationabsolute",this._onDeviceOrientation,this):"ondeviceorientation"in window&&r.DomEvent.off(window,"deviceorientation",this._onDeviceOrientation,this))},setView(){if(this._drawMarker(),this._isOutsideMapBounds())this._event=void 0,this.options.onLocationOutsideMapBounds(this);else if(this._justClicked&&this.options.initialZoomLevel!==!1){var m=this.options.flyTo?this._map.flyTo:this._map.setView;m.bind(this._map)([this._event.latitude,this._event.longitude],this.options.initialZoomLevel)}else if(this.options.keepCurrentZoomLevel){var m=this.options.flyTo?this._map.flyTo:this._map.panTo;m.bind(this._map)([this._event.latitude,this._event.longitude])}else{var m=this.options.flyTo?this._map.flyToBounds:this._map.fitBounds;this._ignoreEvent=!0,m.bind(this._map)(this.options.getLocationBounds(this._event),{padding:this.options.circlePadding,maxZoom:this.options.initialZoomLevel||this.options.locateOptions.maxZoom}),r.Util.requestAnimFrame(function(){this._ignoreEvent=!1},this)}},_drawCompass(){if(!this._event)return;let m=this._event.latlng;if(this.options.showCompass&&m&&this._compassHeading!==null){let v=this._isFollowing()?this.options.followCompassStyle:this.options.compassStyle;this._compass?(this._compass.setLatLng(m),this._compass.setHeading(this._compassHeading),this._compass.setStyle&&this._compass.setStyle(v)):this._compass=new this.options.compassClass(m,this._compassHeading,v).addTo(this._layer)}this._compass&&(!this.options.showCompass||this._compassHeading===null)&&(this._compass.removeFrom(this._layer),this._compass=null)},_drawMarker(){this._event.accuracy===void 0&&(this._event.accuracy=0);let m=this._event.accuracy,v=this._event.latlng;if(this.options.drawCircle){let q=this._isFollowing()?this.options.followCircleStyle:this.options.circleStyle;this._circle?this._circle.setLatLng(v).setRadius(m).setStyle(q):this._circle=r.circle(v,m,q).addTo(this._layer)}let x,P;if(this.options.metric?(x=m.toFixed(0),P=this.options.strings.metersUnit):(x=(m*3.2808399).toFixed(0),P=this.options.strings.feetUnit),this.options.drawMarker){let q=this._isFollowing()?this.options.followMarkerStyle:this.options.markerStyle;this._marker?(this._marker.setLatLng(v),this._marker.setStyle&&this._marker.setStyle(q)):this._marker=new this.options.markerClass(v,q).addTo(this._layer)}this._drawCompass();let T=this.options.strings.popup;function N(){return typeof T=="string"?r.Util.template(T,{distance:x,unit:P}):typeof T=="function"?T({distance:x,unit:P}):T}this.options.showPopup&&T&&this._marker&&this._marker.bindPopup(N())._popup.setLatLng(v),this.options.showPopup&&T&&this._compass&&this._compass.bindPopup(N())._popup.setLatLng(v)},_removeMarker(){this._layer.clearLayers(),this._marker=void 0,this._circle=void 0},_unload(){this.stop(),this._map.off("unload",this._unload,this)},_setCompassHeading(m){!isNaN(parseFloat(m))&&isFinite(m)?(m=Math.round(m),this._compassHeading=m,r.Util.requestAnimFrame(this._drawCompass,this)):this._compassHeading=null},_onCompassNeedsCalibration(){this._setCompassHeading()},_onDeviceOrientation(m){this._active&&(m.webkitCompassHeading?this._setCompassHeading(m.webkitCompassHeading):m.absolute&&m.alpha&&this._setCompassHeading(360-m.alpha))},_onLocationError(m){m.code==3&&this.options.locateOptions.watch||(this.stop(),this.options.onLocationError(m,this))},_onLocationFound(m){if(!(this._event&&this._event.latlng.lat===m.latlng.lat&&this._event.latlng.lng===m.latlng.lng&&this._event.accuracy===m.accuracy)&&this._active){switch(this._event=m,this._drawMarker(),this._updateContainerStyle(),this.options.setView){case"once":this._justClicked&&this.setView();break;case"untilPan":this._userPanned||this.setView();break;case"untilPanOrZoom":!this._userPanned&&!this._userZoomed&&this.setView();break;case"always":this.setView();break;case!1:break}this._justClicked=!1}},_onDrag(){this._event&&!this._ignoreEvent&&(this._userPanned=!0,this._updateContainerStyle(),this._drawMarker())},_onZoom(){this._event&&!this._ignoreEvent&&(this._userZoomed=!0,this._updateContainerStyle(),this._drawMarker())},_onZoomEnd(){this._event&&this._drawCompass(),this._event&&!this._ignoreEvent&&this._marker&&!this._map.getBounds().pad(-.3).contains(this._marker.getLatLng())&&(this._userPanned=!0,this._updateContainerStyle(),this._drawMarker())},_isFollowing(){if(!this._active)return!1;if(this.options.setView==="always")return!0;if(this.options.setView==="untilPan")return!this._userPanned;if(this.options.setView==="untilPanOrZoom")return!this._userPanned&&!this._userZoomed},_isOutsideMapBounds(){return this._event===void 0?!1:this._map.options.maxBounds&&!this._map.options.maxBounds.contains(this._event.latlng)},_updateContainerStyle(){this._container&&(this._active&&!this._event?this._setClasses("requesting"):this._isFollowing()?this._setClasses("following"):this._active?this._setClasses("active"):this._cleanClasses())},_setClasses(m){m=="requesting"?(a(this._container,"active following"),s(this._container,"requesting"),a(this._icon,this.options.icon),s(this._icon,this.options.iconLoading)):m=="active"?(a(this._container,"requesting following"),s(this._container,"active"),a(this._icon,this.options.iconLoading),s(this._icon,this.options.icon)):m=="following"&&(a(this._container,"requesting"),s(this._container,"active following"),a(this._icon,this.options.iconLoading),s(this._icon,this.options.icon))},_cleanClasses(){r.DomUtil.removeClass(this._container,"requesting"),r.DomUtil.removeClass(this._container,"active"),r.DomUtil.removeClass(this._container,"following"),a(this._icon,this.options.iconLoading),s(this._icon,this.options.icon)},_resetVariables(){this._active=!1,this._justClicked=!1,this._userPanned=!1,this._userZoomed=!1}});return r.control.locate=m=>new r.Control.Locate(m),g},window)});var Cf=se((ew,sh)=>{(function(r){if(typeof define=="function"&&define.amd)define(["leaflet"],r);else if(typeof sh<"u")sh.exports=r(wo());else{if(typeof window.L>"u")throw new Error("Leaflet must be loaded first");r(window.L)}})(function(r){var n="polyline-measure-control",s="polyline-measure-unicode-icon";return r.Control.PolylineMeasure=r.Control.extend({options:{position:"topleft",unit:"metres",clearMeasurementsOnStop:!0,showBearings:!1,bearingTextIn:"In",bearingTextOut:"Out",tooltipTextFinish:"Click to finish line
",tooltipTextDelete:"Press SHIFT-key and click to delete point",tooltipTextMove:"Click and drag to move point
",tooltipTextResume:"
Press CTRL-key and click to resume line",tooltipTextAdd:"Press CTRL-key and click to add point",measureControlTitleOn:"Turn on PolylineMeasure",measureControlTitleOff:"Turn off PolylineMeasure",measureControlLabel:"↦",measureControlClasses:[],showClearControl:!1,clearControlTitle:"Clear Measurements",clearControlLabel:"×",clearControlClasses:[],showUnitControl:!1,distanceShowSameUnit:!1,unitControlTitle:{text:"Change Units",metres:"metres",landmiles:"land miles",nauticalmiles:"nautical miles"},unitControlLabel:{metres:"m",kilometres:"km",feet:"ft",landmiles:"mi",nauticalmiles:"nm"},tempLine:{color:"#00f",weight:2},fixedLine:{color:"#006",weight:2},startCircle:{color:"#000",weight:1,fillColor:"#0f0",fillOpacity:1,radius:3},intermedCircle:{color:"#000",weight:1,fillColor:"#ff0",fillOpacity:1,radius:3},currentCircle:{color:"#000",weight:1,fillColor:"#f0f",fillOpacity:1,radius:6},endCircle:{color:"#000",weight:1,fillColor:"#f00",fillOpacity:1,radius:3}},_arcpoints:100,_circleNr:-1,_lineNr:-1,_createControl:function(a,l,c,g,m,v){var x=document.createElement("a");return x.innerHTML=a,x.setAttribute("title",l),c.forEach(function(P){x.classList.add(P)}),r.DomEvent.on(x,"click",m,v),g.appendChild(x),x},onAdd:function(a){var l=this;a.on("movestart ",function(){l._mapdragging=!0}),this._container=document.createElement("div"),this._container.classList.add("leaflet-bar"),r.DomEvent.disableClickPropagation(this._container);var c=this.options.measureControlTitleOn,g=this.options.measureControlLabel,m=this.options.measureControlClasses;if(g.indexOf("&")!=-1&&m.push(s),this._arrPolylines=[],this._measureControl=this._createControl(g,c,m,this._container,this._toggleMeasure,this),this._defaultControlBgColor=this._measureControl.style.backgroundColor,this._measureControl.setAttribute("id",n),this.options.showClearControl){var c=this.options.clearControlTitle,g=this.options.clearControlLabel,m=this.options.clearControlClasses;g.indexOf("&")!=-1&&m.push(s),this._clearMeasureControl=this._createControl(g,c,m,this._container,this._clearAllMeasurements,this),this._clearMeasureControl.classList.add("polyline-measure-clearControl")}if(this.options.showUnitControl){if(this.options.unit=="metres")var g=this.options.unitControlLabel.metres,c=this.options.unitControlTitle.text+" ["+this.options.unitControlTitle.metres+"]";else if(this.options.unit=="landmiles")var g=this.options.unitControlLabel.landmiles,c=this.options.unitControlTitle.text+" ["+this.options.unitControlTitle.landmiles+"]";else var g=this.options.unitControlLabel.nauticalmiles,c=this.options.unitControlTitle.text+" ["+this.options.unitControlTitle.nauticalmiles+"]";var m=[];this._unitControl=this._createControl(g,c,m,this._container,this._changeUnit,this),this._unitControl.setAttribute("id","unitControlId")}return this._container},onRemove:function(){this._measuring&&this._toggleMeasure()},_saveNonpolylineEvents:function(){this._nonpolylineTargets=this._map._targets,typeof this._polylineTargets<"u"?this._map._targets=this._polylineTargets:this._map._targets={}},_savePolylineEvents:function(){this._polylineTargets=this._map._targets,this._map._targets=this._nonpolylineTargets},_toggleMeasure:function(){this._measuring=!this._measuring,this._measuring?(this._mapdragging=!1,this._saveNonpolylineEvents(),this._measureControl.classList.add("polyline-measure-controlOnBgColor"),this._measureControl.style.backgroundColor=this.options.backgroundColor,this._measureControl.title=this.options.measureControlTitleOff,this._oldCursor=this._map._container.style.cursor,this._map._container.style.cursor="crosshair",this._doubleClickZoom=this._map.doubleClickZoom.enabled(),this._map.doubleClickZoom.disable(),this._layerPaint||(this._layerPaint=r.layerGroup().addTo(this._map)),this._map.on("mousemove",this._mouseMove,this),this._map.on("click",this._mouseClick,this),r.DomEvent.on(document,"keydown",this._onKeyDown,this),this._resetPathVariables()):(this._savePolylineEvents(),this._measureControl.classList.remove("polyline-measure-controlOnBgColor"),this._measureControl.style.backgroundColor=this._defaultControlBgColor,this._measureControl.title=this.options.measureControlTitleOn,this._map._container.style.cursor=this._oldCursor,this._map.off("mousemove",this._mouseMove,this),this._map.off("click",this._mouseClick,this),this._map.off("mousemove",this._resumeFirstpointMousemove,this),this._map.off("click",this._resumeFirstpointClick,this),this._map.off("mousemove",this._dragCircleMousemove,this),this._map.off("mouseup",this._dragCircleMouseup,this),r.DomEvent.off(document,"keydown",this._onKeyDown,this),this._doubleClickZoom&&this._map.doubleClickZoom.enable(),this.options.clearMeasurementsOnStop&&this._layerPaint&&this._clearAllMeasurements(),this._cntCircle!==0&&this._finishPolylinePath()),this._map.fire("polylinemeasure:toggle",{sttus:this._measuring})},_clearAllMeasurements:function(){this._cntCircle!==void 0&&this._cntCircle!==0&&this._finishPolylinePath(),this._layerPaint&&this._layerPaint.clearLayers(),this._arrPolylines=[],this._map.fire("polylinemeasure:clear")},_changeUnit:function(){this.options.unit=="metres"?(this.options.unit="landmiles",document.getElementById("unitControlId").innerHTML=this.options.unitControlLabel.landmiles,this._unitControl.title=this.options.unitControlTitle.text+" ["+this.options.unitControlTitle.landmiles+"]"):this.options.unit=="landmiles"?(this.options.unit="nauticalmiles",document.getElementById("unitControlId").innerHTML=this.options.unitControlLabel.nauticalmiles,this._unitControl.title=this.options.unitControlTitle.text+" ["+this.options.unitControlTitle.nauticalmiles+"]"):(this.options.unit="metres",document.getElementById("unitControlId").innerHTML=this.options.unitControlLabel.metres,this._unitControl.title=this.options.unitControlTitle.text+" ["+this.options.unitControlTitle.metres+"]"),this._currentLine&&this._computeDistance(this._currentLine),this._arrPolylines.map(this._computeDistance.bind(this))},_computeDistance:function(a){var l=0;a.circleCoords.map(function(c,g){if(g>=1){var m=a.circleCoords[g-1].distanceTo(a.circleCoords[g]);l+=m,this._updateTooltip(a.tooltips[g],a.tooltips[g-1],l,m,a.circleCoords[g-1],a.circleCoords[g])}}.bind(this))},_onKeyDown:function(a){if(a.keyCode===27){if(this._resumeFirstpointFlag===!0){this._resumeFirstpointFlag=!1;var l=this._lineNr;this._map.off("mousemove",this._resumeFirstpointMousemove,this),this._map.off("click",this._resumeFirstpointClick,this),this._layerPaint.removeLayer(this._rubberlinePath2),this._layerPaint.removeLayer(this._tooltipNew),this._arrPolylines[l].circleMarkers[0].setStyle(this.options.startCircle);var c="",g=0;this.options.showBearings===!0&&(c=this.options.bearingTextIn+":---\xB0
"+this.options.bearingTextOut+":---\xB0"),c=c+'
+0
',c=c+'
0
',this._arrPolylines[l].tooltips[0]._icon.innerHTML=c,this._arrPolylines[l].tooltips.map(function(m,v){if(v>=1){var x=this._arrPolylines[l].circleCoords[v-1].distanceTo(this._arrPolylines[l].circleCoords[v]),P=this._arrPolylines[l].circleCoords[v-1],T=this._arrPolylines[l].circleCoords[v];g+=x;var N=this._arrPolylines[l].tooltips[v-1];this._updateTooltip(m,N,g,x,P,T)}}.bind(this)),this._map.on("mousemove",this._mouseMove,this);return}this._currentLine?this._finishPolylinePath(a):this._toggleMeasure()}},_getDistance:function(a){var l=a,c;return this.options.unit==="nauticalmiles"?(c=this.options.unitControlLabel.nauticalmiles,l>=185200?l=(l/1852).toFixed(0):l>=18520?l=(l/1852).toFixed(1):l>=1852?l=(l/1852).toFixed(2):this.options.distanceShowSameUnit?l=(l/1852).toFixed(3):(l=(l/.3048).toFixed(0),c=this.options.unitControlLabel.feet)):this.options.unit==="landmiles"?(c=this.options.unitControlLabel.landmiles,l>=160934.4?l=(l/1609.344).toFixed(0):l>=16093.44?l=(l/1609.344).toFixed(1):l>=1609.344?l=(l/1609.344).toFixed(2):this.options.distanceShowSameUnit?l=(l/1609.344).toFixed(3):(l=(l/.3048).toFixed(0),c=this.options.unitControlLabel.feet)):(c=this.options.unitControlLabel.kilometres,l>=1e5?l=(l/1e3).toFixed(0):l>=1e4?l=(l/1e3).toFixed(1):l>=1e3?l=(l/1e3).toFixed(2):this.options.distanceShowSameUnit?l=(l/1e3).toFixed(3):(l=l.toFixed(0),c=this.options.unitControlLabel.metres)),{value:l,unit:c}},_polylineArc:function(a,l){function c(q){var z=Math.sin((1-q)*T)/Math.sin(T),j=Math.sin(q*T)/Math.sin(T),R=z*Math.cos(m)*Math.cos(v)+j*Math.cos(x)*Math.cos(P),B=z*Math.cos(m)*Math.sin(v)+j*Math.cos(x)*Math.sin(P),D=z*Math.sin(m)+j*Math.sin(x),A=180/Math.PI*Math.atan2(D,Math.sqrt(Math.pow(R,2)+Math.pow(B,2))),G=180/Math.PI*Math.atan2(B,R),H=G-v*180/Math.PI;function K(et){return Math[et>0?"floor":"ceil"](et)}return H<0?G=G-K((H-180)/360)*360:G=G-K((H+180)/360)*360,[A,G]}function g(q){for(var z=[],j=1/(q-1),R=0;R0&&(this.options.showBearings===!0&&(z=this.options.bearingTextIn+": "+P+"\xB0
"+this.options.bearingTextOut+":---\xB0"),z+='
+'+q.value+" "+q.unit+"
"),z+='
'+N.value+" "+N.unit+"
",a._icon.innerHTML=z,this.options.showBearings===!0&&l){var j=l._icon.innerHTML,R=new RegExp(this.options.bearingTextOut+".*\xB0"),B=j.replace(R,this.options.bearingTextOut+": "+T+"\xB0");l._icon.innerHTML=B}},_drawArrow:function(a){var l=Math.round(a.length/2),c=a[l-1],g=a[l],m=g[1]-c[1],v=g[0]-c[0],x=[c[0]+v/2,c[1]+m/2],P=-Math.atan2(v,m)*57.29578,T=r.divIcon({className:"",iconSize:[16,16],iconAnchor:[8,8],html:"
"}),N=r.marker(x,{icon:T,zIndexOffset:-50}).addTo(this._layerPaint);return this._currentLine||N.bindTooltip(this.options.tooltipTextAdd,{direction:"top",opacity:.7,className:"polyline-measure-popupTooltip"}),N.on("click",this._clickedArrow,this),N},_mouseMove:function(a){var l=a.latlng;if(this._map.on("click",this._mouseClick,this),!(!l||!this._currentLine)){var c=this._currentLine.circleCoords.last();this._rubberlinePath.setLatLngs(this._polylineArc(c,l));var g=this._currentLine.tooltips.last(),m=this._currentLine.tooltips.slice(-2,-1)[0];g.setLatLng(l);var v=l.distanceTo(c);this._updateTooltip(g,m,this._currentLine.distance+v,v,c,l)}},_startLine:function(a){var l=r.divIcon({className:"polyline-measure-tooltip",iconAnchor:[-4,-4]}),c=function(){return this.slice(-1)[0]};this._rubberlinePath=r.polyline([],{color:this.options.tempLine.color,weight:this.options.tempLine.weight,interactive:!1,dashArray:"8,8"}).addTo(this._layerPaint).bringToBack();var g=this;this._currentLine={id:0,circleCoords:[],circleMarkers:[],arrowMarkers:[],tooltips:[],distance:0,polylinePath:r.polyline([],{color:this.options.fixedLine.color,weight:this.options.fixedLine.weight,interactive:!1}).addTo(this._layerPaint).bringToBack(),handleMarkers:function(x){var P=this.circleMarkers.last();P&&(P.bindTooltip(g.options.tooltipTextDelete,{direction:"top",opacity:.7,className:"polyline-measure-popupTooltip"}),P.off("click",g._finishPolylinePath,g),this.circleMarkers.length===1?P.setStyle(g.options.startCircle):P.setStyle(g.options.intermedCircle));var T=new r.CircleMarker(x,g.options.currentCircle).addTo(g._layerPaint);T.bindTooltip(g.options.tooltipTextFinish+g.options.tooltipTextDelete,{direction:"top",opacity:.7,className:"polyline-measure-popupTooltip"}),T.cntLine=g._currentLine.id,T.cntCircle=g._cntCircle,g._cntCircle++,T.on("mousedown",g._dragCircle,g),T.on("click",g._finishPolylinePath,g),this.circleMarkers.push(T)},getNewToolTip:function(x){return r.marker(x,{icon:l,interactive:!1})},addPoint:function(x){var P=this.circleCoords.last();if(!(P&&P.equals(x))){if(this.circleCoords.push(x),this.circleCoords.length>1){var T=g._polylineArc(P,x);this.circleCoords.length>2&&T.shift(),this.polylinePath.setLatLngs(this.polylinePath.getLatLngs().concat(T));var N=g._drawArrow(T);N.cntLine=g._currentLine.id,N.cntArrow=g._cntCircle-1,g._currentLine.arrowMarkers.push(N);var q=P.distanceTo(x);this.distance+=q;var z=g._currentLine.tooltips.last(),j=g._currentLine.tooltips.slice(-1,-2)[0];g._updateTooltip(z,j,this.distance,q,P,x)}z&&z.setLatLng(x);var R=this.getNewToolTip(x);R.addTo(g._layerPaint),this.tooltips.push(R),this.handleMarkers(x)}},finalize:function(){if(g._layerPaint.removeLayer(this.tooltips.last()),this.tooltips.pop(),g._layerPaint.removeLayer(g._rubberlinePath),this.circleCoords.length>1){this.tooltips.last()._icon.classList.add("polyline-measure-tooltip-end");var x=this.circleMarkers.last();x.setStyle(g.options.endCircle),x.unbindTooltip(),g._currentLine.circleMarkers.map(function(P){P.bindTooltip(g.options.tooltipTextMove+g.options.tooltipTextDelete,{direction:"top",opacity:.7,className:"polyline-measure-popupTooltip"})}),g._currentLine.circleMarkers[0].bindTooltip(g.options.tooltipTextMove+g.options.tooltipTextDelete+g.options.tooltipTextResume,{direction:"top",opacity:.7,className:"polyline-measure-popupTooltip"}),x.bindTooltip(g.options.tooltipTextMove+g.options.tooltipTextDelete+g.options.tooltipTextResume,{direction:"top",opacity:.7,className:"polyline-measure-popupTooltip"}),g._currentLine.arrowMarkers.map(function(P){P.bindTooltip(g.options.tooltipTextAdd,{direction:"top",opacity:.7,className:"polyline-measure-popupTooltip"})}),x.off("click",g._finishPolylinePath,g),x.on("click",g._resumePolylinePath,g),g._arrPolylines.push(this)}else g._layerPaint.removeLayer(this.circleMarkers.last()),g._layerPaint.removeLayer(this.tooltips.last());g._resetPathVariables()}};var m=r.marker(a,{icon:l,interactive:!1});m.addTo(this._layerPaint);var v="";this.options.showBearings===!0&&(v=this.options.bearingTextIn+":---\xB0
"+this.options.bearingTextOut+":---\xB0"),v=v+'
+0
',v=v+'
0
',m._icon.innerHTML=v,this._currentLine.tooltips.push(m),this._currentLine.circleCoords.last=c,this._currentLine.tooltips.last=c,this._currentLine.circleMarkers.last=c,this._currentLine.id=this._arrPolylines.length},_mouseClick:function(a){!a.latlng||this._finishCircleScreencoords&&this._finishCircleScreencoords.equals(a.containerPoint)||(!this._currentLine&&!this._mapdragging&&(this._startLine(a.latlng),this._map.fire("polylinemeasure:start",this._currentLine)),this._mapdragging?this._mapdragging=!1:(this._currentLine.addPoint(a.latlng),this._map.fire("polylinemeasure:add",a),this._map.fire("polylinemeasure:change",this._currentLine)))},_finishPolylinePath:function(a){this._map.fire("polylinemeasure:finish",this._currentLine),this._currentLine.finalize(),a&&(this._finishCircleScreencoords=a.containerPoint)},_resumePolylinePath:function(a){if(a.originalEvent.ctrlKey===!0){this._currentLine=this._arrPolylines[a.target.cntLine],this._rubberlinePath=r.polyline([],{color:this.options.tempLine.color,weight:this.options.tempLine.weight,interactive:!1,dashArray:"8,8"}).addTo(this._layerPaint).bringToBack(),this._currentLine.tooltips.last()._icon.classList.remove("polyline-measure-tooltip-end");var l=this._currentLine.getNewToolTip(a.latlng);l.addTo(this._layerPaint),this._currentLine.tooltips.push(l),this._currentLine.circleMarkers.last().unbindTooltip(),this._currentLine.circleMarkers.last().bindTooltip(this.options.tooltipTextMove+this.options.tooltipTextDelete,{direction:"top",opacity:.7,className:"polyline-measure-popupTooltip"}),this._currentLine.circleMarkers.last().setStyle(this.options.currentCircle),this._cntCircle=this._currentLine.circleCoords.length,this._map.fire("polylinemeasure:resume",this._currentLine)}},_resetPathVariables:function(){this._cntCircle=0,this._currentLine=null},_clickedArrow:function(a){if(a.originalEvent.ctrlKey){var l=a.target.cntLine,c=a.target.cntArrow;this._arrPolylines[l].arrowMarkers[c].removeFrom(this._layerPaint);var g=new r.CircleMarker(a.latlng,this.options.intermedCircle).addTo(this._layerPaint);g.cntLine=l,g.on("mousedown",this._dragCircle,this),g.bindTooltip(this.options.tooltipTextMove+this.options.tooltipTextDelete,{direction:"top",opacity:.7,className:"polyline-measure-popupTooltip"}),this._arrPolylines[l].circleMarkers.splice(c+1,0,g),this._arrPolylines[l].circleMarkers.map(function(T,N){T.cntCircle=N}),this._arrPolylines[l].circleCoords.splice(c+1,0,a.latlng),lineCoords=this._arrPolylines[l].polylinePath.getLatLngs();var m=this._polylineArc(this._arrPolylines[l].circleCoords[c],a.latlng);m.pop();var v=this._polylineArc(a.latlng,this._arrPolylines[l].circleCoords[c+2]);Array.prototype.splice.apply(lineCoords,[c*(this._arcpoints-1),this._arcpoints].concat(m,v)),this._arrPolylines[l].polylinePath.setLatLngs(lineCoords);var x=this._drawArrow(m);this._arrPolylines[l].arrowMarkers[c]=x,x=this._drawArrow(v),this._arrPolylines[l].arrowMarkers.splice(c+1,0,x),this._arrPolylines[l].arrowMarkers.map(function(T,N){T.cntLine=l,T.cntArrow=N}),this._tooltipNew=r.marker(a.latlng,{icon:r.divIcon({className:"polyline-measure-tooltip",iconAnchor:[-4,-4]}),interactive:!1}),this._tooltipNew.addTo(this._layerPaint),this._arrPolylines[l].tooltips.splice(c+1,0,this._tooltipNew);var P=0;this._arrPolylines[l].tooltips.map(function(T,N){if(N>=1){var q=this._arrPolylines[l].circleCoords[N-1].distanceTo(this._arrPolylines[l].circleCoords[N]),z=this._arrPolylines[l].circleCoords[N-1],j=this._arrPolylines[l].circleCoords[N];P+=q;var R=this._arrPolylines[l].tooltips[N-1];this._updateTooltip(T,R,P,q,z,j)}}.bind(this)),this._map.fire("polylinemeasure:insert",a),this._map.fire("polylinemeasure:change",this._arrPolylines[this._lineNr])}},_dragCircleMouseup:function(){this._circleNr===0||this._circleNr===this._arrPolylines[this._lineNr].circleCoords.length-1?this._e1.target.bindTooltip(this.options.tooltipTextMove+this.options.tooltipTextDelete+this.options.tooltipTextResume,{direction:"top",opacity:.7,className:"polyline-measure-popupTooltip"}):this._e1.target.bindTooltip(this.options.tooltipTextMove+this.options.tooltipTextDelete,{direction:"top",opacity:.7,className:"polyline-measure-popupTooltip"}),this._resetPathVariables(),this._map.off("mousemove",this._dragCircleMousemove,this),this._map.dragging.enable(),this._map.on("mousemove",this._mouseMove,this),this._map.off("mouseup",this._dragCircleMouseup,this),this._map.fire("polylinemeasure:move",this._e1),this._map.fire("polylinemeasure:change",this._arrPolylines[this._lineNr])},_dragCircleMousemove:function(a){var l=a.latlng.lat,c=a.latlng.lng,g=l-this._mouseStartingLat,m=c-this._mouseStartingLng,v=r.latLng(this._circleStartingLat+g,this._circleStartingLng+m),x=this._arcpoints,P=this._e1.target.cntLine;this._lineNr=P;var T=this._e1.target.cntCircle;this._circleNr=T,this._e1.target.setLatLng(v),this._e1.target.unbindTooltip(),this._arrPolylines[P].circleCoords[T]=v;var N=this._arrPolylines[P].polylinePath.getLatLngs();if(T>=1){var q=this._polylineArc(this._arrPolylines[P].circleCoords[T-1],v);Array.prototype.splice.apply(N,[(T-1)*(x-1),x].concat(q));var z=this._drawArrow(q);z.cntLine=P,z.cntArrow=T-1,this._arrPolylines[P].arrowMarkers[T-1].removeFrom(this._layerPaint),this._arrPolylines[P].arrowMarkers[T-1]=z}if(T=0&&this._arrPolylines[P].tooltips[T].setLatLng(v);var R=0;this._arrPolylines[P].tooltips.map(function(B,D){if(D>=1){var A=this._arrPolylines[P].circleCoords[D-1].distanceTo(this._arrPolylines[P].circleCoords[D]),G=this._arrPolylines[P].circleCoords[D-1],H=this._arrPolylines[P].circleCoords[D];R+=A,this._arrPolylines[P].distance=R;var K=this._arrPolylines[P].tooltips[D-1];this._updateTooltip(B,K,R,A,G,H)}}.bind(this)),this._map.on("mouseup",this._dragCircleMouseup,this)},_resumeFirstpointMousemove:function(a){var l=this._lineNr;this._map.on("click",this._resumeFirstpointClick,this);var c=a.latlng;this._rubberlinePath2.setLatLngs(this._polylineArc(c,currentCircleCoords)),this._tooltipNew.setLatLng(c);var g=0,m=c.distanceTo(this._arrPolylines[l].circleCoords[0]),v=c,x=this._arrPolylines[l].circleCoords[0];g+=m;var P=this._tooltipNew,T=this._arrPolylines[l].tooltips[0];this._updateTooltip(T,P,g,m,v,x),this._arrPolylines[l].tooltips.map(function(N,q){if(q>=1){var z=this._arrPolylines[l].circleCoords[q-1].distanceTo(this._arrPolylines[l].circleCoords[q]),j=this._arrPolylines[l].circleCoords[q-1],R=this._arrPolylines[l].circleCoords[q];g+=z;var B=this._arrPolylines[l].tooltips[q-1];this._updateTooltip(N,B,g,z,j,R)}}.bind(this))},_resumeFirstpointClick:function(a){var l=this._lineNr;this._resumeFirstpointFlag=!1,this._map.off("mousemove",this._resumeFirstpointMousemove,this),this._map.off("click",this._resumeFirstpointClick,this),this._layerPaint.removeLayer(this._rubberlinePath2),this._arrPolylines[l].circleMarkers[0].setStyle(this.options.intermedCircle),this._arrPolylines[l].circleMarkers[0].unbindTooltip(),this._arrPolylines[l].circleMarkers[0].bindTooltip(this.options.tooltipTextMove+this.options.tooltipTextDelete,{direction:"top",opacity:.7,className:"polyline-measure-popupTooltip"});var c=new r.CircleMarker(a.latlng,this.options.startCircle).addTo(this._layerPaint);c.cntLine=l,c.cntCircle=0,c.on("mousedown",this._dragCircle,this),c.bindTooltip(this.options.tooltipTextMove+this.options.tooltipTextDelete+this.options.tooltipTextResume,{direction:"top",opacity:.7,className:"polyline-measure-popupTooltip"}),this._arrPolylines[l].circleMarkers.unshift(c),this._arrPolylines[l].circleMarkers.map(function(v,x){v.cntCircle=x}),this._arrPolylines[l].circleCoords.unshift(a.latlng);var g=this._polylineArc(a.latlng,currentCircleCoords),m=this._drawArrow(g);this._arrPolylines[l].arrowMarkers.unshift(m),this._arrPolylines[l].arrowMarkers.map(function(v,x){v.cntLine=l,v.cntArrow=x}),g.pop(),this._arrPolylines[l].polylinePath.setLatLngs(g.concat(this._arrPolylines[l].polylinePath.getLatLngs())),this._arrPolylines[l].tooltips.unshift(this._tooltipNew),this._map.on("mousemove",this._mouseMove,this)},_dragCircle:function(a){var l=this._arcpoints;if(a.originalEvent.ctrlKey){if(this._map.off("click",this._mouseClick,this),a.target.cntCircle===0){this._resumeFirstpointFlag=!0,this._lineNr=a.target.cntLine;var c=this._lineNr;this._circleNr=a.target.cntCircle,currentCircleCoords=a.latlng,this._arrPolylines[c].circleMarkers[0].setStyle(this.options.currentCircle),this._rubberlinePath2=r.polyline([],{color:this.options.tempLine.color,weight:this.options.tempLine.weight,interactive:!1,dashArray:"8,8"}).addTo(this._layerPaint).bringToBack(),this._tooltipNew=r.marker(currentCircleCoords,{icon:r.divIcon({className:"polyline-measure-tooltip",iconAnchor:[-4,-4]}),interactive:!1}),this._tooltipNew.addTo(this._layerPaint);var g="";this.options.showBearings===!0&&(g=g+this.options.bearingTextIn+":---\xB0
"+this.options.bearingTextOut+":---\xB0"),g=g+'
+0
',g=g+'
0
',this._tooltipNew._icon.innerHTML=g,this._map.off("mousemove",this._mouseMove,this),this._map.on("mousemove",this._resumeFirstpointMousemove,this)}return}if(a.originalEvent.shiftKey){this._lineNr=a.target.cntLine;var c=this._lineNr;this._circleNr=a.target.cntCircle;var m=this._circleNr;if(this._arrPolylines[c]){if(this._arrPolylines[c].circleMarkers.length===2){this._layerPaint.removeLayer(this._arrPolylines[c].circleMarkers[1]),this._layerPaint.removeLayer(this._arrPolylines[c].tooltips[1]),this._layerPaint.removeLayer(this._arrPolylines[c].circleMarkers[0]),this._layerPaint.removeLayer(this._arrPolylines[c].tooltips[0]),this._layerPaint.removeLayer(this._arrPolylines[c].arrowMarkers[0]),this._layerPaint.removeLayer(this._arrPolylines[c].polylinePath),this._map.fire("polylinemeasure:remove",a),this._map.fire("polylinemeasure:change",this._arrPolylines[this._lineNr]);return}this._arrPolylines[c].circleCoords.splice(m,1),this._arrPolylines[c].circleMarkers[m].removeFrom(this._layerPaint),this._arrPolylines[c].circleMarkers.splice(m,1),this._arrPolylines[c].circleMarkers.map(function(q,z){q.cntCircle=z});var v=this._arrPolylines[c].polylinePath.getLatLngs();if(this._arrPolylines[c].tooltips[m].removeFrom(this._layerPaint),this._arrPolylines[c].tooltips.splice(m,1),!this._arrPolylines[c].circleMarkers.length){this._arrPolylines.splice(c,1),this._arrPolylines.forEach(function(q,z){q.circleMarkers.map(function(j){j.cntLine=z}),q.arrowMarkers.map(function(j){j.cntLine=z})});return}if(m===0){this._arrPolylines[c].circleMarkers[0].setStyle(this.options.startCircle),v.splice(0,l-1),this._arrPolylines[c].circleMarkers[0].bindTooltip(this.options.tooltipTextMove+this.options.tooltipTextDelete+this.options.tooltipTextResume,{direction:"top",opacity:.7,className:"polyline-measure-popupTooltip"}),this._arrPolylines[c].arrowMarkers[m].removeFrom(this._layerPaint),this._arrPolylines[c].arrowMarkers.splice(0,1);var g="";this.options.showBearings===!0&&(g=this.options.bearingTextIn+":---\xB0
"+this.options.bearingTextOut+":---\xB0"),g=g+'
+0
',g=g+'
0
',this._arrPolylines[c].tooltips[0]._icon.innerHTML=g}else if(m===this._arrPolylines[c].circleCoords.length)this._arrPolylines[c].circleMarkers[m-1].on("click",this._resumePolylinePath,this),this._arrPolylines[c].circleMarkers[m-1].bindTooltip(this.options.tooltipTextMove+this.options.tooltipTextDelete+this.options.tooltipTextResume,{direction:"top",opacity:.7,className:"polyline-measure-popupTooltip"}),this._arrPolylines[c].circleMarkers.slice(-1)[0].setStyle(this.options.endCircle),this._arrPolylines[c].tooltips.slice(-1)[0]._icon.classList.add("polyline-measure-tooltip-end"),v.splice(-(l-1),l-1),this._arrPolylines[c].arrowMarkers[m-1].removeFrom(this._layerPaint),this._arrPolylines[c].arrowMarkers.splice(-1,1);else{newLineSegment=this._polylineArc(this._arrPolylines[c].circleCoords[m-1],this._arrPolylines[c].circleCoords[m]),Array.prototype.splice.apply(v,[(m-1)*(l-1),2*l-1].concat(newLineSegment)),this._arrPolylines[c].arrowMarkers[m-1].removeFrom(this._layerPaint),this._arrPolylines[c].arrowMarkers[m].removeFrom(this._layerPaint);var x=this._drawArrow(newLineSegment);this._arrPolylines[c].arrowMarkers.splice(m-1,2,x)}this._arrPolylines[c].polylinePath.setLatLngs(v),this._arrPolylines[c].arrowMarkers.map(function(q,z){q.cntLine=c,q.cntArrow=z});var P=0;this._arrPolylines[c].tooltips.map(function(q,z){if(z>=1){var j=this._arrPolylines[c].circleCoords[z-1].distanceTo(this._arrPolylines[c].circleCoords[z]),R=this._arrPolylines[c].circleCoords[z-1],B=this._arrPolylines[c].circleCoords[z];P+=j,this._arrPolylines[c].distance=P;var D=this._arrPolylines[c].tooltips[z-1];this._updateTooltip(q,D,P,j,R,B)}}.bind(this))}else{if(this._cntCircle--,this._currentLine.circleMarkers.length===1){this._currentLine.finalize();return}if(this._currentLine.circleCoords.splice(m,1),this._currentLine.circleMarkers[m].removeFrom(this._layerPaint),this._currentLine.circleMarkers.splice(m,1),this._currentLine.circleMarkers.map(function(q,z){q.cntCircle=z}),v=this._currentLine.polylinePath.getLatLngs(),this._currentLine.tooltips[m].removeFrom(this._layerPaint),this._currentLine.tooltips.splice(m,1),m===0){this._currentLine.circleMarkers.length===1?this._currentLine.circleMarkers[0].setStyle(this.options.currentCircle):this._currentLine.circleMarkers[0].setStyle(this.options.startCircle),v.splice(0,l-1),this._currentLine.circleMarkers[0].bindTooltip(this.options.tooltipTextMove+this.options.tooltipTextDelete+this.options.tooltipTextResume,{direction:"top",opacity:.7,className:"polyline-measure-popupTooltip"}),this._currentLine.arrowMarkers[m].removeFrom(this._layerPaint),this._currentLine.arrowMarkers.splice(0,1);var g="";this.options.showBearings===!0&&(g=this.options.bearingTextIn+":---\xB0
"+this.options.bearingTextOut+":---\xB0"),g=g+'
+0
',g=g+'
0
',this._currentLine.tooltips[0]._icon.innerHTML=g}else m===this._currentLine.circleCoords.length?(this._currentLine.circleMarkers[m-1].on("click",this._resumePolylinePath,this),this._currentLine.circleMarkers[m-1].bindTooltip(this.options.tooltipTextMove+this.options.tooltipTextDelete+this.options.tooltipTextResume,{direction:"top",opacity:.7,className:"polyline-measure-popupTooltip"}),this._currentLine.circleMarkers.slice(-1)[0].setStyle(this.options.currentCircle),this._currentLine.tooltips.slice(-1)[0]._icon.classList.add("polyline-measure-tooltip-end"),v.splice(-(l-1),l-1),this._currentLine.arrowMarkers[m-1].removeFrom(this._layerPaint),this._currentLine.arrowMarkers.splice(-1,1)):(newLineSegment=this._polylineArc(this._currentLine.circleCoords[m-1],this._currentLine.circleCoords[m]),Array.prototype.splice.apply(v,[(m-1)*(l-1),2*l-1].concat(newLineSegment)),this._currentLine.arrowMarkers[m-1].removeFrom(this._layerPaint),this._currentLine.arrowMarkers[m].removeFrom(this._layerPaint),x=this._drawArrow(newLineSegment),this._currentLine.arrowMarkers.splice(m-1,2,x));this._currentLine.polylinePath.setLatLngs(v),this._currentLine.arrowMarkers.map(function(q,z){q.cntLine=c,q.cntArrow=z});var T=0;this._currentLine.tooltips.map(function(q,z,j){if(z>=1){var R,B,D=this._currentLine.tooltips[z-1],A=this._currentLine.circleCoords[z-1];z===j.length-1?(R=this._currentLine.circleCoords[z-1].distanceTo(a.latlng),B=a.latlng,this._updateTooltip(q,D,T+R,R,A,B)):(R=this._currentLine.circleCoords[z-1].distanceTo(this._currentLine.circleCoords[z]),B=this._currentLine.circleCoords[z],T+=R,this._updateTooltip(q,D,T,R,A,B))}}.bind(this)),this._currentLine.distance=T}this._map.fire("polylinemeasure:remove",a),this._map.fire("polylinemeasure:change",this._arrPolylines[this._lineNr]);return}this._e1=a,this._measuring&&this._cntCircle===0&&(this._map.dragging.disable(),this._map.off("mousemove",this._mouseMove,this),this._map.off("click",this._mouseClick,this),this._mouseStartingLat=a.latlng.lat,this._mouseStartingLng=a.latlng.lng,this._circleStartingLat=a.target._latlng.lat,this._circleStartingLng=a.target._latlng.lng,this._map.on("mousemove",this._dragCircleMousemove,this))},seed:function(a){a.forEach(l=>{this._toggleMeasure(),this._startLine(l[0]),l.forEach((c,g)=>{let m=r.latLng(c);this._mouseMove({latLng:m}),this._currentLine.addPoint(m),g===l.length-1&&(this._finishPolylinePath(),this._toggleMeasure())})})}}),r.Map.mergeOptions({PolylineMeasureControl:!1}),r.Map.addInitHook(function(){this.options.polylineMeasureControl&&(this.PMControl=new r.Control.PolylineMeasure,this.addControl(this.PMControl))}),r.control.polylineMeasure=function(a){return new r.Control.PolylineMeasure(a)},r.Control.PolylineMeasure})});var Xu=se((Mw,qf)=>{"use strict";var Gf=Object.getOwnPropertySymbols,__=Object.prototype.hasOwnProperty,y_=Object.prototype.propertyIsEnumerable;function v_(r){if(r==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}function x_(){try{if(!Object.assign)return!1;var r=new String("abc");if(r[5]="de",Object.getOwnPropertyNames(r)[0]==="5")return!1;for(var n={},s=0;s<10;s++)n["_"+String.fromCharCode(s)]=s;var a=Object.getOwnPropertyNames(n).map(function(c){return n[c]});if(a.join("")!=="0123456789")return!1;var l={};return"abcdefghijklmnopqrst".split("").forEach(function(c){l[c]=c}),Object.keys(Object.assign({},l)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}qf.exports=x_()?Object.assign:function(r,n){for(var s,a=v_(r),l,c=1;c{(function(r,n){typeof mh=="object"&&typeof _h<"u"?_h.exports=n():typeof define=="function"&&define.amd?define(n):(r=r||self).RBush=n()})(mh,function(){"use strict";function r(R,B,D,A,G){(function H(K,et,X,lt,gt){for(;lt>X;){if(lt-X>600){var Et=lt-X+1,Q=et-X+1,kt=Math.log(Et),ct=.5*Math.exp(2*kt/3),bt=.5*Math.sqrt(kt*ct*(Et-ct)/Et)*(Q-Et/2<0?-1:1),Mt=Math.max(X,Math.floor(et-Q*ct/Et+bt)),Xt=Math.min(lt,Math.floor(et+(Et-Q)*ct/Et+bt));H(K,et,Mt,Xt,gt)}var ft=K[et],Ct=X,st=lt;for(n(K,X,et),gt(K[lt],ft)>0&&n(K,X,lt);Ct0;)st--}gt(K[X],ft)===0?n(K,X,st):n(K,++st,lt),st<=et&&(X=st+1),et<=st&&(lt=st-1)}})(R,B,D||0,A||R.length-1,G||s)}function n(R,B,D){var A=R[B];R[B]=R[D],R[D]=A}function s(R,B){return RB?1:0}var a=function(R){R===void 0&&(R=9),this._maxEntries=Math.max(4,R),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function l(R,B,D){if(!D)return B.indexOf(R);for(var A=0;A=R.minX&&B.maxY>=R.minY}function z(R){return{children:R,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function j(R,B,D,A,G){for(var H=[B,D];H.length;)if(!((D=H.pop())-(B=H.pop())<=A)){var K=B+Math.ceil((D-B)/A/2)*A;r(R,K,B,D,G),H.push(B,K,K,D)}}return a.prototype.all=function(){return this._all(this.data,[])},a.prototype.search=function(R){var B=this.data,D=[];if(!q(R,B))return D;for(var A=this.toBBox,G=[];B;){for(var H=0;H=0&&G[B].children.length>this._maxEntries;)this._split(G,B),B--;this._adjustParentBBoxes(A,G,B)},a.prototype._split=function(R,B){var D=R[B],A=D.children.length,G=this._minEntries;this._chooseSplitAxis(D,G,A);var H=this._chooseSplitIndex(D,G,A),K=z(D.children.splice(H,D.children.length-H));K.height=D.height,K.leaf=D.leaf,c(D,this.toBBox),c(K,this.toBBox),B?R[B-1].children.push(K):this._splitRoot(D,K)},a.prototype._splitRoot=function(R,B){this.data=z([R,B]),this.data.height=R.height+1,this.data.leaf=!1,c(this.data,this.toBBox)},a.prototype._chooseSplitIndex=function(R,B,D){for(var A,G,H,K,et,X,lt,gt=1/0,Et=1/0,Q=B;Q<=D-B;Q++){var kt=g(R,0,Q,this.toBBox),ct=g(R,Q,D,this.toBBox),bt=(G=kt,H=ct,K=void 0,et=void 0,X=void 0,lt=void 0,K=Math.max(G.minX,H.minX),et=Math.max(G.minY,H.minY),X=Math.min(G.maxX,H.maxX),lt=Math.min(G.maxY,H.maxY),Math.max(0,X-K)*Math.max(0,lt-et)),Mt=P(kt)+P(ct);bt=B;gt--){var Et=R.children[gt];m(K,R.leaf?G(Et):Et),et+=T(K)}return et},a.prototype._adjustParentBBoxes=function(R,B,D){for(var A=D;A>=0;A--)m(B[A],R)},a.prototype._condense=function(R){for(var B=R.length-1,D=void 0;B>=0;B--)R[B].children.length===0?B>0?(D=R[B-1].children).splice(D.indexOf(R[B]),1):this.clear():c(R[B],this.toBBox)},a})});var Uf=se((vh,xh)=>{(function(r,n){typeof vh=="object"&&typeof xh<"u"?xh.exports=n():typeof define=="function"&&define.amd?define(n):(r=r||self,r.TinyQueue=n())})(vh,function(){"use strict";var r=function(a,l){if(a===void 0&&(a=[]),l===void 0&&(l=n),this.data=a,this.length=this.data.length,this.compare=l,this.length>0)for(var c=(this.length>>1)-1;c>=0;c--)this._down(c)};r.prototype.push=function(a){this.data.push(a),this.length++,this._up(this.length-1)},r.prototype.pop=function(){if(this.length!==0){var a=this.data[0],l=this.data.pop();return this.length--,this.length>0&&(this.data[0]=l,this._down(0)),a}},r.prototype.peek=function(){return this.data[0]},r.prototype._up=function(a){for(var l=this,c=l.data,g=l.compare,m=c[a];a>0;){var v=a-1>>1,x=c[v];if(g(m,x)>=0)break;c[a]=x,a=v}c[a]=m},r.prototype._down=function(a){for(var l=this,c=l.data,g=l.compare,m=this.length>>1,v=c[a];a=0)break;c[a]=P,a=x}c[a]=v};function n(s,a){return sa?1:0}return r})});var Hf=se((Iw,jf)=>{jf.exports=function(n,s,a,l){var c=n[0],g=n[1],m=!1;a===void 0&&(a=0),l===void 0&&(l=s.length);for(var v=(l-a)/2,x=0,P=v-1;xg!=z>g&&c<(q-T)*(g-N)/(z-N)+T;j&&(m=!m)}return m}});var Zf=se((Ow,Xf)=>{Xf.exports=function(n,s,a,l){var c=n[0],g=n[1],m=!1;a===void 0&&(a=0),l===void 0&&(l=s.length);for(var v=l-a,x=0,P=v-1;xg!=z>g&&c<(q-T)*(g-N)/(z-N)+T;j&&(m=!m)}return m}});var Wf=se((Nw,Vu)=>{var Yf=Hf(),Vf=Zf();Vu.exports=function(n,s,a,l){return s.length>0&&Array.isArray(s[0])?Vf(n,s,a,l):Yf(n,s,a,l)};Vu.exports.nested=Vf;Vu.exports.flat=Yf});var Jf=se((Wu,Kf)=>{(function(r,n){typeof Wu=="object"&&typeof Kf<"u"?n(Wu):typeof define=="function"&&define.amd?define(["exports"],n):n((r=r||self).predicates={})})(Wu,function(r){"use strict";let s=33306690738754706e-32;function a(q,z,j,R,B){let D,A,G,H,K=z[0],et=R[0],X=0,lt=0;et>K==et>-K?(D=K,K=z[++X]):(D=et,et=R[++lt]);let gt=0;if(XK==et>-K?(G=D-((A=K+D)-K),K=z[++X]):(G=D-((A=et+D)-et),et=R[++lt]),D=A,G!==0&&(B[gt++]=G);XK==et>-K?(G=D-((A=D+K)-(H=A-D))+(K-H),K=z[++X]):(G=D-((A=D+et)-(H=A-D))+(et-H),et=R[++lt]),D=A,G!==0&&(B[gt++]=G);for(;X0!=G>0)return H;let K=Math.abs(A+G);return Math.abs(H)>=c*K?H:-function(et,X,lt,gt,Et,Q,kt){let ct,bt,Mt,Xt,ft,Ct,st,Rt,Ot,Qt,Tt,ce,Re,Cn,fe,ke,Bt,hn,Sn=et-Et,Hn=lt-Et,Me=X-Q,ue=gt-Q;ft=(fe=(Rt=Sn-(st=(Ct=134217729*Sn)-(Ct-Sn)))*(Qt=ue-(Ot=(Ct=134217729*ue)-(Ct-ue)))-((Cn=Sn*ue)-st*Ot-Rt*Ot-st*Qt))-(Tt=fe-(Bt=(Rt=Me-(st=(Ct=134217729*Me)-(Ct-Me)))*(Qt=Hn-(Ot=(Ct=134217729*Hn)-(Ct-Hn)))-((ke=Me*Hn)-st*Ot-Rt*Ot-st*Qt))),v[0]=fe-(Tt+ft)+(ft-Bt),ft=(Re=Cn-((ce=Cn+Tt)-(ft=ce-Cn))+(Tt-ft))-(Tt=Re-ke),v[1]=Re-(Tt+ft)+(ft-ke),ft=(hn=ce+Tt)-ce,v[2]=ce-(hn-ft)+(Tt-ft),v[3]=hn;let Ht=function(k,F){let Z=F[0];for(let J=1;J=ht||-Ht>=ht||(ct=et-(Sn+(ft=et-Sn))+(ft-Et),Mt=lt-(Hn+(ft=lt-Hn))+(ft-Et),bt=X-(Me+(ft=X-Me))+(ft-Q),Xt=gt-(ue+(ft=gt-ue))+(ft-Q),ct===0&&bt===0&&Mt===0&&Xt===0)||(ht=m*kt+s*Math.abs(Ht),(Ht+=Sn*Xt+ue*ct-(Me*Mt+Hn*bt))>=ht||-Ht>=ht))return Ht;ft=(fe=(Rt=ct-(st=(Ct=134217729*ct)-(Ct-ct)))*(Qt=ue-(Ot=(Ct=134217729*ue)-(Ct-ue)))-((Cn=ct*ue)-st*Ot-Rt*Ot-st*Qt))-(Tt=fe-(Bt=(Rt=bt-(st=(Ct=134217729*bt)-(Ct-bt)))*(Qt=Hn-(Ot=(Ct=134217729*Hn)-(Ct-Hn)))-((ke=bt*Hn)-st*Ot-Rt*Ot-st*Qt))),N[0]=fe-(Tt+ft)+(ft-Bt),ft=(Re=Cn-((ce=Cn+Tt)-(ft=ce-Cn))+(Tt-ft))-(Tt=Re-ke),N[1]=Re-(Tt+ft)+(ft-ke),ft=(hn=ce+Tt)-ce,N[2]=ce-(hn-ft)+(Tt-ft),N[3]=hn;let Y=a(4,v,4,N,x);ft=(fe=(Rt=Sn-(st=(Ct=134217729*Sn)-(Ct-Sn)))*(Qt=Xt-(Ot=(Ct=134217729*Xt)-(Ct-Xt)))-((Cn=Sn*Xt)-st*Ot-Rt*Ot-st*Qt))-(Tt=fe-(Bt=(Rt=Me-(st=(Ct=134217729*Me)-(Ct-Me)))*(Qt=Mt-(Ot=(Ct=134217729*Mt)-(Ct-Mt)))-((ke=Me*Mt)-st*Ot-Rt*Ot-st*Qt))),N[0]=fe-(Tt+ft)+(ft-Bt),ft=(Re=Cn-((ce=Cn+Tt)-(ft=ce-Cn))+(Tt-ft))-(Tt=Re-ke),N[1]=Re-(Tt+ft)+(ft-ke),ft=(hn=ce+Tt)-ce,N[2]=ce-(hn-ft)+(Tt-ft),N[3]=hn;let C=a(Y,x,4,N,P);ft=(fe=(Rt=ct-(st=(Ct=134217729*ct)-(Ct-ct)))*(Qt=Xt-(Ot=(Ct=134217729*Xt)-(Ct-Xt)))-((Cn=ct*Xt)-st*Ot-Rt*Ot-st*Qt))-(Tt=fe-(Bt=(Rt=bt-(st=(Ct=134217729*bt)-(Ct-bt)))*(Qt=Mt-(Ot=(Ct=134217729*Mt)-(Ct-Mt)))-((ke=bt*Mt)-st*Ot-Rt*Ot-st*Qt))),N[0]=fe-(Tt+ft)+(ft-Bt),ft=(Re=Cn-((ce=Cn+Tt)-(ft=ce-Cn))+(Tt-ft))-(Tt=Re-ke),N[1]=Re-(Tt+ft)+(ft-ke),ft=(hn=ce+Tt)-ce,N[2]=ce-(hn-ft)+(Tt-ft),N[3]=hn;let b=a(C,P,4,N,T);return T[b-1]}(q,z,j,R,B,D,K)},r.orient2dfast=function(q,z,j,R,B,D){return(z-D)*(j-B)-(q-B)*(R-D)},Object.defineProperty(r,"__esModule",{value:!0})})});var rp=se((Rw,Eh)=>{"use strict";var $f=yh(),Ju=Uf(),L_=Wf(),b_=Jf().orient2d;Ju.default&&(Ju=Ju.default);Eh.exports=np;Eh.exports.default=np;function np(r,n,s){n=Math.max(0,n===void 0?2:n),s=s||0;var a=S_(r),l=new $f(16);l.toBBox=function(D){return{minX:D[0],minY:D[1],maxX:D[0],maxY:D[1]}},l.compareMinX=function(D,A){return D[0]-A[0]},l.compareMinY=function(D,A){return D[1]-A[1]},l.load(r);for(var c=[],g=0,m;gc||m.push({node:P,dist:T})}for(;m.length&&!m.peek().node.children;){var N=m.pop(),q=N.node,z=bh(q,n,s),j=bh(q,a,l);if(N.dist=n.minX&&r[0]<=n.maxX&&r[1]>=n.minY&&r[1]<=n.maxY}function tp(r,n,s){for(var a=Math.min(r[0],n[0]),l=Math.min(r[1],n[1]),c=Math.max(r[0],n[0]),g=Math.max(r[1],n[1]),m=s.search({minX:a,minY:l,maxX:c,maxY:g}),v=0;v0!=ya(r,n,a)>0&&ya(s,a,r)>0!=ya(s,a,n)>0}function wh(r){var n=r.p,s=r.next.p;return r.minX=Math.min(n[0],s[0]),r.minY=Math.min(n[1],s[1]),r.maxX=Math.max(n[0],s[0]),r.maxY=Math.max(n[1],s[1]),r}function S_(r){for(var n=r[0],s=r[0],a=r[0],l=r[0],c=0;ca[0]&&(a=g),g[1]l[1]&&(l=g)}var m=[n,s,a,l],v=m.slice();for(c=0;c1?(a=s[0],l=s[1]):m>0&&(a+=c*m,l+=g*m)}return c=r[0]-a,g=r[1]-l,c*c+g*g}function Ku(r,n,s,a,l,c,g,m){var v=s-r,x=a-n,P=g-l,T=m-c,N=r-l,q=n-c,z=v*v+x*x,j=v*P+x*T,R=P*P+T*T,B=v*N+x*q,D=P*N+T*q,A=z*R-j*j,G,H,K,et,X=A,lt=A;A===0?(H=0,X=1,et=D,lt=R):(H=j*D-R*B,et=z*D-j*B,H<0?(H=0,et=D,lt=R):H>X&&(H=X,et=D+j,lt=R)),et<0?(et=0,-B<0?H=0:-B>z?H=X:(H=-B,X=z)):et>lt&&(et=lt,-B+j<0?H=0:-B+j>z?H=X:(H=-B+j,X=z)),G=H===0?0:H/X,K=et===0?0:et/lt;var gt=(1-G)*r+G*s,Et=(1-G)*n+G*a,Q=(1-K)*l+K*g,kt=(1-K)*c+K*m,ct=Q-gt,bt=kt-Et;return ct*ct+bt*bt}function k_(r,n){return r[0]===n[0]?r[1]-n[1]:r[0]-n[0]}function T_(r){r.sort(k_);for(var n=[],s=0;s=2&&ya(n[n.length-2],n[n.length-1],r[s])<=0;)n.pop();n.push(r[s])}for(var a=[],l=r.length-1;l>=0;l--){for(;a.length>=2&&ya(a[a.length-2],a[a.length-1],r[l])<=0;)a.pop();a.push(r[l])}return a.pop(),n.pop(),n.concat(a)}});var up=se((Ph,Ch)=>{(function(r,n){typeof Ph=="object"&&typeof Ch<"u"?Ch.exports=n():typeof define=="function"&&define.amd?define(n):r.quickselect=n()})(Ph,function(){"use strict";function r(l,c,g,m,v){n(l,c,g||0,m||l.length-1,v||a)}function n(l,c,g,m,v){for(;m>g;){if(m-g>600){var x=m-g+1,P=c-g+1,T=Math.log(x),N=.5*Math.exp(2*T/3),q=.5*Math.sqrt(T*N*(x-N)/x)*(P-x/2<0?-1:1),z=Math.max(g,Math.floor(c-P*N/x+q)),j=Math.min(m,Math.floor(c+(x-P)*N/x+q));n(l,c,z,j,v)}var R=l[c],B=g,D=m;for(s(l,g,c),v(l[m],R)>0&&s(l,g,m);B0;)D--}v(l[g],R)===0?s(l,g,D):(D++,s(l,D,m)),D<=c&&(g=D+1),c<=D&&(m=D-1)}}function s(l,c,g){var m=l[c];l[c]=l[g],l[g]=m}function a(l,c){return lc?1:0}return r})});var fp=se((sE,Th)=>{"use strict";Th.exports=ru;Th.exports.default=ru;var H_=up();function ru(r,n){if(!(this instanceof ru))return new ru(r,n);this._maxEntries=Math.max(4,r||9),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),n&&this._initFormat(n),this.clear()}ru.prototype={all:function(){return this._all(this.data,[])},search:function(r){var n=this.data,s=[],a=this.toBBox;if(!Qu(r,n))return s;for(var l=[],c,g,m,v;n;){for(c=0,g=n.children.length;c=0&&c[n].children.length>this._maxEntries;)this._split(c,n),n--;this._adjustParentBBoxes(l,c,n)},_split:function(r,n){var s=r[n],a=s.children.length,l=this._minEntries;this._chooseSplitAxis(s,l,a);var c=this._chooseSplitIndex(s,l,a),g=xa(s.children.splice(c,s.children.length-c));g.height=s.height,g.leaf=s.leaf,va(s,this.toBBox),va(g,this.toBBox),n?r[n-1].children.push(g):this._splitRoot(s,g)},_splitRoot:function(r,n){this.data=xa([r,n]),this.data.height=r.height+1,this.data.leaf=!1,va(this.data,this.toBBox)},_chooseSplitIndex:function(r,n,s){var a,l,c,g,m,v,x,P;for(v=x=1/0,a=n;a<=s-n;a++)l=eu(r,0,a,this.toBBox),c=eu(r,a,s,this.toBBox),g=Y_(l,c),m=Sh(l)+Sh(c),g=n;v--)x=r.children[v],nu(g,r.leaf?l(x):x),m+=$u(g);return m},_adjustParentBBoxes:function(r,n,s){for(var a=s;a>=0;a--)nu(n[a],r)},_condense:function(r){for(var n=r.length-1,s;n>=0;n--)r[n].children.length===0?n>0?(s=r[n-1].children,s.splice(s.indexOf(r[n]),1)):this.clear():va(r[n],this.toBBox)},_initFormat:function(r){var n=["return a"," - b",";"];this.compareMinX=new Function("a","b",n.join(r[0])),this.compareMinY=new Function("a","b",n.join(r[1])),this.toBBox=new Function("a","return {minX: a"+r[0]+", minY: a"+r[1]+", maxX: a"+r[2]+", maxY: a"+r[3]+"};")}};function X_(r,n,s){if(!s)return n.indexOf(r);for(var a=0;a=r.minX&&n.maxY>=r.minY}function xa(r){return{children:r,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function cp(r,n,s,a,l){for(var c=[n,s],g;c.length;)s=c.pop(),n=c.pop(),!(s-n<=a)&&(g=n+Math.ceil((s-n)/a/2)*a,H_(r,g,n,s,l),c.push(n,g,g,s))}});var _p=se((vM,Ah)=>{"use strict";Ah.exports=rl;Ah.exports.default=rl;function rl(r,n,s){s=s||2;var a=n&&n.length,l=a?n[0]*s:r.length,c=dp(r,0,l,s,!0),g=[];if(!c||c.next===c.prev)return g;var m,v,x,P,T,N,q;if(a&&(c=oy(r,n,c,s)),r.length>80*s){m=x=r[0],v=P=r[1];for(var z=s;zx&&(x=T),N>P&&(P=N);q=Math.max(x-m,P-v),q=q!==0?32767/q:0}return su(c,g,s,m,v,q,0),g}function dp(r,n,s,a,l){var c,g;if(l===Rh(r,n,s,a)>0)for(c=n;c=n;c-=a)g=pp(c,r[c],r[c+1],g);return g&&il(g,g.next)&&(uu(g),g=g.next),g}function Js(r,n){if(!r)return r;n||(n=r);var s=r,a;do if(a=!1,!s.steiner&&(il(s,s.next)||kr(s.prev,s,s.next)===0)){if(uu(s),s=n=s.prev,s===s.next)break;a=!0}else s=s.next;while(a||s!==n);return n}function su(r,n,s,a,l,c,g){if(r){!g&&c&&hy(r,a,l,c);for(var m=r,v,x;r.prev!==r.next;){if(v=r.prev,x=r.next,c?ny(r,a,l,c):ey(r)){n.push(v.i/s|0),n.push(r.i/s|0),n.push(x.i/s|0),uu(r),r=x.next,m=x.next;continue}if(r=x,r===m){g?g===1?(r=ry(Js(r),n,s),su(r,n,s,a,l,c,2)):g===2&&iy(r,n,s,a,l,c):su(Js(r),n,s,a,l,c,1);break}}}}function ey(r){var n=r.prev,s=r,a=r.next;if(kr(n,s,a)>=0)return!1;for(var l=n.x,c=s.x,g=a.x,m=n.y,v=s.y,x=a.y,P=lc?l>g?l:g:c>g?c:g,q=m>v?m>x?m:x:v>x?v:x,z=a.next;z!==n;){if(z.x>=P&&z.x<=N&&z.y>=T&&z.y<=q&&La(l,m,c,v,g,x,z.x,z.y)&&kr(z.prev,z,z.next)>=0)return!1;z=z.next}return!0}function ny(r,n,s,a){var l=r.prev,c=r,g=r.next;if(kr(l,c,g)>=0)return!1;for(var m=l.x,v=c.x,x=g.x,P=l.y,T=c.y,N=g.y,q=mv?m>x?m:x:v>x?v:x,R=P>T?P>N?P:N:T>N?T:N,B=Oh(q,z,n,s,a),D=Oh(j,R,n,s,a),A=r.prevZ,G=r.nextZ;A&&A.z>=B&&G&&G.z<=D;){if(A.x>=q&&A.x<=j&&A.y>=z&&A.y<=R&&A!==l&&A!==g&&La(m,P,v,T,x,N,A.x,A.y)&&kr(A.prev,A,A.next)>=0||(A=A.prevZ,G.x>=q&&G.x<=j&&G.y>=z&&G.y<=R&&G!==l&&G!==g&&La(m,P,v,T,x,N,G.x,G.y)&&kr(G.prev,G,G.next)>=0))return!1;G=G.nextZ}for(;A&&A.z>=B;){if(A.x>=q&&A.x<=j&&A.y>=z&&A.y<=R&&A!==l&&A!==g&&La(m,P,v,T,x,N,A.x,A.y)&&kr(A.prev,A,A.next)>=0)return!1;A=A.prevZ}for(;G&&G.z<=D;){if(G.x>=q&&G.x<=j&&G.y>=z&&G.y<=R&&G!==l&&G!==g&&La(m,P,v,T,x,N,G.x,G.y)&&kr(G.prev,G,G.next)>=0)return!1;G=G.nextZ}return!0}function ry(r,n,s){var a=r;do{var l=a.prev,c=a.next.next;!il(l,c)&&gp(l,a,a.next,c)&&au(l,c)&&au(c,l)&&(n.push(l.i/s|0),n.push(a.i/s|0),n.push(c.i/s|0),uu(a),uu(a.next),a=r=c),a=a.next}while(a!==r);return Js(a)}function iy(r,n,s,a,l,c){var g=r;do{for(var m=g.next.next;m!==g.prev;){if(g.i!==m.i&&py(g,m)){var v=mp(g,m);g=Js(g,g.next),v=Js(v,v.next),su(g,n,s,a,l,c,0),su(v,n,s,a,l,c,0);return}m=m.next}g=g.next}while(g!==r)}function oy(r,n,s,a){var l=[],c,g,m,v,x;for(c=0,g=n.length;c=s.next.y&&s.next.y!==s.y){var m=s.x+(l-s.y)*(s.next.x-s.x)/(s.next.y-s.y);if(m<=a&&m>c&&(c=m,g=s.x=s.x&&s.x>=x&&a!==s.x&&La(lg.x||s.x===g.x&&ly(g,s)))&&(g=s,T=N)),s=s.next;while(s!==v);return g}function ly(r,n){return kr(r.prev,r,n.prev)<0&&kr(n.next,r,r.next)<0}function hy(r,n,s,a){var l=r;do l.z===0&&(l.z=Oh(l.x,l.y,n,s,a)),l.prevZ=l.prev,l.nextZ=l.next,l=l.next;while(l!==r);l.prevZ.nextZ=null,l.prevZ=null,cy(l)}function cy(r){var n,s,a,l,c,g,m,v,x=1;do{for(s=r,r=null,c=null,g=0;s;){for(g++,a=s,m=0,n=0;n0||v>0&&a;)m!==0&&(v===0||!a||s.z<=a.z)?(l=s,s=s.nextZ,m--):(l=a,a=a.nextZ,v--),c?c.nextZ=l:r=l,l.prevZ=c,c=l;s=a}c.nextZ=null,x*=2}while(g>1);return r}function Oh(r,n,s,a,l){return r=(r-s)*l|0,n=(n-a)*l|0,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,r|n<<1}function fy(r){var n=r,s=r;do(n.x=(r-g)*(c-m)&&(r-g)*(a-m)>=(s-g)*(n-m)&&(s-g)*(c-m)>=(l-g)*(a-m)}function py(r,n){return r.next.i!==n.i&&r.prev.i!==n.i&&!dy(r,n)&&(au(r,n)&&au(n,r)&&gy(r,n)&&(kr(r.prev,r,n.prev)||kr(r,n.prev,n))||il(r,n)&&kr(r.prev,r,r.next)>0&&kr(n.prev,n,n.next)>0)}function kr(r,n,s){return(n.y-r.y)*(s.x-n.x)-(n.x-r.x)*(s.y-n.y)}function il(r,n){return r.x===n.x&&r.y===n.y}function gp(r,n,s,a){var l=nl(kr(r,n,s)),c=nl(kr(r,n,a)),g=nl(kr(s,a,r)),m=nl(kr(s,a,n));return!!(l!==c&&g!==m||l===0&&el(r,s,n)||c===0&&el(r,a,n)||g===0&&el(s,r,a)||m===0&&el(s,n,a))}function el(r,n,s){return n.x<=Math.max(r.x,s.x)&&n.x>=Math.min(r.x,s.x)&&n.y<=Math.max(r.y,s.y)&&n.y>=Math.min(r.y,s.y)}function nl(r){return r>0?1:r<0?-1:0}function dy(r,n){var s=r;do{if(s.i!==r.i&&s.next.i!==r.i&&s.i!==n.i&&s.next.i!==n.i&&gp(s,s.next,r,n))return!0;s=s.next}while(s!==r);return!1}function au(r,n){return kr(r.prev,r,r.next)<0?kr(r,n,r.next)>=0&&kr(r,r.prev,n)>=0:kr(r,n,r.prev)<0||kr(r,r.next,n)<0}function gy(r,n){var s=r,a=!1,l=(r.x+n.x)/2,c=(r.y+n.y)/2;do s.y>c!=s.next.y>c&&s.next.y!==s.y&&l<(s.next.x-s.x)*(c-s.y)/(s.next.y-s.y)+s.x&&(a=!a),s=s.next;while(s!==r);return a}function mp(r,n){var s=new Nh(r.i,r.x,r.y),a=new Nh(n.i,n.x,n.y),l=r.next,c=n.prev;return r.next=n,n.prev=r,s.next=l,l.prev=s,a.next=s,s.prev=a,c.next=a,a.prev=c,a}function pp(r,n,s,a){var l=new Nh(r,n,s);return a?(l.next=a.next,l.prev=a,a.next.prev=l,a.next=l):(l.prev=l,l.next=l),l}function uu(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function Nh(r,n,s){this.i=r,this.x=n,this.y=s,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}rl.deviation=function(r,n,s,a){var l=n&&n.length,c=l?n[0]*s:r.length,g=Math.abs(Rh(r,0,c,s));if(l)for(var m=0,v=n.length;m0&&(a+=r[l-1].length,s.holes.push(a))}return s}});var Gh=se(me=>{"use strict";Object.defineProperty(me,"__esModule",{value:!0});me.earthRadius=63710088e-1;me.factors={centimeters:me.earthRadius*100,centimetres:me.earthRadius*100,degrees:me.earthRadius/111325,feet:me.earthRadius*3.28084,inches:me.earthRadius*39.37,kilometers:me.earthRadius/1e3,kilometres:me.earthRadius/1e3,meters:me.earthRadius,metres:me.earthRadius,miles:me.earthRadius/1609.344,millimeters:me.earthRadius*1e3,millimetres:me.earthRadius*1e3,nauticalmiles:me.earthRadius/1852,radians:1,yards:me.earthRadius*1.0936};me.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/me.earthRadius,yards:1.0936133};me.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function zs(r,n,s){s===void 0&&(s={});var a={type:"Feature"};return(s.id===0||s.id)&&(a.id=s.id),s.bbox&&(a.bbox=s.bbox),a.properties=n||{},a.geometry=r,a}me.feature=zs;function wy(r,n,s){switch(s===void 0&&(s={}),r){case"Point":return Dh(n).geometry;case"LineString":return Fh(n).geometry;case"Polygon":return Bh(n).geometry;case"MultiPoint":return vp(n).geometry;case"MultiLineString":return yp(n).geometry;case"MultiPolygon":return xp(n).geometry;default:throw new Error(r+" is invalid")}}me.geometry=wy;function Dh(r,n,s){if(s===void 0&&(s={}),!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!ol(r[0])||!ol(r[1]))throw new Error("coordinates must contain numbers");var a={type:"Point",coordinates:r};return zs(a,n,s)}me.point=Dh;function Ly(r,n,s){return s===void 0&&(s={}),sl(r.map(function(a){return Dh(a,n)}),s)}me.points=Ly;function Bh(r,n,s){s===void 0&&(s={});for(var a=0,l=r;a=0))throw new Error("precision must be a positive number");var s=Math.pow(10,n||0);return Math.round(r*s)/s}me.round=Py;function wp(r,n){n===void 0&&(n="kilometers");var s=me.factors[n];if(!s)throw new Error(n+" units is invalid");return r*s}me.radiansToLength=wp;function zh(r,n){n===void 0&&(n="kilometers");var s=me.factors[n];if(!s)throw new Error(n+" units is invalid");return r/s}me.lengthToRadians=zh;function Cy(r,n){return Lp(zh(r,n))}me.lengthToDegrees=Cy;function Sy(r){var n=r%360;return n<0&&(n+=360),n}me.bearingToAzimuth=Sy;function Lp(r){var n=r%(2*Math.PI);return n*180/Math.PI}me.radiansToDegrees=Lp;function ky(r){var n=r%360;return n*Math.PI/180}me.degreesToRadians=ky;function Ty(r,n,s){if(n===void 0&&(n="kilometers"),s===void 0&&(s="kilometers"),!(r>=0))throw new Error("length must be a positive number");return wp(zh(r,n),s)}me.convertLength=Ty;function Iy(r,n,s){if(n===void 0&&(n="meters"),s===void 0&&(s="kilometers"),!(r>=0))throw new Error("area must be a positive number");var a=me.areaFactors[n];if(!a)throw new Error("invalid original units");var l=me.areaFactors[s];if(!l)throw new Error("invalid final units");return r/a*l}me.convertArea=Iy;function ol(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}me.isNumber=ol;function Oy(r){return!!r&&r.constructor===Object}me.isObject=Oy;function Ny(r){if(!r)throw new Error("bbox is required");if(!Array.isArray(r))throw new Error("bbox must be an Array");if(r.length!==4&&r.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");r.forEach(function(n){if(!ol(n))throw new Error("bbox must only contain numbers")})}me.validateBBox=Ny;function Ry(r){if(!r)throw new Error("id is required");if(["string","number"].indexOf(typeof r)===-1)throw new Error("id must be a number or a string")}me.validateId=Ry});var Uh=se(pi=>{"use strict";Object.defineProperty(pi,"__esModule",{value:!0});var Yi=Gh();function lu(r,n,s){if(r!==null)for(var a,l,c,g,m,v,x,P=0,T=0,N,q=r.type,z=q==="FeatureCollection",j=q==="Feature",R=z?r.features.length:1,B=0;Bv||z>x||j>P){m=T,v=a,x=z,P=j,c=0;return}var R=Yi.lineString([m,T],s.properties);if(n(R,a,l,j,c)===!1)return!1;c++,m=T})===!1)return!1}}})}function qy(r,n,s){var a=s,l=!1;return Mp(r,function(c,g,m,v,x){l===!1&&s===void 0?a=c:a=n(a,c,g,m,v,x),l=!0}),a}function Pp(r,n){if(!r)throw new Error("geojson is required");al(r,function(s,a,l){if(s.geometry!==null){var c=s.geometry.type,g=s.geometry.coordinates;switch(c){case"LineString":if(n(s,a,l,0,0)===!1)return!1;break;case"Polygon":for(var m=0;m{"use strict";Object.defineProperty(Hh,"__esModule",{value:!0});var Xy=Uh();function jh(r){var n=[1/0,1/0,-1/0,-1/0];return Xy.coordEach(r,function(s){n[0]>s[0]&&(n[0]=s[0]),n[1]>s[1]&&(n[1]=s[1]),n[2]{var hs=yh(),kp=Gh(),Tp=Uh(),ba=Cp().default,Zy=Tp.featureEach,NM=Tp.coordEach,RM=kp.polygon,Sp=kp.featureCollection;function Ip(r){var n=new hs(r);return n.insert=function(s){if(s.type!=="Feature")throw new Error("invalid feature");return s.bbox=s.bbox?s.bbox:ba(s),hs.prototype.insert.call(this,s)},n.load=function(s){var a=[];return Array.isArray(s)?s.forEach(function(l){if(l.type!=="Feature")throw new Error("invalid features");l.bbox=l.bbox?l.bbox:ba(l),a.push(l)}):Zy(s,function(l){if(l.type!=="Feature")throw new Error("invalid features");l.bbox=l.bbox?l.bbox:ba(l),a.push(l)}),hs.prototype.load.call(this,a)},n.remove=function(s,a){if(s.type!=="Feature")throw new Error("invalid feature");return s.bbox=s.bbox?s.bbox:ba(s),hs.prototype.remove.call(this,s,a)},n.clear=function(){return hs.prototype.clear.call(this)},n.search=function(s){var a=hs.prototype.search.call(this,this.toBBox(s));return Sp(a)},n.collides=function(s){return hs.prototype.collides.call(this,this.toBBox(s))},n.all=function(){var s=hs.prototype.all.call(this);return Sp(s)},n.toJSON=function(){return hs.prototype.toJSON.call(this)},n.fromJSON=function(s){return hs.prototype.fromJSON.call(this,s)},n.toBBox=function(s){var a;if(s.bbox)a=s.bbox;else if(Array.isArray(s)&&s.length===4)a=s;else if(Array.isArray(s)&&s.length===6)a=[s[0],s[1],s[3],s[4]];else if(s.type==="Feature")a=ba(s);else if(s.type==="FeatureCollection")a=ba(s);else throw new Error("invalid geojson");return{minX:a[0],minY:a[1],maxX:a[2],maxY:a[3]}},n}Xh.exports=Ip;Xh.exports.default=Ip});var Fp=se((Kh,Jh)=>{(function(r,n){typeof Kh=="object"&&typeof Jh<"u"?Jh.exports=n():typeof define=="function"&&define.amd?define(n):r.quickselect=n()})(Kh,function(){"use strict";function r(l,c,g,m,v){n(l,c,g||0,m||l.length-1,v||a)}function n(l,c,g,m,v){for(;m>g;){if(m-g>600){var x=m-g+1,P=c-g+1,T=Math.log(x),N=.5*Math.exp(2*T/3),q=.5*Math.sqrt(T*N*(x-N)/x)*(P-x/2<0?-1:1),z=Math.max(g,Math.floor(c-P*N/x+q)),j=Math.min(m,Math.floor(c+(x-P)*N/x+q));n(l,c,z,j,v)}var R=l[c],B=g,D=m;for(s(l,g,c),v(l[m],R)>0&&s(l,g,m);B0;)D--}v(l[g],R)===0?s(l,g,D):(D++,s(l,D,m)),D<=c&&(g=D+1),c<=D&&(m=D-1)}}function s(l,c,g){var m=l[c];l[c]=l[g],l[g]=m}function a(l,c){return lc?1:0}return r})});var Up=se((sC,tc)=>{"use strict";tc.exports=fu;tc.exports.default=fu;var nv=Fp();function fu(r,n){if(!(this instanceof fu))return new fu(r,n);this._maxEntries=Math.max(4,r||9),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),n&&this._initFormat(n),this.clear()}fu.prototype={all:function(){return this._all(this.data,[])},search:function(r){var n=this.data,s=[],a=this.toBBox;if(!cl(r,n))return s;for(var l=[],c,g,m,v;n;){for(c=0,g=n.children.length;c=0&&c[n].children.length>this._maxEntries;)this._split(c,n),n--;this._adjustParentBBoxes(l,c,n)},_split:function(r,n){var s=r[n],a=s.children.length,l=this._minEntries;this._chooseSplitAxis(s,l,a);var c=this._chooseSplitIndex(s,l,a),g=Ma(s.children.splice(c,s.children.length-c));g.height=s.height,g.leaf=s.leaf,Ea(s,this.toBBox),Ea(g,this.toBBox),n?r[n-1].children.push(g):this._splitRoot(s,g)},_splitRoot:function(r,n){this.data=Ma([r,n]),this.data.height=r.height+1,this.data.leaf=!1,Ea(this.data,this.toBBox)},_chooseSplitIndex:function(r,n,s){var a,l,c,g,m,v,x,P;for(v=x=1/0,a=n;a<=s-n;a++)l=hu(r,0,a,this.toBBox),c=hu(r,a,s,this.toBBox),g=ov(l,c),m=$h(l)+$h(c),g=n;v--)x=r.children[v],cu(g,r.leaf?l(x):x),m+=hl(g);return m},_adjustParentBBoxes:function(r,n,s){for(var a=s;a>=0;a--)cu(n[a],r)},_condense:function(r){for(var n=r.length-1,s;n>=0;n--)r[n].children.length===0?n>0?(s=r[n-1].children,s.splice(s.indexOf(r[n]),1)):this.clear():Ea(r[n],this.toBBox)},_initFormat:function(r){var n=["return a"," - b",";"];this.compareMinX=new Function("a","b",n.join(r[0])),this.compareMinY=new Function("a","b",n.join(r[1])),this.toBBox=new Function("a","return {minX: a"+r[0]+", minY: a"+r[1]+", maxX: a"+r[2]+", maxY: a"+r[3]+"};")}};function rv(r,n,s){if(!s)return n.indexOf(r);for(var a=0;a=r.minX&&n.maxY>=r.minY}function Ma(r){return{children:r,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function qp(r,n,s,a,l){for(var c=[n,s],g;c.length;)s=c.pop(),n=c.pop(),!(s-n<=a)&&(g=n+Math.ceil((s-n)/a/2)*a,nv(r,g,n,s,l),c.push(n,g,g,s))}});var nc=se((HC,Wp)=>{"use strict";var Vp=Object.prototype.toString;Wp.exports=function(n){var s=Vp.call(n),a=s==="[object Arguments]";return a||(a=s!=="[object Array]"&&n!==null&&typeof n=="object"&&typeof n.length=="number"&&n.length>=0&&Vp.call(n.callee)==="[object Function]"),a}});var id=se((XC,rd)=>{"use strict";var nd;Object.keys||(du=Object.prototype.hasOwnProperty,rc=Object.prototype.toString,Kp=nc(),ic=Object.prototype.propertyIsEnumerable,Jp=!ic.call({toString:null},"toString"),$p=ic.call(function(){},"prototype"),gu=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],fl=function(r){var n=r.constructor;return n&&n.prototype===r},Qp={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},td=function(){if(typeof window>"u")return!1;for(var r in window)try{if(!Qp["$"+r]&&du.call(window,r)&&window[r]!==null&&typeof window[r]=="object")try{fl(window[r])}catch{return!0}}catch{return!0}return!1}(),ed=function(r){if(typeof window>"u"||!td)return fl(r);try{return fl(r)}catch{return!1}},nd=function(n){var s=n!==null&&typeof n=="object",a=rc.call(n)==="[object Function]",l=Kp(n),c=s&&rc.call(n)==="[object String]",g=[];if(!s&&!a&&!l)throw new TypeError("Object.keys called on a non-object");var m=$p&&a;if(c&&n.length>0&&!du.call(n,0))for(var v=0;v0)for(var x=0;x{"use strict";var hv=Array.prototype.slice,cv=nc(),od=Object.keys,pl=od?function(n){return od(n)}:id(),sd=Object.keys;pl.shim=function(){if(Object.keys){var n=function(){var s=Object.keys(arguments);return s&&s.length===arguments.length}(1,2);n||(Object.keys=function(a){return cv(a)?sd(hv.call(a)):sd(a)})}else Object.keys=pl;return Object.keys||pl};ad.exports=pl});var sc=se((YC,ud)=>{"use strict";ud.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var n={},s=Symbol("test"),a=Object(s);if(typeof s=="string"||Object.prototype.toString.call(s)!=="[object Symbol]"||Object.prototype.toString.call(a)!=="[object Symbol]")return!1;var l=42;n[s]=l;for(s in n)return!1;if(typeof Object.keys=="function"&&Object.keys(n).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(n).length!==0)return!1;var c=Object.getOwnPropertySymbols(n);if(c.length!==1||c[0]!==s||!Object.prototype.propertyIsEnumerable.call(n,s))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var g=Object.getOwnPropertyDescriptor(n,s);if(g.value!==l||g.enumerable!==!0)return!1}return!0}});var dl=se((VC,ld)=>{"use strict";var fv=sc();ld.exports=function(){return fv()&&!!Symbol.toStringTag}});var fd=se((WC,cd)=>{"use strict";var hd=typeof Symbol<"u"&&Symbol,pv=sc();cd.exports=function(){return typeof hd!="function"||typeof Symbol!="function"||typeof hd("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:pv()}});var dd=se((KC,pd)=>{"use strict";var dv="Function.prototype.bind called on incompatible ",ac=Array.prototype.slice,gv=Object.prototype.toString,mv="[object Function]";pd.exports=function(n){var s=this;if(typeof s!="function"||gv.call(s)!==mv)throw new TypeError(dv+s);for(var a=ac.call(arguments,1),l,c=function(){if(this instanceof l){var P=s.apply(this,a.concat(ac.call(arguments)));return Object(P)===P?P:this}else return s.apply(n,a.concat(ac.call(arguments)))},g=Math.max(0,s.length-a.length),m=[],v=0;v{"use strict";var _v=dd();gd.exports=Function.prototype.bind||_v});var _d=se(($C,md)=>{"use strict";var yv=gl();md.exports=yv.call(Function.call,Object.prototype.hasOwnProperty)});var yl=se((QC,Ld)=>{"use strict";var Pn,ka=SyntaxError,wd=Function,Sa=TypeError,uc=function(r){try{return wd('"use strict"; return ('+r+").constructor;")()}catch{}},$s=Object.getOwnPropertyDescriptor;if($s)try{$s({},"")}catch{$s=null}var lc=function(){throw new Sa},vv=$s?function(){try{return arguments.callee,lc}catch{try{return $s(arguments,"callee").get}catch{return lc}}}():lc,Pa=fd()(),fs=Object.getPrototypeOf||function(r){return r.__proto__},Ca={},xv=typeof Uint8Array>"u"?Pn:fs(Uint8Array),Qs={"%AggregateError%":typeof AggregateError>"u"?Pn:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Pn:ArrayBuffer,"%ArrayIteratorPrototype%":Pa?fs([][Symbol.iterator]()):Pn,"%AsyncFromSyncIteratorPrototype%":Pn,"%AsyncFunction%":Ca,"%AsyncGenerator%":Ca,"%AsyncGeneratorFunction%":Ca,"%AsyncIteratorPrototype%":Ca,"%Atomics%":typeof Atomics>"u"?Pn:Atomics,"%BigInt%":typeof BigInt>"u"?Pn:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Pn:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Pn:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Pn:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?Pn:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Pn:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Pn:FinalizationRegistry,"%Function%":wd,"%GeneratorFunction%":Ca,"%Int8Array%":typeof Int8Array>"u"?Pn:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Pn:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Pn:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Pa?fs(fs([][Symbol.iterator]())):Pn,"%JSON%":typeof JSON=="object"?JSON:Pn,"%Map%":typeof Map>"u"?Pn:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Pa?Pn:fs(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Pn:Promise,"%Proxy%":typeof Proxy>"u"?Pn:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?Pn:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Pn:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Pa?Pn:fs(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Pn:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Pa?fs(""[Symbol.iterator]()):Pn,"%Symbol%":Pa?Symbol:Pn,"%SyntaxError%":ka,"%ThrowTypeError%":vv,"%TypedArray%":xv,"%TypeError%":Sa,"%Uint8Array%":typeof Uint8Array>"u"?Pn:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Pn:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Pn:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Pn:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?Pn:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Pn:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Pn:WeakSet};try{null.error}catch(r){yd=fs(fs(r)),Qs["%Error.prototype%"]=yd}var yd,wv=function r(n){var s;if(n==="%AsyncFunction%")s=uc("async function () {}");else if(n==="%GeneratorFunction%")s=uc("function* () {}");else if(n==="%AsyncGeneratorFunction%")s=uc("async function* () {}");else if(n==="%AsyncGenerator%"){var a=r("%AsyncGeneratorFunction%");a&&(s=a.prototype)}else if(n==="%AsyncIteratorPrototype%"){var l=r("%AsyncGenerator%");l&&(s=fs(l.prototype))}return Qs[n]=s,s},vd={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},mu=gl(),ml=_d(),Lv=mu.call(Function.call,Array.prototype.concat),bv=mu.call(Function.apply,Array.prototype.splice),xd=mu.call(Function.call,String.prototype.replace),_l=mu.call(Function.call,String.prototype.slice),Ev=mu.call(Function.call,RegExp.prototype.exec),Mv=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Pv=/\\(\\)?/g,Cv=function(n){var s=_l(n,0,1),a=_l(n,-1);if(s==="%"&&a!=="%")throw new ka("invalid intrinsic syntax, expected closing `%`");if(a==="%"&&s!=="%")throw new ka("invalid intrinsic syntax, expected opening `%`");var l=[];return xd(n,Mv,function(c,g,m,v){l[l.length]=m?xd(v,Pv,"$1"):g||c}),l},Sv=function(n,s){var a=n,l;if(ml(vd,a)&&(l=vd[a],a="%"+l[0]+"%"),ml(Qs,a)){var c=Qs[a];if(c===Ca&&(c=wv(a)),typeof c>"u"&&!s)throw new Sa("intrinsic "+n+" exists, but is not available. Please file an issue!");return{alias:l,name:a,value:c}}throw new ka("intrinsic "+n+" does not exist!")};Ld.exports=function(n,s){if(typeof n!="string"||n.length===0)throw new Sa("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof s!="boolean")throw new Sa('"allowMissing" argument must be a boolean');if(Ev(/^%?[^%]*%?$/,n)===null)throw new ka("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var a=Cv(n),l=a.length>0?a[0]:"",c=Sv("%"+l+"%",s),g=c.name,m=c.value,v=!1,x=c.alias;x&&(l=x[0],bv(a,Lv([0,1],x)));for(var P=1,T=!0;P=a.length){var j=$s(m,N);T=!!j,T&&"get"in j&&!("originalValue"in j.get)?m=j.get:m=m[N]}else T=ml(m,N),m=m[N];T&&!v&&(Qs[g]=m)}}return m}});var xl=se((tS,vl)=>{"use strict";var hc=gl(),Ta=yl(),Md=Ta("%Function.prototype.apply%"),Pd=Ta("%Function.prototype.call%"),Cd=Ta("%Reflect.apply%",!0)||hc.call(Pd,Md),bd=Ta("%Object.getOwnPropertyDescriptor%",!0),ta=Ta("%Object.defineProperty%",!0),kv=Ta("%Math.max%");if(ta)try{ta({},"a",{value:1})}catch{ta=null}vl.exports=function(n){var s=Cd(hc,Pd,arguments);if(bd&&ta){var a=bd(s,"length");a.configurable&&ta(s,"length",{value:1+kv(0,n.length-(arguments.length-1))})}return s};var Ed=function(){return Cd(hc,Md,arguments)};ta?ta(vl.exports,"apply",{value:Ed}):vl.exports.apply=Ed});var cc=se((eS,Td)=>{"use strict";var Sd=yl(),kd=xl(),Tv=kd(Sd("String.prototype.indexOf"));Td.exports=function(n,s){var a=Sd(n,!!s);return typeof a=="function"&&Tv(n,".prototype.")>-1?kd(a):a}});var Nd=se((nS,Od)=>{"use strict";var Iv=dl()(),Ov=cc(),fc=Ov("Object.prototype.toString"),wl=function(n){return Iv&&n&&typeof n=="object"&&Symbol.toStringTag in n?!1:fc(n)==="[object Arguments]"},Id=function(n){return wl(n)?!0:n!==null&&typeof n=="object"&&typeof n.length=="number"&&n.length>=0&&fc(n)!=="[object Array]"&&fc(n.callee)==="[object Function]"},Nv=function(){return wl(arguments)}();wl.isLegacyArguments=Id;Od.exports=Nv?wl:Id});var Ad=se((rS,Rd)=>{"use strict";var Rv=yl(),pc=Rv("%Object.defineProperty%",!0),dc=function(){if(pc)try{return pc({},"a",{value:1}),!0}catch{return!1}return!1};dc.hasArrayLengthDefineBug=function(){if(!dc())return null;try{return pc([],"length",{value:1}).length!==1}catch{return!0}};Rd.exports=dc});var Ia=se((iS,zd)=>{"use strict";var Av=oc(),Dv=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",Bv=Object.prototype.toString,Fv=Array.prototype.concat,Dd=Object.defineProperty,zv=function(r){return typeof r=="function"&&Bv.call(r)==="[object Function]"},Gv=Ad()(),Bd=Dd&&Gv,qv=function(r,n,s,a){if(n in r){if(a===!0){if(r[n]===s)return}else if(!zv(a)||!a())return}Bd?Dd(r,n,{configurable:!0,enumerable:!1,value:s,writable:!0}):r[n]=s},Fd=function(r,n){var s=arguments.length>2?arguments[2]:{},a=Av(n);Dv&&(a=Fv.call(a,Object.getOwnPropertySymbols(n)));for(var l=0;l{"use strict";var Gd=function(r){return r!==r};qd.exports=function(n,s){return n===0&&s===0?1/n===1/s:!!(n===s||Gd(n)&&Gd(s))}});var mc=se((sS,Ud)=>{"use strict";var Uv=gc();Ud.exports=function(){return typeof Object.is=="function"?Object.is:Uv}});var Hd=se((aS,jd)=>{"use strict";var jv=mc(),Hv=Ia();jd.exports=function(){var n=jv();return Hv(Object,{is:n},{is:function(){return Object.is!==n}}),n}});var Vd=se((uS,Yd)=>{"use strict";var Xv=Ia(),Zv=xl(),Yv=gc(),Xd=mc(),Vv=Hd(),Zd=Zv(Xd(),Object);Xv(Zd,{getPolyfill:Xd,implementation:Yv,shim:Vv});Yd.exports=Zd});var Qd=se((lS,$d)=>{"use strict";var _c=cc(),Wd=dl()(),Kd,Jd,yc,vc;Wd&&(Kd=_c("Object.prototype.hasOwnProperty"),Jd=_c("RegExp.prototype.exec"),yc={},Ll=function(){throw yc},vc={toString:Ll,valueOf:Ll},typeof Symbol.toPrimitive=="symbol"&&(vc[Symbol.toPrimitive]=Ll));var Ll,Wv=_c("Object.prototype.toString"),Kv=Object.getOwnPropertyDescriptor,Jv="[object RegExp]";$d.exports=Wd?function(n){if(!n||typeof n!="object")return!1;var s=Kv(n,"lastIndex"),a=s&&Kd(s,"value");if(!a)return!1;try{Jd(n,vc)}catch(l){return l===yc}}:function(n){return!n||typeof n!="object"&&typeof n!="function"?!1:Wv(n)===Jv}});var eg=se((hS,tg)=>{"use strict";var yu=function(){return typeof function(){}.name=="string"},_u=Object.getOwnPropertyDescriptor;if(_u)try{_u([],"length")}catch{_u=null}yu.functionsHaveConfigurableNames=function(){if(!yu()||!_u)return!1;var n=_u(function(){},"name");return!!n&&!!n.configurable};var $v=Function.prototype.bind;yu.boundFunctionsHaveNames=function(){return yu()&&typeof $v=="function"&&function(){}.bind().name!==""};tg.exports=yu});var wc=se((cS,xc)=>{"use strict";var Qv=eg().functionsHaveConfigurableNames(),t0=Object,e0=TypeError;xc.exports=function(){if(this!=null&&this!==t0(this))throw new e0("RegExp.prototype.flags getter called on non-object");var n="";return this.hasIndices&&(n+="d"),this.global&&(n+="g"),this.ignoreCase&&(n+="i"),this.multiline&&(n+="m"),this.dotAll&&(n+="s"),this.unicode&&(n+="u"),this.sticky&&(n+="y"),n};Qv&&Object.defineProperty&&Object.defineProperty(xc.exports,"name",{value:"get flags"})});var Lc=se((fS,ng)=>{"use strict";var n0=wc(),r0=Ia().supportsDescriptors,i0=Object.getOwnPropertyDescriptor;ng.exports=function(){if(r0&&/a/mig.flags==="gim"){var n=i0(RegExp.prototype,"flags");if(n&&typeof n.get=="function"&&typeof RegExp.prototype.dotAll=="boolean"&&typeof RegExp.prototype.hasIndices=="boolean"){var s="",a={};if(Object.defineProperty(a,"hasIndices",{get:function(){s+="d"}}),Object.defineProperty(a,"sticky",{get:function(){s+="y"}}),s==="dy")return n.get}}return n0}});var og=se((pS,ig)=>{"use strict";var o0=Ia().supportsDescriptors,s0=Lc(),a0=Object.getOwnPropertyDescriptor,u0=Object.defineProperty,l0=TypeError,rg=Object.getPrototypeOf,h0=/a/;ig.exports=function(){if(!o0||!rg)throw new l0("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var n=s0(),s=rg(h0),a=a0(s,"flags");return(!a||a.get!==n)&&u0(s,"flags",{configurable:!0,enumerable:!1,get:n}),n}});var lg=se((dS,ug)=>{"use strict";var c0=Ia(),f0=xl(),p0=wc(),sg=Lc(),d0=og(),ag=f0(sg());c0(ag,{getPolyfill:sg,implementation:p0,shim:d0});ug.exports=ag});var cg=se((gS,hg)=>{"use strict";var g0=Date.prototype.getDay,m0=function(n){try{return g0.call(n),!0}catch{return!1}},_0=Object.prototype.toString,y0="[object Date]",v0=dl()();hg.exports=function(n){return typeof n!="object"||n===null?!1:v0?m0(n):_0.call(n)===y0}});var bc=se((mS,Lg)=>{var fg=oc(),pg=Nd(),dg=Vd(),gg=Qd(),mg=lg(),_g=cg(),yg=Date.prototype.getTime;function wg(r,n,s){var a=s||{};return(a.strict?dg(r,n):r===n)?!0:!r||!n||typeof r!="object"&&typeof n!="object"?a.strict?dg(r,n):r==n:x0(r,n,a)}function vg(r){return r==null}function xg(r){return!(!r||typeof r!="object"||typeof r.length!="number"||typeof r.copy!="function"||typeof r.slice!="function"||r.length>0&&typeof r[0]!="number")}function x0(r,n,s){var a,l;if(typeof r!=typeof n||vg(r)||vg(n)||r.prototype!==n.prototype||pg(r)!==pg(n))return!1;var c=gg(r),g=gg(n);if(c!==g)return!1;if(c||g)return r.source===n.source&&mg(r)===mg(n);if(_g(r)&&_g(n))return yg.call(r)===yg.call(n);var m=xg(r),v=xg(n);if(m!==v)return!1;if(m||v){if(r.length!==n.length)return!1;for(a=0;a=0;a--)if(x[a]!=P[a])return!1;for(a=x.length-1;a>=0;a--)if(l=x[a],!wg(r[l],n[l],s))return!1;return!0}Lg.exports=wg});var Fc=se((LT,Ig)=>{var _1=bc(),ps=function(r){this.precision=r&&r.precision?r.precision:17,this.direction=r&&r.direction?r.direction:!1,this.pseudoNode=r&&r.pseudoNode?r.pseudoNode:!1,this.objectComparator=r&&r.objectComparator?r.objectComparator:y1};ps.prototype.compare=function(r,n){if(r.type!==n.type||!Tg(r,n))return!1;switch(r.type){case"Point":return this.compareCoord(r.coordinates,n.coordinates);case"LineString":return this.compareLine(r.coordinates,n.coordinates,0,!1);case"Polygon":return this.comparePolygon(r,n);case"Feature":return this.compareFeature(r,n);default:if(r.type.indexOf("Multi")===0){var s=this,a=kg(r),l=kg(n);return a.every(function(c){return this.some(function(g){return s.compare(c,g)})},l)}}return!1};function kg(r){return r.coordinates.map(function(n){return{type:r.type.replace("Multi",""),coordinates:n}})}function Tg(r,n){return r.hasOwnProperty("coordinates")?r.coordinates.length===n.coordinates.length:r.length===n.length}ps.prototype.compareCoord=function(r,n){if(r.length!==n.length)return!1;for(var s=0;s=0&&(s=[].concat(r.slice(a,r.length),r.slice(1,a+1))),s};ps.prototype.comparePath=function(r,n){var s=this;return r.every(function(a,l){return s.compareCoord(a,this[l])},n)};ps.prototype.comparePolygon=function(r,n){if(this.compareLine(r.coordinates[0],n.coordinates[0],1,!0)){var s=r.coordinates.slice(1,r.coordinates.length),a=n.coordinates.slice(1,n.coordinates.length),l=this;return s.every(function(c){return this.some(function(g){return l.compareLine(c,g,1,!0)})},a)}else return!1};ps.prototype.compareFeature=function(r,n){return r.id!==n.id||!this.objectComparator(r.properties,n.properties)||!this.compareBBox(r,n)?!1:this.compare(r.geometry,n.geometry)};ps.prototype.compareBBox=function(r,n){return!!(!r.bbox&&!n.bbox||r.bbox&&n.bbox&&this.compareCoord(r.bbox,n.bbox))};ps.prototype.removePseudo=function(r){return r};function y1(r,n){return _1(r,n,{strict:!0})}Ig.exports=ps});var Ng=se((RT,Ml)=>{function Us(r,n,s,a){this.dataset=[],this.epsilon=1,this.minPts=2,this.distance=this._euclideanDistance,this.clusters=[],this.noise=[],this._visited=[],this._assigned=[],this._datasetLength=0,this._init(r,n,s,a)}Us.prototype.run=function(r,n,s,a){this._init(r,n,s,a);for(var l=0;l=this.minPts&&(n=this._mergeArrays(n,l))}this._assigned[a]!==1&&this._addToCluster(a,r)}};Us.prototype._addToCluster=function(r,n){this.clusters[n].push(r),this._assigned[r]=1};Us.prototype._regionQuery=function(r){for(var n=[],s=0;s{function js(r,n,s){this.k=3,this.dataset=[],this.assignments=[],this.centroids=[],this.init(r,n,s)}js.prototype.init=function(r,n,s){this.assignments=[],this.centroids=[],typeof r<"u"&&(this.dataset=r),typeof n<"u"&&(this.k=n),typeof s<"u"&&(this.distance=s)};js.prototype.run=function(r,n){this.init(r,n);for(var s=this.dataset.length,a=0;a0){for(var v=0;v=0);return n};js.prototype.assign=function(){for(var r=!1,n=this.dataset.length,s,a=0;a"u"&&(r[n]=[]),r[n].push(s);return r};js.prototype.argmin=function(r,n,s){for(var a=Number.MAX_VALUE,l=0,c=n.length,g,m=0;m{function ds(r,n,s){this._queue=[],this._priorities=[],this._sorting="desc",this._init(r,n,s)}ds.prototype.insert=function(r,n){for(var s=this._queue.length,a=s;a--;){var l=this._priorities[a];this._sorting==="desc"?n>l&&(s=a):n{typeof Ra<"u"&&Ra.exports&&(Ag=zc());var Ag;function ks(r,n,s,a){this.epsilon=1,this.minPts=1,this.distance=this._euclideanDistance,this._reachability=[],this._processed=[],this._coreDistance=0,this._orderedList=[],this._init(r,n,s,a)}ks.prototype.run=function(r,n,s,a){this._init(r,n,s,a);for(var l=0,c=this.dataset.length;l=this.minPts)return s}};ks.prototype._regionQuery=function(r,n){n=n||this.epsilon;for(var s=[],a=0,l=this.dataset.length;a{typeof Sl<"u"&&Sl.exports&&(Sl.exports={DBSCAN:Ng(),KMEANS:Rg(),OPTICS:Dg(),PriorityQueue:zc()})});var Gc=se((HT,zg)=>{"use strict";zg.exports={eudist:function(n,s,a){for(var l=n.length,c=0,g=0;g{"use strict";var Gg=Gc(),L1=Gg.eudist,b1=Gg.dist;qg.exports={kmrand:function(n,s){for(var a={},l=[],c=s<<2,g=n.length,m=n[0].length>0;l.length0;){var v=n[Math.floor(Math.random()*g)],x=m?v.join("_"):""+v;a[x]||(a[x]=!0,l.push(v))}if(l.length0,m={},v=n[Math.floor(Math.random()*c)],x=g?v.join("_"):""+v;for(l.push(v),m[x]=!0;l.length{"use strict";var qc=Gc(),Xg=Ug(),E1=qc.eudist,ZT=qc.mandist,YT=qc.dist,M1=Xg.kmrand,P1=Xg.kmpp,jg=1e4;function Hg(r,n,s){s=s||[];for(var a=0;a0,q=[];if(s)s=="kmrand"?l=M1(r,n):s=="kmpp"?l=P1(r,n):l=s;else for(var z={};l.length{(function(r,n){typeof Yc=="object"&&typeof Vc<"u"?Vc.exports=n():typeof define=="function"&&define.amd?define(n):(r=typeof globalThis<"u"?globalThis:r||self,r.polygonClipping=n())})(Yc,function(){"use strict";function r(ht,Y){if(!(ht instanceof Y))throw new TypeError("Cannot call a class as a function")}function n(ht,Y){for(var C=0;CY?1:ht0){if(Y.right===null)break;if(C(ht,Y.right.key)>0){var J=Y.right;if(Y.right=J.left,J.left=Y,Y=J,Y.right===null)break}k.right=Y,k=Y,Y=Y.right}else break}return k.right=Y.left,F.left=Y.right,Y.left=b.right,Y.right=b.left,Y}function g(ht,Y,C,b){var k=new a(ht,Y);if(C===null)return k.left=k.right=null,k;C=c(ht,C,b);var F=b(ht,C.key);return F<0?(k.left=C.left,k.right=C,C.left=null):F>=0&&(k.right=C.right,k.left=C,C.right=null),k}function m(ht,Y,C){var b=null,k=null;if(Y){Y=c(ht,Y,C);var F=C(Y.key,ht);F===0?(b=Y.left,k=Y.right):F<0?(k=Y.right,Y.right=null,b=Y):(b=Y.left,Y.left=null,k=Y)}return{left:b,right:k}}function v(ht,Y,C){return Y===null?ht:(ht===null||(Y=c(ht.key,Y,C),Y.left=ht),Y)}function x(ht,Y,C,b,k){if(ht){b(""+Y+(C?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ")+k(ht)+` +`);var F=Y+(C?" ":"\u2502 ");ht.left&&x(ht.left,F,!1,b,k),ht.right&&x(ht.right,F,!0,b,k)}}var P=function(){function ht(Y){Y===void 0&&(Y=l),this._root=null,this._size=0,this._comparator=Y}return ht.prototype.insert=function(Y,C){return this._size++,this._root=g(Y,C,this._root,this._comparator)},ht.prototype.add=function(Y,C){var b=new a(Y,C);this._root===null&&(b.left=b.right=null,this._size++,this._root=b);var k=this._comparator,F=c(Y,this._root,k),Z=k(Y,F.key);return Z===0?this._root=F:(Z<0?(b.left=F.left,b.right=F,F.left=null):Z>0&&(b.right=F.right,b.left=F,F.right=null),this._size++,this._root=b),this._root},ht.prototype.remove=function(Y){this._root=this._remove(Y,this._root,this._comparator)},ht.prototype._remove=function(Y,C,b){var k;if(C===null)return null;C=c(Y,C,b);var F=b(Y,C.key);return F===0?(C.left===null?k=C.right:(k=c(Y,C.left,b),k.right=C.right),this._size--,k):C},ht.prototype.pop=function(){var Y=this._root;if(Y){for(;Y.left;)Y=Y.left;return this._root=c(Y.key,this._root,this._comparator),this._root=this._remove(Y.key,this._root,this._comparator),{key:Y.key,data:Y.data}}return null},ht.prototype.findStatic=function(Y){for(var C=this._root,b=this._comparator;C;){var k=b(Y,C.key);if(k===0)return C;k<0?C=C.left:C=C.right}return null},ht.prototype.find=function(Y){return this._root&&(this._root=c(Y,this._root,this._comparator),this._comparator(Y,this._root.key)!==0)?null:this._root},ht.prototype.contains=function(Y){for(var C=this._root,b=this._comparator;C;){var k=b(Y,C.key);if(k===0)return!0;k<0?C=C.left:C=C.right}return!1},ht.prototype.forEach=function(Y,C){for(var b=this._root,k=[],F=!1;!F;)b!==null?(k.push(b),b=b.left):k.length!==0?(b=k.pop(),Y.call(C,b),b=b.right):F=!0;return this},ht.prototype.range=function(Y,C,b,k){for(var F=[],Z=this._comparator,J=this._root,tt;F.length!==0||J;)if(J)F.push(J),J=J.left;else{if(J=F.pop(),tt=Z(J.key,C),tt>0)break;if(Z(J.key,Y)>=0&&b.call(k,J))return this;J=J.right}return this},ht.prototype.keys=function(){var Y=[];return this.forEach(function(C){var b=C.key;return Y.push(b)}),Y},ht.prototype.values=function(){var Y=[];return this.forEach(function(C){var b=C.data;return Y.push(b)}),Y},ht.prototype.min=function(){return this._root?this.minNode(this._root).key:null},ht.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},ht.prototype.minNode=function(Y){if(Y===void 0&&(Y=this._root),Y)for(;Y.left;)Y=Y.left;return Y},ht.prototype.maxNode=function(Y){if(Y===void 0&&(Y=this._root),Y)for(;Y.right;)Y=Y.right;return Y},ht.prototype.at=function(Y){for(var C=this._root,b=!1,k=0,F=[];!b;)if(C)F.push(C),C=C.left;else if(F.length>0){if(C=F.pop(),k===Y)return C;k++,C=C.right}else b=!0;return null},ht.prototype.next=function(Y){var C=this._root,b=null;if(Y.right){for(b=Y.right;b.left;)b=b.left;return b}for(var k=this._comparator;C;){var F=k(Y.key,C.key);if(F===0)break;F<0?(b=C,C=C.left):C=C.right}return b},ht.prototype.prev=function(Y){var C=this._root,b=null;if(Y.left!==null){for(b=Y.left;b.right;)b=b.right;return b}for(var k=this._comparator;C;){var F=k(Y.key,C.key);if(F===0)break;F<0?C=C.left:(b=C,C=C.right)}return b},ht.prototype.clear=function(){return this._root=null,this._size=0,this},ht.prototype.toList=function(){return q(this._root)},ht.prototype.load=function(Y,C,b){C===void 0&&(C=[]),b===void 0&&(b=!1);var k=Y.length,F=this._comparator;if(b&&R(Y,C,0,k-1,F),this._root===null)this._root=T(Y,C,0,k),this._size=k;else{var Z=j(this.toList(),N(Y,C),F);k=this._size+k,this._root=z({head:Z},0,k)}return this},ht.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(ht.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(ht.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),ht.prototype.toString=function(Y){Y===void 0&&(Y=function(k){return String(k.key)});var C=[];return x(this._root,"",!0,function(b){return C.push(b)},Y),C.join("")},ht.prototype.update=function(Y,C,b){var k=this._comparator,F=m(Y,this._root,k),Z=F.left,J=F.right;k(Y,C)<0?J=g(C,b,J,k):Z=g(C,b,Z,k),this._root=v(Z,J,k)},ht.prototype.split=function(Y){return m(Y,this._root,this._comparator)},ht}();function T(ht,Y,C,b){var k=b-C;if(k>0){var F=C+Math.floor(k/2),Z=ht[F],J=Y[F],tt=new a(Z,J);return tt.left=T(ht,Y,C,F),tt.right=T(ht,Y,F+1,b),tt}return null}function N(ht,Y){for(var C=new a(null,null),b=C,k=0;k0?(Y=F=F.next=C.pop(),Y=Y.right):b=!0;return F.next=null,k.next}function z(ht,Y,C){var b=C-Y;if(b>0){var k=Y+Math.floor(b/2),F=z(ht,Y,k),Z=ht.head;return Z.left=F,ht.head=ht.head.next,Z.right=z(ht,k+1,C),Z}return null}function j(ht,Y,C){for(var b=new a(null,null),k=b,F=ht,Z=Y;F!==null&&Z!==null;)C(F.key,Z.key)<0?(k.next=F,F=F.next):(k.next=Z,Z=Z.next),k=k.next;return F!==null?k.next=F:Z!==null&&(k.next=Z),b.next}function R(ht,Y,C,b,k){if(!(C>=b)){for(var F=ht[C+b>>1],Z=C-1,J=b+1;;){do Z++;while(k(ht[Z],F)<0);do J--;while(k(ht[J],F)>0);if(Z>=J)break;var tt=ht[Z];ht[Z]=ht[J],ht[J]=tt,tt=Y[Z],Y[Z]=Y[J],Y[J]=tt}R(ht,Y,C,J,k),R(ht,Y,J+1,b,k)}}var B=function(Y,C){return Y.ll.x<=C.x&&C.x<=Y.ur.x&&Y.ll.y<=C.y&&C.y<=Y.ur.y},D=function(Y,C){if(C.ur.xb.x?1:C.yb.y?1:0}}]);function ht(Y,C){r(this,ht),Y.events===void 0?Y.events=[this]:Y.events.push(this),this.point=Y,this.isLeft=C}return s(ht,[{key:"link",value:function(C){if(C.point===this.point)throw new Error("Tried to link already linked events");for(var b=C.point.events,k=0,F=b.length;k=0&&Ft>=0?LtWt?-1:0:pt<0&&Ft<0?LtWt?1:0:Ftpt?1:0}}}]),ht}(),Ct=0,st=function(){s(ht,null,[{key:"compare",value:function(C,b){var k=C.leftSE.point.x,F=b.leftSE.point.x,Z=C.rightSE.point.x,J=b.rightSE.point.x;if(Jtt&&pt>Lt)return-1;var Ft=C.comparePoint(b.leftSE.point);if(Ft<0)return 1;if(Ft>0)return-1;var Wt=b.comparePoint(C.rightSE.point);return Wt!==0?Wt:-1}if(k>F){if(ttpt&&tt>vt)return 1;var Jt=b.comparePoint(C.leftSE.point);if(Jt!==0)return Jt;var $t=C.comparePoint(b.rightSE.point);return $t<0?1:$t>0?-1:1}if(ttpt)return 1;if(ZJ){var ge=C.comparePoint(b.rightSE.point);if(ge<0)return 1;if(ge>0)return-1}if(Z!==J){var pe=Lt-tt,Te=Z-k,Ce=vt-pt,he=J-F;if(pe>Te&&Cehe)return-1}return Z>J?1:Zvt?1:C.idb.id?1:0}}]);function ht(Y,C,b,k){r(this,ht),this.id=++Ct,this.leftSE=Y,Y.segment=this,Y.otherSE=C,this.rightSE=C,C.segment=this,C.otherSE=Y,this.rings=b,this.windings=k}return s(ht,[{key:"replaceRightSE",value:function(C){this.rightSE=C,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var C=this.leftSE.point.y,b=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:Cb?C:b}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(C){return C.x===this.leftSE.point.x&&C.y===this.leftSE.point.y||C.x===this.rightSE.point.x&&C.y===this.rightSE.point.y}},{key:"comparePoint",value:function(C){if(this.isAnEndpoint(C))return 0;var b=this.leftSE.point,k=this.rightSE.point,F=this.vector();if(b.x===k.x)return C.x===b.x?0:C.x0&&tt.swapEvents(),ft.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),k&&(F.checkForConsuming(),Z.checkForConsuming()),b}},{key:"swapEvents",value:function(){var C=this.rightSE;this.rightSE=this.leftSE,this.leftSE=C,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var b=0,k=this.windings.length;b0){var Z=b;b=k,k=Z}if(b.prev===k){var J=b;b=k,k=J}for(var tt=0,pt=k.rings.length;tt0)F=b,Z=C,J=-1;else throw new Error("Tried to create degenerate segment at [".concat(C.x,", ").concat(C.y,"]"));var pt=new ft(F,!0),Lt=new ft(Z,!1);return new ht(pt,Lt,[k],[J])}}]),ht}(),Rt=function(){function ht(Y,C,b){if(r(this,ht),!Array.isArray(Y)||Y.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=C,this.isExterior=b,this.segments=[],typeof Y[0][0]!="number"||typeof Y[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var k=X.round(Y[0][0],Y[0][1]);this.bbox={ll:{x:k.x,y:k.y},ur:{x:k.x,y:k.y}};for(var F=k,Z=1,J=Y.length;Zthis.bbox.ur.x&&(this.bbox.ur.x=tt.x),tt.y>this.bbox.ur.y&&(this.bbox.ur.y=tt.y),F=tt)}(k.x!==F.x||k.y!==F.y)&&this.segments.push(st.fromRing(F,k,this))}return s(ht,[{key:"getSweepEvents",value:function(){for(var C=[],b=0,k=this.segments.length;bthis.bbox.ur.x&&(this.bbox.ur.x=F.bbox.ur.x),F.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=F.bbox.ur.y),this.interiorRings.push(F)}this.multiPoly=C}return s(ht,[{key:"getSweepEvents",value:function(){for(var C=this.exteriorRing.getSweepEvents(),b=0,k=this.interiorRings.length;bthis.bbox.ur.x&&(this.bbox.ur.x=F.bbox.ur.x),F.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=F.bbox.ur.y),this.polys.push(F)}this.isSubject=C}return s(ht,[{key:"getSweepEvents",value:function(){for(var C=[],b=0,k=this.polys.length;b0&&(C=F)}for(var Z=C.segment.prevInResult(),J=Z?Z.prevInResult():null;;){if(!Z)return null;if(!J)return Z.ringOut;if(J.ringOut!==Z.ringOut)return J.ringOut.enclosingRing()!==Z.ringOut?Z.ringOut:Z.ringOut.enclosingRing();Z=J.prevInResult(),J=Z?Z.prevInResult():null}}}]),ht}(),ce=function(){function ht(Y){r(this,ht),this.exteriorRing=Y,Y.poly=this,this.interiorRings=[]}return s(ht,[{key:"addInterior",value:function(C){this.interiorRings.push(C),C.poly=this}},{key:"getGeom",value:function(){var C=[this.exteriorRing.getGeom()];if(C[0]===null)return null;for(var b=0,k=this.interiorRings.length;b1&&arguments[1]!==void 0?arguments[1]:st.compare;r(this,ht),this.queue=Y,this.tree=new P(C),this.segments=[]}return s(ht,[{key:"process",value:function(C){var b=C.segment,k=[];if(C.consumedBy)return C.isLeft?this.queue.remove(C.otherSE):this.tree.remove(b),k;var F=C.isLeft?this.tree.insert(b):this.tree.find(b);if(!F)throw new Error("Unable to find segment #".concat(b.id," ")+"[".concat(b.leftSE.point.x,", ").concat(b.leftSE.point.y,"] -> ")+"[".concat(b.rightSE.point.x,", ").concat(b.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var Z=F,J=F,tt=void 0,pt=void 0;tt===void 0;)Z=this.tree.prev(Z),Z===null?tt=null:Z.key.consumedBy===void 0&&(tt=Z.key);for(;pt===void 0;)J=this.tree.next(J),J===null?pt=null:J.key.consumedBy===void 0&&(pt=J.key);if(C.isLeft){var Lt=null;if(tt){var vt=tt.getIntersection(b);if(vt!==null&&(b.isAnEndpoint(vt)||(Lt=vt),!tt.isAnEndpoint(vt)))for(var Ft=this._splitSafely(tt,vt),Wt=0,Jt=Ft.length;Wt0?(this.tree.remove(b),k.push(C)):(this.segments.push(b),b.prev=tt)}else{if(tt&&pt){var Dn=tt.getIntersection(pt);if(Dn!==null){if(!tt.isAnEndpoint(Dn))for(var Xn=this._splitSafely(tt,Dn),re=0,Vr=Xn.length;refe)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var he=new Cn($t),An=$t.size,we=$t.pop();we;){var St=we.key;if($t.size===An){var Dn=St.segment;throw new Error("Unable to pop() ".concat(St.isLeft?"left":"right"," SweepEvent ")+"[".concat(St.point.x,", ").concat(St.point.y,"] from segment #").concat(Dn.id," ")+"[".concat(Dn.leftSE.point.x,", ").concat(Dn.leftSE.point.y,"] -> ")+"[".concat(Dn.rightSE.point.x,", ").concat(Dn.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if($t.size>fe)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(he.segments.length>ke)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var Xn=he.process(St),re=0,Vr=Xn.length;re1?C-1:0),k=1;k1?C-1:0),k=1;k1?C-1:0),k=1;k1?C-1:0),k=1;k{(function(r,n){typeof Ol=="object"&&typeof cm<"u"?n(Ol):typeof define=="function"&&define.amd?define(["exports"],n):n(r.jsts={})})(Ol,function(r){"use strict";function n(){}function s(t){this.message=t||""}function a(t){this.message=t||""}function l(t){this.message=t||""}function c(){}function g(t){return t===null?nr:t.color}function m(t){return t===null?null:t.parent}function v(t,e){t!==null&&(t.color=e)}function x(t){return t===null?null:t.left}function P(t){return t===null?null:t.right}function T(){this.root_=null,this.size_=0}function N(){}function q(){this.array_=[],arguments[0]instanceof he&&this.addAll(arguments[0])}function z(){}function j(t){this.message=t||""}function R(){this.array_=[]}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(t){if(this===void 0||this===null)throw new TypeError(this+" is not an object");var e=Object(this),o=Math.max(Math.min(e.length,9007199254740991),0)||0,u=1 in arguments&&parseInt(Number(arguments[1]),10)||0;u=u<0?Math.max(o+u,0):Math.min(u,o);var d=2 in arguments&&arguments[2]!==void 0?parseInt(Number(arguments[2]),10)||0:o;for(d=d<0?Math.max(o+arguments[2],0):Math.min(d,o);ue.x?1:this.ye.y?1:0},X.prototype.clone=function(){},X.prototype.copy=function(){return new X(this)},X.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},X.prototype.distance3D=function(t){var e=this.x-t.x,o=this.y-t.y,u=this.z-t.z;return Math.sqrt(e*e+o*o+u*u)},X.prototype.distance=function(t){var e=this.x-t.x,o=this.y-t.y;return Math.sqrt(e*e+o*o)},X.prototype.hashCode=function(){var t=17;return t=37*t+X.hashCode(this.x),t=37*t+X.hashCode(this.y)},X.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z},X.prototype.interfaces_=function(){return[H,K,n]},X.prototype.getClass=function(){return X},X.hashCode=function(){if(arguments.length===1){var t=arguments[0],e=A.doubleToLongBits(t);return Math.trunc((e^e)>>>32)}},lt.DimensionalComparator.get=function(){return gt},lt.serialVersionUID.get=function(){return 6683108902428367e3},lt.NULL_ORDINATE.get=function(){return A.NaN},lt.X.get=function(){return 0},lt.Y.get=function(){return 1},lt.Z.get=function(){return 2},Object.defineProperties(X,lt);var gt=function(t){if(this._dimensionsToTest=2,arguments.length!==0){if(arguments.length===1){var e=arguments[0];if(e!==2&&e!==3)throw new D("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}}};gt.prototype.compare=function(t,e){var o=t,u=e,d=gt.compare(o.x,u.x);if(d!==0)return d;var w=gt.compare(o.y,u.y);return w!==0?w:this._dimensionsToTest<=2?0:gt.compare(o.z,u.z)},gt.prototype.interfaces_=function(){return[et]},gt.prototype.getClass=function(){return gt},gt.compare=function(t,e){return te?1:A.isNaN(t)?A.isNaN(e)?0:-1:A.isNaN(e)?1:0};var Et=function(){};Et.prototype.create=function(){},Et.prototype.interfaces_=function(){return[]},Et.prototype.getClass=function(){return Et};var Q=function(){},kt={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};Q.prototype.interfaces_=function(){return[]},Q.prototype.getClass=function(){return Q},Q.toLocationSymbol=function(t){switch(t){case Q.EXTERIOR:return"e";case Q.BOUNDARY:return"b";case Q.INTERIOR:return"i";case Q.NONE:return"-"}throw new D("Unknown location value: "+t)},kt.INTERIOR.get=function(){return 0},kt.BOUNDARY.get=function(){return 1},kt.EXTERIOR.get=function(){return 2},kt.NONE.get=function(){return-1},Object.defineProperties(Q,kt);var ct=function(t,e){return t.interfaces_&&t.interfaces_().indexOf(e)>-1},bt=function(){},Mt={LOG_10:{configurable:!0}};bt.prototype.interfaces_=function(){return[]},bt.prototype.getClass=function(){return bt},bt.log10=function(t){var e=Math.log(t);return A.isInfinite(e)||A.isNaN(e)?e:e/bt.LOG_10},bt.min=function(t,e,o,u){var d=t;return eo?o:t}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var u=arguments[0],d=arguments[1],w=arguments[2];return uw?w:u}},bt.wrap=function(t,e){return t<0?e- -t%e:t%e},bt.max=function(){if(arguments.length===3){var t=arguments[0],e=arguments[1],o=arguments[2],u=t;return e>u&&(u=e),o>u&&(u=o),u}if(arguments.length===4){var d=arguments[0],w=arguments[1],S=arguments[2],U=arguments[3],$=d;return w>$&&($=w),S>$&&($=S),U>$&&($=U),$}},bt.average=function(t,e){return(t+e)/2},Mt.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(bt,Mt);var Xt=function(t){this.str=t};Xt.prototype.append=function(t){this.str+=t},Xt.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},Xt.prototype.toString=function(t){return this.str};var ft=function(t){this.value=t};ft.prototype.intValue=function(){return this.value},ft.prototype.compareTo=function(t){return this.valuet?1:0},ft.isNaN=function(t){return Number.isNaN(t)};var Ct=function(){};Ct.isWhitespace=function(t){return t<=32&&t>=0||t===127},Ct.toUpperCase=function(t){return t.toUpperCase()};var st=function t(){if(this._hi=0,this._lo=0,arguments.length===0)this.init(0);else if(arguments.length===1){if(typeof arguments[0]=="number"){var e=arguments[0];this.init(e)}else if(arguments[0]instanceof t){var o=arguments[0];this.init(o)}else if(typeof arguments[0]=="string"){var u=arguments[0];t.call(this,t.parse(u))}}else if(arguments.length===2){var d=arguments[0],w=arguments[1];this.init(d,w)}},Rt={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};st.prototype.le=function(t){return(this._hi9?(_t=!0,wt="9"):wt="0"+ut,S.append(wt),o=o.subtract(st.valueOf(ut)).multiply(st.TEN),_t&&o.selfAdd(st.TEN);var zt=!0,qt=st.magnitude(o._hi);if(qt<0&&Math.abs(qt)>=U-$&&(zt=!1),!zt)break}return e[0]=u,S.toString()},st.prototype.sqr=function(){return this.multiply(this)},st.prototype.doubleValue=function(){return this._hi+this._lo},st.prototype.subtract=function(){if(arguments[0]instanceof st){var t=arguments[0];return this.add(t.negate())}if(typeof arguments[0]=="number"){var e=arguments[0];return this.add(-e)}},st.prototype.equals=function(){if(arguments.length===1){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}},st.prototype.isZero=function(){return this._hi===0&&this._lo===0},st.prototype.selfSubtract=function(){if(arguments[0]instanceof st){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t._hi,-t._lo)}if(typeof arguments[0]=="number"){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e,0)}},st.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},st.prototype.min=function(t){return this.le(t)?this:t},st.prototype.selfDivide=function(){if(arguments.length===1){if(arguments[0]instanceof st){var t=arguments[0];return this.selfDivide(t._hi,t._lo)}if(typeof arguments[0]=="number"){var e=arguments[0];return this.selfDivide(e,0)}}else if(arguments.length===2){var o=arguments[0],u=arguments[1],d=null,w=null,S=null,U=null,$=null,ut=null,_t=null,wt=null;return $=this._hi/o,ut=st.SPLIT*$,d=ut-$,wt=st.SPLIT*o,d=ut-d,w=$-d,S=wt-o,_t=$*o,S=wt-S,U=o-S,wt=d*S-_t+d*U+w*S+w*U,ut=(this._hi-_t-wt+this._lo-$*u)/o,wt=$+ut,this._hi=wt,this._lo=$-wt+ut,this}},st.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},st.prototype.divide=function(){if(arguments[0]instanceof st){var t=arguments[0],e=null,o=null,u=null,d=null,w=null,S=null,U=null,$=null;return o=(w=this._hi/t._hi)-(e=(S=st.SPLIT*w)-(e=S-w)),$=e*(u=($=st.SPLIT*t._hi)-(u=$-t._hi))-(U=w*t._hi)+e*(d=t._hi-u)+o*u+o*d,S=(this._hi-U-$+this._lo-w*t._lo)/t._hi,new st($=w+S,w-$+S)}if(typeof arguments[0]=="number"){var ut=arguments[0];return A.isNaN(ut)?st.createNaN():st.copy(this).selfDivide(ut,0)}},st.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo},st.prototype.pow=function(t){if(t===0)return st.valueOf(1);var e=new st(this),o=st.valueOf(1),u=Math.abs(t);if(u>1)for(;u>0;)u%2==1&&o.selfMultiply(e),(u/=2)>0&&(e=e.sqr());else o=e;return t<0?o.reciprocal():o},st.prototype.ceil=function(){if(this.isNaN())return st.NaN;var t=Math.ceil(this._hi),e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new st(t,e)},st.prototype.compareTo=function(t){var e=t;return this._hie._hi?1:this._loe._lo?1:0},st.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},st.prototype.setValue=function(){if(arguments[0]instanceof st){var t=arguments[0];return this.init(t),this}if(typeof arguments[0]=="number"){var e=arguments[0];return this.init(e),this}},st.prototype.max=function(t){return this.ge(t)?this:t},st.prototype.sqrt=function(){if(this.isZero())return st.valueOf(0);if(this.isNegative())return st.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,o=st.valueOf(e),u=this.subtract(o.sqr())._hi*(.5*t);return o.add(u)},st.prototype.selfAdd=function(){if(arguments.length===1){if(arguments[0]instanceof st){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}if(typeof arguments[0]=="number"){var e=arguments[0],o=null,u=null,d=null,w=null,S=null,U=null;return d=this._hi+e,S=d-this._hi,w=d-S,w=e-S+(this._hi-w),U=w+this._lo,o=d+U,u=U+(d-o),this._hi=o+u,this._lo=u+(o-this._hi),this}}else if(arguments.length===2){var $=arguments[0],ut=arguments[1],_t=null,wt=null,zt=null,qt=null,ne=null,oe=null,In=null;qt=this._hi+$,wt=this._lo+ut,ne=qt-(oe=qt-this._hi),zt=wt-(In=wt-this._lo);var xr=(_t=qt+(oe=(ne=$-oe+(this._hi-ne))+wt))+(oe=(zt=ut-In+(this._lo-zt))+(oe+(qt-_t))),vi=oe+(_t-xr);return this._hi=xr,this._lo=vi,this}},st.prototype.selfMultiply=function(){if(arguments.length===1){if(arguments[0]instanceof st){var t=arguments[0];return this.selfMultiply(t._hi,t._lo)}if(typeof arguments[0]=="number"){var e=arguments[0];return this.selfMultiply(e,0)}}else if(arguments.length===2){var o=arguments[0],u=arguments[1],d=null,w=null,S=null,U=null,$=null,ut=null;d=($=st.SPLIT*this._hi)-this._hi,ut=st.SPLIT*o,d=$-d,w=this._hi-d,S=ut-o;var _t=($=this._hi*o)+(ut=d*(S=ut-S)-$+d*(U=o-S)+w*S+w*U+(this._hi*u+this._lo*o)),wt=ut+(d=$-_t);return this._hi=_t,this._lo=wt,this}},st.prototype.selfSqr=function(){return this.selfMultiply(this)},st.prototype.floor=function(){if(this.isNaN())return st.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new st(t,e)},st.prototype.negate=function(){return this.isNaN()?this:new st(-this._hi,-this._lo)},st.prototype.clone=function(){},st.prototype.multiply=function(){if(arguments[0]instanceof st){var t=arguments[0];return t.isNaN()?st.createNaN():st.copy(this).selfMultiply(t)}if(typeof arguments[0]=="number"){var e=arguments[0];return A.isNaN(e)?st.createNaN():st.copy(this).selfMultiply(e,0)}},st.prototype.isNaN=function(){return A.isNaN(this._hi)},st.prototype.intValue=function(){return Math.trunc(this._hi)},st.prototype.toString=function(){var t=st.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()},st.prototype.toStandardNotation=function(){var t=this.getSpecialNumberString();if(t!==null)return t;var e=new Array(1).fill(null),o=this.extractSignificantDigits(!0,e),u=e[0]+1,d=o;if(o.charAt(0)===".")d="0"+o;else if(u<0)d="0."+st.stringOfChar("0",-u)+o;else if(o.indexOf(".")===-1){var w=u-o.length;d=o+st.stringOfChar("0",w)+".0"}return this.isNegative()?"-"+d:d},st.prototype.reciprocal=function(){var t=null,e=null,o=null,u=null,d=null,w=null,S=null,U=null;e=(d=1/this._hi)-(t=(w=st.SPLIT*d)-(t=w-d)),o=(U=st.SPLIT*this._hi)-this._hi;var $=d+(w=(1-(S=d*this._hi)-(U=t*(o=U-o)-S+t*(u=this._hi-o)+e*o+e*u)-d*this._lo)/this._hi);return new st($,d-$+w)},st.prototype.toSciNotation=function(){if(this.isZero())return st.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(t!==null)return t;var e=new Array(1).fill(null),o=this.extractSignificantDigits(!1,e),u=st.SCI_NOT_EXPONENT_CHAR+e[0];if(o.charAt(0)==="0")throw new Error("Found leading zero: "+o);var d="";o.length>1&&(d=o.substring(1));var w=o.charAt(0)+"."+d;return this.isNegative()?"-"+w+u:w+u},st.prototype.abs=function(){return this.isNaN()?st.NaN:this.isNegative()?this.negate():new st(this)},st.prototype.isPositive=function(){return(this._hi>0||this._hi===0)&&this._lo>0},st.prototype.lt=function(t){return(this._hit._hi||this._hi===t._hi)&&this._lo>t._lo},st.prototype.isNegative=function(){return(this._hi<0||this._hi===0)&&this._lo<0},st.prototype.trunc=function(){return this.isNaN()?st.NaN:this.isPositive()?this.floor():this.ceil()},st.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},st.prototype.interfaces_=function(){return[n,H,K]},st.prototype.getClass=function(){return st},st.sqr=function(t){return st.valueOf(t).selfMultiply(t)},st.valueOf=function(){if(typeof arguments[0]=="string"){var t=arguments[0];return st.parse(t)}if(typeof arguments[0]=="number"){var e=arguments[0];return new st(e)}},st.sqrt=function(t){return st.valueOf(t).sqrt()},st.parse=function(t){for(var e=0,o=t.length;Ct.isWhitespace(t.charAt(e));)e++;var u=!1;if(e=o);){var ut=t.charAt(e);if(e++,Ct.isDigit(ut)){var _t=ut-"0";w.selfMultiply(st.TEN),w.selfAdd(_t),S++}else{if(ut!=="."){if(ut==="e"||ut==="E"){var wt=t.substring(e);try{$=ft.parseInt(wt)}catch(In){throw In instanceof Error?new Error("Invalid exponent "+wt+" in string "+t):In}break}throw new Error("Unexpected character '"+ut+"' at position "+e+" in string "+t)}U=S}}var zt=w,qt=S-U-$;if(qt===0)zt=w;else if(qt>0){var ne=st.TEN.pow(qt);zt=w.divide(ne)}else if(qt<0){var oe=st.TEN.pow(-qt);zt=w.multiply(oe)}return u?zt.negate():zt},st.createNaN=function(){return new st(A.NaN,A.NaN)},st.copy=function(t){return new st(t)},st.magnitude=function(t){var e=Math.abs(t),o=Math.log(e)/Math.log(10),u=Math.trunc(Math.floor(o));return 10*Math.pow(10,u)<=e&&(u+=1),u},st.stringOfChar=function(t,e){for(var o=new Xt,u=0;u0){if(w<=0)return Ot.signum(S);u=d+w}else{if(!(d<0)||w>=0)return Ot.signum(S);u=-d-w}var U=Ot.DP_SAFE_EPSILON*u;return S>=U||-S>=U?Ot.signum(S):2},Ot.signum=function(t){return t>0?1:t<0?-1:0},Qt.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(Ot,Qt);var Tt=function(){},ce={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};ce.X.get=function(){return 0},ce.Y.get=function(){return 1},ce.Z.get=function(){return 2},ce.M.get=function(){return 3},Tt.prototype.setOrdinate=function(t,e,o){},Tt.prototype.size=function(){},Tt.prototype.getOrdinate=function(t,e){},Tt.prototype.getCoordinate=function(){},Tt.prototype.getCoordinateCopy=function(t){},Tt.prototype.getDimension=function(){},Tt.prototype.getX=function(t){},Tt.prototype.clone=function(){},Tt.prototype.expandEnvelope=function(t){},Tt.prototype.copy=function(){},Tt.prototype.getY=function(t){},Tt.prototype.toCoordinateArray=function(){},Tt.prototype.interfaces_=function(){return[K]},Tt.prototype.getClass=function(){return Tt},Object.defineProperties(Tt,ce);var Re=function(){},Cn=function(t){function e(){t.call(this,"Projective point not representable on the Cartesian plane.")}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Re),fe=function(){};fe.arraycopy=function(t,e,o,u,d){for(var w=0,S=e;St._minx?this._minx:t._minx,o=this._miny>t._miny?this._miny:t._miny,u=this._maxx=this._minx&&e.getMaxX()<=this._maxx&&e.getMinY()>=this._miny&&e.getMaxY()<=this._maxy}}else if(arguments.length===2){var o=arguments[0],u=arguments[1];return!this.isNull()&&o>=this._minx&&o<=this._maxx&&u>=this._miny&&u<=this._maxy}},Bt.prototype.intersects=function(){if(arguments.length===1){if(arguments[0]instanceof Bt){var t=arguments[0];return!this.isNull()&&!t.isNull()&&!(t._minx>this._maxx||t._maxxthis._maxy||t._maxythis._maxx||othis._maxy||uthis._maxx&&(this._maxx=e._maxx),e._minythis._maxy&&(this._maxy=e._maxy))}}else if(arguments.length===2){var o=arguments[0],u=arguments[1];this.isNull()?(this._minx=o,this._maxx=o,this._miny=u,this._maxy=u):(othis._maxx&&(this._maxx=o),uthis._maxy&&(this._maxy=u))}},Bt.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return te._minx?1:this._minye._miny?1:this._maxxe._maxx?1:this._maxye._maxy?1:0},Bt.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},Bt.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},Bt.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},Bt.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},Bt.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},Bt.prototype.expandBy=function(){if(arguments.length===1){var t=arguments[0];this.expandBy(t,t)}else if(arguments.length===2){var e=arguments[0],o=arguments[1];if(this.isNull())return null;this._minx-=e,this._maxx+=e,this._miny-=o,this._maxy+=o,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},Bt.prototype.contains=function(){if(arguments.length===1){if(arguments[0]instanceof Bt){var t=arguments[0];return this.covers(t)}if(arguments[0]instanceof X){var e=arguments[0];return this.covers(e)}}else if(arguments.length===2){var o=arguments[0],u=arguments[1];return this.covers(o,u)}},Bt.prototype.centre=function(){return this.isNull()?null:new X((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},Bt.prototype.init=function(){if(arguments.length===0)this.setToNull();else if(arguments.length===1){if(arguments[0]instanceof X){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof Bt){var e=arguments[0];this._minx=e._minx,this._maxx=e._maxx,this._miny=e._miny,this._maxy=e._maxy}}else if(arguments.length===2){var o=arguments[0],u=arguments[1];this.init(o.x,u.x,o.y,u.y)}else if(arguments.length===4){var d=arguments[0],w=arguments[1],S=arguments[2],U=arguments[3];dt._maxx&&(e=this._minx-t._maxx);var o=0;return this._maxyt._maxy&&(o=this._miny-t._maxy),e===0?o:o===0?e:Math.sqrt(e*e+o*o)},Bt.prototype.hashCode=function(){var t=17;return t=37*t+X.hashCode(this._minx),t=37*t+X.hashCode(this._maxx),t=37*t+X.hashCode(this._miny),t=37*t+X.hashCode(this._maxy)},Bt.prototype.interfaces_=function(){return[H,n]},Bt.prototype.getClass=function(){return Bt},Bt.intersects=function(){if(arguments.length===3){var t=arguments[0],e=arguments[1],o=arguments[2];return o.x>=(t.xe.x?t.x:e.x)&&o.y>=(t.ye.y?t.y:e.y)}if(arguments.length===4){var u=arguments[0],d=arguments[1],w=arguments[2],S=arguments[3],U=Math.min(w.x,S.x),$=Math.max(w.x,S.x),ut=Math.min(u.x,d.x),_t=Math.max(u.x,d.x);return!(ut>$)&&!(_t$)&&!(_tthis.getEdgeDistance(t,1)?(this._intLineIndex[t][0]=0,this._intLineIndex[t][1]=1):(this._intLineIndex[t][0]=1,this._intLineIndex[t][1]=0)}},b.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},b.prototype.setPrecisionModel=function(t){this._precisionModel=t},b.prototype.isInteriorIntersection=function(){if(arguments.length===0)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(arguments.length===1){for(var t=arguments[0],e=0;ed?u:d;else{var S=Math.abs(t.x-e.x),U=Math.abs(t.y-e.y);(w=u>d?S:U)!==0||t.equals(e)||(w=Math.max(S,U))}return C.isTrue(!(w===0&&!t.equals(e)),"Bad distance calculation"),w},b.nonRobustComputeEdgeDistance=function(t,e,o){var u=t.x-e.x,d=t.y-e.y,w=Math.sqrt(u*u+d*d);return C.isTrue(!(w===0&&!t.equals(e)),"Invalid distance calculation"),w},k.DONT_INTERSECT.get=function(){return 0},k.DO_INTERSECT.get=function(){return 1},k.COLLINEAR.get=function(){return 2},k.NO_INTERSECTION.get=function(){return 0},k.POINT_INTERSECTION.get=function(){return 1},k.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(b,k);var F=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isInSegmentEnvelopes=function(o){var u=new Bt(this._inputLines[0][0],this._inputLines[0][1]),d=new Bt(this._inputLines[1][0],this._inputLines[1][1]);return u.contains(o)&&d.contains(o)},e.prototype.computeIntersection=function(){if(arguments.length!==3)return t.prototype.computeIntersection.apply(this,arguments);var o=arguments[0],u=arguments[1],d=arguments[2];if(this._isProper=!1,Bt.intersects(u,d,o)&&tt.orientationIndex(u,d,o)===0&&tt.orientationIndex(d,u,o)===0)return this._isProper=!0,(o.equals(u)||o.equals(d))&&(this._isProper=!1),this._result=t.POINT_INTERSECTION,null;this._result=t.NO_INTERSECTION},e.prototype.normalizeToMinimum=function(o,u,d,w,S){S.x=this.smallestInAbsValue(o.x,u.x,d.x,w.x),S.y=this.smallestInAbsValue(o.y,u.y,d.y,w.y),o.x-=S.x,o.y-=S.y,u.x-=S.x,u.y-=S.y,d.x-=S.x,d.y-=S.y,w.x-=S.x,w.y-=S.y},e.prototype.safeHCoordinateIntersection=function(o,u,d,w){var S=null;try{S=ke.intersection(o,u,d,w)}catch(U){if(!(U instanceof Cn))throw U;S=e.nearestEndpoint(o,u,d,w)}return S},e.prototype.intersection=function(o,u,d,w){var S=this.intersectionWithNormalization(o,u,d,w);return this.isInSegmentEnvelopes(S)||(S=new X(e.nearestEndpoint(o,u,d,w))),this._precisionModel!==null&&this._precisionModel.makePrecise(S),S},e.prototype.smallestInAbsValue=function(o,u,d,w){var S=o,U=Math.abs(S);return Math.abs(u)1e-4&&fe.out.println("Distance = "+S.distance(U))},e.prototype.intersectionWithNormalization=function(o,u,d,w){var S=new X(o),U=new X(u),$=new X(d),ut=new X(w),_t=new X;this.normalizeToEnvCentre(S,U,$,ut,_t);var wt=this.safeHCoordinateIntersection(S,U,$,ut);return wt.x+=_t.x,wt.y+=_t.y,wt},e.prototype.computeCollinearIntersection=function(o,u,d,w){var S=Bt.intersects(o,u,d),U=Bt.intersects(o,u,w),$=Bt.intersects(d,w,o),ut=Bt.intersects(d,w,u);return S&&U?(this._intPt[0]=d,this._intPt[1]=w,t.COLLINEAR_INTERSECTION):$&&ut?(this._intPt[0]=o,this._intPt[1]=u,t.COLLINEAR_INTERSECTION):S&&$?(this._intPt[0]=d,this._intPt[1]=o,!d.equals(o)||U||ut?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):S&&ut?(this._intPt[0]=d,this._intPt[1]=u,!d.equals(u)||U||$?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):U&&$?(this._intPt[0]=w,this._intPt[1]=o,!w.equals(o)||S||ut?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):U&&ut?(this._intPt[0]=w,this._intPt[1]=u,!w.equals(u)||S||$?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):t.NO_INTERSECTION},e.prototype.normalizeToEnvCentre=function(o,u,d,w,S){var U=o.xu.x?o.x:u.x,_t=o.y>u.y?o.y:u.y,wt=d.xw.x?d.x:w.x,ne=d.y>w.y?d.y:w.y,oe=((U>wt?U:wt)+(utzt?$:zt)+(_t0&&U>0||S<0&&U<0)return t.NO_INTERSECTION;var $=tt.orientationIndex(d,w,o),ut=tt.orientationIndex(d,w,u);return $>0&&ut>0||$<0&&ut<0?t.NO_INTERSECTION:S===0&&U===0&&$===0&&ut===0?this.computeCollinearIntersection(o,u,d,w):(S===0||U===0||$===0||ut===0?(this._isProper=!1,o.equals2D(d)||o.equals2D(w)?this._intPt[0]=o:u.equals2D(d)||u.equals2D(w)?this._intPt[0]=u:S===0?this._intPt[0]=new X(d):U===0?this._intPt[0]=new X(w):$===0?this._intPt[0]=new X(o):ut===0&&(this._intPt[0]=new X(u))):(this._isProper=!0,this._intPt[0]=this.intersection(o,u,d,w)),t.POINT_INTERSECTION)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.nearestEndpoint=function(o,u,d,w){var S=o,U=tt.distancePointLine(o,d,w),$=tt.distancePointLine(u,d,w);return $0?o>0?-d:d:o>0?d:-d;if(e===0||o===0)return u>0?t>0?d:-d:t>0?-d:d;if(e>0?u>0?e<=u||(d=-d,w=t,t=o,o=w,w=e,e=u,u=w):e<=-u?(d=-d,o=-o,u=-u):(w=t,t=-o,o=w,w=e,e=-u,u=w):u>0?-e<=u?(d=-d,t=-t,e=-e):(w=-t,t=o,o=w,w=-e,e=u,u=w):e>=u?(t=-t,e=-e,o=-o,u=-u):(d=-d,w=-t,t=-o,o=w,w=-e,e=-u,u=w),t>0){if(!(o>0)||!(t<=o))return d}else{if(o>0||!(t>=o))return-d;d=-d,t=-t,o=-o}for(;;){if(S=Math.floor(o/t),o-=S*t,(u-=S*e)<0)return-d;if(u>e)return d;if(t>o+o){if(eu+u)return-d;o=t-o,u=e-u,d=-d}if(u===0)return o===0?0:-d;if(o===0||(S=Math.floor(t/o),t-=S*o,(e-=S*u)<0))return d;if(e>u)return-d;if(o>t+t){if(ue+e)return d;t=o-t,e=u-e,d=-d}if(e===0)return t===0?0:d;if(t===0)return-d}};var J=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t};J.prototype.countSegment=function(t,e){if(t.xu&&(o=e.x,u=t.x),this._p.x>=o&&this._p.x<=u&&(this._isPointOnSegment=!0),null}if(t.y>this._p.y&&e.y<=this._p.y||e.y>this._p.y&&t.y<=this._p.y){var d=t.x-this._p.x,w=t.y-this._p.y,S=e.x-this._p.x,U=e.y-this._p.y,$=Z.signOfDet2x2(d,w,S,U);if($===0)return this._isPointOnSegment=!0,null;U0&&this._crossingCount++}},J.prototype.isPointInPolygon=function(){return this.getLocation()!==Q.EXTERIOR},J.prototype.getLocation=function(){return this._isPointOnSegment?Q.BOUNDARY:this._crossingCount%2==1?Q.INTERIOR:Q.EXTERIOR},J.prototype.isOnSegment=function(){return this._isPointOnSegment},J.prototype.interfaces_=function(){return[]},J.prototype.getClass=function(){return J},J.locatePointInRing=function(){if(arguments[0]instanceof X&&ct(arguments[1],Tt)){for(var t=arguments[0],e=arguments[1],o=new J(t),u=new X,d=new X,w=1;w1||U<0||U>1)&&(d=!0)}}else d=!0;return d?bt.min(tt.distancePointLine(t,o,u),tt.distancePointLine(e,o,u),tt.distancePointLine(o,t,e),tt.distancePointLine(u,t,e)):0},tt.isPointInRing=function(t,e){return tt.locatePointInRing(t,e)!==Q.EXTERIOR},tt.computeLength=function(t){var e=t.size();if(e<=1)return 0;var o=0,u=new X;t.getCoordinate(0,u);for(var d=u.x,w=u.y,S=1;So.y&&(o=w,u=d)}var S=u;do(S-=1)<0&&(S=e);while(t[S].equals2D(o)&&S!==u);var U=u;do U=(U+1)%e;while(t[U].equals2D(o)&&U!==u);var $=t[S],ut=t[U];if($.equals2D(o)||ut.equals2D(o)||$.equals2D(ut))return!1;var _t=tt.computeOrientation($,o,ut),wt=!1;return wt=_t===0?$.x>ut.x:_t>0,wt},tt.locatePointInRing=function(t,e){return J.locatePointInRing(t,e)},tt.distancePointLinePerpendicular=function(t,e,o){var u=(o.x-e.x)*(o.x-e.x)+(o.y-e.y)*(o.y-e.y),d=((e.y-t.y)*(o.x-e.x)-(e.x-t.x)*(o.y-e.y))/u;return Math.abs(d)*Math.sqrt(u)},tt.computeOrientation=function(t,e,o){return tt.orientationIndex(t,e,o)},tt.distancePointLine=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];if(e.length===0)throw new D("Line array must contain at least one vertex");for(var o=t.distance(e[0]),u=0;u=1)return w.distance(U);var _t=((S.y-w.y)*(U.x-S.x)-(S.x-w.x)*(U.y-S.y))/$;return Math.abs(_t)*Math.sqrt($)}},tt.isOnLine=function(t,e){for(var o=new F,u=1;u0},pe.prototype.interfaces_=function(){return[$t]},pe.prototype.getClass=function(){return pe};var Te=function(){};Te.prototype.isInBoundary=function(t){return t>1},Te.prototype.interfaces_=function(){return[$t]},Te.prototype.getClass=function(){return Te};var Ce=function(){};Ce.prototype.isInBoundary=function(t){return t===1},Ce.prototype.interfaces_=function(){return[$t]},Ce.prototype.getClass=function(){return Ce};var he=function(){};he.prototype.add=function(){},he.prototype.addAll=function(){},he.prototype.isEmpty=function(){},he.prototype.iterator=function(){},he.prototype.size=function(){},he.prototype.toArray=function(){},he.prototype.remove=function(){},(s.prototype=new Error).name="IndexOutOfBoundsException";var An=function(){};An.prototype.hasNext=function(){},An.prototype.next=function(){},An.prototype.remove=function(){};var we=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(){},e.prototype.set=function(){},e.prototype.isEmpty=function(){},e}(he);(a.prototype=new Error).name="NoSuchElementException";var St=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof he&&this.addAll(arguments[0])}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.ensureCapacity=function(){},e.prototype.interfaces_=function(){return[t,he]},e.prototype.add=function(o){return arguments.length===1?this.array_.push(o):this.array_.splice(arguments[0],arguments[1]),!0},e.prototype.clear=function(){this.array_=[]},e.prototype.addAll=function(o){for(var u=o.iterator();u.hasNext();)this.add(u.next());return!0},e.prototype.set=function(o,u){var d=this.array_[o];return this.array_[o]=u,d},e.prototype.iterator=function(){return new Dn(this)},e.prototype.get=function(o){if(o<0||o>=this.size())throw new s;return this.array_[o]},e.prototype.isEmpty=function(){return this.array_.length===0},e.prototype.size=function(){return this.array_.length},e.prototype.toArray=function(){for(var o=[],u=0,d=this.array_.length;u=1&&this.get(this.size()-1).equals2D(S))return null;t.prototype.add.call(this,S)}else if(arguments[0]instanceof Object&&typeof arguments[1]=="boolean"){var U=arguments[0],$=arguments[1];return this.add(U,$),!0}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var ut=arguments[0],_t=arguments[1];if(arguments[2])for(var wt=0;wt=0;zt--)this.add(ut[zt],_t);return!0}if(typeof arguments[2]=="boolean"&&Number.isInteger(arguments[0])&&arguments[1]instanceof X){var qt=arguments[0],ne=arguments[1];if(!arguments[2]){var oe=this.size();if(oe>0&&(qt>0&&this.get(qt-1).equals2D(ne)||qtZo&&(Ms=-1);for(var ih=vi;ih!==Zo;ih+=Ms)this.add(In[ih],xr);return!0}},e.prototype.closeRing=function(){this.size()>0&&this.add(new X(this.get(0)),!1)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},Object.defineProperties(e,o),e}(St),re=function(){},Vr={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};Vr.ForwardComparator.get=function(){return zn},Vr.BidirectionalComparator.get=function(){return cn},Vr.coordArrayType.get=function(){return new Array(0).fill(null)},re.prototype.interfaces_=function(){return[]},re.prototype.getClass=function(){return re},re.isRing=function(t){return!(t.length<4)&&!!t[0].equals2D(t[t.length-1])},re.ptNotInList=function(t,e){for(var o=0;o=t?e:[]},re.indexOf=function(t,e){for(var o=0;o0)&&(e=t[o]);return e},re.extract=function(t,e,o){e=bt.clamp(e,0,t.length);var u=(o=bt.clamp(o,-1,t.length))-e+1;o<0&&(u=0),e>=t.length&&(u=0),ou.length)return 1;if(o.length===0)return 0;var d=re.compare(o,u);return re.isEqualReversed(o,u)?0:d},cn.prototype.OLDcompare=function(t,e){var o=t,u=e;if(o.lengthu.length)return 1;if(o.length===0)return 0;for(var d=re.increasingDirection(o),w=re.increasingDirection(u),S=d>0?0:o.length-1,U=w>0?0:o.length-1,$=0;$0))return e.value;e=e.right}}return null},T.prototype.put=function(t,e){if(this.root_===null)return this.root_={key:t,value:e,left:null,right:null,parent:null,color:nr,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var o,u,d=this.root_;do if(o=d,(u=t.compareTo(d.key))<0)d=d.left;else{if(!(u>0)){var w=d.value;return d.value=e,w}d=d.right}while(d!==null);var S={key:t,left:null,right:null,value:e,parent:o,color:nr,getValue:function(){return this.value},getKey:function(){return this.key}};return u<0?o.left=S:o.right=S,this.fixAfterInsertion(S),this.size_++,null},T.prototype.fixAfterInsertion=function(t){for(t.color=1;t!=null&&t!==this.root_&&t.parent.color===1;)if(m(t)===x(m(m(t)))){var e=P(m(m(t)));g(e)===1?(v(m(t),nr),v(e,nr),v(m(m(t)),1),t=m(m(t))):(t===P(m(t))&&(t=m(t),this.rotateLeft(t)),v(m(t),nr),v(m(m(t)),1),this.rotateRight(m(m(t))))}else{var o=x(m(m(t)));g(o)===1?(v(m(t),nr),v(o,nr),v(m(m(t)),1),t=m(m(t))):(t===x(m(t))&&(t=m(t),this.rotateRight(t)),v(m(t),nr),v(m(m(t)),1),this.rotateLeft(m(m(t))))}this.root_.color=nr},T.prototype.values=function(){var t=new St,e=this.getFirstEntry();if(e!==null)for(t.add(e.value);(e=T.successor(e))!==null;)t.add(e.value);return t},T.prototype.entrySet=function(){var t=new bo,e=this.getFirstEntry();if(e!==null)for(t.add(e);(e=T.successor(e))!==null;)t.add(e);return t},T.prototype.rotateLeft=function(t){if(t!=null){var e=t.right;t.right=e.left,e.left!=null&&(e.left.parent=t),e.parent=t.parent,t.parent===null?this.root_=e:t.parent.left===t?t.parent.left=e:t.parent.right=e,e.left=t,t.parent=e}},T.prototype.rotateRight=function(t){if(t!=null){var e=t.left;t.left=e.right,e.right!=null&&(e.right.parent=t),e.parent=t.parent,t.parent===null?this.root_=e:t.parent.right===t?t.parent.right=e:t.parent.left=e,e.right=t,t.parent=e}},T.prototype.getFirstEntry=function(){var t=this.root_;if(t!=null)for(;t.left!=null;)t=t.left;return t},T.successor=function(t){if(t===null)return null;if(t.right!==null){for(var e=t.right;e.left!==null;)e=e.left;return e}for(var o=t.parent,u=t;o!==null&&u===o.right;)u=o,o=o.parent;return o},T.prototype.size=function(){return this.size_};var Ut=function(){};Ut.prototype.interfaces_=function(){return[]},Ut.prototype.getClass=function(){return Ut},N.prototype=new c,(q.prototype=new N).contains=function(t){for(var e=0,o=this.array_.length;e=0;){var S=d.substring(0,w);u.add(S),w=(d=d.substring(w+o)).indexOf(e)}d.length>0&&u.add(d);for(var U=new Array(u.size()).fill(null),$=0;$0)for(var w=d;w0&&u.append(" ");for(var w=0;w0&&u.append(","),u.append(rr.toString(t.getOrdinate(d,w)))}return u.append(")"),u.toString()}},Ln.ensureValidRing=function(t,e){var o=e.size();return o===0?e:o<=3?Ln.createClosedRing(t,e,4):e.getOrdinate(0,Tt.X)===e.getOrdinate(o-1,Tt.X)&&e.getOrdinate(0,Tt.Y)===e.getOrdinate(o-1,Tt.Y)?e:Ln.createClosedRing(t,e,o+1)},Ln.createClosedRing=function(t,e,o){var u=t.create(o,e.getDimension()),d=e.size();Ln.copy(e,0,u,0,d);for(var w=d;w0&&Ln.reverse(this._points),null}},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?xe.FALSE:0},e.prototype.isClosed=function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},e.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},e.prototype.getDimension=function(){return 1},e.prototype.getLength=function(){return tt.computeLength(this._points)},e.prototype.getNumPoints=function(){return this._points.size()},e.prototype.reverse=function(){var u=this._points.copy();return Ln.reverse(u),this.getFactory().createLineString(u)},e.prototype.compareToSameClass=function(){if(arguments.length===1){for(var u=arguments[0],d=0,w=0;d= 2)");this._points=u},e.prototype.isCoordinate=function(u){for(var d=0;d=1&&this.getCoordinateSequence().size()= 4)")},e.prototype.getGeometryType=function(){return"LinearRing"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},o.MINIMUM_VALID_SIZE.get=function(){return 4},o.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(e,o),e}(kn),dr=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var o={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return vt.SORTINDEX_MULTIPOLYGON},e.prototype.equalsExact=function(){if(arguments.length===2){var u=arguments[0],d=arguments[1];return!!this.isEquivalentClass(u)&&t.prototype.equalsExact.call(this,u,d)}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.reverse=function(){for(var u=this._geometries.length,d=new Array(u).fill(null),w=0;w0?e.createPoint(o[0]):e.createPoint():t},Fi.prototype.interfaces_=function(){return[ur.GeometryEditorOperation]},Fi.prototype.getClass=function(){return Fi};var Le=function(){};Le.prototype.edit=function(t,e){return t instanceof Nr?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof kn?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof pr?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},Le.prototype.interfaces_=function(){return[ur.GeometryEditorOperation]},Le.prototype.getClass=function(){return Le};var le=function(){if(this._dimension=3,this._coordinates=null,arguments.length===1){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var t=arguments[0];this._coordinates=new Array(t).fill(null);for(var e=0;e0){var t=new Xt(17*this._coordinates.length);t.append("("),t.append(this._coordinates[0]);for(var e=1;e3&&(u=3),u<2?new le(o):new le(o,u)}},Un.prototype.interfaces_=function(){return[Et,n]},Un.prototype.getClass=function(){return Un},Un.instance=function(){return Un.instanceObject},Pi.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},Pi.instanceObject.get=function(){return new Un},Object.defineProperties(Un,Pi);var po=function(t){function e(){t.call(this),this.map_=new Map}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(o){return this.map_.get(o)||null},e.prototype.put=function(o,u){return this.map_.set(o,u),u},e.prototype.values=function(){for(var o=new St,u=this.map_.values(),d=u.next();!d.done;)o.add(d.value),d=u.next();return o},e.prototype.entrySet=function(){var o=new bo;return this.map_.entries().forEach(function(u){return o.add(u)}),o},e.prototype.size=function(){return this.map_.size()},e}(or),Zt=function t(){if(this._modelType=null,this._scale=null,arguments.length===0)this._modelType=t.FLOATING;else if(arguments.length===1){if(arguments[0]instanceof Wr){var e=arguments[0];this._modelType=e,e===t.FIXED&&this.setScale(1)}else if(typeof arguments[0]=="number"){var o=arguments[0];this._modelType=t.FIXED,this.setScale(o)}else if(arguments[0]instanceof t){var u=arguments[0];this._modelType=u._modelType,this._scale=u._scale}}},En={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};Zt.prototype.equals=function(t){if(!(t instanceof Zt))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale},Zt.prototype.compareTo=function(t){var e=t,o=this.getMaximumSignificantDigits(),u=e.getMaximumSignificantDigits();return new ft(o).compareTo(new ft(u))},Zt.prototype.getScale=function(){return this._scale},Zt.prototype.isFloating=function(){return this._modelType===Zt.FLOATING||this._modelType===Zt.FLOATING_SINGLE},Zt.prototype.getType=function(){return this._modelType},Zt.prototype.toString=function(){var t="UNKNOWN";return this._modelType===Zt.FLOATING?t="Floating":this._modelType===Zt.FLOATING_SINGLE?t="Floating-Single":this._modelType===Zt.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},Zt.prototype.makePrecise=function(){if(typeof arguments[0]=="number"){var t=arguments[0];return A.isNaN(t)||this._modelType===Zt.FLOATING_SINGLE?t:this._modelType===Zt.FIXED?Math.round(t*this._scale)/this._scale:t}if(arguments[0]instanceof X){var e=arguments[0];if(this._modelType===Zt.FLOATING)return null;e.x=this.makePrecise(e.x),e.y=this.makePrecise(e.y)}},Zt.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===Zt.FLOATING?t=16:this._modelType===Zt.FLOATING_SINGLE?t=6:this._modelType===Zt.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t},Zt.prototype.setScale=function(t){this._scale=Math.abs(t)},Zt.prototype.interfaces_=function(){return[n,H]},Zt.prototype.getClass=function(){return Zt},Zt.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},En.serialVersionUID.get=function(){return 7777263578777804e3},En.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(Zt,En);var Wr=function t(e){this._name=e||null,t.nameToTypeMap.put(e,this)},Mo={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};Wr.prototype.readResolve=function(){return Wr.nameToTypeMap.get(this._name)},Wr.prototype.toString=function(){return this._name},Wr.prototype.interfaces_=function(){return[n]},Wr.prototype.getClass=function(){return Wr},Mo.serialVersionUID.get=function(){return-552860263173159e4},Mo.nameToTypeMap.get=function(){return new po},Object.defineProperties(Wr,Mo),Zt.Type=Wr,Zt.FIXED=new Wr("FIXED"),Zt.FLOATING=new Wr("FLOATING"),Zt.FLOATING_SINGLE=new Wr("FLOATING SINGLE");var Kt=function t(){this._precisionModel=new Zt,this._SRID=0,this._coordinateSequenceFactory=t.getDefaultCoordinateSequenceFactory(),arguments.length===0||(arguments.length===1?ct(arguments[0],Et)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof Zt&&(this._precisionModel=arguments[0]):arguments.length===2?(this._precisionModel=arguments[0],this._SRID=arguments[1]):arguments.length===3&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},eo={serialVersionUID:{configurable:!0}};Kt.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new X(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new X(t.getMinX(),t.getMinY()),new X(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new X(t.getMinX(),t.getMinY()),new X(t.getMinX(),t.getMaxY()),new X(t.getMaxX(),t.getMaxY()),new X(t.getMaxX(),t.getMinY()),new X(t.getMinX(),t.getMinY())]),null)},Kt.prototype.createLineString=function(t){return t?t instanceof Array?new kn(this.getCoordinateSequenceFactory().create(t),this):ct(t,Tt)?new kn(t,this):void 0:new kn(this.getCoordinateSequenceFactory().create([]),this)},Kt.prototype.createMultiLineString=function(){if(arguments.length===0)return new ar(null,this);if(arguments.length===1){var t=arguments[0];return new ar(t,this)}},Kt.prototype.buildGeometry=function(t){for(var e=null,o=!1,u=!1,d=t.iterator();d.hasNext();){var w=d.next(),S=w.getClass();e===null&&(e=S),S!==e&&(o=!0),w.isGeometryCollectionOrDerived()&&(u=!0)}if(e===null)return this.createGeometryCollection();if(o||u)return this.createGeometryCollection(Kt.toGeometryArray(t));var U=t.iterator().next();if(t.size()>1){if(U instanceof bn)return this.createMultiPolygon(Kt.toPolygonArray(t));if(U instanceof kn)return this.createMultiLineString(Kt.toLineStringArray(t));if(U instanceof pr)return this.createMultiPoint(Kt.toPointArray(t));C.shouldNeverReachHere("Unhandled class: "+U.getClass().getName())}return U},Kt.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(t!==null?this.getCoordinateSequenceFactory().create(t):null)},Kt.prototype.createPoint=function(){if(arguments.length===0)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof X){var t=arguments[0];return this.createPoint(t!==null?this.getCoordinateSequenceFactory().create([t]):null)}if(ct(arguments[0],Tt)){var e=arguments[0];return new pr(e,this)}}},Kt.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},Kt.prototype.createPolygon=function(){if(arguments.length===0)return new bn(null,null,this);if(arguments.length===1){if(ct(arguments[0],Tt)){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}if(arguments[0]instanceof Array){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}if(arguments[0]instanceof Nr){var o=arguments[0];return this.createPolygon(o,null)}}else if(arguments.length===2){var u=arguments[0],d=arguments[1];return new bn(u,d,this)}},Kt.prototype.getSRID=function(){return this._SRID},Kt.prototype.createGeometryCollection=function(){if(arguments.length===0)return new wn(null,this);if(arguments.length===1){var t=arguments[0];return new wn(t,this)}},Kt.prototype.createGeometry=function(t){return new ur(this).edit(t,{edit:function(){if(arguments.length===2){var e=arguments[0];return this._coordinateSequenceFactory.create(e)}}})},Kt.prototype.getPrecisionModel=function(){return this._precisionModel},Kt.prototype.createLinearRing=function(){if(arguments.length===0)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];return this.createLinearRing(t!==null?this.getCoordinateSequenceFactory().create(t):null)}if(ct(arguments[0],Tt)){var e=arguments[0];return new Nr(e,this)}}},Kt.prototype.createMultiPolygon=function(){if(arguments.length===0)return new dr(null,this);if(arguments.length===1){var t=arguments[0];return new dr(t,this)}},Kt.prototype.createMultiPoint=function(){if(arguments.length===0)return new mi(null,this);if(arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];return new mi(t,this)}if(arguments[0]instanceof Array){var e=arguments[0];return this.createMultiPoint(e!==null?this.getCoordinateSequenceFactory().create(e):null)}if(ct(arguments[0],Tt)){var o=arguments[0];if(o===null)return this.createMultiPoint(new Array(0).fill(null));for(var u=new Array(o.size()).fill(null),d=0;d=this.size())throw new Error;return this.array_[t]},R.prototype.push=function(t){return this.array_.push(t),t},R.prototype.pop=function(t){if(this.array_.length===0)throw new j;return this.array_.pop()},R.prototype.peek=function(){if(this.array_.length===0)throw new j;return this.array_[this.array_.length-1]},R.prototype.empty=function(){return this.array_.length===0},R.prototype.isEmpty=function(){return this.empty()},R.prototype.search=function(t){return this.array_.indexOf(t)},R.prototype.size=function(){return this.array_.length},R.prototype.toArray=function(){for(var t=[],e=0,o=this.array_.length;e0&&this._minIndexthis._minCoord.y&&o.y>this._minCoord.y&&u===tt.CLOCKWISE)&&(d=!0),d&&(this._minIndex=this._minIndex-1)},fn.prototype.getRightmostSideOfSegment=function(t,e){var o=t.getEdge().getCoordinates();if(e<0||e+1>=o.length||o[e].y===o[e+1].y)return-1;var u=It.LEFT;return o[e].ythis._minCoord.x)&&(this._minDe=t,this._minIndex=o,this._minCoord=e[o])},fn.prototype.findRightmostEdgeAtNode=function(){var t=this._minDe.getNode().getEdges();this._minDe=t.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},fn.prototype.findEdge=function(t){for(var e=t.iterator();e.hasNext();){var o=e.next();o.isForward()&&this.checkForRightmostCoordinate(o)}C.isTrue(this._minIndex!==0||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),this._minIndex===0?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe,this.getRightmostSide(this._minDe,this._minIndex)===It.LEFT&&(this._orientedDe=this._minDe.getSym())},fn.prototype.interfaces_=function(){return[]},fn.prototype.getClass=function(){return fn};var Qn=function(t){function e(o,u){t.call(this,e.msgWithCoord(o,u)),this.pt=u?new X(u):null,this.name="TopologyException"}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCoordinate=function(){return this.pt},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.msgWithCoord=function(o,u){return u?o:o+" [ "+u+" ]"},e}(ht),Ci=function(){this.array_=[]};Ci.prototype.addLast=function(t){this.array_.push(t)},Ci.prototype.removeFirst=function(){return this.array_.shift()},Ci.prototype.isEmpty=function(){return this.array_.length===0};var tr=function(){this._finder=null,this._dirEdgeList=new St,this._nodes=new St,this._rightMostCoord=null,this._env=null,this._finder=new fn};tr.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();)t.next().setVisited(!1)},tr.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},tr.prototype.computeNodeDepth=function(t){for(var e=null,o=t.getEdges().iterator();o.hasNext();){var u=o.next();if(u.isVisited()||u.getSym().isVisited()){e=u;break}}if(e===null)throw new Qn("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(e);for(var d=t.getEdges().iterator();d.hasNext();){var w=d.next();w.setVisited(!0),this.copySymDepths(w)}},tr.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(It.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},tr.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},tr.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(It.RIGHT)>=1&&e.getDepth(It.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},tr.prototype.computeDepths=function(t){var e=new bo,o=new Ci,u=t.getNode();for(o.addLast(u),e.add(u),t.setVisited(!0);!o.isEmpty();){var d=o.removeFirst();e.add(d),this.computeNodeDepth(d);for(var w=d.getEdges().iterator();w.hasNext();){var S=w.next().getSym();if(!S.isVisited()){var U=S.getNode();e.contains(U)||(o.addLast(U),e.add(U))}}}},tr.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.xe._rightMostCoord.x?1:0},tr.prototype.getEnvelope=function(){if(this._env===null){for(var t=new Bt,e=this._dirEdgeList.iterator();e.hasNext();)for(var o=e.next().getEdge().getCoordinates(),u=0;uthis.location.length){var e=new Array(3).fill(null);e[It.ON]=this.location[It.ON],e[It.LEFT]=Q.NONE,e[It.RIGHT]=Q.NONE,this.location=e}for(var o=0;o1&&t.append(Q.toLocationSymbol(this.location[It.LEFT])),t.append(Q.toLocationSymbol(this.location[It.ON])),this.location.length>1&&t.append(Q.toLocationSymbol(this.location[It.RIGHT])),t.toString()},Ae.prototype.setLocations=function(t,e,o){this.location[It.ON]=t,this.location[It.LEFT]=e,this.location[It.RIGHT]=o},Ae.prototype.get=function(t){return t1},Ae.prototype.isAnyNull=function(){for(var t=0;tthis._maxNodeDegree&&(this._maxNodeDegree=e),t=this.getNext(t)}while(t!==this._startDe);this._maxNodeDegree*=2},Nn.prototype.addPoints=function(t,e,o){var u=t.getCoordinates();if(e){var d=1;o&&(d=0);for(var w=d;w=0;U--)this._pts.add(u[U])}},Nn.prototype.isHole=function(){return this._isHole},Nn.prototype.setInResult=function(){var t=this._startDe;do t.getEdge().setInResult(!0),t=t.getNext();while(t!==this._startDe)},Nn.prototype.containsPoint=function(t){var e=this.getLinearRing();if(!e.getEnvelopeInternal().contains(t)||!tt.isPointInRing(t,e.getCoordinates()))return!1;for(var o=this._holes.iterator();o.hasNext();)if(o.next().containsPoint(t))return!1;return!0},Nn.prototype.addHole=function(t){this._holes.add(t)},Nn.prototype.isShell=function(){return this._shell===null},Nn.prototype.getLabel=function(){return this._label},Nn.prototype.getEdges=function(){return this._edges},Nn.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},Nn.prototype.getShell=function(){return this._shell},Nn.prototype.mergeLabel=function(){if(arguments.length===1){var t=arguments[0];this.mergeLabel(t,0),this.mergeLabel(t,1)}else if(arguments.length===2){var e=arguments[0],o=arguments[1],u=e.getLocation(o,It.RIGHT);if(u===Q.NONE)return null;if(this._label.getLocation(o)===Q.NONE)return this._label.setLocation(o,u),null}},Nn.prototype.setShell=function(t){this._shell=t,t!==null&&t.addHole(this)},Nn.prototype.toPolygon=function(t){for(var e=new Array(this._holes.size()).fill(null),o=0;o=2,"found partial label"),this.computeIM(t)},ie.prototype.isInResult=function(){return this._isInResult},ie.prototype.isVisited=function(){return this._isVisited},ie.prototype.interfaces_=function(){return[]},ie.prototype.getClass=function(){return ie};var Kr=function(t){function e(){t.call(this),this._coord=null,this._edges=null;var o=arguments[0],u=arguments[1];this._coord=o,this._edges=u,this._label=new be(0,Q.NONE)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isIncidentEdgeInResult=function(){for(var o=this.getEdges().getEdges().iterator();o.hasNext();)if(o.next().getEdge().isInResult())return!0;return!1},e.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},e.prototype.getCoordinate=function(){return this._coord},e.prototype.print=function(o){o.println("node "+this._coord+" lbl: "+this._label)},e.prototype.computeIM=function(o){},e.prototype.computeMergedLocation=function(o,u){var d=Q.NONE;if(d=this._label.getLocation(u),!o.isNull(u)){var w=o.getLocation(u);d!==Q.BOUNDARY&&(d=w)}return d},e.prototype.setLabel=function(){if(arguments.length!==2)return t.prototype.setLabel.apply(this,arguments);var o=arguments[0],u=arguments[1];this._label===null?this._label=new be(o,u):this._label.setLocation(o,u)},e.prototype.getEdges=function(){return this._edges},e.prototype.mergeLabel=function(){if(arguments[0]instanceof e){var o=arguments[0];this.mergeLabel(o._label)}else if(arguments[0]instanceof be)for(var u=arguments[0],d=0;d<2;d++){var w=this.computeMergedLocation(u,d);this._label.getLocation(d)===Q.NONE&&this._label.setLocation(d,w)}},e.prototype.add=function(o){this._edges.insert(o),o.setNode(this)},e.prototype.setLabelBoundary=function(o){if(this._label===null)return null;var u=Q.NONE;this._label!==null&&(u=this._label.getLocation(o));var d=null;switch(u){case Q.BOUNDARY:d=Q.INTERIOR;break;case Q.INTERIOR:default:d=Q.BOUNDARY}this._label.setLocation(o,d)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ie),Pe=function(){this.nodeMap=new T,this.nodeFact=null;var t=arguments[0];this.nodeFact=t};Pe.prototype.find=function(t){return this.nodeMap.get(t)},Pe.prototype.addNode=function(){if(arguments[0]instanceof X){var t=arguments[0],e=this.nodeMap.get(t);return e===null&&(e=this.nodeFact.createNode(t),this.nodeMap.put(t,e)),e}if(arguments[0]instanceof Kr){var o=arguments[0],u=this.nodeMap.get(o.getCoordinate());return u===null?(this.nodeMap.put(o.getCoordinate(),o),o):(u.mergeLabel(o),u)}},Pe.prototype.print=function(t){for(var e=this.iterator();e.hasNext();)e.next().print(t)},Pe.prototype.iterator=function(){return this.nodeMap.values().iterator()},Pe.prototype.values=function(){return this.nodeMap.values()},Pe.prototype.getBoundaryNodes=function(t){for(var e=new St,o=this.iterator();o.hasNext();){var u=o.next();u.getLabel().getLocation(t)===Q.BOUNDARY&&e.add(u)}return e},Pe.prototype.add=function(t){var e=t.getCoordinate();this.addNode(e).add(t)},Pe.prototype.interfaces_=function(){return[]},Pe.prototype.getClass=function(){return Pe};var h=function(){},p={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};h.prototype.interfaces_=function(){return[]},h.prototype.getClass=function(){return h},h.isNorthern=function(t){return t===h.NE||t===h.NW},h.isOpposite=function(t,e){return t===e?!1:(t-e+4)%4===2},h.commonHalfPlane=function(t,e){if(t===e)return t;if((t-e+4)%4===2)return-1;var o=te?t:e)===3?3:o},h.isInHalfPlane=function(t,e){return e===h.SE?t===h.SE||t===h.SW:t===e||t===e+1},h.quadrant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1];if(t===0&&e===0)throw new D("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?h.NE:h.SE:e>=0?h.NW:h.SW}if(arguments[0]instanceof X&&arguments[1]instanceof X){var o=arguments[0],u=arguments[1];if(u.x===o.x&&u.y===o.y)throw new D("Cannot compute the quadrant for two identical points "+o);return u.x>=o.x?u.y>=o.y?h.NE:h.SE:u.y>=o.y?h.NW:h.SW}},p.NE.get=function(){return 0},p.NW.get=function(){return 1},p.SW.get=function(){return 2},p.SE.get=function(){return 3},Object.defineProperties(h,p);var _=function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,arguments.length===1){var t=arguments[0];this._edge=t}else if(arguments.length===3){var e=arguments[0],o=arguments[1],u=arguments[2];this._edge=e,this.init(o,u),this._label=null}else if(arguments.length===4){var d=arguments[0],w=arguments[1],S=arguments[2],U=arguments[3];this._edge=d,this.init(w,S),this._label=U}};_.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant2){w.linkDirectedEdgesForMinimalEdgeRings();var S=w.buildMinimalRings(),U=this.findShell(S);U!==null?(this.placePolygonHoles(U,S),e.add(U)):o.addAll(S)}else u.add(w)}return u},nt.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();)if(e.next().containsPoint(t))return!0;return!1},nt.prototype.buildMaximalEdgeRings=function(t){for(var e=new St,o=t.iterator();o.hasNext();){var u=o.next();if(u.isInResult()&&u.getLabel().isArea()&&u.getEdgeRing()===null){var d=new Qo(u,this._geometryFactory);e.add(d),d.setInResult()}}return e},nt.prototype.placePolygonHoles=function(t,e){for(var o=e.iterator();o.hasNext();){var u=o.next();u.isHole()&&u.setShell(t)}},nt.prototype.getPolygons=function(){return this.computePolygons(this._shellList)},nt.prototype.findEdgeRingContaining=function(t,e){for(var o=t.getLinearRing(),u=o.getEnvelopeInternal(),d=o.getCoordinateN(0),w=null,S=null,U=e.iterator();U.hasNext();){var $=U.next(),ut=$.getLinearRing(),_t=ut.getEnvelopeInternal();w!==null&&(S=w.getLinearRing().getEnvelopeInternal());var wt=!1;_t.contains(u)&&tt.isPointInRing(d,ut.getCoordinates())&&(wt=!0),wt&&(w===null||S.contains(_t))&&(w=$)}return w},nt.prototype.findShell=function(t){for(var e=0,o=null,u=t.iterator();u.hasNext();){var d=u.next();d.isHole()||(o=d,e++)}return C.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),o},nt.prototype.add=function(){if(arguments.length===1){var t=arguments[0];this.add(t.getEdgeEnds(),t.getNodes())}else if(arguments.length===2){var e=arguments[0],o=arguments[1];V.linkResultDirectedEdges(o);var u=this.buildMaximalEdgeRings(e),d=new St,w=this.buildMinimalEdgeRings(u,this._shellList,d);this.sortShellsAndHoles(w,this._shellList,d),this.placeFreeHoles(this._shellList,d)}},nt.prototype.interfaces_=function(){return[]},nt.prototype.getClass=function(){return nt};var it=function(){};it.prototype.getBounds=function(){},it.prototype.interfaces_=function(){return[]},it.prototype.getClass=function(){return it};var rt=function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e};rt.prototype.getItem=function(){return this._item},rt.prototype.getBounds=function(){return this._bounds},rt.prototype.interfaces_=function(){return[it,n]},rt.prototype.getClass=function(){return rt};var ot=function(){this._size=null,this._items=null,this._size=0,this._items=new St,this._items.add(null)};ot.prototype.poll=function(){if(this.isEmpty())return null;var t=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),t},ot.prototype.size=function(){return this._size},ot.prototype.reorder=function(t){for(var e=null,o=this._items.get(t);2*t<=this._size&&((e=2*t)!==this._size&&this._items.get(e+1).compareTo(this._items.get(e))<0&&e++,this._items.get(e).compareTo(o)<0);t=e)this._items.set(t,this._items.get(e));this._items.set(t,o)},ot.prototype.clear=function(){this._size=0,this._items.clear()},ot.prototype.isEmpty=function(){return this._size===0},ot.prototype.add=function(t){this._items.add(null),this._size+=1;var e=this._size;for(this._items.set(0,t);t.compareTo(this._items.get(Math.trunc(e/2)))<0;e/=2)this._items.set(e,this._items.get(Math.trunc(e/2)));this._items.set(e,t)},ot.prototype.interfaces_=function(){return[]},ot.prototype.getClass=function(){return ot};var dt=function(){};dt.prototype.visitItem=function(t){},dt.prototype.interfaces_=function(){return[]},dt.prototype.getClass=function(){return dt};var Pt=function(){};Pt.prototype.insert=function(t,e){},Pt.prototype.remove=function(t,e){},Pt.prototype.query=function(){},Pt.prototype.interfaces_=function(){return[]},Pt.prototype.getClass=function(){return Pt};var yt=function(){if(this._childBoundables=new St,this._bounds=null,this._level=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this._level=t}}},At={serialVersionUID:{configurable:!0}};yt.prototype.getLevel=function(){return this._level},yt.prototype.size=function(){return this._childBoundables.size()},yt.prototype.getChildBoundables=function(){return this._childBoundables},yt.prototype.addChildBoundable=function(t){C.isTrue(this._bounds===null),this._childBoundables.add(t)},yt.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},yt.prototype.getBounds=function(){return this._bounds===null&&(this._bounds=this.computeBounds()),this._bounds},yt.prototype.interfaces_=function(){return[it,n]},yt.prototype.getClass=function(){return yt},At.serialVersionUID.get=function(){return 6493722185909574e3},Object.defineProperties(yt,At);var Gt=function(){};Gt.reverseOrder=function(){return{compare:function(t,e){return e.compareTo(t)}}},Gt.min=function(t){return Gt.sort(t),t.get(0)},Gt.sort=function(t,e){var o=t.toArray();e?oi.sort(o,e):oi.sort(o);for(var u=t.iterator(),d=0,w=o.length;dte.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,t,e),null):(this.expand(this._boundable2,this._boundable1,t,e),null);if(o)return this.expand(this._boundable1,this._boundable2,t,e),null;if(u)return this.expand(this._boundable2,this._boundable1,t,e),null;throw new D("neither boundable is composite")},te.prototype.isLeaves=function(){return!(te.isComposite(this._boundable1)||te.isComposite(this._boundable2))},te.prototype.compareTo=function(t){var e=t;return this._distancee._distance?1:0},te.prototype.expand=function(t,e,o,u){for(var d=t.getChildBoundables().iterator();d.hasNext();){var w=d.next(),S=new te(w,e,this._itemDistance);S.getDistance()1,"Node capacity must be greater than 1"),this._nodeCapacity=o}},Rn={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};Dt.prototype.getNodeCapacity=function(){return this._nodeCapacity},Dt.prototype.lastNode=function(t){return t.get(t.size()-1)},Dt.prototype.size=function(){if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.size(this._root));if(arguments.length===1){for(var t=0,e=arguments[0].getChildBoundables().iterator();e.hasNext();){var o=e.next();o instanceof yt?t+=this.size(o):o instanceof rt&&(t+=1)}return t}},Dt.prototype.removeItem=function(t,e){for(var o=null,u=t.getChildBoundables().iterator();u.hasNext();){var d=u.next();d instanceof rt&&d.getItem()===e&&(o=d)}return o!==null&&(t.getChildBoundables().remove(o),!0)},Dt.prototype.itemsTree=function(){if(arguments.length===0){this.build();var t=this.itemsTree(this._root);return t===null?new St:t}if(arguments.length===1){for(var e=arguments[0],o=new St,u=e.getChildBoundables().iterator();u.hasNext();){var d=u.next();if(d instanceof yt){var w=this.itemsTree(d);w!==null&&o.add(w)}else d instanceof rt?o.add(d.getItem()):C.shouldNeverReachHere()}return o.size()<=0?null:o}},Dt.prototype.insert=function(t,e){C.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new rt(t,e))},Dt.prototype.boundablesAtLevel=function(){if(arguments.length===1){var t=arguments[0],e=new St;return this.boundablesAtLevel(t,this._root,e),e}if(arguments.length===3){var o=arguments[0],u=arguments[1],d=arguments[2];if(C.isTrue(o>-2),u.getLevel()===o)return d.add(u),null;for(var w=u.getChildBoundables().iterator();w.hasNext();){var S=w.next();S instanceof yt?this.boundablesAtLevel(o,S,d):(C.isTrue(S instanceof rt),o===-1&&d.add(S))}return null}},Dt.prototype.query=function(){if(arguments.length===1){var t=arguments[0];this.build();var e=new St;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.query(t,this._root,e),e}if(arguments.length===2){var o=arguments[0],u=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),o)&&this.query(o,this._root,u)}else if(arguments.length===3){if(ct(arguments[2],dt)&&arguments[0]instanceof Object&&arguments[1]instanceof yt)for(var d=arguments[0],w=arguments[1],S=arguments[2],U=w.getChildBoundables(),$=0;$t&&(t=u)}}return t+1}},Dt.prototype.createParentBoundables=function(t,e){C.isTrue(!t.isEmpty());var o=new St;o.add(this.createNode(e));var u=new St(t);Gt.sort(u,this.getComparator());for(var d=u.iterator();d.hasNext();){var w=d.next();this.lastNode(o).getChildBoundables().size()===this.getNodeCapacity()&&o.add(this.createNode(e)),this.lastNode(o).addChildBoundable(w)}return o},Dt.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},Dt.prototype.interfaces_=function(){return[n]},Dt.prototype.getClass=function(){return Dt},Dt.compareDoubles=function(t,e){return t>e?1:t0);for(var w=new St,S=0;S0;){var qt=zt.poll(),ne=qt.getDistance();if(ne>=_t)break;qt.isLeaves()?(_t=ne,wt=qt):qt.expandToQueue(zt,_t)}return[wt.getBoundable(0).getItem(),wt.getBoundable(1).getItem()]}}else if(arguments.length===3){var oe=arguments[0],In=arguments[1],xr=arguments[2],vi=new rt(oe,In),Zo=new te(this.getRoot(),vi,xr);return this.nearestNeighbour(Zo)[0]}},e.prototype.interfaces_=function(){return[Pt,n]},e.prototype.getClass=function(){return e},e.centreX=function(u){return e.avg(u.getMinX(),u.getMaxX())},e.avg=function(u,d){return(u+d)/2},e.centreY=function(u){return e.avg(u.getMinY(),u.getMaxY())},o.STRtreeNode.get=function(){return Si},o.serialVersionUID.get=function(){return 0x39920f7d5f261e0},o.xComparator.get=function(){return{interfaces_:function(){return[et]},compare:function(u,d){return t.compareDoubles(e.centreX(u.getBounds()),e.centreX(d.getBounds()))}}},o.yComparator.get=function(){return{interfaces_:function(){return[et]},compare:function(u,d){return t.compareDoubles(e.centreY(u.getBounds()),e.centreY(d.getBounds()))}}},o.intersectsOp.get=function(){return{interfaces_:function(){return[t.IntersectsOp]},intersects:function(u,d){return u.intersects(d)}}},o.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(e,o),e}(Dt),Si=function(t){function e(){var o=arguments[0];t.call(this,o)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.computeBounds=function(){for(var o=null,u=this.getChildBoundables().iterator();u.hasNext();){var d=u.next();o===null?o=new Bt(d.getBounds()):o.expandToInclude(d.getBounds())}return o},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(yt),jn=function(){};jn.prototype.interfaces_=function(){return[]},jn.prototype.getClass=function(){return jn},jn.relativeSign=function(t,e){return te?1:0},jn.compare=function(t,e,o){if(e.equals2D(o))return 0;var u=jn.relativeSign(e.x,o.x),d=jn.relativeSign(e.y,o.y);switch(t){case 0:return jn.compareValue(u,d);case 1:return jn.compareValue(d,u);case 2:return jn.compareValue(d,-u);case 3:return jn.compareValue(-u,d);case 4:return jn.compareValue(-u,-d);case 5:return jn.compareValue(-d,-u);case 6:return jn.compareValue(-d,u);case 7:return jn.compareValue(u,-d)}return C.shouldNeverReachHere("invalid octant value"),0},jn.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0};var no=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var t=arguments[0],e=arguments[1],o=arguments[2],u=arguments[3];this._segString=t,this.coord=new X(e),this.segmentIndex=o,this._segmentOctant=u,this._isInterior=!e.equals2D(t.getCoordinate(o))};no.prototype.getCoordinate=function(){return this.coord},no.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},no.prototype.compareTo=function(t){var e=t;return this.segmentIndexe.segmentIndex?1:this.coord.equals2D(e.coord)?0:jn.compare(this._segmentOctant,this.coord,e.coord)},no.prototype.isEndPoint=function(t){return this.segmentIndex===0&&!this._isInterior||this.segmentIndex===t},no.prototype.isInterior=function(){return this._isInterior},no.prototype.interfaces_=function(){return[H]},no.prototype.getClass=function(){return no};var lr=function(){this._nodeMap=new T,this._edge=null;var t=arguments[0];this._edge=t};lr.prototype.getSplitCoordinates=function(){var t=new Xn;this.addEndpoints();for(var e=this.iterator(),o=e.next();e.hasNext();){var u=e.next();this.addEdgeCoordinates(o,u,t),o=u}return t.toCoordinateArray()},lr.prototype.addCollapsedNodes=function(){var t=new St;this.findCollapsesFromInsertedNodes(t),this.findCollapsesFromExistingVertices(t);for(var e=t.iterator();e.hasNext();){var o=e.next().intValue();this.add(this._edge.getCoordinate(o),o)}},lr.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},lr.prototype.findCollapsesFromExistingVertices=function(t){for(var e=0;e=0?e>=0?o>=u?0:1:o>=u?7:6:e>=0?o>=u?3:2:o>=u?4:5}if(arguments[0]instanceof X&&arguments[1]instanceof X){var d=arguments[0],w=arguments[1],S=w.x-d.x,U=w.y-d.y;if(S===0&&U===0)throw new D("Cannot compute the octant for two identical points "+d);return ki.octant(S,U)}};var Gi=function(){};Gi.prototype.getCoordinates=function(){},Gi.prototype.size=function(){},Gi.prototype.getCoordinate=function(t){},Gi.prototype.isClosed=function(){},Gi.prototype.setData=function(t){},Gi.prototype.getData=function(){},Gi.prototype.interfaces_=function(){return[]},Gi.prototype.getClass=function(){return Gi};var Po=function(){};Po.prototype.addIntersection=function(t,e){},Po.prototype.interfaces_=function(){return[Gi]},Po.prototype.getClass=function(){return Po};var Zn=function(){this._nodeList=new lr(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};Zn.prototype.getCoordinates=function(){return this._pts},Zn.prototype.size=function(){return this._pts.length},Zn.prototype.getCoordinate=function(t){return this._pts[t]},Zn.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Zn.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))},Zn.prototype.setData=function(t){this._data=t},Zn.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:ki.octant(t,e)},Zn.prototype.getData=function(){return this._data},Zn.prototype.addIntersection=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(arguments.length===4){var o=arguments[0],u=arguments[1],d=arguments[3],w=new X(o.getIntersection(d));this.addIntersection(w,u)}},Zn.prototype.toString=function(){return Ht.toLineString(new le(this._pts))},Zn.prototype.getNodeList=function(){return this._nodeList},Zn.prototype.addIntersectionNode=function(t,e){var o=e,u=o+1;if(u=0&&o>=0||e<=0&&o<=0?Math.max(e,o):0}if(arguments[0]instanceof X){var u=arguments[0];return tt.orientationIndex(this.p0,this.p1,u)}},Yt.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])},Yt.prototype.isVertical=function(){return this.p0.x===this.p1.x},Yt.prototype.equals=function(t){if(!(t instanceof Yt))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)},Yt.prototype.intersection=function(t){var e=new F;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},Yt.prototype.project=function(){if(arguments[0]instanceof X){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new X(t);var e=this.projectionFactor(t),o=new X;return o.x=this.p0.x+e*(this.p1.x-this.p0.x),o.y=this.p0.y+e*(this.p1.y-this.p0.y),o}if(arguments[0]instanceof Yt){var u=arguments[0],d=this.projectionFactor(u.p0),w=this.projectionFactor(u.p1);if(d>=1&&w>=1||d<=0&&w<=0)return null;var S=this.project(u.p0);d<0&&(S=this.p0),d>1&&(S=this.p1);var U=this.project(u.p1);return w<0&&(U=this.p0),w>1&&(U=this.p1),new Yt(S,U)}},Yt.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},Yt.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},Yt.prototype.getCoordinate=function(t){return t===0?this.p0:this.p1},Yt.prototype.distancePerpendicular=function(t){return tt.distancePointLinePerpendicular(t,this.p0,this.p1)},Yt.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},Yt.prototype.midPoint=function(){return Yt.midPoint(this.p0,this.p1)},Yt.prototype.projectionFactor=function(t){if(t.equals(this.p0))return 0;if(t.equals(this.p1))return 1;var e=this.p1.x-this.p0.x,o=this.p1.y-this.p0.y,u=e*e+o*o;return u<=0?A.NaN:((t.x-this.p0.x)*e+(t.y-this.p0.y)*o)/u},Yt.prototype.closestPoints=function(t){var e=this.intersection(t);if(e!==null)return[e,e];var o=new Array(2).fill(null),u=A.MAX_VALUE,d=null,w=this.closestPoint(t.p0);u=w.distance(t.p0),o[0]=w,o[1]=t.p0;var S=this.closestPoint(t.p1);(d=S.distance(t.p1))0&&e<1?this.project(t):this.p0.distance(t)1||A.isNaN(e))&&(e=1),e},Yt.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},Yt.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},Yt.prototype.distance=function(){if(arguments[0]instanceof Yt){var t=arguments[0];return tt.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}if(arguments[0]instanceof X){var e=arguments[0];return tt.distancePointLine(e,this.p0,this.p1)}},Yt.prototype.pointAlong=function(t){var e=new X;return e.x=this.p0.x+t*(this.p1.x-this.p0.x),e.y=this.p0.y+t*(this.p1.y-this.p0.y),e},Yt.prototype.hashCode=function(){var t=A.doubleToLongBits(this.p0.x);t^=31*A.doubleToLongBits(this.p0.y);var e=Math.trunc(t)^Math.trunc(t>>32),o=A.doubleToLongBits(this.p1.x);return o^=31*A.doubleToLongBits(this.p1.y),e^(Math.trunc(o)^Math.trunc(o>>32))},Yt.prototype.interfaces_=function(){return[H,n]},Yt.prototype.getClass=function(){return Yt},Yt.midPoint=function(t,e){return new X((t.x+e.x)/2,(t.y+e.y)/2)},ua.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(Yt,ua);var ts=function(){this.tempEnv1=new Bt,this.tempEnv2=new Bt,this._overlapSeg1=new Yt,this._overlapSeg2=new Yt};ts.prototype.overlap=function(){if(arguments.length!==2){if(arguments.length===4){var t=arguments[0],e=arguments[1],o=arguments[2],u=arguments[3];t.getLineSegment(e,this._overlapSeg1),o.getLineSegment(u,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}}},ts.prototype.interfaces_=function(){return[]},ts.prototype.getClass=function(){return ts};var hr=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var t=arguments[0],e=arguments[1],o=arguments[2],u=arguments[3];this._pts=t,this._start=e,this._end=o,this._context=u};hr.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]},hr.prototype.computeSelect=function(t,e,o,u){var d=this._pts[e],w=this._pts[o];if(u.tempEnv1.init(d,w),o-e==1)return u.select(this,e),null;if(!t.intersects(u.tempEnv1))return null;var S=Math.trunc((e+o)/2);e=t.length-1)return t.length-1;for(var u=h.quadrant(t[o],t[o+1]),d=e+1;dw.getId()&&(w.computeOverlaps(U,u),this._nOverlaps++),this._segInt.isDone())return null}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},o.SegmentOverlapAction.get=function(){return la},Object.defineProperties(e,o),e}(Zs),la=function(t){function e(){t.call(this),this._si=null;var o=arguments[0];this._si=o}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.overlap=function(){if(arguments.length!==4)return t.prototype.overlap.apply(this,arguments);var o=arguments[0],u=arguments[1],d=arguments[2],w=arguments[3],S=o.getContext(),U=d.getContext();this._si.processIntersections(S,u,U,w)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ts),Be=function t(){if(this._quadrantSegments=t.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=t.CAP_ROUND,this._joinStyle=t.JOIN_ROUND,this._mitreLimit=t.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=t.DEFAULT_SIMPLIFY_FACTOR,arguments.length!==0){if(arguments.length===1){var e=arguments[0];this.setQuadrantSegments(e)}else if(arguments.length===2){var o=arguments[0],u=arguments[1];this.setQuadrantSegments(o),this.setEndCapStyle(u)}else if(arguments.length===4){var d=arguments[0],w=arguments[1],S=arguments[2],U=arguments[3];this.setQuadrantSegments(d),this.setEndCapStyle(w),this.setJoinStyle(S),this.setMitreLimit(U)}}},go={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}};Be.prototype.getEndCapStyle=function(){return this._endCapStyle},Be.prototype.isSingleSided=function(){return this._isSingleSided},Be.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,this._quadrantSegments===0&&(this._joinStyle=Be.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=Be.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==Be.JOIN_ROUND&&(this._quadrantSegments=Be.DEFAULT_QUADRANT_SEGMENTS)},Be.prototype.getJoinStyle=function(){return this._joinStyle},Be.prototype.setJoinStyle=function(t){this._joinStyle=t},Be.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t},Be.prototype.getSimplifyFactor=function(){return this._simplifyFactor},Be.prototype.getQuadrantSegments=function(){return this._quadrantSegments},Be.prototype.setEndCapStyle=function(t){this._endCapStyle=t},Be.prototype.getMitreLimit=function(){return this._mitreLimit},Be.prototype.setMitreLimit=function(t){this._mitreLimit=t},Be.prototype.setSingleSided=function(t){this._isSingleSided=t},Be.prototype.interfaces_=function(){return[]},Be.prototype.getClass=function(){return Be},Be.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},go.CAP_ROUND.get=function(){return 1},go.CAP_FLAT.get=function(){return 2},go.CAP_SQUARE.get=function(){return 3},go.JOIN_ROUND.get=function(){return 1},go.JOIN_MITRE.get=function(){return 2},go.JOIN_BEVEL.get=function(){return 3},go.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},go.DEFAULT_MITRE_LIMIT.get=function(){return 5},go.DEFAULT_SIMPLIFY_FACTOR.get=function(){return .01},Object.defineProperties(Be,go);var Yn=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=tt.COUNTERCLOCKWISE,this._inputLine=t||null},es={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};Yn.prototype.isDeletable=function(t,e,o,u){var d=this._inputLine[t],w=this._inputLine[e],S=this._inputLine[o];return!!this.isConcave(d,w,S)&&!!this.isShallow(d,w,S,u)&&this.isShallowSampled(d,w,t,o,u)},Yn.prototype.deleteShallowConcavities=function(){for(var t=1,e=this.findNextNonDeletedIndex(t),o=this.findNextNonDeletedIndex(e),u=!1;o=0;u--)this.addPt(t[u])},Lr.prototype.isRedundant=function(t){if(this._ptList.size()<1)return!1;var e=this._ptList.get(this._ptList.size()-1);return t.distance(e)Math.PI;)t-=_e.PI_TIMES_2;for(;t<=-Math.PI;)t+=_e.PI_TIMES_2;return t},_e.angle=function(){if(arguments.length===1){var t=arguments[0];return Math.atan2(t.y,t.x)}if(arguments.length===2){var e=arguments[0],o=arguments[1],u=o.x-e.x,d=o.y-e.y;return Math.atan2(d,u)}},_e.isAcute=function(t,e,o){var u=t.x-e.x,d=t.y-e.y;return u*(o.x-e.x)+d*(o.y-e.y)>0},_e.isObtuse=function(t,e,o){var u=t.x-e.x,d=t.y-e.y;return u*(o.x-e.x)+d*(o.y-e.y)<0},_e.interiorAngle=function(t,e,o){var u=_e.angle(e,t),d=_e.angle(e,o);return Math.abs(d-u)},_e.normalizePositive=function(t){if(t<0){for(;t<0;)t+=_e.PI_TIMES_2;t>=_e.PI_TIMES_2&&(t=0)}else{for(;t>=_e.PI_TIMES_2;)t-=_e.PI_TIMES_2;t<0&&(t=0)}return t},_e.angleBetween=function(t,e,o){var u=_e.angle(e,t),d=_e.angle(e,o);return _e.diff(u,d)},_e.diff=function(t,e){var o=null;return(o=tMath.PI&&(o=2*Math.PI-o),o},_e.toRadians=function(t){return t*Math.PI/180},_e.getTurn=function(t,e){var o=Math.sin(e-t);return o>0?_e.COUNTERCLOCKWISE:o<0?_e.CLOCKWISE:_e.NONE},_e.angleBetweenOriented=function(t,e,o){var u=_e.angle(e,t),d=_e.angle(e,o)-u;return d<=-Math.PI?d+_e.PI_TIMES_2:d>Math.PI?d-_e.PI_TIMES_2:d},Jr.PI_TIMES_2.get=function(){return 2*Math.PI},Jr.PI_OVER_2.get=function(){return Math.PI/2},Jr.PI_OVER_4.get=function(){return Math.PI/4},Jr.COUNTERCLOCKWISE.get=function(){return tt.COUNTERCLOCKWISE},Jr.CLOCKWISE.get=function(){return tt.CLOCKWISE},Jr.NONE.get=function(){return tt.COLLINEAR},Object.defineProperties(_e,Jr);var Bn=function t(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new Yt,this._seg1=new Yt,this._offset0=new Yt,this._offset1=new Yt,this._side=0,this._hasNarrowConcaveAngle=!1;var e=arguments[0],o=arguments[1],u=arguments[2];this._precisionModel=e,this._bufParams=o,this._li=new F,this._filletAngleQuantum=Math.PI/2/o.getQuadrantSegments(),o.getQuadrantSegments()>=8&&o.getJoinStyle()===Be.JOIN_ROUND&&(this._closingSegLengthFactor=t.MAX_CLOSING_SEG_LEN_FACTOR),this.init(u)},Os={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}};Bn.prototype.addNextSegment=function(t,e){if(this._s0=this._s1,this._s1=this._s2,this._s2=t,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var o=tt.computeOrientation(this._s0,this._s1,this._s2),u=o===tt.CLOCKWISE&&this._side===It.LEFT||o===tt.COUNTERCLOCKWISE&&this._side===It.RIGHT;o===0?this.addCollinear(e):u?this.addOutsideTurn(o,e):this.addInsideTurn(o,e)},Bn.prototype.addLineEndCap=function(t,e){var o=new Yt(t,e),u=new Yt;this.computeOffsetSegment(o,It.LEFT,this._distance,u);var d=new Yt;this.computeOffsetSegment(o,It.RIGHT,this._distance,d);var w=e.x-t.x,S=e.y-t.y,U=Math.atan2(S,w);switch(this._bufParams.getEndCapStyle()){case Be.CAP_ROUND:this._segList.addPt(u.p1),this.addFilletArc(e,U+Math.PI/2,U-Math.PI/2,tt.CLOCKWISE,this._distance),this._segList.addPt(d.p1);break;case Be.CAP_FLAT:this._segList.addPt(u.p1),this._segList.addPt(d.p1);break;case Be.CAP_SQUARE:var $=new X;$.x=Math.abs(this._distance)*Math.cos(U),$.y=Math.abs(this._distance)*Math.sin(U);var ut=new X(u.p1.x+$.x,u.p1.y+$.y),_t=new X(d.p1.x+$.x,d.p1.y+$.y);this._segList.addPt(ut),this._segList.addPt(_t)}},Bn.prototype.getCoordinates=function(){return this._segList.getCoordinates()},Bn.prototype.addMitreJoin=function(t,e,o,u){var d=!0,w=null;try{w=ke.intersection(e.p0,e.p1,o.p0,o.p1),(u<=0?1:w.distance(t)/Math.abs(u))>this._bufParams.getMitreLimit()&&(d=!1)}catch(S){if(!(S instanceof Cn))throw S;w=new X(0,0),d=!1}d?this._segList.addPt(w):this.addLimitedMitreJoin(e,o,u,this._bufParams.getMitreLimit())},Bn.prototype.addFilletCorner=function(t,e,o,u,d){var w=e.x-t.x,S=e.y-t.y,U=Math.atan2(S,w),$=o.x-t.x,ut=o.y-t.y,_t=Math.atan2(ut,$);u===tt.CLOCKWISE?U<=_t&&(U+=2*Math.PI):U>=_t&&(U-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,U,_t,u,d),this._segList.addPt(o)},Bn.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)0){var o=new X((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(o);var u=new X((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(u)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},Bn.prototype.createCircle=function(t){var e=new X(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},Bn.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)},Bn.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new Lr,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*Bn.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},Bn.prototype.addCollinear=function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===Be.JOIN_BEVEL||this._bufParams.getJoinStyle()===Be.JOIN_MITRE?(t&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,tt.CLOCKWISE,this._distance))},Bn.prototype.closeRing=function(){this._segList.closeRing()},Bn.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},Bn.prototype.interfaces_=function(){return[]},Bn.prototype.getClass=function(){return Bn},Os.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return .001},Os.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return .001},Os.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},Os.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(Bn,Os);var li=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e};li.prototype.getOffsetCurve=function(t,e){if(this._distance=e,e===0)return null;var o=e<0,u=Math.abs(e),d=this.getSegGen(u);t.length<=1?this.computePointCurve(t[0],d):this.computeOffsetCurve(t,o,d);var w=d.getCoordinates();return o&&re.reverse(w),w},li.prototype.computeSingleSidedBufferCurve=function(t,e,o){var u=this.simplifyTolerance(this._distance);if(e){o.addSegments(t,!0);var d=Yn.simplify(t,-u),w=d.length-1;o.initSideSegments(d[w],d[w-1],It.LEFT),o.addFirstSegment();for(var S=w-2;S>=0;S--)o.addNextSegment(d[S],!0)}else{o.addSegments(t,!1);var U=Yn.simplify(t,u),$=U.length-1;o.initSideSegments(U[0],U[1],It.LEFT),o.addFirstSegment();for(var ut=2;ut<=$;ut++)o.addNextSegment(U[ut],!0)}o.addLastSegment(),o.closeRing()},li.prototype.computeRingBufferCurve=function(t,e,o){var u=this.simplifyTolerance(this._distance);e===It.RIGHT&&(u=-u);var d=Yn.simplify(t,u),w=d.length-1;o.initSideSegments(d[w-1],d[0],e);for(var S=1;S<=w;S++){var U=S!==1;o.addNextSegment(d[S],U)}o.closeRing()},li.prototype.computeLineBufferCurve=function(t,e){var o=this.simplifyTolerance(this._distance),u=Yn.simplify(t,o),d=u.length-1;e.initSideSegments(u[0],u[1],It.LEFT);for(var w=2;w<=d;w++)e.addNextSegment(u[w],!0);e.addLastSegment(),e.addLineEndCap(u[d-1],u[d]);var S=Yn.simplify(t,-o),U=S.length-1;e.initSideSegments(S[U],S[U-1],It.LEFT);for(var $=U-2;$>=0;$--)e.addNextSegment(S[$],!0);e.addLastSegment(),e.addLineEndCap(S[1],S[0]),e.closeRing()},li.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case Be.CAP_ROUND:e.createCircle(t);break;case Be.CAP_SQUARE:e.createSquare(t)}},li.prototype.getLineCurve=function(t,e){if(this._distance=e,e<0&&!this._bufParams.isSingleSided()||e===0)return null;var o=Math.abs(e),u=this.getSegGen(o);if(t.length<=1)this.computePointCurve(t[0],u);else if(this._bufParams.isSingleSided()){var d=e<0;this.computeSingleSidedBufferCurve(t,d,u)}else this.computeLineBufferCurve(t,u);return u.getCoordinates()},li.prototype.getBufferParameters=function(){return this._bufParams},li.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()},li.prototype.getRingCurve=function(t,e,o){if(this._distance=o,t.length<=2)return this.getLineCurve(t,o);if(o===0)return li.copyCoordinates(t);var u=this.getSegGen(o);return this.computeRingBufferCurve(t,e,u),u.getCoordinates()},li.prototype.computeOffsetCurve=function(t,e,o){var u=this.simplifyTolerance(this._distance);if(e){var d=Yn.simplify(t,-u),w=d.length-1;o.initSideSegments(d[w],d[w-1],It.LEFT),o.addFirstSegment();for(var S=w-2;S>=0;S--)o.addNextSegment(d[S],!0)}else{var U=Yn.simplify(t,u),$=U.length-1;o.initSideSegments(U[0],U[1],It.LEFT),o.addFirstSegment();for(var ut=2;ut<=$;ut++)o.addNextSegment(U[ut],!0)}o.addLastSegment()},li.prototype.getSegGen=function(t){return new Bn(this._precisionModel,this._bufParams,t)},li.prototype.interfaces_=function(){return[]},li.prototype.getClass=function(){return li},li.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),o=0;od.getMaxY()||this.findStabbedSegments(t,u.getDirectedEdges(),e)}return e}if(arguments.length===3){if(ct(arguments[2],we)&&arguments[0]instanceof X&&arguments[1]instanceof E){for(var w=arguments[0],S=arguments[1],U=arguments[2],$=S.getEdge().getCoordinates(),ut=0;ut<$.length-1;ut++)if(this._seg.p0=$[ut],this._seg.p1=$[ut+1],this._seg.p0.y>this._seg.p1.y&&this._seg.reverse(),!(Math.max(this._seg.p0.x,this._seg.p1.x)this._seg.p1.y||tt.computeOrientation(this._seg.p0,this._seg.p1,w)===tt.RIGHT)){var _t=S.getDepth(It.LEFT);this._seg.p0.equals($[ut])||(_t=S.getDepth(It.RIGHT));var wt=new rs(this._seg,_t);U.add(wt)}}else if(ct(arguments[2],we)&&arguments[0]instanceof X&&ct(arguments[1],we))for(var zt=arguments[0],qt=arguments[1],ne=arguments[2],oe=qt.iterator();oe.hasNext();){var In=oe.next();In.isForward()&&this.findStabbedSegments(zt,In,ne)}}},ns.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);return e.size()===0?0:Gt.min(e)._leftDepth},ns.prototype.interfaces_=function(){return[]},ns.prototype.getClass=function(){return ns},Ya.DepthSegment.get=function(){return rs},Object.defineProperties(ns,Ya);var rs=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new Yt(t),this._leftDepth=e};rs.prototype.compareTo=function(t){var e=t;if(this._upwardSeg.minX()>=e._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=e._upwardSeg.minX())return-1;var o=this._upwardSeg.orientationIndex(e._upwardSeg);return o!==0||(o=-1*e._upwardSeg.orientationIndex(this._upwardSeg))!=0?o:this._upwardSeg.compareTo(e._upwardSeg)},rs.prototype.compareX=function(t,e){var o=t.p0.compareTo(e.p0);return o!==0?o:t.p1.compareTo(e.p1)},rs.prototype.toString=function(){return this._upwardSeg.toString()},rs.prototype.interfaces_=function(){return[H]},rs.prototype.getClass=function(){return rs};var Oe=function(t,e,o){this.p0=t||null,this.p1=e||null,this.p2=o||null};Oe.prototype.area=function(){return Oe.area(this.p0,this.p1,this.p2)},Oe.prototype.signedArea=function(){return Oe.signedArea(this.p0,this.p1,this.p2)},Oe.prototype.interpolateZ=function(t){if(t===null)throw new D("Supplied point is null.");return Oe.interpolateZ(t,this.p0,this.p1,this.p2)},Oe.prototype.longestSideLength=function(){return Oe.longestSideLength(this.p0,this.p1,this.p2)},Oe.prototype.isAcute=function(){return Oe.isAcute(this.p0,this.p1,this.p2)},Oe.prototype.circumcentre=function(){return Oe.circumcentre(this.p0,this.p1,this.p2)},Oe.prototype.area3D=function(){return Oe.area3D(this.p0,this.p1,this.p2)},Oe.prototype.centroid=function(){return Oe.centroid(this.p0,this.p1,this.p2)},Oe.prototype.inCentre=function(){return Oe.inCentre(this.p0,this.p1,this.p2)},Oe.prototype.interfaces_=function(){return[]},Oe.prototype.getClass=function(){return Oe},Oe.area=function(t,e,o){return Math.abs(((o.x-t.x)*(e.y-t.y)-(e.x-t.x)*(o.y-t.y))/2)},Oe.signedArea=function(t,e,o){return((o.x-t.x)*(e.y-t.y)-(e.x-t.x)*(o.y-t.y))/2},Oe.det=function(t,e,o,u){return t*u-e*o},Oe.interpolateZ=function(t,e,o,u){var d=e.x,w=e.y,S=o.x-d,U=u.x-d,$=o.y-w,ut=u.y-w,_t=S*ut-U*$,wt=t.x-d,zt=t.y-w,qt=(ut*wt-U*zt)/_t,ne=(-$*wt+S*zt)/_t;return e.z+qt*(o.z-e.z)+ne*(u.z-e.z)},Oe.longestSideLength=function(t,e,o){var u=t.distance(e),d=e.distance(o),w=o.distance(t),S=u;return d>S&&(S=d),w>S&&(S=w),S},Oe.isAcute=function(t,e,o){return!!_e.isAcute(t,e,o)&&!!_e.isAcute(e,o,t)&&!!_e.isAcute(o,t,e)},Oe.circumcentre=function(t,e,o){var u=o.x,d=o.y,w=t.x-u,S=t.y-d,U=e.x-u,$=e.y-d,ut=2*Oe.det(w,S,U,$),_t=Oe.det(S,w*w+S*S,$,U*U+$*$),wt=Oe.det(w,w*w+S*S,U,U*U+$*$);return new X(u-_t/ut,d+wt/ut)},Oe.perpendicularBisector=function(t,e){var o=e.x-t.x,u=e.y-t.y,d=new ke(t.x+o/2,t.y+u/2,1),w=new ke(t.x-u+o/2,t.y+o+u/2,1);return new ke(d,w)},Oe.angleBisector=function(t,e,o){var u=e.distance(t),d=u/(u+e.distance(o)),w=o.x-t.x,S=o.y-t.y;return new X(t.x+d*w,t.y+d*S)},Oe.area3D=function(t,e,o){var u=e.x-t.x,d=e.y-t.y,w=e.z-t.z,S=o.x-t.x,U=o.y-t.y,$=o.z-t.z,ut=d*$-w*U,_t=w*S-u*$,wt=u*U-d*S,zt=ut*ut+_t*_t+wt*wt,qt=Math.sqrt(zt)/2;return qt},Oe.centroid=function(t,e,o){var u=(t.x+e.x+o.x)/3,d=(t.y+e.y+o.y)/3;return new X(u,d)},Oe.inCentre=function(t,e,o){var u=e.distance(o),d=t.distance(o),w=t.distance(e),S=u+d+w,U=(u*t.x+d*e.x+w*o.x)/S,$=(u*t.y+d*e.y+w*o.y)/S;return new X(U,$)};var _i=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new St;var t=arguments[0],e=arguments[1],o=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=o};_i.prototype.addPoint=function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),o=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(o,Q.EXTERIOR,Q.INTERIOR)},_i.prototype.addPolygon=function(t){var e=this._distance,o=It.LEFT;this._distance<0&&(e=-this._distance,o=It.RIGHT);var u=t.getExteriorRing(),d=re.removeRepeatedPoints(u.getCoordinates());if(this._distance<0&&this.isErodedCompletely(u,this._distance)||this._distance<=0&&d.length<3)return null;this.addPolygonRing(d,e,o,Q.EXTERIOR,Q.INTERIOR);for(var w=0;w0&&this.isErodedCompletely(S,-this._distance)||this.addPolygonRing(U,e,It.opposite(o),Q.INTERIOR,Q.EXTERIOR)}},_i.prototype.isTriangleErodedCompletely=function(t,e){var o=new Oe(t[0],t[1],t[2]),u=o.inCentre();return tt.distancePointLine(u,o.p0,o.p1)=Nr.MINIMUM_VALID_SIZE&&tt.isCCW(t)&&(w=d,S=u,o=It.opposite(o));var U=this._curveBuilder.getRingCurve(t,o,e);this.addCurve(U,w,S)},_i.prototype.add=function(t){if(t.isEmpty())return null;t instanceof bn?this.addPolygon(t):t instanceof kn?this.addLineString(t):t instanceof pr?this.addPoint(t):t instanceof mi?this.addCollection(t):t instanceof ar?this.addCollection(t):t instanceof dr?this.addCollection(t):t instanceof wn&&this.addCollection(t)},_i.prototype.isErodedCompletely=function(t,e){var o=t.getCoordinates();if(o.length<4)return e<0;if(o.length===4)return this.isTriangleErodedCompletely(o,e);var u=t.getEnvelopeInternal(),d=Math.min(u.getHeight(),u.getWidth());return e<0&&2*Math.abs(e)>d},_i.prototype.addCollection=function(t){for(var e=0;e=this._max)throw new a;var t=this._parent.getGeometryN(this._index++);return t instanceof wn?(this._subcollectionIterator=new mo(t),this._subcollectionIterator.next()):t},mo.prototype.remove=function(){throw new Error(this.getClass().getName())},mo.prototype.hasNext=function(){if(this._atStart)return!0;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)},mo.prototype.interfaces_=function(){return[An]},mo.prototype.getClass=function(){return mo},mo.isAtomic=function(t){return!(t instanceof wn)};var yi=function(){this._geom=null;var t=arguments[0];this._geom=t};yi.prototype.locate=function(t){return yi.locate(t,this._geom)},yi.prototype.interfaces_=function(){return[Ns]},yi.prototype.getClass=function(){return yi},yi.isPointInRing=function(t,e){return!!e.getEnvelopeInternal().intersects(t)&&tt.isPointInRing(t,e.getCoordinates())},yi.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var o=e.getExteriorRing();if(!yi.isPointInRing(t,o))return!1;for(var u=0;u=0;d--){var w=this._edgeList.get(d),S=w.getSym();u===null&&(u=S),o!==null&&S.setNext(o),o=w}u.setNext(o)},e.prototype.computeDepths=function(){if(arguments.length===1){var o=arguments[0],u=this.findIndex(o),d=o.getDepth(It.LEFT),w=o.getDepth(It.RIGHT),S=this.computeDepths(u+1,this._edgeList.size(),d);if(this.computeDepths(0,u,S)!==w)throw new Qn("depth mismatch at "+o.getCoordinate())}else if(arguments.length===3){for(var U=arguments[0],$=arguments[1],ut=arguments[2],_t=U;_t<$;_t++){var wt=this._edgeList.get(_t);wt.setEdgeDepths(It.RIGHT,ut),ut=wt.getDepth(It.LEFT)}return ut}},e.prototype.mergeSymLabels=function(){for(var o=this.iterator();o.hasNext();){var u=o.next();u.getLabel().merge(u.getSym().getLabel())}},e.prototype.linkMinimalDirectedEdges=function(o){for(var u=null,d=null,w=this._SCANNING_FOR_INCOMING,S=this._resultAreaEdgeList.size()-1;S>=0;S--){var U=this._resultAreaEdgeList.get(S),$=U.getSym();switch(u===null&&U.getEdgeRing()===o&&(u=U),w){case this._SCANNING_FOR_INCOMING:if($.getEdgeRing()!==o)continue;d=$,w=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(U.getEdgeRing()!==o)continue;d.setNextMin(U),w=this._SCANNING_FOR_INCOMING}}w===this._LINKING_TO_OUTGOING&&(C.isTrue(u!==null,"found null for first outgoing dirEdge"),C.isTrue(u.getEdgeRing()===o,"unable to link last incoming dirEdge"),d.setNextMin(u))},e.prototype.getOutgoingDegree=function(){if(arguments.length===0){for(var o=0,u=this.iterator();u.hasNext();)u.next().isInResult()&&o++;return o}if(arguments.length===1){for(var d=arguments[0],w=0,S=this.iterator();S.hasNext();)S.next().getEdgeRing()===d&&w++;return w}},e.prototype.getLabel=function(){return this._label},e.prototype.findCoveredLineEdges=function(){for(var o=Q.NONE,u=this.iterator();u.hasNext();){var d=u.next(),w=d.getSym();if(!d.isLineEdge()){if(d.isInResult()){o=Q.INTERIOR;break}if(w.isInResult()){o=Q.EXTERIOR;break}}}if(o===Q.NONE)return null;for(var S=o,U=this.iterator();U.hasNext();){var $=U.next(),ut=$.getSym();$.isLineEdge()?$.getEdge().setCovered(S===Q.INTERIOR):($.isInResult()&&(S=Q.EXTERIOR),ut.isInResult()&&(S=Q.INTERIOR))}},e.prototype.computeLabelling=function(o){t.prototype.computeLabelling.call(this,o),this._label=new be(Q.NONE);for(var u=this.iterator();u.hasNext();)for(var d=u.next().getEdge().getLabel(),w=0;w<2;w++){var S=d.getLocation(w);S!==Q.INTERIOR&&S!==Q.BOUNDARY||this._label.setLocation(w,Q.INTERIOR)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Hr),ms=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createNode=function(o){return new Kr(o,new mo)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(I),Do=function t(){this._pts=null,this._orientation=null;var e=arguments[0];this._pts=e,this._orientation=t.orientation(e)};Do.prototype.compareTo=function(t){var e=t;return Do.compareOriented(this._pts,this._orientation,e._pts,e._orientation)},Do.prototype.interfaces_=function(){return[H]},Do.prototype.getClass=function(){return Do},Do.orientation=function(t){return re.increasingDirection(t)===1},Do.compareOriented=function(t,e,o,u){for(var d=e?1:-1,w=u?1:-1,S=e?t.length:-1,U=u?o.length:-1,$=e?0:t.length-1,ut=u?0:o.length-1;;){var _t=t[$].compareTo(o[ut]);if(_t!==0)return _t;var wt=($+=d)===S,zt=(ut+=w)===U;if(wt&&!zt)return-1;if(!wt&&zt)return 1;if(wt&&zt)return 0}};var br=function(){this._edges=new St,this._ocaMap=new T};br.prototype.print=function(t){t.print("MULTILINESTRING ( ");for(var e=0;e0&&t.print(","),t.print("(");for(var u=o.getCoordinates(),d=0;d0&&t.print(","),t.print(u[d].x+" "+u[d].y);t.println(")")}t.print(") ")},br.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next())},br.prototype.findEdgeIndex=function(t){for(var e=0;e0||!e.coord.equals2D(u);d||o--;var w=new Array(o).fill(null),S=0;w[S++]=new X(t.coord);for(var U=t.segmentIndex+1;U<=e.segmentIndex;U++)w[S++]=this.edge.pts[U];return d&&(w[S]=e.coord),new _s(w,new be(this.edge._label))},Ti.prototype.add=function(t,e,o){var u=new ro(t,e,o),d=this._nodeMap.get(u);return d!==null?d:(this._nodeMap.put(u,u),u)},Ti.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();)if(e.next().coord.equals(t))return!0;return!1},Ti.prototype.interfaces_=function(){return[]},Ti.prototype.getClass=function(){return Ti};var Bo=function(){};Bo.prototype.getChainStartIndices=function(t){var e=0,o=new St;o.add(new ft(e));do{var u=this.findChainEnd(t,e);o.add(new ft(u)),e=u}while(eo?e:o},Ki.prototype.getMinX=function(t){var e=this.pts[this.startIndex[t]].x,o=this.pts[this.startIndex[t+1]].x;return ee&&(u=1),this._depth[t][o]=u}}},Br.prototype.getDelta=function(t){return this._depth[t][It.RIGHT]-this._depth[t][It.LEFT]},Br.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?Q.EXTERIOR:Q.INTERIOR},Br.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},Br.prototype.add=function(){if(arguments.length===1)for(var t=arguments[0],e=0;e<2;e++)for(var o=1;o<3;o++){var u=t.getLocation(e,o);u!==Q.EXTERIOR&&u!==Q.INTERIOR||(this.isNull(e,o)?this._depth[e][o]=Br.depthAtLocation(u):this._depth[e][o]+=Br.depthAtLocation(u))}else if(arguments.length===3){var d=arguments[0],w=arguments[1];arguments[2]===Q.INTERIOR&&this._depth[d][w]++}},Br.prototype.interfaces_=function(){return[]},Br.prototype.getClass=function(){return Br},Br.depthAtLocation=function(t){return t===Q.EXTERIOR?0:t===Q.INTERIOR?1:Br.NULL_VALUE},Fo.NULL_VALUE.get=function(){return-1},Object.defineProperties(Br,Fo);var _s=function(t){function e(){if(t.call(this),this.pts=null,this._env=null,this.eiList=new Ti(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new Br,this._depthDelta=0,arguments.length===1){var o=arguments[0];e.call(this,o,null)}else if(arguments.length===2){var u=arguments[0],d=arguments[1];this.pts=u,this._label=d}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDepth=function(){return this._depth},e.prototype.getCollapsedEdge=function(){var o=new Array(2).fill(null);return o[0]=this.pts[0],o[1]=this.pts[1],new e(o,be.toLineLabel(this._label))},e.prototype.isIsolated=function(){return this._isIsolated},e.prototype.getCoordinates=function(){return this.pts},e.prototype.setIsolated=function(o){this._isIsolated=o},e.prototype.setName=function(o){this._name=o},e.prototype.equals=function(o){if(!(o instanceof e))return!1;var u=o;if(this.pts.length!==u.pts.length)return!1;for(var d=!0,w=!0,S=this.pts.length,U=0;U0?this.pts[0]:null;if(arguments.length===1){var o=arguments[0];return this.pts[o]}},e.prototype.print=function(o){o.print("edge "+this._name+": "),o.print("LINESTRING (");for(var u=0;u0&&o.print(","),o.print(this.pts[u].x+" "+this.pts[u].y);o.print(") "+this._label+" "+this._depthDelta)},e.prototype.computeIM=function(o){e.updateIM(this._label,o)},e.prototype.isCollapsed=function(){return!!this._label.isArea()&&this.pts.length===3&&!!this.pts[0].equals(this.pts[2])},e.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},e.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},e.prototype.getDepthDelta=function(){return this._depthDelta},e.prototype.getNumPoints=function(){return this.pts.length},e.prototype.printReverse=function(o){o.print("edge "+this._name+": ");for(var u=this.pts.length-1;u>=0;u--)o.print(this.pts[u]+" ");o.println("")},e.prototype.getMonotoneChainEdge=function(){return this._mce===null&&(this._mce=new Ki(this)),this._mce},e.prototype.getEnvelope=function(){if(this._env===null){this._env=new Bt;for(var o=0;o0&&o.append(","),o.append(this.pts[u].x+" "+this.pts[u].y);return o.append(") "+this._label+" "+this._depthDelta),o.toString()},e.prototype.isPointwiseEqual=function(o){if(this.pts.length!==o.pts.length)return!1;for(var u=0;uu||this._maxyw;if(S)return!1;var U=this.intersectsToleranceSquare(t,e);return C.isTrue(!(S&&U),"Found bad envelope test"),U},hi.prototype.initCorners=function(t){this._minx=t.x-.5,this._maxx=t.x+.5,this._miny=t.y-.5,this._maxy=t.y+.5,this._corner[0]=new X(this._maxx,this._maxy),this._corner[1]=new X(this._minx,this._maxy),this._corner[2]=new X(this._minx,this._miny),this._corner[3]=new X(this._maxx,this._miny)},hi.prototype.intersects=function(t,e){return this._scaleFactor===1?this.intersectsScaled(t,e):(this.copyScaled(t,this._p0Scaled),this.copyScaled(e,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},hi.prototype.scale=function(t){return Math.round(t*this._scaleFactor)},hi.prototype.getCoordinate=function(){return this._originalPt},hi.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},hi.prototype.getSafeEnvelope=function(){if(this._safeEnv===null){var t=hi.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new Bt(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv},hi.prototype.intersectsPixelClosure=function(t,e){return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),!!this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),!!this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),!!this._li.hasIntersection())))},hi.prototype.intersectsToleranceSquare=function(t,e){var o=!1,u=!1;return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!this._li.isProper()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),!!this._li.isProper()||(this._li.hasIntersection()&&(o=!0),this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),!!this._li.isProper()||(this._li.hasIntersection()&&(u=!0),this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),!!this._li.isProper()||!(!o||!u)||!!t.equals(this._pt)||!!e.equals(this._pt))))},hi.prototype.addSnappedNode=function(t,e){var o=t.getCoordinate(e),u=t.getCoordinate(e+1);return!!this.intersects(o,u)&&(t.addIntersection(this.getCoordinate(),e),!0)},hi.prototype.interfaces_=function(){return[]},hi.prototype.getClass=function(){return hi},ys.SAFE_ENV_EXPANSION_FACTOR.get=function(){return .75},Object.defineProperties(hi,ys);var Zs=function(){this.tempEnv1=new Bt,this.selectedSegment=new Yt};Zs.prototype.select=function(){if(arguments.length!==1){if(arguments.length===2){var t=arguments[0],e=arguments[1];t.getLineSegment(e,this.selectedSegment),this.select(this.selectedSegment)}}},Zs.prototype.interfaces_=function(){return[]},Zs.prototype.getClass=function(){return Zs};var qi=function(){this._index=null;var t=arguments[0];this._index=t},Ys={HotPixelSnapAction:{configurable:!0}};qi.prototype.snap=function(){if(arguments.length===1){var t=arguments[0];return this.snap(t,null,-1)}if(arguments.length===3){var e=arguments[0],o=arguments[1],u=arguments[2],d=e.getSafeEnvelope(),w=new Ya(e,o,u);return this._index.query(d,{interfaces_:function(){return[dt]},visitItem:function(S){S.select(d,w)}}),w.isNodeAdded()}},qi.prototype.interfaces_=function(){return[]},qi.prototype.getClass=function(){return qi},Ys.HotPixelSnapAction.get=function(){return Ya},Object.defineProperties(qi,Ys);var Ya=function(t){function e(){t.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var o=arguments[0],u=arguments[1],d=arguments[2];this._hotPixel=o,this._parentEdge=u,this._hotPixelVertexIndex=d}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isNodeAdded=function(){return this._isNodeAdded},e.prototype.select=function(){if(arguments.length!==2)return t.prototype.select.apply(this,arguments);var o=arguments[0],u=arguments[1],d=o.getContext();if(this._parentEdge!==null&&d===this._parentEdge&&u===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(d,u)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Zs),zo=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new St};zo.prototype.processIntersections=function(t,e,o,u){if(t===o&&e===u)return null;var d=t.getCoordinates()[e],w=t.getCoordinates()[e+1],S=o.getCoordinates()[u],U=o.getCoordinates()[u+1];if(this._li.computeIntersection(d,w,S,U),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var $=0;$=0;e--){try{t.bufferReducedPrecision(e)}catch(w){if(!(w instanceof Qn))throw w;t._saveException=w}if(t._resultGeometry!==null)return null}throw this._saveException}if(arguments.length===1){var o=arguments[0],u=mr.precisionScaleFactor(this._argGeom,this._distance,o),d=new Zt(u);this.bufferFixedPrecision(d)}},mr.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),this._resultGeometry!==null)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===Zt.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},mr.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)},mr.prototype.bufferOriginalPrecision=function(){try{var t=new $r(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(e){if(!(e instanceof ht))throw e;this._saveException=e}},mr.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry},mr.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)},mr.prototype.interfaces_=function(){return[]},mr.prototype.getClass=function(){return mr},mr.bufferOp=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];return new mr(t).getResultGeometry(e)}if(arguments.length===3){if(Number.isInteger(arguments[2])&&arguments[0]instanceof vt&&typeof arguments[1]=="number"){var o=arguments[0],u=arguments[1],d=arguments[2],w=new mr(o);return w.setQuadrantSegments(d),w.getResultGeometry(u)}if(arguments[2]instanceof Be&&arguments[0]instanceof vt&&typeof arguments[1]=="number"){var S=arguments[0],U=arguments[1],$=arguments[2];return new mr(S,$).getResultGeometry(U)}}else if(arguments.length===4){var ut=arguments[0],_t=arguments[1],wt=arguments[2],zt=arguments[3],qt=new mr(ut);return qt.setQuadrantSegments(wt),qt.setEndCapStyle(zt),qt.getResultGeometry(_t)}},mr.precisionScaleFactor=function(t,e,o){var u=t.getEnvelopeInternal(),d=bt.max(Math.abs(u.getMaxX()),Math.abs(u.getMaxY()),Math.abs(u.getMinX()),Math.abs(u.getMinY()))+2*(e>0?e:0),w=o-Math.trunc(Math.log(d)/Math.log(10)+1);return Math.pow(10,w)},Go.CAP_ROUND.get=function(){return Be.CAP_ROUND},Go.CAP_BUTT.get=function(){return Be.CAP_FLAT},Go.CAP_FLAT.get=function(){return Be.CAP_FLAT},Go.CAP_SQUARE.get=function(){return Be.CAP_SQUARE},Go.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(mr,Go);var cr=function(){this._pt=[new X,new X],this._distance=A.NaN,this._isNull=!0};cr.prototype.getCoordinates=function(){return this._pt},cr.prototype.getCoordinate=function(t){return this._pt[t]},cr.prototype.setMinimum=function(){if(arguments.length===1){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],o=arguments[1];if(this._isNull)return this.initialize(e,o),null;var u=e.distance(o);uthis._distance&&this.initialize(e,o,u)}},cr.prototype.interfaces_=function(){return[]},cr.prototype.getClass=function(){return cr};var ji=function(){};ji.prototype.interfaces_=function(){return[]},ji.prototype.getClass=function(){return ji},ji.computeDistance=function(){if(arguments[2]instanceof cr&&arguments[0]instanceof kn&&arguments[1]instanceof X)for(var t=arguments[0],e=arguments[1],o=arguments[2],u=t.getCoordinates(),d=new Yt,w=0;w0||this._isIn?Q.INTERIOR:Q.EXTERIOR)},Ji.prototype.interfaces_=function(){return[]},Ji.prototype.getClass=function(){return Ji};var Xr=function t(){if(this._component=null,this._segIndex=null,this._pt=null,arguments.length===2){var e=arguments[0],o=arguments[1];t.call(this,e,t.INSIDE_AREA,o)}else if(arguments.length===3){var u=arguments[0],d=arguments[1],w=arguments[2];this._component=u,this._segIndex=d,this._pt=w}},Fu={INSIDE_AREA:{configurable:!0}};Xr.prototype.isInsideArea=function(){return this._segIndex===Xr.INSIDE_AREA},Xr.prototype.getCoordinate=function(){return this._pt},Xr.prototype.getGeometryComponent=function(){return this._component},Xr.prototype.getSegmentIndex=function(){return this._segIndex},Xr.prototype.interfaces_=function(){return[]},Xr.prototype.getClass=function(){return Xr},Fu.INSIDE_AREA.get=function(){return-1},Object.defineProperties(Xr,Fu);var Qr=function(t){this._pts=t||null};Qr.prototype.filter=function(t){t instanceof pr&&this._pts.add(t)},Qr.prototype.interfaces_=function(){return[$n]},Qr.prototype.getClass=function(){return Qr},Qr.getPoints=function(){if(arguments.length===1){var t=arguments[0];return t instanceof pr?Gt.singletonList(t):Qr.getPoints(t,new St)}if(arguments.length===2){var e=arguments[0],o=arguments[1];return e instanceof pr?o.add(e):e instanceof wn&&e.apply(new Qr(o)),o}};var So=function(){this._locations=null;var t=arguments[0];this._locations=t};So.prototype.filter=function(t){(t instanceof pr||t instanceof kn||t instanceof bn)&&this._locations.add(new Xr(t,0,t.getCoordinate()))},So.prototype.interfaces_=function(){return[$n]},So.prototype.getClass=function(){return So},So.getLocations=function(t){var e=new St;return t.apply(new So(e)),e};var Fr=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new Ji,this._minDistanceLocation=null,this._minDistance=A.MAX_VALUE,arguments.length===2){var t=arguments[0],e=arguments[1];this._geom=[t,e],this._terminateDistance=0}else if(arguments.length===3){var o=arguments[0],u=arguments[1],d=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=o,this._geom[1]=u,this._terminateDistance=d}};Fr.prototype.computeContainmentDistance=function(){if(arguments.length===0){var t=new Array(2).fill(null);if(this.computeContainmentDistance(0,t),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,t)}else if(arguments.length===2){var e=arguments[0],o=arguments[1],u=1-e,d=Co.getPolygons(this._geom[e]);if(d.size()>0){var w=So.getLocations(this._geom[u]);if(this.computeContainmentDistance(w,d,o),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[u]=o[0],this._minDistanceLocation[e]=o[1],null}}else if(arguments.length===3){if(arguments[2]instanceof Array&&ct(arguments[0],we)&&ct(arguments[1],we)){for(var S=arguments[0],U=arguments[1],$=arguments[2],ut=0;utthis._minDistance)return null;for(var u=t.getCoordinates(),d=e.getCoordinate(),w=0;wthis._minDistance)return null;for(var wt=$.getCoordinates(),zt=ut.getCoordinates(),qt=0;qtthis._distance&&this.initialize(e,o,u)}},_r.prototype.interfaces_=function(){return[]},_r.prototype.getClass=function(){return _r};var so=function(){};so.prototype.interfaces_=function(){return[]},so.prototype.getClass=function(){return so},so.computeDistance=function(){if(arguments[2]instanceof _r&&arguments[0]instanceof kn&&arguments[1]instanceof X)for(var t=arguments[0],e=arguments[1],o=arguments[2],u=new Yt,d=t.getCoordinates(),w=0;w1||t<=0)throw new D("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},Ii.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},Ii.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},Ii.prototype.computeOrientedDistance=function(t,e,o){var u=new yo(e);if(t.apply(u),o.setMaximum(u.getMaxPointDistance()),this._densifyFrac>0){var d=new qo(e,this._densifyFrac);t.apply(d),o.setMaximum(d.getMaxPointDistance())}},Ii.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},Ii.prototype.interfaces_=function(){return[]},Ii.prototype.getClass=function(){return Ii},Ii.distance=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];return new Ii(t,e).distance()}if(arguments.length===3){var o=arguments[0],u=arguments[1],d=arguments[2],w=new Ii(o,u);return w.setDensifyFraction(d),w.distance()}},Va.MaxPointDistanceFilter.get=function(){return yo},Va.MaxDensifiedByFractionDistanceFilter.get=function(){return qo},Object.defineProperties(Ii,Va);var yo=function(){this._maxPtDist=new _r,this._minPtDist=new _r,this._euclideanDist=new so,this._geom=null;var t=arguments[0];this._geom=t};yo.prototype.filter=function(t){this._minPtDist.initialize(),so.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},yo.prototype.getMaxPointDistance=function(){return this._maxPtDist},yo.prototype.interfaces_=function(){return[Jt]},yo.prototype.getClass=function(){return yo};var qo=function(){this._maxPtDist=new _r,this._minPtDist=new _r,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))};qo.prototype.filter=function(t,e){if(e===0)return null;for(var o=t.getCoordinate(e-1),u=t.getCoordinate(e),d=(u.x-o.x)/this._numSubSegs,w=(u.y-o.y)/this._numSubSegs,S=0;So){this._isValid=!1;var d=u.getCoordinates();this._errorLocation=d[1],this._errorIndicator=t.getFactory().createLineString(d),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+Ht.toLineString(d[0],d[1])+")"}},Mr.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=Mr.MAX_DISTANCE_DIFF_FRAC*t;return this._minValidDistance=t-e,this._maxValidDistance=t+e,!(!this._input.isEmpty()&&!this._result.isEmpty())||(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),Mr.VERBOSE&&fe.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},Mr.prototype.checkNegativeValid=function(){if(!(this._input instanceof bn||this._input instanceof dr||this._input instanceof wn))return null;var t=this.getPolygonLines(this._input);if(this.checkMinimumDistance(t,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(t,this._result,this._maxValidDistance)},Mr.prototype.getErrorIndicator=function(){return this._errorIndicator},Mr.prototype.checkMinimumDistance=function(t,e,o){var u=new Fr(t,e,o);if(this._minDistanceFound=u.distance(),this._minDistanceFound0&&t>e&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&t=2||this._distance>0?null:(this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),void this.report("ExpectedEmpty"))},Pr.prototype.report=function(t){if(!Pr.VERBOSE)return null;fe.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))},Pr.prototype.getErrorMessage=function(){return this._errorMsg},Pr.prototype.interfaces_=function(){return[]},Pr.prototype.getClass=function(){return Pr},Pr.isValidMsg=function(t,e,o){var u=new Pr(t,e,o);return u.isValid()?null:u.getErrorMessage()},Pr.isValid=function(t,e,o){return!!new Pr(t,e,o).isValid()},Wa.VERBOSE.get=function(){return!1},Wa.MAX_ENV_DIFF_FRAC.get=function(){return .012},Object.defineProperties(Pr,Wa);var zr=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};zr.prototype.getCoordinates=function(){return this._pts},zr.prototype.size=function(){return this._pts.length},zr.prototype.getCoordinate=function(t){return this._pts[t]},zr.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},zr.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:ki.octant(this.getCoordinate(t),this.getCoordinate(t+1))},zr.prototype.setData=function(t){this._data=t},zr.prototype.getData=function(){return this._data},zr.prototype.toString=function(){return Ht.toLineString(new le(this._pts))},zr.prototype.interfaces_=function(){return[Gi]},zr.prototype.getClass=function(){return zr};var yr=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new St,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null};yr.prototype.getInteriorIntersection=function(){return this._interiorIntersection},yr.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t},yr.prototype.getIntersectionSegments=function(){return this._intSegments},yr.prototype.count=function(){return this._intersectionCount},yr.prototype.getIntersections=function(){return this._intersections},yr.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},yr.prototype.setKeepIntersections=function(t){this._keepIntersections=t},yr.prototype.processIntersections=function(t,e,o,u){if(!this._findAllIntersections&&this.hasIntersection()||t===o&&e===u||this._isCheckEndSegmentsOnly&&!(this.isEndSegment(t,e)||this.isEndSegment(o,u)))return null;var d=t.getCoordinates()[e],w=t.getCoordinates()[e+1],S=o.getCoordinates()[u],U=o.getCoordinates()[u+1];this._li.computeIntersection(d,w,S,U),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=d,this._intSegments[1]=w,this._intSegments[2]=S,this._intSegments[3]=U,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},yr.prototype.isEndSegment=function(t,e){return e===0||e>=t.size()-2},yr.prototype.hasIntersection=function(){return this._interiorIntersection!==null},yr.prototype.isDone=function(){return!this._findAllIntersections&&this._interiorIntersection!==null},yr.prototype.interfaces_=function(){return[rs]},yr.prototype.getClass=function(){return yr},yr.createAllIntersectionsFinder=function(t){var e=new yr(t);return e.setFindAllIntersections(!0),e},yr.createAnyIntersectionFinder=function(t){return new yr(t)},yr.createIntersectionCounter=function(t){var e=new yr(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var Hi=function(){this._li=new F,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};Hi.prototype.execute=function(){if(this._segInt!==null)return null;this.checkInteriorIntersections()},Hi.prototype.getIntersections=function(){return this._segInt.getIntersections()},Hi.prototype.isValid=function(){return this.execute(),this._isValid},Hi.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},Hi.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new yr(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new Xa;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},Hi.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Qn(this.getErrorMessage(),this._segInt.getInteriorIntersection())},Hi.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+Ht.toLineString(t[0],t[1])+" and "+Ht.toLineString(t[2],t[3])},Hi.prototype.interfaces_=function(){return[]},Hi.prototype.getClass=function(){return Hi},Hi.computeIntersections=function(t){var e=new Hi(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var ao=function t(){this._nv=null;var e=arguments[0];this._nv=new Hi(t.toSegmentStrings(e))};ao.prototype.checkValid=function(){this._nv.checkValid()},ao.prototype.interfaces_=function(){return[]},ao.prototype.getClass=function(){return ao},ao.toSegmentStrings=function(t){for(var e=new St,o=t.iterator();o.hasNext();){var u=o.next();e.add(new zr(u.getCoordinates(),u))}return e},ao.checkValid=function(t){new ao(t).checkValid()};var xs=function(t){this._mapOp=t};xs.prototype.map=function(t){for(var e=new St,o=0;o0&&u<4&&!this._preserveType?this._factory.createLineString(o):this._factory.createLinearRing(o)},ti.prototype.interfaces_=function(){return[]},ti.prototype.getClass=function(){return ti};var uo=function t(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new Yt,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof kn&&typeof arguments[1]=="number"){var e=arguments[0],o=arguments[1];t.call(this,e.getCoordinates(),o)}else if(arguments[0]instanceof Array&&typeof arguments[1]=="number"){var u=arguments[0],d=arguments[1];this._srcPts=u,this._isClosed=t.isClosed(u),this._snapTolerance=d}};uo.prototype.snapVertices=function(t,e){for(var o=this._isClosed?t.size()-1:t.size(),u=0;u=0&&t.add(w+1,new X(d),!1)}},uo.prototype.findSegmentIndexToSnap=function(t,e){for(var o=A.MAX_VALUE,u=-1,d=0;de&&(e=u)}return e}if(arguments.length===2){var d=arguments[0],w=arguments[1];return Math.min(er.computeOverlaySnapTolerance(d),er.computeOverlaySnapTolerance(w))}},er.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal();return Math.min(e.getHeight(),e.getWidth())*er.SNAP_PRECISION_FACTOR},er.snapToSelf=function(t,e,o){return new er(t).snapToSelf(e,o)},Ka.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(er,Ka);var Ja=function(t){function e(o,u,d){t.call(this),this._snapTolerance=o||null,this._snapPts=u||null,this._isSelfSnap=d!==void 0&&d}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.snapLine=function(o,u){var d=new uo(o,this._snapTolerance);return d.setAllowSnappingToSourceVertices(this._isSelfSnap),d.snapTo(u)},e.prototype.transformCoordinates=function(o,u){var d=o.toCoordinateArray(),w=this.snapLine(d,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(w)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ti),Zr=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};Zr.prototype.getCommon=function(){return A.longBitsToDouble(this._commonBits)},Zr.prototype.add=function(t){var e=A.doubleToLongBits(t);if(this._isFirst)return this._commonBits=e,this._commonSignExp=Zr.signExpBits(this._commonBits),this._isFirst=!1,null;if(Zr.signExpBits(e)!==this._commonSignExp)return this._commonBits=0,null;this._commonMantissaBitsCount=Zr.numCommonMostSigMantissaBits(this._commonBits,e),this._commonBits=Zr.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))},Zr.prototype.toString=function(){if(arguments.length===1){var t=arguments[0],e=A.longBitsToDouble(t),o="0000000000000000000000000000000000000000000000000000000000000000"+A.toBinaryString(t),u=o.substring(o.length-64);return u.substring(0,1)+" "+u.substring(1,12)+"(exp) "+u.substring(12)+" [ "+e+" ]"}},Zr.prototype.interfaces_=function(){return[]},Zr.prototype.getClass=function(){return Zr},Zr.getBit=function(t,e){return t&1<>52},Zr.zeroLowerBits=function(t,e){return t&~((1<=0;u--){if(Zr.getBit(t,u)!==Zr.getBit(e,u))return o;o++}return 52};var ko=function(){this._commonCoord=null,this._ccFilter=new ws},ca={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};ko.prototype.addCommonBits=function(t){var e=new To(this._commonCoord);t.apply(e),t.geometryChanged()},ko.prototype.removeCommonBits=function(t){if(this._commonCoord.x===0&&this._commonCoord.y===0)return t;var e=new X(this._commonCoord);e.x=-e.x,e.y=-e.y;var o=new To(e);return t.apply(o),t.geometryChanged(),t},ko.prototype.getCommonCoordinate=function(){return this._commonCoord},ko.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},ko.prototype.interfaces_=function(){return[]},ko.prototype.getClass=function(){return ko},ca.CommonCoordinateFilter.get=function(){return ws},ca.Translater.get=function(){return To},Object.defineProperties(ko,ca);var ws=function(){this._commonBitsX=new Zr,this._commonBitsY=new Zr};ws.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)},ws.prototype.getCommonCoordinate=function(){return new X(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},ws.prototype.interfaces_=function(){return[Jt]},ws.prototype.getClass=function(){return ws};var To=function(){this.trans=null;var t=arguments[0];this.trans=t};To.prototype.filter=function(t,e){var o=t.getOrdinate(e,0)+this.trans.x,u=t.getOrdinate(e,1)+this.trans.y;t.setOrdinate(e,0,o),t.setOrdinate(e,1,u)},To.prototype.isDone=function(){return!1},To.prototype.isGeometryChanged=function(){return!0},To.prototype.interfaces_=function(){return[jr]},To.prototype.getClass=function(){return To};var vr=function(t,e){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=t,this._geom[1]=e,this.computeSnapTolerance()};vr.prototype.selfSnap=function(t){return new er(t).snapTo(t,this._snapTolerance)},vr.prototype.removeCommonBits=function(t){this._cbr=new ko,this._cbr.add(t[0]),this._cbr.add(t[1]);var e=new Array(2).fill(null);return e[0]=this._cbr.removeCommonBits(t[0].copy()),e[1]=this._cbr.removeCommonBits(t[1].copy()),e},vr.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t},vr.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),o=de.overlayOp(e[0],e[1],t);return this.prepareResult(o)},vr.prototype.checkValid=function(t){t.isValid()||fe.out.println("Snapped geometry is invalid")},vr.prototype.computeSnapTolerance=function(){this._snapTolerance=er.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},vr.prototype.snap=function(t){var e=this.removeCommonBits(t);return er.snap(e[0],e[1],this._snapTolerance)},vr.prototype.interfaces_=function(){return[]},vr.prototype.getClass=function(){return vr},vr.overlayOp=function(t,e,o){return new vr(t,e).getResultGeometry(o)},vr.union=function(t,e){return vr.overlayOp(t,e,de.UNION)},vr.intersection=function(t,e){return vr.overlayOp(t,e,de.INTERSECTION)},vr.symDifference=function(t,e){return vr.overlayOp(t,e,de.SYMDIFFERENCE)},vr.difference=function(t,e){return vr.overlayOp(t,e,de.DIFFERENCE)};var ei=function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e};ei.prototype.getResultGeometry=function(t){var e=null,o=!1,u=null;try{e=de.overlayOp(this._geom[0],this._geom[1],t),o=!0}catch(d){if(!(d instanceof ht))throw d;u=d}if(!o)try{e=vr.overlayOp(this._geom[0],this._geom[1],t)}catch(d){throw d instanceof ht?u:d}return e},ei.prototype.interfaces_=function(){return[]},ei.prototype.getClass=function(){return ei},ei.overlayOp=function(t,e,o){return new ei(t,e).getResultGeometry(o)},ei.union=function(t,e){return ei.overlayOp(t,e,de.UNION)},ei.intersection=function(t,e){return ei.overlayOp(t,e,de.INTERSECTION)},ei.symDifference=function(t,e){return ei.overlayOp(t,e,de.SYMDIFFERENCE)},ei.difference=function(t,e){return ei.overlayOp(t,e,de.DIFFERENCE)};var i=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};i.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i};var f=function t(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,arguments.length===2){var e=arguments[0],o=arguments[1];this._eventType=t.DELETE,this._xValue=e,this._insertEvent=o}else if(arguments.length===3){var u=arguments[0],d=arguments[1],w=arguments[2];this._eventType=t.INSERT,this._label=u,this._xValue=d,this._obj=w}},y={INSERT:{configurable:!0},DELETE:{configurable:!0}};f.prototype.isDelete=function(){return this._eventType===f.DELETE},f.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t},f.prototype.getObject=function(){return this._obj},f.prototype.compareTo=function(t){var e=t;return this._xValuee._xValue?1:this._eventTypee._eventType?1:0},f.prototype.getInsertEvent=function(){return this._insertEvent},f.prototype.isInsert=function(){return this._eventType===f.INSERT},f.prototype.isSameLabel=function(t){return this._label!==null&&this._label===t._label},f.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},f.prototype.interfaces_=function(){return[H]},f.prototype.getClass=function(){return f},y.INSERT.get=function(){return 1},y.DELETE.get=function(){return 2},Object.defineProperties(f,y);var M=function(){};M.prototype.interfaces_=function(){return[]},M.prototype.getClass=function(){return M};var O=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var t=arguments[0],e=arguments[1],o=arguments[2];this._li=t,this._includeProper=e,this._recordIsolated=o};O.prototype.isTrivialIntersection=function(t,e,o,u){if(t===o&&this._li.getIntersectionNum()===1){if(O.isAdjacentSegments(e,u))return!0;if(t.isClosed()){var d=t.getNumPoints()-1;if(e===0&&u===d||u===0&&e===d)return!0}}return!1},O.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},O.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},O.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},O.prototype.isBoundaryPointInternal=function(t,e){for(var o=e.iterator();o.hasNext();){var u=o.next().getCoordinate();if(t.isIntersection(u))return!0}return!1},O.prototype.hasProperIntersection=function(){return this._hasProper},O.prototype.hasIntersection=function(){return this._hasIntersection},O.prototype.isDone=function(){return this._isDone},O.prototype.isBoundaryPoint=function(t,e){return e!==null&&(!!this.isBoundaryPointInternal(t,e[0])||!!this.isBoundaryPointInternal(t,e[1]))},O.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},O.prototype.addIntersections=function(t,e,o,u){if(t===o&&e===u)return null;this.numTests++;var d=t.getCoordinates()[e],w=t.getCoordinates()[e+1],S=o.getCoordinates()[u],U=o.getCoordinates()[u+1];this._li.computeIntersection(d,w,S,U),this._li.hasIntersection()&&(this._recordIsolated&&(t.setIsolated(!1),o.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(t,e,o,u)||(this._hasIntersection=!0,!this._includeProper&&this._li.isProper()||(t.addIntersections(this._li,e,0),o.addIntersections(this._li,u,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))},O.prototype.interfaces_=function(){return[]},O.prototype.getClass=function(){return O},O.isAdjacentSegments=function(t,e){return Math.abs(t-e)===1};var W=function(t){function e(){t.call(this),this.events=new St,this.nOverlaps=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.prepareEvents=function(){Gt.sort(this.events);for(var o=0;oe||this._maxw?1:0},xt.prototype.interfaces_=function(){return[et]},xt.prototype.getClass=function(){return xt};var Nt=function(t){function e(){t.call(this),this._item=null;var o=arguments[0],u=arguments[1],d=arguments[2];this._min=o,this._max=u,this._item=d}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.query=function(o,u,d){if(!this.intersects(o,u))return null;d.visitItem(this._item)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(at),ee=function(t){function e(){t.call(this),this._node1=null,this._node2=null;var o=arguments[0],u=arguments[1];this._node1=o,this._node2=u,this.buildExtent(this._node1,this._node2)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.buildExtent=function(o,u){this._min=Math.min(o._min,u._min),this._max=Math.max(o._max,u._max)},e.prototype.query=function(o,u,d){if(!this.intersects(o,u))return null;this._node1!==null&&this._node1.query(o,u,d),this._node2!==null&&this._node2.query(o,u,d)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(at),ae=function(){this._leaves=new St,this._root=null,this._level=0};ae.prototype.buildTree=function(){Gt.sort(this._leaves,new at.NodeComparator);for(var t=this._leaves,e=null,o=new St;;){if(this.buildLevel(t,o),o.size()===1)return o.get(0);e=t,t=o,o=e}},ae.prototype.insert=function(t,e,o){if(this._root!==null)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new Nt(t,e,o))},ae.prototype.query=function(t,e,o){this.init(),this._root.query(t,e,o)},ae.prototype.buildRoot=function(){if(this._root!==null)return null;this._root=this.buildTree()},ae.prototype.printNode=function(t){fe.out.println(Ht.toLineString(new X(t._min,this._level),new X(t._max,this._level)))},ae.prototype.init=function(){if(this._root!==null)return null;this.buildRoot()},ae.prototype.buildLevel=function(t,e){this._level++,e.clear();for(var o=0;o=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,u[0]),this.insertBoundaryPoint(this._argIndex,u[u.length-1])},e.prototype.getInvalidPoint=function(){return this._invalidPoint},e.prototype.getBoundaryPoints=function(){for(var o=this.getBoundaryNodes(),u=new Array(o.size()).fill(null),d=0,w=o.iterator();w.hasNext();){var S=w.next();u[d++]=S.getCoordinate().copy()}return u},e.prototype.getBoundaryNodes=function(){return this._boundaryNodes===null&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},e.prototype.addSelfIntersectionNode=function(o,u,d){if(this.isBoundaryNode(o,u))return null;d===Q.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(o,u):this.insertPoint(o,u,d)},e.prototype.addPolygonRing=function(o,u,d){if(o.isEmpty())return null;var w=re.removeRepeatedPoints(o.getCoordinates());if(w.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=w[0],null;var S=u,U=d;tt.isCCW(w)&&(S=d,U=u);var $=new _s(w,new be(this._argIndex,Q.BOUNDARY,S,U));this._lineEdgeMap.put(o,$),this.insertEdge($),this.insertPoint(this._argIndex,w[0],Q.BOUNDARY)},e.prototype.insertPoint=function(o,u,d){var w=this._nodes.addNode(u),S=w.getLabel();S===null?w._label=new be(o,d):S.setLocation(o,d)},e.prototype.createEdgeSetIntersector=function(){return new W},e.prototype.addSelfIntersectionNodes=function(o){for(var u=this._edges.iterator();u.hasNext();)for(var d=u.next(),w=d.getLabel().getLocation(o),S=d.eiList.iterator();S.hasNext();){var U=S.next();this.addSelfIntersectionNode(o,U.coord,w)}},e.prototype.add=function(){if(arguments.length!==1)return t.prototype.add.apply(this,arguments);var o=arguments[0];if(o.isEmpty())return null;if(o instanceof dr&&(this._useBoundaryDeterminationRule=!1),o instanceof bn)this.addPolygon(o);else if(o instanceof kn)this.addLineString(o);else if(o instanceof pr)this.addPoint(o);else if(o instanceof mi)this.addCollection(o);else if(o instanceof ar)this.addCollection(o);else if(o instanceof dr)this.addCollection(o);else{if(!(o instanceof wn))throw new Error(o.getClass().getName());this.addCollection(o)}},e.prototype.addCollection=function(o){for(var u=0;u50?(this._areaPtLocator===null&&(this._areaPtLocator=new ci(this._parentGeom)),this._areaPtLocator.locate(o)):this._ptLocator.locate(o,this._parentGeom)},e.prototype.findEdge=function(){if(arguments.length===1){var o=arguments[0];return this._lineEdgeMap.get(o)}return t.prototype.findEdge.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.determineBoundary=function(o,u){return o.isInBoundary(u)?Q.BOUNDARY:Q.INTERIOR},e}(V),Ns=function(){if(this._li=new F,this._resultPrecisionModel=null,this._arg=null,arguments.length===1){var t=arguments[0];this.setComputationPrecision(t.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new Ls(0,t)}else if(arguments.length===2){var e=arguments[0],o=arguments[1],u=$t.OGC_SFS_BOUNDARY_RULE;e.getPrecisionModel().compareTo(o.getPrecisionModel())>=0?this.setComputationPrecision(e.getPrecisionModel()):this.setComputationPrecision(o.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Ls(0,e,u),this._arg[1]=new Ls(1,o,u)}else if(arguments.length===3){var d=arguments[0],w=arguments[1],S=arguments[2];d.getPrecisionModel().compareTo(w.getPrecisionModel())>=0?this.setComputationPrecision(d.getPrecisionModel()):this.setComputationPrecision(w.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Ls(0,d,S),this._arg[1]=new Ls(1,w,S)}};Ns.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()},Ns.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},Ns.prototype.interfaces_=function(){return[]},Ns.prototype.getClass=function(){return Ns};var is=function(){};is.prototype.interfaces_=function(){return[]},is.prototype.getClass=function(){return is},is.map=function(){if(arguments[0]instanceof vt&&ct(arguments[1],is.MapOp)){for(var t=arguments[0],e=arguments[1],o=new St,u=0;u=t.size()?null:t.get(e)},ir.union=function(t){return new ir(t).union()},zu.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(ir,zu);var bs=function(){};bs.prototype.interfaces_=function(){return[]},bs.prototype.getClass=function(){return bs},bs.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return de.createEmptyResult(de.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),ei.overlayOp(t,e,de.UNION)},r.GeoJSONReader=ai,r.GeoJSONWriter=Vi,r.OverlayOp=de,r.UnionOp=bs,r.BufferOp=mr,Object.defineProperty(r,"__esModule",{value:!0})})});var Ql=se((ff,pf)=>{(function(r,n){typeof ff=="object"&&typeof pf<"u"?pf.exports=n():typeof define=="function"&&define.amd?define(n):(r=typeof globalThis<"u"?globalThis:r||self,r.DOMPurify=n())})(ff,function(){"use strict";let{entries:r,setPrototypeOf:n,isFrozen:s,getPrototypeOf:a,getOwnPropertyDescriptor:l}=Object,{freeze:c,seal:g,create:m}=Object,{apply:v,construct:x}=typeof Reflect<"u"&&Reflect;v||(v=function(Ht,ht,Y){return Ht.apply(ht,Y)}),c||(c=function(Ht){return Ht}),g||(g=function(Ht){return Ht}),x||(x=function(Ht,ht){return new Ht(...ht)});let P=H(Array.prototype.forEach),T=H(Array.prototype.pop),N=H(Array.prototype.push),q=H(String.prototype.toLowerCase),z=H(String.prototype.toString),j=H(String.prototype.match),R=H(String.prototype.replace),B=H(String.prototype.indexOf),D=H(String.prototype.trim),A=H(RegExp.prototype.test),G=K(TypeError);function H(ue){return function(Ht){for(var ht=arguments.length,Y=new Array(ht>1?ht-1:0),C=1;C/gm),Qt=g(/\${[\w\W]*}/gm),Tt=g(/^data-[\-\w.\u00B7-\uFFFF]/),ce=g(/^aria-[\-\w]+$/),Re=g(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Cn=g(/^(?:\w+script|data):/i),fe=g(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ke=g(/^html$/i);var Bt=Object.freeze({__proto__:null,MUSTACHE_EXPR:Rt,ERB_EXPR:Ot,TMPLIT_EXPR:Qt,DATA_ATTR:Tt,ARIA_ATTR:ce,IS_ALLOWED_URI:Re,IS_SCRIPT_OR_DATA:Cn,ATTR_WHITESPACE:fe,DOCTYPE_NAME:ke});let hn=()=>typeof window>"u"?null:window,Sn=function(Ht,ht){if(typeof Ht!="object"||typeof Ht.createPolicy!="function")return null;let Y=null,C="data-tt-policy-suffix";ht.currentScript&&ht.currentScript.hasAttribute(C)&&(Y=ht.currentScript.getAttribute(C));let b="dompurify"+(Y?"#"+Y:"");try{return Ht.createPolicy(b,{createHTML(k){return k},createScriptURL(k){return k}})}catch{return console.warn("TrustedTypes policy "+b+" could not be created."),null}};function Hn(){let ue=arguments.length>0&&arguments[0]!==void 0?arguments[0]:hn(),Ht=p=>Hn(p);if(Ht.version="3.0.2",Ht.removed=[],!ue||!ue.document||ue.document.nodeType!==9)return Ht.isSupported=!1,Ht;let ht=ue.document,{document:Y}=ue,{DocumentFragment:C,HTMLTemplateElement:b,Node:k,Element:F,NodeFilter:Z,NamedNodeMap:J=ue.NamedNodeMap||ue.MozNamedAttrMap,HTMLFormElement:tt,DOMParser:pt,trustedTypes:Lt}=ue,vt=F.prototype,Ft=lt(vt,"cloneNode"),Wt=lt(vt,"nextSibling"),Jt=lt(vt,"childNodes"),$t=lt(vt,"parentNode");if(typeof b=="function"){let p=Y.createElement("template");p.content&&p.content.ownerDocument&&(Y=p.content.ownerDocument)}let jt=Sn(Lt,ht),ge=jt?jt.createHTML(""):"",{implementation:pe,createNodeIterator:Te,createDocumentFragment:Ce,getElementsByTagName:he}=Y,{importNode:An}=ht,we={};Ht.isSupported=typeof r=="function"&&typeof $t=="function"&&pe&&typeof pe.createHTMLDocument<"u";let{MUSTACHE_EXPR:St,ERB_EXPR:Dn,TMPLIT_EXPR:Xn,DATA_ATTR:re,ARIA_ATTR:Vr,IS_SCRIPT_OR_DATA:zn,ATTR_WHITESPACE:cn}=Bt,{IS_ALLOWED_URI:or}=Bt,sr=null,wo=et({},[...gt,...Et,...Q,...ct,...Mt]),Wn=null,nr=et({},[...Xt,...ft,...Ct,...st]),Ut=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ei=null,oi=null,xe=!0,Kn=!0,$n=!1,jr=!0,wn=!1,ar=!1,Or=!1,ho=!1,rr=!1,Lo=!1,Ln=!1,kn=!0,Di=!1,pr="user-content-",Mi=!0,bn=!1,mi={},Nr=null,dr=et({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),ur=null,co=et({},["audio","video","img","source","image","track"]),Bi=null,Fi=et({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Le="http://www.w3.org/1998/Math/MathML",le="http://www.w3.org/2000/svg",Rr="http://www.w3.org/1999/xhtml",Un=Rr,Pi=!1,fo=null,Zt=et({},[Le,le,Rr],z),En,Wr=["application/xhtml+xml","text/html"],bo="text/html",Kt,eo=null,Jo=Y.createElement("form"),si=function(_){return _ instanceof RegExp||_ instanceof Function},De=function(_){eo&&eo===_||((!_||typeof _!="object")&&(_={}),_=X(_),En=Wr.indexOf(_.PARSER_MEDIA_TYPE)===-1?En=bo:En=_.PARSER_MEDIA_TYPE,Kt=En==="application/xhtml+xml"?z:q,sr="ALLOWED_TAGS"in _?et({},_.ALLOWED_TAGS,Kt):wo,Wn="ALLOWED_ATTR"in _?et({},_.ALLOWED_ATTR,Kt):nr,fo="ALLOWED_NAMESPACES"in _?et({},_.ALLOWED_NAMESPACES,z):Zt,Bi="ADD_URI_SAFE_ATTR"in _?et(X(Fi),_.ADD_URI_SAFE_ATTR,Kt):Fi,ur="ADD_DATA_URI_TAGS"in _?et(X(co),_.ADD_DATA_URI_TAGS,Kt):co,Nr="FORBID_CONTENTS"in _?et({},_.FORBID_CONTENTS,Kt):dr,Ei="FORBID_TAGS"in _?et({},_.FORBID_TAGS,Kt):{},oi="FORBID_ATTR"in _?et({},_.FORBID_ATTR,Kt):{},mi="USE_PROFILES"in _?_.USE_PROFILES:!1,xe=_.ALLOW_ARIA_ATTR!==!1,Kn=_.ALLOW_DATA_ATTR!==!1,$n=_.ALLOW_UNKNOWN_PROTOCOLS||!1,jr=_.ALLOW_SELF_CLOSE_IN_ATTR!==!1,wn=_.SAFE_FOR_TEMPLATES||!1,ar=_.WHOLE_DOCUMENT||!1,rr=_.RETURN_DOM||!1,Lo=_.RETURN_DOM_FRAGMENT||!1,Ln=_.RETURN_TRUSTED_TYPE||!1,ho=_.FORCE_BODY||!1,kn=_.SANITIZE_DOM!==!1,Di=_.SANITIZE_NAMED_PROPS||!1,Mi=_.KEEP_CONTENT!==!1,bn=_.IN_PLACE||!1,or=_.ALLOWED_URI_REGEXP||Re,Un=_.NAMESPACE||Rr,Ut=_.CUSTOM_ELEMENT_HANDLING||{},_.CUSTOM_ELEMENT_HANDLING&&si(_.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Ut.tagNameCheck=_.CUSTOM_ELEMENT_HANDLING.tagNameCheck),_.CUSTOM_ELEMENT_HANDLING&&si(_.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Ut.attributeNameCheck=_.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),_.CUSTOM_ELEMENT_HANDLING&&typeof _.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Ut.allowCustomizedBuiltInElements=_.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),wn&&(Kn=!1),Lo&&(rr=!0),mi&&(sr=et({},[...Mt]),Wn=[],mi.html===!0&&(et(sr,gt),et(Wn,Xt)),mi.svg===!0&&(et(sr,Et),et(Wn,ft),et(Wn,st)),mi.svgFilters===!0&&(et(sr,Q),et(Wn,ft),et(Wn,st)),mi.mathMl===!0&&(et(sr,ct),et(Wn,Ct),et(Wn,st))),_.ADD_TAGS&&(sr===wo&&(sr=X(sr)),et(sr,_.ADD_TAGS,Kt)),_.ADD_ATTR&&(Wn===nr&&(Wn=X(Wn)),et(Wn,_.ADD_ATTR,Kt)),_.ADD_URI_SAFE_ATTR&&et(Bi,_.ADD_URI_SAFE_ATTR,Kt),_.FORBID_CONTENTS&&(Nr===dr&&(Nr=X(Nr)),et(Nr,_.FORBID_CONTENTS,Kt)),Mi&&(sr["#text"]=!0),ar&&et(sr,["html","head","body"]),sr.table&&(et(sr,["tbody"]),delete Ei.tbody),c&&c(_),eo=_)},gr=et({},["mi","mo","mn","ms","mtext"]),ai=et({},["foreignobject","desc","title","annotation-xml"]),Vi=et({},["title","style","font","a","script"]),It=et({},Et);et(It,Q),et(It,kt);let zi=et({},ct);et(zi,bt);let fn=function(_){let E=$t(_);(!E||!E.tagName)&&(E={namespaceURI:Un,tagName:"template"});let I=q(_.tagName),V=q(E.tagName);return fo[_.namespaceURI]?_.namespaceURI===le?E.namespaceURI===Rr?I==="svg":E.namespaceURI===Le?I==="svg"&&(V==="annotation-xml"||gr[V]):!!It[I]:_.namespaceURI===Le?E.namespaceURI===Rr?I==="math":E.namespaceURI===le?I==="math"&&ai[V]:!!zi[I]:_.namespaceURI===Rr?E.namespaceURI===le&&!ai[V]||E.namespaceURI===Le&&!gr[V]?!1:!zi[I]&&(Vi[I]||!It[I]):!!(En==="application/xhtml+xml"&&fo[_.namespaceURI]):!1},Qn=function(_){N(Ht.removed,{element:_});try{_.parentNode.removeChild(_)}catch{_.remove()}},Ci=function(_,E){try{N(Ht.removed,{attribute:E.getAttributeNode(_),from:E})}catch{N(Ht.removed,{attribute:null,from:E})}if(E.removeAttribute(_),_==="is"&&!Wn[_])if(rr||Lo)try{Qn(E)}catch{}else try{E.setAttribute(_,"")}catch{}},tr=function(_){let E,I;if(ho)_=""+_;else{let it=j(_,/^[\r\n\t ]+/);I=it&&it[0]}En==="application/xhtml+xml"&&Un===Rr&&(_=''+_+"");let V=jt?jt.createHTML(_):_;if(Un===Rr)try{E=new pt().parseFromString(V,En)}catch{}if(!E||!E.documentElement){E=pe.createDocument(Un,"template",null);try{E.documentElement.innerHTML=Pi?ge:V}catch{}}let nt=E.body||E.documentElement;return _&&I&&nt.insertBefore(Y.createTextNode(I),nt.childNodes[0]||null),Un===Rr?he.call(E,ar?"html":"body")[0]:ar?E.documentElement:nt},Ae=function(_){return Te.call(_.ownerDocument||_,_,Z.SHOW_ELEMENT|Z.SHOW_COMMENT|Z.SHOW_TEXT,null,!1)},be=function(_){return _ instanceof tt&&(typeof _.nodeName!="string"||typeof _.textContent!="string"||typeof _.removeChild!="function"||!(_.attributes instanceof J)||typeof _.removeAttribute!="function"||typeof _.setAttribute!="function"||typeof _.namespaceURI!="string"||typeof _.insertBefore!="function"||typeof _.hasChildNodes!="function")},Nn=function(_){return typeof k=="object"?_ instanceof k:_&&typeof _=="object"&&typeof _.nodeType=="number"&&typeof _.nodeName=="string"},ui=function(_,E,I){we[_]&&P(we[_],V=>{V.call(Ht,E,I,eo)})},$o=function(_){let E;if(ui("beforeSanitizeElements",_,null),be(_))return Qn(_),!0;let I=Kt(_.nodeName);if(ui("uponSanitizeElement",_,{tagName:I,allowedTags:sr}),_.hasChildNodes()&&!Nn(_.firstElementChild)&&(!Nn(_.content)||!Nn(_.content.firstElementChild))&&A(/<[/\w]/g,_.innerHTML)&&A(/<[/\w]/g,_.textContent))return Qn(_),!0;if(!sr[I]||Ei[I]){if(!Ei[I]&&Kr(I)&&(Ut.tagNameCheck instanceof RegExp&&A(Ut.tagNameCheck,I)||Ut.tagNameCheck instanceof Function&&Ut.tagNameCheck(I)))return!1;if(Mi&&!Nr[I]){let V=$t(_)||_.parentNode,nt=Jt(_)||_.childNodes;if(nt&&V){let it=nt.length;for(let rt=it-1;rt>=0;--rt)V.insertBefore(Ft(nt[rt],!0),Wt(_))}}return Qn(_),!0}return _ instanceof F&&!fn(_)||(I==="noscript"||I==="noembed")&&A(/<\/no(script|embed)/i,_.innerHTML)?(Qn(_),!0):(wn&&_.nodeType===3&&(E=_.textContent,E=R(E,St," "),E=R(E,Dn," "),E=R(E,Xn," "),_.textContent!==E&&(N(Ht.removed,{element:_.cloneNode()}),_.textContent=E)),ui("afterSanitizeElements",_,null),!1)},ie=function(_,E,I){if(kn&&(E==="id"||E==="name")&&(I in Y||I in Jo))return!1;if(!(Kn&&!oi[E]&&A(re,E))){if(!(xe&&A(Vr,E))){if(!Wn[E]||oi[E]){if(!(Kr(_)&&(Ut.tagNameCheck instanceof RegExp&&A(Ut.tagNameCheck,_)||Ut.tagNameCheck instanceof Function&&Ut.tagNameCheck(_))&&(Ut.attributeNameCheck instanceof RegExp&&A(Ut.attributeNameCheck,E)||Ut.attributeNameCheck instanceof Function&&Ut.attributeNameCheck(E))||E==="is"&&Ut.allowCustomizedBuiltInElements&&(Ut.tagNameCheck instanceof RegExp&&A(Ut.tagNameCheck,I)||Ut.tagNameCheck instanceof Function&&Ut.tagNameCheck(I))))return!1}else if(!Bi[E]){if(!A(or,R(I,cn,""))){if(!((E==="src"||E==="xlink:href"||E==="href")&&_!=="script"&&B(I,"data:")===0&&ur[_])){if(!($n&&!A(zn,R(I,cn,"")))){if(I)return!1}}}}}}return!0},Kr=function(_){return _.indexOf("-")>0},Pe=function(_){let E,I,V,nt;ui("beforeSanitizeAttributes",_,null);let{attributes:it}=_;if(!it)return;let rt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Wn};for(nt=it.length;nt--;){E=it[nt];let{name:ot,namespaceURI:dt}=E;if(I=ot==="value"?E.value:D(E.value),V=Kt(ot),rt.attrName=V,rt.attrValue=I,rt.keepAttr=!0,rt.forceKeepAttr=void 0,ui("uponSanitizeAttribute",_,rt),I=rt.attrValue,rt.forceKeepAttr||(Ci(ot,_),!rt.keepAttr))continue;if(!jr&&A(/\/>/i,I)){Ci(ot,_);continue}wn&&(I=R(I,St," "),I=R(I,Dn," "),I=R(I,Xn," "));let Pt=Kt(_.nodeName);if(ie(Pt,V,I)){if(Di&&(V==="id"||V==="name")&&(Ci(ot,_),I=pr+I),jt&&typeof Lt=="object"&&typeof Lt.getAttributeType=="function"&&!dt)switch(Lt.getAttributeType(Pt,V)){case"TrustedHTML":I=jt.createHTML(I);break;case"TrustedScriptURL":I=jt.createScriptURL(I);break}try{dt?_.setAttributeNS(dt,ot,I):_.setAttribute(ot,I),T(Ht.removed)}catch{}}}ui("afterSanitizeAttributes",_,null)},h=function p(_){let E,I=Ae(_);for(ui("beforeSanitizeShadowDOM",_,null);E=I.nextNode();)ui("uponSanitizeShadowNode",E,null),!$o(E)&&(E.content instanceof C&&p(E.content),Pe(E));ui("afterSanitizeShadowDOM",_,null)};return Ht.sanitize=function(p){let _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},E,I,V,nt;if(Pi=!p,Pi&&(p=""),typeof p!="string"&&!Nn(p)){if(typeof p.toString!="function")throw G("toString is not a function");if(p=p.toString(),typeof p!="string")throw G("dirty is not a string, aborting")}if(!Ht.isSupported)return p;if(Or||De(_),Ht.removed=[],typeof p=="string"&&(bn=!1),bn){if(p.nodeName){let ot=Kt(p.nodeName);if(!sr[ot]||Ei[ot])throw G("root node is forbidden and cannot be sanitized in-place")}}else if(p instanceof k)E=tr(""),I=E.ownerDocument.importNode(p,!0),I.nodeType===1&&I.nodeName==="BODY"||I.nodeName==="HTML"?E=I:E.appendChild(I);else{if(!rr&&!wn&&!ar&&p.indexOf("<")===-1)return jt&&Ln?jt.createHTML(p):p;if(E=tr(p),!E)return rr?null:Ln?ge:""}E&&ho&&Qn(E.firstChild);let it=Ae(bn?p:E);for(;V=it.nextNode();)$o(V)||(V.content instanceof C&&h(V.content),Pe(V));if(bn)return p;if(rr){if(Lo)for(nt=Ce.call(E.ownerDocument);E.firstChild;)nt.appendChild(E.firstChild);else nt=E;return(Wn.shadowroot||Wn.shadowrootmod)&&(nt=An.call(ht,nt,!0)),nt}let rt=ar?E.outerHTML:E.innerHTML;return ar&&sr["!doctype"]&&E.ownerDocument&&E.ownerDocument.doctype&&E.ownerDocument.doctype.name&&A(ke,E.ownerDocument.doctype.name)&&(rt=" -`+rt),wn&&(rt=R(rt,St," "),rt=R(rt,Dn," "),rt=R(rt,Xn," ")),jt&&Ln?jt.createHTML(rt):rt},Ht.setConfig=function(p){De(p),Or=!0},Ht.clearConfig=function(){eo=null,Or=!1},Ht.isValidAttribute=function(p,_,E){eo||De({});let I=Kt(p),V=Kt(_);return ie(I,V,E)},Ht.addHook=function(p,_){typeof _=="function"&&(we[p]=we[p]||[],N(we[p],_))},Ht.removeHook=function(p){if(we[p])return T(we[p])},Ht.removeHooks=function(p){we[p]&&(we[p]=[])},Ht.removeAllHooks=function(){we={}},Ht}var Me=Hn();return Me})});var Qm=se((x4,wf)=>{(function(r){if(typeof define=="function"&&define.amd)define(["leaflet"],r);else if(typeof wf<"u")wf.exports=r(Oo());else{if(typeof window.L>"u")throw new Error("Leaflet must be loaded first");r(window.L)}})(function(r){return r.Control.Search=r.Control.extend({includes:r.version[0]==="1"?r.Evented.prototype:r.Mixin.Events,options:{url:"",layer:null,sourceData:null,jsonpParam:null,propertyLoc:"loc",propertyName:"title",formatData:null,filterData:null,moveToLocation:null,buildTip:null,container:"",zoom:null,minLength:1,initial:!0,casesensitive:!1,autoType:!0,delayType:400,tooltipLimit:-1,tipAutoSubmit:!0,firstTipSubmit:!1,autoResize:!0,collapsed:!0,autoCollapse:!1,autoCollapseTime:1200,textErr:"Location not found",textCancel:"Cancel",textPlaceholder:"Search...",hideMarkerOnCollapse:!1,position:"topleft",marker:{icon:!1,animate:!0,circle:{radius:10,weight:3,color:"#e03",stroke:!0,fill:!1}}},_getPath:function(n,s){let a=s.split("."),l=a.pop(),c=a.length,g=a[0],m=1;if(c>0)for(;(n=n[g])&&m⊗",r.DomEvent.on(a,"click",r.DomEvent.stop,this).on(a,"click",this.cancel,this),a},_createButton:function(n,s){let a=r.DomUtil.create("a",s,this._container);return a.href="#",a.title=n,r.DomEvent.on(a,"click",r.DomEvent.stop,this).on(a,"click",this._handleSubmit,this).on(a,"focus",this.collapseDelayedStop,this).on(a,"blur",this.collapseDelayed,this),a},_createTooltip:function(n){let s=this,a=r.DomUtil.create("ul",n,this._container);return a.style.display="none",r.DomEvent.disableClickPropagation(a).on(a,"blur",this.collapseDelayed,this).on(a,"wheel",function(l){s.collapseDelayedStop(),r.DomEvent.stopPropagation(l)},this).on(a,"mouseover",function(l){s.collapseDelayedStop()},this),a},_createTip:function(n,s){let a;if(this.options.buildTip){if(a=this.options.buildTip.call(this,n,s),typeof a=="string"){let l=r.DomUtil.create("div");l.innerHTML=a,a=l.firstChild}}else a=r.DomUtil.create("li",""),a.innerHTML=n;return r.DomUtil.addClass(a,"search-tip"),a._text=n,this.options.tipAutoSubmit&&r.DomEvent.disableClickPropagation(a).on(a,"click",r.DomEvent.stop,this).on(a,"click",function(l){this._input.value=n,this._handleAutoresize(),this._input.focus(),this._hideTooltip(),this._handleSubmit()},this),a},_getUrl:function(n){return typeof this.options.url=="function"?this.options.url(n):this.options.url},_defaultFilterData:function(n,s){let a={};if(n=n.replace(new RegExp("[.*+?^${}()|[]\\]","g"),""),n==="")return[];let l=this.options.initial?"^":"",c=this.options.casesensitive?void 0:"i",g=new RegExp(l+n,c);for(let m in s)g.test(m)&&(a[m]=s[m]);return a},showTooltip:function(n){if(this._countertips=0,this._tooltip.innerHTML="",this._tooltip.currentSelection=-1,this.options.tooltipLimit)for(let s in n){if(this._countertips===this.options.tooltipLimit)break;this._countertips++,this._tooltip.appendChild(this._createTip(s,n[s]))}return this._countertips>0?(this._tooltip.style.display="block",this._autoTypeTmp&&this._autoType(),this._autoTypeTmp=this.options.autoType):this._hideTooltip(),this._tooltip.scrollTop=0,this._countertips},_hideTooltip:function(){return this._tooltip.style.display="none",this._tooltip.innerHTML="",0},_defaultFormatData:function(n){let s=this,a=this.options.propertyName,l=this.options.propertyLoc,c={};if(r.Util.isArray(l))for(let g in n)c[s._getPath(n[g],a)]=r.latLng(s._getPath(n[g],l[0]),s._getPath(n[g],l[1]));else for(let g in n)c[s._getPath(n[g],a)]=r.latLng(s._getPath(n[g],l));return c},_recordsFromJsonp:function(n,s){r.Control.Search.callJsonp=s;let a=r.DomUtil.create("script","leaflet-search-jsonp",document.getElementsByTagName("body")[0]),l=r.Util.template(this._getUrl(n)+"&"+this.options.jsonpParam+"=L.Control.Search.callJsonp",{s:n});return a.type="text/javascript",a.src=l,{abort:function(){a.parentNode.removeChild(a)}}},_recordsFromAjax:function(n,s){let a;try{a=new window.XMLHttpRequest}catch{throw new Error("XMLHttpRequest is not supported")}let l=r.Util.template(this._getUrl(n),{s:n});return a.open("GET",l),a.onload=function(){s(JSON.parse(a.responseText))},a.onreadystatechange=function(){a.readyState===4&&a.status===200&&this.onload()},a.send(),a},_searchInLayer:function(n,s,a){let l=this,c;n instanceof r.Control.Search.Marker||(n instanceof r.Marker||n instanceof r.CircleMarker?l._getPath(n.options,a)?(c=n.getLatLng(),c.layer=n,s[l._getPath(n.options,a)]=c):l._getPath(n.feature.properties,a)&&(c=n.getLatLng(),c.layer=n,s[l._getPath(n.feature.properties,a)]=c):n instanceof r.Path||n instanceof r.Polyline||n instanceof r.Polygon?l._getPath(n.options,a)?(c=n.getBounds().getCenter(),c.layer=n,s[l._getPath(n.options,a)]=c):l._getPath(n.feature.properties,a)&&(c=n.getBounds().getCenter(),c.layer=n,s[l._getPath(n.feature.properties,a)]=c):Object.prototype.hasOwnProperty.call(n,"feature")?Object.prototype.hasOwnProperty.call(n.feature.properties,a)&&(n.getLatLng&&typeof n.getLatLng=="function"?(c=n.getLatLng(),c.layer=n,s[n.feature.properties[a]]=c):n.getBounds&&typeof n.getBounds=="function"&&(c=n.getBounds().getCenter(),c.layer=n,s[n.feature.properties[a]]=c)):n instanceof r.LayerGroup&&n.eachLayer(function(g){l._searchInLayer(g,s,a)}))},_recordsFromLayer:function(){let n=this,s={},a=this.options.propertyName;return this._layer.eachLayer(function(l){n._searchInLayer(l,s,a)}),s},_autoType:function(){let n=this._input.value.length,s=this._tooltip.firstChild?this._tooltip.firstChild._text:"",a=s.length;if(s.indexOf(this._input.value)===0)if(this._input.value=s,this._handleAutoresize(),this._input.createTextRange){let l=this._input.createTextRange();l.collapse(!0),l.moveStart("character",n),l.moveEnd("character",a),l.select()}else this._input.setSelectionRange?this._input.setSelectionRange(n,a):this._input.selectionStart&&(this._input.selectionStart=n,this._input.selectionEnd=a)},_hideAutoType:function(){let n;if((n=this._input.selection)&&n.empty)n.empty();else if(this._input.createTextRange){n=this._input.createTextRange(),n.collapse(!0);let s=this._input.value.length;n.moveStart("character",s),n.moveEnd("character",s),n.select()}else this._input.getSelection&&this._input.getSelection().removeAllRanges(),this._input.selectionStart=this._input.selectionEnd},_handleKeypress:function(n){let s=this;switch(n.keyCode){case 27:this.collapse();break;case 13:(this._countertips===1||this.options.firstTipSubmit&&this._countertips>0)&&this._tooltip.currentSelection===-1&&this._handleArrowSelect(1),this._handleSubmit();break;case 38:this._handleArrowSelect(-1);break;case 40:this._handleArrowSelect(1);break;case 45:case 46:this._autoTypeTmp=!1;break;case 37:case 39:case 16:case 17:case 35:case 36:break;default:this._input.value.length?this._cancel.style.display="block":this._cancel.style.display="none",this._input.value.length>=this.options.minLength?(clearTimeout(this.timerKeypress),this.timerKeypress=setTimeout(function(){s._fillRecordsCache()},this.options.delayType)):this._hideTooltip()}this._handleAutoresize()},searchText:function(n){let s=n.charCodeAt(n.length);this._input.value=n,this._input.style.display="block",r.DomUtil.addClass(this._container,"search-exp"),this._autoTypeTmp=!1,this._handleKeypress({keyCode:s})},_fillRecordsCache:function(){let n=this,s=this._input.value,a;this._curReq&&this._curReq.abort&&this._curReq.abort(),r.DomUtil.addClass(this._container,"search-load"),this.options.layer?(this._recordsCache=this._recordsFromLayer(),a=this._filterData(this._input.value,this._recordsCache),this.showTooltip(a),r.DomUtil.removeClass(this._container,"search-load")):(this.options.sourceData?this._retrieveData=this.options.sourceData:this.options.url&&(this._retrieveData=this.options.jsonpParam?this._recordsFromJsonp:this._recordsFromAjax),this._curReq=this._retrieveData(this,s,function(l){n._recordsCache=n._formatData(n,l),n.options.sourceData?a=n._filterData(n._input.value,n._recordsCache):a=n._recordsCache,n.showTooltip(a),r.DomUtil.removeClass(n._container,"search-load")}))},_handleAutoresize:function(){let n;this._input.style.maxWidth!==this._map._container.offsetWidth&&(n=this._map._container.clientWidth,n-=83,this._input.style.maxWidth=n.toString()+"px"),this.options.autoResize&&this._container.offsetWidth+20=s.length-1)r.DomUtil.addClass(s[this._tooltip.currentSelection],"search-tip-select");else if(n===-1&&this._tooltip.currentSelection<=0)this._tooltip.currentSelection=-1;else if(this._tooltip.style.display!=="none"){this._tooltip.currentSelection+=n,r.DomUtil.addClass(s[this._tooltip.currentSelection],"search-tip-select"),this._input.value=s[this._tooltip.currentSelection]._text;let a=s[this._tooltip.currentSelection].offsetTop;a+s[this._tooltip.currentSelection].clientHeight>=this._tooltip.scrollTop+this._tooltip.clientHeight?this._tooltip.scrollTop=a-this._tooltip.clientHeight+s[this._tooltip.currentSelection].clientHeight:a<=this._tooltip.scrollTop&&(this._tooltip.scrollTop=a)}},_handleSubmit:function(){if(this._hideAutoType(),this.hideAlert(),this._hideTooltip(),this._input.style.display==="none")this.expand();else if(this._input.value==="")this.collapse();else{let n=this._getLocation(this._input.value);n?(this.showLocation(n,this._input.value),this.fire("search:locationfound",{latlng:n,text:this._input.value,layer:n.layer?n.layer:null})):this.showAlert()}},_getLocation:function(n){return Object.prototype.hasOwnProperty.call(this._recordsCache,n)?this._recordsCache[n]:!1},_defaultMoveToLocation:function(n,s,a){this.options.zoom?this._map.setView(n,this.options.zoom):this._map.panTo(n)},showLocation:function(n,s){let a=this;return a._map.once("moveend zoomend",function(l){a._markerSearch&&a._markerSearch.addTo(a._map).setLatLng(n)}),a._moveToLocation(n,s,a._map),a.options.autoCollapse&&a.collapse(),a}}),r.Control.Search.Marker=r.Marker.extend({includes:r.version[0]==="1"?r.Evented.prototype:r.Mixin.Events,options:{icon:new r.Icon.Default,animate:!0,circle:{radius:10,weight:3,color:"#e03",stroke:!0,fill:!1}},initialize:function(n,s){r.setOptions(this,s),s.icon===!0&&(s.icon=new r.Icon.Default),r.Marker.prototype.initialize.call(this,n,s),r.Control.Search.prototype._isObject(this.options.circle)&&(this._circleLoc=new r.CircleMarker(n,this.options.circle))},onAdd:function(n){r.Marker.prototype.onAdd.call(this,n),this._circleLoc&&(n.addLayer(this._circleLoc),this.options.animate&&this.animate())},onRemove:function(n){r.Marker.prototype.onRemove.call(this,n),this._circleLoc&&n.removeLayer(this._circleLoc)},setLatLng:function(n){return r.Marker.prototype.setLatLng.call(this,n),this._circleLoc&&this._circleLoc.setLatLng(n),this},_initIcon:function(){this.options.icon&&r.Marker.prototype._initIcon.call(this)},_removeIcon:function(){this.options.icon&&r.Marker.prototype._removeIcon.call(this)},animate:function(){if(this._circleLoc){let n=this._circleLoc,s=200,l=parseInt(n._radius/5),c=this.options.circle.radius,g=n._radius*2,m=0;n._timerAnimLoc=setInterval(function(){m+=.5,l+=m,g-=l,n.setRadius(g),g{var r={9705:(a,l,c)=>{"use strict";var g=c(1540);function m(v){var x=[1/0,1/0,-1/0,-1/0];return g.coordEach(v,function(P){x[0]>P[0]&&(x[0]=P[0]),x[1]>P[1]&&(x[1]=P[1]),x[2]{"use strict";function c(B,D,A){A===void 0&&(A={});var G={type:"Feature"};return(A.id===0||A.id)&&(G.id=A.id),A.bbox&&(G.bbox=A.bbox),G.properties=D||{},G.geometry=B,G}function g(B,D,A){if(A===void 0&&(A={}),!B)throw new Error("coordinates is required");if(!Array.isArray(B))throw new Error("coordinates must be an Array");if(B.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!R(B[0])||!R(B[1]))throw new Error("coordinates must contain numbers");return c({type:"Point",coordinates:B},D,A)}function m(B,D,A){A===void 0&&(A={});for(var G=0,H=B;G=0))throw new Error("precision must be a positive number");var A=Math.pow(10,D||0);return Math.round(B*A)/A},l.radiansToLength=q,l.lengthToRadians=z,l.lengthToDegrees=function(B,D){return j(z(B,D))},l.bearingToAzimuth=function(B){var D=B%360;return D<0&&(D+=360),D},l.radiansToDegrees=j,l.degreesToRadians=function(B){return B%360*Math.PI/180},l.convertLength=function(B,D,A){if(D===void 0&&(D="kilometers"),A===void 0&&(A="kilometers"),!(B>=0))throw new Error("length must be a positive number");return q(z(B,D),A)},l.convertArea=function(B,D,A){if(D===void 0&&(D="meters"),A===void 0&&(A="kilometers"),!(B>=0))throw new Error("area must be a positive number");var G=l.areaFactors[D];if(!G)throw new Error("invalid original units");var H=l.areaFactors[A];if(!H)throw new Error("invalid final units");return B/G*H},l.isNumber=R,l.isObject=function(B){return!!B&&B.constructor===Object},l.validateBBox=function(B){if(!B)throw new Error("bbox is required");if(!Array.isArray(B))throw new Error("bbox must be an Array");if(B.length!==4&&B.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");B.forEach(function(D){if(!R(D))throw new Error("bbox must only contain numbers")})},l.validateId=function(B){if(!B)throw new Error("id is required");if(["string","number"].indexOf(typeof B)===-1)throw new Error("id must be a number or a string")}},1540:(a,l,c)=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0});var g=c(4102);function m(z,j,R){if(z!==null)for(var B,D,A,G,H,K,et,X,lt=0,gt=0,Et=z.type,Q=Et==="FeatureCollection",kt=Et==="Feature",ct=Q?z.features.length:1,bt=0;btK||Q>et||kt>X)return H=lt,K=B,et=Q,X=kt,void(A=0);var ct=g.lineString([H,lt],R.properties);if(j(ct,B,D,kt,A)===!1)return!1;A++,H=lt})!==!1&&void 0}}})}function q(z,j){if(!z)throw new Error("geojson is required");T(z,function(R,B,D){if(R.geometry!==null){var A=R.geometry.type,G=R.geometry.coordinates;switch(A){case"LineString":if(j(R,B,D,0,0)===!1)return!1;break;case"Polygon":for(var H=0;H{"use strict";c(7107);var g=c(2492),m=c.n(g);let v=JSON.parse('{"tooltips":{"placeMarker":"Click to place marker","firstVertex":"Click to place first vertex","continueLine":"Click to continue drawing","finishLine":"Click any existing marker to finish","finishPoly":"Click first marker to finish","finishRect":"Click to finish","startCircle":"Click to place circle center","finishCircle":"Click to finish circle","placeCircleMarker":"Click to place circle marker","placeText":"Click to place text"},"actions":{"finish":"Finish","cancel":"Cancel","removeLastVertex":"Remove Last Vertex"},"buttonTitles":{"drawMarkerButton":"Draw Marker","drawPolyButton":"Draw Polygons","drawLineButton":"Draw Polyline","drawCircleButton":"Draw Circle","drawRectButton":"Draw Rectangle","editButton":"Edit Layers","dragButton":"Drag Layers","cutButton":"Cut Layers","deleteButton":"Remove Layers","drawCircleMarkerButton":"Draw Circle Marker","snappingButton":"Snap dragged marker to other layers and vertices","pinningButton":"Pin shared vertices together","rotateButton":"Rotate Layers","drawTextButton":"Draw Text","scaleButton":"Scale Layers","autoTracingButton":"Auto trace Line"},"measurements":{"totalLength":"Length","segmentLength":"Segment length","area":"Area","radius":"Radius","perimeter":"Perimeter","height":"Height","width":"Width","coordinates":"Position","coordinatesMarker":"Position Marker"}}'),x=JSON.parse('{"tooltips":{"placeMarker":"Platziere den Marker mit Klick","firstVertex":"Platziere den ersten Marker mit Klick","continueLine":"Klicke, um weiter zu zeichnen","finishLine":"Beende mit Klick auf existierenden Marker","finishPoly":"Beende mit Klick auf ersten Marker","finishRect":"Beende mit Klick","startCircle":"Platziere das Kreiszentrum mit Klick","finishCircle":"Beende den Kreis mit Klick","placeCircleMarker":"Platziere den Kreismarker mit Klick","placeText":"Platziere den Text mit Klick"},"actions":{"finish":"Beenden","cancel":"Abbrechen","removeLastVertex":"Letzten Vertex l\xF6schen"},"buttonTitles":{"drawMarkerButton":"Marker zeichnen","drawPolyButton":"Polygon zeichnen","drawLineButton":"Polyline zeichnen","drawCircleButton":"Kreis zeichnen","drawRectButton":"Rechteck zeichnen","editButton":"Layer editieren","dragButton":"Layer bewegen","cutButton":"Layer schneiden","deleteButton":"Layer l\xF6schen","drawCircleMarkerButton":"Kreismarker zeichnen","snappingButton":"Bewegter Layer an andere Layer oder Vertexe einhacken","pinningButton":"Vertexe an der gleichen Position verkn\xFCpfen","rotateButton":"Layer drehen","drawTextButton":"Text zeichnen","scaleButton":"Layer skalieren","autoTracingButton":"Linie automatisch nachzeichen"},"measurements":{"totalLength":"L\xE4nge","segmentLength":"Segment L\xE4nge","area":"Fl\xE4che","radius":"Radius","perimeter":"Umfang","height":"H\xF6he","width":"Breite","coordinates":"Position","coordinatesMarker":"Position Marker"}}'),P=JSON.parse(`{"tooltips":{"placeMarker":"Clicca per posizionare un Marker","firstVertex":"Clicca per posizionare il primo vertice","continueLine":"Clicca per continuare a disegnare","finishLine":"Clicca qualsiasi marker esistente per terminare","finishPoly":"Clicca il primo marker per terminare","finishRect":"Clicca per terminare","startCircle":"Clicca per posizionare il punto centrale del cerchio","finishCircle":"Clicca per terminare il cerchio","placeCircleMarker":"Clicca per posizionare un Marker del cherchio"},"actions":{"finish":"Termina","cancel":"Annulla","removeLastVertex":"Rimuovi l'ultimo vertice"},"buttonTitles":{"drawMarkerButton":"Disegna Marker","drawPolyButton":"Disegna Poligoni","drawLineButton":"Disegna Polilinea","drawCircleButton":"Disegna Cerchio","drawRectButton":"Disegna Rettangolo","editButton":"Modifica Livelli","dragButton":"Sposta Livelli","cutButton":"Ritaglia Livelli","deleteButton":"Elimina Livelli","drawCircleMarkerButton":"Disegna Marker del Cerchio","snappingButton":"Snap ha trascinato il pennarello su altri strati e vertici","pinningButton":"Pin condiviso vertici insieme"}}`),T=JSON.parse('{"tooltips":{"placeMarker":"Klik untuk menempatkan marker","firstVertex":"Klik untuk menempatkan vertex pertama","continueLine":"Klik untuk meneruskan digitasi","finishLine":"Klik pada sembarang marker yang ada untuk mengakhiri","finishPoly":"Klik marker pertama untuk mengakhiri","finishRect":"Klik untuk mengakhiri","startCircle":"Klik untuk menempatkan titik pusat lingkaran","finishCircle":"Klik untuk mengakhiri lingkaran","placeCircleMarker":"Klik untuk menempatkan penanda lingkarann"},"actions":{"finish":"Selesai","cancel":"Batal","removeLastVertex":"Hilangkan Vertex Terakhir"},"buttonTitles":{"drawMarkerButton":"Digitasi Marker","drawPolyButton":"Digitasi Polygon","drawLineButton":"Digitasi Polyline","drawCircleButton":"Digitasi Lingkaran","drawRectButton":"Digitasi Segi Empat","editButton":"Edit Layer","dragButton":"Geser Layer","cutButton":"Potong Layer","deleteButton":"Hilangkan Layer","drawCircleMarkerButton":"Digitasi Penanda Lingkaran","snappingButton":"Jepretkan penanda yang ditarik ke lapisan dan simpul lain","pinningButton":"Sematkan simpul bersama bersama"}}'),N=JSON.parse('{"tooltips":{"placeMarker":"Adaug\u0103 un punct","firstVertex":"Apas\u0103 aici pentru a ad\u0103uga primul Vertex","continueLine":"Apas\u0103 aici pentru a continua desenul","finishLine":"Apas\u0103 pe orice obiect pentru a finisa desenul","finishPoly":"Apas\u0103 pe primul obiect pentru a finisa","finishRect":"Apas\u0103 pentru a finisa","startCircle":"Apas\u0103 pentru a desena un cerc","finishCircle":"Apas\u0103 pentru a finisa un cerc","placeCircleMarker":"Adaug\u0103 un punct"},"actions":{"finish":"Termin\u0103","cancel":"Anuleaz\u0103","removeLastVertex":"\u0218terge ultimul Vertex"},"buttonTitles":{"drawMarkerButton":"Adaug\u0103 o bulin\u0103","drawPolyButton":"Deseneaz\u0103 un poligon","drawLineButton":"Deseneaz\u0103 o linie","drawCircleButton":"Deseneaz\u0103 un cerc","drawRectButton":"Deseneaz\u0103 un dreptunghi","editButton":"Editeaz\u0103 straturile","dragButton":"Mut\u0103 straturile","cutButton":"Taie straturile","deleteButton":"\u0218terge straturile","drawCircleMarkerButton":"Deseneaz\u0103 marcatorul cercului","snappingButton":"Fixa\u021Bi marcatorul glisat pe alte straturi \u0219i v\xE2rfuri","pinningButton":"Fixa\u021Bi v\xE2rfurile partajate \xEEmpreun\u0103"}}'),q=JSON.parse('{"tooltips":{"placeMarker":"\u041D\u0430\u0436\u043C\u0438\u0442\u0435, \u0447\u0442\u043E\u0431\u044B \u043D\u0430\u043D\u0435\u0441\u0442\u0438 \u043C\u0430\u0440\u043A\u0435\u0440","firstVertex":"\u041D\u0430\u0436\u043C\u0438\u0442\u0435, \u0447\u0442\u043E\u0431\u044B \u043D\u0430\u043D\u0435\u0441\u0442\u0438 \u043F\u0435\u0440\u0432\u044B\u0439 \u043E\u0431\u044A\u0435\u043A\u0442","continueLine":"\u041D\u0430\u0436\u043C\u0438\u0442\u0435, \u0447\u0442\u043E\u0431\u044B \u043F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u0442\u044C \u0440\u0438\u0441\u043E\u0432\u0430\u043D\u0438\u0435","finishLine":"\u041D\u0430\u0436\u043C\u0438\u0442\u0435 \u043B\u044E\u0431\u043E\u0439 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044E\u0449\u0438\u0439 \u043C\u0430\u0440\u043A\u0435\u0440 \u0434\u043B\u044F \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u0438\u044F","finishPoly":"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043F\u0435\u0440\u0432\u0443\u044E \u0442\u043E\u0447\u043A\u0443, \u0447\u0442\u043E\u0431\u044B \u0437\u0430\u043A\u043E\u043D\u0447\u0438\u0442\u044C","finishRect":"\u041D\u0430\u0436\u043C\u0438\u0442\u0435, \u0447\u0442\u043E\u0431\u044B \u0437\u0430\u043A\u043E\u043D\u0447\u0438\u0442\u044C","startCircle":"\u041D\u0430\u0436\u043C\u0438\u0442\u0435, \u0447\u0442\u043E\u0431\u044B \u0434\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0446\u0435\u043D\u0442\u0440 \u043A\u0440\u0443\u0433\u0430","finishCircle":"\u041D\u0430\u0436\u043C\u0438\u0442\u0435, \u0447\u0442\u043E\u0431\u044B \u0437\u0430\u0434\u0430\u0442\u044C \u0440\u0430\u0434\u0438\u0443\u0441","placeCircleMarker":"\u041D\u0430\u0436\u043C\u0438\u0442\u0435, \u0447\u0442\u043E\u0431\u044B \u043D\u0430\u043D\u0435\u0441\u0442\u0438 \u043A\u0440\u0443\u0433\u043E\u0432\u043E\u0439 \u043C\u0430\u0440\u043A\u0435\u0440"},"actions":{"finish":"\u0417\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044C","cancel":"\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C","removeLastVertex":"\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0435\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435"},"buttonTitles":{"drawMarkerButton":"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u043C\u0430\u0440\u043A\u0435\u0440","drawPolyButton":"\u0420\u0438\u0441\u043E\u0432\u0430\u0442\u044C \u043F\u043E\u043B\u0438\u0433\u043E\u043D","drawLineButton":"\u0420\u0438\u0441\u043E\u0432\u0430\u0442\u044C \u043A\u0440\u0438\u0432\u0443\u044E","drawCircleButton":"\u0420\u0438\u0441\u043E\u0432\u0430\u0442\u044C \u043A\u0440\u0443\u0433","drawRectButton":"\u0420\u0438\u0441\u043E\u0432\u0430\u0442\u044C \u043F\u0440\u044F\u043C\u043E\u0443\u0433\u043E\u043B\u044C\u043D\u0438\u043A","editButton":"\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0441\u043B\u043E\u0439","dragButton":"\u041F\u0435\u0440\u0435\u043D\u0435\u0441\u0442\u0438 \u0441\u043B\u043E\u0439","cutButton":"\u0412\u044B\u0440\u0435\u0437\u0430\u0442\u044C \u0441\u043B\u043E\u0439","deleteButton":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0441\u043B\u043E\u0439","drawCircleMarkerButton":"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u043A\u0440\u0443\u0433\u043E\u0432\u043E\u0439 \u043C\u0430\u0440\u043A\u0435\u0440","snappingButton":"\u041F\u0440\u0438\u0432\u044F\u0437\u0430\u0442\u044C \u043F\u0435\u0440\u0435\u0442\u0430\u0441\u043A\u0438\u0432\u0430\u0435\u043C\u044B\u0439 \u043C\u0430\u0440\u043A\u0435\u0440 \u043A \u0434\u0440\u0443\u0433\u0438\u043C \u0441\u043B\u043E\u044F\u043C \u0438 \u0432\u0435\u0440\u0448\u0438\u043D\u0430\u043C","pinningButton":"\u0421\u0432\u044F\u0437\u0430\u0442\u044C \u043E\u0431\u0449\u0438\u0435 \u0442\u043E\u0447\u043A\u0438 \u0432\u043C\u0435\u0441\u0442\u0435"}}'),z=JSON.parse('{"tooltips":{"placeMarker":"Presiona para colocar un marcador","firstVertex":"Presiona para colocar el primer v\xE9rtice","continueLine":"Presiona para continuar dibujando","finishLine":"Presiona cualquier marcador existente para finalizar","finishPoly":"Presiona el primer marcador para finalizar","finishRect":"Presiona para finalizar","startCircle":"Presiona para colocar el centro del c\xEDrculo","finishCircle":"Presiona para finalizar el c\xEDrculo","placeCircleMarker":"Presiona para colocar un marcador de c\xEDrculo"},"actions":{"finish":"Finalizar","cancel":"Cancelar","removeLastVertex":"Eliminar \xFAltimo v\xE9rtice"},"buttonTitles":{"drawMarkerButton":"Dibujar Marcador","drawPolyButton":"Dibujar Pol\xEDgono","drawLineButton":"Dibujar L\xEDnea","drawCircleButton":"Dibujar C\xEDrculo","drawRectButton":"Dibujar Rect\xE1ngulo","editButton":"Editar Capas","dragButton":"Arrastrar Capas","cutButton":"Cortar Capas","deleteButton":"Eliminar Capas","drawCircleMarkerButton":"Dibujar Marcador de C\xEDrculo","snappingButton":"El marcador de Snap arrastrado a otras capas y v\xE9rtices","pinningButton":"Fijar juntos los v\xE9rtices compartidos"}}'),j=JSON.parse('{"tooltips":{"placeMarker":"Klik om een marker te plaatsen","firstVertex":"Klik om het eerste punt te plaatsen","continueLine":"Klik om te blijven tekenen","finishLine":"Klik op een bestaand punt om te be\xEBindigen","finishPoly":"Klik op het eerst punt om te be\xEBindigen","finishRect":"Klik om te be\xEBindigen","startCircle":"Klik om het middelpunt te plaatsen","finishCircle":"Klik om de cirkel te be\xEBindigen","placeCircleMarker":"Klik om een marker te plaatsen"},"actions":{"finish":"Bewaar","cancel":"Annuleer","removeLastVertex":"Verwijder laatste punt"},"buttonTitles":{"drawMarkerButton":"Plaats Marker","drawPolyButton":"Teken een vlak","drawLineButton":"Teken een lijn","drawCircleButton":"Teken een cirkel","drawRectButton":"Teken een vierkant","editButton":"Bewerk","dragButton":"Verplaats","cutButton":"Knip","deleteButton":"Verwijder","drawCircleMarkerButton":"Plaats Marker","snappingButton":"Snap gesleepte marker naar andere lagen en hoekpunten","pinningButton":"Speld gedeelde hoekpunten samen"}}'),R=JSON.parse(`{"tooltips":{"placeMarker":"Cliquez pour placer un marqueur","firstVertex":"Cliquez pour placer le premier sommet","continueLine":"Cliquez pour continuer \xE0 dessiner","finishLine":"Cliquez sur n'importe quel marqueur pour terminer","finishPoly":"Cliquez sur le premier marqueur pour terminer","finishRect":"Cliquez pour terminer","startCircle":"Cliquez pour placer le centre du cercle","finishCircle":"Cliquez pour finir le cercle","placeCircleMarker":"Cliquez pour placer le marqueur circulaire"},"actions":{"finish":"Terminer","cancel":"Annuler","removeLastVertex":"Retirer le dernier sommet"},"buttonTitles":{"drawMarkerButton":"Placer des marqueurs","drawPolyButton":"Dessiner des polygones","drawLineButton":"Dessiner des polylignes","drawCircleButton":"Dessiner un cercle","drawRectButton":"Dessiner un rectangle","editButton":"\xC9diter des calques","dragButton":"D\xE9placer des calques","cutButton":"Couper des calques","deleteButton":"Supprimer des calques","drawCircleMarkerButton":"Dessiner un marqueur circulaire","snappingButton":"Glisser le marqueur vers d'autres couches et sommets","pinningButton":"\xC9pingler ensemble les sommets partag\xE9s","rotateButton":"Tourner des calques"}}`),B=JSON.parse('{"tooltips":{"placeMarker":"\u5355\u51FB\u653E\u7F6E\u6807\u8BB0","firstVertex":"\u5355\u51FB\u653E\u7F6E\u9996\u4E2A\u9876\u70B9","continueLine":"\u5355\u51FB\u7EE7\u7EED\u7ED8\u5236","finishLine":"\u5355\u51FB\u4EFB\u4F55\u5B58\u5728\u7684\u6807\u8BB0\u4EE5\u5B8C\u6210","finishPoly":"\u5355\u51FB\u7B2C\u4E00\u4E2A\u6807\u8BB0\u4EE5\u5B8C\u6210","finishRect":"\u5355\u51FB\u5B8C\u6210","startCircle":"\u5355\u51FB\u653E\u7F6E\u5706\u5FC3","finishCircle":"\u5355\u51FB\u5B8C\u6210\u5706\u5F62","placeCircleMarker":"\u70B9\u51FB\u653E\u7F6E\u5706\u5F62\u6807\u8BB0"},"actions":{"finish":"\u5B8C\u6210","cancel":"\u53D6\u6D88","removeLastVertex":"\u79FB\u9664\u6700\u540E\u7684\u9876\u70B9"},"buttonTitles":{"drawMarkerButton":"\u7ED8\u5236\u6807\u8BB0","drawPolyButton":"\u7ED8\u5236\u591A\u8FB9\u5F62","drawLineButton":"\u7ED8\u5236\u7EBF\u6BB5","drawCircleButton":"\u7ED8\u5236\u5706\u5F62","drawRectButton":"\u7ED8\u5236\u957F\u65B9\u5F62","editButton":"\u7F16\u8F91\u56FE\u5C42","dragButton":"\u62D6\u62FD\u56FE\u5C42","cutButton":"\u526A\u5207\u56FE\u5C42","deleteButton":"\u5220\u9664\u56FE\u5C42","drawCircleMarkerButton":"\u753B\u5706\u5708\u6807\u8BB0","snappingButton":"\u5C06\u62D6\u52A8\u7684\u6807\u8BB0\u6355\u6349\u5230\u5176\u4ED6\u56FE\u5C42\u548C\u9876\u70B9","pinningButton":"\u5C06\u5171\u4EAB\u9876\u70B9\u56FA\u5B9A\u5728\u4E00\u8D77"}}'),D=JSON.parse('{"tooltips":{"placeMarker":"\u55AE\u64CA\u653E\u7F6E\u6A19\u8A18","firstVertex":"\u55AE\u64CA\u653E\u7F6E\u7B2C\u4E00\u500B\u9802\u9EDE","continueLine":"\u55AE\u64CA\u7E7C\u7E8C\u7E6A\u88FD","finishLine":"\u55AE\u64CA\u4EFB\u4F55\u5B58\u5728\u7684\u6A19\u8A18\u4EE5\u5B8C\u6210","finishPoly":"\u55AE\u64CA\u7B2C\u4E00\u500B\u6A19\u8A18\u4EE5\u5B8C\u6210","finishRect":"\u55AE\u64CA\u5B8C\u6210","startCircle":"\u55AE\u64CA\u653E\u7F6E\u5713\u5FC3","finishCircle":"\u55AE\u64CA\u5B8C\u6210\u5713\u5F62","placeCircleMarker":"\u9EDE\u64CA\u653E\u7F6E\u5713\u5F62\u6A19\u8A18"},"actions":{"finish":"\u5B8C\u6210","cancel":"\u53D6\u6D88","removeLastVertex":"\u79FB\u9664\u6700\u5F8C\u4E00\u500B\u9802\u9EDE"},"buttonTitles":{"drawMarkerButton":"\u653E\u7F6E\u6A19\u8A18","drawPolyButton":"\u7E6A\u88FD\u591A\u908A\u5F62","drawLineButton":"\u7E6A\u88FD\u7DDA\u6BB5","drawCircleButton":"\u7E6A\u88FD\u5713\u5F62","drawRectButton":"\u7E6A\u88FD\u65B9\u5F62","editButton":"\u7DE8\u8F2F\u5716\u5F62","dragButton":"\u79FB\u52D5\u5716\u5F62","cutButton":"\u88C1\u5207\u5716\u5F62","deleteButton":"\u522A\u9664\u5716\u5F62","drawCircleMarkerButton":"\u756B\u5713\u5708\u6A19\u8A18","snappingButton":"\u5C07\u62D6\u52D5\u7684\u6A19\u8A18\u5C0D\u9F4A\u5230\u5176\u4ED6\u5716\u5C64\u548C\u9802\u9EDE","pinningButton":"\u5C07\u5171\u4EAB\u9802\u9EDE\u56FA\u5B9A\u5728\u4E00\u8D77"}}'),A={en:v,de:x,it:P,id:T,ro:N,ru:q,es:z,nl:j,fr:R,pt_br:JSON.parse('{"tooltips":{"placeMarker":"Clique para posicionar o marcador","firstVertex":"Clique para posicionar o primeiro v\xE9rtice","continueLine":"Clique para continuar desenhando","finishLine":"Clique em qualquer marcador existente para finalizar","finishPoly":"Clique no primeiro ponto para fechar o pol\xEDgono","finishRect":"Clique para finalizar","startCircle":"Clique para posicionar o centro do c\xEDrculo","finishCircle":"Clique para fechar o c\xEDrculo","placeCircleMarker":"Clique para posicionar o marcador circular"},"actions":{"finish":"Finalizar","cancel":"Cancelar","removeLastVertex":"Remover \xFAltimo v\xE9rtice"},"buttonTitles":{"drawMarkerButton":"Desenhar um marcador","drawPolyButton":"Desenhar um pol\xEDgono","drawLineButton":"Desenhar uma polilinha","drawCircleButton":"Desenhar um c\xEDrculo","drawRectButton":"Desenhar um ret\xE2ngulo","editButton":"Editar camada(s)","dragButton":"Mover camada(s)","cutButton":"Recortar camada(s)","deleteButton":"Remover camada(s)","drawCircleMarkerButton":"Marcador de c\xEDrculos de desenho","snappingButton":"Marcador arrastado para outras camadas e v\xE9rtices","pinningButton":"V\xE9rtices compartilhados de pinos juntos"}}'),zh:B,zh_tw:D,pl:JSON.parse('{"tooltips":{"placeMarker":"Kliknij, aby ustawi\u0107 znacznik","firstVertex":"Kliknij, aby ustawi\u0107 pierwszy punkt","continueLine":"Kliknij, aby kontynuowa\u0107 rysowanie","finishLine":"Kliknij dowolny punkt, aby zako\u0144czy\u0107","finishPoly":"Kliknij pierwszy punkt, aby zako\u0144czy\u0107","finishRect":"Kliknij, aby zako\u0144czy\u0107","startCircle":"Kliknij, aby ustawi\u0107 \u015Brodek ko\u0142a","finishCircle":"Kliknij, aby zako\u0144czy\u0107 rysowanie ko\u0142a","placeCircleMarker":"Kliknij, aby ustawi\u0107 okr\u0105g\u0142y znacznik"},"actions":{"finish":"Zako\u0144cz","cancel":"Anuluj","removeLastVertex":"Usu\u0144 ostatni punkt"},"buttonTitles":{"drawMarkerButton":"Narysuj znacznik","drawPolyButton":"Narysuj wielok\u0105t","drawLineButton":"Narysuj \u015Bcie\u017Ck\u0119","drawCircleButton":"Narysuj ko\u0142o","drawRectButton":"Narysuj prostok\u0105t","editButton":"Edytuj","dragButton":"Przesu\u0144","cutButton":"Wytnij","deleteButton":"Usu\u0144","drawCircleMarkerButton":"Narysuj okr\u0105g\u0142y znacznik","snappingButton":"Snap przeci\u0105gni\u0119ty marker na inne warstwy i wierzcho\u0142ki","pinningButton":"Sworze\u0144 wsp\xF3lne wierzcho\u0142ki razem"}}'),sv:JSON.parse('{"tooltips":{"placeMarker":"Klicka f\xF6r att placera mark\xF6r","firstVertex":"Klicka f\xF6r att placera f\xF6rsta h\xF6rnet","continueLine":"Klicka f\xF6r att forts\xE4tta rita","finishLine":"Klicka p\xE5 en existerande punkt f\xF6r att slutf\xF6ra","finishPoly":"Klicka p\xE5 den f\xF6rsta punkten f\xF6r att slutf\xF6ra","finishRect":"Klicka f\xF6r att slutf\xF6ra","startCircle":"Klicka f\xF6r att placera cirkelns centrum","finishCircle":"Klicka f\xF6r att slutf\xF6ra cirkeln","placeCircleMarker":"Klicka f\xF6r att placera cirkelmark\xF6r"},"actions":{"finish":"Slutf\xF6r","cancel":"Avbryt","removeLastVertex":"Ta bort sista h\xF6rnet"},"buttonTitles":{"drawMarkerButton":"Rita Mark\xF6r","drawPolyButton":"Rita Polygoner","drawLineButton":"Rita Linje","drawCircleButton":"Rita Cirkel","drawRectButton":"Rita Rektangel","editButton":"Redigera Lager","dragButton":"Dra Lager","cutButton":"Klipp i Lager","deleteButton":"Ta bort Lager","drawCircleMarkerButton":"Rita Cirkelmark\xF6r","snappingButton":"Sn\xE4pp dra mark\xF6ren till andra lager och h\xF6rn","pinningButton":"F\xE4st delade h\xF6rn tillsammans"}}'),el:JSON.parse('{"tooltips":{"placeMarker":"\u039A\u03AC\u03BD\u03C4\u03B5 \u03BA\u03BB\u03B9\u03BA \u03B3\u03B9\u03B1 \u03BD\u03B1 \u03C4\u03BF\u03C0\u03BF\u03B8\u03B5\u03C4\u03AE\u03C3\u03B5\u03C4\u03B5 \u0394\u03B5\u03AF\u03BA\u03C4\u03B7","firstVertex":"\u039A\u03AC\u03BD\u03C4\u03B5 \u03BA\u03BB\u03B9\u03BA \u03B3\u03B9\u03B1 \u03BD\u03B1 \u03C4\u03BF\u03C0\u03BF\u03B8\u03B5\u03C4\u03AE\u03C3\u03B5\u03C4\u03B5 \u03C4\u03BF \u03C0\u03C1\u03CE\u03C4\u03BF \u03C3\u03B7\u03BC\u03B5\u03AF\u03BF","continueLine":"\u039A\u03AC\u03BD\u03C4\u03B5 \u03BA\u03BB\u03B9\u03BA \u03B3\u03B9\u03B1 \u03BD\u03B1 \u03C3\u03C5\u03BD\u03B5\u03C7\u03AF\u03C3\u03B5\u03C4\u03B5 \u03BD\u03B1 \u03C3\u03C7\u03B5\u03B4\u03B9\u03AC\u03B6\u03B5\u03C4\u03B5","finishLine":"\u039A\u03AC\u03BD\u03C4\u03B5 \u03BA\u03BB\u03B9\u03BA \u03C3\u03B5 \u03BF\u03C0\u03BF\u03B9\u03BF\u03BD\u03B4\u03AE\u03C0\u03BF\u03C4\u03B5 \u03C5\u03C0\u03AC\u03C1\u03C7\u03BF\u03BD \u03C3\u03B7\u03BC\u03B5\u03AF\u03BF \u03B3\u03B9\u03B1 \u03BD\u03B1 \u03BF\u03BB\u03BF\u03BA\u03BB\u03B7\u03C1\u03C9\u03B8\u03B5\u03AF","finishPoly":"\u039A\u03AC\u03BD\u03C4\u03B5 \u03BA\u03BB\u03B9\u03BA \u03C3\u03C4\u03BF \u03C0\u03C1\u03CE\u03C4\u03BF \u03C3\u03B7\u03BC\u03B5\u03AF\u03BF \u03B3\u03B9\u03B1 \u03BD\u03B1 \u03C4\u03B5\u03BB\u03B5\u03B9\u03CE\u03C3\u03B5\u03C4\u03B5","finishRect":"\u039A\u03AC\u03BD\u03C4\u03B5 \u03BA\u03BB\u03B9\u03BA \u03B3\u03B9\u03B1 \u03BD\u03B1 \u03C4\u03B5\u03BB\u03B5\u03B9\u03CE\u03C3\u03B5\u03C4\u03B5","startCircle":"\u039A\u03AC\u03BD\u03C4\u03B5 \u03BA\u03BB\u03B9\u03BA \u03B3\u03B9\u03B1 \u03BD\u03B1 \u03C4\u03BF\u03C0\u03BF\u03B8\u03B5\u03C4\u03AE\u03C3\u03B5\u03C4\u03B5 \u03BA\u03AD\u03BD\u03C4\u03C1\u03BF \u039A\u03CD\u03BA\u03BB\u03BF\u03C5","finishCircle":"\u039A\u03AC\u03BD\u03C4\u03B5 \u03BA\u03BB\u03B9\u03BA \u03B3\u03B9\u03B1 \u03BD\u03B1 \u03BF\u03BB\u03BF\u03BA\u03BB\u03B7\u03C1\u03CE\u03C3\u03B5\u03C4\u03B5 \u03C4\u03BF\u03BD \u039A\u03CD\u03BA\u03BB\u03BF","placeCircleMarker":"\u039A\u03AC\u03BD\u03C4\u03B5 \u03BA\u03BB\u03B9\u03BA \u03B3\u03B9\u03B1 \u03BD\u03B1 \u03C4\u03BF\u03C0\u03BF\u03B8\u03B5\u03C4\u03AE\u03C3\u03B5\u03C4\u03B5 \u039A\u03C5\u03BA\u03BB\u03B9\u03BA\u03CC \u0394\u03B5\u03AF\u03BA\u03C4\u03B7"},"actions":{"finish":"\u03A4\u03AD\u03BB\u03BF\u03C2","cancel":"\u0391\u03BA\u03CD\u03C1\u03C9\u03C3\u03B7","removeLastVertex":"\u039A\u03B1\u03C4\u03AC\u03C1\u03B3\u03B7\u03C3\u03B7 \u03C4\u03B5\u03BB\u03B5\u03C5\u03C4\u03B1\u03AF\u03BF\u03C5 \u03C3\u03B7\u03BC\u03B5\u03AF\u03BF\u03C5"},"buttonTitles":{"drawMarkerButton":"\u03A3\u03C7\u03B5\u03B4\u03AF\u03B1\u03C3\u03B7 \u0394\u03B5\u03AF\u03BA\u03C4\u03B7","drawPolyButton":"\u03A3\u03C7\u03B5\u03B4\u03AF\u03B1\u03C3\u03B7 \u03A0\u03BF\u03BB\u03C5\u03B3\u03CE\u03BD\u03BF\u03C5","drawLineButton":"\u03A3\u03C7\u03B5\u03B4\u03AF\u03B1\u03C3\u03B7 \u0393\u03C1\u03B1\u03BC\u03BC\u03AE\u03C2","drawCircleButton":"\u03A3\u03C7\u03B5\u03B4\u03AF\u03B1\u03C3\u03B7 \u039A\u03CD\u03BA\u03BB\u03BF\u03C5","drawRectButton":"\u03A3\u03C7\u03B5\u03B4\u03AF\u03B1\u03C3\u03B7 \u039F\u03C1\u03B8\u03BF\u03B3\u03C9\u03BD\u03AF\u03BF\u03C5","editButton":"\u0395\u03C0\u03B5\u03BE\u03B5\u03C1\u03B3\u03B1\u03C3\u03AF\u03B1 \u0395\u03C0\u03B9\u03C0\u03AD\u03B4\u03C9\u03BD","dragButton":"\u039C\u03B5\u03C4\u03B1\u03C6\u03BF\u03C1\u03AC \u0395\u03C0\u03B9\u03C0\u03AD\u03B4\u03C9\u03BD","cutButton":"\u0391\u03C0\u03BF\u03BA\u03BF\u03C0\u03AE \u0395\u03C0\u03B9\u03C0\u03AD\u03B4\u03C9\u03BD","deleteButton":"\u039A\u03B1\u03C4\u03AC\u03C1\u03B3\u03B7\u03C3\u03B7 \u0395\u03C0\u03B9\u03C0\u03AD\u03B4\u03C9\u03BD","drawCircleMarkerButton":"\u03A3\u03C7\u03B5\u03B4\u03AF\u03B1\u03C3\u03B7 \u039A\u03C5\u03BA\u03BB\u03B9\u03BA\u03BF\u03CD \u0394\u03B5\u03AF\u03BA\u03C4\u03B7","snappingButton":"\u03A0\u03C1\u03BF\u03C3\u03BA\u03CC\u03BB\u03BB\u03B7\u03C3\u03B7 \u03C4\u03BF\u03C5 \u0394\u03B5\u03AF\u03BA\u03C4\u03B7 \u03BC\u03B5\u03C4\u03B1\u03C6\u03BF\u03C1\u03AC\u03C2 \u03C3\u03B5 \u03AC\u03BB\u03BB\u03B1 \u0395\u03C0\u03AF\u03C0\u03B5\u03B4\u03B1 \u03BA\u03B1\u03B9 \u039A\u03BF\u03C1\u03C5\u03C6\u03AD\u03C2","pinningButton":"\u03A0\u03B5\u03C1\u03B9\u03BA\u03BF\u03C0\u03AE \u03BA\u03BF\u03B9\u03BD\u03CE\u03BD \u03BA\u03BF\u03C1\u03C5\u03C6\u03CE\u03BD \u03BC\u03B1\u03B6\u03AF"}}'),hu:JSON.parse('{"tooltips":{"placeMarker":"Kattintson a jel\xF6l\u0151 elhelyez\xE9s\xE9hez","firstVertex":"Kattintson az els\u0151 pont elhelyez\xE9s\xE9hez","continueLine":"Kattintson a k\xF6vetkez\u0151 pont elhelyez\xE9s\xE9hez","finishLine":"A befejez\xE9shez kattintson egy megl\xE9v\u0151 pontra","finishPoly":"A befejez\xE9shez kattintson az els\u0151 pontra","finishRect":"Kattintson a befejez\xE9shez","startCircle":"Kattintson a k\xF6r k\xF6z\xE9ppontj\xE1nak elhelyez\xE9s\xE9hez","finishCircle":"Kattintson a k\xF6r befejez\xE9s\xE9hez","placeCircleMarker":"Kattintson a k\xF6rjel\xF6l\u0151 elhelyez\xE9s\xE9hez"},"actions":{"finish":"Befejez\xE9s","cancel":"M\xE9gse","removeLastVertex":"Utols\xF3 pont elt\xE1vol\xEDt\xE1sa"},"buttonTitles":{"drawMarkerButton":"Jel\xF6l\u0151 rajzol\xE1sa","drawPolyButton":"Poligon rajzol\xE1sa","drawLineButton":"Vonal rajzol\xE1sa","drawCircleButton":"K\xF6r rajzol\xE1sa","drawRectButton":"N\xE9gyzet rajzol\xE1sa","editButton":"Elemek szerkeszt\xE9se","dragButton":"Elemek mozgat\xE1sa","cutButton":"Elemek v\xE1g\xE1sa","deleteButton":"Elemek t\xF6rl\xE9se","drawCircleMarkerButton":"K\xF6r jel\xF6l\u0151 rajzol\xE1sa","snappingButton":"Kapcsolja a jel\xF6lt\u0151t m\xE1sik elemhez vagy ponthoz","pinningButton":"K\xF6z\xF6s pontok \xF6sszek\xF6t\xE9se"}}'),da:JSON.parse('{"tooltips":{"placeMarker":"Tryk for at placere en mark\xF8r","firstVertex":"Tryk for at placere det f\xF8rste punkt","continueLine":"Tryk for at forts\xE6tte linjen","finishLine":"Tryk p\xE5 et eksisterende punkt for at afslutte","finishPoly":"Tryk p\xE5 det f\xF8rste punkt for at afslutte","finishRect":"Tryk for at afslutte","startCircle":"Tryk for at placere cirklens center","finishCircle":"Tryk for at afslutte cirklen","placeCircleMarker":"Tryk for at placere en cirkelmark\xF8r"},"actions":{"finish":"Afslut","cancel":"Afbryd","removeLastVertex":"Fjern sidste punkt"},"buttonTitles":{"drawMarkerButton":"Placer mark\xF8r","drawPolyButton":"Tegn polygon","drawLineButton":"Tegn linje","drawCircleButton":"Tegn cirkel","drawRectButton":"Tegn firkant","editButton":"Rediger","dragButton":"Tr\xE6k","cutButton":"Klip","deleteButton":"Fjern","drawCircleMarkerButton":"Tegn cirkelmark\xF8r","snappingButton":"Fastg\xF8r trukket mark\xF8r til andre elementer","pinningButton":"Sammenl\xE6g delte elementer"}}'),no:JSON.parse('{"tooltips":{"placeMarker":"Klikk for \xE5 plassere punkt","firstVertex":"Klikk for \xE5 plassere f\xF8rste punkt","continueLine":"Klikk for \xE5 tegne videre","finishLine":"Klikk p\xE5 et eksisterende punkt for \xE5 fullf\xF8re","finishPoly":"Klikk f\xF8rste punkt for \xE5 fullf\xF8re","finishRect":"Klikk for \xE5 fullf\xF8re","startCircle":"Klikk for \xE5 sette sirkel midtpunkt","finishCircle":"Klikk for \xE5 fullf\xF8re sirkel","placeCircleMarker":"Klikk for \xE5 plassere sirkel"},"actions":{"finish":"Fullf\xF8r","cancel":"Kanseller","removeLastVertex":"Fjern forrige punkt"},"buttonTitles":{"drawMarkerButton":"Tegn Punkt","drawPolyButton":"Tegn Flate","drawLineButton":"Tegn Linje","drawCircleButton":"Tegn Sirkel","drawRectButton":"Tegn rektangel","editButton":"Rediger Objekter","dragButton":"Dra Objekter","cutButton":"Kutt Objekter","deleteButton":"Fjern Objekter","drawCircleMarkerButton":"Tegn sirkel-punkt","snappingButton":"Fest dratt punkt til andre objekter og punkt","pinningButton":"Pin delte punkt sammen"}}'),fa:JSON.parse('{"tooltips":{"placeMarker":"\u06A9\u0644\u06CC\u06A9 \u0628\u0631\u0627\u06CC \u062C\u0627\u0646\u0645\u0627\u06CC\u06CC \u0646\u0634\u0627\u0646","firstVertex":"\u06A9\u0644\u06CC\u06A9 \u0628\u0631\u0627\u06CC \u0631\u0633\u0645 \u0627\u0648\u0644\u06CC\u0646 \u0631\u0623\u0633","continueLine":"\u06A9\u0644\u06CC\u06A9 \u0628\u0631\u0627\u06CC \u0627\u062F\u0627\u0645\u0647 \u0631\u0633\u0645","finishLine":"\u06A9\u0644\u06CC\u06A9 \u0631\u0648\u06CC \u0647\u0631 \u0646\u0634\u0627\u0646 \u0645\u0648\u062C\u0648\u062F \u0628\u0631\u0627\u06CC \u067E\u0627\u06CC\u0627\u0646","finishPoly":"\u06A9\u0644\u06CC\u06A9 \u0631\u0648\u06CC \u0627\u0648\u0644\u06CC\u0646 \u0646\u0634\u0627\u0646 \u0628\u0631\u0627\u06CC \u067E\u0627\u06CC\u0627\u0646","finishRect":"\u06A9\u0644\u06CC\u06A9 \u0628\u0631\u0627\u06CC \u067E\u0627\u06CC\u0627\u0646","startCircle":"\u06A9\u0644\u06CC\u06A9 \u0628\u0631\u0627\u06CC \u0631\u0633\u0645 \u0645\u0631\u06A9\u0632 \u062F\u0627\u06CC\u0631\u0647","finishCircle":"\u06A9\u0644\u06CC\u06A9 \u0628\u0631\u0627\u06CC \u067E\u0627\u06CC\u0627\u0646 \u0631\u0633\u0645 \u062F\u0627\u06CC\u0631\u0647","placeCircleMarker":"\u06A9\u0644\u06CC\u06A9 \u0628\u0631\u0627\u06CC \u0631\u0633\u0645 \u0646\u0634\u0627\u0646 \u062F\u0627\u06CC\u0631\u0647","placeText":"\u06A9\u0644\u06CC\u06A9 \u0628\u0631\u0627\u06CC \u0646\u0648\u0634\u062A\u0646 \u0645\u062A\u0646"},"actions":{"finish":"\u067E\u0627\u06CC\u0627\u0646","cancel":"\u0644\u0641\u0648","removeLastVertex":"\u062D\u0630\u0641 \u0622\u062E\u0631\u06CC\u0646 \u0631\u0623\u0633"},"buttonTitles":{"drawMarkerButton":"\u062F\u0631\u062C \u0646\u0634\u0627\u0646","drawPolyButton":"\u0631\u0633\u0645 \u0686\u0646\u062F\u0636\u0644\u0639\u06CC","drawLineButton":"\u0631\u0633\u0645 \u062E\u0637","drawCircleButton":"\u0631\u0633\u0645 \u062F\u0627\u06CC\u0631\u0647","drawRectButton":"\u0631\u0633\u0645 \u0686\u0647\u0627\u0631\u0636\u0644\u0639\u06CC","editButton":"\u0648\u06CC\u0631\u0627\u06CC\u0634 \u0644\u0627\u06CC\u0647\u200C\u0647\u0627","dragButton":"\u062C\u0627\u0628\u062C\u0627\u06CC\u06CC \u0644\u0627\u06CC\u0647\u200C\u0647\u0627","cutButton":"\u0628\u0631\u0634 \u0644\u0627\u06CC\u0647\u200C\u0647\u0627","deleteButton":"\u062D\u0630\u0641 \u0644\u0627\u06CC\u0647\u200C\u0647\u0627","drawCircleMarkerButton":"\u0631\u0633\u0645 \u0646\u0634\u0627\u0646 \u062F\u0627\u06CC\u0631\u0647","snappingButton":"\u0646\u0634\u0627\u0646\u06AF\u0631 \u0631\u0627 \u0628\u0647 \u0644\u0627\u06CC\u0647\u200C\u0647\u0627 \u0648 \u0631\u0626\u0648\u0633 \u062F\u06CC\u06AF\u0631 \u0628\u06A9\u0634\u06CC\u062F","pinningButton":"\u0631\u0626\u0648\u0633 \u0645\u0634\u062A\u0631\u06A9 \u0631\u0627 \u0628\u0627 \u0647\u0645 \u067E\u06CC\u0646 \u06A9\u0646\u06CC\u062F","rotateButton":"\u0686\u0631\u062E\u0634 \u0644\u0627\u06CC\u0647","drawTextButton":"\u0631\u0633\u0645 \u0645\u062A\u0646"}}'),ua:JSON.parse(`{"tooltips":{"placeMarker":"\u041D\u0430\u0442\u0438\u0441\u043D\u0456\u0442\u044C, \u0449\u043E\u0431 \u043D\u0430\u043D\u0435\u0441\u0442\u0438 \u043C\u0430\u0440\u043A\u0435\u0440","firstVertex":"\u041D\u0430\u0442\u0438\u0441\u043D\u0456\u0442\u044C, \u0449\u043E\u0431 \u043D\u0430\u043D\u0435\u0441\u0442\u0438 \u043F\u0435\u0440\u0448\u0443 \u0432\u0435\u0440\u0448\u0438\u043D\u0443","continueLine":"\u041D\u0430\u0442\u0438\u0441\u043D\u0456\u0442\u044C, \u0449\u043E\u0431 \u043F\u0440\u043E\u0434\u043E\u0432\u0436\u0438\u0442\u0438 \u043C\u0430\u043B\u044E\u0432\u0430\u0442\u0438","finishLine":"\u041D\u0430\u0442\u0438\u0441\u043D\u0456\u0442\u044C \u0431\u0443\u0434\u044C-\u044F\u043A\u0438\u0439 \u0456\u0441\u043D\u0443\u044E\u0447\u0438\u0439 \u043C\u0430\u0440\u043A\u0435\u0440 \u0434\u043B\u044F \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u043D\u044F","finishPoly":"\u0412\u0438\u0431\u0435\u0440\u0456\u0442\u044C \u043F\u0435\u0440\u0448\u0438\u0439 \u043C\u0430\u0440\u043A\u0435\u0440, \u0449\u043E\u0431 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0438","finishRect":"\u041D\u0430\u0442\u0438\u0441\u043D\u0456\u0442\u044C, \u0449\u043E\u0431 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0438","startCircle":"\u041D\u0430\u0442\u0438\u0441\u043D\u0456\u0442\u044C, \u0449\u043E\u0431 \u0434\u043E\u0434\u0430\u0442\u0438 \u0446\u0435\u043D\u0442\u0440 \u043A\u043E\u043B\u0430","finishCircle":"\u041D\u0430\u0442\u0438\u0441\u043D\u0456\u0442\u044C, \u0449\u043E\u0431 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0438 \u043A\u043E\u043B\u043E","placeCircleMarker":"\u041D\u0430\u0442\u0438\u0441\u043D\u0456\u0442\u044C, \u0449\u043E\u0431 \u043D\u0430\u043D\u0435\u0441\u0442\u0438 \u043A\u0440\u0443\u0433\u043E\u0432\u0438\u0439 \u043C\u0430\u0440\u043A\u0435\u0440"},"actions":{"finish":"\u0417\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0438","cancel":"\u0412\u0456\u0434\u043C\u0456\u043D\u0438\u0442\u0438","removeLastVertex":"\u0412\u0438\u0434\u0430\u043B\u0438\u0442\u0438 \u043F\u043E\u043F\u0435\u0440\u0435\u0434\u043D\u044E \u0432\u0435\u0440\u0448\u0438\u043D\u0443"},"buttonTitles":{"drawMarkerButton":"\u041C\u0430\u043B\u044E\u0432\u0430\u0442\u0438 \u043C\u0430\u0440\u043A\u0435\u0440","drawPolyButton":"\u041C\u0430\u043B\u044E\u0432\u0430\u0442\u0438 \u043F\u043E\u043B\u0456\u0433\u043E\u043D","drawLineButton":"\u041C\u0430\u043B\u044E\u0432\u0430\u0442\u0438 \u043A\u0440\u0438\u0432\u0443","drawCircleButton":"\u041C\u0430\u043B\u044E\u0432\u0430\u0442\u0438 \u043A\u043E\u043B\u043E","drawRectButton":"\u041C\u0430\u043B\u044E\u0432\u0430\u0442\u0438 \u043F\u0440\u044F\u043C\u043E\u043A\u0443\u0442\u043D\u0438\u043A","editButton":"\u0420\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u0442\u0438 \u0448\u0430\u0440\u0438","dragButton":"\u041F\u0435\u0440\u0435\u043D\u0435\u0441\u0442\u0438 \u0448\u0430\u0440\u0438","cutButton":"\u0412\u0438\u0440\u0456\u0437\u0430\u0442\u0438 \u0448\u0430\u0440\u0438","deleteButton":"\u0412\u0438\u0434\u0430\u043B\u0438\u0442\u0438 \u0448\u0430\u0440\u0438","drawCircleMarkerButton":"\u041C\u0430\u043B\u044E\u0432\u0430\u0442\u0438 \u043A\u0440\u0443\u0433\u043E\u0432\u0438\u0439 \u043C\u0430\u0440\u043A\u0435\u0440","snappingButton":"\u041F\u0440\u0438\u0432\u2019\u044F\u0437\u0430\u0442\u0438 \u043F\u0435\u0440\u0435\u0442\u044F\u0433\u043D\u0443\u0442\u0438\u0439 \u043C\u0430\u0440\u043A\u0435\u0440 \u0434\u043E \u0456\u043D\u0448\u0438\u0445 \u0448\u0430\u0440\u0456\u0432 \u0442\u0430 \u0432\u0435\u0440\u0448\u0438\u043D","pinningButton":"\u0417\u0432'\u044F\u0437\u0430\u0442\u0438 \u0441\u043F\u0456\u043B\u044C\u043D\u0456 \u0432\u0435\u0440\u0448\u0438\u043D\u0438 \u0440\u0430\u0437\u043E\u043C"}}`),tr:JSON.parse('{"tooltips":{"placeMarker":"\u0130\u015Faret\xE7i yerle\u015Ftirmek i\xE7in t\u0131klay\u0131n","firstVertex":"\u0130lk tepe noktas\u0131n\u0131 yerle\u015Ftirmek i\xE7in t\u0131klay\u0131n","continueLine":"\xC7izime devam etmek i\xE7in t\u0131klay\u0131n","finishLine":"Bitirmek i\xE7in mevcut herhangi bir i\u015Faret\xE7iyi t\u0131klay\u0131n","finishPoly":"Bitirmek i\xE7in ilk i\u015Faret\xE7iyi t\u0131klay\u0131n","finishRect":"Bitirmek i\xE7in t\u0131klay\u0131n","startCircle":"Daire merkezine yerle\u015Ftirmek i\xE7in t\u0131klay\u0131n","finishCircle":"Daireyi bitirmek i\xE7in t\u0131klay\u0131n","placeCircleMarker":"Daire i\u015Faret\xE7isi yerle\u015Ftirmek i\xE7in t\u0131klay\u0131n"},"actions":{"finish":"Bitir","cancel":"\u0130ptal","removeLastVertex":"Son k\xF6\u015Feyi kald\u0131r"},"buttonTitles":{"drawMarkerButton":"\xC7izim \u0130\u015Faret\xE7isi","drawPolyButton":"\xC7okgenler \xE7iz","drawLineButton":"\xC7oklu \xE7izgi \xE7iz","drawCircleButton":"\xC7ember \xE7iz","drawRectButton":"Dikd\xF6rtgen \xE7iz","editButton":"Katmanlar\u0131 d\xFCzenle","dragButton":"Katmanlar\u0131 s\xFCr\xFCkle","cutButton":"Katmanlar\u0131 kes","deleteButton":"Katmanlar\u0131 kald\u0131r","drawCircleMarkerButton":"Daire i\u015Faret\xE7isi \xE7iz","snappingButton":"S\xFCr\xFCklenen i\u015Faret\xE7iyi di\u011Fer katmanlara ve k\xF6\u015Felere yap\u0131\u015Ft\u0131r","pinningButton":"Payla\u015F\u0131lan k\xF6\u015Feleri birbirine sabitle"}}'),cz:JSON.parse('{"tooltips":{"placeMarker":"Kliknut\xEDm vytvo\u0159\xEDte zna\u010Dku","firstVertex":"Kliknut\xEDm vytvo\u0159\xEDte prvn\xED objekt","continueLine":"Kliknut\xEDm pokra\u010Dujte v kreslen\xED","finishLine":"Kliknut\xED na libovolnou existuj\xEDc\xED zna\u010Dku pro dokon\u010Den\xED","finishPoly":"Vyberte prvn\xED bod pro dokon\u010Den\xED","finishRect":"Klikn\u011Bte pro dokon\u010Den\xED","startCircle":"Kliknut\xEDm p\u0159idejte st\u0159ed kruhu","finishCircle":"\u041D\u0430\u0436\u043C\u0438\u0442\u0435, \u0447\u0442\u043E\u0431\u044B \u0437\u0430\u0434\u0430\u0442\u044C \u0440\u0430\u0434\u0438\u0443\u0441","placeCircleMarker":"Kliknut\xEDm nastavte polom\u011Br"},"actions":{"finish":"Dokon\u010Dit","cancel":"Zru\u0161it","removeLastVertex":"Zru\u0161it posledn\xED akci"},"buttonTitles":{"drawMarkerButton":"P\u0159idat zna\u010Dku","drawPolyButton":"Nakreslit polygon","drawLineButton":"Nakreslit k\u0159ivku","drawCircleButton":"Nakreslit kruh","drawRectButton":"Nakreslit obd\xE9ln\xEDk","editButton":"Upravit vrstvu","dragButton":"P\u0159eneste vrstvu","cutButton":"Vyjmout vrstvu","deleteButton":"Smazat vrstvu","drawCircleMarkerButton":"P\u0159idat kruhovou zna\u010Dku","snappingButton":"Nav\xE1zat ta\u017Enou zna\u010Dku k dal\u0161\xEDm vrstv\xE1m a vrchol\u016Fm","pinningButton":"Spojit spole\u010Dn\xE9 body dohromady"}}'),ja:JSON.parse('{"tooltips":{"placeMarker":"\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u30DE\u30FC\u30AB\u30FC\u3092\u914D\u7F6E","firstVertex":"\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u6700\u521D\u306E\u9802\u70B9\u3092\u914D\u7F6E","continueLine":"\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u63CF\u753B\u3092\u7D9A\u3051\u308B","finishLine":"\u4EFB\u610F\u306E\u30DE\u30FC\u30AB\u30FC\u3092\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u7D42\u4E86","finishPoly":"\u6700\u521D\u306E\u30DE\u30FC\u30AB\u30FC\u3092\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u7D42\u4E86","finishRect":"\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u7D42\u4E86","startCircle":"\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u5186\u306E\u4E2D\u5FC3\u3092\u914D\u7F6E","finishCircle":"\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u5186\u306E\u63CF\u753B\u3092\u7D42\u4E86","placeCircleMarker":"\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u5186\u30DE\u30FC\u30AB\u30FC\u3092\u914D\u7F6E","placeText":"\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u30C6\u30AD\u30B9\u30C8\u3092\u914D\u7F6E"},"actions":{"finish":"\u7D42\u4E86","cancel":"\u30AD\u30E3\u30F3\u30BB\u30EB","removeLastVertex":"\u6700\u5F8C\u306E\u9802\u70B9\u3092\u524A\u9664"},"buttonTitles":{"drawMarkerButton":"\u30DE\u30FC\u30AB\u30FC\u3092\u63CF\u753B","drawPolyButton":"\u30DD\u30EA\u30B4\u30F3\u3092\u63CF\u753B","drawLineButton":"\u6298\u308C\u7DDA\u3092\u63CF\u753B","drawCircleButton":"\u5186\u3092\u63CF\u753B","drawRectButton":"\u77E9\u5F62\u3092\u63CF\u753B","editButton":"\u30EC\u30A4\u30E4\u30FC\u3092\u7DE8\u96C6","dragButton":"\u30EC\u30A4\u30E4\u30FC\u3092\u30C9\u30E9\u30C3\u30B0","cutButton":"\u30EC\u30A4\u30E4\u30FC\u3092\u5207\u308A\u53D6\u308A","deleteButton":"\u30EC\u30A4\u30E4\u30FC\u3092\u524A\u9664","drawCircleMarkerButton":"\u5186\u30DE\u30FC\u30AB\u30FC\u3092\u63CF\u753B","snappingButton":"\u30C9\u30E9\u30C3\u30B0\u3057\u305F\u30DE\u30FC\u30AB\u30FC\u3092\u4ED6\u306E\u30EC\u30A4\u30E4\u30FC\u3084\u9802\u70B9\u306B\u30B9\u30CA\u30C3\u30D7\u3059\u308B","pinningButton":"\u5171\u6709\u3059\u308B\u9802\u70B9\u3092\u540C\u6642\u306B\u52D5\u304B\u3059","rotateButton":"\u30EC\u30A4\u30E4\u30FC\u3092\u56DE\u8EE2","drawTextButton":"\u30C6\u30AD\u30B9\u30C8\u3092\u63CF\u753B"}}'),fi:JSON.parse('{"tooltips":{"placeMarker":"Klikkaa asettaaksesi merkin","firstVertex":"Klikkaa asettaakseni ensimm\xE4isen osuuden","continueLine":"Klikkaa jatkaaksesi piirt\xE4mist\xE4","finishLine":"Klikkaa olemassa olevaa merkki\xE4 lopettaaksesi","finishPoly":"Klikkaa ensimm\xE4ist\xE4 merkki\xE4 lopettaaksesi","finishRect":"Klikkaa lopettaaksesi","startCircle":"Klikkaa asettaaksesi ympyr\xE4n keskipisteen","finishCircle":"Klikkaa lopettaaksesi ympyr\xE4n","placeCircleMarker":"Klikkaa asettaaksesi ympyr\xE4merkin","placeText":"Klikkaa asettaaksesi tekstin"},"actions":{"finish":"Valmis","cancel":"Peruuta","removeLastVertex":"Poista viimeinen osuus"},"buttonTitles":{"drawMarkerButton":"Piirr\xE4 merkkej\xE4","drawPolyButton":"Piirr\xE4 monikulmioita","drawLineButton":"Piirr\xE4 viivoja","drawCircleButton":"Piirr\xE4 ympyr\xE4","drawRectButton":"Piirr\xE4 neliskulmioita","editButton":"Muokkaa","dragButton":"Siirr\xE4","cutButton":"Leikkaa","deleteButton":"Poista","drawCircleMarkerButton":"Piirr\xE4 ympyr\xE4merkki","snappingButton":"Kiinnit\xE4 siirrett\xE4v\xE4 merkki toisiin muotoihin","pinningButton":"Kiinnit\xE4 jaetut muodot yhteen","rotateButton":"K\xE4\xE4nn\xE4","drawTextButton":"Piirr\xE4 teksti\xE4"}}'),ko:JSON.parse('{"tooltips":{"placeMarker":"\uB9C8\uCEE4 \uC704\uCE58\uB97C \uD074\uB9AD\uD558\uC138\uC694","firstVertex":"\uCCAB\uBC88\uC9F8 \uAF2D\uC9C0\uC810 \uC704\uCE58\uC744 \uD074\uB9AD\uD558\uC138\uC694","continueLine":"\uACC4\uC18D \uADF8\uB9AC\uB824\uBA74 \uD074\uB9AD\uD558\uC138\uC694","finishLine":"\uB05D\uB0B4\uB824\uBA74 \uAE30\uC874 \uB9C8\uCEE4\uB97C \uD074\uB9AD\uD558\uC138\uC694","finishPoly":"\uB05D\uB0B4\uB824\uBA74 \uCC98\uC74C \uB9C8\uCEE4\uB97C \uD074\uB9AD\uD558\uC138\uC694","finishRect":"\uB05D\uB0B4\uB824\uBA74 \uD074\uB9AD\uD558\uC138\uC694","startCircle":"\uC6D0\uC758 \uC911\uC2EC\uC774 \uB420 \uC704\uCE58\uB97C \uD074\uB9AD\uD558\uC138\uC694","finishCircle":"\uC6D0\uC744 \uB05D\uB0B4\uB824\uBA74 \uD074\uB9AD\uD558\uC138\uC694","placeCircleMarker":"\uC6D0 \uB9C8\uCEE4 \uC704\uCE58\uB97C \uD074\uB9AD\uD558\uC138\uC694","placeText":"\uD14D\uC2A4\uD2B8 \uC704\uCE58\uB97C \uD074\uB9AD\uD558\uC138\uC694"},"actions":{"finish":"\uB05D\uB0B4\uAE30","cancel":"\uCDE8\uC18C","removeLastVertex":"\uB9C8\uC9C0\uB9C9 \uAF2D\uC9C0\uC810 \uC81C\uAC70"},"buttonTitles":{"drawMarkerButton":"\uB9C8\uCEE4 \uADF8\uB9AC\uAE30","drawPolyButton":"\uB2E4\uAC01\uD615 \uADF8\uB9AC\uAE30","drawLineButton":"\uB2E4\uAC01\uC120 \uADF8\uB9AC\uAE30","drawCircleButton":"\uC6D0 \uADF8\uB9AC\uAE30","drawRectButton":"\uC9C1\uC0AC\uAC01\uD615 \uADF8\uB9AC\uAE30","editButton":"\uB808\uC774\uC5B4 \uD3B8\uC9D1\uD558\uAE30","dragButton":"\uB808\uC774\uC5B4 \uB04C\uAE30","cutButton":"\uB808\uC774\uC5B4 \uC790\uB974\uAE30","deleteButton":"\uB808\uC774\uC5B4 \uC81C\uAC70\uD558\uAE30","drawCircleMarkerButton":"\uC6D0 \uB9C8\uCEE4 \uADF8\uB9AC\uAE30","snappingButton":"\uC7A1\uC544\uB048 \uB9C8\uCEE4\uB97C \uB2E4\uB978 \uB808\uC774\uC5B4 \uBC0F \uAF2D\uC9C0\uC810\uC5D0 \uB4E4\uB7EC\uBD99\uAC8C \uD558\uAE30","pinningButton":"\uACF5\uC720 \uAF2D\uC9C0\uC810\uC744 \uD568\uAED8 \uCC0D\uAE30","rotateButton":"\uB808\uC774\uC5B4 \uD68C\uC804\uD558\uAE30","drawTextButton":"\uD14D\uC2A4\uD2B8 \uADF8\uB9AC\uAE30"}}')};function G(h,p){var _=Object.keys(h);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(h);p&&(E=E.filter(function(I){return Object.getOwnPropertyDescriptor(h,I).enumerable})),_.push.apply(_,E)}return _}function H(h){for(var p=1;p0&&arguments[0]!==void 0?arguments[0]:this.globalOptions;this.globalEditModeEnabled()?this.disableGlobalEditMode():this.enableGlobalEditMode(h)},handleLayerAdditionInGlobalEditMode:function(){var h=this._addedLayers;for(var p in this._addedLayers={},h){var _=h[p];this._isRelevantForEdit(_)&&this.globalEditModeEnabled()&&_.pm.enable(H({},this.globalOptions))}},_layerAdded:function(h){var p=h.layer;this._addedLayers[L.stamp(p)]=p},_isRelevantForEdit:function(h){return h.pm&&!(h instanceof L.LayerGroup)&&(!L.PM.optIn&&!h.options.pmIgnore||L.PM.optIn&&h.options.pmIgnore===!1)&&!h._pmTempLayer&&h.pm.options.allowEditing}},X={_globalDragModeEnabled:!1,enableGlobalDragMode:function(){var h=L.PM.Utils.findLayers(this.map);this._globalDragModeEnabled=!0,this._addedLayersDrag={},h.forEach(function(p){p.pm.enableLayerDrag()}),this.throttledReInitDrag||(this.throttledReInitDrag=L.Util.throttle(this.reinitGlobalDragMode,100,this)),this.map.on("layeradd",this._layerAddedDrag,this),this.map.on("layeradd",this.throttledReInitDrag,this),this.Toolbar.toggleButton("dragMode",this.globalDragModeEnabled()),this._fireGlobalDragModeToggled(!0)},disableGlobalDragMode:function(){var h=L.PM.Utils.findLayers(this.map);this._globalDragModeEnabled=!1,h.forEach(function(p){p.pm.disableLayerDrag()}),this.map.off("layeradd",this._layerAddedDrag,this),this.map.off("layeradd",this.throttledReInitDrag,this),this.Toolbar.toggleButton("dragMode",this.globalDragModeEnabled()),this._fireGlobalDragModeToggled(!1)},globalDragModeEnabled:function(){return!!this._globalDragModeEnabled},toggleGlobalDragMode:function(){this.globalDragModeEnabled()?this.disableGlobalDragMode():this.enableGlobalDragMode()},reinitGlobalDragMode:function(){var h=this._addedLayersDrag;for(var p in this._addedLayersDrag={},h){var _=h[p];this._isRelevantForDrag(_)&&this.globalDragModeEnabled()&&_.pm.enableLayerDrag()}},_layerAddedDrag:function(h){var p=h.layer;this._addedLayersDrag[L.stamp(p)]=p},_isRelevantForDrag:function(h){return h.pm&&!(h instanceof L.LayerGroup)&&(!L.PM.optIn&&!h.options.pmIgnore||L.PM.optIn&&h.options.pmIgnore===!1)&&!h._pmTempLayer&&h.pm.options.draggable}},lt={_globalRemovalModeEnabled:!1,enableGlobalRemovalMode:function(){var h=this;this._globalRemovalModeEnabled=!0,this.map.eachLayer(function(p){h._isRelevantForRemoval(p)&&(p.pm.disable(),p.on("click",h.removeLayer,h))}),this.throttledReInitRemoval||(this.throttledReInitRemoval=L.Util.throttle(this.reinitGlobalRemovalMode,100,this)),this.map.on("layeradd",this.throttledReInitRemoval,this),this.Toolbar.toggleButton("removalMode",this.globalRemovalModeEnabled()),this._fireGlobalRemovalModeToggled(!0)},disableGlobalRemovalMode:function(){var h=this;this._globalRemovalModeEnabled=!1,this.map.eachLayer(function(p){p.off("click",h.removeLayer,h)}),this.map.off("layeradd",this.throttledReInitRemoval,this),this.Toolbar.toggleButton("removalMode",this.globalRemovalModeEnabled()),this._fireGlobalRemovalModeToggled(!1)},globalRemovalEnabled:function(){return this.globalRemovalModeEnabled()},globalRemovalModeEnabled:function(){return!!this._globalRemovalModeEnabled},toggleGlobalRemovalMode:function(){this.globalRemovalModeEnabled()?this.disableGlobalRemovalMode():this.enableGlobalRemovalMode()},reinitGlobalRemovalMode:function(h){var p=h.layer;this._isRelevantForRemoval(p)&&this.globalRemovalModeEnabled()&&(this.disableGlobalRemovalMode(),this.enableGlobalRemovalMode())},removeLayer:function(h){var p=h.target;this._isRelevantForRemoval(p)&&!p.pm.dragging()&&(p.removeFrom(this.map.pm._getContainingLayer()),p.remove(),p instanceof L.LayerGroup?(this._fireRemoveLayerGroup(p),this._fireRemoveLayerGroup(this.map,p)):(p.pm._fireRemove(p),p.pm._fireRemove(this.map,p)))},_isRelevantForRemoval:function(h){return h.pm&&!(h instanceof L.LayerGroup)&&(!L.PM.optIn&&!h.options.pmIgnore||L.PM.optIn&&h.options.pmIgnore===!1)&&!h._pmTempLayer&&h.pm.options.allowRemoval}},gt={_globalRotateModeEnabled:!1,enableGlobalRotateMode:function(){var h=this;this._globalRotateModeEnabled=!0,L.PM.Utils.findLayers(this.map).filter(function(p){return p instanceof L.Polyline}).forEach(function(p){h._isRelevantForRotate(p)&&p.pm.enableRotate()}),this.throttledReInitRotate||(this.throttledReInitRotate=L.Util.throttle(this._reinitGlobalRotateMode,100,this)),this.map.on("layeradd",this.throttledReInitRotate,this),this.Toolbar.toggleButton("rotateMode",this.globalRotateModeEnabled()),this._fireGlobalRotateModeToggled()},disableGlobalRotateMode:function(){this._globalRotateModeEnabled=!1,L.PM.Utils.findLayers(this.map).filter(function(h){return h instanceof L.Polyline}).forEach(function(h){h.pm.disableRotate()}),this.map.off("layeradd",this.throttledReInitRotate,this),this.Toolbar.toggleButton("rotateMode",this.globalRotateModeEnabled()),this._fireGlobalRotateModeToggled()},globalRotateModeEnabled:function(){return!!this._globalRotateModeEnabled},toggleGlobalRotateMode:function(){this.globalRotateModeEnabled()?this.disableGlobalRotateMode():this.enableGlobalRotateMode()},_reinitGlobalRotateMode:function(h){var p=h.layer;this._isRelevantForRotate(p)&&this.globalRotateModeEnabled()&&(this.disableGlobalRotateMode(),this.enableGlobalRotateMode())},_isRelevantForRotate:function(h){return h.pm&&!(h instanceof L.LayerGroup)&&(!L.PM.optIn&&!h.options.pmIgnore||L.PM.optIn&&h.options.pmIgnore===!1)&&!h._pmTempLayer&&h.pm.options.allowRotation}};function Et(h,p){var _=Object.keys(h);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(h);p&&(E=E.filter(function(I){return Object.getOwnPropertyDescriptor(h,I).enumerable})),_.push.apply(_,E)}return _}function Q(h){for(var p=1;p0&&arguments[0]!==void 0?arguments[0]:"Draw",p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.__fire(this._map,"pm:drawstart",{shape:this._shape,workingLayer:this._layer},h,p)},_fireDrawEnd:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"Draw",p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.__fire(this._map,"pm:drawend",{shape:this._shape},h,p)},_fireCreate:function(h){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Draw",_=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.__fire(this._map,"pm:create",{shape:this._shape,marker:h,layer:h},p,_)},_fireCenterPlaced:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"Draw",p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},_=h==="Draw"?this._layer:void 0,E=h!=="Draw"?this._layer:void 0;this.__fire(this._layer,"pm:centerplaced",{shape:this._shape,workingLayer:_,layer:E,latlng:this._layer.getLatLng()},h,p)},_fireCut:function(h,p,_){var E=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"Draw",I=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{};this.__fire(h,"pm:cut",{shape:this._shape,layer:p,originalLayer:_},E,I)},_fireEdit:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this._layer,p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Edit",_=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.__fire(h,"pm:edit",{layer:this._layer,shape:this.getShape()},p,_)},_fireEnable:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"Edit",p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.__fire(this._layer,"pm:enable",{layer:this._layer,shape:this.getShape()},h,p)},_fireDisable:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"Edit",p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.__fire(this._layer,"pm:disable",{layer:this._layer,shape:this.getShape()},h,p)},_fireUpdate:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"Edit",p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.__fire(this._layer,"pm:update",{layer:this._layer,shape:this.getShape()},h,p)},_fireMarkerDragStart:function(h){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,_=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"Edit",E=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};this.__fire(this._layer,"pm:markerdragstart",{layer:this._layer,markerEvent:h,shape:this.getShape(),indexPath:p},_,E)},_fireMarkerDrag:function(h){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,_=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"Edit",E=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};this.__fire(this._layer,"pm:markerdrag",{layer:this._layer,markerEvent:h,shape:this.getShape(),indexPath:p},_,E)},_fireMarkerDragEnd:function(h){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,_=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,E=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"Edit",I=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{};this.__fire(this._layer,"pm:markerdragend",{layer:this._layer,markerEvent:h,shape:this.getShape(),indexPath:p,intersectionReset:_},E,I)},_fireDragStart:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"Edit",p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.__fire(this._layer,"pm:dragstart",{layer:this._layer,shape:this.getShape()},h,p)},_fireDrag:function(h){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Edit",_=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.__fire(this._layer,"pm:drag",Q(Q({},h),{},{shape:this.getShape()}),p,_)},_fireDragEnd:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"Edit",p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.__fire(this._layer,"pm:dragend",{layer:this._layer,shape:this.getShape()},h,p)},_fireDragEnable:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"Edit",p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.__fire(this._layer,"pm:dragenable",{layer:this._layer,shape:this.getShape()},h,p)},_fireDragDisable:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"Edit",p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.__fire(this._layer,"pm:dragdisable",{layer:this._layer,shape:this.getShape()},h,p)},_fireRemove:function(h){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h,_=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"Edit",E=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};this.__fire(h,"pm:remove",{layer:p,shape:this.getShape()},_,E)},_fireVertexAdded:function(h,p,_){var E=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"Edit",I=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{};this.__fire(this._layer,"pm:vertexadded",{layer:this._layer,workingLayer:this._layer,marker:h,indexPath:p,latlng:_,shape:this.getShape()},E,I)},_fireVertexRemoved:function(h,p){var _=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"Edit",E=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};this.__fire(this._layer,"pm:vertexremoved",{layer:this._layer,marker:h,indexPath:p,shape:this.getShape()},_,E)},_fireVertexClick:function(h,p){var _=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"Edit",E=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};this.__fire(this._layer,"pm:vertexclick",{layer:this._layer,markerEvent:h,indexPath:p,shape:this.getShape()},_,E)},_fireIntersect:function(h){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Edit",_=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.__fire(this._layer,"pm:intersect",{layer:this._layer,intersection:h,shape:this.getShape()},p,_)},_fireLayerReset:function(h,p){var _=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"Edit",E=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};this.__fire(this._layer,"pm:layerreset",{layer:this._layer,markerEvent:h,indexPath:p,shape:this.getShape()},_,E)},_fireChange:function(h){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Edit",_=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.__fire(this._layer,"pm:change",{layer:this._layer,latlngs:h,shape:this.getShape()},p,_)},_fireTextChange:function(h){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Edit",_=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.__fire(this._layer,"pm:textchange",{layer:this._layer,text:h,shape:this.getShape()},p,_)},_fireTextFocus:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"Edit",p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.__fire(this._layer,"pm:textfocus",{layer:this._layer,shape:this.getShape()},h,p)},_fireTextBlur:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"Edit",p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.__fire(this._layer,"pm:textblur",{layer:this._layer,shape:this.getShape()},h,p)},_fireSnapDrag:function(h,p){var _=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"Snapping",E=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};this.__fire(h,"pm:snapdrag",p,_,E)},_fireSnap:function(h,p){var _=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"Snapping",E=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};this.__fire(h,"pm:snap",p,_,E)},_fireUnsnap:function(h,p){var _=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"Snapping",E=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};this.__fire(h,"pm:unsnap",p,_,E)},_fireRotationEnable:function(h,p){var _=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"Rotation",E=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};this.__fire(h,"pm:rotateenable",{layer:this._layer,helpLayer:this._rotatePoly,shape:this.getShape()},_,E)},_fireRotationDisable:function(h){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Rotation",_=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.__fire(h,"pm:rotatedisable",{layer:this._layer,shape:this.getShape()},p,_)},_fireRotationStart:function(h,p){var _=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"Rotation",E=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};this.__fire(h,"pm:rotatestart",{layer:this._rotationLayer,helpLayer:this._layer,startAngle:this._startAngle,originLatLngs:p},_,E)},_fireRotation:function(h,p,_){var E=arguments.length>3&&arguments[3]!==void 0?arguments[3]:this._rotationLayer,I=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"Rotation",V=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};this.__fire(h,"pm:rotate",{layer:E,helpLayer:this._layer,startAngle:this._startAngle,angle:E.pm.getAngle(),angleDiff:p,oldLatLngs:_,newLatLngs:E.getLatLngs()},I,V)},_fireRotationEnd:function(h,p,_){var E=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"Rotation",I=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{};this.__fire(h,"pm:rotateend",{layer:this._rotationLayer,helpLayer:this._layer,startAngle:p,angle:this._rotationLayer.pm.getAngle(),originLatLngs:_,newLatLngs:this._rotationLayer.getLatLngs()},E,I)},_fireActionClick:function(h,p,_){var E=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"Toolbar",I=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{};this.__fire(this._map,"pm:actionclick",{text:h.text,action:h,btnName:p,button:_},E,I)},_fireButtonClick:function(h,p){var _=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"Toolbar",E=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};this.__fire(this._map,"pm:buttonclick",{btnName:h,button:p},_,E)},_fireLangChange:function(h,p,_,E){var I=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"Global",V=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};this.__fire(this.map,"pm:langchange",{oldLang:h,activeLang:p,fallback:_,translations:E},I,V)},_fireGlobalDragModeToggled:function(h){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Global",_=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.__fire(this.map,"pm:globaldragmodetoggled",{enabled:h,map:this.map},p,_)},_fireGlobalEditModeToggled:function(h){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Global",_=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.__fire(this.map,"pm:globaleditmodetoggled",{enabled:h,map:this.map},p,_)},_fireGlobalRemovalModeToggled:function(h){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Global",_=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.__fire(this.map,"pm:globalremovalmodetoggled",{enabled:h,map:this.map},p,_)},_fireGlobalCutModeToggled:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"Global",p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.__fire(this._map,"pm:globalcutmodetoggled",{enabled:!!this._enabled,map:this._map},h,p)},_fireGlobalDrawModeToggled:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"Global",p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.__fire(this._map,"pm:globaldrawmodetoggled",{enabled:this._enabled,shape:this._shape,map:this._map},h,p)},_fireGlobalRotateModeToggled:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"Global",p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.__fire(this.map,"pm:globalrotatemodetoggled",{enabled:this.globalRotateModeEnabled(),map:this.map},h,p)},_fireRemoveLayerGroup:function(h){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h,_=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"Edit",E=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};this.__fire(h,"pm:remove",{layer:p,shape:void 0},_,E)},_fireKeyeventEvent:function(h,p,_){var E=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"Global",I=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{};this.__fire(this.map,"pm:keyevent",{event:h,eventType:p,focusOn:_},E,I)},__fire:function(h,p,_,E){var I=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{};_=m()(_,I,{source:E}),L.PM.Utils._fireEvent(h,p,_)}};let bt=ct,Mt={_lastEvents:{keydown:void 0,keyup:void 0,current:void 0},_initKeyListener:function(h){this.map=h,L.DomEvent.on(document,"keydown keyup",this._onKeyListener,this),L.DomEvent.on(window,"blur",this._onBlur,this)},_onKeyListener:function(h){var p="document";this.map.getContainer().contains(h.target)&&(p="map");var _={event:h,eventType:h.type,focusOn:p};this._lastEvents[h.type]=_,this._lastEvents.current=_,this.map.pm._fireKeyeventEvent(h,h.type,p)},_onBlur:function(h){h.altKey=!1;var p={event:h,eventType:h.type,focusOn:"document"};this._lastEvents[h.type]=p,this._lastEvents.current=p},getLastKeyEvent:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"current";return this._lastEvents[h]},isShiftKeyPressed:function(){var h;return(h=this._lastEvents.current)===null||h===void 0?void 0:h.event.shiftKey},isAltKeyPressed:function(){var h;return(h=this._lastEvents.current)===null||h===void 0?void 0:h.event.altKey},isCtrlKeyPressed:function(){var h;return(h=this._lastEvents.current)===null||h===void 0?void 0:h.event.ctrlKey},isMetaKeyPressed:function(){var h;return(h=this._lastEvents.current)===null||h===void 0?void 0:h.event.metaKey},getPressedKey:function(){var h;return(h=this._lastEvents.current)===null||h===void 0?void 0:h.event.key}};var Xt=c(7361),ft=c.n(Xt),Ct=c(8721),st=c.n(Ct);function Rt(h){var p=L.PM.activeLang;return st()(A,p)||(p="en"),ft()(A[p],h)}function Ot(h){for(var p=0;p1e-12;)E=Math.cos(2*Ie+ki),Gi=ki,ki=Pt/(it*no)+lr*(I=Math.sin(ki))*(E+lr/4*((V=Math.cos(ki))*(2*E*E-1)-lr/6*E*(4*I*I-3)*(4*E*E-3)));var Eo=Tn*I-Rn*V*te,Zn=Math.atan2(Tn*V+Rn*I*te,(1-rt)*Math.sqrt(Ar*Ar+Eo*Eo)),Yt=rt/16*Si*(4+rt*(4-3*Si)),aa=ot+180*(Math.atan2(I*Gt,Rn*V-Tn*I*te)-(1-Yt)*rt*Ar*(ki+Yt*I*(E+Yt*V*(2*E*E-1))))/yt,Qo=180*Zn/yt;return L.latLng(aa,Qo)}function ce(h,p,_,E){for(var I,V,nt=!(arguments.length>4&&arguments[4]!==void 0)||arguments[4],it=[],rt=0;rt<_;rt+=1){if(nt)I=Tt(h,360*rt/_+E,p),V=L.latLng(I.lng,I.lat);else{var ot=h.lat+Math.cos(2*rt*Math.PI/_)*p,dt=h.lng+Math.sin(2*rt*Math.PI/_)*p;V=L.latLng(ot,dt)}it.push(V)}return it}function Re(h,p,_,E){var I=function(V,nt,it){var rt=V.latLngToContainerPoint(nt),ot=V.latLngToContainerPoint(it),dt=180*Math.atan2(ot.y-rt.y,ot.x-rt.x)/Math.PI+90;return dt+(dt<0?360:0)}(h,p,_);return function(V,nt,it){nt=(nt+360)%360;var rt=Math.PI/180,ot=180/Math.PI,dt=6378137,Pt=V.lng*rt,yt=V.lat*rt,At=nt*rt,Gt=Math.sin(yt),te=Math.cos(yt),Dt=Math.cos(it/dt),Rn=Math.sin(it/dt),Tn=Math.asin(Gt*Dt+te*Rn*Math.cos(At)),Ie=Pt+Math.atan2(Math.sin(At)*Rn*te,Dt-Gt*Math.sin(Tn));return Ie=(Ie*=ot)>180?Ie-360:Ie<-180?Ie+360:Ie,L.latLng([Tn*ot,Ie])}(p,I,E)}function Cn(h,p){var _=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"asc";if(!p||Object.keys(p).length===0)return function(rt,ot){return rt-ot};for(var E,I=Object.keys(p),V=I.length-1,nt={};V>=0;)E=I[V],nt[E.toLowerCase()]=p[E],V-=1;function it(rt){return rt instanceof L.Marker?"Marker":rt instanceof L.Circle?"Circle":rt instanceof L.CircleMarker?"CircleMarker":rt instanceof L.Rectangle?"Rectangle":rt instanceof L.Polygon?"Polygon":rt instanceof L.Polyline?"Line":void 0}return function(rt,ot){var dt,Pt;if(h==="instanceofShape"){if(dt=it(rt.layer).toLowerCase(),Pt=it(ot.layer).toLowerCase(),!dt||!Pt)return 0}else{if(!rt.hasOwnProperty(h)||!ot.hasOwnProperty(h))return 0;dt=rt[h].toLowerCase(),Pt=ot[h].toLowerCase()}var yt=dt in nt?nt[dt]:Number.MAX_SAFE_INTEGER,At=Pt in nt?nt[Pt]:Number.MAX_SAFE_INTEGER,Gt=0;return ytAt&&(Gt=1),_==="desc"?-1*Gt:Gt}}function fe(h){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h.getLatLngs();return h instanceof L.Polygon?L.polygon(p).getLatLngs():L.polyline(p).getLatLngs()}function ke(h,p){var _,E;if((_=p.options.crs)!==null&&_!==void 0&&(E=_.projection)!==null&&E!==void 0&&E.MAX_LATITUDE){var I,V,nt=(I=p.options.crs)===null||I===void 0||(V=I.projection)===null||V===void 0?void 0:V.MAX_LATITUDE;h.lat=Math.max(Math.min(nt,h.lat),-nt)}return h}function Bt(h){return h.options.renderer||h._map&&(h._map._getPaneRenderer(h.options.pane)||h._map.options.renderer||h._map._renderer)||h._renderer}let hn=L.Class.extend({includes:[et,X,lt,gt,bt],initialize:function(h){this.map=h,this.Draw=new L.PM.Draw(h),this.Toolbar=new L.PM.Toolbar(h),this.Keyboard=Mt,this.globalOptions={snappable:!0,layerGroup:void 0,snappingOrder:["Marker","CircleMarker","Circle","Line","Polygon","Rectangle"],panes:{vertexPane:"markerPane",layerPane:"overlayPane",markerPane:"markerPane"},draggable:!0},this.Keyboard._initKeyListener(h)},setLang:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"en",p=arguments.length>1?arguments[1]:void 0,_=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"en",E=L.PM.activeLang;p&&(A[h]=m()(A[_],p)),L.PM.activeLang=h,this.map.pm.Toolbar.reinit(),this._fireLangChange(E,h,_,A[h])},addControls:function(h){this.Toolbar.addControls(h)},removeControls:function(){this.Toolbar.removeControls()},toggleControls:function(){this.Toolbar.toggleControls()},controlsVisible:function(){return this.Toolbar.isVisible},enableDraw:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"Polygon",p=arguments.length>1?arguments[1]:void 0;h==="Poly"&&(h="Polygon"),this.Draw.enable(h,p)},disableDraw:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"Polygon";h==="Poly"&&(h="Polygon"),this.Draw.disable(h)},setPathOptions:function(h){var p=this,_=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},E=_.ignoreShapes||[],I=_.merge||!1;this.map.pm.Draw.shapes.forEach(function(V){E.indexOf(V)===-1&&p.map.pm.Draw[V].setPathOptions(h,I)})},getGlobalOptions:function(){return this.globalOptions},setGlobalOptions:function(h){var p=this,_=m()(this.globalOptions,h),E=!1;this.map.pm.Draw.CircleMarker.enabled()&&!!this.map.pm.Draw.CircleMarker.options.editable!=!!_.editable&&(this.map.pm.Draw.CircleMarker.disable(),E=!0),this.map.pm.Draw.shapes.forEach(function(I){p.map.pm.Draw[I].setOptions(_)}),E&&this.map.pm.Draw.CircleMarker.enable(),L.PM.Utils.findLayers(this.map).forEach(function(I){I.pm.setOptions(_)}),this.map.fire("pm:globaloptionschanged"),this.globalOptions=_,this.applyGlobalOptions()},applyGlobalOptions:function(){L.PM.Utils.findLayers(this.map).forEach(function(h){h.pm.enabled()&&h.pm.applyOptions()})},globalDrawModeEnabled:function(){return!!this.Draw.getActiveShape()},globalCutModeEnabled:function(){return!!this.Draw.Cut.enabled()},enableGlobalCutMode:function(h){return this.Draw.Cut.enable(h)},toggleGlobalCutMode:function(h){return this.Draw.Cut.toggle(h)},disableGlobalCutMode:function(){return this.Draw.Cut.disable()},getGeomanLayers:function(){var h=arguments.length>0&&arguments[0]!==void 0&&arguments[0],p=L.PM.Utils.findLayers(this.map);if(!h)return p;var _=L.featureGroup();return _._pmTempLayer=!0,p.forEach(function(E){_.addLayer(E)}),_},getGeomanDrawLayers:function(){var h=arguments.length>0&&arguments[0]!==void 0&&arguments[0],p=L.PM.Utils.findLayers(this.map).filter(function(E){return E._drawnByGeoman===!0});if(!h)return p;var _=L.featureGroup();return _._pmTempLayer=!0,p.forEach(function(E){_.addLayer(E)}),_},_getContainingLayer:function(){return this.globalOptions.layerGroup&&this.globalOptions.layerGroup instanceof L.LayerGroup?this.globalOptions.layerGroup:this.map},_isCRSSimple:function(){return this.map.options.crs===L.CRS.Simple},_touchEventCounter:0,_addTouchEvents:function(h){this._touchEventCounter===0&&(L.DomEvent.on(h,"touchmove",this._canvasTouchMove,this),L.DomEvent.on(h,"touchstart touchend touchcancel",this._canvasTouchClick,this)),this._touchEventCounter+=1},_removeTouchEvents:function(h){this._touchEventCounter===1&&(L.DomEvent.off(h,"touchmove",this._canvasTouchMove,this),L.DomEvent.off(h,"touchstart touchend touchcancel",this._canvasTouchClick,this)),this._touchEventCounter=this._touchEventCounter<=1?0:this._touchEventCounter-1},_canvasTouchMove:function(h){Bt(this.map)._onMouseMove(this._createMouseEvent("mousemove",h))},_canvasTouchClick:function(h){var p="";h.type==="touchstart"||h.type==="pointerdown"?p="mousedown":h.type==="touchend"||h.type==="pointerup"?p="mouseup":h.type!=="touchcancel"&&h.type!=="pointercancel"||(p="mouseup"),p&&Bt(this.map)._onClick(this._createMouseEvent(p,h))},_createMouseEvent:function(h,p){var _,E=p.touches[0]||p.changedTouches[0];try{_=new MouseEvent(h,{bubbles:p.bubbles,cancelable:p.cancelable,view:p.view,detail:E.detail,screenX:E.screenX,screenY:E.screenY,clientX:E.clientX,clientY:E.clientY,ctrlKey:p.ctrlKey,altKey:p.altKey,shiftKey:p.shiftKey,metaKey:p.metaKey,button:p.button,relatedTarget:p.relatedTarget})}catch{(_=document.createEvent("MouseEvents")).initMouseEvent(h,p.bubbles,p.cancelable,p.view,E.detail,E.screenX,E.screenY,E.clientX,E.clientY,p.ctrlKey,p.altKey,p.shiftKey,p.metaKey,p.button,p.relatedTarget)}return _}}),Sn=L.Control.extend({includes:[bt],options:{position:"topleft",disableByOtherButtons:!0},initialize:function(h){this._button=L.Util.extend({},this.options,h)},onAdd:function(h){return this._map=h,this._map.pm.Toolbar.options.oneBlock?this._container=this._map.pm.Toolbar._createContainer(this.options.position):this._button.tool==="edit"?this._container=this._map.pm.Toolbar.editContainer:this._button.tool==="options"?this._container=this._map.pm.Toolbar.optionsContainer:this._button.tool==="custom"?this._container=this._map.pm.Toolbar.customContainer:this._container=this._map.pm.Toolbar.drawContainer,this.buttonsDomNode=this._makeButton(this._button),this._container.appendChild(this.buttonsDomNode),this._container},onRemove:function(){return this.buttonsDomNode.remove(),this._container},getText:function(){return this._button.text},getIconUrl:function(){return this._button.iconUrl},destroy:function(){this._button={},this._update()},toggle:function(h){return this._button.toggleStatus=typeof h=="boolean"?h:!this._button.toggleStatus,this._applyStyleClasses(),this._button.toggleStatus},toggled:function(){return this._button.toggleStatus},onCreate:function(){this.toggle(!1)},disable:function(){this.toggle(!1),this._button.disabled=!0,this._updateDisabled()},enable:function(){this._button.disabled=!1,this._updateDisabled()},_triggerClick:function(h){h&&h.preventDefault(),this._button.disabled||(this._button.onClick(h,{button:this,event:h}),this._clicked(h),this._button.afterClick(h,{button:this,event:h}))},_makeButton:function(h){var p=this,_=this.options.position.indexOf("right")>-1?"pos-right":"",E=L.DomUtil.create("div","button-container ".concat(_),this._container);h.title&&E.setAttribute("title",h.title);var I=L.DomUtil.create("a","leaflet-buttons-control-button",E);I.setAttribute("role","button"),I.setAttribute("tabindex","0"),I.href="#";var V=L.DomUtil.create("div","leaflet-pm-actions-container ".concat(_),E),nt=h.actions,it={cancel:{text:Rt("actions.cancel"),onClick:function(){this._triggerClick()}},finishMode:{text:Rt("actions.finish"),onClick:function(){this._triggerClick()}},removeLastVertex:{text:Rt("actions.removeLastVertex"),onClick:function(){this._map.pm.Draw[h.jsClass]._removeLastVertex()}},finish:{text:Rt("actions.finish"),onClick:function(ot){this._map.pm.Draw[h.jsClass]._finishShape(ot)}}};nt.forEach(function(ot){var dt,Pt=typeof ot=="string"?ot:ot.name;if(it[Pt])dt=it[Pt];else{if(!ot.text)return;dt=ot}var yt=L.DomUtil.create("a","leaflet-pm-action ".concat(_," action-").concat(Pt),V);yt.setAttribute("role","button"),yt.setAttribute("tabindex","0"),yt.href="#",yt.innerHTML=dt.text,L.DomEvent.disableClickPropagation(yt),L.DomEvent.on(yt,"click",L.DomEvent.stop),!h.disabled&&dt.onClick&&(L.DomEvent.addListener(yt,"click",function(At){At.preventDefault();var Gt="",te=p._map.pm.Toolbar.buttons;for(var Dt in te)if(te[Dt]._button===h){Gt=Dt;break}p._fireActionClick(dt,Gt,h)},p),L.DomEvent.addListener(yt,"click",dt.onClick,p))}),h.toggleStatus&&L.DomUtil.addClass(E,"active");var rt=L.DomUtil.create("div","control-icon",I);return h.iconUrl&&rt.setAttribute("src",h.iconUrl),h.className&&L.DomUtil.addClass(rt,h.className),L.DomEvent.disableClickPropagation(I),L.DomEvent.on(I,"click",L.DomEvent.stop),h.disabled||(L.DomEvent.addListener(I,"click",this._onBtnClick,this),L.DomEvent.addListener(I,"click",this._triggerClick,this)),h.disabled&&(L.DomUtil.addClass(I,"pm-disabled"),I.setAttribute("aria-disabled","true")),E},_applyStyleClasses:function(){this._container&&(this._button.toggleStatus&&this._button.cssToggle!==!1?(L.DomUtil.addClass(this.buttonsDomNode,"active"),L.DomUtil.addClass(this._container,"activeChild")):(L.DomUtil.removeClass(this.buttonsDomNode,"active"),L.DomUtil.removeClass(this._container,"activeChild")))},_onBtnClick:function(){this._button.disableOtherButtons&&this._map.pm.Toolbar.triggerClickOnToggledButtons(this);var h="",p=this._map.pm.Toolbar.buttons;for(var _ in p)if(p[_]._button===this._button){h=_;break}this._fireButtonClick(h,this._button)},_clicked:function(){this._button.doToggle&&this.toggle()},_updateDisabled:function(){if(this._container){var h="pm-disabled",p=this.buttonsDomNode.children[0];this._button.disabled?(L.DomUtil.addClass(p,h),p.setAttribute("aria-disabled","true"),L.DomEvent.off(p,"click",this._triggerClick,this),L.DomEvent.off(p,"click",this._onBtnClick,this)):(L.DomUtil.removeClass(p,h),p.setAttribute("aria-disabled","false"),L.DomEvent.on(p,"click",this._triggerClick,this),L.DomEvent.on(p,"click",this._onBtnClick,this))}}});function Hn(h,p){var _=Object.keys(h);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(h);p&&(E=E.filter(function(I){return Object.getOwnPropertyDescriptor(h,I).enumerable})),_.push.apply(_,E)}return _}function Me(h){for(var p=1;p0&&arguments[0]!==void 0?arguments[0]:this.options;typeof h.editPolygon<"u"&&(h.editMode=h.editPolygon),typeof h.deleteLayer<"u"&&(h.removalMode=h.deleteLayer),L.Util.setOptions(this,h),this.applyIconStyle(),this.isVisible=!0,this._showHideButtons()},applyIconStyle:function(){var h=this.getButtons(),p={geomanIcons:{drawMarker:"control-icon leaflet-pm-icon-marker",drawPolyline:"control-icon leaflet-pm-icon-polyline",drawRectangle:"control-icon leaflet-pm-icon-rectangle",drawPolygon:"control-icon leaflet-pm-icon-polygon",drawCircle:"control-icon leaflet-pm-icon-circle",drawCircleMarker:"control-icon leaflet-pm-icon-circle-marker",editMode:"control-icon leaflet-pm-icon-edit",dragMode:"control-icon leaflet-pm-icon-drag",cutPolygon:"control-icon leaflet-pm-icon-cut",removalMode:"control-icon leaflet-pm-icon-delete",drawText:"control-icon leaflet-pm-icon-text"}};for(var _ in h){var E=h[_];L.Util.setOptions(E,{className:p.geomanIcons[_]})}},removeControls:function(){var h=this.getButtons();for(var p in h)h[p].remove();this.isVisible=!1},toggleControls:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options;this.isVisible?this.removeControls():this.addControls(h)},_addButton:function(h,p){return this.buttons[h]=p,this.options[h]=this.options[h]||!1,this.buttons[h]},triggerClickOnToggledButtons:function(h){for(var p in this.buttons){var _=this.buttons[p];_._button.disableByOtherButtons&&_!==h&&_.toggled()&&_._triggerClick()}},toggleButton:function(h,p){var _=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];return h==="editPolygon"&&(h="editMode"),h==="deleteLayer"&&(h="removalMode"),_&&this.triggerClickOnToggledButtons(this.buttons[h]),!!this.buttons[h]&&this.buttons[h].toggle(p)},_defineButtons:function(){var h=this,p={className:"control-icon leaflet-pm-icon-marker",title:Rt("buttonTitles.drawMarkerButton"),jsClass:"Marker",onClick:function(){},afterClick:function(At,Gt){h.map.pm.Draw[Gt.button._button.jsClass].toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["cancel"]},_={title:Rt("buttonTitles.drawPolyButton"),className:"control-icon leaflet-pm-icon-polygon",jsClass:"Polygon",onClick:function(){},afterClick:function(At,Gt){h.map.pm.Draw[Gt.button._button.jsClass].toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["finish","removeLastVertex","cancel"]},E={className:"control-icon leaflet-pm-icon-polyline",title:Rt("buttonTitles.drawLineButton"),jsClass:"Line",onClick:function(){},afterClick:function(At,Gt){h.map.pm.Draw[Gt.button._button.jsClass].toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["finish","removeLastVertex","cancel"]},I={title:Rt("buttonTitles.drawCircleButton"),className:"control-icon leaflet-pm-icon-circle",jsClass:"Circle",onClick:function(){},afterClick:function(At,Gt){h.map.pm.Draw[Gt.button._button.jsClass].toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["cancel"]},V={title:Rt("buttonTitles.drawCircleMarkerButton"),className:"control-icon leaflet-pm-icon-circle-marker",jsClass:"CircleMarker",onClick:function(){},afterClick:function(At,Gt){h.map.pm.Draw[Gt.button._button.jsClass].toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["cancel"]},nt={title:Rt("buttonTitles.drawRectButton"),className:"control-icon leaflet-pm-icon-rectangle",jsClass:"Rectangle",onClick:function(){},afterClick:function(At,Gt){h.map.pm.Draw[Gt.button._button.jsClass].toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["cancel"]},it={title:Rt("buttonTitles.editButton"),className:"control-icon leaflet-pm-icon-edit",onClick:function(){},afterClick:function(){h.map.pm.toggleGlobalEditMode()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,tool:"edit",actions:["finishMode"]},rt={title:Rt("buttonTitles.dragButton"),className:"control-icon leaflet-pm-icon-drag",onClick:function(){},afterClick:function(){h.map.pm.toggleGlobalDragMode()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,tool:"edit",actions:["finishMode"]},ot={title:Rt("buttonTitles.cutButton"),className:"control-icon leaflet-pm-icon-cut",jsClass:"Cut",onClick:function(){},afterClick:function(At,Gt){h.map.pm.Draw[Gt.button._button.jsClass].toggle({snappable:!0,cursorMarker:!0,allowSelfIntersection:!1})},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,tool:"edit",actions:["finish","removeLastVertex","cancel"]},dt={title:Rt("buttonTitles.deleteButton"),className:"control-icon leaflet-pm-icon-delete",onClick:function(){},afterClick:function(){h.map.pm.toggleGlobalRemovalMode()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,tool:"edit",actions:["finishMode"]},Pt={title:Rt("buttonTitles.rotateButton"),className:"control-icon leaflet-pm-icon-rotate",onClick:function(){},afterClick:function(){h.map.pm.toggleGlobalRotateMode()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,tool:"edit",actions:["finishMode"]},yt={className:"control-icon leaflet-pm-icon-text",title:Rt("buttonTitles.drawTextButton"),jsClass:"Text",onClick:function(){},afterClick:function(At,Gt){h.map.pm.Draw[Gt.button._button.jsClass].toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["cancel"]};this._addButton("drawMarker",new L.Control.PMButton(p)),this._addButton("drawPolyline",new L.Control.PMButton(E)),this._addButton("drawRectangle",new L.Control.PMButton(nt)),this._addButton("drawPolygon",new L.Control.PMButton(_)),this._addButton("drawCircle",new L.Control.PMButton(I)),this._addButton("drawCircleMarker",new L.Control.PMButton(V)),this._addButton("drawText",new L.Control.PMButton(yt)),this._addButton("editMode",new L.Control.PMButton(it)),this._addButton("dragMode",new L.Control.PMButton(rt)),this._addButton("cutPolygon",new L.Control.PMButton(ot)),this._addButton("removalMode",new L.Control.PMButton(dt)),this._addButton("rotateMode",new L.Control.PMButton(Pt))},_showHideButtons:function(){if(this.isVisible){this.removeControls(),this.isVisible=!0;var h=this.getButtons(),p=[];for(var _ in this.options.drawControls===!1&&(p=p.concat(Object.keys(h).filter(function(I){return!h[I]._button.tool}))),this.options.editControls===!1&&(p=p.concat(Object.keys(h).filter(function(I){return h[I]._button.tool==="edit"}))),this.options.optionsControls===!1&&(p=p.concat(Object.keys(h).filter(function(I){return h[I]._button.tool==="options"}))),this.options.customControls===!1&&(p=p.concat(Object.keys(h).filter(function(I){return h[I]._button.tool==="custom"}))),h)if(this.options[_]&&p.indexOf(_)===-1){var E=h[_]._button.tool;E||(E="draw"),h[_].setPosition(this._getBtnPosition(E)),h[_].addTo(this.map)}}},_getBtnPosition:function(h){return this.options.positions&&this.options.positions[h]?this.options.positions[h]:this.options.position},setBlockPosition:function(h,p){this.options.positions[h]=p,this._showHideButtons(),this.changeControlOrder()},getBlockPositions:function(){return this.options.positions},copyDrawControl:function(h,p){if(!p)throw new TypeError("Button has no name");Ht(p)!=="object"&&(p={name:p});var _=this._btnNameMapping(h);if(!p.name)throw new TypeError("Button has no name");if(this.buttons[p.name])throw new TypeError("Button with this name already exists");var E=this.map.pm.Draw.createNewDrawInstance(p.name,_);return p=Me(Me({},this.buttons[_]._button),p),{drawInstance:E,control:this.createCustomControl(p)}},createCustomControl:function(h){var p,_;if(!h.name)throw new TypeError("Button has no name");if(this.buttons[h.name])throw new TypeError("Button with this name already exists");h.onClick||(h.onClick=function(){}),h.afterClick||(h.afterClick=function(){}),h.toggle!==!1&&(h.toggle=!0),h.block&&(h.block=h.block.toLowerCase()),h.block&&h.block!=="draw"||(h.block=""),h.className?h.className.indexOf("control-icon")===-1&&(h.className="control-icon ".concat(h.className)):h.className="control-icon";var E={tool:h.block,className:h.className,title:h.title||"",jsClass:h.name,onClick:h.onClick,afterClick:h.afterClick,doToggle:h.toggle,toggleStatus:!1,disableOtherButtons:(p=h.disableOtherButtons)===null||p===void 0||p,disableByOtherButtons:(_=h.disableByOtherButtons)===null||_===void 0||_,cssToggle:h.toggle,position:this.options.position,actions:h.actions||[],disabled:!!h.disabled};this.options[h.name]!==!1&&(this.options[h.name]=!0);var I=this._addButton(h.name,new L.Control.PMButton(E));return this.changeControlOrder(),I},changeControlOrder:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],p=this._shapeMapping(),_=[];h.forEach(function(ot){p[ot]?_.push(p[ot]):_.push(ot)});var E=this.getButtons(),I={};_.forEach(function(ot){E[ot]&&(I[ot]=E[ot])});var V=Object.keys(E).filter(function(ot){return!E[ot]._button.tool});V.forEach(function(ot){_.indexOf(ot)===-1&&(I[ot]=E[ot])});var nt=Object.keys(E).filter(function(ot){return E[ot]._button.tool==="edit"});nt.forEach(function(ot){_.indexOf(ot)===-1&&(I[ot]=E[ot])});var it=Object.keys(E).filter(function(ot){return E[ot]._button.tool==="options"});it.forEach(function(ot){_.indexOf(ot)===-1&&(I[ot]=E[ot])});var rt=Object.keys(E).filter(function(ot){return E[ot]._button.tool==="custom"});rt.forEach(function(ot){_.indexOf(ot)===-1&&(I[ot]=E[ot])}),Object.keys(E).forEach(function(ot){_.indexOf(ot)===-1&&(I[ot]=E[ot])}),this.map.pm.Toolbar.buttons=I,this._showHideButtons()},getControlOrder:function(){var h=this.getButtons(),p=[];for(var _ in h)p.push(_);return p},changeActionsOfControl:function(h,p){var _=this._btnNameMapping(h);if(!_)throw new TypeError("No name passed");if(!p)throw new TypeError("No actions passed");if(!this.buttons[_])throw new TypeError("Button with this name not exists");this.buttons[_]._button.actions=p,this.changeControlOrder()},setButtonDisabled:function(h,p){var _=this._btnNameMapping(h);p?this.buttons[_].disable():this.buttons[_].enable()},_shapeMapping:function(){return{Marker:"drawMarker",Circle:"drawCircle",Polygon:"drawPolygon",Rectangle:"drawRectangle",Polyline:"drawPolyline",Line:"drawPolyline",CircleMarker:"drawCircleMarker",Edit:"editMode",Drag:"dragMode",Cut:"cutPolygon",Removal:"removalMode",Rotate:"rotateMode",Text:"drawText"}},_btnNameMapping:function(h){var p=this._shapeMapping();return p[h]?p[h]:h}});function Y(h,p){var _=Object.keys(h);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(h);p&&(E=E.filter(function(I){return Object.getOwnPropertyDescriptor(h,I).enumerable})),_.push.apply(_,E)}return _}function C(h){for(var p=1;p2&&arguments[2]!==void 0?arguments[2]:1,I=[],V={};p.forEach(function(it,rt){if(!it._parentCopy||it._parentCopy!==_._layer){var ot=_._calcLayerDistances(h,it);if(ot.distance=Math.floor(ot.distance),_.debugIndicatorLines){if(!_.debugIndicatorLines[rt]){var dt=L.polyline([],{color:"red",pmIgnore:!0});dt._pmTempLayer=!0,_.debugIndicatorLines[rt]=dt}_.debugIndicatorLines[rt].setLatLngs([h,ot.latlng])}E===1&&(V.distance===void 0||ot.distance<=V.distance)?(ot.distance3&&arguments[3]!==void 0&&arguments[3],rt=function dt(Pt){Pt.forEach(function(yt,At){if(Array.isArray(yt))dt(yt);else if(nt.options.snapSegment){var Gt,te=yt;Gt=it?At+1===Pt.length?0:At+1:At+1===Pt.length?void 0:At+1;var Dt=Pt[Gt];if(Dt){var Rn=nt._getDistanceToSegment(_,h,te,Dt);(I===void 0||Rn1&&arguments[1]!==void 0?arguments[1]:1;h=h.sort(function(nt,it){return nt._leaflet_id-it._leaflet_id});var _=["Marker","CircleMarker","Circle","Line","Polygon","Rectangle"],E=this._map.pm.globalOptions.snappingOrder||[],I=0,V={};return E.concat(_).forEach(function(nt){V[nt]||(I+=1,V[nt]=I)}),h.sort(Cn("instanceofShape",V)),p===1?h[0]||{}:h.slice(0,p)},_checkPrioritiySnapping:function(h){var p=this._map,_=h.segment[0],E=h.segment[1],I=h.latlng,V=this._getDistance(p,_,I),nt=this._getDistance(p,E,I),it=V1&&arguments[1]!==void 0&&arguments[1];this.options.pathOptions=p?m()(this.options.pathOptions,h):h},getShapes:function(){return this.shapes},getShape:function(){return this._shape},enable:function(h,p){if(!h)throw new Error("Error: Please pass a shape as a parameter. Possible shapes are: ".concat(this.getShapes().join(",")));this.disable(),this[h].enable(p)},disable:function(){var h=this;this.shapes.forEach(function(p){h[p].disable()})},addControls:function(){var h=this;this.shapes.forEach(function(p){h[p].addButton()})},getActiveShape:function(){var h,p=this;return this.shapes.forEach(function(_){p[_]._enabled&&(h=_)}),h},_setGlobalDrawMode:function(){this._shape==="Cut"?this._fireGlobalCutModeToggled():this._fireGlobalDrawModeToggled();var h=L.PM.Utils.findLayers(this._map);this._enabled?h.forEach(function(p){L.PM.Utils.disablePopup(p)}):h.forEach(function(p){L.PM.Utils.enablePopup(p)})},createNewDrawInstance:function(h,p){var _=this._getShapeFromBtnName(p);if(this[h])throw new TypeError("Draw Type already exists");if(!L.PM.Draw[_])throw new TypeError("There is no class L.PM.Draw.".concat(_));return this[h]=new L.PM.Draw[_](this._map),this[h].toolbarButtonName=h,this[h]._shape=h,this.shapes.push(h),this[p]&&this[h].setOptions(this[p].options),this[h].setOptions(this[h].options),this[h]},_getShapeFromBtnName:function(h){var p={drawMarker:"Marker",drawCircle:"Circle",drawPolygon:"Polygon",drawPolyline:"Line",drawRectangle:"Rectangle",drawCircleMarker:"CircleMarker",editMode:"Edit",dragMode:"Drag",cutPolygon:"Cut",removalMode:"Removal",rotateMode:"Rotate",drawText:"Text"};return p[h]?p[h]:this[h]?this[h]._shape:h},_finishLayer:function(h){h.pm&&(h.pm.setOptions(this.options),h.pm._shape=this._shape,h.pm._map=this._map),this._addDrawnLayerProp(h)},_addDrawnLayerProp:function(h){h._drawnByGeoman=!0},_setPane:function(h,p){p==="layerPane"?h.options.pane=this._map.pm.globalOptions.panes&&this._map.pm.globalOptions.panes.layerPane||"overlayPane":p==="vertexPane"?h.options.pane=this._map.pm.globalOptions.panes&&this._map.pm.globalOptions.panes.vertexPane||"markerPane":p==="markerPane"&&(h.options.pane=this._map.pm.globalOptions.panes&&this._map.pm.globalOptions.panes.markerPane||"markerPane")},_isFirstLayer:function(){return(this._map||this._layer._map).pm.getGeomanLayers().length===0}});Z.Marker=Z.extend({initialize:function(h){this._map=h,this._shape="Marker",this.toolbarButtonName="drawMarker"},enable:function(h){var p=this;L.Util.setOptions(this,h),this._enabled=!0,this._map.on("click",this._createMarker,this),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!0),this._hintMarker=L.marker(this._map.getCenter(),this.options.markerStyle),this._setPane(this._hintMarker,"markerPane"),this._hintMarker._pmTempLayer=!0,this._hintMarker.addTo(this._map),this.options.tooltips&&this._hintMarker.bindTooltip(Rt("tooltips.placeMarker"),{permanent:!0,offset:L.point(0,10),direction:"bottom",opacity:.8}).openTooltip(),this._layer=this._hintMarker,this._map.on("mousemove",this._syncHintMarker,this),this.options.markerEditable&&this._map.eachLayer(function(_){p.isRelevantMarker(_)&&_.pm.enable()}),this._fireDrawStart(),this._setGlobalDrawMode()},disable:function(){var h=this;this._enabled&&(this._enabled=!1,this._map.off("click",this._createMarker,this),this._hintMarker.remove(),this._map.off("mousemove",this._syncHintMarker,this),this._map.eachLayer(function(p){h.isRelevantMarker(p)&&p.pm.disable()}),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!1),this.options.snappable&&this._cleanupSnapping(),this._fireDrawEnd(),this._setGlobalDrawMode())},enabled:function(){return this._enabled},toggle:function(h){this.enabled()?this.disable():this.enable(h)},isRelevantMarker:function(h){return h instanceof L.Marker&&h.pm&&!h._pmTempLayer&&!h.pm._initTextMarker},_syncHintMarker:function(h){if(this._hintMarker.setLatLng(h.latlng),this.options.snappable){var p=h;p.target=this._hintMarker,this._handleSnapping(p)}this._fireChange(this._hintMarker.getLatLng(),"Draw")},_createMarker:function(h){if(h.latlng&&(!this.options.requireSnapToFinish||this._hintMarker._snapped||this._isFirstLayer())){this._hintMarker._snapped||this._hintMarker.setLatLng(h.latlng);var p=this._hintMarker.getLatLng(),_=new L.Marker(p,this.options.markerStyle);this._setPane(_,"markerPane"),this._finishLayer(_),_.pm||(_.options.draggable=!1),_.addTo(this._map.pm._getContainingLayer()),_.pm&&this.options.markerEditable?_.pm.enable():_.dragging&&_.dragging.disable(),this._fireCreate(_),this._cleanupSnapping(),this.options.continueDrawing||this.disable()}},setStyle:function(){var h,p;(h=this.options.markerStyle)!==null&&h!==void 0&&h.icon&&((p=this._hintMarker)===null||p===void 0||p.setIcon(this.options.markerStyle.icon))}});var J=63710088e-1,tt={centimeters:637100880,centimetres:637100880,degrees:57.22891354143274,feet:20902260511392e-6,inches:39.37*J,kilometers:6371.0088,kilometres:6371.0088,meters:J,metres:J,miles:3958.761333810546,millimeters:6371008800,millimetres:6371008800,nauticalmiles:J/1852,radians:1,yards:6967335223679999e-9};function pt(h,p,_){_===void 0&&(_={});var E={type:"Feature"};return(_.id===0||_.id)&&(E.id=_.id),_.bbox&&(E.bbox=_.bbox),E.properties=p||{},E.geometry=h,E}function Lt(h,p,_){if(_===void 0&&(_={}),!h)throw new Error("coordinates is required");if(!Array.isArray(h))throw new Error("coordinates must be an Array");if(h.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!ge(h[0])||!ge(h[1]))throw new Error("coordinates must contain numbers");return pt({type:"Point",coordinates:h},p,_)}function vt(h,p,_){if(_===void 0&&(_={}),h.length<2)throw new Error("coordinates must be an array of two or more positions");return pt({type:"LineString",coordinates:h},p,_)}function Ft(h,p){p===void 0&&(p={});var _={type:"FeatureCollection"};return p.id&&(_.id=p.id),p.bbox&&(_.bbox=p.bbox),_.features=h,_}function Wt(h,p){p===void 0&&(p="kilometers");var _=tt[p];if(!_)throw new Error(p+" units is invalid");return h*_}function Jt(h,p){p===void 0&&(p="kilometers");var _=tt[p];if(!_)throw new Error(p+" units is invalid");return h/_}function $t(h){return 180*(h%(2*Math.PI))/Math.PI}function jt(h){return h%360*Math.PI/180}function ge(h){return!isNaN(h)&&h!==null&&!Array.isArray(h)}function pe(h){var p,_,E={type:"FeatureCollection",features:[]};if((_=h.type==="Feature"?h.geometry:h).type==="LineString")p=[_.coordinates];else if(_.type==="MultiLineString")p=_.coordinates;else if(_.type==="MultiPolygon")p=[].concat.apply([],_.coordinates);else{if(_.type!=="Polygon")throw new Error("Input must be a LineString, MultiLineString, Polygon, or MultiPolygon Feature or Geometry");p=_.coordinates}return p.forEach(function(I){p.forEach(function(V){for(var nt=0;nt=0&&ot<=1&&(yt.onLine1=!0),dt>=0&&dt<=1&&(yt.onLine2=!0),!(!yt.onLine1||!yt.onLine2)&&[yt.x,yt.y])}function Ce(h,p){var _=Object.keys(h);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(h);p&&(E=E.filter(function(I){return Object.getOwnPropertyDescriptor(h,I).enumerable})),_.push.apply(_,E)}return _}function he(h){for(var p=1;p=2&&!Array.isArray(h[0])&&!Array.isArray(h[1]))return h;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function cn(h){if(Array.isArray(h))return h;if(h.type==="Feature"){if(h.geometry!==null)return h.geometry.coordinates}else if(h.coordinates)return h.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function or(h){return h.type==="Feature"?h.geometry:h}function sr(h,p){return h.type==="FeatureCollection"?"FeatureCollection":h.type==="GeometryCollection"?"GeometryCollection":h.type==="Feature"&&h.geometry!==null?h.geometry.type:h.type}function wo(h,p,_){if(h!==null)for(var E,I,V,nt,it,rt,ot,dt,Pt=0,yt=0,At=h.type,Gt=At==="FeatureCollection",te=At==="Feature",Dt=Gt?h.features.length:1,Rn=0;Rn0){var p=h[h.length-1];this._hintline.setLatLngs([p,this._hintMarker.getLatLng()])}},_syncHintMarker:function(h){if(this._hintMarker.setLatLng(h.latlng),this.options.snappable){var p=h;p.target=this._hintMarker,this._handleSnapping(p)}this.options.allowSelfIntersection||this._handleSelfIntersection(!0,this._hintMarker.getLatLng());var _=this._layer._defaultShape().slice();_.push(this._hintMarker.getLatLng()),this._change(_)},hasSelfIntersection:function(){return pe(this._layer.toGeoJSON(15)).features.length>0},_handleSelfIntersection:function(h,p){var _=L.polyline(this._layer.getLatLngs());h&&(p||(p=this._hintMarker.getLatLng()),_.addLatLng(p));var E=pe(_.toGeoJSON(15));this._doesSelfIntersect=E.features.length>0,this._doesSelfIntersect?this._hintline.setStyle({color:"#f00000ff"}):this._hintline.isEmpty()||this._hintline.setStyle(this.options.hintlineStyle)},_createVertex:function(h){if(this.options.allowSelfIntersection||(this._handleSelfIntersection(!0,h.latlng),!this._doesSelfIntersect)){this._hintMarker._snapped||this._hintMarker.setLatLng(h.latlng);var p=this._hintMarker.getLatLng(),_=this._layer.getLatLngs(),E=_[_.length-1];if(p.equals(_[0])||_.length>0&&p.equals(E))this._finishShape();else{this._layer._latlngInfo=this._layer._latlngInfo||[],this._layer._latlngInfo.push({latlng:p,snapInfo:this._hintMarker._snapInfo}),this._layer.addLatLng(p);var I=this._createMarker(p);this._setTooltipText(),this._setHintLineAfterNewVertex(p),this._fireVertexAdded(I,void 0,p,"Draw"),this._change(this._layer.getLatLngs()),this.options.finishOn==="snap"&&this._hintMarker._snapped&&this._finishShape(h)}}},_setHintLineAfterNewVertex:function(h){this._hintline.setLatLngs([h,h])},_removeLastVertex:function(){var h=this._markers;if(h.length<=1)this.disable();else{var p=this._layer.getLatLngs(),_=h[h.length-1],E=L.PM.Utils.findDeepMarkerIndex(h,_).indexPath;h.pop(),this._layerGroup.removeLayer(_);var I=h[h.length-1],V=p.indexOf(I.getLatLng());p=p.slice(0,V+1),this._layer.setLatLngs(p),this._layer._latlngInfo.pop(),this._syncHintLine(),this._setTooltipText(),this._fireVertexRemoved(_,E,"Draw"),this._change(this._layer.getLatLngs())}},_finishShape:function(){if((this.options.allowSelfIntersection||(this._handleSelfIntersection(!1),!this._doesSelfIntersect))&&(!this.options.requireSnapToFinish||this._hintMarker._snapped||this._isFirstLayer())){var h=this._layer.getLatLngs();if(!(h.length<=1)){var p=L.polyline(h,this.options.pathOptions);this._setPane(p,"layerPane"),this._finishLayer(p),p.addTo(this._map.pm._getContainingLayer()),this._fireCreate(p),this.options.snappable&&this._cleanupSnapping(),this.disable(),this.options.continueDrawing&&this.enable()}}},_createMarker:function(h){var p=new L.Marker(h,{draggable:!1,icon:L.divIcon({className:"marker-icon"})});return this._setPane(p,"vertexPane"),p._pmTempLayer=!0,this._layerGroup.addLayer(p),this._markers.push(p),p.on("click",this._finishShape,this),p},_setTooltipText:function(){var h="";h=Rt(this._layer.getLatLngs().flat().length<=1?"tooltips.continueLine":"tooltips.finishLine"),this._hintMarker.setTooltipContent(h)},_change:function(h){this._fireChange(h,"Draw")},setStyle:function(){var h,p;(h=this._layer)===null||h===void 0||h.setStyle(this.options.templineStyle),(p=this._hintline)===null||p===void 0||p.setStyle(this.options.hintlineStyle)}}),Z.Polygon=Z.Line.extend({initialize:function(h){this._map=h,this._shape="Polygon",this.toolbarButtonName="drawPolygon"},enable:function(h){L.PM.Draw.Line.prototype.enable.call(this,h),this._layer.pm._shape="Polygon"},_createMarker:function(h){var p=new L.Marker(h,{draggable:!1,icon:L.divIcon({className:"marker-icon"})});return this._setPane(p,"vertexPane"),p._pmTempLayer=!0,this._layerGroup.addLayer(p),this._markers.push(p),this._layer.getLatLngs().flat().length===1?(p.on("click",this._finishShape,this),this._tempSnapLayerIndex=this._otherSnapLayers.push(p)-1,this.options.snappable&&this._cleanupSnapping()):p.on("click",function(){return 1}),p},_setTooltipText:function(){var h="";h=Rt(this._layer.getLatLngs().flat().length<=2?"tooltips.continueLine":"tooltips.finishPoly"),this._hintMarker.setTooltipContent(h)},_finishShape:function(){if((this.options.allowSelfIntersection||(this._handleSelfIntersection(!0,this._layer.getLatLngs()[0]),!this._doesSelfIntersect))&&(!this.options.requireSnapToFinish||this._hintMarker._snapped||this._isFirstLayer())){var h=this._layer.getLatLngs();if(!(h.length<=2)){var p=L.polygon(h,this.options.pathOptions);this._setPane(p,"layerPane"),this._finishLayer(p),p.addTo(this._map.pm._getContainingLayer()),this._fireCreate(p),this._cleanupSnapping(),this._otherSnapLayers.splice(this._tempSnapLayerIndex,1),delete this._tempSnapLayerIndex,this.disable(),this.options.continueDrawing&&this.enable()}}}}),Z.Rectangle=Z.extend({initialize:function(h){this._map=h,this._shape="Rectangle",this.toolbarButtonName="drawRectangle"},enable:function(h){if(L.Util.setOptions(this,h),this._enabled=!0,this._layerGroup=new L.FeatureGroup,this._layerGroup._pmTempLayer=!0,this._layerGroup.addTo(this._map),this._layer=L.rectangle([[0,0],[0,0]],this.options.pathOptions),this._setPane(this._layer,"layerPane"),this._layer._pmTempLayer=!0,this._startMarker=L.marker(this._map.getCenter(),{icon:L.divIcon({className:"marker-icon rect-start-marker"}),draggable:!1,zIndexOffset:-100,opacity:this.options.cursorMarker?1:0}),this._setPane(this._startMarker,"vertexPane"),this._startMarker._pmTempLayer=!0,this._layerGroup.addLayer(this._startMarker),this._hintMarker=L.marker(this._map.getCenter(),{zIndexOffset:150,icon:L.divIcon({className:"marker-icon cursor-marker"})}),this._setPane(this._hintMarker,"vertexPane"),this._hintMarker._pmTempLayer=!0,this._layerGroup.addLayer(this._hintMarker),this.options.cursorMarker&&L.DomUtil.addClass(this._hintMarker._icon,"visible"),this.options.tooltips&&this._hintMarker.bindTooltip(Rt("tooltips.firstVertex"),{permanent:!0,offset:L.point(0,10),direction:"bottom",opacity:.8}).openTooltip(),this.options.cursorMarker){this._styleMarkers=[];for(var p=0;p<2;p+=1){var _=L.marker(this._map.getCenter(),{icon:L.divIcon({className:"marker-icon rect-style-marker"}),draggable:!1,zIndexOffset:100});this._setPane(_,"vertexPane"),_._pmTempLayer=!0,this._layerGroup.addLayer(_),this._styleMarkers.push(_)}}this._map._container.style.cursor="crosshair",this._map.on("click",this._placeStartingMarkers,this),this._map.on("mousemove",this._syncHintMarker,this),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!0),this._otherSnapLayers=[],this._fireDrawStart(),this._setGlobalDrawMode()},disable:function(){this._enabled&&(this._enabled=!1,this._map._container.style.cursor="",this._map.off("click",this._finishShape,this),this._map.off("click",this._placeStartingMarkers,this),this._map.off("mousemove",this._syncHintMarker,this),this._map.removeLayer(this._layerGroup),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!1),this.options.snappable&&this._cleanupSnapping(),this._fireDrawEnd(),this._setGlobalDrawMode())},enabled:function(){return this._enabled},toggle:function(h){this.enabled()?this.disable():this.enable(h)},_placeStartingMarkers:function(h){this._hintMarker._snapped||this._hintMarker.setLatLng(h.latlng);var p=this._hintMarker.getLatLng();L.DomUtil.addClass(this._startMarker._icon,"visible"),this._startMarker.setLatLng(p),this.options.cursorMarker&&this._styleMarkers&&this._styleMarkers.forEach(function(_){L.DomUtil.addClass(_._icon,"visible"),_.setLatLng(p)}),this._map.off("click",this._placeStartingMarkers,this),this._map.on("click",this._finishShape,this),this._hintMarker.setTooltipContent(Rt("tooltips.finishRect")),this._setRectangleOrigin()},_setRectangleOrigin:function(){var h=this._startMarker.getLatLng();h&&(this._layerGroup.addLayer(this._layer),this._layer.setLatLngs([h,h]),this._hintMarker.on("move",this._syncRectangleSize,this))},_syncHintMarker:function(h){if(this._hintMarker.setLatLng(h.latlng),this.options.snappable){var p=h;p.target=this._hintMarker,this._handleSnapping(p)}var _=this._layerGroup&&this._layerGroup.hasLayer(this._layer)?this._layer.getLatLngs():[this._hintMarker.getLatLng()];this._fireChange(_,"Draw")},_syncRectangleSize:function(){var h=this,p=ke(this._startMarker.getLatLng(),this._map),_=ke(this._hintMarker.getLatLng(),this._map),E=L.PM.Utils._getRotatedRectangle(p,_,this.options.rectangleAngle||0,this._map);if(this._layer.setLatLngs(E),this.options.cursorMarker&&this._styleMarkers){var I=[];E.forEach(function(V){V.equals(p,1e-8)||V.equals(_,1e-8)||I.push(V)}),I.forEach(function(V,nt){try{h._styleMarkers[nt].setLatLng(V)}catch{}})}},_findCorners:function(){var h=this._layer.getBounds();return[h.getNorthWest(),h.getNorthEast(),h.getSouthEast(),h.getSouthWest()]},_finishShape:function(h){this._hintMarker._snapped||this._hintMarker.setLatLng(h.latlng);var p=this._hintMarker.getLatLng(),_=this._startMarker.getLatLng();if(!this.options.requireSnapToFinish||this._hintMarker._snapped||this._isFirstLayer()){var E=L.rectangle([_,p],this.options.pathOptions);if(this.options.rectangleAngle){var I=L.PM.Utils._getRotatedRectangle(_,p,this.options.rectangleAngle||0,this._map);E.setLatLngs(I),E.pm&&E.pm._setAngle(this.options.rectangleAngle||0)}this._setPane(E,"layerPane"),this._finishLayer(E),E.addTo(this._map.pm._getContainingLayer()),this._fireCreate(E),this.disable(),this.options.continueDrawing&&this.enable()}},setStyle:function(){var h;(h=this._layer)===null||h===void 0||h.setStyle(this.options.pathOptions)}}),Z.Circle=Z.extend({initialize:function(h){this._map=h,this._shape="Circle",this.toolbarButtonName="drawCircle"},enable:function(h){L.Util.setOptions(this,h),this.options.radius=0,this._enabled=!0,this._layerGroup=new L.FeatureGroup,this._layerGroup._pmTempLayer=!0,this._layerGroup.addTo(this._map),this._layer=L.circle(this._map.getCenter(),St(St({},this.options.templineStyle),{},{radius:0})),this._setPane(this._layer,"layerPane"),this._layer._pmTempLayer=!0,this._centerMarker=L.marker(this._map.getCenter(),{icon:L.divIcon({className:"marker-icon"}),draggable:!1,zIndexOffset:100}),this._setPane(this._centerMarker,"vertexPane"),this._centerMarker._pmTempLayer=!0,this._hintMarker=L.marker(this._map.getCenter(),{zIndexOffset:110,icon:L.divIcon({className:"marker-icon cursor-marker"})}),this._setPane(this._hintMarker,"vertexPane"),this._hintMarker._pmTempLayer=!0,this._layerGroup.addLayer(this._hintMarker),this.options.cursorMarker&&L.DomUtil.addClass(this._hintMarker._icon,"visible"),this.options.tooltips&&this._hintMarker.bindTooltip(Rt("tooltips.startCircle"),{permanent:!0,offset:L.point(0,10),direction:"bottom",opacity:.8}).openTooltip(),this._hintline=L.polyline([],this.options.hintlineStyle),this._setPane(this._hintline,"layerPane"),this._hintline._pmTempLayer=!0,this._layerGroup.addLayer(this._hintline),this._map._container.style.cursor="crosshair",this._map.on("click",this._placeCenterMarker,this),this._map.on("mousemove",this._syncHintMarker,this),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!0),this._otherSnapLayers=[],this._fireDrawStart(),this._setGlobalDrawMode()},disable:function(){this._enabled&&(this._enabled=!1,this._map._container.style.cursor="",this._map.off("click",this._finishShape,this),this._map.off("click",this._placeCenterMarker,this),this._map.off("mousemove",this._syncHintMarker,this),this._map.removeLayer(this._layerGroup),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!1),this.options.snappable&&this._cleanupSnapping(),this._fireDrawEnd(),this._setGlobalDrawMode())},enabled:function(){return this._enabled},toggle:function(h){this.enabled()?this.disable():this.enable(h)},_syncHintLine:function(){var h=this._centerMarker.getLatLng(),p=this._getNewDestinationOfHintMarker();this._hintline.setLatLngs([h,p])},_syncCircleRadius:function(){var h,p=this._centerMarker.getLatLng(),_=this._hintMarker.getLatLng();h=this._map.options.crs===L.CRS.Simple?this._map.distance(p,_):p.distanceTo(_),this.options.minRadiusCircle&&hthis.options.maxRadiusCircle?this._layer.setRadius(this.options.maxRadiusCircle):this._layer.setRadius(h)},_syncHintMarker:function(h){if(this._hintMarker.setLatLng(h.latlng),this._hintMarker.setLatLng(this._getNewDestinationOfHintMarker()),this.options.snappable){var p=h;p.target=this._hintMarker,this._handleSnapping(p)}this._handleHintMarkerSnapping();var _=this._layerGroup&&this._layerGroup.hasLayer(this._centerMarker)?this._centerMarker.getLatLng():this._hintMarker.getLatLng();this._fireChange(_,"Draw")},_placeCenterMarker:function(h){this._layerGroup.addLayer(this._layer),this._layerGroup.addLayer(this._centerMarker),this._hintMarker._snapped||this._hintMarker.setLatLng(h.latlng);var p=this._hintMarker.getLatLng();this._layerGroup.addLayer(this._layer),this._centerMarker.setLatLng(p),this._map.off("click",this._placeCenterMarker,this),this._map.on("click",this._finishShape,this),this._placeCircleCenter()},_placeCircleCenter:function(){var h=this._centerMarker.getLatLng();h&&(this._layer.setLatLng(h),this._hintMarker.on("move",this._syncHintLine,this),this._hintMarker.on("move",this._syncCircleRadius,this),this._hintMarker.setTooltipContent(Rt("tooltips.finishCircle")),this._fireCenterPlaced(),this._fireChange(this._layer.getLatLng(),"Draw"))},_finishShape:function(h){if(!this.options.requireSnapToFinish||this._hintMarker._snapped||this._isFirstLayer()){this._hintMarker._snapped||this._hintMarker.setLatLng(h.latlng);var p,_=this._centerMarker.getLatLng(),E=this._hintMarker.getLatLng();p=this._map.options.crs===L.CRS.Simple?this._map.distance(_,E):_.distanceTo(E),this.options.minRadiusCircle&&pthis.options.maxRadiusCircle&&(p=this.options.maxRadiusCircle);var I=St(St({},this.options.pathOptions),{},{radius:p}),V=L.circle(_,I);this._setPane(V,"layerPane"),this._finishLayer(V),V.addTo(this._map.pm._getContainingLayer()),V.pm&&V.pm._updateHiddenPolyCircle(),this._fireCreate(V),this.disable(),this.options.continueDrawing&&this.enable()}},_getNewDestinationOfHintMarker:function(){var h=this._hintMarker.getLatLng();if(!this._layerGroup.hasLayer(this._centerMarker))return h;var p=this._centerMarker.getLatLng(),_=p.distanceTo(h);return this.options.minRadiusCircle&&_this.options.maxRadiusCircle&&(h=Re(this._map,p,h,this.options.maxRadiusCircle)),h},_handleHintMarkerSnapping:function(){if(this._hintMarker._snapped){var h=this._centerMarker.getLatLng(),p=this._hintMarker.getLatLng(),_=h.distanceTo(p);this._layerGroup.hasLayer(this._centerMarker)&&(this.options.minRadiusCircle&&_this.options.maxRadiusCircle)&&this._hintMarker.setLatLng(this._hintMarker._orgLatLng)}this._hintMarker.setLatLng(this._getNewDestinationOfHintMarker())},setStyle:function(){var h,p;(h=this._layer)===null||h===void 0||h.setStyle(this.options.templineStyle),(p=this._hintline)===null||p===void 0||p.setStyle(this.options.hintlineStyle)}}),Z.CircleMarker=Z.Marker.extend({initialize:function(h){this._map=h,this._shape="CircleMarker",this.toolbarButtonName="drawCircleMarker",this._layerIsDragging=!1},enable:function(h){var p=this;if(L.Util.setOptions(this,h),this._enabled=!0,this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!0),this.options.editable){var _={};L.extend(_,this.options.templineStyle),_.radius=0,this._layerGroup=new L.FeatureGroup,this._layerGroup._pmTempLayer=!0,this._layerGroup.addTo(this._map),this._layer=L.circleMarker(this._map.getCenter(),_),this._setPane(this._layer,"layerPane"),this._layer._pmTempLayer=!0,this._centerMarker=L.marker(this._map.getCenter(),{icon:L.divIcon({className:"marker-icon"}),draggable:!1,zIndexOffset:100}),this._setPane(this._centerMarker,"vertexPane"),this._centerMarker._pmTempLayer=!0,this._hintMarker=L.marker(this._map.getCenter(),{zIndexOffset:110,icon:L.divIcon({className:"marker-icon cursor-marker"})}),this._setPane(this._hintMarker,"vertexPane"),this._hintMarker._pmTempLayer=!0,this._layerGroup.addLayer(this._hintMarker),this.options.cursorMarker&&L.DomUtil.addClass(this._hintMarker._icon,"visible"),this.options.tooltips&&this._hintMarker.bindTooltip(Rt("tooltips.startCircle"),{permanent:!0,offset:L.point(0,10),direction:"bottom",opacity:.8}).openTooltip(),this._hintline=L.polyline([],this.options.hintlineStyle),this._setPane(this._hintline,"layerPane"),this._hintline._pmTempLayer=!0,this._layerGroup.addLayer(this._hintline),this._map.on("click",this._placeCenterMarker,this),this._map._container.style.cursor="crosshair"}else this._map.on("click",this._createMarker,this),this._hintMarker=L.circleMarker(this._map.getCenter(),this.options.templineStyle),this._setPane(this._hintMarker,"layerPane"),this._hintMarker._pmTempLayer=!0,this._hintMarker.addTo(this._map),this._layer=this._hintMarker,this.options.tooltips&&this._hintMarker.bindTooltip(Rt("tooltips.placeCircleMarker"),{permanent:!0,offset:L.point(0,10),direction:"bottom",opacity:.8}).openTooltip();this._map.on("mousemove",this._syncHintMarker,this),!this.options.editable&&this.options.markerEditable&&this._map.eachLayer(function(E){p.isRelevantMarker(E)&&E.pm.enable()}),this._layer.bringToBack(),this._fireDrawStart(),this._setGlobalDrawMode()},disable:function(){var h=this;this._enabled&&(this._enabled=!1,this.options.editable?(this._map._container.style.cursor="",this._map.off("click",this._finishShape,this),this._map.off("click",this._placeCenterMarker,this),this._map.removeLayer(this._layerGroup)):(this._map.off("click",this._createMarker,this),this._map.eachLayer(function(p){h.isRelevantMarker(p)&&p.pm.disable()}),this._hintMarker.remove()),this._map.off("mousemove",this._syncHintMarker,this),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!1),this.options.snappable&&this._cleanupSnapping(),this._fireDrawEnd(),this._setGlobalDrawMode())},_placeCenterMarker:function(h){this._layerGroup.addLayer(this._layer),this._layerGroup.addLayer(this._centerMarker),this._hintMarker._snapped||this._hintMarker.setLatLng(h.latlng);var p=this._hintMarker.getLatLng();this._layerGroup.addLayer(this._layer),this._centerMarker.setLatLng(p),this._map.off("click",this._placeCenterMarker,this),this._map.on("click",this._finishShape,this),this._placeCircleCenter()},_placeCircleCenter:function(){var h=this._centerMarker.getLatLng();h&&(this._layer.setLatLng(h),this._hintMarker.on("move",this._syncHintLine,this),this._hintMarker.on("move",this._syncCircleRadius,this),this._hintMarker.setTooltipContent(Rt("tooltips.finishCircle")),this._fireCenterPlaced(),this._fireChange(this._layer.getLatLng(),"Draw"))},_syncHintLine:function(){var h=this._centerMarker.getLatLng(),p=this._getNewDestinationOfHintMarker();this._hintline.setLatLngs([h,p])},_syncCircleRadius:function(){var h=this._centerMarker.getLatLng(),p=this._hintMarker.getLatLng(),_=this._map.project(h).distanceTo(this._map.project(p));this.options.minRadiusCircleMarker&&_this.options.maxRadiusCircleMarker?this._layer.setRadius(this.options.maxRadiusCircleMarker):this._layer.setRadius(_)},_syncHintMarker:function(h){if(this._hintMarker.setLatLng(h.latlng),this._hintMarker.setLatLng(this._getNewDestinationOfHintMarker()),this.options.snappable){var p=h;p.target=this._hintMarker,this._handleSnapping(p)}this._handleHintMarkerSnapping();var _=this._layerGroup&&this._layerGroup.hasLayer(this._centerMarker)?this._centerMarker.getLatLng():this._hintMarker.getLatLng();this._fireChange(_,"Draw")},isRelevantMarker:function(h){return h instanceof L.CircleMarker&&!(h instanceof L.Circle)&&h.pm&&!h._pmTempLayer},_createMarker:function(h){if((!this.options.requireSnapToFinish||this._hintMarker._snapped||this._isFirstLayer())&&h.latlng&&!this._layerIsDragging){this._hintMarker._snapped||this._hintMarker.setLatLng(h.latlng);var p=this._hintMarker.getLatLng(),_=L.circleMarker(p,this.options.pathOptions);this._setPane(_,"layerPane"),this._finishLayer(_),_.addTo(this._map.pm._getContainingLayer()),_.pm&&this.options.markerEditable&&_.pm.enable(),this._fireCreate(_),this._cleanupSnapping(),this.options.continueDrawing||this.disable()}},_finishShape:function(h){if(!this.options.requireSnapToFinish||this._hintMarker._snapped||this._isFirstLayer()){this._hintMarker._snapped||this._hintMarker.setLatLng(h.latlng);var p=this._centerMarker.getLatLng(),_=this._hintMarker.getLatLng(),E=this._map.project(p).distanceTo(this._map.project(_));this.options.editable&&(this.options.minRadiusCircleMarker&&Ethis.options.maxRadiusCircleMarker&&(E=this.options.maxRadiusCircleMarker));var I=re(re({},this.options.pathOptions),{},{radius:E}),V=L.circleMarker(p,I);this._setPane(V,"layerPane"),this._finishLayer(V),V.addTo(this._map.pm._getContainingLayer()),V.pm&&V.pm._updateHiddenPolyCircle(),this._fireCreate(V),this.disable(),this.options.continueDrawing&&this.enable()}},_getNewDestinationOfHintMarker:function(){var h=this._hintMarker.getLatLng();if(this.options.editable){if(!this._layerGroup.hasLayer(this._centerMarker))return h;var p=this._centerMarker.getLatLng(),_=this._map.project(p).distanceTo(this._map.project(h));this.options.minRadiusCircleMarker&&_this.options.maxRadiusCircleMarker&&(h=Re(this._map,p,h,this._pxRadiusToMeter(this.options.maxRadiusCircleMarker)))}return h},_handleHintMarkerSnapping:function(){if(this.options.editable){if(this._hintMarker._snapped){var h=this._centerMarker.getLatLng(),p=this._hintMarker.getLatLng(),_=this._map.project(h).distanceTo(this._map.project(p));this._layerGroup.hasLayer(this._centerMarker)&&(this.options.minRadiusCircleMarker&&_this.options.maxRadiusCircleMarker)&&this._hintMarker.setLatLng(this._hintMarker._orgLatLng)}this._hintMarker.setLatLng(this._getNewDestinationOfHintMarker())}},_pxRadiusToMeter:function(h){var p=this._centerMarker.getLatLng(),_=this._map.project(p),E=L.point(_.x+h,_.y);return this._map.unproject(E).distanceTo(p)},setStyle:function(){var h,p,_={};L.extend(_,this.options.templineStyle),this.options.editable&&(_.radius=0),(h=this._layer)===null||h===void 0||h.setStyle(_),(p=this._hintline)===null||p===void 0||p.setStyle(this.options.hintlineStyle)}});let Ei=function(h){if(!h)throw new Error("geojson is required");var p=[];return Ut(h,function(_){(function(E,I){var V=[],nt=E.geometry;if(nt!==null){switch(nt.type){case"Polygon":V=cn(nt);break;case"LineString":V=[cn(nt)]}V.forEach(function(it){var rt=function(ot,dt){var Pt=[];return ot.reduce(function(yt,At){var Gt,te,Dt,Rn,Tn,Ie,Ar=vt([yt,At],dt);return Ar.bbox=(te=At,Dt=(Gt=yt)[0],Rn=Gt[1],Tn=te[0],Ie=te[1],[DtTn?Dt:Tn,Rn>Ie?Rn:Ie]),Pt.push(Ar),At}),Pt}(it,E.properties);rt.forEach(function(ot){ot.id=I.length,I.push(ot)})})}})(_,p)}),Ft(p)};var oi=c(1787);function xe(h,p){var _=cn(h),E=cn(p);if(_.length!==2)throw new Error(" line1 must only contain 2 coordinates");if(E.length!==2)throw new Error(" line2 must only contain 2 coordinates");var I=_[0][0],V=_[0][1],nt=_[1][0],it=_[1][1],rt=E[0][0],ot=E[0][1],dt=E[1][0],Pt=E[1][1],yt=(Pt-ot)*(nt-I)-(dt-rt)*(it-V),At=(dt-rt)*(V-ot)-(Pt-ot)*(I-rt),Gt=(nt-I)*(V-ot)-(it-V)*(I-rt);if(yt===0)return null;var te=At/yt,Dt=Gt/yt;return te>=0&&te<=1&&Dt>=0&&Dt<=1?Lt([I+te*(nt-I),V+te*(it-V)]):null}let Kn=function(h,p){var _={},E=[];if(h.type==="LineString"&&(h=pt(h)),p.type==="LineString"&&(p=pt(p)),h.type==="Feature"&&p.type==="Feature"&&h.geometry!==null&&p.geometry!==null&&h.geometry.type==="LineString"&&p.geometry.type==="LineString"&&h.geometry.coordinates.length===2&&p.geometry.coordinates.length===2){var I=xe(h,p);return I&&E.push(I),Ft(E)}var V=oi();return V.load(Ei(p)),Wn(Ei(h),function(nt){Wn(V.search(nt),function(it){var rt=xe(nt,it);if(rt){var ot=cn(rt).join(",");_[ot]||(_[ot]=!0,E.push(rt))}})}),Ft(E)},$n=function(h,p,_){_===void 0&&(_={});var E=zn(h),I=zn(p),V=jt(I[1]-E[1]),nt=jt(I[0]-E[0]),it=jt(E[1]),rt=jt(I[1]),ot=Math.pow(Math.sin(V/2),2)+Math.pow(Math.sin(nt/2),2)*Math.cos(it)*Math.cos(rt);return Wt(2*Math.atan2(Math.sqrt(ot),Math.sqrt(1-ot)),_.units)},jr=function(h){var p=h[0],_=h[1],E=h[2],I=h[3];if($n(h.slice(0,2),[E,_])>=$n(h.slice(0,2),[p,I])){var V=(_+I)/2;return[p,V-(E-p)/2,E,V+(E-p)/2]}var nt=(p+E)/2;return[nt-(I-_)/2,_,nt+(I-_)/2,I]};function wn(h){var p=[1/0,1/0,-1/0,-1/0];return wo(h,function(_){p[0]>_[0]&&(p[0]=_[0]),p[1]>_[1]&&(p[1]=_[1]),p[2]<_[0]&&(p[2]=_[0]),p[3]<_[1]&&(p[3]=_[1])}),p}wn.default=wn;let ar=wn,Or=function(h,p){p===void 0&&(p={});var _=p.precision,E=p.coordinates,I=p.mutate;if(_=_==null||isNaN(_)?6:_,E=E==null||isNaN(E)?3:E,!h)throw new Error(" is required");if(typeof _!="number")throw new Error(" must be a number");if(typeof E!="number")throw new Error(" must be a number");I!==!1&&I!==void 0||(h=JSON.parse(JSON.stringify(h)));var V=Math.pow(10,_);return wo(h,function(nt){(function(it,rt,ot){it.length>ot&&it.splice(ot,it.length);for(var dt=0;dt0&&((Dt=te.features[0]).properties.dist=$n(p,Dt,_),Dt.properties.location=I+$n(rt,Dt,_)),rt.properties.dist1&&_.push(vt(ot)),Ft(_)}function Di(h,p){if(!p.features.length)throw new Error("lines must contain features");if(p.features.length===1)return p.features[0];var _,E=1/0;return Wn(p,function(I){var V=Lo(I,h).properties.dist;V=yt[0]&&At[3]>=yt[1]}(E,nt)===!1)return!1;V==="Polygon"&&(it=[it]);for(var rt=!1,ot=0;oth[1]!=ot>h[1]&&h[0]<(rt-nt)*(h[1]-it)/(ot-it)+nt&&(E=!E)}return E}function Nr(h,p,_,E,I){var V=_[0],nt=_[1],it=h[0],rt=h[1],ot=p[0],dt=p[1],Pt=ot-it,yt=dt-rt,At=(_[0]-it)*yt-(_[1]-rt)*Pt;if(I!==null){if(Math.abs(At)>I)return!1}else if(At!==0)return!1;return E?E==="start"?Math.abs(Pt)>=Math.abs(yt)?Pt>0?it0?rt=Math.abs(yt)?Pt>0?it<=V&&V0?rt<=nt&&nt=Math.abs(yt)?Pt>0?it0?rt=Math.abs(yt)?Pt>0?it<=V&&V<=ot:ot<=V&&V<=it:yt>0?rt<=nt&&nt<=dt:dt<=nt&&nt<=rt}let dr=function(h,p,_){_===void 0&&(_={});for(var E=zn(h),I=cn(p),V=0;V"u"?null:_.epsilon))return!0}return!1};function ur(h,p){var _=or(h),E=or(p),I=_.type,V=E.type,nt=_.coordinates,it=E.coordinates;switch(I){case"Point":if(V==="Point")return Bi(nt,it);throw new Error("feature2 "+V+" geometry not supported");case"MultiPoint":switch(V){case"Point":return function(rt,ot){var dt,Pt=!1;for(dt=0;dtp[0])&&!(h[2]p[1])&&!(h[3]1?p.forEach(function(I){E.push(function(V){return Rr({type:"LineString",coordinates:V})}(I))}):E.push(h),E}function bo(h){var p=[];return h.eachLayer(function(_){p.push(Pi(_.toGeoJSON(15)))}),function(_){return Rr({type:"MultiLineString",coordinates:_})}(p)}function Kt(h,p){return function(_){if(Array.isArray(_))return _}(h)||function(_,E){var I=_==null?null:typeof Symbol<"u"&&_[Symbol.iterator]||_["@@iterator"];if(I!=null){var V,nt,it=[],rt=!0,ot=!1;try{for(I=I.call(_);!(rt=(V=I.next()).done)&&(it.push(V.value),!E||it.length!==E);rt=!0);}catch(dt){ot=!0,nt=dt}finally{try{rt||I.return==null||I.return()}finally{if(ot)throw nt}}return it}}(h,p)||function(_,E){if(_){if(typeof _=="string")return eo(_,E);var I=Object.prototype.toString.call(_).slice(8,-1);if(I==="Object"&&_.constructor&&(I=_.constructor.name),I==="Map"||I==="Set")return Array.from(_);if(I==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(I))return eo(_,E)}}(h,p)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function eo(h,p){(p==null||p>h.length)&&(p=h.length);for(var _=0,E=new Array(p);_h.length)&&(p=h.length);for(var _=0,E=new Array(p);_0)||p.options.layersToCut.indexOf(I)>-1}).filter(function(I){return!p._layerGroup.hasLayer(I)}).filter(function(I){try{var V=!!Kn(h.toGeoJSON(15),I.toGeoJSON(15)).features.length>0;return V||I instanceof L.Polyline&&!(I instanceof L.Polygon)?V:(nt=h.toGeoJSON(15),it=I.toGeoJSON(15),rt=Un(nt),ot=Un(it),!((dt=le().intersection(rt.coordinates,ot.coordinates)).length===0||!(dt.length===1?fo(dt[0]):Zt(dt))))}catch{return I instanceof L.Polygon&&console.error("You can't cut polygons with self-intersections"),!1}var nt,it,rt,ot,dt}).forEach(function(I){var V;if(I instanceof L.Polygon){var nt=(V=L.polygon(I.getLatLngs())).getLatLngs();E.forEach(function(yt){if(yt&&yt.snapInfo){var At=yt.latlng,Gt=p._calcClosestLayer(At,[V]);if(Gt&&Gt.segment&&Gt.distance1?ft()(nt,Tn):nt).splice(Ie,0,At)}}}})}else V=I;var it=p._cutLayer(h,V),rt=L.geoJSON(it,I.options);if(rt.getLayers().length===1){var ot=rt.getLayers();rt=Kt(ot,1)[0]}p._setPane(rt,"layerPane");var dt=rt.addTo(p._map.pm._getContainingLayer());if(dt.pm.enable(I.pm.options),dt.pm.disable(),I._pmTempLayer=!0,h._pmTempLayer=!0,I.remove(),I.removeFrom(p._map.pm._getContainingLayer()),h.remove(),h.removeFrom(p._map.pm._getContainingLayer()),dt.getLayers&&dt.getLayers().length===0&&p._map.pm.removeLayer({target:dt}),dt instanceof L.LayerGroup&&dt.eachLayer(function(yt){p._addDrawnLayerProp(yt)}),p._addDrawnLayerProp(dt),p.options.layersToCut&&L.Util.isArray(p.options.layersToCut)&&p.options.layersToCut.length>0){var Pt=p.options.layersToCut.indexOf(I);Pt>-1&&p.options.layersToCut.splice(Pt,1)}p._editedLayers.push({layer:dt,originalLayer:I})})},_cutLayer:function(h,p){var _,E,I,V,nt,it,rt=L.geoJSON();if(p instanceof L.Polygon)E=p.toGeoJSON(15),I=h.toGeoJSON(15),V=Un(E),nt=Un(I),_=(it=le().difference(V.coordinates,nt.coordinates)).length===0?null:it.length===1?fo(it[0]):Zt(it);else{var ot=Wr(p);ot.forEach(function(dt){var Pt=Mi(dt,h.toGeoJSON(15));(Pt&&Pt.features.length>0?L.geoJSON(Pt):L.geoJSON(dt)).getLayers().forEach(function(yt){ur(h.toGeoJSON(15),yt.toGeoJSON(15))||yt.addTo(rt)})}),_=ot.length>1?bo(rt):rt.toGeoJSON(15)}return _},_change:L.Util.falseFn}),Z.Text=Z.extend({initialize:function(h){this._map=h,this._shape="Text",this.toolbarButtonName="drawText"},enable:function(h){L.Util.setOptions(this,h),this._enabled=!0,this._map.on("click",this._createMarker,this),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!0),this._hintMarker=L.marker(this._map.getCenter(),{interactive:!1,zIndexOffset:100,icon:L.divIcon({className:"marker-icon cursor-marker"})}),this._setPane(this._hintMarker,"vertexPane"),this._hintMarker._pmTempLayer=!0,this._hintMarker.addTo(this._map),this.options.cursorMarker&&L.DomUtil.addClass(this._hintMarker._icon,"visible"),this.options.tooltips&&this._hintMarker.bindTooltip(Rt("tooltips.placeText"),{permanent:!0,offset:L.point(0,10),direction:"bottom",opacity:.8}).openTooltip(),this._layer=this._hintMarker,this._map.on("mousemove",this._syncHintMarker,this),this._fireDrawStart(),this._setGlobalDrawMode()},disable:function(){this._enabled&&(this._enabled=!1,this._map.off("click",this._createMarker,this),this._hintMarker.remove(),this._map.off("mousemove",this._syncHintMarker,this),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!1),this.options.snappable&&this._cleanupSnapping(),this._fireDrawEnd(),this._setGlobalDrawMode())},enabled:function(){return this._enabled},toggle:function(h){this.enabled()?this.disable():this.enable(h)},_syncHintMarker:function(h){if(this._hintMarker.setLatLng(h.latlng),this.options.snappable){var p=h;p.target=this._hintMarker,this._handleSnapping(p)}},_createMarker:function(h){var p;if(h.latlng&&(!this.options.requireSnapToFinish||this._hintMarker._snapped||this._isFirstLayer())){this._hintMarker._snapped||this._hintMarker.setLatLng(h.latlng);var _=this._hintMarker.getLatLng();if(this.textArea=this._createTextArea(),(p=this.options.textOptions)!==null&&p!==void 0&&p.className){var E,I=this.options.textOptions.className.split(" ");(E=this.textArea.classList).add.apply(E,Jo(I))}var V=this._createTextIcon(this.textArea),nt=new L.Marker(_,{textMarker:!0,_textMarkerOverPM:!0,icon:V});if(this._setPane(nt,"markerPane"),this._finishLayer(nt),nt.pm||(nt.options.draggable=!1),nt.addTo(this._map.pm._getContainingLayer()),nt.pm){var it,rt,ot,dt,Pt;nt.pm.textArea=this.textArea,L.setOptions(nt.pm,{removeIfEmpty:(it=(rt=this.options.textOptions)===null||rt===void 0?void 0:rt.removeIfEmpty)===null||it===void 0||it});var yt=(ot=(dt=this.options.textOptions)===null||dt===void 0?void 0:dt.focusAfterDraw)===null||ot===void 0||ot;nt.pm._createTextMarker(yt),(Pt=this.options.textOptions)!==null&&Pt!==void 0&&Pt.text&&nt.pm.setText(this.options.textOptions.text)}this._fireCreate(nt),this._cleanupSnapping(),this.disable(),this.options.continueDrawing&&this.enable()}},_createTextArea:function(){var h=document.createElement("textarea");return h.autofocus=!0,h.readOnly=!0,h.classList.add("pm-textarea","pm-disabled"),h},_createTextIcon:function(h){return L.divIcon({className:"pm-text-marker",html:h})}});let De={enableLayerDrag:function(){if(this.options.draggable&&this._layer._map){this.disable(),this._layerDragEnabled=!0,this._map||(this._map=this._layer._map),(this._layer instanceof L.Marker||this._layer instanceof L.ImageOverlay)&&L.DomEvent.on(this._getDOMElem(),"dragstart",this._stopDOMImageDrag),this._layer.dragging&&this._layer.dragging.disable(),this._tempDragCoord=null,Bt(this._layer)instanceof L.Canvas?(this._layer.on("mouseout",this.removeDraggingClass,this),this._layer.on("mouseover",this.addDraggingClass,this)):this.addDraggingClass(),this._originalMapDragState=this._layer._map.dragging._enabled,this._safeToCacheDragState=!0;var h=this._getDOMElem();h&&(Bt(this._layer)instanceof L.Canvas?(this._layer.on("touchstart mousedown",this._dragMixinOnMouseDown,this),this._map.pm._addTouchEvents(h)):L.DomEvent.on(h,"touchstart mousedown",this._simulateMouseDownEvent,this)),this._fireDragEnable()}},disableLayerDrag:function(){this._layerDragEnabled=!1,Bt(this._layer)instanceof L.Canvas?(this._layer.off("mouseout",this.removeDraggingClass,this),this._layer.off("mouseover",this.addDraggingClass,this)):this.removeDraggingClass(),this._originalMapDragState&&this._dragging&&this._map.dragging.enable(),this._safeToCacheDragState=!1,this._layer.dragging&&this._layer.dragging.disable();var h=this._getDOMElem();h&&(Bt(this._layer)instanceof L.Canvas?(this._layer.off("touchstart mousedown",this._dragMixinOnMouseDown,this),this._map.pm._removeTouchEvents(h)):L.DomEvent.off(h,"touchstart mousedown",this._simulateMouseDownEvent,this)),this._layerDragged&&this._fireUpdate(),this._layerDragged=!1,this._fireDragDisable()},dragging:function(){return this._dragging},layerDragEnabled:function(){return!!this._layerDragEnabled},_simulateMouseDownEvent:function(h){var p=h.touches?h.touches[0]:h,_={originalEvent:p,target:this._layer};return _.containerPoint=this._map.mouseEventToContainerPoint(p),_.latlng=this._map.containerPointToLatLng(_.containerPoint),this._dragMixinOnMouseDown(_),!1},_simulateMouseMoveEvent:function(h){var p=h.touches?h.touches[0]:h,_={originalEvent:p,target:this._layer};return _.containerPoint=this._map.mouseEventToContainerPoint(p),_.latlng=this._map.containerPointToLatLng(_.containerPoint),this._dragMixinOnMouseMove(_),!1},_simulateMouseUpEvent:function(h){var p={originalEvent:h.touches?h.touches[0]:h,target:this._layer};return h.type.indexOf("touch")===-1&&(p.containerPoint=this._map.mouseEventToContainerPoint(h),p.latlng=this._map.containerPointToLatLng(p.containerPoint)),this._dragMixinOnMouseUp(p),!1},_dragMixinOnMouseDown:function(h){if(!(h.originalEvent.button>0)){this._overwriteEventIfItComesFromMarker(h);var p=h._fromLayerSync,_=this._syncLayers("_dragMixinOnMouseDown",h);this._layer instanceof L.Marker&&(!this.options.snappable||p||_?this._disableSnapping():this._initSnappableMarkers()),this._layer instanceof L.CircleMarker&&!(this._layer instanceof L.Circle)&&(!this.options.snappable||p||_?this._layer.pm.options.editable?this._layer.pm._disableSnapping():this._layer.pm._disableSnappingDrag():this._layer.pm.options.editable||this._initSnappableMarkersDrag()),this._safeToCacheDragState&&(this._originalMapDragState=this._layer._map.dragging._enabled,this._safeToCacheDragState=!1),this._tempDragCoord=h.latlng,L.DomEvent.on(this._map.getContainer(),"touchend mouseup",this._simulateMouseUpEvent,this),L.DomEvent.on(this._map.getContainer(),"touchmove mousemove",this._simulateMouseMoveEvent,this)}},_dragMixinOnMouseMove:function(h){this._overwriteEventIfItComesFromMarker(h);var p=this._getDOMElem();this._syncLayers("_dragMixinOnMouseMove",h),this._dragging||(this._dragging=!0,L.DomUtil.addClass(p,"leaflet-pm-dragging"),this._layer instanceof L.Marker||this._layer.bringToFront(),this._originalMapDragState&&this._map.dragging.disable(),this._fireDragStart()),this._tempDragCoord||(this._tempDragCoord=h.latlng),this._onLayerDrag(h),this._layer instanceof L.CircleMarker&&this._layer.pm._updateHiddenPolyCircle()},_dragMixinOnMouseUp:function(h){var p=this,_=this._getDOMElem();return this._syncLayers("_dragMixinOnMouseUp",h),this._originalMapDragState&&this._map.dragging.enable(),this._safeToCacheDragState=!0,L.DomEvent.off(this._map.getContainer(),"touchmove mousemove",this._simulateMouseMoveEvent,this),L.DomEvent.off(this._map.getContainer(),"touchend mouseup",this._simulateMouseUpEvent,this),!!this._dragging&&(this._layer instanceof L.CircleMarker&&this._layer.pm._updateHiddenPolyCircle(),this._layerDragged=!0,window.setTimeout(function(){p._dragging=!1,_&&L.DomUtil.removeClass(_,"leaflet-pm-dragging"),p._fireDragEnd(),p._fireEdit(),p._layerEdited=!0},10),!0)},_onLayerDrag:function(h){var p=h.latlng,_=p.lat-this._tempDragCoord.lat,E=p.lng-this._tempDragCoord.lng,I=function dt(Pt){return Pt.map(function(yt){if(Array.isArray(yt))return dt(yt);var At={lat:yt.lat+_,lng:yt.lng+E};return(yt.alt||yt.alt===0)&&(At.alt=yt.alt),At})};if(this._layer instanceof L.Circle||this._layer instanceof L.CircleMarker&&this._layer.options.editable){var V=I([this._layer.getLatLng()]);this._layer.setLatLng(V[0]),this._fireChange(this._layer.getLatLng(),"Edit")}else if(this._layer instanceof L.CircleMarker||this._layer instanceof L.Marker){var nt=this._layer.getLatLng();this._layer._snapped&&(nt=this._layer._orgLatLng);var it=I([nt]);this._layer.setLatLng(it[0]),this._fireChange(this._layer.getLatLng(),"Edit")}else if(this._layer instanceof L.ImageOverlay){var rt=I([this._layer.getBounds().getNorthWest(),this._layer.getBounds().getSouthEast()]);this._layer.setBounds(rt),this._fireChange(this._layer.getBounds(),"Edit")}else{var ot=I(this._layer.getLatLngs());this._layer.setLatLngs(ot),this._fireChange(this._layer.getLatLngs(),"Edit")}this._tempDragCoord=p,h.layer=this._layer,this._fireDrag(h)},addDraggingClass:function(){var h=this._getDOMElem();h&&L.DomUtil.addClass(h,"leaflet-pm-draggable")},removeDraggingClass:function(){var h=this._getDOMElem();h&&L.DomUtil.removeClass(h,"leaflet-pm-draggable")},_getDOMElem:function(){var h=null;return this._layer._path?h=this._layer._path:this._layer._renderer&&this._layer._renderer._container?h=this._layer._renderer._container:this._layer._image?h=this._layer._image:this._layer._icon&&(h=this._layer._icon),h},_overwriteEventIfItComesFromMarker:function(h){h.target.getLatLng&&(!h.target._radius||h.target._radius<=10)&&(h.containerPoint=this._map.mouseEventToContainerPoint(h.originalEvent),h.latlng=this._map.containerPointToLatLng(h.containerPoint))},_syncLayers:function(h,p){var _=this;if(this.enabled())return!1;if(!p._fromLayerSync&&this._layer===p.target&&this.options.syncLayersOnDrag){p._fromLayerSync=!0;var E=[];if(L.Util.isArray(this.options.syncLayersOnDrag))E=this.options.syncLayersOnDrag,this.options.syncLayersOnDrag.forEach(function(nt){nt instanceof L.LayerGroup&&(E=E.concat(nt.pm.getLayers(!0)))});else if(this.options.syncLayersOnDrag===!0&&this._parentLayerGroup)for(var I in this._parentLayerGroup){var V=this._parentLayerGroup[I];V.pm&&(E=V.pm.getLayers(!0))}return L.Util.isArray(E)&&E.length>0&&(E=E.filter(function(nt){return!!nt.pm}).filter(function(nt){return!!nt.pm.options.draggable})).forEach(function(nt){nt!==_._layer&&nt.pm[h]&&(nt._snapped=!1,nt.pm[h](p))}),E.length>0}return!1},_stopDOMImageDrag:function(h){return h.preventDefault(),!1}};function gr(h,p,_){var E=_.getMaxZoom();if(E===1/0&&(E=_.getZoom()),L.Util.isArray(h)){var I=[];return h.forEach(function(V){I.push(gr(V,p,_))}),I}return h instanceof L.LatLng?function(V,nt,it,rt){return it.unproject(nt.transform(it.project(V,rt)),rt)}(h,p,_,E):null}function ai(h,p){p instanceof L.Layer&&(p=p.getLatLng());var _=h.getMaxZoom();return _===1/0&&(_=h.getZoom()),h.project(p,_)}function Vi(h,p){var _=h.getMaxZoom();return _===1/0&&(_=h.getZoom()),h.unproject(p,_)}var It={_onRotateStart:function(h){this._preventRenderingMarkers(!0),this._rotationOriginLatLng=this._getRotationCenter().clone(),this._rotationOriginPoint=ai(this._map,this._rotationOriginLatLng),this._rotationStartPoint=ai(this._map,h.target.getLatLng()),this._initialRotateLatLng=fe(this._layer),this._startAngle=this.getAngle();var p=fe(this._rotationLayer,this._rotationLayer.pm._rotateOrgLatLng);this._fireRotationStart(this._rotationLayer,p),this._fireRotationStart(this._map,p)},_onRotate:function(h){var p=ai(this._map,h.target.getLatLng()),_=this._rotationStartPoint,E=this._rotationOriginPoint,I=Math.atan2(p.y-E.y,p.x-E.x)-Math.atan2(_.y-E.y,_.x-E.x);this._layer.setLatLngs(this._rotateLayer(I,this._initialRotateLatLng,this._rotationOriginLatLng,L.PM.Matrix.init(),this._map));var V=this;(function ot(dt){var Pt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],yt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:-1;if(yt>-1&&Pt.push(yt),L.Util.isArray(dt[0]))dt.forEach(function(Gt,te){return ot(Gt,Pt.slice(),te)});else{var At=ft()(V._markers,Pt);dt.forEach(function(Gt,te){At[te].setLatLng(Gt)})}})(this._layer.getLatLngs());var nt=fe(this._rotationLayer);this._rotationLayer.setLatLngs(this._rotateLayer(I,this._rotationLayer.pm._rotateOrgLatLng,this._rotationOriginLatLng,L.PM.Matrix.init(),this._map));var it=180*I/Math.PI,rt=(it=it<0?it+360:it)+this._startAngle;this._setAngle(rt),this._rotationLayer.pm._setAngle(rt),this._fireRotation(this._rotationLayer,it,nt),this._fireRotation(this._map,it,nt),this._rotationLayer.pm._fireChange(this._rotationLayer.getLatLngs(),"Rotation")},_onRotateEnd:function(){var h=this._startAngle;delete this._rotationOriginLatLng,delete this._rotationOriginPoint,delete this._rotationStartPoint,delete this._initialRotateLatLng,delete this._startAngle;var p=fe(this._rotationLayer,this._rotationLayer.pm._rotateOrgLatLng);this._rotationLayer.pm._rotateOrgLatLng=fe(this._rotationLayer),this._fireRotationEnd(this._rotationLayer,h,p),this._fireRotationEnd(this._map,h,p),this._rotationLayer.pm._fireEdit(this._rotationLayer,"Rotation"),this._preventRenderingMarkers(!1),this._layerRotated=!0},_rotateLayer:function(h,p,_,E,I){var V=ai(I,_);return this._matrix=E.clone().rotate(h,V).flip(),gr(p,this._matrix,I)},_setAngle:function(h){h=h<0?h+360:h,this._angle=h%360},_getRotationCenter:function(){var h=L.polygon(this._layer.getLatLngs(),{stroke:!1,fill:!1,pmIgnore:!0}).addTo(this._layer._map),p=h.getCenter();return h.removeFrom(this._layer._map),p},enableRotate:function(){this.options.allowRotation?(this.rotateEnabled()&&this.disableRotate(),this._rotatePoly=L.polygon(this._layer.getLatLngs(),{fill:!1,stroke:!1,pmIgnore:!1,snapIgnore:!0}),this._rotatePoly._pmTempLayer=!0,this._rotatePoly.addTo(this._layer._map),this._rotatePoly.pm._setAngle(this.getAngle()),this._rotatePoly.pm.setOptions(this._layer._map.pm.getGlobalOptions()),this._rotatePoly.pm.setOptions({rotate:!0,snappable:!1,hideMiddleMarkers:!0}),this._rotatePoly.pm._rotationLayer=this._layer,this._rotatePoly.pm.enable(),this._rotateOrgLatLng=fe(this._layer),this._rotateEnabled=!0,this._layer.on("remove",this.disableRotate,this),this._fireRotationEnable(this._layer),this._fireRotationEnable(this._layer._map)):this.disableRotate()},disableRotate:function(){this.rotateEnabled()&&(this._rotatePoly.pm._layerRotated&&this._fireUpdate(),this._rotatePoly.pm._layerRotated=!1,this._rotatePoly.pm.disable(),this._rotatePoly.remove(),this._rotatePoly.pm.setOptions({rotate:!1}),this._rotatePoly=void 0,this._rotateOrgLatLng=void 0,this._layer.off("remove",this.disableRotate,this),this._rotateEnabled=!1,this._fireRotationDisable(this._layer),this._fireRotationDisable(this._layer._map))},rotateEnabled:function(){return this._rotateEnabled},rotateLayer:function(h){var p=this.getAngle(),_=this._layer.getLatLngs(),E=h*(Math.PI/180);this._layer.setLatLngs(this._rotateLayer(E,this._layer.getLatLngs(),this._getRotationCenter(),L.PM.Matrix.init(),this._layer._map)),this._rotateOrgLatLng=L.polygon(this._layer.getLatLngs()).getLatLngs(),this._setAngle(this.getAngle()+h),this.rotateEnabled()&&this._rotatePoly&&this._rotatePoly.pm.enabled()&&(this._rotatePoly.setLatLngs(this._rotateLayer(E,this._rotatePoly.getLatLngs(),this._getRotationCenter(),L.PM.Matrix.init(),this._rotatePoly._map)),this._rotatePoly.pm._initMarkers());var I=this.getAngle()-p;I=I<0?I+360:I,this._startAngle=p,this._fireRotation(this._layer,I,_,this._layer),this._fireRotation(this._map||this._layer._map,I,_,this._layer),delete this._startAngle,this._fireChange(this._layer.getLatLngs(),"Rotation")},rotateLayerToAngle:function(h){var p=h-this.getAngle();this.rotateLayer(p)},getAngle:function(){return this._angle||0},setInitAngle:function(h){this._setAngle(h)}};let zi=It,fn=L.Class.extend({includes:[De,F,zi,bt],options:{snappable:!0,snapDistance:20,allowSelfIntersection:!0,allowSelfIntersectionEdit:!1,preventMarkerRemoval:!1,removeLayerBelowMinVertexCount:!0,limitMarkersToCount:-1,hideMiddleMarkers:!1,snapSegment:!0,syncLayersOnDrag:!1,draggable:!0,allowEditing:!0,allowRemoval:!0,allowCutting:!0,allowRotation:!0,addVertexOn:"click",removeVertexOn:"contextmenu",removeVertexValidation:void 0,addVertexValidation:void 0,moveVertexValidation:void 0},setOptions:function(h){L.Util.setOptions(this,h)},getOptions:function(){return this.options},applyOptions:function(){},isPolygon:function(){return this._layer instanceof L.Polygon},getShape:function(){return this._shape},_setPane:function(h,p){p==="layerPane"?h.options.pane=this._map.pm.globalOptions.panes&&this._map.pm.globalOptions.panes.layerPane||"overlayPane":p==="vertexPane"?h.options.pane=this._map.pm.globalOptions.panes&&this._map.pm.globalOptions.panes.vertexPane||"markerPane":p==="markerPane"&&(h.options.pane=this._map.pm.globalOptions.panes&&this._map.pm.globalOptions.panes.markerPane||"markerPane")},remove:function(){(this._map||this._layer._map).pm.removeLayer({target:this._layer})},_vertexValidation:function(h,p){var _=p.target,E={layer:this._layer,marker:_,event:p},I="";return h==="move"?I="moveVertexValidation":h==="add"?I="addVertexValidation":h==="remove"&&(I="removeVertexValidation"),this.options[I]&&typeof this.options[I]=="function"&&!this.options[I](E)?(h==="move"&&(_._cancelDragEventChain=_.getLatLng()),!1):(_._cancelDragEventChain=null,!0)},_vertexValidationDrag:function(h){return!h._cancelDragEventChain||(h._latlng=h._cancelDragEventChain,h.update(),!1)},_vertexValidationDragEnd:function(h){return!h._cancelDragEventChain||(h._cancelDragEventChain=null,!1)}});function Qn(h){return function(p){if(Array.isArray(p))return Ci(p)}(h)||function(p){if(typeof Symbol<"u"&&p[Symbol.iterator]!=null||p["@@iterator"]!=null)return Array.from(p)}(h)||function(p,_){if(p){if(typeof p=="string")return Ci(p,_);var E=Object.prototype.toString.call(p).slice(8,-1);if(E==="Object"&&p.constructor&&(E=p.constructor.name),E==="Map"||E==="Set")return Array.from(p);if(E==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(E))return Ci(p,_)}}(h)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +`)}return t.toString()},Xr.prototype.computeEdgeEndLabels=function(t){for(var e=this.iterator();e.hasNext();)e.next().computeLabel(t)},Xr.prototype.computeLabelling=function(t){this.computeEdgeEndLabels(t[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var e=[!1,!1],o=this.iterator();o.hasNext();)for(var u=o.next().getLabel(),d=0;d<2;d++)u.isLine(d)&&u.getLocation(d)===Q.BOUNDARY&&(e[d]=!0);for(var w=this.iterator();w.hasNext();)for(var S=w.next(),U=S.getLabel(),$=0;$<2;$++)if(U.isAnyNull($)){var ut=Q.NONE;if(e[$])ut=Q.EXTERIOR;else{var _t=S.getCoordinate();ut=this.getLocation($,_t,t)}U.setAllLocationsIfNull($,ut)}},Xr.prototype.getDegree=function(){return this._edgeMap.size()},Xr.prototype.insertEdgeEnd=function(t,e){this._edgeMap.put(t,e),this._edgeList=null},Xr.prototype.interfaces_=function(){return[]},Xr.prototype.getClass=function(){return Xr};var _o=function(t){function e(){t.call(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.linkResultDirectedEdges=function(){this.getResultAreaEdges();for(var o=null,u=null,d=this._SCANNING_FOR_INCOMING,w=0;w=0;d--){var w=this._edgeList.get(d),S=w.getSym();u===null&&(u=S),o!==null&&S.setNext(o),o=w}u.setNext(o)},e.prototype.computeDepths=function(){if(arguments.length===1){var o=arguments[0],u=this.findIndex(o),d=o.getDepth(It.LEFT),w=o.getDepth(It.RIGHT),S=this.computeDepths(u+1,this._edgeList.size(),d);if(this.computeDepths(0,u,S)!==w)throw new Qn("depth mismatch at "+o.getCoordinate())}else if(arguments.length===3){for(var U=arguments[0],$=arguments[1],ut=arguments[2],_t=U;_t<$;_t++){var wt=this._edgeList.get(_t);wt.setEdgeDepths(It.RIGHT,ut),ut=wt.getDepth(It.LEFT)}return ut}},e.prototype.mergeSymLabels=function(){for(var o=this.iterator();o.hasNext();){var u=o.next();u.getLabel().merge(u.getSym().getLabel())}},e.prototype.linkMinimalDirectedEdges=function(o){for(var u=null,d=null,w=this._SCANNING_FOR_INCOMING,S=this._resultAreaEdgeList.size()-1;S>=0;S--){var U=this._resultAreaEdgeList.get(S),$=U.getSym();switch(u===null&&U.getEdgeRing()===o&&(u=U),w){case this._SCANNING_FOR_INCOMING:if($.getEdgeRing()!==o)continue;d=$,w=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(U.getEdgeRing()!==o)continue;d.setNextMin(U),w=this._SCANNING_FOR_INCOMING}}w===this._LINKING_TO_OUTGOING&&(C.isTrue(u!==null,"found null for first outgoing dirEdge"),C.isTrue(u.getEdgeRing()===o,"unable to link last incoming dirEdge"),d.setNextMin(u))},e.prototype.getOutgoingDegree=function(){if(arguments.length===0){for(var o=0,u=this.iterator();u.hasNext();)u.next().isInResult()&&o++;return o}if(arguments.length===1){for(var d=arguments[0],w=0,S=this.iterator();S.hasNext();)S.next().getEdgeRing()===d&&w++;return w}},e.prototype.getLabel=function(){return this._label},e.prototype.findCoveredLineEdges=function(){for(var o=Q.NONE,u=this.iterator();u.hasNext();){var d=u.next(),w=d.getSym();if(!d.isLineEdge()){if(d.isInResult()){o=Q.INTERIOR;break}if(w.isInResult()){o=Q.EXTERIOR;break}}}if(o===Q.NONE)return null;for(var S=o,U=this.iterator();U.hasNext();){var $=U.next(),ut=$.getSym();$.isLineEdge()?$.getEdge().setCovered(S===Q.INTERIOR):($.isInResult()&&(S=Q.EXTERIOR),ut.isInResult()&&(S=Q.INTERIOR))}},e.prototype.computeLabelling=function(o){t.prototype.computeLabelling.call(this,o),this._label=new be(Q.NONE);for(var u=this.iterator();u.hasNext();)for(var d=u.next().getEdge().getLabel(),w=0;w<2;w++){var S=d.getLocation(w);S!==Q.INTERIOR&&S!==Q.BOUNDARY||this._label.setLocation(w,Q.INTERIOR)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Xr),_s=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createNode=function(o){return new Kr(o,new _o)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(I),Bo=function t(){this._pts=null,this._orientation=null;var e=arguments[0];this._pts=e,this._orientation=t.orientation(e)};Bo.prototype.compareTo=function(t){var e=t;return Bo.compareOriented(this._pts,this._orientation,e._pts,e._orientation)},Bo.prototype.interfaces_=function(){return[H]},Bo.prototype.getClass=function(){return Bo},Bo.orientation=function(t){return re.increasingDirection(t)===1},Bo.compareOriented=function(t,e,o,u){for(var d=e?1:-1,w=u?1:-1,S=e?t.length:-1,U=u?o.length:-1,$=e?0:t.length-1,ut=u?0:o.length-1;;){var _t=t[$].compareTo(o[ut]);if(_t!==0)return _t;var wt=($+=d)===S,zt=(ut+=w)===U;if(wt&&!zt)return-1;if(!wt&&zt)return 1;if(wt&&zt)return 0}};var br=function(){this._edges=new St,this._ocaMap=new T};br.prototype.print=function(t){t.print("MULTILINESTRING ( ");for(var e=0;e0&&t.print(","),t.print("(");for(var u=o.getCoordinates(),d=0;d0&&t.print(","),t.print(u[d].x+" "+u[d].y);t.println(")")}t.print(") ")},br.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next())},br.prototype.findEdgeIndex=function(t){for(var e=0;e0||!e.coord.equals2D(u);d||o--;var w=new Array(o).fill(null),S=0;w[S++]=new X(t.coord);for(var U=t.segmentIndex+1;U<=e.segmentIndex;U++)w[S++]=this.edge.pts[U];return d&&(w[S]=e.coord),new ys(w,new be(this.edge._label))},Ti.prototype.add=function(t,e,o){var u=new ro(t,e,o),d=this._nodeMap.get(u);return d!==null?d:(this._nodeMap.put(u,u),u)},Ti.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();)if(e.next().coord.equals(t))return!0;return!1},Ti.prototype.interfaces_=function(){return[]},Ti.prototype.getClass=function(){return Ti};var Fo=function(){};Fo.prototype.getChainStartIndices=function(t){var e=0,o=new St;o.add(new ft(e));do{var u=this.findChainEnd(t,e);o.add(new ft(u)),e=u}while(eo?e:o},Ki.prototype.getMinX=function(t){var e=this.pts[this.startIndex[t]].x,o=this.pts[this.startIndex[t+1]].x;return ee&&(u=1),this._depth[t][o]=u}}},Br.prototype.getDelta=function(t){return this._depth[t][It.RIGHT]-this._depth[t][It.LEFT]},Br.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?Q.EXTERIOR:Q.INTERIOR},Br.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},Br.prototype.add=function(){if(arguments.length===1)for(var t=arguments[0],e=0;e<2;e++)for(var o=1;o<3;o++){var u=t.getLocation(e,o);u!==Q.EXTERIOR&&u!==Q.INTERIOR||(this.isNull(e,o)?this._depth[e][o]=Br.depthAtLocation(u):this._depth[e][o]+=Br.depthAtLocation(u))}else if(arguments.length===3){var d=arguments[0],w=arguments[1];arguments[2]===Q.INTERIOR&&this._depth[d][w]++}},Br.prototype.interfaces_=function(){return[]},Br.prototype.getClass=function(){return Br},Br.depthAtLocation=function(t){return t===Q.EXTERIOR?0:t===Q.INTERIOR?1:Br.NULL_VALUE},zo.NULL_VALUE.get=function(){return-1},Object.defineProperties(Br,zo);var ys=function(t){function e(){if(t.call(this),this.pts=null,this._env=null,this.eiList=new Ti(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new Br,this._depthDelta=0,arguments.length===1){var o=arguments[0];e.call(this,o,null)}else if(arguments.length===2){var u=arguments[0],d=arguments[1];this.pts=u,this._label=d}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDepth=function(){return this._depth},e.prototype.getCollapsedEdge=function(){var o=new Array(2).fill(null);return o[0]=this.pts[0],o[1]=this.pts[1],new e(o,be.toLineLabel(this._label))},e.prototype.isIsolated=function(){return this._isIsolated},e.prototype.getCoordinates=function(){return this.pts},e.prototype.setIsolated=function(o){this._isIsolated=o},e.prototype.setName=function(o){this._name=o},e.prototype.equals=function(o){if(!(o instanceof e))return!1;var u=o;if(this.pts.length!==u.pts.length)return!1;for(var d=!0,w=!0,S=this.pts.length,U=0;U0?this.pts[0]:null;if(arguments.length===1){var o=arguments[0];return this.pts[o]}},e.prototype.print=function(o){o.print("edge "+this._name+": "),o.print("LINESTRING (");for(var u=0;u0&&o.print(","),o.print(this.pts[u].x+" "+this.pts[u].y);o.print(") "+this._label+" "+this._depthDelta)},e.prototype.computeIM=function(o){e.updateIM(this._label,o)},e.prototype.isCollapsed=function(){return!!this._label.isArea()&&this.pts.length===3&&!!this.pts[0].equals(this.pts[2])},e.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},e.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},e.prototype.getDepthDelta=function(){return this._depthDelta},e.prototype.getNumPoints=function(){return this.pts.length},e.prototype.printReverse=function(o){o.print("edge "+this._name+": ");for(var u=this.pts.length-1;u>=0;u--)o.print(this.pts[u]+" ");o.println("")},e.prototype.getMonotoneChainEdge=function(){return this._mce===null&&(this._mce=new Ki(this)),this._mce},e.prototype.getEnvelope=function(){if(this._env===null){this._env=new Bt;for(var o=0;o0&&o.append(","),o.append(this.pts[u].x+" "+this.pts[u].y);return o.append(") "+this._label+" "+this._depthDelta),o.toString()},e.prototype.isPointwiseEqual=function(o){if(this.pts.length!==o.pts.length)return!1;for(var u=0;uu||this._maxyw;if(S)return!1;var U=this.intersectsToleranceSquare(t,e);return C.isTrue(!(S&&U),"Found bad envelope test"),U},hi.prototype.initCorners=function(t){this._minx=t.x-.5,this._maxx=t.x+.5,this._miny=t.y-.5,this._maxy=t.y+.5,this._corner[0]=new X(this._maxx,this._maxy),this._corner[1]=new X(this._minx,this._maxy),this._corner[2]=new X(this._minx,this._miny),this._corner[3]=new X(this._maxx,this._miny)},hi.prototype.intersects=function(t,e){return this._scaleFactor===1?this.intersectsScaled(t,e):(this.copyScaled(t,this._p0Scaled),this.copyScaled(e,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},hi.prototype.scale=function(t){return Math.round(t*this._scaleFactor)},hi.prototype.getCoordinate=function(){return this._originalPt},hi.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},hi.prototype.getSafeEnvelope=function(){if(this._safeEnv===null){var t=hi.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new Bt(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv},hi.prototype.intersectsPixelClosure=function(t,e){return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),!!this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),!!this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),!!this._li.hasIntersection())))},hi.prototype.intersectsToleranceSquare=function(t,e){var o=!1,u=!1;return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!this._li.isProper()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),!!this._li.isProper()||(this._li.hasIntersection()&&(o=!0),this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),!!this._li.isProper()||(this._li.hasIntersection()&&(u=!0),this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),!!this._li.isProper()||!(!o||!u)||!!t.equals(this._pt)||!!e.equals(this._pt))))},hi.prototype.addSnappedNode=function(t,e){var o=t.getCoordinate(e),u=t.getCoordinate(e+1);return!!this.intersects(o,u)&&(t.addIntersection(this.getCoordinate(),e),!0)},hi.prototype.interfaces_=function(){return[]},hi.prototype.getClass=function(){return hi},vs.SAFE_ENV_EXPANSION_FACTOR.get=function(){return .75},Object.defineProperties(hi,vs);var Ys=function(){this.tempEnv1=new Bt,this.selectedSegment=new Yt};Ys.prototype.select=function(){if(arguments.length!==1){if(arguments.length===2){var t=arguments[0],e=arguments[1];t.getLineSegment(e,this.selectedSegment),this.select(this.selectedSegment)}}},Ys.prototype.interfaces_=function(){return[]},Ys.prototype.getClass=function(){return Ys};var qi=function(){this._index=null;var t=arguments[0];this._index=t},Vs={HotPixelSnapAction:{configurable:!0}};qi.prototype.snap=function(){if(arguments.length===1){var t=arguments[0];return this.snap(t,null,-1)}if(arguments.length===3){var e=arguments[0],o=arguments[1],u=arguments[2],d=e.getSafeEnvelope(),w=new Va(e,o,u);return this._index.query(d,{interfaces_:function(){return[dt]},visitItem:function(S){S.select(d,w)}}),w.isNodeAdded()}},qi.prototype.interfaces_=function(){return[]},qi.prototype.getClass=function(){return qi},Vs.HotPixelSnapAction.get=function(){return Va},Object.defineProperties(qi,Vs);var Va=function(t){function e(){t.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var o=arguments[0],u=arguments[1],d=arguments[2];this._hotPixel=o,this._parentEdge=u,this._hotPixelVertexIndex=d}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isNodeAdded=function(){return this._isNodeAdded},e.prototype.select=function(){if(arguments.length!==2)return t.prototype.select.apply(this,arguments);var o=arguments[0],u=arguments[1],d=o.getContext();if(this._parentEdge!==null&&d===this._parentEdge&&u===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(d,u)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ys),Go=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new St};Go.prototype.processIntersections=function(t,e,o,u){if(t===o&&e===u)return null;var d=t.getCoordinates()[e],w=t.getCoordinates()[e+1],S=o.getCoordinates()[u],U=o.getCoordinates()[u+1];if(this._li.computeIntersection(d,w,S,U),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var $=0;$=0;e--){try{t.bufferReducedPrecision(e)}catch(w){if(!(w instanceof Qn))throw w;t._saveException=w}if(t._resultGeometry!==null)return null}throw this._saveException}if(arguments.length===1){var o=arguments[0],u=mr.precisionScaleFactor(this._argGeom,this._distance,o),d=new Zt(u);this.bufferFixedPrecision(d)}},mr.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),this._resultGeometry!==null)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===Zt.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},mr.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)},mr.prototype.bufferOriginalPrecision=function(){try{var t=new $r(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(e){if(!(e instanceof ht))throw e;this._saveException=e}},mr.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry},mr.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)},mr.prototype.interfaces_=function(){return[]},mr.prototype.getClass=function(){return mr},mr.bufferOp=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];return new mr(t).getResultGeometry(e)}if(arguments.length===3){if(Number.isInteger(arguments[2])&&arguments[0]instanceof vt&&typeof arguments[1]=="number"){var o=arguments[0],u=arguments[1],d=arguments[2],w=new mr(o);return w.setQuadrantSegments(d),w.getResultGeometry(u)}if(arguments[2]instanceof Be&&arguments[0]instanceof vt&&typeof arguments[1]=="number"){var S=arguments[0],U=arguments[1],$=arguments[2];return new mr(S,$).getResultGeometry(U)}}else if(arguments.length===4){var ut=arguments[0],_t=arguments[1],wt=arguments[2],zt=arguments[3],qt=new mr(ut);return qt.setQuadrantSegments(wt),qt.setEndCapStyle(zt),qt.getResultGeometry(_t)}},mr.precisionScaleFactor=function(t,e,o){var u=t.getEnvelopeInternal(),d=bt.max(Math.abs(u.getMaxX()),Math.abs(u.getMaxY()),Math.abs(u.getMinX()),Math.abs(u.getMinY()))+2*(e>0?e:0),w=o-Math.trunc(Math.log(d)/Math.log(10)+1);return Math.pow(10,w)},qo.CAP_ROUND.get=function(){return Be.CAP_ROUND},qo.CAP_BUTT.get=function(){return Be.CAP_FLAT},qo.CAP_FLAT.get=function(){return Be.CAP_FLAT},qo.CAP_SQUARE.get=function(){return Be.CAP_SQUARE},qo.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(mr,qo);var cr=function(){this._pt=[new X,new X],this._distance=A.NaN,this._isNull=!0};cr.prototype.getCoordinates=function(){return this._pt},cr.prototype.getCoordinate=function(t){return this._pt[t]},cr.prototype.setMinimum=function(){if(arguments.length===1){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],o=arguments[1];if(this._isNull)return this.initialize(e,o),null;var u=e.distance(o);uthis._distance&&this.initialize(e,o,u)}},cr.prototype.interfaces_=function(){return[]},cr.prototype.getClass=function(){return cr};var ji=function(){};ji.prototype.interfaces_=function(){return[]},ji.prototype.getClass=function(){return ji},ji.computeDistance=function(){if(arguments[2]instanceof cr&&arguments[0]instanceof kn&&arguments[1]instanceof X)for(var t=arguments[0],e=arguments[1],o=arguments[2],u=t.getCoordinates(),d=new Yt,w=0;w0||this._isIn?Q.INTERIOR:Q.EXTERIOR)},Ji.prototype.interfaces_=function(){return[]},Ji.prototype.getClass=function(){return Ji};var Zr=function t(){if(this._component=null,this._segIndex=null,this._pt=null,arguments.length===2){var e=arguments[0],o=arguments[1];t.call(this,e,t.INSIDE_AREA,o)}else if(arguments.length===3){var u=arguments[0],d=arguments[1],w=arguments[2];this._component=u,this._segIndex=d,this._pt=w}},zu={INSIDE_AREA:{configurable:!0}};Zr.prototype.isInsideArea=function(){return this._segIndex===Zr.INSIDE_AREA},Zr.prototype.getCoordinate=function(){return this._pt},Zr.prototype.getGeometryComponent=function(){return this._component},Zr.prototype.getSegmentIndex=function(){return this._segIndex},Zr.prototype.interfaces_=function(){return[]},Zr.prototype.getClass=function(){return Zr},zu.INSIDE_AREA.get=function(){return-1},Object.defineProperties(Zr,zu);var Qr=function(t){this._pts=t||null};Qr.prototype.filter=function(t){t instanceof pr&&this._pts.add(t)},Qr.prototype.interfaces_=function(){return[$n]},Qr.prototype.getClass=function(){return Qr},Qr.getPoints=function(){if(arguments.length===1){var t=arguments[0];return t instanceof pr?Gt.singletonList(t):Qr.getPoints(t,new St)}if(arguments.length===2){var e=arguments[0],o=arguments[1];return e instanceof pr?o.add(e):e instanceof wn&&e.apply(new Qr(o)),o}};var To=function(){this._locations=null;var t=arguments[0];this._locations=t};To.prototype.filter=function(t){(t instanceof pr||t instanceof kn||t instanceof bn)&&this._locations.add(new Zr(t,0,t.getCoordinate()))},To.prototype.interfaces_=function(){return[$n]},To.prototype.getClass=function(){return To},To.getLocations=function(t){var e=new St;return t.apply(new To(e)),e};var Fr=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new Ji,this._minDistanceLocation=null,this._minDistance=A.MAX_VALUE,arguments.length===2){var t=arguments[0],e=arguments[1];this._geom=[t,e],this._terminateDistance=0}else if(arguments.length===3){var o=arguments[0],u=arguments[1],d=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=o,this._geom[1]=u,this._terminateDistance=d}};Fr.prototype.computeContainmentDistance=function(){if(arguments.length===0){var t=new Array(2).fill(null);if(this.computeContainmentDistance(0,t),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,t)}else if(arguments.length===2){var e=arguments[0],o=arguments[1],u=1-e,d=ko.getPolygons(this._geom[e]);if(d.size()>0){var w=To.getLocations(this._geom[u]);if(this.computeContainmentDistance(w,d,o),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[u]=o[0],this._minDistanceLocation[e]=o[1],null}}else if(arguments.length===3){if(arguments[2]instanceof Array&&ct(arguments[0],we)&&ct(arguments[1],we)){for(var S=arguments[0],U=arguments[1],$=arguments[2],ut=0;utthis._minDistance)return null;for(var u=t.getCoordinates(),d=e.getCoordinate(),w=0;wthis._minDistance)return null;for(var wt=$.getCoordinates(),zt=ut.getCoordinates(),qt=0;qtthis._distance&&this.initialize(e,o,u)}},_r.prototype.interfaces_=function(){return[]},_r.prototype.getClass=function(){return _r};var so=function(){};so.prototype.interfaces_=function(){return[]},so.prototype.getClass=function(){return so},so.computeDistance=function(){if(arguments[2]instanceof _r&&arguments[0]instanceof kn&&arguments[1]instanceof X)for(var t=arguments[0],e=arguments[1],o=arguments[2],u=new Yt,d=t.getCoordinates(),w=0;w1||t<=0)throw new D("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},Ii.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},Ii.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},Ii.prototype.computeOrientedDistance=function(t,e,o){var u=new vo(e);if(t.apply(u),o.setMaximum(u.getMaxPointDistance()),this._densifyFrac>0){var d=new Uo(e,this._densifyFrac);t.apply(d),o.setMaximum(d.getMaxPointDistance())}},Ii.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},Ii.prototype.interfaces_=function(){return[]},Ii.prototype.getClass=function(){return Ii},Ii.distance=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];return new Ii(t,e).distance()}if(arguments.length===3){var o=arguments[0],u=arguments[1],d=arguments[2],w=new Ii(o,u);return w.setDensifyFraction(d),w.distance()}},Wa.MaxPointDistanceFilter.get=function(){return vo},Wa.MaxDensifiedByFractionDistanceFilter.get=function(){return Uo},Object.defineProperties(Ii,Wa);var vo=function(){this._maxPtDist=new _r,this._minPtDist=new _r,this._euclideanDist=new so,this._geom=null;var t=arguments[0];this._geom=t};vo.prototype.filter=function(t){this._minPtDist.initialize(),so.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},vo.prototype.getMaxPointDistance=function(){return this._maxPtDist},vo.prototype.interfaces_=function(){return[Jt]},vo.prototype.getClass=function(){return vo};var Uo=function(){this._maxPtDist=new _r,this._minPtDist=new _r,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))};Uo.prototype.filter=function(t,e){if(e===0)return null;for(var o=t.getCoordinate(e-1),u=t.getCoordinate(e),d=(u.x-o.x)/this._numSubSegs,w=(u.y-o.y)/this._numSubSegs,S=0;So){this._isValid=!1;var d=u.getCoordinates();this._errorLocation=d[1],this._errorIndicator=t.getFactory().createLineString(d),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+Ht.toLineString(d[0],d[1])+")"}},Mr.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=Mr.MAX_DISTANCE_DIFF_FRAC*t;return this._minValidDistance=t-e,this._maxValidDistance=t+e,!(!this._input.isEmpty()&&!this._result.isEmpty())||(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),Mr.VERBOSE&&fe.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},Mr.prototype.checkNegativeValid=function(){if(!(this._input instanceof bn||this._input instanceof dr||this._input instanceof wn))return null;var t=this.getPolygonLines(this._input);if(this.checkMinimumDistance(t,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(t,this._result,this._maxValidDistance)},Mr.prototype.getErrorIndicator=function(){return this._errorIndicator},Mr.prototype.checkMinimumDistance=function(t,e,o){var u=new Fr(t,e,o);if(this._minDistanceFound=u.distance(),this._minDistanceFound0&&t>e&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&t=2||this._distance>0?null:(this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),void this.report("ExpectedEmpty"))},Pr.prototype.report=function(t){if(!Pr.VERBOSE)return null;fe.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))},Pr.prototype.getErrorMessage=function(){return this._errorMsg},Pr.prototype.interfaces_=function(){return[]},Pr.prototype.getClass=function(){return Pr},Pr.isValidMsg=function(t,e,o){var u=new Pr(t,e,o);return u.isValid()?null:u.getErrorMessage()},Pr.isValid=function(t,e,o){return!!new Pr(t,e,o).isValid()},Ka.VERBOSE.get=function(){return!1},Ka.MAX_ENV_DIFF_FRAC.get=function(){return .012},Object.defineProperties(Pr,Ka);var zr=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};zr.prototype.getCoordinates=function(){return this._pts},zr.prototype.size=function(){return this._pts.length},zr.prototype.getCoordinate=function(t){return this._pts[t]},zr.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},zr.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:ki.octant(this.getCoordinate(t),this.getCoordinate(t+1))},zr.prototype.setData=function(t){this._data=t},zr.prototype.getData=function(){return this._data},zr.prototype.toString=function(){return Ht.toLineString(new le(this._pts))},zr.prototype.interfaces_=function(){return[Gi]},zr.prototype.getClass=function(){return zr};var yr=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new St,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null};yr.prototype.getInteriorIntersection=function(){return this._interiorIntersection},yr.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t},yr.prototype.getIntersectionSegments=function(){return this._intSegments},yr.prototype.count=function(){return this._intersectionCount},yr.prototype.getIntersections=function(){return this._intersections},yr.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},yr.prototype.setKeepIntersections=function(t){this._keepIntersections=t},yr.prototype.processIntersections=function(t,e,o,u){if(!this._findAllIntersections&&this.hasIntersection()||t===o&&e===u||this._isCheckEndSegmentsOnly&&!(this.isEndSegment(t,e)||this.isEndSegment(o,u)))return null;var d=t.getCoordinates()[e],w=t.getCoordinates()[e+1],S=o.getCoordinates()[u],U=o.getCoordinates()[u+1];this._li.computeIntersection(d,w,S,U),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=d,this._intSegments[1]=w,this._intSegments[2]=S,this._intSegments[3]=U,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},yr.prototype.isEndSegment=function(t,e){return e===0||e>=t.size()-2},yr.prototype.hasIntersection=function(){return this._interiorIntersection!==null},yr.prototype.isDone=function(){return!this._findAllIntersections&&this._interiorIntersection!==null},yr.prototype.interfaces_=function(){return[is]},yr.prototype.getClass=function(){return yr},yr.createAllIntersectionsFinder=function(t){var e=new yr(t);return e.setFindAllIntersections(!0),e},yr.createAnyIntersectionFinder=function(t){return new yr(t)},yr.createIntersectionCounter=function(t){var e=new yr(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var Hi=function(){this._li=new F,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};Hi.prototype.execute=function(){if(this._segInt!==null)return null;this.checkInteriorIntersections()},Hi.prototype.getIntersections=function(){return this._segInt.getIntersections()},Hi.prototype.isValid=function(){return this.execute(),this._isValid},Hi.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},Hi.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new yr(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new Za;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},Hi.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Qn(this.getErrorMessage(),this._segInt.getInteriorIntersection())},Hi.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+Ht.toLineString(t[0],t[1])+" and "+Ht.toLineString(t[2],t[3])},Hi.prototype.interfaces_=function(){return[]},Hi.prototype.getClass=function(){return Hi},Hi.computeIntersections=function(t){var e=new Hi(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var ao=function t(){this._nv=null;var e=arguments[0];this._nv=new Hi(t.toSegmentStrings(e))};ao.prototype.checkValid=function(){this._nv.checkValid()},ao.prototype.interfaces_=function(){return[]},ao.prototype.getClass=function(){return ao},ao.toSegmentStrings=function(t){for(var e=new St,o=t.iterator();o.hasNext();){var u=o.next();e.add(new zr(u.getCoordinates(),u))}return e},ao.checkValid=function(t){new ao(t).checkValid()};var ws=function(t){this._mapOp=t};ws.prototype.map=function(t){for(var e=new St,o=0;o0&&u<4&&!this._preserveType?this._factory.createLineString(o):this._factory.createLinearRing(o)},ti.prototype.interfaces_=function(){return[]},ti.prototype.getClass=function(){return ti};var uo=function t(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new Yt,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof kn&&typeof arguments[1]=="number"){var e=arguments[0],o=arguments[1];t.call(this,e.getCoordinates(),o)}else if(arguments[0]instanceof Array&&typeof arguments[1]=="number"){var u=arguments[0],d=arguments[1];this._srcPts=u,this._isClosed=t.isClosed(u),this._snapTolerance=d}};uo.prototype.snapVertices=function(t,e){for(var o=this._isClosed?t.size()-1:t.size(),u=0;u=0&&t.add(w+1,new X(d),!1)}},uo.prototype.findSegmentIndexToSnap=function(t,e){for(var o=A.MAX_VALUE,u=-1,d=0;de&&(e=u)}return e}if(arguments.length===2){var d=arguments[0],w=arguments[1];return Math.min(er.computeOverlaySnapTolerance(d),er.computeOverlaySnapTolerance(w))}},er.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal();return Math.min(e.getHeight(),e.getWidth())*er.SNAP_PRECISION_FACTOR},er.snapToSelf=function(t,e,o){return new er(t).snapToSelf(e,o)},Ja.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(er,Ja);var $a=function(t){function e(o,u,d){t.call(this),this._snapTolerance=o||null,this._snapPts=u||null,this._isSelfSnap=d!==void 0&&d}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.snapLine=function(o,u){var d=new uo(o,this._snapTolerance);return d.setAllowSnappingToSourceVertices(this._isSelfSnap),d.snapTo(u)},e.prototype.transformCoordinates=function(o,u){var d=o.toCoordinateArray(),w=this.snapLine(d,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(w)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ti),Yr=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};Yr.prototype.getCommon=function(){return A.longBitsToDouble(this._commonBits)},Yr.prototype.add=function(t){var e=A.doubleToLongBits(t);if(this._isFirst)return this._commonBits=e,this._commonSignExp=Yr.signExpBits(this._commonBits),this._isFirst=!1,null;if(Yr.signExpBits(e)!==this._commonSignExp)return this._commonBits=0,null;this._commonMantissaBitsCount=Yr.numCommonMostSigMantissaBits(this._commonBits,e),this._commonBits=Yr.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))},Yr.prototype.toString=function(){if(arguments.length===1){var t=arguments[0],e=A.longBitsToDouble(t),o="0000000000000000000000000000000000000000000000000000000000000000"+A.toBinaryString(t),u=o.substring(o.length-64);return u.substring(0,1)+" "+u.substring(1,12)+"(exp) "+u.substring(12)+" [ "+e+" ]"}},Yr.prototype.interfaces_=function(){return[]},Yr.prototype.getClass=function(){return Yr},Yr.getBit=function(t,e){return t&1<>52},Yr.zeroLowerBits=function(t,e){return t&~((1<=0;u--){if(Yr.getBit(t,u)!==Yr.getBit(e,u))return o;o++}return 52};var Io=function(){this._commonCoord=null,this._ccFilter=new Ls},fa={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};Io.prototype.addCommonBits=function(t){var e=new Oo(this._commonCoord);t.apply(e),t.geometryChanged()},Io.prototype.removeCommonBits=function(t){if(this._commonCoord.x===0&&this._commonCoord.y===0)return t;var e=new X(this._commonCoord);e.x=-e.x,e.y=-e.y;var o=new Oo(e);return t.apply(o),t.geometryChanged(),t},Io.prototype.getCommonCoordinate=function(){return this._commonCoord},Io.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},Io.prototype.interfaces_=function(){return[]},Io.prototype.getClass=function(){return Io},fa.CommonCoordinateFilter.get=function(){return Ls},fa.Translater.get=function(){return Oo},Object.defineProperties(Io,fa);var Ls=function(){this._commonBitsX=new Yr,this._commonBitsY=new Yr};Ls.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)},Ls.prototype.getCommonCoordinate=function(){return new X(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},Ls.prototype.interfaces_=function(){return[Jt]},Ls.prototype.getClass=function(){return Ls};var Oo=function(){this.trans=null;var t=arguments[0];this.trans=t};Oo.prototype.filter=function(t,e){var o=t.getOrdinate(e,0)+this.trans.x,u=t.getOrdinate(e,1)+this.trans.y;t.setOrdinate(e,0,o),t.setOrdinate(e,1,u)},Oo.prototype.isDone=function(){return!1},Oo.prototype.isGeometryChanged=function(){return!0},Oo.prototype.interfaces_=function(){return[Hr]},Oo.prototype.getClass=function(){return Oo};var vr=function(t,e){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=t,this._geom[1]=e,this.computeSnapTolerance()};vr.prototype.selfSnap=function(t){return new er(t).snapTo(t,this._snapTolerance)},vr.prototype.removeCommonBits=function(t){this._cbr=new Io,this._cbr.add(t[0]),this._cbr.add(t[1]);var e=new Array(2).fill(null);return e[0]=this._cbr.removeCommonBits(t[0].copy()),e[1]=this._cbr.removeCommonBits(t[1].copy()),e},vr.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t},vr.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),o=de.overlayOp(e[0],e[1],t);return this.prepareResult(o)},vr.prototype.checkValid=function(t){t.isValid()||fe.out.println("Snapped geometry is invalid")},vr.prototype.computeSnapTolerance=function(){this._snapTolerance=er.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},vr.prototype.snap=function(t){var e=this.removeCommonBits(t);return er.snap(e[0],e[1],this._snapTolerance)},vr.prototype.interfaces_=function(){return[]},vr.prototype.getClass=function(){return vr},vr.overlayOp=function(t,e,o){return new vr(t,e).getResultGeometry(o)},vr.union=function(t,e){return vr.overlayOp(t,e,de.UNION)},vr.intersection=function(t,e){return vr.overlayOp(t,e,de.INTERSECTION)},vr.symDifference=function(t,e){return vr.overlayOp(t,e,de.SYMDIFFERENCE)},vr.difference=function(t,e){return vr.overlayOp(t,e,de.DIFFERENCE)};var ei=function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e};ei.prototype.getResultGeometry=function(t){var e=null,o=!1,u=null;try{e=de.overlayOp(this._geom[0],this._geom[1],t),o=!0}catch(d){if(!(d instanceof ht))throw d;u=d}if(!o)try{e=vr.overlayOp(this._geom[0],this._geom[1],t)}catch(d){throw d instanceof ht?u:d}return e},ei.prototype.interfaces_=function(){return[]},ei.prototype.getClass=function(){return ei},ei.overlayOp=function(t,e,o){return new ei(t,e).getResultGeometry(o)},ei.union=function(t,e){return ei.overlayOp(t,e,de.UNION)},ei.intersection=function(t,e){return ei.overlayOp(t,e,de.INTERSECTION)},ei.symDifference=function(t,e){return ei.overlayOp(t,e,de.SYMDIFFERENCE)},ei.difference=function(t,e){return ei.overlayOp(t,e,de.DIFFERENCE)};var i=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};i.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i};var f=function t(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,arguments.length===2){var e=arguments[0],o=arguments[1];this._eventType=t.DELETE,this._xValue=e,this._insertEvent=o}else if(arguments.length===3){var u=arguments[0],d=arguments[1],w=arguments[2];this._eventType=t.INSERT,this._label=u,this._xValue=d,this._obj=w}},y={INSERT:{configurable:!0},DELETE:{configurable:!0}};f.prototype.isDelete=function(){return this._eventType===f.DELETE},f.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t},f.prototype.getObject=function(){return this._obj},f.prototype.compareTo=function(t){var e=t;return this._xValuee._xValue?1:this._eventTypee._eventType?1:0},f.prototype.getInsertEvent=function(){return this._insertEvent},f.prototype.isInsert=function(){return this._eventType===f.INSERT},f.prototype.isSameLabel=function(t){return this._label!==null&&this._label===t._label},f.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},f.prototype.interfaces_=function(){return[H]},f.prototype.getClass=function(){return f},y.INSERT.get=function(){return 1},y.DELETE.get=function(){return 2},Object.defineProperties(f,y);var M=function(){};M.prototype.interfaces_=function(){return[]},M.prototype.getClass=function(){return M};var O=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var t=arguments[0],e=arguments[1],o=arguments[2];this._li=t,this._includeProper=e,this._recordIsolated=o};O.prototype.isTrivialIntersection=function(t,e,o,u){if(t===o&&this._li.getIntersectionNum()===1){if(O.isAdjacentSegments(e,u))return!0;if(t.isClosed()){var d=t.getNumPoints()-1;if(e===0&&u===d||u===0&&e===d)return!0}}return!1},O.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},O.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},O.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},O.prototype.isBoundaryPointInternal=function(t,e){for(var o=e.iterator();o.hasNext();){var u=o.next().getCoordinate();if(t.isIntersection(u))return!0}return!1},O.prototype.hasProperIntersection=function(){return this._hasProper},O.prototype.hasIntersection=function(){return this._hasIntersection},O.prototype.isDone=function(){return this._isDone},O.prototype.isBoundaryPoint=function(t,e){return e!==null&&(!!this.isBoundaryPointInternal(t,e[0])||!!this.isBoundaryPointInternal(t,e[1]))},O.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},O.prototype.addIntersections=function(t,e,o,u){if(t===o&&e===u)return null;this.numTests++;var d=t.getCoordinates()[e],w=t.getCoordinates()[e+1],S=o.getCoordinates()[u],U=o.getCoordinates()[u+1];this._li.computeIntersection(d,w,S,U),this._li.hasIntersection()&&(this._recordIsolated&&(t.setIsolated(!1),o.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(t,e,o,u)||(this._hasIntersection=!0,!this._includeProper&&this._li.isProper()||(t.addIntersections(this._li,e,0),o.addIntersections(this._li,u,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))},O.prototype.interfaces_=function(){return[]},O.prototype.getClass=function(){return O},O.isAdjacentSegments=function(t,e){return Math.abs(t-e)===1};var W=function(t){function e(){t.call(this),this.events=new St,this.nOverlaps=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.prepareEvents=function(){Gt.sort(this.events);for(var o=0;oe||this._maxw?1:0},xt.prototype.interfaces_=function(){return[et]},xt.prototype.getClass=function(){return xt};var Nt=function(t){function e(){t.call(this),this._item=null;var o=arguments[0],u=arguments[1],d=arguments[2];this._min=o,this._max=u,this._item=d}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.query=function(o,u,d){if(!this.intersects(o,u))return null;d.visitItem(this._item)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(at),ee=function(t){function e(){t.call(this),this._node1=null,this._node2=null;var o=arguments[0],u=arguments[1];this._node1=o,this._node2=u,this.buildExtent(this._node1,this._node2)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.buildExtent=function(o,u){this._min=Math.min(o._min,u._min),this._max=Math.max(o._max,u._max)},e.prototype.query=function(o,u,d){if(!this.intersects(o,u))return null;this._node1!==null&&this._node1.query(o,u,d),this._node2!==null&&this._node2.query(o,u,d)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(at),ae=function(){this._leaves=new St,this._root=null,this._level=0};ae.prototype.buildTree=function(){Gt.sort(this._leaves,new at.NodeComparator);for(var t=this._leaves,e=null,o=new St;;){if(this.buildLevel(t,o),o.size()===1)return o.get(0);e=t,t=o,o=e}},ae.prototype.insert=function(t,e,o){if(this._root!==null)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new Nt(t,e,o))},ae.prototype.query=function(t,e,o){this.init(),this._root.query(t,e,o)},ae.prototype.buildRoot=function(){if(this._root!==null)return null;this._root=this.buildTree()},ae.prototype.printNode=function(t){fe.out.println(Ht.toLineString(new X(t._min,this._level),new X(t._max,this._level)))},ae.prototype.init=function(){if(this._root!==null)return null;this.buildRoot()},ae.prototype.buildLevel=function(t,e){this._level++,e.clear();for(var o=0;o=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,u[0]),this.insertBoundaryPoint(this._argIndex,u[u.length-1])},e.prototype.getInvalidPoint=function(){return this._invalidPoint},e.prototype.getBoundaryPoints=function(){for(var o=this.getBoundaryNodes(),u=new Array(o.size()).fill(null),d=0,w=o.iterator();w.hasNext();){var S=w.next();u[d++]=S.getCoordinate().copy()}return u},e.prototype.getBoundaryNodes=function(){return this._boundaryNodes===null&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},e.prototype.addSelfIntersectionNode=function(o,u,d){if(this.isBoundaryNode(o,u))return null;d===Q.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(o,u):this.insertPoint(o,u,d)},e.prototype.addPolygonRing=function(o,u,d){if(o.isEmpty())return null;var w=re.removeRepeatedPoints(o.getCoordinates());if(w.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=w[0],null;var S=u,U=d;tt.isCCW(w)&&(S=d,U=u);var $=new ys(w,new be(this._argIndex,Q.BOUNDARY,S,U));this._lineEdgeMap.put(o,$),this.insertEdge($),this.insertPoint(this._argIndex,w[0],Q.BOUNDARY)},e.prototype.insertPoint=function(o,u,d){var w=this._nodes.addNode(u),S=w.getLabel();S===null?w._label=new be(o,d):S.setLocation(o,d)},e.prototype.createEdgeSetIntersector=function(){return new W},e.prototype.addSelfIntersectionNodes=function(o){for(var u=this._edges.iterator();u.hasNext();)for(var d=u.next(),w=d.getLabel().getLocation(o),S=d.eiList.iterator();S.hasNext();){var U=S.next();this.addSelfIntersectionNode(o,U.coord,w)}},e.prototype.add=function(){if(arguments.length!==1)return t.prototype.add.apply(this,arguments);var o=arguments[0];if(o.isEmpty())return null;if(o instanceof dr&&(this._useBoundaryDeterminationRule=!1),o instanceof bn)this.addPolygon(o);else if(o instanceof kn)this.addLineString(o);else if(o instanceof pr)this.addPoint(o);else if(o instanceof mi)this.addCollection(o);else if(o instanceof ar)this.addCollection(o);else if(o instanceof dr)this.addCollection(o);else{if(!(o instanceof wn))throw new Error(o.getClass().getName());this.addCollection(o)}},e.prototype.addCollection=function(o){for(var u=0;u50?(this._areaPtLocator===null&&(this._areaPtLocator=new ci(this._parentGeom)),this._areaPtLocator.locate(o)):this._ptLocator.locate(o,this._parentGeom)},e.prototype.findEdge=function(){if(arguments.length===1){var o=arguments[0];return this._lineEdgeMap.get(o)}return t.prototype.findEdge.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.determineBoundary=function(o,u){return o.isInBoundary(u)?Q.BOUNDARY:Q.INTERIOR},e}(V),Rs=function(){if(this._li=new F,this._resultPrecisionModel=null,this._arg=null,arguments.length===1){var t=arguments[0];this.setComputationPrecision(t.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new bs(0,t)}else if(arguments.length===2){var e=arguments[0],o=arguments[1],u=$t.OGC_SFS_BOUNDARY_RULE;e.getPrecisionModel().compareTo(o.getPrecisionModel())>=0?this.setComputationPrecision(e.getPrecisionModel()):this.setComputationPrecision(o.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new bs(0,e,u),this._arg[1]=new bs(1,o,u)}else if(arguments.length===3){var d=arguments[0],w=arguments[1],S=arguments[2];d.getPrecisionModel().compareTo(w.getPrecisionModel())>=0?this.setComputationPrecision(d.getPrecisionModel()):this.setComputationPrecision(w.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new bs(0,d,S),this._arg[1]=new bs(1,w,S)}};Rs.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()},Rs.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},Rs.prototype.interfaces_=function(){return[]},Rs.prototype.getClass=function(){return Rs};var os=function(){};os.prototype.interfaces_=function(){return[]},os.prototype.getClass=function(){return os},os.map=function(){if(arguments[0]instanceof vt&&ct(arguments[1],os.MapOp)){for(var t=arguments[0],e=arguments[1],o=new St,u=0;u=t.size()?null:t.get(e)},ir.union=function(t){return new ir(t).union()},Gu.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(ir,Gu);var Es=function(){};Es.prototype.interfaces_=function(){return[]},Es.prototype.getClass=function(){return Es},Es.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return de.createEmptyResult(de.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),ei.overlayOp(t,e,de.UNION)},r.GeoJSONReader=ai,r.GeoJSONWriter=Vi,r.OverlayOp=de,r.UnionOp=Es,r.BufferOp=mr,Object.defineProperty(r,"__esModule",{value:!0})})});var th=se((pf,df)=>{(function(r,n){typeof pf=="object"&&typeof df<"u"?df.exports=n():typeof define=="function"&&define.amd?define(n):(r=typeof globalThis<"u"?globalThis:r||self,r.DOMPurify=n())})(pf,function(){"use strict";let{entries:r,setPrototypeOf:n,isFrozen:s,getPrototypeOf:a,getOwnPropertyDescriptor:l}=Object,{freeze:c,seal:g,create:m}=Object,{apply:v,construct:x}=typeof Reflect<"u"&&Reflect;v||(v=function(Ht,ht,Y){return Ht.apply(ht,Y)}),c||(c=function(Ht){return Ht}),g||(g=function(Ht){return Ht}),x||(x=function(Ht,ht){return new Ht(...ht)});let P=H(Array.prototype.forEach),T=H(Array.prototype.pop),N=H(Array.prototype.push),q=H(String.prototype.toLowerCase),z=H(String.prototype.toString),j=H(String.prototype.match),R=H(String.prototype.replace),B=H(String.prototype.indexOf),D=H(String.prototype.trim),A=H(RegExp.prototype.test),G=K(TypeError);function H(ue){return function(Ht){for(var ht=arguments.length,Y=new Array(ht>1?ht-1:0),C=1;C/gm),Qt=g(/\${[\w\W]*}/gm),Tt=g(/^data-[\-\w.\u00B7-\uFFFF]/),ce=g(/^aria-[\-\w]+$/),Re=g(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Cn=g(/^(?:\w+script|data):/i),fe=g(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ke=g(/^html$/i);var Bt=Object.freeze({__proto__:null,MUSTACHE_EXPR:Rt,ERB_EXPR:Ot,TMPLIT_EXPR:Qt,DATA_ATTR:Tt,ARIA_ATTR:ce,IS_ALLOWED_URI:Re,IS_SCRIPT_OR_DATA:Cn,ATTR_WHITESPACE:fe,DOCTYPE_NAME:ke});let hn=()=>typeof window>"u"?null:window,Sn=function(Ht,ht){if(typeof Ht!="object"||typeof Ht.createPolicy!="function")return null;let Y=null,C="data-tt-policy-suffix";ht.currentScript&&ht.currentScript.hasAttribute(C)&&(Y=ht.currentScript.getAttribute(C));let b="dompurify"+(Y?"#"+Y:"");try{return Ht.createPolicy(b,{createHTML(k){return k},createScriptURL(k){return k}})}catch{return console.warn("TrustedTypes policy "+b+" could not be created."),null}};function Hn(){let ue=arguments.length>0&&arguments[0]!==void 0?arguments[0]:hn(),Ht=p=>Hn(p);if(Ht.version="3.0.2",Ht.removed=[],!ue||!ue.document||ue.document.nodeType!==9)return Ht.isSupported=!1,Ht;let ht=ue.document,{document:Y}=ue,{DocumentFragment:C,HTMLTemplateElement:b,Node:k,Element:F,NodeFilter:Z,NamedNodeMap:J=ue.NamedNodeMap||ue.MozNamedAttrMap,HTMLFormElement:tt,DOMParser:pt,trustedTypes:Lt}=ue,vt=F.prototype,Ft=lt(vt,"cloneNode"),Wt=lt(vt,"nextSibling"),Jt=lt(vt,"childNodes"),$t=lt(vt,"parentNode");if(typeof b=="function"){let p=Y.createElement("template");p.content&&p.content.ownerDocument&&(Y=p.content.ownerDocument)}let jt=Sn(Lt,ht),ge=jt?jt.createHTML(""):"",{implementation:pe,createNodeIterator:Te,createDocumentFragment:Ce,getElementsByTagName:he}=Y,{importNode:An}=ht,we={};Ht.isSupported=typeof r=="function"&&typeof $t=="function"&&pe&&typeof pe.createHTMLDocument<"u";let{MUSTACHE_EXPR:St,ERB_EXPR:Dn,TMPLIT_EXPR:Xn,DATA_ATTR:re,ARIA_ATTR:Vr,IS_SCRIPT_OR_DATA:zn,ATTR_WHITESPACE:cn}=Bt,{IS_ALLOWED_URI:or}=Bt,sr=null,bo=et({},[...gt,...Et,...Q,...ct,...Mt]),Wn=null,nr=et({},[...Xt,...ft,...Ct,...st]),Ut=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ei=null,oi=null,xe=!0,Kn=!0,$n=!1,Hr=!0,wn=!1,ar=!1,Or=!1,co=!1,rr=!1,Eo=!1,Ln=!1,kn=!0,Di=!1,pr="user-content-",Mi=!0,bn=!1,mi={},Nr=null,dr=et({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),ur=null,fo=et({},["audio","video","img","source","image","track"]),Bi=null,Fi=et({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Le="http://www.w3.org/1998/Math/MathML",le="http://www.w3.org/2000/svg",Rr="http://www.w3.org/1999/xhtml",Un=Rr,Pi=!1,po=null,Zt=et({},[Le,le,Rr],z),En,Wr=["application/xhtml+xml","text/html"],Mo="text/html",Kt,eo=null,$o=Y.createElement("form"),si=function(_){return _ instanceof RegExp||_ instanceof Function},De=function(_){eo&&eo===_||((!_||typeof _!="object")&&(_={}),_=X(_),En=Wr.indexOf(_.PARSER_MEDIA_TYPE)===-1?En=Mo:En=_.PARSER_MEDIA_TYPE,Kt=En==="application/xhtml+xml"?z:q,sr="ALLOWED_TAGS"in _?et({},_.ALLOWED_TAGS,Kt):bo,Wn="ALLOWED_ATTR"in _?et({},_.ALLOWED_ATTR,Kt):nr,po="ALLOWED_NAMESPACES"in _?et({},_.ALLOWED_NAMESPACES,z):Zt,Bi="ADD_URI_SAFE_ATTR"in _?et(X(Fi),_.ADD_URI_SAFE_ATTR,Kt):Fi,ur="ADD_DATA_URI_TAGS"in _?et(X(fo),_.ADD_DATA_URI_TAGS,Kt):fo,Nr="FORBID_CONTENTS"in _?et({},_.FORBID_CONTENTS,Kt):dr,Ei="FORBID_TAGS"in _?et({},_.FORBID_TAGS,Kt):{},oi="FORBID_ATTR"in _?et({},_.FORBID_ATTR,Kt):{},mi="USE_PROFILES"in _?_.USE_PROFILES:!1,xe=_.ALLOW_ARIA_ATTR!==!1,Kn=_.ALLOW_DATA_ATTR!==!1,$n=_.ALLOW_UNKNOWN_PROTOCOLS||!1,Hr=_.ALLOW_SELF_CLOSE_IN_ATTR!==!1,wn=_.SAFE_FOR_TEMPLATES||!1,ar=_.WHOLE_DOCUMENT||!1,rr=_.RETURN_DOM||!1,Eo=_.RETURN_DOM_FRAGMENT||!1,Ln=_.RETURN_TRUSTED_TYPE||!1,co=_.FORCE_BODY||!1,kn=_.SANITIZE_DOM!==!1,Di=_.SANITIZE_NAMED_PROPS||!1,Mi=_.KEEP_CONTENT!==!1,bn=_.IN_PLACE||!1,or=_.ALLOWED_URI_REGEXP||Re,Un=_.NAMESPACE||Rr,Ut=_.CUSTOM_ELEMENT_HANDLING||{},_.CUSTOM_ELEMENT_HANDLING&&si(_.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Ut.tagNameCheck=_.CUSTOM_ELEMENT_HANDLING.tagNameCheck),_.CUSTOM_ELEMENT_HANDLING&&si(_.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Ut.attributeNameCheck=_.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),_.CUSTOM_ELEMENT_HANDLING&&typeof _.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Ut.allowCustomizedBuiltInElements=_.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),wn&&(Kn=!1),Eo&&(rr=!0),mi&&(sr=et({},[...Mt]),Wn=[],mi.html===!0&&(et(sr,gt),et(Wn,Xt)),mi.svg===!0&&(et(sr,Et),et(Wn,ft),et(Wn,st)),mi.svgFilters===!0&&(et(sr,Q),et(Wn,ft),et(Wn,st)),mi.mathMl===!0&&(et(sr,ct),et(Wn,Ct),et(Wn,st))),_.ADD_TAGS&&(sr===bo&&(sr=X(sr)),et(sr,_.ADD_TAGS,Kt)),_.ADD_ATTR&&(Wn===nr&&(Wn=X(Wn)),et(Wn,_.ADD_ATTR,Kt)),_.ADD_URI_SAFE_ATTR&&et(Bi,_.ADD_URI_SAFE_ATTR,Kt),_.FORBID_CONTENTS&&(Nr===dr&&(Nr=X(Nr)),et(Nr,_.FORBID_CONTENTS,Kt)),Mi&&(sr["#text"]=!0),ar&&et(sr,["html","head","body"]),sr.table&&(et(sr,["tbody"]),delete Ei.tbody),c&&c(_),eo=_)},gr=et({},["mi","mo","mn","ms","mtext"]),ai=et({},["foreignobject","desc","title","annotation-xml"]),Vi=et({},["title","style","font","a","script"]),It=et({},Et);et(It,Q),et(It,kt);let zi=et({},ct);et(zi,bt);let fn=function(_){let E=$t(_);(!E||!E.tagName)&&(E={namespaceURI:Un,tagName:"template"});let I=q(_.tagName),V=q(E.tagName);return po[_.namespaceURI]?_.namespaceURI===le?E.namespaceURI===Rr?I==="svg":E.namespaceURI===Le?I==="svg"&&(V==="annotation-xml"||gr[V]):!!It[I]:_.namespaceURI===Le?E.namespaceURI===Rr?I==="math":E.namespaceURI===le?I==="math"&&ai[V]:!!zi[I]:_.namespaceURI===Rr?E.namespaceURI===le&&!ai[V]||E.namespaceURI===Le&&!gr[V]?!1:!zi[I]&&(Vi[I]||!It[I]):!!(En==="application/xhtml+xml"&&po[_.namespaceURI]):!1},Qn=function(_){N(Ht.removed,{element:_});try{_.parentNode.removeChild(_)}catch{_.remove()}},Ci=function(_,E){try{N(Ht.removed,{attribute:E.getAttributeNode(_),from:E})}catch{N(Ht.removed,{attribute:null,from:E})}if(E.removeAttribute(_),_==="is"&&!Wn[_])if(rr||Eo)try{Qn(E)}catch{}else try{E.setAttribute(_,"")}catch{}},tr=function(_){let E,I;if(co)_=""+_;else{let it=j(_,/^[\r\n\t ]+/);I=it&&it[0]}En==="application/xhtml+xml"&&Un===Rr&&(_=''+_+"");let V=jt?jt.createHTML(_):_;if(Un===Rr)try{E=new pt().parseFromString(V,En)}catch{}if(!E||!E.documentElement){E=pe.createDocument(Un,"template",null);try{E.documentElement.innerHTML=Pi?ge:V}catch{}}let nt=E.body||E.documentElement;return _&&I&&nt.insertBefore(Y.createTextNode(I),nt.childNodes[0]||null),Un===Rr?he.call(E,ar?"html":"body")[0]:ar?E.documentElement:nt},Ae=function(_){return Te.call(_.ownerDocument||_,_,Z.SHOW_ELEMENT|Z.SHOW_COMMENT|Z.SHOW_TEXT,null,!1)},be=function(_){return _ instanceof tt&&(typeof _.nodeName!="string"||typeof _.textContent!="string"||typeof _.removeChild!="function"||!(_.attributes instanceof J)||typeof _.removeAttribute!="function"||typeof _.setAttribute!="function"||typeof _.namespaceURI!="string"||typeof _.insertBefore!="function"||typeof _.hasChildNodes!="function")},Nn=function(_){return typeof k=="object"?_ instanceof k:_&&typeof _=="object"&&typeof _.nodeType=="number"&&typeof _.nodeName=="string"},ui=function(_,E,I){we[_]&&P(we[_],V=>{V.call(Ht,E,I,eo)})},Qo=function(_){let E;if(ui("beforeSanitizeElements",_,null),be(_))return Qn(_),!0;let I=Kt(_.nodeName);if(ui("uponSanitizeElement",_,{tagName:I,allowedTags:sr}),_.hasChildNodes()&&!Nn(_.firstElementChild)&&(!Nn(_.content)||!Nn(_.content.firstElementChild))&&A(/<[/\w]/g,_.innerHTML)&&A(/<[/\w]/g,_.textContent))return Qn(_),!0;if(!sr[I]||Ei[I]){if(!Ei[I]&&Kr(I)&&(Ut.tagNameCheck instanceof RegExp&&A(Ut.tagNameCheck,I)||Ut.tagNameCheck instanceof Function&&Ut.tagNameCheck(I)))return!1;if(Mi&&!Nr[I]){let V=$t(_)||_.parentNode,nt=Jt(_)||_.childNodes;if(nt&&V){let it=nt.length;for(let rt=it-1;rt>=0;--rt)V.insertBefore(Ft(nt[rt],!0),Wt(_))}}return Qn(_),!0}return _ instanceof F&&!fn(_)||(I==="noscript"||I==="noembed")&&A(/<\/no(script|embed)/i,_.innerHTML)?(Qn(_),!0):(wn&&_.nodeType===3&&(E=_.textContent,E=R(E,St," "),E=R(E,Dn," "),E=R(E,Xn," "),_.textContent!==E&&(N(Ht.removed,{element:_.cloneNode()}),_.textContent=E)),ui("afterSanitizeElements",_,null),!1)},ie=function(_,E,I){if(kn&&(E==="id"||E==="name")&&(I in Y||I in $o))return!1;if(!(Kn&&!oi[E]&&A(re,E))){if(!(xe&&A(Vr,E))){if(!Wn[E]||oi[E]){if(!(Kr(_)&&(Ut.tagNameCheck instanceof RegExp&&A(Ut.tagNameCheck,_)||Ut.tagNameCheck instanceof Function&&Ut.tagNameCheck(_))&&(Ut.attributeNameCheck instanceof RegExp&&A(Ut.attributeNameCheck,E)||Ut.attributeNameCheck instanceof Function&&Ut.attributeNameCheck(E))||E==="is"&&Ut.allowCustomizedBuiltInElements&&(Ut.tagNameCheck instanceof RegExp&&A(Ut.tagNameCheck,I)||Ut.tagNameCheck instanceof Function&&Ut.tagNameCheck(I))))return!1}else if(!Bi[E]){if(!A(or,R(I,cn,""))){if(!((E==="src"||E==="xlink:href"||E==="href")&&_!=="script"&&B(I,"data:")===0&&ur[_])){if(!($n&&!A(zn,R(I,cn,"")))){if(I)return!1}}}}}}return!0},Kr=function(_){return _.indexOf("-")>0},Pe=function(_){let E,I,V,nt;ui("beforeSanitizeAttributes",_,null);let{attributes:it}=_;if(!it)return;let rt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Wn};for(nt=it.length;nt--;){E=it[nt];let{name:ot,namespaceURI:dt}=E;if(I=ot==="value"?E.value:D(E.value),V=Kt(ot),rt.attrName=V,rt.attrValue=I,rt.keepAttr=!0,rt.forceKeepAttr=void 0,ui("uponSanitizeAttribute",_,rt),I=rt.attrValue,rt.forceKeepAttr||(Ci(ot,_),!rt.keepAttr))continue;if(!Hr&&A(/\/>/i,I)){Ci(ot,_);continue}wn&&(I=R(I,St," "),I=R(I,Dn," "),I=R(I,Xn," "));let Pt=Kt(_.nodeName);if(ie(Pt,V,I)){if(Di&&(V==="id"||V==="name")&&(Ci(ot,_),I=pr+I),jt&&typeof Lt=="object"&&typeof Lt.getAttributeType=="function"&&!dt)switch(Lt.getAttributeType(Pt,V)){case"TrustedHTML":I=jt.createHTML(I);break;case"TrustedScriptURL":I=jt.createScriptURL(I);break}try{dt?_.setAttributeNS(dt,ot,I):_.setAttribute(ot,I),T(Ht.removed)}catch{}}}ui("afterSanitizeAttributes",_,null)},h=function p(_){let E,I=Ae(_);for(ui("beforeSanitizeShadowDOM",_,null);E=I.nextNode();)ui("uponSanitizeShadowNode",E,null),!Qo(E)&&(E.content instanceof C&&p(E.content),Pe(E));ui("afterSanitizeShadowDOM",_,null)};return Ht.sanitize=function(p){let _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},E,I,V,nt;if(Pi=!p,Pi&&(p=""),typeof p!="string"&&!Nn(p)){if(typeof p.toString!="function")throw G("toString is not a function");if(p=p.toString(),typeof p!="string")throw G("dirty is not a string, aborting")}if(!Ht.isSupported)return p;if(Or||De(_),Ht.removed=[],typeof p=="string"&&(bn=!1),bn){if(p.nodeName){let ot=Kt(p.nodeName);if(!sr[ot]||Ei[ot])throw G("root node is forbidden and cannot be sanitized in-place")}}else if(p instanceof k)E=tr(""),I=E.ownerDocument.importNode(p,!0),I.nodeType===1&&I.nodeName==="BODY"||I.nodeName==="HTML"?E=I:E.appendChild(I);else{if(!rr&&!wn&&!ar&&p.indexOf("<")===-1)return jt&&Ln?jt.createHTML(p):p;if(E=tr(p),!E)return rr?null:Ln?ge:""}E&&co&&Qn(E.firstChild);let it=Ae(bn?p:E);for(;V=it.nextNode();)Qo(V)||(V.content instanceof C&&h(V.content),Pe(V));if(bn)return p;if(rr){if(Eo)for(nt=Ce.call(E.ownerDocument);E.firstChild;)nt.appendChild(E.firstChild);else nt=E;return(Wn.shadowroot||Wn.shadowrootmod)&&(nt=An.call(ht,nt,!0)),nt}let rt=ar?E.outerHTML:E.innerHTML;return ar&&sr["!doctype"]&&E.ownerDocument&&E.ownerDocument.doctype&&E.ownerDocument.doctype.name&&A(ke,E.ownerDocument.doctype.name)&&(rt=" +`+rt),wn&&(rt=R(rt,St," "),rt=R(rt,Dn," "),rt=R(rt,Xn," ")),jt&&Ln?jt.createHTML(rt):rt},Ht.setConfig=function(p){De(p),Or=!0},Ht.clearConfig=function(){eo=null,Or=!1},Ht.isValidAttribute=function(p,_,E){eo||De({});let I=Kt(p),V=Kt(_);return ie(I,V,E)},Ht.addHook=function(p,_){typeof _=="function"&&(we[p]=we[p]||[],N(we[p],_))},Ht.removeHook=function(p){if(we[p])return T(we[p])},Ht.removeHooks=function(p){we[p]&&(we[p]=[])},Ht.removeAllHooks=function(){we={}},Ht}var Me=Hn();return Me})});var t_=se((w4,Lf)=>{(function(r){if(typeof define=="function"&&define.amd)define(["leaflet"],r);else if(typeof Lf<"u")Lf.exports=r(wo());else{if(typeof window.L>"u")throw new Error("Leaflet must be loaded first");r(window.L)}})(function(r){return r.Control.Search=r.Control.extend({includes:r.version[0]==="1"?r.Evented.prototype:r.Mixin.Events,options:{url:"",layer:null,sourceData:null,jsonpParam:null,propertyLoc:"loc",propertyName:"title",formatData:null,filterData:null,moveToLocation:null,buildTip:null,container:"",zoom:null,minLength:1,initial:!0,casesensitive:!1,autoType:!0,delayType:400,tooltipLimit:-1,tipAutoSubmit:!0,firstTipSubmit:!1,autoResize:!0,collapsed:!0,autoCollapse:!1,autoCollapseTime:1200,textErr:"Location not found",textCancel:"Cancel",textPlaceholder:"Search...",hideMarkerOnCollapse:!1,position:"topleft",marker:{icon:!1,animate:!0,circle:{radius:10,weight:3,color:"#e03",stroke:!0,fill:!1}}},_getPath:function(n,s){let a=s.split("."),l=a.pop(),c=a.length,g=a[0],m=1;if(c>0)for(;(n=n[g])&&m⊗",r.DomEvent.on(a,"click",r.DomEvent.stop,this).on(a,"click",this.cancel,this),a},_createButton:function(n,s){let a=r.DomUtil.create("a",s,this._container);return a.href="#",a.title=n,r.DomEvent.on(a,"click",r.DomEvent.stop,this).on(a,"click",this._handleSubmit,this).on(a,"focus",this.collapseDelayedStop,this).on(a,"blur",this.collapseDelayed,this),a},_createTooltip:function(n){let s=this,a=r.DomUtil.create("ul",n,this._container);return a.style.display="none",r.DomEvent.disableClickPropagation(a).on(a,"blur",this.collapseDelayed,this).on(a,"wheel",function(l){s.collapseDelayedStop(),r.DomEvent.stopPropagation(l)},this).on(a,"mouseover",function(l){s.collapseDelayedStop()},this),a},_createTip:function(n,s){let a;if(this.options.buildTip){if(a=this.options.buildTip.call(this,n,s),typeof a=="string"){let l=r.DomUtil.create("div");l.innerHTML=a,a=l.firstChild}}else a=r.DomUtil.create("li",""),a.innerHTML=n;return r.DomUtil.addClass(a,"search-tip"),a._text=n,this.options.tipAutoSubmit&&r.DomEvent.disableClickPropagation(a).on(a,"click",r.DomEvent.stop,this).on(a,"click",function(l){this._input.value=n,this._handleAutoresize(),this._input.focus(),this._hideTooltip(),this._handleSubmit()},this),a},_getUrl:function(n){return typeof this.options.url=="function"?this.options.url(n):this.options.url},_defaultFilterData:function(n,s){let a={};if(n=n.replace(new RegExp("[.*+?^${}()|[]\\]","g"),""),n==="")return[];let l=this.options.initial?"^":"",c=this.options.casesensitive?void 0:"i",g=new RegExp(l+n,c);for(let m in s)g.test(m)&&(a[m]=s[m]);return a},showTooltip:function(n){if(this._countertips=0,this._tooltip.innerHTML="",this._tooltip.currentSelection=-1,this.options.tooltipLimit)for(let s in n){if(this._countertips===this.options.tooltipLimit)break;this._countertips++,this._tooltip.appendChild(this._createTip(s,n[s]))}return this._countertips>0?(this._tooltip.style.display="block",this._autoTypeTmp&&this._autoType(),this._autoTypeTmp=this.options.autoType):this._hideTooltip(),this._tooltip.scrollTop=0,this._countertips},_hideTooltip:function(){return this._tooltip.style.display="none",this._tooltip.innerHTML="",0},_defaultFormatData:function(n){let s=this,a=this.options.propertyName,l=this.options.propertyLoc,c={};if(r.Util.isArray(l))for(let g in n)c[s._getPath(n[g],a)]=r.latLng(s._getPath(n[g],l[0]),s._getPath(n[g],l[1]));else for(let g in n)c[s._getPath(n[g],a)]=r.latLng(s._getPath(n[g],l));return c},_recordsFromJsonp:function(n,s){r.Control.Search.callJsonp=s;let a=r.DomUtil.create("script","leaflet-search-jsonp",document.getElementsByTagName("body")[0]),l=r.Util.template(this._getUrl(n)+"&"+this.options.jsonpParam+"=L.Control.Search.callJsonp",{s:n});return a.type="text/javascript",a.src=l,{abort:function(){a.parentNode.removeChild(a)}}},_recordsFromAjax:function(n,s){let a;try{a=new window.XMLHttpRequest}catch{throw new Error("XMLHttpRequest is not supported")}let l=r.Util.template(this._getUrl(n),{s:n});return a.open("GET",l),a.onload=function(){s(JSON.parse(a.responseText))},a.onreadystatechange=function(){a.readyState===4&&a.status===200&&this.onload()},a.send(),a},_searchInLayer:function(n,s,a){let l=this,c;n instanceof r.Control.Search.Marker||(n instanceof r.Marker||n instanceof r.CircleMarker?l._getPath(n.options,a)?(c=n.getLatLng(),c.layer=n,s[l._getPath(n.options,a)]=c):l._getPath(n.feature.properties,a)&&(c=n.getLatLng(),c.layer=n,s[l._getPath(n.feature.properties,a)]=c):n instanceof r.Path||n instanceof r.Polyline||n instanceof r.Polygon?l._getPath(n.options,a)?(c=n.getBounds().getCenter(),c.layer=n,s[l._getPath(n.options,a)]=c):l._getPath(n.feature.properties,a)&&(c=n.getBounds().getCenter(),c.layer=n,s[l._getPath(n.feature.properties,a)]=c):Object.prototype.hasOwnProperty.call(n,"feature")?Object.prototype.hasOwnProperty.call(n.feature.properties,a)&&(n.getLatLng&&typeof n.getLatLng=="function"?(c=n.getLatLng(),c.layer=n,s[n.feature.properties[a]]=c):n.getBounds&&typeof n.getBounds=="function"&&(c=n.getBounds().getCenter(),c.layer=n,s[n.feature.properties[a]]=c)):n instanceof r.LayerGroup&&n.eachLayer(function(g){l._searchInLayer(g,s,a)}))},_recordsFromLayer:function(){let n=this,s={},a=this.options.propertyName;return this._layer.eachLayer(function(l){n._searchInLayer(l,s,a)}),s},_autoType:function(){let n=this._input.value.length,s=this._tooltip.firstChild?this._tooltip.firstChild._text:"",a=s.length;if(s.indexOf(this._input.value)===0)if(this._input.value=s,this._handleAutoresize(),this._input.createTextRange){let l=this._input.createTextRange();l.collapse(!0),l.moveStart("character",n),l.moveEnd("character",a),l.select()}else this._input.setSelectionRange?this._input.setSelectionRange(n,a):this._input.selectionStart&&(this._input.selectionStart=n,this._input.selectionEnd=a)},_hideAutoType:function(){let n;if((n=this._input.selection)&&n.empty)n.empty();else if(this._input.createTextRange){n=this._input.createTextRange(),n.collapse(!0);let s=this._input.value.length;n.moveStart("character",s),n.moveEnd("character",s),n.select()}else this._input.getSelection&&this._input.getSelection().removeAllRanges(),this._input.selectionStart=this._input.selectionEnd},_handleKeypress:function(n){let s=this;switch(n.keyCode){case 27:this.collapse();break;case 13:(this._countertips===1||this.options.firstTipSubmit&&this._countertips>0)&&this._tooltip.currentSelection===-1&&this._handleArrowSelect(1),this._handleSubmit();break;case 38:this._handleArrowSelect(-1);break;case 40:this._handleArrowSelect(1);break;case 45:case 46:this._autoTypeTmp=!1;break;case 37:case 39:case 16:case 17:case 35:case 36:break;default:this._input.value.length?this._cancel.style.display="block":this._cancel.style.display="none",this._input.value.length>=this.options.minLength?(clearTimeout(this.timerKeypress),this.timerKeypress=setTimeout(function(){s._fillRecordsCache()},this.options.delayType)):this._hideTooltip()}this._handleAutoresize()},searchText:function(n){let s=n.charCodeAt(n.length);this._input.value=n,this._input.style.display="block",r.DomUtil.addClass(this._container,"search-exp"),this._autoTypeTmp=!1,this._handleKeypress({keyCode:s})},_fillRecordsCache:function(){let n=this,s=this._input.value,a;this._curReq&&this._curReq.abort&&this._curReq.abort(),r.DomUtil.addClass(this._container,"search-load"),this.options.layer?(this._recordsCache=this._recordsFromLayer(),a=this._filterData(this._input.value,this._recordsCache),this.showTooltip(a),r.DomUtil.removeClass(this._container,"search-load")):(this.options.sourceData?this._retrieveData=this.options.sourceData:this.options.url&&(this._retrieveData=this.options.jsonpParam?this._recordsFromJsonp:this._recordsFromAjax),this._curReq=this._retrieveData(this,s,function(l){n._recordsCache=n._formatData(n,l),n.options.sourceData?a=n._filterData(n._input.value,n._recordsCache):a=n._recordsCache,n.showTooltip(a),r.DomUtil.removeClass(n._container,"search-load")}))},_handleAutoresize:function(){let n;this._input.style.maxWidth!==this._map._container.offsetWidth&&(n=this._map._container.clientWidth,n-=83,this._input.style.maxWidth=n.toString()+"px"),this.options.autoResize&&this._container.offsetWidth+20=s.length-1)r.DomUtil.addClass(s[this._tooltip.currentSelection],"search-tip-select");else if(n===-1&&this._tooltip.currentSelection<=0)this._tooltip.currentSelection=-1;else if(this._tooltip.style.display!=="none"){this._tooltip.currentSelection+=n,r.DomUtil.addClass(s[this._tooltip.currentSelection],"search-tip-select"),this._input.value=s[this._tooltip.currentSelection]._text;let a=s[this._tooltip.currentSelection].offsetTop;a+s[this._tooltip.currentSelection].clientHeight>=this._tooltip.scrollTop+this._tooltip.clientHeight?this._tooltip.scrollTop=a-this._tooltip.clientHeight+s[this._tooltip.currentSelection].clientHeight:a<=this._tooltip.scrollTop&&(this._tooltip.scrollTop=a)}},_handleSubmit:function(){if(this._hideAutoType(),this.hideAlert(),this._hideTooltip(),this._input.style.display==="none")this.expand();else if(this._input.value==="")this.collapse();else{let n=this._getLocation(this._input.value);n?(this.showLocation(n,this._input.value),this.fire("search:locationfound",{latlng:n,text:this._input.value,layer:n.layer?n.layer:null})):this.showAlert()}},_getLocation:function(n){return Object.prototype.hasOwnProperty.call(this._recordsCache,n)?this._recordsCache[n]:!1},_defaultMoveToLocation:function(n,s,a){this.options.zoom?this._map.setView(n,this.options.zoom):this._map.panTo(n)},showLocation:function(n,s){let a=this;return a._map.once("moveend zoomend",function(l){a._markerSearch&&a._markerSearch.addTo(a._map).setLatLng(n)}),a._moveToLocation(n,s,a._map),a.options.autoCollapse&&a.collapse(),a}}),r.Control.Search.Marker=r.Marker.extend({includes:r.version[0]==="1"?r.Evented.prototype:r.Mixin.Events,options:{icon:new r.Icon.Default,animate:!0,circle:{radius:10,weight:3,color:"#e03",stroke:!0,fill:!1}},initialize:function(n,s){r.setOptions(this,s),s.icon===!0&&(s.icon=new r.Icon.Default),r.Marker.prototype.initialize.call(this,n,s),r.Control.Search.prototype._isObject(this.options.circle)&&(this._circleLoc=new r.CircleMarker(n,this.options.circle))},onAdd:function(n){r.Marker.prototype.onAdd.call(this,n),this._circleLoc&&(n.addLayer(this._circleLoc),this.options.animate&&this.animate())},onRemove:function(n){r.Marker.prototype.onRemove.call(this,n),this._circleLoc&&n.removeLayer(this._circleLoc)},setLatLng:function(n){return r.Marker.prototype.setLatLng.call(this,n),this._circleLoc&&this._circleLoc.setLatLng(n),this},_initIcon:function(){this.options.icon&&r.Marker.prototype._initIcon.call(this)},_removeIcon:function(){this.options.icon&&r.Marker.prototype._removeIcon.call(this)},animate:function(){if(this._circleLoc){let n=this._circleLoc,s=200,l=parseInt(n._radius/5),c=this.options.circle.radius,g=n._radius*2,m=0;n._timerAnimLoc=setInterval(function(){m+=.5,l+=m,g-=l,n.setRadius(g),g"+this.options.latitudeText+": "+r.latlng.lat.toFixed(this.options.precision).toString(),lo.DomUtil.get(this._lng).innerHTML=""+this.options.longitudeText+": "+r.latlng.lng.toFixed(this.options.precision).toString())}});(()=>{var r={9705:(a,l,c)=>{"use strict";var g=c(1540);function m(v){var x=[1/0,1/0,-1/0,-1/0];return g.coordEach(v,function(P){x[0]>P[0]&&(x[0]=P[0]),x[1]>P[1]&&(x[1]=P[1]),x[2]{"use strict";function c(B,D,A){A===void 0&&(A={});var G={type:"Feature"};return(A.id===0||A.id)&&(G.id=A.id),A.bbox&&(G.bbox=A.bbox),G.properties=D||{},G.geometry=B,G}function g(B,D,A){if(A===void 0&&(A={}),!B)throw new Error("coordinates is required");if(!Array.isArray(B))throw new Error("coordinates must be an Array");if(B.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!R(B[0])||!R(B[1]))throw new Error("coordinates must contain numbers");return c({type:"Point",coordinates:B},D,A)}function m(B,D,A){A===void 0&&(A={});for(var G=0,H=B;G=0))throw new Error("precision must be a positive number");var A=Math.pow(10,D||0);return Math.round(B*A)/A},l.radiansToLength=q,l.lengthToRadians=z,l.lengthToDegrees=function(B,D){return j(z(B,D))},l.bearingToAzimuth=function(B){var D=B%360;return D<0&&(D+=360),D},l.radiansToDegrees=j,l.degreesToRadians=function(B){return B%360*Math.PI/180},l.convertLength=function(B,D,A){if(D===void 0&&(D="kilometers"),A===void 0&&(A="kilometers"),!(B>=0))throw new Error("length must be a positive number");return q(z(B,D),A)},l.convertArea=function(B,D,A){if(D===void 0&&(D="meters"),A===void 0&&(A="kilometers"),!(B>=0))throw new Error("area must be a positive number");var G=l.areaFactors[D];if(!G)throw new Error("invalid original units");var H=l.areaFactors[A];if(!H)throw new Error("invalid final units");return B/G*H},l.isNumber=R,l.isObject=function(B){return!!B&&B.constructor===Object},l.validateBBox=function(B){if(!B)throw new Error("bbox is required");if(!Array.isArray(B))throw new Error("bbox must be an Array");if(B.length!==4&&B.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");B.forEach(function(D){if(!R(D))throw new Error("bbox must only contain numbers")})},l.validateId=function(B){if(!B)throw new Error("id is required");if(["string","number"].indexOf(typeof B)===-1)throw new Error("id must be a number or a string")}},1540:(a,l,c)=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0});var g=c(4102);function m(z,j,R){if(z!==null)for(var B,D,A,G,H,K,et,X,lt=0,gt=0,Et=z.type,Q=Et==="FeatureCollection",kt=Et==="Feature",ct=Q?z.features.length:1,bt=0;btK||Q>et||kt>X)return H=lt,K=B,et=Q,X=kt,void(A=0);var ct=g.lineString([H,lt],R.properties);if(j(ct,B,D,kt,A)===!1)return!1;A++,H=lt})!==!1&&void 0}}})}function q(z,j){if(!z)throw new Error("geojson is required");T(z,function(R,B,D){if(R.geometry!==null){var A=R.geometry.type,G=R.geometry.coordinates;switch(A){case"LineString":if(j(R,B,D,0,0)===!1)return!1;break;case"Polygon":for(var H=0;H{"use strict";c(7107);var g=c(2492),m=c.n(g);let v=JSON.parse('{"tooltips":{"placeMarker":"Click to place marker","firstVertex":"Click to place first vertex","continueLine":"Click to continue drawing","finishLine":"Click any existing marker to finish","finishPoly":"Click first marker to finish","finishRect":"Click to finish","startCircle":"Click to place circle center","finishCircle":"Click to finish circle","placeCircleMarker":"Click to place circle marker","placeText":"Click to place text"},"actions":{"finish":"Finish","cancel":"Cancel","removeLastVertex":"Remove Last Vertex"},"buttonTitles":{"drawMarkerButton":"Draw Marker","drawPolyButton":"Draw Polygons","drawLineButton":"Draw Polyline","drawCircleButton":"Draw Circle","drawRectButton":"Draw Rectangle","editButton":"Edit Layers","dragButton":"Drag Layers","cutButton":"Cut Layers","deleteButton":"Remove Layers","drawCircleMarkerButton":"Draw Circle Marker","snappingButton":"Snap dragged marker to other layers and vertices","pinningButton":"Pin shared vertices together","rotateButton":"Rotate Layers","drawTextButton":"Draw Text","scaleButton":"Scale Layers","autoTracingButton":"Auto trace Line"},"measurements":{"totalLength":"Length","segmentLength":"Segment length","area":"Area","radius":"Radius","perimeter":"Perimeter","height":"Height","width":"Width","coordinates":"Position","coordinatesMarker":"Position Marker"}}'),x=JSON.parse('{"tooltips":{"placeMarker":"Platziere den Marker mit Klick","firstVertex":"Platziere den ersten Marker mit Klick","continueLine":"Klicke, um weiter zu zeichnen","finishLine":"Beende mit Klick auf existierenden Marker","finishPoly":"Beende mit Klick auf ersten Marker","finishRect":"Beende mit Klick","startCircle":"Platziere das Kreiszentrum mit Klick","finishCircle":"Beende den Kreis mit Klick","placeCircleMarker":"Platziere den Kreismarker mit Klick","placeText":"Platziere den Text mit Klick"},"actions":{"finish":"Beenden","cancel":"Abbrechen","removeLastVertex":"Letzten Vertex l\xF6schen"},"buttonTitles":{"drawMarkerButton":"Marker zeichnen","drawPolyButton":"Polygon zeichnen","drawLineButton":"Polyline zeichnen","drawCircleButton":"Kreis zeichnen","drawRectButton":"Rechteck zeichnen","editButton":"Layer editieren","dragButton":"Layer bewegen","cutButton":"Layer schneiden","deleteButton":"Layer l\xF6schen","drawCircleMarkerButton":"Kreismarker zeichnen","snappingButton":"Bewegter Layer an andere Layer oder Vertexe einhacken","pinningButton":"Vertexe an der gleichen Position verkn\xFCpfen","rotateButton":"Layer drehen","drawTextButton":"Text zeichnen","scaleButton":"Layer skalieren","autoTracingButton":"Linie automatisch nachzeichen"},"measurements":{"totalLength":"L\xE4nge","segmentLength":"Segment L\xE4nge","area":"Fl\xE4che","radius":"Radius","perimeter":"Umfang","height":"H\xF6he","width":"Breite","coordinates":"Position","coordinatesMarker":"Position Marker"}}'),P=JSON.parse(`{"tooltips":{"placeMarker":"Clicca per posizionare un Marker","firstVertex":"Clicca per posizionare il primo vertice","continueLine":"Clicca per continuare a disegnare","finishLine":"Clicca qualsiasi marker esistente per terminare","finishPoly":"Clicca il primo marker per terminare","finishRect":"Clicca per terminare","startCircle":"Clicca per posizionare il punto centrale del cerchio","finishCircle":"Clicca per terminare il cerchio","placeCircleMarker":"Clicca per posizionare un Marker del cherchio"},"actions":{"finish":"Termina","cancel":"Annulla","removeLastVertex":"Rimuovi l'ultimo vertice"},"buttonTitles":{"drawMarkerButton":"Disegna Marker","drawPolyButton":"Disegna Poligoni","drawLineButton":"Disegna Polilinea","drawCircleButton":"Disegna Cerchio","drawRectButton":"Disegna Rettangolo","editButton":"Modifica Livelli","dragButton":"Sposta Livelli","cutButton":"Ritaglia Livelli","deleteButton":"Elimina Livelli","drawCircleMarkerButton":"Disegna Marker del Cerchio","snappingButton":"Snap ha trascinato il pennarello su altri strati e vertici","pinningButton":"Pin condiviso vertici insieme"}}`),T=JSON.parse('{"tooltips":{"placeMarker":"Klik untuk menempatkan marker","firstVertex":"Klik untuk menempatkan vertex pertama","continueLine":"Klik untuk meneruskan digitasi","finishLine":"Klik pada sembarang marker yang ada untuk mengakhiri","finishPoly":"Klik marker pertama untuk mengakhiri","finishRect":"Klik untuk mengakhiri","startCircle":"Klik untuk menempatkan titik pusat lingkaran","finishCircle":"Klik untuk mengakhiri lingkaran","placeCircleMarker":"Klik untuk menempatkan penanda lingkarann"},"actions":{"finish":"Selesai","cancel":"Batal","removeLastVertex":"Hilangkan Vertex Terakhir"},"buttonTitles":{"drawMarkerButton":"Digitasi Marker","drawPolyButton":"Digitasi Polygon","drawLineButton":"Digitasi Polyline","drawCircleButton":"Digitasi Lingkaran","drawRectButton":"Digitasi Segi Empat","editButton":"Edit Layer","dragButton":"Geser Layer","cutButton":"Potong Layer","deleteButton":"Hilangkan Layer","drawCircleMarkerButton":"Digitasi Penanda Lingkaran","snappingButton":"Jepretkan penanda yang ditarik ke lapisan dan simpul lain","pinningButton":"Sematkan simpul bersama bersama"}}'),N=JSON.parse('{"tooltips":{"placeMarker":"Adaug\u0103 un punct","firstVertex":"Apas\u0103 aici pentru a ad\u0103uga primul Vertex","continueLine":"Apas\u0103 aici pentru a continua desenul","finishLine":"Apas\u0103 pe orice obiect pentru a finisa desenul","finishPoly":"Apas\u0103 pe primul obiect pentru a finisa","finishRect":"Apas\u0103 pentru a finisa","startCircle":"Apas\u0103 pentru a desena un cerc","finishCircle":"Apas\u0103 pentru a finisa un cerc","placeCircleMarker":"Adaug\u0103 un punct"},"actions":{"finish":"Termin\u0103","cancel":"Anuleaz\u0103","removeLastVertex":"\u0218terge ultimul Vertex"},"buttonTitles":{"drawMarkerButton":"Adaug\u0103 o bulin\u0103","drawPolyButton":"Deseneaz\u0103 un poligon","drawLineButton":"Deseneaz\u0103 o linie","drawCircleButton":"Deseneaz\u0103 un cerc","drawRectButton":"Deseneaz\u0103 un dreptunghi","editButton":"Editeaz\u0103 straturile","dragButton":"Mut\u0103 straturile","cutButton":"Taie straturile","deleteButton":"\u0218terge straturile","drawCircleMarkerButton":"Deseneaz\u0103 marcatorul cercului","snappingButton":"Fixa\u021Bi marcatorul glisat pe alte straturi \u0219i v\xE2rfuri","pinningButton":"Fixa\u021Bi v\xE2rfurile partajate \xEEmpreun\u0103"}}'),q=JSON.parse('{"tooltips":{"placeMarker":"\u041D\u0430\u0436\u043C\u0438\u0442\u0435, \u0447\u0442\u043E\u0431\u044B \u043D\u0430\u043D\u0435\u0441\u0442\u0438 \u043C\u0430\u0440\u043A\u0435\u0440","firstVertex":"\u041D\u0430\u0436\u043C\u0438\u0442\u0435, \u0447\u0442\u043E\u0431\u044B \u043D\u0430\u043D\u0435\u0441\u0442\u0438 \u043F\u0435\u0440\u0432\u044B\u0439 \u043E\u0431\u044A\u0435\u043A\u0442","continueLine":"\u041D\u0430\u0436\u043C\u0438\u0442\u0435, \u0447\u0442\u043E\u0431\u044B \u043F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u0442\u044C \u0440\u0438\u0441\u043E\u0432\u0430\u043D\u0438\u0435","finishLine":"\u041D\u0430\u0436\u043C\u0438\u0442\u0435 \u043B\u044E\u0431\u043E\u0439 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044E\u0449\u0438\u0439 \u043C\u0430\u0440\u043A\u0435\u0440 \u0434\u043B\u044F \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u0438\u044F","finishPoly":"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043F\u0435\u0440\u0432\u0443\u044E \u0442\u043E\u0447\u043A\u0443, \u0447\u0442\u043E\u0431\u044B \u0437\u0430\u043A\u043E\u043D\u0447\u0438\u0442\u044C","finishRect":"\u041D\u0430\u0436\u043C\u0438\u0442\u0435, \u0447\u0442\u043E\u0431\u044B \u0437\u0430\u043A\u043E\u043D\u0447\u0438\u0442\u044C","startCircle":"\u041D\u0430\u0436\u043C\u0438\u0442\u0435, \u0447\u0442\u043E\u0431\u044B \u0434\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0446\u0435\u043D\u0442\u0440 \u043A\u0440\u0443\u0433\u0430","finishCircle":"\u041D\u0430\u0436\u043C\u0438\u0442\u0435, \u0447\u0442\u043E\u0431\u044B \u0437\u0430\u0434\u0430\u0442\u044C \u0440\u0430\u0434\u0438\u0443\u0441","placeCircleMarker":"\u041D\u0430\u0436\u043C\u0438\u0442\u0435, \u0447\u0442\u043E\u0431\u044B \u043D\u0430\u043D\u0435\u0441\u0442\u0438 \u043A\u0440\u0443\u0433\u043E\u0432\u043E\u0439 \u043C\u0430\u0440\u043A\u0435\u0440"},"actions":{"finish":"\u0417\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044C","cancel":"\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C","removeLastVertex":"\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0435\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435"},"buttonTitles":{"drawMarkerButton":"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u043C\u0430\u0440\u043A\u0435\u0440","drawPolyButton":"\u0420\u0438\u0441\u043E\u0432\u0430\u0442\u044C \u043F\u043E\u043B\u0438\u0433\u043E\u043D","drawLineButton":"\u0420\u0438\u0441\u043E\u0432\u0430\u0442\u044C \u043A\u0440\u0438\u0432\u0443\u044E","drawCircleButton":"\u0420\u0438\u0441\u043E\u0432\u0430\u0442\u044C \u043A\u0440\u0443\u0433","drawRectButton":"\u0420\u0438\u0441\u043E\u0432\u0430\u0442\u044C \u043F\u0440\u044F\u043C\u043E\u0443\u0433\u043E\u043B\u044C\u043D\u0438\u043A","editButton":"\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0441\u043B\u043E\u0439","dragButton":"\u041F\u0435\u0440\u0435\u043D\u0435\u0441\u0442\u0438 \u0441\u043B\u043E\u0439","cutButton":"\u0412\u044B\u0440\u0435\u0437\u0430\u0442\u044C \u0441\u043B\u043E\u0439","deleteButton":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0441\u043B\u043E\u0439","drawCircleMarkerButton":"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u043A\u0440\u0443\u0433\u043E\u0432\u043E\u0439 \u043C\u0430\u0440\u043A\u0435\u0440","snappingButton":"\u041F\u0440\u0438\u0432\u044F\u0437\u0430\u0442\u044C \u043F\u0435\u0440\u0435\u0442\u0430\u0441\u043A\u0438\u0432\u0430\u0435\u043C\u044B\u0439 \u043C\u0430\u0440\u043A\u0435\u0440 \u043A \u0434\u0440\u0443\u0433\u0438\u043C \u0441\u043B\u043E\u044F\u043C \u0438 \u0432\u0435\u0440\u0448\u0438\u043D\u0430\u043C","pinningButton":"\u0421\u0432\u044F\u0437\u0430\u0442\u044C \u043E\u0431\u0449\u0438\u0435 \u0442\u043E\u0447\u043A\u0438 \u0432\u043C\u0435\u0441\u0442\u0435"}}'),z=JSON.parse('{"tooltips":{"placeMarker":"Presiona para colocar un marcador","firstVertex":"Presiona para colocar el primer v\xE9rtice","continueLine":"Presiona para continuar dibujando","finishLine":"Presiona cualquier marcador existente para finalizar","finishPoly":"Presiona el primer marcador para finalizar","finishRect":"Presiona para finalizar","startCircle":"Presiona para colocar el centro del c\xEDrculo","finishCircle":"Presiona para finalizar el c\xEDrculo","placeCircleMarker":"Presiona para colocar un marcador de c\xEDrculo"},"actions":{"finish":"Finalizar","cancel":"Cancelar","removeLastVertex":"Eliminar \xFAltimo v\xE9rtice"},"buttonTitles":{"drawMarkerButton":"Dibujar Marcador","drawPolyButton":"Dibujar Pol\xEDgono","drawLineButton":"Dibujar L\xEDnea","drawCircleButton":"Dibujar C\xEDrculo","drawRectButton":"Dibujar Rect\xE1ngulo","editButton":"Editar Capas","dragButton":"Arrastrar Capas","cutButton":"Cortar Capas","deleteButton":"Eliminar Capas","drawCircleMarkerButton":"Dibujar Marcador de C\xEDrculo","snappingButton":"El marcador de Snap arrastrado a otras capas y v\xE9rtices","pinningButton":"Fijar juntos los v\xE9rtices compartidos"}}'),j=JSON.parse('{"tooltips":{"placeMarker":"Klik om een marker te plaatsen","firstVertex":"Klik om het eerste punt te plaatsen","continueLine":"Klik om te blijven tekenen","finishLine":"Klik op een bestaand punt om te be\xEBindigen","finishPoly":"Klik op het eerst punt om te be\xEBindigen","finishRect":"Klik om te be\xEBindigen","startCircle":"Klik om het middelpunt te plaatsen","finishCircle":"Klik om de cirkel te be\xEBindigen","placeCircleMarker":"Klik om een marker te plaatsen"},"actions":{"finish":"Bewaar","cancel":"Annuleer","removeLastVertex":"Verwijder laatste punt"},"buttonTitles":{"drawMarkerButton":"Plaats Marker","drawPolyButton":"Teken een vlak","drawLineButton":"Teken een lijn","drawCircleButton":"Teken een cirkel","drawRectButton":"Teken een vierkant","editButton":"Bewerk","dragButton":"Verplaats","cutButton":"Knip","deleteButton":"Verwijder","drawCircleMarkerButton":"Plaats Marker","snappingButton":"Snap gesleepte marker naar andere lagen en hoekpunten","pinningButton":"Speld gedeelde hoekpunten samen"}}'),R=JSON.parse(`{"tooltips":{"placeMarker":"Cliquez pour placer un marqueur","firstVertex":"Cliquez pour placer le premier sommet","continueLine":"Cliquez pour continuer \xE0 dessiner","finishLine":"Cliquez sur n'importe quel marqueur pour terminer","finishPoly":"Cliquez sur le premier marqueur pour terminer","finishRect":"Cliquez pour terminer","startCircle":"Cliquez pour placer le centre du cercle","finishCircle":"Cliquez pour finir le cercle","placeCircleMarker":"Cliquez pour placer le marqueur circulaire"},"actions":{"finish":"Terminer","cancel":"Annuler","removeLastVertex":"Retirer le dernier sommet"},"buttonTitles":{"drawMarkerButton":"Placer des marqueurs","drawPolyButton":"Dessiner des polygones","drawLineButton":"Dessiner des polylignes","drawCircleButton":"Dessiner un cercle","drawRectButton":"Dessiner un rectangle","editButton":"\xC9diter des calques","dragButton":"D\xE9placer des calques","cutButton":"Couper des calques","deleteButton":"Supprimer des calques","drawCircleMarkerButton":"Dessiner un marqueur circulaire","snappingButton":"Glisser le marqueur vers d'autres couches et sommets","pinningButton":"\xC9pingler ensemble les sommets partag\xE9s","rotateButton":"Tourner des calques"}}`),B=JSON.parse('{"tooltips":{"placeMarker":"\u5355\u51FB\u653E\u7F6E\u6807\u8BB0","firstVertex":"\u5355\u51FB\u653E\u7F6E\u9996\u4E2A\u9876\u70B9","continueLine":"\u5355\u51FB\u7EE7\u7EED\u7ED8\u5236","finishLine":"\u5355\u51FB\u4EFB\u4F55\u5B58\u5728\u7684\u6807\u8BB0\u4EE5\u5B8C\u6210","finishPoly":"\u5355\u51FB\u7B2C\u4E00\u4E2A\u6807\u8BB0\u4EE5\u5B8C\u6210","finishRect":"\u5355\u51FB\u5B8C\u6210","startCircle":"\u5355\u51FB\u653E\u7F6E\u5706\u5FC3","finishCircle":"\u5355\u51FB\u5B8C\u6210\u5706\u5F62","placeCircleMarker":"\u70B9\u51FB\u653E\u7F6E\u5706\u5F62\u6807\u8BB0"},"actions":{"finish":"\u5B8C\u6210","cancel":"\u53D6\u6D88","removeLastVertex":"\u79FB\u9664\u6700\u540E\u7684\u9876\u70B9"},"buttonTitles":{"drawMarkerButton":"\u7ED8\u5236\u6807\u8BB0","drawPolyButton":"\u7ED8\u5236\u591A\u8FB9\u5F62","drawLineButton":"\u7ED8\u5236\u7EBF\u6BB5","drawCircleButton":"\u7ED8\u5236\u5706\u5F62","drawRectButton":"\u7ED8\u5236\u957F\u65B9\u5F62","editButton":"\u7F16\u8F91\u56FE\u5C42","dragButton":"\u62D6\u62FD\u56FE\u5C42","cutButton":"\u526A\u5207\u56FE\u5C42","deleteButton":"\u5220\u9664\u56FE\u5C42","drawCircleMarkerButton":"\u753B\u5706\u5708\u6807\u8BB0","snappingButton":"\u5C06\u62D6\u52A8\u7684\u6807\u8BB0\u6355\u6349\u5230\u5176\u4ED6\u56FE\u5C42\u548C\u9876\u70B9","pinningButton":"\u5C06\u5171\u4EAB\u9876\u70B9\u56FA\u5B9A\u5728\u4E00\u8D77"}}'),D=JSON.parse('{"tooltips":{"placeMarker":"\u55AE\u64CA\u653E\u7F6E\u6A19\u8A18","firstVertex":"\u55AE\u64CA\u653E\u7F6E\u7B2C\u4E00\u500B\u9802\u9EDE","continueLine":"\u55AE\u64CA\u7E7C\u7E8C\u7E6A\u88FD","finishLine":"\u55AE\u64CA\u4EFB\u4F55\u5B58\u5728\u7684\u6A19\u8A18\u4EE5\u5B8C\u6210","finishPoly":"\u55AE\u64CA\u7B2C\u4E00\u500B\u6A19\u8A18\u4EE5\u5B8C\u6210","finishRect":"\u55AE\u64CA\u5B8C\u6210","startCircle":"\u55AE\u64CA\u653E\u7F6E\u5713\u5FC3","finishCircle":"\u55AE\u64CA\u5B8C\u6210\u5713\u5F62","placeCircleMarker":"\u9EDE\u64CA\u653E\u7F6E\u5713\u5F62\u6A19\u8A18"},"actions":{"finish":"\u5B8C\u6210","cancel":"\u53D6\u6D88","removeLastVertex":"\u79FB\u9664\u6700\u5F8C\u4E00\u500B\u9802\u9EDE"},"buttonTitles":{"drawMarkerButton":"\u653E\u7F6E\u6A19\u8A18","drawPolyButton":"\u7E6A\u88FD\u591A\u908A\u5F62","drawLineButton":"\u7E6A\u88FD\u7DDA\u6BB5","drawCircleButton":"\u7E6A\u88FD\u5713\u5F62","drawRectButton":"\u7E6A\u88FD\u65B9\u5F62","editButton":"\u7DE8\u8F2F\u5716\u5F62","dragButton":"\u79FB\u52D5\u5716\u5F62","cutButton":"\u88C1\u5207\u5716\u5F62","deleteButton":"\u522A\u9664\u5716\u5F62","drawCircleMarkerButton":"\u756B\u5713\u5708\u6A19\u8A18","snappingButton":"\u5C07\u62D6\u52D5\u7684\u6A19\u8A18\u5C0D\u9F4A\u5230\u5176\u4ED6\u5716\u5C64\u548C\u9802\u9EDE","pinningButton":"\u5C07\u5171\u4EAB\u9802\u9EDE\u56FA\u5B9A\u5728\u4E00\u8D77"}}'),A={en:v,de:x,it:P,id:T,ro:N,ru:q,es:z,nl:j,fr:R,pt_br:JSON.parse('{"tooltips":{"placeMarker":"Clique para posicionar o marcador","firstVertex":"Clique para posicionar o primeiro v\xE9rtice","continueLine":"Clique para continuar desenhando","finishLine":"Clique em qualquer marcador existente para finalizar","finishPoly":"Clique no primeiro ponto para fechar o pol\xEDgono","finishRect":"Clique para finalizar","startCircle":"Clique para posicionar o centro do c\xEDrculo","finishCircle":"Clique para fechar o c\xEDrculo","placeCircleMarker":"Clique para posicionar o marcador circular"},"actions":{"finish":"Finalizar","cancel":"Cancelar","removeLastVertex":"Remover \xFAltimo v\xE9rtice"},"buttonTitles":{"drawMarkerButton":"Desenhar um marcador","drawPolyButton":"Desenhar um pol\xEDgono","drawLineButton":"Desenhar uma polilinha","drawCircleButton":"Desenhar um c\xEDrculo","drawRectButton":"Desenhar um ret\xE2ngulo","editButton":"Editar camada(s)","dragButton":"Mover camada(s)","cutButton":"Recortar camada(s)","deleteButton":"Remover camada(s)","drawCircleMarkerButton":"Marcador de c\xEDrculos de desenho","snappingButton":"Marcador arrastado para outras camadas e v\xE9rtices","pinningButton":"V\xE9rtices compartilhados de pinos juntos"}}'),zh:B,zh_tw:D,pl:JSON.parse('{"tooltips":{"placeMarker":"Kliknij, aby ustawi\u0107 znacznik","firstVertex":"Kliknij, aby ustawi\u0107 pierwszy punkt","continueLine":"Kliknij, aby kontynuowa\u0107 rysowanie","finishLine":"Kliknij dowolny punkt, aby zako\u0144czy\u0107","finishPoly":"Kliknij pierwszy punkt, aby zako\u0144czy\u0107","finishRect":"Kliknij, aby zako\u0144czy\u0107","startCircle":"Kliknij, aby ustawi\u0107 \u015Brodek ko\u0142a","finishCircle":"Kliknij, aby zako\u0144czy\u0107 rysowanie ko\u0142a","placeCircleMarker":"Kliknij, aby ustawi\u0107 okr\u0105g\u0142y znacznik"},"actions":{"finish":"Zako\u0144cz","cancel":"Anuluj","removeLastVertex":"Usu\u0144 ostatni punkt"},"buttonTitles":{"drawMarkerButton":"Narysuj znacznik","drawPolyButton":"Narysuj wielok\u0105t","drawLineButton":"Narysuj \u015Bcie\u017Ck\u0119","drawCircleButton":"Narysuj ko\u0142o","drawRectButton":"Narysuj prostok\u0105t","editButton":"Edytuj","dragButton":"Przesu\u0144","cutButton":"Wytnij","deleteButton":"Usu\u0144","drawCircleMarkerButton":"Narysuj okr\u0105g\u0142y znacznik","snappingButton":"Snap przeci\u0105gni\u0119ty marker na inne warstwy i wierzcho\u0142ki","pinningButton":"Sworze\u0144 wsp\xF3lne wierzcho\u0142ki razem"}}'),sv:JSON.parse('{"tooltips":{"placeMarker":"Klicka f\xF6r att placera mark\xF6r","firstVertex":"Klicka f\xF6r att placera f\xF6rsta h\xF6rnet","continueLine":"Klicka f\xF6r att forts\xE4tta rita","finishLine":"Klicka p\xE5 en existerande punkt f\xF6r att slutf\xF6ra","finishPoly":"Klicka p\xE5 den f\xF6rsta punkten f\xF6r att slutf\xF6ra","finishRect":"Klicka f\xF6r att slutf\xF6ra","startCircle":"Klicka f\xF6r att placera cirkelns centrum","finishCircle":"Klicka f\xF6r att slutf\xF6ra cirkeln","placeCircleMarker":"Klicka f\xF6r att placera cirkelmark\xF6r"},"actions":{"finish":"Slutf\xF6r","cancel":"Avbryt","removeLastVertex":"Ta bort sista h\xF6rnet"},"buttonTitles":{"drawMarkerButton":"Rita Mark\xF6r","drawPolyButton":"Rita Polygoner","drawLineButton":"Rita Linje","drawCircleButton":"Rita Cirkel","drawRectButton":"Rita Rektangel","editButton":"Redigera Lager","dragButton":"Dra Lager","cutButton":"Klipp i Lager","deleteButton":"Ta bort Lager","drawCircleMarkerButton":"Rita Cirkelmark\xF6r","snappingButton":"Sn\xE4pp dra mark\xF6ren till andra lager och h\xF6rn","pinningButton":"F\xE4st delade h\xF6rn tillsammans"}}'),el:JSON.parse('{"tooltips":{"placeMarker":"\u039A\u03AC\u03BD\u03C4\u03B5 \u03BA\u03BB\u03B9\u03BA \u03B3\u03B9\u03B1 \u03BD\u03B1 \u03C4\u03BF\u03C0\u03BF\u03B8\u03B5\u03C4\u03AE\u03C3\u03B5\u03C4\u03B5 \u0394\u03B5\u03AF\u03BA\u03C4\u03B7","firstVertex":"\u039A\u03AC\u03BD\u03C4\u03B5 \u03BA\u03BB\u03B9\u03BA \u03B3\u03B9\u03B1 \u03BD\u03B1 \u03C4\u03BF\u03C0\u03BF\u03B8\u03B5\u03C4\u03AE\u03C3\u03B5\u03C4\u03B5 \u03C4\u03BF \u03C0\u03C1\u03CE\u03C4\u03BF \u03C3\u03B7\u03BC\u03B5\u03AF\u03BF","continueLine":"\u039A\u03AC\u03BD\u03C4\u03B5 \u03BA\u03BB\u03B9\u03BA \u03B3\u03B9\u03B1 \u03BD\u03B1 \u03C3\u03C5\u03BD\u03B5\u03C7\u03AF\u03C3\u03B5\u03C4\u03B5 \u03BD\u03B1 \u03C3\u03C7\u03B5\u03B4\u03B9\u03AC\u03B6\u03B5\u03C4\u03B5","finishLine":"\u039A\u03AC\u03BD\u03C4\u03B5 \u03BA\u03BB\u03B9\u03BA \u03C3\u03B5 \u03BF\u03C0\u03BF\u03B9\u03BF\u03BD\u03B4\u03AE\u03C0\u03BF\u03C4\u03B5 \u03C5\u03C0\u03AC\u03C1\u03C7\u03BF\u03BD \u03C3\u03B7\u03BC\u03B5\u03AF\u03BF \u03B3\u03B9\u03B1 \u03BD\u03B1 \u03BF\u03BB\u03BF\u03BA\u03BB\u03B7\u03C1\u03C9\u03B8\u03B5\u03AF","finishPoly":"\u039A\u03AC\u03BD\u03C4\u03B5 \u03BA\u03BB\u03B9\u03BA \u03C3\u03C4\u03BF \u03C0\u03C1\u03CE\u03C4\u03BF \u03C3\u03B7\u03BC\u03B5\u03AF\u03BF \u03B3\u03B9\u03B1 \u03BD\u03B1 \u03C4\u03B5\u03BB\u03B5\u03B9\u03CE\u03C3\u03B5\u03C4\u03B5","finishRect":"\u039A\u03AC\u03BD\u03C4\u03B5 \u03BA\u03BB\u03B9\u03BA \u03B3\u03B9\u03B1 \u03BD\u03B1 \u03C4\u03B5\u03BB\u03B5\u03B9\u03CE\u03C3\u03B5\u03C4\u03B5","startCircle":"\u039A\u03AC\u03BD\u03C4\u03B5 \u03BA\u03BB\u03B9\u03BA \u03B3\u03B9\u03B1 \u03BD\u03B1 \u03C4\u03BF\u03C0\u03BF\u03B8\u03B5\u03C4\u03AE\u03C3\u03B5\u03C4\u03B5 \u03BA\u03AD\u03BD\u03C4\u03C1\u03BF \u039A\u03CD\u03BA\u03BB\u03BF\u03C5","finishCircle":"\u039A\u03AC\u03BD\u03C4\u03B5 \u03BA\u03BB\u03B9\u03BA \u03B3\u03B9\u03B1 \u03BD\u03B1 \u03BF\u03BB\u03BF\u03BA\u03BB\u03B7\u03C1\u03CE\u03C3\u03B5\u03C4\u03B5 \u03C4\u03BF\u03BD \u039A\u03CD\u03BA\u03BB\u03BF","placeCircleMarker":"\u039A\u03AC\u03BD\u03C4\u03B5 \u03BA\u03BB\u03B9\u03BA \u03B3\u03B9\u03B1 \u03BD\u03B1 \u03C4\u03BF\u03C0\u03BF\u03B8\u03B5\u03C4\u03AE\u03C3\u03B5\u03C4\u03B5 \u039A\u03C5\u03BA\u03BB\u03B9\u03BA\u03CC \u0394\u03B5\u03AF\u03BA\u03C4\u03B7"},"actions":{"finish":"\u03A4\u03AD\u03BB\u03BF\u03C2","cancel":"\u0391\u03BA\u03CD\u03C1\u03C9\u03C3\u03B7","removeLastVertex":"\u039A\u03B1\u03C4\u03AC\u03C1\u03B3\u03B7\u03C3\u03B7 \u03C4\u03B5\u03BB\u03B5\u03C5\u03C4\u03B1\u03AF\u03BF\u03C5 \u03C3\u03B7\u03BC\u03B5\u03AF\u03BF\u03C5"},"buttonTitles":{"drawMarkerButton":"\u03A3\u03C7\u03B5\u03B4\u03AF\u03B1\u03C3\u03B7 \u0394\u03B5\u03AF\u03BA\u03C4\u03B7","drawPolyButton":"\u03A3\u03C7\u03B5\u03B4\u03AF\u03B1\u03C3\u03B7 \u03A0\u03BF\u03BB\u03C5\u03B3\u03CE\u03BD\u03BF\u03C5","drawLineButton":"\u03A3\u03C7\u03B5\u03B4\u03AF\u03B1\u03C3\u03B7 \u0393\u03C1\u03B1\u03BC\u03BC\u03AE\u03C2","drawCircleButton":"\u03A3\u03C7\u03B5\u03B4\u03AF\u03B1\u03C3\u03B7 \u039A\u03CD\u03BA\u03BB\u03BF\u03C5","drawRectButton":"\u03A3\u03C7\u03B5\u03B4\u03AF\u03B1\u03C3\u03B7 \u039F\u03C1\u03B8\u03BF\u03B3\u03C9\u03BD\u03AF\u03BF\u03C5","editButton":"\u0395\u03C0\u03B5\u03BE\u03B5\u03C1\u03B3\u03B1\u03C3\u03AF\u03B1 \u0395\u03C0\u03B9\u03C0\u03AD\u03B4\u03C9\u03BD","dragButton":"\u039C\u03B5\u03C4\u03B1\u03C6\u03BF\u03C1\u03AC \u0395\u03C0\u03B9\u03C0\u03AD\u03B4\u03C9\u03BD","cutButton":"\u0391\u03C0\u03BF\u03BA\u03BF\u03C0\u03AE \u0395\u03C0\u03B9\u03C0\u03AD\u03B4\u03C9\u03BD","deleteButton":"\u039A\u03B1\u03C4\u03AC\u03C1\u03B3\u03B7\u03C3\u03B7 \u0395\u03C0\u03B9\u03C0\u03AD\u03B4\u03C9\u03BD","drawCircleMarkerButton":"\u03A3\u03C7\u03B5\u03B4\u03AF\u03B1\u03C3\u03B7 \u039A\u03C5\u03BA\u03BB\u03B9\u03BA\u03BF\u03CD \u0394\u03B5\u03AF\u03BA\u03C4\u03B7","snappingButton":"\u03A0\u03C1\u03BF\u03C3\u03BA\u03CC\u03BB\u03BB\u03B7\u03C3\u03B7 \u03C4\u03BF\u03C5 \u0394\u03B5\u03AF\u03BA\u03C4\u03B7 \u03BC\u03B5\u03C4\u03B1\u03C6\u03BF\u03C1\u03AC\u03C2 \u03C3\u03B5 \u03AC\u03BB\u03BB\u03B1 \u0395\u03C0\u03AF\u03C0\u03B5\u03B4\u03B1 \u03BA\u03B1\u03B9 \u039A\u03BF\u03C1\u03C5\u03C6\u03AD\u03C2","pinningButton":"\u03A0\u03B5\u03C1\u03B9\u03BA\u03BF\u03C0\u03AE \u03BA\u03BF\u03B9\u03BD\u03CE\u03BD \u03BA\u03BF\u03C1\u03C5\u03C6\u03CE\u03BD \u03BC\u03B1\u03B6\u03AF"}}'),hu:JSON.parse('{"tooltips":{"placeMarker":"Kattintson a jel\xF6l\u0151 elhelyez\xE9s\xE9hez","firstVertex":"Kattintson az els\u0151 pont elhelyez\xE9s\xE9hez","continueLine":"Kattintson a k\xF6vetkez\u0151 pont elhelyez\xE9s\xE9hez","finishLine":"A befejez\xE9shez kattintson egy megl\xE9v\u0151 pontra","finishPoly":"A befejez\xE9shez kattintson az els\u0151 pontra","finishRect":"Kattintson a befejez\xE9shez","startCircle":"Kattintson a k\xF6r k\xF6z\xE9ppontj\xE1nak elhelyez\xE9s\xE9hez","finishCircle":"Kattintson a k\xF6r befejez\xE9s\xE9hez","placeCircleMarker":"Kattintson a k\xF6rjel\xF6l\u0151 elhelyez\xE9s\xE9hez"},"actions":{"finish":"Befejez\xE9s","cancel":"M\xE9gse","removeLastVertex":"Utols\xF3 pont elt\xE1vol\xEDt\xE1sa"},"buttonTitles":{"drawMarkerButton":"Jel\xF6l\u0151 rajzol\xE1sa","drawPolyButton":"Poligon rajzol\xE1sa","drawLineButton":"Vonal rajzol\xE1sa","drawCircleButton":"K\xF6r rajzol\xE1sa","drawRectButton":"N\xE9gyzet rajzol\xE1sa","editButton":"Elemek szerkeszt\xE9se","dragButton":"Elemek mozgat\xE1sa","cutButton":"Elemek v\xE1g\xE1sa","deleteButton":"Elemek t\xF6rl\xE9se","drawCircleMarkerButton":"K\xF6r jel\xF6l\u0151 rajzol\xE1sa","snappingButton":"Kapcsolja a jel\xF6lt\u0151t m\xE1sik elemhez vagy ponthoz","pinningButton":"K\xF6z\xF6s pontok \xF6sszek\xF6t\xE9se"}}'),da:JSON.parse('{"tooltips":{"placeMarker":"Tryk for at placere en mark\xF8r","firstVertex":"Tryk for at placere det f\xF8rste punkt","continueLine":"Tryk for at forts\xE6tte linjen","finishLine":"Tryk p\xE5 et eksisterende punkt for at afslutte","finishPoly":"Tryk p\xE5 det f\xF8rste punkt for at afslutte","finishRect":"Tryk for at afslutte","startCircle":"Tryk for at placere cirklens center","finishCircle":"Tryk for at afslutte cirklen","placeCircleMarker":"Tryk for at placere en cirkelmark\xF8r"},"actions":{"finish":"Afslut","cancel":"Afbryd","removeLastVertex":"Fjern sidste punkt"},"buttonTitles":{"drawMarkerButton":"Placer mark\xF8r","drawPolyButton":"Tegn polygon","drawLineButton":"Tegn linje","drawCircleButton":"Tegn cirkel","drawRectButton":"Tegn firkant","editButton":"Rediger","dragButton":"Tr\xE6k","cutButton":"Klip","deleteButton":"Fjern","drawCircleMarkerButton":"Tegn cirkelmark\xF8r","snappingButton":"Fastg\xF8r trukket mark\xF8r til andre elementer","pinningButton":"Sammenl\xE6g delte elementer"}}'),no:JSON.parse('{"tooltips":{"placeMarker":"Klikk for \xE5 plassere punkt","firstVertex":"Klikk for \xE5 plassere f\xF8rste punkt","continueLine":"Klikk for \xE5 tegne videre","finishLine":"Klikk p\xE5 et eksisterende punkt for \xE5 fullf\xF8re","finishPoly":"Klikk f\xF8rste punkt for \xE5 fullf\xF8re","finishRect":"Klikk for \xE5 fullf\xF8re","startCircle":"Klikk for \xE5 sette sirkel midtpunkt","finishCircle":"Klikk for \xE5 fullf\xF8re sirkel","placeCircleMarker":"Klikk for \xE5 plassere sirkel"},"actions":{"finish":"Fullf\xF8r","cancel":"Kanseller","removeLastVertex":"Fjern forrige punkt"},"buttonTitles":{"drawMarkerButton":"Tegn Punkt","drawPolyButton":"Tegn Flate","drawLineButton":"Tegn Linje","drawCircleButton":"Tegn Sirkel","drawRectButton":"Tegn rektangel","editButton":"Rediger Objekter","dragButton":"Dra Objekter","cutButton":"Kutt Objekter","deleteButton":"Fjern Objekter","drawCircleMarkerButton":"Tegn sirkel-punkt","snappingButton":"Fest dratt punkt til andre objekter og punkt","pinningButton":"Pin delte punkt sammen"}}'),fa:JSON.parse('{"tooltips":{"placeMarker":"\u06A9\u0644\u06CC\u06A9 \u0628\u0631\u0627\u06CC \u062C\u0627\u0646\u0645\u0627\u06CC\u06CC \u0646\u0634\u0627\u0646","firstVertex":"\u06A9\u0644\u06CC\u06A9 \u0628\u0631\u0627\u06CC \u0631\u0633\u0645 \u0627\u0648\u0644\u06CC\u0646 \u0631\u0623\u0633","continueLine":"\u06A9\u0644\u06CC\u06A9 \u0628\u0631\u0627\u06CC \u0627\u062F\u0627\u0645\u0647 \u0631\u0633\u0645","finishLine":"\u06A9\u0644\u06CC\u06A9 \u0631\u0648\u06CC \u0647\u0631 \u0646\u0634\u0627\u0646 \u0645\u0648\u062C\u0648\u062F \u0628\u0631\u0627\u06CC \u067E\u0627\u06CC\u0627\u0646","finishPoly":"\u06A9\u0644\u06CC\u06A9 \u0631\u0648\u06CC \u0627\u0648\u0644\u06CC\u0646 \u0646\u0634\u0627\u0646 \u0628\u0631\u0627\u06CC \u067E\u0627\u06CC\u0627\u0646","finishRect":"\u06A9\u0644\u06CC\u06A9 \u0628\u0631\u0627\u06CC \u067E\u0627\u06CC\u0627\u0646","startCircle":"\u06A9\u0644\u06CC\u06A9 \u0628\u0631\u0627\u06CC \u0631\u0633\u0645 \u0645\u0631\u06A9\u0632 \u062F\u0627\u06CC\u0631\u0647","finishCircle":"\u06A9\u0644\u06CC\u06A9 \u0628\u0631\u0627\u06CC \u067E\u0627\u06CC\u0627\u0646 \u0631\u0633\u0645 \u062F\u0627\u06CC\u0631\u0647","placeCircleMarker":"\u06A9\u0644\u06CC\u06A9 \u0628\u0631\u0627\u06CC \u0631\u0633\u0645 \u0646\u0634\u0627\u0646 \u062F\u0627\u06CC\u0631\u0647","placeText":"\u06A9\u0644\u06CC\u06A9 \u0628\u0631\u0627\u06CC \u0646\u0648\u0634\u062A\u0646 \u0645\u062A\u0646"},"actions":{"finish":"\u067E\u0627\u06CC\u0627\u0646","cancel":"\u0644\u0641\u0648","removeLastVertex":"\u062D\u0630\u0641 \u0622\u062E\u0631\u06CC\u0646 \u0631\u0623\u0633"},"buttonTitles":{"drawMarkerButton":"\u062F\u0631\u062C \u0646\u0634\u0627\u0646","drawPolyButton":"\u0631\u0633\u0645 \u0686\u0646\u062F\u0636\u0644\u0639\u06CC","drawLineButton":"\u0631\u0633\u0645 \u062E\u0637","drawCircleButton":"\u0631\u0633\u0645 \u062F\u0627\u06CC\u0631\u0647","drawRectButton":"\u0631\u0633\u0645 \u0686\u0647\u0627\u0631\u0636\u0644\u0639\u06CC","editButton":"\u0648\u06CC\u0631\u0627\u06CC\u0634 \u0644\u0627\u06CC\u0647\u200C\u0647\u0627","dragButton":"\u062C\u0627\u0628\u062C\u0627\u06CC\u06CC \u0644\u0627\u06CC\u0647\u200C\u0647\u0627","cutButton":"\u0628\u0631\u0634 \u0644\u0627\u06CC\u0647\u200C\u0647\u0627","deleteButton":"\u062D\u0630\u0641 \u0644\u0627\u06CC\u0647\u200C\u0647\u0627","drawCircleMarkerButton":"\u0631\u0633\u0645 \u0646\u0634\u0627\u0646 \u062F\u0627\u06CC\u0631\u0647","snappingButton":"\u0646\u0634\u0627\u0646\u06AF\u0631 \u0631\u0627 \u0628\u0647 \u0644\u0627\u06CC\u0647\u200C\u0647\u0627 \u0648 \u0631\u0626\u0648\u0633 \u062F\u06CC\u06AF\u0631 \u0628\u06A9\u0634\u06CC\u062F","pinningButton":"\u0631\u0626\u0648\u0633 \u0645\u0634\u062A\u0631\u06A9 \u0631\u0627 \u0628\u0627 \u0647\u0645 \u067E\u06CC\u0646 \u06A9\u0646\u06CC\u062F","rotateButton":"\u0686\u0631\u062E\u0634 \u0644\u0627\u06CC\u0647","drawTextButton":"\u0631\u0633\u0645 \u0645\u062A\u0646"}}'),ua:JSON.parse(`{"tooltips":{"placeMarker":"\u041D\u0430\u0442\u0438\u0441\u043D\u0456\u0442\u044C, \u0449\u043E\u0431 \u043D\u0430\u043D\u0435\u0441\u0442\u0438 \u043C\u0430\u0440\u043A\u0435\u0440","firstVertex":"\u041D\u0430\u0442\u0438\u0441\u043D\u0456\u0442\u044C, \u0449\u043E\u0431 \u043D\u0430\u043D\u0435\u0441\u0442\u0438 \u043F\u0435\u0440\u0448\u0443 \u0432\u0435\u0440\u0448\u0438\u043D\u0443","continueLine":"\u041D\u0430\u0442\u0438\u0441\u043D\u0456\u0442\u044C, \u0449\u043E\u0431 \u043F\u0440\u043E\u0434\u043E\u0432\u0436\u0438\u0442\u0438 \u043C\u0430\u043B\u044E\u0432\u0430\u0442\u0438","finishLine":"\u041D\u0430\u0442\u0438\u0441\u043D\u0456\u0442\u044C \u0431\u0443\u0434\u044C-\u044F\u043A\u0438\u0439 \u0456\u0441\u043D\u0443\u044E\u0447\u0438\u0439 \u043C\u0430\u0440\u043A\u0435\u0440 \u0434\u043B\u044F \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u043D\u044F","finishPoly":"\u0412\u0438\u0431\u0435\u0440\u0456\u0442\u044C \u043F\u0435\u0440\u0448\u0438\u0439 \u043C\u0430\u0440\u043A\u0435\u0440, \u0449\u043E\u0431 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0438","finishRect":"\u041D\u0430\u0442\u0438\u0441\u043D\u0456\u0442\u044C, \u0449\u043E\u0431 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0438","startCircle":"\u041D\u0430\u0442\u0438\u0441\u043D\u0456\u0442\u044C, \u0449\u043E\u0431 \u0434\u043E\u0434\u0430\u0442\u0438 \u0446\u0435\u043D\u0442\u0440 \u043A\u043E\u043B\u0430","finishCircle":"\u041D\u0430\u0442\u0438\u0441\u043D\u0456\u0442\u044C, \u0449\u043E\u0431 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0438 \u043A\u043E\u043B\u043E","placeCircleMarker":"\u041D\u0430\u0442\u0438\u0441\u043D\u0456\u0442\u044C, \u0449\u043E\u0431 \u043D\u0430\u043D\u0435\u0441\u0442\u0438 \u043A\u0440\u0443\u0433\u043E\u0432\u0438\u0439 \u043C\u0430\u0440\u043A\u0435\u0440"},"actions":{"finish":"\u0417\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0438","cancel":"\u0412\u0456\u0434\u043C\u0456\u043D\u0438\u0442\u0438","removeLastVertex":"\u0412\u0438\u0434\u0430\u043B\u0438\u0442\u0438 \u043F\u043E\u043F\u0435\u0440\u0435\u0434\u043D\u044E \u0432\u0435\u0440\u0448\u0438\u043D\u0443"},"buttonTitles":{"drawMarkerButton":"\u041C\u0430\u043B\u044E\u0432\u0430\u0442\u0438 \u043C\u0430\u0440\u043A\u0435\u0440","drawPolyButton":"\u041C\u0430\u043B\u044E\u0432\u0430\u0442\u0438 \u043F\u043E\u043B\u0456\u0433\u043E\u043D","drawLineButton":"\u041C\u0430\u043B\u044E\u0432\u0430\u0442\u0438 \u043A\u0440\u0438\u0432\u0443","drawCircleButton":"\u041C\u0430\u043B\u044E\u0432\u0430\u0442\u0438 \u043A\u043E\u043B\u043E","drawRectButton":"\u041C\u0430\u043B\u044E\u0432\u0430\u0442\u0438 \u043F\u0440\u044F\u043C\u043E\u043A\u0443\u0442\u043D\u0438\u043A","editButton":"\u0420\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u0442\u0438 \u0448\u0430\u0440\u0438","dragButton":"\u041F\u0435\u0440\u0435\u043D\u0435\u0441\u0442\u0438 \u0448\u0430\u0440\u0438","cutButton":"\u0412\u0438\u0440\u0456\u0437\u0430\u0442\u0438 \u0448\u0430\u0440\u0438","deleteButton":"\u0412\u0438\u0434\u0430\u043B\u0438\u0442\u0438 \u0448\u0430\u0440\u0438","drawCircleMarkerButton":"\u041C\u0430\u043B\u044E\u0432\u0430\u0442\u0438 \u043A\u0440\u0443\u0433\u043E\u0432\u0438\u0439 \u043C\u0430\u0440\u043A\u0435\u0440","snappingButton":"\u041F\u0440\u0438\u0432\u2019\u044F\u0437\u0430\u0442\u0438 \u043F\u0435\u0440\u0435\u0442\u044F\u0433\u043D\u0443\u0442\u0438\u0439 \u043C\u0430\u0440\u043A\u0435\u0440 \u0434\u043E \u0456\u043D\u0448\u0438\u0445 \u0448\u0430\u0440\u0456\u0432 \u0442\u0430 \u0432\u0435\u0440\u0448\u0438\u043D","pinningButton":"\u0417\u0432'\u044F\u0437\u0430\u0442\u0438 \u0441\u043F\u0456\u043B\u044C\u043D\u0456 \u0432\u0435\u0440\u0448\u0438\u043D\u0438 \u0440\u0430\u0437\u043E\u043C"}}`),tr:JSON.parse('{"tooltips":{"placeMarker":"\u0130\u015Faret\xE7i yerle\u015Ftirmek i\xE7in t\u0131klay\u0131n","firstVertex":"\u0130lk tepe noktas\u0131n\u0131 yerle\u015Ftirmek i\xE7in t\u0131klay\u0131n","continueLine":"\xC7izime devam etmek i\xE7in t\u0131klay\u0131n","finishLine":"Bitirmek i\xE7in mevcut herhangi bir i\u015Faret\xE7iyi t\u0131klay\u0131n","finishPoly":"Bitirmek i\xE7in ilk i\u015Faret\xE7iyi t\u0131klay\u0131n","finishRect":"Bitirmek i\xE7in t\u0131klay\u0131n","startCircle":"Daire merkezine yerle\u015Ftirmek i\xE7in t\u0131klay\u0131n","finishCircle":"Daireyi bitirmek i\xE7in t\u0131klay\u0131n","placeCircleMarker":"Daire i\u015Faret\xE7isi yerle\u015Ftirmek i\xE7in t\u0131klay\u0131n"},"actions":{"finish":"Bitir","cancel":"\u0130ptal","removeLastVertex":"Son k\xF6\u015Feyi kald\u0131r"},"buttonTitles":{"drawMarkerButton":"\xC7izim \u0130\u015Faret\xE7isi","drawPolyButton":"\xC7okgenler \xE7iz","drawLineButton":"\xC7oklu \xE7izgi \xE7iz","drawCircleButton":"\xC7ember \xE7iz","drawRectButton":"Dikd\xF6rtgen \xE7iz","editButton":"Katmanlar\u0131 d\xFCzenle","dragButton":"Katmanlar\u0131 s\xFCr\xFCkle","cutButton":"Katmanlar\u0131 kes","deleteButton":"Katmanlar\u0131 kald\u0131r","drawCircleMarkerButton":"Daire i\u015Faret\xE7isi \xE7iz","snappingButton":"S\xFCr\xFCklenen i\u015Faret\xE7iyi di\u011Fer katmanlara ve k\xF6\u015Felere yap\u0131\u015Ft\u0131r","pinningButton":"Payla\u015F\u0131lan k\xF6\u015Feleri birbirine sabitle"}}'),cz:JSON.parse('{"tooltips":{"placeMarker":"Kliknut\xEDm vytvo\u0159\xEDte zna\u010Dku","firstVertex":"Kliknut\xEDm vytvo\u0159\xEDte prvn\xED objekt","continueLine":"Kliknut\xEDm pokra\u010Dujte v kreslen\xED","finishLine":"Kliknut\xED na libovolnou existuj\xEDc\xED zna\u010Dku pro dokon\u010Den\xED","finishPoly":"Vyberte prvn\xED bod pro dokon\u010Den\xED","finishRect":"Klikn\u011Bte pro dokon\u010Den\xED","startCircle":"Kliknut\xEDm p\u0159idejte st\u0159ed kruhu","finishCircle":"\u041D\u0430\u0436\u043C\u0438\u0442\u0435, \u0447\u0442\u043E\u0431\u044B \u0437\u0430\u0434\u0430\u0442\u044C \u0440\u0430\u0434\u0438\u0443\u0441","placeCircleMarker":"Kliknut\xEDm nastavte polom\u011Br"},"actions":{"finish":"Dokon\u010Dit","cancel":"Zru\u0161it","removeLastVertex":"Zru\u0161it posledn\xED akci"},"buttonTitles":{"drawMarkerButton":"P\u0159idat zna\u010Dku","drawPolyButton":"Nakreslit polygon","drawLineButton":"Nakreslit k\u0159ivku","drawCircleButton":"Nakreslit kruh","drawRectButton":"Nakreslit obd\xE9ln\xEDk","editButton":"Upravit vrstvu","dragButton":"P\u0159eneste vrstvu","cutButton":"Vyjmout vrstvu","deleteButton":"Smazat vrstvu","drawCircleMarkerButton":"P\u0159idat kruhovou zna\u010Dku","snappingButton":"Nav\xE1zat ta\u017Enou zna\u010Dku k dal\u0161\xEDm vrstv\xE1m a vrchol\u016Fm","pinningButton":"Spojit spole\u010Dn\xE9 body dohromady"}}'),ja:JSON.parse('{"tooltips":{"placeMarker":"\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u30DE\u30FC\u30AB\u30FC\u3092\u914D\u7F6E","firstVertex":"\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u6700\u521D\u306E\u9802\u70B9\u3092\u914D\u7F6E","continueLine":"\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u63CF\u753B\u3092\u7D9A\u3051\u308B","finishLine":"\u4EFB\u610F\u306E\u30DE\u30FC\u30AB\u30FC\u3092\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u7D42\u4E86","finishPoly":"\u6700\u521D\u306E\u30DE\u30FC\u30AB\u30FC\u3092\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u7D42\u4E86","finishRect":"\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u7D42\u4E86","startCircle":"\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u5186\u306E\u4E2D\u5FC3\u3092\u914D\u7F6E","finishCircle":"\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u5186\u306E\u63CF\u753B\u3092\u7D42\u4E86","placeCircleMarker":"\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u5186\u30DE\u30FC\u30AB\u30FC\u3092\u914D\u7F6E","placeText":"\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u30C6\u30AD\u30B9\u30C8\u3092\u914D\u7F6E"},"actions":{"finish":"\u7D42\u4E86","cancel":"\u30AD\u30E3\u30F3\u30BB\u30EB","removeLastVertex":"\u6700\u5F8C\u306E\u9802\u70B9\u3092\u524A\u9664"},"buttonTitles":{"drawMarkerButton":"\u30DE\u30FC\u30AB\u30FC\u3092\u63CF\u753B","drawPolyButton":"\u30DD\u30EA\u30B4\u30F3\u3092\u63CF\u753B","drawLineButton":"\u6298\u308C\u7DDA\u3092\u63CF\u753B","drawCircleButton":"\u5186\u3092\u63CF\u753B","drawRectButton":"\u77E9\u5F62\u3092\u63CF\u753B","editButton":"\u30EC\u30A4\u30E4\u30FC\u3092\u7DE8\u96C6","dragButton":"\u30EC\u30A4\u30E4\u30FC\u3092\u30C9\u30E9\u30C3\u30B0","cutButton":"\u30EC\u30A4\u30E4\u30FC\u3092\u5207\u308A\u53D6\u308A","deleteButton":"\u30EC\u30A4\u30E4\u30FC\u3092\u524A\u9664","drawCircleMarkerButton":"\u5186\u30DE\u30FC\u30AB\u30FC\u3092\u63CF\u753B","snappingButton":"\u30C9\u30E9\u30C3\u30B0\u3057\u305F\u30DE\u30FC\u30AB\u30FC\u3092\u4ED6\u306E\u30EC\u30A4\u30E4\u30FC\u3084\u9802\u70B9\u306B\u30B9\u30CA\u30C3\u30D7\u3059\u308B","pinningButton":"\u5171\u6709\u3059\u308B\u9802\u70B9\u3092\u540C\u6642\u306B\u52D5\u304B\u3059","rotateButton":"\u30EC\u30A4\u30E4\u30FC\u3092\u56DE\u8EE2","drawTextButton":"\u30C6\u30AD\u30B9\u30C8\u3092\u63CF\u753B"}}'),fi:JSON.parse('{"tooltips":{"placeMarker":"Klikkaa asettaaksesi merkin","firstVertex":"Klikkaa asettaakseni ensimm\xE4isen osuuden","continueLine":"Klikkaa jatkaaksesi piirt\xE4mist\xE4","finishLine":"Klikkaa olemassa olevaa merkki\xE4 lopettaaksesi","finishPoly":"Klikkaa ensimm\xE4ist\xE4 merkki\xE4 lopettaaksesi","finishRect":"Klikkaa lopettaaksesi","startCircle":"Klikkaa asettaaksesi ympyr\xE4n keskipisteen","finishCircle":"Klikkaa lopettaaksesi ympyr\xE4n","placeCircleMarker":"Klikkaa asettaaksesi ympyr\xE4merkin","placeText":"Klikkaa asettaaksesi tekstin"},"actions":{"finish":"Valmis","cancel":"Peruuta","removeLastVertex":"Poista viimeinen osuus"},"buttonTitles":{"drawMarkerButton":"Piirr\xE4 merkkej\xE4","drawPolyButton":"Piirr\xE4 monikulmioita","drawLineButton":"Piirr\xE4 viivoja","drawCircleButton":"Piirr\xE4 ympyr\xE4","drawRectButton":"Piirr\xE4 neliskulmioita","editButton":"Muokkaa","dragButton":"Siirr\xE4","cutButton":"Leikkaa","deleteButton":"Poista","drawCircleMarkerButton":"Piirr\xE4 ympyr\xE4merkki","snappingButton":"Kiinnit\xE4 siirrett\xE4v\xE4 merkki toisiin muotoihin","pinningButton":"Kiinnit\xE4 jaetut muodot yhteen","rotateButton":"K\xE4\xE4nn\xE4","drawTextButton":"Piirr\xE4 teksti\xE4"}}'),ko:JSON.parse('{"tooltips":{"placeMarker":"\uB9C8\uCEE4 \uC704\uCE58\uB97C \uD074\uB9AD\uD558\uC138\uC694","firstVertex":"\uCCAB\uBC88\uC9F8 \uAF2D\uC9C0\uC810 \uC704\uCE58\uC744 \uD074\uB9AD\uD558\uC138\uC694","continueLine":"\uACC4\uC18D \uADF8\uB9AC\uB824\uBA74 \uD074\uB9AD\uD558\uC138\uC694","finishLine":"\uB05D\uB0B4\uB824\uBA74 \uAE30\uC874 \uB9C8\uCEE4\uB97C \uD074\uB9AD\uD558\uC138\uC694","finishPoly":"\uB05D\uB0B4\uB824\uBA74 \uCC98\uC74C \uB9C8\uCEE4\uB97C \uD074\uB9AD\uD558\uC138\uC694","finishRect":"\uB05D\uB0B4\uB824\uBA74 \uD074\uB9AD\uD558\uC138\uC694","startCircle":"\uC6D0\uC758 \uC911\uC2EC\uC774 \uB420 \uC704\uCE58\uB97C \uD074\uB9AD\uD558\uC138\uC694","finishCircle":"\uC6D0\uC744 \uB05D\uB0B4\uB824\uBA74 \uD074\uB9AD\uD558\uC138\uC694","placeCircleMarker":"\uC6D0 \uB9C8\uCEE4 \uC704\uCE58\uB97C \uD074\uB9AD\uD558\uC138\uC694","placeText":"\uD14D\uC2A4\uD2B8 \uC704\uCE58\uB97C \uD074\uB9AD\uD558\uC138\uC694"},"actions":{"finish":"\uB05D\uB0B4\uAE30","cancel":"\uCDE8\uC18C","removeLastVertex":"\uB9C8\uC9C0\uB9C9 \uAF2D\uC9C0\uC810 \uC81C\uAC70"},"buttonTitles":{"drawMarkerButton":"\uB9C8\uCEE4 \uADF8\uB9AC\uAE30","drawPolyButton":"\uB2E4\uAC01\uD615 \uADF8\uB9AC\uAE30","drawLineButton":"\uB2E4\uAC01\uC120 \uADF8\uB9AC\uAE30","drawCircleButton":"\uC6D0 \uADF8\uB9AC\uAE30","drawRectButton":"\uC9C1\uC0AC\uAC01\uD615 \uADF8\uB9AC\uAE30","editButton":"\uB808\uC774\uC5B4 \uD3B8\uC9D1\uD558\uAE30","dragButton":"\uB808\uC774\uC5B4 \uB04C\uAE30","cutButton":"\uB808\uC774\uC5B4 \uC790\uB974\uAE30","deleteButton":"\uB808\uC774\uC5B4 \uC81C\uAC70\uD558\uAE30","drawCircleMarkerButton":"\uC6D0 \uB9C8\uCEE4 \uADF8\uB9AC\uAE30","snappingButton":"\uC7A1\uC544\uB048 \uB9C8\uCEE4\uB97C \uB2E4\uB978 \uB808\uC774\uC5B4 \uBC0F \uAF2D\uC9C0\uC810\uC5D0 \uB4E4\uB7EC\uBD99\uAC8C \uD558\uAE30","pinningButton":"\uACF5\uC720 \uAF2D\uC9C0\uC810\uC744 \uD568\uAED8 \uCC0D\uAE30","rotateButton":"\uB808\uC774\uC5B4 \uD68C\uC804\uD558\uAE30","drawTextButton":"\uD14D\uC2A4\uD2B8 \uADF8\uB9AC\uAE30"}}')};function G(h,p){var _=Object.keys(h);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(h);p&&(E=E.filter(function(I){return Object.getOwnPropertyDescriptor(h,I).enumerable})),_.push.apply(_,E)}return _}function H(h){for(var p=1;p0&&arguments[0]!==void 0?arguments[0]:this.globalOptions;this.globalEditModeEnabled()?this.disableGlobalEditMode():this.enableGlobalEditMode(h)},handleLayerAdditionInGlobalEditMode:function(){var h=this._addedLayers;for(var p in this._addedLayers={},h){var _=h[p];this._isRelevantForEdit(_)&&this.globalEditModeEnabled()&&_.pm.enable(H({},this.globalOptions))}},_layerAdded:function(h){var p=h.layer;this._addedLayers[L.stamp(p)]=p},_isRelevantForEdit:function(h){return h.pm&&!(h instanceof L.LayerGroup)&&(!L.PM.optIn&&!h.options.pmIgnore||L.PM.optIn&&h.options.pmIgnore===!1)&&!h._pmTempLayer&&h.pm.options.allowEditing}},X={_globalDragModeEnabled:!1,enableGlobalDragMode:function(){var h=L.PM.Utils.findLayers(this.map);this._globalDragModeEnabled=!0,this._addedLayersDrag={},h.forEach(function(p){p.pm.enableLayerDrag()}),this.throttledReInitDrag||(this.throttledReInitDrag=L.Util.throttle(this.reinitGlobalDragMode,100,this)),this.map.on("layeradd",this._layerAddedDrag,this),this.map.on("layeradd",this.throttledReInitDrag,this),this.Toolbar.toggleButton("dragMode",this.globalDragModeEnabled()),this._fireGlobalDragModeToggled(!0)},disableGlobalDragMode:function(){var h=L.PM.Utils.findLayers(this.map);this._globalDragModeEnabled=!1,h.forEach(function(p){p.pm.disableLayerDrag()}),this.map.off("layeradd",this._layerAddedDrag,this),this.map.off("layeradd",this.throttledReInitDrag,this),this.Toolbar.toggleButton("dragMode",this.globalDragModeEnabled()),this._fireGlobalDragModeToggled(!1)},globalDragModeEnabled:function(){return!!this._globalDragModeEnabled},toggleGlobalDragMode:function(){this.globalDragModeEnabled()?this.disableGlobalDragMode():this.enableGlobalDragMode()},reinitGlobalDragMode:function(){var h=this._addedLayersDrag;for(var p in this._addedLayersDrag={},h){var _=h[p];this._isRelevantForDrag(_)&&this.globalDragModeEnabled()&&_.pm.enableLayerDrag()}},_layerAddedDrag:function(h){var p=h.layer;this._addedLayersDrag[L.stamp(p)]=p},_isRelevantForDrag:function(h){return h.pm&&!(h instanceof L.LayerGroup)&&(!L.PM.optIn&&!h.options.pmIgnore||L.PM.optIn&&h.options.pmIgnore===!1)&&!h._pmTempLayer&&h.pm.options.draggable}},lt={_globalRemovalModeEnabled:!1,enableGlobalRemovalMode:function(){var h=this;this._globalRemovalModeEnabled=!0,this.map.eachLayer(function(p){h._isRelevantForRemoval(p)&&(p.pm.disable(),p.on("click",h.removeLayer,h))}),this.throttledReInitRemoval||(this.throttledReInitRemoval=L.Util.throttle(this.reinitGlobalRemovalMode,100,this)),this.map.on("layeradd",this.throttledReInitRemoval,this),this.Toolbar.toggleButton("removalMode",this.globalRemovalModeEnabled()),this._fireGlobalRemovalModeToggled(!0)},disableGlobalRemovalMode:function(){var h=this;this._globalRemovalModeEnabled=!1,this.map.eachLayer(function(p){p.off("click",h.removeLayer,h)}),this.map.off("layeradd",this.throttledReInitRemoval,this),this.Toolbar.toggleButton("removalMode",this.globalRemovalModeEnabled()),this._fireGlobalRemovalModeToggled(!1)},globalRemovalEnabled:function(){return this.globalRemovalModeEnabled()},globalRemovalModeEnabled:function(){return!!this._globalRemovalModeEnabled},toggleGlobalRemovalMode:function(){this.globalRemovalModeEnabled()?this.disableGlobalRemovalMode():this.enableGlobalRemovalMode()},reinitGlobalRemovalMode:function(h){var p=h.layer;this._isRelevantForRemoval(p)&&this.globalRemovalModeEnabled()&&(this.disableGlobalRemovalMode(),this.enableGlobalRemovalMode())},removeLayer:function(h){var p=h.target;this._isRelevantForRemoval(p)&&!p.pm.dragging()&&(p.removeFrom(this.map.pm._getContainingLayer()),p.remove(),p instanceof L.LayerGroup?(this._fireRemoveLayerGroup(p),this._fireRemoveLayerGroup(this.map,p)):(p.pm._fireRemove(p),p.pm._fireRemove(this.map,p)))},_isRelevantForRemoval:function(h){return h.pm&&!(h instanceof L.LayerGroup)&&(!L.PM.optIn&&!h.options.pmIgnore||L.PM.optIn&&h.options.pmIgnore===!1)&&!h._pmTempLayer&&h.pm.options.allowRemoval}},gt={_globalRotateModeEnabled:!1,enableGlobalRotateMode:function(){var h=this;this._globalRotateModeEnabled=!0,L.PM.Utils.findLayers(this.map).filter(function(p){return p instanceof L.Polyline}).forEach(function(p){h._isRelevantForRotate(p)&&p.pm.enableRotate()}),this.throttledReInitRotate||(this.throttledReInitRotate=L.Util.throttle(this._reinitGlobalRotateMode,100,this)),this.map.on("layeradd",this.throttledReInitRotate,this),this.Toolbar.toggleButton("rotateMode",this.globalRotateModeEnabled()),this._fireGlobalRotateModeToggled()},disableGlobalRotateMode:function(){this._globalRotateModeEnabled=!1,L.PM.Utils.findLayers(this.map).filter(function(h){return h instanceof L.Polyline}).forEach(function(h){h.pm.disableRotate()}),this.map.off("layeradd",this.throttledReInitRotate,this),this.Toolbar.toggleButton("rotateMode",this.globalRotateModeEnabled()),this._fireGlobalRotateModeToggled()},globalRotateModeEnabled:function(){return!!this._globalRotateModeEnabled},toggleGlobalRotateMode:function(){this.globalRotateModeEnabled()?this.disableGlobalRotateMode():this.enableGlobalRotateMode()},_reinitGlobalRotateMode:function(h){var p=h.layer;this._isRelevantForRotate(p)&&this.globalRotateModeEnabled()&&(this.disableGlobalRotateMode(),this.enableGlobalRotateMode())},_isRelevantForRotate:function(h){return h.pm&&!(h instanceof L.LayerGroup)&&(!L.PM.optIn&&!h.options.pmIgnore||L.PM.optIn&&h.options.pmIgnore===!1)&&!h._pmTempLayer&&h.pm.options.allowRotation}};function Et(h,p){var _=Object.keys(h);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(h);p&&(E=E.filter(function(I){return Object.getOwnPropertyDescriptor(h,I).enumerable})),_.push.apply(_,E)}return _}function Q(h){for(var p=1;p0&&arguments[0]!==void 0?arguments[0]:"Draw",p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.__fire(this._map,"pm:drawstart",{shape:this._shape,workingLayer:this._layer},h,p)},_fireDrawEnd:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"Draw",p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.__fire(this._map,"pm:drawend",{shape:this._shape},h,p)},_fireCreate:function(h){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Draw",_=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.__fire(this._map,"pm:create",{shape:this._shape,marker:h,layer:h},p,_)},_fireCenterPlaced:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"Draw",p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},_=h==="Draw"?this._layer:void 0,E=h!=="Draw"?this._layer:void 0;this.__fire(this._layer,"pm:centerplaced",{shape:this._shape,workingLayer:_,layer:E,latlng:this._layer.getLatLng()},h,p)},_fireCut:function(h,p,_){var E=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"Draw",I=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{};this.__fire(h,"pm:cut",{shape:this._shape,layer:p,originalLayer:_},E,I)},_fireEdit:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this._layer,p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Edit",_=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.__fire(h,"pm:edit",{layer:this._layer,shape:this.getShape()},p,_)},_fireEnable:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"Edit",p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.__fire(this._layer,"pm:enable",{layer:this._layer,shape:this.getShape()},h,p)},_fireDisable:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"Edit",p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.__fire(this._layer,"pm:disable",{layer:this._layer,shape:this.getShape()},h,p)},_fireUpdate:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"Edit",p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.__fire(this._layer,"pm:update",{layer:this._layer,shape:this.getShape()},h,p)},_fireMarkerDragStart:function(h){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,_=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"Edit",E=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};this.__fire(this._layer,"pm:markerdragstart",{layer:this._layer,markerEvent:h,shape:this.getShape(),indexPath:p},_,E)},_fireMarkerDrag:function(h){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,_=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"Edit",E=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};this.__fire(this._layer,"pm:markerdrag",{layer:this._layer,markerEvent:h,shape:this.getShape(),indexPath:p},_,E)},_fireMarkerDragEnd:function(h){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,_=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,E=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"Edit",I=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{};this.__fire(this._layer,"pm:markerdragend",{layer:this._layer,markerEvent:h,shape:this.getShape(),indexPath:p,intersectionReset:_},E,I)},_fireDragStart:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"Edit",p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.__fire(this._layer,"pm:dragstart",{layer:this._layer,shape:this.getShape()},h,p)},_fireDrag:function(h){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Edit",_=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.__fire(this._layer,"pm:drag",Q(Q({},h),{},{shape:this.getShape()}),p,_)},_fireDragEnd:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"Edit",p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.__fire(this._layer,"pm:dragend",{layer:this._layer,shape:this.getShape()},h,p)},_fireDragEnable:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"Edit",p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.__fire(this._layer,"pm:dragenable",{layer:this._layer,shape:this.getShape()},h,p)},_fireDragDisable:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"Edit",p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.__fire(this._layer,"pm:dragdisable",{layer:this._layer,shape:this.getShape()},h,p)},_fireRemove:function(h){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h,_=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"Edit",E=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};this.__fire(h,"pm:remove",{layer:p,shape:this.getShape()},_,E)},_fireVertexAdded:function(h,p,_){var E=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"Edit",I=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{};this.__fire(this._layer,"pm:vertexadded",{layer:this._layer,workingLayer:this._layer,marker:h,indexPath:p,latlng:_,shape:this.getShape()},E,I)},_fireVertexRemoved:function(h,p){var _=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"Edit",E=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};this.__fire(this._layer,"pm:vertexremoved",{layer:this._layer,marker:h,indexPath:p,shape:this.getShape()},_,E)},_fireVertexClick:function(h,p){var _=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"Edit",E=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};this.__fire(this._layer,"pm:vertexclick",{layer:this._layer,markerEvent:h,indexPath:p,shape:this.getShape()},_,E)},_fireIntersect:function(h){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Edit",_=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.__fire(this._layer,"pm:intersect",{layer:this._layer,intersection:h,shape:this.getShape()},p,_)},_fireLayerReset:function(h,p){var _=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"Edit",E=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};this.__fire(this._layer,"pm:layerreset",{layer:this._layer,markerEvent:h,indexPath:p,shape:this.getShape()},_,E)},_fireChange:function(h){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Edit",_=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.__fire(this._layer,"pm:change",{layer:this._layer,latlngs:h,shape:this.getShape()},p,_)},_fireTextChange:function(h){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Edit",_=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.__fire(this._layer,"pm:textchange",{layer:this._layer,text:h,shape:this.getShape()},p,_)},_fireTextFocus:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"Edit",p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.__fire(this._layer,"pm:textfocus",{layer:this._layer,shape:this.getShape()},h,p)},_fireTextBlur:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"Edit",p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.__fire(this._layer,"pm:textblur",{layer:this._layer,shape:this.getShape()},h,p)},_fireSnapDrag:function(h,p){var _=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"Snapping",E=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};this.__fire(h,"pm:snapdrag",p,_,E)},_fireSnap:function(h,p){var _=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"Snapping",E=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};this.__fire(h,"pm:snap",p,_,E)},_fireUnsnap:function(h,p){var _=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"Snapping",E=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};this.__fire(h,"pm:unsnap",p,_,E)},_fireRotationEnable:function(h,p){var _=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"Rotation",E=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};this.__fire(h,"pm:rotateenable",{layer:this._layer,helpLayer:this._rotatePoly,shape:this.getShape()},_,E)},_fireRotationDisable:function(h){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Rotation",_=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.__fire(h,"pm:rotatedisable",{layer:this._layer,shape:this.getShape()},p,_)},_fireRotationStart:function(h,p){var _=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"Rotation",E=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};this.__fire(h,"pm:rotatestart",{layer:this._rotationLayer,helpLayer:this._layer,startAngle:this._startAngle,originLatLngs:p},_,E)},_fireRotation:function(h,p,_){var E=arguments.length>3&&arguments[3]!==void 0?arguments[3]:this._rotationLayer,I=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"Rotation",V=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};this.__fire(h,"pm:rotate",{layer:E,helpLayer:this._layer,startAngle:this._startAngle,angle:E.pm.getAngle(),angleDiff:p,oldLatLngs:_,newLatLngs:E.getLatLngs()},I,V)},_fireRotationEnd:function(h,p,_){var E=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"Rotation",I=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{};this.__fire(h,"pm:rotateend",{layer:this._rotationLayer,helpLayer:this._layer,startAngle:p,angle:this._rotationLayer.pm.getAngle(),originLatLngs:_,newLatLngs:this._rotationLayer.getLatLngs()},E,I)},_fireActionClick:function(h,p,_){var E=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"Toolbar",I=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{};this.__fire(this._map,"pm:actionclick",{text:h.text,action:h,btnName:p,button:_},E,I)},_fireButtonClick:function(h,p){var _=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"Toolbar",E=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};this.__fire(this._map,"pm:buttonclick",{btnName:h,button:p},_,E)},_fireLangChange:function(h,p,_,E){var I=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"Global",V=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};this.__fire(this.map,"pm:langchange",{oldLang:h,activeLang:p,fallback:_,translations:E},I,V)},_fireGlobalDragModeToggled:function(h){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Global",_=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.__fire(this.map,"pm:globaldragmodetoggled",{enabled:h,map:this.map},p,_)},_fireGlobalEditModeToggled:function(h){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Global",_=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.__fire(this.map,"pm:globaleditmodetoggled",{enabled:h,map:this.map},p,_)},_fireGlobalRemovalModeToggled:function(h){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Global",_=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.__fire(this.map,"pm:globalremovalmodetoggled",{enabled:h,map:this.map},p,_)},_fireGlobalCutModeToggled:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"Global",p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.__fire(this._map,"pm:globalcutmodetoggled",{enabled:!!this._enabled,map:this._map},h,p)},_fireGlobalDrawModeToggled:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"Global",p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.__fire(this._map,"pm:globaldrawmodetoggled",{enabled:this._enabled,shape:this._shape,map:this._map},h,p)},_fireGlobalRotateModeToggled:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"Global",p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.__fire(this.map,"pm:globalrotatemodetoggled",{enabled:this.globalRotateModeEnabled(),map:this.map},h,p)},_fireRemoveLayerGroup:function(h){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h,_=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"Edit",E=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};this.__fire(h,"pm:remove",{layer:p,shape:void 0},_,E)},_fireKeyeventEvent:function(h,p,_){var E=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"Global",I=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{};this.__fire(this.map,"pm:keyevent",{event:h,eventType:p,focusOn:_},E,I)},__fire:function(h,p,_,E){var I=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{};_=m()(_,I,{source:E}),L.PM.Utils._fireEvent(h,p,_)}};let bt=ct,Mt={_lastEvents:{keydown:void 0,keyup:void 0,current:void 0},_initKeyListener:function(h){this.map=h,L.DomEvent.on(document,"keydown keyup",this._onKeyListener,this),L.DomEvent.on(window,"blur",this._onBlur,this)},_onKeyListener:function(h){var p="document";this.map.getContainer().contains(h.target)&&(p="map");var _={event:h,eventType:h.type,focusOn:p};this._lastEvents[h.type]=_,this._lastEvents.current=_,this.map.pm._fireKeyeventEvent(h,h.type,p)},_onBlur:function(h){h.altKey=!1;var p={event:h,eventType:h.type,focusOn:"document"};this._lastEvents[h.type]=p,this._lastEvents.current=p},getLastKeyEvent:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"current";return this._lastEvents[h]},isShiftKeyPressed:function(){var h;return(h=this._lastEvents.current)===null||h===void 0?void 0:h.event.shiftKey},isAltKeyPressed:function(){var h;return(h=this._lastEvents.current)===null||h===void 0?void 0:h.event.altKey},isCtrlKeyPressed:function(){var h;return(h=this._lastEvents.current)===null||h===void 0?void 0:h.event.ctrlKey},isMetaKeyPressed:function(){var h;return(h=this._lastEvents.current)===null||h===void 0?void 0:h.event.metaKey},getPressedKey:function(){var h;return(h=this._lastEvents.current)===null||h===void 0?void 0:h.event.key}};var Xt=c(7361),ft=c.n(Xt),Ct=c(8721),st=c.n(Ct);function Rt(h){var p=L.PM.activeLang;return st()(A,p)||(p="en"),ft()(A[p],h)}function Ot(h){for(var p=0;p1e-12;)E=Math.cos(2*Ie+ki),Gi=ki,ki=Pt/(it*no)+lr*(I=Math.sin(ki))*(E+lr/4*((V=Math.cos(ki))*(2*E*E-1)-lr/6*E*(4*I*I-3)*(4*E*E-3)));var Po=Tn*I-Rn*V*te,Zn=Math.atan2(Tn*V+Rn*I*te,(1-rt)*Math.sqrt(Ar*Ar+Po*Po)),Yt=rt/16*Si*(4+rt*(4-3*Si)),ua=ot+180*(Math.atan2(I*Gt,Rn*V-Tn*I*te)-(1-Yt)*rt*Ar*(ki+Yt*I*(E+Yt*V*(2*E*E-1))))/yt,ts=180*Zn/yt;return L.latLng(ua,ts)}function ce(h,p,_,E){for(var I,V,nt=!(arguments.length>4&&arguments[4]!==void 0)||arguments[4],it=[],rt=0;rt<_;rt+=1){if(nt)I=Tt(h,360*rt/_+E,p),V=L.latLng(I.lng,I.lat);else{var ot=h.lat+Math.cos(2*rt*Math.PI/_)*p,dt=h.lng+Math.sin(2*rt*Math.PI/_)*p;V=L.latLng(ot,dt)}it.push(V)}return it}function Re(h,p,_,E){var I=function(V,nt,it){var rt=V.latLngToContainerPoint(nt),ot=V.latLngToContainerPoint(it),dt=180*Math.atan2(ot.y-rt.y,ot.x-rt.x)/Math.PI+90;return dt+(dt<0?360:0)}(h,p,_);return function(V,nt,it){nt=(nt+360)%360;var rt=Math.PI/180,ot=180/Math.PI,dt=6378137,Pt=V.lng*rt,yt=V.lat*rt,At=nt*rt,Gt=Math.sin(yt),te=Math.cos(yt),Dt=Math.cos(it/dt),Rn=Math.sin(it/dt),Tn=Math.asin(Gt*Dt+te*Rn*Math.cos(At)),Ie=Pt+Math.atan2(Math.sin(At)*Rn*te,Dt-Gt*Math.sin(Tn));return Ie=(Ie*=ot)>180?Ie-360:Ie<-180?Ie+360:Ie,L.latLng([Tn*ot,Ie])}(p,I,E)}function Cn(h,p){var _=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"asc";if(!p||Object.keys(p).length===0)return function(rt,ot){return rt-ot};for(var E,I=Object.keys(p),V=I.length-1,nt={};V>=0;)E=I[V],nt[E.toLowerCase()]=p[E],V-=1;function it(rt){return rt instanceof L.Marker?"Marker":rt instanceof L.Circle?"Circle":rt instanceof L.CircleMarker?"CircleMarker":rt instanceof L.Rectangle?"Rectangle":rt instanceof L.Polygon?"Polygon":rt instanceof L.Polyline?"Line":void 0}return function(rt,ot){var dt,Pt;if(h==="instanceofShape"){if(dt=it(rt.layer).toLowerCase(),Pt=it(ot.layer).toLowerCase(),!dt||!Pt)return 0}else{if(!rt.hasOwnProperty(h)||!ot.hasOwnProperty(h))return 0;dt=rt[h].toLowerCase(),Pt=ot[h].toLowerCase()}var yt=dt in nt?nt[dt]:Number.MAX_SAFE_INTEGER,At=Pt in nt?nt[Pt]:Number.MAX_SAFE_INTEGER,Gt=0;return ytAt&&(Gt=1),_==="desc"?-1*Gt:Gt}}function fe(h){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h.getLatLngs();return h instanceof L.Polygon?L.polygon(p).getLatLngs():L.polyline(p).getLatLngs()}function ke(h,p){var _,E;if((_=p.options.crs)!==null&&_!==void 0&&(E=_.projection)!==null&&E!==void 0&&E.MAX_LATITUDE){var I,V,nt=(I=p.options.crs)===null||I===void 0||(V=I.projection)===null||V===void 0?void 0:V.MAX_LATITUDE;h.lat=Math.max(Math.min(nt,h.lat),-nt)}return h}function Bt(h){return h.options.renderer||h._map&&(h._map._getPaneRenderer(h.options.pane)||h._map.options.renderer||h._map._renderer)||h._renderer}let hn=L.Class.extend({includes:[et,X,lt,gt,bt],initialize:function(h){this.map=h,this.Draw=new L.PM.Draw(h),this.Toolbar=new L.PM.Toolbar(h),this.Keyboard=Mt,this.globalOptions={snappable:!0,layerGroup:void 0,snappingOrder:["Marker","CircleMarker","Circle","Line","Polygon","Rectangle"],panes:{vertexPane:"markerPane",layerPane:"overlayPane",markerPane:"markerPane"},draggable:!0},this.Keyboard._initKeyListener(h)},setLang:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"en",p=arguments.length>1?arguments[1]:void 0,_=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"en",E=L.PM.activeLang;p&&(A[h]=m()(A[_],p)),L.PM.activeLang=h,this.map.pm.Toolbar.reinit(),this._fireLangChange(E,h,_,A[h])},addControls:function(h){this.Toolbar.addControls(h)},removeControls:function(){this.Toolbar.removeControls()},toggleControls:function(){this.Toolbar.toggleControls()},controlsVisible:function(){return this.Toolbar.isVisible},enableDraw:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"Polygon",p=arguments.length>1?arguments[1]:void 0;h==="Poly"&&(h="Polygon"),this.Draw.enable(h,p)},disableDraw:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"Polygon";h==="Poly"&&(h="Polygon"),this.Draw.disable(h)},setPathOptions:function(h){var p=this,_=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},E=_.ignoreShapes||[],I=_.merge||!1;this.map.pm.Draw.shapes.forEach(function(V){E.indexOf(V)===-1&&p.map.pm.Draw[V].setPathOptions(h,I)})},getGlobalOptions:function(){return this.globalOptions},setGlobalOptions:function(h){var p=this,_=m()(this.globalOptions,h),E=!1;this.map.pm.Draw.CircleMarker.enabled()&&!!this.map.pm.Draw.CircleMarker.options.editable!=!!_.editable&&(this.map.pm.Draw.CircleMarker.disable(),E=!0),this.map.pm.Draw.shapes.forEach(function(I){p.map.pm.Draw[I].setOptions(_)}),E&&this.map.pm.Draw.CircleMarker.enable(),L.PM.Utils.findLayers(this.map).forEach(function(I){I.pm.setOptions(_)}),this.map.fire("pm:globaloptionschanged"),this.globalOptions=_,this.applyGlobalOptions()},applyGlobalOptions:function(){L.PM.Utils.findLayers(this.map).forEach(function(h){h.pm.enabled()&&h.pm.applyOptions()})},globalDrawModeEnabled:function(){return!!this.Draw.getActiveShape()},globalCutModeEnabled:function(){return!!this.Draw.Cut.enabled()},enableGlobalCutMode:function(h){return this.Draw.Cut.enable(h)},toggleGlobalCutMode:function(h){return this.Draw.Cut.toggle(h)},disableGlobalCutMode:function(){return this.Draw.Cut.disable()},getGeomanLayers:function(){var h=arguments.length>0&&arguments[0]!==void 0&&arguments[0],p=L.PM.Utils.findLayers(this.map);if(!h)return p;var _=L.featureGroup();return _._pmTempLayer=!0,p.forEach(function(E){_.addLayer(E)}),_},getGeomanDrawLayers:function(){var h=arguments.length>0&&arguments[0]!==void 0&&arguments[0],p=L.PM.Utils.findLayers(this.map).filter(function(E){return E._drawnByGeoman===!0});if(!h)return p;var _=L.featureGroup();return _._pmTempLayer=!0,p.forEach(function(E){_.addLayer(E)}),_},_getContainingLayer:function(){return this.globalOptions.layerGroup&&this.globalOptions.layerGroup instanceof L.LayerGroup?this.globalOptions.layerGroup:this.map},_isCRSSimple:function(){return this.map.options.crs===L.CRS.Simple},_touchEventCounter:0,_addTouchEvents:function(h){this._touchEventCounter===0&&(L.DomEvent.on(h,"touchmove",this._canvasTouchMove,this),L.DomEvent.on(h,"touchstart touchend touchcancel",this._canvasTouchClick,this)),this._touchEventCounter+=1},_removeTouchEvents:function(h){this._touchEventCounter===1&&(L.DomEvent.off(h,"touchmove",this._canvasTouchMove,this),L.DomEvent.off(h,"touchstart touchend touchcancel",this._canvasTouchClick,this)),this._touchEventCounter=this._touchEventCounter<=1?0:this._touchEventCounter-1},_canvasTouchMove:function(h){Bt(this.map)._onMouseMove(this._createMouseEvent("mousemove",h))},_canvasTouchClick:function(h){var p="";h.type==="touchstart"||h.type==="pointerdown"?p="mousedown":h.type==="touchend"||h.type==="pointerup"?p="mouseup":h.type!=="touchcancel"&&h.type!=="pointercancel"||(p="mouseup"),p&&Bt(this.map)._onClick(this._createMouseEvent(p,h))},_createMouseEvent:function(h,p){var _,E=p.touches[0]||p.changedTouches[0];try{_=new MouseEvent(h,{bubbles:p.bubbles,cancelable:p.cancelable,view:p.view,detail:E.detail,screenX:E.screenX,screenY:E.screenY,clientX:E.clientX,clientY:E.clientY,ctrlKey:p.ctrlKey,altKey:p.altKey,shiftKey:p.shiftKey,metaKey:p.metaKey,button:p.button,relatedTarget:p.relatedTarget})}catch{(_=document.createEvent("MouseEvents")).initMouseEvent(h,p.bubbles,p.cancelable,p.view,E.detail,E.screenX,E.screenY,E.clientX,E.clientY,p.ctrlKey,p.altKey,p.shiftKey,p.metaKey,p.button,p.relatedTarget)}return _}}),Sn=L.Control.extend({includes:[bt],options:{position:"topleft",disableByOtherButtons:!0},initialize:function(h){this._button=L.Util.extend({},this.options,h)},onAdd:function(h){return this._map=h,this._map.pm.Toolbar.options.oneBlock?this._container=this._map.pm.Toolbar._createContainer(this.options.position):this._button.tool==="edit"?this._container=this._map.pm.Toolbar.editContainer:this._button.tool==="options"?this._container=this._map.pm.Toolbar.optionsContainer:this._button.tool==="custom"?this._container=this._map.pm.Toolbar.customContainer:this._container=this._map.pm.Toolbar.drawContainer,this.buttonsDomNode=this._makeButton(this._button),this._container.appendChild(this.buttonsDomNode),this._container},onRemove:function(){return this.buttonsDomNode.remove(),this._container},getText:function(){return this._button.text},getIconUrl:function(){return this._button.iconUrl},destroy:function(){this._button={},this._update()},toggle:function(h){return this._button.toggleStatus=typeof h=="boolean"?h:!this._button.toggleStatus,this._applyStyleClasses(),this._button.toggleStatus},toggled:function(){return this._button.toggleStatus},onCreate:function(){this.toggle(!1)},disable:function(){this.toggle(!1),this._button.disabled=!0,this._updateDisabled()},enable:function(){this._button.disabled=!1,this._updateDisabled()},_triggerClick:function(h){h&&h.preventDefault(),this._button.disabled||(this._button.onClick(h,{button:this,event:h}),this._clicked(h),this._button.afterClick(h,{button:this,event:h}))},_makeButton:function(h){var p=this,_=this.options.position.indexOf("right")>-1?"pos-right":"",E=L.DomUtil.create("div","button-container ".concat(_),this._container);h.title&&E.setAttribute("title",h.title);var I=L.DomUtil.create("a","leaflet-buttons-control-button",E);I.setAttribute("role","button"),I.setAttribute("tabindex","0"),I.href="#";var V=L.DomUtil.create("div","leaflet-pm-actions-container ".concat(_),E),nt=h.actions,it={cancel:{text:Rt("actions.cancel"),onClick:function(){this._triggerClick()}},finishMode:{text:Rt("actions.finish"),onClick:function(){this._triggerClick()}},removeLastVertex:{text:Rt("actions.removeLastVertex"),onClick:function(){this._map.pm.Draw[h.jsClass]._removeLastVertex()}},finish:{text:Rt("actions.finish"),onClick:function(ot){this._map.pm.Draw[h.jsClass]._finishShape(ot)}}};nt.forEach(function(ot){var dt,Pt=typeof ot=="string"?ot:ot.name;if(it[Pt])dt=it[Pt];else{if(!ot.text)return;dt=ot}var yt=L.DomUtil.create("a","leaflet-pm-action ".concat(_," action-").concat(Pt),V);yt.setAttribute("role","button"),yt.setAttribute("tabindex","0"),yt.href="#",yt.innerHTML=dt.text,L.DomEvent.disableClickPropagation(yt),L.DomEvent.on(yt,"click",L.DomEvent.stop),!h.disabled&&dt.onClick&&(L.DomEvent.addListener(yt,"click",function(At){At.preventDefault();var Gt="",te=p._map.pm.Toolbar.buttons;for(var Dt in te)if(te[Dt]._button===h){Gt=Dt;break}p._fireActionClick(dt,Gt,h)},p),L.DomEvent.addListener(yt,"click",dt.onClick,p))}),h.toggleStatus&&L.DomUtil.addClass(E,"active");var rt=L.DomUtil.create("div","control-icon",I);return h.iconUrl&&rt.setAttribute("src",h.iconUrl),h.className&&L.DomUtil.addClass(rt,h.className),L.DomEvent.disableClickPropagation(I),L.DomEvent.on(I,"click",L.DomEvent.stop),h.disabled||(L.DomEvent.addListener(I,"click",this._onBtnClick,this),L.DomEvent.addListener(I,"click",this._triggerClick,this)),h.disabled&&(L.DomUtil.addClass(I,"pm-disabled"),I.setAttribute("aria-disabled","true")),E},_applyStyleClasses:function(){this._container&&(this._button.toggleStatus&&this._button.cssToggle!==!1?(L.DomUtil.addClass(this.buttonsDomNode,"active"),L.DomUtil.addClass(this._container,"activeChild")):(L.DomUtil.removeClass(this.buttonsDomNode,"active"),L.DomUtil.removeClass(this._container,"activeChild")))},_onBtnClick:function(){this._button.disableOtherButtons&&this._map.pm.Toolbar.triggerClickOnToggledButtons(this);var h="",p=this._map.pm.Toolbar.buttons;for(var _ in p)if(p[_]._button===this._button){h=_;break}this._fireButtonClick(h,this._button)},_clicked:function(){this._button.doToggle&&this.toggle()},_updateDisabled:function(){if(this._container){var h="pm-disabled",p=this.buttonsDomNode.children[0];this._button.disabled?(L.DomUtil.addClass(p,h),p.setAttribute("aria-disabled","true"),L.DomEvent.off(p,"click",this._triggerClick,this),L.DomEvent.off(p,"click",this._onBtnClick,this)):(L.DomUtil.removeClass(p,h),p.setAttribute("aria-disabled","false"),L.DomEvent.on(p,"click",this._triggerClick,this),L.DomEvent.on(p,"click",this._onBtnClick,this))}}});function Hn(h,p){var _=Object.keys(h);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(h);p&&(E=E.filter(function(I){return Object.getOwnPropertyDescriptor(h,I).enumerable})),_.push.apply(_,E)}return _}function Me(h){for(var p=1;p0&&arguments[0]!==void 0?arguments[0]:this.options;typeof h.editPolygon<"u"&&(h.editMode=h.editPolygon),typeof h.deleteLayer<"u"&&(h.removalMode=h.deleteLayer),L.Util.setOptions(this,h),this.applyIconStyle(),this.isVisible=!0,this._showHideButtons()},applyIconStyle:function(){var h=this.getButtons(),p={geomanIcons:{drawMarker:"control-icon leaflet-pm-icon-marker",drawPolyline:"control-icon leaflet-pm-icon-polyline",drawRectangle:"control-icon leaflet-pm-icon-rectangle",drawPolygon:"control-icon leaflet-pm-icon-polygon",drawCircle:"control-icon leaflet-pm-icon-circle",drawCircleMarker:"control-icon leaflet-pm-icon-circle-marker",editMode:"control-icon leaflet-pm-icon-edit",dragMode:"control-icon leaflet-pm-icon-drag",cutPolygon:"control-icon leaflet-pm-icon-cut",removalMode:"control-icon leaflet-pm-icon-delete",drawText:"control-icon leaflet-pm-icon-text"}};for(var _ in h){var E=h[_];L.Util.setOptions(E,{className:p.geomanIcons[_]})}},removeControls:function(){var h=this.getButtons();for(var p in h)h[p].remove();this.isVisible=!1},toggleControls:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options;this.isVisible?this.removeControls():this.addControls(h)},_addButton:function(h,p){return this.buttons[h]=p,this.options[h]=this.options[h]||!1,this.buttons[h]},triggerClickOnToggledButtons:function(h){for(var p in this.buttons){var _=this.buttons[p];_._button.disableByOtherButtons&&_!==h&&_.toggled()&&_._triggerClick()}},toggleButton:function(h,p){var _=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];return h==="editPolygon"&&(h="editMode"),h==="deleteLayer"&&(h="removalMode"),_&&this.triggerClickOnToggledButtons(this.buttons[h]),!!this.buttons[h]&&this.buttons[h].toggle(p)},_defineButtons:function(){var h=this,p={className:"control-icon leaflet-pm-icon-marker",title:Rt("buttonTitles.drawMarkerButton"),jsClass:"Marker",onClick:function(){},afterClick:function(At,Gt){h.map.pm.Draw[Gt.button._button.jsClass].toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["cancel"]},_={title:Rt("buttonTitles.drawPolyButton"),className:"control-icon leaflet-pm-icon-polygon",jsClass:"Polygon",onClick:function(){},afterClick:function(At,Gt){h.map.pm.Draw[Gt.button._button.jsClass].toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["finish","removeLastVertex","cancel"]},E={className:"control-icon leaflet-pm-icon-polyline",title:Rt("buttonTitles.drawLineButton"),jsClass:"Line",onClick:function(){},afterClick:function(At,Gt){h.map.pm.Draw[Gt.button._button.jsClass].toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["finish","removeLastVertex","cancel"]},I={title:Rt("buttonTitles.drawCircleButton"),className:"control-icon leaflet-pm-icon-circle",jsClass:"Circle",onClick:function(){},afterClick:function(At,Gt){h.map.pm.Draw[Gt.button._button.jsClass].toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["cancel"]},V={title:Rt("buttonTitles.drawCircleMarkerButton"),className:"control-icon leaflet-pm-icon-circle-marker",jsClass:"CircleMarker",onClick:function(){},afterClick:function(At,Gt){h.map.pm.Draw[Gt.button._button.jsClass].toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["cancel"]},nt={title:Rt("buttonTitles.drawRectButton"),className:"control-icon leaflet-pm-icon-rectangle",jsClass:"Rectangle",onClick:function(){},afterClick:function(At,Gt){h.map.pm.Draw[Gt.button._button.jsClass].toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["cancel"]},it={title:Rt("buttonTitles.editButton"),className:"control-icon leaflet-pm-icon-edit",onClick:function(){},afterClick:function(){h.map.pm.toggleGlobalEditMode()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,tool:"edit",actions:["finishMode"]},rt={title:Rt("buttonTitles.dragButton"),className:"control-icon leaflet-pm-icon-drag",onClick:function(){},afterClick:function(){h.map.pm.toggleGlobalDragMode()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,tool:"edit",actions:["finishMode"]},ot={title:Rt("buttonTitles.cutButton"),className:"control-icon leaflet-pm-icon-cut",jsClass:"Cut",onClick:function(){},afterClick:function(At,Gt){h.map.pm.Draw[Gt.button._button.jsClass].toggle({snappable:!0,cursorMarker:!0,allowSelfIntersection:!1})},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,tool:"edit",actions:["finish","removeLastVertex","cancel"]},dt={title:Rt("buttonTitles.deleteButton"),className:"control-icon leaflet-pm-icon-delete",onClick:function(){},afterClick:function(){h.map.pm.toggleGlobalRemovalMode()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,tool:"edit",actions:["finishMode"]},Pt={title:Rt("buttonTitles.rotateButton"),className:"control-icon leaflet-pm-icon-rotate",onClick:function(){},afterClick:function(){h.map.pm.toggleGlobalRotateMode()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,tool:"edit",actions:["finishMode"]},yt={className:"control-icon leaflet-pm-icon-text",title:Rt("buttonTitles.drawTextButton"),jsClass:"Text",onClick:function(){},afterClick:function(At,Gt){h.map.pm.Draw[Gt.button._button.jsClass].toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["cancel"]};this._addButton("drawMarker",new L.Control.PMButton(p)),this._addButton("drawPolyline",new L.Control.PMButton(E)),this._addButton("drawRectangle",new L.Control.PMButton(nt)),this._addButton("drawPolygon",new L.Control.PMButton(_)),this._addButton("drawCircle",new L.Control.PMButton(I)),this._addButton("drawCircleMarker",new L.Control.PMButton(V)),this._addButton("drawText",new L.Control.PMButton(yt)),this._addButton("editMode",new L.Control.PMButton(it)),this._addButton("dragMode",new L.Control.PMButton(rt)),this._addButton("cutPolygon",new L.Control.PMButton(ot)),this._addButton("removalMode",new L.Control.PMButton(dt)),this._addButton("rotateMode",new L.Control.PMButton(Pt))},_showHideButtons:function(){if(this.isVisible){this.removeControls(),this.isVisible=!0;var h=this.getButtons(),p=[];for(var _ in this.options.drawControls===!1&&(p=p.concat(Object.keys(h).filter(function(I){return!h[I]._button.tool}))),this.options.editControls===!1&&(p=p.concat(Object.keys(h).filter(function(I){return h[I]._button.tool==="edit"}))),this.options.optionsControls===!1&&(p=p.concat(Object.keys(h).filter(function(I){return h[I]._button.tool==="options"}))),this.options.customControls===!1&&(p=p.concat(Object.keys(h).filter(function(I){return h[I]._button.tool==="custom"}))),h)if(this.options[_]&&p.indexOf(_)===-1){var E=h[_]._button.tool;E||(E="draw"),h[_].setPosition(this._getBtnPosition(E)),h[_].addTo(this.map)}}},_getBtnPosition:function(h){return this.options.positions&&this.options.positions[h]?this.options.positions[h]:this.options.position},setBlockPosition:function(h,p){this.options.positions[h]=p,this._showHideButtons(),this.changeControlOrder()},getBlockPositions:function(){return this.options.positions},copyDrawControl:function(h,p){if(!p)throw new TypeError("Button has no name");Ht(p)!=="object"&&(p={name:p});var _=this._btnNameMapping(h);if(!p.name)throw new TypeError("Button has no name");if(this.buttons[p.name])throw new TypeError("Button with this name already exists");var E=this.map.pm.Draw.createNewDrawInstance(p.name,_);return p=Me(Me({},this.buttons[_]._button),p),{drawInstance:E,control:this.createCustomControl(p)}},createCustomControl:function(h){var p,_;if(!h.name)throw new TypeError("Button has no name");if(this.buttons[h.name])throw new TypeError("Button with this name already exists");h.onClick||(h.onClick=function(){}),h.afterClick||(h.afterClick=function(){}),h.toggle!==!1&&(h.toggle=!0),h.block&&(h.block=h.block.toLowerCase()),h.block&&h.block!=="draw"||(h.block=""),h.className?h.className.indexOf("control-icon")===-1&&(h.className="control-icon ".concat(h.className)):h.className="control-icon";var E={tool:h.block,className:h.className,title:h.title||"",jsClass:h.name,onClick:h.onClick,afterClick:h.afterClick,doToggle:h.toggle,toggleStatus:!1,disableOtherButtons:(p=h.disableOtherButtons)===null||p===void 0||p,disableByOtherButtons:(_=h.disableByOtherButtons)===null||_===void 0||_,cssToggle:h.toggle,position:this.options.position,actions:h.actions||[],disabled:!!h.disabled};this.options[h.name]!==!1&&(this.options[h.name]=!0);var I=this._addButton(h.name,new L.Control.PMButton(E));return this.changeControlOrder(),I},changeControlOrder:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],p=this._shapeMapping(),_=[];h.forEach(function(ot){p[ot]?_.push(p[ot]):_.push(ot)});var E=this.getButtons(),I={};_.forEach(function(ot){E[ot]&&(I[ot]=E[ot])});var V=Object.keys(E).filter(function(ot){return!E[ot]._button.tool});V.forEach(function(ot){_.indexOf(ot)===-1&&(I[ot]=E[ot])});var nt=Object.keys(E).filter(function(ot){return E[ot]._button.tool==="edit"});nt.forEach(function(ot){_.indexOf(ot)===-1&&(I[ot]=E[ot])});var it=Object.keys(E).filter(function(ot){return E[ot]._button.tool==="options"});it.forEach(function(ot){_.indexOf(ot)===-1&&(I[ot]=E[ot])});var rt=Object.keys(E).filter(function(ot){return E[ot]._button.tool==="custom"});rt.forEach(function(ot){_.indexOf(ot)===-1&&(I[ot]=E[ot])}),Object.keys(E).forEach(function(ot){_.indexOf(ot)===-1&&(I[ot]=E[ot])}),this.map.pm.Toolbar.buttons=I,this._showHideButtons()},getControlOrder:function(){var h=this.getButtons(),p=[];for(var _ in h)p.push(_);return p},changeActionsOfControl:function(h,p){var _=this._btnNameMapping(h);if(!_)throw new TypeError("No name passed");if(!p)throw new TypeError("No actions passed");if(!this.buttons[_])throw new TypeError("Button with this name not exists");this.buttons[_]._button.actions=p,this.changeControlOrder()},setButtonDisabled:function(h,p){var _=this._btnNameMapping(h);p?this.buttons[_].disable():this.buttons[_].enable()},_shapeMapping:function(){return{Marker:"drawMarker",Circle:"drawCircle",Polygon:"drawPolygon",Rectangle:"drawRectangle",Polyline:"drawPolyline",Line:"drawPolyline",CircleMarker:"drawCircleMarker",Edit:"editMode",Drag:"dragMode",Cut:"cutPolygon",Removal:"removalMode",Rotate:"rotateMode",Text:"drawText"}},_btnNameMapping:function(h){var p=this._shapeMapping();return p[h]?p[h]:h}});function Y(h,p){var _=Object.keys(h);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(h);p&&(E=E.filter(function(I){return Object.getOwnPropertyDescriptor(h,I).enumerable})),_.push.apply(_,E)}return _}function C(h){for(var p=1;p2&&arguments[2]!==void 0?arguments[2]:1,I=[],V={};p.forEach(function(it,rt){if(!it._parentCopy||it._parentCopy!==_._layer){var ot=_._calcLayerDistances(h,it);if(ot.distance=Math.floor(ot.distance),_.debugIndicatorLines){if(!_.debugIndicatorLines[rt]){var dt=L.polyline([],{color:"red",pmIgnore:!0});dt._pmTempLayer=!0,_.debugIndicatorLines[rt]=dt}_.debugIndicatorLines[rt].setLatLngs([h,ot.latlng])}E===1&&(V.distance===void 0||ot.distance<=V.distance)?(ot.distance3&&arguments[3]!==void 0&&arguments[3],rt=function dt(Pt){Pt.forEach(function(yt,At){if(Array.isArray(yt))dt(yt);else if(nt.options.snapSegment){var Gt,te=yt;Gt=it?At+1===Pt.length?0:At+1:At+1===Pt.length?void 0:At+1;var Dt=Pt[Gt];if(Dt){var Rn=nt._getDistanceToSegment(_,h,te,Dt);(I===void 0||Rn1&&arguments[1]!==void 0?arguments[1]:1;h=h.sort(function(nt,it){return nt._leaflet_id-it._leaflet_id});var _=["Marker","CircleMarker","Circle","Line","Polygon","Rectangle"],E=this._map.pm.globalOptions.snappingOrder||[],I=0,V={};return E.concat(_).forEach(function(nt){V[nt]||(I+=1,V[nt]=I)}),h.sort(Cn("instanceofShape",V)),p===1?h[0]||{}:h.slice(0,p)},_checkPrioritiySnapping:function(h){var p=this._map,_=h.segment[0],E=h.segment[1],I=h.latlng,V=this._getDistance(p,_,I),nt=this._getDistance(p,E,I),it=V1&&arguments[1]!==void 0&&arguments[1];this.options.pathOptions=p?m()(this.options.pathOptions,h):h},getShapes:function(){return this.shapes},getShape:function(){return this._shape},enable:function(h,p){if(!h)throw new Error("Error: Please pass a shape as a parameter. Possible shapes are: ".concat(this.getShapes().join(",")));this.disable(),this[h].enable(p)},disable:function(){var h=this;this.shapes.forEach(function(p){h[p].disable()})},addControls:function(){var h=this;this.shapes.forEach(function(p){h[p].addButton()})},getActiveShape:function(){var h,p=this;return this.shapes.forEach(function(_){p[_]._enabled&&(h=_)}),h},_setGlobalDrawMode:function(){this._shape==="Cut"?this._fireGlobalCutModeToggled():this._fireGlobalDrawModeToggled();var h=L.PM.Utils.findLayers(this._map);this._enabled?h.forEach(function(p){L.PM.Utils.disablePopup(p)}):h.forEach(function(p){L.PM.Utils.enablePopup(p)})},createNewDrawInstance:function(h,p){var _=this._getShapeFromBtnName(p);if(this[h])throw new TypeError("Draw Type already exists");if(!L.PM.Draw[_])throw new TypeError("There is no class L.PM.Draw.".concat(_));return this[h]=new L.PM.Draw[_](this._map),this[h].toolbarButtonName=h,this[h]._shape=h,this.shapes.push(h),this[p]&&this[h].setOptions(this[p].options),this[h].setOptions(this[h].options),this[h]},_getShapeFromBtnName:function(h){var p={drawMarker:"Marker",drawCircle:"Circle",drawPolygon:"Polygon",drawPolyline:"Line",drawRectangle:"Rectangle",drawCircleMarker:"CircleMarker",editMode:"Edit",dragMode:"Drag",cutPolygon:"Cut",removalMode:"Removal",rotateMode:"Rotate",drawText:"Text"};return p[h]?p[h]:this[h]?this[h]._shape:h},_finishLayer:function(h){h.pm&&(h.pm.setOptions(this.options),h.pm._shape=this._shape,h.pm._map=this._map),this._addDrawnLayerProp(h)},_addDrawnLayerProp:function(h){h._drawnByGeoman=!0},_setPane:function(h,p){p==="layerPane"?h.options.pane=this._map.pm.globalOptions.panes&&this._map.pm.globalOptions.panes.layerPane||"overlayPane":p==="vertexPane"?h.options.pane=this._map.pm.globalOptions.panes&&this._map.pm.globalOptions.panes.vertexPane||"markerPane":p==="markerPane"&&(h.options.pane=this._map.pm.globalOptions.panes&&this._map.pm.globalOptions.panes.markerPane||"markerPane")},_isFirstLayer:function(){return(this._map||this._layer._map).pm.getGeomanLayers().length===0}});Z.Marker=Z.extend({initialize:function(h){this._map=h,this._shape="Marker",this.toolbarButtonName="drawMarker"},enable:function(h){var p=this;L.Util.setOptions(this,h),this._enabled=!0,this._map.on("click",this._createMarker,this),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!0),this._hintMarker=L.marker(this._map.getCenter(),this.options.markerStyle),this._setPane(this._hintMarker,"markerPane"),this._hintMarker._pmTempLayer=!0,this._hintMarker.addTo(this._map),this.options.tooltips&&this._hintMarker.bindTooltip(Rt("tooltips.placeMarker"),{permanent:!0,offset:L.point(0,10),direction:"bottom",opacity:.8}).openTooltip(),this._layer=this._hintMarker,this._map.on("mousemove",this._syncHintMarker,this),this.options.markerEditable&&this._map.eachLayer(function(_){p.isRelevantMarker(_)&&_.pm.enable()}),this._fireDrawStart(),this._setGlobalDrawMode()},disable:function(){var h=this;this._enabled&&(this._enabled=!1,this._map.off("click",this._createMarker,this),this._hintMarker.remove(),this._map.off("mousemove",this._syncHintMarker,this),this._map.eachLayer(function(p){h.isRelevantMarker(p)&&p.pm.disable()}),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!1),this.options.snappable&&this._cleanupSnapping(),this._fireDrawEnd(),this._setGlobalDrawMode())},enabled:function(){return this._enabled},toggle:function(h){this.enabled()?this.disable():this.enable(h)},isRelevantMarker:function(h){return h instanceof L.Marker&&h.pm&&!h._pmTempLayer&&!h.pm._initTextMarker},_syncHintMarker:function(h){if(this._hintMarker.setLatLng(h.latlng),this.options.snappable){var p=h;p.target=this._hintMarker,this._handleSnapping(p)}this._fireChange(this._hintMarker.getLatLng(),"Draw")},_createMarker:function(h){if(h.latlng&&(!this.options.requireSnapToFinish||this._hintMarker._snapped||this._isFirstLayer())){this._hintMarker._snapped||this._hintMarker.setLatLng(h.latlng);var p=this._hintMarker.getLatLng(),_=new L.Marker(p,this.options.markerStyle);this._setPane(_,"markerPane"),this._finishLayer(_),_.pm||(_.options.draggable=!1),_.addTo(this._map.pm._getContainingLayer()),_.pm&&this.options.markerEditable?_.pm.enable():_.dragging&&_.dragging.disable(),this._fireCreate(_),this._cleanupSnapping(),this.options.continueDrawing||this.disable()}},setStyle:function(){var h,p;(h=this.options.markerStyle)!==null&&h!==void 0&&h.icon&&((p=this._hintMarker)===null||p===void 0||p.setIcon(this.options.markerStyle.icon))}});var J=63710088e-1,tt={centimeters:637100880,centimetres:637100880,degrees:57.22891354143274,feet:20902260511392e-6,inches:39.37*J,kilometers:6371.0088,kilometres:6371.0088,meters:J,metres:J,miles:3958.761333810546,millimeters:6371008800,millimetres:6371008800,nauticalmiles:J/1852,radians:1,yards:6967335223679999e-9};function pt(h,p,_){_===void 0&&(_={});var E={type:"Feature"};return(_.id===0||_.id)&&(E.id=_.id),_.bbox&&(E.bbox=_.bbox),E.properties=p||{},E.geometry=h,E}function Lt(h,p,_){if(_===void 0&&(_={}),!h)throw new Error("coordinates is required");if(!Array.isArray(h))throw new Error("coordinates must be an Array");if(h.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!ge(h[0])||!ge(h[1]))throw new Error("coordinates must contain numbers");return pt({type:"Point",coordinates:h},p,_)}function vt(h,p,_){if(_===void 0&&(_={}),h.length<2)throw new Error("coordinates must be an array of two or more positions");return pt({type:"LineString",coordinates:h},p,_)}function Ft(h,p){p===void 0&&(p={});var _={type:"FeatureCollection"};return p.id&&(_.id=p.id),p.bbox&&(_.bbox=p.bbox),_.features=h,_}function Wt(h,p){p===void 0&&(p="kilometers");var _=tt[p];if(!_)throw new Error(p+" units is invalid");return h*_}function Jt(h,p){p===void 0&&(p="kilometers");var _=tt[p];if(!_)throw new Error(p+" units is invalid");return h/_}function $t(h){return 180*(h%(2*Math.PI))/Math.PI}function jt(h){return h%360*Math.PI/180}function ge(h){return!isNaN(h)&&h!==null&&!Array.isArray(h)}function pe(h){var p,_,E={type:"FeatureCollection",features:[]};if((_=h.type==="Feature"?h.geometry:h).type==="LineString")p=[_.coordinates];else if(_.type==="MultiLineString")p=_.coordinates;else if(_.type==="MultiPolygon")p=[].concat.apply([],_.coordinates);else{if(_.type!=="Polygon")throw new Error("Input must be a LineString, MultiLineString, Polygon, or MultiPolygon Feature or Geometry");p=_.coordinates}return p.forEach(function(I){p.forEach(function(V){for(var nt=0;nt=0&&ot<=1&&(yt.onLine1=!0),dt>=0&&dt<=1&&(yt.onLine2=!0),!(!yt.onLine1||!yt.onLine2)&&[yt.x,yt.y])}function Ce(h,p){var _=Object.keys(h);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(h);p&&(E=E.filter(function(I){return Object.getOwnPropertyDescriptor(h,I).enumerable})),_.push.apply(_,E)}return _}function he(h){for(var p=1;p=2&&!Array.isArray(h[0])&&!Array.isArray(h[1]))return h;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function cn(h){if(Array.isArray(h))return h;if(h.type==="Feature"){if(h.geometry!==null)return h.geometry.coordinates}else if(h.coordinates)return h.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function or(h){return h.type==="Feature"?h.geometry:h}function sr(h,p){return h.type==="FeatureCollection"?"FeatureCollection":h.type==="GeometryCollection"?"GeometryCollection":h.type==="Feature"&&h.geometry!==null?h.geometry.type:h.type}function bo(h,p,_){if(h!==null)for(var E,I,V,nt,it,rt,ot,dt,Pt=0,yt=0,At=h.type,Gt=At==="FeatureCollection",te=At==="Feature",Dt=Gt?h.features.length:1,Rn=0;Rn0){var p=h[h.length-1];this._hintline.setLatLngs([p,this._hintMarker.getLatLng()])}},_syncHintMarker:function(h){if(this._hintMarker.setLatLng(h.latlng),this.options.snappable){var p=h;p.target=this._hintMarker,this._handleSnapping(p)}this.options.allowSelfIntersection||this._handleSelfIntersection(!0,this._hintMarker.getLatLng());var _=this._layer._defaultShape().slice();_.push(this._hintMarker.getLatLng()),this._change(_)},hasSelfIntersection:function(){return pe(this._layer.toGeoJSON(15)).features.length>0},_handleSelfIntersection:function(h,p){var _=L.polyline(this._layer.getLatLngs());h&&(p||(p=this._hintMarker.getLatLng()),_.addLatLng(p));var E=pe(_.toGeoJSON(15));this._doesSelfIntersect=E.features.length>0,this._doesSelfIntersect?this._hintline.setStyle({color:"#f00000ff"}):this._hintline.isEmpty()||this._hintline.setStyle(this.options.hintlineStyle)},_createVertex:function(h){if(this.options.allowSelfIntersection||(this._handleSelfIntersection(!0,h.latlng),!this._doesSelfIntersect)){this._hintMarker._snapped||this._hintMarker.setLatLng(h.latlng);var p=this._hintMarker.getLatLng(),_=this._layer.getLatLngs(),E=_[_.length-1];if(p.equals(_[0])||_.length>0&&p.equals(E))this._finishShape();else{this._layer._latlngInfo=this._layer._latlngInfo||[],this._layer._latlngInfo.push({latlng:p,snapInfo:this._hintMarker._snapInfo}),this._layer.addLatLng(p);var I=this._createMarker(p);this._setTooltipText(),this._setHintLineAfterNewVertex(p),this._fireVertexAdded(I,void 0,p,"Draw"),this._change(this._layer.getLatLngs()),this.options.finishOn==="snap"&&this._hintMarker._snapped&&this._finishShape(h)}}},_setHintLineAfterNewVertex:function(h){this._hintline.setLatLngs([h,h])},_removeLastVertex:function(){var h=this._markers;if(h.length<=1)this.disable();else{var p=this._layer.getLatLngs(),_=h[h.length-1],E=L.PM.Utils.findDeepMarkerIndex(h,_).indexPath;h.pop(),this._layerGroup.removeLayer(_);var I=h[h.length-1],V=p.indexOf(I.getLatLng());p=p.slice(0,V+1),this._layer.setLatLngs(p),this._layer._latlngInfo.pop(),this._syncHintLine(),this._setTooltipText(),this._fireVertexRemoved(_,E,"Draw"),this._change(this._layer.getLatLngs())}},_finishShape:function(){if((this.options.allowSelfIntersection||(this._handleSelfIntersection(!1),!this._doesSelfIntersect))&&(!this.options.requireSnapToFinish||this._hintMarker._snapped||this._isFirstLayer())){var h=this._layer.getLatLngs();if(!(h.length<=1)){var p=L.polyline(h,this.options.pathOptions);this._setPane(p,"layerPane"),this._finishLayer(p),p.addTo(this._map.pm._getContainingLayer()),this._fireCreate(p),this.options.snappable&&this._cleanupSnapping(),this.disable(),this.options.continueDrawing&&this.enable()}}},_createMarker:function(h){var p=new L.Marker(h,{draggable:!1,icon:L.divIcon({className:"marker-icon"})});return this._setPane(p,"vertexPane"),p._pmTempLayer=!0,this._layerGroup.addLayer(p),this._markers.push(p),p.on("click",this._finishShape,this),p},_setTooltipText:function(){var h="";h=Rt(this._layer.getLatLngs().flat().length<=1?"tooltips.continueLine":"tooltips.finishLine"),this._hintMarker.setTooltipContent(h)},_change:function(h){this._fireChange(h,"Draw")},setStyle:function(){var h,p;(h=this._layer)===null||h===void 0||h.setStyle(this.options.templineStyle),(p=this._hintline)===null||p===void 0||p.setStyle(this.options.hintlineStyle)}}),Z.Polygon=Z.Line.extend({initialize:function(h){this._map=h,this._shape="Polygon",this.toolbarButtonName="drawPolygon"},enable:function(h){L.PM.Draw.Line.prototype.enable.call(this,h),this._layer.pm._shape="Polygon"},_createMarker:function(h){var p=new L.Marker(h,{draggable:!1,icon:L.divIcon({className:"marker-icon"})});return this._setPane(p,"vertexPane"),p._pmTempLayer=!0,this._layerGroup.addLayer(p),this._markers.push(p),this._layer.getLatLngs().flat().length===1?(p.on("click",this._finishShape,this),this._tempSnapLayerIndex=this._otherSnapLayers.push(p)-1,this.options.snappable&&this._cleanupSnapping()):p.on("click",function(){return 1}),p},_setTooltipText:function(){var h="";h=Rt(this._layer.getLatLngs().flat().length<=2?"tooltips.continueLine":"tooltips.finishPoly"),this._hintMarker.setTooltipContent(h)},_finishShape:function(){if((this.options.allowSelfIntersection||(this._handleSelfIntersection(!0,this._layer.getLatLngs()[0]),!this._doesSelfIntersect))&&(!this.options.requireSnapToFinish||this._hintMarker._snapped||this._isFirstLayer())){var h=this._layer.getLatLngs();if(!(h.length<=2)){var p=L.polygon(h,this.options.pathOptions);this._setPane(p,"layerPane"),this._finishLayer(p),p.addTo(this._map.pm._getContainingLayer()),this._fireCreate(p),this._cleanupSnapping(),this._otherSnapLayers.splice(this._tempSnapLayerIndex,1),delete this._tempSnapLayerIndex,this.disable(),this.options.continueDrawing&&this.enable()}}}}),Z.Rectangle=Z.extend({initialize:function(h){this._map=h,this._shape="Rectangle",this.toolbarButtonName="drawRectangle"},enable:function(h){if(L.Util.setOptions(this,h),this._enabled=!0,this._layerGroup=new L.FeatureGroup,this._layerGroup._pmTempLayer=!0,this._layerGroup.addTo(this._map),this._layer=L.rectangle([[0,0],[0,0]],this.options.pathOptions),this._setPane(this._layer,"layerPane"),this._layer._pmTempLayer=!0,this._startMarker=L.marker(this._map.getCenter(),{icon:L.divIcon({className:"marker-icon rect-start-marker"}),draggable:!1,zIndexOffset:-100,opacity:this.options.cursorMarker?1:0}),this._setPane(this._startMarker,"vertexPane"),this._startMarker._pmTempLayer=!0,this._layerGroup.addLayer(this._startMarker),this._hintMarker=L.marker(this._map.getCenter(),{zIndexOffset:150,icon:L.divIcon({className:"marker-icon cursor-marker"})}),this._setPane(this._hintMarker,"vertexPane"),this._hintMarker._pmTempLayer=!0,this._layerGroup.addLayer(this._hintMarker),this.options.cursorMarker&&L.DomUtil.addClass(this._hintMarker._icon,"visible"),this.options.tooltips&&this._hintMarker.bindTooltip(Rt("tooltips.firstVertex"),{permanent:!0,offset:L.point(0,10),direction:"bottom",opacity:.8}).openTooltip(),this.options.cursorMarker){this._styleMarkers=[];for(var p=0;p<2;p+=1){var _=L.marker(this._map.getCenter(),{icon:L.divIcon({className:"marker-icon rect-style-marker"}),draggable:!1,zIndexOffset:100});this._setPane(_,"vertexPane"),_._pmTempLayer=!0,this._layerGroup.addLayer(_),this._styleMarkers.push(_)}}this._map._container.style.cursor="crosshair",this._map.on("click",this._placeStartingMarkers,this),this._map.on("mousemove",this._syncHintMarker,this),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!0),this._otherSnapLayers=[],this._fireDrawStart(),this._setGlobalDrawMode()},disable:function(){this._enabled&&(this._enabled=!1,this._map._container.style.cursor="",this._map.off("click",this._finishShape,this),this._map.off("click",this._placeStartingMarkers,this),this._map.off("mousemove",this._syncHintMarker,this),this._map.removeLayer(this._layerGroup),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!1),this.options.snappable&&this._cleanupSnapping(),this._fireDrawEnd(),this._setGlobalDrawMode())},enabled:function(){return this._enabled},toggle:function(h){this.enabled()?this.disable():this.enable(h)},_placeStartingMarkers:function(h){this._hintMarker._snapped||this._hintMarker.setLatLng(h.latlng);var p=this._hintMarker.getLatLng();L.DomUtil.addClass(this._startMarker._icon,"visible"),this._startMarker.setLatLng(p),this.options.cursorMarker&&this._styleMarkers&&this._styleMarkers.forEach(function(_){L.DomUtil.addClass(_._icon,"visible"),_.setLatLng(p)}),this._map.off("click",this._placeStartingMarkers,this),this._map.on("click",this._finishShape,this),this._hintMarker.setTooltipContent(Rt("tooltips.finishRect")),this._setRectangleOrigin()},_setRectangleOrigin:function(){var h=this._startMarker.getLatLng();h&&(this._layerGroup.addLayer(this._layer),this._layer.setLatLngs([h,h]),this._hintMarker.on("move",this._syncRectangleSize,this))},_syncHintMarker:function(h){if(this._hintMarker.setLatLng(h.latlng),this.options.snappable){var p=h;p.target=this._hintMarker,this._handleSnapping(p)}var _=this._layerGroup&&this._layerGroup.hasLayer(this._layer)?this._layer.getLatLngs():[this._hintMarker.getLatLng()];this._fireChange(_,"Draw")},_syncRectangleSize:function(){var h=this,p=ke(this._startMarker.getLatLng(),this._map),_=ke(this._hintMarker.getLatLng(),this._map),E=L.PM.Utils._getRotatedRectangle(p,_,this.options.rectangleAngle||0,this._map);if(this._layer.setLatLngs(E),this.options.cursorMarker&&this._styleMarkers){var I=[];E.forEach(function(V){V.equals(p,1e-8)||V.equals(_,1e-8)||I.push(V)}),I.forEach(function(V,nt){try{h._styleMarkers[nt].setLatLng(V)}catch{}})}},_findCorners:function(){var h=this._layer.getBounds();return[h.getNorthWest(),h.getNorthEast(),h.getSouthEast(),h.getSouthWest()]},_finishShape:function(h){this._hintMarker._snapped||this._hintMarker.setLatLng(h.latlng);var p=this._hintMarker.getLatLng(),_=this._startMarker.getLatLng();if(!this.options.requireSnapToFinish||this._hintMarker._snapped||this._isFirstLayer()){var E=L.rectangle([_,p],this.options.pathOptions);if(this.options.rectangleAngle){var I=L.PM.Utils._getRotatedRectangle(_,p,this.options.rectangleAngle||0,this._map);E.setLatLngs(I),E.pm&&E.pm._setAngle(this.options.rectangleAngle||0)}this._setPane(E,"layerPane"),this._finishLayer(E),E.addTo(this._map.pm._getContainingLayer()),this._fireCreate(E),this.disable(),this.options.continueDrawing&&this.enable()}},setStyle:function(){var h;(h=this._layer)===null||h===void 0||h.setStyle(this.options.pathOptions)}}),Z.Circle=Z.extend({initialize:function(h){this._map=h,this._shape="Circle",this.toolbarButtonName="drawCircle"},enable:function(h){L.Util.setOptions(this,h),this.options.radius=0,this._enabled=!0,this._layerGroup=new L.FeatureGroup,this._layerGroup._pmTempLayer=!0,this._layerGroup.addTo(this._map),this._layer=L.circle(this._map.getCenter(),St(St({},this.options.templineStyle),{},{radius:0})),this._setPane(this._layer,"layerPane"),this._layer._pmTempLayer=!0,this._centerMarker=L.marker(this._map.getCenter(),{icon:L.divIcon({className:"marker-icon"}),draggable:!1,zIndexOffset:100}),this._setPane(this._centerMarker,"vertexPane"),this._centerMarker._pmTempLayer=!0,this._hintMarker=L.marker(this._map.getCenter(),{zIndexOffset:110,icon:L.divIcon({className:"marker-icon cursor-marker"})}),this._setPane(this._hintMarker,"vertexPane"),this._hintMarker._pmTempLayer=!0,this._layerGroup.addLayer(this._hintMarker),this.options.cursorMarker&&L.DomUtil.addClass(this._hintMarker._icon,"visible"),this.options.tooltips&&this._hintMarker.bindTooltip(Rt("tooltips.startCircle"),{permanent:!0,offset:L.point(0,10),direction:"bottom",opacity:.8}).openTooltip(),this._hintline=L.polyline([],this.options.hintlineStyle),this._setPane(this._hintline,"layerPane"),this._hintline._pmTempLayer=!0,this._layerGroup.addLayer(this._hintline),this._map._container.style.cursor="crosshair",this._map.on("click",this._placeCenterMarker,this),this._map.on("mousemove",this._syncHintMarker,this),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!0),this._otherSnapLayers=[],this._fireDrawStart(),this._setGlobalDrawMode()},disable:function(){this._enabled&&(this._enabled=!1,this._map._container.style.cursor="",this._map.off("click",this._finishShape,this),this._map.off("click",this._placeCenterMarker,this),this._map.off("mousemove",this._syncHintMarker,this),this._map.removeLayer(this._layerGroup),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!1),this.options.snappable&&this._cleanupSnapping(),this._fireDrawEnd(),this._setGlobalDrawMode())},enabled:function(){return this._enabled},toggle:function(h){this.enabled()?this.disable():this.enable(h)},_syncHintLine:function(){var h=this._centerMarker.getLatLng(),p=this._getNewDestinationOfHintMarker();this._hintline.setLatLngs([h,p])},_syncCircleRadius:function(){var h,p=this._centerMarker.getLatLng(),_=this._hintMarker.getLatLng();h=this._map.options.crs===L.CRS.Simple?this._map.distance(p,_):p.distanceTo(_),this.options.minRadiusCircle&&hthis.options.maxRadiusCircle?this._layer.setRadius(this.options.maxRadiusCircle):this._layer.setRadius(h)},_syncHintMarker:function(h){if(this._hintMarker.setLatLng(h.latlng),this._hintMarker.setLatLng(this._getNewDestinationOfHintMarker()),this.options.snappable){var p=h;p.target=this._hintMarker,this._handleSnapping(p)}this._handleHintMarkerSnapping();var _=this._layerGroup&&this._layerGroup.hasLayer(this._centerMarker)?this._centerMarker.getLatLng():this._hintMarker.getLatLng();this._fireChange(_,"Draw")},_placeCenterMarker:function(h){this._layerGroup.addLayer(this._layer),this._layerGroup.addLayer(this._centerMarker),this._hintMarker._snapped||this._hintMarker.setLatLng(h.latlng);var p=this._hintMarker.getLatLng();this._layerGroup.addLayer(this._layer),this._centerMarker.setLatLng(p),this._map.off("click",this._placeCenterMarker,this),this._map.on("click",this._finishShape,this),this._placeCircleCenter()},_placeCircleCenter:function(){var h=this._centerMarker.getLatLng();h&&(this._layer.setLatLng(h),this._hintMarker.on("move",this._syncHintLine,this),this._hintMarker.on("move",this._syncCircleRadius,this),this._hintMarker.setTooltipContent(Rt("tooltips.finishCircle")),this._fireCenterPlaced(),this._fireChange(this._layer.getLatLng(),"Draw"))},_finishShape:function(h){if(!this.options.requireSnapToFinish||this._hintMarker._snapped||this._isFirstLayer()){this._hintMarker._snapped||this._hintMarker.setLatLng(h.latlng);var p,_=this._centerMarker.getLatLng(),E=this._hintMarker.getLatLng();p=this._map.options.crs===L.CRS.Simple?this._map.distance(_,E):_.distanceTo(E),this.options.minRadiusCircle&&pthis.options.maxRadiusCircle&&(p=this.options.maxRadiusCircle);var I=St(St({},this.options.pathOptions),{},{radius:p}),V=L.circle(_,I);this._setPane(V,"layerPane"),this._finishLayer(V),V.addTo(this._map.pm._getContainingLayer()),V.pm&&V.pm._updateHiddenPolyCircle(),this._fireCreate(V),this.disable(),this.options.continueDrawing&&this.enable()}},_getNewDestinationOfHintMarker:function(){var h=this._hintMarker.getLatLng();if(!this._layerGroup.hasLayer(this._centerMarker))return h;var p=this._centerMarker.getLatLng(),_=p.distanceTo(h);return this.options.minRadiusCircle&&_this.options.maxRadiusCircle&&(h=Re(this._map,p,h,this.options.maxRadiusCircle)),h},_handleHintMarkerSnapping:function(){if(this._hintMarker._snapped){var h=this._centerMarker.getLatLng(),p=this._hintMarker.getLatLng(),_=h.distanceTo(p);this._layerGroup.hasLayer(this._centerMarker)&&(this.options.minRadiusCircle&&_this.options.maxRadiusCircle)&&this._hintMarker.setLatLng(this._hintMarker._orgLatLng)}this._hintMarker.setLatLng(this._getNewDestinationOfHintMarker())},setStyle:function(){var h,p;(h=this._layer)===null||h===void 0||h.setStyle(this.options.templineStyle),(p=this._hintline)===null||p===void 0||p.setStyle(this.options.hintlineStyle)}}),Z.CircleMarker=Z.Marker.extend({initialize:function(h){this._map=h,this._shape="CircleMarker",this.toolbarButtonName="drawCircleMarker",this._layerIsDragging=!1},enable:function(h){var p=this;if(L.Util.setOptions(this,h),this._enabled=!0,this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!0),this.options.editable){var _={};L.extend(_,this.options.templineStyle),_.radius=0,this._layerGroup=new L.FeatureGroup,this._layerGroup._pmTempLayer=!0,this._layerGroup.addTo(this._map),this._layer=L.circleMarker(this._map.getCenter(),_),this._setPane(this._layer,"layerPane"),this._layer._pmTempLayer=!0,this._centerMarker=L.marker(this._map.getCenter(),{icon:L.divIcon({className:"marker-icon"}),draggable:!1,zIndexOffset:100}),this._setPane(this._centerMarker,"vertexPane"),this._centerMarker._pmTempLayer=!0,this._hintMarker=L.marker(this._map.getCenter(),{zIndexOffset:110,icon:L.divIcon({className:"marker-icon cursor-marker"})}),this._setPane(this._hintMarker,"vertexPane"),this._hintMarker._pmTempLayer=!0,this._layerGroup.addLayer(this._hintMarker),this.options.cursorMarker&&L.DomUtil.addClass(this._hintMarker._icon,"visible"),this.options.tooltips&&this._hintMarker.bindTooltip(Rt("tooltips.startCircle"),{permanent:!0,offset:L.point(0,10),direction:"bottom",opacity:.8}).openTooltip(),this._hintline=L.polyline([],this.options.hintlineStyle),this._setPane(this._hintline,"layerPane"),this._hintline._pmTempLayer=!0,this._layerGroup.addLayer(this._hintline),this._map.on("click",this._placeCenterMarker,this),this._map._container.style.cursor="crosshair"}else this._map.on("click",this._createMarker,this),this._hintMarker=L.circleMarker(this._map.getCenter(),this.options.templineStyle),this._setPane(this._hintMarker,"layerPane"),this._hintMarker._pmTempLayer=!0,this._hintMarker.addTo(this._map),this._layer=this._hintMarker,this.options.tooltips&&this._hintMarker.bindTooltip(Rt("tooltips.placeCircleMarker"),{permanent:!0,offset:L.point(0,10),direction:"bottom",opacity:.8}).openTooltip();this._map.on("mousemove",this._syncHintMarker,this),!this.options.editable&&this.options.markerEditable&&this._map.eachLayer(function(E){p.isRelevantMarker(E)&&E.pm.enable()}),this._layer.bringToBack(),this._fireDrawStart(),this._setGlobalDrawMode()},disable:function(){var h=this;this._enabled&&(this._enabled=!1,this.options.editable?(this._map._container.style.cursor="",this._map.off("click",this._finishShape,this),this._map.off("click",this._placeCenterMarker,this),this._map.removeLayer(this._layerGroup)):(this._map.off("click",this._createMarker,this),this._map.eachLayer(function(p){h.isRelevantMarker(p)&&p.pm.disable()}),this._hintMarker.remove()),this._map.off("mousemove",this._syncHintMarker,this),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!1),this.options.snappable&&this._cleanupSnapping(),this._fireDrawEnd(),this._setGlobalDrawMode())},_placeCenterMarker:function(h){this._layerGroup.addLayer(this._layer),this._layerGroup.addLayer(this._centerMarker),this._hintMarker._snapped||this._hintMarker.setLatLng(h.latlng);var p=this._hintMarker.getLatLng();this._layerGroup.addLayer(this._layer),this._centerMarker.setLatLng(p),this._map.off("click",this._placeCenterMarker,this),this._map.on("click",this._finishShape,this),this._placeCircleCenter()},_placeCircleCenter:function(){var h=this._centerMarker.getLatLng();h&&(this._layer.setLatLng(h),this._hintMarker.on("move",this._syncHintLine,this),this._hintMarker.on("move",this._syncCircleRadius,this),this._hintMarker.setTooltipContent(Rt("tooltips.finishCircle")),this._fireCenterPlaced(),this._fireChange(this._layer.getLatLng(),"Draw"))},_syncHintLine:function(){var h=this._centerMarker.getLatLng(),p=this._getNewDestinationOfHintMarker();this._hintline.setLatLngs([h,p])},_syncCircleRadius:function(){var h=this._centerMarker.getLatLng(),p=this._hintMarker.getLatLng(),_=this._map.project(h).distanceTo(this._map.project(p));this.options.minRadiusCircleMarker&&_this.options.maxRadiusCircleMarker?this._layer.setRadius(this.options.maxRadiusCircleMarker):this._layer.setRadius(_)},_syncHintMarker:function(h){if(this._hintMarker.setLatLng(h.latlng),this._hintMarker.setLatLng(this._getNewDestinationOfHintMarker()),this.options.snappable){var p=h;p.target=this._hintMarker,this._handleSnapping(p)}this._handleHintMarkerSnapping();var _=this._layerGroup&&this._layerGroup.hasLayer(this._centerMarker)?this._centerMarker.getLatLng():this._hintMarker.getLatLng();this._fireChange(_,"Draw")},isRelevantMarker:function(h){return h instanceof L.CircleMarker&&!(h instanceof L.Circle)&&h.pm&&!h._pmTempLayer},_createMarker:function(h){if((!this.options.requireSnapToFinish||this._hintMarker._snapped||this._isFirstLayer())&&h.latlng&&!this._layerIsDragging){this._hintMarker._snapped||this._hintMarker.setLatLng(h.latlng);var p=this._hintMarker.getLatLng(),_=L.circleMarker(p,this.options.pathOptions);this._setPane(_,"layerPane"),this._finishLayer(_),_.addTo(this._map.pm._getContainingLayer()),_.pm&&this.options.markerEditable&&_.pm.enable(),this._fireCreate(_),this._cleanupSnapping(),this.options.continueDrawing||this.disable()}},_finishShape:function(h){if(!this.options.requireSnapToFinish||this._hintMarker._snapped||this._isFirstLayer()){this._hintMarker._snapped||this._hintMarker.setLatLng(h.latlng);var p=this._centerMarker.getLatLng(),_=this._hintMarker.getLatLng(),E=this._map.project(p).distanceTo(this._map.project(_));this.options.editable&&(this.options.minRadiusCircleMarker&&Ethis.options.maxRadiusCircleMarker&&(E=this.options.maxRadiusCircleMarker));var I=re(re({},this.options.pathOptions),{},{radius:E}),V=L.circleMarker(p,I);this._setPane(V,"layerPane"),this._finishLayer(V),V.addTo(this._map.pm._getContainingLayer()),V.pm&&V.pm._updateHiddenPolyCircle(),this._fireCreate(V),this.disable(),this.options.continueDrawing&&this.enable()}},_getNewDestinationOfHintMarker:function(){var h=this._hintMarker.getLatLng();if(this.options.editable){if(!this._layerGroup.hasLayer(this._centerMarker))return h;var p=this._centerMarker.getLatLng(),_=this._map.project(p).distanceTo(this._map.project(h));this.options.minRadiusCircleMarker&&_this.options.maxRadiusCircleMarker&&(h=Re(this._map,p,h,this._pxRadiusToMeter(this.options.maxRadiusCircleMarker)))}return h},_handleHintMarkerSnapping:function(){if(this.options.editable){if(this._hintMarker._snapped){var h=this._centerMarker.getLatLng(),p=this._hintMarker.getLatLng(),_=this._map.project(h).distanceTo(this._map.project(p));this._layerGroup.hasLayer(this._centerMarker)&&(this.options.minRadiusCircleMarker&&_this.options.maxRadiusCircleMarker)&&this._hintMarker.setLatLng(this._hintMarker._orgLatLng)}this._hintMarker.setLatLng(this._getNewDestinationOfHintMarker())}},_pxRadiusToMeter:function(h){var p=this._centerMarker.getLatLng(),_=this._map.project(p),E=L.point(_.x+h,_.y);return this._map.unproject(E).distanceTo(p)},setStyle:function(){var h,p,_={};L.extend(_,this.options.templineStyle),this.options.editable&&(_.radius=0),(h=this._layer)===null||h===void 0||h.setStyle(_),(p=this._hintline)===null||p===void 0||p.setStyle(this.options.hintlineStyle)}});let Ei=function(h){if(!h)throw new Error("geojson is required");var p=[];return Ut(h,function(_){(function(E,I){var V=[],nt=E.geometry;if(nt!==null){switch(nt.type){case"Polygon":V=cn(nt);break;case"LineString":V=[cn(nt)]}V.forEach(function(it){var rt=function(ot,dt){var Pt=[];return ot.reduce(function(yt,At){var Gt,te,Dt,Rn,Tn,Ie,Ar=vt([yt,At],dt);return Ar.bbox=(te=At,Dt=(Gt=yt)[0],Rn=Gt[1],Tn=te[0],Ie=te[1],[DtTn?Dt:Tn,Rn>Ie?Rn:Ie]),Pt.push(Ar),At}),Pt}(it,E.properties);rt.forEach(function(ot){ot.id=I.length,I.push(ot)})})}})(_,p)}),Ft(p)};var oi=c(1787);function xe(h,p){var _=cn(h),E=cn(p);if(_.length!==2)throw new Error(" line1 must only contain 2 coordinates");if(E.length!==2)throw new Error(" line2 must only contain 2 coordinates");var I=_[0][0],V=_[0][1],nt=_[1][0],it=_[1][1],rt=E[0][0],ot=E[0][1],dt=E[1][0],Pt=E[1][1],yt=(Pt-ot)*(nt-I)-(dt-rt)*(it-V),At=(dt-rt)*(V-ot)-(Pt-ot)*(I-rt),Gt=(nt-I)*(V-ot)-(it-V)*(I-rt);if(yt===0)return null;var te=At/yt,Dt=Gt/yt;return te>=0&&te<=1&&Dt>=0&&Dt<=1?Lt([I+te*(nt-I),V+te*(it-V)]):null}let Kn=function(h,p){var _={},E=[];if(h.type==="LineString"&&(h=pt(h)),p.type==="LineString"&&(p=pt(p)),h.type==="Feature"&&p.type==="Feature"&&h.geometry!==null&&p.geometry!==null&&h.geometry.type==="LineString"&&p.geometry.type==="LineString"&&h.geometry.coordinates.length===2&&p.geometry.coordinates.length===2){var I=xe(h,p);return I&&E.push(I),Ft(E)}var V=oi();return V.load(Ei(p)),Wn(Ei(h),function(nt){Wn(V.search(nt),function(it){var rt=xe(nt,it);if(rt){var ot=cn(rt).join(",");_[ot]||(_[ot]=!0,E.push(rt))}})}),Ft(E)},$n=function(h,p,_){_===void 0&&(_={});var E=zn(h),I=zn(p),V=jt(I[1]-E[1]),nt=jt(I[0]-E[0]),it=jt(E[1]),rt=jt(I[1]),ot=Math.pow(Math.sin(V/2),2)+Math.pow(Math.sin(nt/2),2)*Math.cos(it)*Math.cos(rt);return Wt(2*Math.atan2(Math.sqrt(ot),Math.sqrt(1-ot)),_.units)},Hr=function(h){var p=h[0],_=h[1],E=h[2],I=h[3];if($n(h.slice(0,2),[E,_])>=$n(h.slice(0,2),[p,I])){var V=(_+I)/2;return[p,V-(E-p)/2,E,V+(E-p)/2]}var nt=(p+E)/2;return[nt-(I-_)/2,_,nt+(I-_)/2,I]};function wn(h){var p=[1/0,1/0,-1/0,-1/0];return bo(h,function(_){p[0]>_[0]&&(p[0]=_[0]),p[1]>_[1]&&(p[1]=_[1]),p[2]<_[0]&&(p[2]=_[0]),p[3]<_[1]&&(p[3]=_[1])}),p}wn.default=wn;let ar=wn,Or=function(h,p){p===void 0&&(p={});var _=p.precision,E=p.coordinates,I=p.mutate;if(_=_==null||isNaN(_)?6:_,E=E==null||isNaN(E)?3:E,!h)throw new Error(" is required");if(typeof _!="number")throw new Error(" must be a number");if(typeof E!="number")throw new Error(" must be a number");I!==!1&&I!==void 0||(h=JSON.parse(JSON.stringify(h)));var V=Math.pow(10,_);return bo(h,function(nt){(function(it,rt,ot){it.length>ot&&it.splice(ot,it.length);for(var dt=0;dt0&&((Dt=te.features[0]).properties.dist=$n(p,Dt,_),Dt.properties.location=I+$n(rt,Dt,_)),rt.properties.dist1&&_.push(vt(ot)),Ft(_)}function Di(h,p){if(!p.features.length)throw new Error("lines must contain features");if(p.features.length===1)return p.features[0];var _,E=1/0;return Wn(p,function(I){var V=Eo(I,h).properties.dist;V=yt[0]&&At[3]>=yt[1]}(E,nt)===!1)return!1;V==="Polygon"&&(it=[it]);for(var rt=!1,ot=0;oth[1]!=ot>h[1]&&h[0]<(rt-nt)*(h[1]-it)/(ot-it)+nt&&(E=!E)}return E}function Nr(h,p,_,E,I){var V=_[0],nt=_[1],it=h[0],rt=h[1],ot=p[0],dt=p[1],Pt=ot-it,yt=dt-rt,At=(_[0]-it)*yt-(_[1]-rt)*Pt;if(I!==null){if(Math.abs(At)>I)return!1}else if(At!==0)return!1;return E?E==="start"?Math.abs(Pt)>=Math.abs(yt)?Pt>0?it0?rt=Math.abs(yt)?Pt>0?it<=V&&V0?rt<=nt&&nt=Math.abs(yt)?Pt>0?it0?rt=Math.abs(yt)?Pt>0?it<=V&&V<=ot:ot<=V&&V<=it:yt>0?rt<=nt&&nt<=dt:dt<=nt&&nt<=rt}let dr=function(h,p,_){_===void 0&&(_={});for(var E=zn(h),I=cn(p),V=0;V"u"?null:_.epsilon))return!0}return!1};function ur(h,p){var _=or(h),E=or(p),I=_.type,V=E.type,nt=_.coordinates,it=E.coordinates;switch(I){case"Point":if(V==="Point")return Bi(nt,it);throw new Error("feature2 "+V+" geometry not supported");case"MultiPoint":switch(V){case"Point":return function(rt,ot){var dt,Pt=!1;for(dt=0;dtp[0])&&!(h[2]p[1])&&!(h[3]1?p.forEach(function(I){E.push(function(V){return Rr({type:"LineString",coordinates:V})}(I))}):E.push(h),E}function Mo(h){var p=[];return h.eachLayer(function(_){p.push(Pi(_.toGeoJSON(15)))}),function(_){return Rr({type:"MultiLineString",coordinates:_})}(p)}function Kt(h,p){return function(_){if(Array.isArray(_))return _}(h)||function(_,E){var I=_==null?null:typeof Symbol<"u"&&_[Symbol.iterator]||_["@@iterator"];if(I!=null){var V,nt,it=[],rt=!0,ot=!1;try{for(I=I.call(_);!(rt=(V=I.next()).done)&&(it.push(V.value),!E||it.length!==E);rt=!0);}catch(dt){ot=!0,nt=dt}finally{try{rt||I.return==null||I.return()}finally{if(ot)throw nt}}return it}}(h,p)||function(_,E){if(_){if(typeof _=="string")return eo(_,E);var I=Object.prototype.toString.call(_).slice(8,-1);if(I==="Object"&&_.constructor&&(I=_.constructor.name),I==="Map"||I==="Set")return Array.from(_);if(I==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(I))return eo(_,E)}}(h,p)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function eo(h,p){(p==null||p>h.length)&&(p=h.length);for(var _=0,E=new Array(p);_h.length)&&(p=h.length);for(var _=0,E=new Array(p);_0)||p.options.layersToCut.indexOf(I)>-1}).filter(function(I){return!p._layerGroup.hasLayer(I)}).filter(function(I){try{var V=!!Kn(h.toGeoJSON(15),I.toGeoJSON(15)).features.length>0;return V||I instanceof L.Polyline&&!(I instanceof L.Polygon)?V:(nt=h.toGeoJSON(15),it=I.toGeoJSON(15),rt=Un(nt),ot=Un(it),!((dt=le().intersection(rt.coordinates,ot.coordinates)).length===0||!(dt.length===1?po(dt[0]):Zt(dt))))}catch{return I instanceof L.Polygon&&console.error("You can't cut polygons with self-intersections"),!1}var nt,it,rt,ot,dt}).forEach(function(I){var V;if(I instanceof L.Polygon){var nt=(V=L.polygon(I.getLatLngs())).getLatLngs();E.forEach(function(yt){if(yt&&yt.snapInfo){var At=yt.latlng,Gt=p._calcClosestLayer(At,[V]);if(Gt&&Gt.segment&&Gt.distance1?ft()(nt,Tn):nt).splice(Ie,0,At)}}}})}else V=I;var it=p._cutLayer(h,V),rt=L.geoJSON(it,I.options);if(rt.getLayers().length===1){var ot=rt.getLayers();rt=Kt(ot,1)[0]}p._setPane(rt,"layerPane");var dt=rt.addTo(p._map.pm._getContainingLayer());if(dt.pm.enable(I.pm.options),dt.pm.disable(),I._pmTempLayer=!0,h._pmTempLayer=!0,I.remove(),I.removeFrom(p._map.pm._getContainingLayer()),h.remove(),h.removeFrom(p._map.pm._getContainingLayer()),dt.getLayers&&dt.getLayers().length===0&&p._map.pm.removeLayer({target:dt}),dt instanceof L.LayerGroup&&dt.eachLayer(function(yt){p._addDrawnLayerProp(yt)}),p._addDrawnLayerProp(dt),p.options.layersToCut&&L.Util.isArray(p.options.layersToCut)&&p.options.layersToCut.length>0){var Pt=p.options.layersToCut.indexOf(I);Pt>-1&&p.options.layersToCut.splice(Pt,1)}p._editedLayers.push({layer:dt,originalLayer:I})})},_cutLayer:function(h,p){var _,E,I,V,nt,it,rt=L.geoJSON();if(p instanceof L.Polygon)E=p.toGeoJSON(15),I=h.toGeoJSON(15),V=Un(E),nt=Un(I),_=(it=le().difference(V.coordinates,nt.coordinates)).length===0?null:it.length===1?po(it[0]):Zt(it);else{var ot=Wr(p);ot.forEach(function(dt){var Pt=Mi(dt,h.toGeoJSON(15));(Pt&&Pt.features.length>0?L.geoJSON(Pt):L.geoJSON(dt)).getLayers().forEach(function(yt){ur(h.toGeoJSON(15),yt.toGeoJSON(15))||yt.addTo(rt)})}),_=ot.length>1?Mo(rt):rt.toGeoJSON(15)}return _},_change:L.Util.falseFn}),Z.Text=Z.extend({initialize:function(h){this._map=h,this._shape="Text",this.toolbarButtonName="drawText"},enable:function(h){L.Util.setOptions(this,h),this._enabled=!0,this._map.on("click",this._createMarker,this),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!0),this._hintMarker=L.marker(this._map.getCenter(),{interactive:!1,zIndexOffset:100,icon:L.divIcon({className:"marker-icon cursor-marker"})}),this._setPane(this._hintMarker,"vertexPane"),this._hintMarker._pmTempLayer=!0,this._hintMarker.addTo(this._map),this.options.cursorMarker&&L.DomUtil.addClass(this._hintMarker._icon,"visible"),this.options.tooltips&&this._hintMarker.bindTooltip(Rt("tooltips.placeText"),{permanent:!0,offset:L.point(0,10),direction:"bottom",opacity:.8}).openTooltip(),this._layer=this._hintMarker,this._map.on("mousemove",this._syncHintMarker,this),this._fireDrawStart(),this._setGlobalDrawMode()},disable:function(){this._enabled&&(this._enabled=!1,this._map.off("click",this._createMarker,this),this._hintMarker.remove(),this._map.off("mousemove",this._syncHintMarker,this),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!1),this.options.snappable&&this._cleanupSnapping(),this._fireDrawEnd(),this._setGlobalDrawMode())},enabled:function(){return this._enabled},toggle:function(h){this.enabled()?this.disable():this.enable(h)},_syncHintMarker:function(h){if(this._hintMarker.setLatLng(h.latlng),this.options.snappable){var p=h;p.target=this._hintMarker,this._handleSnapping(p)}},_createMarker:function(h){var p;if(h.latlng&&(!this.options.requireSnapToFinish||this._hintMarker._snapped||this._isFirstLayer())){this._hintMarker._snapped||this._hintMarker.setLatLng(h.latlng);var _=this._hintMarker.getLatLng();if(this.textArea=this._createTextArea(),(p=this.options.textOptions)!==null&&p!==void 0&&p.className){var E,I=this.options.textOptions.className.split(" ");(E=this.textArea.classList).add.apply(E,$o(I))}var V=this._createTextIcon(this.textArea),nt=new L.Marker(_,{textMarker:!0,_textMarkerOverPM:!0,icon:V});if(this._setPane(nt,"markerPane"),this._finishLayer(nt),nt.pm||(nt.options.draggable=!1),nt.addTo(this._map.pm._getContainingLayer()),nt.pm){var it,rt,ot,dt,Pt;nt.pm.textArea=this.textArea,L.setOptions(nt.pm,{removeIfEmpty:(it=(rt=this.options.textOptions)===null||rt===void 0?void 0:rt.removeIfEmpty)===null||it===void 0||it});var yt=(ot=(dt=this.options.textOptions)===null||dt===void 0?void 0:dt.focusAfterDraw)===null||ot===void 0||ot;nt.pm._createTextMarker(yt),(Pt=this.options.textOptions)!==null&&Pt!==void 0&&Pt.text&&nt.pm.setText(this.options.textOptions.text)}this._fireCreate(nt),this._cleanupSnapping(),this.disable(),this.options.continueDrawing&&this.enable()}},_createTextArea:function(){var h=document.createElement("textarea");return h.autofocus=!0,h.readOnly=!0,h.classList.add("pm-textarea","pm-disabled"),h},_createTextIcon:function(h){return L.divIcon({className:"pm-text-marker",html:h})}});let De={enableLayerDrag:function(){if(this.options.draggable&&this._layer._map){this.disable(),this._layerDragEnabled=!0,this._map||(this._map=this._layer._map),(this._layer instanceof L.Marker||this._layer instanceof L.ImageOverlay)&&L.DomEvent.on(this._getDOMElem(),"dragstart",this._stopDOMImageDrag),this._layer.dragging&&this._layer.dragging.disable(),this._tempDragCoord=null,Bt(this._layer)instanceof L.Canvas?(this._layer.on("mouseout",this.removeDraggingClass,this),this._layer.on("mouseover",this.addDraggingClass,this)):this.addDraggingClass(),this._originalMapDragState=this._layer._map.dragging._enabled,this._safeToCacheDragState=!0;var h=this._getDOMElem();h&&(Bt(this._layer)instanceof L.Canvas?(this._layer.on("touchstart mousedown",this._dragMixinOnMouseDown,this),this._map.pm._addTouchEvents(h)):L.DomEvent.on(h,"touchstart mousedown",this._simulateMouseDownEvent,this)),this._fireDragEnable()}},disableLayerDrag:function(){this._layerDragEnabled=!1,Bt(this._layer)instanceof L.Canvas?(this._layer.off("mouseout",this.removeDraggingClass,this),this._layer.off("mouseover",this.addDraggingClass,this)):this.removeDraggingClass(),this._originalMapDragState&&this._dragging&&this._map.dragging.enable(),this._safeToCacheDragState=!1,this._layer.dragging&&this._layer.dragging.disable();var h=this._getDOMElem();h&&(Bt(this._layer)instanceof L.Canvas?(this._layer.off("touchstart mousedown",this._dragMixinOnMouseDown,this),this._map.pm._removeTouchEvents(h)):L.DomEvent.off(h,"touchstart mousedown",this._simulateMouseDownEvent,this)),this._layerDragged&&this._fireUpdate(),this._layerDragged=!1,this._fireDragDisable()},dragging:function(){return this._dragging},layerDragEnabled:function(){return!!this._layerDragEnabled},_simulateMouseDownEvent:function(h){var p=h.touches?h.touches[0]:h,_={originalEvent:p,target:this._layer};return _.containerPoint=this._map.mouseEventToContainerPoint(p),_.latlng=this._map.containerPointToLatLng(_.containerPoint),this._dragMixinOnMouseDown(_),!1},_simulateMouseMoveEvent:function(h){var p=h.touches?h.touches[0]:h,_={originalEvent:p,target:this._layer};return _.containerPoint=this._map.mouseEventToContainerPoint(p),_.latlng=this._map.containerPointToLatLng(_.containerPoint),this._dragMixinOnMouseMove(_),!1},_simulateMouseUpEvent:function(h){var p={originalEvent:h.touches?h.touches[0]:h,target:this._layer};return h.type.indexOf("touch")===-1&&(p.containerPoint=this._map.mouseEventToContainerPoint(h),p.latlng=this._map.containerPointToLatLng(p.containerPoint)),this._dragMixinOnMouseUp(p),!1},_dragMixinOnMouseDown:function(h){if(!(h.originalEvent.button>0)){this._overwriteEventIfItComesFromMarker(h);var p=h._fromLayerSync,_=this._syncLayers("_dragMixinOnMouseDown",h);this._layer instanceof L.Marker&&(!this.options.snappable||p||_?this._disableSnapping():this._initSnappableMarkers()),this._layer instanceof L.CircleMarker&&!(this._layer instanceof L.Circle)&&(!this.options.snappable||p||_?this._layer.pm.options.editable?this._layer.pm._disableSnapping():this._layer.pm._disableSnappingDrag():this._layer.pm.options.editable||this._initSnappableMarkersDrag()),this._safeToCacheDragState&&(this._originalMapDragState=this._layer._map.dragging._enabled,this._safeToCacheDragState=!1),this._tempDragCoord=h.latlng,L.DomEvent.on(this._map.getContainer(),"touchend mouseup",this._simulateMouseUpEvent,this),L.DomEvent.on(this._map.getContainer(),"touchmove mousemove",this._simulateMouseMoveEvent,this)}},_dragMixinOnMouseMove:function(h){this._overwriteEventIfItComesFromMarker(h);var p=this._getDOMElem();this._syncLayers("_dragMixinOnMouseMove",h),this._dragging||(this._dragging=!0,L.DomUtil.addClass(p,"leaflet-pm-dragging"),this._layer instanceof L.Marker||this._layer.bringToFront(),this._originalMapDragState&&this._map.dragging.disable(),this._fireDragStart()),this._tempDragCoord||(this._tempDragCoord=h.latlng),this._onLayerDrag(h),this._layer instanceof L.CircleMarker&&this._layer.pm._updateHiddenPolyCircle()},_dragMixinOnMouseUp:function(h){var p=this,_=this._getDOMElem();return this._syncLayers("_dragMixinOnMouseUp",h),this._originalMapDragState&&this._map.dragging.enable(),this._safeToCacheDragState=!0,L.DomEvent.off(this._map.getContainer(),"touchmove mousemove",this._simulateMouseMoveEvent,this),L.DomEvent.off(this._map.getContainer(),"touchend mouseup",this._simulateMouseUpEvent,this),!!this._dragging&&(this._layer instanceof L.CircleMarker&&this._layer.pm._updateHiddenPolyCircle(),this._layerDragged=!0,window.setTimeout(function(){p._dragging=!1,_&&L.DomUtil.removeClass(_,"leaflet-pm-dragging"),p._fireDragEnd(),p._fireEdit(),p._layerEdited=!0},10),!0)},_onLayerDrag:function(h){var p=h.latlng,_=p.lat-this._tempDragCoord.lat,E=p.lng-this._tempDragCoord.lng,I=function dt(Pt){return Pt.map(function(yt){if(Array.isArray(yt))return dt(yt);var At={lat:yt.lat+_,lng:yt.lng+E};return(yt.alt||yt.alt===0)&&(At.alt=yt.alt),At})};if(this._layer instanceof L.Circle||this._layer instanceof L.CircleMarker&&this._layer.options.editable){var V=I([this._layer.getLatLng()]);this._layer.setLatLng(V[0]),this._fireChange(this._layer.getLatLng(),"Edit")}else if(this._layer instanceof L.CircleMarker||this._layer instanceof L.Marker){var nt=this._layer.getLatLng();this._layer._snapped&&(nt=this._layer._orgLatLng);var it=I([nt]);this._layer.setLatLng(it[0]),this._fireChange(this._layer.getLatLng(),"Edit")}else if(this._layer instanceof L.ImageOverlay){var rt=I([this._layer.getBounds().getNorthWest(),this._layer.getBounds().getSouthEast()]);this._layer.setBounds(rt),this._fireChange(this._layer.getBounds(),"Edit")}else{var ot=I(this._layer.getLatLngs());this._layer.setLatLngs(ot),this._fireChange(this._layer.getLatLngs(),"Edit")}this._tempDragCoord=p,h.layer=this._layer,this._fireDrag(h)},addDraggingClass:function(){var h=this._getDOMElem();h&&L.DomUtil.addClass(h,"leaflet-pm-draggable")},removeDraggingClass:function(){var h=this._getDOMElem();h&&L.DomUtil.removeClass(h,"leaflet-pm-draggable")},_getDOMElem:function(){var h=null;return this._layer._path?h=this._layer._path:this._layer._renderer&&this._layer._renderer._container?h=this._layer._renderer._container:this._layer._image?h=this._layer._image:this._layer._icon&&(h=this._layer._icon),h},_overwriteEventIfItComesFromMarker:function(h){h.target.getLatLng&&(!h.target._radius||h.target._radius<=10)&&(h.containerPoint=this._map.mouseEventToContainerPoint(h.originalEvent),h.latlng=this._map.containerPointToLatLng(h.containerPoint))},_syncLayers:function(h,p){var _=this;if(this.enabled())return!1;if(!p._fromLayerSync&&this._layer===p.target&&this.options.syncLayersOnDrag){p._fromLayerSync=!0;var E=[];if(L.Util.isArray(this.options.syncLayersOnDrag))E=this.options.syncLayersOnDrag,this.options.syncLayersOnDrag.forEach(function(nt){nt instanceof L.LayerGroup&&(E=E.concat(nt.pm.getLayers(!0)))});else if(this.options.syncLayersOnDrag===!0&&this._parentLayerGroup)for(var I in this._parentLayerGroup){var V=this._parentLayerGroup[I];V.pm&&(E=V.pm.getLayers(!0))}return L.Util.isArray(E)&&E.length>0&&(E=E.filter(function(nt){return!!nt.pm}).filter(function(nt){return!!nt.pm.options.draggable})).forEach(function(nt){nt!==_._layer&&nt.pm[h]&&(nt._snapped=!1,nt.pm[h](p))}),E.length>0}return!1},_stopDOMImageDrag:function(h){return h.preventDefault(),!1}};function gr(h,p,_){var E=_.getMaxZoom();if(E===1/0&&(E=_.getZoom()),L.Util.isArray(h)){var I=[];return h.forEach(function(V){I.push(gr(V,p,_))}),I}return h instanceof L.LatLng?function(V,nt,it,rt){return it.unproject(nt.transform(it.project(V,rt)),rt)}(h,p,_,E):null}function ai(h,p){p instanceof L.Layer&&(p=p.getLatLng());var _=h.getMaxZoom();return _===1/0&&(_=h.getZoom()),h.project(p,_)}function Vi(h,p){var _=h.getMaxZoom();return _===1/0&&(_=h.getZoom()),h.unproject(p,_)}var It={_onRotateStart:function(h){this._preventRenderingMarkers(!0),this._rotationOriginLatLng=this._getRotationCenter().clone(),this._rotationOriginPoint=ai(this._map,this._rotationOriginLatLng),this._rotationStartPoint=ai(this._map,h.target.getLatLng()),this._initialRotateLatLng=fe(this._layer),this._startAngle=this.getAngle();var p=fe(this._rotationLayer,this._rotationLayer.pm._rotateOrgLatLng);this._fireRotationStart(this._rotationLayer,p),this._fireRotationStart(this._map,p)},_onRotate:function(h){var p=ai(this._map,h.target.getLatLng()),_=this._rotationStartPoint,E=this._rotationOriginPoint,I=Math.atan2(p.y-E.y,p.x-E.x)-Math.atan2(_.y-E.y,_.x-E.x);this._layer.setLatLngs(this._rotateLayer(I,this._initialRotateLatLng,this._rotationOriginLatLng,L.PM.Matrix.init(),this._map));var V=this;(function ot(dt){var Pt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],yt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:-1;if(yt>-1&&Pt.push(yt),L.Util.isArray(dt[0]))dt.forEach(function(Gt,te){return ot(Gt,Pt.slice(),te)});else{var At=ft()(V._markers,Pt);dt.forEach(function(Gt,te){At[te].setLatLng(Gt)})}})(this._layer.getLatLngs());var nt=fe(this._rotationLayer);this._rotationLayer.setLatLngs(this._rotateLayer(I,this._rotationLayer.pm._rotateOrgLatLng,this._rotationOriginLatLng,L.PM.Matrix.init(),this._map));var it=180*I/Math.PI,rt=(it=it<0?it+360:it)+this._startAngle;this._setAngle(rt),this._rotationLayer.pm._setAngle(rt),this._fireRotation(this._rotationLayer,it,nt),this._fireRotation(this._map,it,nt),this._rotationLayer.pm._fireChange(this._rotationLayer.getLatLngs(),"Rotation")},_onRotateEnd:function(){var h=this._startAngle;delete this._rotationOriginLatLng,delete this._rotationOriginPoint,delete this._rotationStartPoint,delete this._initialRotateLatLng,delete this._startAngle;var p=fe(this._rotationLayer,this._rotationLayer.pm._rotateOrgLatLng);this._rotationLayer.pm._rotateOrgLatLng=fe(this._rotationLayer),this._fireRotationEnd(this._rotationLayer,h,p),this._fireRotationEnd(this._map,h,p),this._rotationLayer.pm._fireEdit(this._rotationLayer,"Rotation"),this._preventRenderingMarkers(!1),this._layerRotated=!0},_rotateLayer:function(h,p,_,E,I){var V=ai(I,_);return this._matrix=E.clone().rotate(h,V).flip(),gr(p,this._matrix,I)},_setAngle:function(h){h=h<0?h+360:h,this._angle=h%360},_getRotationCenter:function(){var h=L.polygon(this._layer.getLatLngs(),{stroke:!1,fill:!1,pmIgnore:!0}).addTo(this._layer._map),p=h.getCenter();return h.removeFrom(this._layer._map),p},enableRotate:function(){this.options.allowRotation?(this.rotateEnabled()&&this.disableRotate(),this._rotatePoly=L.polygon(this._layer.getLatLngs(),{fill:!1,stroke:!1,pmIgnore:!1,snapIgnore:!0}),this._rotatePoly._pmTempLayer=!0,this._rotatePoly.addTo(this._layer._map),this._rotatePoly.pm._setAngle(this.getAngle()),this._rotatePoly.pm.setOptions(this._layer._map.pm.getGlobalOptions()),this._rotatePoly.pm.setOptions({rotate:!0,snappable:!1,hideMiddleMarkers:!0}),this._rotatePoly.pm._rotationLayer=this._layer,this._rotatePoly.pm.enable(),this._rotateOrgLatLng=fe(this._layer),this._rotateEnabled=!0,this._layer.on("remove",this.disableRotate,this),this._fireRotationEnable(this._layer),this._fireRotationEnable(this._layer._map)):this.disableRotate()},disableRotate:function(){this.rotateEnabled()&&(this._rotatePoly.pm._layerRotated&&this._fireUpdate(),this._rotatePoly.pm._layerRotated=!1,this._rotatePoly.pm.disable(),this._rotatePoly.remove(),this._rotatePoly.pm.setOptions({rotate:!1}),this._rotatePoly=void 0,this._rotateOrgLatLng=void 0,this._layer.off("remove",this.disableRotate,this),this._rotateEnabled=!1,this._fireRotationDisable(this._layer),this._fireRotationDisable(this._layer._map))},rotateEnabled:function(){return this._rotateEnabled},rotateLayer:function(h){var p=this.getAngle(),_=this._layer.getLatLngs(),E=h*(Math.PI/180);this._layer.setLatLngs(this._rotateLayer(E,this._layer.getLatLngs(),this._getRotationCenter(),L.PM.Matrix.init(),this._layer._map)),this._rotateOrgLatLng=L.polygon(this._layer.getLatLngs()).getLatLngs(),this._setAngle(this.getAngle()+h),this.rotateEnabled()&&this._rotatePoly&&this._rotatePoly.pm.enabled()&&(this._rotatePoly.setLatLngs(this._rotateLayer(E,this._rotatePoly.getLatLngs(),this._getRotationCenter(),L.PM.Matrix.init(),this._rotatePoly._map)),this._rotatePoly.pm._initMarkers());var I=this.getAngle()-p;I=I<0?I+360:I,this._startAngle=p,this._fireRotation(this._layer,I,_,this._layer),this._fireRotation(this._map||this._layer._map,I,_,this._layer),delete this._startAngle,this._fireChange(this._layer.getLatLngs(),"Rotation")},rotateLayerToAngle:function(h){var p=h-this.getAngle();this.rotateLayer(p)},getAngle:function(){return this._angle||0},setInitAngle:function(h){this._setAngle(h)}};let zi=It,fn=L.Class.extend({includes:[De,F,zi,bt],options:{snappable:!0,snapDistance:20,allowSelfIntersection:!0,allowSelfIntersectionEdit:!1,preventMarkerRemoval:!1,removeLayerBelowMinVertexCount:!0,limitMarkersToCount:-1,hideMiddleMarkers:!1,snapSegment:!0,syncLayersOnDrag:!1,draggable:!0,allowEditing:!0,allowRemoval:!0,allowCutting:!0,allowRotation:!0,addVertexOn:"click",removeVertexOn:"contextmenu",removeVertexValidation:void 0,addVertexValidation:void 0,moveVertexValidation:void 0},setOptions:function(h){L.Util.setOptions(this,h)},getOptions:function(){return this.options},applyOptions:function(){},isPolygon:function(){return this._layer instanceof L.Polygon},getShape:function(){return this._shape},_setPane:function(h,p){p==="layerPane"?h.options.pane=this._map.pm.globalOptions.panes&&this._map.pm.globalOptions.panes.layerPane||"overlayPane":p==="vertexPane"?h.options.pane=this._map.pm.globalOptions.panes&&this._map.pm.globalOptions.panes.vertexPane||"markerPane":p==="markerPane"&&(h.options.pane=this._map.pm.globalOptions.panes&&this._map.pm.globalOptions.panes.markerPane||"markerPane")},remove:function(){(this._map||this._layer._map).pm.removeLayer({target:this._layer})},_vertexValidation:function(h,p){var _=p.target,E={layer:this._layer,marker:_,event:p},I="";return h==="move"?I="moveVertexValidation":h==="add"?I="addVertexValidation":h==="remove"&&(I="removeVertexValidation"),this.options[I]&&typeof this.options[I]=="function"&&!this.options[I](E)?(h==="move"&&(_._cancelDragEventChain=_.getLatLng()),!1):(_._cancelDragEventChain=null,!0)},_vertexValidationDrag:function(h){return!h._cancelDragEventChain||(h._latlng=h._cancelDragEventChain,h.update(),!1)},_vertexValidationDragEnd:function(h){return!h._cancelDragEventChain||(h._cancelDragEventChain=null,!1)}});function Qn(h){return function(p){if(Array.isArray(p))return Ci(p)}(h)||function(p){if(typeof Symbol<"u"&&p[Symbol.iterator]!=null||p["@@iterator"]!=null)return Array.from(p)}(h)||function(p,_){if(p){if(typeof p=="string")return Ci(p,_);var E=Object.prototype.toString.call(p).slice(8,-1);if(E==="Object"&&p.constructor&&(E=p.constructor.name),E==="Map"||E==="Set")return Array.from(p);if(E==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(E))return Ci(p,_)}}(h)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Ci(h,p){(p==null||p>h.length)&&(p=h.length);for(var _=0,E=new Array(p);_0&&p._getMap()&&p._getMap().pm.globalEditModeEnabled()&&p.enabled()&&p.enable(p.getOptions())}},100,this),this),this._layerGroup.on("layerremove",function(_){p._removeLayerFromGroup(_.target)},this),this._layerGroup.on("layerremove",L.Util.throttle(function(_){_.target._pmTempLayer||(p._layers=p.getLayers())},100,this),this)},enable:function(h){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];p.length===0&&(this._layers=this.getLayers()),this._options=h,this._layers.forEach(function(_){_ instanceof L.LayerGroup?p.indexOf(_._leaflet_id)===-1&&(p.push(_._leaflet_id),_.pm.enable(h,p)):_.pm.enable(h)})},disable:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];h.length===0&&(this._layers=this.getLayers()),this._layers.forEach(function(p){p instanceof L.LayerGroup?h.indexOf(p._leaflet_id)===-1&&(h.push(p._leaflet_id),p.pm.disable(h)):p.pm.disable()})},enabled:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];h.length===0&&(this._layers=this.getLayers());var p=this._layers.find(function(_){return _ instanceof L.LayerGroup?h.indexOf(_._leaflet_id)===-1&&(h.push(_._leaflet_id),_.pm.enabled(h)):_.pm.enabled()});return!!p},toggleEdit:function(h){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];p.length===0&&(this._layers=this.getLayers()),this._options=h,this._layers.forEach(function(_){_ instanceof L.LayerGroup?p.indexOf(_._leaflet_id)===-1&&(p.push(_._leaflet_id),_.pm.toggleEdit(h,p)):_.pm.toggleEdit(h)})},_initLayer:function(h){var p=L.Util.stamp(this._layerGroup);h.pm._parentLayerGroup||(h.pm._parentLayerGroup={}),h.pm._parentLayerGroup[p]=this._layerGroup},_removeLayerFromGroup:function(h){if(h.pm&&h.pm._layerGroup){var p=L.Util.stamp(this._layerGroup);delete h.pm._layerGroup[p]}},dragging:function(){if(this._layers=this.getLayers(),this._layers){var h=this._layers.find(function(p){return p.pm.dragging()});return!!h}return!1},getOptions:function(){return this.options},_getMap:function(){var h;return this._map||((h=this._layers.find(function(p){return!!p._map}))===null||h===void 0?void 0:h._map)||null},getLayers:function(){var h=arguments.length>0&&arguments[0]!==void 0&&arguments[0],p=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],_=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],E=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[],I=[];return h?this._layerGroup.getLayers().forEach(function(V){I.push(V),V instanceof L.LayerGroup&&E.indexOf(V._leaflet_id)===-1&&(E.push(V._leaflet_id),I=I.concat(V.pm.getLayers(!0,!0,!0,E)))}):I=this._layerGroup.getLayers(),_&&(I=I.filter(function(V){return!(V instanceof L.LayerGroup)})),p&&(I=(I=(I=I.filter(function(V){return!!V.pm})).filter(function(V){return!V._pmTempLayer})).filter(function(V){return!L.PM.optIn&&!V.options.pmIgnore||L.PM.optIn&&V.options.pmIgnore===!1})),I},setOptions:function(h){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];p.length===0&&(this._layers=this.getLayers()),this.options=h,this._layers.forEach(function(_){_.pm&&(_ instanceof L.LayerGroup?p.indexOf(_._leaflet_id)===-1&&(p.push(_._leaflet_id),_.pm.setOptions(h,p)):_.pm.setOptions(h))})}}),fn.Marker=fn.extend({_shape:"Marker",initialize:function(h){this._layer=h,this._enabled=!1,this._layer.on("dragend",this._onDragEnd,this)},enable:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{draggable:!0};L.Util.setOptions(this,h),this.options.allowEditing&&this._layer._map?(this._map=this._layer._map,this.enabled()&&this.disable(),this.applyOptions(),this._layer.on("remove",this.disable,this),this._enabled=!0,this._fireEnable()):this.disable()},disable:function(){this.enabled()&&(this.disableLayerDrag(),this._layer.off("remove",this.disable,this),this._layer.off("contextmenu",this._removeMarker,this),this._layerEdited&&this._fireUpdate(),this._layerEdited=!1,this._fireDisable(),this._enabled=!1)},enabled:function(){return this._enabled},toggleEdit:function(h){this.enabled()?this.disable():this.enable(h)},applyOptions:function(){this.options.snappable?this._initSnappableMarkers():this._disableSnapping(),this.options.draggable?this.enableLayerDrag():this.disableLayerDrag(),this.options.preventMarkerRemoval||this._layer.on("contextmenu",this._removeMarker,this)},_removeMarker:function(h){var p=h.target;p.remove(),this._fireRemove(p),this._fireRemove(this._map,p)},_onDragEnd:function(){this._fireEdit(),this._layerEdited=!0},_initSnappableMarkers:function(){var h=this._layer;this.options.snapDistance=this.options.snapDistance||30,this.options.snapSegment=this.options.snapSegment===void 0||this.options.snapSegment,h.off("pm:drag",this._handleSnapping,this),h.on("pm:drag",this._handleSnapping,this),h.off("pm:dragend",this._cleanupSnapping,this),h.on("pm:dragend",this._cleanupSnapping,this),h.off("pm:dragstart",this._unsnap,this),h.on("pm:dragstart",this._unsnap,this)},_disableSnapping:function(){var h=this._layer;h.off("pm:drag",this._handleSnapping,this),h.off("pm:dragend",this._cleanupSnapping,this),h.off("pm:dragstart",this._unsnap,this)}});let tr={filterMarkerGroup:function(){this.markerCache=[],this.createCache(),this._layer.on("pm:edit",this.createCache,this),this.applyLimitFilters({}),this.throttledApplyLimitFilters||(this.throttledApplyLimitFilters=L.Util.throttle(this.applyLimitFilters,100,this)),this._layer.on("pm:disable",this._removeMarkerLimitEvents,this),this.options.limitMarkersToCount>-1&&(this._layer.on("pm:vertexremoved",this._initMarkers,this),this._map.on("mousemove",this.throttledApplyLimitFilters,this))},_removeMarkerLimitEvents:function(){this._map.off("mousemove",this.throttledApplyLimitFilters,this),this._layer.off("pm:edit",this.createCache,this),this._layer.off("pm:disable",this._removeMarkerLimitEvents,this),this._layer.off("pm:vertexremoved",this._initMarkers,this)},createCache:function(){var h=[].concat(Qn(this._markerGroup.getLayers()),Qn(this.markerCache));this.markerCache=h.filter(function(p,_,E){return E.indexOf(p)===_})},renderLimits:function(h){var p=this;this.markerCache.forEach(function(_){h.includes(_)?p._markerGroup.addLayer(_):p._markerGroup.removeLayer(_)})},applyLimitFilters:function(h){var p=h.latlng,_=p===void 0?{lat:0,lng:0}:p;if(!this._preventRenderMarkers){var E=Qn(this._filterClosestMarkers(_));this.renderLimits(E)}},_filterClosestMarkers:function(h){var p=Qn(this.markerCache),_=this.options.limitMarkersToCount;return _===-1?p:(p.sort(function(E,I){return E._latlng.distanceTo(h)-I._latlng.distanceTo(h)}),p.filter(function(E,I){return!(_>-1)||I<_}))},_preventRenderMarkers:!1,_preventRenderingMarkers:function(h){this._preventRenderMarkers=!!h}};function Ae(h,p){return function(_){if(Array.isArray(_))return _}(h)||function(_,E){var I=_==null?null:typeof Symbol<"u"&&_[Symbol.iterator]||_["@@iterator"];if(I!=null){var V,nt,it=[],rt=!0,ot=!1;try{for(I=I.call(_);!(rt=(V=I.next()).done)&&(it.push(V.value),!E||it.length!==E);rt=!0);}catch(dt){ot=!0,nt=dt}finally{try{rt||I.return==null||I.return()}finally{if(ot)throw nt}}return it}}(h,p)||function(_,E){if(_){if(typeof _=="string")return be(_,E);var I=Object.prototype.toString.call(_).slice(8,-1);if(I==="Object"&&_.constructor&&(I=_.constructor.name),I==="Map"||I==="Set")return Array.from(_);if(I==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(I))return be(_,E)}}(h,p)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function be(h,p){(p==null||p>h.length)&&(p=h.length);for(var _=0,E=new Array(p);_h.length)&&(p=h.length);for(var _=0,E=new Array(p);_1?ft()(I,rt):I,dt=nt.length>1?ft()(this._markers,rt):this._markers;ot.splice(it+1,0,E),dt.splice(it+1,0,h),this._layer.setLatLngs(I),this.options.hideMiddleMarkers!==!0&&(this._createMiddleMarker(p,h),this._createMiddleMarker(h,_)),this._fireEdit(),this._layerEdited=!0,this._fireChange(this._layer.getLatLngs(),"Edit"),this._fireVertexAdded(h,L.PM.Utils.findDeepMarkerIndex(this._markers,h).indexPath,E),this.options.snappable&&this._initSnappableMarkers()},hasSelfIntersection:function(){return pe(this._layer.toGeoJSON(15)).features.length>0},_handleSelfIntersectionOnVertexRemoval:function(){this._handleLayerStyle(!0),this.hasSelfIntersection()&&(this._layer.setLatLngs(this._coordsBeforeEdit),this._coordsBeforeEdit=null,this._initMarkers())},_handleLayerStyle:function(h){var p=this._layer;if(this.hasSelfIntersection()){if(!this.options.allowSelfIntersection&&this.options.allowSelfIntersectionEdit&&this._updateDisabledMarkerStyle(this._markers,!0),this.isRed)return;h?this._flashLayer():(p.setStyle({color:"#f00000ff"}),this.isRed=!0),this._fireIntersect(pe(this._layer.toGeoJSON(15)))}else p.setStyle({color:this.cachedColor}),this.isRed=!1,!this.options.allowSelfIntersection&&this.options.allowSelfIntersectionEdit&&this._updateDisabledMarkerStyle(this._markers,!1)},_flashLayer:function(){var h=this;this.cachedColor||(this.cachedColor=this._layer.options.color),this._layer.setStyle({color:"#f00000ff"}),this.isRed=!0,window.setTimeout(function(){h._layer.setStyle({color:h.cachedColor}),h.isRed=!1},200)},_updateDisabledMarkerStyle:function(h,p){var _=this;h.forEach(function(E){Array.isArray(E)?_._updateDisabledMarkerStyle(E,p):E._icon&&(p&&!_._checkMarkerAllowedToDrag(E)?L.DomUtil.addClass(E._icon,"vertexmarker-disabled"):L.DomUtil.removeClass(E._icon,"vertexmarker-disabled"))})},_removeMarker:function(h){var p=h.target;if(this._vertexValidation("remove",h)){this.options.allowSelfIntersection||(this._coordsBeforeEdit=fe(this._layer,this._layer.getLatLngs()));var _=this._layer.getLatLngs(),E=L.PM.Utils.findDeepMarkerIndex(this._markers,p),I=E.indexPath,V=E.index,nt=E.parentPath;if(I){var it=I.length>1?ft()(_,nt):_,rt=I.length>1?ft()(this._markers,nt):this._markers;if(this.options.removeLayerBelowMinVertexCount||!(it.length<=2||this.isPolygon()&&it.length<=3)){it.splice(V,1),this._layer.setLatLngs(_),this.isPolygon()&&it.length<=2&&it.splice(0,it.length);var ot=!1;if(it.length<=1&&(it.splice(0,it.length),nt.length>1&&I.length>1&&(_=Qt(_)),this._layer.setLatLngs(_),this._initMarkers(),ot=!0),Ot(_)||this._layer.remove(),_=Qt(_),this._layer.setLatLngs(_),this._markers=Qt(this._markers),!ot&&(rt=I.length>1?ft()(this._markers,nt):this._markers,p._middleMarkerPrev&&this._markerGroup.removeLayer(p._middleMarkerPrev),p._middleMarkerNext&&this._markerGroup.removeLayer(p._middleMarkerNext),this._markerGroup.removeLayer(p),rt)){var dt,Pt;if(this.isPolygon()?(dt=(V+1)%rt.length,Pt=(V+(rt.length-1))%rt.length):(Pt=V-1<0?void 0:V-1,dt=V+1>=rt.length?void 0:V+1),dt!==Pt){var yt=rt[Pt],At=rt[dt];this.options.hideMiddleMarkers!==!0&&this._createMiddleMarker(yt,At)}rt.splice(V,1)}this._fireEdit(),this._layerEdited=!0,this._fireVertexRemoved(p,I),this._fireChange(this._layer.getLatLngs(),"Edit")}else this._flashLayer()}}},updatePolygonCoordsFromMarkerDrag:function(h){var p=this._layer.getLatLngs(),_=h.getLatLng(),E=L.PM.Utils.findDeepMarkerIndex(this._markers,h),I=E.indexPath,V=E.index,nt=E.parentPath;(I.length>1?ft()(p,nt):p).splice(V,1,_),this._layer.setLatLngs(p)},_getNeighborMarkers:function(h){var p=L.PM.Utils.findDeepMarkerIndex(this._markers,h),_=p.indexPath,E=p.index,I=p.parentPath,V=_.length>1?ft()(this._markers,I):this._markers,nt=(E+1)%V.length;return{prevMarker:V[(E+(V.length-1))%V.length],nextMarker:V[nt]}},_checkMarkerAllowedToDrag:function(h){var p=this._getNeighborMarkers(h),_=p.prevMarker,E=p.nextMarker,I=L.polyline([_.getLatLng(),h.getLatLng()]),V=L.polyline([h.getLatLng(),E.getLatLng()]),nt=Kn(this._layer.toGeoJSON(15),I.toGeoJSON(15)).features.length,it=Kn(this._layer.toGeoJSON(15),V.toGeoJSON(15)).features.length;return h.getLatLng()===this._markers[0][0].getLatLng()?it+=1:h.getLatLng()===this._markers[0][this._markers[0].length-1].getLatLng()&&(nt+=1),!(nt<=2&&it<=2)},_onMarkerDragStart:function(h){var p=h.target;if(this.cachedColor||(this.cachedColor=this._layer.options.color),this._vertexValidation("move",h)){var _=L.PM.Utils.findDeepMarkerIndex(this._markers,p).indexPath;this._fireMarkerDragStart(h,_),this.options.allowSelfIntersection||(this._coordsBeforeEdit=fe(this._layer,this._layer.getLatLngs())),!this.options.allowSelfIntersection&&this.options.allowSelfIntersectionEdit&&this.hasSelfIntersection()?this._markerAllowedToDrag=this._checkMarkerAllowedToDrag(p):this._markerAllowedToDrag=null}},_onMarkerDrag:function(h){var p=h.target;if(this._vertexValidationDrag(p)){var _=L.PM.Utils.findDeepMarkerIndex(this._markers,p),E=_.indexPath,I=_.index,V=_.parentPath;if(E){if(!this.options.allowSelfIntersection&&this.options.allowSelfIntersectionEdit&&this.hasSelfIntersection()&&this._markerAllowedToDrag===!1)return this._layer.setLatLngs(this._coordsBeforeEdit),this._initMarkers(),void this._handleLayerStyle();this.updatePolygonCoordsFromMarkerDrag(p);var nt=E.length>1?ft()(this._markers,V):this._markers,it=(I+1)%nt.length,rt=(I+(nt.length-1))%nt.length,ot=p.getLatLng(),dt=nt[rt].getLatLng(),Pt=nt[it].getLatLng();if(p._middleMarkerNext){var yt=L.PM.Utils.calcMiddleLatLng(this._map,ot,Pt);p._middleMarkerNext.setLatLng(yt)}if(p._middleMarkerPrev){var At=L.PM.Utils.calcMiddleLatLng(this._map,ot,dt);p._middleMarkerPrev.setLatLng(At)}this.options.allowSelfIntersection||this._handleLayerStyle(),this._fireMarkerDrag(h,E),this._fireChange(this._layer.getLatLngs(),"Edit")}}},_onMarkerDragEnd:function(h){var p=h.target;if(this._vertexValidationDragEnd(p)){var _=L.PM.Utils.findDeepMarkerIndex(this._markers,p).indexPath,E=this.hasSelfIntersection();E&&this.options.allowSelfIntersectionEdit&&this._markerAllowedToDrag&&(E=!1);var I=!this.options.allowSelfIntersection&&E;if(this._fireMarkerDragEnd(h,_,I),I)return this._layer.setLatLngs(this._coordsBeforeEdit),this._coordsBeforeEdit=null,this._initMarkers(),this.options.snappable&&this._initSnappableMarkers(),this._handleLayerStyle(),void this._fireLayerReset(h,_);!this.options.allowSelfIntersection&&this.options.allowSelfIntersectionEdit&&this._handleLayerStyle(),this._fireEdit(),this._layerEdited=!0,this._fireChange(this._layer.getLatLngs(),"Edit")}},_onVertexClick:function(h){var p=h.target;if(!p._dragging){var _=L.PM.Utils.findDeepMarkerIndex(this._markers,p).indexPath;this._fireVertexClick(h,_)}}}),fn.Polygon=fn.Line.extend({_shape:"Polygon",_checkMarkerAllowedToDrag:function(h){var p=this._getNeighborMarkers(h),_=p.prevMarker,E=p.nextMarker,I=L.polyline([_.getLatLng(),h.getLatLng()]),V=L.polyline([h.getLatLng(),E.getLatLng()]),nt=Kn(this._layer.toGeoJSON(15),I.toGeoJSON(15)).features.length,it=Kn(this._layer.toGeoJSON(15),V.toGeoJSON(15)).features.length;return!(nt<=2&&it<=2)}}),fn.Rectangle=fn.Polygon.extend({_shape:"Rectangle",_initMarkers:function(){var h=this,p=this._map,_=this._findCorners();this._markerGroup&&this._markerGroup.clearLayers(),this._markerGroup=new L.FeatureGroup,this._markerGroup._pmTempLayer=!0,p.addLayer(this._markerGroup),this._markers=[],this._markers[0]=_.map(this._createMarker,this);var E=Ae(this._markers,1);this._cornerMarkers=E[0],this._layer.getLatLngs()[0].forEach(function(I,V){var nt=h._cornerMarkers.find(function(it){return it._index===V});nt&&nt.setLatLng(I)})},applyOptions:function(){this.options.snappable?this._initSnappableMarkers():this._disableSnapping(),this._addMarkerEvents()},_createMarker:function(h,p){var _=new L.Marker(h,{draggable:!0,icon:L.divIcon({className:"marker-icon"})});return this._setPane(_,"vertexPane"),_._origLatLng=h,_._index=p,_._pmTempLayer=!0,this._markerGroup.addLayer(_),_},_addMarkerEvents:function(){var h=this;this._markers[0].forEach(function(p){p.on("dragstart",h._onMarkerDragStart,h),p.on("drag",h._onMarkerDrag,h),p.on("dragend",h._onMarkerDragEnd,h),h.options.preventMarkerRemoval||p.on("contextmenu",h._removeMarker,h)})},_removeMarker:function(){return null},_onMarkerDragStart:function(h){if(this._vertexValidation("move",h)){var p=h.target,_=this._cornerMarkers;p._oppositeCornerLatLng=_.find(function(E){return E._index===(p._index+2)%4}).getLatLng(),p._snapped=!1,this._fireMarkerDragStart(h)}},_onMarkerDrag:function(h){var p=h.target;this._vertexValidationDrag(p)&&p._index!==void 0&&(this._adjustRectangleForMarkerMove(p),this._fireMarkerDrag(h),this._fireChange(this._layer.getLatLngs(),"Edit"))},_onMarkerDragEnd:function(h){var p=h.target;this._vertexValidationDragEnd(p)&&(this._cornerMarkers.forEach(function(_){delete _._oppositeCornerLatLng}),this._fireMarkerDragEnd(h),this._fireEdit(),this._layerEdited=!0,this._fireChange(this._layer.getLatLngs(),"Edit"))},_adjustRectangleForMarkerMove:function(h){L.extend(h._origLatLng,h._latlng);var p=L.PM.Utils._getRotatedRectangle(h.getLatLng(),h._oppositeCornerLatLng,this._angle||0,this._map);this._layer.setLatLngs(p),this._adjustAllMarkers(),this._layer.redraw()},_adjustAllMarkers:function(){var h=this,p=this._layer.getLatLngs()[0];p&&p.length!==4&&p.length>0?(p.forEach(function(_,E){h._cornerMarkers[E].setLatLng(_)}),this._cornerMarkers.slice(p.length).forEach(function(_){_.setLatLng(p[0])})):p&&p.length?this._cornerMarkers.forEach(function(_){_.setLatLng(p[_._index])}):console.error("The layer has no LatLngs")},_findCorners:function(){var h=this._layer.getLatLngs()[0];return L.PM.Utils._getRotatedRectangle(h[0],h[2],this._angle||0,this._map)}}),fn.Circle=fn.extend({_shape:"Circle",initialize:function(h){this._layer=h,this._enabled=!1,this._updateHiddenPolyCircle()},enable:function(h){L.Util.setOptions(this,h),this._map=this._layer._map,this.options.allowEditing?(this.enabled()||this.disable(),this._enabled=!0,this._initMarkers(),this.applyOptions(),this._layer.on("remove",this.disable,this),this._updateHiddenPolyCircle(),this._fireEnable()):this.disable()},disable:function(){if(this.enabled()&&!this._dragging){this._centerMarker.off("dragstart",this._onCircleDragStart,this),this._centerMarker.off("drag",this._onCircleDrag,this),this._centerMarker.off("dragend",this._onCircleDragEnd,this),this._outerMarker.off("drag",this._handleOuterMarkerSnapping,this),this._layer.off("remove",this.disable,this),this._enabled=!1,this._helperLayers.clearLayers();var h=this._layer._path?this._layer._path:this._layer._renderer._container;L.DomUtil.removeClass(h,"leaflet-pm-draggable"),this._layerEdited&&this._fireUpdate(),this._layerEdited=!1,this._fireDisable()}},enabled:function(){return this._enabled},toggleEdit:function(h){this.enabled()?this.disable():this.enable(h)},_initMarkers:function(){var h=this._map;this._helperLayers&&this._helperLayers.clearLayers(),this._helperLayers=new L.FeatureGroup,this._helperLayers._pmTempLayer=!0,this._helperLayers.addTo(h);var p=this._layer.getLatLng(),_=this._layer._radius,E=this._getLatLngOnCircle(p,_);this._centerMarker=this._createCenterMarker(p),this._outerMarker=this._createOuterMarker(E),this._markers=[this._centerMarker,this._outerMarker],this._createHintLine(this._centerMarker,this._outerMarker)},applyOptions:function(){this.options.snappable?(this._initSnappableMarkers(),this._outerMarker.on("drag",this._handleOuterMarkerSnapping,this),this._outerMarker.on("move",this._syncHintLine,this),this._outerMarker.on("move",this._syncCircleRadius,this),this._centerMarker.on("move",this._moveCircle,this)):this._disableSnapping()},_createHintLine:function(h,p){var _=h.getLatLng(),E=p.getLatLng();this._hintline=L.polyline([_,E],this.options.hintlineStyle),this._setPane(this._hintline,"layerPane"),this._hintline._pmTempLayer=!0,this._helperLayers.addLayer(this._hintline)},_createCenterMarker:function(h){var p=this._createMarker(h);return L.DomUtil.addClass(p._icon,"leaflet-pm-draggable"),p.on("drag",this._moveCircle,this),p.on("dragstart",this._onCircleDragStart,this),p.on("drag",this._onCircleDrag,this),p.on("dragend",this._onCircleDragEnd,this),p},_createOuterMarker:function(h){var p=this._createMarker(h);return p.on("drag",this._resizeCircle,this),p},_createMarker:function(h){var p=new L.Marker(h,{draggable:!0,icon:L.divIcon({className:"marker-icon"})});return this._setPane(p,"vertexPane"),p._origLatLng=h,p._pmTempLayer=!0,p.on("dragstart",this._onMarkerDragStart,this),p.on("drag",this._onMarkerDrag,this),p.on("dragend",this._onMarkerDragEnd,this),this._helperLayers.addLayer(p),p},_resizeCircle:function(){this._outerMarker.setLatLng(this._getNewDestinationOfOuterMarker()),this._syncHintLine(),this._syncCircleRadius()},_moveCircle:function(h){if(!h.target._cancelDragEventChain){var p=h.latlng;this._layer.setLatLng(p);var _=this._layer._radius,E=this._getLatLngOnCircle(p,_);this._outerMarker._latlng=E,this._outerMarker.update(),this._syncHintLine(),this._updateHiddenPolyCircle(),this._fireCenterPlaced("Edit"),this._fireChange(this._layer.getLatLng(),"Edit")}},_syncCircleRadius:function(){var h=this._centerMarker.getLatLng(),p=this._outerMarker.getLatLng(),_=this._map.distance(h,p);this.options.minRadiusCircle&&_this.options.maxRadiusCircle?this._layer.setRadius(this.options.maxRadiusCircle):this._layer.setRadius(_),this._updateHiddenPolyCircle(),this._fireChange(this._layer.getLatLng(),"Edit")},_syncHintLine:function(){var h=this._centerMarker.getLatLng(),p=this._outerMarker.getLatLng();this._hintline.setLatLngs([h,p])},_disableSnapping:function(){var h=this;this._markers.forEach(function(p){p.off("move",h._syncHintLine,h),p.off("move",h._syncCircleRadius,h),p.off("drag",h._handleSnapping,h),p.off("dragend",h._cleanupSnapping,h)}),this._layer.off("pm:dragstart",this._unsnap,this)},_onMarkerDragStart:function(h){this._vertexValidation("move",h)&&this._fireMarkerDragStart(h)},_onMarkerDrag:function(h){var p=h.target;this._vertexValidationDrag(p)&&this._fireMarkerDrag(h)},_onMarkerDragEnd:function(h){var p=h.target;this._vertexValidationDragEnd(p)&&(this._fireEdit(),this._layerEdited=!0,this._fireMarkerDragEnd(h))},_onCircleDragStart:function(h){this._vertexValidationDrag(h.target)?(delete this._vertexValidationReset,this._fireDragStart()):this._vertexValidationReset=!0},_onCircleDrag:function(h){this._vertexValidationReset||this._fireDrag(h)},_onCircleDragEnd:function(){this._vertexValidationReset?delete this._vertexValidationReset:this._fireDragEnd()},_updateHiddenPolyCircle:function(){var h=this._map&&this._map.pm._isCRSSimple();this._hiddenPolyCircle?this._hiddenPolyCircle.setLatLngs(L.PM.Utils.circleToPolygon(this._layer,200,!h).getLatLngs()):this._hiddenPolyCircle=L.PM.Utils.circleToPolygon(this._layer,200,!h),this._hiddenPolyCircle._parentCopy||(this._hiddenPolyCircle._parentCopy=this._layer)},_getLatLngOnCircle:function(h,p){var _=this._map.project(h),E=L.point(_.x+p,_.y);return this._map.unproject(E)},_getNewDestinationOfOuterMarker:function(){var h=this._centerMarker.getLatLng(),p=this._outerMarker.getLatLng(),_=this._map.distance(h,p);return this.options.minRadiusCircle&&_this.options.maxRadiusCircle&&(p=Re(this._map,h,p,this.options.maxRadiusCircle)),p},_handleOuterMarkerSnapping:function(){if(this._outerMarker._snapped){var h=this._centerMarker.getLatLng(),p=this._outerMarker.getLatLng(),_=this._map.distance(h,p);(this.options.minRadiusCircle&&_this.options.maxRadiusCircle)&&this._outerMarker.setLatLng(this._outerMarker._orgLatLng)}this._outerMarker.setLatLng(this._getNewDestinationOfOuterMarker())}}),fn.CircleMarker=fn.extend({_shape:"CircleMarker",initialize:function(h){this._layer=h,this._enabled=!1,this._updateHiddenPolyCircle()},enable:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{draggable:!0,snappable:!0};L.Util.setOptions(this,h),this.options.allowEditing&&this._layer._map?(this._map=this._layer._map,this.enabled()&&this.disable(),this.applyOptions(),this._layer.on("remove",this.disable,this),this._enabled=!0,this._layer.on("pm:dragstart",this._onDragStart,this),this._layer.on("pm:drag",this._onMarkerDrag,this),this._layer.on("pm:dragend",this._onMarkerDragEnd,this),this._updateHiddenPolyCircle(),this._fireEnable()):this.disable()},disable:function(){this._dragging||(this._helperLayers&&this._helperLayers.clearLayers(),this._map||(this._map=this._layer._map),this._map||(this.options.editable?(this._map.off("move",this._syncMarkers,this),this._outerMarker&&this._outerMarker.on("drag",this._handleOuterMarkerSnapping,this)):this._map.off("move",this._updateHiddenPolyCircle,this)),this.disableLayerDrag(),this._layer.off("contextmenu",this._removeMarker,this),this._layer.off("remove",this.disable,this),this.enabled()&&(this._layerEdited&&this._fireUpdate(),this._layerEdited=!1,this._fireDisable()),this._enabled=!1)},enabled:function(){return this._enabled},toggleEdit:function(h){this.enabled()?this.disable():this.enable(h)},applyOptions:function(){!this.options.editable&&this.options.draggable?this.enableLayerDrag():this.disableLayerDrag(),this.options.editable?(this._initMarkers(),this._map.on("move",this._syncMarkers,this)):this._map.on("move",this._updateHiddenPolyCircle,this),this.options.snappable?this.options.editable?(this._initSnappableMarkers(),this._centerMarker.on("drag",this._moveCircle,this),this.options.editable&&this._outerMarker.on("drag",this._handleOuterMarkerSnapping,this),this._outerMarker.on("move",this._syncHintLine,this),this._outerMarker.on("move",this._syncCircleRadius,this)):this._initSnappableMarkersDrag():this.options.editable?this._disableSnapping():this._disableSnappingDrag(),this.options.preventMarkerRemoval||this._layer.on("contextmenu",this._removeMarker,this)},_initMarkers:function(){var h=this._map;this._helperLayers&&this._helperLayers.clearLayers(),this._helperLayers=new L.FeatureGroup,this._helperLayers._pmTempLayer=!0,this._helperLayers.addTo(h);var p=this._layer.getLatLng(),_=this._layer._radius,E=this._getLatLngOnCircle(p,_);this._centerMarker=this._createCenterMarker(p),this._outerMarker=this._createOuterMarker(E),this._markers=[this._centerMarker,this._outerMarker],this._createHintLine(this._centerMarker,this._outerMarker)},_getLatLngOnCircle:function(h,p){var _=this._map.project(h),E=L.point(_.x+p,_.y);return this._map.unproject(E)},_createHintLine:function(h,p){var _=h.getLatLng(),E=p.getLatLng();this._hintline=L.polyline([_,E],this.options.hintlineStyle),this._setPane(this._hintline,"layerPane"),this._hintline._pmTempLayer=!0,this._helperLayers.addLayer(this._hintline)},_createCenterMarker:function(h){var p=this._createMarker(h);return this.options.draggable?L.DomUtil.addClass(p._icon,"leaflet-pm-draggable"):p.dragging.disable(),p},_createOuterMarker:function(h){var p=this._createMarker(h);return p.on("drag",this._resizeCircle,this),p},_createMarker:function(h){var p=new L.Marker(h,{draggable:!0,icon:L.divIcon({className:"marker-icon"})});return this._setPane(p,"vertexPane"),p._origLatLng=h,p._pmTempLayer=!0,p.on("dragstart",this._onMarkerDragStart,this),p.on("drag",this._onMarkerDrag,this),p.on("dragend",this._onMarkerDragEnd,this),this._helperLayers.addLayer(p),p},_moveCircle:function(){var h=this._centerMarker.getLatLng();this._layer.setLatLng(h);var p=this._layer._radius,_=this._getLatLngOnCircle(h,p);this._outerMarker._latlng=_,this._outerMarker.update(),this._syncHintLine(),this._updateHiddenPolyCircle(),this._fireCenterPlaced("Edit"),this._fireChange(this._layer.getLatLng(),"Edit")},_syncMarkers:function(){var h=this._layer.getLatLng(),p=this._layer._radius,_=this._getLatLngOnCircle(h,p);this._outerMarker.setLatLng(_),this._centerMarker.setLatLng(h),this._syncHintLine(),this._updateHiddenPolyCircle()},_resizeCircle:function(){this._outerMarker.setLatLng(this._getNewDestinationOfOuterMarker()),this._syncHintLine(),this._syncCircleRadius()},_syncCircleRadius:function(){var h=this._centerMarker.getLatLng(),p=this._outerMarker.getLatLng(),_=this._map.project(h).distanceTo(this._map.project(p));this.options.minRadiusCircleMarker&&_this.options.maxRadiusCircleMarker?this._layer.setRadius(this.options.maxRadiusCircleMarker):this._layer.setRadius(_),this._updateHiddenPolyCircle(),this._fireChange(this._layer.getLatLng(),"Edit")},_syncHintLine:function(){var h=this._centerMarker.getLatLng(),p=this._outerMarker.getLatLng();this._hintline.setLatLngs([h,p])},_removeMarker:function(){this.options.editable&&this.disable(),this._layer.remove(),this._fireRemove(this._layer),this._fireRemove(this._map,this._layer)},_onDragStart:function(){this._map.pm.Draw.CircleMarker._layerIsDragging=!0},_onMarkerDragStart:function(h){this._vertexValidation("move",h)&&this._fireMarkerDragStart(h)},_onMarkerDrag:function(h){var p=h.target;p instanceof L.Marker&&!this._vertexValidationDrag(p)||this._fireMarkerDrag(h)},_onMarkerDragEnd:function(h){this._map.pm.Draw.CircleMarker._layerIsDragging=!1;var p=h.target;this._vertexValidationDragEnd(p)&&(this.options.editable&&(this._fireEdit(),this._layerEdited=!0),this._fireMarkerDragEnd(h))},_initSnappableMarkersDrag:function(){var h=this._layer;this.options.snapDistance=this.options.snapDistance||30,this.options.snapSegment=this.options.snapSegment===void 0||this.options.snapSegment,h.off("pm:drag",this._handleSnapping,this),h.on("pm:drag",this._handleSnapping,this),h.off("pm:dragend",this._cleanupSnapping,this),h.on("pm:dragend",this._cleanupSnapping,this),h.off("pm:dragstart",this._unsnap,this),h.on("pm:dragstart",this._unsnap,this)},_disableSnappingDrag:function(){var h=this._layer;h.off("pm:drag",this._handleSnapping,this),h.off("pm:dragend",this._cleanupSnapping,this),h.off("pm:dragstart",this._unsnap,this)},_updateHiddenPolyCircle:function(){var h=this._layer._map||this._map;if(h){var p=L.PM.Utils.pxRadiusToMeterRadius(this._layer.getRadius(),h,this._layer.getLatLng()),_=L.circle(this._layer.getLatLng(),this._layer.options);_.setRadius(p);var E=h&&h.pm._isCRSSimple();this._hiddenPolyCircle?this._hiddenPolyCircle.setLatLngs(L.PM.Utils.circleToPolygon(_,200,!E).getLatLngs()):this._hiddenPolyCircle=L.PM.Utils.circleToPolygon(_,200,!E),this._hiddenPolyCircle._parentCopy||(this._hiddenPolyCircle._parentCopy=this._layer)}},_getNewDestinationOfOuterMarker:function(){var h=this._centerMarker.getLatLng(),p=this._outerMarker.getLatLng(),_=this._map.project(h).distanceTo(this._map.project(p));return this.options.minRadiusCircleMarker&&_this.options.maxRadiusCircleMarker&&(p=Re(this._map,h,p,L.PM.Utils.pxRadiusToMeterRadius(this.options.maxRadiusCircleMarker,this._map,h))),p},_handleOuterMarkerSnapping:function(){if(this._outerMarker._snapped){var h=this._centerMarker.getLatLng(),p=this._outerMarker.getLatLng(),_=this._map.project(h).distanceTo(this._map.project(p));(this.options.minRadiusCircleMarker&&_this.options.maxRadiusCircleMarker)&&this._outerMarker.setLatLng(this._outerMarker._orgLatLng)}this._outerMarker.setLatLng(this._getNewDestinationOfOuterMarker())}}),fn.ImageOverlay=fn.extend({_shape:"ImageOverlay",initialize:function(h){this._layer=h,this._enabled=!1},toggleEdit:function(h){this.enabled()?this.disable():this.enable(h)},enabled:function(){return this._enabled},enable:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{draggable:!0,snappable:!0};L.Util.setOptions(this,h),this._map=this._layer._map,this._map&&(this.options.allowEditing?(this.enabled()||this.disable(),this.enableLayerDrag(),this._layer.on("remove",this.disable,this),this._enabled=!0,this._otherSnapLayers=this._findCorners(),this._fireEnable()):this.disable())},disable:function(){this._dragging||(this._map||(this._map=this._layer._map),this.disableLayerDrag(),this._layer.off("remove",this.disable,this),this.enabled()||(this._layerEdited&&this._fireUpdate(),this._layerEdited=!1,this._fireDisable()),this._enabled=!1)},_findCorners:function(){var h=this._layer.getBounds();return[h.getNorthWest(),h.getNorthEast(),h.getSouthEast(),h.getSouthWest()]}}),fn.Text=fn.extend({_shape:"Text",initialize:function(h){this._layer=h,this._enabled=!1},enable:function(h){L.Util.setOptions(this,h),this.textArea&&(this.options.allowEditing&&this._layer._map?(this._map=this._layer._map,this.enabled()&&this.disable(),this.applyOptions(),this._safeToCacheDragState=!0,this._focusChange(),this.textArea.readOnly=!1,this.textArea.classList.remove("pm-disabled"),this._layer.on("remove",this.disable,this),L.DomEvent.on(this.textArea,"input",this._autoResize,this),L.DomEvent.on(this.textArea,"focus",this._focusChange,this),L.DomEvent.on(this.textArea,"blur",this._focusChange,this),this._layer.on("dblclick",L.DomEvent.stop),L.DomEvent.off(this.textArea,"mousedown",this._preventTextSelection),this._enabled=!0,this._fireEnable()):this.disable())},disable:function(){if(this.enabled()){this._layer.off("remove",this.disable,this),L.DomEvent.off(this.textArea,"input",this._autoResize,this),L.DomEvent.off(this.textArea,"focus",this._focusChange,this),L.DomEvent.off(this.textArea,"blur",this._focusChange,this),L.DomEvent.off(document,"click",this._documentClick,this),this._focusChange(),this.textArea.readOnly=!0,this.textArea.classList.add("pm-disabled");var h=document.activeElement;this.textArea.focus(),this.textArea.selectionStart=0,this.textArea.selectionEnd=0,L.DomEvent.on(this.textArea,"mousedown",this._preventTextSelection),h.focus(),this._disableOnBlurActive=!1,this._layerEdited&&this._fireUpdate(),this._layerEdited=!1,this._fireDisable(),this._enabled=!1}},enabled:function(){return this._enabled},toggleEdit:function(h){this.enabled()?this.disable():this.enable(h)},applyOptions:function(){this.options.snappable?this._initSnappableMarkers():this._disableSnapping()},_initSnappableMarkers:function(){var h=this._layer;this.options.snapDistance=this.options.snapDistance||30,this.options.snapSegment=this.options.snapSegment===void 0||this.options.snapSegment,h.off("pm:drag",this._handleSnapping,this),h.on("pm:drag",this._handleSnapping,this),h.off("pm:dragend",this._cleanupSnapping,this),h.on("pm:dragend",this._cleanupSnapping,this),h.off("pm:dragstart",this._unsnap,this),h.on("pm:dragstart",this._unsnap,this)},_disableSnapping:function(){var h=this._layer;h.off("pm:drag",this._handleSnapping,this),h.off("pm:dragend",this._cleanupSnapping,this),h.off("pm:dragstart",this._unsnap,this)},_autoResize:function(){this.textArea.style.height="1px",this.textArea.style.width="1px";var h=this.textArea.scrollHeight>21?this.textArea.scrollHeight:21,p=this.textArea.scrollWidth>16?this.textArea.scrollWidth:16;this.textArea.style.height="".concat(h,"px"),this.textArea.style.width="".concat(p,"px"),this._layer.options.text=this.getText(),this._fireTextChange(this.getText())},_disableOnBlur:function(){var h=this;this._disableOnBlurActive=!0,setTimeout(function(){h.enabled()&&L.DomEvent.on(document,"click",h._documentClick,h)},100)},_documentClick:function(h){h.target!==this.textArea&&(this.disable(),!this.getText()&&this.options.removeIfEmpty&&this.remove())},_focusChange:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},p=this._hasFocus;this._hasFocus=h.type==="focus",!p!=!this._hasFocus&&(this._hasFocus?(this._applyFocus(),this._focusText=this.getText(),this._fireTextFocus()):(this._removeFocus(),this._fireTextBlur(),this._focusText!==this.getText()&&(this._fireEdit(),this._layerEdited=!0)))},_applyFocus:function(){this.textArea.classList.add("pm-hasfocus"),this._map.dragging&&(this._safeToCacheDragState&&(this._originalMapDragState=this._map.dragging._enabled,this._safeToCacheDragState=!1),this._map.dragging.disable())},_removeFocus:function(){this._map.dragging&&(this._originalMapDragState&&this._map.dragging.enable(),this._safeToCacheDragState=!0),this.textArea.classList.remove("pm-hasfocus")},focus:function(){if(!this.enabled())throw new TypeError("Layer is not enabled");this.textArea.focus()},blur:function(){if(!this.enabled())throw new TypeError("Layer is not enabled");this.textArea.blur(),this._disableOnBlurActive&&this.disable()},hasFocus:function(){return this._hasFocus},getElement:function(){return this.textArea},setText:function(h){this.textArea.value=h,this._autoResize()},getText:function(){return this.textArea.value},_initTextMarker:function(){if(this.textArea=L.PM.Draw.Text.prototype._createTextArea.call(this),this.options.className){var h,p=this.options.className.split(" ");(h=this.textArea.classList).add.apply(h,Nn(p))}var _=L.PM.Draw.Text.prototype._createTextIcon.call(this,this.textArea);this._layer.setIcon(_),this._layer.once("add",this._createTextMarker,this)},_createTextMarker:function(){var h=arguments.length>0&&arguments[0]!==void 0&&arguments[0];this._layer.off("add",this._createTextMarker,this),this._layer.getElement().tabIndex=-1,this.textArea.wrap="off",this.textArea.style.overflow="hidden",this.textArea.style.height=L.DomUtil.getStyle(this.textArea,"font-size"),this.textArea.style.width="1px",this._layer.options.text&&this.setText(this._layer.options.text),this._autoResize(),h===!0&&(this.enable(),this.focus(),this._disableOnBlur())},_preventTextSelection:function(h){h.preventDefault()}});var $o=function(h,p,_,E,I,V){this._matrix=[h,p,_,E,I,V]};$o.init=function(){return new L.PM.Matrix(1,0,0,1,0,0)},$o.prototype={transform:function(h){return this._transform(h.clone())},_transform:function(h){var p=this._matrix,_=h.x,E=h.y;return h.x=p[0]*_+p[1]*E+p[4],h.y=p[2]*_+p[3]*E+p[5],h},untransform:function(h){var p=this._matrix;return new L.Point((h.x/p[0]-p[4])/p[0],(h.y/p[2]-p[5])/p[2])},clone:function(){var h=this._matrix;return new L.PM.Matrix(h[0],h[1],h[2],h[3],h[4],h[5])},translate:function(h){return h===void 0?new L.Point(this._matrix[4],this._matrix[5]):(typeof h=="number"?(p=h,_=h):(p=h.x,_=h.y),this._add(1,0,0,1,p,_));var p,_},scale:function(h,p){return h===void 0?new L.Point(this._matrix[0],this._matrix[3]):(p=p||L.point(0,0),typeof h=="number"?(_=h,E=h):(_=h.x,E=h.y),this._add(_,0,0,E,p.x,p.y)._add(1,0,0,1,-p.x,-p.y));var _,E},rotate:function(h,p){var _=Math.cos(h),E=Math.sin(h);return p=p||new L.Point(0,0),this._add(_,E,-E,_,p.x,p.y)._add(1,0,0,1,-p.x,-p.y)},flip:function(){return this._matrix[1]*=-1,this._matrix[2]*=-1,this},_add:function(h,p,_,E,I,V){var nt,it=[[],[],[]],rt=this._matrix,ot=[[rt[0],rt[2],rt[4]],[rt[1],rt[3],rt[5]],[0,0,1]],dt=[[h,_,I],[p,E,V],[0,0,1]];h&&h instanceof L.PM.Matrix&&(dt=[[(rt=h._matrix)[0],rt[2],rt[4]],[rt[1],rt[3],rt[5]],[0,0,1]]);for(var Pt=0;Pt<3;Pt+=1)for(var yt=0;yt<3;yt+=1){nt=0;for(var At=0;At<3;At+=1)nt+=ot[Pt][At]*dt[At][yt];it[Pt][yt]=nt}return this._matrix=[it[0][0],it[1][0],it[0][1],it[1][1],it[0][2],it[1][2]],this}};let ie=$o;var Kr={calcMiddleLatLng:function(h,p,_){var E=h.project(p),I=h.project(_);return h.unproject(E._add(I)._divideBy(2))},findLayers:function(h){var p=[];return h.eachLayer(function(_){(_ instanceof L.Polyline||_ instanceof L.Marker||_ instanceof L.Circle||_ instanceof L.CircleMarker||_ instanceof L.ImageOverlay)&&p.push(_)}),p=(p=(p=p.filter(function(_){return!!_.pm})).filter(function(_){return!_._pmTempLayer})).filter(function(_){return!L.PM.optIn&&!_.options.pmIgnore||L.PM.optIn&&_.options.pmIgnore===!1})},circleToPolygon:function(h){for(var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:60,_=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],E=h.getLatLng(),I=h.getRadius(),V=ce(E,I,p,0,_),nt=[],it=0;it3&&arguments[3]!==void 0&&arguments[3];h.fire(p,_,E);var I=this.getAllParentGroups(h),V=I.groups;V.forEach(function(nt){nt.fire(p,_,E)})},getAllParentGroups:function(h){var p=[],_=[];return!h._pmLastGroupFetch||!h._pmLastGroupFetch.time||new Date().getTime()-h._pmLastGroupFetch.time>1e3?(function E(I){for(var V in I._eventParents)if(p.indexOf(V)===-1){p.push(V);var nt=I._eventParents[V];_.push(nt),E(nt)}}(h),h._pmLastGroupFetch={time:new Date().getTime(),groups:_,groupIds:p},{groupIds:p,groups:_}):{groups:h._pmLastGroupFetch.groups,groupIds:h._pmLastGroupFetch.groupIds}},createGeodesicPolygon:ce,getTranslation:Rt,findDeepCoordIndex:function(h,p){var _,E=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],I=function nt(it){return function(rt,ot){var dt=it.concat(ot);if(E){if(rt.lat&&rt.lat===p.lat&&rt.lng===p.lng)return _=dt,!0}else if(rt.lat&&L.latLng(rt).equals(p))return _=dt,!0;return Array.isArray(rt)&&rt.some(nt(dt))}};h.some(I([]));var V={};return _&&(V={indexPath:_,index:_[_.length-1],parentPath:_.slice(0,_.length-1)}),V},findDeepMarkerIndex:function(h,p){var _;h.some(function I(V){return function(nt,it){var rt=V.concat(it);return nt._leaflet_id===p._leaflet_id?(_=rt,!0):Array.isArray(nt)&&nt.some(I(rt))}}([]));var E={};return _&&(E={indexPath:_,index:_[_.length-1],parentPath:_.slice(0,_.length-1)}),E},_getIndexFromSegment:function(h,p){if(p&&p.length===2){var _=this.findDeepCoordIndex(h,p[0]),E=this.findDeepCoordIndex(h,p[1]),I=Math.max(_.index,E.index);return _.index!==0&&E.index!==0||I===1||(I+=1),{indexA:_,indexB:E,newIndex:I,indexPath:_.indexPath,parentPath:_.parentPath}}return null},_getRotatedRectangle:function(h,p,_,E){var I=ai(E,h),V=ai(E,p),nt=_*Math.PI/180,it=Math.cos(nt),rt=Math.sin(nt),ot=(V.x-I.x)*it+(V.y-I.y)*rt,dt=(V.y-I.y)*it-(V.x-I.x)*rt,Pt=ot*it+I.x,yt=ot*rt+I.y,At=-dt*rt+I.x,Gt=dt*it+I.y;return[Vi(E,I),Vi(E,{x:Pt,y:yt}),Vi(E,V),Vi(E,{x:At,y:Gt})]},pxRadiusToMeterRadius:function(h,p,_){var E=p.project(_),I=L.point(E.x+h,E.y);return p.distance(p.unproject(I),_)}};let Pe=Kr;L.PM=L.PM||{version:"2.14.2",Map:hn,Toolbar:ht,Draw:Z,Edit:fn,Utils:Pe,Matrix:ie,activeLang:"en",optIn:!1,initialize:function(h){this.addInitHooks(h)},setOptIn:function(h){this.optIn=!!h},addInitHooks:function(){L.Map.addInitHook(function(){this.pm=void 0,L.PM.optIn?this.options.pmIgnore===!1&&(this.pm=new L.PM.Map(this)):this.options.pmIgnore||(this.pm=new L.PM.Map(this)),this.pm&&this.pm.setGlobalOptions({})}),L.LayerGroup.addInitHook(function(){this.pm=void 0,L.PM.optIn?this.options.pmIgnore===!1&&(this.pm=new L.PM.Edit.LayerGroup(this)):this.options.pmIgnore||(this.pm=new L.PM.Edit.LayerGroup(this))}),L.Marker.addInitHook(function(){this.pm=void 0,L.PM.optIn?this.options.pmIgnore===!1&&(this.options.textMarker?(this.pm=new L.PM.Edit.Text(this),this.options._textMarkerOverPM||this.pm._initTextMarker(),delete this.options._textMarkerOverPM):this.pm=new L.PM.Edit.Marker(this)):this.options.pmIgnore||(this.options.textMarker?(this.pm=new L.PM.Edit.Text(this),this.options._textMarkerOverPM||this.pm._initTextMarker(),delete this.options._textMarkerOverPM):this.pm=new L.PM.Edit.Marker(this))}),L.CircleMarker.addInitHook(function(){this.pm=void 0,L.PM.optIn?this.options.pmIgnore===!1&&(this.pm=new L.PM.Edit.CircleMarker(this)):this.options.pmIgnore||(this.pm=new L.PM.Edit.CircleMarker(this))}),L.Polyline.addInitHook(function(){this.pm=void 0,L.PM.optIn?this.options.pmIgnore===!1&&(this.pm=new L.PM.Edit.Line(this)):this.options.pmIgnore||(this.pm=new L.PM.Edit.Line(this))}),L.Polygon.addInitHook(function(){this.pm=void 0,L.PM.optIn?this.options.pmIgnore===!1&&(this.pm=new L.PM.Edit.Polygon(this)):this.options.pmIgnore||(this.pm=new L.PM.Edit.Polygon(this))}),L.Rectangle.addInitHook(function(){this.pm=void 0,L.PM.optIn?this.options.pmIgnore===!1&&(this.pm=new L.PM.Edit.Rectangle(this)):this.options.pmIgnore||(this.pm=new L.PM.Edit.Rectangle(this))}),L.Circle.addInitHook(function(){this.pm=void 0,L.PM.optIn?this.options.pmIgnore===!1&&(this.pm=new L.PM.Edit.Circle(this)):this.options.pmIgnore||(this.pm=new L.PM.Edit.Circle(this))}),L.ImageOverlay.addInitHook(function(){this.pm=void 0,L.PM.optIn?this.options.pmIgnore===!1&&(this.pm=new L.PM.Edit.ImageOverlay(this)):this.options.pmIgnore||(this.pm=new L.PM.Edit.ImageOverlay(this))})},reInitLayer:function(h){var p=this;h instanceof L.LayerGroup&&h.eachLayer(function(_){p.reInitLayer(_)}),h.pm||L.PM.optIn&&h.options.pmIgnore!==!1||h.options.pmIgnore||(h instanceof L.Map?h.pm=new L.PM.Map(h):h instanceof L.Marker?h.options.textMarker?(h.pm=new L.PM.Edit.Text(h),h.pm._initTextMarker(),h.pm._createTextMarker(!1)):h.pm=new L.PM.Edit.Marker(h):h instanceof L.Circle?h.pm=new L.PM.Edit.Circle(h):h instanceof L.CircleMarker?h.pm=new L.PM.Edit.CircleMarker(h):h instanceof L.Rectangle?h.pm=new L.PM.Edit.Rectangle(h):h instanceof L.Polygon?h.pm=new L.PM.Edit.Polygon(h):h instanceof L.Polyline?h.pm=new L.PM.Edit.Line(h):h instanceof L.LayerGroup?h.pm=new L.PM.Edit.LayerGroup(h):h instanceof L.ImageOverlay&&(h.pm=new L.PM.Edit.ImageOverlay(h)))}},L.version==="1.7.1"&&L.Canvas.include({_onClick:function(h){for(var p,_,E=this._map.mouseEventToLayerPoint(h),I=this._drawFirst;I;I=I.next)(p=I.layer).options.interactive&&p._containsPoint(E)&&(h.type!=="click"&&h.type!=="preclick"||!this._map._draggableMoved(p))&&(_=p);_&&(L.DomEvent.fakeStop(h),this._fireEvent([_],h))}}),L.PM.initialize()},7107:()=>{Array.prototype.findIndex=Array.prototype.findIndex||function(a){if(this===null)throw new TypeError("Array.prototype.findIndex called on null or undefined");if(typeof a!="function")throw new TypeError("callback must be a function");for(var l=Object(this),c=l.length>>>0,g=arguments[1],m=0;m>>0,g=arguments[1],m=0;m>>0;if(g===0)return!1;for(var m,v,x=0|l,P=Math.max(x>=0?x:g-Math.abs(x),0);P{var g=c(2582),m=c(4102),v=c(1540),x=c(9705).Z,P=v.featureEach,T=(v.coordEach,m.polygon,m.featureCollection);function N(q){var z=new g(q);return z.insert=function(j){if(j.type!=="Feature")throw new Error("invalid feature");return j.bbox=j.bbox?j.bbox:x(j),g.prototype.insert.call(this,j)},z.load=function(j){var R=[];return Array.isArray(j)?j.forEach(function(B){if(B.type!=="Feature")throw new Error("invalid features");B.bbox=B.bbox?B.bbox:x(B),R.push(B)}):P(j,function(B){if(B.type!=="Feature")throw new Error("invalid features");B.bbox=B.bbox?B.bbox:x(B),R.push(B)}),g.prototype.load.call(this,R)},z.remove=function(j,R){if(j.type!=="Feature")throw new Error("invalid feature");return j.bbox=j.bbox?j.bbox:x(j),g.prototype.remove.call(this,j,R)},z.clear=function(){return g.prototype.clear.call(this)},z.search=function(j){var R=g.prototype.search.call(this,this.toBBox(j));return T(R)},z.collides=function(j){return g.prototype.collides.call(this,this.toBBox(j))},z.all=function(){var j=g.prototype.all.call(this);return T(j)},z.toJSON=function(){return g.prototype.toJSON.call(this)},z.fromJSON=function(j){return g.prototype.fromJSON.call(this,j)},z.toBBox=function(j){var R;if(j.bbox)R=j.bbox;else if(Array.isArray(j)&&j.length===4)R=j;else if(Array.isArray(j)&&j.length===6)R=[j[0],j[1],j[3],j[4]];else if(j.type==="Feature")R=x(j);else{if(j.type!=="FeatureCollection")throw new Error("invalid geojson");R=x(j)}return{minX:R[0],minY:R[1],maxX:R[2],maxY:R[3]}},z}a.exports=N,a.exports.default=N},1989:(a,l,c)=>{var g=c(1789),m=c(401),v=c(7667),x=c(1327),P=c(1866);function T(N){var q=-1,z=N==null?0:N.length;for(this.clear();++q{var g=c(7040),m=c(4125),v=c(2117),x=c(7518),P=c(4705);function T(N){var q=-1,z=N==null?0:N.length;for(this.clear();++q{var g=c(852)(c(5639),"Map");a.exports=g},3369:(a,l,c)=>{var g=c(4785),m=c(1285),v=c(6e3),x=c(9916),P=c(5265);function T(N){var q=-1,z=N==null?0:N.length;for(this.clear();++q{var g=c(8407),m=c(7465),v=c(3779),x=c(7599),P=c(4758),T=c(4309);function N(q){var z=this.__data__=new g(q);this.size=z.size}N.prototype.clear=m,N.prototype.delete=v,N.prototype.get=x,N.prototype.has=P,N.prototype.set=T,a.exports=N},2705:(a,l,c)=>{var g=c(5639).Symbol;a.exports=g},1149:(a,l,c)=>{var g=c(5639).Uint8Array;a.exports=g},6874:a=>{a.exports=function(l,c,g){switch(g.length){case 0:return l.call(c);case 1:return l.call(c,g[0]);case 2:return l.call(c,g[0],g[1]);case 3:return l.call(c,g[0],g[1],g[2])}return l.apply(c,g)}},4636:(a,l,c)=>{var g=c(2545),m=c(5694),v=c(1469),x=c(4144),P=c(5776),T=c(6719),N=Object.prototype.hasOwnProperty;a.exports=function(q,z){var j=v(q),R=!j&&m(q),B=!j&&!R&&x(q),D=!j&&!R&&!B&&T(q),A=j||R||B||D,G=A?g(q.length,String):[],H=G.length;for(var K in q)!z&&!N.call(q,K)||A&&(K=="length"||B&&(K=="offset"||K=="parent")||D&&(K=="buffer"||K=="byteLength"||K=="byteOffset")||P(K,H))||G.push(K);return G}},9932:a=>{a.exports=function(l,c){for(var g=-1,m=l==null?0:l.length,v=Array(m);++g{var g=c(9465),m=c(7813);a.exports=function(v,x,P){(P!==void 0&&!m(v[x],P)||P===void 0&&!(x in v))&&g(v,x,P)}},4865:(a,l,c)=>{var g=c(9465),m=c(7813),v=Object.prototype.hasOwnProperty;a.exports=function(x,P,T){var N=x[P];v.call(x,P)&&m(N,T)&&(T!==void 0||P in x)||g(x,P,T)}},8470:(a,l,c)=>{var g=c(7813);a.exports=function(m,v){for(var x=m.length;x--;)if(g(m[x][0],v))return x;return-1}},9465:(a,l,c)=>{var g=c(8777);a.exports=function(m,v,x){v=="__proto__"&&g?g(m,v,{configurable:!0,enumerable:!0,value:x,writable:!0}):m[v]=x}},3118:(a,l,c)=>{var g=c(3218),m=Object.create,v=function(){function x(){}return function(P){if(!g(P))return{};if(m)return m(P);x.prototype=P;var T=new x;return x.prototype=void 0,T}}();a.exports=v},8483:(a,l,c)=>{var g=c(5063)();a.exports=g},7786:(a,l,c)=>{var g=c(1811),m=c(327);a.exports=function(v,x){for(var P=0,T=(x=g(x,v)).length;v!=null&&P{var g=c(2705),m=c(9607),v=c(2333),x=g?g.toStringTag:void 0;a.exports=function(P){return P==null?P===void 0?"[object Undefined]":"[object Null]":x&&x in Object(P)?m(P):v(P)}},8565:a=>{var l=Object.prototype.hasOwnProperty;a.exports=function(c,g){return c!=null&&l.call(c,g)}},9454:(a,l,c)=>{var g=c(4239),m=c(7005);a.exports=function(v){return m(v)&&g(v)=="[object Arguments]"}},8458:(a,l,c)=>{var g=c(3560),m=c(5346),v=c(3218),x=c(346),P=/^\[object .+?Constructor\]$/,T=Function.prototype,N=Object.prototype,q=T.toString,z=N.hasOwnProperty,j=RegExp("^"+q.call(z).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");a.exports=function(R){return!(!v(R)||m(R))&&(g(R)?j:P).test(x(R))}},8749:(a,l,c)=>{var g=c(4239),m=c(1780),v=c(7005),x={};x["[object Float32Array]"]=x["[object Float64Array]"]=x["[object Int8Array]"]=x["[object Int16Array]"]=x["[object Int32Array]"]=x["[object Uint8Array]"]=x["[object Uint8ClampedArray]"]=x["[object Uint16Array]"]=x["[object Uint32Array]"]=!0,x["[object Arguments]"]=x["[object Array]"]=x["[object ArrayBuffer]"]=x["[object Boolean]"]=x["[object DataView]"]=x["[object Date]"]=x["[object Error]"]=x["[object Function]"]=x["[object Map]"]=x["[object Number]"]=x["[object Object]"]=x["[object RegExp]"]=x["[object Set]"]=x["[object String]"]=x["[object WeakMap]"]=!1,a.exports=function(P){return v(P)&&m(P.length)&&!!x[g(P)]}},313:(a,l,c)=>{var g=c(3218),m=c(5726),v=c(3498),x=Object.prototype.hasOwnProperty;a.exports=function(P){if(!g(P))return v(P);var T=m(P),N=[];for(var q in P)(q!="constructor"||!T&&x.call(P,q))&&N.push(q);return N}},2980:(a,l,c)=>{var g=c(6384),m=c(6556),v=c(8483),x=c(9783),P=c(3218),T=c(1704),N=c(6390);a.exports=function q(z,j,R,B,D){z!==j&&v(j,function(A,G){if(D||(D=new g),P(A))x(z,j,G,R,q,B,D);else{var H=B?B(N(z,G),A,G+"",z,j,D):void 0;H===void 0&&(H=A),m(z,G,H)}},T)}},9783:(a,l,c)=>{var g=c(6556),m=c(4626),v=c(7133),x=c(278),P=c(8517),T=c(5694),N=c(1469),q=c(9246),z=c(4144),j=c(3560),R=c(3218),B=c(8630),D=c(6719),A=c(6390),G=c(9881);a.exports=function(H,K,et,X,lt,gt,Et){var Q=A(H,et),kt=A(K,et),ct=Et.get(kt);if(ct)g(H,et,ct);else{var bt=gt?gt(Q,kt,et+"",H,K,Et):void 0,Mt=bt===void 0;if(Mt){var Xt=N(kt),ft=!Xt&&z(kt),Ct=!Xt&&!ft&&D(kt);bt=kt,Xt||ft||Ct?N(Q)?bt=Q:q(Q)?bt=x(Q):ft?(Mt=!1,bt=m(kt,!0)):Ct?(Mt=!1,bt=v(kt,!0)):bt=[]:B(kt)||T(kt)?(bt=Q,T(Q)?bt=G(Q):R(Q)&&!j(Q)||(bt=P(kt))):Mt=!1}Mt&&(Et.set(kt,bt),lt(bt,kt,X,gt,Et),Et.delete(kt)),g(H,et,bt)}}},5976:(a,l,c)=>{var g=c(6557),m=c(5357),v=c(61);a.exports=function(x,P){return v(m(x,P,g),x+"")}},6560:(a,l,c)=>{var g=c(5703),m=c(8777),v=c(6557),x=m?function(P,T){return m(P,"toString",{configurable:!0,enumerable:!1,value:g(T),writable:!0})}:v;a.exports=x},2545:a=>{a.exports=function(l,c){for(var g=-1,m=Array(l);++g{var g=c(2705),m=c(9932),v=c(1469),x=c(3448),P=g?g.prototype:void 0,T=P?P.toString:void 0;a.exports=function N(q){if(typeof q=="string")return q;if(v(q))return m(q,N)+"";if(x(q))return T?T.call(q):"";var z=q+"";return z=="0"&&1/q==-1/0?"-0":z}},1717:a=>{a.exports=function(l){return function(c){return l(c)}}},1811:(a,l,c)=>{var g=c(1469),m=c(5403),v=c(5514),x=c(9833);a.exports=function(P,T){return g(P)?P:m(P,T)?[P]:v(x(P))}},4318:(a,l,c)=>{var g=c(1149);a.exports=function(m){var v=new m.constructor(m.byteLength);return new g(v).set(new g(m)),v}},4626:(a,l,c)=>{a=c.nmd(a);var g=c(5639),m=l&&!l.nodeType&&l,v=m&&a&&!a.nodeType&&a,x=v&&v.exports===m?g.Buffer:void 0,P=x?x.allocUnsafe:void 0;a.exports=function(T,N){if(N)return T.slice();var q=T.length,z=P?P(q):new T.constructor(q);return T.copy(z),z}},7133:(a,l,c)=>{var g=c(4318);a.exports=function(m,v){var x=v?g(m.buffer):m.buffer;return new m.constructor(x,m.byteOffset,m.length)}},278:a=>{a.exports=function(l,c){var g=-1,m=l.length;for(c||(c=Array(m));++g{var g=c(4865),m=c(9465);a.exports=function(v,x,P,T){var N=!P;P||(P={});for(var q=-1,z=x.length;++q{var g=c(5639)["__core-js_shared__"];a.exports=g},1463:(a,l,c)=>{var g=c(5976),m=c(6612);a.exports=function(v){return g(function(x,P){var T=-1,N=P.length,q=N>1?P[N-1]:void 0,z=N>2?P[2]:void 0;for(q=v.length>3&&typeof q=="function"?(N--,q):void 0,z&&m(P[0],P[1],z)&&(q=N<3?void 0:q,N=1),x=Object(x);++T{a.exports=function(l){return function(c,g,m){for(var v=-1,x=Object(c),P=m(c),T=P.length;T--;){var N=P[l?T:++v];if(g(x[N],N,x)===!1)break}return c}}},8777:(a,l,c)=>{var g=c(852),m=function(){try{var v=g(Object,"defineProperty");return v({},"",{}),v}catch{}}();a.exports=m},1957:(a,l,c)=>{var g=typeof c.g=="object"&&c.g&&c.g.Object===Object&&c.g;a.exports=g},5050:(a,l,c)=>{var g=c(7019);a.exports=function(m,v){var x=m.__data__;return g(v)?x[typeof v=="string"?"string":"hash"]:x.map}},852:(a,l,c)=>{var g=c(8458),m=c(7801);a.exports=function(v,x){var P=m(v,x);return g(P)?P:void 0}},5924:(a,l,c)=>{var g=c(5569)(Object.getPrototypeOf,Object);a.exports=g},9607:(a,l,c)=>{var g=c(2705),m=Object.prototype,v=m.hasOwnProperty,x=m.toString,P=g?g.toStringTag:void 0;a.exports=function(T){var N=v.call(T,P),q=T[P];try{T[P]=void 0;var z=!0}catch{}var j=x.call(T);return z&&(N?T[P]=q:delete T[P]),j}},7801:a=>{a.exports=function(l,c){return l?.[c]}},222:(a,l,c)=>{var g=c(1811),m=c(5694),v=c(1469),x=c(5776),P=c(1780),T=c(327);a.exports=function(N,q,z){for(var j=-1,R=(q=g(q,N)).length,B=!1;++j{var g=c(4536);a.exports=function(){this.__data__=g?g(null):{},this.size=0}},401:a=>{a.exports=function(l){var c=this.has(l)&&delete this.__data__[l];return this.size-=c?1:0,c}},7667:(a,l,c)=>{var g=c(4536),m=Object.prototype.hasOwnProperty;a.exports=function(v){var x=this.__data__;if(g){var P=x[v];return P==="__lodash_hash_undefined__"?void 0:P}return m.call(x,v)?x[v]:void 0}},1327:(a,l,c)=>{var g=c(4536),m=Object.prototype.hasOwnProperty;a.exports=function(v){var x=this.__data__;return g?x[v]!==void 0:m.call(x,v)}},1866:(a,l,c)=>{var g=c(4536);a.exports=function(m,v){var x=this.__data__;return this.size+=this.has(m)?0:1,x[m]=g&&v===void 0?"__lodash_hash_undefined__":v,this}},8517:(a,l,c)=>{var g=c(3118),m=c(5924),v=c(5726);a.exports=function(x){return typeof x.constructor!="function"||v(x)?{}:g(m(x))}},5776:a=>{var l=/^(?:0|[1-9]\d*)$/;a.exports=function(c,g){var m=typeof c;return!!(g=g??9007199254740991)&&(m=="number"||m!="symbol"&&l.test(c))&&c>-1&&c%1==0&&c{var g=c(7813),m=c(8612),v=c(5776),x=c(3218);a.exports=function(P,T,N){if(!x(N))return!1;var q=typeof T;return!!(q=="number"?m(N)&&v(T,N.length):q=="string"&&T in N)&&g(N[T],P)}},5403:(a,l,c)=>{var g=c(1469),m=c(3448),v=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,x=/^\w*$/;a.exports=function(P,T){if(g(P))return!1;var N=typeof P;return!(N!="number"&&N!="symbol"&&N!="boolean"&&P!=null&&!m(P))||x.test(P)||!v.test(P)||T!=null&&P in Object(T)}},7019:a=>{a.exports=function(l){var c=typeof l;return c=="string"||c=="number"||c=="symbol"||c=="boolean"?l!=="__proto__":l===null}},5346:(a,l,c)=>{var g,m=c(4429),v=(g=/[^.]+$/.exec(m&&m.keys&&m.keys.IE_PROTO||""))?"Symbol(src)_1."+g:"";a.exports=function(x){return!!v&&v in x}},5726:a=>{var l=Object.prototype;a.exports=function(c){var g=c&&c.constructor;return c===(typeof g=="function"&&g.prototype||l)}},7040:a=>{a.exports=function(){this.__data__=[],this.size=0}},4125:(a,l,c)=>{var g=c(8470),m=Array.prototype.splice;a.exports=function(v){var x=this.__data__,P=g(x,v);return!(P<0)&&(P==x.length-1?x.pop():m.call(x,P,1),--this.size,!0)}},2117:(a,l,c)=>{var g=c(8470);a.exports=function(m){var v=this.__data__,x=g(v,m);return x<0?void 0:v[x][1]}},7518:(a,l,c)=>{var g=c(8470);a.exports=function(m){return g(this.__data__,m)>-1}},4705:(a,l,c)=>{var g=c(8470);a.exports=function(m,v){var x=this.__data__,P=g(x,m);return P<0?(++this.size,x.push([m,v])):x[P][1]=v,this}},4785:(a,l,c)=>{var g=c(1989),m=c(8407),v=c(7071);a.exports=function(){this.size=0,this.__data__={hash:new g,map:new(v||m),string:new g}}},1285:(a,l,c)=>{var g=c(5050);a.exports=function(m){var v=g(this,m).delete(m);return this.size-=v?1:0,v}},6e3:(a,l,c)=>{var g=c(5050);a.exports=function(m){return g(this,m).get(m)}},9916:(a,l,c)=>{var g=c(5050);a.exports=function(m){return g(this,m).has(m)}},5265:(a,l,c)=>{var g=c(5050);a.exports=function(m,v){var x=g(this,m),P=x.size;return x.set(m,v),this.size+=x.size==P?0:1,this}},4523:(a,l,c)=>{var g=c(8306);a.exports=function(m){var v=g(m,function(P){return x.size===500&&x.clear(),P}),x=v.cache;return v}},4536:(a,l,c)=>{var g=c(852)(Object,"create");a.exports=g},3498:a=>{a.exports=function(l){var c=[];if(l!=null)for(var g in Object(l))c.push(g);return c}},1167:(a,l,c)=>{a=c.nmd(a);var g=c(1957),m=l&&!l.nodeType&&l,v=m&&a&&!a.nodeType&&a,x=v&&v.exports===m&&g.process,P=function(){try{var T=v&&v.require&&v.require("util").types;return T||x&&x.binding&&x.binding("util")}catch{}}();a.exports=P},2333:a=>{var l=Object.prototype.toString;a.exports=function(c){return l.call(c)}},5569:a=>{a.exports=function(l,c){return function(g){return l(c(g))}}},5357:(a,l,c)=>{var g=c(6874),m=Math.max;a.exports=function(v,x,P){return x=m(x===void 0?v.length-1:x,0),function(){for(var T=arguments,N=-1,q=m(T.length-x,0),z=Array(q);++N{var g=c(1957),m=typeof self=="object"&&self&&self.Object===Object&&self,v=g||m||Function("return this")();a.exports=v},6390:a=>{a.exports=function(l,c){if((c!=="constructor"||typeof l[c]!="function")&&c!="__proto__")return l[c]}},61:(a,l,c)=>{var g=c(6560),m=c(1275)(g);a.exports=m},1275:a=>{var l=Date.now;a.exports=function(c){var g=0,m=0;return function(){var v=l(),x=16-(v-m);if(m=v,x>0){if(++g>=800)return arguments[0]}else g=0;return c.apply(void 0,arguments)}}},7465:(a,l,c)=>{var g=c(8407);a.exports=function(){this.__data__=new g,this.size=0}},3779:a=>{a.exports=function(l){var c=this.__data__,g=c.delete(l);return this.size=c.size,g}},7599:a=>{a.exports=function(l){return this.__data__.get(l)}},4758:a=>{a.exports=function(l){return this.__data__.has(l)}},4309:(a,l,c)=>{var g=c(8407),m=c(7071),v=c(3369);a.exports=function(x,P){var T=this.__data__;if(T instanceof g){var N=T.__data__;if(!m||N.length<199)return N.push([x,P]),this.size=++T.size,this;T=this.__data__=new v(N)}return T.set(x,P),this.size=T.size,this}},5514:(a,l,c)=>{var g=c(4523),m=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,v=/\\(\\)?/g,x=g(function(P){var T=[];return P.charCodeAt(0)===46&&T.push(""),P.replace(m,function(N,q,z,j){T.push(z?j.replace(v,"$1"):q||N)}),T});a.exports=x},327:(a,l,c)=>{var g=c(3448);a.exports=function(m){if(typeof m=="string"||g(m))return m;var v=m+"";return v=="0"&&1/m==-1/0?"-0":v}},346:a=>{var l=Function.prototype.toString;a.exports=function(c){if(c!=null){try{return l.call(c)}catch{}try{return c+""}catch{}}return""}},5703:a=>{a.exports=function(l){return function(){return l}}},7813:a=>{a.exports=function(l,c){return l===c||l!=l&&c!=c}},7361:(a,l,c)=>{var g=c(7786);a.exports=function(m,v,x){var P=m==null?void 0:g(m,v);return P===void 0?x:P}},8721:(a,l,c)=>{var g=c(8565),m=c(222);a.exports=function(v,x){return v!=null&&m(v,x,g)}},6557:a=>{a.exports=function(l){return l}},5694:(a,l,c)=>{var g=c(9454),m=c(7005),v=Object.prototype,x=v.hasOwnProperty,P=v.propertyIsEnumerable,T=g(function(){return arguments}())?g:function(N){return m(N)&&x.call(N,"callee")&&!P.call(N,"callee")};a.exports=T},1469:a=>{var l=Array.isArray;a.exports=l},8612:(a,l,c)=>{var g=c(3560),m=c(1780);a.exports=function(v){return v!=null&&m(v.length)&&!g(v)}},9246:(a,l,c)=>{var g=c(8612),m=c(7005);a.exports=function(v){return m(v)&&g(v)}},4144:(a,l,c)=>{a=c.nmd(a);var g=c(5639),m=c(5062),v=l&&!l.nodeType&&l,x=v&&a&&!a.nodeType&&a,P=x&&x.exports===v?g.Buffer:void 0,T=(P?P.isBuffer:void 0)||m;a.exports=T},3560:(a,l,c)=>{var g=c(4239),m=c(3218);a.exports=function(v){if(!m(v))return!1;var x=g(v);return x=="[object Function]"||x=="[object GeneratorFunction]"||x=="[object AsyncFunction]"||x=="[object Proxy]"}},1780:a=>{a.exports=function(l){return typeof l=="number"&&l>-1&&l%1==0&&l<=9007199254740991}},3218:a=>{a.exports=function(l){var c=typeof l;return l!=null&&(c=="object"||c=="function")}},7005:a=>{a.exports=function(l){return l!=null&&typeof l=="object"}},8630:(a,l,c)=>{var g=c(4239),m=c(5924),v=c(7005),x=Function.prototype,P=Object.prototype,T=x.toString,N=P.hasOwnProperty,q=T.call(Object);a.exports=function(z){if(!v(z)||g(z)!="[object Object]")return!1;var j=m(z);if(j===null)return!0;var R=N.call(j,"constructor")&&j.constructor;return typeof R=="function"&&R instanceof R&&T.call(R)==q}},3448:(a,l,c)=>{var g=c(4239),m=c(7005);a.exports=function(v){return typeof v=="symbol"||m(v)&&g(v)=="[object Symbol]"}},6719:(a,l,c)=>{var g=c(8749),m=c(1717),v=c(1167),x=v&&v.isTypedArray,P=x?m(x):g;a.exports=P},1704:(a,l,c)=>{var g=c(4636),m=c(313),v=c(8612);a.exports=function(x){return v(x)?g(x,!0):m(x)}},8306:(a,l,c)=>{var g=c(3369);function m(v,x){if(typeof v!="function"||x!=null&&typeof x!="function")throw new TypeError("Expected a function");var P=function(){var T=arguments,N=x?x.apply(this,T):T[0],q=P.cache;if(q.has(N))return q.get(N);var z=v.apply(this,T);return P.cache=q.set(N,z)||q,z};return P.cache=new(m.Cache||g),P}m.Cache=g,a.exports=m},2492:(a,l,c)=>{var g=c(2980),m=c(1463)(function(v,x,P){g(v,x,P)});a.exports=m},5062:a=>{a.exports=function(){return!1}},9881:(a,l,c)=>{var g=c(8363),m=c(1704);a.exports=function(v){return g(v,m(v))}},9833:(a,l,c)=>{var g=c(531);a.exports=function(m){return m==null?"":g(m)}},2676:function(a){a.exports=function(){"use strict";function l(C,b){if(!(C instanceof b))throw new TypeError("Cannot call a class as a function")}function c(C,b){for(var k=0;kb?1:C0)||b.right===null||k(C,b.right.key)>0&&(pt=b.right,b.right=pt.left,pt.left=b,(b=pt).right===null))break;Z.right=b,Z=b,b=b.right}}return Z.right=b.left,J.left=b.right,b.left=F.right,b.right=F.left,b}function P(C,b,k,F){var Z=new m(C,b);if(k===null)return Z.left=Z.right=null,Z;var J=F(C,(k=x(C,k,F)).key);return J<0?(Z.left=k.left,Z.right=k,k.left=null):J>=0&&(Z.right=k.right,Z.left=k,k.right=null),Z}function T(C,b,k){var F=null,Z=null;if(b){var J=k((b=x(C,b,k)).key,C);J===0?(F=b.left,Z=b.right):J<0?(Z=b.right,b.right=null,F=b):(F=b.left,b.left=null,Z=b)}return{left:F,right:Z}}function N(C,b,k){return b===null?C:(C===null||((b=x(C.key,b,k)).left=C),b)}function q(C,b,k,F,Z){if(C){F(b+(k?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ")+Z(C)+` -`);var J=b+(k?" ":"\u2502 ");C.left&&q(C.left,J,!1,F,Z),C.right&&q(C.right,J,!0,F,Z)}}var z=function(){function C(b){b===void 0&&(b=v),this._root=null,this._size=0,this._comparator=b}return C.prototype.insert=function(b,k){return this._size++,this._root=P(b,k,this._root,this._comparator)},C.prototype.add=function(b,k){var F=new m(b,k);this._root===null&&(F.left=F.right=null,this._size++,this._root=F);var Z=this._comparator,J=x(b,this._root,Z),tt=Z(b,J.key);return tt===0?this._root=J:(tt<0?(F.left=J.left,F.right=J,J.left=null):tt>0&&(F.right=J.right,F.left=J,J.right=null),this._size++,this._root=F),this._root},C.prototype.remove=function(b){this._root=this._remove(b,this._root,this._comparator)},C.prototype._remove=function(b,k,F){var Z;return k===null?null:F(b,(k=x(b,k,F)).key)===0?(k.left===null?Z=k.right:(Z=x(b,k.left,F)).right=k.right,this._size--,Z):k},C.prototype.pop=function(){var b=this._root;if(b){for(;b.left;)b=b.left;return this._root=x(b.key,this._root,this._comparator),this._root=this._remove(b.key,this._root,this._comparator),{key:b.key,data:b.data}}return null},C.prototype.findStatic=function(b){for(var k=this._root,F=this._comparator;k;){var Z=F(b,k.key);if(Z===0)return k;k=Z<0?k.left:k.right}return null},C.prototype.find=function(b){return this._root&&(this._root=x(b,this._root,this._comparator),this._comparator(b,this._root.key)!==0)?null:this._root},C.prototype.contains=function(b){for(var k=this._root,F=this._comparator;k;){var Z=F(b,k.key);if(Z===0)return!0;k=Z<0?k.left:k.right}return!1},C.prototype.forEach=function(b,k){for(var F=this._root,Z=[],J=!1;!J;)F!==null?(Z.push(F),F=F.left):Z.length!==0?(F=Z.pop(),b.call(k,F),F=F.right):J=!0;return this},C.prototype.range=function(b,k,F,Z){for(var J=[],tt=this._comparator,pt=this._root;J.length!==0||pt;)if(pt)J.push(pt),pt=pt.left;else{if(tt((pt=J.pop()).key,k)>0)break;if(tt(pt.key,b)>=0&&F.call(Z,pt))return this;pt=pt.right}return this},C.prototype.keys=function(){var b=[];return this.forEach(function(k){var F=k.key;return b.push(F)}),b},C.prototype.values=function(){var b=[];return this.forEach(function(k){var F=k.data;return b.push(F)}),b},C.prototype.min=function(){return this._root?this.minNode(this._root).key:null},C.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},C.prototype.minNode=function(b){if(b===void 0&&(b=this._root),b)for(;b.left;)b=b.left;return b},C.prototype.maxNode=function(b){if(b===void 0&&(b=this._root),b)for(;b.right;)b=b.right;return b},C.prototype.at=function(b){for(var k=this._root,F=!1,Z=0,J=[];!F;)if(k)J.push(k),k=k.left;else if(J.length>0){if(k=J.pop(),Z===b)return k;Z++,k=k.right}else F=!0;return null},C.prototype.next=function(b){var k=this._root,F=null;if(b.right){for(F=b.right;F.left;)F=F.left;return F}for(var Z=this._comparator;k;){var J=Z(b.key,k.key);if(J===0)break;J<0?(F=k,k=k.left):k=k.right}return F},C.prototype.prev=function(b){var k=this._root,F=null;if(b.left!==null){for(F=b.left;F.right;)F=F.right;return F}for(var Z=this._comparator;k;){var J=Z(b.key,k.key);if(J===0)break;J<0?k=k.left:(F=k,k=k.right)}return F},C.prototype.clear=function(){return this._root=null,this._size=0,this},C.prototype.toList=function(){return B(this._root)},C.prototype.load=function(b,k,F){k===void 0&&(k=[]),F===void 0&&(F=!1);var Z=b.length,J=this._comparator;if(F&&G(b,k,0,Z-1,J),this._root===null)this._root=j(b,k,0,Z),this._size=Z;else{var tt=A(this.toList(),R(b,k),J);Z=this._size+Z,this._root=D({head:tt},0,Z)}return this},C.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(C.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(C.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),C.prototype.toString=function(b){b===void 0&&(b=function(F){return String(F.key)});var k=[];return q(this._root,"",!0,function(F){return k.push(F)},b),k.join("")},C.prototype.update=function(b,k,F){var Z=this._comparator,J=T(b,this._root,Z),tt=J.left,pt=J.right;Z(b,k)<0?pt=P(k,F,pt,Z):tt=P(k,F,tt,Z),this._root=N(tt,pt,Z)},C.prototype.split=function(b){return T(b,this._root,this._comparator)},C}();function j(C,b,k,F){var Z=F-k;if(Z>0){var J=k+Math.floor(Z/2),tt=C[J],pt=b[J],Lt=new m(tt,pt);return Lt.left=j(C,b,k,J),Lt.right=j(C,b,J+1,F),Lt}return null}function R(C,b){for(var k=new m(null,null),F=k,Z=0;Z0?b=(b=J=J.next=k.pop()).right:F=!0;return J.next=null,Z.next}function D(C,b,k){var F=k-b;if(F>0){var Z=b+Math.floor(F/2),J=D(C,b,Z),tt=C.head;return tt.left=J,C.head=C.head.next,tt.right=D(C,Z+1,k),tt}return null}function A(C,b,k){for(var F=new m(null,null),Z=F,J=C,tt=b;J!==null&&tt!==null;)k(J.key,tt.key)<0?(Z.next=J,J=J.next):(Z.next=tt,tt=tt.next),Z=Z.next;return J!==null?Z.next=J:tt!==null&&(Z.next=tt),F.next}function G(C,b,k,F,Z){if(!(k>=F)){for(var J=C[k+F>>1],tt=k-1,pt=F+1;;){do tt++;while(Z(C[tt],J)<0);do pt--;while(Z(C[pt],J)>0);if(tt>=pt)break;var Lt=C[tt];C[tt]=C[pt],C[pt]=Lt,Lt=b[tt],b[tt]=b[pt],b[pt]=Lt}G(C,b,k,pt,Z),G(C,b,pt+1,F,Z)}}var H=function(C,b){return C.ll.x<=b.x&&b.x<=C.ur.x&&C.ll.y<=b.y&&b.y<=C.ur.y},K=function(C,b){if(b.ur.xk.x?1:b.yk.y?1:0}}]),g(C,[{key:"link",value:function(b){if(b.point===this.point)throw new Error("Tried to link already linked events");for(var k=b.point.events,F=0,Z=k.length;F=0&&Wt>=0?vtJt?-1:0:Lt<0&&Wt<0?vtJt?1:0:WtLt?1:0}}}]),C}(),Qt=0,Tt=function(){function C(b,k,F,Z){l(this,C),this.id=++Qt,this.leftSE=b,b.segment=this,b.otherSE=k,this.rightSE=k,k.segment=this,k.otherSE=b,this.rings=F,this.windings=Z}return g(C,null,[{key:"compare",value:function(b,k){var F=b.leftSE.point.x,Z=k.leftSE.point.x,J=b.rightSE.point.x,tt=k.rightSE.point.x;if(ttpt&&Lt>vt)return-1;var Wt=b.comparePoint(k.leftSE.point);if(Wt<0)return 1;if(Wt>0)return-1;var Jt=k.comparePoint(b.rightSE.point);return Jt!==0?Jt:-1}if(F>Z){if(ptLt&&pt>Ft)return 1;var $t=k.comparePoint(b.leftSE.point);if($t!==0)return $t;var jt=b.comparePoint(k.rightSE.point);return jt<0?1:jt>0?-1:1}if(ptLt)return 1;if(Jtt){var pe=b.comparePoint(k.rightSE.point);if(pe<0)return 1;if(pe>0)return-1}if(J!==tt){var Te=vt-pt,Ce=J-F,he=Ft-Lt,An=tt-Z;if(Te>Ce&&heAn)return-1}return J>tt?1:JFt?1:b.idk.id?1:0}}]),g(C,[{key:"replaceRightSE",value:function(b){this.rightSE=b,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var b=this.leftSE.point.y,k=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:bk?b:k}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(b){return b.x===this.leftSE.point.x&&b.y===this.leftSE.point.y||b.x===this.rightSE.point.x&&b.y===this.rightSE.point.y}},{key:"comparePoint",value:function(b){if(this.isAnEndpoint(b))return 0;var k=this.leftSE.point,F=this.rightSE.point,Z=this.vector();if(k.x===F.x)return b.x===k.x?0:b.x0&&pt.swapEvents(),Ot.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),F&&(Z.checkForConsuming(),J.checkForConsuming()),k}},{key:"swapEvents",value:function(){var b=this.rightSE;this.rightSE=this.leftSE,this.leftSE=b,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var k=0,F=this.windings.length;k0){var J=k;k=F,F=J}if(k.prev===F){var tt=k;k=F,F=tt}for(var pt=0,Lt=F.rings.length;pt0))throw new Error("Tried to create degenerate segment at [".concat(b.x,", ").concat(b.y,"]"));Z=k,J=b,tt=-1}return new C(new Ot(Z,!0),new Ot(J,!1),[F],[tt])}}]),C}(),ce=function(){function C(b,k,F){if(l(this,C),!Array.isArray(b)||b.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=k,this.isExterior=F,this.segments=[],typeof b[0][0]!="number"||typeof b[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var Z=Q.round(b[0][0],b[0][1]);this.bbox={ll:{x:Z.x,y:Z.y},ur:{x:Z.x,y:Z.y}};for(var J=Z,tt=1,pt=b.length;ttthis.bbox.ur.x&&(this.bbox.ur.x=Lt.x),Lt.y>this.bbox.ur.y&&(this.bbox.ur.y=Lt.y),J=Lt)}Z.x===J.x&&Z.y===J.y||this.segments.push(Tt.fromRing(J,Z,this))}return g(C,[{key:"getSweepEvents",value:function(){for(var b=[],k=0,F=this.segments.length;kthis.bbox.ur.x&&(this.bbox.ur.x=J.bbox.ur.x),J.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=J.bbox.ur.y),this.interiorRings.push(J)}this.multiPoly=k}return g(C,[{key:"getSweepEvents",value:function(){for(var b=this.exteriorRing.getSweepEvents(),k=0,F=this.interiorRings.length;kthis.bbox.ur.x&&(this.bbox.ur.x=J.bbox.ur.x),J.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=J.bbox.ur.y),this.polys.push(J)}this.isSubject=k}return g(C,[{key:"getSweepEvents",value:function(){for(var b=[],k=0,F=this.polys.length;k0&&(b=Z)}for(var J=b.segment.prevInResult(),tt=J?J.prevInResult():null;;){if(!J)return null;if(!tt)return J.ringOut;if(tt.ringOut!==J.ringOut)return tt.ringOut.enclosingRing()!==J.ringOut?J.ringOut:J.ringOut.enclosingRing();J=tt.prevInResult(),tt=J?J.prevInResult():null}}}]),C}(),ke=function(){function C(b){l(this,C),this.exteriorRing=b,b.poly=this,this.interiorRings=[]}return g(C,[{key:"addInterior",value:function(b){this.interiorRings.push(b),b.poly=this}},{key:"getGeom",value:function(){var b=[this.exteriorRing.getGeom()];if(b[0]===null)return null;for(var k=0,F=this.interiorRings.length;k1&&arguments[1]!==void 0?arguments[1]:Tt.compare;l(this,C),this.queue=b,this.tree=new z(k),this.segments=[]}return g(C,[{key:"process",value:function(b){var k=b.segment,F=[];if(b.consumedBy)return b.isLeft?this.queue.remove(b.otherSE):this.tree.remove(k),F;var Z=b.isLeft?this.tree.insert(k):this.tree.find(k);if(!Z)throw new Error("Unable to find segment #".concat(k.id," ")+"[".concat(k.leftSE.point.x,", ").concat(k.leftSE.point.y,"] -> ")+"[".concat(k.rightSE.point.x,", ").concat(k.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var J=Z,tt=Z,pt=void 0,Lt=void 0;pt===void 0;)(J=this.tree.prev(J))===null?pt=null:J.key.consumedBy===void 0&&(pt=J.key);for(;Lt===void 0;)(tt=this.tree.next(tt))===null?Lt=null:tt.key.consumedBy===void 0&&(Lt=tt.key);if(b.isLeft){var vt=null;if(pt){var Ft=pt.getIntersection(k);if(Ft!==null&&(k.isAnEndpoint(Ft)||(vt=Ft),!pt.isAnEndpoint(Ft)))for(var Wt=this._splitSafely(pt,Ft),Jt=0,$t=Wt.length;Jt<$t;Jt++)F.push(Wt[Jt])}var jt=null;if(Lt){var ge=Lt.getIntersection(k);if(ge!==null&&(k.isAnEndpoint(ge)||(jt=ge),!Lt.isAnEndpoint(ge)))for(var pe=this._splitSafely(Lt,ge),Te=0,Ce=pe.length;Te0?(this.tree.remove(k),F.push(b)):(this.segments.push(k),k.prev=pt)}else{if(pt&&Lt){var Dn=pt.getIntersection(Lt);if(Dn!==null){if(!pt.isAnEndpoint(Dn))for(var Xn=this._splitSafely(pt,Dn),re=0,Vr=Xn.length;reSn)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var An=new hn(jt),we=jt.size,St=jt.pop();St;){var Dn=St.key;if(jt.size===we){var Xn=Dn.segment;throw new Error("Unable to pop() ".concat(Dn.isLeft?"left":"right"," SweepEvent ")+"[".concat(Dn.point.x,", ").concat(Dn.point.y,"] from segment #").concat(Xn.id," ")+"[".concat(Xn.leftSE.point.x,", ").concat(Xn.leftSE.point.y,"] -> ")+"[".concat(Xn.rightSE.point.x,", ").concat(Xn.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(jt.size>Sn)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(An.segments.length>Hn)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var re=An.process(Dn),Vr=0,zn=re.length;Vr1?b-1:0),F=1;F1?b-1:0),F=1;F1?b-1:0),F=1;F1?b-1:0),F=1;FQ;){if(kt-Q>600){var bt=kt-Q+1,Mt=Et-Q+1,Xt=Math.log(bt),ft=.5*Math.exp(2*Xt/3),Ct=.5*Math.sqrt(Xt*ft*(bt-ft)/bt)*(Mt-bt/2<0?-1:1);lt(gt,Et,Math.max(Q,Math.floor(Et-Mt*ft/bt+Ct)),Math.min(kt,Math.floor(Et+(bt-Mt)*ft/bt+Ct)),ct)}var st=gt[Et],Rt=Q,Ot=kt;for(c(gt,Q,Et),ct(gt[kt],st)>0&&c(gt,Q,kt);Rt0;)Ot--}ct(gt[Q],st)===0?c(gt,Q,Ot):c(gt,++Ot,kt),Ot<=Et&&(Q=Ot+1),Et<=Ot&&(kt=Ot-1)}})(G,H,K||0,et||G.length-1,X||g)}function c(G,H,K){var et=G[H];G[H]=G[K],G[K]=et}function g(G,H){return GH?1:0}var m=function(G){G===void 0&&(G=9),this._maxEntries=Math.max(4,G),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function v(G,H,K){if(!K)return H.indexOf(G);for(var et=0;et=G.minX&&H.maxY>=G.minY}function D(G){return{children:G,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function A(G,H,K,et,X){for(var lt=[H,K];lt.length;)if(!((K=lt.pop())-(H=lt.pop())<=et)){var gt=H+Math.ceil((K-H)/et/2)*et;l(G,gt,H,K,X),lt.push(H,gt,gt,K)}}return m.prototype.all=function(){return this._all(this.data,[])},m.prototype.search=function(G){var H=this.data,K=[];if(!B(G,H))return K;for(var et=this.toBBox,X=[];H;){for(var lt=0;lt=0&&X[H].children.length>this._maxEntries;)this._split(X,H),H--;this._adjustParentBBoxes(et,X,H)},m.prototype._split=function(G,H){var K=G[H],et=K.children.length,X=this._minEntries;this._chooseSplitAxis(K,X,et);var lt=this._chooseSplitIndex(K,X,et),gt=D(K.children.splice(lt,K.children.length-lt));gt.height=K.height,gt.leaf=K.leaf,x(K,this.toBBox),x(gt,this.toBBox),H?G[H-1].children.push(gt):this._splitRoot(K,gt)},m.prototype._splitRoot=function(G,H){this.data=D([G,H]),this.data.height=G.height+1,this.data.leaf=!1,x(this.data,this.toBBox)},m.prototype._chooseSplitIndex=function(G,H,K){for(var et,X,lt,gt,Et,Q,kt,ct=1/0,bt=1/0,Mt=H;Mt<=K-H;Mt++){var Xt=P(G,0,Mt,this.toBBox),ft=P(G,Mt,K,this.toBBox),Ct=(X=Xt,lt=ft,gt=void 0,Et=void 0,Q=void 0,kt=void 0,gt=Math.max(X.minX,lt.minX),Et=Math.max(X.minY,lt.minY),Q=Math.min(X.maxX,lt.maxX),kt=Math.min(X.maxY,lt.maxY),Math.max(0,Q-gt)*Math.max(0,kt-Et)),st=z(Xt)+z(ft);Ct=H;ct--){var bt=G.children[ct];T(gt,G.leaf?X(bt):bt),Et+=j(gt)}return Et},m.prototype._adjustParentBBoxes=function(G,H,K){for(var et=K;et>=0;et--)T(H[et],G)},m.prototype._condense=function(G){for(var H=G.length-1,K=void 0;H>=0;H--)G[H].children.length===0?H>0?(K=G[H-1].children).splice(K.indexOf(G[H]),1):this.clear():x(G[H],this.toBBox)},m}()}},n={};function s(a){var l=n[a];if(l!==void 0)return l.exports;var c=n[a]={id:a,loaded:!1,exports:{}};return r[a].call(c.exports,c,c.exports,s),c.loaded=!0,c.exports}s.n=a=>{var l=a&&a.__esModule?()=>a.default:()=>a;return s.d(l,{a:l}),l},s.d=(a,l)=>{for(var c in l)s.o(l,c)&&!s.o(a,c)&&Object.defineProperty(a,c,{enumerable:!0,get:l[c]})},s.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),s.o=(a,l)=>Object.prototype.hasOwnProperty.call(a,l),s.nmd=a=>(a.paths=[],a.children||(a.children=[]),a),s(5975)})();var sh=On(Oo()),qu=32,Cf=qu*.5,l_=sh.default.Icon.extend({options:{iconSize:[qu,qu],iconAnchor:[Cf,Cf],popupAnchor:[0,-qu*.25]}}),ah=async(r,n)=>{let s=await(await fetch(`./data/bl24/poi/${r}`)).json(),a={};for(let l of s.features){let{name:c,description:g,category:m,link:v}=l.properties,x=l.geometry.coordinates[0],P=l.geometry.coordinates[1];if(a[m]||(a[m]=new l_({iconUrl:"./img/icons/"+m+".png"})),v&&g){let N=v[0]!="#"?'target="_blank':"";g=`${g}`}let T=`

${c}

${g}

`;sh.default.marker([P,x],{icon:a[m]}).addTo(n).bindPopup(T)}};var ju=On(Oo()),Sf=async r=>{let n=await(await fetch("./data/bl24/labels/quarters.json")).json();Uu(n,r,"white",.001)},kf=async r=>{let n=await(await fetch("./data/bl24/labels/plazas.json")).json();Uu(n,r,"white",.0015)},Tf=async r=>{let n=await(await fetch("./data/bl24/labels/neighbourhoods.json")).json();Uu(n,r,"white",.003);let s=await(await fetch("./data/bl24/labels/non-camp-neighbourhoods.json")).json();Uu(s,r,"white",.003)},Uu=(r,n,s,a)=>{for(let c of r.features){let g=c.properties.size||a,m=c.properties.rotation||0,v=c.properties.name,x=c.geometry.coordinates[0],P=c.geometry.coordinates[1];var l=ju.latLngBounds([[P-g*.5,x-g*.5],[P+g*.5,x+g*.5]]);let T=h_(v,"bradleyHand",s,m);ju.svgOverlay(T,l,{opacity:1,interactive:!1}).addTo(n)}};function h_(r,n,s,a){let l=document.createElementNS("http://www.w3.org/2000/svg","svg");l.setAttribute("xmlns","http://www.w3.org/2000/svg");let c="",g=r.split(` -`);for(let v of g)c+=`${v}`;l.innerHTML=`${c}`,document.body.appendChild(l);let m=l.getBBox();return l.remove(),l.setAttribute("viewBox",`${m.x} ${m.y} ${m.width} ${m.height}`),l}var As=On(Oo()),If=async(r,n,s)=>{let a=As.default.control({position:"bottomright"});a.onAdd=function(g){var m=As.default.DomUtil.create("div","legend");return m.innerHTML+='legend',m};let l=As.default.control({position:"bottomright"});l.onAdd=function(g){var m=As.default.DomUtil.create("div","legend");return m.innerHTML+='legend',m};let c=As.default.control({position:"bottomright"});c.onAdd=function(g){var m=As.default.DomUtil.create("div","legend");return m.innerHTML+='legend',m},r.on("overlayadd",function(g){switch(g.name){case"Slope":a.addTo(r);break;case"Height":l.addTo(r);break;case"Soundguide":c.addTo(r);break}}),r.on("overlayremove",function(g){switch(g.name){case"Slope":r.removeControl(a);break;case"Height":r.removeControl(l);break;case"Soundguide":r.removeControl(c);break}}),As.default.control.layers(void 0,n,{position:"bottomright"}).addTo(r),s.has("Slope")&&a.addTo(r),s.has("Height")&&l.addTo(r),s.has("Soundguide")&&c.addTo(r)};var Nf=On(Oo());function Of(r){return function(){let n={opacity:1,fillOpacity:0,weight:1.5,dashArray:"5"};switch(r){case"container":return{...n,fillOpacity:1,color:"#c3c3c3",weight:0};case"naturereserve":return{...n,color:"#00b521",weight:3};case"propertyborder":return{...n,color:"#e77409",weight:1};case"friends":return{...n,color:"turquoise"};case"forbidden":return{...n,color:"red",fillOpacity:.5};case"toilet":return{...n,color:"skyblue",fillOpacity:1,dashArray:"0"};case"bridge":return{...n,color:"brown",fillOpacity:1};case"oktocamp":case"publicplease":case"parking":return{...n,color:"lightblue",fillOpacity:0};case"slope":return{...n,fillOpacity:0,opacity:0};case"fireroad":return{...n,weight:1.5,dashArray:"2",color:"#f05039",fillOpacity:.15};case"plaza":return{...n,weight:2,dashArray:"4",color:"white",opacity:.5,fillOpacity:0};case"quarter":return{...n,weight:5,dashArray:"10",color:"white",opacity:.5,fillOpacity:0};case"neighbourhood":return{...n,weight:5,dashArray:"10",color:"white",opacity:.5,fillOpacity:0};case"minorroad":return{...n,weight:1,dashArray:"20",color:"black",opacity:.5,fillOpacity:0};case"area":return{dashArray:"5",color:"#e7e309",fillOpacity:0,weight:2};case"hiddenforbidden":return{color:"black",fillOpacity:1,weight:0};case"redsoundzone":return{...n,color:"#b60d0d",fillOpacity:.75,weight:0};case"orangesoundzone":return{...n,color:"#ff6f16",fillOpacity:.75,weight:0};case"yellowsoundzone":return{...n,color:"#f4e512",fillOpacity:.75,weight:0};case"closetosanctuary":case"greensoundzone":return{...n,color:"#00e300",fillOpacity:.75,weight:0};case"bluesoundzone":return{...n,color:"#29b6f3",fillOpacity:.75,weight:0};default:return{...n,color:"black"}}}}var fa=async(r,n,s)=>{let l=await(await fetch(s)).json();new Set(l.features.map(g=>g.properties[n])).forEach(g=>{let m=Nf.default.geoJSON(l,{filter:c_(n,g),style:Of(g)});r.groups[g]=m})};function c_(r,n){return function(s){return s.properties[r]===n}}var uh=On(Oo()),Rf=async(r,n,s)=>{var a=uh.default.latLngBounds(s),l=uh.default.imageOverlay(n,a,{opacity:1,interactive:!1});return l};var pa=null,lh=null,hh=null,da=null,f_=new Promise(async r=>{await Promise.allSettled([customElements.whenDefined("sl-drawer")]);let n=document.getElementById("drawer"),s=document.getElementById("drawer-button");n.addEventListener("sl-request-close",a=>{n.placement!="end"&&a.detail.source==="overlay"&&a.preventDefault()}),n.addEventListener("sl-after-hide",a=>{hh&&hh(),lh&&lh(),pa&&(pa=null),ss.page=void 0}),s.addEventListener("click",()=>{da&&da()}),r(n)});async function Af(r){for(let n=0;n{hh=r.onClose||null,lh=s,da=null;let a=await f_;a.placement=r.position||"bottom";let l=a.querySelector(".container");l.innerHTML="";let g=await(await fetch(`drawers/${r.file}.html`)).text();r.file.indexOf("home")>-1&&(r.keepOpen=!0);let m=document.createElement("div");m.innerHTML=g;for(let x of Array.from(m.children))l.appendChild(x);let v=document.getElementById("drawer-button");if(n.keepOpen)v.innerHTML="Continue",da=s;else if(pa&&pa.keepOpen){let x={...pa};v.innerHTML="Back",da=async()=>{await os(x),s()}}else v.innerHTML="Close",da=()=>a.hide();r.btn&&(v.innerHTML=r.btn),ss.page=r.file,pa=r,a.show()})}var hw=document.querySelector(".alert-toast-wrapper");async function No(r,n="primary",s="info-circle",a=3e3){let l=Object.assign(document.createElement("sl-alert"),{variant:n,closable:!0,duration:a,innerHTML:` +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function ui(h,p){(p==null||p>h.length)&&(p=h.length);for(var _=0,E=new Array(p);_1?ft()(I,rt):I,dt=nt.length>1?ft()(this._markers,rt):this._markers;ot.splice(it+1,0,E),dt.splice(it+1,0,h),this._layer.setLatLngs(I),this.options.hideMiddleMarkers!==!0&&(this._createMiddleMarker(p,h),this._createMiddleMarker(h,_)),this._fireEdit(),this._layerEdited=!0,this._fireChange(this._layer.getLatLngs(),"Edit"),this._fireVertexAdded(h,L.PM.Utils.findDeepMarkerIndex(this._markers,h).indexPath,E),this.options.snappable&&this._initSnappableMarkers()},hasSelfIntersection:function(){return pe(this._layer.toGeoJSON(15)).features.length>0},_handleSelfIntersectionOnVertexRemoval:function(){this._handleLayerStyle(!0),this.hasSelfIntersection()&&(this._layer.setLatLngs(this._coordsBeforeEdit),this._coordsBeforeEdit=null,this._initMarkers())},_handleLayerStyle:function(h){var p=this._layer;if(this.hasSelfIntersection()){if(!this.options.allowSelfIntersection&&this.options.allowSelfIntersectionEdit&&this._updateDisabledMarkerStyle(this._markers,!0),this.isRed)return;h?this._flashLayer():(p.setStyle({color:"#f00000ff"}),this.isRed=!0),this._fireIntersect(pe(this._layer.toGeoJSON(15)))}else p.setStyle({color:this.cachedColor}),this.isRed=!1,!this.options.allowSelfIntersection&&this.options.allowSelfIntersectionEdit&&this._updateDisabledMarkerStyle(this._markers,!1)},_flashLayer:function(){var h=this;this.cachedColor||(this.cachedColor=this._layer.options.color),this._layer.setStyle({color:"#f00000ff"}),this.isRed=!0,window.setTimeout(function(){h._layer.setStyle({color:h.cachedColor}),h.isRed=!1},200)},_updateDisabledMarkerStyle:function(h,p){var _=this;h.forEach(function(E){Array.isArray(E)?_._updateDisabledMarkerStyle(E,p):E._icon&&(p&&!_._checkMarkerAllowedToDrag(E)?L.DomUtil.addClass(E._icon,"vertexmarker-disabled"):L.DomUtil.removeClass(E._icon,"vertexmarker-disabled"))})},_removeMarker:function(h){var p=h.target;if(this._vertexValidation("remove",h)){this.options.allowSelfIntersection||(this._coordsBeforeEdit=fe(this._layer,this._layer.getLatLngs()));var _=this._layer.getLatLngs(),E=L.PM.Utils.findDeepMarkerIndex(this._markers,p),I=E.indexPath,V=E.index,nt=E.parentPath;if(I){var it=I.length>1?ft()(_,nt):_,rt=I.length>1?ft()(this._markers,nt):this._markers;if(this.options.removeLayerBelowMinVertexCount||!(it.length<=2||this.isPolygon()&&it.length<=3)){it.splice(V,1),this._layer.setLatLngs(_),this.isPolygon()&&it.length<=2&&it.splice(0,it.length);var ot=!1;if(it.length<=1&&(it.splice(0,it.length),nt.length>1&&I.length>1&&(_=Qt(_)),this._layer.setLatLngs(_),this._initMarkers(),ot=!0),Ot(_)||this._layer.remove(),_=Qt(_),this._layer.setLatLngs(_),this._markers=Qt(this._markers),!ot&&(rt=I.length>1?ft()(this._markers,nt):this._markers,p._middleMarkerPrev&&this._markerGroup.removeLayer(p._middleMarkerPrev),p._middleMarkerNext&&this._markerGroup.removeLayer(p._middleMarkerNext),this._markerGroup.removeLayer(p),rt)){var dt,Pt;if(this.isPolygon()?(dt=(V+1)%rt.length,Pt=(V+(rt.length-1))%rt.length):(Pt=V-1<0?void 0:V-1,dt=V+1>=rt.length?void 0:V+1),dt!==Pt){var yt=rt[Pt],At=rt[dt];this.options.hideMiddleMarkers!==!0&&this._createMiddleMarker(yt,At)}rt.splice(V,1)}this._fireEdit(),this._layerEdited=!0,this._fireVertexRemoved(p,I),this._fireChange(this._layer.getLatLngs(),"Edit")}else this._flashLayer()}}},updatePolygonCoordsFromMarkerDrag:function(h){var p=this._layer.getLatLngs(),_=h.getLatLng(),E=L.PM.Utils.findDeepMarkerIndex(this._markers,h),I=E.indexPath,V=E.index,nt=E.parentPath;(I.length>1?ft()(p,nt):p).splice(V,1,_),this._layer.setLatLngs(p)},_getNeighborMarkers:function(h){var p=L.PM.Utils.findDeepMarkerIndex(this._markers,h),_=p.indexPath,E=p.index,I=p.parentPath,V=_.length>1?ft()(this._markers,I):this._markers,nt=(E+1)%V.length;return{prevMarker:V[(E+(V.length-1))%V.length],nextMarker:V[nt]}},_checkMarkerAllowedToDrag:function(h){var p=this._getNeighborMarkers(h),_=p.prevMarker,E=p.nextMarker,I=L.polyline([_.getLatLng(),h.getLatLng()]),V=L.polyline([h.getLatLng(),E.getLatLng()]),nt=Kn(this._layer.toGeoJSON(15),I.toGeoJSON(15)).features.length,it=Kn(this._layer.toGeoJSON(15),V.toGeoJSON(15)).features.length;return h.getLatLng()===this._markers[0][0].getLatLng()?it+=1:h.getLatLng()===this._markers[0][this._markers[0].length-1].getLatLng()&&(nt+=1),!(nt<=2&&it<=2)},_onMarkerDragStart:function(h){var p=h.target;if(this.cachedColor||(this.cachedColor=this._layer.options.color),this._vertexValidation("move",h)){var _=L.PM.Utils.findDeepMarkerIndex(this._markers,p).indexPath;this._fireMarkerDragStart(h,_),this.options.allowSelfIntersection||(this._coordsBeforeEdit=fe(this._layer,this._layer.getLatLngs())),!this.options.allowSelfIntersection&&this.options.allowSelfIntersectionEdit&&this.hasSelfIntersection()?this._markerAllowedToDrag=this._checkMarkerAllowedToDrag(p):this._markerAllowedToDrag=null}},_onMarkerDrag:function(h){var p=h.target;if(this._vertexValidationDrag(p)){var _=L.PM.Utils.findDeepMarkerIndex(this._markers,p),E=_.indexPath,I=_.index,V=_.parentPath;if(E){if(!this.options.allowSelfIntersection&&this.options.allowSelfIntersectionEdit&&this.hasSelfIntersection()&&this._markerAllowedToDrag===!1)return this._layer.setLatLngs(this._coordsBeforeEdit),this._initMarkers(),void this._handleLayerStyle();this.updatePolygonCoordsFromMarkerDrag(p);var nt=E.length>1?ft()(this._markers,V):this._markers,it=(I+1)%nt.length,rt=(I+(nt.length-1))%nt.length,ot=p.getLatLng(),dt=nt[rt].getLatLng(),Pt=nt[it].getLatLng();if(p._middleMarkerNext){var yt=L.PM.Utils.calcMiddleLatLng(this._map,ot,Pt);p._middleMarkerNext.setLatLng(yt)}if(p._middleMarkerPrev){var At=L.PM.Utils.calcMiddleLatLng(this._map,ot,dt);p._middleMarkerPrev.setLatLng(At)}this.options.allowSelfIntersection||this._handleLayerStyle(),this._fireMarkerDrag(h,E),this._fireChange(this._layer.getLatLngs(),"Edit")}}},_onMarkerDragEnd:function(h){var p=h.target;if(this._vertexValidationDragEnd(p)){var _=L.PM.Utils.findDeepMarkerIndex(this._markers,p).indexPath,E=this.hasSelfIntersection();E&&this.options.allowSelfIntersectionEdit&&this._markerAllowedToDrag&&(E=!1);var I=!this.options.allowSelfIntersection&&E;if(this._fireMarkerDragEnd(h,_,I),I)return this._layer.setLatLngs(this._coordsBeforeEdit),this._coordsBeforeEdit=null,this._initMarkers(),this.options.snappable&&this._initSnappableMarkers(),this._handleLayerStyle(),void this._fireLayerReset(h,_);!this.options.allowSelfIntersection&&this.options.allowSelfIntersectionEdit&&this._handleLayerStyle(),this._fireEdit(),this._layerEdited=!0,this._fireChange(this._layer.getLatLngs(),"Edit")}},_onVertexClick:function(h){var p=h.target;if(!p._dragging){var _=L.PM.Utils.findDeepMarkerIndex(this._markers,p).indexPath;this._fireVertexClick(h,_)}}}),fn.Polygon=fn.Line.extend({_shape:"Polygon",_checkMarkerAllowedToDrag:function(h){var p=this._getNeighborMarkers(h),_=p.prevMarker,E=p.nextMarker,I=L.polyline([_.getLatLng(),h.getLatLng()]),V=L.polyline([h.getLatLng(),E.getLatLng()]),nt=Kn(this._layer.toGeoJSON(15),I.toGeoJSON(15)).features.length,it=Kn(this._layer.toGeoJSON(15),V.toGeoJSON(15)).features.length;return!(nt<=2&&it<=2)}}),fn.Rectangle=fn.Polygon.extend({_shape:"Rectangle",_initMarkers:function(){var h=this,p=this._map,_=this._findCorners();this._markerGroup&&this._markerGroup.clearLayers(),this._markerGroup=new L.FeatureGroup,this._markerGroup._pmTempLayer=!0,p.addLayer(this._markerGroup),this._markers=[],this._markers[0]=_.map(this._createMarker,this);var E=Ae(this._markers,1);this._cornerMarkers=E[0],this._layer.getLatLngs()[0].forEach(function(I,V){var nt=h._cornerMarkers.find(function(it){return it._index===V});nt&&nt.setLatLng(I)})},applyOptions:function(){this.options.snappable?this._initSnappableMarkers():this._disableSnapping(),this._addMarkerEvents()},_createMarker:function(h,p){var _=new L.Marker(h,{draggable:!0,icon:L.divIcon({className:"marker-icon"})});return this._setPane(_,"vertexPane"),_._origLatLng=h,_._index=p,_._pmTempLayer=!0,this._markerGroup.addLayer(_),_},_addMarkerEvents:function(){var h=this;this._markers[0].forEach(function(p){p.on("dragstart",h._onMarkerDragStart,h),p.on("drag",h._onMarkerDrag,h),p.on("dragend",h._onMarkerDragEnd,h),h.options.preventMarkerRemoval||p.on("contextmenu",h._removeMarker,h)})},_removeMarker:function(){return null},_onMarkerDragStart:function(h){if(this._vertexValidation("move",h)){var p=h.target,_=this._cornerMarkers;p._oppositeCornerLatLng=_.find(function(E){return E._index===(p._index+2)%4}).getLatLng(),p._snapped=!1,this._fireMarkerDragStart(h)}},_onMarkerDrag:function(h){var p=h.target;this._vertexValidationDrag(p)&&p._index!==void 0&&(this._adjustRectangleForMarkerMove(p),this._fireMarkerDrag(h),this._fireChange(this._layer.getLatLngs(),"Edit"))},_onMarkerDragEnd:function(h){var p=h.target;this._vertexValidationDragEnd(p)&&(this._cornerMarkers.forEach(function(_){delete _._oppositeCornerLatLng}),this._fireMarkerDragEnd(h),this._fireEdit(),this._layerEdited=!0,this._fireChange(this._layer.getLatLngs(),"Edit"))},_adjustRectangleForMarkerMove:function(h){L.extend(h._origLatLng,h._latlng);var p=L.PM.Utils._getRotatedRectangle(h.getLatLng(),h._oppositeCornerLatLng,this._angle||0,this._map);this._layer.setLatLngs(p),this._adjustAllMarkers(),this._layer.redraw()},_adjustAllMarkers:function(){var h=this,p=this._layer.getLatLngs()[0];p&&p.length!==4&&p.length>0?(p.forEach(function(_,E){h._cornerMarkers[E].setLatLng(_)}),this._cornerMarkers.slice(p.length).forEach(function(_){_.setLatLng(p[0])})):p&&p.length?this._cornerMarkers.forEach(function(_){_.setLatLng(p[_._index])}):console.error("The layer has no LatLngs")},_findCorners:function(){var h=this._layer.getLatLngs()[0];return L.PM.Utils._getRotatedRectangle(h[0],h[2],this._angle||0,this._map)}}),fn.Circle=fn.extend({_shape:"Circle",initialize:function(h){this._layer=h,this._enabled=!1,this._updateHiddenPolyCircle()},enable:function(h){L.Util.setOptions(this,h),this._map=this._layer._map,this.options.allowEditing?(this.enabled()||this.disable(),this._enabled=!0,this._initMarkers(),this.applyOptions(),this._layer.on("remove",this.disable,this),this._updateHiddenPolyCircle(),this._fireEnable()):this.disable()},disable:function(){if(this.enabled()&&!this._dragging){this._centerMarker.off("dragstart",this._onCircleDragStart,this),this._centerMarker.off("drag",this._onCircleDrag,this),this._centerMarker.off("dragend",this._onCircleDragEnd,this),this._outerMarker.off("drag",this._handleOuterMarkerSnapping,this),this._layer.off("remove",this.disable,this),this._enabled=!1,this._helperLayers.clearLayers();var h=this._layer._path?this._layer._path:this._layer._renderer._container;L.DomUtil.removeClass(h,"leaflet-pm-draggable"),this._layerEdited&&this._fireUpdate(),this._layerEdited=!1,this._fireDisable()}},enabled:function(){return this._enabled},toggleEdit:function(h){this.enabled()?this.disable():this.enable(h)},_initMarkers:function(){var h=this._map;this._helperLayers&&this._helperLayers.clearLayers(),this._helperLayers=new L.FeatureGroup,this._helperLayers._pmTempLayer=!0,this._helperLayers.addTo(h);var p=this._layer.getLatLng(),_=this._layer._radius,E=this._getLatLngOnCircle(p,_);this._centerMarker=this._createCenterMarker(p),this._outerMarker=this._createOuterMarker(E),this._markers=[this._centerMarker,this._outerMarker],this._createHintLine(this._centerMarker,this._outerMarker)},applyOptions:function(){this.options.snappable?(this._initSnappableMarkers(),this._outerMarker.on("drag",this._handleOuterMarkerSnapping,this),this._outerMarker.on("move",this._syncHintLine,this),this._outerMarker.on("move",this._syncCircleRadius,this),this._centerMarker.on("move",this._moveCircle,this)):this._disableSnapping()},_createHintLine:function(h,p){var _=h.getLatLng(),E=p.getLatLng();this._hintline=L.polyline([_,E],this.options.hintlineStyle),this._setPane(this._hintline,"layerPane"),this._hintline._pmTempLayer=!0,this._helperLayers.addLayer(this._hintline)},_createCenterMarker:function(h){var p=this._createMarker(h);return L.DomUtil.addClass(p._icon,"leaflet-pm-draggable"),p.on("drag",this._moveCircle,this),p.on("dragstart",this._onCircleDragStart,this),p.on("drag",this._onCircleDrag,this),p.on("dragend",this._onCircleDragEnd,this),p},_createOuterMarker:function(h){var p=this._createMarker(h);return p.on("drag",this._resizeCircle,this),p},_createMarker:function(h){var p=new L.Marker(h,{draggable:!0,icon:L.divIcon({className:"marker-icon"})});return this._setPane(p,"vertexPane"),p._origLatLng=h,p._pmTempLayer=!0,p.on("dragstart",this._onMarkerDragStart,this),p.on("drag",this._onMarkerDrag,this),p.on("dragend",this._onMarkerDragEnd,this),this._helperLayers.addLayer(p),p},_resizeCircle:function(){this._outerMarker.setLatLng(this._getNewDestinationOfOuterMarker()),this._syncHintLine(),this._syncCircleRadius()},_moveCircle:function(h){if(!h.target._cancelDragEventChain){var p=h.latlng;this._layer.setLatLng(p);var _=this._layer._radius,E=this._getLatLngOnCircle(p,_);this._outerMarker._latlng=E,this._outerMarker.update(),this._syncHintLine(),this._updateHiddenPolyCircle(),this._fireCenterPlaced("Edit"),this._fireChange(this._layer.getLatLng(),"Edit")}},_syncCircleRadius:function(){var h=this._centerMarker.getLatLng(),p=this._outerMarker.getLatLng(),_=this._map.distance(h,p);this.options.minRadiusCircle&&_this.options.maxRadiusCircle?this._layer.setRadius(this.options.maxRadiusCircle):this._layer.setRadius(_),this._updateHiddenPolyCircle(),this._fireChange(this._layer.getLatLng(),"Edit")},_syncHintLine:function(){var h=this._centerMarker.getLatLng(),p=this._outerMarker.getLatLng();this._hintline.setLatLngs([h,p])},_disableSnapping:function(){var h=this;this._markers.forEach(function(p){p.off("move",h._syncHintLine,h),p.off("move",h._syncCircleRadius,h),p.off("drag",h._handleSnapping,h),p.off("dragend",h._cleanupSnapping,h)}),this._layer.off("pm:dragstart",this._unsnap,this)},_onMarkerDragStart:function(h){this._vertexValidation("move",h)&&this._fireMarkerDragStart(h)},_onMarkerDrag:function(h){var p=h.target;this._vertexValidationDrag(p)&&this._fireMarkerDrag(h)},_onMarkerDragEnd:function(h){var p=h.target;this._vertexValidationDragEnd(p)&&(this._fireEdit(),this._layerEdited=!0,this._fireMarkerDragEnd(h))},_onCircleDragStart:function(h){this._vertexValidationDrag(h.target)?(delete this._vertexValidationReset,this._fireDragStart()):this._vertexValidationReset=!0},_onCircleDrag:function(h){this._vertexValidationReset||this._fireDrag(h)},_onCircleDragEnd:function(){this._vertexValidationReset?delete this._vertexValidationReset:this._fireDragEnd()},_updateHiddenPolyCircle:function(){var h=this._map&&this._map.pm._isCRSSimple();this._hiddenPolyCircle?this._hiddenPolyCircle.setLatLngs(L.PM.Utils.circleToPolygon(this._layer,200,!h).getLatLngs()):this._hiddenPolyCircle=L.PM.Utils.circleToPolygon(this._layer,200,!h),this._hiddenPolyCircle._parentCopy||(this._hiddenPolyCircle._parentCopy=this._layer)},_getLatLngOnCircle:function(h,p){var _=this._map.project(h),E=L.point(_.x+p,_.y);return this._map.unproject(E)},_getNewDestinationOfOuterMarker:function(){var h=this._centerMarker.getLatLng(),p=this._outerMarker.getLatLng(),_=this._map.distance(h,p);return this.options.minRadiusCircle&&_this.options.maxRadiusCircle&&(p=Re(this._map,h,p,this.options.maxRadiusCircle)),p},_handleOuterMarkerSnapping:function(){if(this._outerMarker._snapped){var h=this._centerMarker.getLatLng(),p=this._outerMarker.getLatLng(),_=this._map.distance(h,p);(this.options.minRadiusCircle&&_this.options.maxRadiusCircle)&&this._outerMarker.setLatLng(this._outerMarker._orgLatLng)}this._outerMarker.setLatLng(this._getNewDestinationOfOuterMarker())}}),fn.CircleMarker=fn.extend({_shape:"CircleMarker",initialize:function(h){this._layer=h,this._enabled=!1,this._updateHiddenPolyCircle()},enable:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{draggable:!0,snappable:!0};L.Util.setOptions(this,h),this.options.allowEditing&&this._layer._map?(this._map=this._layer._map,this.enabled()&&this.disable(),this.applyOptions(),this._layer.on("remove",this.disable,this),this._enabled=!0,this._layer.on("pm:dragstart",this._onDragStart,this),this._layer.on("pm:drag",this._onMarkerDrag,this),this._layer.on("pm:dragend",this._onMarkerDragEnd,this),this._updateHiddenPolyCircle(),this._fireEnable()):this.disable()},disable:function(){this._dragging||(this._helperLayers&&this._helperLayers.clearLayers(),this._map||(this._map=this._layer._map),this._map||(this.options.editable?(this._map.off("move",this._syncMarkers,this),this._outerMarker&&this._outerMarker.on("drag",this._handleOuterMarkerSnapping,this)):this._map.off("move",this._updateHiddenPolyCircle,this)),this.disableLayerDrag(),this._layer.off("contextmenu",this._removeMarker,this),this._layer.off("remove",this.disable,this),this.enabled()&&(this._layerEdited&&this._fireUpdate(),this._layerEdited=!1,this._fireDisable()),this._enabled=!1)},enabled:function(){return this._enabled},toggleEdit:function(h){this.enabled()?this.disable():this.enable(h)},applyOptions:function(){!this.options.editable&&this.options.draggable?this.enableLayerDrag():this.disableLayerDrag(),this.options.editable?(this._initMarkers(),this._map.on("move",this._syncMarkers,this)):this._map.on("move",this._updateHiddenPolyCircle,this),this.options.snappable?this.options.editable?(this._initSnappableMarkers(),this._centerMarker.on("drag",this._moveCircle,this),this.options.editable&&this._outerMarker.on("drag",this._handleOuterMarkerSnapping,this),this._outerMarker.on("move",this._syncHintLine,this),this._outerMarker.on("move",this._syncCircleRadius,this)):this._initSnappableMarkersDrag():this.options.editable?this._disableSnapping():this._disableSnappingDrag(),this.options.preventMarkerRemoval||this._layer.on("contextmenu",this._removeMarker,this)},_initMarkers:function(){var h=this._map;this._helperLayers&&this._helperLayers.clearLayers(),this._helperLayers=new L.FeatureGroup,this._helperLayers._pmTempLayer=!0,this._helperLayers.addTo(h);var p=this._layer.getLatLng(),_=this._layer._radius,E=this._getLatLngOnCircle(p,_);this._centerMarker=this._createCenterMarker(p),this._outerMarker=this._createOuterMarker(E),this._markers=[this._centerMarker,this._outerMarker],this._createHintLine(this._centerMarker,this._outerMarker)},_getLatLngOnCircle:function(h,p){var _=this._map.project(h),E=L.point(_.x+p,_.y);return this._map.unproject(E)},_createHintLine:function(h,p){var _=h.getLatLng(),E=p.getLatLng();this._hintline=L.polyline([_,E],this.options.hintlineStyle),this._setPane(this._hintline,"layerPane"),this._hintline._pmTempLayer=!0,this._helperLayers.addLayer(this._hintline)},_createCenterMarker:function(h){var p=this._createMarker(h);return this.options.draggable?L.DomUtil.addClass(p._icon,"leaflet-pm-draggable"):p.dragging.disable(),p},_createOuterMarker:function(h){var p=this._createMarker(h);return p.on("drag",this._resizeCircle,this),p},_createMarker:function(h){var p=new L.Marker(h,{draggable:!0,icon:L.divIcon({className:"marker-icon"})});return this._setPane(p,"vertexPane"),p._origLatLng=h,p._pmTempLayer=!0,p.on("dragstart",this._onMarkerDragStart,this),p.on("drag",this._onMarkerDrag,this),p.on("dragend",this._onMarkerDragEnd,this),this._helperLayers.addLayer(p),p},_moveCircle:function(){var h=this._centerMarker.getLatLng();this._layer.setLatLng(h);var p=this._layer._radius,_=this._getLatLngOnCircle(h,p);this._outerMarker._latlng=_,this._outerMarker.update(),this._syncHintLine(),this._updateHiddenPolyCircle(),this._fireCenterPlaced("Edit"),this._fireChange(this._layer.getLatLng(),"Edit")},_syncMarkers:function(){var h=this._layer.getLatLng(),p=this._layer._radius,_=this._getLatLngOnCircle(h,p);this._outerMarker.setLatLng(_),this._centerMarker.setLatLng(h),this._syncHintLine(),this._updateHiddenPolyCircle()},_resizeCircle:function(){this._outerMarker.setLatLng(this._getNewDestinationOfOuterMarker()),this._syncHintLine(),this._syncCircleRadius()},_syncCircleRadius:function(){var h=this._centerMarker.getLatLng(),p=this._outerMarker.getLatLng(),_=this._map.project(h).distanceTo(this._map.project(p));this.options.minRadiusCircleMarker&&_this.options.maxRadiusCircleMarker?this._layer.setRadius(this.options.maxRadiusCircleMarker):this._layer.setRadius(_),this._updateHiddenPolyCircle(),this._fireChange(this._layer.getLatLng(),"Edit")},_syncHintLine:function(){var h=this._centerMarker.getLatLng(),p=this._outerMarker.getLatLng();this._hintline.setLatLngs([h,p])},_removeMarker:function(){this.options.editable&&this.disable(),this._layer.remove(),this._fireRemove(this._layer),this._fireRemove(this._map,this._layer)},_onDragStart:function(){this._map.pm.Draw.CircleMarker._layerIsDragging=!0},_onMarkerDragStart:function(h){this._vertexValidation("move",h)&&this._fireMarkerDragStart(h)},_onMarkerDrag:function(h){var p=h.target;p instanceof L.Marker&&!this._vertexValidationDrag(p)||this._fireMarkerDrag(h)},_onMarkerDragEnd:function(h){this._map.pm.Draw.CircleMarker._layerIsDragging=!1;var p=h.target;this._vertexValidationDragEnd(p)&&(this.options.editable&&(this._fireEdit(),this._layerEdited=!0),this._fireMarkerDragEnd(h))},_initSnappableMarkersDrag:function(){var h=this._layer;this.options.snapDistance=this.options.snapDistance||30,this.options.snapSegment=this.options.snapSegment===void 0||this.options.snapSegment,h.off("pm:drag",this._handleSnapping,this),h.on("pm:drag",this._handleSnapping,this),h.off("pm:dragend",this._cleanupSnapping,this),h.on("pm:dragend",this._cleanupSnapping,this),h.off("pm:dragstart",this._unsnap,this),h.on("pm:dragstart",this._unsnap,this)},_disableSnappingDrag:function(){var h=this._layer;h.off("pm:drag",this._handleSnapping,this),h.off("pm:dragend",this._cleanupSnapping,this),h.off("pm:dragstart",this._unsnap,this)},_updateHiddenPolyCircle:function(){var h=this._layer._map||this._map;if(h){var p=L.PM.Utils.pxRadiusToMeterRadius(this._layer.getRadius(),h,this._layer.getLatLng()),_=L.circle(this._layer.getLatLng(),this._layer.options);_.setRadius(p);var E=h&&h.pm._isCRSSimple();this._hiddenPolyCircle?this._hiddenPolyCircle.setLatLngs(L.PM.Utils.circleToPolygon(_,200,!E).getLatLngs()):this._hiddenPolyCircle=L.PM.Utils.circleToPolygon(_,200,!E),this._hiddenPolyCircle._parentCopy||(this._hiddenPolyCircle._parentCopy=this._layer)}},_getNewDestinationOfOuterMarker:function(){var h=this._centerMarker.getLatLng(),p=this._outerMarker.getLatLng(),_=this._map.project(h).distanceTo(this._map.project(p));return this.options.minRadiusCircleMarker&&_this.options.maxRadiusCircleMarker&&(p=Re(this._map,h,p,L.PM.Utils.pxRadiusToMeterRadius(this.options.maxRadiusCircleMarker,this._map,h))),p},_handleOuterMarkerSnapping:function(){if(this._outerMarker._snapped){var h=this._centerMarker.getLatLng(),p=this._outerMarker.getLatLng(),_=this._map.project(h).distanceTo(this._map.project(p));(this.options.minRadiusCircleMarker&&_this.options.maxRadiusCircleMarker)&&this._outerMarker.setLatLng(this._outerMarker._orgLatLng)}this._outerMarker.setLatLng(this._getNewDestinationOfOuterMarker())}}),fn.ImageOverlay=fn.extend({_shape:"ImageOverlay",initialize:function(h){this._layer=h,this._enabled=!1},toggleEdit:function(h){this.enabled()?this.disable():this.enable(h)},enabled:function(){return this._enabled},enable:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{draggable:!0,snappable:!0};L.Util.setOptions(this,h),this._map=this._layer._map,this._map&&(this.options.allowEditing?(this.enabled()||this.disable(),this.enableLayerDrag(),this._layer.on("remove",this.disable,this),this._enabled=!0,this._otherSnapLayers=this._findCorners(),this._fireEnable()):this.disable())},disable:function(){this._dragging||(this._map||(this._map=this._layer._map),this.disableLayerDrag(),this._layer.off("remove",this.disable,this),this.enabled()||(this._layerEdited&&this._fireUpdate(),this._layerEdited=!1,this._fireDisable()),this._enabled=!1)},_findCorners:function(){var h=this._layer.getBounds();return[h.getNorthWest(),h.getNorthEast(),h.getSouthEast(),h.getSouthWest()]}}),fn.Text=fn.extend({_shape:"Text",initialize:function(h){this._layer=h,this._enabled=!1},enable:function(h){L.Util.setOptions(this,h),this.textArea&&(this.options.allowEditing&&this._layer._map?(this._map=this._layer._map,this.enabled()&&this.disable(),this.applyOptions(),this._safeToCacheDragState=!0,this._focusChange(),this.textArea.readOnly=!1,this.textArea.classList.remove("pm-disabled"),this._layer.on("remove",this.disable,this),L.DomEvent.on(this.textArea,"input",this._autoResize,this),L.DomEvent.on(this.textArea,"focus",this._focusChange,this),L.DomEvent.on(this.textArea,"blur",this._focusChange,this),this._layer.on("dblclick",L.DomEvent.stop),L.DomEvent.off(this.textArea,"mousedown",this._preventTextSelection),this._enabled=!0,this._fireEnable()):this.disable())},disable:function(){if(this.enabled()){this._layer.off("remove",this.disable,this),L.DomEvent.off(this.textArea,"input",this._autoResize,this),L.DomEvent.off(this.textArea,"focus",this._focusChange,this),L.DomEvent.off(this.textArea,"blur",this._focusChange,this),L.DomEvent.off(document,"click",this._documentClick,this),this._focusChange(),this.textArea.readOnly=!0,this.textArea.classList.add("pm-disabled");var h=document.activeElement;this.textArea.focus(),this.textArea.selectionStart=0,this.textArea.selectionEnd=0,L.DomEvent.on(this.textArea,"mousedown",this._preventTextSelection),h.focus(),this._disableOnBlurActive=!1,this._layerEdited&&this._fireUpdate(),this._layerEdited=!1,this._fireDisable(),this._enabled=!1}},enabled:function(){return this._enabled},toggleEdit:function(h){this.enabled()?this.disable():this.enable(h)},applyOptions:function(){this.options.snappable?this._initSnappableMarkers():this._disableSnapping()},_initSnappableMarkers:function(){var h=this._layer;this.options.snapDistance=this.options.snapDistance||30,this.options.snapSegment=this.options.snapSegment===void 0||this.options.snapSegment,h.off("pm:drag",this._handleSnapping,this),h.on("pm:drag",this._handleSnapping,this),h.off("pm:dragend",this._cleanupSnapping,this),h.on("pm:dragend",this._cleanupSnapping,this),h.off("pm:dragstart",this._unsnap,this),h.on("pm:dragstart",this._unsnap,this)},_disableSnapping:function(){var h=this._layer;h.off("pm:drag",this._handleSnapping,this),h.off("pm:dragend",this._cleanupSnapping,this),h.off("pm:dragstart",this._unsnap,this)},_autoResize:function(){this.textArea.style.height="1px",this.textArea.style.width="1px";var h=this.textArea.scrollHeight>21?this.textArea.scrollHeight:21,p=this.textArea.scrollWidth>16?this.textArea.scrollWidth:16;this.textArea.style.height="".concat(h,"px"),this.textArea.style.width="".concat(p,"px"),this._layer.options.text=this.getText(),this._fireTextChange(this.getText())},_disableOnBlur:function(){var h=this;this._disableOnBlurActive=!0,setTimeout(function(){h.enabled()&&L.DomEvent.on(document,"click",h._documentClick,h)},100)},_documentClick:function(h){h.target!==this.textArea&&(this.disable(),!this.getText()&&this.options.removeIfEmpty&&this.remove())},_focusChange:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},p=this._hasFocus;this._hasFocus=h.type==="focus",!p!=!this._hasFocus&&(this._hasFocus?(this._applyFocus(),this._focusText=this.getText(),this._fireTextFocus()):(this._removeFocus(),this._fireTextBlur(),this._focusText!==this.getText()&&(this._fireEdit(),this._layerEdited=!0)))},_applyFocus:function(){this.textArea.classList.add("pm-hasfocus"),this._map.dragging&&(this._safeToCacheDragState&&(this._originalMapDragState=this._map.dragging._enabled,this._safeToCacheDragState=!1),this._map.dragging.disable())},_removeFocus:function(){this._map.dragging&&(this._originalMapDragState&&this._map.dragging.enable(),this._safeToCacheDragState=!0),this.textArea.classList.remove("pm-hasfocus")},focus:function(){if(!this.enabled())throw new TypeError("Layer is not enabled");this.textArea.focus()},blur:function(){if(!this.enabled())throw new TypeError("Layer is not enabled");this.textArea.blur(),this._disableOnBlurActive&&this.disable()},hasFocus:function(){return this._hasFocus},getElement:function(){return this.textArea},setText:function(h){this.textArea.value=h,this._autoResize()},getText:function(){return this.textArea.value},_initTextMarker:function(){if(this.textArea=L.PM.Draw.Text.prototype._createTextArea.call(this),this.options.className){var h,p=this.options.className.split(" ");(h=this.textArea.classList).add.apply(h,Nn(p))}var _=L.PM.Draw.Text.prototype._createTextIcon.call(this,this.textArea);this._layer.setIcon(_),this._layer.once("add",this._createTextMarker,this)},_createTextMarker:function(){var h=arguments.length>0&&arguments[0]!==void 0&&arguments[0];this._layer.off("add",this._createTextMarker,this),this._layer.getElement().tabIndex=-1,this.textArea.wrap="off",this.textArea.style.overflow="hidden",this.textArea.style.height=L.DomUtil.getStyle(this.textArea,"font-size"),this.textArea.style.width="1px",this._layer.options.text&&this.setText(this._layer.options.text),this._autoResize(),h===!0&&(this.enable(),this.focus(),this._disableOnBlur())},_preventTextSelection:function(h){h.preventDefault()}});var Qo=function(h,p,_,E,I,V){this._matrix=[h,p,_,E,I,V]};Qo.init=function(){return new L.PM.Matrix(1,0,0,1,0,0)},Qo.prototype={transform:function(h){return this._transform(h.clone())},_transform:function(h){var p=this._matrix,_=h.x,E=h.y;return h.x=p[0]*_+p[1]*E+p[4],h.y=p[2]*_+p[3]*E+p[5],h},untransform:function(h){var p=this._matrix;return new L.Point((h.x/p[0]-p[4])/p[0],(h.y/p[2]-p[5])/p[2])},clone:function(){var h=this._matrix;return new L.PM.Matrix(h[0],h[1],h[2],h[3],h[4],h[5])},translate:function(h){return h===void 0?new L.Point(this._matrix[4],this._matrix[5]):(typeof h=="number"?(p=h,_=h):(p=h.x,_=h.y),this._add(1,0,0,1,p,_));var p,_},scale:function(h,p){return h===void 0?new L.Point(this._matrix[0],this._matrix[3]):(p=p||L.point(0,0),typeof h=="number"?(_=h,E=h):(_=h.x,E=h.y),this._add(_,0,0,E,p.x,p.y)._add(1,0,0,1,-p.x,-p.y));var _,E},rotate:function(h,p){var _=Math.cos(h),E=Math.sin(h);return p=p||new L.Point(0,0),this._add(_,E,-E,_,p.x,p.y)._add(1,0,0,1,-p.x,-p.y)},flip:function(){return this._matrix[1]*=-1,this._matrix[2]*=-1,this},_add:function(h,p,_,E,I,V){var nt,it=[[],[],[]],rt=this._matrix,ot=[[rt[0],rt[2],rt[4]],[rt[1],rt[3],rt[5]],[0,0,1]],dt=[[h,_,I],[p,E,V],[0,0,1]];h&&h instanceof L.PM.Matrix&&(dt=[[(rt=h._matrix)[0],rt[2],rt[4]],[rt[1],rt[3],rt[5]],[0,0,1]]);for(var Pt=0;Pt<3;Pt+=1)for(var yt=0;yt<3;yt+=1){nt=0;for(var At=0;At<3;At+=1)nt+=ot[Pt][At]*dt[At][yt];it[Pt][yt]=nt}return this._matrix=[it[0][0],it[1][0],it[0][1],it[1][1],it[0][2],it[1][2]],this}};let ie=Qo;var Kr={calcMiddleLatLng:function(h,p,_){var E=h.project(p),I=h.project(_);return h.unproject(E._add(I)._divideBy(2))},findLayers:function(h){var p=[];return h.eachLayer(function(_){(_ instanceof L.Polyline||_ instanceof L.Marker||_ instanceof L.Circle||_ instanceof L.CircleMarker||_ instanceof L.ImageOverlay)&&p.push(_)}),p=(p=(p=p.filter(function(_){return!!_.pm})).filter(function(_){return!_._pmTempLayer})).filter(function(_){return!L.PM.optIn&&!_.options.pmIgnore||L.PM.optIn&&_.options.pmIgnore===!1})},circleToPolygon:function(h){for(var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:60,_=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],E=h.getLatLng(),I=h.getRadius(),V=ce(E,I,p,0,_),nt=[],it=0;it3&&arguments[3]!==void 0&&arguments[3];h.fire(p,_,E);var I=this.getAllParentGroups(h),V=I.groups;V.forEach(function(nt){nt.fire(p,_,E)})},getAllParentGroups:function(h){var p=[],_=[];return!h._pmLastGroupFetch||!h._pmLastGroupFetch.time||new Date().getTime()-h._pmLastGroupFetch.time>1e3?(function E(I){for(var V in I._eventParents)if(p.indexOf(V)===-1){p.push(V);var nt=I._eventParents[V];_.push(nt),E(nt)}}(h),h._pmLastGroupFetch={time:new Date().getTime(),groups:_,groupIds:p},{groupIds:p,groups:_}):{groups:h._pmLastGroupFetch.groups,groupIds:h._pmLastGroupFetch.groupIds}},createGeodesicPolygon:ce,getTranslation:Rt,findDeepCoordIndex:function(h,p){var _,E=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],I=function nt(it){return function(rt,ot){var dt=it.concat(ot);if(E){if(rt.lat&&rt.lat===p.lat&&rt.lng===p.lng)return _=dt,!0}else if(rt.lat&&L.latLng(rt).equals(p))return _=dt,!0;return Array.isArray(rt)&&rt.some(nt(dt))}};h.some(I([]));var V={};return _&&(V={indexPath:_,index:_[_.length-1],parentPath:_.slice(0,_.length-1)}),V},findDeepMarkerIndex:function(h,p){var _;h.some(function I(V){return function(nt,it){var rt=V.concat(it);return nt._leaflet_id===p._leaflet_id?(_=rt,!0):Array.isArray(nt)&&nt.some(I(rt))}}([]));var E={};return _&&(E={indexPath:_,index:_[_.length-1],parentPath:_.slice(0,_.length-1)}),E},_getIndexFromSegment:function(h,p){if(p&&p.length===2){var _=this.findDeepCoordIndex(h,p[0]),E=this.findDeepCoordIndex(h,p[1]),I=Math.max(_.index,E.index);return _.index!==0&&E.index!==0||I===1||(I+=1),{indexA:_,indexB:E,newIndex:I,indexPath:_.indexPath,parentPath:_.parentPath}}return null},_getRotatedRectangle:function(h,p,_,E){var I=ai(E,h),V=ai(E,p),nt=_*Math.PI/180,it=Math.cos(nt),rt=Math.sin(nt),ot=(V.x-I.x)*it+(V.y-I.y)*rt,dt=(V.y-I.y)*it-(V.x-I.x)*rt,Pt=ot*it+I.x,yt=ot*rt+I.y,At=-dt*rt+I.x,Gt=dt*it+I.y;return[Vi(E,I),Vi(E,{x:Pt,y:yt}),Vi(E,V),Vi(E,{x:At,y:Gt})]},pxRadiusToMeterRadius:function(h,p,_){var E=p.project(_),I=L.point(E.x+h,E.y);return p.distance(p.unproject(I),_)}};let Pe=Kr;L.PM=L.PM||{version:"2.14.2",Map:hn,Toolbar:ht,Draw:Z,Edit:fn,Utils:Pe,Matrix:ie,activeLang:"en",optIn:!1,initialize:function(h){this.addInitHooks(h)},setOptIn:function(h){this.optIn=!!h},addInitHooks:function(){L.Map.addInitHook(function(){this.pm=void 0,L.PM.optIn?this.options.pmIgnore===!1&&(this.pm=new L.PM.Map(this)):this.options.pmIgnore||(this.pm=new L.PM.Map(this)),this.pm&&this.pm.setGlobalOptions({})}),L.LayerGroup.addInitHook(function(){this.pm=void 0,L.PM.optIn?this.options.pmIgnore===!1&&(this.pm=new L.PM.Edit.LayerGroup(this)):this.options.pmIgnore||(this.pm=new L.PM.Edit.LayerGroup(this))}),L.Marker.addInitHook(function(){this.pm=void 0,L.PM.optIn?this.options.pmIgnore===!1&&(this.options.textMarker?(this.pm=new L.PM.Edit.Text(this),this.options._textMarkerOverPM||this.pm._initTextMarker(),delete this.options._textMarkerOverPM):this.pm=new L.PM.Edit.Marker(this)):this.options.pmIgnore||(this.options.textMarker?(this.pm=new L.PM.Edit.Text(this),this.options._textMarkerOverPM||this.pm._initTextMarker(),delete this.options._textMarkerOverPM):this.pm=new L.PM.Edit.Marker(this))}),L.CircleMarker.addInitHook(function(){this.pm=void 0,L.PM.optIn?this.options.pmIgnore===!1&&(this.pm=new L.PM.Edit.CircleMarker(this)):this.options.pmIgnore||(this.pm=new L.PM.Edit.CircleMarker(this))}),L.Polyline.addInitHook(function(){this.pm=void 0,L.PM.optIn?this.options.pmIgnore===!1&&(this.pm=new L.PM.Edit.Line(this)):this.options.pmIgnore||(this.pm=new L.PM.Edit.Line(this))}),L.Polygon.addInitHook(function(){this.pm=void 0,L.PM.optIn?this.options.pmIgnore===!1&&(this.pm=new L.PM.Edit.Polygon(this)):this.options.pmIgnore||(this.pm=new L.PM.Edit.Polygon(this))}),L.Rectangle.addInitHook(function(){this.pm=void 0,L.PM.optIn?this.options.pmIgnore===!1&&(this.pm=new L.PM.Edit.Rectangle(this)):this.options.pmIgnore||(this.pm=new L.PM.Edit.Rectangle(this))}),L.Circle.addInitHook(function(){this.pm=void 0,L.PM.optIn?this.options.pmIgnore===!1&&(this.pm=new L.PM.Edit.Circle(this)):this.options.pmIgnore||(this.pm=new L.PM.Edit.Circle(this))}),L.ImageOverlay.addInitHook(function(){this.pm=void 0,L.PM.optIn?this.options.pmIgnore===!1&&(this.pm=new L.PM.Edit.ImageOverlay(this)):this.options.pmIgnore||(this.pm=new L.PM.Edit.ImageOverlay(this))})},reInitLayer:function(h){var p=this;h instanceof L.LayerGroup&&h.eachLayer(function(_){p.reInitLayer(_)}),h.pm||L.PM.optIn&&h.options.pmIgnore!==!1||h.options.pmIgnore||(h instanceof L.Map?h.pm=new L.PM.Map(h):h instanceof L.Marker?h.options.textMarker?(h.pm=new L.PM.Edit.Text(h),h.pm._initTextMarker(),h.pm._createTextMarker(!1)):h.pm=new L.PM.Edit.Marker(h):h instanceof L.Circle?h.pm=new L.PM.Edit.Circle(h):h instanceof L.CircleMarker?h.pm=new L.PM.Edit.CircleMarker(h):h instanceof L.Rectangle?h.pm=new L.PM.Edit.Rectangle(h):h instanceof L.Polygon?h.pm=new L.PM.Edit.Polygon(h):h instanceof L.Polyline?h.pm=new L.PM.Edit.Line(h):h instanceof L.LayerGroup?h.pm=new L.PM.Edit.LayerGroup(h):h instanceof L.ImageOverlay&&(h.pm=new L.PM.Edit.ImageOverlay(h)))}},L.version==="1.7.1"&&L.Canvas.include({_onClick:function(h){for(var p,_,E=this._map.mouseEventToLayerPoint(h),I=this._drawFirst;I;I=I.next)(p=I.layer).options.interactive&&p._containsPoint(E)&&(h.type!=="click"&&h.type!=="preclick"||!this._map._draggableMoved(p))&&(_=p);_&&(L.DomEvent.fakeStop(h),this._fireEvent([_],h))}}),L.PM.initialize()},7107:()=>{Array.prototype.findIndex=Array.prototype.findIndex||function(a){if(this===null)throw new TypeError("Array.prototype.findIndex called on null or undefined");if(typeof a!="function")throw new TypeError("callback must be a function");for(var l=Object(this),c=l.length>>>0,g=arguments[1],m=0;m>>0,g=arguments[1],m=0;m>>0;if(g===0)return!1;for(var m,v,x=0|l,P=Math.max(x>=0?x:g-Math.abs(x),0);P{var g=c(2582),m=c(4102),v=c(1540),x=c(9705).Z,P=v.featureEach,T=(v.coordEach,m.polygon,m.featureCollection);function N(q){var z=new g(q);return z.insert=function(j){if(j.type!=="Feature")throw new Error("invalid feature");return j.bbox=j.bbox?j.bbox:x(j),g.prototype.insert.call(this,j)},z.load=function(j){var R=[];return Array.isArray(j)?j.forEach(function(B){if(B.type!=="Feature")throw new Error("invalid features");B.bbox=B.bbox?B.bbox:x(B),R.push(B)}):P(j,function(B){if(B.type!=="Feature")throw new Error("invalid features");B.bbox=B.bbox?B.bbox:x(B),R.push(B)}),g.prototype.load.call(this,R)},z.remove=function(j,R){if(j.type!=="Feature")throw new Error("invalid feature");return j.bbox=j.bbox?j.bbox:x(j),g.prototype.remove.call(this,j,R)},z.clear=function(){return g.prototype.clear.call(this)},z.search=function(j){var R=g.prototype.search.call(this,this.toBBox(j));return T(R)},z.collides=function(j){return g.prototype.collides.call(this,this.toBBox(j))},z.all=function(){var j=g.prototype.all.call(this);return T(j)},z.toJSON=function(){return g.prototype.toJSON.call(this)},z.fromJSON=function(j){return g.prototype.fromJSON.call(this,j)},z.toBBox=function(j){var R;if(j.bbox)R=j.bbox;else if(Array.isArray(j)&&j.length===4)R=j;else if(Array.isArray(j)&&j.length===6)R=[j[0],j[1],j[3],j[4]];else if(j.type==="Feature")R=x(j);else{if(j.type!=="FeatureCollection")throw new Error("invalid geojson");R=x(j)}return{minX:R[0],minY:R[1],maxX:R[2],maxY:R[3]}},z}a.exports=N,a.exports.default=N},1989:(a,l,c)=>{var g=c(1789),m=c(401),v=c(7667),x=c(1327),P=c(1866);function T(N){var q=-1,z=N==null?0:N.length;for(this.clear();++q{var g=c(7040),m=c(4125),v=c(2117),x=c(7518),P=c(4705);function T(N){var q=-1,z=N==null?0:N.length;for(this.clear();++q{var g=c(852)(c(5639),"Map");a.exports=g},3369:(a,l,c)=>{var g=c(4785),m=c(1285),v=c(6e3),x=c(9916),P=c(5265);function T(N){var q=-1,z=N==null?0:N.length;for(this.clear();++q{var g=c(8407),m=c(7465),v=c(3779),x=c(7599),P=c(4758),T=c(4309);function N(q){var z=this.__data__=new g(q);this.size=z.size}N.prototype.clear=m,N.prototype.delete=v,N.prototype.get=x,N.prototype.has=P,N.prototype.set=T,a.exports=N},2705:(a,l,c)=>{var g=c(5639).Symbol;a.exports=g},1149:(a,l,c)=>{var g=c(5639).Uint8Array;a.exports=g},6874:a=>{a.exports=function(l,c,g){switch(g.length){case 0:return l.call(c);case 1:return l.call(c,g[0]);case 2:return l.call(c,g[0],g[1]);case 3:return l.call(c,g[0],g[1],g[2])}return l.apply(c,g)}},4636:(a,l,c)=>{var g=c(2545),m=c(5694),v=c(1469),x=c(4144),P=c(5776),T=c(6719),N=Object.prototype.hasOwnProperty;a.exports=function(q,z){var j=v(q),R=!j&&m(q),B=!j&&!R&&x(q),D=!j&&!R&&!B&&T(q),A=j||R||B||D,G=A?g(q.length,String):[],H=G.length;for(var K in q)!z&&!N.call(q,K)||A&&(K=="length"||B&&(K=="offset"||K=="parent")||D&&(K=="buffer"||K=="byteLength"||K=="byteOffset")||P(K,H))||G.push(K);return G}},9932:a=>{a.exports=function(l,c){for(var g=-1,m=l==null?0:l.length,v=Array(m);++g{var g=c(9465),m=c(7813);a.exports=function(v,x,P){(P!==void 0&&!m(v[x],P)||P===void 0&&!(x in v))&&g(v,x,P)}},4865:(a,l,c)=>{var g=c(9465),m=c(7813),v=Object.prototype.hasOwnProperty;a.exports=function(x,P,T){var N=x[P];v.call(x,P)&&m(N,T)&&(T!==void 0||P in x)||g(x,P,T)}},8470:(a,l,c)=>{var g=c(7813);a.exports=function(m,v){for(var x=m.length;x--;)if(g(m[x][0],v))return x;return-1}},9465:(a,l,c)=>{var g=c(8777);a.exports=function(m,v,x){v=="__proto__"&&g?g(m,v,{configurable:!0,enumerable:!0,value:x,writable:!0}):m[v]=x}},3118:(a,l,c)=>{var g=c(3218),m=Object.create,v=function(){function x(){}return function(P){if(!g(P))return{};if(m)return m(P);x.prototype=P;var T=new x;return x.prototype=void 0,T}}();a.exports=v},8483:(a,l,c)=>{var g=c(5063)();a.exports=g},7786:(a,l,c)=>{var g=c(1811),m=c(327);a.exports=function(v,x){for(var P=0,T=(x=g(x,v)).length;v!=null&&P{var g=c(2705),m=c(9607),v=c(2333),x=g?g.toStringTag:void 0;a.exports=function(P){return P==null?P===void 0?"[object Undefined]":"[object Null]":x&&x in Object(P)?m(P):v(P)}},8565:a=>{var l=Object.prototype.hasOwnProperty;a.exports=function(c,g){return c!=null&&l.call(c,g)}},9454:(a,l,c)=>{var g=c(4239),m=c(7005);a.exports=function(v){return m(v)&&g(v)=="[object Arguments]"}},8458:(a,l,c)=>{var g=c(3560),m=c(5346),v=c(3218),x=c(346),P=/^\[object .+?Constructor\]$/,T=Function.prototype,N=Object.prototype,q=T.toString,z=N.hasOwnProperty,j=RegExp("^"+q.call(z).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");a.exports=function(R){return!(!v(R)||m(R))&&(g(R)?j:P).test(x(R))}},8749:(a,l,c)=>{var g=c(4239),m=c(1780),v=c(7005),x={};x["[object Float32Array]"]=x["[object Float64Array]"]=x["[object Int8Array]"]=x["[object Int16Array]"]=x["[object Int32Array]"]=x["[object Uint8Array]"]=x["[object Uint8ClampedArray]"]=x["[object Uint16Array]"]=x["[object Uint32Array]"]=!0,x["[object Arguments]"]=x["[object Array]"]=x["[object ArrayBuffer]"]=x["[object Boolean]"]=x["[object DataView]"]=x["[object Date]"]=x["[object Error]"]=x["[object Function]"]=x["[object Map]"]=x["[object Number]"]=x["[object Object]"]=x["[object RegExp]"]=x["[object Set]"]=x["[object String]"]=x["[object WeakMap]"]=!1,a.exports=function(P){return v(P)&&m(P.length)&&!!x[g(P)]}},313:(a,l,c)=>{var g=c(3218),m=c(5726),v=c(3498),x=Object.prototype.hasOwnProperty;a.exports=function(P){if(!g(P))return v(P);var T=m(P),N=[];for(var q in P)(q!="constructor"||!T&&x.call(P,q))&&N.push(q);return N}},2980:(a,l,c)=>{var g=c(6384),m=c(6556),v=c(8483),x=c(9783),P=c(3218),T=c(1704),N=c(6390);a.exports=function q(z,j,R,B,D){z!==j&&v(j,function(A,G){if(D||(D=new g),P(A))x(z,j,G,R,q,B,D);else{var H=B?B(N(z,G),A,G+"",z,j,D):void 0;H===void 0&&(H=A),m(z,G,H)}},T)}},9783:(a,l,c)=>{var g=c(6556),m=c(4626),v=c(7133),x=c(278),P=c(8517),T=c(5694),N=c(1469),q=c(9246),z=c(4144),j=c(3560),R=c(3218),B=c(8630),D=c(6719),A=c(6390),G=c(9881);a.exports=function(H,K,et,X,lt,gt,Et){var Q=A(H,et),kt=A(K,et),ct=Et.get(kt);if(ct)g(H,et,ct);else{var bt=gt?gt(Q,kt,et+"",H,K,Et):void 0,Mt=bt===void 0;if(Mt){var Xt=N(kt),ft=!Xt&&z(kt),Ct=!Xt&&!ft&&D(kt);bt=kt,Xt||ft||Ct?N(Q)?bt=Q:q(Q)?bt=x(Q):ft?(Mt=!1,bt=m(kt,!0)):Ct?(Mt=!1,bt=v(kt,!0)):bt=[]:B(kt)||T(kt)?(bt=Q,T(Q)?bt=G(Q):R(Q)&&!j(Q)||(bt=P(kt))):Mt=!1}Mt&&(Et.set(kt,bt),lt(bt,kt,X,gt,Et),Et.delete(kt)),g(H,et,bt)}}},5976:(a,l,c)=>{var g=c(6557),m=c(5357),v=c(61);a.exports=function(x,P){return v(m(x,P,g),x+"")}},6560:(a,l,c)=>{var g=c(5703),m=c(8777),v=c(6557),x=m?function(P,T){return m(P,"toString",{configurable:!0,enumerable:!1,value:g(T),writable:!0})}:v;a.exports=x},2545:a=>{a.exports=function(l,c){for(var g=-1,m=Array(l);++g{var g=c(2705),m=c(9932),v=c(1469),x=c(3448),P=g?g.prototype:void 0,T=P?P.toString:void 0;a.exports=function N(q){if(typeof q=="string")return q;if(v(q))return m(q,N)+"";if(x(q))return T?T.call(q):"";var z=q+"";return z=="0"&&1/q==-1/0?"-0":z}},1717:a=>{a.exports=function(l){return function(c){return l(c)}}},1811:(a,l,c)=>{var g=c(1469),m=c(5403),v=c(5514),x=c(9833);a.exports=function(P,T){return g(P)?P:m(P,T)?[P]:v(x(P))}},4318:(a,l,c)=>{var g=c(1149);a.exports=function(m){var v=new m.constructor(m.byteLength);return new g(v).set(new g(m)),v}},4626:(a,l,c)=>{a=c.nmd(a);var g=c(5639),m=l&&!l.nodeType&&l,v=m&&a&&!a.nodeType&&a,x=v&&v.exports===m?g.Buffer:void 0,P=x?x.allocUnsafe:void 0;a.exports=function(T,N){if(N)return T.slice();var q=T.length,z=P?P(q):new T.constructor(q);return T.copy(z),z}},7133:(a,l,c)=>{var g=c(4318);a.exports=function(m,v){var x=v?g(m.buffer):m.buffer;return new m.constructor(x,m.byteOffset,m.length)}},278:a=>{a.exports=function(l,c){var g=-1,m=l.length;for(c||(c=Array(m));++g{var g=c(4865),m=c(9465);a.exports=function(v,x,P,T){var N=!P;P||(P={});for(var q=-1,z=x.length;++q{var g=c(5639)["__core-js_shared__"];a.exports=g},1463:(a,l,c)=>{var g=c(5976),m=c(6612);a.exports=function(v){return g(function(x,P){var T=-1,N=P.length,q=N>1?P[N-1]:void 0,z=N>2?P[2]:void 0;for(q=v.length>3&&typeof q=="function"?(N--,q):void 0,z&&m(P[0],P[1],z)&&(q=N<3?void 0:q,N=1),x=Object(x);++T{a.exports=function(l){return function(c,g,m){for(var v=-1,x=Object(c),P=m(c),T=P.length;T--;){var N=P[l?T:++v];if(g(x[N],N,x)===!1)break}return c}}},8777:(a,l,c)=>{var g=c(852),m=function(){try{var v=g(Object,"defineProperty");return v({},"",{}),v}catch{}}();a.exports=m},1957:(a,l,c)=>{var g=typeof c.g=="object"&&c.g&&c.g.Object===Object&&c.g;a.exports=g},5050:(a,l,c)=>{var g=c(7019);a.exports=function(m,v){var x=m.__data__;return g(v)?x[typeof v=="string"?"string":"hash"]:x.map}},852:(a,l,c)=>{var g=c(8458),m=c(7801);a.exports=function(v,x){var P=m(v,x);return g(P)?P:void 0}},5924:(a,l,c)=>{var g=c(5569)(Object.getPrototypeOf,Object);a.exports=g},9607:(a,l,c)=>{var g=c(2705),m=Object.prototype,v=m.hasOwnProperty,x=m.toString,P=g?g.toStringTag:void 0;a.exports=function(T){var N=v.call(T,P),q=T[P];try{T[P]=void 0;var z=!0}catch{}var j=x.call(T);return z&&(N?T[P]=q:delete T[P]),j}},7801:a=>{a.exports=function(l,c){return l?.[c]}},222:(a,l,c)=>{var g=c(1811),m=c(5694),v=c(1469),x=c(5776),P=c(1780),T=c(327);a.exports=function(N,q,z){for(var j=-1,R=(q=g(q,N)).length,B=!1;++j{var g=c(4536);a.exports=function(){this.__data__=g?g(null):{},this.size=0}},401:a=>{a.exports=function(l){var c=this.has(l)&&delete this.__data__[l];return this.size-=c?1:0,c}},7667:(a,l,c)=>{var g=c(4536),m=Object.prototype.hasOwnProperty;a.exports=function(v){var x=this.__data__;if(g){var P=x[v];return P==="__lodash_hash_undefined__"?void 0:P}return m.call(x,v)?x[v]:void 0}},1327:(a,l,c)=>{var g=c(4536),m=Object.prototype.hasOwnProperty;a.exports=function(v){var x=this.__data__;return g?x[v]!==void 0:m.call(x,v)}},1866:(a,l,c)=>{var g=c(4536);a.exports=function(m,v){var x=this.__data__;return this.size+=this.has(m)?0:1,x[m]=g&&v===void 0?"__lodash_hash_undefined__":v,this}},8517:(a,l,c)=>{var g=c(3118),m=c(5924),v=c(5726);a.exports=function(x){return typeof x.constructor!="function"||v(x)?{}:g(m(x))}},5776:a=>{var l=/^(?:0|[1-9]\d*)$/;a.exports=function(c,g){var m=typeof c;return!!(g=g??9007199254740991)&&(m=="number"||m!="symbol"&&l.test(c))&&c>-1&&c%1==0&&c{var g=c(7813),m=c(8612),v=c(5776),x=c(3218);a.exports=function(P,T,N){if(!x(N))return!1;var q=typeof T;return!!(q=="number"?m(N)&&v(T,N.length):q=="string"&&T in N)&&g(N[T],P)}},5403:(a,l,c)=>{var g=c(1469),m=c(3448),v=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,x=/^\w*$/;a.exports=function(P,T){if(g(P))return!1;var N=typeof P;return!(N!="number"&&N!="symbol"&&N!="boolean"&&P!=null&&!m(P))||x.test(P)||!v.test(P)||T!=null&&P in Object(T)}},7019:a=>{a.exports=function(l){var c=typeof l;return c=="string"||c=="number"||c=="symbol"||c=="boolean"?l!=="__proto__":l===null}},5346:(a,l,c)=>{var g,m=c(4429),v=(g=/[^.]+$/.exec(m&&m.keys&&m.keys.IE_PROTO||""))?"Symbol(src)_1."+g:"";a.exports=function(x){return!!v&&v in x}},5726:a=>{var l=Object.prototype;a.exports=function(c){var g=c&&c.constructor;return c===(typeof g=="function"&&g.prototype||l)}},7040:a=>{a.exports=function(){this.__data__=[],this.size=0}},4125:(a,l,c)=>{var g=c(8470),m=Array.prototype.splice;a.exports=function(v){var x=this.__data__,P=g(x,v);return!(P<0)&&(P==x.length-1?x.pop():m.call(x,P,1),--this.size,!0)}},2117:(a,l,c)=>{var g=c(8470);a.exports=function(m){var v=this.__data__,x=g(v,m);return x<0?void 0:v[x][1]}},7518:(a,l,c)=>{var g=c(8470);a.exports=function(m){return g(this.__data__,m)>-1}},4705:(a,l,c)=>{var g=c(8470);a.exports=function(m,v){var x=this.__data__,P=g(x,m);return P<0?(++this.size,x.push([m,v])):x[P][1]=v,this}},4785:(a,l,c)=>{var g=c(1989),m=c(8407),v=c(7071);a.exports=function(){this.size=0,this.__data__={hash:new g,map:new(v||m),string:new g}}},1285:(a,l,c)=>{var g=c(5050);a.exports=function(m){var v=g(this,m).delete(m);return this.size-=v?1:0,v}},6e3:(a,l,c)=>{var g=c(5050);a.exports=function(m){return g(this,m).get(m)}},9916:(a,l,c)=>{var g=c(5050);a.exports=function(m){return g(this,m).has(m)}},5265:(a,l,c)=>{var g=c(5050);a.exports=function(m,v){var x=g(this,m),P=x.size;return x.set(m,v),this.size+=x.size==P?0:1,this}},4523:(a,l,c)=>{var g=c(8306);a.exports=function(m){var v=g(m,function(P){return x.size===500&&x.clear(),P}),x=v.cache;return v}},4536:(a,l,c)=>{var g=c(852)(Object,"create");a.exports=g},3498:a=>{a.exports=function(l){var c=[];if(l!=null)for(var g in Object(l))c.push(g);return c}},1167:(a,l,c)=>{a=c.nmd(a);var g=c(1957),m=l&&!l.nodeType&&l,v=m&&a&&!a.nodeType&&a,x=v&&v.exports===m&&g.process,P=function(){try{var T=v&&v.require&&v.require("util").types;return T||x&&x.binding&&x.binding("util")}catch{}}();a.exports=P},2333:a=>{var l=Object.prototype.toString;a.exports=function(c){return l.call(c)}},5569:a=>{a.exports=function(l,c){return function(g){return l(c(g))}}},5357:(a,l,c)=>{var g=c(6874),m=Math.max;a.exports=function(v,x,P){return x=m(x===void 0?v.length-1:x,0),function(){for(var T=arguments,N=-1,q=m(T.length-x,0),z=Array(q);++N{var g=c(1957),m=typeof self=="object"&&self&&self.Object===Object&&self,v=g||m||Function("return this")();a.exports=v},6390:a=>{a.exports=function(l,c){if((c!=="constructor"||typeof l[c]!="function")&&c!="__proto__")return l[c]}},61:(a,l,c)=>{var g=c(6560),m=c(1275)(g);a.exports=m},1275:a=>{var l=Date.now;a.exports=function(c){var g=0,m=0;return function(){var v=l(),x=16-(v-m);if(m=v,x>0){if(++g>=800)return arguments[0]}else g=0;return c.apply(void 0,arguments)}}},7465:(a,l,c)=>{var g=c(8407);a.exports=function(){this.__data__=new g,this.size=0}},3779:a=>{a.exports=function(l){var c=this.__data__,g=c.delete(l);return this.size=c.size,g}},7599:a=>{a.exports=function(l){return this.__data__.get(l)}},4758:a=>{a.exports=function(l){return this.__data__.has(l)}},4309:(a,l,c)=>{var g=c(8407),m=c(7071),v=c(3369);a.exports=function(x,P){var T=this.__data__;if(T instanceof g){var N=T.__data__;if(!m||N.length<199)return N.push([x,P]),this.size=++T.size,this;T=this.__data__=new v(N)}return T.set(x,P),this.size=T.size,this}},5514:(a,l,c)=>{var g=c(4523),m=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,v=/\\(\\)?/g,x=g(function(P){var T=[];return P.charCodeAt(0)===46&&T.push(""),P.replace(m,function(N,q,z,j){T.push(z?j.replace(v,"$1"):q||N)}),T});a.exports=x},327:(a,l,c)=>{var g=c(3448);a.exports=function(m){if(typeof m=="string"||g(m))return m;var v=m+"";return v=="0"&&1/m==-1/0?"-0":v}},346:a=>{var l=Function.prototype.toString;a.exports=function(c){if(c!=null){try{return l.call(c)}catch{}try{return c+""}catch{}}return""}},5703:a=>{a.exports=function(l){return function(){return l}}},7813:a=>{a.exports=function(l,c){return l===c||l!=l&&c!=c}},7361:(a,l,c)=>{var g=c(7786);a.exports=function(m,v,x){var P=m==null?void 0:g(m,v);return P===void 0?x:P}},8721:(a,l,c)=>{var g=c(8565),m=c(222);a.exports=function(v,x){return v!=null&&m(v,x,g)}},6557:a=>{a.exports=function(l){return l}},5694:(a,l,c)=>{var g=c(9454),m=c(7005),v=Object.prototype,x=v.hasOwnProperty,P=v.propertyIsEnumerable,T=g(function(){return arguments}())?g:function(N){return m(N)&&x.call(N,"callee")&&!P.call(N,"callee")};a.exports=T},1469:a=>{var l=Array.isArray;a.exports=l},8612:(a,l,c)=>{var g=c(3560),m=c(1780);a.exports=function(v){return v!=null&&m(v.length)&&!g(v)}},9246:(a,l,c)=>{var g=c(8612),m=c(7005);a.exports=function(v){return m(v)&&g(v)}},4144:(a,l,c)=>{a=c.nmd(a);var g=c(5639),m=c(5062),v=l&&!l.nodeType&&l,x=v&&a&&!a.nodeType&&a,P=x&&x.exports===v?g.Buffer:void 0,T=(P?P.isBuffer:void 0)||m;a.exports=T},3560:(a,l,c)=>{var g=c(4239),m=c(3218);a.exports=function(v){if(!m(v))return!1;var x=g(v);return x=="[object Function]"||x=="[object GeneratorFunction]"||x=="[object AsyncFunction]"||x=="[object Proxy]"}},1780:a=>{a.exports=function(l){return typeof l=="number"&&l>-1&&l%1==0&&l<=9007199254740991}},3218:a=>{a.exports=function(l){var c=typeof l;return l!=null&&(c=="object"||c=="function")}},7005:a=>{a.exports=function(l){return l!=null&&typeof l=="object"}},8630:(a,l,c)=>{var g=c(4239),m=c(5924),v=c(7005),x=Function.prototype,P=Object.prototype,T=x.toString,N=P.hasOwnProperty,q=T.call(Object);a.exports=function(z){if(!v(z)||g(z)!="[object Object]")return!1;var j=m(z);if(j===null)return!0;var R=N.call(j,"constructor")&&j.constructor;return typeof R=="function"&&R instanceof R&&T.call(R)==q}},3448:(a,l,c)=>{var g=c(4239),m=c(7005);a.exports=function(v){return typeof v=="symbol"||m(v)&&g(v)=="[object Symbol]"}},6719:(a,l,c)=>{var g=c(8749),m=c(1717),v=c(1167),x=v&&v.isTypedArray,P=x?m(x):g;a.exports=P},1704:(a,l,c)=>{var g=c(4636),m=c(313),v=c(8612);a.exports=function(x){return v(x)?g(x,!0):m(x)}},8306:(a,l,c)=>{var g=c(3369);function m(v,x){if(typeof v!="function"||x!=null&&typeof x!="function")throw new TypeError("Expected a function");var P=function(){var T=arguments,N=x?x.apply(this,T):T[0],q=P.cache;if(q.has(N))return q.get(N);var z=v.apply(this,T);return P.cache=q.set(N,z)||q,z};return P.cache=new(m.Cache||g),P}m.Cache=g,a.exports=m},2492:(a,l,c)=>{var g=c(2980),m=c(1463)(function(v,x,P){g(v,x,P)});a.exports=m},5062:a=>{a.exports=function(){return!1}},9881:(a,l,c)=>{var g=c(8363),m=c(1704);a.exports=function(v){return g(v,m(v))}},9833:(a,l,c)=>{var g=c(531);a.exports=function(m){return m==null?"":g(m)}},2676:function(a){a.exports=function(){"use strict";function l(C,b){if(!(C instanceof b))throw new TypeError("Cannot call a class as a function")}function c(C,b){for(var k=0;kb?1:C0)||b.right===null||k(C,b.right.key)>0&&(pt=b.right,b.right=pt.left,pt.left=b,(b=pt).right===null))break;Z.right=b,Z=b,b=b.right}}return Z.right=b.left,J.left=b.right,b.left=F.right,b.right=F.left,b}function P(C,b,k,F){var Z=new m(C,b);if(k===null)return Z.left=Z.right=null,Z;var J=F(C,(k=x(C,k,F)).key);return J<0?(Z.left=k.left,Z.right=k,k.left=null):J>=0&&(Z.right=k.right,Z.left=k,k.right=null),Z}function T(C,b,k){var F=null,Z=null;if(b){var J=k((b=x(C,b,k)).key,C);J===0?(F=b.left,Z=b.right):J<0?(Z=b.right,b.right=null,F=b):(F=b.left,b.left=null,Z=b)}return{left:F,right:Z}}function N(C,b,k){return b===null?C:(C===null||((b=x(C.key,b,k)).left=C),b)}function q(C,b,k,F,Z){if(C){F(b+(k?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ")+Z(C)+` +`);var J=b+(k?" ":"\u2502 ");C.left&&q(C.left,J,!1,F,Z),C.right&&q(C.right,J,!0,F,Z)}}var z=function(){function C(b){b===void 0&&(b=v),this._root=null,this._size=0,this._comparator=b}return C.prototype.insert=function(b,k){return this._size++,this._root=P(b,k,this._root,this._comparator)},C.prototype.add=function(b,k){var F=new m(b,k);this._root===null&&(F.left=F.right=null,this._size++,this._root=F);var Z=this._comparator,J=x(b,this._root,Z),tt=Z(b,J.key);return tt===0?this._root=J:(tt<0?(F.left=J.left,F.right=J,J.left=null):tt>0&&(F.right=J.right,F.left=J,J.right=null),this._size++,this._root=F),this._root},C.prototype.remove=function(b){this._root=this._remove(b,this._root,this._comparator)},C.prototype._remove=function(b,k,F){var Z;return k===null?null:F(b,(k=x(b,k,F)).key)===0?(k.left===null?Z=k.right:(Z=x(b,k.left,F)).right=k.right,this._size--,Z):k},C.prototype.pop=function(){var b=this._root;if(b){for(;b.left;)b=b.left;return this._root=x(b.key,this._root,this._comparator),this._root=this._remove(b.key,this._root,this._comparator),{key:b.key,data:b.data}}return null},C.prototype.findStatic=function(b){for(var k=this._root,F=this._comparator;k;){var Z=F(b,k.key);if(Z===0)return k;k=Z<0?k.left:k.right}return null},C.prototype.find=function(b){return this._root&&(this._root=x(b,this._root,this._comparator),this._comparator(b,this._root.key)!==0)?null:this._root},C.prototype.contains=function(b){for(var k=this._root,F=this._comparator;k;){var Z=F(b,k.key);if(Z===0)return!0;k=Z<0?k.left:k.right}return!1},C.prototype.forEach=function(b,k){for(var F=this._root,Z=[],J=!1;!J;)F!==null?(Z.push(F),F=F.left):Z.length!==0?(F=Z.pop(),b.call(k,F),F=F.right):J=!0;return this},C.prototype.range=function(b,k,F,Z){for(var J=[],tt=this._comparator,pt=this._root;J.length!==0||pt;)if(pt)J.push(pt),pt=pt.left;else{if(tt((pt=J.pop()).key,k)>0)break;if(tt(pt.key,b)>=0&&F.call(Z,pt))return this;pt=pt.right}return this},C.prototype.keys=function(){var b=[];return this.forEach(function(k){var F=k.key;return b.push(F)}),b},C.prototype.values=function(){var b=[];return this.forEach(function(k){var F=k.data;return b.push(F)}),b},C.prototype.min=function(){return this._root?this.minNode(this._root).key:null},C.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},C.prototype.minNode=function(b){if(b===void 0&&(b=this._root),b)for(;b.left;)b=b.left;return b},C.prototype.maxNode=function(b){if(b===void 0&&(b=this._root),b)for(;b.right;)b=b.right;return b},C.prototype.at=function(b){for(var k=this._root,F=!1,Z=0,J=[];!F;)if(k)J.push(k),k=k.left;else if(J.length>0){if(k=J.pop(),Z===b)return k;Z++,k=k.right}else F=!0;return null},C.prototype.next=function(b){var k=this._root,F=null;if(b.right){for(F=b.right;F.left;)F=F.left;return F}for(var Z=this._comparator;k;){var J=Z(b.key,k.key);if(J===0)break;J<0?(F=k,k=k.left):k=k.right}return F},C.prototype.prev=function(b){var k=this._root,F=null;if(b.left!==null){for(F=b.left;F.right;)F=F.right;return F}for(var Z=this._comparator;k;){var J=Z(b.key,k.key);if(J===0)break;J<0?k=k.left:(F=k,k=k.right)}return F},C.prototype.clear=function(){return this._root=null,this._size=0,this},C.prototype.toList=function(){return B(this._root)},C.prototype.load=function(b,k,F){k===void 0&&(k=[]),F===void 0&&(F=!1);var Z=b.length,J=this._comparator;if(F&&G(b,k,0,Z-1,J),this._root===null)this._root=j(b,k,0,Z),this._size=Z;else{var tt=A(this.toList(),R(b,k),J);Z=this._size+Z,this._root=D({head:tt},0,Z)}return this},C.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(C.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(C.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),C.prototype.toString=function(b){b===void 0&&(b=function(F){return String(F.key)});var k=[];return q(this._root,"",!0,function(F){return k.push(F)},b),k.join("")},C.prototype.update=function(b,k,F){var Z=this._comparator,J=T(b,this._root,Z),tt=J.left,pt=J.right;Z(b,k)<0?pt=P(k,F,pt,Z):tt=P(k,F,tt,Z),this._root=N(tt,pt,Z)},C.prototype.split=function(b){return T(b,this._root,this._comparator)},C}();function j(C,b,k,F){var Z=F-k;if(Z>0){var J=k+Math.floor(Z/2),tt=C[J],pt=b[J],Lt=new m(tt,pt);return Lt.left=j(C,b,k,J),Lt.right=j(C,b,J+1,F),Lt}return null}function R(C,b){for(var k=new m(null,null),F=k,Z=0;Z0?b=(b=J=J.next=k.pop()).right:F=!0;return J.next=null,Z.next}function D(C,b,k){var F=k-b;if(F>0){var Z=b+Math.floor(F/2),J=D(C,b,Z),tt=C.head;return tt.left=J,C.head=C.head.next,tt.right=D(C,Z+1,k),tt}return null}function A(C,b,k){for(var F=new m(null,null),Z=F,J=C,tt=b;J!==null&&tt!==null;)k(J.key,tt.key)<0?(Z.next=J,J=J.next):(Z.next=tt,tt=tt.next),Z=Z.next;return J!==null?Z.next=J:tt!==null&&(Z.next=tt),F.next}function G(C,b,k,F,Z){if(!(k>=F)){for(var J=C[k+F>>1],tt=k-1,pt=F+1;;){do tt++;while(Z(C[tt],J)<0);do pt--;while(Z(C[pt],J)>0);if(tt>=pt)break;var Lt=C[tt];C[tt]=C[pt],C[pt]=Lt,Lt=b[tt],b[tt]=b[pt],b[pt]=Lt}G(C,b,k,pt,Z),G(C,b,pt+1,F,Z)}}var H=function(C,b){return C.ll.x<=b.x&&b.x<=C.ur.x&&C.ll.y<=b.y&&b.y<=C.ur.y},K=function(C,b){if(b.ur.xk.x?1:b.yk.y?1:0}}]),g(C,[{key:"link",value:function(b){if(b.point===this.point)throw new Error("Tried to link already linked events");for(var k=b.point.events,F=0,Z=k.length;F=0&&Wt>=0?vtJt?-1:0:Lt<0&&Wt<0?vtJt?1:0:WtLt?1:0}}}]),C}(),Qt=0,Tt=function(){function C(b,k,F,Z){l(this,C),this.id=++Qt,this.leftSE=b,b.segment=this,b.otherSE=k,this.rightSE=k,k.segment=this,k.otherSE=b,this.rings=F,this.windings=Z}return g(C,null,[{key:"compare",value:function(b,k){var F=b.leftSE.point.x,Z=k.leftSE.point.x,J=b.rightSE.point.x,tt=k.rightSE.point.x;if(ttpt&&Lt>vt)return-1;var Wt=b.comparePoint(k.leftSE.point);if(Wt<0)return 1;if(Wt>0)return-1;var Jt=k.comparePoint(b.rightSE.point);return Jt!==0?Jt:-1}if(F>Z){if(ptLt&&pt>Ft)return 1;var $t=k.comparePoint(b.leftSE.point);if($t!==0)return $t;var jt=b.comparePoint(k.rightSE.point);return jt<0?1:jt>0?-1:1}if(ptLt)return 1;if(Jtt){var pe=b.comparePoint(k.rightSE.point);if(pe<0)return 1;if(pe>0)return-1}if(J!==tt){var Te=vt-pt,Ce=J-F,he=Ft-Lt,An=tt-Z;if(Te>Ce&&heAn)return-1}return J>tt?1:JFt?1:b.idk.id?1:0}}]),g(C,[{key:"replaceRightSE",value:function(b){this.rightSE=b,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var b=this.leftSE.point.y,k=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:bk?b:k}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(b){return b.x===this.leftSE.point.x&&b.y===this.leftSE.point.y||b.x===this.rightSE.point.x&&b.y===this.rightSE.point.y}},{key:"comparePoint",value:function(b){if(this.isAnEndpoint(b))return 0;var k=this.leftSE.point,F=this.rightSE.point,Z=this.vector();if(k.x===F.x)return b.x===k.x?0:b.x0&&pt.swapEvents(),Ot.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),F&&(Z.checkForConsuming(),J.checkForConsuming()),k}},{key:"swapEvents",value:function(){var b=this.rightSE;this.rightSE=this.leftSE,this.leftSE=b,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var k=0,F=this.windings.length;k0){var J=k;k=F,F=J}if(k.prev===F){var tt=k;k=F,F=tt}for(var pt=0,Lt=F.rings.length;pt0))throw new Error("Tried to create degenerate segment at [".concat(b.x,", ").concat(b.y,"]"));Z=k,J=b,tt=-1}return new C(new Ot(Z,!0),new Ot(J,!1),[F],[tt])}}]),C}(),ce=function(){function C(b,k,F){if(l(this,C),!Array.isArray(b)||b.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=k,this.isExterior=F,this.segments=[],typeof b[0][0]!="number"||typeof b[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var Z=Q.round(b[0][0],b[0][1]);this.bbox={ll:{x:Z.x,y:Z.y},ur:{x:Z.x,y:Z.y}};for(var J=Z,tt=1,pt=b.length;ttthis.bbox.ur.x&&(this.bbox.ur.x=Lt.x),Lt.y>this.bbox.ur.y&&(this.bbox.ur.y=Lt.y),J=Lt)}Z.x===J.x&&Z.y===J.y||this.segments.push(Tt.fromRing(J,Z,this))}return g(C,[{key:"getSweepEvents",value:function(){for(var b=[],k=0,F=this.segments.length;kthis.bbox.ur.x&&(this.bbox.ur.x=J.bbox.ur.x),J.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=J.bbox.ur.y),this.interiorRings.push(J)}this.multiPoly=k}return g(C,[{key:"getSweepEvents",value:function(){for(var b=this.exteriorRing.getSweepEvents(),k=0,F=this.interiorRings.length;kthis.bbox.ur.x&&(this.bbox.ur.x=J.bbox.ur.x),J.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=J.bbox.ur.y),this.polys.push(J)}this.isSubject=k}return g(C,[{key:"getSweepEvents",value:function(){for(var b=[],k=0,F=this.polys.length;k0&&(b=Z)}for(var J=b.segment.prevInResult(),tt=J?J.prevInResult():null;;){if(!J)return null;if(!tt)return J.ringOut;if(tt.ringOut!==J.ringOut)return tt.ringOut.enclosingRing()!==J.ringOut?J.ringOut:J.ringOut.enclosingRing();J=tt.prevInResult(),tt=J?J.prevInResult():null}}}]),C}(),ke=function(){function C(b){l(this,C),this.exteriorRing=b,b.poly=this,this.interiorRings=[]}return g(C,[{key:"addInterior",value:function(b){this.interiorRings.push(b),b.poly=this}},{key:"getGeom",value:function(){var b=[this.exteriorRing.getGeom()];if(b[0]===null)return null;for(var k=0,F=this.interiorRings.length;k1&&arguments[1]!==void 0?arguments[1]:Tt.compare;l(this,C),this.queue=b,this.tree=new z(k),this.segments=[]}return g(C,[{key:"process",value:function(b){var k=b.segment,F=[];if(b.consumedBy)return b.isLeft?this.queue.remove(b.otherSE):this.tree.remove(k),F;var Z=b.isLeft?this.tree.insert(k):this.tree.find(k);if(!Z)throw new Error("Unable to find segment #".concat(k.id," ")+"[".concat(k.leftSE.point.x,", ").concat(k.leftSE.point.y,"] -> ")+"[".concat(k.rightSE.point.x,", ").concat(k.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var J=Z,tt=Z,pt=void 0,Lt=void 0;pt===void 0;)(J=this.tree.prev(J))===null?pt=null:J.key.consumedBy===void 0&&(pt=J.key);for(;Lt===void 0;)(tt=this.tree.next(tt))===null?Lt=null:tt.key.consumedBy===void 0&&(Lt=tt.key);if(b.isLeft){var vt=null;if(pt){var Ft=pt.getIntersection(k);if(Ft!==null&&(k.isAnEndpoint(Ft)||(vt=Ft),!pt.isAnEndpoint(Ft)))for(var Wt=this._splitSafely(pt,Ft),Jt=0,$t=Wt.length;Jt<$t;Jt++)F.push(Wt[Jt])}var jt=null;if(Lt){var ge=Lt.getIntersection(k);if(ge!==null&&(k.isAnEndpoint(ge)||(jt=ge),!Lt.isAnEndpoint(ge)))for(var pe=this._splitSafely(Lt,ge),Te=0,Ce=pe.length;Te0?(this.tree.remove(k),F.push(b)):(this.segments.push(k),k.prev=pt)}else{if(pt&&Lt){var Dn=pt.getIntersection(Lt);if(Dn!==null){if(!pt.isAnEndpoint(Dn))for(var Xn=this._splitSafely(pt,Dn),re=0,Vr=Xn.length;reSn)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var An=new hn(jt),we=jt.size,St=jt.pop();St;){var Dn=St.key;if(jt.size===we){var Xn=Dn.segment;throw new Error("Unable to pop() ".concat(Dn.isLeft?"left":"right"," SweepEvent ")+"[".concat(Dn.point.x,", ").concat(Dn.point.y,"] from segment #").concat(Xn.id," ")+"[".concat(Xn.leftSE.point.x,", ").concat(Xn.leftSE.point.y,"] -> ")+"[".concat(Xn.rightSE.point.x,", ").concat(Xn.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(jt.size>Sn)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(An.segments.length>Hn)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var re=An.process(Dn),Vr=0,zn=re.length;Vr1?b-1:0),F=1;F1?b-1:0),F=1;F1?b-1:0),F=1;F1?b-1:0),F=1;FQ;){if(kt-Q>600){var bt=kt-Q+1,Mt=Et-Q+1,Xt=Math.log(bt),ft=.5*Math.exp(2*Xt/3),Ct=.5*Math.sqrt(Xt*ft*(bt-ft)/bt)*(Mt-bt/2<0?-1:1);lt(gt,Et,Math.max(Q,Math.floor(Et-Mt*ft/bt+Ct)),Math.min(kt,Math.floor(Et+(bt-Mt)*ft/bt+Ct)),ct)}var st=gt[Et],Rt=Q,Ot=kt;for(c(gt,Q,Et),ct(gt[kt],st)>0&&c(gt,Q,kt);Rt0;)Ot--}ct(gt[Q],st)===0?c(gt,Q,Ot):c(gt,++Ot,kt),Ot<=Et&&(Q=Ot+1),Et<=Ot&&(kt=Ot-1)}})(G,H,K||0,et||G.length-1,X||g)}function c(G,H,K){var et=G[H];G[H]=G[K],G[K]=et}function g(G,H){return GH?1:0}var m=function(G){G===void 0&&(G=9),this._maxEntries=Math.max(4,G),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function v(G,H,K){if(!K)return H.indexOf(G);for(var et=0;et=G.minX&&H.maxY>=G.minY}function D(G){return{children:G,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function A(G,H,K,et,X){for(var lt=[H,K];lt.length;)if(!((K=lt.pop())-(H=lt.pop())<=et)){var gt=H+Math.ceil((K-H)/et/2)*et;l(G,gt,H,K,X),lt.push(H,gt,gt,K)}}return m.prototype.all=function(){return this._all(this.data,[])},m.prototype.search=function(G){var H=this.data,K=[];if(!B(G,H))return K;for(var et=this.toBBox,X=[];H;){for(var lt=0;lt=0&&X[H].children.length>this._maxEntries;)this._split(X,H),H--;this._adjustParentBBoxes(et,X,H)},m.prototype._split=function(G,H){var K=G[H],et=K.children.length,X=this._minEntries;this._chooseSplitAxis(K,X,et);var lt=this._chooseSplitIndex(K,X,et),gt=D(K.children.splice(lt,K.children.length-lt));gt.height=K.height,gt.leaf=K.leaf,x(K,this.toBBox),x(gt,this.toBBox),H?G[H-1].children.push(gt):this._splitRoot(K,gt)},m.prototype._splitRoot=function(G,H){this.data=D([G,H]),this.data.height=G.height+1,this.data.leaf=!1,x(this.data,this.toBBox)},m.prototype._chooseSplitIndex=function(G,H,K){for(var et,X,lt,gt,Et,Q,kt,ct=1/0,bt=1/0,Mt=H;Mt<=K-H;Mt++){var Xt=P(G,0,Mt,this.toBBox),ft=P(G,Mt,K,this.toBBox),Ct=(X=Xt,lt=ft,gt=void 0,Et=void 0,Q=void 0,kt=void 0,gt=Math.max(X.minX,lt.minX),Et=Math.max(X.minY,lt.minY),Q=Math.min(X.maxX,lt.maxX),kt=Math.min(X.maxY,lt.maxY),Math.max(0,Q-gt)*Math.max(0,kt-Et)),st=z(Xt)+z(ft);Ct=H;ct--){var bt=G.children[ct];T(gt,G.leaf?X(bt):bt),Et+=j(gt)}return Et},m.prototype._adjustParentBBoxes=function(G,H,K){for(var et=K;et>=0;et--)T(H[et],G)},m.prototype._condense=function(G){for(var H=G.length-1,K=void 0;H>=0;H--)G[H].children.length===0?H>0?(K=G[H-1].children).splice(K.indexOf(G[H]),1):this.clear():x(G[H],this.toBBox)},m}()}},n={};function s(a){var l=n[a];if(l!==void 0)return l.exports;var c=n[a]={id:a,loaded:!1,exports:{}};return r[a].call(c.exports,c,c.exports,s),c.loaded=!0,c.exports}s.n=a=>{var l=a&&a.__esModule?()=>a.default:()=>a;return s.d(l,{a:l}),l},s.d=(a,l)=>{for(var c in l)s.o(l,c)&&!s.o(a,c)&&Object.defineProperty(a,c,{enumerable:!0,get:l[c]})},s.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),s.o=(a,l)=>Object.prototype.hasOwnProperty.call(a,l),s.nmd=a=>(a.paths=[],a.children||(a.children=[]),a),s(5975)})();var ah=On(wo()),Uu=32,Sf=Uu*.5,h_=ah.default.Icon.extend({options:{iconSize:[Uu,Uu],iconAnchor:[Sf,Sf],popupAnchor:[0,-Uu*.25]}}),uh=async(r,n)=>{let s=await(await fetch(`./data/bl24/poi/${r}`)).json(),a={};for(let l of s.features){let{name:c,description:g,category:m,link:v}=l.properties,x=l.geometry.coordinates[0],P=l.geometry.coordinates[1];if(a[m]||(a[m]=new h_({iconUrl:"./img/icons/"+m+".png"})),v&&g){let N=v[0]!="#"?'target="_blank':"";g=`${g}`}let T=`

${c}

${g}

`;ah.default.marker([P,x],{icon:a[m]}).addTo(n).bindPopup(T)}};var Hu=On(wo()),kf=async r=>{let n=await(await fetch("./data/bl24/labels/quarters.json")).json();ju(n,r,"white",.001)},Tf=async r=>{let n=await(await fetch("./data/bl24/labels/plazas.json")).json();ju(n,r,"white",.0015)},If=async r=>{let n=await(await fetch("./data/bl24/labels/neighbourhoods.json")).json();ju(n,r,"white",.003);let s=await(await fetch("./data/bl24/labels/non-camp-neighbourhoods.json")).json();ju(s,r,"white",.003)},ju=(r,n,s,a)=>{for(let c of r.features){let g=c.properties.size||a,m=c.properties.rotation||0,v=c.properties.name,x=c.geometry.coordinates[0],P=c.geometry.coordinates[1];var l=Hu.latLngBounds([[P-g*.5,x-g*.5],[P+g*.5,x+g*.5]]);let T=c_(v,"bradleyHand",s,m);Hu.svgOverlay(T,l,{opacity:1,interactive:!1}).addTo(n)}};function c_(r,n,s,a){let l=document.createElementNS("http://www.w3.org/2000/svg","svg");l.setAttribute("xmlns","http://www.w3.org/2000/svg");let c="",g=r.split(` +`);for(let v of g)c+=`${v}`;l.innerHTML=`${c}`,document.body.appendChild(l);let m=l.getBBox();return l.remove(),l.setAttribute("viewBox",`${m.x} ${m.y} ${m.width} ${m.height}`),l}var Ds=On(wo()),Of=async(r,n,s)=>{let a=Ds.default.control({position:"bottomright"});a.onAdd=function(g){var m=Ds.default.DomUtil.create("div","legend");return m.innerHTML+='legend',m};let l=Ds.default.control({position:"bottomright"});l.onAdd=function(g){var m=Ds.default.DomUtil.create("div","legend");return m.innerHTML+='legend',m};let c=Ds.default.control({position:"bottomright"});c.onAdd=function(g){var m=Ds.default.DomUtil.create("div","legend");return m.innerHTML+='legend',m},r.on("overlayadd",function(g){switch(g.name){case"Slope":a.addTo(r);break;case"Height":l.addTo(r);break;case"Soundguide":c.addTo(r);break}}),r.on("overlayremove",function(g){switch(g.name){case"Slope":r.removeControl(a);break;case"Height":r.removeControl(l);break;case"Soundguide":r.removeControl(c);break}}),Ds.default.control.layers(void 0,n,{position:"bottomright"}).addTo(r),s.has("Slope")&&a.addTo(r),s.has("Height")&&l.addTo(r),s.has("Soundguide")&&c.addTo(r)};var Rf=On(wo());function Nf(r){return function(){let n={opacity:1,fillOpacity:0,weight:1.5,dashArray:"5"};switch(r){case"container":return{...n,fillOpacity:1,color:"#c3c3c3",weight:0};case"naturereserve":return{...n,color:"#00b521",weight:3};case"propertyborder":return{...n,color:"#e77409",weight:1};case"friends":return{...n,color:"turquoise"};case"forbidden":return{...n,color:"red",fillOpacity:.5};case"toilet":return{...n,color:"skyblue",fillOpacity:1,dashArray:"0"};case"bridge":return{...n,color:"brown",fillOpacity:1};case"oktocamp":case"publicplease":case"parking":return{...n,color:"lightblue",fillOpacity:0};case"slope":return{...n,fillOpacity:0,opacity:0};case"fireroad":return{...n,weight:1.5,dashArray:"2",color:"#f05039",fillOpacity:.15};case"plaza":return{...n,weight:2,dashArray:"4",color:"white",opacity:.5,fillOpacity:0};case"quarter":return{...n,weight:5,dashArray:"10",color:"white",opacity:.5,fillOpacity:0};case"neighbourhood":return{...n,weight:5,dashArray:"10",color:"white",opacity:.5,fillOpacity:0};case"minorroad":return{...n,weight:1,dashArray:"20",color:"black",opacity:.5,fillOpacity:0};case"area":return{dashArray:"5",color:"#e7e309",fillOpacity:0,weight:2};case"hiddenforbidden":return{color:"black",fillOpacity:1,weight:0};case"redsoundzone":return{...n,color:"#b60d0d",fillOpacity:.75,weight:0};case"orangesoundzone":return{...n,color:"#ff6f16",fillOpacity:.75,weight:0};case"yellowsoundzone":return{...n,color:"#f4e512",fillOpacity:.75,weight:0};case"closetosanctuary":case"greensoundzone":return{...n,color:"#00e300",fillOpacity:.75,weight:0};case"bluesoundzone":return{...n,color:"#29b6f3",fillOpacity:.75,weight:0};default:return{...n,color:"black"}}}}var pa=async(r,n,s)=>{let l=await(await fetch(s)).json();new Set(l.features.map(g=>g.properties[n])).forEach(g=>{let m=Rf.default.geoJSON(l,{filter:f_(n,g),style:Nf(g)});r.groups[g]=m})};function f_(r,n){return function(s){return s.properties[r]===n}}var lh=On(wo()),Af=async(r,n,s)=>{var a=lh.default.latLngBounds(s),l=lh.default.imageOverlay(n,a,{opacity:1,interactive:!1});return l};var da=null,hh=null,ch=null,ga=null,p_=new Promise(async r=>{await Promise.allSettled([customElements.whenDefined("sl-drawer")]);let n=document.getElementById("drawer"),s=document.getElementById("drawer-button");n.addEventListener("sl-request-close",a=>{n.placement!="end"&&a.detail.source==="overlay"&&a.preventDefault()}),n.addEventListener("sl-after-hide",a=>{ch&&ch(),hh&&hh(),da&&(da=null),as.page=void 0}),s.addEventListener("click",()=>{ga&&ga()}),r(n)});async function Df(r){for(let n=0;n{ch=r.onClose||null,hh=s,ga=null;let a=await p_;a.placement=r.position||"bottom";let l=a.querySelector(".container");l.innerHTML="";let g=await(await fetch(`drawers/${r.file}.html`)).text();r.file.indexOf("home")>-1&&(r.keepOpen=!0);let m=document.createElement("div");m.innerHTML=g;for(let x of Array.from(m.children))l.appendChild(x);let v=document.getElementById("drawer-button");if(n.keepOpen)v.innerHTML="Continue",ga=s;else if(da&&da.keepOpen){let x={...da};v.innerHTML="Back",ga=async()=>{await ss(x),s()}}else v.innerHTML="Close",ga=()=>a.hide();r.btn&&(v.innerHTML=r.btn),as.page=r.file,da=r,a.show()})}var cw=document.querySelector(".alert-toast-wrapper");async function Ro(r,n="primary",s="info-circle",a=3e3){let l=Object.assign(document.createElement("sl-alert"),{variant:n,closable:!0,duration:a,innerHTML:` ${r} - `});return document.body.append(l),await Promise.allSettled([customElements.whenDefined("sl-alert")]),l.toast(),l}var ga="layers:",ma="page:",ch=class{constructor(){this._leafletHash=null;this._leafletMap=null;this._hashMeta=[];this._layers=[];this._page=void 0;window.addEventListener("hashchange",()=>{if(!(location.hash.indexOf(ga)==1||location.hash.indexOf(ma)==1))return;let n=location.hash.substring(1).split("/");for(let s of n)s.indexOf(ga)==0&&(this.layers=s.substring(ga.length).split(",")),s.indexOf(ma)==0&&(this.page=s.substring(ma.length),os({file:this.page,position:"end"}))})}set map(n){this._leafletMap=n,this._leafletHash=new L.Hash(this._leafletMap)}get layers(){return this._layers}set layers(n){n instanceof Set&&(n=Array.from(n)),this._layers=n,this.encode()}get page(){return this._page}set page(n){this._page=n,this.encode()}encode(){this._hashMeta=[],this._layers.length>0&&this._hashMeta.push(ga+this._layers.join(",")),this._page&&this._page.length>0&&this._hashMeta.push(ma+this._page),this._leafletHash.setHashMeta(this._hashMeta,!0)}decode(n){this._hashMeta=n;let s=this._hashMeta.find(l=>l.startsWith(ga));this._layers=s?s.substring(ga.length).split(","):[];let a=this._hashMeta.find(l=>l.startsWith(ma));this._page=a?a.substring(ma.length):void 0,this._page&&os({file:this.page,position:"end"})}},ss=new ch;var Ir=On(Oo());var th=On(Oo());var fi=63710088e-1,Df={centimeters:fi*100,centimetres:fi*100,degrees:fi/111325,feet:fi*3.28084,inches:fi*39.37,kilometers:fi/1e3,kilometres:fi/1e3,meters:fi,metres:fi,miles:fi/1609.344,millimeters:fi*1e3,millimetres:fi*1e3,nauticalmiles:fi/1852,radians:1,yards:fi*1.0936},vw={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/fi,yards:1.0936133};function xi(r,n,s){s===void 0&&(s={});var a={type:"Feature"};return(s.id===0||s.id)&&(a.id=s.id),s.bbox&&(a.bbox=s.bbox),a.properties=n||{},a.geometry=r,a}function Gn(r,n,s){if(s===void 0&&(s={}),!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!as(r[0])||!as(r[1]))throw new Error("coordinates must contain numbers");var a={type:"Point",coordinates:r};return xi(a,n,s)}function wr(r,n,s){s===void 0&&(s={});for(var a=0,l=r;av||z>x||j>P){m=T,v=a,x=z,P=j,c=0;return}var R=Gr([m,T],s.properties);if(n(R,a,l,j,c)===!1)return!1;c++,m=T})===!1)return!1}}})}function ph(r){var n=[1/0,1/0,-1/0,-1/0];return ni(r,function(s){n[0]>s[0]&&(n[0]=s[0]),n[1]>s[1]&&(n[1]=s[1]),n[2]=2&&!Array.isArray(r[0])&&!Array.isArray(r[1]))return r;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function qn(r){if(Array.isArray(r))return r;if(r.type==="Feature"){if(r.geometry!==null)return r.geometry.coordinates}else if(r.coordinates)return r.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function dh(r,n,s){if(!r)throw new Error("No feature passed");if(!s)throw new Error(".featureOf() requires a name");if(!r||r.type!=="Feature"||!r.geometry)throw new Error("Invalid input to "+s+", Feature with geometry required");if(!r.geometry||r.geometry.type!==n)throw new Error("Invalid input to "+s+": must be a "+n+", given "+r.geometry.type)}function qr(r){return r.type==="Feature"?r.geometry:r}var x_=On(Hu(),1);var T_=On(np(),1);function Ur(r,n,s){if(s===void 0&&(s={}),!r)throw new Error("point is required");if(!n)throw new Error("polygon is required");var a=Cr(r),l=qr(n),c=l.type,g=n.bbox,m=l.coordinates;if(g&&I_(a,g)===!1)return!1;c==="Polygon"&&(m=[m]);for(var v=!1,x=0;xr[1]!=x>r[1]&&r[0]<(v-g)*(r[1]-m)/(x-m)+g;T&&(a=!a)}return a}function I_(r,n){return n[0]<=r[0]&&n[1]<=r[1]&&n[2]>=r[0]&&n[3]>=r[1]}function O_(r,n,s){s===void 0&&(s={});var a=Cr(r),l=Cr(n),c=wi(l[1]-a[1]),g=wi(l[0]-a[0]),m=wi(a[1]),v=wi(l[1]),x=Math.pow(Math.sin(c/2),2)+Math.pow(Math.sin(g/2),2)*Math.cos(m)*Math.cos(v);return $a(2*Math.atan2(Math.sqrt(x),Math.sqrt(1-x)),s.units)}var Sr=O_;var op=new ArrayBuffer(16),VL=new Float64Array(op),WL=new Uint32Array(op);var Y_=On(cp(),1);var wE=function(){function r(n){this.points=n.points||[],this.duration=n.duration||1e4,this.sharpness=n.sharpness||.85,this.centers=[],this.controls=[],this.stepLength=n.stepLength||60,this.length=this.points.length,this.delay=0;for(var s=0;sn&&(s.push(l),a=c)}return s},r.prototype.vector=function(n){var s=this.pos(n+10),a=this.pos(n-10);return{angle:180*Math.atan2(s.y-a.y,s.x-a.x)/3.14,speed:Math.sqrt((a.x-s.x)*(a.x-s.x)+(a.y-s.y)*(a.y-s.y)+(a.z-s.z)*(a.z-s.z))}},r.prototype.pos=function(n){var s=n-this.delay;s<0&&(s=0),s>this.duration&&(s=this.duration-1);var a=s/this.duration;if(a>=1)return this.points[this.length-1];var l=Math.floor((this.points.length-1)*a),c=(this.length-1)*a-l;return V_(c,this.points[l],this.controls[l][1],this.controls[l+1][0],this.points[l+1])},r}();function V_(r,n,s,a,l){var c=W_(r),g={x:l.x*c[0]+a.x*c[1]+s.x*c[2]+n.x*c[3],y:l.y*c[0]+a.y*c[1]+s.y*c[2]+n.y*c[3],z:l.z*c[0]+a.z*c[1]+s.z*c[2]+n.z*c[3]};return g}function W_(r){var n=r*r,s=n*r;return[s,3*n*(1-r),3*r*(1-r)*(1-r),(1-r)*(1-r)*(1-r)]}function ru(r,n){n===void 0&&(n={});var s=Number(r[0]),a=Number(r[1]),l=Number(r[2]),c=Number(r[3]);if(r.length===6)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var g=[s,a],m=[s,c],v=[l,c],x=[l,a];return wr([[g,x,v,m,g]],n.properties,{bbox:r,id:n.id})}function K_(r){return ru(ri(r))}var Th=K_;function us(r,n,s,a){a===void 0&&(a={});var l=Cr(r),c=wi(l[0]),g=wi(l[1]),m=wi(s),v=Qa(n,a.units),x=Math.asin(Math.sin(g)*Math.cos(v)+Math.cos(g)*Math.sin(v)*Math.cos(m)),P=c+Math.atan2(Math.sin(m)*Math.sin(v)*Math.cos(g),Math.cos(v)-Math.sin(g)*Math.sin(x)),T=Ws(P),N=Ws(x);return Gn([T,N],a.properties)}function Ms(r,n,s){if(s===void 0&&(s={}),s.final===!0)return J_(r,n);var a=Cr(r),l=Cr(n),c=wi(a[0]),g=wi(l[0]),m=wi(a[1]),v=wi(l[1]),x=Math.sin(g-c)*Math.cos(v),P=Math.cos(m)*Math.sin(v)-Math.sin(m)*Math.cos(v)*Math.cos(g-c);return Ws(Math.atan2(x,P))}function J_(r,n){var s=Ms(n,r);return s=(s+180)%360,s}function $_(r,n){n===void 0&&(n={});var s=ri(r),a=(s[0]+s[2])/2,l=(s[1]+s[3])/2;return Gn([a,l],n.properties,n)}var iu=$_;var gy=On(mp(),1);function my(r){if(!r)throw new Error("geojson is required");var n=[];return Xi(r,function(s){_y(s,n)}),Ne(n)}function _y(r,n){var s=[],a=r.geometry;if(a!==null){switch(a.type){case"Polygon":s=qn(a);break;case"LineString":s=[qn(a)]}s.forEach(function(l){var c=yy(l,r.properties);c.forEach(function(g){g.id=n.length,n.push(g)})})}}function yy(r,n){var s=[];return r.reduce(function(a,l){var c=Gr([a,l],n);return c.bbox=vy(a,l),s.push(c),l}),s}function vy(r,n){var s=r[0],a=r[1],l=n[0],c=n[1],g=sl?s:l,x=a>c?a:c;return[g,m,v,x]}var Bs=my;var Op=On(al(),1);function Zy(r,n){var s={},a=[];if(r.type==="LineString"&&(r=xi(r)),n.type==="LineString"&&(n=xi(n)),r.type==="Feature"&&n.type==="Feature"&&r.geometry!==null&&n.geometry!==null&&r.geometry.type==="LineString"&&n.geometry.type==="LineString"&&r.geometry.coordinates.length===2&&n.geometry.coordinates.length===2){var l=Ip(r,n);return l&&a.push(l),Ne(a)}var c=(0,Op.default)();return c.load(Bs(n)),Vn(Bs(r),function(g){Vn(c.search(g),function(m){var v=Ip(g,m);if(v){var x=qn(v).join(",");s[x]||(s[x]=!0,a.push(v))}})}),Ne(a)}function Ip(r,n){var s=qn(r),a=qn(n);if(s.length!==2)throw new Error(" line1 must only contain 2 coordinates");if(a.length!==2)throw new Error(" line2 must only contain 2 coordinates");var l=s[0][0],c=s[0][1],g=s[1][0],m=s[1][1],v=a[0][0],x=a[0][1],P=a[1][0],T=a[1][1],N=(T-x)*(g-l)-(P-v)*(m-c),q=(P-v)*(c-x)-(T-x)*(l-v),z=(g-l)*(c-x)-(m-c)*(l-v);if(N===0)return null;var j=q/N,R=z/N;if(j>=0&&j<=1&&R>=0&&R<=1){var B=l+j*(g-l),D=c+j*(m-c);return Gn([B,D])}return null}var zs=Zy;function Yy(r,n,s){s===void 0&&(s={});var a=Gn([1/0,1/0],{dist:1/0}),l=0;return Xi(r,function(c){for(var g=qn(c),m=0;m0&&(R=j.features[0],R.properties.dist=Sr(n,R,s),R.properties.location=l+Sr(v,R,s)),v.properties.dist0){n+=Math.abs(Ap(r[0]));for(var s=1;s2){for(m=0;m"u"?null:s.epsilon))return!0}return!1}function $y(r,n,s,a,l){var c=s[0],g=s[1],m=r[0],v=r[1],x=n[0],P=n[1],T=s[0]-m,N=s[1]-v,q=x-m,z=P-v,j=T*z-N*q;if(l!==null){if(Math.abs(j)>l)return!1}else if(j!==0)return!1;if(a){if(a==="start")return Math.abs(q)>=Math.abs(z)?q>0?m0?v=Math.abs(z)?q>0?m<=c&&c0?v<=g&&g=Math.abs(z)?q>0?m0?v=Math.abs(z)?q>0?m<=c&&c<=x:x<=c&&c<=m:z>0?v<=g&&g<=P:P<=g&&g<=v;return!1}var xo=Jy;var ov=On(qp(),1);var Up=Math.PI/180,jp=180/Math.PI,fu=function(r,n){this.lon=r,this.lat=n,this.x=Up*r,this.y=Up*n};fu.prototype.view=function(){return String(this.lon).slice(0,4)+","+String(this.lat).slice(0,4)};fu.prototype.antipode=function(){var r=-1*this.lat,n=this.lon<0?180+this.lon:(180-this.lon)*-1;return new fu(n,r)};var Hp=function(){this.coords=[],this.length=0};Hp.prototype.move_to=function(r){this.length++,this.coords.push(r)};var tc=function(r){this.properties=r||{},this.geometries=[]};tc.prototype.json=function(){if(this.geometries.length<=0)return{geometry:{type:"LineString",coordinates:null},type:"Feature",properties:this.properties};if(this.geometries.length===1)return{geometry:{type:"LineString",coordinates:this.geometries[0].coords},type:"Feature",properties:this.properties};for(var r=[],n=0;nN&&(j>P&&zP&&jv&&(v=R)}var B=[];if(m&&v0&&Math.abs(G-s[A-1][0])>N){var H=parseFloat(s[A-1][0]),K=parseFloat(s[A-1][1]),et=parseFloat(s[A][0]),X=parseFloat(s[A][1]);if(H>-180&&H-180&&s[A-1][0]P&&H<180&&et===-180&&A+1P&&s[A-1][0]<180){D.push([180,s[A][1]]),A++,D.push([s[A][0],s[A][1]]);continue}if(HP){var lt=H;H=et,et=lt;var gt=K;K=X,X=gt}if(H>P&&et=180&&HP?180:-180,Q]),D=[],D.push([s[A-1][0]>P?-180:180,Q]),B.push(D)}else D=[],B.push(D);D.push([G,s[A][1]])}else D.push([s[A][0],s[A][1]])}}else{var kt=[];B.push(kt);for(var ct=0;ct0)-(r<0)||+r}function Oa(r,n,s){var a=n[0]-r[0],l=n[1]-r[1],c=s[0]-n[0],g=s[1]-n[1];return r1(a*g-c*l)}function bg(r,n){var s=r.geometry.coordinates[0].map(function(g){return g[0]}),a=r.geometry.coordinates[0].map(function(g){return g[1]}),l=n.geometry.coordinates[0].map(function(g){return g[0]}),c=n.geometry.coordinates[0].map(function(g){return g[1]});return Math.max.apply(null,s)===Math.max.apply(null,l)&&Math.max.apply(null,a)===Math.max.apply(null,c)&&Math.min.apply(null,s)===Math.min.apply(null,l)&&Math.min.apply(null,a)===Math.min.apply(null,c)}function Nc(r,n){return n.geometry.coordinates[0].every(function(s){return Ur(Gn(s),r)})}function Eg(r,n){return r[0]===n[0]&&r[1]===n[1]}var i1=function(){function r(n){this.id=r.buildId(n),this.coordinates=n,this.innerEdges=[],this.outerEdges=[],this.outerEdgesSorted=!1}return r.buildId=function(n){return n.join(",")},r.prototype.removeInnerEdge=function(n){this.innerEdges=this.innerEdges.filter(function(s){return s.from.id!==n.from.id})},r.prototype.removeOuterEdge=function(n){this.outerEdges=this.outerEdges.filter(function(s){return s.to.id!==n.to.id})},r.prototype.addOuterEdge=function(n){this.outerEdges.push(n),this.outerEdgesSorted=!1},r.prototype.sortOuterEdges=function(){var n=this;this.outerEdgesSorted||(this.outerEdges.sort(function(s,a){var l=s.to,c=a.to;if(l.coordinates[0]-n.coordinates[0]>=0&&c.coordinates[0]-n.coordinates[0]<0)return 1;if(l.coordinates[0]-n.coordinates[0]<0&&c.coordinates[0]-n.coordinates[0]>=0)return-1;if(l.coordinates[0]-n.coordinates[0]===0&&c.coordinates[0]-n.coordinates[0]===0)return l.coordinates[1]-n.coordinates[1]>=0||c.coordinates[1]-n.coordinates[1]>=0?l.coordinates[1]-c.coordinates[1]:c.coordinates[1]-l.coordinates[1];var g=Oa(n.coordinates,l.coordinates,c.coordinates);if(g<0)return 1;if(g>0)return-1;var m=Math.pow(l.coordinates[0]-n.coordinates[0],2)+Math.pow(l.coordinates[1]-n.coordinates[1],2),v=Math.pow(c.coordinates[0]-n.coordinates[0],2)+Math.pow(c.coordinates[1]-n.coordinates[1],2);return m-v}),this.outerEdgesSorted=!0)},r.prototype.getOuterEdges=function(){return this.sortOuterEdges(),this.outerEdges},r.prototype.getOuterEdge=function(n){return this.sortOuterEdges(),this.outerEdges[n]},r.prototype.addInnerEdge=function(n){this.innerEdges.push(n)},r}(),Rc=i1;var o1=function(){function r(n,s){this.from=n,this.to=s,this.next=void 0,this.label=void 0,this.symetric=void 0,this.ring=void 0,this.from.addOuterEdge(this),this.to.addInnerEdge(this)}return r.prototype.getSymetric=function(){return this.symetric||(this.symetric=new r(this.to,this.from),this.symetric.symetric=this),this.symetric},r.prototype.deleteEdge=function(){this.from.removeOuterEdge(this),this.to.removeInnerEdge(this)},r.prototype.isEqual=function(n){return this.from.id===n.from.id&&this.to.id===n.to.id},r.prototype.toString=function(){return"Edge { "+this.from.id+" -> "+this.to.id+" }"},r.prototype.toLineString=function(){return Gr([this.from.coordinates,this.to.coordinates])},r.prototype.compareTo=function(n){return Oa(n.from.coordinates,n.to.coordinates,this.to.coordinates)},r}(),Mg=o1;var s1=function(){function r(){this.edges=[],this.polygon=void 0,this.envelope=void 0}return r.prototype.push=function(n){this.edges.push(n),this.polygon=this.envelope=void 0},r.prototype.get=function(n){return this.edges[n]},Object.defineProperty(r.prototype,"length",{get:function(){return this.edges.length},enumerable:!0,configurable:!0}),r.prototype.forEach=function(n){this.edges.forEach(n)},r.prototype.map=function(n){return this.edges.map(n)},r.prototype.some=function(n){return this.edges.some(n)},r.prototype.isValid=function(){return!0},r.prototype.isHole=function(){var n=this,s=this.edges.reduce(function(g,m,v){return m.from.coordinates[1]>n.edges[g].from.coordinates[1]&&(g=v),g},0),a=(s===0?this.length:s)-1,l=(s+1)%this.length,c=Oa(this.edges[a].from.coordinates,this.edges[s].from.coordinates,this.edges[l].from.coordinates);return c===0?this.edges[a].from.coordinates[0]>this.edges[l].from.coordinates[0]:c>0},r.prototype.toMultiPoint=function(){return fh(this.edges.map(function(n){return n.from.coordinates}))},r.prototype.toPolygon=function(){if(this.polygon)return this.polygon;var n=this.edges.map(function(s){return s.from.coordinates});return n.push(this.edges[0].from.coordinates),this.polygon=wr([n])},r.prototype.getEnvelope=function(){return this.envelope?this.envelope:this.envelope=Th(this.toPolygon())},r.findEdgeRingContaining=function(n,s){var a=n.getEnvelope(),l,c;return s.forEach(function(g){var m=g.getEnvelope();if(c&&(l=c.getEnvelope()),!bg(m,a)&&Nc(m,a)){for(var v=n.map(function(z){return z.from.coordinates}),x=void 0,P=function(z){g.some(function(j){return Eg(z,j.from.coordinates)})||(x=z)},T=0,N=v;T"u"?Object.keys(this.nodes).forEach(function(a){return s._computeNextCWEdges(s.nodes[a])}):n.getOuterEdges().forEach(function(a,l){n.getOuterEdge((l===0?n.getOuterEdges().length:l)-1).symetric.next=a})},r.prototype._computeNextCCWEdges=function(n,s){for(var a=n.getOuterEdges(),l,c,g=a.length-1;g>=0;--g){var m=a[g],v=m.symetric,x=void 0,P=void 0;m.label===s&&(x=m),v.label===s&&(P=v),!(!x||!P)&&(P&&(c=P),x&&(c&&(c.next=x,c=void 0),l||(l=x)))}c&&(c.next=l)},r.prototype._findLabeledEdgeRings=function(){var n=[],s=0;return this.edges.forEach(function(a){if(!(a.label>=0)){n.push(a);var l=a;do l.label=s,l=l.next;while(!a.isEqual(l));s++}}),n},r.prototype.getEdgeRings=function(){var n=this;this._computeNextCWEdges(),this.edges.forEach(function(a){a.label=void 0}),this._findLabeledEdgeRings().forEach(function(a){n._findIntersectionNodes(a).forEach(function(l){n._computeNextCCWEdges(l,a.label)})});var s=[];return this.edges.forEach(function(a){a.ring||s.push(n._findEdgeRing(a))}),s},r.prototype._findIntersectionNodes=function(n){var s=[],a=n,l=function(){var c=0;a.from.getOuterEdges().forEach(function(g){g.label===n.label&&++c}),c>1&&s.push(a.from),a=a.next};do l();while(!n.isEqual(a));return s},r.prototype._findEdgeRing=function(n){var s=n,a=new Ac;do a.push(s),s.ring=a,s=s.next;while(!n.isEqual(s));return a},r.prototype.removeNode=function(n){var s=this;n.getOuterEdges().forEach(function(a){return s.removeEdge(a)}),n.innerEdges.forEach(function(a){return s.removeEdge(a)}),delete this.nodes[n.id]},r.prototype.removeEdge=function(n){this.edges=this.edges.filter(function(s){return!s.isEqual(n)}),n.deleteEdge()},r}();function Cs(r,n){var s=qr(r),a=qr(n),l=s.type,c=a.type,g=s.coordinates,m=a.coordinates;switch(l){case"Point":switch(c){case"Point":return Dc(g,m);default:throw new Error("feature2 "+c+" geometry not supported")}case"MultiPoint":switch(c){case"Point":return u1(s,a);case"MultiPoint":return l1(s,a);default:throw new Error("feature2 "+c+" geometry not supported")}case"LineString":switch(c){case"Point":return xo(a,s,{ignoreEndVertices:!0});case"LineString":return f1(s,a);case"MultiPoint":return h1(s,a);default:throw new Error("feature2 "+c+" geometry not supported")}case"Polygon":switch(c){case"Point":return Ur(a,s,{ignoreBoundary:!0});case"LineString":return p1(s,a);case"Polygon":return d1(s,a);case"MultiPoint":return c1(s,a);default:throw new Error("feature2 "+c+" geometry not supported")}default:throw new Error("feature1 "+l+" geometry not supported")}}function u1(r,n){var s,a=!1;for(s=0;sn[0]||r[2]n[1]||r[3]0}var y1=On(Bc(),1);var x1=On(Dg(),1);var C1=On(Zg(),1);function Vg(r){for(var n=r,s=[];n.parent;)s.unshift(n),n=n.parent;return s}function k1(){return new Wg(function(r){return r.f})}var qc={search:function(r,n,s,a){r.cleanDirty(),a=a||{};var l=a.heuristic||qc.heuristics.manhattan,c=a.closest||!1,g=k1(),m=n;for(n.h=l(n,s),g.push(n);g.size()>0;){var v=g.pop();if(v===s)return Vg(v);v.closed=!0;for(var x=r.neighbors(v),P=0,T=x.length;P0&&(this.content[0]=n,this.bubbleUp(0)),r},remove:function(r){var n=this.content.indexOf(r),s=this.content.pop();n!==this.content.length-1&&(this.content[n]=s,this.scoreFunction(s)0;){var s=(r+1>>1)-1,a=this.content[s];if(this.scoreFunction(n)0)){if(j/=q,q<0){if(j0){if(j>N)return;j>T&&(T=j)}if(j=a-m,!(!q&&j<0)){if(j/=q,q<0){if(j>N)return;j>T&&(T=j)}else if(q>0){if(j0)){if(j/=z,z<0){if(j0){if(j>N)return;j>T&&(T=j)}if(j=l-v,!(!z&&j<0)){if(j/=z,z<0){if(j>N)return;j>T&&(T=j)}else if(z>0){if(j0)&&!(N<1)||(T>0&&(r[0]=[m+T*q,v+T*z]),N<1&&(r[1]=[m+N*q,v+N*z])),!0}}}}}function I1(r,n,s,a,l){var c=r[1];if(c)return!0;var g=r[0],m=r.left,v=r.right,x=m[0],P=m[1],T=v[0],N=v[1],q=(x+T)/2,z=(P+N)/2,j,R;if(N===P){if(q=a)return;if(x>T){if(!g)g=[q,s];else if(g[1]>=l)return;c=[q,l]}else{if(!g)g=[q,l];else if(g[1]1)if(x>T){if(!g)g=[(s-R)/j,s];else if(g[1]>=l)return;c=[(l-R)/j,l]}else{if(!g)g=[(l-R)/j,l];else if(g[1]=a)return;c=[a,j*a+R]}else{if(!g)g=[a,j*a+R];else if(g[0]Jn||Math.abs(c[0][1]-c[1][1])>Jn))&&delete Li[l]}function $g(r){return $i[r.index]={site:r,halfedges:[]}}function O1(r,n){var s=r.site,a=n.left,l=n.right;return s===l&&(l=a,a=s),l?Math.atan2(l[1]-a[1],l[0]-a[0]):(s===a?(a=n[1],l=n[0]):(a=n[0],l=n[1]),Math.atan2(a[0]-l[0],l[1]-a[1]))}function Hc(r,n){return n[+(n.left!==r.site)]}function N1(r,n){return n[+(n.left===r.site)]}function Qg(){for(var r=0,n=$i.length,s,a,l,c;rJn||Math.abs(R-q)>Jn)&&(x.splice(v,0,Li.push(Da(m,z,Math.abs(j-r)Jn?[r,Math.abs(N-r)Jn?[Math.abs(q-a)Jn?[s,Math.abs(N-s)Jn?[Math.abs(q-n)=-nm)){var q=v*v+x*x,z=P*P+T*T,j=(T*q-x*z)/N,R=(v*z-P*q)/N,B=em.pop()||new R1;B.arc=r,B.site=l,B.x=j+g,B.y=(B.cy=R+m)+Math.sqrt(j*j+R*R),r.circle=B;for(var D=null,A=Ba._;A;)if(B.yJn)m=m.L;else if(g=n-D1(m,s),g>Jn){if(!m.R){a=m;break}m=m.R}else{c>-Jn?(a=m.P,l=m):g>-Jn?(a=m,l=m.N):a=l=m;break}$g(r);var v=rm(r);if(ra.insert(a,v),!(!a&&!l)){if(a===l){na(a),l=rm(a.site),ra.insert(v,l),v.edge=l.edge=Aa(a.site,v.site),ea(a),ea(l);return}if(!l){v.edge=Aa(a.site,v.site);return}na(a),na(l);var x=a.site,P=x[0],T=x[1],N=r[0]-P,q=r[1]-T,z=l.site,j=z[0]-P,R=z[1]-T,B=2*(N*R-q*j),D=N*N+q*q,A=j*j+R*R,G=[(R*D-q*A)/B+P,(N*A-j*D)/B+T];wu(l.edge,x,z,G),v.edge=Aa(x,r,null,G),l.edge=Aa(r,z,null,G),ea(a),ea(l)}}function am(r,n){var s=r.site,a=s[0],l=s[1],c=l-n;if(!c)return a;var g=r.P;if(!g)return-1/0;s=g.site;var m=s[0],v=s[1],x=v-n;if(!x)return m;var P=m-a,T=1/c-1/x,N=P/x;return T?(-N+Math.sqrt(N*N-2*T*(P*P/(-2*x)-v+x/2+l-c/2)))/T+a:(a+m)/2}function D1(r,n){var s=r.N;if(s)return am(s,n);var a=r.site;return a[1]===n?a[0]:1/0}var Jn=1e-6,nm=1e-12,ra,$i,Ba,Li;function B1(r,n,s){return(r[0]-s[0])*(n[1]-r[1])-(r[0]-n[0])*(s[1]-r[1])}function F1(r,n){return n[1]-r[1]||n[0]-r[0]}function Tl(r,n){var s=r.sort(F1).pop(),a,l,c;for(Li=[],$i=new Array(r.length),ra=new jc,Ba=new jc;;)if(c=kl,s&&(!c||s[1]=g)return null;var v=r-m.site[0],x=n-m.site[1],P=v*v+x*x;do m=a.cells[l=c],c=null,m.halfedges.forEach(function(T){var N=a.edges[T],q=N.left;if(!((q===m.site||!q)&&!(q=N.right))){var z=r-q[0],j=n-q[1],R=z*z+j*j;R1?0:r<-1?ln:Math.acos(r)}function gi(r){return r>1?di:r<-1?-di:Math.asin(r)}function to(){}function Bl(r,n){r&&dm.hasOwnProperty(r.type)&&dm[r.type](r,n)}var pm={Feature:function(r,n){Bl(r.geometry,n)},FeatureCollection:function(r,n){for(var s=r.features,a=-1,l=s.length;++aln?r-Ai:r<-ln?r+Ai:r,n]}Wc.invert=Wc;function Kc(r,n,s){return(r%=Ai)?n||s?zl(_m(r),ym(n,s)):_m(r):n||s?ym(n,s):Wc}function mm(r){return function(n,s){return n+=r,[n>ln?n-Ai:n<-ln?n+Ai:n,s]}}function _m(r){var n=mm(r);return n.invert=mm(-r),n}function ym(r,n){var s=ye(r),a=ve(r),l=ye(n),c=ve(n);function g(m,v){var x=ye(v),P=ye(m)*x,T=ve(m)*x,N=ve(v),q=N*s+P*a;return[bi(T*l-q*c,P*s-N*a),gi(q*l+T*c)]}return g.invert=function(m,v){var x=ye(v),P=ye(m)*x,T=ve(m)*x,N=ve(v),q=N*l-T*c;return[bi(T*l+N*c,P*s+q*a),gi(q*s-P*a)]},g}function xm(r,n,s,a,l,c){if(s){var g=ye(n),m=ve(n),v=a*s;l==null?(l=n+a*Ai,c=n-v/2):(l=vm(g,l),c=vm(g,c),(a>0?lc)&&(l+=a*Ai));for(var x,P=l;a>0?P>c:P1&&r.push(r.pop().concat(r.shift()))},result:function(){var s=r;return r=[],n=null,s}}}function wm(r,n,s,a,l,c){var g=r[0],m=r[1],v=n[0],x=n[1],P=0,T=1,N=v-g,q=x-m,z;if(z=s-g,!(!N&&z>0)){if(z/=N,N<0){if(z0){if(z>T)return;z>P&&(P=z)}if(z=l-g,!(!N&&z<0)){if(z/=N,N<0){if(z>T)return;z>P&&(P=z)}else if(N>0){if(z0)){if(z/=q,q<0){if(z0){if(z>T)return;z>P&&(P=z)}if(z=c-m,!(!q&&z<0)){if(z/=q,q<0){if(z>T)return;z>P&&(P=z)}else if(q>0){if(z0&&(r[0]=g+P*N,r[1]=m+P*q),T<1&&(n[0]=g+T*N,n[1]=m+T*q),!0}}}}}function qa(r,n){return Fn(r[0]-n[0])=0;--m)l.point((T=P[m])[0],T[1]);else a(N.x,N.p.x,-1,l);N=N.p}N=N.o,P=N.z,q=!q}while(!N.v);l.lineEnd()}}}function Lm(r){if(n=r.length){for(var n,s=0,a=r[0],l;++sn?1:r>=n?0:NaN}function Jc(r){return r.length===1&&(r=V1(r)),{left:function(n,s,a,l){for(a==null&&(a=0),l==null&&(l=n.length);a>>1;r(n[c],s)<0?a=c+1:l=c}return a},right:function(n,s,a,l){for(a==null&&(a=0),l==null&&(l=n.length);a>>1;r(n[c],s)>0?l=c:a=c+1}return a}}}function V1(r){return function(n,s){return Hs(r(n),s)}}var bm=Jc(Hs),W1=bm.right,K1=bm.left;var Em=Array.prototype,$1=Em.slice,Q1=Em.map;var YN=Math.sqrt(50),VN=Math.sqrt(10),WN=Math.sqrt(2);function Pu(r){for(var n=r.length,s,a=-1,l=0,c,g;++a=0;)for(g=r[n],s=g.length;--s>=0;)c[--l]=g[s];return c}var Cu=1e9,Hl=-Cu;function $c(r,n,s,a){function l(x,P){return r<=x&&x<=s&&n<=P&&P<=a}function c(x,P,T,N){var q=0,z=0;if(x==null||(q=g(x,T))!==(z=g(P,T))||v(x,P)<0^T>0)do N.point(q===0||q===3?r:s,q>1?a:n);while((q=(q+T+4)%4)!==z);else N.point(P[0],P[1])}function g(x,P){return Fn(x[0]-r)0?0:3:Fn(x[0]-s)0?2:1:Fn(x[1]-n)0?1:0:P>0?3:2}function m(x,P){return v(x.x,P.x)}function v(x,P){var T=g(x,1),N=g(P,1);return T!==N?T-N:T===0?P[1]-x[1]:T===1?x[0]-P[0]:T===2?x[1]-P[1]:P[0]-x[0]}return function(x){var P=x,T=Gl(),N,q,z,j,R,B,D,A,G,H,K,et={point:X,lineStart:Q,lineEnd:kt,polygonStart:gt,polygonEnd:Et};function X(bt,Mt){l(bt,Mt)&&P.point(bt,Mt)}function lt(){for(var bt=0,Mt=0,Xt=q.length;Mta&&(Tt-Ot)*(a-Qt)>(ce-Qt)*(r-Ot)&&++bt:ce<=a&&(Tt-Ot)*(a-Qt)<(ce-Qt)*(r-Ot)&&--bt;return bt}function gt(){P=T,N=[],q=[],K=!0}function Et(){var bt=lt(),Mt=K&&bt,Xt=(N=Pu(N)).length;(Mt||Xt)&&(x.polygonStart(),Mt&&(x.lineStart(),c(null,null,1,x),x.lineEnd()),Xt&&Ul(N,m,bt,c,x),x.polygonEnd()),P=x,N=q=z=null}function Q(){et.point=ct,q&&q.push(z=[]),H=!0,G=!1,D=A=NaN}function kt(){N&&(ct(j,R),B&&G&&T.rejoin(),N.push(T.result())),et.point=X,G&&P.lineEnd()}function ct(bt,Mt){var Xt=l(bt,Mt);if(q&&z.push([bt,Mt]),H)j=bt,R=Mt,B=Xt,H=!1,Xt&&(P.lineStart(),P.point(bt,Mt));else if(Xt&&G)P.point(bt,Mt);else{var ft=[D=Math.max(Hl,Math.min(Cu,D)),A=Math.max(Hl,Math.min(Cu,A))],Ct=[bt=Math.max(Hl,Math.min(Cu,bt)),Mt=Math.max(Hl,Math.min(Cu,Mt))];wm(ft,Ct,r,n,s,a)?(G||(P.lineStart(),P.point(ft[0],ft[1])),P.point(Ct[0],Ct[1]),Xt||P.lineEnd(),K=!1):Xt&&(P.lineStart(),P.point(bt,Mt),K=!1)}D=bt,A=Mt,G=Xt}return et}}var Qc=lo();function tf(r,n){var s=n[0],a=n[1],l=[ve(s),-ye(s),0],c=0,g=0;Qc.reset();for(var m=0,v=r.length;m=0?1:-1,X=et*K,lt=X>ln,gt=z*G;if(Qc.add(bi(gt*et*ve(X),j*H+gt*ye(X))),c+=lt?K+et*Ai:K,lt^N>=s^D>=s){var Et=ia(Wo(T),Wo(B));Ga(Et);var Q=ia(l,Et);Ga(Q);var kt=(lt^K>=0?-1:1)*gi(Q[2]);(a>kt||a===kt&&(Et[0]||Et[1]))&&(g+=lt^K>=0?1:-1)}}return(c<-Ee||cku&&(ku=r),nZl&&(Zl=n)}var Yl=lx;function ef(r){this._context=r}ef.prototype={_radius:4.5,pointRadius:function(r){return this._radius=r,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(r,n){switch(this._point){case 0:{this._context.moveTo(r,n),this._point=1;break}case 1:{this._context.lineTo(r,n);break}default:{this._context.moveTo(r+this._radius,n),this._context.arc(r,n,this._radius,0,Ai);break}}},result:to};var yD=lo();function nf(){this._string=[]}nf.prototype={_radius:4.5,_circle:Cm(4.5),pointRadius:function(r){return(r=+r)!==this._radius&&(this._radius=r,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(r,n){switch(this._point){case 0:{this._string.push("M",r,",",n),this._point=1;break}case 1:{this._string.push("L",r,",",n);break}default:{this._circle==null&&(this._circle=Cm(this._radius)),this._string.push("M",r,",",n,this._circle);break}}},result:function(){if(this._string.length){var r=this._string.join("");return this._string=[],r}else return null}};function Cm(r){return"m0,"+r+"a"+r+","+r+" 0 1,1 0,"+-2*r+"a"+r+","+r+" 0 1,1 0,"+2*r+"z"}function Vl(r,n,s,a){return function(l,c){var g=n(c),m=l.invert(a[0],a[1]),v=Gl(),x=n(v),P=!1,T,N,q,z={point:j,lineStart:B,lineEnd:D,polygonStart:function(){z.point=A,z.lineStart=G,z.lineEnd=H,N=[],T=[]},polygonEnd:function(){z.point=j,z.lineStart=B,z.lineEnd=D,N=Pu(N);var K=tf(T,m);N.length?(P||(c.polygonStart(),P=!0),Ul(N,fx,K,s,c)):K&&(P||(c.polygonStart(),P=!0),c.lineStart(),s(null,null,1,c),c.lineEnd()),P&&(c.polygonEnd(),P=!1),N=T=null},sphere:function(){c.polygonStart(),c.lineStart(),s(null,null,1,c),c.lineEnd(),c.polygonEnd()}};function j(K,et){var X=l(K,et);r(K=X[0],et=X[1])&&c.point(K,et)}function R(K,et){var X=l(K,et);g.point(X[0],X[1])}function B(){z.point=R,g.lineStart()}function D(){z.point=j,g.lineEnd()}function A(K,et){q.push([K,et]);var X=l(K,et);x.point(X[0],X[1])}function G(){x.lineStart(),q=[]}function H(){A(q[0][0],q[0][1]),x.lineEnd();var K=x.clean(),et=v.result(),X,lt=et.length,gt,Et,Q;if(q.pop(),T.push(q),q=null,!!lt){if(K&1){if(Et=et[0],(gt=Et.length-1)>0){for(P||(c.polygonStart(),P=!0),c.lineStart(),X=0;X1&&K&2&&et.push(et.pop().concat(et.shift())),N.push(et.filter(cx))}}return z}}function cx(r){return r.length>1}function fx(r,n){return((r=r.x)[0]<0?r[1]-di-Ee:di-r[1])-((n=n.x)[0]<0?n[1]-di-Ee:di-n[1])}var rf=Vl(function(){return!0},px,gx,[-ln,-di]);function px(r){var n=NaN,s=NaN,a=NaN,l;return{lineStart:function(){r.lineStart(),l=1},point:function(c,g){var m=c>0?ln:-ln,v=Fn(c-n);Fn(v-ln)0?di:-di),r.point(a,s),r.lineEnd(),r.lineStart(),r.point(m,s),r.point(c,s),l=0):a!==m&&v>=ln&&(Fn(n-a)Ee?Vo((ve(n)*(c=ye(a))*ve(s)-ve(a)*(l=ye(n))*ve(r))/(l*c*g)):(n+a)/2}function gx(r,n,s,a){var l;if(r==null)l=s*di,a.point(-ln,l),a.point(0,l),a.point(ln,l),a.point(ln,0),a.point(ln,-l),a.point(0,-l),a.point(-ln,-l),a.point(-ln,0),a.point(-ln,l);else if(Fn(r[0]-n[0])>Ee){var c=r[0]0,l=Fn(s)>Ee;function c(P,T,N,q){xm(q,r,n,N,P,T)}function g(P,T){return ye(P)*ye(T)>s}function m(P){var T,N,q,z,j;return{lineStart:function(){z=q=!1,j=1},point:function(R,B){var D=[R,B],A,G=g(R,B),H=a?G?0:x(R,B):G?x(R+(R<0?ln:-ln),B):0;if(!T&&(z=q=G)&&P.lineStart(),G!==q&&(A=v(T,D),(!A||qa(T,A)||qa(D,A))&&(D[0]+=Ee,D[1]+=Ee,G=g(D[0],D[1]))),G!==q)j=0,G?(P.lineStart(),A=v(D,T),P.point(A[0],A[1])):(A=v(T,D),P.point(A[0],A[1]),P.lineEnd()),T=A;else if(l&&T&&a^G){var K;!(H&N)&&(K=v(D,T,!0))&&(j=0,a?(P.lineStart(),P.point(K[0][0],K[0][1]),P.point(K[1][0],K[1][1]),P.lineEnd()):(P.point(K[1][0],K[1][1]),P.lineEnd(),P.lineStart(),P.point(K[0][0],K[0][1])))}G&&(!T||!qa(T,D))&&P.point(D[0],D[1]),T=D,q=G,N=H},lineEnd:function(){q&&P.lineEnd(),T=null},clean:function(){return j|(z&&q)<<1}}}function v(P,T,N){var q=Wo(P),z=Wo(T),j=[1,0,0],R=ia(q,z),B=Eu(R,R),D=R[0],A=B-D*D;if(!A)return!N&&P;var G=s*B/A,H=-s*D/A,K=ia(j,R),et=Mu(j,G),X=Mu(R,H);Fl(et,X);var lt=K,gt=Eu(et,lt),Et=Eu(lt,lt),Q=gt*gt-Et*(Eu(et,et)-1);if(!(Q<0)){var kt=ii(Q),ct=Mu(lt,(-gt-kt)/Et);if(Fl(ct,et),ct=za(ct),!N)return ct;var bt=P[0],Mt=T[0],Xt=P[1],ft=T[1],Ct;Mt0^ct[1]<(Fn(ct[0]-bt)ln^(bt<=ct[0]&&ct[0]<=Mt)){var Qt=Mu(lt,(-gt+kt)/Et);return Fl(Qt,et),[ct,za(Qt)]}}}function x(P,T){var N=a?r:ln-r,q=0;return P<-N?q|=1:P>N&&(q|=2),T<-N?q|=4:T>N&&(q|=8),q}return Vl(g,m,c,a?[0,-r]:[-ln,r-ln])}function Tu(r){return function(n){var s=new of;for(var a in r)s[a]=r[a];return s.stream=n,s}}function of(){}of.prototype={constructor:of,point:function(r,n){this.stream.point(r,n)},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 Iu(r,n,s){var a=n[1][0]-n[0][0],l=n[1][1]-n[0][1],c=r.clipExtent&&r.clipExtent();r.scale(150).translate([0,0]),c!=null&&r.clipExtent(null),js(s,r.stream(Yl));var g=Yl.result(),m=Math.min(a/(g[1][0]-g[0][0]),l/(g[1][1]-g[0][1])),v=+n[0][0]+(a-m*(g[1][0]+g[0][0]))/2,x=+n[0][1]+(l-m*(g[1][1]+g[0][1]))/2;return c!=null&&r.clipExtent(c),r.scale(m*150).translate([v,x])}function Wl(r,n,s){return Iu(r,[[0,0],n],s)}var km=16,mx=ye(30*Tr);function sf(r,n){return+n?yx(r,n):_x(r)}function _x(r){return Tu({point:function(n,s){n=r(n,s),this.stream.point(n[0],n[1])}})}function yx(r,n){function s(a,l,c,g,m,v,x,P,T,N,q,z,j,R){var B=x-a,D=P-l,A=B*B+D*D;if(A>4*n&&j--){var G=g+N,H=m+q,K=v+z,et=ii(G*G+H*H+K*K),X=gi(K/=et),lt=Fn(Fn(K)-1)n||Fn((B*kt+D*ct)/A-.5)>.3||g*N+m*q+v*z2?ct[2]%360*Tr:0,Q()):[x*Qi,P*Qi,T*Qi]},lt.precision=function(ct){return arguments.length?(K=sf(Et,H=ct*ct),kt()):ii(H)},lt.fitExtent=function(ct,bt){return Iu(lt,ct,bt)},lt.fitSize=function(ct,bt){return Wl(lt,ct,bt)};function Q(){q=zl(N=Kc(x,P,T),n);var ct=n(m,v);return c=a-ct[0]*s,g=l+ct[1]*s,kt()}function kt(){return et=X=null,lt}return function(){return n=r.apply(this,arguments),lt.invert=n.invert&>,Q()}}function Kl(r){return function(n,s){var a=ye(n),l=ye(s),c=r(a*l);return[c*l*ve(n),c*ve(s)]}}function ds(r){return function(n,s){var a=ii(n*n+s*s),l=r(a),c=ve(l),g=ye(l);return[bi(n*c,a*g),gi(a&&s*c/a)]}}var Nm=Kl(function(r){return ii(2/(1+r))});Nm.invert=ds(function(r){return 2*gi(r/2)});var uf=Kl(function(r){return(r=Dl(r))&&r/ve(r)});uf.invert=ds(function(r){return r});function lf(){return Ko(uf).scale(79.4188).clipAngle(180-.001)}function hf(r,n){return[r,Lu(bu((di+n)/2))]}hf.invert=function(r,n){return[r,2*Vo(Al(n))-di]};function Jl(r,n){return[r,n]}Jl.invert=Jl;function Rm(r,n){var s=ye(n),a=ye(r)*s;return[s*ve(r)/a,ve(n)/a]}Rm.invert=ds(Vo);function Am(r,n){var s=n*n,a=s*s;return[r*(.8707-.131979*s+a*(-.013791+a*(.003971*s-.001529*a))),n*(1.007226+s*(.015085+a*(-.044475+.028874*s-.005916*a)))]}Am.invert=function(r,n){var s=n,a=25,l;do{var c=s*s,g=c*c;s-=l=(s*(1.007226+c*(.015085+g*(-.044475+.028874*c-.005916*g)))-n)/(1.007226+c*(.015085*3+g*(-.044475*7+.028874*9*c-.005916*11*g)))}while(Fn(l)>Ee&&--a>0);return[r/(.8707+(c=s*s)*(-.131979+c*(-.013791+c*c*c*(.003971-.001529*c)))),s]};function Dm(r,n){return[ye(n)*ve(r),ve(n)]}Dm.invert=ds(gi);function Bm(r,n){var s=ye(n),a=1+ye(r)*s;return[s*ve(r)/a,ve(n)/a]}Bm.invert=ds(function(r){return 2*Vo(r)});function Fm(r,n){return[Lu(bu((di+n)/2)),-r]}Fm.invert=function(r,n){return[-n,2*Vo(Al(r))-di]};function Lx(r,n,s){s=s||{};var a=s.units||"kilometers",l=s.steps||8;if(!r)throw new Error("geojson is required");if(typeof s!="object")throw new Error("options must be an object");if(typeof l!="number")throw new Error("steps must be an number");if(n===void 0)throw new Error("radius is required");if(l<=0)throw new Error("steps must be greater than 0");var c=[];switch(r.type){case"GeometryCollection":return Zo(r,function(g){var m=$l(g,n,a,l);m&&c.push(m)}),Ne(c);case"FeatureCollection":return Vn(r,function(g){var m=$l(g,n,a,l);m&&Vn(m,function(v){v&&c.push(v)})}),Ne(c)}return $l(r,n,a,l)}function $l(r,n,s,a){var l=r.properties||{},c=r.type==="Feature"?r.geometry:r;if(c.type==="GeometryCollection"){var g=[];return Zo(r,function(j){var R=$l(j,n,s,a);R&&g.push(R)}),Ne(g)}var m=bx(c),v={type:c.type,coordinates:Gm(c.coordinates,m)},x=new ja.GeoJSONReader,P=x.read(v),T=$a(Qa(n,s),"meters"),N=ja.BufferOp.bufferOp(P,T,a),q=new ja.GeoJSONWriter;if(N=q.write(N),!zm(N.coordinates)){var z={type:N.type,coordinates:qm(N.coordinates,m)};return xi(z,l)}}function zm(r){return Array.isArray(r[0])?zm(r[0]):isNaN(r[0])}function Gm(r,n){return typeof r[0]!="object"?n(r):r.map(function(s){return Gm(s,n)})}function qm(r,n){return typeof r[0]!="object"?n.invert(r):r.map(function(s){return qm(s,n)})}function bx(r){var n=iu(r).geometry.coordinates,s=[-n[0],-n[1]];return lf().rotate(s).scale(fi)}var Ou=Lx;var Ex=On(Fa(),1);var Mx=On(Fa(),1);var Cx=On(Fa(),1);var Sx=On(Fa(),1);var oa=On(Ql()),gf="#7ae9ff",mf={color:gf,fillColor:gf,fillOpacity:.3,weight:1},Bx={color:"#ffbb00",fillColor:"#ffbb00",fillOpacity:.75,weight:3},Fx={color:"#ff0000",fillColor:"#ff0000",fillOpacity:.95,weight:5},df="#00FF40",ks=class{constructor(n,s){this._bufferWidth=5;this._sqmPerPerson=10;this._sqmPerVehicle=70;this.supressWarnings=!1;this.id=n.id,this._rules=s,this.revision=n.revision,this.timeStamp=n.timeStamp,this.isDeleted=n.isDeleted,this.deleteReason=n.deleteReason,this._originalGeoJson=n.geoJson;let a=JSON.parse(n.geoJson);this.layer=new th.GeoJSON(a,{pmIgnore:!1,interactive:!0,bubblingMouseEvents:!1,snapIgnore:!0,style:()=>this.GetDefaultLayerStyle()}),this.revisions={},this.name=oa.default.sanitize(a.properties.name),this.contactInfo=oa.default.sanitize(a.properties.contactInfo)??"",this.description=oa.default.sanitize(a.properties.description)??"",this.nrOfPeople=a.properties.nrOfPeople??"0",this.nrOfVehicles=a.properties.nrOfVechiles??"0",this.additionalSqm=a.properties.additionalSqm??"0",this.powerNeed=a.properties.powerNeed??void 0,Number.isNaN(Number(a.properties.powerNeed))?this.powerNeed=-1:this.powerNeed=Number(a.properties.powerNeed),Number.isNaN(Number(a.properties.amplifiedSound))?this.amplifiedSound=-1:this.amplifiedSound=Number(a.properties.amplifiedSound),this.color=a.properties.color??gf,this.supressWarnings=a.properties.supressWarnings??!1,this.updateBufferedLayer()}get calculatedAreaNeeded(){try{let n=0;return this.nrOfPeople&&(n+=Number(this.nrOfPeople)*this._sqmPerPerson),this.nrOfVehicles&&(n+=Number(this.nrOfVehicles)*this._sqmPerVehicle),this.additionalSqm&&(n+=Number(this.additionalSqm)),n}catch{return NaN}}get calculatedFireExtinguisherNeeded(){try{return 1}catch{return NaN}}get severityOfRulesBroken(){return this._rules.reduce((n,s)=>Math.max(n,s.severity),0)}get area(){return Math.round(hs(this.calculateGeoJson()))}get geoJson(){return JSON.stringify(this.toGeoJSON())}calculateGeoJson(){let n=this.layer.toGeoJSON();return n.features&&n.features[0]&&(n=n.features[0]),n}GetDefaultLayerStyle(n=!1){let s=this.color;return n&&(s=df),{color:s,fillColor:s,fillOpacity:.3,weight:1}}checkAllRules(){for(let n of this._rules)n.checkRule(this)}setLayerStyle(n="severity"){if(n=="severity"||n=="cleancolors")this.severityOfRulesBroken>=3?this.layer.setStyle(Fx):this.severityOfRulesBroken==2&&!this.supressWarnings?this.layer.setStyle(Bx):this.layer.setStyle(this.GetDefaultLayerStyle(n=="cleancolors"));else if(n=="power"){let s=df;this.powerNeed?this.powerNeed>9e3?s="#FF0000":this.powerNeed>1e3&&(s="#FFA200"):s="#D1D1D1",this.layer.setStyle({color:s,fillColor:s,fillOpacity:.3,weight:1})}else if(n=="sound"){let s=df;this.amplifiedSound?this.amplifiedSound>2e3?s="#FF0000":this.amplifiedSound>120&&(s="#FFA200"):s="#D1D1D1",this.layer.setStyle({color:s,fillColor:s,fillOpacity:.3,weight:1})}}getAllTriggeredRules(){return this._rules.filter(n=>n.triggered)}updateBufferedLayer(){let n=this.layer.toGeoJSON(),s=Ou(n,this._bufferWidth,{units:"meters"}),a=0;this.bufferLayer?(this.bufferLayer.clearLayers(),this.bufferLayer.addData(s)):this.bufferLayer=th.geoJSON(s,{style:{color:"red",fillOpacity:0,weight:a,dashArray:"5, 5"},interactive:!1})}toGeoJSON(){let n=this.calculateGeoJson();return n.properties=n.properties||{},n.properties.name=oa.default.sanitize(this.name).substring(0,100),n.properties.description=oa.default.sanitize(this.description).substring(0,1e3),n.properties.contactInfo=oa.default.sanitize(this.contactInfo),n.properties.nrOfPeople=this.nrOfPeople,n.properties.nrOfVechiles=this.nrOfVehicles,n.properties.additionalSqm=this.additionalSqm,n.properties.powerNeed=this.powerNeed,n.properties.amplifiedSound=this.amplifiedSound,n.properties.color=this.color,n.properties.supressWarnings=this.supressWarnings,n}hasChanges(){return this._originalGeoJson!=this.geoJson}};var jm=On(Ql()),Ha="https://placement.freaks.se/api/v1/mapentities",Nu=class{constructor(n){this._latestRevisions={};this._entityConstraints=null;this._rulesGenerator=n,this.loaded=new Promise(s=>this._update().then(()=>s(!0)))}async _update(){let n=await fetch(Ha),s=n.ok?await n.json():[];this._latestRevisions={};for(let a of s){if(this._entityConstraints){let{earliest:l,latest:c}=this._entityConstraints;if(a.timeStamp>c||a.timeStampm||c.timeStamps)return _f(c,g,(s-(a-m))/m)}return n[n.length-1]}pointToSegmentDistance(n,s,a){let[l,c]=s,g=Ro(a[0]-l)*this.kx,m=(a[1]-c)*this.ky,v=0;return(g!==0||m!==0)&&(v=(Ro(n[0]-l)*this.kx*g+(n[1]-c)*this.ky*m)/(g*g+m*m),v>1?(l=a[0],c=a[1]):v>0&&(l+=g/this.kx*v,c+=m/this.ky*v)),g=Ro(n[0]-l)*this.kx,m=(n[1]-c)*this.ky,Math.sqrt(g*g+m*m)}pointOnLine(n,s){let a=1/0,l,c,g,m;for(let v=0;v1?(x=n[v+1][0],P=n[v+1][1]):q>0&&(x+=T/this.kx*q,P+=N/this.ky*q)),T=Ro(s[0]-x)*this.kx,N=(s[1]-P)*this.ky;let z=T*T+N*N;zc.index||l.index===c.index&&l.t>c.t){let x=l;l=c,c=x}let g=[l.point],m=l.index+1,v=c.index;!Zm(a[m],g[0])&&m<=v&&g.push(a[m]);for(let x=m+1;x<=v;x++)g.push(a[x]);return Zm(a[v],c.point)||g.push(c.point),g}lineSliceAlong(n,s,a){let l=0,c=[];for(let g=0;gn&&c.length===0&&c.push(_f(m,v,(n-(l-x))/x)),l>=s)return c.push(_f(m,v,(s-(l-x))/x)),c;l>n&&c.push(v)}return c}bufferPoint(n,s){let a=s/this.ky,l=s/this.kx;return[n[0]-l,n[1]-a,n[0]+l,n[1]+a]}bufferBBox(n,s){let a=s/this.ky,l=s/this.kx;return[n[0]-l,n[1]-a,n[2]+l,n[3]+a]}insideBBox(n,s){return Ro(n[0]-s[0])>=0&&Ro(n[0]-s[2])<=0&&n[1]>=s[1]&&n[1]<=s[3]}};function Zm(r,n){return r[0]===n[0]&&r[1]===n[1]}function _f(r,n,s){let a=Ro(n[0]-r[0]),l=n[1]-r[1];return[r[0]+a*s,r[1]+l*s]}function Ro(r){for(;r<-180;)r+=360;for(;r>180;)r-=360;return r}var xf=1250,Gx=8e3;var Vm=5,qx=Vm+1,Ux=new Au(57.5,"meters"),yf=class{constructor(){this.areaCache={};this.overlapCache={};this.coordsCache={}}coordsHaveChanged(n,s){let a=!1;if(!(n in this.coordsCache)||this.coordsCache[n].length==0||this.coordsCache[n].length!=s.length)a=!0;else for(let l=0;l[Zx(),Xx(),jx(),Hx(),Vx(n,2,"Overlapping other area!","Your area is overlapping someone elses, plz fix <3"),sa(r.slope,1,"Slope warning!","Your area is in slopey or uneven terrain, make sure to check the slope map layer to make sure that you know what you are doing :)"),sa(r.fireroad,3,"Touching fireroad!","Plz move this area away from the fire road!"),Ym(r.propertyborder,3,"Outside border!","You have placed yourself outside our land, please fix that <3"),sa(r.hiddenforbidden,3,"Inside forbidden zone!","You are inside a zone that can not be used this year."),Jx(n,3,"Too large/close to others!","For fire safety, we need to add a bit of open space (5m2) between these camps (or if not next to any camps, this camp simply to big)"),Ym(r.area,2,"Outside placement areas.","You are outside the main placement area (yellow border). Make sure you know what you are doing."),sa(r.publicplease,1,"Close to fire road","You are adjucant to a fire road, please use this space for public offerings and not just for sleeping"),sa(r.minorroad,2,"Blocking a path","You are possibly blocking a path for walking around (the black dotted lines). Keep it clean if possible or plan accordingly!"),sa(r.closetosanctuary,1,"Close to the sanctuary","This area is in the viscinity of the sanctuary, please be mindful of what energy your camp is releasing and how it may effect the santuarcy"),sa(r.redsoundzone,1,"In the western meadow","You're in the western meadow, please be extra careful of keeping the land in good condition and do not put your overnight camp here unless necessary, public dreams are prefered")]}var jx=()=>new gs(1,"Powerful.","You need a lot of power, make sure its not a typo.",r=>({triggered:r.powerNeed>Gx})),Hx=()=>new gs(2,"Missing info","Fill in name, description, contact info, power need and sound amplification please.",r=>({triggered:!r.name||!r.description||!r.contactInfo||r.powerNeed===-1||r.amplifiedSound===-1})),Xx=()=>new gs(3,"Too many ppl/vehicles!","Calculated area need is bigger than the maximum allowed area size! Make another area to fix this.",r=>({triggered:r.calculatedAreaNeeded>xf})),Zx=()=>new gs(2,"Bigger than needed?","Your area is quite big for the amount of people/vehicles and extras you have typed in.",r=>({triggered:r.area>Yx(r.calculatedAreaNeeded),message:`Your area is ${r.area-r.calculatedAreaNeeded}m\xB2 bigger than the suggested area size. Consider making it smaller.`}));function Yx(r){let a=.5*Math.pow(r,-.2),l=Math.max(0,Math.min(a,.5));return Math.min(r*(1+l),xf)}var Vx=(r,n,s,a)=>new gs(n,s,a,l=>({triggered:Kx(l.layer,r)})),sa=(r,n,s,a)=>new gs(n,s,a,l=>{let c=l.toGeoJSON(),g=!1;return r.eachLayer(m=>{let v=m.toGeoJSON();if(v.features){for(let x=0;xWx(r,n,s,a,!1),Wx=(r,n,s,a,l)=>new gs(n,s,a,c=>{let g=r.getLayers();for(let m of g){let v=m.toGeoJSON();if(v.features){for(let x=0;x{if(l||$m(r,g))return;let m=g.toGeoJSON(),v=vf(m.features[0].geometry.coordinates[0]);Km(a,v)&&(ta(s.features[0],m.features[0])||Cs(s.features[0],m.features[0]))&&(l=!0)}),l}var Jx=(r,n,s,a)=>new gs(n,s,a,l=>{let c=l.layer._layers[Object.keys(l.layer._layers)[0]];Ts.coordsHaveChanged(c._leaflet_id,c._latlngs[0])&&Ts.invalidateCache(l.layer._leaflet_id);let g=new Set;return Jm(l.layer,r,g)>xf?{triggered:!0,severity:3,shortMessage:"We need some space between these camps"}:{triggered:!1}});function vf(r){let n=[null,null,null,null],s=!0;for(let a of r)s?(n[0]=a[0],n[2]=a[0],n[1]=a[1],n[3]=a[1],s=!1):(a[0]n[2]&&(n[2]=a[0]),a[1]n[3]&&(n[3]=a[1]));return n}function Km(r,n){return!(n[0]>r[2]||n[2]r[3])}function Jm(r,n,s){if(s.has(r._leaflet_id))return 0;s.add(r._leaflet_id);let a;Ts.areaIsCached(r._leaflet_id)?a=Ts.getAreaCache(r._leaflet_id):(a=hs(r.toGeoJSON()),Ts.setAreaCache(r._leaflet_id,a));let l=vf(r.toGeoJSON().features[0].geometry.coordinates[0]),c=Ux.bufferBBox(l,qx);return n.eachLayer(g=>{if(!$m(r,g)){let m;if(Ts.overlapIsCached(r._leaflet_id,g._leaflet_id))m=Ts.getOverlapCache(r._leaflet_id,g._leaflet_id);else{let v=g.getBounds(),P=[v._southWest.lng,v._southWest.lat,v._northEast.lng,v._northEast.lat];if(!Km(c,P))m=!1,Ts.setOverlapCache(r._leaflet_id,g._leaflet_id,m);else{let T=g.toGeoJSON(),N;if(T.type==="Feature")N=T.geometry;else if(T.type==="FeatureCollection")N=T.features[0];else throw new Error("unsupported geometry");let q=Ou(r.toGeoJSON(),Vm,{units:"meters"});ta(q.features[0],N)||Cs(q.features[0],N)?m=!0:m=!1,Ts.setOverlapCache(r._leaflet_id,g._leaflet_id,m)}}m&&(a+=Jm(g,n,s))}}),a}function $m(r,n){return r._leaflet_id===n._leaflet_id}var nh=On(Ql());L.PathDraggable=L.Draggable.extend({initialize:function(r){this._path=r,this._canvas=r._map.getRenderer(r)instanceof L.Canvas;var n=this._canvas?this._path._map.getRenderer(this._path)._container:this._path._path;L.Draggable.prototype.initialize.call(this,n,n,!0)},_updatePosition:function(){var r={originalEvent:this._lastEvent};this.fire("drag",r)},_onDown:function(r){var n=r.touches?r.touches[0]:r;this._startPoint=new L.Point(n.clientX,n.clientY),!(this._canvas&&!this._path._containsPoint(this._path._map.mouseEventToLayerPoint(n)))&&L.Draggable.prototype._onDown.call(this,r)}});L.Handler.PathDrag=L.Handler.extend({initialize:function(r){this._path=r},getEvents:function(){return{dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd}},addHooks:function(){this._draggable||(this._draggable=new L.PathDraggable(this._path)),this._draggable.on(this.getEvents(),this).enable(),L.DomUtil.addClass(this._draggable._element,"leaflet-path-draggable")},removeHooks:function(){this._draggable.off(this.getEvents(),this).disable(),L.DomUtil.removeClass(this._draggable._element,"leaflet-path-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(){this._startPoint=this._draggable._startPoint,this._path.closePopup().fire("movestart").fire("dragstart")},_onDrag:function(r){var n=this._path,s=r.originalEvent.touches&&r.originalEvent.touches.length===1?r.originalEvent.touches[0]:r.originalEvent,a=L.point(s.clientX,s.clientY),l=n._map.layerPointToLatLng(a);this._offset=a.subtract(this._startPoint),this._startPoint=a,this._path.eachLatLng(this.updateLatLng,this),n.redraw(),r.latlng=l,r.offset=this._offset,n.fire("drag",r),r.latlng=this._path.getCenter?this._path.getCenter():this._path.getLatLng(),n.fire("move",r)},_onDragEnd:function(r){this._path._bounds&&this.resetBounds(),this._path.fire("moveend").fire("dragend",r)},latLngToLayerPoint:function(r){var n=this._path._map.project(L.latLng(r));return n._subtract(this._path._map.getPixelOrigin())},updateLatLng:function(r){var n=this.latLngToLayerPoint(r);n._add(this._offset);var s=this._path._map.layerPointToLatLng(n);r.lat=s.lat,r.lng=s.lng},resetBounds:function(){this._path._bounds=new L.LatLngBounds,this._path.eachLatLng(function(r){this._bounds.extend(r)})}});L.Path.include({eachLatLng:function(r,n){n=n||this;var s=function(a){for(var l=0;l=19?a.getLayers().forEach(function(g){g.setStyle({opacity:1})}):a.getLayers().forEach(function(g){g.setStyle({opacity:0})})});let l=Wm(this._groups,this._placementLayers);this._repository=new Nu(l),this._popup=Ir.popup({autoClose:!1,closeButton:!1,closeOnClick:!1,closeOnEscapeKey:!1}),Ir.PM.setOptIn(!0),this._map.pm.addControls({position:"bottomleft",drawPolygon:!1,drawCircle:!1,drawMarker:!1,drawPolyline:!1,drawRectangle:!1,drawCircleMarker:!1,drawText:!1,removalMode:!1,editControls:!1,snappable:!1}),this._map.pm.setPathOptions(mf),this._map.pm.setGlobalOptions({tooltips:!1,allowSelfIntersection:!1,snappable:!0,draggable:!0}),this._map.on("pm:create",this.onNewLayerCreated.bind(this)),this._map.on("click",g=>{console.log("[Editor]","Editor blur event fired (map click)",{mouseEvent:g}),this.setMode("blur")}),this.sqmTooltip=new Ir.Tooltip({permanent:!0,interactive:!1,direction:"center",className:"shape-tooltip"}),this.sqmTooltip.setLatLng([0,0]),this.sqmTooltip.addTo(this._map),this.sqmTooltip.closeTooltip(),this._nameTooltips={},n.on("zoomend",function(){var g=n.getZoom();this.groups.names.getLayers().forEach(function(m){g>=19?m._tooltip.setOpacity(1):m._tooltip.setOpacity(0)})}),document.onkeydown=g=>{this.keyEscapeListener(g)};var c=new Ir.Control.Search({layer:this._placementLayers,propertyName:"name",marker:!1,zoom:19,initial:!1});n.addControl(c)}async setMode(n,s){let a=this._mode,l=this._selected,c=n==a,g=s==l;if(!(c&&g)){if(this._ghostLayers.clearLayers(),n=="blur")if((a=="editing-shape"||a=="moving-shape"||a=="editing-info")&&l){n="selected",s=s||l;let v=s.layer.getBounds().getCenter();this._popup.setLatLng(v)}else n="none",s=void 0;if(console.log("[Editor]","mode changed!",{mode:this._mode,nextMode:n,nextEntity:s}),this._mode=n,this._mode=="none"){this.setSelected(null,l),this.setPopup("none");return}if(this._mode=="selected"&&s){this.setSelected(s,l),this.setPopup("info",s),l&&(l?.layer.pm.disable(),l?.layer._layers[l.layer._leaflet_id-1].dragging.disable());return}if(this._mode=="editing-shape"&&s){s.layer.pm.enable({editMode:!0,snappable:!1}),this.setSelected(s,l),this.setPopup("none");return}if(this._mode=="moving-shape"&&s){this.setSelected(s,l),this.setPopup("none"),this.UpdateOnScreenDisplay(s,"Drag to move"),s.layer._layers[s.layer._leaflet_id-1].dragging.enable();return}if(this._mode=="editing-info"&&s){this.setSelected(s,l),this.setPopup("edit-info",s);return}}}async setSelected(n,s){s&&n!=s&&s.hasChanges()&&await this.onLayerDoneEditing(s),this._isEditMode&&this.UpdateOnScreenDisplay(n),this._selected=n,this.refreshEntity(this._selected)}keyEscapeListener(n){"key"in n&&!(n.key==="Escape"||n.key==="Esc")||this.setMode("blur")}async setPopup(n,s){if(n=="none"||!s){this._popup.close();return}if(n=="info"){let a=document.createElement("div"),l=s.nrOfPeople==="1"?" person,":" people,",c=s.nrOfVehicles==="1"?"> vehicle,":" vehicles,",g=s.name?s.name:"No name yet",m=s.description?s.description:"No description yet, please add one!",v=s.contactInfo?s.contactInfo:"Please add contact info! Without it, your area might be removed.",x=s.powerNeed!=-1?`${s.powerNeed} Watts`:"Please state your power need! Set to 0 if you will not use electricity.",P=s.amplifiedSound!=-1?`${s.amplifiedSound} Watts`:"Please set sound amplification! Set to 0 if you wont have speakers.",T=nh.default.sanitize(m),N=/(\b(https?|ftp):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gim,q=T.replace(N,'$1');a.innerHTML=`

${nh.default.sanitize(g)}

+ `});return document.body.append(l),await Promise.allSettled([customElements.whenDefined("sl-alert")]),l.toast(),l}var ma="layers:",_a="page:",fh=class{constructor(){this._leafletHash=null;this._leafletMap=null;this._hashMeta=[];this._layers=[];this._page=void 0;window.addEventListener("hashchange",()=>{if(!(location.hash.indexOf(ma)==1||location.hash.indexOf(_a)==1))return;let n=location.hash.substring(1).split("/");for(let s of n)s.indexOf(ma)==0&&(this.layers=s.substring(ma.length).split(",")),s.indexOf(_a)==0&&(this.page=s.substring(_a.length),ss({file:this.page,position:"end"}))})}set map(n){this._leafletMap=n,this._leafletHash=new L.Hash(this._leafletMap)}get layers(){return this._layers}set layers(n){n instanceof Set&&(n=Array.from(n)),this._layers=n,this.encode()}get page(){return this._page}set page(n){this._page=n,this.encode()}encode(){this._hashMeta=[],this._layers.length>0&&this._hashMeta.push(ma+this._layers.join(",")),this._page&&this._page.length>0&&this._hashMeta.push(_a+this._page),this._leafletHash.setHashMeta(this._hashMeta,!0)}decode(n){this._hashMeta=n;let s=this._hashMeta.find(l=>l.startsWith(ma));this._layers=s?s.substring(ma.length).split(","):[];let a=this._hashMeta.find(l=>l.startsWith(_a));this._page=a?a.substring(_a.length):void 0,this._page&&ss({file:this.page,position:"end"})}},as=new fh;var Ir=On(wo());var eh=On(wo());var fi=63710088e-1,Bf={centimeters:fi*100,centimetres:fi*100,degrees:fi/111325,feet:fi*3.28084,inches:fi*39.37,kilometers:fi/1e3,kilometres:fi/1e3,meters:fi,metres:fi,miles:fi/1609.344,millimeters:fi*1e3,millimetres:fi*1e3,nauticalmiles:fi/1852,radians:1,yards:fi*1.0936},xw={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/fi,yards:1.0936133};function xi(r,n,s){s===void 0&&(s={});var a={type:"Feature"};return(s.id===0||s.id)&&(a.id=s.id),s.bbox&&(a.bbox=s.bbox),a.properties=n||{},a.geometry=r,a}function Gn(r,n,s){if(s===void 0&&(s={}),!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!us(r[0])||!us(r[1]))throw new Error("coordinates must contain numbers");var a={type:"Point",coordinates:r};return xi(a,n,s)}function wr(r,n,s){s===void 0&&(s={});for(var a=0,l=r;av||z>x||j>P){m=T,v=a,x=z,P=j,c=0;return}var R=Gr([m,T],s.properties);if(n(R,a,l,j,c)===!1)return!1;c++,m=T})===!1)return!1}}})}function dh(r){var n=[1/0,1/0,-1/0,-1/0];return ni(r,function(s){n[0]>s[0]&&(n[0]=s[0]),n[1]>s[1]&&(n[1]=s[1]),n[2]=2&&!Array.isArray(r[0])&&!Array.isArray(r[1]))return r;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function qn(r){if(Array.isArray(r))return r;if(r.type==="Feature"){if(r.geometry!==null)return r.geometry.coordinates}else if(r.coordinates)return r.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function gh(r,n,s){if(!r)throw new Error("No feature passed");if(!s)throw new Error(".featureOf() requires a name");if(!r||r.type!=="Feature"||!r.geometry)throw new Error("Invalid input to "+s+", Feature with geometry required");if(!r.geometry||r.geometry.type!==n)throw new Error("Invalid input to "+s+": must be a "+n+", given "+r.geometry.type)}function qr(r){return r.type==="Feature"?r.geometry:r}var w_=On(Xu(),1);var I_=On(rp(),1);function Ur(r,n,s){if(s===void 0&&(s={}),!r)throw new Error("point is required");if(!n)throw new Error("polygon is required");var a=Cr(r),l=qr(n),c=l.type,g=n.bbox,m=l.coordinates;if(g&&O_(a,g)===!1)return!1;c==="Polygon"&&(m=[m]);for(var v=!1,x=0;xr[1]!=x>r[1]&&r[0]<(v-g)*(r[1]-m)/(x-m)+g;T&&(a=!a)}return a}function O_(r,n){return n[0]<=r[0]&&n[1]<=r[1]&&n[2]>=r[0]&&n[3]>=r[1]}function N_(r,n,s){s===void 0&&(s={});var a=Cr(r),l=Cr(n),c=wi(l[1]-a[1]),g=wi(l[0]-a[0]),m=wi(a[1]),v=wi(l[1]),x=Math.pow(Math.sin(c/2),2)+Math.pow(Math.sin(g/2),2)*Math.cos(m)*Math.cos(v);return Qa(2*Math.atan2(Math.sqrt(x),Math.sqrt(1-x)),s.units)}var Sr=N_;var sp=new ArrayBuffer(16),WL=new Float64Array(sp),KL=new Uint32Array(sp);var V_=On(fp(),1);var LE=function(){function r(n){this.points=n.points||[],this.duration=n.duration||1e4,this.sharpness=n.sharpness||.85,this.centers=[],this.controls=[],this.stepLength=n.stepLength||60,this.length=this.points.length,this.delay=0;for(var s=0;sn&&(s.push(l),a=c)}return s},r.prototype.vector=function(n){var s=this.pos(n+10),a=this.pos(n-10);return{angle:180*Math.atan2(s.y-a.y,s.x-a.x)/3.14,speed:Math.sqrt((a.x-s.x)*(a.x-s.x)+(a.y-s.y)*(a.y-s.y)+(a.z-s.z)*(a.z-s.z))}},r.prototype.pos=function(n){var s=n-this.delay;s<0&&(s=0),s>this.duration&&(s=this.duration-1);var a=s/this.duration;if(a>=1)return this.points[this.length-1];var l=Math.floor((this.points.length-1)*a),c=(this.length-1)*a-l;return W_(c,this.points[l],this.controls[l][1],this.controls[l+1][0],this.points[l+1])},r}();function W_(r,n,s,a,l){var c=K_(r),g={x:l.x*c[0]+a.x*c[1]+s.x*c[2]+n.x*c[3],y:l.y*c[0]+a.y*c[1]+s.y*c[2]+n.y*c[3],z:l.z*c[0]+a.z*c[1]+s.z*c[2]+n.z*c[3]};return g}function K_(r){var n=r*r,s=n*r;return[s,3*n*(1-r),3*r*(1-r)*(1-r),(1-r)*(1-r)*(1-r)]}function iu(r,n){n===void 0&&(n={});var s=Number(r[0]),a=Number(r[1]),l=Number(r[2]),c=Number(r[3]);if(r.length===6)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var g=[s,a],m=[s,c],v=[l,c],x=[l,a];return wr([[g,x,v,m,g]],n.properties,{bbox:r,id:n.id})}function J_(r){return iu(ri(r))}var Ih=J_;function ls(r,n,s,a){a===void 0&&(a={});var l=Cr(r),c=wi(l[0]),g=wi(l[1]),m=wi(s),v=tu(n,a.units),x=Math.asin(Math.sin(g)*Math.cos(v)+Math.cos(g)*Math.sin(v)*Math.cos(m)),P=c+Math.atan2(Math.sin(m)*Math.sin(v)*Math.cos(g),Math.cos(v)-Math.sin(g)*Math.sin(x)),T=Ks(P),N=Ks(x);return Gn([T,N],a.properties)}function Ps(r,n,s){if(s===void 0&&(s={}),s.final===!0)return $_(r,n);var a=Cr(r),l=Cr(n),c=wi(a[0]),g=wi(l[0]),m=wi(a[1]),v=wi(l[1]),x=Math.sin(g-c)*Math.cos(v),P=Math.cos(m)*Math.sin(v)-Math.sin(m)*Math.cos(v)*Math.cos(g-c);return Ks(Math.atan2(x,P))}function $_(r,n){var s=Ps(n,r);return s=(s+180)%360,s}function Q_(r,n){n===void 0&&(n={});var s=ri(r),a=(s[0]+s[2])/2,l=(s[1]+s[3])/2;return Gn([a,l],n.properties,n)}var ou=Q_;var my=On(_p(),1);function _y(r){if(!r)throw new Error("geojson is required");var n=[];return Xi(r,function(s){yy(s,n)}),Ne(n)}function yy(r,n){var s=[],a=r.geometry;if(a!==null){switch(a.type){case"Polygon":s=qn(a);break;case"LineString":s=[qn(a)]}s.forEach(function(l){var c=vy(l,r.properties);c.forEach(function(g){g.id=n.length,n.push(g)})})}}function vy(r,n){var s=[];return r.reduce(function(a,l){var c=Gr([a,l],n);return c.bbox=xy(a,l),s.push(c),l}),s}function xy(r,n){var s=r[0],a=r[1],l=n[0],c=n[1],g=sl?s:l,x=a>c?a:c;return[g,m,v,x]}var Fs=_y;var Np=On(ul(),1);function Yy(r,n){var s={},a=[];if(r.type==="LineString"&&(r=xi(r)),n.type==="LineString"&&(n=xi(n)),r.type==="Feature"&&n.type==="Feature"&&r.geometry!==null&&n.geometry!==null&&r.geometry.type==="LineString"&&n.geometry.type==="LineString"&&r.geometry.coordinates.length===2&&n.geometry.coordinates.length===2){var l=Op(r,n);return l&&a.push(l),Ne(a)}var c=(0,Np.default)();return c.load(Fs(n)),Vn(Fs(r),function(g){Vn(c.search(g),function(m){var v=Op(g,m);if(v){var x=qn(v).join(",");s[x]||(s[x]=!0,a.push(v))}})}),Ne(a)}function Op(r,n){var s=qn(r),a=qn(n);if(s.length!==2)throw new Error(" line1 must only contain 2 coordinates");if(a.length!==2)throw new Error(" line2 must only contain 2 coordinates");var l=s[0][0],c=s[0][1],g=s[1][0],m=s[1][1],v=a[0][0],x=a[0][1],P=a[1][0],T=a[1][1],N=(T-x)*(g-l)-(P-v)*(m-c),q=(P-v)*(c-x)-(T-x)*(l-v),z=(g-l)*(c-x)-(m-c)*(l-v);if(N===0)return null;var j=q/N,R=z/N;if(j>=0&&j<=1&&R>=0&&R<=1){var B=l+j*(g-l),D=c+j*(m-c);return Gn([B,D])}return null}var Gs=Yy;function Vy(r,n,s){s===void 0&&(s={});var a=Gn([1/0,1/0],{dist:1/0}),l=0;return Xi(r,function(c){for(var g=qn(c),m=0;m0&&(R=j.features[0],R.properties.dist=Sr(n,R,s),R.properties.location=l+Sr(v,R,s)),v.properties.dist0){n+=Math.abs(Dp(r[0]));for(var s=1;s2){for(m=0;m"u"?null:s.epsilon))return!0}return!1}function Qy(r,n,s,a,l){var c=s[0],g=s[1],m=r[0],v=r[1],x=n[0],P=n[1],T=s[0]-m,N=s[1]-v,q=x-m,z=P-v,j=T*z-N*q;if(l!==null){if(Math.abs(j)>l)return!1}else if(j!==0)return!1;if(a){if(a==="start")return Math.abs(q)>=Math.abs(z)?q>0?m0?v=Math.abs(z)?q>0?m<=c&&c0?v<=g&&g=Math.abs(z)?q>0?m0?v=Math.abs(z)?q>0?m<=c&&c<=x:x<=c&&c<=m:z>0?v<=g&&g<=P:P<=g&&g<=v;return!1}var Lo=$y;var sv=On(Up(),1);var jp=Math.PI/180,Hp=180/Math.PI,pu=function(r,n){this.lon=r,this.lat=n,this.x=jp*r,this.y=jp*n};pu.prototype.view=function(){return String(this.lon).slice(0,4)+","+String(this.lat).slice(0,4)};pu.prototype.antipode=function(){var r=-1*this.lat,n=this.lon<0?180+this.lon:(180-this.lon)*-1;return new pu(n,r)};var Xp=function(){this.coords=[],this.length=0};Xp.prototype.move_to=function(r){this.length++,this.coords.push(r)};var ec=function(r){this.properties=r||{},this.geometries=[]};ec.prototype.json=function(){if(this.geometries.length<=0)return{geometry:{type:"LineString",coordinates:null},type:"Feature",properties:this.properties};if(this.geometries.length===1)return{geometry:{type:"LineString",coordinates:this.geometries[0].coords},type:"Feature",properties:this.properties};for(var r=[],n=0;nN&&(j>P&&zP&&jv&&(v=R)}var B=[];if(m&&v0&&Math.abs(G-s[A-1][0])>N){var H=parseFloat(s[A-1][0]),K=parseFloat(s[A-1][1]),et=parseFloat(s[A][0]),X=parseFloat(s[A][1]);if(H>-180&&H-180&&s[A-1][0]P&&H<180&&et===-180&&A+1P&&s[A-1][0]<180){D.push([180,s[A][1]]),A++,D.push([s[A][0],s[A][1]]);continue}if(HP){var lt=H;H=et,et=lt;var gt=K;K=X,X=gt}if(H>P&&et=180&&HP?180:-180,Q]),D=[],D.push([s[A-1][0]>P?-180:180,Q]),B.push(D)}else D=[],B.push(D);D.push([G,s[A][1]])}else D.push([s[A][0],s[A][1]])}}else{var kt=[];B.push(kt);for(var ct=0;ct0)-(r<0)||+r}function Na(r,n,s){var a=n[0]-r[0],l=n[1]-r[1],c=s[0]-n[0],g=s[1]-n[1];return i1(a*g-c*l)}function Eg(r,n){var s=r.geometry.coordinates[0].map(function(g){return g[0]}),a=r.geometry.coordinates[0].map(function(g){return g[1]}),l=n.geometry.coordinates[0].map(function(g){return g[0]}),c=n.geometry.coordinates[0].map(function(g){return g[1]});return Math.max.apply(null,s)===Math.max.apply(null,l)&&Math.max.apply(null,a)===Math.max.apply(null,c)&&Math.min.apply(null,s)===Math.min.apply(null,l)&&Math.min.apply(null,a)===Math.min.apply(null,c)}function Rc(r,n){return n.geometry.coordinates[0].every(function(s){return Ur(Gn(s),r)})}function Mg(r,n){return r[0]===n[0]&&r[1]===n[1]}var o1=function(){function r(n){this.id=r.buildId(n),this.coordinates=n,this.innerEdges=[],this.outerEdges=[],this.outerEdgesSorted=!1}return r.buildId=function(n){return n.join(",")},r.prototype.removeInnerEdge=function(n){this.innerEdges=this.innerEdges.filter(function(s){return s.from.id!==n.from.id})},r.prototype.removeOuterEdge=function(n){this.outerEdges=this.outerEdges.filter(function(s){return s.to.id!==n.to.id})},r.prototype.addOuterEdge=function(n){this.outerEdges.push(n),this.outerEdgesSorted=!1},r.prototype.sortOuterEdges=function(){var n=this;this.outerEdgesSorted||(this.outerEdges.sort(function(s,a){var l=s.to,c=a.to;if(l.coordinates[0]-n.coordinates[0]>=0&&c.coordinates[0]-n.coordinates[0]<0)return 1;if(l.coordinates[0]-n.coordinates[0]<0&&c.coordinates[0]-n.coordinates[0]>=0)return-1;if(l.coordinates[0]-n.coordinates[0]===0&&c.coordinates[0]-n.coordinates[0]===0)return l.coordinates[1]-n.coordinates[1]>=0||c.coordinates[1]-n.coordinates[1]>=0?l.coordinates[1]-c.coordinates[1]:c.coordinates[1]-l.coordinates[1];var g=Na(n.coordinates,l.coordinates,c.coordinates);if(g<0)return 1;if(g>0)return-1;var m=Math.pow(l.coordinates[0]-n.coordinates[0],2)+Math.pow(l.coordinates[1]-n.coordinates[1],2),v=Math.pow(c.coordinates[0]-n.coordinates[0],2)+Math.pow(c.coordinates[1]-n.coordinates[1],2);return m-v}),this.outerEdgesSorted=!0)},r.prototype.getOuterEdges=function(){return this.sortOuterEdges(),this.outerEdges},r.prototype.getOuterEdge=function(n){return this.sortOuterEdges(),this.outerEdges[n]},r.prototype.addInnerEdge=function(n){this.innerEdges.push(n)},r}(),Ac=o1;var s1=function(){function r(n,s){this.from=n,this.to=s,this.next=void 0,this.label=void 0,this.symetric=void 0,this.ring=void 0,this.from.addOuterEdge(this),this.to.addInnerEdge(this)}return r.prototype.getSymetric=function(){return this.symetric||(this.symetric=new r(this.to,this.from),this.symetric.symetric=this),this.symetric},r.prototype.deleteEdge=function(){this.from.removeOuterEdge(this),this.to.removeInnerEdge(this)},r.prototype.isEqual=function(n){return this.from.id===n.from.id&&this.to.id===n.to.id},r.prototype.toString=function(){return"Edge { "+this.from.id+" -> "+this.to.id+" }"},r.prototype.toLineString=function(){return Gr([this.from.coordinates,this.to.coordinates])},r.prototype.compareTo=function(n){return Na(n.from.coordinates,n.to.coordinates,this.to.coordinates)},r}(),Pg=s1;var a1=function(){function r(){this.edges=[],this.polygon=void 0,this.envelope=void 0}return r.prototype.push=function(n){this.edges.push(n),this.polygon=this.envelope=void 0},r.prototype.get=function(n){return this.edges[n]},Object.defineProperty(r.prototype,"length",{get:function(){return this.edges.length},enumerable:!0,configurable:!0}),r.prototype.forEach=function(n){this.edges.forEach(n)},r.prototype.map=function(n){return this.edges.map(n)},r.prototype.some=function(n){return this.edges.some(n)},r.prototype.isValid=function(){return!0},r.prototype.isHole=function(){var n=this,s=this.edges.reduce(function(g,m,v){return m.from.coordinates[1]>n.edges[g].from.coordinates[1]&&(g=v),g},0),a=(s===0?this.length:s)-1,l=(s+1)%this.length,c=Na(this.edges[a].from.coordinates,this.edges[s].from.coordinates,this.edges[l].from.coordinates);return c===0?this.edges[a].from.coordinates[0]>this.edges[l].from.coordinates[0]:c>0},r.prototype.toMultiPoint=function(){return ph(this.edges.map(function(n){return n.from.coordinates}))},r.prototype.toPolygon=function(){if(this.polygon)return this.polygon;var n=this.edges.map(function(s){return s.from.coordinates});return n.push(this.edges[0].from.coordinates),this.polygon=wr([n])},r.prototype.getEnvelope=function(){return this.envelope?this.envelope:this.envelope=Ih(this.toPolygon())},r.findEdgeRingContaining=function(n,s){var a=n.getEnvelope(),l,c;return s.forEach(function(g){var m=g.getEnvelope();if(c&&(l=c.getEnvelope()),!Eg(m,a)&&Rc(m,a)){for(var v=n.map(function(z){return z.from.coordinates}),x=void 0,P=function(z){g.some(function(j){return Mg(z,j.from.coordinates)})||(x=z)},T=0,N=v;T"u"?Object.keys(this.nodes).forEach(function(a){return s._computeNextCWEdges(s.nodes[a])}):n.getOuterEdges().forEach(function(a,l){n.getOuterEdge((l===0?n.getOuterEdges().length:l)-1).symetric.next=a})},r.prototype._computeNextCCWEdges=function(n,s){for(var a=n.getOuterEdges(),l,c,g=a.length-1;g>=0;--g){var m=a[g],v=m.symetric,x=void 0,P=void 0;m.label===s&&(x=m),v.label===s&&(P=v),!(!x||!P)&&(P&&(c=P),x&&(c&&(c.next=x,c=void 0),l||(l=x)))}c&&(c.next=l)},r.prototype._findLabeledEdgeRings=function(){var n=[],s=0;return this.edges.forEach(function(a){if(!(a.label>=0)){n.push(a);var l=a;do l.label=s,l=l.next;while(!a.isEqual(l));s++}}),n},r.prototype.getEdgeRings=function(){var n=this;this._computeNextCWEdges(),this.edges.forEach(function(a){a.label=void 0}),this._findLabeledEdgeRings().forEach(function(a){n._findIntersectionNodes(a).forEach(function(l){n._computeNextCCWEdges(l,a.label)})});var s=[];return this.edges.forEach(function(a){a.ring||s.push(n._findEdgeRing(a))}),s},r.prototype._findIntersectionNodes=function(n){var s=[],a=n,l=function(){var c=0;a.from.getOuterEdges().forEach(function(g){g.label===n.label&&++c}),c>1&&s.push(a.from),a=a.next};do l();while(!n.isEqual(a));return s},r.prototype._findEdgeRing=function(n){var s=n,a=new Dc;do a.push(s),s.ring=a,s=s.next;while(!n.isEqual(s));return a},r.prototype.removeNode=function(n){var s=this;n.getOuterEdges().forEach(function(a){return s.removeEdge(a)}),n.innerEdges.forEach(function(a){return s.removeEdge(a)}),delete this.nodes[n.id]},r.prototype.removeEdge=function(n){this.edges=this.edges.filter(function(s){return!s.isEqual(n)}),n.deleteEdge()},r}();function Ss(r,n){var s=qr(r),a=qr(n),l=s.type,c=a.type,g=s.coordinates,m=a.coordinates;switch(l){case"Point":switch(c){case"Point":return Bc(g,m);default:throw new Error("feature2 "+c+" geometry not supported")}case"MultiPoint":switch(c){case"Point":return l1(s,a);case"MultiPoint":return h1(s,a);default:throw new Error("feature2 "+c+" geometry not supported")}case"LineString":switch(c){case"Point":return Lo(a,s,{ignoreEndVertices:!0});case"LineString":return p1(s,a);case"MultiPoint":return c1(s,a);default:throw new Error("feature2 "+c+" geometry not supported")}case"Polygon":switch(c){case"Point":return Ur(a,s,{ignoreBoundary:!0});case"LineString":return d1(s,a);case"Polygon":return g1(s,a);case"MultiPoint":return f1(s,a);default:throw new Error("feature2 "+c+" geometry not supported")}default:throw new Error("feature1 "+l+" geometry not supported")}}function l1(r,n){var s,a=!1;for(s=0;sn[0]||r[2]n[1]||r[3]0}var v1=On(Fc(),1);var w1=On(Bg(),1);var S1=On(Yg(),1);function Wg(r){for(var n=r,s=[];n.parent;)s.unshift(n),n=n.parent;return s}function T1(){return new Kg(function(r){return r.f})}var Uc={search:function(r,n,s,a){r.cleanDirty(),a=a||{};var l=a.heuristic||Uc.heuristics.manhattan,c=a.closest||!1,g=T1(),m=n;for(n.h=l(n,s),g.push(n);g.size()>0;){var v=g.pop();if(v===s)return Wg(v);v.closed=!0;for(var x=r.neighbors(v),P=0,T=x.length;P0&&(this.content[0]=n,this.bubbleUp(0)),r},remove:function(r){var n=this.content.indexOf(r),s=this.content.pop();n!==this.content.length-1&&(this.content[n]=s,this.scoreFunction(s)0;){var s=(r+1>>1)-1,a=this.content[s];if(this.scoreFunction(n)0)){if(j/=q,q<0){if(j0){if(j>N)return;j>T&&(T=j)}if(j=a-m,!(!q&&j<0)){if(j/=q,q<0){if(j>N)return;j>T&&(T=j)}else if(q>0){if(j0)){if(j/=z,z<0){if(j0){if(j>N)return;j>T&&(T=j)}if(j=l-v,!(!z&&j<0)){if(j/=z,z<0){if(j>N)return;j>T&&(T=j)}else if(z>0){if(j0)&&!(N<1)||(T>0&&(r[0]=[m+T*q,v+T*z]),N<1&&(r[1]=[m+N*q,v+N*z])),!0}}}}}function O1(r,n,s,a,l){var c=r[1];if(c)return!0;var g=r[0],m=r.left,v=r.right,x=m[0],P=m[1],T=v[0],N=v[1],q=(x+T)/2,z=(P+N)/2,j,R;if(N===P){if(q=a)return;if(x>T){if(!g)g=[q,s];else if(g[1]>=l)return;c=[q,l]}else{if(!g)g=[q,l];else if(g[1]1)if(x>T){if(!g)g=[(s-R)/j,s];else if(g[1]>=l)return;c=[(l-R)/j,l]}else{if(!g)g=[(l-R)/j,l];else if(g[1]=a)return;c=[a,j*a+R]}else{if(!g)g=[a,j*a+R];else if(g[0]Jn||Math.abs(c[0][1]-c[1][1])>Jn))&&delete Li[l]}function Qg(r){return $i[r.index]={site:r,halfedges:[]}}function N1(r,n){var s=r.site,a=n.left,l=n.right;return s===l&&(l=a,a=s),l?Math.atan2(l[1]-a[1],l[0]-a[0]):(s===a?(a=n[1],l=n[0]):(a=n[0],l=n[1]),Math.atan2(a[0]-l[0],l[1]-a[1]))}function Xc(r,n){return n[+(n.left!==r.site)]}function R1(r,n){return n[+(n.left===r.site)]}function tm(){for(var r=0,n=$i.length,s,a,l,c;rJn||Math.abs(R-q)>Jn)&&(x.splice(v,0,Li.push(Ba(m,z,Math.abs(j-r)Jn?[r,Math.abs(N-r)Jn?[Math.abs(q-a)Jn?[s,Math.abs(N-s)Jn?[Math.abs(q-n)=-rm)){var q=v*v+x*x,z=P*P+T*T,j=(T*q-x*z)/N,R=(v*z-P*q)/N,B=nm.pop()||new A1;B.arc=r,B.site=l,B.x=j+g,B.y=(B.cy=R+m)+Math.sqrt(j*j+R*R),r.circle=B;for(var D=null,A=Fa._;A;)if(B.yJn)m=m.L;else if(g=n-B1(m,s),g>Jn){if(!m.R){a=m;break}m=m.R}else{c>-Jn?(a=m.P,l=m):g>-Jn?(a=m,l=m.N):a=l=m;break}Qg(r);var v=im(r);if(ia.insert(a,v),!(!a&&!l)){if(a===l){ra(a),l=im(a.site),ia.insert(v,l),v.edge=l.edge=Da(a.site,v.site),na(a),na(l);return}if(!l){v.edge=Da(a.site,v.site);return}ra(a),ra(l);var x=a.site,P=x[0],T=x[1],N=r[0]-P,q=r[1]-T,z=l.site,j=z[0]-P,R=z[1]-T,B=2*(N*R-q*j),D=N*N+q*q,A=j*j+R*R,G=[(R*D-q*A)/B+P,(N*A-j*D)/B+T];Lu(l.edge,x,z,G),v.edge=Da(x,r,null,G),l.edge=Da(r,z,null,G),na(a),na(l)}}function um(r,n){var s=r.site,a=s[0],l=s[1],c=l-n;if(!c)return a;var g=r.P;if(!g)return-1/0;s=g.site;var m=s[0],v=s[1],x=v-n;if(!x)return m;var P=m-a,T=1/c-1/x,N=P/x;return T?(-N+Math.sqrt(N*N-2*T*(P*P/(-2*x)-v+x/2+l-c/2)))/T+a:(a+m)/2}function B1(r,n){var s=r.N;if(s)return um(s,n);var a=r.site;return a[1]===n?a[0]:1/0}var Jn=1e-6,rm=1e-12,ia,$i,Fa,Li;function F1(r,n,s){return(r[0]-s[0])*(n[1]-r[1])-(r[0]-n[0])*(s[1]-r[1])}function z1(r,n){return n[1]-r[1]||n[0]-r[0]}function Il(r,n){var s=r.sort(z1).pop(),a,l,c;for(Li=[],$i=new Array(r.length),ia=new Hc,Fa=new Hc;;)if(c=Tl,s&&(!c||s[1]=g)return null;var v=r-m.site[0],x=n-m.site[1],P=v*v+x*x;do m=a.cells[l=c],c=null,m.halfedges.forEach(function(T){var N=a.edges[T],q=N.left;if(!((q===m.site||!q)&&!(q=N.right))){var z=r-q[0],j=n-q[1],R=z*z+j*j;R1?0:r<-1?ln:Math.acos(r)}function gi(r){return r>1?di:r<-1?-di:Math.asin(r)}function to(){}function Fl(r,n){r&&gm.hasOwnProperty(r.type)&&gm[r.type](r,n)}var dm={Feature:function(r,n){Fl(r.geometry,n)},FeatureCollection:function(r,n){for(var s=r.features,a=-1,l=s.length;++aln?r-Ai:r<-ln?r+Ai:r,n]}Kc.invert=Kc;function Jc(r,n,s){return(r%=Ai)?n||s?Gl(ym(r),vm(n,s)):ym(r):n||s?vm(n,s):Kc}function _m(r){return function(n,s){return n+=r,[n>ln?n-Ai:n<-ln?n+Ai:n,s]}}function ym(r){var n=_m(r);return n.invert=_m(-r),n}function vm(r,n){var s=ye(r),a=ve(r),l=ye(n),c=ve(n);function g(m,v){var x=ye(v),P=ye(m)*x,T=ve(m)*x,N=ve(v),q=N*s+P*a;return[bi(T*l-q*c,P*s-N*a),gi(q*l+T*c)]}return g.invert=function(m,v){var x=ye(v),P=ye(m)*x,T=ve(m)*x,N=ve(v),q=N*l-T*c;return[bi(T*l+N*c,P*s+q*a),gi(q*s-P*a)]},g}function wm(r,n,s,a,l,c){if(s){var g=ye(n),m=ve(n),v=a*s;l==null?(l=n+a*Ai,c=n-v/2):(l=xm(g,l),c=xm(g,c),(a>0?lc)&&(l+=a*Ai));for(var x,P=l;a>0?P>c:P1&&r.push(r.pop().concat(r.shift()))},result:function(){var s=r;return r=[],n=null,s}}}function Lm(r,n,s,a,l,c){var g=r[0],m=r[1],v=n[0],x=n[1],P=0,T=1,N=v-g,q=x-m,z;if(z=s-g,!(!N&&z>0)){if(z/=N,N<0){if(z0){if(z>T)return;z>P&&(P=z)}if(z=l-g,!(!N&&z<0)){if(z/=N,N<0){if(z>T)return;z>P&&(P=z)}else if(N>0){if(z0)){if(z/=q,q<0){if(z0){if(z>T)return;z>P&&(P=z)}if(z=c-m,!(!q&&z<0)){if(z/=q,q<0){if(z>T)return;z>P&&(P=z)}else if(q>0){if(z0&&(r[0]=g+P*N,r[1]=m+P*q),T<1&&(n[0]=g+T*N,n[1]=m+T*q),!0}}}}}function Ua(r,n){return Fn(r[0]-n[0])=0;--m)l.point((T=P[m])[0],T[1]);else a(N.x,N.p.x,-1,l);N=N.p}N=N.o,P=N.z,q=!q}while(!N.v);l.lineEnd()}}}function bm(r){if(n=r.length){for(var n,s=0,a=r[0],l;++sn?1:r>=n?0:NaN}function $c(r){return r.length===1&&(r=W1(r)),{left:function(n,s,a,l){for(a==null&&(a=0),l==null&&(l=n.length);a>>1;r(n[c],s)<0?a=c+1:l=c}return a},right:function(n,s,a,l){for(a==null&&(a=0),l==null&&(l=n.length);a>>1;r(n[c],s)>0?l=c:a=c+1}return a}}}function W1(r){return function(n,s){return Xs(r(n),s)}}var Em=$c(Xs),K1=Em.right,J1=Em.left;var Mm=Array.prototype,Q1=Mm.slice,tx=Mm.map;var VN=Math.sqrt(50),WN=Math.sqrt(10),KN=Math.sqrt(2);function Cu(r){for(var n=r.length,s,a=-1,l=0,c,g;++a=0;)for(g=r[n],s=g.length;--s>=0;)c[--l]=g[s];return c}var Su=1e9,Xl=-Su;function Qc(r,n,s,a){function l(x,P){return r<=x&&x<=s&&n<=P&&P<=a}function c(x,P,T,N){var q=0,z=0;if(x==null||(q=g(x,T))!==(z=g(P,T))||v(x,P)<0^T>0)do N.point(q===0||q===3?r:s,q>1?a:n);while((q=(q+T+4)%4)!==z);else N.point(P[0],P[1])}function g(x,P){return Fn(x[0]-r)0?0:3:Fn(x[0]-s)0?2:1:Fn(x[1]-n)0?1:0:P>0?3:2}function m(x,P){return v(x.x,P.x)}function v(x,P){var T=g(x,1),N=g(P,1);return T!==N?T-N:T===0?P[1]-x[1]:T===1?x[0]-P[0]:T===2?x[1]-P[1]:P[0]-x[0]}return function(x){var P=x,T=ql(),N,q,z,j,R,B,D,A,G,H,K,et={point:X,lineStart:Q,lineEnd:kt,polygonStart:gt,polygonEnd:Et};function X(bt,Mt){l(bt,Mt)&&P.point(bt,Mt)}function lt(){for(var bt=0,Mt=0,Xt=q.length;Mta&&(Tt-Ot)*(a-Qt)>(ce-Qt)*(r-Ot)&&++bt:ce<=a&&(Tt-Ot)*(a-Qt)<(ce-Qt)*(r-Ot)&&--bt;return bt}function gt(){P=T,N=[],q=[],K=!0}function Et(){var bt=lt(),Mt=K&&bt,Xt=(N=Cu(N)).length;(Mt||Xt)&&(x.polygonStart(),Mt&&(x.lineStart(),c(null,null,1,x),x.lineEnd()),Xt&&jl(N,m,bt,c,x),x.polygonEnd()),P=x,N=q=z=null}function Q(){et.point=ct,q&&q.push(z=[]),H=!0,G=!1,D=A=NaN}function kt(){N&&(ct(j,R),B&&G&&T.rejoin(),N.push(T.result())),et.point=X,G&&P.lineEnd()}function ct(bt,Mt){var Xt=l(bt,Mt);if(q&&z.push([bt,Mt]),H)j=bt,R=Mt,B=Xt,H=!1,Xt&&(P.lineStart(),P.point(bt,Mt));else if(Xt&&G)P.point(bt,Mt);else{var ft=[D=Math.max(Xl,Math.min(Su,D)),A=Math.max(Xl,Math.min(Su,A))],Ct=[bt=Math.max(Xl,Math.min(Su,bt)),Mt=Math.max(Xl,Math.min(Su,Mt))];Lm(ft,Ct,r,n,s,a)?(G||(P.lineStart(),P.point(ft[0],ft[1])),P.point(Ct[0],Ct[1]),Xt||P.lineEnd(),K=!1):Xt&&(P.lineStart(),P.point(bt,Mt),K=!1)}D=bt,A=Mt,G=Xt}return et}}var tf=ho();function ef(r,n){var s=n[0],a=n[1],l=[ve(s),-ye(s),0],c=0,g=0;tf.reset();for(var m=0,v=r.length;m=0?1:-1,X=et*K,lt=X>ln,gt=z*G;if(tf.add(bi(gt*et*ve(X),j*H+gt*ye(X))),c+=lt?K+et*Ai:K,lt^N>=s^D>=s){var Et=oa(Ko(T),Ko(B));qa(Et);var Q=oa(l,Et);qa(Q);var kt=(lt^K>=0?-1:1)*gi(Q[2]);(a>kt||a===kt&&(Et[0]||Et[1]))&&(g+=lt^K>=0?1:-1)}}return(c<-Ee||cTu&&(Tu=r),nYl&&(Yl=n)}var Vl=hx;function nf(r){this._context=r}nf.prototype={_radius:4.5,pointRadius:function(r){return this._radius=r,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(r,n){switch(this._point){case 0:{this._context.moveTo(r,n),this._point=1;break}case 1:{this._context.lineTo(r,n);break}default:{this._context.moveTo(r+this._radius,n),this._context.arc(r,n,this._radius,0,Ai);break}}},result:to};var vD=ho();function rf(){this._string=[]}rf.prototype={_radius:4.5,_circle:Sm(4.5),pointRadius:function(r){return(r=+r)!==this._radius&&(this._radius=r,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(r,n){switch(this._point){case 0:{this._string.push("M",r,",",n),this._point=1;break}case 1:{this._string.push("L",r,",",n);break}default:{this._circle==null&&(this._circle=Sm(this._radius)),this._string.push("M",r,",",n,this._circle);break}}},result:function(){if(this._string.length){var r=this._string.join("");return this._string=[],r}else return null}};function Sm(r){return"m0,"+r+"a"+r+","+r+" 0 1,1 0,"+-2*r+"a"+r+","+r+" 0 1,1 0,"+2*r+"z"}function Wl(r,n,s,a){return function(l,c){var g=n(c),m=l.invert(a[0],a[1]),v=ql(),x=n(v),P=!1,T,N,q,z={point:j,lineStart:B,lineEnd:D,polygonStart:function(){z.point=A,z.lineStart=G,z.lineEnd=H,N=[],T=[]},polygonEnd:function(){z.point=j,z.lineStart=B,z.lineEnd=D,N=Cu(N);var K=ef(T,m);N.length?(P||(c.polygonStart(),P=!0),jl(N,px,K,s,c)):K&&(P||(c.polygonStart(),P=!0),c.lineStart(),s(null,null,1,c),c.lineEnd()),P&&(c.polygonEnd(),P=!1),N=T=null},sphere:function(){c.polygonStart(),c.lineStart(),s(null,null,1,c),c.lineEnd(),c.polygonEnd()}};function j(K,et){var X=l(K,et);r(K=X[0],et=X[1])&&c.point(K,et)}function R(K,et){var X=l(K,et);g.point(X[0],X[1])}function B(){z.point=R,g.lineStart()}function D(){z.point=j,g.lineEnd()}function A(K,et){q.push([K,et]);var X=l(K,et);x.point(X[0],X[1])}function G(){x.lineStart(),q=[]}function H(){A(q[0][0],q[0][1]),x.lineEnd();var K=x.clean(),et=v.result(),X,lt=et.length,gt,Et,Q;if(q.pop(),T.push(q),q=null,!!lt){if(K&1){if(Et=et[0],(gt=Et.length-1)>0){for(P||(c.polygonStart(),P=!0),c.lineStart(),X=0;X1&&K&2&&et.push(et.pop().concat(et.shift())),N.push(et.filter(fx))}}return z}}function fx(r){return r.length>1}function px(r,n){return((r=r.x)[0]<0?r[1]-di-Ee:di-r[1])-((n=n.x)[0]<0?n[1]-di-Ee:di-n[1])}var of=Wl(function(){return!0},dx,mx,[-ln,-di]);function dx(r){var n=NaN,s=NaN,a=NaN,l;return{lineStart:function(){r.lineStart(),l=1},point:function(c,g){var m=c>0?ln:-ln,v=Fn(c-n);Fn(v-ln)0?di:-di),r.point(a,s),r.lineEnd(),r.lineStart(),r.point(m,s),r.point(c,s),l=0):a!==m&&v>=ln&&(Fn(n-a)Ee?Wo((ve(n)*(c=ye(a))*ve(s)-ve(a)*(l=ye(n))*ve(r))/(l*c*g)):(n+a)/2}function mx(r,n,s,a){var l;if(r==null)l=s*di,a.point(-ln,l),a.point(0,l),a.point(ln,l),a.point(ln,0),a.point(ln,-l),a.point(0,-l),a.point(-ln,-l),a.point(-ln,0),a.point(-ln,l);else if(Fn(r[0]-n[0])>Ee){var c=r[0]0,l=Fn(s)>Ee;function c(P,T,N,q){wm(q,r,n,N,P,T)}function g(P,T){return ye(P)*ye(T)>s}function m(P){var T,N,q,z,j;return{lineStart:function(){z=q=!1,j=1},point:function(R,B){var D=[R,B],A,G=g(R,B),H=a?G?0:x(R,B):G?x(R+(R<0?ln:-ln),B):0;if(!T&&(z=q=G)&&P.lineStart(),G!==q&&(A=v(T,D),(!A||Ua(T,A)||Ua(D,A))&&(D[0]+=Ee,D[1]+=Ee,G=g(D[0],D[1]))),G!==q)j=0,G?(P.lineStart(),A=v(D,T),P.point(A[0],A[1])):(A=v(T,D),P.point(A[0],A[1]),P.lineEnd()),T=A;else if(l&&T&&a^G){var K;!(H&N)&&(K=v(D,T,!0))&&(j=0,a?(P.lineStart(),P.point(K[0][0],K[0][1]),P.point(K[1][0],K[1][1]),P.lineEnd()):(P.point(K[1][0],K[1][1]),P.lineEnd(),P.lineStart(),P.point(K[0][0],K[0][1])))}G&&(!T||!Ua(T,D))&&P.point(D[0],D[1]),T=D,q=G,N=H},lineEnd:function(){q&&P.lineEnd(),T=null},clean:function(){return j|(z&&q)<<1}}}function v(P,T,N){var q=Ko(P),z=Ko(T),j=[1,0,0],R=oa(q,z),B=Mu(R,R),D=R[0],A=B-D*D;if(!A)return!N&&P;var G=s*B/A,H=-s*D/A,K=oa(j,R),et=Pu(j,G),X=Pu(R,H);zl(et,X);var lt=K,gt=Mu(et,lt),Et=Mu(lt,lt),Q=gt*gt-Et*(Mu(et,et)-1);if(!(Q<0)){var kt=ii(Q),ct=Pu(lt,(-gt-kt)/Et);if(zl(ct,et),ct=Ga(ct),!N)return ct;var bt=P[0],Mt=T[0],Xt=P[1],ft=T[1],Ct;Mt0^ct[1]<(Fn(ct[0]-bt)ln^(bt<=ct[0]&&ct[0]<=Mt)){var Qt=Pu(lt,(-gt+kt)/Et);return zl(Qt,et),[ct,Ga(Qt)]}}}function x(P,T){var N=a?r:ln-r,q=0;return P<-N?q|=1:P>N&&(q|=2),T<-N?q|=4:T>N&&(q|=8),q}return Wl(g,m,c,a?[0,-r]:[-ln,r-ln])}function Iu(r){return function(n){var s=new sf;for(var a in r)s[a]=r[a];return s.stream=n,s}}function sf(){}sf.prototype={constructor:sf,point:function(r,n){this.stream.point(r,n)},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 Ou(r,n,s){var a=n[1][0]-n[0][0],l=n[1][1]-n[0][1],c=r.clipExtent&&r.clipExtent();r.scale(150).translate([0,0]),c!=null&&r.clipExtent(null),Hs(s,r.stream(Vl));var g=Vl.result(),m=Math.min(a/(g[1][0]-g[0][0]),l/(g[1][1]-g[0][1])),v=+n[0][0]+(a-m*(g[1][0]+g[0][0]))/2,x=+n[0][1]+(l-m*(g[1][1]+g[0][1]))/2;return c!=null&&r.clipExtent(c),r.scale(m*150).translate([v,x])}function Kl(r,n,s){return Ou(r,[[0,0],n],s)}var Tm=16,_x=ye(30*Tr);function af(r,n){return+n?vx(r,n):yx(r)}function yx(r){return Iu({point:function(n,s){n=r(n,s),this.stream.point(n[0],n[1])}})}function vx(r,n){function s(a,l,c,g,m,v,x,P,T,N,q,z,j,R){var B=x-a,D=P-l,A=B*B+D*D;if(A>4*n&&j--){var G=g+N,H=m+q,K=v+z,et=ii(G*G+H*H+K*K),X=gi(K/=et),lt=Fn(Fn(K)-1)n||Fn((B*kt+D*ct)/A-.5)>.3||g*N+m*q+v*z<_x)&&(s(a,l,c,g,m,v,Et,Q,lt,G/=et,H/=et,K,j,R),R.point(Et,Q),s(Et,Q,lt,G,H,K,x,P,T,N,q,z,j,R))}}return function(a){var l,c,g,m,v,x,P,T,N,q,z,j,R={point:B,lineStart:D,lineEnd:G,polygonStart:function(){a.polygonStart(),R.lineStart=H},polygonEnd:function(){a.polygonEnd(),R.lineStart=D}};function B(X,lt){X=r(X,lt),a.point(X[0],X[1])}function D(){T=NaN,R.point=A,a.lineStart()}function A(X,lt){var gt=Ko([X,lt]),Et=r(X,lt);s(T,N,P,q,z,j,T=Et[0],N=Et[1],P=X,q=gt[0],z=gt[1],j=gt[2],Tm,a),a.point(T,N)}function G(){R.point=B,a.lineEnd()}function H(){D(),R.point=K,R.lineEnd=et}function K(X,lt){A(l=X,lt),c=T,g=N,m=q,v=z,x=j,R.point=A}function et(){s(T,N,P,q,z,j,c,g,l,m,v,x,Tm,a),R.lineEnd=G,G()}return R}}var xx=Iu({point:function(r,n){this.stream.point(r*Tr,n*Tr)}});function Jo(r){return uf(function(){return r})()}function uf(r){var n,s=150,a=480,l=250,c,g,m=0,v=0,x=0,P=0,T=0,N,q,z=null,j=of,R=null,B,D,A,G=ku,H=.5,K=af(Et,H),et,X;function lt(ct){return ct=q(ct[0]*Tr,ct[1]*Tr),[ct[0]*s+c,g-ct[1]*s]}function gt(ct){return ct=q.invert((ct[0]-c)/s,(g-ct[1])/s),ct&&[ct[0]*Qi,ct[1]*Qi]}function Et(ct,bt){return ct=n(ct,bt),[ct[0]*s+c,g-ct[1]*s]}lt.stream=function(ct){return et&&X===ct?et:et=xx(j(N,K(G(X=ct))))},lt.clipAngle=function(ct){return arguments.length?(j=+ct?km(z=ct*Tr,6*Tr):(z=null,of),kt()):z*Qi},lt.clipExtent=function(ct){return arguments.length?(G=ct==null?(R=B=D=A=null,ku):Qc(R=+ct[0][0],B=+ct[0][1],D=+ct[1][0],A=+ct[1][1]),kt()):R==null?null:[[R,B],[D,A]]},lt.scale=function(ct){return arguments.length?(s=+ct,Q()):s},lt.translate=function(ct){return arguments.length?(a=+ct[0],l=+ct[1],Q()):[a,l]},lt.center=function(ct){return arguments.length?(m=ct[0]%360*Tr,v=ct[1]%360*Tr,Q()):[m*Qi,v*Qi]},lt.rotate=function(ct){return arguments.length?(x=ct[0]%360*Tr,P=ct[1]%360*Tr,T=ct.length>2?ct[2]%360*Tr:0,Q()):[x*Qi,P*Qi,T*Qi]},lt.precision=function(ct){return arguments.length?(K=af(Et,H=ct*ct),kt()):ii(H)},lt.fitExtent=function(ct,bt){return Ou(lt,ct,bt)},lt.fitSize=function(ct,bt){return Kl(lt,ct,bt)};function Q(){q=Gl(N=Jc(x,P,T),n);var ct=n(m,v);return c=a-ct[0]*s,g=l+ct[1]*s,kt()}function kt(){return et=X=null,lt}return function(){return n=r.apply(this,arguments),lt.invert=n.invert&>,Q()}}function Jl(r){return function(n,s){var a=ye(n),l=ye(s),c=r(a*l);return[c*l*ve(n),c*ve(s)]}}function gs(r){return function(n,s){var a=ii(n*n+s*s),l=r(a),c=ve(l),g=ye(l);return[bi(n*c,a*g),gi(a&&s*c/a)]}}var Rm=Jl(function(r){return ii(2/(1+r))});Rm.invert=gs(function(r){return 2*gi(r/2)});var lf=Jl(function(r){return(r=Bl(r))&&r/ve(r)});lf.invert=gs(function(r){return r});function hf(){return Jo(lf).scale(79.4188).clipAngle(180-.001)}function cf(r,n){return[r,bu(Eu((di+n)/2))]}cf.invert=function(r,n){return[r,2*Wo(Dl(n))-di]};function $l(r,n){return[r,n]}$l.invert=$l;function Am(r,n){var s=ye(n),a=ye(r)*s;return[s*ve(r)/a,ve(n)/a]}Am.invert=gs(Wo);function Dm(r,n){var s=n*n,a=s*s;return[r*(.8707-.131979*s+a*(-.013791+a*(.003971*s-.001529*a))),n*(1.007226+s*(.015085+a*(-.044475+.028874*s-.005916*a)))]}Dm.invert=function(r,n){var s=n,a=25,l;do{var c=s*s,g=c*c;s-=l=(s*(1.007226+c*(.015085+g*(-.044475+.028874*c-.005916*g)))-n)/(1.007226+c*(.015085*3+g*(-.044475*7+.028874*9*c-.005916*11*g)))}while(Fn(l)>Ee&&--a>0);return[r/(.8707+(c=s*s)*(-.131979+c*(-.013791+c*c*c*(.003971-.001529*c)))),s]};function Bm(r,n){return[ye(n)*ve(r),ve(n)]}Bm.invert=gs(gi);function Fm(r,n){var s=ye(n),a=1+ye(r)*s;return[s*ve(r)/a,ve(n)/a]}Fm.invert=gs(function(r){return 2*Wo(r)});function zm(r,n){return[bu(Eu((di+n)/2)),-r]}zm.invert=function(r,n){return[-n,2*Wo(Dl(r))-di]};function bx(r,n,s){s=s||{};var a=s.units||"kilometers",l=s.steps||8;if(!r)throw new Error("geojson is required");if(typeof s!="object")throw new Error("options must be an object");if(typeof l!="number")throw new Error("steps must be an number");if(n===void 0)throw new Error("radius is required");if(l<=0)throw new Error("steps must be greater than 0");var c=[];switch(r.type){case"GeometryCollection":return Yo(r,function(g){var m=Ql(g,n,a,l);m&&c.push(m)}),Ne(c);case"FeatureCollection":return Vn(r,function(g){var m=Ql(g,n,a,l);m&&Vn(m,function(v){v&&c.push(v)})}),Ne(c)}return Ql(r,n,a,l)}function Ql(r,n,s,a){var l=r.properties||{},c=r.type==="Feature"?r.geometry:r;if(c.type==="GeometryCollection"){var g=[];return Yo(r,function(j){var R=Ql(j,n,s,a);R&&g.push(R)}),Ne(g)}var m=Ex(c),v={type:c.type,coordinates:qm(c.coordinates,m)},x=new Ha.GeoJSONReader,P=x.read(v),T=Qa(tu(n,s),"meters"),N=Ha.BufferOp.bufferOp(P,T,a),q=new Ha.GeoJSONWriter;if(N=q.write(N),!Gm(N.coordinates)){var z={type:N.type,coordinates:Um(N.coordinates,m)};return xi(z,l)}}function Gm(r){return Array.isArray(r[0])?Gm(r[0]):isNaN(r[0])}function qm(r,n){return typeof r[0]!="object"?n(r):r.map(function(s){return qm(s,n)})}function Um(r,n){return typeof r[0]!="object"?n.invert(r):r.map(function(s){return Um(s,n)})}function Ex(r){var n=ou(r).geometry.coordinates,s=[-n[0],-n[1]];return hf().rotate(s).scale(fi)}var Nu=bx;var Mx=On(za(),1);var Px=On(za(),1);var Sx=On(za(),1);var kx=On(za(),1);var sa=On(th()),mf="#7ae9ff",_f={color:mf,fillColor:mf,fillOpacity:.3,weight:1},Fx={color:"#ffbb00",fillColor:"#ffbb00",fillOpacity:.75,weight:3},zx={color:"#ff0000",fillColor:"#ff0000",fillOpacity:.95,weight:5},gf="#00FF40",Ts=class{constructor(n,s){this._bufferWidth=5;this._sqmPerPerson=10;this._sqmPerVehicle=70;this.supressWarnings=!1;this.id=n.id,this._rules=s,this.revision=n.revision,this.timeStamp=n.timeStamp,this.isDeleted=n.isDeleted,this.deleteReason=n.deleteReason,this._originalGeoJson=n.geoJson;let a=JSON.parse(n.geoJson);this.layer=new eh.GeoJSON(a,{pmIgnore:!1,interactive:!0,bubblingMouseEvents:!1,snapIgnore:!0,style:()=>this.GetDefaultLayerStyle()}),this.revisions={},this.name=sa.default.sanitize(a.properties.name),this.contactInfo=sa.default.sanitize(a.properties.contactInfo)??"",this.description=sa.default.sanitize(a.properties.description)??"",this.nrOfPeople=a.properties.nrOfPeople??"0",this.nrOfVehicles=a.properties.nrOfVechiles??"0",this.additionalSqm=a.properties.additionalSqm??"0",this.powerNeed=a.properties.powerNeed??void 0,Number.isNaN(Number(a.properties.powerNeed))?this.powerNeed=-1:this.powerNeed=Number(a.properties.powerNeed),Number.isNaN(Number(a.properties.amplifiedSound))?this.amplifiedSound=-1:this.amplifiedSound=Number(a.properties.amplifiedSound),this.color=a.properties.color??mf,this.supressWarnings=a.properties.supressWarnings??!1,this.updateBufferedLayer()}get calculatedAreaNeeded(){try{let n=0;return this.nrOfPeople&&(n+=Number(this.nrOfPeople)*this._sqmPerPerson),this.nrOfVehicles&&(n+=Number(this.nrOfVehicles)*this._sqmPerVehicle),this.additionalSqm&&(n+=Number(this.additionalSqm)),n}catch{return NaN}}get calculatedFireExtinguisherNeeded(){try{return 1}catch{return NaN}}get severityOfRulesBroken(){return this._rules.reduce((n,s)=>Math.max(n,s.severity),0)}get area(){return Math.round(cs(this.calculateGeoJson()))}get geoJson(){return JSON.stringify(this.toGeoJSON())}calculateGeoJson(){let n=this.layer.toGeoJSON();return n.features&&n.features[0]&&(n=n.features[0]),n}GetDefaultLayerStyle(n=!1){let s=this.color;return n&&(s=gf),{color:s,fillColor:s,fillOpacity:.3,weight:1}}checkAllRules(){for(let n of this._rules)n.checkRule(this)}setLayerStyle(n="severity"){if(n=="severity"||n=="cleancolors")this.severityOfRulesBroken>=3?this.layer.setStyle(zx):this.severityOfRulesBroken==2&&!this.supressWarnings?this.layer.setStyle(Fx):this.layer.setStyle(this.GetDefaultLayerStyle(n=="cleancolors"));else if(n=="power"){let s=gf;this.powerNeed?this.powerNeed>9e3?s="#FF0000":this.powerNeed>1e3&&(s="#FFA200"):s="#D1D1D1",this.layer.setStyle({color:s,fillColor:s,fillOpacity:.3,weight:1})}else if(n=="sound"){let s=gf;this.amplifiedSound?this.amplifiedSound>2e3?s="#FF0000":this.amplifiedSound>120&&(s="#FFA200"):s="#D1D1D1",this.layer.setStyle({color:s,fillColor:s,fillOpacity:.3,weight:1})}}getAllTriggeredRules(){return this._rules.filter(n=>n.triggered)}updateBufferedLayer(){let n=this.layer.toGeoJSON(),s=Nu(n,this._bufferWidth,{units:"meters"}),a=0;this.bufferLayer?(this.bufferLayer.clearLayers(),this.bufferLayer.addData(s)):this.bufferLayer=eh.geoJSON(s,{style:{color:"red",fillOpacity:0,weight:a,dashArray:"5, 5"},interactive:!1})}toGeoJSON(){let n=this.calculateGeoJson();return n.properties=n.properties||{},n.properties.name=sa.default.sanitize(this.name).substring(0,100),n.properties.description=sa.default.sanitize(this.description).substring(0,1e3),n.properties.contactInfo=sa.default.sanitize(this.contactInfo),n.properties.nrOfPeople=this.nrOfPeople,n.properties.nrOfVechiles=this.nrOfVehicles,n.properties.additionalSqm=this.additionalSqm,n.properties.powerNeed=this.powerNeed,n.properties.amplifiedSound=this.amplifiedSound,n.properties.color=this.color,n.properties.supressWarnings=this.supressWarnings,n}hasChanges(){return this._originalGeoJson!=this.geoJson}};var Hm=On(th()),Xa="https://placement.freaks.se/api/v1/mapentities",Ru=class{constructor(n){this._latestRevisions={};this._entityConstraints=null;this._rulesGenerator=n,this.loaded=new Promise(s=>this._update().then(()=>s(!0)))}async _update(){let n=await fetch(Xa),s=n.ok?await n.json():[];this._latestRevisions={};for(let a of s){if(this._entityConstraints){let{earliest:l,latest:c}=this._entityConstraints;if(a.timeStamp>c||a.timeStampm||c.timeStamps)return yf(c,g,(s-(a-m))/m)}return n[n.length-1]}pointToSegmentDistance(n,s,a){let[l,c]=s,g=Ao(a[0]-l)*this.kx,m=(a[1]-c)*this.ky,v=0;return(g!==0||m!==0)&&(v=(Ao(n[0]-l)*this.kx*g+(n[1]-c)*this.ky*m)/(g*g+m*m),v>1?(l=a[0],c=a[1]):v>0&&(l+=g/this.kx*v,c+=m/this.ky*v)),g=Ao(n[0]-l)*this.kx,m=(n[1]-c)*this.ky,Math.sqrt(g*g+m*m)}pointOnLine(n,s){let a=1/0,l,c,g,m;for(let v=0;v1?(x=n[v+1][0],P=n[v+1][1]):q>0&&(x+=T/this.kx*q,P+=N/this.ky*q)),T=Ao(s[0]-x)*this.kx,N=(s[1]-P)*this.ky;let z=T*T+N*N;zc.index||l.index===c.index&&l.t>c.t){let x=l;l=c,c=x}let g=[l.point],m=l.index+1,v=c.index;!Ym(a[m],g[0])&&m<=v&&g.push(a[m]);for(let x=m+1;x<=v;x++)g.push(a[x]);return Ym(a[v],c.point)||g.push(c.point),g}lineSliceAlong(n,s,a){let l=0,c=[];for(let g=0;gn&&c.length===0&&c.push(yf(m,v,(n-(l-x))/x)),l>=s)return c.push(yf(m,v,(s-(l-x))/x)),c;l>n&&c.push(v)}return c}bufferPoint(n,s){let a=s/this.ky,l=s/this.kx;return[n[0]-l,n[1]-a,n[0]+l,n[1]+a]}bufferBBox(n,s){let a=s/this.ky,l=s/this.kx;return[n[0]-l,n[1]-a,n[2]+l,n[3]+a]}insideBBox(n,s){return Ao(n[0]-s[0])>=0&&Ao(n[0]-s[2])<=0&&n[1]>=s[1]&&n[1]<=s[3]}};function Ym(r,n){return r[0]===n[0]&&r[1]===n[1]}function yf(r,n,s){let a=Ao(n[0]-r[0]),l=n[1]-r[1];return[r[0]+a*s,r[1]+l*s]}function Ao(r){for(;r<-180;)r+=360;for(;r>180;)r-=360;return r}var wf=1250,qx=8e3;var Wm=5,Ux=Wm+1,jx=new Du(57.5,"meters"),vf=class{constructor(){this.areaCache={};this.overlapCache={};this.coordsCache={}}coordsHaveChanged(n,s){let a=!1;if(!(n in this.coordsCache)||this.coordsCache[n].length==0||this.coordsCache[n].length!=s.length)a=!0;else for(let l=0;l[Yx(),Zx(),Hx(),Xx(),Wx(n,2,"Overlapping other area!","Your area is overlapping someone elses, plz fix <3"),aa(r.slope,1,"Slope warning!","Your area is in slopey or uneven terrain, make sure to check the slope map layer to make sure that you know what you are doing :)"),aa(r.fireroad,3,"Touching fireroad!","Plz move this area away from the fire road!"),Vm(r.propertyborder,3,"Outside border!","You have placed yourself outside our land, please fix that <3"),aa(r.hiddenforbidden,3,"Inside forbidden zone!","You are inside a zone that can not be used this year."),$x(n,3,"Too large/close to others!","For fire safety, we need to add a bit of open space (5m2) between these camps (or if not next to any camps, this camp simply to big)"),Vm(r.area,2,"Outside placement areas.","You are outside the main placement area (yellow border). Make sure you know what you are doing."),aa(r.publicplease,1,"Close to fire road","You are adjucant to a fire road, please use this space for public offerings and not just for sleeping"),aa(r.minorroad,2,"Blocking a path","You are possibly blocking a path for walking around (the black dotted lines). Keep it clean if possible or plan accordingly!"),aa(r.closetosanctuary,1,"Close to the sanctuary","This area is in the viscinity of the sanctuary, please be mindful of what energy your camp is releasing and how it may effect the santuarcy"),aa(r.redsoundzone,1,"In the western meadow","You're in the western meadow, please be extra careful of keeping the land in good condition and do not put your overnight camp here unless necessary, public dreams are prefered")]}var Hx=()=>new ms(1,"Powerful.","You need a lot of power, make sure its not a typo.",r=>({triggered:r.powerNeed>qx})),Xx=()=>new ms(2,"Missing info","Fill in name, description, contact info, power need and sound amplification please.",r=>({triggered:!r.name||!r.description||!r.contactInfo||r.powerNeed===-1||r.amplifiedSound===-1})),Zx=()=>new ms(3,"Too many ppl/vehicles!","Calculated area need is bigger than the maximum allowed area size! Make another area to fix this.",r=>({triggered:r.calculatedAreaNeeded>wf})),Yx=()=>new ms(2,"Bigger than needed?","Your area is quite big for the amount of people/vehicles and extras you have typed in.",r=>({triggered:r.area>Vx(r.calculatedAreaNeeded),message:`Your area is ${r.area-r.calculatedAreaNeeded}m\xB2 bigger than the suggested area size. Consider making it smaller.`}));function Vx(r){let a=.5*Math.pow(r,-.2),l=Math.max(0,Math.min(a,.5));return Math.min(r*(1+l),wf)}var Wx=(r,n,s,a)=>new ms(n,s,a,l=>({triggered:Jx(l.layer,r)})),aa=(r,n,s,a)=>new ms(n,s,a,l=>{let c=l.toGeoJSON(),g=!1;return r.eachLayer(m=>{let v=m.toGeoJSON();if(v.features){for(let x=0;xKx(r,n,s,a,!1),Kx=(r,n,s,a,l)=>new ms(n,s,a,c=>{let g=r.getLayers();for(let m of g){let v=m.toGeoJSON();if(v.features){for(let x=0;x{if(l||Qm(r,g))return;let m=g.toGeoJSON(),v=xf(m.features[0].geometry.coordinates[0]);Jm(a,v)&&(ea(s.features[0],m.features[0])||Ss(s.features[0],m.features[0]))&&(l=!0)}),l}var $x=(r,n,s,a)=>new ms(n,s,a,l=>{let c=l.layer._layers[Object.keys(l.layer._layers)[0]];Is.coordsHaveChanged(c._leaflet_id,c._latlngs[0])&&Is.invalidateCache(l.layer._leaflet_id);let g=new Set;return $m(l.layer,r,g)>wf?{triggered:!0,severity:3,shortMessage:"We need some space between these camps"}:{triggered:!1}});function xf(r){let n=[null,null,null,null],s=!0;for(let a of r)s?(n[0]=a[0],n[2]=a[0],n[1]=a[1],n[3]=a[1],s=!1):(a[0]n[2]&&(n[2]=a[0]),a[1]n[3]&&(n[3]=a[1]));return n}function Jm(r,n){return!(n[0]>r[2]||n[2]r[3])}function $m(r,n,s){if(s.has(r._leaflet_id))return 0;s.add(r._leaflet_id);let a;Is.areaIsCached(r._leaflet_id)?a=Is.getAreaCache(r._leaflet_id):(a=cs(r.toGeoJSON()),Is.setAreaCache(r._leaflet_id,a));let l=xf(r.toGeoJSON().features[0].geometry.coordinates[0]),c=jx.bufferBBox(l,Ux);return n.eachLayer(g=>{if(!Qm(r,g)){let m;if(Is.overlapIsCached(r._leaflet_id,g._leaflet_id))m=Is.getOverlapCache(r._leaflet_id,g._leaflet_id);else{let v=g.getBounds(),P=[v._southWest.lng,v._southWest.lat,v._northEast.lng,v._northEast.lat];if(!Jm(c,P))m=!1,Is.setOverlapCache(r._leaflet_id,g._leaflet_id,m);else{let T=g.toGeoJSON(),N;if(T.type==="Feature")N=T.geometry;else if(T.type==="FeatureCollection")N=T.features[0];else throw new Error("unsupported geometry");let q=Nu(r.toGeoJSON(),Wm,{units:"meters"});ea(q.features[0],N)||Ss(q.features[0],N)?m=!0:m=!1,Is.setOverlapCache(r._leaflet_id,g._leaflet_id,m)}}m&&(a+=$m(g,n,s))}}),a}function Qm(r,n){return r._leaflet_id===n._leaflet_id}var rh=On(th());L.PathDraggable=L.Draggable.extend({initialize:function(r){this._path=r,this._canvas=r._map.getRenderer(r)instanceof L.Canvas;var n=this._canvas?this._path._map.getRenderer(this._path)._container:this._path._path;L.Draggable.prototype.initialize.call(this,n,n,!0)},_updatePosition:function(){var r={originalEvent:this._lastEvent};this.fire("drag",r)},_onDown:function(r){var n=r.touches?r.touches[0]:r;this._startPoint=new L.Point(n.clientX,n.clientY),!(this._canvas&&!this._path._containsPoint(this._path._map.mouseEventToLayerPoint(n)))&&L.Draggable.prototype._onDown.call(this,r)}});L.Handler.PathDrag=L.Handler.extend({initialize:function(r){this._path=r},getEvents:function(){return{dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd}},addHooks:function(){this._draggable||(this._draggable=new L.PathDraggable(this._path)),this._draggable.on(this.getEvents(),this).enable(),L.DomUtil.addClass(this._draggable._element,"leaflet-path-draggable")},removeHooks:function(){this._draggable.off(this.getEvents(),this).disable(),L.DomUtil.removeClass(this._draggable._element,"leaflet-path-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(){this._startPoint=this._draggable._startPoint,this._path.closePopup().fire("movestart").fire("dragstart")},_onDrag:function(r){var n=this._path,s=r.originalEvent.touches&&r.originalEvent.touches.length===1?r.originalEvent.touches[0]:r.originalEvent,a=L.point(s.clientX,s.clientY),l=n._map.layerPointToLatLng(a);this._offset=a.subtract(this._startPoint),this._startPoint=a,this._path.eachLatLng(this.updateLatLng,this),n.redraw(),r.latlng=l,r.offset=this._offset,n.fire("drag",r),r.latlng=this._path.getCenter?this._path.getCenter():this._path.getLatLng(),n.fire("move",r)},_onDragEnd:function(r){this._path._bounds&&this.resetBounds(),this._path.fire("moveend").fire("dragend",r)},latLngToLayerPoint:function(r){var n=this._path._map.project(L.latLng(r));return n._subtract(this._path._map.getPixelOrigin())},updateLatLng:function(r){var n=this.latLngToLayerPoint(r);n._add(this._offset);var s=this._path._map.layerPointToLatLng(n);r.lat=s.lat,r.lng=s.lng},resetBounds:function(){this._path._bounds=new L.LatLngBounds,this._path.eachLatLng(function(r){this._bounds.extend(r)})}});L.Path.include({eachLatLng:function(r,n){n=n||this;var s=function(a){for(var l=0;l=19?a.getLayers().forEach(function(g){g.setStyle({opacity:1})}):a.getLayers().forEach(function(g){g.setStyle({opacity:0})})});let l=Km(this._groups,this._placementLayers);this._repository=new Ru(l),this._popup=Ir.popup({autoClose:!1,closeButton:!1,closeOnClick:!1,closeOnEscapeKey:!1}),Ir.PM.setOptIn(!0),this._map.pm.addControls({position:"bottomleft",drawPolygon:!1,drawCircle:!1,drawMarker:!1,drawPolyline:!1,drawRectangle:!1,drawCircleMarker:!1,drawText:!1,removalMode:!1,editControls:!1,snappable:!1}),this._map.pm.setPathOptions(_f),this._map.pm.setGlobalOptions({tooltips:!1,allowSelfIntersection:!1,snappable:!0,draggable:!0}),this._map.on("pm:create",this.onNewLayerCreated.bind(this)),this._map.on("click",g=>{console.log("[Editor]","Editor blur event fired (map click)",{mouseEvent:g}),this.setMode("blur")}),this.sqmTooltip=new Ir.Tooltip({permanent:!0,interactive:!1,direction:"center",className:"shape-tooltip"}),this.sqmTooltip.setLatLng([0,0]),this.sqmTooltip.addTo(this._map),this.sqmTooltip.closeTooltip(),this._nameTooltips={},n.on("zoomend",function(){var g=n.getZoom();this.groups.names.getLayers().forEach(function(m){g>=19?m._tooltip.setOpacity(1):m._tooltip.setOpacity(0)})}),document.onkeydown=g=>{this.keyEscapeListener(g)};var c=new Ir.Control.Search({layer:this._placementLayers,propertyName:"name",marker:!1,zoom:19,initial:!1});n.addControl(c)}async setMode(n,s){let a=this._mode,l=this._selected,c=n==a,g=s==l;if(!(c&&g)){if(this._ghostLayers.clearLayers(),n=="blur")if((a=="editing-shape"||a=="moving-shape"||a=="editing-info")&&l){n="selected",s=s||l;let v=s.layer.getBounds().getCenter();this._popup.setLatLng(v)}else n="none",s=void 0;if(console.log("[Editor]","mode changed!",{mode:this._mode,nextMode:n,nextEntity:s}),this._mode=n,this._mode=="none"){this.setSelected(null,l),this.setPopup("none");return}if(this._mode=="selected"&&s){this.setSelected(s,l),this.setPopup("info",s),l&&(l?.layer.pm.disable(),l?.layer._layers[l.layer._leaflet_id-1].dragging.disable());return}if(this._mode=="editing-shape"&&s){s.layer.pm.enable({editMode:!0,snappable:!1}),this.setSelected(s,l),this.setPopup("none");return}if(this._mode=="moving-shape"&&s){this.setSelected(s,l),this.setPopup("none"),this.UpdateOnScreenDisplay(s,"Drag to move"),s.layer._layers[s.layer._leaflet_id-1].dragging.enable();return}if(this._mode=="editing-info"&&s){this.setSelected(s,l),this.setPopup("edit-info",s);return}}}async setSelected(n,s){s&&n!=s&&s.hasChanges()&&await this.onLayerDoneEditing(s),this._isEditMode&&this.UpdateOnScreenDisplay(n),this._selected=n,this.refreshEntity(this._selected)}keyEscapeListener(n){"key"in n&&!(n.key==="Escape"||n.key==="Esc")||this.setMode("blur")}async setPopup(n,s){if(n=="none"||!s){this._popup.close();return}if(n=="info"){let a=document.createElement("div"),l=s.nrOfPeople==="1"?" person,":" people,",c=s.nrOfVehicles==="1"?"> vehicle,":" vehicles,",g=s.name?s.name:"No name yet",m=s.description?s.description:"No description yet, please add one!",v=s.contactInfo?s.contactInfo:"Please add contact info! Without it, your area might be removed.",x=s.powerNeed!=-1?`${s.powerNeed} Watts`:"Please state your power need! Set to 0 if you will not use electricity.",P=s.amplifiedSound!=-1?`${s.amplifiedSound} Watts`:"Please set sound amplification! Set to 0 if you wont have speakers.",T=rh.default.sanitize(m),N=/(\b(https?|ftp):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gim,q=T.replace(N,'$1');a.innerHTML=`

${rh.default.sanitize(g)}

${q}

- Contact: ${nh.default.sanitize(v)} + Contact: ${rh.default.sanitize(v)}
Power: ${x}
@@ -34,7 +34,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho a laptop is about 50W, a phone charger is about 10W.`,z.style.width="5em",z.style.marginTop="7px",z.style.marginBottom="7px",z.style.marginLeft="110px",z.type="number",z.value=String(s.powerNeed),z.placeholder="?",z.min="0",z.oninput=()=>{s.powerNeed=z.value,this.refreshEntity(s),this.UpdateOnScreenDisplay(s)},a.appendChild(z),a.appendChild(document.createElement("br")),a.appendChild(document.createElement("b")).innerHTML="Sound amplification (Watts) ";let j=document.createElement("input");if(j.style.width="5em",j.title=`If over 100W then you are considered a sound camp. Please get in contact with the sound lead.`,j.style.marginBottom="7px",j.style.marginLeft="58px",j.type="number",j.value=String(s.amplifiedSound),j.min="0",j.placeholder="?",j.oninput=()=>{s.amplifiedSound=j.value,this.refreshEntity(s),this.UpdateOnScreenDisplay(s)},a.appendChild(j),a.appendChild(document.createElement("p")),this._isEditMode){let R=document.createElement("button");R.innerHTML="Ok!",R.style.width="200px",R.onclick=async D=>{D.stopPropagation(),D.preventDefault(),this.setMode("blur")},a.appendChild(R);let B=document.createElement("button");B.innerHTML="More...",B.style.marginRight="0",B.onclick=async D=>{D.stopPropagation(),D.preventDefault(),this.setPopup("more",s)},a.appendChild(B)}a.onkeydown=R=>{"key"in R&&R.key==="Enter"&&"ctrlKey"in R&&R.ctrlKey==!0&&this.setMode("blur")},this._popup.setContent(a).openOn(this._map);return}if(n=="more"){let a=document.createElement("div");a.innerHTML="",a.appendChild(document.createElement("h2")).innerHTML="More stuff";let l=this.formatDate(s.timeStamp),c=a.appendChild(document.createElement("div"));c.innerHTML=`Entity Id: ${s.id}
Revisions: ${s.revision}
Last edited: ${l}`,a.appendChild(document.createElement("br"));let g=a.appendChild(document.createElement("a"));g.innerHTML="Click here to copy a link to this entity",g.href="?id="+s.id,g.onclick=q=>(console.log("Copy to clipboard",g.href),q.stopPropagation(),q.preventDefault(),navigator.clipboard.writeText(g.href),!1),a.appendChild(document.createElement("br")),a.appendChild(document.createElement("br")),a.appendChild(document.createElement("b")).innerHTML="Supress yellow warnings";let m=document.createElement("input");m.type="checkbox",m.style.marginLeft="10px",m.checked=s.supressWarnings,m.onchange=()=>{s.supressWarnings=m.checked,this.refreshEntity(s)},a.appendChild(m),a.appendChild(document.createElement("br")),a.appendChild(document.createElement("b")).innerHTML="Custom color ";let v=document.createElement("input");v.type="color",v.style.width="66px",v.style.marginLeft="146px",v.value=s.color,v.onchange=()=>{s.color=v.value,this.refreshEntity(s)},a.appendChild(v),a.appendChild(document.createElement("p"));let x=document.createElement("button");x.classList.add("delete-button"),x.innerHTML="Delete",x.style.width="100%",x.onclick=async q=>{let z=prompt("Are you really sure you should delete this area? Answer why.","");if(z==null||z==""){console.log("Delete nope, deleteReason",z);return}console.log("Delete yes, deleteReason",z),q.stopPropagation(),q.preventDefault(),this.deleteAndRemoveEntity(s,z)},a.appendChild(x);let P=document.createElement("button");P.innerHTML="History",P.style.marginRight="0",P.onclick=async q=>{q.stopPropagation(),q.preventDefault(),this.setPopup("history",s)},a.appendChild(P);let T=a.appendChild(document.createElement("div"));T.innerHTML="Use delete with caution! Only delete things you know is ok. Undelete can only be performed by using black magic.",a.appendChild(document.createElement("br"));let N=document.createElement("button");N.innerHTML="Back",N.style.width="200px",N.onclick=async q=>{q.stopPropagation(),q.preventDefault(),this.setMode("blur")},a.appendChild(N),this._popup.setContent(a).openOn(this._map);return}if(n=="history"){let a=document.createElement("div");a.innerHTML="",a.appendChild(document.createElement("h2")).innerHTML="Edit-History";let l=this.formatDate(s.timeStamp),c=a.appendChild(document.createElement("div"));c.innerHTML=`Entity Id: ${s.id}
Name: ${s.name}
Revisions: ${s.revision}
Last edited: ${l}`,a.appendChild(document.createElement("br"));let g=document.createElement("div"),m=document.createElement("div"),v=document.createElement("div"),x=document.createElement("h3");x.innerText="Description",m.append(x),m.append(v),g.id="history-table",a.appendChild(g),v.id="change-description",a.appendChild(m);let P=document.createElement("table");g.appendChild(P);let N=P.createTHead().insertRow();N.insertCell().innerText="Revision",N.insertCell().innerText="Timestamp",N.insertCell().innerText="What Changed";let q=P.createTBody();await this._repository.getRevisionsForEntity(s);let z=[],j=null,R=null,B={color:"#ff0000",fillColor:"#000000",fillOpacity:.5,weight:5};for(let A in s.revisions){let G=document.createElement("ul"),H=document.createElement("tr");j=s.revisions[A],H.insertCell().innerText=j.revision,H.insertCell().innerText=this.formatDate(j.timeStamp,"short","medium"),H.insertCell().append(G);let K=this.getEntityDifferences(j,R);for(let et in K){let X=K[et],lt=document.createElement("li");lt.innerText=X.changeShort;let gt=document.createElement("a");gt.href="#",gt.innerText=" Show",gt.title="Show a detailed description about this change.",gt.onclick=()=>{let Et=s.revisions[A];x.innerText=`Description of revision ${A}`,v.innerText=`${X.changeLong} -`;let Q=Ir.DomUtil.create("button","history-button");Q.title=`Restores detailes from revision ${A}.`,Q.textContent="\u26A0 Restore Details",Q.onclick=()=>{console.log(`Restores detailes from revision ${A}.`),s.name=s.revisions[A].name,s.description=s.revisions[A].description,s.contactInfo=s.revisions[A].contactInfo,s.nrOfPeople=s.revisions[A].nrOfPeople,s.nrOfVehicles=s.revisions[A].nrOfVehicles,s.additionalSqm=s.revisions[A].additionalSqm,s.powerNeed=s.revisions[A].powerNeed,s.amplifiedSound=s.revisions[A].amplifiedSound,s.color=s.revisions[A].color,s.supressWarnings=s.revisions[A].supressWarnings},v.append(Q);let kt=Ir.DomUtil.create("button","history-button");kt.title=`Restores shape from revision ${A}.`,kt.textContent="\u26A0 Restore Shape",kt.onclick=()=>{console.log(`Restores shape from revision ${A}.`),this.removeEntityNameTooltip(s),this.removeEntityFromLayers(s),s.layer=s.revisions[A].layer,this.addEntityToMap(s)},v.append(kt),this._ghostLayers.clearLayers(),Et.layer.setStyle(B),this._ghostLayers.addLayer(Et.layer)},lt.append(gt),G.append(lt)}z.push(H),R=j}z.slice().reverse().forEach(function(A){q.append(A)});let D=document.createElement("button");D.innerHTML="Back",D.style.width="200px",D.onclick=async A=>{A.stopPropagation(),A.preventDefault(),this.setMode("blur")},a.appendChild(D),this._popup.setContent(a).openOn(this._map);return}}async onLayerClicked(n){console.log("[Editor]","Click event fired",{entity:n}),this.setMode("selected",n)}async onLayerDoneEditing(n){console.log("[Editor]","onLayerDoneEditing!",{selected:this._selected}),n.layer.pm.disable(),this.UpdateOnScreenDisplay(null),await this._repository.getRevisionsForEntity(n);let s;for(let c in n.revisions)s=c;let a=n.revisions[s];if(n.revision!=a.revision){let c=this.getEntityDifferences(a,n),g="Someone else edited this shape at the same time as you
You have now overwritten their changes, these differences were detected:

    ";for(let m in c)g+=`
  • ${c[m].changeLong}
  • `;g+="
",No(g,"danger",void 0,36e5)}if(this.isAreaTooBig(n.toGeoJSON())){No("The area of the polygon is waaay to big. It will not be saved, please change it.","danger",void 0,36e5);return}let l=await this._repository.updateEntity(n);l&&(this.removeEntity(n,!1),this.addEntityToMap(l),No("Saved!","success"))}async onNewLayerCreated(n){console.log("[Editor]","Create event fired",{createEvent:n});let{layer:s}=n,a=s.toGeoJSON();if(this.isAreaTooBig(a)){No("The area of the polygon is waaay to big. Draw something smaller.","danger",void 0,36e5),this._map.removeLayer(s);return}let l=await this._repository.createEntity(a);if(l){this.addEntityToMap(l),this._map.removeLayer(s);let g=l.layer.getBounds().getCenter();this._popup.setLatLng(g),this.setMode("editing-info",l),No("Saved!","success")}}createEntityTooltip(n){let s=new Ir.Marker(n.layer.getBounds().getCenter(),{opacity:0});return s.feature={type:"Feature",geometry:{type:"Point",coordinates:[0,0]},properties:{}},s.options.icon.options.iconSize=[1,1],s.bindTooltip(n.name,{permanent:!0,interactive:!1,direction:"center",className:"name-tooltip"}),n.nameMarker=s,s}addEntityToMap(n,s=!0){this._currentRevisions[n.id]=n,n.layer.on("click",({latlng:a})=>{console.log(a),this._popup.setLatLng(a),this.onLayerClicked(n)}),this._nameTooltips[n.id]=this.createEntityTooltip(n),this._nameTooltips[n.id].addTo(this._groups.names),n.layer.on("pm:markerdrag",()=>{n.updateBufferedLayer(),this.refreshEntity(n),this.UpdateOnScreenDisplay(n)}),n.layer.on("pm:markerdragend",()=>{this.isAreaTooBig(n.toGeoJSON())&&No("The area of the polygon is waaay to big. Draw something smaller, this wont be saved anyways.","danger",void 0,36e5)}),n.layer._layers[n.layer._leaflet_id-1].on("drag",()=>{n.updateBufferedLayer(),this.refreshEntity(n),this.UpdateOnScreenDisplay(null)}),n.layer.on("pm:vertexremoved",()=>{n.updateBufferedLayer(),this.refreshEntity(n),this.UpdateOnScreenDisplay(n)}),this._placementLayers.addLayer(n.layer),this._placementBufferLayers.addLayer(n.bufferLayer),this._map.getZoom()<19&&n.bufferLayer.setStyle({opacity:0}),s&&this.refreshEntity(n)}refreshEntity(n,s=!0){if(n==null)return;let a=n.nameMarker,l=n.nameMarker.getLatLng(),c=n.layer.getBounds().getCenter();(c.lat!=l.lat||c.lng!=l.lng)&&n.nameMarker.setLatLng(c),n.nameMarker._tooltip._content!=n.name&&n.nameMarker.setTooltipContent(n.name);var g=this._map.getZoom();g>=19?this._nameTooltips[n.id]._tooltip.setOpacity(1):this._nameTooltips[n.id]._tooltip.setOpacity(0),s&&n.checkAllRules(),n.setLayerStyle(this._currentLayerFilterStyle)}refreshAllEntities(n=!0){for(let s in this._currentRevisions)this.refreshEntity(this._currentRevisions[s],n)}refreshEntitiesSlow(n=null){if(No("Validating..."),n)this._validateEntitiesQueue=n;else for(let s in this._currentRevisions)this._validateEntitiesQueue.push(this._currentRevisions[s]);this.validateSlowly()}validateSlowly(){let n=0;for(;this._validateEntitiesQueue.length>0&&n<50;){let s=this._validateEntitiesQueue.pop();n=n+1,this.refreshEntity(s,!0)}this._validateEntitiesQueue.length==0?No("Validation done","success"):setTimeout(()=>{this.validateSlowly()},50)}setLayerFilter(n,s=!0){this._currentLayerFilterStyle=n,this.refreshAllEntities(s)}isAreaTooBig(n){return hs(n)>5e3}deleteAndRemoveEntity(n,s=null){this._selected=null,this.setMode("none"),this.removeEntity(n),this._repository.deleteEntity(n,s)}removeEntityNameTooltip(n){n.nameMarker.unbindTooltip(),this._groups.names.removeLayer(n.nameMarker),n.nameMarker=null,delete this._nameTooltips[n.id]}removeEntityFromLayers(n){this._placementLayers.removeLayer(n.layer),this._placementBufferLayers.removeLayer(n.bufferLayer),this._map.removeLayer(n.layer),this._map.removeLayer(n.bufferLayer)}removeEntity(n,s=!0){this.removeEntityNameTooltip(n),this.removeEntityFromLayers(n),delete this._currentRevisions[n.id],s&&this._repository.remove(n)}addToggleEditButton(){if(!0){let n=Ir.Control.extend({options:{position:"bottomleft"},onAdd:()=>{let s=Ir.DomUtil.create("button","btn btn-gradient1 button-shake-animate");return s.title="Edit",s.textContent="Edit",Ir.DomEvent.disableClickPropagation(s),s.onclick=()=>{this.toggleEditMode(),s.textContent=this._isEditMode?"Done":"Edit",s.title=this._isEditMode?"Done":"Edit"},s}});this._map.addControl(new n)}if(void 0){let n=Ir.Control.extend({options:{position:"bottomleft"},onAdd:()=>{var s=Ir.DomUtil.create("p","btn btn-gradient1 button-shake-animate");return s.innerHTML+=void 0,s}});this._map.addControl(new n)}}formatDate(n,s="short",a="short"){return new Date(Date.parse(n)).toLocaleString("sv",{dateStyle:s,timeStyle:a})}getEntityDifferences(n,s){let a=[];if(s==null)return a.push({what:"Created",changeShort:"Created",changeLong:"Someone created this entity."}),a;n.isDeleted!=s.isDeleted&&a.push({what:"Deleted",changeShort:"Is Deleted",changeLong:`Is Deleted due to ${n.deleteReason}.`}),n.name!=s.name&&a.push({what:"Name",changeShort:"Name Changed",changeLong:`Someone changed the name from ${s.name} to ${n.name}.`}),n.description!=s.description&&a.push({what:"Description",changeShort:"Description Changed",changeLong:`Someone changed the description from ${s.description} to ${n.description}.`}),n.contactInfo!=s.contactInfo&&a.push({what:"Contact Info",changeShort:"Contact Info Changed",changeLong:`Someone changed the contact info from ${s.contactInfo} to ${n.contactInfo}.`}),n.nrOfPeople!=s.nrOfPeople&&a.push({what:"NrOfPeople",changeShort:"NrOfPeople Changed",changeLong:`Someone changed the number of people from ${s.nrOfPeople} to ${n.nrOfPeople}.`}),n.nrOfVehicles!=s.nrOfVehicles&&a.push({what:"NrOfVehicles",changeShort:"NrOfVehicles Changed",changeLong:`Someone changed the number of vehicles from ${s.nrOfVehicles} to ${n.nrOfVehicles}.`}),n.additionalSqm!=s.additionalSqm&&a.push({what:"AdditionalSqm",changeShort:"AdditionalSqm Changed",changeLong:`Someone changed additional Sqm from ${s.additionalSqm} to ${n.additionalSqm}.`}),n.powerNeed!=s.powerNeed&&a.push({what:"PowerNeed",changeShort:"PowerNeed Changed",changeLong:`Someone changed power need from ${s.powerNeed} to ${n.powerNeed}.`}),n.amplifiedSound!=s.amplifiedSound&&a.push({what:"AmplifiedSound",changeShort:"AmplifiedSound Changed",changeLong:`Someone changed amplified sound from ${s.amplifiedSound} to ${n.amplifiedSound}.`}),n.color!=s.color&&a.push({what:"Color",changeShort:"Color Changed",changeLong:`Someone changed color from ${s.color} to ${n.color}.`}),n.supressWarnings!=s.supressWarnings&&a.push({what:"SupressWarnings",changeShort:"SupressWarnings Changed",changeLong:`Someone changed supress warnings from ${s.supressWarnings} to ${n.supressWarnings}.`});let l=JSON.stringify(n.toGeoJSON().geometry),c=JSON.stringify(s.toGeoJSON().geometry);return l!=c&&a.push({what:"GeoJson",changeShort:"Polygon Changed",changeLong:"Someone changed the polygon."}),a.length==0&&a.push({what:"NoDifference",changeShort:"No difference",changeLong:"No difference detected between revisions."}),a}async toggleEditMode(){if(!!0){this._isEditMode=!1;return}this._isEditMode=!this._isEditMode,this._isEditMode&&localStorage.getItem("hasSeenEditorInstructions")==null&&Af([{file:"entering_edit_mode",position:"bottom"},{file:"entering_edit_mode_page_two",position:"bottom",onClose:()=>{localStorage.setItem("hasSeenEditorInstructions","true")}}]),this.setPopup("info",this._selected),this._isEditMode==!1&&this._mode!="selected"&&this.setMode("none"),this._map.pm.addControls({drawPolygon:this._isEditMode}),this._map.pm.Toolbar.changeActionsOfControl("Polygon",["cancel"])}async addAPIEntities(){No("Loading your drawn polygons from da interweb!");let n=await this._repository.entities();this._lastEnityFetch=new Date().getTime()/1e3;for(let s of n)this.addEntityToMap(s,!1);this.refreshAllEntities(!1),setTimeout(()=>{this.refreshEntitiesSlow()},100),this.addToggleEditButton()}async checkForUpdatedEntities(){if(this._isEditMode==!1){var n=new Date().getTime()/1e3;if(n-this._lastEnityFetch>this._autoRefreshIntervall){this._lastEnityFetch=n;let s=await this._repository.reload(),a=new Array,l=new Array;for(let c of s.refreshedAdded){let g=this._repository.getEntityById(c);l.push(`Add new entity ${g.id} ${g.name}`),this.addEntityToMap(g,!1),a.push(g)}for(let c of s.refreshedDeleted){let g=this._currentRevisions[c];l.push(`Removed entity ${g.id} ${g.name}`),this.removeEntity(g)}for(let c of s.refreshedUpdated){let g=this._repository.getEntityById(c);l.push(`Updated entity ${g.id} ${g.name}`),this.removeEntity(this._currentRevisions[c],!1),this.addEntityToMap(g,!1),a.push(g)}l.length>0&&(console.log("Fetched latest changes from map",new Date().toISOString(),l),this.refreshAllEntities(!1)),a.length>0&&this.refreshEntitiesSlow(a)}}setTimeout(()=>{this.checkForUpdatedEntities()},1e4)}gotoEntity(n){let s=this._repository.getEntityById(n);if(s){let a=s.layer.getBounds().getCenter();this._map.setView(a,19),this._popup.setLatLng(a),this.onLayerClicked(s)}}UpdateOnScreenDisplay(n,s=null){if(n||s){let a="";if(s)a=s;else{a=n.area+"m\xB2";for(let l of n.getAllTriggeredRules())l.severity>=2&&(a+="
"+l.shortMessage)}this.sqmTooltip.openOn(this._map),this.sqmTooltip.setLatLng(n.layer.getBounds().getCenter()),this.sqmTooltip.setContent(a)}else this.sqmTooltip.close()}};var n_=async()=>{let r=new Set(["Placement","Placement_map","POI"]),n=Yr.default.map("map",{zoomControl:!1,maxZoom:21,drawControl:!0,attributionControl:!1}).setView([57.6226,14.9276],16);n.groups={placement:new Yr.default.LayerGroup,mapstuff:new Yr.default.LayerGroup,neighbourhoods:new Yr.default.LayerGroup,quarters:new Yr.default.LayerGroup,plazas:new Yr.default.LayerGroup,poi:new Yr.default.LayerGroup,soundspots:new Yr.default.LayerGroup},n.groups.googleSatellite=Yr.default.tileLayer("https://{s}.google.com/vt/lyrs=s&x={x}&y={y}&z={z}",{maxZoom:21,maxNativeZoom:20,subdomains:["mt0","mt1","mt2","mt3"]}).addTo(n),fetch("./data/analysis/contours.geojson").then(v=>v.json()).then(v=>{Yr.default.geoJSON(v.features,{style:{color:"#ffffff",weight:1,opacity:.5}}).addTo(n.groups.mapstuff)}),await fa(n,"type","./data/bl24/placement_areas.geojson"),await fa(n,"type","./data/bl24/borders.geojson"),await fa(n,"type","./data/bl24/roads_and_distances.geojson"),await fa(n,"type","./data/bl24/plazas.geojson"),await fa(n,"type","./data/bl24/neighbourhoods.geojson"),n.groups.propertyborder.addTo(n.groups.mapstuff),n.removeLayer(n.groups.propertyborder),n.groups.minorroad.addTo(n.groups.mapstuff),n.removeLayer(n.groups.minorroad),n.groups.fireroad.addTo(n.groups.mapstuff),n.removeLayer(n.groups.fireroad),n.groups.area.addTo(n.groups.mapstuff),n.removeLayer(n.groups.area),n.groups.hiddenforbidden.addTo(n.groups.mapstuff),n.groups.container.addTo(n.groups.mapstuff),n.removeLayer(n.groups.container),n.groups.parking.addTo(n.groups.mapstuff),n.removeLayer(n.groups.parking),n.groups.toilet.addTo(n.groups.mapstuff),n.removeLayer(n.groups.toilet),n.groups.bridge.addTo(n.groups.mapstuff),n.removeLayer(n.groups.bridge),n.groups.names=new Yr.default.LayerGroup,n.groups.names.addTo(n),n.groups.soundguide=new Yr.default.LayerGroup,n.groups.bluesoundzone.addTo(n.groups.soundguide),n.removeLayer(n.groups.bluesoundzone),n.groups.greensoundzone.addTo(n.groups.soundguide),n.removeLayer(n.groups.greensoundzone),n.groups.yellowsoundzone.addTo(n.groups.soundguide),n.removeLayer(n.groups.yellowsoundzone),n.groups.orangesoundzone.addTo(n.groups.soundguide),n.removeLayer(n.groups.orangesoundzone),n.groups.redsoundzone.addTo(n.groups.soundguide),n.on("overlayadd",function(v){n.groups.names.setZIndex(101),v.name==="Soundguide"&&(n.groups.bluesoundzone.bringToBack(),n.groups.greensoundzone.bringToBack(),n.groups.yellowsoundzone.bringToBack(),n.groups.orangesoundzone.bringToBack(),n.groups.redsoundzone.bringToBack())}),n.groups.terrain=await Rf(n,"./data/terrain.png",[[57.615642290070426,14.915097173672454],[57.62912303949617,14.936217846229036]]),n.groups.heightmap=Yr.default.tileLayer("./data/analysis/height/{z}/{x}/{y}.jpg",{minZoom:13,maxZoom:21,minNativeZoom:16,maxNativeZoom:17,tms:!1}),n.groups.slopemap=Yr.default.tileLayer("./data/analysis/slope/{z}/{x}/{y}.png",{minZoom:13,maxZoom:21,minNativeZoom:16,maxNativeZoom:17,tms:!1}),n.groups.aftermath=Yr.default.tileLayer("./data/bl23/aftermath/{z}/{x}/{y}.png",{minZoom:0,maxZoom:21,minNativeZoom:0,maxNativeZoom:20,tms:!1}),n.groups.aftermath22=Yr.default.tileLayer("./data/bl22/aftermath/{z}/{x}/{y}.png",{minZoom:0,maxZoom:21,minNativeZoom:0,maxNativeZoom:20,tms:!1}),n.groups.plaza.addTo(n.groups.plazas),n.removeLayer(n.groups.plaza),n.groups.neighbourhood.addTo(n.groups.neighbourhoods),n.removeLayer(n.groups.neighbourhood);var s={Placement_map:n.groups.mapstuff,POI:n.groups.poi,Soundguide:n.groups.soundguide,Slope:n.groups.slopemap,Height:n.groups.heightmap,Terrain:n.groups.terrain,Plazas:n.groups.plazas,Placement:n.groups.placement,Names:n.groups.names,Neighbourhoods:n.groups.neighbourhoods,Quarters:n.groups.quarters,Aftermath22:n.groups.aftermath22,Aftermath23:n.groups.aftermath};let a=new Du(n,n.groups),l=Yr.default.Control.extend({options:{position:"topleft"},onAdd:()=>{let v=Yr.default.DomUtil.create("button","leaflet-bar help-button");return v.title="Guide to the placement process",v.textContent="\u26D1\uFE0F",Yr.default.DomEvent.disableClickPropagation(v),v.onclick=()=>{os({file:"guide-home",position:"end",onClose:()=>{localStorage.setItem("hasSeenPlacementWelcome","true")}})},v}});n.addControl(new l),Yr.default.control.polylineMeasure({measureControlLabel:"📏",arrow:{color:"#0000"}}).addTo(n),n.on("hashmetainit",function(v){ss.decode(v.meta),ss.layers.filter(x=>x in s).forEach(x=>r.add(x)),r.forEach(x=>n.addLayer(s[x]))}),n.on("overlayadd",function(v){r.add(v.name),ss.layers=r}),n.on("overlayremove",function(v){r.delete(v.name),ss.layers=r}),ss.map=n,ss.layers=r,n.on("click",function(v){console.log(v.latlng)}),await ah("poi.json",n.groups.poi),await ah("soundspots.json",n.groups.soundspots),n.groups.soundspots.addTo(n.groups.soundguide),n.removeLayer(n.groups.soundspots),Sf(n.groups.quarters),kf(n.groups.plazas),Tf(n.groups.neighbourhoods),await If(n,s,r),await a.addAPIEntities(),n.groups.placement.addTo(n);let m=new URLSearchParams(window.location.search).get("id");m&&a.gotoEntity(m),No("Loaded everything!","success")};async function $x(){try{await n_()}catch(r){console.error(r)}localStorage.getItem("hasSeenPlacementWelcome")||os({file:"welcome",position:"bottom",onClose:()=>{localStorage.setItem("hasSeenPlacementWelcome","true")}})}$x();})(); +`;let Q=Ir.DomUtil.create("button","history-button");Q.title=`Restores detailes from revision ${A}.`,Q.textContent="\u26A0 Restore Details",Q.onclick=()=>{console.log(`Restores detailes from revision ${A}.`),s.name=s.revisions[A].name,s.description=s.revisions[A].description,s.contactInfo=s.revisions[A].contactInfo,s.nrOfPeople=s.revisions[A].nrOfPeople,s.nrOfVehicles=s.revisions[A].nrOfVehicles,s.additionalSqm=s.revisions[A].additionalSqm,s.powerNeed=s.revisions[A].powerNeed,s.amplifiedSound=s.revisions[A].amplifiedSound,s.color=s.revisions[A].color,s.supressWarnings=s.revisions[A].supressWarnings},v.append(Q);let kt=Ir.DomUtil.create("button","history-button");kt.title=`Restores shape from revision ${A}.`,kt.textContent="\u26A0 Restore Shape",kt.onclick=()=>{console.log(`Restores shape from revision ${A}.`),this.removeEntityNameTooltip(s),this.removeEntityFromLayers(s),s.layer=s.revisions[A].layer,this.addEntityToMap(s)},v.append(kt),this._ghostLayers.clearLayers(),Et.layer.setStyle(B),this._ghostLayers.addLayer(Et.layer)},lt.append(gt),G.append(lt)}z.push(H),R=j}z.slice().reverse().forEach(function(A){q.append(A)});let D=document.createElement("button");D.innerHTML="Back",D.style.width="200px",D.onclick=async A=>{A.stopPropagation(),A.preventDefault(),this.setMode("blur")},a.appendChild(D),this._popup.setContent(a).openOn(this._map);return}}async onLayerClicked(n){console.log("[Editor]","Click event fired",{entity:n}),this.setMode("selected",n)}async onLayerDoneEditing(n){console.log("[Editor]","onLayerDoneEditing!",{selected:this._selected}),n.layer.pm.disable(),this.UpdateOnScreenDisplay(null),await this._repository.getRevisionsForEntity(n);let s;for(let c in n.revisions)s=c;let a=n.revisions[s];if(n.revision!=a.revision){let c=this.getEntityDifferences(a,n),g="Someone else edited this shape at the same time as you
You have now overwritten their changes, these differences were detected:
    ";for(let m in c)g+=`
  • ${c[m].changeLong}
  • `;g+="
",Ro(g,"danger",void 0,36e5)}if(this.isAreaTooBig(n.toGeoJSON())){Ro("The area of the polygon is waaay to big. It will not be saved, please change it.","danger",void 0,36e5);return}let l=await this._repository.updateEntity(n);l&&(this.removeEntity(n,!1),this.addEntityToMap(l),Ro("Saved!","success"))}async onNewLayerCreated(n){console.log("[Editor]","Create event fired",{createEvent:n});let{layer:s}=n,a=s.toGeoJSON();if(this.isAreaTooBig(a)){Ro("The area of the polygon is waaay to big. Draw something smaller.","danger",void 0,36e5),this._map.removeLayer(s);return}let l=await this._repository.createEntity(a);if(l){this.addEntityToMap(l),this._map.removeLayer(s);let g=l.layer.getBounds().getCenter();this._popup.setLatLng(g),this.setMode("editing-info",l),Ro("Saved!","success")}}createEntityTooltip(n){let s=new Ir.Marker(n.layer.getBounds().getCenter(),{opacity:0});return s.feature={type:"Feature",geometry:{type:"Point",coordinates:[0,0]},properties:{}},s.options.icon.options.iconSize=[1,1],s.bindTooltip(n.name,{permanent:!0,interactive:!1,direction:"center",className:"name-tooltip"}),n.nameMarker=s,s}addEntityToMap(n,s=!0){this._currentRevisions[n.id]=n,n.layer.on("click",({latlng:a})=>{console.log(a),this._popup.setLatLng(a),this.onLayerClicked(n)}),this._nameTooltips[n.id]=this.createEntityTooltip(n),this._nameTooltips[n.id].addTo(this._groups.names),n.layer.on("pm:markerdrag",()=>{n.updateBufferedLayer(),this.refreshEntity(n),this.UpdateOnScreenDisplay(n)}),n.layer.on("pm:markerdragend",()=>{this.isAreaTooBig(n.toGeoJSON())&&Ro("The area of the polygon is waaay to big. Draw something smaller, this wont be saved anyways.","danger",void 0,36e5)}),n.layer._layers[n.layer._leaflet_id-1].on("drag",()=>{n.updateBufferedLayer(),this.refreshEntity(n),this.UpdateOnScreenDisplay(null)}),n.layer.on("pm:vertexremoved",()=>{n.updateBufferedLayer(),this.refreshEntity(n),this.UpdateOnScreenDisplay(n)}),this._placementLayers.addLayer(n.layer),this._placementBufferLayers.addLayer(n.bufferLayer),this._map.getZoom()<19&&n.bufferLayer.setStyle({opacity:0}),s&&this.refreshEntity(n)}refreshEntity(n,s=!0){if(n==null)return;let a=n.nameMarker,l=n.nameMarker.getLatLng(),c=n.layer.getBounds().getCenter();(c.lat!=l.lat||c.lng!=l.lng)&&n.nameMarker.setLatLng(c),n.nameMarker._tooltip._content!=n.name&&n.nameMarker.setTooltipContent(n.name);var g=this._map.getZoom();g>=19?this._nameTooltips[n.id]._tooltip.setOpacity(1):this._nameTooltips[n.id]._tooltip.setOpacity(0),s&&n.checkAllRules(),n.setLayerStyle(this._currentLayerFilterStyle)}refreshAllEntities(n=!0){for(let s in this._currentRevisions)this.refreshEntity(this._currentRevisions[s],n)}refreshEntitiesSlow(n=null){if(Ro("Validating..."),n)this._validateEntitiesQueue=n;else for(let s in this._currentRevisions)this._validateEntitiesQueue.push(this._currentRevisions[s]);this.validateSlowly()}validateSlowly(){let n=0;for(;this._validateEntitiesQueue.length>0&&n<50;){let s=this._validateEntitiesQueue.pop();n=n+1,this.refreshEntity(s,!0)}this._validateEntitiesQueue.length==0?Ro("Validation done","success"):setTimeout(()=>{this.validateSlowly()},50)}setLayerFilter(n,s=!0){this._currentLayerFilterStyle=n,this.refreshAllEntities(s)}isAreaTooBig(n){return cs(n)>5e3}deleteAndRemoveEntity(n,s=null){this._selected=null,this.setMode("none"),this.removeEntity(n),this._repository.deleteEntity(n,s)}removeEntityNameTooltip(n){n.nameMarker.unbindTooltip(),this._groups.names.removeLayer(n.nameMarker),n.nameMarker=null,delete this._nameTooltips[n.id]}removeEntityFromLayers(n){this._placementLayers.removeLayer(n.layer),this._placementBufferLayers.removeLayer(n.bufferLayer),this._map.removeLayer(n.layer),this._map.removeLayer(n.bufferLayer)}removeEntity(n,s=!0){this.removeEntityNameTooltip(n),this.removeEntityFromLayers(n),delete this._currentRevisions[n.id],s&&this._repository.remove(n)}addToggleEditButton(){if(!0){let n=Ir.Control.extend({options:{position:"bottomleft"},onAdd:()=>{let s=Ir.DomUtil.create("button","btn btn-gradient1 button-shake-animate");return s.title="Edit",s.textContent="Edit",Ir.DomEvent.disableClickPropagation(s),s.onclick=()=>{this.toggleEditMode(),s.textContent=this._isEditMode?"Done":"Edit",s.title=this._isEditMode?"Done":"Edit"},s}});this._map.addControl(new n)}if(void 0){let n=Ir.Control.extend({options:{position:"bottomleft"},onAdd:()=>{var s=Ir.DomUtil.create("p","btn btn-gradient1 button-shake-animate");return s.innerHTML+=void 0,s}});this._map.addControl(new n)}}formatDate(n,s="short",a="short"){return new Date(Date.parse(n)).toLocaleString("sv",{dateStyle:s,timeStyle:a})}getEntityDifferences(n,s){let a=[];if(s==null)return a.push({what:"Created",changeShort:"Created",changeLong:"Someone created this entity."}),a;n.isDeleted!=s.isDeleted&&a.push({what:"Deleted",changeShort:"Is Deleted",changeLong:`Is Deleted due to ${n.deleteReason}.`}),n.name!=s.name&&a.push({what:"Name",changeShort:"Name Changed",changeLong:`Someone changed the name from ${s.name} to ${n.name}.`}),n.description!=s.description&&a.push({what:"Description",changeShort:"Description Changed",changeLong:`Someone changed the description from ${s.description} to ${n.description}.`}),n.contactInfo!=s.contactInfo&&a.push({what:"Contact Info",changeShort:"Contact Info Changed",changeLong:`Someone changed the contact info from ${s.contactInfo} to ${n.contactInfo}.`}),n.nrOfPeople!=s.nrOfPeople&&a.push({what:"NrOfPeople",changeShort:"NrOfPeople Changed",changeLong:`Someone changed the number of people from ${s.nrOfPeople} to ${n.nrOfPeople}.`}),n.nrOfVehicles!=s.nrOfVehicles&&a.push({what:"NrOfVehicles",changeShort:"NrOfVehicles Changed",changeLong:`Someone changed the number of vehicles from ${s.nrOfVehicles} to ${n.nrOfVehicles}.`}),n.additionalSqm!=s.additionalSqm&&a.push({what:"AdditionalSqm",changeShort:"AdditionalSqm Changed",changeLong:`Someone changed additional Sqm from ${s.additionalSqm} to ${n.additionalSqm}.`}),n.powerNeed!=s.powerNeed&&a.push({what:"PowerNeed",changeShort:"PowerNeed Changed",changeLong:`Someone changed power need from ${s.powerNeed} to ${n.powerNeed}.`}),n.amplifiedSound!=s.amplifiedSound&&a.push({what:"AmplifiedSound",changeShort:"AmplifiedSound Changed",changeLong:`Someone changed amplified sound from ${s.amplifiedSound} to ${n.amplifiedSound}.`}),n.color!=s.color&&a.push({what:"Color",changeShort:"Color Changed",changeLong:`Someone changed color from ${s.color} to ${n.color}.`}),n.supressWarnings!=s.supressWarnings&&a.push({what:"SupressWarnings",changeShort:"SupressWarnings Changed",changeLong:`Someone changed supress warnings from ${s.supressWarnings} to ${n.supressWarnings}.`});let l=JSON.stringify(n.toGeoJSON().geometry),c=JSON.stringify(s.toGeoJSON().geometry);return l!=c&&a.push({what:"GeoJson",changeShort:"Polygon Changed",changeLong:"Someone changed the polygon."}),a.length==0&&a.push({what:"NoDifference",changeShort:"No difference",changeLong:"No difference detected between revisions."}),a}async toggleEditMode(){if(!!0){this._isEditMode=!1;return}this._isEditMode=!this._isEditMode,this._isEditMode&&localStorage.getItem("hasSeenEditorInstructions")==null&&Df([{file:"entering_edit_mode",position:"bottom"},{file:"entering_edit_mode_page_two",position:"bottom",onClose:()=>{localStorage.setItem("hasSeenEditorInstructions","true")}}]),this.setPopup("info",this._selected),this._isEditMode==!1&&this._mode!="selected"&&this.setMode("none"),this._map.pm.addControls({drawPolygon:this._isEditMode}),this._map.pm.Toolbar.changeActionsOfControl("Polygon",["cancel"])}async addAPIEntities(){Ro("Loading your drawn polygons from da interweb!");let n=await this._repository.entities();this._lastEnityFetch=new Date().getTime()/1e3;for(let s of n)this.addEntityToMap(s,!1);this.refreshAllEntities(!1),setTimeout(()=>{this.refreshEntitiesSlow()},100),this.addToggleEditButton()}async checkForUpdatedEntities(){if(this._isEditMode==!1){var n=new Date().getTime()/1e3;if(n-this._lastEnityFetch>this._autoRefreshIntervall){this._lastEnityFetch=n;let s=await this._repository.reload(),a=new Array,l=new Array;for(let c of s.refreshedAdded){let g=this._repository.getEntityById(c);l.push(`Add new entity ${g.id} ${g.name}`),this.addEntityToMap(g,!1),a.push(g)}for(let c of s.refreshedDeleted){let g=this._currentRevisions[c];l.push(`Removed entity ${g.id} ${g.name}`),this.removeEntity(g)}for(let c of s.refreshedUpdated){let g=this._repository.getEntityById(c);l.push(`Updated entity ${g.id} ${g.name}`),this.removeEntity(this._currentRevisions[c],!1),this.addEntityToMap(g,!1),a.push(g)}l.length>0&&(console.log("Fetched latest changes from map",new Date().toISOString(),l),this.refreshAllEntities(!1)),a.length>0&&this.refreshEntitiesSlow(a)}}setTimeout(()=>{this.checkForUpdatedEntities()},1e4)}gotoEntity(n){let s=this._repository.getEntityById(n);if(s){let a=s.layer.getBounds().getCenter();this._map.setView(a,19),this._popup.setLatLng(a),this.onLayerClicked(s)}}UpdateOnScreenDisplay(n,s=null){if(n||s){let a="";if(s)a=s;else{a=n.area+"m\xB2";for(let l of n.getAllTriggeredRules())l.severity>=2&&(a+="
"+l.shortMessage)}this.sqmTooltip.openOn(this._map),this.sqmTooltip.setLatLng(n.layer.getBounds().getCenter()),this.sqmTooltip.setContent(a)}else this.sqmTooltip.close()}};var r_=async()=>{let r=new Set(["Placement","Placement_map","POI"]),n=jr.default.map("map",{zoomControl:!1,maxZoom:21,drawControl:!0,attributionControl:!1}).setView([57.6226,14.9276],16);n.groups={placement:new jr.default.LayerGroup,mapstuff:new jr.default.LayerGroup,neighbourhoods:new jr.default.LayerGroup,quarters:new jr.default.LayerGroup,plazas:new jr.default.LayerGroup,poi:new jr.default.LayerGroup,soundspots:new jr.default.LayerGroup},n.groups.googleSatellite=jr.default.tileLayer("https://{s}.google.com/vt/lyrs=s&x={x}&y={y}&z={z}",{maxZoom:21,maxNativeZoom:20,subdomains:["mt0","mt1","mt2","mt3"]}).addTo(n),fetch("./data/analysis/contours.geojson").then(x=>x.json()).then(x=>{jr.default.geoJSON(x.features,{style:{color:"#ffffff",weight:1,opacity:.5}}).addTo(n.groups.mapstuff)}),await pa(n,"type","./data/bl24/placement_areas.geojson"),await pa(n,"type","./data/bl24/borders.geojson"),await pa(n,"type","./data/bl24/roads_and_distances.geojson"),await pa(n,"type","./data/bl24/plazas.geojson"),await pa(n,"type","./data/bl24/neighbourhoods.geojson"),n.groups.propertyborder.addTo(n.groups.mapstuff),n.removeLayer(n.groups.propertyborder),n.groups.minorroad.addTo(n.groups.mapstuff),n.removeLayer(n.groups.minorroad),n.groups.fireroad.addTo(n.groups.mapstuff),n.removeLayer(n.groups.fireroad),n.groups.area.addTo(n.groups.mapstuff),n.removeLayer(n.groups.area),n.groups.hiddenforbidden.addTo(n.groups.mapstuff),n.groups.container.addTo(n.groups.mapstuff),n.removeLayer(n.groups.container),n.groups.parking.addTo(n.groups.mapstuff),n.removeLayer(n.groups.parking),n.groups.toilet.addTo(n.groups.mapstuff),n.removeLayer(n.groups.toilet),n.groups.bridge.addTo(n.groups.mapstuff),n.removeLayer(n.groups.bridge),n.groups.names=new jr.default.LayerGroup,n.groups.names.addTo(n),n.groups.soundguide=new jr.default.LayerGroup,n.groups.bluesoundzone.addTo(n.groups.soundguide),n.removeLayer(n.groups.bluesoundzone),n.groups.greensoundzone.addTo(n.groups.soundguide),n.removeLayer(n.groups.greensoundzone),n.groups.yellowsoundzone.addTo(n.groups.soundguide),n.removeLayer(n.groups.yellowsoundzone),n.groups.orangesoundzone.addTo(n.groups.soundguide),n.removeLayer(n.groups.orangesoundzone),n.groups.redsoundzone.addTo(n.groups.soundguide),n.on("overlayadd",function(x){n.groups.names.setZIndex(101),x.name==="Soundguide"&&(n.groups.bluesoundzone.bringToBack(),n.groups.greensoundzone.bringToBack(),n.groups.yellowsoundzone.bringToBack(),n.groups.orangesoundzone.bringToBack(),n.groups.redsoundzone.bringToBack())}),n.groups.terrain=await Af(n,"./data/terrain.png",[[57.615642290070426,14.915097173672454],[57.62912303949617,14.936217846229036]]),n.groups.heightmap=jr.default.tileLayer("./data/analysis/height/{z}/{x}/{y}.jpg",{minZoom:13,maxZoom:21,minNativeZoom:16,maxNativeZoom:17,tms:!1}),n.groups.slopemap=jr.default.tileLayer("./data/analysis/slope/{z}/{x}/{y}.png",{minZoom:13,maxZoom:21,minNativeZoom:16,maxNativeZoom:17,tms:!1}),n.groups.aftermath=jr.default.tileLayer("./data/bl23/aftermath/{z}/{x}/{y}.png",{minZoom:0,maxZoom:21,minNativeZoom:0,maxNativeZoom:20,tms:!1}),n.groups.aftermath22=jr.default.tileLayer("./data/bl22/aftermath/{z}/{x}/{y}.png",{minZoom:0,maxZoom:21,minNativeZoom:0,maxNativeZoom:20,tms:!1}),n.groups.plaza.addTo(n.groups.plazas),n.removeLayer(n.groups.plaza),n.groups.neighbourhood.addTo(n.groups.neighbourhoods),n.removeLayer(n.groups.neighbourhood);var s={Placement_map:n.groups.mapstuff,POI:n.groups.poi,Soundguide:n.groups.soundguide,Slope:n.groups.slopemap,Height:n.groups.heightmap,Terrain:n.groups.terrain,Plazas:n.groups.plazas,Placement:n.groups.placement,Names:n.groups.names,Neighbourhoods:n.groups.neighbourhoods,Quarters:n.groups.quarters,Aftermath22:n.groups.aftermath22,Aftermath23:n.groups.aftermath};let a=new Bu(n,n.groups),l=jr.default.Control.extend({options:{position:"topleft"},onAdd:()=>{let x=jr.default.DomUtil.create("button","leaflet-bar help-button");return x.title="Guide to the placement process",x.textContent="\u26D1\uFE0F",jr.default.DomEvent.disableClickPropagation(x),x.onclick=()=>{ss({file:"guide-home",position:"end",onClose:()=>{localStorage.setItem("hasSeenPlacementWelcome","true")}})},x}});n.addControl(new l),jr.default.control.polylineMeasure({measureControlLabel:"📏",arrow:{color:"#0000"}}).addTo(n);let g=new jr.default.Control.Coordinates({position:"topright",latitudeText:"lat",longitudeText:"lng",promptText:"Current Coordinaes:",precision:10});g.addTo(n),console.log(g),n.on("hashmetainit",function(x){as.decode(x.meta),as.layers.filter(P=>P in s).forEach(P=>r.add(P)),r.forEach(P=>n.addLayer(s[P]))}),n.on("overlayadd",function(x){r.add(x.name),as.layers=r}),n.on("overlayremove",function(x){r.delete(x.name),as.layers=r}),as.map=n,as.layers=r,n.on("click",function(x){console.log(x.latlng),g.setCoordinates(x)}),await uh("poi.json",n.groups.poi),await uh("soundspots.json",n.groups.soundspots),n.groups.soundspots.addTo(n.groups.soundguide),n.removeLayer(n.groups.soundspots),kf(n.groups.quarters),Tf(n.groups.plazas),If(n.groups.neighbourhoods),await Of(n,s,r),await a.addAPIEntities(),n.groups.placement.addTo(n);let v=new URLSearchParams(window.location.search).get("id");v&&a.gotoEntity(v),Ro("Loaded everything!","success")};async function Qx(){try{await r_()}catch(r){console.error(r)}localStorage.getItem("hasSeenPlacementWelcome")||ss({file:"welcome",position:"bottom",onClose:()=>{localStorage.setItem("hasSeenPlacementWelcome","true")}})}Qx();})(); /*! Bundled license information: leaflet/dist/leaflet-src.js: diff --git a/index.css b/index.css index b798036..40356d5 100644 --- a/index.css +++ b/index.css @@ -451,3 +451,20 @@ body, font-family: 'bradleyHand'; src: url('fonts/bradley.woff') format('woff'); } + +/* Lat Lng Ctrl */ +.leaflet-control-coordinates { + background: white; + border-radius: 4px; + box-shadow: 0 1px 5px rgba(0, 0, 0, 0.65); + cursor: pointer; + padding: 2px 5px; +} + +.leaflet-control-coordinates.hidden { + display: none; +} + +.leaflet-control-coordinates-lng { + padding-left: 5px; +}