@defra/interactive-map 0.0.59-alpha → 0.0.60-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 +2 -2
- package/assets/templates/add-symbols.njk +2 -2
- 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/panel-definition.md +30 -0
- package/docs/api/symbol-config.md +12 -0
- package/docs/api.md +21 -2
- package/docs/assets/images/slot-map.svg +3 -3
- package/docs/plugins/datasets.md +11 -1
- package/package.json +1 -1
- package/plugins/datasets/dist/esm/index.js +1 -1
- package/plugins/datasets/dist/esm/layerAdapter.js +1 -1
- package/plugins/datasets/dist/umd/im-datasets-ml-adapter.js +1 -1
- package/plugins/datasets/dist/umd/im-datasets-ol-adapter.js +1 -1
- package/plugins/datasets/dist/umd/im-datasets-plugin.js +1 -1
- package/plugins/datasets/dist/umd/index.js +1 -1
- package/plugins/datasets/src/index.js +0 -1
- package/plugins/datasets/src/index.test.js +2 -8
- package/plugins/datasets/src/registry/dataset.test.js +9 -0
- 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/interact/dist/esm/im-interact-plugin.js +1 -1
- package/plugins/interact/dist/umd/im-interact-plugin.js +1 -1
- 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/search/dist/css/index.css +1 -1
- package/plugins/search/src/components/Form/Form.module.scss +1 -0
- package/providers/esri/dist/esm/im-esri-provider.js +1 -1
- package/providers/esri/src/esriProvider.js +10 -21
- package/providers/esri/src/utils/coords.js +37 -7
- package/providers/esri/src/utils/coords.test.js +22 -1
- package/providers/esri/src/utils/spatial.js +1 -47
- 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/src/maplibreProvider.js +5 -14
- package/providers/maplibre/src/maplibreProvider.test.js +143 -146
- package/providers/maplibre/src/utils/spatial.js +0 -40
- package/providers/maplibre/src/utils/spatial.test.js +0 -35
- package/providers/openlayers/dist/esm/im-openlayers-provider.js +1 -1
- package/providers/openlayers/dist/umd/im-openlayers-provider.js +1 -1
- package/providers/openlayers/src/openlayersProvider.js +5 -14
- package/providers/openlayers/src/openlayersProvider.test.js +12 -10
- package/providers/openlayers/src/utils/spatial.js +0 -39
- package/providers/openlayers/src/utils/spatial.test.js +1 -26
- package/src/App/components/Hints/Hints.jsx +9 -21
- package/src/App/components/Hints/Hints.test.jsx +20 -33
- package/src/App/components/Panel/Panel.jsx +16 -1
- package/src/App/components/Panel/Panel.test.jsx +44 -0
- package/src/App/hooks/useCrossHairAPI.js +27 -28
- package/src/App/hooks/useCrossHairAPI.test.js +64 -7
- package/src/App/hooks/useLayoutMeasurements.js +175 -131
- package/src/App/hooks/useLayoutMeasurements.test.js +227 -122
- package/src/App/hooks/useMapProviderOverrides.js +114 -35
- package/src/App/hooks/useMapProviderOverrides.test.js +188 -5
- package/src/App/hooks/useModalPanelBehaviour.js +18 -32
- package/src/App/hooks/useModalPanelBehaviour.test.js +45 -33
- package/src/App/hooks/useVisibleGeometry.js +35 -45
- package/src/App/hooks/useVisibleGeometry.test.js +149 -121
- package/src/App/layout/Layout.jsx +4 -4
- package/src/App/layout/layout.module.scss +124 -61
- package/src/App/store/AppProvider.jsx +3 -0
- package/src/App/store/appDispatchMiddleware.js +18 -10
- package/src/App/store/appDispatchMiddleware.test.js +42 -4
- package/src/InteractiveMap/InteractiveMap.js +3 -2
- package/src/InteractiveMap/InteractiveMap.test.js +2 -2
- package/src/config/events.js +1 -1
- package/src/config/mapPanelSlots.js +8 -0
- package/src/config/symbolConfig.js +1 -1
- package/src/services/symbolRegistry.js +1 -1
- package/src/services/symbolRegistry.test.js +19 -0
- package/src/types.js +29 -8
- package/src/utils/getFitMove.js +73 -0
- package/src/utils/getFitMove.test.js +114 -0
- package/src/utils/getSafeZoneInset.js +122 -77
- package/src/utils/getSafeZoneInset.test.js +241 -54
- package/src/utils/getValueForStyle.js +10 -5
- package/src/utils/getValueForStyle.test.js +13 -2
- package/src/utils/renderedBoxes.js +25 -0
- package/src/utils/renderedBoxes.test.js +61 -0
- package/src/utils/screenBox.js +70 -0
- package/src/utils/screenBox.test.js +69 -0
- package/src/utils/symbolUtils.js +9 -9
- package/src/utils/symbolUtils.test.js +21 -0
- package/providers/esri/src/utils/spatial.test.js +0 -58
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see im-maplibre-provider.js.LICENSE.txt */
|
|
2
|
-
"use strict";(Object("undefined"!=typeof self?self:this).webpackChunkdefra_DefraMap=Object("undefined"!=typeof self?self:this).webpackChunkdefra_DefraMap||[]).push([[772],{988:function(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,i(n.key),n)}}function i(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:function(){return ae}});var a=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:"_notImplemented",value:function(t){throw new Error("".concat(this.name," must implement ").concat(t,"()"))}},{key:"isBaseMapReady",value:function(){this._notImplemented("isBaseMapReady")}},{key:"addSymbolsToMap",value:function(){this._notImplemented("addSymbolsToMap")}},{key:"addPatternsToMap",value:function(){this._notImplemented("addPatternsToMap")}},{key:"getActiveSymbolImageId",value:function(){this._notImplemented("getActiveSymbolImageId")}},{key:"getSelectedSymbolImageId",value:function(){this._notImplemented("getSelectedSymbolImageId")}}])&&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 f(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 s=function(t,e){var r=null,n=function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];clearTimeout(r),r=setTimeout(function(){t.apply(void 0,o)},e)};return n.cancel=function(){r&&(clearTimeout(r),r=null)},n};function y(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,i=t.getZoom,a=t.getBounds,u=t.getResolution,l=[],c=[],f=function(){var t=i();return{center:o(),bounds:a(),resolution:u(),zoom:t,isAtMaxZoom:e.getMaxZoom()<=t,isAtMinZoom:e.getMinZoom()>=t}},p=function(t,e){return n.emit(t,e)},v=function(){return p(r.MAP_LOADED)};e.on("load",v),l.push(["load",v]),e.once("idle",function(){return p(r.MAP_FIRST_IDLE,f())});var h=function(){return p(r.MAP_MOVE_START)};e.on("movestart",h),l.push(["movestart",h]);var d=s(function(){p(r.MAP_MOVE_END,f())},500);e.on("moveend",d),l.push(["moveend",d]);var m,g,b=(m=function(){p(r.MAP_MOVE,f())},g=0,function(){var t=Date.now();t-g>=10&&(g=t,m.apply(void 0,arguments))});e.on("zoom",b),l.push(["zoom",b]);var S=function(){return p(r.MAP_RENDER)};e.on("render",S),l.push(["render",S]);var w=s(function(){p(r.MAP_DATA_CHANGE,f())},500),P=function(t){t.isSourceLoaded&&w()};e.on("styledata",w),e.on("sourcedata",P),l.push(["styledata",w],["sourcedata",P]);var I=function(){return p(r.MAP_STYLE_CHANGE)};e.on("style.load",I),l.push(["style.load",I]);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(d,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,i,a,u=[],l=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.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&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}(r,n)||function(t,e){if(t){if("string"==typeof t)return y(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)?y(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.")}()),i=o[0],a=o[1];return e.off(i,a)})}}}function v(t){var e=t.mapProvider,r=t.map,n=t.events,o=t.eventBus,i=function(t){r.once("style.load",function(){o.emit(n.MAP_STYLE_CHANGE,{mapStyleId:t.id})}),r.setStyle(t.url,{diff:!1})},a=function(t){r.setPixelRatio(t)},u=function(t){var r=t.mapSize;e.mapSize=r};return o.on(n.MAP_SET_STYLE,i),o.on(n.MAP_SET_PIXEL_RATIO,a),o.on(n.MAP_SIZE_CHANGE,u),{remove:function(){o.off(n.MAP_SET_STYLE,i),o.off(n.MAP_SET_PIXEL_RATIO,a),o.off(n.MAP_SIZE_CHANGE,u)}}}function h(t,e,r){if(null!==t)for(var n,o,i,a,u,l,c,f,s=0,y=0,p=t.type,v="FeatureCollection"===p,d="Feature"===p,m=v?t.features.length:1,g=0;g<m;g++){u=(f=!!(c=v?t.features[g].geometry:d?t.geometry:t)&&"GeometryCollection"===c.type)?c.geometries.length:1;for(var b=0;b<u;b++){var S=0,w=0;if(null!==(a=f?c.geometries[b]:c)){l=a.coordinates;var P=a.type;switch(s=!r||"Polygon"!==P&&"MultiPolygon"!==P?0:1,P){case null:break;case"Point":if(!1===e(l,y,g,S,w))return!1;y++,S++;break;case"LineString":case"MultiPoint":for(n=0;n<l.length;n++){if(!1===e(l[n],y,g,S,w))return!1;y++,"MultiPoint"===P&&S++}"LineString"===P&&S++;break;case"Polygon":case"MultiLineString":for(n=0;n<l.length;n++){for(o=0;o<l[n].length-s;o++){if(!1===e(l[n][o],y,g,S,w))return!1;y++}"MultiLineString"===P&&S++,"Polygon"===P&&w++}"Polygon"===P&&S++;break;case"MultiPolygon":for(n=0;n<l.length;n++){for(w=0,o=0;o<l[n].length;o++){for(i=0;i<l[n][o].length-s;i++){if(!1===e(l[n][o][i],y,g,S,w))return!1;y++}w++}S++}break;case"GeometryCollection":for(n=0;n<a.geometries.length;n++)if(!1===h(a.geometries[n],e,r))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}var d=function(t,e={}){if(null!=t.bbox&&!0!==e.recompute)return t.bbox;const r=[1/0,1/0,-1/0,-1/0];return h(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 m(t){return function(t){if(Array.isArray(t))return S(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||b(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 g(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,i,a,u=[],l=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.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&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}(t,e)||b(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 b(t,e){if(t){if("string"==typeof t)return S(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)?S(t,e):void 0}}function S(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 w=Math.PI/180,P=1e-4,I=function(t){return t*w},O=function(t,e){var r=g(t,2),n=r[0],o=r[1],i=g(e,2),a=i[0],u=i[1],l=I(o),c=I(u),f=c-l,s=I(a-n),y=Math.pow(Math.sin(f/2),2)+Math.cos(l)*Math.cos(c)*Math.pow(Math.sin(s/2),2);return 2*Math.atan2(Math.sqrt(y),Math.sqrt(1-y))*6371e3},j=function(t){var e=t/1609.344;if(e<.5){var r=Math.round(t),n=1===r?"metre":"metres";return"".concat(r," ").concat(n)}if(e<10){var o=Number.parseFloat(e.toFixed(1)),i=1===o?"mile":"miles";return"".concat(o," ").concat(i)}var a=Math.round(e);return"".concat(a," miles")},A=function(t){return d(t)};function x(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,i,a,u=[],l=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.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&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return M(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)?M(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 M(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 E(t){return E="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},E(t)}function k(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 L(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?k(Object(r),!0).forEach(function(e){T(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):k(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function T(t,e,r){return(e=function(t){var e=function(t){if("object"!=E(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=E(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==E(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 F(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],i=1;i<r.length;i++){var a=r[i];if(a[0]>e){o=a,n=r[i-1];break}n=r[i-1],o=a}var u=x(n,2),l=u[0],c=u[1],f=x(o,2),s=f[0],y=f[1];return e<=l?c:e>=s?y:c+(e-l)/(s-l)*(y-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],i=_(n).slice(3);if("zoom"!==o[0])throw new Error("Only zoom-based expressions supported");for(var a=0;a<i.length-2;a+=2){var u=i[a],l=i[a+1],c=i[a+2],f=i[a+3];if(e<=u)return l;if(e<=c)return l+(e-u)/(c-u)*(f-l)}return i[i.length-1]}function R(t,e){if(e.highlightLayerId&&t.getLayer(e.highlightLayerId)){try{t.removeLayer(e.highlightLayerId)}catch(t){}e.highlightLayerId=null,e.highlightedExpr=null}}function D(t,e,r){var n,o,i,a;if(null!=e&&null!==(n=e.feature)&&void 0!==n&&n.layer){R(t,r);var u=e.feature,l=e.layer;r.highlightLayerId="highlight-".concat(l.id);var c=u.id,f=u.type,s=u.properties,y=u.geometry;t.getSource(C).setData({id:c,type:f,properties:s,geometry:y}),r.highlightedExpr=l.layout["text-size"];var p=t.getZoom(),v=(o=l,i=1.5*F(r.highlightedExpr,p),a=r.isDarkStyle?{text:"#ffffff",halo:"#000000"}:{text:"#000000",halo:"#ffffff"},{id:"highlight-".concat(o.id),type:o.type,source:C,layout:L(L({},o.layout),{},{"text-size":i,"text-allow-overlap":!0,"text-ignore-placement":!0,"text-max-angle":90}),paint:L(L({},o.paint),{},{"text-color":a.text,"text-halo-color":a.halo,"text-halo-width":3,"text-halo-blur":1,"text-opacity":1})});t.addLayer(v),t.moveLayer(r.highlightLayerId)}}function B(t){t.getSource(C)||t.addSource(C,{type:"geojson",data:{type:"FeatureCollection",features:[]}})}function G(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 i(){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,i,a,u="string"==typeof(o=null===(n=e.layout)||void 0===n?void 0:n["text-field"])?null===(i=/^{(.+)}$/.exec(o))||void 0===i?void 0:i[1]:Array.isArray(o)?null===(a=o.find(function(t){return Array.isArray(t)&&"get"===t[0]}))||void 0===a?void 0:a[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],i=o.reduce(function(t,e){return[t[0]+e[0],t[1]+e[1]]},[0,0]);return[i[0]/o.length,i[1]/o.length]}return null}(t.geometry);if(!o)return null;var i=n.project({lng:o[0],lat:o[1]});return{text:t.properties[r],x:i.x,y:i.y,feature:t,layer:e}}(r,e,u,t)}).filter(Boolean):[]})}(t,e,r)}function a(){if(i(),!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},D(t,r,o),r.text}return G(t),B(t),null==n||n.on(r.MAP_SET_STYLE,function(e){t.once("styledata",function(){return t.once("idle",function(){G(t),B(t),o.isDarkStyle="dark"===(null==e?void 0:e.mapColorScheme)})})}),t.on("zoom",function(){if(o.highlightLayerId&&o.highlightedExpr){var e=F(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:i,highlightNextLabel:function(e){if(i(),!o.labels.length)return null;if(!o.currentPixel)return a();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]),i=Math.abs(e[1]-t[1]);return("ArrowUp"===r?e[1]<=t[1]&&i>=o:"ArrowDown"===r?e[1]>t[1]&&i>=o:"ArrowLeft"===r?e[0]<=t[0]&&i<o:"ArrowRight"!==r||e[0]>t[0]&&i<o)&&!n(e,t)});o.length||o.push(t);var i=function(e){return Math.hypot(t[0]-e[0],t[1]-e[1])},a=o.reduce(function(t,e){return i(e)<i(t)?e:t},o[0]);return e.findIndex(function(t){return n(t,a)})}([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},D(t,r,o),r.text):null},highlightLabelAtCenter:a,clearHighlightedLabel:function(){return R(t,o)}}}var N=function(t){return t.endsWith(".cold")?"".concat(t.slice(0,-5),".hot"):t.endsWith(".hot")?"".concat(t.slice(0,-4),".cold"):null};function Z(t){return Z="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},Z(t)}function H(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,i,a,u=[],l=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.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&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}(t,e)||W(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 W(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 $(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 q(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?$(Object(r),!0).forEach(function(e){Y(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):$(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function Y(t,e,r){return(e=function(t){var e=function(t){if("object"!=Z(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Z(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Z(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var V="icon-image",J="active-highlight",K="active-highlight-inner",X="selected-highlight",Q=function(t,e){return"active"===e?{property:"user_symbolActiveImageId",getImageId:function(e){var r;return null!==(r=null==t?void 0:t.getActiveImageId(e))&&void 0!==r?r:null}}:{property:"user_symbolSelectedImageId",getImageId:function(e){var r;return null!==(r=null==t?void 0:t.getSelectedImageId(e))&&void 0!==r?r:null}}},tt=function(t,e,r,n){var o=n.featureId,i=n.idProperty,a=n.geometry,u=t.getLayer(r);u&&(e[r]||(e[r]={ids:new Set,fillIds:new Set,idProperty:i,sourceId:u.source,hasFillGeometry:!1}),!a||"Polygon"!==a.type&&"MultiPolygon"!==a.type||(e[r].hasFillGeometry=!0,e[r].fillIds.add(o)),e[r].ids.add(o))},et=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",""])})}})},rt=function(t,e){var r="_".concat(e.replaceAll("-",""),"Sources");et(t,t[r]||new Set,new Set,e),t[r]=new Set},nt=function(t,e,r,n,o,i,a){!!t.getLayer(e)||t.addLayer(q(q({id:e,type:r,source:n},o&&{"source-layer":o}),{},{paint:i})),Object.entries(i).forEach(function(r){var n=H(r,2),o=n[0],i=n[1];t.setPaintProperty(e,o,i)}),t.setFilter(e,a),t.moveLayer(e)},ot=function(t,e,r,n,o,i,a){var u,l=t.getLayoutProperty(o,"icon-offset");t.getLayer(e)||t.addLayer(q(q({id:e,type:"symbol",source:r},n&&{"source-layer":n}),{},{layout:q(q(Y(Y({},V,i),"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,V,i),void 0!==l&&t.setLayoutProperty(e,"icon-offset",l),t.setFilter(e,a),t.moveLayer(e)},it=function(t,e,r,n,o){var i=function(t,e){var r={};return null==e||e.forEach(function(e){tt(t,r,e.layerId,e);var n=N(e.layerId);n&&tt(t,r,n,e)}),r}(t,e),a=new Set(Object.keys(i)),u="_".concat(n.replaceAll("-",""),"Sources"),l=t[u]||new Set;return et(t,l,a,n),t[u]=a,a.forEach(function(e){return function(t,e,r,n,o,i){var a,u=r[e],l=u.ids,c=u.fillIds,f=u.idProperty,s=u.sourceId,y=u.hasFillGeometry,p=t.getLayer(e),v=null!==(a=n[e])&&void 0!==a?a:n[N(e)];if(p&&v){var h=p.sourceLayer,d=y?"fill":p.type,m="".concat(o,"-").concat(e),g=v.fill,b=o===X,S=function(t){return t===X||t===K}(o),w=function(t,e){return{lineColor:e?t.selectionStroke:t.stroke,lineWidth:e?t.strokeWidth:t.activeStrokeWidth}}(v,S),P=w.lineColor,I=w.lineWidth,O=f?["get",f]:["id"],j=["in",O,["literal",Array.from(l)]];if("fill-extrusion"!==p.type)switch(d){case"fill":!function(t,e,r,n,o){var i=o.idExpression,a=o.fill,u=o.lineColor,l=o.lineWidth,c=o.filter;if(o.isSelected){var f=[];o.fillIds.forEach(function(t){return f.push(t)});var s=["in",i,["literal",f]];nt(t,"".concat(e,"-fill"),"fill",r,n,{"fill-color":a},s)}nt(t,"".concat(e,"-line"),"line",r,n,{"line-color":u,"line-width":l},c)}(t,m,s,h,{isSelected:b,idExpression:O,fillIds:c,fill:g,lineColor:P,lineWidth:I,filter:j});break;case"line":!function(t,e,r,n,o,i,a){t.getLayer("".concat(e,"-fill"))&&t.setFilter("".concat(e,"-fill"),["==","id",""]),nt(t,"".concat(e,"-line"),"line",r,n,{"line-color":o,"line-width":i},a)}(t,m,s,h,P,I,j);break;case"symbol":!function(t,e,r,n,o,i,a){var u=t.getLayoutProperty(o,V);if(Array.isArray(u))ot(t,"".concat(e,"-symbol"),r,n,o,["get",a.property],i);else{var l=a.getImageId(u);l&&ot(t,"".concat(e,"-symbol"),r,n,o,l,i)}}(t,m,s,h,e,j,i)}else!function(t,e,r,n){var o=n.lineColor,i=n.lineWidth,a=n.idExpression,u=[];n.ids.forEach(function(t){return u.push(t)});var l=["in",a,["literal",u]],c=t.getLayer(r),f=c.source,s=c.sourceLayer;nt(t,"".concat(e,"-line"),"line",f,s,{"line-color":o,"line-width":i},l)}(t,m,e,{ids:l,lineColor:P,lineWidth:I,idExpression:O})}}(t,e,i,r,n,o)}),i};function at(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,i,a,u=[],l=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.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&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return ut(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)?ut(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 ut(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 lt=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 ct(t,e){if(t){if("string"==typeof t)return ft(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)?ft(t,e):void 0}}function ft(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 st=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=N(t);e&&r.add(e)}),function(t){if(Array.isArray(t))return ft(t)}(e=r)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(e)||ct(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 i=function(t,e){var r,n=[],o=[],i=function(t){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=ct(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,i=!0,a=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return i=t.done,t},e:function(t){a=!0,o=t},f:function(){try{i||null==e.return||e.return()}finally{if(a)throw o}}}}(e);try{for(i.s();!(r=i.n()).done;){var a=r.value;if("line"===t.getLayer(a).type){var u=a.endsWith("-stroke")?a.slice(0,-7):null;null!==u&&e.includes(u)||n.push(a)}else o.push(a)}}catch(t){i.e(t)}finally{i.f()}return{lineLayers:n,otherLayers:o}}(t,o),a=i.lineLayers,u=i.otherLayers,l=r.point,c=l.x,f=l.y,s=[[c-10,f-10],[c+10,f+10]],y=a.length>0&&t.queryRenderedFeatures(s,{layers:a}).length>0,p=u.length>0&&t.queryRenderedFeatures(r.point,{layers:u}).length>0;n.style.cursor=y||p?"pointer":""}else n.style.cursor=""};return t.on("mousemove",o),o};function yt(t){return yt="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},yt(t)}function pt(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,i,a,u=[],l=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.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&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return vt(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)?vt(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 vt(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 ht(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,dt(n.key),n)}}function dt(t){var e=function(t){if("object"!=yt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=yt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==yt(e)?e:e+""}var mt=function(){return t=function t(){var e,r,n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=this,r="sets",n=new Map,(r=dt(r))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n},(e=[{key:"add",value:function(t,e){var r,n=null!==(r=this.sets.get(t))&&void 0!==r?r:new Set;this.sets.delete(t),this.sets.set(t,n),e.forEach(function(t){return n.add(t)});for(var o=new Set;this.sets.size>2;){var i=pt(this.sets.entries().next().value,2),a=i[0],u=i[1];this.sets.delete(a),u.forEach(function(t){return o.add(t)})}return this.sets.forEach(function(t){return t.forEach(function(t){return o.delete(t)})}),Array.from(o)}}])&&ht(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function gt(t){return gt="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},gt(t)}function bt(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var l=n&&n.prototype instanceof u?n:u,c=Object.create(l.prototype);return St(c,"_invoke",function(r,n,o){var i,u,l,c=0,f=o||[],s=!1,y={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,r){return i=e,u=0,l=t,y.n=r,a}};function p(r,n){for(u=r,l=n,e=0;!s&&c&&!o&&e<f.length;e++){var o,i=f[e],p=y.p,v=i[2];r>3?(o=v===n)&&(l=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=p&&((o=r<2&&p<i[1])?(u=0,y.v=n,y.n=i[1]):p<v&&(o=r<3||i[0]>n||n>v)&&(i[4]=r,i[5]=n,y.n=v,u=0))}if(o||r>1)return a;throw s=!0,n}return function(o,f,v){if(c>1)throw TypeError("Generator is already running");for(s&&1===f&&p(f,v),u=f,l=v;(e=u<2?t:l)||!s;){i||(u?u<3?(u>1&&(y.n=-1),p(u,l)):y.n=l:y.v=l);try{if(c=2,i){if(u||(o="next"),e=i[o]){if(!(e=e.call(i,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=i.return)&&e.call(i),u<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=t}else if((e=(s=y.n<0)?l:r.call(n,y))!==a)break}catch(e){i=t,u=1,l=e}finally{c=1}}return{value:e,done:s}}}(r,o,i),!0),c}var a={};function u(){}function l(){}function c(){}e=Object.getPrototypeOf;var f=[][n]?e(e([][n]())):(St(e={},n,function(){return this}),e),s=c.prototype=u.prototype=Object.create(f);function y(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,St(t,o,"GeneratorFunction")),t.prototype=Object.create(s),t}return l.prototype=c,St(s,"constructor",c),St(c,"constructor",l),l.displayName="GeneratorFunction",St(c,o,"GeneratorFunction"),St(s),St(s,o,"Generator"),St(s,n,function(){return this}),St(s,"toString",function(){return"[object Generator]"}),(bt=function(){return{w:i,m:y}})()}function St(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}St=function(t,e,r,n){function i(e,r){St(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:(i("next",0),i("throw",1),i("return",2))},St(t,e,r,n)}function wt(t,e,r,n,o,i,a){try{var u=t[i](a),l=u.value}catch(t){return void r(t)}u.done?e(l):Promise.resolve(l).then(n,o)}function Pt(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){wt(i,n,o,a,u,"next",t)}function u(t){wt(i,n,o,a,u,"throw",t)}a(void 0)})}}function It(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,jt(n.key),n)}}function Ot(t,e,r){return(e=jt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function jt(t){var e=function(t){if("object"!=gt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=gt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==gt(e)?e:e+""}function At(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,i,a,u=[],l=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.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&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return xt(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)?xt(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 xt(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 Mt=.25,Et=.75,kt=function(t){return t<=Mt?0:t>=Et?1:.5},Lt=function(t){return Math.round(100*t)/100},Tt=function(t,e){var r=At(t,2),n=r[0],o=r[1],i=At(e.split(" ").map(Number),4),a=i[2],u=i[3];return[Lt((kt(n)-n)*a),Lt((kt(o)-o)*u)]},_t=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Ot(this,"activeImageIds",new Map),Ot(this,"selectedImageIds",new Map),Ot(this,"recentImageSets",new mt),this.map=e},e=[{key:"getActiveImageId",value:function(t){var e;return null!==(e=this.activeImageIds.get(t))&&void 0!==e?e:null}},{key:"getSelectedImageId",value:function(t){var e;return null!==(e=this.selectedImageIds.get(t))&&void 0!==e?e:null}},{key:"removeImage",value:function(t){this.map.hasImage(t)&&this.map.removeImage(t),this.activeImageIds.delete(t),this.selectedImageIds.delete(t)}},{key:"registerSymbols",value:(r=Pt(bt().m(function t(e,r,n,o){var i,a,u=this;return bt().w(function(t){for(;;)switch(t.n){case 0:return i=this.map,t.n=1,Promise.all(e.map(function(){var t=Pt(bt().m(function t(e){var a;return bt().w(function(t){for(;;)switch(t.n){case 0:if(a=n.getSymbolImageIds(e,r,o)){t.n=1;break}return t.a(2,[]);case 1:return u.activeImageIds.set(a.normal,a.active),u.selectedImageIds.set(a.normal,a.selected),t.n=2,Promise.all(Object.entries(a).map(function(){var t=Pt(bt().m(function t(a){var u,l,c,f;return bt().w(function(t){for(;;)switch(t.n){case 0:if(u=At(a,2),l=u[0],c=u[1],!i.hasImage(c)){t.n=1;break}return t.a(2);case 1:return t.n=2,n.rasteriseSymbolImage(e,r,l,o);case 2:(f=t.v)&&!i.hasImage(f.imageId)&&i.addImage(f.imageId,f.imageData,{pixelRatio:o});case 3:return t.a(2)}},t)}));return function(e){return t.apply(this,arguments)}}()));case 2:return t.a(2,Object.values(a))}},t)}));return function(e){return t.apply(this,arguments)}}()));case 1:a=t.v,this.recentImageSets.add("".concat(null==r?void 0:r.id,"|").concat(o),a.flat()).forEach(function(t){return u.removeImage(t)});case 2:return t.a(2)}},t,this)})),function(t,e,n,o){return r.apply(this,arguments)})}],e&&It(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}(),Ct=function(t){return Math.max(2,2*t)};function Ft(t){return Ft="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},Ft(t)}function Rt(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var l=n&&n.prototype instanceof u?n:u,c=Object.create(l.prototype);return Dt(c,"_invoke",function(r,n,o){var i,u,l,c=0,f=o||[],s=!1,y={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,r){return i=e,u=0,l=t,y.n=r,a}};function p(r,n){for(u=r,l=n,e=0;!s&&c&&!o&&e<f.length;e++){var o,i=f[e],p=y.p,v=i[2];r>3?(o=v===n)&&(l=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=p&&((o=r<2&&p<i[1])?(u=0,y.v=n,y.n=i[1]):p<v&&(o=r<3||i[0]>n||n>v)&&(i[4]=r,i[5]=n,y.n=v,u=0))}if(o||r>1)return a;throw s=!0,n}return function(o,f,v){if(c>1)throw TypeError("Generator is already running");for(s&&1===f&&p(f,v),u=f,l=v;(e=u<2?t:l)||!s;){i||(u?u<3?(u>1&&(y.n=-1),p(u,l)):y.n=l:y.v=l);try{if(c=2,i){if(u||(o="next"),e=i[o]){if(!(e=e.call(i,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=i.return)&&e.call(i),u<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=t}else if((e=(s=y.n<0)?l:r.call(n,y))!==a)break}catch(e){i=t,u=1,l=e}finally{c=1}}return{value:e,done:s}}}(r,o,i),!0),c}var a={};function u(){}function l(){}function c(){}e=Object.getPrototypeOf;var f=[][n]?e(e([][n]())):(Dt(e={},n,function(){return this}),e),s=c.prototype=u.prototype=Object.create(f);function y(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,Dt(t,o,"GeneratorFunction")),t.prototype=Object.create(s),t}return l.prototype=c,Dt(s,"constructor",c),Dt(c,"constructor",l),l.displayName="GeneratorFunction",Dt(c,o,"GeneratorFunction"),Dt(s),Dt(s,o,"Generator"),Dt(s,n,function(){return this}),Dt(s,"toString",function(){return"[object Generator]"}),(Rt=function(){return{w:i,m:y}})()}function Dt(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}Dt=function(t,e,r,n){function i(e,r){Dt(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:(i("next",0),i("throw",1),i("return",2))},Dt(t,e,r,n)}function Bt(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,i,a,u=[],l=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.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&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Gt(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)?Gt(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 Gt(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 zt(t,e,r,n,o,i,a){try{var u=t[i](a),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 i=t.apply(e,r);function a(t){zt(i,n,o,a,u,"next",t)}function u(t){zt(i,n,o,a,u,"throw",t)}a(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,Ht(n.key),n)}}function Ht(t){var e=function(t){if("object"!=Ft(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Ft(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ft(e)?e:e+""}var Wt=function(){return t=function t(e){var r,n,o;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),r=this,n="recentImageSets",o=new mt,(n=Ht(n))in r?Object.defineProperty(r,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[n]=o,this.map=e},e=[{key:"registerPatterns",value:(r=Nt(Rt().m(function t(e,r,n,o){var i,a,u;return Rt().w(function(t){for(;;)switch(t.n){case 0:return i=this.map,a=new Map,e.forEach(function(t){var e=n.getPatternImageId(t,r,o);e&&!a.has(e)&&a.set(e,t)}),u=Ct(o),t.n=1,Promise.all(Array.from(a,function(){var t=Nt(Rt().m(function t(e){var a,l,c,f;return Rt().w(function(t){for(;;)switch(t.n){case 0:if(a=Bt(e,2),l=a[0],c=a[1],!i.hasImage(l)){t.n=1;break}return t.a(2);case 1:return t.n=2,n.rasterisePatternImage(c,r,o);case 2:(f=t.v)&&!i.hasImage(f.imageId)&&i.addImage(f.imageId,f.imageData,{pixelRatio:u});case 3:return t.a(2)}},t)}));return function(e){return t.apply(this,arguments)}}()));case 1:this.recentImageSets.add("".concat(r,"|").concat(o),Array.from(a.keys())).forEach(function(t){i.hasImage(t)&&i.removeImage(t)});case 2:return t.a(2)}},t,this)})),function(t,e,n,o){return r.apply(this,arguments)})}],e&&Zt(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Ut(t){return Ut="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},Ut(t)}var $t=["container","padding","mapStyle","mapSize","center","zoom","bounds","pixelRatio"];function qt(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var l=n&&n.prototype instanceof u?n:u,c=Object.create(l.prototype);return Yt(c,"_invoke",function(r,n,o){var i,u,l,c=0,f=o||[],s=!1,y={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,r){return i=e,u=0,l=t,y.n=r,a}};function p(r,n){for(u=r,l=n,e=0;!s&&c&&!o&&e<f.length;e++){var o,i=f[e],p=y.p,v=i[2];r>3?(o=v===n)&&(l=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=p&&((o=r<2&&p<i[1])?(u=0,y.v=n,y.n=i[1]):p<v&&(o=r<3||i[0]>n||n>v)&&(i[4]=r,i[5]=n,y.n=v,u=0))}if(o||r>1)return a;throw s=!0,n}return function(o,f,v){if(c>1)throw TypeError("Generator is already running");for(s&&1===f&&p(f,v),u=f,l=v;(e=u<2?t:l)||!s;){i||(u?u<3?(u>1&&(y.n=-1),p(u,l)):y.n=l:y.v=l);try{if(c=2,i){if(u||(o="next"),e=i[o]){if(!(e=e.call(i,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=i.return)&&e.call(i),u<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=t}else if((e=(s=y.n<0)?l:r.call(n,y))!==a)break}catch(e){i=t,u=1,l=e}finally{c=1}}return{value:e,done:s}}}(r,o,i),!0),c}var a={};function u(){}function l(){}function c(){}e=Object.getPrototypeOf;var f=[][n]?e(e([][n]())):(Yt(e={},n,function(){return this}),e),s=c.prototype=u.prototype=Object.create(f);function y(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,Yt(t,o,"GeneratorFunction")),t.prototype=Object.create(s),t}return l.prototype=c,Yt(s,"constructor",c),Yt(c,"constructor",l),l.displayName="GeneratorFunction",Yt(c,o,"GeneratorFunction"),Yt(s),Yt(s,o,"Generator"),Yt(s,n,function(){return this}),Yt(s,"toString",function(){return"[object Generator]"}),(qt=function(){return{w:i,m:y}})()}function Yt(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}Yt=function(t,e,r,n){function i(e,r){Yt(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:(i("next",0),i("throw",1),i("return",2))},Yt(t,e,r,n)}function Vt(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 Jt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Vt(Object(r),!0).forEach(function(e){Kt(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Vt(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function Kt(t,e,r){return(e=re(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Xt(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 i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)r=i[n],-1===e.indexOf(r)&&{}.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function Qt(t,e,r,n,o,i,a){try{var u=t[i](a),l=u.value}catch(t){return void r(t)}u.done?e(l):Promise.resolve(l).then(n,o)}function te(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){Qt(i,n,o,a,u,"next",t)}function u(t){Qt(i,n,o,a,u,"throw",t)}a(void 0)})}}function ee(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,re(n.key),n)}}function re(t){var e=function(t){if("object"!=Ut(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Ut(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ut(e)?e:e+""}function ne(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(ne=function(){return!!t})()}function oe(t){return oe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},oe(t)}function ie(t,e){return ie=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ie(t,e)}var ae=function(t){function e(t){var r,n=t.mapFramework,o=t.mapProviderConfig,i=void 0===o?{}:o,a=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=function(t,e,r){return e=oe(e),function(t,e){if(e&&("object"==Ut(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,ne()?Reflect.construct(e,r||[],oe(t).constructor):e.apply(t,r))}(this,e)).maplibreModule=n,r.events=a,r.eventBus=u,r.capabilities={supportedShortcuts:l,supportsMapSizes:!0},Object.assign(r,i),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&&ie(t,e)}(e,t),r=e,n=[{key:"name",get:function(){return"MapLibreProvider"}},{key:"initMap",value:(a=te(qt().m(function t(e){var r,n,o,i,a,u,l,s,y,h,d,m,g,b=this;return qt().w(function(t){for(;;)switch(t.n){case 0:r=e.container,n=e.padding,o=e.mapStyle,i=e.mapSize,a=e.center,u=e.zoom,l=e.bounds,s=e.pixelRatio,y=Xt(e,$t),this.mapStyleId=null==o?void 0:o.id,this.mapSize=i,h=this.maplibreModule.Map,d=this.events,m=this.eventBus,(g=new h(Jt(Jt({},y),{},{container:r,style:null==o?void 0:o.url,pixelRatio:s,padding:n,center:a,zoom:u,fadeDuration:0,attributionControl:!1,dragRotate:!1,doubleClickZoom:!1}))).touchZoomRotate.disableRotation(),this.map=g,this.symbolImages=new _t(g),this.patternImages=new Wt(g),this.map.setPadding(n),l&&g.fitBounds(l,{duration:0}),f(g),c(g),p({map:g,events:d,eventBus:m,getCenter:this.getCenter.bind(this),getZoom:this.getZoom.bind(this),getBounds:this.getBounds.bind(this),getResolution:this.getResolution.bind(this)}),v({mapProvider:this,map:g,events:d,eventBus:m}),g.on("load",function(){b.labelNavigator=z(g,null==o?void 0:o.mapColorScheme,d,m)}),this.eventBus.emit(d.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 a.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=st(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:A(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,i=t.stylesMap,a=t.symbolImages;if(!r)return null;var u=Q(a,"active"),l=Q(a,"selected");null!=o&&o.length?(it(r,o,i,J,u),it(r,o,i,K,l)):(rt(r,J),rt(r,K));var c={};null!=n&&n.length?c=it(r,n,i,X,l):rt(r,X);var f=[];return Object.entries(c).forEach(function(t){var e=H(t,2),n=e[0],o=e[1],i=o.ids,a=o.idProperty;f.push.apply(f,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)||W(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 i.has(a?null===(e=t.properties)||void 0===e?void 0:e[a]: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,f)}({LngLatBounds:this.maplibreModule.LngLatBounds,map:this.map,selectedFeatures:t,activeFeatures:e,stylesMap:r,symbolImages:this.symbolImages})}},{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]],i=t.queryRenderedFeatures(o);if(0===i.length)return[];var a=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=[];i.forEach(function(t){!1===u.includes(t.layer.id)&&u.push(t.layer.id)});for(var l=new Set,c=[],f=i.length-1;f>=0;f--){var s,y=i[f],p=void 0===y.id?JSON.stringify(y.properties):y.id,v="".concat(null===(s=y.layer)||void 0===s?void 0:s.source,":").concat(p);!1===l.has(v)&&(l.add(v),c.push(y))}var h=t.unproject(e),d=[h.lng,h.lat],m=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=at(t,2),n=r[0],o=r[1],i=!1,a=0,u=e.length-1;a<e.length;u=a,a++){var l=at(e[a],2),c=l[0],f=l[1],s=at(e[u],2),y=s[0],p=s[1];f>o!=p>o&&n<(y-c)*(o-f)/(p-f)+c&&(i=!i)}return i}(d,t[0])});if("Point"===e||"MultiPoint"===e){var r,n=void 0===t.id?JSON.stringify(t.properties):t.id;return a.has("".concat(null===(r=t.layer)||void 0===r?void 0:r.source,":").concat(n))}return!0});return m.map(function(r){var n=0,o=r.geometry.type,i=function(t,e,r){var n=r.coordinates,o=r.type,i=1/0,a=function(e){return t.project(e)},u=function(t){for(var r=0;r<t.length-1;r++){var n=lt(e,a(t[r]),a(t[r+1]));n<i&&(i=n)}};if("Point"===o){var l=a(n);i=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=a(t),n=Math.pow(e.x-r.x,2)+Math.pow(e.y-r.y,2);n<i&&(i=n)}):"Polygon"===o||"MultiLineString"===o?n.forEach(u):"MultiPolygon"===o&&n.forEach(function(t){return t.forEach(u)});return i}(t,e,r.geometry);return n+=1e6*u.indexOf(r.layer.id),o.includes("Polygon")&&(n-=5e5),{f:r,score:n+=i}}).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:(i=te(qt().m(function t(e,r,n){var o,i=arguments;return qt().w(function(t){for(;;)if(0===t.n)return o=i.length>3&&void 0!==i[3]?i[3]:this.map.getPixelRatio()||1,t.a(2,this.symbolImages.registerSymbols(e,r,n,o))},t,this)})),function(t,e,r){return i.apply(this,arguments)})},{key:"getSymbolIconLayout",value:function(t){return l=(u=t).anchor,c=u.viewBox,{"icon-anchor":(e=l,r=At(e,2),n=r[0],o=r[1],i=function(t){return t<=Mt?"left":t>=Et?"right":""}(n),a=function(t){return t<=Mt?"top":t>=Et?"bottom":""}(o),a+(i&&a?"-":"")+i||"center"),"icon-offset":Tt(l,c)};var e,r,n,o,i,a,u,l,c}},{key:"getActiveSymbolImageId",value:function(t){var e,r;return null!==(e=null===(r=this.symbolImages)||void 0===r?void 0:r.getActiveImageId(t))&&void 0!==e?e:null}},{key:"getSelectedSymbolImageId",value:function(t){var e,r;return null!==(e=null===(r=this.symbolImages)||void 0===r?void 0:r.getSelectedImageId(t))&&void 0!==e?e:null}},{key:"addPatternsToMap",value:(o=te(qt().m(function t(e,r,n){var o,i=arguments;return qt().w(function(t){for(;;)if(0===t.n)return o=i.length>3&&void 0!==i[3]?i[3]:this.map.getPixelRatio()||1,t.a(2,this.patternImages.registerPatterns(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 i=g(t,2),a=g(i[0],2);e=a[0],r=a[1];var u=g(i[1],2);n=u[0],o=u[1]}var l=O([e,r],[n,r]),c=O([e,r],[e,o]),f=j(l),s=j(c);return"".concat(s," by ").concat(f)}((t=this.maplibreModule.LngLatBounds,e=this.map,r=e.getContainer().getBoundingClientRect(),n=r.width,o=r.height,i=e.getPadding(),a=[i.left,o-i.bottom],u=[n-i.right,i.top],new t(e.unproject(a),e.unproject(u))));var t,e,r,n,o,i,a,u}},{key:"getCardinalMove",value:function(t,e){return function(t,e){var r=g(t,2),n=r[0],o=r[1],i=g(e,2),a=i[0],u=i[1],l=u-o,c=a-n,f=[];if(Math.abs(l)>P){var s=Math.round(O([n,o],[n,u]));f.push("".concat(l>0?"north":"south"," ").concat(j(s)))}if(Math.abs(c)>P){var y=Math.round(O([n,o],[a,o]));f.push("".concat(c>0?"east":"west"," ").concat(j(y)))}return f.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(I(r))/(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=g(A(t),4),i=o[0],a=o[1],u=o[2],l=o[3],c=[r.project([i,a]),r.project([i,l]),r.project([u,a]),r.project([u,l])],f=Math.min.apply(Math,m(c.map(function(t){return t.x}))),s=Math.max.apply(Math,m(c.map(function(t){return t.x}))),y=Math.min.apply(Math,m(c.map(function(t){return t.y}))),p=Math.max.apply(Math,m(c.map(function(t){return t.y}))),v=e.left-n.left,h=e.top-n.top,d=e.right-n.left,b=e.bottom-n.top;return f<d&&s>v&&y<b&&p>h}(t,e,this.map)}}],n&&ee(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o,i,a}(a)}}]);
|
|
2
|
+
"use strict";(Object("undefined"!=typeof self?self:this).webpackChunkdefra_DefraMap=Object("undefined"!=typeof self?self:this).webpackChunkdefra_DefraMap||[]).push([[772],{988:function(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,i(n.key),n)}}function i(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:function(){return ne}});var a=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:"_notImplemented",value:function(t){throw new Error("".concat(this.name," must implement ").concat(t,"()"))}},{key:"isBaseMapReady",value:function(){this._notImplemented("isBaseMapReady")}},{key:"addSymbolsToMap",value:function(){this._notImplemented("addSymbolsToMap")}},{key:"addPatternsToMap",value:function(){this._notImplemented("addPatternsToMap")}},{key:"getActiveSymbolImageId",value:function(){this._notImplemented("getActiveSymbolImageId")}},{key:"getSelectedSymbolImageId",value:function(){this._notImplemented("getSelectedSymbolImageId")}}])&&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 f(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 s=function(t,e){var r=null,n=function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];clearTimeout(r),r=setTimeout(function(){t.apply(void 0,o)},e)};return n.cancel=function(){r&&(clearTimeout(r),r=null)},n};function y(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,i=t.getZoom,a=t.getBounds,u=t.getResolution,l=[],c=[],f=function(){var t=i();return{center:o(),bounds:a(),resolution:u(),zoom:t,isAtMaxZoom:e.getMaxZoom()<=t,isAtMinZoom:e.getMinZoom()>=t}},p=function(t,e){return n.emit(t,e)},v=function(){return p(r.MAP_LOADED)};e.on("load",v),l.push(["load",v]),e.once("idle",function(){return p(r.MAP_FIRST_IDLE,f())});var h=function(){return p(r.MAP_MOVE_START)};e.on("movestart",h),l.push(["movestart",h]);var d=s(function(){p(r.MAP_MOVE_END,f())},500);e.on("moveend",d),l.push(["moveend",d]);var m,g,b=(m=function(){p(r.MAP_MOVE,f())},g=0,function(){var t=Date.now();t-g>=10&&(g=t,m.apply(void 0,arguments))});e.on("zoom",b),l.push(["zoom",b]);var S=function(){return p(r.MAP_RENDER)};e.on("render",S),l.push(["render",S]);var w=s(function(){p(r.MAP_DATA_CHANGE,f())},500),P=function(t){t.isSourceLoaded&&w()};e.on("styledata",w),e.on("sourcedata",P),l.push(["styledata",w],["sourcedata",P]);var O=function(){return p(r.MAP_STYLE_CHANGE)};e.on("style.load",O),l.push(["style.load",O]);var I=function(t){return p(r.MAP_CLICK,{point:t.point,coords:[t.lngLat.lng,t.lngLat.lat]})};return e.on("click",I),l.push(["click",I]),c.push(d,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,i,a,u=[],l=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.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&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}(r,n)||function(t,e){if(t){if("string"==typeof t)return y(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)?y(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.")}()),i=o[0],a=o[1];return e.off(i,a)})}}}function v(t){var e=t.mapProvider,r=t.map,n=t.events,o=t.eventBus,i=function(t){r.once("style.load",function(){o.emit(n.MAP_STYLE_CHANGE,{mapStyleId:t.id})}),r.setStyle(t.url,{diff:!1})},a=function(t){r.setPixelRatio(t)},u=function(t){var r=t.mapSize;e.mapSize=r};return o.on(n.MAP_SET_STYLE,i),o.on(n.MAP_SET_PIXEL_RATIO,a),o.on(n.MAP_SIZE_CHANGE,u),{remove:function(){o.off(n.MAP_SET_STYLE,i),o.off(n.MAP_SET_PIXEL_RATIO,a),o.off(n.MAP_SIZE_CHANGE,u)}}}function h(t,e,r){if(null!==t)for(var n,o,i,a,u,l,c,f,s=0,y=0,p=t.type,v="FeatureCollection"===p,d="Feature"===p,m=v?t.features.length:1,g=0;g<m;g++){u=(f=!!(c=v?t.features[g].geometry:d?t.geometry:t)&&"GeometryCollection"===c.type)?c.geometries.length:1;for(var b=0;b<u;b++){var S=0,w=0;if(null!==(a=f?c.geometries[b]:c)){l=a.coordinates;var P=a.type;switch(s=!r||"Polygon"!==P&&"MultiPolygon"!==P?0:1,P){case null:break;case"Point":if(!1===e(l,y,g,S,w))return!1;y++,S++;break;case"LineString":case"MultiPoint":for(n=0;n<l.length;n++){if(!1===e(l[n],y,g,S,w))return!1;y++,"MultiPoint"===P&&S++}"LineString"===P&&S++;break;case"Polygon":case"MultiLineString":for(n=0;n<l.length;n++){for(o=0;o<l[n].length-s;o++){if(!1===e(l[n][o],y,g,S,w))return!1;y++}"MultiLineString"===P&&S++,"Polygon"===P&&w++}"Polygon"===P&&S++;break;case"MultiPolygon":for(n=0;n<l.length;n++){for(w=0,o=0;o<l[n].length;o++){for(i=0;i<l[n][o].length-s;i++){if(!1===e(l[n][o][i],y,g,S,w))return!1;y++}w++}S++}break;case"GeometryCollection":for(n=0;n<a.geometries.length;n++)if(!1===h(a.geometries[n],e,r))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}var d=function(t,e={}){if(null!=t.bbox&&!0!==e.recompute)return t.bbox;const r=[1/0,1/0,-1/0,-1/0];return h(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 m(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,i,a,u=[],l=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.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&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return g(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)?g(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 g(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 b=Math.PI/180,S=1e-4,w=function(t){return t*b},P=function(t,e){var r=m(t,2),n=r[0],o=r[1],i=m(e,2),a=i[0],u=i[1],l=w(o),c=w(u),f=c-l,s=w(a-n),y=Math.pow(Math.sin(f/2),2)+Math.cos(l)*Math.cos(c)*Math.pow(Math.sin(s/2),2);return 2*Math.atan2(Math.sqrt(y),Math.sqrt(1-y))*6371e3},O=function(t){var e=t/1609.344;if(e<.5){var r=Math.round(t),n=1===r?"metre":"metres";return"".concat(r," ").concat(n)}if(e<10){var o=Number.parseFloat(e.toFixed(1)),i=1===o?"mile":"miles";return"".concat(o," ").concat(i)}var a=Math.round(e);return"".concat(a," miles")};function I(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,i,a,u=[],l=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.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&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return j(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)?j(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 j(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 A(t){return A="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},A(t)}function x(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 E(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?x(Object(r),!0).forEach(function(e){M(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):x(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function M(t,e,r){return(e=function(t){var e=function(t){if("object"!=A(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=A(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==A(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function k(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 L="highlighted-label";function T(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],i=1;i<r.length;i++){var a=r[i];if(a[0]>e){o=a,n=r[i-1];break}n=r[i-1],o=a}var u=I(n,2),l=u[0],c=u[1],f=I(o,2),s=f[0],y=f[1];return e<=l?c:e>=s?y:c+(e-l)/(s-l)*(y-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 k(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)?k(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],i=k(n).slice(3);if("zoom"!==o[0])throw new Error("Only zoom-based expressions supported");for(var a=0;a<i.length-2;a+=2){var u=i[a],l=i[a+1],c=i[a+2],f=i[a+3];if(e<=u)return l;if(e<=c)return l+(e-u)/(c-u)*(f-l)}return i[i.length-1]}function _(t,e){if(e.highlightLayerId&&t.getLayer(e.highlightLayerId)){try{t.removeLayer(e.highlightLayerId)}catch(t){}e.highlightLayerId=null,e.highlightedExpr=null}}function C(t,e,r){var n,o,i,a;if(null!=e&&null!==(n=e.feature)&&void 0!==n&&n.layer){_(t,r);var u=e.feature,l=e.layer;r.highlightLayerId="highlight-".concat(l.id);var c=u.id,f=u.type,s=u.properties,y=u.geometry;t.getSource(L).setData({id:c,type:f,properties:s,geometry:y}),r.highlightedExpr=l.layout["text-size"];var p=t.getZoom(),v=(o=l,i=1.5*T(r.highlightedExpr,p),a=r.isDarkStyle?{text:"#ffffff",halo:"#000000"}:{text:"#000000",halo:"#ffffff"},{id:"highlight-".concat(o.id),type:o.type,source:L,layout:E(E({},o.layout),{},{"text-size":i,"text-allow-overlap":!0,"text-ignore-placement":!0,"text-max-angle":90}),paint:E(E({},o.paint),{},{"text-color":a.text,"text-halo-color":a.halo,"text-halo-width":3,"text-halo-blur":1,"text-opacity":1})});t.addLayer(v),t.moveLayer(r.highlightLayerId)}}function F(t){t.getSource(L)||t.addSource(L,{type:"geojson",data:{type:"FeatureCollection",features:[]}})}function R(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 D(t,e,r,n){var o={isDarkStyle:"dark"===e,labels:[],currentPixel:null,highlightLayerId:null,highlightedExpr:null};function i(){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,i,a,u="string"==typeof(o=null===(n=e.layout)||void 0===n?void 0:n["text-field"])?null===(i=/^{(.+)}$/.exec(o))||void 0===i?void 0:i[1]:Array.isArray(o)?null===(a=o.find(function(t){return Array.isArray(t)&&"get"===t[0]}))||void 0===a?void 0:a[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],i=o.reduce(function(t,e){return[t[0]+e[0],t[1]+e[1]]},[0,0]);return[i[0]/o.length,i[1]/o.length]}return null}(t.geometry);if(!o)return null;var i=n.project({lng:o[0],lat:o[1]});return{text:t.properties[r],x:i.x,y:i.y,feature:t,layer:e}}(r,e,u,t)}).filter(Boolean):[]})}(t,e,r)}function a(){if(i(),!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},C(t,r,o),r.text}return R(t),F(t),null==n||n.on(r.MAP_SET_STYLE,function(e){t.once("styledata",function(){return t.once("idle",function(){R(t),F(t),o.isDarkStyle="dark"===(null==e?void 0:e.mapColorScheme)})})}),t.on("zoom",function(){if(o.highlightLayerId&&o.highlightedExpr){var e=T(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:i,highlightNextLabel:function(e){if(i(),!o.labels.length)return null;if(!o.currentPixel)return a();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]),i=Math.abs(e[1]-t[1]);return("ArrowUp"===r?e[1]<=t[1]&&i>=o:"ArrowDown"===r?e[1]>t[1]&&i>=o:"ArrowLeft"===r?e[0]<=t[0]&&i<o:"ArrowRight"!==r||e[0]>t[0]&&i<o)&&!n(e,t)});o.length||o.push(t);var i=function(e){return Math.hypot(t[0]-e[0],t[1]-e[1])},a=o.reduce(function(t,e){return i(e)<i(t)?e:t},o[0]);return e.findIndex(function(t){return n(t,a)})}([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},C(t,r,o),r.text):null},highlightLabelAtCenter:a,clearHighlightedLabel:function(){return _(t,o)}}}var B=function(t){return t.endsWith(".cold")?"".concat(t.slice(0,-5),".hot"):t.endsWith(".hot")?"".concat(t.slice(0,-4),".cold"):null};function G(t){return G="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},G(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,i,a,u=[],l=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.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&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}(t,e)||N(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 N(t,e){if(t){if("string"==typeof t)return Z(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)?Z(t,e):void 0}}function Z(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 H(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 W(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?H(Object(r),!0).forEach(function(e){U(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):H(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function U(t,e,r){return(e=function(t){var e=function(t){if("object"!=G(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=G(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==G(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var $="icon-image",q="active-highlight",Y="active-highlight-inner",V="selected-highlight",J=function(t,e){return"active"===e?{property:"user_symbolActiveImageId",getImageId:function(e){var r;return null!==(r=null==t?void 0:t.getActiveImageId(e))&&void 0!==r?r:null}}:{property:"user_symbolSelectedImageId",getImageId:function(e){var r;return null!==(r=null==t?void 0:t.getSelectedImageId(e))&&void 0!==r?r:null}}},K=function(t,e,r,n){var o=n.featureId,i=n.idProperty,a=n.geometry,u=t.getLayer(r);u&&(e[r]||(e[r]={ids:new Set,fillIds:new Set,idProperty:i,sourceId:u.source,hasFillGeometry:!1}),!a||"Polygon"!==a.type&&"MultiPolygon"!==a.type||(e[r].hasFillGeometry=!0,e[r].fillIds.add(o)),e[r].ids.add(o))},X=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",""])})}})},Q=function(t,e){var r="_".concat(e.replaceAll("-",""),"Sources");X(t,t[r]||new Set,new Set,e),t[r]=new Set},tt=function(t,e,r,n,o,i,a){!!t.getLayer(e)||t.addLayer(W(W({id:e,type:r,source:n},o&&{"source-layer":o}),{},{paint:i})),Object.entries(i).forEach(function(r){var n=z(r,2),o=n[0],i=n[1];t.setPaintProperty(e,o,i)}),t.setFilter(e,a),t.moveLayer(e)},et=function(t,e,r,n,o,i,a){var u,l=t.getLayoutProperty(o,"icon-offset");t.getLayer(e)||t.addLayer(W(W({id:e,type:"symbol",source:r},n&&{"source-layer":n}),{},{layout:W(W(U(U({},$,i),"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,$,i),void 0!==l&&t.setLayoutProperty(e,"icon-offset",l),t.setFilter(e,a),t.moveLayer(e)},rt=function(t,e,r,n,o){var i=function(t,e){var r={};return null==e||e.forEach(function(e){K(t,r,e.layerId,e);var n=B(e.layerId);n&&K(t,r,n,e)}),r}(t,e),a=new Set(Object.keys(i)),u="_".concat(n.replaceAll("-",""),"Sources"),l=t[u]||new Set;return X(t,l,a,n),t[u]=a,a.forEach(function(e){return function(t,e,r,n,o,i){var a,u=r[e],l=u.ids,c=u.fillIds,f=u.idProperty,s=u.sourceId,y=u.hasFillGeometry,p=t.getLayer(e),v=null!==(a=n[e])&&void 0!==a?a:n[B(e)];if(p&&v){var h=p.sourceLayer,d=y?"fill":p.type,m="".concat(o,"-").concat(e),g=v.fill,b=o===V,S=function(t){return t===V||t===Y}(o),w=function(t,e){return{lineColor:e?t.selectionStroke:t.stroke,lineWidth:e?t.strokeWidth:t.activeStrokeWidth}}(v,S),P=w.lineColor,O=w.lineWidth,I=f?["get",f]:["id"],j=["in",I,["literal",Array.from(l)]];if("fill-extrusion"!==p.type)switch(d){case"fill":!function(t,e,r,n,o){var i=o.idExpression,a=o.fill,u=o.lineColor,l=o.lineWidth,c=o.filter;if(o.isSelected){var f=[];o.fillIds.forEach(function(t){return f.push(t)});var s=["in",i,["literal",f]];tt(t,"".concat(e,"-fill"),"fill",r,n,{"fill-color":a},s)}tt(t,"".concat(e,"-line"),"line",r,n,{"line-color":u,"line-width":l},c)}(t,m,s,h,{isSelected:b,idExpression:I,fillIds:c,fill:g,lineColor:P,lineWidth:O,filter:j});break;case"line":!function(t,e,r,n,o,i,a){t.getLayer("".concat(e,"-fill"))&&t.setFilter("".concat(e,"-fill"),["==","id",""]),tt(t,"".concat(e,"-line"),"line",r,n,{"line-color":o,"line-width":i},a)}(t,m,s,h,P,O,j);break;case"symbol":!function(t,e,r,n,o,i,a){var u=t.getLayoutProperty(o,$);if(Array.isArray(u))et(t,"".concat(e,"-symbol"),r,n,o,["get",a.property],i);else{var l=a.getImageId(u);l&&et(t,"".concat(e,"-symbol"),r,n,o,l,i)}}(t,m,s,h,e,j,i)}else!function(t,e,r,n){var o=n.lineColor,i=n.lineWidth,a=n.idExpression,u=[];n.ids.forEach(function(t){return u.push(t)});var l=["in",a,["literal",u]],c=t.getLayer(r),f=c.source,s=c.sourceLayer;tt(t,"".concat(e,"-line"),"line",f,s,{"line-color":o,"line-width":i},l)}(t,m,e,{ids:l,lineColor:P,lineWidth:O,idExpression:I})}}(t,e,i,r,n,o)}),i};function nt(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,i,a,u=[],l=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.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&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return ot(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)?ot(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 ot(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 it=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 at(t,e){if(t){if("string"==typeof t)return ut(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)?ut(t,e):void 0}}function ut(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 lt=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=B(t);e&&r.add(e)}),function(t){if(Array.isArray(t))return ut(t)}(e=r)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(e)||at(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 i=function(t,e){var r,n=[],o=[],i=function(t){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=at(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,i=!0,a=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return i=t.done,t},e:function(t){a=!0,o=t},f:function(){try{i||null==e.return||e.return()}finally{if(a)throw o}}}}(e);try{for(i.s();!(r=i.n()).done;){var a=r.value;if("line"===t.getLayer(a).type){var u=a.endsWith("-stroke")?a.slice(0,-7):null;null!==u&&e.includes(u)||n.push(a)}else o.push(a)}}catch(t){i.e(t)}finally{i.f()}return{lineLayers:n,otherLayers:o}}(t,o),a=i.lineLayers,u=i.otherLayers,l=r.point,c=l.x,f=l.y,s=[[c-10,f-10],[c+10,f+10]],y=a.length>0&&t.queryRenderedFeatures(s,{layers:a}).length>0,p=u.length>0&&t.queryRenderedFeatures(r.point,{layers:u}).length>0;n.style.cursor=y||p?"pointer":""}else n.style.cursor=""};return t.on("mousemove",o),o};function ct(t){return ct="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},ct(t)}function ft(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,i,a,u=[],l=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.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&&(a=r.return(),Object(a)!==a))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}function yt(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,pt(n.key),n)}}function pt(t){var e=function(t){if("object"!=ct(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=ct(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ct(e)?e:e+""}var vt=function(){return t=function t(){var e,r,n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=this,r="sets",n=new Map,(r=pt(r))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n},(e=[{key:"add",value:function(t,e){var r,n=null!==(r=this.sets.get(t))&&void 0!==r?r:new Set;this.sets.delete(t),this.sets.set(t,n),e.forEach(function(t){return n.add(t)});for(var o=new Set;this.sets.size>2;){var i=ft(this.sets.entries().next().value,2),a=i[0],u=i[1];this.sets.delete(a),u.forEach(function(t){return o.add(t)})}return this.sets.forEach(function(t){return t.forEach(function(t){return o.delete(t)})}),Array.from(o)}}])&&yt(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function ht(t){return ht="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},ht(t)}function dt(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var l=n&&n.prototype instanceof u?n:u,c=Object.create(l.prototype);return mt(c,"_invoke",function(r,n,o){var i,u,l,c=0,f=o||[],s=!1,y={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,r){return i=e,u=0,l=t,y.n=r,a}};function p(r,n){for(u=r,l=n,e=0;!s&&c&&!o&&e<f.length;e++){var o,i=f[e],p=y.p,v=i[2];r>3?(o=v===n)&&(l=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=p&&((o=r<2&&p<i[1])?(u=0,y.v=n,y.n=i[1]):p<v&&(o=r<3||i[0]>n||n>v)&&(i[4]=r,i[5]=n,y.n=v,u=0))}if(o||r>1)return a;throw s=!0,n}return function(o,f,v){if(c>1)throw TypeError("Generator is already running");for(s&&1===f&&p(f,v),u=f,l=v;(e=u<2?t:l)||!s;){i||(u?u<3?(u>1&&(y.n=-1),p(u,l)):y.n=l:y.v=l);try{if(c=2,i){if(u||(o="next"),e=i[o]){if(!(e=e.call(i,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=i.return)&&e.call(i),u<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=t}else if((e=(s=y.n<0)?l:r.call(n,y))!==a)break}catch(e){i=t,u=1,l=e}finally{c=1}}return{value:e,done:s}}}(r,o,i),!0),c}var a={};function u(){}function l(){}function c(){}e=Object.getPrototypeOf;var f=[][n]?e(e([][n]())):(mt(e={},n,function(){return this}),e),s=c.prototype=u.prototype=Object.create(f);function y(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,mt(t,o,"GeneratorFunction")),t.prototype=Object.create(s),t}return l.prototype=c,mt(s,"constructor",c),mt(c,"constructor",l),l.displayName="GeneratorFunction",mt(c,o,"GeneratorFunction"),mt(s),mt(s,o,"Generator"),mt(s,n,function(){return this}),mt(s,"toString",function(){return"[object Generator]"}),(dt=function(){return{w:i,m:y}})()}function mt(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}mt=function(t,e,r,n){function i(e,r){mt(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:(i("next",0),i("throw",1),i("return",2))},mt(t,e,r,n)}function gt(t,e,r,n,o,i,a){try{var u=t[i](a),l=u.value}catch(t){return void r(t)}u.done?e(l):Promise.resolve(l).then(n,o)}function bt(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){gt(i,n,o,a,u,"next",t)}function u(t){gt(i,n,o,a,u,"throw",t)}a(void 0)})}}function St(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,Pt(n.key),n)}}function wt(t,e,r){return(e=Pt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Pt(t){var e=function(t){if("object"!=ht(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=ht(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ht(e)?e:e+""}function Ot(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,i,a,u=[],l=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.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&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return It(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)?It(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 It(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 jt=.25,At=.75,xt=function(t){return t<=jt?0:t>=At?1:.5},Et=function(t){return Math.round(100*t)/100},Mt=function(t,e){var r=Ot(t,2),n=r[0],o=r[1],i=Ot(e.split(" ").map(Number),4),a=i[2],u=i[3];return[Et((xt(n)-n)*a),Et((xt(o)-o)*u)]},kt=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),wt(this,"activeImageIds",new Map),wt(this,"selectedImageIds",new Map),wt(this,"recentImageSets",new vt),this.map=e},e=[{key:"getActiveImageId",value:function(t){var e;return null!==(e=this.activeImageIds.get(t))&&void 0!==e?e:null}},{key:"getSelectedImageId",value:function(t){var e;return null!==(e=this.selectedImageIds.get(t))&&void 0!==e?e:null}},{key:"removeImage",value:function(t){this.map.hasImage(t)&&this.map.removeImage(t),this.activeImageIds.delete(t),this.selectedImageIds.delete(t)}},{key:"registerSymbols",value:(r=bt(dt().m(function t(e,r,n,o){var i,a,u=this;return dt().w(function(t){for(;;)switch(t.n){case 0:return i=this.map,t.n=1,Promise.all(e.map(function(){var t=bt(dt().m(function t(e){var a;return dt().w(function(t){for(;;)switch(t.n){case 0:if(a=n.getSymbolImageIds(e,r,o)){t.n=1;break}return t.a(2,[]);case 1:return u.activeImageIds.set(a.normal,a.active),u.selectedImageIds.set(a.normal,a.selected),t.n=2,Promise.all(Object.entries(a).map(function(){var t=bt(dt().m(function t(a){var u,l,c,f;return dt().w(function(t){for(;;)switch(t.n){case 0:if(u=Ot(a,2),l=u[0],c=u[1],!i.hasImage(c)){t.n=1;break}return t.a(2);case 1:return t.n=2,n.rasteriseSymbolImage(e,r,l,o);case 2:(f=t.v)&&!i.hasImage(f.imageId)&&i.addImage(f.imageId,f.imageData,{pixelRatio:o});case 3:return t.a(2)}},t)}));return function(e){return t.apply(this,arguments)}}()));case 2:return t.a(2,Object.values(a))}},t)}));return function(e){return t.apply(this,arguments)}}()));case 1:a=t.v,this.recentImageSets.add("".concat(null==r?void 0:r.id,"|").concat(o),a.flat()).forEach(function(t){return u.removeImage(t)});case 2:return t.a(2)}},t,this)})),function(t,e,n,o){return r.apply(this,arguments)})}],e&&St(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}(),Lt=function(t){return Math.max(2,2*t)};function Tt(t){return Tt="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},Tt(t)}function _t(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var l=n&&n.prototype instanceof u?n:u,c=Object.create(l.prototype);return Ct(c,"_invoke",function(r,n,o){var i,u,l,c=0,f=o||[],s=!1,y={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,r){return i=e,u=0,l=t,y.n=r,a}};function p(r,n){for(u=r,l=n,e=0;!s&&c&&!o&&e<f.length;e++){var o,i=f[e],p=y.p,v=i[2];r>3?(o=v===n)&&(l=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=p&&((o=r<2&&p<i[1])?(u=0,y.v=n,y.n=i[1]):p<v&&(o=r<3||i[0]>n||n>v)&&(i[4]=r,i[5]=n,y.n=v,u=0))}if(o||r>1)return a;throw s=!0,n}return function(o,f,v){if(c>1)throw TypeError("Generator is already running");for(s&&1===f&&p(f,v),u=f,l=v;(e=u<2?t:l)||!s;){i||(u?u<3?(u>1&&(y.n=-1),p(u,l)):y.n=l:y.v=l);try{if(c=2,i){if(u||(o="next"),e=i[o]){if(!(e=e.call(i,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=i.return)&&e.call(i),u<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=t}else if((e=(s=y.n<0)?l:r.call(n,y))!==a)break}catch(e){i=t,u=1,l=e}finally{c=1}}return{value:e,done:s}}}(r,o,i),!0),c}var a={};function u(){}function l(){}function c(){}e=Object.getPrototypeOf;var f=[][n]?e(e([][n]())):(Ct(e={},n,function(){return this}),e),s=c.prototype=u.prototype=Object.create(f);function y(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,Ct(t,o,"GeneratorFunction")),t.prototype=Object.create(s),t}return l.prototype=c,Ct(s,"constructor",c),Ct(c,"constructor",l),l.displayName="GeneratorFunction",Ct(c,o,"GeneratorFunction"),Ct(s),Ct(s,o,"Generator"),Ct(s,n,function(){return this}),Ct(s,"toString",function(){return"[object Generator]"}),(_t=function(){return{w:i,m:y}})()}function Ct(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}Ct=function(t,e,r,n){function i(e,r){Ct(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:(i("next",0),i("throw",1),i("return",2))},Ct(t,e,r,n)}function Ft(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,i,a,u=[],l=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.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&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Rt(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)?Rt(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 Rt(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 Dt(t,e,r,n,o,i,a){try{var u=t[i](a),l=u.value}catch(t){return void r(t)}u.done?e(l):Promise.resolve(l).then(n,o)}function Bt(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){Dt(i,n,o,a,u,"next",t)}function u(t){Dt(i,n,o,a,u,"throw",t)}a(void 0)})}}function Gt(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,zt(n.key),n)}}function zt(t){var e=function(t){if("object"!=Tt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Tt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Tt(e)?e:e+""}var Nt=function(){return t=function t(e){var r,n,o;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),r=this,n="recentImageSets",o=new vt,(n=zt(n))in r?Object.defineProperty(r,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[n]=o,this.map=e},e=[{key:"registerPatterns",value:(r=Bt(_t().m(function t(e,r,n,o){var i,a,u;return _t().w(function(t){for(;;)switch(t.n){case 0:return i=this.map,a=new Map,e.forEach(function(t){var e=n.getPatternImageId(t,r,o);e&&!a.has(e)&&a.set(e,t)}),u=Lt(o),t.n=1,Promise.all(Array.from(a,function(){var t=Bt(_t().m(function t(e){var a,l,c,f;return _t().w(function(t){for(;;)switch(t.n){case 0:if(a=Ft(e,2),l=a[0],c=a[1],!i.hasImage(l)){t.n=1;break}return t.a(2);case 1:return t.n=2,n.rasterisePatternImage(c,r,o);case 2:(f=t.v)&&!i.hasImage(f.imageId)&&i.addImage(f.imageId,f.imageData,{pixelRatio:u});case 3:return t.a(2)}},t)}));return function(e){return t.apply(this,arguments)}}()));case 1:this.recentImageSets.add("".concat(r,"|").concat(o),Array.from(a.keys())).forEach(function(t){i.hasImage(t)&&i.removeImage(t)});case 2:return t.a(2)}},t,this)})),function(t,e,n,o){return r.apply(this,arguments)})}],e&&Gt(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Zt(t){return Zt="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},Zt(t)}var Ht=["container","padding","mapStyle","mapSize","center","zoom","bounds","pixelRatio"];function Wt(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var l=n&&n.prototype instanceof u?n:u,c=Object.create(l.prototype);return Ut(c,"_invoke",function(r,n,o){var i,u,l,c=0,f=o||[],s=!1,y={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,r){return i=e,u=0,l=t,y.n=r,a}};function p(r,n){for(u=r,l=n,e=0;!s&&c&&!o&&e<f.length;e++){var o,i=f[e],p=y.p,v=i[2];r>3?(o=v===n)&&(l=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=p&&((o=r<2&&p<i[1])?(u=0,y.v=n,y.n=i[1]):p<v&&(o=r<3||i[0]>n||n>v)&&(i[4]=r,i[5]=n,y.n=v,u=0))}if(o||r>1)return a;throw s=!0,n}return function(o,f,v){if(c>1)throw TypeError("Generator is already running");for(s&&1===f&&p(f,v),u=f,l=v;(e=u<2?t:l)||!s;){i||(u?u<3?(u>1&&(y.n=-1),p(u,l)):y.n=l:y.v=l);try{if(c=2,i){if(u||(o="next"),e=i[o]){if(!(e=e.call(i,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=i.return)&&e.call(i),u<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=t}else if((e=(s=y.n<0)?l:r.call(n,y))!==a)break}catch(e){i=t,u=1,l=e}finally{c=1}}return{value:e,done:s}}}(r,o,i),!0),c}var a={};function u(){}function l(){}function c(){}e=Object.getPrototypeOf;var f=[][n]?e(e([][n]())):(Ut(e={},n,function(){return this}),e),s=c.prototype=u.prototype=Object.create(f);function y(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,Ut(t,o,"GeneratorFunction")),t.prototype=Object.create(s),t}return l.prototype=c,Ut(s,"constructor",c),Ut(c,"constructor",l),l.displayName="GeneratorFunction",Ut(c,o,"GeneratorFunction"),Ut(s),Ut(s,o,"Generator"),Ut(s,n,function(){return this}),Ut(s,"toString",function(){return"[object Generator]"}),(Wt=function(){return{w:i,m:y}})()}function Ut(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}Ut=function(t,e,r,n){function i(e,r){Ut(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:(i("next",0),i("throw",1),i("return",2))},Ut(t,e,r,n)}function $t(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 qt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?$t(Object(r),!0).forEach(function(e){Yt(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):$t(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function Yt(t,e,r){return(e=Qt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Vt(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 i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)r=i[n],-1===e.indexOf(r)&&{}.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function Jt(t,e,r,n,o,i,a){try{var u=t[i](a),l=u.value}catch(t){return void r(t)}u.done?e(l):Promise.resolve(l).then(n,o)}function Kt(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){Jt(i,n,o,a,u,"next",t)}function u(t){Jt(i,n,o,a,u,"throw",t)}a(void 0)})}}function Xt(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,Qt(n.key),n)}}function Qt(t){var e=function(t){if("object"!=Zt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Zt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Zt(e)?e:e+""}function te(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(te=function(){return!!t})()}function ee(t){return ee=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ee(t)}function re(t,e){return re=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},re(t,e)}var ne=function(t){function e(t){var r,n=t.mapFramework,o=t.mapProviderConfig,i=void 0===o?{}:o,a=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=function(t,e,r){return e=ee(e),function(t,e){if(e&&("object"==Zt(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,te()?Reflect.construct(e,r||[],ee(t).constructor):e.apply(t,r))}(this,e)).maplibreModule=n,r.events=a,r.eventBus=u,r.capabilities={supportedShortcuts:l,supportsMapSizes:!0},Object.assign(r,i),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&&re(t,e)}(e,t),r=e,n=[{key:"name",get:function(){return"MapLibreProvider"}},{key:"initMap",value:(a=Kt(Wt().m(function t(e){var r,n,o,i,a,u,l,s,y,h,d,m,g,b=this;return Wt().w(function(t){for(;;)switch(t.n){case 0:r=e.container,n=e.padding,o=e.mapStyle,i=e.mapSize,a=e.center,u=e.zoom,l=e.bounds,s=e.pixelRatio,y=Vt(e,Ht),this.mapStyleId=null==o?void 0:o.id,this.mapSize=i,h=this.maplibreModule.Map,d=this.events,m=this.eventBus,(g=new h(qt(qt({},y),{},{container:r,style:null==o?void 0:o.url,pixelRatio:s,padding:n,center:a,zoom:u,fadeDuration:0,attributionControl:!1,dragRotate:!1,doubleClickZoom:!1}))).touchZoomRotate.disableRotation(),this.map=g,this.symbolImages=new kt(g),this.patternImages=new Nt(g),this.map.setPadding(n),l&&g.fitBounds(l,{duration:0}),f(g),c(g),p({map:g,events:d,eventBus:m,getCenter:this.getCenter.bind(this),getZoom:this.getZoom.bind(this),getBounds:this.getBounds.bind(this),getResolution:this.getResolution.bind(this)}),v({mapProvider:this,map:g,events:d,eventBus:m}),g.on("load",function(){b.labelNavigator=D(g,null==o?void 0:o.mapColorScheme,d,m)}),this.eventBus.emit(d.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 a.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=lt(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=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).padding,r=Array.isArray(t)?t:d(t),n=this.map.isStyleLoaded()?u:0;this.map.fitBounds(r,qt({duration:n},e&&{padding:e}))}},{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,i=t.stylesMap,a=t.symbolImages;if(!r)return null;var u=J(a,"active"),l=J(a,"selected");null!=o&&o.length?(rt(r,o,i,q,u),rt(r,o,i,Y,l)):(Q(r,q),Q(r,Y));var c={};null!=n&&n.length?c=rt(r,n,i,V,l):Q(r,V);var f=[];return Object.entries(c).forEach(function(t){var e=z(t,2),n=e[0],o=e[1],i=o.ids,a=o.idProperty;f.push.apply(f,function(t){return function(t){if(Array.isArray(t))return Z(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||N(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 i.has(a?null===(e=t.properties)||void 0===e?void 0:e[a]: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,f)}({LngLatBounds:this.maplibreModule.LngLatBounds,map:this.map,selectedFeatures:t,activeFeatures:e,stylesMap:r,symbolImages:this.symbolImages})}},{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]],i=t.queryRenderedFeatures(o);if(0===i.length)return[];var a=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=[];i.forEach(function(t){!1===u.includes(t.layer.id)&&u.push(t.layer.id)});for(var l=new Set,c=[],f=i.length-1;f>=0;f--){var s,y=i[f],p=void 0===y.id?JSON.stringify(y.properties):y.id,v="".concat(null===(s=y.layer)||void 0===s?void 0:s.source,":").concat(p);!1===l.has(v)&&(l.add(v),c.push(y))}var h=t.unproject(e),d=[h.lng,h.lat],m=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=nt(t,2),n=r[0],o=r[1],i=!1,a=0,u=e.length-1;a<e.length;u=a,a++){var l=nt(e[a],2),c=l[0],f=l[1],s=nt(e[u],2),y=s[0],p=s[1];f>o!=p>o&&n<(y-c)*(o-f)/(p-f)+c&&(i=!i)}return i}(d,t[0])});if("Point"===e||"MultiPoint"===e){var r,n=void 0===t.id?JSON.stringify(t.properties):t.id;return a.has("".concat(null===(r=t.layer)||void 0===r?void 0:r.source,":").concat(n))}return!0});return m.map(function(r){var n=0,o=r.geometry.type,i=function(t,e,r){var n=r.coordinates,o=r.type,i=1/0,a=function(e){return t.project(e)},u=function(t){for(var r=0;r<t.length-1;r++){var n=it(e,a(t[r]),a(t[r+1]));n<i&&(i=n)}};if("Point"===o){var l=a(n);i=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=a(t),n=Math.pow(e.x-r.x,2)+Math.pow(e.y-r.y,2);n<i&&(i=n)}):"Polygon"===o||"MultiLineString"===o?n.forEach(u):"MultiPolygon"===o&&n.forEach(function(t){return t.forEach(u)});return i}(t,e,r.geometry);return n+=1e6*u.indexOf(r.layer.id),o.includes("Polygon")&&(n-=5e5),{f:r,score:n+=i}}).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:(i=Kt(Wt().m(function t(e,r,n){var o,i=arguments;return Wt().w(function(t){for(;;)if(0===t.n)return o=i.length>3&&void 0!==i[3]?i[3]:this.map.getPixelRatio()||1,t.a(2,this.symbolImages.registerSymbols(e,r,n,o))},t,this)})),function(t,e,r){return i.apply(this,arguments)})},{key:"getSymbolIconLayout",value:function(t){return l=(u=t).anchor,c=u.viewBox,{"icon-anchor":(e=l,r=Ot(e,2),n=r[0],o=r[1],i=function(t){return t<=jt?"left":t>=At?"right":""}(n),a=function(t){return t<=jt?"top":t>=At?"bottom":""}(o),a+(i&&a?"-":"")+i||"center"),"icon-offset":Mt(l,c)};var e,r,n,o,i,a,u,l,c}},{key:"getActiveSymbolImageId",value:function(t){var e,r;return null!==(e=null===(r=this.symbolImages)||void 0===r?void 0:r.getActiveImageId(t))&&void 0!==e?e:null}},{key:"getSelectedSymbolImageId",value:function(t){var e,r;return null!==(e=null===(r=this.symbolImages)||void 0===r?void 0:r.getSelectedImageId(t))&&void 0!==e?e:null}},{key:"addPatternsToMap",value:(o=Kt(Wt().m(function t(e,r,n){var o,i=arguments;return Wt().w(function(t){for(;;)if(0===t.n)return o=i.length>3&&void 0!==i[3]?i[3]:this.map.getPixelRatio()||1,t.a(2,this.patternImages.registerPatterns(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 i=m(t,2),a=m(i[0],2);e=a[0],r=a[1];var u=m(i[1],2);n=u[0],o=u[1]}var l=P([e,r],[n,r]),c=P([e,r],[e,o]),f=O(l),s=O(c);return"".concat(s," by ").concat(f)}((t=this.maplibreModule.LngLatBounds,e=this.map,r=e.getContainer().getBoundingClientRect(),n=r.width,o=r.height,i=e.getPadding(),a=[i.left,o-i.bottom],u=[n-i.right,i.top],new t(e.unproject(a),e.unproject(u))));var t,e,r,n,o,i,a,u}},{key:"getCardinalMove",value:function(t,e){return function(t,e){var r=m(t,2),n=r[0],o=r[1],i=m(e,2),a=i[0],u=i[1],l=u-o,c=a-n,f=[];if(Math.abs(l)>S){var s=Math.round(P([n,o],[n,u]));f.push("".concat(l>0?"north":"south"," ").concat(O(s)))}if(Math.abs(c)>S){var y=Math.round(P([n,o],[a,o]));f.push("".concat(c>0?"east":"west"," ").concat(O(y)))}return f.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(w(r))/(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]}}],n&&Xt(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o,i,a}(a)}}]);
|
|
@@ -7,7 +7,7 @@ import { DEFAULTS, supportedShortcuts } from './defaults.js'
|
|
|
7
7
|
import { cleanCanvas, applyPreventDefaultFix } from './utils/maplibreFixes.js'
|
|
8
8
|
import { attachMapEvents } from './mapEvents.js'
|
|
9
9
|
import { attachAppEvents } from './appEvents.js'
|
|
10
|
-
import { getAreaDimensions, getCardinalMove, getBboxFromGeoJSON,
|
|
10
|
+
import { getAreaDimensions, getCardinalMove, getBboxFromGeoJSON, getResolution, getPaddedBounds } from './utils/spatial.js'
|
|
11
11
|
import { createMapLabelNavigator } from './utils/labels.js'
|
|
12
12
|
import { updateHighlightedFeatures } from './utils/highlightFeatures.js'
|
|
13
13
|
import { queryFeatures } from './utils/queryFeatures.js'
|
|
@@ -206,11 +206,13 @@ export default class MapLibreProvider extends MapProvider {
|
|
|
206
206
|
* Fit map view to the specified bounds or GeoJSON geometry.
|
|
207
207
|
*
|
|
208
208
|
* @param {[number, number, number, number] | object} bounds - Bounds as [west, south, east, north], or a GeoJSON Feature, FeatureCollection, or geometry. Bbox is computed from GeoJSON using @turf/bbox.
|
|
209
|
+
* @param {Object} [options]
|
|
210
|
+
* @param {{ top: number, right: number, bottom: number, left: number }} [options.padding] - Extra space in pixels kept around the bounds, inside the map's padding.
|
|
209
211
|
*/
|
|
210
|
-
fitToBounds (bounds) {
|
|
212
|
+
fitToBounds (bounds, { padding } = {}) {
|
|
211
213
|
const bbox = Array.isArray(bounds) ? bounds : getBboxFromGeoJSON(bounds)
|
|
212
214
|
const duration = this.map.isStyleLoaded() ? DEFAULTS.animationDuration : 0
|
|
213
|
-
this.map.fitBounds(bbox, { duration })
|
|
215
|
+
this.map.fitBounds(bbox, { duration, ...(padding && { padding }) })
|
|
214
216
|
}
|
|
215
217
|
|
|
216
218
|
/**
|
|
@@ -438,15 +440,4 @@ export default class MapLibreProvider extends MapProvider {
|
|
|
438
440
|
const { lng, lat } = this.map.unproject([point.x, point.y])
|
|
439
441
|
return [lng, lat]
|
|
440
442
|
}
|
|
441
|
-
|
|
442
|
-
/**
|
|
443
|
-
* Returns true if the geometry's screen bounding box overlaps the given panel rectangle.
|
|
444
|
-
*
|
|
445
|
-
* @param {object} geojson - GeoJSON Feature, FeatureCollection, or geometry.
|
|
446
|
-
* @param {DOMRect} panelRect - Bounding rect of the panel element (viewport coordinates).
|
|
447
|
-
* @returns {boolean}
|
|
448
|
-
*/
|
|
449
|
-
isGeometryObscured (geojson, panelRect) {
|
|
450
|
-
return isGeometryObscured(geojson, panelRect, this.map)
|
|
451
|
-
}
|
|
452
443
|
}
|