UNPKG

@ulb-darmstadt/shacl-form

Version:
2 lines 220 kB
/*! For license information please see leaflet.js.LICENSE.txt */ var t={7055:(t,e,i)=>{var n,o,r;((s,a)=>{o=[i(3481)],void 0===(r="function"==typeof(n=s)?n.apply(e,o):n)||(t.exports=r),void 0!==a&&a.L&&s(a.L)})((t=>{t.Editable=t.Evented.extend({statics:{FORWARD:1,BACKWARD:-1},options:{zIndex:1e3,polygonClass:t.Polygon,polylineClass:t.Polyline,markerClass:t.Marker,circleMarkerClass:t.CircleMarker,rectangleClass:t.Rectangle,circleClass:t.Circle,drawingCSSClass:"leaflet-editable-drawing",drawingCursor:"crosshair",editLayer:void 0,featuresLayer:void 0,polylineEditorClass:void 0,polygonEditorClass:void 0,markerEditorClass:void 0,circleMarkerEditorClass:void 0,rectangleEditorClass:void 0,circleEditorClass:void 0,lineGuideOptions:{},skipMiddleMarkers:!1},initialize:function(e,i){t.setOptions(this,i),this._lastZIndex=this.options.zIndex,this.map=e,this.editLayer=this.createEditLayer(),this.featuresLayer=this.createFeaturesLayer(),this.forwardLineGuide=this.createLineGuide(),this.backwardLineGuide=this.createLineGuide()},fireAndForward:function(t,e){(e=e||{}).editTools=this,this.fire(t,e),this.map.fire(t,e)},createLineGuide:function(){const e=t.extend({dashArray:"5,10",weight:1,interactive:!1},this.options.lineGuideOptions);return t.polyline([],e)},createVertexIcon:e=>t.Browser.mobile&&t.Browser.touch?new t.Editable.TouchVertexIcon(e):new t.Editable.VertexIcon(e),createEditLayer:function(){return this.options.editLayer||(new t.LayerGroup).addTo(this.map)},createFeaturesLayer:function(){return this.options.featuresLayer||(new t.LayerGroup).addTo(this.map)},moveForwardLineGuide:function(t){this.forwardLineGuide._latlngs.length&&(this.forwardLineGuide._latlngs[1]=t,this.forwardLineGuide._bounds.extend(t),this.forwardLineGuide.redraw())},moveBackwardLineGuide:function(t){this.backwardLineGuide._latlngs.length&&(this.backwardLineGuide._latlngs[1]=t,this.backwardLineGuide._bounds.extend(t),this.backwardLineGuide.redraw())},anchorForwardLineGuide:function(t){this.forwardLineGuide._latlngs[0]=t,this.forwardLineGuide._bounds.extend(t),this.forwardLineGuide.redraw()},anchorBackwardLineGuide:function(t){this.backwardLineGuide._latlngs[0]=t,this.backwardLineGuide._bounds.extend(t),this.backwardLineGuide.redraw()},attachForwardLineGuide:function(){this.editLayer.addLayer(this.forwardLineGuide)},attachBackwardLineGuide:function(){this.editLayer.addLayer(this.backwardLineGuide)},detachForwardLineGuide:function(){this.forwardLineGuide.setLatLngs([]),this.editLayer.removeLayer(this.forwardLineGuide)},detachBackwardLineGuide:function(){this.backwardLineGuide.setLatLngs([]),this.editLayer.removeLayer(this.backwardLineGuide)},blockEvents:function(){this._oldTargets||(this._oldTargets=this.map._targets,this.map._targets={})},unblockEvents:function(){this._oldTargets&&(this.map._targets=t.extend(this.map._targets,this._oldTargets),delete this._oldTargets)},registerForDrawing:function(e){this._drawingEditor&&this.unregisterForDrawing(this._drawingEditor),this.blockEvents(),e.reset(),this._drawingEditor=e,this.map.on("mousemove touchmove",e.onDrawingMouseMove,e),this.map.on("mousedown",this.onMousedown,this),this.map.on("mouseup",this.onMouseup,this),t.DomUtil.addClass(this.map._container,this.options.drawingCSSClass),this.defaultMapCursor=this.map._container.style.cursor,this.map._container.style.cursor=this.options.drawingCursor},unregisterForDrawing:function(e){this.unblockEvents(),t.DomUtil.removeClass(this.map._container,this.options.drawingCSSClass),this.map._container.style.cursor=this.defaultMapCursor,(e=e||this._drawingEditor)&&(this.map.off("mousemove touchmove",e.onDrawingMouseMove,e),this.map.off("mousedown",this.onMousedown,this),this.map.off("mouseup",this.onMouseup,this),e===this._drawingEditor&&(delete this._drawingEditor,e._drawing&&e.cancelDrawing()))},onMousedown:function(t){1==t.originalEvent.which&&(this._mouseDown=t,this._drawingEditor.onDrawingMouseDown(t))},onMouseup:function(e){if(this._mouseDown){const i=this._drawingEditor,n=this._mouseDown;if(this._mouseDown=null,i.onDrawingMouseUp(e),this._drawingEditor!==i)return;const o=t.point(n.originalEvent.clientX,n.originalEvent.clientY),r=t.point(e.originalEvent.clientX,e.originalEvent.clientY).distanceTo(o);Math.abs(r)<9*(window.devicePixelRatio||1)&&this._drawingEditor.onDrawingClick(e)}},drawing:function(){return this._drawingEditor?.drawing()},stopDrawing:function(){this.unregisterForDrawing()},commitDrawing:function(t){this._drawingEditor&&this._drawingEditor.commitDrawing(t)},connectCreatedToMap:function(t){return this.featuresLayer.addLayer(t)},startPolyline:function(t,e){const i=this.createPolyline([],e);return i.enableEdit(this.map).newShape(t),i},startPolygon:function(t,e){const i=this.createPolygon([],e);return i.enableEdit(this.map).newShape(t),i},startMarker:function(t,e){t=t||this.map.getCenter().clone();const i=this.createMarker(t,e);return i.enableEdit(this.map).startDrawing(),i},startCircleMarker:function(t,e){t=t||this.map.getCenter().clone();const i=this.createCircleMarker(t,e);return i.enableEdit(this.map).startDrawing(),i},startRectangle:function(e,i){const n=e||t.latLng([0,0]),o=new t.LatLngBounds(n,n),r=this.createRectangle(o,i);return r.enableEdit(this.map).startDrawing(),r},startCircle:function(t,e){t=t||this.map.getCenter().clone();const i=this.createCircle(t,e);return i.enableEdit(this.map).startDrawing(),i},startHole:(t,e)=>{t.newHole(e)},createLayer:function(e,i,n){const o=new e(i,n=t.Util.extend({editOptions:{editTools:this}},n));return this.fireAndForward("editable:created",{layer:o}),o},createPolyline:function(t,e){return this.createLayer(e?.polylineClass||this.options.polylineClass,t,e)},createPolygon:function(t,e){return this.createLayer(e?.polygonClass||this.options.polygonClass,t,e)},createMarker:function(t,e){return this.createLayer(e?.markerClass||this.options.markerClass,t,e)},createCircleMarker:function(t,e){return this.createLayer(e?.circleMarkerClass||this.options.circleMarkerClass,t,e)},createRectangle:function(t,e){return this.createLayer(e?.rectangleClass||this.options.rectangleClass,t,e)},createCircle:function(t,e){return this.createLayer(e?.circleClass||this.options.circleClass,t,e)}}),t.extend(t.Editable,{makeCancellable:t=>{t.cancel=()=>{t._cancelled=!0}}}),t.Map.mergeOptions({editToolsClass:t.Editable,editable:!1,editOptions:{}}),t.Map.addInitHook((function(){this.whenReady((function(){this.options.editable&&(this.editTools=new this.options.editToolsClass(this,this.options.editOptions))}))})),t.Editable.VertexIcon=t.DivIcon.extend({options:{iconSize:new t.Point(8,8)}}),t.Editable.TouchVertexIcon=t.Editable.VertexIcon.extend({options:{iconSize:new t.Point(20,20)}}),t.Editable.VertexMarker=t.Marker.extend({options:{draggable:!0,className:"leaflet-div-icon leaflet-vertex-icon"},initialize:function(e,i,n,o){this.latlng=e,this.latlngs=i,this.editor=n,t.Marker.prototype.initialize.call(this,e,o),this.options.icon=this.editor.tools.createVertexIcon({className:this.options.className}),this.latlng.__vertex=this,this.connect(),this.setZIndexOffset(n.tools._lastZIndex+1)},connect:function(){this.editor.editLayer.addLayer(this)},onAdd:function(e){t.Marker.prototype.onAdd.call(this,e),this.on("drag",this.onDrag),this.on("dragstart",this.onDragStart),this.on("dragend",this.onDragEnd),this.on("mouseup",this.onMouseup),this.on("click",this.onClick),this.on("contextmenu",this.onContextMenu),this.on("mousedown touchstart",this.onMouseDown),this.on("mouseover",this.onMouseOver),this.on("mouseout",this.onMouseOut),this.addMiddleMarkers()},onRemove:function(e){this.middleMarker&&this.middleMarker.delete(),delete this.latlng.__vertex,this.off("drag",this.onDrag),this.off("dragstart",this.onDragStart),this.off("dragend",this.onDragEnd),this.off("mouseup",this.onMouseup),this.off("click",this.onClick),this.off("contextmenu",this.onContextMenu),this.off("mousedown touchstart",this.onMouseDown),this.off("mouseover",this.onMouseOver),this.off("mouseout",this.onMouseOut),t.Marker.prototype.onRemove.call(this,e)},onDrag:function(e){e.vertex=this,this.editor.onVertexMarkerDrag(e);const i=t.DomUtil.getPosition(this._icon),n=this._map.layerPointToLatLng(i);this.latlng.update(n),this._latlng=this.latlng,this.editor.refresh(),this.middleMarker&&this.middleMarker.updateLatLng();const o=this.getNext();o?.middleMarker&&o.middleMarker.updateLatLng()},onDragStart:function(t){t.vertex=this,this.editor.onVertexMarkerDragStart(t)},onDragEnd:function(t){t.vertex=this,this.editor.onVertexMarkerDragEnd(t)},onClick:function(t){t.vertex=this,this.editor.onVertexMarkerClick(t)},onMouseup:function(e){t.DomEvent.stop(e),e.vertex=this,this.editor.map.fire("mouseup",e)},onContextMenu:function(t){t.vertex=this,this.editor.onVertexMarkerContextMenu(t)},onMouseDown:function(t){t.vertex=this,this.editor.onVertexMarkerMouseDown(t)},onMouseOver:function(t){t.vertex=this,this.editor.onVertexMarkerMouseOver(t)},onMouseOut:function(t){t.vertex=this,this.editor.onVertexMarkerMouseOut(t)},delete:function(){const t=this.getNext();this.latlngs.splice(this.getIndex(),1),this.editor.editLayer.removeLayer(this),this.editor.onVertexDeleted({latlng:this.latlng,vertex:this}),this.latlngs.length||this.editor.deleteShape(this.latlngs),t&&t.resetMiddleMarker(),this.editor.refresh()},getIndex:function(){return this.latlngs.indexOf(this.latlng)},getLastIndex:function(){return this.latlngs.length-1},getPrevious:function(){if(this.latlngs.length<2)return;const t=this.getIndex();let e=t-1;0===t&&this.editor.CLOSED&&(e=this.getLastIndex());const i=this.latlngs[e];return i?i.__vertex:void 0},getNext:function(){if(this.latlngs.length<2)return;const t=this.getIndex();let e=t+1;t===this.getLastIndex()&&this.editor.CLOSED&&(e=0);const i=this.latlngs[e];return i?i.__vertex:void 0},addMiddleMarker:function(t){this.editor.hasMiddleMarkers()&&(t=t||this.getPrevious())&&!this.middleMarker&&(this.middleMarker=this.editor.addMiddleMarker(t,this,this.latlngs,this.editor))},addMiddleMarkers:function(){if(!this.editor.hasMiddleMarkers())return;const t=this.getPrevious();t&&this.addMiddleMarker(t);const e=this.getNext();e&&e.resetMiddleMarker()},resetMiddleMarker:function(){this.middleMarker&&this.middleMarker.delete(),this.addMiddleMarker()},split:function(){this.editor.splitShape&&this.editor.splitShape(this.latlngs,this.getIndex())},continue:function(){if(!this.editor.continueBackward)return;const t=this.getIndex();0===t?this.editor.continueBackward(this.latlngs):t===this.getLastIndex()&&this.editor.continueForward(this.latlngs)}}),t.Editable.mergeOptions({vertexMarkerClass:t.Editable.VertexMarker}),t.Editable.MiddleMarker=t.Marker.extend({options:{opacity:.5,className:"leaflet-div-icon leaflet-middle-icon",draggable:!0},initialize:function(e,i,n,o,r){this.left=e,this.right=i,this.editor=o,this.latlngs=n,t.Marker.prototype.initialize.call(this,this.computeLatLng(),r),this._opacity=this.options.opacity,this.options.icon=this.editor.tools.createVertexIcon({className:this.options.className}),this.editor.editLayer.addLayer(this),this.setVisibility()},setVisibility:function(){const e=this._map.latLngToContainerPoint(this.left.latlng),i=this._map.latLngToContainerPoint(this.right.latlng),n=t.point(this.options.icon.options.iconSize);e.distanceTo(i)<3*n.x?this.hide():this.show()},show:function(){this.setOpacity(this._opacity)},hide:function(){this.setOpacity(0)},updateLatLng:function(){this.setLatLng(this.computeLatLng()),this.setVisibility()},computeLatLng:function(){const t=this.editor.map.latLngToContainerPoint(this.left.latlng),e=this.editor.map.latLngToContainerPoint(this.right.latlng),i=(t.y+e.y)/2,n=(t.x+e.x)/2;return this.editor.map.containerPointToLatLng([n,i])},onAdd:function(e){t.Marker.prototype.onAdd.call(this,e),t.DomEvent.on(this._icon,"mousedown touchstart",this.onMouseDown,this),e.on("zoomend",this.setVisibility,this)},onRemove:function(e){delete this.right.middleMarker,t.DomEvent.off(this._icon,"mousedown touchstart",this.onMouseDown,this),e.off("zoomend",this.setVisibility,this),t.Marker.prototype.onRemove.call(this,e)},onMouseDown:function(e){const i=t.DomUtil.getPosition(this._icon);if(e={originalEvent:e,latlng:this.editor.map.layerPointToLatLng(i)},0===this.options.opacity)return;if(t.Editable.makeCancellable(e),this.editor.onMiddleMarkerMouseDown(e),e._cancelled)return;this.latlngs.splice(this.index(),0,e.latlng),this.editor.refresh();const n=this._icon,o=this.editor.addVertexMarker(e.latlng,this.latlngs);this.editor.onNewVertex(o);const r=o._icon.parentNode;r.removeChild(o._icon),o._icon=n,r.appendChild(o._icon),o._initIcon(),o._initInteraction(),o.setOpacity(1),t.Draggable._dragging=!1,o.dragging._draggable._onDown(e.originalEvent),this.delete()},delete:function(){this.editor.editLayer.removeLayer(this)},index:function(){return this.latlngs.indexOf(this.right.latlng)}}),t.Editable.mergeOptions({middleMarkerClass:t.Editable.MiddleMarker}),t.Editable.BaseEditor=t.Handler.extend({initialize:function(e,i,n){t.setOptions(this,n),this.map=e,this.feature=i,this.feature.editor=this,this.editLayer=new t.LayerGroup,this.tools=this.options.editTools||e.editTools},addHooks:function(){this.isConnected()?this.onFeatureAdd():this.feature.once("add",this.onFeatureAdd,this),this.onEnable(),this.feature.on(this._getEvents(),this)},removeHooks:function(){this.feature.off(this._getEvents(),this),this.feature.dragging&&this.feature.dragging.disable(),this.editLayer.clearLayers(),this.tools.editLayer.removeLayer(this.editLayer),this.onDisable(),this._drawing&&this.cancelDrawing()},drawing:function(){return!!this._drawing},reset:()=>{},onFeatureAdd:function(){this.tools.editLayer.addLayer(this.editLayer),this.feature.dragging&&this.feature.dragging.enable()},hasMiddleMarkers:function(){return!this.options.skipMiddleMarkers&&!this.tools.options.skipMiddleMarkers},fireAndForward:function(t,e){(e=e||{}).layer=this.feature,this.feature.fire(t,e),this.tools.fireAndForward(t,e)},onEnable:function(){this.fireAndForward("editable:enable")},onDisable:function(){this.fireAndForward("editable:disable")},onEditing:function(){this.fireAndForward("editable:editing")},onEdited:function(){this.fireAndForward("editable:edited")},onStartDrawing:function(){this.fireAndForward("editable:drawing:start")},onEndDrawing:function(){this.fireAndForward("editable:drawing:end")},onCancelDrawing:function(){this.fireAndForward("editable:drawing:cancel")},onCommitDrawing:function(t){this.fireAndForward("editable:drawing:commit",t),this.onEdited()},onDrawingMouseDown:function(t){this.fireAndForward("editable:drawing:mousedown",t)},onDrawingMouseUp:function(t){this.fireAndForward("editable:drawing:mouseup",t)},startDrawing:function(){this._drawing||(this._drawing=t.Editable.FORWARD),this.tools.registerForDrawing(this),this.onStartDrawing()},commitDrawing:function(t){this.onCommitDrawing(t),this.endDrawing()},cancelDrawing:function(){t.Draggable._dragging=!1,this.onCancelDrawing(),this.endDrawing()},endDrawing:function(){this._drawing=!1,this.tools.unregisterForDrawing(this),this.onEndDrawing()},onDrawingClick:function(e){this.drawing()&&(t.Editable.makeCancellable(e),this.fireAndForward("editable:drawing:click",e),e._cancelled||(this.isConnected()||this.connect(e),this.processDrawingClick(e)))},isConnected:function(){return this.map.hasLayer(this.feature)},connect:function(){this.tools.connectCreatedToMap(this.feature),this.tools.editLayer.addLayer(this.editLayer)},onMove:function(t){this.fireAndForward("editable:drawing:move",t)},onDrawingMouseMove:function(t){this.onMove(t)},_getEvents:function(){return{dragstart:this.onDragStart,drag:this.onDrag,dragend:this.onDragEnd,remove:this.disable}},onDragStart:function(t){this.onEditing(),this.fireAndForward("editable:dragstart",t)},onDrag:function(t){this.onMove(t),this.fireAndForward("editable:drag",t)},onDragEnd:function(t){this.fireAndForward("editable:dragend",t),this.onEdited()}}),t.Editable.MarkerEditor=t.Editable.BaseEditor.extend({onDrawingMouseMove:function(e){t.Editable.BaseEditor.prototype.onDrawingMouseMove.call(this,e),this._drawing&&this.feature.setLatLng(e.latlng)},processDrawingClick:function(t){this.fireAndForward("editable:drawing:clicked",t),this.commitDrawing(t)},connect:function(e){e&&(this.feature._latlng=e.latlng),t.Editable.BaseEditor.prototype.connect.call(this,e)}}),t.Editable.CircleMarkerEditor=t.Editable.BaseEditor.extend({onDrawingMouseMove:function(e){t.Editable.BaseEditor.prototype.onDrawingMouseMove.call(this,e),this._drawing&&this.feature.setLatLng(e.latlng)},processDrawingClick:function(t){this.fireAndForward("editable:drawing:clicked",t),this.commitDrawing(t)},connect:function(e){e&&(this.feature._latlng=e.latlng),t.Editable.BaseEditor.prototype.connect.call(this,e)}}),t.Editable.PathEditor=t.Editable.BaseEditor.extend({CLOSED:!1,MIN_VERTEX:2,addHooks:function(){return t.Editable.BaseEditor.prototype.addHooks.call(this),this.feature&&(this.initVertexMarkers(),this.map.on("moveend",this.onMoveEnd,this)),this},removeHooks:function(){t.Editable.BaseEditor.prototype.removeHooks.call(this),this.feature&&this.map.off("moveend",this.onMoveEnd,this)},onMoveEnd:function(){this.initVertexMarkers()},initVertexMarkers:function(t){if(this.enabled())if(t=t||this.getLatLngs(),h(t))this.addVertexMarkers(t);else for(const e of t)this.initVertexMarkers(e)},getLatLngs:function(){return this.feature.getLatLngs()},reset:function(){this.editLayer.clearLayers(),this.initVertexMarkers()},addVertexMarker:function(t,e){return t.__vertex?(t.__vertex.connect(),t.__vertex):new this.tools.options.vertexMarkerClass(t,e,this)},onNewVertex:function(t){this.fireAndForward("editable:vertex:new",{latlng:t.latlng,vertex:t})},addVertexMarkers:function(t){const e=this.map.getBounds();for(const i of t)e.contains(i)&&this.addVertexMarker(i,t)},refreshVertexMarkers:function(t){t=t||this.getDefaultLatLngs();for(const e of t)e.__vertex.update()},addMiddleMarker:function(t,e,i){return new this.tools.options.middleMarkerClass(t,e,i,this)},onVertexMarkerClick:function(e){if(t.Editable.makeCancellable(e),this.fireAndForward("editable:vertex:click",e),e._cancelled)return;if(this.tools.drawing()&&this.tools._drawingEditor!==this)return;const i=e.vertex.getIndex();let n;e.originalEvent.ctrlKey?this.onVertexMarkerCtrlClick(e):e.originalEvent.altKey?this.onVertexMarkerAltClick(e):e.originalEvent.shiftKey?this.onVertexMarkerShiftClick(e):e.originalEvent.metaKey?this.onVertexMarkerMetaKeyClick(e):i===e.vertex.getLastIndex()&&this._drawing===t.Editable.FORWARD?i>=this.MIN_VERTEX-1&&(n=!0):0===i&&this._drawing===t.Editable.BACKWARD&&this._drawnLatLngs.length>=this.MIN_VERTEX||0===i&&this._drawing===t.Editable.FORWARD&&this._drawnLatLngs.length>=this.MIN_VERTEX&&this.CLOSED?n=!0:this.onVertexRawMarkerClick(e),this.fireAndForward("editable:vertex:clicked",e),n&&this.commitDrawing(e)},onVertexRawMarkerClick:function(t){this.fireAndForward("editable:vertex:rawclick",t),t._cancelled||this.vertexCanBeDeleted(t.vertex)&&t.vertex.delete()},vertexCanBeDeleted:function(t){return t.latlngs.length>this.MIN_VERTEX},onVertexDeleted:function(t){this.fireAndForward("editable:vertex:deleted",t)},onVertexMarkerCtrlClick:function(t){this.fireAndForward("editable:vertex:ctrlclick",t)},onVertexMarkerShiftClick:function(t){this.fireAndForward("editable:vertex:shiftclick",t)},onVertexMarkerMetaKeyClick:function(t){this.fireAndForward("editable:vertex:metakeyclick",t)},onVertexMarkerAltClick:function(t){this.fireAndForward("editable:vertex:altclick",t)},onVertexMarkerContextMenu:function(t){this.fireAndForward("editable:vertex:contextmenu",t)},onVertexMarkerMouseDown:function(t){this.fireAndForward("editable:vertex:mousedown",t)},onVertexMarkerMouseOver:function(t){this.fireAndForward("editable:vertex:mouseover",t)},onVertexMarkerMouseOut:function(t){this.fireAndForward("editable:vertex:mouseout",t)},onMiddleMarkerMouseDown:function(t){this.fireAndForward("editable:middlemarker:mousedown",t)},onVertexMarkerDrag:function(t){this.onMove(t),this.feature._bounds&&this.extendBounds(t),this.fireAndForward("editable:vertex:drag",t)},onVertexMarkerDragStart:function(t){this.fireAndForward("editable:vertex:dragstart",t)},onVertexMarkerDragEnd:function(t){this.fireAndForward("editable:vertex:dragend",t),this.onEdited()},setDrawnLatLngs:function(t){this._drawnLatLngs=t||this.getDefaultLatLngs()},startDrawing:function(){this._drawnLatLngs||this.setDrawnLatLngs(),t.Editable.BaseEditor.prototype.startDrawing.call(this)},startDrawingForward:function(){this.startDrawing()},endDrawing:function(){this.tools.detachForwardLineGuide(),this.tools.detachBackwardLineGuide(),this._drawnLatLngs&&this._drawnLatLngs.length<this.MIN_VERTEX&&this.deleteShape(this._drawnLatLngs),t.Editable.BaseEditor.prototype.endDrawing.call(this),delete this._drawnLatLngs},addLatLng:function(e){this._drawing===t.Editable.FORWARD?this._drawnLatLngs.push(e):this._drawnLatLngs.unshift(e),this.feature._bounds.extend(e);const i=this.addVertexMarker(e,this._drawnLatLngs);this.onNewVertex(i),this.refresh()},newPointForward:function(t){this.addLatLng(t),this.tools.attachForwardLineGuide(),this.tools.anchorForwardLineGuide(t)},newPointBackward:function(t){this.addLatLng(t),this.tools.anchorBackwardLineGuide(t)},push:function(e){if(!e)return console.error("L.Editable.PathEditor.push expect a valid latlng as parameter");this._drawing===t.Editable.FORWARD?this.newPointForward(e):this.newPointBackward(e)},removeLatLng:function(t){t.__vertex.delete(),this.refresh()},pop:function(){if(this._drawnLatLngs.length<=1)return;let e;return e=this._drawing===t.Editable.FORWARD?this._drawnLatLngs[this._drawnLatLngs.length-1]:this._drawnLatLngs[0],this.removeLatLng(e),this._drawing===t.Editable.FORWARD?this.tools.anchorForwardLineGuide(this._drawnLatLngs[this._drawnLatLngs.length-1]):this.tools.anchorForwardLineGuide(this._drawnLatLngs[0]),e},processDrawingClick:function(e){e.vertex&&e.vertex.editor===this||(this._drawing===t.Editable.FORWARD?this.newPointForward(e.latlng):this.newPointBackward(e.latlng),this.fireAndForward("editable:drawing:clicked",e))},onDrawingMouseMove:function(e){t.Editable.BaseEditor.prototype.onDrawingMouseMove.call(this,e),this._drawing&&(this.tools.moveForwardLineGuide(e.latlng),this.tools.moveBackwardLineGuide(e.latlng))},refresh:function(){this.feature.redraw(),this.onEditing()},newShape:function(t){const e=this.addNewEmptyShape();e&&(this.setDrawnLatLngs(e[0]||e),this.startDrawingForward(),this.fireAndForward("editable:shape:new",{shape:e}),t&&this.newPointForward(t))},deleteShape:function(e,i){const n={shape:e};if(t.Editable.makeCancellable(n),this.fireAndForward("editable:shape:delete",n),!n._cancelled)return e=this._deleteShape(e,i),this.ensureNotFlat&&this.ensureNotFlat(),this.feature.setLatLngs(this.getLatLngs()),this.refresh(),this.reset(),this.fireAndForward("editable:shape:deleted",{shape:e}),this.onEdited(),e},_deleteShape:function(t,e){if(!(e=e||this.getLatLngs()).length)return;const i=(t,e)=>(t.splice(t.indexOf(e),1),t.length||this._deleteShape(t),e);if(e===t)return(t=>t.splice(0,Number.MAX_VALUE))(e);for(const n of e){if(n===t)return i(e,t);if(-1!==n.indexOf(t))return i(n,t)}},deleteShapeAt:function(t){const e=this.feature.shapeAt(t);if(e)return this.deleteShape(e)},appendShape:function(t){this.insertShape(t)},prependShape:function(t){this.insertShape(t,0)},insertShape:function(t,e){this.ensureMulti(),t=this.formatShape(t),void 0===e&&(e=this.feature._latlngs.length),this.feature._latlngs.splice(e,0,t),this.feature.redraw(),this._enabled&&this.reset()},extendBounds:function(t){this.feature._bounds.extend(t.vertex.latlng)},onDragStart:function(e){this.editLayer.clearLayers(),t.Editable.BaseEditor.prototype.onDragStart.call(this,e)},onDragEnd:function(e){this.initVertexMarkers(),t.Editable.BaseEditor.prototype.onDragEnd.call(this,e)}}),t.Editable.PolylineEditor=t.Editable.PathEditor.extend({startDrawingBackward:function(){this._drawing=t.Editable.BACKWARD,this.startDrawing()},continueBackward:function(t){this.drawing()||(t=t||this.getDefaultLatLngs(),this.setDrawnLatLngs(t),t.length>0&&(this.tools.attachBackwardLineGuide(),this.tools.anchorBackwardLineGuide(t[0])),this.startDrawingBackward())},continueForward:function(t){this.drawing()||(t=t||this.getDefaultLatLngs(),this.setDrawnLatLngs(t),t.length>0&&(this.tools.attachForwardLineGuide(),this.tools.anchorForwardLineGuide(t[t.length-1])),this.startDrawingForward())},getDefaultLatLngs:function(e){return!(e=e||this.feature._latlngs).length||e[0]instanceof t.LatLng?e:this.getDefaultLatLngs(e[0])},ensureMulti:function(){this.feature._latlngs.length&&h(this.feature._latlngs)&&(this.feature._latlngs=[this.feature._latlngs])},addNewEmptyShape:function(){if(this.feature._latlngs.length){const t=[];return this.appendShape(t),t}return this.feature._latlngs},formatShape:function(t){return h(t)?t:t[0]?this.formatShape(t[0]):void 0},splitShape:function(e,i){if(!i||i>=e.length-1)return;this.ensureMulti();const n=this.feature._latlngs.indexOf(e);if(-1===n)return;const o=e.slice(0,i+1),r=e.slice(i);r[0]=t.latLng(r[0].lat,r[0].lng,r[0].alt),this.feature._latlngs.splice(n,1,o,r),this.refresh(),this.reset(),this.onEdited()}}),t.Editable.PolygonEditor=t.Editable.PathEditor.extend({CLOSED:!0,MIN_VERTEX:3,newPointForward:function(e){t.Editable.PathEditor.prototype.newPointForward.call(this,e),this.tools.backwardLineGuide._latlngs.length||this.tools.anchorBackwardLineGuide(e),2===this._drawnLatLngs.length&&this.tools.attachBackwardLineGuide()},addNewEmptyHole:function(t){this.ensureNotFlat();const e=this.feature.shapeAt(t);if(!e)return;const i=[];return e.push(i),i},newHole:function(t){const e=this.addNewEmptyHole(t);e&&(this.setDrawnLatLngs(e),this.startDrawingForward(),t&&this.newPointForward(t))},addNewEmptyShape:function(){if(this.feature._latlngs.length&&this.feature._latlngs[0].length){const t=[];return this.appendShape(t),t}return this.feature._latlngs},ensureMulti:function(){this.feature._latlngs.length&&h(this.feature._latlngs[0])&&(this.feature._latlngs=[this.feature._latlngs])},ensureNotFlat:function(){this.feature._latlngs.length&&!h(this.feature._latlngs)||(this.feature._latlngs=[this.feature._latlngs])},vertexCanBeDeleted:function(e){const i=this.feature.parentShape(e.latlngs);return t.Util.indexOf(i,e.latlngs)>0||t.Editable.PathEditor.prototype.vertexCanBeDeleted.call(this,e)},getDefaultLatLngs:function(){return this.feature._latlngs.length||this.feature._latlngs.push([]),this.feature._latlngs[0]},formatShape:t=>!h(t)||t[0]&&0===t[0].length?t:[t]}),t.Editable.RectangleEditor=t.Editable.PathEditor.extend({CLOSED:!0,MIN_VERTEX:4,options:{skipMiddleMarkers:!0},extendBounds:function(e){const i=e.vertex.getIndex(),n=e.vertex.getNext(),o=e.vertex.getPrevious(),r=(i+2)%4,s=e.vertex.latlngs[r],a=new t.LatLngBounds(e.latlng,s);o.latlng.update([e.latlng.lat,s.lng]),n.latlng.update([s.lat,e.latlng.lng]),this.updateBounds(a),this.refreshVertexMarkers()},onDrawingMouseDown:function(e){t.Editable.PathEditor.prototype.onDrawingMouseDown.call(this,e),this.connect();const i=this.getDefaultLatLngs();3===i.length&&i.push(e.latlng);const n=new t.LatLngBounds(e.latlng,e.latlng);this.updateBounds(n),this.updateLatLngs(n),this.refresh(),this.reset(),e.originalEvent._simulated=!1,this.map.dragging._draggable._onUp(e.originalEvent),i[3].__vertex.dragging._draggable._onDown(e.originalEvent)},onDrawingMouseUp:function(e){this.commitDrawing(e),e.originalEvent._simulated=!1,t.Editable.PathEditor.prototype.onDrawingMouseUp.call(this,e)},onDrawingMouseMove:function(e){e.originalEvent._simulated=!1,t.Editable.PathEditor.prototype.onDrawingMouseMove.call(this,e)},getDefaultLatLngs:function(t){return t||this.feature._latlngs[0]},updateBounds:function(t){this.feature._bounds=t},updateLatLngs:function(t){const e=this.getDefaultLatLngs(),i=this.feature._boundsToLatLngs(t);for(let t=0;t<e.length;t++)e[t].update(i[t])}}),t.Editable.CircleEditor=t.Editable.PathEditor.extend({MIN_VERTEX:2,options:{skipMiddleMarkers:!0},initialize:function(e,i,n){t.Editable.PathEditor.prototype.initialize.call(this,e,i,n),this._resizeLatLng=this.computeResizeLatLng()},computeResizeLatLng:function(){const t=(this.feature._radius||this.feature._mRadius)*Math.cos(Math.PI/4),e=this.map.project(this.feature._latlng);return this.map.unproject([e.x+t,e.y-t])},updateResizeLatLng:function(){this._resizeLatLng.update(this.computeResizeLatLng()),this._resizeLatLng.__vertex.update()},getLatLngs:function(){return[this.feature._latlng,this._resizeLatLng]},getDefaultLatLngs:function(){return this.getLatLngs()},onVertexMarkerDrag:function(e){1===e.vertex.getIndex()?this.resize(e):this.updateResizeLatLng(e),t.Editable.PathEditor.prototype.onVertexMarkerDrag.call(this,e)},resize:function(t){let e;e=this.map.options.crs?this.map.options.crs.distance(this.feature._latlng,t.latlng):this.feature._latlng.distanceTo(t.latlng),this.feature.setRadius(e)},onDrawingMouseDown:function(e){t.Editable.PathEditor.prototype.onDrawingMouseDown.call(this,e),this._resizeLatLng.update(e.latlng),this.feature._latlng.update(e.latlng),this.connect(),e.originalEvent._simulated=!1,this.map.dragging._draggable._onUp(e.originalEvent),this._resizeLatLng.__vertex.dragging._draggable._onDown(e.originalEvent)},onDrawingMouseUp:function(e){this.commitDrawing(e),e.originalEvent._simulated=!1,t.Editable.PathEditor.prototype.onDrawingMouseUp.call(this,e)},onDrawingMouseMove:function(e){e.originalEvent._simulated=!1,t.Editable.PathEditor.prototype.onDrawingMouseMove.call(this,e)},onDrag:function(e){t.Editable.PathEditor.prototype.onDrag.call(this,e),this.feature.dragging.updateLatLng(this._resizeLatLng)}});const e={createEditor:function(t){t=t||this._map;const e=this.options.editOptions?.editTools||t.editTools;if(!e)throw Error("Unable to detect Editable instance.");return new(this.options.editorClass||this.getEditorClass(e))(t,this,this.options.editOptions)},enableEdit:function(t){return this.editor||this.createEditor(t),this.editor.enable(),this.editor},editEnabled:function(){return this.editor?.enabled()},disableEdit:function(){this.editor&&(this.editor.disable(),delete this.editor)},toggleEdit:function(){this.editEnabled()?this.disableEdit():this.enableEdit()},_onEditableAdd:function(){this.editor&&this.enableEdit()}},i={getEditorClass:e=>e?.options?.polylineEditorClass||t.Editable.PolylineEditor,shapeAt:function(t,e){let i=null;if(!(e=e||this._latlngs).length)return i;if(h(e)&&this.isInLatLngs(t,e))i=e;else for(const i of e)if(this.isInLatLngs(t,i))return i;return i},isInLatLngs:function(e,i){if(!i)return!1;let n,o,r,s,a=[];const l=this._clickTolerance();if(this._projectLatlngs(i,a,this._pxBounds),a=a[0],s=this._map.latLngToLayerPoint(e),!this._pxBounds.contains(s))return!1;for(n=1,r=a.length,o=0;n<r;o=n++)if(t.LineUtil.pointToSegmentDistance(s,a[o],a[n])<=l)return!0;return!1}},n={getEditorClass:e=>e?.options?.polygonEditorClass||t.Editable.PolygonEditor,shapeAt:function(t,e){let i=null;if(!(e=e||this._latlngs).length)return i;if(h(e)&&this.isInLatLngs(t,e)&&(i=e),h(e[0])&&this.isInLatLngs(t,e[0]))i=e;else for(const i of e)if(this.isInLatLngs(t,i[0]))return i;return i},isInLatLngs:(t,e)=>{let i,n,o,r,s,a=!1;for(o=0,s=e.length,r=s-1;o<s;r=o++)i=e[o],n=e[r],i.lat>t.lat!=n.lat>t.lat&&t.lng<(n.lng-i.lng)*(t.lat-i.lat)/(n.lat-i.lat)+i.lng&&(a=!a);return a},parentShape:function(e,i){if(!(i=i||this._latlngs))return;let n=t.Util.indexOf(i,e);if(-1!==n)return i;for(const o of i)if(n=t.Util.indexOf(o,e),-1!==n)return o}},o={getEditorClass:e=>e?.options?.markerEditorClass||t.Editable.MarkerEditor},r={getEditorClass:e=>e?.options?.circleMarkerEditorClass||t.Editable.CircleMarkerEditor},s={getEditorClass:e=>e?.options?.rectangleEditorClass||t.Editable.RectangleEditor},a={getEditorClass:e=>e?.options?.circleEditorClass||t.Editable.CircleEditor},l=function(){this.on("add",this._onEditableAdd)},h=t.LineUtil.isFlat||t.LineUtil._flat||t.Polyline._flat;t.Polyline&&(t.Polyline.include(e),t.Polyline.include(i),t.Polyline.addInitHook(l)),t.Polygon&&(t.Polygon.include(e),t.Polygon.include(n)),t.Marker&&(t.Marker.include(e),t.Marker.include(o),t.Marker.addInitHook(l)),t.CircleMarker&&(t.CircleMarker.include(e),t.CircleMarker.include(r),t.CircleMarker.addInitHook(l)),t.Rectangle&&(t.Rectangle.include(e),t.Rectangle.include(s)),t.Circle&&(t.Circle.include(e),t.Circle.include(a)),t.LatLng.prototype.update=function(e){e=t.latLng(e),this.lat=e.lat,this.lng=e.lng}}),window)},9401:function(t,e,i){var n,o,r,s;"undefined"!=typeof self&&self,s=t=>{if("undefined"==typeof document)return console.warn('"window.document" is undefined; leaflet.fullscreen requires this object to access the DOM'),!1;const e=(()=>{const t=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"]],e=t[0],i={};for(const n of t)if(n[1]in document){for(let t=0;t<n.length;t++)i[e[t]]=n[t];return i}return!1})(),i={change:e.fullscreenchange,error:e.fullscreenerror},n={request(t,i){return new Promise(((n,o)=>{const r=function(){this.off("change",r),n()}.bind(this);this.on("change",r);const s=(t=t||document.documentElement)[e.requestFullscreen](i);s instanceof Promise&&s.then(r).catch(o)}))},exit(){return new Promise(((t,i)=>{if(!this.isFullscreen)return void t();const n=function(){this.off("change",n),t()}.bind(this);this.on("change",n);const o=document[e.exitFullscreen]();o instanceof Promise&&o.then(n).catch(i)}))},on(t,e){const n=i[t];n&&document.addEventListener(n,e,!1)},off(t,e){const n=i[t];n&&document.removeEventListener(n,e,!1)},nativeAPI:e};return Object.defineProperties(n,{isFullscreen:{get:()=>Boolean(document[e.fullscreenElement])},isEnabled:{enumerable:!0,get:()=>Boolean(document[e.fullscreenEnabled])}}),t.Control.FullScreen=t.Control.extend({options:{position:"topleft",title:"Full Screen",titleCancel:"Exit Full Screen",forceSeparateButton:!1,forcePseudoFullscreen:!1,fullscreenElement:!1},_screenfull:n,onAdd(e){let i,n="leaflet-control-zoom-fullscreen",o="";return i=e.zoomControl&&!this.options.forceSeparateButton?e.zoomControl._container:t.DomUtil.create("div","leaflet-bar"),this.options.content?o=this.options.content:n+=" fullscreen-icon",this._createButton(this.options.title,n,o,i,this.toggleFullScreen,this),this._map.fullscreenControl=this,this._map.on("enterFullscreen exitFullscreen",this._toggleState,this),i},onRemove(){t.DomEvent.off(this.link,"click",t.DomEvent.stop).off(this.link,"click",this.toggleFullScreen,this),this._screenfull.isEnabled&&(t.DomEvent.off(this._container,this._screenfull.nativeAPI.fullscreenchange,t.DomEvent.stop).off(this._container,this._screenfull.nativeAPI.fullscreenchange,this._handleFullscreenChange,this),t.DomEvent.off(document,this._screenfull.nativeAPI.fullscreenchange,t.DomEvent.stop).off(document,this._screenfull.nativeAPI.fullscreenchange,this._handleFullscreenChange,this))},_createButton(e,i,n,o,r,s){return this.link=t.DomUtil.create("a",i,o),this.link.href="#",this.link.title=e,this.link.innerHTML=n,this.link.setAttribute("role","button"),this.link.setAttribute("aria-label",e),L.DomEvent.disableClickPropagation(o),t.DomEvent.on(this.link,"click",t.DomEvent.stop).on(this.link,"click",r,s),this._screenfull.isEnabled&&(t.DomEvent.on(o,this._screenfull.nativeAPI.fullscreenchange,t.DomEvent.stop).on(o,this._screenfull.nativeAPI.fullscreenchange,this._handleFullscreenChange,s),t.DomEvent.on(document,this._screenfull.nativeAPI.fullscreenchange,t.DomEvent.stop).on(document,this._screenfull.nativeAPI.fullscreenchange,this._handleFullscreenChange,s)),this.link},toggleFullScreen(){const e=this._map;e._exitFired=!1,e._isFullscreen?(this._screenfull.isEnabled&&!this.options.forcePseudoFullscreen?this._screenfull.exit().then((()=>e.invalidateSize())):(t.DomUtil.removeClass(this.options.fullscreenElement?this.options.fullscreenElement:e._container,"leaflet-pseudo-fullscreen"),e.invalidateSize()),e.fire("exitFullscreen"),e._exitFired=!0,e._isFullscreen=!1):(this._screenfull.isEnabled&&!this.options.forcePseudoFullscreen?this._screenfull.request(this.options.fullscreenElement?this.options.fullscreenElement:e._container).then((()=>e.invalidateSize())):(t.DomUtil.addClass(this.options.fullscreenElement?this.options.fullscreenElement:e._container,"leaflet-pseudo-fullscreen"),e.invalidateSize()),e.fire("enterFullscreen"),e._isFullscreen=!0)},_toggleState(){this.link.title=this._map._isFullscreen?this.options.title:this.options.titleCancel,this._map._isFullscreen?L.DomUtil.removeClass(this.link,"leaflet-fullscreen-on"):L.DomUtil.addClass(this.link,"leaflet-fullscreen-on")},_handleFullscreenChange(t){const e=this._map;t.target!==e.getContainer()||this._screenfull.isFullscreen||e._exitFired||(this._screenfull.exit().then((()=>e.invalidateSize())),e.fire("exitFullscreen"),e._exitFired=!0,e._isFullscreen=!1)}}),t.Map.include({toggleFullscreen(){this.fullscreenControl.toggleFullScreen()}}),t.Map.addInitHook((function(){this.options.fullscreenControl&&this.addControl(t.control.fullscreen(this.options.fullscreenControlOptions))})),t.control.fullscreen=function(e){return new t.Control.FullScreen(e)},{leaflet:t}},o=[i(3481)],void 0===(r="function"==typeof(n=s)?n.apply(e,o):n)||(t.exports=r)},3481:function(t,e){!function(t){function e(t){var e,i,n,o;for(i=1,n=arguments.length;i<n;i++)for(e in o=arguments[i])t[e]=o[e];return t}var i=Object.create||function(){function t(){}return function(e){return t.prototype=e,new t}}();function n(t,e){var i=Array.prototype.slice;if(t.bind)return t.bind.apply(t,i.call(arguments,1));var n=i.call(arguments,2);return function(){return t.apply(e,n.length?n.concat(i.call(arguments)):arguments)}}var o=0;function r(t){return"_leaflet_id"in t||(t._leaflet_id=++o),t._leaflet_id}function s(t,e,i){var n,o,r,s;return s=function(){n=!1,o&&(r.apply(i,o),o=!1)},r=function(){n?o=arguments:(t.apply(i,arguments),setTimeout(s,e),n=!0)},r}function a(t,e,i){var n=e[1],o=e[0],r=n-o;return t===n&&i?t:((t-o)%r+r)%r+o}function l(){return!1}function h(t,e){if(!1===e)return t;var i=Math.pow(10,void 0===e?6:e);return Math.round(t*i)/i}function u(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function c(t){return u(t).split(/\s+/)}function d(t,e){for(var n in Object.prototype.hasOwnProperty.call(t,"options")||(t.options=t.options?i(t.options):{}),e)t.options[n]=e[n];return t.options}function p(t,e,i){var n=[];for(var o in t)n.push(encodeURIComponent(i?o.toUpperCase():o)+"="+encodeURIComponent(t[o]));return(e&&-1!==e.indexOf("?")?"&":"?")+n.join("&")}var f=/\{ *([\w_ -]+) *\}/g;function _(t,e){return t.replace(f,(function(t,i){var n=e[i];if(void 0===n)throw new Error("No value provided for variable "+t);return"function"==typeof n&&(n=n(e)),n}))}var m=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function g(t,e){for(var i=0;i<t.length;i++)if(t[i]===e)return i;return-1}var v="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function y(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var w=0;function x(t){var e=+new Date,i=Math.max(0,16-(e-w));return w=e+i,window.setTimeout(t,i)}var b=window.requestAnimationFrame||y("RequestAnimationFrame")||x,M=window.cancelAnimationFrame||y("CancelAnimationFrame")||y("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function P(t,e,i){if(!i||b!==x)return b.call(window,n(t,e));t.call(e)}function k(t){t&&M.call(window,t)}var E={__proto__:null,extend:e,create:i,bind:n,get lastId(){return o},stamp:r,throttle:s,wrapNum:a,falseFn:l,formatNum:h,trim:u,splitWords:c,setOptions:d,getParamString:p,template:_,isArray:m,indexOf:g,emptyImageUrl:v,requestFn:b,cancelFn:M,requestAnimFrame:P,cancelAnimFrame:k};function C(){}C.extend=function(t){var n=function(){d(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},o=n.__super__=this.prototype,r=i(o);for(var s in r.constructor=n,n.prototype=r,this)Object.prototype.hasOwnProperty.call(this,s)&&"prototype"!==s&&"__super__"!==s&&(n[s]=this[s]);return t.statics&&e(n,t.statics),t.includes&&(function(t){if("undefined"!=typeof L&&L&&L.Mixin){t=m(t)?t:[t];for(var e=0;e<t.length;e++)t[e]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",(new Error).stack)}}(t.includes),e.apply(null,[r].concat(t.includes))),e(r,t),delete r.statics,delete r.includes,r.options&&(r.options=o.options?i(o.options):{},e(r.options,t.options)),r._initHooks=[],r.callInitHooks=function(){if(!this._initHooksCalled){o.callInitHooks&&o.callInitHooks.call(this),this._initHooksCalled=!0;for(var t=0,e=r._initHooks.length;t<e;t++)r._initHooks[t].call(this)}},n},C.include=function(t){var i=this.prototype.options;return e(this.prototype,t),t.options&&(this.prototype.options=i,this.mergeOptions(t.options)),this},C.mergeOptions=function(t){return e(this.prototype.options,t),this},C.addInitHook=function(t){var e=Array.prototype.slice.call(arguments,1),i="function"==typeof t?t:function(){this[t].apply(this,e)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(i),this};var T={on:function(t,e,i){if("object"==typeof t)for(var n in t)this._on(n,t[n],e);else for(var o=0,r=(t=c(t)).length;o<r;o++)this._on(t[o],e,i);return this},off:function(t,e,i){if(arguments.length)if("object"==typeof t)for(var n in t)this._off(n,t[n],e);else{t=c(t);for(var o=1===arguments.length,r=0,s=t.length;r<s;r++)o?this._off(t[r]):this._off(t[r],e,i)}else delete this._events;return this},_on:function(t,e,i,n){if("function"==typeof e){if(!1===this._listens(t,e,i)){i===this&&(i=void 0);var o={fn:e,ctx:i};n&&(o.once=!0),this._events=this._events||{},this._events[t]=this._events[t]||[],this._events[t].push(o)}}else console.warn("wrong listener type: "+typeof e)},_off:function(t,e,i){var n,o,r;if(this._events&&(n=this._events[t]))if(1!==arguments.length)if("function"==typeof e){var s=this._listens(t,e,i);if(!1!==s){var a=n[s];this._firingCount&&(a.fn=l,this._events[t]=n=n.slice()),n.splice(s,1)}}else console.warn("wrong listener type: "+typeof e);else{if(this._firingCount)for(o=0,r=n.length;o<r;o++)n[o].fn=l;delete this._events[t]}},fire:function(t,i,n){if(!this.listens(t,n))return this;var o=e({},i,{type:t,target:this,sourceTarget:i&&i.sourceTarget||this});if(this._events){var r=this._events[t];if(r){this._firingCount=this._firingCount+1||1;for(var s=0,a=r.length;s<a;s++){var l=r[s],h=l.fn;l.once&&this.off(t,h,l.ctx),h.call(l.ctx||this,o)}this._firingCount--}}return n&&this._propagateEvent(o),this},listens:function(t,e,i,n){"string"!=typeof t&&console.warn('"string" type argument expected');var o=e;"function"!=typeof e&&(n=!!e,o=void 0,i=void 0);var r=this._events&&this._events[t];if(r&&r.length&&!1!==this._listens(t,o,i))return!0;if(n)for(var s in this._eventParents)if(this._eventParents[s].listens(t,e,i,n))return!0;return!1},_listens:function(t,e,i){if(!this._events)return!1;var n=this._events[t]||[];if(!e)return!!n.length;i===this&&(i=void 0);for(var o=0,r=n.length;o<r;o++)if(n[o].fn===e&&n[o].ctx===i)return o;return!1},once:function(t,e,i){if("object"==typeof t)for(var n in t)this._on(n,t[n],e,!0);else for(var o=0,r=(t=c(t)).length;o<r;o++)this._on(t[o],e,i,!0);return this},addEventParent:function(t){return this._eventParents=this._eventParents||{},this._eventParents[r(t)]=t,this},removeEventParent:function(t){return this._eventParents&&delete this._eventParents[r(t)],this},_propagateEvent:function(t){for(var i in this._eventParents)this._eventParents[i].fire(t.type,e({layer:t.target,propagatedFrom:t.target},t),!0)}};T.addEventListener=T.on,T.removeEventListener=T.clearAllEventListeners=T.off,T.addOneTimeEventListener=T.once,T.fireEvent=T.fire,T.hasEventListeners=T.listens;var z=C.extend(T);function S(t,e,i){this.x=i?Math.round(t):t,this.y=i?Math.round(e):e}var A=Math.trunc||function(t){return t>0?Math.floor(t):Math.ceil(t)};function D(t,e,i){return t instanceof S?t:m(t)?new S(t[0],t[1]):null==t?t:"object"==typeof t&&"x"in t&&"y"in t?new S(t.x,t.y):new S(t,e,i)}function I(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;n<o;n++)this.extend(i[n])}function O(t,e){return!t||t instanceof I?t:new I(t,e)}function B(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;n<o;n++)this.extend(i[n])}function N(t,e){return t instanceof B?t:new B(t,e)}function Z(t,e,i){if(isNaN(t)||isNaN(e))throw new Error("Invalid LatLng object: ("+t+", "+e+")");this.lat=+t,this.lng=+e,void 0!==i&&(this.alt=+i)}function j(t,e,i){return t instanceof Z?t:m(t)&&"object"!=typeof t[0]?3===t.length?new Z(t[0],t[1],t[2]):2===t.length?new Z(t[0],t[1]):null:null==t?t:"object"==typeof t&&"lat"in t?new Z(t.lat,"lng"in t?t.lng:t.lon,t.alt):void 0===e?null:new Z(t,e,i)}S.prototype={clone:function(){return new S(this.x,this.y)},add:function(t){return this.clone()._add(D(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(D(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new S(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new S(this.x/t.x,this.y/t.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=A(this.x),this.y=A(this.y),this},distanceTo:function(t){var e=(t=D(t)).x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},equals:function(t){return(t=D(t)).x===this.x&&t.y===this.y},contains:function(t){return t=D(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+h(this.x)+", "+h(this.y)+")"}},I.prototype={extend:function(t){var e,i;if(!t)return this;if(t instanceof S||"number"==typeof t[0]||"x"in t)e=i=D(t);else if(e=(t=O(t)).min,i=t.max,!e||!i)return this;return this.min||this.max?(this.min.x=Math.min(e.x,this.min.x),this.max.x=Math.max(i.x,this.max.x),this.min.y=Math.min(e.y,this.min.y),this.max.y=Math.max(i.y,this.max.y)):(this.min=e.clone(),this.max=i.clone()),this},getCenter:function(t){return D((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return D(this.min.x,this.max.y)},getTopRight:function(){return D(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var e,i;return(t="number"==typeof t[0]||t instanceof S?D(t):O(t))instanceof I?(e=t.min,i=t.max):e=i=t,e.x>=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=O(t);var e=this.min,i=this.max,n=t.min,o=t.max,r=o.x>=e.x&&n.x<=i.x,s=o.y>=e.y&&n.y<=i.y;return r&&s},overlaps:function(t){t=O(t);var e=this.min,i=this.max,n=t.min,o=t.max,r=o.x>e.x&&n.x<i.x,s=o.y>e.y&&n.y<i.y;return r&&s},isValid:function(){return!(!this.min||!this.max)},pad:function(t){var e=this.min,i=this.max,n=Math.abs(e.x-i.x)*t,o=Math.abs(e.y-i.y)*t;return O(D(e.x-n,e.y-o),D(i.x+n,i.y+o))},equals:function(t){return!!t&&(t=O(t),this.min.equals(t.getTopLeft())&&this.max.equals(t.getBottomRight()))}},B.prototype={extend:function(t){var e,i,n=this._southWest,o=this._northEast;if(t instanceof Z)e=t,i=t;else{if(!(t instanceof B))return t?this.extend(j(t)||N(t)):this;if(e=t._southWest,i=t._northEast,!e||!i)return this}return n||o?(n.lat=Math.min(e.lat,n.lat),n.lng=Math.min(e.lng,n.lng),o.lat=Math.max(i.lat,o.lat),o.lng=Math.max(i.lng,o.lng)):(this._southWest=new Z(e.lat,e.lng),this._northEast=new Z(i.lat,i.lng)),this},pad:function(t){var e=this._southWest,i=this._northEast,n=Math.abs(e.lat-i.lat)*t,o=Math.abs(e.lng-i.lng)*t;return new B(new Z(e.lat-n,e.lng-o),new Z(i.lat+n,i.lng+o))},getCenter:function(){return new Z((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new Z(this.getNorth(),this.getWest())},getSouthEast:function(){return new Z(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(t){t="number"==typeof t[0]||t instanceof Z||"lat"in t?j(t):N(t);var e,i,n=this._southWest,o=this._northEast;return t instanceof B?(e=t.getSouthWest(),i=t.getNorthEast()):e=i=t,e.lat>=n.lat&&i.lat<=o.lat&&e.lng>=n.lng&&i.lng<=o.lng},intersects:function(t){t=N(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),r=o.lat>=e.lat&&n.lat<=i.lat,s=o.lng>=e.lng&&n.lng<=i.lng;return r&&s},overlaps:function(t){t=N(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),r=o.lat>e.lat&&n.lat<i.lat,s=o.lng>e.lng&&n.lng<i.lng;return r&&s},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t,e){return!!t&&(t=N(t),this._southWest.equals(t.getSouthWest(),e)&&this._northEast.equals(t.getNorthEast(),e))},isValid:function(){return!(!this._southWest||!this._northEast)}},Z.prototype={equals:function(t,e){return!!t&&(t=j(t),Math.max(Math.abs(this.lat-t.lat),Math.abs(this.lng-t.lng))<=(void 0===e?1e-9:e))},toString:function(t){return"LatLng("+h(this.lat,t)+", "+h(this.lng,t)