(()=>{var Xs=Object.create;var ci=Object.defineProperty,Ys=Object.defineProperties,Qs=Object.getOwnPropertyDescriptor,el=Object.getOwnPropertyDescriptors,tl=Object.getOwnPropertyNames,li=Object.getOwnPropertySymbols,nl=Object.getPrototypeOf,ir=Object.prototype.hasOwnProperty,ca=Object.prototype.propertyIsEnumerable;var la=(t,i,s)=>i in t?ci(t,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[i]=s,Ct=(t,i)=>{for(var s in i||(i={}))ir.call(i,s)&&la(t,s,i[s]);if(li)for(var s of li(i))ca.call(i,s)&&la(t,s,i[s]);return t},da=(t,i)=>Ys(t,el(i));var fa=(t,i)=>{var s={};for(var a in t)ir.call(t,a)&&i.indexOf(a)<0&&(s[a]=t[a]);if(t!=null&&li)for(var a of li(t))i.indexOf(a)<0&&ca.call(t,a)&&(s[a]=t[a]);return s};var ol=(t,i)=>()=>(t&&(i=t(t=0)),i);var ma=(t,i)=>()=>(i||t((i={exports:{}}).exports,i),i.exports),ua=(t,i)=>{for(var s in i)ci(t,s,{get:i[s],enumerable:!0})},il=(t,i,s,a)=>{if(i&&typeof i=="object"||typeof i=="function")for(let c of tl(i))!ir.call(t,c)&&c!==s&&ci(t,c,{get:()=>i[c],enumerable:!(a=Qs(i,c))||a.enumerable});return t};var rr=(t,i,s)=>(s=t!=null?Xs(nl(t)):{},il(i||!t||!t.__esModule?ci(s,"default",{value:t,enumerable:!0}):s,t));var Cr=ma((Ai,Qa)=>{(function(t,i){typeof Ai=="object"&&typeof Qa!="undefined"?i(Ai):typeof define=="function"&&define.amd?define(["exports"],i):(t=typeof globalThis!="undefined"?globalThis:t||self,i(t.leaflet={}))})(Ai,function(t){"use strict";var i="1.9.4";function s(e){var o,l,u,g;for(l=1,u=arguments.length;l0?Math.floor(e):Math.ceil(e)};me.prototype={clone:function(){return new me(this.x,this.y)},add:function(e){return this.clone()._add(te(e))},_add:function(e){return this.x+=e.x,this.y+=e.y,this},subtract:function(e){return this.clone()._subtract(te(e))},_subtract:function(e){return this.x-=e.x,this.y-=e.y,this},divideBy:function(e){return this.clone()._divideBy(e)},_divideBy:function(e){return this.x/=e,this.y/=e,this},multiplyBy:function(e){return this.clone()._multiplyBy(e)},_multiplyBy:function(e){return this.x*=e,this.y*=e,this},scaleBy:function(e){return new me(this.x*e.x,this.y*e.y)},unscaleBy:function(e){return new me(this.x/e.x,this.y/e.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=ve(this.x),this.y=ve(this.y),this},distanceTo:function(e){e=te(e);var o=e.x-this.x,l=e.y-this.y;return Math.sqrt(o*o+l*l)},equals:function(e){return e=te(e),e.x===this.x&&e.y===this.y},contains:function(e){return e=te(e),Math.abs(e.x)<=Math.abs(this.x)&&Math.abs(e.y)<=Math.abs(this.y)},toString:function(){return"Point("+y(this.x)+", "+y(this.y)+")"}};function te(e,o,l){return e instanceof me?e:I(e)?new me(e[0],e[1]):e==null?e:typeof e=="object"&&"x"in e&&"y"in e?new me(e.x,e.y):new me(e,o,l)}function ge(e,o){if(e)for(var l=o?[e,o]:e,u=0,g=l.length;u=this.min.x&&l.x<=this.max.x&&o.y>=this.min.y&&l.y<=this.max.y},intersects:function(e){e=ye(e);var o=this.min,l=this.max,u=e.min,g=e.max,k=g.x>=o.x&&u.x<=l.x,P=g.y>=o.y&&u.y<=l.y;return k&&P},overlaps:function(e){e=ye(e);var o=this.min,l=this.max,u=e.min,g=e.max,k=g.x>o.x&&u.xo.y&&u.y=o.lat&&g.lat<=l.lat&&u.lng>=o.lng&&g.lng<=l.lng},intersects:function(e){e=we(e);var o=this._southWest,l=this._northEast,u=e.getSouthWest(),g=e.getNorthEast(),k=g.lat>=o.lat&&u.lat<=l.lat,P=g.lng>=o.lng&&u.lng<=l.lng;return k&&P},overlaps:function(e){e=we(e);var o=this._southWest,l=this._northEast,u=e.getSouthWest(),g=e.getNorthEast(),k=g.lat>o.lat&&u.lato.lng&&u.lng1,tn=function(){var e=!1;try{var o=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("testPassiveEventSupport",v,o),window.removeEventListener("testPassiveEventSupport",v,o)}catch(l){}return e}(),ft=function(){return!!document.createElement("canvas").getContext}(),Ye=!!(document.createElementNS&&Cn("svg").createSVGRect),Zt=!!Ye&&function(){var e=document.createElement("div");return e.innerHTML="",(e.firstChild&&e.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),No=!Ye&&function(){try{var e=document.createElement("div");e.innerHTML='';var o=e.firstChild;return o.style.behavior="url(#default#VML)",o&&typeof o.adj=="object"}catch(l){return!1}}(),co=navigator.platform.indexOf("Mac")===0,An=navigator.platform.indexOf("Linux")===0;function Pt(e){return navigator.userAgent.toLowerCase().indexOf(e)>=0}var ke={ie:qt,ielt9:lo,edge:En,webkit:M,android:_,android23:w,androidStock:S,opera:j,chrome:oe,gecko:ie,safari:fe,phantom:xe,opera12:De,win:Re,ie3d:Te,webkit3d:Ne,gecko3d:Se,any3d:qe,mobile:Ze,mobileWebkit:ot,mobileWebkit3d:dt,msPointer:rt,pointer:at,touch:Mt,touchNative:Dt,mobileOpera:mt,mobileGecko:xt,retina:jt,passiveEvents:tn,canvas:ft,svg:Ye,vml:No,inlineSvg:Zt,mac:co,linux:An},Gn=ke.msPointer?"MSPointerDown":"pointerdown",Hn=ke.msPointer?"MSPointerMove":"pointermove",fo=ke.msPointer?"MSPointerUp":"pointerup",Vt=ke.msPointer?"MSPointerCancel":"pointercancel",Nt={touchstart:Gn,touchmove:Hn,touchend:fo,touchcancel:Vt},Uo={touchstart:ho,touchmove:Bn,touchend:Bn,touchcancel:Bn},$t={},pn=!1;function Hi(e,o,l){return o==="touchstart"&&uo(),Uo[o]?(l=Uo[o].bind(this,l),e.addEventListener(Nt[o],l,!1),l):(console.warn("wrong event specified:",o),v)}function Go(e,o,l){if(!Nt[o]){console.warn("wrong event specified:",o);return}e.removeEventListener(Nt[o],l,!1)}function Ho(e){$t[e.pointerId]=e}function qi(e){$t[e.pointerId]&&($t[e.pointerId]=e)}function mo(e){delete $t[e.pointerId]}function uo(){pn||(document.addEventListener(Gn,Ho,!0),document.addEventListener(Hn,qi,!0),document.addEventListener(fo,mo,!0),document.addEventListener(Vt,mo,!0),pn=!0)}function Bn(e,o){if(o.pointerType!==(o.MSPOINTER_TYPE_MOUSE||"mouse")){o.touches=[];for(var l in $t)o.touches.push($t[l]);o.changedTouches=[o],e(o)}}function ho(e,o){o.MSPOINTER_TYPE_TOUCH&&o.pointerType===o.MSPOINTER_TYPE_TOUCH&&B(o),Bn(e,o)}function Zi(e){var o={},l,u;for(u in e)l=e[u],o[u]=l&&l.bind?l.bind(e):l;return e=o,o.type="dblclick",o.detail=2,o.isTrusted=!1,o._simulated=!0,o}var qn=200;function qo(e,o){e.addEventListener("dblclick",o);var l=0,u;function g(k){if(k.detail!==1){u=k.detail;return}if(!(k.pointerType==="mouse"||k.sourceCapabilities&&!k.sourceCapabilities.firesTouchEvents)){var P=T(k);if(!(P.some(function(X){return X instanceof HTMLLabelElement&&X.attributes.for})&&!P.some(function(X){return X instanceof HTMLInputElement||X instanceof HTMLSelectElement}))){var W=Date.now();W-l<=qn?(u++,u===2&&o(Zi(k))):u=1,l=W}}}return e.addEventListener("click",g),{dblclick:o,simDblclick:g}}function Vi(e,o){e.removeEventListener("dblclick",o.dblclick),e.removeEventListener("click",o.simDblclick)}var nn=Kn(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),Dn=Kn(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),bo=Dn==="webkitTransition"||Dn==="OTransition"?Dn+"End":"transitionend";function Zn(e){return typeof e=="string"?document.getElementById(e):e}function Mn(e,o){var l=e.style[o]||e.currentStyle&&e.currentStyle[o];if((!l||l==="auto")&&document.defaultView){var u=document.defaultView.getComputedStyle(e,null);l=u?u[o]:null}return l==="auto"?null:l}function ze(e,o,l){var u=document.createElement(e);return u.className=o||"",l&&l.appendChild(u),u}function Ve(e){var o=e.parentNode;o&&o.removeChild(e)}function on(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function Ut(e){var o=e.parentNode;o&&o.lastChild!==e&&o.appendChild(e)}function rn(e){var o=e.parentNode;o&&o.firstChild!==e&&o.insertBefore(e,o.firstChild)}function Vn(e,o){if(e.classList!==void 0)return e.classList.contains(o);var l=$n(e);return l.length>0&&new RegExp("(^|\\s)"+o+"(\\s|$)").test(l)}function Pe(e,o){if(e.classList!==void 0)for(var l=G(o),u=0,g=l.length;u0?2*window.devicePixelRatio:1;function Q(e){return ke.edge?e.wheelDeltaY/2:e.deltaY&&e.deltaMode===0?-e.deltaY/ne:e.deltaY&&e.deltaMode===1?-e.deltaY*20:e.deltaY&&e.deltaMode===2?-e.deltaY*60:e.deltaX||e.deltaZ?0:e.wheelDelta?(e.wheelDeltaY||e.wheelDelta)/2:e.detail&&Math.abs(e.detail)<32765?-e.detail*20:e.detail?e.detail/-32765*60:0}function se(e,o){var l=o.relatedTarget;if(!l)return!0;try{for(;l&&l!==e;)l=l.parentNode}catch(u){return!1}return l!==e}var he={__proto__:null,on:Me,off:He,stopPropagation:F,disableScrollPropagation:x,disableClickPropagation:A,preventDefault:B,stop:D,getPropagationPath:T,getMousePosition:K,getWheelDelta:Q,isExternalTarget:se,addListener:Me,removeListener:He},Le=_e.extend({run:function(e,o,l,u){this.stop(),this._el=e,this._inProgress=!0,this._duration=l||.25,this._easeOutPower=1/Math.max(u||.5,.2),this._startPos=Kt(e),this._offset=o.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=U(this._animate,this),this._step()},_step:function(e){var o=+new Date-this._startTime,l=this._duration*1e3;othis.options.maxZoom)?this.setZoom(e):this},panInsideBounds:function(e,o){this._enforcingBounds=!0;var l=this.getCenter(),u=this._limitCenter(l,this._zoom,we(e));return l.equals(u)||this.panTo(u,o),this._enforcingBounds=!1,this},panInside:function(e,o){o=o||{};var l=te(o.paddingTopLeft||o.padding||[0,0]),u=te(o.paddingBottomRight||o.padding||[0,0]),g=this.project(this.getCenter()),k=this.project(e),P=this.getPixelBounds(),W=ye([P.min.add(l),P.max.subtract(u)]),X=W.getSize();if(!W.contains(k)){this._enforcingBounds=!0;var ae=k.subtract(W.getCenter()),Fe=W.extend(k).getSize().subtract(X);g.x+=ae.x<0?-Fe.x:Fe.x,g.y+=ae.y<0?-Fe.y:Fe.y,this.panTo(this.unproject(g),o),this._enforcingBounds=!1}return this},invalidateSize:function(e){if(!this._loaded)return this;e=s({animate:!1,pan:!0},e===!0?{animate:!0}:e);var o=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var l=this.getSize(),u=o.divideBy(2).round(),g=l.divideBy(2).round(),k=u.subtract(g);return!k.x&&!k.y?this:(e.animate&&e.pan?this.panBy(k):(e.pan&&this._rawPanBy(k),this.fire("move"),e.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(c(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:o,newSize:l}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(e){if(e=this._locateOptions=s({timeout:1e4,watch:!1},e),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var o=c(this._handleGeolocationResponse,this),l=c(this._handleGeolocationError,this);return e.watch?this._locationWatchId=navigator.geolocation.watchPosition(o,l,e):navigator.geolocation.getCurrentPosition(o,l,e),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(e){if(this._container._leaflet_id){var o=e.code,l=e.message||(o===1?"permission denied":o===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:o,message:"Geolocation error: "+l+"."})}},_handleGeolocationResponse:function(e){if(this._container._leaflet_id){var o=e.coords.latitude,l=e.coords.longitude,u=new Be(o,l),g=u.toBounds(e.coords.accuracy*2),k=this._locateOptions;if(k.setView){var P=this.getBoundsZoom(g);this.setView(u,k.maxZoom?Math.min(P,k.maxZoom):P)}var W={latlng:u,bounds:g,timestamp:e.timestamp};for(var X in e.coords)typeof e.coords[X]=="number"&&(W[X]=e.coords[X]);this.fire("locationfound",W)}},addHandler:function(e,o){if(!o)return this;var l=this[e]=new o(this);return this._handlers.push(l),this.options[e]&&l.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(o){this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),Ve(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(ee(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var e;for(e in this._layers)this._layers[e].remove();for(e in this._panes)Ve(this._panes[e]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(e,o){var l="leaflet-pane"+(e?" leaflet-"+e.replace("Pane","")+"-pane":""),u=ze("div",l,o||this._mapPane);return e&&(this._panes[e]=u),u},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var e=this.getPixelBounds(),o=this.unproject(e.getBottomLeft()),l=this.unproject(e.getTopRight());return new ue(o,l)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(e,o,l){e=we(e),l=te(l||[0,0]);var u=this.getZoom()||0,g=this.getMinZoom(),k=this.getMaxZoom(),P=e.getNorthWest(),W=e.getSouthEast(),X=this.getSize().subtract(l),ae=ye(this.project(W,u),this.project(P,u)).getSize(),Fe=ke.any3d?this.options.zoomSnap:1,Ee=X.x/ae.x,Oe=X.y/ae.y,ut=o?Math.max(Ee,Oe):Math.min(Ee,Oe);return u=this.getScaleZoom(ut,u),Fe&&(u=Math.round(u/(Fe/100))*(Fe/100),u=o?Math.ceil(u/Fe)*Fe:Math.floor(u/Fe)*Fe),Math.max(g,Math.min(k,u))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new me(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(e,o){var l=this._getTopLeftPoint(e,o);return new ge(l,l.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(e){return this.options.crs.getProjectedBounds(e===void 0?this.getZoom():e)},getPane:function(e){return typeof e=="string"?this._panes[e]:e},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(e,o){var l=this.options.crs;return o=o===void 0?this._zoom:o,l.scale(e)/l.scale(o)},getScaleZoom:function(e,o){var l=this.options.crs;o=o===void 0?this._zoom:o;var u=l.zoom(e*l.scale(o));return isNaN(u)?1/0:u},project:function(e,o){return o=o===void 0?this._zoom:o,this.options.crs.latLngToPoint(Ae(e),o)},unproject:function(e,o){return o=o===void 0?this._zoom:o,this.options.crs.pointToLatLng(te(e),o)},layerPointToLatLng:function(e){var o=te(e).add(this.getPixelOrigin());return this.unproject(o)},latLngToLayerPoint:function(e){var o=this.project(Ae(e))._round();return o._subtract(this.getPixelOrigin())},wrapLatLng:function(e){return this.options.crs.wrapLatLng(Ae(e))},wrapLatLngBounds:function(e){return this.options.crs.wrapLatLngBounds(we(e))},distance:function(e,o){return this.options.crs.distance(Ae(e),Ae(o))},containerPointToLayerPoint:function(e){return te(e).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(e){return te(e).add(this._getMapPanePos())},containerPointToLatLng:function(e){var o=this.containerPointToLayerPoint(te(e));return this.layerPointToLatLng(o)},latLngToContainerPoint:function(e){return this.layerPointToContainerPoint(this.latLngToLayerPoint(Ae(e)))},mouseEventToContainerPoint:function(e){return K(e,this._container)},mouseEventToLayerPoint:function(e){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(e))},mouseEventToLatLng:function(e){return this.layerPointToLatLng(this.mouseEventToLayerPoint(e))},_initContainer:function(e){var o=this._container=Zn(e);if(o){if(o._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");Me(o,"scroll",this._onScroll,this),this._containerId=m(o)},_initLayout:function(){var e=this._container;this._fadeAnimated=this.options.fadeAnimation&&ke.any3d,Pe(e,"leaflet-container"+(ke.touch?" leaflet-touch":"")+(ke.retina?" leaflet-retina":"")+(ke.ielt9?" leaflet-oldie":"")+(ke.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var o=Mn(e,"position");o!=="absolute"&&o!=="relative"&&o!=="fixed"&&o!=="sticky"&&(e.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var e=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Je(this._mapPane,new me(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(Pe(e.markerPane,"leaflet-zoom-hide"),Pe(e.shadowPane,"leaflet-zoom-hide"))},_resetView:function(e,o,l){Je(this._mapPane,new me(0,0));var u=!this._loaded;this._loaded=!0,o=this._limitZoom(o),this.fire("viewprereset");var g=this._zoom!==o;this._moveStart(g,l)._move(e,o)._moveEnd(g),this.fire("viewreset"),u&&this.fire("load")},_moveStart:function(e,o){return e&&this.fire("zoomstart"),o||this.fire("movestart"),this},_move:function(e,o,l,u){o===void 0&&(o=this._zoom);var g=this._zoom!==o;return this._zoom=o,this._lastCenter=e,this._pixelOrigin=this._getNewPixelOrigin(e),u?l&&l.pinch&&this.fire("zoom",l):((g||l&&l.pinch)&&this.fire("zoom",l),this.fire("move",l)),this},_moveEnd:function(e){return e&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return ee(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(e){Je(this._mapPane,this._getMapPanePos().subtract(e))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(e){this._targets={},this._targets[m(this._container)]=this;var o=e?He:Me;o(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&o(window,"resize",this._onResize,this),ke.any3d&&this.options.transform3DLimit&&(e?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){ee(this._resizeRequest),this._resizeRequest=U(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var e=this._getMapPanePos();Math.max(Math.abs(e.x),Math.abs(e.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(e,o){for(var l=[],u,g=o==="mouseout"||o==="mouseover",k=e.target||e.srcElement,P=!1;k;){if(u=this._targets[m(k)],u&&(o==="click"||o==="preclick")&&this._draggableMoved(u)){P=!0;break}if(u&&u.listens(o,!0)&&(g&&!se(k,e)||(l.push(u),g))||k===this._container)break;k=k.parentNode}return!l.length&&!P&&!g&&this.listens(o,!0)&&(l=[this]),l},_isClickDisabled:function(e){for(;e&&e!==this._container;){if(e._leaflet_disable_click)return!0;e=e.parentNode}},_handleDOMEvent:function(e){var o=e.target||e.srcElement;if(!(!this._loaded||o._leaflet_disable_events||e.type==="click"&&this._isClickDisabled(o))){var l=e.type;l==="mousedown"&&vo(o),this._fireDOMEvent(e,l)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(e,o,l){if(e.type==="click"){var u=s({},e);u.type="preclick",this._fireDOMEvent(u,u.type,l)}var g=this._findEventTargets(e,o);if(l){for(var k=[],P=0;P0?Math.round(e-o)/2:Math.max(0,Math.ceil(e))-Math.max(0,Math.floor(o))},_limitZoom:function(e){var o=this.getMinZoom(),l=this.getMaxZoom(),u=ke.any3d?this.options.zoomSnap:1;return u&&(e=Math.round(e/u)*u),Math.max(o,Math.min(l,e))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){$e(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(e,o){var l=this._getCenterOffset(e)._trunc();return(o&&o.animate)!==!0&&!this.getSize().contains(l)?!1:(this.panBy(l,o),!0)},_createAnimProxy:function(){var e=this._proxy=ze("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(e),this.on("zoomanim",function(o){var l=nn,u=this._proxy.style[l];Gt(this._proxy,this.project(o.center,o.zoom),this.getZoomScale(o.zoom,1)),u===this._proxy.style[l]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){Ve(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var e=this.getCenter(),o=this.getZoom();Gt(this._proxy,this.project(e,o),this.getZoomScale(o,1))},_catchTransitionEnd:function(e){this._animatingZoom&&e.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(e,o,l){if(this._animatingZoom)return!0;if(l=l||{},!this._zoomAnimated||l.animate===!1||this._nothingToAnimate()||Math.abs(o-this._zoom)>this.options.zoomAnimationThreshold)return!1;var u=this.getZoomScale(o),g=this._getCenterOffset(e)._divideBy(1-1/u);return l.animate!==!0&&!this.getSize().contains(g)?!1:(U(function(){this._moveStart(!0,l.noMoveStart||!1)._animateZoom(e,o,!0)},this),!0)},_animateZoom:function(e,o,l,u){this._mapPane&&(l&&(this._animatingZoom=!0,this._animateToCenter=e,this._animateToZoom=o,Pe(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:e,zoom:o,noUpdate:u}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(c(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&$e(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 Ue(e,o){return new be(e,o)}var je=de.extend({options:{position:"topright"},initialize:function(e){$(this,e)},getPosition:function(){return this.options.position},setPosition:function(e){var o=this._map;return o&&o.removeControl(this),this.options.position=e,o&&o.addControl(this),this},getContainer:function(){return this._container},addTo:function(e){this.remove(),this._map=e;var o=this._container=this.onAdd(e),l=this.getPosition(),u=e._controlCorners[l];return Pe(o,"leaflet-control"),l.indexOf("bottom")!==-1?u.insertBefore(o,u.firstChild):u.appendChild(o),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(Ve(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(e){this._map&&e&&e.screenX>0&&e.screenY>0&&this._map.getContainer().focus()}}),Ie=function(e){return new je(e)};be.include({addControl:function(e){return e.addTo(this),this},removeControl:function(e){return e.remove(),this},_initControlPos:function(){var e=this._controlCorners={},o="leaflet-",l=this._controlContainer=ze("div",o+"control-container",this._container);function u(g,k){var P=o+g+" "+o+k;e[g+k]=ze("div",P,l)}u("top","left"),u("top","right"),u("bottom","left"),u("bottom","right")},_clearControlPos:function(){for(var e in this._controlCorners)Ve(this._controlCorners[e]);Ve(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var it=je.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(e,o,l,u){return l1,this._baseLayersList.style.display=e?"":"none"),this._separator.style.display=o&&e?"":"none",this},_onLayerChange:function(e){this._handlingClick||this._update();var o=this._getLayer(m(e.target)),l=o.overlay?e.type==="add"?"overlayadd":"overlayremove":e.type==="add"?"baselayerchange":null;l&&this._map.fire(l,o)},_createRadioElement:function(e,o){var l='",u=document.createElement("div");return u.innerHTML=l,u.firstChild},_addItem:function(e){var o=document.createElement("label"),l=this._map.hasLayer(e.layer),u;e.overlay?(u=document.createElement("input"),u.type="checkbox",u.className="leaflet-control-layers-selector",u.defaultChecked=l):u=this._createRadioElement("leaflet-base-layers_"+m(this),l),this._layerControlInputs.push(u),u.layerId=m(e.layer),Me(u,"click",this._onInputClick,this);var g=document.createElement("span");g.innerHTML=" "+e.name;var k=document.createElement("span");o.appendChild(k),k.appendChild(u),k.appendChild(g);var P=e.overlay?this._overlaysList:this._baseLayersList;return P.appendChild(o),this._checkDisabledLayers(),o},_onInputClick:function(){if(!this._preventClick){var e=this._layerControlInputs,o,l,u=[],g=[];this._handlingClick=!0;for(var k=e.length-1;k>=0;k--)o=e[k],l=this._getLayer(o.layerId).layer,o.checked?u.push(l):o.checked||g.push(l);for(k=0;k=0;g--)o=e[g],l=this._getLayer(o.layerId).layer,o.disabled=l.options.minZoom!==void 0&&ul.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var e=this._section;this._preventClick=!0,Me(e,"click",B),this.expand();var o=this;setTimeout(function(){He(e,"click",B),o._preventClick=!1})}}),Ft=function(e,o,l){return new it(e,o,l)},Ot=je.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(e){var o="leaflet-control-zoom",l=ze("div",o+" leaflet-bar"),u=this.options;return this._zoomInButton=this._createButton(u.zoomInText,u.zoomInTitle,o+"-in",l,this._zoomIn),this._zoomOutButton=this._createButton(u.zoomOutText,u.zoomOutTitle,o+"-out",l,this._zoomOut),this._updateDisabled(),e.on("zoomend zoomlevelschange",this._updateDisabled,this),l},onRemove:function(e){e.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(e){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(e.shiftKey?3:1))},_createButton:function(e,o,l,u,g){var k=ze("a",l,u);return k.innerHTML=e,k.href="#",k.title=o,k.setAttribute("role","button"),k.setAttribute("aria-label",o),A(k),Me(k,"click",D),Me(k,"click",g,this),Me(k,"click",this._refocusOnMap,this),k},_updateDisabled:function(){var e=this._map,o="leaflet-disabled";$e(this._zoomInButton,o),$e(this._zoomOutButton,o),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||e._zoom===e.getMinZoom())&&(Pe(this._zoomOutButton,o),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||e._zoom===e.getMaxZoom())&&(Pe(this._zoomInButton,o),this._zoomInButton.setAttribute("aria-disabled","true"))}});be.mergeOptions({zoomControl:!0}),be.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Ot,this.addControl(this.zoomControl))});var $o=function(e){return new Ot(e)},Wn=je.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(e){var o="leaflet-control-scale",l=ze("div",o),u=this.options;return this._addScales(u,o+"-line",l),e.on(u.updateWhenIdle?"moveend":"move",this._update,this),e.whenReady(this._update,this),l},onRemove:function(e){e.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(e,o,l){e.metric&&(this._mScale=ze("div",o,l)),e.imperial&&(this._iScale=ze("div",o,l))},_update:function(){var e=this._map,o=e.getSize().y/2,l=e.distance(e.containerPointToLatLng([0,o]),e.containerPointToLatLng([this.options.maxWidth,o]));this._updateScales(l)},_updateScales:function(e){this.options.metric&&e&&this._updateMetric(e),this.options.imperial&&e&&this._updateImperial(e)},_updateMetric:function(e){var o=this._getRoundNum(e),l=o<1e3?o+" m":o/1e3+" km";this._updateScale(this._mScale,l,o/e)},_updateImperial:function(e){var o=e*3.2808399,l,u,g;o>5280?(l=o/5280,u=this._getRoundNum(l),this._updateScale(this._iScale,u+" mi",u/l)):(g=this._getRoundNum(o),this._updateScale(this._iScale,g+" ft",g/o))},_updateScale:function(e,o,l){e.style.width=Math.round(this.options.maxWidth*l)+"px",e.innerHTML=o},_getRoundNum:function(e){var o=Math.pow(10,(Math.floor(e)+"").length-1),l=e/o;return l=l>=10?10:l>=5?5:l>=3?3:l>=2?2:1,o*l}}),an=function(e){return new Wn(e)},Ko='',Jn=je.extend({options:{position:"bottomright",prefix:''+(ke.inlineSvg?Ko+" ":"")+"Leaflet"},initialize:function(e){$(this,e),this._attributions={}},onAdd:function(e){e.attributionControl=this,this._container=ze("div","leaflet-control-attribution"),A(this._container);for(var o in e._layers)e._layers[o].getAttribution&&this.addAttribution(e._layers[o].getAttribution());return this._update(),e.on("layeradd",this._addAttribution,this),this._container},onRemove:function(e){e.off("layeradd",this._addAttribution,this)},_addAttribution:function(e){e.layer.getAttribution&&(this.addAttribution(e.layer.getAttribution()),e.layer.once("remove",function(){this.removeAttribution(e.layer.getAttribution())},this))},setPrefix:function(e){return this.options.prefix=e,this._update(),this},addAttribution:function(e){return e?(this._attributions[e]||(this._attributions[e]=0),this._attributions[e]++,this._update(),this):this},removeAttribution:function(e){return e?(this._attributions[e]&&(this._attributions[e]--,this._update()),this):this},_update:function(){if(this._map){var e=[];for(var o in this._attributions)this._attributions[o]&&e.push(o);var l=[];this.options.prefix&&l.push(this.options.prefix),e.length&&l.push(e.join(", ")),this._container.innerHTML=l.join(' ')}}});be.mergeOptions({attributionControl:!0}),be.addInitHook(function(){this.options.attributionControl&&new Jn().addTo(this)});var $i=function(e){return new Jn(e)};je.Layers=it,je.Zoom=Ot,je.Scale=Wn,je.Attribution=Jn,Ie.layers=Ft,Ie.zoom=$o,Ie.scale=an,Ie.attribution=$i;var vt=de.extend({initialize:function(e){this._map=e},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});vt.addTo=function(e,o){return e.addHandler(o,this),this};var Ki={Events:Ce},Wo=ke.touch?"touchstart mousedown":"mousedown",vn=_e.extend({options:{clickTolerance:3},initialize:function(e,o,l,u){$(this,u),this._element=e,this._dragStartTarget=o||e,this._preventOutline=l},enable:function(){this._enabled||(Me(this._dragStartTarget,Wo,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(vn._dragging===this&&this.finishDrag(!0),He(this._dragStartTarget,Wo,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(e){if(this._enabled&&(this._moved=!1,!Vn(this._element,"leaflet-zoom-anim"))){if(e.touches&&e.touches.length!==1){vn._dragging===this&&this.finishDrag();return}if(!(vn._dragging||e.shiftKey||e.which!==1&&e.button!==1&&!e.touches)&&(vn._dragging=this,this._preventOutline&&vo(this._element),Xe(),St(),!this._moving)){this.fire("down");var o=e.touches?e.touches[0]:e,l=Vo(this._element);this._startPoint=new me(o.clientX,o.clientY),this._startPos=Kt(this._element),this._parentScale=Tn(l);var u=e.type==="mousedown";Me(document,u?"mousemove":"touchmove",this._onMove,this),Me(document,u?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(e){if(this._enabled){if(e.touches&&e.touches.length>1){this._moved=!0;return}var o=e.touches&&e.touches.length===1?e.touches[0]:e,l=new me(o.clientX,o.clientY)._subtract(this._startPoint);!l.x&&!l.y||Math.abs(l.x)+Math.abs(l.y)k&&(P=W,k=X);k>l&&(o[P]=1,Ji(e,o,l,u,P),Ji(e,o,l,P,g))}function ps(e,o){for(var l=[e[0]],u=1,g=0,k=e.length;uo&&(l.push(e[u]),g=u);return go.max.x&&(l|=2),e.yo.max.y&&(l|=8),l}function gs(e,o){var l=o.x-e.x,u=o.y-e.y;return l*l+u*u}function yo(e,o,l,u){var g=o.x,k=o.y,P=l.x-g,W=l.y-k,X=P*P+W*W,ae;return X>0&&(ae=((e.x-g)*P+(e.y-k)*W)/X,ae>1?(g=l.x,k=l.y):ae>0&&(g+=P*ae,k+=W*ae)),P=e.x-g,W=e.y-k,u?P*P+W*W:new me(g,k)}function Rt(e){return!I(e[0])||typeof e[0][0]!="object"&&typeof e[0][0]!="undefined"}function zr(e){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Rt(e)}function Ir(e,o){var l,u,g,k,P,W,X,ae;if(!e||e.length===0)throw new Error("latlngs not passed");Rt(e)||(console.warn("latlngs are not flat! Only the first ring will be used"),e=e[0]);var Fe=Ae([0,0]),Ee=we(e),Oe=Ee.getNorthWest().distanceTo(Ee.getSouthWest())*Ee.getNorthEast().distanceTo(Ee.getNorthWest());Oe<1700&&(Fe=Wi(e));var ut=e.length,st=[];for(l=0;lu){X=(k-u)/g,ae=[W.x-X*(W.x-P.x),W.y-X*(W.y-P.y)];break}var _t=o.unproject(te(ae));return Ae([_t.lat+Fe.lat,_t.lng+Fe.lng])}var Fs={__proto__:null,simplify:Sr,pointToSegmentDistance:Tr,closestPointOnSegment:hs,clipSegment:Rr,_getEdgeIntersection:Jo,_getBitCode:On,_sqClosestPointOnSegment:yo,isFlat:Rt,_flat:zr,polylineCenter:Ir},Xi={project:function(e){return new me(e.lng,e.lat)},unproject:function(e){return new Be(e.y,e.x)},bounds:new ge([-180,-90],[180,90])},Yi={R:6378137,R_MINOR:6356752314245179e-9,bounds:new ge([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(e){var o=Math.PI/180,l=this.R,u=e.lat*o,g=this.R_MINOR/l,k=Math.sqrt(1-g*g),P=k*Math.sin(u),W=Math.tan(Math.PI/4-u/2)/Math.pow((1-P)/(1+P),k/2);return u=-l*Math.log(Math.max(W,1e-10)),new me(e.lng*o*l,u)},unproject:function(e){for(var o=180/Math.PI,l=this.R,u=this.R_MINOR/l,g=Math.sqrt(1-u*u),k=Math.exp(-e.y/l),P=Math.PI/2-2*Math.atan(k),W=0,X=.1,ae;W<15&&Math.abs(X)>1e-7;W++)ae=g*Math.sin(P),ae=Math.pow((1-ae)/(1+ae),g/2),X=Math.PI/2-2*Math.atan(k*ae)-P,P+=X;return new Be(P*o,e.x*o/l)}},vs={__proto__:null,LonLat:Xi,Mercator:Yi,SphericalMercator:Ke},_s=s({},Ge,{code:"EPSG:3395",projection:Yi,transformation:function(){var e=.5/(Math.PI*Yi.R);return lt(e,.5,-e,.5)}()}),jr=s({},Ge,{code:"EPSG:4326",projection:Xi,transformation:lt(1/180,1,-1/180,.5)}),ys=s({},Qe,{projection:Xi,transformation:lt(1,0,-1,0),scale:function(e){return Math.pow(2,e)},zoom:function(e){return Math.log(e)/Math.LN2},distance:function(e,o){var l=o.lng-e.lng,u=o.lat-e.lat;return Math.sqrt(l*l+u*u)},infinite:!0});Qe.Earth=Ge,Qe.EPSG3395=_s,Qe.EPSG3857=xn,Qe.EPSG900913=Un,Qe.EPSG4326=jr,Qe.Simple=ys;var Ht=_e.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(e){return e.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(e){return e&&e.removeLayer(this),this},getPane:function(e){return this._map.getPane(e?this.options[e]||e:this.options.pane)},addInteractiveTarget:function(e){return this._map._targets[m(e)]=this,this},removeInteractiveTarget:function(e){return delete this._map._targets[m(e)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(e){var o=e.target;if(o.hasLayer(this)){if(this._map=o,this._zoomAnimated=o._zoomAnimated,this.getEvents){var l=this.getEvents();o.on(l,this),this.once("remove",function(){o.off(l,this)},this)}this.onAdd(o),this.fire("add"),o.fire("layeradd",{layer:this})}}});be.include({addLayer:function(e){if(!e._layerAdd)throw new Error("The provided object is not a Layer.");var o=m(e);return this._layers[o]?this:(this._layers[o]=e,e._mapToAdd=this,e.beforeAdd&&e.beforeAdd(this),this.whenReady(e._layerAdd,e),this)},removeLayer:function(e){var o=m(e);return this._layers[o]?(this._loaded&&e.onRemove(this),delete this._layers[o],this._loaded&&(this.fire("layerremove",{layer:e}),e.fire("remove")),e._map=e._mapToAdd=null,this):this},hasLayer:function(e){return m(e)in this._layers},eachLayer:function(e,o){for(var l in this._layers)e.call(o,this._layers[l]);return this},_addLayers:function(e){e=e?I(e)?e:[e]:[];for(var o=0,l=e.length;othis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()=2&&o[0]instanceof Be&&o[0].equals(o[l-1])&&o.pop(),o},_setLatLngs:function(e){ln.prototype._setLatLngs.call(this,e),Rt(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Rt(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var e=this._renderer._bounds,o=this.options.weight,l=new me(o,o);if(e=new ge(e.min.subtract(l),e.max.add(l)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(e))){if(this.options.noClip){this._parts=this._rings;return}for(var u=0,g=this._rings.length,k;ue.y!=g.y>e.y&&e.x<(g.x-u.x)*(e.y-u.y)/(g.y-u.y)+u.x&&(o=!o);return o||ln.prototype._containsPoint.call(this,e,!0)}});function Bs(e,o){return new Qn(e,o)}var cn=sn.extend({initialize:function(e,o){$(this,o),this._layers={},e&&this.addData(e)},addData:function(e){var o=I(e)?e:e.features,l,u,g;if(o){for(l=0,u=o.length;l0&&g.push(g[0].slice()),g}function eo(e,o){return e.feature?s({},e.feature,{geometry:o}):ni(o)}function ni(e){return e.type==="Feature"||e.type==="FeatureCollection"?e:{type:"Feature",properties:{},geometry:e}}var nr={toGeoJSON:function(e){return eo(this,{type:"Point",coordinates:tr(this.getLatLng(),e)})}};Xo.include(nr),Qi.include(nr),Yo.include(nr),ln.include({toGeoJSON:function(e){var o=!Rt(this._latlngs),l=ti(this._latlngs,o?1:0,!1,e);return eo(this,{type:(o?"Multi":"")+"LineString",coordinates:l})}}),Qn.include({toGeoJSON:function(e){var o=!Rt(this._latlngs),l=o&&!Rt(this._latlngs[0]),u=ti(this._latlngs,l?2:o?1:0,!0,e);return o||(u=[u]),eo(this,{type:(l?"Multi":"")+"Polygon",coordinates:u})}}),Xn.include({toMultiPoint:function(e){var o=[];return this.eachLayer(function(l){o.push(l.toGeoJSON(e).geometry.coordinates)}),eo(this,{type:"MultiPoint",coordinates:o})},toGeoJSON:function(e){var o=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(o==="MultiPoint")return this.toMultiPoint(e);var l=o==="GeometryCollection",u=[];return this.eachLayer(function(g){if(g.toGeoJSON){var k=g.toGeoJSON(e);if(l)u.push(k.geometry);else{var P=ni(k);P.type==="FeatureCollection"?u.push.apply(u,P.features):u.push(P)}}}),l?eo(this,{geometries:u,type:"GeometryCollection"}):{type:"FeatureCollection",features:u}}});function Gr(e,o){return new cn(e,o)}var Ds=Gr,oi=Ht.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(e,o,l){this._url=e,this._bounds=we(o),$(this,l)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(Pe(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){Ve(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(e){return this.options.opacity=e,this._image&&this._updateOpacity(),this},setStyle:function(e){return e.opacity&&this.setOpacity(e.opacity),this},bringToFront:function(){return this._map&&Ut(this._image),this},bringToBack:function(){return this._map&&rn(this._image),this},setUrl:function(e){return this._url=e,this._image&&(this._image.src=e),this},setBounds:function(e){return this._bounds=we(e),this._map&&this._reset(),this},getEvents:function(){var e={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(e.zoomanim=this._animateZoom),e},setZIndex:function(e){return this.options.zIndex=e,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var e=this._url.tagName==="IMG",o=this._image=e?this._url:ze("img");if(Pe(o,"leaflet-image-layer"),this._zoomAnimated&&Pe(o,"leaflet-zoom-animated"),this.options.className&&Pe(o,this.options.className),o.onselectstart=v,o.onmousemove=v,o.onload=c(this.fire,this,"load"),o.onerror=c(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(o.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),e){this._url=o.src;return}o.src=this._url,o.alt=this.options.alt},_animateZoom:function(e){var o=this._map.getZoomScale(e.zoom),l=this._map._latLngBoundsToNewLayerBounds(this._bounds,e.zoom,e.center).min;Gt(this._image,l,o)},_reset:function(){var e=this._image,o=new ge(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),l=o.getSize();Je(e,o.min),e.style.width=l.x+"px",e.style.height=l.y+"px"},_updateOpacity:function(){gt(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var e=this.options.errorOverlayUrl;e&&this._url!==e&&(this._url=e,this._image.src=e)},getCenter:function(){return this._bounds.getCenter()}}),Ms=function(e,o,l){return new oi(e,o,l)},Hr=oi.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var e=this._url.tagName==="VIDEO",o=this._image=e?this._url:ze("video");if(Pe(o,"leaflet-image-layer"),this._zoomAnimated&&Pe(o,"leaflet-zoom-animated"),this.options.className&&Pe(o,this.options.className),o.onselectstart=v,o.onmousemove=v,o.onloadeddata=c(this.fire,this,"load"),e){for(var l=o.getElementsByTagName("source"),u=[],g=0;g0?u:[o.src];return}I(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(o.style,"objectFit")&&(o.style.objectFit="fill"),o.autoplay=!!this.options.autoplay,o.loop=!!this.options.loop,o.muted=!!this.options.muted,o.playsInline=!!this.options.playsInline;for(var k=0;kg?(o.height=g+"px",Pe(e,k)):$e(e,k),this._containerWidth=this._container.offsetWidth},_animateZoom:function(e){var o=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center),l=this._getAnchor();Je(this._container,o.add(l))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var e=this._map,o=parseInt(Mn(this._container,"marginBottom"),10)||0,l=this._container.offsetHeight+o,u=this._containerWidth,g=new me(this._containerLeft,-l-this._containerBottom);g._add(Kt(this._container));var k=e.layerPointToContainerPoint(g),P=te(this.options.autoPanPadding),W=te(this.options.autoPanPaddingTopLeft||P),X=te(this.options.autoPanPaddingBottomRight||P),ae=e.getSize(),Fe=0,Ee=0;k.x+u+X.x>ae.x&&(Fe=k.x+u-ae.x+X.x),k.x-Fe-W.x<0&&(Fe=k.x-W.x),k.y+l+X.y>ae.y&&(Ee=k.y+l-ae.y+X.y),k.y-Ee-W.y<0&&(Ee=k.y-W.y),(Fe||Ee)&&(this.options.keepInView&&(this._autopanning=!0),e.fire("autopanstart").panBy([Fe,Ee]))}},_getAnchor:function(){return te(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Ts=function(e,o){return new ii(e,o)};be.mergeOptions({closePopupOnClick:!0}),be.include({openPopup:function(e,o,l){return this._initOverlay(ii,e,o,l).openOn(this),this},closePopup:function(e){return e=arguments.length?e:this._popup,e&&e.close(),this}}),Ht.include({bindPopup:function(e,o){return this._popup=this._initOverlay(ii,this._popup,e,o),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(e){return this._popup&&(this instanceof sn||(this._popup._source=this),this._popup._prepareOpen(e||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(e){return this._popup&&this._popup.setContent(e),this},getPopup:function(){return this._popup},_openPopup:function(e){if(!(!this._popup||!this._map)){D(e);var o=e.layer||e.target;if(this._popup._source===o&&!(o instanceof _n)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(e.latlng);return}this._popup._source=o,this.openPopup(e.latlng)}},_movePopup:function(e){this._popup.setLatLng(e.latlng)},_onKeyPress:function(e){e.originalEvent.keyCode===13&&this._openPopup(e)}});var ri=Jt.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(e){Jt.prototype.onAdd.call(this,e),this.setOpacity(this.options.opacity),e.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(e){Jt.prototype.onRemove.call(this,e),e.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var e=Jt.prototype.getEvents.call(this);return this.options.permanent||(e.preclick=this.close),e},_initLayout:function(){var e="leaflet-tooltip",o=e+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=ze("div",o),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+m(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(e){var o,l,u=this._map,g=this._container,k=u.latLngToContainerPoint(u.getCenter()),P=u.layerPointToContainerPoint(e),W=this.options.direction,X=g.offsetWidth,ae=g.offsetHeight,Fe=te(this.options.offset),Ee=this._getAnchor();W==="top"?(o=X/2,l=ae):W==="bottom"?(o=X/2,l=0):W==="center"?(o=X/2,l=ae/2):W==="right"?(o=0,l=ae/2):W==="left"?(o=X,l=ae/2):P.xthis.options.maxZoom||lu?this._retainParent(g,k,P,u):!1)},_retainChildren:function(e,o,l,u){for(var g=2*e;g<2*e+2;g++)for(var k=2*o;k<2*o+2;k++){var P=new me(g,k);P.z=l+1;var W=this._tileCoordsToKey(P),X=this._tiles[W];if(X&&X.active){X.retain=!0;continue}else X&&X.loaded&&(X.retain=!0);l+1this.options.maxZoom||this.options.minZoom!==void 0&&g1){this._setView(e,l);return}for(var Ee=g.min.y;Ee<=g.max.y;Ee++)for(var Oe=g.min.x;Oe<=g.max.x;Oe++){var ut=new me(Oe,Ee);if(ut.z=this._tileZoom,!!this._isValidTile(ut)){var st=this._tiles[this._tileCoordsToKey(ut)];st?st.current=!0:P.push(ut)}}if(P.sort(function(_t,no){return _t.distanceTo(k)-no.distanceTo(k)}),P.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var zt=document.createDocumentFragment();for(Oe=0;Oel.max.x)||!o.wrapLat&&(e.yl.max.y))return!1}if(!this.options.bounds)return!0;var u=this._tileCoordsToBounds(e);return we(this.options.bounds).overlaps(u)},_keyToBounds:function(e){return this._tileCoordsToBounds(this._keyToTileCoords(e))},_tileCoordsToNwSe:function(e){var o=this._map,l=this.getTileSize(),u=e.scaleBy(l),g=u.add(l),k=o.unproject(u,e.z),P=o.unproject(g,e.z);return[k,P]},_tileCoordsToBounds:function(e){var o=this._tileCoordsToNwSe(e),l=new ue(o[0],o[1]);return this.options.noWrap||(l=this._map.wrapLatLngBounds(l)),l},_tileCoordsToKey:function(e){return e.x+":"+e.y+":"+e.z},_keyToTileCoords:function(e){var o=e.split(":"),l=new me(+o[0],+o[1]);return l.z=+o[2],l},_removeTile:function(e){var o=this._tiles[e];o&&(Ve(o.el),delete this._tiles[e],this.fire("tileunload",{tile:o.el,coords:this._keyToTileCoords(e)}))},_initTile:function(e){Pe(e,"leaflet-tile");var o=this.getTileSize();e.style.width=o.x+"px",e.style.height=o.y+"px",e.onselectstart=v,e.onmousemove=v,ke.ielt9&&this.options.opacity<1&>(e,this.options.opacity)},_addTile:function(e,o){var l=this._getTilePos(e),u=this._tileCoordsToKey(e),g=this.createTile(this._wrapCoords(e),c(this._tileReady,this,e));this._initTile(g),this.createTile.length<2&&U(c(this._tileReady,this,e,null,g)),Je(g,l),this._tiles[u]={el:g,coords:e,current:!0},o.appendChild(g),this.fire("tileloadstart",{tile:g,coords:e})},_tileReady:function(e,o,l){o&&this.fire("tileerror",{error:o,tile:l,coords:e});var u=this._tileCoordsToKey(e);l=this._tiles[u],l&&(l.loaded=+new Date,this._map._fadeAnimated?(gt(l.el,0),ee(this._fadeFrame),this._fadeFrame=U(this._updateOpacity,this)):(l.active=!0,this._pruneTiles()),o||(Pe(l.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:l.el,coords:e})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),ke.ielt9||!this._map._fadeAnimated?U(this._pruneTiles,this):setTimeout(c(this._pruneTiles,this),250)))},_getTilePos:function(e){return e.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(e){var o=new me(this._wrapX?p(e.x,this._wrapX):e.x,this._wrapY?p(e.y,this._wrapY):e.y);return o.z=e.z,o},_pxBoundsToTileRange:function(e){var o=this.getTileSize();return new ge(e.min.unscaleBy(o).floor(),e.max.unscaleBy(o).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var e in this._tiles)if(!this._tiles[e].loaded)return!1;return!0}});function zs(e){return new wo(e)}var to=wo.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(e,o){this._url=e,o=$(this,o),o.detectRetina&&ke.retina&&o.maxZoom>0?(o.tileSize=Math.floor(o.tileSize/2),o.zoomReverse?(o.zoomOffset--,o.minZoom=Math.min(o.maxZoom,o.minZoom+1)):(o.zoomOffset++,o.maxZoom=Math.max(o.minZoom,o.maxZoom-1)),o.minZoom=Math.max(0,o.minZoom)):o.zoomReverse?o.minZoom=Math.min(o.maxZoom,o.minZoom):o.maxZoom=Math.max(o.minZoom,o.maxZoom),typeof o.subdomains=="string"&&(o.subdomains=o.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(e,o){return this._url===e&&o===void 0&&(o=!0),this._url=e,o||this.redraw(),this},createTile:function(e,o){var l=document.createElement("img");return Me(l,"load",c(this._tileOnLoad,this,o,l)),Me(l,"error",c(this._tileOnError,this,o,l)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(l.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(l.referrerPolicy=this.options.referrerPolicy),l.alt="",l.src=this.getTileUrl(e),l},getTileUrl:function(e){var o={r:ke.retina?"@2x":"",s:this._getSubdomain(e),x:e.x,y:e.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var l=this._globalTileRange.max.y-e.y;this.options.tms&&(o.y=l),o["-y"]=l}return J(this._url,s(o,this.options))},_tileOnLoad:function(e,o){ke.ielt9?setTimeout(c(e,this,null,o),0):e(null,o)},_tileOnError:function(e,o,l){var u=this.options.errorTileUrl;u&&o.getAttribute("src")!==u&&(o.src=u),e(l,o)},_onTileRemove:function(e){e.tile.onload=null},_getZoomForUrl:function(){var e=this._tileZoom,o=this.options.maxZoom,l=this.options.zoomReverse,u=this.options.zoomOffset;return l&&(e=o-e),e+u},_getSubdomain:function(e){var o=Math.abs(e.x+e.y)%this.options.subdomains.length;return this.options.subdomains[o]},_abortLoading:function(){var e,o;for(e in this._tiles)if(this._tiles[e].coords.z!==this._tileZoom&&(o=this._tiles[e].el,o.onload=v,o.onerror=v,!o.complete)){o.src=V;var l=this._tiles[e].coords;Ve(o),delete this._tiles[e],this.fire("tileabort",{tile:o,coords:l})}},_removeTile:function(e){var o=this._tiles[e];if(o)return o.el.setAttribute("src",V),wo.prototype._removeTile.call(this,e)},_tileReady:function(e,o,l){if(!(!this._map||l&&l.getAttribute("src")===V))return wo.prototype._tileReady.call(this,e,o,l)}});function Vr(e,o){return new to(e,o)}var $r=to.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(e,o){this._url=e;var l=s({},this.defaultWmsParams);for(var u in o)u in this.options||(l[u]=o[u]);o=$(this,o);var g=o.detectRetina&&ke.retina?2:1,k=this.getTileSize();l.width=k.x*g,l.height=k.y*g,this.wmsParams=l},onAdd:function(e){this._crs=this.options.crs||e.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var o=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[o]=this._crs.code,to.prototype.onAdd.call(this,e)},getTileUrl:function(e){var o=this._tileCoordsToNwSe(e),l=this._crs,u=ye(l.project(o[0]),l.project(o[1])),g=u.min,k=u.max,P=(this._wmsVersion>=1.3&&this._crs===jr?[g.y,g.x,k.y,k.x]:[g.x,g.y,k.x,k.y]).join(","),W=to.prototype.getTileUrl.call(this,e);return W+N(this.wmsParams,W,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+P},setParams:function(e,o){return s(this.wmsParams,e),o||this.redraw(),this}});function Is(e,o){return new $r(e,o)}to.WMS=$r,Vr.wms=Is;var dn=Ht.extend({options:{padding:.1},initialize:function(e){$(this,e),m(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),Pe(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var e={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(e.zoomanim=this._onAnimZoom),e},_onAnimZoom:function(e){this._updateTransform(e.center,e.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(e,o){var l=this._map.getZoomScale(o,this._zoom),u=this._map.getSize().multiplyBy(.5+this.options.padding),g=this._map.project(this._center,o),k=u.multiplyBy(-l).add(g).subtract(this._map._getNewPixelOrigin(e,o));ke.any3d?Gt(this._container,k,l):Je(this._container,k)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var e in this._layers)this._layers[e]._reset()},_onZoomEnd:function(){for(var e in this._layers)this._layers[e]._project()},_updatePaths:function(){for(var e in this._layers)this._layers[e]._update()},_update:function(){var e=this.options.padding,o=this._map.getSize(),l=this._map.containerPointToLayerPoint(o.multiplyBy(-e)).round();this._bounds=new ge(l,l.add(o.multiplyBy(1+e*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Kr=dn.extend({options:{tolerance:0},getEvents:function(){var e=dn.prototype.getEvents.call(this);return e.viewprereset=this._onViewPreReset,e},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){dn.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var e=this._container=document.createElement("canvas");Me(e,"mousemove",this._onMouseMove,this),Me(e,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Me(e,"mouseout",this._handleMouseOut,this),e._leaflet_disable_events=!0,this._ctx=e.getContext("2d")},_destroyContainer:function(){ee(this._redrawRequest),delete this._ctx,Ve(this._container),He(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var e;this._redrawBounds=null;for(var o in this._layers)e=this._layers[o],e._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){dn.prototype._update.call(this);var e=this._bounds,o=this._container,l=e.getSize(),u=ke.retina?2:1;Je(o,e.min),o.width=u*l.x,o.height=u*l.y,o.style.width=l.x+"px",o.style.height=l.y+"px",ke.retina&&this._ctx.scale(2,2),this._ctx.translate(-e.min.x,-e.min.y),this.fire("update")}},_reset:function(){dn.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(e){this._updateDashArray(e),this._layers[m(e)]=e;var o=e._order={layer:e,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=o),this._drawLast=o,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(e){this._requestRedraw(e)},_removePath:function(e){var o=e._order,l=o.next,u=o.prev;l?l.prev=u:this._drawLast=u,u?u.next=l:this._drawFirst=l,delete e._order,delete this._layers[m(e)],this._requestRedraw(e)},_updatePath:function(e){this._extendRedrawBounds(e),e._project(),e._update(),this._requestRedraw(e)},_updateStyle:function(e){this._updateDashArray(e),this._requestRedraw(e)},_updateDashArray:function(e){if(typeof e.options.dashArray=="string"){var o=e.options.dashArray.split(/[, ]+/),l=[],u,g;for(g=0;g')}}catch(e){}return function(e){return document.createElement("<"+e+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),js={_initContainer:function(){this._container=ze("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(dn.prototype._update.call(this),this.fire("update"))},_initPath:function(e){var o=e._container=xo("shape");Pe(o,"leaflet-vml-shape "+(this.options.className||"")),o.coordsize="1 1",e._path=xo("path"),o.appendChild(e._path),this._updateStyle(e),this._layers[m(e)]=e},_addPath:function(e){var o=e._container;this._container.appendChild(o),e.options.interactive&&e.addInteractiveTarget(o)},_removePath:function(e){var o=e._container;Ve(o),e.removeInteractiveTarget(o),delete this._layers[m(e)]},_updateStyle:function(e){var o=e._stroke,l=e._fill,u=e.options,g=e._container;g.stroked=!!u.stroke,g.filled=!!u.fill,u.stroke?(o||(o=e._stroke=xo("stroke")),g.appendChild(o),o.weight=u.weight+"px",o.color=u.color,o.opacity=u.opacity,u.dashArray?o.dashStyle=I(u.dashArray)?u.dashArray.join(" "):u.dashArray.replace(/( *, *)/g," "):o.dashStyle="",o.endcap=u.lineCap.replace("butt","flat"),o.joinstyle=u.lineJoin):o&&(g.removeChild(o),e._stroke=null),u.fill?(l||(l=e._fill=xo("fill")),g.appendChild(l),l.color=u.fillColor||u.color,l.opacity=u.fillOpacity):l&&(g.removeChild(l),e._fill=null)},_updateCircle:function(e){var o=e._point.round(),l=Math.round(e._radius),u=Math.round(e._radiusY||l);this._setPath(e,e._empty()?"M0 0":"AL "+o.x+","+o.y+" "+l+","+u+" 0,"+65535*360)},_setPath:function(e,o){e._path.v=o},_bringToFront:function(e){Ut(e._container)},_bringToBack:function(e){rn(e._container)}},ai=ke.vml?xo:Cn,Co=dn.extend({_initContainer:function(){this._container=ai("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=ai("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){Ve(this._container),He(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){dn.prototype._update.call(this);var e=this._bounds,o=e.getSize(),l=this._container;(!this._svgSize||!this._svgSize.equals(o))&&(this._svgSize=o,l.setAttribute("width",o.x),l.setAttribute("height",o.y)),Je(l,e.min),l.setAttribute("viewBox",[e.min.x,e.min.y,o.x,o.y].join(" ")),this.fire("update")}},_initPath:function(e){var o=e._path=ai("path");e.options.className&&Pe(o,e.options.className),e.options.interactive&&Pe(o,"leaflet-interactive"),this._updateStyle(e),this._layers[m(e)]=e},_addPath:function(e){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(e._path),e.addInteractiveTarget(e._path)},_removePath:function(e){Ve(e._path),e.removeInteractiveTarget(e._path),delete this._layers[m(e)]},_updatePath:function(e){e._project(),e._update()},_updateStyle:function(e){var o=e._path,l=e.options;o&&(l.stroke?(o.setAttribute("stroke",l.color),o.setAttribute("stroke-opacity",l.opacity),o.setAttribute("stroke-width",l.weight),o.setAttribute("stroke-linecap",l.lineCap),o.setAttribute("stroke-linejoin",l.lineJoin),l.dashArray?o.setAttribute("stroke-dasharray",l.dashArray):o.removeAttribute("stroke-dasharray"),l.dashOffset?o.setAttribute("stroke-dashoffset",l.dashOffset):o.removeAttribute("stroke-dashoffset")):o.setAttribute("stroke","none"),l.fill?(o.setAttribute("fill",l.fillColor||l.color),o.setAttribute("fill-opacity",l.fillOpacity),o.setAttribute("fill-rule",l.fillRule||"evenodd")):o.setAttribute("fill","none"))},_updatePoly:function(e,o){this._setPath(e,ct(e._parts,o))},_updateCircle:function(e){var o=e._point,l=Math.max(Math.round(e._radius),1),u=Math.max(Math.round(e._radiusY),1)||l,g="a"+l+","+u+" 0 1,0 ",k=e._empty()?"M0 0":"M"+(o.x-l)+","+o.y+g+l*2+",0 "+g+-l*2+",0 ";this._setPath(e,k)},_setPath:function(e,o){e._path.setAttribute("d",o)},_bringToFront:function(e){Ut(e._path)},_bringToBack:function(e){rn(e._path)}});ke.vml&&Co.include(js);function Jr(e){return ke.svg||ke.vml?new Co(e):null}be.include({getRenderer:function(e){var o=e.options.renderer||this._getPaneRenderer(e.options.pane)||this.options.renderer||this._renderer;return o||(o=this._renderer=this._createRenderer()),this.hasLayer(o)||this.addLayer(o),o},_getPaneRenderer:function(e){if(e==="overlayPane"||e===void 0)return!1;var o=this._paneRenderers[e];return o===void 0&&(o=this._createRenderer({pane:e}),this._paneRenderers[e]=o),o},_createRenderer:function(e){return this.options.preferCanvas&&Wr(e)||Jr(e)}});var Xr=Qn.extend({initialize:function(e,o){Qn.prototype.initialize.call(this,this._boundsToLatLngs(e),o)},setBounds:function(e){return this.setLatLngs(this._boundsToLatLngs(e))},_boundsToLatLngs:function(e){return e=we(e),[e.getSouthWest(),e.getNorthWest(),e.getNorthEast(),e.getSouthEast()]}});function Ns(e,o){return new Xr(e,o)}Co.create=ai,Co.pointsToPath=ct,cn.geometryToLayer=Qo,cn.coordsToLatLng=er,cn.coordsToLatLngs=ei,cn.latLngToCoords=tr,cn.latLngsToCoords=ti,cn.getFeature=eo,cn.asFeature=ni,be.mergeOptions({boxZoom:!0});var Yr=vt.extend({initialize:function(e){this._map=e,this._container=e._container,this._pane=e._panes.overlayPane,this._resetStateTimeout=0,e.on("unload",this._destroy,this)},addHooks:function(){Me(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){He(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){Ve(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(e){if(!e.shiftKey||e.which!==1&&e.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),St(),Xe(),this._startPoint=this._map.mouseEventToContainerPoint(e),Me(document,{contextmenu:D,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(e){this._moved||(this._moved=!0,this._box=ze("div","leaflet-zoom-box",this._container),Pe(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(e);var o=new ge(this._point,this._startPoint),l=o.getSize();Je(this._box,o.min),this._box.style.width=l.x+"px",this._box.style.height=l.y+"px"},_finish:function(){this._moved&&(Ve(this._box),$e(this._container,"leaflet-crosshair")),Wt(),gn(),He(document,{contextmenu:D,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(e){if(!(e.which!==1&&e.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(c(this._resetState,this),0);var o=new ue(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(o).fire("boxzoomend",{boxZoomBounds:o})}},_onKeyDown:function(e){e.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});be.addInitHook("addHandler","boxZoom",Yr),be.mergeOptions({doubleClickZoom:!0});var Qr=vt.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(e){var o=this._map,l=o.getZoom(),u=o.options.zoomDelta,g=e.originalEvent.shiftKey?l-u:l+u;o.options.doubleClickZoom==="center"?o.setZoom(g):o.setZoomAround(e.containerPoint,g)}});be.addInitHook("addHandler","doubleClickZoom",Qr),be.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var ea=vt.extend({addHooks:function(){if(!this._draggable){var e=this._map;this._draggable=new vn(e._mapPane,e._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),e.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),e.on("zoomend",this._onZoomEnd,this),e.whenReady(this._onZoomEnd,this))}Pe(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){$e(this._map._container,"leaflet-grab"),$e(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var e=this._map;if(e._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var o=we(this._map.options.maxBounds);this._offsetLimit=ye(this._map.latLngToContainerPoint(o.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(o.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;e.fire("movestart").fire("dragstart"),e.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(e){if(this._map.options.inertia){var o=this._lastTime=+new Date,l=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(l),this._times.push(o),this._prunePositions(o)}this._map.fire("move",e).fire("drag",e)},_prunePositions:function(e){for(;this._positions.length>1&&e-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var e=this._map.getSize().divideBy(2),o=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=o.subtract(e).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(e,o){return e-(e-o)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var e=this._draggable._newPos.subtract(this._draggable._startPos),o=this._offsetLimit;e.xo.max.x&&(e.x=this._viscousLimit(e.x,o.max.x)),e.y>o.max.y&&(e.y=this._viscousLimit(e.y,o.max.y)),this._draggable._newPos=this._draggable._startPos.add(e)}},_onPreDragWrap:function(){var e=this._worldWidth,o=Math.round(e/2),l=this._initialWorldOffset,u=this._draggable._newPos.x,g=(u-o+l)%e+o-l,k=(u+o+l)%e-o-l,P=Math.abs(g+l)0?k:-k))-o;this._delta=0,this._startTime=null,P&&(e.options.scrollWheelZoom==="center"?e.setZoom(o+P):e.setZoomAround(this._lastMousePos,o+P))}});be.addInitHook("addHandler","scrollWheelZoom",na);var Us=600;be.mergeOptions({tapHold:ke.touchNative&&ke.safari&&ke.mobile,tapTolerance:15});var oa=vt.extend({addHooks:function(){Me(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){He(this._map._container,"touchstart",this._onDown,this)},_onDown:function(e){if(clearTimeout(this._holdTimeout),e.touches.length===1){var o=e.touches[0];this._startPos=this._newPos=new me(o.clientX,o.clientY),this._holdTimeout=setTimeout(c(function(){this._cancel(),this._isTapValid()&&(Me(document,"touchend",B),Me(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",o))},this),Us),Me(document,"touchend touchcancel contextmenu",this._cancel,this),Me(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function e(){He(document,"touchend",B),He(document,"touchend touchcancel",e)},_cancel:function(){clearTimeout(this._holdTimeout),He(document,"touchend touchcancel contextmenu",this._cancel,this),He(document,"touchmove",this._onMove,this)},_onMove:function(e){var o=e.touches[0];this._newPos=new me(o.clientX,o.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(e,o){var l=new MouseEvent(e,{bubbles:!0,cancelable:!0,view:window,screenX:o.screenX,screenY:o.screenY,clientX:o.clientX,clientY:o.clientY});l._simulated=!0,o.target.dispatchEvent(l)}});be.addInitHook("addHandler","tapHold",oa),be.mergeOptions({touchZoom:ke.touch,bounceAtZoomLimits:!0});var ia=vt.extend({addHooks:function(){Pe(this._map._container,"leaflet-touch-zoom"),Me(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){$e(this._map._container,"leaflet-touch-zoom"),He(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(e){var o=this._map;if(!(!e.touches||e.touches.length!==2||o._animatingZoom||this._zooming)){var l=o.mouseEventToContainerPoint(e.touches[0]),u=o.mouseEventToContainerPoint(e.touches[1]);this._centerPoint=o.getSize()._divideBy(2),this._startLatLng=o.containerPointToLatLng(this._centerPoint),o.options.touchZoom!=="center"&&(this._pinchStartLatLng=o.containerPointToLatLng(l.add(u)._divideBy(2))),this._startDist=l.distanceTo(u),this._startZoom=o.getZoom(),this._moved=!1,this._zooming=!0,o._stop(),Me(document,"touchmove",this._onTouchMove,this),Me(document,"touchend touchcancel",this._onTouchEnd,this),B(e)}},_onTouchMove:function(e){if(!(!e.touches||e.touches.length!==2||!this._zooming)){var o=this._map,l=o.mouseEventToContainerPoint(e.touches[0]),u=o.mouseEventToContainerPoint(e.touches[1]),g=l.distanceTo(u)/this._startDist;if(this._zoom=o.getScaleZoom(g,this._startZoom),!o.options.bounceAtZoomLimits&&(this._zoomo.getMaxZoom()&&g>1)&&(this._zoom=o._limitZoom(this._zoom)),o.options.touchZoom==="center"){if(this._center=this._startLatLng,g===1)return}else{var k=l._add(u)._divideBy(2)._subtract(this._centerPoint);if(g===1&&k.x===0&&k.y===0)return;this._center=o.unproject(o.project(this._pinchStartLatLng,this._zoom).subtract(k),this._zoom)}this._moved||(o._moveStart(!0,!1),this._moved=!0),ee(this._animRequest);var P=c(o._move,o,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=U(P,this,!0),B(e)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,ee(this._animRequest),He(document,"touchmove",this._onTouchMove,this),He(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))}});be.addInitHook("addHandler","touchZoom",ia),be.BoxZoom=Yr,be.DoubleClickZoom=Qr,be.Drag=ea,be.Keyboard=ta,be.ScrollWheelZoom=na,be.TapHold=oa,be.TouchZoom=ia,t.Bounds=ge,t.Browser=ke,t.CRS=Qe,t.Canvas=Kr,t.Circle=Qi,t.CircleMarker=Yo,t.Class=de,t.Control=je,t.DivIcon=Zr,t.DivOverlay=Jt,t.DomEvent=he,t.DomUtil=_o,t.Draggable=vn,t.Evented=_e,t.FeatureGroup=sn,t.GeoJSON=cn,t.GridLayer=wo,t.Handler=vt,t.Icon=Yn,t.ImageOverlay=oi,t.LatLng=Be,t.LatLngBounds=ue,t.Layer=Ht,t.LayerGroup=Xn,t.LineUtil=Fs,t.Map=be,t.Marker=Xo,t.Mixin=Ki,t.Path=_n,t.Point=me,t.PolyUtil=us,t.Polygon=Qn,t.Polyline=ln,t.Popup=ii,t.PosAnimation=Le,t.Projection=vs,t.Rectangle=Xr,t.Renderer=dn,t.SVG=Co,t.SVGOverlay=qr,t.TileLayer=to,t.Tooltip=ri,t.Transformation=wt,t.Util=ce,t.VideoOverlay=Hr,t.bind=c,t.bounds=ye,t.canvas=Wr,t.circle=Es,t.circleMarker=Ls,t.control=Ie,t.divIcon=Rs,t.extend=s,t.featureGroup=ws,t.geoJSON=Gr,t.geoJson=Ds,t.gridLayer=zs,t.icon=xs,t.imageOverlay=Ms,t.latLng=Ae,t.latLngBounds=we,t.layerGroup=ks,t.map=Ue,t.marker=Cs,t.point=te,t.polygon=Bs,t.polyline=As,t.popup=Ts,t.rectangle=Ns,t.setOptions=$,t.stamp=m,t.svg=Jr,t.svgOverlay=Ss,t.tileLayer=Vr,t.tooltip=Os,t.transformation=lt,t.version=i,t.videoOverlay=Ps;var Gs=window.L;t.noConflict=function(){return window.L=Gs,this},window.L=t})});var ss={};ua(ss,{Geocoder:()=>Nn,default:()=>Sc,geocoder:()=>as,geocoders:()=>rs});function pt(t,i){return Z.Util.extend(i,t.geocodingQueryParams)}function kt(t,i){return Z.Util.extend(i,t.reverseQueryParams)}function mc(t){return fc[t]}function uc(t){return t==null?"":t?(t=""+t,dc.test(t)?t.replace(cc,mc):t):t+""}function ns(t,i,s,a,c){let d="_l_geocoder_"+lc++;i[c||"callback"]=d,window[d]=Z.Util.bind(s,a);let m=document.createElement("script");m.type="text/javascript",m.src=t+os(i),m.id=d,document.getElementsByTagName("head")[0].appendChild(m)}function We(t,i,s){let a=new XMLHttpRequest;a.onreadystatechange=function(){if(a.readyState!==4)return;let c;if(a.status!==200&&a.status!==304)c="";else if(typeof a.response=="string")try{c=JSON.parse(a.response)}catch(d){c=a.response}else c=a.response;s(c)},a.open("GET",t+os(i),!0),a.responseType="json",a.setRequestHeader("Accept","application/json"),a.send(null)}function hc(t,i){return t.replace(/\{ *([\w_]+) *\}/g,(s,a)=>{let c=i[a];return c===void 0?c="":typeof c=="function"&&(c=c(i)),uc(c)})}function os(t,i,s){let a=[];for(let c in t){let d=encodeURIComponent(s?c.toUpperCase():c),m=t[c];if(!Array.isArray(m))a.push(d+"="+encodeURIComponent(String(m)));else for(let h=0;h{Z=rr(Cr());lc=0,cc=/[&<>"'`]/g,dc=/[&<>"'`]/,fc={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"};Bi=class{constructor(i){this.options={serviceUrl:"https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer",apiKey:""},Z.Util.setOptions(this,i)}geocode(i,s,a){let c=pt(this.options,{token:this.options.apiKey,SingleLine:i,outFields:"Addr_Type",forStorage:!1,maxLocations:10,f:"json"});We(this.options.serviceUrl+"/findAddressCandidates",c,d=>{let m=[];if(d.candidates&&d.candidates.length)for(let h=0;h<=d.candidates.length-1;h++){let p=d.candidates[h],v=Z.latLng(p.location.y,p.location.x),y=Z.latLngBounds(Z.latLng(p.extent.ymax,p.extent.xmax),Z.latLng(p.extent.ymin,p.extent.xmin));m[h]={name:p.address,bbox:y,center:v}}s.call(a,m)})}suggest(i,s,a){return this.geocode(i,s,a)}reverse(i,s,a,c){let d=kt(this.options,{location:i.lng+","+i.lat,distance:100,f:"json"});We(this.options.serviceUrl+"/reverseGeocode",d,m=>{let h=[];if(m&&!m.error){let p=Z.latLng(m.location.y,m.location.x),v=Z.latLngBounds(p,p);h.push({name:m.address.Match_addr,center:p,bbox:v})}a.call(c,h)})}};Di=class{constructor(i){this.options={serviceUrl:"https://dev.virtualearth.net/REST/v1/Locations"},Z.Util.setOptions(this,i)}geocode(i,s,a){let c=pt(this.options,{query:i,key:this.options.apiKey});ns(this.options.apiKey,c,d=>{let m=[];if(d.resourceSets.length>0)for(let h=d.resourceSets[0].resources.length-1;h>=0;h--){let p=d.resourceSets[0].resources[h],v=p.bbox;m[h]={name:p.name,bbox:Z.latLngBounds([v[0],v[1]],[v[2],v[3]]),center:Z.latLng(p.point.coordinates)}}s.call(a,m)},this,"jsonp")}reverse(i,s,a,c){let d=kt(this.options,{key:this.options.apiKey});ns(this.options.serviceUrl+i.lat+","+i.lng,d,m=>{let h=[];for(let p=m.resourceSets[0].resources.length-1;p>=0;p--){let v=m.resourceSets[0].resources[p],y=v.bbox;h[p]={name:v.name,bbox:Z.latLngBounds([y[0],y[1]],[y[2],y[3]]),center:Z.latLng(v.point.coordinates)}}a.call(c,h)},this,"jsonp")}};Mi=class{constructor(i){this.options={serviceUrl:"https://maps.googleapis.com/maps/api/geocode/json"},Z.Util.setOptions(this,i)}geocode(i,s,a){let c=pt(this.options,{key:this.options.apiKey,address:i});We(this.options.serviceUrl,c,d=>{let m=[];if(d.results&&d.results.length)for(let h=0;h<=d.results.length-1;h++){let p=d.results[h],v=Z.latLng(p.geometry.location),y=Z.latLngBounds(Z.latLng(p.geometry.viewport.northeast),Z.latLng(p.geometry.viewport.southwest));m[h]={name:p.formatted_address,bbox:y,center:v,properties:p.address_components}}s.call(a,m)})}reverse(i,s,a,c){let d=kt(this.options,{key:this.options.apiKey,latlng:i.lat+","+i.lng});We(this.options.serviceUrl,d,m=>{let h=[];if(m.results&&m.results.length)for(let p=0;p<=m.results.length-1;p++){let v=m.results[p],y=Z.latLng(v.geometry.location),R=Z.latLngBounds(Z.latLng(v.geometry.viewport.northeast),Z.latLng(v.geometry.viewport.southwest));h[p]={name:v.formatted_address,bbox:R,center:y,properties:v.address_components}}a.call(c,h)})}};Pi=class{constructor(i){if(this.options={serviceUrl:"https://geocoder.api.here.com/6.2/",app_id:"",app_code:"",apiKey:"",maxResults:5},Z.Util.setOptions(this,i),i.apiKey)throw Error("apiKey is not supported, use app_id/app_code instead!")}geocode(i,s,a){let c=pt(this.options,{searchtext:i,gen:9,app_id:this.options.app_id,app_code:this.options.app_code,jsonattributes:1,maxresults:this.options.maxResults});this.getJSON(this.options.serviceUrl+"geocode.json",c,s,a)}reverse(i,s,a,c){let d=i.lat+","+i.lng;this.options.reverseGeocodeProxRadius&&(d+=","+this.options.reverseGeocodeProxRadius);let m=kt(this.options,{prox:d,mode:"retrieveAddresses",app_id:this.options.app_id,app_code:this.options.app_code,gen:9,jsonattributes:1,maxresults:this.options.maxResults});this.getJSON(this.options.serviceUrl+"reversegeocode.json",m,a,c)}getJSON(i,s,a,c){We(i,s,d=>{let m=[];if(d.response.view&&d.response.view.length)for(let h=0;h<=d.response.view[0].result.length-1;h++){let p=d.response.view[0].result[h].location,v=Z.latLng(p.displayPosition.latitude,p.displayPosition.longitude),y=Z.latLngBounds(Z.latLng(p.mapView.topLeft.latitude,p.mapView.topLeft.longitude),Z.latLng(p.mapView.bottomRight.latitude,p.mapView.bottomRight.longitude));m[h]={name:p.address.label,properties:p.address,bbox:y,center:v}}a.call(c,m)})}},Si=class{constructor(i){this.options={serviceUrl:"https://geocode.search.hereapi.com/v1",apiKey:"",app_id:"",app_code:"",maxResults:10},Z.Util.setOptions(this,i)}geocode(i,s,a){let c=pt(this.options,{q:i,apiKey:this.options.apiKey,limit:this.options.maxResults});if(!c.at&&!c.in)throw Error("at / in parameters not found. Please define coordinates (at=latitude,longitude) or other (in) in your geocodingQueryParams.");this.getJSON(this.options.serviceUrl+"/discover",c,s,a)}reverse(i,s,a,c){let d=kt(this.options,{at:i.lat+","+i.lng,limit:this.options.reverseGeocodeProxRadius,apiKey:this.options.apiKey});this.getJSON(this.options.serviceUrl+"/revgeocode",d,a,c)}getJSON(i,s,a,c){We(i,s,d=>{let m=[];if(d.items&&d.items.length)for(let h=0;h<=d.items.length-1;h++){let p=d.items[h],v=Z.latLng(p.position.lat,p.position.lng),y;p.mapView?y=Z.latLngBounds(Z.latLng(p.mapView.south,p.mapView.west),Z.latLng(p.mapView.north,p.mapView.east)):y=Z.latLngBounds(Z.latLng(p.position.lat,p.position.lng),Z.latLng(p.position.lat,p.position.lng)),m[h]={name:p.address.label,properties:p.address,bbox:y,center:v}}a.call(c,m)})}};Ti=class{constructor(i){this.options={next:void 0,sizeInMeters:1e4},Z.Util.setOptions(this,i)}geocode(i,s,a){let c=is(i);if(c){let d=[{name:i,center:c,bbox:c.toBounds(this.options.sizeInMeters)}];s.call(a,d)}else this.options.next&&this.options.next.geocode(i,s,a)}};Oi=class{constructor(i){this.options={serviceUrl:"https://api.mapbox.com/geocoding/v5/mapbox.places/"},Z.Util.setOptions(this,i)}_getProperties(i){let s={text:i.text,address:i.address};for(let a=0;a<(i.context||[]).length;a++){let c=i.context[a].id.split(".")[0];s[c]=i.context[a].text,i.context[a].short_code&&(s.countryShortCode=i.context[a].short_code)}return s}geocode(i,s,a){let c=pt(this.options,{access_token:this.options.apiKey});c.proximity!==void 0&&c.proximity.lat!==void 0&&c.proximity.lng!==void 0&&(c.proximity=c.proximity.lng+","+c.proximity.lat),We(this.options.serviceUrl+encodeURIComponent(i)+".json",c,d=>{let m=[];if(d.features&&d.features.length)for(let h=0;h<=d.features.length-1;h++){let p=d.features[h],v=Z.latLng(p.center.reverse()),y;p.bbox?y=Z.latLngBounds(Z.latLng(p.bbox.slice(0,2).reverse()),Z.latLng(p.bbox.slice(2,4).reverse())):y=Z.latLngBounds(v,v),m[h]={name:p.place_name,bbox:y,center:v,properties:this._getProperties(p)}}s.call(a,m)})}suggest(i,s,a){return this.geocode(i,s,a)}reverse(i,s,a,c){let d=this.options.serviceUrl+i.lng+","+i.lat+".json",m=kt(this.options,{access_token:this.options.apiKey});We(d,m,h=>{let p=[];if(h.features&&h.features.length)for(let v=0;v<=h.features.length-1;v++){let y=h.features[v],R=Z.latLng(y.center.reverse()),G;y.bbox?G=Z.latLngBounds(Z.latLng(y.bbox.slice(0,2).reverse()),Z.latLng(y.bbox.slice(2,4).reverse())):G=Z.latLngBounds(R,R),p[v]={name:y.place_name,bbox:G,center:R,properties:this._getProperties(y)}}a.call(c,p)})}};Ri=class{constructor(i){this.options={serviceUrl:"https://www.mapquestapi.com/geocoding/v1"},Z.Util.setOptions(this,i),this.options.apiKey=decodeURIComponent(this.options.apiKey)}_formatName(...i){return i.filter(s=>!!s).join(", ")}geocode(i,s,a){let c=pt(this.options,{key:this.options.apiKey,location:i,limit:5,outFormat:"json"});We(this.options.serviceUrl+"/address",c,Z.Util.bind(function(d){let m=[];if(d.results&&d.results[0].locations)for(let h=d.results[0].locations.length-1;h>=0;h--){let p=d.results[0].locations[h],v=Z.latLng(p.latLng);m[h]={name:this._formatName(p.street,p.adminArea4,p.adminArea3,p.adminArea1),bbox:Z.latLngBounds(v,v),center:v}}s.call(a,m)},this))}reverse(i,s,a,c){let d=kt(this.options,{key:this.options.apiKey,location:i.lat+","+i.lng,outputFormat:"json"});We(this.options.serviceUrl+"/reverse",d,Z.Util.bind(function(m){let h=[];if(m.results&&m.results[0].locations)for(let p=m.results[0].locations.length-1;p>=0;p--){let v=m.results[0].locations[p],y=Z.latLng(v.latLng);h[p]={name:this._formatName(v.street,v.adminArea4,v.adminArea3,v.adminArea1),bbox:Z.latLngBounds(y,y),center:y}}a.call(c,h)},this))}};zi=class{constructor(i){this.options={userId:void 0,apiKey:void 0,serviceUrl:"https://neutrinoapi.com/"},Z.Util.setOptions(this,i)}geocode(i,s,a){let c=pt(this.options,{apiKey:this.options.apiKey,userId:this.options.userId,address:i.split(/\s+/).join(".")});We(this.options.serviceUrl+"geocode-address",c,d=>{let m=[];if(d.locations){d.geometry=d.locations[0];let h=Z.latLng(d.geometry.latitude,d.geometry.longitude),p=Z.latLngBounds(h,h);m[0]={name:d.geometry.address,bbox:p,center:h}}s.call(a,m)})}suggest(i,s,a){return this.geocode(i,s,a)}reverse(i,s,a,c){let d=kt(this.options,{apiKey:this.options.apiKey,userId:this.options.userId,latitude:i.lat,longitude:i.lng});We(this.options.serviceUrl+"geocode-reverse",d,m=>{let h=[];if(m.status.status==200&&m.found){let p=Z.latLng(i.lat,i.lng),v=Z.latLngBounds(p,p);h[0]={name:m.address,bbox:v,center:p}}a.call(c,h)})}};Io=class{constructor(i){this.options={serviceUrl:"https://nominatim.openstreetmap.org/",htmlTemplate:function(s){let a=s.address,c,d=[];return(a.road||a.building)&&d.push("{building} {road} {house_number}"),(a.city||a.town||a.village||a.hamlet)&&(c=d.length>0?"leaflet-control-geocoder-address-detail":"",d.push('{postcode} {city} {town} {village} {hamlet}')),(a.state||a.country)&&(c=d.length>0?"leaflet-control-geocoder-address-context":"",d.push('{state} {country}')),hc(d.join("
"),a)}},Z.Util.setOptions(this,i||{})}geocode(i,s,a){let c=pt(this.options,{q:i,limit:5,format:"json",addressdetails:1});We(this.options.serviceUrl+"search",c,d=>{let m=[];for(let h=d.length-1;h>=0;h--){let p=d[h].boundingbox;for(let v=0;v<4;v++)p[v]=+p[v];m[h]={icon:d[h].icon,name:d[h].display_name,html:this.options.htmlTemplate?this.options.htmlTemplate(d[h]):void 0,bbox:Z.latLngBounds([p[0],p[2]],[p[1],p[3]]),center:Z.latLng(d[h].lat,d[h].lon),properties:d[h]}}s.call(a,m)})}reverse(i,s,a,c){let d=kt(this.options,{lat:i.lat,lon:i.lng,zoom:Math.round(Math.log(s/256)/Math.log(2)),addressdetails:1,format:"json"});We(this.options.serviceUrl+"reverse",d,m=>{let h=[];if(m&&m.lat&&m.lon){let p=Z.latLng(m.lat,m.lon),v=Z.latLngBounds(p,p);h.push({name:m.display_name,html:this.options.htmlTemplate?this.options.htmlTemplate(m):void 0,center:p,bbox:v,properties:m})}a.call(c,h)})}};Ii=class{constructor(i){Z.Util.setOptions(this,i)}geocode(i,s,a){try{let c=this.options.OpenLocationCode.decode(i),d={name:i,center:Z.latLng(c.latitudeCenter,c.longitudeCenter),bbox:Z.latLngBounds(Z.latLng(c.latitudeLo,c.longitudeLo),Z.latLng(c.latitudeHi,c.longitudeHi))};s.call(a,[d])}catch(c){console.warn(c),s.call(a,[])}}reverse(i,s,a,c){try{let m={name:this.options.OpenLocationCode.encode(i.lat,i.lng,this.options.codeLength),center:Z.latLng(i.lat,i.lng),bbox:Z.latLngBounds(Z.latLng(i.lat,i.lng),Z.latLng(i.lat,i.lng))};a.call(c,[m])}catch(d){console.warn(d),a.call(c,[])}}};ji=class{constructor(i){this.options={serviceUrl:"https://api.opencagedata.com/geocode/v1/json"},Z.Util.setOptions(this,i)}geocode(i,s,a){let c=pt(this.options,{key:this.options.apiKey,q:i});We(this.options.serviceUrl,c,d=>{let m=[];if(d.results&&d.results.length)for(let h=0;h{let h=[];if(m.results&&m.results.length)for(let p=0;p{s.call(a,this._parseResults(d,"bbox"))})}suggest(i,s,a){let c=pt(this.options,{api_key:this.options.apiKey,text:i});We(this.options.serviceUrl+"/autocomplete",c,d=>{d.geocoding.timestamp>this._lastSuggest&&(this._lastSuggest=d.geocoding.timestamp,s.call(a,this._parseResults(d,"bbox")))})}reverse(i,s,a,c){let d=kt(this.options,{api_key:this.options.apiKey,"point.lat":i.lat,"point.lon":i.lng});We(this.options.serviceUrl+"/reverse",d,m=>{a.call(c,this._parseResults(m,"bounds"))})}_parseResults(i,s){let a=[];return Z.geoJSON(i,{pointToLayer:function(c,d){return Z.circleMarker(d)},onEachFeature:function(c,d){let m={},h,p;d.getBounds?(h=d.getBounds(),p=h.getCenter()):d.feature.bbox?(p=d.getLatLng(),h=Z.latLngBounds(Z.GeoJSON.coordsToLatLng(d.feature.bbox.slice(0,2)),Z.GeoJSON.coordsToLatLng(d.feature.bbox.slice(2,4)))):(p=d.getLatLng(),h=Z.latLngBounds(p,p)),m.name=d.feature.properties.label,m.center=p,m[s]=h,m.properties=d.feature.properties,a.push(m)}}),a}};Lc=jn,Ec=Lr,Ac=jn,Bc=Lr,Ni=class extends jn{constructor(i){super(Z.Util.extend({serviceUrl:"https://api.openrouteservice.org/geocode"},i))}};Ui=class{constructor(i){this.options={serviceUrl:"https://photon.komoot.io/api/",reverseUrl:"https://photon.komoot.io/reverse/",nameProperties:["name","street","suburb","hamlet","town","city","state","country"]},Z.Util.setOptions(this,i)}geocode(i,s,a){let c=pt(this.options,{q:i});We(this.options.serviceUrl,c,Z.Util.bind(function(d){s.call(a,this._decodeFeatures(d))},this))}suggest(i,s,a){return this.geocode(i,s,a)}reverse(i,s,a,c){let d=kt(this.options,{lat:i.lat,lon:i.lng});We(this.options.reverseUrl,d,Z.Util.bind(function(m){a.call(c,this._decodeFeatures(m))},this))}_decodeFeatures(i){let s=[];if(i&&i.features)for(let a=0;ai.properties[s]).filter(s=>!!s).join(", ")}};Gi=class{constructor(i){this.options={serviceUrl:"https://api.what3words.com/v2/"},Z.Util.setOptions(this,i)}geocode(i,s,a){We(this.options.serviceUrl+"forward",pt(this.options,{key:this.options.apiKey,addr:i.split(/\s+/).join(".")}),c=>{let d=[];if(c.geometry){let m=Z.latLng(c.geometry.lat,c.geometry.lng),h=Z.latLngBounds(m,m);d[0]={name:c.words,bbox:h,center:m}}s.call(a,d)})}suggest(i,s,a){return this.geocode(i,s,a)}reverse(i,s,a,c){We(this.options.serviceUrl+"reverse",kt(this.options,{key:this.options.apiKey,coords:[i.lat,i.lng].join(",")}),d=>{let m=[];if(d.status.status==200){let h=Z.latLng(d.geometry.lat,d.geometry.lng),p=Z.latLngBounds(h,h);m[0]={name:d.words,bbox:p,center:h}}a.call(c,m)})}};rs={__proto__:null,geocodingParams:pt,reverseParams:kt,ArcGis:Bi,arcgis:bc,Bing:Di,bing:pc,Google:Mi,google:gc,HERE:Pi,HEREv2:Si,here:Fc,parseLatLng:is,LatLng:Ti,latLng:vc,Mapbox:Oi,mapbox:_c,MapQuest:Ri,mapQuest:yc,Neutrino:zi,neutrino:kc,Nominatim:Io,nominatim:wc,OpenLocationCode:Ii,openLocationCode:xc,OpenCage:ji,opencage:Cc,Pelias:jn,pelias:Lr,GeocodeEarth:Lc,geocodeEarth:Ec,Mapzen:Ac,mapzen:Bc,Openrouteservice:Ni,openrouteservice:Dc,Photon:Ui,photon:Mc,What3Words:Gi,what3words:Pc},jo=class{constructor(...i){}};Z.Util.extend(jo.prototype,Z.Control.prototype);Z.Util.extend(jo.prototype,Z.Evented.prototype);Nn=class extends jo{constructor(i){super(i),this.options={showUniqueResult:!0,showResultIcons:!1,collapsed:!0,expand:"touch",position:"topright",placeholder:"Search...",errorMessage:"Nothing found.",iconLabel:"Initiate a new search",query:"",queryMinLength:1,suggestMinLength:3,suggestTimeout:250,defaultMarkGeocode:!0},this._requestCount=0,Z.Util.setOptions(this,i),this.options.geocoder||(this.options.geocoder=new Io)}addThrobberClass(){Z.DomUtil.addClass(this._container,"leaflet-control-geocoder-throbber")}removeThrobberClass(){Z.DomUtil.removeClass(this._container,"leaflet-control-geocoder-throbber")}onAdd(i){let s="leaflet-control-geocoder",a=Z.DomUtil.create("div",s+" leaflet-bar"),c=Z.DomUtil.create("button",s+"-icon",a),d=this._form=Z.DomUtil.create("div",s+"-form",a);this._map=i,this._container=a,c.innerHTML=" ",c.type="button",c.setAttribute("aria-label",this.options.iconLabel);let m=this._input=Z.DomUtil.create("input","",d);return m.type="text",m.value=this.options.query,m.placeholder=this.options.placeholder,Z.DomEvent.disableClickPropagation(m),this._errorElement=Z.DomUtil.create("div",s+"-form-no-error",a),this._errorElement.innerHTML=this.options.errorMessage,this._alts=Z.DomUtil.create("ul",s+"-alternatives leaflet-control-geocoder-alternatives-minimized",a),Z.DomEvent.disableClickPropagation(this._alts),Z.DomEvent.addListener(m,"keydown",this._keydown,this),this.options.geocoder.suggest&&Z.DomEvent.addListener(m,"input",this._change,this),Z.DomEvent.addListener(m,"blur",()=>{this.options.collapsed&&!this._preventBlurCollapse&&this._collapse(),this._preventBlurCollapse=!1}),this.options.collapsed?this.options.expand==="click"?Z.DomEvent.addListener(a,"click",h=>{h.button===0&&h.detail!==2&&this._toggle()}):this.options.expand==="touch"?Z.DomEvent.addListener(a,Z.Browser.touch?"touchstart mousedown":"mousedown",h=>{this._toggle(),h.preventDefault(),h.stopPropagation()},this):(Z.DomEvent.addListener(a,"mouseover",this._expand,this),Z.DomEvent.addListener(a,"mouseout",this._collapse,this),this._map.on("movestart",this._collapse,this)):(this._expand(),Z.Browser.touch?Z.DomEvent.addListener(a,"touchstart",()=>this._geocode()):Z.DomEvent.addListener(a,"click",()=>this._geocode())),this.options.defaultMarkGeocode&&this.on("markgeocode",this.markGeocode,this),this.on("startgeocode",this.addThrobberClass,this),this.on("finishgeocode",this.removeThrobberClass,this),this.on("startsuggest",this.addThrobberClass,this),this.on("finishsuggest",this.removeThrobberClass,this),Z.DomEvent.disableClickPropagation(a),a}setQuery(i){return this._input.value=i,this}_geocodeResult(i,s){if(!s&&this.options.showUniqueResult&&i.length===1)this._geocodeResultSelected(i[0]);else if(i.length>0){this._alts.innerHTML="",this._results=i,Z.DomUtil.removeClass(this._alts,"leaflet-control-geocoder-alternatives-minimized"),Z.DomUtil.addClass(this._container,"leaflet-control-geocoder-options-open");for(let a=0;a{if(a===this._requestCount){let h={input:s,results:m};this.fire(i?"finishsuggest":"finishgeocode",h),this._geocodeResult(m,i)}};this._lastGeocode=s,i||this._clearResults();let d={input:s};this.fire(i?"startsuggest":"startgeocode",d),i?this.options.geocoder.suggest(s,c):this.options.geocoder.geocode(s,c)}_geocodeResultSelected(i){let s={geocode:i};this.fire("markgeocode",s)}_toggle(){Z.DomUtil.hasClass(this._container,"leaflet-control-geocoder-expanded")?this._collapse():this._expand()}_expand(){Z.DomUtil.addClass(this._container,"leaflet-control-geocoder-expanded"),this._input.select(),this.fire("expand")}_collapse(){Z.DomUtil.removeClass(this._container,"leaflet-control-geocoder-expanded"),Z.DomUtil.addClass(this._alts,"leaflet-control-geocoder-alternatives-minimized"),Z.DomUtil.removeClass(this._errorElement,"leaflet-control-geocoder-error"),Z.DomUtil.removeClass(this._container,"leaflet-control-geocoder-options-open"),Z.DomUtil.removeClass(this._container,"leaflet-control-geocoder-options-error"),this._input.blur(),this.fire("collapse")}_clearResults(){Z.DomUtil.addClass(this._alts,"leaflet-control-geocoder-alternatives-minimized"),this._selection=null,Z.DomUtil.removeClass(this._errorElement,"leaflet-control-geocoder-error"),Z.DomUtil.removeClass(this._container,"leaflet-control-geocoder-options-open"),Z.DomUtil.removeClass(this._container,"leaflet-control-geocoder-options-error")}_createAlt(i,s){let a=Z.DomUtil.create("li",""),c=Z.DomUtil.create("a","",a),d=this.options.showResultIcons&&i.icon?Z.DomUtil.create("img","",c):null,m=i.html?void 0:document.createTextNode(i.name),h=p=>{this._preventBlurCollapse=!0,Z.DomEvent.stop(p),this._geocodeResultSelected(i),Z.DomEvent.on(a,"click touchend",()=>{this.options.collapsed?this._collapse():this._clearResults()})};return d&&(d.src=i.icon),a.setAttribute("data-result-index",String(s)),i.html?c.innerHTML=c.innerHTML+i.html:m&&c.appendChild(m),Z.DomEvent.addListener(a,"mousedown touchstart",h,this),a}_keydown(i){let s=a=>{this._selection&&(Z.DomUtil.removeClass(this._selection,"leaflet-control-geocoder-selected"),this._selection=this._selection[a>0?"nextSibling":"previousSibling"]),this._selection||(this._selection=this._alts[a>0?"firstChild":"lastChild"]),this._selection&&Z.DomUtil.addClass(this._selection,"leaflet-control-geocoder-selected")};switch(i.keyCode){case 27:this.options.collapsed?this._collapse():this._clearResults();break;case 38:s(-1);break;case 40:s(1);break;case 13:if(this._selection){let a=parseInt(this._selection.getAttribute("data-result-index"),10);this._geocodeResultSelected(this._results[a]),this._clearResults()}else this._geocode();break;default:return}Z.DomEvent.preventDefault(i)}_change(){let i=this._input.value;i!==this._lastGeocode&&(clearTimeout(this._suggestTimeout),i.length>=this.options.suggestMinLength?this._suggestTimeout=setTimeout(()=>this._geocode(!0),this.options.suggestTimeout):this._clearResults())}};Z.Util.extend(Nn,rs);Z.Util.extend(Z.Control,{Geocoder:Nn,geocoder:as});Sc=Nn});var cs=ma(()=>{(()=>{var t={9705:(a,c,d)=>{"use strict";var m=d(1540);function h(p){var v=[1/0,1/0,-1/0,-1/0];return m.coordEach(p,function(y){v[0]>y[0]&&(v[0]=y[0]),v[1]>y[1]&&(v[1]=y[1]),v[2]{"use strict";function d(I,q,V){V===void 0&&(V={});var E={type:"Feature"};return(V.id===0||V.id)&&(E.id=V.id),V.bbox&&(E.bbox=V.bbox),E.properties=q||{},E.geometry=I,E}function m(I,q,V){if(V===void 0&&(V={}),!I)throw new Error("coordinates is required");if(!Array.isArray(I))throw new Error("coordinates must be an Array");if(I.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!J(I[0])||!J(I[1]))throw new Error("coordinates must contain numbers");return d({type:"Point",coordinates:I},q,V)}function h(I,q,V){V===void 0&&(V={});for(var E=0,z=I;E=0))throw new Error("precision must be a positive number");var V=Math.pow(10,q||0);return Math.round(I*V)/V},c.radiansToLength=$,c.lengthToRadians=N,c.lengthToDegrees=function(I,q){return O(N(I,q))},c.bearingToAzimuth=function(I){var q=I%360;return q<0&&(q+=360),q},c.radiansToDegrees=O,c.degreesToRadians=function(I){return I%360*Math.PI/180},c.convertLength=function(I,q,V){if(q===void 0&&(q="kilometers"),V===void 0&&(V="kilometers"),!(I>=0))throw new Error("length must be a positive number");return $(N(I,q),V)},c.convertArea=function(I,q,V){if(q===void 0&&(q="meters"),V===void 0&&(V="kilometers"),!(I>=0))throw new Error("area must be a positive number");var E=c.areaFactors[q];if(!E)throw new Error("invalid original units");var z=c.areaFactors[V];if(!z)throw new Error("invalid final units");return I/E*z},c.isNumber=J,c.isObject=function(I){return!!I&&I.constructor===Object},c.validateBBox=function(I){if(!I)throw new Error("bbox is required");if(!Array.isArray(I))throw new Error("bbox must be an Array");if(I.length!==4&&I.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");I.forEach(function(q){if(!J(q))throw new Error("bbox must only contain numbers")})},c.validateId=function(I){if(!I)throw new Error("id is required");if(["string","number"].indexOf(typeof I)===-1)throw new Error("id must be a number or a string")}},1540:(a,c,d)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var m=d(4102);function h(N,O,J){if(N!==null)for(var I,q,V,E,z,H,re,le,U=0,ee=0,ce=N.type,de=ce==="FeatureCollection",pe=ce==="Feature",Ce=de?N.features.length:1,_e=0;_eH||de>re||pe>le)return z=U,H=I,re=de,le=pe,void(V=0);var Ce=m.lineString([z,U],J.properties);if(O(Ce,I,q,pe,V)===!1)return!1;V++,z=U})!==!1&&void 0}}})}function $(N,O){if(!N)throw new Error("geojson is required");R(N,function(J,I,q){if(J.geometry!==null){var V=J.geometry.type,E=J.geometry.coordinates;switch(V){case"LineString":if(O(J,I,q,0,0)===!1)return!1;break;case"Polygon":for(var z=0;z{"use strict";d(7107);var m=d(2492),h=d.n(m);let p=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"}}'),v=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"}}'),y=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"}}`),R=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"}}'),G=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"}}'),$=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"}}'),N=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"}}'),O=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"}}'),J=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"}}`),I=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"}}'),q=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"}}'),V={en:p,de:v,it:y,id:R,ro:G,ru:$,es:N,nl:O,fr:J,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:I,zh_tw:q,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 E(n,r){var f=Object.keys(n);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(n);r&&(b=b.filter(function(F){return Object.getOwnPropertyDescriptor(n,F).enumerable})),f.push.apply(f,b)}return f}function z(n){for(var r=1;r0&&arguments[0]!==void 0?arguments[0]:this.globalOptions;this.globalEditModeEnabled()?this.disableGlobalEditMode():this.enableGlobalEditMode(n)},handleLayerAdditionInGlobalEditMode:function(){var n=this._addedLayers;for(var r in this._addedLayers={},n){var f=n[r];this._isRelevantForEdit(f)&&this.globalEditModeEnabled()&&f.pm.enable(z({},this.globalOptions))}},_layerAdded:function(n){var r=n.layer;this._addedLayers[L.stamp(r)]=r},_isRelevantForEdit:function(n){return n.pm&&!(n instanceof L.LayerGroup)&&(!L.PM.optIn&&!n.options.pmIgnore||L.PM.optIn&&n.options.pmIgnore===!1)&&!n._pmTempLayer&&n.pm.options.allowEditing}},le={_globalDragModeEnabled:!1,enableGlobalDragMode:function(){var n=L.PM.Utils.findLayers(this.map);this._globalDragModeEnabled=!0,this._addedLayersDrag={},n.forEach(function(r){r.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 n=L.PM.Utils.findLayers(this.map);this._globalDragModeEnabled=!1,n.forEach(function(r){r.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 n=this._addedLayersDrag;for(var r in this._addedLayersDrag={},n){var f=n[r];this._isRelevantForDrag(f)&&this.globalDragModeEnabled()&&f.pm.enableLayerDrag()}},_layerAddedDrag:function(n){var r=n.layer;this._addedLayersDrag[L.stamp(r)]=r},_isRelevantForDrag:function(n){return n.pm&&!(n instanceof L.LayerGroup)&&(!L.PM.optIn&&!n.options.pmIgnore||L.PM.optIn&&n.options.pmIgnore===!1)&&!n._pmTempLayer&&n.pm.options.draggable}},U={_globalRemovalModeEnabled:!1,enableGlobalRemovalMode:function(){var n=this;this._globalRemovalModeEnabled=!0,this.map.eachLayer(function(r){n._isRelevantForRemoval(r)&&(r.pm.disable(),r.on("click",n.removeLayer,n))}),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 n=this;this._globalRemovalModeEnabled=!1,this.map.eachLayer(function(r){r.off("click",n.removeLayer,n)}),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(n){var r=n.layer;this._isRelevantForRemoval(r)&&this.globalRemovalModeEnabled()&&(this.disableGlobalRemovalMode(),this.enableGlobalRemovalMode())},removeLayer:function(n){var r=n.target;this._isRelevantForRemoval(r)&&!r.pm.dragging()&&(r.removeFrom(this.map.pm._getContainingLayer()),r.remove(),r instanceof L.LayerGroup?(this._fireRemoveLayerGroup(r),this._fireRemoveLayerGroup(this.map,r)):(r.pm._fireRemove(r),r.pm._fireRemove(this.map,r)))},_isRelevantForRemoval:function(n){return n.pm&&!(n instanceof L.LayerGroup)&&(!L.PM.optIn&&!n.options.pmIgnore||L.PM.optIn&&n.options.pmIgnore===!1)&&!n._pmTempLayer&&n.pm.options.allowRemoval}},ee={_globalRotateModeEnabled:!1,enableGlobalRotateMode:function(){var n=this;this._globalRotateModeEnabled=!0,L.PM.Utils.findLayers(this.map).filter(function(r){return r instanceof L.Polyline}).forEach(function(r){n._isRelevantForRotate(r)&&r.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(n){return n instanceof L.Polyline}).forEach(function(n){n.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(n){var r=n.layer;this._isRelevantForRotate(r)&&this.globalRotateModeEnabled()&&(this.disableGlobalRotateMode(),this.enableGlobalRotateMode())},_isRelevantForRotate:function(n){return n.pm&&!(n instanceof L.LayerGroup)&&(!L.PM.optIn&&!n.options.pmIgnore||L.PM.optIn&&n.options.pmIgnore===!1)&&!n._pmTempLayer&&n.pm.options.allowRotation}};function ce(n,r){var f=Object.keys(n);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(n);r&&(b=b.filter(function(F){return Object.getOwnPropertyDescriptor(n,F).enumerable})),f.push.apply(f,b)}return f}function de(n){for(var r=1;r0&&arguments[0]!==void 0?arguments[0]:"Draw",r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.__fire(this._map,"pm:drawstart",{shape:this._shape,workingLayer:this._layer},n,r)},_fireDrawEnd:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"Draw",r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.__fire(this._map,"pm:drawend",{shape:this._shape},n,r)},_fireCreate:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Draw",f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.__fire(this._map,"pm:create",{shape:this._shape,marker:n,layer:n},r,f)},_fireCenterPlaced:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"Draw",r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},f=n==="Draw"?this._layer:void 0,b=n!=="Draw"?this._layer:void 0;this.__fire(this._layer,"pm:centerplaced",{shape:this._shape,workingLayer:f,layer:b,latlng:this._layer.getLatLng()},n,r)},_fireCut:function(n,r,f){var b=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"Draw",F=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{};this.__fire(n,"pm:cut",{shape:this._shape,layer:r,originalLayer:f},b,F)},_fireEdit:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this._layer,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Edit",f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.__fire(n,"pm:edit",{layer:this._layer,shape:this.getShape()},r,f)},_fireEnable:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"Edit",r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.__fire(this._layer,"pm:enable",{layer:this._layer,shape:this.getShape()},n,r)},_fireDisable:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"Edit",r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.__fire(this._layer,"pm:disable",{layer:this._layer,shape:this.getShape()},n,r)},_fireUpdate:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"Edit",r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.__fire(this._layer,"pm:update",{layer:this._layer,shape:this.getShape()},n,r)},_fireMarkerDragStart:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"Edit",b=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};this.__fire(this._layer,"pm:markerdragstart",{layer:this._layer,markerEvent:n,shape:this.getShape(),indexPath:r},f,b)},_fireMarkerDrag:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"Edit",b=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};this.__fire(this._layer,"pm:markerdrag",{layer:this._layer,markerEvent:n,shape:this.getShape(),indexPath:r},f,b)},_fireMarkerDragEnd:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,b=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"Edit",F=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{};this.__fire(this._layer,"pm:markerdragend",{layer:this._layer,markerEvent:n,shape:this.getShape(),indexPath:r,intersectionReset:f},b,F)},_fireDragStart:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"Edit",r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.__fire(this._layer,"pm:dragstart",{layer:this._layer,shape:this.getShape()},n,r)},_fireDrag:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Edit",f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.__fire(this._layer,"pm:drag",de(de({},n),{},{shape:this.getShape()}),r,f)},_fireDragEnd:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"Edit",r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.__fire(this._layer,"pm:dragend",{layer:this._layer,shape:this.getShape()},n,r)},_fireDragEnable:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"Edit",r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.__fire(this._layer,"pm:dragenable",{layer:this._layer,shape:this.getShape()},n,r)},_fireDragDisable:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"Edit",r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.__fire(this._layer,"pm:dragdisable",{layer:this._layer,shape:this.getShape()},n,r)},_fireRemove:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n,f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"Edit",b=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};this.__fire(n,"pm:remove",{layer:r,shape:this.getShape()},f,b)},_fireVertexAdded:function(n,r,f){var b=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"Edit",F=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{};this.__fire(this._layer,"pm:vertexadded",{layer:this._layer,workingLayer:this._layer,marker:n,indexPath:r,latlng:f,shape:this.getShape()},b,F)},_fireVertexRemoved:function(n,r){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"Edit",b=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};this.__fire(this._layer,"pm:vertexremoved",{layer:this._layer,marker:n,indexPath:r,shape:this.getShape()},f,b)},_fireVertexClick:function(n,r){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"Edit",b=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};this.__fire(this._layer,"pm:vertexclick",{layer:this._layer,markerEvent:n,indexPath:r,shape:this.getShape()},f,b)},_fireIntersect:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Edit",f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.__fire(this._layer,"pm:intersect",{layer:this._layer,intersection:n,shape:this.getShape()},r,f)},_fireLayerReset:function(n,r){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"Edit",b=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};this.__fire(this._layer,"pm:layerreset",{layer:this._layer,markerEvent:n,indexPath:r,shape:this.getShape()},f,b)},_fireChange:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Edit",f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.__fire(this._layer,"pm:change",{layer:this._layer,latlngs:n,shape:this.getShape()},r,f)},_fireTextChange:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Edit",f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.__fire(this._layer,"pm:textchange",{layer:this._layer,text:n,shape:this.getShape()},r,f)},_fireTextFocus:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"Edit",r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.__fire(this._layer,"pm:textfocus",{layer:this._layer,shape:this.getShape()},n,r)},_fireTextBlur:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"Edit",r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.__fire(this._layer,"pm:textblur",{layer:this._layer,shape:this.getShape()},n,r)},_fireSnapDrag:function(n,r){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"Snapping",b=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};this.__fire(n,"pm:snapdrag",r,f,b)},_fireSnap:function(n,r){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"Snapping",b=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};this.__fire(n,"pm:snap",r,f,b)},_fireUnsnap:function(n,r){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"Snapping",b=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};this.__fire(n,"pm:unsnap",r,f,b)},_fireRotationEnable:function(n,r){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"Rotation",b=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};this.__fire(n,"pm:rotateenable",{layer:this._layer,helpLayer:this._rotatePoly,shape:this.getShape()},f,b)},_fireRotationDisable:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Rotation",f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.__fire(n,"pm:rotatedisable",{layer:this._layer,shape:this.getShape()},r,f)},_fireRotationStart:function(n,r){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"Rotation",b=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};this.__fire(n,"pm:rotatestart",{layer:this._rotationLayer,helpLayer:this._layer,startAngle:this._startAngle,originLatLngs:r},f,b)},_fireRotation:function(n,r,f){var b=arguments.length>3&&arguments[3]!==void 0?arguments[3]:this._rotationLayer,F=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"Rotation",x=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};this.__fire(n,"pm:rotate",{layer:b,helpLayer:this._layer,startAngle:this._startAngle,angle:b.pm.getAngle(),angleDiff:r,oldLatLngs:f,newLatLngs:b.getLatLngs()},F,x)},_fireRotationEnd:function(n,r,f){var b=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"Rotation",F=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{};this.__fire(n,"pm:rotateend",{layer:this._rotationLayer,helpLayer:this._layer,startAngle:r,angle:this._rotationLayer.pm.getAngle(),originLatLngs:f,newLatLngs:this._rotationLayer.getLatLngs()},b,F)},_fireActionClick:function(n,r,f){var b=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"Toolbar",F=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{};this.__fire(this._map,"pm:actionclick",{text:n.text,action:n,btnName:r,button:f},b,F)},_fireButtonClick:function(n,r){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"Toolbar",b=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};this.__fire(this._map,"pm:buttonclick",{btnName:n,button:r},f,b)},_fireLangChange:function(n,r,f,b){var F=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"Global",x=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};this.__fire(this.map,"pm:langchange",{oldLang:n,activeLang:r,fallback:f,translations:b},F,x)},_fireGlobalDragModeToggled:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Global",f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.__fire(this.map,"pm:globaldragmodetoggled",{enabled:n,map:this.map},r,f)},_fireGlobalEditModeToggled:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Global",f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.__fire(this.map,"pm:globaleditmodetoggled",{enabled:n,map:this.map},r,f)},_fireGlobalRemovalModeToggled:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Global",f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.__fire(this.map,"pm:globalremovalmodetoggled",{enabled:n,map:this.map},r,f)},_fireGlobalCutModeToggled:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"Global",r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.__fire(this._map,"pm:globalcutmodetoggled",{enabled:!!this._enabled,map:this._map},n,r)},_fireGlobalDrawModeToggled:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"Global",r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.__fire(this._map,"pm:globaldrawmodetoggled",{enabled:this._enabled,shape:this._shape,map:this._map},n,r)},_fireGlobalRotateModeToggled:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"Global",r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.__fire(this.map,"pm:globalrotatemodetoggled",{enabled:this.globalRotateModeEnabled(),map:this.map},n,r)},_fireRemoveLayerGroup:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n,f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"Edit",b=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};this.__fire(n,"pm:remove",{layer:r,shape:void 0},f,b)},_fireKeyeventEvent:function(n,r,f){var b=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"Global",F=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{};this.__fire(this.map,"pm:keyevent",{event:n,eventType:r,focusOn:f},b,F)},__fire:function(n,r,f,b){var F=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{};f=h()(f,F,{source:b}),L.PM.Utils._fireEvent(n,r,f)}};let _e=Ce,me={_lastEvents:{keydown:void 0,keyup:void 0,current:void 0},_initKeyListener:function(n){this.map=n,L.DomEvent.on(document,"keydown keyup",this._onKeyListener,this),L.DomEvent.on(window,"blur",this._onBlur,this)},_onKeyListener:function(n){var r="document";this.map.getContainer().contains(n.target)&&(r="map");var f={event:n,eventType:n.type,focusOn:r};this._lastEvents[n.type]=f,this._lastEvents.current=f,this.map.pm._fireKeyeventEvent(n,n.type,r)},_onBlur:function(n){n.altKey=!1;var r={event:n,eventType:n.type,focusOn:"document"};this._lastEvents[n.type]=r,this._lastEvents.current=r},getLastKeyEvent:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"current";return this._lastEvents[n]},isShiftKeyPressed:function(){var n;return(n=this._lastEvents.current)===null||n===void 0?void 0:n.event.shiftKey},isAltKeyPressed:function(){var n;return(n=this._lastEvents.current)===null||n===void 0?void 0:n.event.altKey},isCtrlKeyPressed:function(){var n;return(n=this._lastEvents.current)===null||n===void 0?void 0:n.event.ctrlKey},isMetaKeyPressed:function(){var n;return(n=this._lastEvents.current)===null||n===void 0?void 0:n.event.metaKey},getPressedKey:function(){var n;return(n=this._lastEvents.current)===null||n===void 0?void 0:n.event.key}};var ve=d(7361),te=d.n(ve),ge=d(8721),ye=d.n(ge);function ue(n){var r=L.PM.activeLang;return ye()(V,r)||(r="en"),te()(V[r],n)}function we(n){for(var r=0;r1e-12;)b=Math.cos(2*Ie+an),Ko=an,an=ne/(B*$o)+Wn*(F=Math.sin(an))*(b+Wn/4*((x=Math.cos(an))*(2*b*b-1)-Wn/6*b*(4*F*F-3)*(4*b*b-3)));var Jn=je*F-Ue*x*Le,$i=Math.atan2(je*x+Ue*F*Le,(1-D)*Math.sqrt(it*it+Jn*Jn)),vt=D/16*Ft*(4+D*(4-3*Ft)),Ki=T+180*(Math.atan2(F*he,Ue*x-je*F*Le)-(1-vt)*D*it*(an+vt*F*(b+vt*x*(2*b*b-1))))/Q,Wo=180*$i/Q;return L.latLng(Ki,Wo)}function Qe(n,r,f,b){for(var F,x,A=!(arguments.length>4&&arguments[4]!==void 0)||arguments[4],B=[],D=0;D180?Ie-360:Ie<-180?Ie+360:Ie,L.latLng([je*T,Ie])}(r,F,b)}function Bt(n,r){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"asc";if(!r||Object.keys(r).length===0)return function(D,T){return D-T};for(var b,F=Object.keys(r),x=F.length-1,A={};x>=0;)b=F[x],A[b.toLowerCase()]=r[b],x-=1;function B(D){return D instanceof L.Marker?"Marker":D instanceof L.Circle?"Circle":D instanceof L.CircleMarker?"CircleMarker":D instanceof L.Rectangle?"Rectangle":D instanceof L.Polygon?"Polygon":D instanceof L.Polyline?"Line":void 0}return function(D,T){var K,ne;if(n==="instanceofShape"){if(K=B(D.layer).toLowerCase(),ne=B(T.layer).toLowerCase(),!K||!ne)return 0}else{if(!D.hasOwnProperty(n)||!T.hasOwnProperty(n))return 0;K=D[n].toLowerCase(),ne=T[n].toLowerCase()}var Q=K in A?A[K]:Number.MAX_SAFE_INTEGER,se=ne in A?A[ne]:Number.MAX_SAFE_INTEGER,he=0;return Qse&&(he=1),f==="desc"?-1*he:he}}function Ke(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n.getLatLngs();return n instanceof L.Polygon?L.polygon(r).getLatLngs():L.polyline(r).getLatLngs()}function wt(n,r){var f,b;if((f=r.options.crs)!==null&&f!==void 0&&(b=f.projection)!==null&&b!==void 0&&b.MAX_LATITUDE){var F,x,A=(F=r.options.crs)===null||F===void 0||(x=F.projection)===null||x===void 0?void 0:x.MAX_LATITUDE;n.lat=Math.max(Math.min(A,n.lat),-A)}return n}function lt(n){return n.options.renderer||n._map&&(n._map._getPaneRenderer(n.options.pane)||n._map.options.renderer||n._map._renderer)||n._renderer}let xn=L.Class.extend({includes:[re,le,U,ee,_e],initialize:function(n){this.map=n,this.Draw=new L.PM.Draw(n),this.Toolbar=new L.PM.Toolbar(n),this.Keyboard=me,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(n)},setLang:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"en",r=arguments.length>1?arguments[1]:void 0,f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"en",b=L.PM.activeLang;r&&(V[n]=h()(V[f],r)),L.PM.activeLang=n,this.map.pm.Toolbar.reinit(),this._fireLangChange(b,n,f,V[n])},addControls:function(n){this.Toolbar.addControls(n)},removeControls:function(){this.Toolbar.removeControls()},toggleControls:function(){this.Toolbar.toggleControls()},controlsVisible:function(){return this.Toolbar.isVisible},enableDraw:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"Polygon",r=arguments.length>1?arguments[1]:void 0;n==="Poly"&&(n="Polygon"),this.Draw.enable(n,r)},disableDraw:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"Polygon";n==="Poly"&&(n="Polygon"),this.Draw.disable(n)},setPathOptions:function(n){var r=this,f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},b=f.ignoreShapes||[],F=f.merge||!1;this.map.pm.Draw.shapes.forEach(function(x){b.indexOf(x)===-1&&r.map.pm.Draw[x].setPathOptions(n,F)})},getGlobalOptions:function(){return this.globalOptions},setGlobalOptions:function(n){var r=this,f=h()(this.globalOptions,n),b=!1;this.map.pm.Draw.CircleMarker.enabled()&&!!this.map.pm.Draw.CircleMarker.options.editable!=!!f.editable&&(this.map.pm.Draw.CircleMarker.disable(),b=!0),this.map.pm.Draw.shapes.forEach(function(F){r.map.pm.Draw[F].setOptions(f)}),b&&this.map.pm.Draw.CircleMarker.enable(),L.PM.Utils.findLayers(this.map).forEach(function(F){F.pm.setOptions(f)}),this.map.fire("pm:globaloptionschanged"),this.globalOptions=f,this.applyGlobalOptions()},applyGlobalOptions:function(){L.PM.Utils.findLayers(this.map).forEach(function(n){n.pm.enabled()&&n.pm.applyOptions()})},globalDrawModeEnabled:function(){return!!this.Draw.getActiveShape()},globalCutModeEnabled:function(){return!!this.Draw.Cut.enabled()},enableGlobalCutMode:function(n){return this.Draw.Cut.enable(n)},toggleGlobalCutMode:function(n){return this.Draw.Cut.toggle(n)},disableGlobalCutMode:function(){return this.Draw.Cut.disable()},getGeomanLayers:function(){var n=arguments.length>0&&arguments[0]!==void 0&&arguments[0],r=L.PM.Utils.findLayers(this.map);if(!n)return r;var f=L.featureGroup();return f._pmTempLayer=!0,r.forEach(function(b){f.addLayer(b)}),f},getGeomanDrawLayers:function(){var n=arguments.length>0&&arguments[0]!==void 0&&arguments[0],r=L.PM.Utils.findLayers(this.map).filter(function(b){return b._drawnByGeoman===!0});if(!n)return r;var f=L.featureGroup();return f._pmTempLayer=!0,r.forEach(function(b){f.addLayer(b)}),f},_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(n){this._touchEventCounter===0&&(L.DomEvent.on(n,"touchmove",this._canvasTouchMove,this),L.DomEvent.on(n,"touchstart touchend touchcancel",this._canvasTouchClick,this)),this._touchEventCounter+=1},_removeTouchEvents:function(n){this._touchEventCounter===1&&(L.DomEvent.off(n,"touchmove",this._canvasTouchMove,this),L.DomEvent.off(n,"touchstart touchend touchcancel",this._canvasTouchClick,this)),this._touchEventCounter=this._touchEventCounter<=1?0:this._touchEventCounter-1},_canvasTouchMove:function(n){lt(this.map)._onMouseMove(this._createMouseEvent("mousemove",n))},_canvasTouchClick:function(n){var r="";n.type==="touchstart"||n.type==="pointerdown"?r="mousedown":n.type==="touchend"||n.type==="pointerup"?r="mouseup":n.type!=="touchcancel"&&n.type!=="pointercancel"||(r="mouseup"),r&<(this.map)._onClick(this._createMouseEvent(r,n))},_createMouseEvent:function(n,r){var f,b=r.touches[0]||r.changedTouches[0];try{f=new MouseEvent(n,{bubbles:r.bubbles,cancelable:r.cancelable,view:r.view,detail:b.detail,screenX:b.screenX,screenY:b.screenY,clientX:b.clientX,clientY:b.clientY,ctrlKey:r.ctrlKey,altKey:r.altKey,shiftKey:r.shiftKey,metaKey:r.metaKey,button:r.button,relatedTarget:r.relatedTarget})}catch(F){(f=document.createEvent("MouseEvents")).initMouseEvent(n,r.bubbles,r.cancelable,r.view,b.detail,b.screenX,b.screenY,b.clientX,b.clientY,r.ctrlKey,r.altKey,r.shiftKey,r.metaKey,r.button,r.relatedTarget)}return f}}),Un=L.Control.extend({includes:[_e],options:{position:"topleft",disableByOtherButtons:!0},initialize:function(n){this._button=L.Util.extend({},this.options,n)},onAdd:function(n){return this._map=n,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(n){return this._button.toggleStatus=typeof n=="boolean"?n:!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(n){n&&n.preventDefault(),this._button.disabled||(this._button.onClick(n,{button:this,event:n}),this._clicked(n),this._button.afterClick(n,{button:this,event:n}))},_makeButton:function(n){var r=this,f=this.options.position.indexOf("right")>-1?"pos-right":"",b=L.DomUtil.create("div","button-container ".concat(f),this._container);n.title&&b.setAttribute("title",n.title);var F=L.DomUtil.create("a","leaflet-buttons-control-button",b);F.setAttribute("role","button"),F.setAttribute("tabindex","0"),F.href="#";var x=L.DomUtil.create("div","leaflet-pm-actions-container ".concat(f),b),A=n.actions,B={cancel:{text:ue("actions.cancel"),onClick:function(){this._triggerClick()}},finishMode:{text:ue("actions.finish"),onClick:function(){this._triggerClick()}},removeLastVertex:{text:ue("actions.removeLastVertex"),onClick:function(){this._map.pm.Draw[n.jsClass]._removeLastVertex()}},finish:{text:ue("actions.finish"),onClick:function(T){this._map.pm.Draw[n.jsClass]._finishShape(T)}}};A.forEach(function(T){var K,ne=typeof T=="string"?T:T.name;if(B[ne])K=B[ne];else{if(!T.text)return;K=T}var Q=L.DomUtil.create("a","leaflet-pm-action ".concat(f," action-").concat(ne),x);Q.setAttribute("role","button"),Q.setAttribute("tabindex","0"),Q.href="#",Q.innerHTML=K.text,L.DomEvent.disableClickPropagation(Q),L.DomEvent.on(Q,"click",L.DomEvent.stop),!n.disabled&&K.onClick&&(L.DomEvent.addListener(Q,"click",function(se){se.preventDefault();var he="",Le=r._map.pm.Toolbar.buttons;for(var be in Le)if(Le[be]._button===n){he=be;break}r._fireActionClick(K,he,n)},r),L.DomEvent.addListener(Q,"click",K.onClick,r))}),n.toggleStatus&&L.DomUtil.addClass(b,"active");var D=L.DomUtil.create("div","control-icon",F);return n.iconUrl&&D.setAttribute("src",n.iconUrl),n.className&&L.DomUtil.addClass(D,n.className),L.DomEvent.disableClickPropagation(F),L.DomEvent.on(F,"click",L.DomEvent.stop),n.disabled||(L.DomEvent.addListener(F,"click",this._onBtnClick,this),L.DomEvent.addListener(F,"click",this._triggerClick,this)),n.disabled&&(L.DomUtil.addClass(F,"pm-disabled"),F.setAttribute("aria-disabled","true")),b},_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 n="",r=this._map.pm.Toolbar.buttons;for(var f in r)if(r[f]._button===this._button){n=f;break}this._fireButtonClick(n,this._button)},_clicked:function(){this._button.doToggle&&this.toggle()},_updateDisabled:function(){if(this._container){var n="pm-disabled",r=this.buttonsDomNode.children[0];this._button.disabled?(L.DomUtil.addClass(r,n),r.setAttribute("aria-disabled","true"),L.DomEvent.off(r,"click",this._triggerClick,this),L.DomEvent.off(r,"click",this._onBtnClick,this)):(L.DomUtil.removeClass(r,n),r.setAttribute("aria-disabled","false"),L.DomEvent.on(r,"click",this._triggerClick,this),L.DomEvent.on(r,"click",this._onBtnClick,this))}}});function Cn(n,r){var f=Object.keys(n);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(n);r&&(b=b.filter(function(F){return Object.getOwnPropertyDescriptor(n,F).enumerable})),f.push.apply(f,b)}return f}function ct(n){for(var r=1;r0&&arguments[0]!==void 0?arguments[0]:this.options;typeof n.editPolygon!="undefined"&&(n.editMode=n.editPolygon),typeof n.deleteLayer!="undefined"&&(n.removalMode=n.deleteLayer),L.Util.setOptions(this,n),this.applyIconStyle(),this.isVisible=!0,this._showHideButtons()},applyIconStyle:function(){var n=this.getButtons(),r={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 f in n){var b=n[f];L.Util.setOptions(b,{className:r.geomanIcons[f]})}},removeControls:function(){var n=this.getButtons();for(var r in n)n[r].remove();this.isVisible=!1},toggleControls:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options;this.isVisible?this.removeControls():this.addControls(n)},_addButton:function(n,r){return this.buttons[n]=r,this.options[n]=this.options[n]||!1,this.buttons[n]},triggerClickOnToggledButtons:function(n){for(var r in this.buttons){var f=this.buttons[r];f._button.disableByOtherButtons&&f!==n&&f.toggled()&&f._triggerClick()}},toggleButton:function(n,r){var f=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];return n==="editPolygon"&&(n="editMode"),n==="deleteLayer"&&(n="removalMode"),f&&this.triggerClickOnToggledButtons(this.buttons[n]),!!this.buttons[n]&&this.buttons[n].toggle(r)},_defineButtons:function(){var n=this,r={className:"control-icon leaflet-pm-icon-marker",title:ue("buttonTitles.drawMarkerButton"),jsClass:"Marker",onClick:function(){},afterClick:function(se,he){n.map.pm.Draw[he.button._button.jsClass].toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["cancel"]},f={title:ue("buttonTitles.drawPolyButton"),className:"control-icon leaflet-pm-icon-polygon",jsClass:"Polygon",onClick:function(){},afterClick:function(se,he){n.map.pm.Draw[he.button._button.jsClass].toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["finish","removeLastVertex","cancel"]},b={className:"control-icon leaflet-pm-icon-polyline",title:ue("buttonTitles.drawLineButton"),jsClass:"Line",onClick:function(){},afterClick:function(se,he){n.map.pm.Draw[he.button._button.jsClass].toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["finish","removeLastVertex","cancel"]},F={title:ue("buttonTitles.drawCircleButton"),className:"control-icon leaflet-pm-icon-circle",jsClass:"Circle",onClick:function(){},afterClick:function(se,he){n.map.pm.Draw[he.button._button.jsClass].toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["cancel"]},x={title:ue("buttonTitles.drawCircleMarkerButton"),className:"control-icon leaflet-pm-icon-circle-marker",jsClass:"CircleMarker",onClick:function(){},afterClick:function(se,he){n.map.pm.Draw[he.button._button.jsClass].toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["cancel"]},A={title:ue("buttonTitles.drawRectButton"),className:"control-icon leaflet-pm-icon-rectangle",jsClass:"Rectangle",onClick:function(){},afterClick:function(se,he){n.map.pm.Draw[he.button._button.jsClass].toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["cancel"]},B={title:ue("buttonTitles.editButton"),className:"control-icon leaflet-pm-icon-edit",onClick:function(){},afterClick:function(){n.map.pm.toggleGlobalEditMode()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,tool:"edit",actions:["finishMode"]},D={title:ue("buttonTitles.dragButton"),className:"control-icon leaflet-pm-icon-drag",onClick:function(){},afterClick:function(){n.map.pm.toggleGlobalDragMode()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,tool:"edit",actions:["finishMode"]},T={title:ue("buttonTitles.cutButton"),className:"control-icon leaflet-pm-icon-cut",jsClass:"Cut",onClick:function(){},afterClick:function(se,he){n.map.pm.Draw[he.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"]},K={title:ue("buttonTitles.deleteButton"),className:"control-icon leaflet-pm-icon-delete",onClick:function(){},afterClick:function(){n.map.pm.toggleGlobalRemovalMode()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,tool:"edit",actions:["finishMode"]},ne={title:ue("buttonTitles.rotateButton"),className:"control-icon leaflet-pm-icon-rotate",onClick:function(){},afterClick:function(){n.map.pm.toggleGlobalRotateMode()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,tool:"edit",actions:["finishMode"]},Q={className:"control-icon leaflet-pm-icon-text",title:ue("buttonTitles.drawTextButton"),jsClass:"Text",onClick:function(){},afterClick:function(se,he){n.map.pm.Draw[he.button._button.jsClass].toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["cancel"]};this._addButton("drawMarker",new L.Control.PMButton(r)),this._addButton("drawPolyline",new L.Control.PMButton(b)),this._addButton("drawRectangle",new L.Control.PMButton(A)),this._addButton("drawPolygon",new L.Control.PMButton(f)),this._addButton("drawCircle",new L.Control.PMButton(F)),this._addButton("drawCircleMarker",new L.Control.PMButton(x)),this._addButton("drawText",new L.Control.PMButton(Q)),this._addButton("editMode",new L.Control.PMButton(B)),this._addButton("dragMode",new L.Control.PMButton(D)),this._addButton("cutPolygon",new L.Control.PMButton(T)),this._addButton("removalMode",new L.Control.PMButton(K)),this._addButton("rotateMode",new L.Control.PMButton(ne))},_showHideButtons:function(){if(this.isVisible){this.removeControls(),this.isVisible=!0;var n=this.getButtons(),r=[];for(var f in this.options.drawControls===!1&&(r=r.concat(Object.keys(n).filter(function(F){return!n[F]._button.tool}))),this.options.editControls===!1&&(r=r.concat(Object.keys(n).filter(function(F){return n[F]._button.tool==="edit"}))),this.options.optionsControls===!1&&(r=r.concat(Object.keys(n).filter(function(F){return n[F]._button.tool==="options"}))),this.options.customControls===!1&&(r=r.concat(Object.keys(n).filter(function(F){return n[F]._button.tool==="custom"}))),n)if(this.options[f]&&r.indexOf(f)===-1){var b=n[f]._button.tool;b||(b="draw"),n[f].setPosition(this._getBtnPosition(b)),n[f].addTo(this.map)}}},_getBtnPosition:function(n){return this.options.positions&&this.options.positions[n]?this.options.positions[n]:this.options.position},setBlockPosition:function(n,r){this.options.positions[n]=r,this._showHideButtons(),this.changeControlOrder()},getBlockPositions:function(){return this.options.positions},copyDrawControl:function(n,r){if(!r)throw new TypeError("Button has no name");qt(r)!=="object"&&(r={name:r});var f=this._btnNameMapping(n);if(!r.name)throw new TypeError("Button has no name");if(this.buttons[r.name])throw new TypeError("Button with this name already exists");var b=this.map.pm.Draw.createNewDrawInstance(r.name,f);return r=ct(ct({},this.buttons[f]._button),r),{drawInstance:b,control:this.createCustomControl(r)}},createCustomControl:function(n){var r,f;if(!n.name)throw new TypeError("Button has no name");if(this.buttons[n.name])throw new TypeError("Button with this name already exists");n.onClick||(n.onClick=function(){}),n.afterClick||(n.afterClick=function(){}),n.toggle!==!1&&(n.toggle=!0),n.block&&(n.block=n.block.toLowerCase()),n.block&&n.block!=="draw"||(n.block=""),n.className?n.className.indexOf("control-icon")===-1&&(n.className="control-icon ".concat(n.className)):n.className="control-icon";var b={tool:n.block,className:n.className,title:n.title||"",jsClass:n.name,onClick:n.onClick,afterClick:n.afterClick,doToggle:n.toggle,toggleStatus:!1,disableOtherButtons:(r=n.disableOtherButtons)===null||r===void 0||r,disableByOtherButtons:(f=n.disableByOtherButtons)===null||f===void 0||f,cssToggle:n.toggle,position:this.options.position,actions:n.actions||[],disabled:!!n.disabled};this.options[n.name]!==!1&&(this.options[n.name]=!0);var F=this._addButton(n.name,new L.Control.PMButton(b));return this.changeControlOrder(),F},changeControlOrder:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=this._shapeMapping(),f=[];n.forEach(function(T){r[T]?f.push(r[T]):f.push(T)});var b=this.getButtons(),F={};f.forEach(function(T){b[T]&&(F[T]=b[T])});var x=Object.keys(b).filter(function(T){return!b[T]._button.tool});x.forEach(function(T){f.indexOf(T)===-1&&(F[T]=b[T])});var A=Object.keys(b).filter(function(T){return b[T]._button.tool==="edit"});A.forEach(function(T){f.indexOf(T)===-1&&(F[T]=b[T])});var B=Object.keys(b).filter(function(T){return b[T]._button.tool==="options"});B.forEach(function(T){f.indexOf(T)===-1&&(F[T]=b[T])});var D=Object.keys(b).filter(function(T){return b[T]._button.tool==="custom"});D.forEach(function(T){f.indexOf(T)===-1&&(F[T]=b[T])}),Object.keys(b).forEach(function(T){f.indexOf(T)===-1&&(F[T]=b[T])}),this.map.pm.Toolbar.buttons=F,this._showHideButtons()},getControlOrder:function(){var n=this.getButtons(),r=[];for(var f in n)r.push(f);return r},changeActionsOfControl:function(n,r){var f=this._btnNameMapping(n);if(!f)throw new TypeError("No name passed");if(!r)throw new TypeError("No actions passed");if(!this.buttons[f])throw new TypeError("Button with this name not exists");this.buttons[f]._button.actions=r,this.changeControlOrder()},setButtonDisabled:function(n,r){var f=this._btnNameMapping(n);r?this.buttons[f].disable():this.buttons[f].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(n){var r=this._shapeMapping();return r[n]?r[n]:n}});function En(n,r){var f=Object.keys(n);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(n);r&&(b=b.filter(function(F){return Object.getOwnPropertyDescriptor(n,F).enumerable})),f.push.apply(f,b)}return f}function M(n){for(var r=1;r2&&arguments[2]!==void 0?arguments[2]:1,F=[],x={};r.forEach(function(B,D){if(!B._parentCopy||B._parentCopy!==f._layer){var T=f._calcLayerDistances(n,B);if(T.distance=Math.floor(T.distance),f.debugIndicatorLines){if(!f.debugIndicatorLines[D]){var K=L.polyline([],{color:"red",pmIgnore:!0});K._pmTempLayer=!0,f.debugIndicatorLines[D]=K}f.debugIndicatorLines[D].setLatLngs([n,T.latlng])}b===1&&(x.distance===void 0||T.distance<=x.distance)?(T.distance3&&arguments[3]!==void 0&&arguments[3],D=function K(ne){ne.forEach(function(Q,se){if(Array.isArray(Q))K(Q);else if(A.options.snapSegment){var he,Le=Q;he=B?se+1===ne.length?0:se+1:se+1===ne.length?void 0:se+1;var be=ne[he];if(be){var Ue=A._getDistanceToSegment(f,n,Le,be);(F===void 0||Ue1&&arguments[1]!==void 0?arguments[1]:1;n=n.sort(function(A,B){return A._leaflet_id-B._leaflet_id});var f=["Marker","CircleMarker","Circle","Line","Polygon","Rectangle"],b=this._map.pm.globalOptions.snappingOrder||[],F=0,x={};return b.concat(f).forEach(function(A){x[A]||(F+=1,x[A]=F)}),n.sort(Bt("instanceofShape",x)),r===1?n[0]||{}:n.slice(0,r)},_checkPrioritiySnapping:function(n){var r=this._map,f=n.segment[0],b=n.segment[1],F=n.latlng,x=this._getDistance(r,f,F),A=this._getDistance(r,b,F),B=x1&&arguments[1]!==void 0&&arguments[1];this.options.pathOptions=r?h()(this.options.pathOptions,n):n},getShapes:function(){return this.shapes},getShape:function(){return this._shape},enable:function(n,r){if(!n)throw new Error("Error: Please pass a shape as a parameter. Possible shapes are: ".concat(this.getShapes().join(",")));this.disable(),this[n].enable(r)},disable:function(){var n=this;this.shapes.forEach(function(r){n[r].disable()})},addControls:function(){var n=this;this.shapes.forEach(function(r){n[r].addButton()})},getActiveShape:function(){var n,r=this;return this.shapes.forEach(function(f){r[f]._enabled&&(n=f)}),n},_setGlobalDrawMode:function(){this._shape==="Cut"?this._fireGlobalCutModeToggled():this._fireGlobalDrawModeToggled();var n=L.PM.Utils.findLayers(this._map);this._enabled?n.forEach(function(r){L.PM.Utils.disablePopup(r)}):n.forEach(function(r){L.PM.Utils.enablePopup(r)})},createNewDrawInstance:function(n,r){var f=this._getShapeFromBtnName(r);if(this[n])throw new TypeError("Draw Type already exists");if(!L.PM.Draw[f])throw new TypeError("There is no class L.PM.Draw.".concat(f));return this[n]=new L.PM.Draw[f](this._map),this[n].toolbarButtonName=n,this[n]._shape=n,this.shapes.push(n),this[r]&&this[n].setOptions(this[r].options),this[n].setOptions(this[n].options),this[n]},_getShapeFromBtnName:function(n){var r={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 r[n]?r[n]:this[n]?this[n]._shape:n},_finishLayer:function(n){n.pm&&(n.pm.setOptions(this.options),n.pm._shape=this._shape,n.pm._map=this._map),this._addDrawnLayerProp(n)},_addDrawnLayerProp:function(n){n._drawnByGeoman=!0},_setPane:function(n,r){r==="layerPane"?n.options.pane=this._map.pm.globalOptions.panes&&this._map.pm.globalOptions.panes.layerPane||"overlayPane":r==="vertexPane"?n.options.pane=this._map.pm.globalOptions.panes&&this._map.pm.globalOptions.panes.vertexPane||"markerPane":r==="markerPane"&&(n.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}});S.Marker=S.extend({initialize:function(n){this._map=n,this._shape="Marker",this.toolbarButtonName="drawMarker"},enable:function(n){var r=this;L.Util.setOptions(this,n),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(ue("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(f){r.isRelevantMarker(f)&&f.pm.enable()}),this._fireDrawStart(),this._setGlobalDrawMode()},disable:function(){var n=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(r){n.isRelevantMarker(r)&&r.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(n){this.enabled()?this.disable():this.enable(n)},isRelevantMarker:function(n){return n instanceof L.Marker&&n.pm&&!n._pmTempLayer&&!n.pm._initTextMarker},_syncHintMarker:function(n){if(this._hintMarker.setLatLng(n.latlng),this.options.snappable){var r=n;r.target=this._hintMarker,this._handleSnapping(r)}this._fireChange(this._hintMarker.getLatLng(),"Draw")},_createMarker:function(n){if(n.latlng&&(!this.options.requireSnapToFinish||this._hintMarker._snapped||this._isFirstLayer())){this._hintMarker._snapped||this._hintMarker.setLatLng(n.latlng);var r=this._hintMarker.getLatLng(),f=new L.Marker(r,this.options.markerStyle);this._setPane(f,"markerPane"),this._finishLayer(f),f.pm||(f.options.draggable=!1),f.addTo(this._map.pm._getContainingLayer()),f.pm&&this.options.markerEditable?f.pm.enable():f.dragging&&f.dragging.disable(),this._fireCreate(f),this._cleanupSnapping(),this.options.continueDrawing||this.disable()}},setStyle:function(){var n,r;(n=this.options.markerStyle)!==null&&n!==void 0&&n.icon&&((r=this._hintMarker)===null||r===void 0||r.setIcon(this.options.markerStyle.icon))}});var j=63710088e-1,oe={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 ie(n,r,f){f===void 0&&(f={});var b={type:"Feature"};return(f.id===0||f.id)&&(b.id=f.id),f.bbox&&(b.bbox=f.bbox),b.properties=r||{},b.geometry=n,b}function fe(n,r,f){if(f===void 0&&(f={}),!n)throw new Error("coordinates is required");if(!Array.isArray(n))throw new Error("coordinates must be an Array");if(n.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!qe(n[0])||!qe(n[1]))throw new Error("coordinates must contain numbers");return ie({type:"Point",coordinates:n},r,f)}function xe(n,r,f){if(f===void 0&&(f={}),n.length<2)throw new Error("coordinates must be an array of two or more positions");return ie({type:"LineString",coordinates:n},r,f)}function De(n,r){r===void 0&&(r={});var f={type:"FeatureCollection"};return r.id&&(f.id=r.id),r.bbox&&(f.bbox=r.bbox),f.features=n,f}function Re(n,r){r===void 0&&(r="kilometers");var f=oe[r];if(!f)throw new Error(r+" units is invalid");return n*f}function Te(n,r){r===void 0&&(r="kilometers");var f=oe[r];if(!f)throw new Error(r+" units is invalid");return n/f}function Ne(n){return 180*(n%(2*Math.PI))/Math.PI}function Se(n){return n%360*Math.PI/180}function qe(n){return!isNaN(n)&&n!==null&&!Array.isArray(n)}function Ze(n){var r,f,b={type:"FeatureCollection",features:[]};if((f=n.type==="Feature"?n.geometry:n).type==="LineString")r=[f.coordinates];else if(f.type==="MultiLineString")r=f.coordinates;else if(f.type==="MultiPolygon")r=[].concat.apply([],f.coordinates);else{if(f.type!=="Polygon")throw new Error("Input must be a LineString, MultiLineString, Polygon, or MultiPolygon Feature or Geometry");r=f.coordinates}return r.forEach(function(F){r.forEach(function(x){for(var A=0;A=0&&T<=1&&(Q.onLine1=!0),K>=0&&K<=1&&(Q.onLine2=!0),!(!Q.onLine1||!Q.onLine2)&&[Q.x,Q.y])}function dt(n,r){var f=Object.keys(n);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(n);r&&(b=b.filter(function(F){return Object.getOwnPropertyDescriptor(n,F).enumerable})),f.push.apply(f,b)}return f}function rt(n){for(var r=1;r=2&&!Array.isArray(n[0])&&!Array.isArray(n[1]))return n;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Ye(n){if(Array.isArray(n))return n;if(n.type==="Feature"){if(n.geometry!==null)return n.geometry.coordinates}else if(n.coordinates)return n.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function Zt(n){return n.type==="Feature"?n.geometry:n}function No(n,r){return n.type==="FeatureCollection"?"FeatureCollection":n.type==="GeometryCollection"?"GeometryCollection":n.type==="Feature"&&n.geometry!==null?n.geometry.type:n.type}function co(n,r,f){if(n!==null)for(var b,F,x,A,B,D,T,K,ne=0,Q=0,se=n.type,he=se==="FeatureCollection",Le=se==="Feature",be=he?n.features.length:1,Ue=0;Ue0){var r=n[n.length-1];this._hintline.setLatLngs([r,this._hintMarker.getLatLng()])}},_syncHintMarker:function(n){if(this._hintMarker.setLatLng(n.latlng),this.options.snappable){var r=n;r.target=this._hintMarker,this._handleSnapping(r)}this.options.allowSelfIntersection||this._handleSelfIntersection(!0,this._hintMarker.getLatLng());var f=this._layer._defaultShape().slice();f.push(this._hintMarker.getLatLng()),this._change(f)},hasSelfIntersection:function(){return Ze(this._layer.toGeoJSON(15)).features.length>0},_handleSelfIntersection:function(n,r){var f=L.polyline(this._layer.getLatLngs());n&&(r||(r=this._hintMarker.getLatLng()),f.addLatLng(r));var b=Ze(f.toGeoJSON(15));this._doesSelfIntersect=b.features.length>0,this._doesSelfIntersect?this._hintline.setStyle({color:"#f00000ff"}):this._hintline.isEmpty()||this._hintline.setStyle(this.options.hintlineStyle)},_createVertex:function(n){if(this.options.allowSelfIntersection||(this._handleSelfIntersection(!0,n.latlng),!this._doesSelfIntersect)){this._hintMarker._snapped||this._hintMarker.setLatLng(n.latlng);var r=this._hintMarker.getLatLng(),f=this._layer.getLatLngs(),b=f[f.length-1];if(r.equals(f[0])||f.length>0&&r.equals(b))this._finishShape();else{this._layer._latlngInfo=this._layer._latlngInfo||[],this._layer._latlngInfo.push({latlng:r,snapInfo:this._hintMarker._snapInfo}),this._layer.addLatLng(r);var F=this._createMarker(r);this._setTooltipText(),this._setHintLineAfterNewVertex(r),this._fireVertexAdded(F,void 0,r,"Draw"),this._change(this._layer.getLatLngs()),this.options.finishOn==="snap"&&this._hintMarker._snapped&&this._finishShape(n)}}},_setHintLineAfterNewVertex:function(n){this._hintline.setLatLngs([n,n])},_removeLastVertex:function(){var n=this._markers;if(n.length<=1)this.disable();else{var r=this._layer.getLatLngs(),f=n[n.length-1],b=L.PM.Utils.findDeepMarkerIndex(n,f).indexPath;n.pop(),this._layerGroup.removeLayer(f);var F=n[n.length-1],x=r.indexOf(F.getLatLng());r=r.slice(0,x+1),this._layer.setLatLngs(r),this._layer._latlngInfo.pop(),this._syncHintLine(),this._setTooltipText(),this._fireVertexRemoved(f,b,"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 n=this._layer.getLatLngs();if(!(n.length<=1)){var r=L.polyline(n,this.options.pathOptions);this._setPane(r,"layerPane"),this._finishLayer(r),r.addTo(this._map.pm._getContainingLayer()),this._fireCreate(r),this.options.snappable&&this._cleanupSnapping(),this.disable(),this.options.continueDrawing&&this.enable()}}},_createMarker:function(n){var r=new L.Marker(n,{draggable:!1,icon:L.divIcon({className:"marker-icon"})});return this._setPane(r,"vertexPane"),r._pmTempLayer=!0,this._layerGroup.addLayer(r),this._markers.push(r),r.on("click",this._finishShape,this),r},_setTooltipText:function(){var n="";n=ue(this._layer.getLatLngs().flat().length<=1?"tooltips.continueLine":"tooltips.finishLine"),this._hintMarker.setTooltipContent(n)},_change:function(n){this._fireChange(n,"Draw")},setStyle:function(){var n,r;(n=this._layer)===null||n===void 0||n.setStyle(this.options.templineStyle),(r=this._hintline)===null||r===void 0||r.setStyle(this.options.hintlineStyle)}}),S.Polygon=S.Line.extend({initialize:function(n){this._map=n,this._shape="Polygon",this.toolbarButtonName="drawPolygon"},enable:function(n){L.PM.Draw.Line.prototype.enable.call(this,n),this._layer.pm._shape="Polygon"},_createMarker:function(n){var r=new L.Marker(n,{draggable:!1,icon:L.divIcon({className:"marker-icon"})});return this._setPane(r,"vertexPane"),r._pmTempLayer=!0,this._layerGroup.addLayer(r),this._markers.push(r),this._layer.getLatLngs().flat().length===1?(r.on("click",this._finishShape,this),this._tempSnapLayerIndex=this._otherSnapLayers.push(r)-1,this.options.snappable&&this._cleanupSnapping()):r.on("click",function(){return 1}),r},_setTooltipText:function(){var n="";n=ue(this._layer.getLatLngs().flat().length<=2?"tooltips.continueLine":"tooltips.finishPoly"),this._hintMarker.setTooltipContent(n)},_finishShape:function(){if((this.options.allowSelfIntersection||(this._handleSelfIntersection(!0,this._layer.getLatLngs()[0]),!this._doesSelfIntersect))&&(!this.options.requireSnapToFinish||this._hintMarker._snapped||this._isFirstLayer())){var n=this._layer.getLatLngs();if(!(n.length<=2)){var r=L.polygon(n,this.options.pathOptions);this._setPane(r,"layerPane"),this._finishLayer(r),r.addTo(this._map.pm._getContainingLayer()),this._fireCreate(r),this._cleanupSnapping(),this._otherSnapLayers.splice(this._tempSnapLayerIndex,1),delete this._tempSnapLayerIndex,this.disable(),this.options.continueDrawing&&this.enable()}}}}),S.Rectangle=S.extend({initialize:function(n){this._map=n,this._shape="Rectangle",this.toolbarButtonName="drawRectangle"},enable:function(n){if(L.Util.setOptions(this,n),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(ue("tooltips.firstVertex"),{permanent:!0,offset:L.point(0,10),direction:"bottom",opacity:.8}).openTooltip(),this.options.cursorMarker){this._styleMarkers=[];for(var r=0;r<2;r+=1){var f=L.marker(this._map.getCenter(),{icon:L.divIcon({className:"marker-icon rect-style-marker"}),draggable:!1,zIndexOffset:100});this._setPane(f,"vertexPane"),f._pmTempLayer=!0,this._layerGroup.addLayer(f),this._styleMarkers.push(f)}}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(n){this.enabled()?this.disable():this.enable(n)},_placeStartingMarkers:function(n){this._hintMarker._snapped||this._hintMarker.setLatLng(n.latlng);var r=this._hintMarker.getLatLng();L.DomUtil.addClass(this._startMarker._icon,"visible"),this._startMarker.setLatLng(r),this.options.cursorMarker&&this._styleMarkers&&this._styleMarkers.forEach(function(f){L.DomUtil.addClass(f._icon,"visible"),f.setLatLng(r)}),this._map.off("click",this._placeStartingMarkers,this),this._map.on("click",this._finishShape,this),this._hintMarker.setTooltipContent(ue("tooltips.finishRect")),this._setRectangleOrigin()},_setRectangleOrigin:function(){var n=this._startMarker.getLatLng();n&&(this._layerGroup.addLayer(this._layer),this._layer.setLatLngs([n,n]),this._hintMarker.on("move",this._syncRectangleSize,this))},_syncHintMarker:function(n){if(this._hintMarker.setLatLng(n.latlng),this.options.snappable){var r=n;r.target=this._hintMarker,this._handleSnapping(r)}var f=this._layerGroup&&this._layerGroup.hasLayer(this._layer)?this._layer.getLatLngs():[this._hintMarker.getLatLng()];this._fireChange(f,"Draw")},_syncRectangleSize:function(){var n=this,r=wt(this._startMarker.getLatLng(),this._map),f=wt(this._hintMarker.getLatLng(),this._map),b=L.PM.Utils._getRotatedRectangle(r,f,this.options.rectangleAngle||0,this._map);if(this._layer.setLatLngs(b),this.options.cursorMarker&&this._styleMarkers){var F=[];b.forEach(function(x){x.equals(r,1e-8)||x.equals(f,1e-8)||F.push(x)}),F.forEach(function(x,A){try{n._styleMarkers[A].setLatLng(x)}catch(B){}})}},_findCorners:function(){var n=this._layer.getBounds();return[n.getNorthWest(),n.getNorthEast(),n.getSouthEast(),n.getSouthWest()]},_finishShape:function(n){this._hintMarker._snapped||this._hintMarker.setLatLng(n.latlng);var r=this._hintMarker.getLatLng(),f=this._startMarker.getLatLng();if(!this.options.requireSnapToFinish||this._hintMarker._snapped||this._isFirstLayer()){var b=L.rectangle([f,r],this.options.pathOptions);if(this.options.rectangleAngle){var F=L.PM.Utils._getRotatedRectangle(f,r,this.options.rectangleAngle||0,this._map);b.setLatLngs(F),b.pm&&b.pm._setAngle(this.options.rectangleAngle||0)}this._setPane(b,"layerPane"),this._finishLayer(b),b.addTo(this._map.pm._getContainingLayer()),this._fireCreate(b),this.disable(),this.options.continueDrawing&&this.enable()}},setStyle:function(){var n;(n=this._layer)===null||n===void 0||n.setStyle(this.options.pathOptions)}}),S.Circle=S.extend({initialize:function(n){this._map=n,this._shape="Circle",this.toolbarButtonName="drawCircle"},enable:function(n){L.Util.setOptions(this,n),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(),Mt(Mt({},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(ue("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(n){this.enabled()?this.disable():this.enable(n)},_syncHintLine:function(){var n=this._centerMarker.getLatLng(),r=this._getNewDestinationOfHintMarker();this._hintline.setLatLngs([n,r])},_syncCircleRadius:function(){var n,r=this._centerMarker.getLatLng(),f=this._hintMarker.getLatLng();n=this._map.options.crs===L.CRS.Simple?this._map.distance(r,f):r.distanceTo(f),this.options.minRadiusCircle&&nthis.options.maxRadiusCircle?this._layer.setRadius(this.options.maxRadiusCircle):this._layer.setRadius(n)},_syncHintMarker:function(n){if(this._hintMarker.setLatLng(n.latlng),this._hintMarker.setLatLng(this._getNewDestinationOfHintMarker()),this.options.snappable){var r=n;r.target=this._hintMarker,this._handleSnapping(r)}this._handleHintMarkerSnapping();var f=this._layerGroup&&this._layerGroup.hasLayer(this._centerMarker)?this._centerMarker.getLatLng():this._hintMarker.getLatLng();this._fireChange(f,"Draw")},_placeCenterMarker:function(n){this._layerGroup.addLayer(this._layer),this._layerGroup.addLayer(this._centerMarker),this._hintMarker._snapped||this._hintMarker.setLatLng(n.latlng);var r=this._hintMarker.getLatLng();this._layerGroup.addLayer(this._layer),this._centerMarker.setLatLng(r),this._map.off("click",this._placeCenterMarker,this),this._map.on("click",this._finishShape,this),this._placeCircleCenter()},_placeCircleCenter:function(){var n=this._centerMarker.getLatLng();n&&(this._layer.setLatLng(n),this._hintMarker.on("move",this._syncHintLine,this),this._hintMarker.on("move",this._syncCircleRadius,this),this._hintMarker.setTooltipContent(ue("tooltips.finishCircle")),this._fireCenterPlaced(),this._fireChange(this._layer.getLatLng(),"Draw"))},_finishShape:function(n){if(!this.options.requireSnapToFinish||this._hintMarker._snapped||this._isFirstLayer()){this._hintMarker._snapped||this._hintMarker.setLatLng(n.latlng);var r,f=this._centerMarker.getLatLng(),b=this._hintMarker.getLatLng();r=this._map.options.crs===L.CRS.Simple?this._map.distance(f,b):f.distanceTo(b),this.options.minRadiusCircle&&rthis.options.maxRadiusCircle&&(r=this.options.maxRadiusCircle);var F=Mt(Mt({},this.options.pathOptions),{},{radius:r}),x=L.circle(f,F);this._setPane(x,"layerPane"),this._finishLayer(x),x.addTo(this._map.pm._getContainingLayer()),x.pm&&x.pm._updateHiddenPolyCircle(),this._fireCreate(x),this.disable(),this.options.continueDrawing&&this.enable()}},_getNewDestinationOfHintMarker:function(){var n=this._hintMarker.getLatLng();if(!this._layerGroup.hasLayer(this._centerMarker))return n;var r=this._centerMarker.getLatLng(),f=r.distanceTo(n);return this.options.minRadiusCircle&&fthis.options.maxRadiusCircle&&(n=Ge(this._map,r,n,this.options.maxRadiusCircle)),n},_handleHintMarkerSnapping:function(){if(this._hintMarker._snapped){var n=this._centerMarker.getLatLng(),r=this._hintMarker.getLatLng(),f=n.distanceTo(r);this._layerGroup.hasLayer(this._centerMarker)&&(this.options.minRadiusCircle&&fthis.options.maxRadiusCircle)&&this._hintMarker.setLatLng(this._hintMarker._orgLatLng)}this._hintMarker.setLatLng(this._getNewDestinationOfHintMarker())},setStyle:function(){var n,r;(n=this._layer)===null||n===void 0||n.setStyle(this.options.templineStyle),(r=this._hintline)===null||r===void 0||r.setStyle(this.options.hintlineStyle)}}),S.CircleMarker=S.Marker.extend({initialize:function(n){this._map=n,this._shape="CircleMarker",this.toolbarButtonName="drawCircleMarker",this._layerIsDragging=!1},enable:function(n){var r=this;if(L.Util.setOptions(this,n),this._enabled=!0,this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!0),this.options.editable){var f={};L.extend(f,this.options.templineStyle),f.radius=0,this._layerGroup=new L.FeatureGroup,this._layerGroup._pmTempLayer=!0,this._layerGroup.addTo(this._map),this._layer=L.circleMarker(this._map.getCenter(),f),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(ue("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(ue("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(b){r.isRelevantMarker(b)&&b.pm.enable()}),this._layer.bringToBack(),this._fireDrawStart(),this._setGlobalDrawMode()},disable:function(){var n=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(r){n.isRelevantMarker(r)&&r.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(n){this._layerGroup.addLayer(this._layer),this._layerGroup.addLayer(this._centerMarker),this._hintMarker._snapped||this._hintMarker.setLatLng(n.latlng);var r=this._hintMarker.getLatLng();this._layerGroup.addLayer(this._layer),this._centerMarker.setLatLng(r),this._map.off("click",this._placeCenterMarker,this),this._map.on("click",this._finishShape,this),this._placeCircleCenter()},_placeCircleCenter:function(){var n=this._centerMarker.getLatLng();n&&(this._layer.setLatLng(n),this._hintMarker.on("move",this._syncHintLine,this),this._hintMarker.on("move",this._syncCircleRadius,this),this._hintMarker.setTooltipContent(ue("tooltips.finishCircle")),this._fireCenterPlaced(),this._fireChange(this._layer.getLatLng(),"Draw"))},_syncHintLine:function(){var n=this._centerMarker.getLatLng(),r=this._getNewDestinationOfHintMarker();this._hintline.setLatLngs([n,r])},_syncCircleRadius:function(){var n=this._centerMarker.getLatLng(),r=this._hintMarker.getLatLng(),f=this._map.project(n).distanceTo(this._map.project(r));this.options.minRadiusCircleMarker&&fthis.options.maxRadiusCircleMarker?this._layer.setRadius(this.options.maxRadiusCircleMarker):this._layer.setRadius(f)},_syncHintMarker:function(n){if(this._hintMarker.setLatLng(n.latlng),this._hintMarker.setLatLng(this._getNewDestinationOfHintMarker()),this.options.snappable){var r=n;r.target=this._hintMarker,this._handleSnapping(r)}this._handleHintMarkerSnapping();var f=this._layerGroup&&this._layerGroup.hasLayer(this._centerMarker)?this._centerMarker.getLatLng():this._hintMarker.getLatLng();this._fireChange(f,"Draw")},isRelevantMarker:function(n){return n instanceof L.CircleMarker&&!(n instanceof L.Circle)&&n.pm&&!n._pmTempLayer},_createMarker:function(n){if((!this.options.requireSnapToFinish||this._hintMarker._snapped||this._isFirstLayer())&&n.latlng&&!this._layerIsDragging){this._hintMarker._snapped||this._hintMarker.setLatLng(n.latlng);var r=this._hintMarker.getLatLng(),f=L.circleMarker(r,this.options.pathOptions);this._setPane(f,"layerPane"),this._finishLayer(f),f.addTo(this._map.pm._getContainingLayer()),f.pm&&this.options.markerEditable&&f.pm.enable(),this._fireCreate(f),this._cleanupSnapping(),this.options.continueDrawing||this.disable()}},_finishShape:function(n){if(!this.options.requireSnapToFinish||this._hintMarker._snapped||this._isFirstLayer()){this._hintMarker._snapped||this._hintMarker.setLatLng(n.latlng);var r=this._centerMarker.getLatLng(),f=this._hintMarker.getLatLng(),b=this._map.project(r).distanceTo(this._map.project(f));this.options.editable&&(this.options.minRadiusCircleMarker&&bthis.options.maxRadiusCircleMarker&&(b=this.options.maxRadiusCircleMarker));var F=jt(jt({},this.options.pathOptions),{},{radius:b}),x=L.circleMarker(r,F);this._setPane(x,"layerPane"),this._finishLayer(x),x.addTo(this._map.pm._getContainingLayer()),x.pm&&x.pm._updateHiddenPolyCircle(),this._fireCreate(x),this.disable(),this.options.continueDrawing&&this.enable()}},_getNewDestinationOfHintMarker:function(){var n=this._hintMarker.getLatLng();if(this.options.editable){if(!this._layerGroup.hasLayer(this._centerMarker))return n;var r=this._centerMarker.getLatLng(),f=this._map.project(r).distanceTo(this._map.project(n));this.options.minRadiusCircleMarker&&fthis.options.maxRadiusCircleMarker&&(n=Ge(this._map,r,n,this._pxRadiusToMeter(this.options.maxRadiusCircleMarker)))}return n},_handleHintMarkerSnapping:function(){if(this.options.editable){if(this._hintMarker._snapped){var n=this._centerMarker.getLatLng(),r=this._hintMarker.getLatLng(),f=this._map.project(n).distanceTo(this._map.project(r));this._layerGroup.hasLayer(this._centerMarker)&&(this.options.minRadiusCircleMarker&&fthis.options.maxRadiusCircleMarker)&&this._hintMarker.setLatLng(this._hintMarker._orgLatLng)}this._hintMarker.setLatLng(this._getNewDestinationOfHintMarker())}},_pxRadiusToMeter:function(n){var r=this._centerMarker.getLatLng(),f=this._map.project(r),b=L.point(f.x+n,f.y);return this._map.unproject(b).distanceTo(r)},setStyle:function(){var n,r,f={};L.extend(f,this.options.templineStyle),this.options.editable&&(f.radius=0),(n=this._layer)===null||n===void 0||n.setStyle(f),(r=this._hintline)===null||r===void 0||r.setStyle(this.options.hintlineStyle)}});let Gn=function(n){if(!n)throw new Error("geojson is required");var r=[];return ke(n,function(f){(function(b,F){var x=[],A=b.geometry;if(A!==null){switch(A.type){case"Polygon":x=Ye(A);break;case"LineString":x=[Ye(A)]}x.forEach(function(B){var D=function(T,K){var ne=[];return T.reduce(function(Q,se){var he,Le,be,Ue,je,Ie,it=xe([Q,se],K);return it.bbox=(Le=se,be=(he=Q)[0],Ue=he[1],je=Le[0],Ie=Le[1],[beje?be:je,Ue>Ie?Ue:Ie]),ne.push(it),se}),ne}(B,b.properties);D.forEach(function(T){T.id=F.length,F.push(T)})})}})(f,r)}),De(r)};var Hn=d(1787);function fo(n,r){var f=Ye(n),b=Ye(r);if(f.length!==2)throw new Error(" line1 must only contain 2 coordinates");if(b.length!==2)throw new Error(" line2 must only contain 2 coordinates");var F=f[0][0],x=f[0][1],A=f[1][0],B=f[1][1],D=b[0][0],T=b[0][1],K=b[1][0],ne=b[1][1],Q=(ne-T)*(A-F)-(K-D)*(B-x),se=(K-D)*(x-T)-(ne-T)*(F-D),he=(A-F)*(x-T)-(B-x)*(F-D);if(Q===0)return null;var Le=se/Q,be=he/Q;return Le>=0&&Le<=1&&be>=0&&be<=1?fe([F+Le*(A-F),x+Le*(B-x)]):null}let Vt=function(n,r){var f={},b=[];if(n.type==="LineString"&&(n=ie(n)),r.type==="LineString"&&(r=ie(r)),n.type==="Feature"&&r.type==="Feature"&&n.geometry!==null&&r.geometry!==null&&n.geometry.type==="LineString"&&r.geometry.type==="LineString"&&n.geometry.coordinates.length===2&&r.geometry.coordinates.length===2){var F=fo(n,r);return F&&b.push(F),De(b)}var x=Hn();return x.load(Gn(r)),An(Gn(n),function(A){An(x.search(A),function(B){var D=fo(A,B);if(D){var T=Ye(D).join(",");f[T]||(f[T]=!0,b.push(D))}})}),De(b)},Nt=function(n,r,f){f===void 0&&(f={});var b=ft(n),F=ft(r),x=Se(F[1]-b[1]),A=Se(F[0]-b[0]),B=Se(b[1]),D=Se(F[1]),T=Math.pow(Math.sin(x/2),2)+Math.pow(Math.sin(A/2),2)*Math.cos(B)*Math.cos(D);return Re(2*Math.atan2(Math.sqrt(T),Math.sqrt(1-T)),f.units)},Uo=function(n){var r=n[0],f=n[1],b=n[2],F=n[3];if(Nt(n.slice(0,2),[b,f])>=Nt(n.slice(0,2),[r,F])){var x=(f+F)/2;return[r,x-(b-r)/2,b,x+(b-r)/2]}var A=(r+b)/2;return[A-(F-f)/2,f,A+(F-f)/2,F]};function $t(n){var r=[1/0,1/0,-1/0,-1/0];return co(n,function(f){r[0]>f[0]&&(r[0]=f[0]),r[1]>f[1]&&(r[1]=f[1]),r[2] is required");if(typeof f!="number")throw new Error(" must be a number");if(typeof b!="number")throw new Error(" must be a number");F!==!1&&F!==void 0||(n=JSON.parse(JSON.stringify(n)));var x=Math.pow(10,f);return co(n,function(A){(function(B,D,T){B.length>T&&B.splice(T,B.length);for(var K=0;K0&&((be=Le.features[0]).properties.dist=Nt(r,be,f),be.properties.location=F+Nt(D,be,f)),D.properties.dist1&&f.push(xe(T)),De(f)}function Bn(n,r){if(!r.features.length)throw new Error("lines must contain features");if(r.features.length===1)return r.features[0];var f,b=1/0;return An(r,function(F){var x=qi(F,n).properties.dist;x=Q[0]&&se[3]>=Q[1]}(b,A)===!1)return!1;x==="Polygon"&&(B=[B]);for(var D=!1,T=0;Tn[1]!=T>n[1]&&n[0]<(D-A)*(n[1]-B)/(T-B)+A&&(b=!b)}return b}function Vi(n,r,f,b,F){var x=f[0],A=f[1],B=n[0],D=n[1],T=r[0],K=r[1],ne=T-B,Q=K-D,se=(f[0]-B)*Q-(f[1]-D)*ne;if(F!==null){if(Math.abs(se)>F)return!1}else if(se!==0)return!1;return b?b==="start"?Math.abs(ne)>=Math.abs(Q)?ne>0?B0?D=Math.abs(Q)?ne>0?B<=x&&x0?D<=A&&A=Math.abs(Q)?ne>0?B0?D=Math.abs(Q)?ne>0?B<=x&&x<=T:T<=x&&x<=B:Q>0?D<=A&&A<=K:K<=A&&A<=D}let nn=function(n,r,f){f===void 0&&(f={});for(var b=ft(n),F=Ye(r),x=0;xr[0])&&!(n[2]r[1])&&!(n[3]1?r.forEach(function(F){b.push(function(x){return on({type:"LineString",coordinates:x})}(F))}):b.push(n),b}function $n(n){var r=[];return n.eachLayer(function(f){r.push(rn(f.toGeoJSON(15)))}),function(f){return on({type:"MultiLineString",coordinates:f})}(r)}function gt(n,r){return function(f){if(Array.isArray(f))return f}(n)||function(f,b){var F=f==null?null:typeof Symbol!="undefined"&&f[Symbol.iterator]||f["@@iterator"];if(F!=null){var x,A,B=[],D=!0,T=!1;try{for(F=F.call(f);!(D=(x=F.next()).done)&&(B.push(x.value),!b||B.length!==b);D=!0);}catch(K){T=!0,A=K}finally{try{D||F.return==null||F.return()}finally{if(T)throw A}}return B}}(n,r)||function(f,b){if(f){if(typeof f=="string")return Zo(f,b);var F=Object.prototype.toString.call(f).slice(8,-1);if(F==="Object"&&f.constructor&&(F=f.constructor.name),F==="Map"||F==="Set")return Array.from(f);if(F==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(F))return Zo(f,b)}}(n,r)||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 Zo(n,r){(r==null||r>n.length)&&(r=n.length);for(var f=0,b=new Array(r);fn.length)&&(r=n.length);for(var f=0,b=new Array(r);f0)||r.options.layersToCut.indexOf(F)>-1}).filter(function(F){return!r._layerGroup.hasLayer(F)}).filter(function(F){try{var x=!!Vt(n.toGeoJSON(15),F.toGeoJSON(15)).features.length>0;return x||F instanceof L.Polyline&&!(F instanceof L.Polygon)?x:(A=n.toGeoJSON(15),B=F.toGeoJSON(15),D=Ut(A),T=Ut(B),!((K=Ve().intersection(D.coordinates,T.coordinates)).length===0||!(K.length===1?Vn(K[0]):Pe(K))))}catch(ne){return F instanceof L.Polygon&&console.error("You can't cut polygons with self-intersections"),!1}var A,B,D,T,K}).forEach(function(F){var x;if(F instanceof L.Polygon){var A=(x=L.polygon(F.getLatLngs())).getLatLngs();b.forEach(function(Q){if(Q&&Q.snapInfo){var se=Q.latlng,he=r._calcClosestLayer(se,[x]);if(he&&he.segment&&he.distance1?te()(A,je):A).splice(Ie,0,se)}}}})}else x=F;var B=r._cutLayer(n,x),D=L.geoJSON(B,F.options);if(D.getLayers().length===1){var T=D.getLayers();D=gt(T,1)[0]}r._setPane(D,"layerPane");var K=D.addTo(r._map.pm._getContainingLayer());if(K.pm.enable(F.pm.options),K.pm.disable(),F._pmTempLayer=!0,n._pmTempLayer=!0,F.remove(),F.removeFrom(r._map.pm._getContainingLayer()),n.remove(),n.removeFrom(r._map.pm._getContainingLayer()),K.getLayers&&K.getLayers().length===0&&r._map.pm.removeLayer({target:K}),K instanceof L.LayerGroup&&K.eachLayer(function(Q){r._addDrawnLayerProp(Q)}),r._addDrawnLayerProp(K),r.options.layersToCut&&L.Util.isArray(r.options.layersToCut)&&r.options.layersToCut.length>0){var ne=r.options.layersToCut.indexOf(F);ne>-1&&r.options.layersToCut.splice(ne,1)}r._editedLayers.push({layer:K,originalLayer:F})})},_cutLayer:function(n,r){var f,b,F,x,A,B,D=L.geoJSON();if(r instanceof L.Polygon)b=r.toGeoJSON(15),F=n.toGeoJSON(15),x=Ut(b),A=Ut(F),f=(B=Ve().difference(x.coordinates,A.coordinates)).length===0?null:B.length===1?Vn(B[0]):Pe(B);else{var T=po(r);T.forEach(function(K){var ne=Zi(K,n.toGeoJSON(15));(ne&&ne.features.length>0?L.geoJSON(ne):L.geoJSON(K)).getLayers().forEach(function(Q){Dn(n.toGeoJSON(15),Q.toGeoJSON(15))||Q.addTo(D)})}),f=T.length>1?$n(D):D.toGeoJSON(15)}return f},_change:L.Util.falseFn}),S.Text=S.extend({initialize:function(n){this._map=n,this._shape="Text",this.toolbarButtonName="drawText"},enable:function(n){L.Util.setOptions(this,n),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(ue("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(n){this.enabled()?this.disable():this.enable(n)},_syncHintMarker:function(n){if(this._hintMarker.setLatLng(n.latlng),this.options.snappable){var r=n;r.target=this._hintMarker,this._handleSnapping(r)}},_createMarker:function(n){var r;if(n.latlng&&(!this.options.requireSnapToFinish||this._hintMarker._snapped||this._isFirstLayer())){this._hintMarker._snapped||this._hintMarker.setLatLng(n.latlng);var f=this._hintMarker.getLatLng();if(this.textArea=this._createTextArea(),(r=this.options.textOptions)!==null&&r!==void 0&&r.className){var b,F=this.options.textOptions.className.split(" ");(b=this.textArea.classList).add.apply(b,Kn(F))}var x=this._createTextIcon(this.textArea),A=new L.Marker(f,{textMarker:!0,_textMarkerOverPM:!0,icon:x});if(this._setPane(A,"markerPane"),this._finishLayer(A),A.pm||(A.options.draggable=!1),A.addTo(this._map.pm._getContainingLayer()),A.pm){var B,D,T,K,ne;A.pm.textArea=this.textArea,L.setOptions(A.pm,{removeIfEmpty:(B=(D=this.options.textOptions)===null||D===void 0?void 0:D.removeIfEmpty)===null||B===void 0||B});var Q=(T=(K=this.options.textOptions)===null||K===void 0?void 0:K.focusAfterDraw)===null||T===void 0||T;A.pm._createTextMarker(Q),(ne=this.options.textOptions)!==null&&ne!==void 0&&ne.text&&A.pm.setText(this.options.textOptions.text)}this._fireCreate(A),this._cleanupSnapping(),this.disable(),this.options.continueDrawing&&this.enable()}},_createTextArea:function(){var n=document.createElement("textarea");return n.autofocus=!0,n.readOnly=!0,n.classList.add("pm-textarea","pm-disabled"),n},_createTextIcon:function(n){return L.divIcon({className:"pm-text-marker",html:n})}});let Je={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,lt(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 n=this._getDOMElem();n&&(lt(this._layer)instanceof L.Canvas?(this._layer.on("touchstart mousedown",this._dragMixinOnMouseDown,this),this._map.pm._addTouchEvents(n)):L.DomEvent.on(n,"touchstart mousedown",this._simulateMouseDownEvent,this)),this._fireDragEnable()}},disableLayerDrag:function(){this._layerDragEnabled=!1,lt(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 n=this._getDOMElem();n&&(lt(this._layer)instanceof L.Canvas?(this._layer.off("touchstart mousedown",this._dragMixinOnMouseDown,this),this._map.pm._removeTouchEvents(n)):L.DomEvent.off(n,"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(n){var r=n.touches?n.touches[0]:n,f={originalEvent:r,target:this._layer};return f.containerPoint=this._map.mouseEventToContainerPoint(r),f.latlng=this._map.containerPointToLatLng(f.containerPoint),this._dragMixinOnMouseDown(f),!1},_simulateMouseMoveEvent:function(n){var r=n.touches?n.touches[0]:n,f={originalEvent:r,target:this._layer};return f.containerPoint=this._map.mouseEventToContainerPoint(r),f.latlng=this._map.containerPointToLatLng(f.containerPoint),this._dragMixinOnMouseMove(f),!1},_simulateMouseUpEvent:function(n){var r={originalEvent:n.touches?n.touches[0]:n,target:this._layer};return n.type.indexOf("touch")===-1&&(r.containerPoint=this._map.mouseEventToContainerPoint(n),r.latlng=this._map.containerPointToLatLng(r.containerPoint)),this._dragMixinOnMouseUp(r),!1},_dragMixinOnMouseDown:function(n){if(!(n.originalEvent.button>0)){this._overwriteEventIfItComesFromMarker(n);var r=n._fromLayerSync,f=this._syncLayers("_dragMixinOnMouseDown",n);this._layer instanceof L.Marker&&(!this.options.snappable||r||f?this._disableSnapping():this._initSnappableMarkers()),this._layer instanceof L.CircleMarker&&!(this._layer instanceof L.Circle)&&(!this.options.snappable||r||f?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=n.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(n){this._overwriteEventIfItComesFromMarker(n);var r=this._getDOMElem();this._syncLayers("_dragMixinOnMouseMove",n),this._dragging||(this._dragging=!0,L.DomUtil.addClass(r,"leaflet-pm-dragging"),this._layer instanceof L.Marker||this._layer.bringToFront(),this._originalMapDragState&&this._map.dragging.disable(),this._fireDragStart()),this._tempDragCoord||(this._tempDragCoord=n.latlng),this._onLayerDrag(n),this._layer instanceof L.CircleMarker&&this._layer.pm._updateHiddenPolyCircle()},_dragMixinOnMouseUp:function(n){var r=this,f=this._getDOMElem();return this._syncLayers("_dragMixinOnMouseUp",n),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(){r._dragging=!1,f&&L.DomUtil.removeClass(f,"leaflet-pm-dragging"),r._fireDragEnd(),r._fireEdit(),r._layerEdited=!0},10),!0)},_onLayerDrag:function(n){var r=n.latlng,f=r.lat-this._tempDragCoord.lat,b=r.lng-this._tempDragCoord.lng,F=function K(ne){return ne.map(function(Q){if(Array.isArray(Q))return K(Q);var se={lat:Q.lat+f,lng:Q.lng+b};return(Q.alt||Q.alt===0)&&(se.alt=Q.alt),se})};if(this._layer instanceof L.Circle||this._layer instanceof L.CircleMarker&&this._layer.options.editable){var x=F([this._layer.getLatLng()]);this._layer.setLatLng(x[0]),this._fireChange(this._layer.getLatLng(),"Edit")}else if(this._layer instanceof L.CircleMarker||this._layer instanceof L.Marker){var A=this._layer.getLatLng();this._layer._snapped&&(A=this._layer._orgLatLng);var B=F([A]);this._layer.setLatLng(B[0]),this._fireChange(this._layer.getLatLng(),"Edit")}else if(this._layer instanceof L.ImageOverlay){var D=F([this._layer.getBounds().getNorthWest(),this._layer.getBounds().getSouthEast()]);this._layer.setBounds(D),this._fireChange(this._layer.getBounds(),"Edit")}else{var T=F(this._layer.getLatLngs());this._layer.setLatLngs(T),this._fireChange(this._layer.getLatLngs(),"Edit")}this._tempDragCoord=r,n.layer=this._layer,this._fireDrag(n)},addDraggingClass:function(){var n=this._getDOMElem();n&&L.DomUtil.addClass(n,"leaflet-pm-draggable")},removeDraggingClass:function(){var n=this._getDOMElem();n&&L.DomUtil.removeClass(n,"leaflet-pm-draggable")},_getDOMElem:function(){var n=null;return this._layer._path?n=this._layer._path:this._layer._renderer&&this._layer._renderer._container?n=this._layer._renderer._container:this._layer._image?n=this._layer._image:this._layer._icon&&(n=this._layer._icon),n},_overwriteEventIfItComesFromMarker:function(n){n.target.getLatLng&&(!n.target._radius||n.target._radius<=10)&&(n.containerPoint=this._map.mouseEventToContainerPoint(n.originalEvent),n.latlng=this._map.containerPointToLatLng(n.containerPoint))},_syncLayers:function(n,r){var f=this;if(this.enabled())return!1;if(!r._fromLayerSync&&this._layer===r.target&&this.options.syncLayersOnDrag){r._fromLayerSync=!0;var b=[];if(L.Util.isArray(this.options.syncLayersOnDrag))b=this.options.syncLayersOnDrag,this.options.syncLayersOnDrag.forEach(function(A){A instanceof L.LayerGroup&&(b=b.concat(A.pm.getLayers(!0)))});else if(this.options.syncLayersOnDrag===!0&&this._parentLayerGroup)for(var F in this._parentLayerGroup){var x=this._parentLayerGroup[F];x.pm&&(b=x.pm.getLayers(!0))}return L.Util.isArray(b)&&b.length>0&&(b=b.filter(function(A){return!!A.pm}).filter(function(A){return!!A.pm.options.draggable})).forEach(function(A){A!==f._layer&&A.pm[n]&&(A._snapped=!1,A.pm[n](r))}),b.length>0}return!1},_stopDOMImageDrag:function(n){return n.preventDefault(),!1}};function Kt(n,r,f){var b=f.getMaxZoom();if(b===1/0&&(b=f.getZoom()),L.Util.isArray(n)){var F=[];return n.forEach(function(x){F.push(Kt(x,r,f))}),F}return n instanceof L.LatLng?function(x,A,B,D){return B.unproject(A.transform(B.project(x,D)),D)}(n,r,f,b):null}function St(n,r){r instanceof L.Layer&&(r=r.getLatLng());var f=n.getMaxZoom();return f===1/0&&(f=n.getZoom()),n.project(r,f)}function Wt(n,r){var f=n.getMaxZoom();return f===1/0&&(f=n.getZoom()),n.unproject(r,f)}var go={_onRotateStart:function(n){this._preventRenderingMarkers(!0),this._rotationOriginLatLng=this._getRotationCenter().clone(),this._rotationOriginPoint=St(this._map,this._rotationOriginLatLng),this._rotationStartPoint=St(this._map,n.target.getLatLng()),this._initialRotateLatLng=Ke(this._layer),this._startAngle=this.getAngle();var r=Ke(this._rotationLayer,this._rotationLayer.pm._rotateOrgLatLng);this._fireRotationStart(this._rotationLayer,r),this._fireRotationStart(this._map,r)},_onRotate:function(n){var r=St(this._map,n.target.getLatLng()),f=this._rotationStartPoint,b=this._rotationOriginPoint,F=Math.atan2(r.y-b.y,r.x-b.x)-Math.atan2(f.y-b.y,f.x-b.x);this._layer.setLatLngs(this._rotateLayer(F,this._initialRotateLatLng,this._rotationOriginLatLng,L.PM.Matrix.init(),this._map));var x=this;(function T(K){var ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Q=arguments.length>2&&arguments[2]!==void 0?arguments[2]:-1;if(Q>-1&&ne.push(Q),L.Util.isArray(K[0]))K.forEach(function(he,Le){return T(he,ne.slice(),Le)});else{var se=te()(x._markers,ne);K.forEach(function(he,Le){se[Le].setLatLng(he)})}})(this._layer.getLatLngs());var A=Ke(this._rotationLayer);this._rotationLayer.setLatLngs(this._rotateLayer(F,this._rotationLayer.pm._rotateOrgLatLng,this._rotationOriginLatLng,L.PM.Matrix.init(),this._map));var B=180*F/Math.PI,D=(B=B<0?B+360:B)+this._startAngle;this._setAngle(D),this._rotationLayer.pm._setAngle(D),this._fireRotation(this._rotationLayer,B,A),this._fireRotation(this._map,B,A),this._rotationLayer.pm._fireChange(this._rotationLayer.getLatLngs(),"Rotation")},_onRotateEnd:function(){var n=this._startAngle;delete this._rotationOriginLatLng,delete this._rotationOriginPoint,delete this._rotationStartPoint,delete this._initialRotateLatLng,delete this._startAngle;var r=Ke(this._rotationLayer,this._rotationLayer.pm._rotateOrgLatLng);this._rotationLayer.pm._rotateOrgLatLng=Ke(this._rotationLayer),this._fireRotationEnd(this._rotationLayer,n,r),this._fireRotationEnd(this._map,n,r),this._rotationLayer.pm._fireEdit(this._rotationLayer,"Rotation"),this._preventRenderingMarkers(!1),this._layerRotated=!0},_rotateLayer:function(n,r,f,b,F){var x=St(F,f);return this._matrix=b.clone().rotate(n,x).flip(),Kt(r,this._matrix,F)},_setAngle:function(n){n=n<0?n+360:n,this._angle=n%360},_getRotationCenter:function(){var n=L.polygon(this._layer.getLatLngs(),{stroke:!1,fill:!1,pmIgnore:!0}).addTo(this._layer._map),r=n.getCenter();return n.removeFrom(this._layer._map),r},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=Ke(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(n){var r=this.getAngle(),f=this._layer.getLatLngs(),b=n*(Math.PI/180);this._layer.setLatLngs(this._rotateLayer(b,this._layer.getLatLngs(),this._getRotationCenter(),L.PM.Matrix.init(),this._layer._map)),this._rotateOrgLatLng=L.polygon(this._layer.getLatLngs()).getLatLngs(),this._setAngle(this.getAngle()+n),this.rotateEnabled()&&this._rotatePoly&&this._rotatePoly.pm.enabled()&&(this._rotatePoly.setLatLngs(this._rotateLayer(b,this._rotatePoly.getLatLngs(),this._getRotationCenter(),L.PM.Matrix.init(),this._rotatePoly._map)),this._rotatePoly.pm._initMarkers());var F=this.getAngle()-r;F=F<0?F+360:F,this._startAngle=r,this._fireRotation(this._layer,F,f,this._layer),this._fireRotation(this._map||this._layer._map,F,f,this._layer),delete this._startAngle,this._fireChange(this._layer.getLatLngs(),"Rotation")},rotateLayerToAngle:function(n){var r=n-this.getAngle();this.rotateLayer(r)},getAngle:function(){return this._angle||0},setInitAngle:function(n){this._setAngle(n)}};let Pn=go,Xe=L.Class.extend({includes:[Je,C,Pn,_e],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(n){L.Util.setOptions(this,n)},getOptions:function(){return this.options},applyOptions:function(){},isPolygon:function(){return this._layer instanceof L.Polygon},getShape:function(){return this._shape},_setPane:function(n,r){r==="layerPane"?n.options.pane=this._map.pm.globalOptions.panes&&this._map.pm.globalOptions.panes.layerPane||"overlayPane":r==="vertexPane"?n.options.pane=this._map.pm.globalOptions.panes&&this._map.pm.globalOptions.panes.vertexPane||"markerPane":r==="markerPane"&&(n.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(n,r){var f=r.target,b={layer:this._layer,marker:f,event:r},F="";return n==="move"?F="moveVertexValidation":n==="add"?F="addVertexValidation":n==="remove"&&(F="removeVertexValidation"),this.options[F]&&typeof this.options[F]=="function"&&!this.options[F](b)?(n==="move"&&(f._cancelDragEventChain=f.getLatLng()),!1):(f._cancelDragEventChain=null,!0)},_vertexValidationDrag:function(n){return!n._cancelDragEventChain||(n._latlng=n._cancelDragEventChain,n.update(),!1)},_vertexValidationDragEnd:function(n){return!n._cancelDragEventChain||(n._cancelDragEventChain=null,!1)}});function gn(n){return function(r){if(Array.isArray(r))return Fn(r)}(n)||function(r){if(typeof Symbol!="undefined"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}(n)||function(r,f){if(r){if(typeof r=="string")return Fn(r,f);var b=Object.prototype.toString.call(r).slice(8,-1);if(b==="Object"&&r.constructor&&(b=r.constructor.name),b==="Map"||b==="Set")return Array.from(r);if(b==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(b))return Fn(r,f)}}(n)||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 Fn(n,r){(r==null||r>n.length)&&(r=n.length);for(var f=0,b=new Array(r);f0&&r._getMap()&&r._getMap().pm.globalEditModeEnabled()&&r.enabled()&&r.enable(r.getOptions())}},100,this),this),this._layerGroup.on("layerremove",function(f){r._removeLayerFromGroup(f.target)},this),this._layerGroup.on("layerremove",L.Util.throttle(function(f){f.target._pmTempLayer||(r._layers=r.getLayers())},100,this),this)},enable:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];r.length===0&&(this._layers=this.getLayers()),this._options=n,this._layers.forEach(function(f){f instanceof L.LayerGroup?r.indexOf(f._leaflet_id)===-1&&(r.push(f._leaflet_id),f.pm.enable(n,r)):f.pm.enable(n)})},disable:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];n.length===0&&(this._layers=this.getLayers()),this._layers.forEach(function(r){r instanceof L.LayerGroup?n.indexOf(r._leaflet_id)===-1&&(n.push(r._leaflet_id),r.pm.disable(n)):r.pm.disable()})},enabled:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];n.length===0&&(this._layers=this.getLayers());var r=this._layers.find(function(f){return f instanceof L.LayerGroup?n.indexOf(f._leaflet_id)===-1&&(n.push(f._leaflet_id),f.pm.enabled(n)):f.pm.enabled()});return!!r},toggleEdit:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];r.length===0&&(this._layers=this.getLayers()),this._options=n,this._layers.forEach(function(f){f instanceof L.LayerGroup?r.indexOf(f._leaflet_id)===-1&&(r.push(f._leaflet_id),f.pm.toggleEdit(n,r)):f.pm.toggleEdit(n)})},_initLayer:function(n){var r=L.Util.stamp(this._layerGroup);n.pm._parentLayerGroup||(n.pm._parentLayerGroup={}),n.pm._parentLayerGroup[r]=this._layerGroup},_removeLayerFromGroup:function(n){if(n.pm&&n.pm._layerGroup){var r=L.Util.stamp(this._layerGroup);delete n.pm._layerGroup[r]}},dragging:function(){if(this._layers=this.getLayers(),this._layers){var n=this._layers.find(function(r){return r.pm.dragging()});return!!n}return!1},getOptions:function(){return this.options},_getMap:function(){var n;return this._map||((n=this._layers.find(function(r){return!!r._map}))===null||n===void 0?void 0:n._map)||null},getLayers:function(){var n=arguments.length>0&&arguments[0]!==void 0&&arguments[0],r=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],f=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],b=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[],F=[];return n?this._layerGroup.getLayers().forEach(function(x){F.push(x),x instanceof L.LayerGroup&&b.indexOf(x._leaflet_id)===-1&&(b.push(x._leaflet_id),F=F.concat(x.pm.getLayers(!0,!0,!0,b)))}):F=this._layerGroup.getLayers(),f&&(F=F.filter(function(x){return!(x instanceof L.LayerGroup)})),r&&(F=(F=(F=F.filter(function(x){return!!x.pm})).filter(function(x){return!x._pmTempLayer})).filter(function(x){return!L.PM.optIn&&!x.options.pmIgnore||L.PM.optIn&&x.options.pmIgnore===!1})),F},setOptions:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];r.length===0&&(this._layers=this.getLayers()),this.options=n,this._layers.forEach(function(f){f.pm&&(f instanceof L.LayerGroup?r.indexOf(f._leaflet_id)===-1&&(r.push(f._leaflet_id),f.pm.setOptions(n,r)):f.pm.setOptions(n))})}}),Xe.Marker=Xe.extend({_shape:"Marker",initialize:function(n){this._layer=n,this._enabled=!1,this._layer.on("dragend",this._onDragEnd,this)},enable:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{draggable:!0};L.Util.setOptions(this,n),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(n){this.enabled()?this.disable():this.enable(n)},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(n){var r=n.target;r.remove(),this._fireRemove(r),this._fireRemove(this._map,r)},_onDragEnd:function(){this._fireEdit(),this._layerEdited=!0},_initSnappableMarkers:function(){var n=this._layer;this.options.snapDistance=this.options.snapDistance||30,this.options.snapSegment=this.options.snapSegment===void 0||this.options.snapSegment,n.off("pm:drag",this._handleSnapping,this),n.on("pm:drag",this._handleSnapping,this),n.off("pm:dragend",this._cleanupSnapping,this),n.on("pm:dragend",this._cleanupSnapping,this),n.off("pm:dragstart",this._unsnap,this),n.on("pm:dragstart",this._unsnap,this)},_disableSnapping:function(){var n=this._layer;n.off("pm:drag",this._handleSnapping,this),n.off("pm:dragend",this._cleanupSnapping,this),n.off("pm:dragstart",this._unsnap,this)}});let Fo={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 n=[].concat(gn(this._markerGroup.getLayers()),gn(this.markerCache));this.markerCache=n.filter(function(r,f,b){return b.indexOf(r)===f})},renderLimits:function(n){var r=this;this.markerCache.forEach(function(f){n.includes(f)?r._markerGroup.addLayer(f):r._markerGroup.removeLayer(f)})},applyLimitFilters:function(n){var r=n.latlng,f=r===void 0?{lat:0,lng:0}:r;if(!this._preventRenderMarkers){var b=gn(this._filterClosestMarkers(f));this.renderLimits(b)}},_filterClosestMarkers:function(n){var r=gn(this.markerCache),f=this.options.limitMarkersToCount;return f===-1?r:(r.sort(function(b,F){return b._latlng.distanceTo(n)-F._latlng.distanceTo(n)}),r.filter(function(b,F){return!(f>-1)||Fn.length)&&(r=n.length);for(var f=0,b=new Array(r);fn.length)&&(r=n.length);for(var f=0,b=new Array(r);f1?te()(F,D):F,K=A.length>1?te()(this._markers,D):this._markers;T.splice(B+1,0,b),K.splice(B+1,0,n),this._layer.setLatLngs(F),this.options.hideMiddleMarkers!==!0&&(this._createMiddleMarker(r,n),this._createMiddleMarker(n,f)),this._fireEdit(),this._layerEdited=!0,this._fireChange(this._layer.getLatLngs(),"Edit"),this._fireVertexAdded(n,L.PM.Utils.findDeepMarkerIndex(this._markers,n).indexPath,b),this.options.snappable&&this._initSnappableMarkers()},hasSelfIntersection:function(){return Ze(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(n){var r=this._layer;if(this.hasSelfIntersection()){if(!this.options.allowSelfIntersection&&this.options.allowSelfIntersectionEdit&&this._updateDisabledMarkerStyle(this._markers,!0),this.isRed)return;n?this._flashLayer():(r.setStyle({color:"#f00000ff"}),this.isRed=!0),this._fireIntersect(Ze(this._layer.toGeoJSON(15)))}else r.setStyle({color:this.cachedColor}),this.isRed=!1,!this.options.allowSelfIntersection&&this.options.allowSelfIntersectionEdit&&this._updateDisabledMarkerStyle(this._markers,!1)},_flashLayer:function(){var n=this;this.cachedColor||(this.cachedColor=this._layer.options.color),this._layer.setStyle({color:"#f00000ff"}),this.isRed=!0,window.setTimeout(function(){n._layer.setStyle({color:n.cachedColor}),n.isRed=!1},200)},_updateDisabledMarkerStyle:function(n,r){var f=this;n.forEach(function(b){Array.isArray(b)?f._updateDisabledMarkerStyle(b,r):b._icon&&(r&&!f._checkMarkerAllowedToDrag(b)?L.DomUtil.addClass(b._icon,"vertexmarker-disabled"):L.DomUtil.removeClass(b._icon,"vertexmarker-disabled"))})},_removeMarker:function(n){var r=n.target;if(this._vertexValidation("remove",n)){this.options.allowSelfIntersection||(this._coordsBeforeEdit=Ke(this._layer,this._layer.getLatLngs()));var f=this._layer.getLatLngs(),b=L.PM.Utils.findDeepMarkerIndex(this._markers,r),F=b.indexPath,x=b.index,A=b.parentPath;if(F){var B=F.length>1?te()(f,A):f,D=F.length>1?te()(this._markers,A):this._markers;if(this.options.removeLayerBelowMinVertexCount||!(B.length<=2||this.isPolygon()&&B.length<=3)){B.splice(x,1),this._layer.setLatLngs(f),this.isPolygon()&&B.length<=2&&B.splice(0,B.length);var T=!1;if(B.length<=1&&(B.splice(0,B.length),A.length>1&&F.length>1&&(f=Be(f)),this._layer.setLatLngs(f),this._initMarkers(),T=!0),we(f)||this._layer.remove(),f=Be(f),this._layer.setLatLngs(f),this._markers=Be(this._markers),!T&&(D=F.length>1?te()(this._markers,A):this._markers,r._middleMarkerPrev&&this._markerGroup.removeLayer(r._middleMarkerPrev),r._middleMarkerNext&&this._markerGroup.removeLayer(r._middleMarkerNext),this._markerGroup.removeLayer(r),D)){var K,ne;if(this.isPolygon()?(K=(x+1)%D.length,ne=(x+(D.length-1))%D.length):(ne=x-1<0?void 0:x-1,K=x+1>=D.length?void 0:x+1),K!==ne){var Q=D[ne],se=D[K];this.options.hideMiddleMarkers!==!0&&this._createMiddleMarker(Q,se)}D.splice(x,1)}this._fireEdit(),this._layerEdited=!0,this._fireVertexRemoved(r,F),this._fireChange(this._layer.getLatLngs(),"Edit")}else this._flashLayer()}}},updatePolygonCoordsFromMarkerDrag:function(n){var r=this._layer.getLatLngs(),f=n.getLatLng(),b=L.PM.Utils.findDeepMarkerIndex(this._markers,n),F=b.indexPath,x=b.index,A=b.parentPath;(F.length>1?te()(r,A):r).splice(x,1,f),this._layer.setLatLngs(r)},_getNeighborMarkers:function(n){var r=L.PM.Utils.findDeepMarkerIndex(this._markers,n),f=r.indexPath,b=r.index,F=r.parentPath,x=f.length>1?te()(this._markers,F):this._markers,A=(b+1)%x.length;return{prevMarker:x[(b+(x.length-1))%x.length],nextMarker:x[A]}},_checkMarkerAllowedToDrag:function(n){var r=this._getNeighborMarkers(n),f=r.prevMarker,b=r.nextMarker,F=L.polyline([f.getLatLng(),n.getLatLng()]),x=L.polyline([n.getLatLng(),b.getLatLng()]),A=Vt(this._layer.toGeoJSON(15),F.toGeoJSON(15)).features.length,B=Vt(this._layer.toGeoJSON(15),x.toGeoJSON(15)).features.length;return n.getLatLng()===this._markers[0][0].getLatLng()?B+=1:n.getLatLng()===this._markers[0][this._markers[0].length-1].getLatLng()&&(A+=1),!(A<=2&&B<=2)},_onMarkerDragStart:function(n){var r=n.target;if(this.cachedColor||(this.cachedColor=this._layer.options.color),this._vertexValidation("move",n)){var f=L.PM.Utils.findDeepMarkerIndex(this._markers,r).indexPath;this._fireMarkerDragStart(n,f),this.options.allowSelfIntersection||(this._coordsBeforeEdit=Ke(this._layer,this._layer.getLatLngs())),!this.options.allowSelfIntersection&&this.options.allowSelfIntersectionEdit&&this.hasSelfIntersection()?this._markerAllowedToDrag=this._checkMarkerAllowedToDrag(r):this._markerAllowedToDrag=null}},_onMarkerDrag:function(n){var r=n.target;if(this._vertexValidationDrag(r)){var f=L.PM.Utils.findDeepMarkerIndex(this._markers,r),b=f.indexPath,F=f.index,x=f.parentPath;if(b){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(r);var A=b.length>1?te()(this._markers,x):this._markers,B=(F+1)%A.length,D=(F+(A.length-1))%A.length,T=r.getLatLng(),K=A[D].getLatLng(),ne=A[B].getLatLng();if(r._middleMarkerNext){var Q=L.PM.Utils.calcMiddleLatLng(this._map,T,ne);r._middleMarkerNext.setLatLng(Q)}if(r._middleMarkerPrev){var se=L.PM.Utils.calcMiddleLatLng(this._map,T,K);r._middleMarkerPrev.setLatLng(se)}this.options.allowSelfIntersection||this._handleLayerStyle(),this._fireMarkerDrag(n,b),this._fireChange(this._layer.getLatLngs(),"Edit")}}},_onMarkerDragEnd:function(n){var r=n.target;if(this._vertexValidationDragEnd(r)){var f=L.PM.Utils.findDeepMarkerIndex(this._markers,r).indexPath,b=this.hasSelfIntersection();b&&this.options.allowSelfIntersectionEdit&&this._markerAllowedToDrag&&(b=!1);var F=!this.options.allowSelfIntersection&&b;if(this._fireMarkerDragEnd(n,f,F),F)return this._layer.setLatLngs(this._coordsBeforeEdit),this._coordsBeforeEdit=null,this._initMarkers(),this.options.snappable&&this._initSnappableMarkers(),this._handleLayerStyle(),void this._fireLayerReset(n,f);!this.options.allowSelfIntersection&&this.options.allowSelfIntersectionEdit&&this._handleLayerStyle(),this._fireEdit(),this._layerEdited=!0,this._fireChange(this._layer.getLatLngs(),"Edit")}},_onVertexClick:function(n){var r=n.target;if(!r._dragging){var f=L.PM.Utils.findDeepMarkerIndex(this._markers,r).indexPath;this._fireVertexClick(n,f)}}}),Xe.Polygon=Xe.Line.extend({_shape:"Polygon",_checkMarkerAllowedToDrag:function(n){var r=this._getNeighborMarkers(n),f=r.prevMarker,b=r.nextMarker,F=L.polyline([f.getLatLng(),n.getLatLng()]),x=L.polyline([n.getLatLng(),b.getLatLng()]),A=Vt(this._layer.toGeoJSON(15),F.toGeoJSON(15)).features.length,B=Vt(this._layer.toGeoJSON(15),x.toGeoJSON(15)).features.length;return!(A<=2&&B<=2)}}),Xe.Rectangle=Xe.Polygon.extend({_shape:"Rectangle",_initMarkers:function(){var n=this,r=this._map,f=this._findCorners();this._markerGroup&&this._markerGroup.clearLayers(),this._markerGroup=new L.FeatureGroup,this._markerGroup._pmTempLayer=!0,r.addLayer(this._markerGroup),this._markers=[],this._markers[0]=f.map(this._createMarker,this);var b=vo(this._markers,1);this._cornerMarkers=b[0],this._layer.getLatLngs()[0].forEach(function(F,x){var A=n._cornerMarkers.find(function(B){return B._index===x});A&&A.setLatLng(F)})},applyOptions:function(){this.options.snappable?this._initSnappableMarkers():this._disableSnapping(),this._addMarkerEvents()},_createMarker:function(n,r){var f=new L.Marker(n,{draggable:!0,icon:L.divIcon({className:"marker-icon"})});return this._setPane(f,"vertexPane"),f._origLatLng=n,f._index=r,f._pmTempLayer=!0,this._markerGroup.addLayer(f),f},_addMarkerEvents:function(){var n=this;this._markers[0].forEach(function(r){r.on("dragstart",n._onMarkerDragStart,n),r.on("drag",n._onMarkerDrag,n),r.on("dragend",n._onMarkerDragEnd,n),n.options.preventMarkerRemoval||r.on("contextmenu",n._removeMarker,n)})},_removeMarker:function(){return null},_onMarkerDragStart:function(n){if(this._vertexValidation("move",n)){var r=n.target,f=this._cornerMarkers;r._oppositeCornerLatLng=f.find(function(b){return b._index===(r._index+2)%4}).getLatLng(),r._snapped=!1,this._fireMarkerDragStart(n)}},_onMarkerDrag:function(n){var r=n.target;this._vertexValidationDrag(r)&&r._index!==void 0&&(this._adjustRectangleForMarkerMove(r),this._fireMarkerDrag(n),this._fireChange(this._layer.getLatLngs(),"Edit"))},_onMarkerDragEnd:function(n){var r=n.target;this._vertexValidationDragEnd(r)&&(this._cornerMarkers.forEach(function(f){delete f._oppositeCornerLatLng}),this._fireMarkerDragEnd(n),this._fireEdit(),this._layerEdited=!0,this._fireChange(this._layer.getLatLngs(),"Edit"))},_adjustRectangleForMarkerMove:function(n){L.extend(n._origLatLng,n._latlng);var r=L.PM.Utils._getRotatedRectangle(n.getLatLng(),n._oppositeCornerLatLng,this._angle||0,this._map);this._layer.setLatLngs(r),this._adjustAllMarkers(),this._layer.redraw()},_adjustAllMarkers:function(){var n=this,r=this._layer.getLatLngs()[0];r&&r.length!==4&&r.length>0?(r.forEach(function(f,b){n._cornerMarkers[b].setLatLng(f)}),this._cornerMarkers.slice(r.length).forEach(function(f){f.setLatLng(r[0])})):r&&r.length?this._cornerMarkers.forEach(function(f){f.setLatLng(r[f._index])}):console.error("The layer has no LatLngs")},_findCorners:function(){var n=this._layer.getLatLngs()[0];return L.PM.Utils._getRotatedRectangle(n[0],n[2],this._angle||0,this._map)}}),Xe.Circle=Xe.extend({_shape:"Circle",initialize:function(n){this._layer=n,this._enabled=!1,this._updateHiddenPolyCircle()},enable:function(n){L.Util.setOptions(this,n),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 n=this._layer._path?this._layer._path:this._layer._renderer._container;L.DomUtil.removeClass(n,"leaflet-pm-draggable"),this._layerEdited&&this._fireUpdate(),this._layerEdited=!1,this._fireDisable()}},enabled:function(){return this._enabled},toggleEdit:function(n){this.enabled()?this.disable():this.enable(n)},_initMarkers:function(){var n=this._map;this._helperLayers&&this._helperLayers.clearLayers(),this._helperLayers=new L.FeatureGroup,this._helperLayers._pmTempLayer=!0,this._helperLayers.addTo(n);var r=this._layer.getLatLng(),f=this._layer._radius,b=this._getLatLngOnCircle(r,f);this._centerMarker=this._createCenterMarker(r),this._outerMarker=this._createOuterMarker(b),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(n,r){var f=n.getLatLng(),b=r.getLatLng();this._hintline=L.polyline([f,b],this.options.hintlineStyle),this._setPane(this._hintline,"layerPane"),this._hintline._pmTempLayer=!0,this._helperLayers.addLayer(this._hintline)},_createCenterMarker:function(n){var r=this._createMarker(n);return L.DomUtil.addClass(r._icon,"leaflet-pm-draggable"),r.on("drag",this._moveCircle,this),r.on("dragstart",this._onCircleDragStart,this),r.on("drag",this._onCircleDrag,this),r.on("dragend",this._onCircleDragEnd,this),r},_createOuterMarker:function(n){var r=this._createMarker(n);return r.on("drag",this._resizeCircle,this),r},_createMarker:function(n){var r=new L.Marker(n,{draggable:!0,icon:L.divIcon({className:"marker-icon"})});return this._setPane(r,"vertexPane"),r._origLatLng=n,r._pmTempLayer=!0,r.on("dragstart",this._onMarkerDragStart,this),r.on("drag",this._onMarkerDrag,this),r.on("dragend",this._onMarkerDragEnd,this),this._helperLayers.addLayer(r),r},_resizeCircle:function(){this._outerMarker.setLatLng(this._getNewDestinationOfOuterMarker()),this._syncHintLine(),this._syncCircleRadius()},_moveCircle:function(n){if(!n.target._cancelDragEventChain){var r=n.latlng;this._layer.setLatLng(r);var f=this._layer._radius,b=this._getLatLngOnCircle(r,f);this._outerMarker._latlng=b,this._outerMarker.update(),this._syncHintLine(),this._updateHiddenPolyCircle(),this._fireCenterPlaced("Edit"),this._fireChange(this._layer.getLatLng(),"Edit")}},_syncCircleRadius:function(){var n=this._centerMarker.getLatLng(),r=this._outerMarker.getLatLng(),f=this._map.distance(n,r);this.options.minRadiusCircle&&fthis.options.maxRadiusCircle?this._layer.setRadius(this.options.maxRadiusCircle):this._layer.setRadius(f),this._updateHiddenPolyCircle(),this._fireChange(this._layer.getLatLng(),"Edit")},_syncHintLine:function(){var n=this._centerMarker.getLatLng(),r=this._outerMarker.getLatLng();this._hintline.setLatLngs([n,r])},_disableSnapping:function(){var n=this;this._markers.forEach(function(r){r.off("move",n._syncHintLine,n),r.off("move",n._syncCircleRadius,n),r.off("drag",n._handleSnapping,n),r.off("dragend",n._cleanupSnapping,n)}),this._layer.off("pm:dragstart",this._unsnap,this)},_onMarkerDragStart:function(n){this._vertexValidation("move",n)&&this._fireMarkerDragStart(n)},_onMarkerDrag:function(n){var r=n.target;this._vertexValidationDrag(r)&&this._fireMarkerDrag(n)},_onMarkerDragEnd:function(n){var r=n.target;this._vertexValidationDragEnd(r)&&(this._fireEdit(),this._layerEdited=!0,this._fireMarkerDragEnd(n))},_onCircleDragStart:function(n){this._vertexValidationDrag(n.target)?(delete this._vertexValidationReset,this._fireDragStart()):this._vertexValidationReset=!0},_onCircleDrag:function(n){this._vertexValidationReset||this._fireDrag(n)},_onCircleDragEnd:function(){this._vertexValidationReset?delete this._vertexValidationReset:this._fireDragEnd()},_updateHiddenPolyCircle:function(){var n=this._map&&this._map.pm._isCRSSimple();this._hiddenPolyCircle?this._hiddenPolyCircle.setLatLngs(L.PM.Utils.circleToPolygon(this._layer,200,!n).getLatLngs()):this._hiddenPolyCircle=L.PM.Utils.circleToPolygon(this._layer,200,!n),this._hiddenPolyCircle._parentCopy||(this._hiddenPolyCircle._parentCopy=this._layer)},_getLatLngOnCircle:function(n,r){var f=this._map.project(n),b=L.point(f.x+r,f.y);return this._map.unproject(b)},_getNewDestinationOfOuterMarker:function(){var n=this._centerMarker.getLatLng(),r=this._outerMarker.getLatLng(),f=this._map.distance(n,r);return this.options.minRadiusCircle&&fthis.options.maxRadiusCircle&&(r=Ge(this._map,n,r,this.options.maxRadiusCircle)),r},_handleOuterMarkerSnapping:function(){if(this._outerMarker._snapped){var n=this._centerMarker.getLatLng(),r=this._outerMarker.getLatLng(),f=this._map.distance(n,r);(this.options.minRadiusCircle&&fthis.options.maxRadiusCircle)&&this._outerMarker.setLatLng(this._outerMarker._orgLatLng)}this._outerMarker.setLatLng(this._getNewDestinationOfOuterMarker())}}),Xe.CircleMarker=Xe.extend({_shape:"CircleMarker",initialize:function(n){this._layer=n,this._enabled=!1,this._updateHiddenPolyCircle()},enable:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{draggable:!0,snappable:!0};L.Util.setOptions(this,n),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(n){this.enabled()?this.disable():this.enable(n)},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 n=this._map;this._helperLayers&&this._helperLayers.clearLayers(),this._helperLayers=new L.FeatureGroup,this._helperLayers._pmTempLayer=!0,this._helperLayers.addTo(n);var r=this._layer.getLatLng(),f=this._layer._radius,b=this._getLatLngOnCircle(r,f);this._centerMarker=this._createCenterMarker(r),this._outerMarker=this._createOuterMarker(b),this._markers=[this._centerMarker,this._outerMarker],this._createHintLine(this._centerMarker,this._outerMarker)},_getLatLngOnCircle:function(n,r){var f=this._map.project(n),b=L.point(f.x+r,f.y);return this._map.unproject(b)},_createHintLine:function(n,r){var f=n.getLatLng(),b=r.getLatLng();this._hintline=L.polyline([f,b],this.options.hintlineStyle),this._setPane(this._hintline,"layerPane"),this._hintline._pmTempLayer=!0,this._helperLayers.addLayer(this._hintline)},_createCenterMarker:function(n){var r=this._createMarker(n);return this.options.draggable?L.DomUtil.addClass(r._icon,"leaflet-pm-draggable"):r.dragging.disable(),r},_createOuterMarker:function(n){var r=this._createMarker(n);return r.on("drag",this._resizeCircle,this),r},_createMarker:function(n){var r=new L.Marker(n,{draggable:!0,icon:L.divIcon({className:"marker-icon"})});return this._setPane(r,"vertexPane"),r._origLatLng=n,r._pmTempLayer=!0,r.on("dragstart",this._onMarkerDragStart,this),r.on("drag",this._onMarkerDrag,this),r.on("dragend",this._onMarkerDragEnd,this),this._helperLayers.addLayer(r),r},_moveCircle:function(){var n=this._centerMarker.getLatLng();this._layer.setLatLng(n);var r=this._layer._radius,f=this._getLatLngOnCircle(n,r);this._outerMarker._latlng=f,this._outerMarker.update(),this._syncHintLine(),this._updateHiddenPolyCircle(),this._fireCenterPlaced("Edit"),this._fireChange(this._layer.getLatLng(),"Edit")},_syncMarkers:function(){var n=this._layer.getLatLng(),r=this._layer._radius,f=this._getLatLngOnCircle(n,r);this._outerMarker.setLatLng(f),this._centerMarker.setLatLng(n),this._syncHintLine(),this._updateHiddenPolyCircle()},_resizeCircle:function(){this._outerMarker.setLatLng(this._getNewDestinationOfOuterMarker()),this._syncHintLine(),this._syncCircleRadius()},_syncCircleRadius:function(){var n=this._centerMarker.getLatLng(),r=this._outerMarker.getLatLng(),f=this._map.project(n).distanceTo(this._map.project(r));this.options.minRadiusCircleMarker&&fthis.options.maxRadiusCircleMarker?this._layer.setRadius(this.options.maxRadiusCircleMarker):this._layer.setRadius(f),this._updateHiddenPolyCircle(),this._fireChange(this._layer.getLatLng(),"Edit")},_syncHintLine:function(){var n=this._centerMarker.getLatLng(),r=this._outerMarker.getLatLng();this._hintline.setLatLngs([n,r])},_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(n){this._vertexValidation("move",n)&&this._fireMarkerDragStart(n)},_onMarkerDrag:function(n){var r=n.target;r instanceof L.Marker&&!this._vertexValidationDrag(r)||this._fireMarkerDrag(n)},_onMarkerDragEnd:function(n){this._map.pm.Draw.CircleMarker._layerIsDragging=!1;var r=n.target;this._vertexValidationDragEnd(r)&&(this.options.editable&&(this._fireEdit(),this._layerEdited=!0),this._fireMarkerDragEnd(n))},_initSnappableMarkersDrag:function(){var n=this._layer;this.options.snapDistance=this.options.snapDistance||30,this.options.snapSegment=this.options.snapSegment===void 0||this.options.snapSegment,n.off("pm:drag",this._handleSnapping,this),n.on("pm:drag",this._handleSnapping,this),n.off("pm:dragend",this._cleanupSnapping,this),n.on("pm:dragend",this._cleanupSnapping,this),n.off("pm:dragstart",this._unsnap,this),n.on("pm:dragstart",this._unsnap,this)},_disableSnappingDrag:function(){var n=this._layer;n.off("pm:drag",this._handleSnapping,this),n.off("pm:dragend",this._cleanupSnapping,this),n.off("pm:dragstart",this._unsnap,this)},_updateHiddenPolyCircle:function(){var n=this._layer._map||this._map;if(n){var r=L.PM.Utils.pxRadiusToMeterRadius(this._layer.getRadius(),n,this._layer.getLatLng()),f=L.circle(this._layer.getLatLng(),this._layer.options);f.setRadius(r);var b=n&&n.pm._isCRSSimple();this._hiddenPolyCircle?this._hiddenPolyCircle.setLatLngs(L.PM.Utils.circleToPolygon(f,200,!b).getLatLngs()):this._hiddenPolyCircle=L.PM.Utils.circleToPolygon(f,200,!b),this._hiddenPolyCircle._parentCopy||(this._hiddenPolyCircle._parentCopy=this._layer)}},_getNewDestinationOfOuterMarker:function(){var n=this._centerMarker.getLatLng(),r=this._outerMarker.getLatLng(),f=this._map.project(n).distanceTo(this._map.project(r));return this.options.minRadiusCircleMarker&&fthis.options.maxRadiusCircleMarker&&(r=Ge(this._map,n,r,L.PM.Utils.pxRadiusToMeterRadius(this.options.maxRadiusCircleMarker,this._map,n))),r},_handleOuterMarkerSnapping:function(){if(this._outerMarker._snapped){var n=this._centerMarker.getLatLng(),r=this._outerMarker.getLatLng(),f=this._map.project(n).distanceTo(this._map.project(r));(this.options.minRadiusCircleMarker&&fthis.options.maxRadiusCircleMarker)&&this._outerMarker.setLatLng(this._outerMarker._orgLatLng)}this._outerMarker.setLatLng(this._getNewDestinationOfOuterMarker())}}),Xe.ImageOverlay=Xe.extend({_shape:"ImageOverlay",initialize:function(n){this._layer=n,this._enabled=!1},toggleEdit:function(n){this.enabled()?this.disable():this.enable(n)},enabled:function(){return this._enabled},enable:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{draggable:!0,snappable:!0};L.Util.setOptions(this,n),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 n=this._layer.getBounds();return[n.getNorthWest(),n.getNorthEast(),n.getSouthEast(),n.getSouthWest()]}}),Xe.Text=Xe.extend({_shape:"Text",initialize:function(n){this._layer=n,this._enabled=!1},enable:function(n){L.Util.setOptions(this,n),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 n=document.activeElement;this.textArea.focus(),this.textArea.selectionStart=0,this.textArea.selectionEnd=0,L.DomEvent.on(this.textArea,"mousedown",this._preventTextSelection),n.focus(),this._disableOnBlurActive=!1,this._layerEdited&&this._fireUpdate(),this._layerEdited=!1,this._fireDisable(),this._enabled=!1}},enabled:function(){return this._enabled},toggleEdit:function(n){this.enabled()?this.disable():this.enable(n)},applyOptions:function(){this.options.snappable?this._initSnappableMarkers():this._disableSnapping()},_initSnappableMarkers:function(){var n=this._layer;this.options.snapDistance=this.options.snapDistance||30,this.options.snapSegment=this.options.snapSegment===void 0||this.options.snapSegment,n.off("pm:drag",this._handleSnapping,this),n.on("pm:drag",this._handleSnapping,this),n.off("pm:dragend",this._cleanupSnapping,this),n.on("pm:dragend",this._cleanupSnapping,this),n.off("pm:dragstart",this._unsnap,this),n.on("pm:dragstart",this._unsnap,this)},_disableSnapping:function(){var n=this._layer;n.off("pm:drag",this._handleSnapping,this),n.off("pm:dragend",this._cleanupSnapping,this),n.off("pm:dragstart",this._unsnap,this)},_autoResize:function(){this.textArea.style.height="1px",this.textArea.style.width="1px";var n=this.textArea.scrollHeight>21?this.textArea.scrollHeight:21,r=this.textArea.scrollWidth>16?this.textArea.scrollWidth:16;this.textArea.style.height="".concat(n,"px"),this.textArea.style.width="".concat(r,"px"),this._layer.options.text=this.getText(),this._fireTextChange(this.getText())},_disableOnBlur:function(){var n=this;this._disableOnBlurActive=!0,setTimeout(function(){n.enabled()&&L.DomEvent.on(document,"click",n._documentClick,n)},100)},_documentClick:function(n){n.target!==this.textArea&&(this.disable(),!this.getText()&&this.options.removeIfEmpty&&this.remove())},_focusChange:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=this._hasFocus;this._hasFocus=n.type==="focus",!r!=!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(n){this.textArea.value=n,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 n,r=this.options.className.split(" ");(n=this.textArea.classList).add.apply(n,Vo(r))}var f=L.PM.Draw.Text.prototype._createTextIcon.call(this,this.textArea);this._layer.setIcon(f),this._layer.once("add",this._createTextMarker,this)},_createTextMarker:function(){var n=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(),n===!0&&(this.enable(),this.focus(),this._disableOnBlur())},_preventTextSelection:function(n){n.preventDefault()}});var _o=function(n,r,f,b,F,x){this._matrix=[n,r,f,b,F,x]};_o.init=function(){return new L.PM.Matrix(1,0,0,1,0,0)},_o.prototype={transform:function(n){return this._transform(n.clone())},_transform:function(n){var r=this._matrix,f=n.x,b=n.y;return n.x=r[0]*f+r[1]*b+r[4],n.y=r[2]*f+r[3]*b+r[5],n},untransform:function(n){var r=this._matrix;return new L.Point((n.x/r[0]-r[4])/r[0],(n.y/r[2]-r[5])/r[2])},clone:function(){var n=this._matrix;return new L.PM.Matrix(n[0],n[1],n[2],n[3],n[4],n[5])},translate:function(n){return n===void 0?new L.Point(this._matrix[4],this._matrix[5]):(typeof n=="number"?(r=n,f=n):(r=n.x,f=n.y),this._add(1,0,0,1,r,f));var r,f},scale:function(n,r){return n===void 0?new L.Point(this._matrix[0],this._matrix[3]):(r=r||L.point(0,0),typeof n=="number"?(f=n,b=n):(f=n.x,b=n.y),this._add(f,0,0,b,r.x,r.y)._add(1,0,0,1,-r.x,-r.y));var f,b},rotate:function(n,r){var f=Math.cos(n),b=Math.sin(n);return r=r||new L.Point(0,0),this._add(f,b,-b,f,r.x,r.y)._add(1,0,0,1,-r.x,-r.y)},flip:function(){return this._matrix[1]*=-1,this._matrix[2]*=-1,this},_add:function(n,r,f,b,F,x){var A,B=[[],[],[]],D=this._matrix,T=[[D[0],D[2],D[4]],[D[1],D[3],D[5]],[0,0,1]],K=[[n,f,F],[r,b,x],[0,0,1]];n&&n instanceof L.PM.Matrix&&(K=[[(D=n._matrix)[0],D[2],D[4]],[D[1],D[3],D[5]],[0,0,1]]);for(var ne=0;ne<3;ne+=1)for(var Q=0;Q<3;Q+=1){A=0;for(var se=0;se<3;se+=1)A+=T[ne][se]*K[se][Q];B[ne][Q]=A}return this._matrix=[B[0][0],B[1][0],B[0][1],B[1][1],B[0][2],B[1][2]],this}};let Me=_o;var Tt={calcMiddleLatLng:function(n,r,f){var b=n.project(r),F=n.project(f);return n.unproject(b._add(F)._divideBy(2))},findLayers:function(n){var r=[];return n.eachLayer(function(f){(f instanceof L.Polyline||f instanceof L.Marker||f instanceof L.Circle||f instanceof L.CircleMarker||f instanceof L.ImageOverlay)&&r.push(f)}),r=(r=(r=r.filter(function(f){return!!f.pm})).filter(function(f){return!f._pmTempLayer})).filter(function(f){return!L.PM.optIn&&!f.options.pmIgnore||L.PM.optIn&&f.options.pmIgnore===!1})},circleToPolygon:function(n){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:60,f=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],b=n.getLatLng(),F=n.getRadius(),x=Qe(b,F,r,0,f),A=[],B=0;B3&&arguments[3]!==void 0&&arguments[3];n.fire(r,f,b);var F=this.getAllParentGroups(n),x=F.groups;x.forEach(function(A){A.fire(r,f,b)})},getAllParentGroups:function(n){var r=[],f=[];return!n._pmLastGroupFetch||!n._pmLastGroupFetch.time||new Date().getTime()-n._pmLastGroupFetch.time>1e3?(function b(F){for(var x in F._eventParents)if(r.indexOf(x)===-1){r.push(x);var A=F._eventParents[x];f.push(A),b(A)}}(n),n._pmLastGroupFetch={time:new Date().getTime(),groups:f,groupIds:r},{groupIds:r,groups:f}):{groups:n._pmLastGroupFetch.groups,groupIds:n._pmLastGroupFetch.groupIds}},createGeodesicPolygon:Qe,getTranslation:ue,findDeepCoordIndex:function(n,r){var f,b=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],F=function A(B){return function(D,T){var K=B.concat(T);if(b){if(D.lat&&D.lat===r.lat&&D.lng===r.lng)return f=K,!0}else if(D.lat&&L.latLng(D).equals(r))return f=K,!0;return Array.isArray(D)&&D.some(A(K))}};n.some(F([]));var x={};return f&&(x={indexPath:f,index:f[f.length-1],parentPath:f.slice(0,f.length-1)}),x},findDeepMarkerIndex:function(n,r){var f;n.some(function F(x){return function(A,B){var D=x.concat(B);return A._leaflet_id===r._leaflet_id?(f=D,!0):Array.isArray(A)&&A.some(F(D))}}([]));var b={};return f&&(b={indexPath:f,index:f[f.length-1],parentPath:f.slice(0,f.length-1)}),b},_getIndexFromSegment:function(n,r){if(r&&r.length===2){var f=this.findDeepCoordIndex(n,r[0]),b=this.findDeepCoordIndex(n,r[1]),F=Math.max(f.index,b.index);return f.index!==0&&b.index!==0||F===1||(F+=1),{indexA:f,indexB:b,newIndex:F,indexPath:f.indexPath,parentPath:f.parentPath}}return null},_getRotatedRectangle:function(n,r,f,b){var F=St(b,n),x=St(b,r),A=f*Math.PI/180,B=Math.cos(A),D=Math.sin(A),T=(x.x-F.x)*B+(x.y-F.y)*D,K=(x.y-F.y)*B-(x.x-F.x)*D,ne=T*B+F.x,Q=T*D+F.y,se=-K*D+F.x,he=K*B+F.y;return[Wt(b,F),Wt(b,{x:ne,y:Q}),Wt(b,x),Wt(b,{x:se,y:he})]},pxRadiusToMeterRadius:function(n,r,f){var b=r.project(f),F=L.point(b.x+n,b.y);return r.distance(r.unproject(F),f)}};let He=Tt;L.PM=L.PM||{version:"2.14.2",Map:xn,Toolbar:lo,Draw:S,Edit:Xe,Utils:He,Matrix:Me,activeLang:"en",optIn:!1,initialize:function(n){this.addInitHooks(n)},setOptIn:function(n){this.optIn=!!n},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(n){var r=this;n instanceof L.LayerGroup&&n.eachLayer(function(f){r.reInitLayer(f)}),n.pm||L.PM.optIn&&n.options.pmIgnore!==!1||n.options.pmIgnore||(n instanceof L.Map?n.pm=new L.PM.Map(n):n instanceof L.Marker?n.options.textMarker?(n.pm=new L.PM.Edit.Text(n),n.pm._initTextMarker(),n.pm._createTextMarker(!1)):n.pm=new L.PM.Edit.Marker(n):n instanceof L.Circle?n.pm=new L.PM.Edit.Circle(n):n instanceof L.CircleMarker?n.pm=new L.PM.Edit.CircleMarker(n):n instanceof L.Rectangle?n.pm=new L.PM.Edit.Rectangle(n):n instanceof L.Polygon?n.pm=new L.PM.Edit.Polygon(n):n instanceof L.Polyline?n.pm=new L.PM.Edit.Line(n):n instanceof L.LayerGroup?n.pm=new L.PM.Edit.LayerGroup(n):n instanceof L.ImageOverlay&&(n.pm=new L.PM.Edit.ImageOverlay(n)))}},L.version==="1.7.1"&&L.Canvas.include({_onClick:function(n){for(var r,f,b=this._map.mouseEventToLayerPoint(n),F=this._drawFirst;F;F=F.next)(r=F.layer).options.interactive&&r._containsPoint(b)&&(n.type!=="click"&&n.type!=="preclick"||!this._map._draggableMoved(r))&&(f=r);f&&(L.DomEvent.fakeStop(n),this._fireEvent([f],n))}}),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 c=Object(this),d=c.length>>>0,m=arguments[1],h=0;h>>0,m=arguments[1],h=0;h>>0;if(m===0)return!1;for(var h,p,v=0|c,y=Math.max(v>=0?v:m-Math.abs(v),0);y{var m=d(2582),h=d(4102),p=d(1540),v=d(9705).Z,y=p.featureEach,R=(p.coordEach,h.polygon,h.featureCollection);function G($){var N=new m($);return N.insert=function(O){if(O.type!=="Feature")throw new Error("invalid feature");return O.bbox=O.bbox?O.bbox:v(O),m.prototype.insert.call(this,O)},N.load=function(O){var J=[];return Array.isArray(O)?O.forEach(function(I){if(I.type!=="Feature")throw new Error("invalid features");I.bbox=I.bbox?I.bbox:v(I),J.push(I)}):y(O,function(I){if(I.type!=="Feature")throw new Error("invalid features");I.bbox=I.bbox?I.bbox:v(I),J.push(I)}),m.prototype.load.call(this,J)},N.remove=function(O,J){if(O.type!=="Feature")throw new Error("invalid feature");return O.bbox=O.bbox?O.bbox:v(O),m.prototype.remove.call(this,O,J)},N.clear=function(){return m.prototype.clear.call(this)},N.search=function(O){var J=m.prototype.search.call(this,this.toBBox(O));return R(J)},N.collides=function(O){return m.prototype.collides.call(this,this.toBBox(O))},N.all=function(){var O=m.prototype.all.call(this);return R(O)},N.toJSON=function(){return m.prototype.toJSON.call(this)},N.fromJSON=function(O){return m.prototype.fromJSON.call(this,O)},N.toBBox=function(O){var J;if(O.bbox)J=O.bbox;else if(Array.isArray(O)&&O.length===4)J=O;else if(Array.isArray(O)&&O.length===6)J=[O[0],O[1],O[3],O[4]];else if(O.type==="Feature")J=v(O);else{if(O.type!=="FeatureCollection")throw new Error("invalid geojson");J=v(O)}return{minX:J[0],minY:J[1],maxX:J[2],maxY:J[3]}},N}a.exports=G,a.exports.default=G},1989:(a,c,d)=>{var m=d(1789),h=d(401),p=d(7667),v=d(1327),y=d(1866);function R(G){var $=-1,N=G==null?0:G.length;for(this.clear();++${var m=d(7040),h=d(4125),p=d(2117),v=d(7518),y=d(4705);function R(G){var $=-1,N=G==null?0:G.length;for(this.clear();++${var m=d(852)(d(5639),"Map");a.exports=m},3369:(a,c,d)=>{var m=d(4785),h=d(1285),p=d(6e3),v=d(9916),y=d(5265);function R(G){var $=-1,N=G==null?0:G.length;for(this.clear();++${var m=d(8407),h=d(7465),p=d(3779),v=d(7599),y=d(4758),R=d(4309);function G($){var N=this.__data__=new m($);this.size=N.size}G.prototype.clear=h,G.prototype.delete=p,G.prototype.get=v,G.prototype.has=y,G.prototype.set=R,a.exports=G},2705:(a,c,d)=>{var m=d(5639).Symbol;a.exports=m},1149:(a,c,d)=>{var m=d(5639).Uint8Array;a.exports=m},6874:a=>{a.exports=function(c,d,m){switch(m.length){case 0:return c.call(d);case 1:return c.call(d,m[0]);case 2:return c.call(d,m[0],m[1]);case 3:return c.call(d,m[0],m[1],m[2])}return c.apply(d,m)}},4636:(a,c,d)=>{var m=d(2545),h=d(5694),p=d(1469),v=d(4144),y=d(5776),R=d(6719),G=Object.prototype.hasOwnProperty;a.exports=function($,N){var O=p($),J=!O&&h($),I=!O&&!J&&v($),q=!O&&!J&&!I&&R($),V=O||J||I||q,E=V?m($.length,String):[],z=E.length;for(var H in $)!N&&!G.call($,H)||V&&(H=="length"||I&&(H=="offset"||H=="parent")||q&&(H=="buffer"||H=="byteLength"||H=="byteOffset")||y(H,z))||E.push(H);return E}},9932:a=>{a.exports=function(c,d){for(var m=-1,h=c==null?0:c.length,p=Array(h);++m{var m=d(9465),h=d(7813);a.exports=function(p,v,y){(y!==void 0&&!h(p[v],y)||y===void 0&&!(v in p))&&m(p,v,y)}},4865:(a,c,d)=>{var m=d(9465),h=d(7813),p=Object.prototype.hasOwnProperty;a.exports=function(v,y,R){var G=v[y];p.call(v,y)&&h(G,R)&&(R!==void 0||y in v)||m(v,y,R)}},8470:(a,c,d)=>{var m=d(7813);a.exports=function(h,p){for(var v=h.length;v--;)if(m(h[v][0],p))return v;return-1}},9465:(a,c,d)=>{var m=d(8777);a.exports=function(h,p,v){p=="__proto__"&&m?m(h,p,{configurable:!0,enumerable:!0,value:v,writable:!0}):h[p]=v}},3118:(a,c,d)=>{var m=d(3218),h=Object.create,p=function(){function v(){}return function(y){if(!m(y))return{};if(h)return h(y);v.prototype=y;var R=new v;return v.prototype=void 0,R}}();a.exports=p},8483:(a,c,d)=>{var m=d(5063)();a.exports=m},7786:(a,c,d)=>{var m=d(1811),h=d(327);a.exports=function(p,v){for(var y=0,R=(v=m(v,p)).length;p!=null&&y{var m=d(2705),h=d(9607),p=d(2333),v=m?m.toStringTag:void 0;a.exports=function(y){return y==null?y===void 0?"[object Undefined]":"[object Null]":v&&v in Object(y)?h(y):p(y)}},8565:a=>{var c=Object.prototype.hasOwnProperty;a.exports=function(d,m){return d!=null&&c.call(d,m)}},9454:(a,c,d)=>{var m=d(4239),h=d(7005);a.exports=function(p){return h(p)&&m(p)=="[object Arguments]"}},8458:(a,c,d)=>{var m=d(3560),h=d(5346),p=d(3218),v=d(346),y=/^\[object .+?Constructor\]$/,R=Function.prototype,G=Object.prototype,$=R.toString,N=G.hasOwnProperty,O=RegExp("^"+$.call(N).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");a.exports=function(J){return!(!p(J)||h(J))&&(m(J)?O:y).test(v(J))}},8749:(a,c,d)=>{var m=d(4239),h=d(1780),p=d(7005),v={};v["[object Float32Array]"]=v["[object Float64Array]"]=v["[object Int8Array]"]=v["[object Int16Array]"]=v["[object Int32Array]"]=v["[object Uint8Array]"]=v["[object Uint8ClampedArray]"]=v["[object Uint16Array]"]=v["[object Uint32Array]"]=!0,v["[object Arguments]"]=v["[object Array]"]=v["[object ArrayBuffer]"]=v["[object Boolean]"]=v["[object DataView]"]=v["[object Date]"]=v["[object Error]"]=v["[object Function]"]=v["[object Map]"]=v["[object Number]"]=v["[object Object]"]=v["[object RegExp]"]=v["[object Set]"]=v["[object String]"]=v["[object WeakMap]"]=!1,a.exports=function(y){return p(y)&&h(y.length)&&!!v[m(y)]}},313:(a,c,d)=>{var m=d(3218),h=d(5726),p=d(3498),v=Object.prototype.hasOwnProperty;a.exports=function(y){if(!m(y))return p(y);var R=h(y),G=[];for(var $ in y)($!="constructor"||!R&&v.call(y,$))&&G.push($);return G}},2980:(a,c,d)=>{var m=d(6384),h=d(6556),p=d(8483),v=d(9783),y=d(3218),R=d(1704),G=d(6390);a.exports=function $(N,O,J,I,q){N!==O&&p(O,function(V,E){if(q||(q=new m),y(V))v(N,O,E,J,$,I,q);else{var z=I?I(G(N,E),V,E+"",N,O,q):void 0;z===void 0&&(z=V),h(N,E,z)}},R)}},9783:(a,c,d)=>{var m=d(6556),h=d(4626),p=d(7133),v=d(278),y=d(8517),R=d(5694),G=d(1469),$=d(9246),N=d(4144),O=d(3560),J=d(3218),I=d(8630),q=d(6719),V=d(6390),E=d(9881);a.exports=function(z,H,re,le,U,ee,ce){var de=V(z,re),pe=V(H,re),Ce=ce.get(pe);if(Ce)m(z,re,Ce);else{var _e=ee?ee(de,pe,re+"",z,H,ce):void 0,me=_e===void 0;if(me){var ve=G(pe),te=!ve&&N(pe),ge=!ve&&!te&&q(pe);_e=pe,ve||te||ge?G(de)?_e=de:$(de)?_e=v(de):te?(me=!1,_e=h(pe,!0)):ge?(me=!1,_e=p(pe,!0)):_e=[]:I(pe)||R(pe)?(_e=de,R(de)?_e=E(de):J(de)&&!O(de)||(_e=y(pe))):me=!1}me&&(ce.set(pe,_e),U(_e,pe,le,ee,ce),ce.delete(pe)),m(z,re,_e)}}},5976:(a,c,d)=>{var m=d(6557),h=d(5357),p=d(61);a.exports=function(v,y){return p(h(v,y,m),v+"")}},6560:(a,c,d)=>{var m=d(5703),h=d(8777),p=d(6557),v=h?function(y,R){return h(y,"toString",{configurable:!0,enumerable:!1,value:m(R),writable:!0})}:p;a.exports=v},2545:a=>{a.exports=function(c,d){for(var m=-1,h=Array(c);++m{var m=d(2705),h=d(9932),p=d(1469),v=d(3448),y=m?m.prototype:void 0,R=y?y.toString:void 0;a.exports=function G($){if(typeof $=="string")return $;if(p($))return h($,G)+"";if(v($))return R?R.call($):"";var N=$+"";return N=="0"&&1/$==-1/0?"-0":N}},1717:a=>{a.exports=function(c){return function(d){return c(d)}}},1811:(a,c,d)=>{var m=d(1469),h=d(5403),p=d(5514),v=d(9833);a.exports=function(y,R){return m(y)?y:h(y,R)?[y]:p(v(y))}},4318:(a,c,d)=>{var m=d(1149);a.exports=function(h){var p=new h.constructor(h.byteLength);return new m(p).set(new m(h)),p}},4626:(a,c,d)=>{a=d.nmd(a);var m=d(5639),h=c&&!c.nodeType&&c,p=h&&a&&!a.nodeType&&a,v=p&&p.exports===h?m.Buffer:void 0,y=v?v.allocUnsafe:void 0;a.exports=function(R,G){if(G)return R.slice();var $=R.length,N=y?y($):new R.constructor($);return R.copy(N),N}},7133:(a,c,d)=>{var m=d(4318);a.exports=function(h,p){var v=p?m(h.buffer):h.buffer;return new h.constructor(v,h.byteOffset,h.length)}},278:a=>{a.exports=function(c,d){var m=-1,h=c.length;for(d||(d=Array(h));++m{var m=d(4865),h=d(9465);a.exports=function(p,v,y,R){var G=!y;y||(y={});for(var $=-1,N=v.length;++${var m=d(5639)["__core-js_shared__"];a.exports=m},1463:(a,c,d)=>{var m=d(5976),h=d(6612);a.exports=function(p){return m(function(v,y){var R=-1,G=y.length,$=G>1?y[G-1]:void 0,N=G>2?y[2]:void 0;for($=p.length>3&&typeof $=="function"?(G--,$):void 0,N&&h(y[0],y[1],N)&&($=G<3?void 0:$,G=1),v=Object(v);++R{a.exports=function(c){return function(d,m,h){for(var p=-1,v=Object(d),y=h(d),R=y.length;R--;){var G=y[c?R:++p];if(m(v[G],G,v)===!1)break}return d}}},8777:(a,c,d)=>{var m=d(852),h=function(){try{var p=m(Object,"defineProperty");return p({},"",{}),p}catch(v){}}();a.exports=h},1957:(a,c,d)=>{var m=typeof d.g=="object"&&d.g&&d.g.Object===Object&&d.g;a.exports=m},5050:(a,c,d)=>{var m=d(7019);a.exports=function(h,p){var v=h.__data__;return m(p)?v[typeof p=="string"?"string":"hash"]:v.map}},852:(a,c,d)=>{var m=d(8458),h=d(7801);a.exports=function(p,v){var y=h(p,v);return m(y)?y:void 0}},5924:(a,c,d)=>{var m=d(5569)(Object.getPrototypeOf,Object);a.exports=m},9607:(a,c,d)=>{var m=d(2705),h=Object.prototype,p=h.hasOwnProperty,v=h.toString,y=m?m.toStringTag:void 0;a.exports=function(R){var G=p.call(R,y),$=R[y];try{R[y]=void 0;var N=!0}catch(J){}var O=v.call(R);return N&&(G?R[y]=$:delete R[y]),O}},7801:a=>{a.exports=function(c,d){return c==null?void 0:c[d]}},222:(a,c,d)=>{var m=d(1811),h=d(5694),p=d(1469),v=d(5776),y=d(1780),R=d(327);a.exports=function(G,$,N){for(var O=-1,J=($=m($,G)).length,I=!1;++O{var m=d(4536);a.exports=function(){this.__data__=m?m(null):{},this.size=0}},401:a=>{a.exports=function(c){var d=this.has(c)&&delete this.__data__[c];return this.size-=d?1:0,d}},7667:(a,c,d)=>{var m=d(4536),h=Object.prototype.hasOwnProperty;a.exports=function(p){var v=this.__data__;if(m){var y=v[p];return y==="__lodash_hash_undefined__"?void 0:y}return h.call(v,p)?v[p]:void 0}},1327:(a,c,d)=>{var m=d(4536),h=Object.prototype.hasOwnProperty;a.exports=function(p){var v=this.__data__;return m?v[p]!==void 0:h.call(v,p)}},1866:(a,c,d)=>{var m=d(4536);a.exports=function(h,p){var v=this.__data__;return this.size+=this.has(h)?0:1,v[h]=m&&p===void 0?"__lodash_hash_undefined__":p,this}},8517:(a,c,d)=>{var m=d(3118),h=d(5924),p=d(5726);a.exports=function(v){return typeof v.constructor!="function"||p(v)?{}:m(h(v))}},5776:a=>{var c=/^(?:0|[1-9]\d*)$/;a.exports=function(d,m){var h=typeof d;return!!(m=m==null?9007199254740991:m)&&(h=="number"||h!="symbol"&&c.test(d))&&d>-1&&d%1==0&&d{var m=d(7813),h=d(8612),p=d(5776),v=d(3218);a.exports=function(y,R,G){if(!v(G))return!1;var $=typeof R;return!!($=="number"?h(G)&&p(R,G.length):$=="string"&&R in G)&&m(G[R],y)}},5403:(a,c,d)=>{var m=d(1469),h=d(3448),p=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,v=/^\w*$/;a.exports=function(y,R){if(m(y))return!1;var G=typeof y;return!(G!="number"&&G!="symbol"&&G!="boolean"&&y!=null&&!h(y))||v.test(y)||!p.test(y)||R!=null&&y in Object(R)}},7019:a=>{a.exports=function(c){var d=typeof c;return d=="string"||d=="number"||d=="symbol"||d=="boolean"?c!=="__proto__":c===null}},5346:(a,c,d)=>{var m,h=d(4429),p=(m=/[^.]+$/.exec(h&&h.keys&&h.keys.IE_PROTO||""))?"Symbol(src)_1."+m:"";a.exports=function(v){return!!p&&p in v}},5726:a=>{var c=Object.prototype;a.exports=function(d){var m=d&&d.constructor;return d===(typeof m=="function"&&m.prototype||c)}},7040:a=>{a.exports=function(){this.__data__=[],this.size=0}},4125:(a,c,d)=>{var m=d(8470),h=Array.prototype.splice;a.exports=function(p){var v=this.__data__,y=m(v,p);return!(y<0)&&(y==v.length-1?v.pop():h.call(v,y,1),--this.size,!0)}},2117:(a,c,d)=>{var m=d(8470);a.exports=function(h){var p=this.__data__,v=m(p,h);return v<0?void 0:p[v][1]}},7518:(a,c,d)=>{var m=d(8470);a.exports=function(h){return m(this.__data__,h)>-1}},4705:(a,c,d)=>{var m=d(8470);a.exports=function(h,p){var v=this.__data__,y=m(v,h);return y<0?(++this.size,v.push([h,p])):v[y][1]=p,this}},4785:(a,c,d)=>{var m=d(1989),h=d(8407),p=d(7071);a.exports=function(){this.size=0,this.__data__={hash:new m,map:new(p||h),string:new m}}},1285:(a,c,d)=>{var m=d(5050);a.exports=function(h){var p=m(this,h).delete(h);return this.size-=p?1:0,p}},6e3:(a,c,d)=>{var m=d(5050);a.exports=function(h){return m(this,h).get(h)}},9916:(a,c,d)=>{var m=d(5050);a.exports=function(h){return m(this,h).has(h)}},5265:(a,c,d)=>{var m=d(5050);a.exports=function(h,p){var v=m(this,h),y=v.size;return v.set(h,p),this.size+=v.size==y?0:1,this}},4523:(a,c,d)=>{var m=d(8306);a.exports=function(h){var p=m(h,function(y){return v.size===500&&v.clear(),y}),v=p.cache;return p}},4536:(a,c,d)=>{var m=d(852)(Object,"create");a.exports=m},3498:a=>{a.exports=function(c){var d=[];if(c!=null)for(var m in Object(c))d.push(m);return d}},1167:(a,c,d)=>{a=d.nmd(a);var m=d(1957),h=c&&!c.nodeType&&c,p=h&&a&&!a.nodeType&&a,v=p&&p.exports===h&&m.process,y=function(){try{var R=p&&p.require&&p.require("util").types;return R||v&&v.binding&&v.binding("util")}catch(G){}}();a.exports=y},2333:a=>{var c=Object.prototype.toString;a.exports=function(d){return c.call(d)}},5569:a=>{a.exports=function(c,d){return function(m){return c(d(m))}}},5357:(a,c,d)=>{var m=d(6874),h=Math.max;a.exports=function(p,v,y){return v=h(v===void 0?p.length-1:v,0),function(){for(var R=arguments,G=-1,$=h(R.length-v,0),N=Array($);++G<$;)N[G]=R[v+G];G=-1;for(var O=Array(v+1);++G{var m=d(1957),h=typeof self=="object"&&self&&self.Object===Object&&self,p=m||h||Function("return this")();a.exports=p},6390:a=>{a.exports=function(c,d){if((d!=="constructor"||typeof c[d]!="function")&&d!="__proto__")return c[d]}},61:(a,c,d)=>{var m=d(6560),h=d(1275)(m);a.exports=h},1275:a=>{var c=Date.now;a.exports=function(d){var m=0,h=0;return function(){var p=c(),v=16-(p-h);if(h=p,v>0){if(++m>=800)return arguments[0]}else m=0;return d.apply(void 0,arguments)}}},7465:(a,c,d)=>{var m=d(8407);a.exports=function(){this.__data__=new m,this.size=0}},3779:a=>{a.exports=function(c){var d=this.__data__,m=d.delete(c);return this.size=d.size,m}},7599:a=>{a.exports=function(c){return this.__data__.get(c)}},4758:a=>{a.exports=function(c){return this.__data__.has(c)}},4309:(a,c,d)=>{var m=d(8407),h=d(7071),p=d(3369);a.exports=function(v,y){var R=this.__data__;if(R instanceof m){var G=R.__data__;if(!h||G.length<199)return G.push([v,y]),this.size=++R.size,this;R=this.__data__=new p(G)}return R.set(v,y),this.size=R.size,this}},5514:(a,c,d)=>{var m=d(4523),h=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,p=/\\(\\)?/g,v=m(function(y){var R=[];return y.charCodeAt(0)===46&&R.push(""),y.replace(h,function(G,$,N,O){R.push(N?O.replace(p,"$1"):$||G)}),R});a.exports=v},327:(a,c,d)=>{var m=d(3448);a.exports=function(h){if(typeof h=="string"||m(h))return h;var p=h+"";return p=="0"&&1/h==-1/0?"-0":p}},346:a=>{var c=Function.prototype.toString;a.exports=function(d){if(d!=null){try{return c.call(d)}catch(m){}try{return d+""}catch(m){}}return""}},5703:a=>{a.exports=function(c){return function(){return c}}},7813:a=>{a.exports=function(c,d){return c===d||c!=c&&d!=d}},7361:(a,c,d)=>{var m=d(7786);a.exports=function(h,p,v){var y=h==null?void 0:m(h,p);return y===void 0?v:y}},8721:(a,c,d)=>{var m=d(8565),h=d(222);a.exports=function(p,v){return p!=null&&h(p,v,m)}},6557:a=>{a.exports=function(c){return c}},5694:(a,c,d)=>{var m=d(9454),h=d(7005),p=Object.prototype,v=p.hasOwnProperty,y=p.propertyIsEnumerable,R=m(function(){return arguments}())?m:function(G){return h(G)&&v.call(G,"callee")&&!y.call(G,"callee")};a.exports=R},1469:a=>{var c=Array.isArray;a.exports=c},8612:(a,c,d)=>{var m=d(3560),h=d(1780);a.exports=function(p){return p!=null&&h(p.length)&&!m(p)}},9246:(a,c,d)=>{var m=d(8612),h=d(7005);a.exports=function(p){return h(p)&&m(p)}},4144:(a,c,d)=>{a=d.nmd(a);var m=d(5639),h=d(5062),p=c&&!c.nodeType&&c,v=p&&a&&!a.nodeType&&a,y=v&&v.exports===p?m.Buffer:void 0,R=(y?y.isBuffer:void 0)||h;a.exports=R},3560:(a,c,d)=>{var m=d(4239),h=d(3218);a.exports=function(p){if(!h(p))return!1;var v=m(p);return v=="[object Function]"||v=="[object GeneratorFunction]"||v=="[object AsyncFunction]"||v=="[object Proxy]"}},1780:a=>{a.exports=function(c){return typeof c=="number"&&c>-1&&c%1==0&&c<=9007199254740991}},3218:a=>{a.exports=function(c){var d=typeof c;return c!=null&&(d=="object"||d=="function")}},7005:a=>{a.exports=function(c){return c!=null&&typeof c=="object"}},8630:(a,c,d)=>{var m=d(4239),h=d(5924),p=d(7005),v=Function.prototype,y=Object.prototype,R=v.toString,G=y.hasOwnProperty,$=R.call(Object);a.exports=function(N){if(!p(N)||m(N)!="[object Object]")return!1;var O=h(N);if(O===null)return!0;var J=G.call(O,"constructor")&&O.constructor;return typeof J=="function"&&J instanceof J&&R.call(J)==$}},3448:(a,c,d)=>{var m=d(4239),h=d(7005);a.exports=function(p){return typeof p=="symbol"||h(p)&&m(p)=="[object Symbol]"}},6719:(a,c,d)=>{var m=d(8749),h=d(1717),p=d(1167),v=p&&p.isTypedArray,y=v?h(v):m;a.exports=y},1704:(a,c,d)=>{var m=d(4636),h=d(313),p=d(8612);a.exports=function(v){return p(v)?m(v,!0):h(v)}},8306:(a,c,d)=>{var m=d(3369);function h(p,v){if(typeof p!="function"||v!=null&&typeof v!="function")throw new TypeError("Expected a function");var y=function(){var R=arguments,G=v?v.apply(this,R):R[0],$=y.cache;if($.has(G))return $.get(G);var N=p.apply(this,R);return y.cache=$.set(G,N)||$,N};return y.cache=new(h.Cache||m),y}h.Cache=m,a.exports=h},2492:(a,c,d)=>{var m=d(2980),h=d(1463)(function(p,v,y){m(p,v,y)});a.exports=h},5062:a=>{a.exports=function(){return!1}},9881:(a,c,d)=>{var m=d(8363),h=d(1704);a.exports=function(p){return m(p,h(p))}},9833:(a,c,d)=>{var m=d(531);a.exports=function(h){return h==null?"":m(h)}},2676:function(a){a.exports=function(){"use strict";function c(M,_){if(!(M instanceof _))throw new TypeError("Cannot call a class as a function")}function d(M,_){for(var w=0;w<_.length;w++){var C=_[w];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(M,C.key,C)}}function m(M,_,w){return _&&d(M.prototype,_),w&&d(M,w),M}var h=function(){function M(_,w){this.next=null,this.key=_,this.data=w,this.left=null,this.right=null}return M}();function p(M,_){return M>_?1:M<_?-1:0}function v(M,_,w){for(var C=new h(null,null),S=C,j=C;;){var oe=w(M,_.key);if(oe<0){if(_.left===null)break;if(w(M,_.left.key)<0){var ie=_.left;if(_.left=ie.right,ie.right=_,(_=ie).left===null)break}j.left=_,j=_,_=_.left}else{if(!(oe>0)||_.right===null||w(M,_.right.key)>0&&(ie=_.right,_.right=ie.left,ie.left=_,(_=ie).right===null))break;S.right=_,S=_,_=_.right}}return S.right=_.left,j.left=_.right,_.left=C.right,_.right=C.left,_}function y(M,_,w,C){var S=new h(M,_);if(w===null)return S.left=S.right=null,S;var j=C(M,(w=v(M,w,C)).key);return j<0?(S.left=w.left,S.right=w,w.left=null):j>=0&&(S.right=w.right,S.left=w,w.right=null),S}function R(M,_,w){var C=null,S=null;if(_){var j=w((_=v(M,_,w)).key,M);j===0?(C=_.left,S=_.right):j<0?(S=_.right,_.right=null,C=_):(C=_.left,_.left=null,S=_)}return{left:C,right:S}}function G(M,_,w){return _===null?M:(M===null||((_=v(M.key,_,w)).left=M),_)}function $(M,_,w,C,S){if(M){C(_+(w?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ")+S(M)+` `);var j=_+(w?" ":"\u2502 ");M.left&&$(M.left,j,!1,C,S),M.right&&$(M.right,j,!0,C,S)}}var N=function(){function M(_){_===void 0&&(_=p),this._root=null,this._size=0,this._comparator=_}return M.prototype.insert=function(_,w){return this._size++,this._root=y(_,w,this._root,this._comparator)},M.prototype.add=function(_,w){var C=new h(_,w);this._root===null&&(C.left=C.right=null,this._size++,this._root=C);var S=this._comparator,j=v(_,this._root,S),oe=S(_,j.key);return oe===0?this._root=j:(oe<0?(C.left=j.left,C.right=j,j.left=null):oe>0&&(C.right=j.right,C.left=j,j.right=null),this._size++,this._root=C),this._root},M.prototype.remove=function(_){this._root=this._remove(_,this._root,this._comparator)},M.prototype._remove=function(_,w,C){var S;return w===null?null:C(_,(w=v(_,w,C)).key)===0?(w.left===null?S=w.right:(S=v(_,w.left,C)).right=w.right,this._size--,S):w},M.prototype.pop=function(){var _=this._root;if(_){for(;_.left;)_=_.left;return this._root=v(_.key,this._root,this._comparator),this._root=this._remove(_.key,this._root,this._comparator),{key:_.key,data:_.data}}return null},M.prototype.findStatic=function(_){for(var w=this._root,C=this._comparator;w;){var S=C(_,w.key);if(S===0)return w;w=S<0?w.left:w.right}return null},M.prototype.find=function(_){return this._root&&(this._root=v(_,this._root,this._comparator),this._comparator(_,this._root.key)!==0)?null:this._root},M.prototype.contains=function(_){for(var w=this._root,C=this._comparator;w;){var S=C(_,w.key);if(S===0)return!0;w=S<0?w.left:w.right}return!1},M.prototype.forEach=function(_,w){for(var C=this._root,S=[],j=!1;!j;)C!==null?(S.push(C),C=C.left):S.length!==0?(C=S.pop(),_.call(w,C),C=C.right):j=!0;return this},M.prototype.range=function(_,w,C,S){for(var j=[],oe=this._comparator,ie=this._root;j.length!==0||ie;)if(ie)j.push(ie),ie=ie.left;else{if(oe((ie=j.pop()).key,w)>0)break;if(oe(ie.key,_)>=0&&C.call(S,ie))return this;ie=ie.right}return this},M.prototype.keys=function(){var _=[];return this.forEach(function(w){var C=w.key;return _.push(C)}),_},M.prototype.values=function(){var _=[];return this.forEach(function(w){var C=w.data;return _.push(C)}),_},M.prototype.min=function(){return this._root?this.minNode(this._root).key:null},M.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},M.prototype.minNode=function(_){if(_===void 0&&(_=this._root),_)for(;_.left;)_=_.left;return _},M.prototype.maxNode=function(_){if(_===void 0&&(_=this._root),_)for(;_.right;)_=_.right;return _},M.prototype.at=function(_){for(var w=this._root,C=!1,S=0,j=[];!C;)if(w)j.push(w),w=w.left;else if(j.length>0){if(w=j.pop(),S===_)return w;S++,w=w.right}else C=!0;return null},M.prototype.next=function(_){var w=this._root,C=null;if(_.right){for(C=_.right;C.left;)C=C.left;return C}for(var S=this._comparator;w;){var j=S(_.key,w.key);if(j===0)break;j<0?(C=w,w=w.left):w=w.right}return C},M.prototype.prev=function(_){var w=this._root,C=null;if(_.left!==null){for(C=_.left;C.right;)C=C.right;return C}for(var S=this._comparator;w;){var j=S(_.key,w.key);if(j===0)break;j<0?w=w.left:(C=w,w=w.right)}return C},M.prototype.clear=function(){return this._root=null,this._size=0,this},M.prototype.toList=function(){return I(this._root)},M.prototype.load=function(_,w,C){w===void 0&&(w=[]),C===void 0&&(C=!1);var S=_.length,j=this._comparator;if(C&&E(_,w,0,S-1,j),this._root===null)this._root=O(_,w,0,S),this._size=S;else{var oe=V(this.toList(),J(_,w),j);S=this._size+S,this._root=q({head:oe},0,S)}return this},M.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(M.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(M.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),M.prototype.toString=function(_){_===void 0&&(_=function(C){return String(C.key)});var w=[];return $(this._root,"",!0,function(C){return w.push(C)},_),w.join("")},M.prototype.update=function(_,w,C){var S=this._comparator,j=R(_,this._root,S),oe=j.left,ie=j.right;S(_,w)<0?ie=y(w,C,ie,S):oe=y(w,C,oe,S),this._root=G(oe,ie,S)},M.prototype.split=function(_){return R(_,this._root,this._comparator)},M}();function O(M,_,w,C){var S=C-w;if(S>0){var j=w+Math.floor(S/2),oe=M[j],ie=_[j],fe=new h(oe,ie);return fe.left=O(M,_,w,j),fe.right=O(M,_,j+1,C),fe}return null}function J(M,_){for(var w=new h(null,null),C=w,S=0;S0?_=(_=j=j.next=w.pop()).right:C=!0;return j.next=null,S.next}function q(M,_,w){var C=w-_;if(C>0){var S=_+Math.floor(C/2),j=q(M,_,S),oe=M.head;return oe.left=j,M.head=M.head.next,oe.right=q(M,S+1,w),oe}return null}function V(M,_,w){for(var C=new h(null,null),S=C,j=M,oe=_;j!==null&&oe!==null;)w(j.key,oe.key)<0?(S.next=j,j=j.next):(S.next=oe,oe=oe.next),S=S.next;return j!==null?S.next=j:oe!==null&&(S.next=oe),C.next}function E(M,_,w,C,S){if(!(w>=C)){for(var j=M[w+C>>1],oe=w-1,ie=C+1;;){do oe++;while(S(M[oe],j)<0);do ie--;while(S(M[ie],j)>0);if(oe>=ie)break;var fe=M[oe];M[oe]=M[ie],M[ie]=fe,fe=_[oe],_[oe]=_[ie],_[ie]=fe}E(M,_,w,ie,S),E(M,_,ie+1,C,S)}}var z=function(M,_){return M.ll.x<=_.x&&_.x<=M.ur.x&&M.ll.y<=_.y&&_.y<=M.ur.y},H=function(M,_){if(_.ur.xw.x?1:_.yw.y?1:0}}]),m(M,[{key:"link",value:function(_){if(_.point===this.point)throw new Error("Tried to link already linked events");for(var w=_.point.events,C=0,S=w.length;C=0&&Re>=0?xeTe?-1:0:fe<0&&Re<0?xeTe?1:0:Refe?1:0}}}]),M}(),Be=0,Ae=function(){function M(_,w,C,S){c(this,M),this.id=++Be,this.leftSE=_,_.segment=this,_.otherSE=w,this.rightSE=w,w.segment=this,w.otherSE=_,this.rings=C,this.windings=S}return m(M,null,[{key:"compare",value:function(_,w){var C=_.leftSE.point.x,S=w.leftSE.point.x,j=_.rightSE.point.x,oe=w.rightSE.point.x;if(oeie&&fe>xe)return-1;var Re=_.comparePoint(w.leftSE.point);if(Re<0)return 1;if(Re>0)return-1;var Te=w.comparePoint(_.rightSE.point);return Te!==0?Te:-1}if(C>S){if(iefe&&ie>De)return 1;var Ne=w.comparePoint(_.leftSE.point);if(Ne!==0)return Ne;var Se=_.comparePoint(w.rightSE.point);return Se<0?1:Se>0?-1:1}if(iefe)return 1;if(joe){var Ze=_.comparePoint(w.rightSE.point);if(Ze<0)return 1;if(Ze>0)return-1}if(j!==oe){var ot=xe-ie,dt=j-C,rt=De-fe,at=oe-S;if(ot>dt&&rtat)return-1}return j>oe?1:jDe?1:_.idw.id?1:0}}]),m(M,[{key:"replaceRightSE",value:function(_){this.rightSE=_,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var _=this.leftSE.point.y,w=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:_w?_:w}}}},{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(_){return _.x===this.leftSE.point.x&&_.y===this.leftSE.point.y||_.x===this.rightSE.point.x&&_.y===this.rightSE.point.y}},{key:"comparePoint",value:function(_){if(this.isAnEndpoint(_))return 0;var w=this.leftSE.point,C=this.rightSE.point,S=this.vector();if(w.x===C.x)return _.x===w.x?0:_.x0&&ie.swapEvents(),we.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),C&&(S.checkForConsuming(),j.checkForConsuming()),w}},{key:"swapEvents",value:function(){var _=this.rightSE;this.rightSE=this.leftSE,this.leftSE=_,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var w=0,C=this.windings.length;w0){var j=w;w=C,C=j}if(w.prev===C){var oe=w;w=C,C=oe}for(var ie=0,fe=C.rings.length;ie0))throw new Error("Tried to create degenerate segment at [".concat(_.x,", ").concat(_.y,"]"));S=w,j=_,oe=-1}return new M(new we(S,!0),new we(j,!1),[C],[oe])}}]),M}(),Qe=function(){function M(_,w,C){if(c(this,M),!Array.isArray(_)||_.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=w,this.isExterior=C,this.segments=[],typeof _[0][0]!="number"||typeof _[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var S=de.round(_[0][0],_[0][1]);this.bbox={ll:{x:S.x,y:S.y},ur:{x:S.x,y:S.y}};for(var j=S,oe=1,ie=_.length;oethis.bbox.ur.x&&(this.bbox.ur.x=fe.x),fe.y>this.bbox.ur.y&&(this.bbox.ur.y=fe.y),j=fe)}S.x===j.x&&S.y===j.y||this.segments.push(Ae.fromRing(j,S,this))}return m(M,[{key:"getSweepEvents",value:function(){for(var _=[],w=0,C=this.segments.length;wthis.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=w}return m(M,[{key:"getSweepEvents",value:function(){for(var _=this.exteriorRing.getSweepEvents(),w=0,C=this.interiorRings.length;wthis.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=w}return m(M,[{key:"getSweepEvents",value:function(){for(var _=[],w=0,C=this.polys.length;w0&&(_=S)}for(var j=_.segment.prevInResult(),oe=j?j.prevInResult():null;;){if(!j)return null;if(!oe)return j.ringOut;if(oe.ringOut!==j.ringOut)return oe.ringOut.enclosingRing()!==j.ringOut?j.ringOut:j.ringOut.enclosingRing();j=oe.prevInResult(),oe=j?j.prevInResult():null}}}]),M}(),wt=function(){function M(_){c(this,M),this.exteriorRing=_,_.poly=this,this.interiorRings=[]}return m(M,[{key:"addInterior",value:function(_){this.interiorRings.push(_),_.poly=this}},{key:"getGeom",value:function(){var _=[this.exteriorRing.getGeom()];if(_[0]===null)return null;for(var w=0,C=this.interiorRings.length;w1&&arguments[1]!==void 0?arguments[1]:Ae.compare;c(this,M),this.queue=_,this.tree=new N(w),this.segments=[]}return m(M,[{key:"process",value:function(_){var w=_.segment,C=[];if(_.consumedBy)return _.isLeft?this.queue.remove(_.otherSE):this.tree.remove(w),C;var S=_.isLeft?this.tree.insert(w):this.tree.find(w);if(!S)throw new Error("Unable to find segment #".concat(w.id," ")+"[".concat(w.leftSE.point.x,", ").concat(w.leftSE.point.y,"] -> ")+"[".concat(w.rightSE.point.x,", ").concat(w.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var j=S,oe=S,ie=void 0,fe=void 0;ie===void 0;)(j=this.tree.prev(j))===null?ie=null:j.key.consumedBy===void 0&&(ie=j.key);for(;fe===void 0;)(oe=this.tree.next(oe))===null?fe=null:oe.key.consumedBy===void 0&&(fe=oe.key);if(_.isLeft){var xe=null;if(ie){var De=ie.getIntersection(w);if(De!==null&&(w.isAnEndpoint(De)||(xe=De),!ie.isAnEndpoint(De)))for(var Re=this._splitSafely(ie,De),Te=0,Ne=Re.length;Te0?(this.tree.remove(w),C.push(_)):(this.segments.push(w),w.prev=ie)}else{if(ie&&fe){var mt=ie.getIntersection(fe);if(mt!==null){if(!ie.isAnEndpoint(mt))for(var xt=this._splitSafely(ie,mt),jt=0,tn=xt.length;jtUn)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var at=new xn(Se),Dt=Se.size,Mt=Se.pop();Mt;){var mt=Mt.key;if(Se.size===Dt){var xt=mt.segment;throw new Error("Unable to pop() ".concat(mt.isLeft?"left":"right"," SweepEvent ")+"[".concat(mt.point.x,", ").concat(mt.point.y,"] from segment #").concat(xt.id," ")+"[".concat(xt.leftSE.point.x,", ").concat(xt.leftSE.point.y,"] -> ")+"[".concat(xt.rightSE.point.x,", ").concat(xt.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(Se.size>Un)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(at.segments.length>Cn)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var jt=at.process(mt),tn=0,ft=jt.length;tn1?_-1:0),C=1;C<_;C++)w[C-1]=arguments[C];return ct.run("union",M,w)},qt=function(M){for(var _=arguments.length,w=new Array(_>1?_-1:0),C=1;C<_;C++)w[C-1]=arguments[C];return ct.run("intersection",M,w)},lo=function(M){for(var _=arguments.length,w=new Array(_>1?_-1:0),C=1;C<_;C++)w[C-1]=arguments[C];return ct.run("xor",M,w)},En=function(M){for(var _=arguments.length,w=new Array(_>1?_-1:0),C=1;C<_;C++)w[C-1]=arguments[C];return ct.run("difference",M,w)};return{union:Ln,intersection:qt,xor:lo,difference:En}}()},2582:function(a){a.exports=function(){"use strict";function c(E,z,H,re,le){(function U(ee,ce,de,pe,Ce){for(;pe>de;){if(pe-de>600){var _e=pe-de+1,me=ce-de+1,ve=Math.log(_e),te=.5*Math.exp(2*ve/3),ge=.5*Math.sqrt(ve*te*(_e-te)/_e)*(me-_e/2<0?-1:1);U(ee,ce,Math.max(de,Math.floor(ce-me*te/_e+ge)),Math.min(pe,Math.floor(ce+(_e-me)*te/_e+ge)),Ce)}var ye=ee[ce],ue=de,we=pe;for(d(ee,de,ce),Ce(ee[pe],ye)>0&&d(ee,de,pe);ue0;)we--}Ce(ee[de],ye)===0?d(ee,de,we):d(ee,++we,pe),we<=ce&&(de=we+1),ce<=we&&(pe=we-1)}})(E,z,H||0,re||E.length-1,le||m)}function d(E,z,H){var re=E[z];E[z]=E[H],E[H]=re}function m(E,z){return Ez?1:0}var h=function(E){E===void 0&&(E=9),this._maxEntries=Math.max(4,E),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function p(E,z,H){if(!H)return z.indexOf(E);for(var re=0;re=E.minX&&z.maxY>=E.minY}function q(E){return{children:E,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function V(E,z,H,re,le){for(var U=[z,H];U.length;)if(!((H=U.pop())-(z=U.pop())<=re)){var ee=z+Math.ceil((H-z)/re/2)*re;c(E,ee,z,H,le),U.push(z,ee,ee,H)}}return h.prototype.all=function(){return this._all(this.data,[])},h.prototype.search=function(E){var z=this.data,H=[];if(!I(E,z))return H;for(var re=this.toBBox,le=[];z;){for(var U=0;U=0&&le[z].children.length>this._maxEntries;)this._split(le,z),z--;this._adjustParentBBoxes(re,le,z)},h.prototype._split=function(E,z){var H=E[z],re=H.children.length,le=this._minEntries;this._chooseSplitAxis(H,le,re);var U=this._chooseSplitIndex(H,le,re),ee=q(H.children.splice(U,H.children.length-U));ee.height=H.height,ee.leaf=H.leaf,v(H,this.toBBox),v(ee,this.toBBox),z?E[z-1].children.push(ee):this._splitRoot(H,ee)},h.prototype._splitRoot=function(E,z){this.data=q([E,z]),this.data.height=E.height+1,this.data.leaf=!1,v(this.data,this.toBBox)},h.prototype._chooseSplitIndex=function(E,z,H){for(var re,le,U,ee,ce,de,pe,Ce=1/0,_e=1/0,me=z;me<=H-z;me++){var ve=y(E,0,me,this.toBBox),te=y(E,me,H,this.toBBox),ge=(le=ve,U=te,ee=void 0,ce=void 0,de=void 0,pe=void 0,ee=Math.max(le.minX,U.minX),ce=Math.max(le.minY,U.minY),de=Math.min(le.maxX,U.maxX),pe=Math.min(le.maxY,U.maxY),Math.max(0,de-ee)*Math.max(0,pe-ce)),ye=N(ve)+N(te);ge=z;Ce--){var _e=E.children[Ce];R(ee,E.leaf?le(_e):_e),ce+=O(ee)}return ce},h.prototype._adjustParentBBoxes=function(E,z,H){for(var re=H;re>=0;re--)R(z[re],E)},h.prototype._condense=function(E){for(var z=E.length-1,H=void 0;z>=0;z--)E[z].children.length===0?z>0?(H=E[z-1].children).splice(H.indexOf(E[z]),1):this.clear():v(E[z],this.toBBox)},h}()}},i={};function s(a){var c=i[a];if(c!==void 0)return c.exports;var d=i[a]={id:a,loaded:!1,exports:{}};return t[a].call(d.exports,d,d.exports,s),d.loaded=!0,d.exports}s.n=a=>{var c=a&&a.__esModule?()=>a.default:()=>a;return s.d(c,{a:c}),c},s.d=(a,c)=>{for(var d in c)s.o(c,d)&&!s.o(a,d)&&Object.defineProperty(a,d,{enumerable:!0,get:c[d]})},s.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch(a){if(typeof window=="object")return window}}(),s.o=(a,c)=>Object.prototype.hasOwnProperty.call(a,c),s.nmd=a=>(a.paths=[],a.children||(a.children=[]),a),s(5975)})()});(function(){var t=i();function i(){if(typeof window.CustomEvent=="function")return window.CustomEvent;function c(d,m){m=m||{bubbles:!1,cancelable:!1,detail:void 0};var h=document.createEvent("CustomEvent");return h.initCustomEvent(d,m.bubbles,m.cancelable,m.detail),h}return c.prototype=window.Event.prototype,c}function s(c,d){var m=document.createElement("input");return m.type="hidden",m.name=c,m.value=d,m}function a(c,d){var m=c.getAttribute("data-to"),h=s("_method",c.getAttribute("data-method")),p=s("_csrf_token",c.getAttribute("data-csrf")),v=document.createElement("form"),y=document.createElement("input"),R=c.getAttribute("target");v.method=c.getAttribute("data-method")==="get"?"get":"post",v.action=m,v.style.display="none",R?v.target=R:d&&(v.target="_blank"),v.appendChild(p),v.appendChild(h),document.body.appendChild(v),y.type="submit",v.appendChild(y),y.click()}window.addEventListener("click",function(c){var d=c.target;if(!c.defaultPrevented)for(;d&&d.getAttribute;){var m=new t("phoenix.link.click",{bubbles:!0,cancelable:!0});if(!d.dispatchEvent(m))return c.preventDefault(),c.stopImmediatePropagation(),!1;if(d.getAttribute("data-method")&&d.getAttribute("data-to"))return a(d,c.metaKey||c.shiftKey),c.preventDefault(),!1;d=d.parentNode}},!1),window.addEventListener("phoenix.link.click",function(c){var d=c.target.getAttribute("data-confirm");d&&!window.confirm(d)&&c.preventDefault()},!1)})();var Ao=t=>typeof t=="function"?t:function(){return t},rl=typeof self!="undefined"?self:null,Eo=typeof window!="undefined"?window:null,Rn=rl||Eo||Rn,al="2.0.0",Xt={connecting:0,open:1,closing:2,closed:3},sl=1e4,ll=1e3,Lt={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},fn={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},ar={longpoll:"longpoll",websocket:"websocket"},cl={complete:4},di=class{constructor(t,i,s,a){this.channel=t,this.event=i,this.payload=s||function(){return{}},this.receivedResp=null,this.timeout=a,this.timeoutTimer=null,this.recHooks=[],this.sent=!1}resend(t){this.timeout=t,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(t,i){return this.hasReceived(t)&&i(this.receivedResp.response),this.recHooks.push({status:t,callback:i}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}matchReceive({status:t,response:i,_ref:s}){this.recHooks.filter(a=>a.status===t).forEach(a=>a.callback(i))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,t=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=t,this.matchReceive(t)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}trigger(t,i){this.channel.trigger(this.refEvent,{status:t,response:i})}},ha=class{constructor(t,i){this.callback=t,this.timerCalc=i,this.timer=null,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},dl=class{constructor(t,i,s){this.state=Lt.closed,this.topic=t,this.params=Ao(i||{}),this.socket=s,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new di(this,fn.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new ha(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive("ok",()=>{this.state=Lt.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(a=>a.send()),this.pushBuffer=[]}),this.joinPush.receive("error",()=>{this.state=Lt.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic} ${this.joinRef()}`),this.state=Lt.closed,this.socket.remove(this)}),this.onError(a=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,a),this.isJoining()&&this.joinPush.reset(),this.state=Lt.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic} (${this.joinRef()})`,this.joinPush.timeout),new di(this,fn.leave,Ao({}),this.timeout).send(),this.state=Lt.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(fn.reply,(a,c)=>{this.trigger(this.replyEventName(c),a)})}join(t=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=t,this.joinedOnce=!0,this.rejoin(),this.joinPush}onClose(t){this.on(fn.close,t)}onError(t){return this.on(fn.error,i=>t(i))}on(t,i){let s=this.bindingRef++;return this.bindings.push({event:t,ref:s,callback:i}),s}off(t,i){this.bindings=this.bindings.filter(s=>!(s.event===t&&(typeof i=="undefined"||i===s.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(t,i,s=this.timeout){if(i=i||{},!this.joinedOnce)throw new Error(`tried to push '${t}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let a=new di(this,t,function(){return i},s);return this.canPush()?a.send():(a.startTimeout(),this.pushBuffer.push(a)),a}leave(t=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=Lt.leaving;let i=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(fn.close,"leave")},s=new di(this,fn.leave,Ao({}),t);return s.receive("ok",()=>i()).receive("timeout",()=>i()),s.send(),this.canPush()||s.trigger("ok",{}),s}onMessage(t,i,s){return i}isMember(t,i,s,a){return this.topic!==t?!1:a&&a!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:t,event:i,payload:s,joinRef:a}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(t=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=Lt.joining,this.joinPush.resend(t))}trigger(t,i,s,a){let c=this.onMessage(t,i,s,a);if(i&&!c)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let d=this.bindings.filter(m=>m.event===t);for(let m=0;m{let h=this.parseJSON(t.responseText);m&&m(h)},d&&(t.ontimeout=d),t.onprogress=()=>{},t.send(a),t}static xhrRequest(t,i,s,a,c,d,m,h){return t.open(i,s,!0),t.timeout=d,t.setRequestHeader("Content-Type",a),t.onerror=()=>h&&h(null),t.onreadystatechange=()=>{if(t.readyState===cl.complete&&h){let p=this.parseJSON(t.responseText);h(p)}},m&&(t.ontimeout=m),t.send(c),t}static parseJSON(t){if(!t||t==="")return null;try{return JSON.parse(t)}catch(i){return console&&console.log("failed to parse JSON response",t),null}}static serialize(t,i){let s=[];for(var a in t){if(!Object.prototype.hasOwnProperty.call(t,a))continue;let c=i?`${i}[${a}]`:a,d=t[a];typeof d=="object"?s.push(this.serialize(d,c)):s.push(encodeURIComponent(c)+"="+encodeURIComponent(d))}return s.join("&")}static appendParams(t,i){if(Object.keys(i).length===0)return t;let s=t.match(/\?/)?"&":"?";return`${t}${s}${this.serialize(i)}`}},fl=t=>{let i="",s=new Uint8Array(t),a=s.byteLength;for(let c=0;cthis.poll(),0)}normalizeEndpoint(t){return t.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+ar.websocket),"$1/"+ar.longpoll)}endpointURL(){return mi.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(t,i,s){this.close(t,i,s),this.readyState=Xt.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===Xt.open||this.readyState===Xt.connecting}poll(){this.ajax("GET","application/json",null,()=>this.ontimeout(),t=>{if(t){var{status:i,token:s,messages:a}=t;this.token=s}else i=0;switch(i){case 200:a.forEach(c=>{setTimeout(()=>this.onmessage({data:c}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=Xt.open,this.onopen({}),this.poll();break;case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw new Error(`unhandled poll status ${i}`)}})}send(t){typeof t!="string"&&(t=fl(t)),this.currentBatch?this.currentBatch.push(t):this.awaitingBatchAck?this.batchBuffer.push(t):(this.currentBatch=[t],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(t){this.awaitingBatchAck=!0,this.ajax("POST","application/x-ndjson",t.join(` `),()=>this.onerror("timeout"),i=>{this.awaitingBatchAck=!1,!i||i.status!==200?(this.onerror(i&&i.status),this.closeAndRetry(1011,"internal server error",!1)):this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[])})}close(t,i,s){for(let c of this.reqs)c.abort();this.readyState=Xt.closed;let a=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:t,reason:i,wasClean:s});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent!="undefined"?this.onclose(new CloseEvent("close",a)):this.onclose(a)}ajax(t,i,s,a,c){let d,m=()=>{this.reqs.delete(d),a()};d=mi.request(t,this.endpointURL(),i,s,this.timeout,m,h=>{this.reqs.delete(d),this.isActive()&&c(h)}),this.reqs.add(d)}};var fi={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(t,i){if(t.payload.constructor===ArrayBuffer)return i(this.binaryEncode(t));{let s=[t.join_ref,t.ref,t.topic,t.event,t.payload];return i(JSON.stringify(s))}},decode(t,i){if(t.constructor===ArrayBuffer)return i(this.binaryDecode(t));{let[s,a,c,d,m]=JSON.parse(t);return i({join_ref:s,ref:a,topic:c,event:d,payload:m})}},binaryEncode(t){let{join_ref:i,ref:s,event:a,topic:c,payload:d}=t,m=this.META_LENGTH+i.length+s.length+c.length+a.length,h=new ArrayBuffer(this.HEADER_LENGTH+m),p=new DataView(h),v=0;p.setUint8(v++,this.KINDS.push),p.setUint8(v++,i.length),p.setUint8(v++,s.length),p.setUint8(v++,c.length),p.setUint8(v++,a.length),Array.from(i,R=>p.setUint8(v++,R.charCodeAt(0))),Array.from(s,R=>p.setUint8(v++,R.charCodeAt(0))),Array.from(c,R=>p.setUint8(v++,R.charCodeAt(0))),Array.from(a,R=>p.setUint8(v++,R.charCodeAt(0)));var y=new Uint8Array(h.byteLength+d.byteLength);return y.set(new Uint8Array(h),0),y.set(new Uint8Array(d),h.byteLength),y.buffer},binaryDecode(t){let i=new DataView(t),s=i.getUint8(0),a=new TextDecoder;switch(s){case this.KINDS.push:return this.decodePush(t,i,a);case this.KINDS.reply:return this.decodeReply(t,i,a);case this.KINDS.broadcast:return this.decodeBroadcast(t,i,a)}},decodePush(t,i,s){let a=i.getUint8(1),c=i.getUint8(2),d=i.getUint8(3),m=this.HEADER_LENGTH+this.META_LENGTH-1,h=s.decode(t.slice(m,m+a));m=m+a;let p=s.decode(t.slice(m,m+c));m=m+c;let v=s.decode(t.slice(m,m+d));m=m+d;let y=t.slice(m,t.byteLength);return{join_ref:h,ref:null,topic:p,event:v,payload:y}},decodeReply(t,i,s){let a=i.getUint8(1),c=i.getUint8(2),d=i.getUint8(3),m=i.getUint8(4),h=this.HEADER_LENGTH+this.META_LENGTH,p=s.decode(t.slice(h,h+a));h=h+a;let v=s.decode(t.slice(h,h+c));h=h+c;let y=s.decode(t.slice(h,h+d));h=h+d;let R=s.decode(t.slice(h,h+m));h=h+m;let G=t.slice(h,t.byteLength),$={status:R,response:G};return{join_ref:p,ref:v,topic:y,event:fn.reply,payload:$}},decodeBroadcast(t,i,s){let a=i.getUint8(1),c=i.getUint8(2),d=this.HEADER_LENGTH+2,m=s.decode(t.slice(d,d+a));d=d+a;let h=s.decode(t.slice(d,d+c));d=d+c;let p=t.slice(d,t.byteLength);return{join_ref:null,ref:null,topic:m,event:h,payload:p}}},ba=class{constructor(t,i={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.timeout=i.timeout||sl,this.transport=i.transport||Rn.WebSocket||Lo,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=i.longPollFallbackMs,this.fallbackTimer=null,this.sessionStore=i.sessionStorage||Rn&&Rn.sessionStorage,this.establishedConnections=0,this.defaultEncoder=fi.encode.bind(fi),this.defaultDecoder=fi.decode.bind(fi),this.closeWasClean=!1,this.disconnecting=!1,this.binaryType=i.binaryType||"arraybuffer",this.connectClock=1,this.transport!==Lo?(this.encode=i.encode||this.defaultEncoder,this.decode=i.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let s=null;Eo&&Eo.addEventListener&&(Eo.addEventListener("pagehide",a=>{this.conn&&(this.disconnect(),s=this.connectClock)}),Eo.addEventListener("pageshow",a=>{s===this.connectClock&&(s=null,this.connect())})),this.heartbeatIntervalMs=i.heartbeatIntervalMs||3e4,this.rejoinAfterMs=a=>i.rejoinAfterMs?i.rejoinAfterMs(a):[1e3,2e3,5e3][a-1]||1e4,this.reconnectAfterMs=a=>i.reconnectAfterMs?i.reconnectAfterMs(a):[10,50,100,150,200,250,500,1e3,2e3][a-1]||5e3,this.logger=i.logger||null,!this.logger&&i.debug&&(this.logger=(a,c,d)=>{console.log(`${a}: ${c}`,d)}),this.longpollerTimeout=i.longpollerTimeout||2e4,this.params=Ao(i.params||{}),this.endPoint=`${t}/${ar.websocket}`,this.vsn=i.vsn||al,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new ha(()=>{this.teardown(()=>this.connect())},this.reconnectAfterMs)}getLongPollTransport(){return Lo}replaceTransport(t){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=t}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let t=mi.appendParams(mi.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return t.charAt(0)!=="/"?t:t.charAt(1)==="/"?`${this.protocol()}:${t}`:`${this.protocol()}://${location.host}${t}`}disconnect(t,i,s){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,t&&t()},i,s)}connect(t){t&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=Ao(t)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==Lo?this.connectWithFallback(Lo,this.longPollFallbackMs):this.transportConnect())}log(t,i,s){this.logger&&this.logger(t,i,s)}hasLogger(){return this.logger!==null}onOpen(t){let i=this.makeRef();return this.stateChangeCallbacks.open.push([i,t]),i}onClose(t){let i=this.makeRef();return this.stateChangeCallbacks.close.push([i,t]),i}onError(t){let i=this.makeRef();return this.stateChangeCallbacks.error.push([i,t]),i}onMessage(t){let i=this.makeRef();return this.stateChangeCallbacks.message.push([i,t]),i}ping(t){if(!this.isConnected())return!1;let i=this.makeRef(),s=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:i});let a=this.onMessage(c=>{c.ref===i&&(this.off([a]),t(Date.now()-s))});return!0}transportConnect(){this.connectClock++,this.closeWasClean=!1,this.conn=new this.transport(this.endPointURL()),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=t=>this.onConnError(t),this.conn.onmessage=t=>this.onConnMessage(t),this.conn.onclose=t=>this.onConnClose(t)}getSession(t){return this.sessionStore&&this.sessionStore.getItem(t)}storeSession(t,i){this.sessionStore&&this.sessionStore.setItem(t,i)}connectWithFallback(t,i=2500){clearTimeout(this.fallbackTimer);let s=!1,a=!0,c,d,m=h=>{this.log("transport",`falling back to ${t.name}...`,h),this.off([c,d]),a=!1,this.replaceTransport(t),this.transportConnect()};if(this.getSession(`phx:fallback:${t.name}`))return m("memorized");this.fallbackTimer=setTimeout(m,i),d=this.onError(h=>{this.log("transport","error",h),a&&!s&&(clearTimeout(this.fallbackTimer),m(h))}),this.onOpen(()=>{if(s=!0,!a)return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${t.name}`,"true"),this.log("transport",`established ${t.name} fallback`);clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(m,i),this.ping(h=>{this.log("transport","connected to primary after",h),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`${this.transport.name} connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.resetHeartbeat(),this.stateChangeCallbacks.open.forEach(([,t])=>t())}heartbeatTimeout(){this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection"),this.triggerChanError(),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),ll,"heartbeat timeout"))}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(t,i,s){if(!this.conn)return t&&t();let a=this.connectClock;this.waitForBufferDone(()=>{a===this.connectClock&&(this.conn&&(i?this.conn.close(i,s||""):this.conn.close()),this.waitForSocketClosed(()=>{a===this.connectClock&&(this.conn&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),t&&t())}))})}waitForBufferDone(t,i=1){if(i===5||!this.conn||!this.conn.bufferedAmount){t();return}setTimeout(()=>{this.waitForBufferDone(t,i+1)},150*i)}waitForSocketClosed(t,i=1){if(i===5||!this.conn||this.conn.readyState===Xt.closed){t();return}setTimeout(()=>{this.waitForSocketClosed(t,i+1)},150*i)}onConnClose(t){let i=t&&t.code;this.hasLogger()&&this.log("transport","close",t),this.triggerChanError(),this.clearHeartbeats(),!this.closeWasClean&&i!==1e3&&this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach(([,s])=>s(t))}onConnError(t){this.hasLogger()&&this.log("transport",t);let i=this.transport,s=this.establishedConnections;this.stateChangeCallbacks.error.forEach(([,a])=>{a(t,i,s)}),(i===this.transport||s>0)&&this.triggerChanError()}triggerChanError(){this.channels.forEach(t=>{t.isErrored()||t.isLeaving()||t.isClosed()||t.trigger(fn.error)})}connectionState(){switch(this.conn&&this.conn.readyState){case Xt.connecting:return"connecting";case Xt.open:return"open";case Xt.closing:return"closing";default:return"closed"}}isConnected(){return this.connectionState()==="open"}remove(t){this.off(t.stateChangeRefs),this.channels=this.channels.filter(i=>i!==t)}off(t){for(let i in this.stateChangeCallbacks)this.stateChangeCallbacks[i]=this.stateChangeCallbacks[i].filter(([s])=>t.indexOf(s)===-1)}channel(t,i={}){let s=new dl(t,i,this);return this.channels.push(s),s}push(t){if(this.hasLogger()){let{topic:i,event:s,payload:a,ref:c,join_ref:d}=t;this.log("push",`${i} ${s} (${d}, ${c})`,a)}this.isConnected()?this.encode(t,i=>this.conn.send(i)):this.sendBuffer.push(()=>this.encode(t,i=>this.conn.send(i)))}makeRef(){let t=this.ref+1;return t===this.ref?this.ref=0:this.ref=t,this.ref.toString()}sendHeartbeat(){this.pendingHeartbeatRef&&!this.isConnected()||(this.pendingHeartbeatRef=this.makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs))}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(t=>t()),this.sendBuffer=[])}onConnMessage(t){this.decode(t.data,i=>{let{topic:s,event:a,payload:c,ref:d,join_ref:m}=i;d&&d===this.pendingHeartbeatRef&&(this.clearHeartbeats(),this.pendingHeartbeatRef=null,this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)),this.hasLogger()&&this.log("receive",`${c.status||""} ${s} ${a} ${d&&"("+d+")"||""}`,c);for(let h=0;hs.topic===t&&(s.isJoined()||s.isJoining()));i&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${t}"`),i.leave())}};var Ga="consecutive-reloads",ml=10,ul=5e3,hl=1e4,bl=3e4,Ha=["phx-click-loading","phx-change-loading","phx-submit-loading","phx-keydown-loading","phx-keyup-loading","phx-blur-loading","phx-focus-loading","phx-hook-loading"],un="data-phx-component",sr="data-phx-link",pl="track-static",gl="data-phx-link-state",Et="data-phx-ref",kn="data-phx-ref-src",qa="track-uploads",hn="data-phx-upload-ref",yr="data-phx-preflighted-refs",Fl="data-phx-done-refs",pa="drop-target",pr="data-phx-active-refs",ki="phx:live-file:updated",Za="data-phx-skip",Va="data-phx-id",ga="data-phx-prune",Fa="page-loading",va="phx-connected",Bo="phx-loading",ui="phx-no-feedback",hi="phx-error",_a="phx-client-error",lr="phx-server-error",zn="data-phx-parent-id",kr="data-phx-main",In="data-phx-root-id",gr="viewport-top",Fr="viewport-bottom",vl="trigger-action",xi="feedback-for",Ci="feedback-group",vr="phx-has-focused",_l=["text","textarea","number","email","password","search","tel","url","date","time","datetime-local","color","range"],$a=["checkbox","radio"],Li="phx-has-submitted",bn="data-phx-session",so=`[${bn}]`,ya="data-phx-sticky",ro="data-phx-static",cr="data-phx-readonly",oo="data-phx-disabled",_r="disable-with",bi="data-phx-disable-with-restore",Do="hook",yl="debounce",kl="throttle",Ei="update",dr="stream",fr="data-phx-stream",wl="key",Yt="phxPrivate",ka="auto-recover",pi="phx:live-socket:debug",mr="phx:live-socket:profiling",ur="phx:live-socket:latency-sim",xl="progress",wa="mounted",Cl=1,Ll=200,El="phx-",Al=3e4,Mo="debounce-trigger",Po="throttled",xa="debounce-prev-key",Bl={debounce:300,throttle:300},gi="d",Qt="s",hr="r",ht="c",Ca="e",La="r",Ea="t",Dl="p",Aa="stream",Ml=class{constructor(t,i,s){this.liveSocket=s,this.entry=t,this.offset=0,this.chunkSize=i,this.chunkTimer=null,this.errored=!1,this.uploadChannel=s.channel(`lvu:${t.ref}`,{token:t.metadata()})}error(t){this.errored||(this.uploadChannel.leave(),this.errored=!0,clearTimeout(this.chunkTimer),this.entry.error(t))}upload(){this.uploadChannel.onError(t=>this.error(t)),this.uploadChannel.join().receive("ok",t=>this.readNextChunk()).receive("error",t=>this.error(t))}isDone(){return this.offset>=this.entry.file.size}readNextChunk(){let t=new window.FileReader,i=this.entry.file.slice(this.offset,this.chunkSize+this.offset);t.onload=s=>{if(s.target.error===null)this.offset+=s.target.result.byteLength,this.pushChunk(s.target.result);else return At("Read error: "+s.target.error)},t.readAsArrayBuffer(i)}pushChunk(t){this.uploadChannel.isJoined()&&this.uploadChannel.push("chunk",t).receive("ok",()=>{this.entry.progress(this.offset/this.entry.file.size*100),this.isDone()||(this.chunkTimer=setTimeout(()=>this.readNextChunk(),this.liveSocket.getLatencySim()||0))}).receive("error",({reason:i})=>this.error(i))}},At=(t,i)=>console.error&&console.error(t,i),mn=t=>{let i=typeof t;return i==="number"||i==="string"&&/^(0|[1-9]\d*)$/.test(t)};function Pl(){let t=new Set,i=document.querySelectorAll("*[id]");for(let s=0,a=i.length;s{t.liveSocket.isDebugEnabled()&&console.log(`${t.id} ${i}: ${s} - `,a)},So=t=>typeof t=="function"?t:function(){return t},wi=t=>JSON.parse(JSON.stringify(t)),zo=(t,i,s)=>{do{if(t.matches(`[${i}]`)&&!t.disabled)return t;t=t.parentElement||t.parentNode}while(t!==null&&t.nodeType===1&&!(s&&s.isSameNode(t)||t.matches(so)));return null},io=t=>t!==null&&typeof t=="object"&&!(t instanceof Array),Tl=(t,i)=>JSON.stringify(t)===JSON.stringify(i),Ba=t=>{for(let i in t)return!1;return!0},wn=(t,i)=>t&&i(t),Ol=function(t,i,s,a){t.forEach(c=>{new Ml(c,s.config.chunk_size,a).upload()})},Ka={canPushState(){return typeof history.pushState!="undefined"},dropLocal(t,i,s){return t.removeItem(this.localKey(i,s))},updateLocal(t,i,s,a,c){let d=this.getLocal(t,i,s),m=this.localKey(i,s),h=d===null?a:c(d);return t.setItem(m,JSON.stringify(h)),h},getLocal(t,i,s){return JSON.parse(t.getItem(this.localKey(i,s)))},updateCurrentState(t){this.canPushState()&&history.replaceState(t(history.state||{}),"",window.location.href)},pushState(t,i,s){if(this.canPushState()){if(s!==window.location.href){if(i.type=="redirect"&&i.scroll){let c=history.state||{};c.scroll=i.scroll,history.replaceState(c,"",window.location.href)}delete i.scroll,history[t+"State"](i,"",s||null);let a=this.getHashTargetEl(window.location.hash);a?a.scrollIntoView():i.type==="redirect"&&window.scroll(0,0)}}else this.redirect(s)},setCookie(t,i){document.cookie=`${t}=${i}`},getCookie(t){return document.cookie.replace(new RegExp(`(?:(?:^|.*;s*)${t}s*=s*([^;]*).*$)|^.*$`),"$1")},redirect(t,i){i&&Ka.setCookie("__phoenix_flash__",i+"; max-age=60000; path=/"),window.location=t},localKey(t,i){return`${t}-${i}`},getHashTargetEl(t){let i=t.toString().substring(1);if(i!=="")return document.getElementById(i)||document.querySelector(`a[name="${i}"]`)}},en=Ka,Rl={focusMain(){let t=document.querySelector("main h1, main, h1");if(t){let i=t.tabIndex;t.tabIndex=-1,t.focus(),t.tabIndex=i}},anyOf(t,i){return i.find(s=>t instanceof s)},isFocusable(t,i){return t instanceof HTMLAnchorElement&&t.rel!=="ignore"||t instanceof HTMLAreaElement&&t.href!==void 0||!t.disabled&&this.anyOf(t,[HTMLInputElement,HTMLSelectElement,HTMLTextAreaElement,HTMLButtonElement])||t instanceof HTMLIFrameElement||t.tabIndex>0||!i&&t.getAttribute("tabindex")!==null&&t.getAttribute("aria-hidden")!=="true"},attemptFocus(t,i){if(this.isFocusable(t,i))try{t.focus()}catch(s){}return!!document.activeElement&&document.activeElement.isSameNode(t)},focusFirstInteractive(t){let i=t.firstElementChild;for(;i;){if(this.attemptFocus(i,!0)||this.focusFirstInteractive(i,!0))return!0;i=i.nextElementSibling}},focusFirst(t){let i=t.firstElementChild;for(;i;){if(this.attemptFocus(i)||this.focusFirst(i))return!0;i=i.nextElementSibling}},focusLast(t){let i=t.lastElementChild;for(;i;){if(this.attemptFocus(i)||this.focusLast(i))return!0;i=i.previousElementSibling}}},ao=Rl,Da=[],Ma=200,zl={exec(t,i,s,a,c){let[d,m]=c||[null,{callback:c&&c.callback}];(i.charAt(0)==="["?JSON.parse(i):[[d,m]]).forEach(([p,v])=>{p===d&&m.data&&(v.data=Object.assign(v.data||{},m.data),v.callback=v.callback||m.callback),this.filterToEls(a,v).forEach(y=>{this[`exec_${p}`](t,i,s,a,y,v)})})},isVisible(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length>0)},isInViewport(t){let i=t.getBoundingClientRect(),s=window.innerHeight||document.documentElement.clientHeight,a=window.innerWidth||document.documentElement.clientWidth;return i.right>0&&i.bottom>0&&i.left{let v=p.getAttribute(d);if(!v)throw new Error(`expected ${d} to contain JS command on "${m}"`);s.liveSocket.execJS(p,v,t)})},exec_dispatch(t,i,s,a,c,{to:d,event:m,detail:h,bubbles:p}){h=h||{},h.dispatcher=a,Y.dispatchEvent(c,m,{detail:h,bubbles:p})},exec_push(t,i,s,a,c,d){let{event:m,data:h,target:p,page_loading:v,loading:y,value:R,dispatcher:G,callback:$}=d,N={loading:y,value:R,target:p,page_loading:!!v},O=t==="change"&&G?G:a,J=p||O.getAttribute(s.binding("target"))||O;s.withinTargets(J,(I,q)=>{if(I.isConnected())if(t==="change"){let{newCid:V,_target:E}=d;E=E||(Y.isFormInput(a)?a.name:void 0),E&&(N._target=E),I.pushInput(a,q,V,m||i,N,$)}else if(t==="submit"){let{submitter:V}=d;I.submitForm(a,q,m||i,V,N,$)}else I.pushEvent(t,a,q,m||i,h,N,$)})},exec_navigate(t,i,s,a,c,{href:d,replace:m}){s.liveSocket.historyRedirect(d,m?"replace":"push")},exec_patch(t,i,s,a,c,{href:d,replace:m}){s.liveSocket.pushHistoryPatch(d,m?"replace":"push",a)},exec_focus(t,i,s,a,c){window.requestAnimationFrame(()=>ao.attemptFocus(c))},exec_focus_first(t,i,s,a,c){window.requestAnimationFrame(()=>ao.focusFirstInteractive(c)||ao.focusFirst(c))},exec_push_focus(t,i,s,a,c){window.requestAnimationFrame(()=>Da.push(c||a))},exec_pop_focus(t,i,s,a,c){window.requestAnimationFrame(()=>{let d=Da.pop();d&&d.focus()})},exec_add_class(t,i,s,a,c,{names:d,transition:m,time:h}){this.addOrRemoveClasses(c,d,[],m,h,s)},exec_remove_class(t,i,s,a,c,{names:d,transition:m,time:h}){this.addOrRemoveClasses(c,[],d,m,h,s)},exec_toggle_class(t,i,s,a,c,{to:d,names:m,transition:h,time:p}){this.toggleClasses(c,m,h,p,s)},exec_toggle_attr(t,i,s,a,c,{attr:[d,m,h]}){c.hasAttribute(d)?h!==void 0?c.getAttribute(d)===m?this.setOrRemoveAttrs(c,[[d,h]],[]):this.setOrRemoveAttrs(c,[[d,m]],[]):this.setOrRemoveAttrs(c,[],[d]):this.setOrRemoveAttrs(c,[[d,m]],[])},exec_transition(t,i,s,a,c,{time:d,transition:m}){this.addOrRemoveClasses(c,[],[],m,d,s)},exec_toggle(t,i,s,a,c,{display:d,ins:m,outs:h,time:p}){this.toggle(t,s,c,d,m,h,p)},exec_show(t,i,s,a,c,{display:d,transition:m,time:h}){this.show(t,s,c,d,m,h)},exec_hide(t,i,s,a,c,{display:d,transition:m,time:h}){this.hide(t,s,c,d,m,h)},exec_set_attr(t,i,s,a,c,{attr:[d,m]}){this.setOrRemoveAttrs(c,[[d,m]],[])},exec_remove_attr(t,i,s,a,c,{attr:d}){this.setOrRemoveAttrs(c,[],[d])},show(t,i,s,a,c,d){this.isVisible(s)||this.toggle(t,i,s,a,c,null,d)},hide(t,i,s,a,c,d){this.isVisible(s)&&this.toggle(t,i,s,a,null,c,d)},toggle(t,i,s,a,c,d,m){m=m||Ma;let[h,p,v]=c||[[],[],[]],[y,R,G]=d||[[],[],[]];if(h.length>0||y.length>0)if(this.isVisible(s)){let $=()=>{this.addOrRemoveClasses(s,R,h.concat(p).concat(v)),window.requestAnimationFrame(()=>{this.addOrRemoveClasses(s,y,[]),window.requestAnimationFrame(()=>this.addOrRemoveClasses(s,G,R))})};s.dispatchEvent(new Event("phx:hide-start")),i.transition(m,$,()=>{this.addOrRemoveClasses(s,[],y.concat(G)),Y.putSticky(s,"toggle",N=>N.style.display="none"),s.dispatchEvent(new Event("phx:hide-end"))})}else{if(t==="remove")return;let $=()=>{this.addOrRemoveClasses(s,p,y.concat(R).concat(G));let N=a||this.defaultDisplay(s);Y.putSticky(s,"toggle",O=>O.style.display=N),window.requestAnimationFrame(()=>{this.addOrRemoveClasses(s,h,[]),window.requestAnimationFrame(()=>this.addOrRemoveClasses(s,v,p))})};s.dispatchEvent(new Event("phx:show-start")),i.transition(m,$,()=>{this.addOrRemoveClasses(s,[],h.concat(v)),s.dispatchEvent(new Event("phx:show-end"))})}else this.isVisible(s)?window.requestAnimationFrame(()=>{s.dispatchEvent(new Event("phx:hide-start")),Y.putSticky(s,"toggle",$=>$.style.display="none"),s.dispatchEvent(new Event("phx:hide-end"))}):window.requestAnimationFrame(()=>{s.dispatchEvent(new Event("phx:show-start"));let $=a||this.defaultDisplay(s);Y.putSticky(s,"toggle",N=>N.style.display=$),s.dispatchEvent(new Event("phx:show-end"))})},toggleClasses(t,i,s,a,c){window.requestAnimationFrame(()=>{let[d,m]=Y.getSticky(t,"classes",[[],[]]),h=i.filter(v=>d.indexOf(v)<0&&!t.classList.contains(v)),p=i.filter(v=>m.indexOf(v)<0&&t.classList.contains(v));this.addOrRemoveClasses(t,h,p,s,a,c)})},addOrRemoveClasses(t,i,s,a,c,d){c=c||Ma;let[m,h,p]=a||[[],[],[]];if(m.length>0){let v=()=>{this.addOrRemoveClasses(t,h,[].concat(m).concat(p)),window.requestAnimationFrame(()=>{this.addOrRemoveClasses(t,m,[]),window.requestAnimationFrame(()=>this.addOrRemoveClasses(t,p,h))})},y=()=>this.addOrRemoveClasses(t,i.concat(p),s.concat(m).concat(h));return d.transition(c,v,y)}window.requestAnimationFrame(()=>{let[v,y]=Y.getSticky(t,"classes",[[],[]]),R=i.filter(O=>v.indexOf(O)<0&&!t.classList.contains(O)),G=s.filter(O=>y.indexOf(O)<0&&t.classList.contains(O)),$=v.filter(O=>s.indexOf(O)<0).concat(R),N=y.filter(O=>i.indexOf(O)<0).concat(G);Y.putSticky(t,"classes",O=>(O.classList.remove(...N),O.classList.add(...$),[$,N]))})},setOrRemoveAttrs(t,i,s){let[a,c]=Y.getSticky(t,"attrs",[[],[]]),d=i.map(([p,v])=>p).concat(s),m=a.filter(([p,v])=>!d.includes(p)).concat(i),h=c.filter(p=>!d.includes(p)).concat(s);Y.putSticky(t,"attrs",p=>(h.forEach(v=>p.removeAttribute(v)),m.forEach(([v,y])=>p.setAttribute(v,y)),[m,h]))},hasAllClasses(t,i){return i.every(s=>t.classList.contains(s))},isToggledOut(t,i){return!this.isVisible(t)||this.hasAllClasses(t,i)},filterToEls(t,{to:i}){return i?Y.all(document,i):[t]},defaultDisplay(t){return{tr:"table-row",td:"table-cell"}[t.tagName.toLowerCase()]||"block"}},bt=zl,It={byId(t){return document.getElementById(t)||At(`no id found for ${t}`)},removeClass(t,i){t.classList.remove(i),t.classList.length===0&&t.removeAttribute("class")},all(t,i,s){if(!t)return[];let a=Array.from(t.querySelectorAll(i));return s?a.forEach(s):a},childNodeLength(t){let i=document.createElement("template");return i.innerHTML=t,i.content.childElementCount},isUploadInput(t){return t.type==="file"&&t.getAttribute(hn)!==null},isAutoUpload(t){return t.hasAttribute("data-phx-auto-upload")},findUploadInputs(t){let i=t.id,s=this.all(document,`input[type="file"][${hn}][form="${i}"]`);return this.all(t,`input[type="file"][${hn}]`).concat(s)},findComponentNodeList(t,i){return this.filterWithinSameLiveView(this.all(t,`[${un}="${i}"]`),t)},isPhxDestroyed(t){return!!(t.id&&It.private(t,"destroyed"))},wantsNewTab(t){let i=t.ctrlKey||t.shiftKey||t.metaKey||t.button&&t.button===1,s=t.target instanceof HTMLAnchorElement&&t.target.hasAttribute("download"),a=t.target.hasAttribute("target")&&t.target.getAttribute("target").toLowerCase()==="_blank",c=t.target.hasAttribute("target")&&!t.target.getAttribute("target").startsWith("_");return i||a||s||c},isUnloadableFormSubmit(t){return t.target&&t.target.getAttribute("method")==="dialog"||t.submitter&&t.submitter.getAttribute("formmethod")==="dialog"?!1:!t.defaultPrevented&&!this.wantsNewTab(t)},isNewPageClick(t,i){let s=t.target instanceof HTMLAnchorElement?t.target.getAttribute("href"):null,a;if(t.defaultPrevented||s===null||this.wantsNewTab(t)||s.startsWith("mailto:")||s.startsWith("tel:")||t.target.isContentEditable)return!1;try{a=new URL(s)}catch(c){try{a=new URL(s,i)}catch(d){return!0}}return a.host===i.host&&a.protocol===i.protocol&&a.pathname===i.pathname&&a.search===i.search?a.hash===""&&!a.href.endsWith("#"):a.protocol.startsWith("http")},markPhxChildDestroyed(t){this.isPhxChild(t)&&t.setAttribute(bn,""),this.putPrivate(t,"destroyed",!0)},findPhxChildrenInFragment(t,i){let s=document.createElement("template");return s.innerHTML=t,this.findPhxChildren(s.content,i)},isIgnored(t,i){return(t.getAttribute(i)||t.getAttribute("data-phx-update"))==="ignore"},isPhxUpdate(t,i,s){return t.getAttribute&&s.indexOf(t.getAttribute(i))>=0},findPhxSticky(t){return this.all(t,`[${ya}]`)},findPhxChildren(t,i){return this.all(t,`${so}[${zn}="${i}"]`)},findExistingParentCIDs(t,i){let s=new Set,a=new Set;return i.forEach(c=>{this.filterWithinSameLiveView(this.all(t,`[${un}="${c}"]`),t).forEach(d=>{s.add(c),this.all(d,`[${un}]`).map(m=>parseInt(m.getAttribute(un))).forEach(m=>a.add(m))})}),a.forEach(c=>s.delete(c)),s},filterWithinSameLiveView(t,i){return i.querySelector(so)?t.filter(s=>this.withinSameLiveView(s,i)):t},withinSameLiveView(t,i){for(;t=t.parentNode;){if(t.isSameNode(i))return!0;if(t.getAttribute(bn)!==null)return!1}},private(t,i){return t[Yt]&&t[Yt][i]},deletePrivate(t,i){t[Yt]&&delete t[Yt][i]},putPrivate(t,i,s){t[Yt]||(t[Yt]={}),t[Yt][i]=s},updatePrivate(t,i,s,a){let c=this.private(t,i);c===void 0?this.putPrivate(t,i,a(s)):this.putPrivate(t,i,a(c))},copyPrivates(t,i){i[Yt]&&(t[Yt]=i[Yt])},putTitle(t){let i=document.querySelector("title");if(i){let{prefix:s,suffix:a}=i.dataset;document.title=`${s||""}${t}${a||""}`}else document.title=t},debounce(t,i,s,a,c,d,m,h){let p=t.getAttribute(s),v=t.getAttribute(c);p===""&&(p=a),v===""&&(v=d);let y=p||v;switch(y){case null:return h();case"blur":this.once(t,"debounce-blur")&&t.addEventListener("blur",()=>{m()&&h()});return;default:let R=parseInt(y),G=()=>v?this.deletePrivate(t,Po):h(),$=this.incCycle(t,Mo,G);if(isNaN(R))return At(`invalid throttle/debounce value: ${y}`);if(v){let O=!1;if(i.type==="keydown"){let J=this.private(t,xa);this.putPrivate(t,xa,i.key),O=J!==i.key}if(!O&&this.private(t,Po))return!1;{h();let J=setTimeout(()=>{m()&&this.triggerCycle(t,Mo)},R);this.putPrivate(t,Po,J)}}else setTimeout(()=>{m()&&this.triggerCycle(t,Mo,$)},R);let N=t.form;N&&this.once(N,"bind-debounce")&&N.addEventListener("submit",()=>{Array.from(new FormData(N).entries(),([O])=>{let J=N.querySelector(`[name="${O}"]`);this.incCycle(J,Mo),this.deletePrivate(J,Po)})}),this.once(t,"bind-debounce")&&t.addEventListener("blur",()=>{clearTimeout(this.private(t,Po)),this.triggerCycle(t,Mo)})}},triggerCycle(t,i,s){let[a,c]=this.private(t,i);s||(s=a),s===a&&(this.incCycle(t,i),c())},once(t,i){return this.private(t,i)===!0?!1:(this.putPrivate(t,i,!0),!0)},incCycle(t,i,s=function(){}){let[a]=this.private(t,i)||[0,s];return a++,this.putPrivate(t,i,[a,s]),a},maybeAddPrivateHooks(t,i,s){t.hasAttribute&&(t.hasAttribute(i)||t.hasAttribute(s))&&t.setAttribute("data-phx-hook","Phoenix.InfiniteScroll")},isFeedbackContainer(t,i){return t.hasAttribute&&t.hasAttribute(i)},maybeHideFeedback(t,i,s,a){let c={};i.forEach(d=>{if(!t.contains(d))return;let m=d.getAttribute(s);if(!m){bt.addOrRemoveClasses(d,[],[ui]);return}if(c[m]===!0){this.hideFeedback(d);return}c[m]=this.shouldHideFeedback(t,m,a),c[m]===!0&&this.hideFeedback(d)})},hideFeedback(t){bt.addOrRemoveClasses(t,[ui],[])},shouldHideFeedback(t,i,s){let a=`[name="${i}"], [name="${i}[]"], [${s}="${i}"]`,c=!1;return It.all(t,a,d=>{(this.private(d,vr)||this.private(d,Li))&&(c=!0)}),!c},feedbackSelector(t,i,s){let a=`[${i}="${t.name}"], [${i}="${t.name.replace(/\[\]$/,"")}"]`;return t.getAttribute(s)&&(a+=`,[${i}="${t.getAttribute(s)}"]`),a},resetForm(t,i,s){Array.from(t.elements).forEach(a=>{let c=this.feedbackSelector(a,i,s);this.deletePrivate(a,vr),this.deletePrivate(a,Li),this.all(document,c,d=>{bt.addOrRemoveClasses(d,[ui],[])})})},showError(t,i,s){if(t.name){let a=this.feedbackSelector(t,i,s);this.all(document,a,c=>{bt.addOrRemoveClasses(c,[],[ui])})}},isPhxChild(t){return t.getAttribute&&t.getAttribute(zn)},isPhxSticky(t){return t.getAttribute&&t.getAttribute(ya)!==null},isChildOfAny(t,i){return!!i.find(s=>s.contains(t))},firstPhxChild(t){return this.isPhxChild(t)?t:this.all(t,`[${zn}]`)[0]},dispatchEvent(t,i,s={}){let a=!0;t.nodeName==="INPUT"&&t.type==="file"&&i==="click"&&(a=!1);let m={bubbles:s.bubbles===void 0?a:!!s.bubbles,cancelable:!0,detail:s.detail||{}},h=i==="click"?new MouseEvent("click",m):new CustomEvent(i,m);t.dispatchEvent(h)},cloneNode(t,i){if(typeof i=="undefined")return t.cloneNode(!0);{let s=t.cloneNode(!1);return s.innerHTML=i,s}},mergeAttrs(t,i,s={}){let a=new Set(s.exclude||[]),c=s.isIgnored,d=i.attributes;for(let h=d.length-1;h>=0;h--){let p=d[h].name;if(a.has(p))p==="value"&&t.value===i.value&&t.setAttribute("value",i.getAttribute(p));else{let v=i.getAttribute(p);t.getAttribute(p)!==v&&(!c||c&&p.startsWith("data-"))&&t.setAttribute(p,v)}}let m=t.attributes;for(let h=m.length-1;h>=0;h--){let p=m[h].name;c?p.startsWith("data-")&&!i.hasAttribute(p)&&![Et,kn].includes(p)&&t.removeAttribute(p):i.hasAttribute(p)||t.removeAttribute(p)}},mergeFocusedInput(t,i){t instanceof HTMLSelectElement||It.mergeAttrs(t,i,{exclude:["value"]}),i.readOnly?t.setAttribute("readonly",!0):t.removeAttribute("readonly")},hasSelectionRange(t){return t.setSelectionRange&&(t.type==="text"||t.type==="textarea")},restoreFocus(t,i,s){if(t instanceof HTMLSelectElement&&t.focus(),!It.isTextualInput(t))return;t.matches(":focus")||t.focus(),this.hasSelectionRange(t)&&t.setSelectionRange(i,s)},isFormInput(t){return/^(?:input|select|textarea)$/i.test(t.tagName)&&t.type!=="button"},syncAttrsToProps(t){t instanceof HTMLInputElement&&$a.indexOf(t.type.toLocaleLowerCase())>=0&&(t.checked=t.getAttribute("checked")!==null)},isTextualInput(t){return _l.indexOf(t.type)>=0},isNowTriggerFormExternal(t,i){return t.getAttribute&&t.getAttribute(i)!==null},syncPendingRef(t,i,s){let a=t.getAttribute(Et);if(a===null)return!0;let c=t.getAttribute(kn);return It.isFormInput(t)||t.getAttribute(s)!==null?(It.isUploadInput(t)&&It.mergeAttrs(t,i,{isIgnored:!0}),It.putPrivate(t,Et,i),!1):(Ha.forEach(d=>{t.classList.contains(d)&&i.classList.add(d)}),i.setAttribute(Et,a),i.setAttribute(kn,c),!0)},cleanChildNodes(t,i){if(It.isPhxUpdate(t,i,["append","prepend"])){let s=[];t.childNodes.forEach(a=>{a.id||(!(a.nodeType===Node.TEXT_NODE&&a.nodeValue.trim()==="")&&a.nodeType!==Node.COMMENT_NODE&&At(`only HTML element tags with an id are allowed inside containers with phx-update. removing illegal node: "${(a.outerHTML||a.nodeValue).trim()}" `),s.push(a))}),s.forEach(a=>a.remove())}},replaceRootContainer(t,i,s){let a=new Set(["id",bn,ro,kr,In]);if(t.tagName.toLowerCase()===i.toLowerCase())return Array.from(t.attributes).filter(c=>!a.has(c.name.toLowerCase())).forEach(c=>t.removeAttribute(c.name)),Object.keys(s).filter(c=>!a.has(c.toLowerCase())).forEach(c=>t.setAttribute(c,s[c])),t;{let c=document.createElement(i);return Object.keys(s).forEach(d=>c.setAttribute(d,s[d])),a.forEach(d=>c.setAttribute(d,t.getAttribute(d))),c.innerHTML=t.innerHTML,t.replaceWith(c),c}},getSticky(t,i,s){let a=(It.private(t,"sticky")||[]).find(([c])=>i===c);if(a){let[c,d,m]=a;return m}else return typeof s=="function"?s():s},deleteSticky(t,i){this.updatePrivate(t,"sticky",[],s=>s.filter(([a,c])=>a!==i))},putSticky(t,i,s){let a=s(t);this.updatePrivate(t,"sticky",[],c=>{let d=c.findIndex(([m])=>i===m);return d>=0?c[d]=[i,s,a]:c.push([i,s,a]),c})},applyStickyOperations(t){let i=It.private(t,"sticky");i&&i.forEach(([s,a,c])=>this.putSticky(t,s,a))}},Y=It,To=class{static isActive(t,i){let s=i._phxRef===void 0,c=t.getAttribute(pr).split(",").indexOf(tt.genFileRef(i))>=0;return i.size>0&&(s||c)}static isPreflighted(t,i){return t.getAttribute(yr).split(",").indexOf(tt.genFileRef(i))>=0&&this.isActive(t,i)}static isPreflightInProgress(t){return t._preflightInProgress===!0}static markPreflightInProgress(t){t._preflightInProgress=!0}constructor(t,i,s,a){this.ref=tt.genFileRef(i),this.fileEl=t,this.file=i,this.view=s,this.meta=null,this._isCancelled=!1,this._isDone=!1,this._progress=0,this._lastProgressSent=-1,this._onDone=function(){},this._onElUpdated=this.onElUpdated.bind(this),this.fileEl.addEventListener(ki,this._onElUpdated),this.autoUpload=a}metadata(){return this.meta}progress(t){this._progress=Math.floor(t),this._progress>this._lastProgressSent&&(this._progress>=100?(this._progress=100,this._lastProgressSent=100,this._isDone=!0,this.view.pushFileProgress(this.fileEl,this.ref,100,()=>{tt.untrackFile(this.fileEl,this.file),this._onDone()})):(this._lastProgressSent=this._progress,this.view.pushFileProgress(this.fileEl,this.ref,this._progress)))}isCancelled(){return this._isCancelled}cancel(){this.file._preflightInProgress=!1,this._isCancelled=!0,this._isDone=!0,this._onDone()}isDone(){return this._isDone}error(t="failed"){this.fileEl.removeEventListener(ki,this._onElUpdated),this.view.pushFileProgress(this.fileEl,this.ref,{error:t}),this.isAutoUpload()||tt.clearFiles(this.fileEl)}isAutoUpload(){return this.autoUpload}onDone(t){this._onDone=()=>{this.fileEl.removeEventListener(ki,this._onElUpdated),t()}}onElUpdated(){this.fileEl.getAttribute(pr).split(",").indexOf(this.ref)===-1&&(tt.untrackFile(this.fileEl,this.file),this.cancel())}toPreflightPayload(){return{last_modified:this.file.lastModified,name:this.file.name,relative_path:this.file.webkitRelativePath,size:this.file.size,type:this.file.type,ref:this.ref,meta:typeof this.file.meta=="function"?this.file.meta():void 0}}uploader(t){if(this.meta.uploader){let i=t[this.meta.uploader]||At(`no uploader configured for ${this.meta.uploader}`);return{name:this.meta.uploader,callback:i}}else return{name:"channel",callback:Ol}}zipPostFlight(t){this.meta=t.entries[this.ref],this.meta||At(`no preflight upload response returned with ref ${this.ref}`,{input:this.fileEl,response:t})}},Il=0,tt=class{static genFileRef(t){let i=t._phxRef;return i!==void 0?i:(t._phxRef=(Il++).toString(),t._phxRef)}static getEntryDataURL(t,i,s){let a=this.activeFiles(t).find(c=>this.genFileRef(c)===i);s(URL.createObjectURL(a))}static hasUploadsInProgress(t){let i=0;return Y.findUploadInputs(t).forEach(s=>{s.getAttribute(yr)!==s.getAttribute(Fl)&&i++}),i>0}static serializeUploads(t){let i=this.activeFiles(t),s={};return i.forEach(a=>{let c={path:t.name},d=t.getAttribute(hn);s[d]=s[d]||[],c.ref=this.genFileRef(a),c.last_modified=a.lastModified,c.name=a.name||c.ref,c.relative_path=a.webkitRelativePath,c.type=a.type,c.size=a.size,typeof a.meta=="function"&&(c.meta=a.meta()),s[d].push(c)}),s}static clearFiles(t){t.value=null,t.removeAttribute(hn),Y.putPrivate(t,"files",[])}static untrackFile(t,i){Y.putPrivate(t,"files",Y.private(t,"files").filter(s=>!Object.is(s,i)))}static trackFiles(t,i,s){if(t.getAttribute("multiple")!==null){let a=i.filter(c=>!this.activeFiles(t).find(d=>Object.is(d,c)));Y.updatePrivate(t,"files",[],c=>c.concat(a)),t.value=null}else s&&s.files.length>0&&(t.files=s.files),Y.putPrivate(t,"files",i)}static activeFileInputs(t){let i=Y.findUploadInputs(t);return Array.from(i).filter(s=>s.files&&this.activeFiles(s).length>0)}static activeFiles(t){return(Y.private(t,"files")||[]).filter(i=>To.isActive(t,i))}static inputsAwaitingPreflight(t){let i=Y.findUploadInputs(t);return Array.from(i).filter(s=>this.filesAwaitingPreflight(s).length>0)}static filesAwaitingPreflight(t){return this.activeFiles(t).filter(i=>!To.isPreflighted(t,i)&&!To.isPreflightInProgress(i))}static markPreflightInProgress(t){t.forEach(i=>To.markPreflightInProgress(i.file))}constructor(t,i,s){this.autoUpload=Y.isAutoUpload(t),this.view=i,this.onComplete=s,this._entries=Array.from(tt.filesAwaitingPreflight(t)||[]).map(a=>new To(t,a,i,this.autoUpload)),tt.markPreflightInProgress(this._entries),this.numEntriesInProgress=this._entries.length}isAutoUpload(){return this.autoUpload}entries(){return this._entries}initAdapterUpload(t,i,s){this._entries=this._entries.map(c=>(c.isCancelled()?(this.numEntriesInProgress--,this.numEntriesInProgress===0&&this.onComplete()):(c.zipPostFlight(t),c.onDone(()=>{this.numEntriesInProgress--,this.numEntriesInProgress===0&&this.onComplete()})),c));let a=this._entries.reduce((c,d)=>{if(!d.meta)return c;let{name:m,callback:h}=d.uploader(s.uploaders);return c[m]=c[m]||{callback:h,entries:[]},c[m].entries.push(d),c},{});for(let c in a){let{callback:d,entries:m}=a[c];d(m,i,t,s)}}},Wa={LiveFileUpload:{activeRefs(){return this.el.getAttribute(pr)},preflightedRefs(){return this.el.getAttribute(yr)},mounted(){this.preflightedWas=this.preflightedRefs()},updated(){let t=this.preflightedRefs();this.preflightedWas!==t&&(this.preflightedWas=t,t===""&&this.__view.cancelSubmit(this.el.form)),this.activeRefs()===""&&(this.el.value=null),this.el.dispatchEvent(new CustomEvent(ki))}},LiveImgPreview:{mounted(){this.ref=this.el.getAttribute("data-phx-entry-ref"),this.inputEl=document.getElementById(this.el.getAttribute(hn)),tt.getEntryDataURL(this.inputEl,this.ref,t=>{this.url=t,this.el.src=t})},destroyed(){URL.revokeObjectURL(this.url)}},FocusWrap:{mounted(){this.focusStart=this.el.firstElementChild,this.focusEnd=this.el.lastElementChild,this.focusStart.addEventListener("focus",()=>ao.focusLast(this.el)),this.focusEnd.addEventListener("focus",()=>ao.focusFirst(this.el)),this.el.addEventListener("phx:show-end",()=>this.el.focus()),window.getComputedStyle(this.el).display!=="none"&&ao.focusFirst(this.el)}}},Ja=t=>["HTML","BODY"].indexOf(t.nodeName.toUpperCase())>=0?null:["scroll","auto"].indexOf(getComputedStyle(t).overflowY)>=0?t:Ja(t.parentElement),Pa=t=>t?t.scrollTop:document.documentElement.scrollTop||document.body.scrollTop,wr=t=>t?t.getBoundingClientRect().bottom:window.innerHeight||document.documentElement.clientHeight,xr=t=>t?t.getBoundingClientRect().top:0,jl=(t,i)=>{let s=t.getBoundingClientRect();return s.top>=xr(i)&&s.left>=0&&s.top<=wr(i)},Nl=(t,i)=>{let s=t.getBoundingClientRect();return s.right>=xr(i)&&s.left>=0&&s.bottom<=wr(i)},Sa=(t,i)=>{let s=t.getBoundingClientRect();return s.top>=xr(i)&&s.left>=0&&s.top<=wr(i)};Wa.InfiniteScroll={mounted(){this.scrollContainer=Ja(this.el);let t=Pa(this.scrollContainer),i=!1,s=500,a=null,c=this.throttle(s,(h,p)=>{a=()=>!0,this.liveSocket.execJSHookPush(this.el,h,{id:p.id,_overran:!0},()=>{a=null})}),d=this.throttle(s,(h,p)=>{a=()=>p.scrollIntoView({block:"start"}),this.liveSocket.execJSHookPush(this.el,h,{id:p.id},()=>{a=null,window.requestAnimationFrame(()=>{Sa(p,this.scrollContainer)||p.scrollIntoView({block:"start"})})})}),m=this.throttle(s,(h,p)=>{a=()=>p.scrollIntoView({block:"end"}),this.liveSocket.execJSHookPush(this.el,h,{id:p.id},()=>{a=null,window.requestAnimationFrame(()=>{Sa(p,this.scrollContainer)||p.scrollIntoView({block:"end"})})})});this.onScroll=h=>{let p=Pa(this.scrollContainer);if(a)return t=p,a();let v=this.el.getBoundingClientRect(),y=this.el.getAttribute(this.liveSocket.binding("viewport-top")),R=this.el.getAttribute(this.liveSocket.binding("viewport-bottom")),G=this.el.lastElementChild,$=this.el.firstElementChild,N=pt;N&&y&&!i&&v.top>=0?(i=!0,c(y,$)):O&&i&&v.top<=0&&(i=!1),y&&N&&jl($,this.scrollContainer)?d(y,$):R&&O&&Nl(G,this.scrollContainer)&&m(R,G),t=p},this.scrollContainer?this.scrollContainer.addEventListener("scroll",this.onScroll):window.addEventListener("scroll",this.onScroll)},destroyed(){this.scrollContainer?this.scrollContainer.removeEventListener("scroll",this.onScroll):window.removeEventListener("scroll",this.onScroll)},throttle(t,i){let s=0,a;return(...c)=>{let d=Date.now(),m=t-(d-s);m<=0||m>t?(a&&(clearTimeout(a),a=null),s=d,i(...c)):a||(a=setTimeout(()=>{s=Date.now(),a=null,i(...c)},m))}}};var Ul=Wa,Gl=class{constructor(t,i,s){let a=new Set,c=new Set([...i.children].map(m=>m.id)),d=[];Array.from(t.children).forEach(m=>{if(m.id&&(a.add(m.id),c.has(m.id))){let h=m.previousElementSibling&&m.previousElementSibling.id;d.push({elementId:m.id,previousElementId:h})}}),this.containerId=i.id,this.updateType=s,this.elementsToModify=d,this.elementIdsToAdd=[...c].filter(m=>!a.has(m))}perform(){let t=Y.byId(this.containerId);this.elementsToModify.forEach(i=>{i.previousElementId?wn(document.getElementById(i.previousElementId),s=>{wn(document.getElementById(i.elementId),a=>{a.previousElementSibling&&a.previousElementSibling.id==s.id||s.insertAdjacentElement("afterend",a)})}):wn(document.getElementById(i.elementId),s=>{s.previousElementSibling==null||t.insertAdjacentElement("afterbegin",s)})}),this.updateType=="prepend"&&this.elementIdsToAdd.reverse().forEach(i=>{wn(document.getElementById(i),s=>t.insertAdjacentElement("afterbegin",s))})}},Ta=11;function Hl(t,i){var s=i.attributes,a,c,d,m,h;if(!(i.nodeType===Ta||t.nodeType===Ta)){for(var p=s.length-1;p>=0;p--)a=s[p],c=a.name,d=a.namespaceURI,m=a.value,d?(c=a.localName||c,h=t.getAttributeNS(d,c),h!==m&&(a.prefix==="xmlns"&&(c=a.name),t.setAttributeNS(d,c,m))):(h=t.getAttribute(c),h!==m&&t.setAttribute(c,m));for(var v=t.attributes,y=v.length-1;y>=0;y--)a=v[y],c=a.name,d=a.namespaceURI,d?(c=a.localName||c,i.hasAttributeNS(d,c)||t.removeAttributeNS(d,c)):i.hasAttribute(c)||t.removeAttribute(c)}}var Fi,ql="http://www.w3.org/1999/xhtml",yt=typeof document=="undefined"?void 0:document,Zl=!!yt&&"content"in yt.createElement("template"),Vl=!!yt&&yt.createRange&&"createContextualFragment"in yt.createRange();function $l(t){var i=yt.createElement("template");return i.innerHTML=t,i.content.childNodes[0]}function Kl(t){Fi||(Fi=yt.createRange(),Fi.selectNode(yt.body));var i=Fi.createContextualFragment(t);return i.childNodes[0]}function Wl(t){var i=yt.createElement("body");return i.innerHTML=t,i.childNodes[0]}function Jl(t){return t=t.trim(),Zl?$l(t):Vl?Kl(t):Wl(t)}function vi(t,i){var s=t.nodeName,a=i.nodeName,c,d;return s===a?!0:(c=s.charCodeAt(0),d=a.charCodeAt(0),c<=90&&d>=97?s===a.toUpperCase():d<=90&&c>=97?a===s.toUpperCase():!1)}function Xl(t,i){return!i||i===ql?yt.createElement(t):yt.createElementNS(i,t)}function Yl(t,i){for(var s=t.firstChild;s;){var a=s.nextSibling;i.appendChild(s),s=a}return i}function br(t,i,s){t[s]!==i[s]&&(t[s]=i[s],t[s]?t.setAttribute(s,""):t.removeAttribute(s))}var Oa={OPTION:function(t,i){var s=t.parentNode;if(s){var a=s.nodeName.toUpperCase();a==="OPTGROUP"&&(s=s.parentNode,a=s&&s.nodeName.toUpperCase()),a==="SELECT"&&!s.hasAttribute("multiple")&&(t.hasAttribute("selected")&&!i.selected&&(t.setAttribute("selected","selected"),t.removeAttribute("selected")),s.selectedIndex=-1)}br(t,i,"selected")},INPUT:function(t,i){br(t,i,"checked"),br(t,i,"disabled"),t.value!==i.value&&(t.value=i.value),i.hasAttribute("value")||t.removeAttribute("value")},TEXTAREA:function(t,i){var s=i.value;t.value!==s&&(t.value=s);var a=t.firstChild;if(a){var c=a.nodeValue;if(c==s||!s&&c==t.placeholder)return;a.nodeValue=s}},SELECT:function(t,i){if(!i.hasAttribute("multiple")){for(var s=-1,a=0,c=t.firstChild,d,m;c;)if(m=c.nodeName&&c.nodeName.toUpperCase(),m==="OPTGROUP")d=c,c=d.firstChild;else{if(m==="OPTION"){if(c.hasAttribute("selected")){s=a;break}a++}c=c.nextSibling,!c&&d&&(c=d.nextSibling,d=null)}t.selectedIndex=s}}},Oo=1,Ra=11,za=3,Ia=8;function yn(){}function Ql(t){if(t)return t.getAttribute&&t.getAttribute("id")||t.id}function ec(t){return function(s,a,c){if(c||(c={}),typeof a=="string")if(s.nodeName==="#document"||s.nodeName==="HTML"||s.nodeName==="BODY"){var d=a;a=yt.createElement("html"),a.innerHTML=d}else a=Jl(a);else a.nodeType===Ra&&(a=a.firstElementChild);var m=c.getNodeKey||Ql,h=c.onBeforeNodeAdded||yn,p=c.onNodeAdded||yn,v=c.onBeforeElUpdated||yn,y=c.onElUpdated||yn,R=c.onBeforeNodeDiscarded||yn,G=c.onNodeDiscarded||yn,$=c.onBeforeElChildrenUpdated||yn,N=c.skipFromChildren||yn,O=c.addChild||function(ve,te){return ve.appendChild(te)},J=c.childrenOnly===!0,I=Object.create(null),q=[];function V(ve){q.push(ve)}function E(ve,te){if(ve.nodeType===Oo)for(var ge=ve.firstChild;ge;){var ye=void 0;te&&(ye=m(ge))?V(ye):(G(ge),ge.firstChild&&E(ge,te)),ge=ge.nextSibling}}function z(ve,te,ge){R(ve)!==!1&&(te&&te.removeChild(ve),G(ve),E(ve,ge))}function H(ve){if(ve.nodeType===Oo||ve.nodeType===Ra)for(var te=ve.firstChild;te;){var ge=m(te);ge&&(I[ge]=te),H(te),te=te.nextSibling}}H(s);function re(ve){p(ve);for(var te=ve.firstChild;te;){var ge=te.nextSibling,ye=m(te);if(ye){var ue=I[ye];ue&&vi(te,ue)?(te.parentNode.replaceChild(ue,te),U(ue,te)):re(te)}else re(te);te=ge}}function le(ve,te,ge){for(;te;){var ye=te.nextSibling;(ge=m(te))?V(ge):z(te,ve,!0),te=ye}}function U(ve,te,ge){var ye=m(te);ye&&delete I[ye],!(!ge&&(v(ve,te)===!1||(t(ve,te),y(ve),$(ve,te)===!1)))&&(ve.nodeName!=="TEXTAREA"?ee(ve,te):Oa.TEXTAREA(ve,te))}function ee(ve,te){var ge=N(ve,te),ye=te.firstChild,ue=ve.firstChild,we,Be,Ae,Qe,Ge;e:for(;ye;){for(Qe=ye.nextSibling,we=m(ye);!ge&&ue;){if(Ae=ue.nextSibling,ye.isSameNode&&ye.isSameNode(ue)){ye=Qe,ue=Ae;continue e}Be=m(ue);var Bt=ue.nodeType,Ke=void 0;if(Bt===ye.nodeType&&(Bt===Oo?(we?we!==Be&&((Ge=I[we])?Ae===Ge?Ke=!1:(ve.insertBefore(Ge,ue),Be?V(Be):z(ue,ve,!0),ue=Ge,Be=m(ue)):Ke=!1):Be&&(Ke=!1),Ke=Ke!==!1&&vi(ue,ye),Ke&&U(ue,ye)):(Bt===za||Bt==Ia)&&(Ke=!0,ue.nodeValue!==ye.nodeValue&&(ue.nodeValue=ye.nodeValue))),Ke){ye=Qe,ue=Ae;continue e}Be?V(Be):z(ue,ve,!0),ue=Ae}if(we&&(Ge=I[we])&&vi(Ge,ye))ge||O(ve,Ge),U(Ge,ye);else{var wt=h(ye);wt!==!1&&(wt&&(ye=wt),ye.actualize&&(ye=ye.actualize(ve.ownerDocument||yt)),O(ve,ye),re(ye))}ye=Qe,ue=Ae}le(ve,ue,Be);var lt=Oa[ve.nodeName];lt&<(ve,te)}var ce=s,de=ce.nodeType,pe=a.nodeType;if(!J){if(de===Oo)pe===Oo?vi(s,a)||(G(s),ce=Yl(s,Xl(a.nodeName,a.namespaceURI))):ce=a;else if(de===za||de===Ia){if(pe===de)return ce.nodeValue!==a.nodeValue&&(ce.nodeValue=a.nodeValue),ce;ce=a}}if(ce===a)G(s);else{if(a.isSameNode&&a.isSameNode(ce))return;if(U(ce,a,J),q)for(var Ce=0,_e=q.length;Ce<_e;Ce++){var me=I[q[Ce]];me&&z(me,me.parentNode,!1)}}return!J&&ce!==s&&s.parentNode&&(ce.actualize&&(ce=ce.actualize(s.ownerDocument||yt)),s.parentNode.replaceChild(ce,s)),ce}}var tc=ec(Hl),ja=tc,_i=class{static patchEl(t,i,s){ja(t,i,{childrenOnly:!1,onBeforeElUpdated:(a,c)=>{if(s&&s.isSameNode(a)&&Y.isFormInput(a))return Y.mergeFocusedInput(a,c),!1}})}constructor(t,i,s,a,c,d){this.view=t,this.liveSocket=t.liveSocket,this.container=i,this.id=s,this.rootID=t.root.id,this.html=a,this.streams=c,this.streamInserts={},this.streamComponentRestore={},this.targetCID=d,this.cidPatch=mn(this.targetCID),this.pendingRemoves=[],this.phxRemove=this.liveSocket.binding("remove"),this.callbacks={beforeadded:[],beforeupdated:[],beforephxChildAdded:[],afteradded:[],afterupdated:[],afterdiscarded:[],afterphxChildAdded:[],aftertransitionsDiscarded:[]}}before(t,i){this.callbacks[`before${t}`].push(i)}after(t,i){this.callbacks[`after${t}`].push(i)}trackBefore(t,...i){this.callbacks[`before${t}`].forEach(s=>s(...i))}trackAfter(t,...i){this.callbacks[`after${t}`].forEach(s=>s(...i))}markPrunableContentForRemoval(){let t=this.liveSocket.binding(Ei);Y.all(this.container,`[${t}=append] > *, [${t}=prepend] > *`,i=>{i.setAttribute(ga,"")})}perform(t){let{view:i,liveSocket:s,container:a,html:c}=this,d=this.isCIDPatch()?this.targetCIDContainer(c):a;if(this.isCIDPatch()&&!d)return;let m=s.getActiveElement(),{selectionStart:h,selectionEnd:p}=m&&Y.hasSelectionRange(m)?m:{},v=s.binding(Ei),y=s.binding(xi),R=s.binding(Ci),G=s.binding(_r),$=s.binding(gr),N=s.binding(Fr),O=s.binding(vl),J=[],I=[],q=[],V=[],E=null;function z(H,re,le=!1){ja(H,re,{childrenOnly:H.getAttribute(un)===null&&!le,getNodeKey:U=>Y.isPhxDestroyed(U)?null:t?U.id:U.id||U.getAttribute&&U.getAttribute(Va),skipFromChildren:U=>U.getAttribute(v)===dr,addChild:(U,ee)=>{let{ref:ce,streamAt:de}=this.getStreamInsert(ee);if(ce===void 0)return U.appendChild(ee);if(this.setStreamRef(ee,ce),de===0)U.insertAdjacentElement("afterbegin",ee);else if(de===-1)U.appendChild(ee);else if(de>0){let pe=Array.from(U.children)[de];U.insertBefore(ee,pe)}},onBeforeNodeAdded:U=>{Y.maybeAddPrivateHooks(U,$,N),this.trackBefore("added",U);let ee=U;return!t&&this.streamComponentRestore[U.id]&&(ee=this.streamComponentRestore[U.id],delete this.streamComponentRestore[U.id],z.call(this,ee,U,!0)),ee},onNodeAdded:U=>{U.getAttribute&&this.maybeReOrderStream(U,!0),Y.isFeedbackContainer(U,y)&&I.push(U),U instanceof HTMLImageElement&&U.srcset?U.srcset=U.srcset:U instanceof HTMLVideoElement&&U.autoplay&&U.play(),Y.isNowTriggerFormExternal(U,O)&&(E=U),(Y.isPhxChild(U)&&i.ownsElement(U)||Y.isPhxSticky(U)&&i.ownsElement(U.parentNode))&&this.trackAfter("phxChildAdded",U),J.push(U)},onNodeDiscarded:U=>this.onNodeDiscarded(U),onBeforeNodeDiscarded:U=>U.getAttribute&&U.getAttribute(ga)!==null?!0:!(U.parentElement!==null&&U.id&&Y.isPhxUpdate(U.parentElement,v,[dr,"append","prepend"])||this.maybePendingRemove(U)||this.skipCIDSibling(U)),onElUpdated:U=>{Y.isNowTriggerFormExternal(U,O)&&(E=U),q.push(U),this.maybeReOrderStream(U,!1)},onBeforeElUpdated:(U,ee)=>{if(Y.maybeAddPrivateHooks(ee,$,N),(Y.isFeedbackContainer(U,y)||Y.isFeedbackContainer(ee,y))&&(I.push(U),I.push(ee)),Y.cleanChildNodes(ee,v),this.skipCIDSibling(ee))return this.maybeReOrderStream(U),!1;if(Y.isPhxSticky(U))return!1;if(Y.isIgnored(U,v)||U.form&&U.form.isSameNode(E))return this.trackBefore("updated",U,ee),Y.mergeAttrs(U,ee,{isIgnored:Y.isIgnored(U,v)}),q.push(U),Y.applyStickyOperations(U),!1;if(U.type==="number"&&U.validity&&U.validity.badInput)return!1;if(!Y.syncPendingRef(U,ee,G))return Y.isUploadInput(U)&&(this.trackBefore("updated",U,ee),q.push(U)),Y.applyStickyOperations(U),!1;if(Y.isPhxChild(ee)){let pe=U.getAttribute(bn);return Y.mergeAttrs(U,ee,{exclude:[ro]}),pe!==""&&U.setAttribute(bn,pe),U.setAttribute(In,this.rootID),Y.applyStickyOperations(U),!1}Y.copyPrivates(ee,U);let ce=m&&U.isSameNode(m)&&Y.isFormInput(U),de=ce&&this.isChangedSelect(U,ee);return ce&&U.type!=="hidden"&&!de?(this.trackBefore("updated",U,ee),Y.mergeFocusedInput(U,ee),Y.syncAttrsToProps(U),q.push(U),Y.applyStickyOperations(U),!1):(de&&U.blur(),Y.isPhxUpdate(ee,v,["append","prepend"])&&V.push(new Gl(U,ee,ee.getAttribute(v))),Y.syncAttrsToProps(ee),Y.applyStickyOperations(ee),this.trackBefore("updated",U,ee),!0)}})}return this.trackBefore("added",a),this.trackBefore("updated",a,a),s.time("morphdom",()=>{this.streams.forEach(([H,re,le,U])=>{re.forEach(([ee,ce,de])=>{this.streamInserts[ee]={ref:H,streamAt:ce,limit:de,reset:U}}),U!==void 0&&Y.all(a,`[${fr}="${H}"]`,ee=>{this.removeStreamChildElement(ee)}),le.forEach(ee=>{let ce=a.querySelector(`[id="${ee}"]`);ce&&this.removeStreamChildElement(ce)})}),t&&Y.all(this.container,`[${v}=${dr}]`,H=>{this.liveSocket.owner(H,re=>{re===this.view&&Array.from(H.children).forEach(le=>{this.removeStreamChildElement(le)})})}),z.call(this,d,c)}),s.isDebugEnabled()&&(Pl(),Array.from(document.querySelectorAll("input[name=id]")).forEach(H=>{H.form&&console.error(`Detected an input with name="id" inside a form! This will cause problems when patching the DOM. `,H)})),V.length>0&&s.time("post-morph append/prepend restoration",()=>{V.forEach(H=>H.perform())}),Y.maybeHideFeedback(d,I,y,R),s.silenceEvents(()=>Y.restoreFocus(m,h,p)),Y.dispatchEvent(document,"phx:update"),J.forEach(H=>this.trackAfter("added",H)),q.forEach(H=>this.trackAfter("updated",H)),this.transitionPendingRemoves(),E&&(s.unload(),Object.getPrototypeOf(E).submit.call(E)),!0}onNodeDiscarded(t){(Y.isPhxChild(t)||Y.isPhxSticky(t))&&this.liveSocket.destroyViewByEl(t),this.trackAfter("discarded",t)}maybePendingRemove(t){return t.getAttribute&&t.getAttribute(this.phxRemove)!==null?(this.pendingRemoves.push(t),!0):!1}removeStreamChildElement(t){this.streamInserts[t.id]?(this.streamComponentRestore[t.id]=t,t.remove()):this.maybePendingRemove(t)||(t.remove(),this.onNodeDiscarded(t))}getStreamInsert(t){return(t.id?this.streamInserts[t.id]:{})||{}}setStreamRef(t,i){Y.putSticky(t,fr,s=>s.setAttribute(fr,i))}maybeReOrderStream(t,i){let{ref:s,streamAt:a,reset:c}=this.getStreamInsert(t);if(a!==void 0&&(this.setStreamRef(t,s),!(!c&&!i)&&t.parentElement)){if(a===0)t.parentElement.insertBefore(t,t.parentElement.firstElementChild);else if(a>0){let d=Array.from(t.parentElement.children),m=d.indexOf(t);if(a>=d.length-1)t.parentElement.appendChild(t);else{let h=d[a];m>a?t.parentElement.insertBefore(t,h):t.parentElement.insertBefore(t,h.nextElementSibling)}}this.maybeLimitStream(t)}}maybeLimitStream(t){let{limit:i}=this.getStreamInsert(t),s=i!==null&&Array.from(t.parentElement.children);i&&i<0&&s.length>i*-1?s.slice(0,s.length+i).forEach(a=>this.removeStreamChildElement(a)):i&&i>=0&&s.length>i&&s.slice(i).forEach(a=>this.removeStreamChildElement(a))}transitionPendingRemoves(){let{pendingRemoves:t,liveSocket:i}=this;t.length>0&&(i.transitionRemoves(t),i.requestDOMUpdate(()=>{t.forEach(s=>{let a=Y.firstPhxChild(s);a&&i.destroyViewByEl(a),s.remove()}),this.trackAfter("transitionsDiscarded",t)}))}isChangedSelect(t,i){if(!(t instanceof HTMLSelectElement)||t.multiple)return!1;if(t.options.length!==i.options.length)return!0;let s=t.selectedOptions[0],a=i.selectedOptions[0];return s&&s.hasAttribute("selected")&&a.setAttribute("selected",s.getAttribute("selected")),!t.isEqualNode(i)}isCIDPatch(){return this.cidPatch}skipCIDSibling(t){return t.nodeType===Node.ELEMENT_NODE&&t.hasAttribute(Za)}targetCIDContainer(t){if(!this.isCIDPatch())return;let[i,...s]=Y.findComponentNodeList(this.container,this.targetCID);return s.length===0&&Y.childNodeLength(t)===1?i:i&&i.parentNode}indexOf(t,i){return Array.from(t.children).indexOf(i)}},nc=new Set(["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),oc=new Set(["'",'"']),Na=(t,i,s)=>{let a=0,c=!1,d,m,h,p,v,y,R=t.match(/^(\s*(?:\s*)*)<([^\s\/>]+)/);if(R===null)throw new Error(`malformed html ${t}`);for(a=R[0].length,d=R[1],h=R[2],p=a,a;a";a++)if(t.charAt(a)==="="){let N=t.slice(a-3,a)===" id";a++;let O=t.charAt(a);if(oc.has(O)){let J=a;for(a++,a;a=d.length+h.length;){let N=t.charAt(G);if(c)N==="-"&&t.slice(G-3,G)===""&&t.slice(G-2,G)==="--")c=!0,G-=3;else{if(N===">")break;G-=1}}m=t.slice(G+1,t.length);let $=Object.keys(i).map(N=>i[N]===!0?N:`${N}="${i[N]}"`).join(" ");if(s){let N=v?` id="${v}"`:"";nc.has(h)?y=`<${h}${N}${$===""?"":" "}${$}/>`:y=`<${h}${N}${$===""?"":" "}${$}>`}else{let N=t.slice(p,G+1);y=`<${h}${$===""?"":" "}${$}${N}`}return[y,d,m]},Ua=class{static extract(t){let{[La]:i,[Ca]:s,[Ea]:a}=t;return delete t[La],delete t[Ca],delete t[Ea],{diff:t,title:a,reply:i||null,events:s||[]}}constructor(t,i){this.viewId=t,this.rendered={},this.magicId=0,this.mergeDiff(i)}parentViewId(){return this.viewId}toString(t){let[i,s]=this.recursiveToString(this.rendered,this.rendered[ht],t,!0,{});return[i,s]}recursiveToString(t,i=t[ht],s,a,c){s=s?new Set(s):null;let d={buffer:"",components:i,onlyCids:s,streams:new Set};return this.toOutputBuffer(t,null,d,a,c),[d.buffer,d.streams]}componentCIDs(t){return Object.keys(t[ht]||{}).map(i=>parseInt(i))}isComponentOnlyDiff(t){return t[ht]?Object.keys(t).length===1:!1}getComponent(t,i){return t[ht][i]}resetRender(t){this.rendered[ht][t]&&(this.rendered[ht][t].reset=!0)}mergeDiff(t){let i=t[ht],s={};if(delete t[ht],this.rendered=this.mutableMerge(this.rendered,t),this.rendered[ht]=this.rendered[ht]||{},i){let a=this.rendered[ht];for(let c in i)i[c]=this.cachedFindComponent(c,i[c],a,i,s);for(let c in i)a[c]=i[c];t[ht]=i}}cachedFindComponent(t,i,s,a,c){if(c[t])return c[t];{let d,m,h=i[Qt];if(mn(h)){let p;h>0?p=this.cachedFindComponent(h,a[h],s,a,c):p=s[-h],m=p[Qt],d=this.cloneMerge(p,i,!0),d[Qt]=m}else d=i[Qt]!==void 0||s[t]===void 0?i:this.cloneMerge(s[t],i,!1);return c[t]=d,d}}mutableMerge(t,i){return i[Qt]!==void 0?i:(this.doMutableMerge(t,i),t)}doMutableMerge(t,i){for(let s in i){let a=i[s],c=t[s];io(a)&&a[Qt]===void 0&&io(c)?this.doMutableMerge(c,a):t[s]=a}t[hr]&&(t.newRender=!0)}cloneMerge(t,i,s){let a=Ct(Ct({},t),i);for(let c in a){let d=i[c],m=t[c];io(d)&&d[Qt]===void 0&&io(m)?a[c]=this.cloneMerge(m,d,s):d===void 0&&io(m)&&(a[c]=this.cloneMerge(m,{},s))}return s?(delete a.magicId,delete a.newRender):t[hr]&&(a.newRender=!0),a}componentToString(t){let[i,s]=this.recursiveCIDToString(this.rendered[ht],t,null),[a,c,d]=Na(i,{});return[a,s]}pruneCIDs(t){t.forEach(i=>delete this.rendered[ht][i])}get(){return this.rendered}isNewFingerprint(t={}){return!!t[Qt]}templateStatic(t,i){return typeof t=="number"?i[t]:t}nextMagicID(){return this.magicId++,`m${this.magicId}-${this.parentViewId()}`}toOutputBuffer(t,i,s,a,c={}){if(t[gi])return this.comprehensionToBuffer(t,i,s);let{[Qt]:d}=t;d=this.templateStatic(d,i);let m=t[hr],h=s.buffer;m&&(s.buffer=""),a&&m&&!t.magicId&&(t.newRender=!0,t.magicId=this.nextMagicID()),s.buffer+=d[0];for(let p=1;p0||p.length>0||v)&&(delete t[Aa],t[gi]=[],s.streams.add(d))}dynamicToBuffer(t,i,s,a){if(typeof t=="number"){let[c,d]=this.recursiveCIDToString(s.components,t,s.onlyCids);s.buffer+=c,s.streams=new Set([...s.streams,...d])}else io(t)?this.toOutputBuffer(t,i,s,a,{}):s.buffer+=t}recursiveCIDToString(t,i,s){let a=t[i]||At(`no component for CID ${i}`,t),c={[un]:i},d=s&&!s.has(i);a.newRender=!d,a.magicId=`c${i}-${this.parentViewId()}`;let m=!a.reset,[h,p]=this.recursiveToString(a,t,s,m,c);return delete a.reset,[h,p]}},ic=1,Ro=class{static makeID(){return ic++}static elementID(t){return t.phxHookId}constructor(t,i,s){this.__view=t,this.liveSocket=t.liveSocket,this.__callbacks=s,this.__listeners=new Set,this.__isDisconnected=!1,this.el=i,this.el.phxHookId=this.constructor.makeID();for(let a in this.__callbacks)this[a]=this.__callbacks[a]}__mounted(){this.mounted&&this.mounted()}__updated(){this.updated&&this.updated()}__beforeUpdate(){this.beforeUpdate&&this.beforeUpdate()}__destroyed(){this.destroyed&&this.destroyed()}__reconnected(){this.__isDisconnected&&(this.__isDisconnected=!1,this.reconnected&&this.reconnected())}__disconnected(){this.__isDisconnected=!0,this.disconnected&&this.disconnected()}pushEvent(t,i={},s=function(){}){return this.__view.pushHookEvent(this.el,null,t,i,s)}pushEventTo(t,i,s={},a=function(){}){return this.__view.withinTargets(t,(c,d)=>c.pushHookEvent(this.el,d,i,s,a))}handleEvent(t,i){let s=(a,c)=>c?t:i(a.detail);return window.addEventListener(`phx:${t}`,s),this.__listeners.add(s),s}removeHandleEvent(t){let i=t(null,!0);window.removeEventListener(`phx:${i}`,t),this.__listeners.delete(t)}upload(t,i){return this.__view.dispatchUploads(null,t,i)}uploadTo(t,i,s){return this.__view.withinTargets(t,(a,c)=>{a.dispatchUploads(c,i,s)})}__cleanup__(){this.__listeners.forEach(t=>this.removeHandleEvent(t))}},yi=(t,i,s=[])=>{let v=i,{submitter:a}=v,c=fa(v,["submitter"]),d;if(a&&a.name){let y=document.createElement("input");y.type="hidden";let R=a.getAttribute("form");R&&y.setAttribute("form",R),y.name=a.name,y.value=a.value,a.parentElement.insertBefore(y,a),d=y}let m=new FormData(t),h=[];m.forEach((y,R,G)=>{y instanceof File&&h.push(R)}),h.forEach(y=>m.delete(y));let p=new URLSearchParams;for(let[y,R]of m.entries())(s.length===0||s.indexOf(y)>=0)&&p.append(y,R);a&&d&&a.parentElement.removeChild(d);for(let y in c)p.append(y,c[y]);return p.toString()},Xa=class{constructor(t,i,s,a,c){this.isDead=!1,this.liveSocket=i,this.flash=a,this.parent=s,this.root=s?s.root:this,this.el=t,this.id=this.el.id,this.ref=0,this.childJoins=0,this.loaderTimer=null,this.pendingDiffs=[],this.pendingForms=new Set,this.redirect=!1,this.href=null,this.joinCount=this.parent?this.parent.joinCount-1:0,this.joinPending=!0,this.destroyed=!1,this.joinCallback=function(d){d&&d()},this.stopCallback=function(){},this.pendingJoinOps=this.parent?null:[],this.viewHooks={},this.formSubmits=[],this.children=this.parent?null:{},this.root.children[this.id]={},this.formsForRecovery={},this.channel=this.liveSocket.channel(`lv:${this.id}`,()=>{let d=this.href&&this.expandURL(this.href);return{redirect:this.redirect?d:void 0,url:this.redirect?void 0:d||void 0,params:this.connectParams(c),session:this.getSession(),static:this.getStatic(),flash:this.flash}})}setHref(t){this.href=t}setRedirect(t){this.redirect=!0,this.href=t}isMain(){return this.el.hasAttribute(kr)}connectParams(t){let i=this.liveSocket.params(this.el),s=Y.all(document,`[${this.binding(pl)}]`).map(a=>a.src||a.href).filter(a=>typeof a=="string");return s.length>0&&(i._track_static=s),i._mounts=this.joinCount,i._live_referer=t,i}isConnected(){return this.channel.canPush()}getSession(){return this.el.getAttribute(bn)}getStatic(){let t=this.el.getAttribute(ro);return t===""?null:t}destroy(t=function(){}){this.destroyAllChildren(),this.destroyed=!0,delete this.root.children[this.id],this.parent&&delete this.root.children[this.parent.id][this.id],clearTimeout(this.loaderTimer);let i=()=>{t();for(let s in this.viewHooks)this.destroyHook(this.viewHooks[s])};Y.markPhxChildDestroyed(this.el),this.log("destroyed",()=>["the child has been removed from the parent"]),this.channel.leave().receive("ok",i).receive("error",i).receive("timeout",i)}setContainerClasses(...t){this.el.classList.remove(va,Bo,hi,_a,lr),this.el.classList.add(...t)}showLoader(t){if(clearTimeout(this.loaderTimer),t)this.loaderTimer=setTimeout(()=>this.showLoader(),t);else{for(let i in this.viewHooks)this.viewHooks[i].__disconnected();this.setContainerClasses(Bo)}}execAll(t){Y.all(this.el,`[${t}]`,i=>this.liveSocket.execJS(i,i.getAttribute(t)))}hideLoader(){clearTimeout(this.loaderTimer),this.setContainerClasses(va),this.execAll(this.binding("connected"))}triggerReconnected(){for(let t in this.viewHooks)this.viewHooks[t].__reconnected()}log(t,i){this.liveSocket.log(this,t,i)}transition(t,i,s=function(){}){this.liveSocket.transition(t,i,s)}withinTargets(t,i,s=document,a){if(t instanceof HTMLElement||t instanceof SVGElement)return this.liveSocket.owner(t,c=>i(c,t));if(mn(t))Y.findComponentNodeList(a||this.el,t).length===0?At(`no component found matching phx-target of ${t}`):i(this,parseInt(t));else{let c=Array.from(s.querySelectorAll(t));c.length===0&&At(`nothing found matching the phx-target selector "${t}"`),c.forEach(d=>this.liveSocket.owner(d,m=>i(m,d)))}}applyDiff(t,i,s){this.log(t,()=>["",wi(i)]);let{diff:a,reply:c,events:d,title:m}=Ua.extract(i);s({diff:a,reply:c,events:d}),typeof m=="string"&&window.requestAnimationFrame(()=>Y.putTitle(m))}onJoin(t){let{rendered:i,container:s,liveview_version:a}=t;if(s){let[c,d]=s;this.el=Y.replaceRootContainer(this.el,c,d)}this.childJoins=0,this.joinPending=!0,this.flash=null,this.root===this&&(this.formsForRecovery=this.getFormsForRecovery()),a!==this.liveSocket.version()&&console.error(`LiveView asset version mismatch. JavaScript version ${this.liveSocket.version()} vs. server ${a}. To avoid issues, please ensure that your assets use the same version as the server.`),en.dropLocal(this.liveSocket.localStorage,window.location.pathname,Ga),this.applyDiff("mount",i,({diff:c,events:d})=>{this.rendered=new Ua(this.id,c);let[m,h]=this.renderContainer(null,"join");this.dropPendingRefs(),this.joinCount++,this.maybeRecoverForms(m,()=>{this.onJoinComplete(t,m,h,d)})})}dropPendingRefs(){Y.all(document,`[${kn}="${this.id}"][${Et}]`,t=>{t.removeAttribute(Et),t.removeAttribute(kn)})}onJoinComplete({live_patch:t},i,s,a){if(this.joinCount>1||this.parent&&!this.parent.isJoinPending())return this.applyJoinPatch(t,i,s,a);Y.findPhxChildrenInFragment(i,this.id).filter(d=>{let m=d.id&&this.el.querySelector(`[id="${d.id}"]`),h=m&&m.getAttribute(ro);return h&&d.setAttribute(ro,h),m&&m.setAttribute(In,this.root.id),this.joinChild(d)}).length===0?this.parent?(this.root.pendingJoinOps.push([this,()=>this.applyJoinPatch(t,i,s,a)]),this.parent.ackJoin(this)):(this.onAllChildJoinsComplete(),this.applyJoinPatch(t,i,s,a)):this.root.pendingJoinOps.push([this,()=>this.applyJoinPatch(t,i,s,a)])}attachTrueDocEl(){this.el=Y.byId(this.id),this.el.setAttribute(In,this.root.id)}execNewMounted(){let t=this.binding(gr),i=this.binding(Fr);Y.all(this.el,`[${t}], [${i}]`,s=>{this.ownsElement(s)&&(Y.maybeAddPrivateHooks(s,t,i),this.maybeAddNewHook(s))}),Y.all(this.el,`[${this.binding(Do)}], [data-phx-${Do}]`,s=>{this.ownsElement(s)&&this.maybeAddNewHook(s)}),Y.all(this.el,`[${this.binding(wa)}]`,s=>{this.ownsElement(s)&&this.maybeMounted(s)})}applyJoinPatch(t,i,s,a){this.attachTrueDocEl();let c=new _i(this,this.el,this.id,i,s,null);if(c.markPrunableContentForRemoval(),this.performPatch(c,!1,!0),this.joinNewChildren(),this.execNewMounted(),this.joinPending=!1,this.liveSocket.dispatchEvents(a),this.applyPendingUpdates(),t){let{kind:d,to:m}=t;this.liveSocket.historyPatch(m,d)}this.hideLoader(),this.joinCount>1&&this.triggerReconnected(),this.stopCallback()}triggerBeforeUpdateHook(t,i){this.liveSocket.triggerDOM("onBeforeElUpdated",[t,i]);let s=this.getHook(t),a=s&&Y.isIgnored(t,this.binding(Ei));if(s&&!t.isEqualNode(i)&&!(a&&Tl(t.dataset,i.dataset)))return s.__beforeUpdate(),s}maybeMounted(t){let i=t.getAttribute(this.binding(wa)),s=i&&Y.private(t,"mounted");i&&!s&&(this.liveSocket.execJS(t,i),Y.putPrivate(t,"mounted",!0))}maybeAddNewHook(t,i){let s=this.addHook(t);s&&s.__mounted()}performPatch(t,i,s=!1){let a=[],c=!1,d=new Set;return t.after("added",m=>{this.liveSocket.triggerDOM("onNodeAdded",[m]);let h=this.binding(gr),p=this.binding(Fr);Y.maybeAddPrivateHooks(m,h,p),this.maybeAddNewHook(m),m.getAttribute&&this.maybeMounted(m)}),t.after("phxChildAdded",m=>{Y.isPhxSticky(m)?this.liveSocket.joinRootViews():c=!0}),t.before("updated",(m,h)=>{this.triggerBeforeUpdateHook(m,h)&&d.add(m.id)}),t.after("updated",m=>{d.has(m.id)&&this.getHook(m).__updated()}),t.after("discarded",m=>{m.nodeType===Node.ELEMENT_NODE&&a.push(m)}),t.after("transitionsDiscarded",m=>this.afterElementsRemoved(m,i)),t.perform(s),this.afterElementsRemoved(a,i),c}afterElementsRemoved(t,i){let s=[];t.forEach(a=>{let c=Y.all(a,`[${un}]`),d=Y.all(a,`[${this.binding(Do)}]`);c.concat(a).forEach(m=>{let h=this.componentID(m);mn(h)&&s.indexOf(h)===-1&&s.push(h)}),d.concat(a).forEach(m=>{let h=this.getHook(m);h&&this.destroyHook(h)})}),i&&this.maybePushComponentsDestroyed(s)}joinNewChildren(){Y.findPhxChildren(this.el,this.id).forEach(t=>this.joinChild(t))}maybeRecoverForms(t,i){let s=this.binding("change"),a=this.root.formsForRecovery,c=document.createElement("template");c.innerHTML=t;let d=c.content.firstElementChild;d.id=this.id,d.setAttribute(In,this.root.id),d.setAttribute(bn,this.getSession()),d.setAttribute(ro,this.getStatic()),d.setAttribute(zn,this.parent?this.parent.id:null);let m=Y.all(c.content,"form").filter(h=>h.id&&a[h.id]).filter(h=>!this.pendingForms.has(h.id)).filter(h=>a[h.id].getAttribute(s)===h.getAttribute(s)).map(h=>[a[h.id],h]);if(m.length===0)return i();m.forEach(([h,p],v)=>{this.pendingForms.add(p.id),this.pushFormRecovery(h,p,c.content,()=>{this.pendingForms.delete(p.id),v===m.length-1&&i()})})}getChildById(t){return this.root.children[this.id][t]}getDescendentByEl(t){return t.id===this.id?this:this.children[t.getAttribute(zn)][t.id]}destroyDescendent(t){for(let i in this.root.children)for(let s in this.root.children[i])if(s===t)return this.root.children[i][s].destroy()}joinChild(t){if(!this.getChildById(t.id)){let s=new Xa(t,this.liveSocket,this);return this.root.children[this.id][s.id]=s,s.join(),this.childJoins++,!0}}isJoinPending(){return this.joinPending}ackJoin(t){this.childJoins--,this.childJoins===0&&(this.parent?this.parent.ackJoin(this):this.onAllChildJoinsComplete())}onAllChildJoinsComplete(){this.pendingForms.clear(),this.formsForRecovery={},this.joinCallback(()=>{this.pendingJoinOps.forEach(([t,i])=>{t.isDestroyed()||i()}),this.pendingJoinOps=[]})}update(t,i){if(this.isJoinPending()||this.liveSocket.hasPendingLink()&&this.root.isMain())return this.pendingDiffs.push({diff:t,events:i});this.rendered.mergeDiff(t);let s=!1;this.rendered.isComponentOnlyDiff(t)?this.liveSocket.time("component patch complete",()=>{Y.findExistingParentCIDs(this.el,this.rendered.componentCIDs(t)).forEach(c=>{this.componentPatch(this.rendered.getComponent(t,c),c)&&(s=!0)})}):Ba(t)||this.liveSocket.time("full patch complete",()=>{let[a,c]=this.renderContainer(t,"update"),d=new _i(this,this.el,this.id,a,c,null);s=this.performPatch(d,!0)}),this.liveSocket.dispatchEvents(i),s&&this.joinNewChildren()}renderContainer(t,i){return this.liveSocket.time(`toString diff (${i})`,()=>{let s=this.el.tagName,a=t?this.rendered.componentCIDs(t):null,[c,d]=this.rendered.toString(a);return[`<${s}>${c}`,d]})}componentPatch(t,i){if(Ba(t))return!1;let[s,a]=this.rendered.componentToString(i),c=new _i(this,this.el,this.id,s,a,i);return this.performPatch(c,!0)}getHook(t){return this.viewHooks[Ro.elementID(t)]}addHook(t){if(Ro.elementID(t)||!t.getAttribute)return;let i=t.getAttribute(`data-phx-${Do}`)||t.getAttribute(this.binding(Do));if(i&&!this.ownsElement(t))return;let s=this.liveSocket.getHookCallbacks(i);if(s){t.id||At(`no DOM ID for hook "${i}". Hooks require a unique ID on each element.`,t);let a=new Ro(this,t,s);return this.viewHooks[Ro.elementID(a.el)]=a,a}else i!==null&&At(`unknown hook found for "${i}"`,t)}destroyHook(t){t.__destroyed(),t.__cleanup__(),delete this.viewHooks[Ro.elementID(t.el)]}applyPendingUpdates(){this.pendingDiffs.forEach(({diff:t,events:i})=>this.update(t,i)),this.pendingDiffs=[],this.eachChild(t=>t.applyPendingUpdates())}eachChild(t){let i=this.root.children[this.id]||{};for(let s in i)t(this.getChildById(s))}onChannel(t,i){this.liveSocket.onChannel(this.channel,t,s=>{this.isJoinPending()?this.root.pendingJoinOps.push([this,()=>i(s)]):this.liveSocket.requestDOMUpdate(()=>i(s))})}bindChannel(){this.liveSocket.onChannel(this.channel,"diff",t=>{this.liveSocket.requestDOMUpdate(()=>{this.applyDiff("update",t,({diff:i,events:s})=>this.update(i,s))})}),this.onChannel("redirect",({to:t,flash:i})=>this.onRedirect({to:t,flash:i})),this.onChannel("live_patch",t=>this.onLivePatch(t)),this.onChannel("live_redirect",t=>this.onLiveRedirect(t)),this.channel.onError(t=>this.onError(t)),this.channel.onClose(t=>this.onClose(t))}destroyAllChildren(){this.eachChild(t=>t.destroy())}onLiveRedirect(t){let{to:i,kind:s,flash:a}=t,c=this.expandURL(i);this.liveSocket.historyRedirect(c,s,a)}onLivePatch(t){let{to:i,kind:s}=t;this.href=this.expandURL(i),this.liveSocket.historyPatch(i,s)}expandURL(t){return t.startsWith("/")?`${window.location.protocol}//${window.location.host}${t}`:t}onRedirect({to:t,flash:i}){this.liveSocket.redirect(t,i)}isDestroyed(){return this.destroyed}joinDead(){this.isDead=!0}join(t){this.showLoader(this.liveSocket.loaderTimeout),this.bindChannel(),this.isMain()&&(this.stopCallback=this.liveSocket.withPageLoading({to:this.href,kind:"initial"})),this.joinCallback=i=>{i=i||function(){},t?t(this.joinCount,i):i()},this.liveSocket.wrapPush(this,{timeout:!1},()=>this.channel.join().receive("ok",i=>{this.isDestroyed()||this.liveSocket.requestDOMUpdate(()=>this.onJoin(i))}).receive("error",i=>!this.isDestroyed()&&this.onJoinError(i)).receive("timeout",()=>!this.isDestroyed()&&this.onJoinError({reason:"timeout"})))}onJoinError(t){if(t.reason==="reload"){this.log("error",()=>[`failed mount with ${t.status}. Falling back to page request`,t]),this.isMain()&&this.onRedirect({to:this.href});return}else if(t.reason==="unauthorized"||t.reason==="stale"){this.log("error",()=>["unauthorized live_redirect. Falling back to page request",t]),this.isMain()&&this.onRedirect({to:this.href});return}if((t.redirect||t.live_redirect)&&(this.joinPending=!1,this.channel.leave()),t.redirect)return this.onRedirect(t.redirect);if(t.live_redirect)return this.onLiveRedirect(t.live_redirect);this.displayError([Bo,hi,lr]),this.log("error",()=>["unable to join",t]),this.liveSocket.isConnected()&&this.liveSocket.reloadWithJitter(this)}onClose(t){if(!this.isDestroyed()){if(this.liveSocket.hasPendingLink()&&t!=="leave")return this.liveSocket.reloadWithJitter(this);this.destroyAllChildren(),this.liveSocket.dropActiveElement(this),document.activeElement&&document.activeElement.blur(),this.liveSocket.isUnloaded()&&this.showLoader(Ll)}}onError(t){this.onClose(t),this.liveSocket.isConnected()&&this.log("error",()=>["view crashed",t]),this.liveSocket.isUnloaded()||(this.liveSocket.isConnected()?this.displayError([Bo,hi,lr]):this.displayError([Bo,hi,_a]))}displayError(t){this.isMain()&&Y.dispatchEvent(window,"phx:page-loading-start",{detail:{to:this.href,kind:"error"}}),this.showLoader(),this.setContainerClasses(...t),this.execAll(this.binding("disconnected"))}pushWithReply(t,i,s,a=function(){}){if(!this.isConnected())return;let[c,[d],m]=t?t():[null,[],{}],h=function(){};return(m.page_loading||d&&d.getAttribute(this.binding(Fa))!==null)&&(h=this.liveSocket.withPageLoading({kind:"element",target:d})),typeof s.cid!="number"&&delete s.cid,this.liveSocket.wrapPush(this,{timeout:!0},()=>this.channel.push(i,s,Al).receive("ok",p=>{let v=y=>{p.redirect&&this.onRedirect(p.redirect),p.live_patch&&this.onLivePatch(p.live_patch),p.live_redirect&&this.onLiveRedirect(p.live_redirect),h(),a(p,y)};p.diff?this.liveSocket.requestDOMUpdate(()=>{this.applyDiff("update",p.diff,({diff:y,reply:R,events:G})=>{c!==null&&this.undoRefs(c),this.update(y,G),v(R)})}):(c!==null&&this.undoRefs(c),v(null))}))}undoRefs(t,i){i=i?new Set(i):null,this.isConnected()&&Y.all(document,`[${kn}="${this.id}"][${Et}="${t}"]`,s=>{if(i&&!i.has(s))return;s.dispatchEvent(new CustomEvent("phx:unlock",{bubbles:!0,cancelable:!1}));let a=s.getAttribute(oo),c=s.getAttribute(cr);s.removeAttribute(Et),s.removeAttribute(kn),c!==null&&(s.readOnly=c==="true",s.removeAttribute(cr)),a!==null&&(s.disabled=a==="true",s.removeAttribute(oo)),Ha.forEach(h=>Y.removeClass(s,h));let d=s.getAttribute(bi);d!==null&&(s.innerText=d,s.removeAttribute(bi));let m=Y.private(s,Et);if(m){let h=this.triggerBeforeUpdateHook(s,m);_i.patchEl(s,m,this.liveSocket.getActiveElement()),h&&h.__updated(),Y.deletePrivate(s,Et)}})}putRef(t,i,s={}){let a=this.ref++,c=this.binding(_r);s.loading&&(t=t.concat(Y.all(document,s.loading)));for(let d of t){if(d.setAttribute(Et,a),d.setAttribute(kn,this.el.id),s.submitter&&!(d===s.submitter||d===s.form))continue;d.classList.add(`phx-${i}-loading`),d.dispatchEvent(new CustomEvent(`phx:${i}-loading`,{bubbles:!0,cancelable:!1}));let m=d.getAttribute(c);m!==null&&(d.getAttribute(bi)||d.setAttribute(bi,d.innerText),m!==""&&(d.innerText=m),d.setAttribute(oo,d.getAttribute(oo)||d.disabled),d.setAttribute("disabled",""))}return[a,t,s]}componentID(t){let i=t.getAttribute&&t.getAttribute(un);return i?parseInt(i):null}targetComponentID(t,i,s={}){if(mn(i))return i;let a=s.target||t.getAttribute(this.binding("target"));return mn(a)?parseInt(a):i&&(a!==null||s.target)?this.closestComponentID(i):null}closestComponentID(t){return mn(t)?t:t?wn(t.closest(`[${un}]`),i=>this.ownsElement(i)&&this.componentID(i)):null}pushHookEvent(t,i,s,a,c){if(!this.isConnected())return this.log("hook",()=>["unable to push hook event. LiveView not connected",s,a]),!1;let[d,m,h]=this.putRef([t],"hook");return this.pushWithReply(()=>[d,m,h],"event",{type:"hook",event:s,value:a,cid:this.closestComponentID(i)},(p,v)=>c(v,d)),d}extractMeta(t,i,s){let a=this.binding("value-");for(let c=0;c=0&&!t.checked&&delete i.value),s){i||(i={});for(let c in s)i[c]=s[c]}return i}pushEvent(t,i,s,a,c,d={},m){this.pushWithReply(()=>this.putRef([i],t,d),"event",{type:t,event:a,value:this.extractMeta(i,c,d.value),cid:this.targetComponentID(i,s,d)},(h,p)=>m&&m(p))}pushFileProgress(t,i,s,a=function(){}){this.liveSocket.withinOwners(t.form,(c,d)=>{c.pushWithReply(null,"progress",{event:t.getAttribute(c.binding(xl)),ref:t.getAttribute(hn),entry_ref:i,progress:s,cid:c.targetComponentID(t.form,d)},a)})}pushInput(t,i,s,a,c,d){let m,h=mn(s)?s:this.targetComponentID(t.form,i,c),p=()=>this.putRef([t,t.form],"change",c),v,y=this.extractMeta(t.form);t instanceof HTMLButtonElement&&(y.submitter=t),t.getAttribute(this.binding("change"))?v=yi(t.form,Ct({_target:c._target},y),[t.name]):v=yi(t.form,Ct({_target:c._target},y)),Y.isUploadInput(t)&&t.files&&t.files.length>0&&tt.trackFiles(t,Array.from(t.files)),m=tt.serializeUploads(t);let R={type:"form",event:a,value:v,uploads:m,cid:h};this.pushWithReply(p,"event",R,G=>{if(Y.showError(t,this.liveSocket.binding(xi),this.liveSocket.binding(Ci)),Y.isUploadInput(t)&&Y.isAutoUpload(t)){if(tt.filesAwaitingPreflight(t).length>0){let[$,N]=p();this.undoRefs($,[t.form]),this.uploadFiles(t.form,i,$,h,O=>{d&&d(G),this.triggerAwaitingSubmit(t.form),this.undoRefs($)})}}else d&&d(G)})}triggerAwaitingSubmit(t){let i=this.getScheduledSubmit(t);if(i){let[s,a,c,d]=i;this.cancelSubmit(t),d()}}getScheduledSubmit(t){return this.formSubmits.find(([i,s,a,c])=>i.isSameNode(t))}scheduleSubmit(t,i,s,a){if(this.getScheduledSubmit(t))return!0;this.formSubmits.push([t,i,s,a])}cancelSubmit(t){this.formSubmits=this.formSubmits.filter(([i,s,a])=>i.isSameNode(t)?(this.undoRefs(s),!1):!0)}disableForm(t,i={}){let s=y=>!(zo(y,`${this.binding(Ei)}=ignore`,y.form)||zo(y,"data-phx-update=ignore",y.form)),a=y=>y.hasAttribute(this.binding(_r)),c=y=>y.tagName=="BUTTON",d=y=>["INPUT","TEXTAREA","SELECT"].includes(y.tagName),m=Array.from(t.elements),h=m.filter(a),p=m.filter(c).filter(s),v=m.filter(d).filter(s);return p.forEach(y=>{y.setAttribute(oo,y.disabled),y.disabled=!0}),v.forEach(y=>{y.setAttribute(cr,y.readOnly),y.readOnly=!0,y.files&&(y.setAttribute(oo,y.disabled),y.disabled=!0)}),t.setAttribute(this.binding(Fa),""),this.putRef([t].concat(h).concat(p).concat(v),"submit",i)}pushFormSubmit(t,i,s,a,c,d){let m=()=>this.disableForm(t,da(Ct({},c),{form:t,submitter:a})),h=this.targetComponentID(t,i);if(tt.hasUploadsInProgress(t)){let[p,v]=m(),y=()=>this.pushFormSubmit(t,i,s,a,c,d);return this.scheduleSubmit(t,p,c,y)}else if(tt.inputsAwaitingPreflight(t).length>0){let[p,v]=m(),y=()=>[p,v,c];this.uploadFiles(t,i,p,h,R=>{if(tt.inputsAwaitingPreflight(t).length>0)return this.undoRefs(p);let G=this.extractMeta(t),$=yi(t,Ct({submitter:a},G));this.pushWithReply(y,"event",{type:"form",event:s,value:$,cid:h},d)})}else if(!(t.hasAttribute(Et)&&t.classList.contains("phx-submit-loading"))){let p=this.extractMeta(t),v=yi(t,Ct({submitter:a},p));this.pushWithReply(m,"event",{type:"form",event:s,value:v,cid:h},d)}}uploadFiles(t,i,s,a,c){let d=this.joinCount,m=tt.activeFileInputs(t),h=m.length;m.forEach(p=>{let v=new tt(p,this,()=>{h--,h===0&&c()}),y=v.entries().map(G=>G.toPreflightPayload());if(y.length===0){h--;return}let R={ref:p.getAttribute(hn),entries:y,cid:this.targetComponentID(p.form,i)};this.log("upload",()=>["sending preflight request",R]),this.pushWithReply(null,"allow_upload",R,G=>{if(this.log("upload",()=>["got preflight response",G]),v.entries().forEach($=>{G.entries&&!G.entries[$.ref]&&this.handleFailedEntryPreflight($.ref,"failed preflight",v)}),G.error||Object.keys(G.entries).length===0)this.undoRefs(s),(G.error||[]).map(([N,O])=>{this.handleFailedEntryPreflight(N,O,v)});else{let $=N=>{this.channel.onError(()=>{this.joinCount===d&&N()})};v.initAdapterUpload(G,$,this.liveSocket)}})})}handleFailedEntryPreflight(t,i,s){if(s.isAutoUpload()){let a=s.entries().find(c=>c.ref===t.toString());a&&a.cancel()}else s.entries().map(a=>a.cancel());this.log("upload",()=>[`error for entry ${t}`,i])}dispatchUploads(t,i,s){let a=this.targetCtxElement(t)||this.el,c=Y.findUploadInputs(a).filter(d=>d.name===i);c.length===0?At(`no live file inputs found matching the name "${i}"`):c.length>1?At(`duplicate live file inputs found matching the name "${i}"`):Y.dispatchEvent(c[0],qa,{detail:{files:s}})}targetCtxElement(t){if(mn(t)){let[i]=Y.findComponentNodeList(this.el,t);return i}else return t||null}pushFormRecovery(t,i,s,a){let c=this.binding("change"),d=i.getAttribute(this.binding("target"))||i,m=i.getAttribute(this.binding(ka))||i.getAttribute(this.binding("change")),h=Array.from(t.elements).filter(y=>Y.isFormInput(y)&&y.name&&!y.hasAttribute(c));if(h.length===0)return;h.forEach(y=>y.hasAttribute(hn)&&tt.clearFiles(y));let p=h.find(y=>y.type!=="hidden")||h[0],v=0;this.withinTargets(d,(y,R)=>{let G=this.targetComponentID(i,R);v++,y.pushInput(p,R,G,m,{_target:p.name},()=>{v--,v===0&&a()})},s,s)}pushLinkPatch(t,i,s){let a=this.liveSocket.setPendingLink(t),c=i?()=>this.putRef([i],"click"):null,d=()=>this.liveSocket.redirect(window.location.href),m=t.startsWith("/")?`${location.protocol}//${location.host}${t}`:t,h=this.pushWithReply(c,"live_patch",{url:m},p=>{this.liveSocket.requestDOMUpdate(()=>{p.link_redirect?this.liveSocket.replaceMain(t,null,s,a):(this.liveSocket.commitPendingLink(a)&&(this.href=t),this.applyPendingUpdates(),s&&s(a))})});h?h.receive("timeout",d):d()}getFormsForRecovery(){if(this.joinCount===0)return{};let t=this.binding("change");return Y.all(this.el,`form[${t}]`).filter(i=>i.id).filter(i=>i.elements.length>0).filter(i=>i.getAttribute(this.binding(ka))!=="ignore").map(i=>i.cloneNode(!0)).reduce((i,s)=>(i[s.id]=s,i),{})}maybePushComponentsDestroyed(t){let i=t.filter(s=>Y.findComponentNodeList(this.el,s).length===0);i.length>0&&(i.forEach(s=>this.rendered.resetRender(s)),this.pushWithReply(null,"cids_will_destroy",{cids:i},()=>{this.liveSocket.requestDOMUpdate(()=>{let s=i.filter(a=>Y.findComponentNodeList(this.el,a).length===0);s.length>0&&this.pushWithReply(null,"cids_destroyed",{cids:s},a=>{this.rendered.pruneCIDs(a.cids)})})}))}ownsElement(t){let i=t.closest(so);return t.getAttribute(zn)===this.id||i&&i.id===this.id||!i&&this.isDead}submitForm(t,i,s,a,c={}){Y.putPrivate(t,Li,!0);let d=this.liveSocket.binding(xi),m=this.liveSocket.binding(Ci),h=Array.from(t.elements);h.forEach(p=>Y.putPrivate(p,Li,!0)),this.liveSocket.blurActiveElement(this),this.pushFormSubmit(t,i,s,a,c,()=>{h.forEach(p=>Y.showError(p,d,m)),this.liveSocket.restorePreviouslyActiveFocus()})}binding(t){return this.liveSocket.binding(t)}},Ya=class{constructor(t,i,s={}){if(this.unloaded=!1,!i||i.constructor.name==="Object")throw new Error(` a phoenix Socket must be provided as the second argument to the LiveSocket constructor. For example: import {Socket} from "phoenix" import {LiveSocket} from "phoenix_live_view" let liveSocket = new LiveSocket("/live", Socket, {...}) `);this.socket=new i(t,s),this.bindingPrefix=s.bindingPrefix||El,this.opts=s,this.params=So(s.params||{}),this.viewLogger=s.viewLogger,this.metadataCallbacks=s.metadata||{},this.defaults=Object.assign(wi(Bl),s.defaults||{}),this.activeElement=null,this.prevActive=null,this.silenced=!1,this.main=null,this.outgoingMainEl=null,this.clickStartedAtTarget=null,this.linkRef=1,this.roots={},this.href=window.location.href,this.pendingLink=null,this.currentLocation=wi(window.location),this.hooks=s.hooks||{},this.uploaders=s.uploaders||{},this.loaderTimeout=s.loaderTimeout||Cl,this.reloadWithJitterTimer=null,this.maxReloads=s.maxReloads||ml,this.reloadJitterMin=s.reloadJitterMin||ul,this.reloadJitterMax=s.reloadJitterMax||hl,this.failsafeJitter=s.failsafeJitter||bl,this.localStorage=s.localStorage||window.localStorage,this.sessionStorage=s.sessionStorage||window.sessionStorage,this.boundTopLevelEvents=!1,this.serverCloseRef=null,this.domCallbacks=Object.assign({onPatchStart:So(),onPatchEnd:So(),onNodeAdded:So(),onBeforeElUpdated:So()},s.dom||{}),this.transitions=new rc,window.addEventListener("pagehide",a=>{this.unloaded=!0}),this.socket.onOpen(()=>{this.isUnloaded()&&window.location.reload()})}version(){return"0.20.17"}isProfileEnabled(){return this.sessionStorage.getItem(mr)==="true"}isDebugEnabled(){return this.sessionStorage.getItem(pi)==="true"}isDebugDisabled(){return this.sessionStorage.getItem(pi)==="false"}enableDebug(){this.sessionStorage.setItem(pi,"true")}enableProfiling(){this.sessionStorage.setItem(mr,"true")}disableDebug(){this.sessionStorage.setItem(pi,"false")}disableProfiling(){this.sessionStorage.removeItem(mr)}enableLatencySim(t){this.enableDebug(),console.log("latency simulator enabled for the duration of this browser session. Call disableLatencySim() to disable"),this.sessionStorage.setItem(ur,t)}disableLatencySim(){this.sessionStorage.removeItem(ur)}getLatencySim(){let t=this.sessionStorage.getItem(ur);return t?parseInt(t):null}getSocket(){return this.socket}connect(){window.location.hostname==="localhost"&&!this.isDebugDisabled()&&this.enableDebug();let t=()=>{this.joinRootViews()?(this.bindTopLevelEvents(),this.socket.connect()):this.main?this.socket.connect():this.bindTopLevelEvents({dead:!0}),this.joinDeadView()};["complete","loaded","interactive"].indexOf(document.readyState)>=0?t():document.addEventListener("DOMContentLoaded",()=>t())}disconnect(t){clearTimeout(this.reloadWithJitterTimer),this.serverCloseRef&&(this.socket.off(this.serverCloseRef),this.serverCloseRef=null),this.socket.disconnect(t)}replaceTransport(t){clearTimeout(this.reloadWithJitterTimer),this.socket.replaceTransport(t),this.connect()}execJS(t,i,s=null){this.owner(t,a=>bt.exec(s,i,a,t))}execJSHookPush(t,i,s,a){this.withinOwners(t,c=>{bt.exec("hook",i,c,t,["push",{data:s,callback:a}])})}unload(){this.unloaded||(this.main&&this.isConnected()&&this.log(this.main,"socket",()=>["disconnect for page nav"]),this.unloaded=!0,this.destroyAllViews(),this.disconnect())}triggerDOM(t,i){this.domCallbacks[t](...i)}time(t,i){if(!this.isProfileEnabled()||!console.time)return i();console.time(t);let s=i();return console.timeEnd(t),s}log(t,i,s){if(this.viewLogger){let[a,c]=s();this.viewLogger(t,i,a,c)}else if(this.isDebugEnabled()){let[a,c]=s();Sl(t,i,a,c)}}requestDOMUpdate(t){this.transitions.after(t)}transition(t,i,s=function(){}){this.transitions.addTransition(t,i,s)}onChannel(t,i,s){t.on(i,a=>{let c=this.getLatencySim();c?setTimeout(()=>s(a),c):s(a)})}wrapPush(t,i,s){let a=this.getLatencySim(),c=t.joinCount;if(!a)return this.isConnected()&&i.timeout?s().receive("timeout",()=>{t.joinCount===c&&!t.isDestroyed()&&this.reloadWithJitter(t,()=>{this.log(t,"timeout",()=>["received timeout while communicating with server. Falling back to hard refresh for recovery"])})}):s();let d={receives:[],receive(m,h){this.receives.push([m,h])}};return setTimeout(()=>{t.isDestroyed()||d.receives.reduce((m,[h,p])=>m.receive(h,p),s())},a),d}reloadWithJitter(t,i){clearTimeout(this.reloadWithJitterTimer),this.disconnect();let s=this.reloadJitterMin,a=this.reloadJitterMax,c=Math.floor(Math.random()*(a-s+1))+s,d=en.updateLocal(this.localStorage,window.location.pathname,Ga,0,m=>m+1);d>this.maxReloads&&(c=this.failsafeJitter),this.reloadWithJitterTimer=setTimeout(()=>{t.isDestroyed()||t.isConnected()||(t.destroy(),i?i():this.log(t,"join",()=>[`encountered ${d} consecutive reloads`]),d>this.maxReloads&&this.log(t,"join",()=>[`exceeded ${this.maxReloads} consecutive reloads. Entering failsafe mode`]),this.hasPendingLink()?window.location=this.pendingLink:window.location.reload())},c)}getHookCallbacks(t){return t&&t.startsWith("Phoenix.")?Ul[t.split(".")[1]]:this.hooks[t]}isUnloaded(){return this.unloaded}isConnected(){return this.socket.isConnected()}getBindingPrefix(){return this.bindingPrefix}binding(t){return`${this.getBindingPrefix()}${t}`}channel(t,i){return this.socket.channel(t,i)}joinDeadView(){let t=document.body;if(t&&!this.isPhxView(t)&&!this.isPhxView(document.firstElementChild)){let i=this.newRootView(t);i.setHref(this.getHref()),i.joinDead(),this.main||(this.main=i),window.requestAnimationFrame(()=>i.execNewMounted())}}joinRootViews(){let t=!1;return Y.all(document,`${so}:not([${zn}])`,i=>{if(!this.getRootById(i.id)){let s=this.newRootView(i);s.setHref(this.getHref()),s.join(),i.hasAttribute(kr)&&(this.main=s)}t=!0}),t}redirect(t,i){this.unload(),en.redirect(t,i)}replaceMain(t,i,s=null,a=this.setPendingLink(t)){let c=this.currentLocation.href;this.outgoingMainEl=this.outgoingMainEl||this.main.el;let d=Y.cloneNode(this.outgoingMainEl,"");this.main.showLoader(this.loaderTimeout),this.main.destroy(),this.main=this.newRootView(d,i,c),this.main.setRedirect(t),this.transitionRemoves(null,!0),this.main.join((m,h)=>{m===1&&this.commitPendingLink(a)&&this.requestDOMUpdate(()=>{Y.findPhxSticky(document).forEach(p=>d.appendChild(p)),this.outgoingMainEl.replaceWith(d),this.outgoingMainEl=null,s&&s(a),h()})})}transitionRemoves(t,i){let s=this.binding("remove");if(t=t||Y.all(document,`[${s}]`),i){let a=Y.findPhxSticky(document)||[];t=t.filter(c=>!Y.isChildOfAny(c,a))}t.forEach(a=>{this.execJS(a,a.getAttribute(s),"remove")})}isPhxView(t){return t.getAttribute&&t.getAttribute(bn)!==null}newRootView(t,i,s){let a=new Xa(t,this,null,i,s);return this.roots[a.id]=a,a}owner(t,i){let s=wn(t.closest(so),a=>this.getViewByEl(a))||this.main;s&&i(s)}withinOwners(t,i){this.owner(t,s=>i(s,t))}getViewByEl(t){let i=t.getAttribute(In);return wn(this.getRootById(i),s=>s.getDescendentByEl(t))}getRootById(t){return this.roots[t]}destroyAllViews(){for(let t in this.roots)this.roots[t].destroy(),delete this.roots[t];this.main=null}destroyViewByEl(t){let i=this.getRootById(t.getAttribute(In));i&&i.id===t.id?(i.destroy(),delete this.roots[i.id]):i&&i.destroyDescendent(t.id)}setActiveElement(t){if(this.activeElement===t)return;this.activeElement=t;let i=()=>{t===this.activeElement&&(this.activeElement=null),t.removeEventListener("mouseup",this),t.removeEventListener("touchend",this)};t.addEventListener("mouseup",i),t.addEventListener("touchend",i)}getActiveElement(){return document.activeElement===document.body?this.activeElement||document.activeElement:document.activeElement||document.body}dropActiveElement(t){this.prevActive&&t.ownsElement(this.prevActive)&&(this.prevActive=null)}restorePreviouslyActiveFocus(){this.prevActive&&this.prevActive!==document.body&&this.prevActive.focus()}blurActiveElement(){this.prevActive=this.getActiveElement(),this.prevActive!==document.body&&this.prevActive.blur()}bindTopLevelEvents({dead:t}={}){this.boundTopLevelEvents||(this.boundTopLevelEvents=!0,this.serverCloseRef=this.socket.onClose(i=>{if(i&&i.code===1e3&&this.main)return this.reloadWithJitter(this.main)}),document.body.addEventListener("click",function(){}),window.addEventListener("pageshow",i=>{i.persisted&&(this.getSocket().disconnect(),this.withPageLoading({to:window.location.href,kind:"redirect"}),window.location.reload())},!0),t||this.bindNav(),this.bindClicks(),t||this.bindForms(),this.bind({keyup:"keyup",keydown:"keydown"},(i,s,a,c,d,m)=>{let h=c.getAttribute(this.binding(wl)),p=i.key&&i.key.toLowerCase();if(h&&h.toLowerCase()!==p)return;let v=Ct({key:i.key},this.eventMeta(s,i,c));bt.exec(s,d,a,c,["push",{data:v}])}),this.bind({blur:"focusout",focus:"focusin"},(i,s,a,c,d,m)=>{if(!m){let h=Ct({key:i.key},this.eventMeta(s,i,c));bt.exec(s,d,a,c,["push",{data:h}])}}),this.bind({blur:"blur",focus:"focus"},(i,s,a,c,d,m)=>{if(m==="window"){let h=this.eventMeta(s,i,c);bt.exec(s,d,a,c,["push",{data:h}])}}),window.addEventListener("dragover",i=>i.preventDefault()),window.addEventListener("drop",i=>{i.preventDefault();let s=wn(zo(i.target,this.binding(pa)),d=>d.getAttribute(this.binding(pa))),a=s&&document.getElementById(s),c=Array.from(i.dataTransfer.files||[]);!a||a.disabled||c.length===0||!(a.files instanceof FileList)||(tt.trackFiles(a,c,i.dataTransfer),a.dispatchEvent(new Event("input",{bubbles:!0})))}),this.on(qa,i=>{let s=i.target;if(!Y.isUploadInput(s))return;let a=Array.from(i.detail.files||[]).filter(c=>c instanceof File||c instanceof Blob);tt.trackFiles(s,a),s.dispatchEvent(new Event("input",{bubbles:!0}))}))}eventMeta(t,i,s){let a=this.metadataCallbacks[t];return a?a(i,s):{}}setPendingLink(t){return this.linkRef++,this.pendingLink=t,this.linkRef}commitPendingLink(t){return this.linkRef!==t?!1:(this.href=this.pendingLink,this.pendingLink=null,!0)}getHref(){return this.href}hasPendingLink(){return!!this.pendingLink}bind(t,i){for(let s in t){let a=t[s];this.on(a,c=>{let d=this.binding(s),m=this.binding(`window-${s}`),h=c.target.getAttribute&&c.target.getAttribute(d);h?this.debounce(c.target,c,a,()=>{this.withinOwners(c.target,p=>{i(c,s,p,c.target,h,null)})}):Y.all(document,`[${m}]`,p=>{let v=p.getAttribute(m);this.debounce(p,c,a,()=>{this.withinOwners(p,y=>{i(c,s,y,p,v,"window")})})})})}}bindClicks(){window.addEventListener("mousedown",t=>this.clickStartedAtTarget=t.target),this.bindClick("click","click")}bindClick(t,i){let s=this.binding(i);window.addEventListener(t,a=>{let c=null;a.detail===0&&(this.clickStartedAtTarget=a.target);let d=this.clickStartedAtTarget||a.target;c=zo(d,s),this.dispatchClickAway(a,d),this.clickStartedAtTarget=null;let m=c&&c.getAttribute(s);if(!m){Y.isNewPageClick(a,window.location)&&this.unload();return}c.getAttribute("href")==="#"&&a.preventDefault(),!c.hasAttribute(Et)&&this.debounce(c,a,"click",()=>{this.withinOwners(c,h=>{bt.exec("click",m,h,c,["push",{data:this.eventMeta("click",a,c)}])})})},!1)}dispatchClickAway(t,i){let s=this.binding("click-away");Y.all(document,`[${s}]`,a=>{a.isSameNode(i)||a.contains(i)||this.withinOwners(a,c=>{let d=a.getAttribute(s);bt.isVisible(a)&&bt.isInViewport(a)&&bt.exec("click",d,c,a,["push",{data:this.eventMeta("click",t,t.target)}])})})}bindNav(){if(!en.canPushState())return;history.scrollRestoration&&(history.scrollRestoration="manual");let t=null;window.addEventListener("scroll",i=>{clearTimeout(t),t=setTimeout(()=>{en.updateCurrentState(s=>Object.assign(s,{scroll:window.scrollY}))},100)}),window.addEventListener("popstate",i=>{if(!this.registerNewLocation(window.location))return;let{type:s,id:a,root:c,scroll:d}=i.state||{},m=window.location.href;Y.dispatchEvent(window,"phx:navigate",{detail:{href:m,patch:s==="patch",pop:!0}}),this.requestDOMUpdate(()=>{this.main.isConnected()&&s==="patch"&&a===this.main.id?this.main.pushLinkPatch(m,null,()=>{this.maybeScroll(d)}):this.replaceMain(m,null,()=>{c&&this.replaceRootHistory(),this.maybeScroll(d)})})},!1),window.addEventListener("click",i=>{let s=zo(i.target,sr),a=s&&s.getAttribute(sr);if(!a||!this.isConnected()||!this.main||Y.wantsNewTab(i))return;let c=s.href instanceof SVGAnimatedString?s.href.baseVal:s.href,d=s.getAttribute(gl);i.preventDefault(),i.stopImmediatePropagation(),this.pendingLink!==c&&this.requestDOMUpdate(()=>{if(a==="patch")this.pushHistoryPatch(c,d,s);else if(a==="redirect")this.historyRedirect(c,d);else throw new Error(`expected ${sr} to be "patch" or "redirect", got: ${a}`);let m=s.getAttribute(this.binding("click"));m&&this.requestDOMUpdate(()=>this.execJS(s,m,"click"))})},!1)}maybeScroll(t){typeof t=="number"&&requestAnimationFrame(()=>{window.scrollTo(0,t)})}dispatchEvent(t,i={}){Y.dispatchEvent(window,`phx:${t}`,{detail:i})}dispatchEvents(t){t.forEach(([i,s])=>this.dispatchEvent(i,s))}withPageLoading(t,i){Y.dispatchEvent(window,"phx:page-loading-start",{detail:t});let s=()=>Y.dispatchEvent(window,"phx:page-loading-stop",{detail:t});return i?i(s):s}pushHistoryPatch(t,i,s){if(!this.isConnected()||!this.main.isMain())return en.redirect(t);this.withPageLoading({to:t,kind:"patch"},a=>{this.main.pushLinkPatch(t,s,c=>{this.historyPatch(t,i,c),a()})})}historyPatch(t,i,s=this.setPendingLink(t)){this.commitPendingLink(s)&&(en.pushState(i,{type:"patch",id:this.main.id},t),Y.dispatchEvent(window,"phx:navigate",{detail:{patch:!0,href:t,pop:!1}}),this.registerNewLocation(window.location))}historyRedirect(t,i,s){if(!this.isConnected()||!this.main.isMain())return en.redirect(t,s);if(/^\/$|^\/[^\/]+.*$/.test(t)){let{protocol:c,host:d}=window.location;t=`${c}//${d}${t}`}let a=window.scrollY;this.withPageLoading({to:t,kind:"redirect"},c=>{this.replaceMain(t,s,d=>{d===this.linkRef&&(en.pushState(i,{type:"redirect",id:this.main.id,scroll:a},t),Y.dispatchEvent(window,"phx:navigate",{detail:{href:t,patch:!1,pop:!1}}),this.registerNewLocation(window.location)),c()})})}replaceRootHistory(){en.pushState("replace",{root:!0,type:"patch",id:this.main.id})}registerNewLocation(t){let{pathname:i,search:s}=this.currentLocation;return i+s===t.pathname+t.search?!1:(this.currentLocation=wi(t),!0)}bindForms(){let t=0,i=!1;this.on("submit",s=>{let a=s.target.getAttribute(this.binding("submit")),c=s.target.getAttribute(this.binding("change"));!i&&c&&!a&&(i=!0,s.preventDefault(),this.withinOwners(s.target,d=>{d.disableForm(s.target),window.requestAnimationFrame(()=>{Y.isUnloadableFormSubmit(s)&&this.unload(),s.target.submit()})}))},!0),this.on("submit",s=>{let a=s.target.getAttribute(this.binding("submit"));if(!a){Y.isUnloadableFormSubmit(s)&&this.unload();return}s.preventDefault(),s.target.disabled=!0,this.withinOwners(s.target,c=>{bt.exec("submit",a,c,s.target,["push",{submitter:s.submitter}])})},!1);for(let s of["change","input"])this.on(s,a=>{let c=this.binding("change"),d=a.target,m=d.getAttribute(c),h=d.form&&d.form.getAttribute(c),p=m||h;if(!p||d.type==="number"&&d.validity&&d.validity.badInput)return;let v=m?d:d.form,y=t;t++;let{at:R,type:G}=Y.private(d,"prev-iteration")||{};R===y-1&&s==="change"&&G==="input"||(Y.putPrivate(d,"prev-iteration",{at:y,type:s}),this.debounce(d,a,s,()=>{this.withinOwners(v,$=>{Y.putPrivate(d,vr,!0),Y.isTextualInput(d)||this.setActiveElement(d),bt.exec("change",p,$,d,["push",{_target:a.target.name,dispatcher:v}])})}))},!1);this.on("reset",s=>{let a=s.target;Y.resetForm(a,this.binding(xi),this.binding(Ci));let c=Array.from(a.elements).find(d=>d.type==="reset");c&&window.requestAnimationFrame(()=>{c.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!1}))})})}debounce(t,i,s,a){if(s==="blur"||s==="focusout")return a();let c=this.binding(yl),d=this.binding(kl),m=this.defaults.debounce.toString(),h=this.defaults.throttle.toString();this.withinOwners(t,p=>{let v=()=>!p.isDestroyed()&&document.body.contains(t);Y.debounce(t,i,c,m,d,h,v,()=>{a()})})}silenceEvents(t){this.silenced=!0,t(),this.silenced=!1}on(t,i){window.addEventListener(t,s=>{this.silenced||i(s)})}},rc=class{constructor(){this.transitions=new Set,this.pendingOps=[]}reset(){this.transitions.forEach(t=>{clearTimeout(t),this.transitions.delete(t)}),this.flushPendingOps()}after(t){this.size()===0?t():this.pushPendingOp(t)}addTransition(t,i,s){i();let a=setTimeout(()=>{this.transitions.delete(a),s(),this.flushPendingOps()},t);this.transitions.add(a)}pushPendingOp(t){this.pendingOps.push(t)}size(){return this.transitions.size}flushPendingOps(){if(this.size()>0)return;let t=this.pendingOps.shift();t&&(t(),this.flushPendingOps())}};var Br={};ua(Br,{ConfirmGeoFenceDeletion:()=>Ic,Dropdown:()=>Oc,LocalTime:()=>Rc,LocalTimeRange:()=>zc,Map:()=>Hc,Modal:()=>qc,NumericInput:()=>Zc,SimpleMap:()=>Uc,TriggerChange:()=>Gc});var nt=rr(Cr());var es="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=";var ts="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACkAAAApCAQAAAACach9AAACMUlEQVR4Ae3ShY7jQBAE0Aoz/f9/HTMzhg1zrdKUrJbdx+Kd2nD8VNudfsL/Th///dyQN2TH6f3y/BGpC379rV+S+qqetBOxImNQXL8JCAr2V4iMQXHGNJxeCfZXhSRBcQMfvkOWUdtfzlLgAENmZDcmo2TVmt8OSM2eXxBp3DjHSMFutqS7SbmemzBiR+xpKCNUIRkdkkYxhAkyGoBvyQFEJEefwSmmvBfJuJ6aKqKWnAkvGZOaZXTUgFqYULWNSHUckZuR1HIIimUExutRxwzOLROIG4vKmCKQt364mIlhSyzAf1m9lHZHJZrlAOMMztRRiKimp/rpdJDc9Awry5xTZCte7FHtuS8wJgeYGrex28xNTd086Dik7vUMscQOa8y4DoGtCCSkAKlNwpgNtphjrC6MIHUkR6YWxxs6Sc5xqn222mmCRFzIt8lEdKx+ikCtg91qS2WpwVfBelJCiQJwvzixfI9cxZQWgiSJelKnwBElKYtDOb2MFbhmUigbReQBV0Cg4+qMXSxXSyGUn4UbF8l+7qdSGnTC0XLCmahIgUHLhLOhpVCtw4CzYXvLQWQbJNmxoCsOKAxSgBJno75avolkRw8iIAFcsdc02e9iyCd8tHwmeSSoKTowIgvscSGZUOA7PuCN5b2BX9mQM7S0wYhMNU74zgsPBj3HU7wguAfnxxjFQGBE6pwN+GjME9zHY7zGp8wVxMShYX9NXvEWD3HbwJf4giO4CFIQxXScH1/TM+04kkBiAAAAAElFTkSuQmCC";var Ar=navigator.languages?navigator.languages[0]:navigator.language||navigator.userLanguage;function Er(t,i){let s=new Date(t);return s instanceof Date&&!isNaN(s.valueOf())?s.toLocaleTimeString(Ar,i):"\u2013"}function Tc(t,i){let s=new Date(t);return s instanceof Date&&!isNaN(s.valueOf())?s.toLocaleDateString(Ar,i):"\u2013"}var Oc={mounted(){let t=this.el;t.querySelector("button").addEventListener("click",i=>{i.stopPropagation(),t.classList.toggle("is-active")}),document.addEventListener("click",()=>{t.classList.remove("is-active")})}},Rc={mounted(){this.el.innerText=Er(this.el.dataset.date)},updated(){this.el.innerText=Er(this.el.dataset.date)}},zc={exec(){let t=Tc(this.el.dataset.startDate,{year:"numeric",month:"short",day:"numeric"}),i=[this.el.dataset.startDate,this.el.dataset.endDate].map(s=>Er(s,{hour:"2-digit",minute:"2-digit",hour12:!1})).join(" \u2013 ");this.el.innerText=`${t}, ${i}`},mounted(){this.exec()},updated(){this.exec()}},Ic={mounted(){let{id:t,msg:i}=this.el.dataset;this.el.addEventListener("click",()=>{window.confirm(i)&&this.pushEvent("delete",{id:t})})}},jc=new nt.Icon({iconUrl:es,shadowUrl:ts,iconAnchor:[12,40],popupAnchor:[0,-25]}),Nc=nt.CircleMarker.extend({initialize(t,i,s){this._heading=i,nt.CircleMarker.prototype.initialize.call(this,t,Ct({fillOpacity:1,radius:5},s))},setHeading(t){this._heading=t,this.redraw()},_updatePath(){let{x:t,y:i}=this._point;if(this._heading==="")return nt.CircleMarker.prototype._updatePath.call(this);this.getElement().setAttributeNS(null,"transform",`translate(${t},${i}) rotate(${this._heading})`);let s=this._empty()?"":"M0,3 L-4,5 L0,-5 L4,5 z}";this._renderer._setPath(this,s)}});function ds(t){let i=new nt.Map(t.elId!=null?`map_${t.elId}`:"map",t),s=new nt.TileLayer("https://tile.openstreetmap.org/{z}/{x}/{y}.png",{maxZoom:19});if(t.enableHybridLayer){let a=new nt.TileLayer("http://{s}.google.com/vt/lyrs=s,h&x={x}&y={y}&z={z}",{maxZoom:20,subdomains:["mt0","mt1","mt2","mt3"]});new nt.Control.Layers({OSM:s,Hybrid:a}).addTo(i)}return i.addLayer(s),i}var Uc={mounted(){let t=document.querySelector(`#position_${this.el.dataset.id}`),i=ds({elId:this.el.dataset.id,zoomControl:!!this.el.dataset.zoom,boxZoom:!1,doubleClickZoom:!1,keyboard:!1,scrollWheelZoom:!1,tap:!1,dragging:!1,touchZoom:!1}),s=this.el.dataset.marker==="arrow",[a,c,d]=t.value.split(","),m=s?new Nc([a,c],d):new nt.Marker([a,c],{icon:jc});if(i.setView([a,c],17),m.addTo(i),i.removeControl(i.zoomControl),i.on("mouseover",function(h){i.addControl(i.zoomControl)}),i.on("mouseout",function(h){i.removeControl(i.zoomControl)}),s){let h=()=>{let[p,v,y]=t.value.split(",");m.setHeading(y),m.setLatLng([p,v]),i.setView([p,v],i.getZoom())};t.addEventListener("change",h)}}},Gc={updated(){this.el.dispatchEvent(new CustomEvent("change"))}};Promise.resolve().then(()=>ls());Promise.resolve().then(()=>rr(cs()));var Hc={mounted(){let t=v=>document.querySelector(`input[name='geo_fence[${v}]']`),i=t("radius"),s=t("latitude"),a=t("longitude"),c=new nt.LatLng(s.value,a.value),d={position:"topleft",cutPolygon:!1,drawCircle:!1,drawCircleMarker:!1,drawMarker:!1,drawPolygon:!1,drawPolyline:!1,drawRectangle:!1,removalMode:!1},m={allowSelfIntersection:!1,preventMarkerRemoval:!0},h=ds({enableHybridLayer:!0});h.setView(c,17,{animate:!1}),h.pm.setLang(Ar),h.pm.addControls(d),h.pm.enableGlobalEditMode(m);let p=new nt.Circle(c,{radius:i.value}).addTo(h).on("pm:edit",v=>{let{lat:y,lng:R}=v.target.getLatLng(),G=Math.round(v.target.getRadius());i.value=G,s.value=y,a.value=R;let $=h.getBounds(),N=p.getBounds(),O=$.contains(N)?$:N;h.fitBounds(O)});new nt.Control.geocoder({defaultMarkGeocode:!1}).on("markgeocode",v=>{let{bbox:y,center:R}=v.geocode,G=L.polygon([y.getSouthEast(),y.getNorthEast(),y.getNorthWest(),y.getSouthWest()]);p.setLatLng(R);let $=G.getBounds(),N=p.getBounds(),O=N.contains($)?N:$;h.fitBounds(O),h.pm.enableGlobalEditMode();let{lat:J,lng:I}=R;s.value=J,a.value=I}).addTo(h),h.fitBounds(p.getBounds(),{animate:!1})}},qc={_freeze(){document.documentElement.classList.add("is-clipped")},_unfreeze(){document.documentElement.classList.remove("is-clipped")},mounted(){},updated(){this.el.classList.contains("is-active")?this._freeze():this._unfreeze()},destroyed(){this._unfreeze()}},Zc={mounted(){this.el.onkeypress=t=>{let i=t.which?t.which:t.keyCode;return!(i>31&&(i<48||i>57))}}};document.querySelector(".navbar-burger").addEventListener("click",function(){document.getElementById(this.dataset.target).classList.toggle("is-active"),this.classList.toggle("is-active")});for(let t of document.querySelectorAll(".navbar-item.has-dropdown"))t.addEventListener("click",function(){document.querySelector(".navbar-menu.is-active")&&this.classList.toggle("active")});var Dr=document.querySelector("a[data-uid='1EZnXszMk']"),fs=Intl&&Intl.DateTimeFormat().resolvedOptions().timeZone;Dr&&fs&&(Dr.href=`${Dr.href}?var-timezone=${decodeURIComponent(fs)}`);document.addEventListener("click",()=>0);function ms(){let t=window.innerHeight*.01;document.documentElement.style.setProperty("--vh",`${t}px`)}window.addEventListener("resize",ms);ms();var Vc=document.querySelector("meta[name='csrf-token']").getAttribute("content"),$c=new Ya(window.LIVE_PATH,ba,{hooks:Br,params:{_csrf_token:Vc,baseUrl:window.location.origin,referrer:document.referrer,tz:Intl&&Intl.DateTimeFormat().resolvedOptions().timeZone}});$c.connect();})(); /*! Bundled license information: leaflet/dist/leaflet-src.js: (* @preserve * Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade *) leaflet-control-geocoder/dist/Control.Geocoder.modern.js: (* @preserve * Leaflet Control Geocoder * https://github.com/perliedman/leaflet-control-geocoder * * Copyright (c) 2012 sa3m (https://github.com/sa3m) * Copyright (c) 2018 Per Liedman * All rights reserved. *) */