PageSourceSearch

https://anzanatitlan.org/wp-content/uploads/hummingbird-assets/bea0bad84174480b6d19bfd3672a6329.js

js anzanatitlan.org collected 2026-10-06 17:21:53 UTC 146,642 bytes, 49 lines download raw bytes

1/**handles:oum_leaflet_maplibre_js,oum_leaflet_draw_js,oum_global_leaflet_js,oum_map_styles_js,oum_frontend_opening_hours_js,oum_frontend_block_map_js,oum_frontend_ajax_js,oum_frontend_carousel_js**/
2((t,i)=>{"object"==typeof exports&&"undefined"!=typeof module?i(exports,require("leaflet"),require("maplibre-gl")):"function"==typeof define&&define.amd?define(["exports","leaflet","maplibre-gl"],i):i((t="undefined"!=typeof globalThis?globalThis:t||self).MaplibreGLLeaflet={},t.L,t.maplibregl)})(this,function(t,i,s){Object.defineProperty(t,"__esModule",{value:!0});var n=Object.create,l=Object.defineProperty,p=Object.getOwnPropertyDescriptor,h=Object.getOwnPropertyNames,o=Object.getPrototypeOf,m=Object.prototype.hasOwnProperty,a=(t,i,e,n)=>{if(i&&"object"==typeof i||"function"==typeof i)for(var o=h(i),a=0,s=o.length,r;a<s;a++)r=o[a],m.call(t,r)||r===e||l(t,r,{get:(t=>i[t]).bind(null,r),enumerable:!(n=p(i,r))||n.enumerable});return t},e=(t,i,e)=>(e=null!=t?n(o(t)):{},a(!i&&t&&t.__esModule&&m.call(t,"default")?e:l(e,"default",{value:t,enumerable:!0}),t)),r=(i=e(i,1),s=e(s,1),i.default||i),_=r.Layer.extend({options:{updateInterval:32,padding:.1,interactive:!1,pane:"tilePane"},initialize:function(t){r.setOptions(this,t),this._throttledUpdate=r.Util.throttle(this._update,this.options.updateInterval,this)},onAdd:function(t){this._container||this._initContainer();var i=this.getPaneName();t.getPane(i).appendChild(this._container),this._initGL(),this._offset=this._map.containerPointToLayerPoint([0,0]),t.options.zoomAnimation&&r.DomEvent.on(t._proxy,r.DomUtil.TRANSITION_END,this._transitionEnd,this)},onRemove:function(t){this._map._proxy&&this._map.options.zoomAnimation&&r.DomEvent.off(this._map._proxy,r.DomUtil.TRANSITION_END,this._transitionEnd,this);var i=this.getPaneName();t.getPane(i).removeChild(this._container),this._glMap.remove(),this._glMap=null},getEvents:function(){return{move:this._throttledUpdate,zoomanim:this._animateZoom,zoom:this._pinchZoom,zoomstart:this._zoomStart,zoomend:this._zoomEnd,resize:this._resize}},getAttribution:function(){if(this.options.attributionControl)return this.options.attributionControl.customAttribution;var i=this._glMap;if(i&&!1!==this.options.attributionControl){var t=i.getStyle();if(t&&t.sources)return Object.keys(t.sources).map(function(t){var t=i.getSource(t);return t&&"string"==typeof t.attribution?t.attribution.trim():null}).filter(Boolean).join(", ")}return""},getMaplibreMap:function(){return this._glMap},getCanvas:function(){return this._glMap.getCanvas()},getSize:function(){return this._map.getSize().multiplyBy(1+2*this.options.padding)},getBounds:function(){var t=this.getSize().multiplyBy(.5),i=this._map.latLngToContainerPoint(this._map.getCenter());return r.latLngBounds(this._map.containerPointToLatLng(i.subtract(t)),this._map.containerPointToLatLng(i.add(t)))},getContainer:function(){return this._container},getPaneName:function(){return this._map.getPane(this.options.pane)?this.options.pane:"tilePane"},_roundPoint:function(t){return{x:Math.round(t.x),y:Math.round(t.y)}},_initContainer:function(){var t=this._container=r.DomUtil.create("div","leaflet-gl-layer"),i=(this._resizeContainer(),this._map.getSize().multiplyBy(this.options.padding)),i=this._map.containerPointToLayerPoint([0,0]).subtract(i);r.DomUtil.setPosition(t,this._roundPoint(i))},_resizeContainer:function(){var t=this.getSize();this._container.style.width=t.x+"px",this._container.style.height=t.y+"px"},_initGL:function(){var t=this._map.getCenter(),t=r.extend({},this.options,{container:this._container,center:[t.lng,t.lat],zoom:this._map.getZoom()-1,attributionControl:!1}),i=(this._glMap=new s.Map(t),this._map),e=this.getAttribution(),n=this.getAttribution.bind(this),t,o,a,a,o=(this._glMap.on("load",function(){i&&i.attributionControl&&(i.attributionControl.removeAttribution(e),i.attributionControl.addAttribution(n()))}),this._glMap.setTransformConstrain?this._glMap.setTransformConstrain(function(t,i){return{center:t,zoom:i}}):(t=this._glMap.transform,o=Object.getPrototypeOf(t),(a=Object.getOwnPropertyDescriptor(o,"latRange"))&&!a.set&&!a.writable||(t.latRange=null),(a=Object.getOwnPropertyDescriptor(o,"maxValidLatitude"))&&!a.set&&!a.writable||(t.maxValidLatitude=1/0),t._helper&&t._helper._latRange&&(t._helper._latRange=[-1/0,1/0])),this._transformGL(this._glMap),this._glMap._canvas.canvas?this._glMap._actualCanvas=this._glMap._canvas.canvas:this._glMap._actualCanvas=this._glMap._canvas,this._glMap._actualCanvas);r.DomUtil.addClass(o,"leaflet-image-layer"),r.DomUtil.addClass(o,"leaflet-zoom-animated"),this.options.interactive&&r.DomUtil.addClass(o,"leaflet-interactive"),this.options.className&&r.DomUtil.addClass(o,this.options.className)},_update:function(t){var i,e,n,n;this._map&&(this._offset=this._map.containerPointToLayerPoint([0,0]),this._zooming||(i=this._container,e=this._glMap,n=this._map.getSize().multiplyBy(this.options.padding),n=this._map.containerPointToLayerPoint([0,0]).subtract(n),r.DomUtil.setPosition(i,this._roundPoint(n)),this._transformGL(e)))},_transformGL:function(t){var i=this._map.getCenter();t.jumpTo({center:[i.lng,i.lat],zoom:this._map.getZoom()-1})},_pinchZoom:function(t){this._glMap.jumpTo({zoom:this._map.getZoom()-1,center:this._map.getCenter()})},_animateZoom:function(t){var i=this._map.getZoomScale(t.zoom),e=this._map.getSize().multiplyBy(this.options.padding*i),n=this.getSize()._divideBy(2),n=this._map.project(t.center,t.zoom)._subtract(n)._add(this._map._getMapPanePos().add(e))._round(),e=this._map.project(this._map.getBounds().getNorthWest(),t.zoom)._subtract(n);r.DomUtil.setTransform(this._glMap._actualCanvas,e.subtract(this._offset),i)},_zoomStart:function(t){this._zooming=!0},_zoomEnd:function(){var t=this._map.getZoomScale(this._map.getZoom());r.DomUtil.setTransform(this._glMap._actualCanvas,null,t),this._zooming=!1,this._update()}
2,_transitionEnd:function(t){r.Util.requestAnimFrame(function(){var t=this._map.getZoom(),i=this._map.getCenter(),e=this._map.latLngToContainerPoint(this._map.getBounds().getNorthWest());this._resizeContainer(),r.DomUtil.setTransform(this._glMap._actualCanvas,e,1),this._glMap.once("moveend",r.Util.bind(function(){this._zoomEnd()},this)),this._glMap.jumpTo({center:i,zoom:t-1})},this)},_resize:function(t){this._transitionEnd(t)}}),e=function(t){return new _(t)};Object.isExtensible(r)&&(r.MaplibreGL=_,r.maplibreGL=e),t.MaplibreGL=_,t.default=e,t.maplibreGL=e});
3((o,e,t)=>{function i(t,e){for(;(t=t.parentElement)&&!t.classList.contains(e););return t}var s;L.drawVersion="1.0.4",L.Draw={},L.drawLocal={draw:{toolbar:{actions:{title:"Cancel drawing",text:"Cancel"},finish:{title:"Finish drawing",text:"Finish"},undo:{title:"Delete last point drawn",text:"Delete last point"},buttons:{polyline:"Draw a polyline",polygon:"Draw a polygon",rectangle:"Draw a rectangle",circle:"Draw a circle",marker:"Draw a marker",circlemarker:"Draw a circlemarker"}},handlers:{circle:{tooltip:{start:"Click and drag to draw circle."},radius:"Radius"},circlemarker:{tooltip:{start:"Click map to place circle marker."}},marker:{tooltip:{start:"Click map to place marker."}},polygon:{tooltip:{start:"Click to start drawing shape.",cont:"Click to continue drawing shape.",end:"Click first point to close this shape."}},polyline:{error:"<strong>Error:</strong> shape edges cannot cross!",tooltip:{start:"Click to start drawing line.",cont:"Click to continue drawing line.",end:"Click last point to finish line."}},rectangle:{tooltip:{start:"Click and drag to draw rectangle."}},simpleshape:{tooltip:{end:"Release mouse to finish drawing."}}}},edit:{toolbar:{actions:{save:{title:"Save changes",text:"Save"},cancel:{title:"Cancel editing, discards all changes",text:"Cancel"},clearAll:{title:"Clear all layers",text:"Clear All"}},buttons:{edit:"Edit layers",editDisabled:"No layers to edit",remove:"Delete layers",removeDisabled:"No layers to delete"}},handlers:{edit:{tooltip:{text:"Drag handles or markers to edit features.",subtext:"Click cancel to undo changes."}},remove:{tooltip:{text:"Click on a feature to remove."}}}}},L.Draw.Event={},L.Draw.Event.CREATED="draw:created",L.Draw.Event.EDITED="draw:edited",L.Draw.Event.DELETED="draw:deleted",L.Draw.Event.DRAWSTART="draw:drawstart",L.Draw.Event.DRAWSTOP="draw:drawstop",L.Draw.Event.DRAWVERTEX="draw:drawvertex",L.Draw.Event.EDITSTART="draw:editstart",L.Draw.Event.EDITMOVE="draw:editmove",L.Draw.Event.EDITRESIZE="draw:editresize",L.Draw.Event.EDITVERTEX="draw:editvertex",L.Draw.Event.EDITSTOP="draw:editstop",L.Draw.Event.DELETESTART="draw:deletestart",L.Draw.Event.DELETESTOP="draw:deletestop",L.Draw.Event.TOOLBAROPENED="draw:toolbaropened",L.Draw.Event.TOOLBARCLOSED="draw:toolbarclosed",L.Draw.Event.MARKERCONTEXT="draw:markercontext",L.Draw=L.Draw||{},L.Draw.Feature=L.Handler.extend({initialize:function(t,e){this._map=t,this._container=t._container,this._overlayPane=t._panes.overlayPane,this._popupPane=t._panes.popupPane,e&&e.shapeOptions&&(e.shapeOptions=L.Util.extend({},this.options.shapeOptions,e.shapeOptions)),L.setOptions(this,e);var t=L.version.split(".");1===parseInt(t[0],10)&&2<=parseInt(t[1],10)?L.Draw.Feature.include(L.Evented.prototype):L.Draw.Feature.include(L.Mixin.Events)},enable:function(){this._enabled||(L.Handler.prototype.enable.call(this),this.fire("enabled",{handler:this.type}),this._map.fire(L.Draw.Event.DRAWSTART,{layerType:this.type}))},disable:function(){this._enabled&&(L.Handler.prototype.disable.call(this),this._map.fire(L.Draw.Event.DRAWSTOP,{layerType:this.type}),this.fire("disabled",{handler:this.type}))},addHooks:function(){var t=this._map;t&&(L.DomUtil.disableTextSelection(),t.getContainer().focus(),this._tooltip=new L.Draw.Tooltip(this._map),L.DomEvent.on(this._container,"keyup",this._cancelDrawing,this))},removeHooks:function(){this._map&&(L.DomUtil.enableTextSelection(),this._tooltip.dispose(),this._tooltip=null,L.DomEvent.off(this._container,"keyup",this._cancelDrawing,this))},setOptions:function(t){L.setOptions(this,t)},_fireCreatedEvent:function(t){this._map.fire(L.Draw.Event.CREATED,{layer:t,layerType:this.t
3ype})},_cancelDrawing:function(t){27===t.keyCode&&(this._map.fire("draw:canceled",{layerType:this.type}),this.disable())}}),L.Draw.Polyline=L.Draw.Feature.extend({statics:{TYPE:"polyline"},Poly:L.Polyline,options:{allowIntersection:!0,repeatMode:!1,drawError:{color:"#b00b00",timeout:2500},icon:new L.DivIcon({iconSize:new L.Point(8,8),className:"leaflet-div-icon leaflet-editing-icon"}),touchIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:"leaflet-div-icon leaflet-editing-icon leaflet-touch-icon"}),guidelineDistance:20,maxGuideLineLength:4e3,shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!1,clickable:!0},metric:!0,feet:!0,nautic:!1,showLength:!0,zIndexOffset:2e3,factor:1,maxPoints:0},initialize:function(t,e){L.Browser.touch&&(this.options.icon=this.options.touchIcon),this.options.drawError.message=L.drawLocal.draw.handlers.polyline.error,e&&e.drawError&&(e.drawError=L.Util.extend({},this.options.drawError,e.drawError)),this.type=L.Draw.Polyline.TYPE,L.Draw.Feature.prototype.initialize.call(this,t,e)},addHooks:function(){L.Draw.Feature.prototype.addHooks.call(this),this._map&&(this._markers=[],this._markerGroup=new L.LayerGroup,this._map.addLayer(this._markerGroup),this._poly=new L.Polyline([],this.options.shapeOptions),this._tooltip.updateContent(this._getTooltipText()),this._mouseMarker||(this._mouseMarker=L.marker(this._map.getCenter(),{icon:L.divIcon({className:"leaflet-mouse-marker",iconAnchor:[20,20],iconSize:[40,40]}),opacity:0,zIndexOffset:this.options.zIndexOffset})),this._mouseMarker.on("mouseout",this._onMouseOut,this).on("mousemove",this._onMouseMove,this).on("mousedown",this._onMouseDown,this).on("mouseup",this._onMouseUp,this).addTo(this._map),this._map.on("mouseup",this._onMouseUp,this).on("mousemove",this._onMouseMove,this).on("zoomlevelschange",this._onZoomEnd,this).on("touchstart",this._onTouch,this).on("zoomend",this._onZoomEnd,this))},removeHooks:function(){L.Draw.Feature.prototype.removeHooks.call(this),this._clearHideErrorTimeout(),this._cleanUpShape(),this._map.removeLayer(this._markerGroup),delete this._markerGroup,delete this._markers,this._map.removeLayer(this._poly),delete this._poly,this._mouseMarker.off("mousedown",this._onMouseDown,this).off("mouseout",this._onMouseOut,this).off("mouseup",this._onMouseUp,this).off("mousemove",this._onMouseMove,this),this._map.removeLayer(this._mouseMarker),delete this._mouseMarker,this._clearGuides(),this._map.off("mouseup",this._onMouseUp,this).off("mousemove",this._onMouseMove,this).off("zoomlevelschange",this._onZoomEnd,this).off("zoomend",this._onZoomEnd,this).off("touchstart",this._onTouch,this).off("click",this._onTouch,this)},deleteLastVertex:function(){var t,e,i,o;this._markers.length<=1||(t=this._markers.pop(),o=(i=(e=this._poly).getLatLngs()).splice(-1,1)[0],this._poly.setLatLngs(i),this._markerGroup.removeLayer(t),e.getLatLngs().length<2&&this._map.removeLayer(e),this._vertexChanged(o,!1))},addVertex:function(t){2<=this._markers.length&&!this.options.allowIntersection&&this._poly.newLatLngIntersects(t)?this._showErrorTooltip():(this._errorShown&&this._hideErrorTooltip(),this._markers.push(this._createMarker(t)),this._poly.addLatLng(t),2===this._poly.getLatLngs().length&&this._map.addLayer(this._poly),this._vertexChanged(t,!0))},completeShape:function(){this._markers.length<=1||!this._shapeIsValid()||(this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable())},_finishShape:function(){var t=this._poly._defaultShape?this._poly._defaultShape():this._poly.getLatLngs(),t=this._poly.newLatLngIntersects(t[t.length-1]);!this.options.allowIntersection&&t||!this._shapeIsValid()?this._showErrorTooltip():(this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable())},_shapeIsValid:function(){return!0},_onZoomEnd:function(){null!==this._markers&&this._updateGuide()},_onMouseMove:function(t){var e=this._map.mouseEventToLayerPoint(t.originalEvent),i=this._map.layerPointToLatLng(e);this._currentLatLng=i,this._updateTooltip(i),this._updateGuide(e),this._mouseMarker.setLatLng(i),L.DomEvent.preventDefault(t.originalEvent)},_vertexChanged:function(t,e){this._map.fire(L.Draw.Event.DRAWVERTEX,{layers:this._markerGroup}),this._updateFinishHandler(),this._updateRunningMeasure(t,e),this._clearGuides(),this._updateTooltip()},_onMouseDown:function(t){var t,e,i;this._clickHandled||this._touchHandled||this._disableMarkers||(this._onMouseMove(t),this._clickHandled=!0,this._disableNewMarkers(),e=(t=t.originalEvent).clientX,this._startPoint.call(this,e,t.clientY))},_startPoint:function(t,e){this._mouseDownOrigin=L.point(t,e)},_onMouseUp:function(t){var e=t.originalEvent,i=e.clientX,o;this._endPoint.call(this,i,e.clientY,t),this._clickHandled=null}
3,_endPoint:function(t,e,i){var t,e;this._mouseDownOrigin&&(t=L.point(t,e).distanceTo(this._mouseDownOrigin),e=this._calculateFinishDistance(i.latlng),1<this.options.maxPoints&&this.options.maxPoints==this._markers.length+1?(this.addVertex(i.latlng),this._finishShape()):e<10&&L.Browser.touch?this._finishShape():Math.abs(t)<9*(o.devicePixelRatio||1)&&this.addVertex(i.latlng),this._enableNewMarkers()),this._mouseDownOrigin=null},_onTouch:function(t){var e,i,i=t.originalEvent;!i.touches||!i.touches[0]||this._clickHandled||this._touchHandled||this._disableMarkers||(e=i.touches[0].clientX,i=i.touches[0].clientY,this._disableNewMarkers(),this._touchHandled=!0,this._startPoint.call(this,e,i),this._endPoint.call(this,e,i,t),this._touchHandled=null),this._clickHandled=null},_onMouseOut:function(){this._tooltip&&this._tooltip._onMouseOut.call(this._tooltip)},_calculateFinishDistance:function(t){var e,e;if(0<this._markers.length){if(this.type===L.Draw.Polyline.TYPE)e=this._markers[this._markers.length-1];else{if(this.type!==L.Draw.Polygon.TYPE)return 1/0;e=this._markers[0]}var e=this._map.latLngToContainerPoint(e.getLatLng()),t=new L.Marker(t,{icon:this.options.icon,zIndexOffset:2*this.options.zIndexOffset}),t=this._map.latLngToContainerPoint(t.getLatLng()),e=e.distanceTo(t)}else e=1/0;return e},_updateFinishHandler:function(){var t=this._markers.length;1<t&&this._markers[t-1].on("click",this._finishShape,this),2<t&&this._markers[t-2].off("click",this._finishShape,this)},_createMarker:function(t){var t=new L.Marker(t,{icon:this.options.icon,zIndexOffset:2*this.options.zIndexOffset});return this._markerGroup.addLayer(t),t},_updateGuide:function(t){var e=this._markers?this._markers.length:0;0<e&&(t=t||this._map.latLngToLayerPoint(this._currentLatLng),this._clearGuides(),this._drawGuide(this._map.latLngToLayerPoint(this._markers[e-1].getLatLng()),t))},_updateTooltip:function(t){var e=this._getTooltipText();t&&this._tooltip.updatePosition(t),this._errorShown||this._tooltip.updateContent(e)},_drawGuide:function(t,e){var i,i,o,a=Math.floor(Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))),n=this.options.guidelineDistance,s=this.options.maxGuideLineLength,r=s<a?a-s:n;for(this._guidesContainer||(this._guidesContainer=L.DomUtil.create("div","leaflet-draw-guides",this._overlayPane));r<a;r+=this.options.guidelineDistance)i=r/a,i={x:Math.floor(t.x*(1-i)+i*e.x),y:Math.floor(t.y*(1-i)+i*e.y)},(o=L.DomUtil.create("div","leaflet-draw-guide-dash",this._guidesContainer)).style.backgroundColor=(this._errorShown?this.options.drawError:this.options.shapeOptions).color,L.DomUtil.setPosition(o,i)},_updateGuideColor:function(t){if(this._guidesContainer)for(var e=0,i=this._guidesContainer.childNodes.length;e<i;e++)this._guidesContainer.childNodes[e].style.backgroundColor=t},_clearGuides:function(){if(this._guidesContainer)for(;this._guidesContainer.firstChild;)this._guidesContainer.removeChild(this._guidesContainer.firstChild)},_getTooltipText:function(){var t,t,t=this.options.showLength,t=0===this._markers.length?{text:L.drawLocal.draw.handlers.polyline.tooltip.start}:(t=t?this._getMeasurementString():"",1===this._markers.length?{text:L.drawLocal.draw.handlers.polyline.tooltip.cont,subtext:t}:{text:L.drawLocal.draw.handlers.polyline.tooltip.end,subtext:t});return t},_updateRunningMeasure:function(t,e){var i,t,i=this._markers.length;1===this._markers.length?this._measurementRunningTotal=0:(i=i-(e?2:1),t=L.GeometryUtil.isVersion07x()?t.distanceTo(this._markers[i].getLatLng())*(this.options.factor||1):this._map.distance(t,this._markers[i].getLatLng())*(this.options.factor||1),this._measurementRunningTotal+=t*(e?1:-1))},_getMeasurementString:function(){var t,t=this._currentLatLng,e=this._markers[this._markers.length-1].getLatLng(),t=L.GeometryUtil.isVersion07x()?e&&t&&t.distanceTo?this._measurementRunningTotal+t.distanceTo(e)*(this.options.factor||1):this._measurementRunningTotal||0:e&&t?this._measurementRunningTotal+this._map.distance(t,e)*(this.options.factor||1):this._measurementRunningTotal||0;return L.GeometryUtil.readableDistance(t,this.options.metric,this.options.feet,this.options.nautic,this.options.precision)},_showErrorTooltip:function(){this._errorShown=!0,this._tooltip.showAsError().updateContent({text:this.options.drawError.message}),this._updateGuideColor(this.options.drawError.color),this._poly.setStyle({color:this.options.drawError.color}),this._clearHideErrorTimeout(),this._hideErrorTimeout=setTimeout(L.Util.bind(this._hideErrorTooltip,this),this.options.drawError.timeout)},_hideErrorTooltip:function(){this._errorShown=!1,this._clearHideErrorTimeout(),this._tooltip.removeError().updateContent(this._getTooltipText()),this._updateGuideColor(this.options.shapeOptions.color),this._poly.setStyle({color:this.options.shapeOptions.color})},_clearHideErrorTimeout:function(){this._hideErrorTimeout&&(clearTimeout(this._hideErrorTimeout),this._hideErrorTimeout=null)},_disableNewMarkers:function(){this._disableMarkers=!0},_enableNewMarkers:function(){setTimeout(function(){this._disableMarkers=!1}.bind(this),50)},_cleanUpShape:function(){1<this._markers.length&&this._markers[this._markers.length-1].off("click",this._finishShape,this)},_fireCreatedEvent:function(){var t=new this.Poly(this._poly.getLatLngs(),this.options.shapeOptions);L.Draw.Feature.prototype._fireCreatedEvent.call(this,t)}}),L.Draw.Polygon=L.Draw.Polyline.extend({statics:{TYPE:"polygon"},Poly:L.Polygon,options:{showArea:!1,showLength:!1,shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0},metric:!0,feet:!0,nautic:!1,precision:{}},initialize:function(t,e){L.Draw.Polyline.prototype.initialize.call(this,t,e),this.type=L.Draw.Polygon.TYPE},_updateFinishHandler:function(){var t=this._markers.length;1===t&&this._markers[0].on("click",this._finishShape,this),2<t&&(this._markers[t-1].on("dblclick",this._finishShape,this),3<t)&&this._markers[t-2].off("dblclick",this._finishShape,this)},_getTooltipText:function(){var t,e;
3return 0===this._markers.length?t=L.drawLocal.draw.handlers.polygon.tooltip.start:e=(t=this._markers.length<3?L.drawLocal.draw.handlers.polygon.tooltip.cont:L.drawLocal.draw.handlers.polygon.tooltip.end,this._getMeasurementString()),{text:t,subtext:e}},_getMeasurementString:function(){var t=this._area,e="";return t||this.options.showLength?(this.options.showLength&&(e=L.Draw.Polyline.prototype._getMeasurementString.call(this)),t&&(e+="<br>"+L.GeometryUtil.readableArea(t,this.options.metric,this.options.precision)),e):null},_shapeIsValid:function(){return 3<=this._markers.length},_vertexChanged:function(t,e){var i;!this.options.allowIntersection&&this.options.showArea&&(i=this._poly.getLatLngs(),this._area=L.GeometryUtil.geodesicArea(i)),L.Draw.Polyline.prototype._vertexChanged.call(this,t,e)},_cleanUpShape:function(){var t=this._markers.length;0<t&&(this._markers[0].off("click",this._finishShape,this),2<t)&&this._markers[t-1].off("dblclick",this._finishShape,this)}}),L.SimpleShape={},L.Draw.SimpleShape=L.Draw.Feature.extend({options:{repeatMode:!1},initialize:function(t,e){this._endLabelText=L.drawLocal.draw.handlers.simpleshape.tooltip.end,L.Draw.Feature.prototype.initialize.call(this,t,e)},addHooks:function(){L.Draw.Feature.prototype.addHooks.call(this),this._map&&(this._mapDraggable=this._map.dragging.enabled(),this._mapDraggable&&this._map.dragging.disable(),this._container.style.cursor="crosshair",this._tooltip.updateContent({text:this._initialLabelText}),this._map.on("mousedown",this._onMouseDown,this).on("mousemove",this._onMouseMove,this).on("touchstart",this._onMouseDown,this).on("touchmove",this._onMouseMove,this),e.addEventListener("touchstart",L.DomEvent.preventDefault,{passive:!1}))},removeHooks:function(){L.Draw.Feature.prototype.removeHooks.call(this),this._map&&(this._mapDraggable&&this._map.dragging.enable(),this._container.style.cursor="",this._map.off("mousedown",this._onMouseDown,this).off("mousemove",this._onMouseMove,this).off("touchstart",this._onMouseDown,this).off("touchmove",this._onMouseMove,this),L.DomEvent.off(e,"mouseup",this._onMouseUp,this),L.DomEvent.off(e,"touchend",this._onMouseUp,this),e.removeEventListener("touchstart",L.DomEvent.preventDefault),this._shape)&&(this._map.removeLayer(this._shape),delete this._shape),this._isDrawing=!1},_getTooltipText:function(){return{text:this._endLabelText}},_onMouseDown:function(t){this._isDrawing=!0,this._startLatLng=t.latlng,L.DomEvent.on(e,"mouseup",this._onMouseUp,this).on(e,"touchend",this._onMouseUp,this).preventDefault(t.originalEvent)},_onMouseMove:function(t){var t=t.latlng;this._tooltip.updatePosition(t),this._isDrawing&&(this._tooltip.updateContent(this._getTooltipText()),this._drawShape(t))},_onMouseUp:function(){this._shape&&this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable()}}),L.Draw.Rectangle=L.Draw.SimpleShape.extend({statics:{TYPE:"rectangle"},options:{shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0},showArea:!0,metric:!0},initialize:function(t,e){this.type=L.Draw.Rectangle.TYPE,this._initialLabelText=L.drawLocal.draw.handlers.rectangle.tooltip.start,L.Draw.SimpleShape.prototype.initialize.call(this,t,e)},disable:function(){this._enabled&&(this._isCurrentlyTwoClickDrawing=!1,L.Draw.SimpleShape.prototype.disable.call(this))},_onMouseUp:function(t){this._shape||this._isCurrentlyTwoClickDrawing?this._isCurrentlyTwoClickDrawing&&!i(t.target,"leaflet-pane")||L.Draw.SimpleShape.prototype._onMouseUp.call(this):this._isCurrentlyTwoClickDrawing=!0},_drawShape:function(t){this._shape?this._shape.setBounds(new L.LatLngBounds(this._startLatLng,t)):(this._shape=new L.Rectangle(new L.LatLngBounds(this._startLatLng,t),this.options.shapeOptions),this._map.addLayer(this._shape))},_fireCreatedEvent:function(){var t=new L.Rectangle(this._shape.getBounds(),this.options.shapeOptions);L.Draw.SimpleShape.prototype._fireCreatedEvent.call(this,t)},_getTooltipText:function(){var t,t,e,i=L.Draw.SimpleShape.prototype._getTooltipText.call(this),t=this._shape,o=this.options.showArea;return t&&(t=this._shape._defaultShape?this._shape._defaultShape():this._shape.getLatLngs(),t=L.GeometryUtil.geodesicArea(t),e=o?L.GeometryUtil.readableArea(t,this.options.metric):""),{text:i.text,subtext:e}}}),L.Draw.Marker=L.Draw.Feature.extend({statics:{TYPE:"marker"},options:{icon:new L.Icon.Default,repeatMode:!1,zIndexOffset:2e3},initialize:function(t,e){this.type=L.Draw.Marker.TYPE,this._initialLabelText=L.drawLocal.draw.handlers.marker.tooltip.start,L.Draw.Feature.prototype.initialize.call(this,t,e)},addHooks:function(){L.Draw.Feature.prototype.addHooks.call(this),this._map&&(this._tooltip.updateContent({text:this._initialLabelText}),this._mouseMarker||(this._mouseMarker=L.marker(this._map.getCenter(),{icon:L.divIcon({className:"leaflet-mouse-marker",iconAnchor:[20,20],iconSize:[40,40]}),opacity:0,zIndexOffset:this.options.zIndexOffset})),this._mouseMarker.on("click",this._onClick,this).addTo(this._map),this._map.on("mousemove",this._onMouseMove,this),this._map.on("click",this._onTouch,this))},removeHooks:function(){L.Draw.Feature.prototype.removeHooks.call(this),this._map&&(this._map.off("click",this._onClick,this).off("click",this._onTouch,this),this._marker&&(this._marker.off("click",this._onClick,this),this._map.removeLayer(this._marker),delete this._marker),this._mouseMarker.off("click",this._onClick,this),this._map.removeLayer(this._mouseMarker),delete this._mouseMarker,this._map.off("mousemove",this._onMouseMove,this))},_onMouseMove:function(t){var t=t.latlng;this._tooltip.updatePosition(t),this._mouseMarker.setLatLng(t),this._marker?(t=this._mouseMarker.getLatLng(),this._marker.setLatLng(t)):(this._marker=this._createMarker(t),this._marker.on("click",this._onClick,this),this._map.on("click",this._onClick,this).addLayer(this._marker))},_createMarker:function(t){return new L.Marker(t,{icon:this.options.icon,zIndexOffset:this.options.zIndexOffset})},_onClick:function(){this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable()},_onTouch:function(t){this._onMouseMove(t),this._onClick()},_fireCreatedEvent:function(){var t=new L.Marker.Touch(this._marker.getLatLng(),{icon:this.options.icon});L.Draw.Feature.prototype._fireCreatedEvent.call(this,t)}}),L.Draw.CircleMarker=L.Draw.Marker.extend({statics:{TYPE:"circlemarker"},options:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0,zIndexOffset:2e3},initialize:function(t,e){this.type=L.Draw.CircleMarker.TYPE,this._initialLabelText=L.drawLocal.draw.handlers.circlemarker.tooltip.start,L.Draw.Feature.prototype.initialize.call(this,t,e)},_fireCreatedEvent:function(){var t=new L.CircleMarker(this._marker.getLatLng(),this.options);L.Draw.Feature.prototype._fireCreatedEvent.call(this,t)},_createMarker:function(t){return new L.CircleMarker(t,this.options)}}),L.Draw.Circle=L.Draw.SimpleShape.extend({statics:{TYPE:"circle"},options:{shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0},showRadius:!0,metric:!0,feet:!0,nautic:!1},initialize:function(t,e){this.type=L.Draw.Circle.TYPE,this._initialLabelText=L.drawLocal.draw.handlers.circle.tooltip.start,L.Draw.SimpleShape.prototype.initialize.call(this,t,e)},_drawShape:function(t){var t,t;t=L.GeometryUtil.isVersion07x()?this._startLatLng.distanceTo(t):this._map.distance(this._startLatLng,t),this._shape?this._shape.setRadius(t):(this._shape=new L.Circle(this._startLatLng,t,this.options.shapeOptions),this._map.addLayer(this._shape))},_fireCreatedEvent:function(){var t=new L.Circle(this._startLatLng,this._shape.getRadius(),this.options.shapeOptions);L.Draw.SimpleShape.prototype._fireCreatedEvent.call(this,t)},_onMouseMove:function(t){var t,t=t.latlng,e=this.options.showRadius,i=this.options.metric,t,o;this._tooltip.updatePosition(t),this._isDrawing&&(this._drawShape(t),t=this._shape.getRadius().toFixed(1),o="",e&&(o=L.drawLocal.draw.handlers.circle.radius+": "+L.GeometryUtil.readableDistance(t,i,this.options.feet,this.options.nautic)),this._tooltip.updateContent({text:this._endLabelText,subtext:o}))}}),L.Edit=L.Edit||{},L.Edit.Marker=L.Handler.extend({initialize:function(t,e){this._marker=t,L.setOptions(this,e)},addHooks:function(){var t=this._marker;t.dragging.enable(),t.on("dragend",this._onDragEnd,t),this._toggleMarkerHighlight()},removeHooks:function(){var t=this._marker;t.dragging.disable(),t.off("dragend",this._onDragEnd,t),this._toggleMarkerHighlight()},_onDragEnd:function(t){var t=t.target;t.edited=!0,this._map.fire(L.Draw.Event.EDITMOVE,{layer:t})},_toggleMarkerHighlight:function(){var t=this._marker._icon;t&&(t.style.display="none",L.DomUtil.hasClass(t,"leaflet-edit-marker-selected")?(L.DomUtil.removeClass(t,"leaflet-edit-marker-selected"),this._offsetMarker(t,-4)):(L.Dom
3Util.addClass(t,"leaflet-edit-marker-selected"),this._offsetMarker(t,4)),t.style.display="")},_offsetMarker:function(t,e){var i=parseInt(t.style.marginTop,10)-e,e=parseInt(t.style.marginLeft,10)-e;t.style.marginTop=i+"px",t.style.marginLeft=e+"px"}}),L.Marker.addInitHook(function(){L.Edit.Marker&&(this.editing=new L.Edit.Marker(this),this.options.editable)&&this.editing.enable()}),L.Edit=L.Edit||{},L.Edit.Poly=L.Handler.extend({initialize:function(t){this.latlngs=[t._latlngs],t._holes&&(this.latlngs=this.latlngs.concat(t._holes)),this._poly=t,this._poly.on("revert-edited",this._updateLatLngs,this)},_defaultShape:function(){return!L.Polyline._flat||L.Polyline._flat(this._poly._latlngs)?this._poly._latlngs:this._poly._latlngs[0]},_eachVertexHandler:function(t){for(var e=0;e<this._verticesHandlers.length;e++)t(this._verticesHandlers[e])},addHooks:function(){this._initHandlers(),this._eachVertexHandler(function(t){t.addHooks()})},removeHooks:function(){this._eachVertexHandler(function(t){t.removeHooks()})},updateMarkers:function(){this._eachVertexHandler(function(t){t.updateMarkers()})},_initHandlers:function(){this._verticesHandlers=[];for(var t=0;t<this.latlngs.length;t++)this._verticesHandlers.push(new L.Edit.PolyVerticesEdit(this._poly,this.latlngs[t],this._poly.options.poly))},_updateLatLngs:function(t){this.latlngs=[t.layer._latlngs],t.layer._holes&&(this.latlngs=this.latlngs.concat(t.layer._holes))}}),L.Edit.PolyVerticesEdit=L.Handler.extend({options:{icon:new L.DivIcon({iconSize:new L.Point(8,8),className:"leaflet-div-icon leaflet-editing-icon"}),touchIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:"leaflet-div-icon leaflet-editing-icon leaflet-touch-icon"}),drawError:{color:"#b00b00",timeout:1e3}},initialize:function(t,e,i){L.Browser.touch&&(this.options.icon=this.options.touchIcon),this._poly=t,i&&i.drawError&&(i.drawError=L.Util.extend({},this.options.drawError,i.drawError)),this._latlngs=e,L.setOptions(this,i)},_defaultShape:function(){return!L.Polyline._flat||L.Polyline._flat(this._latlngs)?this._latlngs:this._latlngs[0]},addHooks:function(){var t=this._poly,e=t._path;t instanceof L.Polygon||(t.options.fill=!1,t.options.editing&&(t.options.editing.fill=!1)),e&&t.options.editing&&t.options.editing.className&&(t.options.original.className&&t.options.original.className.split(" ").forEach(function(t){L.DomUtil.removeClass(e,t)}),t.options.editing.className.split(" ").forEach(function(t){L.DomUtil.addClass(e,t)})),t.setStyle(t.options.editing),this._poly._map&&(this._map=this._poly._map,this._markerGroup||this._initMarkers(),this._poly._map.addLayer(this._markerGroup))},removeHooks:function(){var t=this._poly,e=t._path;e&&t.options.editing&&t.options.editing.className&&(t.options.editing.className.split(" ").forEach(function(t){L.DomUtil.removeClass(e,t)}),t.options.original.className)&&t.options.original.className.split(" ").forEach(function(t){L.DomUtil.addClass(e,t)}),t.setStyle(t.options.original),t._map&&(t._map.removeLayer(this._markerGroup),delete this._markerGroup,delete this._markers)},updateMarkers:function(){this._markerGroup.clearLayers(),this._initMarkers()},_initMarkers:function(){this._markerGroup||(this._markerGroup=new L.LayerGroup),this._markers=[];for(var t,e,i,o,a=this._defaultShape(),t=0,i=a.length,n,s;t<i;t++)(o=this._createMarker(a[t],t)).on("click",this._onMarkerClick,this),o.on("contextmenu",this._onContextMenu,this),this._markers.push(o);for(t=0,e=i-1;t<i;e=t++)(0!==t||L.Polygon&&this._poly instanceof L.Polygon)&&(n=this._markers[e],s=this._markers[t],this._createMiddleMarker(n,s),this._updatePrevNext(n,s))},_createMarker:function(t,e){var i=new L.Marker.Touch(t,{draggable:!0,icon:this.options.icon});return i._origLatLng=t,i._index=e,i.on("dragstart",this._onMarkerDragStart,this).on("drag",this._onMarkerDrag,this).on("dragend",this._fireEdit,this).on("touchmove",this._onTouchMove,this).on("touchend",this._fireEdit,this).on("MSPointerMove",this._onTouchMove,this).on("MSPointerUp",this._fireEdit,this),this._markerGroup.addLayer(i),i},_onMarkerDragStart:function(){this._poly.fire("editstart")}
3,_spliceLatLngs:function(){var t=this._defaultShape(),e=[].splice.apply(t,arguments);return this._poly._convertLatLngs(t,!0),this._poly.redraw(),e},_removeMarker:function(t){var e=t._index;this._markerGroup.removeLayer(t),this._markers.splice(e,1),this._spliceLatLngs(e,1),this._updateIndexes(e,-1),t.off("dragstart",this._onMarkerDragStart,this).off("drag",this._onMarkerDrag,this).off("dragend",this._fireEdit,this).off("touchmove",this._onMarkerDrag,this).off("touchend",this._fireEdit,this).off("click",this._onMarkerClick,this).off("MSPointerMove",this._onTouchMove,this).off("MSPointerUp",this._fireEdit,this)},_fireEdit:function(){this._poly.edited=!0,this._poly.fire("edit"),this._poly._map.fire(L.Draw.Event.EDITVERTEX,{layers:this._markerGroup,poly:this._poly})},_onMarkerDrag:function(t){var t=t.target,e=this._poly,i=L.LatLngUtil.cloneLatLng(t._origLatLng),o,a,i=(L.extend(t._origLatLng,t._latlng),e.options.poly&&(o=e._map._editTooltip,!e.options.poly.allowIntersection)&&e.intersects()&&(L.extend(t._origLatLng,i),t.setLatLng(i),a=e.options.color,e.setStyle({color:this.options.drawError.color}),o&&o.updateContent({text:L.drawLocal.draw.handlers.polyline.error}),setTimeout(function(){e.setStyle({color:a}),o&&o.updateContent({text:L.drawLocal.edit.handlers.edit.tooltip.text,subtext:L.drawLocal.edit.handlers.edit.tooltip.subtext})},1e3)),t._middleLeft&&t._middleLeft.setLatLng(this._getMiddleLatLng(t._prev,t)),t._middleRight&&t._middleRight.setLatLng(this._getMiddleLatLng(t,t._next)),this._poly._bounds._southWest=L.latLng(1/0,1/0),this._poly._bounds._northEast=L.latLng(-1/0,-1/0),this._poly.getLatLngs());this._poly._convertLatLngs(i,!0),this._poly.redraw(),this._poly.fire("editdrag")},_onMarkerClick:function(t){var e=L.Polygon&&this._poly instanceof L.Polygon?4:3,t=t.target;this._defaultShape().length<e||(this._removeMarker(t),this._updatePrevNext(t._prev,t._next),t._middleLeft&&this._markerGroup.removeLayer(t._middleLeft),t._middleRight&&this._markerGroup.removeLayer(t._middleRight),t._prev&&t._next?this._createMiddleMarker(t._prev,t._next):t._prev?t._next||(t._prev._middleRight=null):t._next._middleLeft=null,this._fireEdit())},_onContextMenu:function(t){var t=t.target;this._poly,this._poly._map.fire(L.Draw.Event.MARKERCONTEXT,{marker:t,layers:this._markerGroup,poly:this._poly}),L.DomEvent.stopPropagation},_onTouchMove:function(t){var e=this._map.mouseEventToLayerPoint(t.originalEvent.touches[0]),e=this._map.layerPointToLatLng(e),t=t.target;L.extend(t._origLatLng,e),t._middleLeft&&t._middleLeft.setLatLng(this._getMiddleLatLng(t._prev,t)),t._middleRight&&t._middleRight.setLatLng(this._getMiddleLatLng(t,t._next)),this._poly.redraw(),this.updateMarkers()},_updateIndexes:function(e,i){this._markerGroup.eachLayer(function(t){t._index>e&&(t._index+=i)})},_createMiddleMarker:function(e,i){var o,a,t,n=this._getMiddleLatLng(e,i),s=this._createMarker(n);s.setOpacity(.6),e._middleRight=i._middleLeft=s,a=function(){s.off("touchmove",a,this);var t=i._index;s._index=t,s.off("click",o,this).on("click",this._onMarkerClick,this),n.lat=s.getLatLng().lat,n.lng=s.getLatLng().lng,this._spliceLatLngs(t,0,n),this._markers.splice(t,0,s),s.setOpacity(1),this._updateIndexes(t,1),i._index++,this._updatePrevNext(e,s),this._updatePrevNext(s,i),this._poly.fire("editstart")},t=function(){s.off("dragstart",a,this),s.off("dragend",t,this),s.off("touchmove",a,this),this._createMiddleMarker(e,s),this._createMiddleMarker(s,i)},o=function(){a.call(this),t.call(this),this._fireEdit()},s.on("click",o,this).on("dragstart",a,this).on("dragend",t,this).on("touchmove",a,this),this._markerGroup.addLayer(s)},_updatePrevNext:function(t,e){t&&(t._next=e),e&&(e._prev=t)},_getMiddleLatLng:function(t,e){var i=this._poly._map,t=i.project(t.getLatLng()),e=i.project(e.getLatLng());return i.unproject(t._add(e)._divideBy(2))}}),L.Polyline.addInitHook(function(){this.editing||(L.Edit.Poly&&(this.editing=new L.Edit.Poly(this),this.options.editable)&&this.editing.enable(),this.on("add",function(){this.editing&&this.editing.enabled()&&this.editing.addHooks()}),this.on("remove",function(){this.editing&&this.editing.enabled()&&this.editing.removeHooks()}))}),L.Edit=L.Edit||{},L.Edit.SimpleShape=L.Handler.extend({options:{moveIcon:new L.DivIcon({iconSize:new L.Point(8,8),className:"leaflet-div-icon leaflet-editing-icon leaflet-edit-move"}),resizeIcon:new L.DivIcon({iconSize:new L.Point(8,8),className:"leaflet-div-icon leaflet-editing-icon leaflet-edit-resize"}),touchMoveIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:"leaflet-div-icon leaflet-editing-icon leaflet-edit-move leaflet-touch-icon"}),touchResizeIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:"leaflet-div-icon leaflet-editing-icon leaflet-edit-resize leaflet-touch-icon"})},initialize:function(t,e){L.Browser.touch&&(this.options.moveIcon=this.options.touchMoveIcon,this.options.resizeIcon=this.options.touchResizeIcon),this._shape=t,L.Util.setOptions(this,e)},addHooks:function(){var t=this._shape;this._shape._map&&(this._map=this._shape._map,t.setStyle(t.options.editing),t._map)&&(this._map=t._map,this._markerGroup||this._initMarkers(),this._map.addLayer(this._markerGroup))},removeHooks:function(){var t=this._shape;if(t.setStyle(t.options.original),t._map){this._unbindMarker(this._moveMarker);for(var e=0,i=this._resizeMarkers.length;e<i;e++)this._unbindMarker(this._resizeMarkers[e]);this._resizeMarkers=null,this._map.removeLayer(this._markerGroup),delete this._markerGroup}this._map=null},updateMarkers:function(){this._markerGroup.clearLayers(),this._initMarkers()},_initMarkers:function(){this._markerGroup||(this._markerGroup=new L.LayerGroup),this._createMoveMarker(),this._createResizeMarker()},_createMoveMarker:function(){},_createResizeMarker:function(){},_createMarker:function(t,e){var t=new L.Marker.Touch(t,{draggable:!0,icon:e,zIndexOffset:10});return this._bindMarker(t),this._markerGroup.addLayer(t),t},_bindMarker:function(t){t.on("dragstart",this._onMarkerDragStart,this).on("drag",this._onMarkerDrag,this).on("dragend",this._onMarkerDragEnd,this).on("touchstart",this._onTouchStart,this).on("touchmove",this._onTouchMove,this).on("MSPointerMove",this._onTouchMove,this).on("touchend",this._onTouchEnd,this).on("MSPointerUp",this._onTouchEnd,this)},_unbindMarker:function(t){t.off("dragstart",this._onMarkerDragStart,this).off("drag",this._onMarkerDrag,this).off("dragend",this._onMarkerDragEnd,this).off("touchstart",this._onTouchStart,this).off("touchmove",this._onTouchMove,this).off("MSPointerMove",this._onTouchMove,this).off("touchend",this._onTouchEnd,this).off("MSPointerUp",this._onTouchEnd,this)},_onMarkerDragStart:function(t){t.target.setOpacity(0),this._shape.fire("editstart")},_fireEdit:function(){this._shape.edited=!0,this._shape.fire("edit")},_onMarkerDrag:function(t){var t=t.target,e=t.getLatLng();t===this._moveMarker?this._move(e):this._resize(e),this._shape.redraw(),this._shape.fire("editdrag")},_onMarkerDragEnd:function(t){t.target.setOpacity(1),this._fireEdit()},_onTouchStart:function(t){var e,t,i;L.Edit.SimpleShape.prototype._onMarkerDragStart.call(this,t),"function"==typeof this._getCorners&&(e=this._getCorners(),i=(t=t.target)._cornerIndex,t.setOpacity(0),this._oppositeCorner=e[(i+2)%4],this._toggleCornerMarkers(0,i)),this._shape.fire("editstart")},_onTouchMove:function(t){var e=this._map.mouseEventToLayerPoint(t.originalEvent.touches[0]),e=this._map.layerPointToLatLng(e);return t.target===this._moveMarker?this._move(e):this._resize(e),this._shape.redraw(),!1},_onTouchEnd:function(t){t.target.setOpacity(1),this.updateMarkers(),this._fireEdit()},_move:function(){},_resize:function(){}}),L.Edit=L.Edit||{},L.Edit.Rectangle=L.Edit.SimpleShape.extend({_createMoveMarker:function(){var t,e=this._shape.getBounds().getCenter();this._moveMarker=this._createMarker(e,this.options.moveIcon)},_createResizeMarker:function(){var t=this._getCorners();this._resizeMarkers=[];for(var e=0,i=t.length;e<i;e++)this._resizeMarkers.push(this._createMarker(t[e],this.options.resizeIcon)),this._resizeMarkers[e]._cornerIndex=e},_onMarkerDragStart:function(t){L.Edit.SimpleShape.prototype._onMarkerDragStart.call(this,t);var e=this._getCorners(),i,t=t.target._cornerIndex;this._oppositeCorner=e[(t+2)%4],this._toggleCornerMarkers(0,t)},_onMarkerDragEnd:function(t){var e,i,o=t.target;o===this._moveMarker&&(i=(e=this._shape.getBounds()).getCenter(),o.setLatLng(i)),this._toggleCornerMarkers(1),this._repositionCornerMarkers(),L.Edit.SimpleShape.prototype._onMarkerDragEnd.call(this,t)},_move:function(t){for(var e,i=this._shape._defaultShape?this._shape._defaultShape():this._shape.getLatLngs(),o,a=this._shape.getBounds().getCenter(),n=[],s=0,r=i.length;s<r;s++)e=[i[s].lat-a.lat,i[s].lng-a.lng],n.push([t.lat+e[0],t.lng+e[1]]);this._shape.setLatLngs(n),this._repositionCornerMarkers(),this._map.fire(L.Draw.Event.EDITMOVE,{layer:this._shape})},_resize:function(t){var t;this._shape.setBounds(L.latLngBounds(t,this._oppositeCorner)),t=this._shape.getBounds(),this._moveMarker.setLatLng(t.getCenter()),this._map.fire(L.Draw.Event.EDITRESIZE,{layer:this._shape})},_getCorners:function(){var t=this._shape.getBounds();return[t.getNorthWest(),t.getNorthEast(),t.getSouthEast(),t.getSouthWest
3()]},_toggleCornerMarkers:function(t){for(var e=0,i=this._resizeMarkers.length;e<i;e++)this._resizeMarkers[e].setOpacity(t)},_repositionCornerMarkers:function(){for(var t=this._getCorners(),e=0,i=this._resizeMarkers.length;e<i;e++)this._resizeMarkers[e].setLatLng(t[e])}}),L.Rectangle.addInitHook(function(){L.Edit.Rectangle&&(this.editing=new L.Edit.Rectangle(this),this.options.editable)&&this.editing.enable()}),L.Edit=L.Edit||{},L.Edit.CircleMarker=L.Edit.SimpleShape.extend({_createMoveMarker:function(){var t=this._shape.getLatLng();this._moveMarker=this._createMarker(t,this.options.moveIcon)},_createResizeMarker:function(){this._resizeMarkers=[]},_move:function(t){var e;this._resizeMarkers.length&&(e=this._getResizeMarkerPoint(t),this._resizeMarkers[0].setLatLng(e)),this._shape.setLatLng(t),this._map.fire(L.Draw.Event.EDITMOVE,{layer:this._shape})}}),L.CircleMarker.addInitHook(function(){L.Edit.CircleMarker&&(this.editing=new L.Edit.CircleMarker(this),this.options.editable)&&this.editing.enable(),this.on("add",function(){this.editing&&this.editing.enabled()&&this.editing.addHooks()}),this.on("remove",function(){this.editing&&this.editing.enabled()&&this.editing.removeHooks()})}),L.Edit=L.Edit||{},L.Edit.Circle=L.Edit.CircleMarker.extend({_createResizeMarker:function(){var t=this._shape.getLatLng(),t=this._getResizeMarkerPoint(t);this._resizeMarkers=[],this._resizeMarkers.push(this._createMarker(t,this.options.resizeIcon))},_getResizeMarkerPoint:function(t){var e=this._shape._radius*Math.cos(Math.PI/4),t=this._map.project(t);return this._map.unproject([t.x+e,t.y-e])},_resize:function(t){var e=this._moveMarker.getLatLng();radius=L.GeometryUtil.isVersion07x()?e.distanceTo(t):this._map.distance(e,t),this._shape.setRadius(radius),this._map.editTooltip&&this._map._editTooltip.updateContent({text:L.drawLocal.edit.handlers.edit.tooltip.subtext+"<br />"+L.drawLocal.edit.handlers.edit.tooltip.text,subtext:L.drawLocal.draw.handlers.circle.radius+": "+L.GeometryUtil.readableDistance(radius,!0,this.options.feet,this.options.nautic)}),this._shape.setRadius(radius),this._map.fire(L.Draw.Event.EDITRESIZE,{layer:this._shape})}}),L.Circle.addInitHook(function(){L.Edit.Circle&&(this.editing=new L.Edit.Circle(this),this.options.editable)&&this.editing.enable()}),L.Map.mergeOptions({touchExtend:!0}),L.Map.TouchExtend=L.Handler.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane},addHooks:function(){L.DomEvent.on(this._container,"touchstart",this._onTouchStart,this),L.DomEvent.on(this._container,"touchend",this._onTouchEnd,this),L.DomEvent.on(this._container,"touchmove",this._onTouchMove,this),this._detectIE()?(L.DomEvent.on(this._container,"MSPointerDown",this._onTouchStart,this),L.DomEvent.on(this._container,"MSPointerUp",this._onTouchEnd,this),L.DomEvent.on(this._container,"MSPointerMove",this._onTouchMove,this),L.DomEvent.on(this._container,"MSPointerCancel",this._onTouchCancel,this)):(L.DomEvent.on(this._container,"touchcancel",this._onTouchCancel,this),L.DomEvent.on(this._container,"touchleave",this._onTouchLeave,this))},removeHooks:function(){L.DomEvent.off(this._container,"touchstart",this._onTouchStart,this),L.DomEvent.off(this._container,"touchend",this._onTouchEnd,this),L.DomEvent.off(this._container,"touchmove",this._onTouchMove,this),this._detectIE()?(L.DomEvent.off(this._container,"MSPointerDown",this._onTouchStart,this),L.DomEvent.off(this._container,"MSPointerUp",this._onTouchEnd,this),L.DomEvent.off(this._container,"MSPointerMove",this._onTouchMove,this),L.DomEvent.off(this._container,"MSPointerCancel",this._onTouchCancel,this)):(L.DomEvent.off(this._container,"touchcancel",this._onTouchCancel,this),L.DomEvent.off(this._container,"touchleave",this._onTouchLeave,this))},_touchEvent:function(t,e){var i={};if(void 0!==t.touches){if(!t.touches.length)return;i=t.touches[0]}else{if("touch"!==t.pointerType)return;if(!this._filterClick(i=t))return}var o=this._map.mouseEventToContainerPoint(i),a=this._map.mouseEventToLayerPoint(i),n=this._map.layerPointToLatLng(
3a);this._map.fire(e,{latlng:n,layerPoint:a,containerPoint:o,pageX:i.pageX,pageY:i.pageY,originalEvent:t})},_filterClick:function(t){var e=t.timeStamp||t.originalEvent.timeStamp,i=L.DomEvent._lastClick&&e-L.DomEvent._lastClick;return i&&100<i&&i<500||t.target._simulatedClick&&!t._simulated?(L.DomEvent.stop(t),!1):(L.DomEvent._lastClick=e,!0)},_onTouchStart:function(t){this._map._loaded&&this._touchEvent(t,"touchstart")},_onTouchEnd:function(t){this._map._loaded&&this._touchEvent(t,"touchend")},_onTouchCancel:function(t){var e;this._map._loaded&&(e="touchcancel",this._detectIE()&&(e="pointercancel"),this._touchEvent(t,e))},_onTouchLeave:function(t){this._map._loaded&&this._touchEvent(t,"touchleave")},_onTouchMove:function(t){this._map._loaded&&this._touchEvent(t,"touchmove")},_detectIE:function(){var t=o.navigator.userAgent,e=t.indexOf("MSIE "),e,e;return 0<e?parseInt(t.substring(e+5,t.indexOf(".",e)),10):0<t.indexOf("Trident/")?(e=t.indexOf("rv:"),parseInt(t.substring(e+3,t.indexOf(".",e)),10)):0<(e=t.indexOf("Edge/"))&&parseInt(t.substring(e+5,t.indexOf(".",e)),10)}}),L.Map.addInitHook("addHandler","touchExtend",L.Map.TouchExtend),L.Marker.Touch=L.Marker.extend({_initInteraction:function(){return this.addInteractiveTarget?L.Marker.prototype._initInteraction.apply(this):this._initInteractionLegacy()},_initInteractionLegacy:function(){if(this.options.clickable){var t=this._icon,e=["dblclick","mousedown","mouseover","mouseout","contextmenu","touchstart","touchend","touchmove"];this._detectIE?e.concat(["MSPointerDown","MSPointerUp","MSPointerMove","MSPointerCancel"]):e.concat(["touchcancel"]),L.DomUtil.addClass(t,"leaflet-clickable"),L.DomEvent.on(t,"click",this._onMouseClick,this),L.DomEvent.on(t,"keypress",this._onKeyPress,this);for(var i=0;i<e.length;i++)L.DomEvent.on(t,e[i],this._fireMouseEvent,this);L.Handler.MarkerDrag&&(this.dragging=new L.Handler.MarkerDrag(this),this.options.draggable)&&this.dragging.enable()}},_detectIE:function(){var t=o.navigator.userAgent,e=t.indexOf("MSIE "),e,e;return 0<e?parseInt(t.substring(e+5,t.indexOf(".",e)),10):0<t.indexOf("Trident/")?(e=t.indexOf("rv:"),parseInt(t.substring(e+3,t.indexOf(".",e)),10)):0<(e=t.indexOf("Edge/"))&&parseInt(t.substring(e+5,t.indexOf(".",e)),10)}}),L.LatLngUtil={cloneLatLngs:function(t){for(var e=[],i=0,o=t.length;i<o;i++)Array.isArray(t[i])?e.push(L.LatLngUtil.cloneLatLngs(t[i])):e.push(this.cloneLatLng(t[i]));return e},cloneLatLng:function(t){return L.latLng(t.lat,t.lng)}},s={km:2,ha:2,m:0,mi:2,ac:2,yd:0,ft:0,nm:2},L.GeometryUtil=L.extend(L.GeometryUtil||{},{geodesicArea:function(t){var e,i,o=t.length,a=0,n=Math.PI/180;if(2<o){for(var s=0;s<o;s++)e=t[s],a+=((i=t[(s+1)%o]).lng-e.lng)*n*(2+Math.sin(e.lat*n)+Math.sin(i.lat*n));a=6378137*a*6378137/2}return Math.abs(a)},formattedNumber:function(t,e){var t=parseFloat(t).toFixed(e),e=L.drawLocal.format&&L.drawLocal.format.numeric,e=e&&e.delimiters,i=e&&e.thousands,e=e&&e.decimal,o,t,e;return t=(i||e)&&(o=t.split("."),t=i?o[0].replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+i):o[0],e=e||".",1<o.length)?t+e+o[1]:t},readableArea:function(t,e,i){var e,o,i=L.Util.extend({},s,i),e=e?(o=["ha","m"],"string"===(type=typeof e)?o=[e]:"boolean"!==type&&(o=e),1e6<=t&&-1!==o.indexOf("km")?L.GeometryUtil.formattedNumber(1e-6*t,i.km)+" km²":1e4<=t&&-1!==o.indexOf("ha")?L.GeometryUtil.formattedNumber(1e-4*t,i.ha)+" ha":L.GeometryUtil.formattedNumber(t,i.m)+" m²"):3097600<=(t/=.836127)?L.GeometryUtil.formattedNumber(t/3097600,i.mi)+" mi²":4840<=t?L.GeometryUtil.formattedNumber(t/4840,i.ac)+" acres":L.GeometryUtil.formattedNumber(t,i.yd)+" yd²";return e},readableDistance:function(t,e,i,o,a){var n,a=L.Util.extend({},s,a);switch(e?"string"==typeof e?e:"metric":i?"feet":o?"nauticalMile":"yards"){case"metric":n=1e3<t?L.GeometryUtil.formattedNumber(t/1e3,a.km)+" km":L.GeometryUtil.formattedNumber(t,a.m)+" m";break;case"feet":t*=3.28083,n=L.GeometryUtil.formattedNumber(t,a.ft)+" ft";break;case"nauticalMile":t*=.53996,n=L.GeometryUtil.formattedNumber(t/1e3,a.nm)+" nm";break;default:n=1760<(t*=1.09361)?L.GeometryUtil.formattedNumber(t/1760,a.mi)+" miles":L.GeometryUtil.formattedNumber(t,a.yd)+" yd"}return n},isVersion07x:function(){var t=L.version.split(".");return 0===parseInt(t[0],10)&&7===parseInt(t[1],10)}}
3),L.Util.extend(L.LineUtil,{segmentsIntersect:function(t,e,i,o){return this._checkCounterclockwise(t,i,o)!==this._checkCounterclockwise(e,i,o)&&this._checkCounterclockwise(t,e,i)!==this._checkCounterclockwise(t,e,o)},_checkCounterclockwise:function(t,e,i){return(i.y-t.y)*(e.x-t.x)>(e.y-t.y)*(i.x-t.x)}}),L.Polyline.include({intersects:function(){var t,e,i,o=this._getProjectedPoints(),a=o?o.length:0;if(!this._tooFewPointsForIntersection())for(t=a-1;3<=t;t--)if(e=o[t-1],i=o[t],this._lineSegmentsIntersectsRange(e,i,t-2))return!0;return!1},newLatLngIntersects:function(t,e){return!!this._map&&this.newPointIntersects(this._map.latLngToLayerPoint(t),e)},newPointIntersects:function(t,e){var i=this._getProjectedPoints(),o=i?i.length:0,i=i?i[o-1]:null,o=o-2;return!this._tooFewPointsForIntersection(1)&&this._lineSegmentsIntersectsRange(i,t,o,e?1:0)},_tooFewPointsForIntersection:function(t){var e=this._getProjectedPoints(),i=e?e.length:0;return i+=t||0,!e||i<=3},_lineSegmentsIntersectsRange:function(t,e,i,o){var a,n,s=this._getProjectedPoints();o=o||0;for(var r=i;o<r;r--)if(a=s[r-1],n=s[r],L.LineUtil.segmentsIntersect(t,e,a,n))return!0;return!1},_getProjectedPoints:function(){if(!this._defaultShape)return this._originalPoints;for(var t=[],e=this._defaultShape(),i=0;i<e.length;i++)t.push(this._map.latLngToLayerPoint(e[i]));return t}}),L.Polygon.include({intersects:function(){var t,e,i,o,i=this._getProjectedPoints();return!this._tooFewPointsForIntersection()&&(!!L.Polyline.prototype.intersects.call(this)||(t=i.length,e=i[0],i=i[t-1],this._lineSegmentsIntersectsRange(i,e,o=t-2,1)))}}),L.Control.Draw=L.Control.extend({options:{position:"topleft",draw:{},edit:!1},initialize:function(t){if(L.version<"0.7")throw new Error("Leaflet.draw 0.2.3+ requires Leaflet 0.7.0+. Download latest from https://github.com/Leaflet/Leaflet/");var e;L.Control.prototype.initialize.call(this,t),this._toolbars={},L.DrawToolbar&&this.options.draw&&(e=new L.DrawToolbar(this.options.draw),this._toolbars[L.DrawToolbar.TYPE]=e,this._toolbars[L.DrawToolbar.TYPE].on("enable",this._toolbarEnabled,this)),L.EditToolbar&&this.options.edit&&(e=new L.EditToolbar(this.options.edit),this._toolbars[L.EditToolbar.TYPE]=e,this._toolbars[L.EditToolbar.TYPE].on("enable",this._toolbarEnabled,this)),L.toolbar=this},onAdd:function(t){var e,i=L.DomUtil.create("div","leaflet-draw"),o=!1,a;for(a in this._toolbars)this._toolbars.hasOwnProperty(a)&&(e=this._toolbars[a].addToolbar(t))&&(o||(L.DomUtil.hasClass(e,"leaflet-draw-toolbar-top")||L.DomUtil.addClass(e.childNodes[0],"leaflet-draw-toolbar-top"),o=!0),i.appendChild(e));return i},onRemove:function(){for(var t in this._toolbars)this._toolbars.hasOwnProperty(t)&&this._toolbars[t].removeToolbar()},setDrawingOptions:function(t){for(var e in this._toolbars)this._toolbars[e]instanceof L.DrawToolbar&&this._toolbars[e].setOptions(t)},_toolbarEnabled:function(t){var e=t.target,i;for(i in this._toolbars)this._toolbars[i]!==e&&this._toolbars[i].disable()}}),L.Map.mergeOptions({drawControlTooltips:!0,drawControl:!1}),L.Map.addInitHook(function(){this.options.drawControl&&(this.drawControl=new L.Control.Draw,this.addControl(this.drawControl))}),L.Toolbar=L.Class.extend({initialize:function(t){L.setOptions(this,t),this._modes={},this._actionButtons=[],this._activeMode=null;var t=L.version.split(".");1===parseInt(t[0],10)&&2<=parseInt(t[1],10)?L.Toolbar.include(L.Evented.prototype):L.Toolbar.include(L.Mixin.Events)},enabled:function(){return null!==this._activeMode},disable:function(){this.enabled()&&this._activeMode.handler.disable()},addToolbar:function(t){var e,i=L.DomUtil.create("div","leaflet-draw-section"),o=0,a=this._toolbarClass||"",n=this.getModeHandlers(t);for(this._toolbarContainer=L.DomUtil.create("div","leaflet-draw-toolbar leaflet-bar"),this._map=t,e=0;e<n.length;e++)n[e].enabled&&this._initModeHandler(n[e].handler,this._toolbarContainer,o++,a,n[e].title);if(o)return this._lastButtonIndex=--o,this._actionsContainer=L.DomUtil.create("ul","leaflet-draw-actions"),i.appendChild(this._toolbarContainer),i.appendChild(this._actionsContainer),i},removeToolbar:function(){for(var t in this._modes)this._modes.hasOwnProperty(t)&&(this._disposeButton(this._modes[t].button,this._modes[t].handler.enable,this._modes[t].handler),this._modes[t].handler.disable(),this._modes[t].handler.off("enabled",this._handlerActivated,this).off("disabled",this._handlerDeactivated,this));this._modes={};for(var e=0,i=this._actionButtons.length;e<i;e++)this._disposeButton(this._actionButtons[e].button,this._actionButtons[e].callback,this);this._actionButtons=[],this._actionsContainer=null}
vendor: 4,265 bytes, line 3
3,_initModeHandler:function(t,e,i,o,a){var n=t.type;this._modes[n]={},this._modes[n].handler=t,this._modes[n].button=this._createButton({type:n,title:a,className:o+"-"+n,container:e,callback:this._modes[n].handler.enable,context:this._modes[n].handler}),this._modes[n].buttonIndex=i,this._modes[n].handler.on("enabled",this._handlerActivated,this).on("disabled",this._handlerDeactivated,this)},_detectIOS:function(){return/iPad|iPhone|iPod/.test(navigator.userAgent)&&!o.MSStream},_createButton:function(t){var e=L.DomUtil.create("a",t.className||"",t.container),i=L.DomUtil.create("span","sr-only",t.container),i=(e.href="#",e.appendChild(i),t.title&&(e.title=t.title,i.innerHTML=t.title),t.text&&(e.innerHTML=t.text,i.innerHTML=t.text),this._detectIOS()?"touchstart":"click");return L.DomEvent.on(e,"click",L.DomEvent.stopPropagation).on(e,"mousedown",L.DomEvent.stopPropagation).on(e,"dblclick",L.DomEvent.stopPropagation).on(e,"touchstart",L.DomEvent.stopPropagation).on(e,"click",L.DomEvent.preventDefault).on(e,i,t.callback,t.context),e},_disposeButton:function(t,e){var i=this._detectIOS()?"touchstart":"click";L.DomEvent.off(t,"click",L.DomEvent.stopPropagation).off(t,"mousedown",L.DomEvent.stopPropagation).off(t,"dblclick",L.DomEvent.stopPropagation).off(t,"touchstart",L.DomEvent.stopPropagation).off(t,"click",L.DomEvent.preventDefault).off(t,i,e)},_handlerActivated:function(t){this.disable(),this._activeMode=this._modes[t.handler],L.DomUtil.addClass(this._activeMode.button,"leaflet-draw-toolbar-button-enabled"),this._showActionsToolbar(),this.fire("enable")},_handlerDeactivated:function(){this._hideActionsToolbar(),L.DomUtil.removeClass(this._activeMode.button,"leaflet-draw-toolbar-button-enabled"),this._activeMode=null,this.fire("disable")},_createActions:function(t){for(var e,i,o,e,a=this._actionsContainer,n=this.getActions(t),s=n.length,i=0,o=this._actionButtons.length;i<o;i++)this._disposeButton(this._actionButtons[i].button,this._actionButtons[i].callback);for(this._actionButtons=[];a.firstChild;)a.removeChild(a.firstChild);for(var r=0;r<s;r++)"enabled"in n[r]&&!n[r].enabled||(e=L.DomUtil.create("li","",a),e=this._createButton({title:n[r].title,text:n[r].text,container:e,callback:n[r].callback,context:n[r].context}),this._actionButtons.push({button:e,callback:n[r].callback}))},_showActionsToolbar:function(){var t=this._activeMode.buttonIndex,e=this._lastButtonIndex,i=this._activeMode.button.offsetTop-1;this._createActions(this._activeMode.handler),this._actionsContainer.style.top=i+"px",0===t&&(L.DomUtil.addClass(this._toolbarContainer,"leaflet-draw-toolbar-notop"),L.DomUtil.addClass(this._actionsContainer,"leaflet-draw-actions-top")),t===e&&(L.DomUtil.addClass(this._toolbarContainer,"leaflet-draw-toolbar-nobottom"),L.DomUtil.addClass(this._actionsContainer,"leaflet-draw-actions-bottom")),this._actionsContainer.style.display="block",this._map.fire(L.Draw.Event.TOOLBAROPENED)},_hideActionsToolbar:function(){this._actionsContainer.style.display="none",L.DomUtil.removeClass(this._toolbarContainer,"leaflet-draw-toolbar-notop"),L.DomUtil.removeClass(this._toolbarContainer,"leaflet-draw-toolbar-nobottom"),L.DomUtil.removeClass(this._actionsContainer,"leaflet-draw-actions-top"),L.DomUtil.removeClass(this._actionsContainer,"leaflet-draw-actions-bottom"),this._map.fire(L.Draw.Event.TOOLBARCLOSED)}}),L.Draw=L.Draw||{},L.Draw.Tooltip=L.Class.extend({initialize:function(t){this._map=t,this._popupPane=t._panes.popupPane,this._visible=!1,this._container=t.options.drawControlTooltips?L.DomUtil.create("div","leaflet-draw-tooltip",this._popupPane):null,this._singleLineLabel=!1,this._map.on("mouseout",this._onMouseOut,this)},dispose:function(){this._map.off("mouseout",this._onMouseOut,this),this._container&&(this._popupPane.removeChild(this._container),this._container=null)},updateContent:function(t){return this._container&&(t.subtext=t.subtext||"",0!==t.subtext.length||this._singleLineLabel?0<t.subtext.length&&this._singleLineLabel&&(L.DomUtil.removeClass(this._container,"leaflet-draw-tooltip-single"),this._singleLineLabel=!1):(L.DomUtil.addClass(this._container,"leaflet-draw-tooltip-single"),this._singleLineLabel=!0),this._container.innerHTML=(0<t.subtext.length?'<span class="leaflet-draw-tooltip-subtext">
3'+t.subtext+"</span><br />":"")+"<span>"+t.text+"</span>",t.text||t.subtext?(this._visible=!0,this._container.style.visibility="inherit"):(this._visible=!1,this._container.style.visibility="hidden")),this},updatePosition:function(t){var t=this._map.latLngToLayerPoint(t),e=this._container;return this._container&&(this._visible&&(e.style.visibility="inherit"),L.DomUtil.setPosition(e,t)),this},showAsError:function(){return this._container&&L.DomUtil.addClass(this._container,"leaflet-error-draw-tooltip"),this},removeError:function(){return this._container&&L.DomUtil.removeClass(this._container,"leaflet-error-draw-tooltip"),this},_onMouseOut:function(){this._container&&(this._container.style.visibility="hidden")}}),L.DrawToolbar=L.Toolbar.extend({statics:{TYPE:"draw"},options:{polyline:{},polygon:{},rectangle:{},circle:{},marker:{},circlemarker:{}},initialize:function(t){for(var e in this.options)this.options.hasOwnProperty(e)&&t[e]&&(t[e]=L.extend({},this.options[e],t[e]));this._toolbarClass="leaflet-draw-draw",L.Toolbar.prototype.initialize.call(this,t)},getModeHandlers:function(t){return[{enabled:this.options.polyline,handler:new L.Draw.Polyline(t,this.options.polyline),title:L.drawLocal.draw.toolbar.buttons.polyline},{enabled:this.options.polygon,handler:new L.Draw.Polygon(t,this.options.polygon),title:L.drawLocal.draw.toolbar.buttons.polygon},{enabled:this.options.rectangle,handler:new L.Draw.Rectangle(t,this.options.rectangle),title:L.drawLocal.draw.toolbar.buttons.rectangle},{enabled:this.options.circle,handler:new L.Draw.Circle(t,this.options.circle),title:L.drawLocal.draw.toolbar.buttons.circle},{enabled:this.options.marker,handler:new L.Draw.Marker(t,this.options.marker),title:L.drawLocal.draw.toolbar.buttons.marker},{enabled:this.options.circlemarker,handler:new L.Draw.CircleMarker(t,this.options.circlemarker),title:L.drawLocal.draw.toolbar.buttons.circlemarker}]},getActions:function(t){return[{enabled:t.completeShape,title:L.drawLocal.draw.toolbar.finish.title,text:L.drawLocal.draw.toolbar.finish.text,callback:t.completeShape,context:t},{enabled:t.deleteLastVertex,title:L.drawLocal.draw.toolbar.undo.title,text:L.drawLocal.draw.toolbar.undo.text,callback:t.deleteLastVertex,context:t},{title:L.drawLocal.draw.toolbar.actions.title,text:L.drawLocal.draw.toolbar.actions.text,callback:this.disable,context:this}]},setOptions:function(t){for(var e in L.setOptions(this,t),this._modes)this._modes.hasOwnProperty(e)&&t.hasOwnProperty(e)&&this._modes[e].handler.setOptions(t[e])}}),L.EditToolbar=L.Toolbar.extend({statics:{TYPE:"edit"},options:{edit:{selectedPathOptions:{dashArray:"10, 10",fill:!0,fillColor:"#fe57a1",fillOpacity:.1,maintainColor:!1}},remove:{},poly:null,featureGroup:null},initialize:function(t){t.edit&&(void 0===t.edit.selectedPathOptions&&(t.edit.selectedPathOptions=this.options.edit.selectedPathOptions),t.edit.selectedPathOptions=L.extend({},this.options.edit.selectedPathOptions,t.edit.selectedPathOptions)),t.remove&&(t.remove=L.extend({},this.options.remove,t.remove)),t.poly&&(t.poly=L.extend({},this.options.poly,t.poly)),this._toolbarClass="leaflet-draw-edit",L.Toolbar.prototype.initialize.call(this,t),this._selectedFeatureCount=0},getModeHandlers:function(t){var e=this.options.featureGroup;return[{enabled:this.options.edit,handler:new L.EditToolbar.Edit(t,{featureGroup:e,selectedPathOptions:this.options.edit.selectedPathOptions,poly:this.options.poly}),title:L.drawLocal.edit.toolbar.buttons.edit},{enabled:this.options.remove,handler:new L.EditToolbar.Delete(t,{featureGroup:e}),title:L.drawLocal.edit.toolbar.buttons.remove}]},getActions:function(t){var e=[{title:L.drawLocal.edit.toolbar.actions.save.title,text:L.drawLocal.edit.toolbar.actions.save.text,callback:this._save,context:this},{title:L.drawLocal.edit.toolbar.actions.cancel.title,text:L.drawLocal.edit.toolbar.actions.cancel.text,callback:this.disable,context:this}];return t.removeAllLayers&&e.push({title:L.drawLocal.edit.toolbar.actions.clearAll.title,text:L.drawLocal.edit.toolbar.actions.clearAll.text,callback:this._clearAllLayers,context:this}),e},addToolbar:function(t){var t=L.Toolbar.prototype.addToolbar.call(this,t);return this._checkDisabled(),this.options.featureGroup.on("layeradd layerremove",this._checkDisabled,this),t},removeToolbar:function(){this.options.featureGroup.off("layeradd layerremove",this._checkDisabled,this),L.Toolbar.prototype.removeToolbar.call(this)},disable:function(){this.enabled()&&(this._activeMode.handler.revertLayers(),L.Toolbar.prototype.disable.call(this))},_save:function(){this._activeMode.handler.save(),this._activeMode&&this._activeMode.handler.disable()},_clearAllLayers:function(){this._activeMode.handler.removeAllLayers(),this._activeMode&&this._activeMode.handler.disable()},_checkDisabled:function(){var t,e,i=0!==this.options.featureGroup.getLayers().length;this.options.edit&&(t=this._modes[L.EditToolbar.Edit.TYPE].button,i?L.DomUtil.removeClass(t,"leaflet-disabled"):L.DomUtil.addClass(t,"leaflet-disabled"),t.setAttribute("title",i?L.drawLocal.edit.toolbar.buttons.edit:L.drawLocal.edit.toolbar.buttons.editDisabled)),this.options.remove&&(t=this._modes[L.EditToolbar.Delete.TYPE].button,i?L.DomUtil.removeClass(t,"leaflet-disabled"):L.DomUtil.addClass(t,"leaflet-disabled"),t.setAttribute("title",i?L.drawLocal.edit.toolbar.buttons.remove:L.drawLocal.edit.toolbar.buttons.removeDisabled))}}),L.EditToolbar.Edit=L.Handler.extend({statics:{TYPE:"edit"},initialize:function(t,e){if(L.Handler.prototype.initialize.call(this,t),L.setOptions(this,e),this._featureGroup=e.featureGroup,!(this._featureGroup instanceof L.FeatureGroup))throw new Error("options.featureGroup must be a L.FeatureGroup");this._uneditedLayerProps={},this.type=L.EditToolbar.Edit.TYPE;var t=L.version.split(".");1===parseInt(t[0],10)&&2<=parseInt(t[1],10)?L.EditToolbar.Edit.include(L.Evented.prototype):L.EditToolbar.Edit.include(L.Mixin.Events)},enable:function(){!this._enabled&&this._hasAvailableLayers()&&(this.fire("enabled",{handler:this.t
vendor: 4,179 bytes, line 3
3ype}),this._map.fire(L.Draw.Event.EDITSTART,{handler:this.type}),L.Handler.prototype.enable.call(this),this._featureGroup.on("layeradd",this._enableLayerEdit,this).on("layerremove",this._disableLayerEdit,this))},disable:function(){this._enabled&&(this._featureGroup.off("layeradd",this._enableLayerEdit,this).off("layerremove",this._disableLayerEdit,this),L.Handler.prototype.disable.call(this),this._map.fire(L.Draw.Event.EDITSTOP,{handler:this.type}),this.fire("disabled",{handler:this.type}))},addHooks:function(){var t=this._map;t&&(t.getContainer().focus(),this._featureGroup.eachLayer(this._enableLayerEdit,this),this._tooltip=new L.Draw.Tooltip(this._map),this._tooltip.updateContent({text:L.drawLocal.edit.handlers.edit.tooltip.text,subtext:L.drawLocal.edit.handlers.edit.tooltip.subtext}),t._editTooltip=this._tooltip,this._updateTooltip(),this._map.on("mousemove",this._onMouseMove,this).on("touchmove",this._onMouseMove,this).on("MSPointerMove",this._onMouseMove,this).on(L.Draw.Event.EDITVERTEX,this._updateTooltip,this))},removeHooks:function(){this._map&&(this._featureGroup.eachLayer(this._disableLayerEdit,this),this._uneditedLayerProps={},this._tooltip.dispose(),this._tooltip=null,this._map.off("mousemove",this._onMouseMove,this).off("touchmove",this._onMouseMove,this).off("MSPointerMove",this._onMouseMove,this).off(L.Draw.Event.EDITVERTEX,this._updateTooltip,this))},revertLayers:function(){this._featureGroup.eachLayer(function(t){this._revertLayer(t)},this)},save:function(){var e=new L.LayerGroup;this._featureGroup.eachLayer(function(t){t.edited&&(e.addLayer(t),t.edited=!1)}),this._map.fire(L.Draw.Event.EDITED,{layers:e})},_backupLayer:function(t){var e=L.Util.stamp(t);this._uneditedLayerProps[e]||(t instanceof L.Polyline||t instanceof L.Polygon||t instanceof L.Rectangle?this._uneditedLayerProps[e]={latlngs:L.LatLngUtil.cloneLatLngs(t.getLatLngs())}:t instanceof L.Circle?this._uneditedLayerProps[e]={latlng:L.LatLngUtil.cloneLatLng(t.getLatLng()),radius:t.getRadius()}:(t instanceof L.Marker||t instanceof L.CircleMarker)&&(this._uneditedLayerProps[e]={latlng:L.LatLngUtil.cloneLatLng(t.getLatLng())}))},_getTooltipText:function(){return{text:L.drawLocal.edit.handlers.edit.tooltip.text,subtext:L.drawLocal.edit.handlers.edit.tooltip.subtext}},_updateTooltip:function(){this._tooltip.updateContent(this._getTooltipText())},_revertLayer:function(t){var e=L.Util.stamp(t);t.edited=!1,this._uneditedLayerProps.hasOwnProperty(e)&&(t instanceof L.Polyline||t instanceof L.Polygon||t instanceof L.Rectangle?t.setLatLngs(this._uneditedLayerProps[e].latlngs):t instanceof L.Circle?(t.setLatLng(this._uneditedLayerProps[e].latlng),t.setRadius(this._uneditedLayerProps[e].radius)):(t instanceof L.Marker||t instanceof L.CircleMarker)&&t.setLatLng(this._uneditedLayerProps[e].latlng),t.fire("revert-edited",{layer:t}))},_enableLayerEdit:function(t){var e,e,t=t.layer||t.target||t;this._backupLayer(t),this.options.poly&&(e=L.Util.extend({},this.options.poly),t.options.poly=e),this.options.selectedPathOptions&&((e=L.Util.extend({},this.options.selectedPathOptions)).maintainColor&&(e.color=t.options.color,e.fillColor=t.options.fillColor),t.options.original=L.extend({},t.options),t.options.editing=e),t instanceof L.Marker?(t.editing&&t.editing.enable(),t.dragging.enable(),t.on("dragend",this._onMarkerDragEnd).on("touchmove",this._onTouchMove,this).on("MSPointerMove",this._onTouchMove,this).on("touchend",this._onMarkerDragEnd,this).on("MSPointerUp",this._onMarkerDragEnd,this)):t.editing.enable()},_disableLayerEdit:function(t){var t=t.layer||t.target||t;t.edited=!1,t.editing&&t.editing.disable(),delete t.options.editing,delete t.options.original,this._selectedPathOptions&&(t instanceof L.Marker?this._toggleMarkerHighlight(t):(t.setStyle(t.options.previousOptions),delete t.options.previousOptions)),t instanceof L.Marker?(t.dragging.disable(),t.off("dragend",this._onMarkerDragEnd,this).off("touchmove",this._onTouchMove,this).off("MSPointerMove",this._onTouchMove,this).off("touchend",this._onMarkerDragEnd,this).off("MSPointerUp",this._onMarkerDragEnd,this)):t.editing.disable()},_onMouseMove:function(t){this._tooltip.updatePosition(t.latlng)}
3,_onMarkerDragEnd:function(t){var t=t.target;t.edited=!0,this._map.fire(L.Draw.Event.EDITMOVE,{layer:t})},_onTouchMove:function(t){var e=t.originalEvent.changedTouches[0],e=this._map.mouseEventToLayerPoint(e),e=this._map.layerPointToLatLng(e);t.target.setLatLng(e)},_hasAvailableLayers:function(){return 0!==this._featureGroup.getLayers().length}}),L.EditToolbar.Delete=L.Handler.extend({statics:{TYPE:"remove"},initialize:function(t,e){if(L.Handler.prototype.initialize.call(this,t),L.Util.setOptions(this,e),this._deletableLayers=this.options.featureGroup,!(this._deletableLayers instanceof L.FeatureGroup))throw new Error("options.featureGroup must be a L.FeatureGroup");this.type=L.EditToolbar.Delete.TYPE;var t=L.version.split(".");1===parseInt(t[0],10)&&2<=parseInt(t[1],10)?L.EditToolbar.Delete.include(L.Evented.prototype):L.EditToolbar.Delete.include(L.Mixin.Events)},enable:function(){!this._enabled&&this._hasAvailableLayers()&&(this.fire("enabled",{handler:this.type}),this._map.fire(L.Draw.Event.DELETESTART,{handler:this.type}),L.Handler.prototype.enable.call(this),this._deletableLayers.on("layeradd",this._enableLayerDelete,this).on("layerremove",this._disableLayerDelete,this))},disable:function(){this._enabled&&(this._deletableLayers.off("layeradd",this._enableLayerDelete,this).off("layerremove",this._disableLayerDelete,this),L.Handler.prototype.disable.call(this),this._map.fire(L.Draw.Event.DELETESTOP,{handler:this.type}),this.fire("disabled",{handler:this.type}))},addHooks:function(){var t=this._map;t&&(t.getContainer().focus(),this._deletableLayers.eachLayer(this._enableLayerDelete,this),this._deletedLayers=new L.LayerGroup,this._tooltip=new L.Draw.Tooltip(this._map),this._tooltip.updateContent({text:L.drawLocal.edit.handlers.remove.tooltip.text}),this._map.on("mousemove",this._onMouseMove,this))},removeHooks:function(){this._map&&(this._deletableLayers.eachLayer(this._disableLayerDelete,this),this._deletedLayers=null,this._tooltip.dispose(),this._tooltip=null,this._map.off("mousemove",this._onMouseMove,this))},revertLayers:function(){this._deletedLayers.eachLayer(function(t){this._deletableLayers.addLayer(t),t.fire("revert-deleted",{layer:t})},this)},save:function(){this._map.fire(L.Draw.Event.DELETED,{layers:this._deletedLayers})},removeAllLayers:function(){this._deletableLayers.eachLayer(function(t){this._removeLayer({layer:t})},this),this.save()},_enableLayerDelete:function(t){(t.layer||t.target||t).on("click",this._removeLayer,this)},_disableLayerDelete:function(t){var t=t.layer||t.target||t;t.off("click",this._removeLayer,this),this._deletedLayers.removeLayer(t)},_removeLayer:function(t){var t=t.layer||t.target||t;this._deletableLayers.removeLayer(t),this._deletedLayers.addLayer(t),t.fire("deleted")},_onMouseMove:function(t){this._tooltip.updatePosition(t.latlng)},_hasAvailableLayers:function(){return 0!==this._deletableLayers.getLayers().length}})})(window,document);
4window.OUMLeaflet||(window.OUMLeaflet={}),window.OUMLeaflet.L=window.L;
5(a=>{let t='<a href="https://openfreemap.org/" target="_blank" rel="noopener noreferrer">OpenFreeMap</a> &copy; <a href="https://openmaptiles.org/" target="_blank" rel="noopener noreferrer">OpenMapTiles</a> Data from <a href="https://www.openstreetmap.org/copyright" target="_blank" rel="noopener noreferrer">OpenStreetMap</a>';function o(){return a.oum_map_style_registry||{}}function n(e){let r=String(e||"").toLowerCase();return Object.keys(o()).find(function(e){return e.toLowerCase()===r})||""}function i(e){var r=n(e);return r?o()[r]:"customimage"===String(e||"").toLowerCase()?{provider:"custom_image"}:p(e)}function p(e){var e=String(e||"").replace(/^OpenFreeMap\./i,"").toLowerCase(),r={liberty:"https://tiles.openfreemap.org/styles/liberty",bright:"https://tiles.openfreemap.org/styles/bright",positron:"https://tiles.openfreemap.org/styles/positron",dark:"https://tiles.openfreemap.org/styles/dark",fiord:"https://tiles.openfreemap.org/styles/fiord"};return r[e]?{provider:"openfreemap",url:r[e]}:null}function s(e){e&&"function"==typeof e.getMaxZoom&&!isFinite(e.getMaxZoom())&&"function"==typeof e.setMaxZoom&&e.setMaxZoom(20)}function l(e,r){return e&&e[r]?e[r]:""}function u(e,r,t){var t=l(t,"cartoKey");return t?a.L.tileLayer.provider(r,{apikey:t}).addTo(e):(console.warn("Open User Map: This CARTO style requires an API key."),null)}function d(e,r,t){var t=l(t,"cartoKey"),t;return t?(t="?key="+encodeURIComponent(t),a.L.tileLayer(r.carto_base_url+t).addTo(e),a.L.tileLayer("https://{s}.basemaps.cartocdn.com/rastertiles/voyager_only_labels/{z}/{x}/{y}{r}.png"+t,{tileSize:512,zoomOffset:-1}).addTo(e)):(console.warn("Open User Map: This CARTO style requires an API key."),null)}function y(e,r,t){var t=l(t,"mapboxKey");return t?a.L.tileLayer.provider("MapBox",{id:r.mapbox_id,accessToken:t}).addTo(e):(console.warn("Open User Map: This MapBox style requires an API key."),null)}function c(e,r){var t;return r&&"function"==typeof r.setupCustomImageLayer&&r.setupCustomImageLayer(),r&&r.customImageHideTiles?(t=a.L.tileLayer("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==",{attribution:"",opacity:0}
5).addTo(e),r.customImageBackgroundColor&&(e.getContainer().style.backgroundColor=r.customImageBackgroundColor),t):a.L.tileLayer.provider("OpenStreetMap.Mapnik").addTo(e)}function f(e,r){return a.L&&"function"==typeof a.L.maplibreGL?(s(e),a.L.maplibreGL({style:r.url,attributionControl:{customAttribution:t}}).addTo(e)):(console.warn("Open User Map: MapLibre assets are required for OpenFreeMap styles."),a.L&&a.L.tileLayer&&a.L.tileLayer.provider?a.L.tileLayer.provider("OpenStreetMap.Mapnik").addTo(e):null)}function e(e,r,t){var o=i(r)||{};return"openfreemap"===o.provider?f(e,o):"custom_image"===o.provider?c(e,t):o.mapbox_id?y(e,o,t):o.carto_base_url?d(e,o,t):"carto"===o.provider?u(e,r,t):a.L.tileLayer.provider(r).addTo(e)}a.OUMMapStyles={getStyleDefinition:i,isOpenFreeMapStyle:function(e){var e=i(e);return!!e&&"openfreemap"===e.provider},addOpenFreeMapLayer:function(e,r){var r=i(r);return r&&"openfreemap"===r.provider?f(e,r):null},addBaseLayer:e}})(window);
6let OUMOpeningHours=(()=>{let e=null,t={mo:"Mo",tu:"Tu",we:"We",th:"Th",fr:"Fr",sa:"Sa",su:"Su"},n={mo:"mo",tu:"tu",we:"we",th:"th",fr:"fr",sa:"sa",su:"su"};function f(){return"undefined"!=typeof oum_opening_hours&&oum_opening_hours?{aliases:oum_opening_hours.day_aliases||n,abbrs:oum_opening_hours.day_abbrs||t}:{aliases:n,abbrs:t}}function r(e){if(!e||"string"!=typeof e)return"";let t=e.trim().replace(/\.+$/,"").toLowerCase();try{t=t.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}catch(e){}return t}function l(e){var e=r(e),t=f().aliases;return e&&t[e]&&t[e]}function p(e){if(!e||"string"!=typeof e)return null;var t=/^(\d{1,2}):(\d{2})\s*(AM|PM)$/i,e=e.trim().match(t);if(!e)return null;let n=parseInt(e[1],10);var t=parseInt(e[2],10),e=e[3].toUpperCase();return t<0||59<t||("AM"===e?12===n&&(n=0):12!==n&&(n+=12),n<0)||23<n?null:String(n).padStart(2,"0")+":"+String(t).padStart(2,"0")}function o(e){if(!e||"string"!=typeof e)return!1;var e=e.trim();if(""===e)return!1;var t,n=/^(\S+)\s+(\d{1,2}):(\d{2})-(\d{1,2}):(\d{2})$/,r=/^(\S+)\s+(\d{1,2}):(\d{2})\s*(AM|PM)-(\d{1,2}):(\d{2})\s*(AM|PM)$/i,o;for(o of e.split("|"))if(""!==(o=o.trim())){var a=o.match(r);if(a){if(!l(a[1]))return!1;var s=a[2]+":"+a[3]+" "+a[4],a=a[5]+":"+a[6]+" "+a[7],s=p(s),a=p(a);if(!s||!a)return!1}else{var s=o.match(n);if(!s||!l(s[1]))return!1;var a=parseInt(s[2],10),u=parseInt(s[3],10),i=parseInt(s[4],10),d=parseInt(s[5],10);if(a<0||23<a||u<0||59<u||i<0||23<i||d<0||59<d)return!1}}return!0}function c(e){if(!e||!e.match(/^\d{2}:\d{2}$/))return e;var e=e.split(":");let t=parseInt(e[0],10);var e=e[1];let n="AM";return 0===t?t=12:12===t?n="PM":12<t&&(t-=12,n="PM"),t+":"+e+" "+n}function a(e,t=!1){if(!e||!e.week)return"";var n=f().abbrs,r=[],o,a;for(a of["mo","tu","we","th","fr","sa","su"]){var s=n[a],u,i,d,l;if(s)for(i of e.week[a]||[]){t?(d=c(i.start),l=c(i.end),r.push(s+` ${d}-`+l)):r.push(`${s} ${i.start}-`+i.end)}}return r.join(" | ")}function s(e){var t;e&&e.querySelectorAll(".oum-opening-hours-header").forEach(function(t){"true"!==t.dataset.oumToggleSetup&&(t.dataset.oumToggleSetup="true",t.addEventListener("click",function(e){e.preventDefault(),u(t)}),t.addEventListener("keydown",function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),u(t))}))})}function u(e){var t=e.nextElementSibling,n;t&&t.classList.contains("oum-opening-hours-wrapper")&&(t.classList.contains("oum-opening-hours-expanded")?(t.classList.remove("oum-opening-hours-expanded"),t.style.display="none",e.classList.remove("oum-opening-hours-expanded")):(t.classList.add("oum-opening-hours-expanded"),t.style.display="block",e.classList.add("oum-opening-hours-expanded")))}function i(){e||(e=new MutationObserver(function(e){e.forEach(function(e){e.addedNodes.length&&e.addedNodes.forEach(function(e){1===e.nodeType&&(e.querySelector&&e.querySelector(".oum-opening-hours-header")&&s(e),e.classList)&&e.classList.contains("oum-opening-hours-header")&&s(e.parentElement)})})})).observe(document.body,{childList:!0,subtree:!0})}function d(){s(document.body),i()}return{validateFormat:o,formatForInput:a,init:d,setupToggle:s}})();
7let sharedMapBounds=null,OUMUtils=(()=>{function e(e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var t,e=new RegExp("[\\?&]"+e+"=([^&#]*)").exec(location.search);return null===e?"":decodeURIComponent(e[1].replace(/\+/g," "))}function t(e,t,o,n,a){if(e="string"==typeof e?parseFloat(e.replace(/['"]+/g,"")):parseFloat(e),t="string"==typeof t?parseFloat(t.replace(/['"]+/g,"")):parseFloat(t),o="string"==typeof o?parseFloat(o.replace(/['"]+/g,"")):parseFloat(o),n="string"==typeof n?parseFloat(n.replace(/['"]+/g,"")):parseFloat(n),a="string"==typeof a?parseFloat(a.replace(/['"]+/g,"")):parseFloat(a),!c(e,t))return console.warn("Invalid coordinates for latLngToBounds, using defaults"),[[OUMConfig.defaults.map.lat,OUMConfig.defaults.map.lng],[OUMConfig.defaults.map.lat,OUMConfig.defaults.map.lng]];(isNaN(n)||n<=0||isNaN(a)||a<=0)&&(console.warn("Invalid dimensions for latLngToBounds"),n=520,a=294),o=isNaN(o)?OUMConfig.defaults.map.zoom:Math.max(1,Math.min(20,o));var r=L.CRS.EPSG3857,e=L.latLng(e,t),t=r.latLngToPoint(e,o),e=n/2,n=a/2,a=L.point(t.x-e,t.y-n),i=L.point(t.x+e,t.y-n),l=L.point(t.x-e,t.y+n),e=L.point(t.x+e,t.y+n),t=r.pointToLatLng(
7a,o),n=r.pointToLatLng(i,o),a=r.pointToLatLng(l,o),i=r.pointToLatLng(e,o),l=Math.min(t.lat,n.lat,a.lat,i.lat),r=Math.max(t.lat,n.lat,a.lat,i.lat),s,u;return[[l,Math.min(t.lng,n.lng,a.lng,i.lng)],[r,Math.max(t.lng,n.lng,a.lng,i.lng)]]}function o(e,t){return'<div><img src="'+t.layer.options.icon.options.iconUrl+'" />'+t.layer.options.title+"</div>"}function n(){let e;switch(oum_geosearch_provider){case"osm":e=new GeoSearch.OpenStreetMapProvider;break;case"geoapify":e=new GeoSearch.GeoapifyProvider({params:{apiKey:oum_geosearch_provider_geoapify_key}});break;case"here":e=new GeoSearch.HereProvider({params:{apiKey:oum_geosearch_provider_here_key}});break;case"mapbox":e=new GeoSearch.MapBoxProvider({params:{access_token:oum_geosearch_provider_mapbox_key}});break;default:e=new GeoSearch.OpenStreetMapProvider}return e}function c(e,t){var e=parseFloat(e),t=parseFloat(t);return!isNaN(e)&&!isNaN(t)&&-90<=e&&e<=90&&-180<=t&&t<=180}function a(e,t=null){try{return JSON.parse(e)}catch(e){return t}}function r(n,a=250){let r;return function e(...t){var o=()=>{clearTimeout(r),n(...t)};clearTimeout(r),r=setTimeout(o,a)}}
7function i(e,...o){return e.replace(/\\n/g,"\n").replace(/%(\d+)\$[sd]/g,(e,t)=>void 0!==o[t-1]?o[t-1]:e)}return{getParameterByName:e,latLngToBounds:t,customAutoSuggestText:o,initGeosearchProvider:n,validateCoordinates:c,safeJSONParse:a,debounce:r,sprintf:i}})(),OUMErrorHandler=(()=>{function o(e,t="error"){console.error("OUM Error: "+e);var o=document.getElementById("oum_add_location_error");o&&(o.innerHTML=e+"<br>",o.style.display="block")}function e(e){o("Ajax request failed: "+e.message)}function t(e,t){var e=parseFloat(e),t=parseFloat(t);return isNaN(e)||isNaN(t)?(o("Invalid coordinates provided"),!1):!(e<-90||90<e||t<-180||180<t)||(o("Coordinates out of valid range"),!1)}return{showError:o,handleAjaxError:e,validateCoordinates:t}})(),OUMConfig=(()=>{var e;function t(){return window.mapStyle||"OpenFreeMap.bright"}function o(){return window.oum_tile_provider_mapbox_key||""}function n(){return window.oum_tile_provider_carto_key||""}function a(){let e;switch(oum_geosearch_provider){case"geoapify":e=new GeoSearch.GeoapifyProvider({params:{apiKey:oum_geosearch_provider_geoapify_key}});break;case"here":e=new GeoSearch.HereProvider({params:{apiKey:oum_geosearch_provider_here_key}});break;case"mapbox":e=new GeoSearch.MapBoxProvider({params:{access_token:oum_geosearch_provider_mapbox_key}});break;default:e=new GeoSearch.OpenStreetMapProvider}return e}return{defaults:{map:{lat:26,lng:10,zoom:1,bounds:L.latLngBounds(L.latLng(-85,-200),L.latLng(85,200))},media:{maxFiles:5,validImageExtensions:["jpeg","jpg","png","webp"],maxImageSize:1048576*(window.oum_max_image_filesize||10)},search:{zoomLevel:window.oum_searchmarkers_zoom||8,addressLabel:window.oum_searchaddress_label||"Search for address",markersLabel:window.oum_searchmarkers_label||"Find marker"}},getMapStyle:t,getTileProviderKey:o,getCartoTileProviderKey:n,getGeosearchProvider:a}})(),OUMMap=(()=>{let g=null,l=null,y={lat:"undefined"!=typeof start_lat?Number(start_lat):OUMConfig.defaults.map.lat,lng:"undefined"!=typeof start_lng?Number(start_lng):OUMConfig.defaults.map.lng,zoom:"undefined"!=typeof start_zoom?Number(start_zoom):OUMConfig.defaults.map.zoom};function f(){OUMUtils.validateCoordinates(y.lat,y.lng)||(console.warn("Invalid coordinates, using defaults"),y.lat=OUMConfig.defaults.map.lat,y.lng=OUMConfig.defaults.map.lng),(isNaN(y.zoom)||y.zoom<1||20<y.zoom)&&(console.warn("Invalid zoom level, using default"),y.zoom=OUMConfig.defaults.map.zoom)}function _(){return oum_enable_cluster}function h(e){var t=Number(e);return isNaN(t)?e:_()?Math.round(t):t}function v(e,t,o={}){g.setView(e,h(t),o)}function p(e,t,o={}){g.flyTo(e,h(t),o)}function n(e,t={}){var t={...t};_()&&(t.maxZoom=h(g.getBoundsZoom(e,!1))),g.flyToBounds(e,t)}function w(){var e;sharedMapBounds=l=oum_enable_fixed_map_bounds?(e=OUMUtils.latLngToBounds(y.lat,y.lng,y.zoom,520,294),L.latLngBounds(L.latLng(e[0][0],e[0][1]),L.latLng(e[1][0],e[1][1]))):OUMConfig.defaults.map.bounds;let t=g.getBoundsZoom(l),o=(g.setMinZoom(t),g.setMaxBounds(l),!1);g.on("moveend",function(){if(!o){o=!0;var n=g.getZoom();if(n>t){var a=g.getBounds(),r=g.getCenter();let e=!1,t=r.lat,o=r.lng;var r=a.getNorth()-a.getSouth(),i=a.getEast()-a.getWest();a.getNorth()>l.getNorth()?(t=l.getNorth()-r/2,e=!0):a.getSouth()<l.getSouth()&&(t=l.getSouth()+r/2,e=!0),a.getEast()>l.getEast()?(o=l.getEast()-i/2,e=!0):a.getWest()<l.getWest()&&(o=l.getWest()+i/2,e=!0),e&&v([t,o],n,{animate:!1})}o=!1}})}function b(e){window.OUMMapStyles.addBaseLayer(g,e,{mapboxKey:OUMConfig.getTileProviderKey(),cartoKey:OUMConfig.getCartoTileProviderKey(),setupCustomImageLayer:t,customImageHideTiles:window.oum_custom_image_hide_tiles,customImageBackgroundColor:window.oum_custom_image_background_color})}function t(){var e;void 0!==window.oum_custom_image_url&&window.oum_custom_image_url&&void 0!==window.oum_custom_image_bounds&&window.oum_custom_image_bounds&&(window.oum_custom_image_url.toLowerCase().includes(".svg")?o:a)()}function o(){try{let t=window.oum_custom_image_bounds;t&&void 0!==t.north&&void 0!==t.south&&void 0!==t.east&&void 0!==t.west&&""!==t.north&&""!==t.south&&""!==t.east&&""!==t.west?fetch(window.oum_custom_image_url).then(e=>e.text()).then(e=>{var e=r(e),e;e?((e=L.svgOverlay(e,[[t.south,t.west],[t.north,t.east]],{opacity:1,interactive:!0})).addTo(g),window.oumCustomSVGLayer=e,console.log("Open User Map: Custom SVG file layer added successfully")):console.warn("Open User Map: Cannot create SVG layer from file - invalid SVG element")}).catch(e=>{console.warn("Open User Map: Error fetching SVG file:",e)}):console.warn("Open User Map: Invalid or empty bounds data, skipping SVG file layer")}catch(e){console.warn("Open User Map: Error setting up custom SVG file layer:",e)}}function a(){try{var e=window.oum_custom_image_bounds,t;e&&void 0!==e.north&&void 0!==e.south&&void 0!==e.east&&void 0!==e.west&&""!==e.n
7orth&&""!==e.south&&""!==e.east&&""!==e.west?((t=L.imageOverlay(window.oum_custom_image_url,[[e.south,e.west],[e.north,e.east]],{opacity:1,interactive:!0})).addTo(g),window.oumCustomImageLayer=t,console.log("Open User Map: Custom image layer added successfully")):console.warn("Open User Map: Invalid or empty bounds data, skipping image layer")}catch(e){console.warn("Open User Map: Error setting up custom image layer:",e)}}function r(e){var t=document.createElement("div"),e=(t.innerHTML=e,t.querySelector("svg")),t,o,t,o;return e?(e.getAttribute("viewBox")||(t=e.getAttribute("width"),o=e.getAttribute("height"),!t||!o||(t=parseFloat(t),o=parseFloat(o),isNaN(t))||isNaN(o)?e.setAttribute("viewBox","0 0 1000 1200"):e.setAttribute("viewBox",`0 0 ${t} `+o)),e.style.width="100%",e.style.height="100%",e.style.display="block",e.setAttribute("preserveAspectRatio","none"),console.log("Open User Map: SVG element created successfully:",e),e):(console.warn("Open User Map: No valid SVG element found in SVG text"),null)}function M(){var e,e,e;oum_enable_searchmarkers_button&&L.control.search({textPlaceholder:oum_searchmarkers_label,layer:window.oumMarkersLayer,propertyName:"content",initial:!1,buildTip:OUMUtils.customAutoSuggestText,autoType:!1,firstTipSubmit:!0,autoCollapse:!0,zoom:oum_searchmarkers_zoom}).addTo(g),oum_enable_searchbar&&"markers"===oum_searchbar_type&&((e=L.control.search({textPlaceholder:oum_searchmarkers_label,layer:window.oumMarkersLayer,propertyName:"content",initial:!1,buildTip:OUMUtils.customAutoSuggestText,autoType:!1,firstTipSubmit:!0,autoCollapse:!1,collapsed:!1,zoom:oum_searchmarkers_zoom,container:"oum_search_marker"})).addTo(g),e.on("search:locationfound",function(){this._input.value="",this._cancel&&(this._cancel.style.display="none")})),oum_enable_searchbar&&"address"===oum_searchbar_type&&(e=new GeoSearch.GeoSearchControl({style:"bar",showMarker:!1,provider:OUMUtils.initGeosearchProvider(),searchLabel:oum_searchaddress_label,updateMap:!1}),g.addControl(e),i()),oum_enable_searchaddress_button&&(e=new GeoSearch.GeoSearchControl({style:"button",showMarker:!1,provider:OUMUtils.initGeosearchProvider(),searchLabel:oum_searchaddress_label,updateMap:!1}),g.addControl(e)),oum_enable_currentlocation&&(window.map_locate_process=L.control.locate({flyTo:!0,showPopup:!1}).addTo(g))}function i(){var e=document.getElementById("oum_search_address");if(e&&g){var o,n=g.getContainer().querySelectorAll(".leaflet-control-geosearch.leaflet-geosearch-bar");let t=null;
7n.forEach(function(e){e.closest(".leaflet-top")||e.closest(".leaflet-bottom")||(t=e)}),(t=!t&&n.length?n[0]:t)&&e.appendChild(t)}}function S(){g.on("moveend",function(e){y.lat=g.getCenter().lat,y.lng=g.getCenter().lng,y.zoom=g.getZoom()});let e=document.querySelector("#add-location-overlay"),t=e?.parentElement,o=document.querySelector(".open-user-map .map-wrap");e&&(g.on("enterFullscreen",function(){o.appendChild(e)}),g.on("exitFullscreen",function(){t.appendChild(e)})),g.on("geosearch/showlocation",function(e){var t=e.marker._latlng;let o=!0;if((o="on"===oum_enable_fixed_map_bounds&&sharedMapBounds?sharedMapBounds.contains(t):o)||"on"!==oum_enable_fixed_map_bounds)e.location.bounds?n(e.location.bounds):e.location.raw&&e.location.raw.mapView?n([[e.location.raw.mapView.south,e.location.raw.mapView.west],[e.location.raw.mapView.north,e.location.raw.mapView.east]]):p([e.location.y,e.location.x],17);else{console.log("This search result is out of reach.");let e=document.querySelector(`#${map_el} .leaflet-geosearch-bar form`)||document.querySelector("#oum_search_address form")||document.querySelector(".oum-searchbar-filter .leaflet-geosearch-bar form");e&&(e.style.boxShadow="0 0 10px rgb(255, 111, 105)",setTimeout(function(){e.style.boxShadow="0 1px 5px rgba(255, 255, 255, 0.65)"},2e3))}})}function E(){document.querySelectorAll(".open-user-map .change_region").forEach(function(e){e.onclick=function(e){var e=e.currentTarget,t=e.getAttribute("data-lat"),o=e.getAttribute("data-lng"),n=e.getAttribute("data-zoom"),a=g.getContainer(),r=a.offsetWidth||520,a=a.offsetHeight||294,i=520,l=294,s=OUMUtils.latLngToBounds(parseFloat(t),parseFloat(o),parseFloat(n),i,l),s=L.latLngBounds(L.latLng(s[0][0],s[0][1]),L.latLng(s[1][0],s[1][1])),u,c,l=Math.abs(i/l-r/a),d,a;let m;p([t,o],m=l<.01?(a=Math.log2(r/i),parseFloat(n)+a):g.getBoundsZoom(s,!1)),document.querySelectorAll(".open-user-map .change_region").forEach(function(e){e.classList.remove("active")}),e.classList.add("active")};var t=OUMUtils.getParameterByName("region");e.textContent==t&&e.click()})}return{init:function(t){try{f(),(g=L.map(t,{gestureHandling:!oum_enable_scrollwheel_zoom_map,minZoom:1,zoomSnap:_()?1:.01,zoomDelta:1,attributionControl:!0,fullscreenControl:oum_enable_fullscreen,fullscreenControlOptions:{position:"topleft",fullscreenElement:document.querySelector(".open-user-map .map-wrap")}})).attributionControl.setPrefix(!1),b(OUMConfig.getMapStyle()),g.invalidateSize();var o=g.getContainer(),n=o.offsetWidth||520,a,r=520,i=294,l=r/i,s=n/(o.offsetHeight||294),u=Math.abs(l-s),c=OUMUtils.latLngToBounds(y.lat,y.lng,y.zoom,r,i),d=L.latLngBounds(L.latLng(c[0][0],c[0][1]),L.latLng(c[1][0],c[1][1])),m,p;let e;return e=h(e=u<.01?(m=n/r,p=Math.log2(m),y.zoom+p):g.getBoundsZoom(d,!1)),v([y.lat,y.lng],e,{animate:!1}),w(),S(),E(),window.oumMap=g,document.addEventListener("oum:markers_initialized",function(e){e.detail.mapId===t&&M()},{once:!0}),document.dispatchEvent(new CustomEvent("oum:map_initialized",{detail:{mapId:t,map:oumMap}})),g}catch(e){throw OUMErrorHandler.showError("Error initializing map: "+e.message),e}},getMap:function(){return g},getStartPosition:function(){return y}}})(),OUMMarkers=(()=>{let n=null,a=null,r=[],i=null,o={},t="",l=null,s=null,e=0,u='.open-user-map .oum-marker-categories-filter [name="type"]';function c(){n=oum_enable_cluster?L.markerClusterGroup({showCoverageOnHover:!1,removeOutsideVisibleBounds:!0,maxClusterRadius:50,chunkedLoading:!0}):L.layerGroup({chunkedLoading:!0}),a=L.layerGroup()}function d(){var e;return'<div class="oum-bubble-loading" role="status" aria-live="polite" aria-busy="true" aria-label="'+("undefined"!=typeof oum_custom_strings&&oum_custom_strings.bubble_loading?String(oum_custom_strings.bubble_loading).replace(/\\/g,"\\\\").replace(/"/g,"&quot;"):"Loading")+'"><span class="oum-bubble-loading-spinner" aria-hidden="true"></span></div>'}function m(){var e;return'<div class="oum-bubble-error" role="alert">'+("undefined"!=typeof oum_custom_strings&&oum_custom_strings.bubble_load_error?oum_custom_strings.bubble_load_error:"Unable to load location details.")+"</div>"}function p(e){var t=e&&e._source?e._source:null,o=document.querySelector(".open-user-map #location-fullscreen-container"),n=o?o.querySelector(".location-content-wrap"):null,e=(n&&(n.innerHTML=e.getContent(),g(n,t)),o&&(o.classList.add("visible"),document.querySelector("body").classList.add("oum-location-opened")),n&&E(n),e.getElement()),a,r;e&&(g(e,t),E(e)),window.OUMVoteHandler&&window.OUMVoteHandler.updateVoteButtonStates&&window.OUMVoteHandler.updateVoteButtonStates(),window.OUMVoteHandler&&window.OUMVoteHandler.initializeVoteCountsFromData&&0<(o?o.querySelectorAll(".oum_vote_button"):[]).length&&window.OUMVoteHandler.initializeVoteCountsFromData(),window.OUMVoteHandler&&window.OUMVoteHandler.initializeStarRatings&&0<(o?o.querySelectorAll(".oum_star_rating"):[]).length&&window.OUMVoteHandler.initializeStarRatings(),n&&OUMOpeningHours.setupToggle(n),e&&OUMOpe
7ningHours.setupToggle(e)}function g(e,t){var e,o;e&&t&&t.options&&t.options.oumMeasurementLabel&&(e=e.querySelector(".oum_location_title"))&&!e.querySelector(".oum_location_measurement")&&((o=document.createElement("span")).className="oum_location_measurement",o.textContent=t.options.oumMeasurementLabel,e.appendChild(o))}function y(n){return n.reduce((e,t,o)=>0===o?e:e+n[o-1].distanceTo(t),0)}function f(e){return L.GeometryUtil&&L.GeometryUtil.geodesicArea?Math.abs(L.GeometryUtil.geodesicArea(e)):0}function _(e){return!isFinite(e)||e<=0?"":1e3<=e?(e/1e3).toFixed(1e4<=e?0:1)+" km":Math.round(e)+" m"}function h(e){return!isFinite(e)||e<=0?"":Math.round(e).toLocaleString()+" m²"}function v(e){var t=(e.content||"").toString().replace(/(<([^>]+)>)/gi," ").replace(/\s\s+/g," "),t=(e.title+" | "+t).toLowerCase(),t=L.marker([e.lat,e.lng],{title:e.title,post_id:e.post_id,content:t,zoom:e.zoom,icon:L.icon({iconUrl:e.icon,iconSize:[26,41],iconAnchor:[13,41],popupAnchor:[0,-25],shadowUrl:marker_shadow_url,shadowSize:[41,41],shadowAnchor:[13,41]}),types:e.types||[]}),e;return"undefined"!=typeof oum_hide_location_popup&&oum_hide_location_popup||(e=L.responsivePopup().setContent(d()),t.bindPopup(e)),t}function w(e){var t=(e.content||"").toString().replace(/(<([^>]+)>)/gi," ").replace(/\s\s+/g," "),t=(e.title+" | "+t).toLowerCase(),o=e.geometry||{},n,a=("Polygon"===o.type&&Array.isArray(o.coordinates)&&Array.isArray(o.coordinates[0])?o.coordinates[0]:Array.isArray(o.coordinates)?o.coordinates:[]).filter(e=>Array.isArray(e)&&2<=e.length).map(e=>L.latLng(Number(e[1]),Number(e[0]))).filter(e=>isFinite(e.lat)&&isFinite(e.lng)),r,i,l,o,s,u,t,e,u;return a.length<2?v(e):(o="Polygon"===o.type||4<=a.length&&(r=a[0]).equals(a[a.length-1]),s=e.category_color||"#e82c71",u=e.show_measurement?o?h(f(a)):_(y(a)):"",t={title:e.title,post_id:e.post_id,content:t,zoom:e.zoom,types:e.types||[],oumMeasurementLabel:u,color:s,weight:4,opacity:.9},e=o?L.polygon(a,{...t,fillColor:s,fillOpacity:.25}):L.polyline(a,t),"undefined"!=typeof oum_hide_location_popup&&oum_hide_location_popup||(u=L.responsivePopup().setContent(d()),e.bindPopup(u)),e)}function b(e){return("polyline"!==e.geometry_type&&"polygon"!==e.geometry_type||!e.geometry?v:w)(e)}function M(e){var e=e&&"function"==typeof e.getElement?e.getElement():null;e&&"true"!==e.dataset.oumIgnoreGestures&&(e.dataset.oumIgnoreGestures="true",L.DomEvent.on(e,"touchmove",L.DomEvent.stopPropagation))}function S(){i.on("popupopen",function(e){let o=e.popup,n=(M(o),o._source),a=e=>{o.setContent(e),"function"==typeof o.update&&o.update(),p(o)};if(n&&n.options&&n.options.post_id)if(n._oumBubbleHtmlCache)a(n._oumBubbleHtmlCache);else{n._oumBubbleFetchId=(n._oumBubbleFetchId||0)+1;let t=n._oumBubbleFetchId;var e=n.options.post_id;o.setContent(d()),"function"==typeof o.update&&o.update(),p(o),"undefined"!=typeof jQuery&&oum_ajax&&oum_ajax.ajaxurl?jQuery.ajax({type:"POST",url:oum_ajax.ajaxurl,dataType:"json",data:{action:oum_ajax.bubble_action||"oum_get_location_bubble",post_id:e},success:function(e){t===n._oumBubbleFetchId&&(e&&e.success&&e.data&&e.data.html?(n._oumBubbleHtmlCache=e.data.html,a(e.data.html)):a(m()))},error:function(){t===n._oumBubbleFetchId&&a(m())}}):a(m())}else p(o)}),i.on("popupclose",function(){var e=document.querySelector(".open-user-map #location-fullscreen-container"),t;e&&((t=e.querySelector(".location-content-wrap"))&&(t.innerHTML=""),e.classList.remove("visible")),document.querySelector("body").classList.remove("oum-location-opened")})}function E(e){let n=e.querySelector(".edit-location-button-placeholder");if(n){let t=n.getAttribute("data-post-id");t&&"undefined"!=typeof jQuery&&oum_ajax&&oum_ajax.ajaxurl?jQuery.ajax({type:"POST",url:oum_ajax.ajaxurl,dataType:"json",data:{action:"oum_check_edit_permission",post_id:t},success:function(e){var e;e&&e.success&&e.data&&e.data.can_edit?((e=document.createElement("div")).className="edit-location-button",e.setAttribute("data-post-id",t),e.setAttribute("title",oum_custom_strings&&oum_custom_strings.edit_location?oum_custom_strings.edit_location:"Edit location"),n.parentNode.replaceChild(e,n)):n.remove()},error:function(e,t,o){n.remove()}}):n.remove()}}function k(){if(n){n.clearLayers(),a&&a.clearLayers();let t=[];
7r.forEach(e=>{C(e)&&O(e)&&U(e)&&t.push(e)}),e=t.length,x(t),oum_enable_cluster&&"function"==typeof n.refreshClusters&&n.refreshClusters()}}function x(e){if(n&&e.length){let t=[],o=[];e.forEach(e=>{(e instanceof L.Marker?t:o).push(e)}),o.forEach(e=>{a&&a.addLayer(e)}),t.length&&(oum_enable_cluster&&1===t.length&&"function"==typeof n.addLayer?n.addLayer(t[0]):"function"==typeof n.addLayers?n.addLayers(t):t.forEach(e=>{n.addLayer(e)}))}}function C(e){return!t||e.options.content.toLowerCase().includes(t)}function O(e){var e=e.options.types||[];return!e.length||null===l||l.size&&e.some(e=>l.has(e))}function U(e){if(s&&Object.keys(s).length){var o=B(e.options.post_id),t;if(o)for(let[t,e]of Object.entries(s))if("opening_hours_open_now"===e.type){var n=o.custom_fields?.find(e=>String(e.index)===String(t));if(!n||"boolean"!=typeof n.open_now)return;if(!0!==n.open_now)return}else{if(!q(A(o,t),e))return}}return 1}function B(t){if(t){if(o[String(t)])return o[String(t)];if("undefined"!=typeof window&&Array.isArray(window.oum_all_locations)){var e=window.oum_all_locations.find(e=>String(e.post_id)===String(t));if(e)return o[String(t)]=e}}return null}function A(e,t){var e;return e&&Array.isArray(e.custom_fields)&&(e=e.custom_fields.find(e=>String(e.index)===String(t)))?e.val:null}function I(e){var e;return Array.isArray(e)?e.map(e=>e.toString()).filter(e=>""!==e):"string"==typeof e?e.split("|").map(e=>e.trim()).filter(e=>""!==e):null!=e&&(e=e.toString())?[e]:[]}function q(e,o){if(!(null==e||"string"==typeof e&&""===e.trim()||Array.isArray(e)&&0===e.length))switch(o.type){case"text":return e.toString().toLowerCase().includes(o.value);case"checkbox":{let t=I(e);var n;return"AND"===(o.relation||"OR")?0<o.values.length&&o.values.every(e=>t.includes(e)):o.values.some(e=>t.includes(e))}case"radio":case"select":var t;return I(e).includes(o.value);default:return 1}}function T(){var e=document.getElementById("oum_filter_markers"),e=(t=e?e.value.toLowerCase():"",document.querySelectorAll(u));l=0===e.length?null:new Set(Array.from(e).filter(e=>e.checked).map(e=>e.value)),k()}function F(){let o=document.querySelector(".open-user-map .oum-filter-controls");if(o){var e=o.querySelector(".close-filter-list"),n=o.querySelector(".oum-filter-toggle");let t=o.closest(".oum-map-filter-wrapper");e&&e.addEventListener("click",function(e){e.stopPropagation(),o.classList.remove("active"),o.classList.add("use-collapse")}),n&&n.addEventListener("click",function(e){e.stopPropagation(),o.classList.toggle("active")}),t&&document.addEventListener("click",function(e){o.classList.contains("use-collapse")&&!t.contains(e.target)&&o.classList.remove("active")})}}function N(){var e=document.querySelector(".open-user-map .oum-marker-categories-filter");if(e){let o=e.querySelector(".oum-toggle-all-checkbox"),n=e.querySelectorAll('[name="type"]');function t(){var e=Array.from(n).filter(e=>e.checked).length,t=n.length;0===e?(o.checked=!1,o.indeterminate=!1):e===t?(o.checked=!0,o.indeterminate=!1):(o.checked=!1,o.indeterminate=!0)}function a(){var e,t;let o=Array.from(n).filter(e=>e.checked).length<n.length;n.forEach(e=>{e.checked=o}),T()}
7o&&0!==n.length&&(o.addEventListener("change",a),n.forEach(e=>{e.addEventListener("change",t)}),t())}}function z(){var e,t=(document.querySelectorAll(u).forEach(e=>{e.checked=!0}),document.querySelector(".open-user-map .oum-marker-categories-filter .oum-toggle-all-checkbox"));t&&(t.checked=!0,t.indeterminate=!1),T()}function P(t){let o=r.find(e=>e.options.post_id===t);if(o){let e="undefined"==typeof oum_hide_location_popup||!oum_hide_location_popup;oum_enable_cluster?o instanceof L.Marker&&"function"==typeof n.zoomToShowLayer?setTimeout(()=>{n.zoomToShowLayer(o,()=>{e&&o.openPopup()})},500):o.getBounds&&(i.fitBounds(o.getBounds(),{padding:[20,20]}),e)&&o.openPopup():(o.getLatLng?i.setView(o.getLatLng(),o.options.zoom):o.getBounds&&i.fitBounds(o.getBounds(),{padding:[20,20]}),e&&o.openPopup())}}return{init:function(e){return i=e,c(),n.addTo(i),a.addTo(i),S(),F(),N(),window.oumMarkersLayer=n,window.oumAllMarkers=r,document.dispatchEvent(new CustomEvent("oum:markers_initialized",{detail:{mapId:i._container.id,markersLayer:n}})),this},addMarkers:function(e){e.forEach(e=>{var t=b(e);r.push(t),o[String(e.post_id)]=e}),k();var e=OUMUtils.getParameterByName("markerid");e&&P(e)},updateSearchtextAndCategoriesFilters:T,resetCategoriesFilter:z,getMarkersLayer:function(){return n},getAllMarkers:function(){return r},getAllLocations:function(){return Object.values(o)},setCustomfieldsFilter:function(e){s=e&&0<Object.keys(e).length?e:null,k()},getFilterState:function(){return{searchtext:t,categories:null===l?null:Array.from(l),customfields:s}},getFilteredMarkersCount:function(){return e},invalidateBubbleHtmlCacheForPost:function(e){let t=String(e);r.forEach(e=>{e&&e.options&&String(e.options.post_id)===t&&(delete e._oumBubbleHtmlCache,e._oumBubbleFetchId=0)})}}})(),OUMFormMap=(()=>{let p=null,r=null,i=!1,t=!1,o=!1,l="point",n=null,e=null,a=null;function s(){if(!o){p=L.map("mapGetLocation",{attributionControl:!1,gestureHandling:!0,minZoom:1,zoomSnap:.01,zoomDelta:1,fullscreenControl:oum_enable_fullscreen,fullscreenControlOptions:{position:"topleft"}}),window.oumMap2=p,c(),d(),m(),g(),w(),v(),p.invalidateSize();let l=oum_enable_fixed_map_bounds?sharedMapBounds:OUMConfig.defaults.map.bounds;p.setMaxBounds(l);let e;oum_enable_fixed_map_bounds&&sharedMapBounds?(p.invalidateSize(),e=p.getBoundsZoom(sharedMapBounds),p.setMinZoom(e)):e=p.getBoundsZoom(l),p.on("moveend",function(){if(!t){t=!0;var n=p.getZoom();if(n>e){var a=p.getBounds(),r=p.getCenter();let e=!1,t=r.lat,o=r.lng;var r=a.getNorth()-a.getSouth(),i=a.getEast()-a.getWest();a.getNorth()>l.getNorth()?(t=l.getNorth()-r/2,e=!0):a.getSouth()<l.getSouth()&&(t=l.getSouth()+r/2,e=!0),a.getEast()>l.getEast()?(o=l.getEast()-i/2,e=!0):a.getWest()<l.getWest()&&(o=l.getWest()+i/2,e=!0),e&&p.setView([t,o],n,{animate:!1})}t=!1}}),p.on("zoomend",function(){q()}),u(),o=!0}}function u(){var e;p&&oum_enable_fixed_map_bounds&&sharedMapBounds&&(p.invalidateSize(),e=p.getBoundsZoom(sharedMapBounds),p.setMinZoom(e))}function c(){var e=window.mapStyle||"OpenFreeMap.bright";window.OUMMapStyles.addBaseLayer(p,e,{mapboxKey:OUMConfig.getTileProviderKey(),cartoKey:OUMConfig.getCartoTileProviderKey(),setupCustomImageLayer:D,customImageHideTiles:window.oum_custom_image_hide_tiles,customImageBackgroundColor:window.oum_custom_image_background_color})}function d(){var e=new GeoSearch.GeoSearchControl({style:"bar",showMarker:!1,provider:OUMUtils.initGeosearchProvider(),searchLabel:oum_searchaddress_label,updateMap:!1});p.addControl(e),oum_enable_currentlocation&&(window.formMap_locate_process=L.control.locate({flyTo:!0,showPopup:!1}).addTo(p))}function m(){var e=L.icon({iconUrl:marker_icon_url,iconSize:[26,41],iconAnchor:[13,41],popupAnchor:[0,-25],shadowUrl:marker_shadow_url,shadowSize:[41,41],shadowAnchor:[13,41]});r=L.marker([0,0],{icon:e,draggable:!0}),window.locationMarker=r,window.markerIsVisible=i,r.on("dragend",function(e){_(e.target.getLatLng())})}function g(){p.on("click locationfound",function(e){var e;"point"===l&&(e=e.latlng,r.setLatLng(e),i||(r.addTo(p),i=!0,window.markerIsVisible=!0),_(e))}),p.on("geosearch/showlocation",y)}function y(e){var t=e.marker._latlng,o=e.location.label;let n=document.querySelector("#mapGetLocation .leaflet-geosearch-bar form"),a=!0;(a="on"===oum_enable_fixed_map_bounds&&sharedMapBounds?sharedMapBounds.contains(t):a)||"on"!==oum_enable_fixed_map_bounds?("point"!==l||(_(t,o),r.setLatLng(t),i)||(r.addTo(p),i=!0,window.markerIsVisible=!0),f(e.location)):(console.log("This search result is out of reach."),n&&(n.style.boxShadow="0 0 10px rgb(255, 111, 105)",setTimeout(function(){n.style.boxShadow="0 1px 5px rgba(255, 255, 255, 0.65)"},2e3)))}function f(e){null!==e.bounds?p.flyToBounds(e.bounds):e.raw.mapView?p.flyToBounds([[e.raw.mapView.south,e.raw.mapView.west],[e.raw.mapView.north,e.raw.mapView.east]]):p.flyTo([e.y,e.x],17)}function _(e,t,o=!1){document.getElementById("oum_location_lat").value=e.lat,document.getElementById("oum_location_lng").value=e.lng,q(),!o&&T()&&H(e.lat,e.lng,t)}function h(){r&&p&&(r.remove(),i=!1,window.markerIsVisible=!1)}function v(){var e,t=(document.querySelectorAll('input[name="oum_location_type_choice"]').forEach(e
7=>{e.addEventListener("change",function(){this.checked&&k(this.value)})}),document.getElementById("oum_geometry_type"));k(t&&t.value?t.value:"point",{autoStartDrawing:!1})}function w(){L.Control&&L.Control.Draw&&(n=L.featureGroup().addTo(p),b(),M())}function b(){p&&L.Control&&L.Control.Draw&&(e&&e._map&&p.removeControl(e),e=new L.Control.Draw({draw:{polyline:"polyline"===l&&{shapeOptions:S()},polygon:"polygon"===l&&{shapeOptions:E()},rectangle:!1,circle:!1,circlemarker:!1,marker:!1},edit:{featureGroup:n,remove:!0}}))}function M(){p.on(L.Draw.Event.CREATED,function(e){"point"!==l&&U(e.layer)}),p.on(L.Draw.Event.EDITED,function(){I()}),p.on(L.Draw.Event.DELETED,function(){a=null,I()})}function S(){return{color:"#e82c71",weight:4,opacity:.9}}function E(){return{...S(),fillColor:"#e82c71",fillOpacity:.25}}function k(e,t={}){l="polyline"===e||"polygon"===e?e:"point";var e=!1!==t.autoStartDrawing,t=(z(),document.querySelector(".add-location")),t=(t&&t.setAttribute("data-oum-geometry-type",l),document.getElementById("oum_geometry_type")),t=(t&&(t.value=l),document.querySelector(`input[name="oum_location_type_choice"][value="${l}"]`));t&&(t.checked=!0),document.querySelectorAll("[data-oum-location-type-card]").forEach(e=>{e.classList.toggle("is-selected",e.getAttribute("data-oum-location-type-card")===l)}),x(),"polyline"===l||"polygon"===l?(h(),b(),P(),e&&C()):(G(),B()),I()}function x(){let o="polygon"===l?"polygonLabel":"polyline"===l?"polylineLabel":"pointLabel";var e;document.querySelectorAll("[data-oum-category-title]").forEach(e=>{var t=e.dataset[o]||e.dataset.pointLabel||e.textContent;e.textContent=t}),document.querySelectorAll(".oum-category-dropdown-display").forEach(e=>{e.setAttribute("data-oum-geometry-type",l)}),document.querySelectorAll(".oum-marker-category-option").forEach(e=>{var t,o=(e.getAttribute("data-category-type")||"point")===l,n=e.querySelector('input[name="oum_marker_icon[]"]');e.hidden=!o,n&&(n.disabled=!o,o||(n.checked=!1))}),document.querySelectorAll("select#oum_marker_icon option[data-category-type]").forEach(e=>{var t,o=(e.getAttribute("data-category-type")||"point")===l;e.hidden=!o,e.disabled=!o,!o&&e.selected&&(e.selected=!1)}),document.querySelectorAll("select#oum_marker_icon").forEach(e=>{var t=e.options[e.selectedIndex];t&&t.disabled&&(e.value=""),e.dispatchEvent(new Event("change"))})}function C(o=0){p&&window.setTimeout(()=>{var e,t,e;p._loaded?(e=p.getContainer())&&(t="polygon"===l?".leaflet-draw-draw-polygon":".leaflet-draw-draw-polyline",!(e=e.querySelector(t))||e.classList.contains("leaflet-disabled")||e.classList.contains("leaflet-draw-toolbar-button-enabled")||e.click()):o<10&&C(o+1)},0)}function O(){"polyline"!==l&&"polygon"!==l||C()}function N(){p&&a&&window.setTimeout(()=>{var e=p.getContainer(),e,t,o;e&&(t=(e=e.querySelector(".leaflet-draw-edit-edit"))&&e.classList.contains("leaflet-draw-toolbar-button-enabled"),o=e&&e.classList.contains("leaflet-disabled"),!e||t||o||e.click())},0)}function z(){var e,e;p&&(e=p.getContainer())&&(e=e.querySelector(".leaflet-draw-actions a[title='Cancel drawing'], .leaflet-draw-actions a[title='Cancel']"))&&e.click()}function P(){e&&p&&!e._map&&p.addControl(e)}function G(){e&&p&&e._map&&p.removeControl(e)}function U(e){n&&e&&(B(),(a=e).setStyle&&a.setStyle(("polygon"===l?E:S)()),n.addLayer(a),I())}function B(){n&&n.clearLayers(),a=null}function V(e){var t,o;(!e||!Array.isArray(e.coordinates)||"LineString"!==e.type&&"Polygon"!==e.type||(o=("Polygon"===e.type&&Array.isArray(e.coordinates[0])?e.coordinates[0]:e.coordinates).filter(e=>Array.isArray(e)&&2<=e.length).map(e=>L.latLng(Number(e[1]),Number(e[0])))).length<2||"Polygon"===e.type&&o.length<4?(B(),I):(k("Polygon"===e.type?"polygon":"polyline",{autoStartDrawing:!1}),U("Polygon"===e.type?L.polygon(o,E()):L.polyline(o,S())),A))()}function A(){var e;p&&a&&a.getBounds&&(e=a.getBounds())&&e.isValid()&&p.fitBounds(e,{padding:[20,20]})}function I(){var e=document.getElementById("oum_location_geometry"),t,t;e&&("point"!==l&&a?(t=a.toGeoJSON().geometry,e.value=JSON.stringify(t),(t=a.getBounds())&&t.isValid()&&_(t.getCenter(),"",!0)):e.value="")}function q(){var e=document.getElementById("oum_location_zoom");e&&p&&(e.value=p.getZoom())}function T(){var e=void 0!==window.oum_enable_address&&"on"===window.oum_enable_address,t=void 0!==window.oum_enable_address_autofill&&"on"===window.oum_enable_address_autofill;return e&&t}function j(e,t){var o=[];return e.house_number&&o.push(e.house_number),e.road&&o.push(e.road),e.suburb&&o.push(e.suburb),(e.city||e.town||e.village)&&o.push(e.city||e.town||e.village),e.postcode&&o.push(e.postcode),e.country&&o.push(e.country),0<o.length?o.join(", "):t||"Address not found"}function H(o,n,e){var t;e&&e.trim()?F(e.trim()):OUMUtils.validateCoordinates(o,n)?fetch(`https://nominatim.openstreetmap.org/reverse?format=json&lat=${o}&lon=${n}&zoom=18&addressdetails=1`,{headers:{"User-Agent":"OpenUserMap/1.0"}}).then(e=>{if(e.ok)return e.json();throw new Error("HTTP error! status: "+e.status)}).then(e=>{var t;e&&e.address?F(j(e.address,e.display_name)):console.log("Open User Map: No address found for coordinates:",o,n)}).catch(e=>{console.warn("Open User Map: Reverse geocoding error:",e)}):console.warn("Open User Map: Invalid coordinates for reverse geocoding")}function F(e){var t;e&&"string"==typeof e&&(console.log("Open User Map: Address:",e),T())&&(t=document.getElementById("oum_location_address"))&&(t.value=e)}function D(){var e;void 0!==window.oum_custom_image_url&&window.oum_custom_image_url&&void 0!==window.oum_custom_image_bounds&&window.oum_custom_image_bounds&&(window.oum_custom_image_url.toLowerCase().includes(".svg")?R:Z)()}function R(){try{let t=window.oum_custom_image_bounds;t&&void 0!==t.north&&void 0!==t.south&&void 0!==t.east&&void 0!==t.west&&""!==t.north&&""!==t.south&&""!==t.east&&""!==t.west?fetch(window.oum_custom_image_url).then(e=>e.text()).then(e=>
7{var e=$(e),e;e?((e=L.svgOverlay(e,[[t.north,t.west],[t.south,t.east]],{opacity:1,interactive:!0})).addTo(p),window.oumCustomSVGLayer=e,console.log("Open User Map: Custom SVG file layer added successfully")):console.warn("Open User Map: Cannot create SVG layer from file - invalid SVG element")}).catch(e=>{console.warn("Open User Map: Error fetching SVG file:",e)}):console.warn("Open User Map: Invalid or empty bounds data, skipping SVG file layer")}catch(e){console.warn("Open User Map: Error setting up custom SVG file layer:",e)}}function Z(){try{var e=window.oum_custom_image_bounds,t;e&&void 0!==e.north&&void 0!==e.south&&void 0!==e.east&&void 0!==e.west&&""!==e.north&&""!==e.south&&""!==e.east&&""!==e.west?((t=L.imageOverlay(window.oum_custom_image_url,[[e.north,e.west],[e.south,e.east]],{opacity:1,interactive:!0})).addTo(p),window.oumCustomImageLayer=t,console.log("Open User Map: Custom image layer added successfully")):console.warn("Open User Map: Invalid or empty bounds data, skipping image layer")}catch(e){console.warn("Open User Map: Error setting up custom image layer:",e)}}function $(e){var t=document.createElement("div"),e=(t.innerHTML=e,t.querySelector("svg")),t,o,t,o;return e?(e.getAttribute("viewBox")||(t=e.getAttribute("width"),o=e.getAttribute("height"),!t||!o||(t=parseFloat(t),o=parseFloat(o),isNaN(t))||isNaN(o)?e.setAttribute("viewBox","0 0 1000 1200"):e.setAttribute("viewBox",`0 0 ${t} `+o)),e.style.width="100%",e.style.height="100%",e.style.display="block",e.setAttribute("preserveAspectRatio","none"),console.log("Open User Map: SVG element created successfully:",e),e):(console.warn("Open User Map: No valid SVG element found in SVG text"),null)}return{init:function(){document.getElementById("mapGetLocation")&&s()},setLocation:function(e,t){k("point"),r&&(r.setLatLng([e,t]),i||(r.addTo(p),i=!0,window.markerIsVisible=!0),_({lat:e,lng:t}))},clearMarker:function(){h()},setGeometryType:k,updateLocationTypeCategoryUi:x,setPolylineGeometry:V,fitPolylineBounds:A,startDrawToolForCurrentType:O,startEditLayersTool:N,clearPolyline:B,syncGeometryFields:I,invalidateSize:function(){p&&p.invalidateSize()},updateMinZoom:function(){u()},getMap:function(){return p},setView:function(e,t,o){p&&(p.setView([e,t],o),q())},setViewToMatchMainMap:function(t){if(p&&t){p.invalidateSize();var o=t.getBounds(),n=t.getCenter(),a=t.getZoom(),r=p.getContainer(),i=r.offsetWidth||520,r=r.offsetHeight||294,t=t.getContainer(),l=t.offsetWidth||520,s,u,c,t=Math.abs(l/(t.offsetHeight||294)-i/r),d,m;let e;e=t<.01?a+(m=Math.log2(i/l)):p.getBoundsZoom(o,!1),p.setView([n.lat,n.lng],e,{animate:!1})}}}})(),OUMFormController=(()=>{let i=!1,l=null,a=[];function t(e,t,o,n=null,a=null){var r=document.getElementById("oum_add_location"),i=document.getElementById("oum_add_location_error"),l=document.getElementById("oum_add_location_thankyou"),r,i,s,r,r,i,r,s,i;r&&i&&l?(r.style.display="none",i.style.display="none",r=l.querySelector("h3"),i=l.querySelector(".oum-add-location-thankyou-text"),s=l.querySelector("button"),r&&i&&s||(r||(r=document.createElement("h3"),l.appendChild(r)),i||((r=document.createElement("p")).className="oum-add-location-thankyou-text",l.appendChild(r)),s)||(i=document.createElement("button"),l.appendChild(i)),r=l.querySelector("h3"),s=l.querySelector(".oum-add-location-thankyou-text"),i=l.querySelector("button"),l.className="confirm-delete"===e?"oum-delete-confirmation":"",r&&(r.textContent=t||""),s&&(s.textContent=o||""),i&&(n&&a?(i.textContent=n,i.onclick=a,i.style.display="inline-block"):i.style.display="none"),l.style.display="block"):console.error("Required form elements not found")}function e(){var e=document.getElementById("oum_delete_location_btn");e&&e.addEventListener("click",function(e){e.preventDefault(),t("confirm-delete",oum_custom_strings.delete_location,oum_custom_strings.delete_location_message,oum_custom_strings.delete_location_button,function(){document.getElementById("oum_delete_location").value="true";var e=document.getElementById("oum_add_location"),e=new FormData(e);e.append("action","oum_add_location_from_frontend"),jQuery.ajax({type:"POST",url:oum_ajax.ajaxurl,cache:!1,contentType:!1,processData:!1,data:e,success:function(e){e.success?t("success",oum_custom_strings.location_deleted,oum_custom_strings.delete_success,oum_custom_strings.close_and_refresh,function(){window.location.reload()}):oumShowError(e.data)},error:function(e,t,o){console.log(o),oumShowError([{message:oum_custom_strings.delete_error}])}})})})}function o(){var e=document.getElementById("open-add-location-overlay");e&&e.addEventListener("click",n),document.addEventListener("click",function(e){if(e.target&&e.target.classList.contains("edit-location-button")){e.preventDefault();let t=e.target.getAttribute("data-post-id");var e=window.oum_all_locations.find(e=>e.post_id===t);e&&(y(),s(e))}}),u(),d(),m()}function r(){var e=document.getElementById("oum_add_location");if(!e||"undefined"==typeof oum_ajax)return Promise.resolve();let t=e.querySelector('input[name="oum_location_nonce"]');if(!t||!oum_ajax.ajaxurl)return Promise.resolve();var e=oum_ajax.refresh_nonce_action||"oum_refresh_location_nonce";jQuery.ajax({type:"POST",url:oum_ajax.ajaxurl,dataType:"json",data:{action:e}}).done(function(e){e&&e.success&&e.data&&e.data.nonce&&(t.value=e.data.nonce)}).fail(function(){console.warn("Open User Map: Unable to refresh nonce.")})}function n(){y(),s()}function s(n=null){r(),document.querySelector(".add-location").classList.add("active"),document.body.classList.add("oum-add-location-opened"),setTimeout(function(){OUMFormMap.init(),setTimeout(function(){OUMFormMap.updateMinZoom()},100);var e=()=>{let e=document.querySelector("#"+map_el);var t,t,o,t,o,t,o;if(e&&(t=window.oumMap)&&(o=(t=t.getContainer()).offsetWidth,t=t.offsetHeight,o)&&t&&(o=o/t,t=document.querySelector(".add-location .location-overlay-content .map-wrap"))&&(t.style.aspectRatio=o.toString(),t.style.height="auto"),n)g(n);else{let e=document.querySelector("#"+map_el);
7e&&(o=window.oumMap,OUMFormMap.setViewToMatchMainMap(o))}};e(),requestAnimationFrame(e),setTimeout(()=>{var e,t;OUMFormMap.invalidateSize(),n&&("polyline"===n.geometry_type||"polygon"===n.geometry_type)&&n.geometry?OUMFormMap.fitPolylineBounds():n||(document.querySelector("#"+map_el)&&(t=window.oumMap,OUMFormMap.setViewToMatchMainMap(t)),OUMFormMap.startDrawToolForCurrentType())},200)},150)}function u(){var e=document.getElementById("close-add-location-overlay");e&&(e.addEventListener("click",c),document.addEventListener("keydown",function(e){"Escape"===(e=e||window.event).key&&document.getElementById("add-location-overlay").classList.contains("active")&&c()}),document.getElementById("add-location-overlay").addEventListener("click",function(e){e.target===this&&c()}))}function c(){var e=document.getElementById("add-location-overlay");e&&e.classList.remove("active"),window.formMap_locate_process&&window.formMap_locate_process.stop(),document.querySelector("body").classList.remove("oum-add-location-opened"),y(),OUMFormMap.clearMarker()}function d(){var e=document.getElementById("oum_location_notification");e&&e.addEventListener("change",function(){var e=document.getElementById("oum_author"),t=document.getElementById("oum_location_author_name"),o=document.getElementById("oum_location_author_email");this.checked?(e.classList.add("active"),t.required=!0,o.required=!0):(e.classList.remove("active"),t.required=!1,o.required=!1)})}function m(){var e=document.getElementById("oum_location_images"),e=(e&&OUMMedia.initializeImageUpload(e),document.getElementById("oum_remove_image")),e=(e&&e.addEventListener("click",function(){document.getElementById("oum_location_images_preview").innerHTML=""}),document.getElementById("oum_remove_audio"));e&&e.addEventListener("click",function(){var e=document.getElementById("oum_location_audio"),t=e.nextElementSibling,o=t.querySelector(".audio-preview");e.value="",o&&(o.innerHTML=""),t.classList.remove("active"),document.getElementById("oum_remove_existing_audio").value="1"})}function p(){let s=document.querySelector("select#oum_marker_icon");if(s){var e=document.createElement("div"),t=(e.className="oum-category-dropdown-wrapper",e.style.position="relative",s.parentNode.insertBefore(e,s),e.appendChild(s),document.createElement("div"));t.className="oum-category-dropdown-display";let a=document.createElement("img"),r=(a.className="oum-category-dropdown-icon",document.createElement("span")),i=(r.className="oum-category-line-preview",document.createElement("span"));i.className="oum-category-area-preview";var o=document.getElementById("oum-route-category-icon-template"),n=document.getElementById("oum-area-category-icon-template");o&&o.content&&r.appendChild(o.content.cloneNode(!0)),n&&n.content&&i.appendChild(n.content.cloneNode(!0));let l=document.createElement("span");function u(){var e=s.options[s.selectedIndex],t,o,n;e&&e.value?(t=e.getAttribute("data-icon"),o=e.getAttribute("data-color")||"#e82c71","point"===(n=e.getAttribute("data-category-type")||"point")&&t?(a.src=t,a.style.display="block"):a.style.display="none",r.style.color=o,r.style.display="polyline"===n?"inline-block":"none",i.style.color=o,i.style.display="polygon"===n?"inline-block":"none",l.textContent=e.textContent):(a.style.display="none",r.style.color="",r.style.display="none",i.style.color="",i.style.display="none",l.textContent="Select a category...")}l.className="oum-category-dropdown-text",t.appendChild(a),t.appendChild(r),t.appendChild(i),t.appendChild(l),e.insertBefore(t,s),s.style.cssText=`
8        position: absolute;
9        top: 0;
10        left: 0;
11        width: 100%;
12        height: 100%;
13        opacity: 0;
14        cursor: pointer;
15        z-index: 1;
16      `,u(),void 0!==OUMFormMap&&OUMFormMap.updateLocationTypeCategoryUi&&(OUMFormMap.updateLocationTypeCategoryUi(),u()),s.addEventListener("change",u),t.setAttribute("tabindex","0"),t.addEventListener("keydown",function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),s.focus(),s.click())})}}function g(o){i=!0,l=o.post_id;var e=document.querySelector(".add-location"),e=(e&&e.classList.add("edit-location"),document.getElementById("oum_post_id")),e=(e&&(e.value=o.post_id),document.getElementById("oum_location_title")),t=document.getElementById("oum_location_lat"),n=document.getElementById("oum_location_lng"),a=document.getElementById("oum_location_address"),e=(e&&(e.value=o.title||""),t&&(t.value=o.lat||""),n&&(n.value=o.lng||""),a&&(a.value=o.address||""),"polyline"===o.geometry_type||"polygon"===o.geometry_type?o.geometry_type:"point"),t,n,r,a=(OUMFormMap.setGeometryType(e,{autoStartDrawing:!1}),o.types&&Array.isArray(o.types)&&("undefined"!=typeof oum_enable_multiple_marker_types&&"true"==oum_enable_multiple_marker_types?0<(t=document.querySelectorAll('input[name="oum_marker_icon[]"]')).length&&t.forEach(e
16=>{e.checked=o.types.includes(e.value)}):(n=document.querySelector("select#oum_marker_icon"))&&(n.value=o.types[0]||"",document.querySelector(".oum-category-dropdown-display"))&&n.dispatchEvent(new Event("change"))),document.getElementById("oum_location_text")),t=(a&&(a.value=o.text||""),document.getElementById("oum_location_video")),t;if(t&&o.video&&(t.value=o.video),o.custom_fields&&Array.isArray(o.custom_fields)&&o.custom_fields.forEach(o=>{if(o&&void 0!==o.index)if("checkbox"===o.fieldtype){let n=Array.isArray(o.val)?o.val:[o.val];var t=document.querySelectorAll(`input[type="checkbox"][name="oum_location_custom_fields[${o.index}][]"]`);0<t.length&&t.forEach(e=>{var t,o;e&&(t=e.value.trim(),o=n.map(e=>(e||"").toString().trim()),e.checked=o.includes(t))})}else if("radio"===o.fieldtype){var t=document.querySelectorAll(`input[type="radio"][name="oum_location_custom_fields[${o.index}]"]`);0<t.length&&t.forEach(e=>{e&&(e.checked=e.value===o.val)})}else if("select"===o.fieldtype){let e=document.querySelector(`[name="oum_location_custom_fields[${o.index}][]"]`);var n=!!e;if((e=e||document.querySelector(`[name="oum_location_custom_fields[${o.index}]"]`))&&"SELECT"===e.tagName){let t=Array.isArray(o.val)?o.val.map(e=>(e||"").toString().trim()):[(o.val||"").toString().trim()];Array.from(e.options).forEach(e=>{e.selected=t.includes((e.value||"").toString().trim())})}}else if("opening_hours"===o.fieldtype)try{var e=JSON.parse(o.val),a,r,i;e&&"object"==typeof e&&(a=document.querySelector(`input[name="oum_location_custom_fields[${o.index}][hours]"]`),i=(r=document.querySelector(`[data-custom-field-index="${o.index}"]`))&&"1"===r.dataset.use12hour,a)&&"undefined"!=typeof OUMOpeningHours&&(a.value=OUMOpeningHours.formatForInput(e,i))}catch(e){var t=document.querySelector(`input[name="oum_location_custom_fields[${o.index}][hours]"]`);t&&(t.value=o.val||"")}else{var r=document.querySelector(`[name="oum_location_custom_fields[${o.index}]"]`);r&&(r.value=o.val||"")}}),o.image){var n=o.image.split("|").filter(e=>e);let t=document.getElementById("oum_location_images_preview");var a=document.getElementById("oum_location_images");a&&0<n.length&&a.removeAttribute("required"),t&&(t.innerHTML="",n.forEach(e=>{var e;e&&(e=OUMMedia.createExistingImagePreview(e))&&(e.style.opacity="0",e.style.transform="scale(0.9)",e.style.transition="all 0.3s ease",e.style.opacity="1",e.style.transform="scale(1)",t.appendChild(e))}))}o.audio&&(OUMMedia.setExistingAudio(o.audio),document.getElementById("oum_remove_existing_audio").value="0"),"point"!==e&&o.geometry?(OUMFormMap.setPolylineGeometry(o.geometry),OUMFormMap.startEditLayersTool()):o.lat&&o.lng&&(t=o.zoom?Number(o.zoom):12,OUMFormMap.setView(o.lat,o.lng,t),OUMFormMap.setLocation(o.lat,o.lng)),OUMCheckboxValidation.syncAllGroups()}function y(){i=!1,l=null,a=[],window.oumSelectedFiles=[];var t=document.querySelector(".add-location"),t=(t&&t.classList.remove("edit-location"),document.getElementById("oum_add_location")),o=document.getElementById("oum_add_location_error"),e=document.getElementById("oum_add_location_thankyou"),t,t=(t&&(t.reset(),t.style.display="block"),void 0!==OUMFormMap&&(t=document.getElementById("oum_geometry_type"),OUMFormMap.setGeometryType(t&&t.value?t.value:"point",{autoStartDrawing:!1}),OUMFormMap.clearPolyline()),window.map_locate_process&&window.map_locate_process.stop(),document.querySelectorAll('[name^="oum_location_custom_fields"]')),t=(t&&t.forEach(e=>{"checkbox"===e.type||"radio"===e.type?e.checked=!1:"select-one"===e.type?e.selectedIndex=0:e.value=""}),document.getElementById("oum_post_id")),t=(t&&(t.value=""),document.getElementById("oum_delete_location"));t&&(t.value=""),o&&(o.style.display="none"),e&&(e.style.display="none",e.classList.remove("oum-delete-confirmation"));let n=document.getElementById("oum_location_images_preview");n&&(n.innerHTML="");var t=document.getElementById("oum_location_audio");if(t){let e=t.nextElementSibling;var o=e.querySelector(".audio-preview");t.value="",o&&(o.innerHTML=""),e.classList.remove("active")}var e=document.getElementById("oum_remove_existing_image"),t=(e&&(e.value="0"),document.getElementById("oum_remove_existing_audio")),o=(t&&(t.value="0"),document.getElementById("oum_author")),e=(o&&o.classList.remove("active"),document.getElementById("oum_location_author_name")),t=document.getElementById("oum_location_author_email");e&&t&&(e.required=!1,t.required=!1)}return{init:function(){o(),e(),p()}
16,showFormMessage:t,openForm:s,closeForm:c,resetForm:y,populateForm:g,isEditMode:function(){return i},getCurrentLocationId:function(){return l}}})(),OUMMedia=(()=>{let s=[],e,t,o,r,n=!1;function a(t){var e;t&&((e=t.parentElement.querySelector('label[for="oum_location_images"]'))&&e.addEventListener("click",function(e){e.preventDefault(),t.click()}),document.addEventListener("mousemove",h),document.addEventListener("mouseup",v),t.parentElement.querySelector(".image-preview-container")&&t.parentElement.querySelector(".image-preview-container").addEventListener("dragover",b),t.addEventListener("change",c))}function i(){let t=document.getElementById("oum_location_audio");var e;t&&((e=t.parentElement.querySelector('label[for="oum_location_audio"]'))&&e.addEventListener("click",function(e){e.preventDefault(),t.click()}),t.addEventListener("change",l))}function l(e){var e=e.target,t=e.nextElementSibling,o=t.querySelector(".audio-preview"),e,t,n;e.files&&e.files[0]&&(e=e.files[0],t.classList.add("active"),(t=document.createElement("audio")).controls=!0,t.style.width="100%",(n=document.createElement("source")).src=URL.createObjectURL(e),n.type=e.type,t.appendChild(n),o.innerHTML="",o.appendChild(t))}function u(e){var t,t,o,t,n;e&&(t=document.getElementById("oum_location_audio"))&&(o=(t=t.nextElementSibling).querySelector(".audio-preview"),t.classList.add("active"),(t=document.createElement("audio")).controls=!0,t.style.width="100%",(n=document.createElement("source")).src=e,n.type="audio/"+e.split(".").pop(),t.appendChild(n),o.innerHTML="",o.appendChild(t))}function c(e){var t=e.target,o=document.getElementById("oum_location_images_preview"),t=parseInt(t.dataset.maxFiles)||5;let n=OUMConfig.defaults.media.maxImageSize;var e=Array.prototype.slice.call(e.target.files),a=s.length,r,t=(t<a+e.length&&alert(OUMUtils.sprintf(oum_custom_strings.max_files_exceeded,t,t-a)),t-a),a=e.slice(0,t),e;let i=[],l=[];a.forEach(e=>{e.size>n?l.push(e.name):i.push(e)}),0<l.length&&(e=Math.round(n/1048576),alert(OUMUtils.sprintf(oum_custom_strings.max_filesize_exceeded,e,l.join("\n")))),s=[...s,...i],d(i,o),window.oumSelectedFiles=s}function d(e,n){e.forEach(o=>{var e=new FileReader;e.onload=function(e){let t=m(e.target.result,o.name);t.style.opacity="0",t.style.transform="scale(0.9)",n.appendChild(t),setTimeout(()=>{t.style.transition="all 0.3s ease",t.style.opacity="1",t.style.transform="scale(1)"},50)},e.readAsDataURL(o)})}function m(e,t,o){var n=document.createElement("div"),t=(n.className=o?"image-preview-item existing-image":"image-preview-item",t&&(n.dataset.fileName=t),e&&(n.dataset.url=e),document.createElement("img")),a=(t.setAttribute("alt","Preview"),t.src=e,document.createElement("div")),r=(a.className="remove-image",a.setAttribute("title","Remove image"),a.textContent="×",document.createElement("div")),t,a=(r.className="drag-handle",r.setAttribute("title","Drag to reorder"),r.textContent="⋮⋮",n.appendChild(t),n.appendChild(a),n.appendChild(r),o&&((t=document.createElement("input")).type="hidden",t.name="existing_images[]",t.value=e,n.appendChild(t)),n.querySelector(".remove-image"));return a&&a.addEventListener("click",p),g(n),n}function p(e){e.preventDefault();let o=this.closest(".image-preview-item");if(o.classList.contains("existing-image")){var e=o.querySelector("[name='existing_images[]']").value,t=document.getElementById("oum_remove_existing_image"),n="0"===t.value?[]:t.value.split("|");n.push(e),t.value=n.join("|")}
16else{let t=o.dataset.fileName;s=s.filter(e=>e.name!==t),window.oumSelectedFiles=s}o.style.transition="all 0.3s ease",o.style.transform="scale(0.8)",o.style.opacity="0",setTimeout(()=>{o.remove()},300)}function g(e){e.setAttribute("draggable","true"),e.addEventListener("mousedown",function(e){var t;e.target.classList.contains("remove-image")||(n=!0,this.classList.add("dragging"),t=this.getBoundingClientRect(),this.style.width=t.width+"px",this.style.height=t.height+"px",this.initialContainer=this.closest(".oum-image-preview-grid"),y(this),this.style.position="fixed",this.style.zIndex="1000",this.style.opacity="0.9",this.style.transform="scale(1.05) rotate(1deg)",this.style.pointerEvents="none",this.style.boxShadow="0 5px 15px rgba(0,0,0,0.15)",f(this,e),document.body.style.cursor="grabbing")}),e.addEventListener("touchstart",w)}function y(e){(r=document.createElement("div")).classList.add("image-preview-placeholder"),r.style.width=e.offsetWidth+"px",r.style.height=e.offsetHeight+"px",r.style.transition="transform 0.2s ease",r.style.border="2px dashed #e82c71",r.style.borderRadius="4px",r.style.backgroundColor="rgba(224, 42, 175, 0.05)",e.parentNode.insertBefore(r,e)}function f(e,t){var o=e.getBoundingClientRect(),n=o.width/2,o=o.height/2;e.style.left=t.clientX-n+"px",e.style.top=t.clientY-o+"px"}function _(n){var e=document.getElementById("oum_location_images_preview"),t,o,a;e&&document.querySelector(".dragging")&&((a=[...e.querySelectorAll(".image-preview-item:not(.dragging)")].reduce((e,t)=>{var o=t.getBoundingClientRect(),o=o.left+o.width/2,o=n.clientX-o;return o<0&&(!e.element||o>e.offset)?{offset:o,element:t}:e},{offset:Number.NEGATIVE_INFINITY,element:null})).element?e.insertBefore(r,a.element):e.appendChild(r))}function h(e){var t,t,t,o;n&&(t=document.querySelector(".dragging"))&&(f(t,e),t=document.getElementById("oum_location_images_preview"))&&(t=t.getBoundingClientRect(),!(e.clientX>=t.left-50&&e.clientX<=t.right+50&&e.clientY>=t.top-50&&e.clientY<=t.bottom+50)&&r?r.style.display="none":r&&(r.style.display="block",_(e)))}function v(){var e=document.querySelector(".dragging"),t;e&&(document.body.style.cursor="",(t=document.getElementById("oum_location_images_preview"))?r&&"none"!==r.style.display?(e.style.transition="none",r.parentNode.insertBefore(e,r)):t.appendChild(e):e.initialContainer&&e.initialContainer.appendChild(e),r&&r.remove(),e.style.position="",e.style.zIndex="",e.style.top="",e.style.left="",e.style.width="",e.style.height="",e.style.transform="",e.style.pointerEvents="",e.style.boxShadow="",e.classList.remove("dragging"),n=!1)}function w(e){var e=e.touches[0],e=new MouseEvent("mousedown",{clientX:e.clientX,clientY:e.clientY});this.dispatchEvent(e)}function b(e){var t,e;e.preventDefault(),e.stopPropagation(),document.querySelector(".dragging")&&(null==(e=getDragAfterElement(this,e.clientX))?this.appendChild(r):this.insertBefore(r,e))}return{init:function(){i()},initializeImageUpload:function(e){a(e)},getSelectedFiles:function(){return s},setupDragAndDrop:g,handleRemoveImage:p,createExistingImagePreview:function(e){return e?m(e,"",!0):null},setExistingAudio:u}})(),OUMCheckboxValidation=(()=>{function n(e){var t=e.some(e=>e.checked),o;e[0].required=!t}function e(){var e=document.querySelectorAll('.oum-checkbox-group.is-required input[type="checkbox"]');if(!e.length)return{};let o={};return e.forEach(e=>{var t=e.name;o[t]||(o[t]=[]),o[t].push(e)}),o}function o(t,e=!0){var o;t[0].required&&(e&&t.forEach(e=>e.addEventListener("change",()=>n(t))),n(t))}function t(){let t=e();Object.keys(t).forEach(e=>{o(t[e],!0)})}return{init:function(){t()},syncAllGroups:function(){let t=e();Object.keys(t).forEach(e=>{o(t[e],!1)})}}})(),OUMAdvancedFilter=(()=>{let e=!1,r=null;function t(){e||(r=document.querySelector(".oum-advanced-filter-sidebar"))&&(n(),o(),e=!0)}function o(){let o=document.querySelector(".oum-advanced-filter-button, .oum-advanced-filter-panel");if(o&&o.classList.contains("use-collapse")){var e=o.querySelector(".oum-advanced-filter-toggle"),n=o.querySelector(".close-advanced-filter");let t=o.closest(".oum-map-filter-wrapper");e&&e.addEventListener("click",function(e){e.stopPropagation(),o.classList.toggle("active")}),n&&n.addEventListener("click",function(e){e.stopPropagation(),o.classList.remove("active")}),t&&document.addEventListener("click",function(e){t.contains(e.target)||o.classList.remove("active")})}}function n(){var e=r.querySelectorAll(".oum-advanced-filter-input"),t=r.querySelectorAll(".oum-advanced-filter-checkbox"),o=r.querySelectorAll(".oum-advanced-filter-radio"),n=r.querySelectorAll(".oum-advanced-filter-select"),e=(e.forEach(e
16=>{e.addEventListener("input",a)}),t.forEach(e=>{e.addEventListener("change",a)}),o.forEach(e=>{e.addEventListener("change",a)}),n.forEach(e=>{e.addEventListener("change",a)}),r.querySelector("#oum-advanced-filter-reset"));e&&e.addEventListener("click",l)}function a(){var e;void 0!==OUMMarkers&&OUMMarkers.setCustomfieldsFilter?(e=i(),OUMMarkers.setCustomfieldsFilter(e)):console.warn("OUMMarkers not available for advanced filtering")}function i(){let n={};var e,t,o,a;return r&&(r.querySelectorAll(".oum-advanced-filter-input").forEach(e=>{var t=e.dataset.customFieldId;t&&e.value.trim()&&(n[t]={type:"text",value:e.value.trim().toLowerCase()})}),r.querySelectorAll(".oum-advanced-filter-checkbox").forEach(e=>{var t=e.dataset.customFieldId,o=e.dataset.filterType,o,o;t&&("opening_hours_open_now"===o?e.checked&&(n[t]={type:"opening_hours_open_now",value:"open"}):(n[t]||(o=(o=e.closest(".oum-checkbox-group"))&&o.dataset.checkboxRelation||"OR",n[t]={type:"checkbox",values:[],relation:o}),e.checked&&n[t].values.push(e.value)))}),r.querySelectorAll(".oum-advanced-filter-radio").forEach(e=>{var t=e.dataset.customFieldId;t&&e.checked&&(n[t]={type:"radio",value:e.value})}),r.querySelectorAll(".oum-advanced-filter-select").forEach(e=>{var t=e.dataset.customFieldId;t&&e.value&&(n[t]={type:"select",value:e.value})}),Object.keys(n).forEach(e=>{var t=n[e];"checkbox"===t.type&&0===t.values.length&&delete n[e]})),n}function l(){var e,t,o,n;r.querySelectorAll(".oum-advanced-filter-input").forEach(e=>{e.value=""}),r.querySelectorAll(".oum-advanced-filter-checkbox").forEach(e=>{e.checked=!1}),r.querySelectorAll(".oum-advanced-filter-radio").forEach(e=>{e.checked=!1}),r.querySelectorAll(".oum-advanced-filter-select").forEach(e=>{e.selectedIndex=0}),void 0!==OUMMarkers&&OUMMarkers.setCustomfieldsFilter&&OUMMarkers.setCustomfieldsFilter(null),void 0!==OUMMarkers&&OUMMarkers.resetCategoriesFilter&&OUMMarkers.resetCategoriesFilter(),s()}function s(){var e=document.getElementById("oum_filter_markers"),e=(e&&(e.value="",void 0!==OUMMarkers)&&OUMMarkers.updateSearchtextAndCategoriesFilters&&OUMMarkers.updateSearchtextAndCategoriesFilters(),document.querySelector("#oum_search_marker .search-cancel")),e,e=(e?e.click():(e=document.querySelector("#oum_search_marker .search-input"))&&(e.value="",e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("keyup",{bubbles:!0}))),document.querySelector("#oum_search_address button.reset, .oum-searchbar-filter .leaflet-geosearch-bar button.reset")),e;e?e.click():(e=document.querySelector("#oum_search_address input, .oum-searchbar-filter .leaflet-geosearch-bar input"))&&(e.value="")}return{init:t}})();function oumInitializeMap(){if(document.getElementById(map_el)){OUMOpeningHours.init(),window.L=window.OUMLeaflet.L;var e=OUMMap.init(map_el),t=OUMMarkers.init(e),t=("undefined"!=typeof oum_all_locations&&Array.isArray(oum_all_locations)&&t.addMarkers(oum_all_locations),OUMFormMap.init(e),OUMFormController.init(),OUMMedia.init(),OUMCheckboxValidation.init(),OUMAdvancedFilter.init(),document.getElementById("oum_filter_markers")),e=(t&&t.addEventListener("input",OUMMarkers.updateSearchtextAndCategoriesFilters),document.querySelectorAll('.open-user-map .oum-marker-categories-filter [name="type"]'));if(0<e.length&&e.forEach(e=>{e.addEventListener("change",OUMMarkers.updateSearchtextAndCategoriesFilters)}),"undefined"!=typeof custom_js&&custom_js.snippet)try{var o=`
17        try {
18          if (typeof document !== 'undefined') {
19            // Defer map2-related code execution
20            if (${custom_js.snippet.includes("oumMap2")}) {
21              // Create a MutationObserver to watch for the form map initialization
22              const observer = new MutationObserver((mutations) => {
23                if (window.oumMap2) {
24                  // Execute the custom JS only when oumMap2 is available
25                  try {
26                    ${custom_js.snippet}
27                  } catch (e) {
28                    console.warn('Custom JS execution error (deferred):', e);
29                  }
30                  observer.disconnect();
31                }
32              });
33
34              // Start observing the document for the form map to be added
35              observer.observe(document.body, {
36                childList: true,
37                subtree: true
38              });
39            } else {
40              // Execute non-map2 related code immediately
41              ${custom_js.snippet}
42            }
43          }
44        } catch (e) {
45          console.warn('Custom JS execution error:', e);
46        }
47      `;Function(o)()}catch(e){console.warn("Error executing custom JS:",e)}}else console.warn("‼️ Open User Map: Map container missing. Initialization aborted. Disable page caching if applicable, or contact [email protected] for help.")}
48function oumShowError(o){let e=jQuery("#oum_add_location_error");e.html(""),o.forEach(o=>{e.append(o.message+"<br>")}),e.show()}jQuery("#oum_add_location").submit(function(o){var o;jQuery("#oum_submit_btn").addClass("oum-loading"),o.preventDefault(),window.oumMap2&&"function"==typeof window.oumMap2.getZoom&&(o=document.getElementById("oum_location_zoom"))&&(o.value=window.oumMap2.getZoom()),"undefined"!=typeof OUMFormMap&&"function"==typeof OUMFormMap.syncGeometryFields&&OUMFormMap.syncGeometryFields();let s=new FormData(this);var e,o=(document.querySelectorAll(".oum-opening-hours-input").forEach(function(o){var e=o.name,t=e.match(/\[(\d+)\]/);if(t){var t=t[1],o=o.value.trim();
48if(s.delete(e),""!==o){if("undefined"==typeof OUMOpeningHours||!OUMOpeningHours.validateFormat(o))return oumShowError([{message:"undefined"!=typeof oum_opening_hours&&oum_opening_hours.invalid_format?oum_opening_hours.invalid_format:"Invalid opening hours format. Expected format: Mo 09:00-18:00 or Mo 9:00 AM-5:00 PM"}]),jQuery("#oum_submit_btn").removeClass("oum-loading"),!1;s.append(`oum_location_custom_fields[${t}][hours]`,o)}}}),document.getElementById("oum_location_images_preview")),t;let a=[];o&&(o.querySelectorAll(".image-preview-item").forEach((o,e)=>{if(o.classList.contains("existing-image")){var t=o.querySelector('[name="existing_images[]"]');if(t){let e=t.value;if(e.startsWith("http"))try{var n=new URL(e);e=n.pathname}catch(o){console.log("Could not parse URL:",e)}s.append("existing_images[]",e),a.push("existing:"+e)}}else{let e=o.dataset.fileName;var t=window.oumSelectedFiles.find(o=>o.name===e);t&&(s.append("oum_location_images[]",t),a.push("new:"+e))}}),s.append("image_order",JSON.stringify(a))),s.append("action","oum_add_location_from_frontend"),jQuery.ajax({type:"POST",url:oum_ajax.ajaxurl,cache:!1,contentType:!1,processData:!1,data:s,success:function(o,e,t){var o,n,o,n,o,n,o,n;jQuery("#oum_submit_btn").removeClass("oum-loading"),0==o.success&&oumShowError(o.data),1==o.success&&(jQuery("#oum_add_location").trigger("reset"),o=document.getElementById("oum_delete_location"),n=document.getElementById("oum_post_id"),o&&"true"===o.value?OUMFormController.showFormMessage("success",oum_custom_strings.location_deleted,oum_custom_strings.delete_success,oum_custom_strings.close_and_refresh,function(){window.location.reload()}):n&&n.value?OUMFormController.showFormMessage("success",oum_custom_strings.changes_saved,oum_custom_strings.changes_saved_message,oum_custom_strings.close_and_refresh,function(){window.location.reload()}):"undefined"!=typeof oum_action_after_submit?"refresh"===oum_action_after_submit?window.location.reload():"redirect"===oum_action_after_submit&&"undefined"!=typeof thankyou_redirect&&""!==thankyou_redirect?window.location.href=thankyou_redirect:(n=(o=document.getElementById("oum_add_location_thankyou"))?.querySelector("h3")?.textContent||oum_custom_strings.thank_you,o=o?.querySelector(".oum-add-location-thankyou-text")?.textContent||oum_custom_strings.thank_you_message,OUMFormController.showFormMessage("success",n,o,oum_custom_strings.close_and_refresh,function(){window.location.reload()})):(o=(n=document.getElementById("oum_add_location_thankyou"))?.querySelector("h3")?.textContent||oum_custom_strings.thank_you,n=n?.querySelector(".oum-add-location-thankyou-text")?.textContent||oum_custom_strings.thank_you_message,OUMFormController.showFormMessage("success",o,n,oum_custom_strings.close_and_refresh,function(){window.location.reload()})))},error:function(o,e,t){console.log(t)}})});
49let OUMCarousel=(()=>{function e(){var e;new MutationObserver(e=>{e.forEach(e=>{e.addedNodes.length&&e.addedNodes.forEach(e=>{t(e)}),t(e.target)})}).observe(document.body,{childList:!0,subtree:!0,characterData:!0}),document.querySelectorAll(".open-user-map-locations-list .oum-carousel").forEach(e=>{n(e)}),document.querySelectorAll(".oum-location-value .oum-carousel").forEach(e=>{n(e)})}function t(e){e&&1===e.nodeType&&(e.classList&&e.classList.contains("oum-carousel")&&n(e),e.querySelectorAll(".oum-carousel").forEach(e=>{n(e)}))}function n(r){if(r&&"1"!==r.dataset.oumCarouselInitialized){let o=r.querySelectorAll(".oum-carousel-item");if(!(o.length<=1)){r.dataset.oumCarouselInitialized="1";let e=0,{prevBtn:t,nextBtn:n,counter:a}=l();function c(){a.textContent="1/"+o.length}r.appendChild(t),r.appendChild(n),r.appendChild(a),u(o,t,n,a,0),o[0].classList.add("active"),c()}}}function l(){var e=document.createElement("button"),t=(e.className="oum-carousel-prev",e.setAttribute("aria-label","Previous image"),document.createElement("button")),n=(t.className="oum-carousel-next",t.setAttribute("aria-label","Next image"),document.createElement("div"));return n.className="oum-carousel-counter",{prevBtn:e,nextBtn:t,counter:n}}function u(t,e,n,a,o){function r(e){t[o].classList.remove("active"),(o=(o=e)<0?t.length-1:o)>=t.length&&(o=0),t[o].classList.add("active"),a.textContent=o+1+"/"+t.length}e.addEventListener("click",()=>r(o-1)),n.addEventListener("click",()=>r(o+1)),document.addEventListener("keydown",e=>{t[o].closest(".leaflet-popup-content-wrapper")&&("ArrowLeft"===e.key&&r(o-1),"ArrowRight"===e.key)&&r(o+1)});let c=0;t[0].parentElement.addEventListener("touchstart",e=>{c=e.changedTouches[0].screenX},!1),t[0].parentElement.addEventListener("touchend",e=>{var e=e.changedTouches[0].screenX,e=c-e;50<Math.abs(e)&&r(0<e?o+1:o-1)},!1)}return{init:function(){e()}}})();
49jQuery(document).ready(function(e){OUMCarousel.init()});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.