@defra/interactive-map 0.0.50-alpha → 0.0.51-apha

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.
Files changed (76) hide show
  1. package/dist/esm/im-core.js +1 -1
  2. package/dist/umd/im-core.js +1 -1
  3. package/docs/api.md +19 -0
  4. package/docs/architecture.md +14 -0
  5. package/docs/getting-started.md +10 -0
  6. package/docs/plugins/datasets.md +9 -3
  7. package/jest.setup.js +8 -0
  8. package/package.json +8 -3
  9. package/plugins/datasets/dist/esm/im-datasets-ml-adapter.js +1 -1
  10. package/plugins/datasets/dist/esm/im-datasets-ol-adapter.js +1 -0
  11. package/plugins/datasets/dist/esm/im-datasets-plugin.js +1 -1
  12. package/plugins/datasets/dist/umd/im-datasets-ml-adapter.js +1 -1
  13. package/plugins/datasets/dist/umd/im-datasets-ol-adapter.js +2 -0
  14. package/plugins/datasets/dist/umd/im-datasets-ol-adapter.js.LICENSE.txt +1 -0
  15. package/plugins/datasets/dist/umd/im-datasets-plugin.js +1 -1
  16. package/plugins/datasets/dist/umd/index.js +1 -1
  17. package/plugins/datasets/src/adapters/loadLayerAdapter.js +7 -3
  18. package/plugins/datasets/src/adapters/loadLayerAdapter.test.js +17 -0
  19. package/plugins/datasets/src/adapters/mapboxStyleLayerAdapter.js +74 -0
  20. package/plugins/datasets/src/adapters/maplibre/maplibreLayerAdapter.js +14 -79
  21. package/plugins/datasets/src/adapters/maplibre/maplibreLayerAdapter.test.js +4 -0
  22. package/plugins/datasets/src/adapters/maplibre/registry/mapLibreDataset.js +3 -89
  23. package/plugins/datasets/src/adapters/openlayers/canvasPatternStyle.js +111 -0
  24. package/plugins/datasets/src/adapters/openlayers/canvasPatternStyle.test.js +198 -0
  25. package/plugins/datasets/src/adapters/openlayers/layerBuilders.js +205 -0
  26. package/plugins/datasets/src/adapters/openlayers/layerBuilders.test.js +233 -0
  27. package/plugins/datasets/src/adapters/openlayers/openlayersLayerAdapter.js +276 -0
  28. package/plugins/datasets/src/adapters/openlayers/openlayersLayerAdapter.test.js +431 -0
  29. package/plugins/datasets/src/adapters/openlayers/registry/openLayersDataset.js +172 -0
  30. package/plugins/datasets/src/adapters/openlayers/registry/openLayersDataset.test.js +262 -0
  31. package/plugins/datasets/src/fetch/createDynamicSource.js +12 -8
  32. package/plugins/datasets/src/fetch/createDynamicSource.test.js +61 -52
  33. package/plugins/datasets/src/initialise/DatasetsInit.jsx +13 -1
  34. package/plugins/datasets/src/initialise/DatasetsInit.test.jsx +20 -0
  35. package/plugins/datasets/src/initialise/initialiseDatasets.js +1 -1
  36. package/plugins/datasets/src/initialise/initialiseDatasets.test.js +1 -1
  37. package/plugins/datasets/src/registry/mapboxStyleDataset.js +108 -0
  38. package/plugins/datasets/src/registry/mapboxStyleDataset.test.js +240 -0
  39. package/plugins/datasets/src/utils/bbox.js +5 -7
  40. package/plugins/datasets/src/utils/bbox.test.js +3 -10
  41. package/plugins/draw/dist/css/index.css +1 -0
  42. package/plugins/draw/dist/umd/im-draw-ol-adapter.js +1 -1
  43. package/plugins/draw/dist/umd/im-draw-plugin.js +1 -1
  44. package/plugins/draw/src/index.js +2 -0
  45. package/plugins/draw/src/index.test.js +1 -0
  46. package/plugins/map-key/dist/esm/im-map-key-plugin.js +1 -1
  47. package/plugins/map-key/dist/umd/im-map-key-plugin.js +1 -1
  48. package/providers/beta/openlayers/dist/esm/im-openlayers-provider.js +1 -1
  49. package/providers/beta/openlayers/dist/umd/im-openlayers-provider.js +1 -1
  50. package/providers/beta/openlayers/dist/umd/index.js +1 -1
  51. package/providers/beta/openlayers/src/index.js +16 -0
  52. package/providers/beta/openlayers/src/openlayersProvider.js +160 -7
  53. package/providers/beta/openlayers/src/openlayersProvider.test.js +13 -0
  54. package/providers/beta/openlayers/src/utils/bngProjection.js +9 -0
  55. package/providers/beta/openlayers/src/utils/filterEvaluator.js +32 -0
  56. package/providers/beta/openlayers/src/utils/filterEvaluator.test.js +36 -0
  57. package/providers/beta/openlayers/src/utils/highlightFeatures.js +38 -23
  58. package/providers/beta/openlayers/src/utils/highlightFeatures.test.js +153 -8
  59. package/providers/beta/openlayers/src/utils/hoverCursor.js +5 -1
  60. package/providers/beta/openlayers/src/utils/hoverCursor.test.js +40 -0
  61. package/providers/beta/openlayers/src/utils/queryFeatures.js +72 -54
  62. package/providers/beta/openlayers/src/utils/queryFeatures.test.js +143 -1
  63. package/providers/beta/openlayers/src/utils/symbolImages.js +79 -5
  64. package/providers/beta/openlayers/src/utils/symbolImages.test.js +111 -1
  65. package/providers/beta/openlayers/src/utils/vtTileFragments.js +20 -8
  66. package/providers/beta/openlayers/src/utils/vtTileFragments.test.js +162 -0
  67. package/providers/maplibre/dist/esm/im-maplibre-provider.js +1 -1
  68. package/providers/maplibre/dist/umd/im-maplibre-provider.js +1 -1
  69. package/providers/maplibre/dist/umd/index.js +1 -1
  70. package/providers/maplibre/src/utils/patternImages.js +4 -44
  71. package/rollup.esm.mjs +2 -0
  72. package/src/services/patternRegistry.js +38 -0
  73. package/src/services/patternRegistry.test.js +61 -0
  74. package/src/types.js +11 -0
  75. package/webpack.dev.mjs +1 -0
  76. /package/plugins/datasets/dist/esm/{esriLayerAdapter.js → im-datasets-esri-adapter.js} +0 -0
