@defra/interactive-map 0.0.23-alpha → 0.0.25-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/images/light-raster-thumb.jpg +0 -0
- package/assets/images/outdoor-raster-thumb.jpg +0 -0
- package/assets/images/road-raster-thumb.jpg +0 -0
- package/dist/css/index.css +1 -1
- package/docs/api/map-style-config.md +39 -2
- package/docs/plugins/search.md +70 -0
- package/package.json +17 -2
- package/plugins/beta/draw-ml/dist/esm/im-draw-ml-plugin.js +1 -1
- package/plugins/beta/draw-ml/dist/umd/im-draw-ml-plugin.js +1 -1
- package/plugins/beta/draw-ml/src/api/editFeature.js +9 -4
- package/plugins/beta/draw-ml/src/modes/createDrawMode.js +11 -3
- package/plugins/beta/scale-bar/dist/css/index.css +31 -1
- package/plugins/interact/src/hooks/useAttachEvents.test.js +3 -0
- package/plugins/search/dist/css/index.css +250 -1
- package/plugins/search/dist/esm/im-search-plugin.js +1 -1
- package/plugins/search/dist/esm/index.js +1 -1
- package/plugins/search/dist/umd/im-search-plugin.js +1 -1
- package/plugins/search/dist/umd/index.js +1 -1
- package/plugins/search/src/Search.jsx +2 -1
- package/plugins/search/src/components/Form/Form.jsx +11 -7
- package/plugins/search/src/components/Form/Form.test.jsx +23 -1
- package/plugins/search/src/datasets.js +2 -2
- package/plugins/search/src/datasets.test.js +1 -1
- package/plugins/search/src/defaults.js +7 -1
- package/plugins/search/src/events/fetchSuggestions.js +13 -10
- package/plugins/search/src/events/fetchSuggestions.test.js +14 -1
- package/plugins/search/src/events/formHandlers.js +2 -4
- package/plugins/search/src/events/formHandlers.test.js +3 -3
- package/plugins/search/src/events/inputHandlers.js +1 -1
- package/plugins/search/src/events/inputHandlers.test.js +1 -1
- package/plugins/search/src/events/suggestionHandlers.js +2 -1
- package/plugins/search/src/events/suggestionHandlers.test.js +7 -1
- package/plugins/search/src/index.js +3 -7
- package/plugins/search/src/reducer.js +10 -5
- package/plugins/search/src/reducer.test.js +2 -1
- package/plugins/search/src/utils/parseOsNamesResults.js +3 -3
- package/providers/beta/openlayers/dist/esm/im-openlayers-provider.js +1 -0
- package/providers/beta/openlayers/dist/esm/index.js +1 -0
- package/providers/beta/openlayers/dist/umd/im-openlayers-provider.js +2 -0
- package/providers/beta/openlayers/dist/umd/im-openlayers-provider.js.LICENSE.txt +1 -0
- package/providers/beta/openlayers/dist/umd/index.js +2 -0
- package/providers/beta/openlayers/dist/umd/index.js.LICENSE.txt +1 -0
- package/providers/beta/openlayers/src/appEvents.js +39 -0
- package/providers/beta/openlayers/src/appEvents.test.js +117 -0
- package/providers/beta/openlayers/src/defaults.js +36 -0
- package/providers/beta/openlayers/src/index.js +21 -0
- package/providers/beta/openlayers/src/mapEvents.js +132 -0
- package/providers/beta/openlayers/src/mapEvents.test.js +198 -0
- package/providers/beta/openlayers/src/openlayersProvider.js +249 -0
- package/providers/beta/openlayers/src/openlayersProvider.test.js +386 -0
- package/providers/beta/openlayers/src/utils/spatial.js +146 -0
- package/providers/beta/openlayers/src/utils/spatial.test.js +119 -0
- package/providers/beta/openlayers/src/utils/tileLayers.js +133 -0
- package/providers/beta/openlayers/src/utils/tileLayers.test.js +251 -0
- package/providers/beta/openlayers/src/utils/zoom.js +26 -0
- package/providers/beta/openlayers/src/utils/zoom.test.js +23 -0
- package/providers/maplibre/dist/esm/im-maplibre-provider.js +1 -1
- package/providers/maplibre/dist/umd/im-maplibre-provider.js +1 -1
- package/providers/maplibre/src/utils/highlightFeatures.js +17 -7
- package/providers/maplibre/src/utils/highlightFeatures.test.js +17 -0
- package/providers/maplibre/src/utils/maplibreFixes.js +1 -1
- package/providers/maplibre/src/utils/patternImages.js +14 -9
- package/providers/maplibre/src/utils/patternImages.test.js +2 -1
- package/rollup.esm.mjs +14 -3
- package/src/App/hooks/useFeatureItems.test.js +1 -0
- package/src/App/hooks/useLayoutMeasurements.test.js +0 -1
- package/src/App/hooks/useMarkersAPI.test.js +1 -0
- package/src/App/hooks/useModalPanelBehaviour.test.js +2 -1
- package/src/App/layout/layout.module.scss +1 -0
- package/src/App/store/AppProvider.test.jsx +5 -0
- package/src/App/store/MapProvider.test.jsx +8 -1
- package/src/services/announcer.test.js +5 -7
- package/src/types.js +11 -1
- package/webpack.dev.mjs +14 -5
- package/webpack.umd.mjs +1 -0
|
@@ -6,19 +6,24 @@ import { getSnapInstance } from '../utils/snapHelpers.js'
|
|
|
6
6
|
* @param {string} featureId - ID of the feature to edit
|
|
7
7
|
* @param {object} options - Options including snapLayers
|
|
8
8
|
*/
|
|
9
|
-
export const editFeature = ({ appState, appConfig, mapState, pluginConfig, pluginState, mapProvider }, featureId, options = {}) => {
|
|
9
|
+
export const editFeature = ({ appState, appConfig, mapState, pluginConfig, pluginState, mapProvider, services }, featureId, options = {}) => {
|
|
10
10
|
const { dispatch } = pluginState
|
|
11
11
|
const { draw, map } = mapProvider
|
|
12
|
+
const { eventBus } = services
|
|
12
13
|
|
|
13
14
|
if (!draw) {
|
|
14
|
-
return
|
|
15
|
+
return false
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
// Guard: feature must exist in draw before doing anything
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
const existingFeature = draw.get(featureId)
|
|
20
|
+
if (!existingFeature) {
|
|
21
|
+
return false
|
|
20
22
|
}
|
|
21
23
|
|
|
24
|
+
const editModeMap = { LineString: 'edit_line', Polygon: 'edit_polygon' }
|
|
25
|
+
eventBus.emit('draw:editstart', { mode: editModeMap[existingFeature.geometry.type] })
|
|
26
|
+
|
|
22
27
|
// Determin snapLayers from pluginConfig or runtime config
|
|
23
28
|
let snapLayers = null
|
|
24
29
|
if (options.snapLayers === undefined) {
|
|
@@ -110,6 +110,11 @@ export const createDrawMode = (ParentMode, config) => {
|
|
|
110
110
|
if (coords.length > 0) {
|
|
111
111
|
coords[coords.length - 1] = [e.lngLat.lng, e.lngLat.lat]
|
|
112
112
|
}
|
|
113
|
+
// For polygon: prevent duplicate-coordinate clicks from reaching ParentMode, which
|
|
114
|
+
// would trigger a changeMode chain and cause a runtime error on coords.length access
|
|
115
|
+
if (!finishOnInvalidClick && !validateClick(getFeature(state))) {
|
|
116
|
+
return
|
|
117
|
+
}
|
|
113
118
|
}
|
|
114
119
|
const coordsBefore = getCoords(getFeature(state)).length
|
|
115
120
|
ParentMode.onClick.call(this, state, e)
|
|
@@ -154,15 +159,18 @@ export const createDrawMode = (ParentMode, config) => {
|
|
|
154
159
|
this._simulateMouse('click', ParentMode.onClick, state)
|
|
155
160
|
}
|
|
156
161
|
|
|
157
|
-
// Push undo if a vertex was added
|
|
158
|
-
|
|
162
|
+
// Push undo and update count if a vertex was added
|
|
163
|
+
const newCoords = getCoords(getFeature(state))
|
|
164
|
+
if (newCoords.length > coordsBefore) {
|
|
159
165
|
this.pushDrawUndo(state)
|
|
166
|
+
this.dispatchVertexChange(newCoords)
|
|
160
167
|
}
|
|
161
168
|
},
|
|
162
169
|
|
|
163
170
|
dispatchVertexChange (coords) {
|
|
171
|
+
// Subtract 1 to exclude the rubber-band vertex that mapbox-gl-draw always appends
|
|
164
172
|
this.map.fire('draw.vertexchange', {
|
|
165
|
-
numVertecies: coords.length
|
|
173
|
+
numVertecies: Math.max(0, coords.length - 1)
|
|
166
174
|
})
|
|
167
175
|
},
|
|
168
176
|
|
|
@@ -1 +1,31 @@
|
|
|
1
|
-
.im-c-scale-bar
|
|
1
|
+
.im-c-scale-bar {
|
|
2
|
+
position: relative;
|
|
3
|
+
margin-left: auto;
|
|
4
|
+
margin-bottom: 1px;
|
|
5
|
+
text-align: right;
|
|
6
|
+
padding-bottom: 5px;
|
|
7
|
+
color: var(--map-overlay-foreground-color);
|
|
8
|
+
user-select: none;
|
|
9
|
+
height: 25px;
|
|
10
|
+
width: 100px;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.im-c-scale-bar__label {
|
|
14
|
+
text-shadow: -1px -1px 0 var(--map-overlay-halo-color), 1px -1px 0 var(--map-overlay-halo-color), -1px 1px 0 var(--map-overlay-halo-color), 1px 1px 0 var(--map-overlay-halo-color);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.im-c-scale-bar::after {
|
|
18
|
+
content: "";
|
|
19
|
+
position: absolute;
|
|
20
|
+
bottom: 0;
|
|
21
|
+
left: 0;
|
|
22
|
+
height: 4px;
|
|
23
|
+
width: 100%;
|
|
24
|
+
background-color: var(--map-overlay-foreground-color);
|
|
25
|
+
box-shadow: -1px -1px 0 var(--map-overlay-halo-color), 1px -1px 0 var(--map-overlay-halo-color), -1px 1px 0 var(--map-overlay-halo-color), 1px 1px 0 var(--map-overlay-halo-color);
|
|
26
|
+
}
|
|
27
|
+
@media (forced-colors: active) {
|
|
28
|
+
.im-c-scale-bar::after {
|
|
29
|
+
background-color: Canvas;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -54,7 +54,10 @@ describe('useAttachEvents', () => {
|
|
|
54
54
|
it('enables click handling after a macrotask', () => {
|
|
55
55
|
jest.useFakeTimers()
|
|
56
56
|
renderHook(() => useAttachEvents(props))
|
|
57
|
+
const { clickReadyRef } = attachEvents.mock.calls[0][0]
|
|
58
|
+
expect(clickReadyRef.current).toBe(false)
|
|
57
59
|
act(() => jest.runAllTimers())
|
|
60
|
+
expect(clickReadyRef.current).toBe(true)
|
|
58
61
|
jest.useRealTimers()
|
|
59
62
|
})
|
|
60
63
|
|
|
@@ -1 +1,250 @@
|
|
|
1
|
-
.im-c-search-form
|
|
1
|
+
.im-c-search-form {
|
|
2
|
+
display: none;
|
|
3
|
+
padding: 0;
|
|
4
|
+
min-height: auto;
|
|
5
|
+
border-radius: 0;
|
|
6
|
+
}
|
|
7
|
+
.im-c-search-form:before {
|
|
8
|
+
border-radius: 0;
|
|
9
|
+
box-shadow: none;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.im-o-app--mobile .im-c-search-form {
|
|
13
|
+
position: absolute;
|
|
14
|
+
left: 0;
|
|
15
|
+
top: 0;
|
|
16
|
+
right: 0;
|
|
17
|
+
height: auto;
|
|
18
|
+
overflow: visible;
|
|
19
|
+
filter: var(--search-drop-shadow);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.im-o-app--tablet .im-c-search-form,
|
|
23
|
+
.im-o-app--desktop .im-c-search-form {
|
|
24
|
+
position: relative;
|
|
25
|
+
overflow: visible;
|
|
26
|
+
border-radius: var(--button-border-radius);
|
|
27
|
+
box-shadow: none;
|
|
28
|
+
filter: var(--search-drop-shadow);
|
|
29
|
+
}
|
|
30
|
+
.im-o-app--tablet .im-c-search-form:before,
|
|
31
|
+
.im-o-app--desktop .im-c-search-form:before {
|
|
32
|
+
border-radius: var(--button-border-radius);
|
|
33
|
+
}
|
|
34
|
+
.im-o-app--tablet .im-c-search-form .im-c-search-suggestions,
|
|
35
|
+
.im-o-app--desktop .im-c-search-form .im-c-search-suggestions {
|
|
36
|
+
position: absolute;
|
|
37
|
+
top: calc(100% + 1px);
|
|
38
|
+
left: 0;
|
|
39
|
+
right: 0;
|
|
40
|
+
z-index: 1;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.im-c-search__status {
|
|
44
|
+
position: absolute;
|
|
45
|
+
top: 100%;
|
|
46
|
+
left: 0;
|
|
47
|
+
right: 0;
|
|
48
|
+
padding: var(--divider-gap) calc(var(--divider-gap) + 2px);
|
|
49
|
+
background-color: var(--background-color);
|
|
50
|
+
border-top: 1px solid var(--button-hover-color);
|
|
51
|
+
border-bottom-left-radius: var(--button-border-radius);
|
|
52
|
+
border-bottom-right-radius: var(--button-border-radius);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.im-o-app--mobile .im-c-search-form--default-expanded {
|
|
56
|
+
position: relative;
|
|
57
|
+
margin: calc(-1 * var(--primary-gap)) calc(-1 * var(--primary-gap)) 0;
|
|
58
|
+
}
|
|
59
|
+
.im-o-app--mobile .im-c-search-form--default-expanded .im-c-search-suggestions {
|
|
60
|
+
position: absolute;
|
|
61
|
+
top: 100%;
|
|
62
|
+
width: 100%;
|
|
63
|
+
left: 0;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.im-c-search-open-button {
|
|
67
|
+
position: relative;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.im-c-search-close-button {
|
|
71
|
+
position: relative;
|
|
72
|
+
}
|
|
73
|
+
.im-c-search-close-button:before {
|
|
74
|
+
box-shadow: none;
|
|
75
|
+
}
|
|
76
|
+
.im-c-search-close-button[data-focus-visible=true] {
|
|
77
|
+
z-index: 1;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.im-c-search-submit-button:before {
|
|
81
|
+
box-shadow: none;
|
|
82
|
+
}
|
|
83
|
+
.im-c-search-submit-button[data-focus-visible=true] {
|
|
84
|
+
z-index: 1;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.im-c-search-suggestions {
|
|
88
|
+
max-height: calc(100vh - 66px);
|
|
89
|
+
overflow-y: auto;
|
|
90
|
+
scroll-padding: 0;
|
|
91
|
+
margin: 0;
|
|
92
|
+
padding: 0;
|
|
93
|
+
background-color: var(--background-color);
|
|
94
|
+
list-style: none;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.im-c-search-suggestions__item {
|
|
98
|
+
margin: 0;
|
|
99
|
+
padding: calc(var(--divider-gap) + 2px) var(--primary-gap);
|
|
100
|
+
position: relative;
|
|
101
|
+
color: var(--secondary-text-color);
|
|
102
|
+
border-top: 1px solid var(--button-hover-color);
|
|
103
|
+
cursor: pointer;
|
|
104
|
+
}
|
|
105
|
+
.im-c-search-suggestions__item mark {
|
|
106
|
+
font-weight: bold;
|
|
107
|
+
color: var(--foreground-color);
|
|
108
|
+
background-color: transparent;
|
|
109
|
+
pointer-events: none;
|
|
110
|
+
}
|
|
111
|
+
@media (hover: hover) and (pointer: fine) {
|
|
112
|
+
.im-c-search-suggestions__item:hover:not([aria-selected=true]) {
|
|
113
|
+
background-color: var(--button-hover-color);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
.im-c-search-suggestions__item[aria-selected=true] {
|
|
117
|
+
background-color: var(--button-hover-color);
|
|
118
|
+
}
|
|
119
|
+
.im-c-search-suggestions__item[aria-selected=true] mark {
|
|
120
|
+
color: var(--fixed-foreground-color);
|
|
121
|
+
}
|
|
122
|
+
.im-c-search-suggestions__item:hover:not([aria-selected=true]) .im-c-search-suggestions__label {
|
|
123
|
+
text-decoration: underline;
|
|
124
|
+
text-underline-offset: 2px;
|
|
125
|
+
text-decoration-thickness: 2px;
|
|
126
|
+
text-decoration-color: var(--foreground-color);
|
|
127
|
+
text-decoration-skip-ink: none;
|
|
128
|
+
}
|
|
129
|
+
.im-c-search-suggestions__item[aria-selected=true] .im-c-search-suggestions__label {
|
|
130
|
+
outline: 3px solid rgba(0, 0, 0, 0);
|
|
131
|
+
color: var(--focus-border-color);
|
|
132
|
+
background-color: var(--focus-outline-color);
|
|
133
|
+
box-shadow: 0 -2px var(--focus-outline-color), 0 4px var(--focus-border-color);
|
|
134
|
+
text-decoration: none;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.im-c-search-suggestions__label {
|
|
138
|
+
display: block;
|
|
139
|
+
overflow: hidden;
|
|
140
|
+
white-space: nowrap;
|
|
141
|
+
text-overflow: ellipsis;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.im-o-app--mobile .im-c-search-form--default-expanded .im-c-search-suggestions {
|
|
145
|
+
box-shadow: var(--panel-box-shadow);
|
|
146
|
+
clip-path: inset(0px 0px -20px 0px);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.im-o-app--tablet .im-c-search-suggestions,
|
|
150
|
+
.im-o-app--desktop .im-c-search-suggestions {
|
|
151
|
+
border-bottom-left-radius: var(--button-border-radius);
|
|
152
|
+
border-bottom-right-radius: var(--button-border-radius);
|
|
153
|
+
}
|
|
154
|
+
.im-o-app--tablet .im-c-search-suggestions__item,
|
|
155
|
+
.im-o-app--desktop .im-c-search-suggestions__item {
|
|
156
|
+
padding: var(--divider-gap) calc(var(--divider-gap) + 2px);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
:root {
|
|
160
|
+
--search-drop-shadow: drop-shadow(0 -2px 20px rgba(0,0,0,.1)) drop-shadow(0 0 12px rgba(0,0,0,.1));
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.im-c-search__input-container {
|
|
164
|
+
display: flex;
|
|
165
|
+
position: relative;
|
|
166
|
+
flex: 1 1 auto;
|
|
167
|
+
min-height: auto;
|
|
168
|
+
height: var(--button-size);
|
|
169
|
+
}
|
|
170
|
+
.im-c-search__input-container:before {
|
|
171
|
+
content: "";
|
|
172
|
+
z-index: 1;
|
|
173
|
+
position: absolute;
|
|
174
|
+
top: -1px;
|
|
175
|
+
right: -1px;
|
|
176
|
+
bottom: -1px;
|
|
177
|
+
left: -1px;
|
|
178
|
+
border-radius: var(--button-border-radius);
|
|
179
|
+
border: 2px solid var(--foreground-color);
|
|
180
|
+
pointer-events: none;
|
|
181
|
+
}
|
|
182
|
+
.im-c-search__input-container:after {
|
|
183
|
+
position: absolute;
|
|
184
|
+
content: "";
|
|
185
|
+
pointer-events: none;
|
|
186
|
+
z-index: 99;
|
|
187
|
+
top: -1px;
|
|
188
|
+
right: -1px;
|
|
189
|
+
bottom: -1px;
|
|
190
|
+
left: -1px;
|
|
191
|
+
border: var(--focus-border-width) solid var(--focus-border-color);
|
|
192
|
+
outline: var(--focus-outline-width) solid var(--focus-outline-color);
|
|
193
|
+
border-radius: calc(var(--button-border-radius) - 2px);
|
|
194
|
+
opacity: 0;
|
|
195
|
+
}
|
|
196
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
197
|
+
.im-c-search__input-container:after {
|
|
198
|
+
transition: opacity var(--duration) ease;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.im-o-app .im-c-search__input {
|
|
203
|
+
width: 100%;
|
|
204
|
+
color: var(--foreground-color);
|
|
205
|
+
background-color: transparent;
|
|
206
|
+
font-size: 1rem;
|
|
207
|
+
border: 0;
|
|
208
|
+
padding: var(--divider-gap) calc(var(--divider-gap) + 2px);
|
|
209
|
+
outline: 0;
|
|
210
|
+
}
|
|
211
|
+
.im-o-app .im-c-search__input:focus {
|
|
212
|
+
outline: 3px solid transparent;
|
|
213
|
+
box-shadow: none;
|
|
214
|
+
}
|
|
215
|
+
.im-o-app .im-c-search__input::placeholder {
|
|
216
|
+
color: var(--foreground-color);
|
|
217
|
+
}
|
|
218
|
+
.im-o-app .im-c-search__input::-webkit-search-cancel-button {
|
|
219
|
+
-webkit-appearance: none;
|
|
220
|
+
appearance: none;
|
|
221
|
+
display: none;
|
|
222
|
+
}
|
|
223
|
+
.im-o-app .im-c-search__input::-moz-search-clear {
|
|
224
|
+
display: none;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.im-c-search__hint {
|
|
228
|
+
display: none;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.im-o-app--exclusive-control .im-o-app__top .im-c-button-wrapper,
|
|
232
|
+
.im-o-app--exclusive-control .im-o-app__right .im-c-button-wrapper {
|
|
233
|
+
opacity: 0;
|
|
234
|
+
z-index: -1;
|
|
235
|
+
}
|
|
236
|
+
.im-o-app--exclusive-control .im-o-app__left-top .im-c-panel,
|
|
237
|
+
.im-o-app--exclusive-control .im-o-app__left-bottom .im-c-panel,
|
|
238
|
+
.im-o-app--exclusive-control .im-o-app__right-top .im-c-panel,
|
|
239
|
+
.im-o-app--exclusive-control .im-o-app__right-bottom .im-c-panel {
|
|
240
|
+
opacity: 0;
|
|
241
|
+
z-index: -1;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.im-o-app--mobile .im-c-search__input-container {
|
|
245
|
+
margin: var(--primary-gap);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.im-c-search__input-container--keyboard-focus-within:after {
|
|
249
|
+
opacity: 1;
|
|
250
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useEffect as e,useRef as t}from"preact/compat";import{jsxs as r,jsx as n}from"preact/jsx-runtime";import a from"@babel/runtime/helpers/defineProperty";import i from"@babel/runtime/helpers/objectWithoutProperties";import o from"@babel/runtime/helpers/taggedTemplateLiteral";import s from"@babel/runtime/helpers/asyncToGenerator";function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach(function(t){a(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var u={TOGGLE_EXPANDED:(e,t)=>c(c({},e),{},{isExpanded:t,areSuggestionsVisible:t,hasFetchedSuggestions:!1}),SET_KEYBOARD_FOCUS_WITHIN:(e,t)=>c(c({},e),{},{hasKeyboardFocusWithin:t,areSuggestionsVisible:!0}),INPUT_BLUR:(e,t)=>c(c({},e),{},{hasKeyboardFocusWithin:!1,areSuggestionsVisible:e.areSuggestionsVisible&&"keyboard"!==t,selectedIndex:-1}),SET_VALUE:(e,t)=>c(c({},e),{},{value:t}),UPDATE_SUGGESTIONS:(e,t)=>c(c({},e),{},{suggestions:t,hasFetchedSuggestions:!0}),SHOW_SUGGESTIONS:e=>c(c({},e),{},{areSuggestionsVisible:!0,hasFetchedSuggestions:!1}),HIDE_SUGGESTIONS:e=>c(c({},e),{},{areSuggestionsVisible:!1,hasFetchedSuggestions:!1}),SET_SELECTED:(e,t)=>c(c({},e),{},{selectedIndex:t,areSuggestionsVisible:t>=0})},d=e=>{var{id:t,isExpanded:a,onClick:i,buttonRef:o,searchIcon:s,showLabel:l}=e;return r("button",{"aria-label":"Open search",className:"im-c-map-button im-c-search-open-button",onClick:i,"aria-controls":"".concat(t,"-search-form"),ref:o,style:a?{display:"none"}:void 0,children:[s&&n("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",dangerouslySetInnerHTML:{__html:s}}),l&&n("span",{children:"Search"})]})},h=e=>{var{id:t,pluginState:r,handleSuggestionClick:a}=e;return n("ul",{id:"".concat(t,"-search-suggestions"),role:"listbox","aria-labelledby":"".concat(t,"-search"),className:"im-c-search-suggestions",style:r.areSuggestionsVisible&&r.suggestions.length?void 0:{display:"none"},children:r.suggestions.map((e,i)=>n("li",{id:"".concat(t,"-search-suggestion-").concat(i),className:"im-c-search-suggestions__item",role:"option","aria-selected":r.selectedIndex===i,"aria-setsize":r.suggestions.length,"aria-posinset":i+1,onClick:()=>a(e),children:n("span",{className:"im-c-search-suggestions__label",dangerouslySetInnerHTML:{__html:e.marked}})},e.id))})};function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}var f=(e,t,r)=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(Object(r),!0).forEach(function(t){a(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({display:e.expanded||t.isExpanded?"flex":void 0},"mobile"!==r.breakpoint&&(null==e?void 0:e.width)&&{width:e.width}),g=t=>{var{id:a,pluginState:i,pluginConfig:o,appState:s,inputRef:l,events:c,services:u,children:d}=t,{areSuggestionsVisible:p,hasFetchedSuggestions:g,suggestions:m=[]}=i;e(()=>{p&&g&&u.announce((e=>{if(0===e)return"No results available";var t=1===e?"result":"results";return"".concat(e," ").concat(t," available")})(m.length))},[m,g]);var y=["im-c-search-form",o.expanded&&"im-c-search-form--default-expanded","im-c-panel"].filter(Boolean).join(" "),b=p&&g&&!m.length;return r("form",{id:"".concat(a,"-search-form"),role:"search",className:y,style:f(o,i,s),"aria-controls":"".concat(a,"-viewport"),onSubmit:e=>c.handleSubmit(e,s,i),children:[n("button",{type:"submit",style:{display:"none"},"aria-hidden":"true",tabIndex:-1,children:"Submit"}),r("div",{className:"im-c-search__input-container".concat(i.hasKeyboardFocusWithin?" im-c-search__input-container--keyboard-focus-within":""),children:[n("label",{htmlFor:"".concat(a,"-search"),className:"im-u-visually-hidden",children:o.placeholder}),n("input",{id:"".concat(a,"-search"),className:"im-c-search__input",type:"search",role:"combobox","aria-expanded":i.suggestionsVisible,"aria-controls":"".concat(a,"-search-suggestions"),"aria-activedescendant":i.selectedIndex>=0?"".concat(a,"-search-suggestion-").concat(i.selectedIndex):void 0,"aria-describedby":i.value?void 0:"".concat(a,"-search-hint"),"aria-autocomplete":"list",autoComplete:"off",placeholder:o.placeholder,name:"".concat(a,"-search"),spellCheck:!1,enterKeyHint:"search",value:i.value,onClick:c.handleInputClick,onChange:c.handleInputChange,onFocus:()=>c.handleInputFocus(s.interfaceType),onBlur:()=>c.handleInputBlur(s.interfaceType),onKeyDown:e=>c.handleInputKeyDown(e,i),ref:l}),n("span",{id:"".concat(a,"-search-hint"),className:"im-c-search__hint",children:"When search results are available use up and down arrows to review and enter to select. Touch device users, explore by touch or with swipe gestures."}),d]}),b&&n("div",{className:"im-c-search__status","aria-hidden":"true",children:"No results available"}),n(h,{id:a,appState:s,pluginState:i,handleSuggestionClick:e=>c.handleSuggestionClick(e,s)})]})},m=e=>{var{defaultExpanded:t,onClick:r,closeIcon:a}=e;return n("button",{"aria-label":"Close search",className:"im-c-map-button im-c-search-close-button",type:"button",onClick:r,style:t?{display:"none"}:void 0,children:a&&n("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",dangerouslySetInnerHTML:{__html:a}})})},y=e=>{var{defaultExpanded:t,submitIcon:r}=e;return n("button",{"aria-label":"Search",className:"im-c-map-button im-c-search-submit-button",type:"submit",style:t?void 0:{display:"none"},children:r&&n("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",dangerouslySetInnerHTML:{__html:r}})})};let b=" ";class w{static get separator(){return b}static set separator(e){b=e}static parse(e){if(!isNaN(parseFloat(e))&&isFinite(e))return Number(e);const t=String(e).trim().replace(/^-/,"").replace(/[NSEW]$/i,"").split(/[^0-9.,]+/);if(""==t[t.length-1]&&t.splice(t.length-1),""==t)return NaN;let r=null;switch(t.length){case 3:r=t[0]/1+t[1]/60+t[2]/3600;break;case 2:r=t[0]/1+t[1]/60;break;case 1:r=t[0];break;default:return NaN}return/^-|[WS]$/i.test(e.trim())&&(r=-r),Number(r)}static toDms(e,t="d",r=void 0){if(isNaN(e))return null;if("string"==typeof e&&""==e.trim())return null;if("boolean"==typeof e)return null;if(e==1/0)return null;if(null==e)return null;if(void 0===r)switch(t){case"d":case"deg":r=4;break;case"dm":case"deg+min":r=2;break;case"dms":case"deg+min+sec":r=0;break;default:t="d",r=4}e=Math.abs(e);let n=null,a=null,i=null,o=null;switch(t){default:case"d":case"deg":a=e.toFixed(r),a<100&&(a="0"+a),a<10&&(a="0"+a),n=a+"°";break;case"dm":case"deg+min":a=Math.floor(e),i=(60*e%60).toFixed(r),60==i&&(i=(0).toFixed(r),a++),a=("000"+a).slice(-3),i<10&&(i="0"+i),n=a+"°"+w.separator+i+"′";break;case"dms":case"deg+min+sec":a=Math.floor(e),i=Math.floor(3600*e/60)%60,o=(3600*e%60).toFixed(r),60==o&&(o=(0).toFixed(r),i++),60==i&&(i=0,a++),a=("000"+a).slice(-3),i=("00"+i).slice(-2),o<10&&(o="0"+o),n=a+"°"+w.separator+i+"′"+w.separator+o+"″"}return n}static toLat(e,t,r){const n=w.toDms(w.wrap90(e),t,r);return null===n?"–":n.slice(1)+w.separator+(e<0?"S":"N")}static toLon(e,t,r){const n=w.toDms(w.wrap180(e),t,r);return null===n?"–":n+w.separator+(e<0?"W":"E")}static toBrng(e,t,r){const n=w.toDms(w.wrap360(e),t,r);return null===n?"–":n.replace("360","0")}static fromLocale(e){const t=123456.789.toLocaleString(),r={thousands:t.slice(3,4),decimal:t.slice(7,8)};return e.replace(r.thousands,"⁜").replace(r.decimal,".").replace("⁜",",")}static toLocale(e){const t=123456.789.toLocaleString(),r={thousands:t.slice(3,4),decimal:t.slice(7,8)};return e.replace(/,([0-9])/,"⁜$1").replace(".",r.decimal).replace("⁜",r.thousands)}static compassPoint(e,t=3){if(![1,2,3].includes(Number(t)))throw new RangeError(`invalid precision ‘${t}’`);e=w.wrap360(e);const r=4*2**(t-1);return["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.round(e*r/360)%r*16/r]}static wrap90(e){if(-90<=e&&e<=90)return e;const t=e,r=360;return 1*Math.abs(((t-90)%r+r)%r-180)-90}static wrap180(e){if(-180<=e&&e<=180)return e;const t=360;return((360*e/t-180)%t+t)%t-180}static wrap360(e){if(0<=e&&e<360)return e;const t=360;return(360*e/t%t+t)%t}}Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};class E{constructor(e,t,r){if(isNaN(e)||isNaN(t)||isNaN(r))throw new TypeError(`invalid vector [${e},${t},${r}]`);this.x=Number(e),this.y=Number(t),this.z=Number(r)}get length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}plus(e){if(!(e instanceof E))throw new TypeError("v is not Vector3d object");return new E(this.x+e.x,this.y+e.y,this.z+e.z)}minus(e){if(!(e instanceof E))throw new TypeError("v is not Vector3d object");return new E(this.x-e.x,this.y-e.y,this.z-e.z)}times(e){if(isNaN(e))throw new TypeError(`invalid scalar value ‘${e}’`);return new E(this.x*e,this.y*e,this.z*e)}dividedBy(e){if(isNaN(e))throw new TypeError(`invalid scalar value ‘${e}’`);return new E(this.x/e,this.y/e,this.z/e)}dot(e){if(!(e instanceof E))throw new TypeError("v is not Vector3d object");return this.x*e.x+this.y*e.y+this.z*e.z}cross(e){if(!(e instanceof E))throw new TypeError("v is not Vector3d object");const t=this.y*e.z-this.z*e.y,r=this.z*e.x-this.x*e.z,n=this.x*e.y-this.y*e.x;return new E(t,r,n)}negate(){return new E(-this.x,-this.y,-this.z)}unit(){const e=this.length;if(1==e)return this;if(0==e)return this;const t=this.x/e,r=this.y/e,n=this.z/e;return new E(t,r,n)}angleTo(e,t=void 0){if(!(e instanceof E))throw new TypeError("v is not Vector3d object");if(!(t instanceof E||null==t))throw new TypeError("n is not Vector3d object");const r=null==t||this.cross(e).dot(t)>=0?1:-1,n=this.cross(e).length*r,a=this.dot(e);return Math.atan2(n,a)}rotateAround(e,t){if(!(e instanceof E))throw new TypeError("axis is not Vector3d object");const r=t.toRadians(),n=this.unit(),a=e.unit(),i=Math.sin(r),o=Math.cos(r),s=1-o,l=a.x,c=a.y,u=a.z,d=[[s*l*l+o,s*l*c-i*u,s*l*u+i*c],[s*l*c+i*u,s*c*c+o,s*c*u-i*l],[s*l*u-i*c,s*c*u+i*l,s*u*u+o]],h=[d[0][0]*n.x+d[0][1]*n.y+d[0][2]*n.z,d[1][0]*n.x+d[1][1]*n.y+d[1][2]*n.z,d[2][0]*n.x+d[2][1]*n.y+d[2][2]*n.z];return new E(h[0],h[1],h[2])}toString(e=3){return`[${this.x.toFixed(e)},${this.y.toFixed(e)},${this.z.toFixed(e)}]`}}Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};const v={WGS84:{a:6378137,b:6356752.314245,f:1/298.257223563}},O={WGS84:{ellipsoid:v.WGS84}};Object.freeze(v.WGS84),Object.freeze(O.WGS84);class S{constructor(e,t,r=0){if(isNaN(e)||null==e)throw new TypeError(`invalid lat ‘${e}’`);if(isNaN(t)||null==t)throw new TypeError(`invalid lon ‘${t}’`);if(isNaN(r)||null==r)throw new TypeError(`invalid height ‘${r}’`);this._lat=w.wrap90(Number(e)),this._lon=w.wrap180(Number(t)),this._height=Number(r)}get lat(){return this._lat}get latitude(){return this._lat}set lat(e){if(this._lat=isNaN(e)?w.wrap90(w.parse(e)):w.wrap90(Number(e)),isNaN(this._lat))throw new TypeError(`invalid lat ‘${e}’`)}set latitude(e){if(this._lat=isNaN(e)?w.wrap90(w.parse(e)):w.wrap90(Number(e)),isNaN(this._lat))throw new TypeError(`invalid latitude ‘${e}’`)}get lon(){return this._lon}get lng(){return this._lon}get longitude(){return this._lon}set lon(e){if(this._lon=isNaN(e)?w.wrap180(w.parse(e)):w.wrap180(Number(e)),isNaN(this._lon))throw new TypeError(`invalid lon ‘${e}’`)}set lng(e){if(this._lon=isNaN(e)?w.wrap180(w.parse(e)):w.wrap180(Number(e)),isNaN(this._lon))throw new TypeError(`invalid lng ‘${e}’`)}set longitude(e){if(this._lon=isNaN(e)?w.wrap180(w.parse(e)):w.wrap180(Number(e)),isNaN(this._lon))throw new TypeError(`invalid longitude ‘${e}’`)}get height(){return this._height}set height(e){if(this._height=Number(e),isNaN(this._height))throw new TypeError(`invalid height ‘${e}’`)}get datum(){return this._datum}set datum(e){this._datum=e}static get ellipsoids(){return v}static get datums(){return O}static parse(...e){if(0==e.length)throw new TypeError("invalid (empty) point");let t,r,n;if("object"==typeof e[0]&&(1==e.length||!isNaN(parseFloat(e[1])))){const a=e[0];if("Point"==a.type&&Array.isArray(a.coordinates)?([r,t,n]=a.coordinates,n=n||0):(null!=a.latitude&&(t=a.latitude),null!=a.lat&&(t=a.lat),null!=a.longitude&&(r=a.longitude),null!=a.lng&&(r=a.lng),null!=a.lon&&(r=a.lon),null!=a.height&&(n=a.height),t=w.wrap90(w.parse(t)),r=w.wrap180(w.parse(r))),null!=e[1]&&(n=e[1]),isNaN(t)||isNaN(r))throw new TypeError(`invalid point ‘${JSON.stringify(e[0])}’`)}if("string"==typeof e[0]&&2==e[0].split(",").length&&([t,r]=e[0].split(","),t=w.wrap90(w.parse(t)),r=w.wrap180(w.parse(r)),n=e[1]||0,isNaN(t)||isNaN(r)))throw new TypeError(`invalid point ‘${e[0]}’`);if(null==t&&null==r&&([t,r]=e,t=w.wrap90(w.parse(t)),r=w.wrap180(w.parse(r)),n=e[2]||0,isNaN(t)||isNaN(r)))throw new TypeError(`invalid point ‘${e.toString()}’`);return new this(t,r,n)}toCartesian(){const e=this.datum?this.datum.ellipsoid:this.referenceFrame?this.referenceFrame.ellipsoid:v.WGS84,t=this.lat.toRadians(),r=this.lon.toRadians(),n=this.height,{a:a,f:i}=e,o=Math.sin(t),s=Math.cos(t),l=Math.sin(r),c=Math.cos(r),u=2*i-i*i,d=a/Math.sqrt(1-u*o*o);return new N((d+n)*s*c,(d+n)*s*l,(d*(1-u)+n)*o)}equals(e){if(!(e instanceof S))throw new TypeError(`invalid point ‘${e}’`);return!(Math.abs(this.lat-e.lat)>Number.EPSILON)&&(!(Math.abs(this.lon-e.lon)>Number.EPSILON)&&(!(Math.abs(this.height-e.height)>Number.EPSILON)&&(this.datum==e.datum&&(this.referenceFrame==e.referenceFrame&&this.epoch==e.epoch))))}toString(e="d",t=void 0,r=null){if(!["d","dm","dms","n"].includes(e))throw new RangeError(`invalid format ‘${e}’`);const n=(this.height>=0?" +":" ")+this.height.toFixed(r)+"m";if("n"==e){null==t&&(t=4);return`${this.lat.toFixed(t)}, ${this.lon.toFixed(t)}${null==r?"":n}`}return`${w.toLat(this.lat,e,t)}, ${w.toLon(this.lon,e,t)}${null==r?"":n}`}}class N extends E{constructor(e,t,r){super(e,t,r)}toLatLon(e=v.WGS84){if(!e||!e.a)throw new TypeError(`invalid ellipsoid ‘${e}’`);const{x:t,y:r,z:n}=this,{a:a,b:i,f:o}=e,s=2*o-o*o,l=s/(1-s),c=Math.sqrt(t*t+r*r),u=i*n/(a*c)*(1+l*i/Math.sqrt(c*c+n*n)),d=u/Math.sqrt(1+u*u),h=d/u,p=isNaN(h)?0:Math.atan2(n+l*i*d*d*d,c-s*a*h*h*h),f=Math.atan2(r,t),g=Math.sin(p),m=c*Math.cos(p)+n*g-a*a/(a/Math.sqrt(1-s*g*g));return new S(p.toDegrees(),f.toDegrees(),m)}toString(e=0){return`[${this.x.toFixed(e)},${this.y.toFixed(e)},${this.z.toFixed(e)}]`}}const T={WGS84:{a:6378137,b:6356752.314245,f:1/298.257223563},Airy1830:{a:6377563.396,b:6356256.909,f:1/299.3249646},AiryModified:{a:6377340.189,b:6356034.448,f:1/299.3249646},Bessel1841:{a:6377397.155,b:6356078.962818,f:1/299.1528128},Clarke1866:{a:6378206.4,b:6356583.8,f:1/294.978698214},Clarke1880IGN:{a:6378249.2,b:6356515,f:1/293.466021294},GRS80:{a:6378137,b:6356752.31414,f:1/298.257222101},Intl1924:{a:6378388,b:6356911.946,f:1/297},WGS72:{a:6378135,b:6356750.5,f:1/298.26}},_={ED50:{ellipsoid:T.Intl1924,transform:[89.5,93.8,123.1,-1.2,0,0,.156]},ETRS89:{ellipsoid:T.GRS80,transform:[0,0,0,0,0,0,0]},Irl1975:{ellipsoid:T.AiryModified,transform:[-482.53,130.596,-564.557,-8.15,1.042,.214,.631]},NAD27:{ellipsoid:T.Clarke1866,transform:[8,-160,-176,0,0,0,0]},NAD83:{ellipsoid:T.GRS80,transform:[.9956,-1.9103,-.5215,-62e-5,.025915,.009426,.011599]},NTF:{ellipsoid:T.Clarke1880IGN,transform:[168,60,-320,0,0,0,0]},OSGB36:{ellipsoid:T.Airy1830,transform:[-446.448,125.157,-542.06,20.4894,-.1502,-.247,-.8421]},Potsdam:{ellipsoid:T.Bessel1841,transform:[-582,-105,-414,-8.3,1.04,.35,-3.08]},TokyoJapan:{ellipsoid:T.Bessel1841,transform:[148,-507,-685,0,0,0,0]},WGS72:{ellipsoid:T.WGS72,transform:[0,0,-4.5,-.22,0,0,.554]},WGS84:{ellipsoid:T.WGS84,transform:[0,0,0,0,0,0,0]}};Object.keys(T).forEach(e=>Object.freeze(T[e])),Object.keys(_).forEach(e=>{Object.freeze(_[e]),Object.freeze(_[e].transform)});class x extends S{constructor(e,t,r=0,n=_.WGS84){if(!n||null==n.ellipsoid)throw new TypeError(`unrecognised datum ‘${n}’`);super(e,t,r),this._datum=n}get datum(){return this._datum}static get ellipsoids(){return T}static get datums(){return _}static parse(...e){let t=_.WGS84;if((4==e.length||3==e.length&&"object"==typeof e[2])&&(t=e.pop()),!t||null==t.ellipsoid)throw new TypeError(`unrecognised datum ‘${t}’`);const r=super.parse(...e);return r._datum=t,r}convertDatum(e){if(!e||null==e.ellipsoid)throw new TypeError(`unrecognised datum ‘${e}’`);return this.toCartesian().convertDatum(e).toLatLon()}toCartesian(){const e=super.toCartesian();return new D(e.x,e.y,e.z,this.datum)}}class D extends N{constructor(e,t,r,n=void 0){if(n&&null==n.ellipsoid)throw new TypeError(`unrecognised datum ‘${n}’`);super(e,t,r),n&&(this._datum=n)}get datum(){return this._datum}set datum(e){if(!e||null==e.ellipsoid)throw new TypeError(`unrecognised datum ‘${e}’`);this._datum=e}toLatLon(e=void 0){e&&(console.info("datum parameter to Cartesian_Datum.toLatLon is deprecated: set datum before calling toLatLon()"),this.datum=e);const t=this.datum||_.WGS84;if(!t||null==t.ellipsoid)throw new TypeError(`unrecognised datum ‘${t}’`);const r=super.toLatLon(t.ellipsoid);return new x(r.lat,r.lon,r.height,this.datum)}convertDatum(e){if(!e||null==e.ellipsoid)throw new TypeError(`unrecognised datum ‘${e}’`);if(!this.datum)throw new TypeError("cartesian coordinate has no datum");let t=null,r=null;null!=this.datum&&this.datum!=_.WGS84||(t=this,r=e.transform),e==_.WGS84&&(t=this,r=this.datum.transform.map(e=>-e)),null==r&&(t=this.convertDatum(_.WGS84),r=e.transform);const n=t.applyTransform(r);return n.datum=e,n}applyTransform(e){const{x:t,y:r,z:n}=this,a=e[0],i=e[1],o=e[2],s=e[3]/1e6+1,l=(e[4]/3600).toRadians(),c=(e[5]/3600).toRadians(),u=(e[6]/3600).toRadians();return new D(a+t*s-r*u+n*c,i+t*u+r*s-n*l,o-t*c+r*l+n*s)}}const j={trueOrigin:{lat:49,lon:-2},scaleFactor:.9996012717,ellipsoid:x.ellipsoids.Airy1830};class M{constructor(e,t){if(this.easting=Number(e),this.northing=Number(t),isNaN(e)||this.easting<0||this.easting>7e5)throw new RangeError(`invalid easting ‘${e}’`);if(isNaN(t)||this.northing<0||this.northing>13e5)throw new RangeError(`invalid northing ‘${t}’`)}toLatLon(e=x.datums.WGS84){const{easting:t,northing:r}=this,{a:n,b:a}=j.ellipsoid,i=j.trueOrigin.lat.toRadians(),o=j.trueOrigin.lon.toRadians(),s=-1e5,l=j.scaleFactor,c=1-a*a/(n*n),u=(n-a)/(n+a),d=u*u,h=u*u*u;let p=i,f=0;do{p=(r-s-f)/(n*l)+p;f=a*l*((1+u+5/4*d+5/4*h)*(p-i)-(3*u+3*u*u+21/8*h)*Math.sin(p-i)*Math.cos(p+i)+(15/8*d+15/8*h)*Math.sin(2*(p-i))*Math.cos(2*(p+i))-35/24*h*Math.sin(3*(p-i))*Math.cos(3*(p+i)))}while(Math.abs(r-s-f)>=1e-5);const g=Math.cos(p),m=Math.sin(p),y=n*l/Math.sqrt(1-c*m*m),b=n*l*(1-c)/Math.pow(1-c*m*m,1.5),w=y/b-1,E=Math.tan(p),v=E*E,O=v*v,S=1/g,N=y*y*y,T=N*y*y,_=t-4e5,D=_*_,M=D*_,G=D*D,P=M*D;p=p-E/(2*b*y)*D+E/(24*b*N)*(5+3*v+w-9*v*w)*G-E/(720*b*T)*(61+90*v+45*O)*(G*D);const k=o+S/y*_-S/(6*N)*(y/b+2*v)*M+S/(120*T)*(5+28*v+24*O)*P-S/(5040*(T*y*y))*(61+662*v+1320*O+720*(O*v))*(P*D);let C=new R(p.toDegrees(),k.toDegrees(),0,x.datums.OSGB36);return e!=x.datums.OSGB36&&(C=C.convertDatum(e),C=new R(C.lat,C.lon,C.height,C.datum)),C}static parse(e){let t=(e=String(e).trim()).match(/^(\d+),\s*(\d+)$/);if(t)return new M(t[1],t[2]);if(t=e.match(/^[HNST][ABCDEFGHJKLMNOPQRSTUVWXYZ]\s*[0-9]+\s*[0-9]+$/i),!t)throw new Error(`invalid grid reference ‘${e}’`);let r=e.toUpperCase().charCodeAt(0)-"A".charCodeAt(0),n=e.toUpperCase().charCodeAt(1)-"A".charCodeAt(0);r>7&&r--,n>7&&n--;const a=(r-2)%5*5+n%5,i=19-5*Math.floor(r/5)-Math.floor(n/5);let o=e.slice(2).trim().split(/\s+/);if(1==o.length&&(o=[o[0].slice(0,o[0].length/2),o[0].slice(o[0].length/2)]),o[0].length!=o[1].length)throw new Error(`invalid grid reference ‘${e}’`);o[0]=o[0].padEnd(5,"0"),o[1]=o[1].padEnd(5,"0");const s=a+o[0],l=i+o[1];return new M(s,l)}toString(e=10){if(![0,2,4,6,8,10,12,14,16].includes(Number(e)))throw new RangeError(`invalid precision ‘${e}’`);let{easting:t,northing:r}=this;if(0==e){const e={useGrouping:!1,minimumIntegerDigits:6,maximumFractionDigits:3};return`${t.toLocaleString("en",e)},${r.toLocaleString("en",e)}`}const n=Math.floor(t/1e5),a=Math.floor(r/1e5);let i=19-a-(19-a)%5+Math.floor((n+10)/5),o=5*(19-a)%25+n%5;i>7&&i++,o>7&&o++;const s=String.fromCharCode(i+"A".charCodeAt(0),o+"A".charCodeAt(0));return t=Math.floor(t%1e5/Math.pow(10,5-e/2)),r=Math.floor(r%1e5/Math.pow(10,5-e/2)),t=t.toString().padStart(e/2,"0"),r=r.toString().padStart(e/2,"0"),`${s} ${t} ${r}`}}class R extends x{toOsGrid(){const e=this.datum==x.datums.OSGB36?this:this.convertDatum(x.datums.OSGB36),t=e.lat.toRadians(),r=e.lon.toRadians(),{a:n,b:a}=j.ellipsoid,i=j.trueOrigin.lat.toRadians(),o=j.trueOrigin.lon.toRadians(),s=j.scaleFactor,l=1-a*a/(n*n),c=(n-a)/(n+a),u=c*c,d=c*c*c,h=Math.cos(t),p=Math.sin(t),f=n*s/Math.sqrt(1-l*p*p),g=n*s*(1-l)/Math.pow(1-l*p*p,1.5),m=f/g-1,y=a*s*((1+c+5/4*u+5/4*d)*(t-i)-(3*c+3*c*c+21/8*d)*Math.sin(t-i)*Math.cos(t+i)+(15/8*u+15/8*d)*Math.sin(2*(t-i))*Math.cos(2*(t+i))-35/24*d*Math.sin(3*(t-i))*Math.cos(3*(t+i))),b=h*h*h,w=b*h*h,E=Math.tan(t)*Math.tan(t),v=E*E,O=r-o,S=O*O,N=S*O,T=N*O,_=T*O;let D=y+-1e5+f/2*p*h*S+f/24*p*b*(5-E+9*m)*T+f/720*p*w*(61-58*E+v)*(_*O),R=4e5+f*h*O+f/6*b*(f/g-E)*N+f/120*w*(5-18*E+v+14*m-58*E*m)*_;D=Number(D.toFixed(3)),R=Number(R.toFixed(3));try{return new M(R,D)}catch(t){throw new Error(`${t.message} from (${e.lat.toFixed(6)},${e.lon.toFixed(6)}).toOsGrid()`)}}convertDatum(e){const t=super.convertDatum(e);return new R(t.lat,t.lon,t.height,t.datum)}}var G;function P(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function k(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?P(Object(r),!0).forEach(function(t){a(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):P(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var C=500,L=e=>{var t=e.GAZETTEER_ENTRY,r="eng"===t.NAME2_LANG?t.NAME2:t.NAME1;return e.GAZETTEER_ENTRY.NAME1=r,e.GAZETTEER_ENTRY.NAME1_LANG="eng",e},I=(e,t)=>{var r,n,a,i,{MBR_XMIN:o,MBR_YMIN:s,MBR_XMAX:l,MBR_YMAX:c,GEOMETRY_X:u,GEOMETRY_Y:d}=t;if(null==o?(r=u-C,n=d-C,a=u+C,i=d+C):(r=o,n=s,a=l,i=c),"EPSG:27700"===e)return[r,n,a,i];if("EPSG:4326"===e){var h=new M(r,n).toLatLon(),p=new M(a,i).toLatLon();return[h.lon,h.lat,p.lon,p.lat].map(e=>Math.round(1e6*e)/1e6)}throw new Error("Unsupported CRS: ".concat(e))},A=(e,t)=>{var{GEOMETRY_X:r,GEOMETRY_Y:n}=t;if("EPSG:27700"===e)return[r,n];if("EPSG:4326"===e){var a=new M(r,n).toLatLon();return[Math.round(1e6*a.lon)/1e6,Math.round(1e6*a.lat)/1e6]}throw new Error("Unsupported CRS: ".concat(e))},$=(e,t,r,n)=>{var a;if(!e||e.error||0===(null===(a=e.header)||void 0===a?void 0:a.totalresults))return[];var i=e.results;return i=((e,t)=>{var r=t.toLowerCase().replace(/,/g,"").split(" ");return e.map(L).filter(e=>r.some(r=>{return e.GAZETTEER_ENTRY.NAME1.toLowerCase().includes(r)||(n=(n=t).replace(/\s/g,""),/^(([A-Z]{1,2}\d[A-Z\d]?|ASCN|STHL|TDCU|BBND|[BFS]IQQ|PCRN|TKCA) ?\d[A-Z]{2}|BFPO ?\d{1,4}|(KY\d|MSR|VG|AI)[ -]?\d{4}|[A-Z]{2} ?\d{2}|GE ?CX|GIR ?0A{2}|SAN ?TA1)$/i.test(n));var n}))})(i,t),i=((e,t)=>e.filter(e=>{var r,n=null==e||null===(r=e.GAZETTEER_ENTRY)||void 0===r||null===(r=r.COUNTRY)||void 0===r?void 0:r.toLowerCase();return n&&t.includes(n)}))(i=(e=>Array.from(new Map(e.map(e=>[e.GAZETTEER_ENTRY.ID,e])).values()))(i),r),(i=i.slice(0,8)).map(e=>k(k({id:e.GAZETTEER_ENTRY.ID,bounds:I(n,e.GAZETTEER_ENTRY),point:A(n,e.GAZETTEER_ENTRY)},((e,t)=>{var r,n,a,i,{NAME1:s,COUNTY_UNITARY:l,DISTRICT_BOROUGH:c,POSTCODE_DISTRICT:u,LOCAL_TYPE:d}=t,h="".concat(["City","Postcode"].includes(d)?"":u+", ").concat("City"===d?"":l||c),p="".concat(s).concat(h?", "+h:"");return{text:p,marked:(r=p,n=e,a=n.replace(/\s+/g,"").split("").join(String.raw(G||(G=o(["s*"],["\\s*"])))),i=new RegExp("(".concat(a,")"),"i"),r.replace(i,"<mark>$1</mark>"))}})(t,e.GAZETTEER_ENTRY)),{},{type:"os-names"}))};var F=e=>{var{url:t,options:r}=e;return new Request(t,r)},W=function(){var e=s(function*(e,t,r){var n,a={url:null===(n=e.urlTemplate)||void 0===n?void 0:n.replace("{query}",encodeURIComponent(t)),options:{method:"GET"}};if(e.buildRequest){var i=e.buildRequest(t,()=>a);return i instanceof Request?i:F(i)}return F(r?yield r(a,t):a)});return function(t,r,n){return e.apply(this,arguments)}}(),U=function(){var e=s(function*(e,t,r){try{var n=yield fetch(t);if(!n.ok)return console.error("Fetch error for ".concat(e.label||"dataset",": ").concat(n.status)),null;var a=yield n.json();return e.parseResults(a,r)}catch(t){return console.error("Network error for ".concat(e.label||"dataset",":"),t),null}});return function(t,r,n){return e.apply(this,arguments)}}(),B=function(){var e=s(function*(e,t,r,n){var a=(e=>e.replace(/[^a-zA-Z0-9\s\-.,]/g,"").trim())(e),i=t.filter(t=>{var r=!t.includeRegex||t.includeRegex.test(e),n=!!t.excludeRegex&&t.excludeRegex.test(a);return r&&!n}),o=[];for(var s of i){var l=yield W(s,a,n),c=yield U(s,l,a);if(null!=c&&c.length&&(o=[...o,...c],s.exclusive))break}return r({type:"UPDATE_SUGGESTIONS",payload:o}),{results:o,sanitisedValue:a}});return function(t,r,n,a){return e.apply(this,arguments)}}();function z(e){var{mapProvider:t,bounds:r,point:n,markers:a,showMarker:i,markerOptions:o}=e;t.fitToBounds(r),i&&a.add("search",n,o)}var V=3;function Y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function H(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Y(Object(r),!0).forEach(function(t){a(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Y(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function q(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}var Z=e=>{var{dispatch:t,services:r,mapProvider:n,markers:i,showMarker:o,markerOptions:s}=e,l=(e,t)=>{var r;return t>=0?"".concat(null===(r=e[t])||void 0===r?void 0:r.text,". ").concat(t+1," of ").concat(e.length," is highlighted"):"".concat(e.length," suggestions available")};return{handleSuggestionClick(e,l){t({type:"SET_VALUE",payload:e.text}),t({type:"HIDE_SUGGESTIONS"}),t({type:"SET_SELECTED",payload:-1}),"mobile"===l.breakpoint&&(t({type:"TOGGLE_EXPANDED",payload:!1}),r.eventBus.emit("search:close")),z({mapProvider:n,bounds:e.bounds,point:e.point,markers:i,showMarker:o,markerOptions:s}),r.eventBus.emit("search:match",function(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){a(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}({query:e.text},e))},handleInputKeyDown(e,n){var{suggestions:a,selectedIndex:i}=n;switch(e.key){case"ArrowDown":if(null==a||!a.length)return;if(e.preventDefault(),i<a.length-1){var o=i+1;r.announce(l(a,o)),t({type:"SET_SELECTED",payload:o}),t({type:"SET_KEYBOARD_FOCUS_WITHIN",payload:!1})}break;case"ArrowUp":if(null==a||!a.length)return;e.preventDefault();var s=i>0?i-1:-1;r.announce(l(a,s)),t({type:"SET_SELECTED",payload:s}),t({type:"SET_KEYBOARD_FOCUS_WITHIN",payload:s<0});break;case"Escape":e.preventDefault(),t({type:"HIDE_SUGGESTIONS"}),t({type:"SET_SELECTED",payload:-1})}}}};function K(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function X(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?K(Object(r),!0).forEach(function(t){a(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):K(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function J(e){var t,r,n,a,{dispatch:i,searchContainerRef:o}=e,l=(t=t=>B(t,e.datasets,i,e.transformRequest),r=350,n=null,a=function(){for(var e=arguments.length,a=new Array(e),i=0;i<e;i++)a[i]=arguments[i];clearTimeout(n),n=setTimeout(()=>{t(...a)},r)},a.cancel=()=>{n&&(clearTimeout(n),n=null)},a),c=(e=>{var{dispatch:t,services:r,viewportRef:n,mapProvider:a,markers:i,datasets:o,transformRequest:l,showMarker:c,markerOptions:u}=e,d="";return{handleOpenClick(){t({type:"TOGGLE_EXPANDED",payload:!0}),r.eventBus.emit("search:open")},handleCloseClick(e,n){t({type:"TOGGLE_EXPANDED",payload:!1}),t({type:"UPDATE_SUGGESTIONS",payload:[]}),t({type:"SET_VALUE",payload:""}),setTimeout(()=>n.current.focus(),0),i.remove("search"),r.eventBus.emit("search:clear"),r.eventBus.emit("search:close")},handleSubmit:(e,h,p)=>s(function*(){e.preventDefault();var{suggestions:s,selectedIndex:f,value:g}=p,m=null==g?void 0:g.trim();if(t({type:"SET_SELECTED",payload:-1}),t({type:"HIDE_SUGGESTIONS"}),f>=0){var y,b=s[f];return t({type:"SET_VALUE",payload:b.text}),null===(y=n.current)||void 0===y||y.focus(),z({mapProvider:a,bounds:b.bounds,point:b.point,markers:i,showMarker:c,markerOptions:u}),void r.eventBus.emit("search:match",H({query:b.text},b))}if(!((null==m?void 0:m.length)<V)){var w=s;if(!s.length||m!==d){var{results:E,sanitisedValue:v}=yield B(m,o,t,l);w=E,d=v}if(w.length){var O;"keyboard"===h.interfaceType&&(null===(O=n.current)||void 0===O||O.focus()),"mobile"===h.breakpoint&&(t({type:"TOGGLE_EXPANDED",payload:!1}),r.eventBus.emit("search:close"));var S=w[0];z({mapProvider:a,bounds:S.bounds,point:S.point,markers:i,showMarker:c,markerOptions:u}),r.eventBus.emit("search:match",H({query:g},S))}}})()}})(e),u=(e=>{var{dispatch:t,debouncedFetchSuggestions:r}=e;return{handleInputClick(){t({type:"SHOW_SUGGESTIONS"})},handleInputFocus(e){t({type:"SET_KEYBOARD_FOCUS_WITHIN",payload:"keyboard"===e})},handleInputBlur(e){t({type:"INPUT_BLUR",payload:e})},handleInputChange(e){var n=e.target.value;if(t({type:"SET_VALUE",payload:n}),n.length<V)return r.cancel(),t({type:"UPDATE_SUGGESTIONS",payload:[]}),void t({type:"HIDE_SUGGESTIONS"});t({type:"SHOW_SUGGESTIONS"}),r(n)}}})(X(X({},e),{},{debouncedFetchSuggestions:l})),d=Z(e);return X(X(X(X({},c),u),d),{},{handleOutside(t){o.current.contains(t.target)||(i({type:"TOGGLE_EXPANDED",payload:!1}),e.services.eventBus.emit("search:close"))}})}var Q=["marker"];function ee(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}var te={reducer:{initialState:{isExpanded:!1,hasKeyboardFocusWithin:!1,value:"",suggestions:[],areSuggestionsVisible:!1,hasFetchedSuggestions:!1,selectedIndex:-1},actions:u},controls:[{id:"search",mobile:{slot:"top-right",showLabel:!1},tablet:{slot:"top-left",showLabel:!1},desktop:{slot:"top-left",showLabel:!1},render:function(o){var s,{appConfig:l,iconRegistry:c,pluginState:u,pluginConfig:h,appState:p,mapState:f,services:b,mapProvider:w}=o,{id:E}=l,{interfaceType:v}=p,{expanded:O,customDatasets:S,osNamesURL:N,regions:T}=h,{dispatch:_,isExpanded:x,areSuggestionsVisible:D,suggestions:j}=u,M=(null==p||null===(s=p.controlConfig)||void 0===s||null===(s=s.search)||void 0===s?void 0:s[null==p?void 0:p.breakpoint].showLabel)||!1,R=c.close,G=c.search,P=t(null),k=t(null),C=t(null),L=p.layoutRefs.viewportRef,I=function(e){var{customDatasets:t=[],osNamesURL:r,crs:n,regions:a=["england","scotland","wales"]}=e;return r?[{name:"osNames",urlTemplate:r,parseResults:(e,t)=>$(e,t,a,n),includeRegex:/[a-zA-Z0-9]/,excludeRegex:/^(?:[a-z]{2}\s*(?:\d{3}\s*\d{3}|\d{4}\s*\d{4}|\d{5}\s*\d{5})|\d+\s*,?\s*\d+)$/i},...t]:t}({customDatasets:S,osNamesURL:N,regions:T,crs:w.crs}),A=t(null);if(!A.current){var{marker:F}=h,W=i(h,Q);A.current=J(function(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){a(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}({dispatch:_,datasets:I,services:b,mapProvider:w,viewportRef:L,searchContainerRef:P,markers:f.markers,markerOptions:F},W))}var U=A.current,B=x||!!(O&&D&&j.length);return e(()=>{var e;x&&(null===(e=C.current)||void 0===e||e.focus())},[x]),e(()=>{if(p.dispatch({type:"TOGGLE_HAS_EXCLUSIVE_CONTROL",payload:x}),B)return L.current.style.pointerEvents="none",document.addEventListener("focusin",U.handleOutside),document.addEventListener("pointerdown",U.handleOutside),()=>{L.current.style.pointerEvents="auto",document.removeEventListener("focusin",U.handleOutside),document.removeEventListener("pointerdown",U.handleOutside)}},[x,v,D,j]),r("div",{className:"im-c-search",ref:P,children:[!O&&n(d,{id:E,isExpanded:x,onClick:()=>U.handleOpenClick(p),buttonRef:k,searchIcon:G,showLabel:M}),r(g,{id:E,pluginState:u,pluginConfig:h,appState:p,inputRef:C,events:U,services:b,children:[n(m,{defaultExpanded:O,onClick:e=>U.handleCloseClick(e,k,p),closeIcon:R}),n(y,{defaultExpanded:O,onClick:e=>U.handleCloseClick(e,k,p),submitIcon:G})]})]})}}],icons:[{id:"search",svgContent:'<path d="m21 21-4.34-4.34"></path><circle cx="11" cy="11" r="8"></circle>'}]};export{te as manifest};
|
|
1
|
+
import{useEffect as e,useRef as t}from"preact/compat";import{jsxs as r,jsx as n}from"preact/jsx-runtime";import a from"@babel/runtime/helpers/defineProperty";import s from"@babel/runtime/helpers/objectWithoutProperties";import i from"@babel/runtime/helpers/taggedTemplateLiteral";import o from"@babel/runtime/helpers/asyncToGenerator";var l={expanded:!1,showMarker:!0,placeholder:"Search",minSearchLength:3,maxSuggestions:8,noResultsMessage:"No results available",searchErrorMessage:"Sorry, there was a problem with search"};function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?c(Object(r),!0).forEach(function(t){a(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var h={TOGGLE_EXPANDED:(e,t)=>u(u({},e),{},{isExpanded:t,areSuggestionsVisible:t,hasFetchedSuggestions:!1,hasSearchError:!1}),SET_KEYBOARD_FOCUS_WITHIN:(e,t)=>u(u({},e),{},{hasKeyboardFocusWithin:t,areSuggestionsVisible:!0}),INPUT_BLUR:(e,t)=>u(u({},e),{},{hasKeyboardFocusWithin:!1,areSuggestionsVisible:e.areSuggestionsVisible&&"keyboard"!==t,selectedIndex:-1}),SET_VALUE:(e,t)=>u(u({},e),{},{value:t}),UPDATE_SUGGESTIONS:(e,t)=>u(u({},e),{},{suggestions:t.results,hasFetchedSuggestions:!0,hasSearchError:t.hasError}),SHOW_SUGGESTIONS:e=>u(u({},e),{},{areSuggestionsVisible:!0,hasFetchedSuggestions:!1,hasSearchError:!1}),HIDE_SUGGESTIONS:e=>u(u({},e),{},{areSuggestionsVisible:!1,hasFetchedSuggestions:!1,hasSearchError:!1}),SET_SELECTED:(e,t)=>u(u({},e),{},{selectedIndex:t,areSuggestionsVisible:t>=0})},d=e=>{var{id:t,isExpanded:a,onClick:s,buttonRef:i,searchIcon:o,showLabel:l}=e;return r("button",{"aria-label":"Open search",className:"im-c-map-button im-c-search-open-button",onClick:s,"aria-controls":"".concat(t,"-search-form"),ref:i,style:a?{display:"none"}:void 0,children:[o&&n("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",dangerouslySetInnerHTML:{__html:o}}),l&&n("span",{children:"Search"})]})},p=e=>{var{id:t,pluginState:r,handleSuggestionClick:a}=e;return n("ul",{id:"".concat(t,"-search-suggestions"),role:"listbox","aria-labelledby":"".concat(t,"-search"),className:"im-c-search-suggestions",style:r.areSuggestionsVisible&&r.suggestions.length?void 0:{display:"none"},children:r.suggestions.map((e,s)=>n("li",{id:"".concat(t,"-search-suggestion-").concat(s),className:"im-c-search-suggestions__item",role:"option","aria-selected":r.selectedIndex===s,"aria-setsize":r.suggestions.length,"aria-posinset":s+1,onClick:()=>a(e),children:n("span",{className:"im-c-search-suggestions__label",dangerouslySetInnerHTML:{__html:e.marked}})},e.id))})};function g(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}var f=(e,t,r)=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?g(Object(r),!0).forEach(function(t){a(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):g(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({display:e.expanded||t.isExpanded?"flex":void 0},"mobile"!==r.breakpoint&&(null==e?void 0:e.width)&&{width:e.width}),m=t=>{var{id:a,pluginState:s,pluginConfig:i,appState:o,inputRef:l,events:c,services:u,children:h}=t,{areSuggestionsVisible:d,hasFetchedSuggestions:g,hasSearchError:m,suggestions:y=[]}=s,{noResultsMessage:b,searchErrorMessage:E}=i;e(()=>{d&&g&&u.announce(((e,t,r,n)=>{if(t)return r;if(0===e)return n;var a=1===e?"result":"results";return"".concat(e," ").concat(a," available")})(y.length,m,E,b))},[y,g]);var w=["im-c-search-form",i.expanded&&"im-c-search-form--default-expanded","im-c-panel"].filter(Boolean).join(" "),v=d&&g&&(m||!y.length);return r("form",{id:"".concat(a,"-search-form"),role:"search",className:w,style:f(i,s,o),"aria-controls":"".concat(a,"-viewport"),onSubmit:e=>c.handleSubmit(e,o,s),children:[n("button",{type:"submit",style:{display:"none"},"aria-hidden":"true",tabIndex:-1,children:"Submit"}),r("div",{className:"im-c-search__input-container".concat(s.hasKeyboardFocusWithin?" im-c-search__input-container--keyboard-focus-within":""),children:[n("label",{htmlFor:"".concat(a,"-search"),className:"im-u-visually-hidden",children:i.placeholder}),n("input",{id:"".concat(a,"-search"),className:"im-c-search__input",type:"search",role:"combobox","aria-expanded":s.suggestionsVisible,"aria-controls":"".concat(a,"-search-suggestions"),"aria-activedescendant":s.selectedIndex>=0?"".concat(a,"-search-suggestion-").concat(s.selectedIndex):void 0,"aria-describedby":s.value?void 0:"".concat(a,"-search-hint"),"aria-autocomplete":"list",autoComplete:"off",placeholder:i.placeholder,name:"".concat(a,"-search"),spellCheck:!1,enterKeyHint:"search",value:s.value,onClick:c.handleInputClick,onChange:c.handleInputChange,onFocus:()=>c.handleInputFocus(o.interfaceType),onBlur:()=>c.handleInputBlur(o.interfaceType),onKeyDown:e=>c.handleInputKeyDown(e,s),ref:l}),n("span",{id:"".concat(a,"-search-hint"),className:"im-c-search__hint",children:"When search results are available use up and down arrows to review and enter to select. Touch device users, explore by touch or with swipe gestures."}),h]}),v&&n("div",{className:"im-c-search__status","aria-hidden":"true",children:m?E:b}),n(p,{id:a,appState:o,pluginState:s,handleSuggestionClick:e=>c.handleSuggestionClick(e,o)})]})},y=e=>{var{defaultExpanded:t,onClick:r,closeIcon:a}=e;return n("button",{"aria-label":"Close search",className:"im-c-map-button im-c-search-close-button",type:"button",onClick:r,style:t?{display:"none"}:void 0,children:a&&n("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",dangerouslySetInnerHTML:{__html:a}})})},b=e=>{var{defaultExpanded:t,submitIcon:r}=e;return n("button",{"aria-label":"Search",className:"im-c-map-button im-c-search-submit-button",type:"submit",style:t?void 0:{display:"none"},children:r&&n("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",dangerouslySetInnerHTML:{__html:r}})})};let E=" ";class w{static get separator(){return E}static set separator(e){E=e}static parse(e){if(!isNaN(parseFloat(e))&&isFinite(e))return Number(e);const t=String(e).trim().replace(/^-/,"").replace(/[NSEW]$/i,"").split(/[^0-9.,]+/);if(""==t[t.length-1]&&t.splice(t.length-1),""==t)return NaN;let r=null;switch(t.length){case 3:r=t[0]/1+t[1]/60+t[2]/3600;break;case 2:r=t[0]/1+t[1]/60;break;case 1:r=t[0];break;default:return NaN}return/^-|[WS]$/i.test(e.trim())&&(r=-r),Number(r)}static toDms(e,t="d",r=void 0){if(isNaN(e))return null;if("string"==typeof e&&""==e.trim())return null;if("boolean"==typeof e)return null;if(e==1/0)return null;if(null==e)return null;if(void 0===r)switch(t){case"d":case"deg":r=4;break;case"dm":case"deg+min":r=2;break;case"dms":case"deg+min+sec":r=0;break;default:t="d",r=4}e=Math.abs(e);let n=null,a=null,s=null,i=null;switch(t){default:case"d":case"deg":a=e.toFixed(r),a<100&&(a="0"+a),a<10&&(a="0"+a),n=a+"°";break;case"dm":case"deg+min":a=Math.floor(e),s=(60*e%60).toFixed(r),60==s&&(s=(0).toFixed(r),a++),a=("000"+a).slice(-3),s<10&&(s="0"+s),n=a+"°"+w.separator+s+"′";break;case"dms":case"deg+min+sec":a=Math.floor(e),s=Math.floor(3600*e/60)%60,i=(3600*e%60).toFixed(r),60==i&&(i=(0).toFixed(r),s++),60==s&&(s=0,a++),a=("000"+a).slice(-3),s=("00"+s).slice(-2),i<10&&(i="0"+i),n=a+"°"+w.separator+s+"′"+w.separator+i+"″"}return n}static toLat(e,t,r){const n=w.toDms(w.wrap90(e),t,r);return null===n?"–":n.slice(1)+w.separator+(e<0?"S":"N")}static toLon(e,t,r){const n=w.toDms(w.wrap180(e),t,r);return null===n?"–":n+w.separator+(e<0?"W":"E")}static toBrng(e,t,r){const n=w.toDms(w.wrap360(e),t,r);return null===n?"–":n.replace("360","0")}static fromLocale(e){const t=123456.789.toLocaleString(),r={thousands:t.slice(3,4),decimal:t.slice(7,8)};return e.replace(r.thousands,"⁜").replace(r.decimal,".").replace("⁜",",")}static toLocale(e){const t=123456.789.toLocaleString(),r={thousands:t.slice(3,4),decimal:t.slice(7,8)};return e.replace(/,([0-9])/,"⁜$1").replace(".",r.decimal).replace("⁜",r.thousands)}static compassPoint(e,t=3){if(![1,2,3].includes(Number(t)))throw new RangeError(`invalid precision ‘${t}’`);e=w.wrap360(e);const r=4*2**(t-1);return["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.round(e*r/360)%r*16/r]}static wrap90(e){if(-90<=e&&e<=90)return e;const t=e,r=360;return 1*Math.abs(((t-90)%r+r)%r-180)-90}static wrap180(e){if(-180<=e&&e<=180)return e;const t=360;return((360*e/t-180)%t+t)%t-180}static wrap360(e){if(0<=e&&e<360)return e;const t=360;return(360*e/t%t+t)%t}}Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};class v{constructor(e,t,r){if(isNaN(e)||isNaN(t)||isNaN(r))throw new TypeError(`invalid vector [${e},${t},${r}]`);this.x=Number(e),this.y=Number(t),this.z=Number(r)}get length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}plus(e){if(!(e instanceof v))throw new TypeError("v is not Vector3d object");return new v(this.x+e.x,this.y+e.y,this.z+e.z)}minus(e){if(!(e instanceof v))throw new TypeError("v is not Vector3d object");return new v(this.x-e.x,this.y-e.y,this.z-e.z)}times(e){if(isNaN(e))throw new TypeError(`invalid scalar value ‘${e}’`);return new v(this.x*e,this.y*e,this.z*e)}dividedBy(e){if(isNaN(e))throw new TypeError(`invalid scalar value ‘${e}’`);return new v(this.x/e,this.y/e,this.z/e)}dot(e){if(!(e instanceof v))throw new TypeError("v is not Vector3d object");return this.x*e.x+this.y*e.y+this.z*e.z}cross(e){if(!(e instanceof v))throw new TypeError("v is not Vector3d object");const t=this.y*e.z-this.z*e.y,r=this.z*e.x-this.x*e.z,n=this.x*e.y-this.y*e.x;return new v(t,r,n)}negate(){return new v(-this.x,-this.y,-this.z)}unit(){const e=this.length;if(1==e)return this;if(0==e)return this;const t=this.x/e,r=this.y/e,n=this.z/e;return new v(t,r,n)}angleTo(e,t=void 0){if(!(e instanceof v))throw new TypeError("v is not Vector3d object");if(!(t instanceof v||null==t))throw new TypeError("n is not Vector3d object");const r=null==t||this.cross(e).dot(t)>=0?1:-1,n=this.cross(e).length*r,a=this.dot(e);return Math.atan2(n,a)}rotateAround(e,t){if(!(e instanceof v))throw new TypeError("axis is not Vector3d object");const r=t.toRadians(),n=this.unit(),a=e.unit(),s=Math.sin(r),i=Math.cos(r),o=1-i,l=a.x,c=a.y,u=a.z,h=[[o*l*l+i,o*l*c-s*u,o*l*u+s*c],[o*l*c+s*u,o*c*c+i,o*c*u-s*l],[o*l*u-s*c,o*c*u+s*l,o*u*u+i]],d=[h[0][0]*n.x+h[0][1]*n.y+h[0][2]*n.z,h[1][0]*n.x+h[1][1]*n.y+h[1][2]*n.z,h[2][0]*n.x+h[2][1]*n.y+h[2][2]*n.z];return new v(d[0],d[1],d[2])}toString(e=3){return`[${this.x.toFixed(e)},${this.y.toFixed(e)},${this.z.toFixed(e)}]`}}Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};const S={WGS84:{a:6378137,b:6356752.314245,f:1/298.257223563}},O={WGS84:{ellipsoid:S.WGS84}};Object.freeze(S.WGS84),Object.freeze(O.WGS84);class N{constructor(e,t,r=0){if(isNaN(e)||null==e)throw new TypeError(`invalid lat ‘${e}’`);if(isNaN(t)||null==t)throw new TypeError(`invalid lon ‘${t}’`);if(isNaN(r)||null==r)throw new TypeError(`invalid height ‘${r}’`);this._lat=w.wrap90(Number(e)),this._lon=w.wrap180(Number(t)),this._height=Number(r)}get lat(){return this._lat}get latitude(){return this._lat}set lat(e){if(this._lat=isNaN(e)?w.wrap90(w.parse(e)):w.wrap90(Number(e)),isNaN(this._lat))throw new TypeError(`invalid lat ‘${e}’`)}set latitude(e){if(this._lat=isNaN(e)?w.wrap90(w.parse(e)):w.wrap90(Number(e)),isNaN(this._lat))throw new TypeError(`invalid latitude ‘${e}’`)}get lon(){return this._lon}get lng(){return this._lon}get longitude(){return this._lon}set lon(e){if(this._lon=isNaN(e)?w.wrap180(w.parse(e)):w.wrap180(Number(e)),isNaN(this._lon))throw new TypeError(`invalid lon ‘${e}’`)}set lng(e){if(this._lon=isNaN(e)?w.wrap180(w.parse(e)):w.wrap180(Number(e)),isNaN(this._lon))throw new TypeError(`invalid lng ‘${e}’`)}set longitude(e){if(this._lon=isNaN(e)?w.wrap180(w.parse(e)):w.wrap180(Number(e)),isNaN(this._lon))throw new TypeError(`invalid longitude ‘${e}’`)}get height(){return this._height}set height(e){if(this._height=Number(e),isNaN(this._height))throw new TypeError(`invalid height ‘${e}’`)}get datum(){return this._datum}set datum(e){this._datum=e}static get ellipsoids(){return S}static get datums(){return O}static parse(...e){if(0==e.length)throw new TypeError("invalid (empty) point");let t,r,n;if("object"==typeof e[0]&&(1==e.length||!isNaN(parseFloat(e[1])))){const a=e[0];if("Point"==a.type&&Array.isArray(a.coordinates)?([r,t,n]=a.coordinates,n=n||0):(null!=a.latitude&&(t=a.latitude),null!=a.lat&&(t=a.lat),null!=a.longitude&&(r=a.longitude),null!=a.lng&&(r=a.lng),null!=a.lon&&(r=a.lon),null!=a.height&&(n=a.height),t=w.wrap90(w.parse(t)),r=w.wrap180(w.parse(r))),null!=e[1]&&(n=e[1]),isNaN(t)||isNaN(r))throw new TypeError(`invalid point ‘${JSON.stringify(e[0])}’`)}if("string"==typeof e[0]&&2==e[0].split(",").length&&([t,r]=e[0].split(","),t=w.wrap90(w.parse(t)),r=w.wrap180(w.parse(r)),n=e[1]||0,isNaN(t)||isNaN(r)))throw new TypeError(`invalid point ‘${e[0]}’`);if(null==t&&null==r&&([t,r]=e,t=w.wrap90(w.parse(t)),r=w.wrap180(w.parse(r)),n=e[2]||0,isNaN(t)||isNaN(r)))throw new TypeError(`invalid point ‘${e.toString()}’`);return new this(t,r,n)}toCartesian(){const e=this.datum?this.datum.ellipsoid:this.referenceFrame?this.referenceFrame.ellipsoid:S.WGS84,t=this.lat.toRadians(),r=this.lon.toRadians(),n=this.height,{a:a,f:s}=e,i=Math.sin(t),o=Math.cos(t),l=Math.sin(r),c=Math.cos(r),u=2*s-s*s,h=a/Math.sqrt(1-u*i*i);return new T((h+n)*o*c,(h+n)*o*l,(h*(1-u)+n)*i)}equals(e){if(!(e instanceof N))throw new TypeError(`invalid point ‘${e}’`);return!(Math.abs(this.lat-e.lat)>Number.EPSILON)&&(!(Math.abs(this.lon-e.lon)>Number.EPSILON)&&(!(Math.abs(this.height-e.height)>Number.EPSILON)&&(this.datum==e.datum&&(this.referenceFrame==e.referenceFrame&&this.epoch==e.epoch))))}toString(e="d",t=void 0,r=null){if(!["d","dm","dms","n"].includes(e))throw new RangeError(`invalid format ‘${e}’`);const n=(this.height>=0?" +":" ")+this.height.toFixed(r)+"m";if("n"==e){null==t&&(t=4);return`${this.lat.toFixed(t)}, ${this.lon.toFixed(t)}${null==r?"":n}`}return`${w.toLat(this.lat,e,t)}, ${w.toLon(this.lon,e,t)}${null==r?"":n}`}}class T extends v{constructor(e,t,r){super(e,t,r)}toLatLon(e=S.WGS84){if(!e||!e.a)throw new TypeError(`invalid ellipsoid ‘${e}’`);const{x:t,y:r,z:n}=this,{a:a,b:s,f:i}=e,o=2*i-i*i,l=o/(1-o),c=Math.sqrt(t*t+r*r),u=s*n/(a*c)*(1+l*s/Math.sqrt(c*c+n*n)),h=u/Math.sqrt(1+u*u),d=h/u,p=isNaN(d)?0:Math.atan2(n+l*s*h*h*h,c-o*a*d*d*d),g=Math.atan2(r,t),f=Math.sin(p),m=c*Math.cos(p)+n*f-a*a/(a/Math.sqrt(1-o*f*f));return new N(p.toDegrees(),g.toDegrees(),m)}toString(e=0){return`[${this.x.toFixed(e)},${this.y.toFixed(e)},${this.z.toFixed(e)}]`}}const _={WGS84:{a:6378137,b:6356752.314245,f:1/298.257223563},Airy1830:{a:6377563.396,b:6356256.909,f:1/299.3249646},AiryModified:{a:6377340.189,b:6356034.448,f:1/299.3249646},Bessel1841:{a:6377397.155,b:6356078.962818,f:1/299.1528128},Clarke1866:{a:6378206.4,b:6356583.8,f:1/294.978698214},Clarke1880IGN:{a:6378249.2,b:6356515,f:1/293.466021294},GRS80:{a:6378137,b:6356752.31414,f:1/298.257222101},Intl1924:{a:6378388,b:6356911.946,f:1/297},WGS72:{a:6378135,b:6356750.5,f:1/298.26}},x={ED50:{ellipsoid:_.Intl1924,transform:[89.5,93.8,123.1,-1.2,0,0,.156]},ETRS89:{ellipsoid:_.GRS80,transform:[0,0,0,0,0,0,0]},Irl1975:{ellipsoid:_.AiryModified,transform:[-482.53,130.596,-564.557,-8.15,1.042,.214,.631]},NAD27:{ellipsoid:_.Clarke1866,transform:[8,-160,-176,0,0,0,0]},NAD83:{ellipsoid:_.GRS80,transform:[.9956,-1.9103,-.5215,-62e-5,.025915,.009426,.011599]},NTF:{ellipsoid:_.Clarke1880IGN,transform:[168,60,-320,0,0,0,0]},OSGB36:{ellipsoid:_.Airy1830,transform:[-446.448,125.157,-542.06,20.4894,-.1502,-.247,-.8421]},Potsdam:{ellipsoid:_.Bessel1841,transform:[-582,-105,-414,-8.3,1.04,.35,-3.08]},TokyoJapan:{ellipsoid:_.Bessel1841,transform:[148,-507,-685,0,0,0,0]},WGS72:{ellipsoid:_.WGS72,transform:[0,0,-4.5,-.22,0,0,.554]},WGS84:{ellipsoid:_.WGS84,transform:[0,0,0,0,0,0,0]}};Object.keys(_).forEach(e=>Object.freeze(_[e])),Object.keys(x).forEach(e=>{Object.freeze(x[e]),Object.freeze(x[e].transform)});class M extends N{constructor(e,t,r=0,n=x.WGS84){if(!n||null==n.ellipsoid)throw new TypeError(`unrecognised datum ‘${n}’`);super(e,t,r),this._datum=n}get datum(){return this._datum}static get ellipsoids(){return _}static get datums(){return x}static parse(...e){let t=x.WGS84;if((4==e.length||3==e.length&&"object"==typeof e[2])&&(t=e.pop()),!t||null==t.ellipsoid)throw new TypeError(`unrecognised datum ‘${t}’`);const r=super.parse(...e);return r._datum=t,r}convertDatum(e){if(!e||null==e.ellipsoid)throw new TypeError(`unrecognised datum ‘${e}’`);return this.toCartesian().convertDatum(e).toLatLon()}toCartesian(){const e=super.toCartesian();return new D(e.x,e.y,e.z,this.datum)}}class D extends T{constructor(e,t,r,n=void 0){if(n&&null==n.ellipsoid)throw new TypeError(`unrecognised datum ‘${n}’`);super(e,t,r),n&&(this._datum=n)}get datum(){return this._datum}set datum(e){if(!e||null==e.ellipsoid)throw new TypeError(`unrecognised datum ‘${e}’`);this._datum=e}toLatLon(e=void 0){e&&(console.info("datum parameter to Cartesian_Datum.toLatLon is deprecated: set datum before calling toLatLon()"),this.datum=e);const t=this.datum||x.WGS84;if(!t||null==t.ellipsoid)throw new TypeError(`unrecognised datum ‘${t}’`);const r=super.toLatLon(t.ellipsoid);return new M(r.lat,r.lon,r.height,this.datum)}convertDatum(e){if(!e||null==e.ellipsoid)throw new TypeError(`unrecognised datum ‘${e}’`);if(!this.datum)throw new TypeError("cartesian coordinate has no datum");let t=null,r=null;null!=this.datum&&this.datum!=x.WGS84||(t=this,r=e.transform),e==x.WGS84&&(t=this,r=this.datum.transform.map(e=>-e)),null==r&&(t=this.convertDatum(x.WGS84),r=e.transform);const n=t.applyTransform(r);return n.datum=e,n}applyTransform(e){const{x:t,y:r,z:n}=this,a=e[0],s=e[1],i=e[2],o=e[3]/1e6+1,l=(e[4]/3600).toRadians(),c=(e[5]/3600).toRadians(),u=(e[6]/3600).toRadians();return new D(a+t*o-r*u+n*c,s+t*u+r*o-n*l,i-t*c+r*l+n*o)}}const j={trueOrigin:{lat:49,lon:-2},scaleFactor:.9996012717,ellipsoid:M.ellipsoids.Airy1830};class R{constructor(e,t){if(this.easting=Number(e),this.northing=Number(t),isNaN(e)||this.easting<0||this.easting>7e5)throw new RangeError(`invalid easting ‘${e}’`);if(isNaN(t)||this.northing<0||this.northing>13e5)throw new RangeError(`invalid northing ‘${t}’`)}toLatLon(e=M.datums.WGS84){const{easting:t,northing:r}=this,{a:n,b:a}=j.ellipsoid,s=j.trueOrigin.lat.toRadians(),i=j.trueOrigin.lon.toRadians(),o=-1e5,l=j.scaleFactor,c=1-a*a/(n*n),u=(n-a)/(n+a),h=u*u,d=u*u*u;let p=s,g=0;do{p=(r-o-g)/(n*l)+p;g=a*l*((1+u+5/4*h+5/4*d)*(p-s)-(3*u+3*u*u+21/8*d)*Math.sin(p-s)*Math.cos(p+s)+(15/8*h+15/8*d)*Math.sin(2*(p-s))*Math.cos(2*(p+s))-35/24*d*Math.sin(3*(p-s))*Math.cos(3*(p+s)))}while(Math.abs(r-o-g)>=1e-5);const f=Math.cos(p),m=Math.sin(p),y=n*l/Math.sqrt(1-c*m*m),b=n*l*(1-c)/Math.pow(1-c*m*m,1.5),E=y/b-1,w=Math.tan(p),v=w*w,S=v*v,O=1/f,N=y*y*y,T=N*y*y,_=t-4e5,x=_*_,D=x*_,R=x*x,P=D*x;p=p-w/(2*b*y)*x+w/(24*b*N)*(5+3*v+E-9*v*E)*R-w/(720*b*T)*(61+90*v+45*S)*(R*x);const k=i+O/y*_-O/(6*N)*(y/b+2*v)*D+O/(120*T)*(5+28*v+24*S)*P-O/(5040*(T*y*y))*(61+662*v+1320*S+720*(S*v))*(P*x);let C=new G(p.toDegrees(),k.toDegrees(),0,M.datums.OSGB36);return e!=M.datums.OSGB36&&(C=C.convertDatum(e),C=new G(C.lat,C.lon,C.height,C.datum)),C}static parse(e){let t=(e=String(e).trim()).match(/^(\d+),\s*(\d+)$/);if(t)return new R(t[1],t[2]);if(t=e.match(/^[HNST][ABCDEFGHJKLMNOPQRSTUVWXYZ]\s*[0-9]+\s*[0-9]+$/i),!t)throw new Error(`invalid grid reference ‘${e}’`);let r=e.toUpperCase().charCodeAt(0)-"A".charCodeAt(0),n=e.toUpperCase().charCodeAt(1)-"A".charCodeAt(0);r>7&&r--,n>7&&n--;const a=(r-2)%5*5+n%5,s=19-5*Math.floor(r/5)-Math.floor(n/5);let i=e.slice(2).trim().split(/\s+/);if(1==i.length&&(i=[i[0].slice(0,i[0].length/2),i[0].slice(i[0].length/2)]),i[0].length!=i[1].length)throw new Error(`invalid grid reference ‘${e}’`);i[0]=i[0].padEnd(5,"0"),i[1]=i[1].padEnd(5,"0");const o=a+i[0],l=s+i[1];return new R(o,l)}toString(e=10){if(![0,2,4,6,8,10,12,14,16].includes(Number(e)))throw new RangeError(`invalid precision ‘${e}’`);let{easting:t,northing:r}=this;if(0==e){const e={useGrouping:!1,minimumIntegerDigits:6,maximumFractionDigits:3};return`${t.toLocaleString("en",e)},${r.toLocaleString("en",e)}`}const n=Math.floor(t/1e5),a=Math.floor(r/1e5);let s=19-a-(19-a)%5+Math.floor((n+10)/5),i=5*(19-a)%25+n%5;s>7&&s++,i>7&&i++;const o=String.fromCharCode(s+"A".charCodeAt(0),i+"A".charCodeAt(0));return t=Math.floor(t%1e5/Math.pow(10,5-e/2)),r=Math.floor(r%1e5/Math.pow(10,5-e/2)),t=t.toString().padStart(e/2,"0"),r=r.toString().padStart(e/2,"0"),`${o} ${t} ${r}`}}class G extends M{toOsGrid(){const e=this.datum==M.datums.OSGB36?this:this.convertDatum(M.datums.OSGB36),t=e.lat.toRadians(),r=e.lon.toRadians(),{a:n,b:a}=j.ellipsoid,s=j.trueOrigin.lat.toRadians(),i=j.trueOrigin.lon.toRadians(),o=j.scaleFactor,l=1-a*a/(n*n),c=(n-a)/(n+a),u=c*c,h=c*c*c,d=Math.cos(t),p=Math.sin(t),g=n*o/Math.sqrt(1-l*p*p),f=n*o*(1-l)/Math.pow(1-l*p*p,1.5),m=g/f-1,y=a*o*((1+c+5/4*u+5/4*h)*(t-s)-(3*c+3*c*c+21/8*h)*Math.sin(t-s)*Math.cos(t+s)+(15/8*u+15/8*h)*Math.sin(2*(t-s))*Math.cos(2*(t+s))-35/24*h*Math.sin(3*(t-s))*Math.cos(3*(t+s))),b=d*d*d,E=b*d*d,w=Math.tan(t)*Math.tan(t),v=w*w,S=r-i,O=S*S,N=O*S,T=N*S,_=T*S;let x=y+-1e5+g/2*p*d*O+g/24*p*b*(5-w+9*m)*T+g/720*p*E*(61-58*w+v)*(_*S),D=4e5+g*d*S+g/6*b*(g/f-w)*N+g/120*E*(5-18*w+v+14*m-58*w*m)*_;x=Number(x.toFixed(3)),D=Number(D.toFixed(3));try{return new R(D,x)}catch(t){throw new Error(`${t.message} from (${e.lat.toFixed(6)},${e.lon.toFixed(6)}).toOsGrid()`)}}convertDatum(e){const t=super.convertDatum(e);return new G(t.lat,t.lon,t.height,t.datum)}}var P;function k(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function C(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?k(Object(r),!0).forEach(function(t){a(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):k(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var L=500,I=e=>{var t=e.GAZETTEER_ENTRY,r="eng"===t.NAME2_LANG?t.NAME2:t.NAME1;return e.GAZETTEER_ENTRY.NAME1=r,e.GAZETTEER_ENTRY.NAME1_LANG="eng",e},A=(e,t)=>{var r,n,a,s,{MBR_XMIN:i,MBR_YMIN:o,MBR_XMAX:l,MBR_YMAX:c,GEOMETRY_X:u,GEOMETRY_Y:h}=t;if(null==i?(r=u-L,n=h-L,a=u+L,s=h+L):(r=i,n=o,a=l,s=c),"EPSG:27700"===e)return[r,n,a,s];if("EPSG:4326"===e){var d=new R(r,n).toLatLon(),p=new R(a,s).toLatLon();return[d.lon,d.lat,p.lon,p.lat].map(e=>Math.round(1e6*e)/1e6)}throw new Error("Unsupported CRS: ".concat(e))},$=(e,t)=>{var{GEOMETRY_X:r,GEOMETRY_Y:n}=t;if("EPSG:27700"===e)return[r,n];if("EPSG:4326"===e){var a=new R(r,n).toLatLon();return[Math.round(1e6*a.lon)/1e6,Math.round(1e6*a.lat)/1e6]}throw new Error("Unsupported CRS: ".concat(e))},F=function(e,t,r,n){var a,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:8;if(!e||e.error||0===(null===(a=e.header)||void 0===a?void 0:a.totalresults))return[];var o=e.results;return o=((e,t)=>{var r=t.toLowerCase().replace(/,/g,"").split(" ");return e.map(I).filter(e=>r.some(r=>{return e.GAZETTEER_ENTRY.NAME1.toLowerCase().includes(r)||(n=(n=t).replace(/\s/g,""),/^(([A-Z]{1,2}\d[A-Z\d]?|ASCN|STHL|TDCU|BBND|[BFS]IQQ|PCRN|TKCA) ?\d[A-Z]{2}|BFPO ?\d{1,4}|(KY\d|MSR|VG|AI)[ -]?\d{4}|[A-Z]{2} ?\d{2}|GE ?CX|GIR ?0A{2}|SAN ?TA1)$/i.test(n));var n}))})(o,t),o=((e,t)=>e.filter(e=>{var r,n=null==e||null===(r=e.GAZETTEER_ENTRY)||void 0===r||null===(r=r.COUNTRY)||void 0===r?void 0:r.toLowerCase();return n&&t.includes(n)}))(o=(e=>Array.from(new Map(e.map(e=>[e.GAZETTEER_ENTRY.ID,e])).values()))(o),r),(o=o.slice(0,s)).map(e=>C(C({id:e.GAZETTEER_ENTRY.ID,bounds:A(n,e.GAZETTEER_ENTRY),point:$(n,e.GAZETTEER_ENTRY)},((e,t)=>{var r,n,a,s,{NAME1:o,COUNTY_UNITARY:l,DISTRICT_BOROUGH:c,POSTCODE_DISTRICT:u,LOCAL_TYPE:h}=t,d="".concat(["City","Postcode"].includes(h)?"":u+", ").concat("City"===h?"":l||c),p="".concat(o).concat(d?", "+d:"");return{text:p,marked:(r=p,n=e,a=n.replace(/\s+/g,"").split("").join(String.raw(P||(P=i(["s*"],["\\s*"])))),s=new RegExp("(".concat(a,")"),"i"),r.replace(s,"<mark>$1</mark>"))}})(t,e.GAZETTEER_ENTRY)),{},{type:"os-names"}))};var W=e=>{var{url:t,options:r}=e;return new Request(t,r)},U=function(){var e=o(function*(e,t,r){var n,a={url:null===(n=e.urlTemplate)||void 0===n?void 0:n.replace("{query}",encodeURIComponent(t)),options:{method:"GET"}};if(e.buildRequest){var s=e.buildRequest(t,()=>a);return s instanceof Request?s:W(s)}return W(r?yield r(a,t):a)});return function(t,r,n){return e.apply(this,arguments)}}(),B=function(){var e=o(function*(e,t,r){try{var n=yield fetch(t);if(!n.ok)return console.error("Fetch error for ".concat(e.label||"dataset",": ").concat(n.status)),{error:!0};var a=yield n.json();return e.parseResults(a,r)}catch(t){return console.error("Network error for ".concat(e.label||"dataset",":"),t),{error:!0}}});return function(t,r,n){return e.apply(this,arguments)}}(),z=function(){var e=o(function*(e,t,r,n){var a=(e=>e.replaceAll(/[^a-zA-Z0-9\s\-.,]/g,"").trim())(e),s=t.filter(t=>{var r=!t.includeRegex||t.includeRegex.test(e),n=!!t.excludeRegex&&t.excludeRegex.test(a);return r&&!n}),i=[],o=!1;for(var l of s){var c=yield U(l,a,n),u=yield B(l,c,a);if(null!=u&&u.error?o=!0:null!=u&&u.length&&(i=[...i,...u]),l.exclusive&&i.length)break}return r({type:"UPDATE_SUGGESTIONS",payload:{results:i,hasError:o}}),{results:i,sanitisedValue:a}});return function(t,r,n,a){return e.apply(this,arguments)}}();function V(e){var{mapProvider:t,bounds:r,point:n,markers:a,showMarker:s,markerOptions:i}=e;t.fitToBounds(r),s&&a.add("search",n,i)}function Y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function H(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Y(Object(r),!0).forEach(function(t){a(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Y(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function q(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}var Z=e=>{var{dispatch:t,services:r,mapProvider:n,markers:s,showMarker:i,markerOptions:o,viewportRef:l}=e,c=(e,t)=>{var r;return t>=0?"".concat(null===(r=e[t])||void 0===r?void 0:r.text,". ").concat(t+1," of ").concat(e.length," is highlighted"):"".concat(e.length," suggestions available")};return{handleSuggestionClick(e,c){var u;t({type:"SET_VALUE",payload:e.text}),t({type:"HIDE_SUGGESTIONS"}),t({type:"SET_SELECTED",payload:-1}),"mobile"===c.breakpoint&&(t({type:"TOGGLE_EXPANDED",payload:!1}),r.eventBus.emit("search:close")),null===(u=l.current)||void 0===u||u.focus(),V({mapProvider:n,bounds:e.bounds,point:e.point,markers:s,showMarker:i,markerOptions:o}),r.eventBus.emit("search:match",function(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){a(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}({query:e.text},e))},handleInputKeyDown(e,n){var{suggestions:a,selectedIndex:s}=n;switch(e.key){case"ArrowDown":if(null==a||!a.length)return;if(e.preventDefault(),s<a.length-1){var i=s+1;r.announce(c(a,i)),t({type:"SET_SELECTED",payload:i}),t({type:"SET_KEYBOARD_FOCUS_WITHIN",payload:!1})}break;case"ArrowUp":if(null==a||!a.length)return;e.preventDefault();var o=s>0?s-1:-1;r.announce(c(a,o)),t({type:"SET_SELECTED",payload:o}),t({type:"SET_KEYBOARD_FOCUS_WITHIN",payload:o<0});break;case"Escape":e.preventDefault(),t({type:"HIDE_SUGGESTIONS"}),t({type:"SET_SELECTED",payload:-1})}}}};function K(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function X(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?K(Object(r),!0).forEach(function(t){a(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):K(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function J(e){var t,r,n,a,{dispatch:s,searchContainerRef:i}=e,c=(t=t=>z(t,e.datasets,s,e.transformRequest),r=350,n=null,a=function(){for(var e=arguments.length,a=new Array(e),s=0;s<e;s++)a[s]=arguments[s];clearTimeout(n),n=setTimeout(()=>{t(...a)},r)},a.cancel=()=>{n&&(clearTimeout(n),n=null)},a),u=(e=>{var{dispatch:t,services:r,viewportRef:n,mapProvider:a,markers:s,datasets:i,transformRequest:c,showMarker:u,markerOptions:h}=e,d="";return{handleOpenClick(){t({type:"TOGGLE_EXPANDED",payload:!0}),r.eventBus.emit("search:open")},handleCloseClick(e,n){t({type:"TOGGLE_EXPANDED",payload:!1}),t({type:"UPDATE_SUGGESTIONS",payload:{results:[],hasError:!1}}),t({type:"SET_VALUE",payload:""}),setTimeout(()=>n.current.focus(),0),s.remove("search"),r.eventBus.emit("search:clear"),r.eventBus.emit("search:close")},handleSubmit:(e,p,g)=>o(function*(){e.preventDefault();var{suggestions:o,selectedIndex:f,value:m}=g,y=null==m?void 0:m.trim();if(t({type:"SET_SELECTED",payload:-1}),t({type:"HIDE_SUGGESTIONS"}),f>=0){var b,E=o[f];return t({type:"SET_VALUE",payload:E.text}),null===(b=n.current)||void 0===b||b.focus(),V({mapProvider:a,bounds:E.bounds,point:E.point,markers:s,showMarker:u,markerOptions:h}),void r.eventBus.emit("search:match",H({query:E.text},E))}if(!((null==y?void 0:y.length)<l.minSearchLength)){var w=o;if(!o.length||y!==d){var{results:v,sanitisedValue:S}=yield z(y,i,t,c);w=v,d=S}if(w.length){var O;null===(O=n.current)||void 0===O||O.focus(),"mobile"===p.breakpoint&&(t({type:"TOGGLE_EXPANDED",payload:!1}),r.eventBus.emit("search:close"));var N=w[0];V({mapProvider:a,bounds:N.bounds,point:N.point,markers:s,showMarker:u,markerOptions:h}),r.eventBus.emit("search:match",H({query:m},N))}}})()}})(e),h=(e=>{var{dispatch:t,debouncedFetchSuggestions:r}=e;return{handleInputClick(){t({type:"SHOW_SUGGESTIONS"})},handleInputFocus(e){t({type:"SET_KEYBOARD_FOCUS_WITHIN",payload:"keyboard"===e})},handleInputBlur(e){t({type:"INPUT_BLUR",payload:e})},handleInputChange(e){var n=e.target.value;if(t({type:"SET_VALUE",payload:n}),n.length<l.minSearchLength)return r.cancel(),t({type:"UPDATE_SUGGESTIONS",payload:{results:[],hasError:!1}}),void t({type:"HIDE_SUGGESTIONS"});t({type:"SHOW_SUGGESTIONS"}),r(n)}}})(X(X({},e),{},{debouncedFetchSuggestions:c})),d=Z(e);return X(X(X(X({},u),h),d),{},{handleOutside(t){i.current.contains(t.target)||(s({type:"TOGGLE_EXPANDED",payload:!1}),e.services.eventBus.emit("search:close"))}})}var Q=["marker"];function ee(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}var te={reducer:{initialState:{isExpanded:!1,hasKeyboardFocusWithin:!1,value:"",suggestions:[],areSuggestionsVisible:!1,hasFetchedSuggestions:!1,hasSearchError:!1,selectedIndex:-1},actions:h},controls:[{id:"search",mobile:{slot:"top-right",showLabel:!1},tablet:{slot:"top-left",showLabel:!1},desktop:{slot:"top-left",showLabel:!1},render:function(i){var o,{appConfig:l,iconRegistry:c,pluginState:u,pluginConfig:h,appState:p,mapState:g,services:f,mapProvider:E}=i,{id:w}=l,{interfaceType:v}=p,{expanded:S,customDatasets:O,osNamesURL:N,regions:T,maxSuggestions:_}=h,{dispatch:x,isExpanded:M,areSuggestionsVisible:D,suggestions:j}=u,R=(null==p||null===(o=p.controlConfig)||void 0===o||null===(o=o.search)||void 0===o?void 0:o[null==p?void 0:p.breakpoint].showLabel)||!1,G=c.close,P=c.search,k=t(null),C=t(null),L=t(null),I=p.layoutRefs.viewportRef,A=function(e){var{customDatasets:t=[],osNamesURL:r,crs:n,regions:a=["england","scotland","wales"],maxSuggestions:s}=e;return r?[{name:"osNames",urlTemplate:r,parseResults:(e,t)=>F(e,t,a,n,s),includeRegex:/[a-zA-Z0-9]/,excludeRegex:/^(?:[a-z]{2}\s*(?:\d{3}\s*\d{3}|\d{4}\s*\d{4}|\d{5}\s*\d{5})|\d+\s*,?\s*\d+)$/i},...t]:t}({customDatasets:O,osNamesURL:N,regions:T,maxSuggestions:_,crs:E.crs}),$=t(null);if(!$.current){var{marker:W}=h,U=s(h,Q);$.current=J(function(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){a(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}({dispatch:x,datasets:A,services:f,mapProvider:E,viewportRef:I,searchContainerRef:k,markers:g.markers,markerOptions:W},U))}var B=$.current,z=M||!!(S&&D&&j.length);return e(()=>{var e;M&&(null===(e=L.current)||void 0===e||e.focus())},[M]),e(()=>{if(p.dispatch({type:"TOGGLE_HAS_EXCLUSIVE_CONTROL",payload:M}),z)return I.current.style.pointerEvents="none",document.addEventListener("focusin",B.handleOutside),document.addEventListener("pointerdown",B.handleOutside),()=>{I.current.style.pointerEvents="auto",document.removeEventListener("focusin",B.handleOutside),document.removeEventListener("pointerdown",B.handleOutside)}},[M,v,D,j]),r("div",{className:"im-c-search",ref:k,children:[!S&&n(d,{id:w,isExpanded:M,onClick:()=>B.handleOpenClick(p),buttonRef:C,searchIcon:P,showLabel:R}),r(m,{id:w,pluginState:u,pluginConfig:h,appState:p,inputRef:L,events:B,services:f,children:[n(y,{defaultExpanded:S,onClick:e=>B.handleCloseClick(e,C,p),closeIcon:G}),n(b,{defaultExpanded:S,onClick:e=>B.handleCloseClick(e,C,p),submitIcon:P})]})]})}}],icons:[{id:"search",svgContent:'<path d="m21 21-4.34-4.34"></path><circle cx="11" cy="11" r="8"></circle>'}]},re=Object.freeze({__proto__:null,manifest:te});export{l as D,re as m};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/asyncToGenerator";import r from"@babel/runtime/helpers/defineProperty";function
|
|
1
|
+
import e from"@babel/runtime/helpers/asyncToGenerator";import r from"@babel/runtime/helpers/defineProperty";import{D as t}from"./im-search-plugin.js";import"preact/compat";import"preact/jsx-runtime";import"@babel/runtime/helpers/objectWithoutProperties";import"@babel/runtime/helpers/taggedTemplateLiteral";function n(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function o(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?n(Object(o),!0).forEach(function(t){r(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):n(Object(o)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(o,r))})}return e}function i(){var r,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o(o(o(o({},t),n),n.expanded&&{manifest:{controls:[{id:"search",mobile:{slot:"banner"}}]}}),{},{id:"search",load:(r=e(function*(){return(yield import(/* webpackChunkName: "im-search-plugin" */ "./im-search-plugin.js").then(function(e){return e.m})).manifest}),function(){return r.apply(this,arguments)})})}export{i as default};
|