@defra/interactive-map 0.0.43-fmp-experimental → 0.0.44-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/templates/add-polygons.njk +5 -1
- package/assets/templates/add-symbols.njk +5 -1
- package/dist/css/index.css +1 -1
- package/dist/esm/im-core.js +1 -1
- package/dist/esm/im-shell.js +1 -1
- package/dist/umd/im-core.js +1 -1
- package/dist/umd/index.js +1 -1
- package/docs/api/context.md +24 -0
- package/docs/api/keyboard-shortcut-definition.md +102 -0
- package/docs/api.md +18 -8
- package/docs/building-a-plugin.md +1 -0
- package/docs/plugins/draw.md +2 -2
- package/docs/plugins/plugin-manifest.md +9 -0
- package/package.json +4 -2
- package/plugins/beta/draw-es/dist/esm/im-draw-es-plugin.js +1 -1
- package/plugins/beta/draw-es/src/api/newPolygon.js +1 -0
- package/plugins/beta/draw-es/src/events.js +17 -8
- package/plugins/beta/draw-es/src/reducer.js +8 -1
- package/plugins/beta/draw-ml/dist/esm/im-draw-ml-plugin.js +1 -1
- package/plugins/beta/draw-ml/dist/umd/im-draw-ml-plugin.js +1 -1
- package/plugins/beta/draw-ol/dist/css/index.css +1 -13
- package/plugins/beta/draw-ol/dist/esm/im-draw-ol-plugin.js +1 -1
- package/plugins/beta/frame/dist/css/index.css +1 -11
- package/plugins/beta/frame/dist/esm/im-frame-plugin.js +1 -1
- package/plugins/beta/frame/dist/umd/im-frame-plugin.js +1 -1
- package/plugins/beta/frame/src/Frame.jsx +28 -2
- package/plugins/beta/map-styles/dist/css/index.css +1 -1
- package/plugins/beta/map-styles/dist/umd/im-map-styles-plugin.js +1 -1
- package/plugins/beta/map-styles/dist/umd/index.js +1 -1
- package/plugins/beta/scale-bar/dist/css/index.css +1 -8
- package/plugins/datasets/dist/css/5648.index.css +1 -5
- package/plugins/datasets/dist/css/index.css +1 -1
- package/plugins/datasets/dist/esm/im-datasets-plugin.js +1 -1
- package/plugins/datasets/dist/umd/im-datasets-plugin.js +1 -1
- package/plugins/datasets/src/components/LayersMenu/Layers.module.scss +1 -0
- package/plugins/datasets/src/initialise/DatasetsInit.jsx +2 -2
- package/plugins/datasets/src/initialise/DatasetsInit.test.jsx +6 -5
- package/plugins/datasets/src/registry/dataset.js +8 -12
- package/plugins/datasets/src/registry/dataset.test.js +17 -0
- package/plugins/datasets/src/registry/datasetRegistry.js +4 -5
- package/plugins/draw/dist/esm/im-draw-ml-adapter.js +1 -1
- package/plugins/draw/dist/esm/im-draw-ol-adapter.js +1 -1
- package/plugins/draw/dist/esm/im-draw-plugin.js +1 -1
- package/plugins/draw/dist/esm/index.js +1 -1
- package/plugins/draw/dist/umd/im-draw-ml-adapter.js +1 -1
- package/plugins/draw/dist/umd/im-draw-ol-adapter.js +1 -1
- package/plugins/draw/dist/umd/im-draw-plugin.js +1 -1
- package/plugins/draw/dist/umd/index.js +1 -1
- package/plugins/draw/src/DrawInit.jsx +41 -26
- package/plugins/draw/src/DrawInit.test.jsx +55 -12
- package/plugins/draw/src/adapters/maplibre/MaplibreDrawAdapter.js +113 -114
- package/plugins/draw/src/adapters/maplibre/MaplibreDrawAdapter.test.js +82 -9
- package/plugins/draw/src/adapters/maplibre/drawEvents.js +3 -1
- package/plugins/draw/src/adapters/maplibre/modes/createDrawMode.test.js +1 -1
- package/plugins/draw/src/adapters/maplibre/modes/drawMode/__helpers__/harness.js +18 -9
- package/plugins/draw/src/adapters/maplibre/modes/drawMode/clickHandlers.js +9 -1
- package/plugins/draw/src/adapters/maplibre/modes/drawMode/clickHandlers.test.js +11 -1
- package/plugins/draw/src/adapters/maplibre/modes/drawMode/lifecycle.js +23 -2
- package/plugins/draw/src/adapters/maplibre/modes/drawMode/lifecycle.test.js +53 -0
- package/plugins/draw/src/adapters/maplibre/modes/drawMode/pointerHandlers.js +29 -19
- package/plugins/draw/src/adapters/maplibre/modes/drawMode/pointerHandlers.test.js +17 -2
- package/plugins/draw/src/adapters/maplibre/modes/drawMode/undoHandlers.test.js +1 -1
- package/plugins/draw/src/adapters/maplibre/modes/drawPointMode.js +35 -29
- package/plugins/draw/src/adapters/maplibre/modes/drawPointMode.test.js +24 -6
- package/plugins/draw/src/adapters/maplibre/modes/editPointMode/keyboardHandlers.js +22 -20
- package/plugins/draw/src/adapters/maplibre/modes/editPointMode/pointOperations.js +1 -1
- package/plugins/draw/src/adapters/maplibre/modes/editPointMode.js +2 -2
- package/plugins/draw/src/adapters/maplibre/modes/editPointMode.test.js +3 -3
- package/plugins/draw/src/adapters/maplibre/modes/editVertexMode/geometryHelpers.js +31 -0
- package/plugins/draw/src/adapters/maplibre/modes/editVertexMode/geometryHelpers.test.js +8 -1
- package/plugins/draw/src/adapters/maplibre/modes/editVertexMode/keyboardHandlers.js +38 -30
- package/plugins/draw/src/adapters/maplibre/modes/editVertexMode/keyboardHandlers.test.js +20 -3
- package/plugins/draw/src/adapters/maplibre/modes/editVertexMode/pointerHandlers.js +5 -5
- package/plugins/draw/src/adapters/maplibre/modes/editVertexMode/touchHandlers.js +2 -2
- package/plugins/draw/src/adapters/maplibre/modes/editVertexMode/touchHandlers.test.js +2 -2
- package/plugins/draw/src/adapters/maplibre/modes/editVertexMode/undoHandlers.js +3 -3
- package/plugins/draw/src/adapters/maplibre/modes/editVertexMode/undoHandlers.test.js +7 -7
- package/plugins/draw/src/adapters/maplibre/modes/editVertexMode/vertexOperations.js +4 -4
- package/plugins/draw/src/adapters/maplibre/modes/editVertexMode/vertexOperations.test.js +14 -14
- package/plugins/draw/src/adapters/maplibre/modes/editVertexMode/vertexQueries.js +12 -32
- package/plugins/draw/src/adapters/maplibre/modes/editVertexMode/vertexQueries.test.js +10 -10
- package/plugins/draw/src/adapters/maplibre/modes/editVertexMode.js +48 -22
- package/plugins/draw/src/adapters/maplibre/modes/editVertexMode.test.js +74 -6
- package/plugins/draw/src/adapters/maplibre/utils/snapMovement.js +2 -2
- package/plugins/draw/src/adapters/openlayers/OLDrawAdapter.js +6 -0
- package/plugins/draw/src/adapters/openlayers/OLDrawAdapter.test.js +9 -0
- package/plugins/draw/src/adapters/openlayers/core/OLDrawManager.js +15 -2
- package/plugins/draw/src/adapters/openlayers/core/OLDrawManager.test.js +27 -1
- package/plugins/draw/src/adapters/openlayers/draw/DrawMode.test.js +1 -1
- package/plugins/draw/src/adapters/openlayers/draw/drawInput.js +40 -17
- package/plugins/draw/src/adapters/openlayers/draw/drawInput.test.js +55 -1
- package/plugins/draw/src/adapters/openlayers/draw/vertexPlacement.js +13 -7
- package/plugins/draw/src/adapters/openlayers/draw/vertexPlacement.test.js +7 -15
- package/plugins/draw/src/adapters/openlayers/edit/EditMode.js +36 -4
- package/plugins/draw/src/adapters/openlayers/edit/EditMode.test.js +41 -1
- package/plugins/draw/src/adapters/openlayers/edit/keyboardHandler.js +35 -25
- package/plugins/draw/src/adapters/openlayers/edit/keyboardHandler.test.js +40 -2
- package/plugins/draw/src/adapters/openlayers/edit/nudge.js +2 -2
- package/plugins/draw/src/adapters/openlayers/edit/nudge.test.js +2 -2
- package/plugins/draw/src/adapters/openlayers/point/drawPointMode.js +40 -54
- package/plugins/draw/src/adapters/openlayers/point/drawPointMode.test.js +32 -13
- package/plugins/draw/src/adapters/openlayers/point/editPointMode.js +1 -1
- package/plugins/draw/src/adapters/openlayers/point/editPointMode.test.js +17 -1
- package/plugins/draw/src/events.js +4 -4
- package/plugins/draw/src/events.test.js +1 -1
- package/plugins/draw/src/hooks/useSpatialList.js +180 -0
- package/plugins/draw/src/hooks/useSpatialList.test.js +339 -0
- package/plugins/draw/src/manifest.js +4 -1
- package/plugins/draw/src/manifest.test.js +19 -7
- package/plugins/draw/src/utils/spatial.js +1 -31
- package/plugins/draw/src/utils/spatial.test.js +1 -24
- package/plugins/interact/dist/esm/im-interact-plugin.js +1 -1
- package/plugins/interact/dist/umd/im-interact-plugin.js +1 -1
- package/plugins/interact/dist/umd/index.js +1 -1
- package/plugins/interact/src/InteractInit.jsx +2 -2
- package/plugins/interact/src/InteractInit.test.js +3 -3
- package/plugins/interact/src/events.js +11 -2
- package/plugins/interact/src/events.test.js +32 -0
- package/plugins/interact/src/hooks/useAttachEvents.js +20 -0
- package/plugins/interact/src/hooks/useAttachEvents.test.js +44 -1
- package/plugins/interact/src/hooks/useCrossHairVisibility.js +9 -4
- package/plugins/interact/src/hooks/useCrossHairVisibility.test.js +7 -7
- package/plugins/interact/src/hooks/useSpatialList.js +251 -0
- package/plugins/interact/src/hooks/{useMapItemList.test.js → useSpatialList.test.js} +216 -70
- package/plugins/interact/src/manifest.js +12 -1
- package/plugins/interact/src/manifest.test.js +20 -0
- package/plugins/interact/src/utils/spatial.js +24 -1
- package/plugins/interact/src/utils/spatial.test.js +26 -1
- package/plugins/map-key/dist/css/index.css +1 -106
- package/plugins/map-key/dist/esm/im-map-key-plugin.js +1 -1
- package/plugins/map-key/dist/umd/im-map-key-plugin.js +1 -1
- package/plugins/map-key/dist/umd/index.js +1 -1
- package/plugins/map-key/src/components/Key/Key.jsx +3 -4
- package/plugins/map-key/src/components/Key/Key.module.scss +10 -8
- package/plugins/map-key/src/components/Key/KeyGroupItem.test.jsx +2 -2
- package/plugins/map-key/src/components/Key/KeyItem.jsx +2 -2
- package/plugins/map-key/src/components/Key/KeySvg.jsx +9 -7
- package/plugins/map-key/src/components/Key/KeySvg.test.jsx +4 -4
- package/plugins/map-key/src/components/Key/MapKey.jsx +5 -3
- package/plugins/map-key/src/manifest.js +1 -1
- package/plugins/map-key/src/utils/groupStyles.js +7 -0
- package/plugins/map-key/src/utils/mergeKeyGroupItems.js +12 -0
- package/plugins/map-key/src/utils/mergeKeyGroupItems.test.js +53 -0
- package/plugins/menu/dist/css/index.css +1 -80
- package/plugins/menu/dist/esm/im-menu-plugin.js +1 -1
- package/plugins/menu/dist/umd/im-menu-plugin.js +1 -1
- package/plugins/menu/dist/umd/index.js +1 -1
- package/plugins/menu/src/initialise/MenuInit.jsx +15 -3
- package/plugins/menu/src/initialise/MenuInit.test.jsx +25 -0
- package/plugins/menu/src/initialise/createMenu.js +3 -1
- package/plugins/menu/src/initialise/createMenu.test.js +20 -5
- package/plugins/menu/src/initialise/updateUrl.js +44 -0
- package/plugins/menu/src/initialise/updateUrl.test.js +91 -0
- package/plugins/menu/src/reducers/menuStateReducer.js +19 -1
- package/plugins/menu/src/reducers/menuStateReducer.test.js +53 -20
- package/plugins/menu/src/reducers/pluginState.js +1 -6
- package/plugins/menu/src/reducers/pluginState.test.js +0 -25
- package/plugins/search/dist/css/index.css +1 -1
- package/plugins/search/dist/esm/im-search-plugin.js +1 -1
- package/plugins/search/dist/umd/im-search-plugin.js +1 -1
- package/plugins/search/src/manifest.js +5 -9
- package/plugins/search/src/manifest.test.js +5 -0
- package/providers/beta/esri/dist/css/index.css +1 -34
- package/providers/beta/openlayers/dist/esm/im-openlayers-provider.js +1 -1
- package/providers/beta/openlayers/dist/umd/im-openlayers-provider.js +1 -1
- package/providers/beta/openlayers/src/openlayersProvider.js +3 -3
- package/providers/beta/openlayers/src/openlayersProvider.test.js +6 -3
- package/providers/beta/openlayers/src/utils/queryFeatures.js +72 -0
- package/providers/beta/openlayers/src/utils/queryFeatures.test.js +122 -1
- package/providers/maplibre/dist/esm/im-maplibre-provider.js +1 -1
- package/providers/maplibre/dist/umd/im-maplibre-provider.js +1 -1
- package/providers/maplibre/dist/umd/index.js +1 -1
- package/providers/maplibre/src/defaults.test.js +26 -0
- package/providers/maplibre/src/utils/labels.js +2 -2
- package/providers/maplibre/src/utils/labels.test.js +5 -5
- package/providers/maplibre/src/utils/spatial.js +0 -57
- package/providers/maplibre/src/utils/spatial.test.js +0 -27
- package/rollup.esm.mjs +2 -1
- package/scripts/publish-package.sh +36 -0
- package/src/App/App.jsx +1 -1
- package/src/App/App.test.jsx +6 -1
- package/src/App/components/CrossHair/CrossHair.jsx +25 -11
- package/src/App/components/CrossHair/CrossHair.module.scss +37 -12
- package/src/App/components/CrossHair/CrossHair.test.jsx +40 -11
- package/src/App/components/Hints/Hints.jsx +3 -3
- package/src/App/components/Hints/Hints.test.jsx +3 -3
- package/src/App/components/KeyboardHelp/KeyboardHelp.jsx +4 -1
- package/src/App/components/KeyboardHelp/KeyboardHelp.test.jsx +17 -0
- package/src/App/components/MapButton/MapButton.jsx +19 -7
- package/src/App/components/MapButton/MapButton.module.scss +1 -2
- package/src/App/components/MapButton/MapButton.test.jsx +42 -4
- package/src/App/components/{MoveControls/MoveControls.jsx → MapControls/MapControls.jsx} +10 -10
- package/src/App/components/{MoveControls/MoveControls.module.scss → MapControls/MapControls.module.scss} +25 -25
- package/src/App/components/{MoveControls/MoveControls.test.jsx → MapControls/MapControls.test.jsx} +48 -48
- package/src/App/components/Markers/Markers.jsx +2 -2
- package/src/App/components/Markers/Markers.test.jsx +3 -3
- package/src/App/components/Markers/SymbolMarker.jsx +2 -3
- package/src/App/components/Markers/SymbolMarker.test.jsx +8 -9
- package/src/App/components/Panel/Panel.jsx +19 -20
- package/src/App/components/Panel/Panel.module.scss +5 -0
- package/src/App/components/Panel/Panel.test.jsx +69 -4
- package/src/App/components/PopupMenu/PopupMenu.jsx +7 -3
- package/src/App/components/PopupMenu/PopupMenu.test.jsx +71 -0
- package/src/App/components/PopupMenu/usePopupMenu.js +10 -9
- package/src/App/components/Viewport/MapStatus.jsx +1 -1
- package/src/App/components/Viewport/SpatialList.jsx +47 -0
- package/src/App/components/Viewport/{Features.module.scss → SpatialList.module.scss} +6 -6
- package/src/App/components/Viewport/SpatialList.test.jsx +285 -0
- package/src/App/components/Viewport/Viewport.jsx +21 -11
- package/src/App/components/Viewport/Viewport.test.jsx +18 -2
- package/src/App/controls/keyboardMappings.js +7 -2
- package/src/App/controls/keyboardMappings.test.js +21 -0
- package/src/App/controls/keyboardShortcuts.js +16 -2
- package/src/App/controls/keyboardShortcuts.test.js +21 -0
- package/src/App/hooks/useCrossHairAPI.js +29 -1
- package/src/App/hooks/useCrossHairAPI.test.js +17 -1
- package/src/App/hooks/useHintsAPI.js +5 -5
- package/src/App/hooks/useInterfaceAPI.js +2 -1
- package/src/App/hooks/useInterfaceAPI.test.js +9 -0
- package/src/App/hooks/useKeyboardShortcuts.js +66 -35
- package/src/App/hooks/useKeyboardShortcuts.test.js +52 -0
- package/src/App/hooks/useModalPanelBehaviour.js +48 -34
- package/src/App/hooks/useModalPanelBehaviour.test.js +59 -0
- package/src/App/hooks/useSpatialListFocus.js +296 -0
- package/src/App/hooks/useSpatialListFocus.test.js +957 -0
- package/src/App/hooks/useSpatialListItems.js +51 -0
- package/src/App/hooks/useSpatialListItems.test.js +217 -0
- package/src/App/initialiseApp.js +6 -3
- package/src/App/initialiseApp.test.js +11 -0
- package/src/App/layout/Layout.jsx +4 -2
- package/src/App/layout/Layout.test.jsx +21 -0
- package/src/App/layout/layout.module.scss +7 -1
- package/src/App/registry/keyboardShortcutRegistry.js +2 -2
- package/src/App/registry/keyboardShortcutRegistry.test.js +16 -0
- package/src/App/registry/pluginRegistry.js +13 -0
- package/src/App/registry/pluginRegistry.test.js +15 -0
- package/src/App/registry/spatialListRegistry.js +104 -0
- package/src/App/registry/spatialListRegistry.test.js +218 -0
- package/src/App/renderer/HtmlElementHost.jsx +12 -32
- package/src/App/renderer/mapButtons.js +4 -0
- package/src/App/renderer/mapButtons.test.js +20 -0
- package/src/App/renderer/mapPanels.js +33 -53
- package/src/App/renderer/mapPanels.test.js +29 -4
- package/src/App/renderer/slotHelpers.js +33 -0
- package/src/App/renderer/slotHelpers.test.js +79 -2
- package/src/App/store/AppProvider.jsx +3 -2
- package/src/App/store/ServiceProvider.jsx +5 -3
- package/src/App/store/ServiceProvider.test.jsx +20 -1
- package/src/InteractiveMap/InteractiveMap.js +13 -2
- package/src/InteractiveMap/InteractiveMap.test.js +33 -0
- package/src/config/appConfig.js +16 -16
- package/src/config/appConfig.test.js +19 -19
- package/src/config/defaults.js +2 -2
- package/src/config/events.js +8 -8
- package/src/scss/main.scss +2 -2
- package/src/test-utils.js +8 -0
- package/src/types.js +51 -9
- package/src/utils/findNearestItemInDirection.js +29 -0
- package/src/utils/findNearestItemInDirection.test.js +67 -0
- package/src/utils/getPanelElementId.js +4 -0
- package/src/utils/getPanelElementId.test.js +11 -0
- package/src/utils/getPanelRole.js +22 -0
- package/src/utils/getPanelRole.test.js +56 -0
- package/src/utils/globalAltShortcuts.js +12 -0
- package/src/utils/globalAltShortcuts.test.js +27 -0
- package/src/utils/spatialNavigate.js +49 -0
- package/src/utils/spatialNavigate.test.js +42 -0
- package/webpack.umd.mjs +6 -1
- package/plugins/interact/src/hooks/useMapItemList.js +0 -187
- package/src/App/components/Viewport/Features.jsx +0 -35
- package/src/App/components/Viewport/Features.test.jsx +0 -124
- package/src/App/hooks/useFeatureFocus.js +0 -199
- package/src/App/hooks/useFeatureFocus.test.js +0 -635
- package/src/App/hooks/useFeatureItems.js +0 -39
- package/src/App/hooks/useFeatureItems.test.js +0 -155
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see im-maplibre-provider.js.LICENSE.txt */
|
|
2
|
-
"use strict";(this.webpackChunkdefra_DefraMap=this.webpackChunkdefra_DefraMap||[]).push([[772],{612(t,e,r){function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,a(n.key),n)}}function a(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}r.r(e),r.d(e,{default:()=>Vt});var i=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)},(e=[{key:"isBaseMapReady",value:function(){throw new Error(this.name+" must implement isBaseMapReady()")}}])&&o(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}(),u=400,l=["showKeyboardHelp","selectControl","moveLarge","nudgeMap","zoomLarge","nudgeZoom","highlightLabelAtCenter","highlightNextLabel"];function c(t){var e=t.getCanvas();e.removeAttribute("role"),e.setAttribute("tabindex",-1),e.removeAttribute("aria-label"),e.style.display="block",e.addEventListener("focus",function(t){e.blur(),t.relatedTarget&&t.relatedTarget.focus({preventScroll:!0})})}function s(t){var e=Event.prototype.preventDefault;Event.prototype.preventDefault=function(){if(("touchmove"===this.type||"touchstart"===this.type)&&!this.cancelable){var r=t.getCanvas();if(r&&(this.target===r||r.contains(this.target)))return}e.call(this)}}var f=function(t,e){var r=null,n=function(){for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];clearTimeout(r),r=setTimeout(function(){t.apply(void 0,o)},e)};return n.cancel=function(){r&&(clearTimeout(r),r=null)},n};function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function p(t){var e=t.map,r=t.events,n=t.eventBus,o=t.getCenter,a=t.getZoom,i=t.getBounds,u=t.getResolution,l=[],c=[],s=function(){var t=a();return{center:o(),bounds:i(),resolution:u(),zoom:t,isAtMaxZoom:e.getMaxZoom()<=t,isAtMinZoom:e.getMinZoom()>=t}},p=function(t,e){return n.emit(t,e)},y=function(){return p(r.MAP_LOADED)};e.on("load",y),l.push(["load",y]),e.once("idle",function(){return p(r.MAP_FIRST_IDLE,s())});var d=function(){return p(r.MAP_MOVE_START)};e.on("movestart",d),l.push(["movestart",d]);var v=f(function(){p(r.MAP_MOVE_END,s())},500);e.on("moveend",v),l.push(["moveend",v]);var g,m,b=(g=function(){p(r.MAP_MOVE,s())},m=0,function(){var t=Date.now();t-m>=10&&(m=t,g.apply(void 0,arguments))});e.on("zoom",b),l.push(["zoom",b]);var M=function(){return p(r.MAP_RENDER)};e.on("render",M),l.push(["render",M]);var w=f(function(){p(r.MAP_DATA_CHANGE,s())},500),S=function(t){t.isSourceLoaded&&w()};e.on("styledata",w),e.on("sourcedata",S),l.push(["styledata",w],["sourcedata",S]);var P=function(){return p(r.MAP_STYLE_CHANGE)};e.on("style.load",P),l.push(["style.load",P]);var O=function(t){return p(r.MAP_CLICK,{point:t.point,coords:[t.lngLat.lng,t.lngLat.lat]})};return e.on("click",O),l.push(["click",O]),c.push(v,b,w),{remove:function(){c.forEach(function(t){return t.cancel()}),l.forEach(function(t){var r,n,o=(n=2,function(t){if(Array.isArray(t))return t}(r=t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,u=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(u.push(n.value),u.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return u}}(r,n)||function(t,e){if(t){if("string"==typeof t)return h(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?h(t,e):void 0}}(r,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=o[0],i=o[1];return e.off(a,i)})}}}function y(t){var e=t.mapProvider,r=t.map,n=t.events,o=t.eventBus,a=function(t){r.once("style.load",function(){o.emit(n.MAP_STYLE_CHANGE,{mapStyleId:t.id})}),r.setStyle(t.url,{diff:!1})},i=function(t){r.setPixelRatio(t)},u=function(t){var r=t.mapSize;e.mapSize=r};return o.on(n.MAP_SET_STYLE,a),o.on(n.MAP_SET_PIXEL_RATIO,i),o.on(n.MAP_SIZE_CHANGE,u),{remove:function(){o.off(n.MAP_SET_STYLE,a),o.off(n.MAP_SET_PIXEL_RATIO,i),o.off(n.MAP_SIZE_CHANGE,u)}}}let d=" ";class v{static get separator(){return d}static set separator(t){d=t}static parse(t){if(!isNaN(parseFloat(t))&&isFinite(t))return Number(t);const e=String(t).trim().replace(/^-/,"").replace(/[NSEW]$/i,"").split(/[^0-9.,]+/);if(""==e[e.length-1]&&e.splice(e.length-1),""==e)return NaN;let r=null;switch(e.length){case 3:r=e[0]/1+e[1]/60+e[2]/3600;break;case 2:r=e[0]/1+e[1]/60;break;case 1:r=e[0];break;default:return NaN}return/^-|[WS]$/i.test(t.trim())&&(r=-r),Number(r)}static toDms(t,e="d",r=void 0){if(isNaN(t))return null;if("string"==typeof t&&""==t.trim())return null;if("boolean"==typeof t)return null;if(t==1/0)return null;if(null==t)return null;if(void 0===r)switch(e){case"d":case"deg":r=4;break;case"dm":case"deg+min":r=2;break;case"dms":case"deg+min+sec":r=0;break;default:e="d",r=4}t=Math.abs(t);let n=null,o=null,a=null,i=null;switch(e){default:case"d":case"deg":o=t.toFixed(r),o<100&&(o="0"+o),o<10&&(o="0"+o),n=o+"°";break;case"dm":case"deg+min":o=Math.floor(t),a=(60*t%60).toFixed(r),60==a&&(a=(0).toFixed(r),o++),o=("000"+o).slice(-3),a<10&&(a="0"+a),n=o+"°"+v.separator+a+"′";break;case"dms":case"deg+min+sec":o=Math.floor(t),a=Math.floor(3600*t/60)%60,i=(3600*t%60).toFixed(r),60==i&&(i=(0).toFixed(r),a++),60==a&&(a=0,o++),o=("000"+o).slice(-3),a=("00"+a).slice(-2),i<10&&(i="0"+i),n=o+"°"+v.separator+a+"′"+v.separator+i+"″"}return n}static toLat(t,e,r){const n=v.toDms(v.wrap90(t),e,r);return null===n?"–":n.slice(1)+v.separator+(t<0?"S":"N")}static toLon(t,e,r){const n=v.toDms(v.wrap180(t),e,r);return null===n?"–":n+v.separator+(t<0?"W":"E")}static toBrng(t,e,r){const n=v.toDms(v.wrap360(t),e,r);return null===n?"–":n.replace("360","0")}static fromLocale(t){const e=123456.789.toLocaleString(),r={thousands:e.slice(3,4),decimal:e.slice(7,8)};return t.replace(r.thousands,"⁜").replace(r.decimal,".").replace("⁜",",")}static toLocale(t){const e=123456.789.toLocaleString(),r={thousands:e.slice(3,4),decimal:e.slice(7,8)};return t.replace(/,([0-9])/,"⁜$1").replace(".",r.decimal).replace("⁜",r.thousands)}static compassPoint(t,e=3){if(![1,2,3].includes(Number(e)))throw new RangeError(`invalid precision ‘${e}’`);t=v.wrap360(t);const r=4*2**(e-1);return["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.round(t*r/360)%r*16/r]}static wrap90(t){if(-90<=t&&t<=90)return t;const e=t;return 1*Math.abs(((e-90)%360+360)%360-180)-90}static wrap180(t){if(-180<=t&&t<=180)return t;const e=360;return((360*t/e-180)%e+e)%e-180}static wrap360(t){if(0<=t&&t<360)return t;const e=360;return(360*t/e%e+e)%e}}Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};const g=v,m=Math.PI;class b{constructor(t,e){if(isNaN(t))throw new TypeError(`invalid lat ‘${t}’`);if(isNaN(e))throw new TypeError(`invalid lon ‘${e}’`);this._lat=g.wrap90(Number(t)),this._lon=g.wrap180(Number(e))}get lat(){return this._lat}get latitude(){return this._lat}set lat(t){if(this._lat=isNaN(t)?g.wrap90(g.parse(t)):g.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid lat ‘${t}’`)}set latitude(t){if(this._lat=isNaN(t)?g.wrap90(g.parse(t)):g.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid latitude ‘${t}’`)}get lon(){return this._lon}get lng(){return this._lon}get longitude(){return this._lon}set lon(t){if(this._lon=isNaN(t)?g.wrap180(g.parse(t)):g.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lon ‘${t}’`)}set lng(t){if(this._lon=isNaN(t)?g.wrap180(g.parse(t)):g.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lng ‘${t}’`)}set longitude(t){if(this._lon=isNaN(t)?g.wrap180(g.parse(t)):g.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid longitude ‘${t}’`)}static get metresToKm(){return.001}static get metresToMiles(){return 1/1609.344}static get metresToNauticalMiles(){return 1/1852}static parse(...t){if(0==t.length)throw new TypeError("invalid (empty) point");if(null===t[0]||null===t[1])throw new TypeError("invalid (null) point");let e,r;if(2==t.length&&([e,r]=t,e=g.wrap90(g.parse(e)),r=g.wrap180(g.parse(r)),isNaN(e)||isNaN(r)))throw new TypeError(`invalid point ‘${t.toString()}’`);if(1==t.length&&"string"==typeof t[0]&&([e,r]=t[0].split(","),e=g.wrap90(g.parse(e)),r=g.wrap180(g.parse(r)),isNaN(e)||isNaN(r)))throw new TypeError(`invalid point ‘${t[0]}’`);if(1==t.length&&"object"==typeof t[0]){const n=t[0];if("Point"==n.type&&Array.isArray(n.coordinates)?[r,e]=n.coordinates:(null!=n.latitude&&(e=n.latitude),null!=n.lat&&(e=n.lat),null!=n.longitude&&(r=n.longitude),null!=n.lng&&(r=n.lng),null!=n.lon&&(r=n.lon),e=g.wrap90(g.parse(e)),r=g.wrap180(g.parse(r))),isNaN(e)||isNaN(r))throw new TypeError(`invalid point ‘${JSON.stringify(t[0])}’`)}if(isNaN(e)||isNaN(r))throw new TypeError(`invalid point ‘${t.toString()}’`);return new b(e,r)}distanceTo(t,e=6371e3){if(t instanceof b||(t=b.parse(t)),isNaN(e))throw new TypeError(`invalid radius ‘${e}’`);const r=e,n=this.lat.toRadians(),o=this.lon.toRadians(),a=t.lat.toRadians(),i=a-n,u=t.lon.toRadians()-o,l=Math.sin(i/2)*Math.sin(i/2)+Math.cos(n)*Math.cos(a)*Math.sin(u/2)*Math.sin(u/2);return r*(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)))}initialBearingTo(t){if(t instanceof b||(t=b.parse(t)),this.equals(t))return NaN;const e=this.lat.toRadians(),r=t.lat.toRadians(),n=(t.lon-this.lon).toRadians(),o=Math.cos(e)*Math.sin(r)-Math.sin(e)*Math.cos(r)*Math.cos(n),a=Math.sin(n)*Math.cos(r),i=Math.atan2(a,o).toDegrees();return g.wrap360(i)}finalBearingTo(t){t instanceof b||(t=b.parse(t));const e=t.initialBearingTo(this)+180;return g.wrap360(e)}midpointTo(t){t instanceof b||(t=b.parse(t));const e=this.lat.toRadians(),r=this.lon.toRadians(),n=t.lat.toRadians(),o=(t.lon-this.lon).toRadians(),a=Math.cos(e),i=Math.sin(e),u={x:a+Math.cos(n)*Math.cos(o),y:0+Math.cos(n)*Math.sin(o),z:i+Math.sin(n)},l=Math.atan2(u.z,Math.sqrt(u.x*u.x+u.y*u.y)),c=r+Math.atan2(u.y,u.x),s=l.toDegrees(),f=c.toDegrees();return new b(s,f)}intermediatePointTo(t,e){if(t instanceof b||(t=b.parse(t)),this.equals(t))return new b(this.lat,this.lon);const r=this.lat.toRadians(),n=this.lon.toRadians(),o=t.lat.toRadians(),a=t.lon.toRadians(),i=o-r,u=a-n,l=Math.sin(i/2)*Math.sin(i/2)+Math.cos(r)*Math.cos(o)*Math.sin(u/2)*Math.sin(u/2),c=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),s=Math.sin((1-e)*c)/Math.sin(c),f=Math.sin(e*c)/Math.sin(c),h=s*Math.cos(r)*Math.cos(n)+f*Math.cos(o)*Math.cos(a),p=s*Math.cos(r)*Math.sin(n)+f*Math.cos(o)*Math.sin(a),y=s*Math.sin(r)+f*Math.sin(o),d=Math.atan2(y,Math.sqrt(h*h+p*p)),v=Math.atan2(p,h),g=d.toDegrees(),m=v.toDegrees();return new b(g,m)}destinationPoint(t,e,r=6371e3){const n=t/r,o=Number(e).toRadians(),a=this.lat.toRadians(),i=this.lon.toRadians(),u=Math.sin(a)*Math.cos(n)+Math.cos(a)*Math.sin(n)*Math.cos(o),l=Math.asin(u),c=Math.sin(o)*Math.sin(n)*Math.cos(a),s=Math.cos(n)-Math.sin(a)*u,f=i+Math.atan2(c,s),h=l.toDegrees(),p=f.toDegrees();return new b(h,p)}static intersection(t,e,r,n){if(t instanceof b||(t=b.parse(t)),r instanceof b||(r=b.parse(r)),isNaN(e))throw new TypeError(`invalid brng1 ‘${e}’`);if(isNaN(n))throw new TypeError(`invalid brng2 ‘${n}’`);const o=t.lat.toRadians(),a=t.lon.toRadians(),i=r.lat.toRadians(),u=r.lon.toRadians(),l=Number(e).toRadians(),c=Number(n).toRadians(),s=i-o,f=u-a,h=2*Math.asin(Math.sqrt(Math.sin(s/2)*Math.sin(s/2)+Math.cos(o)*Math.cos(i)*Math.sin(f/2)*Math.sin(f/2)));if(Math.abs(h)<Number.EPSILON)return new b(t.lat,t.lon);const p=(Math.sin(i)-Math.sin(o)*Math.cos(h))/(Math.sin(h)*Math.cos(o)),y=(Math.sin(o)-Math.sin(i)*Math.cos(h))/(Math.sin(h)*Math.cos(i)),d=Math.acos(Math.min(Math.max(p,-1),1)),v=Math.acos(Math.min(Math.max(y,-1),1)),g=l-(Math.sin(u-a)>0?d:2*m-d),M=(Math.sin(u-a)>0?2*m-v:v)-c;if(0==Math.sin(g)&&0==Math.sin(M))return null;if(Math.sin(g)*Math.sin(M)<0)return null;const w=-Math.cos(g)*Math.cos(M)+Math.sin(g)*Math.sin(M)*Math.cos(h),S=Math.atan2(Math.sin(h)*Math.sin(g)*Math.sin(M),Math.cos(M)+Math.cos(g)*w),P=Math.asin(Math.min(Math.max(Math.sin(o)*Math.cos(S)+Math.cos(o)*Math.sin(S)*Math.cos(l),-1),1)),O=a+Math.atan2(Math.sin(l)*Math.sin(S)*Math.cos(o),Math.cos(S)-Math.sin(o)*Math.sin(P)),x=P.toDegrees(),E=O.toDegrees();return new b(x,E)}crossTrackDistanceTo(t,e,r=6371e3){t instanceof b||(t=b.parse(t)),e instanceof b||(e=b.parse(e));const n=r;if(this.equals(t))return 0;const o=t.distanceTo(this,n)/n,a=t.initialBearingTo(this).toRadians(),i=t.initialBearingTo(e).toRadians();return Math.asin(Math.sin(o)*Math.sin(a-i))*n}alongTrackDistanceTo(t,e,r=6371e3){t instanceof b||(t=b.parse(t)),e instanceof b||(e=b.parse(e));const n=r;if(this.equals(t))return 0;const o=t.distanceTo(this,n)/n,a=t.initialBearingTo(this).toRadians(),i=t.initialBearingTo(e).toRadians(),u=Math.asin(Math.sin(o)*Math.sin(a-i));return Math.acos(Math.cos(o)/Math.abs(Math.cos(u)))*Math.sign(Math.cos(i-a))*n}maxLatitude(t){const e=Number(t).toRadians(),r=this.lat.toRadians();return Math.acos(Math.abs(Math.sin(e)*Math.cos(r))).toDegrees()}static crossingParallels(t,e,r){if(t.equals(e))return null;const n=Number(r).toRadians(),o=t.lat.toRadians(),a=t.lon.toRadians(),i=e.lat.toRadians(),u=e.lon.toRadians()-a,l=Math.sin(o)*Math.cos(i)*Math.cos(n)*Math.sin(u),c=Math.sin(o)*Math.cos(i)*Math.cos(n)*Math.cos(u)-Math.cos(o)*Math.sin(i)*Math.cos(n),s=Math.cos(o)*Math.cos(i)*Math.sin(n)*Math.sin(u);if(s*s>l*l+c*c)return null;const f=Math.atan2(-c,l),h=Math.acos(s/Math.sqrt(l*l+c*c)),p=a+f+h,y=(a+f-h).toDegrees(),d=p.toDegrees();return{lon1:g.wrap180(y),lon2:g.wrap180(d)}}rhumbDistanceTo(t,e=6371e3){t instanceof b||(t=b.parse(t));const r=e,n=this.lat.toRadians(),o=t.lat.toRadians(),a=o-n;let i=Math.abs(t.lon-this.lon).toRadians();Math.abs(i)>m&&(i=i>0?-(2*m-i):2*m+i);const u=Math.log(Math.tan(o/2+m/4)/Math.tan(n/2+m/4)),l=Math.abs(u)>1e-11?a/u:Math.cos(n);return Math.sqrt(a*a+l*l*i*i)*r}rhumbBearingTo(t){if(t instanceof b||(t=b.parse(t)),this.equals(t))return NaN;const e=this.lat.toRadians(),r=t.lat.toRadians();let n=(t.lon-this.lon).toRadians();Math.abs(n)>m&&(n=n>0?-(2*m-n):2*m+n);const o=Math.log(Math.tan(r/2+m/4)/Math.tan(e/2+m/4)),a=Math.atan2(n,o).toDegrees();return g.wrap360(a)}rhumbDestinationPoint(t,e,r=6371e3){const n=this.lat.toRadians(),o=this.lon.toRadians(),a=Number(e).toRadians(),i=t/r,u=i*Math.cos(a);let l=n+u;Math.abs(l)>m/2&&(l=l>0?m-l:-m-l);const c=Math.log(Math.tan(l/2+m/4)/Math.tan(n/2+m/4)),s=Math.abs(c)>1e-11?u/c:Math.cos(n),f=o+i*Math.sin(a)/s,h=l.toDegrees(),p=f.toDegrees();return new b(h,p)}rhumbMidpointTo(t){t instanceof b||(t=b.parse(t));const e=this.lat.toRadians();let r=this.lon.toRadians();const n=t.lat.toRadians(),o=t.lon.toRadians();Math.abs(o-r)>m&&(r+=2*m);const a=(e+n)/2,i=Math.tan(m/4+e/2),u=Math.tan(m/4+n/2),l=Math.tan(m/4+a/2);let c=((o-r)*Math.log(l)+r*Math.log(u)-o*Math.log(i))/Math.log(u/i);isFinite(c)||(c=(r+o)/2);const s=a.toDegrees(),f=c.toDegrees();return new b(s,f)}static areaOf(t,e=6371e3){const r=e,n=t[0].equals(t[t.length-1]);n||t.push(t[0]);const o=t.length-1;let a=0;for(let e=0;e<o;e++){const r=t[e].lat.toRadians(),n=t[e+1].lat.toRadians(),o=(t[e+1].lon-t[e].lon).toRadians();a+=2*Math.atan2(Math.tan(o/2)*(Math.tan(r/2)+Math.tan(n/2)),1+Math.tan(r/2)*Math.tan(n/2))}(function(t){let e=0,r=t[0].initialBearingTo(t[1]);for(let n=0;n<t.length-1;n++){const o=t[n].initialBearingTo(t[n+1]),a=t[n].finalBearingTo(t[n+1]);e+=(o-r+540)%360-180,e+=(a-o+540)%360-180,r=a}return e+=(t[0].initialBearingTo(t[1])-r+540)%360-180,Math.abs(e)<90})(t)&&(a=Math.abs(a)-2*m);const i=Math.abs(a*r*r);return n||t.pop(),i}equals(t){return t instanceof b||(t=b.parse(t)),!(Math.abs(this.lat-t.lat)>Number.EPSILON||Math.abs(this.lon-t.lon)>Number.EPSILON)}toGeoJSON(){return{type:"Point",coordinates:[this.lon,this.lat]}}toString(t="d",e=void 0){if(!["d","dm","dms","n"].includes(t))throw new RangeError(`invalid format ‘${t}’`);return"n"==t?(null==e&&(e=4),`${this.lat.toFixed(e)},${this.lon.toFixed(e)}`):`${g.toLat(this.lat,t,e)}, ${g.toLon(this.lon,t,e)}`}}function M(t,e,r){if(null!==t)for(var n,o,a,i,u,l,c,s,f=0,h=0,p=t.type,y="FeatureCollection"===p,d="Feature"===p,v=y?t.features.length:1,g=0;g<v;g++){u=(s=!!(c=y?t.features[g].geometry:d?t.geometry:t)&&"GeometryCollection"===c.type)?c.geometries.length:1;for(var m=0;m<u;m++){var b=0,w=0;if(null!==(i=s?c.geometries[m]:c)){l=i.coordinates;var S=i.type;switch(f=!r||"Polygon"!==S&&"MultiPolygon"!==S?0:1,S){case null:break;case"Point":if(!1===e(l,h,g,b,w))return!1;h++,b++;break;case"LineString":case"MultiPoint":for(n=0;n<l.length;n++){if(!1===e(l[n],h,g,b,w))return!1;h++,"MultiPoint"===S&&b++}"LineString"===S&&b++;break;case"Polygon":case"MultiLineString":for(n=0;n<l.length;n++){for(o=0;o<l[n].length-f;o++){if(!1===e(l[n][o],h,g,b,w))return!1;h++}"MultiLineString"===S&&b++,"Polygon"===S&&w++}"Polygon"===S&&b++;break;case"MultiPolygon":for(n=0;n<l.length;n++){for(w=0,o=0;o<l[n].length;o++){for(a=0;a<l[n][o].length-f;a++){if(!1===e(l[n][o][a],h,g,b,w))return!1;h++}w++}b++}break;case"GeometryCollection":for(n=0;n<i.geometries.length;n++)if(!1===M(i.geometries[n],e,r))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}var w=function(t,e={}){if(null!=t.bbox&&!0!==e.recompute)return t.bbox;const r=[1/0,1/0,-1/0,-1/0];return M(t,t=>{r[0]>t[0]&&(r[0]=t[0]),r[1]>t[1]&&(r[1]=t[1]),r[2]<t[0]&&(r[2]=t[0]),r[3]<t[1]&&(r[3]=t[1])}),r};function S(t){return function(t){if(Array.isArray(t))return x(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||O(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function P(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,u=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(u.push(n.value),u.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return u}}(t,e)||O(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function O(t,e){if(t){if("string"==typeof t)return x(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?x(t,e):void 0}}function x(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var E=function(t,e){var r=P(t,2),n=r[0],o=r[1],a=P(e,2),i=a[0],u=a[1],l=new b(o,n),c=new b(u,i);return l.distanceTo(c)},j=function(t){var e=t/1609.344;if(e<.5)return"".concat(Math.round(t),"m");if(e<10){var r=Number.parseFloat(e.toFixed(1)),n=1===r?"mile":"miles";return"".concat(r," ").concat(n)}var o=Math.round(e);return"".concat(o," miles")},N=function(t){return w(t)};function A(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,u=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(u.push(n.value),u.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return T(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?T(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function T(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function I(t){return I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},I(t)}function L(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function k(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?L(Object(r),!0).forEach(function(e){R(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):L(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function R(t,e,r){return(e=function(t){var e=function(t){if("object"!=I(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=I(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==I(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var C="highlighted-label";function D(t,e){if("number"==typeof t)return t;if(!Array.isArray(t)||"interpolate"!==t[0])return function(t,e){var r=t.stops;if(r.length<2)return r.length>0?r[0][1]:0;for(var n=r[0],o=r[r.length-1],a=1;a<r.length;a++){var i=r[a];if(i[0]>e){o=i,n=r[a-1];break}n=r[a-1],o=i}var u=A(n,2),l=u[0],c=u[1],s=A(o,2),f=s[0],h=s[1];return e<=l?c:e>=f?h:c+(e-l)/(f-l)*(h-c)}(t,e);var r,n=function(t){if(Array.isArray(t))return t}(r=t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(r)||function(t,e){if(t){if("string"==typeof t)return _(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_(t,e):void 0}}(r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),o=n[2],a=_(n).slice(3);if("zoom"!==o[0])throw new Error("Only zoom-based expressions supported");for(var i=0;i<a.length-2;i+=2){var u=a[i],l=a[i+1],c=a[i+2],s=a[i+3];if(e<=u)return l;if(e<=c)return l+(e-u)/(c-u)*(s-l)}return a[a.length-1]}function F(t,e){if(e.highlightLayerId&&t.getLayer(e.highlightLayerId)){try{t.removeLayer(e.highlightLayerId)}catch(t){}e.highlightLayerId=null,e.highlightedExpr=null}}function B(t,e,r){var n,o,a,i;if(null!=e&&null!==(n=e.feature)&&void 0!==n&&n.layer){F(t,r);var u=e.feature,l=e.layer;r.highlightLayerId="highlight-".concat(l.id);var c=u.id,s=u.type,f=u.properties,h=u.geometry;t.getSource(C).setData({id:c,type:s,properties:f,geometry:h}),r.highlightedExpr=l.layout["text-size"];var p=t.getZoom(),y=(o=l,a=1.5*D(r.highlightedExpr,p),i=r.isDarkStyle?{text:"#ffffff",halo:"#000000"}:{text:"#000000",halo:"#ffffff"},{id:"highlight-".concat(o.id),type:o.type,source:C,layout:k(k({},o.layout),{},{"text-size":a,"text-allow-overlap":!0,"text-ignore-placement":!0,"text-max-angle":90}),paint:k(k({},o.paint),{},{"text-color":i.text,"text-halo-color":i.halo,"text-halo-width":3,"text-halo-blur":1,"text-opacity":1})});t.addLayer(y),t.moveLayer(r.highlightLayerId)}}function G(t){t.getSource(C)||t.addSource(C,{type:"geojson",data:{type:"FeatureCollection",features:[]}})}function $(t){t.getStyle().layers.filter(function(t){var e;return"line"===(null===(e=t.layout)||void 0===e?void 0:e["symbol-placement"])}).forEach(function(e){return t.setLayoutProperty(e.id,"symbol-placement","line-center")})}function z(t,e,r,n){var o={isDarkStyle:"dark"===e,labels:[],currentPixel:null,highlightLayerId:null,highlightedExpr:null};function a(){var e=t.getStyle().layers.filter(function(t){return"symbol"===t.type}),r=t.queryRenderedFeatures({layers:e.map(function(t){return t.id})});o.labels=function(t,e,r){return e.flatMap(function(e){var n,o,a,i,u="string"==typeof(o=null===(n=e.layout)||void 0===n?void 0:n["text-field"])?null===(a=/^{(.+)}$/.exec(o))||void 0===a?void 0:a[1]:Array.isArray(o)?null===(i=o.find(function(t){return Array.isArray(t)&&"get"===t[0]}))||void 0===i?void 0:i[1]:null;return u?r.filter(function(t){var r;return t.layer.id===e.id&&(null===(r=t.properties)||void 0===r?void 0:r[u])}).map(function(r){return function(t,e,r,n){var o=function(t){var e=t.type,r=t.coordinates;if("Point"===e)return r;if("MultiPoint"===e)return r[0];if(e.includes("LineString")){var n="LineString"===e?r:r[0];return[(n[0][0]+n[n.length-1][0])/2,(n[0][1]+n[n.length-1][1])/2]}if(e.includes("Polygon")){var o="Polygon"===e?r[0]:r[0][0],a=o.reduce(function(t,e){return[t[0]+e[0],t[1]+e[1]]},[0,0]);return[a[0]/o.length,a[1]/o.length]}return null}(t.geometry);if(!o)return null;var a=n.project({lng:o[0],lat:o[1]});return{text:t.properties[r],x:a.x,y:a.y,feature:t,layer:e}}(r,e,u,t)}).filter(Boolean):[]})}(t,e,r)}function i(){if(a(),!o.labels.length)return null;var e=t.project(t.getCenter()),r=function(t,e){var r;return null===(r=t.reduce(function(t,r){var n=Math.pow(r.x-e.x,2)+Math.pow(r.y-e.y,2);return!t||n<t.dist?{label:r,dist:n}:t},null))||void 0===r?void 0:r.label}(o.labels,e);return o.currentPixel={x:r.x,y:r.y},B(t,r,o),"".concat(r.text," (").concat(r.layer.id,")")}return $(t),G(t),null==n||n.on(r.MAP_SET_STYLE,function(e){t.once("styledata",function(){return t.once("idle",function(){$(t),G(t),o.isDarkStyle="dark"===(null==e?void 0:e.mapColorScheme)})})}),t.on("zoom",function(){if(o.highlightLayerId&&o.highlightedExpr){var e=D(o.highlightedExpr,t.getZoom());t.setLayoutProperty(o.highlightLayerId,"text-size",1.5*e)}}),function(t){t.getStyle().layers.filter(function(t){return"symbol"===t.type}).forEach(function(e){t.setPaintProperty(e.id,"text-opacity",["case",["boolean",["feature-state","highlighted"],!1],0,1])})}(t),{refreshLabels:a,highlightNextLabel:function(e){if(a(),!o.labels.length)return null;if(!o.currentPixel)return i();var r=function(t,e){if(!e.currentPixel)return null;var r=e.labels.map(function(t,e){return{pixel:[t.x,t.y],index:e}}).filter(function(t){return t.pixel[0]!==e.currentPixel.x||t.pixel[1]!==e.currentPixel.y});if(!r.length)return null;var n=r.map(function(t){return t.pixel}),o=function(t,e,r){var n=P(e,2),o=n[0],a=n[1],i=r.filter(function(e){var r=P(e,2),n=r[0],i=r[1];return(n!==o||i!==a)&&function(t,e,r){switch(t){case"ArrowUp":return r<0&&Math.abs(r)>=Math.abs(e);case"ArrowDown":return r>0&&Math.abs(r)>=Math.abs(e);case"ArrowLeft":return e<0&&Math.abs(e)>Math.abs(r);case"ArrowRight":return e>0&&Math.abs(e)>Math.abs(r);default:return!1}}(t,n-o,i-a)});if(!i.length)return r.findIndex(function(t){return t[0]===o&&t[1]===a});var u=-1,l=1/0;return i.forEach(function(t){var e=t[0]-o,n=t[1]-a,i=e*e+n*n;i<l&&(l=i,u=r.indexOf(t))}),u}(t,[e.currentPixel.x,e.currentPixel.y],n);return(null==o||o<0||o>=r.length)&&(o=0),e.labels[r[o].index]}(e,o);return r?(o.currentPixel={x:r.x,y:r.y},B(t,r,o),"".concat(r.text," (").concat(r.layer.id,")")):null},highlightLabelAtCenter:i,clearHighlightedLabel:function(){return F(t,o)}}}var W=function(t){return t.endsWith(".cold")?"".concat(t.slice(0,-5),".hot"):t.endsWith(".hot")?"".concat(t.slice(0,-4),".cold"):null};function q(t){return q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},q(t)}function Z(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,u=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(u.push(n.value),u.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return u}}(t,e)||H(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function H(t,e){if(t){if("string"==typeof t)return U(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?U(t,e):void 0}}function U(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function V(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function Y(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?V(Object(r),!0).forEach(function(e){J(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):V(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function J(t,e,r){return(e=function(t){var e=function(t){if("object"!=q(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=q(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==q(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var K="icon-image",X="active-highlight",Q="active-highlight-inner",tt="selected-highlight",et=function(t,e){var r,n;return null!==(r=null===(n=t._activeSymbolImageMap)||void 0===n?void 0:n[e])&&void 0!==r?r:null},rt=function(t,e){var r,n;return null!==(r=null===(n=t._selectedSymbolImageMap)||void 0===n?void 0:n[e])&&void 0!==r?r:null},nt=function(t,e,r,n){var o=n.featureId,a=n.idProperty,i=n.geometry,u=t.getLayer(r);u&&(e[r]||(e[r]={ids:new Set,fillIds:new Set,idProperty:a,sourceId:u.source,hasFillGeometry:!1}),!i||"Polygon"!==i.type&&"MultiPolygon"!==i.type||(e[r].hasFillGeometry=!0,e[r].fillIds.add(o)),e[r].ids.add(o))},ot=function(t,e,r,n){e.forEach(function(e){if(!r.has(e)){var o="".concat(n,"-").concat(e);["".concat(o,"-fill"),"".concat(o,"-line"),"".concat(o,"-symbol")].forEach(function(e){t.getLayer(e)&&t.setFilter(e,["==","id",""])})}})},at=function(t,e){var r="_".concat(e.replaceAll("-",""),"Sources");ot(t,t[r]||new Set,new Set,e),t[r]=new Set},it=function(t,e,r,n,o,a,i){!!t.getLayer(e)||t.addLayer(Y(Y({id:e,type:r,source:n},o&&{"source-layer":o}),{},{paint:a})),Object.entries(a).forEach(function(r){var n=Z(r,2),o=n[0],a=n[1];t.setPaintProperty(e,o,a)}),t.setFilter(e,i),t.moveLayer(e)},ut=function(t,e,r,n,o,a,i){var u,l=t.getLayoutProperty(o,"icon-offset");t.getLayer(e)||t.addLayer(Y(Y({id:e,type:"symbol",source:r},n&&{"source-layer":n}),{},{layout:Y(Y(J(J({},K,a),"icon-anchor",null!==(u=t.getLayoutProperty(o,"icon-anchor"))&&void 0!==u?u:"center"),void 0!==l&&{"icon-offset":l}),{},{"icon-allow-overlap":!0})})),t.setLayoutProperty(e,K,a),void 0!==l&&t.setLayoutProperty(e,"icon-offset",l),t.setFilter(e,i),t.moveLayer(e)},lt=function(t,e,r,n,o){var a=function(t,e){var r={};return null==e||e.forEach(function(e){nt(t,r,e.layerId,e);var n=W(e.layerId);n&&nt(t,r,n,e)}),r}(t,e),i=new Set(Object.keys(a)),u="_".concat(n.replaceAll("-",""),"Sources"),l=t[u]||new Set;return ot(t,l,i,n),t[u]=i,i.forEach(function(e){return function(t,e,r,n,o,a){var i,u=r[e],l=u.ids,c=u.fillIds,s=u.idProperty,f=u.sourceId,h=u.hasFillGeometry,p=t.getLayer(e),y=null!==(i=n[e])&&void 0!==i?i:n[W(e)];if(p&&y){var d=p.sourceLayer,v=h?"fill":p.type,g="".concat(o,"-").concat(e),m=y.fill,b=o===tt,M=function(t){return t===tt||t===Q}(o),w=function(t,e){return{lineColor:e?t.selectionStroke:t.stroke,lineWidth:e?t.strokeWidth:t.activeStrokeWidth}}(y,M),S=w.lineColor,P=w.lineWidth,O=s?["get",s]:["id"],x=["in",O,["literal",Array.from(l)]];if("fill-extrusion"!==p.type)switch(v){case"fill":!function(t,e,r,n,o){var a=o.idExpression,i=o.fill,u=o.lineColor,l=o.lineWidth,c=o.filter;if(o.isSelected){var s=[];o.fillIds.forEach(function(t){return s.push(t)});var f=["in",a,["literal",s]];it(t,"".concat(e,"-fill"),"fill",r,n,{"fill-color":i},f)}it(t,"".concat(e,"-line"),"line",r,n,{"line-color":u,"line-width":l},c)}(t,g,f,d,{isSelected:b,idExpression:O,fillIds:c,fill:m,lineColor:S,lineWidth:P,filter:x});break;case"line":!function(t,e,r,n,o,a,i){t.getLayer("".concat(e,"-fill"))&&t.setFilter("".concat(e,"-fill"),["==","id",""]),it(t,"".concat(e,"-line"),"line",r,n,{"line-color":o,"line-width":a},i)}(t,g,f,d,S,P,x);break;case"symbol":!function(t,e,r,n,o,a,i){var u=t.getLayoutProperty(o,K);if(Array.isArray(u)){var l=i===et?"user_symbolActiveImageId":"user_symbolSelectedImageId";ut(t,"".concat(e,"-symbol"),r,n,o,["get",l],a)}else{var c=i(t,u);c&&ut(t,"".concat(e,"-symbol"),r,n,o,c,a)}}(t,g,f,d,e,x,a)}else!function(t,e,r,n){var o=n.lineColor,a=n.lineWidth,i=n.idExpression,u=[];n.ids.forEach(function(t){return u.push(t)});var l=["in",i,["literal",u]],c=t.getLayer(r),s=c.source,f=c.sourceLayer;it(t,"".concat(e,"-line"),"line",s,f,{"line-color":o,"line-width":a},l)}(t,g,e,{ids:l,lineColor:S,lineWidth:P,idExpression:O})}}(t,e,a,r,n,o)}),a};function ct(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,u=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(u.push(n.value),u.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return st(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?st(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function st(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var ft=function(t,e,r){var n=Math.pow(e.x-r.x,2)+Math.pow(e.y-r.y,2);if(0===n)return Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2);var o=((t.x-e.x)*(r.x-e.x)+(t.y-e.y)*(r.y-e.y))/n;return o=Math.max(0,Math.min(1,o)),Math.pow(t.x-(e.x+o*(r.x-e.x)),2)+Math.pow(t.y-(e.y+o*(r.y-e.y)),2)};function ht(t,e){if(t){if("string"==typeof t)return pt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?pt(t,e):void 0}}function pt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var yt=function(t,e,r){var n=t.getCanvas();if(r&&t.off("mousemove",r),null==e||!e.length)return n.style.cursor="",null;var o=function(r){var o=function(t){var e,r=new Set(t);return t.forEach(function(t){var e=W(t);e&&r.add(e)}),function(t){if(Array.isArray(t))return pt(t)}(e=r)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(e)||ht(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e).filter(function(e){return t.getLayer(e)});if(0!==o.length){var a=function(t,e){var r,n=[],o=[],a=function(t){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=ht(t))){e&&(t=e);var r=0,n=function(){};return{s:n,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,i=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return a=t.done,t},e:function(t){i=!0,o=t},f:function(){try{a||null==e.return||e.return()}finally{if(i)throw o}}}}(e);try{for(a.s();!(r=a.n()).done;){var i=r.value;if("line"===t.getLayer(i).type){var u=i.endsWith("-stroke")?i.slice(0,-7):null;null!==u&&e.includes(u)||n.push(i)}else o.push(i)}}catch(t){a.e(t)}finally{a.f()}return{lineLayers:n,otherLayers:o}}(t,o),i=a.lineLayers,u=a.otherLayers,l=r.point,c=l.x,s=l.y,f=[[c-10,s-10],[c+10,s+10]],h=i.length>0&&t.queryRenderedFeatures(f,{layers:i}).length>0,p=u.length>0&&t.queryRenderedFeatures(r.point,{layers:u}).length>0;n.style.cursor=h||p?"pointer":""}else n.style.cursor=""};return t.on("mousemove",o),o};function dt(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function a(r,n,o,a){var l=n&&n.prototype instanceof u?n:u,c=Object.create(l.prototype);return vt(c,"_invoke",function(r,n,o){var a,u,l,c=0,s=o||[],f=!1,h={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,r){return a=e,u=0,l=t,h.n=r,i}};function p(r,n){for(u=r,l=n,e=0;!f&&c&&!o&&e<s.length;e++){var o,a=s[e],p=h.p,y=a[2];r>3?(o=y===n)&&(l=a[(u=a[4])?5:(u=3,3)],a[4]=a[5]=t):a[0]<=p&&((o=r<2&&p<a[1])?(u=0,h.v=n,h.n=a[1]):p<y&&(o=r<3||a[0]>n||n>y)&&(a[4]=r,a[5]=n,h.n=y,u=0))}if(o||r>1)return i;throw f=!0,n}return function(o,s,y){if(c>1)throw TypeError("Generator is already running");for(f&&1===s&&p(s,y),u=s,l=y;(e=u<2?t:l)||!f;){a||(u?u<3?(u>1&&(h.n=-1),p(u,l)):h.n=l:h.v=l);try{if(c=2,a){if(u||(o="next"),e=a[o]){if(!(e=e.call(a,l)))throw TypeError("iterator result is not an object");if(!e.done)return e;l=e.value,u<2&&(u=0)}else 1===u&&(e=a.return)&&e.call(a),u<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),u=1);a=t}else if((e=(f=h.n<0)?l:r.call(n,h))!==i)break}catch(e){a=t,u=1,l=e}finally{c=1}}return{value:e,done:f}}}(r,o,a),!0),c}var i={};function u(){}function l(){}function c(){}e=Object.getPrototypeOf;var s=[][n]?e(e([][n]())):(vt(e={},n,function(){return this}),e),f=c.prototype=u.prototype=Object.create(s);function h(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,vt(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return l.prototype=c,vt(f,"constructor",c),vt(c,"constructor",l),l.displayName="GeneratorFunction",vt(c,o,"GeneratorFunction"),vt(f),vt(f,o,"Generator"),vt(f,n,function(){return this}),vt(f,"toString",function(){return"[object Generator]"}),(dt=function(){return{w:a,m:h}})()}function vt(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}vt=function(t,e,r,n){function a(e,r){vt(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(a("next",0),a("throw",1),a("return",2))},vt(t,e,r,n)}function gt(t,e,r,n,o,a,i){try{var u=t[a](i),l=u.value}catch(t){return void r(t)}u.done?e(l):Promise.resolve(l).then(n,o)}function mt(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var a=t.apply(e,r);function i(t){gt(a,n,o,i,u,"next",t)}function u(t){gt(a,n,o,i,u,"throw",t)}i(void 0)})}}var bt=function(){var t=mt(dt().m(function t(e,r,n,o){var a,i,u,l=arguments;return dt().w(function(t){for(;;)switch(t.n){case 0:if(u=l.length>4&&void 0!==l[4]?l[4]:2,r.length){t.n=1;break}return t.a(2);case 1:return null!==(a=e._activeSymbolImageMap)&&void 0!==a||(e._activeSymbolImageMap={}),null!==(i=e._selectedSymbolImageMap)&&void 0!==i||(e._selectedSymbolImageMap={}),t.n=2,Promise.all(r.flatMap(function(t){var r=o.getSymbolImageId(t,n,!1,u),a=o.getSymbolImageId(t,n,!0,u);return r&&a&&(e._activeSymbolImageMap[r]=a),["normal","active","selected"].map(function(){var i=mt(dt().m(function i(l){var c,s;return dt().w(function(i){for(;;)switch(i.n){case 0:if(c="active"===l?a:r,"selected"===l||c&&!e.hasImage(c)){i.n=1;break}return i.a(2);case 1:return i.n=2,o.rasteriseSymbolImage(t,n,l,u);case 2:(s=i.v)&&("selected"===l&&r&&(e._selectedSymbolImageMap[r]=s.imageId),e.hasImage(s.imageId)||e.addImage(s.imageId,s.imageData,{pixelRatio:u}));case 3:return i.a(2)}},i)}));return function(t){return i.apply(this,arguments)}}())}));case 2:return t.a(2)}},t)}));return function(e,r,n,o){return t.apply(this,arguments)}}(),Mt=function(t){return Math.max(2,2*t)},wt=function(t,e,r){return t.replace(/\{\{foregroundColor\}\}/g,e||"black").replace(/\{\{backgroundColor\}\}/g,r||"transparent")};function St(t){return St="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},St(t)}var Pt=function(t,e){if(!t)return null;if("string"==typeof t)return t.trim();if("object"===St(t)){if(e&&t[e])return t[e];var r=Object.values(t)[0];return null!=r?r:null}return null},Ot=function(t,e,r){return new Promise(function(n,o){var a="data:image/svg+xml;charset=utf-8,".concat(encodeURIComponent(t)),i=new Image(e,r);i.onload=function(){var t=document.createElement("canvas");t.width=e,t.height=r;var o=t.getContext("2d");o.drawImage(i,0,0,e,r),n(o.getImageData(0,0,e,r))},i.onerror=function(){o(new Error("Failed to rasterise SVG: ".concat(t.slice(0,80))))},i.src=a})};function xt(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function a(r,n,o,a){var l=n&&n.prototype instanceof u?n:u,c=Object.create(l.prototype);return Et(c,"_invoke",function(r,n,o){var a,u,l,c=0,s=o||[],f=!1,h={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,r){return a=e,u=0,l=t,h.n=r,i}};function p(r,n){for(u=r,l=n,e=0;!f&&c&&!o&&e<s.length;e++){var o,a=s[e],p=h.p,y=a[2];r>3?(o=y===n)&&(l=a[(u=a[4])?5:(u=3,3)],a[4]=a[5]=t):a[0]<=p&&((o=r<2&&p<a[1])?(u=0,h.v=n,h.n=a[1]):p<y&&(o=r<3||a[0]>n||n>y)&&(a[4]=r,a[5]=n,h.n=y,u=0))}if(o||r>1)return i;throw f=!0,n}return function(o,s,y){if(c>1)throw TypeError("Generator is already running");for(f&&1===s&&p(s,y),u=s,l=y;(e=u<2?t:l)||!f;){a||(u?u<3?(u>1&&(h.n=-1),p(u,l)):h.n=l:h.v=l);try{if(c=2,a){if(u||(o="next"),e=a[o]){if(!(e=e.call(a,l)))throw TypeError("iterator result is not an object");if(!e.done)return e;l=e.value,u<2&&(u=0)}else 1===u&&(e=a.return)&&e.call(a),u<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),u=1);a=t}else if((e=(f=h.n<0)?l:r.call(n,h))!==i)break}catch(e){a=t,u=1,l=e}finally{c=1}}return{value:e,done:f}}}(r,o,a),!0),c}var i={};function u(){}function l(){}function c(){}e=Object.getPrototypeOf;var s=[][n]?e(e([][n]())):(Et(e={},n,function(){return this}),e),f=c.prototype=u.prototype=Object.create(s);function h(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,Et(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return l.prototype=c,Et(f,"constructor",c),Et(c,"constructor",l),l.displayName="GeneratorFunction",Et(c,o,"GeneratorFunction"),Et(f),Et(f,o,"Generator"),Et(f,n,function(){return this}),Et(f,"toString",function(){return"[object Generator]"}),(xt=function(){return{w:a,m:h}})()}function Et(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}Et=function(t,e,r,n){function a(e,r){Et(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(a("next",0),a("throw",1),a("return",2))},Et(t,e,r,n)}function jt(t,e,r,n,o,a,i){try{var u=t[a](i),l=u.value}catch(t){return void r(t)}u.done?e(l):Promise.resolve(l).then(n,o)}function Nt(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var a=t.apply(e,r);function i(t){jt(a,n,o,i,u,"next",t)}function u(t){jt(a,n,o,i,u,"throw",t)}i(void 0)})}}var At=new Map,Tt=function(){var t=Nt(xt().m(function t(e,r,n,o){var a,i,u,l,c,s,f,h,p,y;return xt().w(function(t){for(;;)switch(t.n){case 0:if(a=n.getPatternInnerContent(e)){t.n=1;break}return t.a(2,null);case 1:if(i=n.getPatternImageId(e,r,o)){t.n=2;break}return t.a(2,null);case 2:if(u=At.get(i)){t.n=4;break}return l=Pt(e.fillPatternForegroundColor,r)||"black",c=Pt(e.fillPatternBackgroundColor,r)||"transparent",s=wt(a,l,c),f='<rect width="16" height="16" fill="'.concat(c,'"/>'),h=Mt(o),p=Math.round(8*h),y='<svg xmlns="http://www.w3.org/2000/svg" width="'.concat(p,'" height="').concat(p,'" viewBox="0 0 16 16">').concat(f).concat(s,"</svg>"),t.n=3,Ot(y,p,p);case 3:u=t.v,At.set(i,u);case 4:return t.a(2,{imageId:i,imageData:u})}},t)}));return function(e,r,n,o){return t.apply(this,arguments)}}(),It=function(){var t=Nt(xt().m(function t(e,r,n,o,a){var i,u;return xt().w(function(t){for(;;)switch(t.n){case 0:if(r.length){t.n=1;break}return t.a(2);case 1:return i=Mt(a),u=r.reduce(function(t,r){var u=o.getPatternImageId(r,n,a);return!u||t[u]||e.hasImage(u)||(t[u]=Nt(xt().m(function t(){var u;return xt().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,Tt(r,n,o,a);case 1:(u=t.v)&&!e.hasImage(u.imageId)&&e.addImage(u.imageId,u.imageData,{pixelRatio:i});case 2:return t.a(2)}},t)}))),t},{}),t.n=2,Promise.all(Object.values(u).map(function(t){return t()}));case 2:return t.a(2)}},t)}));return function(e,r,n,o,a){return t.apply(this,arguments)}}();function Lt(t){return Lt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lt(t)}var kt=["container","padding","mapStyle","mapSize","center","zoom","bounds","pixelRatio"];function Rt(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function a(r,n,o,a){var l=n&&n.prototype instanceof u?n:u,c=Object.create(l.prototype);return _t(c,"_invoke",function(r,n,o){var a,u,l,c=0,s=o||[],f=!1,h={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,r){return a=e,u=0,l=t,h.n=r,i}};function p(r,n){for(u=r,l=n,e=0;!f&&c&&!o&&e<s.length;e++){var o,a=s[e],p=h.p,y=a[2];r>3?(o=y===n)&&(l=a[(u=a[4])?5:(u=3,3)],a[4]=a[5]=t):a[0]<=p&&((o=r<2&&p<a[1])?(u=0,h.v=n,h.n=a[1]):p<y&&(o=r<3||a[0]>n||n>y)&&(a[4]=r,a[5]=n,h.n=y,u=0))}if(o||r>1)return i;throw f=!0,n}return function(o,s,y){if(c>1)throw TypeError("Generator is already running");for(f&&1===s&&p(s,y),u=s,l=y;(e=u<2?t:l)||!f;){a||(u?u<3?(u>1&&(h.n=-1),p(u,l)):h.n=l:h.v=l);try{if(c=2,a){if(u||(o="next"),e=a[o]){if(!(e=e.call(a,l)))throw TypeError("iterator result is not an object");if(!e.done)return e;l=e.value,u<2&&(u=0)}else 1===u&&(e=a.return)&&e.call(a),u<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),u=1);a=t}else if((e=(f=h.n<0)?l:r.call(n,h))!==i)break}catch(e){a=t,u=1,l=e}finally{c=1}}return{value:e,done:f}}}(r,o,a),!0),c}var i={};function u(){}function l(){}function c(){}e=Object.getPrototypeOf;var s=[][n]?e(e([][n]())):(_t(e={},n,function(){return this}),e),f=c.prototype=u.prototype=Object.create(s);function h(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,_t(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return l.prototype=c,_t(f,"constructor",c),_t(c,"constructor",l),l.displayName="GeneratorFunction",_t(c,o,"GeneratorFunction"),_t(f),_t(f,o,"Generator"),_t(f,n,function(){return this}),_t(f,"toString",function(){return"[object Generator]"}),(Rt=function(){return{w:a,m:h}})()}function _t(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}_t=function(t,e,r,n){function a(e,r){_t(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(a("next",0),a("throw",1),a("return",2))},_t(t,e,r,n)}function Ct(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function Dt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ct(Object(r),!0).forEach(function(e){Ft(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ct(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function Ft(t,e,r){return(e=Wt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Bt(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)r=a[n],-1===e.indexOf(r)&&{}.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function Gt(t,e,r,n,o,a,i){try{var u=t[a](i),l=u.value}catch(t){return void r(t)}u.done?e(l):Promise.resolve(l).then(n,o)}function $t(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var a=t.apply(e,r);function i(t){Gt(a,n,o,i,u,"next",t)}function u(t){Gt(a,n,o,i,u,"throw",t)}i(void 0)})}}function zt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Wt(n.key),n)}}function Wt(t){var e=function(t){if("object"!=Lt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Lt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Lt(e)?e:e+""}function qt(t,e,r){return e=Ht(e),function(t,e){if(e&&("object"==Lt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Zt()?Reflect.construct(e,r||[],Ht(t).constructor):e.apply(t,r))}function Zt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Zt=function(){return!!t})()}function Ht(t){return Ht=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ht(t)}function Ut(t,e){return Ut=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ut(t,e)}var Vt=function(t){function e(t){var r,n=t.mapFramework,o=t.mapProviderConfig,a=void 0===o?{}:o,i=t.events,u=t.eventBus;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=qt(this,e)).maplibreModule=n,r.events=i,r.eventBus=u,r.capabilities={supportedShortcuts:l,supportsMapSizes:!0},Object.assign(r,a),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ut(t,e)}(e,t),r=e,n=[{key:"name",get:function(){return"MapLibreProvider"}},{key:"initMap",value:(i=$t(Rt().m(function t(e){var r,n,o,a,i,u,l,f,h,d,v,g,m,b=this;return Rt().w(function(t){for(;;)switch(t.n){case 0:r=e.container,n=e.padding,o=e.mapStyle,a=e.mapSize,i=e.center,u=e.zoom,l=e.bounds,f=e.pixelRatio,h=Bt(e,kt),this.mapStyleId=null==o?void 0:o.id,this.mapSize=a,d=this.maplibreModule.Map,v=this.events,g=this.eventBus,(m=new d(Dt(Dt({},h),{},{container:r,style:null==o?void 0:o.url,pixelRatio:f,padding:n,center:i,zoom:u,fadeDuration:0,attributionControl:!1,dragRotate:!1,doubleClickZoom:!1}))).touchZoomRotate.disableRotation(),this.map=m,this.map.setPadding(n),l&&m.fitBounds(l,{duration:0}),s(m),c(m),p({map:m,events:v,eventBus:g,getCenter:this.getCenter.bind(this),getZoom:this.getZoom.bind(this),getBounds:this.getBounds.bind(this),getResolution:this.getResolution.bind(this)}),y({mapProvider:this,map:m,events:v,eventBus:g}),m.on("load",function(){b.labelNavigator=z(m,null==o?void 0:o.mapColorScheme,v,g)}),this.eventBus.emit(v.MAP_READY,{map:this.map,mapStyleId:this.mapStyleId,mapSize:this.mapSize,crs:this.crs});case 1:return t.a(2)}},t,this)})),function(t){return i.apply(this,arguments)})},{key:"isBaseMapReady",value:function(){var t;return Boolean(null===(t=this.map)||void 0===t?void 0:t.getStyle())}},{key:"destroyMap",value:function(){var t,e;this.setHoverCursor([]),null===(t=this.mapEvents)||void 0===t||t.remove(),null===(e=this.appEvents)||void 0===e||e.remove(),this.mapEvents=null,this.appEvents=null,this.map.remove()}},{key:"setHoverCursor",value:function(t){this.map&&(this._onHoverMove=yt(this.map,t,this._onHoverMove))}},{key:"setView",value:function(t){var e=t.center,r=t.zoom;this.map.flyTo({center:e||this.getCenter(),zoom:r||this.getZoom(),duration:this.map.isStyleLoaded()?u:0})}},{key:"zoomIn",value:function(t){this.map.easeTo({zoom:this.getZoom()+t,duration:u})}},{key:"zoomOut",value:function(t){this.map.easeTo({zoom:this.getZoom()-t,duration:u})}},{key:"panBy",value:function(t){this.map.panBy(t,{duration:u})}},{key:"fitToBounds",value:function(t){var e=Array.isArray(t)?t:N(t),r=this.map.isStyleLoaded()?u:0;this.map.fitBounds(e,{duration:r})}},{key:"setPadding",value:function(t){this.map.setPadding(t)}},{key:"updateHighlightedFeatures",value:function(t,e,r){return function(t){var e=t.LngLatBounds,r=t.map,n=t.selectedFeatures,o=t.activeFeatures,a=t.stylesMap;if(!r)return null;null!=o&&o.length?(lt(r,o,a,X,et),lt(r,o,a,Q,rt)):(at(r,X),at(r,Q));var i={};null!=n&&n.length?i=lt(r,n,a,tt,rt):at(r,tt);var u=[];return Object.entries(i).forEach(function(t){var e=Z(t,2),n=e[0],o=e[1],a=o.ids,i=o.idProperty;u.push.apply(u,function(t){return function(t){if(Array.isArray(t))return U(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||H(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(r.queryRenderedFeatures({layers:[n]}).filter(function(t){var e;return a.has(i?null===(e=t.properties)||void 0===e?void 0:e[i]:t.id)})))}),function(t,e){if(!e.length)return null;var r=new t;return e.forEach(function(t){var e=function(t){return"number"==typeof t[0]?r.extend(t):t.forEach(e)};e(t.geometry.coordinates)}),[r.getWest(),r.getSouth(),r.getEast(),r.getNorth()]}(e,u)}({LngLatBounds:this.maplibreModule.LngLatBounds,map:this.map,selectedFeatures:t,activeFeatures:e,stylesMap:r})}},{key:"highlightNextLabel",value:function(t){var e;return(null===(e=this.labelNavigator)||void 0===e?void 0:e.highlightNextLabel(t))||null}},{key:"highlightLabelAtCenter",value:function(){var t;return(null===(t=this.labelNavigator)||void 0===t?void 0:t.highlightLabelAtCenter())||null}},{key:"clearHighlightedLabel",value:function(){var t;return(null===(t=this.labelNavigator)||void 0===t?void 0:t.clearHighlightedLabel())||null}},{key:"getCenter",value:function(){var t=this.map.getCenter();return[Number(t.lng.toFixed(7)),Number(t.lat.toFixed(7))]}},{key:"getZoom",value:function(){return Number(this.map.getZoom().toFixed(7))}},{key:"getBounds",value:function(){return this.map.getBounds().toArray().flat(1)}},{key:"getFeaturesAtPoint",value:function(t,e){return function(t,e){var r=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).radius,n=void 0===r?10:r,o=[[e.x-n,e.y-n],[e.x+n,e.y+n]],a=t.queryRenderedFeatures(o);if(0===a.length)return[];var i=new Set(t.queryRenderedFeatures([e.x,e.y]).map(function(t){var e,r=void 0===t.id?JSON.stringify(t.properties):t.id;return"".concat(null===(e=t.layer)||void 0===e?void 0:e.source,":").concat(r)})),u=[];a.forEach(function(t){!1===u.includes(t.layer.id)&&u.push(t.layer.id)});for(var l=new Set,c=[],s=a.length-1;s>=0;s--){var f,h=a[s],p=void 0===h.id?JSON.stringify(h.properties):h.id,y="".concat(null===(f=h.layer)||void 0===f?void 0:f.source,":").concat(p);!1===l.has(y)&&(l.add(y),c.push(h))}var d=t.unproject(e),v=[d.lng,d.lat],g=c.filter(function(t){var e=t.geometry.type;if(e.includes("Polygon"))return("Polygon"===e?[t.geometry.coordinates]:t.geometry.coordinates).some(function(t){return function(t,e){for(var r=ct(t,2),n=r[0],o=r[1],a=!1,i=0,u=e.length-1;i<e.length;u=i,i++){var l=ct(e[i],2),c=l[0],s=l[1],f=ct(e[u],2),h=f[0],p=f[1];s>o!=p>o&&n<(h-c)*(o-s)/(p-s)+c&&(a=!a)}return a}(v,t[0])});if("Point"===e||"MultiPoint"===e){var r,n=void 0===t.id?JSON.stringify(t.properties):t.id;return i.has("".concat(null===(r=t.layer)||void 0===r?void 0:r.source,":").concat(n))}return!0});return g.map(function(r){var n=0,o=r.geometry.type,a=function(t,e,r){var n=r.coordinates,o=r.type,a=1/0,i=function(e){return t.project(e)},u=function(t){for(var r=0;r<t.length-1;r++){var n=ft(e,i(t[r]),i(t[r+1]));n<a&&(a=n)}};if("Point"===o){var l=i(n);a=Math.pow(e.x-l.x,2)+Math.pow(e.y-l.y,2)}else"LineString"===o||"MultiPoint"===o?"LineString"===o?u(n):n.forEach(function(t){var r=i(t),n=Math.pow(e.x-r.x,2)+Math.pow(e.y-r.y,2);n<a&&(a=n)}):"Polygon"===o||"MultiLineString"===o?n.forEach(u):"MultiPolygon"===o&&n.forEach(function(t){return t.forEach(u)});return a}(t,e,r.geometry);return n+=1e6*u.indexOf(r.layer.id),o.includes("Polygon")&&(n-=5e5),{f:r,score:n+=a}}).sort(function(t,e){return t.score-e.score}).map(function(t){return t.f})}(this.map,t,e)}},{key:"getVisibleFeatures",value:function(t){var e=this,r=t.filter(function(t){return e.map.getLayer(t)});return r.length?this.map.queryRenderedFeatures(void 0,{layers:r}):[]}},{key:"addSymbolsToMap",value:(a=$t(Rt().m(function t(e,r,n){var o;return Rt().w(function(t){for(;;)if(0===t.n)return o=this.map.getPixelRatio()||1,t.a(2,bt(this.map,e,r,n,o))},t,this)})),function(t,e,r){return a.apply(this,arguments)})},{key:"addPatternsToMap",value:(o=$t(Rt().m(function t(e,r,n){var o;return Rt().w(function(t){for(;;)if(0===t.n)return o=this.map.getPixelRatio()||1,t.a(2,It(this.map,e,r,n,o))},t,this)})),function(t,e,r){return o.apply(this,arguments)})},{key:"getAreaDimensions",value:function(){return function(t){var e,r,n,o;if(t&&"function"==typeof t.getWest)e=t.getWest(),r=t.getSouth(),n=t.getEast(),o=t.getNorth();else{if(!Array.isArray(t)||2!==t.length)return"";var a=P(t,2),i=P(a[0],2);e=i[0],r=i[1];var u=P(a[1],2);n=u[0],o=u[1]}var l=E([e,r],[n,r]),c=E([e,r],[e,o]),s=j(l),f=j(c);return"".concat(f," by ").concat(s)}((t=this.maplibreModule.LngLatBounds,e=this.map,r=e.getContainer().getBoundingClientRect(),n=r.width,o=r.height,a=e.getPadding(),i=[a.left,o-a.bottom],u=[n-a.right,a.top],new t(e.unproject(i),e.unproject(u))));var t,e,r,n,o,a,i,u}},{key:"getCardinalMove",value:function(t,e){return function(t,e){var r=P(t,2),n=r[0],o=r[1],a=P(e,2),i=a[0],u=a[1],l=u-o,c=i-n,s=[];if(Math.abs(l)>1e-4){var f=Math.round(E([n,o],[n,u]));s.push("".concat(l>0?"north":"south"," ").concat(j(f)))}if(Math.abs(c)>1e-4){var h=Math.round(E([n,o],[i,o]));s.push("".concat(c>0?"east":"west"," ").concat(j(h)))}return s.join(", ")}(t,e)}},{key:"getResolution",value:function(){return t=this.map.getCenter(),e=this.map.getZoom(),r=t.lat,n=Math.pow(2,e),40075016.686*Math.cos(r*Math.PI/180)/(512*n);var t,e,r,n}},{key:"mapToScreen",value:function(t){return this.map.project(t)}},{key:"screenToMap",value:function(t){var e=this.map.unproject([t.x,t.y]);return[e.lng,e.lat]}},{key:"isGeometryObscured",value:function(t,e){return function(t,e,r){var n=r.getContainer().getBoundingClientRect(),o=P(N(t),4),a=o[0],i=o[1],u=o[2],l=o[3],c=[r.project([a,i]),r.project([a,l]),r.project([u,i]),r.project([u,l])],s=Math.min.apply(Math,S(c.map(function(t){return t.x}))),f=Math.max.apply(Math,S(c.map(function(t){return t.x}))),h=Math.min.apply(Math,S(c.map(function(t){return t.y}))),p=Math.max.apply(Math,S(c.map(function(t){return t.y}))),y=e.left-n.left,d=e.top-n.top,v=e.right-n.left,g=e.bottom-n.top;return s<v&&f>y&&h<g&&p>d}(t,e,this.map)}}],n&&zt(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o,a,i}(i)}}]);
|
|
2
|
+
"use strict";(this.webpackChunkdefra_DefraMap=this.webpackChunkdefra_DefraMap||[]).push([[772],{808(t,e,r){function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,a(n.key),n)}}function a(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}r.r(e),r.d(e,{default:()=>Vt});var i=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)},(e=[{key:"isBaseMapReady",value:function(){throw new Error(this.name+" must implement isBaseMapReady()")}}])&&o(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}(),u=400,l=["showKeyboardHelp","selectControl","moveLarge","nudgeMap","zoomLarge","nudgeZoom","highlightLabelAtCenter","highlightNextLabel"];function c(t){var e=t.getCanvas();e.removeAttribute("role"),e.setAttribute("tabindex",-1),e.removeAttribute("aria-label"),e.style.display="block",e.addEventListener("focus",function(t){e.blur(),t.relatedTarget&&t.relatedTarget.focus({preventScroll:!0})})}function s(t){var e=Event.prototype.preventDefault;Event.prototype.preventDefault=function(){if(("touchmove"===this.type||"touchstart"===this.type)&&!this.cancelable){var r=t.getCanvas();if(r&&(this.target===r||r.contains(this.target)))return}e.call(this)}}var f=function(t,e){var r=null,n=function(){for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];clearTimeout(r),r=setTimeout(function(){t.apply(void 0,o)},e)};return n.cancel=function(){r&&(clearTimeout(r),r=null)},n};function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function p(t){var e=t.map,r=t.events,n=t.eventBus,o=t.getCenter,a=t.getZoom,i=t.getBounds,u=t.getResolution,l=[],c=[],s=function(){var t=a();return{center:o(),bounds:i(),resolution:u(),zoom:t,isAtMaxZoom:e.getMaxZoom()<=t,isAtMinZoom:e.getMinZoom()>=t}},p=function(t,e){return n.emit(t,e)},y=function(){return p(r.MAP_LOADED)};e.on("load",y),l.push(["load",y]),e.once("idle",function(){return p(r.MAP_FIRST_IDLE,s())});var d=function(){return p(r.MAP_MOVE_START)};e.on("movestart",d),l.push(["movestart",d]);var v=f(function(){p(r.MAP_MOVE_END,s())},500);e.on("moveend",v),l.push(["moveend",v]);var g,m,b=(g=function(){p(r.MAP_MOVE,s())},m=0,function(){var t=Date.now();t-m>=10&&(m=t,g.apply(void 0,arguments))});e.on("zoom",b),l.push(["zoom",b]);var M=function(){return p(r.MAP_RENDER)};e.on("render",M),l.push(["render",M]);var w=f(function(){p(r.MAP_DATA_CHANGE,s())},500),S=function(t){t.isSourceLoaded&&w()};e.on("styledata",w),e.on("sourcedata",S),l.push(["styledata",w],["sourcedata",S]);var P=function(){return p(r.MAP_STYLE_CHANGE)};e.on("style.load",P),l.push(["style.load",P]);var O=function(t){return p(r.MAP_CLICK,{point:t.point,coords:[t.lngLat.lng,t.lngLat.lat]})};return e.on("click",O),l.push(["click",O]),c.push(v,b,w),{remove:function(){c.forEach(function(t){return t.cancel()}),l.forEach(function(t){var r,n,o=(n=2,function(t){if(Array.isArray(t))return t}(r=t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,u=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(u.push(n.value),u.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return u}}(r,n)||function(t,e){if(t){if("string"==typeof t)return h(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?h(t,e):void 0}}(r,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=o[0],i=o[1];return e.off(a,i)})}}}function y(t){var e=t.mapProvider,r=t.map,n=t.events,o=t.eventBus,a=function(t){r.once("style.load",function(){o.emit(n.MAP_STYLE_CHANGE,{mapStyleId:t.id})}),r.setStyle(t.url,{diff:!1})},i=function(t){r.setPixelRatio(t)},u=function(t){var r=t.mapSize;e.mapSize=r};return o.on(n.MAP_SET_STYLE,a),o.on(n.MAP_SET_PIXEL_RATIO,i),o.on(n.MAP_SIZE_CHANGE,u),{remove:function(){o.off(n.MAP_SET_STYLE,a),o.off(n.MAP_SET_PIXEL_RATIO,i),o.off(n.MAP_SIZE_CHANGE,u)}}}let d=" ";class v{static get separator(){return d}static set separator(t){d=t}static parse(t){if(!isNaN(parseFloat(t))&&isFinite(t))return Number(t);const e=String(t).trim().replace(/^-/,"").replace(/[NSEW]$/i,"").split(/[^0-9.,]+/);if(""==e[e.length-1]&&e.splice(e.length-1),""==e)return NaN;let r=null;switch(e.length){case 3:r=e[0]/1+e[1]/60+e[2]/3600;break;case 2:r=e[0]/1+e[1]/60;break;case 1:r=e[0];break;default:return NaN}return/^-|[WS]$/i.test(t.trim())&&(r=-r),Number(r)}static toDms(t,e="d",r=void 0){if(isNaN(t))return null;if("string"==typeof t&&""==t.trim())return null;if("boolean"==typeof t)return null;if(t==1/0)return null;if(null==t)return null;if(void 0===r)switch(e){case"d":case"deg":r=4;break;case"dm":case"deg+min":r=2;break;case"dms":case"deg+min+sec":r=0;break;default:e="d",r=4}t=Math.abs(t);let n=null,o=null,a=null,i=null;switch(e){default:case"d":case"deg":o=t.toFixed(r),o<100&&(o="0"+o),o<10&&(o="0"+o),n=o+"°";break;case"dm":case"deg+min":o=Math.floor(t),a=(60*t%60).toFixed(r),60==a&&(a=(0).toFixed(r),o++),o=("000"+o).slice(-3),a<10&&(a="0"+a),n=o+"°"+v.separator+a+"′";break;case"dms":case"deg+min+sec":o=Math.floor(t),a=Math.floor(3600*t/60)%60,i=(3600*t%60).toFixed(r),60==i&&(i=(0).toFixed(r),a++),60==a&&(a=0,o++),o=("000"+o).slice(-3),a=("00"+a).slice(-2),i<10&&(i="0"+i),n=o+"°"+v.separator+a+"′"+v.separator+i+"″"}return n}static toLat(t,e,r){const n=v.toDms(v.wrap90(t),e,r);return null===n?"–":n.slice(1)+v.separator+(t<0?"S":"N")}static toLon(t,e,r){const n=v.toDms(v.wrap180(t),e,r);return null===n?"–":n+v.separator+(t<0?"W":"E")}static toBrng(t,e,r){const n=v.toDms(v.wrap360(t),e,r);return null===n?"–":n.replace("360","0")}static fromLocale(t){const e=123456.789.toLocaleString(),r={thousands:e.slice(3,4),decimal:e.slice(7,8)};return t.replace(r.thousands,"⁜").replace(r.decimal,".").replace("⁜",",")}static toLocale(t){const e=123456.789.toLocaleString(),r={thousands:e.slice(3,4),decimal:e.slice(7,8)};return t.replace(/,([0-9])/,"⁜$1").replace(".",r.decimal).replace("⁜",r.thousands)}static compassPoint(t,e=3){if(![1,2,3].includes(Number(e)))throw new RangeError(`invalid precision ‘${e}’`);t=v.wrap360(t);const r=4*2**(e-1);return["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.round(t*r/360)%r*16/r]}static wrap90(t){if(-90<=t&&t<=90)return t;const e=t;return 1*Math.abs(((e-90)%360+360)%360-180)-90}static wrap180(t){if(-180<=t&&t<=180)return t;const e=360;return((360*t/e-180)%e+e)%e-180}static wrap360(t){if(0<=t&&t<360)return t;const e=360;return(360*t/e%e+e)%e}}Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};const g=v,m=Math.PI;class b{constructor(t,e){if(isNaN(t))throw new TypeError(`invalid lat ‘${t}’`);if(isNaN(e))throw new TypeError(`invalid lon ‘${e}’`);this._lat=g.wrap90(Number(t)),this._lon=g.wrap180(Number(e))}get lat(){return this._lat}get latitude(){return this._lat}set lat(t){if(this._lat=isNaN(t)?g.wrap90(g.parse(t)):g.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid lat ‘${t}’`)}set latitude(t){if(this._lat=isNaN(t)?g.wrap90(g.parse(t)):g.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid latitude ‘${t}’`)}get lon(){return this._lon}get lng(){return this._lon}get longitude(){return this._lon}set lon(t){if(this._lon=isNaN(t)?g.wrap180(g.parse(t)):g.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lon ‘${t}’`)}set lng(t){if(this._lon=isNaN(t)?g.wrap180(g.parse(t)):g.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lng ‘${t}’`)}set longitude(t){if(this._lon=isNaN(t)?g.wrap180(g.parse(t)):g.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid longitude ‘${t}’`)}static get metresToKm(){return.001}static get metresToMiles(){return 1/1609.344}static get metresToNauticalMiles(){return 1/1852}static parse(...t){if(0==t.length)throw new TypeError("invalid (empty) point");if(null===t[0]||null===t[1])throw new TypeError("invalid (null) point");let e,r;if(2==t.length&&([e,r]=t,e=g.wrap90(g.parse(e)),r=g.wrap180(g.parse(r)),isNaN(e)||isNaN(r)))throw new TypeError(`invalid point ‘${t.toString()}’`);if(1==t.length&&"string"==typeof t[0]&&([e,r]=t[0].split(","),e=g.wrap90(g.parse(e)),r=g.wrap180(g.parse(r)),isNaN(e)||isNaN(r)))throw new TypeError(`invalid point ‘${t[0]}’`);if(1==t.length&&"object"==typeof t[0]){const n=t[0];if("Point"==n.type&&Array.isArray(n.coordinates)?[r,e]=n.coordinates:(null!=n.latitude&&(e=n.latitude),null!=n.lat&&(e=n.lat),null!=n.longitude&&(r=n.longitude),null!=n.lng&&(r=n.lng),null!=n.lon&&(r=n.lon),e=g.wrap90(g.parse(e)),r=g.wrap180(g.parse(r))),isNaN(e)||isNaN(r))throw new TypeError(`invalid point ‘${JSON.stringify(t[0])}’`)}if(isNaN(e)||isNaN(r))throw new TypeError(`invalid point ‘${t.toString()}’`);return new b(e,r)}distanceTo(t,e=6371e3){if(t instanceof b||(t=b.parse(t)),isNaN(e))throw new TypeError(`invalid radius ‘${e}’`);const r=e,n=this.lat.toRadians(),o=this.lon.toRadians(),a=t.lat.toRadians(),i=a-n,u=t.lon.toRadians()-o,l=Math.sin(i/2)*Math.sin(i/2)+Math.cos(n)*Math.cos(a)*Math.sin(u/2)*Math.sin(u/2);return r*(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)))}initialBearingTo(t){if(t instanceof b||(t=b.parse(t)),this.equals(t))return NaN;const e=this.lat.toRadians(),r=t.lat.toRadians(),n=(t.lon-this.lon).toRadians(),o=Math.cos(e)*Math.sin(r)-Math.sin(e)*Math.cos(r)*Math.cos(n),a=Math.sin(n)*Math.cos(r),i=Math.atan2(a,o).toDegrees();return g.wrap360(i)}finalBearingTo(t){t instanceof b||(t=b.parse(t));const e=t.initialBearingTo(this)+180;return g.wrap360(e)}midpointTo(t){t instanceof b||(t=b.parse(t));const e=this.lat.toRadians(),r=this.lon.toRadians(),n=t.lat.toRadians(),o=(t.lon-this.lon).toRadians(),a=Math.cos(e),i=Math.sin(e),u={x:a+Math.cos(n)*Math.cos(o),y:0+Math.cos(n)*Math.sin(o),z:i+Math.sin(n)},l=Math.atan2(u.z,Math.sqrt(u.x*u.x+u.y*u.y)),c=r+Math.atan2(u.y,u.x),s=l.toDegrees(),f=c.toDegrees();return new b(s,f)}intermediatePointTo(t,e){if(t instanceof b||(t=b.parse(t)),this.equals(t))return new b(this.lat,this.lon);const r=this.lat.toRadians(),n=this.lon.toRadians(),o=t.lat.toRadians(),a=t.lon.toRadians(),i=o-r,u=a-n,l=Math.sin(i/2)*Math.sin(i/2)+Math.cos(r)*Math.cos(o)*Math.sin(u/2)*Math.sin(u/2),c=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),s=Math.sin((1-e)*c)/Math.sin(c),f=Math.sin(e*c)/Math.sin(c),h=s*Math.cos(r)*Math.cos(n)+f*Math.cos(o)*Math.cos(a),p=s*Math.cos(r)*Math.sin(n)+f*Math.cos(o)*Math.sin(a),y=s*Math.sin(r)+f*Math.sin(o),d=Math.atan2(y,Math.sqrt(h*h+p*p)),v=Math.atan2(p,h),g=d.toDegrees(),m=v.toDegrees();return new b(g,m)}destinationPoint(t,e,r=6371e3){const n=t/r,o=Number(e).toRadians(),a=this.lat.toRadians(),i=this.lon.toRadians(),u=Math.sin(a)*Math.cos(n)+Math.cos(a)*Math.sin(n)*Math.cos(o),l=Math.asin(u),c=Math.sin(o)*Math.sin(n)*Math.cos(a),s=Math.cos(n)-Math.sin(a)*u,f=i+Math.atan2(c,s),h=l.toDegrees(),p=f.toDegrees();return new b(h,p)}static intersection(t,e,r,n){if(t instanceof b||(t=b.parse(t)),r instanceof b||(r=b.parse(r)),isNaN(e))throw new TypeError(`invalid brng1 ‘${e}’`);if(isNaN(n))throw new TypeError(`invalid brng2 ‘${n}’`);const o=t.lat.toRadians(),a=t.lon.toRadians(),i=r.lat.toRadians(),u=r.lon.toRadians(),l=Number(e).toRadians(),c=Number(n).toRadians(),s=i-o,f=u-a,h=2*Math.asin(Math.sqrt(Math.sin(s/2)*Math.sin(s/2)+Math.cos(o)*Math.cos(i)*Math.sin(f/2)*Math.sin(f/2)));if(Math.abs(h)<Number.EPSILON)return new b(t.lat,t.lon);const p=(Math.sin(i)-Math.sin(o)*Math.cos(h))/(Math.sin(h)*Math.cos(o)),y=(Math.sin(o)-Math.sin(i)*Math.cos(h))/(Math.sin(h)*Math.cos(i)),d=Math.acos(Math.min(Math.max(p,-1),1)),v=Math.acos(Math.min(Math.max(y,-1),1)),g=l-(Math.sin(u-a)>0?d:2*m-d),M=(Math.sin(u-a)>0?2*m-v:v)-c;if(0==Math.sin(g)&&0==Math.sin(M))return null;if(Math.sin(g)*Math.sin(M)<0)return null;const w=-Math.cos(g)*Math.cos(M)+Math.sin(g)*Math.sin(M)*Math.cos(h),S=Math.atan2(Math.sin(h)*Math.sin(g)*Math.sin(M),Math.cos(M)+Math.cos(g)*w),P=Math.asin(Math.min(Math.max(Math.sin(o)*Math.cos(S)+Math.cos(o)*Math.sin(S)*Math.cos(l),-1),1)),O=a+Math.atan2(Math.sin(l)*Math.sin(S)*Math.cos(o),Math.cos(S)-Math.sin(o)*Math.sin(P)),x=P.toDegrees(),E=O.toDegrees();return new b(x,E)}crossTrackDistanceTo(t,e,r=6371e3){t instanceof b||(t=b.parse(t)),e instanceof b||(e=b.parse(e));const n=r;if(this.equals(t))return 0;const o=t.distanceTo(this,n)/n,a=t.initialBearingTo(this).toRadians(),i=t.initialBearingTo(e).toRadians();return Math.asin(Math.sin(o)*Math.sin(a-i))*n}alongTrackDistanceTo(t,e,r=6371e3){t instanceof b||(t=b.parse(t)),e instanceof b||(e=b.parse(e));const n=r;if(this.equals(t))return 0;const o=t.distanceTo(this,n)/n,a=t.initialBearingTo(this).toRadians(),i=t.initialBearingTo(e).toRadians(),u=Math.asin(Math.sin(o)*Math.sin(a-i));return Math.acos(Math.cos(o)/Math.abs(Math.cos(u)))*Math.sign(Math.cos(i-a))*n}maxLatitude(t){const e=Number(t).toRadians(),r=this.lat.toRadians();return Math.acos(Math.abs(Math.sin(e)*Math.cos(r))).toDegrees()}static crossingParallels(t,e,r){if(t.equals(e))return null;const n=Number(r).toRadians(),o=t.lat.toRadians(),a=t.lon.toRadians(),i=e.lat.toRadians(),u=e.lon.toRadians()-a,l=Math.sin(o)*Math.cos(i)*Math.cos(n)*Math.sin(u),c=Math.sin(o)*Math.cos(i)*Math.cos(n)*Math.cos(u)-Math.cos(o)*Math.sin(i)*Math.cos(n),s=Math.cos(o)*Math.cos(i)*Math.sin(n)*Math.sin(u);if(s*s>l*l+c*c)return null;const f=Math.atan2(-c,l),h=Math.acos(s/Math.sqrt(l*l+c*c)),p=a+f+h,y=(a+f-h).toDegrees(),d=p.toDegrees();return{lon1:g.wrap180(y),lon2:g.wrap180(d)}}rhumbDistanceTo(t,e=6371e3){t instanceof b||(t=b.parse(t));const r=e,n=this.lat.toRadians(),o=t.lat.toRadians(),a=o-n;let i=Math.abs(t.lon-this.lon).toRadians();Math.abs(i)>m&&(i=i>0?-(2*m-i):2*m+i);const u=Math.log(Math.tan(o/2+m/4)/Math.tan(n/2+m/4)),l=Math.abs(u)>1e-11?a/u:Math.cos(n);return Math.sqrt(a*a+l*l*i*i)*r}rhumbBearingTo(t){if(t instanceof b||(t=b.parse(t)),this.equals(t))return NaN;const e=this.lat.toRadians(),r=t.lat.toRadians();let n=(t.lon-this.lon).toRadians();Math.abs(n)>m&&(n=n>0?-(2*m-n):2*m+n);const o=Math.log(Math.tan(r/2+m/4)/Math.tan(e/2+m/4)),a=Math.atan2(n,o).toDegrees();return g.wrap360(a)}rhumbDestinationPoint(t,e,r=6371e3){const n=this.lat.toRadians(),o=this.lon.toRadians(),a=Number(e).toRadians(),i=t/r,u=i*Math.cos(a);let l=n+u;Math.abs(l)>m/2&&(l=l>0?m-l:-m-l);const c=Math.log(Math.tan(l/2+m/4)/Math.tan(n/2+m/4)),s=Math.abs(c)>1e-11?u/c:Math.cos(n),f=o+i*Math.sin(a)/s,h=l.toDegrees(),p=f.toDegrees();return new b(h,p)}rhumbMidpointTo(t){t instanceof b||(t=b.parse(t));const e=this.lat.toRadians();let r=this.lon.toRadians();const n=t.lat.toRadians(),o=t.lon.toRadians();Math.abs(o-r)>m&&(r+=2*m);const a=(e+n)/2,i=Math.tan(m/4+e/2),u=Math.tan(m/4+n/2),l=Math.tan(m/4+a/2);let c=((o-r)*Math.log(l)+r*Math.log(u)-o*Math.log(i))/Math.log(u/i);isFinite(c)||(c=(r+o)/2);const s=a.toDegrees(),f=c.toDegrees();return new b(s,f)}static areaOf(t,e=6371e3){const r=e,n=t[0].equals(t[t.length-1]);n||t.push(t[0]);const o=t.length-1;let a=0;for(let e=0;e<o;e++){const r=t[e].lat.toRadians(),n=t[e+1].lat.toRadians(),o=(t[e+1].lon-t[e].lon).toRadians();a+=2*Math.atan2(Math.tan(o/2)*(Math.tan(r/2)+Math.tan(n/2)),1+Math.tan(r/2)*Math.tan(n/2))}(function(t){let e=0,r=t[0].initialBearingTo(t[1]);for(let n=0;n<t.length-1;n++){const o=t[n].initialBearingTo(t[n+1]),a=t[n].finalBearingTo(t[n+1]);e+=(o-r+540)%360-180,e+=(a-o+540)%360-180,r=a}return e+=(t[0].initialBearingTo(t[1])-r+540)%360-180,Math.abs(e)<90})(t)&&(a=Math.abs(a)-2*m);const i=Math.abs(a*r*r);return n||t.pop(),i}equals(t){return t instanceof b||(t=b.parse(t)),!(Math.abs(this.lat-t.lat)>Number.EPSILON||Math.abs(this.lon-t.lon)>Number.EPSILON)}toGeoJSON(){return{type:"Point",coordinates:[this.lon,this.lat]}}toString(t="d",e=void 0){if(!["d","dm","dms","n"].includes(t))throw new RangeError(`invalid format ‘${t}’`);return"n"==t?(null==e&&(e=4),`${this.lat.toFixed(e)},${this.lon.toFixed(e)}`):`${g.toLat(this.lat,t,e)}, ${g.toLon(this.lon,t,e)}`}}function M(t,e,r){if(null!==t)for(var n,o,a,i,u,l,c,s,f=0,h=0,p=t.type,y="FeatureCollection"===p,d="Feature"===p,v=y?t.features.length:1,g=0;g<v;g++){u=(s=!!(c=y?t.features[g].geometry:d?t.geometry:t)&&"GeometryCollection"===c.type)?c.geometries.length:1;for(var m=0;m<u;m++){var b=0,w=0;if(null!==(i=s?c.geometries[m]:c)){l=i.coordinates;var S=i.type;switch(f=!r||"Polygon"!==S&&"MultiPolygon"!==S?0:1,S){case null:break;case"Point":if(!1===e(l,h,g,b,w))return!1;h++,b++;break;case"LineString":case"MultiPoint":for(n=0;n<l.length;n++){if(!1===e(l[n],h,g,b,w))return!1;h++,"MultiPoint"===S&&b++}"LineString"===S&&b++;break;case"Polygon":case"MultiLineString":for(n=0;n<l.length;n++){for(o=0;o<l[n].length-f;o++){if(!1===e(l[n][o],h,g,b,w))return!1;h++}"MultiLineString"===S&&b++,"Polygon"===S&&w++}"Polygon"===S&&b++;break;case"MultiPolygon":for(n=0;n<l.length;n++){for(w=0,o=0;o<l[n].length;o++){for(a=0;a<l[n][o].length-f;a++){if(!1===e(l[n][o][a],h,g,b,w))return!1;h++}w++}b++}break;case"GeometryCollection":for(n=0;n<i.geometries.length;n++)if(!1===M(i.geometries[n],e,r))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}var w=function(t,e={}){if(null!=t.bbox&&!0!==e.recompute)return t.bbox;const r=[1/0,1/0,-1/0,-1/0];return M(t,t=>{r[0]>t[0]&&(r[0]=t[0]),r[1]>t[1]&&(r[1]=t[1]),r[2]<t[0]&&(r[2]=t[0]),r[3]<t[1]&&(r[3]=t[1])}),r};function S(t){return function(t){if(Array.isArray(t))return x(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||O(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function P(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,u=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(u.push(n.value),u.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return u}}(t,e)||O(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function O(t,e){if(t){if("string"==typeof t)return x(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?x(t,e):void 0}}function x(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var E=function(t,e){var r=P(t,2),n=r[0],o=r[1],a=P(e,2),i=a[0],u=a[1],l=new b(o,n),c=new b(u,i);return l.distanceTo(c)},j=function(t){var e=t/1609.344;if(e<.5)return"".concat(Math.round(t),"m");if(e<10){var r=Number.parseFloat(e.toFixed(1)),n=1===r?"mile":"miles";return"".concat(r," ").concat(n)}var o=Math.round(e);return"".concat(o," miles")},N=function(t){return w(t)};function A(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,u=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(u.push(n.value),u.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return T(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?T(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function T(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function I(t){return I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},I(t)}function L(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function k(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?L(Object(r),!0).forEach(function(e){R(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):L(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function R(t,e,r){return(e=function(t){var e=function(t){if("object"!=I(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=I(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==I(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var C="highlighted-label";function D(t,e){if("number"==typeof t)return t;if(!Array.isArray(t)||"interpolate"!==t[0])return function(t,e){var r=t.stops;if(r.length<2)return r.length>0?r[0][1]:0;for(var n=r[0],o=r[r.length-1],a=1;a<r.length;a++){var i=r[a];if(i[0]>e){o=i,n=r[a-1];break}n=r[a-1],o=i}var u=A(n,2),l=u[0],c=u[1],s=A(o,2),f=s[0],h=s[1];return e<=l?c:e>=f?h:c+(e-l)/(f-l)*(h-c)}(t,e);var r,n=function(t){if(Array.isArray(t))return t}(r=t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(r)||function(t,e){if(t){if("string"==typeof t)return _(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_(t,e):void 0}}(r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),o=n[2],a=_(n).slice(3);if("zoom"!==o[0])throw new Error("Only zoom-based expressions supported");for(var i=0;i<a.length-2;i+=2){var u=a[i],l=a[i+1],c=a[i+2],s=a[i+3];if(e<=u)return l;if(e<=c)return l+(e-u)/(c-u)*(s-l)}return a[a.length-1]}function F(t,e){if(e.highlightLayerId&&t.getLayer(e.highlightLayerId)){try{t.removeLayer(e.highlightLayerId)}catch(t){}e.highlightLayerId=null,e.highlightedExpr=null}}function B(t,e,r){var n,o,a,i;if(null!=e&&null!==(n=e.feature)&&void 0!==n&&n.layer){F(t,r);var u=e.feature,l=e.layer;r.highlightLayerId="highlight-".concat(l.id);var c=u.id,s=u.type,f=u.properties,h=u.geometry;t.getSource(C).setData({id:c,type:s,properties:f,geometry:h}),r.highlightedExpr=l.layout["text-size"];var p=t.getZoom(),y=(o=l,a=1.5*D(r.highlightedExpr,p),i=r.isDarkStyle?{text:"#ffffff",halo:"#000000"}:{text:"#000000",halo:"#ffffff"},{id:"highlight-".concat(o.id),type:o.type,source:C,layout:k(k({},o.layout),{},{"text-size":a,"text-allow-overlap":!0,"text-ignore-placement":!0,"text-max-angle":90}),paint:k(k({},o.paint),{},{"text-color":i.text,"text-halo-color":i.halo,"text-halo-width":3,"text-halo-blur":1,"text-opacity":1})});t.addLayer(y),t.moveLayer(r.highlightLayerId)}}function G(t){t.getSource(C)||t.addSource(C,{type:"geojson",data:{type:"FeatureCollection",features:[]}})}function $(t){t.getStyle().layers.filter(function(t){var e;return"line"===(null===(e=t.layout)||void 0===e?void 0:e["symbol-placement"])}).forEach(function(e){return t.setLayoutProperty(e.id,"symbol-placement","line-center")})}function z(t,e,r,n){var o={isDarkStyle:"dark"===e,labels:[],currentPixel:null,highlightLayerId:null,highlightedExpr:null};function a(){var e=t.getStyle().layers.filter(function(t){return"symbol"===t.type}),r=t.queryRenderedFeatures({layers:e.map(function(t){return t.id})});o.labels=function(t,e,r){return e.flatMap(function(e){var n,o,a,i,u="string"==typeof(o=null===(n=e.layout)||void 0===n?void 0:n["text-field"])?null===(a=/^{(.+)}$/.exec(o))||void 0===a?void 0:a[1]:Array.isArray(o)?null===(i=o.find(function(t){return Array.isArray(t)&&"get"===t[0]}))||void 0===i?void 0:i[1]:null;return u?r.filter(function(t){var r;return t.layer.id===e.id&&(null===(r=t.properties)||void 0===r?void 0:r[u])}).map(function(r){return function(t,e,r,n){var o=function(t){var e=t.type,r=t.coordinates;if("Point"===e)return r;if("MultiPoint"===e)return r[0];if(e.includes("LineString")){var n="LineString"===e?r:r[0];return[(n[0][0]+n[n.length-1][0])/2,(n[0][1]+n[n.length-1][1])/2]}if(e.includes("Polygon")){var o="Polygon"===e?r[0]:r[0][0],a=o.reduce(function(t,e){return[t[0]+e[0],t[1]+e[1]]},[0,0]);return[a[0]/o.length,a[1]/o.length]}return null}(t.geometry);if(!o)return null;var a=n.project({lng:o[0],lat:o[1]});return{text:t.properties[r],x:a.x,y:a.y,feature:t,layer:e}}(r,e,u,t)}).filter(Boolean):[]})}(t,e,r)}function i(){if(a(),!o.labels.length)return null;var e=t.project(t.getCenter()),r=function(t,e){var r;return null===(r=t.reduce(function(t,r){var n=Math.pow(r.x-e.x,2)+Math.pow(r.y-e.y,2);return!t||n<t.dist?{label:r,dist:n}:t},null))||void 0===r?void 0:r.label}(o.labels,e);return o.currentPixel={x:r.x,y:r.y},B(t,r,o),"".concat(r.text," (").concat(r.layer.id,")")}return $(t),G(t),null==n||n.on(r.MAP_SET_STYLE,function(e){t.once("styledata",function(){return t.once("idle",function(){$(t),G(t),o.isDarkStyle="dark"===(null==e?void 0:e.mapColorScheme)})})}),t.on("zoom",function(){if(o.highlightLayerId&&o.highlightedExpr){var e=D(o.highlightedExpr,t.getZoom());t.setLayoutProperty(o.highlightLayerId,"text-size",1.5*e)}}),function(t){t.getStyle().layers.filter(function(t){return"symbol"===t.type}).forEach(function(e){t.setPaintProperty(e.id,"text-opacity",["case",["boolean",["feature-state","highlighted"],!1],0,1])})}(t),{refreshLabels:a,highlightNextLabel:function(e){if(a(),!o.labels.length)return null;if(!o.currentPixel)return i();var r=function(t,e){if(!e.currentPixel)return null;var r=e.labels.map(function(t,e){return{pixel:[t.x,t.y],index:e}}).filter(function(t){return t.pixel[0]!==e.currentPixel.x||t.pixel[1]!==e.currentPixel.y});if(!r.length)return null;var n=r.map(function(t){return t.pixel}),o=function(t,e,r){var n=function(t,e){return t[0]===e[0]&&t[1]===e[1]},o=e.filter(function(e){var o=Math.abs(e[0]-t[0]),a=Math.abs(e[1]-t[1]);return("ArrowUp"===r?e[1]<=t[1]&&a>=o:"ArrowDown"===r?e[1]>t[1]&&a>=o:"ArrowLeft"===r?e[0]<=t[0]&&a<o:"ArrowRight"!==r||e[0]>t[0]&&a<o)&&!n(e,t)});o.length||o.push(t);var a=function(e){return Math.hypot(t[0]-e[0],t[1]-e[1])},i=o.reduce(function(t,e){return a(e)<a(t)?e:t},o[0]);return e.findIndex(function(t){return n(t,i)})}([e.currentPixel.x,e.currentPixel.y],n,t);return(null==o||o<0||o>=r.length)&&(o=0),e.labels[r[o].index]}(e,o);return r?(o.currentPixel={x:r.x,y:r.y},B(t,r,o),"".concat(r.text," (").concat(r.layer.id,")")):null},highlightLabelAtCenter:i,clearHighlightedLabel:function(){return F(t,o)}}}var W=function(t){return t.endsWith(".cold")?"".concat(t.slice(0,-5),".hot"):t.endsWith(".hot")?"".concat(t.slice(0,-4),".cold"):null};function q(t){return q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},q(t)}function Z(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,u=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(u.push(n.value),u.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return u}}(t,e)||H(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function H(t,e){if(t){if("string"==typeof t)return U(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?U(t,e):void 0}}function U(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function V(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function Y(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?V(Object(r),!0).forEach(function(e){J(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):V(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function J(t,e,r){return(e=function(t){var e=function(t){if("object"!=q(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=q(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==q(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var K="icon-image",X="active-highlight",Q="active-highlight-inner",tt="selected-highlight",et=function(t,e){var r,n;return null!==(r=null===(n=t._activeSymbolImageMap)||void 0===n?void 0:n[e])&&void 0!==r?r:null},rt=function(t,e){var r,n;return null!==(r=null===(n=t._selectedSymbolImageMap)||void 0===n?void 0:n[e])&&void 0!==r?r:null},nt=function(t,e,r,n){var o=n.featureId,a=n.idProperty,i=n.geometry,u=t.getLayer(r);u&&(e[r]||(e[r]={ids:new Set,fillIds:new Set,idProperty:a,sourceId:u.source,hasFillGeometry:!1}),!i||"Polygon"!==i.type&&"MultiPolygon"!==i.type||(e[r].hasFillGeometry=!0,e[r].fillIds.add(o)),e[r].ids.add(o))},ot=function(t,e,r,n){e.forEach(function(e){if(!r.has(e)){var o="".concat(n,"-").concat(e);["".concat(o,"-fill"),"".concat(o,"-line"),"".concat(o,"-symbol")].forEach(function(e){t.getLayer(e)&&t.setFilter(e,["==","id",""])})}})},at=function(t,e){var r="_".concat(e.replaceAll("-",""),"Sources");ot(t,t[r]||new Set,new Set,e),t[r]=new Set},it=function(t,e,r,n,o,a,i){!!t.getLayer(e)||t.addLayer(Y(Y({id:e,type:r,source:n},o&&{"source-layer":o}),{},{paint:a})),Object.entries(a).forEach(function(r){var n=Z(r,2),o=n[0],a=n[1];t.setPaintProperty(e,o,a)}),t.setFilter(e,i),t.moveLayer(e)},ut=function(t,e,r,n,o,a,i){var u,l=t.getLayoutProperty(o,"icon-offset");t.getLayer(e)||t.addLayer(Y(Y({id:e,type:"symbol",source:r},n&&{"source-layer":n}),{},{layout:Y(Y(J(J({},K,a),"icon-anchor",null!==(u=t.getLayoutProperty(o,"icon-anchor"))&&void 0!==u?u:"center"),void 0!==l&&{"icon-offset":l}),{},{"icon-allow-overlap":!0})})),t.setLayoutProperty(e,K,a),void 0!==l&&t.setLayoutProperty(e,"icon-offset",l),t.setFilter(e,i),t.moveLayer(e)},lt=function(t,e,r,n,o){var a=function(t,e){var r={};return null==e||e.forEach(function(e){nt(t,r,e.layerId,e);var n=W(e.layerId);n&&nt(t,r,n,e)}),r}(t,e),i=new Set(Object.keys(a)),u="_".concat(n.replaceAll("-",""),"Sources"),l=t[u]||new Set;return ot(t,l,i,n),t[u]=i,i.forEach(function(e){return function(t,e,r,n,o,a){var i,u=r[e],l=u.ids,c=u.fillIds,s=u.idProperty,f=u.sourceId,h=u.hasFillGeometry,p=t.getLayer(e),y=null!==(i=n[e])&&void 0!==i?i:n[W(e)];if(p&&y){var d=p.sourceLayer,v=h?"fill":p.type,g="".concat(o,"-").concat(e),m=y.fill,b=o===tt,M=function(t){return t===tt||t===Q}(o),w=function(t,e){return{lineColor:e?t.selectionStroke:t.stroke,lineWidth:e?t.strokeWidth:t.activeStrokeWidth}}(y,M),S=w.lineColor,P=w.lineWidth,O=s?["get",s]:["id"],x=["in",O,["literal",Array.from(l)]];if("fill-extrusion"!==p.type)switch(v){case"fill":!function(t,e,r,n,o){var a=o.idExpression,i=o.fill,u=o.lineColor,l=o.lineWidth,c=o.filter;if(o.isSelected){var s=[];o.fillIds.forEach(function(t){return s.push(t)});var f=["in",a,["literal",s]];it(t,"".concat(e,"-fill"),"fill",r,n,{"fill-color":i},f)}it(t,"".concat(e,"-line"),"line",r,n,{"line-color":u,"line-width":l},c)}(t,g,f,d,{isSelected:b,idExpression:O,fillIds:c,fill:m,lineColor:S,lineWidth:P,filter:x});break;case"line":!function(t,e,r,n,o,a,i){t.getLayer("".concat(e,"-fill"))&&t.setFilter("".concat(e,"-fill"),["==","id",""]),it(t,"".concat(e,"-line"),"line",r,n,{"line-color":o,"line-width":a},i)}(t,g,f,d,S,P,x);break;case"symbol":!function(t,e,r,n,o,a,i){var u=t.getLayoutProperty(o,K);if(Array.isArray(u)){var l=i===et?"user_symbolActiveImageId":"user_symbolSelectedImageId";ut(t,"".concat(e,"-symbol"),r,n,o,["get",l],a)}else{var c=i(t,u);c&&ut(t,"".concat(e,"-symbol"),r,n,o,c,a)}}(t,g,f,d,e,x,a)}else!function(t,e,r,n){var o=n.lineColor,a=n.lineWidth,i=n.idExpression,u=[];n.ids.forEach(function(t){return u.push(t)});var l=["in",i,["literal",u]],c=t.getLayer(r),s=c.source,f=c.sourceLayer;it(t,"".concat(e,"-line"),"line",s,f,{"line-color":o,"line-width":a},l)}(t,g,e,{ids:l,lineColor:S,lineWidth:P,idExpression:O})}}(t,e,a,r,n,o)}),a};function ct(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,u=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(u.push(n.value),u.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return st(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?st(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function st(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var ft=function(t,e,r){var n=Math.pow(e.x-r.x,2)+Math.pow(e.y-r.y,2);if(0===n)return Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2);var o=((t.x-e.x)*(r.x-e.x)+(t.y-e.y)*(r.y-e.y))/n;return o=Math.max(0,Math.min(1,o)),Math.pow(t.x-(e.x+o*(r.x-e.x)),2)+Math.pow(t.y-(e.y+o*(r.y-e.y)),2)};function ht(t,e){if(t){if("string"==typeof t)return pt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?pt(t,e):void 0}}function pt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var yt=function(t,e,r){var n=t.getCanvas();if(r&&t.off("mousemove",r),null==e||!e.length)return n.style.cursor="",null;var o=function(r){var o=function(t){var e,r=new Set(t);return t.forEach(function(t){var e=W(t);e&&r.add(e)}),function(t){if(Array.isArray(t))return pt(t)}(e=r)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(e)||ht(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e).filter(function(e){return t.getLayer(e)});if(0!==o.length){var a=function(t,e){var r,n=[],o=[],a=function(t){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=ht(t))){e&&(t=e);var r=0,n=function(){};return{s:n,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,i=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return a=t.done,t},e:function(t){i=!0,o=t},f:function(){try{a||null==e.return||e.return()}finally{if(i)throw o}}}}(e);try{for(a.s();!(r=a.n()).done;){var i=r.value;if("line"===t.getLayer(i).type){var u=i.endsWith("-stroke")?i.slice(0,-7):null;null!==u&&e.includes(u)||n.push(i)}else o.push(i)}}catch(t){a.e(t)}finally{a.f()}return{lineLayers:n,otherLayers:o}}(t,o),i=a.lineLayers,u=a.otherLayers,l=r.point,c=l.x,s=l.y,f=[[c-10,s-10],[c+10,s+10]],h=i.length>0&&t.queryRenderedFeatures(f,{layers:i}).length>0,p=u.length>0&&t.queryRenderedFeatures(r.point,{layers:u}).length>0;n.style.cursor=h||p?"pointer":""}else n.style.cursor=""};return t.on("mousemove",o),o};function dt(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function a(r,n,o,a){var l=n&&n.prototype instanceof u?n:u,c=Object.create(l.prototype);return vt(c,"_invoke",function(r,n,o){var a,u,l,c=0,s=o||[],f=!1,h={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,r){return a=e,u=0,l=t,h.n=r,i}};function p(r,n){for(u=r,l=n,e=0;!f&&c&&!o&&e<s.length;e++){var o,a=s[e],p=h.p,y=a[2];r>3?(o=y===n)&&(l=a[(u=a[4])?5:(u=3,3)],a[4]=a[5]=t):a[0]<=p&&((o=r<2&&p<a[1])?(u=0,h.v=n,h.n=a[1]):p<y&&(o=r<3||a[0]>n||n>y)&&(a[4]=r,a[5]=n,h.n=y,u=0))}if(o||r>1)return i;throw f=!0,n}return function(o,s,y){if(c>1)throw TypeError("Generator is already running");for(f&&1===s&&p(s,y),u=s,l=y;(e=u<2?t:l)||!f;){a||(u?u<3?(u>1&&(h.n=-1),p(u,l)):h.n=l:h.v=l);try{if(c=2,a){if(u||(o="next"),e=a[o]){if(!(e=e.call(a,l)))throw TypeError("iterator result is not an object");if(!e.done)return e;l=e.value,u<2&&(u=0)}else 1===u&&(e=a.return)&&e.call(a),u<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),u=1);a=t}else if((e=(f=h.n<0)?l:r.call(n,h))!==i)break}catch(e){a=t,u=1,l=e}finally{c=1}}return{value:e,done:f}}}(r,o,a),!0),c}var i={};function u(){}function l(){}function c(){}e=Object.getPrototypeOf;var s=[][n]?e(e([][n]())):(vt(e={},n,function(){return this}),e),f=c.prototype=u.prototype=Object.create(s);function h(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,vt(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return l.prototype=c,vt(f,"constructor",c),vt(c,"constructor",l),l.displayName="GeneratorFunction",vt(c,o,"GeneratorFunction"),vt(f),vt(f,o,"Generator"),vt(f,n,function(){return this}),vt(f,"toString",function(){return"[object Generator]"}),(dt=function(){return{w:a,m:h}})()}function vt(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}vt=function(t,e,r,n){function a(e,r){vt(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(a("next",0),a("throw",1),a("return",2))},vt(t,e,r,n)}function gt(t,e,r,n,o,a,i){try{var u=t[a](i),l=u.value}catch(t){return void r(t)}u.done?e(l):Promise.resolve(l).then(n,o)}function mt(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var a=t.apply(e,r);function i(t){gt(a,n,o,i,u,"next",t)}function u(t){gt(a,n,o,i,u,"throw",t)}i(void 0)})}}var bt=function(){var t=mt(dt().m(function t(e,r,n,o){var a,i,u,l=arguments;return dt().w(function(t){for(;;)switch(t.n){case 0:if(u=l.length>4&&void 0!==l[4]?l[4]:2,r.length){t.n=1;break}return t.a(2);case 1:return null!==(a=e._activeSymbolImageMap)&&void 0!==a||(e._activeSymbolImageMap={}),null!==(i=e._selectedSymbolImageMap)&&void 0!==i||(e._selectedSymbolImageMap={}),t.n=2,Promise.all(r.flatMap(function(t){var r=o.getSymbolImageId(t,n,!1,u),a=o.getSymbolImageId(t,n,!0,u);return r&&a&&(e._activeSymbolImageMap[r]=a),["normal","active","selected"].map(function(){var i=mt(dt().m(function i(l){var c,s;return dt().w(function(i){for(;;)switch(i.n){case 0:if(c="active"===l?a:r,"selected"===l||c&&!e.hasImage(c)){i.n=1;break}return i.a(2);case 1:return i.n=2,o.rasteriseSymbolImage(t,n,l,u);case 2:(s=i.v)&&("selected"===l&&r&&(e._selectedSymbolImageMap[r]=s.imageId),e.hasImage(s.imageId)||e.addImage(s.imageId,s.imageData,{pixelRatio:u}));case 3:return i.a(2)}},i)}));return function(t){return i.apply(this,arguments)}}())}));case 2:return t.a(2)}},t)}));return function(e,r,n,o){return t.apply(this,arguments)}}(),Mt=function(t){return Math.max(2,2*t)},wt=function(t,e,r){return t.replace(/\{\{foregroundColor\}\}/g,e||"black").replace(/\{\{backgroundColor\}\}/g,r||"transparent")};function St(t){return St="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},St(t)}var Pt=function(t,e){if(!t)return null;if("string"==typeof t)return t.trim();if("object"===St(t)){if(e&&t[e])return t[e];var r=Object.values(t)[0];return null!=r?r:null}return null},Ot=function(t,e,r){return new Promise(function(n,o){var a="data:image/svg+xml;charset=utf-8,".concat(encodeURIComponent(t)),i=new Image(e,r);i.onload=function(){var t=document.createElement("canvas");t.width=e,t.height=r;var o=t.getContext("2d");o.drawImage(i,0,0,e,r),n(o.getImageData(0,0,e,r))},i.onerror=function(){o(new Error("Failed to rasterise SVG: ".concat(t.slice(0,80))))},i.src=a})};function xt(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function a(r,n,o,a){var l=n&&n.prototype instanceof u?n:u,c=Object.create(l.prototype);return Et(c,"_invoke",function(r,n,o){var a,u,l,c=0,s=o||[],f=!1,h={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,r){return a=e,u=0,l=t,h.n=r,i}};function p(r,n){for(u=r,l=n,e=0;!f&&c&&!o&&e<s.length;e++){var o,a=s[e],p=h.p,y=a[2];r>3?(o=y===n)&&(l=a[(u=a[4])?5:(u=3,3)],a[4]=a[5]=t):a[0]<=p&&((o=r<2&&p<a[1])?(u=0,h.v=n,h.n=a[1]):p<y&&(o=r<3||a[0]>n||n>y)&&(a[4]=r,a[5]=n,h.n=y,u=0))}if(o||r>1)return i;throw f=!0,n}return function(o,s,y){if(c>1)throw TypeError("Generator is already running");for(f&&1===s&&p(s,y),u=s,l=y;(e=u<2?t:l)||!f;){a||(u?u<3?(u>1&&(h.n=-1),p(u,l)):h.n=l:h.v=l);try{if(c=2,a){if(u||(o="next"),e=a[o]){if(!(e=e.call(a,l)))throw TypeError("iterator result is not an object");if(!e.done)return e;l=e.value,u<2&&(u=0)}else 1===u&&(e=a.return)&&e.call(a),u<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),u=1);a=t}else if((e=(f=h.n<0)?l:r.call(n,h))!==i)break}catch(e){a=t,u=1,l=e}finally{c=1}}return{value:e,done:f}}}(r,o,a),!0),c}var i={};function u(){}function l(){}function c(){}e=Object.getPrototypeOf;var s=[][n]?e(e([][n]())):(Et(e={},n,function(){return this}),e),f=c.prototype=u.prototype=Object.create(s);function h(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,Et(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return l.prototype=c,Et(f,"constructor",c),Et(c,"constructor",l),l.displayName="GeneratorFunction",Et(c,o,"GeneratorFunction"),Et(f),Et(f,o,"Generator"),Et(f,n,function(){return this}),Et(f,"toString",function(){return"[object Generator]"}),(xt=function(){return{w:a,m:h}})()}function Et(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}Et=function(t,e,r,n){function a(e,r){Et(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(a("next",0),a("throw",1),a("return",2))},Et(t,e,r,n)}function jt(t,e,r,n,o,a,i){try{var u=t[a](i),l=u.value}catch(t){return void r(t)}u.done?e(l):Promise.resolve(l).then(n,o)}function Nt(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var a=t.apply(e,r);function i(t){jt(a,n,o,i,u,"next",t)}function u(t){jt(a,n,o,i,u,"throw",t)}i(void 0)})}}var At=new Map,Tt=function(){var t=Nt(xt().m(function t(e,r,n,o){var a,i,u,l,c,s,f,h,p,y;return xt().w(function(t){for(;;)switch(t.n){case 0:if(a=n.getPatternInnerContent(e)){t.n=1;break}return t.a(2,null);case 1:if(i=n.getPatternImageId(e,r,o)){t.n=2;break}return t.a(2,null);case 2:if(u=At.get(i)){t.n=4;break}return l=Pt(e.fillPatternForegroundColor,r)||"black",c=Pt(e.fillPatternBackgroundColor,r)||"transparent",s=wt(a,l,c),f='<rect width="16" height="16" fill="'.concat(c,'"/>'),h=Mt(o),p=Math.round(8*h),y='<svg xmlns="http://www.w3.org/2000/svg" width="'.concat(p,'" height="').concat(p,'" viewBox="0 0 16 16">').concat(f).concat(s,"</svg>"),t.n=3,Ot(y,p,p);case 3:u=t.v,At.set(i,u);case 4:return t.a(2,{imageId:i,imageData:u})}},t)}));return function(e,r,n,o){return t.apply(this,arguments)}}(),It=function(){var t=Nt(xt().m(function t(e,r,n,o,a){var i,u;return xt().w(function(t){for(;;)switch(t.n){case 0:if(r.length){t.n=1;break}return t.a(2);case 1:return i=Mt(a),u=r.reduce(function(t,r){var u=o.getPatternImageId(r,n,a);return!u||t[u]||e.hasImage(u)||(t[u]=Nt(xt().m(function t(){var u;return xt().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,Tt(r,n,o,a);case 1:(u=t.v)&&!e.hasImage(u.imageId)&&e.addImage(u.imageId,u.imageData,{pixelRatio:i});case 2:return t.a(2)}},t)}))),t},{}),t.n=2,Promise.all(Object.values(u).map(function(t){return t()}));case 2:return t.a(2)}},t)}));return function(e,r,n,o,a){return t.apply(this,arguments)}}();function Lt(t){return Lt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lt(t)}var kt=["container","padding","mapStyle","mapSize","center","zoom","bounds","pixelRatio"];function Rt(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function a(r,n,o,a){var l=n&&n.prototype instanceof u?n:u,c=Object.create(l.prototype);return _t(c,"_invoke",function(r,n,o){var a,u,l,c=0,s=o||[],f=!1,h={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,r){return a=e,u=0,l=t,h.n=r,i}};function p(r,n){for(u=r,l=n,e=0;!f&&c&&!o&&e<s.length;e++){var o,a=s[e],p=h.p,y=a[2];r>3?(o=y===n)&&(l=a[(u=a[4])?5:(u=3,3)],a[4]=a[5]=t):a[0]<=p&&((o=r<2&&p<a[1])?(u=0,h.v=n,h.n=a[1]):p<y&&(o=r<3||a[0]>n||n>y)&&(a[4]=r,a[5]=n,h.n=y,u=0))}if(o||r>1)return i;throw f=!0,n}return function(o,s,y){if(c>1)throw TypeError("Generator is already running");for(f&&1===s&&p(s,y),u=s,l=y;(e=u<2?t:l)||!f;){a||(u?u<3?(u>1&&(h.n=-1),p(u,l)):h.n=l:h.v=l);try{if(c=2,a){if(u||(o="next"),e=a[o]){if(!(e=e.call(a,l)))throw TypeError("iterator result is not an object");if(!e.done)return e;l=e.value,u<2&&(u=0)}else 1===u&&(e=a.return)&&e.call(a),u<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),u=1);a=t}else if((e=(f=h.n<0)?l:r.call(n,h))!==i)break}catch(e){a=t,u=1,l=e}finally{c=1}}return{value:e,done:f}}}(r,o,a),!0),c}var i={};function u(){}function l(){}function c(){}e=Object.getPrototypeOf;var s=[][n]?e(e([][n]())):(_t(e={},n,function(){return this}),e),f=c.prototype=u.prototype=Object.create(s);function h(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,_t(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return l.prototype=c,_t(f,"constructor",c),_t(c,"constructor",l),l.displayName="GeneratorFunction",_t(c,o,"GeneratorFunction"),_t(f),_t(f,o,"Generator"),_t(f,n,function(){return this}),_t(f,"toString",function(){return"[object Generator]"}),(Rt=function(){return{w:a,m:h}})()}function _t(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}_t=function(t,e,r,n){function a(e,r){_t(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(a("next",0),a("throw",1),a("return",2))},_t(t,e,r,n)}function Ct(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function Dt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ct(Object(r),!0).forEach(function(e){Ft(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ct(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function Ft(t,e,r){return(e=Wt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Bt(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)r=a[n],-1===e.indexOf(r)&&{}.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function Gt(t,e,r,n,o,a,i){try{var u=t[a](i),l=u.value}catch(t){return void r(t)}u.done?e(l):Promise.resolve(l).then(n,o)}function $t(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var a=t.apply(e,r);function i(t){Gt(a,n,o,i,u,"next",t)}function u(t){Gt(a,n,o,i,u,"throw",t)}i(void 0)})}}function zt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Wt(n.key),n)}}function Wt(t){var e=function(t){if("object"!=Lt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Lt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Lt(e)?e:e+""}function qt(t,e,r){return e=Ht(e),function(t,e){if(e&&("object"==Lt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Zt()?Reflect.construct(e,r||[],Ht(t).constructor):e.apply(t,r))}function Zt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Zt=function(){return!!t})()}function Ht(t){return Ht=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ht(t)}function Ut(t,e){return Ut=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ut(t,e)}var Vt=function(t){function e(t){var r,n=t.mapFramework,o=t.mapProviderConfig,a=void 0===o?{}:o,i=t.events,u=t.eventBus;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=qt(this,e)).maplibreModule=n,r.events=i,r.eventBus=u,r.capabilities={supportedShortcuts:l,supportsMapSizes:!0},Object.assign(r,a),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ut(t,e)}(e,t),r=e,n=[{key:"name",get:function(){return"MapLibreProvider"}},{key:"initMap",value:(i=$t(Rt().m(function t(e){var r,n,o,a,i,u,l,f,h,d,v,g,m,b=this;return Rt().w(function(t){for(;;)switch(t.n){case 0:r=e.container,n=e.padding,o=e.mapStyle,a=e.mapSize,i=e.center,u=e.zoom,l=e.bounds,f=e.pixelRatio,h=Bt(e,kt),this.mapStyleId=null==o?void 0:o.id,this.mapSize=a,d=this.maplibreModule.Map,v=this.events,g=this.eventBus,(m=new d(Dt(Dt({},h),{},{container:r,style:null==o?void 0:o.url,pixelRatio:f,padding:n,center:i,zoom:u,fadeDuration:0,attributionControl:!1,dragRotate:!1,doubleClickZoom:!1}))).touchZoomRotate.disableRotation(),this.map=m,this.map.setPadding(n),l&&m.fitBounds(l,{duration:0}),s(m),c(m),p({map:m,events:v,eventBus:g,getCenter:this.getCenter.bind(this),getZoom:this.getZoom.bind(this),getBounds:this.getBounds.bind(this),getResolution:this.getResolution.bind(this)}),y({mapProvider:this,map:m,events:v,eventBus:g}),m.on("load",function(){b.labelNavigator=z(m,null==o?void 0:o.mapColorScheme,v,g)}),this.eventBus.emit(v.MAP_READY,{map:this.map,mapStyleId:this.mapStyleId,mapSize:this.mapSize,crs:this.crs});case 1:return t.a(2)}},t,this)})),function(t){return i.apply(this,arguments)})},{key:"isBaseMapReady",value:function(){var t;return Boolean(null===(t=this.map)||void 0===t?void 0:t.getStyle())}},{key:"destroyMap",value:function(){var t,e;this.setHoverCursor([]),null===(t=this.mapEvents)||void 0===t||t.remove(),null===(e=this.appEvents)||void 0===e||e.remove(),this.mapEvents=null,this.appEvents=null,this.map.remove()}},{key:"setHoverCursor",value:function(t){this.map&&(this._onHoverMove=yt(this.map,t,this._onHoverMove))}},{key:"setView",value:function(t){var e=t.center,r=t.zoom;this.map.flyTo({center:e||this.getCenter(),zoom:r||this.getZoom(),duration:this.map.isStyleLoaded()?u:0})}},{key:"zoomIn",value:function(t){this.map.easeTo({zoom:this.getZoom()+t,duration:u})}},{key:"zoomOut",value:function(t){this.map.easeTo({zoom:this.getZoom()-t,duration:u})}},{key:"panBy",value:function(t){this.map.panBy(t,{duration:u})}},{key:"fitToBounds",value:function(t){var e=Array.isArray(t)?t:N(t),r=this.map.isStyleLoaded()?u:0;this.map.fitBounds(e,{duration:r})}},{key:"setPadding",value:function(t){this.map.setPadding(t)}},{key:"updateHighlightedFeatures",value:function(t,e,r){return function(t){var e=t.LngLatBounds,r=t.map,n=t.selectedFeatures,o=t.activeFeatures,a=t.stylesMap;if(!r)return null;null!=o&&o.length?(lt(r,o,a,X,et),lt(r,o,a,Q,rt)):(at(r,X),at(r,Q));var i={};null!=n&&n.length?i=lt(r,n,a,tt,rt):at(r,tt);var u=[];return Object.entries(i).forEach(function(t){var e=Z(t,2),n=e[0],o=e[1],a=o.ids,i=o.idProperty;u.push.apply(u,function(t){return function(t){if(Array.isArray(t))return U(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||H(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(r.queryRenderedFeatures({layers:[n]}).filter(function(t){var e;return a.has(i?null===(e=t.properties)||void 0===e?void 0:e[i]:t.id)})))}),function(t,e){if(!e.length)return null;var r=new t;return e.forEach(function(t){var e=function(t){return"number"==typeof t[0]?r.extend(t):t.forEach(e)};e(t.geometry.coordinates)}),[r.getWest(),r.getSouth(),r.getEast(),r.getNorth()]}(e,u)}({LngLatBounds:this.maplibreModule.LngLatBounds,map:this.map,selectedFeatures:t,activeFeatures:e,stylesMap:r})}},{key:"highlightNextLabel",value:function(t){var e;return(null===(e=this.labelNavigator)||void 0===e?void 0:e.highlightNextLabel(t))||null}},{key:"highlightLabelAtCenter",value:function(){var t;return(null===(t=this.labelNavigator)||void 0===t?void 0:t.highlightLabelAtCenter())||null}},{key:"clearHighlightedLabel",value:function(){var t;return(null===(t=this.labelNavigator)||void 0===t?void 0:t.clearHighlightedLabel())||null}},{key:"getCenter",value:function(){var t=this.map.getCenter();return[Number(t.lng.toFixed(7)),Number(t.lat.toFixed(7))]}},{key:"getZoom",value:function(){return Number(this.map.getZoom().toFixed(7))}},{key:"getBounds",value:function(){return this.map.getBounds().toArray().flat(1)}},{key:"getFeaturesAtPoint",value:function(t,e){return function(t,e){var r=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).radius,n=void 0===r?10:r,o=[[e.x-n,e.y-n],[e.x+n,e.y+n]],a=t.queryRenderedFeatures(o);if(0===a.length)return[];var i=new Set(t.queryRenderedFeatures([e.x,e.y]).map(function(t){var e,r=void 0===t.id?JSON.stringify(t.properties):t.id;return"".concat(null===(e=t.layer)||void 0===e?void 0:e.source,":").concat(r)})),u=[];a.forEach(function(t){!1===u.includes(t.layer.id)&&u.push(t.layer.id)});for(var l=new Set,c=[],s=a.length-1;s>=0;s--){var f,h=a[s],p=void 0===h.id?JSON.stringify(h.properties):h.id,y="".concat(null===(f=h.layer)||void 0===f?void 0:f.source,":").concat(p);!1===l.has(y)&&(l.add(y),c.push(h))}var d=t.unproject(e),v=[d.lng,d.lat],g=c.filter(function(t){var e=t.geometry.type;if(e.includes("Polygon"))return("Polygon"===e?[t.geometry.coordinates]:t.geometry.coordinates).some(function(t){return function(t,e){for(var r=ct(t,2),n=r[0],o=r[1],a=!1,i=0,u=e.length-1;i<e.length;u=i,i++){var l=ct(e[i],2),c=l[0],s=l[1],f=ct(e[u],2),h=f[0],p=f[1];s>o!=p>o&&n<(h-c)*(o-s)/(p-s)+c&&(a=!a)}return a}(v,t[0])});if("Point"===e||"MultiPoint"===e){var r,n=void 0===t.id?JSON.stringify(t.properties):t.id;return i.has("".concat(null===(r=t.layer)||void 0===r?void 0:r.source,":").concat(n))}return!0});return g.map(function(r){var n=0,o=r.geometry.type,a=function(t,e,r){var n=r.coordinates,o=r.type,a=1/0,i=function(e){return t.project(e)},u=function(t){for(var r=0;r<t.length-1;r++){var n=ft(e,i(t[r]),i(t[r+1]));n<a&&(a=n)}};if("Point"===o){var l=i(n);a=Math.pow(e.x-l.x,2)+Math.pow(e.y-l.y,2)}else"LineString"===o||"MultiPoint"===o?"LineString"===o?u(n):n.forEach(function(t){var r=i(t),n=Math.pow(e.x-r.x,2)+Math.pow(e.y-r.y,2);n<a&&(a=n)}):"Polygon"===o||"MultiLineString"===o?n.forEach(u):"MultiPolygon"===o&&n.forEach(function(t){return t.forEach(u)});return a}(t,e,r.geometry);return n+=1e6*u.indexOf(r.layer.id),o.includes("Polygon")&&(n-=5e5),{f:r,score:n+=a}}).sort(function(t,e){return t.score-e.score}).map(function(t){return t.f})}(this.map,t,e)}},{key:"getVisibleFeatures",value:function(t){var e=this,r=t.filter(function(t){return e.map.getLayer(t)});return r.length?this.map.queryRenderedFeatures(void 0,{layers:r}):[]}},{key:"addSymbolsToMap",value:(a=$t(Rt().m(function t(e,r,n){var o;return Rt().w(function(t){for(;;)if(0===t.n)return o=this.map.getPixelRatio()||1,t.a(2,bt(this.map,e,r,n,o))},t,this)})),function(t,e,r){return a.apply(this,arguments)})},{key:"addPatternsToMap",value:(o=$t(Rt().m(function t(e,r,n){var o;return Rt().w(function(t){for(;;)if(0===t.n)return o=this.map.getPixelRatio()||1,t.a(2,It(this.map,e,r,n,o))},t,this)})),function(t,e,r){return o.apply(this,arguments)})},{key:"getAreaDimensions",value:function(){return function(t){var e,r,n,o;if(t&&"function"==typeof t.getWest)e=t.getWest(),r=t.getSouth(),n=t.getEast(),o=t.getNorth();else{if(!Array.isArray(t)||2!==t.length)return"";var a=P(t,2),i=P(a[0],2);e=i[0],r=i[1];var u=P(a[1],2);n=u[0],o=u[1]}var l=E([e,r],[n,r]),c=E([e,r],[e,o]),s=j(l),f=j(c);return"".concat(f," by ").concat(s)}((t=this.maplibreModule.LngLatBounds,e=this.map,r=e.getContainer().getBoundingClientRect(),n=r.width,o=r.height,a=e.getPadding(),i=[a.left,o-a.bottom],u=[n-a.right,a.top],new t(e.unproject(i),e.unproject(u))));var t,e,r,n,o,a,i,u}},{key:"getCardinalMove",value:function(t,e){return function(t,e){var r=P(t,2),n=r[0],o=r[1],a=P(e,2),i=a[0],u=a[1],l=u-o,c=i-n,s=[];if(Math.abs(l)>1e-4){var f=Math.round(E([n,o],[n,u]));s.push("".concat(l>0?"north":"south"," ").concat(j(f)))}if(Math.abs(c)>1e-4){var h=Math.round(E([n,o],[i,o]));s.push("".concat(c>0?"east":"west"," ").concat(j(h)))}return s.join(", ")}(t,e)}},{key:"getResolution",value:function(){return t=this.map.getCenter(),e=this.map.getZoom(),r=t.lat,n=Math.pow(2,e),40075016.686*Math.cos(r*Math.PI/180)/(512*n);var t,e,r,n}},{key:"mapToScreen",value:function(t){return this.map.project(t)}},{key:"screenToMap",value:function(t){var e=this.map.unproject([t.x,t.y]);return[e.lng,e.lat]}},{key:"isGeometryObscured",value:function(t,e){return function(t,e,r){var n=r.getContainer().getBoundingClientRect(),o=P(N(t),4),a=o[0],i=o[1],u=o[2],l=o[3],c=[r.project([a,i]),r.project([a,l]),r.project([u,i]),r.project([u,l])],s=Math.min.apply(Math,S(c.map(function(t){return t.x}))),f=Math.max.apply(Math,S(c.map(function(t){return t.x}))),h=Math.min.apply(Math,S(c.map(function(t){return t.y}))),p=Math.max.apply(Math,S(c.map(function(t){return t.y}))),y=e.left-n.left,d=e.top-n.top,v=e.right-n.left,g=e.bottom-n.top;return s<v&&f>y&&h<g&&p>d}(t,e,this.map)}}],n&&zt(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o,a,i}(i)}}]);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
-
!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("defra",[],r):"object"==typeof exports?exports.defra=r():(e.defra=e.defra||{},e.defra.maplibreProvider=r())}(this,()=>(()=>{"use strict";var e,r,t,n,o={},i={};function a(e){var r=i[e];if(void 0!==r)return r.exports;var t=i[e]={exports:{}};return o[e].call(t.exports,t,t.exports,a),t.exports}a.m=o,r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,a.t=function(t,n){if(1&n&&(t=this(t)),8&n)return t;if("object"==typeof t&&t){if(4&n&&t.__esModule)return t;if(16&n&&"function"==typeof t.then)return t}var o=Object.create(null);a.r(o);var i={};e=e||[null,r({}),r([]),r(r)];for(var u=2&n&&t;("object"==typeof u||"function"==typeof u)&&!~e.indexOf(u);u=r(u))Object.getOwnPropertyNames(u).forEach(e=>i[e]=()=>t[e]);return i.default=()=>t,a.d(o,i),o},a.d=(e,r)=>{for(var t in r)a.o(r,t)&&!a.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce((r,t)=>(a.f[t](e,r),r),[])),a.u=e=>({649:"im-maplibre-framework",772:"im-maplibre-provider"}[e]+".js"),a.miniCssF=e=>{},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t={},n="defra.maplibreProvider:",a.l=(e,r,o,i)=>{if(t[e])t[e].push(r);else{var u,c;if(void 0!==o)for(var f=document.getElementsByTagName("script"),l=0;l<f.length;l++){var p=f[l];if(p.getAttribute("src")==e||p.getAttribute("data-webpack")==n+o){u=p;break}}u||(c=!0,(u=document.createElement("script")).charset="utf-8",a.nc&&u.setAttribute("nonce",a.nc),u.setAttribute("data-webpack",n+o),u.src=e),t[e]=[r];var s=(r,n)=>{u.onerror=u.onload=null,clearTimeout(d);var o=t[e];if(delete t[e],u.parentNode&&u.parentNode.removeChild(u),o&&o.forEach(e=>e(n)),r)return r(n)},d=setTimeout(s.bind(null,void 0,{type:"timeout",target:u}),12e4);u.onerror=s.bind(null,u.onerror),u.onload=s.bind(null,u.onload),c&&document.head.appendChild(u)}},a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;a.g.importScripts&&(e=a.g.location+"");var r=a.g.document;if(!e&&r&&(r.currentScript&&"SCRIPT"===r.currentScript.tagName.toUpperCase()&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName("script");if(t.length)for(var n=t.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=t[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e})(),(()=>{var e={57:0};a.f.j=(r,t)=>{var n=a.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else{var o=new Promise((t,o)=>n=e[r]=[t,o]);t.push(n[2]=o);var i=a.p+a.u(r),u=new Error;a.l(i,t=>{if(a.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var o=t&&("load"===t.type?"missing":t.type),i=t&&t.target&&t.target.src;u.message="Loading chunk "+r+" failed.\n("+o+": "+i+")",u.name="ChunkLoadError",u.type=o,u.request=i,n[1](u)}},"chunk-"+r,r)}};var r=(r,t)=>{var n,o,[i,u,c]=t,f=0;if(i.some(r=>0!==e[r])){for(n in u)a.o(u,n)&&(a.m[n]=u[n]);c&&c(a)}for(r&&r(t);f<i.length;f++)o=i[f],a.o(e,o)&&e[o]&&e[o][0](),e[o]=0},t=this.webpackChunkdefra_DefraMap=this.webpackChunkdefra_DefraMap||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})();var u={};function c(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}a.d(u,{default:()=>m});var f=function(e){if(!window.WebGLRenderingContext)return{isEnabled:!1,error:"WebGL is not supported"};var r,t=document.createElement("canvas"),n=!1,o=function(e,r){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,r){if(e){if("string"==typeof e)return c(e,r);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?c(e,r):void 0}}(e))||r&&e&&"number"==typeof e.length){t&&(e=t);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==t.return||t.return()}finally{if(u)throw i}}}}(e);try{for(o.s();!(r=o.n()).done;){var i=r.value;try{if((n=t.getContext(i))&&"function"==typeof n.getParameter)return{isEnabled:!0}}catch(e){}}}catch(e){o.e(e)}finally{o.f()}return{isEnabled:!1,error:"WebGL is supported, but disabled"}};function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function p(){var e,r,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function i(t,n,o,i){var c=n&&n.prototype instanceof u?n:u,f=Object.create(c.prototype);return s(f,"_invoke",function(t,n,o){var i,u,c,f=0,l=o||[],p=!1,s={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(r,t){return i=r,u=0,c=e,s.n=t,a}};function d(t,n){for(u=t,c=n,r=0;!p&&f&&!o&&r<l.length;r++){var o,i=l[r],d=s.p,b=i[2];t>3?(o=b===n)&&(c=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=t<2&&d<i[1])?(u=0,s.v=n,s.n=i[1]):d<b&&(o=t<3||i[0]>n||n>b)&&(i[4]=t,i[5]=n,s.n=b,u=0))}if(o||t>1)return a;throw p=!0,n}return function(o,l,b){if(f>1)throw TypeError("Generator is already running");for(p&&1===l&&d(l,b),u=l,c=b;(r=u<2?e:c)||!p;){i||(u?u<3?(u>1&&(s.n=-1),d(u,c)):s.n=c:s.v=c);try{if(f=2,i){if(u||(o="next"),r=i[o]){if(!(r=r.call(i,c)))throw TypeError("iterator result is not an object");if(!r.done)return r;c=r.value,u<2&&(u=0)}else 1===u&&(r=i.return)&&r.call(i),u<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=e}else if((r=(p=s.n<0)?c:t.call(n,s))!==a)break}catch(r){i=e,u=1,c=r}finally{f=1}}return{value:r,done:p}}}(t,o,i),!0),f}var a={};function u(){}function c(){}function f(){}r=Object.getPrototypeOf;var l=[][n]?r(r([][n]())):(s(r={},n,function(){return this}),r),d=f.prototype=u.prototype=Object.create(l);function b(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,s(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=f,s(d,"constructor",f),s(f,"constructor",c),c.displayName="GeneratorFunction",s(f,o,"GeneratorFunction"),s(d),s(d,o,"Generator"),s(d,n,function(){return this}),s(d,"toString",function(){return"[object Generator]"}),(p=function(){return{w:i,m:b}})()}function s(e,r,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}s=function(e,r,t,n){function i(r,t){s(e,r,function(e){return this._invoke(r,t,e)})}r?o?o(e,r,{value:t,enumerable:!n,configurable:!n,writable:!n}):e[r]=t:(i("next",0),i("throw",1),i("return",2))},s(e,r,t,n)}function d(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function b(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?d(Object(t),!0).forEach(function(r){y(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):d(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function y(e,r,t){return(r=function(e){var r=function(e){if("object"!=l(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var t=r.call(e,"string");if("object"!=l(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==l(r)?r:r+""}(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function v(e,r,t,n,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void t(e)}u.done?r(c):Promise.resolve(c).then(n,o)}function m(){var e,r,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{checkDeviceCapabilities:function(){var e=f(["webgl2","webgl1"]),r=document.documentMode;return{isSupported:e.isEnabled&&"function"==typeof"".replaceAll,error:r?"Internet Explorer is not supported":e.error}},load:(e=p().m(function e(){var r,n,o;return p().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,a.e(649).then(a.t.bind(a,443,19));case 1:return r=e.v,t.workerUrl&&r.setWorkerUrl(t.workerUrl),e.n=2,a.e(772).then(a.bind(a,
|
|
2
|
+
!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("defra",[],r):"object"==typeof exports?exports.defra=r():(e.defra=e.defra||{},e.defra.maplibreProvider=r())}(this,()=>(()=>{"use strict";var e,r,t,n,o={},i={};function a(e){var r=i[e];if(void 0!==r)return r.exports;var t=i[e]={exports:{}};return o[e].call(t.exports,t,t.exports,a),t.exports}a.m=o,r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,a.t=function(t,n){if(1&n&&(t=this(t)),8&n)return t;if("object"==typeof t&&t){if(4&n&&t.__esModule)return t;if(16&n&&"function"==typeof t.then)return t}var o=Object.create(null);a.r(o);var i={};e=e||[null,r({}),r([]),r(r)];for(var u=2&n&&t;("object"==typeof u||"function"==typeof u)&&!~e.indexOf(u);u=r(u))Object.getOwnPropertyNames(u).forEach(e=>i[e]=()=>t[e]);return i.default=()=>t,a.d(o,i),o},a.d=(e,r)=>{for(var t in r)a.o(r,t)&&!a.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce((r,t)=>(a.f[t](e,r),r),[])),a.u=e=>({649:"im-maplibre-framework",772:"im-maplibre-provider"}[e]+".js"),a.miniCssF=e=>{},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t={},n="defra.maplibreProvider:",a.l=(e,r,o,i)=>{if(t[e])t[e].push(r);else{var u,c;if(void 0!==o)for(var f=document.getElementsByTagName("script"),l=0;l<f.length;l++){var p=f[l];if(p.getAttribute("src")==e||p.getAttribute("data-webpack")==n+o){u=p;break}}u||(c=!0,(u=document.createElement("script")).charset="utf-8",a.nc&&u.setAttribute("nonce",a.nc),u.setAttribute("data-webpack",n+o),u.src=e),t[e]=[r];var s=(r,n)=>{u.onerror=u.onload=null,clearTimeout(d);var o=t[e];if(delete t[e],u.parentNode&&u.parentNode.removeChild(u),o&&o.forEach(e=>e(n)),r)return r(n)},d=setTimeout(s.bind(null,void 0,{type:"timeout",target:u}),12e4);u.onerror=s.bind(null,u.onerror),u.onload=s.bind(null,u.onload),c&&document.head.appendChild(u)}},a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;a.g.importScripts&&(e=a.g.location+"");var r=a.g.document;if(!e&&r&&(r.currentScript&&"SCRIPT"===r.currentScript.tagName.toUpperCase()&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName("script");if(t.length)for(var n=t.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=t[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e})(),(()=>{var e={57:0};a.f.j=(r,t)=>{var n=a.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else{var o=new Promise((t,o)=>n=e[r]=[t,o]);t.push(n[2]=o);var i=a.p+a.u(r),u=new Error;a.l(i,t=>{if(a.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var o=t&&("load"===t.type?"missing":t.type),i=t&&t.target&&t.target.src;u.message="Loading chunk "+r+" failed.\n("+o+": "+i+")",u.name="ChunkLoadError",u.type=o,u.request=i,n[1](u)}},"chunk-"+r,r)}};var r=(r,t)=>{var n,o,[i,u,c]=t,f=0;if(i.some(r=>0!==e[r])){for(n in u)a.o(u,n)&&(a.m[n]=u[n]);c&&c(a)}for(r&&r(t);f<i.length;f++)o=i[f],a.o(e,o)&&e[o]&&e[o][0](),e[o]=0},t=this.webpackChunkdefra_DefraMap=this.webpackChunkdefra_DefraMap||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})();var u={};function c(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}a.d(u,{default:()=>m});var f=function(e){if(!window.WebGLRenderingContext)return{isEnabled:!1,error:"WebGL is not supported"};var r,t=document.createElement("canvas"),n=!1,o=function(e,r){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,r){if(e){if("string"==typeof e)return c(e,r);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?c(e,r):void 0}}(e))||r&&e&&"number"==typeof e.length){t&&(e=t);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==t.return||t.return()}finally{if(u)throw i}}}}(e);try{for(o.s();!(r=o.n()).done;){var i=r.value;try{if((n=t.getContext(i))&&"function"==typeof n.getParameter)return{isEnabled:!0}}catch(e){}}}catch(e){o.e(e)}finally{o.f()}return{isEnabled:!1,error:"WebGL is supported, but disabled"}};function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function p(){var e,r,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function i(t,n,o,i){var c=n&&n.prototype instanceof u?n:u,f=Object.create(c.prototype);return s(f,"_invoke",function(t,n,o){var i,u,c,f=0,l=o||[],p=!1,s={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(r,t){return i=r,u=0,c=e,s.n=t,a}};function d(t,n){for(u=t,c=n,r=0;!p&&f&&!o&&r<l.length;r++){var o,i=l[r],d=s.p,b=i[2];t>3?(o=b===n)&&(c=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=t<2&&d<i[1])?(u=0,s.v=n,s.n=i[1]):d<b&&(o=t<3||i[0]>n||n>b)&&(i[4]=t,i[5]=n,s.n=b,u=0))}if(o||t>1)return a;throw p=!0,n}return function(o,l,b){if(f>1)throw TypeError("Generator is already running");for(p&&1===l&&d(l,b),u=l,c=b;(r=u<2?e:c)||!p;){i||(u?u<3?(u>1&&(s.n=-1),d(u,c)):s.n=c:s.v=c);try{if(f=2,i){if(u||(o="next"),r=i[o]){if(!(r=r.call(i,c)))throw TypeError("iterator result is not an object");if(!r.done)return r;c=r.value,u<2&&(u=0)}else 1===u&&(r=i.return)&&r.call(i),u<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=e}else if((r=(p=s.n<0)?c:t.call(n,s))!==a)break}catch(r){i=e,u=1,c=r}finally{f=1}}return{value:r,done:p}}}(t,o,i),!0),f}var a={};function u(){}function c(){}function f(){}r=Object.getPrototypeOf;var l=[][n]?r(r([][n]())):(s(r={},n,function(){return this}),r),d=f.prototype=u.prototype=Object.create(l);function b(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,s(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=f,s(d,"constructor",f),s(f,"constructor",c),c.displayName="GeneratorFunction",s(f,o,"GeneratorFunction"),s(d),s(d,o,"Generator"),s(d,n,function(){return this}),s(d,"toString",function(){return"[object Generator]"}),(p=function(){return{w:i,m:b}})()}function s(e,r,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}s=function(e,r,t,n){function i(r,t){s(e,r,function(e){return this._invoke(r,t,e)})}r?o?o(e,r,{value:t,enumerable:!n,configurable:!n,writable:!n}):e[r]=t:(i("next",0),i("throw",1),i("return",2))},s(e,r,t,n)}function d(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function b(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?d(Object(t),!0).forEach(function(r){y(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):d(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function y(e,r,t){return(r=function(e){var r=function(e){if("object"!=l(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var t=r.call(e,"string");if("object"!=l(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==l(r)?r:r+""}(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function v(e,r,t,n,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void t(e)}u.done?r(c):Promise.resolve(c).then(n,o)}function m(){var e,r,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{checkDeviceCapabilities:function(){var e=f(["webgl2","webgl1"]),r=document.documentMode;return{isSupported:e.isEnabled&&"function"==typeof"".replaceAll,error:r?"Internet Explorer is not supported":e.error}},load:(e=p().m(function e(){var r,n,o;return p().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,a.e(649).then(a.t.bind(a,443,19));case 1:return r=e.v,t.workerUrl&&r.setWorkerUrl(t.workerUrl),e.n=2,a.e(772).then(a.bind(a,808));case 2:return n=e.v.default,o=b(b({},t),{},{crs:"EPSG:4326"}),e.a(2,{MapProvider:n,mapProviderConfig:o,mapFramework:r})}},e)}),r=function(){var r=this,t=arguments;return new Promise(function(n,o){var i=e.apply(r,t);function a(e){v(i,n,o,a,u,"next",e)}function u(e){v(i,n,o,a,u,"throw",e)}a(void 0)})},function(){return r.apply(this,arguments)})}}return u.default})());
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { DEFAULTS, supportedShortcuts } from './defaults.js'
|
|
2
|
+
|
|
3
|
+
describe('DEFAULTS', () => {
|
|
4
|
+
it('keeps animationDuration below the 500ms core debounce time', () => {
|
|
5
|
+
expect(DEFAULTS.animationDuration).toBeLessThan(500)
|
|
6
|
+
})
|
|
7
|
+
|
|
8
|
+
it('exposes coordinatePrecision', () => {
|
|
9
|
+
expect(DEFAULTS.coordinatePrecision).toBe(7)
|
|
10
|
+
})
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
describe('supportedShortcuts', () => {
|
|
14
|
+
it('lists the keyboard shortcuts this provider supports', () => {
|
|
15
|
+
expect(supportedShortcuts).toEqual([
|
|
16
|
+
'showKeyboardHelp',
|
|
17
|
+
'selectControl',
|
|
18
|
+
'moveLarge',
|
|
19
|
+
'nudgeMap',
|
|
20
|
+
'zoomLarge',
|
|
21
|
+
'nudgeZoom',
|
|
22
|
+
'highlightLabelAtCenter',
|
|
23
|
+
'highlightNextLabel'
|
|
24
|
+
])
|
|
25
|
+
})
|
|
26
|
+
})
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { spatialNavigate } from '
|
|
1
|
+
import { spatialNavigate } from '../../../../src/utils/spatialNavigate.js'
|
|
2
2
|
import { calculateLinearTextSize } from './calculateLinearTextSize.js'
|
|
3
3
|
|
|
4
4
|
const HIGHLIGHT_SCALE_FACTOR = 1.5
|
|
@@ -166,7 +166,7 @@ export function navigateToNextLabel (direction, state) {
|
|
|
166
166
|
return null
|
|
167
167
|
}
|
|
168
168
|
const pixelArray = filtered.map(l => l.pixel)
|
|
169
|
-
let nextFilteredIndex = spatialNavigate(
|
|
169
|
+
let nextFilteredIndex = spatialNavigate([state.currentPixel.x, state.currentPixel.y], pixelArray, direction)
|
|
170
170
|
if (nextFilteredIndex == null || nextFilteredIndex < 0 || nextFilteredIndex >= filtered.length) {
|
|
171
171
|
nextFilteredIndex = 0
|
|
172
172
|
}
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
navigateToNextLabel, createMapLabelNavigator
|
|
6
6
|
} from './labels.js'
|
|
7
7
|
|
|
8
|
-
import { spatialNavigate } from '
|
|
8
|
+
import { spatialNavigate } from '../../../../src/utils/spatialNavigate.js'
|
|
9
9
|
import { calculateLinearTextSize } from './calculateLinearTextSize.js'
|
|
10
10
|
|
|
11
|
-
jest.mock('
|
|
11
|
+
jest.mock('../../../../src/utils/spatialNavigate.js', () => ({ spatialNavigate: jest.fn() }))
|
|
12
12
|
jest.mock('./calculateLinearTextSize.js', () => ({ calculateLinearTextSize: jest.fn(() => 12) }))
|
|
13
13
|
|
|
14
14
|
describe('labels utils', () => {
|
|
@@ -183,7 +183,7 @@ describe('labels utils', () => {
|
|
|
183
183
|
expect(nav.highlightNextLabel('ArrowRight')).toBeNull()
|
|
184
184
|
|
|
185
185
|
// Zoom handler: no active highlight → no-op
|
|
186
|
-
const zoomHandler = map.on.mock.calls.find(([
|
|
186
|
+
const zoomHandler = map.on.mock.calls.find(([eventName]) => eventName === 'zoom')[1]
|
|
187
187
|
map.setLayoutProperty.mockClear()
|
|
188
188
|
zoomHandler()
|
|
189
189
|
expect(map.setLayoutProperty).not.toHaveBeenCalled()
|
|
@@ -222,10 +222,10 @@ describe('labels utils', () => {
|
|
|
222
222
|
// Fire MAP_SET_STYLE → styledata → idle → setLineCenterPlacement + initLabelSource
|
|
223
223
|
const styleHandler = eventBus.on.mock.calls[0][1]
|
|
224
224
|
styleHandler({ mapColorScheme: 'dark' })
|
|
225
|
-
const styleDataHandler = map.once.mock.calls.find(([
|
|
225
|
+
const styleDataHandler = map.once.mock.calls.find(([eventName]) => eventName === 'styledata')[1]
|
|
226
226
|
styleDataHandler()
|
|
227
227
|
map.setLayoutProperty.mockClear()
|
|
228
|
-
const idleHandler = map.once.mock.calls.find(([
|
|
228
|
+
const idleHandler = map.once.mock.calls.find(([eventName]) => eventName === 'idle')[1]
|
|
229
229
|
idleHandler()
|
|
230
230
|
expect(map.setLayoutProperty).toHaveBeenCalledWith('s1', 'symbol-placement', 'line-center')
|
|
231
231
|
})
|
|
@@ -106,62 +106,6 @@ const getCardinalMove = (from, to) => {
|
|
|
106
106
|
return moves.join(', ')
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
/**
|
|
110
|
-
* Find the index of the nearest pixel in a given cardinal direction.
|
|
111
|
-
*
|
|
112
|
-
* The function:
|
|
113
|
-
* - Filters candidate points that lie in the specified direction
|
|
114
|
-
* (up, down, left, right) relative to a start pixel.
|
|
115
|
-
* - Selects the nearest valid candidate using Euclidean distance.
|
|
116
|
-
* - Falls back to returning the start pixel index if no candidate exists.
|
|
117
|
-
*
|
|
118
|
-
* Example:
|
|
119
|
-
* spatialNavigate('up', [100, 200], [[100, 100], [150, 250], [90, 180]])
|
|
120
|
-
* → returns the index of [100, 100]
|
|
121
|
-
*
|
|
122
|
-
* @param {'ArrowUp'|'ArrowDown'|'ArrowLeft'|'ArrowRight'} direction - The direction to search.
|
|
123
|
-
* @param {[number, number]} start - The starting pixel coordinate [x, y].
|
|
124
|
-
* @param {Array<[number, number]>} pixels - Array of pixel coordinates.
|
|
125
|
-
* @returns {number} Index of the closest pixel in the given direction.
|
|
126
|
-
*/
|
|
127
|
-
const isInDirection = (direction, dx, dy) => {
|
|
128
|
-
switch (direction) {
|
|
129
|
-
case 'ArrowUp': return dy < 0 && Math.abs(dy) >= Math.abs(dx)
|
|
130
|
-
case 'ArrowDown': return dy > 0 && Math.abs(dy) >= Math.abs(dx)
|
|
131
|
-
case 'ArrowLeft': return dx < 0 && Math.abs(dx) > Math.abs(dy)
|
|
132
|
-
case 'ArrowRight': return dx > 0 && Math.abs(dx) > Math.abs(dy)
|
|
133
|
-
default: return false
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
const spatialNavigate = (direction, start, pixels) => {
|
|
138
|
-
const [sx, sy] = start
|
|
139
|
-
|
|
140
|
-
// Direction filters
|
|
141
|
-
const candidates = pixels.filter(([x, y]) =>
|
|
142
|
-
(x !== sx || y !== sy) && isInDirection(direction, x - sx, y - sy)
|
|
143
|
-
)
|
|
144
|
-
|
|
145
|
-
if (!candidates.length) {
|
|
146
|
-
return pixels.findIndex(p => p[0] === sx && p[1] === sy)
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
// Choose the closest by Euclidean distance
|
|
150
|
-
let closestIndex = -1
|
|
151
|
-
let minDist = Infinity
|
|
152
|
-
candidates.forEach(c => {
|
|
153
|
-
const dx = c[0] - sx
|
|
154
|
-
const dy = c[1] - sy
|
|
155
|
-
const dist = dx * dx + dy * dy // squared distance is enough
|
|
156
|
-
if (dist < minDist) {
|
|
157
|
-
minDist = dist
|
|
158
|
-
closestIndex = pixels.indexOf(c)
|
|
159
|
-
}
|
|
160
|
-
})
|
|
161
|
-
|
|
162
|
-
return closestIndex
|
|
163
|
-
}
|
|
164
|
-
|
|
165
109
|
const getResolution = (center, zoom) => {
|
|
166
110
|
const EARTH_CIRCUMFERENCE = 40075016.686
|
|
167
111
|
const TILE_SIZE = 512
|
|
@@ -239,7 +183,6 @@ export {
|
|
|
239
183
|
getCardinalMove,
|
|
240
184
|
getBboxFromGeoJSON,
|
|
241
185
|
isGeometryObscured,
|
|
242
|
-
spatialNavigate,
|
|
243
186
|
getResolution,
|
|
244
187
|
getPaddedBounds,
|
|
245
188
|
formatDimension
|
|
@@ -50,33 +50,6 @@ describe('spatial utils', () => {
|
|
|
50
50
|
expect(spatial.getCardinalMove([0, 0], [0.00001, 0.00001])).toBe('')
|
|
51
51
|
})
|
|
52
52
|
|
|
53
|
-
test('spatialNavigate all directions and fallback', () => {
|
|
54
|
-
const pixels = [[0, 0], [0, -1], [1, 0], [0, 1], [-1, 0]]
|
|
55
|
-
expect(spatial.spatialNavigate('ArrowUp', [0, 0], pixels)).toBe(1)
|
|
56
|
-
expect(spatial.spatialNavigate('ArrowDown', [0, 0], pixels)).toBe(3)
|
|
57
|
-
expect(spatial.spatialNavigate('ArrowLeft', [0, 0], pixels)).toBe(4)
|
|
58
|
-
expect(spatial.spatialNavigate('ArrowRight', [0, 0], pixels)).toBe(2)
|
|
59
|
-
expect(spatial.spatialNavigate('InvalidDir', [0, 0], pixels)).toBe(0)
|
|
60
|
-
})
|
|
61
|
-
|
|
62
|
-
test('spatialNavigate finds closer candidates (hits dist < minDist)', () => {
|
|
63
|
-
const start = [0, 0]
|
|
64
|
-
const pixels = [[0, 0], [10, 0], [2, 0]]
|
|
65
|
-
expect(spatial.spatialNavigate('ArrowRight', start, pixels)).toBe(2)
|
|
66
|
-
})
|
|
67
|
-
|
|
68
|
-
test('spatialNavigate skips farther candidate (dist >= minDist false branch)', () => {
|
|
69
|
-
// Closer candidate first → second candidate fails dist < minDist
|
|
70
|
-
const pixels = [[0, 0], [2, 0], [10, 0]]
|
|
71
|
-
expect(spatial.spatialNavigate('ArrowRight', [0, 0], pixels)).toBe(1)
|
|
72
|
-
})
|
|
73
|
-
|
|
74
|
-
test('spatialNavigate diagonal with dx>dy', () => {
|
|
75
|
-
const start = [0, 0]
|
|
76
|
-
const pixels = [[0, 0], [3, 1], [1, 0]] // dx>dy
|
|
77
|
-
expect(spatial.spatialNavigate('ArrowRight', start, pixels)).toBe(2)
|
|
78
|
-
})
|
|
79
|
-
|
|
80
53
|
test('getResolution returns positive value', () => {
|
|
81
54
|
expect(spatial.getResolution({ lat: 0 }, 1)).toBeGreaterThan(0)
|
|
82
55
|
})
|
package/rollup.esm.mjs
CHANGED
|
@@ -166,7 +166,8 @@ const createESMConfig = (entryPath, outDir, isCore = false, manualChunks = null,
|
|
|
166
166
|
// (rootDir) → "css/index.css" — no ".." in the emitted fileName.
|
|
167
167
|
postcss({
|
|
168
168
|
extract: path.resolve(cssDir, 'index.css'),
|
|
169
|
-
use: ['sass']
|
|
169
|
+
use: ['sass'],
|
|
170
|
+
minimize: true
|
|
170
171
|
}),
|
|
171
172
|
|
|
172
173
|
terser(),
|