@@ -1,3 +1,5 @@
1
+ import './draw.scss'
2
+
1
3
  export default function createPlugin (options = {}) {
2
4
  return {
3
5
  ...options,
@@ -1,6 +1,7 @@
1
1
  import createPlugin from './index.js'
2
2
  import { manifest } from './manifest.js'
3
3
 
4
+ jest.mock('./draw.scss', () => {})
4
5
  jest.mock('./manifest.js', () => ({ manifest: { id: 'draw-manifest' } }))
5
6
 
6
7
  describe('createPlugin', () => {
@@ -1 +1 @@
1
- import{useState as e,useEffect as t,useRef as r}from"preact/compat";import{jsx as o,jsxs as n}from"preact/jsx-runtime";import i from"@babel/runtime/helpers/defineProperty";import l from"@babel/runtime/helpers/asyncToGenerator";var a=null,c=e=>a=e,s={"cross-hatch":'<path d="M0 4.486V3.485h3.5V.001h1v3.484h7.002V.001h1v3.484h3.5v1.001h-3.5v7h3.5v.999h-3.5v3.516h-1v-3.516H4.499v3.516h-1v-3.516H0v-.999h3.5v-7H0zm11.501 0H4.499v7h7.002v-7z" fill="{{foregroundColor}}"/>',"diagonal-cross-hatch":'<path d="M0 8.707V7.293L7.293 0h1.414L16 7.293v1.414L8.707 16H7.293L0 8.707zM.707 8L8 15.293 15.293 8 8 .707.707 8z" fill="{{foregroundColor}}"/>',"forward-diagonal-hatch":'<path d="M16 8.707V7.293L7.293 16h1.414L16 8.707zm-16 0L8.707 0H7.293L0 7.293v1.414z" fill="{{foregroundColor}}"/>',"backward-diagonal-hatch":'<path d="M0 8.707V7.293L8.707 16H7.293L0 8.707zm16 0L7.293 0h1.414L16 7.293v1.414z" fill="{{foregroundColor}}"/>',"horizontal-hatch":'<path d="M0 4.5V3.499h15.999V4.5H0zm0 7h15.999V12.5H0v-1.001z" fill="{{foregroundColor}}"/>',"vertical-hatch":'<path d="M3.501 16.001V0h1v16.001h-1zm7.998 0V0h1v16.001h-1z" fill="{{foregroundColor}}"/>',dot:'<path d="M3.999 2A2 2 0 0 1 6 3.999C6 5.103 5.103 6 3.999 6a2 2 0 0 1-1.999-2.001A2 2 0 0 1 3.999 2zm0 7.999C5.103 10 6 10.897 6 12.001A2 2 0 0 1 3.999 14a2 2 0 0 1-1.999-1.999A2 2 0 0 1 3.999 10zM11.999 2A2 2 0 0 1 14 3.999C14 5.103 13.103 6 11.999 6S10 5.103 10 3.999A2 2 0 0 1 11.999 2zm0 7.999c1.104 0 2.001.897 2.001 2.001A2 2 0 0 1 11.999 14 2 2 0 0 1 10 12.001c0-1.104.897-2.001 1.999-2.001z" fill="{{foregroundColor}}"/>',diamond:'<path d="M4 .465L7.535 4 4 7.535.465 4 4 .465zm0 7.999l3.535 3.535L4 15.535.465 11.999 4 8.464zm8-8l3.535 3.535-3.536 3.536L8.464 4 12 .464zm0 8.001L15.536 12 12 15.536 8.465 12 12 8.465z" fill="{{foregroundColor}}"/>'},p=(e,t)=>{if(!e)return null;if("string"==typeof e)return e.trim();if("object"==typeof e){if(t&&e[t])return e[t];var r=Object.values(e)[0];return null!=r?r:null}return null},u=(e,t,r)=>e.replace(/\{\{foregroundColor\}\}/g,t||"black").replace(/\{\{backgroundColor\}\}/g,r),f=new Map,y={register(e,t){f.set(e,{id:e,svgContent:t})},get:e=>f.get(e),list:()=>[...f.values()],clear(){f.clear()},initialise(){Object.entries(s).forEach(e=>{var[t,r]=e;this.register(t,r)})},getPatternInnerContent(e){return e.fillPatternSvgContent?e.fillPatternSvgContent:e.fillPattern&&null!==(t=null===(r=this.get(e.fillPattern))||void 0===r?void 0:r.svgContent)&&void 0!==t?t:null;var t,r},getKeyPatternPaths(e,t){var r=this.getPatternInnerContent(e);if(!r)return null;var o=p(e.fillPatternForegroundColor,t)||"black",n=p(e.fillPatternBackgroundColor,t)||"transparent",i=p(e.stroke,t)||o;return{border:u('<path d="M19 2.862v14.275c0 1.028-.835 1.862-1.862 1.862H2.863c-1.028 0-1.862-.835-1.862-1.862V2.862C1.001 1.834 1.836 1 2.863 1h14.275C18.166 1 19 1.835 19 2.862z" fill="{{backgroundColor}}" stroke="{{foregroundColor}}" stroke-width="2"/>',i,n),content:u(r,o,n)}},getPatternImageId(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=this.getPatternInnerContent(e);if(!o)return null;var n=p(e.fillPatternForegroundColor,t)||"black",i=p(e.fillPatternBackgroundColor,t)||"transparent",l=(e=>Math.max(2,2*e))(r);return"pattern-".concat((e=>{var t=0;for(var r of e)t=Math.trunc((t<<5)-t+r.codePointAt(0));return Math.abs(t).toString(36)})(o+n+i),"-").concat(l,"x")}};y.initialise();var d={symbol:"pin",backgroundColor:"#ca3535",foregroundColor:"#ffffff"},g={dot:"M8 3c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.241 5-5-2.24-5-5-5z",cross:"M6 3H10V6H13V10H10V13H6V10H3V6H6Z",diamond:"M8 2L14 8L8 14L2 8Z",triangle:"M8 2L14 14H2Z",square:"M3 3H13V13H3Z"},h={id:"pin",viewBox:"0 0 44 44",anchor:[.5,.9],graphic:g.dot,svg:'<path d="M22 40.999c-3.621 0-8.306-5.864-10.258-8.3C9.02 29.302 6 23.66 6 19.002a16.01 16.01 0 0 1 16-16 16.01 16.01 0 0 1 16 16c0 4.658-3.02 10.3-5.742 13.697-1.952 2.437-6.637 8.3-10.258 8.3z" fill="{{selectedColor}}" stroke="{{activeColor}}" stroke-width="6" paint-order="stroke fill"/>\n <path d="M22 7.001a12.01 12.01 0 0 1 12 12c0 7.623-10.377 17.998-12 17.998S10 26.624 10 19.001a12.01 12.01 0 0 1 12-12z" fill="{{backgroundColor}}" stroke="{{haloColor}}" stroke-width="2" paint-order="stroke fill"/>\n <g transform="translate(22, 19) scale(0.8) translate(-8, -8)"><path d="{{graphic}}" fill="{{foregroundColor}}"/></g>'},v={id:"circle",viewBox:"0 0 44 44",anchor:[.5,.5],graphic:g.dot,svg:'<circle cx="22" cy="22" r="16" fill="{{selectedColor}}" stroke="{{activeColor}}" stroke-width="6" paint-order="stroke fill"/>\n <circle cx="22" cy="22" r="12" fill="{{backgroundColor}}" stroke="{{haloColor}}" stroke-width="2" paint-order="stroke fill"/>\n <g transform="translate(22, 22) scale(0.8) translate(-8, -8)"><path d="{{graphic}}" fill="{{foregroundColor}}"/></g>'},m={id:"square",viewBox:"0 0 44 44",anchor:[.5,.5],graphic:g.dot,svg:'<path d="M13 6h18c3.863 0 7 3.137 7 7v18c0 3.863-3.137 7-7 7H13c-3.863 0-7-3.137-7-7V13c0-3.863 3.137-7 7-7" fill="{{selectedColor}}" stroke="{{activeColor}}" stroke-width="6" paint-order="stroke fill"/>\n <path d="M13 34a3 3 0 0 1-3-3V13a3 3 0 0 1 3-3h18a3 3 0 0 1 3 3v18a3 3 0 0 1-3 3H13z" fill-rule="nonzero" fill="{{backgroundColor}}" stroke="{{haloColor}}" stroke-width="2" paint-order="stroke fill"/>\n <g transform="translate(22, 22) scale(0.8) translate(-8, -8)"><path d="{{graphic}}" fill="{{foregroundColor}}"/></g>'},b=new Set(["symbolBackgroundColor","symbolForegroundColor","symbolHaloWidth","symbolGraphic"]),O=e=>{if(!(e=>!(!e.symbol&&!e.symbolSvgContent))(e))return{};var t={};return b.forEach(r=>{if(null!=e[r]){var o=r.charAt(6).toLowerCase()+r.slice(7);t[o]=e[r]}}),t},j=(e,t)=>{var r;return e.symbolViewBox?e.symbolViewBox:null!==(r=null==t?void 0:t.viewBox)&&void 0!==r?r:"0 0 38 38"},k={light:{haloColor:"#ffffff",selectedColor:"#0b0c0c",activeColor:"#ffdd00",foregroundColor:"#0b0c0c"},dark:{haloColor:"#0b0c0c",selectedColor:"#ffffff",activeColor:"#ffdd00",foregroundColor:"#ffffff"}};function w(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,o)}return r}function S(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?w(Object(r),!0).forEach(function(t){i(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):w(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var P=new Map,D=new Map,C={},M=e=>{var t=0;for(var r of e)t=Math.trunc((t<<5)-t+r.codePointAt(0));return Math.abs(t).toString(36)},L=new Set(["id","svg","viewBox","anchor","symbol","symbolSvgContent"]);function E(e,t,r){var o,n,i,l,a=null==r?void 0:r.id,c=Object.fromEntries(Object.entries(e||{}).filter(e=>{var[t]=e;return!L.has(t)})),s=Object.fromEntries(Object.entries(C).filter(e=>{var[t]=e;return!L.has(t)})),u=Object.fromEntries(Object.entries(t).filter(e=>{var[,t]=e;return null!=t})),f=S(S(S(S({},d),s),c),u),y=null!==(o=k[null==r?void 0:r.mapColorScheme])&&void 0!==o?o:k.light;return f.haloColor=null!==(n=null==r?void 0:r.haloColor)&&void 0!==n?n:y.haloColor,f.selectedColor=null!==(i=null==r?void 0:r.selectedColor)&&void 0!==i?i:y.selectedColor,f.activeColor=null!==(l=null==r?void 0:r.activeColor)&&void 0!==l?l:y.activeColor,"string"==typeof f.graphic&&g[f.graphic]&&(f.graphic=g[f.graphic]),Object.fromEntries(Object.entries(f).map(e=>{var[t,r]=e;return[t,p(r,a)||""]}))}function x(e,t){return Object.entries(t).reduce((e,t)=>{var[r,o]=t;return e.replaceAll("{{".concat(r,"}}"),o)},e)}var I={setDefaults(e){C=e||{}},getDefaults:()=>S(S({},d),C),register(e){P.set(e.id,e)},get:e=>P.get(e),list:()=>[...P.values()],clear(){P.clear()},initialise(){this.register(h),this.register(v),this.register(m)},resolve(e,t,r){var o=E(e,t||{},r);return e?(o.selectedColor="none",o.activeColor="none",x(e.svg,o)):""},resolveActive(e,t,r){var o=E(e,t||{},r);return e?x(e.svg,o):""},resolveSelected(e,t,r){var o=E(e,t||{},r);return e?(o.activeColor="none",x(e.svg,o)):""},getSymbolImageId(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2,n=this.getSymbolDef(e);if(!n)return null;var i=O(e),l=r?this.resolveActive(n,i,t):this.resolve(n,i,t);return"symbol-".concat(r?"act-":"").concat(M(l),"-").concat(o,"x")},getSymbolDef(e){return e.symbolSvgContent?{svg:e.symbolSvgContent}:e.symbol?this.get(e.symbol):void 0},rasteriseSymbolImage(e,t,r,o){var n=this;return l(function*(){var i=n.getSymbolDef(e);if(!i)return null;var l,a,c=O(e);"active"===r?(l=n.resolveActive(i,c,t),a="act-"):"selected"===r?(l=n.resolveSelected(i,c,t),a="sel-"):(l=n.resolve(i,c,t),a="");var s="symbol-".concat(a).concat(M(l),"-").concat(o,"x"),p=D.get(s);if(!p){var u=j(e,i),[,,f,y]=u.split(" ").map(Number),d='<svg xmlns="http://www.w3.org/2000/svg" width="'.concat(f*o,'" height="').concat(y*o,'" viewBox="').concat(u,'">').concat(l,"</svg>");p=yield((e,t,r)=>new Promise((o,n)=>{var i="data:image/svg+xml;charset=utf-8,".concat(encodeURIComponent(e)),l=new Image(t,r);l.onload=()=>{var e=document.createElement("canvas");e.width=t,e.height=r;var n=e.getContext("2d");n.drawImage(l,0,0,t,r),o(n.getImageData(0,0,t,r))},l.onerror=()=>{n(new Error("Failed to rasterise SVG: ".concat(e.slice(0,80))))},l.src=i}))(d,f*o,y*o),D.set(s,p)}return{imageId:s,imageData:p}})()}};function _(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,o)}return r}function z(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_(Object(r),!0).forEach(function(t){i(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}I.initialise();var H={},V=null,B=[],A=()=>{var e;if(null===(e=H)||void 0===e||!e.current)return[];if(V===H.current)return B;V=H.current;var{groups:t=[],keyDefinitions:r=[]}=H.current;return B=t.map(e=>"flat"===e.type?z(z({},e),{},{keyDefinition:r.find(t=>t.id===e.id)}):z(z({},e),{},{keyDefinitions:r.filter(t=>t.groupId===e.id)}))},K=e=>{var{text:t}=e;return o("div",{className:"im-c-map-key",children:o("p",{className:"im-c-map-key__empty-message",children:t})})};function N(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,o)}return r}function G(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?N(Object(r),!0).forEach(function(t){i(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):N(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var Y=20,R={xmlns:"http://www.w3.org/2000/svg",width:Y,height:Y,viewBox:"0 0 ".concat(Y," ").concat(Y),className:"im-c-map-key-symbol","aria-hidden":"true",focusable:"false"},T=G(G({},R),{},{width:44,height:44,className:"im-c-map-key-symbol im-c-map-key-symbol--point"});function W(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,o)}return r}function q(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?W(Object(r),!0).forEach(function(t){i(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):W(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var F=e=>{var{keyDefinition:t,mapStyle:r}=e,{style:i}=t,l=y.getKeyPatternPaths(i,r.id);return l?n("svg",q(q({},R),{},{children:[o("g",{dangerouslySetInnerHTML:{__html:l.border}}),o("g",{transform:"translate(".concat(2,", ").concat(2,")"),dangerouslySetInnerHTML:{__html:l.content}})]})):null};function Z(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,o)}return r}function U(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Z(Object(r),!0).forEach(function(t){i(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Z(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var J=e=>{var t,{keyDefinition:r,mapStyle:n,symbolDef:i}=e,{style:l}=r,a=null!==(t=null==n?void 0:n.appColorScheme)&&void 0!==t?t:"light",c=U(U({},n),{},{mapColorScheme:a}),s=I.resolve(i,O(l),c),p=j(l,i);return s&&p?o("svg",U(U({},T),{},{viewBox:p,children:o("g",{dangerouslySetInnerHTML:{__html:s}})})):null};function Q(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,o)}return r}function X(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Q(Object(r),!0).forEach(function(t){i(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Q(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var $=e=>{var{mapStyle:t,keyDefinition:r}=e,{style:n}=r,i=n.strokeWidth,l=p(n.stroke,t.id);return o("svg",X(X({},R),{},{children:o("line",{x1:i/2,y1:10,x2:Y-i/2,y2:10,stroke:l,strokeWidth:i,strokeLinecap:"round"})}))};function ee(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,o)}return r}function te(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ee(Object(r),!0).forEach(function(t){i(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ee(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var re=e=>{var{mapStyle:t,keyDefinition:r}=e,{style:n}=r,i=n.strokeWidth,l=p(n.fill,t.id),a=p(n.stroke,t.id);return o("svg",te(te({},R),{},{children:o("rect",{x:i/2,y:i/2,width:Y-i,height:Y-i,rx:i,ry:i,fill:l,stroke:a,strokeWidth:i,strokeLinejoin:"round"})}))},oe=e=>{var{mapStyle:t,keyDefinition:r}=e,{style:n}=r,i=p(n.fill,t.id),l=p(n.fill,t.id);return o("svg",{viewBox:"0 0 5 5",preserveAspectRatio:"none",fill:i,stroke:l,strokeWidth:"1",children:o("path",{d:"M0 0h5v5H0z"})})},ne="horizontal-ramp",ie=e=>{var{keyDefinition:t,groupStyle:r,mapStyle:n}=e,{symbolShape:i,symbolDef:l}=((e,t)=>{if(!e)return{symbolShape:null,symbolDef:null};var{hasSymbol:r,hasPattern:o,style:n}=e;if(t===ne)return{symbolShape:ne,symbolDef:null};if(r){var i=I.getSymbolDef(n);return{symbolShape:i?"symbol":"rect",symbolDef:i}}return o?{symbolShape:"pattern",symbolDef:null}:"line"===n.keySymbolShape?{symbolShape:"line",symbolDef:null}:{symbolShape:"rect",symbolDef:null}})(t,r);return i?"symbol"===i?o(J,{mapStyle:n,keyDefinition:t,symbolDef:l}):o("pattern"===i?F:"line"===i?$:i===ne?oe:re,{mapStyle:n,keyDefinition:t}):null},le=e=>{var{keyDefinition:t,groupStyle:r,mapStyle:i}=e,l=t.label,a=p(t.symbolDescription,i.id);return n("div",{className:"im-c-map-key-list__item",children:[o("dt",{className:"im-c-map-key-list__item-symbol",children:o(ie,{keyDefinition:t,groupStyle:r,mapStyle:i})}),n("dd",{className:"im-c-map-key-list__item-label",children:[l,a&&n("span",{className:"govuk-visually-hidden",children:["(",a,")"]})]})]})},ae=e=>{var{headingId:t,label:r,groupStyle:i,keyDefinitions:l,mapStyle:a}=e,c="im-c-map-key-list"+(i?" im-c-map-key-list-".concat(i):"");return n("section",{className:"im-c-map-key__group","aria-labelledby":t,children:[o("h3",{id:t,className:"im-c-map-key__group-heading",children:r}),o("dl",{className:c,children:l.map(e=>o(le,{keyDefinition:e,mapStyle:a,groupStyle:i},"".concat(e.id)))})]})},ce="im-c-map-key",se=e=>{var{item:t,groupStyle:r,mapStyle:n}=e;return"group"===t.type?o(ae,{headingId:"key-heading-".concat(t.id),label:t.groupLabel,groupStyle:r,keyDefinitions:t.keyDefinitions,mapStyle:n}):o(le,{keyDefinition:t.keyDefinition,mapStyle:n})},pe=e=>{var{noKeyItemText:t,keyGroups:r,hasGroups:n,mapStyle:i}=e;if(null==r||!r.length)return o(K,{text:t});var l=n?"".concat(ce," ").concat("im-c-map-key--has-groups"):ce;return o("div",{className:l,children:r.map(e=>o(se,{item:e,mapStyle:i,groupStyle:e.groupStyle},e.id))})};function ue(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,o)}return r}function fe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ue(Object(r),!0).forEach(function(t){i(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ue(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function ye(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,o)}return r}function de(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ye(Object(r),!0).forEach(function(t){i(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ye(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var ge={InitComponent:function(e){var{pluginConfig:o,pluginState:n,mapState:i,services:l}=e,{dispatch:a}=n,{eventBus:s}=l,p=r(n);p.current=n,t(()=>{i.isMapReady&&((e=>{H=e})(p),s.requestOnce("datasets:registry",c),s.emit("map-key:ready"))},[i.isMapReady]),t(()=>{if(o.groups){var e=Object.entries(o.groups).map(e=>{var[t,r]=e;return fe(fe({},r),{},{id:t,label:r.groupLabel})});a({type:"ADD_KEY_GROUPS",payload:e})}},[o.groups])},reducer:{initialState:{keyDefinitions:[],groups:[]},actions:{ADD_KEY_SYMBOL:(e,t)=>{var r,{id:o,groupLabel:n}=t,i=t.groupId||((r=n)?r.toLowerCase().replace(/\s+/g,"-"):null),l=((e,t,r)=>e.groups.find(e=>"group"===e.type&&e.id===r||"flat"===e.type&&e.id===t))(e,o,i),a=l?null:((e,t,r)=>t?{id:t,type:"group",groupLabel:r}:{id:e,type:"flat"})(o,i,n),c=a?[...e.groups,a]:e.groups,s=[...e.keyDefinitions,de(de({},t),{},{type:"manual"},i?{groupId:i}:{})];return de(de({},e),{},{keyDefinitions:s,groups:c})},REMOVE_KEY_SYMBOL:(e,t)=>{var{id:r}=t;return de(de({},e),{},{keyDefinitions:e.keyDefinitions.filter(e=>e.id!==r)})},ADD_KEY_GROUPS:(e,t)=>de(de({},e),{},{groups:[...e.groups,...t]})}},panels:[{id:"mapKey",label:"Key",mobile:{slot:"drawer",modal:!0},tablet:{slot:"left-top",width:"260px"},desktop:{slot:"left-top",width:"280px"},render:function(r){var{mapState:{mapStyle:n},pluginConfig:{noKeyItemText:i},pluginState:l,services:{eventBus:c}}=r,[s,p]=e(a),[u,f]=e(()=>{var e;return null!==(e=null==s?void 0:s.keyItems().items)&&void 0!==e?e:[]}),[y,d]=e(()=>{var e;return null!==(e=null==s?void 0:s.keyItems().hasGroups)&&void 0!==e&&e}),g=()=>{var{items:e,hasGroups:t}=s.keyItems(),r=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[...A()];return 0===t.length?e:[...e.map(e=>{var r=t.findIndex(t=>t.id===e.id);if(-1===r)return e;var o=t.splice(r,1)[0];return z(z(z({},e),o),{},{keyDefinitions:[...o.keyDefinitions||[],...e.keyDefinitions||[]]})}),...t].filter(e=>{var t;return"flat"===e.type&&e.keyDefinition||"group"===e.type&&(null===(t=e.keyDefinitions)||void 0===t?void 0:t.length)})}(e);f(r),d(t)},h=e=>{s.invalidateKeyItemsOnMenuStateChange(e),g()};return t(()=>s?(g(),c.on("menu:changed",h).on("datasets:changed",g),()=>c.off("menu:changed",h).off("datasets:changed",g)):(c.requestOnce("datasets:registry",p),()=>{}),[s]),t(()=>{s&&g()},[l]),o(pe,{noKeyItemText:i,keyGroups:u,hasGroups:y,mapStyle:n})}}],buttons:[{id:"mapKey",panelId:"mapKey",label:"Key",iconId:"key",mobile:{slot:"top-left",showLabel:!0},tablet:{slot:"top-left",showLabel:!0},desktop:{slot:"top-left",showLabel:!0}}],icons:[{id:"key",svgContent:'<path d="M3 5h.01"/><path d="M3 12h.01"/><path d="M3 19h.01"/><path d="M8 5h13"/><path d="M8 12h13"/><path d="M8 19h13"/>'}],api:{addSymbol:(e,t)=>{var{pluginState:{dispatch:r}}=e;r({type:"ADD_KEY_SYMBOL",payload:t})},removeSymbol:(e,t)=>{var{pluginState:{dispatch:r}}=e;r({type:"REMOVE_KEY_SYMBOL",payload:t})}}};export{ge as manifest};
1
+ import{useState as e,useEffect as t,useRef as r}from"preact/compat";import{jsx as o,jsxs as n}from"preact/jsx-runtime";import i from"@babel/runtime/helpers/defineProperty";import l from"@babel/runtime/helpers/asyncToGenerator";var a=null,c=e=>a=e,s={"cross-hatch":'<path d="M0 4.486V3.485h3.5V.001h1v3.484h7.002V.001h1v3.484h3.5v1.001h-3.5v7h3.5v.999h-3.5v3.516h-1v-3.516H4.499v3.516h-1v-3.516H0v-.999h3.5v-7H0zm11.501 0H4.499v7h7.002v-7z" fill="{{foregroundColor}}"/>',"diagonal-cross-hatch":'<path d="M0 8.707V7.293L7.293 0h1.414L16 7.293v1.414L8.707 16H7.293L0 8.707zM.707 8L8 15.293 15.293 8 8 .707.707 8z" fill="{{foregroundColor}}"/>',"forward-diagonal-hatch":'<path d="M16 8.707V7.293L7.293 16h1.414L16 8.707zm-16 0L8.707 0H7.293L0 7.293v1.414z" fill="{{foregroundColor}}"/>',"backward-diagonal-hatch":'<path d="M0 8.707V7.293L8.707 16H7.293L0 8.707zm16 0L7.293 0h1.414L16 7.293v1.414z" fill="{{foregroundColor}}"/>',"horizontal-hatch":'<path d="M0 4.5V3.499h15.999V4.5H0zm0 7h15.999V12.5H0v-1.001z" fill="{{foregroundColor}}"/>',"vertical-hatch":'<path d="M3.501 16.001V0h1v16.001h-1zm7.998 0V0h1v16.001h-1z" fill="{{foregroundColor}}"/>',dot:'<path d="M3.999 2A2 2 0 0 1 6 3.999C6 5.103 5.103 6 3.999 6a2 2 0 0 1-1.999-2.001A2 2 0 0 1 3.999 2zm0 7.999C5.103 10 6 10.897 6 12.001A2 2 0 0 1 3.999 14a2 2 0 0 1-1.999-1.999A2 2 0 0 1 3.999 10zM11.999 2A2 2 0 0 1 14 3.999C14 5.103 13.103 6 11.999 6S10 5.103 10 3.999A2 2 0 0 1 11.999 2zm0 7.999c1.104 0 2.001.897 2.001 2.001A2 2 0 0 1 11.999 14 2 2 0 0 1 10 12.001c0-1.104.897-2.001 1.999-2.001z" fill="{{foregroundColor}}"/>',diamond:'<path d="M4 .465L7.535 4 4 7.535.465 4 4 .465zm0 7.999l3.535 3.535L4 15.535.465 11.999 4 8.464zm8-8l3.535 3.535-3.536 3.536L8.464 4 12 .464zm0 8.001L15.536 12 12 15.536 8.465 12 12 8.465z" fill="{{foregroundColor}}"/>'},p=(e,t)=>{if(!e)return null;if("string"==typeof e)return e.trim();if("object"==typeof e){if(t&&e[t])return e[t];var r=Object.values(e)[0];return null!=r?r:null}return null},u=e=>Math.max(2,2*e),f=(e,t,r)=>e.replace(/\{\{foregroundColor\}\}/g,t||"black").replace(/\{\{backgroundColor\}\}/g,r||"transparent"),d=(e,t,r)=>new Promise((o,n)=>{var i="data:image/svg+xml;charset=utf-8,".concat(encodeURIComponent(e)),l=new Image(t,r);l.onload=()=>{var e=document.createElement("canvas");e.width=t,e.height=r;var n=e.getContext("2d");n.drawImage(l,0,0,t,r),o(n.getImageData(0,0,t,r))},l.onerror=()=>{n(new Error("Failed to rasterise SVG: ".concat(e.slice(0,80))))},l.src=i}),y=new Map,g=new Map,h={register(e,t){y.set(e,{id:e,svgContent:t})},get:e=>y.get(e),list:()=>[...y.values()],clear(){y.clear()},initialise(){Object.entries(s).forEach(e=>{var[t,r]=e;this.register(t,r)})},getPatternInnerContent(e){return e.fillPatternSvgContent?e.fillPatternSvgContent:e.fillPattern&&null!==(t=null===(r=this.get(e.fillPattern))||void 0===r?void 0:r.svgContent)&&void 0!==t?t:null;var t,r},getKeyPatternPaths(e,t){var r=this.getPatternInnerContent(e);if(!r)return null;var o=p(e.fillPatternForegroundColor,t)||"black",n=p(e.fillPatternBackgroundColor,t)||"transparent",i=p(e.stroke,t)||o;return{border:f('<path d="M19 2.862v14.275c0 1.028-.835 1.862-1.862 1.862H2.863c-1.028 0-1.862-.835-1.862-1.862V2.862C1.001 1.834 1.836 1 2.863 1h14.275C18.166 1 19 1.835 19 2.862z" fill="{{backgroundColor}}" stroke="{{foregroundColor}}" stroke-width="2"/>',i,n),content:f(r,o,n)}},getPatternImageId(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=this.getPatternInnerContent(e);if(!o)return null;var n=p(e.fillPatternForegroundColor,t)||"black",i=p(e.fillPatternBackgroundColor,t)||"transparent",l=u(r);return"pattern-".concat((e=>{var t=0;for(var r of e)t=Math.trunc((t<<5)-t+r.codePointAt(0));return Math.abs(t).toString(36)})(o+n+i),"-").concat(l,"x")},rasterisePatternImage(e,t){var r=arguments,o=this;return l(function*(){var n=r.length>2&&void 0!==r[2]?r[2]:1,i=o.getPatternInnerContent(e);if(!i)return null;var l=o.getPatternImageId(e,t,n);if(!l)return null;var a=g.get(l);if(!a){var c=p(e.fillPatternForegroundColor,t)||"black",s=p(e.fillPatternBackgroundColor,t)||"transparent",y=f(i,c,s),h='<rect width="16" height="16" fill="'.concat(s,'"/>'),v=u(n),m=Math.round(8*v),b='<svg xmlns="http://www.w3.org/2000/svg" width="'.concat(m,'" height="').concat(m,'" viewBox="0 0 16 16">').concat(h).concat(y,"</svg>");a=yield d(b,m,m),g.set(l,a)}return{imageId:l,imageData:a}})()}};h.initialise();var v={symbol:"pin",backgroundColor:"#ca3535",foregroundColor:"#ffffff"},m={dot:"M8 3c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.241 5-5-2.24-5-5-5z",cross:"M6 3H10V6H13V10H10V13H6V10H3V6H6Z",diamond:"M8 2L14 8L8 14L2 8Z",triangle:"M8 2L14 14H2Z",square:"M3 3H13V13H3Z"},b={id:"pin",viewBox:"0 0 44 44",anchor:[.5,.9],graphic:m.dot,svg:'<path d="M22 40.999c-3.621 0-8.306-5.864-10.258-8.3C9.02 29.302 6 23.66 6 19.002a16.01 16.01 0 0 1 16-16 16.01 16.01 0 0 1 16 16c0 4.658-3.02 10.3-5.742 13.697-1.952 2.437-6.637 8.3-10.258 8.3z" fill="{{selectedColor}}" stroke="{{activeColor}}" stroke-width="6" paint-order="stroke fill"/>\n <path d="M22 7.001a12.01 12.01 0 0 1 12 12c0 7.623-10.377 17.998-12 17.998S10 26.624 10 19.001a12.01 12.01 0 0 1 12-12z" fill="{{backgroundColor}}" stroke="{{haloColor}}" stroke-width="2" paint-order="stroke fill"/>\n <g transform="translate(22, 19) scale(0.8) translate(-8, -8)"><path d="{{graphic}}" fill="{{foregroundColor}}"/></g>'},O={id:"circle",viewBox:"0 0 44 44",anchor:[.5,.5],graphic:m.dot,svg:'<circle cx="22" cy="22" r="16" fill="{{selectedColor}}" stroke="{{activeColor}}" stroke-width="6" paint-order="stroke fill"/>\n <circle cx="22" cy="22" r="12" fill="{{backgroundColor}}" stroke="{{haloColor}}" stroke-width="2" paint-order="stroke fill"/>\n <g transform="translate(22, 22) scale(0.8) translate(-8, -8)"><path d="{{graphic}}" fill="{{foregroundColor}}"/></g>'},j={id:"square",viewBox:"0 0 44 44",anchor:[.5,.5],graphic:m.dot,svg:'<path d="M13 6h18c3.863 0 7 3.137 7 7v18c0 3.863-3.137 7-7 7H13c-3.863 0-7-3.137-7-7V13c0-3.863 3.137-7 7-7" fill="{{selectedColor}}" stroke="{{activeColor}}" stroke-width="6" paint-order="stroke fill"/>\n <path d="M13 34a3 3 0 0 1-3-3V13a3 3 0 0 1 3-3h18a3 3 0 0 1 3 3v18a3 3 0 0 1-3 3H13z" fill-rule="nonzero" fill="{{backgroundColor}}" stroke="{{haloColor}}" stroke-width="2" paint-order="stroke fill"/>\n <g transform="translate(22, 22) scale(0.8) translate(-8, -8)"><path d="{{graphic}}" fill="{{foregroundColor}}"/></g>'},k=new Set(["symbolBackgroundColor","symbolForegroundColor","symbolHaloWidth","symbolGraphic"]),w=e=>{if(!(e=>!(!e.symbol&&!e.symbolSvgContent))(e))return{};var t={};return k.forEach(r=>{if(null!=e[r]){var o=r.charAt(6).toLowerCase()+r.slice(7);t[o]=e[r]}}),t},P=(e,t)=>{var r;return e.symbolViewBox?e.symbolViewBox:null!==(r=null==t?void 0:t.viewBox)&&void 0!==r?r:"0 0 38 38"},S={light:{haloColor:"#ffffff",selectedColor:"#0b0c0c",activeColor:"#ffdd00",foregroundColor:"#0b0c0c"},dark:{haloColor:"#0b0c0c",selectedColor:"#ffffff",activeColor:"#ffdd00",foregroundColor:"#ffffff"}};function D(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,o)}return r}function C(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?D(Object(r),!0).forEach(function(t){i(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):D(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var M=new Map,L=new Map,x={},I=e=>{var t=0;for(var r of e)t=Math.trunc((t<<5)-t+r.codePointAt(0));return Math.abs(t).toString(36)},E=new Set(["id","svg","viewBox","anchor","symbol","symbolSvgContent"]);function _(e,t,r){var o,n,i,l,a=null==r?void 0:r.id,c=Object.fromEntries(Object.entries(e||{}).filter(e=>{var[t]=e;return!E.has(t)})),s=Object.fromEntries(Object.entries(x).filter(e=>{var[t]=e;return!E.has(t)})),u=Object.fromEntries(Object.entries(t).filter(e=>{var[,t]=e;return null!=t})),f=C(C(C(C({},v),s),c),u),d=null!==(o=S[null==r?void 0:r.mapColorScheme])&&void 0!==o?o:S.light;return f.haloColor=null!==(n=null==r?void 0:r.haloColor)&&void 0!==n?n:d.haloColor,f.selectedColor=null!==(i=null==r?void 0:r.selectedColor)&&void 0!==i?i:d.selectedColor,f.activeColor=null!==(l=null==r?void 0:r.activeColor)&&void 0!==l?l:d.activeColor,"string"==typeof f.graphic&&m[f.graphic]&&(f.graphic=m[f.graphic]),Object.fromEntries(Object.entries(f).map(e=>{var[t,r]=e;return[t,p(r,a)||""]}))}function z(e,t){return Object.entries(t).reduce((e,t)=>{var[r,o]=t;return e.replaceAll("{{".concat(r,"}}"),o)},e)}var H={setDefaults(e){x=e||{}},getDefaults:()=>C(C({},v),x),register(e){M.set(e.id,e)},get:e=>M.get(e),list:()=>[...M.values()],clear(){M.clear()},initialise(){this.register(b),this.register(O),this.register(j)},resolve(e,t,r){var o=_(e,t||{},r);return e?(o.selectedColor="none",o.activeColor="none",z(e.svg,o)):""},resolveActive(e,t,r){var o=_(e,t||{},r);return e?z(e.svg,o):""},resolveSelected(e,t,r){var o=_(e,t||{},r);return e?(o.activeColor="none",z(e.svg,o)):""},getSymbolImageId(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2,n=this.getSymbolDef(e);if(!n)return null;var i=w(e),l=r?this.resolveActive(n,i,t):this.resolve(n,i,t);return"symbol-".concat(r?"act-":"").concat(I(l),"-").concat(o,"x")},getSymbolDef(e){return e.symbolSvgContent?{svg:e.symbolSvgContent}:e.symbol?this.get(e.symbol):void 0},rasteriseSymbolImage(e,t,r,o){var n=this;return l(function*(){var i=n.getSymbolDef(e);if(!i)return null;var l,a,c=w(e);"active"===r?(l=n.resolveActive(i,c,t),a="act-"):"selected"===r?(l=n.resolveSelected(i,c,t),a="sel-"):(l=n.resolve(i,c,t),a="");var s="symbol-".concat(a).concat(I(l),"-").concat(o,"x"),p=L.get(s);if(!p){var u=P(e,i),[,,f,y]=u.split(" ").map(Number),g='<svg xmlns="http://www.w3.org/2000/svg" width="'.concat(f*o,'" height="').concat(y*o,'" viewBox="').concat(u,'">').concat(l,"</svg>");p=yield d(g,f*o,y*o),L.set(s,p)}return{imageId:s,imageData:p}})()}};function V(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,o)}return r}function B(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?V(Object(r),!0).forEach(function(t){i(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):V(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}H.initialise();var A={},K=null,N=[],G=()=>{var e;if(null===(e=A)||void 0===e||!e.current)return[];if(K===A.current)return N;K=A.current;var{groups:t=[],keyDefinitions:r=[]}=A.current;return N=t.map(e=>"flat"===e.type?B(B({},e),{},{keyDefinition:r.find(t=>t.id===e.id)}):B(B({},e),{},{keyDefinitions:r.filter(t=>t.groupId===e.id)}))},Y=e=>{var{text:t}=e;return o("div",{className:"im-c-map-key",children:o("p",{className:"im-c-map-key__empty-message",children:t})})};function R(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,o)}return r}function T(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?R(Object(r),!0).forEach(function(t){i(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):R(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var W=20,F={xmlns:"http://www.w3.org/2000/svg",width:W,height:W,viewBox:"0 0 ".concat(W," ").concat(W),className:"im-c-map-key-symbol","aria-hidden":"true",focusable:"false"},q=T(T({},F),{},{width:44,height:44,className:"im-c-map-key-symbol im-c-map-key-symbol--point"});function Z(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,o)}return r}function U(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Z(Object(r),!0).forEach(function(t){i(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Z(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var J=e=>{var{keyDefinition:t,mapStyle:r}=e,{style:i}=t,l=h.getKeyPatternPaths(i,r.id);return l?n("svg",U(U({},F),{},{children:[o("g",{dangerouslySetInnerHTML:{__html:l.border}}),o("g",{transform:"translate(".concat(2,", ").concat(2,")"),dangerouslySetInnerHTML:{__html:l.content}})]})):null};function Q(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,o)}return r}function X(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Q(Object(r),!0).forEach(function(t){i(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Q(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var $=e=>{var t,{keyDefinition:r,mapStyle:n,symbolDef:i}=e,{style:l}=r,a=null!==(t=null==n?void 0:n.appColorScheme)&&void 0!==t?t:"light",c=X(X({},n),{},{mapColorScheme:a}),s=H.resolve(i,w(l),c),p=P(l,i);return s&&p?o("svg",X(X({},q),{},{viewBox:p,children:o("g",{dangerouslySetInnerHTML:{__html:s}})})):null};function ee(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,o)}return r}function te(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ee(Object(r),!0).forEach(function(t){i(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ee(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var re=e=>{var{mapStyle:t,keyDefinition:r}=e,{style:n}=r,i=n.strokeWidth,l=p(n.stroke,t.id);return o("svg",te(te({},F),{},{children:o("line",{x1:i/2,y1:10,x2:W-i/2,y2:10,stroke:l,strokeWidth:i,strokeLinecap:"round"})}))};function oe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,o)}return r}function ne(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?oe(Object(r),!0).forEach(function(t){i(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):oe(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var ie=e=>{var{mapStyle:t,keyDefinition:r}=e,{style:n}=r,i=n.strokeWidth,l=p(n.fill,t.id),a=p(n.stroke,t.id);return o("svg",ne(ne({},F),{},{children:o("rect",{x:i/2,y:i/2,width:W-i,height:W-i,rx:i,ry:i,fill:l,stroke:a,strokeWidth:i,strokeLinejoin:"round"})}))},le=e=>{var{mapStyle:t,keyDefinition:r}=e,{style:n}=r,i=p(n.fill,t.id),l=p(n.fill,t.id);return o("svg",{viewBox:"0 0 5 5",preserveAspectRatio:"none",fill:i,stroke:l,strokeWidth:"1",children:o("path",{d:"M0 0h5v5H0z"})})},ae="horizontal-ramp",ce=e=>{var{keyDefinition:t,groupStyle:r,mapStyle:n}=e,{symbolShape:i,symbolDef:l}=((e,t)=>{if(!e)return{symbolShape:null,symbolDef:null};var{hasSymbol:r,hasPattern:o,style:n}=e;if(t===ae)return{symbolShape:ae,symbolDef:null};if(r){var i=H.getSymbolDef(n);return{symbolShape:i?"symbol":"rect",symbolDef:i}}return o?{symbolShape:"pattern",symbolDef:null}:"line"===n.keySymbolShape?{symbolShape:"line",symbolDef:null}:{symbolShape:"rect",symbolDef:null}})(t,r);return i?"symbol"===i?o($,{mapStyle:n,keyDefinition:t,symbolDef:l}):o("pattern"===i?J:"line"===i?re:i===ae?le:ie,{mapStyle:n,keyDefinition:t}):null},se=e=>{var{keyDefinition:t,groupStyle:r,mapStyle:i}=e,l=t.label,a=p(t.symbolDescription,i.id);return n("div",{className:"im-c-map-key-list__item",children:[o("dt",{className:"im-c-map-key-list__item-symbol",children:o(ce,{keyDefinition:t,groupStyle:r,mapStyle:i})}),n("dd",{className:"im-c-map-key-list__item-label",children:[l,a&&n("span",{className:"govuk-visually-hidden",children:["(",a,")"]})]})]})},pe=e=>{var{headingId:t,label:r,groupStyle:i,keyDefinitions:l,mapStyle:a}=e,c="im-c-map-key-list"+(i?" im-c-map-key-list-".concat(i):"");return n("section",{className:"im-c-map-key__group","aria-labelledby":t,children:[o("h3",{id:t,className:"im-c-map-key__group-heading",children:r}),o("dl",{className:c,children:l.map(e=>o(se,{keyDefinition:e,mapStyle:a,groupStyle:i},"".concat(e.id)))})]})},ue="im-c-map-key",fe=e=>{var{item:t,groupStyle:r,mapStyle:n}=e;return"group"===t.type?o(pe,{headingId:"key-heading-".concat(t.id),label:t.groupLabel,groupStyle:r,keyDefinitions:t.keyDefinitions,mapStyle:n}):o(se,{keyDefinition:t.keyDefinition,mapStyle:n})},de=e=>{var{noKeyItemText:t,keyGroups:r,hasGroups:n,mapStyle:i}=e;if(null==r||!r.length)return o(Y,{text:t});var l=n?"".concat(ue," ").concat("im-c-map-key--has-groups"):ue;return o("div",{className:l,children:r.map(e=>o(fe,{item:e,mapStyle:i,groupStyle:e.groupStyle},e.id))})};function ye(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,o)}return r}function ge(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ye(Object(r),!0).forEach(function(t){i(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ye(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function he(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,o)}return r}function ve(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?he(Object(r),!0).forEach(function(t){i(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):he(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var me={InitComponent:function(e){var{pluginConfig:o,pluginState:n,mapState:i,services:l}=e,{dispatch:a}=n,{eventBus:s}=l,p=r(n);p.current=n,t(()=>{i.isMapReady&&((e=>{A=e})(p),s.requestOnce("datasets:registry",c),s.emit("map-key:ready"))},[i.isMapReady]),t(()=>{if(o.groups){var e=Object.entries(o.groups).map(e=>{var[t,r]=e;return ge(ge({},r),{},{id:t,label:r.groupLabel})});a({type:"ADD_KEY_GROUPS",payload:e})}},[o.groups])},reducer:{initialState:{keyDefinitions:[],groups:[]},actions:{ADD_KEY_SYMBOL:(e,t)=>{var r,{id:o,groupLabel:n}=t,i=t.groupId||((r=n)?r.toLowerCase().replace(/\s+/g,"-"):null),l=((e,t,r)=>e.groups.find(e=>"group"===e.type&&e.id===r||"flat"===e.type&&e.id===t))(e,o,i),a=l?null:((e,t,r)=>t?{id:t,type:"group",groupLabel:r}:{id:e,type:"flat"})(o,i,n),c=a?[...e.groups,a]:e.groups,s=[...e.keyDefinitions,ve(ve({},t),{},{type:"manual"},i?{groupId:i}:{})];return ve(ve({},e),{},{keyDefinitions:s,groups:c})},REMOVE_KEY_SYMBOL:(e,t)=>{var{id:r}=t;return ve(ve({},e),{},{keyDefinitions:e.keyDefinitions.filter(e=>e.id!==r)})},ADD_KEY_GROUPS:(e,t)=>ve(ve({},e),{},{groups:[...e.groups,...t]})}},panels:[{id:"mapKey",label:"Key",mobile:{slot:"drawer",modal:!0},tablet:{slot:"left-top",width:"260px"},desktop:{slot:"left-top",width:"280px"},render:function(r){var{mapState:{mapStyle:n},pluginConfig:{noKeyItemText:i},pluginState:l,services:{eventBus:c}}=r,[s,p]=e(a),[u,f]=e(()=>{var e;return null!==(e=null==s?void 0:s.keyItems().items)&&void 0!==e?e:[]}),[d,y]=e(()=>{var e;return null!==(e=null==s?void 0:s.keyItems().hasGroups)&&void 0!==e&&e}),g=()=>{var{items:e,hasGroups:t}=s.keyItems(),r=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[...G()];return 0===t.length?e:[...e.map(e=>{var r=t.findIndex(t=>t.id===e.id);if(-1===r)return e;var o=t.splice(r,1)[0];return B(B(B({},e),o),{},{keyDefinitions:[...o.keyDefinitions||[],...e.keyDefinitions||[]]})}),...t].filter(e=>{var t;return"flat"===e.type&&e.keyDefinition||"group"===e.type&&(null===(t=e.keyDefinitions)||void 0===t?void 0:t.length)})}(e);f(r),y(t)},h=e=>{s.invalidateKeyItemsOnMenuStateChange(e),g()};return t(()=>s?(g(),c.on("menu:changed",h).on("datasets:changed",g),()=>c.off("menu:changed",h).off("datasets:changed",g)):(c.requestOnce("datasets:registry",p),()=>{}),[s]),t(()=>{s&&g()},[l]),o(de,{noKeyItemText:i,keyGroups:u,hasGroups:d,mapStyle:n})}}],buttons:[{id:"mapKey",panelId:"mapKey",label:"Key",iconId:"key",mobile:{slot:"top-left",showLabel:!0},tablet:{slot:"top-left",showLabel:!0},desktop:{slot:"top-left",showLabel:!0}}],icons:[{id:"key",svgContent:'<path d="M3 5h.01"/><path d="M3 12h.01"/><path d="M3 19h.01"/><path d="M8 5h13"/><path d="M8 12h13"/><path d="M8 19h13"/>'}],api:{addSymbol:(e,t)=>{var{pluginState:{dispatch:r}}=e;r({type:"ADD_KEY_SYMBOL",payload:t})},removeSymbol:(e,t)=>{var{pluginState:{dispatch:r}}=e;r({type:"REMOVE_KEY_SYMBOL",payload:t})}}};export{me as manifest};
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see im-map-key-plugin.js.LICENSE.txt */
2
- "use strict";(this.webpackChunkdefra_DefraMap=this.webpackChunkdefra_DefraMap||[]).push([[414],{64(t,r,e){e.r(r),e.d(r,{manifest:()=>Wt});var n=e(738),o=null,i=function(t){return o=t};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 l(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)||function(t,r){if(t){if("string"==typeof t)return u(t,r);var e={}.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?u(t,r):void 0}}(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 u(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=Array(r);e<r;e++)n[e]=t[e];return n}function c(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),e.push.apply(e,n)}return e}function f(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?c(Object(e),!0).forEach(function(r){s(t,r,e[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):c(Object(e)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))})}return t}function s(t,r,e){return(r=function(t){var r=function(t){if("object"!=a(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var e=r.call(t,"string");if("object"!=a(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==a(r)?r:r+""}(r))in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}var y={},p=null,b=[],m=e(287),v=function(t){var r=t.text;return(0,m.jsx)("div",{className:"im-c-map-key",children:(0,m.jsx)("p",{className:"im-c-map-key__empty-message",children:r})})};function d(t){return d="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},d(t)}var h=function(t,r){if(!t)return null;if("string"==typeof t)return t.trim();if("object"===d(t)){if(r&&t[r])return t[r];var e=Object.values(t)[0];return null!=e?e:null}return 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 S(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),e.push.apply(e,n)}return e}function O(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?S(Object(e),!0).forEach(function(r){j(t,r,e[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):S(Object(e)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))})}return t}function j(t,r,e){return(r=function(t){var r=function(t){if("object"!=g(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var e=r.call(t,"string");if("object"!=g(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==g(r)?r:r+""}(r))in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}var w=20,P={xmlns:"http://www.w3.org/2000/svg",width:w,height:w,viewBox:"0 0 ".concat(w," ").concat(w),className:"im-c-map-key-symbol","aria-hidden":"true",focusable:"false"},k=O(O({},P),{},{width:44,height:44,className:"im-c-map-key-symbol im-c-map-key-symbol--point"}),D={"cross-hatch":'<path d="M0 4.486V3.485h3.5V.001h1v3.484h7.002V.001h1v3.484h3.5v1.001h-3.5v7h3.5v.999h-3.5v3.516h-1v-3.516H4.499v3.516h-1v-3.516H0v-.999h3.5v-7H0zm11.501 0H4.499v7h7.002v-7z" fill="{{foregroundColor}}"/>',"diagonal-cross-hatch":'<path d="M0 8.707V7.293L7.293 0h1.414L16 7.293v1.414L8.707 16H7.293L0 8.707zM.707 8L8 15.293 15.293 8 8 .707.707 8z" fill="{{foregroundColor}}"/>',"forward-diagonal-hatch":'<path d="M16 8.707V7.293L7.293 16h1.414L16 8.707zm-16 0L8.707 0H7.293L0 7.293v1.414z" fill="{{foregroundColor}}"/>',"backward-diagonal-hatch":'<path d="M0 8.707V7.293L8.707 16H7.293L0 8.707zm16 0L7.293 0h1.414L16 7.293v1.414z" fill="{{foregroundColor}}"/>',"horizontal-hatch":'<path d="M0 4.5V3.499h15.999V4.5H0zm0 7h15.999V12.5H0v-1.001z" fill="{{foregroundColor}}"/>',"vertical-hatch":'<path d="M3.501 16.001V0h1v16.001h-1zm7.998 0V0h1v16.001h-1z" fill="{{foregroundColor}}"/>',dot:'<path d="M3.999 2A2 2 0 0 1 6 3.999C6 5.103 5.103 6 3.999 6a2 2 0 0 1-1.999-2.001A2 2 0 0 1 3.999 2zm0 7.999C5.103 10 6 10.897 6 12.001A2 2 0 0 1 3.999 14a2 2 0 0 1-1.999-1.999A2 2 0 0 1 3.999 10zM11.999 2A2 2 0 0 1 14 3.999C14 5.103 13.103 6 11.999 6S10 5.103 10 3.999A2 2 0 0 1 11.999 2zm0 7.999c1.104 0 2.001.897 2.001 2.001A2 2 0 0 1 11.999 14 2 2 0 0 1 10 12.001c0-1.104.897-2.001 1.999-2.001z" fill="{{foregroundColor}}"/>',diamond:'<path d="M4 .465L7.535 4 4 7.535.465 4 4 .465zm0 7.999l3.535 3.535L4 15.535.465 11.999 4 8.464zm8-8l3.535 3.535-3.536 3.536L8.464 4 12 .464zm0 8.001L15.536 12 12 15.536 8.465 12 12 8.465z" fill="{{foregroundColor}}"/>'};function C(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=Array(r);e<r;e++)n[e]=t[e];return n}var x=function(t,r,e){return t.replace(/\{\{foregroundColor\}\}/g,r||"black").replace(/\{\{backgroundColor\}\}/g,e||"transparent")};function A(t,r){if(t){if("string"==typeof t)return E(t,r);var e={}.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?E(t,r):void 0}}function E(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=Array(r);e<r;e++)n[e]=t[e];return n}var I=new Map,M={register:function(t,r){I.set(t,{id:t,svgContent:r})},get:function(t){return I.get(t)},list:function(){return function(t){if(Array.isArray(t))return E(t)}(t=I.values())||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||A(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.")}();var t},clear:function(){I.clear()},initialise:function(){var t=this;Object.entries(D).forEach(function(r){var e,n,o=(n=2,function(t){if(Array.isArray(t))return t}(e=r)||function(t,r){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var n,o,i,a,l=[],u=!0,c=!1;try{if(i=(e=e.call(t)).next,0===r){if(Object(e)!==e)return;u=!1}else for(;!(u=(n=i.call(e)).done)&&(l.push(n.value),l.length!==r);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=e.return&&(a=e.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,n)||A(e,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];t.register(i,a)})},getPatternInnerContent:function(t){return t.fillPatternSvgContent?t.fillPatternSvgContent:t.fillPattern&&null!==(r=null===(e=this.get(t.fillPattern))||void 0===e?void 0:e.svgContent)&&void 0!==r?r:null;var r,e},getKeyPatternPaths:function(t,r){var e=this.getPatternInnerContent(t);if(!e)return null;var n=h(t.fillPatternForegroundColor,r)||"black",o=h(t.fillPatternBackgroundColor,r)||"transparent",i=h(t.stroke,r)||n;return{border:x('<path d="M19 2.862v14.275c0 1.028-.835 1.862-1.862 1.862H2.863c-1.028 0-1.862-.835-1.862-1.862V2.862C1.001 1.834 1.836 1 2.863 1h14.275C18.166 1 19 1.835 19 2.862z" fill="{{backgroundColor}}" stroke="{{foregroundColor}}" stroke-width="2"/>',i,o),content:x(e,n,o)}},getPatternImageId:function(t,r){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=this.getPatternInnerContent(t);if(!n)return null;var o=h(t.fillPatternForegroundColor,r)||"black",i=h(t.fillPatternBackgroundColor,r)||"transparent",a=function(t){return Math.max(2,2*t)}(e);return"pattern-".concat(function(t){var r,e=0,n=function(t,r){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=function(t,r){if(t){if("string"==typeof t)return C(t,r);var e={}.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?C(t,r):void 0}}(t))||r&&t&&"number"==typeof t.length){e&&(t=e);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return a=t.done,t},e:function(t){l=!0,i=t},f:function(){try{a||null==e.return||e.return()}finally{if(l)throw i}}}}(t);try{for(n.s();!(r=n.n()).done;){var o=r.value;e=Math.trunc((e<<5)-e+o.codePointAt(0))}}catch(t){n.e(t)}finally{n.f()}return Math.abs(e).toString(36)}(n+o+i),"-").concat(a,"x")}};function L(t){return L="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},L(t)}function _(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),e.push.apply(e,n)}return e}function T(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?_(Object(e),!0).forEach(function(r){z(t,r,e[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):_(Object(e)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))})}return t}function z(t,r,e){return(r=function(t){var r=function(t){if("object"!=L(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var e=r.call(t,"string");if("object"!=L(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==L(r)?r:r+""}(r))in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}M.initialise();var H=function(t){var r=t.keyDefinition,e=t.mapStyle,n=r.style,o=M.getKeyPatternPaths(n,e.id);return o?(0,m.jsxs)("svg",T(T({},P),{},{children:[(0,m.jsx)("g",{dangerouslySetInnerHTML:{__html:o.border}}),(0,m.jsx)("g",{transform:"translate(".concat(2,", ").concat(2,")"),dangerouslySetInnerHTML:{__html:o.content}})]})):null},V=new Set(["symbolBackgroundColor","symbolForegroundColor","symbolHaloWidth","symbolGraphic"]),B=function(t){if(!function(t){return!(!t.symbol&&!t.symbolSvgContent)}(t))return{};var r={};return V.forEach(function(e){if(null!=t[e]){var n=e.charAt(6).toLowerCase()+e.slice(7);r[n]=t[e]}}),r},K=function(t,r){var e;return t.symbolViewBox?t.symbolViewBox:null!==(e=null==r?void 0:r.viewBox)&&void 0!==e?e:"0 0 38 38"},G={symbol:"pin",backgroundColor:"#ca3535",foregroundColor:"#ffffff"},N={dot:"M8 3c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.241 5-5-2.24-5-5-5z",cross:"M6 3H10V6H13V10H10V13H6V10H3V6H6Z",diamond:"M8 2L14 8L8 14L2 8Z",triangle:"M8 2L14 14H2Z",square:"M3 3H13V13H3Z"},U={id:"pin",viewBox:"0 0 44 44",anchor:[.5,.9],graphic:N.dot,svg:'<path d="M22 40.999c-3.621 0-8.306-5.864-10.258-8.3C9.02 29.302 6 23.66 6 19.002a16.01 16.01 0 0 1 16-16 16.01 16.01 0 0 1 16 16c0 4.658-3.02 10.3-5.742 13.697-1.952 2.437-6.637 8.3-10.258 8.3z" fill="{{selectedColor}}" stroke="{{activeColor}}" stroke-width="6" paint-order="stroke fill"/>\n <path d="M22 7.001a12.01 12.01 0 0 1 12 12c0 7.623-10.377 17.998-12 17.998S10 26.624 10 19.001a12.01 12.01 0 0 1 12-12z" fill="{{backgroundColor}}" stroke="{{haloColor}}" stroke-width="2" paint-order="stroke fill"/>\n <g transform="translate(22, 19) scale(0.8) translate(-8, -8)"><path d="{{graphic}}" fill="{{foregroundColor}}"/></g>'},Y={id:"circle",viewBox:"0 0 44 44",anchor:[.5,.5],graphic:N.dot,svg:'<circle cx="22" cy="22" r="16" fill="{{selectedColor}}" stroke="{{activeColor}}" stroke-width="6" paint-order="stroke fill"/>\n <circle cx="22" cy="22" r="12" fill="{{backgroundColor}}" stroke="{{haloColor}}" stroke-width="2" paint-order="stroke fill"/>\n <g transform="translate(22, 22) scale(0.8) translate(-8, -8)"><path d="{{graphic}}" fill="{{foregroundColor}}"/></g>'},R={id:"square",viewBox:"0 0 44 44",anchor:[.5,.5],graphic:N.dot,svg:'<path d="M13 6h18c3.863 0 7 3.137 7 7v18c0 3.863-3.137 7-7 7H13c-3.863 0-7-3.137-7-7V13c0-3.863 3.137-7 7-7" fill="{{selectedColor}}" stroke="{{activeColor}}" stroke-width="6" paint-order="stroke fill"/>\n <path d="M13 34a3 3 0 0 1-3-3V13a3 3 0 0 1 3-3h18a3 3 0 0 1 3 3v18a3 3 0 0 1-3 3H13z" fill-rule="nonzero" fill="{{backgroundColor}}" stroke="{{haloColor}}" stroke-width="2" paint-order="stroke fill"/>\n <g transform="translate(22, 22) scale(0.8) translate(-8, -8)"><path d="{{graphic}}" fill="{{foregroundColor}}"/></g>'},F={light:{haloColor:"#ffffff",selectedColor:"#0b0c0c",activeColor:"#ffdd00",foregroundColor:"#0b0c0c"},dark:{haloColor:"#0b0c0c",selectedColor:"#ffffff",activeColor:"#ffdd00",foregroundColor:"#ffffff"}},$=function(t,r,e){return new Promise(function(n,o){var i="data:image/svg+xml;charset=utf-8,".concat(encodeURIComponent(t)),a=new Image(r,e);a.onload=function(){var t=document.createElement("canvas");t.width=r,t.height=e;var o=t.getContext("2d");o.drawImage(a,0,0,r,e),n(o.getImageData(0,0,r,e))},a.onerror=function(){o(new Error("Failed to rasterise SVG: ".concat(t.slice(0,80))))},a.src=i})};function W(t){return W="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},W(t)}function q(){var t,r,e="function"==typeof Symbol?Symbol:{},n=e.iterator||"@@iterator",o=e.toStringTag||"@@toStringTag";function i(e,n,o,i){var u=n&&n.prototype instanceof l?n:l,c=Object.create(u.prototype);return Z(c,"_invoke",function(e,n,o){var i,l,u,c=0,f=o||[],s=!1,y={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(r,e){return i=r,l=0,u=t,y.n=e,a}};function p(e,n){for(l=e,u=n,r=0;!s&&c&&!o&&r<f.length;r++){var o,i=f[r],p=y.p,b=i[2];e>3?(o=b===n)&&(u=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=t):i[0]<=p&&((o=e<2&&p<i[1])?(l=0,y.v=n,y.n=i[1]):p<b&&(o=e<3||i[0]>n||n>b)&&(i[4]=e,i[5]=n,y.n=b,l=0))}if(o||e>1)return a;throw s=!0,n}return function(o,f,b){if(c>1)throw TypeError("Generator is already running");for(s&&1===f&&p(f,b),l=f,u=b;(r=l<2?t:u)||!s;){i||(l?l<3?(l>1&&(y.n=-1),p(l,u)):y.n=u:y.v=u);try{if(c=2,i){if(l||(o="next"),r=i[o]){if(!(r=r.call(i,u)))throw TypeError("iterator result is not an object");if(!r.done)return r;u=r.value,l<2&&(l=0)}else 1===l&&(r=i.return)&&r.call(i),l<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=t}else if((r=(s=y.n<0)?u:e.call(n,y))!==a)break}catch(r){i=t,l=1,u=r}finally{c=1}}return{value:r,done:s}}}(e,o,i),!0),c}var a={};function l(){}function u(){}function c(){}r=Object.getPrototypeOf;var f=[][n]?r(r([][n]())):(Z(r={},n,function(){return this}),r),s=c.prototype=l.prototype=Object.create(f);function y(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,Z(t,o,"GeneratorFunction")),t.prototype=Object.create(s),t}return u.prototype=c,Z(s,"constructor",c),Z(c,"constructor",u),u.displayName="GeneratorFunction",Z(c,o,"GeneratorFunction"),Z(s),Z(s,o,"Generator"),Z(s,n,function(){return this}),Z(s,"toString",function(){return"[object Generator]"}),(q=function(){return{w:i,m:y}})()}function Z(t,r,e,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}Z=function(t,r,e,n){function i(r,e){Z(t,r,function(t){return this._invoke(r,e,t)})}r?o?o(t,r,{value:e,enumerable:!n,configurable:!n,writable:!n}):t[r]=e:(i("next",0),i("throw",1),i("return",2))},Z(t,r,e,n)}function J(t,r,e,n,o,i,a){try{var l=t[i](a),u=l.value}catch(t){return void e(t)}l.done?r(u):Promise.resolve(u).then(n,o)}function Q(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),e.push.apply(e,n)}return e}function X(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?Q(Object(e),!0).forEach(function(r){tt(t,r,e[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Q(Object(e)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))})}return t}function tt(t,r,e){return(r=function(t){var r=function(t){if("object"!=W(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var e=r.call(t,"string");if("object"!=W(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==W(r)?r:r+""}(r))in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}function rt(t,r){return function(t){if(Array.isArray(t))return t}(t)||function(t,r){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var n,o,i,a,l=[],u=!0,c=!1;try{if(i=(e=e.call(t)).next,0===r){if(Object(e)!==e)return;u=!1}else for(;!(u=(n=i.call(e)).done)&&(l.push(n.value),l.length!==r);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=e.return&&(a=e.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(t,r)||et(t,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.")}()}function et(t,r){if(t){if("string"==typeof t)return nt(t,r);var e={}.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?nt(t,r):void 0}}function nt(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=Array(r);e<r;e++)n[e]=t[e];return n}var ot=new Map,it=new Map,at={},lt=function(t){var r,e=0,n=function(t){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=et(t))){r&&(t=r);var e=0,n=function(){};return{s:n,n:function(){return e>=t.length?{done:!0}:{done:!1,value:t[e++]}},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(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){a=!0,o=t},f:function(){try{i||null==r.return||r.return()}finally{if(a)throw o}}}}(t);try{for(n.s();!(r=n.n()).done;){var o=r.value;e=Math.trunc((e<<5)-e+o.codePointAt(0))}}catch(t){n.e(t)}finally{n.f()}return Math.abs(e).toString(36)},ut=new Set(["id","svg","viewBox","anchor","symbol","symbolSvgContent"]);function ct(t,r,e){var n,o,i,a,l=null==e?void 0:e.id,u=Object.fromEntries(Object.entries(t||{}).filter(function(t){var r=rt(t,1)[0];return!ut.has(r)})),c=Object.fromEntries(Object.entries(at).filter(function(t){var r=rt(t,1)[0];return!ut.has(r)})),f=Object.fromEntries(Object.entries(r).filter(function(t){return null!=rt(t,2)[1]})),s=X(X(X(X({},G),c),u),f),y=null!==(n=F[null==e?void 0:e.mapColorScheme])&&void 0!==n?n:F.light;return s.haloColor=null!==(o=null==e?void 0:e.haloColor)&&void 0!==o?o:y.haloColor,s.selectedColor=null!==(i=null==e?void 0:e.selectedColor)&&void 0!==i?i:y.selectedColor,s.activeColor=null!==(a=null==e?void 0:e.activeColor)&&void 0!==a?a:y.activeColor,"string"==typeof s.graphic&&N[s.graphic]&&(s.graphic=N[s.graphic]),Object.fromEntries(Object.entries(s).map(function(t){var r=rt(t,2),e=r[0],n=r[1];return[e,h(n,l)||""]}))}function ft(t,r){return Object.entries(r).reduce(function(t,r){var e=rt(r,2),n=e[0],o=e[1];return t.replaceAll("{{".concat(n,"}}"),o)},t)}var st={setDefaults:function(t){at=t||{}},getDefaults:function(){return X(X({},G),at)},register:function(t){ot.set(t.id,t)},get:function(t){return ot.get(t)},list:function(){return function(t){if(Array.isArray(t))return nt(t)}(t=ot.values())||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||et(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.")}();var t},clear:function(){ot.clear()},initialise:function(){this.register(U),this.register(Y),this.register(R)},resolve:function(t,r,e){var n=ct(t,r||{},e);return t?(n.selectedColor="none",n.activeColor="none",ft(t.svg,n)):""},resolveActive:function(t,r,e){var n=ct(t,r||{},e);return t?ft(t.svg,n):""},resolveSelected:function(t,r,e){var n=ct(t,r||{},e);return t?(n.activeColor="none",ft(t.svg,n)):""},getSymbolImageId:function(t,r){var e=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2,o=this.getSymbolDef(t);if(!o)return null;var i=B(t),a=e?this.resolveActive(o,i,r):this.resolve(o,i,r);return"symbol-".concat(e?"act-":"").concat(lt(a),"-").concat(n,"x")},getSymbolDef:function(t){return t.symbolSvgContent?{svg:t.symbolSvgContent}:t.symbol?this.get(t.symbol):void 0},rasteriseSymbolImage:function(t,r,e,n){var o,i=this;return(o=q().m(function o(){var a,l,u,c,f,s,y,p,b,m,v,d;return q().w(function(o){for(;;)switch(o.n){case 0:if(a=i.getSymbolDef(t)){o.n=1;break}return o.a(2,null);case 1:if(l=B(t),"active"===e?(u=i.resolveActive(a,l,r),c="act-"):"selected"===e?(u=i.resolveSelected(a,l,r),c="sel-"):(u=i.resolve(a,l,r),c=""),f="symbol-".concat(c).concat(lt(u),"-").concat(n,"x"),s=it.get(f)){o.n=3;break}return y=K(t,a),p=y.split(" ").map(Number),b=rt(p,4),m=b[2],v=b[3],d='<svg xmlns="http://www.w3.org/2000/svg" width="'.concat(m*n,'" height="').concat(v*n,'" viewBox="').concat(y,'">').concat(u,"</svg>"),o.n=2,$(d,m*n,v*n);case 2:s=o.v,it.set(f,s);case 3:return o.a(2,{imageId:f,imageData:s})}},o)}),function(){var t=this,r=arguments;return new Promise(function(e,n){var i=o.apply(t,r);function a(t){J(i,e,n,a,l,"next",t)}function l(t){J(i,e,n,a,l,"throw",t)}a(void 0)})})()}};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,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),e.push.apply(e,n)}return e}function bt(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?pt(Object(e),!0).forEach(function(r){mt(t,r,e[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):pt(Object(e)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))})}return t}function mt(t,r,e){return(r=function(t){var r=function(t){if("object"!=yt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var e=r.call(t,"string");if("object"!=yt(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==yt(r)?r:r+""}(r))in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}st.initialise();var vt=function(t){var r,e=t.keyDefinition,n=t.mapStyle,o=t.symbolDef,i=e.style,a=null!==(r=null==n?void 0:n.appColorScheme)&&void 0!==r?r:"light",l=bt(bt({},n),{},{mapColorScheme:a}),u=st.resolve(o,B(i),l),c=K(i,o);return u&&c?(0,m.jsx)("svg",bt(bt({},k),{},{viewBox:c,children:(0,m.jsx)("g",{dangerouslySetInnerHTML:{__html:u}})})):null};function dt(t){return dt="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},dt(t)}function ht(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),e.push.apply(e,n)}return e}function gt(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?ht(Object(e),!0).forEach(function(r){St(t,r,e[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):ht(Object(e)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))})}return t}function St(t,r,e){return(r=function(t){var r=function(t){if("object"!=dt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var e=r.call(t,"string");if("object"!=dt(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==dt(r)?r:r+""}(r))in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}var Ot=function(t){var r=t.mapStyle,e=t.keyDefinition.style,n=e.strokeWidth,o=h(e.stroke,r.id);return(0,m.jsx)("svg",gt(gt({},P),{},{children:(0,m.jsx)("line",{x1:n/2,y1:10,x2:w-n/2,y2:10,stroke:o,strokeWidth:n,strokeLinecap:"round"})}))};function jt(t){return jt="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},jt(t)}function wt(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),e.push.apply(e,n)}return e}function Pt(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?wt(Object(e),!0).forEach(function(r){kt(t,r,e[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):wt(Object(e)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))})}return t}function kt(t,r,e){return(r=function(t){var r=function(t){if("object"!=jt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var e=r.call(t,"string");if("object"!=jt(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==jt(r)?r:r+""}(r))in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}var Dt=function(t){var r=t.mapStyle,e=t.keyDefinition.style,n=e.strokeWidth,o=h(e.fill,r.id),i=h(e.stroke,r.id);return(0,m.jsx)("svg",Pt(Pt({},P),{},{children:(0,m.jsx)("rect",{x:n/2,y:n/2,width:w-n,height:w-n,rx:n,ry:n,fill:o,stroke:i,strokeWidth:n,strokeLinejoin:"round"})}))},Ct=function(t){var r=t.mapStyle,e=t.keyDefinition.style,n=h(e.fill,r.id),o=h(e.fill,r.id);return(0,m.jsx)("svg",{viewBox:"0 0 5 5",preserveAspectRatio:"none",fill:n,stroke:o,strokeWidth:"1",children:(0,m.jsx)("path",{d:"M0 0h5v5H0z"})})},xt="horizontal-ramp",At=function(t){var r=t.keyDefinition,e=t.groupStyle,n=t.mapStyle,o=function(t,r){if(!t)return{symbolShape:null,symbolDef:null};var e=t.hasSymbol,n=t.hasPattern,o=t.style;if(r===xt)return{symbolShape:xt,symbolDef:null};if(e){var i=st.getSymbolDef(o);return{symbolShape:i?"symbol":"rect",symbolDef:i}}return n?{symbolShape:"pattern",symbolDef:null}:"line"===o.keySymbolShape?{symbolShape:"line",symbolDef:null}:{symbolShape:"rect",symbolDef:null}}(r,e),i=o.symbolShape,a=o.symbolDef;return i?"symbol"===i?(0,m.jsx)(vt,{mapStyle:n,keyDefinition:r,symbolDef:a}):"pattern"===i?(0,m.jsx)(H,{mapStyle:n,keyDefinition:r}):"line"===i?(0,m.jsx)(Ot,{mapStyle:n,keyDefinition:r}):i===xt?(0,m.jsx)(Ct,{mapStyle:n,keyDefinition:r}):(0,m.jsx)(Dt,{mapStyle:n,keyDefinition:r}):null},Et=function(t){var r=t.keyDefinition,e=t.groupStyle,n=t.mapStyle,o=r.label,i=h(r.symbolDescription,n.id);return(0,m.jsxs)("div",{className:"im-c-map-key-list__item",children:[(0,m.jsx)("dt",{className:"im-c-map-key-list__item-symbol",children:(0,m.jsx)(At,{keyDefinition:r,groupStyle:e,mapStyle:n})}),(0,m.jsxs)("dd",{className:"im-c-map-key-list__item-label",children:[o,i&&(0,m.jsxs)("span",{className:"govuk-visually-hidden",children:["(",i,")"]})]})]})},It=function(t){var r=t.headingId,e=t.label,n=t.groupStyle,o=t.keyDefinitions,i=t.mapStyle,a="im-c-map-key-list"+(n?" im-c-map-key-list-".concat(n):"");return(0,m.jsxs)("section",{className:"im-c-map-key__group","aria-labelledby":r,children:[(0,m.jsx)("h3",{id:r,className:"im-c-map-key__group-heading",children:e}),(0,m.jsx)("dl",{className:a,children:o.map(function(t){return(0,m.jsx)(Et,{keyDefinition:t,mapStyle:i,groupStyle:n},"".concat(t.id))})})]})},Mt="im-c-map-key",Lt=function(t){var r=t.item,e=t.groupStyle,n=t.mapStyle;return"group"===r.type?(0,m.jsx)(It,{headingId:"key-heading-".concat(r.id),label:r.groupLabel,groupStyle:e,keyDefinitions:r.keyDefinitions,mapStyle:n}):(0,m.jsx)(Et,{keyDefinition:r.keyDefinition,mapStyle:n})},_t=function(t){var r=t.noKeyItemText,e=t.keyGroups,n=t.hasGroups,o=t.mapStyle;if(null==e||!e.length)return(0,m.jsx)(v,{text:r});var i=n?"".concat(Mt," ").concat("im-c-map-key--has-groups"):Mt;return(0,m.jsx)("div",{className:i,children:e.map(function(t){return(0,m.jsx)(Lt,{item:t,mapStyle:o,groupStyle:t.groupStyle},t.id)})})};function Tt(t,r){return function(t){if(Array.isArray(t))return t}(t)||function(t,r){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var n,o,i,a,l=[],u=!0,c=!1;try{if(i=(e=e.call(t)).next,0===r){if(Object(e)!==e)return;u=!1}else for(;!(u=(n=i.call(e)).done)&&(l.push(n.value),l.length!==r);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=e.return&&(a=e.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(t,r)||function(t,r){if(t){if("string"==typeof t)return zt(t,r);var e={}.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?zt(t,r):void 0}}(t,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.")}()}function zt(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=Array(r);e<r;e++)n[e]=t[e];return n}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 Vt(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),e.push.apply(e,n)}return e}function Bt(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?Vt(Object(e),!0).forEach(function(r){Kt(t,r,e[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Vt(Object(e)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))})}return t}function Kt(t,r,e){return(r=function(t){var r=function(t){if("object"!=Ht(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var e=r.call(t,"string");if("object"!=Ht(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ht(r)?r:r+""}(r))in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}function Gt(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=Array(r);e<r;e++)n[e]=t[e];return n}function Nt(t){return Nt="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},Nt(t)}function Ut(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),e.push.apply(e,n)}return e}function Yt(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?Ut(Object(e),!0).forEach(function(r){Rt(t,r,e[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Ut(Object(e)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))})}return t}function Rt(t,r,e){return(r=function(t){var r=function(t){if("object"!=Nt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var e=r.call(t,"string");if("object"!=Nt(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Nt(r)?r:r+""}(r))in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}function Ft(t){return function(t){if(Array.isArray(t))return $t(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,r){if(t){if("string"==typeof t)return $t(t,r);var e={}.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?$t(t,r):void 0}}(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 $t(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=Array(r);e<r;e++)n[e]=t[e];return n}var Wt={InitComponent:function(t){var r=t.pluginConfig,e=t.pluginState,o=t.mapState,a=t.services,l=e.dispatch,u=a.eventBus,c=(0,n.useRef)(e);c.current=e,(0,n.useEffect)(function(){o.isMapReady&&(function(t){y=t}(c),u.requestOnce("datasets:registry",i),u.emit("map-key:ready"))},[o.isMapReady]),(0,n.useEffect)(function(){if(r.groups){var t=Object.entries(r.groups).map(function(t){var r,e,n=(e=2,function(t){if(Array.isArray(t))return t}(r=t)||function(t,r){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var n,o,i,a,l=[],u=!0,c=!1;try{if(i=(e=e.call(t)).next,0===r){if(Object(e)!==e)return;u=!1}else for(;!(u=(n=i.call(e)).done)&&(l.push(n.value),l.length!==r);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=e.return&&(a=e.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(r,e)||function(t,r){if(t){if("string"==typeof t)return Gt(t,r);var e={}.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Gt(t,r):void 0}}(r,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.")}()),o=n[0],i=n[1];return Bt(Bt({},i),{},{id:o,label:i.groupLabel})});l({type:"ADD_KEY_GROUPS",payload:t})}},[r.groups])},reducer:{initialState:{keyDefinitions:[],groups:[]},actions:{ADD_KEY_SYMBOL:function(t,r){var e,n=r.id,o=r.groupLabel,i=r.groupId||((e=o)?e.toLowerCase().replace(/\s+/g,"-"):null),a=function(t,r,e){return t.groups.find(function(t){return"group"===t.type&&t.id===e||"flat"===t.type&&t.id===r})}(t,n,i),l=a?null:function(t,r,e){return r?{id:r,type:"group",groupLabel:e}:{id:t,type:"flat"}}(n,i,o),u=l?[].concat(Ft(t.groups),[l]):t.groups,c=[].concat(Ft(t.keyDefinitions),[Yt(Yt({},r),{},{type:"manual"},i?{groupId:i}:{})]);return Yt(Yt({},t),{},{keyDefinitions:c,groups:u})},REMOVE_KEY_SYMBOL:function(t,r){var e=r.id;return Yt(Yt({},t),{},{keyDefinitions:t.keyDefinitions.filter(function(t){return t.id!==e})})},ADD_KEY_GROUPS:function(t,r){return Yt(Yt({},t),{},{groups:[].concat(Ft(t.groups),Ft(r))})}}},panels:[{id:"mapKey",label:"Key",mobile:{slot:"drawer",modal:!0},tablet:{slot:"left-top",width:"260px"},desktop:{slot:"left-top",width:"280px"},render:function(t){var r=t.mapState.mapStyle,e=t.pluginConfig.noKeyItemText,i=t.pluginState,a=t.services.eventBus,u=Tt((0,n.useState)(o),2),c=u[0],s=u[1],v=Tt((0,n.useState)(function(){var t;return null!==(t=null==c?void 0:c.keyItems().items)&&void 0!==t?t:[]}),2),d=v[0],h=v[1],g=Tt((0,n.useState)(function(){var t;return null!==(t=null==c?void 0:c.keyItems().hasGroups)&&void 0!==t&&t}),2),S=g[0],O=g[1],j=function(){var t=c.keyItems(),r=t.items,e=t.hasGroups,n=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=l(function(){var t;if(null===(t=y)||void 0===t||!t.current)return[];if(p===y.current)return b;p=y.current;var r=y.current,e=r.groups,n=void 0===e?[]:e,o=r.keyDefinitions,i=void 0===o?[]:o;return b=n.map(function(t){return"flat"===t.type?f(f({},t),{},{keyDefinition:i.find(function(r){return r.id===t.id})}):f(f({},t),{},{keyDefinitions:i.filter(function(r){return r.groupId===t.id})})})}());if(0===r.length)return t;var e=t.map(function(t){var e=r.findIndex(function(r){return r.id===t.id});if(-1===e)return t;var n=r.splice(e,1)[0];return f(f(f({},t),n),{},{keyDefinitions:[].concat(l(n.keyDefinitions||[]),l(t.keyDefinitions||[]))})});return[].concat(l(e),l(r)).filter(function(t){var r;return"flat"===t.type&&t.keyDefinition||"group"===t.type&&(null===(r=t.keyDefinitions)||void 0===r?void 0:r.length)})}(r);h(n),O(e)},w=function(t){c.invalidateKeyItemsOnMenuStateChange(t),j()};return(0,n.useEffect)(function(){return c?(j(),a.on("menu:changed",w).on("datasets:changed",j),function(){return a.off("menu:changed",w).off("datasets:changed",j)}):(a.requestOnce("datasets:registry",s),function(){})},[c]),(0,n.useEffect)(function(){c&&j()},[i]),(0,m.jsx)(_t,{noKeyItemText:e,keyGroups:d,hasGroups:S,mapStyle:r})}}],buttons:[{id:"mapKey",panelId:"mapKey",label:"Key",iconId:"key",mobile:{slot:"top-left",showLabel:!0},tablet:{slot:"top-left",showLabel:!0},desktop:{slot:"top-left",showLabel:!0}}],icons:[{id:"key",svgContent:'<path d="M3 5h.01"/><path d="M3 12h.01"/><path d="M3 19h.01"/><path d="M8 5h13"/><path d="M8 12h13"/><path d="M8 19h13"/>'}],api:{addSymbol:function(t,r){(0,t.pluginState.dispatch)({type:"ADD_KEY_SYMBOL",payload:r})},removeSymbol:function(t,r){(0,t.pluginState.dispatch)({type:"REMOVE_KEY_SYMBOL",payload:r})}}}}}]);
2
+ "use strict";(this.webpackChunkdefra_DefraMap=this.webpackChunkdefra_DefraMap||[]).push([[414],{64(t,r,e){e.r(r),e.d(r,{manifest:()=>Xt});var n=e(738),o=null,i=function(t){return o=t};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 l(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)||function(t,r){if(t){if("string"==typeof t)return u(t,r);var e={}.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?u(t,r):void 0}}(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 u(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=Array(r);e<r;e++)n[e]=t[e];return n}function c(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),e.push.apply(e,n)}return e}function f(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?c(Object(e),!0).forEach(function(r){s(t,r,e[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):c(Object(e)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))})}return t}function s(t,r,e){return(r=function(t){var r=function(t){if("object"!=a(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var e=r.call(t,"string");if("object"!=a(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==a(r)?r:r+""}(r))in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}var y={},p=null,b=[],m=e(287),v=function(t){var r=t.text;return(0,m.jsx)("div",{className:"im-c-map-key",children:(0,m.jsx)("p",{className:"im-c-map-key__empty-message",children:r})})};function d(t){return d="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},d(t)}var h=function(t,r){if(!t)return null;if("string"==typeof t)return t.trim();if("object"===d(t)){if(r&&t[r])return t[r];var e=Object.values(t)[0];return null!=e?e:null}return 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 S(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),e.push.apply(e,n)}return e}function O(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?S(Object(e),!0).forEach(function(r){j(t,r,e[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):S(Object(e)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))})}return t}function j(t,r,e){return(r=function(t){var r=function(t){if("object"!=g(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var e=r.call(t,"string");if("object"!=g(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==g(r)?r:r+""}(r))in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}var w=20,P={xmlns:"http://www.w3.org/2000/svg",width:w,height:w,viewBox:"0 0 ".concat(w," ").concat(w),className:"im-c-map-key-symbol","aria-hidden":"true",focusable:"false"},k=O(O({},P),{},{width:44,height:44,className:"im-c-map-key-symbol im-c-map-key-symbol--point"}),D={"cross-hatch":'<path d="M0 4.486V3.485h3.5V.001h1v3.484h7.002V.001h1v3.484h3.5v1.001h-3.5v7h3.5v.999h-3.5v3.516h-1v-3.516H4.499v3.516h-1v-3.516H0v-.999h3.5v-7H0zm11.501 0H4.499v7h7.002v-7z" fill="{{foregroundColor}}"/>',"diagonal-cross-hatch":'<path d="M0 8.707V7.293L7.293 0h1.414L16 7.293v1.414L8.707 16H7.293L0 8.707zM.707 8L8 15.293 15.293 8 8 .707.707 8z" fill="{{foregroundColor}}"/>',"forward-diagonal-hatch":'<path d="M16 8.707V7.293L7.293 16h1.414L16 8.707zm-16 0L8.707 0H7.293L0 7.293v1.414z" fill="{{foregroundColor}}"/>',"backward-diagonal-hatch":'<path d="M0 8.707V7.293L8.707 16H7.293L0 8.707zm16 0L7.293 0h1.414L16 7.293v1.414z" fill="{{foregroundColor}}"/>',"horizontal-hatch":'<path d="M0 4.5V3.499h15.999V4.5H0zm0 7h15.999V12.5H0v-1.001z" fill="{{foregroundColor}}"/>',"vertical-hatch":'<path d="M3.501 16.001V0h1v16.001h-1zm7.998 0V0h1v16.001h-1z" fill="{{foregroundColor}}"/>',dot:'<path d="M3.999 2A2 2 0 0 1 6 3.999C6 5.103 5.103 6 3.999 6a2 2 0 0 1-1.999-2.001A2 2 0 0 1 3.999 2zm0 7.999C5.103 10 6 10.897 6 12.001A2 2 0 0 1 3.999 14a2 2 0 0 1-1.999-1.999A2 2 0 0 1 3.999 10zM11.999 2A2 2 0 0 1 14 3.999C14 5.103 13.103 6 11.999 6S10 5.103 10 3.999A2 2 0 0 1 11.999 2zm0 7.999c1.104 0 2.001.897 2.001 2.001A2 2 0 0 1 11.999 14 2 2 0 0 1 10 12.001c0-1.104.897-2.001 1.999-2.001z" fill="{{foregroundColor}}"/>',diamond:'<path d="M4 .465L7.535 4 4 7.535.465 4 4 .465zm0 7.999l3.535 3.535L4 15.535.465 11.999 4 8.464zm8-8l3.535 3.535-3.536 3.536L8.464 4 12 .464zm0 8.001L15.536 12 12 15.536 8.465 12 12 8.465z" fill="{{foregroundColor}}"/>'};function C(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=Array(r);e<r;e++)n[e]=t[e];return n}var x=function(t){return Math.max(2,2*t)},A=function(t,r,e){return t.replace(/\{\{foregroundColor\}\}/g,r||"black").replace(/\{\{backgroundColor\}\}/g,e||"transparent")},E=function(t,r,e){return new Promise(function(n,o){var i="data:image/svg+xml;charset=utf-8,".concat(encodeURIComponent(t)),a=new Image(r,e);a.onload=function(){var t=document.createElement("canvas");t.width=r,t.height=e;var o=t.getContext("2d");o.drawImage(a,0,0,r,e),n(o.getImageData(0,0,r,e))},a.onerror=function(){o(new Error("Failed to rasterise SVG: ".concat(t.slice(0,80))))},a.src=i})};function I(){var t,r,e="function"==typeof Symbol?Symbol:{},n=e.iterator||"@@iterator",o=e.toStringTag||"@@toStringTag";function i(e,n,o,i){var u=n&&n.prototype instanceof l?n:l,c=Object.create(u.prototype);return M(c,"_invoke",function(e,n,o){var i,l,u,c=0,f=o||[],s=!1,y={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(r,e){return i=r,l=0,u=t,y.n=e,a}};function p(e,n){for(l=e,u=n,r=0;!s&&c&&!o&&r<f.length;r++){var o,i=f[r],p=y.p,b=i[2];e>3?(o=b===n)&&(u=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=t):i[0]<=p&&((o=e<2&&p<i[1])?(l=0,y.v=n,y.n=i[1]):p<b&&(o=e<3||i[0]>n||n>b)&&(i[4]=e,i[5]=n,y.n=b,l=0))}if(o||e>1)return a;throw s=!0,n}return function(o,f,b){if(c>1)throw TypeError("Generator is already running");for(s&&1===f&&p(f,b),l=f,u=b;(r=l<2?t:u)||!s;){i||(l?l<3?(l>1&&(y.n=-1),p(l,u)):y.n=u:y.v=u);try{if(c=2,i){if(l||(o="next"),r=i[o]){if(!(r=r.call(i,u)))throw TypeError("iterator result is not an object");if(!r.done)return r;u=r.value,l<2&&(l=0)}else 1===l&&(r=i.return)&&r.call(i),l<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=t}else if((r=(s=y.n<0)?u:e.call(n,y))!==a)break}catch(r){i=t,l=1,u=r}finally{c=1}}return{value:r,done:s}}}(e,o,i),!0),c}var a={};function l(){}function u(){}function c(){}r=Object.getPrototypeOf;var f=[][n]?r(r([][n]())):(M(r={},n,function(){return this}),r),s=c.prototype=l.prototype=Object.create(f);function y(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,M(t,o,"GeneratorFunction")),t.prototype=Object.create(s),t}return u.prototype=c,M(s,"constructor",c),M(c,"constructor",u),u.displayName="GeneratorFunction",M(c,o,"GeneratorFunction"),M(s),M(s,o,"Generator"),M(s,n,function(){return this}),M(s,"toString",function(){return"[object Generator]"}),(I=function(){return{w:i,m:y}})()}function M(t,r,e,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}M=function(t,r,e,n){function i(r,e){M(t,r,function(t){return this._invoke(r,e,t)})}r?o?o(t,r,{value:e,enumerable:!n,configurable:!n,writable:!n}):t[r]=e:(i("next",0),i("throw",1),i("return",2))},M(t,r,e,n)}function _(t,r,e,n,o,i,a){try{var l=t[i](a),u=l.value}catch(t){return void e(t)}l.done?r(u):Promise.resolve(u).then(n,o)}function L(t,r){if(t){if("string"==typeof t)return T(t,r);var e={}.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?T(t,r):void 0}}function T(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=Array(r);e<r;e++)n[e]=t[e];return n}var z=new Map,H=new Map,V={register:function(t,r){z.set(t,{id:t,svgContent:r})},get:function(t){return z.get(t)},list:function(){return function(t){if(Array.isArray(t))return T(t)}(t=z.values())||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||L(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.")}();var t},clear:function(){z.clear()},initialise:function(){var t=this;Object.entries(D).forEach(function(r){var e,n,o=(n=2,function(t){if(Array.isArray(t))return t}(e=r)||function(t,r){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var n,o,i,a,l=[],u=!0,c=!1;try{if(i=(e=e.call(t)).next,0===r){if(Object(e)!==e)return;u=!1}else for(;!(u=(n=i.call(e)).done)&&(l.push(n.value),l.length!==r);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=e.return&&(a=e.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,n)||L(e,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];t.register(i,a)})},getPatternInnerContent:function(t){return t.fillPatternSvgContent?t.fillPatternSvgContent:t.fillPattern&&null!==(r=null===(e=this.get(t.fillPattern))||void 0===e?void 0:e.svgContent)&&void 0!==r?r:null;var r,e},getKeyPatternPaths:function(t,r){var e=this.getPatternInnerContent(t);if(!e)return null;var n=h(t.fillPatternForegroundColor,r)||"black",o=h(t.fillPatternBackgroundColor,r)||"transparent",i=h(t.stroke,r)||n;return{border:A('<path d="M19 2.862v14.275c0 1.028-.835 1.862-1.862 1.862H2.863c-1.028 0-1.862-.835-1.862-1.862V2.862C1.001 1.834 1.836 1 2.863 1h14.275C18.166 1 19 1.835 19 2.862z" fill="{{backgroundColor}}" stroke="{{foregroundColor}}" stroke-width="2"/>',i,o),content:A(e,n,o)}},getPatternImageId:function(t,r){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=this.getPatternInnerContent(t);if(!n)return null;var o=h(t.fillPatternForegroundColor,r)||"black",i=h(t.fillPatternBackgroundColor,r)||"transparent",a=x(e);return"pattern-".concat(function(t){var r,e=0,n=function(t,r){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=function(t,r){if(t){if("string"==typeof t)return C(t,r);var e={}.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?C(t,r):void 0}}(t))||r&&t&&"number"==typeof t.length){e&&(t=e);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return a=t.done,t},e:function(t){l=!0,i=t},f:function(){try{a||null==e.return||e.return()}finally{if(l)throw i}}}}(t);try{for(n.s();!(r=n.n()).done;){var o=r.value;e=Math.trunc((e<<5)-e+o.codePointAt(0))}}catch(t){n.e(t)}finally{n.f()}return Math.abs(e).toString(36)}(n+o+i),"-").concat(a,"x")},rasterisePatternImage:function(t,r){var e,n=arguments,o=this;return(e=I().m(function e(){var i,a,l,u,c,f,s,y,p,b,m;return I().w(function(e){for(;;)switch(e.n){case 0:if(i=n.length>2&&void 0!==n[2]?n[2]:1,a=o.getPatternInnerContent(t)){e.n=1;break}return e.a(2,null);case 1:if(l=o.getPatternImageId(t,r,i)){e.n=2;break}return e.a(2,null);case 2:if(u=H.get(l)){e.n=4;break}return c=h(t.fillPatternForegroundColor,r)||"black",f=h(t.fillPatternBackgroundColor,r)||"transparent",s=A(a,c,f),y='<rect width="16" height="16" fill="'.concat(f,'"/>'),p=x(i),b=Math.round(8*p),m='<svg xmlns="http://www.w3.org/2000/svg" width="'.concat(b,'" height="').concat(b,'" viewBox="0 0 16 16">').concat(y).concat(s,"</svg>"),e.n=3,E(m,b,b);case 3:u=e.v,H.set(l,u);case 4:return e.a(2,{imageId:l,imageData:u})}},e)}),function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(t){_(i,n,o,a,l,"next",t)}function l(t){_(i,n,o,a,l,"throw",t)}a(void 0)})})()}};function B(t){return B="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},B(t)}function G(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),e.push.apply(e,n)}return e}function K(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?G(Object(e),!0).forEach(function(r){N(t,r,e[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):G(Object(e)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))})}return t}function N(t,r,e){return(r=function(t){var r=function(t){if("object"!=B(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var e=r.call(t,"string");if("object"!=B(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==B(r)?r:r+""}(r))in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}V.initialise();var F=function(t){var r=t.keyDefinition,e=t.mapStyle,n=r.style,o=V.getKeyPatternPaths(n,e.id);return o?(0,m.jsxs)("svg",K(K({},P),{},{children:[(0,m.jsx)("g",{dangerouslySetInnerHTML:{__html:o.border}}),(0,m.jsx)("g",{transform:"translate(".concat(2,", ").concat(2,")"),dangerouslySetInnerHTML:{__html:o.content}})]})):null},U=new Set(["symbolBackgroundColor","symbolForegroundColor","symbolHaloWidth","symbolGraphic"]),Y=function(t){if(!function(t){return!(!t.symbol&&!t.symbolSvgContent)}(t))return{};var r={};return U.forEach(function(e){if(null!=t[e]){var n=e.charAt(6).toLowerCase()+e.slice(7);r[n]=t[e]}}),r},R=function(t,r){var e;return t.symbolViewBox?t.symbolViewBox:null!==(e=null==r?void 0:r.viewBox)&&void 0!==e?e:"0 0 38 38"},$={symbol:"pin",backgroundColor:"#ca3535",foregroundColor:"#ffffff"},W={dot:"M8 3c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.241 5-5-2.24-5-5-5z",cross:"M6 3H10V6H13V10H10V13H6V10H3V6H6Z",diamond:"M8 2L14 8L8 14L2 8Z",triangle:"M8 2L14 14H2Z",square:"M3 3H13V13H3Z"},q={id:"pin",viewBox:"0 0 44 44",anchor:[.5,.9],graphic:W.dot,svg:'<path d="M22 40.999c-3.621 0-8.306-5.864-10.258-8.3C9.02 29.302 6 23.66 6 19.002a16.01 16.01 0 0 1 16-16 16.01 16.01 0 0 1 16 16c0 4.658-3.02 10.3-5.742 13.697-1.952 2.437-6.637 8.3-10.258 8.3z" fill="{{selectedColor}}" stroke="{{activeColor}}" stroke-width="6" paint-order="stroke fill"/>\n <path d="M22 7.001a12.01 12.01 0 0 1 12 12c0 7.623-10.377 17.998-12 17.998S10 26.624 10 19.001a12.01 12.01 0 0 1 12-12z" fill="{{backgroundColor}}" stroke="{{haloColor}}" stroke-width="2" paint-order="stroke fill"/>\n <g transform="translate(22, 19) scale(0.8) translate(-8, -8)"><path d="{{graphic}}" fill="{{foregroundColor}}"/></g>'},Z={id:"circle",viewBox:"0 0 44 44",anchor:[.5,.5],graphic:W.dot,svg:'<circle cx="22" cy="22" r="16" fill="{{selectedColor}}" stroke="{{activeColor}}" stroke-width="6" paint-order="stroke fill"/>\n <circle cx="22" cy="22" r="12" fill="{{backgroundColor}}" stroke="{{haloColor}}" stroke-width="2" paint-order="stroke fill"/>\n <g transform="translate(22, 22) scale(0.8) translate(-8, -8)"><path d="{{graphic}}" fill="{{foregroundColor}}"/></g>'},J={id:"square",viewBox:"0 0 44 44",anchor:[.5,.5],graphic:W.dot,svg:'<path d="M13 6h18c3.863 0 7 3.137 7 7v18c0 3.863-3.137 7-7 7H13c-3.863 0-7-3.137-7-7V13c0-3.863 3.137-7 7-7" fill="{{selectedColor}}" stroke="{{activeColor}}" stroke-width="6" paint-order="stroke fill"/>\n <path d="M13 34a3 3 0 0 1-3-3V13a3 3 0 0 1 3-3h18a3 3 0 0 1 3 3v18a3 3 0 0 1-3 3H13z" fill-rule="nonzero" fill="{{backgroundColor}}" stroke="{{haloColor}}" stroke-width="2" paint-order="stroke fill"/>\n <g transform="translate(22, 22) scale(0.8) translate(-8, -8)"><path d="{{graphic}}" fill="{{foregroundColor}}"/></g>'},Q={light:{haloColor:"#ffffff",selectedColor:"#0b0c0c",activeColor:"#ffdd00",foregroundColor:"#0b0c0c"},dark:{haloColor:"#0b0c0c",selectedColor:"#ffffff",activeColor:"#ffdd00",foregroundColor:"#ffffff"}};function X(t){return X="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},X(t)}function tt(){var t,r,e="function"==typeof Symbol?Symbol:{},n=e.iterator||"@@iterator",o=e.toStringTag||"@@toStringTag";function i(e,n,o,i){var u=n&&n.prototype instanceof l?n:l,c=Object.create(u.prototype);return rt(c,"_invoke",function(e,n,o){var i,l,u,c=0,f=o||[],s=!1,y={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(r,e){return i=r,l=0,u=t,y.n=e,a}};function p(e,n){for(l=e,u=n,r=0;!s&&c&&!o&&r<f.length;r++){var o,i=f[r],p=y.p,b=i[2];e>3?(o=b===n)&&(u=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=t):i[0]<=p&&((o=e<2&&p<i[1])?(l=0,y.v=n,y.n=i[1]):p<b&&(o=e<3||i[0]>n||n>b)&&(i[4]=e,i[5]=n,y.n=b,l=0))}if(o||e>1)return a;throw s=!0,n}return function(o,f,b){if(c>1)throw TypeError("Generator is already running");for(s&&1===f&&p(f,b),l=f,u=b;(r=l<2?t:u)||!s;){i||(l?l<3?(l>1&&(y.n=-1),p(l,u)):y.n=u:y.v=u);try{if(c=2,i){if(l||(o="next"),r=i[o]){if(!(r=r.call(i,u)))throw TypeError("iterator result is not an object");if(!r.done)return r;u=r.value,l<2&&(l=0)}else 1===l&&(r=i.return)&&r.call(i),l<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=t}else if((r=(s=y.n<0)?u:e.call(n,y))!==a)break}catch(r){i=t,l=1,u=r}finally{c=1}}return{value:r,done:s}}}(e,o,i),!0),c}var a={};function l(){}function u(){}function c(){}r=Object.getPrototypeOf;var f=[][n]?r(r([][n]())):(rt(r={},n,function(){return this}),r),s=c.prototype=l.prototype=Object.create(f);function y(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,rt(t,o,"GeneratorFunction")),t.prototype=Object.create(s),t}return u.prototype=c,rt(s,"constructor",c),rt(c,"constructor",u),u.displayName="GeneratorFunction",rt(c,o,"GeneratorFunction"),rt(s),rt(s,o,"Generator"),rt(s,n,function(){return this}),rt(s,"toString",function(){return"[object Generator]"}),(tt=function(){return{w:i,m:y}})()}function rt(t,r,e,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}rt=function(t,r,e,n){function i(r,e){rt(t,r,function(t){return this._invoke(r,e,t)})}r?o?o(t,r,{value:e,enumerable:!n,configurable:!n,writable:!n}):t[r]=e:(i("next",0),i("throw",1),i("return",2))},rt(t,r,e,n)}function et(t,r,e,n,o,i,a){try{var l=t[i](a),u=l.value}catch(t){return void e(t)}l.done?r(u):Promise.resolve(u).then(n,o)}function nt(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),e.push.apply(e,n)}return e}function ot(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?nt(Object(e),!0).forEach(function(r){it(t,r,e[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):nt(Object(e)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))})}return t}function it(t,r,e){return(r=function(t){var r=function(t){if("object"!=X(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var e=r.call(t,"string");if("object"!=X(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==X(r)?r:r+""}(r))in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}function at(t,r){return function(t){if(Array.isArray(t))return t}(t)||function(t,r){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var n,o,i,a,l=[],u=!0,c=!1;try{if(i=(e=e.call(t)).next,0===r){if(Object(e)!==e)return;u=!1}else for(;!(u=(n=i.call(e)).done)&&(l.push(n.value),l.length!==r);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=e.return&&(a=e.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(t,r)||lt(t,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.")}()}function lt(t,r){if(t){if("string"==typeof t)return ut(t,r);var e={}.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?ut(t,r):void 0}}function ut(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=Array(r);e<r;e++)n[e]=t[e];return n}var ct=new Map,ft=new Map,st={},yt=function(t){var r,e=0,n=function(t){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=lt(t))){r&&(t=r);var e=0,n=function(){};return{s:n,n:function(){return e>=t.length?{done:!0}:{done:!1,value:t[e++]}},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(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){a=!0,o=t},f:function(){try{i||null==r.return||r.return()}finally{if(a)throw o}}}}(t);try{for(n.s();!(r=n.n()).done;){var o=r.value;e=Math.trunc((e<<5)-e+o.codePointAt(0))}}catch(t){n.e(t)}finally{n.f()}return Math.abs(e).toString(36)},pt=new Set(["id","svg","viewBox","anchor","symbol","symbolSvgContent"]);function bt(t,r,e){var n,o,i,a,l=null==e?void 0:e.id,u=Object.fromEntries(Object.entries(t||{}).filter(function(t){var r=at(t,1)[0];return!pt.has(r)})),c=Object.fromEntries(Object.entries(st).filter(function(t){var r=at(t,1)[0];return!pt.has(r)})),f=Object.fromEntries(Object.entries(r).filter(function(t){return null!=at(t,2)[1]})),s=ot(ot(ot(ot({},$),c),u),f),y=null!==(n=Q[null==e?void 0:e.mapColorScheme])&&void 0!==n?n:Q.light;return s.haloColor=null!==(o=null==e?void 0:e.haloColor)&&void 0!==o?o:y.haloColor,s.selectedColor=null!==(i=null==e?void 0:e.selectedColor)&&void 0!==i?i:y.selectedColor,s.activeColor=null!==(a=null==e?void 0:e.activeColor)&&void 0!==a?a:y.activeColor,"string"==typeof s.graphic&&W[s.graphic]&&(s.graphic=W[s.graphic]),Object.fromEntries(Object.entries(s).map(function(t){var r=at(t,2),e=r[0],n=r[1];return[e,h(n,l)||""]}))}function mt(t,r){return Object.entries(r).reduce(function(t,r){var e=at(r,2),n=e[0],o=e[1];return t.replaceAll("{{".concat(n,"}}"),o)},t)}var vt={setDefaults:function(t){st=t||{}},getDefaults:function(){return ot(ot({},$),st)},register:function(t){ct.set(t.id,t)},get:function(t){return ct.get(t)},list:function(){return function(t){if(Array.isArray(t))return ut(t)}(t=ct.values())||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||lt(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.")}();var t},clear:function(){ct.clear()},initialise:function(){this.register(q),this.register(Z),this.register(J)},resolve:function(t,r,e){var n=bt(t,r||{},e);return t?(n.selectedColor="none",n.activeColor="none",mt(t.svg,n)):""},resolveActive:function(t,r,e){var n=bt(t,r||{},e);return t?mt(t.svg,n):""},resolveSelected:function(t,r,e){var n=bt(t,r||{},e);return t?(n.activeColor="none",mt(t.svg,n)):""},getSymbolImageId:function(t,r){var e=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2,o=this.getSymbolDef(t);if(!o)return null;var i=Y(t),a=e?this.resolveActive(o,i,r):this.resolve(o,i,r);return"symbol-".concat(e?"act-":"").concat(yt(a),"-").concat(n,"x")},getSymbolDef:function(t){return t.symbolSvgContent?{svg:t.symbolSvgContent}:t.symbol?this.get(t.symbol):void 0},rasteriseSymbolImage:function(t,r,e,n){var o,i=this;return(o=tt().m(function o(){var a,l,u,c,f,s,y,p,b,m,v,d;return tt().w(function(o){for(;;)switch(o.n){case 0:if(a=i.getSymbolDef(t)){o.n=1;break}return o.a(2,null);case 1:if(l=Y(t),"active"===e?(u=i.resolveActive(a,l,r),c="act-"):"selected"===e?(u=i.resolveSelected(a,l,r),c="sel-"):(u=i.resolve(a,l,r),c=""),f="symbol-".concat(c).concat(yt(u),"-").concat(n,"x"),s=ft.get(f)){o.n=3;break}return y=R(t,a),p=y.split(" ").map(Number),b=at(p,4),m=b[2],v=b[3],d='<svg xmlns="http://www.w3.org/2000/svg" width="'.concat(m*n,'" height="').concat(v*n,'" viewBox="').concat(y,'">').concat(u,"</svg>"),o.n=2,E(d,m*n,v*n);case 2:s=o.v,ft.set(f,s);case 3:return o.a(2,{imageId:f,imageData:s})}},o)}),function(){var t=this,r=arguments;return new Promise(function(e,n){var i=o.apply(t,r);function a(t){et(i,e,n,a,l,"next",t)}function l(t){et(i,e,n,a,l,"throw",t)}a(void 0)})})()}};function dt(t){return dt="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},dt(t)}function ht(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),e.push.apply(e,n)}return e}function gt(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?ht(Object(e),!0).forEach(function(r){St(t,r,e[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):ht(Object(e)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))})}return t}function St(t,r,e){return(r=function(t){var r=function(t){if("object"!=dt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var e=r.call(t,"string");if("object"!=dt(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==dt(r)?r:r+""}(r))in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}vt.initialise();var Ot=function(t){var r,e=t.keyDefinition,n=t.mapStyle,o=t.symbolDef,i=e.style,a=null!==(r=null==n?void 0:n.appColorScheme)&&void 0!==r?r:"light",l=gt(gt({},n),{},{mapColorScheme:a}),u=vt.resolve(o,Y(i),l),c=R(i,o);return u&&c?(0,m.jsx)("svg",gt(gt({},k),{},{viewBox:c,children:(0,m.jsx)("g",{dangerouslySetInnerHTML:{__html:u}})})):null};function jt(t){return jt="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},jt(t)}function wt(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),e.push.apply(e,n)}return e}function Pt(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?wt(Object(e),!0).forEach(function(r){kt(t,r,e[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):wt(Object(e)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))})}return t}function kt(t,r,e){return(r=function(t){var r=function(t){if("object"!=jt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var e=r.call(t,"string");if("object"!=jt(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==jt(r)?r:r+""}(r))in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}var Dt=function(t){var r=t.mapStyle,e=t.keyDefinition.style,n=e.strokeWidth,o=h(e.stroke,r.id);return(0,m.jsx)("svg",Pt(Pt({},P),{},{children:(0,m.jsx)("line",{x1:n/2,y1:10,x2:w-n/2,y2:10,stroke:o,strokeWidth:n,strokeLinecap:"round"})}))};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 xt(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),e.push.apply(e,n)}return e}function At(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?xt(Object(e),!0).forEach(function(r){Et(t,r,e[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):xt(Object(e)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))})}return t}function Et(t,r,e){return(r=function(t){var r=function(t){if("object"!=Ct(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var e=r.call(t,"string");if("object"!=Ct(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ct(r)?r:r+""}(r))in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}var It=function(t){var r=t.mapStyle,e=t.keyDefinition.style,n=e.strokeWidth,o=h(e.fill,r.id),i=h(e.stroke,r.id);return(0,m.jsx)("svg",At(At({},P),{},{children:(0,m.jsx)("rect",{x:n/2,y:n/2,width:w-n,height:w-n,rx:n,ry:n,fill:o,stroke:i,strokeWidth:n,strokeLinejoin:"round"})}))},Mt=function(t){var r=t.mapStyle,e=t.keyDefinition.style,n=h(e.fill,r.id),o=h(e.fill,r.id);return(0,m.jsx)("svg",{viewBox:"0 0 5 5",preserveAspectRatio:"none",fill:n,stroke:o,strokeWidth:"1",children:(0,m.jsx)("path",{d:"M0 0h5v5H0z"})})},_t="horizontal-ramp",Lt=function(t){var r=t.keyDefinition,e=t.groupStyle,n=t.mapStyle,o=function(t,r){if(!t)return{symbolShape:null,symbolDef:null};var e=t.hasSymbol,n=t.hasPattern,o=t.style;if(r===_t)return{symbolShape:_t,symbolDef:null};if(e){var i=vt.getSymbolDef(o);return{symbolShape:i?"symbol":"rect",symbolDef:i}}return n?{symbolShape:"pattern",symbolDef:null}:"line"===o.keySymbolShape?{symbolShape:"line",symbolDef:null}:{symbolShape:"rect",symbolDef:null}}(r,e),i=o.symbolShape,a=o.symbolDef;return i?"symbol"===i?(0,m.jsx)(Ot,{mapStyle:n,keyDefinition:r,symbolDef:a}):"pattern"===i?(0,m.jsx)(F,{mapStyle:n,keyDefinition:r}):"line"===i?(0,m.jsx)(Dt,{mapStyle:n,keyDefinition:r}):i===_t?(0,m.jsx)(Mt,{mapStyle:n,keyDefinition:r}):(0,m.jsx)(It,{mapStyle:n,keyDefinition:r}):null},Tt=function(t){var r=t.keyDefinition,e=t.groupStyle,n=t.mapStyle,o=r.label,i=h(r.symbolDescription,n.id);return(0,m.jsxs)("div",{className:"im-c-map-key-list__item",children:[(0,m.jsx)("dt",{className:"im-c-map-key-list__item-symbol",children:(0,m.jsx)(Lt,{keyDefinition:r,groupStyle:e,mapStyle:n})}),(0,m.jsxs)("dd",{className:"im-c-map-key-list__item-label",children:[o,i&&(0,m.jsxs)("span",{className:"govuk-visually-hidden",children:["(",i,")"]})]})]})},zt=function(t){var r=t.headingId,e=t.label,n=t.groupStyle,o=t.keyDefinitions,i=t.mapStyle,a="im-c-map-key-list"+(n?" im-c-map-key-list-".concat(n):"");return(0,m.jsxs)("section",{className:"im-c-map-key__group","aria-labelledby":r,children:[(0,m.jsx)("h3",{id:r,className:"im-c-map-key__group-heading",children:e}),(0,m.jsx)("dl",{className:a,children:o.map(function(t){return(0,m.jsx)(Tt,{keyDefinition:t,mapStyle:i,groupStyle:n},"".concat(t.id))})})]})},Ht="im-c-map-key",Vt=function(t){var r=t.item,e=t.groupStyle,n=t.mapStyle;return"group"===r.type?(0,m.jsx)(zt,{headingId:"key-heading-".concat(r.id),label:r.groupLabel,groupStyle:e,keyDefinitions:r.keyDefinitions,mapStyle:n}):(0,m.jsx)(Tt,{keyDefinition:r.keyDefinition,mapStyle:n})},Bt=function(t){var r=t.noKeyItemText,e=t.keyGroups,n=t.hasGroups,o=t.mapStyle;if(null==e||!e.length)return(0,m.jsx)(v,{text:r});var i=n?"".concat(Ht," ").concat("im-c-map-key--has-groups"):Ht;return(0,m.jsx)("div",{className:i,children:e.map(function(t){return(0,m.jsx)(Vt,{item:t,mapStyle:o,groupStyle:t.groupStyle},t.id)})})};function Gt(t,r){return function(t){if(Array.isArray(t))return t}(t)||function(t,r){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var n,o,i,a,l=[],u=!0,c=!1;try{if(i=(e=e.call(t)).next,0===r){if(Object(e)!==e)return;u=!1}else for(;!(u=(n=i.call(e)).done)&&(l.push(n.value),l.length!==r);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=e.return&&(a=e.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(t,r)||function(t,r){if(t){if("string"==typeof t)return Kt(t,r);var e={}.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Kt(t,r):void 0}}(t,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.")}()}function Kt(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=Array(r);e<r;e++)n[e]=t[e];return n}function Nt(t){return Nt="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},Nt(t)}function Ft(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),e.push.apply(e,n)}return e}function Ut(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?Ft(Object(e),!0).forEach(function(r){Yt(t,r,e[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Ft(Object(e)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))})}return t}function Yt(t,r,e){return(r=function(t){var r=function(t){if("object"!=Nt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var e=r.call(t,"string");if("object"!=Nt(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Nt(r)?r:r+""}(r))in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}function Rt(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=Array(r);e<r;e++)n[e]=t[e];return n}function $t(t){return $t="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},$t(t)}function Wt(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),e.push.apply(e,n)}return e}function qt(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?Wt(Object(e),!0).forEach(function(r){Zt(t,r,e[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Wt(Object(e)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))})}return t}function Zt(t,r,e){return(r=function(t){var r=function(t){if("object"!=$t(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var e=r.call(t,"string");if("object"!=$t(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==$t(r)?r:r+""}(r))in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}function Jt(t){return function(t){if(Array.isArray(t))return Qt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,r){if(t){if("string"==typeof t)return Qt(t,r);var e={}.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Qt(t,r):void 0}}(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 Qt(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=Array(r);e<r;e++)n[e]=t[e];return n}var Xt={InitComponent:function(t){var r=t.pluginConfig,e=t.pluginState,o=t.mapState,a=t.services,l=e.dispatch,u=a.eventBus,c=(0,n.useRef)(e);c.current=e,(0,n.useEffect)(function(){o.isMapReady&&(function(t){y=t}(c),u.requestOnce("datasets:registry",i),u.emit("map-key:ready"))},[o.isMapReady]),(0,n.useEffect)(function(){if(r.groups){var t=Object.entries(r.groups).map(function(t){var r,e,n=(e=2,function(t){if(Array.isArray(t))return t}(r=t)||function(t,r){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var n,o,i,a,l=[],u=!0,c=!1;try{if(i=(e=e.call(t)).next,0===r){if(Object(e)!==e)return;u=!1}else for(;!(u=(n=i.call(e)).done)&&(l.push(n.value),l.length!==r);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=e.return&&(a=e.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(r,e)||function(t,r){if(t){if("string"==typeof t)return Rt(t,r);var e={}.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Rt(t,r):void 0}}(r,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.")}()),o=n[0],i=n[1];return Ut(Ut({},i),{},{id:o,label:i.groupLabel})});l({type:"ADD_KEY_GROUPS",payload:t})}},[r.groups])},reducer:{initialState:{keyDefinitions:[],groups:[]},actions:{ADD_KEY_SYMBOL:function(t,r){var e,n=r.id,o=r.groupLabel,i=r.groupId||((e=o)?e.toLowerCase().replace(/\s+/g,"-"):null),a=function(t,r,e){return t.groups.find(function(t){return"group"===t.type&&t.id===e||"flat"===t.type&&t.id===r})}(t,n,i),l=a?null:function(t,r,e){return r?{id:r,type:"group",groupLabel:e}:{id:t,type:"flat"}}(n,i,o),u=l?[].concat(Jt(t.groups),[l]):t.groups,c=[].concat(Jt(t.keyDefinitions),[qt(qt({},r),{},{type:"manual"},i?{groupId:i}:{})]);return qt(qt({},t),{},{keyDefinitions:c,groups:u})},REMOVE_KEY_SYMBOL:function(t,r){var e=r.id;return qt(qt({},t),{},{keyDefinitions:t.keyDefinitions.filter(function(t){return t.id!==e})})},ADD_KEY_GROUPS:function(t,r){return qt(qt({},t),{},{groups:[].concat(Jt(t.groups),Jt(r))})}}},panels:[{id:"mapKey",label:"Key",mobile:{slot:"drawer",modal:!0},tablet:{slot:"left-top",width:"260px"},desktop:{slot:"left-top",width:"280px"},render:function(t){var r=t.mapState.mapStyle,e=t.pluginConfig.noKeyItemText,i=t.pluginState,a=t.services.eventBus,u=Gt((0,n.useState)(o),2),c=u[0],s=u[1],v=Gt((0,n.useState)(function(){var t;return null!==(t=null==c?void 0:c.keyItems().items)&&void 0!==t?t:[]}),2),d=v[0],h=v[1],g=Gt((0,n.useState)(function(){var t;return null!==(t=null==c?void 0:c.keyItems().hasGroups)&&void 0!==t&&t}),2),S=g[0],O=g[1],j=function(){var t=c.keyItems(),r=t.items,e=t.hasGroups,n=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=l(function(){var t;if(null===(t=y)||void 0===t||!t.current)return[];if(p===y.current)return b;p=y.current;var r=y.current,e=r.groups,n=void 0===e?[]:e,o=r.keyDefinitions,i=void 0===o?[]:o;return b=n.map(function(t){return"flat"===t.type?f(f({},t),{},{keyDefinition:i.find(function(r){return r.id===t.id})}):f(f({},t),{},{keyDefinitions:i.filter(function(r){return r.groupId===t.id})})})}());if(0===r.length)return t;var e=t.map(function(t){var e=r.findIndex(function(r){return r.id===t.id});if(-1===e)return t;var n=r.splice(e,1)[0];return f(f(f({},t),n),{},{keyDefinitions:[].concat(l(n.keyDefinitions||[]),l(t.keyDefinitions||[]))})});return[].concat(l(e),l(r)).filter(function(t){var r;return"flat"===t.type&&t.keyDefinition||"group"===t.type&&(null===(r=t.keyDefinitions)||void 0===r?void 0:r.length)})}(r);h(n),O(e)},w=function(t){c.invalidateKeyItemsOnMenuStateChange(t),j()};return(0,n.useEffect)(function(){return c?(j(),a.on("menu:changed",w).on("datasets:changed",j),function(){return a.off("menu:changed",w).off("datasets:changed",j)}):(a.requestOnce("datasets:registry",s),function(){})},[c]),(0,n.useEffect)(function(){c&&j()},[i]),(0,m.jsx)(Bt,{noKeyItemText:e,keyGroups:d,hasGroups:S,mapStyle:r})}}],buttons:[{id:"mapKey",panelId:"mapKey",label:"Key",iconId:"key",mobile:{slot:"top-left",showLabel:!0},tablet:{slot:"top-left",showLabel:!0},desktop:{slot:"top-left",showLabel:!0}}],icons:[{id:"key",svgContent:'<path d="M3 5h.01"/><path d="M3 12h.01"/><path d="M3 19h.01"/><path d="M8 5h13"/><path d="M8 12h13"/><path d="M8 19h13"/>'}],api:{addSymbol:function(t,r){(0,t.pluginState.dispatch)({type:"ADD_KEY_SYMBOL",payload:r})},removeSymbol:function(t,r){(0,t.pluginState.dispatch)({type:"REMOVE_KEY_SYMBOL",payload:r})}}}}}]);